From: Andrea Cuccaro Date: Thu, 30 Sep 2021 09:53:20 +0000 (+0200) Subject: Built motion from commit d62f9d50.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22%7B%7Blicense.fax?a=commitdiff_plain;h=d0187c2045535a70324fb8af354784ac1c962452;p=motion2.git Built motion from commit d62f9d50.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index f54d75d..bb7c429 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-09-30T09:10:30.490Z", + "time": "2021-09-30T09:44:15.318Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index fff9a38..e51665b 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-30T09:10:30.490Z", + "time": "2021-09-30T09:44:15.318Z", "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 2256a09..324589a 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 _0xc077=['VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xc077,0x16f));var _0x7c07=function(_0x1613d9,_0x2f583e){_0x1613d9=_0x1613d9-0x0;var _0x1ab5e0=_0xc077[_0x1613d9];return _0x1ab5e0;};'use strict';var Sequelize=require('sequelize');module[_0x7c07('0x0')]={'name':{'type':Sequelize[_0x7c07('0x1')],'get':function(_0x324e08){return this[_0x7c07('0x2')]('action');}},'action':{'type':Sequelize[_0x7c07('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7c07('0x4'),_0x7c07('0x5'),_0x7c07('0x6'),_0x7c07('0x7'),_0x7c07('0x8'),_0x7c07('0x9'),_0x7c07('0xa'),'script']],'msg':_0x7c07('0xb')}},'comment':_0x7c07('0xb')},'data1':{'type':Sequelize[_0x7c07('0x3')](0x1000),'comment':_0x7c07('0xc')},'data2':{'type':Sequelize[_0x7c07('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x7c07('0x3')](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[_0x7c07('0x3')](0x1000),'comments':_0x7c07('0xd')},'data6':{'type':Sequelize[_0x7c07('0x3')],'comments':_0x7c07('0xe')},'data7':{'type':Sequelize['TEXT'],'comments':_0x7c07('0xf')}}; \ No newline at end of file +var _0xbc75=['TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbc75,0xad));var _0x5bc7=function(_0x5c5479,_0x3c8617){_0x5c5479=_0x5c5479-0x0;var _0xff9413=_0xbc75[_0x5c5479];return _0xff9413;};'use strict';var Sequelize=require(_0x5bc7('0x0'));module['exports']={'name':{'type':Sequelize[_0x5bc7('0x1')],'get':function(_0x16a00d){return this[_0x5bc7('0x2')](_0x5bc7('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5bc7('0x4'),_0x5bc7('0x5'),_0x5bc7('0x6'),'urlForward',_0x5bc7('0x7'),_0x5bc7('0x8'),_0x5bc7('0x9')]],'msg':_0x5bc7('0xa')}},'comment':_0x5bc7('0xa')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comment':_0x5bc7('0xc')},'data3':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comment':_0x5bc7('0xd')},'data4':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comments':_0x5bc7('0xe')},'data5':{'type':Sequelize[_0x5bc7('0xb')](0x1000),'comments':_0x5bc7('0xf')},'data6':{'type':Sequelize[_0x5bc7('0xb')],'comments':_0x5bc7('0x10')},'data7':{'type':Sequelize[_0x5bc7('0x11')],'comments':_0x5bc7('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index fe754e2..33114db 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 _0x3a12=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','destroy','sendStatus','error','stack','name','send','body','find','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3cea78,_0x4a6751){var _0x33b66b=function(_0x1f45cd){while(--_0x1f45cd){_0x3cea78['push'](_0x3cea78['shift']());}};_0x33b66b(++_0x4a6751);}(_0x3a12,0xf6));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x23a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x23a1('0x1'));var jsonpatch=require(_0x23a1('0x2'));var rp=require(_0x23a1('0x3'));var moment=require(_0x23a1('0x4'));var BPromise=require(_0x23a1('0x5'));var Mustache=require('mustache');var util=require(_0x23a1('0x6'));var path=require(_0x23a1('0x7'));var sox=require(_0x23a1('0x8'));var csv=require(_0x23a1('0x9'));var ejs=require(_0x23a1('0xa'));var fs=require('fs');var fs_extra=require(_0x23a1('0xb'));var _=require(_0x23a1('0xc'));var squel=require(_0x23a1('0xd'));var crypto=require(_0x23a1('0xe'));var jsforce=require(_0x23a1('0xf'));var deskjs=require(_0x23a1('0x10'));var toCsv=require(_0x23a1('0x9'));var querystring=require(_0x23a1('0x11'));var Papa=require(_0x23a1('0x12'));var Redis=require(_0x23a1('0x13'));var authService=require(_0x23a1('0x14'));var qs=require(_0x23a1('0x15'));var as=require(_0x23a1('0x16'));var hardwareService=require(_0x23a1('0x17'));var logger=require(_0x23a1('0x18'))(_0x23a1('0x19'));var utils=require(_0x23a1('0x1a'));var config=require(_0x23a1('0x1b'));var licenseUtil=require(_0x23a1('0x1c'));var db=require(_0x23a1('0x1d'))['db'];function respondWithStatusCode(_0x35a648,_0x39947a){_0x39947a=_0x39947a||0xcc;return function(_0x4f3f32){if(_0x4f3f32){return _0x35a648['sendStatus'](_0x39947a);}return _0x35a648[_0x23a1('0x1e')](_0x39947a)[_0x23a1('0x1f')]();};}function respondWithResult(_0x2ea8f2,_0x185709){_0x185709=_0x185709||0xc8;return function(_0x4b4dae){if(_0x4b4dae){return _0x2ea8f2[_0x23a1('0x1e')](_0x185709)['json'](_0x4b4dae);}};}function respondWithFilteredResult(_0xd93552,_0x472772){return function(_0x128842){if(_0x128842){var _0x46ba9d=typeof _0x472772[_0x23a1('0x20')]===_0x23a1('0x21')&&typeof _0x472772[_0x23a1('0x22')]===_0x23a1('0x21');var _0x3e5528=_0x128842[_0x23a1('0x23')];var _0x104eed=_0x46ba9d?0x0:_0x472772[_0x23a1('0x20')];var _0x252554=_0x46ba9d?_0x128842[_0x23a1('0x23')]:_0x472772[_0x23a1('0x20')]+_0x472772[_0x23a1('0x22')];var _0x25a1a2;if(_0x252554>=_0x3e5528){_0x252554=_0x3e5528;_0x25a1a2=0xc8;}else{_0x25a1a2=0xce;}_0xd93552['status'](_0x25a1a2);return _0xd93552[_0x23a1('0x24')](_0x23a1('0x25'),_0x104eed+'-'+_0x252554+'/'+_0x3e5528)[_0x23a1('0x26')](_0x128842);}return null;};}function patchUpdates(_0x3a55fe){return function(_0x1f9b2b){try{jsonpatch[_0x23a1('0x27')](_0x1f9b2b,_0x3a55fe,!![]);}catch(_0x35ff42){return BPromise['reject'](_0x35ff42);}return _0x1f9b2b['save']();};}function saveUpdates(_0x5bf48d,_0x3d19b2){return function(_0x2e97af){if(_0x2e97af){return _0x2e97af[_0x23a1('0x28')](_0x5bf48d)[_0x23a1('0x29')](function(_0x334e63){return _0x334e63;});}return null;};}function removeEntity(_0x564d66,_0x17ceb0){return function(_0x16f3f8){if(_0x16f3f8){return _0x16f3f8[_0x23a1('0x2a')]()['then'](function(){_0x564d66[_0x23a1('0x1e')](0xcc)[_0x23a1('0x1f')]();});}};}function handleEntityNotFound(_0x3aa31f,_0xa69c79){return function(_0x58972e){if(!_0x58972e){_0x3aa31f[_0x23a1('0x2b')](0x194);}return _0x58972e;};}function handleError(_0x97728e,_0x4c4645){_0x4c4645=_0x4c4645||0x1f4;return function(_0x109b30){logger[_0x23a1('0x2c')](_0x109b30[_0x23a1('0x2d')]);if(_0x109b30[_0x23a1('0x2e')]){delete _0x109b30[_0x23a1('0x2e')];}_0x97728e[_0x23a1('0x1e')](_0x4c4645)[_0x23a1('0x2f')](_0x109b30);};}exports[_0x23a1('0x28')]=function(_0x572c52,_0xd69d92){if(_0x572c52[_0x23a1('0x30')]['id']){delete _0x572c52[_0x23a1('0x30')]['id'];}return db['Action'][_0x23a1('0x31')]({'where':{'id':_0x572c52['params']['id']}})[_0x23a1('0x29')](handleEntityNotFound(_0xd69d92,null))[_0x23a1('0x29')](saveUpdates(_0x572c52['body'],null))[_0x23a1('0x29')](respondWithResult(_0xd69d92,null))[_0x23a1('0x32')](handleError(_0xd69d92,null));};exports[_0x23a1('0x2a')]=function(_0x333701,_0x427021){return db['Action'][_0x23a1('0x31')]({'where':{'id':_0x333701[_0x23a1('0x33')]['id']}})[_0x23a1('0x29')](handleEntityNotFound(_0x427021,null))[_0x23a1('0x29')](removeEntity(_0x427021,null))[_0x23a1('0x32')](handleError(_0x427021,null));}; \ No newline at end of file +var _0xac6b=['request-promise','moment','bluebird','mustache','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','end','error','stack','name','send','update','body','Action','find','params','catch','eml-format','zip-dir'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0xac6b,0x181));var _0xbac6=function(_0x438f87,_0x545cc6){_0x438f87=_0x438f87-0x0;var _0x13ff7d=_0xac6b[_0x438f87];return _0x13ff7d;};'use strict';var emlformat=require(_0xbac6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbac6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbac6('0x2'));var moment=require(_0xbac6('0x3'));var BPromise=require(_0xbac6('0x4'));var Mustache=require(_0xbac6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbac6('0x6'));var ejs=require(_0xbac6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbac6('0x8'));var crypto=require(_0xbac6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbac6('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbac6('0xb'));var Papa=require(_0xbac6('0xc'));var Redis=require(_0xbac6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbac6('0xe'));var as=require(_0xbac6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbac6('0x10'))(_0xbac6('0x11'));var utils=require('../../config/utils');var config=require(_0xbac6('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xbac6('0x13'))['db'];function respondWithStatusCode(_0x5e17cf,_0x50de4c){_0x50de4c=_0x50de4c||0xcc;return function(_0x15666b){if(_0x15666b){return _0x5e17cf[_0xbac6('0x14')](_0x50de4c);}return _0x5e17cf[_0xbac6('0x15')](_0x50de4c)['end']();};}function respondWithResult(_0x1c1cef,_0x13ad0){_0x13ad0=_0x13ad0||0xc8;return function(_0xb09d2c){if(_0xb09d2c){return _0x1c1cef[_0xbac6('0x15')](_0x13ad0)['json'](_0xb09d2c);}};}function respondWithFilteredResult(_0x48eabe,_0x5c3739){return function(_0xed785e){if(_0xed785e){var _0xdc357f=typeof _0x5c3739[_0xbac6('0x16')]===_0xbac6('0x17')&&typeof _0x5c3739['limit']==='undefined';var _0x2cb573=_0xed785e[_0xbac6('0x18')];var _0x3fa9ab=_0xdc357f?0x0:_0x5c3739[_0xbac6('0x16')];var _0x3083aa=_0xdc357f?_0xed785e['count']:_0x5c3739[_0xbac6('0x16')]+_0x5c3739[_0xbac6('0x19')];var _0x5e0023;if(_0x3083aa>=_0x2cb573){_0x3083aa=_0x2cb573;_0x5e0023=0xc8;}else{_0x5e0023=0xce;}_0x48eabe['status'](_0x5e0023);return _0x48eabe[_0xbac6('0x1a')](_0xbac6('0x1b'),_0x3fa9ab+'-'+_0x3083aa+'/'+_0x2cb573)['json'](_0xed785e);}return null;};}function patchUpdates(_0x56b427){return function(_0x37f366){try{jsonpatch['apply'](_0x37f366,_0x56b427,!![]);}catch(_0x4b6be4){return BPromise[_0xbac6('0x1c')](_0x4b6be4);}return _0x37f366[_0xbac6('0x1d')]();};}function saveUpdates(_0x1e712d,_0x526382){return function(_0x1c3d84){if(_0x1c3d84){return _0x1c3d84['update'](_0x1e712d)[_0xbac6('0x1e')](function(_0x411622){return _0x411622;});}return null;};}function removeEntity(_0x487d11,_0x43de21){return function(_0x5364d3){if(_0x5364d3){return _0x5364d3[_0xbac6('0x1f')]()[_0xbac6('0x1e')](function(){_0x487d11[_0xbac6('0x15')](0xcc)[_0xbac6('0x20')]();});}};}function handleEntityNotFound(_0x1c4ea2,_0x5e76af){return function(_0x75ebbc){if(!_0x75ebbc){_0x1c4ea2[_0xbac6('0x14')](0x194);}return _0x75ebbc;};}function handleError(_0xecc2ba,_0x20c145){_0x20c145=_0x20c145||0x1f4;return function(_0x5ee747){logger[_0xbac6('0x21')](_0x5ee747[_0xbac6('0x22')]);if(_0x5ee747[_0xbac6('0x23')]){delete _0x5ee747['name'];}_0xecc2ba['status'](_0x20c145)[_0xbac6('0x24')](_0x5ee747);};}exports[_0xbac6('0x25')]=function(_0x1f7be4,_0x560488){if(_0x1f7be4['body']['id']){delete _0x1f7be4[_0xbac6('0x26')]['id'];}return db[_0xbac6('0x27')][_0xbac6('0x28')]({'where':{'id':_0x1f7be4[_0xbac6('0x29')]['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x560488,null))['then'](saveUpdates(_0x1f7be4['body'],null))[_0xbac6('0x1e')](respondWithResult(_0x560488,null))[_0xbac6('0x2a')](handleError(_0x560488,null));};exports[_0xbac6('0x1f')]=function(_0x122969,_0x5ac9bc){return db[_0xbac6('0x27')][_0xbac6('0x28')]({'where':{'id':_0x122969[_0xbac6('0x29')]['id']}})[_0xbac6('0x1e')](handleEntityNotFound(_0x5ac9bc,null))[_0xbac6('0x1e')](removeEntity(_0x5ac9bc,null))['catch'](handleError(_0x5ac9bc,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 77bcefd..3367ddc 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 _0x3f5c=['Action','lodash','util','../../config/logger','api','moment','bluebird','exports','define'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x3f5c,0x64));var _0xc3f5=function(_0x5de4f7,_0x4faad0){_0x5de4f7=_0x5de4f7-0x0;var _0x2ef6bb=_0x3f5c[_0x5de4f7];return _0x2ef6bb;};'use strict';var _=require(_0xc3f5('0x0'));var util=require(_0xc3f5('0x1'));var logger=require(_0xc3f5('0x2'))(_0xc3f5('0x3'));var moment=require(_0xc3f5('0x4'));var BPromise=require(_0xc3f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0xc3f5('0x6')]=function(_0x92a3ce,_0x578972){return _0x92a3ce[_0xc3f5('0x7')](_0xc3f5('0x8'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe924=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','lodash'];(function(_0x38ff71,_0x52e0d7){var _0x296aa4=function(_0x141cc3){while(--_0x141cc3){_0x38ff71['push'](_0x38ff71['shift']());}};_0x296aa4(++_0x52e0d7);}(_0xe924,0x141));var _0x4e92=function(_0x6027cd,_0x1b2be5){_0x6027cd=_0x6027cd-0x0;var _0x4718a7=_0xe924[_0x6027cd];return _0x4718a7;};'use strict';var _=require(_0x4e92('0x0'));var util=require(_0x4e92('0x1'));var logger=require(_0x4e92('0x2'))(_0x4e92('0x3'));var moment=require(_0x4e92('0x4'));var BPromise=require(_0x4e92('0x5'));var rp=require(_0x4e92('0x6'));var fs=require('fs');var path=require(_0x4e92('0x7'));var rimraf=require(_0x4e92('0x8'));var config=require(_0x4e92('0x9'));var attributes=require(_0x4e92('0xa'));module['exports']=function(_0x401987,_0x5ebf4b){return _0x401987[_0x4e92('0xb')](_0x4e92('0xc'),attributes,{'tableName':_0x4e92('0xd'),'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 158744c..8018d6f 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 _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x814b,0x1a2));var _0xb814=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x814b[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1e78a1,_0xee9752){var _0x39bb49=function(_0x49f71c){while(--_0x49f71c){_0x1e78a1['push'](_0x1e78a1['shift']());}};_0x39bb49(++_0xee9752);}(_0x5fc3,0xa8));var _0x35fc=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x5fc3[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 750bea9..400f2eb 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 _0x9389=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','update','delete','isAuthenticated','destroy','exports'];(function(_0x57c79c,_0x54f485){var _0x1b5796=function(_0x5ae43b){while(--_0x5ae43b){_0x57c79c['push'](_0x57c79c['shift']());}};_0x1b5796(++_0x54f485);}(_0x9389,0xcc));var _0x9938=function(_0x488b6e,_0x2036b7){_0x488b6e=_0x488b6e-0x0;var _0x2fbcc7=_0x9389[_0x488b6e];return _0x2fbcc7;};'use strict';var multer=require(_0x9938('0x0'));var util=require(_0x9938('0x1'));var path=require(_0x9938('0x2'));var timeout=require(_0x9938('0x3'));var express=require(_0x9938('0x4'));var router=express[_0x9938('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9938('0x6'));var interaction=require(_0x9938('0x7'));var config=require(_0x9938('0x8'));var controller=require(_0x9938('0x9'));router[_0x9938('0xa')](_0x9938('0xb'),auth['isAuthenticated'](),controller[_0x9938('0xc')]);router[_0x9938('0xd')](_0x9938('0xb'),auth[_0x9938('0xe')](),controller[_0x9938('0xf')]);module[_0x9938('0x10')]=router; \ No newline at end of file +var _0x43f0=['isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x43f0,0x14d));var _0x043f=function(_0x490fde,_0x35d48b){_0x490fde=_0x490fde-0x0;var _0x15feb0=_0x43f0[_0x490fde];return _0x15feb0;};'use strict';var multer=require('multer');var util=require(_0x043f('0x0'));var path=require(_0x043f('0x1'));var timeout=require(_0x043f('0x2'));var express=require(_0x043f('0x3'));var router=express[_0x043f('0x4')]();var fs_extra=require(_0x043f('0x5'));var auth=require(_0x043f('0x6'));var interaction=require(_0x043f('0x7'));var config=require(_0x043f('0x8'));var controller=require(_0x043f('0x9'));router[_0x043f('0xa')](_0x043f('0xb'),auth[_0x043f('0xc')](),controller['update']);router['delete'](_0x043f('0xb'),auth['isAuthenticated'](),controller[_0x043f('0xd')]);module[_0x043f('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 506dde9..51c416b 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 _0x7217=['sequelize','STRING','TEXT'];(function(_0x526291,_0x58e1b8){var _0x5e2bea=function(_0x403231){while(--_0x403231){_0x526291['push'](_0x526291['shift']());}};_0x5e2bea(++_0x58e1b8);}(_0x7217,0x19e));var _0x7721=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x7217[_0x1b828b];return _0x98da1a;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x34b986,_0x122220){_0x34b986=_0x34b986-0x0;var _0x3ba364=_0x8ef6[_0x34b986];return _0x3ba364;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index fc7da72..371c8a7 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 _0x2ffe=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','replace','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','Please\x20insert\x20at\x20least\x20one\x20field','output','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','countTable','COUNT(*)','run','HOUR(%s)','IS\x20EMPTY','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','UserProfileResource','stack','name','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x546c90,_0x55f520){var _0x486553=function(_0xf00284){while(--_0xf00284){_0x546c90['push'](_0x546c90['shift']());}};_0x486553(++_0x55f520);}(_0x2ffe,0x6a));var _0xe2ff=function(_0x4ef1bc,_0x531d4f){_0x4ef1bc=_0x4ef1bc-0x0;var _0x1cc196=_0x2ffe[_0x4ef1bc];return _0x1cc196;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2ff('0x0'));var zipdir=require(_0xe2ff('0x1'));var jsonpatch=require(_0xe2ff('0x2'));var rp=require(_0xe2ff('0x3'));var moment=require(_0xe2ff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe2ff('0x5'));var util=require(_0xe2ff('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe2ff('0x7'));var ejs=require(_0xe2ff('0x8'));var fs=require('fs');var fs_extra=require(_0xe2ff('0x9'));var _=require('lodash');var squel=require(_0xe2ff('0xa'));var crypto=require(_0xe2ff('0xb'));var jsforce=require(_0xe2ff('0xc'));var deskjs=require(_0xe2ff('0xd'));var toCsv=require(_0xe2ff('0x7'));var querystring=require(_0xe2ff('0xe'));var Papa=require(_0xe2ff('0xf'));var Redis=require(_0xe2ff('0x10'));var authService=require(_0xe2ff('0x11'));var qs=require(_0xe2ff('0x12'));var as=require(_0xe2ff('0x13'));var hardwareService=require(_0xe2ff('0x14'));var logger=require(_0xe2ff('0x15'))(_0xe2ff('0x16'));var utils=require(_0xe2ff('0x17'));var config=require(_0xe2ff('0x18'));var licenseUtil=require(_0xe2ff('0x19'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe2ff('0x1a'))[_0xe2ff('0x1b')];function respondWithStatusCode(_0x47f1c4,_0x1b2a6a){_0x1b2a6a=_0x1b2a6a||0xcc;return function(_0x3061e2){if(_0x3061e2){return _0x47f1c4[_0xe2ff('0x1c')](_0x1b2a6a);}return _0x47f1c4[_0xe2ff('0x1d')](_0x1b2a6a)[_0xe2ff('0x1e')]();};}function respondWithResult(_0x3203e1,_0x201128){_0x201128=_0x201128||0xc8;return function(_0x96907c){if(_0x96907c){return _0x3203e1[_0xe2ff('0x1d')](_0x201128)[_0xe2ff('0x1f')](_0x96907c);}};}function respondWithFilteredResult(_0x25143e,_0x3b8f1b){return function(_0x336368){if(_0x336368){var _0x31a8a0=typeof _0x3b8f1b[_0xe2ff('0x20')]===_0xe2ff('0x21')&&typeof _0x3b8f1b['limit']===_0xe2ff('0x21');var _0x10c7d6=_0x336368[_0xe2ff('0x22')];var _0x42c589=_0x31a8a0?0x0:_0x3b8f1b['offset'];var _0x1c5673=_0x31a8a0?_0x336368[_0xe2ff('0x22')]:_0x3b8f1b[_0xe2ff('0x20')]+_0x3b8f1b[_0xe2ff('0x23')];var _0x216b30;if(_0x1c5673>=_0x10c7d6){_0x1c5673=_0x10c7d6;_0x216b30=0xc8;}else{_0x216b30=0xce;}_0x25143e[_0xe2ff('0x1d')](_0x216b30);return _0x25143e[_0xe2ff('0x24')]('Content-Range',_0x42c589+'-'+_0x1c5673+'/'+_0x10c7d6)['json'](_0x336368);}return null;};}function patchUpdates(_0x5646ee){return function(_0x5e31f3){try{jsonpatch[_0xe2ff('0x25')](_0x5e31f3,_0x5646ee,!![]);}catch(_0x394aef){return BPromise[_0xe2ff('0x26')](_0x394aef);}return _0x5e31f3[_0xe2ff('0x27')]();};}function saveUpdates(_0x181bd2,_0x3d9d66){return function(_0x335d9c){if(_0x335d9c){return _0x335d9c[_0xe2ff('0x28')](_0x181bd2)[_0xe2ff('0x29')](function(_0x4e2ff7){return _0x4e2ff7;});}return null;};}function removeEntity(_0x71e3da,_0x4a2222){return function(_0xa6ad9){if(_0xa6ad9){return _0xa6ad9[_0xe2ff('0x2a')]()['then'](function(){var _0x3e7ff2=_0xa6ad9['get']({'plain':!![]});var _0x5265b5='CustomReports';return db[_0xe2ff('0x2b')]['destroy']({'where':{'type':_0x5265b5,'resourceId':_0x3e7ff2['id']}})['then'](function(){return _0xa6ad9;});})[_0xe2ff('0x29')](function(){_0x71e3da[_0xe2ff('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b2489,_0x3eeba0){return function(_0x41322d){if(!_0x41322d){_0x5b2489[_0xe2ff('0x1c')](0x194);}return _0x41322d;};}function handleError(_0x2733c3,_0x270296){_0x270296=_0x270296||0x1f4;return function(_0x1b827d){logger['error'](_0x1b827d[_0xe2ff('0x2c')]);if(_0x1b827d[_0xe2ff('0x2d')]){delete _0x1b827d[_0xe2ff('0x2d')];}_0x2733c3[_0xe2ff('0x1d')](_0x270296)['send'](_0x1b827d);};}exports[_0xe2ff('0x2e')]=function(_0x1da1c8,_0x5e14d9){var _0x385896={},_0x14f82a={},_0x32a533={'count':0x0,'rows':[]};var _0x4c5570=_[_0xe2ff('0x2f')](db[_0xe2ff('0x30')][_0xe2ff('0x31')],function(_0x95df6b){return{'name':_0x95df6b[_0xe2ff('0x32')],'type':_0x95df6b[_0xe2ff('0x33')][_0xe2ff('0x34')]};});_0x14f82a[_0xe2ff('0x35')]=_['map'](_0x4c5570,_0xe2ff('0x2d'));_0x14f82a[_0xe2ff('0x36')]=_[_0xe2ff('0x37')](_0x1da1c8['query']);_0x14f82a['filters']=_['intersection'](_0x14f82a['model'],_0x14f82a[_0xe2ff('0x36')]);_0x385896[_0xe2ff('0x38')]=_[_0xe2ff('0x39')](_0x14f82a[_0xe2ff('0x35')],qs[_0xe2ff('0x3a')](_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x3a')]));_0x385896['attributes']=_0x385896[_0xe2ff('0x38')][_0xe2ff('0x3b')]?_0x385896['attributes']:_0x14f82a[_0xe2ff('0x35')];if(!_0x1da1c8['query'][_0xe2ff('0x3c')](_0xe2ff('0x3d'))){_0x385896['limit']=qs[_0xe2ff('0x23')](_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x23')]);_0x385896[_0xe2ff('0x20')]=qs['offset'](_0x1da1c8['query'][_0xe2ff('0x20')]);}_0x385896[_0xe2ff('0x3e')]=qs[_0xe2ff('0x3f')](_0x1da1c8['query'][_0xe2ff('0x3f')]);_0x385896[_0xe2ff('0x40')]=qs[_0xe2ff('0x41')](_[_0xe2ff('0x42')](_0x1da1c8[_0xe2ff('0x36')],_0x14f82a[_0xe2ff('0x41')]),_0x4c5570);if(_0x1da1c8['query'][_0xe2ff('0x43')]){_0x385896[_0xe2ff('0x40')]=_[_0xe2ff('0x44')](_0x385896[_0xe2ff('0x40')],{'$or':_[_0xe2ff('0x2f')](_0x4c5570,function(_0x3ceaff){if(_0x3ceaff[_0xe2ff('0x33')]!==_0xe2ff('0x45')){var _0x4cb057={};_0x4cb057[_0x3ceaff[_0xe2ff('0x2d')]]={'$like':'%'+_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x43')]+'%'};return _0x4cb057;}})});}_0x385896=_[_0xe2ff('0x44')]({},_0x385896,_0x1da1c8[_0xe2ff('0x46')]);var _0x916d8c={'where':_0x385896[_0xe2ff('0x40')]};return db['AnalyticCustomReport'][_0xe2ff('0x22')](_0x916d8c)['then'](function(_0x5acd54){_0x32a533['count']=_0x5acd54;if(_0x1da1c8[_0xe2ff('0x36')][_0xe2ff('0x47')]){_0x385896[_0xe2ff('0x48')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xe2ff('0x49')](_0x385896);})[_0xe2ff('0x29')](function(_0x190b49){_0x32a533[_0xe2ff('0x4a')]=_0x190b49;return _0x32a533;})[_0xe2ff('0x29')](respondWithFilteredResult(_0x5e14d9,_0x385896))[_0xe2ff('0x4b')](handleError(_0x5e14d9,null));};exports[_0xe2ff('0x4c')]=function(_0x4a2989,_0x507d04){var _0x19cda4={'raw':![],'where':{'id':_0x4a2989[_0xe2ff('0x4d')]['id']}},_0x1e4c4d={};_0x1e4c4d[_0xe2ff('0x35')]=_[_0xe2ff('0x37')](db[_0xe2ff('0x30')][_0xe2ff('0x31')]);_0x1e4c4d[_0xe2ff('0x36')]=_[_0xe2ff('0x37')](_0x4a2989[_0xe2ff('0x36')]);_0x1e4c4d[_0xe2ff('0x41')]=_[_0xe2ff('0x39')](_0x1e4c4d[_0xe2ff('0x35')],_0x1e4c4d[_0xe2ff('0x36')]);_0x19cda4[_0xe2ff('0x38')]=_['intersection'](_0x1e4c4d[_0xe2ff('0x35')],qs['fields'](_0x4a2989[_0xe2ff('0x36')][_0xe2ff('0x3a')]));_0x19cda4[_0xe2ff('0x38')]=_0x19cda4[_0xe2ff('0x38')]['length']?_0x19cda4[_0xe2ff('0x38')]:_0x1e4c4d[_0xe2ff('0x35')];if(_0x4a2989['query'][_0xe2ff('0x47')]){_0x19cda4['include']=[{'all':!![]}];}_0x19cda4=_[_0xe2ff('0x44')]({},_0x19cda4,_0x4a2989[_0xe2ff('0x46')]);return db['AnalyticCustomReport'][_0xe2ff('0x4e')](_0x19cda4)[_0xe2ff('0x29')](handleEntityNotFound(_0x507d04,null))['then'](respondWithResult(_0x507d04,null))['catch'](handleError(_0x507d04,null));};exports[_0xe2ff('0x4f')]=function(_0x588507,_0x1eeadc){return db[_0xe2ff('0x30')][_0xe2ff('0x4f')](_0x588507[_0xe2ff('0x50')],{})[_0xe2ff('0x29')](function(_0x3b9ebf){var _0x39c869=_0x588507['user'][_0xe2ff('0x51')]({'plain':!![]});if(!_0x39c869)throw new Error(_0xe2ff('0x52'));if(_0x39c869[_0xe2ff('0x53')]===_0xe2ff('0x54')){var _0x53ab67=_0x3b9ebf[_0xe2ff('0x51')]({'plain':!![]});var _0x2fb1f6=_0xe2ff('0x55');return db['UserProfileSection']['find']({'where':{'name':_0x2fb1f6,'userProfileId':_0x39c869[_0xe2ff('0x56')]},'raw':!![]})[_0xe2ff('0x29')](function(_0x53939a){if(_0x53939a&&_0x53939a[_0xe2ff('0x57')]===0x0){return db[_0xe2ff('0x2b')]['create']({'name':_0x53ab67['name'],'resourceId':_0x53ab67['id'],'type':'CustomReports','sectionId':_0x53939a['id']},{})['then'](function(){return _0x3b9ebf;});}else{return _0x3b9ebf;}})[_0xe2ff('0x4b')](function(_0x323acf){logger[_0xe2ff('0x58')](_0xe2ff('0x59'),_0x323acf);throw _0x323acf;});}return _0x3b9ebf;})['then'](respondWithResult(_0x1eeadc,0xc9))['catch'](handleError(_0x1eeadc,null));};exports['update']=function(_0x58e032,_0x5dbdbe){if(_0x58e032['body']['id']){delete _0x58e032[_0xe2ff('0x50')]['id'];}return db['AnalyticCustomReport'][_0xe2ff('0x4e')]({'where':{'id':_0x58e032[_0xe2ff('0x4d')]['id']}})[_0xe2ff('0x29')](handleEntityNotFound(_0x5dbdbe,null))['then'](saveUpdates(_0x58e032[_0xe2ff('0x50')],null))['then'](respondWithResult(_0x5dbdbe,null))['catch'](handleError(_0x5dbdbe,null));};exports['destroy']=function(_0x57a8e1,_0x1518f9){return db['AnalyticCustomReport']['find']({'where':{'id':_0x57a8e1['params']['id']}})['then'](handleEntityNotFound(_0x1518f9,null))[_0xe2ff('0x29')](removeEntity(_0x1518f9,null))[_0xe2ff('0x4b')](handleError(_0x1518f9,null));};exports[_0xe2ff('0x5a')]=function(_0xa60f1c,_0x26f702){var _0xd7abe3=0xa;var _0x1f1cd1=['join',_0xe2ff('0x5b'),_0xe2ff('0x5c'),_0xe2ff('0x5d')];var _0x42c268={'SUM':_0xe2ff('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe2ff('0x5f'),'MAX':_0xe2ff('0x60'),'MIN':_0xe2ff('0x61'),'AVG':_0xe2ff('0x62'),'GROUP_CONCAT':_0xe2ff('0x63'),'GROUP_CONCAT ASC':_0xe2ff('0x64'),'GROUP_CONCAT DESC':_0xe2ff('0x65')};var _0x11ef53={'SEC_TO_TIME':_0xe2ff('0x66'),'DATE':_0xe2ff('0x67'),'HOUR':'HOUR(%s)','ROUND':_0xe2ff('0x68'),'UNIX_TIMESTAMP':_0xe2ff('0x69')};var _0x13e880=function(_0x45a62f){return!_[_0xe2ff('0x6a')]([_0xe2ff('0x6b'),_0xe2ff('0x6c'),'IS\x20EMPTY',_0xe2ff('0x6d')],_0x45a62f);};var _0x5271eb=function(_0x4bf11e){if(!_0x4bf11e||!_0x4bf11e[_0xe2ff('0x6e')][_0xe2ff('0x3b')]){return'';}for(var _0x4e2aef='(',_0x15bef6=0x0;_0x15bef6<_0x4bf11e[_0xe2ff('0x6e')][_0xe2ff('0x3b')];_0x15bef6+=0x1){_0x15bef6>0x0&&(_0x4e2aef+='\x20'+_0x4bf11e[_0xe2ff('0x6f')]+'\x20');_0x4e2aef+=_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6]['group']?_0x5271eb(_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x70')]):_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6]['field']+'\x20'+_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x71')]+(_0x13e880(_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x71')])?'\x20'+_0x4bf11e[_0xe2ff('0x6e')][_0x15bef6][_0xe2ff('0x72')]:'');}return _0x4e2aef+')';};var _0x14d5a0={'where':{'id':_0xa60f1c[_0xe2ff('0x4d')]['id']}},_0x42e731,_0x54461e,_0x312cab,_0x51f4db,_0x48252f;_0x14d5a0=_[_0xe2ff('0x44')]({},_0x14d5a0,_0xa60f1c[_0xe2ff('0x46')]);return db['AnalyticCustomReport'][_0xe2ff('0x4e')](_0x14d5a0)['then'](function(_0x447131){if(_0x447131){_0x42e731=_0x447131;return _0x447131[_0xe2ff('0x73')]();}return null;})[_0xe2ff('0x29')](function(_0x1fcde0){if(_0x1fcde0){if(!_0x1fcde0[_0xe2ff('0x3b')]){throw new db[(_0xe2ff('0x74'))][(_0xe2ff('0x75'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x54461e=_0x1fcde0;return db[_0xe2ff('0x76')][_0xe2ff('0x49')]({'raw':!![]});}return null;})[_0xe2ff('0x29')](function(_0x208e48){if(_0x208e48){_0x312cab=_[_0xe2ff('0x77')](_0x208e48,'id');var _0x52fb2f;var _0x119acc=squel[_0xe2ff('0x78')]();_0x119acc[_0xe2ff('0x79')](_0x42e731[_0xe2ff('0x7a')]);for(var _0x18f0ce=0x0;_0x18f0ce<_0x54461e['length'];_0x18f0ce+=0x1){_0x52fb2f=_0x54461e[_0x18f0ce][_0xe2ff('0x7b')]?_0x312cab[_0x54461e[_0x18f0ce]['MetricId']][_0xe2ff('0x7c')]:_0x54461e[_0x18f0ce][_0xe2ff('0x7d')];_0x52fb2f=_0x54461e[_0x18f0ce]['function']?_[_0xe2ff('0x7e')](_0x42c268[_0x54461e[_0x18f0ce][_0xe2ff('0x7f')]],'%s',_0x52fb2f):_0x52fb2f;_0x52fb2f=_0x54461e[_0x18f0ce][_0xe2ff('0x80')]?_['replace'](_0x11ef53[_0x54461e[_0x18f0ce][_0xe2ff('0x80')]],'%s',_0x52fb2f):_0x52fb2f;if(_0x54461e[_0x18f0ce][_0xe2ff('0x81')]){_0x119acc['group'](_0x52fb2f);}_0x54461e[_0x18f0ce][_0xe2ff('0x82')]&&_0x119acc[_0xe2ff('0x3e')](_0x52fb2f,_0x54461e[_0x18f0ce]['orderBy']===_0xe2ff('0x83')?![]:!![]);_0x119acc[_0xe2ff('0x7d')](_0x52fb2f,_0x54461e[_0x18f0ce][_0xe2ff('0x84')]||_0x52fb2f);}if(_0x42e731['joins']){_0x42e731[_0xe2ff('0x85')]=JSON[_0xe2ff('0x86')](_0x42e731[_0xe2ff('0x85')]);for(var _0x340309=0x0;_0x340309<_0x42e731[_0xe2ff('0x85')]['length'];_0x340309+=0x1){if(_0x42e731['joins'][_0x340309][_0xe2ff('0x33')]&&_['includes'](_0x1f1cd1,_0x42e731['joins'][_0x340309][_0xe2ff('0x33')])&&_0x42e731['joins'][_0x340309][_0xe2ff('0x87')]&&_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x88')]&&_0x42e731[_0xe2ff('0x85')][_0x340309]['foreignKey']){_0x119acc[_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x33')]](_0x42e731[_0xe2ff('0x85')][_0x340309]['foreignTable'],null,util[_0xe2ff('0x80')](_0xe2ff('0x89'),_0x42e731[_0xe2ff('0x7a')],_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x87')],_0x42e731['joins'][_0x340309]['foreignTable'],_0x42e731[_0xe2ff('0x85')][_0x340309][_0xe2ff('0x8a')]));}}}if(_0x42e731[_0xe2ff('0x8b')]){_0x42e731['conditions']=JSON[_0xe2ff('0x86')](_0x42e731[_0xe2ff('0x8b')]);_0x119acc[_0xe2ff('0x40')](_0x5271eb(_0x42e731[_0xe2ff('0x8b')][_0xe2ff('0x70')]));}_0x48252f=_0x119acc[_0xe2ff('0x8c')]();_0x119acc['limit'](_0xd7abe3);_0x119acc[_0xe2ff('0x20')](0x0);logger[_0xe2ff('0x8d')](_0xe2ff('0x8e'),_0x119acc['toString']());return dbH[_0xe2ff('0x8f')][_0xe2ff('0x36')](_0x119acc[_0xe2ff('0x90')](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')][_0xe2ff('0x92')]});}})['then'](respondWithResult(_0x26f702,null))[_0xe2ff('0x4b')](handleError(_0x26f702,null));};function runReport(_0xe1827c,_0x583d01,_0x42cd72){var _0x149b82=_0x583d01[_0xe2ff('0x2d')];var _0x2bcb9e=0xa;var _0x424260=[_0xe2ff('0x93'),_0xe2ff('0x5b'),_0xe2ff('0x5c'),_0xe2ff('0x5d')];var _0x1bd74f={'SUM':_0xe2ff('0x5e'),'COUNT':_0xe2ff('0x94'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xe2ff('0x61'),'AVG':_0xe2ff('0x62'),'GROUP_CONCAT':_0xe2ff('0x63'),'GROUP_CONCAT ASC':_0xe2ff('0x64'),'GROUP_CONCAT DESC':_0xe2ff('0x65')};var _0x460d2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xe2ff('0x68'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x317c0c=function(_0x2c912b){return!_[_0xe2ff('0x6a')]([_0xe2ff('0x6b'),_0xe2ff('0x6c'),'IS\x20EMPTY',_0xe2ff('0x6d')],_0x2c912b);};var _0x29d387=function(_0x587d15){if(!_0x587d15||!_0x587d15[_0xe2ff('0x6e')][_0xe2ff('0x3b')]){return'';}for(var _0x3dbb5b='(',_0x44a351=0x0;_0x44a351<_0x587d15[_0xe2ff('0x6e')][_0xe2ff('0x3b')];_0x44a351+=0x1){_0x44a351>0x0&&(_0x3dbb5b+='\x20'+_0x587d15['operator']+'\x20');_0x3dbb5b+=_0x587d15[_0xe2ff('0x6e')][_0x44a351][_0xe2ff('0x70')]?_0x29d387(_0x587d15['rules'][_0x44a351][_0xe2ff('0x70')]):_0x587d15['rules'][_0x44a351][_0xe2ff('0x7d')]+'\x20'+_0x587d15[_0xe2ff('0x6e')][_0x44a351][_0xe2ff('0x71')]+(_0x317c0c(_0x587d15[_0xe2ff('0x6e')][_0x44a351][_0xe2ff('0x71')])?'\x20'+_0x587d15['rules'][_0x44a351]['value']:'');}return _0x3dbb5b+')';};var _0x2e7f6d={'where':{'id':_0xe1827c['id']}},_0x9138ad,_0x3b1394,_0x593236,_0x4da500,_0x437b5b;_0x2e7f6d=_['merge']({},_0x2e7f6d,_0x42cd72);return db[_0xe2ff('0x30')][_0xe2ff('0x4e')](_0x2e7f6d)[_0xe2ff('0x29')](function(_0x2f119f){if(_0x2f119f){_0x9138ad=_0x2f119f;return _0x2f119f['getFields']();}return null;})['then'](function(_0x533d18){if(_0x533d18){if(!_0x533d18['length']){throw new db[(_0xe2ff('0x74'))][(_0xe2ff('0x75'))](_0xe2ff('0x95'),0x193);}_0x3b1394=_0x533d18;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xe2ff('0x29')](function(_0x28c026){if(_0x28c026){_0x593236=_[_0xe2ff('0x77')](_0x28c026,'id');var _0x18270d;var _0x589845=squel['select']();_0x589845['from'](_0x9138ad[_0xe2ff('0x7a')]);for(var _0x4b83bc=0x0;_0x4b83bc<_0x3b1394[_0xe2ff('0x3b')];_0x4b83bc+=0x1){_0x18270d=_0x3b1394[_0x4b83bc][_0xe2ff('0x7b')]?_0x593236[_0x3b1394[_0x4b83bc][_0xe2ff('0x7b')]][_0xe2ff('0x7c')]:_0x3b1394[_0x4b83bc]['field'];_0x18270d=_0x3b1394[_0x4b83bc][_0xe2ff('0x7f')]?_[_0xe2ff('0x7e')](_0x1bd74f[_0x3b1394[_0x4b83bc][_0xe2ff('0x7f')]],'%s',_0x18270d):_0x18270d;_0x18270d=_0x3b1394[_0x4b83bc][_0xe2ff('0x80')]?_['replace'](_0x460d2e[_0x3b1394[_0x4b83bc][_0xe2ff('0x80')]],'%s',_0x18270d):_0x18270d;if(_0x3b1394[_0x4b83bc]['groupBy']){_0x589845[_0xe2ff('0x70')](_0x18270d);}_0x3b1394[_0x4b83bc][_0xe2ff('0x82')]&&_0x589845[_0xe2ff('0x3e')](_0x18270d,_0x3b1394[_0x4b83bc][_0xe2ff('0x82')]===_0xe2ff('0x83')?![]:!![]);_0x589845['field'](_0x18270d,_0x3b1394[_0x4b83bc][_0xe2ff('0x84')]||_0x18270d);}if(_0x9138ad['joins']){_0x9138ad[_0xe2ff('0x85')]=JSON[_0xe2ff('0x86')](_0x9138ad[_0xe2ff('0x85')]);for(var _0x1ddb99=0x0;_0x1ddb99<_0x9138ad[_0xe2ff('0x85')][_0xe2ff('0x3b')];_0x1ddb99+=0x1){if(_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x33')]&&_['includes'](_0x424260,_0x9138ad['joins'][_0x1ddb99][_0xe2ff('0x33')])&&_0x9138ad[_0xe2ff('0x85')][_0x1ddb99]['parentKey']&&_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x88')]&&_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x8a')]){_0x589845[_0x9138ad['joins'][_0x1ddb99][_0xe2ff('0x33')]](_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x88')],null,util[_0xe2ff('0x80')](_0xe2ff('0x89'),_0x9138ad['table'],_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x87')],_0x9138ad[_0xe2ff('0x85')][_0x1ddb99][_0xe2ff('0x88')],_0x9138ad['joins'][_0x1ddb99][_0xe2ff('0x8a')]));}}}if(_0x9138ad[_0xe2ff('0x8b')]){_0x9138ad[_0xe2ff('0x8b')]=JSON[_0xe2ff('0x86')](_0x9138ad[_0xe2ff('0x8b')]);_0x589845[_0xe2ff('0x40')](_0x29d387(_0x9138ad[_0xe2ff('0x8b')][_0xe2ff('0x70')]));}_0x437b5b=_0x589845[_0xe2ff('0x8c')]();_0x589845[_0xe2ff('0x23')](_0x2bcb9e);_0x589845[_0xe2ff('0x20')](0x0);return;}})[_0xe2ff('0x29')](function(){if(_0x583d01[_0xe2ff('0x96')]===_0xe2ff('0x97')){return null;}var _0x35b885=_['merge'](_0x583d01,{'name':_0x583d01[_0xe2ff('0x98')]||_0x583d01[_0xe2ff('0x2d')]||_0x9138ad[_0xe2ff('0x2d')],'basename':_0x149b82,'savename':util[_0xe2ff('0x80')](_0xe2ff('0x99'),_0x583d01['name']||_0x9138ad[_0xe2ff('0x2d')],require('randomstring')[_0xe2ff('0x9a')](0x4),_0x583d01[_0xe2ff('0x96')]||_0xe2ff('0x9b')),'reportId':_0x9138ad['id'],'reportType':'custom'});return db[_0xe2ff('0x9c')]['create'](_0x35b885,{'raw':!![]});})['then'](function(_0x351dd8){if(_0x9138ad[_0xe2ff('0x7a')]===_0xe2ff('0x9d')){_0x437b5b[_0xe2ff('0x40')](_0x9138ad[_0xe2ff('0x7a')]+_0xe2ff('0x9e'),_0x583d01['startDate'],_0x583d01[_0xe2ff('0x9f')]);}else{_0x437b5b[_0xe2ff('0x40')](_0x9138ad['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x583d01[_0xe2ff('0xa0')],_0x583d01[_0xe2ff('0x9f')]);}if(_0x351dd8){logger[_0xe2ff('0xa1')](_0xe2ff('0xa2'),_0x437b5b['toString']());require(_0xe2ff('0xa3'))[_0xe2ff('0xa4')](path[_0xe2ff('0x93')](__dirname,'../../components/export/',_0x351dd8[_0xe2ff('0x96')]),[_0x351dd8['id'],_0x437b5b[_0xe2ff('0x90')](),path[_0xe2ff('0x93')](__dirname,_0xe2ff('0xa5'),_0x351dd8['savename']),_0x149b82]);return _0x351dd8;}else{var _0x1150f8=squel[_0xe2ff('0x78')]();_0x1150f8[_0xe2ff('0x79')]('('+_0x437b5b[_0xe2ff('0x90')]()+')',_0xe2ff('0xa6'));_0x1150f8[_0xe2ff('0x7d')](_0xe2ff('0xa7'),'count');_0x437b5b[_0xe2ff('0x23')](_0x583d01[_0xe2ff('0x23')]||_0x2bcb9e);_0x437b5b[_0xe2ff('0x20')](_0x583d01[_0xe2ff('0x20')]||0x0);return dbH[_0xe2ff('0x8f')][_0xe2ff('0x36')](_0x1150f8[_0xe2ff('0x90')](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')]['SELECT']})[_0xe2ff('0x29')](function(_0x5d64f9){if(!_0x5d64f9['length']){_0x4da500=0x0;}else{_0x4da500=_0x5d64f9[0x0][_0xe2ff('0x22')]||0x0;}return dbH[_0xe2ff('0x8f')]['query'](_0x437b5b[_0xe2ff('0x90')](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')][_0xe2ff('0x92')]});})[_0xe2ff('0x29')](function(_0xea2092){return{'rows':_0xea2092||[],'count':_0x4da500};});}});}exports[_0xe2ff('0xa8')]=function(_0x44d668,_0x140fb6){return runReport(_0x44d668[_0xe2ff('0x4d')],_0x44d668[_0xe2ff('0x36')],_0x44d668[_0xe2ff('0x46')])[_0xe2ff('0x29')](respondWithResult(_0x140fb6,null))[_0xe2ff('0x4b')](handleError(_0x140fb6,null));};exports['runReport']=runReport;exports[_0xe2ff('0x36')]=function(_0x53ac7c,_0x57bac4){var _0x2b183d=0xa;var _0x20ce0a=['join',_0xe2ff('0x5b'),_0xe2ff('0x5c'),_0xe2ff('0x5d')];var _0x307084={'SUM':_0xe2ff('0x5e'),'COUNT':_0xe2ff('0x94'),'COUNT DISTINCT':_0xe2ff('0x5f'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xe2ff('0x63'),'GROUP_CONCAT ASC':_0xe2ff('0x64'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x569fe9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xe2ff('0xa9'),'ROUND':_0xe2ff('0x68'),'UNIX_TIMESTAMP':_0xe2ff('0x69')};var _0x47f5bc=function(_0x2f323b){return!_[_0xe2ff('0x6a')]([_0xe2ff('0x6b'),_0xe2ff('0x6c'),_0xe2ff('0xaa'),'IS\x20NOT\x20EMPTY'],_0x2f323b);};var _0x1f94cb=function(_0x135e58){if(!_0x135e58||!_0x135e58[_0xe2ff('0x6e')][_0xe2ff('0x3b')]){return'';}for(var _0x28b7ed='(',_0x256505=0x0;_0x256505<_0x135e58[_0xe2ff('0x6e')]['length'];_0x256505+=0x1){_0x256505>0x0&&(_0x28b7ed+='\x20'+_0x135e58['operator']+'\x20');_0x28b7ed+=_0x135e58[_0xe2ff('0x6e')][_0x256505]['group']?_0x1f94cb(_0x135e58[_0xe2ff('0x6e')][_0x256505][_0xe2ff('0x70')]):_0x135e58['rules'][_0x256505][_0xe2ff('0x7d')]+'\x20'+_0x135e58[_0xe2ff('0x6e')][_0x256505][_0xe2ff('0x71')]+(_0x47f5bc(_0x135e58[_0xe2ff('0x6e')][_0x256505][_0xe2ff('0x71')])?'\x20'+_0x135e58['rules'][_0x256505]['value']:'');}return _0x28b7ed+')';};var _0x5854c9={'where':{'id':_0x53ac7c[_0xe2ff('0x4d')]['id']}},_0x409913,_0x367c2e,_0x250905,_0x597e27,_0x5159be;_0x5854c9=_['merge']({},_0x5854c9,_0x53ac7c[_0xe2ff('0x46')]);return db['AnalyticCustomReport']['find'](_0x5854c9)[_0xe2ff('0x29')](function(_0x361da8){if(_0x361da8){_0x409913=_0x361da8;return _0x361da8['getFields']();}return null;})['then'](function(_0x284034){if(_0x284034){if(!_0x284034[_0xe2ff('0x3b')]){throw new db['Sequelize'][(_0xe2ff('0x75'))](_0xe2ff('0x95'),0x193);}_0x367c2e=_0x284034;return db[_0xe2ff('0x76')][_0xe2ff('0x49')]({'raw':!![]});}return null;})[_0xe2ff('0x29')](function(_0x293f8e){if(_0x293f8e){_0x250905=_[_0xe2ff('0x77')](_0x293f8e,'id');var _0x2bc269;var _0x4ee49c=squel[_0xe2ff('0x78')]();_0x4ee49c[_0xe2ff('0x79')](_0x409913['table']);for(var _0x54fc86=0x0;_0x54fc86<_0x367c2e[_0xe2ff('0x3b')];_0x54fc86+=0x1){_0x2bc269=_0x367c2e[_0x54fc86][_0xe2ff('0x7b')]?_0x250905[_0x367c2e[_0x54fc86][_0xe2ff('0x7b')]][_0xe2ff('0x7c')]:_0x367c2e[_0x54fc86][_0xe2ff('0x7d')];_0x2bc269=_0x367c2e[_0x54fc86][_0xe2ff('0x7f')]?_[_0xe2ff('0x7e')](_0x307084[_0x367c2e[_0x54fc86][_0xe2ff('0x7f')]],'%s',_0x2bc269):_0x2bc269;_0x2bc269=_0x367c2e[_0x54fc86][_0xe2ff('0x80')]?_[_0xe2ff('0x7e')](_0x569fe9[_0x367c2e[_0x54fc86][_0xe2ff('0x80')]],'%s',_0x2bc269):_0x2bc269;if(_0x367c2e[_0x54fc86][_0xe2ff('0x81')]){_0x4ee49c[_0xe2ff('0x70')](_0x2bc269);}_0x367c2e[_0x54fc86]['orderBy']&&_0x4ee49c[_0xe2ff('0x3e')](_0x2bc269,_0x367c2e[_0x54fc86][_0xe2ff('0x82')]===_0xe2ff('0x83')?![]:!![]);_0x4ee49c[_0xe2ff('0x7d')](_0x2bc269,_0x367c2e[_0x54fc86]['alias']||_0x2bc269);}if(_0x409913[_0xe2ff('0x85')]){_0x409913[_0xe2ff('0x85')]=JSON[_0xe2ff('0x86')](_0x409913['joins']);for(var _0x57d15d=0x0;_0x57d15d<_0x409913['joins'][_0xe2ff('0x3b')];_0x57d15d+=0x1){if(_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x33')]&&_[_0xe2ff('0x6a')](_0x20ce0a,_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x33')])&&_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x87')]&&_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x88')]&&_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x8a')]){_0x4ee49c[_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x33')]](_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x88')],null,util[_0xe2ff('0x80')]('%s.%s\x20=\x20%s.%s',_0x409913['table'],_0x409913[_0xe2ff('0x85')][_0x57d15d]['parentKey'],_0x409913[_0xe2ff('0x85')][_0x57d15d]['foreignTable'],_0x409913[_0xe2ff('0x85')][_0x57d15d][_0xe2ff('0x8a')]));}}}if(_0x409913[_0xe2ff('0x8b')]){_0x409913['conditions']=JSON[_0xe2ff('0x86')](_0x409913[_0xe2ff('0x8b')]);_0x4ee49c[_0xe2ff('0x40')](_0x1f94cb(_0x409913[_0xe2ff('0x8b')][_0xe2ff('0x70')]));}_0x5159be=_0x4ee49c[_0xe2ff('0x8c')]();_0x4ee49c[_0xe2ff('0x23')](_0x2b183d);_0x4ee49c[_0xe2ff('0x20')](0x0);logger['debug'](_0xe2ff('0x8e'),_0x4ee49c['toString']());return dbH[_0xe2ff('0x8f')][_0xe2ff('0x36')](_0x4ee49c['toString'](),{'type':dbH[_0xe2ff('0x8f')][_0xe2ff('0x91')][_0xe2ff('0x92')]});}})[_0xe2ff('0x29')](function(){return{'sql':_0x5159be[_0xe2ff('0x90')]()};})[_0xe2ff('0x29')](respondWithResult(_0x57bac4,null))[_0xe2ff('0x4b')](handleError(_0x57bac4,null));}; \ No newline at end of file +var _0xf117=['type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','QueryTypes','SELECT','MAX(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','from','foreignKey','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','sequelize','run','runReport','GROUP_CONCAT(%s)','IS\x20NULL','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes'];(function(_0x388113,_0x16cac1){var _0x5c3a72=function(_0x34c96a){while(--_0x34c96a){_0x388113['push'](_0x388113['shift']());}};_0x5c3a72(++_0x16cac1);}(_0xf117,0x122));var _0x7f11=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xf117[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f11('0x0'));var zipdir=require(_0x7f11('0x1'));var jsonpatch=require(_0x7f11('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7f11('0x3'));var Mustache=require(_0x7f11('0x4'));var util=require(_0x7f11('0x5'));var path=require(_0x7f11('0x6'));var sox=require(_0x7f11('0x7'));var csv=require(_0x7f11('0x8'));var ejs=require(_0x7f11('0x9'));var fs=require('fs');var fs_extra=require(_0x7f11('0xa'));var _=require(_0x7f11('0xb'));var squel=require(_0x7f11('0xc'));var crypto=require(_0x7f11('0xd'));var jsforce=require(_0x7f11('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7f11('0xf'));var Papa=require(_0x7f11('0x10'));var Redis=require(_0x7f11('0x11'));var authService=require(_0x7f11('0x12'));var qs=require(_0x7f11('0x13'));var as=require(_0x7f11('0x14'));var hardwareService=require(_0x7f11('0x15'));var logger=require(_0x7f11('0x16'))('api');var utils=require(_0x7f11('0x17'));var config=require(_0x7f11('0x18'));var licenseUtil=require(_0x7f11('0x19'));var db=require(_0x7f11('0x1a'))['db'];var dbH=require(_0x7f11('0x1a'))[_0x7f11('0x1b')];function respondWithStatusCode(_0x2d9208,_0xe7a0a7){_0xe7a0a7=_0xe7a0a7||0xcc;return function(_0x4ca403){if(_0x4ca403){return _0x2d9208['sendStatus'](_0xe7a0a7);}return _0x2d9208[_0x7f11('0x1c')](_0xe7a0a7)[_0x7f11('0x1d')]();};}function respondWithResult(_0x5c9274,_0x4fbcbc){_0x4fbcbc=_0x4fbcbc||0xc8;return function(_0x1dfa7d){if(_0x1dfa7d){return _0x5c9274[_0x7f11('0x1c')](_0x4fbcbc)[_0x7f11('0x1e')](_0x1dfa7d);}};}function respondWithFilteredResult(_0x1c9d89,_0x294e95){return function(_0x2e4f8f){if(_0x2e4f8f){var _0x50604c=typeof _0x294e95[_0x7f11('0x1f')]===_0x7f11('0x20')&&typeof _0x294e95[_0x7f11('0x21')]===_0x7f11('0x20');var _0x1d89d8=_0x2e4f8f[_0x7f11('0x22')];var _0x2e242a=_0x50604c?0x0:_0x294e95[_0x7f11('0x1f')];var _0x4b8ccb=_0x50604c?_0x2e4f8f['count']:_0x294e95['offset']+_0x294e95[_0x7f11('0x21')];var _0x13c0d9;if(_0x4b8ccb>=_0x1d89d8){_0x4b8ccb=_0x1d89d8;_0x13c0d9=0xc8;}else{_0x13c0d9=0xce;}_0x1c9d89[_0x7f11('0x1c')](_0x13c0d9);return _0x1c9d89[_0x7f11('0x23')](_0x7f11('0x24'),_0x2e242a+'-'+_0x4b8ccb+'/'+_0x1d89d8)[_0x7f11('0x1e')](_0x2e4f8f);}return null;};}function patchUpdates(_0x36eb2c){return function(_0x373895){try{jsonpatch['apply'](_0x373895,_0x36eb2c,!![]);}catch(_0x292454){return BPromise[_0x7f11('0x25')](_0x292454);}return _0x373895[_0x7f11('0x26')]();};}function saveUpdates(_0x39ddc7,_0x1465b8){return function(_0x53e95c){if(_0x53e95c){return _0x53e95c[_0x7f11('0x27')](_0x39ddc7)[_0x7f11('0x28')](function(_0x5b2fd7){return _0x5b2fd7;});}return null;};}function removeEntity(_0x48118a,_0x285115){return function(_0xec5f13){if(_0xec5f13){return _0xec5f13[_0x7f11('0x29')]()[_0x7f11('0x28')](function(){var _0x225aa0=_0xec5f13[_0x7f11('0x2a')]({'plain':!![]});var _0x3b3d4c='CustomReports';return db[_0x7f11('0x2b')]['destroy']({'where':{'type':_0x3b3d4c,'resourceId':_0x225aa0['id']}})[_0x7f11('0x28')](function(){return _0xec5f13;});})[_0x7f11('0x28')](function(){_0x48118a[_0x7f11('0x1c')](0xcc)[_0x7f11('0x1d')]();});}};}function handleEntityNotFound(_0x43362b,_0x14ca42){return function(_0x3b01b6){if(!_0x3b01b6){_0x43362b[_0x7f11('0x2c')](0x194);}return _0x3b01b6;};}function handleError(_0x351bc1,_0x5d7762){_0x5d7762=_0x5d7762||0x1f4;return function(_0x5d24a4){logger['error'](_0x5d24a4[_0x7f11('0x2d')]);if(_0x5d24a4[_0x7f11('0x2e')]){delete _0x5d24a4[_0x7f11('0x2e')];}_0x351bc1[_0x7f11('0x1c')](_0x5d7762)[_0x7f11('0x2f')](_0x5d24a4);};}exports[_0x7f11('0x30')]=function(_0x339bab,_0x4e7c64){var _0x148319={},_0x27a2a3={},_0xcc7ce9={'count':0x0,'rows':[]};var _0x334adc=_[_0x7f11('0x31')](db[_0x7f11('0x32')][_0x7f11('0x33')],function(_0x36a7db){return{'name':_0x36a7db['fieldName'],'type':_0x36a7db[_0x7f11('0x34')][_0x7f11('0x35')]};});_0x27a2a3['model']=_[_0x7f11('0x31')](_0x334adc,'name');_0x27a2a3['query']=_[_0x7f11('0x36')](_0x339bab[_0x7f11('0x37')]);_0x27a2a3['filters']=_[_0x7f11('0x38')](_0x27a2a3[_0x7f11('0x39')],_0x27a2a3[_0x7f11('0x37')]);_0x148319[_0x7f11('0x3a')]=_[_0x7f11('0x38')](_0x27a2a3[_0x7f11('0x39')],qs[_0x7f11('0x3b')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x3b')]));_0x148319['attributes']=_0x148319['attributes'][_0x7f11('0x3c')]?_0x148319[_0x7f11('0x3a')]:_0x27a2a3[_0x7f11('0x39')];if(!_0x339bab[_0x7f11('0x37')][_0x7f11('0x3d')](_0x7f11('0x3e'))){_0x148319[_0x7f11('0x21')]=qs[_0x7f11('0x21')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x21')]);_0x148319[_0x7f11('0x1f')]=qs['offset'](_0x339bab[_0x7f11('0x37')][_0x7f11('0x1f')]);}_0x148319[_0x7f11('0x3f')]=qs[_0x7f11('0x40')](_0x339bab[_0x7f11('0x37')][_0x7f11('0x40')]);_0x148319['where']=qs['filters'](_[_0x7f11('0x41')](_0x339bab[_0x7f11('0x37')],_0x27a2a3[_0x7f11('0x42')]),_0x334adc);if(_0x339bab[_0x7f11('0x37')][_0x7f11('0x43')]){_0x148319[_0x7f11('0x44')]=_['merge'](_0x148319[_0x7f11('0x44')],{'$or':_[_0x7f11('0x31')](_0x334adc,function(_0x351691){if(_0x351691[_0x7f11('0x34')]!==_0x7f11('0x45')){var _0xbc89d5={};_0xbc89d5[_0x351691[_0x7f11('0x2e')]]={'$like':'%'+_0x339bab['query'][_0x7f11('0x43')]+'%'};return _0xbc89d5;}})});}_0x148319=_[_0x7f11('0x46')]({},_0x148319,_0x339bab['options']);var _0x5c9544={'where':_0x148319[_0x7f11('0x44')]};return db[_0x7f11('0x32')][_0x7f11('0x22')](_0x5c9544)[_0x7f11('0x28')](function(_0xf490d7){_0xcc7ce9[_0x7f11('0x22')]=_0xf490d7;if(_0x339bab[_0x7f11('0x37')][_0x7f11('0x47')]){_0x148319[_0x7f11('0x48')]=[{'all':!![]}];}return db[_0x7f11('0x32')]['findAll'](_0x148319);})[_0x7f11('0x28')](function(_0x1516c5){_0xcc7ce9[_0x7f11('0x49')]=_0x1516c5;return _0xcc7ce9;})[_0x7f11('0x28')](respondWithFilteredResult(_0x4e7c64,_0x148319))[_0x7f11('0x4a')](handleError(_0x4e7c64,null));};exports[_0x7f11('0x4b')]=function(_0x5166fb,_0x22df6b){var _0x3525d3={'raw':![],'where':{'id':_0x5166fb[_0x7f11('0x4c')]['id']}},_0x116cec={};_0x116cec['model']=_[_0x7f11('0x36')](db[_0x7f11('0x32')][_0x7f11('0x33')]);_0x116cec[_0x7f11('0x37')]=_['keys'](_0x5166fb[_0x7f11('0x37')]);_0x116cec[_0x7f11('0x42')]=_[_0x7f11('0x38')](_0x116cec['model'],_0x116cec['query']);_0x3525d3[_0x7f11('0x3a')]=_['intersection'](_0x116cec['model'],qs[_0x7f11('0x3b')](_0x5166fb[_0x7f11('0x37')][_0x7f11('0x3b')]));_0x3525d3[_0x7f11('0x3a')]=_0x3525d3[_0x7f11('0x3a')][_0x7f11('0x3c')]?_0x3525d3[_0x7f11('0x3a')]:_0x116cec[_0x7f11('0x39')];if(_0x5166fb['query']['includeAll']){_0x3525d3[_0x7f11('0x48')]=[{'all':!![]}];}_0x3525d3=_[_0x7f11('0x46')]({},_0x3525d3,_0x5166fb[_0x7f11('0x4d')]);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x3525d3)[_0x7f11('0x28')](handleEntityNotFound(_0x22df6b,null))[_0x7f11('0x28')](respondWithResult(_0x22df6b,null))[_0x7f11('0x4a')](handleError(_0x22df6b,null));};exports[_0x7f11('0x4f')]=function(_0x595bc0,_0x2c29fa){return db['AnalyticCustomReport']['create'](_0x595bc0[_0x7f11('0x50')],{})['then'](function(_0x4ab82e){var _0x4e6cc7=_0x595bc0['user']['get']({'plain':!![]});if(!_0x4e6cc7)throw new Error(_0x7f11('0x51'));if(_0x4e6cc7[_0x7f11('0x52')]===_0x7f11('0x53')){var _0x42a79e=_0x4ab82e['get']({'plain':!![]});var _0x39fdb1='Reports';return db['UserProfileSection'][_0x7f11('0x4e')]({'where':{'name':_0x39fdb1,'userProfileId':_0x4e6cc7[_0x7f11('0x54')]},'raw':!![]})[_0x7f11('0x28')](function(_0x1fe49f){if(_0x1fe49f&&_0x1fe49f['autoAssociation']===0x0){return db[_0x7f11('0x2b')]['create']({'name':_0x42a79e[_0x7f11('0x2e')],'resourceId':_0x42a79e['id'],'type':_0x7f11('0x55'),'sectionId':_0x1fe49f['id']},{})[_0x7f11('0x28')](function(){return _0x4ab82e;});}else{return _0x4ab82e;}})[_0x7f11('0x4a')](function(_0x51961b){logger['error'](_0x7f11('0x56'),_0x51961b);throw _0x51961b;});}return _0x4ab82e;})[_0x7f11('0x28')](respondWithResult(_0x2c29fa,0xc9))[_0x7f11('0x4a')](handleError(_0x2c29fa,null));};exports[_0x7f11('0x27')]=function(_0xf61e5f,_0x23385c){if(_0xf61e5f['body']['id']){delete _0xf61e5f[_0x7f11('0x50')]['id'];}return db[_0x7f11('0x32')][_0x7f11('0x4e')]({'where':{'id':_0xf61e5f['params']['id']}})[_0x7f11('0x28')](handleEntityNotFound(_0x23385c,null))[_0x7f11('0x28')](saveUpdates(_0xf61e5f[_0x7f11('0x50')],null))[_0x7f11('0x28')](respondWithResult(_0x23385c,null))['catch'](handleError(_0x23385c,null));};exports[_0x7f11('0x29')]=function(_0x2e9307,_0x530e27){return db[_0x7f11('0x32')][_0x7f11('0x4e')]({'where':{'id':_0x2e9307[_0x7f11('0x4c')]['id']}})[_0x7f11('0x28')](handleEntityNotFound(_0x530e27,null))[_0x7f11('0x28')](removeEntity(_0x530e27,null))[_0x7f11('0x4a')](handleError(_0x530e27,null));};exports[_0x7f11('0x57')]=function(_0x1b8900,_0x4278f0){var _0x48dec5=0xa;var _0x2262c3=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0x2863c5={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':'MAX(%s)','MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':_0x7f11('0x62')};var _0x2cce70={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':_0x7f11('0x65'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7f11('0x66')};var _0x18a61a=function(_0x32a33e){return!_[_0x7f11('0x67')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x7f11('0x68')],_0x32a33e);};var _0x452865=function(_0x52ab80){if(!_0x52ab80||!_0x52ab80[_0x7f11('0x69')]['length']){return'';}for(var _0x5031e='(',_0x2263e5=0x0;_0x2263e5<_0x52ab80['rules'][_0x7f11('0x3c')];_0x2263e5+=0x1){_0x2263e5>0x0&&(_0x5031e+='\x20'+_0x52ab80[_0x7f11('0x6a')]+'\x20');_0x5031e+=_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6b')]?_0x452865(_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6b')]):_0x52ab80[_0x7f11('0x69')][_0x2263e5][_0x7f11('0x6c')]+'\x20'+_0x52ab80[_0x7f11('0x69')][_0x2263e5]['condition']+(_0x18a61a(_0x52ab80['rules'][_0x2263e5][_0x7f11('0x6d')])?'\x20'+_0x52ab80['rules'][_0x2263e5][_0x7f11('0x6e')]:'');}return _0x5031e+')';};var _0x54cce4={'where':{'id':_0x1b8900['params']['id']}},_0x498bfe,_0x5f1555,_0x52dbb3,_0xd7070a,_0x167009;_0x54cce4=_[_0x7f11('0x46')]({},_0x54cce4,_0x1b8900[_0x7f11('0x4d')]);return db['AnalyticCustomReport'][_0x7f11('0x4e')](_0x54cce4)[_0x7f11('0x28')](function(_0x3ce5aa){if(_0x3ce5aa){_0x498bfe=_0x3ce5aa;return _0x3ce5aa[_0x7f11('0x6f')]();}return null;})[_0x7f11('0x28')](function(_0x47c4bd){if(_0x47c4bd){if(!_0x47c4bd[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))][(_0x7f11('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5f1555=_0x47c4bd;return db[_0x7f11('0x72')][_0x7f11('0x73')]({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x1f95e7){if(_0x1f95e7){_0x52dbb3=_[_0x7f11('0x74')](_0x1f95e7,'id');var _0x3ede7b;var _0x4fd35a=squel[_0x7f11('0x75')]();_0x4fd35a['from'](_0x498bfe[_0x7f11('0x76')]);for(var _0x22d496=0x0;_0x22d496<_0x5f1555[_0x7f11('0x3c')];_0x22d496+=0x1){_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x77')]?_0x52dbb3[_0x5f1555[_0x22d496][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x5f1555[_0x22d496]['field'];_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0x2863c5[_0x5f1555[_0x22d496][_0x7f11('0x79')]],'%s',_0x3ede7b):_0x3ede7b;_0x3ede7b=_0x5f1555[_0x22d496][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x2cce70[_0x5f1555[_0x22d496][_0x7f11('0x7b')]],'%s',_0x3ede7b):_0x3ede7b;if(_0x5f1555[_0x22d496][_0x7f11('0x7c')]){_0x4fd35a[_0x7f11('0x6b')](_0x3ede7b);}_0x5f1555[_0x22d496]['orderBy']&&_0x4fd35a[_0x7f11('0x3f')](_0x3ede7b,_0x5f1555[_0x22d496][_0x7f11('0x7d')]===_0x7f11('0x7e')?![]:!![]);_0x4fd35a['field'](_0x3ede7b,_0x5f1555[_0x22d496][_0x7f11('0x7f')]||_0x3ede7b);}if(_0x498bfe[_0x7f11('0x80')]){_0x498bfe['joins']=JSON[_0x7f11('0x81')](_0x498bfe[_0x7f11('0x80')]);for(var _0x323f1c=0x0;_0x323f1c<_0x498bfe[_0x7f11('0x80')][_0x7f11('0x3c')];_0x323f1c+=0x1){if(_0x498bfe[_0x7f11('0x80')][_0x323f1c]['type']&&_[_0x7f11('0x67')](_0x2262c3,_0x498bfe['joins'][_0x323f1c][_0x7f11('0x34')])&&_0x498bfe[_0x7f11('0x80')][_0x323f1c][_0x7f11('0x82')]&&_0x498bfe['joins'][_0x323f1c][_0x7f11('0x83')]&&_0x498bfe['joins'][_0x323f1c]['foreignKey']){_0x4fd35a[_0x498bfe['joins'][_0x323f1c][_0x7f11('0x34')]](_0x498bfe[_0x7f11('0x80')][_0x323f1c]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x498bfe[_0x7f11('0x76')],_0x498bfe[_0x7f11('0x80')][_0x323f1c][_0x7f11('0x82')],_0x498bfe['joins'][_0x323f1c]['foreignTable'],_0x498bfe['joins'][_0x323f1c]['foreignKey']));}}}if(_0x498bfe[_0x7f11('0x84')]){_0x498bfe['conditions']=JSON[_0x7f11('0x81')](_0x498bfe[_0x7f11('0x84')]);_0x4fd35a[_0x7f11('0x44')](_0x452865(_0x498bfe['conditions'][_0x7f11('0x6b')]));}_0x167009=_0x4fd35a[_0x7f11('0x85')]();_0x4fd35a[_0x7f11('0x21')](_0x48dec5);_0x4fd35a[_0x7f11('0x1f')](0x0);logger[_0x7f11('0x86')](_0x7f11('0x87'),_0x4fd35a['toString']());return dbH['sequelize']['query'](_0x4fd35a[_0x7f11('0x88')](),{'type':dbH['sequelize'][_0x7f11('0x89')][_0x7f11('0x8a')]});}})[_0x7f11('0x28')](respondWithResult(_0x4278f0,null))[_0x7f11('0x4a')](handleError(_0x4278f0,null));};function runReport(_0x2c6f10,_0x3abc08,_0x5660){var _0x248acd=_0x3abc08[_0x7f11('0x2e')];var _0x5a1377=0xa;var _0x75fc9e=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0x2a7ec4={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':_0x7f11('0x8b'),'MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':_0x7f11('0x62')};var _0x36db1e={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7f11('0x66')};var _0x5629ac=function(_0x5d7ab){return!_[_0x7f11('0x67')](['IS\x20NULL',_0x7f11('0x8c'),_0x7f11('0x8d'),_0x7f11('0x68')],_0x5d7ab);};var _0x582b9d=function(_0x238d80){if(!_0x238d80||!_0x238d80[_0x7f11('0x69')]['length']){return'';}for(var _0x56e3fc='(',_0x4e1145=0x0;_0x4e1145<_0x238d80['rules']['length'];_0x4e1145+=0x1){_0x4e1145>0x0&&(_0x56e3fc+='\x20'+_0x238d80[_0x7f11('0x6a')]+'\x20');_0x56e3fc+=_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6b')]?_0x582b9d(_0x238d80[_0x7f11('0x69')][_0x4e1145]['group']):_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6c')]+'\x20'+_0x238d80[_0x7f11('0x69')][_0x4e1145][_0x7f11('0x6d')]+(_0x5629ac(_0x238d80['rules'][_0x4e1145]['condition'])?'\x20'+_0x238d80['rules'][_0x4e1145][_0x7f11('0x6e')]:'');}return _0x56e3fc+')';};var _0x54c468={'where':{'id':_0x2c6f10['id']}},_0x315f22,_0x2a10cc,_0x20b037,_0x3eec79,_0x2df338;_0x54c468=_['merge']({},_0x54c468,_0x5660);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x54c468)[_0x7f11('0x28')](function(_0x3b2b06){if(_0x3b2b06){_0x315f22=_0x3b2b06;return _0x3b2b06[_0x7f11('0x6f')]();}return null;})[_0x7f11('0x28')](function(_0xe5bcd3){if(_0xe5bcd3){if(!_0xe5bcd3[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))]['ValidationErrorItem'](_0x7f11('0x8e'),0x193);}_0x2a10cc=_0xe5bcd3;return db[_0x7f11('0x72')]['findAll']({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x2dbc13){if(_0x2dbc13){_0x20b037=_[_0x7f11('0x74')](_0x2dbc13,'id');var _0xfa5238;var _0x451311=squel[_0x7f11('0x75')]();_0x451311[_0x7f11('0x8f')](_0x315f22[_0x7f11('0x76')]);for(var _0x696d24=0x0;_0x696d24<_0x2a10cc[_0x7f11('0x3c')];_0x696d24+=0x1){_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x77')]?_0x20b037[_0x2a10cc[_0x696d24][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x2a10cc[_0x696d24][_0x7f11('0x6c')];_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0x2a7ec4[_0x2a10cc[_0x696d24][_0x7f11('0x79')]],'%s',_0xfa5238):_0xfa5238;_0xfa5238=_0x2a10cc[_0x696d24][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x36db1e[_0x2a10cc[_0x696d24][_0x7f11('0x7b')]],'%s',_0xfa5238):_0xfa5238;if(_0x2a10cc[_0x696d24][_0x7f11('0x7c')]){_0x451311[_0x7f11('0x6b')](_0xfa5238);}_0x2a10cc[_0x696d24]['orderBy']&&_0x451311[_0x7f11('0x3f')](_0xfa5238,_0x2a10cc[_0x696d24][_0x7f11('0x7d')]==='DESC'?![]:!![]);_0x451311[_0x7f11('0x6c')](_0xfa5238,_0x2a10cc[_0x696d24]['alias']||_0xfa5238);}if(_0x315f22[_0x7f11('0x80')]){_0x315f22['joins']=JSON['parse'](_0x315f22[_0x7f11('0x80')]);for(var _0x51cff1=0x0;_0x51cff1<_0x315f22[_0x7f11('0x80')][_0x7f11('0x3c')];_0x51cff1+=0x1){if(_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x34')]&&_[_0x7f11('0x67')](_0x75fc9e,_0x315f22['joins'][_0x51cff1]['type'])&&_0x315f22[_0x7f11('0x80')][_0x51cff1]['parentKey']&&_0x315f22['joins'][_0x51cff1]['foreignTable']&&_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x90')]){_0x451311[_0x315f22[_0x7f11('0x80')][_0x51cff1]['type']](_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x83')],null,util[_0x7f11('0x7b')](_0x7f11('0x91'),_0x315f22[_0x7f11('0x76')],_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x82')],_0x315f22[_0x7f11('0x80')][_0x51cff1][_0x7f11('0x83')],_0x315f22[_0x7f11('0x80')][_0x51cff1]['foreignKey']));}}}if(_0x315f22[_0x7f11('0x84')]){_0x315f22[_0x7f11('0x84')]=JSON[_0x7f11('0x81')](_0x315f22[_0x7f11('0x84')]);_0x451311[_0x7f11('0x44')](_0x582b9d(_0x315f22[_0x7f11('0x84')][_0x7f11('0x6b')]));}_0x2df338=_0x451311[_0x7f11('0x85')]();_0x451311['limit'](_0x5a1377);_0x451311[_0x7f11('0x1f')](0x0);return;}})[_0x7f11('0x28')](function(){if(_0x3abc08[_0x7f11('0x92')]===_0x7f11('0x93')){return null;}var _0x50aab1=_[_0x7f11('0x46')](_0x3abc08,{'name':_0x3abc08[_0x7f11('0x94')]||_0x3abc08[_0x7f11('0x2e')]||_0x315f22['name'],'basename':_0x248acd,'savename':util[_0x7f11('0x7b')](_0x7f11('0x95'),_0x3abc08['name']||_0x315f22['name'],require(_0x7f11('0x96'))[_0x7f11('0x97')](0x4),_0x3abc08[_0x7f11('0x92')]||_0x7f11('0x98')),'reportId':_0x315f22['id'],'reportType':_0x7f11('0x99')});return db[_0x7f11('0x9a')][_0x7f11('0x4f')](_0x50aab1,{'raw':!![]});})['then'](function(_0x439e62){if(_0x315f22[_0x7f11('0x76')]==='cdr'){_0x2df338[_0x7f11('0x44')](_0x315f22[_0x7f11('0x76')]+_0x7f11('0x9b'),_0x3abc08[_0x7f11('0x9c')],_0x3abc08[_0x7f11('0x9d')]);}else{_0x2df338[_0x7f11('0x44')](_0x315f22[_0x7f11('0x76')]+_0x7f11('0x9e'),_0x3abc08[_0x7f11('0x9c')],_0x3abc08[_0x7f11('0x9d')]);}if(_0x439e62){logger[_0x7f11('0x9f')](_0x7f11('0xa0'),_0x2df338[_0x7f11('0x88')]());require(_0x7f11('0xa1'))['fork'](path[_0x7f11('0x58')](__dirname,_0x7f11('0xa2'),_0x439e62[_0x7f11('0x92')]),[_0x439e62['id'],_0x2df338[_0x7f11('0x88')](),path['join'](__dirname,'../../files/reports',_0x439e62[_0x7f11('0xa3')]),_0x248acd]);return _0x439e62;}else{var _0x18222c=squel[_0x7f11('0x75')]();_0x18222c[_0x7f11('0x8f')]('('+_0x2df338['toString']()+')',_0x7f11('0xa4'));_0x18222c[_0x7f11('0x6c')](_0x7f11('0xa5'),'count');_0x2df338['limit'](_0x3abc08['limit']||_0x5a1377);_0x2df338[_0x7f11('0x1f')](_0x3abc08['offset']||0x0);return dbH[_0x7f11('0xa6')][_0x7f11('0x37')](_0x18222c[_0x7f11('0x88')](),{'type':dbH[_0x7f11('0xa6')][_0x7f11('0x89')]['SELECT']})[_0x7f11('0x28')](function(_0x1fb9de){if(!_0x1fb9de['length']){_0x3eec79=0x0;}else{_0x3eec79=_0x1fb9de[0x0][_0x7f11('0x22')]||0x0;}return dbH[_0x7f11('0xa6')]['query'](_0x2df338[_0x7f11('0x88')](),{'type':dbH[_0x7f11('0xa6')][_0x7f11('0x89')]['SELECT']});})[_0x7f11('0x28')](function(_0x495a95){return{'rows':_0x495a95||[],'count':_0x3eec79};});}});}exports[_0x7f11('0xa7')]=function(_0x4e0873,_0x5963f8){return runReport(_0x4e0873['params'],_0x4e0873[_0x7f11('0x37')],_0x4e0873[_0x7f11('0x4d')])[_0x7f11('0x28')](respondWithResult(_0x5963f8,null))['catch'](handleError(_0x5963f8,null));};exports[_0x7f11('0xa8')]=runReport;exports[_0x7f11('0x37')]=function(_0x2c82e,_0x2de410){var _0x4212ea=0xa;var _0x29e09a=[_0x7f11('0x58'),_0x7f11('0x59'),_0x7f11('0x5a'),_0x7f11('0x5b')];var _0xa15263={'SUM':_0x7f11('0x5c'),'COUNT':_0x7f11('0x5d'),'COUNT DISTINCT':_0x7f11('0x5e'),'MAX':_0x7f11('0x8b'),'MIN':_0x7f11('0x5f'),'AVG':_0x7f11('0x60'),'GROUP_CONCAT':_0x7f11('0xa9'),'GROUP_CONCAT ASC':_0x7f11('0x61'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3623d5={'SEC_TO_TIME':_0x7f11('0x63'),'DATE':_0x7f11('0x64'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x531a18=function(_0x3d0174){return!_[_0x7f11('0x67')]([_0x7f11('0xaa'),_0x7f11('0x8c'),_0x7f11('0x8d'),'IS\x20NOT\x20EMPTY'],_0x3d0174);};var _0x45dfa8=function(_0x22e4d7){if(!_0x22e4d7||!_0x22e4d7[_0x7f11('0x69')][_0x7f11('0x3c')]){return'';}for(var _0x4fc2e2='(',_0x190f52=0x0;_0x190f52<_0x22e4d7['rules'][_0x7f11('0x3c')];_0x190f52+=0x1){_0x190f52>0x0&&(_0x4fc2e2+='\x20'+_0x22e4d7['operator']+'\x20');_0x4fc2e2+=_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6b')]?_0x45dfa8(_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6b')]):_0x22e4d7[_0x7f11('0x69')][_0x190f52][_0x7f11('0x6c')]+'\x20'+_0x22e4d7[_0x7f11('0x69')][_0x190f52]['condition']+(_0x531a18(_0x22e4d7['rules'][_0x190f52][_0x7f11('0x6d')])?'\x20'+_0x22e4d7[_0x7f11('0x69')][_0x190f52]['value']:'');}return _0x4fc2e2+')';};var _0x7b4682={'where':{'id':_0x2c82e['params']['id']}},_0x5adcf0,_0x3db2f7,_0x11ae98,_0x3c44a0,_0x132392;_0x7b4682=_[_0x7f11('0x46')]({},_0x7b4682,_0x2c82e[_0x7f11('0x4d')]);return db[_0x7f11('0x32')][_0x7f11('0x4e')](_0x7b4682)['then'](function(_0x251da5){if(_0x251da5){_0x5adcf0=_0x251da5;return _0x251da5[_0x7f11('0x6f')]();}return null;})['then'](function(_0x3c055c){if(_0x3c055c){if(!_0x3c055c[_0x7f11('0x3c')]){throw new db[(_0x7f11('0x70'))][(_0x7f11('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3db2f7=_0x3c055c;return db[_0x7f11('0x72')][_0x7f11('0x73')]({'raw':!![]});}return null;})[_0x7f11('0x28')](function(_0x177fd9){if(_0x177fd9){_0x11ae98=_[_0x7f11('0x74')](_0x177fd9,'id');var _0x392786;var _0x45e0dc=squel[_0x7f11('0x75')]();_0x45e0dc[_0x7f11('0x8f')](_0x5adcf0[_0x7f11('0x76')]);for(var _0x238144=0x0;_0x238144<_0x3db2f7['length'];_0x238144+=0x1){_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x77')]?_0x11ae98[_0x3db2f7[_0x238144][_0x7f11('0x77')]][_0x7f11('0x78')]:_0x3db2f7[_0x238144][_0x7f11('0x6c')];_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x79')]?_[_0x7f11('0x7a')](_0xa15263[_0x3db2f7[_0x238144][_0x7f11('0x79')]],'%s',_0x392786):_0x392786;_0x392786=_0x3db2f7[_0x238144][_0x7f11('0x7b')]?_[_0x7f11('0x7a')](_0x3623d5[_0x3db2f7[_0x238144]['format']],'%s',_0x392786):_0x392786;if(_0x3db2f7[_0x238144][_0x7f11('0x7c')]){_0x45e0dc[_0x7f11('0x6b')](_0x392786);}_0x3db2f7[_0x238144][_0x7f11('0x7d')]&&_0x45e0dc[_0x7f11('0x3f')](_0x392786,_0x3db2f7[_0x238144][_0x7f11('0x7d')]===_0x7f11('0x7e')?![]:!![]);_0x45e0dc[_0x7f11('0x6c')](_0x392786,_0x3db2f7[_0x238144]['alias']||_0x392786);}if(_0x5adcf0[_0x7f11('0x80')]){_0x5adcf0[_0x7f11('0x80')]=JSON['parse'](_0x5adcf0[_0x7f11('0x80')]);for(var _0x27e455=0x0;_0x27e455<_0x5adcf0[_0x7f11('0x80')][_0x7f11('0x3c')];_0x27e455+=0x1){if(_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')]&&_[_0x7f11('0x67')](_0x29e09a,_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')])&&_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x82')]&&_0x5adcf0[_0x7f11('0x80')][_0x27e455]['foreignTable']&&_0x5adcf0[_0x7f11('0x80')][_0x27e455]['foreignKey']){_0x45e0dc[_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x34')]](_0x5adcf0['joins'][_0x27e455][_0x7f11('0x83')],null,util[_0x7f11('0x7b')]('%s.%s\x20=\x20%s.%s',_0x5adcf0['table'],_0x5adcf0['joins'][_0x27e455][_0x7f11('0x82')],_0x5adcf0['joins'][_0x27e455][_0x7f11('0x83')],_0x5adcf0[_0x7f11('0x80')][_0x27e455][_0x7f11('0x90')]));}}}if(_0x5adcf0['conditions']){_0x5adcf0[_0x7f11('0x84')]=JSON[_0x7f11('0x81')](_0x5adcf0[_0x7f11('0x84')]);_0x45e0dc[_0x7f11('0x44')](_0x45dfa8(_0x5adcf0[_0x7f11('0x84')][_0x7f11('0x6b')]));}_0x132392=_0x45e0dc[_0x7f11('0x85')]();_0x45e0dc[_0x7f11('0x21')](_0x4212ea);_0x45e0dc[_0x7f11('0x1f')](0x0);logger[_0x7f11('0x86')](_0x7f11('0x87'),_0x45e0dc[_0x7f11('0x88')]());return dbH[_0x7f11('0xa6')][_0x7f11('0x37')](_0x45e0dc[_0x7f11('0x88')](),{'type':dbH['sequelize'][_0x7f11('0x89')][_0x7f11('0x8a')]});}})[_0x7f11('0x28')](function(){return{'sql':_0x132392['toString']()};})[_0x7f11('0x28')](respondWithResult(_0x2de410,null))[_0x7f11('0x4a')](handleError(_0x2de410,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index c948751..9f0c8fa 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 _0xd78e=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','define','AnalyticCustomReport','analytics_custom_reports','lodash'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xd78e,0x83));var _0xed78=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xd78e[_0x8c1005];return _0x175354;};'use strict';var _=require(_0xed78('0x0'));var util=require(_0xed78('0x1'));var logger=require(_0xed78('0x2'))('api');var moment=require(_0xed78('0x3'));var BPromise=require(_0xed78('0x4'));var rp=require(_0xed78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed78('0x6'));var config=require(_0xed78('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x1a6389,_0x16ea14){return _0x1a6389[_0xed78('0x8')](_0xed78('0x9'),attributes,{'tableName':_0xed78('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8ce=['analytics_custom_reports','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x306626,_0x425e93){var _0x466728=function(_0x3b3478){while(--_0x3b3478){_0x306626['push'](_0x306626['shift']());}};_0x466728(++_0x425e93);}(_0xf8ce,0x1da));var _0xef8c=function(_0x41d9a8,_0x386c27){_0x41d9a8=_0x41d9a8-0x0;var _0x146498=_0xf8ce[_0x41d9a8];return _0x146498;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xef8c('0x0'))(_0xef8c('0x1'));var moment=require(_0xef8c('0x2'));var BPromise=require(_0xef8c('0x3'));var rp=require(_0xef8c('0x4'));var fs=require('fs');var path=require(_0xef8c('0x5'));var rimraf=require(_0xef8c('0x6'));var config=require(_0xef8c('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0xef8c('0x8')]=function(_0x56149c,_0x57e0fd){return _0x56149c[_0xef8c('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0xef8c('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 c8ab46f..71753d6 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 _0xa1dc=['catch','AnalyticCustomReport,\x20%s,\x20%s','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','debug','request\x20sent','stringify','error','code','message','result'];(function(_0x1d2a6c,_0x4523a9){var _0x30e0c9=function(_0x32fb85){while(--_0x32fb85){_0x1d2a6c['push'](_0x1d2a6c['shift']());}};_0x30e0c9(++_0x4523a9);}(_0xa1dc,0xaa));var _0xca1d=function(_0x54dc96,_0x360e0c){_0x54dc96=_0x54dc96-0x0;var _0x3ec0f1=_0xa1dc[_0x54dc96];return _0x3ec0f1;};'use strict';var _=require(_0xca1d('0x0'));var util=require(_0xca1d('0x1'));var moment=require(_0xca1d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca1d('0x3'));var db=require(_0xca1d('0x4'))['db'];var utils=require(_0xca1d('0x5'));var logger=require(_0xca1d('0x6'))(_0xca1d('0x7'));var config=require('../../config/environment');var jayson=require(_0xca1d('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a0c99,_0x2765d2,_0x486080){return new BPromise(function(_0x261116,_0x4572d9){return client[_0xca1d('0x9')](_0x4a0c99,_0x486080)[_0xca1d('0xa')](function(_0x2d7535){logger[_0xca1d('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,'request\x20sent');logger[_0xca1d('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2765d2,_0xca1d('0xd'),JSON[_0xca1d('0xe')](_0x2d7535));if(_0x2d7535[_0xca1d('0xf')]){if(_0x2d7535[_0xca1d('0xf')][_0xca1d('0x10')]===0x1f4){logger[_0xca1d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,_0x2d7535[_0xca1d('0xf')][_0xca1d('0x11')]);return _0x4572d9(_0x2d7535[_0xca1d('0xf')][_0xca1d('0x11')]);}logger[_0xca1d('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,_0x2d7535[_0xca1d('0xf')]['message']);return _0x261116(_0x2d7535[_0xca1d('0xf')]['message']);}else{logger[_0xca1d('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2765d2,_0xca1d('0xd'));_0x261116(_0x2d7535[_0xca1d('0x12')][_0xca1d('0x11')]);}})[_0xca1d('0x13')](function(_0xb24df6){logger[_0xca1d('0xf')](_0xca1d('0x14'),_0x2765d2,_0xb24df6);_0x4572d9(_0xb24df6);});});} \ No newline at end of file +var _0x1872=['then','info','request\x20sent','debug','stringify','code','error','AnalyticCustomReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x3a7189,_0x429f51){var _0x47f36b=function(_0x19781b){while(--_0x19781b){_0x3a7189['push'](_0x3a7189['shift']());}};_0x47f36b(++_0x429f51);}(_0x1872,0xa3));var _0x2187=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0x1872[_0x3b8ed6];return _0x2e6223;};'use strict';var _=require(_0x2187('0x0'));var util=require(_0x2187('0x1'));var moment=require(_0x2187('0x2'));var BPromise=require(_0x2187('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2187('0x4'));var db=require(_0x2187('0x5'))['db'];var utils=require(_0x2187('0x6'));var logger=require(_0x2187('0x7'))(_0x2187('0x8'));var config=require(_0x2187('0x9'));var jayson=require(_0x2187('0xa'));var client=jayson['client'][_0x2187('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xec26ed,_0xa25c54,_0x3a9fb6){return new BPromise(function(_0x15d738,_0x400650){return client[_0x2187('0xc')](_0xec26ed,_0x3a9fb6)[_0x2187('0xd')](function(_0x2c7c2b){logger[_0x2187('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xa25c54,_0x2187('0xf'));logger[_0x2187('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xa25c54,_0x2187('0xf'),JSON[_0x2187('0x11')](_0x2c7c2b));if(_0x2c7c2b['error']){if(_0x2c7c2b['error'][_0x2187('0x12')]===0x1f4){logger[_0x2187('0x13')](_0x2187('0x14'),_0xa25c54,_0x2c7c2b[_0x2187('0x13')]['message']);return _0x400650(_0x2c7c2b['error'][_0x2187('0x15')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xa25c54,_0x2c7c2b[_0x2187('0x13')]['message']);return _0x15d738(_0x2c7c2b[_0x2187('0x13')]['message']);}else{logger[_0x2187('0xe')](_0x2187('0x14'),_0xa25c54,_0x2187('0xf'));_0x15d738(_0x2c7c2b['result']['message']);}})['catch'](function(_0x126e90){logger[_0x2187('0x13')](_0x2187('0x14'),_0xa25c54,_0x126e90);_0x400650(_0x126e90);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index b1b5aa7..13ac362 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 _0xeb52=['/:id/run','run','/:id/query','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','show','/:id/preview','preview'];(function(_0xf9a335,_0x2c5784){var _0x8c0ca4=function(_0x388d8a){while(--_0x388d8a){_0xf9a335['push'](_0xf9a335['shift']());}};_0x8c0ca4(++_0x2c5784);}(_0xeb52,0x113));var _0x2eb5=function(_0x30f788,_0x9a4ef5){_0x30f788=_0x30f788-0x0;var _0x39d80c=_0xeb52[_0x30f788];return _0x39d80c;};'use strict';var multer=require(_0x2eb5('0x0'));var util=require('util');var path=require(_0x2eb5('0x1'));var timeout=require(_0x2eb5('0x2'));var express=require(_0x2eb5('0x3'));var router=express[_0x2eb5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2eb5('0x5'));var config=require('../../config/environment');var controller=require(_0x2eb5('0x6'));router[_0x2eb5('0x7')]('/',auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x9')]);router['get']('/:id',auth[_0x2eb5('0x8')](),controller[_0x2eb5('0xa')]);router[_0x2eb5('0x7')](_0x2eb5('0xb'),auth['isAuthenticated'](),controller[_0x2eb5('0xc')]);router[_0x2eb5('0x7')](_0x2eb5('0xd'),auth[_0x2eb5('0x8')](),controller[_0x2eb5('0xe')]);router['get'](_0x2eb5('0xf'),auth[_0x2eb5('0x8')](),controller['query']);router[_0x2eb5('0x10')]('/',auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x11')]);router[_0x2eb5('0x12')](_0x2eb5('0x13'),auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x14')]);router[_0x2eb5('0x15')](_0x2eb5('0x13'),auth[_0x2eb5('0x8')](),controller[_0x2eb5('0x16')]);module[_0x2eb5('0x17')]=router; \ No newline at end of file +var _0x926a=['update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/preview','isAuthenticated','preview','/:id/run','query','post','create','put'];(function(_0x44dce7,_0x32e89e){var _0x4ee56e=function(_0x285afb){while(--_0x285afb){_0x44dce7['push'](_0x44dce7['shift']());}};_0x4ee56e(++_0x32e89e);}(_0x926a,0x146));var _0xa926=function(_0xe06035,_0x22a4f9){_0xe06035=_0xe06035-0x0;var _0x352a58=_0x926a[_0xe06035];return _0x352a58;};'use strict';var multer=require(_0xa926('0x0'));var util=require(_0xa926('0x1'));var path=require(_0xa926('0x2'));var timeout=require('connect-timeout');var express=require(_0xa926('0x3'));var router=express['Router']();var fs_extra=require(_0xa926('0x4'));var auth=require(_0xa926('0x5'));var interaction=require(_0xa926('0x6'));var config=require(_0xa926('0x7'));var controller=require('./analyticCustomReport.controller');router[_0xa926('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa926('0x8')](_0xa926('0x9'),auth['isAuthenticated'](),controller[_0xa926('0xa')]);router['get'](_0xa926('0xb'),auth[_0xa926('0xc')](),controller[_0xa926('0xd')]);router[_0xa926('0x8')](_0xa926('0xe'),auth[_0xa926('0xc')](),controller['run']);router[_0xa926('0x8')]('/:id/query',auth[_0xa926('0xc')](),controller[_0xa926('0xf')]);router[_0xa926('0x10')]('/',auth[_0xa926('0xc')](),controller[_0xa926('0x11')]);router[_0xa926('0x12')](_0xa926('0x9'),auth[_0xa926('0xc')](),controller[_0xa926('0x13')]);router[_0xa926('0x14')](_0xa926('0x9'),auth['isAuthenticated'](),controller[_0xa926('0x15')]);module[_0xa926('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 84dca59..e2053e3 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 _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x89e3b9,_0x37db7f){var _0x5c1b19=function(_0x3c8b52){while(--_0x3c8b52){_0x89e3b9['push'](_0x89e3b9['shift']());}};_0x5c1b19(++_0x37db7f);}(_0x1883,0xab));var _0x3188=function(_0x54e096,_0x2245ac){_0x54e096=_0x54e096-0x0;var _0x386a42=_0x1883[_0x54e096];return _0x386a42;};'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 +var _0xee14=['STRING','TEXT'];(function(_0x459367,_0x45609c){var _0x7a0561=function(_0x53a812){while(--_0x53a812){_0x459367['push'](_0x459367['shift']());}};_0x7a0561(++_0x45609c);}(_0xee14,0x13a));var _0x4ee1=function(_0x554e00,_0x2d1b2e){_0x554e00=_0x554e00-0x0;var _0x5165f6=_0xee14[_0x554e00];return _0x5165f6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index a29517c..8fccb2f 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 _0xabce=['where','findAll','show','includeAll','options','find','catch','create','body','user','role','Reports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','table','MetricId','field','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ValidationErrorItem','AnalyticMetric','keyBy','select','metric','DESC','foreignKey','output','web','%s-%s.%s','default','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','sequelize','QueryTypes','run','runReport','Sequelize','alias','clone','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','limit','undefined','count','set','json','apply','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabce,0x103));var _0xeabc=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xabce[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];var dbH=require(_0xeabc('0x19'))[_0xeabc('0x1a')];function respondWithStatusCode(_0xcfbf06,_0x53df9c){_0x53df9c=_0x53df9c||0xcc;return function(_0x235c2d){if(_0x235c2d){return _0xcfbf06[_0xeabc('0x1b')](_0x53df9c);}return _0xcfbf06[_0xeabc('0x1c')](_0x53df9c)['end']();};}function respondWithResult(_0x5f4ee8,_0x3170ea){_0x3170ea=_0x3170ea||0xc8;return function(_0x3ae954){if(_0x3ae954){return _0x5f4ee8[_0xeabc('0x1c')](_0x3170ea)['json'](_0x3ae954);}};}function respondWithFilteredResult(_0xf913d7,_0x638976){return function(_0x49f2d8){if(_0x49f2d8){var _0x53fe28=typeof _0x638976[_0xeabc('0x1d')]==='undefined'&&typeof _0x638976[_0xeabc('0x1e')]===_0xeabc('0x1f');var _0x58a3c0=_0x49f2d8[_0xeabc('0x20')];var _0x31dd53=_0x53fe28?0x0:_0x638976[_0xeabc('0x1d')];var _0x384be5=_0x53fe28?_0x49f2d8[_0xeabc('0x20')]:_0x638976['offset']+_0x638976[_0xeabc('0x1e')];var _0x4d68ea;if(_0x384be5>=_0x58a3c0){_0x384be5=_0x58a3c0;_0x4d68ea=0xc8;}else{_0x4d68ea=0xce;}_0xf913d7[_0xeabc('0x1c')](_0x4d68ea);return _0xf913d7[_0xeabc('0x21')]('Content-Range',_0x31dd53+'-'+_0x384be5+'/'+_0x58a3c0)[_0xeabc('0x22')](_0x49f2d8);}return null;};}function patchUpdates(_0x41d67a){return function(_0x254590){try{jsonpatch[_0xeabc('0x23')](_0x254590,_0x41d67a,!![]);}catch(_0x3c9611){return BPromise['reject'](_0x3c9611);}return _0x254590[_0xeabc('0x24')]();};}function saveUpdates(_0x10c675,_0x91ab00){return function(_0x5bdd57){if(_0x5bdd57){return _0x5bdd57[_0xeabc('0x25')](_0x10c675)[_0xeabc('0x26')](function(_0x214953){return _0x214953;});}return null;};}function removeEntity(_0x319119,_0x5b8838){return function(_0x109e1d){if(_0x109e1d){return _0x109e1d['destroy']()[_0xeabc('0x26')](function(){var _0x4d4e29=_0x109e1d[_0xeabc('0x27')]({'plain':!![]});var _0x12acbd=_0xeabc('0x28');return db[_0xeabc('0x29')][_0xeabc('0x2a')]({'where':{'type':_0x12acbd,'resourceId':_0x4d4e29['id']}})[_0xeabc('0x26')](function(){return _0x109e1d;});})[_0xeabc('0x26')](function(){_0x319119['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x459c8a,_0x5bf8f2){return function(_0x3c1b5b){if(!_0x3c1b5b){_0x459c8a[_0xeabc('0x1b')](0x194);}return _0x3c1b5b;};}function handleError(_0x48fb52,_0x2163e6){_0x2163e6=_0x2163e6||0x1f4;return function(_0x38572d){logger[_0xeabc('0x2b')](_0x38572d[_0xeabc('0x2c')]);if(_0x38572d[_0xeabc('0x2d')]){delete _0x38572d[_0xeabc('0x2d')];}_0x48fb52[_0xeabc('0x1c')](_0x2163e6)[_0xeabc('0x2e')](_0x38572d);};}exports[_0xeabc('0x2f')]=function(_0x5ebb86,_0x5b34dd){var _0x5bb1f1={},_0x2f03e8={},_0x2d027e={'count':0x0,'rows':[]};var _0x98b445=_[_0xeabc('0x30')](db[_0xeabc('0x31')][_0xeabc('0x32')],function(_0x61c0af){return{'name':_0x61c0af['fieldName'],'type':_0x61c0af[_0xeabc('0x33')][_0xeabc('0x34')]};});_0x2f03e8[_0xeabc('0x35')]=_['map'](_0x98b445,_0xeabc('0x2d'));_0x2f03e8[_0xeabc('0x36')]=_[_0xeabc('0x37')](_0x5ebb86['query']);_0x2f03e8[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0x2f03e8[_0xeabc('0x35')],_0x2f03e8['query']);_0x5bb1f1[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0x2f03e8['model'],qs['fields'](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x5bb1f1['attributes']=_0x5bb1f1[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x5bb1f1[_0xeabc('0x3a')]:_0x2f03e8[_0xeabc('0x35')];if(!_0x5ebb86[_0xeabc('0x36')]['hasOwnProperty'](_0xeabc('0x3d'))){_0x5bb1f1['limit']=qs[_0xeabc('0x1e')](_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x1e')]);_0x5bb1f1['offset']=qs['offset'](_0x5ebb86[_0xeabc('0x36')]['offset']);}_0x5bb1f1[_0xeabc('0x3e')]=qs['sort'](_0x5ebb86['query']['sort']);_0x5bb1f1['where']=qs[_0xeabc('0x38')](_['pick'](_0x5ebb86[_0xeabc('0x36')],_0x2f03e8[_0xeabc('0x38')]),_0x98b445);if(_0x5ebb86['query'][_0xeabc('0x3f')]){_0x5bb1f1['where']=_[_0xeabc('0x40')](_0x5bb1f1['where'],{'$or':_[_0xeabc('0x30')](_0x98b445,function(_0xf1b7ef){if(_0xf1b7ef[_0xeabc('0x33')]!=='VIRTUAL'){var _0x5a00d0={};_0x5a00d0[_0xf1b7ef['name']]={'$like':'%'+_0x5ebb86[_0xeabc('0x36')][_0xeabc('0x3f')]+'%'};return _0x5a00d0;}})});}_0x5bb1f1=_[_0xeabc('0x40')]({},_0x5bb1f1,_0x5ebb86['options']);var _0x4f1897={'where':_0x5bb1f1[_0xeabc('0x41')]};return db[_0xeabc('0x31')]['count'](_0x4f1897)[_0xeabc('0x26')](function(_0x5e0b78){_0x2d027e[_0xeabc('0x20')]=_0x5e0b78;if(_0x5ebb86['query']['includeAll']){_0x5bb1f1['include']=[{'all':!![]}];}return db[_0xeabc('0x31')][_0xeabc('0x42')](_0x5bb1f1);})[_0xeabc('0x26')](function(_0x3eeeb5){_0x2d027e['rows']=_0x3eeeb5;return _0x2d027e;})[_0xeabc('0x26')](respondWithFilteredResult(_0x5b34dd,_0x5bb1f1))['catch'](handleError(_0x5b34dd,null));};exports[_0xeabc('0x43')]=function(_0x1a4bbe,_0x3a7807){var _0x17a0df={'raw':!![],'where':{'id':_0x1a4bbe['params']['id']}},_0xc849c9={};_0xc849c9['model']=_[_0xeabc('0x37')](db['AnalyticDefaultReport'][_0xeabc('0x32')]);_0xc849c9[_0xeabc('0x36')]=_['keys'](_0x1a4bbe[_0xeabc('0x36')]);_0xc849c9[_0xeabc('0x38')]=_[_0xeabc('0x39')](_0xc849c9[_0xeabc('0x35')],_0xc849c9[_0xeabc('0x36')]);_0x17a0df[_0xeabc('0x3a')]=_[_0xeabc('0x39')](_0xc849c9['model'],qs[_0xeabc('0x3b')](_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x3b')]));_0x17a0df[_0xeabc('0x3a')]=_0x17a0df[_0xeabc('0x3a')][_0xeabc('0x3c')]?_0x17a0df[_0xeabc('0x3a')]:_0xc849c9[_0xeabc('0x35')];if(_0x1a4bbe[_0xeabc('0x36')][_0xeabc('0x44')]){_0x17a0df['include']=[{'all':!![]}];}_0x17a0df=_[_0xeabc('0x40')]({},_0x17a0df,_0x1a4bbe[_0xeabc('0x45')]);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x17a0df)[_0xeabc('0x26')](handleEntityNotFound(_0x3a7807,null))[_0xeabc('0x26')](respondWithResult(_0x3a7807,null))[_0xeabc('0x47')](handleError(_0x3a7807,null));};exports['create']=function(_0x766743,_0x32e09b){return db[_0xeabc('0x31')][_0xeabc('0x48')](_0x766743[_0xeabc('0x49')],{})['then'](function(_0x305946){var _0x2b2b9c=_0x766743[_0xeabc('0x4a')][_0xeabc('0x27')]({'plain':!![]});if(!_0x2b2b9c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b2b9c[_0xeabc('0x4b')]===_0xeabc('0x4a')){var _0x568847=_0x305946[_0xeabc('0x27')]({'plain':!![]});var _0x5a0d4d=_0xeabc('0x4c');return db['UserProfileSection'][_0xeabc('0x46')]({'where':{'name':_0x5a0d4d,'userProfileId':_0x2b2b9c[_0xeabc('0x4d')]},'raw':!![]})[_0xeabc('0x26')](function(_0x1524c3){if(_0x1524c3&&_0x1524c3[_0xeabc('0x4e')]===0x0){return db[_0xeabc('0x29')][_0xeabc('0x48')]({'name':_0x568847[_0xeabc('0x2d')],'resourceId':_0x568847['id'],'type':_0xeabc('0x28'),'sectionId':_0x1524c3['id']},{})[_0xeabc('0x26')](function(){return _0x305946;});}else{return _0x305946;}})['catch'](function(_0x180a14){logger[_0xeabc('0x2b')](_0xeabc('0x4f'),_0x180a14);throw _0x180a14;});}return _0x305946;})[_0xeabc('0x26')](respondWithResult(_0x32e09b,0xc9))['catch'](handleError(_0x32e09b,null));};exports[_0xeabc('0x25')]=function(_0x392913,_0x10d56f){if(_0x392913[_0xeabc('0x49')]['id']){delete _0x392913['body']['id'];}return db[_0xeabc('0x31')][_0xeabc('0x46')]({'where':{'id':_0x392913[_0xeabc('0x50')]['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x10d56f,null))[_0xeabc('0x26')](saveUpdates(_0x392913[_0xeabc('0x49')],null))[_0xeabc('0x26')](respondWithResult(_0x10d56f,null))[_0xeabc('0x47')](handleError(_0x10d56f,null));};exports[_0xeabc('0x2a')]=function(_0x58ab08,_0x4546c4){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x58ab08['params']['id']}})[_0xeabc('0x26')](handleEntityNotFound(_0x4546c4,null))[_0xeabc('0x26')](removeEntity(_0x4546c4,null))[_0xeabc('0x47')](handleError(_0x4546c4,null));};exports[_0xeabc('0x51')]=function(_0xe89728,_0x2f78f3){var _0x4a2ad6=0xa;var _0x4358d7=[_0xeabc('0x52'),_0xeabc('0x53'),_0xeabc('0x54'),_0xeabc('0x55')];var _0x2c7b4e={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x536f42={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x26c784=function(_0xc2ef0c){return!_['includes']([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0xc2ef0c);};var _0x11cc1f=function(_0x514787){if(!_0x514787||!_0x514787['rules'][_0xeabc('0x3c')]){return'';}for(var _0x7b659f='(',_0x1b6675=0x0;_0x1b6675<_0x514787[_0xeabc('0x64')][_0xeabc('0x3c')];_0x1b6675+=0x1){_0x1b6675>0x0&&(_0x7b659f+='\x20'+_0x514787[_0xeabc('0x65')]+'\x20');_0x7b659f+=_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x66')]?_0x11cc1f(_0x514787[_0xeabc('0x64')][_0x1b6675]['group']):_0x514787[_0xeabc('0x64')][_0x1b6675]['field']+'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')]+(_0x26c784(_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x67')])?'\x20'+_0x514787[_0xeabc('0x64')][_0x1b6675][_0xeabc('0x68')]:'');}return _0x7b659f+')';};var _0xf48062={'where':{'id':_0xe89728[_0xeabc('0x50')]['id']}},_0xb59a2a,_0x5d4bc2,_0x24d0e5,_0x5702cb,_0x3fa31b;_0xf48062=_[_0xeabc('0x40')]({},_0xf48062,_0xe89728[_0xeabc('0x45')]);return db['AnalyticDefaultReport'][_0xeabc('0x46')](_0xf48062)['then'](function(_0x54e7d6){if(_0x54e7d6){_0xb59a2a=_0x54e7d6;return _0x54e7d6[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x23270a){if(_0x23270a){if(!_0x23270a[_0xeabc('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0xeabc('0x6a'),0x193);}_0x5d4bc2=_0x23270a;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xeabc('0x26')](function(_0x4f1a4f){if(_0x4f1a4f){_0x24d0e5=_['keyBy'](_0x4f1a4f,'id');var _0xa44f2d;var _0x1c84b5=squel['select']();_0x1c84b5['from'](_0xb59a2a[_0xeabc('0x6b')]);for(var _0x5d183a=0x0;_0x5d183a<_0x5d4bc2[_0xeabc('0x3c')];_0x5d183a+=0x1){_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6c')]?_0x24d0e5[_0x5d4bc2[_0x5d183a]['MetricId']]['metric']:_0x5d4bc2[_0x5d183a][_0xeabc('0x6d')];_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x2c7b4e[_0x5d4bc2[_0x5d183a][_0xeabc('0x6e')]],'%s',_0xa44f2d):_0xa44f2d;_0xa44f2d=_0x5d4bc2[_0x5d183a][_0xeabc('0x70')]?_['replace'](_0x536f42[_0x5d4bc2[_0x5d183a]['format']],'%s',_0xa44f2d):_0xa44f2d;if(_0x5d4bc2[_0x5d183a][_0xeabc('0x71')]){_0x1c84b5['group'](_0xa44f2d);}_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]&&_0x1c84b5['order'](_0xa44f2d,_0x5d4bc2[_0x5d183a][_0xeabc('0x72')]==='DESC'?![]:!![]);_0x1c84b5[_0xeabc('0x6d')](_0xa44f2d,_0x5d4bc2[_0x5d183a]['alias']||_0xa44f2d);}if(_0xb59a2a[_0xeabc('0x73')]){_0xb59a2a[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x73')]);for(var _0x5e121c=0x0;_0x5e121c<_0xb59a2a[_0xeabc('0x73')]['length'];_0x5e121c+=0x1){if(_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x4358d7,_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')])&&_0xb59a2a['joins'][_0x5e121c][_0xeabc('0x76')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')]&&_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']){_0x1c84b5[_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x33')]](_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x77')],null,util['format'](_0xeabc('0x78'),_0xb59a2a[_0xeabc('0x6b')],_0xb59a2a[_0xeabc('0x73')][_0x5e121c][_0xeabc('0x76')],_0xb59a2a['joins'][_0x5e121c]['foreignTable'],_0xb59a2a[_0xeabc('0x73')][_0x5e121c]['foreignKey']));}}}if(_0xb59a2a['conditions']){_0xb59a2a[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0xb59a2a[_0xeabc('0x79')]);_0x1c84b5['where'](_0x11cc1f(_0xb59a2a[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3fa31b=_0x1c84b5['clone']();_0x1c84b5[_0xeabc('0x1e')](_0x4a2ad6);_0x1c84b5[_0xeabc('0x1d')](0x0);logger[_0xeabc('0x7a')](_0xeabc('0x7b'),_0x1c84b5[_0xeabc('0x7c')]());return dbH['sequelize'][_0xeabc('0x36')](_0x1c84b5['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](respondWithResult(_0x2f78f3,null))[_0xeabc('0x47')](handleError(_0x2f78f3,null));};function runReport(_0x4424ce,_0x33fa74,_0x51368f){var _0x39f961=_0x33fa74['name'];var _0x1795fe=0xa;var _0x2f95c7=['join',_0xeabc('0x53'),'right_join','cross_join'];var _0x952dc7={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':'MIN(%s)','AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x348064={'SEC_TO_TIME':_0xeabc('0x81'),'DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':_0xeabc('0x5e'),'UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x522c6e=function(_0x436f8e){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xeabc('0x63')],_0x436f8e);};var _0x273ca5=function(_0xe90200){if(!_0xe90200||!_0xe90200[_0xeabc('0x64')][_0xeabc('0x3c')]){return'';}for(var _0x5f5a47='(',_0x289f98=0x0;_0x289f98<_0xe90200['rules']['length'];_0x289f98+=0x1){_0x289f98>0x0&&(_0x5f5a47+='\x20'+_0xe90200[_0xeabc('0x65')]+'\x20');_0x5f5a47+=_0xe90200[_0xeabc('0x64')][_0x289f98]['group']?_0x273ca5(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x66')]):_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x6d')]+'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')]+(_0x522c6e(_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x67')])?'\x20'+_0xe90200[_0xeabc('0x64')][_0x289f98][_0xeabc('0x68')]:'');}return _0x5f5a47+')';};var _0x1f8197={'where':{'id':_0x4424ce['id']}},_0x485c13,_0xb54c35,_0x5c9d6f,_0x1caaa7,_0x3e764a;_0x1f8197=_[_0xeabc('0x40')]({},_0x1f8197,_0x51368f);return db[_0xeabc('0x31')][_0xeabc('0x46')](_0x1f8197)[_0xeabc('0x26')](function(_0x40f51e){if(_0x40f51e){_0x485c13=_0x40f51e;return _0x40f51e[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x156e20){if(_0x156e20){if(!_0x156e20[_0xeabc('0x3c')]){throw new db['Sequelize'][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0xb54c35=_0x156e20;return db[_0xeabc('0x83')][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x26c595){if(_0x26c595){_0x5c9d6f=_[_0xeabc('0x84')](_0x26c595,'id');var _0x580661;var _0x3de927=squel[_0xeabc('0x85')]();_0x3de927['from'](_0x485c13['table']);for(var _0x489b1d=0x0;_0x489b1d<_0xb54c35['length'];_0x489b1d+=0x1){_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6c')]?_0x5c9d6f[_0xb54c35[_0x489b1d][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0xb54c35[_0x489b1d][_0xeabc('0x6d')];_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x6e')]?_[_0xeabc('0x6f')](_0x952dc7[_0xb54c35[_0x489b1d][_0xeabc('0x6e')]],'%s',_0x580661):_0x580661;_0x580661=_0xb54c35[_0x489b1d][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x348064[_0xb54c35[_0x489b1d][_0xeabc('0x70')]],'%s',_0x580661):_0x580661;if(_0xb54c35[_0x489b1d]['groupBy']){_0x3de927[_0xeabc('0x66')](_0x580661);}_0xb54c35[_0x489b1d][_0xeabc('0x72')]&&_0x3de927['order'](_0x580661,_0xb54c35[_0x489b1d][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x3de927[_0xeabc('0x6d')](_0x580661,_0xb54c35[_0x489b1d]['alias']||_0x580661);}if(_0x485c13[_0xeabc('0x73')]){_0x485c13['joins']=JSON[_0xeabc('0x74')](_0x485c13[_0xeabc('0x73')]);for(var _0x1841f0=0x0;_0x1841f0<_0x485c13[_0xeabc('0x73')][_0xeabc('0x3c')];_0x1841f0+=0x1){if(_0x485c13['joins'][_0x1841f0]['type']&&_['includes'](_0x2f95c7,_0x485c13['joins'][_0x1841f0][_0xeabc('0x33')])&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')]&&_0x485c13['joins'][_0x1841f0][_0xeabc('0x77')]&&_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x88')]){_0x3de927[_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x33')]](_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x77')],null,util[_0xeabc('0x70')](_0xeabc('0x78'),_0x485c13[_0xeabc('0x6b')],_0x485c13[_0xeabc('0x73')][_0x1841f0][_0xeabc('0x76')],_0x485c13['joins'][_0x1841f0]['foreignTable'],_0x485c13[_0xeabc('0x73')][_0x1841f0]['foreignKey']));}}}if(_0x485c13[_0xeabc('0x79')]){_0x485c13[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x485c13['conditions']);_0x3de927[_0xeabc('0x41')](_0x273ca5(_0x485c13[_0xeabc('0x79')][_0xeabc('0x66')]));}_0x3e764a=_0x3de927['clone']();_0x3de927['limit'](_0x1795fe);_0x3de927[_0xeabc('0x1d')](0x0);return;}})[_0xeabc('0x26')](function(){if(_0x33fa74[_0xeabc('0x89')]===_0xeabc('0x8a')){return null;}var _0x2cc9b3=_[_0xeabc('0x40')](_0x33fa74,{'name':_0x33fa74['fullPath']||_0x33fa74['name']||_0x485c13[_0xeabc('0x2d')],'basename':_0x39f961,'savename':util[_0xeabc('0x70')](_0xeabc('0x8b'),_0x33fa74[_0xeabc('0x2d')]||_0x485c13['name'],require('randomstring')['generate'](0x4),_0x33fa74[_0xeabc('0x89')]||'csv'),'reportId':_0x485c13['id'],'reportType':_0xeabc('0x8c')});return db['AnalyticExtractedReport'][_0xeabc('0x48')](_0x2cc9b3,{'raw':!![]});})['then'](function(_0x6e6ab2){if(_0x485c13[_0xeabc('0x6b')]===_0xeabc('0x8d')){_0x3e764a[_0xeabc('0x41')](_0x485c13[_0xeabc('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}else{_0x3e764a[_0xeabc('0x41')](_0x485c13['table']+_0xeabc('0x90'),_0x33fa74[_0xeabc('0x8e')],_0x33fa74[_0xeabc('0x8f')]);}if(_0x6e6ab2){logger[_0xeabc('0x91')](_0xeabc('0x92'),_0x3e764a['toString']());require(_0xeabc('0x93'))[_0xeabc('0x94')](path['join'](__dirname,_0xeabc('0x95'),_0x6e6ab2[_0xeabc('0x89')]),[_0x6e6ab2['id'],_0x3e764a['toString'](),path[_0xeabc('0x52')](__dirname,_0xeabc('0x96'),_0x6e6ab2[_0xeabc('0x97')]),_0x39f961]);return _0x6e6ab2;}else{var _0x307d26=squel[_0xeabc('0x85')]();_0x307d26[_0xeabc('0x98')]('('+_0x3e764a[_0xeabc('0x7c')]()+')',_0xeabc('0x99'));_0x307d26[_0xeabc('0x6d')](_0xeabc('0x9a'),_0xeabc('0x20'));_0x3e764a[_0xeabc('0x1e')](_0x33fa74[_0xeabc('0x1e')]||_0x1795fe);_0x3e764a['offset'](_0x33fa74['offset']||0x0);return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x307d26[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')]['QueryTypes'][_0xeabc('0x7d')]})['then'](function(_0x49fba2){if(!_0x49fba2['length']){_0x1caaa7=0x0;}else{_0x1caaa7=_0x49fba2[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x3e764a[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});})[_0xeabc('0x26')](function(_0xe27492){return{'rows':_0xe27492||[],'count':_0x1caaa7};});}});}exports[_0xeabc('0x9d')]=function(_0x3eaedf,_0x44dc85){return runReport(_0x3eaedf['params'],_0x3eaedf[_0xeabc('0x36')],_0x3eaedf[_0xeabc('0x45')])[_0xeabc('0x26')](respondWithResult(_0x44dc85,null))[_0xeabc('0x47')](handleError(_0x44dc85,null));};exports[_0xeabc('0x9e')]=runReport;exports[_0xeabc('0x36')]=function(_0x2a29d7,_0x5bb5d6){var _0x3513ce=0xa;var _0x58cb5d=[_0xeabc('0x52'),_0xeabc('0x53'),'right_join',_0xeabc('0x55')];var _0x4c8bf3={'SUM':_0xeabc('0x56'),'COUNT':_0xeabc('0x57'),'COUNT DISTINCT':_0xeabc('0x7e'),'MAX':_0xeabc('0x7f'),'MIN':_0xeabc('0x58'),'AVG':_0xeabc('0x59'),'GROUP_CONCAT':_0xeabc('0x5a'),'GROUP_CONCAT ASC':_0xeabc('0x80'),'GROUP_CONCAT DESC':_0xeabc('0x5b')};var _0x484c75={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xeabc('0x5c'),'HOUR':_0xeabc('0x5d'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xeabc('0x5f')};var _0x580f72=function(_0x37907a){return!_[_0xeabc('0x75')]([_0xeabc('0x60'),_0xeabc('0x61'),_0xeabc('0x62'),_0xeabc('0x63')],_0x37907a);};var _0x57db6d=function(_0x13cc55){if(!_0x13cc55||!_0x13cc55['rules'][_0xeabc('0x3c')]){return'';}for(var _0x43b88e='(',_0x1fa464=0x0;_0x1fa464<_0x13cc55[_0xeabc('0x64')]['length'];_0x1fa464+=0x1){_0x1fa464>0x0&&(_0x43b88e+='\x20'+_0x13cc55[_0xeabc('0x65')]+'\x20');_0x43b88e+=_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x66')]?_0x57db6d(_0x13cc55['rules'][_0x1fa464][_0xeabc('0x66')]):_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x6d')]+'\x20'+_0x13cc55['rules'][_0x1fa464]['condition']+(_0x580f72(_0x13cc55['rules'][_0x1fa464]['condition'])?'\x20'+_0x13cc55[_0xeabc('0x64')][_0x1fa464][_0xeabc('0x68')]:'');}return _0x43b88e+')';};var _0x52e84f={'where':{'id':_0x2a29d7[_0xeabc('0x50')]['id']}},_0x12f024,_0x1d35da,_0x2695a4,_0x199251,_0x1899d6;_0x52e84f=_[_0xeabc('0x40')]({},_0x52e84f,_0x2a29d7[_0xeabc('0x45')]);return db[_0xeabc('0x31')]['find'](_0x52e84f)[_0xeabc('0x26')](function(_0x5bb015){if(_0x5bb015){_0x12f024=_0x5bb015;return _0x5bb015[_0xeabc('0x69')]();}return null;})[_0xeabc('0x26')](function(_0x438ce3){if(_0x438ce3){if(!_0x438ce3[_0xeabc('0x3c')]){throw new db[(_0xeabc('0x9f'))][(_0xeabc('0x82'))](_0xeabc('0x6a'),0x193);}_0x1d35da=_0x438ce3;return db['AnalyticMetric'][_0xeabc('0x42')]({'raw':!![]});}return null;})['then'](function(_0x475160){if(_0x475160){_0x2695a4=_['keyBy'](_0x475160,'id');var _0x10d66b;var _0x12a042=squel[_0xeabc('0x85')]();_0x12a042[_0xeabc('0x98')](_0x12f024[_0xeabc('0x6b')]);for(var _0x49bf0f=0x0;_0x49bf0f<_0x1d35da[_0xeabc('0x3c')];_0x49bf0f+=0x1){_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]?_0x2695a4[_0x1d35da[_0x49bf0f][_0xeabc('0x6c')]][_0xeabc('0x86')]:_0x1d35da[_0x49bf0f][_0xeabc('0x6d')];_0x10d66b=_0x1d35da[_0x49bf0f]['function']?_[_0xeabc('0x6f')](_0x4c8bf3[_0x1d35da[_0x49bf0f][_0xeabc('0x6e')]],'%s',_0x10d66b):_0x10d66b;_0x10d66b=_0x1d35da[_0x49bf0f][_0xeabc('0x70')]?_[_0xeabc('0x6f')](_0x484c75[_0x1d35da[_0x49bf0f][_0xeabc('0x70')]],'%s',_0x10d66b):_0x10d66b;if(_0x1d35da[_0x49bf0f]['groupBy']){_0x12a042[_0xeabc('0x66')](_0x10d66b);}_0x1d35da[_0x49bf0f]['orderBy']&&_0x12a042[_0xeabc('0x3e')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0x72')]===_0xeabc('0x87')?![]:!![]);_0x12a042[_0xeabc('0x6d')](_0x10d66b,_0x1d35da[_0x49bf0f][_0xeabc('0xa0')]||_0x10d66b);}if(_0x12f024[_0xeabc('0x73')]){_0x12f024[_0xeabc('0x73')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x73')]);for(var _0x223a3=0x0;_0x223a3<_0x12f024['joins'][_0xeabc('0x3c')];_0x223a3+=0x1){if(_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]&&_[_0xeabc('0x75')](_0x58cb5d,_0x12f024['joins'][_0x223a3][_0xeabc('0x33')])&&_0x12f024['joins'][_0x223a3]['parentKey']&&_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')]&&_0x12f024[_0xeabc('0x73')][_0x223a3]['foreignKey']){_0x12a042[_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x33')]](_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x77')],null,util[_0xeabc('0x70')]('%s.%s\x20=\x20%s.%s',_0x12f024[_0xeabc('0x6b')],_0x12f024[_0xeabc('0x73')][_0x223a3]['parentKey'],_0x12f024['joins'][_0x223a3][_0xeabc('0x77')],_0x12f024[_0xeabc('0x73')][_0x223a3][_0xeabc('0x88')]));}}}if(_0x12f024[_0xeabc('0x79')]){_0x12f024[_0xeabc('0x79')]=JSON[_0xeabc('0x74')](_0x12f024[_0xeabc('0x79')]);_0x12a042[_0xeabc('0x41')](_0x57db6d(_0x12f024[_0xeabc('0x79')]['group']));}_0x1899d6=_0x12a042[_0xeabc('0xa1')]();_0x12a042['limit'](_0x3513ce);_0x12a042[_0xeabc('0x1d')](0x0);logger['debug'](_0xeabc('0x7b'),_0x12a042[_0xeabc('0x7c')]());return dbH[_0xeabc('0x9b')][_0xeabc('0x36')](_0x12a042[_0xeabc('0x7c')](),{'type':dbH[_0xeabc('0x9b')][_0xeabc('0x9c')][_0xeabc('0x7d')]});}})[_0xeabc('0x26')](function(){return{'sql':_0x1899d6[_0xeabc('0x7c')]()};})['then'](respondWithResult(_0x5bb5d6,null))['catch'](handleError(_0x5bb5d6,null));}; \ No newline at end of file +var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%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','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x8f123d,_0x232ae9){var _0x54cc18=function(_0x4c24a0){while(--_0x4c24a0){_0x8f123d['push'](_0x8f123d['shift']());}};_0x54cc18(++_0x232ae9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x14c9c2,_0x35a467){_0x14c9c2=_0x14c9c2-0x0;var _0x1dc7b4=_0x1cb9[_0x14c9c2];return _0x1dc7b4;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index e0b105c..60fcdf5 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 _0x55b2=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','api','moment'];(function(_0x40c1a6,_0x349514){var _0x403f1c=function(_0x4e64b3){while(--_0x4e64b3){_0x40c1a6['push'](_0x40c1a6['shift']());}};_0x403f1c(++_0x349514);}(_0x55b2,0xb2));var _0x255b=function(_0x527c18,_0x5db700){_0x527c18=_0x527c18-0x0;var _0x5ac45c=_0x55b2[_0x527c18];return _0x5ac45c;};'use strict';var _=require(_0x255b('0x0'));var util=require(_0x255b('0x1'));var logger=require('../../config/logger')(_0x255b('0x2'));var moment=require(_0x255b('0x3'));var BPromise=require(_0x255b('0x4'));var rp=require(_0x255b('0x5'));var fs=require('fs');var path=require(_0x255b('0x6'));var rimraf=require(_0x255b('0x7'));var config=require(_0x255b('0x8'));var attributes=require(_0x255b('0x9'));module[_0x255b('0xa')]=function(_0x516adb,_0x3a2c93){return _0x516adb['define'](_0x255b('0xb'),attributes,{'tableName':_0x255b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa51e=['define','analytics_default_reports','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x30433e,_0x37960c){var _0xb59e95=function(_0x58fc82){while(--_0x58fc82){_0x30433e['push'](_0x30433e['shift']());}};_0xb59e95(++_0x37960c);}(_0xa51e,0x176));var _0xea51=function(_0x1439e6,_0x2634b8){_0x1439e6=_0x1439e6-0x0;var _0x1101a9=_0xa51e[_0x1439e6];return _0x1101a9;};'use strict';var _=require('lodash');var util=require(_0xea51('0x0'));var logger=require('../../config/logger')(_0xea51('0x1'));var moment=require(_0xea51('0x2'));var BPromise=require(_0xea51('0x3'));var rp=require(_0xea51('0x4'));var fs=require('fs');var path=require(_0xea51('0x5'));var rimraf=require(_0xea51('0x6'));var config=require(_0xea51('0x7'));var attributes=require(_0xea51('0x8'));module[_0xea51('0x9')]=function(_0x439266,_0xaf9b90){return _0x439266[_0xea51('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0xea51('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 4b43a3a..7239c63 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 _0x00d6=['../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x00d6,0x83));var _0x600d=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x00d6[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x600d('0x0'));var util=require(_0x600d('0x1'));var moment=require('moment');var BPromise=require(_0x600d('0x2'));var rs=require(_0x600d('0x3'));var fs=require('fs');var Redis=require(_0x600d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x600d('0x5'));var logger=require(_0x600d('0x6'))('rpc');var config=require(_0x600d('0x7'));var jayson=require(_0x600d('0x8'));var client=jayson[_0x600d('0x9')][_0x600d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x361783,_0x4fe72,_0x2cfd01){return new BPromise(function(_0x4b3f00,_0x485ebd){return client[_0x600d('0xb')](_0x361783,_0x2cfd01)[_0x600d('0xc')](function(_0x3bab4c){logger['info'](_0x600d('0xd'),_0x4fe72,_0x600d('0xe'));logger[_0x600d('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x4fe72,_0x600d('0xe'),JSON[_0x600d('0x10')](_0x3bab4c));if(_0x3bab4c[_0x600d('0x11')]){if(_0x3bab4c[_0x600d('0x11')][_0x600d('0x12')]===0x1f4){logger[_0x600d('0x11')](_0x600d('0xd'),_0x4fe72,_0x3bab4c[_0x600d('0x11')][_0x600d('0x13')]);return _0x485ebd(_0x3bab4c[_0x600d('0x11')][_0x600d('0x13')]);}logger[_0x600d('0x11')](_0x600d('0xd'),_0x4fe72,_0x3bab4c[_0x600d('0x11')]['message']);return _0x4b3f00(_0x3bab4c[_0x600d('0x11')][_0x600d('0x13')]);}else{logger[_0x600d('0x14')](_0x600d('0xd'),_0x4fe72,'request\x20sent');_0x4b3f00(_0x3bab4c[_0x600d('0x15')][_0x600d('0x13')]);}})[_0x600d('0x16')](function(_0x5e3f7a){logger[_0x600d('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4fe72,_0x5e3f7a);_0x485ebd(_0x5e3f7a);});});} \ No newline at end of file +var _0xec38=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xec38,0x15a));var _0x8ec3=function(_0x4ff120,_0x30ee0b){_0x4ff120=_0x4ff120-0x0;var _0x1a8437=_0xec38[_0x4ff120];return _0x1a8437;};'use strict';var _=require(_0x8ec3('0x0'));var util=require('util');var moment=require(_0x8ec3('0x1'));var BPromise=require(_0x8ec3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8ec3('0x3'));var db=require(_0x8ec3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ec3('0x5'))(_0x8ec3('0x6'));var config=require('../../config/environment');var jayson=require(_0x8ec3('0x7'));var client=jayson[_0x8ec3('0x8')][_0x8ec3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x180ccf,_0x11ad19,_0x53619f){return new BPromise(function(_0x3cab6b,_0x3cc7c9){return client[_0x8ec3('0xa')](_0x180ccf,_0x53619f)[_0x8ec3('0xb')](function(_0x595c5e){logger[_0x8ec3('0xc')](_0x8ec3('0xd'),_0x11ad19,'request\x20sent');logger[_0x8ec3('0xe')](_0x8ec3('0xf'),_0x11ad19,_0x8ec3('0x10'),JSON[_0x8ec3('0x11')](_0x595c5e));if(_0x595c5e[_0x8ec3('0x12')]){if(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x13')]===0x1f4){logger[_0x8ec3('0x12')](_0x8ec3('0xd'),_0x11ad19,_0x595c5e['error'][_0x8ec3('0x14')]);return _0x3cc7c9(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x14')]);}logger['error'](_0x8ec3('0xd'),_0x11ad19,_0x595c5e[_0x8ec3('0x12')]['message']);return _0x3cab6b(_0x595c5e[_0x8ec3('0x12')][_0x8ec3('0x14')]);}else{logger[_0x8ec3('0xc')](_0x8ec3('0xd'),_0x11ad19,_0x8ec3('0x10'));_0x3cab6b(_0x595c5e[_0x8ec3('0x15')][_0x8ec3('0x14')]);}})[_0x8ec3('0x16')](function(_0x11e826){logger[_0x8ec3('0x12')](_0x8ec3('0xd'),_0x11ad19,_0x11e826);_0x3cc7c9(_0x11e826);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index c62c94f..28d35f3 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 _0xfea2=['/:id/query','query','post','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','run'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0xfea2,0x156));var _0x2fea=function(_0xf97eb0,_0x1578b7){_0xf97eb0=_0xf97eb0-0x0;var _0xea70f4=_0xfea2[_0xf97eb0];return _0xea70f4;};'use strict';var multer=require(_0x2fea('0x0'));var util=require(_0x2fea('0x1'));var path=require(_0x2fea('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fea('0x3'));var router=express[_0x2fea('0x4')]();var fs_extra=require(_0x2fea('0x5'));var auth=require(_0x2fea('0x6'));var interaction=require(_0x2fea('0x7'));var config=require(_0x2fea('0x8'));var controller=require(_0x2fea('0x9'));router['get']('/',auth[_0x2fea('0xa')](),controller[_0x2fea('0xb')]);router['get'](_0x2fea('0xc'),auth[_0x2fea('0xa')](),controller[_0x2fea('0xd')]);router[_0x2fea('0xe')](_0x2fea('0xf'),auth[_0x2fea('0xa')](),controller[_0x2fea('0x10')]);router[_0x2fea('0xe')]('/:id/run',auth[_0x2fea('0xa')](),controller[_0x2fea('0x11')]);router['get'](_0x2fea('0x12'),auth['isAuthenticated'](),controller[_0x2fea('0x13')]);router[_0x2fea('0x14')]('/',auth[_0x2fea('0xa')](),controller['create']);router['put'](_0x2fea('0xc'),auth[_0x2fea('0xa')](),controller[_0x2fea('0x15')]);router[_0x2fea('0x16')](_0x2fea('0xc'),auth[_0x2fea('0xa')](),controller['destroy']);module[_0x2fea('0x17')]=router; \ No newline at end of file +var _0xf097=['delete','/:id','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put'];(function(_0x47458a,_0x494317){var _0x11955e=function(_0x35acd3){while(--_0x35acd3){_0x47458a['push'](_0x47458a['shift']());}};_0x11955e(++_0x494317);}(_0xf097,0x10c));var _0x7f09=function(_0x45cd76,_0x2e2a5b){_0x45cd76=_0x45cd76-0x0;var _0x55918d=_0xf097[_0x45cd76];return _0x55918d;};'use strict';var multer=require(_0x7f09('0x0'));var util=require('util');var path=require(_0x7f09('0x1'));var timeout=require(_0x7f09('0x2'));var express=require('express');var router=express[_0x7f09('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7f09('0x4'));var interaction=require(_0x7f09('0x5'));var config=require(_0x7f09('0x6'));var controller=require(_0x7f09('0x7'));router[_0x7f09('0x8')]('/',auth[_0x7f09('0x9')](),controller[_0x7f09('0xa')]);router[_0x7f09('0x8')]('/:id',auth[_0x7f09('0x9')](),controller[_0x7f09('0xb')]);router[_0x7f09('0x8')](_0x7f09('0xc'),auth['isAuthenticated'](),controller[_0x7f09('0xd')]);router[_0x7f09('0x8')](_0x7f09('0xe'),auth['isAuthenticated'](),controller[_0x7f09('0xf')]);router[_0x7f09('0x8')](_0x7f09('0x10'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x11')]);router[_0x7f09('0x12')]('/',auth[_0x7f09('0x9')](),controller['create']);router[_0x7f09('0x13')]('/:id',auth[_0x7f09('0x9')](),controller['update']);router[_0x7f09('0x14')](_0x7f09('0x15'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x16')]);module[_0x7f09('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 7327066..03bf9c6 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 _0x5e85=['xlsx','csv','DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','pdf'];(function(_0x22cb97,_0x57a60b){var _0x7a60cd=function(_0x51be30){while(--_0x51be30){_0x22cb97['push'](_0x22cb97['shift']());}};_0x7a60cd(++_0x57a60b);}(_0x5e85,0x127));var _0x55e8=function(_0x3aac7c,_0x1619d3){_0x3aac7c=_0x3aac7c-0x0;var _0x43d651=_0x5e85[_0x3aac7c];return _0x43d651;};'use strict';var Sequelize=require(_0x55e8('0x0'));var moment=require(_0x55e8('0x1'));module['exports']={'name':{'type':Sequelize[_0x55e8('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x55e8('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x55e8('0x3')]('csv',_0x55e8('0x4'),_0x55e8('0x5')),'allowNull':![],'defaultValue':_0x55e8('0x6')},'savename':{'type':Sequelize[_0x55e8('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x55e8('0x7')]},'endDate':{'type':Sequelize[_0x55e8('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x55e8('0x8')},'type':{'type':Sequelize[_0x55e8('0x3')](_0x55e8('0x9'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x55e8('0xa')](0xb)[_0x55e8('0xb')]},'reportType':{'type':Sequelize[_0x55e8('0x2')]}}; \ No newline at end of file +var _0x727d=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','pdf','xlsx','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x727d,0xad));var _0xd727=function(_0x1acb96,_0x108216){_0x1acb96=_0x1acb96-0x0;var _0x5da6cf=_0x727d[_0x1acb96];return _0x5da6cf;};'use strict';var Sequelize=require(_0xd727('0x0'));var moment=require('moment');module[_0xd727('0x1')]={'name':{'type':Sequelize[_0xd727('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd727('0x3')]('csv',_0xd727('0x4'),_0xd727('0x5')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xd727('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd727('0x6')]},'endDate':{'type':Sequelize[_0xd727('0x6')]},'status':{'type':Sequelize[_0xd727('0x2')],'defaultValue':_0xd727('0x7')},'type':{'type':Sequelize[_0xd727('0x3')](_0xd727('0x8'),_0xd727('0x9')),'allowNull':![],'defaultValue':_0xd727('0x8')},'reportId':{'type':Sequelize[_0xd727('0xa')](0xb)[_0xd727('0xb')]},'reportType':{'type':Sequelize[_0xd727('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 5bcaf11..5307886 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 _0xa9c3=['hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','name','filter','options','include','findAll','rows','catch','params','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','download','basename','savename','output','existsSync','join','root','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','server/files/reports','format','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','then','destroy','get','ExtractedReports','UserProfileResource','sendStatus','stack','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length'];(function(_0x36ea94,_0x6178c4){var _0x2d1fe0=function(_0x2c0dbb){while(--_0x2c0dbb){_0x36ea94['push'](_0x36ea94['shift']());}};_0x2d1fe0(++_0x6178c4);}(_0xa9c3,0xf6));var _0x3a9c=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa9c3[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x3a9c('0x0'));var rimraf=require(_0x3a9c('0x1'));var zipdir=require(_0x3a9c('0x2'));var jsonpatch=require(_0x3a9c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3a9c('0x4'));var Mustache=require(_0x3a9c('0x5'));var util=require(_0x3a9c('0x6'));var path=require(_0x3a9c('0x7'));var sox=require('sox');var csv=require(_0x3a9c('0x8'));var ejs=require(_0x3a9c('0x9'));var fs=require('fs');var fs_extra=require(_0x3a9c('0xa'));var _=require(_0x3a9c('0xb'));var squel=require(_0x3a9c('0xc'));var crypto=require(_0x3a9c('0xd'));var jsforce=require(_0x3a9c('0xe'));var deskjs=require(_0x3a9c('0xf'));var toCsv=require(_0x3a9c('0x8'));var querystring=require(_0x3a9c('0x10'));var Papa=require(_0x3a9c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3a9c('0x12'));var as=require(_0x3a9c('0x13'));var hardwareService=require(_0x3a9c('0x14'));var logger=require(_0x3a9c('0x15'))(_0x3a9c('0x16'));var utils=require(_0x3a9c('0x17'));var config=require(_0x3a9c('0x18'));var licenseUtil=require(_0x3a9c('0x19'));var db=require(_0x3a9c('0x1a'))['db'];function respondWithStatusCode(_0x17746b,_0x5ec258){_0x5ec258=_0x5ec258||0xcc;return function(_0x286422){if(_0x286422){return _0x17746b['sendStatus'](_0x5ec258);}return _0x17746b['status'](_0x5ec258)[_0x3a9c('0x1b')]();};}function respondWithResult(_0x5d21c9,_0x382c7b){_0x382c7b=_0x382c7b||0xc8;return function(_0x4aff3a){if(_0x4aff3a){return _0x5d21c9['status'](_0x382c7b)[_0x3a9c('0x1c')](_0x4aff3a);}};}function respondWithFilteredResult(_0x311f63,_0x1865ae){return function(_0x3f0dad){if(_0x3f0dad){var _0x5762fc=typeof _0x1865ae[_0x3a9c('0x1d')]===_0x3a9c('0x1e')&&typeof _0x1865ae['limit']===_0x3a9c('0x1e');var _0x2c5774=_0x3f0dad[_0x3a9c('0x1f')];var _0x3bf940=_0x5762fc?0x0:_0x1865ae[_0x3a9c('0x1d')];var _0x45f053=_0x5762fc?_0x3f0dad['count']:_0x1865ae[_0x3a9c('0x1d')]+_0x1865ae[_0x3a9c('0x20')];var _0x4d7890;if(_0x45f053>=_0x2c5774){_0x45f053=_0x2c5774;_0x4d7890=0xc8;}else{_0x4d7890=0xce;}_0x311f63[_0x3a9c('0x21')](_0x4d7890);return _0x311f63[_0x3a9c('0x22')](_0x3a9c('0x23'),_0x3bf940+'-'+_0x45f053+'/'+_0x2c5774)['json'](_0x3f0dad);}return null;};}function patchUpdates(_0x596335){return function(_0x1a1e5d){try{jsonpatch[_0x3a9c('0x24')](_0x1a1e5d,_0x596335,!![]);}catch(_0x1e330c){return BPromise[_0x3a9c('0x25')](_0x1e330c);}return _0x1a1e5d[_0x3a9c('0x26')]();};}function saveUpdates(_0x553b27,_0x3702ea){return function(_0x24776e){if(_0x24776e){return _0x24776e['update'](_0x553b27)[_0x3a9c('0x27')](function(_0x5570f7){return _0x5570f7;});}return null;};}function removeEntity(_0x58e87e,_0x27d0a7){return function(_0x2274cf){if(_0x2274cf){return _0x2274cf[_0x3a9c('0x28')]()[_0x3a9c('0x27')](function(){var _0x3792eb=_0x2274cf[_0x3a9c('0x29')]({'plain':!![]});var _0xe585c5=_0x3a9c('0x2a');return db[_0x3a9c('0x2b')][_0x3a9c('0x28')]({'where':{'type':_0xe585c5,'resourceId':_0x3792eb['id']}})[_0x3a9c('0x27')](function(){return _0x2274cf;});})['then'](function(){_0x58e87e[_0x3a9c('0x21')](0xcc)[_0x3a9c('0x1b')]();});}};}function handleEntityNotFound(_0x29f53c,_0x4d1187){return function(_0x4dbe41){if(!_0x4dbe41){_0x29f53c[_0x3a9c('0x2c')](0x194);}return _0x4dbe41;};}function handleError(_0x397104,_0x47e8ab){_0x47e8ab=_0x47e8ab||0x1f4;return function(_0x401cb0){logger['error'](_0x401cb0[_0x3a9c('0x2d')]);if(_0x401cb0['name']){delete _0x401cb0['name'];}_0x397104[_0x3a9c('0x21')](_0x47e8ab)[_0x3a9c('0x2e')](_0x401cb0);};}exports[_0x3a9c('0x2f')]=function(_0x17ffbd,_0x210025){var _0x350e2c={},_0x335131={},_0x3af2e6={'count':0x0,'rows':[]};var _0x58a2b0=_[_0x3a9c('0x30')](db[_0x3a9c('0x31')][_0x3a9c('0x32')],function(_0x51abc5){return{'name':_0x51abc5[_0x3a9c('0x33')],'type':_0x51abc5[_0x3a9c('0x34')]['key']};});_0x335131['model']=_['map'](_0x58a2b0,'name');_0x335131[_0x3a9c('0x35')]=_[_0x3a9c('0x36')](_0x17ffbd[_0x3a9c('0x35')]);_0x335131['filters']=_[_0x3a9c('0x37')](_0x335131[_0x3a9c('0x38')],_0x335131[_0x3a9c('0x35')]);_0x350e2c[_0x3a9c('0x39')]=_[_0x3a9c('0x37')](_0x335131[_0x3a9c('0x38')],qs[_0x3a9c('0x3a')](_0x17ffbd['query']['fields']));_0x350e2c[_0x3a9c('0x39')]=_0x350e2c[_0x3a9c('0x39')][_0x3a9c('0x3b')]?_0x350e2c[_0x3a9c('0x39')]:_0x335131[_0x3a9c('0x38')];if(!_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x3c')](_0x3a9c('0x3d'))){_0x350e2c[_0x3a9c('0x20')]=qs[_0x3a9c('0x20')](_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x20')]);_0x350e2c[_0x3a9c('0x1d')]=qs[_0x3a9c('0x1d')](_0x17ffbd[_0x3a9c('0x35')]['offset']);}_0x350e2c[_0x3a9c('0x3e')]=qs['sort'](_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x3f')]);_0x350e2c[_0x3a9c('0x40')]=qs[_0x3a9c('0x41')](_[_0x3a9c('0x42')](_0x17ffbd[_0x3a9c('0x35')],_0x335131[_0x3a9c('0x41')]),_0x58a2b0);if(_0x17ffbd[_0x3a9c('0x35')]['filter']){_0x350e2c[_0x3a9c('0x40')]=_[_0x3a9c('0x43')](_0x350e2c['where'],{'$or':_[_0x3a9c('0x30')](_0x58a2b0,function(_0x3cfc17){if(_0x3cfc17[_0x3a9c('0x34')]!==_0x3a9c('0x44')){var _0xac4984={};_0xac4984[_0x3cfc17[_0x3a9c('0x45')]]={'$like':'%'+_0x17ffbd[_0x3a9c('0x35')][_0x3a9c('0x46')]+'%'};return _0xac4984;}})});}_0x350e2c=_[_0x3a9c('0x43')]({},_0x350e2c,_0x17ffbd[_0x3a9c('0x47')]);var _0x2ec9e2={'where':_0x350e2c[_0x3a9c('0x40')]};return db[_0x3a9c('0x31')][_0x3a9c('0x1f')](_0x2ec9e2)[_0x3a9c('0x27')](function(_0x22abd2){_0x3af2e6[_0x3a9c('0x1f')]=_0x22abd2;if(_0x17ffbd['query']['includeAll']){_0x350e2c[_0x3a9c('0x48')]=[{'all':!![]}];}return db[_0x3a9c('0x31')][_0x3a9c('0x49')](_0x350e2c);})[_0x3a9c('0x27')](function(_0x51b29c){_0x3af2e6[_0x3a9c('0x4a')]=_0x51b29c;return _0x3af2e6;})[_0x3a9c('0x27')](respondWithFilteredResult(_0x210025,_0x350e2c))[_0x3a9c('0x4b')](handleError(_0x210025,null));};exports['show']=function(_0x23cd6f,_0x39f1b0){var _0x1a7fdc={'raw':!![],'where':{'id':_0x23cd6f[_0x3a9c('0x4c')]['id']}},_0x431f17={};_0x431f17[_0x3a9c('0x38')]=_[_0x3a9c('0x36')](db[_0x3a9c('0x31')][_0x3a9c('0x32')]);_0x431f17[_0x3a9c('0x35')]=_[_0x3a9c('0x36')](_0x23cd6f[_0x3a9c('0x35')]);_0x431f17[_0x3a9c('0x41')]=_[_0x3a9c('0x37')](_0x431f17['model'],_0x431f17[_0x3a9c('0x35')]);_0x1a7fdc[_0x3a9c('0x39')]=_[_0x3a9c('0x37')](_0x431f17[_0x3a9c('0x38')],qs[_0x3a9c('0x3a')](_0x23cd6f[_0x3a9c('0x35')]['fields']));_0x1a7fdc[_0x3a9c('0x39')]=_0x1a7fdc[_0x3a9c('0x39')][_0x3a9c('0x3b')]?_0x1a7fdc['attributes']:_0x431f17['model'];if(_0x23cd6f[_0x3a9c('0x35')][_0x3a9c('0x4d')]){_0x1a7fdc['include']=[{'all':!![]}];}_0x1a7fdc=_[_0x3a9c('0x43')]({},_0x1a7fdc,_0x23cd6f['options']);return db['AnalyticExtractedReport'][_0x3a9c('0x4e')](_0x1a7fdc)['then'](handleEntityNotFound(_0x39f1b0,null))[_0x3a9c('0x27')](respondWithResult(_0x39f1b0,null))[_0x3a9c('0x4b')](handleError(_0x39f1b0,null));};exports[_0x3a9c('0x4f')]=function(_0x1ab9fc,_0x2a3acb){return db[_0x3a9c('0x31')][_0x3a9c('0x4f')](_0x1ab9fc['body'],{})[_0x3a9c('0x27')](function(_0x37ab6b){var _0x51ab9b=_0x1ab9fc['user'][_0x3a9c('0x29')]({'plain':!![]});if(!_0x51ab9b)throw new Error(_0x3a9c('0x50'));if(_0x51ab9b[_0x3a9c('0x51')]===_0x3a9c('0x52')){var _0x28506e=_0x37ab6b[_0x3a9c('0x29')]({'plain':!![]});var _0x53427a=_0x3a9c('0x2a');return db[_0x3a9c('0x53')][_0x3a9c('0x4e')]({'where':{'name':_0x53427a,'userProfileId':_0x51ab9b[_0x3a9c('0x54')]},'raw':!![]})[_0x3a9c('0x27')](function(_0x4a3a82){if(_0x4a3a82&&_0x4a3a82[_0x3a9c('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x28506e[_0x3a9c('0x45')],'resourceId':_0x28506e['id'],'type':_0x4a3a82[_0x3a9c('0x45')],'sectionId':_0x4a3a82['id']},{})[_0x3a9c('0x27')](function(){return _0x37ab6b;});}else{return _0x37ab6b;}})[_0x3a9c('0x4b')](function(_0x1f84a8){logger[_0x3a9c('0x56')](_0x3a9c('0x57'),_0x1f84a8);throw _0x1f84a8;});}return _0x37ab6b;})[_0x3a9c('0x27')](respondWithResult(_0x2a3acb,0xc9))[_0x3a9c('0x4b')](handleError(_0x2a3acb,null));};exports[_0x3a9c('0x58')]=function(_0x5be893,_0xa695c5){if(_0x5be893[_0x3a9c('0x59')]['id']){delete _0x5be893[_0x3a9c('0x59')]['id'];}return db[_0x3a9c('0x31')]['find']({'where':{'id':_0x5be893[_0x3a9c('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa695c5,null))['then'](saveUpdates(_0x5be893[_0x3a9c('0x59')],null))[_0x3a9c('0x27')](respondWithResult(_0xa695c5,null))[_0x3a9c('0x4b')](handleError(_0xa695c5,null));};exports[_0x3a9c('0x28')]=function(_0x44387b,_0x599ba7){return db[_0x3a9c('0x31')][_0x3a9c('0x4e')]({'where':{'id':_0x44387b[_0x3a9c('0x4c')]['id']}})[_0x3a9c('0x27')](handleEntityNotFound(_0x599ba7,null))[_0x3a9c('0x27')](removeEntity(_0x599ba7,null))[_0x3a9c('0x4b')](handleError(_0x599ba7,null));};exports[_0x3a9c('0x5a')]=function(_0x13dc43,_0x427e37,_0x452d69){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x13dc43[_0x3a9c('0x4c')]['id']},'attributes':[_0x3a9c('0x45'),_0x3a9c('0x5b'),_0x3a9c('0x5c'),_0x3a9c('0x5d')],'raw':!![]})[_0x3a9c('0x27')](handleEntityNotFound(_0x427e37,null))['then'](function(_0x39d1b1){if(_0x39d1b1){if(!fs[_0x3a9c('0x5e')](path[_0x3a9c('0x5f')](config[_0x3a9c('0x60')],'server/files/reports',_0x39d1b1[_0x3a9c('0x5c')]))){throw new db[(_0x3a9c('0x61'))][(_0x3a9c('0x62'))](_0x3a9c('0x63'));}if(_0x13dc43[_0x3a9c('0x35')]['exists']){return _0x427e37['sendStatus'](0xc8);}return _0x427e37['download'](path[_0x3a9c('0x5f')](config['root'],_0x3a9c('0x64'),_0x39d1b1['savename']),util[_0x3a9c('0x65')]('%s.%s',_0x39d1b1[_0x3a9c('0x5b')]||_0x39d1b1[_0x3a9c('0x45')],_0x39d1b1[_0x3a9c('0x5d')]['toLowerCase']()));}})[_0x3a9c('0x4b')](handleError(_0x427e37,null));}; \ No newline at end of file +var _0xb544=['bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','save','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','index','map','AnalyticExtractedReport','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','catch','keys','rawAttributes','fields','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','params','basename','savename','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment'];(function(_0x350a95,_0x30a22a){var _0x47616d=function(_0x156304){while(--_0x156304){_0x350a95['push'](_0x350a95['shift']());}};_0x47616d(++_0x30a22a);}(_0xb544,0x160));var _0x4b54=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xb544[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0x4b54('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b54('0x1'));var jsonpatch=require(_0x4b54('0x2'));var rp=require('request-promise');var moment=require(_0x4b54('0x3'));var BPromise=require(_0x4b54('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b54('0x5'));var sox=require(_0x4b54('0x6'));var csv=require(_0x4b54('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b54('0x8'));var _=require(_0x4b54('0x9'));var squel=require(_0x4b54('0xa'));var crypto=require(_0x4b54('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4b54('0xc'));var toCsv=require(_0x4b54('0x7'));var querystring=require('querystring');var Papa=require(_0x4b54('0xd'));var Redis=require(_0x4b54('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4b54('0xf'));var as=require(_0x4b54('0x10'));var hardwareService=require(_0x4b54('0x11'));var logger=require(_0x4b54('0x12'))(_0x4b54('0x13'));var utils=require(_0x4b54('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b54('0x15'))['db'];function respondWithStatusCode(_0x1894b2,_0x16513d){_0x16513d=_0x16513d||0xcc;return function(_0x2c5cf3){if(_0x2c5cf3){return _0x1894b2[_0x4b54('0x16')](_0x16513d);}return _0x1894b2['status'](_0x16513d)[_0x4b54('0x17')]();};}function respondWithResult(_0x3afcb4,_0x3633f5){_0x3633f5=_0x3633f5||0xc8;return function(_0x1da7b0){if(_0x1da7b0){return _0x3afcb4[_0x4b54('0x18')](_0x3633f5)[_0x4b54('0x19')](_0x1da7b0);}};}function respondWithFilteredResult(_0x2bb23b,_0x7af3b3){return function(_0x11218f){if(_0x11218f){var _0x40eb4c=typeof _0x7af3b3[_0x4b54('0x1a')]===_0x4b54('0x1b')&&typeof _0x7af3b3[_0x4b54('0x1c')]===_0x4b54('0x1b');var _0x59a7ec=_0x11218f[_0x4b54('0x1d')];var _0x1e4c19=_0x40eb4c?0x0:_0x7af3b3[_0x4b54('0x1a')];var _0x1a08e2=_0x40eb4c?_0x11218f[_0x4b54('0x1d')]:_0x7af3b3[_0x4b54('0x1a')]+_0x7af3b3[_0x4b54('0x1c')];var _0x109cbf;if(_0x1a08e2>=_0x59a7ec){_0x1a08e2=_0x59a7ec;_0x109cbf=0xc8;}else{_0x109cbf=0xce;}_0x2bb23b[_0x4b54('0x18')](_0x109cbf);return _0x2bb23b[_0x4b54('0x1e')]('Content-Range',_0x1e4c19+'-'+_0x1a08e2+'/'+_0x59a7ec)['json'](_0x11218f);}return null;};}function patchUpdates(_0x46d0fe){return function(_0x58a9de){try{jsonpatch['apply'](_0x58a9de,_0x46d0fe,!![]);}catch(_0x5bd741){return BPromise[_0x4b54('0x1f')](_0x5bd741);}return _0x58a9de[_0x4b54('0x20')]();};}function saveUpdates(_0x5c1b8b,_0x29b28b){return function(_0x3a0792){if(_0x3a0792){return _0x3a0792[_0x4b54('0x21')](_0x5c1b8b)[_0x4b54('0x22')](function(_0x54a339){return _0x54a339;});}return null;};}function removeEntity(_0x2a16c8,_0x288182){return function(_0x468883){if(_0x468883){return _0x468883['destroy']()['then'](function(){var _0x1f0d15=_0x468883[_0x4b54('0x23')]({'plain':!![]});var _0x45bfa2=_0x4b54('0x24');return db[_0x4b54('0x25')][_0x4b54('0x26')]({'where':{'type':_0x45bfa2,'resourceId':_0x1f0d15['id']}})[_0x4b54('0x22')](function(){return _0x468883;});})[_0x4b54('0x22')](function(){_0x2a16c8[_0x4b54('0x18')](0xcc)[_0x4b54('0x17')]();});}};}function handleEntityNotFound(_0x3d8d4f,_0x2ba4ce){return function(_0x10618e){if(!_0x10618e){_0x3d8d4f[_0x4b54('0x16')](0x194);}return _0x10618e;};}function handleError(_0x2d7ff9,_0x126be0){_0x126be0=_0x126be0||0x1f4;return function(_0x108fec){logger[_0x4b54('0x27')](_0x108fec[_0x4b54('0x28')]);if(_0x108fec[_0x4b54('0x29')]){delete _0x108fec[_0x4b54('0x29')];}_0x2d7ff9[_0x4b54('0x18')](_0x126be0)['send'](_0x108fec);};}exports[_0x4b54('0x2a')]=function(_0x53b8dc,_0x1fc775){var _0x12f210={},_0x274344={},_0x10e10e={'count':0x0,'rows':[]};var _0x3f80b6=_[_0x4b54('0x2b')](db[_0x4b54('0x2c')]['rawAttributes'],function(_0xd98f3a){return{'name':_0xd98f3a[_0x4b54('0x2d')],'type':_0xd98f3a[_0x4b54('0x2e')]['key']};});_0x274344[_0x4b54('0x2f')]=_[_0x4b54('0x2b')](_0x3f80b6,_0x4b54('0x29'));_0x274344[_0x4b54('0x30')]=_['keys'](_0x53b8dc['query']);_0x274344[_0x4b54('0x31')]=_[_0x4b54('0x32')](_0x274344[_0x4b54('0x2f')],_0x274344[_0x4b54('0x30')]);_0x12f210[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x274344['model'],qs['fields'](_0x53b8dc[_0x4b54('0x30')]['fields']));_0x12f210[_0x4b54('0x33')]=_0x12f210[_0x4b54('0x33')]['length']?_0x12f210['attributes']:_0x274344[_0x4b54('0x2f')];if(!_0x53b8dc['query'][_0x4b54('0x34')](_0x4b54('0x35'))){_0x12f210[_0x4b54('0x1c')]=qs[_0x4b54('0x1c')](_0x53b8dc[_0x4b54('0x30')]['limit']);_0x12f210[_0x4b54('0x1a')]=qs['offset'](_0x53b8dc['query']['offset']);}_0x12f210[_0x4b54('0x36')]=qs[_0x4b54('0x37')](_0x53b8dc[_0x4b54('0x30')][_0x4b54('0x37')]);_0x12f210[_0x4b54('0x38')]=qs[_0x4b54('0x31')](_[_0x4b54('0x39')](_0x53b8dc[_0x4b54('0x30')],_0x274344['filters']),_0x3f80b6);if(_0x53b8dc[_0x4b54('0x30')]['filter']){_0x12f210[_0x4b54('0x38')]=_[_0x4b54('0x3a')](_0x12f210[_0x4b54('0x38')],{'$or':_[_0x4b54('0x2b')](_0x3f80b6,function(_0x3e92e5){if(_0x3e92e5[_0x4b54('0x2e')]!==_0x4b54('0x3b')){var _0x554b2a={};_0x554b2a[_0x3e92e5['name']]={'$like':'%'+_0x53b8dc[_0x4b54('0x30')][_0x4b54('0x3c')]+'%'};return _0x554b2a;}})});}_0x12f210=_[_0x4b54('0x3a')]({},_0x12f210,_0x53b8dc[_0x4b54('0x3d')]);var _0x3af63c={'where':_0x12f210['where']};return db[_0x4b54('0x2c')][_0x4b54('0x1d')](_0x3af63c)[_0x4b54('0x22')](function(_0xbecb34){_0x10e10e[_0x4b54('0x1d')]=_0xbecb34;if(_0x53b8dc['query'][_0x4b54('0x3e')]){_0x12f210['include']=[{'all':!![]}];}return db[_0x4b54('0x2c')]['findAll'](_0x12f210);})['then'](function(_0x117bdb){_0x10e10e['rows']=_0x117bdb;return _0x10e10e;})[_0x4b54('0x22')](respondWithFilteredResult(_0x1fc775,_0x12f210))[_0x4b54('0x3f')](handleError(_0x1fc775,null));};exports['show']=function(_0x153315,_0x3bdeb7){var _0x5bfef7={'raw':!![],'where':{'id':_0x153315['params']['id']}},_0x43ce55={};_0x43ce55[_0x4b54('0x2f')]=_[_0x4b54('0x40')](db[_0x4b54('0x2c')][_0x4b54('0x41')]);_0x43ce55[_0x4b54('0x30')]=_[_0x4b54('0x40')](_0x153315['query']);_0x43ce55[_0x4b54('0x31')]=_['intersection'](_0x43ce55[_0x4b54('0x2f')],_0x43ce55[_0x4b54('0x30')]);_0x5bfef7[_0x4b54('0x33')]=_[_0x4b54('0x32')](_0x43ce55['model'],qs[_0x4b54('0x42')](_0x153315[_0x4b54('0x30')]['fields']));_0x5bfef7['attributes']=_0x5bfef7['attributes']['length']?_0x5bfef7[_0x4b54('0x33')]:_0x43ce55[_0x4b54('0x2f')];if(_0x153315[_0x4b54('0x30')][_0x4b54('0x3e')]){_0x5bfef7[_0x4b54('0x43')]=[{'all':!![]}];}_0x5bfef7=_[_0x4b54('0x3a')]({},_0x5bfef7,_0x153315[_0x4b54('0x3d')]);return db[_0x4b54('0x2c')][_0x4b54('0x44')](_0x5bfef7)[_0x4b54('0x22')](handleEntityNotFound(_0x3bdeb7,null))[_0x4b54('0x22')](respondWithResult(_0x3bdeb7,null))[_0x4b54('0x3f')](handleError(_0x3bdeb7,null));};exports[_0x4b54('0x45')]=function(_0x29e9b8,_0x43b916){return db[_0x4b54('0x2c')][_0x4b54('0x45')](_0x29e9b8[_0x4b54('0x46')],{})[_0x4b54('0x22')](function(_0x59c4da){var _0x4d1ee5=_0x29e9b8[_0x4b54('0x47')][_0x4b54('0x23')]({'plain':!![]});if(!_0x4d1ee5)throw new Error(_0x4b54('0x48'));if(_0x4d1ee5[_0x4b54('0x49')]===_0x4b54('0x47')){var _0x3160d4=_0x59c4da['get']({'plain':!![]});var _0x28f78c=_0x4b54('0x24');return db[_0x4b54('0x4a')][_0x4b54('0x44')]({'where':{'name':_0x28f78c,'userProfileId':_0x4d1ee5['userProfileId']},'raw':!![]})[_0x4b54('0x22')](function(_0x16da97){if(_0x16da97&&_0x16da97['autoAssociation']===0x0){return db[_0x4b54('0x25')][_0x4b54('0x45')]({'name':_0x3160d4[_0x4b54('0x29')],'resourceId':_0x3160d4['id'],'type':_0x16da97[_0x4b54('0x29')],'sectionId':_0x16da97['id']},{})[_0x4b54('0x22')](function(){return _0x59c4da;});}else{return _0x59c4da;}})[_0x4b54('0x3f')](function(_0x4b431a){logger[_0x4b54('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b431a);throw _0x4b431a;});}return _0x59c4da;})[_0x4b54('0x22')](respondWithResult(_0x43b916,0xc9))[_0x4b54('0x3f')](handleError(_0x43b916,null));};exports['update']=function(_0xe844a6,_0x432fbd){if(_0xe844a6[_0x4b54('0x46')]['id']){delete _0xe844a6[_0x4b54('0x46')]['id'];}return db[_0x4b54('0x2c')][_0x4b54('0x44')]({'where':{'id':_0xe844a6['params']['id']}})[_0x4b54('0x22')](handleEntityNotFound(_0x432fbd,null))['then'](saveUpdates(_0xe844a6[_0x4b54('0x46')],null))[_0x4b54('0x22')](respondWithResult(_0x432fbd,null))[_0x4b54('0x3f')](handleError(_0x432fbd,null));};exports[_0x4b54('0x26')]=function(_0x3e9958,_0x23093b){return db['AnalyticExtractedReport'][_0x4b54('0x44')]({'where':{'id':_0x3e9958['params']['id']}})['then'](handleEntityNotFound(_0x23093b,null))['then'](removeEntity(_0x23093b,null))[_0x4b54('0x3f')](handleError(_0x23093b,null));};exports['download']=function(_0x175a18,_0x3894ed,_0x1aa544){return db['AnalyticExtractedReport'][_0x4b54('0x44')]({'where':{'id':_0x175a18[_0x4b54('0x4b')]['id']},'attributes':[_0x4b54('0x29'),_0x4b54('0x4c'),_0x4b54('0x4d'),'output'],'raw':!![]})[_0x4b54('0x22')](handleEntityNotFound(_0x3894ed,null))[_0x4b54('0x22')](function(_0x533c3b){if(_0x533c3b){if(!fs[_0x4b54('0x4e')](path[_0x4b54('0x4f')](config['root'],_0x4b54('0x50'),_0x533c3b[_0x4b54('0x4d')]))){throw new db[(_0x4b54('0x51'))][(_0x4b54('0x52'))](_0x4b54('0x53'));}if(_0x175a18['query'][_0x4b54('0x54')]){return _0x3894ed['sendStatus'](0xc8);}return _0x3894ed[_0x4b54('0x55')](path[_0x4b54('0x4f')](config[_0x4b54('0x56')],_0x4b54('0x50'),_0x533c3b['savename']),util['format'](_0x4b54('0x57'),_0x533c3b[_0x4b54('0x4c')]||_0x533c3b[_0x4b54('0x29')],_0x533c3b['output'][_0x4b54('0x58')]()));}})[_0x4b54('0x3f')](handleError(_0x3894ed,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 064709d..0b60943 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 _0x455a=['moment','request-promise','path','rimraf','../../config/environment','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x50a70c,_0x52491f){var _0x5a5813=function(_0x29e851){while(--_0x29e851){_0x50a70c['push'](_0x50a70c['shift']());}};_0x5a5813(++_0x52491f);}(_0x455a,0x104));var _0xa455=function(_0x47c758,_0x10a261){_0x47c758=_0x47c758-0x0;var _0xe0b1e0=_0x455a[_0x47c758];return _0xe0b1e0;};'use strict';var _=require(_0xa455('0x0'));var util=require(_0xa455('0x1'));var logger=require(_0xa455('0x2'))(_0xa455('0x3'));var moment=require(_0xa455('0x4'));var BPromise=require('bluebird');var rp=require(_0xa455('0x5'));var fs=require('fs');var path=require(_0xa455('0x6'));var rimraf=require(_0xa455('0x7'));var config=require(_0xa455('0x8'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x98eead,_0x6a4fe5){return _0x98eead['define'](_0xa455('0x9'),attributes,{'tableName':_0xa455('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed54=['request-promise','path','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed54,0xcc));var _0x4ed5=function(_0x36121d,_0x59afab){_0x36121d=_0x36121d-0x0;var _0x4455ab=_0xed54[_0x36121d];return _0x4455ab;};'use strict';var _=require(_0x4ed5('0x0'));var util=require(_0x4ed5('0x1'));var logger=require(_0x4ed5('0x2'))('api');var moment=require(_0x4ed5('0x3'));var BPromise=require(_0x4ed5('0x4'));var rp=require(_0x4ed5('0x5'));var fs=require('fs');var path=require(_0x4ed5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4ed5('0x7'));module[_0x4ed5('0x8')]=function(_0xab49d7,_0x24ee1d){return _0xab49d7[_0x4ed5('0x9')](_0x4ed5('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 45c0b15..6ad91b0 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 _0xbc33=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug'];(function(_0x43e6d5,_0x1a1d50){var _0x4a9074=function(_0x1c92ae){while(--_0x1c92ae){_0x43e6d5['push'](_0x43e6d5['shift']());}};_0x4a9074(++_0x1a1d50);}(_0xbc33,0xd1));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3bc3('0x0'));var util=require(_0x3bc3('0x1'));var moment=require(_0x3bc3('0x2'));var BPromise=require(_0x3bc3('0x3'));var rs=require(_0x3bc3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bc3('0x5'))['db'];var utils=require(_0x3bc3('0x6'));var logger=require(_0x3bc3('0x7'))(_0x3bc3('0x8'));var config=require(_0x3bc3('0x9'));var jayson=require(_0x3bc3('0xa'));var client=jayson[_0x3bc3('0xb')][_0x3bc3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14db1f,_0x5ca5fe,_0x5ef597){return new BPromise(function(_0x106f1d,_0x1e70b4){return client[_0x3bc3('0xd')](_0x14db1f,_0x5ef597)['then'](function(_0x41f981){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ca5fe,_0x3bc3('0xe'));logger[_0x3bc3('0xf')](_0x3bc3('0x10'),_0x5ca5fe,_0x3bc3('0xe'),JSON[_0x3bc3('0x11')](_0x41f981));if(_0x41f981[_0x3bc3('0x12')]){if(_0x41f981[_0x3bc3('0x12')][_0x3bc3('0x13')]===0x1f4){logger[_0x3bc3('0x12')](_0x3bc3('0x14'),_0x5ca5fe,_0x41f981[_0x3bc3('0x12')][_0x3bc3('0x15')]);return _0x1e70b4(_0x41f981['error'][_0x3bc3('0x15')]);}logger[_0x3bc3('0x12')](_0x3bc3('0x14'),_0x5ca5fe,_0x41f981['error'][_0x3bc3('0x15')]);return _0x106f1d(_0x41f981[_0x3bc3('0x12')]['message']);}else{logger[_0x3bc3('0x16')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ca5fe,_0x3bc3('0xe'));_0x106f1d(_0x41f981[_0x3bc3('0x17')][_0x3bc3('0x15')]);}})[_0x3bc3('0x18')](function(_0x2ff9b6){logger[_0x3bc3('0x12')](_0x3bc3('0x14'),_0x5ca5fe,_0x2ff9b6);_0x1e70b4(_0x2ff9b6);});});} \ No newline at end of file +var _0xc88f=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x148351,_0x440979){var _0x1852bc=function(_0x50ef94){while(--_0x50ef94){_0x148351['push'](_0x148351['shift']());}};_0x1852bc(++_0x440979);}(_0xc88f,0xed));var _0xfc88=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc88f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfc88('0x0'));var util=require('util');var moment=require(_0xfc88('0x1'));var BPromise=require(_0xfc88('0x2'));var rs=require(_0xfc88('0x3'));var fs=require('fs');var Redis=require(_0xfc88('0x4'));var db=require(_0xfc88('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc88('0x6'))(_0xfc88('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfc88('0x8')][_0xfc88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b9c25,_0x3e9000,_0x14052f){return new BPromise(function(_0xeb143,_0x15ffb0){return client[_0xfc88('0xa')](_0x3b9c25,_0x14052f)[_0xfc88('0xb')](function(_0x2eec35){logger['info'](_0xfc88('0xc'),_0x3e9000,_0xfc88('0xd'));logger[_0xfc88('0xe')](_0xfc88('0xf'),_0x3e9000,_0xfc88('0xd'),JSON[_0xfc88('0x10')](_0x2eec35));if(_0x2eec35[_0xfc88('0x11')]){if(_0x2eec35['error']['code']===0x1f4){logger['error'](_0xfc88('0xc'),_0x3e9000,_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);return _0x15ffb0(_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);}logger['error'](_0xfc88('0xc'),_0x3e9000,_0x2eec35[_0xfc88('0x11')][_0xfc88('0x12')]);return _0xeb143(_0x2eec35['error'][_0xfc88('0x12')]);}else{logger[_0xfc88('0x13')](_0xfc88('0xc'),_0x3e9000,_0xfc88('0xd'));_0xeb143(_0x2eec35['result'][_0xfc88('0x12')]);}})[_0xfc88('0x14')](function(_0x35e178){logger[_0xfc88('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e9000,_0x35e178);_0x15ffb0(_0x35e178);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 74006b1..406f329 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 _0xe2dd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','create','put','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x9b101,_0x17c8e9){var _0x5d1722=function(_0x280bf7){while(--_0x280bf7){_0x9b101['push'](_0x9b101['shift']());}};_0x5d1722(++_0x17c8e9);}(_0xe2dd,0x18a));var _0xde2d=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xe2dd[_0x49c68e];return _0x33032b;};'use strict';var multer=require(_0xde2d('0x0'));var util=require(_0xde2d('0x1'));var path=require(_0xde2d('0x2'));var timeout=require(_0xde2d('0x3'));var express=require(_0xde2d('0x4'));var router=express['Router']();var fs_extra=require(_0xde2d('0x5'));var auth=require(_0xde2d('0x6'));var interaction=require(_0xde2d('0x7'));var config=require(_0xde2d('0x8'));var controller=require('./analyticExtractedReport.controller');router[_0xde2d('0x9')]('/',auth[_0xde2d('0xa')](),controller['index']);router[_0xde2d('0x9')](_0xde2d('0xb'),auth[_0xde2d('0xa')](),controller[_0xde2d('0xc')]);router[_0xde2d('0x9')](_0xde2d('0xd'),auth[_0xde2d('0xa')](),controller[_0xde2d('0xe')]);router['post']('/',auth[_0xde2d('0xa')](),controller[_0xde2d('0xf')]);router[_0xde2d('0x10')](_0xde2d('0xb'),auth[_0xde2d('0xa')](),controller[_0xde2d('0x11')]);router['delete'](_0xde2d('0xb'),auth[_0xde2d('0xa')](),controller[_0xde2d('0x12')]);module['exports']=router; \ No newline at end of file +var _0x76d1=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','put'];(function(_0x47c5bf,_0x45977e){var _0x11b779=function(_0x1bd585){while(--_0x1bd585){_0x47c5bf['push'](_0x47c5bf['shift']());}};_0x11b779(++_0x45977e);}(_0x76d1,0xdf));var _0x176d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x76d1[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x176d('0x0'));var util=require('util');var path=require(_0x176d('0x1'));var timeout=require(_0x176d('0x2'));var express=require(_0x176d('0x3'));var router=express[_0x176d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x176d('0x5'));var interaction=require(_0x176d('0x6'));var config=require(_0x176d('0x7'));var controller=require(_0x176d('0x8'));router[_0x176d('0x9')]('/',auth[_0x176d('0xa')](),controller[_0x176d('0xb')]);router['get'](_0x176d('0xc'),auth[_0x176d('0xa')](),controller['show']);router[_0x176d('0x9')](_0x176d('0xd'),auth[_0x176d('0xa')](),controller[_0x176d('0xe')]);router[_0x176d('0xf')]('/',auth[_0x176d('0xa')](),controller['create']);router[_0x176d('0x10')]('/:id',auth[_0x176d('0xa')](),controller[_0x176d('0x11')]);router['delete'](_0x176d('0xc'),auth[_0x176d('0xa')](),controller[_0x176d('0x12')]);module[_0x176d('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 f40f5a5..bc3350e 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 _0xe824=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x5c4172,_0x1ac4d0){var _0x52eff4=function(_0x227b4a){while(--_0x227b4a){_0x5c4172['push'](_0x5c4172['shift']());}};_0x52eff4(++_0x1ac4d0);}(_0xe824,0xf1));var _0x4e82=function(_0x44b0af,_0xdb6975){_0x44b0af=_0x44b0af-0x0;var _0xafaa74=_0xe824[_0x44b0af];return _0xafaa74;};'use strict';var Sequelize=require(_0x4e82('0x0'));module['exports']={'field':{'type':Sequelize[_0x4e82('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x4e82('0x2')]},'format':{'type':Sequelize[_0x4e82('0x2')]},'groupBy':{'type':Sequelize[_0x4e82('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4e82('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xb6a6=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xb6a6,0x179));var _0x6b6a=function(_0x34683e,_0x46427f){_0x34683e=_0x34683e-0x0;var _0x33c7f8=_0xb6a6[_0x34683e];return _0x33c7f8;};'use strict';var Sequelize=require(_0x6b6a('0x0'));module[_0x6b6a('0x1')]={'field':{'type':Sequelize[_0x6b6a('0x2')]},'alias':{'type':Sequelize[_0x6b6a('0x3')]},'function':{'type':Sequelize[_0x6b6a('0x3')]},'format':{'type':Sequelize[_0x6b6a('0x3')]},'groupBy':{'type':Sequelize[_0x6b6a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6b6a('0x3')]},'custom':{'type':Sequelize[_0x6b6a('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index bb4d560..7a20651 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 _0x7785=['destroy','addFields','sequelize','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','limit','count','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','index','AnalyticFieldReport','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','map','VIRTUAL','filter','merge','includeAll','include','findAll','catch','show','params','rawAttributes','options','body','bulkCreate','find','bulkDestroy'];(function(_0x13ce26,_0xba331f){var _0x1fccf4=function(_0x390fea){while(--_0x390fea){_0x13ce26['push'](_0x13ce26['shift']());}};_0x1fccf4(++_0xba331f);}(_0x7785,0xe4));var _0x5778=function(_0x4d7789,_0x4065b5){_0x4d7789=_0x4d7789-0x0;var _0x2952d6=_0x7785[_0x4d7789];return _0x2952d6;};'use strict';var emlformat=require(_0x5778('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5778('0x1'));var jsonpatch=require(_0x5778('0x2'));var rp=require('request-promise');var moment=require(_0x5778('0x3'));var BPromise=require(_0x5778('0x4'));var Mustache=require(_0x5778('0x5'));var util=require('util');var path=require('path');var sox=require(_0x5778('0x6'));var csv=require(_0x5778('0x7'));var ejs=require(_0x5778('0x8'));var fs=require('fs');var fs_extra=require(_0x5778('0x9'));var _=require(_0x5778('0xa'));var squel=require(_0x5778('0xb'));var crypto=require(_0x5778('0xc'));var jsforce=require(_0x5778('0xd'));var deskjs=require(_0x5778('0xe'));var toCsv=require(_0x5778('0x7'));var querystring=require('querystring');var Papa=require(_0x5778('0xf'));var Redis=require(_0x5778('0x10'));var authService=require(_0x5778('0x11'));var qs=require(_0x5778('0x12'));var as=require(_0x5778('0x13'));var hardwareService=require(_0x5778('0x14'));var logger=require(_0x5778('0x15'))(_0x5778('0x16'));var utils=require(_0x5778('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5778('0x18'))['db'];function respondWithStatusCode(_0x593aa9,_0x58a6c5){_0x58a6c5=_0x58a6c5||0xcc;return function(_0x36698e){if(_0x36698e){return _0x593aa9['sendStatus'](_0x58a6c5);}return _0x593aa9[_0x5778('0x19')](_0x58a6c5)[_0x5778('0x1a')]();};}function respondWithResult(_0xba4514,_0x45a6e0){_0x45a6e0=_0x45a6e0||0xc8;return function(_0x545d40){if(_0x545d40){return _0xba4514[_0x5778('0x19')](_0x45a6e0)['json'](_0x545d40);}};}function respondWithFilteredResult(_0x26bde6,_0x41da39){return function(_0x5c1446){if(_0x5c1446){var _0xeac168=typeof _0x41da39['offset']==='undefined'&&typeof _0x41da39[_0x5778('0x1b')]==='undefined';var _0x2d66fd=_0x5c1446['count'];var _0x2d7de9=_0xeac168?0x0:_0x41da39['offset'];var _0x58a814=_0xeac168?_0x5c1446[_0x5778('0x1c')]:_0x41da39['offset']+_0x41da39[_0x5778('0x1b')];var _0x47ea6;if(_0x58a814>=_0x2d66fd){_0x58a814=_0x2d66fd;_0x47ea6=0xc8;}else{_0x47ea6=0xce;}_0x26bde6[_0x5778('0x19')](_0x47ea6);return _0x26bde6['set'](_0x5778('0x1d'),_0x2d7de9+'-'+_0x58a814+'/'+_0x2d66fd)[_0x5778('0x1e')](_0x5c1446);}return null;};}function patchUpdates(_0x116100){return function(_0x196abf){try{jsonpatch[_0x5778('0x1f')](_0x196abf,_0x116100,!![]);}catch(_0x44a206){return BPromise[_0x5778('0x20')](_0x44a206);}return _0x196abf[_0x5778('0x21')]();};}function saveUpdates(_0x48c510,_0x4ab863){return function(_0x5436a1){if(_0x5436a1){return _0x5436a1[_0x5778('0x22')](_0x48c510)[_0x5778('0x23')](function(_0xb480b9){return _0xb480b9;});}return null;};}function removeEntity(_0x14572e,_0xe9588b){return function(_0x513cbc){if(_0x513cbc){return _0x513cbc['destroy']()[_0x5778('0x23')](function(){_0x14572e[_0x5778('0x19')](0xcc)[_0x5778('0x1a')]();});}};}function handleEntityNotFound(_0x989cb6,_0x5e1267){return function(_0x497230){if(!_0x497230){_0x989cb6[_0x5778('0x24')](0x194);}return _0x497230;};}function handleError(_0x6551a3,_0xc4cad8){_0xc4cad8=_0xc4cad8||0x1f4;return function(_0x1d30c6){logger['error'](_0x1d30c6[_0x5778('0x25')]);if(_0x1d30c6[_0x5778('0x26')]){delete _0x1d30c6[_0x5778('0x26')];}_0x6551a3[_0x5778('0x19')](_0xc4cad8)['send'](_0x1d30c6);};}exports[_0x5778('0x27')]=function(_0x459045,_0x2d485b){var _0x5bb221={},_0xcc3d04={},_0x2c5d9d={'count':0x0,'rows':[]};var _0x47bb80=_['map'](db[_0x5778('0x28')]['rawAttributes'],function(_0x53c282){return{'name':_0x53c282[_0x5778('0x29')],'type':_0x53c282['type'][_0x5778('0x2a')]};});_0xcc3d04['model']=_['map'](_0x47bb80,_0x5778('0x26'));_0xcc3d04[_0x5778('0x2b')]=_[_0x5778('0x2c')](_0x459045[_0x5778('0x2b')]);_0xcc3d04[_0x5778('0x2d')]=_[_0x5778('0x2e')](_0xcc3d04[_0x5778('0x2f')],_0xcc3d04[_0x5778('0x2b')]);_0x5bb221[_0x5778('0x30')]=_[_0x5778('0x2e')](_0xcc3d04['model'],qs[_0x5778('0x31')](_0x459045[_0x5778('0x2b')][_0x5778('0x31')]));_0x5bb221[_0x5778('0x30')]=_0x5bb221[_0x5778('0x30')][_0x5778('0x32')]?_0x5bb221[_0x5778('0x30')]:_0xcc3d04[_0x5778('0x2f')];if(!_0x459045['query'][_0x5778('0x33')](_0x5778('0x34'))){_0x5bb221[_0x5778('0x1b')]=qs[_0x5778('0x1b')](_0x459045[_0x5778('0x2b')][_0x5778('0x1b')]);_0x5bb221[_0x5778('0x35')]=qs[_0x5778('0x35')](_0x459045[_0x5778('0x2b')][_0x5778('0x35')]);}_0x5bb221['order']=qs[_0x5778('0x36')](_0x459045['query'][_0x5778('0x36')]);_0x5bb221[_0x5778('0x37')]=qs[_0x5778('0x2d')](_['pick'](_0x459045[_0x5778('0x2b')],_0xcc3d04[_0x5778('0x2d')]),_0x47bb80);if(_0x459045[_0x5778('0x2b')]['filter']){_0x5bb221[_0x5778('0x37')]=_['merge'](_0x5bb221[_0x5778('0x37')],{'$or':_[_0x5778('0x38')](_0x47bb80,function(_0x58b1a0){if(_0x58b1a0['type']!==_0x5778('0x39')){var _0x42b132={};_0x42b132[_0x58b1a0[_0x5778('0x26')]]={'$like':'%'+_0x459045['query'][_0x5778('0x3a')]+'%'};return _0x42b132;}})});}_0x5bb221=_[_0x5778('0x3b')]({},_0x5bb221,_0x459045['options']);var _0x1f2155={'where':_0x5bb221[_0x5778('0x37')]};return db['AnalyticFieldReport'][_0x5778('0x1c')](_0x1f2155)[_0x5778('0x23')](function(_0x2e8478){_0x2c5d9d[_0x5778('0x1c')]=_0x2e8478;if(_0x459045['query'][_0x5778('0x3c')]){_0x5bb221[_0x5778('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x5778('0x3e')](_0x5bb221);})[_0x5778('0x23')](function(_0x52c610){_0x2c5d9d['rows']=_0x52c610;return _0x2c5d9d;})[_0x5778('0x23')](respondWithFilteredResult(_0x2d485b,_0x5bb221))[_0x5778('0x3f')](handleError(_0x2d485b,null));};exports[_0x5778('0x40')]=function(_0x56401b,_0x173f53){var _0x253f2a={'raw':![],'where':{'id':_0x56401b[_0x5778('0x41')]['id']}},_0x42d0e0={};_0x42d0e0[_0x5778('0x2f')]=_['keys'](db[_0x5778('0x28')][_0x5778('0x42')]);_0x42d0e0[_0x5778('0x2b')]=_[_0x5778('0x2c')](_0x56401b['query']);_0x42d0e0[_0x5778('0x2d')]=_['intersection'](_0x42d0e0['model'],_0x42d0e0[_0x5778('0x2b')]);_0x253f2a[_0x5778('0x30')]=_[_0x5778('0x2e')](_0x42d0e0[_0x5778('0x2f')],qs[_0x5778('0x31')](_0x56401b['query'][_0x5778('0x31')]));_0x253f2a[_0x5778('0x30')]=_0x253f2a[_0x5778('0x30')]['length']?_0x253f2a[_0x5778('0x30')]:_0x42d0e0[_0x5778('0x2f')];if(_0x56401b['query'][_0x5778('0x3c')]){_0x253f2a['include']=[{'all':!![]}];}_0x253f2a=_[_0x5778('0x3b')]({},_0x253f2a,_0x56401b[_0x5778('0x43')]);return db['AnalyticFieldReport']['find'](_0x253f2a)[_0x5778('0x23')](handleEntityNotFound(_0x173f53,null))[_0x5778('0x23')](respondWithResult(_0x173f53,null))[_0x5778('0x3f')](handleError(_0x173f53,null));};exports['create']=function(_0x4f3835,_0x2aeb2a){return db[_0x5778('0x28')]['create'](_0x4f3835[_0x5778('0x44')],{})['then'](respondWithResult(_0x2aeb2a,0xc9))[_0x5778('0x3f')](handleError(_0x2aeb2a,null));};exports[_0x5778('0x45')]=function(_0x1c0a71,_0x2650c1){return db['AnalyticFieldReport']['bulkCreate'](_0x1c0a71[_0x5778('0x44')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2650c1,0xc9))['catch'](handleError(_0x2650c1,null));};exports[_0x5778('0x22')]=function(_0x1fab1a,_0x18e723){if(_0x1fab1a[_0x5778('0x44')]['id']){delete _0x1fab1a[_0x5778('0x44')]['id'];}return db[_0x5778('0x28')]['find']({'where':{'id':_0x1fab1a[_0x5778('0x41')]['id']}})[_0x5778('0x23')](handleEntityNotFound(_0x18e723,null))[_0x5778('0x23')](saveUpdates(_0x1fab1a[_0x5778('0x44')],null))[_0x5778('0x23')](respondWithResult(_0x18e723,null))['catch'](handleError(_0x18e723,null));};exports['destroy']=function(_0x143f18,_0x2ef075){return db[_0x5778('0x28')][_0x5778('0x46')]({'where':{'id':_0x143f18['params']['id']}})['then'](handleEntityNotFound(_0x2ef075,null))[_0x5778('0x23')](removeEntity(_0x2ef075,null))[_0x5778('0x3f')](handleError(_0x2ef075,null));};exports[_0x5778('0x47')]=function(_0x32a613,_0x1794ec){return db[_0x5778('0x28')][_0x5778('0x48')]({'where':{'id':_0x32a613[_0x5778('0x2b')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x5778('0x23')](respondWithResult(_0x1794ec,0xcc))[_0x5778('0x3f')](handleError(_0x1794ec,null));};exports[_0x5778('0x49')]=function(_0x4670df,_0x52595d,_0x2d2d6e){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x4670df[_0x5778('0x41')]['id']}})[_0x5778('0x23')](handleEntityNotFound(_0x52595d,null))[_0x5778('0x23')](function(_0x36e118){if(_0x36e118){return db[_0x5778('0x4a')]['transaction'](function(_0x1f88e8){return db[_0x5778('0x28')][_0x5778('0x48')]({'where':{'CustomReportId':_0x4670df['params']['id']},'transaction':_0x1f88e8})[_0x5778('0x23')](function(_0x31e88f){var _0x564f27=_['map'](_0x4670df['body'],function(_0x128828){delete _0x128828['id'];_0x128828['CustomReportId']=_0x4670df['params']['id'];return _0x128828;});return db[_0x5778('0x28')][_0x5778('0x45')](_0x564f27,{'transaction':_0x1f88e8});});})['then'](function(){return db[_0x5778('0x28')][_0x5778('0x3e')]({'where':{'CustomReportId':_0x4670df['params']['id']}});});}})[_0x5778('0x23')](respondWithResult(_0x52595d,null))['catch'](handleError(_0x52595d,null));}; \ No newline at end of file +var _0xf419=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','bulkCreate','params','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','rimraf','fast-json-patch','moment','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x1b2462,_0x6bcef5){var _0x39b174=function(_0x1b1e9e){while(--_0x1b1e9e){_0x1b2462['push'](_0x1b2462['shift']());}};_0x39b174(++_0x6bcef5);}(_0xf419,0x185));var _0x9f41=function(_0x2ea44c,_0x5e145f){_0x2ea44c=_0x2ea44c-0x0;var _0x4e9346=_0xf419[_0x2ea44c];return _0x4e9346;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f41('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f41('0x1'));var rp=require('request-promise');var moment=require(_0x9f41('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f41('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x9f41('0x4'));var ejs=require(_0x9f41('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9f41('0x6'));var squel=require(_0x9f41('0x7'));var crypto=require(_0x9f41('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x9f41('0x9'));var toCsv=require(_0x9f41('0x4'));var querystring=require(_0x9f41('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9f41('0xb'));var qs=require(_0x9f41('0xc'));var as=require(_0x9f41('0xd'));var hardwareService=require(_0x9f41('0xe'));var logger=require('../../config/logger')(_0x9f41('0xf'));var utils=require(_0x9f41('0x10'));var config=require(_0x9f41('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x9f41('0x12'))['db'];function respondWithStatusCode(_0x5bb505,_0x35d0f3){_0x35d0f3=_0x35d0f3||0xcc;return function(_0xf0af6c){if(_0xf0af6c){return _0x5bb505['sendStatus'](_0x35d0f3);}return _0x5bb505['status'](_0x35d0f3)[_0x9f41('0x13')]();};}function respondWithResult(_0x7525a8,_0x14332c){_0x14332c=_0x14332c||0xc8;return function(_0x3119c0){if(_0x3119c0){return _0x7525a8[_0x9f41('0x14')](_0x14332c)[_0x9f41('0x15')](_0x3119c0);}};}function respondWithFilteredResult(_0x1c9db7,_0x51af4b){return function(_0x4ecb76){if(_0x4ecb76){var _0x569a97=typeof _0x51af4b[_0x9f41('0x16')]==='undefined'&&typeof _0x51af4b['limit']==='undefined';var _0x3e4a51=_0x4ecb76['count'];var _0x30c54a=_0x569a97?0x0:_0x51af4b['offset'];var _0x192653=_0x569a97?_0x4ecb76[_0x9f41('0x17')]:_0x51af4b[_0x9f41('0x16')]+_0x51af4b[_0x9f41('0x18')];var _0x24c8f8;if(_0x192653>=_0x3e4a51){_0x192653=_0x3e4a51;_0x24c8f8=0xc8;}else{_0x24c8f8=0xce;}_0x1c9db7[_0x9f41('0x14')](_0x24c8f8);return _0x1c9db7[_0x9f41('0x19')](_0x9f41('0x1a'),_0x30c54a+'-'+_0x192653+'/'+_0x3e4a51)[_0x9f41('0x15')](_0x4ecb76);}return null;};}function patchUpdates(_0x1b89e8){return function(_0x1956be){try{jsonpatch['apply'](_0x1956be,_0x1b89e8,!![]);}catch(_0x3471eb){return BPromise[_0x9f41('0x1b')](_0x3471eb);}return _0x1956be[_0x9f41('0x1c')]();};}function saveUpdates(_0x4a80aa,_0x1db57a){return function(_0x600909){if(_0x600909){return _0x600909[_0x9f41('0x1d')](_0x4a80aa)[_0x9f41('0x1e')](function(_0x4e4313){return _0x4e4313;});}return null;};}function removeEntity(_0xa2d66e,_0x342ef9){return function(_0x34552b){if(_0x34552b){return _0x34552b[_0x9f41('0x1f')]()['then'](function(){_0xa2d66e[_0x9f41('0x14')](0xcc)[_0x9f41('0x13')]();});}};}function handleEntityNotFound(_0x58dc98,_0x47084){return function(_0x4119db){if(!_0x4119db){_0x58dc98[_0x9f41('0x20')](0x194);}return _0x4119db;};}function handleError(_0x4de18f,_0x32bff7){_0x32bff7=_0x32bff7||0x1f4;return function(_0x5b7df6){logger[_0x9f41('0x21')](_0x5b7df6[_0x9f41('0x22')]);if(_0x5b7df6[_0x9f41('0x23')]){delete _0x5b7df6[_0x9f41('0x23')];}_0x4de18f[_0x9f41('0x14')](_0x32bff7)[_0x9f41('0x24')](_0x5b7df6);};}exports[_0x9f41('0x25')]=function(_0x3d7cd5,_0x547b83){var _0x3876a8={},_0x74e721={},_0x546bef={'count':0x0,'rows':[]};var _0xf1048b=_[_0x9f41('0x26')](db[_0x9f41('0x27')]['rawAttributes'],function(_0x15746a){return{'name':_0x15746a[_0x9f41('0x28')],'type':_0x15746a[_0x9f41('0x29')][_0x9f41('0x2a')]};});_0x74e721['model']=_[_0x9f41('0x26')](_0xf1048b,_0x9f41('0x23'));_0x74e721['query']=_[_0x9f41('0x2b')](_0x3d7cd5[_0x9f41('0x2c')]);_0x74e721[_0x9f41('0x2d')]=_['intersection'](_0x74e721[_0x9f41('0x2e')],_0x74e721['query']);_0x3876a8['attributes']=_[_0x9f41('0x2f')](_0x74e721[_0x9f41('0x2e')],qs[_0x9f41('0x30')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x30')]));_0x3876a8[_0x9f41('0x31')]=_0x3876a8[_0x9f41('0x31')][_0x9f41('0x32')]?_0x3876a8['attributes']:_0x74e721['model'];if(!_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x33')](_0x9f41('0x34'))){_0x3876a8[_0x9f41('0x18')]=qs['limit'](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x18')]);_0x3876a8[_0x9f41('0x16')]=qs[_0x9f41('0x16')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x16')]);}_0x3876a8[_0x9f41('0x35')]=qs[_0x9f41('0x36')](_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x36')]);_0x3876a8['where']=qs[_0x9f41('0x2d')](_[_0x9f41('0x37')](_0x3d7cd5['query'],_0x74e721[_0x9f41('0x2d')]),_0xf1048b);if(_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x38')]){_0x3876a8[_0x9f41('0x39')]=_[_0x9f41('0x3a')](_0x3876a8[_0x9f41('0x39')],{'$or':_['map'](_0xf1048b,function(_0x590a6f){if(_0x590a6f['type']!==_0x9f41('0x3b')){var _0x241e8c={};_0x241e8c[_0x590a6f[_0x9f41('0x23')]]={'$like':'%'+_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x38')]+'%'};return _0x241e8c;}})});}_0x3876a8=_[_0x9f41('0x3a')]({},_0x3876a8,_0x3d7cd5['options']);var _0x2fa0c3={'where':_0x3876a8['where']};return db[_0x9f41('0x27')][_0x9f41('0x17')](_0x2fa0c3)[_0x9f41('0x1e')](function(_0x4c0ddd){_0x546bef[_0x9f41('0x17')]=_0x4c0ddd;if(_0x3d7cd5[_0x9f41('0x2c')][_0x9f41('0x3c')]){_0x3876a8[_0x9f41('0x3d')]=[{'all':!![]}];}return db[_0x9f41('0x27')][_0x9f41('0x3e')](_0x3876a8);})['then'](function(_0x3ad523){_0x546bef[_0x9f41('0x3f')]=_0x3ad523;return _0x546bef;})[_0x9f41('0x1e')](respondWithFilteredResult(_0x547b83,_0x3876a8))[_0x9f41('0x40')](handleError(_0x547b83,null));};exports[_0x9f41('0x41')]=function(_0x39ba40,_0x4ad188){var _0x52cf62={'raw':![],'where':{'id':_0x39ba40['params']['id']}},_0x50a8c0={};_0x50a8c0[_0x9f41('0x2e')]=_[_0x9f41('0x2b')](db[_0x9f41('0x27')][_0x9f41('0x42')]);_0x50a8c0['query']=_['keys'](_0x39ba40['query']);_0x50a8c0['filters']=_['intersection'](_0x50a8c0[_0x9f41('0x2e')],_0x50a8c0['query']);_0x52cf62[_0x9f41('0x31')]=_['intersection'](_0x50a8c0['model'],qs[_0x9f41('0x30')](_0x39ba40[_0x9f41('0x2c')][_0x9f41('0x30')]));_0x52cf62[_0x9f41('0x31')]=_0x52cf62[_0x9f41('0x31')][_0x9f41('0x32')]?_0x52cf62[_0x9f41('0x31')]:_0x50a8c0[_0x9f41('0x2e')];if(_0x39ba40['query'][_0x9f41('0x3c')]){_0x52cf62[_0x9f41('0x3d')]=[{'all':!![]}];}_0x52cf62=_[_0x9f41('0x3a')]({},_0x52cf62,_0x39ba40[_0x9f41('0x43')]);return db[_0x9f41('0x27')][_0x9f41('0x44')](_0x52cf62)[_0x9f41('0x1e')](handleEntityNotFound(_0x4ad188,null))[_0x9f41('0x1e')](respondWithResult(_0x4ad188,null))[_0x9f41('0x40')](handleError(_0x4ad188,null));};exports[_0x9f41('0x45')]=function(_0x30d5f7,_0x39ffe9){return db[_0x9f41('0x27')]['create'](_0x30d5f7[_0x9f41('0x46')],{})[_0x9f41('0x1e')](respondWithResult(_0x39ffe9,0xc9))['catch'](handleError(_0x39ffe9,null));};exports['bulkCreate']=function(_0x26a801,_0x1f7ec2){return db[_0x9f41('0x27')][_0x9f41('0x47')](_0x26a801['body'],{'raw':![],'individualHooks':!![]})[_0x9f41('0x1e')](respondWithResult(_0x1f7ec2,0xc9))['catch'](handleError(_0x1f7ec2,null));};exports[_0x9f41('0x1d')]=function(_0x17d1f6,_0x4b2a28){if(_0x17d1f6[_0x9f41('0x46')]['id']){delete _0x17d1f6['body']['id'];}return db[_0x9f41('0x27')][_0x9f41('0x44')]({'where':{'id':_0x17d1f6[_0x9f41('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b2a28,null))[_0x9f41('0x1e')](saveUpdates(_0x17d1f6[_0x9f41('0x46')],null))[_0x9f41('0x1e')](respondWithResult(_0x4b2a28,null))[_0x9f41('0x40')](handleError(_0x4b2a28,null));};exports[_0x9f41('0x1f')]=function(_0x2c83f6,_0x57d64f){return db[_0x9f41('0x27')]['find']({'where':{'id':_0x2c83f6['params']['id']}})[_0x9f41('0x1e')](handleEntityNotFound(_0x57d64f,null))[_0x9f41('0x1e')](removeEntity(_0x57d64f,null))[_0x9f41('0x40')](handleError(_0x57d64f,null));};exports[_0x9f41('0x49')]=function(_0xceac6c,_0x526c96){return db['AnalyticFieldReport'][_0x9f41('0x1f')]({'where':{'id':_0xceac6c[_0x9f41('0x2c')][_0x9f41('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x9f41('0x1e')](respondWithResult(_0x526c96,0xcc))[_0x9f41('0x40')](handleError(_0x526c96,null));};exports[_0x9f41('0x4b')]=function(_0x2fee9d,_0x3209bc,_0x2bfdeb){return db[_0x9f41('0x4c')][_0x9f41('0x4d')]({'where':{'id':_0x2fee9d[_0x9f41('0x48')]['id']}})['then'](handleEntityNotFound(_0x3209bc,null))[_0x9f41('0x1e')](function(_0x230d39){if(_0x230d39){return db['sequelize'][_0x9f41('0x4e')](function(_0x54eb3e){return db[_0x9f41('0x27')][_0x9f41('0x1f')]({'where':{'CustomReportId':_0x2fee9d['params']['id']},'transaction':_0x54eb3e})[_0x9f41('0x1e')](function(_0x3ba64c){var _0x33b8af=_['map'](_0x2fee9d['body'],function(_0x11ed40){delete _0x11ed40['id'];_0x11ed40[_0x9f41('0x4f')]=_0x2fee9d[_0x9f41('0x48')]['id'];return _0x11ed40;});return db['AnalyticFieldReport']['bulkCreate'](_0x33b8af,{'transaction':_0x54eb3e});});})[_0x9f41('0x1e')](function(){return db[_0x9f41('0x27')][_0x9f41('0x3e')]({'where':{'CustomReportId':_0x2fee9d[_0x9f41('0x48')]['id']}});});}})['then'](respondWithResult(_0x3209bc,null))[_0x9f41('0x40')](handleError(_0x3209bc,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 3507226..cef3202 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 _0x68cd=['../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3f5adc,_0x49b1c6){var _0x49ff79=function(_0x368c7f){while(--_0x368c7f){_0x3f5adc['push'](_0x3f5adc['shift']());}};_0x49ff79(++_0x49b1c6);}(_0x68cd,0x10d));var _0xd68c=function(_0x3a3758,_0x4dd8cf){_0x3a3758=_0x3a3758-0x0;var _0x1a9234=_0x68cd[_0x3a3758];return _0x1a9234;};'use strict';var _=require(_0xd68c('0x0'));var util=require(_0xd68c('0x1'));var logger=require(_0xd68c('0x2'))('api');var moment=require(_0xd68c('0x3'));var BPromise=require(_0xd68c('0x4'));var rp=require(_0xd68c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd68c('0x6'));var config=require(_0xd68c('0x7'));var attributes=require(_0xd68c('0x8'));module[_0xd68c('0x9')]=function(_0x1acac7,_0xbbef22){return _0x1acac7[_0xd68c('0xa')]('AnalyticFieldReport',attributes,{'tableName':_0xd68c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43a3=['moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api'];(function(_0x36abc8,_0x354a28){var _0x4626ad=function(_0x5c0bfe){while(--_0x5c0bfe){_0x36abc8['push'](_0x36abc8['shift']());}};_0x4626ad(++_0x354a28);}(_0x43a3,0x1c4));var _0x343a=function(_0x40a410,_0x54a561){_0x40a410=_0x40a410-0x0;var _0x4e0d8b=_0x43a3[_0x40a410];return _0x4e0d8b;};'use strict';var _=require('lodash');var util=require(_0x343a('0x0'));var logger=require(_0x343a('0x1'))(_0x343a('0x2'));var moment=require(_0x343a('0x3'));var BPromise=require(_0x343a('0x4'));var rp=require(_0x343a('0x5'));var fs=require('fs');var path=require(_0x343a('0x6'));var rimraf=require(_0x343a('0x7'));var config=require('../../config/environment');var attributes=require(_0x343a('0x8'));module[_0x343a('0x9')]=function(_0x245180,_0x15a6fd){return _0x245180[_0x343a('0xa')](_0x343a('0xb'),attributes,{'tableName':_0x343a('0xc'),'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 611ac35..b558952 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 _0x32d7=['AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x598622,_0x39985c){var _0x50df2f=function(_0x59ee9e){while(--_0x59ee9e){_0x598622['push'](_0x598622['shift']());}};_0x50df2f(++_0x39985c);}(_0x32d7,0xd0));var _0x732d=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x32d7[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0x732d('0x0'));var util=require('util');var moment=require(_0x732d('0x1'));var BPromise=require(_0x732d('0x2'));var rs=require(_0x732d('0x3'));var fs=require('fs');var Redis=require(_0x732d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x732d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x732d('0x6'));var jayson=require(_0x732d('0x7'));var client=jayson[_0x732d('0x8')][_0x732d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d430a,_0x259c51,_0x243a03){return new BPromise(function(_0x3ba72a,_0x58fe13){return client['request'](_0x4d430a,_0x243a03)[_0x732d('0xa')](function(_0x386f83){logger[_0x732d('0xb')](_0x732d('0xc'),_0x259c51,_0x732d('0xd'));logger[_0x732d('0xe')](_0x732d('0xf'),_0x259c51,_0x732d('0xd'),JSON['stringify'](_0x386f83));if(_0x386f83['error']){if(_0x386f83[_0x732d('0x10')]['code']===0x1f4){logger[_0x732d('0x10')](_0x732d('0xc'),_0x259c51,_0x386f83[_0x732d('0x10')][_0x732d('0x11')]);return _0x58fe13(_0x386f83[_0x732d('0x10')]['message']);}logger[_0x732d('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x259c51,_0x386f83[_0x732d('0x10')][_0x732d('0x11')]);return _0x3ba72a(_0x386f83[_0x732d('0x10')][_0x732d('0x11')]);}else{logger[_0x732d('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x259c51,'request\x20sent');_0x3ba72a(_0x386f83[_0x732d('0x12')]['message']);}})[_0x732d('0x13')](function(_0x29ac79){logger[_0x732d('0x10')](_0x732d('0xc'),_0x259c51,_0x29ac79);_0x58fe13(_0x29ac79);});});} \ No newline at end of file +var _0x0235=['../../config/logger','../../config/environment','jayson/promise','http','info','AnalyticFieldReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3d00db,_0x3692b3){var _0x41f115=function(_0x3c94fd){while(--_0x3c94fd){_0x3d00db['push'](_0x3d00db['shift']());}};_0x41f115(++_0x3692b3);}(_0x0235,0x77));var _0x5023=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0235[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x5023('0x0'));var util=require(_0x5023('0x1'));var moment=require(_0x5023('0x2'));var BPromise=require(_0x5023('0x3'));var rs=require(_0x5023('0x4'));var fs=require('fs');var Redis=require(_0x5023('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5023('0x6'));var logger=require(_0x5023('0x7'))('rpc');var config=require(_0x5023('0x8'));var jayson=require(_0x5023('0x9'));var client=jayson['client'][_0x5023('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16fddd,_0x54832a,_0x6a7aef){return new BPromise(function(_0x5079b6,_0x5b1b7c){return client['request'](_0x16fddd,_0x6a7aef)['then'](function(_0x3dc4b9){logger[_0x5023('0xb')](_0x5023('0xc'),_0x54832a,'request\x20sent');logger[_0x5023('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x54832a,_0x5023('0xe'),JSON[_0x5023('0xf')](_0x3dc4b9));if(_0x3dc4b9[_0x5023('0x10')]){if(_0x3dc4b9[_0x5023('0x10')][_0x5023('0x11')]===0x1f4){logger[_0x5023('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);return _0x5b1b7c(_0x3dc4b9['error'][_0x5023('0x12')]);}logger[_0x5023('0x10')](_0x5023('0xc'),_0x54832a,_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);return _0x5079b6(_0x3dc4b9[_0x5023('0x10')][_0x5023('0x12')]);}else{logger[_0x5023('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x5023('0xe'));_0x5079b6(_0x3dc4b9[_0x5023('0x13')][_0x5023('0x12')]);}})[_0x5023('0x14')](function(_0x1c7574){logger[_0x5023('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x54832a,_0x1c7574);_0x5b1b7c(_0x1c7574);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 2b2aa97..ccbc85f 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(_0x2a967d,_0x25f4e1){var _0x2295ba=function(_0x465046){while(--_0x465046){_0x2a967d['push'](_0x2a967d['shift']());}};_0x2295ba(++_0x25f4e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x3dd4fc,_0x1f7812){var _0x3e7f83=function(_0x23b249){while(--_0x23b249){_0x3dd4fc['push'](_0x3dd4fc['shift']());}};_0x3e7f83(++_0x1f7812);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index fb418a9..39b14bd 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 _0x99cd=['STRING','name','TEXT','sequelize'];(function(_0x1c0752,_0x3e5a4e){var _0x42bb0b=function(_0x21a1fb){while(--_0x21a1fb){_0x1c0752['push'](_0x1c0752['shift']());}};_0x42bb0b(++_0x3e5a4e);}(_0x99cd,0x1df));var _0xd99c=function(_0x981548,_0xd8b65e){_0x981548=_0x981548-0x0;var _0x142cc8=_0x99cd[_0x981548];return _0x142cc8;};'use strict';var Sequelize=require(_0xd99c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd99c('0x1')],'allowNull':![],'unique':_0xd99c('0x2')},'table':{'type':Sequelize[_0xd99c('0x1')]},'metric':{'type':Sequelize[_0xd99c('0x3')]},'description':{'type':Sequelize[_0xd99c('0x1')]}}; \ No newline at end of file +var _0x570f=['STRING','TEXT','sequelize','exports'];(function(_0x5ca2fe,_0x20e1fd){var _0x206e0f=function(_0x16b9fa){while(--_0x16b9fa){_0x5ca2fe['push'](_0x5ca2fe['shift']());}};_0x206e0f(++_0x20e1fd);}(_0x570f,0x152));var _0xf570=function(_0x4e26b8,_0x1a3c12){_0x4e26b8=_0x4e26b8-0x0;var _0x10a6f0=_0x570f[_0x4e26b8];return _0x10a6f0;};'use strict';var Sequelize=require(_0xf570('0x0'));module[_0xf570('0x1')]={'name':{'type':Sequelize[_0xf570('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0xf570('0x3')]},'description':{'type':Sequelize[_0xf570('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 10a0ecc..6875a26 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 _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x5e9d2a,_0x3c8d45){var _0x4920f3=function(_0x41e7c5){while(--_0x41e7c5){_0x5e9d2a['push'](_0x5e9d2a['shift']());}};_0x4920f3(++_0x3c8d45);}(_0x5fc3,0xa8));var _0x35fc=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x5fc3[_0x377a6e];return _0x37f751;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));}; \ No newline at end of file +var _0x81bd=['filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','AnalyticMetric','includeAll','include','findAll','rows','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','error','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','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Metrics','stack','name','send','index','map','fieldName','query','keys'];(function(_0x43d753,_0x3f297d){var _0x1958e9=function(_0xb48c3b){while(--_0xb48c3b){_0x43d753['push'](_0x43d753['shift']());}};_0x1958e9(++_0x3f297d);}(_0x81bd,0x7c));var _0xd81b=function(_0x5617e2,_0x1ffcd7){_0x5617e2=_0x5617e2-0x0;var _0x27b60d=_0x81bd[_0x5617e2];return _0x27b60d;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21dfff,_0x57f71d){_0x57f71d=_0x57f71d||0xcc;return function(_0x3f2405){if(_0x3f2405){return _0x21dfff[_0xd81b('0x1b')](_0x57f71d);}return _0x21dfff['status'](_0x57f71d)[_0xd81b('0x1c')]();};}function respondWithResult(_0x47dd04,_0x13dd00){_0x13dd00=_0x13dd00||0xc8;return function(_0x41bf7a){if(_0x41bf7a){return _0x47dd04[_0xd81b('0x1d')](_0x13dd00)[_0xd81b('0x1e')](_0x41bf7a);}};}function respondWithFilteredResult(_0x128162,_0x552215){return function(_0x1c620d){if(_0x1c620d){var _0x27b7a0=typeof _0x552215['offset']===_0xd81b('0x1f')&&typeof _0x552215[_0xd81b('0x20')]===_0xd81b('0x1f');var _0x15e860=_0x1c620d[_0xd81b('0x21')];var _0xc49b8d=_0x27b7a0?0x0:_0x552215[_0xd81b('0x22')];var _0x3d4d34=_0x27b7a0?_0x1c620d[_0xd81b('0x21')]:_0x552215[_0xd81b('0x22')]+_0x552215[_0xd81b('0x20')];var _0x453952;if(_0x3d4d34>=_0x15e860){_0x3d4d34=_0x15e860;_0x453952=0xc8;}else{_0x453952=0xce;}_0x128162[_0xd81b('0x1d')](_0x453952);return _0x128162[_0xd81b('0x23')](_0xd81b('0x24'),_0xc49b8d+'-'+_0x3d4d34+'/'+_0x15e860)[_0xd81b('0x1e')](_0x1c620d);}return null;};}function patchUpdates(_0x5f101a){return function(_0x4d566e){try{jsonpatch[_0xd81b('0x25')](_0x4d566e,_0x5f101a,!![]);}catch(_0x1b7876){return BPromise[_0xd81b('0x26')](_0x1b7876);}return _0x4d566e['save']();};}function saveUpdates(_0x19ed0e,_0x6571a6){return function(_0x542ee2){if(_0x542ee2){return _0x542ee2[_0xd81b('0x27')](_0x19ed0e)[_0xd81b('0x28')](function(_0x1670cd){return _0x1670cd;});}return null;};}function removeEntity(_0x1ad65c,_0x279176){return function(_0xcb4f91){if(_0xcb4f91){return _0xcb4f91[_0xd81b('0x29')]()[_0xd81b('0x28')](function(){var _0x341aec=_0xcb4f91[_0xd81b('0x2a')]({'plain':!![]});var _0x2ccedf=_0xd81b('0x2b');return db['UserProfileResource'][_0xd81b('0x29')]({'where':{'type':_0x2ccedf,'resourceId':_0x341aec['id']}})[_0xd81b('0x28')](function(){return _0xcb4f91;});})[_0xd81b('0x28')](function(){_0x1ad65c[_0xd81b('0x1d')](0xcc)[_0xd81b('0x1c')]();});}};}function handleEntityNotFound(_0x2d0d02,_0x3e28dd){return function(_0x73dc09){if(!_0x73dc09){_0x2d0d02[_0xd81b('0x1b')](0x194);}return _0x73dc09;};}function handleError(_0x483a3d,_0x469cc4){_0x469cc4=_0x469cc4||0x1f4;return function(_0x4e2eff){logger['error'](_0x4e2eff[_0xd81b('0x2c')]);if(_0x4e2eff[_0xd81b('0x2d')]){delete _0x4e2eff['name'];}_0x483a3d['status'](_0x469cc4)[_0xd81b('0x2e')](_0x4e2eff);};}exports[_0xd81b('0x2f')]=function(_0x1b1434,_0x289f54){var _0x1a1572={},_0x4654ba={},_0x5527ed={'count':0x0,'rows':[]};var _0x37d381=_[_0xd81b('0x30')](db['AnalyticMetric']['rawAttributes'],function(_0x165892){return{'name':_0x165892[_0xd81b('0x31')],'type':_0x165892['type']['key']};});_0x4654ba['model']=_[_0xd81b('0x30')](_0x37d381,_0xd81b('0x2d'));_0x4654ba[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x1b1434[_0xd81b('0x32')]);_0x4654ba[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x4654ba['model'],_0x4654ba[_0xd81b('0x32')]);_0x1a1572['attributes']=_[_0xd81b('0x35')](_0x4654ba[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x37')]));_0x1a1572[_0xd81b('0x38')]=_0x1a1572[_0xd81b('0x38')][_0xd81b('0x39')]?_0x1a1572[_0xd81b('0x38')]:_0x4654ba[_0xd81b('0x36')];if(!_0x1b1434[_0xd81b('0x32')][_0xd81b('0x3a')](_0xd81b('0x3b'))){_0x1a1572['limit']=qs['limit'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x20')]);_0x1a1572[_0xd81b('0x22')]=qs['offset'](_0x1b1434[_0xd81b('0x32')][_0xd81b('0x22')]);}_0x1a1572['order']=qs[_0xd81b('0x3c')](_0x1b1434[_0xd81b('0x32')]['sort']);_0x1a1572[_0xd81b('0x3d')]=qs['filters'](_[_0xd81b('0x3e')](_0x1b1434[_0xd81b('0x32')],_0x4654ba[_0xd81b('0x34')]),_0x37d381);if(_0x1b1434[_0xd81b('0x32')]['filter']){_0x1a1572[_0xd81b('0x3d')]=_[_0xd81b('0x3f')](_0x1a1572[_0xd81b('0x3d')],{'$or':_[_0xd81b('0x30')](_0x37d381,function(_0x3abd60){if(_0x3abd60[_0xd81b('0x40')]!==_0xd81b('0x41')){var _0x532ada={};_0x532ada[_0x3abd60[_0xd81b('0x2d')]]={'$like':'%'+_0x1b1434[_0xd81b('0x32')][_0xd81b('0x42')]+'%'};return _0x532ada;}})});}_0x1a1572=_['merge']({},_0x1a1572,_0x1b1434[_0xd81b('0x43')]);var _0x3a05f4={'where':_0x1a1572[_0xd81b('0x3d')]};return db[_0xd81b('0x44')][_0xd81b('0x21')](_0x3a05f4)['then'](function(_0x3dfba7){_0x5527ed[_0xd81b('0x21')]=_0x3dfba7;if(_0x1b1434[_0xd81b('0x32')][_0xd81b('0x45')]){_0x1a1572[_0xd81b('0x46')]=[{'all':!![]}];}return db[_0xd81b('0x44')][_0xd81b('0x47')](_0x1a1572);})[_0xd81b('0x28')](function(_0x4405a8){_0x5527ed[_0xd81b('0x48')]=_0x4405a8;return _0x5527ed;})[_0xd81b('0x28')](respondWithFilteredResult(_0x289f54,_0x1a1572))['catch'](handleError(_0x289f54,null));};exports[_0xd81b('0x49')]=function(_0x2778b3,_0x25824e){var _0xa5e391={'raw':!![],'where':{'id':_0x2778b3[_0xd81b('0x4a')]['id']}},_0x1e6654={};_0x1e6654[_0xd81b('0x36')]=_[_0xd81b('0x33')](db['AnalyticMetric']['rawAttributes']);_0x1e6654[_0xd81b('0x32')]=_[_0xd81b('0x33')](_0x2778b3[_0xd81b('0x32')]);_0x1e6654[_0xd81b('0x34')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],_0x1e6654[_0xd81b('0x32')]);_0xa5e391[_0xd81b('0x38')]=_[_0xd81b('0x35')](_0x1e6654[_0xd81b('0x36')],qs[_0xd81b('0x37')](_0x2778b3[_0xd81b('0x32')]['fields']));_0xa5e391[_0xd81b('0x38')]=_0xa5e391[_0xd81b('0x38')][_0xd81b('0x39')]?_0xa5e391[_0xd81b('0x38')]:_0x1e6654[_0xd81b('0x36')];if(_0x2778b3[_0xd81b('0x32')][_0xd81b('0x45')]){_0xa5e391[_0xd81b('0x46')]=[{'all':!![]}];}_0xa5e391=_[_0xd81b('0x3f')]({},_0xa5e391,_0x2778b3['options']);return db[_0xd81b('0x44')][_0xd81b('0x4b')](_0xa5e391)[_0xd81b('0x28')](handleEntityNotFound(_0x25824e,null))[_0xd81b('0x28')](respondWithResult(_0x25824e,null))['catch'](handleError(_0x25824e,null));};exports[_0xd81b('0x4c')]=function(_0x151127,_0x15030b){return db[_0xd81b('0x44')][_0xd81b('0x4c')](_0x151127[_0xd81b('0x4d')],{})[_0xd81b('0x28')](function(_0x43d7ce){var _0x133a76=_0x151127['user']['get']({'plain':!![]});if(!_0x133a76)throw new Error(_0xd81b('0x4e'));if(_0x133a76[_0xd81b('0x4f')]===_0xd81b('0x50')){var _0x4da281=_0x43d7ce[_0xd81b('0x2a')]({'plain':!![]});var _0x3d6ab3=_0xd81b('0x2b');return db[_0xd81b('0x51')]['find']({'where':{'name':_0x3d6ab3,'userProfileId':_0x133a76[_0xd81b('0x52')]},'raw':!![]})[_0xd81b('0x28')](function(_0x1b523c){if(_0x1b523c&&_0x1b523c[_0xd81b('0x53')]===0x0){return db[_0xd81b('0x54')]['create']({'name':_0x4da281[_0xd81b('0x2d')],'resourceId':_0x4da281['id'],'type':_0x1b523c[_0xd81b('0x2d')],'sectionId':_0x1b523c['id']},{})['then'](function(){return _0x43d7ce;});}else{return _0x43d7ce;}})[_0xd81b('0x55')](function(_0x315bd5){logger[_0xd81b('0x56')](_0xd81b('0x57'),_0x315bd5);throw _0x315bd5;});}return _0x43d7ce;})[_0xd81b('0x28')](respondWithResult(_0x15030b,0xc9))[_0xd81b('0x55')](handleError(_0x15030b,null));};exports[_0xd81b('0x27')]=function(_0x22f588,_0x3ed626){if(_0x22f588[_0xd81b('0x4d')]['id']){delete _0x22f588[_0xd81b('0x4d')]['id'];}return db['AnalyticMetric'][_0xd81b('0x4b')]({'where':{'id':_0x22f588['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x3ed626,null))[_0xd81b('0x28')](saveUpdates(_0x22f588[_0xd81b('0x4d')],null))[_0xd81b('0x28')](respondWithResult(_0x3ed626,null))[_0xd81b('0x55')](handleError(_0x3ed626,null));};exports[_0xd81b('0x29')]=function(_0x5c196a,_0x2d978d){return db[_0xd81b('0x44')]['find']({'where':{'id':_0x5c196a['params']['id']}})[_0xd81b('0x28')](handleEntityNotFound(_0x2d978d,null))['then'](removeEntity(_0x2d978d,null))[_0xd81b('0x55')](handleError(_0x2d978d,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 6ea7f10..0dd4a20 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 _0x0f9f=['rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xdd0f2c,_0x47d12a){var _0xeeba3=function(_0x34468a){while(--_0x34468a){_0xdd0f2c['push'](_0xdd0f2c['shift']());}};_0xeeba3(++_0x47d12a);}(_0x0f9f,0xae));var _0xf0f9=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x0f9f[_0x3df871];return _0x570f7b;};'use strict';var _=require(_0xf0f9('0x0'));var util=require(_0xf0f9('0x1'));var logger=require(_0xf0f9('0x2'))(_0xf0f9('0x3'));var moment=require(_0xf0f9('0x4'));var BPromise=require(_0xf0f9('0x5'));var rp=require(_0xf0f9('0x6'));var fs=require('fs');var path=require(_0xf0f9('0x7'));var rimraf=require(_0xf0f9('0x8'));var config=require(_0xf0f9('0x9'));var attributes=require(_0xf0f9('0xa'));module['exports']=function(_0xcc39d6,_0x4540a2){return _0xcc39d6['define'](_0xf0f9('0xb'),attributes,{'tableName':_0xf0f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbcba=['util','api','moment','bluebird','request-promise','path','rimraf','exports','AnalyticMetric','analytics_metrics','lodash'];(function(_0x5b0c7d,_0x4ad3e2){var _0x42aab8=function(_0x5dce29){while(--_0x5dce29){_0x5b0c7d['push'](_0x5b0c7d['shift']());}};_0x42aab8(++_0x4ad3e2);}(_0xbcba,0x6d));var _0xabcb=function(_0x331f71,_0x5a0cf8){_0x331f71=_0x331f71-0x0;var _0x43e0f5=_0xbcba[_0x331f71];return _0x43e0f5;};'use strict';var _=require(_0xabcb('0x0'));var util=require(_0xabcb('0x1'));var logger=require('../../config/logger')(_0xabcb('0x2'));var moment=require(_0xabcb('0x3'));var BPromise=require(_0xabcb('0x4'));var rp=require(_0xabcb('0x5'));var fs=require('fs');var path=require(_0xabcb('0x6'));var rimraf=require(_0xabcb('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xabcb('0x8')]=function(_0x1290b2,_0x5c706e){return _0x1290b2['define'](_0xabcb('0x9'),attributes,{'tableName':_0xabcb('0xa'),'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 5809d67..aa588b7 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 _0x9bf1=['request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x2d8390,_0x224bb8){var _0x560b66=function(_0x4a9407){while(--_0x4a9407){_0x2d8390['push'](_0x2d8390['shift']());}};_0x560b66(++_0x224bb8);}(_0x9bf1,0x180));var _0x19bf=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x9bf1[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x19bf('0x0'));var util=require('util');var moment=require(_0x19bf('0x1'));var BPromise=require(_0x19bf('0x2'));var rs=require(_0x19bf('0x3'));var fs=require('fs');var Redis=require(_0x19bf('0x4'));var db=require(_0x19bf('0x5'))['db'];var utils=require(_0x19bf('0x6'));var logger=require(_0x19bf('0x7'))(_0x19bf('0x8'));var config=require('../../config/environment');var jayson=require(_0x19bf('0x9'));var client=jayson[_0x19bf('0xa')][_0x19bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346d51,_0x1a6a39,_0x4f497f){return new BPromise(function(_0x559088,_0x5ac498){return client[_0x19bf('0xc')](_0x346d51,_0x4f497f)[_0x19bf('0xd')](function(_0x307242){logger[_0x19bf('0xe')](_0x19bf('0xf'),_0x1a6a39,_0x19bf('0x10'));logger[_0x19bf('0x11')](_0x19bf('0x12'),_0x1a6a39,_0x19bf('0x10'),JSON[_0x19bf('0x13')](_0x307242));if(_0x307242[_0x19bf('0x14')]){if(_0x307242[_0x19bf('0x14')][_0x19bf('0x15')]===0x1f4){logger[_0x19bf('0x14')](_0x19bf('0xf'),_0x1a6a39,_0x307242['error'][_0x19bf('0x16')]);return _0x5ac498(_0x307242[_0x19bf('0x14')][_0x19bf('0x16')]);}logger['error'](_0x19bf('0xf'),_0x1a6a39,_0x307242[_0x19bf('0x14')]['message']);return _0x559088(_0x307242[_0x19bf('0x14')][_0x19bf('0x16')]);}else{logger['info'](_0x19bf('0xf'),_0x1a6a39,_0x19bf('0x10'));_0x559088(_0x307242[_0x19bf('0x17')][_0x19bf('0x16')]);}})[_0x19bf('0x18')](function(_0x377727){logger[_0x19bf('0x14')]('AnalyticMetric,\x20%s,\x20%s',_0x1a6a39,_0x377727);_0x5ac498(_0x377727);});});} \ No newline at end of file +var _0x5e24=['code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x568363,_0x2e79a7){var _0x47f0ed=function(_0x7d922b){while(--_0x7d922b){_0x568363['push'](_0x568363['shift']());}};_0x47f0ed(++_0x2e79a7);}(_0x5e24,0x1bd));var _0x45e2=function(_0x47fc6c,_0x2455ce){_0x47fc6c=_0x47fc6c-0x0;var _0x1ec6e6=_0x5e24[_0x47fc6c];return _0x1ec6e6;};'use strict';var _=require(_0x45e2('0x0'));var util=require('util');var moment=require(_0x45e2('0x1'));var BPromise=require(_0x45e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45e2('0x3'));var db=require(_0x45e2('0x4'))['db'];var utils=require(_0x45e2('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x45e2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x45e2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16fa93,_0x4d63a5,_0x3873da){return new BPromise(function(_0x143f14,_0x3cf3f8){return client['request'](_0x16fa93,_0x3873da)['then'](function(_0x10ea43){logger[_0x45e2('0x8')](_0x45e2('0x9'),_0x4d63a5,_0x45e2('0xa'));logger[_0x45e2('0xb')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x4d63a5,_0x45e2('0xa'),JSON[_0x45e2('0xc')](_0x10ea43));if(_0x10ea43[_0x45e2('0xd')]){if(_0x10ea43[_0x45e2('0xd')][_0x45e2('0xe')]===0x1f4){logger[_0x45e2('0xd')](_0x45e2('0x9'),_0x4d63a5,_0x10ea43['error'][_0x45e2('0xf')]);return _0x3cf3f8(_0x10ea43[_0x45e2('0xd')][_0x45e2('0xf')]);}logger[_0x45e2('0xd')](_0x45e2('0x9'),_0x4d63a5,_0x10ea43['error'][_0x45e2('0xf')]);return _0x143f14(_0x10ea43['error'][_0x45e2('0xf')]);}else{logger[_0x45e2('0x8')]('AnalyticMetric,\x20%s,\x20%s',_0x4d63a5,_0x45e2('0xa'));_0x143f14(_0x10ea43['result'][_0x45e2('0xf')]);}})[_0x45e2('0x10')](function(_0x1109c3){logger['error'](_0x45e2('0x9'),_0x4d63a5,_0x1109c3);_0x3cf3f8(_0x1109c3);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 42e4828..b324b1d 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 _0x207c=['fs-extra','../../components/auth/service','../../config/environment','index','get','/:id','show','post','isAuthenticated','put','update','delete','util','path','connect-timeout','express','Router'];(function(_0x29f80e,_0x9027ff){var _0x5c7eaa=function(_0x48ec7c){while(--_0x48ec7c){_0x29f80e['push'](_0x29f80e['shift']());}};_0x5c7eaa(++_0x9027ff);}(_0x207c,0x1e8));var _0xc207=function(_0x62c646,_0xa08641){_0x62c646=_0x62c646-0x0;var _0x2385f3=_0x207c[_0x62c646];return _0x2385f3;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./analyticMetric.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xc207('0x8')]);router[_0xc207('0x9')](_0xc207('0xa'),auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')]('/',auth[_0xc207('0xd')](),controller['create']);router[_0xc207('0xe')](_0xc207('0xa'),auth[_0xc207('0xd')](),controller[_0xc207('0xf')]);router[_0xc207('0x10')](_0xc207('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x34aa=['index','/:id','show','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated'];(function(_0x402b19,_0x224241){var _0x13da47=function(_0x34cb5b){while(--_0x34cb5b){_0x402b19['push'](_0x402b19['shift']());}};_0x13da47(++_0x224241);}(_0x34aa,0x171));var _0xa34a=function(_0xa45395,_0x5579e6){_0xa45395=_0xa45395-0x0;var _0x3c83d2=_0x34aa[_0xa45395];return _0x3c83d2;};'use strict';var multer=require(_0xa34a('0x0'));var util=require('util');var path=require(_0xa34a('0x1'));var timeout=require(_0xa34a('0x2'));var express=require(_0xa34a('0x3'));var router=express[_0xa34a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xa34a('0x5'));var interaction=require(_0xa34a('0x6'));var config=require(_0xa34a('0x7'));var controller=require(_0xa34a('0x8'));router[_0xa34a('0x9')]('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xb')]);router[_0xa34a('0x9')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0xd')]);router['post']('/',auth[_0xa34a('0xa')](),controller[_0xa34a('0xe')]);router[_0xa34a('0xf')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller['update']);router[_0xa34a('0x10')](_0xa34a('0xc'),auth[_0xa34a('0xa')](),controller[_0xa34a('0x11')]);module[_0xa34a('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 66a7dbf..f65b0da 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 _0xd2b4=['TEXT','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd2b4,0xd0));var _0x4d2b=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xd2b4[_0x352e09];return _0x1b7094;};'use strict';var Sequelize=require(_0x4d2b('0x0'));module[_0x4d2b('0x1')]={'tree':{'type':Sequelize[_0x4d2b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x8cd9=['sequelize','exports','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cd9,0x186));var _0x98cd=function(_0x4daadc,_0x52e09b){_0x4daadc=_0x4daadc-0x0;var _0x191b4d=_0x8cd9[_0x4daadc];return _0x191b4d;};'use strict';var Sequelize=require(_0x98cd('0x0'));module[_0x98cd('0x1')]={'tree':{'type':Sequelize[_0x98cd('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 aaf3064..84700f1 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 _0x1123=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','update','then','destroy','error','name','send','map','AnalyticTreeReport','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x58dce1,_0x7f97c6){var _0x57c006=function(_0x311b1a){while(--_0x311b1a){_0x58dce1['push'](_0x58dce1['shift']());}};_0x57c006(++_0x7f97c6);}(_0x1123,0x78));var _0x3112=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1123[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x3112('0x0'));var rimraf=require(_0x3112('0x1'));var zipdir=require(_0x3112('0x2'));var jsonpatch=require(_0x3112('0x3'));var rp=require(_0x3112('0x4'));var moment=require(_0x3112('0x5'));var BPromise=require(_0x3112('0x6'));var Mustache=require(_0x3112('0x7'));var util=require(_0x3112('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x3112('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3112('0xa'));var squel=require('squel');var crypto=require(_0x3112('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3112('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3112('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3112('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3112('0xf'));var hardwareService=require(_0x3112('0x10'));var logger=require(_0x3112('0x11'))(_0x3112('0x12'));var utils=require(_0x3112('0x13'));var config=require(_0x3112('0x14'));var licenseUtil=require(_0x3112('0x15'));var db=require(_0x3112('0x16'))['db'];function respondWithStatusCode(_0x46c4b1,_0x29725d){_0x29725d=_0x29725d||0xcc;return function(_0x2e9562){if(_0x2e9562){return _0x46c4b1[_0x3112('0x17')](_0x29725d);}return _0x46c4b1[_0x3112('0x18')](_0x29725d)[_0x3112('0x19')]();};}function respondWithResult(_0x377c52,_0x390258){_0x390258=_0x390258||0xc8;return function(_0x58ed2b){if(_0x58ed2b){return _0x377c52[_0x3112('0x18')](_0x390258)[_0x3112('0x1a')](_0x58ed2b);}};}function respondWithFilteredResult(_0x1d56f8,_0x4c8e3e){return function(_0xfb3240){if(_0xfb3240){var _0x36a7eb=typeof _0x4c8e3e[_0x3112('0x1b')]==='undefined'&&typeof _0x4c8e3e[_0x3112('0x1c')]===_0x3112('0x1d');var _0x4a9b94=_0xfb3240['count'];var _0x3a99c3=_0x36a7eb?0x0:_0x4c8e3e['offset'];var _0x56123b=_0x36a7eb?_0xfb3240[_0x3112('0x1e')]:_0x4c8e3e[_0x3112('0x1b')]+_0x4c8e3e[_0x3112('0x1c')];var _0x2dd0e6;if(_0x56123b>=_0x4a9b94){_0x56123b=_0x4a9b94;_0x2dd0e6=0xc8;}else{_0x2dd0e6=0xce;}_0x1d56f8['status'](_0x2dd0e6);return _0x1d56f8['set']('Content-Range',_0x3a99c3+'-'+_0x56123b+'/'+_0x4a9b94)[_0x3112('0x1a')](_0xfb3240);}return null;};}function patchUpdates(_0xe393b2){return function(_0x594a8c){try{jsonpatch[_0x3112('0x1f')](_0x594a8c,_0xe393b2,!![]);}catch(_0x592890){return BPromise[_0x3112('0x20')](_0x592890);}return _0x594a8c['save']();};}function saveUpdates(_0x52aa2c,_0x4824a8){return function(_0x31ff92){if(_0x31ff92){return _0x31ff92[_0x3112('0x21')](_0x52aa2c)[_0x3112('0x22')](function(_0xcf4f4e){return _0xcf4f4e;});}return null;};}function removeEntity(_0x49270e,_0x56df41){return function(_0x583b8d){if(_0x583b8d){return _0x583b8d[_0x3112('0x23')]()[_0x3112('0x22')](function(){_0x49270e[_0x3112('0x18')](0xcc)[_0x3112('0x19')]();});}};}function handleEntityNotFound(_0x225f40,_0x20429f){return function(_0x3734a6){if(!_0x3734a6){_0x225f40[_0x3112('0x17')](0x194);}return _0x3734a6;};}function handleError(_0x4ae26d,_0x39300c){_0x39300c=_0x39300c||0x1f4;return function(_0x267bf1){logger[_0x3112('0x24')](_0x267bf1['stack']);if(_0x267bf1[_0x3112('0x25')]){delete _0x267bf1[_0x3112('0x25')];}_0x4ae26d[_0x3112('0x18')](_0x39300c)[_0x3112('0x26')](_0x267bf1);};}exports['index']=function(_0x4e4212,_0x5f3f43){var _0x2e5b62={},_0x439c50={},_0x505035={'count':0x0,'rows':[]};var _0x16ea4f=_[_0x3112('0x27')](db[_0x3112('0x28')]['rawAttributes'],function(_0x2d7df3){return{'name':_0x2d7df3[_0x3112('0x29')],'type':_0x2d7df3['type'][_0x3112('0x2a')]};});_0x439c50[_0x3112('0x2b')]=_['map'](_0x16ea4f,'name');_0x439c50[_0x3112('0x2c')]=_['keys'](_0x4e4212['query']);_0x439c50[_0x3112('0x2d')]=_[_0x3112('0x2e')](_0x439c50[_0x3112('0x2b')],_0x439c50[_0x3112('0x2c')]);_0x2e5b62[_0x3112('0x2f')]=_[_0x3112('0x2e')](_0x439c50['model'],qs[_0x3112('0x30')](_0x4e4212[_0x3112('0x2c')][_0x3112('0x30')]));_0x2e5b62['attributes']=_0x2e5b62[_0x3112('0x2f')]['length']?_0x2e5b62[_0x3112('0x2f')]:_0x439c50[_0x3112('0x2b')];if(!_0x4e4212[_0x3112('0x2c')]['hasOwnProperty'](_0x3112('0x31'))){_0x2e5b62[_0x3112('0x1c')]=qs[_0x3112('0x1c')](_0x4e4212[_0x3112('0x2c')][_0x3112('0x1c')]);_0x2e5b62[_0x3112('0x1b')]=qs[_0x3112('0x1b')](_0x4e4212[_0x3112('0x2c')][_0x3112('0x1b')]);}_0x2e5b62[_0x3112('0x32')]=qs[_0x3112('0x33')](_0x4e4212['query'][_0x3112('0x33')]);_0x2e5b62['where']=qs[_0x3112('0x2d')](_['pick'](_0x4e4212[_0x3112('0x2c')],_0x439c50[_0x3112('0x2d')]),_0x16ea4f);if(_0x4e4212[_0x3112('0x2c')][_0x3112('0x34')]){_0x2e5b62[_0x3112('0x35')]=_['merge'](_0x2e5b62['where'],{'$or':_[_0x3112('0x27')](_0x16ea4f,function(_0x1aea4f){if(_0x1aea4f['type']!==_0x3112('0x36')){var _0x18d2a2={};_0x18d2a2[_0x1aea4f[_0x3112('0x25')]]={'$like':'%'+_0x4e4212['query'][_0x3112('0x34')]+'%'};return _0x18d2a2;}})});}_0x2e5b62=_[_0x3112('0x37')]({},_0x2e5b62,_0x4e4212[_0x3112('0x38')]);var _0x51aedb={'where':_0x2e5b62['where']};return db['AnalyticTreeReport']['count'](_0x51aedb)[_0x3112('0x22')](function(_0x1ceaf1){_0x505035[_0x3112('0x1e')]=_0x1ceaf1;if(_0x4e4212[_0x3112('0x2c')][_0x3112('0x39')]){_0x2e5b62[_0x3112('0x3a')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3112('0x3b')](_0x2e5b62);})[_0x3112('0x22')](function(_0x28620d){_0x505035[_0x3112('0x3c')]=_0x28620d;return _0x505035;})[_0x3112('0x22')](respondWithFilteredResult(_0x5f3f43,_0x2e5b62))[_0x3112('0x3d')](handleError(_0x5f3f43,null));};exports['show']=function(_0x3aa853,_0x32f848){var _0x216570={'raw':!![],'where':{'id':_0x3aa853[_0x3112('0x3e')]['id']}},_0x4d4b33={};_0x4d4b33['model']=_[_0x3112('0x3f')](db[_0x3112('0x28')][_0x3112('0x40')]);_0x4d4b33[_0x3112('0x2c')]=_[_0x3112('0x3f')](_0x3aa853[_0x3112('0x2c')]);_0x4d4b33[_0x3112('0x2d')]=_[_0x3112('0x2e')](_0x4d4b33[_0x3112('0x2b')],_0x4d4b33['query']);_0x216570[_0x3112('0x2f')]=_['intersection'](_0x4d4b33[_0x3112('0x2b')],qs[_0x3112('0x30')](_0x3aa853['query'][_0x3112('0x30')]));_0x216570[_0x3112('0x2f')]=_0x216570[_0x3112('0x2f')]['length']?_0x216570[_0x3112('0x2f')]:_0x4d4b33['model'];if(_0x3aa853['query'][_0x3112('0x39')]){_0x216570[_0x3112('0x3a')]=[{'all':!![]}];}_0x216570=_[_0x3112('0x37')]({},_0x216570,_0x3aa853['options']);return db[_0x3112('0x28')][_0x3112('0x41')](_0x216570)[_0x3112('0x22')](handleEntityNotFound(_0x32f848,null))['then'](respondWithResult(_0x32f848,null))[_0x3112('0x3d')](handleError(_0x32f848,null));};exports['create']=function(_0x36e1ec,_0xb8e513){return db[_0x3112('0x28')][_0x3112('0x42')](_0x36e1ec['body'],{})[_0x3112('0x22')](respondWithResult(_0xb8e513,0xc9))[_0x3112('0x3d')](handleError(_0xb8e513,null));};exports[_0x3112('0x21')]=function(_0x1a3e3c,_0x4aed3c){if(_0x1a3e3c[_0x3112('0x43')]['id']){delete _0x1a3e3c[_0x3112('0x43')]['id'];}return db[_0x3112('0x28')][_0x3112('0x41')]({'where':{'id':_0x1a3e3c['params']['id']}})['then'](handleEntityNotFound(_0x4aed3c,null))[_0x3112('0x22')](saveUpdates(_0x1a3e3c[_0x3112('0x43')],null))[_0x3112('0x22')](respondWithResult(_0x4aed3c,null))['catch'](handleError(_0x4aed3c,null));};exports[_0x3112('0x23')]=function(_0x338337,_0x52aae5){return db['AnalyticTreeReport'][_0x3112('0x41')]({'where':{'id':_0x338337[_0x3112('0x3e')]['id']}})['then'](handleEntityNotFound(_0x52aae5,null))[_0x3112('0x22')](removeEntity(_0x52aae5,null))[_0x3112('0x3d')](handleError(_0x52aae5,null));}; \ No newline at end of file +var _0x8bc4=['crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','AnalyticTreeReport','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1e9612,_0x5ce781){var _0x3f5f24=function(_0x1de34d){while(--_0x1de34d){_0x1e9612['push'](_0x1e9612['shift']());}};_0x3f5f24(++_0x5ce781);}(_0x8bc4,0xd7));var _0x48bc=function(_0x48791f,_0x1f44eb){_0x48791f=_0x48791f-0x0;var _0x249d1c=_0x8bc4[_0x48791f];return _0x249d1c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48bc('0x0'));var zipdir=require(_0x48bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x48bc('0x2'));var moment=require(_0x48bc('0x3'));var BPromise=require(_0x48bc('0x4'));var Mustache=require(_0x48bc('0x5'));var util=require('util');var path=require(_0x48bc('0x6'));var sox=require(_0x48bc('0x7'));var csv=require(_0x48bc('0x8'));var ejs=require(_0x48bc('0x9'));var fs=require('fs');var fs_extra=require(_0x48bc('0xa'));var _=require(_0x48bc('0xb'));var squel=require(_0x48bc('0xc'));var crypto=require(_0x48bc('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x48bc('0x8'));var querystring=require(_0x48bc('0xe'));var Papa=require('papaparse');var Redis=require(_0x48bc('0xf'));var authService=require(_0x48bc('0x10'));var qs=require(_0x48bc('0x11'));var as=require(_0x48bc('0x12'));var hardwareService=require(_0x48bc('0x13'));var logger=require(_0x48bc('0x14'))(_0x48bc('0x15'));var utils=require(_0x48bc('0x16'));var config=require(_0x48bc('0x17'));var licenseUtil=require(_0x48bc('0x18'));var db=require(_0x48bc('0x19'))['db'];function respondWithStatusCode(_0x327b90,_0xf7e5f){_0xf7e5f=_0xf7e5f||0xcc;return function(_0x53170e){if(_0x53170e){return _0x327b90[_0x48bc('0x1a')](_0xf7e5f);}return _0x327b90[_0x48bc('0x1b')](_0xf7e5f)[_0x48bc('0x1c')]();};}function respondWithResult(_0x3bec05,_0x11b2a6){_0x11b2a6=_0x11b2a6||0xc8;return function(_0x8ca33b){if(_0x8ca33b){return _0x3bec05['status'](_0x11b2a6)[_0x48bc('0x1d')](_0x8ca33b);}};}function respondWithFilteredResult(_0xca3e1e,_0x59f4f0){return function(_0x38eae7){if(_0x38eae7){var _0x52bcc3=typeof _0x59f4f0['offset']==='undefined'&&typeof _0x59f4f0[_0x48bc('0x1e')]===_0x48bc('0x1f');var _0x2aefb1=_0x38eae7[_0x48bc('0x20')];var _0x2a106b=_0x52bcc3?0x0:_0x59f4f0['offset'];var _0x2cd87a=_0x52bcc3?_0x38eae7[_0x48bc('0x20')]:_0x59f4f0[_0x48bc('0x21')]+_0x59f4f0['limit'];var _0x2366cd;if(_0x2cd87a>=_0x2aefb1){_0x2cd87a=_0x2aefb1;_0x2366cd=0xc8;}else{_0x2366cd=0xce;}_0xca3e1e['status'](_0x2366cd);return _0xca3e1e[_0x48bc('0x22')](_0x48bc('0x23'),_0x2a106b+'-'+_0x2cd87a+'/'+_0x2aefb1)[_0x48bc('0x1d')](_0x38eae7);}return null;};}function patchUpdates(_0x509ebb){return function(_0x303b05){try{jsonpatch[_0x48bc('0x24')](_0x303b05,_0x509ebb,!![]);}catch(_0x5b5e07){return BPromise[_0x48bc('0x25')](_0x5b5e07);}return _0x303b05[_0x48bc('0x26')]();};}function saveUpdates(_0x28d91f,_0x4b566e){return function(_0x1cc73c){if(_0x1cc73c){return _0x1cc73c[_0x48bc('0x27')](_0x28d91f)[_0x48bc('0x28')](function(_0x4a5d81){return _0x4a5d81;});}return null;};}function removeEntity(_0x536a06,_0x4d31b9){return function(_0x93572f){if(_0x93572f){return _0x93572f[_0x48bc('0x29')]()['then'](function(){_0x536a06['status'](0xcc)[_0x48bc('0x1c')]();});}};}function handleEntityNotFound(_0x538971,_0x490264){return function(_0x392950){if(!_0x392950){_0x538971[_0x48bc('0x1a')](0x194);}return _0x392950;};}function handleError(_0x57ec83,_0x4a53ed){_0x4a53ed=_0x4a53ed||0x1f4;return function(_0x4c0cbf){logger[_0x48bc('0x2a')](_0x4c0cbf['stack']);if(_0x4c0cbf[_0x48bc('0x2b')]){delete _0x4c0cbf[_0x48bc('0x2b')];}_0x57ec83['status'](_0x4a53ed)['send'](_0x4c0cbf);};}exports[_0x48bc('0x2c')]=function(_0x5df323,_0x5e923b){var _0x52beb5={},_0x299945={},_0x38cdca={'count':0x0,'rows':[]};var _0x1d695e=_[_0x48bc('0x2d')](db[_0x48bc('0x2e')]['rawAttributes'],function(_0x1473e9){return{'name':_0x1473e9[_0x48bc('0x2f')],'type':_0x1473e9['type']['key']};});_0x299945['model']=_['map'](_0x1d695e,_0x48bc('0x2b'));_0x299945[_0x48bc('0x30')]=_[_0x48bc('0x31')](_0x5df323['query']);_0x299945[_0x48bc('0x32')]=_[_0x48bc('0x33')](_0x299945['model'],_0x299945[_0x48bc('0x30')]);_0x52beb5[_0x48bc('0x34')]=_[_0x48bc('0x33')](_0x299945[_0x48bc('0x35')],qs[_0x48bc('0x36')](_0x5df323[_0x48bc('0x30')]['fields']));_0x52beb5[_0x48bc('0x34')]=_0x52beb5[_0x48bc('0x34')][_0x48bc('0x37')]?_0x52beb5[_0x48bc('0x34')]:_0x299945[_0x48bc('0x35')];if(!_0x5df323[_0x48bc('0x30')][_0x48bc('0x38')](_0x48bc('0x39'))){_0x52beb5['limit']=qs[_0x48bc('0x1e')](_0x5df323['query'][_0x48bc('0x1e')]);_0x52beb5[_0x48bc('0x21')]=qs['offset'](_0x5df323['query'][_0x48bc('0x21')]);}_0x52beb5[_0x48bc('0x3a')]=qs[_0x48bc('0x3b')](_0x5df323[_0x48bc('0x30')][_0x48bc('0x3b')]);_0x52beb5[_0x48bc('0x3c')]=qs[_0x48bc('0x32')](_['pick'](_0x5df323[_0x48bc('0x30')],_0x299945[_0x48bc('0x32')]),_0x1d695e);if(_0x5df323[_0x48bc('0x30')]['filter']){_0x52beb5[_0x48bc('0x3c')]=_[_0x48bc('0x3d')](_0x52beb5[_0x48bc('0x3c')],{'$or':_[_0x48bc('0x2d')](_0x1d695e,function(_0x2590cf){if(_0x2590cf['type']!==_0x48bc('0x3e')){var _0x5e73bb={};_0x5e73bb[_0x2590cf[_0x48bc('0x2b')]]={'$like':'%'+_0x5df323[_0x48bc('0x30')][_0x48bc('0x3f')]+'%'};return _0x5e73bb;}})});}_0x52beb5=_[_0x48bc('0x3d')]({},_0x52beb5,_0x5df323[_0x48bc('0x40')]);var _0x28aa49={'where':_0x52beb5[_0x48bc('0x3c')]};return db[_0x48bc('0x2e')][_0x48bc('0x20')](_0x28aa49)[_0x48bc('0x28')](function(_0x48b7cc){_0x38cdca[_0x48bc('0x20')]=_0x48b7cc;if(_0x5df323['query'][_0x48bc('0x41')]){_0x52beb5[_0x48bc('0x42')]=[{'all':!![]}];}return db[_0x48bc('0x2e')][_0x48bc('0x43')](_0x52beb5);})['then'](function(_0x35f2fa){_0x38cdca[_0x48bc('0x44')]=_0x35f2fa;return _0x38cdca;})[_0x48bc('0x28')](respondWithFilteredResult(_0x5e923b,_0x52beb5))[_0x48bc('0x45')](handleError(_0x5e923b,null));};exports[_0x48bc('0x46')]=function(_0x2131a2,_0x47df06){var _0x28fde1={'raw':!![],'where':{'id':_0x2131a2[_0x48bc('0x47')]['id']}},_0x43a9b0={};_0x43a9b0['model']=_[_0x48bc('0x31')](db[_0x48bc('0x2e')][_0x48bc('0x48')]);_0x43a9b0[_0x48bc('0x30')]=_['keys'](_0x2131a2['query']);_0x43a9b0[_0x48bc('0x32')]=_[_0x48bc('0x33')](_0x43a9b0[_0x48bc('0x35')],_0x43a9b0[_0x48bc('0x30')]);_0x28fde1['attributes']=_['intersection'](_0x43a9b0[_0x48bc('0x35')],qs['fields'](_0x2131a2[_0x48bc('0x30')][_0x48bc('0x36')]));_0x28fde1['attributes']=_0x28fde1[_0x48bc('0x34')][_0x48bc('0x37')]?_0x28fde1[_0x48bc('0x34')]:_0x43a9b0[_0x48bc('0x35')];if(_0x2131a2[_0x48bc('0x30')][_0x48bc('0x41')]){_0x28fde1[_0x48bc('0x42')]=[{'all':!![]}];}_0x28fde1=_[_0x48bc('0x3d')]({},_0x28fde1,_0x2131a2[_0x48bc('0x40')]);return db[_0x48bc('0x2e')][_0x48bc('0x49')](_0x28fde1)[_0x48bc('0x28')](handleEntityNotFound(_0x47df06,null))[_0x48bc('0x28')](respondWithResult(_0x47df06,null))[_0x48bc('0x45')](handleError(_0x47df06,null));};exports['create']=function(_0x43f5d0,_0x53738e){return db[_0x48bc('0x2e')][_0x48bc('0x4a')](_0x43f5d0[_0x48bc('0x4b')],{})[_0x48bc('0x28')](respondWithResult(_0x53738e,0xc9))[_0x48bc('0x45')](handleError(_0x53738e,null));};exports['update']=function(_0x30cf66,_0x14fb93){if(_0x30cf66[_0x48bc('0x4b')]['id']){delete _0x30cf66[_0x48bc('0x4b')]['id'];}return db[_0x48bc('0x2e')][_0x48bc('0x49')]({'where':{'id':_0x30cf66['params']['id']}})[_0x48bc('0x28')](handleEntityNotFound(_0x14fb93,null))[_0x48bc('0x28')](saveUpdates(_0x30cf66['body'],null))[_0x48bc('0x28')](respondWithResult(_0x14fb93,null))[_0x48bc('0x45')](handleError(_0x14fb93,null));};exports['destroy']=function(_0x28f793,_0xd1352){return db['AnalyticTreeReport'][_0x48bc('0x49')]({'where':{'id':_0x28f793[_0x48bc('0x47')]['id']}})['then'](handleEntityNotFound(_0xd1352,null))[_0x48bc('0x28')](removeEntity(_0xd1352,null))['catch'](handleError(_0xd1352,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 6c2a176..b853b73 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 _0x3757=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','lodash','util'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x3757,0x18a));var _0x7375=function(_0x48357c,_0x347ed9){_0x48357c=_0x48357c-0x0;var _0x4c51e8=_0x3757[_0x48357c];return _0x4c51e8;};'use strict';var _=require(_0x7375('0x0'));var util=require(_0x7375('0x1'));var logger=require(_0x7375('0x2'))(_0x7375('0x3'));var moment=require(_0x7375('0x4'));var BPromise=require(_0x7375('0x5'));var rp=require(_0x7375('0x6'));var fs=require('fs');var path=require(_0x7375('0x7'));var rimraf=require(_0x7375('0x8'));var config=require('../../config/environment');var attributes=require(_0x7375('0x9'));module[_0x7375('0xa')]=function(_0x31be75,_0x2b4c6c){return _0x31be75[_0x7375('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x858d=['api','moment','path','../../config/environment','exports','define','AnalyticTreeReport','lodash','util','../../config/logger'];(function(_0x382028,_0x37b799){var _0x5ae64c=function(_0x2e1b74){while(--_0x2e1b74){_0x382028['push'](_0x382028['shift']());}};_0x5ae64c(++_0x37b799);}(_0x858d,0x18d));var _0xd858=function(_0x1d50ec,_0x5aef15){_0x1d50ec=_0x1d50ec-0x0;var _0x2e970d=_0x858d[_0x1d50ec];return _0x2e970d;};'use strict';var _=require(_0xd858('0x0'));var util=require(_0xd858('0x1'));var logger=require(_0xd858('0x2'))(_0xd858('0x3'));var moment=require(_0xd858('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd858('0x5'));var rimraf=require('rimraf');var config=require(_0xd858('0x6'));var attributes=require('./analyticTreeReport.attributes');module[_0xd858('0x7')]=function(_0x39c167,_0x138106){return _0x39c167[_0xd858('0x8')](_0xd858('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index d6a5a06..9ef43b4 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x129954,_0x17b156){var _0x2b40f2=function(_0x5b3ce1){while(--_0x5b3ce1){_0x129954['push'](_0x129954['shift']());}};_0x2b40f2(++_0x17b156);}(_0x2ef3,0xba));var _0x32ef=function(_0x2a85a6,_0x457e78){_0x2a85a6=_0x2a85a6-0x0;var _0xfbe55e=_0x2ef3[_0x2a85a6];return _0xfbe55e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _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(_0x29fb63,_0xdd2860){var _0x1c8876=function(_0x4042f5){while(--_0x4042f5){_0x29fb63['push'](_0x29fb63['shift']());}};_0x1c8876(++_0xdd2860);}(_0x1261,0x144));var _0x1126=function(_0x5be8ab,_0x4000a6){_0x5be8ab=_0x5be8ab-0x0;var _0x35914d=_0x1261[_0x5be8ab];return _0x35914d;};'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 ff98d5c..50d398e 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 _0xdce0=['put','update','delete','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','/:id','isAuthenticated','show','post','create'];(function(_0x5458a6,_0x1688c5){var _0x2669fc=function(_0x54ed83){while(--_0x54ed83){_0x5458a6['push'](_0x5458a6['shift']());}};_0x2669fc(++_0x1688c5);}(_0xdce0,0x15a));var _0x0dce=function(_0x207d61,_0xabddf2){_0x207d61=_0x207d61-0x0;var _0xe25562=_0xdce0[_0x207d61];return _0xe25562;};'use strict';var multer=require('multer');var util=require(_0x0dce('0x0'));var path=require(_0x0dce('0x1'));var timeout=require('connect-timeout');var express=require(_0x0dce('0x2'));var router=express[_0x0dce('0x3')]();var fs_extra=require(_0x0dce('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0dce('0x5'));var config=require(_0x0dce('0x6'));var controller=require(_0x0dce('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0dce('0x8')](_0x0dce('0x9'),auth[_0x0dce('0xa')](),controller[_0x0dce('0xb')]);router[_0x0dce('0xc')]('/',auth[_0x0dce('0xa')](),controller[_0x0dce('0xd')]);router[_0x0dce('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0dce('0xf')]);router[_0x0dce('0x10')](_0x0dce('0x9'),auth[_0x0dce('0xa')](),controller['destroy']);module[_0x0dce('0x11')]=router; \ No newline at end of file +var _0xb421=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb421,0x6e));var _0x1b42=function(_0x6784a1,_0x2792fb){_0x6784a1=_0x6784a1-0x0;var _0x4a629e=_0xb421[_0x6784a1];return _0x4a629e;};'use strict';var multer=require(_0x1b42('0x0'));var util=require(_0x1b42('0x1'));var path=require(_0x1b42('0x2'));var timeout=require(_0x1b42('0x3'));var express=require(_0x1b42('0x4'));var router=express[_0x1b42('0x5')]();var fs_extra=require(_0x1b42('0x6'));var auth=require(_0x1b42('0x7'));var interaction=require(_0x1b42('0x8'));var config=require(_0x1b42('0x9'));var controller=require(_0x1b42('0xa'));router[_0x1b42('0xb')]('/',auth['isAuthenticated'](),controller[_0x1b42('0xc')]);router['get']('/:id',auth[_0x1b42('0xd')](),controller[_0x1b42('0xe')]);router[_0x1b42('0xf')]('/',auth[_0x1b42('0xd')](),controller[_0x1b42('0x10')]);router[_0x1b42('0x11')]('/:id',auth[_0x1b42('0xd')](),controller[_0x1b42('0x12')]);router[_0x1b42('0x13')](_0x1b42('0x14'),auth[_0x1b42('0xd')](),controller[_0x1b42('0x15')]);module[_0x1b42('0x16')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index b549854..e6ea23b 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 _0x89f7=['sequelize','exports','STRING'];(function(_0x5cfdcf,_0xf1b182){var _0x6cfd17=function(_0x1fd3c2){while(--_0x1fd3c2){_0x5cfdcf['push'](_0x5cfdcf['shift']());}};_0x6cfd17(++_0xf1b182);}(_0x89f7,0x105));var _0x789f=function(_0x178e71,_0x5c6c7d){_0x178e71=_0x178e71-0x0;var _0x3eec6c=_0x89f7[_0x178e71];return _0x3eec6c;};'use strict';var Sequelize=require(_0x789f('0x0'));module[_0x789f('0x1')]={'name':{'type':Sequelize[_0x789f('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x789f('0x2')]}}; \ No newline at end of file +var _0x6737=['exports','STRING'];(function(_0x513203,_0x53ad55){var _0x5b3c8b=function(_0x275b28){while(--_0x275b28){_0x513203['push'](_0x513203['shift']());}};_0x5b3c8b(++_0x53ad55);}(_0x6737,0xe2));var _0x7673=function(_0x279e17,_0x49f85a){_0x279e17=_0x279e17-0x0;var _0x1f159a=_0x6737[_0x279e17];return _0x1f159a;};'use strict';var Sequelize=require('sequelize');module[_0x7673('0x0')]={'name':{'type':Sequelize[_0x7673('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7673('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c06d84b..7d6b43f 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 _0x6aec=['attributes','intersection','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','options','find','include','omit','createdAt','updatedAt','create','body','catch','update','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','offset','undefined','count','limit','status','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','send','Attachment','rawAttributes','key','map','name','query','keys','filters'];(function(_0x10abfe,_0x7a9ad6){var _0x473c1b=function(_0x392758){while(--_0x392758){_0x10abfe['push'](_0x10abfe['shift']());}};_0x473c1b(++_0x7a9ad6);}(_0x6aec,0xd2));var _0xc6ae=function(_0x5c0be6,_0x4f3671){_0x5c0be6=_0x5c0be6-0x0;var _0x3be5ae=_0x6aec[_0x5c0be6];return _0x3be5ae;};'use strict';var emlformat=require(_0xc6ae('0x0'));var rimraf=require(_0xc6ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6ae('0x2'));var rp=require(_0xc6ae('0x3'));var moment=require(_0xc6ae('0x4'));var BPromise=require(_0xc6ae('0x5'));var Mustache=require(_0xc6ae('0x6'));var util=require('util');var path=require(_0xc6ae('0x7'));var sox=require('sox');var csv=require(_0xc6ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6ae('0x9'));var _=require(_0xc6ae('0xa'));var squel=require(_0xc6ae('0xb'));var crypto=require(_0xc6ae('0xc'));var jsforce=require(_0xc6ae('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc6ae('0xe'));var authService=require(_0xc6ae('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc6ae('0x10'));var hardwareService=require(_0xc6ae('0x11'));var logger=require(_0xc6ae('0x12'))(_0xc6ae('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc6ae('0x14'));var db=require(_0xc6ae('0x15'))['db'];function respondWithStatusCode(_0x504568,_0x8f712){_0x8f712=_0x8f712||0xcc;return function(_0x48b1a6){if(_0x48b1a6){return _0x504568['sendStatus'](_0x8f712);}return _0x504568['status'](_0x8f712)['end']();};}function respondWithResult(_0x2a7b40,_0x3ec68d){_0x3ec68d=_0x3ec68d||0xc8;return function(_0x2b48a8){if(_0x2b48a8){return _0x2a7b40['status'](_0x3ec68d)['json'](_0x2b48a8);}};}function respondWithFilteredResult(_0x15c9dd,_0x2ed1d7){return function(_0x4a56d1){if(_0x4a56d1){var _0x1d7baf=typeof _0x2ed1d7[_0xc6ae('0x16')]===_0xc6ae('0x17')&&typeof _0x2ed1d7['limit']===_0xc6ae('0x17');var _0x4c981d=_0x4a56d1[_0xc6ae('0x18')];var _0x299f0c=_0x1d7baf?0x0:_0x2ed1d7[_0xc6ae('0x16')];var _0x2711ed=_0x1d7baf?_0x4a56d1[_0xc6ae('0x18')]:_0x2ed1d7['offset']+_0x2ed1d7[_0xc6ae('0x19')];var _0x4e3535;if(_0x2711ed>=_0x4c981d){_0x2711ed=_0x4c981d;_0x4e3535=0xc8;}else{_0x4e3535=0xce;}_0x15c9dd[_0xc6ae('0x1a')](_0x4e3535);return _0x15c9dd['set'](_0xc6ae('0x1b'),_0x299f0c+'-'+_0x2711ed+'/'+_0x4c981d)['json'](_0x4a56d1);}return null;};}function patchUpdates(_0x2489ac){return function(_0x3c2a34){try{jsonpatch[_0xc6ae('0x1c')](_0x3c2a34,_0x2489ac,!![]);}catch(_0x3c4bb6){return BPromise[_0xc6ae('0x1d')](_0x3c4bb6);}return _0x3c2a34[_0xc6ae('0x1e')]();};}function saveUpdates(_0xb80d5b,_0x28268a){return function(_0x2b405b){if(_0x2b405b){return _0x2b405b['update'](_0xb80d5b)[_0xc6ae('0x1f')](function(_0x599299){return _0x599299;});}return null;};}function removeEntity(_0x3a3699,_0x102302){return function(_0x44c73a){if(_0x44c73a){return _0x44c73a[_0xc6ae('0x20')]()[_0xc6ae('0x1f')](function(){_0x3a3699[_0xc6ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1057de,_0x5840bb){return function(_0x381cf2){if(!_0x381cf2){_0x1057de[_0xc6ae('0x21')](0x194);}return _0x381cf2;};}function handleError(_0x5c76be,_0x424379){_0x424379=_0x424379||0x1f4;return function(_0x45a5cb){logger[_0xc6ae('0x22')](_0x45a5cb[_0xc6ae('0x23')]);if(_0x45a5cb['name']){delete _0x45a5cb['name'];}_0x5c76be['status'](_0x424379)[_0xc6ae('0x24')](_0x45a5cb);};}exports['index']=function(_0x12aa92,_0x2bde5c){var _0x2a6f53={},_0x2f7408={},_0x54a78c={'count':0x0,'rows':[]};var _0x253c90=_['map'](db[_0xc6ae('0x25')][_0xc6ae('0x26')],function(_0x1804e7){return{'name':_0x1804e7['fieldName'],'type':_0x1804e7['type'][_0xc6ae('0x27')]};});_0x2f7408['model']=_[_0xc6ae('0x28')](_0x253c90,_0xc6ae('0x29'));_0x2f7408[_0xc6ae('0x2a')]=_[_0xc6ae('0x2b')](_0x12aa92[_0xc6ae('0x2a')]);_0x2f7408[_0xc6ae('0x2c')]=_['intersection'](_0x2f7408['model'],_0x2f7408[_0xc6ae('0x2a')]);_0x2a6f53[_0xc6ae('0x2d')]=_[_0xc6ae('0x2e')](_0x2f7408['model'],qs[_0xc6ae('0x2f')](_0x12aa92[_0xc6ae('0x2a')]['fields']));_0x2a6f53[_0xc6ae('0x2d')]=_0x2a6f53[_0xc6ae('0x2d')][_0xc6ae('0x30')]?_0x2a6f53[_0xc6ae('0x2d')]:_0x2f7408[_0xc6ae('0x31')];if(!_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x32')](_0xc6ae('0x33'))){_0x2a6f53[_0xc6ae('0x19')]=qs[_0xc6ae('0x19')](_0x12aa92[_0xc6ae('0x2a')]['limit']);_0x2a6f53[_0xc6ae('0x16')]=qs[_0xc6ae('0x16')](_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x16')]);}_0x2a6f53[_0xc6ae('0x34')]=qs[_0xc6ae('0x35')](_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x35')]);_0x2a6f53[_0xc6ae('0x36')]=qs[_0xc6ae('0x2c')](_[_0xc6ae('0x37')](_0x12aa92['query'],_0x2f7408[_0xc6ae('0x2c')]),_0x253c90);if(_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x38')]){_0x2a6f53[_0xc6ae('0x36')]=_[_0xc6ae('0x39')](_0x2a6f53[_0xc6ae('0x36')],{'$or':_['map'](_0x253c90,function(_0x39fb08){if(_0x39fb08[_0xc6ae('0x3a')]!==_0xc6ae('0x3b')){var _0x1d4d7e={};_0x1d4d7e[_0x39fb08[_0xc6ae('0x29')]]={'$like':'%'+_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x38')]+'%'};return _0x1d4d7e;}})});}_0x2a6f53=_[_0xc6ae('0x39')]({},_0x2a6f53,_0x12aa92['options']);var _0x333e7a={'where':_0x2a6f53[_0xc6ae('0x36')]};return db[_0xc6ae('0x25')]['count'](_0x333e7a)[_0xc6ae('0x1f')](function(_0x53c34e){_0x54a78c[_0xc6ae('0x18')]=_0x53c34e;if(_0x12aa92[_0xc6ae('0x2a')][_0xc6ae('0x3c')]){_0x2a6f53['include']=[{'all':!![]}];}return db[_0xc6ae('0x25')][_0xc6ae('0x3d')](_0x2a6f53);})[_0xc6ae('0x1f')](function(_0x5ab354){_0x54a78c[_0xc6ae('0x3e')]=_0x5ab354;return _0x54a78c;})[_0xc6ae('0x1f')](respondWithFilteredResult(_0x2bde5c,_0x2a6f53))['catch'](handleError(_0x2bde5c,null));};exports[_0xc6ae('0x3f')]=function(_0x3649a0,_0x341b12){var _0x4a5170={'raw':!![],'where':{'id':_0x3649a0[_0xc6ae('0x40')]['id']}},_0x469386={};_0x469386['model']=_[_0xc6ae('0x2b')](db['Attachment'][_0xc6ae('0x26')]);_0x469386[_0xc6ae('0x2a')]=_[_0xc6ae('0x2b')](_0x3649a0[_0xc6ae('0x2a')]);_0x469386['filters']=_['intersection'](_0x469386[_0xc6ae('0x31')],_0x469386[_0xc6ae('0x2a')]);_0x4a5170[_0xc6ae('0x2d')]=_[_0xc6ae('0x2e')](_0x469386[_0xc6ae('0x31')],qs[_0xc6ae('0x2f')](_0x3649a0[_0xc6ae('0x2a')][_0xc6ae('0x2f')]));_0x4a5170[_0xc6ae('0x2d')]=_0x4a5170[_0xc6ae('0x2d')][_0xc6ae('0x30')]?_0x4a5170['attributes']:_0x469386[_0xc6ae('0x31')];if(_0x3649a0[_0xc6ae('0x2a')][_0xc6ae('0x3c')]){_0x4a5170['include']=[{'all':!![]}];}_0x4a5170=_[_0xc6ae('0x39')]({},_0x4a5170,_0x3649a0[_0xc6ae('0x41')]);return db[_0xc6ae('0x25')][_0xc6ae('0x42')](_0x4a5170)[_0xc6ae('0x1f')](handleEntityNotFound(_0x341b12,null))['then'](respondWithResult(_0x341b12,null))['catch'](handleError(_0x341b12,null));};exports['clone']=function(_0x3ef92c,_0xd25199){var _0x1a92ed={'where':{'id':_0x3ef92c[_0xc6ae('0x40')]['id']}},_0x2c91bc={};_0x2c91bc[_0xc6ae('0x31')]=_[_0xc6ae('0x2b')](db[_0xc6ae('0x25')]['rawAttributes']);_0x1a92ed['attributes']=_[_0xc6ae('0x2e')](_0x2c91bc[_0xc6ae('0x31')],qs[_0xc6ae('0x2f')](_0x3ef92c[_0xc6ae('0x2a')][_0xc6ae('0x2f')]));_0x1a92ed[_0xc6ae('0x2d')]=_0x1a92ed[_0xc6ae('0x2d')][_0xc6ae('0x30')]?_0x1a92ed[_0xc6ae('0x2d')]:_0x2c91bc[_0xc6ae('0x31')];if(_0x3ef92c['query']['includeAll']){_0x1a92ed[_0xc6ae('0x43')]=[{'all':!![]}];}_0x1a92ed=_['merge']({},_0x1a92ed,_0x3ef92c[_0xc6ae('0x41')]);return db['Attachment']['find'](_0x1a92ed)[_0xc6ae('0x1f')](handleEntityNotFound(_0xd25199,null))[_0xc6ae('0x1f')](function(_0x2be95a){if(_0x2be95a){var _0x4f8e1f=_0x2be95a['get']({'plain':!![]});_0x4f8e1f=qs[_0xc6ae('0x44')](_0x4f8e1f,['id',_0xc6ae('0x45'),_0xc6ae('0x46')]);_0x3ef92c['body']=_[_0xc6ae('0x44')](_0x3ef92c['body'],['id','createdAt',_0xc6ae('0x46')]);return db[_0xc6ae('0x25')][_0xc6ae('0x47')](_[_0xc6ae('0x39')](_0x4f8e1f,_0x3ef92c[_0xc6ae('0x48')]),{'include':_0x3ef92c['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0xc6ae('0x1f')](respondWithResult(_0xd25199,0xc9))[_0xc6ae('0x49')](handleError(_0xd25199,null));};exports[_0xc6ae('0x4a')]=function(_0x5865f8,_0x518e42){if(_0x5865f8[_0xc6ae('0x48')]['id']){delete _0x5865f8[_0xc6ae('0x48')]['id'];}return db[_0xc6ae('0x25')][_0xc6ae('0x42')]({'where':{'id':_0x5865f8['params']['id']}})[_0xc6ae('0x1f')](handleEntityNotFound(_0x518e42,null))[_0xc6ae('0x1f')](saveUpdates(_0x5865f8[_0xc6ae('0x48')],null))[_0xc6ae('0x1f')](respondWithResult(_0x518e42,null))[_0xc6ae('0x49')](handleError(_0x518e42,null));};exports['destroy']=function(_0x1473f8,_0x142d0d){return db[_0xc6ae('0x25')][_0xc6ae('0x42')]({'where':{'id':_0x1473f8[_0xc6ae('0x40')]['id']}})[_0xc6ae('0x1f')](handleEntityNotFound(_0x142d0d,null))['then'](removeEntity(_0x142d0d,null))[_0xc6ae('0x49')](handleError(_0x142d0d,null));};exports[_0xc6ae('0x47')]=function(_0x245f3d,_0x1d9958,_0x49b108){_0x245f3d[_0xc6ae('0x48')][_0xc6ae('0x29')]=_0x245f3d[_0xc6ae('0x4b')][_0xc6ae('0x4c')];_0x245f3d[_0xc6ae('0x48')][_0xc6ae('0x4d')]=_0x245f3d[_0xc6ae('0x4b')][_0xc6ae('0x4e')];_0x245f3d['body'][_0xc6ae('0x3a')]=_0x245f3d['file']['mimetype'];return db[_0xc6ae('0x25')]['create'](_0x245f3d[_0xc6ae('0x48')])[_0xc6ae('0x1f')](respondWithResult(_0x1d9958,0xc9))[_0xc6ae('0x49')](handleError(_0x1d9958,null));};exports[_0xc6ae('0x4f')]=function(_0xf4e69a,_0x58797e,_0x808ce){return db[_0xc6ae('0x25')]['findOne']({'where':{'id':_0xf4e69a[_0xc6ae('0x40')]['id']},'raw':!![]})[_0xc6ae('0x1f')](handleEntityNotFound(_0x58797e,null))[_0xc6ae('0x1f')](function(_0x5c666d){if(_0x5c666d){var _0x39c632=_0x5c666d[_0xc6ae('0x50')]!==null;var _0x2f4928=path[_0xc6ae('0x51')](config[_0xc6ae('0x52')],_0xc6ae('0x53'));if(_0x39c632){_0x2f4928=path['join'](_0x2f4928,_0xc6ae('0x54'));}var _0x2c8678=path[_0xc6ae('0x51')](_0x2f4928,_0x5c666d['basename']);return _0x58797e[_0xc6ae('0x4f')](_0x2c8678);}})[_0xc6ae('0x49')](handleError(_0x58797e,null));}; \ No newline at end of file +var _0x5d5e=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','save','update','destroy','error','name','send','map','Attachment','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','clone','rawAttributes','find','get','omit','updatedAt','body','createdAt','create','catch','originalname','basename','file','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format'];(function(_0x416586,_0xbdf0b1){var _0x5cbb10=function(_0x274854){while(--_0x274854){_0x416586['push'](_0x416586['shift']());}};_0x5cbb10(++_0xbdf0b1);}(_0x5d5e,0x104));var _0xe5d5=function(_0x467698,_0x1b7e8f){_0x467698=_0x467698-0x0;var _0x89f21b=_0x5d5e[_0x467698];return _0x89f21b;};'use strict';var emlformat=require(_0xe5d5('0x0'));var rimraf=require(_0xe5d5('0x1'));var zipdir=require(_0xe5d5('0x2'));var jsonpatch=require(_0xe5d5('0x3'));var rp=require('request-promise');var moment=require(_0xe5d5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe5d5('0x5'));var util=require(_0xe5d5('0x6'));var path=require(_0xe5d5('0x7'));var sox=require(_0xe5d5('0x8'));var csv=require(_0xe5d5('0x9'));var ejs=require(_0xe5d5('0xa'));var fs=require('fs');var fs_extra=require(_0xe5d5('0xb'));var _=require(_0xe5d5('0xc'));var squel=require(_0xe5d5('0xd'));var crypto=require(_0xe5d5('0xe'));var jsforce=require(_0xe5d5('0xf'));var deskjs=require(_0xe5d5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe5d5('0x11'));var Papa=require('papaparse');var Redis=require(_0xe5d5('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe5d5('0x13'));var hardwareService=require(_0xe5d5('0x14'));var logger=require('../../config/logger')(_0xe5d5('0x15'));var utils=require(_0xe5d5('0x16'));var config=require(_0xe5d5('0x17'));var licenseUtil=require(_0xe5d5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e331d,_0x28cb5d){_0x28cb5d=_0x28cb5d||0xcc;return function(_0x4e1cdf){if(_0x4e1cdf){return _0x4e331d[_0xe5d5('0x19')](_0x28cb5d);}return _0x4e331d[_0xe5d5('0x1a')](_0x28cb5d)[_0xe5d5('0x1b')]();};}function respondWithResult(_0x23df93,_0x248c0f){_0x248c0f=_0x248c0f||0xc8;return function(_0x4ba4fc){if(_0x4ba4fc){return _0x23df93[_0xe5d5('0x1a')](_0x248c0f)[_0xe5d5('0x1c')](_0x4ba4fc);}};}function respondWithFilteredResult(_0xf53458,_0x278411){return function(_0xf5b6bd){if(_0xf5b6bd){var _0x3f4491=typeof _0x278411['offset']===_0xe5d5('0x1d')&&typeof _0x278411['limit']==='undefined';var _0x583a9e=_0xf5b6bd[_0xe5d5('0x1e')];var _0x5bab59=_0x3f4491?0x0:_0x278411[_0xe5d5('0x1f')];var _0xf33c37=_0x3f4491?_0xf5b6bd[_0xe5d5('0x1e')]:_0x278411[_0xe5d5('0x1f')]+_0x278411['limit'];var _0x1d07ab;if(_0xf33c37>=_0x583a9e){_0xf33c37=_0x583a9e;_0x1d07ab=0xc8;}else{_0x1d07ab=0xce;}_0xf53458[_0xe5d5('0x1a')](_0x1d07ab);return _0xf53458[_0xe5d5('0x20')](_0xe5d5('0x21'),_0x5bab59+'-'+_0xf33c37+'/'+_0x583a9e)[_0xe5d5('0x1c')](_0xf5b6bd);}return null;};}function patchUpdates(_0x36dc84){return function(_0x287199){try{jsonpatch['apply'](_0x287199,_0x36dc84,!![]);}catch(_0x5555af){return BPromise['reject'](_0x5555af);}return _0x287199[_0xe5d5('0x22')]();};}function saveUpdates(_0x39be17,_0x1dae40){return function(_0x44dbb9){if(_0x44dbb9){return _0x44dbb9[_0xe5d5('0x23')](_0x39be17)['then'](function(_0x25a906){return _0x25a906;});}return null;};}function removeEntity(_0x55d44f,_0x3f3ec7){return function(_0x1b989e){if(_0x1b989e){return _0x1b989e[_0xe5d5('0x24')]()['then'](function(){_0x55d44f[_0xe5d5('0x1a')](0xcc)[_0xe5d5('0x1b')]();});}};}function handleEntityNotFound(_0x485508,_0x42b7d1){return function(_0x3aaf1b){if(!_0x3aaf1b){_0x485508[_0xe5d5('0x19')](0x194);}return _0x3aaf1b;};}function handleError(_0x8d6fa4,_0x81aab0){_0x81aab0=_0x81aab0||0x1f4;return function(_0x1e0f8f){logger[_0xe5d5('0x25')](_0x1e0f8f['stack']);if(_0x1e0f8f[_0xe5d5('0x26')]){delete _0x1e0f8f[_0xe5d5('0x26')];}_0x8d6fa4[_0xe5d5('0x1a')](_0x81aab0)[_0xe5d5('0x27')](_0x1e0f8f);};}exports['index']=function(_0x570333,_0x11b622){var _0x3b0cb9={},_0x3af9c9={},_0x2b384a={'count':0x0,'rows':[]};var _0x55b978=_[_0xe5d5('0x28')](db[_0xe5d5('0x29')]['rawAttributes'],function(_0xc6830f){return{'name':_0xc6830f[_0xe5d5('0x2a')],'type':_0xc6830f[_0xe5d5('0x2b')][_0xe5d5('0x2c')]};});_0x3af9c9['model']=_[_0xe5d5('0x28')](_0x55b978,_0xe5d5('0x26'));_0x3af9c9['query']=_[_0xe5d5('0x2d')](_0x570333[_0xe5d5('0x2e')]);_0x3af9c9[_0xe5d5('0x2f')]=_[_0xe5d5('0x30')](_0x3af9c9[_0xe5d5('0x31')],_0x3af9c9[_0xe5d5('0x2e')]);_0x3b0cb9[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x3af9c9[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x33')]));_0x3b0cb9['attributes']=_0x3b0cb9[_0xe5d5('0x32')]['length']?_0x3b0cb9[_0xe5d5('0x32')]:_0x3af9c9['model'];if(!_0x570333['query'][_0xe5d5('0x34')](_0xe5d5('0x35'))){_0x3b0cb9['limit']=qs[_0xe5d5('0x36')](_0x570333['query']['limit']);_0x3b0cb9[_0xe5d5('0x1f')]=qs[_0xe5d5('0x1f')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x1f')]);}_0x3b0cb9[_0xe5d5('0x37')]=qs[_0xe5d5('0x38')](_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x38')]);_0x3b0cb9[_0xe5d5('0x39')]=qs['filters'](_['pick'](_0x570333[_0xe5d5('0x2e')],_0x3af9c9[_0xe5d5('0x2f')]),_0x55b978);if(_0x570333['query']['filter']){_0x3b0cb9[_0xe5d5('0x39')]=_[_0xe5d5('0x3a')](_0x3b0cb9[_0xe5d5('0x39')],{'$or':_[_0xe5d5('0x28')](_0x55b978,function(_0x465043){if(_0x465043[_0xe5d5('0x2b')]!==_0xe5d5('0x3b')){var _0x108990={};_0x108990[_0x465043['name']]={'$like':'%'+_0x570333[_0xe5d5('0x2e')]['filter']+'%'};return _0x108990;}})});}_0x3b0cb9=_[_0xe5d5('0x3a')]({},_0x3b0cb9,_0x570333[_0xe5d5('0x3c')]);var _0x421940={'where':_0x3b0cb9['where']};return db[_0xe5d5('0x29')][_0xe5d5('0x1e')](_0x421940)[_0xe5d5('0x3d')](function(_0x556c15){_0x2b384a['count']=_0x556c15;if(_0x570333[_0xe5d5('0x2e')][_0xe5d5('0x3e')]){_0x3b0cb9[_0xe5d5('0x3f')]=[{'all':!![]}];}return db[_0xe5d5('0x29')][_0xe5d5('0x40')](_0x3b0cb9);})[_0xe5d5('0x3d')](function(_0x24dd19){_0x2b384a[_0xe5d5('0x41')]=_0x24dd19;return _0x2b384a;})[_0xe5d5('0x3d')](respondWithFilteredResult(_0x11b622,_0x3b0cb9))['catch'](handleError(_0x11b622,null));};exports[_0xe5d5('0x42')]=function(_0x20a46d,_0x22fe09){var _0x2db585={'raw':!![],'where':{'id':_0x20a46d[_0xe5d5('0x43')]['id']}},_0x3a32a2={};_0x3a32a2[_0xe5d5('0x31')]=_['keys'](db[_0xe5d5('0x29')]['rawAttributes']);_0x3a32a2[_0xe5d5('0x2e')]=_['keys'](_0x20a46d[_0xe5d5('0x2e')]);_0x3a32a2[_0xe5d5('0x2f')]=_[_0xe5d5('0x30')](_0x3a32a2[_0xe5d5('0x31')],_0x3a32a2['query']);_0x2db585[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x3a32a2[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x20a46d[_0xe5d5('0x2e')]['fields']));_0x2db585['attributes']=_0x2db585['attributes']['length']?_0x2db585['attributes']:_0x3a32a2[_0xe5d5('0x31')];if(_0x20a46d['query'][_0xe5d5('0x3e')]){_0x2db585[_0xe5d5('0x3f')]=[{'all':!![]}];}_0x2db585=_['merge']({},_0x2db585,_0x20a46d[_0xe5d5('0x3c')]);return db[_0xe5d5('0x29')]['find'](_0x2db585)[_0xe5d5('0x3d')](handleEntityNotFound(_0x22fe09,null))[_0xe5d5('0x3d')](respondWithResult(_0x22fe09,null))['catch'](handleError(_0x22fe09,null));};exports[_0xe5d5('0x44')]=function(_0x4672e9,_0x2087c2){var _0x3ecdc9={'where':{'id':_0x4672e9[_0xe5d5('0x43')]['id']}},_0x59f872={};_0x59f872[_0xe5d5('0x31')]=_[_0xe5d5('0x2d')](db[_0xe5d5('0x29')][_0xe5d5('0x45')]);_0x3ecdc9[_0xe5d5('0x32')]=_[_0xe5d5('0x30')](_0x59f872[_0xe5d5('0x31')],qs[_0xe5d5('0x33')](_0x4672e9['query'][_0xe5d5('0x33')]));_0x3ecdc9[_0xe5d5('0x32')]=_0x3ecdc9['attributes']['length']?_0x3ecdc9[_0xe5d5('0x32')]:_0x59f872[_0xe5d5('0x31')];if(_0x4672e9[_0xe5d5('0x2e')]['includeAll']){_0x3ecdc9[_0xe5d5('0x3f')]=[{'all':!![]}];}_0x3ecdc9=_[_0xe5d5('0x3a')]({},_0x3ecdc9,_0x4672e9[_0xe5d5('0x3c')]);return db[_0xe5d5('0x29')][_0xe5d5('0x46')](_0x3ecdc9)[_0xe5d5('0x3d')](handleEntityNotFound(_0x2087c2,null))[_0xe5d5('0x3d')](function(_0x5e982e){if(_0x5e982e){var _0x1dd6f9=_0x5e982e[_0xe5d5('0x47')]({'plain':!![]});_0x1dd6f9=qs[_0xe5d5('0x48')](_0x1dd6f9,['id','createdAt',_0xe5d5('0x49')]);_0x4672e9[_0xe5d5('0x4a')]=_[_0xe5d5('0x48')](_0x4672e9['body'],['id',_0xe5d5('0x4b'),_0xe5d5('0x49')]);return db[_0xe5d5('0x29')][_0xe5d5('0x4c')](_[_0xe5d5('0x3a')](_0x1dd6f9,_0x4672e9['body']),{'include':_0x4672e9[_0xe5d5('0x2e')][_0xe5d5('0x3e')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x2087c2,0xc9))[_0xe5d5('0x4d')](handleError(_0x2087c2,null));};exports['update']=function(_0x3caf55,_0x40e159){if(_0x3caf55['body']['id']){delete _0x3caf55[_0xe5d5('0x4a')]['id'];}return db[_0xe5d5('0x29')][_0xe5d5('0x46')]({'where':{'id':_0x3caf55['params']['id']}})[_0xe5d5('0x3d')](handleEntityNotFound(_0x40e159,null))[_0xe5d5('0x3d')](saveUpdates(_0x3caf55[_0xe5d5('0x4a')],null))[_0xe5d5('0x3d')](respondWithResult(_0x40e159,null))[_0xe5d5('0x4d')](handleError(_0x40e159,null));};exports[_0xe5d5('0x24')]=function(_0x34315d,_0x42dd12){return db[_0xe5d5('0x29')][_0xe5d5('0x46')]({'where':{'id':_0x34315d['params']['id']}})[_0xe5d5('0x3d')](handleEntityNotFound(_0x42dd12,null))[_0xe5d5('0x3d')](removeEntity(_0x42dd12,null))[_0xe5d5('0x4d')](handleError(_0x42dd12,null));};exports[_0xe5d5('0x4c')]=function(_0xdaff12,_0x2f684c,_0x2d3738){_0xdaff12[_0xe5d5('0x4a')]['name']=_0xdaff12['file'][_0xe5d5('0x4e')];_0xdaff12['body'][_0xe5d5('0x4f')]=_0xdaff12[_0xe5d5('0x50')]['filename'];_0xdaff12[_0xe5d5('0x4a')][_0xe5d5('0x2b')]=_0xdaff12['file']['mimetype'];return db[_0xe5d5('0x29')][_0xe5d5('0x4c')](_0xdaff12[_0xe5d5('0x4a')])[_0xe5d5('0x3d')](respondWithResult(_0x2f684c,0xc9))[_0xe5d5('0x4d')](handleError(_0x2f684c,null));};exports['download']=function(_0x3aed51,_0x5405a0,_0x348d48){return db[_0xe5d5('0x29')][_0xe5d5('0x51')]({'where':{'id':_0x3aed51[_0xe5d5('0x43')]['id']},'raw':!![]})[_0xe5d5('0x3d')](handleEntityNotFound(_0x5405a0,null))[_0xe5d5('0x3d')](function(_0x5460af){if(_0x5460af){var _0x4026ad=_0x5460af[_0xe5d5('0x52')]!==null;var _0x5d5351=path['join'](config[_0xe5d5('0x53')],_0xe5d5('0x54'));if(_0x4026ad){_0x5d5351=path[_0xe5d5('0x55')](_0x5d5351,_0xe5d5('0x56'));}var _0x8e78e0=path[_0xe5d5('0x55')](_0x5d5351,_0x5460af[_0xe5d5('0x4f')]);return _0x5405a0['download'](_0x8e78e0);}})[_0xe5d5('0x4d')](handleError(_0x5405a0,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 511d869..a1c381f 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 _0x1e51=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define','Attachment','attachments','lodash','util','../../config/logger','api'];(function(_0x553d1d,_0x456a4d){var _0x3712c9=function(_0x2204ad){while(--_0x2204ad){_0x553d1d['push'](_0x553d1d['shift']());}};_0x3712c9(++_0x456a4d);}(_0x1e51,0x130));var _0x11e5=function(_0x3cff25,_0x1d6be6){_0x3cff25=_0x3cff25-0x0;var _0x322bd6=_0x1e51[_0x3cff25];return _0x322bd6;};'use strict';var _=require(_0x11e5('0x0'));var util=require(_0x11e5('0x1'));var logger=require(_0x11e5('0x2'))(_0x11e5('0x3'));var moment=require(_0x11e5('0x4'));var BPromise=require(_0x11e5('0x5'));var rp=require(_0x11e5('0x6'));var fs=require('fs');var path=require(_0x11e5('0x7'));var rimraf=require(_0x11e5('0x8'));var config=require(_0x11e5('0x9'));var attributes=require(_0x11e5('0xa'));module['exports']=function(_0x451c4e,_0x3efb9d){return _0x451c4e[_0x11e5('0xb')](_0x11e5('0xc'),attributes,{'tableName':_0x11e5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72de=['Attachment','attachments','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x590a3a,_0xd9db9){var _0x49017f=function(_0x1d92e9){while(--_0x1d92e9){_0x590a3a['push'](_0x590a3a['shift']());}};_0x49017f(++_0xd9db9);}(_0x72de,0x1e6));var _0xe72d=function(_0x17b203,_0x5a2205){_0x17b203=_0x17b203-0x0;var _0x153741=_0x72de[_0x17b203];return _0x153741;};'use strict';var _=require(_0xe72d('0x0'));var util=require(_0xe72d('0x1'));var logger=require(_0xe72d('0x2'))(_0xe72d('0x3'));var moment=require(_0xe72d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe72d('0x5'));var config=require(_0xe72d('0x6'));var attributes=require(_0xe72d('0x7'));module[_0xe72d('0x8')]=function(_0x30858e,_0x312cdb){return _0x30858e['define'](_0xe72d('0x9'),attributes,{'tableName':_0xe72d('0xa'),'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 c08c157..b482d66 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 _0x99e9=['Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Attachment','create','body','raw','CreateAttachment','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x167d37,_0x53d041){var _0x18b7a4=function(_0x4cf090){while(--_0x4cf090){_0x167d37['push'](_0x167d37['shift']());}};_0x18b7a4(++_0x53d041);}(_0x99e9,0xb4));var _0x999e=function(_0x31f7c5,_0x3bf428){_0x31f7c5=_0x31f7c5-0x0;var _0x19fabc=_0x99e9[_0x31f7c5];return _0x19fabc;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var moment=require(_0x999e('0x1'));var BPromise=require(_0x999e('0x2'));var rs=require(_0x999e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x999e('0x4'))['db'];var utils=require(_0x999e('0x5'));var logger=require(_0x999e('0x6'))('rpc');var config=require(_0x999e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x999e('0x8')][_0x999e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x100330,_0x18f337,_0x5c1c17){return new BPromise(function(_0x46aeae,_0x38a692){return client[_0x999e('0xa')](_0x100330,_0x5c1c17)[_0x999e('0xb')](function(_0x2c38cf){logger[_0x999e('0xc')](_0x999e('0xd'),_0x18f337,_0x999e('0xe'));logger[_0x999e('0xf')](_0x999e('0x10'),_0x18f337,_0x999e('0xe'),JSON[_0x999e('0x11')](_0x2c38cf));if(_0x2c38cf[_0x999e('0x12')]){if(_0x2c38cf[_0x999e('0x12')][_0x999e('0x13')]===0x1f4){logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x38a692(_0x2c38cf['error'][_0x999e('0x14')]);}logger[_0x999e('0x12')](_0x999e('0xd'),_0x18f337,_0x2c38cf['error'][_0x999e('0x14')]);return _0x46aeae(_0x2c38cf['error'][_0x999e('0x14')]);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x18f337,_0x999e('0xe'));_0x46aeae(_0x2c38cf[_0x999e('0x15')][_0x999e('0x14')]);}})[_0x999e('0x16')](function(_0x1e9bff){logger[_0x999e('0x12')]('Attachment,\x20%s,\x20%s',_0x18f337,_0x1e9bff);_0x38a692(_0x1e9bff);});});}exports['CreateAttachment']=function(_0x4fcdfb){var _0x3153ce=this;return new Promise(function(_0x43b09e,_0xc4ef74){return db[_0x999e('0x17')][_0x999e('0x18')](_0x4fcdfb[_0x999e('0x19')],{'raw':_0x4fcdfb['options']?_0x4fcdfb['options'][_0x999e('0x1a')]===undefined?!![]:![]:!![]})[_0x999e('0xb')](function(_0x3b3642){logger['info'](_0x999e('0x1b'),_0x4fcdfb);logger[_0x999e('0xf')](_0x999e('0x1b'),_0x4fcdfb,JSON[_0x999e('0x11')](_0x3b3642));_0x43b09e(_0x3b3642);})[_0x999e('0x16')](function(_0x3750a0){logger[_0x999e('0x12')]('CreateAttachment',_0x3750a0['message'],_0x4fcdfb);_0xc4ef74(_0x3153ce[_0x999e('0x12')](0x1f4,_0x3750a0[_0x999e('0x14')]));});});}; \ No newline at end of file +var _0xa74f=['then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateAttachment','Attachment','body','options','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xa74f,0x9a));var _0xfa74=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xa74f[_0x29bf80];return _0x932096;};'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);});});}exports[_0xfa74('0x13')]=function(_0x51dda1){var _0x4928b6=this;return new Promise(function(_0x31d3c1,_0x25a36b){return db[_0xfa74('0x14')]['create'](_0x51dda1[_0xfa74('0x15')],{'raw':_0x51dda1[_0xfa74('0x16')]?_0x51dda1[_0xfa74('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xfa74('0x7')](function(_0x302eb4){logger[_0xfa74('0x8')]('CreateAttachment',_0x51dda1);logger['debug'](_0xfa74('0x13'),_0x51dda1,JSON[_0xfa74('0xc')](_0x302eb4));_0x31d3c1(_0x302eb4);})[_0xfa74('0x12')](function(_0xeaaa19){logger[_0xfa74('0xd')]('CreateAttachment',_0xeaaa19['message'],_0x51dda1);_0x25a36b(_0x4928b6[_0xfa74('0xd')](0x1f4,_0xeaaa19['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 50d7bbf..eca446b 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5bde33,_0x317aef){var _0x5bffd1=function(_0x5376d5){while(--_0x5376d5){_0x5bde33['push'](_0x5bde33['shift']());}};_0x5bffd1(++_0x317aef);}(_0x5f2f,0x73));var _0xf5f2=function(_0x462ae6,_0x384d3d){_0x462ae6=_0x462ae6-0x0;var _0x38f095=_0x5f2f[_0x462ae6];return _0x38f095;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5e4146,_0x306610){var _0x1b0344=function(_0x4fb8a5){while(--_0x4fb8a5){_0x5e4146['push'](_0x5e4146['shift']());}};_0x1b0344(++_0x306610);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56d776,_0x252211){_0x56d776=_0x56d776-0x0;var _0x2be469=_0x5f2f[_0x56d776];return _0x2be469;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 563717b..5361acc 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 _0x1796=['getLicense','lodash','passport','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','/login','email','callback','google','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','then','User','find','emails','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','blockDuration','minutes'];(function(_0x49a57c,_0x2eb02c){var _0x4e0316=function(_0x37e2e5){while(--_0x37e2e5){_0x49a57c['push'](_0x49a57c['shift']());}};_0x4e0316(++_0x2eb02c);}(_0x1796,0xab));var _0x6179=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x1796[_0x543084];return _0x306a57;};'use strict';var _=require(_0x6179('0x0'));var passport=require(_0x6179('0x1'));var GoogleStrategy=require('passport-google-oauth20')[_0x6179('0x2')];var moment=require(_0x6179('0x3'));var db=require(_0x6179('0x4'))['db'];var config=require(_0x6179('0x5'));var signToken=require(_0x6179('0x6'))[_0x6179('0x7')];var utils=require(_0x6179('0x8'));exports[_0x6179('0x9')]=passport[_0x6179('0xa')]('google',{'failureRedirect':_0x6179('0xb'),'scope':['profile',_0x6179('0xc')],'session':![]});exports[_0x6179('0xd')]=passport[_0x6179('0xa')](_0x6179('0xe'),{'failureRedirect':_0x6179('0xb'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x6179('0xe')]?config['google'][_0x6179('0xf')]:'id','clientSecret':config[_0x6179('0xe')]?config['google'][_0x6179('0x10')]:_0x6179('0x11'),'callbackURL':config[_0x6179('0xe')]?config[_0x6179('0xe')]['callbackURL']:''},function(_0x14ec8e,_0x50709c,_0xd30faa,_0x3ef0f7){var _0x4a0feb,_0x5214ea;return db[_0x6179('0x12')][_0x6179('0x13')]({'where':{'id':0x1},'attributes':[_0x6179('0x14'),'blockDuration'],'raw':!![]})[_0x6179('0x15')](function(_0x2497ad){_0x4a0feb=_0x2497ad;return db[_0x6179('0x16')][_0x6179('0x17')]({'where':{'email':_['map'](_0xd30faa[_0x6179('0x18')],'value'),'role':{'$or':[_0x6179('0x19'),_0x6179('0x1a'),_0x6179('0x1b')]}}});})[_0x6179('0x15')](function(_0x2cfd54){_0x5214ea=_0x2cfd54;if(_0x5214ea){if(_0x5214ea['disabled']){return _0x3ef0f7(_0x6179('0x1c'));}else if(_0x4a0feb['blockDuration']>0x0){if(_0x5214ea[_0x6179('0x1d')]){if(moment(_0x5214ea[_0x6179('0x1e')])['add'](_0x4a0feb[_0x6179('0x1f')],_0x6179('0x20'))>moment()){return _0x3ef0f7(_0x6179('0x1c'));}else{return utils['clearBlockUser'](_0x5214ea,0x0,![],null)[_0x6179('0x15')](function(){return utils[_0x6179('0x21')](_0x5214ea);})[_0x6179('0x15')](function(){return _0x3ef0f7(null,_0x5214ea);});}}else{return utils[_0x6179('0x21')](_0x5214ea)[_0x6179('0x15')](function(){return _0x3ef0f7(null,_0x5214ea);});}}else{return utils[_0x6179('0x21')](_0x5214ea)['then'](function(){return _0x3ef0f7(null,_0x5214ea);});}}return _0x3ef0f7(_0x6179('0x1c'));})['catch'](function(_0x220123){_0x3ef0f7(_0x220123);});})); \ No newline at end of file +var _0x4ce6=['map','emails','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','login','google','profile','callback','authenticate','/login','use','clientID','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find'];(function(_0x43f528,_0x3471f2){var _0x309445=function(_0x45b43e){while(--_0x45b43e){_0x43f528['push'](_0x43f528['shift']());}};_0x309445(++_0x3471f2);}(_0x4ce6,0x1be));var _0x64ce=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0x4ce6[_0x2eb3db];return _0x358f33;};'use strict';var _=require('lodash');var passport=require(_0x64ce('0x0'));var GoogleStrategy=require(_0x64ce('0x1'))['Strategy'];var moment=require(_0x64ce('0x2'));var db=require(_0x64ce('0x3'))['db'];var config=require(_0x64ce('0x4'));var signToken=require(_0x64ce('0x5'))['signToken'];var utils=require('../../config/utils');exports[_0x64ce('0x6')]=passport['authenticate'](_0x64ce('0x7'),{'failureRedirect':'/login','scope':[_0x64ce('0x8'),'email'],'session':![]});exports[_0x64ce('0x9')]=passport[_0x64ce('0xa')]('google',{'failureRedirect':_0x64ce('0xb'),'session':![]});passport[_0x64ce('0xc')](new GoogleStrategy({'clientID':config[_0x64ce('0x7')]?config['google'][_0x64ce('0xd')]:'id','clientSecret':config[_0x64ce('0x7')]?config[_0x64ce('0x7')]['clientSecret']:_0x64ce('0xe'),'callbackURL':config[_0x64ce('0x7')]?config[_0x64ce('0x7')]['callbackURL']:''},function(_0x417db7,_0x28fc6c,_0x1ce40c,_0x319a58){var _0xbcd998,_0x35bbca;return db[_0x64ce('0xf')][_0x64ce('0x10')]({'where':{'id':0x1},'attributes':[_0x64ce('0x11'),_0x64ce('0x12')],'raw':!![]})[_0x64ce('0x13')](function(_0x334cdb){_0xbcd998=_0x334cdb;return db[_0x64ce('0x14')][_0x64ce('0x15')]({'where':{'email':_[_0x64ce('0x16')](_0x1ce40c[_0x64ce('0x17')],'value'),'role':{'$or':[_0x64ce('0x18'),_0x64ce('0x19'),_0x64ce('0x1a')]}}});})['then'](function(_0x59e85d){_0x35bbca=_0x59e85d;if(_0x35bbca){if(_0x35bbca[_0x64ce('0x1b')]){return _0x319a58(_0x64ce('0x1c'));}else if(_0xbcd998['blockDuration']>0x0){if(_0x35bbca[_0x64ce('0x1d')]){if(moment(_0x35bbca[_0x64ce('0x1e')])[_0x64ce('0x1f')](_0xbcd998[_0x64ce('0x12')],_0x64ce('0x20'))>moment()){return _0x319a58(_0x64ce('0x1c'));}else{return utils[_0x64ce('0x21')](_0x35bbca,0x0,![],null)[_0x64ce('0x13')](function(){return utils[_0x64ce('0x22')](_0x35bbca);})[_0x64ce('0x13')](function(){return _0x319a58(null,_0x35bbca);});}}else{return utils[_0x64ce('0x22')](_0x35bbca)[_0x64ce('0x13')](function(){return _0x319a58(null,_0x35bbca);});}}else{return utils['getLicense'](_0x35bbca)['then'](function(){return _0x319a58(null,_0x35bbca);});}}return _0x319a58(_0x64ce('0x1c'));})[_0x64ce('0x23')](function(_0x501990){_0x319a58(_0x501990);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index beb758d..b2de5fb 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 _0x3f1f=['isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','login','get','/callback','callback'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x3f1f,0x1e6));var _0xf3f1=function(_0x59000f,_0x375711){_0x59000f=_0x59000f-0x0;var _0x32da60=_0x3f1f[_0x59000f];return _0x32da60;};'use strict';var express=require('express');var passport=require(_0xf3f1('0x0'));var router=express[_0xf3f1('0x1')]();var controller=require(_0xf3f1('0x2'));var userController=require(_0xf3f1('0x3'));var authService=require(_0xf3f1('0x4'));router['get']('/',controller[_0xf3f1('0x5')]);router[_0xf3f1('0x6')](_0xf3f1('0x7'),controller[_0xf3f1('0x8')],authService[_0xf3f1('0x9')],userController['login'],authService[_0xf3f1('0xa')]);module['exports']=router; \ No newline at end of file +var _0x7604=['express','passport','Router','./authGoogle.controller','get','login','callback','isMiddleware','setTokenCookie','exports'];(function(_0x39a1cf,_0x42875c){var _0x58a94f=function(_0x16f4b6){while(--_0x16f4b6){_0x39a1cf['push'](_0x39a1cf['shift']());}};_0x58a94f(++_0x42875c);}(_0x7604,0xd2));var _0x4760=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7604[_0x4565bf];return _0x5610ba;};'use strict';var express=require(_0x4760('0x0'));var passport=require(_0x4760('0x1'));var router=express[_0x4760('0x2')]();var controller=require(_0x4760('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x4760('0x4')]('/',controller[_0x4760('0x5')]);router[_0x4760('0x4')]('/callback',controller[_0x4760('0x6')],authService[_0x4760('0x7')],userController['login'],authService[_0x4760('0x8')]);module[_0x4760('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 e7781b1..7c27d3b 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 _0x9e2f=['local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','/reset/','Reset\x20Email\x20sent!','reset','User','params','securePassword','passwordHistoryLimit','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','findOne','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login'];(function(_0x48fc4e,_0x15e483){var _0x3569cc=function(_0x3eebc0){while(--_0x3eebc0){_0x48fc4e['push'](_0x48fc4e['shift']());}};_0x3569cc(++_0x15e483);}(_0x9e2f,0xc0));var _0xf9e2=function(_0x587c97,_0x27c3a2){_0x587c97=_0x587c97-0x0;var _0x4ad638=_0x9e2f[_0x587c97];return _0x4ad638;};'use strict';var util=require(_0xf9e2('0x0'));var passport=require(_0xf9e2('0x1'));var LocalStrategy=require('passport-local')[_0xf9e2('0x2')];var jayson=require(_0xf9e2('0x3'));var _=require(_0xf9e2('0x4'));var rs=require(_0xf9e2('0x5'));var moment=require(_0xf9e2('0x6'));var db=require(_0xf9e2('0x7'))['db'];var authService=require(_0xf9e2('0x8'));var utils=require(_0xf9e2('0x9'));var client=jayson[_0xf9e2('0xa')][_0xf9e2('0xb')]({'port':0x232b});function localAuthenticate(_0x2daba9,_0x1e0537,_0x13fac3,_0x23fa61){var _0x379f38,_0x1817ae;return db[_0xf9e2('0xc')]['findOne']({'where':{'id':0x1},'attributes':[_0xf9e2('0xd'),_0xf9e2('0xe')],'raw':!![]})['then'](function(_0x376d42){_0x379f38=_0x376d42;return _0x2daba9[_0xf9e2('0xf')]({'attributes':['id',_0xf9e2('0x10'),_0xf9e2('0x11'),_0xf9e2('0x12'),_0xf9e2('0x13'),_0xf9e2('0x14'),_0xf9e2('0x15'),_0xf9e2('0x16'),_0xf9e2('0x17')],'where':{'name':_0x1e0537,'role':{'$or':[_0xf9e2('0x18'),_0xf9e2('0x19'),'agent']}}});})[_0xf9e2('0x1a')](function(_0xb7eeca){if(!_0xb7eeca||_0xb7eeca&&_0xb7eeca['name']!==_0x1e0537){throw new Error(_0xf9e2('0x1b'));}else{_0x1817ae=_0xb7eeca;return _0x1817ae;}})[_0xf9e2('0x1a')](function(){_0x1817ae[_0xf9e2('0x1c')](_0x13fac3,function(_0x66d5d0,_0x3a5e6b){var _0x340d9a=_0x1817ae['loginAttempts']+0x1;if(_0x66d5d0){return _0x23fa61(_0x66d5d0);}else if(!_0x3a5e6b){if(_0x1817ae['disabled']){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}else if(_0x379f38[_0xf9e2('0xd')]>0x0){if(_0x1817ae[_0xf9e2('0x15')]){if(_0x379f38['blockDuration']>0x0){if(moment(_0x1817ae[_0xf9e2('0x16')])[_0xf9e2('0x1d')](_0x379f38['blockDuration'],_0xf9e2('0x1e'))>moment()){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}else{return utils[_0xf9e2('0x1f')](_0x1817ae,_0x340d9a,![],null)['then'](function(){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});});}}else{return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}}else{if(_0x340d9a>=_0x379f38[_0xf9e2('0xd')]){return utils[_0xf9e2('0x1f')](_0x1817ae,0x0,!![],moment())[_0xf9e2('0x1a')](function(){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});});}else{return utils['clearBlockUser'](_0x1817ae,_0x340d9a,![],null)['then'](function(){return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});});}}}else{return _0x23fa61(null,![],{'message':_0xf9e2('0x1b')});}}else{if(_0x1817ae[_0xf9e2('0x14')]){return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x379f38[_0xf9e2('0xd')]>0x0){if(_0x1817ae[_0xf9e2('0x15')]){if(_0x379f38[_0xf9e2('0xe')]>0x0){if(moment(_0x1817ae[_0xf9e2('0x16')])[_0xf9e2('0x1d')](_0x379f38[_0xf9e2('0xe')],_0xf9e2('0x1e'))>moment()){return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xf9e2('0x1f')](_0x1817ae,0x0,![],null)[_0xf9e2('0x1a')](function(){return utils[_0xf9e2('0x20')](_0x1817ae);})['then'](function(){return _0x23fa61(null,_0x1817ae);});}}else{return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xf9e2('0x1f')](_0x1817ae,0x0,![],null)[_0xf9e2('0x1a')](function(){return utils[_0xf9e2('0x20')](_0x1817ae);})[_0xf9e2('0x1a')](function(){return _0x23fa61(null,_0x1817ae);})[_0xf9e2('0x21')](function(_0x2295df){return _0x23fa61(null,![],_0x2295df);});}}else{if(_0x1817ae[_0xf9e2('0x15')]){return _0x23fa61(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x1817ae)[_0xf9e2('0x1a')](function(){return _0x23fa61(null,_0x1817ae);});}}}});})[_0xf9e2('0x21')](function(_0x302985){return _0x23fa61(null,![],_0x302985);});}function sendServiceMail(_0x5c72e4){return db[_0xf9e2('0x22')]['find']({'where':{'service':!![]},'attributes':['id',_0xf9e2('0x10'),'email'],'include':[{'model':db[_0xf9e2('0x23')],'as':_0xf9e2('0x24')}]})['then'](function(_0x97cb98){if(!_0x97cb98){throw new Error(_0xf9e2('0x25'));}var _0x2adc79={'tls':{'rejectUnauthorized':![]}};if(_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x26')]){_0x2adc79[_0xf9e2('0x26')]=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x26')];}else{_0x2adc79['host']=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x27')];_0x2adc79[_0xf9e2('0x28')]=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x28')];_0x2adc79[_0xf9e2('0x29')]=_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x29')];}if(_0x97cb98['Smtp'][_0xf9e2('0x2a')]){_0x2adc79[_0xf9e2('0x2b')]={'user':_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x19')],'pass':_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x2c')]};}var _0x336670={'account':_0x2adc79,'message':_['merge']({'from':util[_0xf9e2('0x2d')](_0xf9e2('0x2e'),_0x97cb98[_0xf9e2('0x10')],_0x97cb98[_0xf9e2('0x2f')]||_0x97cb98[_0xf9e2('0x24')][_0xf9e2('0x19')])},_0x5c72e4)};return client[_0xf9e2('0x30')](_0xf9e2('0x31'),_0x336670);})[_0xf9e2('0x1a')](function(_0x3f9489){if(_0x3f9489[_0xf9e2('0x32')]){throw new Error(util[_0xf9e2('0x2d')](_0xf9e2('0x33'),_0x3f9489['error'][_0xf9e2('0x34')]||JSON[_0xf9e2('0x35')](_0x3f9489[_0xf9e2('0x32')])));}return!![];});}function handleError(_0x2198fa,_0x5cc420,_0x4820f7){return _0x2198fa[_0xf9e2('0x36')](_0x5cc420||0x1f4)[_0xf9e2('0x37')]({'message':_0x4820f7?_0x4820f7[_0xf9e2('0x34')]||_0x4820f7:''});}exports[_0xf9e2('0x38')]=function(_0x45569e,_0x5843b7,_0x3e042f){passport['authenticate'](_0xf9e2('0x39'),function(_0x1e3cb5,_0xcd05b3,_0x2c07ae){var _0x291f34=_0x1e3cb5||_0x2c07ae;if(_0x291f34){return handleError(_0x5843b7,0x191,_0x291f34);}if(!_0xcd05b3){return handleError(_0x5843b7,0x194,{'message':_0xf9e2('0x3a')});}else{var _0x2e1d31={'payload':{'id':_0xcd05b3['id'],'role':_0xcd05b3[_0xf9e2('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xf9e2('0x3b')](_0x2e1d31)['then'](function(_0x2154c0){_0x5843b7[_0xf9e2('0x3c')]({'id':_0xcd05b3['id'],'token':_0x2154c0,'statusCall':'','isAlreadyLogged':_0xcd05b3['online']});});}})(_0x45569e,_0x5843b7,_0x3e042f);};exports[_0xf9e2('0x3d')]=function(_0x27c662,_0x645453,_0x55fc08){if(!_0x27c662[_0xf9e2('0x3e')][_0xf9e2('0x2f')]){return handleError(_0x645453,0x1f4,{'message':_0xf9e2('0x3f')});}var _0x4d98f0=rs[_0xf9e2('0x40')]();_0x27c662['body'][_0xf9e2('0x2f')]=_0x27c662[_0xf9e2('0x3e')][_0xf9e2('0x2f')][_0xf9e2('0x41')]()['toLowerCase']();var _0xe11f8d;return db[_0xf9e2('0xc')][_0xf9e2('0xf')]({'where':{'id':0x1},'attributes':[_0xf9e2('0xd'),_0xf9e2('0xe')],'raw':!![]})['then'](function(_0x188e1b){_0xe11f8d=_0x188e1b;return db['User'][_0xf9e2('0x42')]({'where':{'email':_0x27c662[_0xf9e2('0x3e')][_0xf9e2('0x2f')]}});})[_0xf9e2('0x1a')](function(_0x2eecd0){if(!_0x2eecd0){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x2eecd0[_0xf9e2('0x14')]){throw new Error(_0xf9e2('0x43'));}if(_0x2eecd0[_0xf9e2('0x15')]){if(moment(_0x2eecd0[_0xf9e2('0x16')])[_0xf9e2('0x1d')](_0xe11f8d['blockDuration'],_0xf9e2('0x1e'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2eecd0[_0xf9e2('0x15')]=![];_0x2eecd0['blockedAt']=null;}}_0x2eecd0[_0xf9e2('0x44')]=_0x4d98f0;_0x2eecd0['resetPasswordExpires']=Date[_0xf9e2('0x45')]()+0x36ee80;return _0x2eecd0[_0xf9e2('0x46')]();})[_0xf9e2('0x1a')](function(){return sendServiceMail({'to':_0x27c662['body']['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xf9e2('0x47')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xf9e2('0x48')+_0x27c662['headers'][_0xf9e2('0x27')]+_0xf9e2('0x49')+_0x4d98f0+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xf9e2('0x1a')](function(){_0x645453[_0xf9e2('0x36')](0xc8)[_0xf9e2('0x37')]({'message':_0xf9e2('0x4a')});})[_0xf9e2('0x21')](function(_0x463a15){return handleError(_0x645453,0x1f4,_0x463a15);});};exports[_0xf9e2('0x4b')]=function(_0x448d61,_0x2ca5e3,_0x30e1bb){return db[_0xf9e2('0x4c')][_0xf9e2('0x42')]({'where':{'resetPasswordToken':_0x448d61[_0xf9e2('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0xf9e2('0x45')]()}}})['then'](function(_0x58a4ba){if(!_0x58a4ba){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0xf9e2('0x4e'),'enforcePasswordHistory',_0xf9e2('0x4f')]})[_0xf9e2('0x1a')](function(_0x11c76b){if(_0x11c76b[_0xf9e2('0x4e')])authService['validatePasswordPattern'](_0x448d61[_0xf9e2('0x3e')][_0xf9e2('0x11')]);if(!_0x11c76b['enforcePasswordHistory']||!_0x58a4ba[_0xf9e2('0x50')])return _0x58a4ba;authService[_0xf9e2('0x51')](_0x448d61[_0xf9e2('0x3e')][_0xf9e2('0x11')],_0x58a4ba[_0xf9e2('0x50')],_0x11c76b[_0xf9e2('0x4f')]);return _0x58a4ba;})[_0xf9e2('0x1a')](function(){_0x58a4ba[_0xf9e2('0x11')]=_0x448d61[_0xf9e2('0x3e')][_0xf9e2('0x11')];_0x58a4ba[_0xf9e2('0x44')]=null;_0x58a4ba['resetPasswordExpires']=null;return _0x58a4ba['save']();});})['then'](function(){_0x2ca5e3['status'](0xc8)[_0xf9e2('0x37')]({'message':_0xf9e2('0x52')});})[_0xf9e2('0x21')](function(_0x3eb335){return handleError(_0x2ca5e3,0x1f4,_0x3eb335);});};passport['use'](new LocalStrategy({'usernameField':_0xf9e2('0x10'),'passwordField':_0xf9e2('0x11')},function(_0x2cc132,_0x4ec965,_0x31328d){return localAuthenticate(db[_0xf9e2('0x4c')],_0x2cc132,_0x4ec965,_0x31328d);})); \ No newline at end of file +var _0xcd53=['admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','minutes','clearBlockUser','add','catch','getLicense','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','merge','format','\x22%s\x22\x20<%s>','error','stringify','status','send','message','authenticate','local','signToken','json','body','Email\x20parameter\x20is\x20missing','generate','findOne','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts'];(function(_0xc97b2e,_0x146ff1){var _0x17f120=function(_0x8638d){while(--_0x8638d){_0xc97b2e['push'](_0xc97b2e['shift']());}};_0x17f120(++_0x146ff1);}(_0xcd53,0x8e));var _0x3cd5=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0xcd53[_0x3d5f84];return _0x1981b8;};'use strict';var util=require('util');var passport=require('passport');var LocalStrategy=require(_0x3cd5('0x0'))[_0x3cd5('0x1')];var jayson=require(_0x3cd5('0x2'));var _=require(_0x3cd5('0x3'));var rs=require('randomstring');var moment=require(_0x3cd5('0x4'));var db=require(_0x3cd5('0x5'))['db'];var authService=require(_0x3cd5('0x6'));var utils=require(_0x3cd5('0x7'));var client=jayson[_0x3cd5('0x8')][_0x3cd5('0x9')]({'port':0x232b});function localAuthenticate(_0x530022,_0xd2196f,_0x1b9ecd,_0x426cd0){var _0x46f29e,_0xbd200a;return db[_0x3cd5('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x3cd5('0xb')](function(_0x4e544c){_0x46f29e=_0x4e544c;return _0x530022['findOne']({'attributes':['id',_0x3cd5('0xc'),_0x3cd5('0xd'),_0x3cd5('0xe'),_0x3cd5('0xf'),_0x3cd5('0x10'),_0x3cd5('0x11'),_0x3cd5('0x12'),_0x3cd5('0x13')],'where':{'name':_0xd2196f,'role':{'$or':[_0x3cd5('0x14'),_0x3cd5('0x15'),_0x3cd5('0x16')]}}});})[_0x3cd5('0xb')](function(_0x5bd98a){if(!_0x5bd98a||_0x5bd98a&&_0x5bd98a[_0x3cd5('0xc')]!==_0xd2196f){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0xbd200a=_0x5bd98a;return _0xbd200a;}})[_0x3cd5('0xb')](function(){_0xbd200a['authenticate'](_0x1b9ecd,function(_0x3cf624,_0x3def28){var _0x631939=_0xbd200a['loginAttempts']+0x1;if(_0x3cf624){return _0x426cd0(_0x3cf624);}else if(!_0x3def28){if(_0xbd200a['disabled']){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else if(_0x46f29e[_0x3cd5('0x18')]>0x0){if(_0xbd200a[_0x3cd5('0x11')]){if(_0x46f29e[_0x3cd5('0x19')]>0x0){if(moment(_0xbd200a[_0x3cd5('0x12')])['add'](_0x46f29e[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,_0x631939,![],null)[_0x3cd5('0xb')](function(){return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}}else{if(_0x631939>=_0x46f29e[_0x3cd5('0x18')]){return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,!![],moment())['then'](function(){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,_0x631939,![],null)[_0x3cd5('0xb')](function(){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});});}}}else{return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0xbd200a[_0x3cd5('0x10')]){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else if(_0x46f29e[_0x3cd5('0x18')]>0x0){if(_0xbd200a[_0x3cd5('0x11')]){if(_0x46f29e[_0x3cd5('0x19')]>0x0){if(moment(_0xbd200a[_0x3cd5('0x12')])[_0x3cd5('0x1c')](_0x46f29e[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){return _0x426cd0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,![],null)[_0x3cd5('0xb')](function(){return utils['getLicense'](_0xbd200a);})[_0x3cd5('0xb')](function(){return _0x426cd0(null,_0xbd200a);});}}else{return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}}else{return utils[_0x3cd5('0x1b')](_0xbd200a,0x0,![],null)[_0x3cd5('0xb')](function(){return utils['getLicense'](_0xbd200a);})['then'](function(){return _0x426cd0(null,_0xbd200a);})[_0x3cd5('0x1d')](function(_0x43ef9e){return _0x426cd0(null,![],_0x43ef9e);});}}else{if(_0xbd200a[_0x3cd5('0x11')]){return _0x426cd0(null,![],{'message':_0x3cd5('0x17')});}else{return utils[_0x3cd5('0x1e')](_0xbd200a)[_0x3cd5('0xb')](function(){return _0x426cd0(null,_0xbd200a);});}}}});})[_0x3cd5('0x1d')](function(_0x1ffc98){return _0x426cd0(null,![],_0x1ffc98);});}function sendServiceMail(_0x27219f){return db[_0x3cd5('0x1f')][_0x3cd5('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x3cd5('0x21')],'include':[{'model':db[_0x3cd5('0x22')],'as':_0x3cd5('0x23')}]})[_0x3cd5('0xb')](function(_0x3549d0){if(!_0x3549d0){throw new Error(_0x3cd5('0x24'));}var _0x55274f={'tls':{'rejectUnauthorized':![]}};if(_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x25')]){_0x55274f[_0x3cd5('0x25')]=_0x3549d0['Smtp']['service'];}else{_0x55274f['host']=_0x3549d0['Smtp'][_0x3cd5('0x26')];_0x55274f[_0x3cd5('0x27')]=_0x3549d0[_0x3cd5('0x23')]['port'];_0x55274f[_0x3cd5('0x28')]=_0x3549d0['Smtp'][_0x3cd5('0x28')];}if(_0x3549d0['Smtp'][_0x3cd5('0x29')]){_0x55274f[_0x3cd5('0x2a')]={'user':_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x15')],'pass':_0x3549d0[_0x3cd5('0x23')]['pass']};}var _0xb2538e={'account':_0x55274f,'message':_[_0x3cd5('0x2b')]({'from':util[_0x3cd5('0x2c')](_0x3cd5('0x2d'),_0x3549d0[_0x3cd5('0xc')],_0x3549d0[_0x3cd5('0x21')]||_0x3549d0[_0x3cd5('0x23')][_0x3cd5('0x15')])},_0x27219f)};return client['request']('SendMail',_0xb2538e);})[_0x3cd5('0xb')](function(_0x30d7d7){if(_0x30d7d7[_0x3cd5('0x2e')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x30d7d7[_0x3cd5('0x2e')]['message']||JSON[_0x3cd5('0x2f')](_0x30d7d7[_0x3cd5('0x2e')])));}return!![];});}function handleError(_0x4666ab,_0x349667,_0x52cb64){return _0x4666ab[_0x3cd5('0x30')](_0x349667||0x1f4)[_0x3cd5('0x31')]({'message':_0x52cb64?_0x52cb64[_0x3cd5('0x32')]||_0x52cb64:''});}exports['login']=function(_0x12ff87,_0x4b3f55,_0x54658f){passport[_0x3cd5('0x33')](_0x3cd5('0x34'),function(_0x43bf03,_0x176bd3,_0x10cea3){var _0x1b16aa=_0x43bf03||_0x10cea3;if(_0x1b16aa){return handleError(_0x4b3f55,0x191,_0x1b16aa);}if(!_0x176bd3){return handleError(_0x4b3f55,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x3f390c={'payload':{'id':_0x176bd3['id'],'role':_0x176bd3[_0x3cd5('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x3cd5('0x35')](_0x3f390c)[_0x3cd5('0xb')](function(_0x191713){_0x4b3f55[_0x3cd5('0x36')]({'id':_0x176bd3['id'],'token':_0x191713,'statusCall':'','isAlreadyLogged':_0x176bd3['online']});});}})(_0x12ff87,_0x4b3f55,_0x54658f);};exports['forgot']=function(_0x6cbc1a,_0x4cd753,_0x586c09){if(!_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]){return handleError(_0x4cd753,0x1f4,{'message':_0x3cd5('0x38')});}var _0x389094=rs[_0x3cd5('0x39')]();_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]=_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')]['trim']()['toLowerCase']();var _0x5ea2fe;return db[_0x3cd5('0xa')][_0x3cd5('0x3a')]({'where':{'id':0x1},'attributes':[_0x3cd5('0x18'),_0x3cd5('0x19')],'raw':!![]})[_0x3cd5('0xb')](function(_0x537a6f){_0x5ea2fe=_0x537a6f;return db[_0x3cd5('0x3b')][_0x3cd5('0x20')]({'where':{'email':_0x6cbc1a[_0x3cd5('0x37')]['email']}});})[_0x3cd5('0xb')](function(_0x5db986){if(!_0x5db986){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x5db986['disabled']){throw new Error(_0x3cd5('0x3c'));}if(_0x5db986[_0x3cd5('0x11')]){if(moment(_0x5db986[_0x3cd5('0x12')])['add'](_0x5ea2fe[_0x3cd5('0x19')],_0x3cd5('0x1a'))>moment()){throw new Error(_0x3cd5('0x3d'));}else{_0x5db986[_0x3cd5('0x11')]=![];_0x5db986[_0x3cd5('0x12')]=null;}}_0x5db986[_0x3cd5('0x3e')]=_0x389094;_0x5db986['resetPasswordExpires']=Date[_0x3cd5('0x3f')]()+0x36ee80;return _0x5db986[_0x3cd5('0x40')]();})[_0x3cd5('0xb')](function(){return sendServiceMail({'to':_0x6cbc1a[_0x3cd5('0x37')][_0x3cd5('0x21')],'subject':_0x3cd5('0x41'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x3cd5('0x42')+'https://'+_0x6cbc1a['headers'][_0x3cd5('0x26')]+_0x3cd5('0x43')+_0x389094+'\x0a\x0a'+_0x3cd5('0x44')});})['then'](function(){_0x4cd753[_0x3cd5('0x30')](0xc8)[_0x3cd5('0x31')]({'message':_0x3cd5('0x45')});})['catch'](function(_0x2ff758){return handleError(_0x4cd753,0x1f4,_0x2ff758);});};exports['reset']=function(_0x136e4f,_0xd13c15,_0x4d8d23){return db[_0x3cd5('0x3b')][_0x3cd5('0x20')]({'where':{'resetPasswordToken':_0x136e4f[_0x3cd5('0x46')][_0x3cd5('0x47')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3cd5('0xb')](function(_0xeba605){if(!_0xeba605){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3cd5('0xa')][_0x3cd5('0x3a')]({'attributes':['id',_0x3cd5('0x48'),_0x3cd5('0x49'),_0x3cd5('0x4a')]})['then'](function(_0x290c3f){if(_0x290c3f['securePassword'])authService[_0x3cd5('0x4b')](_0x136e4f[_0x3cd5('0x37')][_0x3cd5('0xd')]);if(!_0x290c3f[_0x3cd5('0x49')]||!_0xeba605[_0x3cd5('0x4c')])return _0xeba605;authService[_0x3cd5('0x4d')](_0x136e4f[_0x3cd5('0x37')]['password'],_0xeba605[_0x3cd5('0x4c')],_0x290c3f[_0x3cd5('0x4a')]);return _0xeba605;})[_0x3cd5('0xb')](function(){_0xeba605[_0x3cd5('0xd')]=_0x136e4f[_0x3cd5('0x37')][_0x3cd5('0xd')];_0xeba605['resetPasswordToken']=null;_0xeba605[_0x3cd5('0x4e')]=null;return _0xeba605[_0x3cd5('0x40')]();});})['then'](function(){_0xd13c15[_0x3cd5('0x30')](0xc8)[_0x3cd5('0x31')]({'message':_0x3cd5('0x4f')});})[_0x3cd5('0x1d')](function(_0x5323a0){return handleError(_0xd13c15,0x1f4,_0x5323a0);});};passport[_0x3cd5('0x50')](new LocalStrategy({'usernameField':_0x3cd5('0xc'),'passwordField':_0x3cd5('0xd')},function(_0x593f81,_0x218226,_0x4e2dab){return localAuthenticate(db[_0x3cd5('0x3b')],_0x593f81,_0x218226,_0x4e2dab);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index c00faab..de3f997 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 _0xe244=['forgot','/reset/:token','reset','Router','./authLocal.controller','post','login','/forgot'];(function(_0x26a818,_0x40708a){var _0x5d8ca0=function(_0x3cc7ed){while(--_0x3cc7ed){_0x26a818['push'](_0x26a818['shift']());}};_0x5d8ca0(++_0x40708a);}(_0xe244,0xf3));var _0x4e24=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe244[_0x3b380d];return _0x54502b;};'use strict';var express=require('express');var router=express[_0x4e24('0x0')]();var controller=require(_0x4e24('0x1'));router[_0x4e24('0x2')]('/',controller[_0x4e24('0x3')]);router[_0x4e24('0x2')](_0x4e24('0x4'),controller[_0x4e24('0x5')]);router[_0x4e24('0x2')](_0x4e24('0x6'),controller[_0x4e24('0x7')]);module['exports']=router; \ No newline at end of file +var _0x7e3f=['post','login','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x17770f,_0x1cc11b){var _0x4dba75=function(_0x4aa697){while(--_0x4aa697){_0x17770f['push'](_0x17770f['shift']());}};_0x4dba75(++_0x1cc11b);}(_0x7e3f,0x96));var _0xf7e3=function(_0x29bfdc,_0x45b3ba){_0x29bfdc=_0x29bfdc-0x0;var _0x30eb0d=_0x7e3f[_0x29bfdc];return _0x30eb0d;};'use strict';var express=require(_0xf7e3('0x0'));var router=express[_0xf7e3('0x1')]();var controller=require(_0xf7e3('0x2'));router[_0xf7e3('0x3')]('/',controller[_0xf7e3('0x4')]);router[_0xf7e3('0x3')]('/forgot',controller[_0xf7e3('0x5')]);router['post'](_0xf7e3('0x6'),controller[_0xf7e3('0x7')]);module[_0xf7e3('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 fc7c927..a4729db 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 _0x5e3d=['sequelize','exports','STRING','INTEGER'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x5e3d,0xd0));var _0xd5e3=function(_0x3b8447,_0x5ba7cd){_0x3b8447=_0x3b8447-0x0;var _0x114837=_0x5e3d[_0x3b8447];return _0x114837;};'use strict';var Sequelize=require(_0xd5e3('0x0'));module[_0xd5e3('0x1')]={'name':{'type':Sequelize[_0xd5e3('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd5e3('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd5e3('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x5e5d=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2736e4,_0x538134){var _0x46dfc9=function(_0x2f87aa){while(--_0x2f87aa){_0x2736e4['push'](_0x2736e4['shift']());}};_0x46dfc9(++_0x538134);}(_0x5e5d,0x1e0));var _0xd5e5=function(_0x3a3489,_0x39e658){_0x3a3489=_0x3a3489-0x0;var _0x17509f=_0x5e5d[_0x3a3489];return _0x17509f;};'use strict';var Sequelize=require(_0xd5e5('0x0'));module[_0xd5e5('0x1')]={'name':{'type':Sequelize[_0xd5e5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xd5e5('0x2')]},'description':{'type':Sequelize[_0xd5e5('0x2')]},'status':{'type':Sequelize[_0xd5e5('0x3')],'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 3dc1c73..cbbc532 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 _0x368b=['lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','create','body','find','addConditions','omit','ids','findOne','Condition','length','order','pick','filter','getConditions','nolimit','addActions','getActions','Action','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x368b,0x13e));var _0xb368=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x368b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb368('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb368('0x1'));var jsonpatch=require(_0xb368('0x2'));var rp=require(_0xb368('0x3'));var moment=require(_0xb368('0x4'));var BPromise=require(_0xb368('0x5'));var Mustache=require('mustache');var util=require(_0xb368('0x6'));var path=require(_0xb368('0x7'));var sox=require('sox');var csv=require(_0xb368('0x8'));var ejs=require(_0xb368('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb368('0xa'));var squel=require('squel');var crypto=require(_0xb368('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb368('0x8'));var querystring=require('querystring');var Papa=require(_0xb368('0xc'));var Redis=require(_0xb368('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb368('0xe'));var as=require(_0xb368('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb368('0x10'))(_0xb368('0x11'));var utils=require(_0xb368('0x12'));var config=require(_0xb368('0x13'));var licenseUtil=require(_0xb368('0x14'));var db=require(_0xb368('0x15'))['db'];function respondWithStatusCode(_0x271fa3,_0x52d8ab){_0x52d8ab=_0x52d8ab||0xcc;return function(_0x966930){if(_0x966930){return _0x271fa3[_0xb368('0x16')](_0x52d8ab);}return _0x271fa3[_0xb368('0x17')](_0x52d8ab)[_0xb368('0x18')]();};}function respondWithResult(_0x39c292,_0x230c4e){_0x230c4e=_0x230c4e||0xc8;return function(_0x5f1cd7){if(_0x5f1cd7){return _0x39c292[_0xb368('0x17')](_0x230c4e)[_0xb368('0x19')](_0x5f1cd7);}};}function respondWithFilteredResult(_0x2de173,_0x3e49a3){return function(_0x2f5b6b){if(_0x2f5b6b){var _0x3f64b0=typeof _0x3e49a3['offset']===_0xb368('0x1a')&&typeof _0x3e49a3[_0xb368('0x1b')]===_0xb368('0x1a');var _0x5c6aad=_0x2f5b6b[_0xb368('0x1c')];var _0x42167c=_0x3f64b0?0x0:_0x3e49a3[_0xb368('0x1d')];var _0x5439b3=_0x3f64b0?_0x2f5b6b[_0xb368('0x1c')]:_0x3e49a3[_0xb368('0x1d')]+_0x3e49a3[_0xb368('0x1b')];var _0x482c96;if(_0x5439b3>=_0x5c6aad){_0x5439b3=_0x5c6aad;_0x482c96=0xc8;}else{_0x482c96=0xce;}_0x2de173['status'](_0x482c96);return _0x2de173[_0xb368('0x1e')]('Content-Range',_0x42167c+'-'+_0x5439b3+'/'+_0x5c6aad)[_0xb368('0x19')](_0x2f5b6b);}return null;};}function patchUpdates(_0x478512){return function(_0x1b2471){try{jsonpatch['apply'](_0x1b2471,_0x478512,!![]);}catch(_0x30bfa4){return BPromise['reject'](_0x30bfa4);}return _0x1b2471[_0xb368('0x1f')]();};}function saveUpdates(_0x13baca,_0x1e8f60){return function(_0x40b775){if(_0x40b775){return _0x40b775[_0xb368('0x20')](_0x13baca)[_0xb368('0x21')](function(_0x1f0a98){return _0x1f0a98;});}return null;};}function removeEntity(_0x33e9ea,_0x2c3649){return function(_0x363c0b){if(_0x363c0b){return _0x363c0b[_0xb368('0x22')]()[_0xb368('0x21')](function(){_0x33e9ea[_0xb368('0x17')](0xcc)[_0xb368('0x18')]();});}};}function handleEntityNotFound(_0x455999,_0x5548ba){return function(_0x846f44){if(!_0x846f44){_0x455999[_0xb368('0x16')](0x194);}return _0x846f44;};}function handleError(_0x241bc1,_0x58eeca){_0x58eeca=_0x58eeca||0x1f4;return function(_0x5a547b){logger[_0xb368('0x23')](_0x5a547b[_0xb368('0x24')]);if(_0x5a547b['name']){delete _0x5a547b[_0xb368('0x25')];}_0x241bc1[_0xb368('0x17')](_0x58eeca)[_0xb368('0x26')](_0x5a547b);};}exports[_0xb368('0x27')]=function(_0x483b4b,_0x41d847){var _0x1f3784={},_0x23cf43={},_0x18b3a6={'count':0x0,'rows':[]};var _0x5796f5=_[_0xb368('0x28')](db[_0xb368('0x29')][_0xb368('0x2a')],function(_0x499e35){return{'name':_0x499e35[_0xb368('0x2b')],'type':_0x499e35[_0xb368('0x2c')][_0xb368('0x2d')]};});_0x23cf43[_0xb368('0x2e')]=_['map'](_0x5796f5,_0xb368('0x25'));_0x23cf43[_0xb368('0x2f')]=_[_0xb368('0x30')](_0x483b4b[_0xb368('0x2f')]);_0x23cf43['filters']=_['intersection'](_0x23cf43[_0xb368('0x2e')],_0x23cf43[_0xb368('0x2f')]);_0x1f3784[_0xb368('0x31')]=_[_0xb368('0x32')](_0x23cf43[_0xb368('0x2e')],qs[_0xb368('0x33')](_0x483b4b['query']['fields']));_0x1f3784[_0xb368('0x31')]=_0x1f3784['attributes']['length']?_0x1f3784[_0xb368('0x31')]:_0x23cf43[_0xb368('0x2e')];if(!_0x483b4b[_0xb368('0x2f')][_0xb368('0x34')]('nolimit')){_0x1f3784[_0xb368('0x1b')]=qs['limit'](_0x483b4b['query']['limit']);_0x1f3784[_0xb368('0x1d')]=qs['offset'](_0x483b4b['query'][_0xb368('0x1d')]);}_0x1f3784['order']=qs[_0xb368('0x35')](_0x483b4b[_0xb368('0x2f')][_0xb368('0x35')]);_0x1f3784[_0xb368('0x36')]=qs[_0xb368('0x37')](_['pick'](_0x483b4b[_0xb368('0x2f')],_0x23cf43[_0xb368('0x37')]),_0x5796f5);if(_0x483b4b[_0xb368('0x2f')]['filter']){_0x1f3784[_0xb368('0x36')]=_[_0xb368('0x38')](_0x1f3784[_0xb368('0x36')],{'$or':_['map'](_0x5796f5,function(_0xd7f605){if(_0xd7f605['type']!==_0xb368('0x39')){var _0x3ef515={};_0x3ef515[_0xd7f605['name']]={'$like':'%'+_0x483b4b['query']['filter']+'%'};return _0x3ef515;}})});}_0x1f3784=_[_0xb368('0x38')]({},_0x1f3784,_0x483b4b['options']);var _0x22aa13={'where':_0x1f3784[_0xb368('0x36')]};return db[_0xb368('0x29')][_0xb368('0x1c')](_0x22aa13)['then'](function(_0x41ca55){_0x18b3a6[_0xb368('0x1c')]=_0x41ca55;if(_0x483b4b[_0xb368('0x2f')][_0xb368('0x3a')]){_0x1f3784[_0xb368('0x3b')]=[{'all':!![]}];}return db[_0xb368('0x29')][_0xb368('0x3c')](_0x1f3784);})[_0xb368('0x21')](function(_0x4779dc){_0x18b3a6[_0xb368('0x3d')]=_0x4779dc;return _0x18b3a6;})[_0xb368('0x21')](respondWithFilteredResult(_0x41d847,_0x1f3784))[_0xb368('0x3e')](handleError(_0x41d847,null));};exports['show']=function(_0x3e2c5a,_0x44702d){var _0x4c83df={'raw':![],'where':{'id':_0x3e2c5a[_0xb368('0x3f')]['id']}},_0x41c42a={};_0x41c42a['model']=_[_0xb368('0x30')](db[_0xb368('0x29')]['rawAttributes']);_0x41c42a[_0xb368('0x2f')]=_[_0xb368('0x30')](_0x3e2c5a[_0xb368('0x2f')]);_0x41c42a[_0xb368('0x37')]=_[_0xb368('0x32')](_0x41c42a[_0xb368('0x2e')],_0x41c42a['query']);_0x4c83df[_0xb368('0x31')]=_[_0xb368('0x32')](_0x41c42a[_0xb368('0x2e')],qs[_0xb368('0x33')](_0x3e2c5a['query'][_0xb368('0x33')]));_0x4c83df[_0xb368('0x31')]=_0x4c83df[_0xb368('0x31')]['length']?_0x4c83df[_0xb368('0x31')]:_0x41c42a['model'];if(_0x3e2c5a['query'][_0xb368('0x3a')]){_0x4c83df[_0xb368('0x3b')]=[{'all':!![]}];}_0x4c83df=_['merge']({},_0x4c83df,_0x3e2c5a[_0xb368('0x40')]);return db[_0xb368('0x29')]['find'](_0x4c83df)[_0xb368('0x21')](handleEntityNotFound(_0x44702d,null))[_0xb368('0x21')](respondWithResult(_0x44702d,null))[_0xb368('0x3e')](handleError(_0x44702d,null));};exports[_0xb368('0x41')]=function(_0x58486c,_0x337edd){return db['Automation'][_0xb368('0x41')](_0x58486c[_0xb368('0x42')],{})['then'](respondWithResult(_0x337edd,0xc9))[_0xb368('0x3e')](handleError(_0x337edd,null));};exports[_0xb368('0x20')]=function(_0x4d22bc,_0x36395e){if(_0x4d22bc[_0xb368('0x42')]['id']){delete _0x4d22bc[_0xb368('0x42')]['id'];}return db[_0xb368('0x29')][_0xb368('0x43')]({'where':{'id':_0x4d22bc[_0xb368('0x3f')]['id']}})['then'](handleEntityNotFound(_0x36395e,null))[_0xb368('0x21')](saveUpdates(_0x4d22bc[_0xb368('0x42')],null))[_0xb368('0x21')](respondWithResult(_0x36395e,null))[_0xb368('0x3e')](handleError(_0x36395e,null));};exports[_0xb368('0x22')]=function(_0xf181e9,_0x497890){return db[_0xb368('0x29')]['find']({'where':{'id':_0xf181e9[_0xb368('0x3f')]['id']}})['then'](handleEntityNotFound(_0x497890,null))['then'](removeEntity(_0x497890,null))[_0xb368('0x3e')](handleError(_0x497890,null));};exports[_0xb368('0x44')]=function(_0x59c15d,_0x3fb5bc,_0x31cfd6){return db['Condition'][_0xb368('0x43')]({'where':{'id':_0x59c15d[_0xb368('0x3f')]['id']}})[_0xb368('0x21')](handleEntityNotFound(_0x3fb5bc,null))[_0xb368('0x21')](function(_0x278c9b){if(_0x278c9b){return _0x278c9b[_0xb368('0x44')](_0x59c15d[_0xb368('0x42')]['ids'],_[_0xb368('0x45')](_0x59c15d[_0xb368('0x42')],[_0xb368('0x46'),'id'])||{});}})[_0xb368('0x21')](respondWithResult(_0x3fb5bc,null))[_0xb368('0x3e')](handleError(_0x3fb5bc,null));};exports['getConditions']=function(_0x39c005,_0x448a07,_0x3d6f83){var _0x2df1a9={};var _0x303af7={};var _0x3d64fc;var _0x1965bc;return db[_0xb368('0x29')][_0xb368('0x47')]({'where':{'id':_0x39c005[_0xb368('0x3f')]['id']}})[_0xb368('0x21')](handleEntityNotFound(_0x448a07,null))['then'](function(_0x4145b6){if(_0x4145b6){_0x3d64fc=_0x4145b6;_0x303af7[_0xb368('0x2e')]=_[_0xb368('0x30')](db[_0xb368('0x48')][_0xb368('0x2a')]);_0x303af7[_0xb368('0x2f')]=_[_0xb368('0x30')](_0x39c005[_0xb368('0x2f')]);_0x303af7[_0xb368('0x37')]=_[_0xb368('0x32')](_0x303af7['model'],_0x303af7[_0xb368('0x2f')]);_0x2df1a9[_0xb368('0x31')]=_['intersection'](_0x303af7['model'],qs[_0xb368('0x33')](_0x39c005[_0xb368('0x2f')][_0xb368('0x33')]));_0x2df1a9[_0xb368('0x31')]=_0x2df1a9[_0xb368('0x31')][_0xb368('0x49')]?_0x2df1a9['attributes']:_0x303af7[_0xb368('0x2e')];_0x2df1a9[_0xb368('0x4a')]=qs[_0xb368('0x35')](_0x39c005['query'][_0xb368('0x35')]);_0x2df1a9[_0xb368('0x36')]=qs[_0xb368('0x37')](_[_0xb368('0x4b')](_0x39c005[_0xb368('0x2f')],_0x303af7[_0xb368('0x37')]));if(_0x39c005[_0xb368('0x2f')][_0xb368('0x4c')]){_0x2df1a9[_0xb368('0x36')]=_[_0xb368('0x38')](_0x2df1a9['where'],{'$or':_[_0xb368('0x28')](_0x2df1a9['attributes'],function(_0x3c7f5b){var _0x560fcd={};_0x560fcd[_0x3c7f5b]={'$like':'%'+_0x39c005[_0xb368('0x2f')]['filter']+'%'};return _0x560fcd;})});}_0x2df1a9=_['merge']({},_0x2df1a9,_0x39c005[_0xb368('0x40')]);return _0x3d64fc[_0xb368('0x4d')](_0x2df1a9);}})['then'](function(_0x1b2ad7){if(_0x1b2ad7){_0x1965bc=_0x1b2ad7[_0xb368('0x49')];if(!_0x39c005[_0xb368('0x2f')][_0xb368('0x34')](_0xb368('0x4e'))){_0x2df1a9[_0xb368('0x1b')]=qs[_0xb368('0x1b')](_0x39c005['query'][_0xb368('0x1b')]);_0x2df1a9[_0xb368('0x1d')]=qs['offset'](_0x39c005[_0xb368('0x2f')][_0xb368('0x1d')]);}return _0x3d64fc[_0xb368('0x4d')](_0x2df1a9);}})['then'](function(_0xf227ef){if(_0xf227ef){return _0xf227ef?{'count':_0x1965bc,'rows':_0xf227ef}:null;}})['then'](respondWithResult(_0x448a07,null))[_0xb368('0x3e')](handleError(_0x448a07,null));};exports[_0xb368('0x4f')]=function(_0xea4030,_0x56322d,_0x173642){return db['Action']['find']({'where':{'id':_0xea4030[_0xb368('0x3f')]['id']}})['then'](handleEntityNotFound(_0x56322d,null))[_0xb368('0x21')](function(_0x2d3116){if(_0x2d3116){return _0x2d3116[_0xb368('0x4f')](_0xea4030[_0xb368('0x42')][_0xb368('0x46')],_['omit'](_0xea4030[_0xb368('0x42')],[_0xb368('0x46'),'id'])||{});}})[_0xb368('0x21')](respondWithResult(_0x56322d,null))[_0xb368('0x3e')](handleError(_0x56322d,null));};exports[_0xb368('0x50')]=function(_0x30d1fb,_0x83f8fd,_0x33f42c){var _0x4657f0={};var _0x193fe5={};var _0x4cca20;var _0x543e2b;return db['Automation'][_0xb368('0x47')]({'where':{'id':_0x30d1fb[_0xb368('0x3f')]['id']}})[_0xb368('0x21')](handleEntityNotFound(_0x83f8fd,null))[_0xb368('0x21')](function(_0x186b06){if(_0x186b06){_0x4cca20=_0x186b06;_0x193fe5[_0xb368('0x2e')]=_[_0xb368('0x30')](db[_0xb368('0x51')][_0xb368('0x2a')]);_0x193fe5['query']=_[_0xb368('0x30')](_0x30d1fb['query']);_0x193fe5[_0xb368('0x37')]=_[_0xb368('0x32')](_0x193fe5[_0xb368('0x2e')],_0x193fe5[_0xb368('0x2f')]);_0x4657f0[_0xb368('0x31')]=_[_0xb368('0x32')](_0x193fe5[_0xb368('0x2e')],qs['fields'](_0x30d1fb[_0xb368('0x2f')][_0xb368('0x33')]));_0x4657f0[_0xb368('0x31')]=_0x4657f0['attributes'][_0xb368('0x49')]?_0x4657f0['attributes']:_0x193fe5[_0xb368('0x2e')];_0x4657f0[_0xb368('0x4a')]=qs[_0xb368('0x35')](_0x30d1fb[_0xb368('0x2f')][_0xb368('0x35')]);_0x4657f0[_0xb368('0x36')]=qs[_0xb368('0x37')](_['pick'](_0x30d1fb[_0xb368('0x2f')],_0x193fe5['filters']));if(_0x30d1fb['query'][_0xb368('0x4c')]){_0x4657f0[_0xb368('0x36')]=_[_0xb368('0x38')](_0x4657f0[_0xb368('0x36')],{'$or':_[_0xb368('0x28')](_0x4657f0[_0xb368('0x31')],function(_0x27e1a8){var _0x2d3adf={};_0x2d3adf[_0x27e1a8]={'$like':'%'+_0x30d1fb[_0xb368('0x2f')]['filter']+'%'};return _0x2d3adf;})});}_0x4657f0=_['merge']({},_0x4657f0,_0x30d1fb['options']);return _0x4cca20[_0xb368('0x50')](_0x4657f0);}})[_0xb368('0x21')](function(_0x5a66d5){if(_0x5a66d5){_0x543e2b=_0x5a66d5[_0xb368('0x49')];if(!_0x30d1fb[_0xb368('0x2f')][_0xb368('0x34')](_0xb368('0x4e'))){_0x4657f0[_0xb368('0x1b')]=qs[_0xb368('0x1b')](_0x30d1fb['query'][_0xb368('0x1b')]);_0x4657f0[_0xb368('0x1d')]=qs['offset'](_0x30d1fb[_0xb368('0x2f')]['offset']);}return _0x4cca20[_0xb368('0x50')](_0x4657f0);}})[_0xb368('0x21')](function(_0x5dab9e){if(_0x5dab9e){return _0x5dab9e?{'count':_0x543e2b,'rows':_0x5dab9e}:null;}})['then'](respondWithResult(_0x83f8fd,null))['catch'](handleError(_0x83f8fd,null));}; \ No newline at end of file +var _0x95d4=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','addConditions','Condition','findOne','getConditions','hasOwnProperty','addActions','Action','ids','getActions','eml-format'];(function(_0x21f3bf,_0xfb0f59){var _0x249d08=function(_0x37e6c2){while(--_0x37e6c2){_0x21f3bf['push'](_0x21f3bf['shift']());}};_0x249d08(++_0xfb0f59);}(_0x95d4,0x1e5));var _0x495d=function(_0x52dfa5,_0x3908fd){_0x52dfa5=_0x52dfa5-0x0;var _0x1eaf0b=_0x95d4[_0x52dfa5];return _0x1eaf0b;};'use strict';var emlformat=require(_0x495d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x495d('0x1'));var jsonpatch=require(_0x495d('0x2'));var rp=require(_0x495d('0x3'));var moment=require(_0x495d('0x4'));var BPromise=require(_0x495d('0x5'));var Mustache=require(_0x495d('0x6'));var util=require('util');var path=require(_0x495d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x495d('0x8'));var _=require(_0x495d('0x9'));var squel=require(_0x495d('0xa'));var crypto=require(_0x495d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x495d('0xc'));var toCsv=require(_0x495d('0xd'));var querystring=require(_0x495d('0xe'));var Papa=require(_0x495d('0xf'));var Redis=require(_0x495d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x495d('0x11'));var hardwareService=require(_0x495d('0x12'));var logger=require('../../config/logger')(_0x495d('0x13'));var utils=require(_0x495d('0x14'));var config=require(_0x495d('0x15'));var licenseUtil=require(_0x495d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a284d,_0x101459){_0x101459=_0x101459||0xcc;return function(_0x189ac4){if(_0x189ac4){return _0x3a284d['sendStatus'](_0x101459);}return _0x3a284d[_0x495d('0x17')](_0x101459)['end']();};}function respondWithResult(_0x269961,_0x193e0d){_0x193e0d=_0x193e0d||0xc8;return function(_0x5aacb1){if(_0x5aacb1){return _0x269961[_0x495d('0x17')](_0x193e0d)['json'](_0x5aacb1);}};}function respondWithFilteredResult(_0x3f513f,_0x1e81e3){return function(_0x346f84){if(_0x346f84){var _0xdfe913=typeof _0x1e81e3['offset']===_0x495d('0x18')&&typeof _0x1e81e3['limit']==='undefined';var _0xaa335b=_0x346f84[_0x495d('0x19')];var _0x2a524e=_0xdfe913?0x0:_0x1e81e3[_0x495d('0x1a')];var _0x12cd06=_0xdfe913?_0x346f84[_0x495d('0x19')]:_0x1e81e3[_0x495d('0x1a')]+_0x1e81e3['limit'];var _0x4beced;if(_0x12cd06>=_0xaa335b){_0x12cd06=_0xaa335b;_0x4beced=0xc8;}else{_0x4beced=0xce;}_0x3f513f[_0x495d('0x17')](_0x4beced);return _0x3f513f[_0x495d('0x1b')](_0x495d('0x1c'),_0x2a524e+'-'+_0x12cd06+'/'+_0xaa335b)['json'](_0x346f84);}return null;};}function patchUpdates(_0xb69183){return function(_0x1dade7){try{jsonpatch[_0x495d('0x1d')](_0x1dade7,_0xb69183,!![]);}catch(_0x4fc5a3){return BPromise[_0x495d('0x1e')](_0x4fc5a3);}return _0x1dade7[_0x495d('0x1f')]();};}function saveUpdates(_0x294530,_0x36c5ff){return function(_0x31f2a3){if(_0x31f2a3){return _0x31f2a3[_0x495d('0x20')](_0x294530)[_0x495d('0x21')](function(_0x3e3321){return _0x3e3321;});}return null;};}function removeEntity(_0x13d2da,_0x48dfe3){return function(_0x53789e){if(_0x53789e){return _0x53789e[_0x495d('0x22')]()['then'](function(){_0x13d2da[_0x495d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fd2e4,_0x344986){return function(_0x153ea6){if(!_0x153ea6){_0x2fd2e4[_0x495d('0x23')](0x194);}return _0x153ea6;};}function handleError(_0x589348,_0x2e3ac4){_0x2e3ac4=_0x2e3ac4||0x1f4;return function(_0xc33034){logger[_0x495d('0x24')](_0xc33034[_0x495d('0x25')]);if(_0xc33034[_0x495d('0x26')]){delete _0xc33034[_0x495d('0x26')];}_0x589348[_0x495d('0x17')](_0x2e3ac4)['send'](_0xc33034);};}exports[_0x495d('0x27')]=function(_0x25e69e,_0x44f25c){var _0x1ea8bf={},_0x34129f={},_0x6d08f5={'count':0x0,'rows':[]};var _0xd94213=_[_0x495d('0x28')](db[_0x495d('0x29')][_0x495d('0x2a')],function(_0x108bc0){return{'name':_0x108bc0['fieldName'],'type':_0x108bc0[_0x495d('0x2b')][_0x495d('0x2c')]};});_0x34129f[_0x495d('0x2d')]=_[_0x495d('0x28')](_0xd94213,_0x495d('0x26'));_0x34129f[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x25e69e[_0x495d('0x2e')]);_0x34129f[_0x495d('0x30')]=_[_0x495d('0x31')](_0x34129f[_0x495d('0x2d')],_0x34129f[_0x495d('0x2e')]);_0x1ea8bf[_0x495d('0x32')]=_[_0x495d('0x31')](_0x34129f[_0x495d('0x2d')],qs[_0x495d('0x33')](_0x25e69e['query']['fields']));_0x1ea8bf[_0x495d('0x32')]=_0x1ea8bf[_0x495d('0x32')]['length']?_0x1ea8bf[_0x495d('0x32')]:_0x34129f['model'];if(!_0x25e69e[_0x495d('0x2e')]['hasOwnProperty'](_0x495d('0x34'))){_0x1ea8bf[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x25e69e[_0x495d('0x2e')][_0x495d('0x35')]);_0x1ea8bf[_0x495d('0x1a')]=qs[_0x495d('0x1a')](_0x25e69e['query']['offset']);}_0x1ea8bf[_0x495d('0x36')]=qs[_0x495d('0x37')](_0x25e69e[_0x495d('0x2e')][_0x495d('0x37')]);_0x1ea8bf[_0x495d('0x38')]=qs[_0x495d('0x30')](_[_0x495d('0x39')](_0x25e69e[_0x495d('0x2e')],_0x34129f['filters']),_0xd94213);if(_0x25e69e[_0x495d('0x2e')][_0x495d('0x3a')]){_0x1ea8bf[_0x495d('0x38')]=_['merge'](_0x1ea8bf[_0x495d('0x38')],{'$or':_['map'](_0xd94213,function(_0x59c851){if(_0x59c851[_0x495d('0x2b')]!==_0x495d('0x3b')){var _0x36da17={};_0x36da17[_0x59c851[_0x495d('0x26')]]={'$like':'%'+_0x25e69e[_0x495d('0x2e')]['filter']+'%'};return _0x36da17;}})});}_0x1ea8bf=_[_0x495d('0x3c')]({},_0x1ea8bf,_0x25e69e[_0x495d('0x3d')]);var _0x30a790={'where':_0x1ea8bf[_0x495d('0x38')]};return db[_0x495d('0x29')][_0x495d('0x19')](_0x30a790)[_0x495d('0x21')](function(_0x588aae){_0x6d08f5[_0x495d('0x19')]=_0x588aae;if(_0x25e69e[_0x495d('0x2e')][_0x495d('0x3e')]){_0x1ea8bf[_0x495d('0x3f')]=[{'all':!![]}];}return db[_0x495d('0x29')]['findAll'](_0x1ea8bf);})[_0x495d('0x21')](function(_0x127c73){_0x6d08f5[_0x495d('0x40')]=_0x127c73;return _0x6d08f5;})[_0x495d('0x21')](respondWithFilteredResult(_0x44f25c,_0x1ea8bf))[_0x495d('0x41')](handleError(_0x44f25c,null));};exports[_0x495d('0x42')]=function(_0x46a8dd,_0x242e0d){var _0x4273b={'raw':![],'where':{'id':_0x46a8dd[_0x495d('0x43')]['id']}},_0x1e0669={};_0x1e0669[_0x495d('0x2d')]=_[_0x495d('0x2f')](db[_0x495d('0x29')][_0x495d('0x2a')]);_0x1e0669[_0x495d('0x2e')]=_['keys'](_0x46a8dd[_0x495d('0x2e')]);_0x1e0669[_0x495d('0x30')]=_[_0x495d('0x31')](_0x1e0669[_0x495d('0x2d')],_0x1e0669[_0x495d('0x2e')]);_0x4273b[_0x495d('0x32')]=_[_0x495d('0x31')](_0x1e0669['model'],qs[_0x495d('0x33')](_0x46a8dd[_0x495d('0x2e')][_0x495d('0x33')]));_0x4273b['attributes']=_0x4273b[_0x495d('0x32')][_0x495d('0x44')]?_0x4273b[_0x495d('0x32')]:_0x1e0669[_0x495d('0x2d')];if(_0x46a8dd[_0x495d('0x2e')][_0x495d('0x3e')]){_0x4273b[_0x495d('0x3f')]=[{'all':!![]}];}_0x4273b=_[_0x495d('0x3c')]({},_0x4273b,_0x46a8dd['options']);return db[_0x495d('0x29')][_0x495d('0x45')](_0x4273b)[_0x495d('0x21')](handleEntityNotFound(_0x242e0d,null))['then'](respondWithResult(_0x242e0d,null))[_0x495d('0x41')](handleError(_0x242e0d,null));};exports[_0x495d('0x46')]=function(_0x5b60a3,_0x51f6c9){return db[_0x495d('0x29')]['create'](_0x5b60a3[_0x495d('0x47')],{})[_0x495d('0x21')](respondWithResult(_0x51f6c9,0xc9))[_0x495d('0x41')](handleError(_0x51f6c9,null));};exports['update']=function(_0x38c950,_0x43c815){if(_0x38c950[_0x495d('0x47')]['id']){delete _0x38c950[_0x495d('0x47')]['id'];}return db[_0x495d('0x29')]['find']({'where':{'id':_0x38c950[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x43c815,null))[_0x495d('0x21')](saveUpdates(_0x38c950[_0x495d('0x47')],null))[_0x495d('0x21')](respondWithResult(_0x43c815,null))['catch'](handleError(_0x43c815,null));};exports['destroy']=function(_0x272615,_0x29e1ed){return db[_0x495d('0x29')][_0x495d('0x45')]({'where':{'id':_0x272615['params']['id']}})['then'](handleEntityNotFound(_0x29e1ed,null))[_0x495d('0x21')](removeEntity(_0x29e1ed,null))[_0x495d('0x41')](handleError(_0x29e1ed,null));};exports[_0x495d('0x48')]=function(_0x2ca00d,_0x4624b3,_0x43dcc1){return db[_0x495d('0x49')][_0x495d('0x45')]({'where':{'id':_0x2ca00d[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x4624b3,null))[_0x495d('0x21')](function(_0x204a0b){if(_0x204a0b){return _0x204a0b[_0x495d('0x48')](_0x2ca00d[_0x495d('0x47')]['ids'],_['omit'](_0x2ca00d[_0x495d('0x47')],['ids','id'])||{});}})[_0x495d('0x21')](respondWithResult(_0x4624b3,null))[_0x495d('0x41')](handleError(_0x4624b3,null));};exports['getConditions']=function(_0x2544e6,_0x40c549,_0x28e756){var _0x5e9f5c={};var _0x5ab855={};var _0x5e1d8b;var _0x217767;return db[_0x495d('0x29')][_0x495d('0x4a')]({'where':{'id':_0x2544e6['params']['id']}})['then'](handleEntityNotFound(_0x40c549,null))[_0x495d('0x21')](function(_0x340158){if(_0x340158){_0x5e1d8b=_0x340158;_0x5ab855[_0x495d('0x2d')]=_[_0x495d('0x2f')](db[_0x495d('0x49')][_0x495d('0x2a')]);_0x5ab855[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x2544e6[_0x495d('0x2e')]);_0x5ab855[_0x495d('0x30')]=_[_0x495d('0x31')](_0x5ab855[_0x495d('0x2d')],_0x5ab855[_0x495d('0x2e')]);_0x5e9f5c[_0x495d('0x32')]=_['intersection'](_0x5ab855['model'],qs['fields'](_0x2544e6[_0x495d('0x2e')][_0x495d('0x33')]));_0x5e9f5c[_0x495d('0x32')]=_0x5e9f5c[_0x495d('0x32')][_0x495d('0x44')]?_0x5e9f5c[_0x495d('0x32')]:_0x5ab855[_0x495d('0x2d')];_0x5e9f5c[_0x495d('0x36')]=qs[_0x495d('0x37')](_0x2544e6['query'][_0x495d('0x37')]);_0x5e9f5c[_0x495d('0x38')]=qs['filters'](_[_0x495d('0x39')](_0x2544e6['query'],_0x5ab855[_0x495d('0x30')]));if(_0x2544e6[_0x495d('0x2e')][_0x495d('0x3a')]){_0x5e9f5c['where']=_['merge'](_0x5e9f5c[_0x495d('0x38')],{'$or':_[_0x495d('0x28')](_0x5e9f5c[_0x495d('0x32')],function(_0x1ed53b){var _0x1851a8={};_0x1851a8[_0x1ed53b]={'$like':'%'+_0x2544e6[_0x495d('0x2e')]['filter']+'%'};return _0x1851a8;})});}_0x5e9f5c=_[_0x495d('0x3c')]({},_0x5e9f5c,_0x2544e6[_0x495d('0x3d')]);return _0x5e1d8b[_0x495d('0x4b')](_0x5e9f5c);}})[_0x495d('0x21')](function(_0x5dbf7b){if(_0x5dbf7b){_0x217767=_0x5dbf7b[_0x495d('0x44')];if(!_0x2544e6[_0x495d('0x2e')][_0x495d('0x4c')]('nolimit')){_0x5e9f5c[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x2544e6[_0x495d('0x2e')][_0x495d('0x35')]);_0x5e9f5c[_0x495d('0x1a')]=qs[_0x495d('0x1a')](_0x2544e6[_0x495d('0x2e')][_0x495d('0x1a')]);}return _0x5e1d8b[_0x495d('0x4b')](_0x5e9f5c);}})['then'](function(_0x1df59a){if(_0x1df59a){return _0x1df59a?{'count':_0x217767,'rows':_0x1df59a}:null;}})[_0x495d('0x21')](respondWithResult(_0x40c549,null))[_0x495d('0x41')](handleError(_0x40c549,null));};exports[_0x495d('0x4d')]=function(_0x195427,_0x149d46,_0x1cadd2){return db[_0x495d('0x4e')][_0x495d('0x45')]({'where':{'id':_0x195427[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x149d46,null))['then'](function(_0x3cfd4f){if(_0x3cfd4f){return _0x3cfd4f[_0x495d('0x4d')](_0x195427[_0x495d('0x47')]['ids'],_['omit'](_0x195427[_0x495d('0x47')],[_0x495d('0x4f'),'id'])||{});}})[_0x495d('0x21')](respondWithResult(_0x149d46,null))['catch'](handleError(_0x149d46,null));};exports[_0x495d('0x50')]=function(_0x2719e1,_0x4bf044,_0x49fd66){var _0x33d8b1={};var _0x1f25a0={};var _0xa5b976;var _0x4da161;return db[_0x495d('0x29')][_0x495d('0x4a')]({'where':{'id':_0x2719e1[_0x495d('0x43')]['id']}})[_0x495d('0x21')](handleEntityNotFound(_0x4bf044,null))[_0x495d('0x21')](function(_0x4a2506){if(_0x4a2506){_0xa5b976=_0x4a2506;_0x1f25a0['model']=_['keys'](db['Action'][_0x495d('0x2a')]);_0x1f25a0[_0x495d('0x2e')]=_[_0x495d('0x2f')](_0x2719e1[_0x495d('0x2e')]);_0x1f25a0[_0x495d('0x30')]=_['intersection'](_0x1f25a0[_0x495d('0x2d')],_0x1f25a0[_0x495d('0x2e')]);_0x33d8b1[_0x495d('0x32')]=_[_0x495d('0x31')](_0x1f25a0[_0x495d('0x2d')],qs[_0x495d('0x33')](_0x2719e1['query'][_0x495d('0x33')]));_0x33d8b1['attributes']=_0x33d8b1[_0x495d('0x32')]['length']?_0x33d8b1[_0x495d('0x32')]:_0x1f25a0[_0x495d('0x2d')];_0x33d8b1[_0x495d('0x36')]=qs['sort'](_0x2719e1['query'][_0x495d('0x37')]);_0x33d8b1[_0x495d('0x38')]=qs[_0x495d('0x30')](_['pick'](_0x2719e1[_0x495d('0x2e')],_0x1f25a0[_0x495d('0x30')]));if(_0x2719e1[_0x495d('0x2e')][_0x495d('0x3a')]){_0x33d8b1[_0x495d('0x38')]=_[_0x495d('0x3c')](_0x33d8b1['where'],{'$or':_[_0x495d('0x28')](_0x33d8b1[_0x495d('0x32')],function(_0x2835c7){var _0x12cf10={};_0x12cf10[_0x2835c7]={'$like':'%'+_0x2719e1['query'][_0x495d('0x3a')]+'%'};return _0x12cf10;})});}_0x33d8b1=_[_0x495d('0x3c')]({},_0x33d8b1,_0x2719e1[_0x495d('0x3d')]);return _0xa5b976['getActions'](_0x33d8b1);}})[_0x495d('0x21')](function(_0x1fcbeb){if(_0x1fcbeb){_0x4da161=_0x1fcbeb['length'];if(!_0x2719e1[_0x495d('0x2e')][_0x495d('0x4c')](_0x495d('0x34'))){_0x33d8b1[_0x495d('0x35')]=qs[_0x495d('0x35')](_0x2719e1[_0x495d('0x2e')]['limit']);_0x33d8b1['offset']=qs[_0x495d('0x1a')](_0x2719e1['query']['offset']);}return _0xa5b976['getActions'](_0x33d8b1);}})[_0x495d('0x21')](function(_0x1082c3){if(_0x1082c3){return _0x1082c3?{'count':_0x4da161,'rows':_0x1082c3}:null;}})[_0x495d('0x21')](respondWithResult(_0x4bf044,null))[_0x495d('0x41')](handleError(_0x4bf044,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 1c3bbd1..9e27ed5 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 _0x8774=['define','tools_automations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8774,0x146));var _0x4877=function(_0x59681a,_0x187572){_0x59681a=_0x59681a-0x0;var _0x1e5741=_0x8774[_0x59681a];return _0x1e5741;};'use strict';var _=require(_0x4877('0x0'));var util=require(_0x4877('0x1'));var logger=require(_0x4877('0x2'))('api');var moment=require(_0x4877('0x3'));var BPromise=require(_0x4877('0x4'));var rp=require(_0x4877('0x5'));var fs=require('fs');var path=require(_0x4877('0x6'));var rimraf=require('rimraf');var config=require(_0x4877('0x7'));var attributes=require(_0x4877('0x8'));module[_0x4877('0x9')]=function(_0x4912fa,_0x482d0f){return _0x4912fa[_0x4877('0xa')]('Automation',attributes,{'tableName':_0x4877('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6edc=['rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x2d2a8d,_0x596fd6){var _0x4de305=function(_0x5c3e69){while(--_0x5c3e69){_0x2d2a8d['push'](_0x2d2a8d['shift']());}};_0x4de305(++_0x596fd6);}(_0x6edc,0xbd));var _0xc6ed=function(_0x1340a2,_0x26b995){_0x1340a2=_0x1340a2-0x0;var _0x550fc1=_0x6edc[_0x1340a2];return _0x550fc1;};'use strict';var _=require(_0xc6ed('0x0'));var util=require('util');var logger=require(_0xc6ed('0x1'))(_0xc6ed('0x2'));var moment=require(_0xc6ed('0x3'));var BPromise=require('bluebird');var rp=require(_0xc6ed('0x4'));var fs=require('fs');var path=require(_0xc6ed('0x5'));var rimraf=require(_0xc6ed('0x6'));var config=require(_0xc6ed('0x7'));var attributes=require(_0xc6ed('0x8'));module[_0xc6ed('0x9')]=function(_0x1979c8,_0x20030a){return _0x1979c8[_0xc6ed('0xa')](_0xc6ed('0xb'),attributes,{'tableName':_0xc6ed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index d26fb88..46ac400 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 _0xcf2f=['stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s'];(function(_0x390d58,_0x9d4593){var _0x5ba088=function(_0x16f153){while(--_0x16f153){_0x390d58['push'](_0x390d58['shift']());}};_0x5ba088(++_0x9d4593);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x2c930a,_0x138d04){_0x2c930a=_0x2c930a-0x0;var _0x440a9f=_0xcf2f[_0x2c930a];return _0x440a9f;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41d4bd,_0x157f48,_0x16b6b2){return new BPromise(function(_0x34f444,_0xb4c510){return client[_0xfcf2('0xd')](_0x41d4bd,_0x16b6b2)['then'](function(_0x575f33){logger['info'](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));logger['debug'](_0xfcf2('0x10'),_0x157f48,_0xfcf2('0xf'),JSON[_0xfcf2('0x11')](_0x575f33));if(_0x575f33[_0xfcf2('0x12')]){if(_0x575f33['error']['code']===0x1f4){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x575f33[_0xfcf2('0x12')][_0xfcf2('0x13')]);return _0xb4c510(_0x575f33['error'][_0xfcf2('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x157f48,_0x575f33['error'][_0xfcf2('0x13')]);return _0x34f444(_0x575f33['error'][_0xfcf2('0x13')]);}else{logger[_0xfcf2('0x14')](_0xfcf2('0xe'),_0x157f48,_0xfcf2('0xf'));_0x34f444(_0x575f33[_0xfcf2('0x15')][_0xfcf2('0x13')]);}})[_0xfcf2('0x16')](function(_0x4d64ce){logger[_0xfcf2('0x12')](_0xfcf2('0xe'),_0x157f48,_0x4d64ce);_0xb4c510(_0x4d64ce);});});} \ No newline at end of file +var _0x72a1=['jayson/promise','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x72a1,0x1ce));var _0x172a=function(_0x19c1ce,_0x15b196){_0x19c1ce=_0x19c1ce-0x0;var _0x3a7f6e=_0x72a1[_0x19c1ce];return _0x3a7f6e;};'use strict';var _=require('lodash');var util=require(_0x172a('0x0'));var moment=require('moment');var BPromise=require(_0x172a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x172a('0x2'));var db=require(_0x172a('0x3'))['db'];var utils=require(_0x172a('0x4'));var logger=require('../../config/logger')(_0x172a('0x5'));var config=require('../../config/environment');var jayson=require(_0x172a('0x6'));var client=jayson['client'][_0x172a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4859e1,_0x15e050,_0x5bf691){return new BPromise(function(_0x1164c1,_0x3efa61){return client['request'](_0x4859e1,_0x5bf691)[_0x172a('0x8')](function(_0x4928a6){logger[_0x172a('0x9')](_0x172a('0xa'),_0x15e050,_0x172a('0xb'));logger['debug'](_0x172a('0xc'),_0x15e050,_0x172a('0xb'),JSON[_0x172a('0xd')](_0x4928a6));if(_0x4928a6[_0x172a('0xe')]){if(_0x4928a6[_0x172a('0xe')]['code']===0x1f4){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);return _0x3efa61(_0x4928a6['error'][_0x172a('0xf')]);}logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x4928a6['error'][_0x172a('0xf')]);return _0x1164c1(_0x4928a6[_0x172a('0xe')][_0x172a('0xf')]);}else{logger[_0x172a('0x9')]('Automation,\x20%s,\x20%s',_0x15e050,_0x172a('0xb'));_0x1164c1(_0x4928a6[_0x172a('0x10')]['message']);}})[_0x172a('0x11')](function(_0x489d1c){logger[_0x172a('0xe')](_0x172a('0xa'),_0x15e050,_0x489d1c);_0x3efa61(_0x489d1c);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 77ad82e..b57e9c6 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 _0xd634=['show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0xd634,0x151));var _0x4d63=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0xd634[_0xa79977];return _0x109f10;};'use strict';var multer=require(_0x4d63('0x0'));var util=require(_0x4d63('0x1'));var path=require(_0x4d63('0x2'));var timeout=require(_0x4d63('0x3'));var express=require(_0x4d63('0x4'));var router=express[_0x4d63('0x5')]();var fs_extra=require(_0x4d63('0x6'));var auth=require(_0x4d63('0x7'));var interaction=require(_0x4d63('0x8'));var config=require(_0x4d63('0x9'));var controller=require('./automation.controller');router[_0x4d63('0xa')]('/',auth[_0x4d63('0xb')](),controller[_0x4d63('0xc')]);router[_0x4d63('0xa')](_0x4d63('0xd'),auth[_0x4d63('0xb')](),controller[_0x4d63('0xe')]);router[_0x4d63('0xa')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x4d63('0xf')]);router['get'](_0x4d63('0x10'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x11')]);router[_0x4d63('0x12')]('/',auth['isAuthenticated'](),controller[_0x4d63('0x13')]);router['post'](_0x4d63('0x14'),auth[_0x4d63('0xb')](),controller['addConditions']);router[_0x4d63('0x12')](_0x4d63('0x10'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x15')]);router[_0x4d63('0x16')](_0x4d63('0xd'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x17')]);router[_0x4d63('0x18')](_0x4d63('0xd'),auth[_0x4d63('0xb')](),controller[_0x4d63('0x19')]);module[_0x4d63('0x1a')]=router; \ No newline at end of file +var _0x5cd7=['../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','update','delete','/:id','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1e1279,_0x3dd8ca){var _0x175c1a=function(_0x109386){while(--_0x109386){_0x1e1279['push'](_0x1e1279['shift']());}};_0x175c1a(++_0x3dd8ca);}(_0x5cd7,0x102));var _0x75cd=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x5cd7[_0x46f1a6];return _0x38429a;};'use strict';var multer=require(_0x75cd('0x0'));var util=require('util');var path=require(_0x75cd('0x1'));var timeout=require(_0x75cd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x75cd('0x3'));var auth=require(_0x75cd('0x4'));var interaction=require(_0x75cd('0x5'));var config=require(_0x75cd('0x6'));var controller=require(_0x75cd('0x7'));router[_0x75cd('0x8')]('/',auth[_0x75cd('0x9')](),controller[_0x75cd('0xa')]);router[_0x75cd('0x8')]('/:id',auth[_0x75cd('0x9')](),controller[_0x75cd('0xb')]);router[_0x75cd('0x8')](_0x75cd('0xc'),auth[_0x75cd('0x9')](),controller[_0x75cd('0xd')]);router[_0x75cd('0x8')](_0x75cd('0xe'),auth[_0x75cd('0x9')](),controller[_0x75cd('0xf')]);router['post']('/',auth[_0x75cd('0x9')](),controller['create']);router[_0x75cd('0x10')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x75cd('0x11')]);router['post'](_0x75cd('0xe'),auth[_0x75cd('0x9')](),controller[_0x75cd('0x12')]);router['put']('/:id',auth[_0x75cd('0x9')](),controller[_0x75cd('0x13')]);router[_0x75cd('0x14')](_0x75cd('0x15'),auth['isAuthenticated'](),controller[_0x75cd('0x16')]);module[_0x75cd('0x17')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 264e58b..c799d85 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 _0x2a59=['never','onlyIfOpen','always','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*'];(function(_0x510584,_0x1a901e){var _0x318b4b=function(_0x2939aa){while(--_0x2939aa){_0x510584['push'](_0x510584['shift']());}};_0x318b4b(++_0x1a901e);}(_0x2a59,0x129));var _0x92a5=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x2a59[_0x174ef5];return _0x1cc379;};'use strict';var Sequelize=require(_0x92a5('0x0'));module[_0x92a5('0x1')]={'name':{'type':Sequelize[_0x92a5('0x2')],'unique':_0x92a5('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x92a5('0x4')](_0x92a5('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x92a5('0x2')]},'active':{'type':Sequelize[_0x92a5('0x6')],'defaultValue':0x0,'comment':_0x92a5('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x92a5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x92a5('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'comment':_0x92a5('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x92a5('0x10')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x92a5('0x2')],'defaultValue':_0x92a5('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x92a5('0x4')]('always',_0x92a5('0x12'),_0x92a5('0x13')),'defaultValue':_0x92a5('0x14')},'dialAMDActive':{'type':Sequelize[_0x92a5('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x92a5('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x92a5('0xa')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x92a5('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x92a5('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x92a5('0xa')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x92a5('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x92a5('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x92a5('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x92a5('0xa')](0x9)[_0x92a5('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x92a5('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x92a5('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x92a5('0x1a')},'dialCutDigit':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x92a5('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x92a5('0xa')](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x92a5('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x92a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x92a5('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x92a5('0xa')](0x5)[_0x92a5('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x52a4=['#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ivr','STRING','BOOLEAN','INTEGER','UNSIGNED'];(function(_0x1bb9e4,_0x15bc58){var _0xe362b1=function(_0xc5c0aa){while(--_0xc5c0aa){_0x1bb9e4['push'](_0x1bb9e4['shift']());}};_0xe362b1(++_0x15bc58);}(_0x52a4,0xe6));var _0x452a=function(_0x1e342f,_0x22bbe5){_0x1e342f=_0x1e342f-0x0;var _0x40551a=_0x52a4[_0x1e342f];return _0x40551a;};'use strict';var Sequelize=require(_0x452a('0x0'));module[_0x452a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x452a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x452a('0x3')),'allowNull':![],'defaultValue':_0x452a('0x3')},'description':{'type':Sequelize[_0x452a('0x4')]},'active':{'type':Sequelize[_0x452a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x452a('0x6')](0x4)[_0x452a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x452a('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x452a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x9')},'dialBusyMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'comment':_0x452a('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x452a('0xd')},'dialTimezone':{'type':Sequelize[_0x452a('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x452a('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x452a('0xe')](_0x452a('0xf'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x452a('0x5')],'defaultValue':0x0,'comment':_0x452a('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x452a('0x11')},'dialAMDGreeting':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x452a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x452a('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x452a('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x452a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x452a('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x452a('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x452a('0x6')](0x9)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x452a('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x452a('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x452a('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x452a('0xe')](_0x452a('0x18'),_0x452a('0x19')),'defaultValue':_0x452a('0x18')},'dialPrefix':{'type':Sequelize[_0x452a('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x452a('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x1c')},'dialDropRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)[_0x452a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)[_0x452a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x452a('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x452a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x452a('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x452a('0x21')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 5fdf104..b423845 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 _0x28c6=['cm_hopper_black','push','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','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','save','update','destroy','get','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','Campaign','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','CmHopper','nolimit','order','pick','findOne','CampaignId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','insert','sequelize','all','getBlackLists','addBlackLists'];(function(_0x3de2c7,_0x454dad){var _0x287f21=function(_0x9f97d8){while(--_0x9f97d8){_0x3de2c7['push'](_0x3de2c7['shift']());}};_0x287f21(++_0x454dad);}(_0x28c6,0x111));var _0x628c=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0x28c6[_0x56916d];return _0x2b7f1f;};'use strict';var emlformat=require(_0x628c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x628c('0x1'));var jsonpatch=require(_0x628c('0x2'));var rp=require(_0x628c('0x3'));var moment=require(_0x628c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x628c('0x5'));var util=require(_0x628c('0x6'));var path=require('path');var sox=require(_0x628c('0x7'));var csv=require(_0x628c('0x8'));var ejs=require(_0x628c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x628c('0xa'));var crypto=require(_0x628c('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x628c('0x8'));var querystring=require(_0x628c('0xc'));var Papa=require(_0x628c('0xd'));var Redis=require(_0x628c('0xe'));var authService=require(_0x628c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x628c('0x10'));var hardwareService=require(_0x628c('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x628c('0x12'));var config=require(_0x628c('0x13'));var licenseUtil=require(_0x628c('0x14'));var db=require(_0x628c('0x15'))['db'];function respondWithStatusCode(_0x4900a1,_0x228eff){_0x228eff=_0x228eff||0xcc;return function(_0x5c7cff){if(_0x5c7cff){return _0x4900a1[_0x628c('0x16')](_0x228eff);}return _0x4900a1[_0x628c('0x17')](_0x228eff)[_0x628c('0x18')]();};}function respondWithResult(_0x2152d5,_0x4a22c8){_0x4a22c8=_0x4a22c8||0xc8;return function(_0x16242e){if(_0x16242e){return _0x2152d5[_0x628c('0x17')](_0x4a22c8)[_0x628c('0x19')](_0x16242e);}};}function respondWithFilteredResult(_0x8af00d,_0x3f5845){return function(_0x3c7239){if(_0x3c7239){var _0x5ceb38=typeof _0x3f5845['offset']===_0x628c('0x1a')&&typeof _0x3f5845[_0x628c('0x1b')]===_0x628c('0x1a');var _0x2039fb=_0x3c7239[_0x628c('0x1c')];var _0x2a8a83=_0x5ceb38?0x0:_0x3f5845[_0x628c('0x1d')];var _0x4f1bcc=_0x5ceb38?_0x3c7239[_0x628c('0x1c')]:_0x3f5845['offset']+_0x3f5845[_0x628c('0x1b')];var _0x4f6606;if(_0x4f1bcc>=_0x2039fb){_0x4f1bcc=_0x2039fb;_0x4f6606=0xc8;}else{_0x4f6606=0xce;}_0x8af00d['status'](_0x4f6606);return _0x8af00d[_0x628c('0x1e')](_0x628c('0x1f'),_0x2a8a83+'-'+_0x4f1bcc+'/'+_0x2039fb)['json'](_0x3c7239);}return null;};}function patchUpdates(_0x19cc01){return function(_0x3bad94){try{jsonpatch['apply'](_0x3bad94,_0x19cc01,!![]);}catch(_0x3ae869){return BPromise[_0x628c('0x20')](_0x3ae869);}return _0x3bad94[_0x628c('0x21')]();};}function saveUpdates(_0xeb0091,_0x5f7d13){return function(_0x11eeee){if(_0x11eeee){return _0x11eeee[_0x628c('0x22')](_0xeb0091)['then'](function(_0x67ac7b){return _0x67ac7b;});}return null;};}function removeEntity(_0x52b904,_0x318228){return function(_0x157f24){if(_0x157f24){return _0x157f24[_0x628c('0x23')]()['then'](function(){var _0x44ce7d=_0x157f24[_0x628c('0x24')]({'plain':!![]});var _0x2fa735=_0x628c('0x25');return db[_0x628c('0x26')][_0x628c('0x23')]({'where':{'type':_0x2fa735,'resourceId':_0x44ce7d['id']}})['then'](function(){return _0x157f24;});})[_0x628c('0x27')](function(){_0x52b904['status'](0xcc)[_0x628c('0x18')]();});}};}function handleEntityNotFound(_0x17e7fa,_0x40d114){return function(_0x303fa2){if(!_0x303fa2){_0x17e7fa[_0x628c('0x16')](0x194);}return _0x303fa2;};}function handleError(_0x3d062e,_0x52f267){_0x52f267=_0x52f267||0x1f4;return function(_0x527cc4){logger[_0x628c('0x28')](_0x527cc4[_0x628c('0x29')]);if(_0x527cc4[_0x628c('0x2a')]){delete _0x527cc4[_0x628c('0x2a')];}_0x3d062e[_0x628c('0x17')](_0x52f267)[_0x628c('0x2b')](_0x527cc4);};}exports[_0x628c('0x2c')]=function(_0x3dd49d,_0xf90f05){var _0x4cbc25={},_0x32bf76={},_0x231478={'count':0x0,'rows':[]};var _0x103be2=_[_0x628c('0x2d')](db[_0x628c('0x2e')]['rawAttributes'],function(_0x107842){return{'name':_0x107842[_0x628c('0x2f')],'type':_0x107842[_0x628c('0x30')][_0x628c('0x31')]};});_0x32bf76[_0x628c('0x32')]=_[_0x628c('0x2d')](_0x103be2,_0x628c('0x2a'));_0x32bf76[_0x628c('0x33')]=_[_0x628c('0x34')](_0x3dd49d['query']);_0x32bf76[_0x628c('0x35')]=_[_0x628c('0x36')](_0x32bf76['model'],_0x32bf76[_0x628c('0x33')]);_0x4cbc25[_0x628c('0x37')]=_[_0x628c('0x36')](_0x32bf76[_0x628c('0x32')],qs['fields'](_0x3dd49d[_0x628c('0x33')][_0x628c('0x38')]));_0x4cbc25[_0x628c('0x37')]=_0x4cbc25[_0x628c('0x37')][_0x628c('0x39')]?_0x4cbc25['attributes']:_0x32bf76[_0x628c('0x32')];if(!_0x3dd49d[_0x628c('0x33')][_0x628c('0x3a')]('nolimit')){_0x4cbc25[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x3dd49d[_0x628c('0x33')]['limit']);_0x4cbc25[_0x628c('0x1d')]=qs[_0x628c('0x1d')](_0x3dd49d['query']['offset']);}_0x4cbc25['order']=qs['sort'](_0x3dd49d[_0x628c('0x33')][_0x628c('0x3b')]);_0x4cbc25['where']=qs[_0x628c('0x35')](_['pick'](_0x3dd49d[_0x628c('0x33')],_0x32bf76[_0x628c('0x35')]),_0x103be2);if(_0x3dd49d[_0x628c('0x33')]['filter']){_0x4cbc25[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x4cbc25[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x103be2,function(_0x4b408a){if(_0x4b408a[_0x628c('0x30')]!==_0x628c('0x3e')){var _0x5ee888={};_0x5ee888[_0x4b408a[_0x628c('0x2a')]]={'$like':'%'+_0x3dd49d[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x5ee888;}})});}_0x4cbc25=_[_0x628c('0x3d')]({},_0x4cbc25,_0x3dd49d[_0x628c('0x40')]);var _0xacb97a={'where':_0x4cbc25[_0x628c('0x3c')]};return db[_0x628c('0x2e')][_0x628c('0x1c')](_0xacb97a)[_0x628c('0x27')](function(_0x3cb509){_0x231478[_0x628c('0x1c')]=_0x3cb509;if(_0x3dd49d[_0x628c('0x33')][_0x628c('0x41')]){_0x4cbc25['include']=[{'all':!![]}];}return db[_0x628c('0x2e')][_0x628c('0x42')](_0x4cbc25);})[_0x628c('0x27')](function(_0x987d80){_0x231478[_0x628c('0x43')]=_0x987d80;return _0x231478;})[_0x628c('0x27')](respondWithFilteredResult(_0xf90f05,_0x4cbc25))[_0x628c('0x44')](handleError(_0xf90f05,null));};exports[_0x628c('0x45')]=function(_0x5abe2a,_0x321479){var _0x5a7eea={'raw':![],'where':{'id':_0x5abe2a[_0x628c('0x46')]['id']}},_0x3ea4fe={};_0x3ea4fe[_0x628c('0x32')]=_['keys'](db['Campaign'][_0x628c('0x47')]);_0x3ea4fe[_0x628c('0x33')]=_[_0x628c('0x34')](_0x5abe2a[_0x628c('0x33')]);_0x3ea4fe[_0x628c('0x35')]=_[_0x628c('0x36')](_0x3ea4fe[_0x628c('0x32')],_0x3ea4fe['query']);_0x5a7eea[_0x628c('0x37')]=_[_0x628c('0x36')](_0x3ea4fe['model'],qs[_0x628c('0x38')](_0x5abe2a['query'][_0x628c('0x38')]));_0x5a7eea['attributes']=_0x5a7eea[_0x628c('0x37')][_0x628c('0x39')]?_0x5a7eea[_0x628c('0x37')]:_0x3ea4fe[_0x628c('0x32')];if(_0x5abe2a['query'][_0x628c('0x41')]){_0x5a7eea[_0x628c('0x48')]=[{'all':!![]}];}_0x5a7eea=_[_0x628c('0x3d')]({},_0x5a7eea,_0x5abe2a[_0x628c('0x40')]);return db[_0x628c('0x2e')]['find'](_0x5a7eea)['then'](handleEntityNotFound(_0x321479,null))[_0x628c('0x27')](respondWithResult(_0x321479,null))['catch'](handleError(_0x321479,null));};exports[_0x628c('0x49')]=function(_0x117d14,_0x550e06){return db[_0x628c('0x2e')][_0x628c('0x49')](_0x117d14['body'],{})[_0x628c('0x27')](function(_0x225067){var _0xd4c1db=_0x117d14[_0x628c('0x4a')][_0x628c('0x24')]({'plain':!![]});if(!_0xd4c1db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd4c1db[_0x628c('0x4b')]===_0x628c('0x4a')){var _0x2b25e6=_0x225067['get']({'plain':!![]});var _0x4ce2f4=_0x628c('0x25');return db[_0x628c('0x4c')][_0x628c('0x4d')]({'where':{'name':_0x4ce2f4,'userProfileId':_0xd4c1db[_0x628c('0x4e')]},'raw':!![]})[_0x628c('0x27')](function(_0x3e7909){if(_0x3e7909&&_0x3e7909['autoAssociation']===0x0){return db[_0x628c('0x26')]['create']({'name':_0x2b25e6[_0x628c('0x2a')],'resourceId':_0x2b25e6['id'],'type':_0x3e7909[_0x628c('0x2a')],'sectionId':_0x3e7909['id']},{})[_0x628c('0x27')](function(){return _0x225067;});}else{return _0x225067;}})[_0x628c('0x44')](function(_0x5a8a4c){logger[_0x628c('0x28')](_0x628c('0x4f'),_0x5a8a4c);throw _0x5a8a4c;});}return _0x225067;})[_0x628c('0x27')](respondWithResult(_0x550e06,0xc9))['catch'](handleError(_0x550e06,null));};exports[_0x628c('0x50')]=function(_0x128ff9,_0x42fabf){var _0x5df128={'where':{'id':_0x128ff9[_0x628c('0x46')]['id']}},_0x3914dd={};_0x3914dd[_0x628c('0x32')]=_['keys'](db[_0x628c('0x2e')][_0x628c('0x47')]);_0x5df128[_0x628c('0x37')]=_['intersection'](_0x3914dd[_0x628c('0x32')],qs[_0x628c('0x38')](_0x128ff9[_0x628c('0x33')]['fields']));_0x5df128[_0x628c('0x37')]=_0x5df128['attributes'][_0x628c('0x39')]?_0x5df128[_0x628c('0x37')]:_0x3914dd['model'];if(_0x128ff9[_0x628c('0x33')]['includeAll']){_0x5df128['include']=[{'all':!![]}];}_0x5df128=_[_0x628c('0x3d')]({},_0x5df128,_0x128ff9[_0x628c('0x40')]);return db[_0x628c('0x2e')][_0x628c('0x4d')](_0x5df128)['then'](handleEntityNotFound(_0x42fabf,null))[_0x628c('0x27')](function(_0xc4a2bd){if(_0xc4a2bd){var _0x5f4830=_0xc4a2bd[_0x628c('0x24')]({'plain':!![]});_0x5f4830=qs[_0x628c('0x51')](_0x5f4830,['id',_0x628c('0x52'),_0x628c('0x53')]);_0x128ff9['body']=_['omit'](_0x128ff9[_0x628c('0x54')],['id','createdAt',_0x628c('0x53')]);return db[_0x628c('0x2e')][_0x628c('0x49')](_[_0x628c('0x3d')](_0x5f4830,_0x128ff9['body']),{'include':_0x128ff9['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2acb0d){var _0x3e67e3=_0x128ff9[_0x628c('0x4a')][_0x628c('0x24')]({'plain':!![]});if(!_0x3e67e3)throw new Error(_0x628c('0x55'));if(_0x3e67e3['role']===_0x628c('0x4a')){var _0x1f2b0a=_0x2acb0d[_0x628c('0x24')]({'plain':!![]});var _0x37186e='IvrCampaigns';return db[_0x628c('0x4c')][_0x628c('0x4d')]({'where':{'name':_0x37186e,'userProfileId':_0x3e67e3[_0x628c('0x4e')]},'raw':!![]})[_0x628c('0x27')](function(_0x22d089){if(_0x22d089&&_0x22d089['autoAssociation']===0x0){return db[_0x628c('0x26')][_0x628c('0x49')]({'name':_0x1f2b0a['name'],'resourceId':_0x1f2b0a['id'],'type':_0x22d089['name'],'sectionId':_0x22d089['id']},{})[_0x628c('0x27')](function(){return _0x2acb0d;});}else{return _0x2acb0d;}})[_0x628c('0x44')](function(_0x1acd2a){logger[_0x628c('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1acd2a);throw _0x1acd2a;});}return _0x2acb0d;});}})[_0x628c('0x27')](respondWithResult(_0x42fabf,0xc9))[_0x628c('0x44')](handleError(_0x42fabf,null));};exports[_0x628c('0x22')]=function(_0x3d7299,_0x444692){if(_0x3d7299[_0x628c('0x54')]['id']){delete _0x3d7299['body']['id'];}return db['Campaign'][_0x628c('0x4d')]({'where':{'id':_0x3d7299[_0x628c('0x46')]['id']}})['then'](handleEntityNotFound(_0x444692,null))['then'](saveUpdates(_0x3d7299['body'],null))[_0x628c('0x27')](respondWithResult(_0x444692,null))[_0x628c('0x44')](handleError(_0x444692,null));};exports[_0x628c('0x23')]=function(_0x102a49,_0x5f36a0){return db[_0x628c('0x2e')][_0x628c('0x4d')]({'where':{'id':_0x102a49[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x5f36a0,null))[_0x628c('0x27')](removeEntity(_0x5f36a0,null))[_0x628c('0x44')](handleError(_0x5f36a0,null));};exports[_0x628c('0x56')]=function(_0x5a663d,_0x46f15f,_0x32f64a){var _0x341647={'raw':!![],'where':{}};var _0x5f1d7f={};var _0x83ab7f={'count':0x0,'rows':[]};return db[_0x628c('0x2e')]['findOne']({'where':{'id':_0x5a663d['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x46f15f,null))[_0x628c('0x27')](function(_0x417dfe){if(_0x417dfe){_0x5f1d7f[_0x628c('0x32')]=_[_0x628c('0x34')](db[_0x628c('0x57')]['rawAttributes']);_0x5f1d7f[_0x628c('0x33')]=_[_0x628c('0x34')](_0x5a663d['query']);_0x5f1d7f[_0x628c('0x35')]=_[_0x628c('0x36')](_0x5f1d7f[_0x628c('0x32')],_0x5f1d7f[_0x628c('0x33')]);_0x341647[_0x628c('0x37')]=_['intersection'](_0x5f1d7f[_0x628c('0x32')],qs['fields'](_0x5a663d[_0x628c('0x33')][_0x628c('0x38')]));_0x341647['attributes']=_0x341647[_0x628c('0x37')][_0x628c('0x39')]?_0x341647[_0x628c('0x37')]:_0x5f1d7f[_0x628c('0x32')];if(!_0x5a663d[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x341647[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x5a663d[_0x628c('0x33')]['limit']);_0x341647[_0x628c('0x1d')]=qs['offset'](_0x5a663d[_0x628c('0x33')][_0x628c('0x1d')]);}_0x341647[_0x628c('0x59')]=qs[_0x628c('0x3b')](_0x5a663d[_0x628c('0x33')][_0x628c('0x3b')]);_0x341647['where']=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x5a663d['query'],_0x5f1d7f[_0x628c('0x35')]));_0x341647[_0x628c('0x3c')]['CampaignId']=_0x417dfe['id'];if(_0x5a663d['query'][_0x628c('0x3f')]){_0x341647[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x341647['where'],{'$or':_[_0x628c('0x2d')](_0x341647[_0x628c('0x37')],function(_0x324ea2){var _0x125074={};_0x125074[_0x324ea2]={'$like':'%'+_0x5a663d[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x125074;})});}_0x341647=_['merge']({},_0x341647,_0x5a663d[_0x628c('0x40')]);return db['CmHopper'][_0x628c('0x1c')]({'where':_0x341647[_0x628c('0x3c')]})[_0x628c('0x27')](function(_0x48fb8e){_0x83ab7f['count']=_0x48fb8e;if(_0x5a663d[_0x628c('0x33')][_0x628c('0x41')]){_0x341647['include']=[{'all':!![]}];}return db[_0x628c('0x57')][_0x628c('0x42')](_0x341647);})[_0x628c('0x27')](function(_0x10ec47){_0x83ab7f[_0x628c('0x43')]=_0x10ec47;return _0x83ab7f;});}})[_0x628c('0x27')](respondWithFilteredResult(_0x46f15f,_0x341647))[_0x628c('0x44')](handleError(_0x46f15f,null));};exports['getHopperHistories']=function(_0x536dd9,_0x3fb658,_0x671c8a){var _0x22885d={'raw':!![],'where':{}};var _0x515af8={};var _0x5f2e89={'count':0x0,'rows':[]};return db['Campaign'][_0x628c('0x5b')]({'where':{'id':_0x536dd9[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x3fb658,null))[_0x628c('0x27')](function(_0x38baaf){if(_0x38baaf){_0x515af8[_0x628c('0x32')]=_[_0x628c('0x34')](db['CmHopperHistory']['rawAttributes']);_0x515af8[_0x628c('0x33')]=_['keys'](_0x536dd9[_0x628c('0x33')]);_0x515af8[_0x628c('0x35')]=_[_0x628c('0x36')](_0x515af8[_0x628c('0x32')],_0x515af8[_0x628c('0x33')]);_0x22885d[_0x628c('0x37')]=_[_0x628c('0x36')](_0x515af8[_0x628c('0x32')],qs['fields'](_0x536dd9[_0x628c('0x33')][_0x628c('0x38')]));_0x22885d[_0x628c('0x37')]=_0x22885d[_0x628c('0x37')]['length']?_0x22885d[_0x628c('0x37')]:_0x515af8['model'];if(!_0x536dd9[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x22885d[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x536dd9[_0x628c('0x33')]['limit']);_0x22885d[_0x628c('0x1d')]=qs['offset'](_0x536dd9[_0x628c('0x33')][_0x628c('0x1d')]);}_0x22885d[_0x628c('0x59')]=qs['sort'](_0x536dd9[_0x628c('0x33')][_0x628c('0x3b')]);_0x22885d[_0x628c('0x3c')]=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x536dd9['query'],_0x515af8[_0x628c('0x35')]));_0x22885d[_0x628c('0x3c')][_0x628c('0x5c')]=_0x38baaf['id'];if(_0x536dd9[_0x628c('0x33')][_0x628c('0x3f')]){_0x22885d[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x22885d[_0x628c('0x3c')],{'$or':_['map'](_0x22885d[_0x628c('0x37')],function(_0x19398a){var _0x33d259={};_0x33d259[_0x19398a]={'$like':'%'+_0x536dd9[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x33d259;})});}_0x22885d=_[_0x628c('0x3d')]({},_0x22885d,_0x536dd9[_0x628c('0x40')]);return db[_0x628c('0x5d')][_0x628c('0x1c')]({'where':_0x22885d[_0x628c('0x3c')]})[_0x628c('0x27')](function(_0x30a79c){_0x5f2e89[_0x628c('0x1c')]=_0x30a79c;if(_0x536dd9['query'][_0x628c('0x41')]){_0x22885d[_0x628c('0x48')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x628c('0x42')](_0x22885d);})[_0x628c('0x27')](function(_0x1088d8){_0x5f2e89[_0x628c('0x43')]=_0x1088d8;return _0x5f2e89;});}})[_0x628c('0x27')](respondWithFilteredResult(_0x3fb658,_0x22885d))['catch'](handleError(_0x3fb658,null));};exports['getHopperFinals']=function(_0xb3dc11,_0x25726e,_0xed7d4a){var _0x2436b0={'raw':!![],'where':{}};var _0x3c4950={};var _0x563291={'count':0x0,'rows':[]};return db[_0x628c('0x2e')][_0x628c('0x5b')]({'where':{'id':_0xb3dc11['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x25726e,null))['then'](function(_0x396465){if(_0x396465){_0x3c4950[_0x628c('0x32')]=_[_0x628c('0x34')](db[_0x628c('0x5e')][_0x628c('0x47')]);_0x3c4950[_0x628c('0x33')]=_[_0x628c('0x34')](_0xb3dc11[_0x628c('0x33')]);_0x3c4950[_0x628c('0x35')]=_[_0x628c('0x36')](_0x3c4950[_0x628c('0x32')],_0x3c4950['query']);_0x2436b0[_0x628c('0x37')]=_[_0x628c('0x36')](_0x3c4950[_0x628c('0x32')],qs[_0x628c('0x38')](_0xb3dc11['query'][_0x628c('0x38')]));_0x2436b0[_0x628c('0x37')]=_0x2436b0[_0x628c('0x37')]['length']?_0x2436b0[_0x628c('0x37')]:_0x3c4950[_0x628c('0x32')];if(!_0xb3dc11['query'][_0x628c('0x3a')](_0x628c('0x58'))){_0x2436b0[_0x628c('0x1b')]=qs['limit'](_0xb3dc11[_0x628c('0x33')][_0x628c('0x1b')]);_0x2436b0[_0x628c('0x1d')]=qs['offset'](_0xb3dc11[_0x628c('0x33')][_0x628c('0x1d')]);}_0x2436b0['order']=qs['sort'](_0xb3dc11['query'][_0x628c('0x3b')]);_0x2436b0[_0x628c('0x3c')]=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0xb3dc11['query'],_0x3c4950['filters']));_0x2436b0[_0x628c('0x3c')][_0x628c('0x5c')]=_0x396465['id'];if(_0xb3dc11['query'][_0x628c('0x3f')]){_0x2436b0[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x2436b0[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x2436b0['attributes'],function(_0x1b2f1e){var _0x2079ce={};_0x2079ce[_0x1b2f1e]={'$like':'%'+_0xb3dc11['query'][_0x628c('0x3f')]+'%'};return _0x2079ce;})});}_0x2436b0=_[_0x628c('0x3d')]({},_0x2436b0,_0xb3dc11['options']);return db[_0x628c('0x5e')][_0x628c('0x1c')]({'where':_0x2436b0['where']})[_0x628c('0x27')](function(_0xb33f7b){_0x563291[_0x628c('0x1c')]=_0xb33f7b;if(_0xb3dc11[_0x628c('0x33')][_0x628c('0x41')]){_0x2436b0[_0x628c('0x48')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x628c('0x42')](_0x2436b0);})[_0x628c('0x27')](function(_0xc75b3a){_0x563291[_0x628c('0x43')]=_0xc75b3a;return _0x563291;});}})[_0x628c('0x27')](respondWithFilteredResult(_0x25726e,_0x2436b0))[_0x628c('0x44')](handleError(_0x25726e,null));};exports[_0x628c('0x5f')]=function(_0x3e556e,_0x139123,_0xa98b8a){var _0x3e33a5={'raw':!![],'where':{}};var _0x20559f={};var _0x284d5a={'count':0x0,'rows':[]};return db[_0x628c('0x2e')][_0x628c('0x5b')]({'where':{'id':_0x3e556e[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x139123,null))[_0x628c('0x27')](function(_0x4bc78e){if(_0x4bc78e){_0x20559f[_0x628c('0x32')]=_['keys'](db['CmHopperBlack'][_0x628c('0x47')]);_0x20559f['query']=_[_0x628c('0x34')](_0x3e556e['query']);_0x20559f['filters']=_[_0x628c('0x36')](_0x20559f[_0x628c('0x32')],_0x20559f[_0x628c('0x33')]);_0x3e33a5[_0x628c('0x37')]=_['intersection'](_0x20559f['model'],qs['fields'](_0x3e556e[_0x628c('0x33')]['fields']));_0x3e33a5[_0x628c('0x37')]=_0x3e33a5[_0x628c('0x37')]['length']?_0x3e33a5['attributes']:_0x20559f[_0x628c('0x32')];if(!_0x3e556e[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x3e33a5['limit']=qs[_0x628c('0x1b')](_0x3e556e[_0x628c('0x33')]['limit']);_0x3e33a5[_0x628c('0x1d')]=qs['offset'](_0x3e556e[_0x628c('0x33')][_0x628c('0x1d')]);}_0x3e33a5['order']=qs[_0x628c('0x3b')](_0x3e556e[_0x628c('0x33')][_0x628c('0x3b')]);_0x3e33a5[_0x628c('0x3c')]=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x3e556e['query'],_0x20559f[_0x628c('0x35')]));_0x3e33a5['where'][_0x628c('0x5c')]=_0x4bc78e['id'];if(_0x3e556e[_0x628c('0x33')][_0x628c('0x3f')]){_0x3e33a5[_0x628c('0x3c')]=_['merge'](_0x3e33a5[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x3e33a5[_0x628c('0x37')],function(_0x38cb0d){var _0x520f5e={};_0x520f5e[_0x38cb0d]={'$like':'%'+_0x3e556e[_0x628c('0x33')]['filter']+'%'};return _0x520f5e;})});}_0x3e33a5=_[_0x628c('0x3d')]({},_0x3e33a5,_0x3e556e['options']);return db[_0x628c('0x60')]['count']({'where':_0x3e33a5[_0x628c('0x3c')]})['then'](function(_0x448860){_0x284d5a[_0x628c('0x1c')]=_0x448860;if(_0x3e556e[_0x628c('0x33')][_0x628c('0x41')]){_0x3e33a5[_0x628c('0x48')]=[{'all':!![]}];}return db[_0x628c('0x60')]['findAll'](_0x3e33a5);})[_0x628c('0x27')](function(_0x39ddc4){_0x284d5a['rows']=_0x39ddc4;return _0x284d5a;});}})['then'](respondWithFilteredResult(_0x139123,_0x3e33a5))[_0x628c('0x44')](handleError(_0x139123,null));};exports[_0x628c('0x61')]=function(_0x4ea634,_0x4eddb2,_0x46a095){var _0x41e1c0={};var _0x3dac31={};var _0x50a3fa;var _0x3cb02b;return db[_0x628c('0x2e')]['findOne']({'where':{'id':_0x4ea634['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x4eddb2,null))[_0x628c('0x27')](function(_0x5d095c){if(_0x5d095c){_0x50a3fa=_0x5d095c;_0x3dac31[_0x628c('0x32')]=_[_0x628c('0x34')](db[_0x628c('0x62')]['rawAttributes']);_0x3dac31['query']=_['keys'](_0x4ea634['query']);_0x3dac31['filters']=_[_0x628c('0x36')](_0x3dac31[_0x628c('0x32')],_0x3dac31[_0x628c('0x33')]);_0x41e1c0['attributes']=_[_0x628c('0x36')](_0x3dac31[_0x628c('0x32')],qs['fields'](_0x4ea634[_0x628c('0x33')]['fields']));_0x41e1c0[_0x628c('0x37')]=_0x41e1c0[_0x628c('0x37')][_0x628c('0x39')]?_0x41e1c0['attributes']:_0x3dac31['model'];_0x41e1c0[_0x628c('0x59')]=qs[_0x628c('0x3b')](_0x4ea634['query'][_0x628c('0x3b')]);_0x41e1c0['where']=qs[_0x628c('0x35')](_[_0x628c('0x5a')](_0x4ea634['query'],_0x3dac31['filters']));if(_0x4ea634[_0x628c('0x33')][_0x628c('0x3f')]){_0x41e1c0[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x41e1c0[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x41e1c0[_0x628c('0x37')],function(_0x497bb8){var _0xb288a9={};_0xb288a9[_0x497bb8]={'$like':'%'+_0x4ea634[_0x628c('0x33')]['filter']+'%'};return _0xb288a9;})});}_0x41e1c0=_[_0x628c('0x3d')]({},_0x41e1c0,_0x4ea634[_0x628c('0x40')]);return _0x50a3fa[_0x628c('0x61')](_0x41e1c0);}})[_0x628c('0x27')](function(_0x3139fc){if(_0x3139fc){_0x3cb02b=_0x3139fc[_0x628c('0x39')];if(!_0x4ea634[_0x628c('0x33')][_0x628c('0x3a')](_0x628c('0x58'))){_0x41e1c0[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x4ea634['query'][_0x628c('0x1b')]);_0x41e1c0[_0x628c('0x1d')]=qs[_0x628c('0x1d')](_0x4ea634['query']['offset']);}return _0x50a3fa['getLists'](_0x41e1c0);}})['then'](function(_0x155577){if(_0x155577){return _0x155577?{'count':_0x3cb02b,'rows':_0x155577}:null;}})[_0x628c('0x27')](respondWithResult(_0x4eddb2,null))[_0x628c('0x44')](handleError(_0x4eddb2,null));};exports[_0x628c('0x63')]=function(_0x1e5347,_0x34b91b,_0xc3112){var _0xeb9dd1,_0x2c91a8;return db[_0x628c('0x2e')]['find']({'where':{'id':_0x1e5347['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x34b91b,null))[_0x628c('0x27')](function(_0x2bdcec){if(_0x2bdcec){_0x2c91a8=_0x2bdcec;return _0x2bdcec[_0x628c('0x63')](_0x1e5347[_0x628c('0x54')]['ids'],_[_0x628c('0x51')](_0x1e5347[_0x628c('0x54')],[_0x628c('0x64'),'id'])||{});}return null;})[_0x628c('0x65')](function(_0x2f6884){var _0x3a9f49;_0xeb9dd1=_0x2f6884||[];var _0x5e3a2b=[];if(_0x2f6884){for(var _0x58e1e7=0x0;_0x58e1e7<_0x2f6884[_0x628c('0x39')];_0x58e1e7+=0x1){var _0x50ae27=_0x2f6884[_0x58e1e7][_0x628c('0x24')]({'plain':!![]});_0x2c91a8['dialCheckDuplicateType']=_0x1e5347[_0x628c('0x54')][_0x628c('0x66')]?_0x1e5347[_0x628c('0x54')][_0x628c('0x66')]:_0x2c91a8[_0x628c('0x66')];switch(_0x2c91a8[_0x628c('0x66')]){case _0x628c('0x67'):_0x3a9f49=squel['insert']()['into'](_0x628c('0x68'))[_0x628c('0x69')]([_0x628c('0x6a'),_0x628c('0x6b'),_0x628c('0x6c'),_0x628c('0x6d'),'CampaignId',_0x628c('0x52'),_0x628c('0x53')],squel['select']()[_0x628c('0x6e')](_0x628c('0x6a'),'phone')['field'](_0x628c('0x6f'),_0x628c('0x6b'))[_0x628c('0x6e')]('id','ContactId')['field'](_0x50ae27[_0x628c('0x70')][_0x628c('0x71')](),_0x628c('0x6d'))[_0x628c('0x6e')](_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')]('NOW()',_0x628c('0x52'))['field'](_0x628c('0x6f'),_0x628c('0x53'))['from'](_0x628c('0x72'))['where'](_0x628c('0x73'))[_0x628c('0x3c')](_0x628c('0x74'),_0x50ae27[_0x628c('0x70')][_0x628c('0x71')]())[_0x628c('0x3c')](_0x628c('0x75'))[_0x628c('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0x628c('0x76')]()[_0x628c('0x6e')](_0x628c('0x77'))[_0x628c('0x78')](_0x628c('0x79'))[_0x628c('0x3c')](_0x628c('0x7a'),_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')]()))['where'](_0x628c('0x7b'),squel[_0x628c('0x76')]()[_0x628c('0x6e')](_0x628c('0x7c'))[_0x628c('0x78')](_0x628c('0x68'))['where'](_0x628c('0x7a'),_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')]())))[_0x628c('0x71')]();break;case _0x628c('0x7d'):_0x3a9f49=squel['insert']()[_0x628c('0x7e')](_0x628c('0x68'))[_0x628c('0x69')](['phone',_0x628c('0x6b'),_0x628c('0x6c'),_0x628c('0x6d'),_0x628c('0x5c'),_0x628c('0x52'),_0x628c('0x53')],squel[_0x628c('0x76')]()['field'](_0x628c('0x6a'),'phone')['field'](_0x628c('0x6f'),_0x628c('0x6b'))[_0x628c('0x6e')]('id',_0x628c('0x6c'))['field'](_0x50ae27[_0x628c('0x70')][_0x628c('0x71')](),_0x628c('0x6d'))[_0x628c('0x6e')](_0x1e5347[_0x628c('0x46')]['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')]('NOW()',_0x628c('0x52'))[_0x628c('0x6e')](_0x628c('0x6f'),'updatedAt')['from'](_0x628c('0x72'))['where'](_0x628c('0x73'))[_0x628c('0x3c')](_0x628c('0x74'),_0x50ae27[_0x628c('0x70')][_0x628c('0x71')]())[_0x628c('0x3c')](_0x628c('0x75'))[_0x628c('0x3c')](_0x628c('0x7b'),squel[_0x628c('0x76')]()['field']('COALESCE(phone,\x27\x27)')[_0x628c('0x78')](_0x628c('0x68'))['where']('CampaignId\x20=\x20?',_0x1e5347['params']['id'][_0x628c('0x71')]())))['toString']();break;default:_0x3a9f49=squel[_0x628c('0x7f')]()[_0x628c('0x7e')](_0x628c('0x68'))[_0x628c('0x69')]([_0x628c('0x6a'),_0x628c('0x6b'),'ContactId',_0x628c('0x6d'),_0x628c('0x5c'),_0x628c('0x52'),_0x628c('0x53')],squel['select']()[_0x628c('0x6e')](_0x628c('0x6a'),_0x628c('0x6a'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x6b'))[_0x628c('0x6e')]('id','ContactId')[_0x628c('0x6e')](_0x50ae27[_0x628c('0x70')][_0x628c('0x71')](),'ListId')[_0x628c('0x6e')](_0x1e5347['params']['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x52'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x53'))[_0x628c('0x78')](_0x628c('0x72'))[_0x628c('0x3c')]('deletedAt\x20IS\x20NULL')[_0x628c('0x3c')](_0x628c('0x74'),_0x50ae27[_0x628c('0x70')][_0x628c('0x71')]())[_0x628c('0x3c')](_0x628c('0x75')))[_0x628c('0x71')]();}_0x5e3a2b['push'](db[_0x628c('0x80')][_0x628c('0x33')](_0x3a9f49));}return BPromise[_0x628c('0x81')](_0x5e3a2b);}})[_0x628c('0x27')](function(){return _0xeb9dd1;})['then'](respondWithResult(_0x34b91b,null))[_0x628c('0x44')](handleError(_0x34b91b,null));};exports['removeLists']=function(_0x4767e3,_0x46612c,_0x1a11e9){return db['Campaign']['find']({'where':{'id':_0x4767e3[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x46612c,null))[_0x628c('0x27')](function(_0x5d0e97){if(_0x5d0e97){return _0x5d0e97['removeLists'](_0x4767e3[_0x628c('0x33')]['ids']);}})[_0x628c('0x27')](function(_0x1b2b0d){if(_0x1b2b0d){return db[_0x628c('0x57')][_0x628c('0x23')]({'where':{'ListId':_0x4767e3[_0x628c('0x33')][_0x628c('0x64')],'CampaignId':_0x4767e3['params']['id']}})['then'](function(){return _0x1b2b0d;});}})[_0x628c('0x27')](respondWithStatusCode(_0x46612c,null))[_0x628c('0x44')](handleError(_0x46612c,null));};exports[_0x628c('0x82')]=function(_0x4ef7bf,_0x376e23,_0x1fe6ab){var _0x5cc401={};var _0x57a4ed={};var _0x3dd46a;var _0xf99888;return db[_0x628c('0x2e')][_0x628c('0x5b')]({'where':{'id':_0x4ef7bf[_0x628c('0x46')]['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x376e23,null))['then'](function(_0x105627){if(_0x105627){_0x3dd46a=_0x105627;_0x57a4ed['model']=_[_0x628c('0x34')](db[_0x628c('0x62')][_0x628c('0x47')]);_0x57a4ed[_0x628c('0x33')]=_[_0x628c('0x34')](_0x4ef7bf[_0x628c('0x33')]);_0x57a4ed['filters']=_[_0x628c('0x36')](_0x57a4ed['model'],_0x57a4ed[_0x628c('0x33')]);_0x5cc401[_0x628c('0x37')]=_[_0x628c('0x36')](_0x57a4ed[_0x628c('0x32')],qs[_0x628c('0x38')](_0x4ef7bf[_0x628c('0x33')][_0x628c('0x38')]));_0x5cc401[_0x628c('0x37')]=_0x5cc401[_0x628c('0x37')][_0x628c('0x39')]?_0x5cc401[_0x628c('0x37')]:_0x57a4ed[_0x628c('0x32')];_0x5cc401[_0x628c('0x59')]=qs[_0x628c('0x3b')](_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3b')]);_0x5cc401[_0x628c('0x3c')]=qs[_0x628c('0x35')](_['pick'](_0x4ef7bf['query'],_0x57a4ed[_0x628c('0x35')]));if(_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3f')]){_0x5cc401[_0x628c('0x3c')]=_[_0x628c('0x3d')](_0x5cc401[_0x628c('0x3c')],{'$or':_[_0x628c('0x2d')](_0x5cc401['attributes'],function(_0xfbc39a){var _0x5f0b23={};_0x5f0b23[_0xfbc39a]={'$like':'%'+_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3f')]+'%'};return _0x5f0b23;})});}_0x5cc401=_[_0x628c('0x3d')]({},_0x5cc401,_0x4ef7bf[_0x628c('0x40')]);return _0x3dd46a['getBlackLists'](_0x5cc401);}})['then'](function(_0x240ffc){if(_0x240ffc){_0xf99888=_0x240ffc['length'];if(!_0x4ef7bf[_0x628c('0x33')][_0x628c('0x3a')]('nolimit')){_0x5cc401[_0x628c('0x1b')]=qs[_0x628c('0x1b')](_0x4ef7bf[_0x628c('0x33')]['limit']);_0x5cc401['offset']=qs[_0x628c('0x1d')](_0x4ef7bf['query'][_0x628c('0x1d')]);}return _0x3dd46a[_0x628c('0x82')](_0x5cc401);}})[_0x628c('0x27')](function(_0x218ac8){if(_0x218ac8){return _0x218ac8?{'count':_0xf99888,'rows':_0x218ac8}:null;}})[_0x628c('0x27')](respondWithResult(_0x376e23,null))[_0x628c('0x44')](handleError(_0x376e23,null));};exports[_0x628c('0x83')]=function(_0x4577ca,_0x1402b8,_0x591570){var _0x5992cd,_0x43ae89;return db[_0x628c('0x2e')][_0x628c('0x4d')]({'where':{'id':_0x4577ca['params']['id']}})[_0x628c('0x27')](handleEntityNotFound(_0x1402b8,null))[_0x628c('0x27')](function(_0x47756c){if(_0x47756c){_0x43ae89=_0x47756c;return _0x47756c['addBlackLists'](_0x4577ca[_0x628c('0x54')][_0x628c('0x64')],_[_0x628c('0x51')](_0x4577ca['body'],[_0x628c('0x64'),'id'])||{});}return null;})[_0x628c('0x65')](function(_0x169d81){var _0x29c26b;_0x5992cd=_0x169d81||[];var _0x24cb52=[];if(_0x169d81){for(var _0x3f86d8=0x0;_0x3f86d8<_0x169d81[_0x628c('0x39')];_0x3f86d8+=0x1){var _0x53eb3d=_0x169d81[_0x3f86d8][_0x628c('0x24')]({'plain':!![]});_0x29c26b=squel[_0x628c('0x7f')]()['into'](_0x628c('0x84'))['fromQuery']([_0x628c('0x6a'),_0x628c('0x6c'),_0x628c('0x6d'),_0x628c('0x5c'),'createdAt','updatedAt'],squel['select']()[_0x628c('0x6e')](_0x628c('0x6a'),_0x628c('0x6a'))[_0x628c('0x6e')]('id','ContactId')[_0x628c('0x6e')](_0x53eb3d[_0x628c('0x70')]['toString'](),_0x628c('0x6d'))[_0x628c('0x6e')](_0x4577ca[_0x628c('0x46')]['id'][_0x628c('0x71')](),_0x628c('0x5c'))[_0x628c('0x6e')]('NOW()',_0x628c('0x52'))[_0x628c('0x6e')](_0x628c('0x6f'),_0x628c('0x53'))[_0x628c('0x78')](_0x628c('0x72'))[_0x628c('0x3c')](_0x628c('0x73'))[_0x628c('0x3c')](_0x628c('0x74'),_0x53eb3d['CmListId']['toString']())[_0x628c('0x3c')](_0x628c('0x75')))[_0x628c('0x71')]();_0x24cb52[_0x628c('0x85')](db[_0x628c('0x80')]['query'](_0x29c26b));}return BPromise['all'](_0x24cb52);}})[_0x628c('0x27')](function(){return _0x5992cd;})['then'](respondWithResult(_0x1402b8,null))['catch'](handleError(_0x1402b8,null));};exports[_0x628c('0x86')]=function(_0x24be8a,_0xa50278,_0x2e9e30){return db[_0x628c('0x2e')]['find']({'where':{'id':_0x24be8a['params']['id']}})['then'](handleEntityNotFound(_0xa50278,null))[_0x628c('0x27')](function(_0x1c6c4a){if(_0x1c6c4a){return _0x1c6c4a[_0x628c('0x86')](_0x24be8a[_0x628c('0x33')][_0x628c('0x64')]);}})['then'](function(_0xc78467){if(_0xc78467){return db[_0x628c('0x60')][_0x628c('0x23')]({'where':{'ListId':_0x24be8a[_0x628c('0x33')][_0x628c('0x64')],'CampaignId':_0x24be8a[_0x628c('0x46')]['id']}})[_0x628c('0x27')](function(){return _0xc78467;});}})[_0x628c('0x27')](respondWithStatusCode(_0xa50278,null))[_0x628c('0x44')](handleError(_0xa50278,null));}; \ No newline at end of file +var _0x4e7f=['send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','Campaign','include','findAll','rows','catch','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','merge','omit','createdAt','updatedAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','order','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','scheduledAt','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','mustache','path','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4e7f,0x1df));var _0xf4e7=function(_0x1591d4,_0x4ea3bd){_0x1591d4=_0x1591d4-0x0;var _0x4c46bb=_0x4e7f[_0x1591d4];return _0x4c46bb;};'use strict';var emlformat=require(_0xf4e7('0x0'));var rimraf=require(_0xf4e7('0x1'));var zipdir=require(_0xf4e7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf4e7('0x3'));var util=require('util');var path=require(_0xf4e7('0x4'));var sox=require('sox');var csv=require(_0xf4e7('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf4e7('0x6'));var crypto=require(_0xf4e7('0x7'));var jsforce=require(_0xf4e7('0x8'));var deskjs=require(_0xf4e7('0x9'));var toCsv=require(_0xf4e7('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf4e7('0xa'));var authService=require(_0xf4e7('0xb'));var qs=require(_0xf4e7('0xc'));var as=require(_0xf4e7('0xd'));var hardwareService=require(_0xf4e7('0xe'));var logger=require(_0xf4e7('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf4e7('0x10'));var db=require(_0xf4e7('0x11'))['db'];function respondWithStatusCode(_0x5b24ef,_0x316652){_0x316652=_0x316652||0xcc;return function(_0x50bb16){if(_0x50bb16){return _0x5b24ef[_0xf4e7('0x12')](_0x316652);}return _0x5b24ef['status'](_0x316652)[_0xf4e7('0x13')]();};}function respondWithResult(_0x5c6378,_0x249357){_0x249357=_0x249357||0xc8;return function(_0x597164){if(_0x597164){return _0x5c6378[_0xf4e7('0x14')](_0x249357)[_0xf4e7('0x15')](_0x597164);}};}function respondWithFilteredResult(_0x3a2ea7,_0xe1a127){return function(_0x198dc0){if(_0x198dc0){var _0x2fc150=typeof _0xe1a127[_0xf4e7('0x16')]===_0xf4e7('0x17')&&typeof _0xe1a127[_0xf4e7('0x18')]===_0xf4e7('0x17');var _0x118885=_0x198dc0[_0xf4e7('0x19')];var _0x118aeb=_0x2fc150?0x0:_0xe1a127[_0xf4e7('0x16')];var _0x529de1=_0x2fc150?_0x198dc0[_0xf4e7('0x19')]:_0xe1a127[_0xf4e7('0x16')]+_0xe1a127['limit'];var _0x3acfe0;if(_0x529de1>=_0x118885){_0x529de1=_0x118885;_0x3acfe0=0xc8;}else{_0x3acfe0=0xce;}_0x3a2ea7[_0xf4e7('0x14')](_0x3acfe0);return _0x3a2ea7[_0xf4e7('0x1a')](_0xf4e7('0x1b'),_0x118aeb+'-'+_0x529de1+'/'+_0x118885)['json'](_0x198dc0);}return null;};}function patchUpdates(_0x456d30){return function(_0x19260b){try{jsonpatch[_0xf4e7('0x1c')](_0x19260b,_0x456d30,!![]);}catch(_0x524a6c){return BPromise['reject'](_0x524a6c);}return _0x19260b[_0xf4e7('0x1d')]();};}function saveUpdates(_0x5efd89,_0x51aae7){return function(_0x1cfd83){if(_0x1cfd83){return _0x1cfd83[_0xf4e7('0x1e')](_0x5efd89)[_0xf4e7('0x1f')](function(_0x145c96){return _0x145c96;});}return null;};}function removeEntity(_0x5b2743,_0x3b7d37){return function(_0x5a53b2){if(_0x5a53b2){return _0x5a53b2[_0xf4e7('0x20')]()[_0xf4e7('0x1f')](function(){var _0x2f9873=_0x5a53b2[_0xf4e7('0x21')]({'plain':!![]});var _0x4badc4=_0xf4e7('0x22');return db[_0xf4e7('0x23')][_0xf4e7('0x20')]({'where':{'type':_0x4badc4,'resourceId':_0x2f9873['id']}})[_0xf4e7('0x1f')](function(){return _0x5a53b2;});})[_0xf4e7('0x1f')](function(){_0x5b2743['status'](0xcc)[_0xf4e7('0x13')]();});}};}function handleEntityNotFound(_0x43cb2d,_0x562866){return function(_0x23f18f){if(!_0x23f18f){_0x43cb2d[_0xf4e7('0x12')](0x194);}return _0x23f18f;};}function handleError(_0x959613,_0x26812c){_0x26812c=_0x26812c||0x1f4;return function(_0x35d74b){logger[_0xf4e7('0x24')](_0x35d74b['stack']);if(_0x35d74b['name']){delete _0x35d74b['name'];}_0x959613[_0xf4e7('0x14')](_0x26812c)[_0xf4e7('0x25')](_0x35d74b);};}exports[_0xf4e7('0x26')]=function(_0x3a94c6,_0x23058c){var _0x38dd7e={},_0x313f0a={},_0x4f4ada={'count':0x0,'rows':[]};var _0x55f592=_[_0xf4e7('0x27')](db['Campaign'][_0xf4e7('0x28')],function(_0x287833){return{'name':_0x287833[_0xf4e7('0x29')],'type':_0x287833[_0xf4e7('0x2a')][_0xf4e7('0x2b')]};});_0x313f0a[_0xf4e7('0x2c')]=_[_0xf4e7('0x27')](_0x55f592,_0xf4e7('0x2d'));_0x313f0a[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x3a94c6[_0xf4e7('0x2e')]);_0x313f0a[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x313f0a[_0xf4e7('0x2c')],_0x313f0a['query']);_0x38dd7e['attributes']=_['intersection'](_0x313f0a['model'],qs['fields'](_0x3a94c6[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x38dd7e['attributes']=_0x38dd7e[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x38dd7e['attributes']:_0x313f0a[_0xf4e7('0x2c')];if(!_0x3a94c6['query']['hasOwnProperty'](_0xf4e7('0x35'))){_0x38dd7e[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x3a94c6[_0xf4e7('0x2e')]['limit']);_0x38dd7e[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x3a94c6['query'][_0xf4e7('0x16')]);}_0x38dd7e['order']=qs[_0xf4e7('0x36')](_0x3a94c6[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x38dd7e[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x3a94c6[_0xf4e7('0x2e')],_0x313f0a[_0xf4e7('0x30')]),_0x55f592);if(_0x3a94c6['query'][_0xf4e7('0x39')]){_0x38dd7e[_0xf4e7('0x37')]=_['merge'](_0x38dd7e[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x55f592,function(_0x4ffc97){if(_0x4ffc97[_0xf4e7('0x2a')]!==_0xf4e7('0x3a')){var _0x2161e4={};_0x2161e4[_0x4ffc97['name']]={'$like':'%'+_0x3a94c6['query'][_0xf4e7('0x39')]+'%'};return _0x2161e4;}})});}_0x38dd7e=_['merge']({},_0x38dd7e,_0x3a94c6['options']);var _0x28ad1f={'where':_0x38dd7e[_0xf4e7('0x37')]};return db[_0xf4e7('0x3b')]['count'](_0x28ad1f)[_0xf4e7('0x1f')](function(_0x256ce4){_0x4f4ada[_0xf4e7('0x19')]=_0x256ce4;if(_0x3a94c6[_0xf4e7('0x2e')]['includeAll']){_0x38dd7e[_0xf4e7('0x3c')]=[{'all':!![]}];}return db['Campaign'][_0xf4e7('0x3d')](_0x38dd7e);})[_0xf4e7('0x1f')](function(_0x551ed3){_0x4f4ada[_0xf4e7('0x3e')]=_0x551ed3;return _0x4f4ada;})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x23058c,_0x38dd7e))[_0xf4e7('0x3f')](handleError(_0x23058c,null));};exports['show']=function(_0x387c00,_0x371af3){var _0x133844={'raw':![],'where':{'id':_0x387c00['params']['id']}},_0x26136b={};_0x26136b[_0xf4e7('0x2c')]=_['keys'](db[_0xf4e7('0x3b')][_0xf4e7('0x28')]);_0x26136b[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x387c00[_0xf4e7('0x2e')]);_0x26136b[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x26136b[_0xf4e7('0x2c')],_0x26136b[_0xf4e7('0x2e')]);_0x133844['attributes']=_[_0xf4e7('0x31')](_0x26136b[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x387c00['query'][_0xf4e7('0x32')]));_0x133844[_0xf4e7('0x33')]=_0x133844[_0xf4e7('0x33')]['length']?_0x133844['attributes']:_0x26136b['model'];if(_0x387c00[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x133844['include']=[{'all':!![]}];}_0x133844=_['merge']({},_0x133844,_0x387c00[_0xf4e7('0x41')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x42')](_0x133844)[_0xf4e7('0x1f')](handleEntityNotFound(_0x371af3,null))['then'](respondWithResult(_0x371af3,null))[_0xf4e7('0x3f')](handleError(_0x371af3,null));};exports['create']=function(_0x32027a,_0x30814b){return db[_0xf4e7('0x3b')][_0xf4e7('0x43')](_0x32027a[_0xf4e7('0x44')],{})[_0xf4e7('0x1f')](function(_0x37a7b3){var _0x4d9248=_0x32027a[_0xf4e7('0x45')][_0xf4e7('0x21')]({'plain':!![]});if(!_0x4d9248)throw new Error(_0xf4e7('0x46'));if(_0x4d9248[_0xf4e7('0x47')]===_0xf4e7('0x45')){var _0x2cb0fb=_0x37a7b3[_0xf4e7('0x21')]({'plain':!![]});var _0x2381f3=_0xf4e7('0x22');return db['UserProfileSection']['find']({'where':{'name':_0x2381f3,'userProfileId':_0x4d9248[_0xf4e7('0x48')]},'raw':!![]})[_0xf4e7('0x1f')](function(_0x4a1c58){if(_0x4a1c58&&_0x4a1c58[_0xf4e7('0x49')]===0x0){return db[_0xf4e7('0x23')][_0xf4e7('0x43')]({'name':_0x2cb0fb[_0xf4e7('0x2d')],'resourceId':_0x2cb0fb['id'],'type':_0x4a1c58[_0xf4e7('0x2d')],'sectionId':_0x4a1c58['id']},{})[_0xf4e7('0x1f')](function(){return _0x37a7b3;});}else{return _0x37a7b3;}})['catch'](function(_0x14beb1){logger[_0xf4e7('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14beb1);throw _0x14beb1;});}return _0x37a7b3;})['then'](respondWithResult(_0x30814b,0xc9))[_0xf4e7('0x3f')](handleError(_0x30814b,null));};exports['clone']=function(_0x15c76c,_0x3c0d26){var _0x28ee07={'where':{'id':_0x15c76c[_0xf4e7('0x4a')]['id']}},_0x22c0dc={};_0x22c0dc[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x3b')][_0xf4e7('0x28')]);_0x28ee07[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0x22c0dc[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x28ee07[_0xf4e7('0x33')]=_0x28ee07[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x28ee07[_0xf4e7('0x33')]:_0x22c0dc[_0xf4e7('0x2c')];if(_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x28ee07[_0xf4e7('0x3c')]=[{'all':!![]}];}_0x28ee07=_[_0xf4e7('0x4b')]({},_0x28ee07,_0x15c76c[_0xf4e7('0x41')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x42')](_0x28ee07)[_0xf4e7('0x1f')](handleEntityNotFound(_0x3c0d26,null))['then'](function(_0x1ba960){if(_0x1ba960){var _0x6660b4=_0x1ba960[_0xf4e7('0x21')]({'plain':!![]});_0x6660b4=qs[_0xf4e7('0x4c')](_0x6660b4,['id',_0xf4e7('0x4d'),_0xf4e7('0x4e')]);_0x15c76c[_0xf4e7('0x44')]=_[_0xf4e7('0x4c')](_0x15c76c[_0xf4e7('0x44')],['id',_0xf4e7('0x4d'),_0xf4e7('0x4e')]);return db[_0xf4e7('0x3b')][_0xf4e7('0x43')](_[_0xf4e7('0x4b')](_0x6660b4,_0x15c76c['body']),{'include':_0x15c76c[_0xf4e7('0x2e')][_0xf4e7('0x40')]?[{'all':!![]}]:undefined})[_0xf4e7('0x1f')](function(_0x3a5bd5){var _0x3ffb08=_0x15c76c[_0xf4e7('0x45')][_0xf4e7('0x21')]({'plain':!![]});if(!_0x3ffb08)throw new Error(_0xf4e7('0x46'));if(_0x3ffb08[_0xf4e7('0x47')]===_0xf4e7('0x45')){var _0x53ba9d=_0x3a5bd5[_0xf4e7('0x21')]({'plain':!![]});var _0x55479e=_0xf4e7('0x22');return db[_0xf4e7('0x4f')][_0xf4e7('0x42')]({'where':{'name':_0x55479e,'userProfileId':_0x3ffb08[_0xf4e7('0x48')]},'raw':!![]})[_0xf4e7('0x1f')](function(_0x1c86a){if(_0x1c86a&&_0x1c86a['autoAssociation']===0x0){return db[_0xf4e7('0x23')][_0xf4e7('0x43')]({'name':_0x53ba9d['name'],'resourceId':_0x53ba9d['id'],'type':_0x1c86a[_0xf4e7('0x2d')],'sectionId':_0x1c86a['id']},{})[_0xf4e7('0x1f')](function(){return _0x3a5bd5;});}else{return _0x3a5bd5;}})[_0xf4e7('0x3f')](function(_0x2e7e7c){logger[_0xf4e7('0x24')](_0xf4e7('0x50'),_0x2e7e7c);throw _0x2e7e7c;});}return _0x3a5bd5;});}})[_0xf4e7('0x1f')](respondWithResult(_0x3c0d26,0xc9))[_0xf4e7('0x3f')](handleError(_0x3c0d26,null));};exports[_0xf4e7('0x1e')]=function(_0x3f5a82,_0x4ac213){if(_0x3f5a82[_0xf4e7('0x44')]['id']){delete _0x3f5a82[_0xf4e7('0x44')]['id'];}return db[_0xf4e7('0x3b')]['find']({'where':{'id':_0x3f5a82['params']['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x4ac213,null))[_0xf4e7('0x1f')](saveUpdates(_0x3f5a82['body'],null))[_0xf4e7('0x1f')](respondWithResult(_0x4ac213,null))[_0xf4e7('0x3f')](handleError(_0x4ac213,null));};exports[_0xf4e7('0x20')]=function(_0x4c9249,_0xe53c75){return db['Campaign'][_0xf4e7('0x42')]({'where':{'id':_0x4c9249[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0xe53c75,null))[_0xf4e7('0x1f')](removeEntity(_0xe53c75,null))[_0xf4e7('0x3f')](handleError(_0xe53c75,null));};exports[_0xf4e7('0x51')]=function(_0x45fe2e,_0x282070,_0x1eab05){var _0x553cfc={'raw':!![],'where':{}};var _0x3f0b62={};var _0x2bb2a4={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x45fe2e[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x282070,null))[_0xf4e7('0x1f')](function(_0x39dd04){if(_0x39dd04){_0x3f0b62[_0xf4e7('0x2c')]=_['keys'](db[_0xf4e7('0x53')][_0xf4e7('0x28')]);_0x3f0b62[_0xf4e7('0x2e')]=_['keys'](_0x45fe2e[_0xf4e7('0x2e')]);_0x3f0b62[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x3f0b62[_0xf4e7('0x2c')],_0x3f0b62[_0xf4e7('0x2e')]);_0x553cfc[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0x3f0b62[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x45fe2e['query']['fields']));_0x553cfc[_0xf4e7('0x33')]=_0x553cfc[_0xf4e7('0x33')]['length']?_0x553cfc[_0xf4e7('0x33')]:_0x3f0b62[_0xf4e7('0x2c')];if(!_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x54')]('nolimit')){_0x553cfc[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x553cfc[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x16')]);}_0x553cfc[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x45fe2e[_0xf4e7('0x2e')]['sort']);_0x553cfc[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x45fe2e['query'],_0x3f0b62['filters']));_0x553cfc['where'][_0xf4e7('0x56')]=_0x39dd04['id'];if(_0x45fe2e[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x553cfc['where']=_[_0xf4e7('0x4b')](_0x553cfc[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x553cfc['attributes'],function(_0x5c5605){var _0x53d3b1={};_0x53d3b1[_0x5c5605]={'$like':'%'+_0x45fe2e['query']['filter']+'%'};return _0x53d3b1;})});}_0x553cfc=_[_0xf4e7('0x4b')]({},_0x553cfc,_0x45fe2e['options']);return db[_0xf4e7('0x53')][_0xf4e7('0x19')]({'where':_0x553cfc['where']})[_0xf4e7('0x1f')](function(_0x386849){_0x2bb2a4[_0xf4e7('0x19')]=_0x386849;if(_0x45fe2e[_0xf4e7('0x2e')]['includeAll']){_0x553cfc[_0xf4e7('0x3c')]=[{'all':!![]}];}return db[_0xf4e7('0x53')]['findAll'](_0x553cfc);})['then'](function(_0x93e024){_0x2bb2a4[_0xf4e7('0x3e')]=_0x93e024;return _0x2bb2a4;});}})['then'](respondWithFilteredResult(_0x282070,_0x553cfc))[_0xf4e7('0x3f')](handleError(_0x282070,null));};exports[_0xf4e7('0x57')]=function(_0x4e0829,_0x32d975,_0x1fbed6){var _0x58ccf2={'raw':!![],'where':{}};var _0x29d4ae={};var _0x5517f1={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x4e0829[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32d975,null))['then'](function(_0x4c0c4b){if(_0x4c0c4b){_0x29d4ae['model']=_[_0xf4e7('0x2f')](db[_0xf4e7('0x58')]['rawAttributes']);_0x29d4ae[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x4e0829['query']);_0x29d4ae[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x29d4ae[_0xf4e7('0x2c')],_0x29d4ae[_0xf4e7('0x2e')]);_0x58ccf2[_0xf4e7('0x33')]=_['intersection'](_0x29d4ae[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x58ccf2[_0xf4e7('0x33')]=_0x58ccf2['attributes']['length']?_0x58ccf2[_0xf4e7('0x33')]:_0x29d4ae[_0xf4e7('0x2c')];if(!_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x54')]('nolimit')){_0x58ccf2[_0xf4e7('0x18')]=qs['limit'](_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x58ccf2[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x4e0829['query'][_0xf4e7('0x16')]);}_0x58ccf2[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x4e0829['query'][_0xf4e7('0x36')]);_0x58ccf2[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_[_0xf4e7('0x38')](_0x4e0829[_0xf4e7('0x2e')],_0x29d4ae[_0xf4e7('0x30')]));_0x58ccf2[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x4c0c4b['id'];if(_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x58ccf2[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x58ccf2[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x58ccf2['attributes'],function(_0x4fc67d){var _0x4c44d6={};_0x4c44d6[_0x4fc67d]={'$like':'%'+_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x4c44d6;})});}_0x58ccf2=_[_0xf4e7('0x4b')]({},_0x58ccf2,_0x4e0829[_0xf4e7('0x41')]);return db[_0xf4e7('0x58')]['count']({'where':_0x58ccf2[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x5d8caa){_0x5517f1['count']=_0x5d8caa;if(_0x4e0829[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x58ccf2['include']=[{'all':!![]}];}return db[_0xf4e7('0x58')][_0xf4e7('0x3d')](_0x58ccf2);})[_0xf4e7('0x1f')](function(_0x412dfe){_0x5517f1[_0xf4e7('0x3e')]=_0x412dfe;return _0x5517f1;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x32d975,_0x58ccf2))[_0xf4e7('0x3f')](handleError(_0x32d975,null));};exports[_0xf4e7('0x59')]=function(_0x1437b6,_0x52aca0,_0xf76238){var _0x3dcabd={'raw':!![],'where':{}};var _0x3c6c75={};var _0x15d808={'count':0x0,'rows':[]};return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x1437b6[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x52aca0,null))[_0xf4e7('0x1f')](function(_0x54d487){if(_0x54d487){_0x3c6c75['model']=_[_0xf4e7('0x2f')](db['CmHopperFinal'][_0xf4e7('0x28')]);_0x3c6c75[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x1437b6[_0xf4e7('0x2e')]);_0x3c6c75[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0x3c6c75[_0xf4e7('0x2c')],_0x3c6c75[_0xf4e7('0x2e')]);_0x3dcabd['attributes']=_['intersection'](_0x3c6c75['model'],qs[_0xf4e7('0x32')](_0x1437b6['query'][_0xf4e7('0x32')]));_0x3dcabd[_0xf4e7('0x33')]=_0x3dcabd['attributes'][_0xf4e7('0x34')]?_0x3dcabd[_0xf4e7('0x33')]:_0x3c6c75['model'];if(!_0x1437b6['query']['hasOwnProperty']('nolimit')){_0x3dcabd[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x1437b6['query'][_0xf4e7('0x18')]);_0x3dcabd[_0xf4e7('0x16')]=qs['offset'](_0x1437b6['query'][_0xf4e7('0x16')]);}_0x3dcabd[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x1437b6['query'][_0xf4e7('0x36')]);_0x3dcabd[_0xf4e7('0x37')]=qs['filters'](_[_0xf4e7('0x38')](_0x1437b6[_0xf4e7('0x2e')],_0x3c6c75[_0xf4e7('0x30')]));_0x3dcabd[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x54d487['id'];if(_0x1437b6[_0xf4e7('0x2e')]['filter']){_0x3dcabd[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x3dcabd[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x3dcabd['attributes'],function(_0x41bdb4){var _0x4bfe66={};_0x4bfe66[_0x41bdb4]={'$like':'%'+_0x1437b6[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x4bfe66;})});}_0x3dcabd=_[_0xf4e7('0x4b')]({},_0x3dcabd,_0x1437b6[_0xf4e7('0x41')]);return db['CmHopperFinal'][_0xf4e7('0x19')]({'where':_0x3dcabd[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x4516cd){_0x15d808[_0xf4e7('0x19')]=_0x4516cd;if(_0x1437b6[_0xf4e7('0x2e')][_0xf4e7('0x40')]){_0x3dcabd[_0xf4e7('0x3c')]=[{'all':!![]}];}return db[_0xf4e7('0x5a')][_0xf4e7('0x3d')](_0x3dcabd);})[_0xf4e7('0x1f')](function(_0x5f2c06){_0x15d808['rows']=_0x5f2c06;return _0x15d808;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x52aca0,_0x3dcabd))[_0xf4e7('0x3f')](handleError(_0x52aca0,null));};exports['getHopperBlacks']=function(_0x2fa7ed,_0x16b2c3,_0x46ab86){var _0x45b883={'raw':!![],'where':{}};var _0xd2548e={};var _0x102ed5={'count':0x0,'rows':[]};return db['Campaign'][_0xf4e7('0x52')]({'where':{'id':_0x2fa7ed[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x16b2c3,null))[_0xf4e7('0x1f')](function(_0x45a09a){if(_0x45a09a){_0xd2548e[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db['CmHopperBlack'][_0xf4e7('0x28')]);_0xd2548e[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x2fa7ed[_0xf4e7('0x2e')]);_0xd2548e[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0xd2548e['model'],_0xd2548e[_0xf4e7('0x2e')]);_0x45b883['attributes']=_[_0xf4e7('0x31')](_0xd2548e[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x2fa7ed[_0xf4e7('0x2e')]['fields']));_0x45b883[_0xf4e7('0x33')]=_0x45b883[_0xf4e7('0x33')][_0xf4e7('0x34')]?_0x45b883[_0xf4e7('0x33')]:_0xd2548e['model'];if(!_0x2fa7ed[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x45b883[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x2fa7ed[_0xf4e7('0x2e')]['limit']);_0x45b883['offset']=qs[_0xf4e7('0x16')](_0x2fa7ed['query'][_0xf4e7('0x16')]);}_0x45b883[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x2fa7ed[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x45b883[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_['pick'](_0x2fa7ed[_0xf4e7('0x2e')],_0xd2548e[_0xf4e7('0x30')]));_0x45b883[_0xf4e7('0x37')][_0xf4e7('0x56')]=_0x45a09a['id'];if(_0x2fa7ed[_0xf4e7('0x2e')]['filter']){_0x45b883[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x45b883['where'],{'$or':_[_0xf4e7('0x27')](_0x45b883['attributes'],function(_0xec097b){var _0x3d49cf={};_0x3d49cf[_0xec097b]={'$like':'%'+_0x2fa7ed['query'][_0xf4e7('0x39')]+'%'};return _0x3d49cf;})});}_0x45b883=_[_0xf4e7('0x4b')]({},_0x45b883,_0x2fa7ed[_0xf4e7('0x41')]);return db[_0xf4e7('0x5b')][_0xf4e7('0x19')]({'where':_0x45b883[_0xf4e7('0x37')]})[_0xf4e7('0x1f')](function(_0x4d682b){_0x102ed5[_0xf4e7('0x19')]=_0x4d682b;if(_0x2fa7ed['query'][_0xf4e7('0x40')]){_0x45b883[_0xf4e7('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x45b883);})[_0xf4e7('0x1f')](function(_0x48ad82){_0x102ed5[_0xf4e7('0x3e')]=_0x48ad82;return _0x102ed5;});}})[_0xf4e7('0x1f')](respondWithFilteredResult(_0x16b2c3,_0x45b883))[_0xf4e7('0x3f')](handleError(_0x16b2c3,null));};exports[_0xf4e7('0x5c')]=function(_0x35c5d8,_0x28c48c,_0x5bc22d){var _0x47fd8e={};var _0x47c08a={};var _0x3b8170;var _0x57a6dd;return db['Campaign']['findOne']({'where':{'id':_0x35c5d8['params']['id']}})['then'](handleEntityNotFound(_0x28c48c,null))[_0xf4e7('0x1f')](function(_0x23b249){if(_0x23b249){_0x3b8170=_0x23b249;_0x47c08a[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x5d')][_0xf4e7('0x28')]);_0x47c08a[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x35c5d8[_0xf4e7('0x2e')]);_0x47c08a['filters']=_[_0xf4e7('0x31')](_0x47c08a['model'],_0x47c08a[_0xf4e7('0x2e')]);_0x47fd8e['attributes']=_[_0xf4e7('0x31')](_0x47c08a[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x32')]));_0x47fd8e[_0xf4e7('0x33')]=_0x47fd8e['attributes'][_0xf4e7('0x34')]?_0x47fd8e[_0xf4e7('0x33')]:_0x47c08a[_0xf4e7('0x2c')];_0x47fd8e[_0xf4e7('0x55')]=qs[_0xf4e7('0x36')](_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x47fd8e[_0xf4e7('0x37')]=qs['filters'](_[_0xf4e7('0x38')](_0x35c5d8[_0xf4e7('0x2e')],_0x47c08a[_0xf4e7('0x30')]));if(_0x35c5d8['query'][_0xf4e7('0x39')]){_0x47fd8e[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x47fd8e[_0xf4e7('0x37')],{'$or':_[_0xf4e7('0x27')](_0x47fd8e[_0xf4e7('0x33')],function(_0x27cb64){var _0x650668={};_0x650668[_0x27cb64]={'$like':'%'+_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x650668;})});}_0x47fd8e=_[_0xf4e7('0x4b')]({},_0x47fd8e,_0x35c5d8[_0xf4e7('0x41')]);return _0x3b8170['getLists'](_0x47fd8e);}})['then'](function(_0x1df9ef){if(_0x1df9ef){_0x57a6dd=_0x1df9ef['length'];if(!_0x35c5d8[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x47fd8e[_0xf4e7('0x18')]=qs[_0xf4e7('0x18')](_0x35c5d8['query'][_0xf4e7('0x18')]);_0x47fd8e[_0xf4e7('0x16')]=qs[_0xf4e7('0x16')](_0x35c5d8['query'][_0xf4e7('0x16')]);}return _0x3b8170[_0xf4e7('0x5c')](_0x47fd8e);}})[_0xf4e7('0x1f')](function(_0x27db3d){if(_0x27db3d){return _0x27db3d?{'count':_0x57a6dd,'rows':_0x27db3d}:null;}})[_0xf4e7('0x1f')](respondWithResult(_0x28c48c,null))[_0xf4e7('0x3f')](handleError(_0x28c48c,null));};exports[_0xf4e7('0x5e')]=function(_0x298f72,_0x5a5610,_0x4c9d2a){var _0x4b6d7f,_0x3e2421;return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x298f72[_0xf4e7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a5610,null))[_0xf4e7('0x1f')](function(_0x24fe8a){if(_0x24fe8a){_0x3e2421=_0x24fe8a;return _0x24fe8a[_0xf4e7('0x5e')](_0x298f72[_0xf4e7('0x44')]['ids'],_[_0xf4e7('0x4c')](_0x298f72[_0xf4e7('0x44')],[_0xf4e7('0x5f'),'id'])||{});}return null;})[_0xf4e7('0x60')](function(_0x2114a8){var _0xfe2a56;_0x4b6d7f=_0x2114a8||[];var _0x31e981=[];if(_0x2114a8){for(var _0x50ab11=0x0;_0x50ab11<_0x2114a8[_0xf4e7('0x34')];_0x50ab11+=0x1){var _0x2bba4d=_0x2114a8[_0x50ab11][_0xf4e7('0x21')]({'plain':!![]});_0x3e2421[_0xf4e7('0x61')]=_0x298f72[_0xf4e7('0x44')][_0xf4e7('0x61')]?_0x298f72['body'][_0xf4e7('0x61')]:_0x3e2421[_0xf4e7('0x61')];switch(_0x3e2421[_0xf4e7('0x61')]){case _0xf4e7('0x62'):_0xfe2a56=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')](_0xf4e7('0x65'))[_0xf4e7('0x66')]([_0xf4e7('0x67'),'scheduledAt',_0xf4e7('0x68'),_0xf4e7('0x69'),_0xf4e7('0x56'),_0xf4e7('0x4d'),'updatedAt'],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),'phone')[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x6c'))[_0xf4e7('0x6b')]('id','ContactId')[_0xf4e7('0x6b')](_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')](),'ListId')[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'createdAt')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))[_0xf4e7('0x70')](_0xf4e7('0x71'))[_0xf4e7('0x37')](_0xf4e7('0x72'))['where'](_0xf4e7('0x73'),_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')]())[_0xf4e7('0x37')](_0xf4e7('0x74'))['where'](_0xf4e7('0x75'),squel[_0xf4e7('0x6a')]()['field'](_0xf4e7('0x76'))[_0xf4e7('0x70')](_0xf4e7('0x77'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')]()))['where'](_0xf4e7('0x75'),squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')]('COALESCE(phone,\x27\x27)')[_0xf4e7('0x70')](_0xf4e7('0x65'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')]())))[_0xf4e7('0x6e')]();break;case'onlyIfOpen':_0xfe2a56=squel['insert']()[_0xf4e7('0x64')](_0xf4e7('0x65'))['fromQuery']([_0xf4e7('0x67'),_0xf4e7('0x6c'),_0xf4e7('0x68'),_0xf4e7('0x69'),'CampaignId',_0xf4e7('0x4d'),_0xf4e7('0x4e')],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),'phone')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'scheduledAt')[_0xf4e7('0x6b')]('id',_0xf4e7('0x68'))[_0xf4e7('0x6b')](_0x2bba4d['CmListId'][_0xf4e7('0x6e')](),'ListId')[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),'CampaignId')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'createdAt')[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))[_0xf4e7('0x70')](_0xf4e7('0x71'))['where'](_0xf4e7('0x72'))[_0xf4e7('0x37')]('ListId\x20=\x20?',_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')]())[_0xf4e7('0x37')](_0xf4e7('0x74'))[_0xf4e7('0x37')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x79'))[_0xf4e7('0x70')](_0xf4e7('0x65'))[_0xf4e7('0x37')](_0xf4e7('0x78'),_0x298f72[_0xf4e7('0x4a')]['id']['toString']())))[_0xf4e7('0x6e')]();break;default:_0xfe2a56=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')]('cm_hopper')[_0xf4e7('0x66')]([_0xf4e7('0x67'),'scheduledAt','ContactId',_0xf4e7('0x69'),_0xf4e7('0x56'),'createdAt',_0xf4e7('0x4e')],squel[_0xf4e7('0x6a')]()[_0xf4e7('0x6b')](_0xf4e7('0x67'),_0xf4e7('0x67'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),'scheduledAt')['field']('id',_0xf4e7('0x68'))['field'](_0x2bba4d[_0xf4e7('0x6d')][_0xf4e7('0x6e')](),_0xf4e7('0x69'))[_0xf4e7('0x6b')](_0x298f72[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))['field'](_0xf4e7('0x6f'),_0xf4e7('0x4d'))[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x4e'))[_0xf4e7('0x70')]('cm_contacts')[_0xf4e7('0x37')]('deletedAt\x20IS\x20NULL')[_0xf4e7('0x37')]('ListId\x20=\x20?',_0x2bba4d[_0xf4e7('0x6d')]['toString']())[_0xf4e7('0x37')](_0xf4e7('0x74')))[_0xf4e7('0x6e')]();}_0x31e981['push'](db['sequelize'][_0xf4e7('0x2e')](_0xfe2a56));}return BPromise['all'](_0x31e981);}})[_0xf4e7('0x1f')](function(){return _0x4b6d7f;})[_0xf4e7('0x1f')](respondWithResult(_0x5a5610,null))[_0xf4e7('0x3f')](handleError(_0x5a5610,null));};exports['removeLists']=function(_0x5c51a0,_0x5b100b,_0x50cbf3){return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x5c51a0[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x5b100b,null))['then'](function(_0x21813a){if(_0x21813a){return _0x21813a[_0xf4e7('0x7a')](_0x5c51a0[_0xf4e7('0x2e')][_0xf4e7('0x5f')]);}})[_0xf4e7('0x1f')](function(_0x2342fb){if(_0x2342fb){return db['CmHopper'][_0xf4e7('0x20')]({'where':{'ListId':_0x5c51a0[_0xf4e7('0x2e')]['ids'],'CampaignId':_0x5c51a0['params']['id']}})['then'](function(){return _0x2342fb;});}})[_0xf4e7('0x1f')](respondWithStatusCode(_0x5b100b,null))[_0xf4e7('0x3f')](handleError(_0x5b100b,null));};exports[_0xf4e7('0x7b')]=function(_0x105c66,_0x3ff03a,_0xa1a61e){var _0x2961db={};var _0xc98288={};var _0x549018;var _0x59c2b2;return db[_0xf4e7('0x3b')][_0xf4e7('0x52')]({'where':{'id':_0x105c66[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x3ff03a,null))[_0xf4e7('0x1f')](function(_0x612d43){if(_0x612d43){_0x549018=_0x612d43;_0xc98288[_0xf4e7('0x2c')]=_[_0xf4e7('0x2f')](db[_0xf4e7('0x5d')][_0xf4e7('0x28')]);_0xc98288[_0xf4e7('0x2e')]=_[_0xf4e7('0x2f')](_0x105c66[_0xf4e7('0x2e')]);_0xc98288[_0xf4e7('0x30')]=_[_0xf4e7('0x31')](_0xc98288[_0xf4e7('0x2c')],_0xc98288[_0xf4e7('0x2e')]);_0x2961db[_0xf4e7('0x33')]=_[_0xf4e7('0x31')](_0xc98288[_0xf4e7('0x2c')],qs[_0xf4e7('0x32')](_0x105c66[_0xf4e7('0x2e')]['fields']));_0x2961db['attributes']=_0x2961db['attributes'][_0xf4e7('0x34')]?_0x2961db[_0xf4e7('0x33')]:_0xc98288[_0xf4e7('0x2c')];_0x2961db['order']=qs[_0xf4e7('0x36')](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x36')]);_0x2961db[_0xf4e7('0x37')]=qs[_0xf4e7('0x30')](_['pick'](_0x105c66[_0xf4e7('0x2e')],_0xc98288[_0xf4e7('0x30')]));if(_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x39')]){_0x2961db[_0xf4e7('0x37')]=_[_0xf4e7('0x4b')](_0x2961db['where'],{'$or':_[_0xf4e7('0x27')](_0x2961db[_0xf4e7('0x33')],function(_0x530d1b){var _0x1059b6={};_0x1059b6[_0x530d1b]={'$like':'%'+_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x39')]+'%'};return _0x1059b6;})});}_0x2961db=_[_0xf4e7('0x4b')]({},_0x2961db,_0x105c66[_0xf4e7('0x41')]);return _0x549018[_0xf4e7('0x7b')](_0x2961db);}})[_0xf4e7('0x1f')](function(_0x461957){if(_0x461957){_0x59c2b2=_0x461957['length'];if(!_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x54')](_0xf4e7('0x35'))){_0x2961db[_0xf4e7('0x18')]=qs['limit'](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x18')]);_0x2961db[_0xf4e7('0x16')]=qs['offset'](_0x105c66[_0xf4e7('0x2e')][_0xf4e7('0x16')]);}return _0x549018[_0xf4e7('0x7b')](_0x2961db);}})[_0xf4e7('0x1f')](function(_0x42082f){if(_0x42082f){return _0x42082f?{'count':_0x59c2b2,'rows':_0x42082f}:null;}})[_0xf4e7('0x1f')](respondWithResult(_0x3ff03a,null))[_0xf4e7('0x3f')](handleError(_0x3ff03a,null));};exports[_0xf4e7('0x7c')]=function(_0x2135fb,_0x395d0c,_0x3f1f53){var _0x49970a,_0x5f04f0;return db[_0xf4e7('0x3b')][_0xf4e7('0x42')]({'where':{'id':_0x2135fb[_0xf4e7('0x4a')]['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x395d0c,null))[_0xf4e7('0x1f')](function(_0x5c05f0){if(_0x5c05f0){_0x5f04f0=_0x5c05f0;return _0x5c05f0['addBlackLists'](_0x2135fb['body'][_0xf4e7('0x5f')],_[_0xf4e7('0x4c')](_0x2135fb[_0xf4e7('0x44')],[_0xf4e7('0x5f'),'id'])||{});}return null;})[_0xf4e7('0x60')](function(_0x4c3d4c){var _0xc85f72;_0x49970a=_0x4c3d4c||[];var _0xc0013d=[];if(_0x4c3d4c){for(var _0x5f5109=0x0;_0x5f5109<_0x4c3d4c['length'];_0x5f5109+=0x1){var _0x27c58a=_0x4c3d4c[_0x5f5109][_0xf4e7('0x21')]({'plain':!![]});_0xc85f72=squel[_0xf4e7('0x63')]()[_0xf4e7('0x64')](_0xf4e7('0x7d'))[_0xf4e7('0x66')]([_0xf4e7('0x67'),'ContactId',_0xf4e7('0x69'),_0xf4e7('0x56'),_0xf4e7('0x4d'),'updatedAt'],squel['select']()['field'](_0xf4e7('0x67'),_0xf4e7('0x67'))[_0xf4e7('0x6b')]('id','ContactId')[_0xf4e7('0x6b')](_0x27c58a[_0xf4e7('0x6d')]['toString'](),_0xf4e7('0x69'))[_0xf4e7('0x6b')](_0x2135fb[_0xf4e7('0x4a')]['id'][_0xf4e7('0x6e')](),_0xf4e7('0x56'))[_0xf4e7('0x6b')]('NOW()',_0xf4e7('0x4d'))[_0xf4e7('0x6b')](_0xf4e7('0x6f'),_0xf4e7('0x4e'))['from'](_0xf4e7('0x71'))[_0xf4e7('0x37')]('deletedAt\x20IS\x20NULL')[_0xf4e7('0x37')](_0xf4e7('0x73'),_0x27c58a[_0xf4e7('0x6d')]['toString']())['where'](_0xf4e7('0x74')))[_0xf4e7('0x6e')]();_0xc0013d[_0xf4e7('0x7e')](db[_0xf4e7('0x7f')][_0xf4e7('0x2e')](_0xc85f72));}return BPromise['all'](_0xc0013d);}})[_0xf4e7('0x1f')](function(){return _0x49970a;})[_0xf4e7('0x1f')](respondWithResult(_0x395d0c,null))[_0xf4e7('0x3f')](handleError(_0x395d0c,null));};exports[_0xf4e7('0x80')]=function(_0x2f9850,_0x5d32c3,_0x487ef5){return db[_0xf4e7('0x3b')]['find']({'where':{'id':_0x2f9850['params']['id']}})[_0xf4e7('0x1f')](handleEntityNotFound(_0x5d32c3,null))[_0xf4e7('0x1f')](function(_0x44d717){if(_0x44d717){return _0x44d717['removeBlackLists'](_0x2f9850[_0xf4e7('0x2e')][_0xf4e7('0x5f')]);}})[_0xf4e7('0x1f')](function(_0x285c32){if(_0x285c32){return db[_0xf4e7('0x5b')][_0xf4e7('0x20')]({'where':{'ListId':_0x2f9850[_0xf4e7('0x2e')][_0xf4e7('0x5f')],'CampaignId':_0x2f9850[_0xf4e7('0x4a')]['id']}})['then'](function(){return _0x285c32;});}})[_0xf4e7('0x1f')](respondWithStatusCode(_0x5d32c3,null))[_0xf4e7('0x3f')](handleError(_0x5d32c3,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 401890d..cf677b2 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(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index cc8ef8d..81c26b4 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 _0xe189=['Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','map','include','model','info','GetCampaign','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xe189,0x194));var _0x9e18=function(_0x29cbba,_0x5355bf){_0x29cbba=_0x29cbba-0x0;var _0x411a9e=_0xe189[_0x29cbba];return _0x411a9e;};'use strict';var _=require(_0x9e18('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e18('0x1'));var rs=require(_0x9e18('0x2'));var fs=require('fs');var Redis=require(_0x9e18('0x3'));var db=require(_0x9e18('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e18('0x5'));var config=require(_0x9e18('0x6'));var jayson=require(_0x9e18('0x7'));var client=jayson[_0x9e18('0x8')][_0x9e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6097,_0x3153cf,_0x2e4691){return new BPromise(function(_0x4656a4,_0x50a0ce){return client[_0x9e18('0xa')](_0x5e6097,_0x2e4691)[_0x9e18('0xb')](function(_0x33e9cd){logger['info'](_0x9e18('0xc'),_0x3153cf,_0x9e18('0xd'));logger[_0x9e18('0xe')](_0x9e18('0xf'),_0x3153cf,_0x9e18('0xd'),JSON[_0x9e18('0x10')](_0x33e9cd));if(_0x33e9cd[_0x9e18('0x11')]){if(_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x12')]===0x1f4){logger['error'](_0x9e18('0xc'),_0x3153cf,_0x33e9cd['error'][_0x9e18('0x13')]);return _0x50a0ce(_0x33e9cd[_0x9e18('0x11')]['message']);}logger[_0x9e18('0x11')](_0x9e18('0xc'),_0x3153cf,_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x13')]);return _0x4656a4(_0x33e9cd['error'][_0x9e18('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x3153cf,_0x9e18('0xd'));_0x4656a4(_0x33e9cd['result'][_0x9e18('0x13')]);}})[_0x9e18('0x14')](function(_0x1f71fc){logger[_0x9e18('0x11')]('Campaign,\x20%s,\x20%s',_0x3153cf,_0x1f71fc);_0x50a0ce(_0x1f71fc);});});}exports['GetCampaign']=function(_0x15cf20){var _0x446098=this;return new Promise(function(_0x57cd1f,_0x1aa23f){return db['Campaign'][_0x9e18('0x15')]({'raw':_0x15cf20['options']?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x17')]===undefined?!![]:![]:!![],'where':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x18')]||null:null,'attributes':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x19')]||null:null,'limit':_0x15cf20[_0x9e18('0x16')]?_0x15cf20['options'][_0x9e18('0x1a')]||null:null,'include':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')]['include']?_[_0x9e18('0x1b')](_0x15cf20['options'][_0x9e18('0x1c')],function(_0x50131d){return{'model':db[_0x50131d[_0x9e18('0x1d')]],'as':_0x50131d['as'],'attributes':_0x50131d['attributes'],'include':_0x50131d[_0x9e18('0x1c')]?_[_0x9e18('0x1b')](_0x50131d['include'],function(_0x12f90d){return{'model':db[_0x12f90d['model']],'as':_0x12f90d['as'],'attributes':_0x12f90d['attributes'],'include':_0x12f90d[_0x9e18('0x1c')]?_['map'](_0x12f90d[_0x9e18('0x1c')],function(_0x49a3d6){return{'model':db[_0x49a3d6[_0x9e18('0x1d')]],'as':_0x49a3d6['as'],'attributes':_0x49a3d6[_0x9e18('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9e18('0xb')](function(_0xd115f3){logger[_0x9e18('0x1e')](_0x9e18('0x1f'),_0x15cf20);logger[_0x9e18('0xe')](_0x9e18('0x1f'),_0x15cf20,JSON[_0x9e18('0x10')](_0xd115f3));_0x57cd1f(_0xd115f3);})['catch'](function(_0x2ee4da){logger[_0x9e18('0x11')](_0x9e18('0x1f'),_0x2ee4da[_0x9e18('0x13')],_0x15cf20);_0x1aa23f(_0x446098['error'](0x1f4,_0x2ee4da['message']));});});}; \ No newline at end of file +var _0xf2cb=['code','message','result','catch','GetCampaign','findAll','options','raw','where','attributes','map','include','model','then','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xe9ce81,_0x4d48bb){var _0x27c089=function(_0x27a214){while(--_0x27a214){_0xe9ce81['push'](_0xe9ce81['shift']());}};_0x27c089(++_0x4d48bb);}(_0xf2cb,0x130));var _0xbf2c=function(_0x1b2978,_0x2bfc85){_0x1b2978=_0x1b2978-0x0;var _0x73cc34=_0xf2cb[_0x1b2978];return _0x73cc34;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('Campaign,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('Campaign,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});}exports[_0xbf2c('0x13')]=function(_0x1df2ab){var _0x298329=this;return new Promise(function(_0x32a44d,_0x266035){return db['Campaign'][_0xbf2c('0x14')]({'raw':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x16')]===undefined?!![]:![]:!![],'where':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x17')]||null:null,'attributes':_0x1df2ab['options']?_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x18')]||null:null,'limit':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')]['limit']||null:null,'include':_0x1df2ab[_0xbf2c('0x15')]?_0x1df2ab[_0xbf2c('0x15')]['include']?_[_0xbf2c('0x19')](_0x1df2ab[_0xbf2c('0x15')][_0xbf2c('0x1a')],function(_0x52ecb4){return{'model':db[_0x52ecb4['model']],'as':_0x52ecb4['as'],'attributes':_0x52ecb4[_0xbf2c('0x18')],'include':_0x52ecb4[_0xbf2c('0x1a')]?_[_0xbf2c('0x19')](_0x52ecb4[_0xbf2c('0x1a')],function(_0x108aa8){return{'model':db[_0x108aa8[_0xbf2c('0x1b')]],'as':_0x108aa8['as'],'attributes':_0x108aa8[_0xbf2c('0x18')],'include':_0x108aa8['include']?_['map'](_0x108aa8[_0xbf2c('0x1a')],function(_0xcbd882){return{'model':db[_0xcbd882[_0xbf2c('0x1b')]],'as':_0xcbd882['as'],'attributes':_0xcbd882[_0xbf2c('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbf2c('0x1c')](function(_0x4a0257){logger[_0xbf2c('0x8')](_0xbf2c('0x13'),_0x1df2ab);logger[_0xbf2c('0xa')]('GetCampaign',_0x1df2ab,JSON[_0xbf2c('0xd')](_0x4a0257));_0x32a44d(_0x4a0257);})['catch'](function(_0x3a9130){logger[_0xbf2c('0xe')](_0xbf2c('0x13'),_0x3a9130[_0xbf2c('0x10')],_0x1df2ab);_0x266035(_0x298329[_0xbf2c('0xe')](0x1f4,_0x3a9130['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 8482611..e86a006 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 _0x73d7=['/:id/clone','clone','addLists','put','update','delete','destroy','removeLists','removeBlackLists','util','connect-timeout','express','Router','../../components/auth/service','./campaign.controller','isAuthenticated','index','/:id','show','getHoppers','get','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create'];(function(_0x380a3f,_0x202483){var _0x2b4eca=function(_0x1e99b2){while(--_0x1e99b2){_0x380a3f['push'](_0x380a3f['shift']());}};_0x2b4eca(++_0x202483);}(_0x73d7,0x135));var _0x773d=function(_0x3371f6,_0x4d7264){_0x3371f6=_0x3371f6-0x0;var _0x2a182d=_0x73d7[_0x3371f6];return _0x2a182d;};'use strict';var multer=require('multer');var util=require(_0x773d('0x0'));var path=require('path');var timeout=require(_0x773d('0x1'));var express=require(_0x773d('0x2'));var router=express[_0x773d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x773d('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x773d('0x5'));router['get']('/',auth[_0x773d('0x6')](),controller[_0x773d('0x7')]);router['get'](_0x773d('0x8'),auth['isAuthenticated'](),controller[_0x773d('0x9')]);router['get']('/:id/hoppers',auth[_0x773d('0x6')](),controller[_0x773d('0xa')]);router[_0x773d('0xb')](_0x773d('0xc'),auth[_0x773d('0x6')](),controller[_0x773d('0xd')]);router['get'](_0x773d('0xe'),auth['isAuthenticated'](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x773d('0xb')](_0x773d('0xf'),auth[_0x773d('0x6')](),controller[_0x773d('0x10')]);router[_0x773d('0xb')](_0x773d('0x11'),auth[_0x773d('0x6')](),controller[_0x773d('0x12')]);router[_0x773d('0x13')]('/',auth[_0x773d('0x6')](),controller[_0x773d('0x14')]);router[_0x773d('0x13')](_0x773d('0x15'),auth[_0x773d('0x6')](),controller[_0x773d('0x16')]);router['post']('/:id/lists',auth['isAuthenticated'](),controller[_0x773d('0x17')]);router['post'](_0x773d('0x11'),auth[_0x773d('0x6')](),controller['addBlackLists']);router[_0x773d('0x18')](_0x773d('0x8'),auth[_0x773d('0x6')](),controller[_0x773d('0x19')]);router[_0x773d('0x1a')](_0x773d('0x8'),auth[_0x773d('0x6')](),controller[_0x773d('0x1b')]);router[_0x773d('0x1a')](_0x773d('0xf'),auth[_0x773d('0x6')](),controller[_0x773d('0x1c')]);router[_0x773d('0x1a')](_0x773d('0x11'),auth[_0x773d('0x6')](),controller[_0x773d('0x1d')]);module['exports']=router; \ No newline at end of file +var _0xcfd2=['getBlackLists','create','/:id/clone','post','addBlackLists','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists'];(function(_0x53b53e,_0x498437){var _0xbb6179=function(_0x3975eb){while(--_0x3975eb){_0x53b53e['push'](_0x53b53e['shift']());}};_0xbb6179(++_0x498437);}(_0xcfd2,0xe9));var _0x2cfd=function(_0x4542d4,_0x4e304b){_0x4542d4=_0x4542d4-0x0;var _0x2f4e1c=_0xcfd2[_0x4542d4];return _0x2f4e1c;};'use strict';var multer=require(_0x2cfd('0x0'));var util=require(_0x2cfd('0x1'));var path=require(_0x2cfd('0x2'));var timeout=require(_0x2cfd('0x3'));var express=require(_0x2cfd('0x4'));var router=express[_0x2cfd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x2cfd('0x6'));var interaction=require(_0x2cfd('0x7'));var config=require(_0x2cfd('0x8'));var controller=require(_0x2cfd('0x9'));router['get']('/',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0xb')]);router['get'](_0x2cfd('0xc'),auth['isAuthenticated'](),controller[_0x2cfd('0xd')]);router[_0x2cfd('0xe')]('/:id/hoppers',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0xf')]);router[_0x2cfd('0xe')](_0x2cfd('0x10'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x11')]);router[_0x2cfd('0xe')](_0x2cfd('0x12'),auth['isAuthenticated'](),controller[_0x2cfd('0x13')]);router[_0x2cfd('0xe')]('/:id/hopper_black',auth['isAuthenticated'](),controller['getHopperBlacks']);router[_0x2cfd('0xe')](_0x2cfd('0x14'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x15')]);router['get'](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x17')]);router['post']('/',auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x18')]);router['post'](_0x2cfd('0x19'),auth[_0x2cfd('0xa')](),controller['clone']);router['post'](_0x2cfd('0x14'),auth[_0x2cfd('0xa')](),controller['addLists']);router[_0x2cfd('0x1a')](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x1b')]);router[_0x2cfd('0x1c')](_0x2cfd('0xc'),auth[_0x2cfd('0xa')](),controller[_0x2cfd('0x1d')]);router['delete'](_0x2cfd('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x2cfd('0x1e')](_0x2cfd('0x14'),auth['isAuthenticated'](),controller['removeLists']);router['delete'](_0x2cfd('0x16'),auth[_0x2cfd('0xa')](),controller['removeBlackLists']);module[_0x2cfd('0x1f')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index e656c30..d8f34ac 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 _0x3833=['exports','TEXT','STRING','getDataValue','sequelize'];(function(_0x325501,_0x5242f6){var _0x2c1626=function(_0x4270b2){while(--_0x4270b2){_0x325501['push'](_0x325501['shift']());}};_0x2c1626(++_0x5242f6);}(_0x3833,0xef));var _0x3383=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x3833[_0x38ced4];return _0x547c07;};'use strict';var Sequelize=require(_0x3383('0x0'));module[_0x3383('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3383('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3383('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3383('0x4')]('key');}}}; \ No newline at end of file +var _0x01d2=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x3121ee,_0x1fb011){var _0x55b96c=function(_0x1b5a95){while(--_0x1b5a95){_0x3121ee['push'](_0x3121ee['shift']());}};_0x55b96c(++_0x1fb011);}(_0x01d2,0x165));var _0x201d=function(_0x25c2ba,_0x22e11b){_0x25c2ba=_0x25c2ba-0x0;var _0x4e339d=_0x01d2[_0x25c2ba];return _0x4e339d;};'use strict';var Sequelize=require(_0x201d('0x0'));module[_0x201d('0x1')]={'key':{'type':Sequelize[_0x201d('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x201d('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x201d('0x2')]},'name':{'type':Sequelize[_0x201d('0x4')],'get':function(){return this[_0x201d('0x5')](_0x201d('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f20ad81..01fbe51 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 _0xa09f=['MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','count','set','Content-Range','apply','save','update','destroy','then','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','length','include','options','find','body','create'];(function(_0x5bd3be,_0x3a08e1){var _0x250d33=function(_0xf69391){while(--_0xf69391){_0x5bd3be['push'](_0x5bd3be['shift']());}};_0x250d33(++_0x3a08e1);}(_0xa09f,0x12a));var _0xfa09=function(_0x10f63f,_0x242991){_0x10f63f=_0x10f63f-0x0;var _0xab57c6=_0xa09f[_0x10f63f];return _0xab57c6;};'use strict';var emlformat=require(_0xfa09('0x0'));var rimraf=require(_0xfa09('0x1'));var zipdir=require(_0xfa09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa09('0x3'));var moment=require(_0xfa09('0x4'));var BPromise=require(_0xfa09('0x5'));var Mustache=require(_0xfa09('0x6'));var util=require(_0xfa09('0x7'));var path=require(_0xfa09('0x8'));var sox=require(_0xfa09('0x9'));var csv=require(_0xfa09('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa09('0xb'));var _=require(_0xfa09('0xc'));var squel=require(_0xfa09('0xd'));var crypto=require('crypto');var jsforce=require(_0xfa09('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfa09('0xf'));var Papa=require(_0xfa09('0x10'));var Redis=require(_0xfa09('0x11'));var authService=require(_0xfa09('0x12'));var qs=require(_0xfa09('0x13'));var as=require(_0xfa09('0x14'));var hardwareService=require(_0xfa09('0x15'));var logger=require('../../config/logger')(_0xfa09('0x16'));var utils=require(_0xfa09('0x17'));var config=require(_0xfa09('0x18'));var licenseUtil=require(_0xfa09('0x19'));var db=require(_0xfa09('0x1a'))['db'];function respondWithStatusCode(_0x22eb27,_0x359c96){_0x359c96=_0x359c96||0xcc;return function(_0x3a8010){if(_0x3a8010){return _0x22eb27[_0xfa09('0x1b')](_0x359c96);}return _0x22eb27[_0xfa09('0x1c')](_0x359c96)[_0xfa09('0x1d')]();};}function respondWithResult(_0x2666f2,_0x524bef){_0x524bef=_0x524bef||0xc8;return function(_0x2b59f8){if(_0x2b59f8){return _0x2666f2['status'](_0x524bef)[_0xfa09('0x1e')](_0x2b59f8);}};}function respondWithFilteredResult(_0x4028cb,_0x2d534c){return function(_0x140c6a){if(_0x140c6a){var _0x5e2f39=typeof _0x2d534c['offset']===_0xfa09('0x1f')&&typeof _0x2d534c['limit']==='undefined';var _0x1152d9=_0x140c6a['count'];var _0x54562e=_0x5e2f39?0x0:_0x2d534c[_0xfa09('0x20')];var _0xac2c9f=_0x5e2f39?_0x140c6a[_0xfa09('0x21')]:_0x2d534c['offset']+_0x2d534c['limit'];var _0x1be728;if(_0xac2c9f>=_0x1152d9){_0xac2c9f=_0x1152d9;_0x1be728=0xc8;}else{_0x1be728=0xce;}_0x4028cb[_0xfa09('0x1c')](_0x1be728);return _0x4028cb[_0xfa09('0x22')](_0xfa09('0x23'),_0x54562e+'-'+_0xac2c9f+'/'+_0x1152d9)['json'](_0x140c6a);}return null;};}function patchUpdates(_0x2cbd73){return function(_0x35fa98){try{jsonpatch[_0xfa09('0x24')](_0x35fa98,_0x2cbd73,!![]);}catch(_0x3830d3){return BPromise['reject'](_0x3830d3);}return _0x35fa98[_0xfa09('0x25')]();};}function saveUpdates(_0x59f8d4,_0x37e9f5){return function(_0x54219b){if(_0x54219b){return _0x54219b[_0xfa09('0x26')](_0x59f8d4)['then'](function(_0x381439){return _0x381439;});}return null;};}function removeEntity(_0x30e881,_0x1d4002){return function(_0x18266c){if(_0x18266c){return _0x18266c[_0xfa09('0x27')]()[_0xfa09('0x28')](function(){var _0x2404fd=_0x18266c[_0xfa09('0x29')]({'plain':!![]});var _0x441b76=_0xfa09('0x2a');return db[_0xfa09('0x2b')]['destroy']({'where':{'type':_0x441b76,'resourceId':_0x2404fd['id']}})[_0xfa09('0x28')](function(){return _0x18266c;});})[_0xfa09('0x28')](function(){_0x30e881['status'](0xcc)[_0xfa09('0x1d')]();});}};}function handleEntityNotFound(_0x23caed,_0x173c3b){return function(_0x2cd7ab){if(!_0x2cd7ab){_0x23caed[_0xfa09('0x1b')](0x194);}return _0x2cd7ab;};}function handleError(_0x288146,_0x27ca2f){_0x27ca2f=_0x27ca2f||0x1f4;return function(_0x2bbc6f){logger[_0xfa09('0x2c')](_0x2bbc6f[_0xfa09('0x2d')]);if(_0x2bbc6f[_0xfa09('0x2e')]){delete _0x2bbc6f['name'];}_0x288146[_0xfa09('0x1c')](_0x27ca2f)[_0xfa09('0x2f')](_0x2bbc6f);};}exports[_0xfa09('0x30')]=function(_0x344d02,_0x371853){var _0x17e514={},_0x37fa9e={},_0x4cf5e7={'count':0x0,'rows':[]};var _0x353825=_[_0xfa09('0x31')](db[_0xfa09('0x32')]['rawAttributes'],function(_0x4b7527){return{'name':_0x4b7527[_0xfa09('0x33')],'type':_0x4b7527[_0xfa09('0x34')][_0xfa09('0x35')]};});_0x37fa9e[_0xfa09('0x36')]=_[_0xfa09('0x31')](_0x353825,'name');_0x37fa9e[_0xfa09('0x37')]=_['keys'](_0x344d02[_0xfa09('0x37')]);_0x37fa9e[_0xfa09('0x38')]=_[_0xfa09('0x39')](_0x37fa9e['model'],_0x37fa9e[_0xfa09('0x37')]);_0x17e514['attributes']=_[_0xfa09('0x39')](_0x37fa9e['model'],qs[_0xfa09('0x3a')](_0x344d02[_0xfa09('0x37')][_0xfa09('0x3a')]));_0x17e514[_0xfa09('0x3b')]=_0x17e514[_0xfa09('0x3b')]['length']?_0x17e514[_0xfa09('0x3b')]:_0x37fa9e[_0xfa09('0x36')];if(!_0x344d02[_0xfa09('0x37')][_0xfa09('0x3c')]('nolimit')){_0x17e514[_0xfa09('0x3d')]=qs[_0xfa09('0x3d')](_0x344d02['query'][_0xfa09('0x3d')]);_0x17e514[_0xfa09('0x20')]=qs[_0xfa09('0x20')](_0x344d02['query'][_0xfa09('0x20')]);}_0x17e514[_0xfa09('0x3e')]=qs[_0xfa09('0x3f')](_0x344d02['query'][_0xfa09('0x3f')]);_0x17e514[_0xfa09('0x40')]=qs[_0xfa09('0x38')](_[_0xfa09('0x41')](_0x344d02[_0xfa09('0x37')],_0x37fa9e[_0xfa09('0x38')]),_0x353825);if(_0x344d02['query'][_0xfa09('0x42')]){_0x17e514[_0xfa09('0x40')]=_[_0xfa09('0x43')](_0x17e514[_0xfa09('0x40')],{'$or':[{'key':{'$like':'%'+_0x344d02[_0xfa09('0x37')][_0xfa09('0x42')]+'%'}},{'value':{'$like':'%'+_0x344d02[_0xfa09('0x37')]['filter']+'%'}}]});}_0x17e514=_[_0xfa09('0x43')]({},_0x17e514,_0x344d02['options']);var _0x3195b8={'where':_0x17e514[_0xfa09('0x40')]};return db['CannedAnswer']['count'](_0x3195b8)[_0xfa09('0x28')](function(_0x5489c9){_0x4cf5e7[_0xfa09('0x21')]=_0x5489c9;if(_0x344d02[_0xfa09('0x37')][_0xfa09('0x44')]){_0x17e514['include']=[{'all':!![]}];}return db[_0xfa09('0x32')][_0xfa09('0x45')](_0x17e514);})[_0xfa09('0x28')](function(_0x44e44b){_0x4cf5e7[_0xfa09('0x46')]=_0x44e44b;return _0x4cf5e7;})[_0xfa09('0x28')](respondWithFilteredResult(_0x371853,_0x17e514))[_0xfa09('0x47')](handleError(_0x371853,null));};exports[_0xfa09('0x48')]=function(_0x30176f,_0xfe7a73){var _0x19dc2b={'raw':!![],'where':{'id':_0x30176f[_0xfa09('0x49')]['id']}},_0x3a274e={};_0x3a274e['model']=_['keys'](db[_0xfa09('0x32')][_0xfa09('0x4a')]);_0x3a274e['query']=_[_0xfa09('0x4b')](_0x30176f[_0xfa09('0x37')]);_0x3a274e['filters']=_[_0xfa09('0x39')](_0x3a274e['model'],_0x3a274e[_0xfa09('0x37')]);_0x19dc2b[_0xfa09('0x3b')]=_[_0xfa09('0x39')](_0x3a274e['model'],qs[_0xfa09('0x3a')](_0x30176f[_0xfa09('0x37')]['fields']));_0x19dc2b[_0xfa09('0x3b')]=_0x19dc2b[_0xfa09('0x3b')][_0xfa09('0x4c')]?_0x19dc2b[_0xfa09('0x3b')]:_0x3a274e['model'];if(_0x30176f[_0xfa09('0x37')][_0xfa09('0x44')]){_0x19dc2b[_0xfa09('0x4d')]=[{'all':!![]}];}_0x19dc2b=_[_0xfa09('0x43')]({},_0x19dc2b,_0x30176f[_0xfa09('0x4e')]);return db[_0xfa09('0x32')][_0xfa09('0x4f')](_0x19dc2b)[_0xfa09('0x28')](handleEntityNotFound(_0xfe7a73,null))[_0xfa09('0x28')](respondWithResult(_0xfe7a73,null))['catch'](handleError(_0xfe7a73,null));};exports[_0xfa09('0x26')]=function(_0x388376,_0x8209c2){if(_0x388376[_0xfa09('0x50')]['id']){delete _0x388376[_0xfa09('0x50')]['id'];}return db[_0xfa09('0x32')][_0xfa09('0x4f')]({'where':{'id':_0x388376[_0xfa09('0x49')]['id']}})[_0xfa09('0x28')](handleEntityNotFound(_0x8209c2,null))['then'](saveUpdates(_0x388376[_0xfa09('0x50')],null))[_0xfa09('0x28')](respondWithResult(_0x8209c2,null))[_0xfa09('0x47')](handleError(_0x8209c2,null));};exports['destroy']=function(_0x14235f,_0x264bc7){return db['CannedAnswer'][_0xfa09('0x4f')]({'where':{'id':_0x14235f[_0xfa09('0x49')]['id']}})[_0xfa09('0x28')](handleEntityNotFound(_0x264bc7,null))[_0xfa09('0x28')](removeEntity(_0x264bc7,null))['catch'](handleError(_0x264bc7,null));};exports[_0xfa09('0x51')]=function(_0x41b675,_0x33209d){var _0x1bafb3={'key':_0x41b675[_0xfa09('0x50')]['key']};if(_0x41b675[_0xfa09('0x50')][_0xfa09('0x52')]){_0x1bafb3[_0xfa09('0x52')]=_0x41b675[_0xfa09('0x50')]['MailAccountId'];}else if(_0x41b675[_0xfa09('0x50')]['SmsAccountId']){_0x1bafb3[_0xfa09('0x53')]=_0x41b675['body'][_0xfa09('0x53')];}else if(_0x41b675['body'][_0xfa09('0x54')]){_0x1bafb3[_0xfa09('0x54')]=_0x41b675[_0xfa09('0x50')][_0xfa09('0x54')];}else if(_0x41b675[_0xfa09('0x50')]['ChatWebsiteId']){_0x1bafb3[_0xfa09('0x55')]=_0x41b675[_0xfa09('0x50')][_0xfa09('0x55')];}return db[_0xfa09('0x32')][_0xfa09('0x4f')]({'where':_0x1bafb3})[_0xfa09('0x28')](function(_0x2665b8){if(_0x2665b8){throw new db[(_0xfa09('0x56'))][(_0xfa09('0x57'))](_0xfa09('0x58'));}return db['CannedAnswer'][_0xfa09('0x51')](_0x41b675['body']);})[_0xfa09('0x28')](function(_0x2262c2){var _0xb7f993=_0x41b675[_0xfa09('0x59')][_0xfa09('0x29')]({'plain':!![]});if(!_0xb7f993)throw new Error(_0xfa09('0x5a'));if(_0xb7f993[_0xfa09('0x5b')]===_0xfa09('0x59')){var _0x543c8f=_0x2262c2[_0xfa09('0x29')]({'plain':!![]});return db[_0xfa09('0x5c')][_0xfa09('0x4f')]({'where':{'name':_0xfa09('0x2a'),'userProfileId':_0xb7f993[_0xfa09('0x5d')]},'raw':!![]})[_0xfa09('0x28')](function(_0x583a84){if(_0x583a84&&_0x583a84[_0xfa09('0x5e')]===0x0){return db[_0xfa09('0x2b')][_0xfa09('0x51')]({'name':_0x543c8f[_0xfa09('0x2e')],'resourceId':_0x543c8f['id'],'type':_0x583a84[_0xfa09('0x2e')],'sectionId':_0x583a84['id']},{})[_0xfa09('0x28')](function(){return _0x2262c2;});}else{return _0x2262c2;}})[_0xfa09('0x47')](function(_0x464aa1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x464aa1);throw _0x464aa1;});}return _0x2262c2;})[_0xfa09('0x28')](respondWithResult(_0x33209d,0xc9))[_0xfa09('0x47')](handleError(_0x33209d,null));}; \ No newline at end of file +var _0x9f72=['ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','then','stack','name','send','CannedAnswer','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId'];(function(_0x51dd2c,_0x2a2345){var _0x41c678=function(_0xa14c31){while(--_0xa14c31){_0x51dd2c['push'](_0x51dd2c['shift']());}};_0x41c678(++_0x2a2345);}(_0x9f72,0xc4));var _0x29f7=function(_0x10f754,_0x51e252){_0x10f754=_0x10f754-0x0;var _0x273708=_0x9f72[_0x10f754];return _0x273708;};'use strict';var emlformat=require(_0x29f7('0x0'));var rimraf=require(_0x29f7('0x1'));var zipdir=require(_0x29f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x29f7('0x3'));var moment=require(_0x29f7('0x4'));var BPromise=require(_0x29f7('0x5'));var Mustache=require('mustache');var util=require(_0x29f7('0x6'));var path=require(_0x29f7('0x7'));var sox=require(_0x29f7('0x8'));var csv=require('to-csv');var ejs=require(_0x29f7('0x9'));var fs=require('fs');var fs_extra=require(_0x29f7('0xa'));var _=require(_0x29f7('0xb'));var squel=require('squel');var crypto=require(_0x29f7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x29f7('0xd'));var toCsv=require(_0x29f7('0xe'));var querystring=require(_0x29f7('0xf'));var Papa=require(_0x29f7('0x10'));var Redis=require(_0x29f7('0x11'));var authService=require(_0x29f7('0x12'));var qs=require(_0x29f7('0x13'));var as=require(_0x29f7('0x14'));var hardwareService=require(_0x29f7('0x15'));var logger=require(_0x29f7('0x16'))('api');var utils=require(_0x29f7('0x17'));var config=require(_0x29f7('0x18'));var licenseUtil=require(_0x29f7('0x19'));var db=require(_0x29f7('0x1a'))['db'];function respondWithStatusCode(_0x1ddad4,_0x139682){_0x139682=_0x139682||0xcc;return function(_0x115002){if(_0x115002){return _0x1ddad4[_0x29f7('0x1b')](_0x139682);}return _0x1ddad4['status'](_0x139682)[_0x29f7('0x1c')]();};}function respondWithResult(_0x2e1c46,_0x7def93){_0x7def93=_0x7def93||0xc8;return function(_0x2050c9){if(_0x2050c9){return _0x2e1c46['status'](_0x7def93)[_0x29f7('0x1d')](_0x2050c9);}};}function respondWithFilteredResult(_0x2e665b,_0x3a882c){return function(_0x1c7dcc){if(_0x1c7dcc){var _0xd12de1=typeof _0x3a882c[_0x29f7('0x1e')]===_0x29f7('0x1f')&&typeof _0x3a882c['limit']==='undefined';var _0x461453=_0x1c7dcc[_0x29f7('0x20')];var _0x435785=_0xd12de1?0x0:_0x3a882c[_0x29f7('0x1e')];var _0x475722=_0xd12de1?_0x1c7dcc[_0x29f7('0x20')]:_0x3a882c[_0x29f7('0x1e')]+_0x3a882c[_0x29f7('0x21')];var _0x17cbf4;if(_0x475722>=_0x461453){_0x475722=_0x461453;_0x17cbf4=0xc8;}else{_0x17cbf4=0xce;}_0x2e665b[_0x29f7('0x22')](_0x17cbf4);return _0x2e665b['set'](_0x29f7('0x23'),_0x435785+'-'+_0x475722+'/'+_0x461453)[_0x29f7('0x1d')](_0x1c7dcc);}return null;};}function patchUpdates(_0x4dc033){return function(_0x2a4423){try{jsonpatch[_0x29f7('0x24')](_0x2a4423,_0x4dc033,!![]);}catch(_0x1c9271){return BPromise[_0x29f7('0x25')](_0x1c9271);}return _0x2a4423[_0x29f7('0x26')]();};}function saveUpdates(_0x30705c,_0x3240db){return function(_0x266085){if(_0x266085){return _0x266085[_0x29f7('0x27')](_0x30705c)['then'](function(_0x4ccda3){return _0x4ccda3;});}return null;};}function removeEntity(_0x160d49,_0x290b77){return function(_0x4294ee){if(_0x4294ee){return _0x4294ee[_0x29f7('0x28')]()['then'](function(){var _0x4490e7=_0x4294ee[_0x29f7('0x29')]({'plain':!![]});var _0x4cae48='CannedAnswers';return db[_0x29f7('0x2a')][_0x29f7('0x28')]({'where':{'type':_0x4cae48,'resourceId':_0x4490e7['id']}})['then'](function(){return _0x4294ee;});})[_0x29f7('0x2b')](function(){_0x160d49[_0x29f7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36950a,_0x2a7b52){return function(_0x4e9a3a){if(!_0x4e9a3a){_0x36950a[_0x29f7('0x1b')](0x194);}return _0x4e9a3a;};}function handleError(_0x2f8655,_0x20506e){_0x20506e=_0x20506e||0x1f4;return function(_0x445ae4){logger['error'](_0x445ae4[_0x29f7('0x2c')]);if(_0x445ae4['name']){delete _0x445ae4[_0x29f7('0x2d')];}_0x2f8655[_0x29f7('0x22')](_0x20506e)[_0x29f7('0x2e')](_0x445ae4);};}exports['index']=function(_0x552cc5,_0x5318db){var _0x56cdc7={},_0x3368b0={},_0x3349c3={'count':0x0,'rows':[]};var _0x2859c8=_['map'](db[_0x29f7('0x2f')]['rawAttributes'],function(_0x3a9028){return{'name':_0x3a9028[_0x29f7('0x30')],'type':_0x3a9028[_0x29f7('0x31')][_0x29f7('0x32')]};});_0x3368b0[_0x29f7('0x33')]=_[_0x29f7('0x34')](_0x2859c8,_0x29f7('0x2d'));_0x3368b0[_0x29f7('0x35')]=_[_0x29f7('0x36')](_0x552cc5['query']);_0x3368b0[_0x29f7('0x37')]=_[_0x29f7('0x38')](_0x3368b0['model'],_0x3368b0[_0x29f7('0x35')]);_0x56cdc7[_0x29f7('0x39')]=_['intersection'](_0x3368b0[_0x29f7('0x33')],qs[_0x29f7('0x3a')](_0x552cc5[_0x29f7('0x35')]['fields']));_0x56cdc7['attributes']=_0x56cdc7[_0x29f7('0x39')]['length']?_0x56cdc7[_0x29f7('0x39')]:_0x3368b0[_0x29f7('0x33')];if(!_0x552cc5['query'][_0x29f7('0x3b')](_0x29f7('0x3c'))){_0x56cdc7[_0x29f7('0x21')]=qs[_0x29f7('0x21')](_0x552cc5[_0x29f7('0x35')]['limit']);_0x56cdc7[_0x29f7('0x1e')]=qs['offset'](_0x552cc5[_0x29f7('0x35')][_0x29f7('0x1e')]);}_0x56cdc7['order']=qs[_0x29f7('0x3d')](_0x552cc5[_0x29f7('0x35')]['sort']);_0x56cdc7['where']=qs[_0x29f7('0x37')](_[_0x29f7('0x3e')](_0x552cc5['query'],_0x3368b0['filters']),_0x2859c8);if(_0x552cc5[_0x29f7('0x35')][_0x29f7('0x3f')]){_0x56cdc7[_0x29f7('0x40')]=_['merge'](_0x56cdc7[_0x29f7('0x40')],{'$or':[{'key':{'$like':'%'+_0x552cc5[_0x29f7('0x35')][_0x29f7('0x3f')]+'%'}},{'value':{'$like':'%'+_0x552cc5['query'][_0x29f7('0x3f')]+'%'}}]});}_0x56cdc7=_[_0x29f7('0x41')]({},_0x56cdc7,_0x552cc5[_0x29f7('0x42')]);var _0x25dd19={'where':_0x56cdc7[_0x29f7('0x40')]};return db[_0x29f7('0x2f')][_0x29f7('0x20')](_0x25dd19)[_0x29f7('0x2b')](function(_0x412719){_0x3349c3[_0x29f7('0x20')]=_0x412719;if(_0x552cc5['query']['includeAll']){_0x56cdc7[_0x29f7('0x43')]=[{'all':!![]}];}return db[_0x29f7('0x2f')][_0x29f7('0x44')](_0x56cdc7);})[_0x29f7('0x2b')](function(_0x16f4c7){_0x3349c3[_0x29f7('0x45')]=_0x16f4c7;return _0x3349c3;})['then'](respondWithFilteredResult(_0x5318db,_0x56cdc7))[_0x29f7('0x46')](handleError(_0x5318db,null));};exports[_0x29f7('0x47')]=function(_0x412388,_0x465199){var _0x967154={'raw':!![],'where':{'id':_0x412388[_0x29f7('0x48')]['id']}},_0x1f4f1={};_0x1f4f1[_0x29f7('0x33')]=_[_0x29f7('0x36')](db['CannedAnswer'][_0x29f7('0x49')]);_0x1f4f1[_0x29f7('0x35')]=_[_0x29f7('0x36')](_0x412388['query']);_0x1f4f1['filters']=_[_0x29f7('0x38')](_0x1f4f1[_0x29f7('0x33')],_0x1f4f1[_0x29f7('0x35')]);_0x967154[_0x29f7('0x39')]=_[_0x29f7('0x38')](_0x1f4f1[_0x29f7('0x33')],qs[_0x29f7('0x3a')](_0x412388[_0x29f7('0x35')]['fields']));_0x967154[_0x29f7('0x39')]=_0x967154[_0x29f7('0x39')]['length']?_0x967154[_0x29f7('0x39')]:_0x1f4f1[_0x29f7('0x33')];if(_0x412388[_0x29f7('0x35')][_0x29f7('0x4a')]){_0x967154['include']=[{'all':!![]}];}_0x967154=_[_0x29f7('0x41')]({},_0x967154,_0x412388[_0x29f7('0x42')]);return db[_0x29f7('0x2f')][_0x29f7('0x4b')](_0x967154)[_0x29f7('0x2b')](handleEntityNotFound(_0x465199,null))['then'](respondWithResult(_0x465199,null))[_0x29f7('0x46')](handleError(_0x465199,null));};exports[_0x29f7('0x27')]=function(_0x42fada,_0x3a4571){if(_0x42fada[_0x29f7('0x4c')]['id']){delete _0x42fada[_0x29f7('0x4c')]['id'];}return db['CannedAnswer']['find']({'where':{'id':_0x42fada['params']['id']}})[_0x29f7('0x2b')](handleEntityNotFound(_0x3a4571,null))['then'](saveUpdates(_0x42fada[_0x29f7('0x4c')],null))[_0x29f7('0x2b')](respondWithResult(_0x3a4571,null))[_0x29f7('0x46')](handleError(_0x3a4571,null));};exports['destroy']=function(_0x5aa0a0,_0x43e6f7){return db[_0x29f7('0x2f')]['find']({'where':{'id':_0x5aa0a0[_0x29f7('0x48')]['id']}})['then'](handleEntityNotFound(_0x43e6f7,null))[_0x29f7('0x2b')](removeEntity(_0x43e6f7,null))[_0x29f7('0x46')](handleError(_0x43e6f7,null));};exports['create']=function(_0x294a8d,_0x509e51){var _0x40999c={'key':_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x32')]};if(_0x294a8d[_0x29f7('0x4c')]['MailAccountId']){_0x40999c[_0x29f7('0x4d')]=_0x294a8d[_0x29f7('0x4c')]['MailAccountId'];}else if(_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4e')]){_0x40999c[_0x29f7('0x4e')]=_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4e')];}else if(_0x294a8d['body'][_0x29f7('0x4f')]){_0x40999c['OpenchannelAccountId']=_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x4f')];}else if(_0x294a8d[_0x29f7('0x4c')][_0x29f7('0x50')]){_0x40999c[_0x29f7('0x50')]=_0x294a8d['body'][_0x29f7('0x50')];}return db[_0x29f7('0x2f')]['find']({'where':_0x40999c})[_0x29f7('0x2b')](function(_0x3e4a05){if(_0x3e4a05){throw new db['Sequelize'][(_0x29f7('0x51'))](_0x29f7('0x52'));}return db[_0x29f7('0x2f')][_0x29f7('0x53')](_0x294a8d[_0x29f7('0x4c')]);})[_0x29f7('0x2b')](function(_0x59fe7c){var _0x21a1b4=_0x294a8d[_0x29f7('0x54')][_0x29f7('0x29')]({'plain':!![]});if(!_0x21a1b4)throw new Error(_0x29f7('0x55'));if(_0x21a1b4[_0x29f7('0x56')]===_0x29f7('0x54')){var _0x71e024=_0x59fe7c['get']({'plain':!![]});return db[_0x29f7('0x57')][_0x29f7('0x4b')]({'where':{'name':_0x29f7('0x58'),'userProfileId':_0x21a1b4[_0x29f7('0x59')]},'raw':!![]})[_0x29f7('0x2b')](function(_0x23e8a9){if(_0x23e8a9&&_0x23e8a9[_0x29f7('0x5a')]===0x0){return db['UserProfileResource'][_0x29f7('0x53')]({'name':_0x71e024[_0x29f7('0x2d')],'resourceId':_0x71e024['id'],'type':_0x23e8a9[_0x29f7('0x2d')],'sectionId':_0x23e8a9['id']},{})[_0x29f7('0x2b')](function(){return _0x59fe7c;});}else{return _0x59fe7c;}})['catch'](function(_0x4fddf9){logger[_0x29f7('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fddf9);throw _0x4fddf9;});}return _0x59fe7c;})[_0x29f7('0x2b')](respondWithResult(_0x509e51,0xc9))[_0x29f7('0x46')](handleError(_0x509e51,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index d0269ae..7b1e8be 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 _0x9bea=['define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x34ae3d,_0x3dab37){var _0x1190d0=function(_0x435e8f){while(--_0x435e8f){_0x34ae3d['push'](_0x34ae3d['shift']());}};_0x1190d0(++_0x3dab37);}(_0x9bea,0x1f3));var _0xa9be=function(_0x360df4,_0x494d1a){_0x360df4=_0x360df4-0x0;var _0x4870c7=_0x9bea[_0x360df4];return _0x4870c7;};'use strict';var _=require(_0xa9be('0x0'));var util=require(_0xa9be('0x1'));var logger=require(_0xa9be('0x2'))(_0xa9be('0x3'));var moment=require(_0xa9be('0x4'));var BPromise=require(_0xa9be('0x5'));var rp=require(_0xa9be('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9be('0x7'));var config=require(_0xa9be('0x8'));var attributes=require(_0xa9be('0x9'));module[_0xa9be('0xa')]=function(_0x23beb6,_0x37d7c4){return _0x23beb6[_0xa9be('0xb')](_0xa9be('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa9be('0xd'),'collate':_0xa9be('0xe')});}; \ No newline at end of file +var _0xa647=['tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa647,0x11a));var _0x7a64=function(_0x481906,_0x24f326){_0x481906=_0x481906-0x0;var _0x41a55d=_0xa647[_0x481906];return _0x41a55d;};'use strict';var _=require(_0x7a64('0x0'));var util=require(_0x7a64('0x1'));var logger=require(_0x7a64('0x2'))(_0x7a64('0x3'));var moment=require(_0x7a64('0x4'));var BPromise=require(_0x7a64('0x5'));var rp=require(_0x7a64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7a64('0x7'));var config=require('../../config/environment');var attributes=require(_0x7a64('0x8'));module[_0x7a64('0x9')]=function(_0x5e0e6d,_0x49f987){return _0x5e0e6d[_0x7a64('0xa')](_0x7a64('0xb'),attributes,{'tableName':_0x7a64('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7a64('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index c73565c..2460dc0 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(_0x548665,_0x285830){var _0x958727=function(_0x4694f9){while(--_0x4694f9){_0x548665['push'](_0x548665['shift']());}};_0x958727(++_0x285830);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x4bf954,_0x4482f8){var _0x2746d0=function(_0x561c7a){while(--_0x561c7a){_0x4bf954['push'](_0x4bf954['shift']());}};_0x2746d0(++_0x4482f8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index aeb0eb8..0a00af5 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 _0xd989=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post','create','put','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x5e7f6d,_0x2abe5f){var _0x4f9f88=function(_0x23f281){while(--_0x23f281){_0x5e7f6d['push'](_0x5e7f6d['shift']());}};_0x4f9f88(++_0x2abe5f);}(_0xd989,0x166));var _0x9d98=function(_0x560623,_0x5c748a){_0x560623=_0x560623-0x0;var _0x2a9089=_0xd989[_0x560623];return _0x2a9089;};'use strict';var multer=require(_0x9d98('0x0'));var util=require(_0x9d98('0x1'));var path=require(_0x9d98('0x2'));var timeout=require('connect-timeout');var express=require(_0x9d98('0x3'));var router=express[_0x9d98('0x4')]();var fs_extra=require(_0x9d98('0x5'));var auth=require(_0x9d98('0x6'));var interaction=require(_0x9d98('0x7'));var config=require(_0x9d98('0x8'));var controller=require('./cannedAnswer.controller');router[_0x9d98('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9d98('0x9')](_0x9d98('0xa'),auth['isAuthenticated'](),controller[_0x9d98('0xb')]);router[_0x9d98('0xc')]('/',auth['isAuthenticated'](),controller[_0x9d98('0xd')]);router[_0x9d98('0xe')](_0x9d98('0xa'),auth[_0x9d98('0xf')](),controller[_0x9d98('0x10')]);router[_0x9d98('0x11')](_0x9d98('0xa'),auth['isAuthenticated'](),controller[_0x9d98('0x12')]);module[_0x9d98('0x13')]=router; \ No newline at end of file +var _0x28e2=['./cannedAnswer.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x12eb43,_0x4254c4){var _0x264af7=function(_0x567d05){while(--_0x567d05){_0x12eb43['push'](_0x12eb43['shift']());}};_0x264af7(++_0x4254c4);}(_0x28e2,0x1e7));var _0x228e=function(_0x4b0427,_0x8650c2){_0x4b0427=_0x4b0427-0x0;var _0x148d32=_0x28e2[_0x4b0427];return _0x148d32;};'use strict';var multer=require(_0x228e('0x0'));var util=require('util');var path=require(_0x228e('0x1'));var timeout=require(_0x228e('0x2'));var express=require(_0x228e('0x3'));var router=express['Router']();var fs_extra=require(_0x228e('0x4'));var auth=require(_0x228e('0x5'));var interaction=require(_0x228e('0x6'));var config=require('../../config/environment');var controller=require(_0x228e('0x7'));router[_0x228e('0x8')]('/',auth['isAuthenticated'](),controller[_0x228e('0x9')]);router[_0x228e('0x8')](_0x228e('0xa'),auth[_0x228e('0xb')](),controller[_0x228e('0xc')]);router[_0x228e('0xd')]('/',auth[_0x228e('0xb')](),controller[_0x228e('0xe')]);router[_0x228e('0xf')](_0x228e('0xa'),auth[_0x228e('0xb')](),controller[_0x228e('0x10')]);router[_0x228e('0x11')](_0x228e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x228e('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a1cf3cc..3b442a7 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 _0xfa2f=['INTEGER','DATE','STRING'];(function(_0x2f7bec,_0x27b9f6){var _0x5d1c2e=function(_0x442b0a){while(--_0x442b0a){_0x2f7bec['push'](_0x2f7bec['shift']());}};_0x5d1c2e(++_0x27b9f6);}(_0xfa2f,0xe8));var _0xffa2=function(_0x31bf7a,_0x2e4d4f){_0x31bf7a=_0x31bf7a-0x0;var _0x389002=_0xfa2f[_0x31bf7a];return _0x389002;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0xffa2('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xffa2('0x1')]},'src':{'type':Sequelize[_0xffa2('0x1')]},'dst':{'type':Sequelize[_0xffa2('0x1')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xffa2('0x1')]},'dstchannel':{'type':Sequelize[_0xffa2('0x1')]},'lastapp':{'type':Sequelize[_0xffa2('0x1')]},'lastdata':{'type':Sequelize[_0xffa2('0x1')]},'duration':{'type':Sequelize[_0xffa2('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xffa2('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xffa2('0x1')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xffa2('0x1')]},'uniqueid':{'type':Sequelize[_0xffa2('0x1')]},'linkedid':{'type':Sequelize[_0xffa2('0x1')]},'sequence':{'type':Sequelize[_0xffa2('0x1')]},'peeraccount':{'type':Sequelize[_0xffa2('0x1')]},'type':{'type':Sequelize[_0xffa2('0x1')]},'tag':{'type':Sequelize[_0xffa2('0x1')]}}; \ No newline at end of file +var _0xc285=['INTEGER','sequelize','exports','1970-01-01\x2000:00:01','STRING'];(function(_0x306ddc,_0x9c4d60){var _0x11767f=function(_0x35183e){while(--_0x35183e){_0x306ddc['push'](_0x306ddc['shift']());}};_0x11767f(++_0x9c4d60);}(_0xc285,0xd8));var _0x5c28=function(_0x4c9173,_0x54c378){_0x4c9173=_0x4c9173-0x0;var _0x48bf57=_0xc285[_0x4c9173];return _0x48bf57;};'use strict';var Sequelize=require(_0x5c28('0x0'));module[_0x5c28('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x5c28('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x5c28('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x5c28('0x3')]},'channel':{'type':Sequelize[_0x5c28('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x5c28('0x3')]},'lastdata':{'type':Sequelize[_0x5c28('0x3')]},'duration':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x5c28('0x3')]},'amaflags':{'type':Sequelize[_0x5c28('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x5c28('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x5c28('0x3')]},'linkedid':{'type':Sequelize[_0x5c28('0x3')]},'sequence':{'type':Sequelize[_0x5c28('0x3')]},'peeraccount':{'type':Sequelize[_0x5c28('0x3')]},'type':{'type':Sequelize[_0x5c28('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 e4b1d91..0fae817 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 _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x250f95,_0x5a5728){var _0x4ada97=function(_0x392edc){while(--_0x392edc){_0x250f95['push'](_0x250f95['shift']());}};_0x4ada97(++_0x5a5728);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x2facb4,_0x57ffb4){_0x2facb4=_0x2facb4-0x0;var _0x4aecf4=_0x6b8f[_0x2facb4];return _0x4aecf4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));}; \ No newline at end of file +var _0xc949=['eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','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','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Cdr','type','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','rawAttributes','intersection','include','find','create','body','params','describe'];(function(_0x38c4e6,_0x6fe10a){var _0x3af923=function(_0x2f8755){while(--_0x2f8755){_0x38c4e6['push'](_0x38c4e6['shift']());}};_0x3af923(++_0x6fe10a);}(_0xc949,0x181));var _0x9c94=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xc949[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0x9c94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c94('0x1'));var jsonpatch=require(_0x9c94('0x2'));var rp=require(_0x9c94('0x3'));var moment=require(_0x9c94('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9c94('0x5'));var util=require(_0x9c94('0x6'));var path=require('path');var sox=require(_0x9c94('0x7'));var csv=require(_0x9c94('0x8'));var ejs=require(_0x9c94('0x9'));var fs=require('fs');var fs_extra=require(_0x9c94('0xa'));var _=require('lodash');var squel=require(_0x9c94('0xb'));var crypto=require(_0x9c94('0xc'));var jsforce=require(_0x9c94('0xd'));var deskjs=require(_0x9c94('0xe'));var toCsv=require(_0x9c94('0x8'));var querystring=require(_0x9c94('0xf'));var Papa=require(_0x9c94('0x10'));var Redis=require(_0x9c94('0x11'));var authService=require(_0x9c94('0x12'));var qs=require(_0x9c94('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c94('0x14'));var logger=require(_0x9c94('0x15'))(_0x9c94('0x16'));var utils=require(_0x9c94('0x17'));var config=require(_0x9c94('0x18'));var licenseUtil=require(_0x9c94('0x19'));var db=require(_0x9c94('0x1a'))['db'];function respondWithStatusCode(_0x423adb,_0x30f64e){_0x30f64e=_0x30f64e||0xcc;return function(_0x1e326f){if(_0x1e326f){return _0x423adb[_0x9c94('0x1b')](_0x30f64e);}return _0x423adb[_0x9c94('0x1c')](_0x30f64e)[_0x9c94('0x1d')]();};}function respondWithResult(_0x15c51c,_0x54d956){_0x54d956=_0x54d956||0xc8;return function(_0x9789bc){if(_0x9789bc){return _0x15c51c['status'](_0x54d956)[_0x9c94('0x1e')](_0x9789bc);}};}function respondWithFilteredResult(_0x26e629,_0x4f0013){return function(_0xe52641){if(_0xe52641){var _0x4d6308=typeof _0x4f0013['offset']===_0x9c94('0x1f')&&typeof _0x4f0013['limit']===_0x9c94('0x1f');var _0x33bd19=_0xe52641['count'];var _0x201e04=_0x4d6308?0x0:_0x4f0013[_0x9c94('0x20')];var _0x412804=_0x4d6308?_0xe52641[_0x9c94('0x21')]:_0x4f0013[_0x9c94('0x20')]+_0x4f0013[_0x9c94('0x22')];var _0x3e361c;if(_0x412804>=_0x33bd19){_0x412804=_0x33bd19;_0x3e361c=0xc8;}else{_0x3e361c=0xce;}_0x26e629['status'](_0x3e361c);return _0x26e629[_0x9c94('0x23')](_0x9c94('0x24'),_0x201e04+'-'+_0x412804+'/'+_0x33bd19)['json'](_0xe52641);}return null;};}function patchUpdates(_0x141801){return function(_0x845304){try{jsonpatch[_0x9c94('0x25')](_0x845304,_0x141801,!![]);}catch(_0x326b38){return BPromise[_0x9c94('0x26')](_0x326b38);}return _0x845304[_0x9c94('0x27')]();};}function saveUpdates(_0xadab16,_0x23cdf5){return function(_0x8fe4fb){if(_0x8fe4fb){return _0x8fe4fb[_0x9c94('0x28')](_0xadab16)[_0x9c94('0x29')](function(_0xe9280a){return _0xe9280a;});}return null;};}function removeEntity(_0x44d732,_0x8c0b7f){return function(_0x5b1020){if(_0x5b1020){return _0x5b1020[_0x9c94('0x2a')]()[_0x9c94('0x29')](function(){_0x44d732['status'](0xcc)[_0x9c94('0x1d')]();});}};}function handleEntityNotFound(_0x2c3d25,_0x4795bb){return function(_0x335184){if(!_0x335184){_0x2c3d25[_0x9c94('0x1b')](0x194);}return _0x335184;};}function handleError(_0x4dd38e,_0xc18230){_0xc18230=_0xc18230||0x1f4;return function(_0x45cf4d){logger['error'](_0x45cf4d[_0x9c94('0x2b')]);if(_0x45cf4d['name']){delete _0x45cf4d[_0x9c94('0x2c')];}_0x4dd38e[_0x9c94('0x1c')](_0xc18230)[_0x9c94('0x2d')](_0x45cf4d);};}exports[_0x9c94('0x2e')]=function(_0x1581c0,_0x3f2622){var _0xf30dd1={},_0x561fdc={},_0x5a6b1c={'count':0x0,'rows':[]};var _0xc4a819=_[_0x9c94('0x2f')](db[_0x9c94('0x30')]['rawAttributes'],function(_0x25a6b9){return{'name':_0x25a6b9['fieldName'],'type':_0x25a6b9[_0x9c94('0x31')][_0x9c94('0x32')]};});_0x561fdc[_0x9c94('0x33')]=_['map'](_0xc4a819,'name');_0x561fdc[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x1581c0[_0x9c94('0x34')]);_0x561fdc['filters']=_['intersection'](_0x561fdc['model'],_0x561fdc['query']);_0xf30dd1[_0x9c94('0x36')]=_['intersection'](_0x561fdc[_0x9c94('0x33')],qs[_0x9c94('0x37')](_0x1581c0['query']['fields']));_0xf30dd1[_0x9c94('0x36')]=_0xf30dd1[_0x9c94('0x36')][_0x9c94('0x38')]?_0xf30dd1[_0x9c94('0x36')]:_0x561fdc[_0x9c94('0x33')];if(!_0x1581c0[_0x9c94('0x34')][_0x9c94('0x39')](_0x9c94('0x3a'))){_0xf30dd1[_0x9c94('0x22')]=qs[_0x9c94('0x22')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x22')]);_0xf30dd1[_0x9c94('0x20')]=qs[_0x9c94('0x20')](_0x1581c0[_0x9c94('0x34')][_0x9c94('0x20')]);}_0xf30dd1[_0x9c94('0x3b')]=qs[_0x9c94('0x3c')](_0x1581c0['query'][_0x9c94('0x3c')]);_0xf30dd1[_0x9c94('0x3d')]=qs[_0x9c94('0x3e')](_[_0x9c94('0x3f')](_0x1581c0[_0x9c94('0x34')],_0x561fdc[_0x9c94('0x3e')]),_0xc4a819);if(_0x1581c0[_0x9c94('0x34')]['filter']){_0xf30dd1[_0x9c94('0x3d')]=_['merge'](_0xf30dd1[_0x9c94('0x3d')],{'$or':_[_0x9c94('0x2f')](_0xc4a819,function(_0x442d46){if(_0x442d46[_0x9c94('0x31')]!=='VIRTUAL'){var _0x245278={};_0x245278[_0x442d46['name']]={'$like':'%'+_0x1581c0[_0x9c94('0x34')][_0x9c94('0x40')]+'%'};return _0x245278;}})});}_0xf30dd1=_[_0x9c94('0x41')]({},_0xf30dd1,_0x1581c0['options']);var _0x21e9f7={'where':_0xf30dd1['where']};return db[_0x9c94('0x30')]['count'](_0x21e9f7)['then'](function(_0x9a75f0){_0x5a6b1c[_0x9c94('0x21')]=_0x9a75f0;if(_0x1581c0[_0x9c94('0x34')][_0x9c94('0x42')]){_0xf30dd1['include']=[{'all':!![]}];}return db[_0x9c94('0x30')][_0x9c94('0x43')](_0xf30dd1);})[_0x9c94('0x29')](function(_0x360960){_0x5a6b1c['rows']=_0x360960;return _0x5a6b1c;})[_0x9c94('0x29')](respondWithFilteredResult(_0x3f2622,_0xf30dd1))[_0x9c94('0x44')](handleError(_0x3f2622,null));};exports['show']=function(_0x24e74c,_0x3d8b31){var _0x2a5bd5={'raw':!![],'where':{'id':_0x24e74c['params']['id']}},_0x5e6a90={};_0x5e6a90[_0x9c94('0x33')]=_[_0x9c94('0x35')](db[_0x9c94('0x30')][_0x9c94('0x45')]);_0x5e6a90[_0x9c94('0x34')]=_[_0x9c94('0x35')](_0x24e74c[_0x9c94('0x34')]);_0x5e6a90[_0x9c94('0x3e')]=_[_0x9c94('0x46')](_0x5e6a90[_0x9c94('0x33')],_0x5e6a90[_0x9c94('0x34')]);_0x2a5bd5['attributes']=_[_0x9c94('0x46')](_0x5e6a90['model'],qs[_0x9c94('0x37')](_0x24e74c[_0x9c94('0x34')][_0x9c94('0x37')]));_0x2a5bd5[_0x9c94('0x36')]=_0x2a5bd5[_0x9c94('0x36')][_0x9c94('0x38')]?_0x2a5bd5[_0x9c94('0x36')]:_0x5e6a90['model'];if(_0x24e74c['query'][_0x9c94('0x42')]){_0x2a5bd5[_0x9c94('0x47')]=[{'all':!![]}];}_0x2a5bd5=_[_0x9c94('0x41')]({},_0x2a5bd5,_0x24e74c['options']);return db[_0x9c94('0x30')][_0x9c94('0x48')](_0x2a5bd5)['then'](handleEntityNotFound(_0x3d8b31,null))['then'](respondWithResult(_0x3d8b31,null))['catch'](handleError(_0x3d8b31,null));};exports['create']=function(_0x2b94e0,_0x5362f4){return db['Cdr'][_0x9c94('0x49')](_0x2b94e0['body'],{})[_0x9c94('0x29')](respondWithResult(_0x5362f4,0xc9))[_0x9c94('0x44')](handleError(_0x5362f4,null));};exports[_0x9c94('0x28')]=function(_0x205f51,_0x22eaa4){if(_0x205f51['body']['id']){delete _0x205f51[_0x9c94('0x4a')]['id'];}return db[_0x9c94('0x30')][_0x9c94('0x48')]({'where':{'id':_0x205f51[_0x9c94('0x4b')]['id']}})[_0x9c94('0x29')](handleEntityNotFound(_0x22eaa4,null))[_0x9c94('0x29')](saveUpdates(_0x205f51['body'],null))[_0x9c94('0x29')](respondWithResult(_0x22eaa4,null))['catch'](handleError(_0x22eaa4,null));};exports[_0x9c94('0x2a')]=function(_0x38bb48,_0x426c0f){return db['Cdr'][_0x9c94('0x48')]({'where':{'id':_0x38bb48[_0x9c94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x426c0f,null))[_0x9c94('0x29')](removeEntity(_0x426c0f,null))['catch'](handleError(_0x426c0f,null));};exports[_0x9c94('0x4c')]=function(_0x3aa1dd,_0x537c78){return db['Cdr'][_0x9c94('0x4c')]()['then'](respondWithResult(_0x537c78,null))[_0x9c94('0x44')](handleError(_0x537c78,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index b5f4fa8..9201392 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x44c1cb,_0x14e16c){var _0x393b70=function(_0x1dbde8){while(--_0x1dbde8){_0x44c1cb['push'](_0x44c1cb['shift']());}};_0x393b70(++_0x14e16c);}(_0x7a54,0x106));var _0x47a5=function(_0x5c674e,_0x5dcba2){_0x5c674e=_0x5c674e-0x0;var _0x296e29=_0x7a54[_0x5c674e];return _0x296e29;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x58344f,_0x668799){var _0x14a048=function(_0x48cf5a){while(--_0x48cf5a){_0x58344f['push'](_0x58344f['shift']());}};_0x14a048(++_0x668799);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index eaf842b..6e32b2c 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 _0x6cd1=['rpc','../../config/environment','http','request','info','Cdr,\x20%s,\x20%s','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','moment','../../mysqldb','../../config/utils'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x6cd1,0x85));var _0x16cd=function(_0xb5e37f,_0xc624f1){_0xb5e37f=_0xb5e37f-0x0;var _0x23f431=_0x6cd1[_0xb5e37f];return _0x23f431;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x16cd('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16cd('0x1'))['db'];var utils=require(_0x16cd('0x2'));var logger=require('../../config/logger')(_0x16cd('0x3'));var config=require(_0x16cd('0x4'));var jayson=require('jayson/promise');var client=jayson['client'][_0x16cd('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x241c4e,_0x4bdd82,_0x8f91a8){return new BPromise(function(_0x594207,_0x39231d){return client[_0x16cd('0x6')](_0x241c4e,_0x8f91a8)['then'](function(_0x16a862){logger[_0x16cd('0x7')](_0x16cd('0x8'),_0x4bdd82,'request\x20sent');logger[_0x16cd('0x9')](_0x16cd('0xa'),_0x4bdd82,'request\x20sent',JSON[_0x16cd('0xb')](_0x16a862));if(_0x16a862[_0x16cd('0xc')]){if(_0x16a862[_0x16cd('0xc')][_0x16cd('0xd')]===0x1f4){logger[_0x16cd('0xc')](_0x16cd('0x8'),_0x4bdd82,_0x16a862[_0x16cd('0xc')][_0x16cd('0xe')]);return _0x39231d(_0x16a862['error'][_0x16cd('0xe')]);}logger[_0x16cd('0xc')](_0x16cd('0x8'),_0x4bdd82,_0x16a862[_0x16cd('0xc')][_0x16cd('0xe')]);return _0x594207(_0x16a862[_0x16cd('0xc')]['message']);}else{logger[_0x16cd('0x7')](_0x16cd('0x8'),_0x4bdd82,_0x16cd('0xf'));_0x594207(_0x16a862['result'][_0x16cd('0xe')]);}})[_0x16cd('0x10')](function(_0x3fc127){logger[_0x16cd('0xc')](_0x16cd('0x8'),_0x4bdd82,_0x3fc127);_0x39231d(_0x3fc127);});});} \ No newline at end of file +var _0x1c7a=['Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2bbd69,_0x25aa38){var _0x12b5f7=function(_0x2c4993){while(--_0x2c4993){_0x2bbd69['push'](_0x2bbd69['shift']());}};_0x12b5f7(++_0x25aa38);}(_0x1c7a,0xb4));var _0xa1c7=function(_0x69862a,_0x3e36a3){_0x69862a=_0x69862a-0x0;var _0xfde71b=_0x1c7a[_0x69862a];return _0xfde71b;};'use strict';var _=require(_0xa1c7('0x0'));var util=require(_0xa1c7('0x1'));var moment=require(_0xa1c7('0x2'));var BPromise=require(_0xa1c7('0x3'));var rs=require(_0xa1c7('0x4'));var fs=require('fs');var Redis=require(_0xa1c7('0x5'));var db=require(_0xa1c7('0x6'))['db'];var utils=require(_0xa1c7('0x7'));var logger=require(_0xa1c7('0x8'))(_0xa1c7('0x9'));var config=require(_0xa1c7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa1c7('0xb')][_0xa1c7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x33f780,_0x51b7af,_0x51d53d){return new BPromise(function(_0x294a9a,_0x51c68f){return client['request'](_0x33f780,_0x51d53d)['then'](function(_0x597e85){logger['info']('Cdr,\x20%s,\x20%s',_0x51b7af,_0xa1c7('0xd'));logger[_0xa1c7('0xe')](_0xa1c7('0xf'),_0x51b7af,'request\x20sent',JSON[_0xa1c7('0x10')](_0x597e85));if(_0x597e85[_0xa1c7('0x11')]){if(_0x597e85['error']['code']===0x1f4){logger['error'](_0xa1c7('0x12'),_0x51b7af,_0x597e85[_0xa1c7('0x11')][_0xa1c7('0x13')]);return _0x51c68f(_0x597e85[_0xa1c7('0x11')][_0xa1c7('0x13')]);}logger[_0xa1c7('0x11')](_0xa1c7('0x12'),_0x51b7af,_0x597e85['error'][_0xa1c7('0x13')]);return _0x294a9a(_0x597e85['error'][_0xa1c7('0x13')]);}else{logger['info'](_0xa1c7('0x12'),_0x51b7af,_0xa1c7('0xd'));_0x294a9a(_0x597e85[_0xa1c7('0x14')][_0xa1c7('0x13')]);}})[_0xa1c7('0x15')](function(_0x5abe81){logger[_0xa1c7('0x11')](_0xa1c7('0x12'),_0x51b7af,_0x5abe81);_0x51c68f(_0x5abe81);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 54be85a..0ae06b8 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x52b7b9,_0x43ed4b){var _0x5b5d30=function(_0x4a5b9c){while(--_0x4a5b9c){_0x52b7b9['push'](_0x52b7b9['shift']());}};_0x5b5d30(++_0x43ed4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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 +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(_0x1a8518,_0x4fde78){var _0x1ac19c=function(_0x31106f){while(--_0x31106f){_0x1a8518['push'](_0x1a8518['shift']());}};_0x1ac19c(++_0x4fde78);}(_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 5ef9003..6403172 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 _0x1960=['TEXT','*,*,*,*','sequelize','exports','STRING','noop'];(function(_0x193aae,_0x5c9cd3){var _0x6a9ced=function(_0x4efde9){while(--_0x4efde9){_0x193aae['push'](_0x193aae['shift']());}};_0x6a9ced(++_0x5c9cd3);}(_0x1960,0x128));var _0x0196=function(_0x23f185,_0x104d9b){_0x23f185=_0x23f185-0x0;var _0x4c1b92=_0x1960[_0x23f185];return _0x4c1b92;};'use strict';var Sequelize=require(_0x0196('0x0'));module[_0x0196('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x0196('0x2')],'allowNull':![],'defaultValue':_0x0196('0x3')},'appdata':{'type':Sequelize[_0x0196('0x4')]()},'description':{'type':Sequelize[_0x0196('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0196('0x5')}}; \ No newline at end of file +var _0xbf96=['INTEGER','STRING','sequelize','exports'];(function(_0x5e649f,_0x16bdb2){var _0x29a25c=function(_0x1cda9d){while(--_0x1cda9d){_0x5e649f['push'](_0x5e649f['shift']());}};_0x29a25c(++_0x16bdb2);}(_0xbf96,0x1e2));var _0x6bf9=function(_0x2a9a45,_0x1eb664){_0x2a9a45=_0x2a9a45-0x0;var _0x4cd571=_0xbf96[_0x2a9a45];return _0x4cd571;};'use strict';var Sequelize=require(_0x6bf9('0x0'));module[_0x6bf9('0x1')]={'priority':{'type':Sequelize[_0x6bf9('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6bf9('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6bf9('0x3')]},'interval':{'type':Sequelize[_0x6bf9('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 1764590..ca36691 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 _0x65d2=['params','model','keys','ChatApplication','rawAttributes','query','filters','attributes','intersection','includeAll','include','merge','options','body','find','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','update','destroy','then','stack','name','send'];(function(_0x102589,_0x476a51){var _0x3e77de=function(_0x11104a){while(--_0x11104a){_0x102589['push'](_0x102589['shift']());}};_0x3e77de(++_0x476a51);}(_0x65d2,0xb8));var _0x265d=function(_0x476cc4,_0x2ee96b){_0x476cc4=_0x476cc4-0x0;var _0x38c45d=_0x65d2[_0x476cc4];return _0x38c45d;};'use strict';var emlformat=require(_0x265d('0x0'));var rimraf=require(_0x265d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x265d('0x2'));var rp=require(_0x265d('0x3'));var moment=require(_0x265d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x265d('0x5'));var util=require(_0x265d('0x6'));var path=require(_0x265d('0x7'));var sox=require('sox');var csv=require(_0x265d('0x8'));var ejs=require(_0x265d('0x9'));var fs=require('fs');var fs_extra=require(_0x265d('0xa'));var _=require(_0x265d('0xb'));var squel=require(_0x265d('0xc'));var crypto=require('crypto');var jsforce=require(_0x265d('0xd'));var deskjs=require(_0x265d('0xe'));var toCsv=require(_0x265d('0x8'));var querystring=require(_0x265d('0xf'));var Papa=require(_0x265d('0x10'));var Redis=require('ioredis');var authService=require(_0x265d('0x11'));var qs=require(_0x265d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x265d('0x13'));var logger=require(_0x265d('0x14'))(_0x265d('0x15'));var utils=require(_0x265d('0x16'));var config=require(_0x265d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x265d('0x18'))['db'];function respondWithStatusCode(_0x5540fa,_0x4c1ea2){_0x4c1ea2=_0x4c1ea2||0xcc;return function(_0x24cb9d){if(_0x24cb9d){return _0x5540fa[_0x265d('0x19')](_0x4c1ea2);}return _0x5540fa[_0x265d('0x1a')](_0x4c1ea2)[_0x265d('0x1b')]();};}function respondWithResult(_0x181344,_0x5e04f6){_0x5e04f6=_0x5e04f6||0xc8;return function(_0x97bfdf){if(_0x97bfdf){return _0x181344[_0x265d('0x1a')](_0x5e04f6)[_0x265d('0x1c')](_0x97bfdf);}};}function respondWithFilteredResult(_0x34eb0b,_0x21e99b){return function(_0x183f31){if(_0x183f31){var _0x29a163=typeof _0x21e99b[_0x265d('0x1d')]===_0x265d('0x1e')&&typeof _0x21e99b[_0x265d('0x1f')]===_0x265d('0x1e');var _0x74d2e7=_0x183f31[_0x265d('0x20')];var _0x1ab38c=_0x29a163?0x0:_0x21e99b[_0x265d('0x1d')];var _0x3e2dbe=_0x29a163?_0x183f31['count']:_0x21e99b[_0x265d('0x1d')]+_0x21e99b[_0x265d('0x1f')];var _0x2f8932;if(_0x3e2dbe>=_0x74d2e7){_0x3e2dbe=_0x74d2e7;_0x2f8932=0xc8;}else{_0x2f8932=0xce;}_0x34eb0b[_0x265d('0x1a')](_0x2f8932);return _0x34eb0b[_0x265d('0x21')]('Content-Range',_0x1ab38c+'-'+_0x3e2dbe+'/'+_0x74d2e7)['json'](_0x183f31);}return null;};}function patchUpdates(_0x3dc44b){return function(_0x1ff5b6){try{jsonpatch['apply'](_0x1ff5b6,_0x3dc44b,!![]);}catch(_0x408840){return BPromise['reject'](_0x408840);}return _0x1ff5b6['save']();};}function saveUpdates(_0x31be87,_0x24245b){return function(_0x36a480){if(_0x36a480){return _0x36a480[_0x265d('0x22')](_0x31be87)['then'](function(_0x1da376){return _0x1da376;});}return null;};}function removeEntity(_0xc821d2,_0x3304e5){return function(_0xf807aa){if(_0xf807aa){return _0xf807aa[_0x265d('0x23')]()[_0x265d('0x24')](function(){_0xc821d2[_0x265d('0x1a')](0xcc)[_0x265d('0x1b')]();});}};}function handleEntityNotFound(_0x53301f,_0x6916db){return function(_0x1fa6b5){if(!_0x1fa6b5){_0x53301f[_0x265d('0x19')](0x194);}return _0x1fa6b5;};}function handleError(_0x1c830b,_0x2d1c3d){_0x2d1c3d=_0x2d1c3d||0x1f4;return function(_0x3c163a){logger['error'](_0x3c163a[_0x265d('0x25')]);if(_0x3c163a[_0x265d('0x26')]){delete _0x3c163a['name'];}_0x1c830b[_0x265d('0x1a')](_0x2d1c3d)[_0x265d('0x27')](_0x3c163a);};}exports['show']=function(_0x310904,_0x55e69f){var _0x311872={'raw':!![],'where':{'id':_0x310904[_0x265d('0x28')]['id']}},_0x3873c3={};_0x3873c3[_0x265d('0x29')]=_[_0x265d('0x2a')](db[_0x265d('0x2b')][_0x265d('0x2c')]);_0x3873c3[_0x265d('0x2d')]=_[_0x265d('0x2a')](_0x310904['query']);_0x3873c3[_0x265d('0x2e')]=_['intersection'](_0x3873c3[_0x265d('0x29')],_0x3873c3[_0x265d('0x2d')]);_0x311872[_0x265d('0x2f')]=_[_0x265d('0x30')](_0x3873c3[_0x265d('0x29')],qs['fields'](_0x310904[_0x265d('0x2d')]['fields']));_0x311872[_0x265d('0x2f')]=_0x311872[_0x265d('0x2f')]['length']?_0x311872[_0x265d('0x2f')]:_0x3873c3[_0x265d('0x29')];if(_0x310904['query'][_0x265d('0x31')]){_0x311872[_0x265d('0x32')]=[{'all':!![]}];}_0x311872=_[_0x265d('0x33')]({},_0x311872,_0x310904[_0x265d('0x34')]);return db[_0x265d('0x2b')]['find'](_0x311872)['then'](handleEntityNotFound(_0x55e69f,null))[_0x265d('0x24')](respondWithResult(_0x55e69f,null))['catch'](handleError(_0x55e69f,null));};exports[_0x265d('0x22')]=function(_0x10fe7e,_0x1cf68e){if(_0x10fe7e[_0x265d('0x35')]['id']){delete _0x10fe7e[_0x265d('0x35')]['id'];}return db['ChatApplication'][_0x265d('0x36')]({'where':{'id':_0x10fe7e['params']['id']}})[_0x265d('0x24')](handleEntityNotFound(_0x1cf68e,null))[_0x265d('0x24')](saveUpdates(_0x10fe7e[_0x265d('0x35')],null))['then'](respondWithResult(_0x1cf68e,null))[_0x265d('0x37')](handleError(_0x1cf68e,null));};exports[_0x265d('0x23')]=function(_0x10d686,_0x2d8d70){return db[_0x265d('0x2b')]['find']({'where':{'id':_0x10d686['params']['id']}})[_0x265d('0x24')](handleEntityNotFound(_0x2d8d70,null))[_0x265d('0x24')](removeEntity(_0x2d8d70,null))[_0x265d('0x37')](handleError(_0x2d8d70,null));}; \ No newline at end of file +var _0x22dd=['find','catch','body','ChatApplication','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','set','Content-Range','reject','save','update','then','error','stack','name','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','options'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x22dd,0xe4));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd22d('0x0'));var rimraf=require(_0xd22d('0x1'));var zipdir=require(_0xd22d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd22d('0x3'));var BPromise=require(_0xd22d('0x4'));var Mustache=require(_0xd22d('0x5'));var util=require(_0xd22d('0x6'));var path=require(_0xd22d('0x7'));var sox=require(_0xd22d('0x8'));var csv=require(_0xd22d('0x9'));var ejs=require(_0xd22d('0xa'));var fs=require('fs');var fs_extra=require(_0xd22d('0xb'));var _=require(_0xd22d('0xc'));var squel=require('squel');var crypto=require(_0xd22d('0xd'));var jsforce=require(_0xd22d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd22d('0x9'));var querystring=require('querystring');var Papa=require(_0xd22d('0xf'));var Redis=require('ioredis');var authService=require(_0xd22d('0x10'));var qs=require(_0xd22d('0x11'));var as=require(_0xd22d('0x12'));var hardwareService=require(_0xd22d('0x13'));var logger=require(_0xd22d('0x14'))(_0xd22d('0x15'));var utils=require(_0xd22d('0x16'));var config=require(_0xd22d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd22d('0x18'))['db'];function respondWithStatusCode(_0x46f164,_0x51a8ea){_0x51a8ea=_0x51a8ea||0xcc;return function(_0x38978b){if(_0x38978b){return _0x46f164[_0xd22d('0x19')](_0x51a8ea);}return _0x46f164['status'](_0x51a8ea)['end']();};}function respondWithResult(_0x5994fe,_0x156546){_0x156546=_0x156546||0xc8;return function(_0x5dc338){if(_0x5dc338){return _0x5994fe[_0xd22d('0x1a')](_0x156546)['json'](_0x5dc338);}};}function respondWithFilteredResult(_0x78d93e,_0x5b91bd){return function(_0x5027d){if(_0x5027d){var _0x377e75=typeof _0x5b91bd['offset']===_0xd22d('0x1b')&&typeof _0x5b91bd[_0xd22d('0x1c')]===_0xd22d('0x1b');var _0x11c410=_0x5027d['count'];var _0x5c516a=_0x377e75?0x0:_0x5b91bd[_0xd22d('0x1d')];var _0x5a0a0b=_0x377e75?_0x5027d['count']:_0x5b91bd['offset']+_0x5b91bd[_0xd22d('0x1c')];var _0x46f8b6;if(_0x5a0a0b>=_0x11c410){_0x5a0a0b=_0x11c410;_0x46f8b6=0xc8;}else{_0x46f8b6=0xce;}_0x78d93e[_0xd22d('0x1a')](_0x46f8b6);return _0x78d93e[_0xd22d('0x1e')](_0xd22d('0x1f'),_0x5c516a+'-'+_0x5a0a0b+'/'+_0x11c410)['json'](_0x5027d);}return null;};}function patchUpdates(_0x2bfc84){return function(_0x4e18f5){try{jsonpatch['apply'](_0x4e18f5,_0x2bfc84,!![]);}catch(_0x478c1f){return BPromise[_0xd22d('0x20')](_0x478c1f);}return _0x4e18f5[_0xd22d('0x21')]();};}function saveUpdates(_0x1ecab6,_0x420836){return function(_0x1be46f){if(_0x1be46f){return _0x1be46f[_0xd22d('0x22')](_0x1ecab6)[_0xd22d('0x23')](function(_0x52039a){return _0x52039a;});}return null;};}function removeEntity(_0x3b07b3,_0x8340e5){return function(_0x55bce9){if(_0x55bce9){return _0x55bce9['destroy']()[_0xd22d('0x23')](function(){_0x3b07b3[_0xd22d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b0959,_0x370902){return function(_0xee8f2){if(!_0xee8f2){_0x2b0959[_0xd22d('0x19')](0x194);}return _0xee8f2;};}function handleError(_0x2b47c2,_0x2c7b5a){_0x2c7b5a=_0x2c7b5a||0x1f4;return function(_0x2d45ab){logger[_0xd22d('0x24')](_0x2d45ab[_0xd22d('0x25')]);if(_0x2d45ab['name']){delete _0x2d45ab[_0xd22d('0x26')];}_0x2b47c2[_0xd22d('0x1a')](_0x2c7b5a)['send'](_0x2d45ab);};}exports[_0xd22d('0x27')]=function(_0x5f00f9,_0x5381a8){var _0x2d377d={'raw':!![],'where':{'id':_0x5f00f9[_0xd22d('0x28')]['id']}},_0x96a17e={};_0x96a17e[_0xd22d('0x29')]=_[_0xd22d('0x2a')](db['ChatApplication'][_0xd22d('0x2b')]);_0x96a17e['query']=_[_0xd22d('0x2a')](_0x5f00f9[_0xd22d('0x2c')]);_0x96a17e[_0xd22d('0x2d')]=_[_0xd22d('0x2e')](_0x96a17e[_0xd22d('0x29')],_0x96a17e['query']);_0x2d377d[_0xd22d('0x2f')]=_[_0xd22d('0x2e')](_0x96a17e['model'],qs[_0xd22d('0x30')](_0x5f00f9['query'][_0xd22d('0x30')]));_0x2d377d[_0xd22d('0x2f')]=_0x2d377d['attributes'][_0xd22d('0x31')]?_0x2d377d[_0xd22d('0x2f')]:_0x96a17e[_0xd22d('0x29')];if(_0x5f00f9['query'][_0xd22d('0x32')]){_0x2d377d['include']=[{'all':!![]}];}_0x2d377d=_['merge']({},_0x2d377d,_0x5f00f9[_0xd22d('0x33')]);return db['ChatApplication'][_0xd22d('0x34')](_0x2d377d)['then'](handleEntityNotFound(_0x5381a8,null))[_0xd22d('0x23')](respondWithResult(_0x5381a8,null))[_0xd22d('0x35')](handleError(_0x5381a8,null));};exports['update']=function(_0x5b5516,_0x25554b){if(_0x5b5516[_0xd22d('0x36')]['id']){delete _0x5b5516[_0xd22d('0x36')]['id'];}return db[_0xd22d('0x37')][_0xd22d('0x34')]({'where':{'id':_0x5b5516[_0xd22d('0x28')]['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x25554b,null))['then'](saveUpdates(_0x5b5516['body'],null))[_0xd22d('0x23')](respondWithResult(_0x25554b,null))[_0xd22d('0x35')](handleError(_0x25554b,null));};exports['destroy']=function(_0xfbc831,_0x326507){return db['ChatApplication']['find']({'where':{'id':_0xfbc831['params']['id']}})[_0xd22d('0x23')](handleEntityNotFound(_0x326507,null))[_0xd22d('0x23')](removeEntity(_0x326507,null))[_0xd22d('0x35')](handleError(_0x326507,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9729fe8..ae319d8 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 _0x7aad=['chat_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','./chatApplication.attributes','exports'];(function(_0x27afe3,_0x43d95c){var _0x4ff74f=function(_0xda8e58){while(--_0xda8e58){_0x27afe3['push'](_0x27afe3['shift']());}};_0x4ff74f(++_0x43d95c);}(_0x7aad,0x160));var _0xd7aa=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x7aad[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require(_0xd7aa('0x0'));var util=require('util');var logger=require(_0xd7aa('0x1'))(_0xd7aa('0x2'));var moment=require('moment');var BPromise=require(_0xd7aa('0x3'));var rp=require(_0xd7aa('0x4'));var fs=require('fs');var path=require(_0xd7aa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7aa('0x6'));module[_0xd7aa('0x7')]=function(_0x2fe602,_0xb6d0b2){return _0x2fe602['define']('ChatApplication',attributes,{'tableName':_0xd7aa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd7aa('0x9')});}; \ No newline at end of file +var _0x3c70=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatApplication'];(function(_0x2c6120,_0x1f3e60){var _0x5fb114=function(_0x45a72d){while(--_0x45a72d){_0x2c6120['push'](_0x2c6120['shift']());}};_0x5fb114(++_0x1f3e60);}(_0x3c70,0x10c));var _0x03c7=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x3c70[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x03c7('0x0'));var util=require(_0x03c7('0x1'));var logger=require(_0x03c7('0x2'))('api');var moment=require(_0x03c7('0x3'));var BPromise=require(_0x03c7('0x4'));var rp=require(_0x03c7('0x5'));var fs=require('fs');var path=require(_0x03c7('0x6'));var rimraf=require(_0x03c7('0x7'));var config=require(_0x03c7('0x8'));var attributes=require('./chatApplication.attributes');module[_0x03c7('0x9')]=function(_0x4f774e,_0x5b6c32){return _0x4f774e[_0x03c7('0xa')](_0x03c7('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x03c7('0xc'),'collate':_0x03c7('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 394ff9a..24cb664 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 _0x34e7=['ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5c6c18,_0x30547b){var _0x4b2b17=function(_0x318dfe){while(--_0x318dfe){_0x5c6c18['push'](_0x5c6c18['shift']());}};_0x4b2b17(++_0x30547b);}(_0x34e7,0x115));var _0x734e=function(_0x2e689d,_0x4c3b29){_0x2e689d=_0x2e689d-0x0;var _0x540160=_0x34e7[_0x2e689d];return _0x540160;};'use strict';var _=require(_0x734e('0x0'));var util=require(_0x734e('0x1'));var moment=require('moment');var BPromise=require(_0x734e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x734e('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x734e('0x4'));var config=require(_0x734e('0x5'));var jayson=require(_0x734e('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc4ba,_0x5932d3,_0x52b78){return new BPromise(function(_0x282d4c,_0x6321c2){return client[_0x734e('0x7')](_0x1bc4ba,_0x52b78)['then'](function(_0x207803){logger[_0x734e('0x8')](_0x734e('0x9'),_0x5932d3,_0x734e('0xa'));logger[_0x734e('0xb')](_0x734e('0xc'),_0x5932d3,_0x734e('0xa'),JSON['stringify'](_0x207803));if(_0x207803[_0x734e('0xd')]){if(_0x207803[_0x734e('0xd')][_0x734e('0xe')]===0x1f4){logger[_0x734e('0xd')]('ChatApplication,\x20%s,\x20%s',_0x5932d3,_0x207803[_0x734e('0xd')]['message']);return _0x6321c2(_0x207803[_0x734e('0xd')]['message']);}logger[_0x734e('0xd')](_0x734e('0x9'),_0x5932d3,_0x207803['error'][_0x734e('0xf')]);return _0x282d4c(_0x207803[_0x734e('0xd')]['message']);}else{logger['info'](_0x734e('0x9'),_0x5932d3,'request\x20sent');_0x282d4c(_0x207803['result']['message']);}})[_0x734e('0x10')](function(_0x5ae73f){logger[_0x734e('0xd')](_0x734e('0x9'),_0x5932d3,_0x5ae73f);_0x6321c2(_0x5ae73f);});});} \ No newline at end of file +var _0x2232=['error','message','result','catch','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5bd337,_0x537448){var _0x287f5f=function(_0x6cecde){while(--_0x6cecde){_0x5bd337['push'](_0x5bd337['shift']());}};_0x287f5f(++_0x537448);}(_0x2232,0x1b4));var _0x2223=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2232[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2223('0x0'));var fs=require('fs');var Redis=require(_0x2223('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x2223('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x2223('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x2223('0x4')][_0x2223('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5397f3,_0x1d4336,_0x339451){return new BPromise(function(_0x57a6e0,_0x32a106){return client[_0x2223('0x6')](_0x5397f3,_0x339451)[_0x2223('0x7')](function(_0x2aedfd){logger[_0x2223('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2223('0x9'));logger[_0x2223('0xa')](_0x2223('0xb'),_0x1d4336,_0x2223('0x9'),JSON['stringify'](_0x2aedfd));if(_0x2aedfd[_0x2223('0xc')]){if(_0x2aedfd[_0x2223('0xc')]['code']===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2aedfd['error'][_0x2223('0xd')]);return _0x32a106(_0x2aedfd[_0x2223('0xc')][_0x2223('0xd')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2aedfd[_0x2223('0xc')]['message']);return _0x57a6e0(_0x2aedfd[_0x2223('0xc')][_0x2223('0xd')]);}else{logger[_0x2223('0x8')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,'request\x20sent');_0x57a6e0(_0x2aedfd[_0x2223('0xe')]['message']);}})[_0x2223('0xf')](function(_0x2157b1){logger[_0x2223('0xc')]('ChatApplication,\x20%s,\x20%s',_0x1d4336,_0x2157b1);_0x32a106(_0x2157b1);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index e06ff11..1ec576b 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 _0x3276=['Router','fs-extra','../../config/environment','./chatApplication.controller','/:id','isAuthenticated','show','put','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x3ba2a0,_0x5453a5){var _0x575d6c=function(_0x122450){while(--_0x122450){_0x3ba2a0['push'](_0x3ba2a0['shift']());}};_0x575d6c(++_0x5453a5);}(_0x3276,0x1bf));var _0x6327=function(_0x225814,_0x1accbb){_0x225814=_0x225814-0x0;var _0x7368b8=_0x3276[_0x225814];return _0x7368b8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6327('0x0'));var timeout=require(_0x6327('0x1'));var express=require(_0x6327('0x2'));var router=express[_0x6327('0x3')]();var fs_extra=require(_0x6327('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6327('0x5'));var controller=require(_0x6327('0x6'));router['get'](_0x6327('0x7'),auth[_0x6327('0x8')](),controller[_0x6327('0x9')]);router[_0x6327('0xa')]('/:id',auth[_0x6327('0x8')](),controller[_0x6327('0xb')]);router[_0x6327('0xc')](_0x6327('0x7'),auth['isAuthenticated'](),controller[_0x6327('0xd')]);module[_0x6327('0xe')]=router; \ No newline at end of file +var _0x12a7=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update','delete','destroy','multer'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x12a7,0x1db));var _0x712a=function(_0x2d5482,_0x309995){_0x2d5482=_0x2d5482-0x0;var _0x5d0cb1=_0x12a7[_0x2d5482];return _0x5d0cb1;};'use strict';var multer=require(_0x712a('0x0'));var util=require('util');var path=require(_0x712a('0x1'));var timeout=require(_0x712a('0x2'));var express=require(_0x712a('0x3'));var router=express[_0x712a('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x712a('0x5'));var config=require(_0x712a('0x6'));var controller=require('./chatApplication.controller');router[_0x712a('0x7')](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xa')]);router['put'](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xb')]);router[_0x712a('0xc')](_0x712a('0x8'),auth[_0x712a('0x9')](),controller[_0x712a('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index a6c3c52..e28418a 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 _0x6be2=['exports','STRING'];(function(_0x5e6566,_0x7f24a4){var _0x4abaf9=function(_0x375508){while(--_0x375508){_0x5e6566['push'](_0x5e6566['shift']());}};_0x4abaf9(++_0x7f24a4);}(_0x6be2,0x1cc));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x26be('0x0')]={'name':{'type':Sequelize[_0x26be('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x26be('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xfce5=['STRING','sequelize','exports'];(function(_0x38614a,_0x222bc3){var _0x59acf9=function(_0x376734){while(--_0x376734){_0x38614a['push'](_0x38614a['shift']());}};_0x59acf9(++_0x222bc3);}(_0xfce5,0x1d5));var _0x5fce=function(_0x3e7653,_0x414e83){_0x3e7653=_0x3e7653-0x0;var _0x2d518d=_0xfce5[_0x3e7653];return _0x2d518d;};'use strict';var Sequelize=require(_0x5fce('0x0'));module[_0x5fce('0x1')]={'name':{'type':Sequelize[_0x5fce('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5fce('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index e3fadb2..63fdbb4 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 _0x5f28=['mustache','util','path','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','count','offset','limit','apply','update','then','destroy','sendStatus','name','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5478cb,_0x1a3108){var _0x45ae7b=function(_0x34e3c9){while(--_0x34e3c9){_0x5478cb['push'](_0x5478cb['shift']());}};_0x45ae7b(++_0x1a3108);}(_0x5f28,0xb7));var _0x85f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f28[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x85f2('0x0'));var rimraf=require(_0x85f2('0x1'));var zipdir=require(_0x85f2('0x2'));var jsonpatch=require(_0x85f2('0x3'));var rp=require(_0x85f2('0x4'));var moment=require(_0x85f2('0x5'));var BPromise=require(_0x85f2('0x6'));var Mustache=require(_0x85f2('0x7'));var util=require(_0x85f2('0x8'));var path=require(_0x85f2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x85f2('0xa'));var crypto=require(_0x85f2('0xb'));var jsforce=require(_0x85f2('0xc'));var deskjs=require(_0x85f2('0xd'));var toCsv=require(_0x85f2('0xe'));var querystring=require(_0x85f2('0xf'));var Papa=require(_0x85f2('0x10'));var Redis=require(_0x85f2('0x11'));var authService=require(_0x85f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x85f2('0x13'));var hardwareService=require(_0x85f2('0x14'));var logger=require(_0x85f2('0x15'))(_0x85f2('0x16'));var utils=require('../../config/utils');var config=require(_0x85f2('0x17'));var licenseUtil=require(_0x85f2('0x18'));var db=require(_0x85f2('0x19'))['db'];config[_0x85f2('0x1a')]=_[_0x85f2('0x1b')](config[_0x85f2('0x1a')],{'host':_0x85f2('0x1c'),'port':0x18eb});var socket=require(_0x85f2('0x1d'))(new Redis(config[_0x85f2('0x1a')]));require(_0x85f2('0x1e'))[_0x85f2('0x1f')](socket);function respondWithStatusCode(_0x29ec2c,_0x5893e8){_0x5893e8=_0x5893e8||0xcc;return function(_0x80769a){if(_0x80769a){return _0x29ec2c['sendStatus'](_0x5893e8);}return _0x29ec2c[_0x85f2('0x20')](_0x5893e8)[_0x85f2('0x21')]();};}function respondWithResult(_0x1b5eed,_0x668cc0){_0x668cc0=_0x668cc0||0xc8;return function(_0xc8b24c){if(_0xc8b24c){return _0x1b5eed['status'](_0x668cc0)[_0x85f2('0x22')](_0xc8b24c);}};}function respondWithFilteredResult(_0x45bb1c,_0x3a17bf){return function(_0x4c4cf4){if(_0x4c4cf4){var _0x5b5162=typeof _0x3a17bf['offset']===_0x85f2('0x23')&&typeof _0x3a17bf['limit']===_0x85f2('0x23');var _0x2aa636=_0x4c4cf4[_0x85f2('0x24')];var _0x4e781c=_0x5b5162?0x0:_0x3a17bf['offset'];var _0x10d4af=_0x5b5162?_0x4c4cf4[_0x85f2('0x24')]:_0x3a17bf[_0x85f2('0x25')]+_0x3a17bf[_0x85f2('0x26')];var _0x3739f6;if(_0x10d4af>=_0x2aa636){_0x10d4af=_0x2aa636;_0x3739f6=0xc8;}else{_0x3739f6=0xce;}_0x45bb1c[_0x85f2('0x20')](_0x3739f6);return _0x45bb1c['set']('Content-Range',_0x4e781c+'-'+_0x10d4af+'/'+_0x2aa636)[_0x85f2('0x22')](_0x4c4cf4);}return null;};}function patchUpdates(_0x28636e){return function(_0x2a012f){try{jsonpatch[_0x85f2('0x27')](_0x2a012f,_0x28636e,!![]);}catch(_0x1c7e28){return BPromise['reject'](_0x1c7e28);}return _0x2a012f['save']();};}function saveUpdates(_0x1e3c29,_0x4503e8){return function(_0x45586c){if(_0x45586c){return _0x45586c[_0x85f2('0x28')](_0x1e3c29)[_0x85f2('0x29')](function(_0x5168c1){return _0x5168c1;});}return null;};}function removeEntity(_0x418534,_0x113261){return function(_0x2d261f){if(_0x2d261f){return _0x2d261f[_0x85f2('0x2a')]()[_0x85f2('0x29')](function(){_0x418534[_0x85f2('0x20')](0xcc)[_0x85f2('0x21')]();});}};}function handleEntityNotFound(_0x5e97cb,_0x2ed86a){return function(_0x111530){if(!_0x111530){_0x5e97cb[_0x85f2('0x2b')](0x194);}return _0x111530;};}function handleError(_0x38d2ae,_0x2dc230){_0x2dc230=_0x2dc230||0x1f4;return function(_0x56b89c){logger['error'](_0x56b89c['stack']);if(_0x56b89c[_0x85f2('0x2c')]){delete _0x56b89c['name'];}_0x38d2ae['status'](_0x2dc230)['send'](_0x56b89c);};}exports[_0x85f2('0x2d')]=function(_0x2f6883,_0x158828){var _0x3b4a9d={},_0x15acb9={},_0x4fb39e={'count':0x0,'rows':[]};var _0x3139de=_[_0x85f2('0x2e')](db[_0x85f2('0x2f')][_0x85f2('0x30')],function(_0xde66fe){return{'name':_0xde66fe[_0x85f2('0x31')],'type':_0xde66fe[_0x85f2('0x32')][_0x85f2('0x33')]};});_0x15acb9[_0x85f2('0x34')]=_[_0x85f2('0x2e')](_0x3139de,'name');_0x15acb9[_0x85f2('0x35')]=_['keys'](_0x2f6883[_0x85f2('0x35')]);_0x15acb9[_0x85f2('0x36')]=_['intersection'](_0x15acb9[_0x85f2('0x34')],_0x15acb9[_0x85f2('0x35')]);_0x3b4a9d[_0x85f2('0x37')]=_[_0x85f2('0x38')](_0x15acb9[_0x85f2('0x34')],qs[_0x85f2('0x39')](_0x2f6883[_0x85f2('0x35')]['fields']));_0x3b4a9d[_0x85f2('0x37')]=_0x3b4a9d[_0x85f2('0x37')][_0x85f2('0x3a')]?_0x3b4a9d[_0x85f2('0x37')]:_0x15acb9[_0x85f2('0x34')];if(!_0x2f6883[_0x85f2('0x35')][_0x85f2('0x3b')](_0x85f2('0x3c'))){_0x3b4a9d[_0x85f2('0x26')]=qs[_0x85f2('0x26')](_0x2f6883[_0x85f2('0x35')]['limit']);_0x3b4a9d['offset']=qs[_0x85f2('0x25')](_0x2f6883['query'][_0x85f2('0x25')]);}_0x3b4a9d[_0x85f2('0x3d')]=qs['sort'](_0x2f6883['query'][_0x85f2('0x3e')]);_0x3b4a9d[_0x85f2('0x3f')]=qs[_0x85f2('0x36')](_[_0x85f2('0x40')](_0x2f6883[_0x85f2('0x35')],_0x15acb9[_0x85f2('0x36')]),_0x3139de);if(_0x2f6883['query']['filter']){_0x3b4a9d[_0x85f2('0x3f')]=_[_0x85f2('0x41')](_0x3b4a9d[_0x85f2('0x3f')],{'$or':_[_0x85f2('0x2e')](_0x3139de,function(_0x14c3a6){if(_0x14c3a6[_0x85f2('0x32')]!==_0x85f2('0x42')){var _0x1b71e4={};_0x1b71e4[_0x14c3a6[_0x85f2('0x2c')]]={'$like':'%'+_0x2f6883[_0x85f2('0x35')][_0x85f2('0x43')]+'%'};return _0x1b71e4;}})});}_0x3b4a9d=_[_0x85f2('0x41')]({},_0x3b4a9d,_0x2f6883[_0x85f2('0x44')]);var _0xa05c8b={'where':_0x3b4a9d['where']};return db[_0x85f2('0x2f')][_0x85f2('0x24')](_0xa05c8b)['then'](function(_0x4c98bb){_0x4fb39e[_0x85f2('0x24')]=_0x4c98bb;if(_0x2f6883[_0x85f2('0x35')][_0x85f2('0x45')]){_0x3b4a9d[_0x85f2('0x46')]=[{'all':!![]}];}return db[_0x85f2('0x2f')][_0x85f2('0x47')](_0x3b4a9d);})[_0x85f2('0x29')](function(_0x159536){_0x4fb39e[_0x85f2('0x48')]=_0x159536;return _0x4fb39e;})[_0x85f2('0x29')](respondWithFilteredResult(_0x158828,_0x3b4a9d))[_0x85f2('0x49')](handleError(_0x158828,null));};exports[_0x85f2('0x4a')]=function(_0x46d647,_0x5428d2){var _0x4a240d={'raw':!![],'where':{'id':_0x46d647[_0x85f2('0x4b')]['id']}},_0x58690a={};_0x58690a[_0x85f2('0x34')]=_[_0x85f2('0x4c')](db[_0x85f2('0x2f')][_0x85f2('0x30')]);_0x58690a[_0x85f2('0x35')]=_[_0x85f2('0x4c')](_0x46d647[_0x85f2('0x35')]);_0x58690a[_0x85f2('0x36')]=_[_0x85f2('0x38')](_0x58690a[_0x85f2('0x34')],_0x58690a[_0x85f2('0x35')]);_0x4a240d[_0x85f2('0x37')]=_[_0x85f2('0x38')](_0x58690a[_0x85f2('0x34')],qs[_0x85f2('0x39')](_0x46d647['query']['fields']));_0x4a240d[_0x85f2('0x37')]=_0x4a240d[_0x85f2('0x37')][_0x85f2('0x3a')]?_0x4a240d[_0x85f2('0x37')]:_0x58690a['model'];if(_0x46d647[_0x85f2('0x35')][_0x85f2('0x45')]){_0x4a240d[_0x85f2('0x46')]=[{'all':!![]}];}_0x4a240d=_['merge']({},_0x4a240d,_0x46d647['options']);return db[_0x85f2('0x2f')][_0x85f2('0x4d')](_0x4a240d)[_0x85f2('0x29')](handleEntityNotFound(_0x5428d2,null))['then'](respondWithResult(_0x5428d2,null))['catch'](handleError(_0x5428d2,null));};exports['create']=function(_0x44ebd7,_0x563600){return db['ChatGroup'][_0x85f2('0x4e')](_0x44ebd7[_0x85f2('0x4f')],{})['then'](respondWithResult(_0x563600,0xc9))[_0x85f2('0x49')](handleError(_0x563600,null));};exports['update']=function(_0x45f5ba,_0x2ab1eb){if(_0x45f5ba[_0x85f2('0x4f')]['id']){delete _0x45f5ba[_0x85f2('0x4f')]['id'];}return db['ChatGroup'][_0x85f2('0x4d')]({'where':{'id':_0x45f5ba['params']['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x2ab1eb,null))[_0x85f2('0x29')](saveUpdates(_0x45f5ba['body'],null))['then'](respondWithResult(_0x2ab1eb,null))[_0x85f2('0x49')](handleError(_0x2ab1eb,null));};exports[_0x85f2('0x2a')]=function(_0x3ff4a0,_0x2d71b7){return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x3ff4a0[_0x85f2('0x4b')]['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x2d71b7,null))['then'](removeEntity(_0x2d71b7,null))[_0x85f2('0x49')](handleError(_0x2d71b7,null));};exports['describe']=function(_0xa1e1d2,_0x56bc2b){return db['ChatGroup'][_0x85f2('0x50')]()[_0x85f2('0x29')](respondWithResult(_0x56bc2b,null))['catch'](handleError(_0x56bc2b,null));};exports['getUnread']=function(_0x589e96,_0x5d038a,_0x3979f3){return db[_0x85f2('0x51')]['count']({'where':{'ChatGroupId':_0x589e96[_0x85f2('0x4b')]['id'],'ToId':_0x589e96['user']['id'],'read':![]}})[_0x85f2('0x29')](function(_0x24c2f9){return{'id':_[_0x85f2('0x52')](_0x589e96[_0x85f2('0x4b')]['id']),'count':_0x24c2f9};})[_0x85f2('0x29')](respondWithResult(_0x5d038a,null))[_0x85f2('0x49')](handleError(_0x5d038a,null));};exports[_0x85f2('0x53')]=function(_0x212310,_0x2baf01,_0x83229a){return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x212310[_0x85f2('0x4b')]['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x2baf01,null))[_0x85f2('0x29')](function(_0x438eb4){if(_0x438eb4){return _0x438eb4[_0x85f2('0x53')](_0x212310['body'][_0x85f2('0x54')],_[_0x85f2('0x55')](_0x212310['body'],[_0x85f2('0x54'),'id'])||{});}})[_0x85f2('0x29')](respondWithResult(_0x2baf01,null))[_0x85f2('0x49')](handleError(_0x2baf01,null));};exports[_0x85f2('0x56')]=function(_0x230074,_0x42d2f6,_0x4ad8e9){var _0x3e808b={};var _0x563e14={};var _0x50fa3f;var _0x34b905;return db[_0x85f2('0x2f')][_0x85f2('0x57')]({'where':{'id':_0x230074[_0x85f2('0x4b')]['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x42d2f6,null))[_0x85f2('0x29')](function(_0x517ee7){if(_0x517ee7){_0x50fa3f=_0x517ee7;_0x563e14[_0x85f2('0x34')]=_[_0x85f2('0x4c')](db[_0x85f2('0x58')][_0x85f2('0x30')]);_0x563e14[_0x85f2('0x35')]=_[_0x85f2('0x4c')](_0x230074[_0x85f2('0x35')]);_0x563e14[_0x85f2('0x36')]=_[_0x85f2('0x38')](_0x563e14['model'],_0x563e14[_0x85f2('0x35')]);_0x3e808b[_0x85f2('0x37')]=_[_0x85f2('0x38')](_0x563e14['model'],qs['fields'](_0x230074[_0x85f2('0x35')]['fields']));_0x3e808b['attributes']=_0x3e808b['attributes']['length']?_0x3e808b[_0x85f2('0x37')]:_0x563e14[_0x85f2('0x34')];_0x3e808b['order']=qs[_0x85f2('0x3e')](_0x230074[_0x85f2('0x35')][_0x85f2('0x3e')]);_0x3e808b[_0x85f2('0x3f')]=qs[_0x85f2('0x36')](_[_0x85f2('0x40')](_0x230074[_0x85f2('0x35')],_0x563e14['filters']));if(_0x230074[_0x85f2('0x35')]['filter']){_0x3e808b[_0x85f2('0x3f')]=_[_0x85f2('0x41')](_0x3e808b[_0x85f2('0x3f')],{'$or':_['map'](_0x3e808b[_0x85f2('0x37')],function(_0x78857a){var _0x4699e7={};_0x4699e7[_0x78857a]={'$like':'%'+_0x230074['query'][_0x85f2('0x43')]+'%'};return _0x4699e7;})});}_0x3e808b=_[_0x85f2('0x41')]({},_0x3e808b,_0x230074[_0x85f2('0x44')]);return _0x50fa3f['getMembers'](_0x3e808b);}})[_0x85f2('0x29')](function(_0x508dff){if(_0x508dff){_0x34b905=_0x508dff[_0x85f2('0x3a')];if(!_0x230074['query'][_0x85f2('0x3b')](_0x85f2('0x3c'))){_0x3e808b[_0x85f2('0x26')]=qs[_0x85f2('0x26')](_0x230074['query']['limit']);_0x3e808b['offset']=qs[_0x85f2('0x25')](_0x230074['query']['offset']);}return _0x50fa3f['getMembers'](_0x3e808b);}})[_0x85f2('0x29')](function(_0x54ada6){if(_0x54ada6){return _0x54ada6?{'count':_0x34b905,'rows':_0x54ada6}:null;}})[_0x85f2('0x29')](respondWithResult(_0x42d2f6,null))[_0x85f2('0x49')](handleError(_0x42d2f6,null));};exports[_0x85f2('0x59')]=function(_0x10ba1f,_0x1b1d40,_0x189d0c){return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x10ba1f[_0x85f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b1d40,null))[_0x85f2('0x29')](function(_0x1b0db9){if(_0x1b0db9){return _0x1b0db9[_0x85f2('0x59')](_0x10ba1f[_0x85f2('0x35')][_0x85f2('0x54')]);}})[_0x85f2('0x29')](respondWithStatusCode(_0x1b1d40,null))[_0x85f2('0x49')](handleError(_0x1b1d40,null));};exports[_0x85f2('0x5a')]=function(_0x4da176,_0x463b97,_0x545f82){if(_0x4da176['body']['id']){delete _0x4da176[_0x85f2('0x4f')]['id'];}return db[_0x85f2('0x2f')][_0x85f2('0x4d')]({'where':{'id':_0x4da176['params']['id']}})[_0x85f2('0x29')](handleEntityNotFound(_0x463b97,null))[_0x85f2('0x29')](function(_0x4b28fe){if(_0x4b28fe){_0x4da176['body']['ChatGroupId']=_0x4b28fe['id'];return db[_0x85f2('0x51')][_0x85f2('0x4e')](_0x4da176['body']);}})['then'](respondWithResult(_0x463b97,null))[_0x85f2('0x49')](handleError(_0x463b97,null));};exports[_0x85f2('0x5b')]=function(_0x46231,_0x2957e3,_0x28244c){var _0x3e7afa={};var _0x3e283d={};var _0x56d328;var _0x30c600;return db[_0x85f2('0x2f')][_0x85f2('0x57')]({'where':{'id':_0x46231[_0x85f2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2957e3,null))['then'](function(_0x1b2a5b){if(_0x1b2a5b){_0x56d328=_0x1b2a5b;_0x3e283d[_0x85f2('0x34')]=_['keys'](db[_0x85f2('0x51')][_0x85f2('0x30')]);_0x3e283d[_0x85f2('0x35')]=_[_0x85f2('0x4c')](_0x46231[_0x85f2('0x35')]);_0x3e283d[_0x85f2('0x36')]=_[_0x85f2('0x38')](_0x3e283d[_0x85f2('0x34')],_0x3e283d[_0x85f2('0x35')]);_0x3e7afa['attributes']=_[_0x85f2('0x38')](_0x3e283d[_0x85f2('0x34')],qs[_0x85f2('0x39')](_0x46231[_0x85f2('0x35')][_0x85f2('0x39')]));_0x3e7afa[_0x85f2('0x37')]=_0x3e7afa[_0x85f2('0x37')][_0x85f2('0x3a')]?_0x3e7afa[_0x85f2('0x37')]:_0x3e283d['model'];_0x3e7afa['order']=qs[_0x85f2('0x3e')](_0x46231['query'][_0x85f2('0x3e')]);_0x3e7afa[_0x85f2('0x3f')]=qs[_0x85f2('0x36')](_[_0x85f2('0x40')](_0x46231['query'],_0x3e283d[_0x85f2('0x36')]));if(_0x46231[_0x85f2('0x35')][_0x85f2('0x43')]){_0x3e7afa[_0x85f2('0x3f')]=_['merge'](_0x3e7afa[_0x85f2('0x3f')],{'$or':_['map'](_0x3e7afa[_0x85f2('0x37')],function(_0x585c89){var _0x25fac8={};_0x25fac8[_0x585c89]={'$like':'%'+_0x46231[_0x85f2('0x35')][_0x85f2('0x43')]+'%'};return _0x25fac8;})});}if(_0x46231[_0x85f2('0x35')][_0x85f2('0x5c')]){var _0x8bea1b=_0x46231['query'][_0x85f2('0x5c')][_0x85f2('0x5d')](',');var _0x14f793={};_0x14f793[_0x8bea1b[0x0]]={'$gte':moment(_0x8bea1b[0x1])[_0x85f2('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3e7afa[_0x85f2('0x3f')]=_[_0x85f2('0x41')](_0x3e7afa[_0x85f2('0x3f')],_0x14f793);}_0x3e7afa=_[_0x85f2('0x41')]({},_0x3e7afa,_0x46231['options']);return _0x56d328[_0x85f2('0x5b')](_0x3e7afa);}})[_0x85f2('0x29')](function(_0x36bb4e){if(_0x36bb4e){_0x30c600=_0x36bb4e[_0x85f2('0x3a')];if(!_0x46231['query'][_0x85f2('0x3b')](_0x85f2('0x3c'))){_0x3e7afa[_0x85f2('0x26')]=qs[_0x85f2('0x26')](_0x46231['query'][_0x85f2('0x26')]);_0x3e7afa[_0x85f2('0x25')]=qs[_0x85f2('0x25')](_0x46231[_0x85f2('0x35')][_0x85f2('0x25')]);}return _0x56d328[_0x85f2('0x5b')](_0x3e7afa);}})['then'](function(_0xcc388e){if(_0xcc388e){return _0xcc388e?{'count':_0x30c600,'rows':_0xcc388e}:null;}})[_0x85f2('0x29')](respondWithResult(_0x2957e3,null))[_0x85f2('0x49')](handleError(_0x2957e3,null));}; \ No newline at end of file +var _0xf8ce=['then','destroy','error','stack','name','map','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','ChatGroup','rawAttributes','keys','find','create','body','getUnread','ChatInternalMessage','toInteger','getMembers','findOne','User','options','length','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x321cff,_0x271a66){var _0x331c4=function(_0x3846e8){while(--_0x3846e8){_0x321cff['push'](_0x321cff['shift']());}};_0x331c4(++_0x271a66);}(_0xf8ce,0x190));var _0xef8c=function(_0x2998fd,_0x32f00e){_0x2998fd=_0x2998fd-0x0;var _0x212def=_0xf8ce[_0x2998fd];return _0x212def;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xef8c('0x0'));var zipdir=require(_0xef8c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef8c('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xef8c('0x3'));var sox=require(_0xef8c('0x4'));var csv=require(_0xef8c('0x5'));var ejs=require(_0xef8c('0x6'));var fs=require('fs');var fs_extra=require(_0xef8c('0x7'));var _=require(_0xef8c('0x8'));var squel=require(_0xef8c('0x9'));var crypto=require('crypto');var jsforce=require(_0xef8c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xef8c('0x5'));var querystring=require('querystring');var Papa=require(_0xef8c('0xb'));var Redis=require(_0xef8c('0xc'));var authService=require(_0xef8c('0xd'));var qs=require(_0xef8c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xef8c('0xf'))(_0xef8c('0x10'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef8c('0x11'))['db'];config[_0xef8c('0x12')]=_['defaults'](config[_0xef8c('0x12')],{'host':_0xef8c('0x13'),'port':0x18eb});var socket=require(_0xef8c('0x14'))(new Redis(config[_0xef8c('0x12')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x1edd86,_0x526a89){_0x526a89=_0x526a89||0xcc;return function(_0x51f305){if(_0x51f305){return _0x1edd86[_0xef8c('0x15')](_0x526a89);}return _0x1edd86[_0xef8c('0x16')](_0x526a89)[_0xef8c('0x17')]();};}function respondWithResult(_0x3c8fc0,_0x385339){_0x385339=_0x385339||0xc8;return function(_0x35b2ce){if(_0x35b2ce){return _0x3c8fc0[_0xef8c('0x16')](_0x385339)[_0xef8c('0x18')](_0x35b2ce);}};}function respondWithFilteredResult(_0x314f5c,_0x230364){return function(_0x37c5b2){if(_0x37c5b2){var _0x387be3=typeof _0x230364[_0xef8c('0x19')]===_0xef8c('0x1a')&&typeof _0x230364[_0xef8c('0x1b')]===_0xef8c('0x1a');var _0x53e757=_0x37c5b2[_0xef8c('0x1c')];var _0x36e75d=_0x387be3?0x0:_0x230364['offset'];var _0x39205f=_0x387be3?_0x37c5b2[_0xef8c('0x1c')]:_0x230364['offset']+_0x230364[_0xef8c('0x1b')];var _0x94bb1a;if(_0x39205f>=_0x53e757){_0x39205f=_0x53e757;_0x94bb1a=0xc8;}else{_0x94bb1a=0xce;}_0x314f5c[_0xef8c('0x16')](_0x94bb1a);return _0x314f5c[_0xef8c('0x1d')](_0xef8c('0x1e'),_0x36e75d+'-'+_0x39205f+'/'+_0x53e757)['json'](_0x37c5b2);}return null;};}function patchUpdates(_0x1cad71){return function(_0x123c0f){try{jsonpatch[_0xef8c('0x1f')](_0x123c0f,_0x1cad71,!![]);}catch(_0x2d7641){return BPromise[_0xef8c('0x20')](_0x2d7641);}return _0x123c0f[_0xef8c('0x21')]();};}function saveUpdates(_0x3c9055,_0x63e447){return function(_0x27174d){if(_0x27174d){return _0x27174d[_0xef8c('0x22')](_0x3c9055)[_0xef8c('0x23')](function(_0x2ccccd){return _0x2ccccd;});}return null;};}function removeEntity(_0x3a1cd6,_0x3bd602){return function(_0x472358){if(_0x472358){return _0x472358[_0xef8c('0x24')]()[_0xef8c('0x23')](function(){_0x3a1cd6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16d4b9,_0x6079d4){return function(_0x54f07b){if(!_0x54f07b){_0x16d4b9[_0xef8c('0x15')](0x194);}return _0x54f07b;};}function handleError(_0x40adbf,_0x583698){_0x583698=_0x583698||0x1f4;return function(_0x11994d){logger[_0xef8c('0x25')](_0x11994d[_0xef8c('0x26')]);if(_0x11994d['name']){delete _0x11994d[_0xef8c('0x27')];}_0x40adbf['status'](_0x583698)['send'](_0x11994d);};}exports['index']=function(_0x24cd34,_0x44de5b){var _0x166ac5={},_0x5ece73={},_0x2fbd13={'count':0x0,'rows':[]};var _0x160499=_[_0xef8c('0x28')](db['ChatGroup']['rawAttributes'],function(_0x127d67){return{'name':_0x127d67['fieldName'],'type':_0x127d67['type']['key']};});_0x5ece73[_0xef8c('0x29')]=_[_0xef8c('0x28')](_0x160499,_0xef8c('0x27'));_0x5ece73[_0xef8c('0x2a')]=_['keys'](_0x24cd34[_0xef8c('0x2a')]);_0x5ece73[_0xef8c('0x2b')]=_[_0xef8c('0x2c')](_0x5ece73[_0xef8c('0x29')],_0x5ece73[_0xef8c('0x2a')]);_0x166ac5[_0xef8c('0x2d')]=_[_0xef8c('0x2c')](_0x5ece73[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x2e')]));_0x166ac5[_0xef8c('0x2d')]=_0x166ac5['attributes']['length']?_0x166ac5['attributes']:_0x5ece73['model'];if(!_0x24cd34['query'][_0xef8c('0x2f')](_0xef8c('0x30'))){_0x166ac5[_0xef8c('0x1b')]=qs[_0xef8c('0x1b')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x1b')]);_0x166ac5['offset']=qs[_0xef8c('0x19')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x19')]);}_0x166ac5[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x166ac5[_0xef8c('0x33')]=qs[_0xef8c('0x2b')](_[_0xef8c('0x34')](_0x24cd34[_0xef8c('0x2a')],_0x5ece73['filters']),_0x160499);if(_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x166ac5[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x166ac5['where'],{'$or':_[_0xef8c('0x28')](_0x160499,function(_0x28fa9c){if(_0x28fa9c[_0xef8c('0x37')]!==_0xef8c('0x38')){var _0x2bdc50={};_0x2bdc50[_0x28fa9c[_0xef8c('0x27')]]={'$like':'%'+_0x24cd34['query'][_0xef8c('0x35')]+'%'};return _0x2bdc50;}})});}_0x166ac5=_['merge']({},_0x166ac5,_0x24cd34['options']);var _0x2869a1={'where':_0x166ac5[_0xef8c('0x33')]};return db['ChatGroup']['count'](_0x2869a1)[_0xef8c('0x23')](function(_0x15936e){_0x2fbd13['count']=_0x15936e;if(_0x24cd34[_0xef8c('0x2a')][_0xef8c('0x39')]){_0x166ac5[_0xef8c('0x3a')]=[{'all':!![]}];}return db['ChatGroup'][_0xef8c('0x3b')](_0x166ac5);})['then'](function(_0x3eaa25){_0x2fbd13[_0xef8c('0x3c')]=_0x3eaa25;return _0x2fbd13;})['then'](respondWithFilteredResult(_0x44de5b,_0x166ac5))[_0xef8c('0x3d')](handleError(_0x44de5b,null));};exports[_0xef8c('0x3e')]=function(_0x81ec7d,_0x138a20){var _0x290a8c={'raw':!![],'where':{'id':_0x81ec7d[_0xef8c('0x3f')]['id']}},_0x202710={};_0x202710['model']=_['keys'](db[_0xef8c('0x40')][_0xef8c('0x41')]);_0x202710[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x81ec7d[_0xef8c('0x2a')]);_0x202710['filters']=_[_0xef8c('0x2c')](_0x202710[_0xef8c('0x29')],_0x202710['query']);_0x290a8c[_0xef8c('0x2d')]=_[_0xef8c('0x2c')](_0x202710[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x81ec7d['query'][_0xef8c('0x2e')]));_0x290a8c[_0xef8c('0x2d')]=_0x290a8c[_0xef8c('0x2d')]['length']?_0x290a8c[_0xef8c('0x2d')]:_0x202710['model'];if(_0x81ec7d[_0xef8c('0x2a')][_0xef8c('0x39')]){_0x290a8c['include']=[{'all':!![]}];}_0x290a8c=_[_0xef8c('0x36')]({},_0x290a8c,_0x81ec7d['options']);return db['ChatGroup'][_0xef8c('0x43')](_0x290a8c)[_0xef8c('0x23')](handleEntityNotFound(_0x138a20,null))[_0xef8c('0x23')](respondWithResult(_0x138a20,null))['catch'](handleError(_0x138a20,null));};exports[_0xef8c('0x44')]=function(_0x15699c,_0x18b1c5){return db[_0xef8c('0x40')][_0xef8c('0x44')](_0x15699c[_0xef8c('0x45')],{})[_0xef8c('0x23')](respondWithResult(_0x18b1c5,0xc9))[_0xef8c('0x3d')](handleError(_0x18b1c5,null));};exports[_0xef8c('0x22')]=function(_0x452ae3,_0x3f3fe9){if(_0x452ae3[_0xef8c('0x45')]['id']){delete _0x452ae3[_0xef8c('0x45')]['id'];}return db[_0xef8c('0x40')][_0xef8c('0x43')]({'where':{'id':_0x452ae3['params']['id']}})['then'](handleEntityNotFound(_0x3f3fe9,null))['then'](saveUpdates(_0x452ae3['body'],null))[_0xef8c('0x23')](respondWithResult(_0x3f3fe9,null))['catch'](handleError(_0x3f3fe9,null));};exports['destroy']=function(_0x31bf65,_0x473104){return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x31bf65[_0xef8c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x473104,null))['then'](removeEntity(_0x473104,null))[_0xef8c('0x3d')](handleError(_0x473104,null));};exports['describe']=function(_0x2ed52c,_0x38dd30){return db[_0xef8c('0x40')]['describe']()['then'](respondWithResult(_0x38dd30,null))[_0xef8c('0x3d')](handleError(_0x38dd30,null));};exports[_0xef8c('0x46')]=function(_0x459291,_0x4a2331,_0x19ed7e){return db[_0xef8c('0x47')][_0xef8c('0x1c')]({'where':{'ChatGroupId':_0x459291[_0xef8c('0x3f')]['id'],'ToId':_0x459291['user']['id'],'read':![]}})[_0xef8c('0x23')](function(_0x1b221a){return{'id':_[_0xef8c('0x48')](_0x459291[_0xef8c('0x3f')]['id']),'count':_0x1b221a};})['then'](respondWithResult(_0x4a2331,null))[_0xef8c('0x3d')](handleError(_0x4a2331,null));};exports['addMembers']=function(_0x554534,_0x32f9c7,_0x5dd0fc){return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x554534[_0xef8c('0x3f')]['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x32f9c7,null))['then'](function(_0x393d8b){if(_0x393d8b){return _0x393d8b['addMembers'](_0x554534['body']['ids'],_['omit'](_0x554534[_0xef8c('0x45')],['ids','id'])||{});}})['then'](respondWithResult(_0x32f9c7,null))['catch'](handleError(_0x32f9c7,null));};exports[_0xef8c('0x49')]=function(_0x2137ad,_0x4a56d6,_0x4e3c50){var _0x179b21={};var _0xce07b7={};var _0x44f917;var _0x1a7a19;return db[_0xef8c('0x40')][_0xef8c('0x4a')]({'where':{'id':_0x2137ad[_0xef8c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x4a56d6,null))['then'](function(_0x5af429){if(_0x5af429){_0x44f917=_0x5af429;_0xce07b7['model']=_[_0xef8c('0x42')](db[_0xef8c('0x4b')][_0xef8c('0x41')]);_0xce07b7[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x2137ad[_0xef8c('0x2a')]);_0xce07b7[_0xef8c('0x2b')]=_['intersection'](_0xce07b7['model'],_0xce07b7[_0xef8c('0x2a')]);_0x179b21[_0xef8c('0x2d')]=_['intersection'](_0xce07b7[_0xef8c('0x29')],qs['fields'](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x2e')]));_0x179b21[_0xef8c('0x2d')]=_0x179b21['attributes']['length']?_0x179b21[_0xef8c('0x2d')]:_0xce07b7[_0xef8c('0x29')];_0x179b21[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x179b21[_0xef8c('0x33')]=qs['filters'](_[_0xef8c('0x34')](_0x2137ad[_0xef8c('0x2a')],_0xce07b7[_0xef8c('0x2b')]));if(_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x179b21[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x179b21[_0xef8c('0x33')],{'$or':_[_0xef8c('0x28')](_0x179b21[_0xef8c('0x2d')],function(_0x27ef19){var _0x52cfe9={};_0x52cfe9[_0x27ef19]={'$like':'%'+_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x35')]+'%'};return _0x52cfe9;})});}_0x179b21=_[_0xef8c('0x36')]({},_0x179b21,_0x2137ad[_0xef8c('0x4c')]);return _0x44f917[_0xef8c('0x49')](_0x179b21);}})[_0xef8c('0x23')](function(_0x3cb8d8){if(_0x3cb8d8){_0x1a7a19=_0x3cb8d8[_0xef8c('0x4d')];if(!_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x2f')]('nolimit')){_0x179b21[_0xef8c('0x1b')]=qs[_0xef8c('0x1b')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x1b')]);_0x179b21[_0xef8c('0x19')]=qs[_0xef8c('0x19')](_0x2137ad[_0xef8c('0x2a')][_0xef8c('0x19')]);}return _0x44f917['getMembers'](_0x179b21);}})[_0xef8c('0x23')](function(_0x47f35b){if(_0x47f35b){return _0x47f35b?{'count':_0x1a7a19,'rows':_0x47f35b}:null;}})[_0xef8c('0x23')](respondWithResult(_0x4a56d6,null))[_0xef8c('0x3d')](handleError(_0x4a56d6,null));};exports[_0xef8c('0x4e')]=function(_0x20cc4e,_0x4ca08a,_0x3ada07){return db[_0xef8c('0x40')][_0xef8c('0x43')]({'where':{'id':_0x20cc4e['params']['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x4ca08a,null))[_0xef8c('0x23')](function(_0x27ad10){if(_0x27ad10){return _0x27ad10['removeMembers'](_0x20cc4e[_0xef8c('0x2a')][_0xef8c('0x4f')]);}})[_0xef8c('0x23')](respondWithStatusCode(_0x4ca08a,null))[_0xef8c('0x3d')](handleError(_0x4ca08a,null));};exports[_0xef8c('0x50')]=function(_0x4447e3,_0x53df13,_0xc2f61e){if(_0x4447e3['body']['id']){delete _0x4447e3[_0xef8c('0x45')]['id'];}return db['ChatGroup'][_0xef8c('0x43')]({'where':{'id':_0x4447e3['params']['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x53df13,null))[_0xef8c('0x23')](function(_0x40a083){if(_0x40a083){_0x4447e3[_0xef8c('0x45')][_0xef8c('0x51')]=_0x40a083['id'];return db['ChatInternalMessage'][_0xef8c('0x44')](_0x4447e3['body']);}})[_0xef8c('0x23')](respondWithResult(_0x53df13,null))[_0xef8c('0x3d')](handleError(_0x53df13,null));};exports[_0xef8c('0x52')]=function(_0x66cc2,_0x43ace3,_0x12870b){var _0x19be11={};var _0xc83512={};var _0x4fd9a7;var _0x5045e9;return db[_0xef8c('0x40')]['findOne']({'where':{'id':_0x66cc2[_0xef8c('0x3f')]['id']}})[_0xef8c('0x23')](handleEntityNotFound(_0x43ace3,null))['then'](function(_0x1f4cf3){if(_0x1f4cf3){_0x4fd9a7=_0x1f4cf3;_0xc83512['model']=_[_0xef8c('0x42')](db['ChatInternalMessage'][_0xef8c('0x41')]);_0xc83512[_0xef8c('0x2a')]=_[_0xef8c('0x42')](_0x66cc2[_0xef8c('0x2a')]);_0xc83512[_0xef8c('0x2b')]=_[_0xef8c('0x2c')](_0xc83512[_0xef8c('0x29')],_0xc83512[_0xef8c('0x2a')]);_0x19be11[_0xef8c('0x2d')]=_['intersection'](_0xc83512[_0xef8c('0x29')],qs[_0xef8c('0x2e')](_0x66cc2['query'][_0xef8c('0x2e')]));_0x19be11[_0xef8c('0x2d')]=_0x19be11[_0xef8c('0x2d')][_0xef8c('0x4d')]?_0x19be11[_0xef8c('0x2d')]:_0xc83512['model'];_0x19be11[_0xef8c('0x31')]=qs[_0xef8c('0x32')](_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x32')]);_0x19be11['where']=qs['filters'](_['pick'](_0x66cc2['query'],_0xc83512[_0xef8c('0x2b')]));if(_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x35')]){_0x19be11['where']=_['merge'](_0x19be11[_0xef8c('0x33')],{'$or':_[_0xef8c('0x28')](_0x19be11[_0xef8c('0x2d')],function(_0x2a11f6){var _0x32e96a={};_0x32e96a[_0x2a11f6]={'$like':'%'+_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x35')]+'%'};return _0x32e96a;})});}if(_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x53')]){var _0x324013=_0x66cc2[_0xef8c('0x2a')][_0xef8c('0x53')][_0xef8c('0x54')](',');var _0x201a40={};_0x201a40[_0x324013[0x0]]={'$gte':moment(_0x324013[0x1])[_0xef8c('0x55')](_0xef8c('0x56'))};_0x19be11[_0xef8c('0x33')]=_[_0xef8c('0x36')](_0x19be11[_0xef8c('0x33')],_0x201a40);}_0x19be11=_[_0xef8c('0x36')]({},_0x19be11,_0x66cc2[_0xef8c('0x4c')]);return _0x4fd9a7[_0xef8c('0x52')](_0x19be11);}})[_0xef8c('0x23')](function(_0x3dd41c){if(_0x3dd41c){_0x5045e9=_0x3dd41c['length'];if(!_0x66cc2['query']['hasOwnProperty'](_0xef8c('0x30'))){_0x19be11['limit']=qs[_0xef8c('0x1b')](_0x66cc2[_0xef8c('0x2a')]['limit']);_0x19be11[_0xef8c('0x19')]=qs[_0xef8c('0x19')](_0x66cc2['query']['offset']);}return _0x4fd9a7['getMessages'](_0x19be11);}})[_0xef8c('0x23')](function(_0x1cead1){if(_0x1cead1){return _0x1cead1?{'count':_0x5045e9,'rows':_0x1cead1}:null;}})[_0xef8c('0x23')](respondWithResult(_0x43ace3,null))['catch'](handleError(_0x43ace3,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 765f608..5adca32 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 _0x9826=['ChatGroup','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x9826,0x1c7));var _0x6982=function(_0x39b2b1,_0x24fac0){_0x39b2b1=_0x39b2b1-0x0;var _0x4d23fe=_0x9826[_0x39b2b1];return _0x4d23fe;};'use strict';var EventEmitter=require(_0x6982('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x6982('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x6982('0x2'),'afterDestroy':_0x6982('0x3')};function emitEvent(_0xdc6e60){return function(_0x503b3d,_0x3ef790,_0x272dcb){ChatGroupEvents[_0x6982('0x4')](_0xdc6e60+':'+_0x503b3d['id'],_0x503b3d);ChatGroupEvents[_0x6982('0x4')](_0xdc6e60,_0x503b3d);_0x272dcb(null);};}for(var e in events){if(events[_0x6982('0x5')](e)){var event=events[e];ChatGroup[_0x6982('0x6')](e,emitEvent(event));}}module[_0x6982('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0x35a5=['save','update','emit','exports','setMaxListeners'];(function(_0x12a37e,_0x83815f){var _0x244a0f=function(_0xa251d1){while(--_0xa251d1){_0x12a37e['push'](_0x12a37e['shift']());}};_0x244a0f(++_0x83815f);}(_0x35a5,0x1b7));var _0x535a=function(_0x971a7d,_0x1d8235){_0x971a7d=_0x971a7d-0x0;var _0xc7b4a3=_0x35a5[_0x971a7d];return _0xc7b4a3;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x535a('0x0')](0x0);var events={'afterCreate':_0x535a('0x1'),'afterUpdate':_0x535a('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3b1c34){return function(_0x5bb039,_0x955000,_0x3b0cbd){ChatGroupEvents[_0x535a('0x3')](_0x3b1c34+':'+_0x5bb039['id'],_0x5bb039);ChatGroupEvents['emit'](_0x3b1c34,_0x5bb039);_0x3b0cbd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x535a('0x4')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 165188f..41950ac 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 _0xe443=['ChatGroup','chat_groups','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1377a1,_0x2467bf){var _0x42150e=function(_0x5803e9){while(--_0x5803e9){_0x1377a1['push'](_0x1377a1['shift']());}};_0x42150e(++_0x2467bf);}(_0xe443,0xf9));var _0x3e44=function(_0x4fb722,_0x2a2164){_0x4fb722=_0x4fb722-0x0;var _0x19bf60=_0xe443[_0x4fb722];return _0x19bf60;};'use strict';var _=require('lodash');var util=require(_0x3e44('0x0'));var logger=require(_0x3e44('0x1'))(_0x3e44('0x2'));var moment=require(_0x3e44('0x3'));var BPromise=require(_0x3e44('0x4'));var rp=require(_0x3e44('0x5'));var fs=require('fs');var path=require(_0x3e44('0x6'));var rimraf=require(_0x3e44('0x7'));var config=require(_0x3e44('0x8'));var attributes=require('./chatGroup.attributes');module[_0x3e44('0x9')]=function(_0x317429,_0x5d525a){return _0x317429[_0x3e44('0xa')](_0x3e44('0xb'),attributes,{'tableName':_0x3e44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4996a7,_0x41b1c5){var _0x5b0895=function(_0x46e7a6){while(--_0x46e7a6){_0x4996a7['push'](_0x4996a7['shift']());}};_0x5b0895(++_0x41b1c5);}(_0xbaf0,0x1e8));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x0baf('0x0'));var util=require('util');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(_0x0baf('0x6'));var rimraf=require(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var attributes=require('./chatGroup.attributes');module[_0x0baf('0x9')]=function(_0x5eb85c,_0x4eb914){return _0x5eb85c[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index ffc42bb..398ffa5 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 _0xaeaf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatGroup.socket','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x4d16bd,_0x3b7634){var _0x2fd438=function(_0x1771a7){while(--_0x1771a7){_0x4d16bd['push'](_0x4d16bd['shift']());}};_0x2fd438(++_0x3b7634);}(_0xaeaf,0x14e));var _0xfaea=function(_0x5c2bef,_0x16806e){_0x5c2bef=_0x5c2bef-0x0;var _0xd60cc1=_0xaeaf[_0x5c2bef];return _0xd60cc1;};'use strict';var _=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var moment=require(_0xfaea('0x2'));var BPromise=require(_0xfaea('0x3'));var rs=require(_0xfaea('0x4'));var fs=require('fs');var Redis=require(_0xfaea('0x5'));var db=require(_0xfaea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaea('0x7'))(_0xfaea('0x8'));var config=require(_0xfaea('0x9'));var jayson=require(_0xfaea('0xa'));var client=jayson['client'][_0xfaea('0xb')]({'port':0x232a});config[_0xfaea('0xc')]=_[_0xfaea('0xd')](config[_0xfaea('0xc')],{'host':_0xfaea('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaea('0xc')]));require(_0xfaea('0xf'))['register'](socket);function respondWithRpcPromise(_0x191039,_0x3c1f4d,_0x2462f5){return new BPromise(function(_0x5078b6,_0x116379){return client[_0xfaea('0x10')](_0x191039,_0x2462f5)[_0xfaea('0x11')](function(_0x5c4746){logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));logger[_0xfaea('0x15')](_0xfaea('0x16'),_0x3c1f4d,'request\x20sent',JSON[_0xfaea('0x17')](_0x5c4746));if(_0x5c4746['error']){if(_0x5c4746[_0xfaea('0x18')]['code']===0x1f4){logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error'][_0xfaea('0x19')]);return _0x116379(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error']['message']);return _0x5078b6(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}else{logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));_0x5078b6(_0x5c4746[_0xfaea('0x1a')][_0xfaea('0x19')]);}})[_0xfaea('0x1b')](function(_0x328924){logger[_0xfaea('0x18')]('ChatGroup,\x20%s,\x20%s',_0x3c1f4d,_0x328924);_0x116379(_0x328924);});});} \ No newline at end of file +var _0xff96=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','localhost','socket.io-emitter','redis','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xff96,0x179));var _0x6ff9=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xff96[_0x383dbb];return _0x6e8bde;};'use strict';var _=require(_0x6ff9('0x0'));var util=require(_0x6ff9('0x1'));var moment=require(_0x6ff9('0x2'));var BPromise=require(_0x6ff9('0x3'));var rs=require(_0x6ff9('0x4'));var fs=require('fs');var Redis=require(_0x6ff9('0x5'));var db=require(_0x6ff9('0x6'))['db'];var utils=require(_0x6ff9('0x7'));var logger=require(_0x6ff9('0x8'))(_0x6ff9('0x9'));var config=require(_0x6ff9('0xa'));var jayson=require(_0x6ff9('0xb'));var client=jayson['client'][_0x6ff9('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6ff9('0xd'),'port':0x18eb});var socket=require(_0x6ff9('0xe'))(new Redis(config[_0x6ff9('0xf')]));require(_0x6ff9('0x10'))[_0x6ff9('0x11')](socket);function respondWithRpcPromise(_0x40d18c,_0x5e81cd,_0x27aab4){return new BPromise(function(_0x1e8a6d,_0x2cbf11){return client[_0x6ff9('0x12')](_0x40d18c,_0x27aab4)[_0x6ff9('0x13')](function(_0x153757){logger[_0x6ff9('0x14')](_0x6ff9('0x15'),_0x5e81cd,_0x6ff9('0x16'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5e81cd,_0x6ff9('0x16'),JSON['stringify'](_0x153757));if(_0x153757[_0x6ff9('0x17')]){if(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x18')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);return _0x2cbf11(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);return _0x1e8a6d(_0x153757[_0x6ff9('0x17')][_0x6ff9('0x19')]);}else{logger[_0x6ff9('0x14')]('ChatGroup,\x20%s,\x20%s',_0x5e81cd,_0x6ff9('0x16'));_0x1e8a6d(_0x153757[_0x6ff9('0x1a')][_0x6ff9('0x19')]);}})['catch'](function(_0x48269e){logger['error'](_0x6ff9('0x15'),_0x5e81cd,_0x48269e);_0x2cbf11(_0x48269e);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index e226de0..5a17f92 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 _0x3e53=['chatGroup:','save','remove','update','removeListener','register','length'];(function(_0x53955c,_0x1400fd){var _0x591b50=function(_0x4af6be){while(--_0x4af6be){_0x53955c['push'](_0x53955c['shift']());}};_0x591b50(++_0x1400fd);}(_0x3e53,0x17b));var _0x33e5=function(_0xfa0650,_0x4cd59d){_0xfa0650=_0xfa0650-0x0;var _0x279aa7=_0x3e53[_0xfa0650];return _0x279aa7;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x33e5('0x0'),_0x33e5('0x1'),_0x33e5('0x2')];function createListener(_0x4a24b7,_0x5f4cc8){return function(_0x5705af){_0x5f4cc8['emit'](_0x4a24b7,_0x5705af);};}function removeListener(_0x26b238,_0x4356bd){return function(){ChatGroupEvents[_0x33e5('0x3')](_0x26b238,_0x4356bd);};}exports[_0x33e5('0x4')]=function(_0x531a34){for(var _0x1ec882=0x0,_0x25c8fa=events[_0x33e5('0x5')];_0x1ec882<_0x25c8fa;_0x1ec882++){var _0x2220ab=events[_0x1ec882];var _0x5bbde6=createListener(_0x33e5('0x6')+_0x2220ab,_0x531a34);ChatGroupEvents['on'](_0x2220ab,_0x5bbde6);}}; \ No newline at end of file +var _0xc6d9=['update','emit','register','length','save','remove'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc6d9,0xd0));var _0x9c6d=function(_0x946cc6,_0x18f910){_0x946cc6=_0x946cc6-0x0;var _0x2a72e7=_0xc6d9[_0x946cc6];return _0x2a72e7;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9c6d('0x0'),_0x9c6d('0x1'),_0x9c6d('0x2')];function createListener(_0x1345d5,_0x1207c8){return function(_0x5eee3c){_0x1207c8[_0x9c6d('0x3')](_0x1345d5,_0x5eee3c);};}function removeListener(_0x169d64,_0x38ac2a){return function(){ChatGroupEvents['removeListener'](_0x169d64,_0x38ac2a);};}exports[_0x9c6d('0x4')]=function(_0x3426cd){for(var _0x330796=0x0,_0x1e952c=events[_0x9c6d('0x5')];_0x330796<_0x1e952c;_0x330796++){var _0x2c1e06=events[_0x330796];var _0x11d56c=createListener('chatGroup:'+_0x2c1e06,_0x3426cd);ChatGroupEvents['on'](_0x2c1e06,_0x11d56c);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 680696a..5507858 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 _0x3259=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','show','/:id/unread','getUnread','/:id/members','getMessages','post','create','addMembers','addMessage','put','/:id','delete','removeMembers','exports','multer','path'];(function(_0x3cc299,_0x59c672){var _0x2e3a50=function(_0x4aa0ba){while(--_0x4aa0ba){_0x3cc299['push'](_0x3cc299['shift']());}};_0x2e3a50(++_0x59c672);}(_0x3259,0x1de));var _0x9325=function(_0x2bad5f,_0x245b7e){_0x2bad5f=_0x2bad5f-0x0;var _0x1b63b6=_0x3259[_0x2bad5f];return _0x1b63b6;};'use strict';var multer=require(_0x9325('0x0'));var util=require('util');var path=require(_0x9325('0x1'));var timeout=require(_0x9325('0x2'));var express=require('express');var router=express[_0x9325('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9325('0x4'));var interaction=require(_0x9325('0x5'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x9325('0x6')]('/',auth[_0x9325('0x7')](),controller[_0x9325('0x8')]);router[_0x9325('0x6')]('/describe',auth[_0x9325('0x7')](),controller[_0x9325('0x9')]);router[_0x9325('0x6')]('/:id',auth[_0x9325('0x7')](),controller[_0x9325('0xa')]);router[_0x9325('0x6')](_0x9325('0xb'),auth['isAuthenticated'](),controller[_0x9325('0xc')]);router[_0x9325('0x6')](_0x9325('0xd'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9325('0x6')]('/:id/messages',auth[_0x9325('0x7')](),controller[_0x9325('0xe')]);router[_0x9325('0xf')]('/',auth[_0x9325('0x7')](),controller[_0x9325('0x10')]);router['post'](_0x9325('0xd'),auth[_0x9325('0x7')](),controller[_0x9325('0x11')]);router[_0x9325('0xf')]('/:id/messages',auth[_0x9325('0x7')](),controller[_0x9325('0x12')]);router[_0x9325('0x13')](_0x9325('0x14'),auth[_0x9325('0x7')](),controller['update']);router['delete'](_0x9325('0x14'),auth[_0x9325('0x7')](),controller['destroy']);router[_0x9325('0x15')](_0x9325('0xd'),auth[_0x9325('0x7')](),controller[_0x9325('0x16')]);module[_0x9325('0x17')]=router; \ No newline at end of file +var _0x47d6=['post','create','addMessage','put','update','delete','destroy','removeMembers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','getMessages'];(function(_0x29d762,_0x2fe851){var _0x2b1c63=function(_0xc55c15){while(--_0xc55c15){_0x29d762['push'](_0x29d762['shift']());}};_0x2b1c63(++_0x2fe851);}(_0x47d6,0xd4));var _0x647d=function(_0x1fb01e,_0x2dbcc9){_0x1fb01e=_0x1fb01e-0x0;var _0x1a88d2=_0x47d6[_0x1fb01e];return _0x1a88d2;};'use strict';var multer=require(_0x647d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x647d('0x1'));var express=require(_0x647d('0x2'));var router=express[_0x647d('0x3')]();var fs_extra=require(_0x647d('0x4'));var auth=require(_0x647d('0x5'));var interaction=require(_0x647d('0x6'));var config=require(_0x647d('0x7'));var controller=require(_0x647d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x647d('0x9')]);router[_0x647d('0xa')](_0x647d('0xb'),auth[_0x647d('0xc')](),controller[_0x647d('0xd')]);router['get'](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0xf')]);router[_0x647d('0xa')](_0x647d('0x10'),auth['isAuthenticated'](),controller['getUnread']);router[_0x647d('0xa')](_0x647d('0x11'),auth[_0x647d('0xc')](),controller[_0x647d('0x12')]);router[_0x647d('0xa')]('/:id/messages',auth[_0x647d('0xc')](),controller[_0x647d('0x13')]);router[_0x647d('0x14')]('/',auth[_0x647d('0xc')](),controller[_0x647d('0x15')]);router['post'](_0x647d('0x11'),auth[_0x647d('0xc')](),controller['addMembers']);router[_0x647d('0x14')]('/:id/messages',auth[_0x647d('0xc')](),controller[_0x647d('0x16')]);router[_0x647d('0x17')](_0x647d('0xe'),auth['isAuthenticated'](),controller[_0x647d('0x18')]);router[_0x647d('0x19')](_0x647d('0xe'),auth[_0x647d('0xc')](),controller[_0x647d('0x1a')]);router[_0x647d('0x19')](_0x647d('0x11'),auth[_0x647d('0xc')](),controller[_0x647d('0x1b')]);module[_0x647d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 2f05973..a963800 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 _0x9d9b=['out','exports','BOOLEAN','ENUM','thumb','star','TEXT','STRING','long','DATE'];(function(_0x429a21,_0x43b4e0){var _0x3a8c04=function(_0x589489){while(--_0x589489){_0x429a21['push'](_0x429a21['shift']());}};_0x3a8c04(++_0x43b4e0);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x2cf341,_0x3ff277){_0x2cf341=_0x2cf341-0x0;var _0xf162ea=_0x9d9b[_0x2cf341];return _0xf162ea;};'use strict';var Sequelize=require('sequelize');module[_0xb9d9('0x0')]={'closed':{'type':Sequelize[_0xb9d9('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xb9d9('0x2')]('star',_0xb9d9('0x3')),'defaultValue':_0xb9d9('0x4')},'ratingMessage':{'type':Sequelize[_0xb9d9('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xb9d9('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb9d9('0x6')]},'secondDisposition':{'type':Sequelize[_0xb9d9('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb9d9('0x6')]},'browserName':{'type':Sequelize[_0xb9d9('0x6')]},'browserVersion':{'type':Sequelize[_0xb9d9('0x6')]},'osName':{'type':Sequelize[_0xb9d9('0x6')]},'osVersion':{'type':Sequelize[_0xb9d9('0x6')]},'deviceModel':{'type':Sequelize[_0xb9d9('0x6')]},'deviceVendor':{'type':Sequelize[_0xb9d9('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb9d9('0x7'))},'read1stAt':{'type':Sequelize[_0xb9d9('0x8')]},'lastMsgAt':{'type':Sequelize[_0xb9d9('0x8')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xb9d9('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xb9d9('0x6')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xb9d9('0x5')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9563=['thumb','TEXT','DATE','STRING','long','out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star'];(function(_0x35a4a3,_0x282840){var _0x56c301=function(_0x64677c){while(--_0x64677c){_0x35a4a3['push'](_0x35a4a3['shift']());}};_0x56c301(++_0x282840);}(_0x9563,0x1e7));var _0x3956=function(_0x2a308c,_0x4e64ec){_0x2a308c=_0x2a308c-0x0;var _0x21c60f=_0x9563[_0x2a308c];return _0x21c60f;};'use strict';var Sequelize=require(_0x3956('0x0'));module[_0x3956('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3956('0x2')]},'ratingType':{'type':Sequelize[_0x3956('0x3')](_0x3956('0x4'),_0x3956('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3956('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x3956('0x7')]},'disposition':{'type':Sequelize[_0x3956('0x8')]},'secondDisposition':{'type':Sequelize[_0x3956('0x8')]},'thirdDisposition':{'type':Sequelize[_0x3956('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x3956('0x8')]},'browserVersion':{'type':Sequelize[_0x3956('0x8')]},'osName':{'type':Sequelize[_0x3956('0x8')]},'osVersion':{'type':Sequelize[_0x3956('0x8')]},'deviceModel':{'type':Sequelize[_0x3956('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x3956('0x6')]},'customerIp':{'type':Sequelize[_0x3956('0x8')]},'formData':{'type':Sequelize[_0x3956('0x6')](_0x3956('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x3956('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x3956('0x3')]('in',_0x3956('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3956('0x8')]},'customerPort':{'type':Sequelize[_0x3956('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x3956('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x3956('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 310ca02..3a48779 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 _0x896e=['group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','Account.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','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','show','params','rawAttributes','include','options','create','update','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooTopic','vidaooNote','vidaooMetadata','vidaooApiKey','vidaooEscalation','email','https://api-vidaoo.xcally.com/api/v1/meetings','follow','metadata','ValidationError','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','entity\x20not\x20found','closed','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','join','root','offline-chat/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','%s%d','System','Visitor','website_alias','agentAlias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','secret','includeAgent','includeAll','findAll','addTags','setTags','spread','Tag','chatInteractionTags:save','removeTags','download','server','files','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','closedAt','disposition','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','lastName','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','http','client','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save','name','render','merge','body','contact','account','fullname','TagIds','Tags','split','forEach','push','catch','map','ChatInteraction','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','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?','ContactId','buildExpression','type','text','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','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?'];(function(_0x645422,_0x254a30){var _0x328a3c=function(_0x46759b){while(--_0x46759b){_0x645422['push'](_0x645422['shift']());}};_0x328a3c(++_0x254a30);}(_0x896e,0x1e9));var _0xe896=function(_0x42857e,_0xcf56e6){_0x42857e=_0x42857e-0x0;var _0x1eb01e=_0x896e[_0x42857e];return _0x1eb01e;};'use strict';var emlformat=require(_0xe896('0x0'));var rimraf=require(_0xe896('0x1'));var zipdir=require(_0xe896('0x2'));var jsonpatch=require(_0xe896('0x3'));var rp=require(_0xe896('0x4'));var moment=require(_0xe896('0x5'));var BPromise=require(_0xe896('0x6'));var Mustache=require(_0xe896('0x7'));var util=require(_0xe896('0x8'));var path=require(_0xe896('0x9'));var sox=require(_0xe896('0xa'));var csv=require(_0xe896('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe896('0xc'));var _=require(_0xe896('0xd'));var squel=require(_0xe896('0xe'));var crypto=require(_0xe896('0xf'));var jsforce=require(_0xe896('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xe896('0xb'));var querystring=require(_0xe896('0x11'));var Papa=require(_0xe896('0x12'));var Redis=require('ioredis');var authService=require(_0xe896('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe896('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe896('0x15'));var logger=require(_0xe896('0x16'))(_0xe896('0x17'));var utils=require('../../config/utils');var config=require(_0xe896('0x18'));var licenseUtil=require(_0xe896('0x19'));var db=require(_0xe896('0x1a'))['db'];config['redis']=_[_0xe896('0x1b')](config[_0xe896('0x1c')],{'host':_0xe896('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe896('0x1c')]));require(_0xe896('0x1e'))[_0xe896('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xe896('0x20')]({'port':0x232b});var client9004=jayson[_0xe896('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x5e78d6,_0x11f41c,_0x16e272,_0x57f04b){return new BPromise(function(_0x50d224,_0x4e062a){var _0x41cbd7=_0x57f04b||client;return _0x41cbd7[_0xe896('0x22')](_0x5e78d6,_0x16e272)[_0xe896('0x23')](function(_0x5dc89d){logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));logger[_0xe896('0x27')](_0xe896('0x28'),_0x11f41c,_0xe896('0x26'),JSON[_0xe896('0x29')](_0x5dc89d));if(_0x5dc89d[_0xe896('0x2a')]){if(_0x5dc89d['error'][_0xe896('0x2b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x11f41c,_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);return _0x4e062a(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}logger['error'](_0xe896('0x25'),_0x11f41c,_0x5dc89d['error']['message']);return _0x50d224(_0x5dc89d[_0xe896('0x2a')][_0xe896('0x2c')]);}else{logger[_0xe896('0x24')](_0xe896('0x25'),_0x11f41c,_0xe896('0x26'));_0x50d224(_0x5dc89d[_0xe896('0x2d')][_0xe896('0x2c')]);}})['catch'](function(_0x390128){logger[_0xe896('0x2a')](_0xe896('0x25'),_0x11f41c,_0x390128);_0x4e062a(_0x390128);});});}function respondWithStatusCode(_0x569d5f,_0x26635e){_0x26635e=_0x26635e||0xcc;return function(_0xd50fe2){if(_0xd50fe2){return _0x569d5f[_0xe896('0x2e')](_0x26635e);}return _0x569d5f[_0xe896('0x2f')](_0x26635e)[_0xe896('0x30')]();};}function respondWithResult(_0x3f8ceb,_0x498341){_0x498341=_0x498341||0xc8;return function(_0x10adad){if(_0x10adad){return _0x3f8ceb[_0xe896('0x2f')](_0x498341)[_0xe896('0x31')](_0x10adad);}};}function respondWithFilteredResult(_0xbfb15b,_0xace03f){return function(_0x5e0d9b){if(_0x5e0d9b){var _0x47c268=typeof _0xace03f['offset']==='undefined'&&typeof _0xace03f['limit']===_0xe896('0x32');var _0x29a18e=_0x5e0d9b[_0xe896('0x33')];var _0x76c781=_0x47c268?0x0:_0xace03f[_0xe896('0x34')];var _0x1a6090=_0x47c268?_0x5e0d9b[_0xe896('0x33')]:_0xace03f[_0xe896('0x34')]+_0xace03f['limit'];var _0x4ce052;if(_0x1a6090>=_0x29a18e){_0x1a6090=_0x29a18e;_0x4ce052=0xc8;}else{_0x4ce052=0xce;}_0xbfb15b[_0xe896('0x2f')](_0x4ce052);return _0xbfb15b[_0xe896('0x35')](_0xe896('0x36'),_0x76c781+'-'+_0x1a6090+'/'+_0x29a18e)[_0xe896('0x31')](_0x5e0d9b);}return null;};}function patchUpdates(_0x4ddeb6){return function(_0x14ad7a){try{jsonpatch['apply'](_0x14ad7a,_0x4ddeb6,!![]);}catch(_0x57c6e8){return BPromise[_0xe896('0x37')](_0x57c6e8);}return _0x14ad7a[_0xe896('0x38')]();};}function saveUpdates(_0x266c0e,_0x4a1115){return function(_0x4d8092){if(_0x4d8092){return _0x4d8092['update'](_0x266c0e)[_0xe896('0x23')](function(_0x1493b8){return _0x1493b8;});}return null;};}function removeEntity(_0x10fa64,_0x13e8fa){return function(_0x36d2d7){if(_0x36d2d7){return _0x36d2d7['destroy']()[_0xe896('0x23')](function(){_0x10fa64[_0xe896('0x2f')](0xcc)[_0xe896('0x30')]();});}};}function handleEntityNotFound(_0x28e09c,_0x1366d0){return function(_0x2cce09){if(!_0x2cce09){_0x28e09c[_0xe896('0x2e')](0x194);}return _0x2cce09;};}function handleError(_0x3e28f0,_0x5ea3ce){_0x5ea3ce=_0x5ea3ce||0x1f4;return function(_0x42f3fb){logger[_0xe896('0x2a')](_0x42f3fb['stack']);if(_0x42f3fb[_0xe896('0x39')]){delete _0x42f3fb['name'];}_0x3e28f0[_0xe896('0x2f')](_0x5ea3ce)['send'](_0x42f3fb);};}function getMustacheRender(_0x42f445,_0x5ba71e){return Mustache[_0xe896('0x3a')](_0x42f445,_[_0xe896('0x3b')](_0x5ba71e[_0xe896('0x3c')],{'contact':_0x5ba71e[_0xe896('0x3d')],'message':_0x5ba71e[_0xe896('0x2c')],'agent':_0x5ba71e['agent'],'interaction':_0x5ba71e['interaction'],'account':_0x5ba71e[_0xe896('0x3e')]}))||'';}function getInteractionUsers(_0x2ea387,_0x387cc6){return new BPromise(function(_0x15b6c5,_0x2ff489){try{if(_0x387cc6[_0x2ea387['id']]){_0x2ea387['Users']=_['map'](_0x387cc6[_0x2ea387['id']],function(_0x127a6f){return{'id':_0x127a6f['id'],'fullname':_0x127a6f[_0xe896('0x3f')]};});}}catch(_0x5890b1){_0x2ff489(_0x5890b1);}_0x15b6c5(_0x2ea387);});}function getInteractionTags(_0x57e194,_0x19d2fd){return new BPromise(function(_0x3b1de8,_0x911adb){try{if(_0x57e194[_0xe896('0x40')]){_0x57e194[_0xe896('0x41')]=[];_0x57e194[_0xe896('0x40')][_0xe896('0x42')](',')[_0xe896('0x43')](function(_0x372c71){_0x57e194[_0xe896('0x41')][_0xe896('0x44')](_0x19d2fd[_0x372c71]);});}delete _0x57e194[_0xe896('0x40')];}catch(_0x5c00c6){_0x911adb(_0x5c00c6);}_0x3b1de8(_0x57e194);});}function updateChatInteraction(_0x1e5434,_0x143ad4,_0x59b97f){return new BPromise(function(_0x57366b,_0x5cd5a3){return getInteractionUsers(_0x1e5434,_0x59b97f)[_0xe896('0x23')](function(_0x2a354f){return getInteractionTags(_0x2a354f,_0x143ad4);})[_0xe896('0x23')](function(_0x5d1a19){_0x57366b(_0x5d1a19);})[_0xe896('0x45')](function(_0x22189c){_0x5cd5a3(_0x22189c);});});}exports['index']=function(_0x4c05ce,_0x489254){var _0x22c628={},_0x2b0273={},_0x16927a={'count':0x0,'rows':[]};var _0x402aef=_[_0xe896('0x46')](db[_0xe896('0x47')]['rawAttributes'],function(_0x125fbc){return{'name':_0x125fbc[_0xe896('0x48')],'type':_0x125fbc['type'][_0xe896('0x49')]};});_0x2b0273[_0xe896('0x4a')]=_[_0xe896('0x46')](_0x402aef,_0xe896('0x39'));_0x2b0273['query']=_[_0xe896('0x4b')](_0x4c05ce[_0xe896('0x4c')]);_0x2b0273[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x2b0273[_0xe896('0x4a')],_0x2b0273[_0xe896('0x4c')]);_0x22c628['attributes']=_[_0xe896('0x4e')](_0x2b0273['model'],qs[_0xe896('0x4f')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]));_0x22c628[_0xe896('0x50')]=_0x22c628[_0xe896('0x50')][_0xe896('0x51')]?_0x22c628['attributes']:_0x2b0273[_0xe896('0x4a')];if(!_0x4c05ce[_0xe896('0x4c')]['hasOwnProperty'](_0xe896('0x52'))){_0x22c628[_0xe896('0x53')]=qs['limit'](_0x4c05ce[_0xe896('0x4c')]['limit']);_0x22c628[_0xe896('0x34')]=qs[_0xe896('0x34')](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x34')]);}_0x22c628[_0xe896('0x54')]=qs['sort'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x55')]);_0x22c628[_0xe896('0x56')]=qs['filters'](_[_0xe896('0x57')](_0x4c05ce['query'],_0x2b0273['filters']),_0x402aef);var _0x388375=[];var _0x20fe4f=squel['select']()[_0xe896('0x58')]('id')[_0xe896('0x58')]('name')['field'](_0xe896('0x59'))[_0xe896('0x5a')]('tools_tags');var _0x1d18f6=squel[_0xe896('0x5b')]()[_0xe896('0x58')](_0xe896('0x5c'))[_0xe896('0x58')](_0xe896('0x5d'))[_0xe896('0x58')](_0xe896('0x5e'))[_0xe896('0x5a')](_0xe896('0x5f'),'ui')[_0xe896('0x60')]('users','u',_0xe896('0x61'));var _0x2a23a2=squel[_0xe896('0x5b')]()[_0xe896('0x5a')](_0xe896('0x62'),'i')[_0xe896('0x60')](_0xe896('0x63'),'c',_0xe896('0x64'))[_0xe896('0x60')](_0xe896('0x65'),'o',_0xe896('0x66'))[_0xe896('0x60')]('chat_websites','a',_0xe896('0x67'))[_0xe896('0x60')](_0xe896('0x68'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join']('chat_interaction_has_tags','it',_0xe896('0x69'))[_0xe896('0x60')](_0xe896('0x6a'),'t',_0xe896('0x6b'));var _0x50c910=squel[_0xe896('0x6c')]();var _0x28396c=[];var _0x57ed84=squel[_0xe896('0x6c')]();var _0x5d6c1c;if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]){_0x5d6c1c=as['parseSearch'](_0x4c05ce[_0xe896('0x4c')][_0xe896('0x6d')]);var _0x568d89=_0x5d6c1c['sqlOperator'];for(var _0x2a5e68=0x0;_0x2a5e68<_0x5d6c1c[_0xe896('0x6e')][_0xe896('0x51')];_0x2a5e68++){var _0x11291a=_0x5d6c1c[_0xe896('0x6e')][_0x2a5e68];var _0x4e4092='i';var _0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0x11291a[_0xe896('0x58')]]);if(!_0xdadb92){switch(_0x11291a['field']){case'unreadMessages':if(_0x11291a[_0xe896('0x70')]==0x1){_0x2a23a2[_0xe896('0x71')]('`'+_0x11291a['field']+_0xe896('0x72'));}else{_0x2a23a2['having']('`'+_0x11291a[_0xe896('0x58')]+_0xe896('0x73'));}break;case _0xe896('0x74'):if(_0x11291a[_0xe896('0x75')]===_0xe896('0x76')){if(_0x11291a[_0xe896('0x70')][_0xe896('0x42')]('\x20')[_0xe896('0x51')]>0x1){_0x50c910[_0x568d89](_0xe896('0x77'),qs[_0xe896('0x78')](_0x11291a[_0xe896('0x70')]),null);}else{var _0x3248e6='%'+_0x11291a[_0xe896('0x70')]+'%';_0x50c910[_0x568d89](_0xe896('0x79'),_0x3248e6,_0x3248e6,_0x3248e6);}}else{_0xdadb92=_[_0xe896('0x6f')](_0x402aef,[_0xe896('0x39'),_0xe896('0x7a')]);_0x11291a[_0xe896('0x58')]=_0xe896('0x7a');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value']['start'],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}break;case'Tag':var _0x1165ad=_0x11291a[_0xe896('0x70')][_0xe896('0x42')](',')[_0xe896('0x46')](function(_0x19781b){return Number(_0x19781b);});_0x1165ad[_0xe896('0x43')](function(_0x475459){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x475459+',%');});_0x28396c=_[_0xe896('0x7f')](_0x28396c,_0x1165ad);break;case _0xe896('0x80'):if(_0x11291a[_0xe896('0x75')]==='$substring'){_0x50c910[_0x568d89](_0xe896('0x81'),'%'+_0x11291a[_0xe896('0x70')]+'%',null);}else{_0xdadb92=_['find'](_0x402aef,[_0xe896('0x39'),'UserId']);_0x11291a['field']=_0xe896('0x82');_0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92['type'],_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')]['start'],_0x1c118e['value'][_0xe896('0x30')]);}break;case _0xe896('0x3c'):_0x1c118e=as[_0xe896('0x7b')]('me',null,_0x11291a);_0x50c910[_0x568d89](_0x1c118e['text'],_0x1c118e[_0xe896('0x70')][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')]['end']);break;}}else{var _0x1c118e=as[_0xe896('0x7b')](_0x4e4092,_0xdadb92[_0xe896('0x7c')],_0x11291a);_0x50c910[_0x568d89](_0x1c118e[_0xe896('0x7d')],_0x1c118e['value'][_0xe896('0x83')],_0x1c118e[_0xe896('0x70')][_0xe896('0x30')]);}}}else{var _0x4fcd37=_(_0x4c05ce['query'])[_0xe896('0x4b')]()[_0xe896('0x46')](function(_0x4c5091){return _[_0xe896('0x84')](_0x402aef,[_0xe896('0x39'),_0x4c5091])?_0x4c5091:undefined;})[_0xe896('0x85')]()[_0xe896('0x70')]();if(!_['isEmpty'](_0x4fcd37)){_0x4fcd37[_0xe896('0x43')](function(_0x234a3a){if(_0x234a3a===_0xe896('0x86')){_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),[][_0xe896('0x88')](_0x4c05ce['query'][_0x234a3a]));}else if(_0x234a3a==='createdAt'){var _0x48b523=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8a')];var _0x270121=JSON[_0xe896('0x89')](_0x4c05ce[_0xe896('0x4c')][_0x234a3a])[_0xe896('0x8b')];_0x2a23a2['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x48b523,_0x270121);}else{if(_0x4c05ce[_0xe896('0x4c')][_0x234a3a]==='null'){_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20IS\x20NULL');}else{_0x2a23a2[_0xe896('0x56')]('i.'+_0x234a3a+'\x20=\x20?',_0x4c05ce[_0xe896('0x4c')][_0x234a3a]);}}});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8c')]==0x1){_0x2a23a2['having'](_0xe896('0x8d'));}else{_0x2a23a2[_0xe896('0x71')](_0xe896('0x8e'));}}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]){_0x28396c=_[_0xe896('0x90')](_0x4c05ce[_0xe896('0x4c')]['tag'])?_0x4c05ce[_0xe896('0x4c')]['tag']:new Array(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x8f')]);_0x28396c[_0xe896('0x43')](function(_0x503131){_0x57ed84['or'](_0xe896('0x7e'),'%,'+_0x503131+',%');});}if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')]){var _0x1913b2=_0x4c05ce[_0xe896('0x4c')][_0xe896('0x91')][_0xe896('0x92')]('\x5c','\x5c\x5c')[_0xe896('0x92')](/'/g,'\x27\x27');if(qs[_0xe896('0x93')](_0x1913b2)){_0x50c910['or'](_0xe896('0x94'),_0x1913b2+'%');}else{_0x50c910['or'](_0xe896('0x95'),qs['getFullTextValue'](_0x1913b2))['or'](_0xe896('0x96'),_0x1913b2+'%');}}}_0x2a23a2[_0xe896('0x56')](_0x50c910);_0x2a23a2[_0xe896('0x97')](_0xe896('0x98'));var _0x48885e={'type':db[_0xe896('0x99')][_0xe896('0x9a')][_0xe896('0x9b')],'raw':!![]};var _0x779db6=_0x2a23a2[_0xe896('0x9c')]();_0x779db6[_0xe896('0x58')](_0xe896('0x98'));_0x779db6[_0xe896('0x58')](_0xe896('0x9d'),_0xe896('0x9e'));if(_0x22c628[_0xe896('0x54')]){_0x22c628[_0xe896('0x54')]['forEach'](function(_0x2bd061){var _0x1d1364=_0x2bd061[0x0]===_0xe896('0x9f')?_0x2bd061[0x0]:'i.'+_0x2bd061[0x0];_0x2a23a2['order'](_0x1d1364,_0x2bd061[0x1]===_0xe896('0xa0')?![]:!![]);});}if(!_['isEmpty'](_0x28396c)){_0x2a23a2['having'](_0x57ed84);_0x779db6[_0xe896('0x56')](_0xe896('0xa1'),_0x28396c);}BPromise[_0xe896('0xa2')]()['then'](function(){if(!_0x5d6c1c){if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return;_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa3'));return;}if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]!==_0xe896('0xa6'))return;return _0x4c05ce[_0xe896('0xa4')][_0xe896('0xa7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x544d2d){if(_[_0xe896('0xa8')](_0x544d2d)){_0x779db6['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x2a23a2[_0xe896('0x56')](_0xe896('0xa9'));}else{_0x779db6[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));_0x2a23a2[_0xe896('0x56')](_0xe896('0x87'),_['map'](_0x544d2d,'id'));}});})[_0xe896('0x23')](function(){if(_0x4c05ce[_0xe896('0xa4')][_0xe896('0xa5')]===_0xe896('0xa6')&&!_0x5d6c1c&&!_0x4c05ce[_0xe896('0x4c')][_0xe896('0x86')])return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x779db6[_0xe896('0xab')](),_0x48885e);})[_0xe896('0x23')](function(_0x16ff5e){_0x16927a[_0xe896('0x33')]=_0x16ff5e[_0xe896('0x51')];if(_0x16927a['count']===0x0)return[];return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x20fe4f[_0xe896('0xab')](),_0x48885e)[_0xe896('0x23')](function(_0x229150){_0x388375=_[_0xe896('0xac')](_0x229150,'id');_0x48885e=_[_0xe896('0x3b')](_0x48885e,{'model':db[_0xe896('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c05ce[_0xe896('0x4c')][_0xe896('0x4f')]){_0x22c628['attributes']['forEach'](function(_0x41e6c4){_0x2a23a2[_0xe896('0x58')]('i.'+_0x41e6c4);});}else{_0x2a23a2[_0xe896('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe896('0x9e'));_0x2a23a2[_0xe896('0x58')]('a.key',_0xe896('0xad'));_0x2a23a2[_0xe896('0x58')]('a.mandatoryDisposition',_0xe896('0xae'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xaf'),_0xe896('0x9f'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb0'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb1'),'Contact.firstName');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb2'),_0xe896('0xb3'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb4'),'Contact.email');_0x2a23a2[_0xe896('0x58')](_0xe896('0xb5'),_0xe896('0xb6'));_0x2a23a2['field'](_0xe896('0xb7'),_0xe896('0xb8'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xb9'),_0xe896('0xba'));_0x2a23a2[_0xe896('0x58')](_0xe896('0xbb'),_0xe896('0xbc'));_0x2a23a2[_0xe896('0x58')]('o.internal',_0xe896('0xbd'));_0x2a23a2['field'](_0xe896('0xbe'),_0xe896('0x40'));}if(_0x22c628[_0xe896('0x53')])_0x2a23a2[_0xe896('0x53')](_0x22c628['limit']);if(_0x22c628[_0xe896('0x34')])_0x2a23a2[_0xe896('0x34')](_0x22c628['offset']);return db[_0xe896('0xaa')][_0xe896('0x4c')](_0x2a23a2[_0xe896('0xab')](),_0x48885e);})['then'](function(_0xadc81f){if(_0xadc81f['length']>0x0)_0x1d18f6['where'](_0xe896('0xbf'),_[_0xe896('0x46')](_0xadc81f,'id'));return db['sequelize'][_0xe896('0x4c')](_0x1d18f6[_0xe896('0xab')](),_0x48885e)['then'](function(_0x529df2){var _0x5b4e01=_['groupBy'](_0x529df2,_0xe896('0xc0'));var _0x237cae=[];_0xadc81f[_0xe896('0x43')](function(_0xc0fa84){_0x237cae[_0xe896('0x44')](updateChatInteraction(_0xc0fa84,_0x388375,_0x5b4e01));});return BPromise[_0xe896('0xc1')](_0x237cae);});});})[_0xe896('0x23')](function(_0x2dbfd3){_0x16927a['rows']=_0x2dbfd3;return _0x16927a;})[_0xe896('0x23')](respondWithFilteredResult(_0x489254,_0x22c628))[_0xe896('0x45')](handleError(_0x489254,null));};exports[_0xe896('0xc2')]=function(_0x2a1d41,_0x5a254b){var _0x4f4d26={'raw':![],'where':{'id':_0x2a1d41[_0xe896('0xc3')]['id']}},_0x2f30a9={};_0x2f30a9['model']=_['keys'](db[_0xe896('0x47')][_0xe896('0xc4')]);_0x2f30a9[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x2a1d41[_0xe896('0x4c')]);_0x2f30a9['filters']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],_0x2f30a9[_0xe896('0x4c')]);_0x4f4d26['attributes']=_[_0xe896('0x4e')](_0x2f30a9[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x2a1d41[_0xe896('0x4c')][_0xe896('0x4f')]));_0x4f4d26['attributes']=_0x4f4d26[_0xe896('0x50')][_0xe896('0x51')]?_0x4f4d26[_0xe896('0x50')]:_0x2f30a9['model'];if(_0x2a1d41[_0xe896('0x4c')]['includeAll']){_0x4f4d26[_0xe896('0xc5')]=[{'all':!![]}];}_0x4f4d26=_[_0xe896('0x3b')]({},_0x4f4d26,_0x2a1d41[_0xe896('0xc6')]);return db[_0xe896('0x47')][_0xe896('0x6f')](_0x4f4d26)[_0xe896('0x23')](handleEntityNotFound(_0x5a254b,null))['then'](respondWithResult(_0x5a254b,null))['catch'](handleError(_0x5a254b,null));};exports[_0xe896('0xc7')]=function(_0x54c61f,_0x15af0e){return db[_0xe896('0x47')]['create'](_0x54c61f[_0xe896('0x3c')],{})[_0xe896('0x23')](respondWithResult(_0x15af0e,0xc9))['catch'](handleError(_0x15af0e,null));};exports[_0xe896('0xc8')]=function(_0x4bcd8c,_0x326c67){if(_0x4bcd8c[_0xe896('0x3c')]['id']){delete _0x4bcd8c[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')]['find']({'where':{'id':_0x4bcd8c[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x326c67,null))[_0xe896('0x23')](saveUpdates(_0x4bcd8c[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x326c67,null))[_0xe896('0x45')](handleError(_0x326c67,null));};exports[_0xe896('0xc9')]=function(_0x3c8951,_0x41b162){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x3c8951[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x41b162,null))[_0xe896('0x23')](removeEntity(_0x41b162,null))[_0xe896('0x45')](handleError(_0x41b162,null));};exports[_0xe896('0xca')]=function(_0x16b398,_0x4edeaf){return db[_0xe896('0x47')][_0xe896('0xca')]()['then'](respondWithResult(_0x4edeaf,null))['catch'](handleError(_0x4edeaf,null));};exports[_0xe896('0xcb')]=function(_0xdd4767,_0x3df01d){var _0xf6563d=_0xdd4767[_0xe896('0xc3')]['id'];var _0x21e7a2;var _0x43b9e0;var _0x46a4f0;return db['ChatInteraction'][_0xe896('0xcc')]({'where':{'id':_0xf6563d}})[_0xe896('0x23')](function(_0x2ee264){_0x21e7a2=_0x2ee264;return db[_0xe896('0xcd')]['findOne']({'where':{'id':_0x2ee264[_0xe896('0x86')]},'attributes':['id','vidaooApiKey','vidaooEscalation',_0xe896('0xce'),_0xe896('0xcf'),_0xe896('0xd0')],'raw':!![]});})[_0xe896('0x23')](function(_0x3e55b7){if(_0x3e55b7&&_0x3e55b7[_0xe896('0xd1')]&&_0x3e55b7[_0xe896('0xd2')]){_0x43b9e0=_0x3e55b7;var _0x49293e={'interaction':{'id':_0xf6563d},'agent':{'id':_0xdd4767[_0xe896('0xa4')]['id'],'name':_0xdd4767[_0xe896('0xa4')][_0xe896('0x39')],'fullname':_0xdd4767[_0xe896('0xa4')][_0xe896('0x3f')],'email':_0xdd4767[_0xe896('0xa4')][_0xe896('0xd3')]},'contact':_0xdd4767[_0xe896('0x3c')][_0xe896('0x3d')],'account':_0xdd4767['body'][_0xe896('0x3e')]};var _0x13c2fb={'rejectUnauthorized':![],'method':'POST','url':_0xe896('0xd4'),'headers':{'X-APIKEY':_0x3e55b7['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0xdd4767['user'][_0xe896('0xd3')]],'buttons':null,'topic':_0x43b9e0['vidaooTopic'],'note':_['isNull'](_0x43b9e0[_0xe896('0xcf')])?null:getMustacheRender(_0x43b9e0[_0xe896('0xcf')],_0x49293e),'metadata':null},'redirect':_0xe896('0xd5'),'json':!![]};try{if(!_['isNull'](_0x43b9e0[_0xe896('0xd0')])){var _0x55be9b=getMustacheRender(_0x43b9e0[_0xe896('0xd0')],_0x49293e);var _0x1406c2=JSON['parse'](_0x55be9b);_0x13c2fb[_0xe896('0x3c')][_0xe896('0xd6')]=_0x1406c2;}}catch(_0x53cebb){throw new db[(_0xe896('0x99'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x13c2fb);}else{throw new db['Sequelize'][(_0xe896('0xd7'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xe896('0x23')](function(_0x30c8f4){_0x46a4f0=_0x30c8f4;if(_0x46a4f0['id']){var _0x386f5a={'body':_0x46a4f0[_0xe896('0xd8')],'ChatWebsiteId':_0x43b9e0['id'],'ChatInteractionId':_0x21e7a2['id'],'direction':'out','UserId':_0xdd4767[_0xe896('0xa4')]['id']};return db[_0xe896('0xd9')][_0xe896('0xc7')](_0x386f5a,{});}else{throw new db[(_0xe896('0x99'))]['ValidationError'](_0xe896('0xda'));}})['then'](function(){return _0x21e7a2[_0xe896('0xdb')]({'vidaooSessionId':_0x46a4f0['id']});})[_0xe896('0x23')](respondWithResult(_0x3df01d,null))[_0xe896('0x45')](handleError(_0x3df01d,null));};exports[_0xe896('0xdc')]=function(_0x5a5336,_0x42ab19){if(_0x5a5336['body']['id']){delete _0x5a5336[_0xe896('0x3c')]['id'];}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x5a5336[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xdd')],'as':'Contact'}]})[_0xe896('0x23')](handleEntityNotFound(_0x42ab19,null))['then'](saveUpdates(_0x5a5336[_0xe896('0x3c')],null))[_0xe896('0x23')](respondWithResult(_0x42ab19,null))['catch'](handleError(_0x42ab19,null));};exports[_0xe896('0xde')]=function(_0x384116,_0x5949f1,_0x432775){if(_0x384116[_0xe896('0x3c')]['id']){delete _0x384116[_0xe896('0x3c')]['id'];}return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x384116[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](function(_0x5da1fa){if(!_0x5da1fa){logger[_0xe896('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s','abandon',0x194,_0xe896('0xdf'));_0x5949f1[_0xe896('0x2e')](0x194);}else{if(_0x5da1fa['UserId']){throw new db[(_0xe896('0x99'))][(_0xe896('0xd7'))]('Interaction\x20already\x20assigned');}}return _0x5da1fa;})['then'](function(_0x24c6bc){if(_0x24c6bc){return _0x24c6bc[_0xe896('0xc8')]({'closed':_0x384116['body'][_0xe896('0xe0')],'disposition':_0x384116[_0xe896('0x3c')]['disposition']})[_0xe896('0x23')](function(_0x54219c){return _0x54219c;});}})[_0xe896('0x23')](function(_0x577d5a){return respondWithRpcPromise(_0xe896('0xe1'),_0xe896('0xde'),_0x384116['body'],client9004);})[_0xe896('0x23')](respondWithResult(_0x5949f1,null))[_0xe896('0x45')](handleError(_0x5949f1,null));};exports[_0xe896('0xe2')]=function(_0x32f30e,_0x265206,_0x90a856){_0x32f30e[_0xe896('0x3c')][_0xe896('0x39')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe4')];_0x32f30e[_0xe896('0x3c')][_0xe896('0xe5')]=_0x32f30e[_0xe896('0xe3')][_0xe896('0xe6')];_0x32f30e['body'][_0xe896('0x7c')]=_0x32f30e['file'][_0xe896('0xe7')];return db[_0xe896('0xe8')]['create'](_0x32f30e[_0xe896('0x3c')])[_0xe896('0x23')](respondWithResult(_0x265206,0xc9))[_0xe896('0x45')](handleError(_0x265206,null));};exports['attachmentDownload']=function(_0x28deef,_0x3f32f7,_0x2b1427){return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x28deef[_0xe896('0xc3')]['id']},'raw':!![]})[_0xe896('0x23')](handleEntityNotFound(_0x3f32f7,null))[_0xe896('0x23')](function(_0xdd5dbf){if(_0xdd5dbf){if(_0xdd5dbf['closed']){return _0x3f32f7['status'](0x193)['json']({'status':0x193,'message':_0xe896('0xe9')});}return db['Attachment']['findOne']({'where':{'id':_0x28deef[_0xe896('0x4c')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x3f32f7,null));}})['then'](function(_0x348cd5){if(_0x348cd5){var _0x4a5f7f=_0x348cd5[_0xe896('0xea')]!==null;var _0x222029=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server/files/attachments/');if(_0x4a5f7f){_0x222029=path[_0xe896('0xeb')](_0x222029,_0xe896('0xed'));}var _0x36c394=path[_0xe896('0xeb')](_0x222029,_0x348cd5[_0xe896('0xe5')]);return _0x3f32f7['download'](_0x36c394);}})['catch'](handleError(_0x3f32f7,null));};exports[_0xe896('0xee')]=function(_0x1a5056,_0x57aa1b){var _0x21b078=null;var _0x17edcd=null;var _0x71d912=null;var _0x22a63d=null;if(_0x1a5056[_0xe896('0x3c')]['id']){delete _0x1a5056[_0xe896('0x3c')]['id'];}if(_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')]){_0x22a63d=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0xf0'),util[_0xe896('0xf1')](_0xe896('0xf2'),Date['now']()));_0x1a5056[_0xe896('0x3c')][_0xe896('0xf3')]=_0x22a63d;}return db['ChatInteraction'][_0xe896('0x6f')]({'where':{'id':_0x1a5056[_0xe896('0xc3')]['id']},'include':[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'include':[{'model':db[_0xe896('0x80')],'as':_0xe896('0x80')}]}]})[_0xe896('0x23')](handleEntityNotFound(_0x57aa1b,null))[_0xe896('0x23')](saveUpdates(_0x1a5056[_0xe896('0x3c')],null))[_0xe896('0x23')](function(_0x5487f0){if(_0x5487f0){_0x21b078=_0x5487f0;return db[_0xe896('0xcd')]['find']({'where':{'id':_0x21b078[_0xe896('0x86')]}});}})[_0xe896('0x23')](function(_0xb528ff){if(_0xb528ff){_0x71d912=_0xb528ff;return db[_0xe896('0xdd')][_0xe896('0x6f')]({'where':{'id':_0x21b078[_0xe896('0x7a')]}});}})[_0xe896('0x23')](function(_0x6e53ae){if(_0x6e53ae){_0x17edcd=_0x6e53ae;if(_0x22a63d){var _0x52337e=null;for(var _0x1d6003=0x1;_0x1d6003<_0x21b078[_0xe896('0xf4')][_0xe896('0x51')];++_0x1d6003){_0x52337e=_0x21b078[_0xe896('0xf4')][_0x1d6003];var _0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912['agentAlias'],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');var _0x27743a=_0x1a5056['body']['customer']||util[_0xe896('0xf1')](_0xe896('0xf5'),_0xe896('0xf7'),_0x52337e['ContactId']);switch(_0x71d912['agentIdentifier']){case _0xe896('0xf8'):_0x882a0e=_0x52337e[_0xe896('0x82')]?util['format'](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');break;case _0xe896('0xfa'):_0x882a0e=_0x52337e[_0xe896('0x82')]?_0x52337e['User'][_0xe896('0xfb')]||_0x52337e[_0xe896('0x80')]['fullname']:_0xe896('0xf6');break;case _0xe896('0xfc'):_0x882a0e=_0x52337e['UserId']?_0x52337e['User']['fullname']:'System';break;default:_0x882a0e=_0x52337e[_0xe896('0x82')]?util[_0xe896('0xf1')](_0xe896('0xf5'),_0x71d912[_0xe896('0xf9')],_0x52337e[_0xe896('0x82')]):_0xe896('0xf6');}var _0x58fcf9=util[_0xe896('0xf1')]('[%s]\x20%s:\x20%s\x0a',moment(_0x52337e[_0xe896('0xfd')])['format'](_0xe896('0xfe')),_0x52337e[_0xe896('0xff')]==='in'?_0x27743a:_0x882a0e,_0x52337e['body']);if(!_0x52337e['secret']){fs[_0xe896('0x100')](_0x22a63d,_0x58fcf9);}}return db[_0xe896('0x101')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xe896('0x102'),'raw':!![]}]});}}})[_0xe896('0x23')](function(_0xbee8fa){if(_0xbee8fa&&_0xbee8fa[_0xe896('0x102')]&&_0x1a5056[_0xe896('0x3c')]){var _0x1a50c3={'tls':{'rejectUnauthorized':![]}};if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')]){_0x1a50c3[_0xe896('0x103')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x103')];}else{_0x1a50c3[_0xe896('0x104')]=_0xbee8fa[_0xe896('0x102')]['host'];_0x1a50c3['port']=_0xbee8fa[_0xe896('0x102')][_0xe896('0x105')];_0x1a50c3[_0xe896('0x106')]=_0xbee8fa[_0xe896('0x102')][_0xe896('0x106')];}if(_0xbee8fa[_0xe896('0x102')][_0xe896('0x107')]){_0x1a50c3[_0xe896('0x108')]={'user':_0xbee8fa[_0xe896('0x102')][_0xe896('0xa4')],'pass':_0xbee8fa[_0xe896('0x102')][_0xe896('0x109')]};}return respondWithRpcPromise(_0xe896('0x10a'),_0xe896('0x10b'),{'account':_0x1a50c3,'message':{'from':util[_0xe896('0xf1')](_0xe896('0x10c'),_0xbee8fa['name'],_0xbee8fa['email']||_0xbee8fa['Smtp'][_0xe896('0xa4')]),'to':_0x1a5056[_0xe896('0x3c')][_0xe896('0xef')],'subject':_0xe896('0x10d'),'text':util[_0xe896('0xf1')](_0xe896('0x10e'),_0x1a5056[_0xe896('0x3c')]['mailTranscript']),'attachments':[{'path':_0x22a63d}]}})['then'](function(){return _0x21b078;})[_0xe896('0x45')](function(_0x550c55){console['error'](_0x550c55);});}else{return _0x21b078;}})['then'](respondWithStatusCode(_0x57aa1b,0xc8))[_0xe896('0x45')](handleError(_0x57aa1b,null));};exports[_0xe896('0x10f')]=function(_0x14da55,_0x5656d0,_0x31ca0b){return db[_0xe896('0xd9')][_0xe896('0x6f')]({'where':{'id':_0x14da55[_0xe896('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5656d0,null))['then'](function(_0x518847){if(_0x518847){return _0x518847[_0xe896('0x10f')](_0x14da55[_0xe896('0x3c')]['ids'],_[_0xe896('0x110')](_0x14da55[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{});}})[_0xe896('0x23')](respondWithResult(_0x5656d0,null))['catch'](handleError(_0x5656d0,null));};exports[_0xe896('0x112')]=function(_0xf78ce2,_0x3f8ea0,_0x254420){var _0x1196d4={'raw':![],'where':{}};var _0x1ee26e={};var _0x1bd649={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0xf78ce2[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f8ea0,null))[_0xe896('0x23')](function(_0x2e5c38){if(_0x2e5c38){_0x1ee26e[_0xe896('0x4a')]=_['keys'](db[_0xe896('0xd9')]['rawAttributes']);_0x1ee26e[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0xf78ce2['query']);_0x1ee26e['filters']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],_0x1ee26e[_0xe896('0x4c')]);_0x1196d4['attributes']=_[_0xe896('0x4e')](_0x1ee26e[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0xf78ce2['query'][_0xe896('0x4f')]));_0x1196d4[_0xe896('0x50')]=_0x1196d4[_0xe896('0x50')]['length']?_0x1196d4['attributes']:_0x1ee26e[_0xe896('0x4a')];if(!_0xf78ce2['query'][_0xe896('0x113')](_0xe896('0x52'))){_0x1196d4[_0xe896('0x53')]=qs[_0xe896('0x53')](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x53')]);_0x1196d4[_0xe896('0x34')]=qs['offset'](_0xf78ce2['query'][_0xe896('0x34')]);}_0x1196d4[_0xe896('0x54')]=qs['sort'](_0xf78ce2[_0xe896('0x4c')][_0xe896('0x55')]);_0x1196d4['where']=qs['filters'](_['pick'](_0xf78ce2['query'],_0x1ee26e['filters']));_0x1196d4['where'][_0xe896('0xc0')]=_0x2e5c38['id'];if(_0xf78ce2['query'][_0xe896('0x91')]){_0x1196d4[_0xe896('0x56')]=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],{'$or':_['map'](_0x1196d4[_0xe896('0x50')],function(_0x646354){var _0x3d751c={};_0x3d751c[_0x646354]={'$like':'%'+_0xf78ce2['query'][_0xe896('0x91')]+'%'};return _0x3d751c;})});}if(_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')]){var _0x42bf84=_0xf78ce2[_0xe896('0x4c')][_0xe896('0x8a')][_0xe896('0x42')](',');var _0x115450={};_0x115450[_0x42bf84[0x0]]={'$gte':moment(_0x42bf84[0x1])[_0xe896('0xf1')](_0xe896('0x114'))};_0x1196d4['where']=_[_0xe896('0x3b')](_0x1196d4[_0xe896('0x56')],_0x115450);}_0x1196d4=_[_0xe896('0x3b')]({},_0x1196d4,_0xf78ce2[_0xe896('0xc6')]);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x1196d4[_0xe896('0x56')]})[_0xe896('0x23')](function(_0x3bee56){_0x1bd649[_0xe896('0x33')]=_0x3bee56;if(_0xf78ce2[_0xe896('0x4c')]['includeAll']){_0x1196d4['include']=[{'all':!![]}];}return db[_0xe896('0xd9')]['findAll'](_0x1196d4);})['then'](function(_0x1d3083){_0x1bd649[_0xe896('0x115')]=_0x1d3083;return _0x1bd649;});}})[_0xe896('0x23')](respondWithFilteredResult(_0x3f8ea0,_0x1196d4))['catch'](handleError(_0x3f8ea0,null));};exports[_0xe896('0x116')]=function(_0x4ddfde,_0xc1bdcf,_0xdea91f){var _0x5c2af6={'where':{}},_0x306757={},_0x31f4e1={'count':0x0,'rows':[]};return db[_0xe896('0x47')][_0xe896('0xcc')]({'where':{'id':_0x4ddfde['params']['id']}})[_0xe896('0x23')](handleEntityNotFound(_0xc1bdcf,null))['then'](function(_0x186b58){if(_0x186b58){_0x306757[_0xe896('0x4a')]=_[_0xe896('0x4b')](db['ChatMessage']['rawAttributes']);_0x306757[_0xe896('0x4c')]=_[_0xe896('0x4b')](_0x4ddfde[_0xe896('0x4c')]);_0x306757[_0xe896('0x4d')]=_[_0xe896('0x4e')](_0x306757[_0xe896('0x4a')],_0x306757[_0xe896('0x4c')]);_0x5c2af6[_0xe896('0x50')]=_['intersection'](_0x306757[_0xe896('0x4a')],qs[_0xe896('0x4f')](_0x4ddfde['query'][_0xe896('0x4f')]));_0x5c2af6['attributes']=_0x5c2af6['attributes'][_0xe896('0x51')]?_0x5c2af6[_0xe896('0x50')]:_0x306757[_0xe896('0x4a')];if(!_0x4ddfde[_0xe896('0x4c')][_0xe896('0x113')]('nolimit')){_0x5c2af6[_0xe896('0x53')]=qs[_0xe896('0x53')](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x53')]);_0x5c2af6[_0xe896('0x34')]=qs['offset'](_0x4ddfde[_0xe896('0x4c')][_0xe896('0x34')]);}_0x5c2af6[_0xe896('0x54')]=qs[_0xe896('0x55')](_0x4ddfde['query'][_0xe896('0x55')]);_0x5c2af6[_0xe896('0x56')]=qs[_0xe896('0x4d')](_[_0xe896('0x57')](_0x4ddfde['query'],_0x306757[_0xe896('0x4d')]));_0x5c2af6[_0xe896('0x56')][_0xe896('0xc0')]=_0x186b58['id'];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]){_0x5c2af6['where']=_[_0xe896('0x3b')](_0x5c2af6[_0xe896('0x56')],{'$or':_['map'](_0x5c2af6['attributes'],function(_0x42490d){var _0x2dba2f={};_0x2dba2f[_0x42490d]={'$like':'%'+_0x4ddfde[_0xe896('0x4c')][_0xe896('0x91')]+'%'};return _0x2dba2f;})});}_0x5c2af6['where'][_0xe896('0x117')]=![];if(_0x4ddfde[_0xe896('0x4c')]['id']){_0x5c2af6[_0xe896('0x56')]['id']={'$gt':_0x4ddfde[_0xe896('0x4c')]['id']};}_0x5c2af6=_['merge']({},_0x5c2af6,_0x4ddfde['options']);return db['ChatMessage'][_0xe896('0x33')]({'where':_0x5c2af6[_0xe896('0x56')]})[_0xe896('0x23')](function(_0xabf68b){_0x31f4e1[_0xe896('0x33')]=_0xabf68b;_0x5c2af6['include']=[];if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x118')]){_0x5c2af6['include'][_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id','fullname',_0xe896('0xfb')]});}if(_0x4ddfde[_0xe896('0x4c')][_0xe896('0x119')]){_0x5c2af6[_0xe896('0xc5')]=[{'all':!![]}];}return db[_0xe896('0xd9')][_0xe896('0x11a')](_0x5c2af6);})['then'](function(_0xbf5fec){_0x31f4e1[_0xe896('0x115')]=_0xbf5fec;return _0x31f4e1;});}})['then'](respondWithFilteredResult(_0xc1bdcf,_0x5c2af6))[_0xe896('0x45')](handleError(_0xc1bdcf,null));};exports[_0xe896('0x11b')]=function(_0x50e9f6,_0x3f7f9b,_0x45fbfd){return db['ChatInteraction']['find']({'where':{'id':_0x50e9f6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x3f7f9b,null))['then'](function(_0xd7222b){if(_0xd7222b){return _0xd7222b[_0xe896('0x11c')](_0x50e9f6['body'][_0xe896('0x111')],_[_0xe896('0x110')](_0x50e9f6[_0xe896('0x3c')],[_0xe896('0x111'),'id'])||{})[_0xe896('0x11d')](function(){return db[_0xe896('0x11e')][_0xe896('0x11a')]({'attributes':['id',_0xe896('0x39'),_0xe896('0x59')],'where':{'id':_0x50e9f6[_0xe896('0x3c')]['ids']}});})[_0xe896('0x23')](function(_0x4b7dda){socket['emit'](_0xe896('0x11f'),{'id':Number(_0x50e9f6[_0xe896('0xc3')]['id']),'tags':_0x4b7dda||[]});return{'id':Number(_0x50e9f6['params']['id']),'tags':_0x4b7dda||[]};});}})['then'](respondWithResult(_0x3f7f9b,null))[_0xe896('0x45')](handleError(_0x3f7f9b,null));};exports[_0xe896('0x120')]=function(_0x40efd6,_0x513fbe,_0x17b841){return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x40efd6[_0xe896('0xc3')]['id']}})[_0xe896('0x23')](handleEntityNotFound(_0x513fbe,null))['then'](function(_0x704996){if(_0x704996){return _0x704996[_0xe896('0x120')](_0x40efd6[_0xe896('0x4c')]['ids']);}})[_0xe896('0x23')](respondWithStatusCode(_0x513fbe,null))[_0xe896('0x45')](handleError(_0x513fbe,null));};exports[_0xe896('0x121')]=function(_0x99a090,_0x15c4f9){var _0x4b1785=moment()['unix']()[_0xe896('0xab')]();var _0x5bc230=path[_0xe896('0xeb')](config[_0xe896('0xec')],_0xe896('0x122'),_0xe896('0x123'),'tmp');var _0x2d2654=path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x123'),_0xe896('0x124'));var _0x5bbc65=path[_0xe896('0xeb')](_0x5bc230,_0x4b1785);var _0x194003=util[_0xe896('0xf1')](_0xe896('0x125'),_0x99a090[_0xe896('0xc3')]['id'],_0x4b1785);var _0x2a3489=path[_0xe896('0xeb')](_0x5bc230,_0x194003);var _0x54df80=[];_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x80'),'attributes':['id',_0xe896('0x3f')],'raw':!![]});_0x54df80[_0xe896('0x44')]({'model':db[_0xe896('0xdd')],'as':_0xe896('0x74'),'attributes':['id',_0xe896('0x126'),'lastName'],'raw':!![]});if(_0x99a090[_0xe896('0x4c')][_0xe896('0x124')]){_0x54df80[_0xe896('0x44')]({'model':db['Attachment'],'as':_0xe896('0xe8'),'raw':!![]});}var _0x2279c9=[{'model':db[_0xe896('0xd9')],'as':_0xe896('0xf4'),'attributes':['id','body',_0xe896('0xfd'),_0xe896('0xff'),_0xe896('0x117'),_0xe896('0x8c')],'include':_0x54df80}];_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0xcd')],'as':_0xe896('0x127'),'attributes':['id',_0xe896('0x39')]});_0x2279c9[_0xe896('0x44')]({'model':db[_0xe896('0x80')],'as':_0xe896('0x128'),'attributes':['id',_0xe896('0x3f')]});return db[_0xe896('0x47')][_0xe896('0x6f')]({'where':{'id':_0x99a090[_0xe896('0xc3')]['id']},'include':_0x2279c9})['then'](handleEntityNotFound(_0x15c4f9,null))['then'](function(_0x5cd4ff){if(_0x5cd4ff){var _0x81d8be=_0x5cd4ff[_0xe896('0x129')]({'plain':!![]});fs[_0xe896('0x12a')](_0x5bbc65);var _0x132625={'channel':_0xe896('0x12b'),'account':_0x81d8be[_0xe896('0x127')][_0xe896('0x39')],'agent':_0x81d8be[_0xe896('0x128')]?_0x81d8be[_0xe896('0x128')][_0xe896('0x3f')]:'N.A.','createdAt':moment(_0x81d8be[_0xe896('0xfd')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')](),'closedAt':_0x81d8be[_0xe896('0xe0')]?moment(_0x81d8be[_0xe896('0x12c')])[_0xe896('0xf1')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe896('0xab')]():'','disposition':_0x81d8be[_0xe896('0x12d')],'chatInfo':{'browser':_0x81d8be['browserName'],'os':_0x81d8be[_0xe896('0x12e')],'referer':_0x81d8be[_0xe896('0x12f')],'customerIp':_0x81d8be[_0xe896('0x130')],'customerPort':_0x81d8be[_0xe896('0x131')]?_0x81d8be['customerPort']:_0xe896('0x132')},'messages':_(_0x81d8be['Messages'])[_0xe896('0x133')]()[_0xe896('0x91')]({'secret':![]})[_0xe896('0x46')](function(_0x374e2f){if(_0x374e2f[_0xe896('0xe8')]){var _0x328e2b=path['join'](_0x2d2654,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]);if(fs[_0xe896('0x134')](_0x328e2b)){fs[_0xe896('0x135')](_0x328e2b)['pipe'](fs[_0xe896('0x136')](path[_0xe896('0xeb')](_0x5bbc65,_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')])));}}return{'date':moment(_0x374e2f['createdAt'])[_0xe896('0xf1')](_0xe896('0x114'))[_0xe896('0xab')](),'sender':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?_0x374e2f[_0xe896('0x80')]?_0x374e2f[_0xe896('0x80')][_0xe896('0x3f')]:'System':_0x374e2f['Contact'][_0xe896('0x126')]+(_0x374e2f[_0xe896('0x74')][_0xe896('0x138')]?'\x20'+_0x374e2f[_0xe896('0x74')]['lastName']:''),'body':_0x374e2f[_0xe896('0xe8')]?_0x374e2f[_0xe896('0xe8')][_0xe896('0xe5')]:_0x374e2f[_0xe896('0x3c')],'direction':_0x374e2f[_0xe896('0xff')]===_0xe896('0x137')?'A':'C','secret':_0x374e2f[_0xe896('0x117')],'read':_0x374e2f['read'],'attachment':_0x374e2f[_0xe896('0xe8')]};})[_0xe896('0x70')]()};return ejs[_0xe896('0x139')](path[_0xe896('0xeb')](config[_0xe896('0xec')],'server',_0xe896('0x13a'),'downloadInteraction.ejs'),{'interaction':_0x132625})[_0xe896('0x23')](function(_0x50d56b){var _0x5d05a4=path[_0xe896('0xeb')](_0x5bbc65,_0xe896('0x13b')+_0x81d8be['id']+'-'+_0x4b1785+_0xe896('0x13c'));var _0x9223f={'path':_0x5d05a4,'channel':_0xe896('0x12b'),'interactionId':_0x81d8be['id']};return pdf[_0xe896('0x13d')](_0x50d56b,_0x9223f);})[_0xe896('0x23')](function(){return new BPromise(function(_0x399827,_0x2a2fa5){zipdir(_0x5bbc65,{'saveTo':_0x2a3489},function(_0x21d235,_0x3d7f5f){if(_0x21d235)return _0x2a2fa5(_0x21d235);return _0x399827(_0x3d7f5f);});})[_0xe896('0x23')](function(){return new BPromise(function(_0x313eb0,_0x54a741){rimraf(_0x5bbc65,function(_0x3edee9){if(_0x3edee9)_0x54a741(_0x3edee9);return _0x313eb0();});});})[_0xe896('0x23')](function(){return _0x15c4f9['download'](_0x2a3489,_0x194003,function(_0x42163c){if(_0x42163c){console[_0xe896('0x13e')]('err',_0x42163c);}else{fs[_0xe896('0x13f')](_0x2a3489);}});});});}else{return _0x15c4f9[_0xe896('0x2e')](0xc8);}})[_0xe896('0x45')](handleError(_0x15c4f9,null));}; \ No newline at end of file +var _0x14a0=['t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','toString','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ChatInteractionId','rows','show','params','intersection','includeAll','include','options','create','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','customUpdate','CmContact','Contact','abandon','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','server/files/chat/upload/','transcript-%s.txt','now','ChatMessage','Messages','format','agentAlias','System','customer','agentIdentifier','%s%d','agent_alias','alias','agent_fullname','createdAt','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','addTags','omit','spread','chatInteractionTags:save','removeTags','files','server','attachments','firstName','lastName','Account','get','Chat','Owner','N.A.','closedAt','osName','referer','customerPort','existsSync','createReadStream','pipe','out','views','transcript-','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','merge','contact','agent','interaction','account','Users','map','fullname','Tags','TagIds','split','forEach','push','ChatInteraction','rawAttributes','type','key','model','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','select','color','tools_tags','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','chat_websites','a.id\x20=\x20i.ChatWebsiteId','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','length','getFullTextValue','ContactId','buildExpression','text','start','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','isEmpty','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','DESC'];(function(_0x24875d,_0x4fb24d){var _0x181471=function(_0x4ecd6d){while(--_0x4ecd6d){_0x24875d['push'](_0x24875d['shift']());}};_0x181471(++_0x4fb24d);}(_0x14a0,0x8e));var _0x014a=function(_0x541399,_0x16175c){_0x541399=_0x541399-0x0;var _0x3f98b9=_0x14a0[_0x541399];return _0x3f98b9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x014a('0x0'));var zipdir=require(_0x014a('0x1'));var jsonpatch=require(_0x014a('0x2'));var rp=require(_0x014a('0x3'));var moment=require(_0x014a('0x4'));var BPromise=require(_0x014a('0x5'));var Mustache=require(_0x014a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x014a('0x7'));var csv=require(_0x014a('0x8'));var ejs=require(_0x014a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x014a('0xf'));var logger=require(_0x014a('0x10'))('api');var utils=require(_0x014a('0x11'));var config=require(_0x014a('0x12'));var licenseUtil=require(_0x014a('0x13'));var db=require(_0x014a('0x14'))['db'];config[_0x014a('0x15')]=_[_0x014a('0x16')](config[_0x014a('0x15')],{'host':_0x014a('0x17'),'port':0x18eb});var socket=require(_0x014a('0x18'))(new Redis(config[_0x014a('0x15')]));require(_0x014a('0x19'))[_0x014a('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x014a('0x1b')][_0x014a('0x1c')]({'port':0x232b});var client9004=jayson['client'][_0x014a('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x128c46,_0x59a4ea,_0x16e6fc,_0x17e4be){return new BPromise(function(_0x20f148,_0x12da95){var _0x2c26ac=_0x17e4be||client;return _0x2c26ac[_0x014a('0x1d')](_0x128c46,_0x16e6fc)[_0x014a('0x1e')](function(_0x263b07){logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));logger[_0x014a('0x22')](_0x014a('0x23'),_0x59a4ea,_0x014a('0x21'),JSON['stringify'](_0x263b07));if(_0x263b07[_0x014a('0x24')]){if(_0x263b07[_0x014a('0x24')][_0x014a('0x25')]===0x1f4){logger[_0x014a('0x24')](_0x014a('0x20'),_0x59a4ea,_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);return _0x12da95(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}logger['error'](_0x014a('0x20'),_0x59a4ea,_0x263b07['error'][_0x014a('0x26')]);return _0x20f148(_0x263b07[_0x014a('0x24')][_0x014a('0x26')]);}else{logger[_0x014a('0x1f')](_0x014a('0x20'),_0x59a4ea,_0x014a('0x21'));_0x20f148(_0x263b07[_0x014a('0x27')][_0x014a('0x26')]);}})[_0x014a('0x28')](function(_0x4c2627){logger[_0x014a('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x59a4ea,_0x4c2627);_0x12da95(_0x4c2627);});});}function respondWithStatusCode(_0x39a432,_0x28701e){_0x28701e=_0x28701e||0xcc;return function(_0x4f1c44){if(_0x4f1c44){return _0x39a432['sendStatus'](_0x28701e);}return _0x39a432[_0x014a('0x29')](_0x28701e)[_0x014a('0x2a')]();};}function respondWithResult(_0x143346,_0x5ed71b){_0x5ed71b=_0x5ed71b||0xc8;return function(_0x183f19){if(_0x183f19){return _0x143346[_0x014a('0x29')](_0x5ed71b)['json'](_0x183f19);}};}function respondWithFilteredResult(_0x31dc95,_0x2560a6){return function(_0x496040){if(_0x496040){var _0x4f9c1c=typeof _0x2560a6[_0x014a('0x2b')]===_0x014a('0x2c')&&typeof _0x2560a6[_0x014a('0x2d')]===_0x014a('0x2c');var _0x4ea00c=_0x496040[_0x014a('0x2e')];var _0x147e7e=_0x4f9c1c?0x0:_0x2560a6[_0x014a('0x2b')];var _0x402d3b=_0x4f9c1c?_0x496040[_0x014a('0x2e')]:_0x2560a6[_0x014a('0x2b')]+_0x2560a6[_0x014a('0x2d')];var _0x1dae8e;if(_0x402d3b>=_0x4ea00c){_0x402d3b=_0x4ea00c;_0x1dae8e=0xc8;}else{_0x1dae8e=0xce;}_0x31dc95[_0x014a('0x29')](_0x1dae8e);return _0x31dc95[_0x014a('0x2f')](_0x014a('0x30'),_0x147e7e+'-'+_0x402d3b+'/'+_0x4ea00c)['json'](_0x496040);}return null;};}function patchUpdates(_0x105d4a){return function(_0x41ead8){try{jsonpatch[_0x014a('0x31')](_0x41ead8,_0x105d4a,!![]);}catch(_0x457883){return BPromise[_0x014a('0x32')](_0x457883);}return _0x41ead8[_0x014a('0x33')]();};}function saveUpdates(_0x211d18,_0x4dd025){return function(_0x116a24){if(_0x116a24){return _0x116a24[_0x014a('0x34')](_0x211d18)['then'](function(_0x415f83){return _0x415f83;});}return null;};}function removeEntity(_0x12de94,_0x40738f){return function(_0x467032){if(_0x467032){return _0x467032[_0x014a('0x35')]()[_0x014a('0x1e')](function(){_0x12de94[_0x014a('0x29')](0xcc)[_0x014a('0x2a')]();});}};}function handleEntityNotFound(_0x5e37e4,_0x19cee1){return function(_0x1dfe6e){if(!_0x1dfe6e){_0x5e37e4[_0x014a('0x36')](0x194);}return _0x1dfe6e;};}function handleError(_0x1f31c8,_0x5127f3){_0x5127f3=_0x5127f3||0x1f4;return function(_0x427c7a){logger[_0x014a('0x24')](_0x427c7a[_0x014a('0x37')]);if(_0x427c7a[_0x014a('0x38')]){delete _0x427c7a[_0x014a('0x38')];}_0x1f31c8[_0x014a('0x29')](_0x5127f3)[_0x014a('0x39')](_0x427c7a);};}function getMustacheRender(_0x36187b,_0x1ec350){return Mustache['render'](_0x36187b,_[_0x014a('0x3a')](_0x1ec350['body'],{'contact':_0x1ec350[_0x014a('0x3b')],'message':_0x1ec350[_0x014a('0x26')],'agent':_0x1ec350[_0x014a('0x3c')],'interaction':_0x1ec350[_0x014a('0x3d')],'account':_0x1ec350[_0x014a('0x3e')]}))||'';}function getInteractionUsers(_0x55126d,_0x1c6f6f){return new BPromise(function(_0x3f4a61,_0x51dca8){try{if(_0x1c6f6f[_0x55126d['id']]){_0x55126d[_0x014a('0x3f')]=_[_0x014a('0x40')](_0x1c6f6f[_0x55126d['id']],function(_0x3e5ecf){return{'id':_0x3e5ecf['id'],'fullname':_0x3e5ecf[_0x014a('0x41')]};});}}catch(_0x3788d6){_0x51dca8(_0x3788d6);}_0x3f4a61(_0x55126d);});}function getInteractionTags(_0x313eb8,_0x17b1b6){return new BPromise(function(_0x764fbe,_0x2beddc){try{if(_0x313eb8['TagIds']){_0x313eb8[_0x014a('0x42')]=[];_0x313eb8[_0x014a('0x43')][_0x014a('0x44')](',')[_0x014a('0x45')](function(_0x5f1a91){_0x313eb8[_0x014a('0x42')][_0x014a('0x46')](_0x17b1b6[_0x5f1a91]);});}delete _0x313eb8[_0x014a('0x43')];}catch(_0x1355dd){_0x2beddc(_0x1355dd);}_0x764fbe(_0x313eb8);});}function updateChatInteraction(_0x1dc647,_0x430a56,_0x5f2969){return new BPromise(function(_0x361866,_0x2830e1){return getInteractionUsers(_0x1dc647,_0x5f2969)['then'](function(_0xc086b3){return getInteractionTags(_0xc086b3,_0x430a56);})[_0x014a('0x1e')](function(_0x2c45f1){_0x361866(_0x2c45f1);})['catch'](function(_0x5bcf8){_0x2830e1(_0x5bcf8);});});}exports['index']=function(_0x5ab5e8,_0x67b30f){var _0x29c9ca={},_0x5aa496={},_0x1557ad={'count':0x0,'rows':[]};var _0x11c0d5=_[_0x014a('0x40')](db[_0x014a('0x47')][_0x014a('0x48')],function(_0xbaf8c6){return{'name':_0xbaf8c6['fieldName'],'type':_0xbaf8c6[_0x014a('0x49')][_0x014a('0x4a')]};});_0x5aa496[_0x014a('0x4b')]=_['map'](_0x11c0d5,'name');_0x5aa496[_0x014a('0x4c')]=_['keys'](_0x5ab5e8['query']);_0x5aa496[_0x014a('0x4d')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],_0x5aa496[_0x014a('0x4c')]);_0x29c9ca[_0x014a('0x4e')]=_['intersection'](_0x5aa496[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x4f')]));_0x29c9ca[_0x014a('0x4e')]=_0x29c9ca[_0x014a('0x4e')]['length']?_0x29c9ca[_0x014a('0x4e')]:_0x5aa496[_0x014a('0x4b')];if(!_0x5ab5e8['query'][_0x014a('0x50')](_0x014a('0x51'))){_0x29c9ca[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x2d')]);_0x29c9ca[_0x014a('0x2b')]=qs[_0x014a('0x2b')](_0x5ab5e8['query'][_0x014a('0x2b')]);}_0x29c9ca[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x53')]);_0x29c9ca['where']=qs[_0x014a('0x4d')](_['pick'](_0x5ab5e8[_0x014a('0x4c')],_0x5aa496[_0x014a('0x4d')]),_0x11c0d5);var _0x40e02b=[];var _0x479dc0=squel[_0x014a('0x54')]()['field']('id')['field']('name')['field'](_0x014a('0x55'))['from'](_0x014a('0x56'));var _0x5b5318=squel['select']()[_0x014a('0x57')]('u.id')[_0x014a('0x57')](_0x014a('0x58'))[_0x014a('0x57')](_0x014a('0x59'))[_0x014a('0x5a')](_0x014a('0x5b'),'ui')[_0x014a('0x5c')](_0x014a('0x5d'),'u',_0x014a('0x5e'));var _0x3fc9ab=squel['select']()['from'](_0x014a('0x5f'),'i')[_0x014a('0x5c')](_0x014a('0x60'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x014a('0x5d'),'o','o.id\x20=\x20i.UserId')[_0x014a('0x5c')](_0x014a('0x61'),'a',_0x014a('0x62'))[_0x014a('0x5c')]('chat_messages','me',_0x014a('0x63'))[_0x014a('0x5c')](_0x014a('0x64'),'it','it.ChatInteractionId\x20=\x20i.id')[_0x014a('0x5c')]('tools_tags','t',_0x014a('0x65'));var _0x47074f=squel[_0x014a('0x66')]();var _0x24d433=[];var _0xd0334a=squel[_0x014a('0x66')]();var _0x4e9260;if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x67')]){_0x4e9260=as[_0x014a('0x68')](_0x5ab5e8['query'][_0x014a('0x67')]);var _0x17f9d7=_0x4e9260[_0x014a('0x69')];for(var _0xa4fd8d=0x0;_0xa4fd8d<_0x4e9260[_0x014a('0x6a')]['length'];_0xa4fd8d++){var _0x8ac9cd=_0x4e9260[_0x014a('0x6a')][_0xa4fd8d];var _0x63c341='i';var _0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x8ac9cd[_0x014a('0x57')]]);if(!_0x37a7b8){switch(_0x8ac9cd[_0x014a('0x57')]){case _0x014a('0x6c'):if(_0x8ac9cd[_0x014a('0x6d')]==0x1){_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd[_0x014a('0x57')]+'`\x20=\x200');}else{_0x3fc9ab[_0x014a('0x6e')]('`'+_0x8ac9cd['field']+'`\x20>\x200');}break;case'Contact':if(_0x8ac9cd['operator']==='$substring'){if(_0x8ac9cd[_0x014a('0x6d')][_0x014a('0x44')]('\x20')[_0x014a('0x6f')]>0x1){_0x47074f[_0x17f9d7]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x014a('0x70')](_0x8ac9cd[_0x014a('0x6d')]),null);}else{var _0x3071c8='%'+_0x8ac9cd[_0x014a('0x6d')]+'%';_0x47074f[_0x17f9d7]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x3071c8,_0x3071c8,_0x3071c8);}}else{_0x37a7b8=_['find'](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x71')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x71');_0x58e087=as[_0x014a('0x72')](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}break;case'Tag':var _0x2d87e3=_0x8ac9cd[_0x014a('0x6d')]['split'](',')[_0x014a('0x40')](function(_0x3e39c9){return Number(_0x3e39c9);});_0x2d87e3['forEach'](function(_0x14f2e2){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x14f2e2+',%');});_0x24d433=_[_0x014a('0x75')](_0x24d433,_0x2d87e3);break;case _0x014a('0x76'):if(_0x8ac9cd[_0x014a('0x77')]===_0x014a('0x78')){_0x47074f[_0x17f9d7](_0x014a('0x79'),'%'+_0x8ac9cd['value']+'%',null);}else{_0x37a7b8=_[_0x014a('0x6b')](_0x11c0d5,[_0x014a('0x38'),_0x014a('0x7a')]);_0x8ac9cd[_0x014a('0x57')]=_0x014a('0x7a');_0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')]['end']);}break;case _0x014a('0x7b'):_0x58e087=as[_0x014a('0x72')]('me',null,_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087[_0x014a('0x73')],_0x58e087[_0x014a('0x6d')][_0x014a('0x74')],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);break;}}else{var _0x58e087=as['buildExpression'](_0x63c341,_0x37a7b8[_0x014a('0x49')],_0x8ac9cd);_0x47074f[_0x17f9d7](_0x58e087['text'],_0x58e087[_0x014a('0x6d')]['start'],_0x58e087[_0x014a('0x6d')][_0x014a('0x2a')]);}}}else{var _0x55bca3=_(_0x5ab5e8['query'])[_0x014a('0x7c')]()[_0x014a('0x40')](function(_0x5f391d){return _[_0x014a('0x7d')](_0x11c0d5,[_0x014a('0x38'),_0x5f391d])?_0x5f391d:undefined;})['compact']()['value']();if(!_[_0x014a('0x7e')](_0x55bca3)){_0x55bca3[_0x014a('0x45')](function(_0x1ee130){if(_0x1ee130===_0x014a('0x7f')){_0x3fc9ab[_0x014a('0x80')](_0x014a('0x81'),[]['concat'](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]));}else if(_0x1ee130==='createdAt'){var _0x5a8351=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])['$gte'];var _0x27e363=JSON[_0x014a('0x82')](_0x5ab5e8[_0x014a('0x4c')][_0x1ee130])[_0x014a('0x83')];_0x3fc9ab[_0x014a('0x80')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a8351,_0x27e363);}else{if(_0x5ab5e8[_0x014a('0x4c')][_0x1ee130]===_0x014a('0x84')){_0x3fc9ab[_0x014a('0x80')]('i.'+_0x1ee130+_0x014a('0x85'));}else{_0x3fc9ab['where']('i.'+_0x1ee130+_0x014a('0x86'),_0x5ab5e8['query'][_0x1ee130]);}}});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x87')]==0x1){_0x3fc9ab[_0x014a('0x6e')](_0x014a('0x88'));}else{_0x3fc9ab['having'](_0x014a('0x89'));}}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]){_0x24d433=_[_0x014a('0x8b')](_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')])?_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8a')]:new Array(_0x5ab5e8['query'][_0x014a('0x8a')]);_0x24d433[_0x014a('0x45')](function(_0x3c2a39){_0xd0334a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3c2a39+',%');});}if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')]){var _0x1cdfa5=_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x8c')][_0x014a('0x8d')]('\x5c','\x5c\x5c')[_0x014a('0x8d')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1cdfa5)){_0x47074f['or']('i.id\x20LIKE\x20?',_0x1cdfa5+'%');}else{_0x47074f['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1cdfa5))['or'](_0x014a('0x8e'),_0x1cdfa5+'%');}}}_0x3fc9ab[_0x014a('0x80')](_0x47074f);_0x3fc9ab[_0x014a('0x8f')](_0x014a('0x90'));var _0xe1b5ed={'type':db[_0x014a('0x91')][_0x014a('0x92')]['SELECT'],'raw':!![]};var _0x24ffb0=_0x3fc9ab[_0x014a('0x93')]();_0x24ffb0[_0x014a('0x57')](_0x014a('0x90'));_0x24ffb0['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x014a('0x6c'));if(_0x29c9ca[_0x014a('0x52')]){_0x29c9ca['order']['forEach'](function(_0x9aa04b){var _0x5bcaf9=_0x9aa04b[0x0]==='contactName'?_0x9aa04b[0x0]:'i.'+_0x9aa04b[0x0];_0x3fc9ab[_0x014a('0x52')](_0x5bcaf9,_0x9aa04b[0x1]===_0x014a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x24d433)){_0x3fc9ab[_0x014a('0x6e')](_0xd0334a);_0x24ffb0[_0x014a('0x80')](_0x014a('0x95'),_0x24d433);}BPromise[_0x014a('0x96')]()[_0x014a('0x1e')](function(){if(!_0x4e9260){if(_0x5ab5e8[_0x014a('0x4c')][_0x014a('0x7f')])return;_0x24ffb0[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x3fc9ab['where'](_0x014a('0x97'));return;}if(_0x5ab5e8['user']['role']!=='agent')return;return _0x5ab5e8[_0x014a('0x98')][_0x014a('0x99')]({'attributes':['id'],'raw':!![]})[_0x014a('0x1e')](function(_0x55408f){if(_[_0x014a('0x7e')](_0x55408f)){_0x24ffb0[_0x014a('0x80')](_0x014a('0x9a'));_0x3fc9ab[_0x014a('0x80')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24ffb0[_0x014a('0x80')](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));_0x3fc9ab['where'](_0x014a('0x81'),_[_0x014a('0x40')](_0x55408f,'id'));}});})['then'](function(){if(_0x5ab5e8[_0x014a('0x98')][_0x014a('0x9b')]===_0x014a('0x3c')&&!_0x4e9260&&!_0x5ab5e8['query'][_0x014a('0x7f')])return[];return db[_0x014a('0x9c')]['query'](_0x24ffb0[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x317df3){_0x1557ad[_0x014a('0x2e')]=_0x317df3[_0x014a('0x6f')];if(_0x1557ad[_0x014a('0x2e')]===0x0)return[];return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x479dc0['toString'](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x1806d0){_0x40e02b=_['keyBy'](_0x1806d0,'id');_0xe1b5ed=_['merge'](_0xe1b5ed,{'model':db[_0x014a('0x47')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5ab5e8[_0x014a('0x4c')]['fields']){_0x29c9ca[_0x014a('0x4e')][_0x014a('0x45')](function(_0x216b27){_0x3fc9ab['field']('i.'+_0x216b27);});}else{_0x3fc9ab[_0x014a('0x57')](_0x014a('0x9e'),'unreadMessages');_0x3fc9ab['field'](_0x014a('0x9f'),'Account.key');_0x3fc9ab[_0x014a('0x57')]('a.mandatoryDisposition',_0x014a('0xa0'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa1'),_0x014a('0xa2'));_0x3fc9ab[_0x014a('0x57')]('i.*');_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa3'),_0x014a('0xa4'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa5'),_0x014a('0xa6'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xa7'),'Contact.email');_0x3fc9ab[_0x014a('0x57')]('c.phone',_0x014a('0xa8'));_0x3fc9ab['field']('c.mobile','Contact.mobile');_0x3fc9ab['field'](_0x014a('0xa9'),_0x014a('0xaa'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xab'),_0x014a('0xac'));_0x3fc9ab[_0x014a('0x57')](_0x014a('0xad'),_0x014a('0xae'));_0x3fc9ab['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x014a('0x43'));}if(_0x29c9ca[_0x014a('0x2d')])_0x3fc9ab[_0x014a('0x2d')](_0x29c9ca[_0x014a('0x2d')]);if(_0x29c9ca[_0x014a('0x2b')])_0x3fc9ab[_0x014a('0x2b')](_0x29c9ca[_0x014a('0x2b')]);return db[_0x014a('0x9c')]['query'](_0x3fc9ab[_0x014a('0x9d')](),_0xe1b5ed);})[_0x014a('0x1e')](function(_0x3a2752){if(_0x3a2752[_0x014a('0x6f')]>0x0)_0x5b5318[_0x014a('0x80')]('ui.ChatInteractionId\x20IN\x20?',_[_0x014a('0x40')](_0x3a2752,'id'));return db[_0x014a('0x9c')][_0x014a('0x4c')](_0x5b5318[_0x014a('0x9d')](),_0xe1b5ed)[_0x014a('0x1e')](function(_0x567357){var _0x3036e4=_['groupBy'](_0x567357,_0x014a('0xaf'));var _0x5a83ab=[];_0x3a2752['forEach'](function(_0x1667c8){_0x5a83ab[_0x014a('0x46')](updateChatInteraction(_0x1667c8,_0x40e02b,_0x3036e4));});return BPromise['all'](_0x5a83ab);});});})[_0x014a('0x1e')](function(_0x3199b9){_0x1557ad[_0x014a('0xb0')]=_0x3199b9;return _0x1557ad;})['then'](respondWithFilteredResult(_0x67b30f,_0x29c9ca))[_0x014a('0x28')](handleError(_0x67b30f,null));};exports[_0x014a('0xb1')]=function(_0x2feb8a,_0x336bcf){var _0x2f7969={'raw':![],'where':{'id':_0x2feb8a[_0x014a('0xb2')]['id']}},_0x263212={};_0x263212[_0x014a('0x4b')]=_[_0x014a('0x7c')](db['ChatInteraction']['rawAttributes']);_0x263212[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x2feb8a[_0x014a('0x4c')]);_0x263212['filters']=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],_0x263212[_0x014a('0x4c')]);_0x2f7969[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x263212[_0x014a('0x4b')],qs['fields'](_0x2feb8a[_0x014a('0x4c')][_0x014a('0x4f')]));_0x2f7969[_0x014a('0x4e')]=_0x2f7969[_0x014a('0x4e')]['length']?_0x2f7969[_0x014a('0x4e')]:_0x263212[_0x014a('0x4b')];if(_0x2feb8a[_0x014a('0x4c')][_0x014a('0xb4')]){_0x2f7969[_0x014a('0xb5')]=[{'all':!![]}];}_0x2f7969=_['merge']({},_0x2f7969,_0x2feb8a[_0x014a('0xb6')]);return db['ChatInteraction']['find'](_0x2f7969)[_0x014a('0x1e')](handleEntityNotFound(_0x336bcf,null))[_0x014a('0x1e')](respondWithResult(_0x336bcf,null))[_0x014a('0x28')](handleError(_0x336bcf,null));};exports[_0x014a('0xb7')]=function(_0x3646b8,_0x243fd9){return db[_0x014a('0x47')][_0x014a('0xb7')](_0x3646b8[_0x014a('0x7b')],{})[_0x014a('0x1e')](respondWithResult(_0x243fd9,0xc9))[_0x014a('0x28')](handleError(_0x243fd9,null));};exports[_0x014a('0x34')]=function(_0x383bd8,_0x175c12){if(_0x383bd8[_0x014a('0x7b')]['id']){delete _0x383bd8[_0x014a('0x7b')]['id'];}return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x383bd8[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x175c12,null))['then'](saveUpdates(_0x383bd8[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x175c12,null))[_0x014a('0x28')](handleError(_0x175c12,null));};exports[_0x014a('0x35')]=function(_0x116631,_0xbfd7f8){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x116631[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0xbfd7f8,null))[_0x014a('0x1e')](removeEntity(_0xbfd7f8,null))[_0x014a('0x28')](handleError(_0xbfd7f8,null));};exports[_0x014a('0xb8')]=function(_0x11aab3,_0x4f91f1){return db[_0x014a('0x47')]['describe']()['then'](respondWithResult(_0x4f91f1,null))[_0x014a('0x28')](handleError(_0x4f91f1,null));};exports['createVidaooSession']=function(_0x2de457,_0x2ca658){var _0x4ee77b=_0x2de457[_0x014a('0xb2')]['id'];var _0x4e75e4;var _0x172210;var _0x8cc35d;return db['ChatInteraction'][_0x014a('0xb9')]({'where':{'id':_0x4ee77b}})[_0x014a('0x1e')](function(_0x50a129){_0x4e75e4=_0x50a129;return db[_0x014a('0xba')][_0x014a('0xb9')]({'where':{'id':_0x50a129[_0x014a('0x7f')]},'attributes':['id',_0x014a('0xbb'),_0x014a('0xbc'),_0x014a('0xbd'),_0x014a('0xbe'),_0x014a('0xbf')],'raw':!![]});})[_0x014a('0x1e')](function(_0x38df6c){if(_0x38df6c&&_0x38df6c[_0x014a('0xbb')]&&_0x38df6c[_0x014a('0xbc')]){_0x172210=_0x38df6c;var _0x4e0c1a={'interaction':{'id':_0x4ee77b},'agent':{'id':_0x2de457[_0x014a('0x98')]['id'],'name':_0x2de457[_0x014a('0x98')][_0x014a('0x38')],'fullname':_0x2de457[_0x014a('0x98')][_0x014a('0x41')],'email':_0x2de457[_0x014a('0x98')][_0x014a('0xc0')]},'contact':_0x2de457[_0x014a('0x7b')]['contact'],'account':_0x2de457[_0x014a('0x7b')][_0x014a('0x3e')]};var _0x2b3dc0={'rejectUnauthorized':![],'method':_0x014a('0xc1'),'url':_0x014a('0xc2'),'headers':{'X-APIKEY':_0x38df6c[_0x014a('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2de457['user'][_0x014a('0xc0')]],'buttons':null,'topic':_0x172210[_0x014a('0xbd')],'note':_[_0x014a('0xc3')](_0x172210['vidaooNote'])?null:getMustacheRender(_0x172210['vidaooNote'],_0x4e0c1a),'metadata':null},'redirect':_0x014a('0xc4'),'json':!![]};try{if(!_[_0x014a('0xc3')](_0x172210[_0x014a('0xbf')])){var _0x31e65e=getMustacheRender(_0x172210[_0x014a('0xbf')],_0x4e0c1a);var _0x537353=JSON[_0x014a('0x82')](_0x31e65e);_0x2b3dc0[_0x014a('0x7b')][_0x014a('0xc5')]=_0x537353;}}catch(_0x5dd7a5){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2b3dc0);}else{throw new db[(_0x014a('0x91'))]['ValidationError'](_0x014a('0xc7'));}})['then'](function(_0x57d852){_0x8cc35d=_0x57d852;if(_0x8cc35d['id']){var _0x581c3a={'body':_0x8cc35d[_0x014a('0xc8')],'ChatWebsiteId':_0x172210['id'],'ChatInteractionId':_0x4e75e4['id'],'direction':'out','UserId':_0x2de457[_0x014a('0x98')]['id']};return db['ChatMessage'][_0x014a('0xb7')](_0x581c3a,{});}else{throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x014a('0x1e')](function(){return _0x4e75e4['updateAttributes']({'vidaooSessionId':_0x8cc35d['id']});})[_0x014a('0x1e')](respondWithResult(_0x2ca658,null))[_0x014a('0x28')](handleError(_0x2ca658,null));};exports[_0x014a('0xc9')]=function(_0x533371,_0x57b53b){if(_0x533371[_0x014a('0x7b')]['id']){delete _0x533371[_0x014a('0x7b')]['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x533371[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xca')],'as':_0x014a('0xcb')}]})[_0x014a('0x1e')](handleEntityNotFound(_0x57b53b,null))[_0x014a('0x1e')](saveUpdates(_0x533371[_0x014a('0x7b')],null))[_0x014a('0x1e')](respondWithResult(_0x57b53b,null))[_0x014a('0x28')](handleError(_0x57b53b,null));};exports[_0x014a('0xcc')]=function(_0x4adbd2,_0x55a4bb,_0x38807c){if(_0x4adbd2[_0x014a('0x7b')]['id']){delete _0x4adbd2['body']['id'];}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x4adbd2['params']['id']}})['then'](function(_0xf01aa6){if(!_0xf01aa6){logger[_0x014a('0x24')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x014a('0xcc'),0x194,'entity\x20not\x20found');_0x55a4bb[_0x014a('0x36')](0x194);}else{if(_0xf01aa6[_0x014a('0x7a')]){throw new db[(_0x014a('0x91'))][(_0x014a('0xc6'))]('Interaction\x20already\x20assigned');}}return _0xf01aa6;})['then'](function(_0x5db9d1){if(_0x5db9d1){return _0x5db9d1['update']({'closed':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xcd')],'disposition':_0x4adbd2[_0x014a('0x7b')][_0x014a('0xce')]})[_0x014a('0x1e')](function(_0x3e19c0){return _0x3e19c0;});}})[_0x014a('0x1e')](function(_0x3546e7){return respondWithRpcPromise(_0x014a('0xcf'),_0x014a('0xcc'),_0x4adbd2[_0x014a('0x7b')],client9004);})['then'](respondWithResult(_0x55a4bb,null))['catch'](handleError(_0x55a4bb,null));};exports['attachmentUpload']=function(_0x190839,_0x28f011,_0x4da4a1){_0x190839[_0x014a('0x7b')][_0x014a('0x38')]=_0x190839[_0x014a('0xd0')][_0x014a('0xd1')];_0x190839['body'][_0x014a('0xd2')]=_0x190839[_0x014a('0xd0')]['filename'];_0x190839[_0x014a('0x7b')][_0x014a('0x49')]=_0x190839['file'][_0x014a('0xd3')];return db[_0x014a('0xd4')][_0x014a('0xb7')](_0x190839[_0x014a('0x7b')])[_0x014a('0x1e')](respondWithResult(_0x28f011,0xc9))[_0x014a('0x28')](handleError(_0x28f011,null));};exports[_0x014a('0xd5')]=function(_0xd50ab0,_0x4cee0b,_0x129deb){return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0xb2')]['id']},'raw':!![]})[_0x014a('0x1e')](handleEntityNotFound(_0x4cee0b,null))[_0x014a('0x1e')](function(_0x2573bd){if(_0x2573bd){if(_0x2573bd[_0x014a('0xcd')]){return _0x4cee0b[_0x014a('0x29')](0x193)['json']({'status':0x193,'message':_0x014a('0xd6')});}return db['Attachment'][_0x014a('0xb9')]({'where':{'id':_0xd50ab0[_0x014a('0x4c')][_0x014a('0xd7')]},'raw':!![]})['then'](handleEntityNotFound(_0x4cee0b,null));}})['then'](function(_0x293ee3){if(_0x293ee3){var _0x4ce807=_0x293ee3['ChatOfflineMessageId']!==null;var _0x5c002b=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xda'));if(_0x4ce807){_0x5c002b=path['join'](_0x5c002b,_0x014a('0xdb'));}var _0x19a2ed=path['join'](_0x5c002b,_0x293ee3[_0x014a('0xd2')]);return _0x4cee0b[_0x014a('0xdc')](_0x19a2ed);}})[_0x014a('0x28')](handleError(_0x4cee0b,null));};exports['close']=function(_0x5b82f2,_0x2b622f){var _0x24e9d7=null;var _0x344adb=null;var _0x1441ed=null;var _0x34b528=null;if(_0x5b82f2[_0x014a('0x7b')]['id']){delete _0x5b82f2['body']['id'];}if(_0x5b82f2['body']['mailTranscript']){_0x34b528=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0xdd'),util['format'](_0x014a('0xde'),Date[_0x014a('0xdf')]()));_0x5b82f2[_0x014a('0x7b')]['pathTranscript']=_0x34b528;}return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x5b82f2[_0x014a('0xb2')]['id']},'include':[{'model':db[_0x014a('0xe0')],'as':'Messages','include':[{'model':db[_0x014a('0x76')],'as':'User'}]}]})[_0x014a('0x1e')](handleEntityNotFound(_0x2b622f,null))[_0x014a('0x1e')](saveUpdates(_0x5b82f2[_0x014a('0x7b')],null))['then'](function(_0xdd63f){if(_0xdd63f){_0x24e9d7=_0xdd63f;return db[_0x014a('0xba')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x7f')]}});}})[_0x014a('0x1e')](function(_0x49a1eb){if(_0x49a1eb){_0x1441ed=_0x49a1eb;return db[_0x014a('0xca')][_0x014a('0x6b')]({'where':{'id':_0x24e9d7[_0x014a('0x71')]}});}})[_0x014a('0x1e')](function(_0x2432ac){if(_0x2432ac){_0x344adb=_0x2432ac;if(_0x34b528){var _0xb91589=null;for(var _0x53260c=0x1;_0x53260c<_0x24e9d7[_0x014a('0xe1')][_0x014a('0x6f')];++_0x53260c){_0xb91589=_0x24e9d7['Messages'][_0x53260c];var _0x1b5b25=_0xb91589['UserId']?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');var _0x10b3c5=_0x5b82f2[_0x014a('0x7b')][_0x014a('0xe5')]||util[_0x014a('0xe2')]('%s%d','Visitor',_0xb91589[_0x014a('0x71')]);switch(_0x1441ed[_0x014a('0xe6')]){case'website_alias':_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')](_0x014a('0xe7'),_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):'System';break;case _0x014a('0xe8'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0xe9')]||_0xb91589['User'][_0x014a('0x41')]:'System';break;case _0x014a('0xea'):_0x1b5b25=_0xb91589[_0x014a('0x7a')]?_0xb91589[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4');break;default:_0x1b5b25=_0xb91589[_0x014a('0x7a')]?util[_0x014a('0xe2')]('%s%d',_0x1441ed[_0x014a('0xe3')],_0xb91589[_0x014a('0x7a')]):_0x014a('0xe4');}var _0x343b5e=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0xb91589[_0x014a('0xeb')])[_0x014a('0xe2')]('MM/DD/YYYY\x20HH:mm:ss'),_0xb91589[_0x014a('0xec')]==='in'?_0x10b3c5:_0x1b5b25,_0xb91589[_0x014a('0x7b')]);if(!_0xb91589[_0x014a('0xed')]){fs[_0x014a('0xee')](_0x34b528,_0x343b5e);}}return db[_0x014a('0xef')][_0x014a('0xb9')]({'where':{'service':!![]},'include':[{'model':db[_0x014a('0xf0')],'as':_0x014a('0xf1'),'raw':!![]}]});}}})[_0x014a('0x1e')](function(_0x4ad0c6){if(_0x4ad0c6&&_0x4ad0c6[_0x014a('0xf1')]&&_0x5b82f2['body']){var _0x5f8d5b={'tls':{'rejectUnauthorized':![]}};if(_0x4ad0c6[_0x014a('0xf1')]['service']){_0x5f8d5b[_0x014a('0xf2')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf2')];}else{_0x5f8d5b[_0x014a('0xf3')]=_0x4ad0c6[_0x014a('0xf1')]['host'];_0x5f8d5b[_0x014a('0xf4')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf4')];_0x5f8d5b[_0x014a('0xf5')]=_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf5')];}if(_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf6')]){_0x5f8d5b['auth']={'user':_0x4ad0c6[_0x014a('0xf1')]['user'],'pass':_0x4ad0c6[_0x014a('0xf1')][_0x014a('0xf7')]};}return respondWithRpcPromise(_0x014a('0xf8'),_0x014a('0xf9'),{'account':_0x5f8d5b,'message':{'from':util[_0x014a('0xe2')](_0x014a('0xfa'),_0x4ad0c6['name'],_0x4ad0c6[_0x014a('0xc0')]||_0x4ad0c6['Smtp'][_0x014a('0x98')]),'to':_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')],'subject':_0x014a('0xfc'),'text':util[_0x014a('0xe2')](_0x014a('0xfd'),_0x5b82f2[_0x014a('0x7b')][_0x014a('0xfb')]),'attachments':[{'path':_0x34b528}]}})['then'](function(){return _0x24e9d7;})['catch'](function(_0xac886c){console[_0x014a('0x24')](_0xac886c);});}else{return _0x24e9d7;}})[_0x014a('0x1e')](respondWithStatusCode(_0x2b622f,0xc8))[_0x014a('0x28')](handleError(_0x2b622f,null));};exports[_0x014a('0xfe')]=function(_0x30aa7b,_0x451579,_0x3858a1){return db[_0x014a('0xe0')][_0x014a('0x6b')]({'where':{'id':_0x30aa7b[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x451579,null))[_0x014a('0x1e')](function(_0x57bd30){if(_0x57bd30){return _0x57bd30[_0x014a('0xfe')](_0x30aa7b[_0x014a('0x7b')][_0x014a('0xff')],_['omit'](_0x30aa7b[_0x014a('0x7b')],[_0x014a('0xff'),'id'])||{});}})[_0x014a('0x1e')](respondWithResult(_0x451579,null))[_0x014a('0x28')](handleError(_0x451579,null));};exports[_0x014a('0x100')]=function(_0x36c94d,_0x44cb05,_0x30a903){var _0x3bb1f={'raw':![],'where':{}};var _0x4775a4={};var _0x13ec10={'count':0x0,'rows':[]};return db[_0x014a('0x47')]['findOne']({'where':{'id':_0x36c94d['params']['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x44cb05,null))[_0x014a('0x1e')](function(_0x4a361b){if(_0x4a361b){_0x4775a4[_0x014a('0x4b')]=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x4775a4[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x36c94d[_0x014a('0x4c')]);_0x4775a4[_0x014a('0x4d')]=_['intersection'](_0x4775a4[_0x014a('0x4b')],_0x4775a4[_0x014a('0x4c')]);_0x3bb1f[_0x014a('0x4e')]=_[_0x014a('0xb3')](_0x4775a4['model'],qs[_0x014a('0x4f')](_0x36c94d[_0x014a('0x4c')][_0x014a('0x4f')]));_0x3bb1f['attributes']=_0x3bb1f[_0x014a('0x4e')][_0x014a('0x6f')]?_0x3bb1f['attributes']:_0x4775a4[_0x014a('0x4b')];if(!_0x36c94d[_0x014a('0x4c')][_0x014a('0x50')]('nolimit')){_0x3bb1f[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x36c94d[_0x014a('0x4c')]['limit']);_0x3bb1f[_0x014a('0x2b')]=qs['offset'](_0x36c94d[_0x014a('0x4c')]['offset']);}_0x3bb1f[_0x014a('0x52')]=qs[_0x014a('0x53')](_0x36c94d['query'][_0x014a('0x53')]);_0x3bb1f['where']=qs[_0x014a('0x4d')](_[_0x014a('0x101')](_0x36c94d[_0x014a('0x4c')],_0x4775a4[_0x014a('0x4d')]));_0x3bb1f[_0x014a('0x80')]['ChatInteractionId']=_0x4a361b['id'];if(_0x36c94d[_0x014a('0x4c')][_0x014a('0x8c')]){_0x3bb1f[_0x014a('0x80')]=_['merge'](_0x3bb1f[_0x014a('0x80')],{'$or':_[_0x014a('0x40')](_0x3bb1f['attributes'],function(_0x565da5){var _0x309858={};_0x309858[_0x565da5]={'$like':'%'+_0x36c94d[_0x014a('0x4c')]['filter']+'%'};return _0x309858;})});}if(_0x36c94d[_0x014a('0x4c')]['$gte']){var _0x56bfaf=_0x36c94d[_0x014a('0x4c')][_0x014a('0x102')]['split'](',');var _0x5f14e4={};_0x5f14e4[_0x56bfaf[0x0]]={'$gte':moment(_0x56bfaf[0x1])['format'](_0x014a('0x103'))};_0x3bb1f[_0x014a('0x80')]=_[_0x014a('0x3a')](_0x3bb1f['where'],_0x5f14e4);}_0x3bb1f=_['merge']({},_0x3bb1f,_0x36c94d[_0x014a('0xb6')]);return db['ChatMessage'][_0x014a('0x2e')]({'where':_0x3bb1f[_0x014a('0x80')]})['then'](function(_0x4acfe9){_0x13ec10[_0x014a('0x2e')]=_0x4acfe9;if(_0x36c94d[_0x014a('0x4c')]['includeAll']){_0x3bb1f[_0x014a('0xb5')]=[{'all':!![]}];}return db['ChatMessage'][_0x014a('0x104')](_0x3bb1f);})['then'](function(_0x8c21a7){_0x13ec10[_0x014a('0xb0')]=_0x8c21a7;return _0x13ec10;});}})[_0x014a('0x1e')](respondWithFilteredResult(_0x44cb05,_0x3bb1f))[_0x014a('0x28')](handleError(_0x44cb05,null));};exports[_0x014a('0x105')]=function(_0x260f79,_0x68de07,_0x4126a3){var _0x4f1f23={'where':{}},_0x1ef9b0={},_0x11d0e9={'count':0x0,'rows':[]};return db[_0x014a('0x47')][_0x014a('0xb9')]({'where':{'id':_0x260f79[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x68de07,null))[_0x014a('0x1e')](function(_0x4f7960){if(_0x4f7960){_0x1ef9b0['model']=_[_0x014a('0x7c')](db[_0x014a('0xe0')][_0x014a('0x48')]);_0x1ef9b0[_0x014a('0x4c')]=_[_0x014a('0x7c')](_0x260f79[_0x014a('0x4c')]);_0x1ef9b0[_0x014a('0x4d')]=_[_0x014a('0xb3')](_0x1ef9b0[_0x014a('0x4b')],_0x1ef9b0[_0x014a('0x4c')]);_0x4f1f23[_0x014a('0x4e')]=_['intersection'](_0x1ef9b0[_0x014a('0x4b')],qs[_0x014a('0x4f')](_0x260f79[_0x014a('0x4c')][_0x014a('0x4f')]));_0x4f1f23[_0x014a('0x4e')]=_0x4f1f23[_0x014a('0x4e')][_0x014a('0x6f')]?_0x4f1f23['attributes']:_0x1ef9b0['model'];if(!_0x260f79[_0x014a('0x4c')][_0x014a('0x50')](_0x014a('0x51'))){_0x4f1f23[_0x014a('0x2d')]=qs[_0x014a('0x2d')](_0x260f79['query'][_0x014a('0x2d')]);_0x4f1f23[_0x014a('0x2b')]=qs['offset'](_0x260f79[_0x014a('0x4c')][_0x014a('0x2b')]);}_0x4f1f23[_0x014a('0x52')]=qs['sort'](_0x260f79[_0x014a('0x4c')][_0x014a('0x53')]);_0x4f1f23[_0x014a('0x80')]=qs['filters'](_[_0x014a('0x101')](_0x260f79[_0x014a('0x4c')],_0x1ef9b0['filters']));_0x4f1f23[_0x014a('0x80')][_0x014a('0xaf')]=_0x4f7960['id'];if(_0x260f79[_0x014a('0x4c')]['filter']){_0x4f1f23[_0x014a('0x80')]=_['merge'](_0x4f1f23['where'],{'$or':_['map'](_0x4f1f23['attributes'],function(_0xf3e4fb){var _0x126084={};_0x126084[_0xf3e4fb]={'$like':'%'+_0x260f79[_0x014a('0x4c')][_0x014a('0x8c')]+'%'};return _0x126084;})});}_0x4f1f23[_0x014a('0x80')][_0x014a('0xed')]=![];if(_0x260f79[_0x014a('0x4c')]['id']){_0x4f1f23['where']['id']={'$gt':_0x260f79[_0x014a('0x4c')]['id']};}_0x4f1f23=_['merge']({},_0x4f1f23,_0x260f79[_0x014a('0xb6')]);return db[_0x014a('0xe0')][_0x014a('0x2e')]({'where':_0x4f1f23['where']})[_0x014a('0x1e')](function(_0x58421d){_0x11d0e9['count']=_0x58421d;_0x4f1f23[_0x014a('0xb5')]=[];if(_0x260f79[_0x014a('0x4c')][_0x014a('0x106')]){_0x4f1f23['include']['push']({'model':db[_0x014a('0x76')],'as':_0x014a('0x76'),'attributes':['id',_0x014a('0x41'),_0x014a('0xe9')]});}if(_0x260f79[_0x014a('0x4c')][_0x014a('0xb4')]){_0x4f1f23['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x4f1f23);})[_0x014a('0x1e')](function(_0x40a47f){_0x11d0e9[_0x014a('0xb0')]=_0x40a47f;return _0x11d0e9;});}})['then'](respondWithFilteredResult(_0x68de07,_0x4f1f23))[_0x014a('0x28')](handleError(_0x68de07,null));};exports[_0x014a('0x107')]=function(_0x8a099,_0x81208d,_0x320be9){return db[_0x014a('0x47')][_0x014a('0x6b')]({'where':{'id':_0x8a099[_0x014a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x81208d,null))[_0x014a('0x1e')](function(_0x46a2c5){if(_0x46a2c5){return _0x46a2c5['setTags'](_0x8a099[_0x014a('0x7b')][_0x014a('0xff')],_[_0x014a('0x108')](_0x8a099['body'],[_0x014a('0xff'),'id'])||{})[_0x014a('0x109')](function(){return db['Tag'][_0x014a('0x104')]({'attributes':['id','name',_0x014a('0x55')],'where':{'id':_0x8a099[_0x014a('0x7b')][_0x014a('0xff')]}});})[_0x014a('0x1e')](function(_0x4f56a9){socket['emit'](_0x014a('0x10a'),{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]});return{'id':Number(_0x8a099[_0x014a('0xb2')]['id']),'tags':_0x4f56a9||[]};});}})[_0x014a('0x1e')](respondWithResult(_0x81208d,null))[_0x014a('0x28')](handleError(_0x81208d,null));};exports[_0x014a('0x10b')]=function(_0x32ba5d,_0x120047,_0x570898){return db['ChatInteraction']['find']({'where':{'id':_0x32ba5d[_0x014a('0xb2')]['id']}})[_0x014a('0x1e')](handleEntityNotFound(_0x120047,null))[_0x014a('0x1e')](function(_0x47cd44){if(_0x47cd44){return _0x47cd44[_0x014a('0x10b')](_0x32ba5d[_0x014a('0x4c')][_0x014a('0xff')]);}})['then'](respondWithStatusCode(_0x120047,null))[_0x014a('0x28')](handleError(_0x120047,null));};exports['download']=function(_0x546af7,_0x4c492f){var _0x331ba9=moment()['unix']()[_0x014a('0x9d')]();var _0x3e7923=path['join'](config[_0x014a('0xd9')],'server',_0x014a('0x10c'),'tmp');var _0x387e49=path[_0x014a('0xd8')](config[_0x014a('0xd9')],_0x014a('0x10d'),_0x014a('0x10c'),_0x014a('0x10e'));var _0x1c5606=path['join'](_0x3e7923,_0x331ba9);var _0x4b4336=util[_0x014a('0xe2')]('transcript-%d-%s.zip',_0x546af7[_0x014a('0xb2')]['id'],_0x331ba9);var _0x1b3f4d=path[_0x014a('0xd8')](_0x3e7923,_0x4b4336);var _0x5f58bd=[];_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0x76')],'as':'User','attributes':['id',_0x014a('0x41')],'raw':!![]});_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xca')],'as':_0x014a('0xcb'),'attributes':['id',_0x014a('0x10f'),_0x014a('0x110')],'raw':!![]});if(_0x546af7[_0x014a('0x4c')]['attachments']){_0x5f58bd[_0x014a('0x46')]({'model':db[_0x014a('0xd4')],'as':'Attachment','raw':!![]});}var _0x5104b1=[{'model':db[_0x014a('0xe0')],'as':_0x014a('0xe1'),'attributes':['id',_0x014a('0x7b'),_0x014a('0xeb'),'direction',_0x014a('0xed'),_0x014a('0x87')],'include':_0x5f58bd}];_0x5104b1[_0x014a('0x46')]({'model':db[_0x014a('0xba')],'as':_0x014a('0x111'),'attributes':['id',_0x014a('0x38')]});_0x5104b1['push']({'model':db['User'],'as':'Owner','attributes':['id',_0x014a('0x41')]});return db['ChatInteraction'][_0x014a('0x6b')]({'where':{'id':_0x546af7[_0x014a('0xb2')]['id']},'include':_0x5104b1})[_0x014a('0x1e')](handleEntityNotFound(_0x4c492f,null))['then'](function(_0x501d05){if(_0x501d05){var _0x48c669=_0x501d05[_0x014a('0x112')]({'plain':!![]});fs['mkdirSync'](_0x1c5606);var _0x5d4bae={'channel':_0x014a('0x113'),'account':_0x48c669[_0x014a('0x111')][_0x014a('0x38')],'agent':_0x48c669[_0x014a('0x114')]?_0x48c669[_0x014a('0x114')][_0x014a('0x41')]:_0x014a('0x115'),'createdAt':moment(_0x48c669[_0x014a('0xeb')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x48c669['closed']?moment(_0x48c669[_0x014a('0x116')])[_0x014a('0xe2')](_0x014a('0x103'))[_0x014a('0x9d')]():'','disposition':_0x48c669[_0x014a('0xce')],'chatInfo':{'browser':_0x48c669['browserName'],'os':_0x48c669[_0x014a('0x117')],'referer':_0x48c669[_0x014a('0x118')],'customerIp':_0x48c669['customerIp'],'customerPort':_0x48c669[_0x014a('0x119')]?_0x48c669[_0x014a('0x119')]:_0x014a('0x115')},'messages':_(_0x48c669[_0x014a('0xe1')])['tail']()[_0x014a('0x8c')]({'secret':![]})[_0x014a('0x40')](function(_0x5afb91){if(_0x5afb91[_0x014a('0xd4')]){var _0x172440=path[_0x014a('0xd8')](_0x387e49,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]);if(fs[_0x014a('0x11a')](_0x172440)){fs[_0x014a('0x11b')](_0x172440)[_0x014a('0x11c')](fs['createWriteStream'](path[_0x014a('0xd8')](_0x1c5606,_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')])));}}return{'date':moment(_0x5afb91['createdAt'])['format'](_0x014a('0x103'))[_0x014a('0x9d')](),'sender':_0x5afb91[_0x014a('0xec')]==='out'?_0x5afb91[_0x014a('0x76')]?_0x5afb91[_0x014a('0x76')][_0x014a('0x41')]:_0x014a('0xe4'):_0x5afb91[_0x014a('0xcb')][_0x014a('0x10f')]+(_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]?'\x20'+_0x5afb91[_0x014a('0xcb')][_0x014a('0x110')]:''),'body':_0x5afb91[_0x014a('0xd4')]?_0x5afb91[_0x014a('0xd4')][_0x014a('0xd2')]:_0x5afb91[_0x014a('0x7b')],'direction':_0x5afb91[_0x014a('0xec')]===_0x014a('0x11d')?'A':'C','secret':_0x5afb91[_0x014a('0xed')],'read':_0x5afb91['read'],'attachment':_0x5afb91[_0x014a('0xd4')]};})[_0x014a('0x6d')]()};return ejs['renderFile'](path['join'](config['root'],_0x014a('0x10d'),_0x014a('0x11e'),'downloadInteraction.ejs'),{'interaction':_0x5d4bae})['then'](function(_0x374e3d){var _0x2d9178=path['join'](_0x1c5606,_0x014a('0x11f')+_0x48c669['id']+'-'+_0x331ba9+'.pdf');var _0x30c604={'path':_0x2d9178,'channel':'Chat','interactionId':_0x48c669['id']};return pdf['createPdfFromHTML'](_0x374e3d,_0x30c604);})[_0x014a('0x1e')](function(){return new BPromise(function(_0x321a17,_0x2f20e7){zipdir(_0x1c5606,{'saveTo':_0x1b3f4d},function(_0x18edd1,_0xcad1af){if(_0x18edd1)return _0x2f20e7(_0x18edd1);return _0x321a17(_0xcad1af);});})['then'](function(){return new BPromise(function(_0x42cd23,_0x82d77b){rimraf(_0x1c5606,function(_0x48bcec){if(_0x48bcec)_0x82d77b(_0x48bcec);return _0x42cd23();});});})[_0x014a('0x1e')](function(){return _0x4c492f[_0x014a('0xdc')](_0x1b3f4d,_0x4b4336,function(_0x1d8179){if(_0x1d8179){console[_0x014a('0x120')](_0x014a('0x121'),_0x1d8179);}else{fs[_0x014a('0x122')](_0x1b3f4d);}});});});}else{return _0x4c492f[_0x014a('0x36')](0xc8);}})['catch'](handleError(_0x4c492f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 2e747d7..ee50445 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 _0xff0c=['then','setDataValue','Users','map','findAll','emit','hasOwnProperty','exports','events','../../mysqldb','save','update','remove','getUsers'];(function(_0x39735a,_0x17ad25){var _0x39d581=function(_0x5c759b){while(--_0x5c759b){_0x39735a['push'](_0x39735a['shift']());}};_0x39d581(++_0x17ad25);}(_0xff0c,0x6a));var _0xcff0=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0xff0c[_0x476c7];return _0x47ae56;};'use strict';var EventEmitter=require(_0xcff0('0x0'));var ChatInteraction=require(_0xcff0('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xcff0('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcff0('0x2'),'afterUpdate':_0xcff0('0x3'),'afterDestroy':_0xcff0('0x4')};function emitEvent(_0x3c25db){return function(_0x5379a5,_0x25860f,_0x211e79){_0x5379a5[_0xcff0('0x5')]({'attributes':['id'],'raw':!![]})[_0xcff0('0x6')](function(_0x20be68){_0x5379a5[_0xcff0('0x7')](_0xcff0('0x8'),_0x20be68[_0xcff0('0x9')](function(_0x271f23){return{'id':_0x271f23['id']};}));return ChatMessage[_0xcff0('0xa')]({'where':{'ChatInteractionId':_0x5379a5['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcff0('0x6')](function(_0x3db1bc){_0x5379a5[_0xcff0('0x7')]('unreadMessages',_0x3db1bc['length']);ChatInteractionEvents['emit'](_0x3c25db+':'+_0x5379a5['id'],_0x5379a5);ChatInteractionEvents[_0xcff0('0xb')](_0x3c25db,_0x5379a5);_0x211e79(null);})['catch'](_0x211e79(null));};}for(var e in events){if(events[_0xcff0('0xc')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xcff0('0xd')]=ChatInteractionEvents; \ No newline at end of file +var _0xdef4=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','getUsers','then','setDataValue','map','unreadMessages'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xdef4,0x18a));var _0x4def=function(_0x14eb9e,_0x29fe9e){_0x14eb9e=_0x14eb9e-0x0;var _0x4c59c4=_0xdef4[_0x14eb9e];return _0x4c59c4;};'use strict';var EventEmitter=require(_0x4def('0x0'));var ChatInteraction=require(_0x4def('0x1'))['db'][_0x4def('0x2')];var ChatMessage=require(_0x4def('0x1'))['db'][_0x4def('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4def('0x4'),'afterUpdate':_0x4def('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4c57ea){return function(_0x4a720f,_0x1c8dfd,_0x41feaa){_0x4a720f[_0x4def('0x6')]({'attributes':['id'],'raw':!![]})[_0x4def('0x7')](function(_0x515727){_0x4a720f[_0x4def('0x8')]('Users',_0x515727[_0x4def('0x9')](function(_0x21c129){return{'id':_0x21c129['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x4a720f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x43a03f){_0x4a720f['setDataValue'](_0x4def('0xa'),_0x43a03f['length']);ChatInteractionEvents[_0x4def('0xb')](_0x4c57ea+':'+_0x4a720f['id'],_0x4a720f);ChatInteractionEvents[_0x4def('0xb')](_0x4c57ea,_0x4a720f);_0x41feaa(null);})['catch'](_0x41feaa(null));};}for(var e in events){if(events[_0x4def('0xc')](e)){var event=events[e];ChatInteraction[_0x4def('0xd')](e,emitEvent(event));}}module[_0x4def('0xe')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index b9c0b34..d387005 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 _0x25e7=['path','rimraf','./chatInteraction.attributes','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x25e7,0x11c));var _0x725e=function(_0x2404ab,_0x1008c2){_0x2404ab=_0x2404ab-0x0;var _0x5edff9=_0x25e7[_0x2404ab];return _0x5edff9;};'use strict';var _=require(_0x725e('0x0'));var util=require('util');var logger=require(_0x725e('0x1'))('api');var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rp=require(_0x725e('0x4'));var fs=require('fs');var path=require(_0x725e('0x5'));var rimraf=require(_0x725e('0x6'));var config=require('../../config/environment');var attributes=require(_0x725e('0x7'));module[_0x725e('0x8')]=function(_0x2b5b90,_0x1afa7a){return _0x2b5b90['define'](_0x725e('0x9'),attributes,{'tableName':_0x725e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19154f,_0x396930,_0x354d86){if(_0x19154f[_0x725e('0xb')](_0x725e('0xc'))){_0x19154f['closedAt']=moment()[_0x725e('0xd')](_0x725e('0xe'));}_0x354d86(null,_0x19154f);}},'charset':_0x725e('0xf'),'collate':_0x725e('0x10')});}; \ No newline at end of file +var _0x9e3d=['define','ChatInteraction','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x5edd2f,_0x245dcd){var _0x37b39e=function(_0x42c1e7){while(--_0x42c1e7){_0x5edd2f['push'](_0x5edd2f['shift']());}};_0x37b39e(++_0x245dcd);}(_0x9e3d,0x1e9));var _0xd9e3=function(_0x55850c,_0x229051){_0x55850c=_0x55850c-0x0;var _0x32d952=_0x9e3d[_0x55850c];return _0x32d952;};'use strict';var _=require(_0xd9e3('0x0'));var util=require(_0xd9e3('0x1'));var logger=require('../../config/logger')(_0xd9e3('0x2'));var moment=require(_0xd9e3('0x3'));var BPromise=require(_0xd9e3('0x4'));var rp=require(_0xd9e3('0x5'));var fs=require('fs');var path=require(_0xd9e3('0x6'));var rimraf=require(_0xd9e3('0x7'));var config=require(_0xd9e3('0x8'));var attributes=require(_0xd9e3('0x9'));module[_0xd9e3('0xa')]=function(_0x41cc79,_0x2d2fb9){return _0x41cc79[_0xd9e3('0xb')](_0xd9e3('0xc'),attributes,{'tableName':_0xd9e3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c8308,_0x50da69,_0x1ce0d0){if(_0x2c8308[_0xd9e3('0xe')]('closed')){_0x2c8308[_0xd9e3('0xf')]=moment()[_0xd9e3('0x10')](_0xd9e3('0x11'));}_0x1ce0d0(null,_0x2c8308);}},'charset':_0xd9e3('0x12'),'collate':_0xd9e3('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 688bcb0..334716a 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 _0xdc65=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateChatInteraction','body','options','where','attributes','AddTagsToChatInteraction','ChatInteraction','find','addTags','omit','ids','spread','AddTags','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x4588bd,_0x57222b){var _0x1becaa=function(_0x2ec59d){while(--_0x2ec59d){_0x4588bd['push'](_0x4588bd['shift']());}};_0x1becaa(++_0x57222b);}(_0xdc65,0xf5));var _0x5dc6=function(_0x22e4ea,_0x1eaab1){_0x22e4ea=_0x22e4ea-0x0;var _0x2237dc=_0xdc65[_0x22e4ea];return _0x2237dc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5dc6('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5dc6('0x1'));var db=require(_0x5dc6('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5dc6('0x3'))('rpc');var config=require(_0x5dc6('0x4'));var jayson=require(_0x5dc6('0x5'));var client=jayson[_0x5dc6('0x6')][_0x5dc6('0x7')]({'port':0x232a});config['redis']=_[_0x5dc6('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5dc6('0x9'))(new Redis(config['redis']));require(_0x5dc6('0xa'))[_0x5dc6('0xb')](socket);function respondWithRpcPromise(_0x2e3517,_0x520752,_0x13910a){return new BPromise(function(_0x2b05a9,_0x418328){return client[_0x5dc6('0xc')](_0x2e3517,_0x13910a)[_0x5dc6('0xd')](function(_0x1c772a){logger['info'](_0x5dc6('0xe'),_0x520752,_0x5dc6('0xf'));logger[_0x5dc6('0x10')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x520752,_0x5dc6('0xf'),JSON[_0x5dc6('0x11')](_0x1c772a));if(_0x1c772a[_0x5dc6('0x12')]){if(_0x1c772a[_0x5dc6('0x12')][_0x5dc6('0x13')]===0x1f4){logger[_0x5dc6('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x520752,_0x1c772a[_0x5dc6('0x12')]['message']);return _0x418328(_0x1c772a['error']['message']);}logger[_0x5dc6('0x12')](_0x5dc6('0xe'),_0x520752,_0x1c772a[_0x5dc6('0x12')][_0x5dc6('0x14')]);return _0x2b05a9(_0x1c772a[_0x5dc6('0x12')]['message']);}else{logger[_0x5dc6('0x15')](_0x5dc6('0xe'),_0x520752,_0x5dc6('0xf'));_0x2b05a9(_0x1c772a[_0x5dc6('0x16')][_0x5dc6('0x14')]);}})[_0x5dc6('0x17')](function(_0x5cf96b){logger[_0x5dc6('0x12')](_0x5dc6('0xe'),_0x520752,_0x5cf96b);_0x418328(_0x5cf96b);});});}exports[_0x5dc6('0x18')]=function(_0x5776aa){var _0x5bfeae=this;return new Promise(function(_0x5257dd,_0x90f071){return db['ChatInteraction']['update'](_0x5776aa[_0x5dc6('0x19')],{'raw':_0x5776aa[_0x5dc6('0x1a')]?_0x5776aa[_0x5dc6('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5776aa[_0x5dc6('0x1a')]?_0x5776aa[_0x5dc6('0x1a')][_0x5dc6('0x1b')]||null:null,'attributes':_0x5776aa[_0x5dc6('0x1a')]?_0x5776aa[_0x5dc6('0x1a')][_0x5dc6('0x1c')]||null:null,'limit':_0x5776aa['options']?_0x5776aa[_0x5dc6('0x1a')]['limit']||null:null})['then'](function(_0x5791ea){logger[_0x5dc6('0x15')]('UpdateChatInteraction',_0x5776aa);logger['debug'](_0x5dc6('0x18'),_0x5776aa,JSON[_0x5dc6('0x11')](_0x5791ea));_0x5257dd(_0x5791ea);})[_0x5dc6('0x17')](function(_0x1aea45){logger[_0x5dc6('0x12')](_0x5dc6('0x18'),_0x1aea45['message'],_0x5776aa);_0x90f071(_0x5bfeae[_0x5dc6('0x12')](0x1f4,_0x1aea45[_0x5dc6('0x14')]));});});};exports[_0x5dc6('0x1d')]=function(_0x1389a0){return new Promise(function(_0x43efb0,_0x56c8b4){return db[_0x5dc6('0x1e')][_0x5dc6('0x1f')]({'where':_0x1389a0[_0x5dc6('0x1a')]?_0x1389a0[_0x5dc6('0x1a')][_0x5dc6('0x1b')]||null:null})[_0x5dc6('0xd')](function(_0x1d0e76){if(_0x1d0e76){return _0x1d0e76[_0x5dc6('0x20')](_0x1389a0['body']['ids'],_[_0x5dc6('0x21')](_0x1389a0['body'],[_0x5dc6('0x22'),'id'])||{});}})[_0x5dc6('0x23')](function(_0x2e8b58){logger[_0x5dc6('0x15')](_0x5dc6('0x24'),_0x1389a0);logger[_0x5dc6('0x10')](_0x5dc6('0x24'),_0x1389a0,JSON['stringify'](_0x2e8b58));_0x43efb0(_0x2e8b58);})[_0x5dc6('0x17')](function(_0x4fbae7){logger[_0x5dc6('0x12')](_0x5dc6('0x24'),_0x4fbae7[_0x5dc6('0x14')],_0x1389a0);_0x56c8b4(_this[_0x5dc6('0x12')](0x1f4,_0x4fbae7[_0x5dc6('0x14')]));});});}; \ No newline at end of file +var _0xecf5=['where','attributes','limit','UpdateChatInteraction','stringify','find','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','socket.io-emitter','redis','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','ChatInteraction,\x20%s,\x20%s','message','result','catch','ChatInteraction','update','body','options','raw'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0xecf5,0x17b));var _0x5ecf=function(_0x372fa3,_0x1c49aa){_0x372fa3=_0x372fa3-0x0;var _0x49e830=_0xecf5[_0x372fa3];return _0x49e830;};'use strict';var _=require(_0x5ecf('0x0'));var util=require(_0x5ecf('0x1'));var moment=require(_0x5ecf('0x2'));var BPromise=require(_0x5ecf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ecf('0x4'));var db=require(_0x5ecf('0x5'))['db'];var utils=require(_0x5ecf('0x6'));var logger=require(_0x5ecf('0x7'))(_0x5ecf('0x8'));var config=require(_0x5ecf('0x9'));var jayson=require(_0x5ecf('0xa'));var client=jayson['client'][_0x5ecf('0xb')]({'port':0x232a});config['redis']=_[_0x5ecf('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5ecf('0xd'))(new Redis(config[_0x5ecf('0xe')]));require('./chatInteraction.socket')[_0x5ecf('0xf')](socket);function respondWithRpcPromise(_0x251a04,_0x3ddfb6,_0x5e0f19){return new BPromise(function(_0x1fa6a5,_0x2cc906){return client[_0x5ecf('0x10')](_0x251a04,_0x5e0f19)[_0x5ecf('0x11')](function(_0x433a14){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3ddfb6,_0x5ecf('0x12'));logger[_0x5ecf('0x13')](_0x5ecf('0x14'),_0x3ddfb6,_0x5ecf('0x12'),JSON['stringify'](_0x433a14));if(_0x433a14[_0x5ecf('0x15')]){if(_0x433a14[_0x5ecf('0x15')]['code']===0x1f4){logger['error'](_0x5ecf('0x16'),_0x3ddfb6,_0x433a14[_0x5ecf('0x15')][_0x5ecf('0x17')]);return _0x2cc906(_0x433a14[_0x5ecf('0x15')]['message']);}logger[_0x5ecf('0x15')](_0x5ecf('0x16'),_0x3ddfb6,_0x433a14[_0x5ecf('0x15')][_0x5ecf('0x17')]);return _0x1fa6a5(_0x433a14[_0x5ecf('0x15')]['message']);}else{logger['info'](_0x5ecf('0x16'),_0x3ddfb6,_0x5ecf('0x12'));_0x1fa6a5(_0x433a14[_0x5ecf('0x18')][_0x5ecf('0x17')]);}})[_0x5ecf('0x19')](function(_0x28c824){logger[_0x5ecf('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x3ddfb6,_0x28c824);_0x2cc906(_0x28c824);});});}exports['UpdateChatInteraction']=function(_0x48fca8){var _0x155534=this;return new Promise(function(_0x465c5e,_0x17bd18){return db[_0x5ecf('0x1a')][_0x5ecf('0x1b')](_0x48fca8[_0x5ecf('0x1c')],{'raw':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x1f')]||null:null,'attributes':_0x48fca8[_0x5ecf('0x1d')]?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x20')]||null:null,'limit':_0x48fca8['options']?_0x48fca8[_0x5ecf('0x1d')][_0x5ecf('0x21')]||null:null})[_0x5ecf('0x11')](function(_0x3613de){logger['info'](_0x5ecf('0x22'),_0x48fca8);logger[_0x5ecf('0x13')]('UpdateChatInteraction',_0x48fca8,JSON[_0x5ecf('0x23')](_0x3613de));_0x465c5e(_0x3613de);})[_0x5ecf('0x19')](function(_0x593b84){logger[_0x5ecf('0x15')]('UpdateChatInteraction',_0x593b84[_0x5ecf('0x17')],_0x48fca8);_0x17bd18(_0x155534['error'](0x1f4,_0x593b84['message']));});});};exports['AddTagsToChatInteraction']=function(_0x172714){return new Promise(function(_0x4773fb,_0x4d1ac3){return db[_0x5ecf('0x1a')][_0x5ecf('0x24')]({'where':_0x172714[_0x5ecf('0x1d')]?_0x172714[_0x5ecf('0x1d')][_0x5ecf('0x1f')]||null:null})['then'](function(_0x56dfbe){if(_0x56dfbe){return _0x56dfbe['addTags'](_0x172714[_0x5ecf('0x1c')][_0x5ecf('0x25')],_[_0x5ecf('0x26')](_0x172714[_0x5ecf('0x1c')],[_0x5ecf('0x25'),'id'])||{});}})[_0x5ecf('0x27')](function(_0x1b52cc){logger['info'](_0x5ecf('0x28'),_0x172714);logger[_0x5ecf('0x13')](_0x5ecf('0x28'),_0x172714,JSON['stringify'](_0x1b52cc));_0x4773fb(_0x1b52cc);})['catch'](function(_0x5d0650){logger['error']('AddTags',_0x5d0650[_0x5ecf('0x17')],_0x172714);_0x4d1ac3(_this[_0x5ecf('0x15')](0x1f4,_0x5d0650[_0x5ecf('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 7c45d13..056300f 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 _0xefe7=['./chatInteraction.events','remove','update','emit','length','chatInteraction:'];(function(_0x53969e,_0xf883b8){var _0x3dfc7a=function(_0xb41ef){while(--_0xb41ef){_0x53969e['push'](_0x53969e['shift']());}};_0x3dfc7a(++_0xf883b8);}(_0xefe7,0x168));var _0x7efe=function(_0x261d58,_0x1745c3){_0x261d58=_0x261d58-0x0;var _0x2ce66c=_0xefe7[_0x261d58];return _0x2ce66c;};'use strict';var ChatInteractionEvents=require(_0x7efe('0x0'));var events=['save',_0x7efe('0x1'),_0x7efe('0x2')];function createListener(_0x4986dc,_0x5901c0){return function(_0xb80e9c){_0x5901c0[_0x7efe('0x3')](_0x4986dc,_0xb80e9c);};}function removeListener(_0x5044d0,_0x1e380e){return function(){ChatInteractionEvents['removeListener'](_0x5044d0,_0x1e380e);};}exports['register']=function(_0x4183a6){for(var _0x43ac91=0x0,_0x6c7f38=events[_0x7efe('0x4')];_0x43ac91<_0x6c7f38;_0x43ac91++){var _0x56093c=events[_0x43ac91];var _0x3f24f3=createListener(_0x7efe('0x5')+_0x56093c,_0x4183a6);ChatInteractionEvents['on'](_0x56093c,_0x3f24f3);}}; \ No newline at end of file +var _0xa553=['./chatInteraction.events','save','remove','update','removeListener','register','length','chatInteraction:'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0xa553,0x158));var _0x3a55=function(_0x342c40,_0x8174ef){_0x342c40=_0x342c40-0x0;var _0x4cb218=_0xa553[_0x342c40];return _0x4cb218;};'use strict';var ChatInteractionEvents=require(_0x3a55('0x0'));var events=[_0x3a55('0x1'),_0x3a55('0x2'),_0x3a55('0x3')];function createListener(_0x7d0b52,_0x41dd31){return function(_0x1636ba){_0x41dd31['emit'](_0x7d0b52,_0x1636ba);};}function removeListener(_0x287402,_0xfc35ae){return function(){ChatInteractionEvents[_0x3a55('0x4')](_0x287402,_0xfc35ae);};}exports[_0x3a55('0x5')]=function(_0x285fb3){for(var _0x488937=0x0,_0x4fd97a=events[_0x3a55('0x6')];_0x488937<_0x4fd97a;_0x488937++){var _0x17a451=events[_0x488937];var _0x218ccb=createListener(_0x3a55('0x7')+_0x17a451,_0x285fb3);ChatInteractionEvents['on'](_0x17a451,_0x218ccb);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c4cb72a..8165339 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 _0x0f87=['originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','join','root','server/files/attachments/','format','now'];(function(_0x1f9ddb,_0xe6b723){var _0x38db97=function(_0x4b6edd){while(--_0x4b6edd){_0x1f9ddb['push'](_0x1f9ddb['shift']());}};_0x38db97(++_0xe6b723);}(_0x0f87,0xf3));var _0x70f8=function(_0x44b400,_0x3b299d){_0x44b400=_0x44b400-0x0;var _0x38e966=_0x0f87[_0x44b400];return _0x38e966;};'use strict';var multer=require(_0x70f8('0x0'));var util=require(_0x70f8('0x1'));var path=require(_0x70f8('0x2'));var timeout=require(_0x70f8('0x3'));var express=require(_0x70f8('0x4'));var router=express[_0x70f8('0x5')]();var fs_extra=require(_0x70f8('0x6'));var auth=require(_0x70f8('0x7'));var interaction=require(_0x70f8('0x8'));var config=require(_0x70f8('0x9'));var controller=require(_0x70f8('0xa'));router[_0x70f8('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x70f8('0xb')](_0x70f8('0xc'),auth[_0x70f8('0xd')](),controller['describe']);router[_0x70f8('0xb')](_0x70f8('0xe'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x10')]);router[_0x70f8('0xb')](_0x70f8('0x11'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x12')]);router['get'](_0x70f8('0x13'),auth[_0x70f8('0xd')](),controller[_0x70f8('0x14')]);router[_0x70f8('0xb')](_0x70f8('0x15'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x16')]);router[_0x70f8('0xb')](_0x70f8('0x17'),auth[_0x70f8('0xd')](),controller[_0x70f8('0x18')]);router[_0x70f8('0x19')]('/',auth[_0x70f8('0xd')](),controller[_0x70f8('0x1a')]);router[_0x70f8('0x19')]('/:id/vidaoo',auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x267734,_0x45f72f,_0x6643dc){_0x6643dc(null,path[_0x70f8('0x1b')](config[_0x70f8('0x1c')],_0x70f8('0x1d')));},'filename':function(_0x5322dd,_0x44e636,_0x1e12e3){_0x1e12e3(null,util[_0x70f8('0x1e')]('%s-%s',Date[_0x70f8('0x1f')](),_0x44e636[_0x70f8('0x20')][_0x70f8('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x70f8('0x19')](_0x70f8('0x22'),upload[_0x70f8('0x23')](_0x70f8('0x24')),controller['attachmentUpload']);router['post'](_0x70f8('0x13'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x25')]);router['post'](_0x70f8('0x26'),auth[_0x70f8('0xd')](),interaction[_0x70f8('0x27')](_0x70f8('0x28'),_0x70f8('0x29')),controller[_0x70f8('0x2a')]);router[_0x70f8('0x2b')](_0x70f8('0xe'),auth[_0x70f8('0xd')](),interaction[_0x70f8('0x27')](_0x70f8('0x28'),_0x70f8('0x2c')),controller[_0x70f8('0x2d')]);router[_0x70f8('0x2b')]('/:id/custom_update',controller[_0x70f8('0x2e')]);router[_0x70f8('0x2b')](_0x70f8('0x2f'),auth[_0x70f8('0xf')](),controller[_0x70f8('0x30')]);router[_0x70f8('0x2b')](_0x70f8('0x31'),controller[_0x70f8('0x32')]);router[_0x70f8('0x33')](_0x70f8('0xe'),auth['isAuthenticated'](),interaction[_0x70f8('0x27')](_0x70f8('0x28'),_0x70f8('0x34')),controller[_0x70f8('0x35')]);router['delete'](_0x70f8('0x26'),auth[_0x70f8('0xd')](),controller[_0x70f8('0x36')]);module['exports']=router; \ No newline at end of file +var _0x54b6=['addTags','put','/:id/custom_update','customUpdate','abandon','chatinteraction:destroy','delete','removeTags','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','root','server/files/attachments/','%s-%s','now','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat'];(function(_0x3abd49,_0x5ec0ec){var _0x5f5677=function(_0x29478a){while(--_0x29478a){_0x3abd49['push'](_0x3abd49['shift']());}};_0x5f5677(++_0x5ec0ec);}(_0x54b6,0x144));var _0x654b=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x54b6[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x654b('0x0'));var timeout=require(_0x654b('0x1'));var express=require(_0x654b('0x2'));var router=express[_0x654b('0x3')]();var fs_extra=require(_0x654b('0x4'));var auth=require(_0x654b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x654b('0x6'));var controller=require(_0x654b('0x7'));router[_0x654b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x654b('0x9')](),controller['describe']);router[_0x654b('0x8')](_0x654b('0xa'),auth[_0x654b('0xb')](),controller[_0x654b('0xc')]);router[_0x654b('0x8')](_0x654b('0xd'),auth[_0x654b('0xb')](),controller[_0x654b('0xe')]);router[_0x654b('0x8')](_0x654b('0xf'),auth[_0x654b('0x9')](),controller['getMessages']);router['get'](_0x654b('0x10'),auth[_0x654b('0xb')](),controller[_0x654b('0x11')]);router['get'](_0x654b('0x12'),auth[_0x654b('0x9')](),controller[_0x654b('0x13')]);router[_0x654b('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x654b('0x14')]('/:id/vidaoo',auth[_0x654b('0x9')](),controller[_0x654b('0x15')]);var upload=multer({'storage':multer[_0x654b('0x16')]({'destination':function(_0x54b4d6,_0x1b0467,_0x26e860){_0x26e860(null,path['join'](config[_0x654b('0x17')],_0x654b('0x18')));},'filename':function(_0x1949eb,_0x232432,_0xc1cdf3){_0xc1cdf3(null,util['format'](_0x654b('0x19'),Date[_0x654b('0x1a')](),_0x232432['originalname'][_0x654b('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x654b('0x14')](_0x654b('0x1c'),upload[_0x654b('0x1d')](_0x654b('0x1e')),controller[_0x654b('0x1f')]);router[_0x654b('0x14')](_0x654b('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x654b('0x20')]);router['post'](_0x654b('0x21'),auth[_0x654b('0x9')](),interaction[_0x654b('0x22')](_0x654b('0x23'),'chatinteraction:addtags'),controller[_0x654b('0x24')]);router[_0x654b('0x25')](_0x654b('0xa'),auth['isAuthenticated'](),interaction['tracked']('chat','chatinteraction:update'),controller['update']);router[_0x654b('0x25')](_0x654b('0x26'),controller[_0x654b('0x27')]);router[_0x654b('0x25')]('/:id/abandon',auth[_0x654b('0xb')](),controller[_0x654b('0x28')]);router[_0x654b('0x25')]('/:id/close',controller['close']);router['delete'](_0x654b('0xa'),auth[_0x654b('0x9')](),interaction['tracked']('chat',_0x654b('0x29')),controller['destroy']);router[_0x654b('0x2a')](_0x654b('0x21'),auth[_0x654b('0x9')](),controller[_0x654b('0x2b')]);module[_0x654b('0x2c')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index a4d97bd..88231dc 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 _0x06a8=['BOOLEAN','INTEGER','sequelize','medium'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x06a8,0x1e2));var _0x806a=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x06a8[_0x2aea9e];return _0x430b92;};'use strict';var Sequelize=require(_0x806a('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x806a('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x806a('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x806a('0x3')]}}; \ No newline at end of file +var _0x4c38=['sequelize','medium','BOOLEAN'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4c38,0x14a));var _0x84c3=function(_0x21a7aa,_0x2248dc){_0x21a7aa=_0x21a7aa-0x0;var _0x20c622=_0x4c38[_0x21a7aa];return _0x20c622;};'use strict';var Sequelize=require(_0x84c3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x84c3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x84c3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index a3f68e9..8e554e5 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 _0x784d=['showWebBar','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','isEmpty','length','resourceId','push','FromId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','jsforce','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','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','body','catch','update','find','describe','get','messages','lastMessageAt','createdAt','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','agent','admin','user','fullname','role','internal','online','lastLoginAt'];(function(_0x3ed195,_0x793f6d){var _0x10e647=function(_0x326c02){while(--_0x326c02){_0x3ed195['push'](_0x3ed195['shift']());}};_0x10e647(++_0x793f6d);}(_0x784d,0x14e));var _0xd784=function(_0x4187b7,_0x11a446){_0x4187b7=_0x4187b7-0x0;var _0x3a4625=_0x784d[_0x4187b7];return _0x3a4625;};'use strict';var emlformat=require(_0xd784('0x0'));var rimraf=require(_0xd784('0x1'));var zipdir=require(_0xd784('0x2'));var jsonpatch=require(_0xd784('0x3'));var rp=require(_0xd784('0x4'));var moment=require('moment');var BPromise=require(_0xd784('0x5'));var Mustache=require(_0xd784('0x6'));var util=require('util');var path=require(_0xd784('0x7'));var sox=require(_0xd784('0x8'));var csv=require('to-csv');var ejs=require(_0xd784('0x9'));var fs=require('fs');var fs_extra=require(_0xd784('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd784('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xd784('0xc'));var querystring=require(_0xd784('0xd'));var Papa=require(_0xd784('0xe'));var Redis=require(_0xd784('0xf'));var authService=require(_0xd784('0x10'));var qs=require(_0xd784('0x11'));var as=require(_0xd784('0x12'));var hardwareService=require(_0xd784('0x13'));var logger=require(_0xd784('0x14'))(_0xd784('0x15'));var utils=require(_0xd784('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd784('0x17'));var db=require(_0xd784('0x18'))['db'];config[_0xd784('0x19')]=_[_0xd784('0x1a')](config[_0xd784('0x19')],{'host':_0xd784('0x1b'),'port':0x18eb});var socket=require(_0xd784('0x1c'))(new Redis(config[_0xd784('0x19')]));require(_0xd784('0x1d'))[_0xd784('0x1e')](socket);function respondWithStatusCode(_0xdb4365,_0x37459b){_0x37459b=_0x37459b||0xcc;return function(_0x5b2113){if(_0x5b2113){return _0xdb4365['sendStatus'](_0x37459b);}return _0xdb4365[_0xd784('0x1f')](_0x37459b)['end']();};}function respondWithResult(_0x3ad3b8,_0x1e1477){_0x1e1477=_0x1e1477||0xc8;return function(_0x343024){if(_0x343024){return _0x3ad3b8['status'](_0x1e1477)[_0xd784('0x20')](_0x343024);}};}function respondWithFilteredResult(_0x4d21c5,_0x4f3f50){return function(_0x27a8a7){if(_0x27a8a7){var _0x5a97ef=typeof _0x4f3f50[_0xd784('0x21')]===_0xd784('0x22')&&typeof _0x4f3f50[_0xd784('0x23')]===_0xd784('0x22');var _0x4d1549=_0x27a8a7[_0xd784('0x24')];var _0x1bef86=_0x5a97ef?0x0:_0x4f3f50[_0xd784('0x21')];var _0x4324a2=_0x5a97ef?_0x27a8a7[_0xd784('0x24')]:_0x4f3f50[_0xd784('0x21')]+_0x4f3f50[_0xd784('0x23')];var _0x3b7478;if(_0x4324a2>=_0x4d1549){_0x4324a2=_0x4d1549;_0x3b7478=0xc8;}else{_0x3b7478=0xce;}_0x4d21c5[_0xd784('0x1f')](_0x3b7478);return _0x4d21c5[_0xd784('0x25')](_0xd784('0x26'),_0x1bef86+'-'+_0x4324a2+'/'+_0x4d1549)[_0xd784('0x20')](_0x27a8a7);}return null;};}function patchUpdates(_0x17bbc5){return function(_0x1c8253){try{jsonpatch['apply'](_0x1c8253,_0x17bbc5,!![]);}catch(_0x5ef368){return BPromise[_0xd784('0x27')](_0x5ef368);}return _0x1c8253[_0xd784('0x28')]();};}function saveUpdates(_0x334371,_0x359b52){return function(_0x1fcaa6){if(_0x1fcaa6){return _0x1fcaa6['update'](_0x334371)[_0xd784('0x29')](function(_0xd97df6){return _0xd97df6;});}return null;};}function removeEntity(_0x5af39d,_0x2d2fcc){return function(_0x35afaf){if(_0x35afaf){return _0x35afaf['destroy']()[_0xd784('0x29')](function(){_0x5af39d[_0xd784('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc1eb,_0x527f1e){return function(_0x81d873){if(!_0x81d873){_0x1dc1eb['sendStatus'](0x194);}return _0x81d873;};}function handleError(_0x4abdc2,_0x3fcda1){_0x3fcda1=_0x3fcda1||0x1f4;return function(_0x3b2e7a){logger[_0xd784('0x2a')](_0x3b2e7a[_0xd784('0x2b')]);if(_0x3b2e7a[_0xd784('0x2c')]){delete _0x3b2e7a[_0xd784('0x2c')];}_0x4abdc2[_0xd784('0x1f')](_0x3fcda1)[_0xd784('0x2d')](_0x3b2e7a);};}exports[_0xd784('0x2e')]=function(_0xdc44ca,_0x12526b){var _0xaeaff6={},_0x190938={},_0x1f71e9={'count':0x0,'rows':[]};var _0xbf2846=_[_0xd784('0x2f')](db[_0xd784('0x30')][_0xd784('0x31')],function(_0x125a79){return{'name':_0x125a79['fieldName'],'type':_0x125a79[_0xd784('0x32')][_0xd784('0x33')]};});_0x190938[_0xd784('0x34')]=_[_0xd784('0x2f')](_0xbf2846,_0xd784('0x2c'));_0x190938['query']=_[_0xd784('0x35')](_0xdc44ca[_0xd784('0x36')]);_0x190938['filters']=_[_0xd784('0x37')](_0x190938[_0xd784('0x34')],_0x190938[_0xd784('0x36')]);_0xaeaff6[_0xd784('0x38')]=_[_0xd784('0x37')](_0x190938['model'],qs['fields'](_0xdc44ca[_0xd784('0x36')][_0xd784('0x39')]));_0xaeaff6[_0xd784('0x38')]=_0xaeaff6[_0xd784('0x38')]['length']?_0xaeaff6['attributes']:_0x190938[_0xd784('0x34')];if(!_0xdc44ca[_0xd784('0x36')][_0xd784('0x3a')]('nolimit')){_0xaeaff6['limit']=qs[_0xd784('0x23')](_0xdc44ca[_0xd784('0x36')]['limit']);_0xaeaff6['offset']=qs[_0xd784('0x21')](_0xdc44ca[_0xd784('0x36')][_0xd784('0x21')]);}_0xaeaff6['order']=qs[_0xd784('0x3b')](_0xdc44ca[_0xd784('0x36')][_0xd784('0x3b')]);_0xaeaff6[_0xd784('0x3c')]=qs[_0xd784('0x3d')](_[_0xd784('0x3e')](_0xdc44ca['query'],_0x190938['filters']),_0xbf2846);if(_0xdc44ca[_0xd784('0x36')][_0xd784('0x3f')]){_0xaeaff6[_0xd784('0x3c')]=_[_0xd784('0x40')](_0xaeaff6[_0xd784('0x3c')],{'$or':_[_0xd784('0x2f')](_0xbf2846,function(_0xf7220e){if(_0xf7220e[_0xd784('0x32')]!==_0xd784('0x41')){var _0x15c199={};_0x15c199[_0xf7220e[_0xd784('0x2c')]]={'$like':'%'+_0xdc44ca[_0xd784('0x36')][_0xd784('0x3f')]+'%'};return _0x15c199;}})});}_0xaeaff6=_[_0xd784('0x40')]({},_0xaeaff6,_0xdc44ca[_0xd784('0x42')]);var _0x3b4b4d={'where':_0xaeaff6[_0xd784('0x3c')]};return db[_0xd784('0x30')][_0xd784('0x24')](_0x3b4b4d)[_0xd784('0x29')](function(_0x406a85){_0x1f71e9[_0xd784('0x24')]=_0x406a85;if(_0xdc44ca['query']['includeAll']){_0xaeaff6[_0xd784('0x43')]=[{'all':!![]}];}return db[_0xd784('0x30')][_0xd784('0x44')](_0xaeaff6);})['then'](function(_0x46a41a){_0x1f71e9[_0xd784('0x45')]=_0x46a41a;return _0x1f71e9;})[_0xd784('0x29')](respondWithFilteredResult(_0x12526b,_0xaeaff6))['catch'](handleError(_0x12526b,null));};exports[_0xd784('0x46')]=function(_0xf1e754,_0x5da78d){var _0x118350={'raw':!![],'where':{'id':_0xf1e754[_0xd784('0x47')]['id']}},_0x3d8989={};_0x3d8989[_0xd784('0x34')]=_[_0xd784('0x35')](db[_0xd784('0x30')]['rawAttributes']);_0x3d8989[_0xd784('0x36')]=_[_0xd784('0x35')](_0xf1e754[_0xd784('0x36')]);_0x3d8989['filters']=_[_0xd784('0x37')](_0x3d8989[_0xd784('0x34')],_0x3d8989[_0xd784('0x36')]);_0x118350[_0xd784('0x38')]=_[_0xd784('0x37')](_0x3d8989[_0xd784('0x34')],qs[_0xd784('0x39')](_0xf1e754[_0xd784('0x36')][_0xd784('0x39')]));_0x118350['attributes']=_0x118350[_0xd784('0x38')]['length']?_0x118350[_0xd784('0x38')]:_0x3d8989[_0xd784('0x34')];if(_0xf1e754[_0xd784('0x36')][_0xd784('0x48')]){_0x118350[_0xd784('0x43')]=[{'all':!![]}];}_0x118350=_[_0xd784('0x40')]({},_0x118350,_0xf1e754[_0xd784('0x42')]);return db[_0xd784('0x30')]['find'](_0x118350)[_0xd784('0x29')](handleEntityNotFound(_0x5da78d,null))[_0xd784('0x29')](respondWithResult(_0x5da78d,null))['catch'](handleError(_0x5da78d,null));};exports[_0xd784('0x49')]=function(_0x43441e,_0x3b9539){return db[_0xd784('0x30')][_0xd784('0x49')](_0x43441e[_0xd784('0x4a')],{})[_0xd784('0x29')](respondWithResult(_0x3b9539,0xc9))[_0xd784('0x4b')](handleError(_0x3b9539,null));};exports[_0xd784('0x4c')]=function(_0x48b536,_0x1ca909){if(_0x48b536['body']['id']){delete _0x48b536[_0xd784('0x4a')]['id'];}return db[_0xd784('0x30')]['find']({'where':{'id':_0x48b536[_0xd784('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ca909,null))[_0xd784('0x29')](saveUpdates(_0x48b536['body'],null))[_0xd784('0x29')](respondWithResult(_0x1ca909,null))[_0xd784('0x4b')](handleError(_0x1ca909,null));};exports['destroy']=function(_0x4a46a0,_0x565341){return db[_0xd784('0x30')][_0xd784('0x4d')]({'where':{'id':_0x4a46a0[_0xd784('0x47')]['id']}})[_0xd784('0x29')](handleEntityNotFound(_0x565341,null))['then'](removeEntity(_0x565341,null))['catch'](handleError(_0x565341,null));};exports[_0xd784('0x4e')]=function(_0x1aaa5e,_0x215c2b){return db['ChatInternalMessage'][_0xd784('0x4e')]()['then'](respondWithResult(_0x215c2b,null))[_0xd784('0x4b')](handleError(_0x215c2b,null));};function wrapUser(_0x5f3174){return function(_0x40b962){var _0x48f640=_0x5f3174[_0xd784('0x4f')]({'plain':!![]});_0x48f640[_0xd784('0x50')]=[];if(_0x40b962){_0x48f640[_0xd784('0x51')]=_0x40b962[_0xd784('0x52')];_0x48f640['lastMessage']=_0x40b962;}else{_0x48f640['lastMessageAt']=moment(0x0)['format'](_0xd784('0x53'));_0x48f640[_0xd784('0x54')]={};}return _0x48f640;};}exports[_0xd784('0x55')]=function(_0xa2c767,_0x52d146,_0x5e17eb){var _0x3d632e=[];return db['User'][_0xd784('0x44')]({'where':{'role':[_0xd784('0x56'),_0xd784('0x57'),_0xd784('0x58')]},'attributes':['id',_0xd784('0x59'),'name',_0xd784('0x5a'),'userpic',_0xd784('0x5b'),_0xd784('0x5c'),_0xd784('0x5d'),'allowmessenger',_0xd784('0x5e')],'order':qs[_0xd784('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0xd784('0x2c'),_0xd784('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x28d010){if(_0x28d010){var _0x192d9e=_0xa2c767['user'][_0xd784('0x4f')]({'plain':!![]});if(!_0x192d9e)throw new Error(_0xd784('0x5f'));if(_0x192d9e[_0xd784('0x5a')]===_0xd784('0x58')){return db[_0xd784('0x60')]['find']({'where':{'name':_0xd784('0x61'),'userProfileId':_0x192d9e['userProfileId']},'raw':!![]})[_0xd784('0x29')](function(_0xf49dba){if(_0xf49dba){if(_0xf49dba[_0xd784('0x62')]===0x0){return db['UserProfileResource'][_0xd784('0x44')]({'where':{'sectionId':_0xf49dba['id']},'raw':!![]})[_0xd784('0x29')](function(_0x39e13e){var _0x198581=[];if(_[_0xd784('0x63')](_0x39e13e)){_0x198581=_[_0xd784('0x3f')](_0x28d010,function(_0x1fa2c2){if(_0x1fa2c2['role']!=='agent'){return _0x1fa2c2;}});return _0x198581;}else{for(var _0x5586b0=0x0;_0x5586b0<_0x28d010[_0xd784('0x64')];_0x5586b0++){var _0x2086ba=_0x28d010[_0x5586b0];if(_0x2086ba[_0xd784('0x5a')]===_0xd784('0x56')){var _0x3fb035=_['find'](_0x39e13e,function(_0x4487fd){return _0x4487fd[_0xd784('0x65')]===_0x2086ba['id'];});if(_0x3fb035)_0x198581[_0xd784('0x66')](_0x2086ba);}else{_0x198581[_0xd784('0x66')](_0x2086ba);}}return _0x198581;}});}else{return _0x28d010;}}else{var _0x5870fa=_[_0xd784('0x3f')](_0x28d010,function(_0x1d1c1b){if(_0x1d1c1b[_0xd784('0x5a')]!=='agent'){return _0x1d1c1b;}});return _0x5870fa;}});}else{return _0x28d010;}}})[_0xd784('0x29')](function(_0x5e27b6){var _0x2d21be=[];if(_0x5e27b6){_0x3d632e=_0x5e27b6;for(var _0x4713b9=0x0;_0x4713b9<_0x5e27b6[_0xd784('0x64')];_0x4713b9+=0x1){_0x3d632e[_0x4713b9][_0xd784('0x50')]=[];_0x2d21be[_0xd784('0x66')](db['ChatInternalMessage'][_0xd784('0x4d')]({'where':{'FromId':[_0xa2c767[_0xd784('0x58')]['id'],_0x5e27b6[_0x4713b9]['id']],'ToId':[_0xa2c767[_0xd784('0x58')]['id'],_0x5e27b6[_0x4713b9]['id']],'ChatGroupId':null},'attributes':['id',_0xd784('0x52'),_0xd784('0x67'),'ToId',_0xd784('0x68'),_0xd784('0x4a')],'order':qs[_0xd784('0x3b')](_0xd784('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd784('0x29')](wrapUser(_0x5e27b6[_0x4713b9])));}return BPromise[_0xd784('0x6a')](_0x2d21be);}return[];})['then'](function(_0x3b4f02){return{'rows':_0x3b4f02,'count':_0x3b4f02['length']};})['then'](respondWithResult(_0x52d146,null))['catch'](handleError(_0x52d146,null));}; \ No newline at end of file +var _0xa957=['eml-format','rimraf','fast-json-patch','request-promise','moment','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','./chatInternalMessage.socket','sendStatus','status','offset','limit','Content-Range','json','apply','save','then','destroy','end','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','options','find','create','body','update','params','describe','messages','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','admin','user','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','push','FromId','read','-createdAt','all'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xa957,0x141));var _0x7a95=function(_0x2386c7,_0x6330c){_0x2386c7=_0x2386c7-0x0;var _0x5f388a=_0xa957[_0x2386c7];return _0x5f388a;};'use strict';var emlformat=require(_0x7a95('0x0'));var rimraf=require(_0x7a95('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7a95('0x2'));var rp=require(_0x7a95('0x3'));var moment=require(_0x7a95('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7a95('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a95('0x6'));var fs=require('fs');var fs_extra=require(_0x7a95('0x7'));var _=require(_0x7a95('0x8'));var squel=require('squel');var crypto=require(_0x7a95('0x9'));var jsforce=require(_0x7a95('0xa'));var deskjs=require(_0x7a95('0xb'));var toCsv=require(_0x7a95('0xc'));var querystring=require(_0x7a95('0xd'));var Papa=require(_0x7a95('0xe'));var Redis=require('ioredis');var authService=require(_0x7a95('0xf'));var qs=require(_0x7a95('0x10'));var as=require(_0x7a95('0x11'));var hardwareService=require(_0x7a95('0x12'));var logger=require(_0x7a95('0x13'))(_0x7a95('0x14'));var utils=require(_0x7a95('0x15'));var config=require(_0x7a95('0x16'));var licenseUtil=require(_0x7a95('0x17'));var db=require(_0x7a95('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x7a95('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7a95('0x1a'))['register'](socket);function respondWithStatusCode(_0x3a62e3,_0x30d682){_0x30d682=_0x30d682||0xcc;return function(_0x3c2e76){if(_0x3c2e76){return _0x3a62e3[_0x7a95('0x1b')](_0x30d682);}return _0x3a62e3[_0x7a95('0x1c')](_0x30d682)['end']();};}function respondWithResult(_0x1b1d18,_0x14dfd8){_0x14dfd8=_0x14dfd8||0xc8;return function(_0x33ce16){if(_0x33ce16){return _0x1b1d18[_0x7a95('0x1c')](_0x14dfd8)['json'](_0x33ce16);}};}function respondWithFilteredResult(_0x4fd2d8,_0x54b447){return function(_0x3da5e9){if(_0x3da5e9){var _0x120b9d=typeof _0x54b447['offset']==='undefined'&&typeof _0x54b447['limit']==='undefined';var _0x5536ce=_0x3da5e9['count'];var _0x21f80f=_0x120b9d?0x0:_0x54b447['offset'];var _0x19f6c0=_0x120b9d?_0x3da5e9['count']:_0x54b447[_0x7a95('0x1d')]+_0x54b447[_0x7a95('0x1e')];var _0x590e9c;if(_0x19f6c0>=_0x5536ce){_0x19f6c0=_0x5536ce;_0x590e9c=0xc8;}else{_0x590e9c=0xce;}_0x4fd2d8['status'](_0x590e9c);return _0x4fd2d8['set'](_0x7a95('0x1f'),_0x21f80f+'-'+_0x19f6c0+'/'+_0x5536ce)[_0x7a95('0x20')](_0x3da5e9);}return null;};}function patchUpdates(_0x2abef9){return function(_0xc9bb9){try{jsonpatch[_0x7a95('0x21')](_0xc9bb9,_0x2abef9,!![]);}catch(_0x50b863){return BPromise['reject'](_0x50b863);}return _0xc9bb9[_0x7a95('0x22')]();};}function saveUpdates(_0x3ec5cb,_0x452c6c){return function(_0x4cf784){if(_0x4cf784){return _0x4cf784['update'](_0x3ec5cb)[_0x7a95('0x23')](function(_0xccbdcb){return _0xccbdcb;});}return null;};}function removeEntity(_0x22a9bb,_0x22be51){return function(_0x45cab9){if(_0x45cab9){return _0x45cab9[_0x7a95('0x24')]()[_0x7a95('0x23')](function(){_0x22a9bb[_0x7a95('0x1c')](0xcc)[_0x7a95('0x25')]();});}};}function handleEntityNotFound(_0xea6e32,_0x2ff421){return function(_0x4d3a17){if(!_0x4d3a17){_0xea6e32[_0x7a95('0x1b')](0x194);}return _0x4d3a17;};}function handleError(_0x271d37,_0x361cde){_0x361cde=_0x361cde||0x1f4;return function(_0x38ece2){logger[_0x7a95('0x26')](_0x38ece2[_0x7a95('0x27')]);if(_0x38ece2['name']){delete _0x38ece2[_0x7a95('0x28')];}_0x271d37[_0x7a95('0x1c')](_0x361cde)['send'](_0x38ece2);};}exports[_0x7a95('0x29')]=function(_0x4951cb,_0x53dc11){var _0x232fa8={},_0x4bc01b={},_0x146c78={'count':0x0,'rows':[]};var _0x4984cd=_[_0x7a95('0x2a')](db[_0x7a95('0x2b')][_0x7a95('0x2c')],function(_0x51d198){return{'name':_0x51d198[_0x7a95('0x2d')],'type':_0x51d198[_0x7a95('0x2e')][_0x7a95('0x2f')]};});_0x4bc01b[_0x7a95('0x30')]=_[_0x7a95('0x2a')](_0x4984cd,_0x7a95('0x28'));_0x4bc01b['query']=_[_0x7a95('0x31')](_0x4951cb[_0x7a95('0x32')]);_0x4bc01b['filters']=_[_0x7a95('0x33')](_0x4bc01b[_0x7a95('0x30')],_0x4bc01b[_0x7a95('0x32')]);_0x232fa8[_0x7a95('0x34')]=_['intersection'](_0x4bc01b[_0x7a95('0x30')],qs[_0x7a95('0x35')](_0x4951cb[_0x7a95('0x32')]['fields']));_0x232fa8[_0x7a95('0x34')]=_0x232fa8[_0x7a95('0x34')][_0x7a95('0x36')]?_0x232fa8[_0x7a95('0x34')]:_0x4bc01b[_0x7a95('0x30')];if(!_0x4951cb['query'][_0x7a95('0x37')](_0x7a95('0x38'))){_0x232fa8[_0x7a95('0x1e')]=qs[_0x7a95('0x1e')](_0x4951cb[_0x7a95('0x32')][_0x7a95('0x1e')]);_0x232fa8[_0x7a95('0x1d')]=qs[_0x7a95('0x1d')](_0x4951cb[_0x7a95('0x32')][_0x7a95('0x1d')]);}_0x232fa8[_0x7a95('0x39')]=qs[_0x7a95('0x3a')](_0x4951cb['query'][_0x7a95('0x3a')]);_0x232fa8[_0x7a95('0x3b')]=qs['filters'](_['pick'](_0x4951cb[_0x7a95('0x32')],_0x4bc01b[_0x7a95('0x3c')]),_0x4984cd);if(_0x4951cb[_0x7a95('0x32')][_0x7a95('0x3d')]){_0x232fa8['where']=_['merge'](_0x232fa8['where'],{'$or':_[_0x7a95('0x2a')](_0x4984cd,function(_0x374792){if(_0x374792[_0x7a95('0x2e')]!==_0x7a95('0x3e')){var _0x1bca09={};_0x1bca09[_0x374792[_0x7a95('0x28')]]={'$like':'%'+_0x4951cb['query'][_0x7a95('0x3d')]+'%'};return _0x1bca09;}})});}_0x232fa8=_[_0x7a95('0x3f')]({},_0x232fa8,_0x4951cb['options']);var _0x87e711={'where':_0x232fa8[_0x7a95('0x3b')]};return db[_0x7a95('0x2b')][_0x7a95('0x40')](_0x87e711)[_0x7a95('0x23')](function(_0x1d7c41){_0x146c78['count']=_0x1d7c41;if(_0x4951cb['query'][_0x7a95('0x41')]){_0x232fa8[_0x7a95('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7a95('0x43')](_0x232fa8);})[_0x7a95('0x23')](function(_0x1e880a){_0x146c78[_0x7a95('0x44')]=_0x1e880a;return _0x146c78;})[_0x7a95('0x23')](respondWithFilteredResult(_0x53dc11,_0x232fa8))[_0x7a95('0x45')](handleError(_0x53dc11,null));};exports['show']=function(_0x2c6544,_0x2f5482){var _0x4d26d5={'raw':!![],'where':{'id':_0x2c6544['params']['id']}},_0x27b170={};_0x27b170[_0x7a95('0x30')]=_[_0x7a95('0x31')](db[_0x7a95('0x2b')][_0x7a95('0x2c')]);_0x27b170[_0x7a95('0x32')]=_[_0x7a95('0x31')](_0x2c6544[_0x7a95('0x32')]);_0x27b170[_0x7a95('0x3c')]=_[_0x7a95('0x33')](_0x27b170[_0x7a95('0x30')],_0x27b170[_0x7a95('0x32')]);_0x4d26d5[_0x7a95('0x34')]=_['intersection'](_0x27b170[_0x7a95('0x30')],qs['fields'](_0x2c6544[_0x7a95('0x32')][_0x7a95('0x35')]));_0x4d26d5[_0x7a95('0x34')]=_0x4d26d5[_0x7a95('0x34')][_0x7a95('0x36')]?_0x4d26d5[_0x7a95('0x34')]:_0x27b170[_0x7a95('0x30')];if(_0x2c6544[_0x7a95('0x32')][_0x7a95('0x41')]){_0x4d26d5[_0x7a95('0x42')]=[{'all':!![]}];}_0x4d26d5=_[_0x7a95('0x3f')]({},_0x4d26d5,_0x2c6544[_0x7a95('0x46')]);return db[_0x7a95('0x2b')][_0x7a95('0x47')](_0x4d26d5)[_0x7a95('0x23')](handleEntityNotFound(_0x2f5482,null))[_0x7a95('0x23')](respondWithResult(_0x2f5482,null))['catch'](handleError(_0x2f5482,null));};exports[_0x7a95('0x48')]=function(_0x1d50da,_0x326d7c){return db['ChatInternalMessage']['create'](_0x1d50da[_0x7a95('0x49')],{})[_0x7a95('0x23')](respondWithResult(_0x326d7c,0xc9))[_0x7a95('0x45')](handleError(_0x326d7c,null));};exports[_0x7a95('0x4a')]=function(_0x2e6196,_0x4ea155){if(_0x2e6196[_0x7a95('0x49')]['id']){delete _0x2e6196[_0x7a95('0x49')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x2e6196[_0x7a95('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ea155,null))['then'](saveUpdates(_0x2e6196[_0x7a95('0x49')],null))['then'](respondWithResult(_0x4ea155,null))[_0x7a95('0x45')](handleError(_0x4ea155,null));};exports[_0x7a95('0x24')]=function(_0x281940,_0x52319f){return db[_0x7a95('0x2b')][_0x7a95('0x47')]({'where':{'id':_0x281940[_0x7a95('0x4b')]['id']}})[_0x7a95('0x23')](handleEntityNotFound(_0x52319f,null))['then'](removeEntity(_0x52319f,null))[_0x7a95('0x45')](handleError(_0x52319f,null));};exports[_0x7a95('0x4c')]=function(_0x4c25e0,_0x5469e0){return db[_0x7a95('0x2b')][_0x7a95('0x4c')]()[_0x7a95('0x23')](respondWithResult(_0x5469e0,null))['catch'](handleError(_0x5469e0,null));};function wrapUser(_0x508f91){return function(_0x392907){var _0x532439=_0x508f91['get']({'plain':!![]});_0x532439[_0x7a95('0x4d')]=[];if(_0x392907){_0x532439['lastMessageAt']=_0x392907[_0x7a95('0x4e')];_0x532439['lastMessage']=_0x392907;}else{_0x532439['lastMessageAt']=moment(0x0)[_0x7a95('0x4f')](_0x7a95('0x50'));_0x532439['lastMessage']={};}return _0x532439;};}exports[_0x7a95('0x51')]=function(_0x2e2c59,_0x5e65ed,_0x4d6983){var _0x5d9cb0=[];return db['User'][_0x7a95('0x43')]({'where':{'role':['agent',_0x7a95('0x52'),_0x7a95('0x53')]},'attributes':['id',_0x7a95('0x54'),_0x7a95('0x28'),_0x7a95('0x55'),_0x7a95('0x56'),'internal',_0x7a95('0x57'),_0x7a95('0x58'),_0x7a95('0x59'),_0x7a95('0x5a')],'order':qs[_0x7a95('0x3a')](_0x7a95('0x5b')),'include':[{'model':db['VoiceQueue'],'as':_0x7a95('0x5c'),'attributes':['id',_0x7a95('0x28'),_0x7a95('0x2e')],'through':{'attributes':[]}}]})['then'](function(_0x4c90dc){if(_0x4c90dc){var _0x11e47f=_0x2e2c59[_0x7a95('0x53')][_0x7a95('0x5d')]({'plain':!![]});if(!_0x11e47f)throw new Error(_0x7a95('0x5e'));if(_0x11e47f[_0x7a95('0x55')]===_0x7a95('0x53')){return db[_0x7a95('0x5f')][_0x7a95('0x47')]({'where':{'name':_0x7a95('0x60'),'userProfileId':_0x11e47f[_0x7a95('0x61')]},'raw':!![]})[_0x7a95('0x23')](function(_0x39b5ab){if(_0x39b5ab){if(_0x39b5ab[_0x7a95('0x62')]===0x0){return db[_0x7a95('0x63')][_0x7a95('0x43')]({'where':{'sectionId':_0x39b5ab['id']},'raw':!![]})['then'](function(_0x414ac7){var _0x248ac0=[];if(_[_0x7a95('0x64')](_0x414ac7)){_0x248ac0=_[_0x7a95('0x3d')](_0x4c90dc,function(_0x1dd6a2){if(_0x1dd6a2['role']!==_0x7a95('0x65')){return _0x1dd6a2;}});return _0x248ac0;}else{for(var _0x35ad70=0x0;_0x35ad70<_0x4c90dc[_0x7a95('0x36')];_0x35ad70++){var _0x19158e=_0x4c90dc[_0x35ad70];if(_0x19158e[_0x7a95('0x55')]===_0x7a95('0x65')){var _0x2cf9ed=_[_0x7a95('0x47')](_0x414ac7,function(_0x209fe5){return _0x209fe5['resourceId']===_0x19158e['id'];});if(_0x2cf9ed)_0x248ac0['push'](_0x19158e);}else{_0x248ac0['push'](_0x19158e);}}return _0x248ac0;}});}else{return _0x4c90dc;}}else{var _0x987159=_[_0x7a95('0x3d')](_0x4c90dc,function(_0x2942b7){if(_0x2942b7['role']!==_0x7a95('0x65')){return _0x2942b7;}});return _0x987159;}});}else{return _0x4c90dc;}}})['then'](function(_0x213680){var _0x7d41ff=[];if(_0x213680){_0x5d9cb0=_0x213680;for(var _0x4e327a=0x0;_0x4e327a<_0x213680[_0x7a95('0x36')];_0x4e327a+=0x1){_0x5d9cb0[_0x4e327a]['messages']=[];_0x7d41ff[_0x7a95('0x66')](db['ChatInternalMessage'][_0x7a95('0x47')]({'where':{'FromId':[_0x2e2c59['user']['id'],_0x213680[_0x4e327a]['id']],'ToId':[_0x2e2c59['user']['id'],_0x213680[_0x4e327a]['id']],'ChatGroupId':null},'attributes':['id',_0x7a95('0x4e'),_0x7a95('0x67'),'ToId',_0x7a95('0x68'),_0x7a95('0x49')],'order':qs[_0x7a95('0x3a')](_0x7a95('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7a95('0x23')](wrapUser(_0x213680[_0x4e327a])));}return BPromise[_0x7a95('0x6a')](_0x7d41ff);}return[];})['then'](function(_0x10491e){return{'rows':_0x10491e,'count':_0x10491e[_0x7a95('0x36')]};})['then'](respondWithResult(_0x5e65ed,null))[_0x7a95('0x45')](handleError(_0x5e65ed,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 364bf17..1d1f930 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 _0x1e41=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','save','update'];(function(_0x3925ff,_0x3fe6e5){var _0x1f16d5=function(_0xc538a2){while(--_0xc538a2){_0x3925ff['push'](_0x3925ff['shift']());}};_0x1f16d5(++_0x3fe6e5);}(_0x1e41,0x11c));var _0x11e4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x1e41[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x11e4('0x0'))['db'][_0x11e4('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x11e4('0x2'),'afterUpdate':_0x11e4('0x3'),'afterDestroy':_0x11e4('0x4')};function emitEvent(_0x3801b8){return function(_0x4a27c7,_0x887911,_0x50b974){ChatInternalMessageEvents[_0x11e4('0x5')](_0x3801b8+':'+_0x4a27c7['id'],_0x4a27c7);ChatInternalMessageEvents['emit'](_0x3801b8,_0x4a27c7);_0x50b974(null);};}for(var e in events){if(events[_0x11e4('0x6')](e)){var event=events[e];ChatInternalMessage[_0x11e4('0x7')](e,emitEvent(event));}}module[_0x11e4('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x137b=['exports','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x360d0c,_0x5ea257){var _0x419c20=function(_0x36cd39){while(--_0x36cd39){_0x360d0c['push'](_0x360d0c['shift']());}};_0x419c20(++_0x5ea257);}(_0x137b,0xac));var _0xb137=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x137b[_0x47c6b9];return _0x34f34d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require('../../mysqldb')['db'][_0xb137('0x0')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb137('0x1')](0x0);var events={'afterCreate':_0xb137('0x2'),'afterUpdate':_0xb137('0x3'),'afterDestroy':_0xb137('0x4')};function emitEvent(_0x5b4a51){return function(_0x45db83,_0x198c24,_0x3519d8){ChatInternalMessageEvents[_0xb137('0x5')](_0x5b4a51+':'+_0x45db83['id'],_0x45db83);ChatInternalMessageEvents['emit'](_0x5b4a51,_0x45db83);_0x3519d8(null);};}for(var e in events){if(events[_0xb137('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb137('0x7')](e,emitEvent(event));}}module[_0xb137('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 38785e2..2a1238b 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 _0xacd9=['define','chat_internal_messages','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacd9,0x81));var _0x9acd=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xacd9[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x9acd('0x0'));var util=require(_0x9acd('0x1'));var logger=require(_0x9acd('0x2'))(_0x9acd('0x3'));var moment=require(_0x9acd('0x4'));var BPromise=require(_0x9acd('0x5'));var rp=require(_0x9acd('0x6'));var fs=require('fs');var path=require(_0x9acd('0x7'));var rimraf=require(_0x9acd('0x8'));var config=require(_0x9acd('0x9'));var attributes=require(_0x9acd('0xa'));module['exports']=function(_0x5b36c2,_0x115f0a){return _0x5b36c2[_0x9acd('0xb')]('ChatInternalMessage',attributes,{'tableName':_0x9acd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9acd('0xd')});}; \ No newline at end of file +var _0x94f1=['utf8mb4','lodash','util','api','moment','path','rimraf','./chatInternalMessage.attributes','exports','ChatInternalMessage','chat_internal_messages'];(function(_0x4dbe47,_0x325ef7){var _0x2fe4c5=function(_0x1f2fc8){while(--_0x1f2fc8){_0x4dbe47['push'](_0x4dbe47['shift']());}};_0x2fe4c5(++_0x325ef7);}(_0x94f1,0x7a));var _0x194f=function(_0x380c37,_0x57d3d1){_0x380c37=_0x380c37-0x0;var _0x47d664=_0x94f1[_0x380c37];return _0x47d664;};'use strict';var _=require(_0x194f('0x0'));var util=require(_0x194f('0x1'));var logger=require('../../config/logger')(_0x194f('0x2'));var moment=require(_0x194f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x194f('0x4'));var rimraf=require(_0x194f('0x5'));var config=require('../../config/environment');var attributes=require(_0x194f('0x6'));module[_0x194f('0x7')]=function(_0x55bd8b,_0x2db490){return _0x55bd8b['define'](_0x194f('0x8'),attributes,{'tableName':_0x194f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x194f('0xa'),'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 494ed98..1a8de02 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 _0x858a=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','register','request','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatInternalMessage,\x20%s,\x20%s','message'];(function(_0x2f3226,_0x2b0272){var _0x16ebcc=function(_0x1a3fd9){while(--_0x1a3fd9){_0x2f3226['push'](_0x2f3226['shift']());}};_0x16ebcc(++_0x2b0272);}(_0x858a,0x1a2));var _0xa858=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x858a[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xa858('0x0'));var util=require(_0xa858('0x1'));var moment=require(_0xa858('0x2'));var BPromise=require(_0xa858('0x3'));var rs=require(_0xa858('0x4'));var fs=require('fs');var Redis=require(_0xa858('0x5'));var db=require(_0xa858('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa858('0x7'))(_0xa858('0x8'));var config=require(_0xa858('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa858('0xa')]({'port':0x232a});config['redis']=_[_0xa858('0xb')](config[_0xa858('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa858('0xd'))(new Redis(config[_0xa858('0xc')]));require('./chatInternalMessage.socket')[_0xa858('0xe')](socket);function respondWithRpcPromise(_0x34d72b,_0x57d8dc,_0x2c16bc){return new BPromise(function(_0x3b0ee6,_0x2d7a98){return client[_0xa858('0xf')](_0x34d72b,_0x2c16bc)['then'](function(_0x352f7d){logger[_0xa858('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x57d8dc,'request\x20sent');logger[_0xa858('0x11')](_0xa858('0x12'),_0x57d8dc,_0xa858('0x13'),JSON[_0xa858('0x14')](_0x352f7d));if(_0x352f7d[_0xa858('0x15')]){if(_0x352f7d[_0xa858('0x15')]['code']===0x1f4){logger[_0xa858('0x15')](_0xa858('0x16'),_0x57d8dc,_0x352f7d[_0xa858('0x15')]['message']);return _0x2d7a98(_0x352f7d['error']['message']);}logger[_0xa858('0x15')](_0xa858('0x16'),_0x57d8dc,_0x352f7d['error'][_0xa858('0x17')]);return _0x3b0ee6(_0x352f7d[_0xa858('0x15')][_0xa858('0x17')]);}else{logger[_0xa858('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x57d8dc,_0xa858('0x13'));_0x3b0ee6(_0x352f7d[_0xa858('0x18')][_0xa858('0x17')]);}})[_0xa858('0x19')](function(_0x1def8c){logger['error'](_0xa858('0x16'),_0x57d8dc,_0x1def8c);_0x2d7a98(_0x1def8c);});});} \ No newline at end of file +var _0x209f=['code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x1024a7,_0x4fd745){var _0x30b2b2=function(_0x258595){while(--_0x258595){_0x1024a7['push'](_0x1024a7['shift']());}};_0x30b2b2(++_0x4fd745);}(_0x209f,0x199));var _0xf209=function(_0x1958f0,_0x15ab19){_0x1958f0=_0x1958f0-0x0;var _0x252936=_0x209f[_0x1958f0];return _0x252936;};'use strict';var _=require(_0xf209('0x0'));var util=require('util');var moment=require(_0xf209('0x1'));var BPromise=require(_0xf209('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf209('0x3'));var db=require(_0xf209('0x4'))['db'];var utils=require(_0xf209('0x5'));var logger=require('../../config/logger')(_0xf209('0x6'));var config=require(_0xf209('0x7'));var jayson=require(_0xf209('0x8'));var client=jayson[_0xf209('0x9')][_0xf209('0xa')]({'port':0x232a});config['redis']=_[_0xf209('0xb')](config[_0xf209('0xc')],{'host':_0xf209('0xd'),'port':0x18eb});var socket=require(_0xf209('0xe'))(new Redis(config[_0xf209('0xc')]));require(_0xf209('0xf'))['register'](socket);function respondWithRpcPromise(_0x212cdd,_0x13e491,_0x471736){return new BPromise(function(_0x19a62a,_0x517aa4){return client[_0xf209('0x10')](_0x212cdd,_0x471736)[_0xf209('0x11')](function(_0x6eb857){logger[_0xf209('0x12')](_0xf209('0x13'),_0x13e491,_0xf209('0x14'));logger[_0xf209('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x13e491,'request\x20sent',JSON['stringify'](_0x6eb857));if(_0x6eb857[_0xf209('0x16')]){if(_0x6eb857[_0xf209('0x16')][_0xf209('0x17')]===0x1f4){logger['error'](_0xf209('0x13'),_0x13e491,_0x6eb857[_0xf209('0x16')][_0xf209('0x18')]);return _0x517aa4(_0x6eb857['error']['message']);}logger[_0xf209('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e491,_0x6eb857[_0xf209('0x16')][_0xf209('0x18')]);return _0x19a62a(_0x6eb857['error']['message']);}else{logger[_0xf209('0x12')](_0xf209('0x13'),_0x13e491,_0xf209('0x14'));_0x19a62a(_0x6eb857[_0xf209('0x19')][_0xf209('0x18')]);}})[_0xf209('0x1a')](function(_0x3fc4fa){logger[_0xf209('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x13e491,_0x3fc4fa);_0x517aa4(_0x3fc4fa);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 17331a6..82665ee 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 _0x40e1=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x5ddda9,_0x43e558){var _0x53a004=function(_0x2794a1){while(--_0x2794a1){_0x5ddda9['push'](_0x5ddda9['shift']());}};_0x53a004(++_0x43e558);}(_0x40e1,0xfc));var _0x140e=function(_0x45bee0,_0x42bf09){_0x45bee0=_0x45bee0-0x0;var _0x1fcfd5=_0x40e1[_0x45bee0];return _0x1fcfd5;};'use strict';var ChatInternalMessageEvents=require(_0x140e('0x0'));var events=[_0x140e('0x1'),_0x140e('0x2'),_0x140e('0x3')];function createListener(_0x243c58,_0x39fbc7){return function(_0x436e5c){_0x39fbc7['emit'](_0x243c58,_0x436e5c);};}function removeListener(_0x40c402,_0x1785c3){return function(){ChatInternalMessageEvents[_0x140e('0x4')](_0x40c402,_0x1785c3);};}exports[_0x140e('0x5')]=function(_0x3b1dce){for(var _0x4e89fa=0x0,_0x1d65d8=events[_0x140e('0x6')];_0x4e89fa<_0x1d65d8;_0x4e89fa++){var _0x3cee26=events[_0x4e89fa];var _0x333b1e=createListener(_0x140e('0x7')+_0x3cee26,_0x3b1dce);ChatInternalMessageEvents['on'](_0x3cee26,_0x333b1e);}}; \ No newline at end of file +var _0x04ba=['./chatInternalMessage.events','remove','register','length'];(function(_0x5b9231,_0x2181c6){var _0x1f7959=function(_0xa1620d){while(--_0xa1620d){_0x5b9231['push'](_0x5b9231['shift']());}};_0x1f7959(++_0x2181c6);}(_0x04ba,0x14c));var _0xa04b=function(_0x270485,_0x455f1e){_0x270485=_0x270485-0x0;var _0x20fa79=_0x04ba[_0x270485];return _0x20fa79;};'use strict';var ChatInternalMessageEvents=require(_0xa04b('0x0'));var events=['save',_0xa04b('0x1'),'update'];function createListener(_0x1025dc,_0x35ed23){return function(_0x10fa3f){_0x35ed23['emit'](_0x1025dc,_0x10fa3f);};}function removeListener(_0x33276b,_0x33d4d3){return function(){ChatInternalMessageEvents['removeListener'](_0x33276b,_0x33d4d3);};}exports[_0xa04b('0x2')]=function(_0x3bc9be){for(var _0x2cd468=0x0,_0x331e81=events[_0xa04b('0x3')];_0x2cd468<_0x331e81;_0x2cd468++){var _0xe1c3d8=events[_0x2cd468];var _0x523a9e=createListener('chatInternalMessage:'+_0xe1c3d8,_0x3bc9be);ChatInternalMessageEvents['on'](_0xe1c3d8,_0x523a9e);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3f32203..f5f2fc2 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 _0x11be=['update','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','describe','/users','getUsers','/:id','show','post','put'];(function(_0x34b1b8,_0x54c9bf){var _0x542dd8=function(_0xff3f89){while(--_0xff3f89){_0x34b1b8['push'](_0x34b1b8['shift']());}};_0x542dd8(++_0x54c9bf);}(_0x11be,0x67));var _0xe11b=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x11be[_0x483102];return _0x5cc885;};'use strict';var multer=require(_0xe11b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe11b('0x1'));var router=express[_0xe11b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe11b('0x3'));var interaction=require(_0xe11b('0x4'));var config=require(_0xe11b('0x5'));var controller=require(_0xe11b('0x6'));router[_0xe11b('0x7')]('/',auth[_0xe11b('0x8')](),controller[_0xe11b('0x9')]);router[_0xe11b('0x7')]('/describe',auth[_0xe11b('0x8')](),controller[_0xe11b('0xa')]);router[_0xe11b('0x7')](_0xe11b('0xb'),auth[_0xe11b('0x8')](),controller[_0xe11b('0xc')]);router[_0xe11b('0x7')](_0xe11b('0xd'),auth[_0xe11b('0x8')](),controller[_0xe11b('0xe')]);router[_0xe11b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe11b('0x10')](_0xe11b('0xd'),controller[_0xe11b('0x11')]);router['delete'](_0xe11b('0xd'),auth[_0xe11b('0x8')](),controller[_0xe11b('0x12')]);module[_0xe11b('0x13')]=router; \ No newline at end of file +var _0xcb88=['getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcb88,0x1ea));var _0x8cb8=function(_0x204728,_0x200843){_0x204728=_0x204728-0x0;var _0x36c979=_0xcb88[_0x204728];return _0x36c979;};'use strict';var multer=require(_0x8cb8('0x0'));var util=require(_0x8cb8('0x1'));var path=require(_0x8cb8('0x2'));var timeout=require(_0x8cb8('0x3'));var express=require(_0x8cb8('0x4'));var router=express[_0x8cb8('0x5')]();var fs_extra=require(_0x8cb8('0x6'));var auth=require(_0x8cb8('0x7'));var interaction=require(_0x8cb8('0x8'));var config=require(_0x8cb8('0x9'));var controller=require('./chatInternalMessage.controller');router[_0x8cb8('0xa')]('/',auth[_0x8cb8('0xb')](),controller[_0x8cb8('0xc')]);router['get'](_0x8cb8('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x8cb8('0xa')]('/users',auth['isAuthenticated'](),controller[_0x8cb8('0xe')]);router[_0x8cb8('0xa')](_0x8cb8('0xf'),auth[_0x8cb8('0xb')](),controller[_0x8cb8('0x10')]);router[_0x8cb8('0x11')]('/',auth['isAuthenticated'](),controller[_0x8cb8('0x12')]);router[_0x8cb8('0x13')](_0x8cb8('0xf'),controller[_0x8cb8('0x14')]);router[_0x8cb8('0x15')](_0x8cb8('0xf'),auth['isAuthenticated'](),controller[_0x8cb8('0x16')]);module[_0x8cb8('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 8efe0a5..1bb62e1 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 _0x4fc2=['out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x4fc2,0x111));var _0x24fc=function(_0x1d6f1e,_0x22a3f2){_0x1d6f1e=_0x1d6f1e-0x0;var _0xc74a85=_0x4fc2[_0x1d6f1e];return _0xc74a85;};'use strict';var Sequelize=require(_0x24fc('0x0'));module[_0x24fc('0x1')]={'body':{'type':Sequelize[_0x24fc('0x2')](_0x24fc('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x24fc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x24fc('0x5')]('in',_0x24fc('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x24fc('0x7')]},'providerName':{'type':Sequelize[_0x24fc('0x8')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4b17=['STRING','sequelize','TEXT','BOOLEAN','out'];(function(_0x2d4946,_0x422382){var _0x1905a1=function(_0x19e1c5){while(--_0x19e1c5){_0x2d4946['push'](_0x2d4946['shift']());}};_0x1905a1(++_0x422382);}(_0x4b17,0x10f));var _0x74b1=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x4b17[_0x545bed];return _0x16c79c;};'use strict';var Sequelize=require(_0x74b1('0x0'));module['exports']={'body':{'type':Sequelize[_0x74b1('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x74b1('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x74b1('0x3')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x74b1('0x4')]},'providerResponse':{'type':Sequelize[_0x74b1('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 38d95d7..e15c3ee 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 _0x5a74=['ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','info','user','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','manual','interface','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','internal','SIP/%s','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','redis','localhost','socket.io-emitter','./chatMessage.socket','register','http','client','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','limit','count','offset','set','apply','reject','save','update','destroy','stack','name','send','map','ChatMessage','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','findAll','rows','show','params','options','create','body','find','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get'];(function(_0x11a444,_0x29ce63){var _0x2bdfca=function(_0x95f24c){while(--_0x95f24c){_0x11a444['push'](_0x11a444['shift']());}};_0x2bdfca(++_0x29ce63);}(_0x5a74,0xac));var _0x45a7=function(_0x18d8e9,_0x2d9568){_0x18d8e9=_0x18d8e9-0x0;var _0x1b9102=_0x5a74[_0x18d8e9];return _0x1b9102;};'use strict';var emlformat=require(_0x45a7('0x0'));var rimraf=require(_0x45a7('0x1'));var zipdir=require(_0x45a7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x45a7('0x3'));var moment=require(_0x45a7('0x4'));var BPromise=require(_0x45a7('0x5'));var Mustache=require(_0x45a7('0x6'));var util=require(_0x45a7('0x7'));var path=require(_0x45a7('0x8'));var sox=require(_0x45a7('0x9'));var csv=require(_0x45a7('0xa'));var ejs=require(_0x45a7('0xb'));var fs=require('fs');var fs_extra=require(_0x45a7('0xc'));var _=require('lodash');var squel=require(_0x45a7('0xd'));var crypto=require('crypto');var jsforce=require(_0x45a7('0xe'));var deskjs=require(_0x45a7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x45a7('0x10'));var Papa=require('papaparse');var Redis=require(_0x45a7('0x11'));var authService=require(_0x45a7('0x12'));var qs=require(_0x45a7('0x13'));var as=require(_0x45a7('0x14'));var hardwareService=require(_0x45a7('0x15'));var logger=require(_0x45a7('0x16'))(_0x45a7('0x17'));var utils=require(_0x45a7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x45a7('0x19'));var db=require(_0x45a7('0x1a'))['db'];config[_0x45a7('0x1b')]=_['defaults'](config[_0x45a7('0x1b')],{'host':_0x45a7('0x1c'),'port':0x18eb});var socket=require(_0x45a7('0x1d'))(new Redis(config['redis']));require(_0x45a7('0x1e'))[_0x45a7('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x45a7('0x20')]({'port':0x232c});var client9002=jayson[_0x45a7('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe2bca6,_0x3d5438,_0x4df71c,_0x1d2df1){return new BPromise(function(_0x42824a,_0x54c6a7){var _0x13e356=_0x1d2df1||client;return _0x13e356[_0x45a7('0x22')](_0xe2bca6,_0x4df71c)[_0x45a7('0x23')](function(_0x38f4e0){logger['info'](_0x45a7('0x24'),_0x3d5438,_0x45a7('0x25'));logger[_0x45a7('0x26')](_0x45a7('0x27'),_0x3d5438,_0x45a7('0x25'),JSON[_0x45a7('0x28')](_0x38f4e0));if(_0x38f4e0[_0x45a7('0x29')]){if(_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2a')]===0x1f4){logger[_0x45a7('0x29')]('ChatMessage,\x20%s,\x20%s',_0x3d5438,_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2b')]);return _0x54c6a7(_0x38f4e0['error'][_0x45a7('0x2b')]);}logger['error'](_0x45a7('0x24'),_0x3d5438,_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2b')]);return _0x42824a(_0x38f4e0[_0x45a7('0x29')][_0x45a7('0x2b')]);}else{logger['info'](_0x45a7('0x24'),_0x3d5438,'request\x20sent');_0x42824a(_0x38f4e0['result'][_0x45a7('0x2b')]);}})[_0x45a7('0x2c')](function(_0x5609b0){logger[_0x45a7('0x29')](_0x45a7('0x24'),_0x3d5438,_0x5609b0);_0x54c6a7(_0x5609b0);});});}function respondWithStatusCode(_0x5b565b,_0x563413){_0x563413=_0x563413||0xcc;return function(_0x4845ce){if(_0x4845ce){return _0x5b565b[_0x45a7('0x2d')](_0x563413);}return _0x5b565b[_0x45a7('0x2e')](_0x563413)[_0x45a7('0x2f')]();};}function respondWithResult(_0x52c8b3,_0x20c313){_0x20c313=_0x20c313||0xc8;return function(_0x1ec66e){if(_0x1ec66e){return _0x52c8b3[_0x45a7('0x2e')](_0x20c313)['json'](_0x1ec66e);}};}function respondWithFilteredResult(_0x3e295c,_0x31c0fc){return function(_0x2131c6){if(_0x2131c6){var _0x3ac017=typeof _0x31c0fc['offset']==='undefined'&&typeof _0x31c0fc[_0x45a7('0x30')]==='undefined';var _0xf8f331=_0x2131c6[_0x45a7('0x31')];var _0x445718=_0x3ac017?0x0:_0x31c0fc[_0x45a7('0x32')];var _0x1864e9=_0x3ac017?_0x2131c6['count']:_0x31c0fc['offset']+_0x31c0fc[_0x45a7('0x30')];var _0x96ba98;if(_0x1864e9>=_0xf8f331){_0x1864e9=_0xf8f331;_0x96ba98=0xc8;}else{_0x96ba98=0xce;}_0x3e295c[_0x45a7('0x2e')](_0x96ba98);return _0x3e295c[_0x45a7('0x33')]('Content-Range',_0x445718+'-'+_0x1864e9+'/'+_0xf8f331)['json'](_0x2131c6);}return null;};}function patchUpdates(_0x58c05f){return function(_0x3741af){try{jsonpatch[_0x45a7('0x34')](_0x3741af,_0x58c05f,!![]);}catch(_0x4413d6){return BPromise[_0x45a7('0x35')](_0x4413d6);}return _0x3741af[_0x45a7('0x36')]();};}function saveUpdates(_0x4d8da2,_0xcda0f){return function(_0x1d2493){if(_0x1d2493){return _0x1d2493[_0x45a7('0x37')](_0x4d8da2)['then'](function(_0x5daf01){return _0x5daf01;});}return null;};}function removeEntity(_0x5d3319,_0x152112){return function(_0x1edd21){if(_0x1edd21){return _0x1edd21[_0x45a7('0x38')]()[_0x45a7('0x23')](function(){_0x5d3319[_0x45a7('0x2e')](0xcc)[_0x45a7('0x2f')]();});}};}function handleEntityNotFound(_0x2e456a,_0x31c53f){return function(_0x535d43){if(!_0x535d43){_0x2e456a[_0x45a7('0x2d')](0x194);}return _0x535d43;};}function handleError(_0x536f6b,_0x5e9b9a){_0x5e9b9a=_0x5e9b9a||0x1f4;return function(_0x5efe96){logger[_0x45a7('0x29')](_0x5efe96[_0x45a7('0x39')]);if(_0x5efe96[_0x45a7('0x3a')]){delete _0x5efe96[_0x45a7('0x3a')];}_0x536f6b[_0x45a7('0x2e')](_0x5e9b9a)[_0x45a7('0x3b')](_0x5efe96);};}exports['index']=function(_0x4fae5d,_0x2439b7){var _0x4f8817={},_0x5b52bd={},_0x45f72f={'count':0x0,'rows':[]};var _0x1e25b8=_[_0x45a7('0x3c')](db[_0x45a7('0x3d')][_0x45a7('0x3e')],function(_0x287231){return{'name':_0x287231[_0x45a7('0x3f')],'type':_0x287231[_0x45a7('0x40')]['key']};});_0x5b52bd[_0x45a7('0x41')]=_[_0x45a7('0x3c')](_0x1e25b8,_0x45a7('0x3a'));_0x5b52bd['query']=_[_0x45a7('0x42')](_0x4fae5d[_0x45a7('0x43')]);_0x5b52bd['filters']=_[_0x45a7('0x44')](_0x5b52bd[_0x45a7('0x41')],_0x5b52bd['query']);_0x4f8817[_0x45a7('0x45')]=_[_0x45a7('0x44')](_0x5b52bd[_0x45a7('0x41')],qs[_0x45a7('0x46')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x46')]));_0x4f8817[_0x45a7('0x45')]=_0x4f8817[_0x45a7('0x45')][_0x45a7('0x47')]?_0x4f8817['attributes']:_0x5b52bd['model'];if(!_0x4fae5d['query'][_0x45a7('0x48')](_0x45a7('0x49'))){_0x4f8817[_0x45a7('0x30')]=qs[_0x45a7('0x30')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x30')]);_0x4f8817[_0x45a7('0x32')]=qs[_0x45a7('0x32')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x32')]);}_0x4f8817[_0x45a7('0x4a')]=qs[_0x45a7('0x4b')](_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x4b')]);_0x4f8817[_0x45a7('0x4c')]=qs[_0x45a7('0x4d')](_['pick'](_0x4fae5d[_0x45a7('0x43')],_0x5b52bd['filters']),_0x1e25b8);if(_0x4fae5d['query'][_0x45a7('0x4e')]){_0x4f8817[_0x45a7('0x4c')]=_['merge'](_0x4f8817[_0x45a7('0x4c')],{'$or':_[_0x45a7('0x3c')](_0x1e25b8,function(_0x47ffd9){if(_0x47ffd9[_0x45a7('0x40')]!=='VIRTUAL'){var _0xda4cbb={};_0xda4cbb[_0x47ffd9[_0x45a7('0x3a')]]={'$like':'%'+_0x4fae5d['query']['filter']+'%'};return _0xda4cbb;}})});}_0x4f8817=_[_0x45a7('0x4f')]({},_0x4f8817,_0x4fae5d['options']);var _0x579698={'where':_0x4f8817[_0x45a7('0x4c')]};return db[_0x45a7('0x3d')]['count'](_0x579698)[_0x45a7('0x23')](function(_0x23dd42){_0x45f72f[_0x45a7('0x31')]=_0x23dd42;if(_0x4fae5d[_0x45a7('0x43')][_0x45a7('0x50')]){_0x4f8817[_0x45a7('0x51')]=[{'all':!![]}];}return db[_0x45a7('0x3d')][_0x45a7('0x52')](_0x4f8817);})[_0x45a7('0x23')](function(_0x59631a){_0x45f72f[_0x45a7('0x53')]=_0x59631a;return _0x45f72f;})['then'](respondWithFilteredResult(_0x2439b7,_0x4f8817))['catch'](handleError(_0x2439b7,null));};exports[_0x45a7('0x54')]=function(_0x2ef17d,_0x106469){var _0x473211={'raw':!![],'where':{'id':_0x2ef17d[_0x45a7('0x55')]['id']}},_0x5be26e={};_0x5be26e[_0x45a7('0x41')]=_[_0x45a7('0x42')](db[_0x45a7('0x3d')]['rawAttributes']);_0x5be26e[_0x45a7('0x43')]=_[_0x45a7('0x42')](_0x2ef17d[_0x45a7('0x43')]);_0x5be26e[_0x45a7('0x4d')]=_[_0x45a7('0x44')](_0x5be26e['model'],_0x5be26e[_0x45a7('0x43')]);_0x473211[_0x45a7('0x45')]=_['intersection'](_0x5be26e[_0x45a7('0x41')],qs[_0x45a7('0x46')](_0x2ef17d[_0x45a7('0x43')][_0x45a7('0x46')]));_0x473211[_0x45a7('0x45')]=_0x473211[_0x45a7('0x45')][_0x45a7('0x47')]?_0x473211[_0x45a7('0x45')]:_0x5be26e[_0x45a7('0x41')];if(_0x2ef17d['query'][_0x45a7('0x50')]){_0x473211[_0x45a7('0x51')]=[{'all':!![]}];}_0x473211=_[_0x45a7('0x4f')]({},_0x473211,_0x2ef17d[_0x45a7('0x56')]);return db[_0x45a7('0x3d')]['find'](_0x473211)[_0x45a7('0x23')](handleEntityNotFound(_0x106469,null))[_0x45a7('0x23')](respondWithResult(_0x106469,null))['catch'](handleError(_0x106469,null));};exports[_0x45a7('0x57')]=function(_0x59fed1,_0x56c638){return db[_0x45a7('0x3d')][_0x45a7('0x57')](_0x59fed1[_0x45a7('0x58')],{})[_0x45a7('0x23')](respondWithResult(_0x56c638,0xc9))['catch'](handleError(_0x56c638,null));};exports[_0x45a7('0x37')]=function(_0x3dbf9e,_0x15b32d){if(_0x3dbf9e[_0x45a7('0x58')]['id']){delete _0x3dbf9e[_0x45a7('0x58')]['id'];}return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x3dbf9e[_0x45a7('0x55')]['id']}})['then'](handleEntityNotFound(_0x15b32d,null))[_0x45a7('0x23')](saveUpdates(_0x3dbf9e[_0x45a7('0x58')],null))[_0x45a7('0x23')](respondWithResult(_0x15b32d,null))[_0x45a7('0x2c')](handleError(_0x15b32d,null));};exports[_0x45a7('0x38')]=function(_0x84d97e,_0x252d7f){return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x84d97e[_0x45a7('0x55')]['id']}})[_0x45a7('0x23')](handleEntityNotFound(_0x252d7f,null))[_0x45a7('0x23')](removeEntity(_0x252d7f,null))[_0x45a7('0x2c')](handleError(_0x252d7f,null));};exports[_0x45a7('0x5a')]=function(_0x2ed4fe,_0x2e5923){return db[_0x45a7('0x3d')]['describe']()[_0x45a7('0x23')](respondWithResult(_0x2e5923,null))['catch'](handleError(_0x2e5923,null));};var interaction_log=require(_0x45a7('0x16'))(_0x45a7('0x5b'));exports[_0x45a7('0x5c')]=function(_0x27cee5,_0x13be16,_0x11f8ad){var _0xb6b0a2={'agent':{},'channel':_0x45a7('0x5d')};if(_0x27cee5[_0x45a7('0x58')]['id']){delete _0x27cee5[_0x45a7('0x58')]['id'];}_0x27cee5[_0x45a7('0x58')][_0x45a7('0x5e')]=!![];_0x27cee5['body']['readAt']=moment()[_0x45a7('0x5f')](_0x45a7('0x60'));_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')]=_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')]||_0x27cee5['user']['id'];_0xb6b0a2[_0x45a7('0x62')]['id']=_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')];return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x27cee5['params']['id'],'UserId':null}})[_0x45a7('0x23')](handleEntityNotFound(_0x13be16,null))['then'](saveUpdates(_0x27cee5[_0x45a7('0x58')],null))['then'](function(_0x5b1687){if(_0x5b1687){_0xb6b0a2[_0x45a7('0x2b')]=_0x5b1687[_0x45a7('0x63')]({'plain':!![]});return db[_0x45a7('0x64')][_0x45a7('0x59')]({'where':{'id':_0x5b1687[_0x45a7('0x65')]}});}return null;})[_0x45a7('0x23')](handleEntityNotFound(_0x13be16,null))['then'](function(_0x283dcb){if(_0x283dcb){return _0x283dcb['update']({'UserId':_0x27cee5['body'][_0x45a7('0x61')],'read1stAt':_[_0x45a7('0x66')](_0x283dcb[_0x45a7('0x67')])?moment()[_0x45a7('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x45a7('0x23')](function(_0x39d85b){if(_0x39d85b){_0xb6b0a2[_0x45a7('0x68')]=_0x39d85b[_0x45a7('0x63')]({'plain':!![]});interaction_log[_0x45a7('0x69')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x27cee5[_0x45a7('0x6a')]['id'],_0x27cee5['user']['name'],_0x27cee5[_0x45a7('0x6a')]['role'],_0xb6b0a2[_0x45a7('0x68')]['id'],_0x27cee5['body']?JSON[_0x45a7('0x28')](_0x27cee5[_0x45a7('0x58')]):'null');return respondWithRpcPromise(_0x45a7('0x6b'),_0x45a7('0x6c'),_0xb6b0a2);}return null;})[_0x45a7('0x23')](function(_0x14b546){var _0x339a58='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x14b546[_0x45a7('0x2b')][_0x45a7('0x6d')];return db[_0x45a7('0x6e')][_0x45a7('0x43')](_0x339a58,{'type':db[_0x45a7('0x6f')][_0x45a7('0x70')]['SELECT'],'raw':!![]})['then'](function(_0x426638){return _0x426638;});})[_0x45a7('0x23')](function(_0x749dd9){if(_0x749dd9){_0xb6b0a2[_0x45a7('0x2b')][_0x45a7('0x71')]=_0x749dd9[0x0];if(!_0x27cee5[_0x45a7('0x58')][_0x45a7('0x61')])return;return db[_0x45a7('0x72')][_0x45a7('0x59')]({'where':{'id':_0x27cee5[_0x45a7('0x58')]['UserId'],'role':_0x45a7('0x62')},'attributes':['id','name',_0x45a7('0x73'),_0x45a7('0x74'),'internal'],'raw':!![]});}return null;})[_0x45a7('0x23')](function(_0x38921b){if(!_0x38921b)return null;_0xb6b0a2['message'][_0x45a7('0x62')]=_0x38921b;return _0xb6b0a2;})['then'](function(_0x528999){if(_0x528999){if(_0x27cee5[_0x45a7('0x58')][_0x45a7('0x75')]){_0xb6b0a2[_0x45a7('0x2b')][_0x45a7('0x76')]=util[_0x45a7('0x5f')]('SIP/%s',_0x27cee5[_0x45a7('0x6a')][_0x45a7('0x3a')]);_0xb6b0a2[_0x45a7('0x2b')]['channel']=_0xb6b0a2[_0x45a7('0x77')];_0xb6b0a2[_0x45a7('0x2b')]['motionChannel']=_0xb6b0a2[_0x45a7('0x77')];_0xb6b0a2['message'][_0x45a7('0x78')]=_0x45a7('0x5c');return respondWithRpcPromise(_0x45a7('0x79'),_0x45a7('0x79'),{'event':_0x45a7('0x7a'),'message':_[_0x45a7('0x4f')](_0xb6b0a2[_0x45a7('0x2b')],JSON[_0x45a7('0x7b')](_0xb6b0a2[_0x45a7('0x68')][_0x45a7('0x7c')]))},client9002)['then'](function(){return _0xb6b0a2;});}return _0xb6b0a2;}return null;})['then'](respondWithResult(_0x13be16,null))['catch'](handleError(_0x13be16,null));};var interaction_log=require(_0x45a7('0x16'))('chat-interactions');exports['reject']=function(_0x2d9c46,_0x31d9bf,_0x132016){var _0x43cc93={'agent':{},'channel':'chat'};if(_0x2d9c46[_0x45a7('0x58')]['id']){delete _0x2d9c46[_0x45a7('0x58')]['id'];}_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')]=_0x2d9c46['body'][_0x45a7('0x61')]||_0x2d9c46[_0x45a7('0x6a')]['id'];_0x43cc93[_0x45a7('0x62')]['id']=_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')];return db[_0x45a7('0x3d')][_0x45a7('0x59')]({'where':{'id':_0x2d9c46['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x31d9bf,null))['then'](function(_0x2fc764){if(_0x2fc764){_0x43cc93[_0x45a7('0x2b')]=_0x2fc764[_0x45a7('0x63')]({'plain':!![]});return db[_0x45a7('0x64')][_0x45a7('0x59')]({'where':{'id':_0x2fc764[_0x45a7('0x65')]}});}return null;})[_0x45a7('0x23')](handleEntityNotFound(_0x31d9bf,null))[_0x45a7('0x23')](function(_0x1e6d45){if(_0x1e6d45){_0x43cc93[_0x45a7('0x68')]=_0x1e6d45[_0x45a7('0x63')]({'plain':!![]});interaction_log['info'](_0x45a7('0x7d'),_0x2d9c46[_0x45a7('0x6a')]['id'],_0x2d9c46[_0x45a7('0x6a')][_0x45a7('0x3a')],_0x2d9c46[_0x45a7('0x6a')][_0x45a7('0x7e')],_0x43cc93[_0x45a7('0x68')]['id'],_0x2d9c46[_0x45a7('0x58')]?JSON[_0x45a7('0x28')](_0x2d9c46[_0x45a7('0x58')]):_0x45a7('0x7f'));return respondWithRpcPromise(_0x45a7('0x80'),_0x45a7('0x81'),_0x43cc93);}return null;})[_0x45a7('0x23')](function(_0x2f9383){var _0x2fc6b5=_0x45a7('0x82')+_0x2f9383[_0x45a7('0x2b')][_0x45a7('0x6d')];return db['sequelize'][_0x45a7('0x43')](_0x2fc6b5,{'type':db['Sequelize'][_0x45a7('0x70')][_0x45a7('0x83')],'raw':!![]})[_0x45a7('0x23')](function(_0xbcc007){return _0xbcc007;});})[_0x45a7('0x23')](function(_0x420913){if(_0x420913){_0x43cc93[_0x45a7('0x2b')][_0x45a7('0x71')]=_0x420913[0x0];if(!_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')])return;return db[_0x45a7('0x72')][_0x45a7('0x59')]({'where':{'id':_0x2d9c46[_0x45a7('0x58')][_0x45a7('0x61')],'role':'agent'},'attributes':['id',_0x45a7('0x3a'),'fullname',_0x45a7('0x74'),_0x45a7('0x84')],'raw':!![]});}return null;})[_0x45a7('0x23')](function(_0x2063e8){if(!_0x2063e8)return null;_0x43cc93[_0x45a7('0x2b')][_0x45a7('0x62')]=_0x2063e8;return _0x43cc93;})[_0x45a7('0x23')](function(_0x345652){if(_0x345652){_0x345652[_0x45a7('0x2b')][_0x45a7('0x76')]=util[_0x45a7('0x5f')](_0x45a7('0x85'),_0x2d9c46[_0x45a7('0x6a')][_0x45a7('0x3a')]);_0x345652[_0x45a7('0x2b')][_0x45a7('0x77')]=_0x43cc93['channel'];_0x345652[_0x45a7('0x2b')][_0x45a7('0x86')]=_0x43cc93[_0x45a7('0x77')];_0x345652[_0x45a7('0x2b')][_0x45a7('0x78')]=_0x45a7('0x35');respondWithRpcPromise(_0x45a7('0x79'),_0x45a7('0x79'),{'event':_0x45a7('0x87'),'message':_[_0x45a7('0x4f')](_0x43cc93[_0x45a7('0x2b')],JSON['parse'](_0x43cc93[_0x45a7('0x68')][_0x45a7('0x7c')]))},client9002);return _0x43cc93;}return null;})[_0x45a7('0x23')](respondWithResult(_0x31d9bf,null))[_0x45a7('0x2c')](handleError(_0x31d9bf,null));}; \ No newline at end of file +var _0x57f8=['ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','params','find','create','body','describe','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','user','channel','motionChannel','EventManager','parse','formData','chat-interactions','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','client','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x47d3ce,_0x41ac2c){var _0xb7d1db=function(_0x13c8be){while(--_0x13c8be){_0x47d3ce['push'](_0x47d3ce['shift']());}};_0xb7d1db(++_0x41ac2c);}(_0x57f8,0x1e3));var _0x857f=function(_0xb31b62,_0x309405){_0xb31b62=_0xb31b62-0x0;var _0x3928ed=_0x57f8[_0xb31b62];return _0x3928ed;};'use strict';var emlformat=require(_0x857f('0x0'));var rimraf=require(_0x857f('0x1'));var zipdir=require(_0x857f('0x2'));var jsonpatch=require(_0x857f('0x3'));var rp=require(_0x857f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x857f('0x5'));var util=require(_0x857f('0x6'));var path=require(_0x857f('0x7'));var sox=require(_0x857f('0x8'));var csv=require('to-csv');var ejs=require(_0x857f('0x9'));var fs=require('fs');var fs_extra=require(_0x857f('0xa'));var _=require(_0x857f('0xb'));var squel=require(_0x857f('0xc'));var crypto=require(_0x857f('0xd'));var jsforce=require(_0x857f('0xe'));var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x857f('0x11'));var as=require(_0x857f('0x12'));var hardwareService=require(_0x857f('0x13'));var logger=require(_0x857f('0x14'))(_0x857f('0x15'));var utils=require(_0x857f('0x16'));var config=require(_0x857f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x857f('0x18'))['db'];config[_0x857f('0x19')]=_[_0x857f('0x1a')](config[_0x857f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x857f('0x1b'))(new Redis(config[_0x857f('0x19')]));require('./chatMessage.socket')[_0x857f('0x1c')](socket);var jayson=require(_0x857f('0x1d'));var client=jayson['client'][_0x857f('0x1e')]({'port':0x232c});var client9002=jayson[_0x857f('0x1f')][_0x857f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x138297,_0x370133,_0x12cae0,_0x578738){return new BPromise(function(_0x3324ec,_0x32ef3c){var _0x1d300e=_0x578738||client;return _0x1d300e['request'](_0x138297,_0x12cae0)[_0x857f('0x20')](function(_0x3cf807){logger[_0x857f('0x21')](_0x857f('0x22'),_0x370133,_0x857f('0x23'));logger[_0x857f('0x24')](_0x857f('0x25'),_0x370133,_0x857f('0x23'),JSON['stringify'](_0x3cf807));if(_0x3cf807[_0x857f('0x26')]){if(_0x3cf807[_0x857f('0x26')][_0x857f('0x27')]===0x1f4){logger[_0x857f('0x26')]('ChatMessage,\x20%s,\x20%s',_0x370133,_0x3cf807['error']['message']);return _0x32ef3c(_0x3cf807['error'][_0x857f('0x28')]);}logger[_0x857f('0x26')](_0x857f('0x22'),_0x370133,_0x3cf807[_0x857f('0x26')][_0x857f('0x28')]);return _0x3324ec(_0x3cf807[_0x857f('0x26')]['message']);}else{logger[_0x857f('0x21')](_0x857f('0x22'),_0x370133,_0x857f('0x23'));_0x3324ec(_0x3cf807[_0x857f('0x29')]['message']);}})[_0x857f('0x2a')](function(_0x79cd87){logger['error'](_0x857f('0x22'),_0x370133,_0x79cd87);_0x32ef3c(_0x79cd87);});});}function respondWithStatusCode(_0x5a3ba0,_0x33f220){_0x33f220=_0x33f220||0xcc;return function(_0x4b9dcc){if(_0x4b9dcc){return _0x5a3ba0[_0x857f('0x2b')](_0x33f220);}return _0x5a3ba0[_0x857f('0x2c')](_0x33f220)[_0x857f('0x2d')]();};}function respondWithResult(_0x36200b,_0x18edac){_0x18edac=_0x18edac||0xc8;return function(_0x347439){if(_0x347439){return _0x36200b['status'](_0x18edac)[_0x857f('0x2e')](_0x347439);}};}function respondWithFilteredResult(_0x4bb6e2,_0x377d40){return function(_0x13ec0e){if(_0x13ec0e){var _0x5e8c0f=typeof _0x377d40[_0x857f('0x2f')]==='undefined'&&typeof _0x377d40[_0x857f('0x30')]==='undefined';var _0x1cd2cd=_0x13ec0e[_0x857f('0x31')];var _0x57c6e2=_0x5e8c0f?0x0:_0x377d40[_0x857f('0x2f')];var _0x4342a3=_0x5e8c0f?_0x13ec0e['count']:_0x377d40[_0x857f('0x2f')]+_0x377d40['limit'];var _0x476ec5;if(_0x4342a3>=_0x1cd2cd){_0x4342a3=_0x1cd2cd;_0x476ec5=0xc8;}else{_0x476ec5=0xce;}_0x4bb6e2[_0x857f('0x2c')](_0x476ec5);return _0x4bb6e2[_0x857f('0x32')]('Content-Range',_0x57c6e2+'-'+_0x4342a3+'/'+_0x1cd2cd)[_0x857f('0x2e')](_0x13ec0e);}return null;};}function patchUpdates(_0x4989a6){return function(_0x4e574c){try{jsonpatch[_0x857f('0x33')](_0x4e574c,_0x4989a6,!![]);}catch(_0x5c8b2d){return BPromise[_0x857f('0x34')](_0x5c8b2d);}return _0x4e574c[_0x857f('0x35')]();};}function saveUpdates(_0x358320,_0x1b801b){return function(_0xc2c464){if(_0xc2c464){return _0xc2c464[_0x857f('0x36')](_0x358320)[_0x857f('0x20')](function(_0x4344b2){return _0x4344b2;});}return null;};}function removeEntity(_0x4a26cf,_0x245507){return function(_0x55c2bb){if(_0x55c2bb){return _0x55c2bb[_0x857f('0x37')]()[_0x857f('0x20')](function(){_0x4a26cf[_0x857f('0x2c')](0xcc)[_0x857f('0x2d')]();});}};}function handleEntityNotFound(_0x5d4c5c,_0x4177ef){return function(_0xf2ba3d){if(!_0xf2ba3d){_0x5d4c5c[_0x857f('0x2b')](0x194);}return _0xf2ba3d;};}function handleError(_0x1cdfed,_0x312935){_0x312935=_0x312935||0x1f4;return function(_0x3b5977){logger[_0x857f('0x26')](_0x3b5977[_0x857f('0x38')]);if(_0x3b5977['name']){delete _0x3b5977[_0x857f('0x39')];}_0x1cdfed[_0x857f('0x2c')](_0x312935)[_0x857f('0x3a')](_0x3b5977);};}exports[_0x857f('0x3b')]=function(_0x2e3626,_0x150871){var _0x190887={},_0x4b7931={},_0x14ec3c={'count':0x0,'rows':[]};var _0x178c69=_[_0x857f('0x3c')](db[_0x857f('0x3d')][_0x857f('0x3e')],function(_0x4212d2){return{'name':_0x4212d2[_0x857f('0x3f')],'type':_0x4212d2[_0x857f('0x40')][_0x857f('0x41')]};});_0x4b7931['model']=_[_0x857f('0x3c')](_0x178c69,_0x857f('0x39'));_0x4b7931[_0x857f('0x42')]=_[_0x857f('0x43')](_0x2e3626[_0x857f('0x42')]);_0x4b7931['filters']=_[_0x857f('0x44')](_0x4b7931[_0x857f('0x45')],_0x4b7931['query']);_0x190887[_0x857f('0x46')]=_[_0x857f('0x44')](_0x4b7931[_0x857f('0x45')],qs[_0x857f('0x47')](_0x2e3626[_0x857f('0x42')][_0x857f('0x47')]));_0x190887[_0x857f('0x46')]=_0x190887[_0x857f('0x46')][_0x857f('0x48')]?_0x190887[_0x857f('0x46')]:_0x4b7931[_0x857f('0x45')];if(!_0x2e3626[_0x857f('0x42')]['hasOwnProperty']('nolimit')){_0x190887[_0x857f('0x30')]=qs['limit'](_0x2e3626[_0x857f('0x42')][_0x857f('0x30')]);_0x190887[_0x857f('0x2f')]=qs['offset'](_0x2e3626[_0x857f('0x42')][_0x857f('0x2f')]);}_0x190887[_0x857f('0x49')]=qs[_0x857f('0x4a')](_0x2e3626['query'][_0x857f('0x4a')]);_0x190887[_0x857f('0x4b')]=qs[_0x857f('0x4c')](_[_0x857f('0x4d')](_0x2e3626['query'],_0x4b7931['filters']),_0x178c69);if(_0x2e3626['query'][_0x857f('0x4e')]){_0x190887[_0x857f('0x4b')]=_[_0x857f('0x4f')](_0x190887[_0x857f('0x4b')],{'$or':_[_0x857f('0x3c')](_0x178c69,function(_0x5c59c1){if(_0x5c59c1[_0x857f('0x40')]!==_0x857f('0x50')){var _0x4fb23e={};_0x4fb23e[_0x5c59c1[_0x857f('0x39')]]={'$like':'%'+_0x2e3626[_0x857f('0x42')][_0x857f('0x4e')]+'%'};return _0x4fb23e;}})});}_0x190887=_['merge']({},_0x190887,_0x2e3626[_0x857f('0x51')]);var _0x2a4112={'where':_0x190887[_0x857f('0x4b')]};return db[_0x857f('0x3d')][_0x857f('0x31')](_0x2a4112)[_0x857f('0x20')](function(_0x1b5317){_0x14ec3c[_0x857f('0x31')]=_0x1b5317;if(_0x2e3626[_0x857f('0x42')]['includeAll']){_0x190887[_0x857f('0x52')]=[{'all':!![]}];}return db[_0x857f('0x3d')]['findAll'](_0x190887);})[_0x857f('0x20')](function(_0x34380d){_0x14ec3c[_0x857f('0x53')]=_0x34380d;return _0x14ec3c;})[_0x857f('0x20')](respondWithFilteredResult(_0x150871,_0x190887))[_0x857f('0x2a')](handleError(_0x150871,null));};exports['show']=function(_0x42b2fc,_0x4a9c4e){var _0x1bac3c={'raw':!![],'where':{'id':_0x42b2fc[_0x857f('0x54')]['id']}},_0x430de6={};_0x430de6[_0x857f('0x45')]=_[_0x857f('0x43')](db['ChatMessage'][_0x857f('0x3e')]);_0x430de6[_0x857f('0x42')]=_['keys'](_0x42b2fc[_0x857f('0x42')]);_0x430de6[_0x857f('0x4c')]=_[_0x857f('0x44')](_0x430de6[_0x857f('0x45')],_0x430de6[_0x857f('0x42')]);_0x1bac3c[_0x857f('0x46')]=_[_0x857f('0x44')](_0x430de6['model'],qs[_0x857f('0x47')](_0x42b2fc['query'][_0x857f('0x47')]));_0x1bac3c[_0x857f('0x46')]=_0x1bac3c['attributes'][_0x857f('0x48')]?_0x1bac3c[_0x857f('0x46')]:_0x430de6[_0x857f('0x45')];if(_0x42b2fc['query']['includeAll']){_0x1bac3c[_0x857f('0x52')]=[{'all':!![]}];}_0x1bac3c=_[_0x857f('0x4f')]({},_0x1bac3c,_0x42b2fc[_0x857f('0x51')]);return db[_0x857f('0x3d')][_0x857f('0x55')](_0x1bac3c)[_0x857f('0x20')](handleEntityNotFound(_0x4a9c4e,null))[_0x857f('0x20')](respondWithResult(_0x4a9c4e,null))[_0x857f('0x2a')](handleError(_0x4a9c4e,null));};exports[_0x857f('0x56')]=function(_0x50e645,_0x1bd0aa){return db[_0x857f('0x3d')]['create'](_0x50e645[_0x857f('0x57')],{})['then'](respondWithResult(_0x1bd0aa,0xc9))[_0x857f('0x2a')](handleError(_0x1bd0aa,null));};exports[_0x857f('0x36')]=function(_0x4db953,_0x1ae91d){if(_0x4db953[_0x857f('0x57')]['id']){delete _0x4db953[_0x857f('0x57')]['id'];}return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x4db953[_0x857f('0x54')]['id']}})[_0x857f('0x20')](handleEntityNotFound(_0x1ae91d,null))[_0x857f('0x20')](saveUpdates(_0x4db953[_0x857f('0x57')],null))[_0x857f('0x20')](respondWithResult(_0x1ae91d,null))[_0x857f('0x2a')](handleError(_0x1ae91d,null));};exports['destroy']=function(_0x419d85,_0x361f6d){return db['ChatMessage'][_0x857f('0x55')]({'where':{'id':_0x419d85[_0x857f('0x54')]['id']}})['then'](handleEntityNotFound(_0x361f6d,null))[_0x857f('0x20')](removeEntity(_0x361f6d,null))[_0x857f('0x2a')](handleError(_0x361f6d,null));};exports['describe']=function(_0x1e00dd,_0x1dcc94){return db[_0x857f('0x3d')][_0x857f('0x58')]()[_0x857f('0x20')](respondWithResult(_0x1dcc94,null))[_0x857f('0x2a')](handleError(_0x1dcc94,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x21c6b1,_0x34fc5f,_0x21bbcb){var _0x39d5a5={'agent':{},'channel':_0x857f('0x59')};if(_0x21c6b1['body']['id']){delete _0x21c6b1[_0x857f('0x57')]['id'];}_0x21c6b1[_0x857f('0x57')][_0x857f('0x5a')]=!![];_0x21c6b1[_0x857f('0x57')][_0x857f('0x5b')]=moment()['format'](_0x857f('0x5c'));_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')]=_0x21c6b1['body'][_0x857f('0x5d')]||_0x21c6b1['user']['id'];_0x39d5a5[_0x857f('0x5e')]['id']=_0x21c6b1['body'][_0x857f('0x5d')];return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x21c6b1[_0x857f('0x54')]['id'],'UserId':null}})[_0x857f('0x20')](handleEntityNotFound(_0x34fc5f,null))[_0x857f('0x20')](saveUpdates(_0x21c6b1[_0x857f('0x57')],null))[_0x857f('0x20')](function(_0x1975b4){if(_0x1975b4){_0x39d5a5[_0x857f('0x28')]=_0x1975b4[_0x857f('0x5f')]({'plain':!![]});return db[_0x857f('0x60')][_0x857f('0x55')]({'where':{'id':_0x1975b4['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x34fc5f,null))[_0x857f('0x20')](function(_0x3997b4){if(_0x3997b4){return _0x3997b4[_0x857f('0x36')]({'UserId':_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')],'read1stAt':_['isNil'](_0x3997b4['read1stAt'])?moment()[_0x857f('0x61')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x857f('0x20')](function(_0x2fc80a){if(_0x2fc80a){_0x39d5a5[_0x857f('0x62')]=_0x2fc80a['get']({'plain':!![]});interaction_log['info'](_0x857f('0x63'),_0x21c6b1['user']['id'],_0x21c6b1['user'][_0x857f('0x39')],_0x21c6b1['user'][_0x857f('0x64')],_0x39d5a5[_0x857f('0x62')]['id'],_0x21c6b1['body']?JSON[_0x857f('0x65')](_0x21c6b1[_0x857f('0x57')]):_0x857f('0x66'));return respondWithRpcPromise(_0x857f('0x67'),_0x857f('0x68'),_0x39d5a5);}return null;})[_0x857f('0x20')](function(_0x732a1d){var _0x45fa9f='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x732a1d['message']['ContactId'];return db[_0x857f('0x69')][_0x857f('0x42')](_0x45fa9f,{'type':db['Sequelize'][_0x857f('0x6a')]['SELECT'],'raw':!![]})[_0x857f('0x20')](function(_0x497d7b){return _0x497d7b;});})[_0x857f('0x20')](function(_0x250b7b){if(_0x250b7b){_0x39d5a5[_0x857f('0x28')][_0x857f('0x6b')]=_0x250b7b[0x0];if(!_0x21c6b1[_0x857f('0x57')][_0x857f('0x5d')])return;return db[_0x857f('0x6c')][_0x857f('0x55')]({'where':{'id':_0x21c6b1['body'][_0x857f('0x5d')],'role':_0x857f('0x5e')},'attributes':['id','name',_0x857f('0x6d'),_0x857f('0x6e'),_0x857f('0x6f')],'raw':!![]});}return null;})[_0x857f('0x20')](function(_0x1c417d){if(!_0x1c417d)return null;_0x39d5a5['message']['agent']=_0x1c417d;return _0x39d5a5;})[_0x857f('0x20')](function(_0x1f964d){if(_0x1f964d){if(_0x21c6b1[_0x857f('0x57')][_0x857f('0x70')]){_0x39d5a5['message'][_0x857f('0x71')]=util['format'](_0x857f('0x72'),_0x21c6b1[_0x857f('0x73')][_0x857f('0x39')]);_0x39d5a5[_0x857f('0x28')]['channel']=_0x39d5a5[_0x857f('0x74')];_0x39d5a5[_0x857f('0x28')][_0x857f('0x75')]=_0x39d5a5[_0x857f('0x74')];_0x39d5a5[_0x857f('0x28')]['event']='accept';return respondWithRpcPromise(_0x857f('0x76'),_0x857f('0x76'),{'event':'acceptmessage','message':_[_0x857f('0x4f')](_0x39d5a5[_0x857f('0x28')],JSON[_0x857f('0x77')](_0x39d5a5[_0x857f('0x62')][_0x857f('0x78')]))},client9002)['then'](function(){return _0x39d5a5;});}return _0x39d5a5;}return null;})[_0x857f('0x20')](respondWithResult(_0x34fc5f,null))[_0x857f('0x2a')](handleError(_0x34fc5f,null));};var interaction_log=require(_0x857f('0x14'))(_0x857f('0x79'));exports[_0x857f('0x34')]=function(_0x44126f,_0x27fc9e,_0x3eaaf5){var _0x46b0e4={'agent':{},'channel':'chat'};if(_0x44126f[_0x857f('0x57')]['id']){delete _0x44126f[_0x857f('0x57')]['id'];}_0x44126f[_0x857f('0x57')]['UserId']=_0x44126f[_0x857f('0x57')][_0x857f('0x5d')]||_0x44126f[_0x857f('0x73')]['id'];_0x46b0e4['agent']['id']=_0x44126f[_0x857f('0x57')][_0x857f('0x5d')];return db[_0x857f('0x3d')][_0x857f('0x55')]({'where':{'id':_0x44126f[_0x857f('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x27fc9e,null))[_0x857f('0x20')](function(_0x16074a){if(_0x16074a){_0x46b0e4[_0x857f('0x28')]=_0x16074a['get']({'plain':!![]});return db[_0x857f('0x60')]['find']({'where':{'id':_0x16074a[_0x857f('0x7a')]}});}return null;})['then'](handleEntityNotFound(_0x27fc9e,null))[_0x857f('0x20')](function(_0x11703d){if(_0x11703d){_0x46b0e4['interaction']=_0x11703d[_0x857f('0x5f')]({'plain':!![]});interaction_log[_0x857f('0x21')](_0x857f('0x7b'),_0x44126f[_0x857f('0x73')]['id'],_0x44126f['user'][_0x857f('0x39')],_0x44126f[_0x857f('0x73')][_0x857f('0x64')],_0x46b0e4[_0x857f('0x62')]['id'],_0x44126f['body']?JSON[_0x857f('0x65')](_0x44126f['body']):_0x857f('0x66'));return respondWithRpcPromise(_0x857f('0x7c'),_0x857f('0x7d'),_0x46b0e4);}return null;})[_0x857f('0x20')](function(_0x23fb85){var _0x341a9d=_0x857f('0x7e')+_0x23fb85[_0x857f('0x28')]['ContactId'];return db[_0x857f('0x69')][_0x857f('0x42')](_0x341a9d,{'type':db[_0x857f('0x7f')][_0x857f('0x6a')][_0x857f('0x80')],'raw':!![]})[_0x857f('0x20')](function(_0x7ae6f4){return _0x7ae6f4;});})['then'](function(_0x20e078){if(_0x20e078){_0x46b0e4['message']['contact']=_0x20e078[0x0];if(!_0x44126f[_0x857f('0x57')][_0x857f('0x5d')])return;return db['User'][_0x857f('0x55')]({'where':{'id':_0x44126f['body'][_0x857f('0x5d')],'role':_0x857f('0x5e')},'attributes':['id',_0x857f('0x39'),_0x857f('0x6d'),'email',_0x857f('0x6f')],'raw':!![]});}return null;})['then'](function(_0x2ea1f5){if(!_0x2ea1f5)return null;_0x46b0e4['message'][_0x857f('0x5e')]=_0x2ea1f5;return _0x46b0e4;})[_0x857f('0x20')](function(_0x2f522f){if(_0x2f522f){_0x2f522f[_0x857f('0x28')][_0x857f('0x71')]=util[_0x857f('0x61')]('SIP/%s',_0x44126f['user'][_0x857f('0x39')]);_0x2f522f['message']['channel']=_0x46b0e4[_0x857f('0x74')];_0x2f522f[_0x857f('0x28')][_0x857f('0x75')]=_0x46b0e4['channel'];_0x2f522f[_0x857f('0x28')]['event']=_0x857f('0x34');respondWithRpcPromise('EventManager',_0x857f('0x76'),{'event':_0x857f('0x81'),'message':_[_0x857f('0x4f')](_0x46b0e4['message'],JSON[_0x857f('0x77')](_0x46b0e4[_0x857f('0x62')][_0x857f('0x78')]))},client9002);return _0x46b0e4;}return null;})[_0x857f('0x20')](respondWithResult(_0x27fc9e,null))[_0x857f('0x2a')](handleError(_0x27fc9e,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 5328c6f..75e6270 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 _0x127f=['../../mysqldb','save','remove','emit','exports','events'];(function(_0x1c3abe,_0x9f50b9){var _0x1ee64a=function(_0x4e351b){while(--_0x4e351b){_0x1c3abe['push'](_0x1c3abe['shift']());}};_0x1ee64a(++_0x9f50b9);}(_0x127f,0xa1));var _0xf127=function(_0x411e97,_0x4848d5){_0x411e97=_0x411e97-0x0;var _0x1498ad=_0x127f[_0x411e97];return _0x1498ad;};'use strict';var EventEmitter=require(_0xf127('0x0'));var ChatMessage=require(_0xf127('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf127('0x2'),'afterUpdate':'update','afterDestroy':_0xf127('0x3')};function emitEvent(_0x4022a7){return function(_0x10b0ff,_0x3c2995,_0x5af703){ChatMessageEvents[_0xf127('0x4')](_0x4022a7+':'+_0x10b0ff['id'],_0x10b0ff);ChatMessageEvents[_0xf127('0x4')](_0x4022a7,_0x10b0ff);_0x5af703(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xf127('0x5')]=ChatMessageEvents; \ No newline at end of file +var _0x446a=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0x2ff7eb,_0x1564c0){var _0x4fbd3a=function(_0x53ab7f){while(--_0x53ab7f){_0x2ff7eb['push'](_0x2ff7eb['shift']());}};_0x4fbd3a(++_0x1564c0);}(_0x446a,0x145));var _0xa446=function(_0x5d56c5,_0x5899f5){_0x5d56c5=_0x5d56c5-0x0;var _0x1ae496=_0x446a[_0x5d56c5];return _0x1ae496;};'use strict';var EventEmitter=require(_0xa446('0x0'));var ChatMessage=require(_0xa446('0x1'))['db'][_0xa446('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xa446('0x3')](0x0);var events={'afterCreate':_0xa446('0x4'),'afterUpdate':_0xa446('0x5'),'afterDestroy':_0xa446('0x6')};function emitEvent(_0x59c7f9){return function(_0x2c52dd,_0x57a898,_0x582a99){ChatMessageEvents[_0xa446('0x7')](_0x59c7f9+':'+_0x2c52dd['id'],_0x2c52dd);ChatMessageEvents[_0xa446('0x7')](_0x59c7f9,_0x2c52dd);_0x582a99(null);};}for(var e in events){if(events[_0xa446('0x8')](e)){var event=events[e];ChatMessage[_0xa446('0x9')](e,emitEvent(event));}}module[_0xa446('0xa')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 3e3d347..c72325f 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 _0x4fd9=['ChatInteraction','then','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId'];(function(_0x415e9c,_0x3e5a3c){var _0x44d2fc=function(_0x5d7de9){while(--_0x5d7de9){_0x415e9c['push'](_0x415e9c['shift']());}};_0x44d2fc(++_0x3e5a3c);}(_0x4fd9,0x6c));var _0x94fd=function(_0xa59696,_0x333d6f){_0xa59696=_0xa59696-0x0;var _0x1c67ae=_0x4fd9[_0xa59696];return _0x1c67ae;};'use strict';var _=require(_0x94fd('0x0'));var util=require('util');var logger=require(_0x94fd('0x1'))(_0x94fd('0x2'));var moment=require(_0x94fd('0x3'));var BPromise=require(_0x94fd('0x4'));var rp=require(_0x94fd('0x5'));var fs=require('fs');var path=require(_0x94fd('0x6'));var rimraf=require('rimraf');var config=require(_0x94fd('0x7'));var attributes=require(_0x94fd('0x8'));module[_0x94fd('0x9')]=function(_0x22479b,_0x676339){return _0x22479b['define'](_0x94fd('0xa'),attributes,{'tableName':_0x94fd('0xb'),'paranoid':![],'indexes':[{'name':_0x94fd('0xc'),'fields':[_0x94fd('0xd')],'type':_0x94fd('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2c3f4b,_0x37c6af,_0xf81e1e){var _0x22b06c=_0x22479b['models'];var _0x43c407=_0x2c3f4b[_0x94fd('0xf')]({'plain':!![]});if(_0x43c407['direction'][_0x94fd('0x10')]()==='in'||_0x43c407[_0x94fd('0x11')]['toLowerCase']()===_0x94fd('0x12')&&!_0x43c407[_0x94fd('0x13')]&&!_[_0x94fd('0x14')](_0x43c407[_0x94fd('0x15')])){_0x22b06c[_0x94fd('0x16')]['findOne']({'where':{'id':_0x43c407['ChatInteractionId']}})[_0x94fd('0x17')](function(_0x2f1799){if(_0x2f1799){_0x2f1799['update']({'lastMsgAt':_0x43c407['createdAt'],'lastMsgDirection':_0x43c407[_0x94fd('0x11')]['toLowerCase']()});}})['catch'](function(_0x4eef4f){console[_0x94fd('0x18')](_0x4eef4f);});}_0xf81e1e();}},'charset':'utf8mb4','collate':_0x94fd('0x19')});}; \ No newline at end of file +var _0x4740=['body','FULLTEXT','models','get','direction','toLowerCase','UserId','ChatInteraction','then','update','catch','utf8mb4','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x435e2f,_0x43f39d){var _0x4f128e=function(_0x51840c){while(--_0x51840c){_0x435e2f['push'](_0x435e2f['shift']());}};_0x4f128e(++_0x43f39d);}(_0x4740,0x1b5));var _0x0474=function(_0x3a9b94,_0x526b54){_0x3a9b94=_0x3a9b94-0x0;var _0x155e6d=_0x4740[_0x3a9b94];return _0x155e6d;};'use strict';var _=require(_0x0474('0x0'));var util=require(_0x0474('0x1'));var logger=require(_0x0474('0x2'))(_0x0474('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0474('0x4'));var fs=require('fs');var path=require(_0x0474('0x5'));var rimraf=require(_0x0474('0x6'));var config=require(_0x0474('0x7'));var attributes=require('./chatMessage.attributes');module[_0x0474('0x8')]=function(_0x20ac37,_0x36441d){return _0x20ac37[_0x0474('0x9')](_0x0474('0xa'),attributes,{'tableName':_0x0474('0xb'),'paranoid':![],'indexes':[{'name':_0x0474('0xc'),'fields':[_0x0474('0xd')],'type':_0x0474('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x330906,_0x35ccbc,_0x504778){var _0x4d58e2=_0x20ac37[_0x0474('0xf')];var _0xec2803=_0x330906[_0x0474('0x10')]({'plain':!![]});if(_0xec2803[_0x0474('0x11')][_0x0474('0x12')]()==='in'||_0xec2803[_0x0474('0x11')][_0x0474('0x12')]()==='out'&&!_0xec2803['secret']&&!_['isNil'](_0xec2803[_0x0474('0x13')])){_0x4d58e2[_0x0474('0x14')]['findOne']({'where':{'id':_0xec2803['ChatInteractionId']}})[_0x0474('0x15')](function(_0x122829){if(_0x122829){_0x122829[_0x0474('0x16')]({'lastMsgAt':_0xec2803['createdAt'],'lastMsgDirection':_0xec2803[_0x0474('0x11')]['toLowerCase']()});}})[_0x0474('0x17')](function(_0x52f62c){console['error'](_0x52f62c);});}_0x504778();}},'charset':_0x0474('0x18'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index b599b70..b8e5b3e 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 _0xd66e=['request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xd66e,0x1bf));var _0xed66=function(_0x195fbb,_0x3e7933){_0x195fbb=_0x195fbb-0x0;var _0x6c5304=_0xd66e[_0x195fbb];return _0x6c5304;};'use strict';var _=require('lodash');var util=require(_0xed66('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xed66('0x1'));var fs=require('fs');var Redis=require(_0xed66('0x2'));var db=require(_0xed66('0x3'))['db'];var utils=require(_0xed66('0x4'));var logger=require(_0xed66('0x5'))(_0xed66('0x6'));var config=require(_0xed66('0x7'));var jayson=require(_0xed66('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xed66('0x9')]=_[_0xed66('0xa')](config[_0xed66('0x9')],{'host':_0xed66('0xb'),'port':0x18eb});var socket=require(_0xed66('0xc'))(new Redis(config[_0xed66('0x9')]));require(_0xed66('0xd'))[_0xed66('0xe')](socket);function respondWithRpcPromise(_0x49c5a0,_0x2aa6d3,_0x29ebc6){return new BPromise(function(_0xd526f1,_0x1d5132){return client[_0xed66('0xf')](_0x49c5a0,_0x29ebc6)[_0xed66('0x10')](function(_0x22d08b){logger[_0xed66('0x11')](_0xed66('0x12'),_0x2aa6d3,'request\x20sent');logger[_0xed66('0x13')](_0xed66('0x14'),_0x2aa6d3,'request\x20sent',JSON[_0xed66('0x15')](_0x22d08b));if(_0x22d08b[_0xed66('0x16')]){if(_0x22d08b[_0xed66('0x16')]['code']===0x1f4){logger[_0xed66('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2aa6d3,_0x22d08b['error'][_0xed66('0x17')]);return _0x1d5132(_0x22d08b['error'][_0xed66('0x17')]);}logger[_0xed66('0x16')]('ChatMessage,\x20%s,\x20%s',_0x2aa6d3,_0x22d08b['error'][_0xed66('0x17')]);return _0xd526f1(_0x22d08b[_0xed66('0x16')]['message']);}else{logger[_0xed66('0x11')](_0xed66('0x12'),_0x2aa6d3,_0xed66('0x18'));_0xd526f1(_0x22d08b[_0xed66('0x19')][_0xed66('0x17')]);}})[_0xed66('0x1a')](function(_0x57d3a0){logger['error'](_0xed66('0x12'),_0x2aa6d3,_0x57d3a0);_0x1d5132(_0x57d3a0);});});}exports[_0xed66('0x1b')]=function(_0x703b63){var _0x23e5d4=this;return new Promise(function(_0x42a88f,_0x31d0ec){return db[_0xed66('0x1c')][_0xed66('0x1d')](_0x703b63[_0xed66('0x1e')],{'raw':_0x703b63['options']?_0x703b63[_0xed66('0x1f')][_0xed66('0x20')]===undefined?!![]:![]:!![]})[_0xed66('0x10')](function(_0x1fc607){logger['info'](_0xed66('0x1b'),_0x703b63);logger[_0xed66('0x13')](_0xed66('0x1b'),_0x703b63,JSON['stringify'](_0x1fc607));_0x42a88f(_0x1fc607);})[_0xed66('0x1a')](function(_0x261cad){logger[_0xed66('0x16')](_0xed66('0x1b'),_0x261cad[_0xed66('0x17')],_0x703b63);_0x31d0ec(_0x23e5d4['error'](0x1f4,_0x261cad[_0xed66('0x17')]));});});}; \ No newline at end of file +var _0xa925=['debug','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','request\x20sent','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','CreateChatMessage','ChatMessage','create','body','options','raw'];(function(_0x2a56ad,_0x2b94bf){var _0x425175=function(_0x342f20){while(--_0x342f20){_0x2a56ad['push'](_0x2a56ad['shift']());}};_0x425175(++_0x2b94bf);}(_0xa925,0x134));var _0x5a92=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa925[_0x297fd3];return _0x2af381;};'use strict';var _=require('lodash');var util=require(_0x5a92('0x0'));var moment=require(_0x5a92('0x1'));var BPromise=require(_0x5a92('0x2'));var rs=require(_0x5a92('0x3'));var fs=require('fs');var Redis=require(_0x5a92('0x4'));var db=require(_0x5a92('0x5'))['db'];var utils=require(_0x5a92('0x6'));var logger=require(_0x5a92('0x7'))(_0x5a92('0x8'));var config=require('../../config/environment');var jayson=require(_0x5a92('0x9'));var client=jayson['client'][_0x5a92('0xa')]({'port':0x232a});config['redis']=_[_0x5a92('0xb')](config[_0x5a92('0xc')],{'host':_0x5a92('0xd'),'port':0x18eb});var socket=require(_0x5a92('0xe'))(new Redis(config['redis']));require(_0x5a92('0xf'))[_0x5a92('0x10')](socket);function respondWithRpcPromise(_0x53373f,_0x275ccb,_0x4266ba){return new BPromise(function(_0x42b226,_0xfc11e6){return client[_0x5a92('0x11')](_0x53373f,_0x4266ba)[_0x5a92('0x12')](function(_0x4ab6c8){logger[_0x5a92('0x13')]('ChatMessage,\x20%s,\x20%s',_0x275ccb,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x275ccb,_0x5a92('0x14'),JSON[_0x5a92('0x15')](_0x4ab6c8));if(_0x4ab6c8[_0x5a92('0x16')]){if(_0x4ab6c8[_0x5a92('0x16')][_0x5a92('0x17')]===0x1f4){logger[_0x5a92('0x16')]('ChatMessage,\x20%s,\x20%s',_0x275ccb,_0x4ab6c8[_0x5a92('0x16')]['message']);return _0xfc11e6(_0x4ab6c8['error'][_0x5a92('0x18')]);}logger[_0x5a92('0x16')](_0x5a92('0x19'),_0x275ccb,_0x4ab6c8['error'][_0x5a92('0x18')]);return _0x42b226(_0x4ab6c8['error'][_0x5a92('0x18')]);}else{logger['info'](_0x5a92('0x19'),_0x275ccb,_0x5a92('0x14'));_0x42b226(_0x4ab6c8['result'][_0x5a92('0x18')]);}})['catch'](function(_0x108a13){logger[_0x5a92('0x16')](_0x5a92('0x19'),_0x275ccb,_0x108a13);_0xfc11e6(_0x108a13);});});}exports[_0x5a92('0x1a')]=function(_0x2c7033){var _0x2d7817=this;return new Promise(function(_0x55fdd9,_0x1ccb14){return db[_0x5a92('0x1b')][_0x5a92('0x1c')](_0x2c7033[_0x5a92('0x1d')],{'raw':_0x2c7033[_0x5a92('0x1e')]?_0x2c7033[_0x5a92('0x1e')][_0x5a92('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x377c92){logger[_0x5a92('0x13')]('CreateChatMessage',_0x2c7033);logger[_0x5a92('0x20')]('CreateChatMessage',_0x2c7033,JSON[_0x5a92('0x15')](_0x377c92));_0x55fdd9(_0x377c92);})[_0x5a92('0x21')](function(_0x4ab4a7){logger[_0x5a92('0x16')](_0x5a92('0x1a'),_0x4ab4a7[_0x5a92('0x18')],_0x2c7033);_0x1ccb14(_0x2d7817[_0x5a92('0x16')](0x1f4,_0x4ab4a7[_0x5a92('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 7ccc9d5..b70b716 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 _0xc949=['chatMessage:','./chatMessage.events','remove','update','emit','removeListener','register','length'];(function(_0x46f153,_0x8061fd){var _0x43b848=function(_0x5deddf){while(--_0x5deddf){_0x46f153['push'](_0x46f153['shift']());}};_0x43b848(++_0x8061fd);}(_0xc949,0x181));var _0x9c94=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xc949[_0x47a7d0];return _0xb9bd08;};'use strict';var ChatMessageEvents=require(_0x9c94('0x0'));var events=['save',_0x9c94('0x1'),_0x9c94('0x2')];function createListener(_0x209cd8,_0x27613f){return function(_0x54facf){_0x27613f[_0x9c94('0x3')](_0x209cd8,_0x54facf);};}function removeListener(_0x231762,_0x528a17){return function(){ChatMessageEvents[_0x9c94('0x4')](_0x231762,_0x528a17);};}exports[_0x9c94('0x5')]=function(_0x46d560){for(var _0x1357ac=0x0,_0x57fcd7=events[_0x9c94('0x6')];_0x1357ac<_0x57fcd7;_0x1357ac++){var _0x360e7b=events[_0x1357ac];var _0x25ecd0=createListener(_0x9c94('0x7')+_0x360e7b,_0x46d560);ChatMessageEvents['on'](_0x360e7b,_0x25ecd0);}}; \ No newline at end of file +var _0x27c5=['update','emit','removeListener','register','chatMessage:','remove'];(function(_0x592109,_0x10d79a){var _0x328ecd=function(_0x320091){while(--_0x320091){_0x592109['push'](_0x592109['shift']());}};_0x328ecd(++_0x10d79a);}(_0x27c5,0x173));var _0x527c=function(_0x3c49b2,_0x285e48){_0x3c49b2=_0x3c49b2-0x0;var _0x2d9203=_0x27c5[_0x3c49b2];return _0x2d9203;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x527c('0x0'),_0x527c('0x1')];function createListener(_0xd193d0,_0x5771e6){return function(_0x1a35ed){_0x5771e6[_0x527c('0x2')](_0xd193d0,_0x1a35ed);};}function removeListener(_0x371ae5,_0x45478a){return function(){ChatMessageEvents[_0x527c('0x3')](_0x371ae5,_0x45478a);};}exports[_0x527c('0x4')]=function(_0x37bd95){for(var _0x552d9b=0x0,_0x18c413=events['length'];_0x552d9b<_0x18c413;_0x552d9b++){var _0x2db820=events[_0x552d9b];var _0x5e07ba=createListener(_0x527c('0x5')+_0x2db820,_0x37bd95);ChatMessageEvents['on'](_0x2db820,_0x5e07ba);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index ddf4f6d..e9822e6 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 _0x607d=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','show','post','chatmessage:create','create','put','/:id','/:id/accept','/:id/reject','reject','delete'];(function(_0x529c6a,_0x1b6bbf){var _0x4ca96a=function(_0x1f0dc9){while(--_0x1f0dc9){_0x529c6a['push'](_0x529c6a['shift']());}};_0x4ca96a(++_0x1b6bbf);}(_0x607d,0x1e4));var _0xd607=function(_0x1b9c13,_0x5a7224){_0x1b9c13=_0x1b9c13-0x0;var _0x57cabe=_0x607d[_0x1b9c13];return _0x57cabe;};'use strict';var multer=require('multer');var util=require(_0xd607('0x0'));var path=require(_0xd607('0x1'));var timeout=require(_0xd607('0x2'));var express=require(_0xd607('0x3'));var router=express['Router']();var fs_extra=require(_0xd607('0x4'));var auth=require(_0xd607('0x5'));var interaction=require(_0xd607('0x6'));var config=require('../../config/environment');var controller=require(_0xd607('0x7'));router['get']('/',auth[_0xd607('0x8')](),controller[_0xd607('0x9')]);router[_0xd607('0xa')](_0xd607('0xb'),auth[_0xd607('0x8')](),controller['describe']);router['get']('/:id',auth[_0xd607('0x8')](),controller[_0xd607('0xc')]);router[_0xd607('0xd')]('/',auth[_0xd607('0x8')](),interaction['tracked']('chat',_0xd607('0xe')),controller[_0xd607('0xf')]);router[_0xd607('0x10')](_0xd607('0x11'),controller['update']);router[_0xd607('0x10')](_0xd607('0x12'),auth[_0xd607('0x8')](),controller['accept']);router['put'](_0xd607('0x13'),auth[_0xd607('0x8')](),controller[_0xd607('0x14')]);router[_0xd607('0x15')](_0xd607('0x11'),auth[_0xd607('0x8')](),controller['destroy']);module[_0xd607('0x16')]=router; \ No newline at end of file +var _0x1b02=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','tracked','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x32c012,_0xe3c576){var _0x48562e=function(_0x505228){while(--_0x505228){_0x32c012['push'](_0x32c012['shift']());}};_0x48562e(++_0xe3c576);}(_0x1b02,0xe2));var _0x21b0=function(_0x49dd26,_0x9e5a5d){_0x49dd26=_0x49dd26-0x0;var _0x45f549=_0x1b02[_0x49dd26];return _0x45f549;};'use strict';var multer=require(_0x21b0('0x0'));var util=require(_0x21b0('0x1'));var path=require(_0x21b0('0x2'));var timeout=require(_0x21b0('0x3'));var express=require(_0x21b0('0x4'));var router=express[_0x21b0('0x5')]();var fs_extra=require(_0x21b0('0x6'));var auth=require(_0x21b0('0x7'));var interaction=require(_0x21b0('0x8'));var config=require(_0x21b0('0x9'));var controller=require(_0x21b0('0xa'));router[_0x21b0('0xb')]('/',auth['isAuthenticated'](),controller[_0x21b0('0xc')]);router[_0x21b0('0xb')](_0x21b0('0xd'),auth['isAuthenticated'](),controller[_0x21b0('0xe')]);router[_0x21b0('0xb')](_0x21b0('0xf'),auth[_0x21b0('0x10')](),controller[_0x21b0('0x11')]);router['post']('/',auth[_0x21b0('0x10')](),interaction[_0x21b0('0x12')]('chat',_0x21b0('0x13')),controller[_0x21b0('0x14')]);router[_0x21b0('0x15')]('/:id',controller[_0x21b0('0x16')]);router[_0x21b0('0x15')](_0x21b0('0x17'),auth[_0x21b0('0x10')](),controller[_0x21b0('0x18')]);router['put'](_0x21b0('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0x21b0('0x1a')]('/:id',auth[_0x21b0('0x10')](),controller[_0x21b0('0x1b')]);module[_0x21b0('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 5acc3dc..3a215d8 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 _0x15c6=['medium','exports'];(function(_0x1f2f9f,_0x52b1a5){var _0x20c387=function(_0x42e3ba){while(--_0x42e3ba){_0x1f2f9f['push'](_0x1f2f9f['shift']());}};_0x20c387(++_0x52b1a5);}(_0x15c6,0xf3));var _0x615c=function(_0x265aa2,_0x220072){_0x265aa2=_0x265aa2-0x0;var _0x447a3a=_0x15c6[_0x265aa2];return _0x447a3a;};'use strict';var Sequelize=require('sequelize');module[_0x615c('0x0')]={'body':{'type':Sequelize['TEXT'](_0x615c('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x976c=['exports','TEXT','medium'];(function(_0x464597,_0x4b3ab0){var _0x227f22=function(_0x4ec014){while(--_0x4ec014){_0x464597['push'](_0x464597['shift']());}};_0x227f22(++_0x4b3ab0);}(_0x976c,0x72));var _0xc976=function(_0x5b47e1,_0x159b15){_0x5b47e1=_0x5b47e1-0x0;var _0x572a56=_0x976c[_0x5b47e1];return _0x572a56;};'use strict';var Sequelize=require('sequelize');module[_0xc976('0x0')]={'body':{'type':Sequelize[_0xc976('0x1')](_0xc976('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 37b022a..48d24e9 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(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0x7a54,0x106));var _0x47a5=function(_0x1fd943,_0x4fb6f9){_0x1fd943=_0x1fd943-0x0;var _0x2f324f=_0x7a54[_0x1fd943];return _0x2f324f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7a54,0x106));var _0x47a5=function(_0x21ff2d,_0x375e29){_0x21ff2d=_0x21ff2d-0x0;var _0x495eae=_0x7a54[_0x21ff2d];return _0x495eae;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 9f4617a..9d9c0a0 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 _0xdb60=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci'];(function(_0xddeac9,_0x2ebf8c){var _0x65fa72=function(_0x795e4f){while(--_0x795e4f){_0xddeac9['push'](_0xddeac9['shift']());}};_0x65fa72(++_0x2ebf8c);}(_0xdb60,0x6c));var _0x0db6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xdb60[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0db6('0x0'));var util=require(_0x0db6('0x1'));var logger=require(_0x0db6('0x2'))(_0x0db6('0x3'));var moment=require(_0x0db6('0x4'));var BPromise=require(_0x0db6('0x5'));var rp=require(_0x0db6('0x6'));var fs=require('fs');var path=require(_0x0db6('0x7'));var rimraf=require('rimraf');var config=require(_0x0db6('0x8'));var attributes=require('./chatOfflineMessage.attributes');module['exports']=function(_0x43c8c0,_0x1f54be){return _0x43c8c0['define'](_0x0db6('0x9'),attributes,{'tableName':_0x0db6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0db6('0xb')});}; \ No newline at end of file +var _0x949b=['ChatOfflineMessage','lodash','api','bluebird','path','../../config/environment','./chatOfflineMessage.attributes','exports','define'];(function(_0x4dbda8,_0xbce830){var _0x1149ed=function(_0x299a39){while(--_0x299a39){_0x4dbda8['push'](_0x4dbda8['shift']());}};_0x1149ed(++_0xbce830);}(_0x949b,0x88));var _0xb949=function(_0x8c4b43,_0xd43984){_0x8c4b43=_0x8c4b43-0x0;var _0x56cf12=_0x949b[_0x8c4b43];return _0x56cf12;};'use strict';var _=require(_0xb949('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb949('0x1'));var moment=require('moment');var BPromise=require(_0xb949('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb949('0x3'));var rimraf=require('rimraf');var config=require(_0xb949('0x4'));var attributes=require(_0xb949('0x5'));module[_0xb949('0x6')]=function(_0x18dbc9,_0x3f200f){return _0x18dbc9[_0xb949('0x7')](_0xb949('0x8'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e63a87b..4a1d666 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 _0x9937=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','randomstring','../../config/utils'];(function(_0x3fceca,_0x1e7b3c){var _0x4c992a=function(_0x509d6d){while(--_0x509d6d){_0x3fceca['push'](_0x3fceca['shift']());}};_0x4c992a(++_0x1e7b3c);}(_0x9937,0x164));var _0x7993=function(_0x4950f3,_0xcb3c1a){_0x4950f3=_0x4950f3-0x0;var _0x2a429f=_0x9937[_0x4950f3];return _0x2a429f;};'use strict';var _=require('lodash');var util=require(_0x7993('0x0'));var moment=require(_0x7993('0x1'));var BPromise=require('bluebird');var rs=require(_0x7993('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7993('0x3'));var logger=require('../../config/logger')(_0x7993('0x4'));var config=require(_0x7993('0x5'));var jayson=require(_0x7993('0x6'));var client=jayson[_0x7993('0x7')][_0x7993('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17f22b,_0x1b6ea9,_0x268ce6){return new BPromise(function(_0x1bb54b,_0x540b5d){return client[_0x7993('0x9')](_0x17f22b,_0x268ce6)[_0x7993('0xa')](function(_0x3847c7){logger[_0x7993('0xb')](_0x7993('0xc'),_0x1b6ea9,_0x7993('0xd'));logger[_0x7993('0xe')](_0x7993('0xf'),_0x1b6ea9,_0x7993('0xd'),JSON['stringify'](_0x3847c7));if(_0x3847c7[_0x7993('0x10')]){if(_0x3847c7[_0x7993('0x10')][_0x7993('0x11')]===0x1f4){logger['error'](_0x7993('0xc'),_0x1b6ea9,_0x3847c7[_0x7993('0x10')][_0x7993('0x12')]);return _0x540b5d(_0x3847c7[_0x7993('0x10')][_0x7993('0x12')]);}logger[_0x7993('0x10')](_0x7993('0xc'),_0x1b6ea9,_0x3847c7[_0x7993('0x10')]['message']);return _0x1bb54b(_0x3847c7[_0x7993('0x10')]['message']);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x1b6ea9,_0x7993('0xd'));_0x1bb54b(_0x3847c7['result']['message']);}})[_0x7993('0x13')](function(_0x3082ab){logger[_0x7993('0x10')](_0x7993('0xc'),_0x1b6ea9,_0x3082ab);_0x540b5d(_0x3082ab);});});} \ No newline at end of file +var _0x02df=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4da447,_0x201307){var _0x11c06f=function(_0x79f49e){while(--_0x79f49e){_0x4da447['push'](_0x4da447['shift']());}};_0x11c06f(++_0x201307);}(_0x02df,0x128));var _0xf02d=function(_0x23010f,_0x8fe0e1){_0x23010f=_0x23010f-0x0;var _0x2a445e=_0x02df[_0x23010f];return _0x2a445e;};'use strict';var _=require(_0xf02d('0x0'));var util=require(_0xf02d('0x1'));var moment=require(_0xf02d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf02d('0x3'));var fs=require('fs');var Redis=require(_0xf02d('0x4'));var db=require(_0xf02d('0x5'))['db'];var utils=require(_0xf02d('0x6'));var logger=require(_0xf02d('0x7'))(_0xf02d('0x8'));var config=require(_0xf02d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf02d('0xa')][_0xf02d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe72fc1,_0x446feb,_0x189612){return new BPromise(function(_0x3ae48b,_0x47217e){return client['request'](_0xe72fc1,_0x189612)[_0xf02d('0xc')](function(_0x13e0fb){logger[_0xf02d('0xd')](_0xf02d('0xe'),_0x446feb,_0xf02d('0xf'));logger[_0xf02d('0x10')](_0xf02d('0x11'),_0x446feb,_0xf02d('0xf'),JSON[_0xf02d('0x12')](_0x13e0fb));if(_0x13e0fb[_0xf02d('0x13')]){if(_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x14')]===0x1f4){logger[_0xf02d('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x446feb,_0x13e0fb[_0xf02d('0x13')]['message']);return _0x47217e(_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x15')]);}logger[_0xf02d('0x13')](_0xf02d('0xe'),_0x446feb,_0x13e0fb[_0xf02d('0x13')][_0xf02d('0x15')]);return _0x3ae48b(_0x13e0fb['error'][_0xf02d('0x15')]);}else{logger[_0xf02d('0xd')](_0xf02d('0xe'),_0x446feb,'request\x20sent');_0x3ae48b(_0x13e0fb[_0xf02d('0x16')][_0xf02d('0x15')]);}})[_0xf02d('0x17')](function(_0x36142e){logger['error'](_0xf02d('0xe'),_0x446feb,_0x36142e);_0x47217e(_0x36142e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 64fc549..c9899e4 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 _0xa299=['show','post','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xa299,0xce));var _0x9a29=function(_0x383576,_0xeab5ba){_0x383576=_0x383576-0x0;var _0x31fb1c=_0xa299[_0x383576];return _0x31fb1c;};'use strict';var multer=require(_0x9a29('0x0'));var util=require(_0x9a29('0x1'));var path=require(_0x9a29('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a29('0x3'));var router=express[_0x9a29('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9a29('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9a29('0x6'));var controller=require(_0x9a29('0x7'));router[_0x9a29('0x8')]('/',auth[_0x9a29('0x9')](),controller['index']);router[_0x9a29('0x8')]('/describe',auth[_0x9a29('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9a29('0xa')]);router[_0x9a29('0xb')]('/',auth[_0x9a29('0x9')](),controller['create']);router[_0x9a29('0xc')](_0x9a29('0xd'),auth[_0x9a29('0x9')](),controller[_0x9a29('0xe')]);router[_0x9a29('0xf')]('/:id',auth[_0x9a29('0x9')](),controller[_0x9a29('0x10')]);module[_0x9a29('0x11')]=router; \ No newline at end of file +var _0x59c3=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','show','post','/:id','destroy'];(function(_0x5e7095,_0x3418ac){var _0x3f4f9e=function(_0x258627){while(--_0x258627){_0x5e7095['push'](_0x5e7095['shift']());}};_0x3f4f9e(++_0x3418ac);}(_0x59c3,0x120));var _0x359c=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x59c3[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require('multer');var util=require(_0x359c('0x0'));var path=require(_0x359c('0x1'));var timeout=require('connect-timeout');var express=require(_0x359c('0x2'));var router=express[_0x359c('0x3')]();var fs_extra=require(_0x359c('0x4'));var auth=require(_0x359c('0x5'));var interaction=require(_0x359c('0x6'));var config=require(_0x359c('0x7'));var controller=require(_0x359c('0x8'));router[_0x359c('0x9')]('/',auth[_0x359c('0xa')](),controller['index']);router['get']('/describe',auth[_0x359c('0xa')](),controller[_0x359c('0xb')]);router[_0x359c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x359c('0xc')]);router[_0x359c('0xd')]('/',auth[_0x359c('0xa')](),controller['create']);router['put']('/:id',auth[_0x359c('0xa')](),controller['update']);router['delete'](_0x359c('0xe'),auth[_0x359c('0xa')](),controller[_0x359c('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 6088fa8..ed60fc7 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 _0xfa1e=['STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x49d45b,_0x58b1b8){var _0x16f8b3=function(_0x22a1ba){while(--_0x22a1ba){_0x49d45b['push'](_0x49d45b['shift']());}};_0x16f8b3(++_0x58b1b8);}(_0xfa1e,0xf5));var _0xefa1=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xfa1e[_0xdeefbd];return _0x4ff63f;};'use strict';var Sequelize=require(_0xefa1('0x0'));module['exports']={'name':{'type':Sequelize[_0xefa1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xefa1('0x2')](_0xefa1('0x3'),_0xefa1('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xefa1('0x5')]}}; \ No newline at end of file +var _0x935e=['ENUM','mouseOver','timeout','INTEGER','sequelize','exports','STRING'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x935e,0xac));var _0xe935=function(_0x1230e5,_0x1a98be){_0x1230e5=_0x1230e5-0x0;var _0x564c99=_0x935e[_0x1230e5];return _0x564c99;};'use strict';var Sequelize=require(_0xe935('0x0'));module[_0xe935('0x1')]={'name':{'type':Sequelize[_0xe935('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe935('0x3')](_0xe935('0x4'),_0xe935('0x5')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0xe935('0x2')]},'timeout':{'type':Sequelize[_0xe935('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 439a115..794dd2c 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 _0x3fc6=['sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','fields','attributes','length','include','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x145fff,_0x110a35){var _0x2ec362=function(_0x4d901f){while(--_0x4d901f){_0x145fff['push'](_0x145fff['shift']());}};_0x2ec362(++_0x110a35);}(_0x3fc6,0x159));var _0x63fc=function(_0x38d288,_0x100d8f){_0x38d288=_0x38d288-0x0;var _0x1ae855=_0x3fc6[_0x38d288];return _0x1ae855;};'use strict';var emlformat=require(_0x63fc('0x0'));var rimraf=require(_0x63fc('0x1'));var zipdir=require(_0x63fc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x63fc('0x3'));var moment=require(_0x63fc('0x4'));var BPromise=require(_0x63fc('0x5'));var Mustache=require(_0x63fc('0x6'));var util=require(_0x63fc('0x7'));var path=require(_0x63fc('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x63fc('0x9'));var fs=require('fs');var fs_extra=require(_0x63fc('0xa'));var _=require(_0x63fc('0xb'));var squel=require('squel');var crypto=require(_0x63fc('0xc'));var jsforce=require(_0x63fc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x63fc('0xe'));var querystring=require(_0x63fc('0xf'));var Papa=require(_0x63fc('0x10'));var Redis=require(_0x63fc('0x11'));var authService=require(_0x63fc('0x12'));var qs=require(_0x63fc('0x13'));var as=require(_0x63fc('0x14'));var hardwareService=require(_0x63fc('0x15'));var logger=require(_0x63fc('0x16'))(_0x63fc('0x17'));var utils=require('../../config/utils');var config=require(_0x63fc('0x18'));var licenseUtil=require(_0x63fc('0x19'));var db=require(_0x63fc('0x1a'))['db'];function respondWithStatusCode(_0x4cdde1,_0x493528){_0x493528=_0x493528||0xcc;return function(_0x293c4c){if(_0x293c4c){return _0x4cdde1[_0x63fc('0x1b')](_0x493528);}return _0x4cdde1[_0x63fc('0x1c')](_0x493528)[_0x63fc('0x1d')]();};}function respondWithResult(_0xed9cc1,_0x1bcf57){_0x1bcf57=_0x1bcf57||0xc8;return function(_0x4ebbbf){if(_0x4ebbbf){return _0xed9cc1[_0x63fc('0x1c')](_0x1bcf57)[_0x63fc('0x1e')](_0x4ebbbf);}};}function respondWithFilteredResult(_0x46926d,_0x337192){return function(_0x5c4c72){if(_0x5c4c72){var _0x3cd826=typeof _0x337192['offset']===_0x63fc('0x1f')&&typeof _0x337192[_0x63fc('0x20')]===_0x63fc('0x1f');var _0x42ef5e=_0x5c4c72[_0x63fc('0x21')];var _0x5e0630=_0x3cd826?0x0:_0x337192[_0x63fc('0x22')];var _0x71ad1d=_0x3cd826?_0x5c4c72[_0x63fc('0x21')]:_0x337192['offset']+_0x337192['limit'];var _0x6e1361;if(_0x71ad1d>=_0x42ef5e){_0x71ad1d=_0x42ef5e;_0x6e1361=0xc8;}else{_0x6e1361=0xce;}_0x46926d[_0x63fc('0x1c')](_0x6e1361);return _0x46926d['set'](_0x63fc('0x23'),_0x5e0630+'-'+_0x71ad1d+'/'+_0x42ef5e)['json'](_0x5c4c72);}return null;};}function patchUpdates(_0x1c2198){return function(_0x2c6d11){try{jsonpatch[_0x63fc('0x24')](_0x2c6d11,_0x1c2198,!![]);}catch(_0x40ae7a){return BPromise[_0x63fc('0x25')](_0x40ae7a);}return _0x2c6d11[_0x63fc('0x26')]();};}function saveUpdates(_0x3047cf,_0x57528b){return function(_0x2e991e){if(_0x2e991e){return _0x2e991e[_0x63fc('0x27')](_0x3047cf)[_0x63fc('0x28')](function(_0x1dcec0){return _0x1dcec0;});}return null;};}function removeEntity(_0x2dd713,_0x561c9b){return function(_0x4f6498){if(_0x4f6498){return _0x4f6498[_0x63fc('0x29')]()[_0x63fc('0x28')](function(){_0x2dd713[_0x63fc('0x1c')](0xcc)[_0x63fc('0x1d')]();});}};}function handleEntityNotFound(_0x59b130,_0x184b80){return function(_0x3af124){if(!_0x3af124){_0x59b130[_0x63fc('0x1b')](0x194);}return _0x3af124;};}function handleError(_0x2d1dc3,_0x3d7b61){_0x3d7b61=_0x3d7b61||0x1f4;return function(_0x390f41){logger[_0x63fc('0x2a')](_0x390f41[_0x63fc('0x2b')]);if(_0x390f41['name']){delete _0x390f41['name'];}_0x2d1dc3[_0x63fc('0x1c')](_0x3d7b61)[_0x63fc('0x2c')](_0x390f41);};}exports['show']=function(_0x53e3c6,_0x5ace6f){var _0x3bb029={'raw':!![],'where':{'id':_0x53e3c6[_0x63fc('0x2d')]['id']}},_0x17c0fd={};_0x17c0fd[_0x63fc('0x2e')]=_[_0x63fc('0x2f')](db[_0x63fc('0x30')][_0x63fc('0x31')]);_0x17c0fd['query']=_[_0x63fc('0x2f')](_0x53e3c6[_0x63fc('0x32')]);_0x17c0fd['filters']=_[_0x63fc('0x33')](_0x17c0fd[_0x63fc('0x2e')],_0x17c0fd[_0x63fc('0x32')]);_0x3bb029['attributes']=_[_0x63fc('0x33')](_0x17c0fd['model'],qs[_0x63fc('0x34')](_0x53e3c6[_0x63fc('0x32')][_0x63fc('0x34')]));_0x3bb029['attributes']=_0x3bb029[_0x63fc('0x35')][_0x63fc('0x36')]?_0x3bb029[_0x63fc('0x35')]:_0x17c0fd['model'];if(_0x53e3c6[_0x63fc('0x32')]['includeAll']){_0x3bb029[_0x63fc('0x37')]=[{'all':!![]}];}_0x3bb029=_[_0x63fc('0x38')]({},_0x3bb029,_0x53e3c6[_0x63fc('0x39')]);return db['ChatProactiveAction'][_0x63fc('0x3a')](_0x3bb029)[_0x63fc('0x28')](handleEntityNotFound(_0x5ace6f,null))[_0x63fc('0x28')](respondWithResult(_0x5ace6f,null))['catch'](handleError(_0x5ace6f,null));};exports[_0x63fc('0x3b')]=function(_0x57df97,_0x168d8d){return db[_0x63fc('0x30')]['create'](_0x57df97[_0x63fc('0x3c')],{})[_0x63fc('0x28')](respondWithResult(_0x168d8d,0xc9))['catch'](handleError(_0x168d8d,null));};exports[_0x63fc('0x27')]=function(_0x48c3ca,_0x4de243){if(_0x48c3ca['body']['id']){delete _0x48c3ca['body']['id'];}return db[_0x63fc('0x30')][_0x63fc('0x3a')]({'where':{'id':_0x48c3ca[_0x63fc('0x2d')]['id']}})['then'](handleEntityNotFound(_0x4de243,null))[_0x63fc('0x28')](saveUpdates(_0x48c3ca[_0x63fc('0x3c')],null))['then'](respondWithResult(_0x4de243,null))['catch'](handleError(_0x4de243,null));};exports[_0x63fc('0x29')]=function(_0x16552e,_0x516e71){return db[_0x63fc('0x30')][_0x63fc('0x3a')]({'where':{'id':_0x16552e['params']['id']}})['then'](handleEntityNotFound(_0x516e71,null))[_0x63fc('0x28')](removeEntity(_0x516e71,null))[_0x63fc('0x3d')](handleError(_0x516e71,null));}; \ No newline at end of file +var _0xf776=['include','merge','ChatProactiveAction','catch','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','reject','update','then','destroy','error','stack','name','show','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll'];(function(_0x272bf3,_0x2226b6){var _0x33c087=function(_0x4b9467){while(--_0x4b9467){_0x272bf3['push'](_0x272bf3['shift']());}};_0x33c087(++_0x2226b6);}(_0xf776,0x169));var _0x6f77=function(_0x4100e5,_0x4656a1){_0x4100e5=_0x4100e5-0x0;var _0x5663cf=_0xf776[_0x4100e5];return _0x5663cf;};'use strict';var emlformat=require(_0x6f77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6f77('0x1'));var jsonpatch=require(_0x6f77('0x2'));var rp=require('request-promise');var moment=require(_0x6f77('0x3'));var BPromise=require(_0x6f77('0x4'));var Mustache=require(_0x6f77('0x5'));var util=require(_0x6f77('0x6'));var path=require('path');var sox=require(_0x6f77('0x7'));var csv=require('to-csv');var ejs=require(_0x6f77('0x8'));var fs=require('fs');var fs_extra=require(_0x6f77('0x9'));var _=require(_0x6f77('0xa'));var squel=require(_0x6f77('0xb'));var crypto=require('crypto');var jsforce=require(_0x6f77('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6f77('0xd'));var querystring=require(_0x6f77('0xe'));var Papa=require(_0x6f77('0xf'));var Redis=require(_0x6f77('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6f77('0x11'));var as=require(_0x6f77('0x12'));var hardwareService=require(_0x6f77('0x13'));var logger=require(_0x6f77('0x14'))(_0x6f77('0x15'));var utils=require(_0x6f77('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6f77('0x17'));var db=require(_0x6f77('0x18'))['db'];function respondWithStatusCode(_0x150260,_0x17fda5){_0x17fda5=_0x17fda5||0xcc;return function(_0x413e19){if(_0x413e19){return _0x150260[_0x6f77('0x19')](_0x17fda5);}return _0x150260[_0x6f77('0x1a')](_0x17fda5)[_0x6f77('0x1b')]();};}function respondWithResult(_0x34547,_0x28e354){_0x28e354=_0x28e354||0xc8;return function(_0x386c51){if(_0x386c51){return _0x34547[_0x6f77('0x1a')](_0x28e354)['json'](_0x386c51);}};}function respondWithFilteredResult(_0x48c26c,_0x17c0a5){return function(_0x2b9b87){if(_0x2b9b87){var _0x5cf3b9=typeof _0x17c0a5[_0x6f77('0x1c')]==='undefined'&&typeof _0x17c0a5[_0x6f77('0x1d')]===_0x6f77('0x1e');var _0x531908=_0x2b9b87['count'];var _0x42f774=_0x5cf3b9?0x0:_0x17c0a5[_0x6f77('0x1c')];var _0x128e84=_0x5cf3b9?_0x2b9b87[_0x6f77('0x1f')]:_0x17c0a5[_0x6f77('0x1c')]+_0x17c0a5[_0x6f77('0x1d')];var _0x3f9943;if(_0x128e84>=_0x531908){_0x128e84=_0x531908;_0x3f9943=0xc8;}else{_0x3f9943=0xce;}_0x48c26c[_0x6f77('0x1a')](_0x3f9943);return _0x48c26c['set'](_0x6f77('0x20'),_0x42f774+'-'+_0x128e84+'/'+_0x531908)[_0x6f77('0x21')](_0x2b9b87);}return null;};}function patchUpdates(_0x3ce6ad){return function(_0x5298e2){try{jsonpatch['apply'](_0x5298e2,_0x3ce6ad,!![]);}catch(_0x499678){return BPromise[_0x6f77('0x22')](_0x499678);}return _0x5298e2['save']();};}function saveUpdates(_0x142416,_0x2d7970){return function(_0x494765){if(_0x494765){return _0x494765[_0x6f77('0x23')](_0x142416)[_0x6f77('0x24')](function(_0x2df95d){return _0x2df95d;});}return null;};}function removeEntity(_0x292ddc,_0x2c0cb2){return function(_0x5e09d6){if(_0x5e09d6){return _0x5e09d6[_0x6f77('0x25')]()[_0x6f77('0x24')](function(){_0x292ddc[_0x6f77('0x1a')](0xcc)[_0x6f77('0x1b')]();});}};}function handleEntityNotFound(_0x2a8a41,_0x12c392){return function(_0x2a907d){if(!_0x2a907d){_0x2a8a41['sendStatus'](0x194);}return _0x2a907d;};}function handleError(_0x4a35d0,_0x1f4af8){_0x1f4af8=_0x1f4af8||0x1f4;return function(_0x1e503c){logger[_0x6f77('0x26')](_0x1e503c[_0x6f77('0x27')]);if(_0x1e503c[_0x6f77('0x28')]){delete _0x1e503c[_0x6f77('0x28')];}_0x4a35d0['status'](_0x1f4af8)['send'](_0x1e503c);};}exports[_0x6f77('0x29')]=function(_0x3904f9,_0x1d08de){var _0x2f2b23={'raw':!![],'where':{'id':_0x3904f9[_0x6f77('0x2a')]['id']}},_0x1381af={};_0x1381af[_0x6f77('0x2b')]=_[_0x6f77('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x1381af[_0x6f77('0x2d')]=_[_0x6f77('0x2c')](_0x3904f9[_0x6f77('0x2d')]);_0x1381af[_0x6f77('0x2e')]=_[_0x6f77('0x2f')](_0x1381af['model'],_0x1381af[_0x6f77('0x2d')]);_0x2f2b23[_0x6f77('0x30')]=_[_0x6f77('0x2f')](_0x1381af['model'],qs[_0x6f77('0x31')](_0x3904f9['query']['fields']));_0x2f2b23[_0x6f77('0x30')]=_0x2f2b23[_0x6f77('0x30')][_0x6f77('0x32')]?_0x2f2b23[_0x6f77('0x30')]:_0x1381af[_0x6f77('0x2b')];if(_0x3904f9[_0x6f77('0x2d')][_0x6f77('0x33')]){_0x2f2b23[_0x6f77('0x34')]=[{'all':!![]}];}_0x2f2b23=_[_0x6f77('0x35')]({},_0x2f2b23,_0x3904f9['options']);return db[_0x6f77('0x36')]['find'](_0x2f2b23)[_0x6f77('0x24')](handleEntityNotFound(_0x1d08de,null))['then'](respondWithResult(_0x1d08de,null))[_0x6f77('0x37')](handleError(_0x1d08de,null));};exports[_0x6f77('0x38')]=function(_0x5d6cff,_0xe00f94){return db[_0x6f77('0x36')][_0x6f77('0x38')](_0x5d6cff[_0x6f77('0x39')],{})[_0x6f77('0x24')](respondWithResult(_0xe00f94,0xc9))['catch'](handleError(_0xe00f94,null));};exports[_0x6f77('0x23')]=function(_0x347d37,_0x28dcff){if(_0x347d37[_0x6f77('0x39')]['id']){delete _0x347d37[_0x6f77('0x39')]['id'];}return db['ChatProactiveAction'][_0x6f77('0x3a')]({'where':{'id':_0x347d37[_0x6f77('0x2a')]['id']}})[_0x6f77('0x24')](handleEntityNotFound(_0x28dcff,null))[_0x6f77('0x24')](saveUpdates(_0x347d37[_0x6f77('0x39')],null))['then'](respondWithResult(_0x28dcff,null))[_0x6f77('0x37')](handleError(_0x28dcff,null));};exports['destroy']=function(_0x2445c6,_0x21b4aa){return db[_0x6f77('0x36')][_0x6f77('0x3a')]({'where':{'id':_0x2445c6[_0x6f77('0x2a')]['id']}})['then'](handleEntityNotFound(_0x21b4aa,null))[_0x6f77('0x24')](removeEntity(_0x21b4aa,null))[_0x6f77('0x37')](handleError(_0x21b4aa,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 318cc86..a634578 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 _0xd5ba=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','lodash'];(function(_0xd511d,_0x3546b9){var _0x3f148e=function(_0x51f35f){while(--_0x51f35f){_0xd511d['push'](_0xd511d['shift']());}};_0x3f148e(++_0x3546b9);}(_0xd5ba,0x154));var _0xad5b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd5ba[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xad5b('0x0'));var util=require(_0xad5b('0x1'));var logger=require(_0xad5b('0x2'))(_0xad5b('0x3'));var moment=require(_0xad5b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xad5b('0x5'));var rimraf=require(_0xad5b('0x6'));var config=require(_0xad5b('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0xad5b('0x8')]=function(_0x2c49e5,_0x74eb3f){return _0x2c49e5[_0xad5b('0x9')](_0xad5b('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4839=['../../config/environment','./chatProactiveAction.attributes','chat_proactive_actions','lodash','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x2386dd,_0x3777a1){var _0x195648=function(_0x411c1e){while(--_0x411c1e){_0x2386dd['push'](_0x2386dd['shift']());}};_0x195648(++_0x3777a1);}(_0x4839,0x12f));var _0x9483=function(_0x6ef16f,_0x1722ae){_0x6ef16f=_0x6ef16f-0x0;var _0x484cc5=_0x4839[_0x6ef16f];return _0x484cc5;};'use strict';var _=require(_0x9483('0x0'));var util=require(_0x9483('0x1'));var logger=require(_0x9483('0x2'))(_0x9483('0x3'));var moment=require(_0x9483('0x4'));var BPromise=require('bluebird');var rp=require(_0x9483('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9483('0x6'));var config=require(_0x9483('0x7'));var attributes=require(_0x9483('0x8'));module['exports']=function(_0x39b4be,_0x1287a7){return _0x39b4be['define']('ChatProactiveAction',attributes,{'tableName':_0x9483('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 452592b..32305d0 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 _0xc193=['../../config/environment','jayson/promise','client','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','info','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0xbc2d9e,_0x40ef4f){var _0x2e315c=function(_0x57fc55){while(--_0x57fc55){_0xbc2d9e['push'](_0xbc2d9e['shift']());}};_0x2e315c(++_0x40ef4f);}(_0xc193,0x1e0));var _0x3c19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc193[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c19('0x0'));var util=require(_0x3c19('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3c19('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c19('0x3'))['db'];var utils=require(_0x3c19('0x4'));var logger=require('../../config/logger')(_0x3c19('0x5'));var config=require(_0x3c19('0x6'));var jayson=require(_0x3c19('0x7'));var client=jayson[_0x3c19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd8605a,_0x314107,_0x27b9a3){return new BPromise(function(_0x4384a7,_0x51b8ff){return client['request'](_0xd8605a,_0x27b9a3)[_0x3c19('0x9')](function(_0x33e737){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x314107,_0x3c19('0xa'));logger[_0x3c19('0xb')](_0x3c19('0xc'),_0x314107,_0x3c19('0xa'),JSON[_0x3c19('0xd')](_0x33e737));if(_0x33e737['error']){if(_0x33e737['error']['code']===0x1f4){logger[_0x3c19('0xe')](_0x3c19('0xf'),_0x314107,_0x33e737[_0x3c19('0xe')][_0x3c19('0x10')]);return _0x51b8ff(_0x33e737[_0x3c19('0xe')]['message']);}logger[_0x3c19('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x314107,_0x33e737[_0x3c19('0xe')][_0x3c19('0x10')]);return _0x4384a7(_0x33e737[_0x3c19('0xe')][_0x3c19('0x10')]);}else{logger[_0x3c19('0x11')](_0x3c19('0xf'),_0x314107,_0x3c19('0xa'));_0x4384a7(_0x33e737['result']['message']);}})['catch'](function(_0x12dd51){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x314107,_0x12dd51);_0x51b8ff(_0x12dd51);});});} \ No newline at end of file +var _0xd095=['../../config/environment','jayson/promise','client','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x137e04,_0x3c0799){var _0x4c6762=function(_0x45f489){while(--_0x45f489){_0x137e04['push'](_0x137e04['shift']());}};_0x4c6762(++_0x3c0799);}(_0xd095,0xd5));var _0x5d09=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xd095[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0x5d09('0x0'));var util=require('util');var moment=require(_0x5d09('0x1'));var BPromise=require(_0x5d09('0x2'));var rs=require(_0x5d09('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d09('0x4'))['db'];var utils=require(_0x5d09('0x5'));var logger=require('../../config/logger')(_0x5d09('0x6'));var config=require(_0x5d09('0x7'));var jayson=require(_0x5d09('0x8'));var client=jayson[_0x5d09('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b1515,_0x44b475,_0x26dd0e){return new BPromise(function(_0x113be2,_0x214744){return client['request'](_0x3b1515,_0x26dd0e)[_0x5d09('0xa')](function(_0x2bccfc){logger['info'](_0x5d09('0xb'),_0x44b475,_0x5d09('0xc'));logger[_0x5d09('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x44b475,'request\x20sent',JSON[_0x5d09('0xe')](_0x2bccfc));if(_0x2bccfc[_0x5d09('0xf')]){if(_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x10')]===0x1f4){logger[_0x5d09('0xf')](_0x5d09('0xb'),_0x44b475,_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x11')]);return _0x214744(_0x2bccfc['error'][_0x5d09('0x11')]);}logger[_0x5d09('0xf')](_0x5d09('0xb'),_0x44b475,_0x2bccfc['error']['message']);return _0x113be2(_0x2bccfc[_0x5d09('0xf')][_0x5d09('0x11')]);}else{logger[_0x5d09('0x12')](_0x5d09('0xb'),_0x44b475,_0x5d09('0xc'));_0x113be2(_0x2bccfc['result'][_0x5d09('0x11')]);}})[_0x5d09('0x13')](function(_0x496873){logger['error'](_0x5d09('0xb'),_0x44b475,_0x496873);_0x214744(_0x496873);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6e35b0b..51bfbbd 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 _0xdc97=['get','/:id','show','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller'];(function(_0x1a5bcf,_0x25b189){var _0x312c29=function(_0x16a633){while(--_0x16a633){_0x1a5bcf['push'](_0x1a5bcf['shift']());}};_0x312c29(++_0x25b189);}(_0xdc97,0x13b));var _0x7dc9=function(_0xfb6347,_0x2dd312){_0xfb6347=_0xfb6347-0x0;var _0x2f7997=_0xdc97[_0xfb6347];return _0x2f7997;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')](_0x7dc9('0x9'),auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7dc9('0xb')]);router[_0x7dc9('0xc')](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xe')]);router['delete'](_0x7dc9('0x9'),auth[_0x7dc9('0xd')](),controller[_0x7dc9('0xf')]);module[_0x7dc9('0x10')]=router; \ No newline at end of file +var _0x207c=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x3bbacb,_0x3a554a){var _0x1ea059=function(_0x32a962){while(--_0x32a962){_0x3bbacb['push'](_0x3bbacb['shift']());}};_0x1ea059(++_0x3a554a);}(_0x207c,0x1e8));var _0xc207=function(_0x497641,_0x5d4f64){_0x497641=_0x497641-0x0;var _0x3c355e=_0x207c[_0x497641];return _0x3c355e;};'use strict';var multer=require('multer');var util=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var timeout=require(_0xc207('0x2'));var express=require(_0xc207('0x3'));var router=express[_0xc207('0x4')]();var fs_extra=require(_0xc207('0x5'));var auth=require(_0xc207('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc207('0x7'));var controller=require('./chatProactiveAction.controller');router['get']('/:id',auth[_0xc207('0x8')](),controller[_0xc207('0x9')]);router[_0xc207('0xa')]('/',auth['isAuthenticated'](),controller[_0xc207('0xb')]);router[_0xc207('0xc')](_0xc207('0xd'),auth['isAuthenticated'](),controller[_0xc207('0xe')]);router[_0xc207('0xf')](_0xc207('0xd'),auth[_0xc207('0x8')](),controller[_0xc207('0x10')]);module[_0xc207('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 7c603c3..c885d50 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 _0x578d=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x578d,0x95));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd578('0x0')]={'name':{'type':Sequelize[_0xd578('0x1')],'unique':_0xd578('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd578('0x1')]},'timeout':{'type':Sequelize[_0xd578('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xd578('0x4'),_0xd578('0x5'),_0xd578('0x6'))}}; \ No newline at end of file +var _0x5942=['roundrobin','sequelize','exports','INTEGER','ENUM','rrmemory'];(function(_0x45ea9d,_0x2e2a68){var _0x367e67=function(_0x5243ca){while(--_0x5243ca){_0x45ea9d['push'](_0x45ea9d['shift']());}};_0x367e67(++_0x2e2a68);}(_0x5942,0xaf));var _0x2594=function(_0x3b4979,_0x29bd1b){_0x3b4979=_0x3b4979-0x0;var _0x52aa62=_0x5942[_0x3b4979];return _0x52aa62;};'use strict';var Sequelize=require(_0x2594('0x0'));module[_0x2594('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2594('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2594('0x3')](_0x2594('0x4'),'beepall',_0x2594('0x5'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 5601b97..29887d9 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 _0x2490=['QueryTypes','SELECT','every','TeamId','all','union','value','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','get','sendStatus','name','send','map','ChatQueue','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','ChatQueueId','UserChatQueue','findAll','findAndCountAll','UserId','agent','chatPause','createdAt','rows','%s/%s','SIP','updatedAt','Team','getTeams','ids','Agents','online','interface','flatMap','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2490,0x145));var _0x0249=function(_0x4afac5,_0x5e3825){_0x4afac5=_0x4afac5-0x0;var _0x14238c=_0x2490[_0x4afac5];return _0x14238c;};'use strict';var emlformat=require(_0x0249('0x0'));var rimraf=require(_0x0249('0x1'));var zipdir=require(_0x0249('0x2'));var jsonpatch=require(_0x0249('0x3'));var rp=require(_0x0249('0x4'));var moment=require(_0x0249('0x5'));var BPromise=require(_0x0249('0x6'));var Mustache=require(_0x0249('0x7'));var util=require(_0x0249('0x8'));var path=require(_0x0249('0x9'));var sox=require(_0x0249('0xa'));var csv=require('to-csv');var ejs=require(_0x0249('0xb'));var fs=require('fs');var fs_extra=require(_0x0249('0xc'));var _=require(_0x0249('0xd'));var squel=require(_0x0249('0xe'));var crypto=require(_0x0249('0xf'));var jsforce=require(_0x0249('0x10'));var deskjs=require(_0x0249('0x11'));var toCsv=require(_0x0249('0x12'));var querystring=require('querystring');var Papa=require(_0x0249('0x13'));var Redis=require(_0x0249('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0249('0x15'));var logger=require(_0x0249('0x16'))(_0x0249('0x17'));var utils=require(_0x0249('0x18'));var config=require(_0x0249('0x19'));var licenseUtil=require(_0x0249('0x1a'));var db=require(_0x0249('0x1b'))['db'];config[_0x0249('0x1c')]=_[_0x0249('0x1d')](config[_0x0249('0x1c')],{'host':_0x0249('0x1e'),'port':0x18eb});var socket=require(_0x0249('0x1f'))(new Redis(config[_0x0249('0x1c')]));require(_0x0249('0x20'))['register'](socket);var jayson=require(_0x0249('0x21'));var client=jayson['client'][_0x0249('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x52e3c3,_0x2c018b,_0x9c1034,_0x22b656){return new BPromise(function(_0x359315,_0x5d05d4){var _0x2fdc89=_0x22b656||client;return _0x2fdc89[_0x0249('0x23')](_0x52e3c3,_0x9c1034)[_0x0249('0x24')](function(_0x59b662){logger[_0x0249('0x25')]('ChatQueue,\x20%s,\x20%s',_0x2c018b,_0x0249('0x26'));logger[_0x0249('0x27')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x2c018b,'request\x20sent',JSON['stringify'](_0x59b662));if(_0x59b662[_0x0249('0x28')]){if(_0x59b662['error'][_0x0249('0x29')]===0x1f4){logger['error'](_0x0249('0x2a'),_0x2c018b,_0x59b662['error'][_0x0249('0x2b')]);return _0x5d05d4(_0x59b662['error'][_0x0249('0x2b')]);}logger[_0x0249('0x28')](_0x0249('0x2a'),_0x2c018b,_0x59b662['error'][_0x0249('0x2b')]);return _0x359315(_0x59b662[_0x0249('0x28')][_0x0249('0x2b')]);}else{logger[_0x0249('0x25')](_0x0249('0x2a'),_0x2c018b,'request\x20sent');_0x359315(_0x59b662[_0x0249('0x2c')][_0x0249('0x2b')]);}})[_0x0249('0x2d')](function(_0x240c0c){logger[_0x0249('0x28')](_0x0249('0x2a'),_0x2c018b,_0x240c0c);_0x5d05d4(_0x240c0c);});});}function respondWithStatusCode(_0x3304a4,_0x1675ba){_0x1675ba=_0x1675ba||0xcc;return function(_0xc4dd37){if(_0xc4dd37){return _0x3304a4['sendStatus'](_0x1675ba);}return _0x3304a4[_0x0249('0x2e')](_0x1675ba)[_0x0249('0x2f')]();};}function respondWithResult(_0x280330,_0x7066db){_0x7066db=_0x7066db||0xc8;return function(_0x21c44f){if(_0x21c44f){return _0x280330[_0x0249('0x2e')](_0x7066db)[_0x0249('0x30')](_0x21c44f);}};}function respondWithFilteredResult(_0x4131be,_0x495177){return function(_0x52e467){if(_0x52e467){var _0x1106b8=typeof _0x495177[_0x0249('0x31')]==='undefined'&&typeof _0x495177[_0x0249('0x32')]===_0x0249('0x33');var _0x1cb107=_0x52e467['count'];var _0x1ce174=_0x1106b8?0x0:_0x495177[_0x0249('0x31')];var _0x64004f=_0x1106b8?_0x52e467[_0x0249('0x34')]:_0x495177[_0x0249('0x31')]+_0x495177[_0x0249('0x32')];var _0x5113cc;if(_0x64004f>=_0x1cb107){_0x64004f=_0x1cb107;_0x5113cc=0xc8;}else{_0x5113cc=0xce;}_0x4131be[_0x0249('0x2e')](_0x5113cc);return _0x4131be['set'](_0x0249('0x35'),_0x1ce174+'-'+_0x64004f+'/'+_0x1cb107)[_0x0249('0x30')](_0x52e467);}return null;};}function patchUpdates(_0x4741e1){return function(_0xe4088f){try{jsonpatch[_0x0249('0x36')](_0xe4088f,_0x4741e1,!![]);}catch(_0x5b9dd9){return BPromise[_0x0249('0x37')](_0x5b9dd9);}return _0xe4088f[_0x0249('0x38')]();};}function saveUpdates(_0x151d4a,_0x463e9e){return function(_0x471f9d){if(_0x471f9d){return _0x471f9d[_0x0249('0x39')](_0x151d4a)[_0x0249('0x24')](function(_0x4d1b16){return _0x4d1b16;});}return null;};}function removeEntity(_0x28f747,_0x121d3f){return function(_0x1cfda3){if(_0x1cfda3){return _0x1cfda3[_0x0249('0x3a')]()['then'](function(){var _0x5beb50=_0x1cfda3[_0x0249('0x3b')]({'plain':!![]});var _0x415e6e='ChatQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x415e6e,'resourceId':_0x5beb50['id']}})[_0x0249('0x24')](function(){return _0x1cfda3;});})['then'](function(){_0x28f747['status'](0xcc)[_0x0249('0x2f')]();});}};}function handleEntityNotFound(_0x18493f,_0x4c9dde){return function(_0x56e4ef){if(!_0x56e4ef){_0x18493f[_0x0249('0x3c')](0x194);}return _0x56e4ef;};}function handleError(_0x1a86e5,_0x29337a){_0x29337a=_0x29337a||0x1f4;return function(_0xe46f87){logger[_0x0249('0x28')](_0xe46f87['stack']);if(_0xe46f87['name']){delete _0xe46f87[_0x0249('0x3d')];}_0x1a86e5['status'](_0x29337a)[_0x0249('0x3e')](_0xe46f87);};}exports['index']=function(_0xdd0c76,_0x251cc7){var _0x5194c5={},_0x399369={},_0x1d1cae={'count':0x0,'rows':[]};var _0x9c9bb4=_[_0x0249('0x3f')](db[_0x0249('0x40')]['rawAttributes'],function(_0x2d3b08){return{'name':_0x2d3b08[_0x0249('0x41')],'type':_0x2d3b08[_0x0249('0x42')][_0x0249('0x43')]};});_0x399369[_0x0249('0x44')]=_[_0x0249('0x3f')](_0x9c9bb4,'name');_0x399369[_0x0249('0x45')]=_['keys'](_0xdd0c76[_0x0249('0x45')]);_0x399369[_0x0249('0x46')]=_['intersection'](_0x399369[_0x0249('0x44')],_0x399369['query']);_0x5194c5[_0x0249('0x47')]=_[_0x0249('0x48')](_0x399369[_0x0249('0x44')],qs[_0x0249('0x49')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x49')]));_0x5194c5['attributes']=_0x5194c5[_0x0249('0x47')][_0x0249('0x4a')]?_0x5194c5[_0x0249('0x47')]:_0x399369[_0x0249('0x44')];if(!_0xdd0c76[_0x0249('0x45')]['hasOwnProperty'](_0x0249('0x4b'))){_0x5194c5[_0x0249('0x32')]=qs[_0x0249('0x32')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x32')]);_0x5194c5[_0x0249('0x31')]=qs[_0x0249('0x31')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x31')]);}_0x5194c5[_0x0249('0x4c')]=qs[_0x0249('0x4d')](_0xdd0c76[_0x0249('0x45')][_0x0249('0x4d')]);_0x5194c5[_0x0249('0x4e')]=qs[_0x0249('0x46')](_[_0x0249('0x4f')](_0xdd0c76[_0x0249('0x45')],_0x399369['filters']),_0x9c9bb4);if(_0xdd0c76[_0x0249('0x45')][_0x0249('0x50')]){_0x5194c5[_0x0249('0x4e')]=_[_0x0249('0x51')](_0x5194c5[_0x0249('0x4e')],{'$or':_[_0x0249('0x3f')](_0x9c9bb4,function(_0xa13374){if(_0xa13374[_0x0249('0x42')]!==_0x0249('0x52')){var _0x5418f0={};_0x5418f0[_0xa13374[_0x0249('0x3d')]]={'$like':'%'+_0xdd0c76[_0x0249('0x45')][_0x0249('0x50')]+'%'};return _0x5418f0;}})});}_0x5194c5=_[_0x0249('0x51')]({},_0x5194c5,_0xdd0c76[_0x0249('0x53')]);var _0x41ad82={'where':_0x5194c5[_0x0249('0x4e')]};return db[_0x0249('0x40')][_0x0249('0x34')](_0x41ad82)[_0x0249('0x24')](function(_0x488e20){_0x1d1cae['count']=_0x488e20;if(_0xdd0c76['query'][_0x0249('0x54')]){_0x5194c5[_0x0249('0x55')]=[{'all':!![]}];}return db['ChatQueue']['findAll'](_0x5194c5);})[_0x0249('0x24')](function(_0x2c581c){_0x1d1cae['rows']=_0x2c581c;return _0x1d1cae;})['then'](respondWithFilteredResult(_0x251cc7,_0x5194c5))[_0x0249('0x2d')](handleError(_0x251cc7,null));};exports['show']=function(_0x576517,_0x248fb0){var _0x552320={'raw':!![],'where':{'id':_0x576517['params']['id']}},_0x59a280={};_0x59a280[_0x0249('0x44')]=_[_0x0249('0x56')](db[_0x0249('0x40')][_0x0249('0x57')]);_0x59a280[_0x0249('0x45')]=_[_0x0249('0x56')](_0x576517[_0x0249('0x45')]);_0x59a280[_0x0249('0x46')]=_[_0x0249('0x48')](_0x59a280[_0x0249('0x44')],_0x59a280['query']);_0x552320[_0x0249('0x47')]=_['intersection'](_0x59a280[_0x0249('0x44')],qs[_0x0249('0x49')](_0x576517[_0x0249('0x45')][_0x0249('0x49')]));_0x552320[_0x0249('0x47')]=_0x552320[_0x0249('0x47')]['length']?_0x552320[_0x0249('0x47')]:_0x59a280['model'];if(_0x576517[_0x0249('0x45')][_0x0249('0x54')]){_0x552320[_0x0249('0x55')]=[{'all':!![]}];}_0x552320=_[_0x0249('0x51')]({},_0x552320,_0x576517[_0x0249('0x53')]);return db[_0x0249('0x40')][_0x0249('0x58')](_0x552320)[_0x0249('0x24')](handleEntityNotFound(_0x248fb0,null))['then'](respondWithResult(_0x248fb0,null))[_0x0249('0x2d')](handleError(_0x248fb0,null));};exports[_0x0249('0x59')]=function(_0x309cb8,_0x5722cf){return db[_0x0249('0x40')][_0x0249('0x59')](_0x309cb8[_0x0249('0x5a')],{})[_0x0249('0x24')](function(_0x4c9f3d){var _0x249756=_0x309cb8[_0x0249('0x5b')][_0x0249('0x3b')]({'plain':!![]});if(!_0x249756)throw new Error(_0x0249('0x5c'));if(_0x249756['role']===_0x0249('0x5b')){var _0x4637a8=_0x4c9f3d[_0x0249('0x3b')]({'plain':!![]});var _0x2e3d8c=_0x0249('0x5d');return db[_0x0249('0x5e')][_0x0249('0x58')]({'where':{'name':_0x2e3d8c,'userProfileId':_0x249756[_0x0249('0x5f')]},'raw':!![]})[_0x0249('0x24')](function(_0x1e62e3){if(_0x1e62e3&&_0x1e62e3[_0x0249('0x60')]===0x0){return db[_0x0249('0x61')]['create']({'name':_0x4637a8[_0x0249('0x3d')],'resourceId':_0x4637a8['id'],'type':_0x1e62e3[_0x0249('0x3d')],'sectionId':_0x1e62e3['id']},{})[_0x0249('0x24')](function(){return _0x4c9f3d;});}else{return _0x4c9f3d;}})[_0x0249('0x2d')](function(_0x3bb658){logger[_0x0249('0x28')](_0x0249('0x62'),_0x3bb658);throw _0x3bb658;});}return _0x4c9f3d;})[_0x0249('0x24')](respondWithResult(_0x5722cf,0xc9))[_0x0249('0x2d')](handleError(_0x5722cf,null));};exports['update']=function(_0x4f169f,_0x5e61fe){if(_0x4f169f[_0x0249('0x5a')]['id']){delete _0x4f169f[_0x0249('0x5a')]['id'];}return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x4f169f['params']['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x5e61fe,null))[_0x0249('0x24')](saveUpdates(_0x4f169f[_0x0249('0x5a')],null))[_0x0249('0x24')](respondWithResult(_0x5e61fe,null))['catch'](handleError(_0x5e61fe,null));};exports[_0x0249('0x3a')]=function(_0x4e2bac,_0x172036){return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x4e2bac[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x172036,null))[_0x0249('0x24')](removeEntity(_0x172036,null))[_0x0249('0x2d')](handleError(_0x172036,null));};exports[_0x0249('0x64')]=function(_0x4935ab,_0x18b746){return db['ChatQueue'][_0x0249('0x64')]()[_0x0249('0x24')](respondWithResult(_0x18b746,null))[_0x0249('0x2d')](handleError(_0x18b746,null));};exports[_0x0249('0x65')]=function(_0x3772a8,_0x12e045,_0x1c1926){var _0x474044={'raw':!![],'where':{}},_0x4c1eda={},_0x5c9fbc;return db[_0x0249('0x40')][_0x0249('0x66')]({'where':{'id':_0x3772a8[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x12e045,null))[_0x0249('0x24')](function(_0x2fa6c3){if(_0x2fa6c3){_0x5c9fbc=_0x2fa6c3[_0x0249('0x3b')]({'plain':!![]});_0x4c1eda[_0x0249('0x44')]=_[_0x0249('0x56')](db['UserChatQueue'][_0x0249('0x57')]);_0x4c1eda[_0x0249('0x45')]=_[_0x0249('0x56')](_0x3772a8['query']);_0x4c1eda[_0x0249('0x46')]=_['intersection'](_0x4c1eda['model'],_0x4c1eda['query']);_0x474044[_0x0249('0x47')]=_[_0x0249('0x48')](_0x4c1eda['model'],qs[_0x0249('0x49')](_0x3772a8[_0x0249('0x45')][_0x0249('0x49')]));_0x474044['attributes']=_0x474044[_0x0249('0x47')][_0x0249('0x4a')]?_0x474044['attributes']:_0x4c1eda[_0x0249('0x44')];if(!_0x3772a8['query'][_0x0249('0x67')](_0x0249('0x4b'))){_0x474044['limit']=qs[_0x0249('0x32')](_0x3772a8[_0x0249('0x45')][_0x0249('0x32')]);_0x474044['offset']=qs[_0x0249('0x31')](_0x3772a8[_0x0249('0x45')]['offset']);}_0x474044['order']=qs[_0x0249('0x4d')](_0x3772a8[_0x0249('0x45')][_0x0249('0x4d')]);_0x474044['where']=qs[_0x0249('0x46')](_[_0x0249('0x4f')](_0x3772a8[_0x0249('0x45')],_0x4c1eda['filters']));_0x474044[_0x0249('0x4e')][_0x0249('0x68')]=_0x2fa6c3['id'];if(_0x3772a8[_0x0249('0x45')]['filter']){_0x474044['where']=_[_0x0249('0x51')](_0x474044[_0x0249('0x4e')],{'$or':_['map'](_0x474044[_0x0249('0x47')],function(_0x4ce136){var _0x3ccd4d={};_0x3ccd4d[_0x4ce136]={'$like':'%'+_0x3772a8[_0x0249('0x45')][_0x0249('0x50')]+'%'};return _0x3ccd4d;})});}_0x474044=_['merge']({},_0x474044,_0x3772a8[_0x0249('0x53')]);return db[_0x0249('0x69')][_0x0249('0x6a')](_0x474044);}})[_0x0249('0x24')](function(_0x111cc2){if(_0x111cc2){return db['User'][_0x0249('0x6b')]({'where':{'id':_['map'](_0x111cc2,_0x0249('0x6c')),'role':_0x0249('0x6d')},'attributes':['id','name',_0x0249('0x6e'),'updatedAt',_0x0249('0x6f')]});}})[_0x0249('0x24')](function(_0x903a56){if(_0x903a56){return{'count':_0x903a56[_0x0249('0x34')],'rows':_[_0x0249('0x3f')](_0x903a56[_0x0249('0x70')],function(_0x513e5a){return{'membername':_0x513e5a[_0x0249('0x3d')],'UserId':_0x513e5a['id'],'queue_name':_0x5c9fbc[_0x0249('0x3d')],'ChatQueueId':_0x5c9fbc['id'],'interface':util['format'](_0x0249('0x71'),_0x0249('0x72'),_0x513e5a[_0x0249('0x3d')]),'penalty':0x0,'paused':_0x513e5a['chatPause'],'createdAt':_0x513e5a[_0x0249('0x6f')],'updatedAt':_0x513e5a[_0x0249('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x12e045,_0x474044))[_0x0249('0x2d')](handleError(_0x12e045,null));};exports['getTeams']=function(_0x277a70,_0xe1b2b,_0xa648b4){var _0xa6e642={};var _0x1dac9a={};var _0x3f9d6;var _0x391c53;return db[_0x0249('0x40')][_0x0249('0x66')]({'where':{'id':_0x277a70[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0xe1b2b,null))[_0x0249('0x24')](function(_0x14202e){if(_0x14202e){_0x3f9d6=_0x14202e;_0x1dac9a[_0x0249('0x44')]=_[_0x0249('0x56')](db[_0x0249('0x74')][_0x0249('0x57')]);_0x1dac9a[_0x0249('0x45')]=_['keys'](_0x277a70[_0x0249('0x45')]);_0x1dac9a[_0x0249('0x46')]=_['intersection'](_0x1dac9a[_0x0249('0x44')],_0x1dac9a[_0x0249('0x45')]);_0xa6e642[_0x0249('0x47')]=_[_0x0249('0x48')](_0x1dac9a['model'],qs[_0x0249('0x49')](_0x277a70['query'][_0x0249('0x49')]));_0xa6e642[_0x0249('0x47')]=_0xa6e642[_0x0249('0x47')]['length']?_0xa6e642[_0x0249('0x47')]:_0x1dac9a[_0x0249('0x44')];_0xa6e642[_0x0249('0x4c')]=qs['sort'](_0x277a70[_0x0249('0x45')][_0x0249('0x4d')]);_0xa6e642[_0x0249('0x4e')]=qs[_0x0249('0x46')](_[_0x0249('0x4f')](_0x277a70[_0x0249('0x45')],_0x1dac9a[_0x0249('0x46')]));if(_0x277a70[_0x0249('0x45')][_0x0249('0x50')]){_0xa6e642[_0x0249('0x4e')]=_[_0x0249('0x51')](_0xa6e642['where'],{'$or':_[_0x0249('0x3f')](_0xa6e642[_0x0249('0x47')],function(_0x16eef8){var _0x22ad08={};_0x22ad08[_0x16eef8]={'$like':'%'+_0x277a70['query'][_0x0249('0x50')]+'%'};return _0x22ad08;})});}_0xa6e642=_['merge']({},_0xa6e642,_0x277a70[_0x0249('0x53')]);return _0x3f9d6[_0x0249('0x75')](_0xa6e642);}})[_0x0249('0x24')](function(_0x114340){if(_0x114340){_0x391c53=_0x114340[_0x0249('0x4a')];if(!_0x277a70[_0x0249('0x45')][_0x0249('0x67')](_0x0249('0x4b'))){_0xa6e642[_0x0249('0x32')]=qs[_0x0249('0x32')](_0x277a70[_0x0249('0x45')][_0x0249('0x32')]);_0xa6e642['offset']=qs[_0x0249('0x31')](_0x277a70[_0x0249('0x45')][_0x0249('0x31')]);}return _0x3f9d6[_0x0249('0x75')](_0xa6e642);}})[_0x0249('0x24')](function(_0x10bd8f){if(_0x10bd8f){return _0x10bd8f?{'count':_0x391c53,'rows':_0x10bd8f}:null;}})[_0x0249('0x24')](respondWithResult(_0xe1b2b,null))[_0x0249('0x2d')](handleError(_0xe1b2b,null));};exports['addTeams']=function(_0x5ee6d3,_0x476460,_0x2e80b7){var _0x27cb2c=_0x5ee6d3[_0x0249('0x5a')][_0x0249('0x76')];return db['Team']['findAll']({'where':{'id':_0x27cb2c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0249('0x77'),'attributes':['id',_0x0249('0x3d'),_0x0249('0x78'),'voicePause',_0x0249('0x79')],'raw':!![]}]})[_0x0249('0x24')](function(_0xa263d4){if(_0xa263d4){var _0x511d68=_[_0x0249('0x7a')](_0xa263d4,function(_0x4c2c91){var _0x1229ad=_0x4c2c91['get']({'plain':!![]});return _0x1229ad[_0x0249('0x77')];});return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x5ee6d3[_0x0249('0x63')]['id']}})[_0x0249('0x24')](function(_0x67e71d){return db['sequelize']['transaction'](function(_0x58b44c){return _0x67e71d[_0x0249('0x7b')](_0x27cb2c,{'transaction':_0x58b44c})[_0x0249('0x24')](function(){return BPromise[_0x0249('0x7c')](_0x511d68,function(_0x268e36){return db[_0x0249('0x69')][_0x0249('0x7d')]({'where':{'UserId':_0x268e36['id'],'ChatQueueId':_0x5ee6d3['params']['id']},'transaction':_0x58b44c});});})[_0x0249('0x24')](function(){_0x511d68[_0x0249('0x7e')](function(_0x48ebef){socket[_0x0249('0x7f')](_0x0249('0x80'),{'UserId':_0x48ebef['id'],'ChatQueueId':_0x67e71d['id']});});});});});}})[_0x0249('0x24')](respondWithStatusCode(_0x476460,null))[_0x0249('0x2d')](handleError(_0x476460,null));};exports[_0x0249('0x81')]=function(_0x598462,_0x35a57a,_0x269af7){return db[_0x0249('0x74')][_0x0249('0x6a')]({'where':{'id':_0x598462['query'][_0x0249('0x76')]},'attributes':['id'],'include':[{'model':db[_0x0249('0x82')],'as':_0x0249('0x77'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x35a57a,null))[_0x0249('0x24')](function(_0x2d3d63){var _0xf46328=_[_0x0249('0x3f')](_0x2d3d63,'id');var _0x28e66a=[];var _0x151922=[];var _0x154821=squel['select']();_0x154821['field']('tq.TeamId')[_0x0249('0x83')](_0x0249('0x84'),'tq')[_0x0249('0x85')]('user_has_teams','ut',_0x0249('0x86'))[_0x0249('0x4e')](_0x0249('0x87'),_0x598462[_0x0249('0x63')]['id']);for(var _0x207268=0x0;_0x207268<_0x2d3d63[_0x0249('0x4a')];_0x207268+=0x1){let _0x4d029c=_0x2d3d63[_0x207268];for(var _0x4b0d04=0x0;_0x4b0d04<_0x4d029c[_0x0249('0x77')][_0x0249('0x4a')];_0x4b0d04+=0x1){let _0x4e66a4=_0x4d029c['Agents'][_0x4b0d04];var _0x3efec2=_0x154821[_0x0249('0x88')]();_0x3efec2[_0x0249('0x4e')](_0x0249('0x89'),_0x4e66a4['id']);_0x151922['push'](db['sequelize'][_0x0249('0x45')](_0x3efec2[_0x0249('0x8a')](),{'type':db[_0x0249('0x8b')][_0x0249('0x8c')][_0x0249('0x8d')]})[_0x0249('0x24')](function(_0x1339b6){if(_0x1339b6['length']===0x1){return _0x4e66a4['id'];}else{var _0x49c211=_[_0x0249('0x8e')](_[_0x0249('0x3f')](_0x1339b6,_0x0249('0x8f')),function(_0x9b45bf){return _['includes'](_0xf46328,_0x9b45bf);});if(_0x49c211){return _0x4e66a4['id'];}}}));}}return BPromise[_0x0249('0x90')](_0x151922)['then'](function(_0x4c4f68){_0x28e66a=_(_0x28e66a)[_0x0249('0x91')](_0x4c4f68)['compact']()[_0x0249('0x92')]();return db[_0x0249('0x40')]['find']({'where':{'id':_0x598462['params']['id']}})[_0x0249('0x24')](function(_0x1237fa){return db[_0x0249('0x8b')]['transaction'](function(_0x493de0){return _0x1237fa[_0x0249('0x81')](_0x598462[_0x0249('0x45')][_0x0249('0x76')],{'transaction':_0x493de0})[_0x0249('0x24')](function(){if(!_[_0x0249('0x93')](_0x28e66a)){return _0x1237fa[_0x0249('0x94')](_0x28e66a,{'transaction':_0x493de0});}})[_0x0249('0x24')](function(){_0x28e66a['forEach'](function(_0x47a22d){socket[_0x0249('0x7f')]('userChatQueue:remove',{'UserId':_0x47a22d,'ChatQueueId':_0x1237fa['id']});});});});});});})['then'](respondWithStatusCode(_0x35a57a,null))['catch'](handleError(_0x35a57a,null));};exports['addAgents']=function(_0x40a0dd,_0x41cf61,_0x4bdb29){return db[_0x0249('0x40')][_0x0249('0x58')]({'where':{'id':_0x40a0dd[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x41cf61,null))['then'](function(_0x4602a2){if(_0x4602a2){return _0x4602a2[_0x0249('0x95')](_0x40a0dd[_0x0249('0x5a')][_0x0249('0x76')],_[_0x0249('0x96')](_0x40a0dd['body'],[_0x0249('0x76'),'id'])||{})[_0x0249('0x97')](function(_0x291dd0){for(var _0x2220b2=0x0;_0x2220b2<_0x40a0dd[_0x0249('0x5a')][_0x0249('0x76')][_0x0249('0x4a')];_0x2220b2+=0x1){socket['emit']('userChatQueue:save',{'UserId':Number(_0x40a0dd['body'][_0x0249('0x76')][_0x2220b2]),'ChatQueueId':Number(_0x40a0dd[_0x0249('0x63')]['id'])});}return _0x291dd0;});}})[_0x0249('0x24')](respondWithResult(_0x41cf61,null))[_0x0249('0x2d')](handleError(_0x41cf61,null));};exports[_0x0249('0x94')]=function(_0x46a3d2,_0x680988,_0x3c9e67){return db[_0x0249('0x40')]['find']({'where':{'id':_0x46a3d2[_0x0249('0x63')]['id']}})[_0x0249('0x24')](handleEntityNotFound(_0x680988,null))[_0x0249('0x24')](function(_0x4102fa){if(_0x4102fa){return _0x4102fa[_0x0249('0x94')](_0x46a3d2[_0x0249('0x45')][_0x0249('0x76')])[_0x0249('0x24')](function(){if(_[_0x0249('0x98')](_0x46a3d2['query']['ids'])){for(var _0x58f6b5=0x0;_0x58f6b5<_0x46a3d2['query']['ids'][_0x0249('0x4a')];_0x58f6b5+=0x1){socket['emit'](_0x0249('0x99'),{'UserId':Number(_0x46a3d2[_0x0249('0x45')][_0x0249('0x76')][_0x58f6b5]),'ChatQueueId':Number(_0x46a3d2[_0x0249('0x63')]['id'])});}}else{socket[_0x0249('0x7f')]('userChatQueue:remove',{'UserId':Number(_0x46a3d2[_0x0249('0x45')][_0x0249('0x76')]),'ChatQueueId':Number(_0x46a3d2[_0x0249('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x680988,null))['catch'](handleError(_0x680988,null));};exports[_0x0249('0x9a')]=function(_0x33d6c4,_0x35054a,_0x1d0fc5){var _0x34b016={};var _0x51b9ec={};var _0x37cf69;var _0x488058;return db['ChatQueue'][_0x0249('0x66')]({'where':{'id':_0x33d6c4[_0x0249('0x63')]['id']}})['then'](handleEntityNotFound(_0x35054a,null))[_0x0249('0x24')](function(_0x56b34c){if(_0x56b34c){_0x37cf69=_0x56b34c;_0x51b9ec[_0x0249('0x44')]=_[_0x0249('0x56')](db[_0x0249('0x82')][_0x0249('0x57')]);_0x51b9ec['query']=_[_0x0249('0x56')](_0x33d6c4[_0x0249('0x45')]);_0x51b9ec['filters']=_['intersection'](_0x51b9ec['model'],_0x51b9ec[_0x0249('0x45')]);_0x34b016[_0x0249('0x47')]=_['intersection'](_0x51b9ec[_0x0249('0x44')],qs[_0x0249('0x49')](_0x33d6c4[_0x0249('0x45')][_0x0249('0x49')]));_0x34b016[_0x0249('0x47')]=_0x34b016[_0x0249('0x47')][_0x0249('0x4a')]?_0x34b016[_0x0249('0x47')]:_0x51b9ec[_0x0249('0x44')];_0x34b016[_0x0249('0x4c')]=qs['sort'](_0x33d6c4['query'][_0x0249('0x4d')]);_0x34b016['where']=qs[_0x0249('0x46')](_['pick'](_0x33d6c4[_0x0249('0x45')],_0x51b9ec[_0x0249('0x46')]));if(_0x33d6c4[_0x0249('0x45')]['filter']){_0x34b016[_0x0249('0x4e')]=_[_0x0249('0x51')](_0x34b016[_0x0249('0x4e')],{'$or':_[_0x0249('0x3f')](_0x34b016[_0x0249('0x47')],function(_0x552fc3){var _0x34f010={};_0x34f010[_0x552fc3]={'$like':'%'+_0x33d6c4[_0x0249('0x45')][_0x0249('0x50')]+'%'};return _0x34f010;})});}_0x34b016=_[_0x0249('0x51')]({},_0x34b016,_0x33d6c4[_0x0249('0x53')]);return _0x37cf69['getAgents'](_0x34b016);}})['then'](function(_0x4ea6b7){if(_0x4ea6b7){_0x488058=_0x4ea6b7['length'];if(!_0x33d6c4[_0x0249('0x45')][_0x0249('0x67')](_0x0249('0x4b'))){_0x34b016[_0x0249('0x32')]=qs['limit'](_0x33d6c4[_0x0249('0x45')][_0x0249('0x32')]);_0x34b016['offset']=qs[_0x0249('0x31')](_0x33d6c4[_0x0249('0x45')][_0x0249('0x31')]);}return _0x37cf69[_0x0249('0x9a')](_0x34b016);}})[_0x0249('0x24')](function(_0x262b37){if(_0x262b37){return _0x262b37?{'count':_0x488058,'rows':_0x262b37}:null;}})['then'](respondWithResult(_0x35054a,null))['catch'](handleError(_0x35054a,null));}; \ No newline at end of file +var _0x453f=['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','UserChatQueue','ChatQueueId','User','agent','chatPause','updatedAt','createdAt','%s/%s','Team','getTeams','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','ids','omit','spread','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','keys','intersection','find'];(function(_0xea7072,_0xf4f740){var _0x5487c1=function(_0x4bce83){while(--_0x4bce83){_0xea7072['push'](_0xea7072['shift']());}};_0x5487c1(++_0xf4f740);}(_0x453f,0xd4));var _0xf453=function(_0xd63b78,_0x17cb52){_0xd63b78=_0xd63b78-0x0;var _0x169180=_0x453f[_0xd63b78];return _0x169180;};'use strict';var emlformat=require(_0xf453('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf453('0x1'));var jsonpatch=require(_0xf453('0x2'));var rp=require(_0xf453('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf453('0x4'));var util=require(_0xf453('0x5'));var path=require('path');var sox=require(_0xf453('0x6'));var csv=require(_0xf453('0x7'));var ejs=require(_0xf453('0x8'));var fs=require('fs');var fs_extra=require(_0xf453('0x9'));var _=require('lodash');var squel=require(_0xf453('0xa'));var crypto=require(_0xf453('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf453('0xc'));var toCsv=require(_0xf453('0x7'));var querystring=require(_0xf453('0xd'));var Papa=require(_0xf453('0xe'));var Redis=require(_0xf453('0xf'));var authService=require(_0xf453('0x10'));var qs=require(_0xf453('0x11'));var as=require(_0xf453('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf453('0x13'))(_0xf453('0x14'));var utils=require(_0xf453('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf453('0x16'));var db=require(_0xf453('0x17'))['db'];config['redis']=_[_0xf453('0x18')](config[_0xf453('0x19')],{'host':_0xf453('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf453('0x1b'))[_0xf453('0x1c')](socket);var jayson=require(_0xf453('0x1d'));var client=jayson[_0xf453('0x1e')][_0xf453('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x154aab,_0xd07df3,_0x4381c0,_0x62db02){return new BPromise(function(_0x29668d,_0x51985d){var _0x557600=_0x62db02||client;return _0x557600[_0xf453('0x20')](_0x154aab,_0x4381c0)[_0xf453('0x21')](function(_0x3aa431){logger[_0xf453('0x22')](_0xf453('0x23'),_0xd07df3,_0xf453('0x24'));logger['debug'](_0xf453('0x25'),_0xd07df3,_0xf453('0x24'),JSON[_0xf453('0x26')](_0x3aa431));if(_0x3aa431['error']){if(_0x3aa431[_0xf453('0x27')][_0xf453('0x28')]===0x1f4){logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x3aa431[_0xf453('0x27')][_0xf453('0x29')]);return _0x51985d(_0x3aa431['error'][_0xf453('0x29')]);}logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x3aa431[_0xf453('0x27')][_0xf453('0x29')]);return _0x29668d(_0x3aa431['error'][_0xf453('0x29')]);}else{logger[_0xf453('0x22')](_0xf453('0x23'),_0xd07df3,_0xf453('0x24'));_0x29668d(_0x3aa431[_0xf453('0x2a')]['message']);}})[_0xf453('0x2b')](function(_0x502775){logger[_0xf453('0x27')](_0xf453('0x23'),_0xd07df3,_0x502775);_0x51985d(_0x502775);});});}function respondWithStatusCode(_0x2bce69,_0x484cc2){_0x484cc2=_0x484cc2||0xcc;return function(_0x31aa67){if(_0x31aa67){return _0x2bce69[_0xf453('0x2c')](_0x484cc2);}return _0x2bce69[_0xf453('0x2d')](_0x484cc2)['end']();};}function respondWithResult(_0xd288c9,_0x259683){_0x259683=_0x259683||0xc8;return function(_0x42cc39){if(_0x42cc39){return _0xd288c9[_0xf453('0x2d')](_0x259683)['json'](_0x42cc39);}};}function respondWithFilteredResult(_0x768a9e,_0xdb40f6){return function(_0x537836){if(_0x537836){var _0x469e83=typeof _0xdb40f6[_0xf453('0x2e')]===_0xf453('0x2f')&&typeof _0xdb40f6[_0xf453('0x30')]===_0xf453('0x2f');var _0x7c2ba=_0x537836[_0xf453('0x31')];var _0x4ec60b=_0x469e83?0x0:_0xdb40f6['offset'];var _0x302620=_0x469e83?_0x537836[_0xf453('0x31')]:_0xdb40f6['offset']+_0xdb40f6[_0xf453('0x30')];var _0x1e5ba6;if(_0x302620>=_0x7c2ba){_0x302620=_0x7c2ba;_0x1e5ba6=0xc8;}else{_0x1e5ba6=0xce;}_0x768a9e[_0xf453('0x2d')](_0x1e5ba6);return _0x768a9e[_0xf453('0x32')](_0xf453('0x33'),_0x4ec60b+'-'+_0x302620+'/'+_0x7c2ba)[_0xf453('0x34')](_0x537836);}return null;};}function patchUpdates(_0x58fa92){return function(_0x4642fd){try{jsonpatch[_0xf453('0x35')](_0x4642fd,_0x58fa92,!![]);}catch(_0x54738e){return BPromise[_0xf453('0x36')](_0x54738e);}return _0x4642fd[_0xf453('0x37')]();};}function saveUpdates(_0x101100,_0x427012){return function(_0x532b8a){if(_0x532b8a){return _0x532b8a[_0xf453('0x38')](_0x101100)[_0xf453('0x21')](function(_0x1059df){return _0x1059df;});}return null;};}function removeEntity(_0x18e2f8,_0x1c4e1c){return function(_0x1fb4bc){if(_0x1fb4bc){return _0x1fb4bc[_0xf453('0x39')]()[_0xf453('0x21')](function(){var _0x23cabf=_0x1fb4bc[_0xf453('0x3a')]({'plain':!![]});var _0x4870d1=_0xf453('0x3b');return db[_0xf453('0x3c')][_0xf453('0x39')]({'where':{'type':_0x4870d1,'resourceId':_0x23cabf['id']}})['then'](function(){return _0x1fb4bc;});})[_0xf453('0x21')](function(){_0x18e2f8[_0xf453('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x331941,_0x31f74a){return function(_0x4ea64e){if(!_0x4ea64e){_0x331941[_0xf453('0x2c')](0x194);}return _0x4ea64e;};}function handleError(_0x2abccb,_0x2e0d85){_0x2e0d85=_0x2e0d85||0x1f4;return function(_0x29f88b){logger[_0xf453('0x27')](_0x29f88b[_0xf453('0x3d')]);if(_0x29f88b[_0xf453('0x3e')]){delete _0x29f88b[_0xf453('0x3e')];}_0x2abccb[_0xf453('0x2d')](_0x2e0d85)[_0xf453('0x3f')](_0x29f88b);};}exports[_0xf453('0x40')]=function(_0x292dfa,_0x4a7f9e){var _0x261d28={},_0x37cf71={},_0x45aab8={'count':0x0,'rows':[]};var _0x1bf473=_[_0xf453('0x41')](db[_0xf453('0x42')][_0xf453('0x43')],function(_0x46d624){return{'name':_0x46d624[_0xf453('0x44')],'type':_0x46d624[_0xf453('0x45')][_0xf453('0x46')]};});_0x37cf71[_0xf453('0x47')]=_['map'](_0x1bf473,_0xf453('0x3e'));_0x37cf71[_0xf453('0x48')]=_['keys'](_0x292dfa['query']);_0x37cf71['filters']=_['intersection'](_0x37cf71[_0xf453('0x47')],_0x37cf71[_0xf453('0x48')]);_0x261d28[_0xf453('0x49')]=_['intersection'](_0x37cf71['model'],qs[_0xf453('0x4a')](_0x292dfa[_0xf453('0x48')]['fields']));_0x261d28['attributes']=_0x261d28[_0xf453('0x49')][_0xf453('0x4b')]?_0x261d28[_0xf453('0x49')]:_0x37cf71[_0xf453('0x47')];if(!_0x292dfa['query'][_0xf453('0x4c')](_0xf453('0x4d'))){_0x261d28[_0xf453('0x30')]=qs[_0xf453('0x30')](_0x292dfa[_0xf453('0x48')][_0xf453('0x30')]);_0x261d28[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x292dfa[_0xf453('0x48')][_0xf453('0x2e')]);}_0x261d28[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x292dfa['query'][_0xf453('0x4f')]);_0x261d28[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x292dfa['query'],_0x37cf71[_0xf453('0x51')]),_0x1bf473);if(_0x292dfa[_0xf453('0x48')]['filter']){_0x261d28['where']=_[_0xf453('0x53')](_0x261d28[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0x1bf473,function(_0x6a60ea){if(_0x6a60ea[_0xf453('0x45')]!==_0xf453('0x54')){var _0x587dad={};_0x587dad[_0x6a60ea[_0xf453('0x3e')]]={'$like':'%'+_0x292dfa[_0xf453('0x48')][_0xf453('0x55')]+'%'};return _0x587dad;}})});}_0x261d28=_[_0xf453('0x53')]({},_0x261d28,_0x292dfa[_0xf453('0x56')]);var _0x3a4146={'where':_0x261d28['where']};return db['ChatQueue'][_0xf453('0x31')](_0x3a4146)[_0xf453('0x21')](function(_0x5da753){_0x45aab8[_0xf453('0x31')]=_0x5da753;if(_0x292dfa[_0xf453('0x48')][_0xf453('0x57')]){_0x261d28[_0xf453('0x58')]=[{'all':!![]}];}return db[_0xf453('0x42')][_0xf453('0x59')](_0x261d28);})[_0xf453('0x21')](function(_0x5d6235){_0x45aab8[_0xf453('0x5a')]=_0x5d6235;return _0x45aab8;})[_0xf453('0x21')](respondWithFilteredResult(_0x4a7f9e,_0x261d28))[_0xf453('0x2b')](handleError(_0x4a7f9e,null));};exports[_0xf453('0x5b')]=function(_0x58d8f6,_0x31cb65){var _0x32ae03={'raw':!![],'where':{'id':_0x58d8f6[_0xf453('0x5c')]['id']}},_0x51a848={};_0x51a848[_0xf453('0x47')]=_[_0xf453('0x5d')](db['ChatQueue'][_0xf453('0x43')]);_0x51a848[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x58d8f6['query']);_0x51a848['filters']=_[_0xf453('0x5e')](_0x51a848['model'],_0x51a848[_0xf453('0x48')]);_0x32ae03[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x51a848['model'],qs['fields'](_0x58d8f6[_0xf453('0x48')][_0xf453('0x4a')]));_0x32ae03[_0xf453('0x49')]=_0x32ae03[_0xf453('0x49')][_0xf453('0x4b')]?_0x32ae03[_0xf453('0x49')]:_0x51a848['model'];if(_0x58d8f6[_0xf453('0x48')][_0xf453('0x57')]){_0x32ae03['include']=[{'all':!![]}];}_0x32ae03=_[_0xf453('0x53')]({},_0x32ae03,_0x58d8f6[_0xf453('0x56')]);return db[_0xf453('0x42')][_0xf453('0x5f')](_0x32ae03)[_0xf453('0x21')](handleEntityNotFound(_0x31cb65,null))[_0xf453('0x21')](respondWithResult(_0x31cb65,null))[_0xf453('0x2b')](handleError(_0x31cb65,null));};exports[_0xf453('0x60')]=function(_0x41319b,_0x518330){return db[_0xf453('0x42')][_0xf453('0x60')](_0x41319b[_0xf453('0x61')],{})[_0xf453('0x21')](function(_0x29d51c){var _0x473bf9=_0x41319b[_0xf453('0x62')][_0xf453('0x3a')]({'plain':!![]});if(!_0x473bf9)throw new Error(_0xf453('0x63'));if(_0x473bf9[_0xf453('0x64')]===_0xf453('0x62')){var _0x1a5aca=_0x29d51c['get']({'plain':!![]});var _0x26c54b=_0xf453('0x3b');return db['UserProfileSection'][_0xf453('0x5f')]({'where':{'name':_0x26c54b,'userProfileId':_0x473bf9[_0xf453('0x65')]},'raw':!![]})[_0xf453('0x21')](function(_0x24aaab){if(_0x24aaab&&_0x24aaab[_0xf453('0x66')]===0x0){return db[_0xf453('0x3c')][_0xf453('0x60')]({'name':_0x1a5aca['name'],'resourceId':_0x1a5aca['id'],'type':_0x24aaab[_0xf453('0x3e')],'sectionId':_0x24aaab['id']},{})[_0xf453('0x21')](function(){return _0x29d51c;});}else{return _0x29d51c;}})['catch'](function(_0x1ff00c){logger[_0xf453('0x27')](_0xf453('0x67'),_0x1ff00c);throw _0x1ff00c;});}return _0x29d51c;})['then'](respondWithResult(_0x518330,0xc9))['catch'](handleError(_0x518330,null));};exports['update']=function(_0xcf1d20,_0xa68f3b){if(_0xcf1d20['body']['id']){delete _0xcf1d20['body']['id'];}return db[_0xf453('0x42')][_0xf453('0x5f')]({'where':{'id':_0xcf1d20[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0xa68f3b,null))[_0xf453('0x21')](saveUpdates(_0xcf1d20['body'],null))[_0xf453('0x21')](respondWithResult(_0xa68f3b,null))['catch'](handleError(_0xa68f3b,null));};exports[_0xf453('0x39')]=function(_0x4dff78,_0x4d015e){return db['ChatQueue']['find']({'where':{'id':_0x4dff78[_0xf453('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4d015e,null))[_0xf453('0x21')](removeEntity(_0x4d015e,null))[_0xf453('0x2b')](handleError(_0x4d015e,null));};exports['describe']=function(_0x1fa18f,_0x467b3d){return db[_0xf453('0x42')][_0xf453('0x68')]()['then'](respondWithResult(_0x467b3d,null))[_0xf453('0x2b')](handleError(_0x467b3d,null));};exports[_0xf453('0x69')]=function(_0x40ef05,_0x4b1166,_0x302597){var _0xcaf2e0={'raw':!![],'where':{}},_0x444f58={},_0x5f45bd;return db[_0xf453('0x42')][_0xf453('0x6a')]({'where':{'id':_0x40ef05[_0xf453('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4b1166,null))[_0xf453('0x21')](function(_0x282f7e){if(_0x282f7e){_0x5f45bd=_0x282f7e['get']({'plain':!![]});_0x444f58[_0xf453('0x47')]=_[_0xf453('0x5d')](db[_0xf453('0x6b')][_0xf453('0x43')]);_0x444f58[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x40ef05[_0xf453('0x48')]);_0x444f58[_0xf453('0x51')]=_[_0xf453('0x5e')](_0x444f58[_0xf453('0x47')],_0x444f58[_0xf453('0x48')]);_0xcaf2e0[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x444f58[_0xf453('0x47')],qs[_0xf453('0x4a')](_0x40ef05['query'][_0xf453('0x4a')]));_0xcaf2e0['attributes']=_0xcaf2e0['attributes'][_0xf453('0x4b')]?_0xcaf2e0['attributes']:_0x444f58['model'];if(!_0x40ef05[_0xf453('0x48')][_0xf453('0x4c')](_0xf453('0x4d'))){_0xcaf2e0['limit']=qs['limit'](_0x40ef05['query'][_0xf453('0x30')]);_0xcaf2e0[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x40ef05['query'][_0xf453('0x2e')]);}_0xcaf2e0['order']=qs[_0xf453('0x4f')](_0x40ef05[_0xf453('0x48')][_0xf453('0x4f')]);_0xcaf2e0[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x40ef05[_0xf453('0x48')],_0x444f58['filters']));_0xcaf2e0['where'][_0xf453('0x6c')]=_0x282f7e['id'];if(_0x40ef05['query'][_0xf453('0x55')]){_0xcaf2e0[_0xf453('0x50')]=_[_0xf453('0x53')](_0xcaf2e0[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0xcaf2e0[_0xf453('0x49')],function(_0x2f1a78){var _0x2b36cd={};_0x2b36cd[_0x2f1a78]={'$like':'%'+_0x40ef05['query']['filter']+'%'};return _0x2b36cd;})});}_0xcaf2e0=_[_0xf453('0x53')]({},_0xcaf2e0,_0x40ef05[_0xf453('0x56')]);return db[_0xf453('0x6b')][_0xf453('0x59')](_0xcaf2e0);}})[_0xf453('0x21')](function(_0x47078e){if(_0x47078e){return db[_0xf453('0x6d')]['findAndCountAll']({'where':{'id':_['map'](_0x47078e,'UserId'),'role':_0xf453('0x6e')},'attributes':['id',_0xf453('0x3e'),_0xf453('0x6f'),_0xf453('0x70'),_0xf453('0x71')]});}})[_0xf453('0x21')](function(_0x251647){if(_0x251647){return{'count':_0x251647['count'],'rows':_[_0xf453('0x41')](_0x251647[_0xf453('0x5a')],function(_0x2a0490){return{'membername':_0x2a0490[_0xf453('0x3e')],'UserId':_0x2a0490['id'],'queue_name':_0x5f45bd[_0xf453('0x3e')],'ChatQueueId':_0x5f45bd['id'],'interface':util['format'](_0xf453('0x72'),'SIP',_0x2a0490[_0xf453('0x3e')]),'penalty':0x0,'paused':_0x2a0490[_0xf453('0x6f')],'createdAt':_0x2a0490['createdAt'],'updatedAt':_0x2a0490['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xf453('0x21')](respondWithFilteredResult(_0x4b1166,_0xcaf2e0))[_0xf453('0x2b')](handleError(_0x4b1166,null));};exports['getTeams']=function(_0x478a90,_0x3020d1,_0x263ca5){var _0x200a0c={};var _0x2e51f0={};var _0x4478d8;var _0x5897d9;return db[_0xf453('0x42')]['findOne']({'where':{'id':_0x478a90[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x3020d1,null))[_0xf453('0x21')](function(_0x1ca998){if(_0x1ca998){_0x4478d8=_0x1ca998;_0x2e51f0[_0xf453('0x47')]=_[_0xf453('0x5d')](db[_0xf453('0x73')][_0xf453('0x43')]);_0x2e51f0[_0xf453('0x48')]=_[_0xf453('0x5d')](_0x478a90[_0xf453('0x48')]);_0x2e51f0['filters']=_[_0xf453('0x5e')](_0x2e51f0[_0xf453('0x47')],_0x2e51f0[_0xf453('0x48')]);_0x200a0c[_0xf453('0x49')]=_[_0xf453('0x5e')](_0x2e51f0['model'],qs[_0xf453('0x4a')](_0x478a90['query']['fields']));_0x200a0c[_0xf453('0x49')]=_0x200a0c['attributes']['length']?_0x200a0c[_0xf453('0x49')]:_0x2e51f0[_0xf453('0x47')];_0x200a0c[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x478a90[_0xf453('0x48')][_0xf453('0x4f')]);_0x200a0c[_0xf453('0x50')]=qs[_0xf453('0x51')](_[_0xf453('0x52')](_0x478a90[_0xf453('0x48')],_0x2e51f0[_0xf453('0x51')]));if(_0x478a90[_0xf453('0x48')][_0xf453('0x55')]){_0x200a0c[_0xf453('0x50')]=_[_0xf453('0x53')](_0x200a0c[_0xf453('0x50')],{'$or':_[_0xf453('0x41')](_0x200a0c[_0xf453('0x49')],function(_0xef085f){var _0x25e1ea={};_0x25e1ea[_0xef085f]={'$like':'%'+_0x478a90[_0xf453('0x48')][_0xf453('0x55')]+'%'};return _0x25e1ea;})});}_0x200a0c=_[_0xf453('0x53')]({},_0x200a0c,_0x478a90[_0xf453('0x56')]);return _0x4478d8[_0xf453('0x74')](_0x200a0c);}})[_0xf453('0x21')](function(_0x183109){if(_0x183109){_0x5897d9=_0x183109[_0xf453('0x4b')];if(!_0x478a90[_0xf453('0x48')][_0xf453('0x4c')](_0xf453('0x4d'))){_0x200a0c['limit']=qs[_0xf453('0x30')](_0x478a90[_0xf453('0x48')][_0xf453('0x30')]);_0x200a0c['offset']=qs[_0xf453('0x2e')](_0x478a90[_0xf453('0x48')]['offset']);}return _0x4478d8[_0xf453('0x74')](_0x200a0c);}})[_0xf453('0x21')](function(_0x4c4e56){if(_0x4c4e56){return _0x4c4e56?{'count':_0x5897d9,'rows':_0x4c4e56}:null;}})[_0xf453('0x21')](respondWithResult(_0x3020d1,null))[_0xf453('0x2b')](handleError(_0x3020d1,null));};exports['addTeams']=function(_0x47ea0b,_0x3fe343,_0x3983bb){var _0x282d7c=_0x47ea0b[_0xf453('0x61')]['ids'];return db[_0xf453('0x73')][_0xf453('0x59')]({'where':{'id':_0x282d7c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xf453('0x75'),'attributes':['id',_0xf453('0x3e'),_0xf453('0x76'),_0xf453('0x77'),_0xf453('0x78')],'raw':!![]}]})[_0xf453('0x21')](function(_0x5405e7){if(_0x5405e7){var _0x20f2f6=_[_0xf453('0x79')](_0x5405e7,function(_0x5ac073){var _0x2f414e=_0x5ac073[_0xf453('0x3a')]({'plain':!![]});return _0x2f414e[_0xf453('0x75')];});return db['ChatQueue'][_0xf453('0x5f')]({'where':{'id':_0x47ea0b['params']['id']}})[_0xf453('0x21')](function(_0x14e8fa){return db['sequelize'][_0xf453('0x7a')](function(_0x26afba){return _0x14e8fa[_0xf453('0x7b')](_0x282d7c,{'transaction':_0x26afba})[_0xf453('0x21')](function(){return BPromise[_0xf453('0x7c')](_0x20f2f6,function(_0x499d71){return db[_0xf453('0x6b')][_0xf453('0x7d')]({'where':{'UserId':_0x499d71['id'],'ChatQueueId':_0x47ea0b[_0xf453('0x5c')]['id']},'transaction':_0x26afba});});})[_0xf453('0x21')](function(){_0x20f2f6[_0xf453('0x7e')](function(_0x1b2151){socket[_0xf453('0x7f')](_0xf453('0x80'),{'UserId':_0x1b2151['id'],'ChatQueueId':_0x14e8fa['id']});});});});});}})[_0xf453('0x21')](respondWithStatusCode(_0x3fe343,null))[_0xf453('0x2b')](handleError(_0x3fe343,null));};exports[_0xf453('0x81')]=function(_0x1cc4ac,_0x3702f7,_0x44be19){return db['Team']['findAll']({'where':{'id':_0x1cc4ac[_0xf453('0x48')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf453('0x6d')],'as':_0xf453('0x75'),'attributes':['id'],'raw':!![]}]})[_0xf453('0x21')](handleEntityNotFound(_0x3702f7,null))[_0xf453('0x21')](function(_0x27385d){var _0x12f34c=_['map'](_0x27385d,'id');var _0x263b13=[];var _0x1f3e8e=[];var _0x406e6f=squel['select']();_0x406e6f[_0xf453('0x82')](_0xf453('0x83'))['from'](_0xf453('0x84'),'tq')['join']('user_has_teams','ut',_0xf453('0x85'))[_0xf453('0x50')](_0xf453('0x86'),_0x1cc4ac[_0xf453('0x5c')]['id']);for(var _0x172b25=0x0;_0x172b25<_0x27385d[_0xf453('0x4b')];_0x172b25+=0x1){let _0x41a049=_0x27385d[_0x172b25];for(var _0x2d729f=0x0;_0x2d729f<_0x41a049[_0xf453('0x75')][_0xf453('0x4b')];_0x2d729f+=0x1){let _0x163459=_0x41a049[_0xf453('0x75')][_0x2d729f];var _0x5c7d6a=_0x406e6f[_0xf453('0x87')]();_0x5c7d6a[_0xf453('0x50')]('ut.UserId\x20=\x20?',_0x163459['id']);_0x1f3e8e[_0xf453('0x88')](db[_0xf453('0x89')][_0xf453('0x48')](_0x5c7d6a[_0xf453('0x8a')](),{'type':db['sequelize'][_0xf453('0x8b')][_0xf453('0x8c')]})[_0xf453('0x21')](function(_0x46158d){if(_0x46158d['length']===0x1){return _0x163459['id'];}else{var _0x338532=_[_0xf453('0x8d')](_['map'](_0x46158d,_0xf453('0x8e')),function(_0xb7f8f5){return _['includes'](_0x12f34c,_0xb7f8f5);});if(_0x338532){return _0x163459['id'];}}}));}}return BPromise[_0xf453('0x8f')](_0x1f3e8e)[_0xf453('0x21')](function(_0x5d1d4d){_0x263b13=_(_0x263b13)[_0xf453('0x90')](_0x5d1d4d)[_0xf453('0x91')]()[_0xf453('0x92')]();return db['ChatQueue'][_0xf453('0x5f')]({'where':{'id':_0x1cc4ac[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](function(_0x358ac2){return db[_0xf453('0x89')][_0xf453('0x7a')](function(_0x2320b1){return _0x358ac2['removeTeams'](_0x1cc4ac[_0xf453('0x48')]['ids'],{'transaction':_0x2320b1})[_0xf453('0x21')](function(){if(!_['isEmpty'](_0x263b13)){return _0x358ac2[_0xf453('0x93')](_0x263b13,{'transaction':_0x2320b1});}})[_0xf453('0x21')](function(){_0x263b13[_0xf453('0x7e')](function(_0x3e8646){socket[_0xf453('0x7f')](_0xf453('0x94'),{'UserId':_0x3e8646,'ChatQueueId':_0x358ac2['id']});});});});});});})['then'](respondWithStatusCode(_0x3702f7,null))[_0xf453('0x2b')](handleError(_0x3702f7,null));};exports[_0xf453('0x95')]=function(_0x4708cf,_0x4dc14b,_0x3e5d4f){return db[_0xf453('0x42')][_0xf453('0x5f')]({'where':{'id':_0x4708cf[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x4dc14b,null))[_0xf453('0x21')](function(_0x380336){if(_0x380336){return _0x380336['addAgents'](_0x4708cf[_0xf453('0x61')][_0xf453('0x96')],_[_0xf453('0x97')](_0x4708cf['body'],[_0xf453('0x96'),'id'])||{})[_0xf453('0x98')](function(_0xda95cb){for(var _0x42ad51=0x0;_0x42ad51<_0x4708cf['body'][_0xf453('0x96')][_0xf453('0x4b')];_0x42ad51+=0x1){socket[_0xf453('0x7f')]('userChatQueue:save',{'UserId':Number(_0x4708cf[_0xf453('0x61')]['ids'][_0x42ad51]),'ChatQueueId':Number(_0x4708cf['params']['id'])});}return _0xda95cb;});}})[_0xf453('0x21')](respondWithResult(_0x4dc14b,null))[_0xf453('0x2b')](handleError(_0x4dc14b,null));};exports[_0xf453('0x93')]=function(_0x32ebf5,_0x1e2434,_0x19be79){return db['ChatQueue']['find']({'where':{'id':_0x32ebf5[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x1e2434,null))[_0xf453('0x21')](function(_0x5a4eea){if(_0x5a4eea){return _0x5a4eea[_0xf453('0x93')](_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')])['then'](function(){if(_['isArray'](_0x32ebf5[_0xf453('0x48')]['ids'])){for(var _0x163a6c=0x0;_0x163a6c<_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')][_0xf453('0x4b')];_0x163a6c+=0x1){socket[_0xf453('0x7f')](_0xf453('0x94'),{'UserId':Number(_0x32ebf5[_0xf453('0x48')][_0xf453('0x96')][_0x163a6c]),'ChatQueueId':Number(_0x32ebf5[_0xf453('0x5c')]['id'])});}}else{socket['emit'](_0xf453('0x94'),{'UserId':Number(_0x32ebf5['query'][_0xf453('0x96')]),'ChatQueueId':Number(_0x32ebf5['params']['id'])});}});}})[_0xf453('0x21')](respondWithStatusCode(_0x1e2434,null))[_0xf453('0x2b')](handleError(_0x1e2434,null));};exports[_0xf453('0x99')]=function(_0x40f408,_0x3298cc,_0x318aaf){var _0x474796={};var _0x1e88df={};var _0x231acf;var _0x4735d3;return db[_0xf453('0x42')]['findOne']({'where':{'id':_0x40f408[_0xf453('0x5c')]['id']}})[_0xf453('0x21')](handleEntityNotFound(_0x3298cc,null))['then'](function(_0xfd656b){if(_0xfd656b){_0x231acf=_0xfd656b;_0x1e88df[_0xf453('0x47')]=_[_0xf453('0x5d')](db['User'][_0xf453('0x43')]);_0x1e88df['query']=_[_0xf453('0x5d')](_0x40f408['query']);_0x1e88df[_0xf453('0x51')]=_[_0xf453('0x5e')](_0x1e88df[_0xf453('0x47')],_0x1e88df['query']);_0x474796['attributes']=_['intersection'](_0x1e88df['model'],qs[_0xf453('0x4a')](_0x40f408['query'][_0xf453('0x4a')]));_0x474796[_0xf453('0x49')]=_0x474796[_0xf453('0x49')]['length']?_0x474796[_0xf453('0x49')]:_0x1e88df['model'];_0x474796[_0xf453('0x4e')]=qs[_0xf453('0x4f')](_0x40f408[_0xf453('0x48')][_0xf453('0x4f')]);_0x474796[_0xf453('0x50')]=qs[_0xf453('0x51')](_['pick'](_0x40f408[_0xf453('0x48')],_0x1e88df[_0xf453('0x51')]));if(_0x40f408[_0xf453('0x48')][_0xf453('0x55')]){_0x474796['where']=_[_0xf453('0x53')](_0x474796['where'],{'$or':_[_0xf453('0x41')](_0x474796[_0xf453('0x49')],function(_0xbe8e97){var _0x201326={};_0x201326[_0xbe8e97]={'$like':'%'+_0x40f408['query']['filter']+'%'};return _0x201326;})});}_0x474796=_[_0xf453('0x53')]({},_0x474796,_0x40f408[_0xf453('0x56')]);return _0x231acf['getAgents'](_0x474796);}})['then'](function(_0x27eff1){if(_0x27eff1){_0x4735d3=_0x27eff1['length'];if(!_0x40f408['query'][_0xf453('0x4c')](_0xf453('0x4d'))){_0x474796['limit']=qs[_0xf453('0x30')](_0x40f408[_0xf453('0x48')]['limit']);_0x474796[_0xf453('0x2e')]=qs[_0xf453('0x2e')](_0x40f408[_0xf453('0x48')]['offset']);}return _0x231acf['getAgents'](_0x474796);}})[_0xf453('0x21')](function(_0x6f418a){if(_0x6f418a){return _0x6f418a?{'count':_0x4735d3,'rows':_0x6f418a}:null;}})[_0xf453('0x21')](respondWithResult(_0x3298cc,null))['catch'](handleError(_0x3298cc,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index e43e5bc..7c759f8 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 _0xd285=['../../mysqldb','ChatQueue','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x17d819,_0x20b7c0){var _0x5b6e5e=function(_0x294dab){while(--_0x294dab){_0x17d819['push'](_0x17d819['shift']());}};_0x5b6e5e(++_0x20b7c0);}(_0xd285,0x132));var _0x5d28=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0xd285[_0x1b2255];return _0x33e57d;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5d28('0x0'))['db'][_0x5d28('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d28('0x2'),'afterUpdate':_0x5d28('0x3'),'afterDestroy':_0x5d28('0x4')};function emitEvent(_0xb8fcdb){return function(_0x1bfd0e,_0x1c988c,_0x3e3185){ChatQueueEvents['emit'](_0xb8fcdb+':'+_0x1bfd0e['id'],_0x1bfd0e);ChatQueueEvents[_0x5d28('0x5')](_0xb8fcdb,_0x1bfd0e);_0x3e3185(null);};}for(var e in events){if(events[_0x5d28('0x6')](e)){var event=events[e];ChatQueue[_0x5d28('0x7')](e,emitEvent(event));}}module[_0x5d28('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x7aaf=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x7aaf,0x1dc));var _0xf7aa=function(_0x3b30ec,_0x451311){_0x3b30ec=_0x3b30ec-0x0;var _0x4130e=_0x7aaf[_0x3b30ec];return _0x4130e;};'use strict';var EventEmitter=require(_0xf7aa('0x0'));var ChatQueue=require('../../mysqldb')['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf7aa('0x1')](0x0);var events={'afterCreate':_0xf7aa('0x2'),'afterUpdate':'update','afterDestroy':_0xf7aa('0x3')};function emitEvent(_0x3918a0){return function(_0x122c4a,_0x81d283,_0x21482c){ChatQueueEvents[_0xf7aa('0x4')](_0x3918a0+':'+_0x122c4a['id'],_0x122c4a);ChatQueueEvents['emit'](_0x3918a0,_0x122c4a);_0x21482c(null);};}for(var e in events){if(events[_0xf7aa('0x5')](e)){var event=events[e];ChatQueue[_0xf7aa('0x6')](e,emitEvent(event));}}module[_0xf7aa('0x7')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 376bd07..7561f65 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 _0x6063=['define','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports'];(function(_0x587fb5,_0x59cb3b){var _0x551105=function(_0x5bbef4){while(--_0x5bbef4){_0x587fb5['push'](_0x587fb5['shift']());}};_0x551105(++_0x59cb3b);}(_0x6063,0x107));var _0x3606=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6063[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x3606('0x0'));var logger=require(_0x3606('0x1'))(_0x3606('0x2'));var moment=require(_0x3606('0x3'));var BPromise=require(_0x3606('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3606('0x5'));var rimraf=require(_0x3606('0x6'));var config=require(_0x3606('0x7'));var attributes=require(_0x3606('0x8'));module[_0x3606('0x9')]=function(_0xddc808,_0x1fe51f){return _0xddc808[_0x3606('0xa')](_0x3606('0xb'),attributes,{'tableName':_0x3606('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14dd=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','chat_queues','lodash','util'];(function(_0x469f66,_0x2daba6){var _0x442f79=function(_0x320cc7){while(--_0x320cc7){_0x469f66['push'](_0x469f66['shift']());}};_0x442f79(++_0x2daba6);}(_0x14dd,0x172));var _0xd14d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd14d('0x0'));var util=require(_0xd14d('0x1'));var logger=require(_0xd14d('0x2'))(_0xd14d('0x3'));var moment=require('moment');var BPromise=require(_0xd14d('0x4'));var rp=require(_0xd14d('0x5'));var fs=require('fs');var path=require(_0xd14d('0x6'));var rimraf=require('rimraf');var config=require(_0xd14d('0x7'));var attributes=require(_0xd14d('0x8'));module[_0xd14d('0x9')]=function(_0x4d4436,_0x12fb59){return _0x4d4436[_0xd14d('0xa')]('ChatQueue',attributes,{'tableName':_0xd14d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index afa474d..f1d7fe3 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 _0x64e6=['code','error','message','result','catch','GetChatQueue','options','raw','where','attributes','limit','include','map','find','model','ShowChatQueue','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x1a308b,_0x14560f){var _0x388b10=function(_0x5645d4){while(--_0x5645d4){_0x1a308b['push'](_0x1a308b['shift']());}};_0x388b10(++_0x14560f);}(_0x64e6,0x1b2));var _0x664e=function(_0x20a73d,_0x18df5c){_0x20a73d=_0x20a73d-0x0;var _0x368a87=_0x64e6[_0x20a73d];return _0x368a87;};'use strict';var _=require(_0x664e('0x0'));var util=require('util');var moment=require(_0x664e('0x1'));var BPromise=require(_0x664e('0x2'));var rs=require(_0x664e('0x3'));var fs=require('fs');var Redis=require(_0x664e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x664e('0x5'))('rpc');var config=require(_0x664e('0x6'));var jayson=require(_0x664e('0x7'));var client=jayson['client'][_0x664e('0x8')]({'port':0x232a});config[_0x664e('0x9')]=_[_0x664e('0xa')](config['redis'],{'host':_0x664e('0xb'),'port':0x18eb});var socket=require(_0x664e('0xc'))(new Redis(config[_0x664e('0x9')]));require(_0x664e('0xd'))[_0x664e('0xe')](socket);function respondWithRpcPromise(_0x2bc4cc,_0x5544aa,_0x294c98){return new BPromise(function(_0x2ded79,_0x245170){return client[_0x664e('0xf')](_0x2bc4cc,_0x294c98)[_0x664e('0x10')](function(_0x50b700){logger[_0x664e('0x11')](_0x664e('0x12'),_0x5544aa,'request\x20sent');logger[_0x664e('0x13')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5544aa,_0x664e('0x14'),JSON[_0x664e('0x15')](_0x50b700));if(_0x50b700['error']){if(_0x50b700['error'][_0x664e('0x16')]===0x1f4){logger[_0x664e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x50b700[_0x664e('0x17')][_0x664e('0x18')]);return _0x245170(_0x50b700[_0x664e('0x17')][_0x664e('0x18')]);}logger[_0x664e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x50b700[_0x664e('0x17')]['message']);return _0x2ded79(_0x50b700[_0x664e('0x17')]['message']);}else{logger[_0x664e('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x664e('0x14'));_0x2ded79(_0x50b700[_0x664e('0x19')]['message']);}})[_0x664e('0x1a')](function(_0x39e9f0){logger[_0x664e('0x17')]('ChatQueue,\x20%s,\x20%s',_0x5544aa,_0x39e9f0);_0x245170(_0x39e9f0);});});}exports[_0x664e('0x1b')]=function(_0x49b444){var _0x1cf289=this;return new Promise(function(_0x896c86,_0x3b5c0a){return db['ChatQueue']['findAll']({'raw':_0x49b444[_0x664e('0x1c')]?_0x49b444['options'][_0x664e('0x1d')]===undefined?!![]:![]:!![],'where':_0x49b444[_0x664e('0x1c')]?_0x49b444[_0x664e('0x1c')][_0x664e('0x1e')]||null:null,'attributes':_0x49b444[_0x664e('0x1c')]?_0x49b444['options'][_0x664e('0x1f')]||null:null,'limit':_0x49b444[_0x664e('0x1c')]?_0x49b444[_0x664e('0x1c')][_0x664e('0x20')]||null:null,'include':_0x49b444[_0x664e('0x1c')]?_0x49b444['options'][_0x664e('0x21')]?_[_0x664e('0x22')](_0x49b444[_0x664e('0x1c')][_0x664e('0x21')],function(_0x7e3679){return{'model':db[_0x7e3679['model']],'as':_0x7e3679['as'],'attributes':_0x7e3679[_0x664e('0x1f')],'include':_0x7e3679[_0x664e('0x21')]?_['map'](_0x7e3679[_0x664e('0x21')],function(_0x28980d){return{'model':db[_0x28980d['model']],'as':_0x28980d['as'],'attributes':_0x28980d[_0x664e('0x1f')],'include':_0x28980d[_0x664e('0x21')]?_[_0x664e('0x22')](_0x28980d['include'],function(_0x35220f){return{'model':db[_0x35220f['model']],'as':_0x35220f['as'],'attributes':_0x35220f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x27ef96){logger[_0x664e('0x11')](_0x664e('0x1b'),_0x49b444);logger[_0x664e('0x13')](_0x664e('0x1b'),_0x49b444,JSON[_0x664e('0x15')](_0x27ef96));_0x896c86(_0x27ef96);})[_0x664e('0x1a')](function(_0x4d9612){logger['error'](_0x664e('0x1b'),_0x4d9612[_0x664e('0x18')],_0x49b444);_0x3b5c0a(_0x1cf289[_0x664e('0x17')](0x1f4,_0x4d9612[_0x664e('0x18')]));});});};exports['ShowChatQueue']=function(_0x32f8c8){var _0x22b618=this;return new Promise(function(_0x2904f8,_0x14b02b){return db['ChatQueue'][_0x664e('0x23')]({'raw':_0x32f8c8[_0x664e('0x1c')]?_0x32f8c8[_0x664e('0x1c')][_0x664e('0x1d')]===undefined?!![]:![]:!![],'where':_0x32f8c8[_0x664e('0x1c')]?_0x32f8c8[_0x664e('0x1c')][_0x664e('0x1e')]||null:null,'attributes':_0x32f8c8['options']?_0x32f8c8[_0x664e('0x1c')][_0x664e('0x1f')]||null:null,'include':_0x32f8c8[_0x664e('0x1c')]?_0x32f8c8['options'][_0x664e('0x21')]?_[_0x664e('0x22')](_0x32f8c8['options'][_0x664e('0x21')],function(_0x435c71){return{'model':db[_0x435c71['model']],'as':_0x435c71['as'],'attributes':_0x435c71[_0x664e('0x1f')],'include':_0x435c71[_0x664e('0x21')]?_['map'](_0x435c71[_0x664e('0x21')],function(_0x2e8c29){return{'model':db[_0x2e8c29['model']],'as':_0x2e8c29['as'],'attributes':_0x2e8c29['attributes'],'include':_0x2e8c29[_0x664e('0x21')]?_[_0x664e('0x22')](_0x2e8c29[_0x664e('0x21')],function(_0x6e5f91){return{'model':db[_0x6e5f91[_0x664e('0x24')]],'as':_0x6e5f91['as'],'attributes':_0x6e5f91['attributes']};}):[]};}):[]};}):[]:[]})[_0x664e('0x10')](function(_0x1f71f0){logger[_0x664e('0x11')](_0x664e('0x25'),_0x32f8c8);logger[_0x664e('0x13')](_0x664e('0x25'),_0x32f8c8,JSON[_0x664e('0x15')](_0x1f71f0));_0x2904f8(_0x1f71f0);})[_0x664e('0x1a')](function(_0x5af41c){logger[_0x664e('0x17')](_0x664e('0x25'),_0x5af41c[_0x664e('0x18')],_0x32f8c8);_0x14b02b(_0x22b618['error'](0x1f4,_0x5af41c['message']));});});}; \ No newline at end of file +var _0x1aab=['../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','findAll','options','raw','where','attributes','include','map','model','ShowChatQueue','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x28ea86,_0x7402c6){var _0x25a519=function(_0x5edafb){while(--_0x5edafb){_0x28ea86['push'](_0x28ea86['shift']());}};_0x25a519(++_0x7402c6);}(_0x1aab,0x122));var _0xb1aa=function(_0x56f75c,_0x32b053){_0x56f75c=_0x56f75c-0x0;var _0x34ba47=_0x1aab[_0x56f75c];return _0x34ba47;};'use strict';var _=require(_0xb1aa('0x0'));var util=require(_0xb1aa('0x1'));var moment=require(_0xb1aa('0x2'));var BPromise=require('bluebird');var rs=require(_0xb1aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1aa('0x4'))['db'];var utils=require(_0xb1aa('0x5'));var logger=require(_0xb1aa('0x6'))(_0xb1aa('0x7'));var config=require(_0xb1aa('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb1aa('0x9')]({'port':0x232a});config[_0xb1aa('0xa')]=_[_0xb1aa('0xb')](config[_0xb1aa('0xa')],{'host':_0xb1aa('0xc'),'port':0x18eb});var socket=require(_0xb1aa('0xd'))(new Redis(config[_0xb1aa('0xa')]));require('./chatQueue.socket')[_0xb1aa('0xe')](socket);function respondWithRpcPromise(_0x3ad2cf,_0x4ecea1,_0x16af92){return new BPromise(function(_0x14f02f,_0x7525e6){return client[_0xb1aa('0xf')](_0x3ad2cf,_0x16af92)[_0xb1aa('0x10')](function(_0x317da5){logger[_0xb1aa('0x11')](_0xb1aa('0x12'),_0x4ecea1,_0xb1aa('0x13'));logger[_0xb1aa('0x14')](_0xb1aa('0x15'),_0x4ecea1,_0xb1aa('0x13'),JSON[_0xb1aa('0x16')](_0x317da5));if(_0x317da5[_0xb1aa('0x17')]){if(_0x317da5[_0xb1aa('0x17')]['code']===0x1f4){logger['error'](_0xb1aa('0x12'),_0x4ecea1,_0x317da5['error'][_0xb1aa('0x18')]);return _0x7525e6(_0x317da5['error'][_0xb1aa('0x18')]);}logger['error'](_0xb1aa('0x12'),_0x4ecea1,_0x317da5['error'][_0xb1aa('0x18')]);return _0x14f02f(_0x317da5[_0xb1aa('0x17')]['message']);}else{logger[_0xb1aa('0x11')](_0xb1aa('0x12'),_0x4ecea1,_0xb1aa('0x13'));_0x14f02f(_0x317da5[_0xb1aa('0x19')][_0xb1aa('0x18')]);}})[_0xb1aa('0x1a')](function(_0x40c985){logger[_0xb1aa('0x17')](_0xb1aa('0x12'),_0x4ecea1,_0x40c985);_0x7525e6(_0x40c985);});});}exports[_0xb1aa('0x1b')]=function(_0x142c6d){var _0x346858=this;return new Promise(function(_0x452e6b,_0x5ca191){return db['ChatQueue'][_0xb1aa('0x1c')]({'raw':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x1e')]===undefined?!![]:![]:!![],'where':_0x142c6d['options']?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x1f')]||null:null,'attributes':_0x142c6d['options']?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x20')]||null:null,'limit':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d['options']['limit']||null:null,'include':_0x142c6d[_0xb1aa('0x1d')]?_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x142c6d[_0xb1aa('0x1d')][_0xb1aa('0x21')],function(_0x26ec21){return{'model':db[_0x26ec21[_0xb1aa('0x23')]],'as':_0x26ec21['as'],'attributes':_0x26ec21[_0xb1aa('0x20')],'include':_0x26ec21[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x26ec21[_0xb1aa('0x21')],function(_0x34b5e8){return{'model':db[_0x34b5e8[_0xb1aa('0x23')]],'as':_0x34b5e8['as'],'attributes':_0x34b5e8[_0xb1aa('0x20')],'include':_0x34b5e8['include']?_[_0xb1aa('0x22')](_0x34b5e8[_0xb1aa('0x21')],function(_0x3c1b92){return{'model':db[_0x3c1b92[_0xb1aa('0x23')]],'as':_0x3c1b92['as'],'attributes':_0x3c1b92['attributes']};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x10')](function(_0x44ac69){logger['info'](_0xb1aa('0x1b'),_0x142c6d);logger[_0xb1aa('0x14')](_0xb1aa('0x1b'),_0x142c6d,JSON['stringify'](_0x44ac69));_0x452e6b(_0x44ac69);})[_0xb1aa('0x1a')](function(_0x120cc3){logger['error']('GetChatQueue',_0x120cc3[_0xb1aa('0x18')],_0x142c6d);_0x5ca191(_0x346858[_0xb1aa('0x17')](0x1f4,_0x120cc3[_0xb1aa('0x18')]));});});};exports[_0xb1aa('0x24')]=function(_0x28ad9a){var _0x1d0f05=this;return new Promise(function(_0x51000f,_0x42ff4a){return db['ChatQueue']['find']({'raw':_0x28ad9a['options']?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x1e')]===undefined?!![]:![]:!![],'where':_0x28ad9a[_0xb1aa('0x1d')]?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x1f')]||null:null,'attributes':_0x28ad9a['options']?_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x20')]||null:null,'include':_0x28ad9a[_0xb1aa('0x1d')]?_0x28ad9a['options']['include']?_['map'](_0x28ad9a[_0xb1aa('0x1d')][_0xb1aa('0x21')],function(_0x2b49d6){return{'model':db[_0x2b49d6[_0xb1aa('0x23')]],'as':_0x2b49d6['as'],'attributes':_0x2b49d6['attributes'],'include':_0x2b49d6[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x2b49d6[_0xb1aa('0x21')],function(_0x30cee3){return{'model':db[_0x30cee3['model']],'as':_0x30cee3['as'],'attributes':_0x30cee3[_0xb1aa('0x20')],'include':_0x30cee3[_0xb1aa('0x21')]?_[_0xb1aa('0x22')](_0x30cee3['include'],function(_0xf2ed78){return{'model':db[_0xf2ed78[_0xb1aa('0x23')]],'as':_0xf2ed78['as'],'attributes':_0xf2ed78[_0xb1aa('0x20')]};}):[]};}):[]};}):[]:[]})[_0xb1aa('0x10')](function(_0x2f8443){logger[_0xb1aa('0x11')](_0xb1aa('0x24'),_0x28ad9a);logger[_0xb1aa('0x14')](_0xb1aa('0x24'),_0x28ad9a,JSON['stringify'](_0x2f8443));_0x51000f(_0x2f8443);})[_0xb1aa('0x1a')](function(_0x4a6ce0){logger[_0xb1aa('0x17')](_0xb1aa('0x24'),_0x4a6ce0[_0xb1aa('0x18')],_0x28ad9a);_0x42ff4a(_0x1d0f05[_0xb1aa('0x17')](0x1f4,_0x4a6ce0['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index ea814f8..a7a5744 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 _0xe5b3=['remove','update','emit','removeListener','register','chatQueue:','save'];(function(_0x190e61,_0x45b2a7){var _0x53ce76=function(_0x40bbad){while(--_0x40bbad){_0x190e61['push'](_0x190e61['shift']());}};_0x53ce76(++_0x45b2a7);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2e1c63,_0x576c5b){_0x2e1c63=_0x2e1c63-0x0;var _0x224607=_0xe5b3[_0x2e1c63];return _0x224607;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x3e5b('0x0'),_0x3e5b('0x1'),_0x3e5b('0x2')];function createListener(_0x1c38ed,_0x2a71ef){return function(_0x3171c5){_0x2a71ef[_0x3e5b('0x3')](_0x1c38ed,_0x3171c5);};}function removeListener(_0x1e58ed,_0x320b1e){return function(){ChatQueueEvents[_0x3e5b('0x4')](_0x1e58ed,_0x320b1e);};}exports[_0x3e5b('0x5')]=function(_0x54e1fb){for(var _0x174923=0x0,_0x5dcf55=events['length'];_0x174923<_0x5dcf55;_0x174923++){var _0x41d46f=events[_0x174923];var _0x3901c2=createListener(_0x3e5b('0x6')+_0x41d46f,_0x54e1fb);ChatQueueEvents['on'](_0x41d46f,_0x3901c2);}}; \ No newline at end of file +var _0x9bde=['chatQueue:','save','update','emit','removeListener','register','length'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5eb2bf,_0x3929ec){_0x5eb2bf=_0x5eb2bf-0x0;var _0x1ce48e=_0x9bde[_0x5eb2bf];return _0x1ce48e;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){ChatQueueEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);ChatQueueEvents['on'](_0xa66ae2,_0x2d5c75);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index ce154a7..41db94c 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x8b4cdb,_0x1c9023){var _0x185628=function(_0xf4b4f2){while(--_0xf4b4f2){_0x8b4cdb['push'](_0x8b4cdb['shift']());}};_0x185628(++_0x1c9023);}(_0x814b,0x1a2));var _0xb814=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x814b[_0x261b8a];return _0x3455e8;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x55893f,_0x3edced){var _0xded9b=function(_0x3c43ef){while(--_0x3c43ef){_0x55893f['push'](_0x55893f['shift']());}};_0xded9b(++_0x3edced);}(_0x008c,0x188));var _0xc008=function(_0x5e9c3a,_0x13acc2){_0x5e9c3a=_0x5e9c3a-0x0;var _0x12ccb4=_0x008c[_0x5e9c3a];return _0x12ccb4;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 4039c55..34d565d 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 _0xcf6a=['DATE','STRING','moment','sequelize','exports'];(function(_0x581041,_0x5bd550){var _0xdcae4=function(_0x38d1a3){while(--_0x38d1a3){_0x581041['push'](_0x581041['shift']());}};_0xdcae4(++_0x5bd550);}(_0xcf6a,0xbb));var _0xacf6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xcf6a[_0x5834bc];return _0x3e183a;};'use strict';var moment=require(_0xacf6('0x0'));var Sequelize=require(_0xacf6('0x1'));module[_0xacf6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xacf6('0x3')]},'leaveAt':{'type':Sequelize[_0xacf6('0x3')]},'acceptAt':{'type':Sequelize[_0xacf6('0x3')]},'exitAt':{'type':Sequelize[_0xacf6('0x3')]},'reason':{'type':Sequelize[_0xacf6('0x4')]}}; \ No newline at end of file +var _0xfa57=['moment','sequelize','exports','STRING','DATE'];(function(_0x260511,_0x336f67){var _0x507f2=function(_0x46ceb7){while(--_0x46ceb7){_0x260511['push'](_0x260511['shift']());}};_0x507f2(++_0x336f67);}(_0xfa57,0xe6));var _0x7fa5=function(_0x4aa8ef,_0x3d922a){_0x4aa8ef=_0x4aa8ef-0x0;var _0x2f1c74=_0xfa57[_0x4aa8ef];return _0x2f1c74;};'use strict';var moment=require(_0x7fa5('0x0'));var Sequelize=require(_0x7fa5('0x1'));module[_0x7fa5('0x2')]={'uniqueid':{'type':Sequelize[_0x7fa5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x7fa5('0x3')]},'joinAt':{'type':Sequelize[_0x7fa5('0x4')]},'leaveAt':{'type':Sequelize[_0x7fa5('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7fa5('0x4')]},'reason':{'type':Sequelize[_0x7fa5('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 501ac0b..0d44195 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 _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x687b,0x14a));var _0xb687=function(_0x2a6193,_0x2ec097){_0x2a6193=_0x2a6193-0x0;var _0x317a31=_0x687b[_0x2a6193];return _0x317a31;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['ChatQueueReport'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['ChatQueueReport']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));}; \ No newline at end of file +var _0x7c09=['map','ChatQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index'];(function(_0x5bf172,_0x50b1c4){var _0x824c0c=function(_0x379459){while(--_0x379459){_0x5bf172['push'](_0x5bf172['shift']());}};_0x824c0c(++_0x50b1c4);}(_0x7c09,0x102));var _0x97c0=function(_0x4e267d,_0x18c2b7){_0x4e267d=_0x4e267d-0x0;var _0x4ae1b2=_0x7c09[_0x4e267d];return _0x4ae1b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97c0('0x0'));var zipdir=require(_0x97c0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97c0('0x2'));var moment=require(_0x97c0('0x3'));var BPromise=require(_0x97c0('0x4'));var Mustache=require(_0x97c0('0x5'));var util=require(_0x97c0('0x6'));var path=require(_0x97c0('0x7'));var sox=require(_0x97c0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x97c0('0x9'));var squel=require(_0x97c0('0xa'));var crypto=require(_0x97c0('0xb'));var jsforce=require(_0x97c0('0xc'));var deskjs=require(_0x97c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x97c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x97c0('0xf'));var authService=require(_0x97c0('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97c0('0x11'));var logger=require(_0x97c0('0x12'))(_0x97c0('0x13'));var utils=require(_0x97c0('0x14'));var config=require(_0x97c0('0x15'));var licenseUtil=require(_0x97c0('0x16'));var db=require(_0x97c0('0x17'))['db'];function respondWithStatusCode(_0x39a3b4,_0x9ca3c1){_0x9ca3c1=_0x9ca3c1||0xcc;return function(_0x2ecf34){if(_0x2ecf34){return _0x39a3b4[_0x97c0('0x18')](_0x9ca3c1);}return _0x39a3b4[_0x97c0('0x19')](_0x9ca3c1)[_0x97c0('0x1a')]();};}function respondWithResult(_0x514782,_0x3f2fc2){_0x3f2fc2=_0x3f2fc2||0xc8;return function(_0x15b336){if(_0x15b336){return _0x514782[_0x97c0('0x19')](_0x3f2fc2)['json'](_0x15b336);}};}function respondWithFilteredResult(_0x42027d,_0x9ca6a8){return function(_0x379951){if(_0x379951){var _0x21e5f7=typeof _0x9ca6a8[_0x97c0('0x1b')]===_0x97c0('0x1c')&&typeof _0x9ca6a8['limit']===_0x97c0('0x1c');var _0x3ae7c4=_0x379951['count'];var _0x560ac0=_0x21e5f7?0x0:_0x9ca6a8[_0x97c0('0x1b')];var _0x179d43=_0x21e5f7?_0x379951[_0x97c0('0x1d')]:_0x9ca6a8[_0x97c0('0x1b')]+_0x9ca6a8[_0x97c0('0x1e')];var _0x4fed42;if(_0x179d43>=_0x3ae7c4){_0x179d43=_0x3ae7c4;_0x4fed42=0xc8;}else{_0x4fed42=0xce;}_0x42027d[_0x97c0('0x19')](_0x4fed42);return _0x42027d[_0x97c0('0x1f')](_0x97c0('0x20'),_0x560ac0+'-'+_0x179d43+'/'+_0x3ae7c4)['json'](_0x379951);}return null;};}function patchUpdates(_0x554122){return function(_0x2b74a2){try{jsonpatch[_0x97c0('0x21')](_0x2b74a2,_0x554122,!![]);}catch(_0x169f19){return BPromise['reject'](_0x169f19);}return _0x2b74a2[_0x97c0('0x22')]();};}function saveUpdates(_0x20bc4c,_0x31ffb7){return function(_0x272314){if(_0x272314){return _0x272314[_0x97c0('0x23')](_0x20bc4c)[_0x97c0('0x24')](function(_0x9dff60){return _0x9dff60;});}return null;};}function removeEntity(_0x5ac457,_0x60ab00){return function(_0x29b3aa){if(_0x29b3aa){return _0x29b3aa[_0x97c0('0x25')]()[_0x97c0('0x24')](function(){_0x5ac457['status'](0xcc)[_0x97c0('0x1a')]();});}};}function handleEntityNotFound(_0x14cada,_0x52a429){return function(_0x2ec9d6){if(!_0x2ec9d6){_0x14cada[_0x97c0('0x18')](0x194);}return _0x2ec9d6;};}function handleError(_0x447316,_0x4af5a5){_0x4af5a5=_0x4af5a5||0x1f4;return function(_0x4f11ba){logger['error'](_0x4f11ba[_0x97c0('0x26')]);if(_0x4f11ba[_0x97c0('0x27')]){delete _0x4f11ba[_0x97c0('0x27')];}_0x447316[_0x97c0('0x19')](_0x4af5a5)[_0x97c0('0x28')](_0x4f11ba);};}exports[_0x97c0('0x29')]=function(_0x4a3645,_0x10e47e){var _0x1c183f={},_0x325090={},_0x4ad645={'count':0x0,'rows':[]};var _0x14617c=_[_0x97c0('0x2a')](db[_0x97c0('0x2b')][_0x97c0('0x2c')],function(_0x2a7b2b){return{'name':_0x2a7b2b['fieldName'],'type':_0x2a7b2b['type'][_0x97c0('0x2d')]};});_0x325090[_0x97c0('0x2e')]=_[_0x97c0('0x2a')](_0x14617c,'name');_0x325090[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x4a3645['query']);_0x325090[_0x97c0('0x31')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],_0x325090[_0x97c0('0x2f')]);_0x1c183f[_0x97c0('0x33')]=_[_0x97c0('0x32')](_0x325090[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x1c183f[_0x97c0('0x33')]=_0x1c183f[_0x97c0('0x33')][_0x97c0('0x35')]?_0x1c183f[_0x97c0('0x33')]:_0x325090[_0x97c0('0x2e')];if(!_0x4a3645['query'][_0x97c0('0x36')](_0x97c0('0x37'))){_0x1c183f[_0x97c0('0x1e')]=qs[_0x97c0('0x1e')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x1e')]);_0x1c183f[_0x97c0('0x1b')]=qs[_0x97c0('0x1b')](_0x4a3645['query'][_0x97c0('0x1b')]);}_0x1c183f['order']=qs[_0x97c0('0x38')](_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x38')]);_0x1c183f[_0x97c0('0x39')]=qs[_0x97c0('0x31')](_[_0x97c0('0x3a')](_0x4a3645[_0x97c0('0x2f')],_0x325090[_0x97c0('0x31')]),_0x14617c);if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3b')]){_0x1c183f[_0x97c0('0x39')]=_['merge'](_0x1c183f[_0x97c0('0x39')],{'$or':_[_0x97c0('0x2a')](_0x14617c,function(_0x4d47b1){if(_0x4d47b1[_0x97c0('0x3c')]!==_0x97c0('0x3d')){var _0x2aeffc={};_0x2aeffc[_0x4d47b1[_0x97c0('0x27')]]={'$like':'%'+_0x4a3645['query'][_0x97c0('0x3b')]+'%'};return _0x2aeffc;}})});}_0x1c183f=_['merge']({},_0x1c183f,_0x4a3645[_0x97c0('0x3e')]);var _0x64cfcd={'where':_0x1c183f['where']};return db[_0x97c0('0x2b')][_0x97c0('0x1d')](_0x64cfcd)[_0x97c0('0x24')](function(_0xb13649){_0x4ad645[_0x97c0('0x1d')]=_0xb13649;if(_0x4a3645[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x1c183f[_0x97c0('0x40')]=[{'all':!![]}];}return db[_0x97c0('0x2b')][_0x97c0('0x41')](_0x1c183f);})[_0x97c0('0x24')](function(_0x2cca4c){_0x4ad645[_0x97c0('0x42')]=_0x2cca4c;return _0x4ad645;})['then'](respondWithFilteredResult(_0x10e47e,_0x1c183f))[_0x97c0('0x43')](handleError(_0x10e47e,null));};exports[_0x97c0('0x44')]=function(_0x1dc6ff,_0x142421){var _0x312fce={'raw':!![],'where':{'id':_0x1dc6ff[_0x97c0('0x45')]['id']}},_0x375ebc={};_0x375ebc['model']=_['keys'](db[_0x97c0('0x2b')][_0x97c0('0x2c')]);_0x375ebc[_0x97c0('0x2f')]=_[_0x97c0('0x30')](_0x1dc6ff[_0x97c0('0x2f')]);_0x375ebc['filters']=_['intersection'](_0x375ebc['model'],_0x375ebc[_0x97c0('0x2f')]);_0x312fce['attributes']=_['intersection'](_0x375ebc[_0x97c0('0x2e')],qs[_0x97c0('0x34')](_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x34')]));_0x312fce[_0x97c0('0x33')]=_0x312fce['attributes'][_0x97c0('0x35')]?_0x312fce[_0x97c0('0x33')]:_0x375ebc[_0x97c0('0x2e')];if(_0x1dc6ff[_0x97c0('0x2f')][_0x97c0('0x3f')]){_0x312fce[_0x97c0('0x40')]=[{'all':!![]}];}_0x312fce=_[_0x97c0('0x46')]({},_0x312fce,_0x1dc6ff[_0x97c0('0x3e')]);return db[_0x97c0('0x2b')][_0x97c0('0x47')](_0x312fce)['then'](handleEntityNotFound(_0x142421,null))[_0x97c0('0x24')](respondWithResult(_0x142421,null))[_0x97c0('0x43')](handleError(_0x142421,null));};exports[_0x97c0('0x48')]=function(_0x276c98,_0x4ff0a5){return db['ChatQueueReport'][_0x97c0('0x48')](_0x276c98[_0x97c0('0x49')],{})[_0x97c0('0x24')](respondWithResult(_0x4ff0a5,0xc9))['catch'](handleError(_0x4ff0a5,null));};exports[_0x97c0('0x23')]=function(_0xac56ac,_0x240f68){if(_0xac56ac[_0x97c0('0x49')]['id']){delete _0xac56ac[_0x97c0('0x49')]['id'];}return db['ChatQueueReport'][_0x97c0('0x47')]({'where':{'id':_0xac56ac[_0x97c0('0x45')]['id']}})[_0x97c0('0x24')](handleEntityNotFound(_0x240f68,null))['then'](saveUpdates(_0xac56ac['body'],null))[_0x97c0('0x24')](respondWithResult(_0x240f68,null))['catch'](handleError(_0x240f68,null));};exports['destroy']=function(_0x473b63,_0x20e2a5){return db[_0x97c0('0x2b')]['find']({'where':{'id':_0x473b63['params']['id']}})['then'](handleEntityNotFound(_0x20e2a5,null))[_0x97c0('0x24')](removeEntity(_0x20e2a5,null))[_0x97c0('0x43')](handleError(_0x20e2a5,null));};exports[_0x97c0('0x4a')]=function(_0xdb2767,_0x397065){return db[_0x97c0('0x2b')][_0x97c0('0x4a')]()['then'](respondWithResult(_0x397065,null))[_0x97c0('0x43')](handleError(_0x397065,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 9c712f3..cdc6a08 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xec17dc,_0x30bada){var _0x1ef30d=function(_0x542423){while(--_0x542423){_0xec17dc['push'](_0xec17dc['shift']());}};_0x1ef30d(++_0x30bada);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 +var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x187536,_0x330504){var _0x5d1f13=function(_0xdbcf0e){while(--_0xdbcf0e){_0x187536['push'](_0x187536['shift']());}};_0x5d1f13(++_0x330504);}(_0xb7e7,0x121));var _0x7b7e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xb7e7[_0x187ee1];return _0x388160;};'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_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 1931d76..e6cc9a0 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 _0x9003=['UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','debug','update','where','attributes'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x9003,0xcd));var _0x3900=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9003[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x3900('0x0'));var util=require('util');var moment=require(_0x3900('0x1'));var BPromise=require(_0x3900('0x2'));var rs=require(_0x3900('0x3'));var fs=require('fs');var Redis=require(_0x3900('0x4'));var db=require(_0x3900('0x5'))['db'];var utils=require(_0x3900('0x6'));var logger=require(_0x3900('0x7'))(_0x3900('0x8'));var config=require(_0x3900('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3900('0xa')][_0x3900('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50281e,_0x2b550c,_0x4d6979){return new BPromise(function(_0x3a8ed4,_0xa12b58){return client['request'](_0x50281e,_0x4d6979)['then'](function(_0x584bcc){logger[_0x3900('0xc')](_0x3900('0xd'),_0x2b550c,_0x3900('0xe'));logger['debug'](_0x3900('0xf'),_0x2b550c,_0x3900('0xe'),JSON[_0x3900('0x10')](_0x584bcc));if(_0x584bcc[_0x3900('0x11')]){if(_0x584bcc[_0x3900('0x11')][_0x3900('0x12')]===0x1f4){logger['error'](_0x3900('0xd'),_0x2b550c,_0x584bcc['error'][_0x3900('0x13')]);return _0xa12b58(_0x584bcc['error']['message']);}logger[_0x3900('0x11')](_0x3900('0xd'),_0x2b550c,_0x584bcc[_0x3900('0x11')]['message']);return _0x3a8ed4(_0x584bcc['error'][_0x3900('0x13')]);}else{logger[_0x3900('0xc')](_0x3900('0xd'),_0x2b550c,_0x3900('0xe'));_0x3a8ed4(_0x584bcc[_0x3900('0x14')][_0x3900('0x13')]);}})[_0x3900('0x15')](function(_0x19730c){logger[_0x3900('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x2b550c,_0x19730c);_0xa12b58(_0x19730c);});});}exports[_0x3900('0x16')]=function(_0x5e5367){var _0x59049b=this;return new Promise(function(_0x39a4cb,_0x43150c){return db[_0x3900('0x17')][_0x3900('0x18')](_0x5e5367[_0x3900('0x19')],{'raw':_0x5e5367['options']?_0x5e5367[_0x3900('0x1a')][_0x3900('0x1b')]===undefined?!![]:![]:!![]})[_0x3900('0x1c')](function(_0x4f343f){logger[_0x3900('0xc')](_0x3900('0x16'),_0x5e5367);logger[_0x3900('0x1d')](_0x3900('0x16'),_0x5e5367,JSON[_0x3900('0x10')](_0x4f343f));_0x39a4cb(_0x4f343f);})[_0x3900('0x15')](function(_0x2065bd){logger['error']('CreateChatQueueReport',_0x2065bd[_0x3900('0x13')],_0x5e5367);_0x43150c(_0x59049b['error'](0x1f4,_0x2065bd['message']));});});};exports['UpdateChatQueueReport']=function(_0x39ed4a){var _0x1f319d=this;return new Promise(function(_0xca43be,_0x568fd6){return db[_0x3900('0x17')][_0x3900('0x1e')](_0x39ed4a['body'],{'raw':_0x39ed4a[_0x3900('0x1a')]?_0x39ed4a['options'][_0x3900('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39ed4a[_0x3900('0x1a')]?_0x39ed4a[_0x3900('0x1a')][_0x3900('0x1f')]||null:null,'attributes':_0x39ed4a['options']?_0x39ed4a[_0x3900('0x1a')][_0x3900('0x20')]||null:null,'limit':_0x39ed4a[_0x3900('0x1a')]?_0x39ed4a[_0x3900('0x1a')]['limit']||null:null})[_0x3900('0x1c')](function(_0x1f70b8){logger[_0x3900('0xc')](_0x3900('0x21'),_0x39ed4a);logger[_0x3900('0x1d')](_0x3900('0x21'),_0x39ed4a,JSON[_0x3900('0x10')](_0x1f70b8));_0xca43be(_0x1f70b8);})[_0x3900('0x15')](function(_0x481441){logger[_0x3900('0x11')](_0x3900('0x21'),_0x481441[_0x3900('0x13')],_0x39ed4a);_0x568fd6(_0x1f319d[_0x3900('0x11')](0x1f4,_0x481441[_0x3900('0x13')]));});});}; \ No newline at end of file +var _0x79d3=['options','CreateChatQueueReport','UpdateChatQueueReport','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','body'];(function(_0x56f0ed,_0x431d41){var _0x218285=function(_0x16c4b5){while(--_0x16c4b5){_0x56f0ed['push'](_0x56f0ed['shift']());}};_0x218285(++_0x431d41);}(_0x79d3,0x1c6));var _0x379d=function(_0x523cc7,_0x34b3d0){_0x523cc7=_0x523cc7-0x0;var _0x268b8b=_0x79d3[_0x523cc7];return _0x268b8b;};'use strict';var _=require(_0x379d('0x0'));var util=require(_0x379d('0x1'));var moment=require(_0x379d('0x2'));var BPromise=require(_0x379d('0x3'));var rs=require(_0x379d('0x4'));var fs=require('fs');var Redis=require(_0x379d('0x5'));var db=require(_0x379d('0x6'))['db'];var utils=require(_0x379d('0x7'));var logger=require('../../config/logger')(_0x379d('0x8'));var config=require(_0x379d('0x9'));var jayson=require(_0x379d('0xa'));var client=jayson[_0x379d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16155a,_0x8aee7c,_0x3d1905){return new BPromise(function(_0x20e8b4,_0x4a0de6){return client['request'](_0x16155a,_0x3d1905)[_0x379d('0xc')](function(_0x160db2){logger[_0x379d('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x8aee7c,_0x379d('0xe'));logger[_0x379d('0xf')](_0x379d('0x10'),_0x8aee7c,'request\x20sent',JSON[_0x379d('0x11')](_0x160db2));if(_0x160db2[_0x379d('0x12')]){if(_0x160db2[_0x379d('0x12')][_0x379d('0x13')]===0x1f4){logger['error'](_0x379d('0x14'),_0x8aee7c,_0x160db2['error'][_0x379d('0x15')]);return _0x4a0de6(_0x160db2[_0x379d('0x12')][_0x379d('0x15')]);}logger[_0x379d('0x12')](_0x379d('0x14'),_0x8aee7c,_0x160db2[_0x379d('0x12')][_0x379d('0x15')]);return _0x20e8b4(_0x160db2[_0x379d('0x12')]['message']);}else{logger[_0x379d('0xd')](_0x379d('0x14'),_0x8aee7c,_0x379d('0xe'));_0x20e8b4(_0x160db2[_0x379d('0x16')][_0x379d('0x15')]);}})[_0x379d('0x17')](function(_0x2e768f){logger[_0x379d('0x12')](_0x379d('0x14'),_0x8aee7c,_0x2e768f);_0x4a0de6(_0x2e768f);});});}exports['CreateChatQueueReport']=function(_0x4708b3){var _0x191083=this;return new Promise(function(_0x247da8,_0x81c1d5){return db[_0x379d('0x18')]['create'](_0x4708b3[_0x379d('0x19')],{'raw':_0x4708b3[_0x379d('0x1a')]?_0x4708b3[_0x379d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x379d('0xc')](function(_0x46ed45){logger[_0x379d('0xd')](_0x379d('0x1b'),_0x4708b3);logger['debug'](_0x379d('0x1b'),_0x4708b3,JSON[_0x379d('0x11')](_0x46ed45));_0x247da8(_0x46ed45);})[_0x379d('0x17')](function(_0x4678f6){logger['error'](_0x379d('0x1b'),_0x4678f6[_0x379d('0x15')],_0x4708b3);_0x81c1d5(_0x191083[_0x379d('0x12')](0x1f4,_0x4678f6['message']));});});};exports[_0x379d('0x1c')]=function(_0x181b6c){var _0x57058c=this;return new Promise(function(_0x480480,_0x495bda){return db[_0x379d('0x18')]['update'](_0x181b6c['body'],{'raw':_0x181b6c[_0x379d('0x1a')]?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1e')]||null:null,'attributes':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')][_0x379d('0x1f')]||null:null,'limit':_0x181b6c['options']?_0x181b6c[_0x379d('0x1a')]['limit']||null:null})['then'](function(_0x2be3bc){logger[_0x379d('0xd')](_0x379d('0x1c'),_0x181b6c);logger['debug'](_0x379d('0x1c'),_0x181b6c,JSON[_0x379d('0x11')](_0x2be3bc));_0x480480(_0x2be3bc);})[_0x379d('0x17')](function(_0x931d5e){logger['error'](_0x379d('0x1c'),_0x931d5e[_0x379d('0x15')],_0x181b6c);_0x495bda(_0x57058c['error'](0x1f4,_0x931d5e[_0x379d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 7559b23..26dd3ca 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 _0xee4e=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get'];(function(_0x1d90ca,_0x3bab16){var _0x28872b=function(_0x3ea71b){while(--_0x3ea71b){_0x1d90ca['push'](_0x1d90ca['shift']());}};_0x28872b(++_0x3bab16);}(_0xee4e,0xa0));var _0xeee4=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xee4e[_0x465028];return _0xb783d4;};'use strict';var multer=require(_0xeee4('0x0'));var util=require(_0xeee4('0x1'));var path=require(_0xeee4('0x2'));var timeout=require(_0xeee4('0x3'));var express=require(_0xeee4('0x4'));var router=express['Router']();var fs_extra=require(_0xeee4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeee4('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xeee4('0x7')]('/',auth[_0xeee4('0x8')](),controller[_0xeee4('0x9')]);router['get'](_0xeee4('0xa'),auth[_0xeee4('0x8')](),controller[_0xeee4('0xb')]);router['get']('/:id',auth[_0xeee4('0x8')](),controller[_0xeee4('0xc')]);router[_0xeee4('0xd')]('/',auth[_0xeee4('0x8')](),controller[_0xeee4('0xe')]);router[_0xeee4('0xf')](_0xeee4('0x10'),auth[_0xeee4('0x8')](),controller[_0xeee4('0x11')]);router[_0xeee4('0x12')](_0xeee4('0x10'),auth['isAuthenticated'](),controller[_0xeee4('0x13')]);module[_0xeee4('0x14')]=router; \ No newline at end of file +var _0xab90=['/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','get','/describe','describe'];(function(_0x14de91,_0x18abe0){var _0x46fee0=function(_0x535e04){while(--_0x535e04){_0x14de91['push'](_0x14de91['shift']());}};_0x46fee0(++_0x18abe0);}(_0xab90,0xb3));var _0x0ab9=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xab90[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0x0ab9('0x0'));var util=require(_0x0ab9('0x1'));var path=require('path');var timeout=require(_0x0ab9('0x2'));var express=require('express');var router=express[_0x0ab9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0ab9('0x4'));var config=require(_0x0ab9('0x5'));var controller=require(_0x0ab9('0x6'));router['get']('/',auth[_0x0ab9('0x7')](),controller['index']);router[_0x0ab9('0x8')](_0x0ab9('0x9'),auth['isAuthenticated'](),controller[_0x0ab9('0xa')]);router[_0x0ab9('0x8')](_0x0ab9('0xb'),auth[_0x0ab9('0x7')](),controller[_0x0ab9('0xc')]);router[_0x0ab9('0xd')]('/',auth[_0x0ab9('0x7')](),controller[_0x0ab9('0xe')]);router[_0x0ab9('0xf')](_0x0ab9('0xb'),auth['isAuthenticated'](),controller[_0x0ab9('0x10')]);router['delete'](_0x0ab9('0xb'),auth[_0x0ab9('0x7')](),controller[_0x0ab9('0x11')]);module[_0x0ab9('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index adab93f..f2eb3ad 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x3bf54b,_0xb1eac8){var _0x38a60e=function(_0x39a842){while(--_0x39a842){_0x3bf54b['push'](_0x3bf54b['shift']());}};_0x38a60e(++_0xb1eac8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x144b30,_0x77072d){_0x144b30=_0x144b30-0x0;var _0x1bb7bc=_0xcb91[_0x144b30];return _0x1bb7bc;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x2fe767,_0x2d37e4){var _0x341e44=function(_0x32aa7f){while(--_0x32aa7f){_0x2fe767['push'](_0x2fe767['shift']());}};_0x341e44(++_0x2d37e4);}(_0xedd9,0xfc));var _0x9edd=function(_0x56092a,_0x291ce5){_0x56092a=_0x56092a-0x0;var _0x1c9558=_0xedd9[_0x56092a];return _0x1c9558;};'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/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 3729056..786db5e 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 _0x4093=['type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','keys','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','ChatTransferReport','rawAttributes','fieldName'];(function(_0x486708,_0x50387e){var _0x24a5fe=function(_0x3fe599){while(--_0x3fe599){_0x486708['push'](_0x486708['shift']());}};_0x24a5fe(++_0x50387e);}(_0x4093,0x10d));var _0x3409=function(_0x54b0f3,_0x5834a0){_0x54b0f3=_0x54b0f3-0x0;var _0x16c089=_0x4093[_0x54b0f3];return _0x16c089;};'use strict';var emlformat=require(_0x3409('0x0'));var rimraf=require(_0x3409('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3409('0x2'));var rp=require('request-promise');var moment=require(_0x3409('0x3'));var BPromise=require(_0x3409('0x4'));var Mustache=require(_0x3409('0x5'));var util=require('util');var path=require(_0x3409('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3409('0x7'));var fs=require('fs');var fs_extra=require(_0x3409('0x8'));var _=require(_0x3409('0x9'));var squel=require(_0x3409('0xa'));var crypto=require(_0x3409('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3409('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3409('0xd'));var Papa=require('papaparse');var Redis=require(_0x3409('0xe'));var authService=require(_0x3409('0xf'));var qs=require(_0x3409('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3409('0x11'));var logger=require(_0x3409('0x12'))(_0x3409('0x13'));var utils=require(_0x3409('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3409('0x15'));var db=require(_0x3409('0x16'))['db'];function respondWithStatusCode(_0x48f2b9,_0x3c3dc8){_0x3c3dc8=_0x3c3dc8||0xcc;return function(_0x44767f){if(_0x44767f){return _0x48f2b9[_0x3409('0x17')](_0x3c3dc8);}return _0x48f2b9[_0x3409('0x18')](_0x3c3dc8)[_0x3409('0x19')]();};}function respondWithResult(_0x3e7cea,_0x51f641){_0x51f641=_0x51f641||0xc8;return function(_0x27a93d){if(_0x27a93d){return _0x3e7cea[_0x3409('0x18')](_0x51f641)[_0x3409('0x1a')](_0x27a93d);}};}function respondWithFilteredResult(_0x5a2376,_0x56e1ea){return function(_0x2b9567){if(_0x2b9567){var _0x2126e3=typeof _0x56e1ea['offset']===_0x3409('0x1b')&&typeof _0x56e1ea[_0x3409('0x1c')]==='undefined';var _0x3a55c7=_0x2b9567[_0x3409('0x1d')];var _0x2cb2c7=_0x2126e3?0x0:_0x56e1ea[_0x3409('0x1e')];var _0x17feb6=_0x2126e3?_0x2b9567[_0x3409('0x1d')]:_0x56e1ea[_0x3409('0x1e')]+_0x56e1ea[_0x3409('0x1c')];var _0x59b01f;if(_0x17feb6>=_0x3a55c7){_0x17feb6=_0x3a55c7;_0x59b01f=0xc8;}else{_0x59b01f=0xce;}_0x5a2376[_0x3409('0x18')](_0x59b01f);return _0x5a2376[_0x3409('0x1f')](_0x3409('0x20'),_0x2cb2c7+'-'+_0x17feb6+'/'+_0x3a55c7)['json'](_0x2b9567);}return null;};}function patchUpdates(_0x167a43){return function(_0x2120bb){try{jsonpatch[_0x3409('0x21')](_0x2120bb,_0x167a43,!![]);}catch(_0xd305f6){return BPromise[_0x3409('0x22')](_0xd305f6);}return _0x2120bb[_0x3409('0x23')]();};}function saveUpdates(_0x28cd11,_0x3eae6f){return function(_0x1df232){if(_0x1df232){return _0x1df232[_0x3409('0x24')](_0x28cd11)['then'](function(_0x261b94){return _0x261b94;});}return null;};}function removeEntity(_0x2b50b7,_0x304d6b){return function(_0x3cbafc){if(_0x3cbafc){return _0x3cbafc[_0x3409('0x25')]()[_0x3409('0x26')](function(){_0x2b50b7[_0x3409('0x18')](0xcc)[_0x3409('0x19')]();});}};}function handleEntityNotFound(_0x3a2e7f,_0xf9de78){return function(_0x42136b){if(!_0x42136b){_0x3a2e7f[_0x3409('0x17')](0x194);}return _0x42136b;};}function handleError(_0x22378d,_0xd27301){_0xd27301=_0xd27301||0x1f4;return function(_0x5cc1d1){logger[_0x3409('0x27')](_0x5cc1d1[_0x3409('0x28')]);if(_0x5cc1d1['name']){delete _0x5cc1d1[_0x3409('0x29')];}_0x22378d[_0x3409('0x18')](_0xd27301)[_0x3409('0x2a')](_0x5cc1d1);};}exports[_0x3409('0x2b')]=function(_0x1bbe95,_0x184f5d){var _0x74cbf2={},_0x2ee3a0={},_0x59366c={'count':0x0,'rows':[]};var _0x2f671f=_['map'](db[_0x3409('0x2c')][_0x3409('0x2d')],function(_0x591876){return{'name':_0x591876[_0x3409('0x2e')],'type':_0x591876[_0x3409('0x2f')][_0x3409('0x30')]};});_0x2ee3a0[_0x3409('0x31')]=_[_0x3409('0x32')](_0x2f671f,_0x3409('0x29'));_0x2ee3a0[_0x3409('0x33')]=_['keys'](_0x1bbe95[_0x3409('0x33')]);_0x2ee3a0[_0x3409('0x34')]=_[_0x3409('0x35')](_0x2ee3a0[_0x3409('0x31')],_0x2ee3a0['query']);_0x74cbf2[_0x3409('0x36')]=_[_0x3409('0x35')](_0x2ee3a0[_0x3409('0x31')],qs[_0x3409('0x37')](_0x1bbe95['query'][_0x3409('0x37')]));_0x74cbf2[_0x3409('0x36')]=_0x74cbf2[_0x3409('0x36')][_0x3409('0x38')]?_0x74cbf2['attributes']:_0x2ee3a0[_0x3409('0x31')];if(!_0x1bbe95[_0x3409('0x33')][_0x3409('0x39')](_0x3409('0x3a'))){_0x74cbf2[_0x3409('0x1c')]=qs[_0x3409('0x1c')](_0x1bbe95[_0x3409('0x33')][_0x3409('0x1c')]);_0x74cbf2[_0x3409('0x1e')]=qs[_0x3409('0x1e')](_0x1bbe95[_0x3409('0x33')][_0x3409('0x1e')]);}_0x74cbf2[_0x3409('0x3b')]=qs[_0x3409('0x3c')](_0x1bbe95[_0x3409('0x33')][_0x3409('0x3c')]);_0x74cbf2[_0x3409('0x3d')]=qs[_0x3409('0x34')](_[_0x3409('0x3e')](_0x1bbe95['query'],_0x2ee3a0[_0x3409('0x34')]),_0x2f671f);if(_0x1bbe95[_0x3409('0x33')]['filter']){_0x74cbf2[_0x3409('0x3d')]=_[_0x3409('0x3f')](_0x74cbf2[_0x3409('0x3d')],{'$or':_[_0x3409('0x32')](_0x2f671f,function(_0x2d644){if(_0x2d644[_0x3409('0x2f')]!==_0x3409('0x40')){var _0x2233f4={};_0x2233f4[_0x2d644[_0x3409('0x29')]]={'$like':'%'+_0x1bbe95[_0x3409('0x33')][_0x3409('0x41')]+'%'};return _0x2233f4;}})});}_0x74cbf2=_['merge']({},_0x74cbf2,_0x1bbe95[_0x3409('0x42')]);var _0x4735cc={'where':_0x74cbf2['where']};return db[_0x3409('0x2c')][_0x3409('0x1d')](_0x4735cc)[_0x3409('0x26')](function(_0x4083db){_0x59366c[_0x3409('0x1d')]=_0x4083db;if(_0x1bbe95[_0x3409('0x33')][_0x3409('0x43')]){_0x74cbf2[_0x3409('0x44')]=[{'all':!![]}];}return db[_0x3409('0x2c')][_0x3409('0x45')](_0x74cbf2);})[_0x3409('0x26')](function(_0xcec97d){_0x59366c[_0x3409('0x46')]=_0xcec97d;return _0x59366c;})['then'](respondWithFilteredResult(_0x184f5d,_0x74cbf2))['catch'](handleError(_0x184f5d,null));};exports[_0x3409('0x47')]=function(_0x129934,_0x41437c){var _0x55444d={'raw':!![],'where':{'id':_0x129934['params']['id']}},_0x51dad3={};_0x51dad3['model']=_[_0x3409('0x48')](db['ChatTransferReport'][_0x3409('0x2d')]);_0x51dad3[_0x3409('0x33')]=_[_0x3409('0x48')](_0x129934[_0x3409('0x33')]);_0x51dad3[_0x3409('0x34')]=_[_0x3409('0x35')](_0x51dad3[_0x3409('0x31')],_0x51dad3[_0x3409('0x33')]);_0x55444d[_0x3409('0x36')]=_[_0x3409('0x35')](_0x51dad3[_0x3409('0x31')],qs['fields'](_0x129934[_0x3409('0x33')][_0x3409('0x37')]));_0x55444d[_0x3409('0x36')]=_0x55444d['attributes'][_0x3409('0x38')]?_0x55444d[_0x3409('0x36')]:_0x51dad3[_0x3409('0x31')];if(_0x129934[_0x3409('0x33')][_0x3409('0x43')]){_0x55444d[_0x3409('0x44')]=[{'all':!![]}];}_0x55444d=_[_0x3409('0x3f')]({},_0x55444d,_0x129934[_0x3409('0x42')]);return db[_0x3409('0x2c')][_0x3409('0x49')](_0x55444d)[_0x3409('0x26')](handleEntityNotFound(_0x41437c,null))[_0x3409('0x26')](respondWithResult(_0x41437c,null))[_0x3409('0x4a')](handleError(_0x41437c,null));};exports[_0x3409('0x4b')]=function(_0x88f899,_0x1352aa){return db[_0x3409('0x2c')]['create'](_0x88f899[_0x3409('0x4c')],{})[_0x3409('0x26')](respondWithResult(_0x1352aa,0xc9))[_0x3409('0x4a')](handleError(_0x1352aa,null));};exports[_0x3409('0x24')]=function(_0x1b1ed8,_0x14d97d){if(_0x1b1ed8[_0x3409('0x4c')]['id']){delete _0x1b1ed8[_0x3409('0x4c')]['id'];}return db['ChatTransferReport']['find']({'where':{'id':_0x1b1ed8[_0x3409('0x4d')]['id']}})[_0x3409('0x26')](handleEntityNotFound(_0x14d97d,null))['then'](saveUpdates(_0x1b1ed8[_0x3409('0x4c')],null))[_0x3409('0x26')](respondWithResult(_0x14d97d,null))[_0x3409('0x4a')](handleError(_0x14d97d,null));};exports[_0x3409('0x25')]=function(_0x3ec68e,_0xbe8ff5){return db[_0x3409('0x2c')][_0x3409('0x49')]({'where':{'id':_0x3ec68e['params']['id']}})[_0x3409('0x26')](handleEntityNotFound(_0xbe8ff5,null))[_0x3409('0x26')](removeEntity(_0xbe8ff5,null))[_0x3409('0x4a')](handleError(_0xbe8ff5,null));};exports[_0x3409('0x4e')]=function(_0x2774e2,_0x442ce9){return db['ChatTransferReport'][_0x3409('0x4e')]()['then'](respondWithResult(_0x442ce9,null))[_0x3409('0x4a')](handleError(_0x442ce9,null));}; \ No newline at end of file +var _0x0472=['lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','ChatTransferReport','rawAttributes','fieldName','type','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','include','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra'];(function(_0x48a366,_0x66ca83){var _0x5664f0=function(_0xeada7d){while(--_0xeada7d){_0x48a366['push'](_0x48a366['shift']());}};_0x5664f0(++_0x66ca83);}(_0x0472,0x1a5));var _0x2047=function(_0x1addc8,_0x3061e9){_0x1addc8=_0x1addc8-0x0;var _0x1ecfa7=_0x0472[_0x1addc8];return _0x1ecfa7;};'use strict';var emlformat=require(_0x2047('0x0'));var rimraf=require(_0x2047('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2047('0x2'));var rp=require(_0x2047('0x3'));var moment=require(_0x2047('0x4'));var BPromise=require(_0x2047('0x5'));var Mustache=require(_0x2047('0x6'));var util=require(_0x2047('0x7'));var path=require(_0x2047('0x8'));var sox=require(_0x2047('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2047('0xa'));var _=require(_0x2047('0xb'));var squel=require(_0x2047('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2047('0xd'));var querystring=require(_0x2047('0xe'));var Papa=require(_0x2047('0xf'));var Redis=require(_0x2047('0x10'));var authService=require(_0x2047('0x11'));var qs=require(_0x2047('0x12'));var as=require(_0x2047('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2047('0x14'))(_0x2047('0x15'));var utils=require(_0x2047('0x16'));var config=require(_0x2047('0x17'));var licenseUtil=require(_0x2047('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x272842,_0x749e95){_0x749e95=_0x749e95||0xcc;return function(_0x361fde){if(_0x361fde){return _0x272842[_0x2047('0x19')](_0x749e95);}return _0x272842[_0x2047('0x1a')](_0x749e95)['end']();};}function respondWithResult(_0x38a45e,_0x539d1e){_0x539d1e=_0x539d1e||0xc8;return function(_0x32d748){if(_0x32d748){return _0x38a45e[_0x2047('0x1a')](_0x539d1e)[_0x2047('0x1b')](_0x32d748);}};}function respondWithFilteredResult(_0x6ec360,_0x1c2d2f){return function(_0x2aa88e){if(_0x2aa88e){var _0x53941d=typeof _0x1c2d2f[_0x2047('0x1c')]===_0x2047('0x1d')&&typeof _0x1c2d2f[_0x2047('0x1e')]===_0x2047('0x1d');var _0x4b283e=_0x2aa88e[_0x2047('0x1f')];var _0x51dae5=_0x53941d?0x0:_0x1c2d2f[_0x2047('0x1c')];var _0x2a08ce=_0x53941d?_0x2aa88e[_0x2047('0x1f')]:_0x1c2d2f['offset']+_0x1c2d2f[_0x2047('0x1e')];var _0x3abe75;if(_0x2a08ce>=_0x4b283e){_0x2a08ce=_0x4b283e;_0x3abe75=0xc8;}else{_0x3abe75=0xce;}_0x6ec360[_0x2047('0x1a')](_0x3abe75);return _0x6ec360[_0x2047('0x20')](_0x2047('0x21'),_0x51dae5+'-'+_0x2a08ce+'/'+_0x4b283e)[_0x2047('0x1b')](_0x2aa88e);}return null;};}function patchUpdates(_0x51f361){return function(_0x16b2a1){try{jsonpatch[_0x2047('0x22')](_0x16b2a1,_0x51f361,!![]);}catch(_0x1f36d2){return BPromise[_0x2047('0x23')](_0x1f36d2);}return _0x16b2a1[_0x2047('0x24')]();};}function saveUpdates(_0x11487e,_0x32c094){return function(_0x8bb2de){if(_0x8bb2de){return _0x8bb2de[_0x2047('0x25')](_0x11487e)[_0x2047('0x26')](function(_0x4e029d){return _0x4e029d;});}return null;};}function removeEntity(_0x2f3395,_0x25cb14){return function(_0x180e21){if(_0x180e21){return _0x180e21['destroy']()[_0x2047('0x26')](function(){_0x2f3395['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x202bd4,_0x32aee4){return function(_0x56840f){if(!_0x56840f){_0x202bd4['sendStatus'](0x194);}return _0x56840f;};}function handleError(_0x17b85c,_0x4ba1d2){_0x4ba1d2=_0x4ba1d2||0x1f4;return function(_0x544673){logger[_0x2047('0x27')](_0x544673['stack']);if(_0x544673[_0x2047('0x28')]){delete _0x544673['name'];}_0x17b85c['status'](_0x4ba1d2)['send'](_0x544673);};}exports['index']=function(_0x20a61f,_0x145d3d){var _0x491f8a={},_0x464e5b={},_0x5c9ce1={'count':0x0,'rows':[]};var _0x1de0f2=_['map'](db[_0x2047('0x29')][_0x2047('0x2a')],function(_0x56f18f){return{'name':_0x56f18f[_0x2047('0x2b')],'type':_0x56f18f[_0x2047('0x2c')]['key']};});_0x464e5b['model']=_[_0x2047('0x2d')](_0x1de0f2,'name');_0x464e5b[_0x2047('0x2e')]=_[_0x2047('0x2f')](_0x20a61f[_0x2047('0x2e')]);_0x464e5b['filters']=_['intersection'](_0x464e5b[_0x2047('0x30')],_0x464e5b['query']);_0x491f8a[_0x2047('0x31')]=_[_0x2047('0x32')](_0x464e5b['model'],qs[_0x2047('0x33')](_0x20a61f['query']['fields']));_0x491f8a['attributes']=_0x491f8a['attributes'][_0x2047('0x34')]?_0x491f8a['attributes']:_0x464e5b[_0x2047('0x30')];if(!_0x20a61f[_0x2047('0x2e')][_0x2047('0x35')](_0x2047('0x36'))){_0x491f8a[_0x2047('0x1e')]=qs[_0x2047('0x1e')](_0x20a61f[_0x2047('0x2e')][_0x2047('0x1e')]);_0x491f8a[_0x2047('0x1c')]=qs[_0x2047('0x1c')](_0x20a61f[_0x2047('0x2e')][_0x2047('0x1c')]);}_0x491f8a[_0x2047('0x37')]=qs[_0x2047('0x38')](_0x20a61f['query'][_0x2047('0x38')]);_0x491f8a[_0x2047('0x39')]=qs[_0x2047('0x3a')](_['pick'](_0x20a61f[_0x2047('0x2e')],_0x464e5b[_0x2047('0x3a')]),_0x1de0f2);if(_0x20a61f[_0x2047('0x2e')]['filter']){_0x491f8a['where']=_[_0x2047('0x3b')](_0x491f8a[_0x2047('0x39')],{'$or':_[_0x2047('0x2d')](_0x1de0f2,function(_0x23b048){if(_0x23b048[_0x2047('0x2c')]!=='VIRTUAL'){var _0x2689be={};_0x2689be[_0x23b048[_0x2047('0x28')]]={'$like':'%'+_0x20a61f[_0x2047('0x2e')][_0x2047('0x3c')]+'%'};return _0x2689be;}})});}_0x491f8a=_[_0x2047('0x3b')]({},_0x491f8a,_0x20a61f[_0x2047('0x3d')]);var _0x2ee205={'where':_0x491f8a[_0x2047('0x39')]};return db[_0x2047('0x29')][_0x2047('0x1f')](_0x2ee205)[_0x2047('0x26')](function(_0x25b0c0){_0x5c9ce1[_0x2047('0x1f')]=_0x25b0c0;if(_0x20a61f[_0x2047('0x2e')]['includeAll']){_0x491f8a[_0x2047('0x3e')]=[{'all':!![]}];}return db[_0x2047('0x29')]['findAll'](_0x491f8a);})[_0x2047('0x26')](function(_0xf28300){_0x5c9ce1[_0x2047('0x3f')]=_0xf28300;return _0x5c9ce1;})[_0x2047('0x26')](respondWithFilteredResult(_0x145d3d,_0x491f8a))['catch'](handleError(_0x145d3d,null));};exports[_0x2047('0x40')]=function(_0x2e36e2,_0xc77543){var _0xe5f2a1={'raw':!![],'where':{'id':_0x2e36e2[_0x2047('0x41')]['id']}},_0x111113={};_0x111113[_0x2047('0x30')]=_[_0x2047('0x2f')](db[_0x2047('0x29')][_0x2047('0x2a')]);_0x111113[_0x2047('0x2e')]=_[_0x2047('0x2f')](_0x2e36e2[_0x2047('0x2e')]);_0x111113[_0x2047('0x3a')]=_[_0x2047('0x32')](_0x111113['model'],_0x111113[_0x2047('0x2e')]);_0xe5f2a1[_0x2047('0x31')]=_['intersection'](_0x111113['model'],qs[_0x2047('0x33')](_0x2e36e2[_0x2047('0x2e')]['fields']));_0xe5f2a1['attributes']=_0xe5f2a1[_0x2047('0x31')][_0x2047('0x34')]?_0xe5f2a1[_0x2047('0x31')]:_0x111113[_0x2047('0x30')];if(_0x2e36e2['query'][_0x2047('0x42')]){_0xe5f2a1[_0x2047('0x3e')]=[{'all':!![]}];}_0xe5f2a1=_[_0x2047('0x3b')]({},_0xe5f2a1,_0x2e36e2['options']);return db[_0x2047('0x29')][_0x2047('0x43')](_0xe5f2a1)['then'](handleEntityNotFound(_0xc77543,null))[_0x2047('0x26')](respondWithResult(_0xc77543,null))[_0x2047('0x44')](handleError(_0xc77543,null));};exports[_0x2047('0x45')]=function(_0x200090,_0x273705){return db[_0x2047('0x29')][_0x2047('0x45')](_0x200090[_0x2047('0x46')],{})['then'](respondWithResult(_0x273705,0xc9))[_0x2047('0x44')](handleError(_0x273705,null));};exports[_0x2047('0x25')]=function(_0x3da4ce,_0x5a9821){if(_0x3da4ce[_0x2047('0x46')]['id']){delete _0x3da4ce[_0x2047('0x46')]['id'];}return db[_0x2047('0x29')][_0x2047('0x43')]({'where':{'id':_0x3da4ce[_0x2047('0x41')]['id']}})[_0x2047('0x26')](handleEntityNotFound(_0x5a9821,null))[_0x2047('0x26')](saveUpdates(_0x3da4ce[_0x2047('0x46')],null))[_0x2047('0x26')](respondWithResult(_0x5a9821,null))[_0x2047('0x44')](handleError(_0x5a9821,null));};exports['destroy']=function(_0x414e22,_0x1621a5){return db[_0x2047('0x29')][_0x2047('0x43')]({'where':{'id':_0x414e22[_0x2047('0x41')]['id']}})[_0x2047('0x26')](handleEntityNotFound(_0x1621a5,null))['then'](removeEntity(_0x1621a5,null))[_0x2047('0x44')](handleError(_0x1621a5,null));};exports['describe']=function(_0x1e14ac,_0x12ae2f){return db[_0x2047('0x29')][_0x2047('0x47')]()[_0x2047('0x26')](respondWithResult(_0x12ae2f,null))[_0x2047('0x44')](handleError(_0x12ae2f,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index dc1eef5..7b32a80 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 _0xc53d=['ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatTransferReport.attributes','exports','define'];(function(_0x19f64f,_0x52c873){var _0x5e2150=function(_0x1d5f64){while(--_0x1d5f64){_0x19f64f['push'](_0x19f64f['shift']());}};_0x5e2150(++_0x52c873);}(_0xc53d,0x65));var _0xdc53=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc53d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdc53('0x0'));var util=require(_0xdc53('0x1'));var logger=require(_0xdc53('0x2'))(_0xdc53('0x3'));var moment=require(_0xdc53('0x4'));var BPromise=require(_0xdc53('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc53('0x6'));var rimraf=require('rimraf');var config=require(_0xdc53('0x7'));var attributes=require(_0xdc53('0x8'));module[_0xdc53('0x9')]=function(_0x35c0b7,_0x2b30e6){return _0x35c0b7[_0xdc53('0xa')](_0xdc53('0xb'),attributes,{'tableName':_0xdc53('0xc'),'paranoid':![],'indexes':[{'name':_0xdc53('0xd'),'fields':[_0xdc53('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4921=['exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','./chatTransferReport.attributes'];(function(_0x1d81ef,_0x5e02f0){var _0x2931ba=function(_0x1f8473){while(--_0x1f8473){_0x1d81ef['push'](_0x1d81ef['shift']());}};_0x2931ba(++_0x5e02f0);}(_0x4921,0xa0));var _0x1492=function(_0x2daef6,_0xcac228){_0x2daef6=_0x2daef6-0x0;var _0x62d030=_0x4921[_0x2daef6];return _0x62d030;};'use strict';var _=require(_0x1492('0x0'));var util=require(_0x1492('0x1'));var logger=require(_0x1492('0x2'))(_0x1492('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1492('0x4'));var fs=require('fs');var path=require(_0x1492('0x5'));var rimraf=require(_0x1492('0x6'));var config=require('../../config/environment');var attributes=require(_0x1492('0x7'));module[_0x1492('0x8')]=function(_0x321385,_0x52e02c){return _0x321385['define'](_0x1492('0x9'),attributes,{'tableName':_0x1492('0xa'),'paranoid':![],'indexes':[{'name':_0x1492('0xb'),'fields':[_0x1492('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 1ea13f2..078f884 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 _0x8c4e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xb37185,_0x3ec508){var _0x575b45=function(_0x2d9b5a){while(--_0x2d9b5a){_0xb37185['push'](_0xb37185['shift']());}};_0x575b45(++_0x3ec508);}(_0x8c4e,0x153));var _0xe8c4=function(_0x208619,_0x4de765){_0x208619=_0x208619-0x0;var _0x1b4b69=_0x8c4e[_0x208619];return _0x1b4b69;};'use strict';var _=require(_0xe8c4('0x0'));var util=require(_0xe8c4('0x1'));var moment=require(_0xe8c4('0x2'));var BPromise=require(_0xe8c4('0x3'));var rs=require(_0xe8c4('0x4'));var fs=require('fs');var Redis=require(_0xe8c4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe8c4('0x6'));var logger=require(_0xe8c4('0x7'))(_0xe8c4('0x8'));var config=require(_0xe8c4('0x9'));var jayson=require(_0xe8c4('0xa'));var client=jayson[_0xe8c4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f895,_0x22d240,_0xcd5268){return new BPromise(function(_0x2cd2bd,_0x8da751){return client['request'](_0x30f895,_0xcd5268)[_0xe8c4('0xc')](function(_0x55ea31){logger[_0xe8c4('0xd')](_0xe8c4('0xe'),_0x22d240,_0xe8c4('0xf'));logger[_0xe8c4('0x10')](_0xe8c4('0x11'),_0x22d240,_0xe8c4('0xf'),JSON[_0xe8c4('0x12')](_0x55ea31));if(_0x55ea31[_0xe8c4('0x13')]){if(_0x55ea31[_0xe8c4('0x13')]['code']===0x1f4){logger[_0xe8c4('0x13')](_0xe8c4('0xe'),_0x22d240,_0x55ea31['error'][_0xe8c4('0x14')]);return _0x8da751(_0x55ea31[_0xe8c4('0x13')][_0xe8c4('0x14')]);}logger['error'](_0xe8c4('0xe'),_0x22d240,_0x55ea31['error']['message']);return _0x2cd2bd(_0x55ea31[_0xe8c4('0x13')][_0xe8c4('0x14')]);}else{logger['info'](_0xe8c4('0xe'),_0x22d240,_0xe8c4('0xf'));_0x2cd2bd(_0x55ea31[_0xe8c4('0x15')][_0xe8c4('0x14')]);}})[_0xe8c4('0x16')](function(_0x3acfab){logger[_0xe8c4('0x13')](_0xe8c4('0xe'),_0x22d240,_0x3acfab);_0x8da751(_0x3acfab);});});} \ No newline at end of file +var _0x4253=['message','ChatTransferReport,\x20%s,\x20%s','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code'];(function(_0xf0f6c7,_0x1de992){var _0x3ba4b3=function(_0x41a0de){while(--_0x41a0de){_0xf0f6c7['push'](_0xf0f6c7['shift']());}};_0x3ba4b3(++_0x1de992);}(_0x4253,0x7a));var _0x3425=function(_0x2cc5ae,_0x4f1bc1){_0x2cc5ae=_0x2cc5ae-0x0;var _0xdffed7=_0x4253[_0x2cc5ae];return _0xdffed7;};'use strict';var _=require(_0x3425('0x0'));var util=require(_0x3425('0x1'));var moment=require(_0x3425('0x2'));var BPromise=require(_0x3425('0x3'));var rs=require(_0x3425('0x4'));var fs=require('fs');var Redis=require(_0x3425('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3425('0x6'))(_0x3425('0x7'));var config=require('../../config/environment');var jayson=require(_0x3425('0x8'));var client=jayson[_0x3425('0x9')][_0x3425('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x297486,_0xc10fad,_0xe4de64){return new BPromise(function(_0x3f0521,_0xd89b22){return client[_0x3425('0xb')](_0x297486,_0xe4de64)[_0x3425('0xc')](function(_0x3df6d8){logger[_0x3425('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x3425('0xe'));logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0xc10fad,'request\x20sent',JSON[_0x3425('0xf')](_0x3df6d8));if(_0x3df6d8[_0x3425('0x10')]){if(_0x3df6d8['error'][_0x3425('0x11')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x3df6d8[_0x3425('0x10')]['message']);return _0xd89b22(_0x3df6d8[_0x3425('0x10')][_0x3425('0x12')]);}logger[_0x3425('0x10')](_0x3425('0x13'),_0xc10fad,_0x3df6d8['error'][_0x3425('0x12')]);return _0x3f0521(_0x3df6d8['error']['message']);}else{logger['info'](_0x3425('0x13'),_0xc10fad,_0x3425('0xe'));_0x3f0521(_0x3df6d8['result'][_0x3425('0x12')]);}})['catch'](function(_0x53df9a){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0xc10fad,_0x53df9a);_0xd89b22(_0x53df9a);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index cc1dba4..b80a66b 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 _0xe34b=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','/:id','update','destroy','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe34b,0xdc));var _0xbe34=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe34b[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0xbe34('0x0'));var util=require(_0xbe34('0x1'));var path=require(_0xbe34('0x2'));var timeout=require('connect-timeout');var express=require(_0xbe34('0x3'));var router=express[_0xbe34('0x4')]();var fs_extra=require(_0xbe34('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbe34('0x6'));var config=require(_0xbe34('0x7'));var controller=require(_0xbe34('0x8'));router['get']('/',auth[_0xbe34('0x9')](),controller[_0xbe34('0xa')]);router[_0xbe34('0xb')](_0xbe34('0xc'),auth[_0xbe34('0x9')](),controller[_0xbe34('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbe34('0xe')]);router[_0xbe34('0xf')]('/',auth[_0xbe34('0x9')](),controller[_0xbe34('0x10')]);router[_0xbe34('0x11')](_0xbe34('0x12'),auth[_0xbe34('0x9')](),controller[_0xbe34('0x13')]);router['delete'](_0xbe34('0x12'),auth[_0xbe34('0x9')](),controller[_0xbe34('0x14')]);module[_0xbe34('0x15')]=router; \ No newline at end of file +var _0x3c03=['./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1676dc,_0x1a027b){var _0x3659d7=function(_0x5ace7f){while(--_0x5ace7f){_0x1676dc['push'](_0x1676dc['shift']());}};_0x3659d7(++_0x1a027b);}(_0x3c03,0xcb));var _0x33c0=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x3c03[_0x49ca18];return _0x145d54;};'use strict';var multer=require('multer');var util=require(_0x33c0('0x0'));var path=require('path');var timeout=require(_0x33c0('0x1'));var express=require(_0x33c0('0x2'));var router=express['Router']();var fs_extra=require(_0x33c0('0x3'));var auth=require(_0x33c0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x33c0('0x5'));var controller=require(_0x33c0('0x6'));router[_0x33c0('0x7')]('/',auth[_0x33c0('0x8')](),controller[_0x33c0('0x9')]);router[_0x33c0('0x7')](_0x33c0('0xa'),auth[_0x33c0('0x8')](),controller['describe']);router[_0x33c0('0x7')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller[_0x33c0('0xc')]);router[_0x33c0('0xd')]('/',auth[_0x33c0('0x8')](),controller[_0x33c0('0xe')]);router[_0x33c0('0xf')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller['update']);router[_0x33c0('0x10')](_0x33c0('0xb'),auth[_0x33c0('0x8')](),controller[_0x33c0('0x11')]);module[_0x33c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 1b51774..1e179e4 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 _0xdffd=['thumb','TEXT','stringify','name','input','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdffd,0x154));var _0xddff=function(_0xabf81e,_0x4425d3){_0xabf81e=_0xabf81e-0x0;var _0x4f2a96=_0xdffd[_0xabf81e];return _0x4f2a96;};'use strict';var Sequelize=require(_0xddff('0x0'));var rs=require(_0xddff('0x1'));module[_0xddff('0x2')]={'name':{'type':Sequelize[_0xddff('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x5')},'customerAlias':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xddff('0x3')],'allowNull':![],'defaultValue':_0xddff('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xddff('0x3')],'allowNull':![],'defaultValue':_0xddff('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xddff('0x9'),_0xddff('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xb')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0xd')},'header_offline':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xe')},'download_transcript':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0x13')},'placeholderMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x14')},'closingMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xd')},'skipMessageButton':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x15')},'conditionAgreement':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x16')},'ratingType':{'type':Sequelize[_0xddff('0x17')]('star',_0xddff('0x18')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xddff('0x19')],'defaultValue':function(){return JSON[_0xddff('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xddff('0x1b'),'type':'text','required':!![]},'props':{'title':_0xddff('0x1b'),'helpText':''}},{'type':_0xddff('0x1c'),'props':{'title':_0xddff('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xddff('0x4'),'type':_0xddff('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xddff('0x1d')](_0xddff('0x1e'))?JSON[_0xddff('0x1f')](this[_0xddff('0x1d')](_0xddff('0x1e'))):{};},'set':function(_0x404e20){return this[_0xddff('0x20')](_0xddff('0x1e'),JSON[_0xddff('0x1a')](_0x404e20));}},'offlineForm':{'type':Sequelize[_0xddff('0x19')],'defaultValue':function(){return JSON[_0xddff('0x1a')]({'items':[{'type':_0xddff('0x1c'),'props':{'title':_0xddff('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xddff('0x4'),'type':_0xddff('0x4')},'variable':null},{'type':_0xddff('0x21'),'config':{'placeholder':_0xddff('0x22')},'props':{'title':_0xddff('0x22'),'helpText':_0xddff('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xddff('0x1f')](this[_0xddff('0x1d')]('offlineForm')):{};},'set':function(_0xe9007c){return this[_0xddff('0x20')]('offlineForm',JSON[_0xddff('0x1a')](_0xe9007c));}},'token':{'type':Sequelize[_0xddff('0x3')],'defaultValue':function(){return rs[_0xddff('0x24')]();}},'autoclose':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xddff('0x3')]},'forwardOffline':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x25')},'waitingMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xddff('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x29')},'skipUnmanaged':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x15')},'sendUnmanaged':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0xd')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xddff('0x19')]},'showAgentAvatar':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xddff('0x3')]},'notificationTemplate':{'type':Sequelize[_0xddff('0x19')],'defaultValue':function(){return _0xddff('0x2a');}},'notificationSound':{'type':Sequelize[_0xddff('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xddff('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x2c')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0xddff('0x19')]},'showCustomerAvatar':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xddff('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xddff('0x3')],'allowNull':![],'defaultValue':_0xddff('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xddff('0x3')],'defaultValue':_0xddff('0x2e')},'systemAvatar':{'type':Sequelize[_0xddff('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xddff('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![],'comment':_0xddff('0x2f'),'set':function(_0xafc8c9){if(!_0xafc8c9)this[_0xddff('0x20')](_0xddff('0x30'),null);this[_0xddff('0x20')](_0xddff('0x31'),_0xafc8c9);}},'vidaooEscalation':{'type':Sequelize[_0xddff('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xddff('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xddff('0x32')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xddff('0x33');}},'vidaooMetadata':{'type':Sequelize[_0xddff('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xddff('0x19')]}}; \ No newline at end of file +var _0x1429=['#fafafa','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','input','name','text','onlineForm','parse','stringify','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right'];(function(_0x59676f,_0x205f4a){var _0x355160=function(_0x4b1e94){while(--_0x4b1e94){_0x59676f['push'](_0x59676f['shift']());}};_0x355160(++_0x205f4a);}(_0x1429,0xcf));var _0x9142=function(_0x113124,_0x2d3bc6){_0x113124=_0x113124-0x0;var _0x205781=_0x1429[_0x113124];return _0x205781;};'use strict';var Sequelize=require(_0x9142('0x0'));var rs=require(_0x9142('0x1'));module[_0x9142('0x2')]={'name':{'type':Sequelize[_0x9142('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'unique':_0x9142('0x4')},'description':{'type':Sequelize[_0x9142('0x3')]},'mapKey':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x5')},'mapKeyOffline':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x5')},'key':{'type':Sequelize[_0x9142('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9142('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9142('0xa')](_0x9142('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0xc')},'offline_chat_button':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'header_offline':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xe')},'download_transcript':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9142('0x11')]},'closingQuestion':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x13')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x14')},'closingMessageButton':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'skipMessageButton':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x15')},'conditionAgreement':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x16')},'ratingType':{'type':Sequelize['ENUM'](_0x9142('0x17'),_0x9142('0x18')),'defaultValue':_0x9142('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9142('0x19'),'variable':null,'config':{'placeholder':_0x9142('0x1a'),'type':_0x9142('0x1b'),'required':!![]},'props':{'title':_0x9142('0x1a'),'helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x9142('0x5'),'type':_0x9142('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x9142('0x1c'))?JSON[_0x9142('0x1d')](this['getDataValue'](_0x9142('0x1c'))):{};},'set':function(_0x25ca11){return this['setDataValue']('onlineForm',JSON[_0x9142('0x1e')](_0x25ca11));}},'offlineForm':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return JSON[_0x9142('0x1e')]({'items':[{'type':_0x9142('0x19'),'props':{'title':_0x9142('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9142('0x5'),'type':'email'},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x9142('0x1f'),'helpText':_0x9142('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x9142('0x21')](_0x9142('0x22'))?JSON['parse'](this['getDataValue'](_0x9142('0x22'))):{};},'set':function(_0x2d5d28){return this['setDataValue'](_0x9142('0x22'),JSON[_0x9142('0x1e')](_0x2d5d28));}},'token':{'type':Sequelize[_0x9142('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9142('0x3')]},'forwardOffline':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9142('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x23')},'waitingMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x25')},'offlineMessageBody':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x27')},'skipUnmanaged':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9142('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9142('0x3')]},'notificationTemplate':{'type':Sequelize[_0x9142('0x11')],'defaultValue':function(){return _0x9142('0x28');}},'notificationSound':{'type':Sequelize[_0x9142('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9142('0x3')],'defaultValue':_0x9142('0x29')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x9142('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x9142('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9142('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9142('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9142('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9142('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9142('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![],'comment':_0x9142('0x2c'),'set':function(_0x2e3312){if(!_0x2e3312)this['setDataValue'](_0x9142('0x2d'),null);this[_0x9142('0x2e')](_0x9142('0x2f'),_0x2e3312);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x9142('0x3')],'allowNull':![],'defaultValue':_0x9142('0x30')},'vidaooNote':{'type':Sequelize[_0x9142('0x3')],'defaultValue':function(){return _0x9142('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x9142('0x11')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9142('0xf')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9142('0x11')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index eb84583..6d7b848 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 _0xf828=['threadId','ChatInteraction','externalUrl','interaction','spread','firstName','messageId','update','created','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','createdAt','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','offlineMessageBody','originalname','mimetype','attachments','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','lastName','Chat','MailAccountId','NotifyMailAccount','notifyMail','server','addInteraction','Contact','User','fullname','internal','Tag','color','tag','getSnippet','timezone','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','chatLicenseExceeded','all','x-real-ip','connection','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','findAndCountAll','getApplications','addProactiveActions','omit','getFields','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','http','client','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','destroy','get','ChatWebsites','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','ChatWebsite','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','Disposition','getDispositions','findOne','order','ChatWebsiteId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','priority','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s'];(function(_0x6bf4f,_0x16bd90){var _0x2ccc13=function(_0x2daacd){while(--_0x2daacd){_0x6bf4f['push'](_0x6bf4f['shift']());}};_0x2ccc13(++_0x16bd90);}(_0xf828,0x75));var _0x8f82=function(_0x7d9126,_0x1846b8){_0x7d9126=_0x7d9126-0x0;var _0x3db79e=_0xf828[_0x7d9126];return _0x3db79e;};'use strict';var emlformat=require(_0x8f82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8f82('0x1'));var jsonpatch=require(_0x8f82('0x2'));var rp=require(_0x8f82('0x3'));var moment=require(_0x8f82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8f82('0x5'));var util=require(_0x8f82('0x6'));var path=require(_0x8f82('0x7'));var sox=require(_0x8f82('0x8'));var csv=require('to-csv');var ejs=require(_0x8f82('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f82('0xa'));var squel=require(_0x8f82('0xb'));var crypto=require('crypto');var jsforce=require(_0x8f82('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8f82('0xd'));var querystring=require(_0x8f82('0xe'));var Papa=require(_0x8f82('0xf'));var Redis=require('ioredis');var authService=require(_0x8f82('0x10'));var qs=require(_0x8f82('0x11'));var as=require(_0x8f82('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8f82('0x13'));var utils=require(_0x8f82('0x14'));var config=require(_0x8f82('0x15'));var licenseUtil=require(_0x8f82('0x16'));var db=require(_0x8f82('0x17'))['db'];config[_0x8f82('0x18')]=_[_0x8f82('0x19')](config[_0x8f82('0x18')],{'host':_0x8f82('0x1a'),'port':0x18eb});var socket=require(_0x8f82('0x1b'))(new Redis(config[_0x8f82('0x18')]));require(_0x8f82('0x1c'))[_0x8f82('0x1d')](socket);var jayson=require(_0x8f82('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x8f82('0x1f')]({'port':0x232a});var client9003=jayson[_0x8f82('0x20')]['http']({'port':0x232b});var client9001=jayson[_0x8f82('0x20')]['http']({'port':0x2329});function respondWithRpcPromise(_0x14c633,_0x1fab60,_0x40bab9,_0x3cecae){return new BPromise(function(_0x56d019,_0x2360c9){var _0x2fa9a2=_0x3cecae||client;return _0x2fa9a2[_0x8f82('0x21')](_0x14c633,_0x40bab9)[_0x8f82('0x22')](function(_0x23a506){logger[_0x8f82('0x23')](_0x8f82('0x24'),_0x1fab60,_0x8f82('0x25'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1fab60,_0x8f82('0x25'),JSON[_0x8f82('0x26')](_0x23a506));if(_0x23a506[_0x8f82('0x27')]){if(_0x23a506[_0x8f82('0x27')]['code']===0x1f4){logger[_0x8f82('0x27')](_0x8f82('0x24'),_0x1fab60,_0x23a506[_0x8f82('0x27')][_0x8f82('0x28')]);return _0x2360c9(_0x23a506[_0x8f82('0x27')][_0x8f82('0x28')]);}logger[_0x8f82('0x27')](_0x8f82('0x24'),_0x1fab60,_0x23a506[_0x8f82('0x27')][_0x8f82('0x28')]);return _0x56d019(_0x23a506['error'][_0x8f82('0x28')]);}else{logger['info'](_0x8f82('0x24'),_0x1fab60,_0x8f82('0x25'));_0x56d019(_0x23a506[_0x8f82('0x29')][_0x8f82('0x28')]);}})[_0x8f82('0x2a')](function(_0x3a750d){logger[_0x8f82('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x1fab60,_0x3a750d);_0x2360c9(_0x3a750d);});});}function respondWithStatusCode(_0x4fb356,_0x552594){_0x552594=_0x552594||0xcc;return function(_0x2cc681){if(_0x2cc681){return _0x4fb356[_0x8f82('0x2b')](_0x552594);}return _0x4fb356[_0x8f82('0x2c')](_0x552594)['end']();};}function respondWithResult(_0x499692,_0x366284){_0x366284=_0x366284||0xc8;return function(_0x313381){if(_0x313381){return _0x499692[_0x8f82('0x2c')](_0x366284)[_0x8f82('0x2d')](_0x313381);}};}function respondWithFilteredResult(_0x472b48,_0xc56478){return function(_0x279b6c){if(_0x279b6c){var _0x4acf1f=typeof _0xc56478[_0x8f82('0x2e')]===_0x8f82('0x2f')&&typeof _0xc56478[_0x8f82('0x30')]===_0x8f82('0x2f');var _0x422b9b=_0x279b6c[_0x8f82('0x31')];var _0x8ae4ec=_0x4acf1f?0x0:_0xc56478['offset'];var _0x45dca4=_0x4acf1f?_0x279b6c[_0x8f82('0x31')]:_0xc56478[_0x8f82('0x2e')]+_0xc56478[_0x8f82('0x30')];var _0x437bfc;if(_0x45dca4>=_0x422b9b){_0x45dca4=_0x422b9b;_0x437bfc=0xc8;}else{_0x437bfc=0xce;}_0x472b48['status'](_0x437bfc);return _0x472b48[_0x8f82('0x32')]('Content-Range',_0x8ae4ec+'-'+_0x45dca4+'/'+_0x422b9b)[_0x8f82('0x2d')](_0x279b6c);}return null;};}function patchUpdates(_0x389e97){return function(_0x4cd971){try{jsonpatch[_0x8f82('0x33')](_0x4cd971,_0x389e97,!![]);}catch(_0x2d5e7d){return BPromise['reject'](_0x2d5e7d);}return _0x4cd971['save']();};}function saveUpdates(_0x4591bc,_0x42e6f4){return function(_0x365701){if(_0x365701){return _0x365701['update'](_0x4591bc)[_0x8f82('0x22')](function(_0x1088fb){return _0x1088fb;});}return null;};}function removeEntity(_0x27fbfd,_0x233717){return function(_0xbddd7c){if(_0xbddd7c){return _0xbddd7c[_0x8f82('0x34')]()[_0x8f82('0x22')](function(){var _0x5afc69=_0xbddd7c[_0x8f82('0x35')]({'plain':!![]});var _0x49960f=_0x8f82('0x36');return db['UserProfileResource'][_0x8f82('0x34')]({'where':{'type':_0x49960f,'resourceId':_0x5afc69['id']}})[_0x8f82('0x22')](function(){return _0xbddd7c;});})[_0x8f82('0x22')](function(){_0x27fbfd[_0x8f82('0x2c')](0xcc)[_0x8f82('0x37')]();});}};}function handleEntityNotFound(_0x58ca90,_0x20da3f){return function(_0x12949a){if(!_0x12949a){_0x58ca90[_0x8f82('0x2b')](0x194);}return _0x12949a;};}function handleError(_0x73afaf,_0x3dded8){_0x3dded8=_0x3dded8||0x1f4;return function(_0x2fb4b2){logger[_0x8f82('0x27')](_0x2fb4b2[_0x8f82('0x38')]);if(_0x2fb4b2[_0x8f82('0x39')]){delete _0x2fb4b2['name'];}_0x73afaf[_0x8f82('0x2c')](_0x3dded8)[_0x8f82('0x3a')](_0x2fb4b2);};}exports[_0x8f82('0x3b')]=function(_0x2b5f52,_0x3d5a02){var _0x2dcc92={'include':[{'model':db[_0x8f82('0x3c')],'as':_0x8f82('0x3d')}]},_0x4574fb={},_0x2ebf42={'count':0x0,'rows':[]};var _0x37af4a=_[_0x8f82('0x3e')](db['ChatWebsite'][_0x8f82('0x3f')],function(_0x173111){return{'name':_0x173111[_0x8f82('0x40')],'type':_0x173111[_0x8f82('0x41')]['key']};});_0x4574fb[_0x8f82('0x42')]=_[_0x8f82('0x3e')](_0x37af4a,'name');_0x4574fb[_0x8f82('0x43')]=_[_0x8f82('0x44')](_0x2b5f52[_0x8f82('0x43')]);_0x4574fb['filters']=_[_0x8f82('0x45')](_0x4574fb[_0x8f82('0x42')],_0x4574fb['query']);_0x2dcc92['attributes']=_['intersection'](_0x4574fb[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x2b5f52['query'][_0x8f82('0x46')]));_0x2dcc92[_0x8f82('0x47')]=_0x2dcc92[_0x8f82('0x47')][_0x8f82('0x48')]?_0x2dcc92[_0x8f82('0x47')]:_0x4574fb[_0x8f82('0x42')];if(!_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x2dcc92[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x30')]);_0x2dcc92['offset']=qs[_0x8f82('0x2e')](_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x2dcc92['order']=qs[_0x8f82('0x4b')](_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x2dcc92['where']=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x2b5f52['query'],_0x4574fb[_0x8f82('0x4c')]),_0x37af4a);if(_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x2dcc92['where']=_[_0x8f82('0x4f')](_0x2dcc92['where'],{'$or':_[_0x8f82('0x3e')](_0x37af4a,function(_0x1fad7e){if(_0x1fad7e[_0x8f82('0x41')]!==_0x8f82('0x50')){var _0x5e7f70={};_0x5e7f70[_0x1fad7e[_0x8f82('0x39')]]={'$like':'%'+_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x5e7f70;}})});}_0x2dcc92=_['merge']({},_0x2dcc92,_0x2b5f52[_0x8f82('0x51')]);var _0x2e28f7={'where':_0x2dcc92[_0x8f82('0x52')]};return db['ChatWebsite'][_0x8f82('0x31')](_0x2e28f7)[_0x8f82('0x22')](function(_0x14c37f){_0x2ebf42[_0x8f82('0x31')]=_0x14c37f;if(_0x2b5f52[_0x8f82('0x43')][_0x8f82('0x53')]){_0x2dcc92['include']=[{'all':!![]}];}return db[_0x8f82('0x54')][_0x8f82('0x55')](_0x2dcc92);})['then'](function(_0x3892ba){_0x2ebf42[_0x8f82('0x56')]=_0x3892ba;return _0x2ebf42;})[_0x8f82('0x22')](respondWithFilteredResult(_0x3d5a02,_0x2dcc92))['catch'](handleError(_0x3d5a02,null));};exports[_0x8f82('0x57')]=function(_0x44f982,_0x43bf1d){var _0x5775e1={'raw':![],'where':{'id':_0x44f982['params']['id']},'include':[{'model':db[_0x8f82('0x3c')],'as':'mandatoryDispositionPause'}]},_0x54bd2e={};_0x54bd2e[_0x8f82('0x42')]=_['keys'](db[_0x8f82('0x54')][_0x8f82('0x3f')]);_0x54bd2e[_0x8f82('0x43')]=_['keys'](_0x44f982[_0x8f82('0x43')]);_0x54bd2e[_0x8f82('0x4c')]=_['intersection'](_0x54bd2e[_0x8f82('0x42')],_0x54bd2e[_0x8f82('0x43')]);_0x5775e1['attributes']=_['intersection'](_0x54bd2e[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x44f982[_0x8f82('0x43')][_0x8f82('0x46')]));_0x5775e1[_0x8f82('0x47')]=_0x5775e1[_0x8f82('0x47')][_0x8f82('0x48')]?_0x5775e1[_0x8f82('0x47')]:_0x54bd2e[_0x8f82('0x42')];if(_0x44f982['query'][_0x8f82('0x53')]){_0x5775e1[_0x8f82('0x58')]=[{'all':!![]}];}_0x5775e1=_[_0x8f82('0x4f')]({},_0x5775e1,_0x44f982[_0x8f82('0x51')]);return db['ChatWebsite'][_0x8f82('0x59')](_0x5775e1)[_0x8f82('0x22')](handleEntityNotFound(_0x43bf1d,null))[_0x8f82('0x22')](respondWithResult(_0x43bf1d,null))['catch'](handleError(_0x43bf1d,null));};exports['create']=function(_0x32c5c3,_0x4fa3c6){return db[_0x8f82('0x54')][_0x8f82('0x5a')](_0x32c5c3['body'],{})['then'](function(_0x168bdf){var _0x50adbd=_0x32c5c3[_0x8f82('0x5b')][_0x8f82('0x35')]({'plain':!![]});if(!_0x50adbd)throw new Error(_0x8f82('0x5c'));if(_0x50adbd['role']===_0x8f82('0x5b')){var _0x2eb489=_0x168bdf['get']({'plain':!![]});var _0x48e1ce=_0x8f82('0x36');return db[_0x8f82('0x5d')][_0x8f82('0x59')]({'where':{'name':_0x48e1ce,'userProfileId':_0x50adbd[_0x8f82('0x5e')]},'raw':!![]})['then'](function(_0x375d25){if(_0x375d25&&_0x375d25[_0x8f82('0x5f')]===0x0){return db[_0x8f82('0x60')][_0x8f82('0x5a')]({'name':_0x2eb489[_0x8f82('0x39')],'resourceId':_0x2eb489['id'],'type':_0x375d25[_0x8f82('0x39')],'sectionId':_0x375d25['id']},{})[_0x8f82('0x22')](function(){return _0x168bdf;});}else{return _0x168bdf;}})['catch'](function(_0x5c26ae){logger[_0x8f82('0x27')](_0x8f82('0x61'),_0x5c26ae);throw _0x5c26ae;});}return _0x168bdf;})[_0x8f82('0x22')](respondWithResult(_0x4fa3c6,0xc9))[_0x8f82('0x2a')](handleError(_0x4fa3c6,null));};exports['update']=function(_0x97748a,_0x12c2e8){if(_0x97748a[_0x8f82('0x62')]['id']){delete _0x97748a[_0x8f82('0x62')]['id'];}return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x97748a[_0x8f82('0x63')]['id']},'include':[{'model':db[_0x8f82('0x3c')],'as':_0x8f82('0x3d')}]})['then'](handleEntityNotFound(_0x12c2e8,null))[_0x8f82('0x22')](saveUpdates(_0x97748a[_0x8f82('0x62')],null))['then'](respondWithResult(_0x12c2e8,null))[_0x8f82('0x2a')](handleError(_0x12c2e8,null));};exports['destroy']=function(_0x3ca4f0,_0x115816){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x3ca4f0[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x115816,null))[_0x8f82('0x22')](removeEntity(_0x115816,null))[_0x8f82('0x2a')](handleError(_0x115816,null));};exports[_0x8f82('0x64')]=function(_0x15b48d,_0x50f23a){return db['ChatWebsite'][_0x8f82('0x64')]()[_0x8f82('0x22')](respondWithResult(_0x50f23a,null))['catch'](handleError(_0x50f23a,null));};exports[_0x8f82('0x65')]=function(_0x492eb8,_0x5094d6,_0x5c1f21){if(_0x492eb8[_0x8f82('0x62')]['id']){delete _0x492eb8[_0x8f82('0x62')]['id'];}return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x492eb8[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x5094d6,null))[_0x8f82('0x22')](function(_0x556e4e){if(_0x556e4e){_0x492eb8[_0x8f82('0x62')]['ChatWebsiteId']=_0x556e4e['id'];return db[_0x8f82('0x66')][_0x8f82('0x5a')](_0x492eb8['body']);}})[_0x8f82('0x22')](respondWithResult(_0x5094d6,null))[_0x8f82('0x2a')](handleError(_0x5094d6,null));};exports[_0x8f82('0x67')]=function(_0x3b8273,_0x75c391,_0x459956){var _0x59d042={'raw':![],'where':{}};var _0x4a4c00={};var _0x2ff805={'count':0x0,'rows':[]};return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x3b8273[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x75c391,null))[_0x8f82('0x22')](function(_0x40b17d){if(_0x40b17d){_0x4a4c00[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0x66')][_0x8f82('0x3f')]);_0x4a4c00[_0x8f82('0x43')]=_['keys'](_0x3b8273[_0x8f82('0x43')]);_0x4a4c00[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x4a4c00[_0x8f82('0x42')],_0x4a4c00[_0x8f82('0x43')]);_0x59d042[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x4a4c00['model'],qs[_0x8f82('0x46')](_0x3b8273[_0x8f82('0x43')]['fields']));_0x59d042[_0x8f82('0x47')]=_0x59d042[_0x8f82('0x47')]['length']?_0x59d042[_0x8f82('0x47')]:_0x4a4c00[_0x8f82('0x42')];if(!_0x3b8273[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x59d042[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x3b8273[_0x8f82('0x43')][_0x8f82('0x30')]);_0x59d042[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x3b8273[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x59d042[_0x8f82('0x69')]=qs['sort'](_0x3b8273['query'][_0x8f82('0x4b')]);_0x59d042['where']=qs[_0x8f82('0x4c')](_['pick'](_0x3b8273['query'],_0x4a4c00['filters']));_0x59d042[_0x8f82('0x52')][_0x8f82('0x6a')]=_0x40b17d['id'];if(_0x3b8273[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x59d042[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x59d042[_0x8f82('0x52')],{'$or':_['map'](_0x59d042['attributes'],function(_0x258b96){var _0x24b305={};_0x24b305[_0x258b96]={'$like':'%'+_0x3b8273[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x24b305;})});}_0x59d042=_[_0x8f82('0x4f')]({},_0x59d042,_0x3b8273['options']);return db[_0x8f82('0x66')][_0x8f82('0x31')]({'where':_0x59d042[_0x8f82('0x52')]})[_0x8f82('0x22')](function(_0x425ce6){_0x2ff805[_0x8f82('0x31')]=_0x425ce6;if(_0x3b8273[_0x8f82('0x43')][_0x8f82('0x53')]){_0x59d042[_0x8f82('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x8f82('0x55')](_0x59d042);})['then'](function(_0x4f4923){_0x2ff805[_0x8f82('0x56')]=_0x4f4923;return _0x2ff805;});}})['then'](respondWithFilteredResult(_0x75c391,_0x59d042))[_0x8f82('0x2a')](handleError(_0x75c391,null));};exports[_0x8f82('0x6b')]=function(_0xc50288,_0x5bdb99,_0x4b2ff8){return db[_0x8f82('0x54')]['find']({'where':{'id':_0xc50288['params']['id']}})['then'](handleEntityNotFound(_0x5bdb99,null))[_0x8f82('0x22')](function(_0x39e244){if(_0x39e244){return _0x39e244[_0x8f82('0x6b')](_0xc50288[_0x8f82('0x43')][_0x8f82('0x6c')]);}})[_0x8f82('0x22')](respondWithStatusCode(_0x5bdb99,null))['catch'](handleError(_0x5bdb99,null));};exports[_0x8f82('0x6d')]=function(_0x554761,_0x144ca5,_0x2bcc89){if(_0x554761[_0x8f82('0x62')]['id']){delete _0x554761[_0x8f82('0x62')]['id'];}return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x554761['params']['id']}})['then'](handleEntityNotFound(_0x144ca5,null))[_0x8f82('0x22')](function(_0x46e302){if(_0x46e302){_0x554761[_0x8f82('0x62')][_0x8f82('0x6a')]=_0x46e302['id'];return db[_0x8f82('0x6e')][_0x8f82('0x5a')](_0x554761[_0x8f82('0x62')]);}})['then'](respondWithResult(_0x144ca5,null))[_0x8f82('0x2a')](handleError(_0x144ca5,null));};exports[_0x8f82('0x6f')]=function(_0x24f967,_0x5148a7,_0x4c96ad){var _0x8951da={'raw':![],'where':{}};var _0x2444d6={};var _0x1623c1={'count':0x0,'rows':[]};return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x24f967['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x5148a7,null))[_0x8f82('0x22')](function(_0x178b37){if(_0x178b37){_0x2444d6[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0x6e')]['rawAttributes']);_0x2444d6['query']=_['keys'](_0x24f967[_0x8f82('0x43')]);_0x2444d6['filters']=_[_0x8f82('0x45')](_0x2444d6[_0x8f82('0x42')],_0x2444d6[_0x8f82('0x43')]);_0x8951da[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x2444d6[_0x8f82('0x42')],qs['fields'](_0x24f967[_0x8f82('0x43')]['fields']));_0x8951da[_0x8f82('0x47')]=_0x8951da[_0x8f82('0x47')][_0x8f82('0x48')]?_0x8951da[_0x8f82('0x47')]:_0x2444d6['model'];if(!_0x24f967[_0x8f82('0x43')]['hasOwnProperty']('nolimit')){_0x8951da[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x24f967[_0x8f82('0x43')]['limit']);_0x8951da[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x24f967[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x8951da[_0x8f82('0x69')]=qs['sort'](_0x24f967[_0x8f82('0x43')]['sort']);_0x8951da[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x24f967[_0x8f82('0x43')],_0x2444d6[_0x8f82('0x4c')]));_0x8951da[_0x8f82('0x52')][_0x8f82('0x6a')]=_0x178b37['id'];if(_0x24f967[_0x8f82('0x43')]['filter']){_0x8951da[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x8951da[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x8951da['attributes'],function(_0x549d0f){var _0x42dcf1={};_0x42dcf1[_0x549d0f]={'$like':'%'+_0x24f967['query']['filter']+'%'};return _0x42dcf1;})});}_0x8951da=_[_0x8f82('0x4f')]({},_0x8951da,_0x24f967['options']);return db['CannedAnswer'][_0x8f82('0x31')]({'where':_0x8951da[_0x8f82('0x52')]})[_0x8f82('0x22')](function(_0x4faa5a){_0x1623c1[_0x8f82('0x31')]=_0x4faa5a;if(_0x24f967[_0x8f82('0x43')]['includeAll']){_0x8951da[_0x8f82('0x58')]=[{'all':!![]}];}return db[_0x8f82('0x6e')]['findAll'](_0x8951da);})[_0x8f82('0x22')](function(_0x4d38f){_0x1623c1['rows']=_0x4d38f;return _0x1623c1;});}})['then'](respondWithFilteredResult(_0x5148a7,_0x8951da))['catch'](handleError(_0x5148a7,null));};exports[_0x8f82('0x70')]=function(_0x502733,_0x4e8006,_0x27c74f){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x502733['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x4e8006,null))[_0x8f82('0x22')](function(_0x4ba1e1){if(_0x4ba1e1){return _0x4ba1e1['removeAnswers'](_0x502733[_0x8f82('0x43')][_0x8f82('0x6c')]);}})[_0x8f82('0x22')](respondWithStatusCode(_0x4e8006,null))[_0x8f82('0x2a')](handleError(_0x4e8006,null));};exports[_0x8f82('0x71')]=function(_0x2a4413,_0x178a53,_0xa03d87){_0x2a4413[_0x8f82('0x62')][_0x8f82('0x72')]=_0x2a4413[_0x8f82('0x73')][_0x8f82('0x74')];return db[_0x8f82('0x54')]['find']({'where':{'id':_0x2a4413[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x178a53,null))['then'](saveUpdates(_0x2a4413['body'],null))[_0x8f82('0x22')](respondWithResult(_0x178a53,null))[_0x8f82('0x2a')](handleError(_0x178a53,null));};exports['addAvatar']=function(_0x396480,_0x5cd890,_0x2a7d03){_0x396480[_0x8f82('0x62')][_0x8f82('0x75')]=_0x396480['file'][_0x8f82('0x74')];return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x396480[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x5cd890,null))[_0x8f82('0x22')](saveUpdates(_0x396480[_0x8f82('0x62')],null))['then'](respondWithResult(_0x5cd890,null))[_0x8f82('0x2a')](handleError(_0x5cd890,null));};exports[_0x8f82('0x76')]=function(_0x374a85,_0x285c0a,_0x31c669){_0x374a85[_0x8f82('0x62')]['customerAvatar']=_0x374a85['file'][_0x8f82('0x74')];return db['ChatWebsite'][_0x8f82('0x59')]({'where':{'id':_0x374a85[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x285c0a,null))[_0x8f82('0x22')](saveUpdates(_0x374a85[_0x8f82('0x62')],null))[_0x8f82('0x22')](respondWithResult(_0x285c0a,null))[_0x8f82('0x2a')](handleError(_0x285c0a,null));};exports[_0x8f82('0x77')]=function(_0x65826a,_0x4628d9,_0x12a79e){_0x65826a['body'][_0x8f82('0x78')]=_0x65826a[_0x8f82('0x73')][_0x8f82('0x74')];return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x65826a[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x4628d9,null))[_0x8f82('0x22')](saveUpdates(_0x65826a['body'],null))['then'](respondWithResult(_0x4628d9,null))[_0x8f82('0x2a')](handleError(_0x4628d9,null));};exports[_0x8f82('0x79')]=function(_0x24b96c,_0x22442a,_0x2c5d8b){var _0x10ee4d=path['join'](config[_0x8f82('0x7a')],'server/files/images/logos/default_logo.svg');var _0x3dd226={'where':{'id':_0x24b96c[_0x8f82('0x63')]['id']},'attributes':['id',_0x8f82('0x72')],'raw':!![]};var _0x171ab7=![];return require(_0x8f82('0x16'))[_0x8f82('0x7b')]()[_0x8f82('0x22')](function(_0x325b24){if(_0x325b24){_0x171ab7=_0x325b24[_0x8f82('0x7c')];}})[_0x8f82('0x22')](function(){return db[_0x8f82('0x54')][_0x8f82('0x59')](_0x3dd226);})[_0x8f82('0x22')](handleEntityNotFound(_0x22442a,null))[_0x8f82('0x22')](function(_0x28c564){if(_0x28c564){if(!_[_0x8f82('0x7d')](_0x28c564[_0x8f82('0x72')])){if(fs[_0x8f82('0x7e')](path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/logos/',_0x28c564['sitepic']))&&_0x171ab7){_0x10ee4d=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x80'),_0x28c564['sitepic']);}}return _0x22442a[_0x8f82('0x81')](_0x10ee4d);}})['catch'](handleError(_0x22442a,null));};exports[_0x8f82('0x82')]=function(_0x4c1442,_0x197b90,_0x5c8a00){var _0x3a1ee3=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x83'));var _0x4d8527={'where':{'id':_0x4c1442[_0x8f82('0x63')]['id']},'attributes':['id',_0x8f82('0x75')],'raw':!![]};return db[_0x8f82('0x54')][_0x8f82('0x59')](_0x4d8527)[_0x8f82('0x22')](handleEntityNotFound(_0x197b90,null))[_0x8f82('0x22')](function(_0xcdc50f){if(_0xcdc50f){if(!_[_0x8f82('0x7d')](_0xcdc50f['agentAvatar'])){if(fs[_0x8f82('0x7e')](path[_0x8f82('0x7f')](config['root'],_0x8f82('0x84'),_0xcdc50f[_0x8f82('0x75')]))){_0x3a1ee3=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x84'),_0xcdc50f['agentAvatar']);}}return _0x197b90['download'](_0x3a1ee3);}})[_0x8f82('0x2a')](handleError(_0x197b90,null));};exports[_0x8f82('0x85')]=function(_0xfee807,_0x95435d,_0xd14559){var _0xccad6c=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/avatars/customer_avatar.png');var _0x1d01e8={'where':{'id':_0xfee807[_0x8f82('0x63')]['id']},'attributes':['id',_0x8f82('0x86'),_0x8f82('0x87')],'raw':!![]};return db[_0x8f82('0x54')]['find'](_0x1d01e8)[_0x8f82('0x22')](handleEntityNotFound(_0x95435d,null))['then'](function(_0x264bf5){if(_0x264bf5){if(!_[_0x8f82('0x7d')](_0x264bf5[_0x8f82('0x86')])){if(fs[_0x8f82('0x7e')](path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/avatars/',_0x264bf5[_0x8f82('0x86')]))&&_0x264bf5['showCustomerAvatar']){_0xccad6c=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/images/avatars/',_0x264bf5[_0x8f82('0x86')]);}}return _0x95435d['download'](_0xccad6c);}})['catch'](handleError(_0x95435d,null));};exports['getSystemAvatar']=function(_0x249f44,_0x44b8f7,_0x2cdaa7){var _0x3d4516=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x88'));var _0x3911f4={'where':{'id':_0x249f44[_0x8f82('0x63')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8f82('0x54')][_0x8f82('0x59')](_0x3911f4)['then'](handleEntityNotFound(_0x44b8f7,null))['then'](function(_0x270a01){if(_0x270a01){if(!_[_0x8f82('0x7d')](_0x270a01[_0x8f82('0x78')])){if(fs[_0x8f82('0x7e')](path['join'](config[_0x8f82('0x7a')],'server/files/images/avatars/',_0x270a01[_0x8f82('0x78')]))){_0x3d4516=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0x84'),_0x270a01['systemAvatar']);}}return _0x44b8f7[_0x8f82('0x81')](_0x3d4516);}})[_0x8f82('0x2a')](handleError(_0x44b8f7,null));};exports[_0x8f82('0x89')]=function(_0x5a3214,_0x59219f,_0x133f43){var _0x4e7c30=require(_0x8f82('0x8a'));var _0x157113=new _0x4e7c30();var _0x2e76cf=_0x157113[_0x8f82('0x8b')](_0x5a3214[_0x8f82('0x8c')][_0x8f82('0x8d')])[_0x8f82('0x8e')]();var _0x151d9c={'body':_0x5a3214[_0x8f82('0x62')],'channel':'chat'};var _0x52e38b=[];var _0x40df5d=[];var _0x340f99={};var _0x40730a=![];return db[_0x8f82('0x8f')][_0x8f82('0x64')]()[_0x8f82('0x22')](function(_0x3e775d){if(!_0x3e775d){throw new db['Sequelize'][(_0x8f82('0x90'))]('no\x20available\x20attributes');}_0x52e38b=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x3e775d),['createdAt',_0x8f82('0x92')]);_0x40df5d=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x3e775d),['createdAt','updatedAt',_0x8f82('0x93'),_0x8f82('0x94')]);if(_0x5a3214[_0x8f82('0x62')]['id']){delete _0x5a3214['body']['id'];}if(_[_0x8f82('0x7d')](_0x5a3214[_0x8f82('0x62')][_0x8f82('0x95')])){throw new db['Sequelize'][(_0x8f82('0x90'))](_0x8f82('0x96'));}if(_[_0x8f82('0x7d')](_0x5a3214[_0x8f82('0x62')]['body'])||_0x5a3214[_0x8f82('0x62')]['body']===''){throw new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))](_0x8f82('0x98'));}if(_[_0x8f82('0x7d')](_0x5a3214['body'][_0x8f82('0x99')])){throw new db[(_0x8f82('0x97'))]['ValidationError'](_0x8f82('0x9a')+_0x40df5d);}if(!_[_0x8f82('0x9b')](_0x40df5d,_0x5a3214[_0x8f82('0x62')][_0x8f82('0x99')])){throw new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))](_0x8f82('0x9c')+_0x40df5d);}_0x340f99[_0x5a3214['body'][_0x8f82('0x99')]]=_0x5a3214['body'][_0x8f82('0x95')];})[_0x8f82('0x22')](function(){return db[_0x8f82('0x54')]['find']({'where':{'id':_0x5a3214[_0x8f82('0x63')]['id']},'include':[{'model':db[_0x8f82('0x9d')],'as':_0x8f82('0x9e'),'include':[{'model':db[_0x8f82('0x8f')],'as':_0x8f82('0x9f'),'where':_0x340f99,'limit':0x1,'order':[[_0x8f82('0x92'),_0x8f82('0xa0')]]}]},{'model':db[_0x8f82('0xa1')],'as':_0x8f82('0xa2')}]});})['then'](handleEntityNotFound(_0x59219f,null))[_0x8f82('0x22')](function(_0x403d60){if(_0x403d60&&_0x403d60[_0x8f82('0x9e')]){_0x151d9c[_0x8f82('0xa3')]=_0x403d60;_0x151d9c[_0x8f82('0xa4')]=_0x403d60[_0x8f82('0xa2')];_0x151d9c[_0x8f82('0xa5')]=_0x403d60[_0x8f82('0x9e')];_0x151d9c[_0x8f82('0xa4')]=_[_0x8f82('0xa6')](_0x151d9c[_0x8f82('0xa4')],[_0x8f82('0xa7')],[_0x8f82('0xa8')]);if(_0x151d9c[_0x8f82('0xa3')][_0x8f82('0xa2')]){delete _0x151d9c[_0x8f82('0xa3')][_0x8f82('0xa2')];}if(_0x151d9c['account'][_0x8f82('0x9e')]&&_0x151d9c[_0x8f82('0xa3')][_0x8f82('0x9e')][_0x8f82('0x9f')]['length']){return _0x151d9c[_0x8f82('0xa3')][_0x8f82('0x9e')][_0x8f82('0x9f')][0x0];}var _0x53158c=_[_0x8f82('0x19')](_0x5a3214[_0x8f82('0x62')],{'firstName':_0x5a3214[_0x8f82('0x62')][_0x8f82('0x95')],'ListId':_0x403d60[_0x8f82('0x94')]});_0x53158c[_0x5a3214[_0x8f82('0x62')][_0x8f82('0x99')]]=_0x5a3214[_0x8f82('0x62')][_0x8f82('0x95')];return db[_0x8f82('0x8f')][_0x8f82('0x5a')](_0x53158c,{'fields':_0x52e38b,'raw':!![]});}})[_0x8f82('0x22')](handleEntityNotFound(_0x59219f,null))[_0x8f82('0x22')](function(_0x1fddb9){_0x151d9c[_0x8f82('0xa9')]=_0x1fddb9;var _0xa3133=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xaa')];if(_0x5a3214[_0x8f82('0x8c')][_0x8f82('0xab')]){_0xa3133=_0x5a3214[_0x8f82('0x8c')]['cf-connecting-ip'];}else if(_0x5a3214[_0x8f82('0x8c')]['x-forwarded-for']){_0xa3133=_[_0x8f82('0xac')](_0x5a3214[_0x8f82('0x8c')][_0x8f82('0xad')]['split'](','));}if(_0x1fddb9){var _0x5741d9={'ContactId':_0x1fddb9['id'],'ChatWebsiteId':_0x5a3214[_0x8f82('0x63')]['id'],'from':(_0x1fddb9['firstName']||'')+'\x20'+(_0x1fddb9['lastName']||''),'customerIp':_0xa3133,'customerPort':_0x5a3214[_0x8f82('0x8c')][_0x8f82('0xae')]?_0x5a3214[_0x8f82('0x8c')]['x-real-port']:null,'referer':_0x5a3214['body'][_0x8f82('0xaf')],'browserName':_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0x39')]&&_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0xb1')]?util[_0x8f82('0xb2')](_0x8f82('0xb3'),_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0x39')],_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0xb1')]):_0x8f82('0xb4'),'browserVersion':_0x2e76cf[_0x8f82('0xb0')][_0x8f82('0xb1')]||_0x8f82('0xb4'),'osName':util[_0x8f82('0xb2')](_0x8f82('0xb3'),_0x2e76cf['os']['name'],_0x2e76cf['os'][_0x8f82('0xb1')]),'osVersion':_0x2e76cf['os'][_0x8f82('0xb1')],'deviceModel':_0x2e76cf['device']['model']&&_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0xb6')]?util['format'](_0x8f82('0xb7'),_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0x42')],_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0xb6')],_0x2e76cf[_0x8f82('0xb5')]['type']):null,'deviceVendor':_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0xb6')],'deviceType':_0x2e76cf[_0x8f82('0xb5')][_0x8f82('0x41')],'formData':JSON[_0x8f82('0x26')](_0x5a3214[_0x8f82('0x62')])};var _0x11d39e={'ChatWebsiteId':_0x5a3214[_0x8f82('0x63')]['id'],'closed':![]};if(_0x5a3214[_0x8f82('0x62')]['threadId']){_0x11d39e[_0x8f82('0xb8')]=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xb8')];return db[_0x8f82('0xb9')][_0x8f82('0x59')]({'where':_0x11d39e})['then'](function(_0x256b6d){if(_0x256b6d){return[_0x256b6d,![]];}_0x5741d9['threadId']=_0x5a3214[_0x8f82('0x62')]['threadId'];_0x5741d9[_0x8f82('0xba')]=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xba')];return db[_0x8f82('0xb9')][_0x8f82('0x5a')](_0x5741d9)['then'](function(_0x321b94){return[_0x321b94,!![]];});});}_0x11d39e['ContactId']=_0x1fddb9['id'];if(_0x5a3214[_0x8f82('0x62')]['interaction']&&_0x5a3214['body']['interaction']['id']){_0x11d39e['id']=_0x5a3214[_0x8f82('0x62')][_0x8f82('0xbb')]['id'];return db['ChatInteraction'][_0x8f82('0x59')]({'where':_0x11d39e})['then'](function(_0x8ea81d){if(_0x8ea81d){return[_0x8ea81d,![]];}return db[_0x8f82('0xb9')][_0x8f82('0x5a')](_0x5741d9)[_0x8f82('0x22')](function(_0x15699c){return[_0x15699c,!![]];});});}return db[_0x8f82('0xb9')][_0x8f82('0x5a')](_0x5741d9)[_0x8f82('0x22')](function(_0x32b1da){return[_0x32b1da,!![]];});}})[_0x8f82('0xbc')](function(_0x631156,_0x31ee5d){if(_0x631156){_0x40730a=_0x31ee5d;if(!_0x31ee5d){var _0x13239b={'from':(_0x151d9c['contact'][_0x8f82('0xbd')]||'')+'\x20'+(_0x151d9c[_0x8f82('0xa9')]['lastName']||'')};if(_0x5a3214[_0x8f82('0x62')][_0x8f82('0xb8')]&&_0x5a3214[_0x8f82('0x62')]['messageId']&&_0x5a3214[_0x8f82('0x62')][_0x8f82('0xb8')]!=_0x5a3214['body'][_0x8f82('0xbe')]){_0x13239b['threadId']=_0x5a3214['body'][_0x8f82('0xbe')];}return _0x631156[_0x8f82('0xbf')](_0x13239b);}else{return _0x631156;}}})[_0x8f82('0x22')](function(_0x2dc057){_0x151d9c[_0x8f82('0xbb')]=_0x2dc057['get']({'plain':!![]});_0x151d9c[_0x8f82('0xbb')][_0x8f82('0xc0')]=_0x40730a;if(_0x151d9c[_0x8f82('0xbb')][_0x8f82('0xc0')]){if(_0x151d9c[_0x8f82('0xa3')]['autoclose']){_0x151d9c[_0x8f82('0xa4')][_0x8f82('0xc1')]({'id':0x0,'priority':_0x151d9c[_0x8f82('0xa4')][_0x8f82('0x48')]+0x1,'app':'close','appdata':_0x8f82('0xc2'),'interval':_0x8f82('0xc3')});}}return db[_0x8f82('0xc4')][_0x8f82('0x5a')]({'body':_0x5a3214[_0x8f82('0x62')][_0x8f82('0x62')],'ChatWebsiteId':_0x5a3214[_0x8f82('0x63')]['id'],'ChatInteractionId':_0x2dc057['id'],'direction':'in','ContactId':_0x151d9c[_0x8f82('0xa9')]['id'],'AttachmentId':_0x5a3214['body'][_0x8f82('0xc5')]});})[_0x8f82('0x22')](function(_0x564279){_0x151d9c[_0x8f82('0x28')]=_0x564279;if(_0x151d9c[_0x8f82('0xbb')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x151d9c[_0x8f82('0xbb')][_0x8f82('0xc6')]}})[_0x8f82('0x22')](function(_0x4dec57){if(_0x4dec57){_0x151d9c[_0x8f82('0xa4')][_0x8f82('0xc7')]({'id':0x0,'priority':0x0,'app':_0x8f82('0xc8'),'appdata':_0x4dec57[_0x8f82('0x39')]+','+(_0x151d9c[_0x8f82('0xa3')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x151d9c[_0x8f82('0xc9')]=!![];}return respondWithRpcPromise(_0x8f82('0xca'),_0x8f82('0xcb'),_0x151d9c);});}return respondWithRpcPromise(_0x8f82('0xca'),_0x8f82('0xcb'),_0x151d9c);})[_0x8f82('0x22')](function(_0x1bd456){respondWithRpcPromise(_0x8f82('0xcc'),_0x8f82('0xcc'),{'event':_0x8f82('0x89'),'message':_0x1bd456},client9002);return _0x1bd456;})['then'](respondWithResult(_0x59219f,null))[_0x8f82('0x2a')](handleError(_0x59219f,null));};exports[_0x8f82('0xcd')]=function(_0x5294a2,_0x4f1d38,_0x524ed){var _0x4d7d00,_0x110590,_0x271863;var _0x369fb6=[];var _0x18a80c=[];var _0x1b9c37={};var _0x52099a=_0x5294a2[_0x8f82('0xce')]||[];var _0x12cb5a=[];var _0x22c0ea;return db[_0x8f82('0x8f')][_0x8f82('0x64')]()[_0x8f82('0x22')](function(_0x44f9bb){if(!_0x44f9bb){throw new db['Sequelize'][(_0x8f82('0x90'))](_0x8f82('0xcf'));}_0x18a80c=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x44f9bb),[_0x8f82('0xd0'),_0x8f82('0x92')]);_0x369fb6=_[_0x8f82('0x91')](_[_0x8f82('0x44')](_0x44f9bb),[_0x8f82('0xd0'),'updatedAt',_0x8f82('0x93'),_0x8f82('0x94')]);if(_0x5294a2[_0x8f82('0x62')]['id']){delete _0x5294a2[_0x8f82('0x62')]['id'];}if(_['isNil'](_0x5294a2[_0x8f82('0x62')]['from'])){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)[_0x8f82('0x3a')](new db['Sequelize'][(_0x8f82('0x90'))]('from\x20is\x20mandatory'));}if(_[_0x8f82('0x7d')](_0x5294a2[_0x8f82('0x62')][_0x8f82('0x62')])||_0x5294a2[_0x8f82('0x62')][_0x8f82('0x62')]===''){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)['send'](new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8f82('0x7d')](_0x5294a2['body'][_0x8f82('0xd1')])){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)[_0x8f82('0x3a')](new db[(_0x8f82('0x97'))][(_0x8f82('0x90'))](_0x8f82('0xd2')+_0x369fb6));}if(!_['includes'](_0x369fb6,_0x5294a2[_0x8f82('0x62')][_0x8f82('0xd1')])){throw _0x4f1d38[_0x8f82('0x2c')](0x1f4)['send'](new db['Sequelize'][(_0x8f82('0x90'))](_0x8f82('0xd3')+_0x369fb6));}_0x1b9c37[_0x5294a2[_0x8f82('0x62')][_0x8f82('0xd1')]]=_0x5294a2['body'][_0x8f82('0x95')];})[_0x8f82('0x22')](function(){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x5294a2[_0x8f82('0x63')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0x8f82('0xd4')}]});})[_0x8f82('0x22')](handleEntityNotFound(_0x4f1d38,null))['then'](function(_0x1274c6){if(_0x1274c6&&_0x1274c6[_0x8f82('0x9e')]){_0x110590=_0x1274c6;var _0x5a5c86=_[_0x8f82('0x19')](_0x5294a2[_0x8f82('0x62')],{'firstName':_0x5294a2[_0x8f82('0x62')]['from'],'phone':_0x5294a2['body']['from'],'ListId':_0x1274c6[_0x8f82('0x94')]});_0x5a5c86[_0x5294a2[_0x8f82('0x62')][_0x8f82('0xd1')]]=_0x5294a2[_0x8f82('0x62')][_0x8f82('0x95')];return db['CmContact'][_0x8f82('0xd5')]({'where':_0x1b9c37,'defaults':_0x5a5c86});}})[_0x8f82('0xbc')](function(_0x4bfe69){if(_0x4bfe69){_0x271863=_0x4bfe69;var _0x35365c=fs[_0x8f82('0xd6')](path['join'](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x8f82('0xd7'));var _0x5a6d37=ejs[_0x8f82('0xd8')](_0x35365c,{'body':_['toPairs'](_0x5294a2[_0x8f82('0x62')]['body']),'bodyTitle':_0x110590[_0x8f82('0xd9')]});return db['ChatOfflineMessage'][_0x8f82('0x5a')]({'body':_0x5a6d37,'ContactId':_0x4bfe69['id'],'ChatWebsiteId':_0x110590['id']});}})['then'](function(_0x406849){_0x22c0ea=_0x406849;if(_0x52099a[_0x8f82('0x48')]){var _0xcfbb85=_0x52099a['map'](function(_0x2991cd){return{'name':_0x2991cd[_0x8f82('0xda')],'basename':_0x2991cd[_0x8f82('0x74')],'type':_0x2991cd[_0x8f82('0xdb')],'ChatOfflineMessageId':_0x406849['id']};});_0x12cb5a=_0xcfbb85[_0x8f82('0x3e')](_0x3bfb22=>{var _0x37e167={'filename':_0x3bfb22['name'],'path':path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server','files',_0x8f82('0xdc'),'offline-chat',_0x3bfb22[_0x8f82('0xdd')])};return _0x37e167;});if(!_0x110590[_0x8f82('0xde')]){return db[_0x8f82('0xdf')]['transaction'](function(_0xef7eaf){return db[_0x8f82('0xe0')][_0x8f82('0xe1')](_0xcfbb85,{'transaction':_0xef7eaf});});}}})[_0x8f82('0x22')](function(){if(_0x22c0ea){_0x4d7d00=_0x22c0ea;return db[_0x8f82('0xd4')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0x8f82('0xe2')],'as':'Smtp','raw':!![]}]});}})[_0x8f82('0x22')](function(_0x14cb06){if(_0x14cb06&&_0x14cb06[_0x8f82('0xe3')]&&_0x110590[_0x8f82('0xe4')]&&_0x110590['forwardOfflineAddress']){var _0x38fb76={'tls':{'rejectUnauthorized':![]}};if(_0x14cb06[_0x8f82('0xe3')]['service']){_0x38fb76['service']=_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe5')];}else{_0x38fb76[_0x8f82('0xe6')]=_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe6')];_0x38fb76[_0x8f82('0xe7')]=_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe7')];_0x38fb76[_0x8f82('0xe8')]=_0x14cb06[_0x8f82('0xe3')]['secure'];}if(_0x14cb06[_0x8f82('0xe3')][_0x8f82('0xe9')]){_0x38fb76[_0x8f82('0xea')]={'user':_0x14cb06[_0x8f82('0xe3')][_0x8f82('0x5b')],'pass':_0x14cb06[_0x8f82('0xe3')]['pass']};}return respondWithRpcPromise(_0x8f82('0xeb'),_0x8f82('0xec'),{'account':_0x38fb76,'message':{'from':util['format'](_0x8f82('0xed'),_0x14cb06[_0x8f82('0x39')],_0x14cb06[_0x8f82('0xee')]||_0x14cb06[_0x8f82('0xe3')][_0x8f82('0x5b')]),'to':_0x110590[_0x8f82('0xef')],'subject':_0x110590[_0x8f82('0xf0')],'html':_0x4d7d00[_0x8f82('0x62')],'attachments':_0x12cb5a}},client9003)[_0x8f82('0x22')](function(){return _0x4d7d00;})[_0x8f82('0x2a')](function(_0x5a22fc){console[_0x8f82('0x27')](_0x5a22fc);});}})[_0x8f82('0x22')](function(){if(_0x110590&&_0x110590[_0x8f82('0xde')]&&_0x110590['MailAccountId']){var _0x5d9b57=[];if(_0x52099a[_0x8f82('0x48')]){_0x5d9b57=_0x52099a['map'](function(_0x10bf68){return{'name':_0x10bf68[_0x8f82('0xda')],'basename':_0x10bf68[_0x8f82('0x74')],'type':_0x10bf68['mimetype'],'ChatOfflineMessageId':_0x22c0ea['id']};});}var _0x3cdf00;if(!_['isNil'](_0x110590[_0x8f82('0xf1')])){var _0x1cdda8=_[_0x8f82('0x3e')](_0x5294a2['body'],function(_0x4033dc){return _0x4033dc;});var _0x4eb4f3=_[_0x8f82('0xf2')](_0x1cdda8)[0x0];var _0x4cf072=_[_0x8f82('0xf3')](_0x4eb4f3,function(_0x5dde13){return _0x5dde13;});_0x3cdf00=_0x4cf072[0x1][_0x110590[_0x8f82('0xf1')]];}var _0x1db679={'from':_0x271863[_0x8f82('0xee')],'firstName':_0x271863[_0x8f82('0xbd')],'lastName':_0x271863[_0x8f82('0xf4')],'mapKey':_0x8f82('0xee'),'message':{'from':_0x271863[_0x8f82('0xee')],'to':_0x110590[_0x8f82('0xd4')][_0x8f82('0xee')],'cc':'','subject':_[_0x8f82('0x7d')](_0x3cdf00)?_0x110590[_0x8f82('0xf0')]:_0x3cdf00,'messageId':'','sentAt':new Date(),'attach':_0x5d9b57['length'],'attachments':_0x5d9b57,'originChannel':_0x8f82('0xf5'),'ChatWebsiteId':_0x110590['id'],'ChatOfflineMessageId':_0x4d7d00['id'],'originTo':_0x110590[_0x8f82('0xd4')][_0x8f82('0xee')]},'body':_0x4d7d00[_0x8f82('0x62')]};var _0x456f1a={'account':{'id':_0x110590[_0x8f82('0xf6')]},'body':_0x1db679,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x8f82('0xf7'),_0x8f82('0xf8'),_0x456f1a,client9001)[_0x8f82('0x22')](function(){return _0x4d7d00;})[_0x8f82('0x2a')](function(_0x4894ea){console[_0x8f82('0x27')](_0x4894ea);});}return;})[_0x8f82('0x22')](function(){if(_0x4d7d00){return _0x4d7d00;}})[_0x8f82('0x22')](respondWithResult(_0x4f1d38,null))[_0x8f82('0x2a')](function(_0x40bcbd){console[_0x8f82('0x27')](_0x8f82('0x2a'),_0x40bcbd);for(var _0x3f5c12 of _0x52099a){var _0x20ea8b=path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],_0x8f82('0xf9'),_0x8f82('0xce'),'attachments','offline-chat',_0x3f5c12[_0x8f82('0x74')]);fs_extra['remove'](_0x20ea8b)[_0x8f82('0x2a')](function(_0x2b6ee0){console[_0x8f82('0x27')]('Could\x20not\x20remove\x20attachment\x20file',_0x20ea8b,_0x2b6ee0);});}});};exports[_0x8f82('0xfa')]=function(_0x1ae86f,_0x461732,_0x20903f){return db[_0x8f82('0xb9')][_0x8f82('0x59')]({'where':{'id':_0x1ae86f['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x461732,null))[_0x8f82('0x22')](function(_0x1927e3){if(_0x1927e3){return _0x1927e3[_0x8f82('0xfa')](_0x1ae86f[_0x8f82('0x62')]['ids'],_['omit'](_0x1ae86f[_0x8f82('0x62')],['ids','id'])||{});}})['then'](respondWithResult(_0x461732,null))[_0x8f82('0x2a')](handleError(_0x461732,null));};exports['getInteractions']=function(_0x2abe0d,_0x27ea38,_0xc66e0e){var _0x423a8d={'raw':![],'where':{}};var _0x3bdb34={};var _0x46472e={'count':0x0,'rows':[]};return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x2abe0d['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x27ea38,null))[_0x8f82('0x22')](function(_0x2b79b6){if(_0x2b79b6){_0x3bdb34[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0xb9')]['rawAttributes']);_0x3bdb34[_0x8f82('0x43')]=_[_0x8f82('0x44')](_0x2abe0d[_0x8f82('0x43')]);_0x3bdb34[_0x8f82('0x4c')]=_['intersection'](_0x3bdb34[_0x8f82('0x42')],_0x3bdb34['query']);_0x423a8d[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x3bdb34[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x46')]));_0x423a8d[_0x8f82('0x47')]=_0x423a8d[_0x8f82('0x47')][_0x8f82('0x48')]?_0x423a8d[_0x8f82('0x47')]:_0x3bdb34[_0x8f82('0x42')];if(!_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x423a8d[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x30')]);_0x423a8d[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x2e')]);}_0x423a8d[_0x8f82('0x69')]=qs[_0x8f82('0x4b')](_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x423a8d[_0x8f82('0x52')]=qs['filters'](_['pick'](_0x2abe0d[_0x8f82('0x43')],_0x3bdb34['filters']));_0x423a8d['where'][_0x8f82('0x6a')]=_0x2b79b6['id'];if(_0x2abe0d['query'][_0x8f82('0x4e')]){_0x423a8d[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x423a8d[_0x8f82('0x52')],{'$or':_['map'](_0x423a8d[_0x8f82('0x47')],function(_0x42d158){var _0x2a7c35={};_0x2a7c35[_0x42d158]={'$like':'%'+_0x2abe0d[_0x8f82('0x43')]['filter']+'%'};return _0x2a7c35;})});}_0x423a8d=_[_0x8f82('0x4f')]({},_0x423a8d,_0x2abe0d[_0x8f82('0x51')]);return db[_0x8f82('0xb9')][_0x8f82('0x31')]({'where':_0x423a8d[_0x8f82('0x52')]})[_0x8f82('0x22')](function(_0x20ab0f){_0x46472e[_0x8f82('0x31')]=_0x20ab0f;if(_0x2abe0d[_0x8f82('0x43')]['includeAll']){_0x423a8d[_0x8f82('0x58')]=[{'model':db['CmContact'],'as':_0x8f82('0xfb'),'required':![]},{'model':db[_0x8f82('0xfc')],'as':'Owner','attributes':['name',_0x8f82('0xfd'),_0x8f82('0xfe')],'required':![]},{'model':db[_0x8f82('0xff')],'as':'Tags','attributes':['id',_0x8f82('0x39'),_0x8f82('0x100')],'where':_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x101')]?{'id':_0x2abe0d[_0x8f82('0x43')][_0x8f82('0x101')]}:undefined,'required':_0x2abe0d[_0x8f82('0x43')]['tag']?!![]:![]}];}return db[_0x8f82('0xb9')]['findAll'](_0x423a8d);})[_0x8f82('0x22')](function(_0x4fedad){_0x46472e[_0x8f82('0x56')]=_0x4fedad;return _0x46472e;});}})['then'](respondWithFilteredResult(_0x27ea38,_0x423a8d))['catch'](handleError(_0x27ea38,null));};function iftimePromise(_0x2d5df6,_0x3b208a){return respondWithRpcPromise('Command',_0x8f82('0x102'),{'command':_0x3b208a[_0x8f82('0x103')]?util[_0x8f82('0xb2')](_0x8f82('0x104'),_0x2d5df6['interval'],_0x3b208a['timezone']):util['format'](_0x8f82('0x105'),_0x2d5df6[_0x8f82('0x106')])},client9002)[_0x8f82('0x22')](function(_0x4c475c){var _0x273090=_0x4c475c&&_0x4c475c[_0x8f82('0x107')](_0x8f82('0x108'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x3b208a['id'],_0x2d5df6['id'],_0x2d5df6[_0x8f82('0x106')],_0x273090?_0x8f82('0x109'):_0x8f82('0x10a'),_0x3b208a[_0x8f82('0x103')]?_0x3b208a['timezone']:_0x8f82('0x10b'));return _0x273090;})['catch'](function(_0x3e1b2d){logger[_0x8f82('0x27')](_0x8f82('0x10c'),_0x3b208a['id'],_0x2d5df6['id'],_0x2d5df6[_0x8f82('0x106')],util['inspect'](_0x3e1b2d,{'showHidden':![],'depth':null}),_0x3b208a[_0x8f82('0x103')]?_0x3b208a['timezone']:_0x8f82('0x10b'));return![];});}exports[_0x8f82('0x102')]=function(_0x3fb2ce,_0x528a54,_0x46ef71){var _0x4bf9f7=0x0;var _0x4685cd=0x0;var _0x314f8a=![];var _0x354627;var _0x3e4f73;return db['ChatWebsite'][_0x8f82('0x59')]({'where':{'id':_0x3fb2ce[_0x8f82('0x63')]['id']},'include':[{'model':db[_0x8f82('0x10d')],'as':_0x8f82('0x10d'),'include':[{'model':db[_0x8f82('0x10d')],'as':_0x8f82('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x528a54,null))[_0x8f82('0x22')](function(_0x4cdfd6){if(_0x4cdfd6){_0x354627=_0x4cdfd6;return _0x4cdfd6[_0x8f82('0x10f')]({'raw':!![]});}})['then'](function(_0xae1457){if(_0x354627){if(_0xae1457){_0x3e4f73=_0xae1457;}}return require(_0x8f82('0x16'))['getLicense']();})[_0x8f82('0x22')](function(_0x5376e0){if(_0x5376e0){_0x4685cd=_0x5376e0[_0x8f82('0x110')];_0x314f8a=_0x5376e0['custom'];}})[_0x8f82('0x22')](function(){return db[_0x8f82('0xb9')][_0x8f82('0x31')]({'where':{'closed':![]}});})[_0x8f82('0x22')](function(_0x3e4ae2){_0x4bf9f7=_0x3e4ae2;if(_0x4685cd&&_0x3e4ae2>_0x4685cd){return db[_0x8f82('0x111')][_0x8f82('0x68')]({'where':{'id':0x1}})[_0x8f82('0x22')](function(_0x4cec86){if(_0x4cec86){_0x4cec86['increment'](_0x8f82('0x112'));}});}})['then'](function(){if(_0x354627[_0x8f82('0x10d')]&&_0x354627[_0x8f82('0x10d')][_0x8f82('0x10e')]){var _0x11017f=[];for(var _0x486b39=0x0;_0x486b39<_0x354627[_0x8f82('0x10d')][_0x8f82('0x10e')][_0x8f82('0x48')];_0x486b39++){var _0x3f1135=_0x354627[_0x8f82('0x10d')]['Intervals'][_0x486b39]['get']({'plain':!![]});_0x11017f['push'](iftimePromise(_0x3f1135,_0x354627));}return BPromise[_0x8f82('0x113')](_0x11017f)[_0x8f82('0x22')](function(_0x3170fd){return _['some'](_0x3170fd);});}else{return!![];}})[_0x8f82('0x22')](function(_0x3a42cc){var _0x5cee34=fs['readFileSync'](path[_0x8f82('0x7f')](config[_0x8f82('0x7a')],'server/files/chat/iframe.ejs'),'utf8');var _0x3c7c23={'remote':_0x354627['remote'],'query':querystring[_0x8f82('0x26')](_[_0x8f82('0x4f')](_0x354627[_0x8f82('0x35')]({'plain':!![]}),{'customerIp':_0x3fb2ce['headers'][_0x8f82('0xad')]||_0x3fb2ce[_0x8f82('0x8c')][_0x8f82('0x114')]||_0x3fb2ce[_0x8f82('0x115')]['remoteAddress']||_0x3fb2ce['ip'],'referer':_0x3fb2ce['headers'][_0x8f82('0xaf')],'openedInteractions':_0x4bf9f7,'maxInteractions':_0x4685cd,'virtual':_0x314f8a[_0x8f82('0x110')],'online':_0x3a42cc,'custom':_0x314f8a}))['replace'](/'/g,'\x5c\x27')};_0x528a54[_0x8f82('0x3a')](ejs[_0x8f82('0xd8')](Mustache[_0x8f82('0xd8')](_0x5cee34,_0x3c7c23),{'proactiveActions':_0x3e4f73,'alignment':_0x354627[_0x8f82('0x116')],'verticalAlignment':_0x354627[_0x8f82('0x117')],'div_color':_0x354627[_0x8f82('0x100')],'text_color':_0x354627[_0x8f82('0x118')],'button_color':_0x354627[_0x8f82('0x119')],'background_color':_0x354627[_0x8f82('0x11a')]}));})['catch'](handleError(_0x528a54,null));};exports[_0x8f82('0x11b')]=function(_0x4a6b8b,_0x4bfb88,_0x236584){return db[_0x8f82('0x54')]['findOne']({'where':{'id':_0x4a6b8b[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x4bfb88,null))['then'](function(_0x5af643){if(_0x5af643){return db[_0x8f82('0xdf')][_0x8f82('0x11c')](function(_0xc3cfe4){return db[_0x8f82('0xa1')][_0x8f82('0x34')]({'where':{'ChatWebsiteId':_0x4a6b8b[_0x8f82('0x63')]['id']},'transaction':_0xc3cfe4})[_0x8f82('0x22')](function(_0xa88a9a){var _0xb623a9=_[_0x8f82('0x3e')](_0x4a6b8b['body'],function(_0x2bc73a){_0x2bc73a[_0x8f82('0x6a')]=_0x4a6b8b[_0x8f82('0x63')]['id'];return _0x2bc73a;});return db['ChatApplication'][_0x8f82('0xe1')](_0xb623a9,{'transaction':_0xc3cfe4});});})[_0x8f82('0x22')](function(){return db[_0x8f82('0xa1')][_0x8f82('0x11d')]({'where':{'ChatWebsiteId':_0x4a6b8b['params']['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4bfb88,null))['catch'](handleError(_0x4bfb88,null));};exports[_0x8f82('0x11e')]=function(_0x506db1,_0x498bb3,_0x1cb9a1){var _0x5f05fb={};var _0x5d828f={};var _0x4b0db0;var _0x27e382;return db['ChatWebsite'][_0x8f82('0x68')]({'where':{'id':_0x506db1['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x498bb3,null))[_0x8f82('0x22')](function(_0x253378){if(_0x253378){_0x4b0db0=_0x253378;_0x5d828f['model']=_[_0x8f82('0x44')](db['ChatApplication'][_0x8f82('0x3f')]);_0x5d828f[_0x8f82('0x43')]=_['keys'](_0x506db1[_0x8f82('0x43')]);_0x5d828f[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x5d828f[_0x8f82('0x42')],_0x5d828f['query']);_0x5f05fb[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x5d828f[_0x8f82('0x42')],qs['fields'](_0x506db1[_0x8f82('0x43')]['fields']));_0x5f05fb[_0x8f82('0x47')]=_0x5f05fb[_0x8f82('0x47')][_0x8f82('0x48')]?_0x5f05fb[_0x8f82('0x47')]:_0x5d828f[_0x8f82('0x42')];_0x5f05fb[_0x8f82('0x69')]=qs['sort'](_0x506db1['query'][_0x8f82('0x4b')]);_0x5f05fb[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_['pick'](_0x506db1[_0x8f82('0x43')],_0x5d828f[_0x8f82('0x4c')]));if(_0x506db1[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x5f05fb[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x5f05fb[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x5f05fb[_0x8f82('0x47')],function(_0x4a6fb8){var _0x2c5c2b={};_0x2c5c2b[_0x4a6fb8]={'$like':'%'+_0x506db1[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x2c5c2b;})});}_0x5f05fb=_['merge']({},_0x5f05fb,_0x506db1['options']);return _0x4b0db0[_0x8f82('0x11e')](_0x5f05fb);}})[_0x8f82('0x22')](function(_0xe98781){if(_0xe98781){_0x27e382=_0xe98781[_0x8f82('0x48')];if(!_0x506db1[_0x8f82('0x43')][_0x8f82('0x49')]('nolimit')){_0x5f05fb['limit']=qs[_0x8f82('0x30')](_0x506db1[_0x8f82('0x43')][_0x8f82('0x30')]);_0x5f05fb[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x506db1[_0x8f82('0x43')][_0x8f82('0x2e')]);}return _0x4b0db0[_0x8f82('0x11e')](_0x5f05fb);}})[_0x8f82('0x22')](function(_0x54a586){if(_0x54a586){return _0x54a586?{'count':_0x27e382,'rows':_0x54a586}:null;}})['then'](respondWithResult(_0x498bb3,null))['catch'](handleError(_0x498bb3,null));};exports['addProactiveActions']=function(_0x1aa3d3,_0x2827f0,_0x1b8848){return db['chatProactiveAction']['find']({'where':{'id':_0x1aa3d3['params']['id']}})['then'](handleEntityNotFound(_0x2827f0,null))['then'](function(_0x34544c){if(_0x34544c){return _0x34544c[_0x8f82('0x11f')](_0x1aa3d3[_0x8f82('0x62')][_0x8f82('0x6c')],_[_0x8f82('0x120')](_0x1aa3d3[_0x8f82('0x62')],[_0x8f82('0x6c'),'id'])||{});}})[_0x8f82('0x22')](respondWithResult(_0x2827f0,null))['catch'](handleError(_0x2827f0,null));};exports[_0x8f82('0x10f')]=function(_0x4484e5,_0x278e82,_0x5f1921){var _0x5f3752={};var _0x43316a={};var _0x5aa6d4;var _0x2a6e90;return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x4484e5[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x278e82,null))[_0x8f82('0x22')](function(_0x4771ae){if(_0x4771ae){_0x5aa6d4=_0x4771ae;_0x43316a[_0x8f82('0x42')]=_[_0x8f82('0x44')](db['ChatProactiveAction'][_0x8f82('0x3f')]);_0x43316a[_0x8f82('0x43')]=_['keys'](_0x4484e5['query']);_0x43316a['filters']=_[_0x8f82('0x45')](_0x43316a[_0x8f82('0x42')],_0x43316a[_0x8f82('0x43')]);_0x5f3752[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x43316a[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x4484e5['query'][_0x8f82('0x46')]));_0x5f3752[_0x8f82('0x47')]=_0x5f3752[_0x8f82('0x47')]['length']?_0x5f3752[_0x8f82('0x47')]:_0x43316a['model'];_0x5f3752['order']=qs[_0x8f82('0x4b')](_0x4484e5[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x5f3752[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x4484e5['query'],_0x43316a[_0x8f82('0x4c')]));if(_0x4484e5['query'][_0x8f82('0x4e')]){_0x5f3752[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x5f3752[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x5f3752[_0x8f82('0x47')],function(_0xe12e5e){var _0x592f73={};_0x592f73[_0xe12e5e]={'$like':'%'+_0x4484e5[_0x8f82('0x43')]['filter']+'%'};return _0x592f73;})});}_0x5f3752=_[_0x8f82('0x4f')]({},_0x5f3752,_0x4484e5[_0x8f82('0x51')]);return _0x5aa6d4['getProactiveActions'](_0x5f3752);}})[_0x8f82('0x22')](function(_0x3ceb40){if(_0x3ceb40){_0x2a6e90=_0x3ceb40['length'];if(!_0x4484e5[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x5f3752[_0x8f82('0x30')]=qs['limit'](_0x4484e5[_0x8f82('0x43')][_0x8f82('0x30')]);_0x5f3752[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x4484e5[_0x8f82('0x43')][_0x8f82('0x2e')]);}return _0x5aa6d4[_0x8f82('0x10f')](_0x5f3752);}})[_0x8f82('0x22')](function(_0x214927){if(_0x214927){return _0x214927?{'count':_0x2a6e90,'rows':_0x214927}:null;}})[_0x8f82('0x22')](respondWithResult(_0x278e82,null))[_0x8f82('0x2a')](handleError(_0x278e82,null));};exports[_0x8f82('0x121')]=function(_0x133b15,_0x61e314,_0x19c420){var _0x10b222=_0x133b15[_0x8f82('0x43')]['online']==='false'?'offlineForm':_0x8f82('0x122');return db['ChatWebsite'][_0x8f82('0x59')]({'attributes':['id',_0x10b222],'where':{'id':_0x133b15['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x61e314,null))[_0x8f82('0x22')](function(_0x416cf8){if(_0x416cf8){var _0x1209cc=_0x416cf8[_0x10b222];var _0x57781e=_0x1209cc&&_0x1209cc[_0x8f82('0x123')]?_0x1209cc[_0x8f82('0x123')]:[];_0x61e314['send']({'fromKey':_[_0x8f82('0x7d')](_0x1209cc[_0x8f82('0x124')])?undefined:_0x1209cc[_0x8f82('0x124')],'count':_0x57781e[_0x8f82('0x48')],'rows':_0x57781e});}})['catch'](handleError(_0x61e314,null));};exports[_0x8f82('0x125')]=function(_0x5a4a01,_0x289e52,_0x390e69){var _0x510796={'raw':![],'where':{}};var _0x5744cd={};var _0xb69389={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8f82('0x68')]({'where':{'id':_0x5a4a01[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x289e52,null))['then'](function(_0x494fc2){if(_0x494fc2){_0x5744cd[_0x8f82('0x42')]=_[_0x8f82('0x44')](db['ChatOfflineMessage'][_0x8f82('0x3f')]);_0x5744cd[_0x8f82('0x43')]=_['keys'](_0x5a4a01[_0x8f82('0x43')]);_0x5744cd[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x5744cd[_0x8f82('0x42')],_0x5744cd['query']);_0x510796[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x5744cd[_0x8f82('0x42')],qs['fields'](_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x46')]));_0x510796[_0x8f82('0x47')]=_0x510796[_0x8f82('0x47')][_0x8f82('0x48')]?_0x510796[_0x8f82('0x47')]:_0x5744cd['model'];if(!_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x49')](_0x8f82('0x4a'))){_0x510796[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x5a4a01['query'][_0x8f82('0x30')]);_0x510796[_0x8f82('0x2e')]=qs[_0x8f82('0x2e')](_0x5a4a01[_0x8f82('0x43')]['offset']);}_0x510796[_0x8f82('0x69')]=qs[_0x8f82('0x4b')](_0x5a4a01['query'][_0x8f82('0x4b')]);_0x510796['where']=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x5a4a01[_0x8f82('0x43')],_0x5744cd[_0x8f82('0x4c')]));_0x510796[_0x8f82('0x52')][_0x8f82('0x6a')]=_0x494fc2['id'];if(_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x4e')]){_0x510796[_0x8f82('0x52')]=_[_0x8f82('0x4f')](_0x510796[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x510796['attributes'],function(_0x341525){var _0x3b8321={};_0x3b8321[_0x341525]={'$like':'%'+_0x5a4a01[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x3b8321;})});}_0x510796=_['merge']({},_0x510796,_0x5a4a01[_0x8f82('0x51')]);return db[_0x8f82('0x126')][_0x8f82('0x31')]({'where':_0x510796['where']})['then'](function(_0x1cc9a1){_0xb69389[_0x8f82('0x31')]=_0x1cc9a1;if(_0x5a4a01['query'][_0x8f82('0x53')]){_0x510796['include']=[{'all':!![]}];}else{_0x510796['include']=[{'model':db[_0x8f82('0x8f')],'as':_0x8f82('0xfb'),'required':![]},{'model':db[_0x8f82('0xe0')],'as':'Attachments','required':![]}];}return db[_0x8f82('0x126')]['findAll'](_0x510796);})[_0x8f82('0x22')](function(_0x5b1010){_0xb69389[_0x8f82('0x56')]=_0x5b1010;return _0xb69389;});}})[_0x8f82('0x22')](respondWithFilteredResult(_0x289e52,_0x510796))[_0x8f82('0x2a')](handleError(_0x289e52,null));};exports[_0x8f82('0x127')]=function(_0x55175b,_0x3c6f35,_0x1c19af){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x55175b[_0x8f82('0x63')]['id']}})['then'](handleEntityNotFound(_0x3c6f35,null))[_0x8f82('0x22')](function(_0x1c5f03){if(_0x1c5f03){return _0x1c5f03[_0x8f82('0x127')](_0x55175b[_0x8f82('0x62')][_0x8f82('0x6c')],_[_0x8f82('0x120')](_0x55175b[_0x8f82('0x62')],[_0x8f82('0x6c'),'id'])||{})['spread'](function(_0x1d905b){for(var _0x2e210a=0x0;_0x2e210a<_0x55175b['body'][_0x8f82('0x6c')][_0x8f82('0x48')];_0x2e210a+=0x1){socket[_0x8f82('0x128')]('userChatWebsite:save',{'UserId':Number(_0x55175b[_0x8f82('0x62')]['ids'][_0x2e210a]),'ChatWebsiteId':Number(_0x55175b['params']['id'])});}return _0x1d905b;});}})['then'](respondWithResult(_0x3c6f35,null))[_0x8f82('0x2a')](handleError(_0x3c6f35,null));};exports[_0x8f82('0x129')]=function(_0x59b424,_0x9025c,_0x4ff242){return db[_0x8f82('0x54')][_0x8f82('0x59')]({'where':{'id':_0x59b424['params']['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0x9025c,null))[_0x8f82('0x22')](function(_0xba3494){if(_0xba3494){return _0xba3494[_0x8f82('0x129')](_0x59b424[_0x8f82('0x43')][_0x8f82('0x6c')])[_0x8f82('0x22')](function(){if(_[_0x8f82('0x12a')](_0x59b424['query'][_0x8f82('0x6c')])){for(var _0x487afe=0x0;_0x487afe<_0x59b424[_0x8f82('0x43')]['ids'][_0x8f82('0x48')];_0x487afe+=0x1){socket[_0x8f82('0x128')](_0x8f82('0x12b'),{'UserId':Number(_0x59b424['query'][_0x8f82('0x6c')][_0x487afe]),'ChatWebsiteId':Number(_0x59b424[_0x8f82('0x63')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x59b424[_0x8f82('0x43')][_0x8f82('0x6c')]),'ChatWebsiteId':Number(_0x59b424['params']['id'])});}});}})[_0x8f82('0x22')](respondWithStatusCode(_0x9025c,null))[_0x8f82('0x2a')](handleError(_0x9025c,null));};exports[_0x8f82('0x12c')]=function(_0x34137c,_0xaf8e88,_0xfb63c8){var _0x2f068f={};var _0x15f9fd={};var _0x31a6b5;var _0x3ef9e9;return db[_0x8f82('0x54')][_0x8f82('0x68')]({'where':{'id':_0x34137c[_0x8f82('0x63')]['id']}})[_0x8f82('0x22')](handleEntityNotFound(_0xaf8e88,null))['then'](function(_0x3719fd){if(_0x3719fd){_0x31a6b5=_0x3719fd;_0x15f9fd[_0x8f82('0x42')]=_[_0x8f82('0x44')](db[_0x8f82('0xfc')][_0x8f82('0x3f')]);_0x15f9fd['query']=_[_0x8f82('0x44')](_0x34137c[_0x8f82('0x43')]);_0x15f9fd[_0x8f82('0x4c')]=_[_0x8f82('0x45')](_0x15f9fd[_0x8f82('0x42')],_0x15f9fd[_0x8f82('0x43')]);_0x2f068f[_0x8f82('0x47')]=_[_0x8f82('0x45')](_0x15f9fd[_0x8f82('0x42')],qs[_0x8f82('0x46')](_0x34137c[_0x8f82('0x43')]['fields']));_0x2f068f['attributes']=_0x2f068f[_0x8f82('0x47')][_0x8f82('0x48')]?_0x2f068f[_0x8f82('0x47')]:_0x15f9fd[_0x8f82('0x42')];_0x2f068f[_0x8f82('0x69')]=qs[_0x8f82('0x4b')](_0x34137c[_0x8f82('0x43')][_0x8f82('0x4b')]);_0x2f068f[_0x8f82('0x52')]=qs[_0x8f82('0x4c')](_[_0x8f82('0x4d')](_0x34137c[_0x8f82('0x43')],_0x15f9fd[_0x8f82('0x4c')]));if(_0x34137c['query'][_0x8f82('0x4e')]){_0x2f068f[_0x8f82('0x52')]=_['merge'](_0x2f068f[_0x8f82('0x52')],{'$or':_[_0x8f82('0x3e')](_0x2f068f[_0x8f82('0x47')],function(_0x449fb3){var _0x226a2a={};_0x226a2a[_0x449fb3]={'$like':'%'+_0x34137c[_0x8f82('0x43')][_0x8f82('0x4e')]+'%'};return _0x226a2a;})});}_0x2f068f=_[_0x8f82('0x4f')]({},_0x2f068f,_0x34137c[_0x8f82('0x51')]);return _0x31a6b5['getAgents'](_0x2f068f);}})[_0x8f82('0x22')](function(_0x5cf2c){if(_0x5cf2c){_0x3ef9e9=_0x5cf2c['length'];if(!_0x34137c[_0x8f82('0x43')]['hasOwnProperty'](_0x8f82('0x4a'))){_0x2f068f[_0x8f82('0x30')]=qs[_0x8f82('0x30')](_0x34137c[_0x8f82('0x43')][_0x8f82('0x30')]);_0x2f068f['offset']=qs['offset'](_0x34137c[_0x8f82('0x43')]['offset']);}return _0x31a6b5[_0x8f82('0x12c')](_0x2f068f);}})['then'](function(_0x367035){if(_0x367035){return _0x367035?{'count':_0x3ef9e9,'rows':_0x367035}:null;}})['then'](respondWithResult(_0xaf8e88,null))[_0x8f82('0x2a')](handleError(_0xaf8e88,null));}; \ No newline at end of file +var _0xcbcd=['addAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','file','join','root','getLicense','custom','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','agentAvatar','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','chat','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','applications','orderBy','asc','defaults','CmContact','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','firstName','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','Tag','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','chatLicenseExceeded','push','x-real-ip','connection','remoteAddress','alignment','verticalAlignment','color','textColor','color_button','addApplications','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','userChatWebsite:save','removeAgents','emit','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','ChatWebsite','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','ChatWebsiteId','Disposition','getDispositions','findOne','include','removeDispositions','ids','getAnswers','CannedAnswer','order','removeAnswers','addLogo','sitepic'];(function(_0x257794,_0x38561d){var _0x2d3c13=function(_0x535307){while(--_0x535307){_0x257794['push'](_0x257794['shift']());}};_0x2d3c13(++_0x38561d);}(_0xcbcd,0x1f2));var _0xdcbc=function(_0x149ca0,_0x2ac7f5){_0x149ca0=_0x149ca0-0x0;var _0x56b6b9=_0xcbcd[_0x149ca0];return _0x56b6b9;};'use strict';var emlformat=require(_0xdcbc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcbc('0x1'));var jsonpatch=require(_0xdcbc('0x2'));var rp=require(_0xdcbc('0x3'));var moment=require(_0xdcbc('0x4'));var BPromise=require(_0xdcbc('0x5'));var Mustache=require(_0xdcbc('0x6'));var util=require(_0xdcbc('0x7'));var path=require(_0xdcbc('0x8'));var sox=require(_0xdcbc('0x9'));var csv=require(_0xdcbc('0xa'));var ejs=require(_0xdcbc('0xb'));var fs=require('fs');var fs_extra=require(_0xdcbc('0xc'));var _=require('lodash');var squel=require(_0xdcbc('0xd'));var crypto=require(_0xdcbc('0xe'));var jsforce=require(_0xdcbc('0xf'));var deskjs=require(_0xdcbc('0x10'));var toCsv=require(_0xdcbc('0xa'));var querystring=require(_0xdcbc('0x11'));var Papa=require(_0xdcbc('0x12'));var Redis=require(_0xdcbc('0x13'));var authService=require(_0xdcbc('0x14'));var qs=require(_0xdcbc('0x15'));var as=require(_0xdcbc('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdcbc('0x17'))('api');var utils=require(_0xdcbc('0x18'));var config=require(_0xdcbc('0x19'));var licenseUtil=require(_0xdcbc('0x1a'));var db=require('../../mysqldb')['db'];config[_0xdcbc('0x1b')]=_['defaults'](config[_0xdcbc('0x1b')],{'host':_0xdcbc('0x1c'),'port':0x18eb});var socket=require(_0xdcbc('0x1d'))(new Redis(config['redis']));require(_0xdcbc('0x1e'))[_0xdcbc('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232c});var client9002=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232a});var client9003=jayson[_0xdcbc('0x20')][_0xdcbc('0x21')]({'port':0x232b});var client9001=jayson[_0xdcbc('0x20')]['http']({'port':0x2329});function respondWithRpcPromise(_0xbdb1d7,_0x3aa1eb,_0x14169b,_0x3f760d){return new BPromise(function(_0x9b79e9,_0x2e355a){var _0x1a8dd6=_0x3f760d||client;return _0x1a8dd6[_0xdcbc('0x22')](_0xbdb1d7,_0x14169b)[_0xdcbc('0x23')](function(_0x141816){logger['info'](_0xdcbc('0x24'),_0x3aa1eb,_0xdcbc('0x25'));logger[_0xdcbc('0x26')](_0xdcbc('0x27'),_0x3aa1eb,_0xdcbc('0x25'),JSON[_0xdcbc('0x28')](_0x141816));if(_0x141816['error']){if(_0x141816['error'][_0xdcbc('0x29')]===0x1f4){logger[_0xdcbc('0x2a')](_0xdcbc('0x24'),_0x3aa1eb,_0x141816[_0xdcbc('0x2a')][_0xdcbc('0x2b')]);return _0x2e355a(_0x141816['error']['message']);}logger['error'](_0xdcbc('0x24'),_0x3aa1eb,_0x141816[_0xdcbc('0x2a')]['message']);return _0x9b79e9(_0x141816['error'][_0xdcbc('0x2b')]);}else{logger[_0xdcbc('0x2c')](_0xdcbc('0x24'),_0x3aa1eb,_0xdcbc('0x25'));_0x9b79e9(_0x141816['result'][_0xdcbc('0x2b')]);}})['catch'](function(_0x2275d1){logger[_0xdcbc('0x2a')](_0xdcbc('0x24'),_0x3aa1eb,_0x2275d1);_0x2e355a(_0x2275d1);});});}function respondWithStatusCode(_0x4f5edc,_0x2bda34){_0x2bda34=_0x2bda34||0xcc;return function(_0x21c0e3){if(_0x21c0e3){return _0x4f5edc[_0xdcbc('0x2d')](_0x2bda34);}return _0x4f5edc[_0xdcbc('0x2e')](_0x2bda34)[_0xdcbc('0x2f')]();};}function respondWithResult(_0x31b7bc,_0x3d5e57){_0x3d5e57=_0x3d5e57||0xc8;return function(_0x43c79b){if(_0x43c79b){return _0x31b7bc[_0xdcbc('0x2e')](_0x3d5e57)['json'](_0x43c79b);}};}function respondWithFilteredResult(_0x2ea5ec,_0x5487ab){return function(_0x364796){if(_0x364796){var _0x431e9e=typeof _0x5487ab[_0xdcbc('0x30')]==='undefined'&&typeof _0x5487ab[_0xdcbc('0x31')]===_0xdcbc('0x32');var _0x16230b=_0x364796[_0xdcbc('0x33')];var _0x1893f1=_0x431e9e?0x0:_0x5487ab[_0xdcbc('0x30')];var _0x4c5e76=_0x431e9e?_0x364796['count']:_0x5487ab['offset']+_0x5487ab[_0xdcbc('0x31')];var _0x2f7e9e;if(_0x4c5e76>=_0x16230b){_0x4c5e76=_0x16230b;_0x2f7e9e=0xc8;}else{_0x2f7e9e=0xce;}_0x2ea5ec[_0xdcbc('0x2e')](_0x2f7e9e);return _0x2ea5ec[_0xdcbc('0x34')]('Content-Range',_0x1893f1+'-'+_0x4c5e76+'/'+_0x16230b)[_0xdcbc('0x35')](_0x364796);}return null;};}function patchUpdates(_0x270cb8){return function(_0xe374be){try{jsonpatch[_0xdcbc('0x36')](_0xe374be,_0x270cb8,!![]);}catch(_0x327816){return BPromise['reject'](_0x327816);}return _0xe374be[_0xdcbc('0x37')]();};}function saveUpdates(_0x2a6202,_0x51e6b0){return function(_0x68f2b9){if(_0x68f2b9){return _0x68f2b9[_0xdcbc('0x38')](_0x2a6202)[_0xdcbc('0x23')](function(_0x873ec6){return _0x873ec6;});}return null;};}function removeEntity(_0x8844e4,_0x5ef776){return function(_0x6706b8){if(_0x6706b8){return _0x6706b8[_0xdcbc('0x39')]()[_0xdcbc('0x23')](function(){var _0x4d0faa=_0x6706b8[_0xdcbc('0x3a')]({'plain':!![]});var _0x50bb42=_0xdcbc('0x3b');return db[_0xdcbc('0x3c')][_0xdcbc('0x39')]({'where':{'type':_0x50bb42,'resourceId':_0x4d0faa['id']}})['then'](function(){return _0x6706b8;});})['then'](function(){_0x8844e4[_0xdcbc('0x2e')](0xcc)[_0xdcbc('0x2f')]();});}};}function handleEntityNotFound(_0x35d94e,_0x514731){return function(_0x5bbd5c){if(!_0x5bbd5c){_0x35d94e[_0xdcbc('0x2d')](0x194);}return _0x5bbd5c;};}function handleError(_0x565c04,_0x2bd97c){_0x2bd97c=_0x2bd97c||0x1f4;return function(_0x44cb89){logger[_0xdcbc('0x2a')](_0x44cb89[_0xdcbc('0x3d')]);if(_0x44cb89[_0xdcbc('0x3e')]){delete _0x44cb89[_0xdcbc('0x3e')];}_0x565c04[_0xdcbc('0x2e')](_0x2bd97c)['send'](_0x44cb89);};}exports[_0xdcbc('0x3f')]=function(_0x53dd84,_0x52e4a2){var _0x471a87={'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]},_0x4e75f3={},_0x2df4c8={'count':0x0,'rows':[]};var _0x281a46=_[_0xdcbc('0x42')](db['ChatWebsite']['rawAttributes'],function(_0x3434a3){return{'name':_0x3434a3['fieldName'],'type':_0x3434a3[_0xdcbc('0x43')]['key']};});_0x4e75f3[_0xdcbc('0x44')]=_[_0xdcbc('0x42')](_0x281a46,_0xdcbc('0x3e'));_0x4e75f3[_0xdcbc('0x45')]=_['keys'](_0x53dd84[_0xdcbc('0x45')]);_0x4e75f3[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x4e75f3[_0xdcbc('0x44')],_0x4e75f3[_0xdcbc('0x45')]);_0x471a87[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x4e75f3[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x53dd84[_0xdcbc('0x45')]['fields']));_0x471a87[_0xdcbc('0x48')]=_0x471a87['attributes'][_0xdcbc('0x4a')]?_0x471a87[_0xdcbc('0x48')]:_0x4e75f3[_0xdcbc('0x44')];if(!_0x53dd84['query'][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x471a87[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x53dd84['query'][_0xdcbc('0x31')]);_0x471a87[_0xdcbc('0x30')]=qs['offset'](_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x471a87['order']=qs[_0xdcbc('0x4d')](_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x471a87['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x53dd84['query'],_0x4e75f3[_0xdcbc('0x46')]),_0x281a46);if(_0x53dd84['query'][_0xdcbc('0x4f')]){_0x471a87['where']=_[_0xdcbc('0x50')](_0x471a87[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x281a46,function(_0x5cc56d){if(_0x5cc56d['type']!==_0xdcbc('0x52')){var _0x5176d6={};_0x5176d6[_0x5cc56d['name']]={'$like':'%'+_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x5176d6;}})});}_0x471a87=_[_0xdcbc('0x50')]({},_0x471a87,_0x53dd84[_0xdcbc('0x53')]);var _0xad0781={'where':_0x471a87[_0xdcbc('0x51')]};return db['ChatWebsite'][_0xdcbc('0x33')](_0xad0781)['then'](function(_0x406a73){_0x2df4c8[_0xdcbc('0x33')]=_0x406a73;if(_0x53dd84[_0xdcbc('0x45')][_0xdcbc('0x54')]){_0x471a87['include']=[{'all':!![]}];}return db[_0xdcbc('0x55')][_0xdcbc('0x56')](_0x471a87);})[_0xdcbc('0x23')](function(_0x48a79f){_0x2df4c8[_0xdcbc('0x57')]=_0x48a79f;return _0x2df4c8;})[_0xdcbc('0x23')](respondWithFilteredResult(_0x52e4a2,_0x471a87))[_0xdcbc('0x58')](handleError(_0x52e4a2,null));};exports[_0xdcbc('0x59')]=function(_0x10e22e,_0x4aa135){var _0x2601e8={'raw':![],'where':{'id':_0x10e22e[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]},_0x1581a8={};_0x1581a8[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0x55')][_0xdcbc('0x5c')]);_0x1581a8[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x10e22e[_0xdcbc('0x45')]);_0x1581a8[_0xdcbc('0x46')]=_['intersection'](_0x1581a8[_0xdcbc('0x44')],_0x1581a8['query']);_0x2601e8[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x1581a8['model'],qs[_0xdcbc('0x49')](_0x10e22e[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x2601e8[_0xdcbc('0x48')]=_0x2601e8[_0xdcbc('0x48')]['length']?_0x2601e8[_0xdcbc('0x48')]:_0x1581a8[_0xdcbc('0x44')];if(_0x10e22e[_0xdcbc('0x45')][_0xdcbc('0x54')]){_0x2601e8['include']=[{'all':!![]}];}_0x2601e8=_[_0xdcbc('0x50')]({},_0x2601e8,_0x10e22e[_0xdcbc('0x53')]);return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x2601e8)[_0xdcbc('0x23')](handleEntityNotFound(_0x4aa135,null))[_0xdcbc('0x23')](respondWithResult(_0x4aa135,null))[_0xdcbc('0x58')](handleError(_0x4aa135,null));};exports[_0xdcbc('0x5e')]=function(_0x79dc31,_0x3229a8){return db[_0xdcbc('0x55')][_0xdcbc('0x5e')](_0x79dc31[_0xdcbc('0x5f')],{})['then'](function(_0x28ff89){var _0x3ef259=_0x79dc31[_0xdcbc('0x60')][_0xdcbc('0x3a')]({'plain':!![]});if(!_0x3ef259)throw new Error(_0xdcbc('0x61'));if(_0x3ef259[_0xdcbc('0x62')]===_0xdcbc('0x60')){var _0xbc91b3=_0x28ff89['get']({'plain':!![]});var _0x3451fe=_0xdcbc('0x3b');return db[_0xdcbc('0x63')][_0xdcbc('0x5d')]({'where':{'name':_0x3451fe,'userProfileId':_0x3ef259[_0xdcbc('0x64')]},'raw':!![]})[_0xdcbc('0x23')](function(_0x32a5ed){if(_0x32a5ed&&_0x32a5ed[_0xdcbc('0x65')]===0x0){return db['UserProfileResource']['create']({'name':_0xbc91b3['name'],'resourceId':_0xbc91b3['id'],'type':_0x32a5ed[_0xdcbc('0x3e')],'sectionId':_0x32a5ed['id']},{})[_0xdcbc('0x23')](function(){return _0x28ff89;});}else{return _0x28ff89;}})[_0xdcbc('0x58')](function(_0x426fcc){logger[_0xdcbc('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x426fcc);throw _0x426fcc;});}return _0x28ff89;})[_0xdcbc('0x23')](respondWithResult(_0x3229a8,0xc9))[_0xdcbc('0x58')](handleError(_0x3229a8,null));};exports[_0xdcbc('0x38')]=function(_0xefe450,_0x57f6ac){if(_0xefe450[_0xdcbc('0x5f')]['id']){delete _0xefe450[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0xefe450[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x40')],'as':_0xdcbc('0x41')}]})[_0xdcbc('0x23')](handleEntityNotFound(_0x57f6ac,null))['then'](saveUpdates(_0xefe450['body'],null))[_0xdcbc('0x23')](respondWithResult(_0x57f6ac,null))[_0xdcbc('0x58')](handleError(_0x57f6ac,null));};exports[_0xdcbc('0x39')]=function(_0x3e84ba,_0x1a7b96){return db['ChatWebsite'][_0xdcbc('0x5d')]({'where':{'id':_0x3e84ba[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x1a7b96,null))[_0xdcbc('0x23')](removeEntity(_0x1a7b96,null))[_0xdcbc('0x58')](handleError(_0x1a7b96,null));};exports[_0xdcbc('0x66')]=function(_0x4fcb54,_0x599c42){return db[_0xdcbc('0x55')][_0xdcbc('0x66')]()['then'](respondWithResult(_0x599c42,null))[_0xdcbc('0x58')](handleError(_0x599c42,null));};exports['addDisposition']=function(_0x499b7e,_0x238ebf,_0x395f4e){if(_0x499b7e[_0xdcbc('0x5f')]['id']){delete _0x499b7e[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x499b7e[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x238ebf,null))['then'](function(_0x4ccdef){if(_0x4ccdef){_0x499b7e['body'][_0xdcbc('0x67')]=_0x4ccdef['id'];return db[_0xdcbc('0x68')][_0xdcbc('0x5e')](_0x499b7e[_0xdcbc('0x5f')]);}})[_0xdcbc('0x23')](respondWithResult(_0x238ebf,null))[_0xdcbc('0x58')](handleError(_0x238ebf,null));};exports[_0xdcbc('0x69')]=function(_0x5a7b7a,_0x85bfb6,_0x19d08a){var _0x5ac0c0={'raw':![],'where':{}};var _0xf5af29={};var _0x11348f={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x5a7b7a[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x85bfb6,null))['then'](function(_0x35c493){if(_0x35c493){_0xf5af29[_0xdcbc('0x44')]=_['keys'](db[_0xdcbc('0x68')][_0xdcbc('0x5c')]);_0xf5af29[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x5a7b7a[_0xdcbc('0x45')]);_0xf5af29[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0xf5af29['model'],_0xf5af29[_0xdcbc('0x45')]);_0x5ac0c0[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0xf5af29['model'],qs[_0xdcbc('0x49')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x5ac0c0[_0xdcbc('0x48')]=_0x5ac0c0[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x5ac0c0[_0xdcbc('0x48')]:_0xf5af29[_0xdcbc('0x44')];if(!_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x5ac0c0[_0xdcbc('0x31')]=qs['limit'](_0x5a7b7a[_0xdcbc('0x45')]['limit']);_0x5ac0c0['offset']=qs[_0xdcbc('0x30')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x5ac0c0['order']=qs[_0xdcbc('0x4d')](_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x5ac0c0['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x5a7b7a[_0xdcbc('0x45')],_0xf5af29[_0xdcbc('0x46')]));_0x5ac0c0['where'][_0xdcbc('0x67')]=_0x35c493['id'];if(_0x5a7b7a[_0xdcbc('0x45')]['filter']){_0x5ac0c0[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x5ac0c0[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x5ac0c0[_0xdcbc('0x48')],function(_0x3bb8aa){var _0x152894={};_0x152894[_0x3bb8aa]={'$like':'%'+_0x5a7b7a[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x152894;})});}_0x5ac0c0=_['merge']({},_0x5ac0c0,_0x5a7b7a['options']);return db['Disposition'][_0xdcbc('0x33')]({'where':_0x5ac0c0[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x12378e){_0x11348f[_0xdcbc('0x33')]=_0x12378e;if(_0x5a7b7a['query'][_0xdcbc('0x54')]){_0x5ac0c0[_0xdcbc('0x6b')]=[{'all':!![]}];}return db['Disposition'][_0xdcbc('0x56')](_0x5ac0c0);})[_0xdcbc('0x23')](function(_0x2e4e7e){_0x11348f[_0xdcbc('0x57')]=_0x2e4e7e;return _0x11348f;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x85bfb6,_0x5ac0c0))['catch'](handleError(_0x85bfb6,null));};exports[_0xdcbc('0x6c')]=function(_0x4f9bef,_0x3289bd,_0x5a492a){return db[_0xdcbc('0x55')]['find']({'where':{'id':_0x4f9bef[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3289bd,null))[_0xdcbc('0x23')](function(_0x2f3260){if(_0x2f3260){return _0x2f3260[_0xdcbc('0x6c')](_0x4f9bef[_0xdcbc('0x45')][_0xdcbc('0x6d')]);}})[_0xdcbc('0x23')](respondWithStatusCode(_0x3289bd,null))[_0xdcbc('0x58')](handleError(_0x3289bd,null));};exports['addAnswer']=function(_0x3d548a,_0x54dde5,_0x5a45fa){if(_0x3d548a[_0xdcbc('0x5f')]['id']){delete _0x3d548a[_0xdcbc('0x5f')]['id'];}return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x3d548a[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x54dde5,null))[_0xdcbc('0x23')](function(_0x4aade2){if(_0x4aade2){_0x3d548a[_0xdcbc('0x5f')][_0xdcbc('0x67')]=_0x4aade2['id'];return db['CannedAnswer']['create'](_0x3d548a[_0xdcbc('0x5f')]);}})['then'](respondWithResult(_0x54dde5,null))[_0xdcbc('0x58')](handleError(_0x54dde5,null));};exports[_0xdcbc('0x6e')]=function(_0x115d7f,_0x53f98f,_0x2c8d4c){var _0x48e23f={'raw':![],'where':{}};var _0x3c71d6={};var _0x25102f={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x115d7f[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x53f98f,null))[_0xdcbc('0x23')](function(_0xf3f066){if(_0xf3f066){_0x3c71d6['model']=_[_0xdcbc('0x5b')](db[_0xdcbc('0x6f')][_0xdcbc('0x5c')]);_0x3c71d6[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x115d7f['query']);_0x3c71d6[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x3c71d6[_0xdcbc('0x44')],_0x3c71d6['query']);_0x48e23f[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x3c71d6[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x48e23f[_0xdcbc('0x48')]=_0x48e23f['attributes'][_0xdcbc('0x4a')]?_0x48e23f[_0xdcbc('0x48')]:_0x3c71d6[_0xdcbc('0x44')];if(!_0x115d7f['query'][_0xdcbc('0x4b')]('nolimit')){_0x48e23f['limit']=qs[_0xdcbc('0x31')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x48e23f[_0xdcbc('0x30')]=qs['offset'](_0x115d7f['query'][_0xdcbc('0x30')]);}_0x48e23f[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x48e23f[_0xdcbc('0x51')]=qs['filters'](_[_0xdcbc('0x4e')](_0x115d7f[_0xdcbc('0x45')],_0x3c71d6[_0xdcbc('0x46')]));_0x48e23f[_0xdcbc('0x51')][_0xdcbc('0x67')]=_0xf3f066['id'];if(_0x115d7f[_0xdcbc('0x45')]['filter']){_0x48e23f[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x48e23f[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x48e23f[_0xdcbc('0x48')],function(_0x5509f7){var _0x218227={};_0x218227[_0x5509f7]={'$like':'%'+_0x115d7f[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x218227;})});}_0x48e23f=_[_0xdcbc('0x50')]({},_0x48e23f,_0x115d7f[_0xdcbc('0x53')]);return db[_0xdcbc('0x6f')][_0xdcbc('0x33')]({'where':_0x48e23f['where']})[_0xdcbc('0x23')](function(_0x276464){_0x25102f['count']=_0x276464;if(_0x115d7f['query'][_0xdcbc('0x54')]){_0x48e23f[_0xdcbc('0x6b')]=[{'all':!![]}];}return db[_0xdcbc('0x6f')][_0xdcbc('0x56')](_0x48e23f);})[_0xdcbc('0x23')](function(_0x4828dc){_0x25102f[_0xdcbc('0x57')]=_0x4828dc;return _0x25102f;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x53f98f,_0x48e23f))[_0xdcbc('0x58')](handleError(_0x53f98f,null));};exports[_0xdcbc('0x71')]=function(_0x292478,_0xcc908a,_0xf48165){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x292478[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xcc908a,null))[_0xdcbc('0x23')](function(_0x58c449){if(_0x58c449){return _0x58c449[_0xdcbc('0x71')](_0x292478[_0xdcbc('0x45')][_0xdcbc('0x6d')]);}})[_0xdcbc('0x23')](respondWithStatusCode(_0xcc908a,null))[_0xdcbc('0x58')](handleError(_0xcc908a,null));};exports[_0xdcbc('0x72')]=function(_0x4d27f0,_0x4d1fd7,_0x26cdf5){_0x4d27f0['body'][_0xdcbc('0x73')]=_0x4d27f0['file']['filename'];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x4d27f0[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4d1fd7,null))[_0xdcbc('0x23')](saveUpdates(_0x4d27f0[_0xdcbc('0x5f')],null))[_0xdcbc('0x23')](respondWithResult(_0x4d1fd7,null))[_0xdcbc('0x58')](handleError(_0x4d1fd7,null));};exports[_0xdcbc('0x74')]=function(_0x1cb941,_0x245304,_0x1e362f){_0x1cb941['body']['agentAvatar']=_0x1cb941['file']['filename'];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x1cb941['params']['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x245304,null))[_0xdcbc('0x23')](saveUpdates(_0x1cb941['body'],null))[_0xdcbc('0x23')](respondWithResult(_0x245304,null))[_0xdcbc('0x58')](handleError(_0x245304,null));};exports[_0xdcbc('0x75')]=function(_0x3fd0f5,_0x28c391,_0x2046a2){_0x3fd0f5['body'][_0xdcbc('0x76')]=_0x3fd0f5['file'][_0xdcbc('0x77')];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x3fd0f5[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x28c391,null))['then'](saveUpdates(_0x3fd0f5[_0xdcbc('0x5f')],null))[_0xdcbc('0x23')](respondWithResult(_0x28c391,null))['catch'](handleError(_0x28c391,null));};exports[_0xdcbc('0x78')]=function(_0x4a6b30,_0xa6bfec,_0x3feeaf){_0x4a6b30[_0xdcbc('0x5f')][_0xdcbc('0x79')]=_0x4a6b30[_0xdcbc('0x7a')][_0xdcbc('0x77')];return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x4a6b30[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xa6bfec,null))[_0xdcbc('0x23')](saveUpdates(_0x4a6b30[_0xdcbc('0x5f')],null))['then'](respondWithResult(_0xa6bfec,null))['catch'](handleError(_0xa6bfec,null));};exports['getLogo']=function(_0xea29be,_0x512c7c,_0x18e71a){var _0x558e9f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/images/logos/default_logo.svg');var _0x248353={'where':{'id':_0xea29be[_0xdcbc('0x5a')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x4c7e39=![];return require('../../config/license/util')[_0xdcbc('0x7d')]()[_0xdcbc('0x23')](function(_0x366a4c){if(_0x366a4c){_0x4c7e39=_0x366a4c[_0xdcbc('0x7e')];}})[_0xdcbc('0x23')](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x248353);})[_0xdcbc('0x23')](handleEntityNotFound(_0x512c7c,null))[_0xdcbc('0x23')](function(_0x23ba43){if(_0x23ba43){if(!_['isNil'](_0x23ba43[_0xdcbc('0x73')])){if(fs[_0xdcbc('0x7f')](path['join'](config[_0xdcbc('0x7c')],_0xdcbc('0x80'),_0x23ba43[_0xdcbc('0x73')]))&&_0x4c7e39){_0x558e9f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x80'),_0x23ba43['sitepic']);}}return _0x512c7c['download'](_0x558e9f);}})[_0xdcbc('0x58')](handleError(_0x512c7c,null));};exports[_0xdcbc('0x81')]=function(_0x290eb9,_0x43595f,_0x236ca9){var _0x460269=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x82'));var _0x16eba6={'where':{'id':_0x290eb9[_0xdcbc('0x5a')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xdcbc('0x55')][_0xdcbc('0x5d')](_0x16eba6)['then'](handleEntityNotFound(_0x43595f,null))['then'](function(_0x27fa93){if(_0x27fa93){if(!_[_0xdcbc('0x83')](_0x27fa93[_0xdcbc('0x84')])){if(fs[_0xdcbc('0x7f')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x27fa93[_0xdcbc('0x84')]))){_0x460269=path['join'](config['root'],_0xdcbc('0x85'),_0x27fa93[_0xdcbc('0x84')]);}}return _0x43595f[_0xdcbc('0x86')](_0x460269);}})['catch'](handleError(_0x43595f,null));};exports[_0xdcbc('0x87')]=function(_0x3d8a41,_0x24ac6b,_0x372e51){var _0xf56360=path['join'](config[_0xdcbc('0x7c')],'server/files/images/avatars/customer_avatar.png');var _0x4c77f1={'where':{'id':_0x3d8a41[_0xdcbc('0x5a')]['id']},'attributes':['id',_0xdcbc('0x76'),_0xdcbc('0x88')],'raw':!![]};return db['ChatWebsite']['find'](_0x4c77f1)[_0xdcbc('0x23')](handleEntityNotFound(_0x24ac6b,null))['then'](function(_0x15acd2){if(_0x15acd2){if(!_[_0xdcbc('0x83')](_0x15acd2[_0xdcbc('0x76')])){if(fs['existsSync'](path['join'](config['root'],_0xdcbc('0x85'),_0x15acd2[_0xdcbc('0x76')]))&&_0x15acd2[_0xdcbc('0x88')]){_0xf56360=path['join'](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x15acd2[_0xdcbc('0x76')]);}}return _0x24ac6b[_0xdcbc('0x86')](_0xf56360);}})[_0xdcbc('0x58')](handleError(_0x24ac6b,null));};exports[_0xdcbc('0x89')]=function(_0x1f06c0,_0x5832d1,_0x11b3ca){var _0x5ad96f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x8a'));var _0x10abe7={'where':{'id':_0x1f06c0['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xdcbc('0x55')]['find'](_0x10abe7)['then'](handleEntityNotFound(_0x5832d1,null))[_0xdcbc('0x23')](function(_0x1ce5f1){if(_0x1ce5f1){if(!_[_0xdcbc('0x83')](_0x1ce5f1[_0xdcbc('0x79')])){if(fs[_0xdcbc('0x7f')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x1ce5f1['systemAvatar']))){_0x5ad96f=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],_0xdcbc('0x85'),_0x1ce5f1[_0xdcbc('0x79')]);}}return _0x5832d1['download'](_0x5ad96f);}})[_0xdcbc('0x58')](handleError(_0x5832d1,null));};exports[_0xdcbc('0x8b')]=function(_0x5d6352,_0xcd971a,_0x2f8689){var _0x441082=require(_0xdcbc('0x8c'));var _0x26b0a4=new _0x441082();var _0x594fce=_0x26b0a4[_0xdcbc('0x8d')](_0x5d6352[_0xdcbc('0x8e')]['user-agent'])['getResult']();var _0x16b597={'body':_0x5d6352['body'],'channel':_0xdcbc('0x8f')};var _0x3cfe62=[];var _0x46388c=[];var _0x51fb8d={};var _0x3f8f59=![];return db['CmContact']['describe']()['then'](function(_0x5cfc9d){if(!_0x5cfc9d){throw new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x92'));}_0x3cfe62=_['difference'](_[_0xdcbc('0x5b')](_0x5cfc9d),['createdAt',_0xdcbc('0x93')]);_0x46388c=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x5cfc9d),[_0xdcbc('0x95'),_0xdcbc('0x93'),'CompanyId',_0xdcbc('0x96')]);if(_0x5d6352[_0xdcbc('0x5f')]['id']){delete _0x5d6352[_0xdcbc('0x5f')]['id'];}if(_['isNil'](_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x97')])){throw new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x98'));}if(_['isNil'](_0x5d6352['body'][_0xdcbc('0x5f')])||_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x5f')]===''){throw new db['Sequelize']['ValidationError'](_0xdcbc('0x99'));}if(_[_0xdcbc('0x83')](_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x9a')])){throw new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x9b')+_0x46388c);}if(!_[_0xdcbc('0x9c')](_0x46388c,_0x5d6352['body'][_0xdcbc('0x9a')])){throw new db['Sequelize'][(_0xdcbc('0x91'))](_0xdcbc('0x9d')+_0x46388c);}_0x51fb8d[_0x5d6352['body'][_0xdcbc('0x9a')]]=_0x5d6352['body'][_0xdcbc('0x97')];})[_0xdcbc('0x23')](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x5d6352[_0xdcbc('0x5a')]['id']},'include':[{'model':db[_0xdcbc('0x9e')],'as':_0xdcbc('0x9f'),'include':[{'model':db['CmContact'],'as':_0xdcbc('0xa0'),'where':_0x51fb8d,'limit':0x1,'order':[[_0xdcbc('0x93'),_0xdcbc('0xa1')]]}]},{'model':db[_0xdcbc('0xa2')],'as':_0xdcbc('0xa3')}]});})['then'](handleEntityNotFound(_0xcd971a,null))[_0xdcbc('0x23')](function(_0x4673b0){if(_0x4673b0&&_0x4673b0[_0xdcbc('0x9f')]){_0x16b597[_0xdcbc('0xa4')]=_0x4673b0;_0x16b597['applications']=_0x4673b0[_0xdcbc('0xa3')];_0x16b597[_0xdcbc('0xa5')]=_0x4673b0[_0xdcbc('0x9f')];_0x16b597[_0xdcbc('0xa6')]=_[_0xdcbc('0xa7')](_0x16b597[_0xdcbc('0xa6')],['priority'],[_0xdcbc('0xa8')]);if(_0x16b597['account'][_0xdcbc('0xa3')]){delete _0x16b597[_0xdcbc('0xa4')][_0xdcbc('0xa3')];}if(_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0x9f')]&&_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0x9f')][_0xdcbc('0xa0')][_0xdcbc('0x4a')]){return _0x16b597[_0xdcbc('0xa4')]['List'][_0xdcbc('0xa0')][0x0];}var _0x331d96=_[_0xdcbc('0xa9')](_0x5d6352['body'],{'firstName':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x97')],'ListId':_0x4673b0['ListId']});_0x331d96[_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0x9a')]]=_0x5d6352[_0xdcbc('0x5f')]['from'];return db[_0xdcbc('0xaa')][_0xdcbc('0x5e')](_0x331d96,{'fields':_0x3cfe62,'raw':!![]});}})[_0xdcbc('0x23')](handleEntityNotFound(_0xcd971a,null))[_0xdcbc('0x23')](function(_0x3165a1){_0x16b597[_0xdcbc('0xab')]=_0x3165a1;var _0x301b5d=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xac')];if(_0x5d6352['headers'][_0xdcbc('0xad')]){_0x301b5d=_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xad')];}else if(_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xae')]){_0x301b5d=_[_0xdcbc('0xaf')](_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xae')][_0xdcbc('0xb0')](','));}if(_0x3165a1){var _0x6b2109={'ContactId':_0x3165a1['id'],'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'from':(_0x3165a1['firstName']||'')+'\x20'+(_0x3165a1['lastName']||''),'customerIp':_0x301b5d,'customerPort':_0x5d6352[_0xdcbc('0x8e')][_0xdcbc('0xb1')]?_0x5d6352['headers'][_0xdcbc('0xb1')]:null,'referer':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xb2')],'browserName':_0x594fce[_0xdcbc('0xb3')]['name']&&_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0xb4')]?util[_0xdcbc('0xb5')](_0xdcbc('0xb6'),_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0x3e')],_0x594fce[_0xdcbc('0xb3')][_0xdcbc('0xb4')]):'unknown','browserVersion':_0x594fce['browser'][_0xdcbc('0xb4')]||_0xdcbc('0xb7'),'osName':util['format']('%s\x20%s',_0x594fce['os'][_0xdcbc('0x3e')],_0x594fce['os'][_0xdcbc('0xb4')]),'osVersion':_0x594fce['os'][_0xdcbc('0xb4')],'deviceModel':_0x594fce['device'][_0xdcbc('0x44')]&&_0x594fce[_0xdcbc('0xb8')]['vendor']?util['format'](_0xdcbc('0xb9'),_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0x44')],_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0xba')],_0x594fce['device']['type']):null,'deviceVendor':_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0xba')],'deviceType':_0x594fce[_0xdcbc('0xb8')][_0xdcbc('0x43')],'formData':JSON['stringify'](_0x5d6352[_0xdcbc('0x5f')])};var _0x5097ef={'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'closed':![]};if(_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')]){_0x5097ef[_0xdcbc('0xbb')]=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')];return db[_0xdcbc('0xbc')]['find']({'where':_0x5097ef})[_0xdcbc('0x23')](function(_0x3e610f){if(_0x3e610f){return[_0x3e610f,![]];}_0x6b2109[_0xdcbc('0xbb')]=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')];_0x6b2109[_0xdcbc('0xbd')]=_0x5d6352['body'][_0xdcbc('0xbd')];return db[_0xdcbc('0xbc')]['create'](_0x6b2109)[_0xdcbc('0x23')](function(_0x5acb28){return[_0x5acb28,!![]];});});}_0x5097ef['ContactId']=_0x3165a1['id'];if(_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbe')]&&_0x5d6352[_0xdcbc('0x5f')]['interaction']['id']){_0x5097ef['id']=_0x5d6352[_0xdcbc('0x5f')]['interaction']['id'];return db['ChatInteraction'][_0xdcbc('0x5d')]({'where':_0x5097ef})[_0xdcbc('0x23')](function(_0x20753c){if(_0x20753c){return[_0x20753c,![]];}return db['ChatInteraction'][_0xdcbc('0x5e')](_0x6b2109)[_0xdcbc('0x23')](function(_0x5c0fa6){return[_0x5c0fa6,!![]];});});}return db[_0xdcbc('0xbc')][_0xdcbc('0x5e')](_0x6b2109)['then'](function(_0x4f998c){return[_0x4f998c,!![]];});}})[_0xdcbc('0xbf')](function(_0x66ba22,_0x10da11){if(_0x66ba22){_0x3f8f59=_0x10da11;if(!_0x10da11){var _0x181741={'from':(_0x16b597[_0xdcbc('0xab')]['firstName']||'')+'\x20'+(_0x16b597[_0xdcbc('0xab')]['lastName']||'')};if(_0x5d6352['body']['threadId']&&_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc0')]&&_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xbb')]!=_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc0')]){_0x181741[_0xdcbc('0xbb')]=_0x5d6352['body'][_0xdcbc('0xc0')];}return _0x66ba22[_0xdcbc('0x38')](_0x181741);}else{return _0x66ba22;}}})[_0xdcbc('0x23')](function(_0x24800f){_0x16b597[_0xdcbc('0xbe')]=_0x24800f[_0xdcbc('0x3a')]({'plain':!![]});_0x16b597['interaction'][_0xdcbc('0xc1')]=_0x3f8f59;if(_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc1')]){if(_0x16b597[_0xdcbc('0xa4')]['autoclose']){_0x16b597[_0xdcbc('0xa6')]['push']({'id':0x0,'priority':_0x16b597[_0xdcbc('0xa6')]['length']+0x1,'app':_0xdcbc('0xc2'),'appdata':_0xdcbc('0xc3'),'interval':'*,*,*,*'});}}return db[_0xdcbc('0xc4')][_0xdcbc('0x5e')]({'body':_0x5d6352[_0xdcbc('0x5f')]['body'],'ChatWebsiteId':_0x5d6352[_0xdcbc('0x5a')]['id'],'ChatInteractionId':_0x24800f['id'],'direction':'in','ContactId':_0x16b597[_0xdcbc('0xab')]['id'],'AttachmentId':_0x5d6352[_0xdcbc('0x5f')][_0xdcbc('0xc5')]});})['then'](function(_0x1fcfb1){_0x16b597['message']=_0x1fcfb1;if(_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc6')]){return db[_0xdcbc('0xc7')]['find']({'attributes':['id',_0xdcbc('0x3e')],'where':{'id':_0x16b597[_0xdcbc('0xbe')][_0xdcbc('0xc6')]}})[_0xdcbc('0x23')](function(_0x2f3683){if(_0x2f3683){_0x16b597[_0xdcbc('0xa6')][_0xdcbc('0xc8')]({'id':0x0,'priority':0x0,'app':_0xdcbc('0xc9'),'appdata':_0x2f3683[_0xdcbc('0x3e')]+','+(_0x16b597[_0xdcbc('0xa4')][_0xdcbc('0xca')]||0xa),'interval':'*,*,*,*'});_0x16b597[_0xdcbc('0xcb')]=!![];}return respondWithRpcPromise(_0xdcbc('0xcc'),_0xdcbc('0xcd'),_0x16b597);});}return respondWithRpcPromise('Start',_0xdcbc('0xcd'),_0x16b597);})[_0xdcbc('0x23')](function(_0x53bca8){respondWithRpcPromise('EventManager',_0xdcbc('0xce'),{'event':_0xdcbc('0x8b'),'message':_0x53bca8},client9002);return _0x53bca8;})[_0xdcbc('0x23')](respondWithResult(_0xcd971a,null))[_0xdcbc('0x58')](handleError(_0xcd971a,null));};exports[_0xdcbc('0xcf')]=function(_0x41837a,_0x52a4e8,_0x297249){var _0x2460ca,_0x9f0067,_0xfb5e7b;var _0x586c47=[];var _0x3d58b5=[];var _0x1d3d00={};var _0x25f014=_0x41837a[_0xdcbc('0xd0')]||[];var _0x357332=[];var _0x5e7fe1;return db[_0xdcbc('0xaa')][_0xdcbc('0x66')]()[_0xdcbc('0x23')](function(_0x11d210){if(!_0x11d210){throw new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x92'));}_0x3d58b5=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x11d210),['createdAt','updatedAt']);_0x586c47=_[_0xdcbc('0x94')](_[_0xdcbc('0x5b')](_0x11d210),[_0xdcbc('0x95'),_0xdcbc('0x93'),_0xdcbc('0xd1'),_0xdcbc('0x96')]);if(_0x41837a[_0xdcbc('0x5f')]['id']){delete _0x41837a[_0xdcbc('0x5f')]['id'];}if(_['isNil'](_0x41837a[_0xdcbc('0x5f')]['from'])){throw _0x52a4e8['status'](0x1f4)[_0xdcbc('0xd2')](new db[(_0xdcbc('0x90'))]['ValidationError'](_0xdcbc('0x98')));}if(_[_0xdcbc('0x83')](_0x41837a[_0xdcbc('0x5f')]['body'])||_0x41837a[_0xdcbc('0x5f')]['body']===''){throw _0x52a4e8['status'](0x1f4)[_0xdcbc('0xd2')](new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))](_0xdcbc('0x99')));}if(_[_0xdcbc('0x83')](_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')])){throw _0x52a4e8['status'](0x1f4)['send'](new db['Sequelize'][(_0xdcbc('0x91'))](_0xdcbc('0xd4')+_0x586c47));}if(!_[_0xdcbc('0x9c')](_0x586c47,_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')])){throw _0x52a4e8[_0xdcbc('0x2e')](0x1f4)['send'](new db[(_0xdcbc('0x90'))][(_0xdcbc('0x91'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x586c47));}_0x1d3d00[_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')]]=_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x97')];})['then'](function(){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x41837a['params']['id']},'include':[{'model':db[_0xdcbc('0x9e')],'as':_0xdcbc('0x9f')},{'model':db[_0xdcbc('0xd5')],'as':'MailAccount'}]});})[_0xdcbc('0x23')](handleEntityNotFound(_0x52a4e8,null))[_0xdcbc('0x23')](function(_0x460805){if(_0x460805&&_0x460805['List']){_0x9f0067=_0x460805;var _0x1fa520=_['defaults'](_0x41837a[_0xdcbc('0x5f')],{'firstName':_0x41837a[_0xdcbc('0x5f')]['from'],'phone':_0x41837a['body'][_0xdcbc('0x97')],'ListId':_0x460805[_0xdcbc('0x96')]});_0x1fa520[_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0xd3')]]=_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x97')];return db[_0xdcbc('0xaa')][_0xdcbc('0xd6')]({'where':_0x1d3d00,'defaults':_0x1fa520});}})[_0xdcbc('0xbf')](function(_0x4b8a3f){if(_0x4b8a3f){_0xfb5e7b=_0x4b8a3f;var _0x1caa40=fs[_0xdcbc('0xd7')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xdcbc('0xd8'));var _0x202851=ejs[_0xdcbc('0xd9')](_0x1caa40,{'body':_[_0xdcbc('0xda')](_0x41837a[_0xdcbc('0x5f')][_0xdcbc('0x5f')]),'bodyTitle':_0x9f0067[_0xdcbc('0xdb')]});return db[_0xdcbc('0xdc')][_0xdcbc('0x5e')]({'body':_0x202851,'ContactId':_0x4b8a3f['id'],'ChatWebsiteId':_0x9f0067['id']});}})[_0xdcbc('0x23')](function(_0x167637){_0x5e7fe1=_0x167637;if(_0x25f014[_0xdcbc('0x4a')]){var _0x206214=_0x25f014[_0xdcbc('0x42')](function(_0x4f6b80){return{'name':_0x4f6b80[_0xdcbc('0xdd')],'basename':_0x4f6b80['filename'],'type':_0x4f6b80[_0xdcbc('0xde')],'ChatOfflineMessageId':_0x167637['id']};});_0x357332=_0x206214['map'](_0x4b6916=>{var _0x35a93b={'filename':_0x4b6916['name'],'path':path[_0xdcbc('0x7b')](config['root'],_0xdcbc('0xdf'),_0xdcbc('0xd0'),_0xdcbc('0xe0'),_0xdcbc('0xe1'),_0x4b6916[_0xdcbc('0xe2')])};return _0x35a93b;});if(!_0x9f0067[_0xdcbc('0xe3')]){return db[_0xdcbc('0xe4')][_0xdcbc('0xe5')](function(_0x3c7971){return db[_0xdcbc('0xe6')][_0xdcbc('0xe7')](_0x206214,{'transaction':_0x3c7971});});}}})[_0xdcbc('0x23')](function(){if(_0x5e7fe1){_0x2460ca=_0x5e7fe1;return db[_0xdcbc('0xd5')][_0xdcbc('0x6a')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]});}})['then'](function(_0x3430c2){if(_0x3430c2&&_0x3430c2[_0xdcbc('0xe8')]&&_0x9f0067[_0xdcbc('0xe9')]&&_0x9f0067[_0xdcbc('0xea')]){var _0x4b1af7={'tls':{'rejectUnauthorized':![]}};if(_0x3430c2['Smtp'][_0xdcbc('0xeb')]){_0x4b1af7[_0xdcbc('0xeb')]=_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xeb')];}else{_0x4b1af7['host']=_0x3430c2['Smtp'][_0xdcbc('0xec')];_0x4b1af7[_0xdcbc('0xed')]=_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xed')];_0x4b1af7[_0xdcbc('0xee')]=_0x3430c2['Smtp'][_0xdcbc('0xee')];}if(_0x3430c2['Smtp'][_0xdcbc('0xef')]){_0x4b1af7['auth']={'user':_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0x60')],'pass':_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0xf0')]};}return respondWithRpcPromise(_0xdcbc('0xf1'),_0xdcbc('0xf2'),{'account':_0x4b1af7,'message':{'from':util['format'](_0xdcbc('0xf3'),_0x3430c2[_0xdcbc('0x3e')],_0x3430c2[_0xdcbc('0xf4')]||_0x3430c2[_0xdcbc('0xe8')][_0xdcbc('0x60')]),'to':_0x9f0067[_0xdcbc('0xea')],'subject':_0x9f0067[_0xdcbc('0xf5')],'html':_0x2460ca[_0xdcbc('0x5f')],'attachments':_0x357332}},client9003)[_0xdcbc('0x23')](function(){return _0x2460ca;})[_0xdcbc('0x58')](function(_0x5a159e){console[_0xdcbc('0x2a')](_0x5a159e);});}})[_0xdcbc('0x23')](function(){if(_0x9f0067&&_0x9f0067[_0xdcbc('0xe3')]&&_0x9f0067['MailAccountId']){var _0x5a52db=[];if(_0x25f014[_0xdcbc('0x4a')]){_0x5a52db=_0x25f014[_0xdcbc('0x42')](function(_0x88828f){return{'name':_0x88828f[_0xdcbc('0xdd')],'basename':_0x88828f['filename'],'type':_0x88828f['mimetype'],'ChatOfflineMessageId':_0x5e7fe1['id']};});}var _0xac9478;if(!_[_0xdcbc('0x83')](_0x9f0067[_0xdcbc('0xf6')])){var _0x1ad03d=_['map'](_0x41837a['body'],function(_0x5be47c){return _0x5be47c;});var _0x33ec6b=_[_0xdcbc('0xf7')](_0x1ad03d)[0x0];var _0x2a22cd=_[_0xdcbc('0xf8')](_0x33ec6b,function(_0x442568){return _0x442568;});_0xac9478=_0x2a22cd[0x1][_0x9f0067[_0xdcbc('0xf6')]];}var _0x249579={'from':_0xfb5e7b[_0xdcbc('0xf4')],'firstName':_0xfb5e7b[_0xdcbc('0xf9')],'lastName':_0xfb5e7b['lastName'],'mapKey':_0xdcbc('0xf4'),'message':{'from':_0xfb5e7b[_0xdcbc('0xf4')],'to':_0x9f0067[_0xdcbc('0xd5')][_0xdcbc('0xf4')],'cc':'','subject':_[_0xdcbc('0x83')](_0xac9478)?_0x9f0067[_0xdcbc('0xf5')]:_0xac9478,'messageId':'','sentAt':new Date(),'attach':_0x5a52db[_0xdcbc('0x4a')],'attachments':_0x5a52db,'originChannel':_0xdcbc('0xfa'),'ChatWebsiteId':_0x9f0067['id'],'ChatOfflineMessageId':_0x2460ca['id'],'originTo':_0x9f0067[_0xdcbc('0xd5')][_0xdcbc('0xf4')]},'body':_0x2460ca['body']};var _0x1ca6c7={'account':{'id':_0x9f0067['MailAccountId']},'body':_0x249579,'log':_0xdcbc('0xfb')};return respondWithRpcPromise('NotifyMailAccount',_0xdcbc('0xfc'),_0x1ca6c7,client9001)['then'](function(){return _0x2460ca;})['catch'](function(_0x5568a1){console[_0xdcbc('0x2a')](_0x5568a1);});}return;})[_0xdcbc('0x23')](function(){if(_0x2460ca){return _0x2460ca;}})['then'](respondWithResult(_0x52a4e8,null))[_0xdcbc('0x58')](function(_0xd3c3b1){console[_0xdcbc('0x2a')]('catch',_0xd3c3b1);for(var _0x44020d of _0x25f014){var _0x53a9a2=path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server',_0xdcbc('0xd0'),'attachments',_0xdcbc('0xe1'),_0x44020d['filename']);fs_extra[_0xdcbc('0xfd')](_0x53a9a2)[_0xdcbc('0x58')](function(_0x5dcf96){console[_0xdcbc('0x2a')](_0xdcbc('0xfe'),_0x53a9a2,_0x5dcf96);});}});};exports[_0xdcbc('0xff')]=function(_0x3aa884,_0xe67977,_0x28d84e){return db[_0xdcbc('0xbc')][_0xdcbc('0x5d')]({'where':{'id':_0x3aa884[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe67977,null))[_0xdcbc('0x23')](function(_0x451dc9){if(_0x451dc9){return _0x451dc9['addInteraction'](_0x3aa884[_0xdcbc('0x5f')][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0x3aa884['body'],[_0xdcbc('0x6d'),'id'])||{});}})[_0xdcbc('0x23')](respondWithResult(_0xe67977,null))['catch'](handleError(_0xe67977,null));};exports['getInteractions']=function(_0x4d9567,_0xf1f092,_0x2da46a){var _0x150bb4={'raw':![],'where':{}};var _0xeee135={};var _0x117a34={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')]['findOne']({'where':{'id':_0x4d9567[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xf1f092,null))[_0xdcbc('0x23')](function(_0x930085){if(_0x930085){_0xeee135[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xbc')][_0xdcbc('0x5c')]);_0xeee135[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x4d9567[_0xdcbc('0x45')]);_0xeee135['filters']=_[_0xdcbc('0x47')](_0xeee135['model'],_0xeee135[_0xdcbc('0x45')]);_0x150bb4[_0xdcbc('0x48')]=_['intersection'](_0xeee135[_0xdcbc('0x44')],qs['fields'](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x150bb4['attributes']=_0x150bb4[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x150bb4[_0xdcbc('0x48')]:_0xeee135[_0xdcbc('0x44')];if(!_0x4d9567[_0xdcbc('0x45')]['hasOwnProperty'](_0xdcbc('0x4c'))){_0x150bb4[_0xdcbc('0x31')]=qs['limit'](_0x4d9567[_0xdcbc('0x45')]['limit']);_0x150bb4[_0xdcbc('0x30')]=qs['offset'](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x30')]);}_0x150bb4[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x150bb4[_0xdcbc('0x51')]=qs['filters'](_[_0xdcbc('0x4e')](_0x4d9567['query'],_0xeee135['filters']));_0x150bb4[_0xdcbc('0x51')][_0xdcbc('0x67')]=_0x930085['id'];if(_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x150bb4[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x150bb4[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x150bb4[_0xdcbc('0x48')],function(_0x5d3fb8){var _0x3d7561={};_0x3d7561[_0x5d3fb8]={'$like':'%'+_0x4d9567[_0xdcbc('0x45')]['filter']+'%'};return _0x3d7561;})});}_0x150bb4=_[_0xdcbc('0x50')]({},_0x150bb4,_0x4d9567['options']);return db[_0xdcbc('0xbc')]['count']({'where':_0x150bb4[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x354ba9){_0x117a34[_0xdcbc('0x33')]=_0x354ba9;if(_0x4d9567[_0xdcbc('0x45')]['includeAll']){_0x150bb4[_0xdcbc('0x6b')]=[{'model':db[_0xdcbc('0xaa')],'as':_0xdcbc('0x101'),'required':![]},{'model':db[_0xdcbc('0xc7')],'as':'Owner','attributes':[_0xdcbc('0x3e'),_0xdcbc('0x102'),'internal'],'required':![]},{'model':db[_0xdcbc('0x103')],'as':'Tags','attributes':['id',_0xdcbc('0x3e'),'color'],'where':_0x4d9567[_0xdcbc('0x45')]['tag']?{'id':_0x4d9567['query'][_0xdcbc('0x104')]}:undefined,'required':_0x4d9567[_0xdcbc('0x45')][_0xdcbc('0x104')]?!![]:![]}];}return db[_0xdcbc('0xbc')]['findAll'](_0x150bb4);})['then'](function(_0x2d978d){_0x117a34[_0xdcbc('0x57')]=_0x2d978d;return _0x117a34;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0xf1f092,_0x150bb4))[_0xdcbc('0x58')](handleError(_0xf1f092,null));};function iftimePromise(_0x9c26dc,_0x5f5148){return respondWithRpcPromise(_0xdcbc('0x105'),_0xdcbc('0x106'),{'command':_0x5f5148['timezone']?util[_0xdcbc('0xb5')](_0xdcbc('0x107'),_0x9c26dc[_0xdcbc('0x108')],_0x5f5148[_0xdcbc('0x109')]):util[_0xdcbc('0xb5')](_0xdcbc('0x10a'),_0x9c26dc['interval'])},client9002)['then'](function(_0x2fffff){var _0x429446=_0x2fffff&&_0x2fffff[_0xdcbc('0x10b')](_0xdcbc('0x10c'))>=0x0?!![]:![];logger[_0xdcbc('0x2c')](_0xdcbc('0x10d'),_0x5f5148['id'],_0x9c26dc['id'],_0x9c26dc[_0xdcbc('0x108')],_0x429446?_0xdcbc('0x10e'):'OFFLINE',_0x5f5148[_0xdcbc('0x109')]?_0x5f5148['timezone']:_0xdcbc('0x10f'));return _0x429446;})[_0xdcbc('0x58')](function(_0x11fe78){logger[_0xdcbc('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x5f5148['id'],_0x9c26dc['id'],_0x9c26dc[_0xdcbc('0x108')],util[_0xdcbc('0x110')](_0x11fe78,{'showHidden':![],'depth':null}),_0x5f5148[_0xdcbc('0x109')]?_0x5f5148[_0xdcbc('0x109')]:_0xdcbc('0x10f'));return![];});}exports[_0xdcbc('0x106')]=function(_0xa3f780,_0x3508b9,_0x2ae507){var _0x3b5247=0x0;var _0x4d7789=0x0;var _0x72756e=![];var _0x2d92c2;var _0x191c5;return db['ChatWebsite'][_0xdcbc('0x5d')]({'where':{'id':_0xa3f780['params']['id']},'include':[{'model':db[_0xdcbc('0x111')],'as':_0xdcbc('0x111'),'include':[{'model':db[_0xdcbc('0x111')],'as':_0xdcbc('0x112'),'attributes':['id',_0xdcbc('0x108')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3508b9,null))[_0xdcbc('0x23')](function(_0x10d979){if(_0x10d979){_0x2d92c2=_0x10d979;return _0x10d979[_0xdcbc('0x113')]({'raw':!![]});}})[_0xdcbc('0x23')](function(_0x1c7e35){if(_0x2d92c2){if(_0x1c7e35){_0x191c5=_0x1c7e35;}}return require(_0xdcbc('0x1a'))[_0xdcbc('0x7d')]();})[_0xdcbc('0x23')](function(_0x310369){if(_0x310369){_0x4d7789=_0x310369['virtual'];_0x72756e=_0x310369['custom'];}})['then'](function(){return db[_0xdcbc('0xbc')][_0xdcbc('0x33')]({'where':{'closed':![]}});})[_0xdcbc('0x23')](function(_0x4e0707){_0x3b5247=_0x4e0707;if(_0x4d7789&&_0x4e0707>_0x4d7789){return db[_0xdcbc('0x114')]['findOne']({'where':{'id':0x1}})[_0xdcbc('0x23')](function(_0x36616d){if(_0x36616d){_0x36616d['increment'](_0xdcbc('0x115'));}});}})[_0xdcbc('0x23')](function(){if(_0x2d92c2[_0xdcbc('0x111')]&&_0x2d92c2['Interval'][_0xdcbc('0x112')]){var _0x418299=[];for(var _0x16fb7a=0x0;_0x16fb7a<_0x2d92c2['Interval']['Intervals']['length'];_0x16fb7a++){var _0x463798=_0x2d92c2['Interval'][_0xdcbc('0x112')][_0x16fb7a][_0xdcbc('0x3a')]({'plain':!![]});_0x418299[_0xdcbc('0x116')](iftimePromise(_0x463798,_0x2d92c2));}return BPromise['all'](_0x418299)['then'](function(_0xfe0304){return _['some'](_0xfe0304);});}else{return!![];}})[_0xdcbc('0x23')](function(_0x2ec9e5){var _0x230226=fs[_0xdcbc('0xd7')](path[_0xdcbc('0x7b')](config[_0xdcbc('0x7c')],'server/files/chat/iframe.ejs'),_0xdcbc('0xd8'));var _0x25c7a5={'remote':_0x2d92c2['remote'],'query':querystring[_0xdcbc('0x28')](_[_0xdcbc('0x50')](_0x2d92c2['get']({'plain':!![]}),{'customerIp':_0xa3f780[_0xdcbc('0x8e')][_0xdcbc('0xae')]||_0xa3f780[_0xdcbc('0x8e')][_0xdcbc('0x117')]||_0xa3f780[_0xdcbc('0x118')][_0xdcbc('0x119')]||_0xa3f780['ip'],'referer':_0xa3f780['headers'][_0xdcbc('0xb2')],'openedInteractions':_0x3b5247,'maxInteractions':_0x4d7789,'virtual':_0x72756e['virtual'],'online':_0x2ec9e5,'custom':_0x72756e}))['replace'](/'/g,'\x5c\x27')};_0x3508b9[_0xdcbc('0xd2')](ejs[_0xdcbc('0xd9')](Mustache[_0xdcbc('0xd9')](_0x230226,_0x25c7a5),{'proactiveActions':_0x191c5,'alignment':_0x2d92c2[_0xdcbc('0x11a')],'verticalAlignment':_0x2d92c2[_0xdcbc('0x11b')],'div_color':_0x2d92c2[_0xdcbc('0x11c')],'text_color':_0x2d92c2[_0xdcbc('0x11d')],'button_color':_0x2d92c2[_0xdcbc('0x11e')],'background_color':_0x2d92c2['backgroundColor']}));})['catch'](handleError(_0x3508b9,null));};exports[_0xdcbc('0x11f')]=function(_0x5784f4,_0x579b92,_0x2c8acb){return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x5784f4['params']['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x579b92,null))[_0xdcbc('0x23')](function(_0x730713){if(_0x730713){return db['sequelize'][_0xdcbc('0xe5')](function(_0x4a147a){return db[_0xdcbc('0xa2')][_0xdcbc('0x39')]({'where':{'ChatWebsiteId':_0x5784f4[_0xdcbc('0x5a')]['id']},'transaction':_0x4a147a})[_0xdcbc('0x23')](function(_0x34830c){var _0x4445f2=_[_0xdcbc('0x42')](_0x5784f4['body'],function(_0x105fc8){_0x105fc8[_0xdcbc('0x67')]=_0x5784f4[_0xdcbc('0x5a')]['id'];return _0x105fc8;});return db[_0xdcbc('0xa2')][_0xdcbc('0xe7')](_0x4445f2,{'transaction':_0x4a147a});});})['then'](function(){return db[_0xdcbc('0xa2')][_0xdcbc('0x120')]({'where':{'ChatWebsiteId':_0x5784f4[_0xdcbc('0x5a')]['id']},'order':_0xdcbc('0x121')});});}})[_0xdcbc('0x23')](respondWithResult(_0x579b92,null))['catch'](handleError(_0x579b92,null));};exports[_0xdcbc('0x122')]=function(_0x117edb,_0x8d865c,_0x512df9){var _0x5567f8={};var _0xa6c89b={};var _0x9ec2c8;var _0x3802da;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x117edb[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x8d865c,null))[_0xdcbc('0x23')](function(_0x44eba8){if(_0x44eba8){_0x9ec2c8=_0x44eba8;_0xa6c89b[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xa2')][_0xdcbc('0x5c')]);_0xa6c89b[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x117edb['query']);_0xa6c89b[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0xa6c89b['model'],_0xa6c89b[_0xdcbc('0x45')]);_0x5567f8[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0xa6c89b[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x117edb['query']['fields']));_0x5567f8[_0xdcbc('0x48')]=_0x5567f8[_0xdcbc('0x48')]['length']?_0x5567f8[_0xdcbc('0x48')]:_0xa6c89b['model'];_0x5567f8[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x5567f8[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x117edb[_0xdcbc('0x45')],_0xa6c89b[_0xdcbc('0x46')]));if(_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x5567f8[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x5567f8[_0xdcbc('0x51')],{'$or':_['map'](_0x5567f8[_0xdcbc('0x48')],function(_0x2875df){var _0x57c6fb={};_0x57c6fb[_0x2875df]={'$like':'%'+_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x57c6fb;})});}_0x5567f8=_[_0xdcbc('0x50')]({},_0x5567f8,_0x117edb['options']);return _0x9ec2c8['getApplications'](_0x5567f8);}})[_0xdcbc('0x23')](function(_0xcb6986){if(_0xcb6986){_0x3802da=_0xcb6986[_0xdcbc('0x4a')];if(!_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x5567f8[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x117edb[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x5567f8[_0xdcbc('0x30')]=qs['offset'](_0x117edb['query'][_0xdcbc('0x30')]);}return _0x9ec2c8['getApplications'](_0x5567f8);}})[_0xdcbc('0x23')](function(_0x14e7ae){if(_0x14e7ae){return _0x14e7ae?{'count':_0x3802da,'rows':_0x14e7ae}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x8d865c,null))[_0xdcbc('0x58')](handleError(_0x8d865c,null));};exports['addProactiveActions']=function(_0xe3329f,_0x1a11a1,_0x1b0844){return db[_0xdcbc('0x123')][_0xdcbc('0x5d')]({'where':{'id':_0xe3329f[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x1a11a1,null))[_0xdcbc('0x23')](function(_0x44382f){if(_0x44382f){return _0x44382f[_0xdcbc('0x124')](_0xe3329f[_0xdcbc('0x5f')][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0xe3329f[_0xdcbc('0x5f')],[_0xdcbc('0x6d'),'id'])||{});}})[_0xdcbc('0x23')](respondWithResult(_0x1a11a1,null))[_0xdcbc('0x58')](handleError(_0x1a11a1,null));};exports[_0xdcbc('0x113')]=function(_0x111a47,_0x473642,_0x580845){var _0x123db5={};var _0x23f710={};var _0x86db36;var _0x21877a;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x111a47['params']['id']}})['then'](handleEntityNotFound(_0x473642,null))[_0xdcbc('0x23')](function(_0x278d5f){if(_0x278d5f){_0x86db36=_0x278d5f;_0x23f710[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0x125')][_0xdcbc('0x5c')]);_0x23f710[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x111a47[_0xdcbc('0x45')]);_0x23f710[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x23f710[_0xdcbc('0x44')],_0x23f710['query']);_0x123db5[_0xdcbc('0x48')]=_['intersection'](_0x23f710[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x123db5[_0xdcbc('0x48')]=_0x123db5[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x123db5[_0xdcbc('0x48')]:_0x23f710[_0xdcbc('0x44')];_0x123db5[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x111a47['query'][_0xdcbc('0x4d')]);_0x123db5[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x111a47[_0xdcbc('0x45')],_0x23f710[_0xdcbc('0x46')]));if(_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x123db5[_0xdcbc('0x51')]=_['merge'](_0x123db5[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x123db5['attributes'],function(_0x432da2){var _0x164e6e={};_0x164e6e[_0x432da2]={'$like':'%'+_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4f')]+'%'};return _0x164e6e;})});}_0x123db5=_[_0xdcbc('0x50')]({},_0x123db5,_0x111a47[_0xdcbc('0x53')]);return _0x86db36[_0xdcbc('0x113')](_0x123db5);}})[_0xdcbc('0x23')](function(_0x3a8bec){if(_0x3a8bec){_0x21877a=_0x3a8bec[_0xdcbc('0x4a')];if(!_0x111a47[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x123db5[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x111a47[_0xdcbc('0x45')]['limit']);_0x123db5['offset']=qs[_0xdcbc('0x30')](_0x111a47['query'][_0xdcbc('0x30')]);}return _0x86db36[_0xdcbc('0x113')](_0x123db5);}})[_0xdcbc('0x23')](function(_0x2af3c6){if(_0x2af3c6){return _0x2af3c6?{'count':_0x21877a,'rows':_0x2af3c6}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x473642,null))[_0xdcbc('0x58')](handleError(_0x473642,null));};exports[_0xdcbc('0x126')]=function(_0x4167c1,_0xdd6dba,_0x4b6884){var _0x1a7ab7=_0x4167c1['query'][_0xdcbc('0x127')]===_0xdcbc('0x128')?_0xdcbc('0x129'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x1a7ab7],'where':{'id':_0x4167c1[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0xdd6dba,null))[_0xdcbc('0x23')](function(_0x5b36e3){if(_0x5b36e3){var _0x42a7a7=_0x5b36e3[_0x1a7ab7];var _0x294be7=_0x42a7a7&&_0x42a7a7[_0xdcbc('0x12a')]?_0x42a7a7[_0xdcbc('0x12a')]:[];_0xdd6dba[_0xdcbc('0xd2')]({'fromKey':_[_0xdcbc('0x83')](_0x42a7a7[_0xdcbc('0x12b')])?undefined:_0x42a7a7[_0xdcbc('0x12b')],'count':_0x294be7[_0xdcbc('0x4a')],'rows':_0x294be7});}})[_0xdcbc('0x58')](handleError(_0xdd6dba,null));};exports[_0xdcbc('0x12c')]=function(_0x120679,_0x5d47c2,_0x27f1be){var _0x19598a={'raw':![],'where':{}};var _0x154094={};var _0x4c88bc={'count':0x0,'rows':[]};return db[_0xdcbc('0x55')][_0xdcbc('0x6a')]({'where':{'id':_0x120679[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x5d47c2,null))[_0xdcbc('0x23')](function(_0x2e65d8){if(_0x2e65d8){_0x154094[_0xdcbc('0x44')]=_['keys'](db[_0xdcbc('0xdc')][_0xdcbc('0x5c')]);_0x154094[_0xdcbc('0x45')]=_[_0xdcbc('0x5b')](_0x120679[_0xdcbc('0x45')]);_0x154094[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x154094[_0xdcbc('0x44')],_0x154094[_0xdcbc('0x45')]);_0x19598a[_0xdcbc('0x48')]=_[_0xdcbc('0x47')](_0x154094['model'],qs[_0xdcbc('0x49')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x49')]));_0x19598a[_0xdcbc('0x48')]=_0x19598a[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x19598a[_0xdcbc('0x48')]:_0x154094[_0xdcbc('0x44')];if(!_0x120679[_0xdcbc('0x45')][_0xdcbc('0x4b')](_0xdcbc('0x4c'))){_0x19598a[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x31')]);_0x19598a['offset']=qs['offset'](_0x120679['query'][_0xdcbc('0x30')]);}_0x19598a[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x120679[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x19598a['where']=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x120679[_0xdcbc('0x45')],_0x154094['filters']));_0x19598a['where'][_0xdcbc('0x67')]=_0x2e65d8['id'];if(_0x120679['query']['filter']){_0x19598a[_0xdcbc('0x51')]=_[_0xdcbc('0x50')](_0x19598a[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x19598a['attributes'],function(_0x3ba46a){var _0x49bd66={};_0x49bd66[_0x3ba46a]={'$like':'%'+_0x120679[_0xdcbc('0x45')]['filter']+'%'};return _0x49bd66;})});}_0x19598a=_[_0xdcbc('0x50')]({},_0x19598a,_0x120679['options']);return db[_0xdcbc('0xdc')]['count']({'where':_0x19598a[_0xdcbc('0x51')]})[_0xdcbc('0x23')](function(_0x4560c1){_0x4c88bc[_0xdcbc('0x33')]=_0x4560c1;if(_0x120679['query'][_0xdcbc('0x54')]){_0x19598a[_0xdcbc('0x6b')]=[{'all':!![]}];}else{_0x19598a[_0xdcbc('0x6b')]=[{'model':db[_0xdcbc('0xaa')],'as':_0xdcbc('0x101'),'required':![]},{'model':db[_0xdcbc('0xe6')],'as':_0xdcbc('0x12d'),'required':![]}];}return db[_0xdcbc('0xdc')][_0xdcbc('0x56')](_0x19598a);})[_0xdcbc('0x23')](function(_0x3f1199){_0x4c88bc[_0xdcbc('0x57')]=_0x3f1199;return _0x4c88bc;});}})[_0xdcbc('0x23')](respondWithFilteredResult(_0x5d47c2,_0x19598a))[_0xdcbc('0x58')](handleError(_0x5d47c2,null));};exports['addAgents']=function(_0x17f605,_0x445460,_0x2c4b67){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x17f605[_0xdcbc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x445460,null))[_0xdcbc('0x23')](function(_0x356db6){if(_0x356db6){return _0x356db6['addAgents'](_0x17f605['body'][_0xdcbc('0x6d')],_[_0xdcbc('0x100')](_0x17f605['body'],[_0xdcbc('0x6d'),'id'])||{})[_0xdcbc('0xbf')](function(_0x9eb906){for(var _0x425271=0x0;_0x425271<_0x17f605[_0xdcbc('0x5f')][_0xdcbc('0x6d')][_0xdcbc('0x4a')];_0x425271+=0x1){socket['emit'](_0xdcbc('0x12e'),{'UserId':Number(_0x17f605[_0xdcbc('0x5f')][_0xdcbc('0x6d')][_0x425271]),'ChatWebsiteId':Number(_0x17f605[_0xdcbc('0x5a')]['id'])});}return _0x9eb906;});}})['then'](respondWithResult(_0x445460,null))[_0xdcbc('0x58')](handleError(_0x445460,null));};exports[_0xdcbc('0x12f')]=function(_0x2e0005,_0x400a00,_0x1d2ab0){return db[_0xdcbc('0x55')][_0xdcbc('0x5d')]({'where':{'id':_0x2e0005['params']['id']}})['then'](handleEntityNotFound(_0x400a00,null))['then'](function(_0x3e6776){if(_0x3e6776){return _0x3e6776[_0xdcbc('0x12f')](_0x2e0005[_0xdcbc('0x45')]['ids'])[_0xdcbc('0x23')](function(){if(_['isArray'](_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')])){for(var _0x4d8f09=0x0;_0x4d8f09<_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')]['length'];_0x4d8f09+=0x1){socket[_0xdcbc('0x130')](_0xdcbc('0x131'),{'UserId':Number(_0x2e0005['query'][_0xdcbc('0x6d')][_0x4d8f09]),'ChatWebsiteId':Number(_0x2e0005[_0xdcbc('0x5a')]['id'])});}}else{socket[_0xdcbc('0x130')](_0xdcbc('0x131'),{'UserId':Number(_0x2e0005[_0xdcbc('0x45')][_0xdcbc('0x6d')]),'ChatWebsiteId':Number(_0x2e0005[_0xdcbc('0x5a')]['id'])});}});}})[_0xdcbc('0x23')](respondWithStatusCode(_0x400a00,null))['catch'](handleError(_0x400a00,null));};exports[_0xdcbc('0x132')]=function(_0x15ccc1,_0x2ee409,_0xe9259d){var _0x520850={};var _0x295304={};var _0x543d33;var _0x8eff12;return db['ChatWebsite'][_0xdcbc('0x6a')]({'where':{'id':_0x15ccc1[_0xdcbc('0x5a')]['id']}})[_0xdcbc('0x23')](handleEntityNotFound(_0x2ee409,null))[_0xdcbc('0x23')](function(_0x1f42f4){if(_0x1f42f4){_0x543d33=_0x1f42f4;_0x295304[_0xdcbc('0x44')]=_[_0xdcbc('0x5b')](db[_0xdcbc('0xc7')][_0xdcbc('0x5c')]);_0x295304[_0xdcbc('0x45')]=_['keys'](_0x15ccc1[_0xdcbc('0x45')]);_0x295304[_0xdcbc('0x46')]=_[_0xdcbc('0x47')](_0x295304[_0xdcbc('0x44')],_0x295304['query']);_0x520850['attributes']=_[_0xdcbc('0x47')](_0x295304[_0xdcbc('0x44')],qs[_0xdcbc('0x49')](_0x15ccc1[_0xdcbc('0x45')]['fields']));_0x520850[_0xdcbc('0x48')]=_0x520850[_0xdcbc('0x48')][_0xdcbc('0x4a')]?_0x520850[_0xdcbc('0x48')]:_0x295304['model'];_0x520850[_0xdcbc('0x70')]=qs[_0xdcbc('0x4d')](_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4d')]);_0x520850[_0xdcbc('0x51')]=qs[_0xdcbc('0x46')](_[_0xdcbc('0x4e')](_0x15ccc1[_0xdcbc('0x45')],_0x295304[_0xdcbc('0x46')]));if(_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4f')]){_0x520850['where']=_[_0xdcbc('0x50')](_0x520850[_0xdcbc('0x51')],{'$or':_[_0xdcbc('0x42')](_0x520850['attributes'],function(_0x5523e3){var _0x5b1098={};_0x5b1098[_0x5523e3]={'$like':'%'+_0x15ccc1[_0xdcbc('0x45')]['filter']+'%'};return _0x5b1098;})});}_0x520850=_[_0xdcbc('0x50')]({},_0x520850,_0x15ccc1[_0xdcbc('0x53')]);return _0x543d33[_0xdcbc('0x132')](_0x520850);}})[_0xdcbc('0x23')](function(_0x369447){if(_0x369447){_0x8eff12=_0x369447['length'];if(!_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x4b')]('nolimit')){_0x520850[_0xdcbc('0x31')]=qs[_0xdcbc('0x31')](_0x15ccc1[_0xdcbc('0x45')]['limit']);_0x520850[_0xdcbc('0x30')]=qs['offset'](_0x15ccc1[_0xdcbc('0x45')][_0xdcbc('0x30')]);}return _0x543d33[_0xdcbc('0x132')](_0x520850);}})[_0xdcbc('0x23')](function(_0x4f6f1b){if(_0x4f6f1b){return _0x4f6f1b?{'count':_0x8eff12,'rows':_0x4f6f1b}:null;}})[_0xdcbc('0x23')](respondWithResult(_0x2ee409,null))[_0xdcbc('0x58')](handleError(_0x2ee409,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index d3eeb01..fc4a26c 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 _0x2b83=['emit','hook','exports','../../mysqldb','ChatWebsite','save','update','remove'];(function(_0x5ecec9,_0xb79a14){var _0x74c17=function(_0x18dbb1){while(--_0x18dbb1){_0x5ecec9['push'](_0x5ecec9['shift']());}};_0x74c17(++_0xb79a14);}(_0x2b83,0x1d3));var _0x32b8=function(_0x39d4c5,_0x143f5e){_0x39d4c5=_0x39d4c5-0x0;var _0x99bb94=_0x2b83[_0x39d4c5];return _0x99bb94;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x32b8('0x0'))['db'][_0x32b8('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x32b8('0x2'),'afterUpdate':_0x32b8('0x3'),'afterDestroy':_0x32b8('0x4')};function emitEvent(_0x5a4168){return function(_0x51d3b4,_0xdd712a,_0x1cc832){ChatWebsiteEvents['emit'](_0x5a4168+':'+_0x51d3b4['id'],_0x51d3b4);ChatWebsiteEvents[_0x32b8('0x5')](_0x5a4168,_0x51d3b4);_0x1cc832(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x32b8('0x6')](e,emitEvent(event));}}module[_0x32b8('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x5a01=['../../mysqldb','ChatWebsite','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x5adcee,_0xfdda97){var _0x1beaa3=function(_0x948152){while(--_0x948152){_0x5adcee['push'](_0x5adcee['shift']());}};_0x1beaa3(++_0xfdda97);}(_0x5a01,0x1af));var _0x15a0=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0x5a01[_0x50f6e5];return _0x5988c5;};'use strict';var EventEmitter=require(_0x15a0('0x0'));var ChatWebsite=require(_0x15a0('0x1'))['db'][_0x15a0('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x15a0('0x3'),'afterDestroy':_0x15a0('0x4')};function emitEvent(_0x4c7c75){return function(_0x1c83a1,_0x12ae6b,_0x1751ed){ChatWebsiteEvents['emit'](_0x4c7c75+':'+_0x1c83a1['id'],_0x1c83a1);ChatWebsiteEvents['emit'](_0x4c7c75,_0x1c83a1);_0x1751ed(null);};}for(var e in events){if(events[_0x15a0('0x5')](e)){var event=events[e];ChatWebsite[_0x15a0('0x6')](e,emitEvent(event));}}module[_0x15a0('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 29773b9..684f6b6 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 _0x62e1=['moment','request-promise','path','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','../../config/logger','api'];(function(_0x7e807b,_0x59bf3a){var _0x4ca606=function(_0x43caab){while(--_0x43caab){_0x7e807b['push'](_0x7e807b['shift']());}};_0x4ca606(++_0x59bf3a);}(_0x62e1,0x97));var _0x162e=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0x62e1[_0x4dab14];return _0xf41aa;};'use strict';var _=require(_0x162e('0x0'));var util=require('util');var logger=require(_0x162e('0x1'))(_0x162e('0x2'));var moment=require(_0x162e('0x3'));var BPromise=require('bluebird');var rp=require(_0x162e('0x4'));var fs=require('fs');var path=require(_0x162e('0x5'));var rimraf=require(_0x162e('0x6'));var config=require('../../config/environment');var attributes=require(_0x162e('0x7'));module[_0x162e('0x8')]=function(_0x442752,_0x3477ac){return _0x442752[_0x162e('0x9')]('ChatWebsite',attributes,{'tableName':_0x162e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd154=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api'];(function(_0x2c4bc3,_0x34f08b){var _0x31ca59=function(_0x2190f0){while(--_0x2190f0){_0x2c4bc3['push'](_0x2c4bc3['shift']());}};_0x31ca59(++_0x34f08b);}(_0xd154,0x177));var _0x4d15=function(_0x564820,_0x344e99){_0x564820=_0x564820-0x0;var _0x1f8ab3=_0xd154[_0x564820];return _0x1f8ab3;};'use strict';var _=require(_0x4d15('0x0'));var util=require(_0x4d15('0x1'));var logger=require('../../config/logger')(_0x4d15('0x2'));var moment=require(_0x4d15('0x3'));var BPromise=require(_0x4d15('0x4'));var rp=require(_0x4d15('0x5'));var fs=require('fs');var path=require(_0x4d15('0x6'));var rimraf=require(_0x4d15('0x7'));var config=require(_0x4d15('0x8'));var attributes=require(_0x4d15('0x9'));module[_0x4d15('0xa')]=function(_0x6963e4,_0xf58fda){return _0x6963e4[_0x4d15('0xb')](_0x4d15('0xc'),attributes,{'tableName':_0x4d15('0xd'),'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 dd8fa25..6e5c3dd 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 _0x5bb0=['lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x2c0686,_0x5451a0){var _0x51b5e6=function(_0x366c54){while(--_0x366c54){_0x2c0686['push'](_0x2c0686['shift']());}};_0x51b5e6(++_0x5451a0);}(_0x5bb0,0x1a0));var _0x05bb=function(_0x4b392f,_0x4ad5b7){_0x4b392f=_0x4b392f-0x0;var _0x222927=_0x5bb0[_0x4b392f];return _0x222927;};'use strict';var _=require(_0x05bb('0x0'));var util=require(_0x05bb('0x1'));var moment=require(_0x05bb('0x2'));var BPromise=require(_0x05bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05bb('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x05bb('0x5'));var config=require(_0x05bb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x05bb('0x7')][_0x05bb('0x8')]({'port':0x232a});config[_0x05bb('0x9')]=_[_0x05bb('0xa')](config[_0x05bb('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x05bb('0xb'))(new Redis(config[_0x05bb('0x9')]));require(_0x05bb('0xc'))[_0x05bb('0xd')](socket);function respondWithRpcPromise(_0x3e0438,_0x32661b,_0x308f22){return new BPromise(function(_0x386351,_0x4d0f02){return client[_0x05bb('0xe')](_0x3e0438,_0x308f22)['then'](function(_0xc4e62e){logger[_0x05bb('0xf')](_0x05bb('0x10'),_0x32661b,'request\x20sent');logger[_0x05bb('0x11')](_0x05bb('0x12'),_0x32661b,_0x05bb('0x13'),JSON[_0x05bb('0x14')](_0xc4e62e));if(_0xc4e62e[_0x05bb('0x15')]){if(_0xc4e62e['error'][_0x05bb('0x16')]===0x1f4){logger[_0x05bb('0x15')](_0x05bb('0x10'),_0x32661b,_0xc4e62e['error'][_0x05bb('0x17')]);return _0x4d0f02(_0xc4e62e[_0x05bb('0x15')][_0x05bb('0x17')]);}logger[_0x05bb('0x15')](_0x05bb('0x10'),_0x32661b,_0xc4e62e[_0x05bb('0x15')][_0x05bb('0x17')]);return _0x386351(_0xc4e62e[_0x05bb('0x15')][_0x05bb('0x17')]);}else{logger[_0x05bb('0xf')](_0x05bb('0x10'),_0x32661b,_0x05bb('0x13'));_0x386351(_0xc4e62e[_0x05bb('0x18')][_0x05bb('0x17')]);}})[_0x05bb('0x19')](function(_0x50d508){logger[_0x05bb('0x15')](_0x05bb('0x10'),_0x32661b,_0x50d508);_0x4d0f02(_0x50d508);});});} \ No newline at end of file +var _0x02c2=['message','result','catch','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x158ab3,_0x4b5908){var _0x302830=function(_0x19fa14){while(--_0x19fa14){_0x158ab3['push'](_0x158ab3['shift']());}};_0x302830(++_0x4b5908);}(_0x02c2,0x14d));var _0x202c=function(_0x548fe7,_0xd82e3d){_0x548fe7=_0x548fe7-0x0;var _0x3a1e53=_0x02c2[_0x548fe7];return _0x3a1e53;};'use strict';var _=require(_0x202c('0x0'));var util=require(_0x202c('0x1'));var moment=require(_0x202c('0x2'));var BPromise=require('bluebird');var rs=require(_0x202c('0x3'));var fs=require('fs');var Redis=require(_0x202c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x202c('0x5'));var config=require(_0x202c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x202c('0x7')][_0x202c('0x8')]({'port':0x232a});config[_0x202c('0x9')]=_[_0x202c('0xa')](config['redis'],{'host':_0x202c('0xb'),'port':0x18eb});var socket=require(_0x202c('0xc'))(new Redis(config['redis']));require(_0x202c('0xd'))['register'](socket);function respondWithRpcPromise(_0x54f610,_0x107cda,_0x273a51){return new BPromise(function(_0x3180f9,_0x2490de){return client['request'](_0x54f610,_0x273a51)['then'](function(_0x82b89){logger[_0x202c('0xe')](_0x202c('0xf'),_0x107cda,_0x202c('0x10'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x107cda,_0x202c('0x10'),JSON[_0x202c('0x11')](_0x82b89));if(_0x82b89['error']){if(_0x82b89[_0x202c('0x12')]['code']===0x1f4){logger[_0x202c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);return _0x2490de(_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);}logger[_0x202c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x82b89['error'][_0x202c('0x13')]);return _0x3180f9(_0x82b89[_0x202c('0x12')][_0x202c('0x13')]);}else{logger[_0x202c('0xe')](_0x202c('0xf'),_0x107cda,'request\x20sent');_0x3180f9(_0x82b89[_0x202c('0x14')][_0x202c('0x13')]);}})[_0x202c('0x15')](function(_0x38da67){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x107cda,_0x38da67);_0x2490de(_0x38da67);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3f8a56f..eb1d01d 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 _0x14b0=['./chatWebsite.events','save','remove','emit','removeListener','register','length'];(function(_0x3adf98,_0x1c0b5a){var _0x32bee8=function(_0x5cd50c){while(--_0x5cd50c){_0x3adf98['push'](_0x3adf98['shift']());}};_0x32bee8(++_0x1c0b5a);}(_0x14b0,0x181));var _0x014b=function(_0x33e580,_0x21b7fa){_0x33e580=_0x33e580-0x0;var _0xab7b7c=_0x14b0[_0x33e580];return _0xab7b7c;};'use strict';var ChatWebsiteEvents=require(_0x014b('0x0'));var events=[_0x014b('0x1'),_0x014b('0x2'),'update'];function createListener(_0x1f1914,_0x44ca12){return function(_0x35354e){_0x44ca12[_0x014b('0x3')](_0x1f1914,_0x35354e);};}function removeListener(_0x592d60,_0x3b94d9){return function(){ChatWebsiteEvents[_0x014b('0x4')](_0x592d60,_0x3b94d9);};}exports[_0x014b('0x5')]=function(_0x4b9276){for(var _0x89f5e0=0x0,_0x1c3cb8=events[_0x014b('0x6')];_0x89f5e0<_0x1c3cb8;_0x89f5e0++){var _0x29eb89=events[_0x89f5e0];var _0x8df7c=createListener('chatWebsite:'+_0x29eb89,_0x4b9276);ChatWebsiteEvents['on'](_0x29eb89,_0x8df7c);}}; \ No newline at end of file +var _0x198d=['removeListener','register','length','save','remove','update','emit'];(function(_0x21d5f9,_0x11e8f2){var _0xb9a560=function(_0x232214){while(--_0x232214){_0x21d5f9['push'](_0x21d5f9['shift']());}};_0xb9a560(++_0x11e8f2);}(_0x198d,0x88));var _0xd198=function(_0x1923d4,_0x5c968b){_0x1923d4=_0x1923d4-0x0;var _0x5d8474=_0x198d[_0x1923d4];return _0x5d8474;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd198('0x0'),_0xd198('0x1'),_0xd198('0x2')];function createListener(_0x6f6671,_0x51cdcc){return function(_0x480c21){_0x51cdcc[_0xd198('0x3')](_0x6f6671,_0x480c21);};}function removeListener(_0xdc4825,_0x1d8464){return function(){ChatWebsiteEvents[_0xd198('0x4')](_0xdc4825,_0x1d8464);};}exports[_0xd198('0x5')]=function(_0x5ce33b){for(var _0x390d6d=0x0,_0x4ac82f=events[_0xd198('0x6')];_0x390d6d<_0x4ac82f;_0x390d6d++){var _0x577e98=events[_0x390d6d];var _0x1c2747=createListener('chatWebsite:'+_0x577e98,_0x5ce33b);ChatWebsiteEvents['on'](_0x577e98,_0x1c2747);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index c050349..6b1d50f 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 _0xf93d=['server/files/images/logos/','format','%s-%s','now','/:id/logo','single','addLogo','server/files/images/avatars/','originalname','file','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','extname','replace','any','offline','/:id/applications','addApplications','addProactiveActions','addAgents','update','delete','removeDispositions','removeAgents','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','diskStorage','join','root'];(function(_0x106f32,_0x17a206){var _0x37c5c1=function(_0x3a2e8a){while(--_0x3a2e8a){_0x106f32['push'](_0x106f32['shift']());}};_0x37c5c1(++_0x17a206);}(_0xf93d,0x66));var _0xdf93=function(_0x1ead47,_0x2d2868){_0x1ead47=_0x1ead47-0x0;var _0x5731e0=_0xf93d[_0x1ead47];return _0x5731e0;};'use strict';var multer=require(_0xdf93('0x0'));var util=require('util');var path=require(_0xdf93('0x1'));var timeout=require('connect-timeout');var express=require(_0xdf93('0x2'));var router=express[_0xdf93('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdf93('0x4'));var interaction=require(_0xdf93('0x5'));var config=require(_0xdf93('0x6'));var controller=require('./chatWebsite.controller');router[_0xdf93('0x7')]('/',auth['isAuthenticated'](),controller[_0xdf93('0x8')]);router[_0xdf93('0x7')](_0xdf93('0x9'),auth['isAuthenticated'](),controller[_0xdf93('0xa')]);router[_0xdf93('0x7')](_0xdf93('0xb'),auth[_0xdf93('0xc')](),controller[_0xdf93('0xd')]);router[_0xdf93('0x7')](_0xdf93('0xe'),auth[_0xdf93('0xc')](),controller[_0xdf93('0xf')]);router[_0xdf93('0x7')](_0xdf93('0x10'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x11')]);router[_0xdf93('0x7')]('/:id/logo',controller[_0xdf93('0x12')]);router[_0xdf93('0x7')](_0xdf93('0x13'),controller['getAvatar']);router[_0xdf93('0x7')](_0xdf93('0x14'),controller[_0xdf93('0x15')]);router[_0xdf93('0x7')](_0xdf93('0x16'),controller[_0xdf93('0x17')]);router[_0xdf93('0x7')](_0xdf93('0x18'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x19')]);router['get'](_0xdf93('0x1a'),controller['getSnippet']);router[_0xdf93('0x7')]('/:id/applications',auth[_0xdf93('0xc')](),controller['getApplications']);router['get'](_0xdf93('0x1b'),auth['isAuthenticated'](),controller[_0xdf93('0x1c')]);router[_0xdf93('0x7')](_0xdf93('0x1d'),controller[_0xdf93('0x1e')]);router['get'](_0xdf93('0x1f'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x20')]);router[_0xdf93('0x7')](_0xdf93('0x21'),auth['isAuthenticated'](),controller[_0xdf93('0x22')]);router[_0xdf93('0x23')]('/',auth['isAuthenticated'](),controller[_0xdf93('0x24')]);router[_0xdf93('0x23')](_0xdf93('0xe'),auth[_0xdf93('0xc')](),controller['addDisposition']);router[_0xdf93('0x23')](_0xdf93('0x10'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x21c76c,_0x3e1f6b,_0x3f2a6d){_0x3f2a6d(null,path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x28')));},'filename':function(_0x3ffb6c,_0x43accd,_0x47082d){_0x47082d(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date[_0xdf93('0x2b')](),_0x43accd['originalname']));}})});router[_0xdf93('0x23')](_0xdf93('0x2c'),upload[_0xdf93('0x2d')]('file'),controller[_0xdf93('0x2e')]);var upload=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x5cfba3,_0x426480,_0x1d281c){_0x1d281c(null,path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x2f')));},'filename':function(_0x165452,_0x55d3dc,_0x5a2a64){_0x5a2a64(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date[_0xdf93('0x2b')](),_0x55d3dc[_0xdf93('0x30')]));}})});router[_0xdf93('0x23')](_0xdf93('0x13'),upload[_0xdf93('0x2d')](_0xdf93('0x31')),controller[_0xdf93('0x32')]);var upload=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x1f83fc,_0x1c5d52,_0xde599c){_0xde599c(null,path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x2f')));},'filename':function(_0x4cb651,_0x5d10f8,_0x1245c3){_0x1245c3(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date[_0xdf93('0x2b')](),_0x5d10f8[_0xdf93('0x30')]));}})});router[_0xdf93('0x23')]('/:id/customer_avatar',upload[_0xdf93('0x2d')](_0xdf93('0x31')),controller[_0xdf93('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a1f20,_0x3e7e84,_0x549c97){_0x549c97(null,path[_0xdf93('0x26')](config['root'],_0xdf93('0x2f')));},'filename':function(_0xcf8773,_0x5f3cb3,_0x28aed7){_0x28aed7(null,util[_0xdf93('0x29')](_0xdf93('0x2a'),Date['now'](),_0x5f3cb3['originalname']));}})});router[_0xdf93('0x23')]('/:id/system_avatar',upload[_0xdf93('0x2d')](_0xdf93('0x31')),controller[_0xdf93('0x34')]);router[_0xdf93('0x23')](_0xdf93('0x35'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdf93('0x25')]({'destination':function(_0x14db21,_0x2f1847,_0x2deadf){const _0x4efb4f=path[_0xdf93('0x26')](config[_0xdf93('0x27')],_0xdf93('0x36'),_0xdf93('0x37'),_0xdf93('0x38'));fs_extra[_0xdf93('0x39')](_0x4efb4f,function(){_0x2deadf(null,_0x4efb4f);});},'filename':function(_0x4cf0c7,_0x291b28,_0x523dce){const _0x10d6a9=_0x291b28[_0xdf93('0x30')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xac4229=path[_0xdf93('0x3a')](_0x10d6a9);const _0x4bd4e6=Date['now']()+'-'+_0x10d6a9[_0xdf93('0x3b')](_0xac4229,'')+_0xac4229;_0x523dce(null,_0x4bd4e6);}})});router[_0xdf93('0x23')]('/:id/offline',offlineUploadMulter[_0xdf93('0x3c')](),controller[_0xdf93('0x3d')]);router['post']('/:id/interactions',auth[_0xdf93('0xc')](),controller['addInteraction']);router[_0xdf93('0x23')](_0xdf93('0x3e'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x3f')]);router[_0xdf93('0x23')](_0xdf93('0x1b'),auth['isAuthenticated'](),controller[_0xdf93('0x40')]);router['post'](_0xdf93('0x21'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x41')]);router['put']('/:id',auth[_0xdf93('0xc')](),controller[_0xdf93('0x42')]);router[_0xdf93('0x43')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xdf93('0x43')](_0xdf93('0xe'),auth[_0xdf93('0xc')](),controller[_0xdf93('0x44')]);router[_0xdf93('0x43')]('/:id/canned_answers',auth[_0xdf93('0xc')](),controller['removeAnswers']);router[_0xdf93('0x43')](_0xdf93('0x21'),auth['isAuthenticated'](),controller[_0xdf93('0x45')]);module[_0xdf93('0x46')]=router; \ No newline at end of file +var _0xc84d=['Router','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','file','addLogo','server/files/images/avatars/','now','/:id/avatar','addAvatar','single','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','offline','addApplications','delete','destroy','removeDispositions','removeAnswers','multer','util','connect-timeout','express'];(function(_0x56f937,_0x58d121){var _0x297fad=function(_0x5456a5){while(--_0x5456a5){_0x56f937['push'](_0x56f937['shift']());}};_0x297fad(++_0x58d121);}(_0xc84d,0x114));var _0xdc84=function(_0x1d757a,_0xf81a72){_0x1d757a=_0x1d757a-0x0;var _0x1d3ed7=_0xc84d[_0x1d757a];return _0x1d3ed7;};'use strict';var multer=require(_0xdc84('0x0'));var util=require(_0xdc84('0x1'));var path=require('path');var timeout=require(_0xdc84('0x2'));var express=require(_0xdc84('0x3'));var router=express[_0xdc84('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdc84('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdc84('0x6'));var controller=require(_0xdc84('0x7'));router[_0xdc84('0x8')]('/',auth[_0xdc84('0x9')](),controller[_0xdc84('0xa')]);router[_0xdc84('0x8')](_0xdc84('0xb'),auth[_0xdc84('0x9')](),controller[_0xdc84('0xc')]);router[_0xdc84('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xdc84('0xd')]);router[_0xdc84('0x8')]('/:id/dispositions',auth[_0xdc84('0x9')](),controller[_0xdc84('0xe')]);router[_0xdc84('0x8')](_0xdc84('0xf'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x10')]);router[_0xdc84('0x8')](_0xdc84('0x11'),controller[_0xdc84('0x12')]);router[_0xdc84('0x8')]('/:id/avatar',controller[_0xdc84('0x13')]);router['get'](_0xdc84('0x14'),controller['getCustomerAvatar']);router[_0xdc84('0x8')](_0xdc84('0x15'),controller[_0xdc84('0x16')]);router['get'](_0xdc84('0x17'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x18')]);router['get'](_0xdc84('0x19'),controller['getSnippet']);router['get'](_0xdc84('0x1a'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x1b')]);router[_0xdc84('0x8')](_0xdc84('0x1c'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x1d')]);router['get'](_0xdc84('0x1e'),controller[_0xdc84('0x1f')]);router[_0xdc84('0x8')](_0xdc84('0x20'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x21')]);router['get'](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['getAgents']);router[_0xdc84('0x23')]('/',auth[_0xdc84('0x9')](),controller[_0xdc84('0x24')]);router[_0xdc84('0x23')](_0xdc84('0x25'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x26')]);router['post'](_0xdc84('0xf'),auth['isAuthenticated'](),controller[_0xdc84('0x27')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x26dee3,_0x393e87,_0x5ec070){_0x5ec070(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x2b')));},'filename':function(_0x56d843,_0x5c307c,_0x3587c1){_0x3587c1(null,util[_0xdc84('0x2c')](_0xdc84('0x2d'),Date['now'](),_0x5c307c[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x11'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x30')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x120624,_0x5184f0,_0x468caa){_0x468caa(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x31')));},'filename':function(_0x29f0e3,_0x5c9fd7,_0x4637f5){_0x4637f5(null,util[_0xdc84('0x2c')](_0xdc84('0x2d'),Date[_0xdc84('0x32')](),_0x5c9fd7[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x33'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x34')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x38af6f,_0x4a4105,_0x2aba01){_0x2aba01(null,path['join'](config['root'],_0xdc84('0x31')));},'filename':function(_0xd1a1c7,_0x31c351,_0x2eb6c7){_0x2eb6c7(null,util[_0xdc84('0x2c')]('%s-%s',Date[_0xdc84('0x32')](),_0x31c351['originalname']));}})});router['post'](_0xdc84('0x14'),upload[_0xdc84('0x35')](_0xdc84('0x2f')),controller[_0xdc84('0x36')]);var upload=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x1a21a4,_0x5bb167,_0x38df93){_0x38df93(null,path[_0xdc84('0x29')](config[_0xdc84('0x2a')],_0xdc84('0x31')));},'filename':function(_0x555dac,_0x341b5e,_0x19e799){_0x19e799(null,util['format'](_0xdc84('0x2d'),Date[_0xdc84('0x32')](),_0x341b5e[_0xdc84('0x2e')]));}})});router[_0xdc84('0x23')](_0xdc84('0x15'),upload['single'](_0xdc84('0x2f')),controller[_0xdc84('0x37')]);router[_0xdc84('0x23')](_0xdc84('0x38'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xdc84('0x28')]({'destination':function(_0x219b44,_0x4d40f1,_0x33710f){const _0x74e6e6=path[_0xdc84('0x29')](config['root'],_0xdc84('0x39'),_0xdc84('0x3a'),_0xdc84('0x3b'));fs_extra[_0xdc84('0x3c')](_0x74e6e6,function(){_0x33710f(null,_0x74e6e6);});},'filename':function(_0x428aae,_0xdd78d9,_0x7aa21d){const _0x49c4d8=_0xdd78d9[_0xdc84('0x2e')][_0xdc84('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5b94c1=path[_0xdc84('0x3e')](_0x49c4d8);const _0x4c244b=Date[_0xdc84('0x32')]()+'-'+_0x49c4d8['replace'](_0x5b94c1,'')+_0x5b94c1;_0x7aa21d(null,_0x4c244b);}})});router['post'](_0xdc84('0x3f'),offlineUploadMulter['any'](),controller[_0xdc84('0x40')]);router[_0xdc84('0x23')](_0xdc84('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xdc84('0x23')](_0xdc84('0x1a'),auth['isAuthenticated'](),controller[_0xdc84('0x41')]);router[_0xdc84('0x23')](_0xdc84('0x1c'),auth[_0xdc84('0x9')](),controller['addProactiveActions']);router[_0xdc84('0x23')](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0xdc84('0x9')](),controller['update']);router[_0xdc84('0x42')]('/:id',auth[_0xdc84('0x9')](),controller[_0xdc84('0x43')]);router[_0xdc84('0x42')]('/:id/dispositions',auth[_0xdc84('0x9')](),controller[_0xdc84('0x44')]);router[_0xdc84('0x42')](_0xdc84('0xf'),auth[_0xdc84('0x9')](),controller[_0xdc84('0x45')]);router[_0xdc84('0x42')](_0xdc84('0x22'),auth[_0xdc84('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index c977426..f6874d5 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 _0x25fa=['Google','sequelize','STRING','ENUM'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x25fa,0x109));var _0xa25f=function(_0x50f6ab,_0x4a9425){_0x50f6ab=_0x50f6ab-0x0;var _0xfeeac=_0x25fa[_0x50f6ab];return _0xfeeac;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa25f('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa25f('0x2')]('AmazonAWS',_0xa25f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0xa25f('0x1')]},'data2':{'type':Sequelize[_0xa25f('0x1')]}}; \ No newline at end of file +var _0x038b=['exports','STRING','ENUM','Google'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x038b,0x114));var _0xb038=function(_0x32d626,_0x3e794b){_0x32d626=_0x32d626-0x0;var _0x5099b5=_0x038b[_0x32d626];return _0x5099b5;};'use strict';var Sequelize=require('sequelize');module[_0xb038('0x0')]={'name':{'type':Sequelize[_0xb038('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xb038('0x2')]('AmazonAWS',_0xb038('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xb038('0x1')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index acc2cb7..60074f4 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 _0x2032=['body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','CloudProvider','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','rows','show','params','keys','rawAttributes','includeAll','find','catch'];(function(_0x184dee,_0x398ee0){var _0x21303b=function(_0x1e5103){while(--_0x1e5103){_0x184dee['push'](_0x184dee['shift']());}};_0x21303b(++_0x398ee0);}(_0x2032,0xd9));var _0x2203=function(_0x37ec58,_0x3e5596){_0x37ec58=_0x37ec58-0x0;var _0x36240e=_0x2032[_0x37ec58];return _0x36240e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'all':!![]}];}return db[_0x2203('0x2c')]['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x446209){_0x34b8ba[_0x2203('0x3f')]=_0x446209;return _0x34b8ba;})['then'](respondWithFilteredResult(_0x1df508,_0x9c53f))['catch'](handleError(_0x1df508,null));};exports[_0x2203('0x40')]=function(_0x3739f6,_0x368444){var _0x1e09f3={'raw':!![],'where':{'id':_0x3739f6[_0x2203('0x41')]['id']}},_0x372709={};_0x372709['model']=_[_0x2203('0x42')](db[_0x2203('0x2c')][_0x2203('0x43')]);_0x372709[_0x2203('0x30')]=_[_0x2203('0x42')](_0x3739f6[_0x2203('0x30')]);_0x372709[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],_0x372709[_0x2203('0x30')]);_0x1e09f3['attributes']=_[_0x2203('0x33')](_0x372709[_0x2203('0x31')],qs[_0x2203('0x34')](_0x3739f6[_0x2203('0x30')]['fields']));_0x1e09f3['attributes']=_0x1e09f3[_0x2203('0x32')]['length']?_0x1e09f3[_0x2203('0x32')]:_0x372709[_0x2203('0x31')];if(_0x3739f6[_0x2203('0x30')][_0x2203('0x44')]){_0x1e09f3['include']=[{'all':!![]}];}_0x1e09f3=_[_0x2203('0x3c')]({},_0x1e09f3,_0x3739f6[_0x2203('0x3e')]);return db['CloudProvider'][_0x2203('0x45')](_0x1e09f3)[_0x2203('0x23')](handleEntityNotFound(_0x368444,null))[_0x2203('0x23')](respondWithResult(_0x368444,null))[_0x2203('0x46')](handleError(_0x368444,null));};exports['create']=function(_0x4c1a29,_0x21b8ab){return db['CloudProvider']['create'](_0x4c1a29[_0x2203('0x47')],{})[_0x2203('0x23')](respondWithResult(_0x21b8ab,0xc9))[_0x2203('0x46')](handleError(_0x21b8ab,null));};exports['update']=function(_0x4c1496,_0x131aec){if(_0x4c1496[_0x2203('0x47')]['id']){delete _0x4c1496[_0x2203('0x47')]['id'];}return db[_0x2203('0x2c')][_0x2203('0x45')]({'where':{'id':_0x4c1496[_0x2203('0x41')]['id']}})['then'](handleEntityNotFound(_0x131aec,null))[_0x2203('0x23')](saveUpdates(_0x4c1496['body'],null))[_0x2203('0x23')](respondWithResult(_0x131aec,null))[_0x2203('0x46')](handleError(_0x131aec,null));};exports[_0x2203('0x24')]=function(_0x1e49dd,_0x58b9bb){return db['CloudProvider'][_0x2203('0x45')]({'where':{'id':_0x1e49dd[_0x2203('0x41')]['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x58b9bb,null))[_0x2203('0x23')](removeEntity(_0x58b9bb,null))['catch'](handleError(_0x58b9bb,null));}; \ No newline at end of file +var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','findAll','rows','catch','keys','find','body','params','destroy','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'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ac2ed,_0x60b800){_0x3ac2ed=_0x3ac2ed-0x0;var _0x56b758=_0x5f2f[_0x3ac2ed];return _0x56b758;};'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')]=[{'all':!![]}];}return db[_0xf5f2('0x29')][_0xf5f2('0x3e')](_0x22c826);})[_0xf5f2('0x24')](function(_0x574f24){_0x11c771[_0xf5f2('0x3f')]=_0x574f24;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x40')](handleError(_0x53cb96,null));};exports['show']=function(_0x509dbc,_0x59eb00){var _0x76d21b={'raw':!![],'where':{'id':_0x509dbc['params']['id']}},_0x2ad13c={};_0x2ad13c[_0xf5f2('0x31')]=_[_0xf5f2('0x41')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x2ad13c[_0xf5f2('0x2e')]=_[_0xf5f2('0x41')](_0x509dbc[_0xf5f2('0x2e')]);_0x2ad13c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],_0x2ad13c[_0xf5f2('0x2e')]);_0x76d21b[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x2ad13c[_0xf5f2('0x31')],qs['fields'](_0x509dbc[_0xf5f2('0x2e')]['fields']));_0x76d21b[_0xf5f2('0x32')]=_0x76d21b[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x76d21b[_0xf5f2('0x32')]:_0x2ad13c[_0xf5f2('0x31')];if(_0x509dbc[_0xf5f2('0x2e')]['includeAll']){_0x76d21b[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x76d21b=_[_0xf5f2('0x39')]({},_0x76d21b,_0x509dbc[_0xf5f2('0x3b')]);return db[_0xf5f2('0x29')][_0xf5f2('0x42')](_0x76d21b)[_0xf5f2('0x24')](handleEntityNotFound(_0x59eb00,null))[_0xf5f2('0x24')](respondWithResult(_0x59eb00,null))[_0xf5f2('0x40')](handleError(_0x59eb00,null));};exports['create']=function(_0x35dece,_0x33ec29){return db[_0xf5f2('0x29')]['create'](_0x35dece[_0xf5f2('0x43')],{})[_0xf5f2('0x24')](respondWithResult(_0x33ec29,0xc9))[_0xf5f2('0x40')](handleError(_0x33ec29,null));};exports['update']=function(_0x57a7cb,_0x7bb942){if(_0x57a7cb[_0xf5f2('0x43')]['id']){delete _0x57a7cb['body']['id'];}return db[_0xf5f2('0x29')]['find']({'where':{'id':_0x57a7cb[_0xf5f2('0x44')]['id']}})['then'](handleEntityNotFound(_0x7bb942,null))[_0xf5f2('0x24')](saveUpdates(_0x57a7cb['body'],null))[_0xf5f2('0x24')](respondWithResult(_0x7bb942,null))[_0xf5f2('0x40')](handleError(_0x7bb942,null));};exports[_0xf5f2('0x45')]=function(_0x11a083,_0x4fa738){return db[_0xf5f2('0x29')][_0xf5f2('0x42')]({'where':{'id':_0x11a083['params']['id']}})['then'](handleEntityNotFound(_0x4fa738,null))[_0xf5f2('0x24')](removeEntity(_0x4fa738,null))[_0xf5f2('0x40')](handleError(_0x4fa738,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 2ed1706..0a91bbb 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 _0x607c=['../../config/logger','api','moment','request-promise','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x607c,0xe2));var _0xc607=function(_0x3b0b72,_0x2514bc){_0x3b0b72=_0x3b0b72-0x0;var _0x39bde6=_0x607c[_0x3b0b72];return _0x39bde6;};'use strict';var _=require(_0xc607('0x0'));var util=require(_0xc607('0x1'));var logger=require(_0xc607('0x2'))(_0xc607('0x3'));var moment=require(_0xc607('0x4'));var BPromise=require('bluebird');var rp=require(_0xc607('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc607('0x6'));var attributes=require(_0xc607('0x7'));module[_0xc607('0x8')]=function(_0x20df35,_0x4d395a){return _0x20df35[_0xc607('0x9')](_0xc607('0xa'),attributes,{'tableName':_0xc607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc17=['path','rimraf','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','lodash','../../config/logger','api','request-promise'];(function(_0x321283,_0x4aa366){var _0xf8a248=function(_0x234762){while(--_0x234762){_0x321283['push'](_0x321283['shift']());}};_0xf8a248(++_0x4aa366);}(_0xfc17,0x1b4));var _0x7fc1=function(_0x35239e,_0x5463a1){_0x35239e=_0x35239e-0x0;var _0x265c79=_0xfc17[_0x35239e];return _0x265c79;};'use strict';var _=require(_0x7fc1('0x0'));var util=require('util');var logger=require(_0x7fc1('0x1'))(_0x7fc1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7fc1('0x3'));var fs=require('fs');var path=require(_0x7fc1('0x4'));var rimraf=require(_0x7fc1('0x5'));var config=require(_0x7fc1('0x6'));var attributes=require(_0x7fc1('0x7'));module[_0x7fc1('0x8')]=function(_0x33c6d9,_0x17d8a3){return _0x33c6d9[_0x7fc1('0x9')](_0x7fc1('0xa'),attributes,{'tableName':'cloud_providers','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 4ec623a..32284f0 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 _0x0137=['http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x0137,0x1d8));var _0x7013=function(_0x2a390b,_0xf49f9b){_0x2a390b=_0x2a390b-0x0;var _0x5df10a=_0x0137[_0x2a390b];return _0x5df10a;};'use strict';var _=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var moment=require(_0x7013('0x2'));var BPromise=require(_0x7013('0x3'));var rs=require(_0x7013('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7013('0x5'))['db'];var utils=require(_0x7013('0x6'));var logger=require(_0x7013('0x7'))(_0x7013('0x8'));var config=require(_0x7013('0x9'));var jayson=require(_0x7013('0xa'));var client=jayson['client'][_0x7013('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x346a4d,_0x4e2460,_0x16c0c8){return new BPromise(function(_0x16dae3,_0x1b748c){return client['request'](_0x346a4d,_0x16c0c8)[_0x7013('0xc')](function(_0x551b8a){logger[_0x7013('0xd')](_0x7013('0xe'),_0x4e2460,'request\x20sent');logger[_0x7013('0xf')](_0x7013('0x10'),_0x4e2460,_0x7013('0x11'),JSON[_0x7013('0x12')](_0x551b8a));if(_0x551b8a[_0x7013('0x13')]){if(_0x551b8a[_0x7013('0x13')]['code']===0x1f4){logger[_0x7013('0x13')](_0x7013('0xe'),_0x4e2460,_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);return _0x1b748c(_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);}logger[_0x7013('0x13')](_0x7013('0xe'),_0x4e2460,_0x551b8a[_0x7013('0x13')][_0x7013('0x14')]);return _0x16dae3(_0x551b8a[_0x7013('0x13')]['message']);}else{logger['info'](_0x7013('0xe'),_0x4e2460,_0x7013('0x11'));_0x16dae3(_0x551b8a[_0x7013('0x15')][_0x7013('0x14')]);}})[_0x7013('0x16')](function(_0x48614e){logger['error'](_0x7013('0xe'),_0x4e2460,_0x48614e);_0x1b748c(_0x48614e);});});} \ No newline at end of file +var _0x13cc=['../../config/environment','client','request','then','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','CloudProvider,\x20%s,\x20%s','info','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x253141,_0x396c1e){var _0x4472f3=function(_0x28b591){while(--_0x28b591){_0x253141['push'](_0x253141['shift']());}};_0x4472f3(++_0x396c1e);}(_0x13cc,0x161));var _0xc13c=function(_0x2e7f71,_0xb8d20c){_0x2e7f71=_0x2e7f71-0x0;var _0x145b93=_0x13cc[_0x2e7f71];return _0x145b93;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc13c('0x0'));var BPromise=require(_0xc13c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc13c('0x2'));var db=require(_0xc13c('0x3'))['db'];var utils=require(_0xc13c('0x4'));var logger=require(_0xc13c('0x5'))(_0xc13c('0x6'));var config=require(_0xc13c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc13c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b0b4,_0x41b41b,_0x4889d6){return new BPromise(function(_0x318eab,_0x3570f3){return client[_0xc13c('0x9')](_0x18b0b4,_0x4889d6)[_0xc13c('0xa')](function(_0x5ee2aa){logger['info']('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));logger[_0xc13c('0xc')](_0xc13c('0xd'),_0x41b41b,_0xc13c('0xb'),JSON[_0xc13c('0xe')](_0x5ee2aa));if(_0x5ee2aa['error']){if(_0x5ee2aa[_0xc13c('0xf')]['code']===0x1f4){logger[_0xc13c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0x5ee2aa['error'][_0xc13c('0x10')]);return _0x3570f3(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);return _0x318eab(_0x5ee2aa[_0xc13c('0xf')][_0xc13c('0x10')]);}else{logger[_0xc13c('0x12')]('CloudProvider,\x20%s,\x20%s',_0x41b41b,_0xc13c('0xb'));_0x318eab(_0x5ee2aa[_0xc13c('0x13')][_0xc13c('0x10')]);}})['catch'](function(_0x93cb3b){logger[_0xc13c('0xf')](_0xc13c('0x11'),_0x41b41b,_0x93cb3b);_0x3570f3(_0x93cb3b);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 84d3c65..200ecb6 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 _0xb1fa=['./cloudProvider.controller','get','isAuthenticated','show','/:id','update','delete','destroy','path','express'];(function(_0x45a793,_0x2a1e72){var _0x2a2c61=function(_0x5d46a0){while(--_0x5d46a0){_0x45a793['push'](_0x45a793['shift']());}};_0x2a2c61(++_0x2a1e72);}(_0xb1fa,0x9e));var _0xab1f=function(_0x36d921,_0x4f802f){_0x36d921=_0x36d921-0x0;var _0x48d9a3=_0xb1fa[_0x36d921];return _0x48d9a3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xab1f('0x0'));var timeout=require('connect-timeout');var express=require(_0xab1f('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xab1f('0x2'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xab1f('0x3')]('/:id',auth[_0xab1f('0x4')](),controller[_0xab1f('0x5')]);router['post']('/',auth[_0xab1f('0x4')](),controller['create']);router['put'](_0xab1f('0x6'),auth[_0xab1f('0x4')](),controller[_0xab1f('0x7')]);router[_0xab1f('0x8')](_0xab1f('0x6'),auth['isAuthenticated'](),controller[_0xab1f('0x9')]);module['exports']=router; \ No newline at end of file +var _0xfa2c=['index','/:id','show','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa2c,0xda));var _0xcfa2=function(_0x2c8bee,_0xbdef90){_0x2c8bee=_0x2c8bee-0x0;var _0xd6335e=_0xfa2c[_0x2c8bee];return _0xd6335e;};'use strict';var multer=require(_0xcfa2('0x0'));var util=require(_0xcfa2('0x1'));var path=require(_0xcfa2('0x2'));var timeout=require('connect-timeout');var express=require(_0xcfa2('0x3'));var router=express[_0xcfa2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcfa2('0x5'));var config=require(_0xcfa2('0x6'));var controller=require(_0xcfa2('0x7'));router[_0xcfa2('0x8')]('/',auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xa')]);router[_0xcfa2('0x8')](_0xcfa2('0xb'),auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xc')]);router[_0xcfa2('0xd')]('/',auth[_0xcfa2('0x9')](),controller[_0xcfa2('0xe')]);router[_0xcfa2('0xf')](_0xcfa2('0xb'),auth['isAuthenticated'](),controller[_0xcfa2('0x10')]);router[_0xcfa2('0x11')](_0xcfa2('0xb'),auth[_0xcfa2('0x9')](),controller['destroy']);module[_0xcfa2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 94cdc99..4c5c5a8 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 _0xd798=['sequelize','exports','name','STRING'];(function(_0x34f46d,_0x1d6712){var _0x3a2d9e=function(_0x13eaec){while(--_0x13eaec){_0x34f46d['push'](_0x34f46d['shift']());}};_0x3a2d9e(++_0x1d6712);}(_0xd798,0x78));var _0x8d79=function(_0x47d171,_0x462d9b){_0x47d171=_0x47d171-0x0;var _0x110676=_0xd798[_0x47d171];return _0x110676;};'use strict';var Sequelize=require(_0x8d79('0x0'));module[_0x8d79('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8d79('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x8d79('0x3')]},'companyId':{'type':Sequelize[_0x8d79('0x3')]},'website':{'type':Sequelize[_0x8d79('0x3')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8d79('0x3')]},'type':{'type':Sequelize[_0x8d79('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8d79('0x3')]},'city':{'type':Sequelize[_0x8d79('0x3')]},'country':{'type':Sequelize[_0x8d79('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x8d79('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x8d79('0x3')]},'sCountry':{'type':Sequelize[_0x8d79('0x3')]},'description':{'type':Sequelize[_0x8d79('0x3')]}}; \ No newline at end of file +var _0x43ce=['exports','STRING','name','sequelize'];(function(_0x5eb584,_0x8fbc2d){var _0x5f4a0f=function(_0x565a1d){while(--_0x565a1d){_0x5eb584['push'](_0x5eb584['shift']());}};_0x5f4a0f(++_0x8fbc2d);}(_0x43ce,0x14b));var _0xe43c=function(_0x31f2be,_0xf21d6b){_0x31f2be=_0x31f2be-0x0;var _0x1ccae0=_0x43ce[_0x31f2be];return _0x1ccae0;};'use strict';var Sequelize=require(_0xe43c('0x0'));module[_0xe43c('0x1')]={'name':{'type':Sequelize[_0xe43c('0x2')],'unique':_0xe43c('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xe43c('0x2')]},'companyId':{'type':Sequelize[_0xe43c('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xe43c('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xe43c('0x2')]},'postalCode':{'type':Sequelize[_0xe43c('0x2')]},'city':{'type':Sequelize[_0xe43c('0x2')]},'country':{'type':Sequelize[_0xe43c('0x2')]},'email':{'type':Sequelize[_0xe43c('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xe43c('0x2')]},'sStreet':{'type':Sequelize[_0xe43c('0x2')]},'sPostalCode':{'type':Sequelize[_0xe43c('0x2')]},'sCity':{'type':Sequelize[_0xe43c('0x2')]},'sCountry':{'type':Sequelize[_0xe43c('0x2')]},'description':{'type':Sequelize[_0xe43c('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index b9e8b5d..95276ee 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 _0xb713=['../../config/logger','api','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','status','error','stack','name','send','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','findAll','rows','catch','show','rawAttributes','includeAll','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0xb713,0x14b));var _0x3b71=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xb713[_0x344a3f];return _0x264712;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b71('0x0'));var zipdir=require(_0x3b71('0x1'));var jsonpatch=require(_0x3b71('0x2'));var rp=require(_0x3b71('0x3'));var moment=require('moment');var BPromise=require(_0x3b71('0x4'));var Mustache=require(_0x3b71('0x5'));var util=require(_0x3b71('0x6'));var path=require(_0x3b71('0x7'));var sox=require(_0x3b71('0x8'));var csv=require(_0x3b71('0x9'));var ejs=require(_0x3b71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b71('0xb'));var squel=require(_0x3b71('0xc'));var crypto=require('crypto');var jsforce=require(_0x3b71('0xd'));var deskjs=require(_0x3b71('0xe'));var toCsv=require(_0x3b71('0x9'));var querystring=require(_0x3b71('0xf'));var Papa=require(_0x3b71('0x10'));var Redis=require(_0x3b71('0x11'));var authService=require(_0x3b71('0x12'));var qs=require(_0x3b71('0x13'));var as=require(_0x3b71('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b71('0x15'))(_0x3b71('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b71('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f39f2,_0x1f860f){_0x1f860f=_0x1f860f||0xcc;return function(_0x3e3124){if(_0x3e3124){return _0x1f39f2[_0x3b71('0x18')](_0x1f860f);}return _0x1f39f2['status'](_0x1f860f)[_0x3b71('0x19')]();};}function respondWithResult(_0x568af5,_0x29e860){_0x29e860=_0x29e860||0xc8;return function(_0x40f834){if(_0x40f834){return _0x568af5['status'](_0x29e860)[_0x3b71('0x1a')](_0x40f834);}};}function respondWithFilteredResult(_0x22ac5a,_0x17c56d){return function(_0x374b66){if(_0x374b66){var _0x1a90c3=typeof _0x17c56d[_0x3b71('0x1b')]===_0x3b71('0x1c')&&typeof _0x17c56d[_0x3b71('0x1d')]===_0x3b71('0x1c');var _0x341a3e=_0x374b66[_0x3b71('0x1e')];var _0x4a0265=_0x1a90c3?0x0:_0x17c56d[_0x3b71('0x1b')];var _0x401d9f=_0x1a90c3?_0x374b66['count']:_0x17c56d[_0x3b71('0x1b')]+_0x17c56d[_0x3b71('0x1d')];var _0x1f9a52;if(_0x401d9f>=_0x341a3e){_0x401d9f=_0x341a3e;_0x1f9a52=0xc8;}else{_0x1f9a52=0xce;}_0x22ac5a['status'](_0x1f9a52);return _0x22ac5a[_0x3b71('0x1f')](_0x3b71('0x20'),_0x4a0265+'-'+_0x401d9f+'/'+_0x341a3e)[_0x3b71('0x1a')](_0x374b66);}return null;};}function patchUpdates(_0x4c5d4d){return function(_0x17d08a){try{jsonpatch[_0x3b71('0x21')](_0x17d08a,_0x4c5d4d,!![]);}catch(_0x1a5d84){return BPromise[_0x3b71('0x22')](_0x1a5d84);}return _0x17d08a[_0x3b71('0x23')]();};}function saveUpdates(_0x47c88d,_0x39db72){return function(_0x529bb3){if(_0x529bb3){return _0x529bb3[_0x3b71('0x24')](_0x47c88d)[_0x3b71('0x25')](function(_0x16460f){return _0x16460f;});}return null;};}function removeEntity(_0x41be09,_0x30ad0e){return function(_0x11ee43){if(_0x11ee43){return _0x11ee43[_0x3b71('0x26')]()[_0x3b71('0x25')](function(){var _0x306865=_0x11ee43[_0x3b71('0x27')]({'plain':!![]});var _0x452166=_0x3b71('0x28');return db[_0x3b71('0x29')][_0x3b71('0x26')]({'where':{'type':_0x452166,'resourceId':_0x306865['id']}})[_0x3b71('0x25')](function(){return _0x11ee43;});})[_0x3b71('0x25')](function(){_0x41be09[_0x3b71('0x2a')](0xcc)[_0x3b71('0x19')]();});}};}function handleEntityNotFound(_0x5c06e9,_0x48daa4){return function(_0x5753ce){if(!_0x5753ce){_0x5c06e9[_0x3b71('0x18')](0x194);}return _0x5753ce;};}function handleError(_0x3bb594,_0x2ca11e){_0x2ca11e=_0x2ca11e||0x1f4;return function(_0x4f4ac0){logger[_0x3b71('0x2b')](_0x4f4ac0[_0x3b71('0x2c')]);if(_0x4f4ac0[_0x3b71('0x2d')]){delete _0x4f4ac0[_0x3b71('0x2d')];}_0x3bb594[_0x3b71('0x2a')](_0x2ca11e)[_0x3b71('0x2e')](_0x4f4ac0);};}exports['index']=function(_0x3e0ec1,_0x2ac28b){var _0x336d17={},_0x484aca={},_0x3e386f={'count':0x0,'rows':[]};return db[_0x3b71('0x2f')]['describe']()[_0x3b71('0x25')](function(_0x23243b){_0x484aca[_0x3b71('0x30')]=_[_0x3b71('0x31')](_0x23243b);_0x484aca[_0x3b71('0x32')]=_['keys'](_0x3e0ec1[_0x3b71('0x32')]);_0x484aca[_0x3b71('0x33')]=_[_0x3b71('0x34')](_0x484aca[_0x3b71('0x30')],_0x484aca[_0x3b71('0x32')]);_0x336d17[_0x3b71('0x35')]=_[_0x3b71('0x34')](_0x484aca[_0x3b71('0x30')],qs['fields'](_0x3e0ec1[_0x3b71('0x32')][_0x3b71('0x36')]));_0x336d17[_0x3b71('0x35')]=_0x336d17[_0x3b71('0x35')][_0x3b71('0x37')]?_0x336d17[_0x3b71('0x35')]:_0x484aca[_0x3b71('0x30')];if(!_0x3e0ec1['query'][_0x3b71('0x38')]('nolimit')){_0x336d17[_0x3b71('0x1d')]=qs['limit'](_0x3e0ec1['query'][_0x3b71('0x1d')]);_0x336d17[_0x3b71('0x1b')]=qs[_0x3b71('0x1b')](_0x3e0ec1[_0x3b71('0x32')]['offset']);}_0x336d17[_0x3b71('0x39')]=qs[_0x3b71('0x3a')](_0x3e0ec1[_0x3b71('0x32')]['sort']);_0x336d17[_0x3b71('0x3b')]=qs[_0x3b71('0x33')](_[_0x3b71('0x3c')](_0x3e0ec1[_0x3b71('0x32')],_0x484aca[_0x3b71('0x33')]),_0x23243b);if(_0x3e0ec1['query']['filter']){_0x336d17[_0x3b71('0x3b')]=_['merge'](_0x336d17[_0x3b71('0x3b')],{'$or':_['map'](_0x336d17[_0x3b71('0x35')],function(_0x1ca407){var _0x481f21={};_0x481f21[_0x1ca407]={'$like':'%'+_0x3e0ec1[_0x3b71('0x32')][_0x3b71('0x3d')]+'%'};return _0x481f21;})});}_0x336d17=_[_0x3b71('0x3e')]({},_0x336d17,_0x3e0ec1[_0x3b71('0x3f')]);var _0x21d3eb={'where':_0x336d17[_0x3b71('0x3b')]};return db[_0x3b71('0x2f')][_0x3b71('0x1e')](_0x21d3eb)[_0x3b71('0x25')](function(_0x187871){_0x3e386f[_0x3b71('0x1e')]=_0x187871;if(_0x3e0ec1['query']['includeAll']){_0x336d17['include']=[{'all':!![]}];}return db[_0x3b71('0x2f')][_0x3b71('0x40')](_0x336d17);})[_0x3b71('0x25')](function(_0x3fce58){_0x3e386f[_0x3b71('0x41')]=_0x3fce58;return _0x3e386f;})[_0x3b71('0x25')](respondWithFilteredResult(_0x2ac28b,_0x336d17))[_0x3b71('0x42')](handleError(_0x2ac28b,null));})[_0x3b71('0x42')](handleError(_0x2ac28b,null));};exports[_0x3b71('0x43')]=function(_0x141a07,_0x1dda01){var _0x568069={'raw':![],'where':{'id':_0x141a07['params']['id']}},_0x696bc7={};_0x696bc7[_0x3b71('0x30')]=_[_0x3b71('0x31')](db[_0x3b71('0x2f')][_0x3b71('0x44')]);_0x696bc7[_0x3b71('0x32')]=_[_0x3b71('0x31')](_0x141a07[_0x3b71('0x32')]);_0x696bc7[_0x3b71('0x33')]=_[_0x3b71('0x34')](_0x696bc7[_0x3b71('0x30')],_0x696bc7['query']);_0x568069[_0x3b71('0x35')]=_[_0x3b71('0x34')](_0x696bc7[_0x3b71('0x30')],qs[_0x3b71('0x36')](_0x141a07['query']['fields']));_0x568069[_0x3b71('0x35')]=_0x568069[_0x3b71('0x35')][_0x3b71('0x37')]?_0x568069['attributes']:_0x696bc7['model'];if(_0x141a07[_0x3b71('0x32')][_0x3b71('0x45')]){_0x568069[_0x3b71('0x46')]=[{'all':!![]}];}_0x568069=_[_0x3b71('0x3e')]({},_0x568069,_0x141a07[_0x3b71('0x3f')]);return db[_0x3b71('0x2f')][_0x3b71('0x47')](_0x568069)[_0x3b71('0x25')](handleEntityNotFound(_0x1dda01,null))[_0x3b71('0x25')](respondWithResult(_0x1dda01,null))[_0x3b71('0x42')](handleError(_0x1dda01,null));};exports['create']=function(_0x57fdd5,_0x5abe08){return db['CmCompany'][_0x3b71('0x48')](_0x57fdd5[_0x3b71('0x49')],{})[_0x3b71('0x25')](function(_0x1377e9){var _0x34946d=_0x57fdd5[_0x3b71('0x4a')][_0x3b71('0x27')]({'plain':!![]});if(!_0x34946d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34946d[_0x3b71('0x4b')]==='user'){var _0x89c719=_0x1377e9[_0x3b71('0x27')]({'plain':!![]});var _0x563255=_0x3b71('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x563255,'userProfileId':_0x34946d[_0x3b71('0x4c')]},'raw':!![]})[_0x3b71('0x25')](function(_0x502972){if(_0x502972&&_0x502972[_0x3b71('0x4d')]===0x0){return db[_0x3b71('0x29')][_0x3b71('0x48')]({'name':_0x89c719[_0x3b71('0x2d')],'resourceId':_0x89c719['id'],'type':_0x502972[_0x3b71('0x2d')],'sectionId':_0x502972['id']},{})[_0x3b71('0x25')](function(){return _0x1377e9;});}else{return _0x1377e9;}})[_0x3b71('0x42')](function(_0x2c543a){logger[_0x3b71('0x2b')](_0x3b71('0x4e'),_0x2c543a);throw _0x2c543a;});}return _0x1377e9;})[_0x3b71('0x25')](respondWithResult(_0x5abe08,0xc9))[_0x3b71('0x42')](handleError(_0x5abe08,null));};exports[_0x3b71('0x24')]=function(_0x595475,_0x5751da){if(_0x595475['body']['id']){delete _0x595475[_0x3b71('0x49')]['id'];}return db[_0x3b71('0x2f')]['find']({'where':{'id':_0x595475[_0x3b71('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5751da,null))[_0x3b71('0x25')](saveUpdates(_0x595475[_0x3b71('0x49')],null))['then'](respondWithResult(_0x5751da,null))[_0x3b71('0x42')](handleError(_0x5751da,null));};exports[_0x3b71('0x26')]=function(_0x1eb732,_0x55b9c6){return db['CmCompany'][_0x3b71('0x47')]({'where':{'id':_0x1eb732[_0x3b71('0x4f')]['id']}})[_0x3b71('0x25')](handleEntityNotFound(_0x55b9c6,null))[_0x3b71('0x25')](removeEntity(_0x55b9c6,null))[_0x3b71('0x42')](handleError(_0x55b9c6,null));};exports['describe']=function(_0x58f2c4,_0x210c74){return db[_0x3b71('0x2f')][_0x3b71('0x50')]()[_0x3b71('0x25')](respondWithResult(_0x210c74,null))[_0x3b71('0x42')](handleError(_0x210c74,null));};exports[_0x3b71('0x51')]=function(_0x8194fe,_0x27c157,_0x275e91){return db[_0x3b71('0x52')][_0x3b71('0x47')]({'where':{'id':_0x8194fe[_0x3b71('0x4f')]['id']}})[_0x3b71('0x25')](handleEntityNotFound(_0x27c157,null))['then'](function(_0x347f46){if(_0x347f46){return _0x347f46[_0x3b71('0x51')](_0x8194fe['body'][_0x3b71('0x53')],_[_0x3b71('0x54')](_0x8194fe['body'],[_0x3b71('0x53'),'id'])||{});}})[_0x3b71('0x25')](respondWithResult(_0x27c157,null))['catch'](handleError(_0x27c157,null));};exports[_0x3b71('0x55')]=function(_0x590867,_0x10ca73,_0x236b29){var _0x52a188={};var _0x240b24={};var _0x254a93;var _0x3a0c1d;return db[_0x3b71('0x2f')][_0x3b71('0x56')]({'where':{'id':_0x590867['params']['id']}})[_0x3b71('0x25')](handleEntityNotFound(_0x10ca73,null))[_0x3b71('0x25')](function(_0x476892){if(_0x476892){_0x254a93=_0x476892;_0x240b24[_0x3b71('0x30')]=_['keys'](db[_0x3b71('0x52')][_0x3b71('0x44')]);_0x240b24[_0x3b71('0x32')]=_[_0x3b71('0x31')](_0x590867[_0x3b71('0x32')]);_0x240b24[_0x3b71('0x33')]=_[_0x3b71('0x34')](_0x240b24[_0x3b71('0x30')],_0x240b24['query']);_0x52a188[_0x3b71('0x35')]=_[_0x3b71('0x34')](_0x240b24[_0x3b71('0x30')],qs[_0x3b71('0x36')](_0x590867[_0x3b71('0x32')]['fields']));_0x52a188['attributes']=_0x52a188['attributes']['length']?_0x52a188['attributes']:_0x240b24[_0x3b71('0x30')];_0x52a188[_0x3b71('0x39')]=qs[_0x3b71('0x3a')](_0x590867[_0x3b71('0x32')][_0x3b71('0x3a')]);_0x52a188['where']=qs['filters'](_['pick'](_0x590867[_0x3b71('0x32')],_0x240b24[_0x3b71('0x33')]));if(_0x590867[_0x3b71('0x32')][_0x3b71('0x3d')]){_0x52a188[_0x3b71('0x3b')]=_[_0x3b71('0x3e')](_0x52a188[_0x3b71('0x3b')],{'$or':_['map'](_0x52a188[_0x3b71('0x35')],function(_0x4fbedb){var _0x122bba={};_0x122bba[_0x4fbedb]={'$like':'%'+_0x590867[_0x3b71('0x32')][_0x3b71('0x3d')]+'%'};return _0x122bba;})});}_0x52a188=_[_0x3b71('0x3e')]({},_0x52a188,_0x590867[_0x3b71('0x3f')]);return _0x254a93[_0x3b71('0x55')](_0x52a188);}})[_0x3b71('0x25')](function(_0x1395be){if(_0x1395be){_0x3a0c1d=_0x1395be[_0x3b71('0x37')];if(!_0x590867[_0x3b71('0x32')][_0x3b71('0x38')](_0x3b71('0x57'))){_0x52a188[_0x3b71('0x1d')]=qs[_0x3b71('0x1d')](_0x590867['query']['limit']);_0x52a188[_0x3b71('0x1b')]=qs['offset'](_0x590867['query']['offset']);}return _0x254a93['getContacts'](_0x52a188);}})['then'](function(_0x5852c0){if(_0x5852c0){return _0x5852c0?{'count':_0x3a0c1d,'rows':_0x5852c0}:null;}})[_0x3b71('0x25')](respondWithResult(_0x10ca73,null))[_0x3b71('0x42')](handleError(_0x10ca73,null));}; \ No newline at end of file +var _0x756a=['order','sort','where','filter','merge','map','options','CmCompany','includeAll','include','rows','catch','params','rawAttributes','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','addContacts','CmContact','ids','omit','getContacts','pick','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','get','Companies','UserProfileResource','end','stack','name','send','index','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x26f954,_0x406ad6){var _0x5360f7=function(_0x78abd9){while(--_0x78abd9){_0x26f954['push'](_0x26f954['shift']());}};_0x5360f7(++_0x406ad6);}(_0x756a,0x1c0));var _0xa756=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x756a[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0xa756('0x0'));var rimraf=require(_0xa756('0x1'));var zipdir=require(_0xa756('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa756('0x3'));var moment=require(_0xa756('0x4'));var BPromise=require(_0xa756('0x5'));var Mustache=require(_0xa756('0x6'));var util=require(_0xa756('0x7'));var path=require(_0xa756('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa756('0x9'));var fs=require('fs');var fs_extra=require(_0xa756('0xa'));var _=require(_0xa756('0xb'));var squel=require(_0xa756('0xc'));var crypto=require(_0xa756('0xd'));var jsforce=require(_0xa756('0xe'));var deskjs=require(_0xa756('0xf'));var toCsv=require(_0xa756('0x10'));var querystring=require(_0xa756('0x11'));var Papa=require('papaparse');var Redis=require(_0xa756('0x12'));var authService=require(_0xa756('0x13'));var qs=require(_0xa756('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa756('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xa756('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa756('0x17'))['db'];function respondWithStatusCode(_0x32e650,_0x13cbea){_0x13cbea=_0x13cbea||0xcc;return function(_0x80ce5e){if(_0x80ce5e){return _0x32e650[_0xa756('0x18')](_0x13cbea);}return _0x32e650[_0xa756('0x19')](_0x13cbea)['end']();};}function respondWithResult(_0x2d1190,_0x36d3ae){_0x36d3ae=_0x36d3ae||0xc8;return function(_0x15aabf){if(_0x15aabf){return _0x2d1190[_0xa756('0x19')](_0x36d3ae)['json'](_0x15aabf);}};}function respondWithFilteredResult(_0x2e8631,_0x1a590b){return function(_0x341c3f){if(_0x341c3f){var _0x5e4bf8=typeof _0x1a590b[_0xa756('0x1a')]===_0xa756('0x1b')&&typeof _0x1a590b['limit']===_0xa756('0x1b');var _0x50492f=_0x341c3f[_0xa756('0x1c')];var _0x5421e4=_0x5e4bf8?0x0:_0x1a590b[_0xa756('0x1a')];var _0x4340d3=_0x5e4bf8?_0x341c3f[_0xa756('0x1c')]:_0x1a590b[_0xa756('0x1a')]+_0x1a590b[_0xa756('0x1d')];var _0x795302;if(_0x4340d3>=_0x50492f){_0x4340d3=_0x50492f;_0x795302=0xc8;}else{_0x795302=0xce;}_0x2e8631[_0xa756('0x19')](_0x795302);return _0x2e8631['set'](_0xa756('0x1e'),_0x5421e4+'-'+_0x4340d3+'/'+_0x50492f)[_0xa756('0x1f')](_0x341c3f);}return null;};}function patchUpdates(_0x3098b3){return function(_0x186c80){try{jsonpatch[_0xa756('0x20')](_0x186c80,_0x3098b3,!![]);}catch(_0x443230){return BPromise['reject'](_0x443230);}return _0x186c80[_0xa756('0x21')]();};}function saveUpdates(_0x184af5,_0x107142){return function(_0x5d31d6){if(_0x5d31d6){return _0x5d31d6[_0xa756('0x22')](_0x184af5)[_0xa756('0x23')](function(_0xa4522c){return _0xa4522c;});}return null;};}function removeEntity(_0x471ddc,_0x3dd77d){return function(_0x3c1694){if(_0x3c1694){return _0x3c1694[_0xa756('0x24')]()['then'](function(){var _0x61a0ab=_0x3c1694[_0xa756('0x25')]({'plain':!![]});var _0x30fd83=_0xa756('0x26');return db[_0xa756('0x27')][_0xa756('0x24')]({'where':{'type':_0x30fd83,'resourceId':_0x61a0ab['id']}})[_0xa756('0x23')](function(){return _0x3c1694;});})['then'](function(){_0x471ddc[_0xa756('0x19')](0xcc)[_0xa756('0x28')]();});}};}function handleEntityNotFound(_0x460de6,_0x43865d){return function(_0x410449){if(!_0x410449){_0x460de6[_0xa756('0x18')](0x194);}return _0x410449;};}function handleError(_0x38fd5e,_0x38c903){_0x38c903=_0x38c903||0x1f4;return function(_0x234778){logger['error'](_0x234778[_0xa756('0x29')]);if(_0x234778[_0xa756('0x2a')]){delete _0x234778[_0xa756('0x2a')];}_0x38fd5e[_0xa756('0x19')](_0x38c903)[_0xa756('0x2b')](_0x234778);};}exports[_0xa756('0x2c')]=function(_0x22d8b7,_0x1603fc){var _0x1d98ba={},_0x4a3371={},_0x2edfcf={'count':0x0,'rows':[]};return db['CmCompany'][_0xa756('0x2d')]()['then'](function(_0x528334){_0x4a3371[_0xa756('0x2e')]=_[_0xa756('0x2f')](_0x528334);_0x4a3371[_0xa756('0x30')]=_[_0xa756('0x2f')](_0x22d8b7[_0xa756('0x30')]);_0x4a3371[_0xa756('0x31')]=_[_0xa756('0x32')](_0x4a3371['model'],_0x4a3371[_0xa756('0x30')]);_0x1d98ba[_0xa756('0x33')]=_[_0xa756('0x32')](_0x4a3371[_0xa756('0x2e')],qs[_0xa756('0x34')](_0x22d8b7['query'][_0xa756('0x34')]));_0x1d98ba[_0xa756('0x33')]=_0x1d98ba[_0xa756('0x33')][_0xa756('0x35')]?_0x1d98ba[_0xa756('0x33')]:_0x4a3371[_0xa756('0x2e')];if(!_0x22d8b7['query'][_0xa756('0x36')](_0xa756('0x37'))){_0x1d98ba[_0xa756('0x1d')]=qs[_0xa756('0x1d')](_0x22d8b7[_0xa756('0x30')][_0xa756('0x1d')]);_0x1d98ba[_0xa756('0x1a')]=qs['offset'](_0x22d8b7[_0xa756('0x30')][_0xa756('0x1a')]);}_0x1d98ba[_0xa756('0x38')]=qs[_0xa756('0x39')](_0x22d8b7['query']['sort']);_0x1d98ba[_0xa756('0x3a')]=qs[_0xa756('0x31')](_['pick'](_0x22d8b7[_0xa756('0x30')],_0x4a3371[_0xa756('0x31')]),_0x528334);if(_0x22d8b7[_0xa756('0x30')][_0xa756('0x3b')]){_0x1d98ba[_0xa756('0x3a')]=_[_0xa756('0x3c')](_0x1d98ba['where'],{'$or':_[_0xa756('0x3d')](_0x1d98ba[_0xa756('0x33')],function(_0x57a07b){var _0x118834={};_0x118834[_0x57a07b]={'$like':'%'+_0x22d8b7['query']['filter']+'%'};return _0x118834;})});}_0x1d98ba=_['merge']({},_0x1d98ba,_0x22d8b7[_0xa756('0x3e')]);var _0xb89578={'where':_0x1d98ba[_0xa756('0x3a')]};return db[_0xa756('0x3f')][_0xa756('0x1c')](_0xb89578)[_0xa756('0x23')](function(_0x518f83){_0x2edfcf[_0xa756('0x1c')]=_0x518f83;if(_0x22d8b7[_0xa756('0x30')][_0xa756('0x40')]){_0x1d98ba[_0xa756('0x41')]=[{'all':!![]}];}return db[_0xa756('0x3f')]['findAll'](_0x1d98ba);})[_0xa756('0x23')](function(_0x36f31f){_0x2edfcf[_0xa756('0x42')]=_0x36f31f;return _0x2edfcf;})['then'](respondWithFilteredResult(_0x1603fc,_0x1d98ba))[_0xa756('0x43')](handleError(_0x1603fc,null));})[_0xa756('0x43')](handleError(_0x1603fc,null));};exports['show']=function(_0x2dee7a,_0x10558f){var _0x1e5028={'raw':![],'where':{'id':_0x2dee7a[_0xa756('0x44')]['id']}},_0x15ed13={};_0x15ed13[_0xa756('0x2e')]=_[_0xa756('0x2f')](db['CmCompany'][_0xa756('0x45')]);_0x15ed13[_0xa756('0x30')]=_[_0xa756('0x2f')](_0x2dee7a[_0xa756('0x30')]);_0x15ed13[_0xa756('0x31')]=_['intersection'](_0x15ed13[_0xa756('0x2e')],_0x15ed13['query']);_0x1e5028[_0xa756('0x33')]=_['intersection'](_0x15ed13['model'],qs[_0xa756('0x34')](_0x2dee7a[_0xa756('0x30')]['fields']));_0x1e5028[_0xa756('0x33')]=_0x1e5028[_0xa756('0x33')][_0xa756('0x35')]?_0x1e5028[_0xa756('0x33')]:_0x15ed13[_0xa756('0x2e')];if(_0x2dee7a[_0xa756('0x30')][_0xa756('0x40')]){_0x1e5028['include']=[{'all':!![]}];}_0x1e5028=_[_0xa756('0x3c')]({},_0x1e5028,_0x2dee7a['options']);return db[_0xa756('0x3f')][_0xa756('0x46')](_0x1e5028)['then'](handleEntityNotFound(_0x10558f,null))[_0xa756('0x23')](respondWithResult(_0x10558f,null))[_0xa756('0x43')](handleError(_0x10558f,null));};exports['create']=function(_0x4cede4,_0x224b3d){return db[_0xa756('0x3f')]['create'](_0x4cede4[_0xa756('0x47')],{})[_0xa756('0x23')](function(_0x22f3f6){var _0xf3ac50=_0x4cede4[_0xa756('0x48')][_0xa756('0x25')]({'plain':!![]});if(!_0xf3ac50)throw new Error(_0xa756('0x49'));if(_0xf3ac50[_0xa756('0x4a')]===_0xa756('0x48')){var _0x5794c4=_0x22f3f6[_0xa756('0x25')]({'plain':!![]});var _0x5dc8f4=_0xa756('0x26');return db[_0xa756('0x4b')]['find']({'where':{'name':_0x5dc8f4,'userProfileId':_0xf3ac50['userProfileId']},'raw':!![]})[_0xa756('0x23')](function(_0xe107ae){if(_0xe107ae&&_0xe107ae[_0xa756('0x4c')]===0x0){return db['UserProfileResource'][_0xa756('0x4d')]({'name':_0x5794c4[_0xa756('0x2a')],'resourceId':_0x5794c4['id'],'type':_0xe107ae[_0xa756('0x2a')],'sectionId':_0xe107ae['id']},{})[_0xa756('0x23')](function(){return _0x22f3f6;});}else{return _0x22f3f6;}})[_0xa756('0x43')](function(_0x496afd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x496afd);throw _0x496afd;});}return _0x22f3f6;})[_0xa756('0x23')](respondWithResult(_0x224b3d,0xc9))[_0xa756('0x43')](handleError(_0x224b3d,null));};exports['update']=function(_0x1bd498,_0x5e38b7){if(_0x1bd498[_0xa756('0x47')]['id']){delete _0x1bd498['body']['id'];}return db['CmCompany'][_0xa756('0x46')]({'where':{'id':_0x1bd498[_0xa756('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e38b7,null))[_0xa756('0x23')](saveUpdates(_0x1bd498[_0xa756('0x47')],null))[_0xa756('0x23')](respondWithResult(_0x5e38b7,null))[_0xa756('0x43')](handleError(_0x5e38b7,null));};exports[_0xa756('0x24')]=function(_0x5ce106,_0x4a8558){return db[_0xa756('0x3f')][_0xa756('0x46')]({'where':{'id':_0x5ce106[_0xa756('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a8558,null))[_0xa756('0x23')](removeEntity(_0x4a8558,null))[_0xa756('0x43')](handleError(_0x4a8558,null));};exports['describe']=function(_0x66a5c3,_0x325875){return db[_0xa756('0x3f')][_0xa756('0x2d')]()[_0xa756('0x23')](respondWithResult(_0x325875,null))[_0xa756('0x43')](handleError(_0x325875,null));};exports[_0xa756('0x4e')]=function(_0x40b149,_0x57c090,_0x2b750c){return db[_0xa756('0x4f')][_0xa756('0x46')]({'where':{'id':_0x40b149[_0xa756('0x44')]['id']}})[_0xa756('0x23')](handleEntityNotFound(_0x57c090,null))[_0xa756('0x23')](function(_0x494dad){if(_0x494dad){return _0x494dad[_0xa756('0x4e')](_0x40b149[_0xa756('0x47')][_0xa756('0x50')],_[_0xa756('0x51')](_0x40b149[_0xa756('0x47')],[_0xa756('0x50'),'id'])||{});}})[_0xa756('0x23')](respondWithResult(_0x57c090,null))[_0xa756('0x43')](handleError(_0x57c090,null));};exports[_0xa756('0x52')]=function(_0x3180f4,_0x29e7e9,_0x4064da){var _0x510194={};var _0x243464={};var _0x3cdc33;var _0x8602a8;return db['CmCompany']['findOne']({'where':{'id':_0x3180f4[_0xa756('0x44')]['id']}})[_0xa756('0x23')](handleEntityNotFound(_0x29e7e9,null))[_0xa756('0x23')](function(_0x467be7){if(_0x467be7){_0x3cdc33=_0x467be7;_0x243464[_0xa756('0x2e')]=_[_0xa756('0x2f')](db[_0xa756('0x4f')][_0xa756('0x45')]);_0x243464['query']=_[_0xa756('0x2f')](_0x3180f4['query']);_0x243464[_0xa756('0x31')]=_[_0xa756('0x32')](_0x243464[_0xa756('0x2e')],_0x243464[_0xa756('0x30')]);_0x510194[_0xa756('0x33')]=_[_0xa756('0x32')](_0x243464[_0xa756('0x2e')],qs[_0xa756('0x34')](_0x3180f4['query'][_0xa756('0x34')]));_0x510194['attributes']=_0x510194['attributes'][_0xa756('0x35')]?_0x510194[_0xa756('0x33')]:_0x243464['model'];_0x510194[_0xa756('0x38')]=qs[_0xa756('0x39')](_0x3180f4['query'][_0xa756('0x39')]);_0x510194[_0xa756('0x3a')]=qs[_0xa756('0x31')](_[_0xa756('0x53')](_0x3180f4[_0xa756('0x30')],_0x243464[_0xa756('0x31')]));if(_0x3180f4[_0xa756('0x30')][_0xa756('0x3b')]){_0x510194['where']=_['merge'](_0x510194[_0xa756('0x3a')],{'$or':_[_0xa756('0x3d')](_0x510194[_0xa756('0x33')],function(_0x25825c){var _0x120ca6={};_0x120ca6[_0x25825c]={'$like':'%'+_0x3180f4[_0xa756('0x30')][_0xa756('0x3b')]+'%'};return _0x120ca6;})});}_0x510194=_[_0xa756('0x3c')]({},_0x510194,_0x3180f4[_0xa756('0x3e')]);return _0x3cdc33['getContacts'](_0x510194);}})[_0xa756('0x23')](function(_0x470b34){if(_0x470b34){_0x8602a8=_0x470b34[_0xa756('0x35')];if(!_0x3180f4[_0xa756('0x30')][_0xa756('0x36')](_0xa756('0x37'))){_0x510194[_0xa756('0x1d')]=qs[_0xa756('0x1d')](_0x3180f4[_0xa756('0x30')]['limit']);_0x510194[_0xa756('0x1a')]=qs['offset'](_0x3180f4[_0xa756('0x30')]['offset']);}return _0x3cdc33[_0xa756('0x52')](_0x510194);}})[_0xa756('0x23')](function(_0x47ad9b){if(_0x47ad9b){return _0x47ad9b?{'count':_0x8602a8,'rows':_0x47ad9b}:null;}})[_0xa756('0x23')](respondWithResult(_0x29e7e9,null))[_0xa756('0x43')](handleError(_0x29e7e9,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index d76810a..d172d69 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 _0x196a=['request-promise','path','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','moment','bluebird'];(function(_0x3e0722,_0x4826d9){var _0x49a6b5=function(_0x48dc5b){while(--_0x48dc5b){_0x3e0722['push'](_0x3e0722['shift']());}};_0x49a6b5(++_0x4826d9);}(_0x196a,0x93));var _0xa196=function(_0x2a139e,_0xa5e346){_0x2a139e=_0x2a139e-0x0;var _0x242052=_0x196a[_0x2a139e];return _0x242052;};'use strict';var _=require(_0xa196('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa196('0x1'));var BPromise=require(_0xa196('0x2'));var rp=require(_0xa196('0x3'));var fs=require('fs');var path=require(_0xa196('0x4'));var rimraf=require('rimraf');var config=require(_0xa196('0x5'));var attributes=require(_0xa196('0x6'));module['exports']=function(_0x1a1864,_0x21fdb1){return _0x1a1864[_0xa196('0x7')](_0xa196('0x8'),attributes,{'tableName':_0xa196('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d59=['moment','bluebird','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x588fa9,_0x39e9b3){var _0x2fc217=function(_0x123ca3){while(--_0x123ca3){_0x588fa9['push'](_0x588fa9['shift']());}};_0x2fc217(++_0x39e9b3);}(_0x7d59,0xce));var _0x97d5=function(_0x3f3a47,_0x28f84b){_0x3f3a47=_0x3f3a47-0x0;var _0x57a682=_0x7d59[_0x3f3a47];return _0x57a682;};'use strict';var _=require(_0x97d5('0x0'));var util=require(_0x97d5('0x1'));var logger=require(_0x97d5('0x2'))('api');var moment=require(_0x97d5('0x3'));var BPromise=require(_0x97d5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97d5('0x5'));var config=require(_0x97d5('0x6'));var attributes=require(_0x97d5('0x7'));module['exports']=function(_0x7b392e,_0x1f5049){return _0x7b392e[_0x97d5('0x8')](_0x97d5('0x9'),attributes,{'tableName':_0x97d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 0002757..f85b207 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 _0xd318=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xd318,0xe0));var _0x8d31=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd318[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x8d31('0x0'));var util=require(_0x8d31('0x1'));var moment=require(_0x8d31('0x2'));var BPromise=require(_0x8d31('0x3'));var rs=require(_0x8d31('0x4'));var fs=require('fs');var Redis=require(_0x8d31('0x5'));var db=require(_0x8d31('0x6'))['db'];var utils=require(_0x8d31('0x7'));var logger=require(_0x8d31('0x8'))(_0x8d31('0x9'));var config=require(_0x8d31('0xa'));var jayson=require(_0x8d31('0xb'));var client=jayson[_0x8d31('0xc')][_0x8d31('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4b5780,_0x92a3f0,_0x2a9edf){return new BPromise(function(_0x336624,_0x25c24a){return client[_0x8d31('0xe')](_0x4b5780,_0x2a9edf)[_0x8d31('0xf')](function(_0x2cc87a){logger[_0x8d31('0x10')](_0x8d31('0x11'),_0x92a3f0,_0x8d31('0x12'));logger[_0x8d31('0x13')](_0x8d31('0x14'),_0x92a3f0,_0x8d31('0x12'),JSON['stringify'](_0x2cc87a));if(_0x2cc87a[_0x8d31('0x15')]){if(_0x2cc87a[_0x8d31('0x15')]['code']===0x1f4){logger[_0x8d31('0x15')](_0x8d31('0x11'),_0x92a3f0,_0x2cc87a[_0x8d31('0x15')][_0x8d31('0x16')]);return _0x25c24a(_0x2cc87a['error']['message']);}logger[_0x8d31('0x15')](_0x8d31('0x11'),_0x92a3f0,_0x2cc87a['error'][_0x8d31('0x16')]);return _0x336624(_0x2cc87a[_0x8d31('0x15')]['message']);}else{logger[_0x8d31('0x10')](_0x8d31('0x11'),_0x92a3f0,'request\x20sent');_0x336624(_0x2cc87a['result'][_0x8d31('0x16')]);}})[_0x8d31('0x17')](function(_0x3d1533){logger['error'](_0x8d31('0x11'),_0x92a3f0,_0x3d1533);_0x25c24a(_0x3d1533);});});} \ No newline at end of file +var _0x33e7=['CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','request\x20sent'];(function(_0x537928,_0x4444f1){var _0x26c016=function(_0x4f7e95){while(--_0x4f7e95){_0x537928['push'](_0x537928['shift']());}};_0x26c016(++_0x4444f1);}(_0x33e7,0x1ac));var _0x733e=function(_0x142d65,_0x36cff7){_0x142d65=_0x142d65-0x0;var _0x4b3054=_0x33e7[_0x142d65];return _0x4b3054;};'use strict';var _=require(_0x733e('0x0'));var util=require(_0x733e('0x1'));var moment=require('moment');var BPromise=require(_0x733e('0x2'));var rs=require(_0x733e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x733e('0x4'))['db'];var utils=require(_0x733e('0x5'));var logger=require(_0x733e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x733e('0x7')][_0x733e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x322cdf,_0x7159a4,_0x43df8d){return new BPromise(function(_0x221009,_0x848787){return client[_0x733e('0x9')](_0x322cdf,_0x43df8d)[_0x733e('0xa')](function(_0x5855c6){logger['info']('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x733e('0xb'));logger['debug'](_0x733e('0xc'),_0x7159a4,_0x733e('0xb'),JSON[_0x733e('0xd')](_0x5855c6));if(_0x5855c6[_0x733e('0xe')]){if(_0x5855c6[_0x733e('0xe')][_0x733e('0xf')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x5855c6['error'][_0x733e('0x10')]);return _0x848787(_0x5855c6[_0x733e('0xe')][_0x733e('0x10')]);}logger[_0x733e('0xe')](_0x733e('0x11'),_0x7159a4,_0x5855c6[_0x733e('0xe')][_0x733e('0x10')]);return _0x221009(_0x5855c6[_0x733e('0xe')]['message']);}else{logger[_0x733e('0x12')]('CmCompany,\x20%s,\x20%s',_0x7159a4,_0x733e('0xb'));_0x221009(_0x5855c6['result']['message']);}})[_0x733e('0x13')](function(_0x564883){logger[_0x733e('0xe')](_0x733e('0x11'),_0x7159a4,_0x564883);_0x848787(_0x564883);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 6ee7999..ad9c321 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 _0x6a80=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmCompany.controller','get','isAuthenticated','index','describe','/:id','getContacts','post','create','addContacts'];(function(_0x39914e,_0x1ec745){var _0x56350b=function(_0x4b390d){while(--_0x4b390d){_0x39914e['push'](_0x39914e['shift']());}};_0x56350b(++_0x1ec745);}(_0x6a80,0x1e7));var _0x06a8=function(_0x41571a,_0x53dd95){_0x41571a=_0x41571a-0x0;var _0x2b1fa4=_0x6a80[_0x41571a];return _0x2b1fa4;};'use strict';var multer=require(_0x06a8('0x0'));var util=require(_0x06a8('0x1'));var path=require('path');var timeout=require(_0x06a8('0x2'));var express=require(_0x06a8('0x3'));var router=express[_0x06a8('0x4')]();var fs_extra=require(_0x06a8('0x5'));var auth=require(_0x06a8('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x06a8('0x7'));router[_0x06a8('0x8')]('/',auth[_0x06a8('0x9')](),controller[_0x06a8('0xa')]);router['get']('/describe',auth[_0x06a8('0x9')](),controller[_0x06a8('0xb')]);router[_0x06a8('0x8')](_0x06a8('0xc'),auth[_0x06a8('0x9')](),controller['show']);router[_0x06a8('0x8')]('/:id/contacts',auth[_0x06a8('0x9')](),controller[_0x06a8('0xd')]);router[_0x06a8('0xe')]('/',auth[_0x06a8('0x9')](),controller[_0x06a8('0xf')]);router[_0x06a8('0xe')]('/:id/contacts',auth[_0x06a8('0x9')](),controller[_0x06a8('0x10')]);router[_0x06a8('0x11')](_0x06a8('0xc'),auth[_0x06a8('0x9')](),controller[_0x06a8('0x12')]);router[_0x06a8('0x13')]('/:id',auth[_0x06a8('0x9')](),controller['destroy']);module[_0x06a8('0x14')]=router; \ No newline at end of file +var _0x35cf=['getContacts','create','post','/:id/contacts','addContacts','/:id','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','show'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x35cf,0x118));var _0xf35c=function(_0xb4e052,_0x1d3cb6){_0xb4e052=_0xb4e052-0x0;var _0x5197e7=_0x35cf[_0xb4e052];return _0x5197e7;};'use strict';var multer=require(_0xf35c('0x0'));var util=require(_0xf35c('0x1'));var path=require('path');var timeout=require(_0xf35c('0x2'));var express=require(_0xf35c('0x3'));var router=express[_0xf35c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf35c('0x5'));var interaction=require(_0xf35c('0x6'));var config=require(_0xf35c('0x7'));var controller=require(_0xf35c('0x8'));router[_0xf35c('0x9')]('/',auth[_0xf35c('0xa')](),controller[_0xf35c('0xb')]);router[_0xf35c('0x9')](_0xf35c('0xc'),auth[_0xf35c('0xa')](),controller['describe']);router['get']('/:id',auth[_0xf35c('0xa')](),controller[_0xf35c('0xd')]);router[_0xf35c('0x9')]('/:id/contacts',auth[_0xf35c('0xa')](),controller[_0xf35c('0xe')]);router['post']('/',auth[_0xf35c('0xa')](),controller[_0xf35c('0xf')]);router[_0xf35c('0x10')](_0xf35c('0x11'),auth['isAuthenticated'](),controller[_0xf35c('0x12')]);router['put'](_0xf35c('0x13'),auth[_0xf35c('0xa')](),controller['update']);router['delete'](_0xf35c('0x13'),auth[_0xf35c('0xa')](),controller['destroy']);module[_0xf35c('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index c9a51f5..290ee1f 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 _0x1d61=['STRING','TEXT','INTEGER','DATE','NOW','lodash','exports'];(function(_0x5c7158,_0x40146f){var _0x526bc4=function(_0x58260f){while(--_0x58260f){_0x5c7158['push'](_0x5c7158['shift']());}};_0x526bc4(++_0x40146f);}(_0x1d61,0xd7));var _0x11d6=function(_0x555435,_0x30e908){_0x555435=_0x555435-0x0;var _0x3ac9c9=_0x1d61[_0x555435];return _0x3ac9c9;};'use strict';var _=require(_0x11d6('0x0'));var Sequelize=require('sequelize');module[_0x11d6('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x11d6('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x11d6('0x2')]},'city':{'type':Sequelize[_0x11d6('0x2')]},'country':{'type':Sequelize[_0x11d6('0x2')]},'dateOfBirth':{'type':Sequelize[_0x11d6('0x2')]},'description':{'type':Sequelize[_0x11d6('0x3')]},'phone':{'type':Sequelize[_0x11d6('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x11d6('0x2')]},'email':{'type':Sequelize[_0x11d6('0x2')]},'url':{'type':Sequelize[_0x11d6('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x11d6('0x2')]},'twitter':{'type':Sequelize[_0x11d6('0x2')]},'skype':{'type':Sequelize[_0x11d6('0x2')]},'teams':{'type':Sequelize[_0x11d6('0x2')]},'viber':{'type':Sequelize[_0x11d6('0x2')]},'line':{'type':Sequelize[_0x11d6('0x2')]},'wechat':{'type':Sequelize[_0x11d6('0x2')]},'telegram':{'type':Sequelize[_0x11d6('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x11d6('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x11d6('0x5')],'defaultValue':Sequelize[_0x11d6('0x6')]}}; \ No newline at end of file +var _0xce32=['STRING','TEXT','INTEGER','DATE','NOW','lodash','sequelize','exports'];(function(_0x8c7dcc,_0x34b381){var _0x539b2d=function(_0x4960b9){while(--_0x4960b9){_0x8c7dcc['push'](_0x8c7dcc['shift']());}};_0x539b2d(++_0x34b381);}(_0xce32,0x17d));var _0x2ce3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xce32[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2ce3('0x0'));var Sequelize=require(_0x2ce3('0x1'));module[_0x2ce3('0x2')]={'firstName':{'type':Sequelize[_0x2ce3('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2ce3('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2ce3('0x3')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ce3('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2ce3('0x3')]},'email':{'type':Sequelize[_0x2ce3('0x3')]},'url':{'type':Sequelize[_0x2ce3('0x3')]},'facebook':{'type':Sequelize[_0x2ce3('0x3')]},'fb_data':{'type':Sequelize[_0x2ce3('0x3')]},'twitter':{'type':Sequelize[_0x2ce3('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2ce3('0x3')]},'line':{'type':Sequelize[_0x2ce3('0x3')]},'wechat':{'type':Sequelize[_0x2ce3('0x3')]},'telegram':{'type':Sequelize[_0x2ce3('0x3')]},'UserId':{'type':Sequelize[_0x2ce3('0x5')]},'priority':{'type':Sequelize[_0x2ce3('0x5')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2ce3('0x6')],'defaultValue':Sequelize[_0x2ce3('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 1d812a5..a038f2c 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 _0xda02=['cm_user_has_contacts','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','buildExpression','text','start','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','merge','c.lastName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','analytics','findAll','alias','custom','values','hasOwnProperty','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','VoiceCallReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','duplicates','$or','findOrCreate','spread','isNil','$and','omit','format','cf_%d','pickBy','table','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','include','CmHopperHistory','getHopperFinals','includeAll','getJscriptySessions','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','filename','chmodSync','0777','child_process','fork','join','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','import','No\x20ListId\x20specified','binding','firstName','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','sms','fax','whatsapp','voice','-createdAt','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','starttime','endtime','note','createdAt','userDisposition','userThirdDisposition','UserId','fullname','startCase','chat','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','customerIp','customerPort','deviceModel','ratingMessage','ratingType','referer','subject','openchannel','externalUrl','threadId','Interaction','flatten','reverse','slice','moment','bluebird','path','lodash','papaparse','ioredis','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','set','Content-Range','json','then','destroy','end','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','push','CmCustomField','findOne','trimStart','all','length','fieldType','type','query','filters','intersection','model','attributes','fields','nolimit','offset','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join'];(function(_0x46a616,_0x52e0df){var _0x50f3dd=function(_0x25606d){while(--_0x25606d){_0x46a616['push'](_0x46a616['shift']());}};_0x50f3dd(++_0x52e0df);}(_0xda02,0xdf));var _0x2da0=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xda02[_0x4dc7b9];return _0x3ab114;};'use strict';var moment=require(_0x2da0('0x0'));var BPromise=require(_0x2da0('0x1'));var util=require('util');var path=require(_0x2da0('0x2'));var fs=require('fs');var _=require(_0x2da0('0x3'));var squel=require('squel');var Papa=require(_0x2da0('0x4'));var Redis=require(_0x2da0('0x5'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var logger=require(_0x2da0('0x6'))(_0x2da0('0x7'));var config=require('../../config/environment');var db=require(_0x2da0('0x8'))['db'];config[_0x2da0('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2da0('0xa'))(new Redis(config[_0x2da0('0x9')]));require(_0x2da0('0xb'))[_0x2da0('0xc')](socket);function respondWithResult(_0x136cf3,_0x465f99){_0x465f99=_0x465f99||0xc8;return function(_0x51bdc3){if(_0x51bdc3){return _0x136cf3[_0x2da0('0xd')](_0x465f99)['json'](_0x51bdc3);}};}function respondWithFilteredResult(_0x1677ce,_0x53cb0f){return function(_0x4dfe25){if(_0x4dfe25){var _0x75b37f=typeof _0x53cb0f['offset']===_0x2da0('0xe')&&typeof _0x53cb0f[_0x2da0('0xf')]===_0x2da0('0xe');var _0x3886d7=_0x4dfe25[_0x2da0('0x10')];var _0xe8b4c4=_0x75b37f?0x0:_0x53cb0f['offset'];var _0x402502=_0x75b37f?_0x4dfe25[_0x2da0('0x10')]:_0x53cb0f['offset']+_0x53cb0f[_0x2da0('0xf')];var _0x4aaed9;if(_0x402502>=_0x3886d7){_0x402502=_0x3886d7;_0x4aaed9=0xc8;}else{_0x4aaed9=0xce;}_0x1677ce['status'](_0x4aaed9);return _0x1677ce[_0x2da0('0x11')](_0x2da0('0x12'),_0xe8b4c4+'-'+_0x402502+'/'+_0x3886d7)[_0x2da0('0x13')](_0x4dfe25);}return null;};}function saveUpdates(_0xce0652){return function(_0x523ca2){if(_0x523ca2){return _0x523ca2['update'](_0xce0652)[_0x2da0('0x14')](function(_0x2973a4){return _0x2973a4;});}return null;};}function removeEntity(_0x5dabe2){return function(_0x41b112){if(_0x41b112){return _0x41b112[_0x2da0('0x15')]()[_0x2da0('0x14')](function(){_0x5dabe2['status'](0xcc)[_0x2da0('0x16')]();});}};}function handleEntityNotFound(_0x5b6366){return function(_0x477192){if(!_0x477192){_0x5b6366[_0x2da0('0x17')](0x194);}return _0x477192;};}function handleError(_0x474c7c,_0x330636){_0x330636=_0x330636||0x1f4;return function(_0x25a325){logger[_0x2da0('0x18')](_0x25a325[_0x2da0('0x19')]);if(_0x25a325[_0x2da0('0x1a')]){delete _0x25a325[_0x2da0('0x1a')];}_0x474c7c[_0x2da0('0xd')](_0x330636)[_0x2da0('0x1b')](_0x25a325);};}exports[_0x2da0('0x1c')]=function(_0x4c9f2e,_0x17e4db){var _0x2a8f72={},_0x492a24={},_0x1511b6={'count':0x0,'rows':[]};return db[_0x2da0('0x1d')][_0x2da0('0x1e')]()[_0x2da0('0x14')](function(_0x35815a){var _0xf1a751=[];for(var _0x46f5ea=0x0;_0x46f5ea0x1){_0x3ca2c2['or'](_0x2da0('0x5f'),qs[_0x2da0('0x60')](_0x1bf47b),null);}else{if(qs[_0x2da0('0x61')](_0x1bf47b)){_0x3ca2c2['or'](_0x2da0('0x62'),_0x1bf47b+'%');_0x3ca2c2['or']('c.phone\x20LIKE\x20?',_0x1bf47b+'%');_0x3ca2c2['or'](_0x2da0('0x63'),_0x1bf47b+'%');_0x3ca2c2['or'](_0x2da0('0x64'),_0x1bf47b+'%');}else if(qs[_0x2da0('0x65')](_0x1bf47b)){_0x3ca2c2['or'](_0x2da0('0x66'),_0x1bf47b+'%');}else{_0x3ca2c2['or'](_0x2da0('0x67'),'%'+_0x1bf47b+'%');_0x3ca2c2['or'](_0x2da0('0x68'),'%'+_0x1bf47b+'%');_0x3ca2c2['or'](_0x2da0('0x66'),'%'+_0x1bf47b+'%');}}}}_0x27b0ab['where'](_0x3ca2c2);_0x27b0ab[_0x2da0('0x69')](_0x2da0('0x6a'));var _0x514855={'type':db[_0x2da0('0x6b')][_0x2da0('0x6c')][_0x2da0('0x6d')],'raw':!![]};var _0x3c7d93=_0x27b0ab[_0x2da0('0x6e')]()[_0x2da0('0x37')](_0x2da0('0x6a'));if(_0x2a8f72[_0x2da0('0x32')]){_0x2a8f72['order'][_0x2da0('0x4b')](function(_0x3d93bd){_0x27b0ab[_0x2da0('0x32')]('c.'+_0x3d93bd[0x0],_0x3d93bd[0x1]===_0x2da0('0x6f')?![]:!![]);});}if(!_[_0x2da0('0x56')](_0x539542)){_0x27b0ab[_0x2da0('0x70')](_0x8f70e);_0x3c7d93[_0x2da0('0x34')](_0x2da0('0x71'),_0x539542);}BPromise[_0x2da0('0x72')]()[_0x2da0('0x14')](function(){if(!_0x79bd42)return;if(_0x4c9f2e[_0x2da0('0x73')][_0x2da0('0x74')]!==_0x2da0('0x75'))return;if(!_[_0x2da0('0x76')](_0x79bd42[_0x2da0('0x45')],['field',_0x2da0('0x4d')])){return _0x4c9f2e[_0x2da0('0x73')][_0x2da0('0x77')]({'attributes':['id'],'raw':!![]})[_0x2da0('0x14')](function(_0x5b94bd){if(_[_0x2da0('0x56')](_0x5b94bd)){_0x3c7d93[_0x2da0('0x34')](_0x2da0('0x78'));_0x27b0ab['where'](_0x2da0('0x78'));}else{_0x3c7d93[_0x2da0('0x34')](_0x2da0('0x58'),_[_0x2da0('0x4a')](_0x5b94bd,'id'));_0x27b0ab[_0x2da0('0x34')](_0x2da0('0x58'),_[_0x2da0('0x4a')](_0x5b94bd,'id'));}});}})['then'](function(){if(_0x4c9f2e[_0x2da0('0x73')][_0x2da0('0x74')]===_0x2da0('0x75')&&!_0x79bd42&&!_0x4c9f2e[_0x2da0('0x2a')][_0x2da0('0x57')])return[];return db[_0x2da0('0x79')][_0x2da0('0x2a')](_0x3c7d93[_0x2da0('0x7a')](),_0x514855);})[_0x2da0('0x14')](function(_0x2e62f1){_0x1511b6[_0x2da0('0x10')]=_0x2e62f1[_0x2da0('0x27')];if(_0x1511b6[_0x2da0('0x10')]===0x0)return[];return db[_0x2da0('0x79')][_0x2da0('0x2a')](_0x67fc96[_0x2da0('0x7a')](),_0x514855)[_0x2da0('0x14')](function(_0x20c846){_0x1dc320=_['keyBy'](_0x20c846,'id');_0x514855=_[_0x2da0('0x7b')](_0x514855,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c9f2e[_0x2da0('0x2a')][_0x2da0('0x2f')]){_0x2a8f72[_0x2da0('0x2e')][_0x2da0('0x4b')](function(_0x4ef61e){_0x27b0ab[_0x2da0('0x37')]('c.'+_0x4ef61e);});}else{_0x27b0ab['field'](_0x2da0('0x6a'));_0x27b0ab[_0x2da0('0x37')]('c.firstName');_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x7c'));_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x7d'));_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x7e'));_0x27b0ab['field']('c.fax');_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x7f'));_0x27b0ab['field'](_0x2da0('0x80'));_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x81'));_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x82'));_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x83'));_0x27b0ab[_0x2da0('0x37')](_0x2da0('0x84'),'TagIds');}if(_0x2a8f72[_0x2da0('0xf')])_0x27b0ab[_0x2da0('0xf')](_0x2a8f72[_0x2da0('0xf')]);if(_0x2a8f72[_0x2da0('0x31')])_0x27b0ab[_0x2da0('0x31')](_0x2a8f72[_0x2da0('0x31')]);return db[_0x2da0('0x79')]['query'](_0x27b0ab[_0x2da0('0x7a')](),_0x514855);});})[_0x2da0('0x14')](function(_0x70c2d3){_0x70c2d3[_0x2da0('0x4b')](function(_0x44c996){if(_0x44c996['TagIds']){_0x44c996['Tags']=[];_0x44c996[_0x2da0('0x85')][_0x2da0('0x49')](',')['forEach'](function(_0x5579ed){_0x44c996[_0x2da0('0x86')][_0x2da0('0x22')](_0x1dc320[_0x5579ed]);});}delete _0x44c996[_0x2da0('0x85')];});_0x1511b6[_0x2da0('0x87')]=_0x70c2d3;return _0x1511b6;})[_0x2da0('0x14')](respondWithFilteredResult(_0x17e4db,_0x2a8f72));})[_0x2da0('0x88')](handleError(_0x17e4db,null));};exports['destroy']=function(_0x24c4eb,_0x3223cd){return db[_0x2da0('0x1d')][_0x2da0('0x46')]({'where':{'id':_0x24c4eb[_0x2da0('0x89')]['id']}})[_0x2da0('0x14')](handleEntityNotFound(_0x3223cd,null))[_0x2da0('0x14')](removeEntity(_0x3223cd,null))[_0x2da0('0x88')](handleError(_0x3223cd,null));};exports[_0x2da0('0x1e')]=function(_0x257b08,_0x2f1cb6){return db[_0x2da0('0x1d')][_0x2da0('0x1e')]()[_0x2da0('0x14')](function(_0x2ad65a){delete _0x2ad65a[_0x2da0('0x8a')];for(var _0x65e76=0x0;_0x65e76=_0x1190a7){_0x44e4fa=_0x1190a7;_0x365224=0xc8;}else{_0x365224=0xce;}_0x422ff6[_0x1e45('0xf')](_0x365224);return _0x422ff6[_0x1e45('0x15')]('Content-Range',_0x585f29+'-'+_0x44e4fa+'/'+_0x1190a7)[_0x1e45('0x10')](_0x38481c);}return null;};}function saveUpdates(_0x56fba3){return function(_0x35e011){if(_0x35e011){return _0x35e011[_0x1e45('0x16')](_0x56fba3)[_0x1e45('0x17')](function(_0x57a39d){return _0x57a39d;});}return null;};}function removeEntity(_0x2e7e14){return function(_0x3756cb){if(_0x3756cb){return _0x3756cb[_0x1e45('0x18')]()[_0x1e45('0x17')](function(){_0x2e7e14['status'](0xcc)[_0x1e45('0x19')]();});}};}function handleEntityNotFound(_0x99fb34){return function(_0x1e11f9){if(!_0x1e11f9){_0x99fb34[_0x1e45('0x1a')](0x194);}return _0x1e11f9;};}function handleError(_0x17ac92,_0x3d39dd){_0x3d39dd=_0x3d39dd||0x1f4;return function(_0x5182c8){logger[_0x1e45('0x1b')](_0x5182c8['stack']);if(_0x5182c8[_0x1e45('0x1c')]){delete _0x5182c8[_0x1e45('0x1c')];}_0x17ac92[_0x1e45('0xf')](_0x3d39dd)[_0x1e45('0x1d')](_0x5182c8);};}exports[_0x1e45('0x1e')]=function(_0x35efad,_0x33df6e){var _0x51d562={},_0x3157a5={},_0x5a41d8={'count':0x0,'rows':[]};return db[_0x1e45('0x1f')][_0x1e45('0x20')]()['then'](function(_0x4508bc){var _0x1605c5=[];for(var _0x5dd178=0x0;_0x5dd1780x1){_0x59ca2c['or'](_0x1e45('0x5a'),qs[_0x1e45('0x5b')](_0x3ecf07),null);}else{if(qs[_0x1e45('0x5c')](_0x3ecf07)){_0x59ca2c['or']('c.id\x20LIKE\x20?',_0x3ecf07+'%');_0x59ca2c['or']('c.phone\x20LIKE\x20?',_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x5d'),_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x5e'),_0x3ecf07+'%');}else if(qs[_0x1e45('0x5f')](_0x3ecf07)){_0x59ca2c['or']('c.email\x20LIKE\x20?',_0x3ecf07+'%');}else{_0x59ca2c['or'](_0x1e45('0x60'),'%'+_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x61'),'%'+_0x3ecf07+'%');_0x59ca2c['or'](_0x1e45('0x62'),'%'+_0x3ecf07+'%');}}}}_0x434a11[_0x1e45('0x30')](_0x59ca2c);_0x434a11[_0x1e45('0x63')](_0x1e45('0x64'));var _0x377b19={'type':db[_0x1e45('0x65')][_0x1e45('0x66')][_0x1e45('0x67')],'raw':!![]};var _0x3aa814=_0x434a11[_0x1e45('0x68')]()[_0x1e45('0x32')](_0x1e45('0x64'));if(_0x51d562[_0x1e45('0x69')]){_0x51d562[_0x1e45('0x69')]['forEach'](function(_0x2f7ea4){_0x434a11[_0x1e45('0x69')]('c.'+_0x2f7ea4[0x0],_0x2f7ea4[0x1]===_0x1e45('0x6a')?![]:!![]);});}if(!_[_0x1e45('0x53')](_0x5f5900)){_0x434a11[_0x1e45('0x6b')](_0x104b62);_0x3aa814[_0x1e45('0x30')](_0x1e45('0x6c'),_0x5f5900);}BPromise[_0x1e45('0x6d')]()[_0x1e45('0x17')](function(){if(!_0x383470)return;if(_0x35efad[_0x1e45('0x6e')][_0x1e45('0x6f')]!==_0x1e45('0x70'))return;if(!_[_0x1e45('0x71')](_0x383470['conditions'],[_0x1e45('0x32'),_0x1e45('0x46')])){return _0x35efad['user'][_0x1e45('0x72')]({'attributes':['id'],'raw':!![]})[_0x1e45('0x17')](function(_0xe6166e){if(_['isEmpty'](_0xe6166e)){_0x3aa814[_0x1e45('0x30')]('c.ListId\x20IS\x20NULL');_0x434a11[_0x1e45('0x30')]('c.ListId\x20IS\x20NULL');}else{_0x3aa814['where']('c.ListId\x20IN\x20?',_[_0x1e45('0x44')](_0xe6166e,'id'));_0x434a11['where']('c.ListId\x20IN\x20?',_[_0x1e45('0x44')](_0xe6166e,'id'));}});}})['then'](function(){if(_0x35efad[_0x1e45('0x6e')]['role']===_0x1e45('0x70')&&!_0x383470&&!_0x35efad[_0x1e45('0x29')][_0x1e45('0x73')])return[];return db[_0x1e45('0x74')][_0x1e45('0x29')](_0x3aa814['toString'](),_0x377b19);})[_0x1e45('0x17')](function(_0x527687){_0x5a41d8[_0x1e45('0x13')]=_0x527687[_0x1e45('0x21')];if(_0x5a41d8[_0x1e45('0x13')]===0x0)return[];return db[_0x1e45('0x74')]['query'](_0x48e7d8[_0x1e45('0x75')](),_0x377b19)[_0x1e45('0x17')](function(_0x10f74e){_0x2c8b02=_['keyBy'](_0x10f74e,'id');_0x377b19=_[_0x1e45('0x76')](_0x377b19,{'model':db[_0x1e45('0x1f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35efad['query'][_0x1e45('0x2c')]){_0x51d562[_0x1e45('0x2d')][_0x1e45('0x45')](function(_0x40644c){_0x434a11[_0x1e45('0x32')]('c.'+_0x40644c);});}else{_0x434a11['field'](_0x1e45('0x64'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x77'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x78'));_0x434a11['field'](_0x1e45('0x79'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7a'));_0x434a11['field'](_0x1e45('0x7b'));_0x434a11['field'](_0x1e45('0x7c'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7d'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7e'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x7f'));_0x434a11['field'](_0x1e45('0x80'));_0x434a11[_0x1e45('0x32')](_0x1e45('0x81'),_0x1e45('0x82'));}if(_0x51d562[_0x1e45('0x12')])_0x434a11[_0x1e45('0x12')](_0x51d562['limit']);if(_0x51d562['offset'])_0x434a11[_0x1e45('0x14')](_0x51d562[_0x1e45('0x14')]);return db[_0x1e45('0x74')][_0x1e45('0x29')](_0x434a11[_0x1e45('0x75')](),_0x377b19);});})[_0x1e45('0x17')](function(_0x5e71b9){_0x5e71b9[_0x1e45('0x45')](function(_0x310dd0){if(_0x310dd0[_0x1e45('0x82')]){_0x310dd0['Tags']=[];_0x310dd0[_0x1e45('0x82')][_0x1e45('0x43')](',')['forEach'](function(_0x3e5ef8){_0x310dd0[_0x1e45('0x83')]['push'](_0x2c8b02[_0x3e5ef8]);});}delete _0x310dd0[_0x1e45('0x82')];});_0x5a41d8[_0x1e45('0x84')]=_0x5e71b9;return _0x5a41d8;})['then'](respondWithFilteredResult(_0x33df6e,_0x51d562));})[_0x1e45('0x85')](handleError(_0x33df6e,null));};exports[_0x1e45('0x18')]=function(_0x170e0c,_0x475ef6){return db['CmContact']['find']({'where':{'id':_0x170e0c[_0x1e45('0x86')]['id']}})['then'](handleEntityNotFound(_0x475ef6,null))['then'](removeEntity(_0x475ef6,null))[_0x1e45('0x85')](handleError(_0x475ef6,null));};exports[_0x1e45('0x20')]=function(_0x780a9d,_0x244795){return db[_0x1e45('0x1f')][_0x1e45('0x20')]()['then'](function(_0x4da082){delete _0x4da082[_0x1e45('0x87')];for(var _0x5d3afc=0x0;_0x5d3afc{}\s\\|]/g,'-');_0x5397b5(null,util['format']('%s-%s%s',path[_0xfde7('0x1d')](_0x44e88d[_0xfde7('0x1b')],path[_0xfde7('0x1e')](_0x44e88d[_0xfde7('0x1b')])),Date['now'](),path['extname'](_0x44e88d[_0xfde7('0x1b')])));}})});router[_0xfde7('0x13')](_0xfde7('0x1f'),upload[_0xfde7('0x20')](_0xfde7('0x21')),controller[_0xfde7('0x22')]);var upload=multer({'storage':multer[_0xfde7('0x18')]({'destination':function(_0x4b7c26,_0x6ac8d5,_0x36743e){_0x36743e(null,path['join'](config[_0xfde7('0x19')],_0xfde7('0x1a')));},'filename':function(_0x14e6c5,_0x4a2518,_0x3ea628){_0x4a2518[_0xfde7('0x1b')]=_0x4a2518[_0xfde7('0x1b')][_0xfde7('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ea628(null,util[_0xfde7('0x23')](_0xfde7('0x24'),path[_0xfde7('0x1d')](_0x4a2518[_0xfde7('0x1b')],path[_0xfde7('0x1e')](_0x4a2518[_0xfde7('0x1b')])),Date['now'](),path[_0xfde7('0x1e')](_0x4a2518[_0xfde7('0x1b')])));}})});router[_0xfde7('0x13')]('/upload',upload[_0xfde7('0x20')](_0xfde7('0x21')),controller[_0xfde7('0x25')]);router[_0xfde7('0x13')](_0xfde7('0x26'),auth['isAuthenticated'](),controller[_0xfde7('0x27')]);router[_0xfde7('0x28')](_0xfde7('0x29'),auth[_0xfde7('0x8')](),controller[_0xfde7('0x2a')]);router[_0xfde7('0x2b')](_0xfde7('0x29'),auth[_0xfde7('0x8')](),controller[_0xfde7('0x2c')]);module[_0xfde7('0x2d')]=router; \ No newline at end of file +var _0x6b7c=['/merge','merge','create','/create_many','setTags','root','originalname','format','%s-%s%s','basename','extname','/csv','single','file','diskStorage','join','server/files/tmp','replace','now','/upload','/upload/:id','import','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','isAuthenticated','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','post'];(function(_0x1cb5fe,_0x4e714e){var _0x428df6=function(_0x35e1ef){while(--_0x35e1ef){_0x1cb5fe['push'](_0x1cb5fe['shift']());}};_0x428df6(++_0x4e714e);}(_0x6b7c,0x119));var _0xc6b7=function(_0x550ac4,_0x1f0436){_0x550ac4=_0x550ac4-0x0;var _0x3b1091=_0x6b7c[_0x550ac4];return _0x3b1091;};'use strict';var multer=require(_0xc6b7('0x0'));var util=require(_0xc6b7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc6b7('0x2'));var router=express[_0xc6b7('0x3')]();var fs_extra=require(_0xc6b7('0x4'));var auth=require(_0xc6b7('0x5'));var interaction=require(_0xc6b7('0x6'));var config=require(_0xc6b7('0x7'));var controller=require(_0xc6b7('0x8'));router[_0xc6b7('0x9')]('/',auth['isAuthenticated'](),controller[_0xc6b7('0xa')]);router[_0xc6b7('0x9')]('/describe',auth[_0xc6b7('0xb')](),controller[_0xc6b7('0xc')]);router[_0xc6b7('0x9')](_0xc6b7('0xd'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0xe')]);router[_0xc6b7('0x9')](_0xc6b7('0xf'),auth[_0xc6b7('0xb')](),controller['getTags']);router[_0xc6b7('0x9')](_0xc6b7('0x10'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x11')]);router[_0xc6b7('0x9')](_0xc6b7('0x12'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x13')]);router['get'](_0xc6b7('0x14'),auth[_0xc6b7('0xb')](),controller['getHopperFinals']);router['get'](_0xc6b7('0x15'),auth['isAuthenticated'](),controller[_0xc6b7('0x16')]);router[_0xc6b7('0x9')](_0xc6b7('0x17'),auth['isAuthenticated'](),controller['getJourney']);router[_0xc6b7('0x18')](_0xc6b7('0x19'),auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x1a')]);router[_0xc6b7('0x18')]('/',auth[_0xc6b7('0xb')](),controller[_0xc6b7('0x1b')]);router[_0xc6b7('0x18')](_0xc6b7('0x1c'),auth[_0xc6b7('0xb')](),controller['bulkCreate']);router[_0xc6b7('0x18')](_0xc6b7('0xf'),auth['isAuthenticated'](),controller[_0xc6b7('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a6027,_0x280056,_0x158cf8){_0x158cf8(null,path['join'](config[_0xc6b7('0x1e')],'server/files/tmp'));},'filename':function(_0x127b51,_0x4896e9,_0x11544b){_0x4896e9['originalname']=_0x4896e9[_0xc6b7('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x11544b(null,util[_0xc6b7('0x20')](_0xc6b7('0x21'),path[_0xc6b7('0x22')](_0x4896e9[_0xc6b7('0x1f')],path[_0xc6b7('0x23')](_0x4896e9[_0xc6b7('0x1f')])),Date['now'](),path[_0xc6b7('0x23')](_0x4896e9[_0xc6b7('0x1f')])));}})});router['post'](_0xc6b7('0x24'),upload[_0xc6b7('0x25')](_0xc6b7('0x26')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xc6b7('0x27')]({'destination':function(_0x2ed6fd,_0x1a323e,_0x157064){_0x157064(null,path[_0xc6b7('0x28')](config[_0xc6b7('0x1e')],_0xc6b7('0x29')));},'filename':function(_0x20f19d,_0x1b5fbe,_0x7eace5){_0x1b5fbe[_0xc6b7('0x1f')]=_0x1b5fbe['originalname'][_0xc6b7('0x2a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x7eace5(null,util[_0xc6b7('0x20')](_0xc6b7('0x21'),path[_0xc6b7('0x22')](_0x1b5fbe[_0xc6b7('0x1f')],path[_0xc6b7('0x23')](_0x1b5fbe[_0xc6b7('0x1f')])),Date[_0xc6b7('0x2b')](),path[_0xc6b7('0x23')](_0x1b5fbe[_0xc6b7('0x1f')])));}})});router[_0xc6b7('0x18')](_0xc6b7('0x2c'),upload[_0xc6b7('0x25')](_0xc6b7('0x26')),controller['upload']);router[_0xc6b7('0x18')](_0xc6b7('0x2d'),auth['isAuthenticated'](),controller[_0xc6b7('0x2e')]);router[_0xc6b7('0x2f')](_0xc6b7('0xd'),auth['isAuthenticated'](),controller[_0xc6b7('0x30')]);router[_0xc6b7('0x31')](_0xc6b7('0xd'),auth[_0xc6b7('0xb')](),controller['destroy']);module[_0xc6b7('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index d0a5268..c1f8447 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 _0x753c=['values','isArray','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x753c,0xfc));var _0xc753=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x753c[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xc753('0x0'));var _=require(_0xc753('0x1'));module[_0xc753('0x2')]={'name':{'type':Sequelize[_0xc753('0x3')],'get':function(_0x3cd215){return this[_0xc753('0x4')](_0xc753('0x5'));}},'alias':{'type':Sequelize[_0xc753('0x6')],'allowNull':![],'set':function(_0x1a0c8d){this[_0xc753('0x7')](_0xc753('0x5'),_0x1a0c8d?_0x1a0c8d:this[_0xc753('0x4')](_0xc753('0x8')));}},'type':{'type':Sequelize[_0xc753('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xc753('0x9')](_0xc753('0xa')),'get':function(){if(this[_0xc753('0x4')](_0xc753('0xb'))===_0xc753('0xc')){return JSON[_0xc753('0xd')](this['getDataValue']('values'));}else{return this[_0xc753('0x4')](_0xc753('0xe'));}},'set':function(_0x2ff2db){if(Array[_0xc753('0xf')](_0x2ff2db)){this[_0xc753('0x7')](_0xc753('0xe'),JSON[_0xc753('0x10')](_0x2ff2db));}else{this[_0xc753('0x7')](_0xc753('0xe'),_0x2ff2db);}}},'required':{'type':Sequelize[_0xc753('0x11')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xc753('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0xc753('0x12'))}}; \ No newline at end of file +var _0xb90b=['values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','getDataValue','alias','setDataValue','name','STRING','TEXT','long','type','select','parse'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb90b,0x1a8));var _0xbb90=function(_0x405538,_0x1c4c8d){_0x405538=_0x405538-0x0;var _0x281c78=_0xb90b[_0x405538];return _0x281c78;};'use strict';var Sequelize=require(_0xbb90('0x0'));var _=require('lodash');module[_0xbb90('0x1')]={'name':{'type':Sequelize[_0xbb90('0x2')],'get':function(_0x117b01){return this[_0xbb90('0x3')](_0xbb90('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x470504){this[_0xbb90('0x5')]('alias',_0x470504?_0x470504:this[_0xbb90('0x3')](_0xbb90('0x6')));}},'type':{'type':Sequelize[_0xbb90('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0xbb90('0x8')](_0xbb90('0x9')),'get':function(){if(this[_0xbb90('0x3')](_0xbb90('0xa'))===_0xbb90('0xb')){return JSON[_0xbb90('0xc')](this[_0xbb90('0x3')](_0xbb90('0xd')));}else{return this[_0xbb90('0x3')](_0xbb90('0xd'));}},'set':function(_0xe7e616){if(Array[_0xbb90('0xe')](_0xe7e616)){this[_0xbb90('0x5')](_0xbb90('0xd'),JSON[_0xbb90('0xf')](_0xe7e616));}else{this['setDataValue'](_0xbb90('0xd'),_0xe7e616);}}},'required':{'type':Sequelize[_0xbb90('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xbb90('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xbb90('0x11')](_0xbb90('0x12'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 5cafc91..16cfef3 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 _0x6e2a=['destroy','error','name','send','index','map','CmCustomField','type','model','differenceBy','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','rawAttributes','fields','length','options','find','body','create','sequelize','transaction','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','format','eml-format','rimraf','fast-json-patch','util','path','sox','ejs','fs-extra','lodash','squel','crypto','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','end','json','undefined','offset','count','limit','set','apply','save','update','then'];(function(_0x427386,_0x5f5229){var _0x418313=function(_0x201879){while(--_0x201879){_0x427386['push'](_0x427386['shift']());}};_0x418313(++_0x5f5229);}(_0x6e2a,0xd4));var _0xa6e2=function(_0x4df5d3,_0x522c48){_0x4df5d3=_0x4df5d3-0x0;var _0x34a8d=_0x6e2a[_0x4df5d3];return _0x34a8d;};'use strict';var emlformat=require(_0xa6e2('0x0'));var rimraf=require(_0xa6e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa6e2('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa6e2('0x3'));var path=require(_0xa6e2('0x4'));var sox=require(_0xa6e2('0x5'));var csv=require('to-csv');var ejs=require(_0xa6e2('0x6'));var fs=require('fs');var fs_extra=require(_0xa6e2('0x7'));var _=require(_0xa6e2('0x8'));var squel=require(_0xa6e2('0x9'));var crypto=require(_0xa6e2('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa6e2('0xb'));var toCsv=require(_0xa6e2('0xc'));var querystring=require(_0xa6e2('0xd'));var Papa=require(_0xa6e2('0xe'));var Redis=require(_0xa6e2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa6e2('0x10'));var as=require(_0xa6e2('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa6e2('0x12'))(_0xa6e2('0x13'));var utils=require(_0xa6e2('0x14'));var config=require(_0xa6e2('0x15'));var licenseUtil=require(_0xa6e2('0x16'));var db=require(_0xa6e2('0x17'))['db'];function respondWithStatusCode(_0x24e74b,_0x1acc5a){_0x1acc5a=_0x1acc5a||0xcc;return function(_0x2d3203){if(_0x2d3203){return _0x24e74b[_0xa6e2('0x18')](_0x1acc5a);}return _0x24e74b[_0xa6e2('0x19')](_0x1acc5a)[_0xa6e2('0x1a')]();};}function respondWithResult(_0x390da0,_0x4aaa56){_0x4aaa56=_0x4aaa56||0xc8;return function(_0x305859){if(_0x305859){return _0x390da0[_0xa6e2('0x19')](_0x4aaa56)[_0xa6e2('0x1b')](_0x305859);}};}function respondWithFilteredResult(_0xdb0d29,_0x2150a5){return function(_0xcf2473){if(_0xcf2473){var _0x135b29=typeof _0x2150a5['offset']==='undefined'&&typeof _0x2150a5['limit']===_0xa6e2('0x1c');var _0xa4a91d=_0xcf2473['count'];var _0x50310c=_0x135b29?0x0:_0x2150a5[_0xa6e2('0x1d')];var _0x22e20e=_0x135b29?_0xcf2473[_0xa6e2('0x1e')]:_0x2150a5[_0xa6e2('0x1d')]+_0x2150a5[_0xa6e2('0x1f')];var _0x3f195c;if(_0x22e20e>=_0xa4a91d){_0x22e20e=_0xa4a91d;_0x3f195c=0xc8;}else{_0x3f195c=0xce;}_0xdb0d29[_0xa6e2('0x19')](_0x3f195c);return _0xdb0d29[_0xa6e2('0x20')]('Content-Range',_0x50310c+'-'+_0x22e20e+'/'+_0xa4a91d)['json'](_0xcf2473);}return null;};}function patchUpdates(_0x4c2aae){return function(_0x523526){try{jsonpatch[_0xa6e2('0x21')](_0x523526,_0x4c2aae,!![]);}catch(_0x226d71){return BPromise['reject'](_0x226d71);}return _0x523526[_0xa6e2('0x22')]();};}function saveUpdates(_0x4514d9,_0x5dafb1){return function(_0x1de24f){if(_0x1de24f){return _0x1de24f[_0xa6e2('0x23')](_0x4514d9)[_0xa6e2('0x24')](function(_0x435b62){return _0x435b62;});}return null;};}function removeEntity(_0x19d8e8,_0x2eadb3){return function(_0x38f4bd){if(_0x38f4bd){return _0x38f4bd[_0xa6e2('0x25')]()['then'](function(){_0x19d8e8[_0xa6e2('0x19')](0xcc)[_0xa6e2('0x1a')]();});}};}function handleEntityNotFound(_0xdd1e83,_0x1e09b9){return function(_0x1e4ad){if(!_0x1e4ad){_0xdd1e83[_0xa6e2('0x18')](0x194);}return _0x1e4ad;};}function handleError(_0x38e322,_0x461056){_0x461056=_0x461056||0x1f4;return function(_0x52c61c){logger[_0xa6e2('0x26')](_0x52c61c['stack']);if(_0x52c61c[_0xa6e2('0x27')]){delete _0x52c61c[_0xa6e2('0x27')];}_0x38e322['status'](_0x461056)[_0xa6e2('0x28')](_0x52c61c);};}exports[_0xa6e2('0x29')]=function(_0x446b59,_0x3048f9){var _0x2e8bfe={},_0x399221={},_0x5818c8={'count':0x0,'rows':[]};var _0x12af03=_[_0xa6e2('0x2a')](db[_0xa6e2('0x2b')]['rawAttributes'],function(_0x225415){return{'name':_0x225415['fieldName'],'type':_0x225415[_0xa6e2('0x2c')]['key']};});_0x399221[_0xa6e2('0x2d')]=_[_0xa6e2('0x2e')](_[_0xa6e2('0x2a')](_0x12af03,'name'),[_0xa6e2('0x27')]);_0x399221[_0xa6e2('0x2f')]=_[_0xa6e2('0x30')](_0x446b59[_0xa6e2('0x2f')]);_0x399221[_0xa6e2('0x31')]=_[_0xa6e2('0x32')](_0x399221['model'],_0x399221[_0xa6e2('0x2f')]);_0x2e8bfe[_0xa6e2('0x33')]=_['intersection'](_0x399221[_0xa6e2('0x2d')],qs['fields'](_0x446b59[_0xa6e2('0x2f')]['fields']));_0x2e8bfe[_0xa6e2('0x33')]=_0x2e8bfe[_0xa6e2('0x33')]['length']?_0x2e8bfe['attributes']:_0x399221[_0xa6e2('0x2d')];if(!_0x446b59['query'][_0xa6e2('0x34')](_0xa6e2('0x35'))){_0x2e8bfe[_0xa6e2('0x1f')]=qs[_0xa6e2('0x1f')](_0x446b59[_0xa6e2('0x2f')]['limit']);_0x2e8bfe[_0xa6e2('0x1d')]=qs[_0xa6e2('0x1d')](_0x446b59['query'][_0xa6e2('0x1d')]);}_0x2e8bfe[_0xa6e2('0x36')]=qs[_0xa6e2('0x37')](_0x446b59[_0xa6e2('0x2f')][_0xa6e2('0x37')]);_0x2e8bfe[_0xa6e2('0x38')]=qs[_0xa6e2('0x31')](_[_0xa6e2('0x39')](_0x446b59[_0xa6e2('0x2f')],_0x399221[_0xa6e2('0x31')]),_0x12af03);if(_0x446b59[_0xa6e2('0x2f')][_0xa6e2('0x3a')]){_0x2e8bfe[_0xa6e2('0x38')]=_[_0xa6e2('0x3b')](_0x2e8bfe['where'],{'$or':_[_0xa6e2('0x2a')](_0x12af03,function(_0x1338df){if(_0x1338df[_0xa6e2('0x2c')]!==_0xa6e2('0x3c')){var _0x7e6d96={};_0x7e6d96[_0x1338df[_0xa6e2('0x27')]]={'$like':'%'+_0x446b59['query'][_0xa6e2('0x3a')]+'%'};return _0x7e6d96;}})});}_0x2e8bfe=_[_0xa6e2('0x3b')]({},_0x2e8bfe,_0x446b59['options']);var _0xaa287f={'where':_0x2e8bfe[_0xa6e2('0x38')]};return db[_0xa6e2('0x2b')][_0xa6e2('0x1e')](_0xaa287f)[_0xa6e2('0x24')](function(_0x1a5acc){_0x5818c8[_0xa6e2('0x1e')]=_0x1a5acc;if(_0x446b59[_0xa6e2('0x2f')][_0xa6e2('0x3d')]){_0x2e8bfe[_0xa6e2('0x3e')]=[{'all':!![]}];}return db[_0xa6e2('0x2b')][_0xa6e2('0x3f')](_0x2e8bfe);})[_0xa6e2('0x24')](function(_0x53dbdb){_0x5818c8['rows']=_0x53dbdb;return _0x5818c8;})[_0xa6e2('0x24')](respondWithFilteredResult(_0x3048f9,_0x2e8bfe))[_0xa6e2('0x40')](handleError(_0x3048f9,null));};exports['show']=function(_0x1bd4ae,_0x321a1f){var _0x26cbb3={'raw':!![],'where':{'id':_0x1bd4ae[_0xa6e2('0x41')]['id']}},_0x5d1a64={};_0x5d1a64[_0xa6e2('0x2d')]=_[_0xa6e2('0x30')](db[_0xa6e2('0x2b')][_0xa6e2('0x42')]);_0x5d1a64[_0xa6e2('0x2f')]=_[_0xa6e2('0x30')](_0x1bd4ae[_0xa6e2('0x2f')]);_0x5d1a64[_0xa6e2('0x31')]=_[_0xa6e2('0x32')](_0x5d1a64[_0xa6e2('0x2d')],_0x5d1a64[_0xa6e2('0x2f')]);_0x26cbb3[_0xa6e2('0x33')]=_['intersection'](_0x5d1a64['model'],qs[_0xa6e2('0x43')](_0x1bd4ae['query'][_0xa6e2('0x43')]));_0x26cbb3[_0xa6e2('0x33')]=_0x26cbb3['attributes'][_0xa6e2('0x44')]?_0x26cbb3['attributes']:_0x5d1a64['model'];if(_0x1bd4ae[_0xa6e2('0x2f')]['includeAll']){_0x26cbb3[_0xa6e2('0x3e')]=[{'all':!![]}];}_0x26cbb3=_[_0xa6e2('0x3b')]({},_0x26cbb3,_0x1bd4ae[_0xa6e2('0x45')]);return db['CmCustomField'][_0xa6e2('0x46')](_0x26cbb3)['then'](handleEntityNotFound(_0x321a1f,null))['then'](respondWithResult(_0x321a1f,null))[_0xa6e2('0x40')](handleError(_0x321a1f,null));};exports[_0xa6e2('0x23')]=function(_0x346c38,_0x4a993f){if(_0x346c38[_0xa6e2('0x47')]['id']){delete _0x346c38['body']['id'];}return db['CmCustomField'][_0xa6e2('0x46')]({'where':{'id':_0x346c38[_0xa6e2('0x41')]['id']}})[_0xa6e2('0x24')](handleEntityNotFound(_0x4a993f,null))[_0xa6e2('0x24')](saveUpdates(_0x346c38[_0xa6e2('0x47')],null))[_0xa6e2('0x24')](respondWithResult(_0x4a993f,null))['catch'](handleError(_0x4a993f,null));};exports[_0xa6e2('0x25')]=function(_0x24360f,_0x265247){return db[_0xa6e2('0x2b')]['find']({'where':{'id':_0x24360f['params']['id']}})[_0xa6e2('0x24')](handleEntityNotFound(_0x265247,null))[_0xa6e2('0x24')](removeEntity(_0x265247,null))[_0xa6e2('0x40')](handleError(_0x265247,null));};exports[_0xa6e2('0x48')]=function(_0x77e2a4,_0x50bdd2){var _0x53afc3;return db[_0xa6e2('0x49')][_0xa6e2('0x4a')](function(_0x1b8262){return db['CmCustomField'][_0xa6e2('0x48')](_0x77e2a4[_0xa6e2('0x47')],{'transaction':_0x1b8262})[_0xa6e2('0x24')](function(_0x477f0d){_0x53afc3=_0x477f0d;var _0x27a8b5={'type':db[_0xa6e2('0x4b')]['TEXT'],'transaction':_0x1b8262};switch(_0x77e2a4[_0xa6e2('0x47')]['type']){case _0xa6e2('0x4c'):_0x27a8b5[_0xa6e2('0x2c')]=db[_0xa6e2('0x4b')][_0xa6e2('0x4d')];break;case _0xa6e2('0x4e'):_0x27a8b5['type']=db[_0xa6e2('0x4b')][_0xa6e2('0x4f')];break;case _0xa6e2('0x50'):_0x27a8b5['type']=db[_0xa6e2('0x4b')][_0xa6e2('0x51')];_0x27a8b5['defaultValue']=![];break;default:}return db[_0xa6e2('0x49')]['queryInterface']['addColumn']('cm_contacts',util[_0xa6e2('0x52')]('cf_%d',_0x53afc3['id']),_0x27a8b5);})['then'](function(){return _0x53afc3;});})['then'](respondWithResult(_0x50bdd2,0xc9))['catch'](handleError(_0x50bdd2,null));}; \ No newline at end of file +var _0x5732=['key','differenceBy','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','params','sequelize','create','Sequelize','TEXT','number','switch','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','CmCustomField','fieldName','type'];(function(_0x2f14db,_0x5b73d1){var _0x452eea=function(_0x432dc9){while(--_0x432dc9){_0x2f14db['push'](_0x2f14db['shift']());}};_0x452eea(++_0x5b73d1);}(_0x5732,0x177));var _0x2573=function(_0xb490a7,_0x3fa11e){_0xb490a7=_0xb490a7-0x0;var _0x34ac2c=_0x5732[_0xb490a7];return _0x34ac2c;};'use strict';var emlformat=require(_0x2573('0x0'));var rimraf=require(_0x2573('0x1'));var zipdir=require(_0x2573('0x2'));var jsonpatch=require(_0x2573('0x3'));var rp=require(_0x2573('0x4'));var moment=require('moment');var BPromise=require(_0x2573('0x5'));var Mustache=require(_0x2573('0x6'));var util=require('util');var path=require(_0x2573('0x7'));var sox=require(_0x2573('0x8'));var csv=require(_0x2573('0x9'));var ejs=require(_0x2573('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2573('0xb'));var squel=require(_0x2573('0xc'));var crypto=require(_0x2573('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2573('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2573('0xf'));var Papa=require(_0x2573('0x10'));var Redis=require(_0x2573('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2573('0x12'));var logger=require(_0x2573('0x13'))(_0x2573('0x14'));var utils=require(_0x2573('0x15'));var config=require(_0x2573('0x16'));var licenseUtil=require(_0x2573('0x17'));var db=require(_0x2573('0x18'))['db'];function respondWithStatusCode(_0x350538,_0x1e2b4a){_0x1e2b4a=_0x1e2b4a||0xcc;return function(_0x2d9495){if(_0x2d9495){return _0x350538[_0x2573('0x19')](_0x1e2b4a);}return _0x350538[_0x2573('0x1a')](_0x1e2b4a)['end']();};}function respondWithResult(_0x143c65,_0x1541af){_0x1541af=_0x1541af||0xc8;return function(_0x314c24){if(_0x314c24){return _0x143c65[_0x2573('0x1a')](_0x1541af)['json'](_0x314c24);}};}function respondWithFilteredResult(_0x389fd2,_0x4637bc){return function(_0x513a6d){if(_0x513a6d){var _0x306dbe=typeof _0x4637bc[_0x2573('0x1b')]===_0x2573('0x1c')&&typeof _0x4637bc[_0x2573('0x1d')]===_0x2573('0x1c');var _0x3dee4a=_0x513a6d[_0x2573('0x1e')];var _0x32d354=_0x306dbe?0x0:_0x4637bc[_0x2573('0x1b')];var _0x5ac87c=_0x306dbe?_0x513a6d[_0x2573('0x1e')]:_0x4637bc['offset']+_0x4637bc[_0x2573('0x1d')];var _0x4a73d1;if(_0x5ac87c>=_0x3dee4a){_0x5ac87c=_0x3dee4a;_0x4a73d1=0xc8;}else{_0x4a73d1=0xce;}_0x389fd2[_0x2573('0x1a')](_0x4a73d1);return _0x389fd2['set'](_0x2573('0x1f'),_0x32d354+'-'+_0x5ac87c+'/'+_0x3dee4a)['json'](_0x513a6d);}return null;};}function patchUpdates(_0x55fa4e){return function(_0x7e63f3){try{jsonpatch[_0x2573('0x20')](_0x7e63f3,_0x55fa4e,!![]);}catch(_0x293383){return BPromise[_0x2573('0x21')](_0x293383);}return _0x7e63f3[_0x2573('0x22')]();};}function saveUpdates(_0x41e001,_0x26974b){return function(_0x277e5e){if(_0x277e5e){return _0x277e5e[_0x2573('0x23')](_0x41e001)['then'](function(_0x2d8460){return _0x2d8460;});}return null;};}function removeEntity(_0x28186f,_0x25e632){return function(_0x465abf){if(_0x465abf){return _0x465abf['destroy']()[_0x2573('0x24')](function(){_0x28186f[_0x2573('0x1a')](0xcc)[_0x2573('0x25')]();});}};}function handleEntityNotFound(_0x2749b8,_0x150ddb){return function(_0x28ebcd){if(!_0x28ebcd){_0x2749b8[_0x2573('0x19')](0x194);}return _0x28ebcd;};}function handleError(_0x5f5614,_0xec5cc){_0xec5cc=_0xec5cc||0x1f4;return function(_0x378271){logger['error'](_0x378271[_0x2573('0x26')]);if(_0x378271[_0x2573('0x27')]){delete _0x378271[_0x2573('0x27')];}_0x5f5614['status'](_0xec5cc)[_0x2573('0x28')](_0x378271);};}exports[_0x2573('0x29')]=function(_0x1c51d7,_0x46352a){var _0xefc956={},_0x66357d={},_0xe45164={'count':0x0,'rows':[]};var _0x3ee232=_['map'](db[_0x2573('0x2a')]['rawAttributes'],function(_0x5e2193){return{'name':_0x5e2193[_0x2573('0x2b')],'type':_0x5e2193[_0x2573('0x2c')][_0x2573('0x2d')]};});_0x66357d['model']=_[_0x2573('0x2e')](_[_0x2573('0x2f')](_0x3ee232,_0x2573('0x27')),['name']);_0x66357d[_0x2573('0x30')]=_[_0x2573('0x31')](_0x1c51d7[_0x2573('0x30')]);_0x66357d[_0x2573('0x32')]=_[_0x2573('0x33')](_0x66357d[_0x2573('0x34')],_0x66357d[_0x2573('0x30')]);_0xefc956[_0x2573('0x35')]=_[_0x2573('0x33')](_0x66357d[_0x2573('0x34')],qs[_0x2573('0x36')](_0x1c51d7[_0x2573('0x30')]['fields']));_0xefc956['attributes']=_0xefc956[_0x2573('0x35')][_0x2573('0x37')]?_0xefc956[_0x2573('0x35')]:_0x66357d[_0x2573('0x34')];if(!_0x1c51d7[_0x2573('0x30')]['hasOwnProperty'](_0x2573('0x38'))){_0xefc956[_0x2573('0x1d')]=qs['limit'](_0x1c51d7['query'][_0x2573('0x1d')]);_0xefc956[_0x2573('0x1b')]=qs[_0x2573('0x1b')](_0x1c51d7[_0x2573('0x30')][_0x2573('0x1b')]);}_0xefc956['order']=qs['sort'](_0x1c51d7['query'][_0x2573('0x39')]);_0xefc956[_0x2573('0x3a')]=qs[_0x2573('0x32')](_[_0x2573('0x3b')](_0x1c51d7['query'],_0x66357d[_0x2573('0x32')]),_0x3ee232);if(_0x1c51d7[_0x2573('0x30')]['filter']){_0xefc956[_0x2573('0x3a')]=_[_0x2573('0x3c')](_0xefc956[_0x2573('0x3a')],{'$or':_[_0x2573('0x2f')](_0x3ee232,function(_0x248006){if(_0x248006[_0x2573('0x2c')]!==_0x2573('0x3d')){var _0x1b15ad={};_0x1b15ad[_0x248006[_0x2573('0x27')]]={'$like':'%'+_0x1c51d7[_0x2573('0x30')][_0x2573('0x3e')]+'%'};return _0x1b15ad;}})});}_0xefc956=_['merge']({},_0xefc956,_0x1c51d7[_0x2573('0x3f')]);var _0x117612={'where':_0xefc956[_0x2573('0x3a')]};return db[_0x2573('0x2a')]['count'](_0x117612)[_0x2573('0x24')](function(_0x45fbf4){_0xe45164['count']=_0x45fbf4;if(_0x1c51d7[_0x2573('0x30')][_0x2573('0x40')]){_0xefc956[_0x2573('0x41')]=[{'all':!![]}];}return db[_0x2573('0x2a')][_0x2573('0x42')](_0xefc956);})[_0x2573('0x24')](function(_0x4e8146){_0xe45164[_0x2573('0x43')]=_0x4e8146;return _0xe45164;})['then'](respondWithFilteredResult(_0x46352a,_0xefc956))[_0x2573('0x44')](handleError(_0x46352a,null));};exports[_0x2573('0x45')]=function(_0x4aa8db,_0x201dbc){var _0x395645={'raw':!![],'where':{'id':_0x4aa8db['params']['id']}},_0x41654e={};_0x41654e[_0x2573('0x34')]=_[_0x2573('0x31')](db[_0x2573('0x2a')][_0x2573('0x46')]);_0x41654e[_0x2573('0x30')]=_[_0x2573('0x31')](_0x4aa8db['query']);_0x41654e['filters']=_[_0x2573('0x33')](_0x41654e[_0x2573('0x34')],_0x41654e[_0x2573('0x30')]);_0x395645['attributes']=_[_0x2573('0x33')](_0x41654e[_0x2573('0x34')],qs[_0x2573('0x36')](_0x4aa8db[_0x2573('0x30')][_0x2573('0x36')]));_0x395645[_0x2573('0x35')]=_0x395645[_0x2573('0x35')][_0x2573('0x37')]?_0x395645[_0x2573('0x35')]:_0x41654e[_0x2573('0x34')];if(_0x4aa8db['query'][_0x2573('0x40')]){_0x395645[_0x2573('0x41')]=[{'all':!![]}];}_0x395645=_['merge']({},_0x395645,_0x4aa8db['options']);return db['CmCustomField'][_0x2573('0x47')](_0x395645)['then'](handleEntityNotFound(_0x201dbc,null))[_0x2573('0x24')](respondWithResult(_0x201dbc,null))[_0x2573('0x44')](handleError(_0x201dbc,null));};exports['update']=function(_0x1aa4e8,_0x23c8ae){if(_0x1aa4e8['body']['id']){delete _0x1aa4e8[_0x2573('0x48')]['id'];}return db[_0x2573('0x2a')][_0x2573('0x47')]({'where':{'id':_0x1aa4e8[_0x2573('0x49')]['id']}})[_0x2573('0x24')](handleEntityNotFound(_0x23c8ae,null))[_0x2573('0x24')](saveUpdates(_0x1aa4e8[_0x2573('0x48')],null))[_0x2573('0x24')](respondWithResult(_0x23c8ae,null))['catch'](handleError(_0x23c8ae,null));};exports['destroy']=function(_0x1b1194,_0x2faa34){return db['CmCustomField']['find']({'where':{'id':_0x1b1194[_0x2573('0x49')]['id']}})[_0x2573('0x24')](handleEntityNotFound(_0x2faa34,null))[_0x2573('0x24')](removeEntity(_0x2faa34,null))[_0x2573('0x44')](handleError(_0x2faa34,null));};exports['create']=function(_0xc0532d,_0x1d5c48){var _0x260d1f;return db[_0x2573('0x4a')]['transaction'](function(_0x199843){return db[_0x2573('0x2a')][_0x2573('0x4b')](_0xc0532d[_0x2573('0x48')],{'transaction':_0x199843})[_0x2573('0x24')](function(_0x229360){_0x260d1f=_0x229360;var _0x393a9a={'type':db[_0x2573('0x4c')][_0x2573('0x4d')],'transaction':_0x199843};switch(_0xc0532d['body'][_0x2573('0x2c')]){case'text':_0x393a9a['type']=db['Sequelize'][_0x2573('0x4d')];break;case _0x2573('0x4e'):_0x393a9a[_0x2573('0x2c')]=db[_0x2573('0x4c')]['INTEGER'];break;case _0x2573('0x4f'):_0x393a9a['type']=db[_0x2573('0x4c')]['BOOLEAN'];_0x393a9a['defaultValue']=![];break;default:}return db['sequelize']['queryInterface'][_0x2573('0x50')](_0x2573('0x51'),util[_0x2573('0x52')](_0x2573('0x53'),_0x260d1f['id']),_0x393a9a);})[_0x2573('0x24')](function(){return _0x260d1f;});})[_0x2573('0x24')](respondWithResult(_0x1d5c48,0xc9))['catch'](handleError(_0x1d5c48,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 97dfa7e..d1a3016 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 _0xe8e3=['cm_custom_fields','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField'];(function(_0x497665,_0x3ea3b2){var _0x1ff718=function(_0x49d4a7){while(--_0x49d4a7){_0x497665['push'](_0x497665['shift']());}};_0x1ff718(++_0x3ea3b2);}(_0xe8e3,0x1c1));var _0x3e8e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe8e3[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x3e8e('0x0'));var logger=require(_0x3e8e('0x1'))(_0x3e8e('0x2'));var moment=require(_0x3e8e('0x3'));var BPromise=require(_0x3e8e('0x4'));var rp=require(_0x3e8e('0x5'));var fs=require('fs');var path=require(_0x3e8e('0x6'));var rimraf=require(_0x3e8e('0x7'));var config=require(_0x3e8e('0x8'));var attributes=require(_0x3e8e('0x9'));module[_0x3e8e('0xa')]=function(_0x2ef1b3,_0x18f81b){return _0x2ef1b3[_0x3e8e('0xb')](_0x3e8e('0xc'),attributes,{'tableName':_0x3e8e('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x157e=['cm_custom_fields','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x157e,0xd3));var _0xe157=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x157e[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xe157('0x0'));var moment=require(_0xe157('0x1'));var BPromise=require(_0xe157('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe157('0x3'));var rimraf=require(_0xe157('0x4'));var config=require(_0xe157('0x5'));var attributes=require(_0xe157('0x6'));module['exports']=function(_0x3777cb,_0x4cf062){return _0x3777cb[_0xe157('0x7')](_0xe157('0x8'),attributes,{'tableName':_0xe157('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index fceabf8..0483c1c 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 _0xdeaa=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0xc52129,_0x21da3e){var _0x4c87d0=function(_0x297057){while(--_0x297057){_0xc52129['push'](_0xc52129['shift']());}};_0x4c87d0(++_0x21da3e);}(_0xdeaa,0x177));var _0xadea=function(_0x5b7e93,_0x13c2ce){_0x5b7e93=_0x5b7e93-0x0;var _0x2fc530=_0xdeaa[_0x5b7e93];return _0x2fc530;};'use strict';var _=require(_0xadea('0x0'));var util=require(_0xadea('0x1'));var moment=require(_0xadea('0x2'));var BPromise=require(_0xadea('0x3'));var rs=require(_0xadea('0x4'));var fs=require('fs');var Redis=require(_0xadea('0x5'));var db=require(_0xadea('0x6'))['db'];var utils=require(_0xadea('0x7'));var logger=require(_0xadea('0x8'))(_0xadea('0x9'));var config=require(_0xadea('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xadea('0xb')][_0xadea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31374a,_0x73a22f,_0x30ee68){return new BPromise(function(_0x41a17d,_0xf573ea){return client[_0xadea('0xd')](_0x31374a,_0x30ee68)[_0xadea('0xe')](function(_0x10ed2c){logger[_0xadea('0xf')](_0xadea('0x10'),_0x73a22f,_0xadea('0x11'));logger[_0xadea('0x12')](_0xadea('0x13'),_0x73a22f,'request\x20sent',JSON[_0xadea('0x14')](_0x10ed2c));if(_0x10ed2c[_0xadea('0x15')]){if(_0x10ed2c['error']['code']===0x1f4){logger['error'](_0xadea('0x10'),_0x73a22f,_0x10ed2c[_0xadea('0x15')]['message']);return _0xf573ea(_0x10ed2c[_0xadea('0x15')][_0xadea('0x16')]);}logger[_0xadea('0x15')](_0xadea('0x10'),_0x73a22f,_0x10ed2c[_0xadea('0x15')][_0xadea('0x16')]);return _0x41a17d(_0x10ed2c[_0xadea('0x15')][_0xadea('0x16')]);}else{logger[_0xadea('0xf')](_0xadea('0x10'),_0x73a22f,_0xadea('0x11'));_0x41a17d(_0x10ed2c[_0xadea('0x17')]['message']);}})[_0xadea('0x18')](function(_0x1df185){logger[_0xadea('0x15')](_0xadea('0x10'),_0x73a22f,_0x1df185);_0xf573ea(_0x1df185);});});} \ No newline at end of file +var _0x5246=['../../config/logger','rpc','client','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','ioredis','../../mysqldb'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0x5246,0x84));var _0x6524=function(_0x4775ad,_0x1efbfb){_0x4775ad=_0x4775ad-0x0;var _0x154fca=_0x5246[_0x4775ad];return _0x154fca;};'use strict';var _=require('lodash');var util=require(_0x6524('0x0'));var moment=require('moment');var BPromise=require(_0x6524('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6524('0x2'));var db=require(_0x6524('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6524('0x4'))(_0x6524('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6524('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a643e,_0x39d6cf,_0x5f249e){return new BPromise(function(_0x329bbb,_0x333160){return client['request'](_0x2a643e,_0x5f249e)[_0x6524('0x7')](function(_0x31bed9){logger[_0x6524('0x8')](_0x6524('0x9'),_0x39d6cf,_0x6524('0xa'));logger[_0x6524('0xb')](_0x6524('0xc'),_0x39d6cf,_0x6524('0xa'),JSON[_0x6524('0xd')](_0x31bed9));if(_0x31bed9[_0x6524('0xe')]){if(_0x31bed9[_0x6524('0xe')]['code']===0x1f4){logger[_0x6524('0xe')](_0x6524('0x9'),_0x39d6cf,_0x31bed9['error']['message']);return _0x333160(_0x31bed9[_0x6524('0xe')][_0x6524('0xf')]);}logger[_0x6524('0xe')](_0x6524('0x9'),_0x39d6cf,_0x31bed9[_0x6524('0xe')][_0x6524('0xf')]);return _0x329bbb(_0x31bed9[_0x6524('0xe')][_0x6524('0xf')]);}else{logger[_0x6524('0x8')](_0x6524('0x9'),_0x39d6cf,_0x6524('0xa'));_0x329bbb(_0x31bed9[_0x6524('0x10')][_0x6524('0xf')]);}})['catch'](function(_0x2954a1){logger[_0x6524('0xe')]('CmCustomField,\x20%s,\x20%s',_0x39d6cf,_0x2954a1);_0x333160(_0x2954a1);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f7f9934..3aa2e25 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 _0xb27d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','/:id','isAuthenticated','show','post','update','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x5e9018,_0x5d3a28){var _0x2062e2=function(_0x4aa0d8){while(--_0x4aa0d8){_0x5e9018['push'](_0x5e9018['shift']());}};_0x2062e2(++_0x5d3a28);}(_0xb27d,0xe5));var _0xdb27=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xb27d[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0xdb27('0x0'));var util=require(_0xdb27('0x1'));var path=require(_0xdb27('0x2'));var timeout=require(_0xdb27('0x3'));var express=require('express');var router=express[_0xdb27('0x4')]();var fs_extra=require(_0xdb27('0x5'));var auth=require(_0xdb27('0x6'));var interaction=require(_0xdb27('0x7'));var config=require(_0xdb27('0x8'));var controller=require(_0xdb27('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdb27('0xa')]);router['get'](_0xdb27('0xb'),auth[_0xdb27('0xc')](),controller[_0xdb27('0xd')]);router[_0xdb27('0xe')]('/',auth[_0xdb27('0xc')](),controller['create']);router['put']('/:id',auth[_0xdb27('0xc')](),controller[_0xdb27('0xf')]);router[_0xdb27('0x10')]('/:id',auth[_0xdb27('0xc')](),controller[_0xdb27('0x11')]);module['exports']=router; \ No newline at end of file +var _0x34f8=['../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x235b7b,_0x18c190){var _0x4b2a87=function(_0x50c837){while(--_0x50c837){_0x235b7b['push'](_0x235b7b['shift']());}};_0x4b2a87(++_0x18c190);}(_0x34f8,0x80));var _0x834f=function(_0x31f77e,_0x64cd4d){_0x31f77e=_0x31f77e-0x0;var _0x3bf479=_0x34f8[_0x31f77e];return _0x3bf479;};'use strict';var multer=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var path=require(_0x834f('0x2'));var timeout=require(_0x834f('0x3'));var express=require(_0x834f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x834f('0x5'));var interaction=require(_0x834f('0x6'));var config=require('../../config/environment');var controller=require(_0x834f('0x7'));router[_0x834f('0x8')]('/',auth[_0x834f('0x9')](),controller[_0x834f('0xa')]);router['get']('/:id',auth[_0x834f('0x9')](),controller[_0x834f('0xb')]);router[_0x834f('0xc')]('/',auth[_0x834f('0x9')](),controller['create']);router[_0x834f('0xd')](_0x834f('0xe'),auth['isAuthenticated'](),controller[_0x834f('0xf')]);router[_0x834f('0x10')](_0x834f('0xe'),auth[_0x834f('0x9')](),controller[_0x834f('0x11')]);module[_0x834f('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 3dab1be..5cef190 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 _0xe129=['contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','UNSIGNED'];(function(_0x43ee39,_0x4d5665){var _0x394679=function(_0x4383bd){while(--_0x4383bd){_0x43ee39['push'](_0x43ee39['shift']());}};_0x394679(++_0x4d5665);}(_0xe129,0x139));var _0x9e12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe129[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require(_0x9e12('0x0'));module[_0x9e12('0x1')]={'phone':{'type':Sequelize[_0x9e12('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x9e12('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9e12('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x9e12('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9e12('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9e12('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9e12('0x4')]},'priority':{'type':Sequelize[_0x9e12('0x5')](0x2)[_0x9e12('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9e12('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x9e12('0x7')},'ListId':{'type':Sequelize[_0x9e12('0x5')],'unique':'contactListQueue'},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x9e12('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x9e12('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9e12('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9e12('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9e12('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9e12('0x5')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6605=['BOOLEAN','format','INTEGER','DATE','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x6605,0x1be));var _0x5660=function(_0x34b863,_0x46e0a4){_0x34b863=_0x34b863-0x0;var _0x20cabb=_0x6605[_0x34b863];return _0x20cabb;};'use strict';var moment=require(_0x5660('0x0'));var Sequelize=require(_0x5660('0x1'));module[_0x5660('0x2')]={'phone':{'type':Sequelize[_0x5660('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x5660('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5660('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5660('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5660('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x5660('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5660('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5660('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x5660('0x6')],'unique':_0x5660('0x9')},'ListId':{'type':Sequelize[_0x5660('0x6')],'unique':_0x5660('0x9')},'UserId':{'type':Sequelize[_0x5660('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5660('0x9')},'CampaignId':{'type':Sequelize[_0x5660('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5660('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'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 0e6ec12..298d79f 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 _0x379e=['COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','isNumber','error','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','type','key','map','query','keys','filters','intersection','model','concat','$and','$or','$gt','$gte','$lt','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contains','$contained','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','CmHopper','then','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','params','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','merge','omit','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','CmContact','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal'];(function(_0xfbc863,_0x3473a9){var _0x2eb889=function(_0xe367ef){while(--_0xe367ef){_0xfbc863['push'](_0xfbc863['shift']());}};_0x2eb889(++_0x3473a9);}(_0x379e,0x1cd));var _0xe379=function(_0x2f6237,_0x14872c){_0x2f6237=_0x2f6237-0x0;var _0x449203=_0x379e[_0x2f6237];return _0x449203;};'use strict';var emlformat=require(_0xe379('0x0'));var rimraf=require(_0xe379('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe379('0x2'));var rp=require(_0xe379('0x3'));var moment=require(_0xe379('0x4'));var BPromise=require(_0xe379('0x5'));var Mustache=require(_0xe379('0x6'));var util=require(_0xe379('0x7'));var path=require(_0xe379('0x8'));var sox=require(_0xe379('0x9'));var csv=require(_0xe379('0xa'));var ejs=require(_0xe379('0xb'));var fs=require('fs');var fs_extra=require(_0xe379('0xc'));var _=require(_0xe379('0xd'));var squel=require(_0xe379('0xe'));var crypto=require(_0xe379('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe379('0x10'));var toCsv=require(_0xe379('0xa'));var querystring=require('querystring');var Papa=require(_0xe379('0x11'));var Redis=require(_0xe379('0x12'));var authService=require(_0xe379('0x13'));var qs=require(_0xe379('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe379('0x15'));var logger=require(_0xe379('0x16'))(_0xe379('0x17'));var utils=require(_0xe379('0x18'));var config=require(_0xe379('0x19'));var licenseUtil=require(_0xe379('0x1a'));var db=require(_0xe379('0x1b'))['db'];function respondWithStatusCode(_0x54c88d,_0xee8815){_0xee8815=_0xee8815||0xcc;return function(_0x6a65ab){if(_0x6a65ab){return _0x54c88d[_0xe379('0x1c')](_0xee8815);}return _0x54c88d[_0xe379('0x1d')](_0xee8815)[_0xe379('0x1e')]();};}function respondWithResult(_0x3d59ba,_0x2133ee){_0x2133ee=_0x2133ee||0xc8;return function(_0x5b14da){if(_0x5b14da){return _0x3d59ba['status'](_0x2133ee)[_0xe379('0x1f')](_0x5b14da);}};}function respondWithFilteredResult(_0x23aaa2,_0x4e2d58){return function(_0x31ca32){if(_0x31ca32){var _0x4ed73b=typeof _0x4e2d58[_0xe379('0x20')]==='undefined'&&typeof _0x4e2d58[_0xe379('0x21')]===_0xe379('0x22');var _0x20ddf1=_0x31ca32[_0xe379('0x23')];var _0x5700b1=_0x4ed73b?0x0:_0x4e2d58['offset'];var _0x43e75c=_0x4ed73b?_0x31ca32[_0xe379('0x23')]:_0x4e2d58['offset']+_0x4e2d58[_0xe379('0x21')];var _0x54bbfd;if(_0x43e75c>=_0x20ddf1){_0x43e75c=_0x20ddf1;_0x54bbfd=0xc8;}else{_0x54bbfd=0xce;}_0x23aaa2[_0xe379('0x1d')](_0x54bbfd);return _0x23aaa2[_0xe379('0x24')](_0xe379('0x25'),_0x5700b1+'-'+_0x43e75c+'/'+_0x20ddf1)[_0xe379('0x1f')](_0x31ca32);}return null;};}function patchUpdates(_0x32fd78){return function(_0x3bb944){try{jsonpatch[_0xe379('0x26')](_0x3bb944,_0x32fd78,!![]);}catch(_0x26dd8c){return BPromise[_0xe379('0x27')](_0x26dd8c);}return _0x3bb944[_0xe379('0x28')]();};}function saveUpdates(_0x380a88,_0x33d123){return function(_0x2ff020){if(_0x2ff020){return _0x2ff020[_0xe379('0x29')](_0x380a88)['then'](function(_0x232219){return _0x232219;});}return null;};}function removeEntity(_0x28b33b,_0x1051eb){return function(_0x176b2c){if(_0x176b2c){return _0x176b2c[_0xe379('0x2a')]()['then'](function(){_0x28b33b[_0xe379('0x1d')](0xcc)[_0xe379('0x1e')]();});}};}function handleEntityNotFound(_0x5e72c3,_0x152ea4){return function(_0x4b9739){if(!_0x4b9739){_0x5e72c3[_0xe379('0x1c')](0x194);}return _0x4b9739;};}function handleError(_0x1a495c,_0x495188){_0x495188=_0x495188||0x1f4;return function(_0x5038ad){logger['error'](_0x5038ad[_0xe379('0x2b')]);if(_0x5038ad[_0xe379('0x2c')]){delete _0x5038ad[_0xe379('0x2c')];}_0x1a495c['status'](_0x495188)['send'](_0x5038ad);};}exports[_0xe379('0x2d')]=function(_0xd52122,_0x343bdb){var _0x13dd14={},_0x2569d4={},_0x539a27={'count':0x0,'rows':[]};var _0x19fd35=_['map'](db['CmHopper']['rawAttributes'],function(_0x4c9b33){return{'name':_0x4c9b33['fieldName'],'type':_0x4c9b33[_0xe379('0x2e')][_0xe379('0x2f')]};});_0x2569d4['model']=_[_0xe379('0x30')](_0x19fd35,'name');_0x2569d4[_0xe379('0x31')]=_[_0xe379('0x32')](_0xd52122['query']);_0x2569d4[_0xe379('0x33')]=_[_0xe379('0x34')](_0x2569d4[_0xe379('0x35')],_0x2569d4[_0xe379('0x31')]);_0x2569d4[_0xe379('0x33')]=_[_0xe379('0x36')](_0x2569d4[_0xe379('0x33')],[_0xe379('0x37'),_0xe379('0x38'),_0xe379('0x39'),_0xe379('0x3a'),_0xe379('0x3b'),'$lte','$ne',_0xe379('0x3c'),_0xe379('0x3d'),_0xe379('0x3e'),_0xe379('0x3f'),_0xe379('0x40'),_0xe379('0x41'),_0xe379('0x42'),'$notLike',_0xe379('0x43'),_0xe379('0x44'),_0xe379('0x42'),'$overlap',_0xe379('0x45'),_0xe379('0x46'),'$any']);_0x13dd14[_0xe379('0x47')]=_['intersection'](_0x2569d4[_0xe379('0x35')],qs[_0xe379('0x48')](_0xd52122[_0xe379('0x31')]['fields']));_0x13dd14[_0xe379('0x47')]=_0x13dd14['attributes'][_0xe379('0x49')]?_0x13dd14['attributes']:_0x2569d4[_0xe379('0x35')];if(!_0xd52122['query']['hasOwnProperty'](_0xe379('0x4a'))){_0x13dd14[_0xe379('0x21')]=qs[_0xe379('0x21')](_0xd52122[_0xe379('0x31')]['limit']);_0x13dd14['offset']=qs[_0xe379('0x20')](_0xd52122[_0xe379('0x31')][_0xe379('0x20')]);}_0x13dd14['order']=qs[_0xe379('0x4b')](_0xd52122[_0xe379('0x31')]['sort']);_0x13dd14[_0xe379('0x4c')]=qs[_0xe379('0x33')](_[_0xe379('0x4d')](_0xd52122[_0xe379('0x31')],_0x2569d4['filters']),_0x19fd35);if(_0xd52122['query'][_0xe379('0x4e')]){_0x13dd14[_0xe379('0x4c')]=_['merge'](_0x13dd14['where'],{'$or':_[_0xe379('0x30')](_0x19fd35,function(_0x3152ad){if(_0x3152ad[_0xe379('0x2e')]!==_0xe379('0x4f')){var _0x51da3f={};_0x51da3f[_0x3152ad[_0xe379('0x2c')]]={'$like':'%'+_0xd52122[_0xe379('0x31')]['filter']+'%'};return _0x51da3f;}})});}_0x13dd14=_['merge']({},_0x13dd14,_0xd52122['options']);var _0x4b72e5={'where':_0x13dd14[_0xe379('0x4c')]};return db[_0xe379('0x50')][_0xe379('0x23')](_0x4b72e5)[_0xe379('0x51')](function(_0x295ed9){_0x539a27[_0xe379('0x23')]=_0x295ed9;if(_0xd52122[_0xe379('0x31')][_0xe379('0x52')]){_0x13dd14['include']=[{'all':!![]}];}return db[_0xe379('0x50')][_0xe379('0x53')](_0x13dd14);})[_0xe379('0x51')](function(_0x2f87d7){_0x539a27[_0xe379('0x54')]=_0x2f87d7;return _0x539a27;})[_0xe379('0x51')](respondWithFilteredResult(_0x343bdb,_0x13dd14))[_0xe379('0x55')](handleError(_0x343bdb,null));};exports[_0xe379('0x56')]=function(_0x14e5ea,_0x568ff4){var _0x1e8174={'raw':!![],'where':{'id':_0x14e5ea['params']['id']}},_0x28d505={};_0x28d505[_0xe379('0x35')]=_[_0xe379('0x32')](db[_0xe379('0x50')][_0xe379('0x57')]);_0x28d505[_0xe379('0x31')]=_['keys'](_0x14e5ea['query']);_0x28d505[_0xe379('0x33')]=_[_0xe379('0x34')](_0x28d505[_0xe379('0x35')],_0x28d505[_0xe379('0x31')]);_0x1e8174['attributes']=_[_0xe379('0x34')](_0x28d505[_0xe379('0x35')],qs[_0xe379('0x48')](_0x14e5ea[_0xe379('0x31')][_0xe379('0x48')]));_0x1e8174[_0xe379('0x47')]=_0x1e8174[_0xe379('0x47')][_0xe379('0x49')]?_0x1e8174[_0xe379('0x47')]:_0x28d505[_0xe379('0x35')];if(_0x14e5ea[_0xe379('0x31')][_0xe379('0x52')]){_0x1e8174[_0xe379('0x58')]=[{'all':!![]}];}_0x1e8174=_['merge']({},_0x1e8174,_0x14e5ea[_0xe379('0x59')]);return db[_0xe379('0x50')][_0xe379('0x5a')](_0x1e8174)[_0xe379('0x51')](handleEntityNotFound(_0x568ff4,null))[_0xe379('0x51')](respondWithResult(_0x568ff4,null))[_0xe379('0x55')](handleError(_0x568ff4,null));};exports[_0xe379('0x5b')]=function(_0x488545,_0x519a92){return db['CmHopper'][_0xe379('0x5b')](_0x488545[_0xe379('0x5c')],{})[_0xe379('0x51')](respondWithResult(_0x519a92,0xc9))[_0xe379('0x55')](handleError(_0x519a92,null));};exports[_0xe379('0x29')]=function(_0x3b1ddf,_0x3ec332){if(_0x3b1ddf[_0xe379('0x5c')]['id']){delete _0x3b1ddf[_0xe379('0x5c')]['id'];}return db[_0xe379('0x50')][_0xe379('0x5a')]({'where':{'id':_0x3b1ddf[_0xe379('0x5d')]['id']}})[_0xe379('0x51')](handleEntityNotFound(_0x3ec332,null))['then'](saveUpdates(_0x3b1ddf[_0xe379('0x5c')],null))[_0xe379('0x51')](respondWithResult(_0x3ec332,null))['catch'](handleError(_0x3ec332,null));};exports['describe']=function(_0x29d564,_0x4fa77d){return db['CmHopper'][_0xe379('0x5e')]()[_0xe379('0x51')](respondWithResult(_0x4fa77d,null))['catch'](handleError(_0x4fa77d,null));};exports[_0xe379('0x2a')]=function(_0x21622c,_0x143b20){var _0x56cd56;return db['CmHopper'][_0xe379('0x5a')]({'where':{'id':_0x21622c['params']['id']}})[_0xe379('0x51')](handleEntityNotFound(_0x143b20,null))[_0xe379('0x51')](function(_0x1b0250){if(_0x1b0250){return _0x1b0250[_0xe379('0x2a')]()[_0xe379('0x51')](function(_0x3672db){return _0x3672db;});}})[_0xe379('0x51')](function(_0x3ce330){_0x56cd56=_0x3ce330;if(_0x3ce330){if(_0x3ce330[_0xe379('0x5f')]||_0x3ce330['CampaignId']){return db[_0x3ce330[_0xe379('0x5f')]?_0xe379('0x60'):_0xe379('0x61')][_0xe379('0x5a')]({'where':{'id':_0x3ce330[_0xe379('0x5f')]?_0x3ce330[_0xe379('0x5f')]:_0x3ce330[_0xe379('0x62')]},'attributes':['id',_0xe379('0x2c')],'raw':!![]});}}})[_0xe379('0x51')](function(_0x2a5b64){var _0x20f490={};if(_0x2a5b64){_[_0xe379('0x63')](_0x20f490,_[_0xe379('0x64')](_0x56cd56['dataValues'],['createdAt',_0xe379('0x65'),'id']));_0x20f490[_0xe379('0x66')]=0x15;_0x20f490[_0xe379('0x67')]=_0xe379('0x68');_0x20f490['campaign']=_0x2a5b64[_0xe379('0x2c')];_0x20f490[_0xe379('0x69')]=_0x21622c[_0xe379('0x6a')][_0xe379('0x2c')];_0x20f490[_0xe379('0x6b')]=_0x21622c[_0xe379('0x6a')]['id'];_0x20f490[_0xe379('0x68')]=!![];_0x20f490[_0xe379('0x6c')]=moment()[_0xe379('0x6d')](_0xe379('0x6e'));_0x20f490[_0xe379('0x6f')]=_0x56cd56['phone'];_0x20f490[_0xe379('0x70')]=_0x56cd56[_0xe379('0x5f')]?_0xe379('0x71'):'ivr';return db[_0xe379('0x72')][_0xe379('0x5a')]({'where':{'id':_0x20f490['ContactId']},'attributes':[_0xe379('0x73'),_0xe379('0x74')]})[_0xe379('0x51')](function(_0x30d9ed){if(!_[_0xe379('0x75')](_0x143b20)&&!_['isNil'](_0x30d9ed[_0xe379('0x73')])){_0x20f490['calleridname']=_0x30d9ed[_0xe379('0x73')];if(!_[_0xe379('0x75')](_0x30d9ed['lastName'])){_0x20f490[_0xe379('0x76')]+='\x20'+_0x30d9ed[_0xe379('0x74')];}}})['finally'](function(){return db[_0xe379('0x77')][_0xe379('0x5b')](_0x20f490);});}})[_0xe379('0x51')](function(){return _0x143b20[_0xe379('0x1d')](0xcc)['end']();})[_0xe379('0x55')](handleError(_0x143b20,null));};exports[_0xe379('0x78')]=function(_0x5f0279,_0x452093,_0x376e91){var _0x5a5351=[];return db[_0xe379('0x72')][_0xe379('0x5e')]()[_0xe379('0x51')](function(_0x550ff0){_0x5a5351=_[_0xe379('0x32')](_0x550ff0);return _0x5f0279[_0xe379('0x6a')]['getVoiceQueues']({'where':{'type':_0xe379('0x79'),'dialActive':!![],'dialMethod':_0xe379('0x7a')},'attributes':['id',_0xe379('0x7b')],'raw':!![]});})[_0xe379('0x51')](function(_0x1a4aee){if(_0x1a4aee&&_0x1a4aee['length']){return db['sequelize'][_0xe379('0x7c')](function(_0x24d694){var _0x37f5db={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe379('0x6d')](_0xe379('0x6e'))},'VoiceQueueId':{'$in':_[_0xe379('0x30')](_0x1a4aee,'id')},'$or':[{'UserId':null},{'UserId':_0x5f0279[_0xe379('0x6a')]['id']}]};var _0x355abd=[];if(_0x5f0279[_0xe379('0x5c')][_0xe379('0x7d')]&&_0x5f0279[_0xe379('0x5c')][_0xe379('0x7d')]===_0xe379('0x7e')){if(!_[_0xe379('0x7f')](_0x5f0279['body'][_0xe379('0x80')])){_0x37f5db['id']={'$in':_0x5f0279[_0xe379('0x5c')][_0xe379('0x80')]};}_0x355abd=[[_0xe379('0x81'),_0xe379('0x82')],[_0xe379('0x83'),_0x1a4aee[0x0][_0xe379('0x7b')]===_0xe379('0x82')?_0xe379('0x84'):_0xe379('0x82')],db[_0xe379('0x85')][_0xe379('0x86')](_0xe379('0x87')),['id',_0xe379('0x84')]];}else{if(!_[_0xe379('0x7f')](_0x5f0279[_0xe379('0x5c')][_0xe379('0x80')])){_0x37f5db['id']={'$notIn':_0x5f0279[_0xe379('0x5c')]['hopperIds']};}_0x355abd=[[_0xe379('0x81'),'DESC'],['scheduledAt',_0x1a4aee[0x0][_0xe379('0x7b')]],db[_0xe379('0x85')]['literal'](_0xe379('0x88')),['id',_0xe379('0x82')]];}return db[_0xe379('0x50')][_0xe379('0x89')]({'attributes':['id','scheduledat'],'where':_0x37f5db,'order':_0x355abd,'transaction':_0x24d694,'lock':_0x24d694[_0xe379('0x8a')][_0xe379('0x8b')],'include':[{'model':db[_0xe379('0x72')],'as':_0xe379('0x8c'),'attributes':_0x5a5351,'include':[{'model':db[_0xe379('0x8d')],'as':_0xe379('0x8e'),'attributes':['id','name']}]},{'model':db[_0xe379('0x8f')],'as':'List','attributes':['id','name']},{'model':db[_0xe379('0x60')],'as':_0xe379('0x90'),'attributes':['id','name','dialActive']}]})[_0xe379('0x51')](function(_0xa14ff0){if(_0xa14ff0){return _0xa14ff0[_0xe379('0x29')]({'UserId':_0x5f0279[_0xe379('0x6a')]['id']},{'transaction':_0x24d694});}});});}})[_0xe379('0x51')](handleEntityNotFound(_0x452093,null))[_0xe379('0x51')](respondWithResult(_0x452093,null))[_0xe379('0x55')](handleError(_0x452093,null));};exports['getOpenContacts']=function(_0x19331f,_0x36c0ec,_0x5227e2){return _0x19331f['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xe379('0x7a')},'attributes':['id'],'raw':!![]})[_0xe379('0x51')](function(_0xd5df25){if(_0xd5df25&&_0xd5df25[_0xe379('0x49')]){return db['CmHopper'][_0xe379('0x23')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe379('0x6d')](_0xe379('0x6e'))},'VoiceQueueId':{'$in':_[_0xe379('0x30')](_0xd5df25,'id')},'$or':[{'UserId':null},{'UserId':_0x19331f['user']['id']}]}});}return 0x0;})[_0xe379('0x51')](function(_0x26c812){if(!_['isNil'](_0x26c812)&&_[_0xe379('0x91')](_0x26c812)){return _0x36c0ec[_0xe379('0x1d')](0xc8)[_0xe379('0x1f')]({'contacts':_0x26c812});}else{logger[_0xe379('0x92')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xe379('0x93'),0x194,_0xe379('0x94'));_0x36c0ec['sendStatus'](0x194);}})[_0xe379('0x55')](handleError(_0x36c0ec,null));}; \ No newline at end of file +var _0xc442=['catch','show','keys','create','body','find','params','describe','destroy','VoiceQueueId','CampaignId','Campaign','omit','dataValues','updatedAt','state','deleted','campaign','user','UserId','deletedat','calleridnum','phone','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','format','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','scheduledat','LOCK','UPDATE','Contact','Company','CmList','List','Queue','getOpenContacts','preview','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','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/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','concat','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$like','$notLike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3eca88,_0x34268e){var _0x5f58a4=function(_0xe7a331){while(--_0xe7a331){_0x3eca88['push'](_0x3eca88['shift']());}};_0x5f58a4(++_0x34268e);}(_0xc442,0x165));var _0x2c44=function(_0x1903dd,_0x25136f){_0x1903dd=_0x1903dd-0x0;var _0x2a4e4c=_0xc442[_0x1903dd];return _0x2a4e4c;};'use strict';var emlformat=require(_0x2c44('0x0'));var rimraf=require(_0x2c44('0x1'));var zipdir=require(_0x2c44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c44('0x3'));var moment=require(_0x2c44('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2c44('0x5'));var util=require(_0x2c44('0x6'));var path=require(_0x2c44('0x7'));var sox=require(_0x2c44('0x8'));var csv=require(_0x2c44('0x9'));var ejs=require(_0x2c44('0xa'));var fs=require('fs');var fs_extra=require(_0x2c44('0xb'));var _=require(_0x2c44('0xc'));var squel=require(_0x2c44('0xd'));var crypto=require(_0x2c44('0xe'));var jsforce=require(_0x2c44('0xf'));var deskjs=require(_0x2c44('0x10'));var toCsv=require(_0x2c44('0x9'));var querystring=require(_0x2c44('0x11'));var Papa=require(_0x2c44('0x12'));var Redis=require(_0x2c44('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2c44('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c44('0x15'))('api');var utils=require(_0x2c44('0x16'));var config=require(_0x2c44('0x17'));var licenseUtil=require(_0x2c44('0x18'));var db=require(_0x2c44('0x19'))['db'];function respondWithStatusCode(_0x4ac875,_0x3a27ab){_0x3a27ab=_0x3a27ab||0xcc;return function(_0x509851){if(_0x509851){return _0x4ac875['sendStatus'](_0x3a27ab);}return _0x4ac875[_0x2c44('0x1a')](_0x3a27ab)[_0x2c44('0x1b')]();};}function respondWithResult(_0x3f0be6,_0x3a5978){_0x3a5978=_0x3a5978||0xc8;return function(_0x2b125a){if(_0x2b125a){return _0x3f0be6[_0x2c44('0x1a')](_0x3a5978)[_0x2c44('0x1c')](_0x2b125a);}};}function respondWithFilteredResult(_0x22f050,_0x5188a9){return function(_0x5b1f81){if(_0x5b1f81){var _0x1d9ae9=typeof _0x5188a9['offset']===_0x2c44('0x1d')&&typeof _0x5188a9[_0x2c44('0x1e')]==='undefined';var _0x463b77=_0x5b1f81[_0x2c44('0x1f')];var _0x143f10=_0x1d9ae9?0x0:_0x5188a9['offset'];var _0x46dafc=_0x1d9ae9?_0x5b1f81['count']:_0x5188a9[_0x2c44('0x20')]+_0x5188a9[_0x2c44('0x1e')];var _0x3d9979;if(_0x46dafc>=_0x463b77){_0x46dafc=_0x463b77;_0x3d9979=0xc8;}else{_0x3d9979=0xce;}_0x22f050[_0x2c44('0x1a')](_0x3d9979);return _0x22f050['set'](_0x2c44('0x21'),_0x143f10+'-'+_0x46dafc+'/'+_0x463b77)[_0x2c44('0x1c')](_0x5b1f81);}return null;};}function patchUpdates(_0x2dc291){return function(_0x152140){try{jsonpatch['apply'](_0x152140,_0x2dc291,!![]);}catch(_0x4735c5){return BPromise[_0x2c44('0x22')](_0x4735c5);}return _0x152140[_0x2c44('0x23')]();};}function saveUpdates(_0xd464d5,_0x2857ec){return function(_0x41d4a6){if(_0x41d4a6){return _0x41d4a6[_0x2c44('0x24')](_0xd464d5)[_0x2c44('0x25')](function(_0x5706b7){return _0x5706b7;});}return null;};}function removeEntity(_0x2a1fad,_0x195060){return function(_0x451a32){if(_0x451a32){return _0x451a32['destroy']()[_0x2c44('0x25')](function(){_0x2a1fad['status'](0xcc)[_0x2c44('0x1b')]();});}};}function handleEntityNotFound(_0x5f4015,_0x2bb992){return function(_0x2f1c68){if(!_0x2f1c68){_0x5f4015[_0x2c44('0x26')](0x194);}return _0x2f1c68;};}function handleError(_0x38806a,_0x3e3425){_0x3e3425=_0x3e3425||0x1f4;return function(_0x4cadd1){logger[_0x2c44('0x27')](_0x4cadd1[_0x2c44('0x28')]);if(_0x4cadd1[_0x2c44('0x29')]){delete _0x4cadd1[_0x2c44('0x29')];}_0x38806a[_0x2c44('0x1a')](_0x3e3425)[_0x2c44('0x2a')](_0x4cadd1);};}exports[_0x2c44('0x2b')]=function(_0xb19f33,_0x370073){var _0x193483={},_0x1d1cfc={},_0x156458={'count':0x0,'rows':[]};var _0x2ec119=_['map'](db[_0x2c44('0x2c')][_0x2c44('0x2d')],function(_0x2ed36b){return{'name':_0x2ed36b[_0x2c44('0x2e')],'type':_0x2ed36b[_0x2c44('0x2f')][_0x2c44('0x30')]};});_0x1d1cfc[_0x2c44('0x31')]=_[_0x2c44('0x32')](_0x2ec119,_0x2c44('0x29'));_0x1d1cfc[_0x2c44('0x33')]=_['keys'](_0xb19f33[_0x2c44('0x33')]);_0x1d1cfc[_0x2c44('0x34')]=_[_0x2c44('0x35')](_0x1d1cfc['model'],_0x1d1cfc[_0x2c44('0x33')]);_0x1d1cfc['filters']=_[_0x2c44('0x36')](_0x1d1cfc[_0x2c44('0x34')],['$and','$or',_0x2c44('0x37'),_0x2c44('0x38'),_0x2c44('0x39'),_0x2c44('0x3a'),_0x2c44('0x3b'),_0x2c44('0x3c'),_0x2c44('0x3d'),_0x2c44('0x3e'),'$notBetween',_0x2c44('0x3f'),'$notIn',_0x2c44('0x40'),_0x2c44('0x41'),'$iLike','$notILike','$like',_0x2c44('0x42'),_0x2c44('0x43'),_0x2c44('0x44'),_0x2c44('0x45')]);_0x193483['attributes']=_['intersection'](_0x1d1cfc['model'],qs['fields'](_0xb19f33[_0x2c44('0x33')][_0x2c44('0x46')]));_0x193483[_0x2c44('0x47')]=_0x193483['attributes'][_0x2c44('0x48')]?_0x193483[_0x2c44('0x47')]:_0x1d1cfc[_0x2c44('0x31')];if(!_0xb19f33[_0x2c44('0x33')][_0x2c44('0x49')](_0x2c44('0x4a'))){_0x193483[_0x2c44('0x1e')]=qs[_0x2c44('0x1e')](_0xb19f33['query'][_0x2c44('0x1e')]);_0x193483['offset']=qs[_0x2c44('0x20')](_0xb19f33['query']['offset']);}_0x193483[_0x2c44('0x4b')]=qs[_0x2c44('0x4c')](_0xb19f33[_0x2c44('0x33')][_0x2c44('0x4c')]);_0x193483[_0x2c44('0x4d')]=qs[_0x2c44('0x34')](_[_0x2c44('0x4e')](_0xb19f33[_0x2c44('0x33')],_0x1d1cfc['filters']),_0x2ec119);if(_0xb19f33[_0x2c44('0x33')][_0x2c44('0x4f')]){_0x193483[_0x2c44('0x4d')]=_[_0x2c44('0x50')](_0x193483[_0x2c44('0x4d')],{'$or':_[_0x2c44('0x32')](_0x2ec119,function(_0x1c505b){if(_0x1c505b[_0x2c44('0x2f')]!==_0x2c44('0x51')){var _0x3e152c={};_0x3e152c[_0x1c505b[_0x2c44('0x29')]]={'$like':'%'+_0xb19f33[_0x2c44('0x33')][_0x2c44('0x4f')]+'%'};return _0x3e152c;}})});}_0x193483=_[_0x2c44('0x50')]({},_0x193483,_0xb19f33[_0x2c44('0x52')]);var _0x3d1aad={'where':_0x193483[_0x2c44('0x4d')]};return db[_0x2c44('0x2c')][_0x2c44('0x1f')](_0x3d1aad)[_0x2c44('0x25')](function(_0x32cb1f){_0x156458[_0x2c44('0x1f')]=_0x32cb1f;if(_0xb19f33[_0x2c44('0x33')][_0x2c44('0x53')]){_0x193483[_0x2c44('0x54')]=[{'all':!![]}];}return db[_0x2c44('0x2c')][_0x2c44('0x55')](_0x193483);})[_0x2c44('0x25')](function(_0x1b5b20){_0x156458[_0x2c44('0x56')]=_0x1b5b20;return _0x156458;})['then'](respondWithFilteredResult(_0x370073,_0x193483))[_0x2c44('0x57')](handleError(_0x370073,null));};exports[_0x2c44('0x58')]=function(_0x4f4039,_0x212969){var _0x2b7ad6={'raw':!![],'where':{'id':_0x4f4039['params']['id']}},_0x3e66b5={};_0x3e66b5[_0x2c44('0x31')]=_[_0x2c44('0x59')](db[_0x2c44('0x2c')]['rawAttributes']);_0x3e66b5[_0x2c44('0x33')]=_[_0x2c44('0x59')](_0x4f4039['query']);_0x3e66b5[_0x2c44('0x34')]=_[_0x2c44('0x35')](_0x3e66b5[_0x2c44('0x31')],_0x3e66b5[_0x2c44('0x33')]);_0x2b7ad6[_0x2c44('0x47')]=_[_0x2c44('0x35')](_0x3e66b5[_0x2c44('0x31')],qs[_0x2c44('0x46')](_0x4f4039['query'][_0x2c44('0x46')]));_0x2b7ad6[_0x2c44('0x47')]=_0x2b7ad6[_0x2c44('0x47')][_0x2c44('0x48')]?_0x2b7ad6[_0x2c44('0x47')]:_0x3e66b5['model'];if(_0x4f4039[_0x2c44('0x33')][_0x2c44('0x53')]){_0x2b7ad6[_0x2c44('0x54')]=[{'all':!![]}];}_0x2b7ad6=_[_0x2c44('0x50')]({},_0x2b7ad6,_0x4f4039[_0x2c44('0x52')]);return db['CmHopper']['find'](_0x2b7ad6)['then'](handleEntityNotFound(_0x212969,null))[_0x2c44('0x25')](respondWithResult(_0x212969,null))[_0x2c44('0x57')](handleError(_0x212969,null));};exports[_0x2c44('0x5a')]=function(_0x41f97e,_0x4a87be){return db['CmHopper'][_0x2c44('0x5a')](_0x41f97e[_0x2c44('0x5b')],{})[_0x2c44('0x25')](respondWithResult(_0x4a87be,0xc9))[_0x2c44('0x57')](handleError(_0x4a87be,null));};exports[_0x2c44('0x24')]=function(_0x204467,_0x14aa21){if(_0x204467[_0x2c44('0x5b')]['id']){delete _0x204467[_0x2c44('0x5b')]['id'];}return db[_0x2c44('0x2c')][_0x2c44('0x5c')]({'where':{'id':_0x204467[_0x2c44('0x5d')]['id']}})[_0x2c44('0x25')](handleEntityNotFound(_0x14aa21,null))[_0x2c44('0x25')](saveUpdates(_0x204467['body'],null))[_0x2c44('0x25')](respondWithResult(_0x14aa21,null))['catch'](handleError(_0x14aa21,null));};exports[_0x2c44('0x5e')]=function(_0x1c8271,_0x3dd624){return db[_0x2c44('0x2c')]['describe']()[_0x2c44('0x25')](respondWithResult(_0x3dd624,null))[_0x2c44('0x57')](handleError(_0x3dd624,null));};exports['destroy']=function(_0xae5d47,_0x3b484a){var _0x5762c8;return db[_0x2c44('0x2c')][_0x2c44('0x5c')]({'where':{'id':_0xae5d47[_0x2c44('0x5d')]['id']}})[_0x2c44('0x25')](handleEntityNotFound(_0x3b484a,null))['then'](function(_0x4083af){if(_0x4083af){return _0x4083af[_0x2c44('0x5f')]()['then'](function(_0x42e4ba){return _0x42e4ba;});}})[_0x2c44('0x25')](function(_0x4fc443){_0x5762c8=_0x4fc443;if(_0x4fc443){if(_0x4fc443[_0x2c44('0x60')]||_0x4fc443[_0x2c44('0x61')]){return db[_0x4fc443[_0x2c44('0x60')]?'VoiceQueue':_0x2c44('0x62')]['find']({'where':{'id':_0x4fc443['VoiceQueueId']?_0x4fc443[_0x2c44('0x60')]:_0x4fc443[_0x2c44('0x61')]},'attributes':['id',_0x2c44('0x29')],'raw':!![]});}}})[_0x2c44('0x25')](function(_0x68c09d){var _0x4cbaea={};if(_0x68c09d){_[_0x2c44('0x50')](_0x4cbaea,_[_0x2c44('0x63')](_0x5762c8[_0x2c44('0x64')],['createdAt',_0x2c44('0x65'),'id']));_0x4cbaea[_0x2c44('0x66')]=0x15;_0x4cbaea['statedesc']=_0x2c44('0x67');_0x4cbaea[_0x2c44('0x68')]=_0x68c09d[_0x2c44('0x29')];_0x4cbaea['membername']=_0xae5d47[_0x2c44('0x69')][_0x2c44('0x29')];_0x4cbaea[_0x2c44('0x6a')]=_0xae5d47['user']['id'];_0x4cbaea[_0x2c44('0x67')]=!![];_0x4cbaea[_0x2c44('0x6b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4cbaea[_0x2c44('0x6c')]=_0x5762c8[_0x2c44('0x6d')];_0x4cbaea['campaigntype']=_0x5762c8[_0x2c44('0x60')]?_0x2c44('0x6e'):_0x2c44('0x6f');return db[_0x2c44('0x70')][_0x2c44('0x5c')]({'where':{'id':_0x4cbaea[_0x2c44('0x71')]},'attributes':[_0x2c44('0x72'),'lastName']})['then'](function(_0x332caa){if(!_[_0x2c44('0x73')](_0x3b484a)&&!_[_0x2c44('0x73')](_0x332caa[_0x2c44('0x72')])){_0x4cbaea[_0x2c44('0x74')]=_0x332caa[_0x2c44('0x72')];if(!_['isNil'](_0x332caa[_0x2c44('0x75')])){_0x4cbaea[_0x2c44('0x74')]+='\x20'+_0x332caa[_0x2c44('0x75')];}}})[_0x2c44('0x76')](function(){return db[_0x2c44('0x77')]['create'](_0x4cbaea);});}})['then'](function(){return _0x3b484a['status'](0xcc)[_0x2c44('0x1b')]();})[_0x2c44('0x57')](handleError(_0x3b484a,null));};exports[_0x2c44('0x78')]=function(_0x158eba,_0x375fc1,_0x56389c){var _0x44b032=[];return db['CmContact'][_0x2c44('0x5e')]()[_0x2c44('0x25')](function(_0x3a85fb){_0x44b032=_['keys'](_0x3a85fb);return _0x158eba[_0x2c44('0x69')][_0x2c44('0x79')]({'where':{'type':_0x2c44('0x7a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x2c44('0x7b')],'raw':!![]});})[_0x2c44('0x25')](function(_0x2d801d){if(_0x2d801d&&_0x2d801d['length']){return db['sequelize']['transaction'](function(_0x2dc8d9){var _0x29062b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c44('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2c44('0x32')](_0x2d801d,'id')},'$or':[{'UserId':null},{'UserId':_0x158eba[_0x2c44('0x69')]['id']}]};var _0x5e284a=[];if(_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7d')]&&_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7d')]===_0x2c44('0x7e')){if(!_['isEmpty'](_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7f')])){_0x29062b['id']={'$in':_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7f')]};}_0x5e284a=[[_0x2c44('0x80'),_0x2c44('0x81')],[_0x2c44('0x82'),_0x2d801d[0x0][_0x2c44('0x7b')]===_0x2c44('0x81')?_0x2c44('0x83'):_0x2c44('0x81')],db[_0x2c44('0x84')][_0x2c44('0x85')](_0x2c44('0x86')),['id','DESC']];}else{if(!_[_0x2c44('0x87')](_0x158eba[_0x2c44('0x5b')][_0x2c44('0x7f')])){_0x29062b['id']={'$notIn':_0x158eba['body'][_0x2c44('0x7f')]};}_0x5e284a=[[_0x2c44('0x80'),_0x2c44('0x83')],[_0x2c44('0x82'),_0x2d801d[0x0]['dialOrderByScheduledAt']],db[_0x2c44('0x84')][_0x2c44('0x85')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db['CmHopper']['findOne']({'attributes':['id',_0x2c44('0x88')],'where':_0x29062b,'order':_0x5e284a,'transaction':_0x2dc8d9,'lock':_0x2dc8d9[_0x2c44('0x89')][_0x2c44('0x8a')],'include':[{'model':db[_0x2c44('0x70')],'as':_0x2c44('0x8b'),'attributes':_0x44b032,'include':[{'model':db['CmCompany'],'as':_0x2c44('0x8c'),'attributes':['id','name']}]},{'model':db[_0x2c44('0x8d')],'as':_0x2c44('0x8e'),'attributes':['id',_0x2c44('0x29')]},{'model':db['VoiceQueue'],'as':_0x2c44('0x8f'),'attributes':['id',_0x2c44('0x29'),'dialActive']}]})[_0x2c44('0x25')](function(_0x48f71a){if(_0x48f71a){return _0x48f71a[_0x2c44('0x24')]({'UserId':_0x158eba['user']['id']},{'transaction':_0x2dc8d9});}});});}})['then'](handleEntityNotFound(_0x375fc1,null))[_0x2c44('0x25')](respondWithResult(_0x375fc1,null))[_0x2c44('0x57')](handleError(_0x375fc1,null));};exports[_0x2c44('0x90')]=function(_0x2774a6,_0x309a5a,_0x49a182){return _0x2774a6[_0x2c44('0x69')][_0x2c44('0x79')]({'where':{'type':_0x2c44('0x7a'),'dialActive':!![],'dialMethod':_0x2c44('0x91')},'attributes':['id'],'raw':!![]})[_0x2c44('0x25')](function(_0x12120d){if(_0x12120d&&_0x12120d['length']){return db[_0x2c44('0x2c')][_0x2c44('0x1f')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2c44('0x7c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2c44('0x32')](_0x12120d,'id')},'$or':[{'UserId':null},{'UserId':_0x2774a6['user']['id']}]}});}return 0x0;})[_0x2c44('0x25')](function(_0x1381ca){if(!_[_0x2c44('0x73')](_0x1381ca)&&_['isNumber'](_0x1381ca)){return _0x309a5a['status'](0xc8)['json']({'contacts':_0x1381ca});}else{logger[_0x2c44('0x27')](_0x2c44('0x92'),_0x2c44('0x90'),0x194,_0x2c44('0x93'));_0x309a5a[_0x2c44('0x26')](0x194);}})['catch'](handleError(_0x309a5a,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d5d2df7..14e14b2 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x31f0=['priority','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone'];(function(_0x5a95e0,_0x2d562f){var _0x6fdd98=function(_0x36ccdd){while(--_0x36ccdd){_0x5a95e0['push'](_0x5a95e0['shift']());}};_0x6fdd98(++_0x2d562f);}(_0x31f0,0xb7));var _0x031f=function(_0x457f7,_0xd63dba){_0x457f7=_0x457f7-0x0;var _0x23c1bf=_0x31f0[_0x457f7];return _0x23c1bf;};'use strict';var _=require(_0x031f('0x0'));var util=require('util');var logger=require(_0x031f('0x1'))('api');var moment=require(_0x031f('0x2'));var BPromise=require(_0x031f('0x3'));var rp=require(_0x031f('0x4'));var fs=require('fs');var path=require(_0x031f('0x5'));var rimraf=require('rimraf');var config=require(_0x031f('0x6'));var attributes=require(_0x031f('0x7'));module['exports']=function(_0x4c0f94,_0x56328c){return _0x4c0f94[_0x031f('0x8')]('CmHopper',attributes,{'tableName':_0x031f('0x9'),'paranoid':![],'indexes':[{'name':_0x031f('0xa'),'fields':[_0x031f('0xa')]},{'name':_0x031f('0xb'),'fields':['phone']},{'name':_0x031f('0xc'),'fields':[_0x031f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['lodash','util','api','moment','bluebird','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority'];(function(_0x2776d9,_0x133bfe){var _0x4334be=function(_0x2247b1){while(--_0x2247b1){_0x2776d9['push'](_0x2776d9['shift']());}};_0x4334be(++_0x133bfe);}(_0x46ed,0x168));var _0xd46e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x46ed[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[{'name':_0xd46e('0xc'),'fields':[_0xd46e('0xc')]},{'name':_0xd46e('0xd'),'fields':[_0xd46e('0xd')]},{'name':'priority','fields':[_0xd46e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 3a3700b..e2d9697 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 _0x821a=['MoveContactManagedDialer','CmHopperFinal','COUNT','literal','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','transaction','order','GetContactRecallMe','GetCmHopperPreview','keys','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','error','code','message','CmHopper','findAll','options','raw','where','attributes','map','include','model','then','GetCmHopper','stringify','ShowCmHopper','catch','CreateCmHopper','create','body','UpdateCmHopper','update','limit','DestroyCmHopper','destroy','CmContact','describe','sequelize','LOCK','Contact','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer'];(function(_0x454abb,_0x46973c){var _0x177b21=function(_0x4374d1){while(--_0x4374d1){_0x454abb['push'](_0x454abb['shift']());}};_0x177b21(++_0x46973c);}(_0x821a,0x12b));var _0xa821=function(_0x49ccaa,_0x5944f2){_0x49ccaa=_0x49ccaa-0x0;var _0x2c1ae1=_0x821a[_0x49ccaa];return _0x2c1ae1;};'use strict';var _=require(_0xa821('0x0'));var util=require('util');var moment=require(_0xa821('0x1'));var BPromise=require(_0xa821('0x2'));var rs=require(_0xa821('0x3'));var fs=require('fs');var Redis=require(_0xa821('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa821('0x5'));var logger=require(_0xa821('0x6'))(_0xa821('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa821('0x8')][_0xa821('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f6c6e,_0x577b05,_0x342729){return new BPromise(function(_0x276e83,_0x1cd6a6){return client[_0xa821('0xa')](_0x1f6c6e,_0x342729)['then'](function(_0x585c87){logger[_0xa821('0xb')](_0xa821('0xc'),_0x577b05,_0xa821('0xd'));logger[_0xa821('0xe')](_0xa821('0xf'),_0x577b05,_0xa821('0xd'),JSON['stringify'](_0x585c87));if(_0x585c87['error']){if(_0x585c87[_0xa821('0x10')][_0xa821('0x11')]===0x1f4){logger['error'](_0xa821('0xc'),_0x577b05,_0x585c87['error'][_0xa821('0x12')]);return _0x1cd6a6(_0x585c87[_0xa821('0x10')][_0xa821('0x12')]);}logger[_0xa821('0x10')]('CmHopper,\x20%s,\x20%s',_0x577b05,_0x585c87[_0xa821('0x10')][_0xa821('0x12')]);return _0x276e83(_0x585c87[_0xa821('0x10')][_0xa821('0x12')]);}else{logger[_0xa821('0xb')](_0xa821('0xc'),_0x577b05,_0xa821('0xd'));_0x276e83(_0x585c87['result'][_0xa821('0x12')]);}})['catch'](function(_0x3b3fcd){logger[_0xa821('0x10')](_0xa821('0xc'),_0x577b05,_0x3b3fcd);_0x1cd6a6(_0x3b3fcd);});});}exports['GetCmHopper']=function(_0x3405bb){var _0x418fd2=this;return new Promise(function(_0x19b42f,_0x3fc583){return db[_0xa821('0x13')][_0xa821('0x14')]({'raw':_0x3405bb[_0xa821('0x15')]?_0x3405bb[_0xa821('0x15')][_0xa821('0x16')]===undefined?!![]:![]:!![],'where':_0x3405bb[_0xa821('0x15')]?_0x3405bb[_0xa821('0x15')][_0xa821('0x17')]||null:null,'attributes':_0x3405bb[_0xa821('0x15')]?_0x3405bb[_0xa821('0x15')][_0xa821('0x18')]||null:null,'limit':_0x3405bb[_0xa821('0x15')]?_0x3405bb[_0xa821('0x15')]['limit']||null:null,'include':_0x3405bb[_0xa821('0x15')]?_0x3405bb[_0xa821('0x15')]['include']?_[_0xa821('0x19')](_0x3405bb[_0xa821('0x15')][_0xa821('0x1a')],function(_0x2d77dd){return{'model':db[_0x2d77dd[_0xa821('0x1b')]],'as':_0x2d77dd['as'],'attributes':_0x2d77dd[_0xa821('0x18')],'include':_0x2d77dd[_0xa821('0x1a')]?_['map'](_0x2d77dd[_0xa821('0x1a')],function(_0x48fdcd){return{'model':db[_0x48fdcd[_0xa821('0x1b')]],'as':_0x48fdcd['as'],'attributes':_0x48fdcd[_0xa821('0x18')],'include':_0x48fdcd[_0xa821('0x1a')]?_['map'](_0x48fdcd[_0xa821('0x1a')],function(_0x1d1aea){return{'model':db[_0x1d1aea[_0xa821('0x1b')]],'as':_0x1d1aea['as'],'attributes':_0x1d1aea[_0xa821('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa821('0x1c')](function(_0x5d9ddb){logger['info'](_0xa821('0x1d'),_0x3405bb);logger[_0xa821('0xe')](_0xa821('0x1d'),_0x3405bb,JSON[_0xa821('0x1e')](_0x5d9ddb));_0x19b42f(_0x5d9ddb);})['catch'](function(_0x5495a4){logger['error'](_0xa821('0x1d'),_0x5495a4[_0xa821('0x12')],_0x3405bb);_0x3fc583(_0x418fd2[_0xa821('0x10')](0x1f4,_0x5495a4[_0xa821('0x12')]));});});};exports[_0xa821('0x1f')]=function(_0x459a16){var _0x140259=this;return new Promise(function(_0x76f8c7,_0x1c59aa){return db[_0xa821('0x13')]['find']({'raw':_0x459a16[_0xa821('0x15')]?_0x459a16[_0xa821('0x15')][_0xa821('0x16')]===undefined?!![]:![]:!![],'where':_0x459a16['options']?_0x459a16[_0xa821('0x15')][_0xa821('0x17')]||null:null,'attributes':_0x459a16['options']?_0x459a16[_0xa821('0x15')]['attributes']||null:null,'include':_0x459a16[_0xa821('0x15')]?_0x459a16['options']['include']?_[_0xa821('0x19')](_0x459a16['options'][_0xa821('0x1a')],function(_0xd2bceb){return{'model':db[_0xd2bceb['model']],'as':_0xd2bceb['as'],'attributes':_0xd2bceb[_0xa821('0x18')],'include':_0xd2bceb[_0xa821('0x1a')]?_[_0xa821('0x19')](_0xd2bceb[_0xa821('0x1a')],function(_0x4c6a18){return{'model':db[_0x4c6a18[_0xa821('0x1b')]],'as':_0x4c6a18['as'],'attributes':_0x4c6a18[_0xa821('0x18')],'include':_0x4c6a18['include']?_['map'](_0x4c6a18[_0xa821('0x1a')],function(_0x36bf9a){return{'model':db[_0x36bf9a[_0xa821('0x1b')]],'as':_0x36bf9a['as'],'attributes':_0x36bf9a[_0xa821('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa821('0x1c')](function(_0x3a6aef){logger[_0xa821('0xb')]('ShowCmHopper',_0x459a16);logger['debug']('ShowCmHopper',_0x459a16,JSON['stringify'](_0x3a6aef));_0x76f8c7(_0x3a6aef);})[_0xa821('0x20')](function(_0x3dcd75){logger[_0xa821('0x10')](_0xa821('0x1f'),_0x3dcd75[_0xa821('0x12')],_0x459a16);_0x1c59aa(_0x140259[_0xa821('0x10')](0x1f4,_0x3dcd75[_0xa821('0x12')]));});});};exports[_0xa821('0x21')]=function(_0x18e6d1){var _0x59fb86=this;return new Promise(function(_0x526118,_0x6351d4){return db[_0xa821('0x13')][_0xa821('0x22')](_0x18e6d1[_0xa821('0x23')],{'raw':_0x18e6d1[_0xa821('0x15')]?_0x18e6d1['options'][_0xa821('0x16')]===undefined?!![]:![]:!![]})[_0xa821('0x1c')](function(_0x3f2c4c){logger['info'](_0xa821('0x21'),_0x18e6d1);logger[_0xa821('0xe')](_0xa821('0x21'),_0x18e6d1,JSON[_0xa821('0x1e')](_0x3f2c4c));_0x526118(_0x3f2c4c);})[_0xa821('0x20')](function(_0x5567ae){logger[_0xa821('0x10')](_0xa821('0x21'),_0x5567ae[_0xa821('0x12')],_0x18e6d1);_0x6351d4(_0x59fb86[_0xa821('0x10')](0x1f4,_0x5567ae[_0xa821('0x12')]));});});};exports[_0xa821('0x24')]=function(_0x1a7e03){var _0x164869=this;return new Promise(function(_0x56bc1d,_0x5b7973){return db['CmHopper'][_0xa821('0x25')](_0x1a7e03[_0xa821('0x23')],{'raw':_0x1a7e03[_0xa821('0x15')]?_0x1a7e03[_0xa821('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a7e03['options']?_0x1a7e03['options'][_0xa821('0x17')]||null:null,'attributes':_0x1a7e03[_0xa821('0x15')]?_0x1a7e03['options'][_0xa821('0x18')]||null:null,'limit':_0x1a7e03['options']?_0x1a7e03[_0xa821('0x15')][_0xa821('0x26')]||null:null})['then'](function(_0x2c4fc6){logger[_0xa821('0xb')](_0xa821('0x24'),_0x1a7e03);logger[_0xa821('0xe')]('UpdateCmHopper',_0x1a7e03,JSON[_0xa821('0x1e')](_0x2c4fc6));_0x56bc1d(_0x2c4fc6);})[_0xa821('0x20')](function(_0x191c67){logger[_0xa821('0x10')](_0xa821('0x24'),_0x191c67[_0xa821('0x12')],_0x1a7e03);_0x5b7973(_0x164869['error'](0x1f4,_0x191c67[_0xa821('0x12')]));});});};exports[_0xa821('0x27')]=function(_0x213e24){var _0x1d4f0b=this;return new Promise(function(_0x33315b,_0x64c385){return db['CmHopper'][_0xa821('0x28')]({'where':_0x213e24[_0xa821('0x15')]?_0x213e24[_0xa821('0x15')][_0xa821('0x17')]||null:null})[_0xa821('0x1c')](function(_0x221587){logger[_0xa821('0xb')]('DestroyCmHopper',_0x213e24);logger[_0xa821('0xe')](_0xa821('0x27'),_0x213e24,JSON[_0xa821('0x1e')](_0x221587));_0x33315b(_0x221587);})[_0xa821('0x20')](function(_0x1ed5c5){logger[_0xa821('0x10')]('DestroyCmHopper',_0x1ed5c5[_0xa821('0x12')],_0x213e24);_0x64c385(_0x1d4f0b[_0xa821('0x10')](0x1f4,_0x1ed5c5[_0xa821('0x12')]));});});};exports['GetContactDialer']=function(_0x57e622){var _0x1703f5=this;return new Promise(function(_0x39aaed,_0x1f8b93){return db[_0xa821('0x29')][_0xa821('0x2a')]()[_0xa821('0x1c')](function(_0xc16142){return db[_0xa821('0x2b')]['transaction'](function(_0x9da608){return db['CmHopper'][_0xa821('0x14')]({'where':_0x57e622['options']?_0x57e622[_0xa821('0x15')][_0xa821('0x17')]||null:null,'attributes':_0x57e622[_0xa821('0x15')]?_0x57e622[_0xa821('0x15')][_0xa821('0x18')]||null:null,'limit':_0x57e622['options']?_0x57e622[_0xa821('0x15')]['limit']||null:null,'order':_0x57e622[_0xa821('0x15')]?_0x57e622[_0xa821('0x15')]['order']||null:null,'transaction':_0x9da608,'lock':_0x9da608[_0xa821('0x2c')]['UPDATE'],'include':[{'model':db[_0xa821('0x29')],'as':_0xa821('0x2d'),'attributes':_['keys'](_0xc16142)},{'model':db[_0xa821('0x2e')],'as':_0xa821('0x2f'),'attributes':['id',_0xa821('0x30'),_0xa821('0x31')]}]})['then'](function(_0x3e14d6){var _0x116e4f=[];var _0x5c2cb7=[];for(var _0x42bffb=0x0;_0x42bffb<_0x3e14d6[_0xa821('0x32')];_0x42bffb+=0x1){var _0x1f4a34=_0x3e14d6[_0x42bffb][_0xa821('0x33')];if(_0x1f4a34===null){_0x116e4f[_0xa821('0x34')](_0x3e14d6[_0x42bffb][_0xa821('0x25')](_0x57e622[_0xa821('0x23')],{'transaction':_0x9da608}));}else if(!_0x5c2cb7[_0xa821('0x35')](_0x1f4a34)){_0x5c2cb7[_0xa821('0x34')](_0x1f4a34);_0x116e4f[_0xa821('0x34')](_0x3e14d6[_0x42bffb][_0xa821('0x25')](_0x57e622[_0xa821('0x23')],{'transaction':_0x9da608}));}}return BPromise[_0xa821('0x36')](_0x116e4f);});})[_0xa821('0x1c')](function(_0x8821d4){logger['info'](_0xa821('0x37'),_0x57e622);logger[_0xa821('0xe')]('GetContactDialer',_0x57e622,JSON[_0xa821('0x1e')](_0x8821d4));_0x39aaed(_0x8821d4);})['catch'](function(_0x20cd60){logger['error'](_0xa821('0x37'),_0x20cd60[_0xa821('0x12')],_0x57e622);_0x1f8b93(_0x1703f5[_0xa821('0x10')](0x1f4,_0x20cd60[_0xa821('0x12')]));});});});};exports[_0xa821('0x38')]=function(_0x466f3d){var _0x2c6704=this;return new Promise(function(_0x5891cc,_0xa367be){return db[_0xa821('0x2b')]['transaction'](function(_0x2e1cfd){return db[_0xa821('0x39')][_0xa821('0x22')](_0x466f3d[_0xa821('0x23')],{'raw':_0x466f3d[_0xa821('0x15')]?_0x466f3d[_0xa821('0x15')]['raw']===undefined?!![]:![]:!![],'transaction':_0x2e1cfd})['then'](function(){return db[_0xa821('0x13')][_0xa821('0x28')]({'where':_0x466f3d['options']?_0x466f3d[_0xa821('0x15')][_0xa821('0x17')]||null:null,'transaction':_0x2e1cfd});});})[_0xa821('0x1c')](function(_0x18047b){logger[_0xa821('0xb')](_0xa821('0x38'),_0x466f3d);logger['debug'](_0xa821('0x38'),_0x466f3d,JSON[_0xa821('0x1e')](_0x18047b));_0x5891cc(_0x18047b);})[_0xa821('0x20')](function(_0x32bd0a){logger[_0xa821('0x10')]('MoveContactManagedDialer',_0x32bd0a[_0xa821('0x12')],_0x466f3d);_0xa367be(_0x2c6704[_0xa821('0x10')](0x1f4,_0x32bd0a[_0xa821('0x12')]));});});};exports['CountReScheduled']=function(_0xabe8a5){var _0x5c4b2a=this;return new Promise(function(_0x45c625,_0x5a9196){return db[_0xa821('0x13')][_0xa821('0x14')]({'raw':_0xabe8a5['options']?_0xabe8a5['options'][_0xa821('0x16')]===undefined?!![]:![]:!![],'where':_0xabe8a5[_0xa821('0x15')]?_0xabe8a5['options'][_0xa821('0x17')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa821('0x3a'),db[_0xa821('0x2b')]['fn']('IF',db[_0xa821('0x2b')][_0xa821('0x3b')]('`scheduledat`\x20>=\x20'+util[_0xa821('0x3c')](_0xa821('0x3d'),moment()[_0xa821('0x3c')](_0xa821('0x3e')))+_0xa821('0x3f')))),_0xa821('0x40')]]})[_0xa821('0x1c')](function(_0x5529ce){logger[_0xa821('0xb')](_0xa821('0x41'),_0xabe8a5);logger[_0xa821('0xe')](_0xa821('0x41'),_0xabe8a5,JSON[_0xa821('0x1e')](_0x5529ce));_0x45c625(_0x5529ce);})[_0xa821('0x20')](function(_0x39730d){logger[_0xa821('0x10')]('CountReScheduled',_0x39730d[_0xa821('0x12')],_0xabe8a5);_0x5a9196(_0x5c4b2a['error'](0x1f4,_0x39730d[_0xa821('0x12')]));});});};exports['GetContactRecallMe']=function(_0x1fd491){var _0x4d3dba=this;return new Promise(function(_0x56b8ae,_0x5b80eb){return db[_0xa821('0x29')][_0xa821('0x2a')]()['then'](function(_0x5ae1b8){return db[_0xa821('0x2b')][_0xa821('0x42')](function(_0x12d99e){return db['CmHopper'][_0xa821('0x14')]({'where':_0x1fd491[_0xa821('0x15')]?_0x1fd491[_0xa821('0x15')][_0xa821('0x17')]||null:null,'attributes':_0x1fd491[_0xa821('0x15')]?_0x1fd491[_0xa821('0x15')][_0xa821('0x18')]||null:null,'limit':0x1,'order':_0x1fd491[_0xa821('0x15')]?_0x1fd491[_0xa821('0x15')][_0xa821('0x43')]||null:null,'group':db[_0xa821('0x13')][_0xa821('0x33')],'transaction':_0x12d99e,'lock':_0x12d99e[_0xa821('0x2c')]['UPDATE'],'include':_0x1fd491[_0xa821('0x15')]?_0x1fd491[_0xa821('0x15')][_0xa821('0x1a')]?_['map'](_0x1fd491[_0xa821('0x15')][_0xa821('0x1a')],function(_0x433772){return{'model':db[_0x433772[_0xa821('0x1b')]],'as':_0x433772['as'],'attributes':_0x433772[_0xa821('0x18')],'include':_0x433772[_0xa821('0x1a')]?_[_0xa821('0x19')](_0x433772[_0xa821('0x1a')],function(_0x25c82c){return{'model':db[_0x25c82c[_0xa821('0x1b')]],'as':_0x25c82c['as'],'attributes':_0x25c82c[_0xa821('0x18')],'include':_0x25c82c[_0xa821('0x1a')]?_[_0xa821('0x19')](_0x25c82c[_0xa821('0x1a')],function(_0x4b5624){return{'model':db[_0x4b5624[_0xa821('0x1b')]],'as':_0x4b5624['as'],'attributes':_0x4b5624[_0xa821('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa821('0x1c')](function(_0x241d4d){var _0xc3a8f1=[];for(var _0x193bfc=0x0;_0x193bfc<_0x241d4d[_0xa821('0x32')];_0x193bfc+=0x1){_0xc3a8f1[_0xa821('0x34')](_0x241d4d[_0x193bfc][_0xa821('0x25')](_0x1fd491['body'],{'transaction':_0x12d99e}));}return BPromise[_0xa821('0x36')](_0xc3a8f1);});})[_0xa821('0x1c')](function(_0x2b3f6d){logger[_0xa821('0xb')](_0xa821('0x44'),_0x1fd491);logger[_0xa821('0xe')](_0xa821('0x44'),_0x1fd491,JSON['stringify'](_0x2b3f6d));_0x56b8ae(_0x2b3f6d);})[_0xa821('0x20')](function(_0x2dc3c5){logger[_0xa821('0x10')](_0xa821('0x44'),_0x2dc3c5[_0xa821('0x12')],_0x1fd491);_0x5b80eb(_0x4d3dba[_0xa821('0x10')](0x1f4,_0x2dc3c5[_0xa821('0x12')]));});});});};exports[_0xa821('0x45')]=function(_0x5d42ec){var _0x45f880=this;return new Promise(function(_0x2b29cc,_0x8f5de2){db[_0xa821('0x29')]['describe']()[_0xa821('0x1c')](function(_0x86662b){return db[_0xa821('0x13')][_0xa821('0x14')]({'raw':_0x5d42ec['options']?_0x5d42ec[_0xa821('0x15')][_0xa821('0x16')]===undefined?!![]:![]:!![],'where':_0x5d42ec[_0xa821('0x15')]?_0x5d42ec[_0xa821('0x15')][_0xa821('0x17')]||null:null,'attributes':_0x5d42ec[_0xa821('0x15')]?_0x5d42ec['options'][_0xa821('0x18')]||null:null,'limit':_0x5d42ec[_0xa821('0x15')]?_0x5d42ec[_0xa821('0x15')][_0xa821('0x26')]||null:null,'include':_0x5d42ec[_0xa821('0x15')]?_0x5d42ec[_0xa821('0x15')]['include']?_[_0xa821('0x19')](_0x5d42ec[_0xa821('0x15')][_0xa821('0x1a')],function(_0x35b3f3){return{'model':db[_0x35b3f3['model']],'as':_0x35b3f3['as'],'attributes':_0x35b3f3['as']===_0xa821('0x2d')?_[_0xa821('0x46')](_0x86662b):_0x35b3f3[_0xa821('0x18')],'include':_0x35b3f3[_0xa821('0x1a')]?_['map'](_0x35b3f3[_0xa821('0x1a')],function(_0x31909b){return{'model':db[_0x31909b[_0xa821('0x1b')]],'as':_0x31909b['as'],'attributes':_0x31909b['attributes'],'include':_0x31909b[_0xa821('0x1a')]?_[_0xa821('0x19')](_0x31909b['include'],function(_0x26024f){return{'model':db[_0x26024f[_0xa821('0x1b')]],'as':_0x26024f['as'],'attributes':_0x26024f[_0xa821('0x18')]};}):[]};}):[]};}):[]:[]})[_0xa821('0x1c')](function(_0x49adfa){logger[_0xa821('0xb')](_0xa821('0x1d'),_0x5d42ec);logger[_0xa821('0xe')]('GetCmHopper',_0x5d42ec,JSON[_0xa821('0x1e')](_0x49adfa));_0x2b29cc(_0x49adfa);})['catch'](function(_0x1911e9){logger[_0xa821('0x10')](_0xa821('0x1d'),_0x1911e9['message'],_0x5d42ec);_0x8f5de2(_0x45f880['error'](0x1f4,_0x1911e9[_0xa821('0x12')]));});});});}; \ No newline at end of file +var _0x9ad8=['attributes','limit','map','include','model','GetCmHopper','catch','ShowCmHopper','CmHopper','find','stringify','CreateCmHopper','body','UpdateCmHopper','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','findAll','order','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','push','includes','all','sequelize','CmHopperFinal','create','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','GetContactRecallMe','LOCK','update','GetCmHopperPreview','keys','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','code','error','message','result','options','raw','where'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x9ad8,0x1a4));var _0x89ad=function(_0x1bfa31,_0x131b5b){_0x1bfa31=_0x1bfa31-0x0;var _0x32f67c=_0x9ad8[_0x1bfa31];return _0x32f67c;};'use strict';var _=require('lodash');var util=require(_0x89ad('0x0'));var moment=require(_0x89ad('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x89ad('0x2'));var db=require(_0x89ad('0x3'))['db'];var utils=require(_0x89ad('0x4'));var logger=require('../../config/logger')(_0x89ad('0x5'));var config=require(_0x89ad('0x6'));var jayson=require(_0x89ad('0x7'));var client=jayson[_0x89ad('0x8')][_0x89ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x584837,_0x1a3bdd,_0x273283){return new BPromise(function(_0x68e0c8,_0x172ad7){return client[_0x89ad('0xa')](_0x584837,_0x273283)[_0x89ad('0xb')](function(_0x51bc61){logger[_0x89ad('0xc')](_0x89ad('0xd'),_0x1a3bdd,_0x89ad('0xe'));logger[_0x89ad('0xf')](_0x89ad('0x10'),_0x1a3bdd,_0x89ad('0xe'),JSON['stringify'](_0x51bc61));if(_0x51bc61['error']){if(_0x51bc61['error'][_0x89ad('0x11')]===0x1f4){logger[_0x89ad('0x12')]('CmHopper,\x20%s,\x20%s',_0x1a3bdd,_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);return _0x172ad7(_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);}logger['error'](_0x89ad('0xd'),_0x1a3bdd,_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);return _0x68e0c8(_0x51bc61[_0x89ad('0x12')][_0x89ad('0x13')]);}else{logger[_0x89ad('0xc')](_0x89ad('0xd'),_0x1a3bdd,_0x89ad('0xe'));_0x68e0c8(_0x51bc61[_0x89ad('0x14')]['message']);}})['catch'](function(_0x110337){logger[_0x89ad('0x12')](_0x89ad('0xd'),_0x1a3bdd,_0x110337);_0x172ad7(_0x110337);});});}exports['GetCmHopper']=function(_0x1edb13){var _0x108a97=this;return new Promise(function(_0x8aaec3,_0xbc1875){return db['CmHopper']['findAll']({'raw':_0x1edb13[_0x89ad('0x15')]?_0x1edb13[_0x89ad('0x15')][_0x89ad('0x16')]===undefined?!![]:![]:!![],'where':_0x1edb13['options']?_0x1edb13['options'][_0x89ad('0x17')]||null:null,'attributes':_0x1edb13['options']?_0x1edb13[_0x89ad('0x15')][_0x89ad('0x18')]||null:null,'limit':_0x1edb13['options']?_0x1edb13[_0x89ad('0x15')][_0x89ad('0x19')]||null:null,'include':_0x1edb13[_0x89ad('0x15')]?_0x1edb13['options']['include']?_[_0x89ad('0x1a')](_0x1edb13[_0x89ad('0x15')][_0x89ad('0x1b')],function(_0x7d8086){return{'model':db[_0x7d8086[_0x89ad('0x1c')]],'as':_0x7d8086['as'],'attributes':_0x7d8086[_0x89ad('0x18')],'include':_0x7d8086[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x7d8086[_0x89ad('0x1b')],function(_0x235ade){return{'model':db[_0x235ade[_0x89ad('0x1c')]],'as':_0x235ade['as'],'attributes':_0x235ade[_0x89ad('0x18')],'include':_0x235ade[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x235ade[_0x89ad('0x1b')],function(_0x5dcbda){return{'model':db[_0x5dcbda[_0x89ad('0x1c')]],'as':_0x5dcbda['as'],'attributes':_0x5dcbda['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ad('0xb')](function(_0xa7e237){logger[_0x89ad('0xc')]('GetCmHopper',_0x1edb13);logger['debug'](_0x89ad('0x1d'),_0x1edb13,JSON['stringify'](_0xa7e237));_0x8aaec3(_0xa7e237);})[_0x89ad('0x1e')](function(_0x19828c){logger['error'](_0x89ad('0x1d'),_0x19828c['message'],_0x1edb13);_0xbc1875(_0x108a97[_0x89ad('0x12')](0x1f4,_0x19828c[_0x89ad('0x13')]));});});};exports[_0x89ad('0x1f')]=function(_0x4c6fc){var _0x1495b4=this;return new Promise(function(_0x5e3665,_0x48d099){return db[_0x89ad('0x20')][_0x89ad('0x21')]({'raw':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc[_0x89ad('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc['options'][_0x89ad('0x17')]||null:null,'attributes':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc['options']['attributes']||null:null,'include':_0x4c6fc[_0x89ad('0x15')]?_0x4c6fc[_0x89ad('0x15')][_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x4c6fc['options'][_0x89ad('0x1b')],function(_0x374e5b){return{'model':db[_0x374e5b[_0x89ad('0x1c')]],'as':_0x374e5b['as'],'attributes':_0x374e5b[_0x89ad('0x18')],'include':_0x374e5b[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x374e5b[_0x89ad('0x1b')],function(_0x13cb70){return{'model':db[_0x13cb70[_0x89ad('0x1c')]],'as':_0x13cb70['as'],'attributes':_0x13cb70[_0x89ad('0x18')],'include':_0x13cb70[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x13cb70[_0x89ad('0x1b')],function(_0x4c1120){return{'model':db[_0x4c1120[_0x89ad('0x1c')]],'as':_0x4c1120['as'],'attributes':_0x4c1120[_0x89ad('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd5a363){logger[_0x89ad('0xc')](_0x89ad('0x1f'),_0x4c6fc);logger['debug'](_0x89ad('0x1f'),_0x4c6fc,JSON[_0x89ad('0x22')](_0xd5a363));_0x5e3665(_0xd5a363);})['catch'](function(_0x3c1015){logger[_0x89ad('0x12')](_0x89ad('0x1f'),_0x3c1015[_0x89ad('0x13')],_0x4c6fc);_0x48d099(_0x1495b4['error'](0x1f4,_0x3c1015[_0x89ad('0x13')]));});});};exports[_0x89ad('0x23')]=function(_0x3a0378){var _0x673019=this;return new Promise(function(_0x484c86,_0x293d55){return db[_0x89ad('0x20')]['create'](_0x3a0378[_0x89ad('0x24')],{'raw':_0x3a0378['options']?_0x3a0378['options'][_0x89ad('0x16')]===undefined?!![]:![]:!![]})[_0x89ad('0xb')](function(_0x39b5aa){logger['info'](_0x89ad('0x23'),_0x3a0378);logger[_0x89ad('0xf')](_0x89ad('0x23'),_0x3a0378,JSON['stringify'](_0x39b5aa));_0x484c86(_0x39b5aa);})['catch'](function(_0x5884b2){logger[_0x89ad('0x12')](_0x89ad('0x23'),_0x5884b2['message'],_0x3a0378);_0x293d55(_0x673019[_0x89ad('0x12')](0x1f4,_0x5884b2['message']));});});};exports['UpdateCmHopper']=function(_0x5a3e86){var _0x3e4a88=this;return new Promise(function(_0x4e8429,_0xf8c3f){return db[_0x89ad('0x20')]['update'](_0x5a3e86['body'],{'raw':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86['options'][_0x89ad('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86['options'][_0x89ad('0x17')]||null:null,'attributes':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86[_0x89ad('0x15')]['attributes']||null:null,'limit':_0x5a3e86[_0x89ad('0x15')]?_0x5a3e86[_0x89ad('0x15')][_0x89ad('0x19')]||null:null})[_0x89ad('0xb')](function(_0x21efd3){logger[_0x89ad('0xc')](_0x89ad('0x25'),_0x5a3e86);logger['debug'](_0x89ad('0x25'),_0x5a3e86,JSON['stringify'](_0x21efd3));_0x4e8429(_0x21efd3);})[_0x89ad('0x1e')](function(_0x24e2c0){logger[_0x89ad('0x12')](_0x89ad('0x25'),_0x24e2c0[_0x89ad('0x13')],_0x5a3e86);_0xf8c3f(_0x3e4a88['error'](0x1f4,_0x24e2c0[_0x89ad('0x13')]));});});};exports['DestroyCmHopper']=function(_0x3129be){var _0xb5d4a0=this;return new Promise(function(_0x45ad61,_0x8c851e){return db[_0x89ad('0x20')][_0x89ad('0x26')]({'where':_0x3129be[_0x89ad('0x15')]?_0x3129be[_0x89ad('0x15')][_0x89ad('0x17')]||null:null})[_0x89ad('0xb')](function(_0x30345a){logger[_0x89ad('0xc')](_0x89ad('0x27'),_0x3129be);logger[_0x89ad('0xf')](_0x89ad('0x27'),_0x3129be,JSON[_0x89ad('0x22')](_0x30345a));_0x45ad61(_0x30345a);})['catch'](function(_0x1bfa1d){logger['error'](_0x89ad('0x27'),_0x1bfa1d[_0x89ad('0x13')],_0x3129be);_0x8c851e(_0xb5d4a0[_0x89ad('0x12')](0x1f4,_0x1bfa1d[_0x89ad('0x13')]));});});};exports[_0x89ad('0x28')]=function(_0x3b11e9){var _0x4be5a6=this;return new Promise(function(_0x3e7697,_0x49dfa4){return db[_0x89ad('0x29')][_0x89ad('0x2a')]()[_0x89ad('0xb')](function(_0x59573f){return db['sequelize'][_0x89ad('0x2b')](function(_0x492c85){return db[_0x89ad('0x20')][_0x89ad('0x2c')]({'where':_0x3b11e9['options']?_0x3b11e9[_0x89ad('0x15')]['where']||null:null,'attributes':_0x3b11e9[_0x89ad('0x15')]?_0x3b11e9[_0x89ad('0x15')]['attributes']||null:null,'limit':_0x3b11e9['options']?_0x3b11e9[_0x89ad('0x15')][_0x89ad('0x19')]||null:null,'order':_0x3b11e9[_0x89ad('0x15')]?_0x3b11e9[_0x89ad('0x15')][_0x89ad('0x2d')]||null:null,'transaction':_0x492c85,'lock':_0x492c85['LOCK'][_0x89ad('0x2e')],'include':[{'model':db['CmContact'],'as':_0x89ad('0x2f'),'attributes':_['keys'](_0x59573f)},{'model':db[_0x89ad('0x30')],'as':_0x89ad('0x31'),'attributes':['id',_0x89ad('0x32'),_0x89ad('0x33')]}]})[_0x89ad('0xb')](function(_0x5a3ba6){var _0x3ffbbe=[];var _0x245508=[];for(var _0x4fc231=0x0;_0x4fc231<_0x5a3ba6[_0x89ad('0x34')];_0x4fc231+=0x1){var _0x14f520=_0x5a3ba6[_0x4fc231][_0x89ad('0x35')];if(_0x14f520===null){_0x3ffbbe[_0x89ad('0x36')](_0x5a3ba6[_0x4fc231]['update'](_0x3b11e9[_0x89ad('0x24')],{'transaction':_0x492c85}));}else if(!_0x245508[_0x89ad('0x37')](_0x14f520)){_0x245508[_0x89ad('0x36')](_0x14f520);_0x3ffbbe['push'](_0x5a3ba6[_0x4fc231]['update'](_0x3b11e9[_0x89ad('0x24')],{'transaction':_0x492c85}));}}return BPromise[_0x89ad('0x38')](_0x3ffbbe);});})['then'](function(_0x5eb52b){logger['info'](_0x89ad('0x28'),_0x3b11e9);logger[_0x89ad('0xf')](_0x89ad('0x28'),_0x3b11e9,JSON[_0x89ad('0x22')](_0x5eb52b));_0x3e7697(_0x5eb52b);})[_0x89ad('0x1e')](function(_0x5546ee){logger['error'](_0x89ad('0x28'),_0x5546ee[_0x89ad('0x13')],_0x3b11e9);_0x49dfa4(_0x4be5a6[_0x89ad('0x12')](0x1f4,_0x5546ee[_0x89ad('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x5227a2){var _0x5a657c=this;return new Promise(function(_0x8c0202,_0x244596){return db[_0x89ad('0x39')][_0x89ad('0x2b')](function(_0x50b564){return db[_0x89ad('0x3a')][_0x89ad('0x3b')](_0x5227a2[_0x89ad('0x24')],{'raw':_0x5227a2[_0x89ad('0x15')]?_0x5227a2[_0x89ad('0x15')][_0x89ad('0x16')]===undefined?!![]:![]:!![],'transaction':_0x50b564})[_0x89ad('0xb')](function(){return db[_0x89ad('0x20')]['destroy']({'where':_0x5227a2[_0x89ad('0x15')]?_0x5227a2[_0x89ad('0x15')][_0x89ad('0x17')]||null:null,'transaction':_0x50b564});});})['then'](function(_0x595f55){logger['info'](_0x89ad('0x3c'),_0x5227a2);logger[_0x89ad('0xf')](_0x89ad('0x3c'),_0x5227a2,JSON[_0x89ad('0x22')](_0x595f55));_0x8c0202(_0x595f55);})[_0x89ad('0x1e')](function(_0x4bdac4){logger[_0x89ad('0x12')](_0x89ad('0x3c'),_0x4bdac4['message'],_0x5227a2);_0x244596(_0x5a657c['error'](0x1f4,_0x4bdac4['message']));});});};exports[_0x89ad('0x3d')]=function(_0xdda8d4){var _0x536ec3=this;return new Promise(function(_0x215311,_0x45e415){return db['CmHopper'][_0x89ad('0x2c')]({'raw':_0xdda8d4[_0x89ad('0x15')]?_0xdda8d4[_0x89ad('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0xdda8d4[_0x89ad('0x15')]?_0xdda8d4[_0x89ad('0x15')][_0x89ad('0x17')]||null:null,'attributes':[[db['sequelize']['fn'](_0x89ad('0x3e'),db[_0x89ad('0x39')]['fn']('IF',db['sequelize'][_0x89ad('0x3f')](_0x89ad('0x40')+util['format'](_0x89ad('0x41'),moment()[_0x89ad('0x42')](_0x89ad('0x43')))+_0x89ad('0x44')))),'contactsRescheduled']]})[_0x89ad('0xb')](function(_0x153536){logger[_0x89ad('0xc')](_0x89ad('0x3d'),_0xdda8d4);logger['debug']('CountReScheduled',_0xdda8d4,JSON[_0x89ad('0x22')](_0x153536));_0x215311(_0x153536);})[_0x89ad('0x1e')](function(_0x367ec9){logger[_0x89ad('0x12')](_0x89ad('0x3d'),_0x367ec9['message'],_0xdda8d4);_0x45e415(_0x536ec3[_0x89ad('0x12')](0x1f4,_0x367ec9[_0x89ad('0x13')]));});});};exports[_0x89ad('0x45')]=function(_0x43ba2e){var _0x521e91=this;return new Promise(function(_0x14df3f,_0x3cee9a){return db['CmContact']['describe']()[_0x89ad('0xb')](function(_0x1ae0be){return db[_0x89ad('0x39')]['transaction'](function(_0x12f170){return db[_0x89ad('0x20')][_0x89ad('0x2c')]({'where':_0x43ba2e['options']?_0x43ba2e['options']['where']||null:null,'attributes':_0x43ba2e[_0x89ad('0x15')]?_0x43ba2e[_0x89ad('0x15')][_0x89ad('0x18')]||null:null,'limit':0x1,'order':_0x43ba2e[_0x89ad('0x15')]?_0x43ba2e[_0x89ad('0x15')][_0x89ad('0x2d')]||null:null,'group':db['CmHopper'][_0x89ad('0x35')],'transaction':_0x12f170,'lock':_0x12f170[_0x89ad('0x46')][_0x89ad('0x2e')],'include':_0x43ba2e[_0x89ad('0x15')]?_0x43ba2e[_0x89ad('0x15')]['include']?_[_0x89ad('0x1a')](_0x43ba2e['options']['include'],function(_0x104a77){return{'model':db[_0x104a77['model']],'as':_0x104a77['as'],'attributes':_0x104a77['attributes'],'include':_0x104a77[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x104a77[_0x89ad('0x1b')],function(_0x5ba9af){return{'model':db[_0x5ba9af[_0x89ad('0x1c')]],'as':_0x5ba9af['as'],'attributes':_0x5ba9af[_0x89ad('0x18')],'include':_0x5ba9af[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x5ba9af['include'],function(_0x308f11){return{'model':db[_0x308f11['model']],'as':_0x308f11['as'],'attributes':_0x308f11[_0x89ad('0x18')]};}):[]};}):[]};}):[]:[]})[_0x89ad('0xb')](function(_0xd0e2f1){var _0x86bad7=[];for(var _0x3c396a=0x0;_0x3c396a<_0xd0e2f1['length'];_0x3c396a+=0x1){_0x86bad7[_0x89ad('0x36')](_0xd0e2f1[_0x3c396a][_0x89ad('0x47')](_0x43ba2e['body'],{'transaction':_0x12f170}));}return BPromise[_0x89ad('0x38')](_0x86bad7);});})[_0x89ad('0xb')](function(_0x4edac5){logger[_0x89ad('0xc')](_0x89ad('0x45'),_0x43ba2e);logger[_0x89ad('0xf')](_0x89ad('0x45'),_0x43ba2e,JSON['stringify'](_0x4edac5));_0x14df3f(_0x4edac5);})[_0x89ad('0x1e')](function(_0x486949){logger['error']('GetContactRecallMe',_0x486949[_0x89ad('0x13')],_0x43ba2e);_0x3cee9a(_0x521e91[_0x89ad('0x12')](0x1f4,_0x486949['message']));});});});};exports[_0x89ad('0x48')]=function(_0x3e3ca7){var _0xa7d231=this;return new Promise(function(_0x4ae8b8,_0x2cd4b2){db[_0x89ad('0x29')][_0x89ad('0x2a')]()[_0x89ad('0xb')](function(_0x363ad0){return db[_0x89ad('0x20')]['findAll']({'raw':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7[_0x89ad('0x15')][_0x89ad('0x16')]===undefined?!![]:![]:!![],'where':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7[_0x89ad('0x15')][_0x89ad('0x17')]||null:null,'attributes':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7['options'][_0x89ad('0x18')]||null:null,'limit':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7['options'][_0x89ad('0x19')]||null:null,'include':_0x3e3ca7[_0x89ad('0x15')]?_0x3e3ca7[_0x89ad('0x15')]['include']?_[_0x89ad('0x1a')](_0x3e3ca7[_0x89ad('0x15')][_0x89ad('0x1b')],function(_0xf4e5bb){return{'model':db[_0xf4e5bb[_0x89ad('0x1c')]],'as':_0xf4e5bb['as'],'attributes':_0xf4e5bb['as']==='Contact'?_[_0x89ad('0x49')](_0x363ad0):_0xf4e5bb[_0x89ad('0x18')],'include':_0xf4e5bb[_0x89ad('0x1b')]?_['map'](_0xf4e5bb[_0x89ad('0x1b')],function(_0x527e6e){return{'model':db[_0x527e6e['model']],'as':_0x527e6e['as'],'attributes':_0x527e6e[_0x89ad('0x18')],'include':_0x527e6e[_0x89ad('0x1b')]?_[_0x89ad('0x1a')](_0x527e6e[_0x89ad('0x1b')],function(_0x180fff){return{'model':db[_0x180fff[_0x89ad('0x1c')]],'as':_0x180fff['as'],'attributes':_0x180fff[_0x89ad('0x18')]};}):[]};}):[]};}):[]:[]})[_0x89ad('0xb')](function(_0x524eb6){logger['info'](_0x89ad('0x1d'),_0x3e3ca7);logger[_0x89ad('0xf')]('GetCmHopper',_0x3e3ca7,JSON['stringify'](_0x524eb6));_0x4ae8b8(_0x524eb6);})[_0x89ad('0x1e')](function(_0x32fad3){logger[_0x89ad('0x12')]('GetCmHopper',_0x32fad3['message'],_0x3e3ca7);_0x2cd4b2(_0xa7d231['error'](0x1f4,_0x32fad3[_0x89ad('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index d678908..7a32cd6 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 _0x735f=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','/describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','destroy','connect-timeout','express'];(function(_0x4a4e1d,_0xe27926){var _0x24edba=function(_0x3deb38){while(--_0x3deb38){_0x4a4e1d['push'](_0x4a4e1d['shift']());}};_0x24edba(++_0xe27926);}(_0x735f,0x18d));var _0xf735=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x735f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf735('0x0'));var express=require(_0xf735('0x1'));var router=express[_0xf735('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf735('0x3'));var interaction=require(_0xf735('0x4'));var config=require(_0xf735('0x5'));var controller=require(_0xf735('0x6'));router[_0xf735('0x7')]('/',auth[_0xf735('0x8')](),controller['index']);router[_0xf735('0x7')](_0xf735('0x9'),auth[_0xf735('0x8')](),controller['describe']);router[_0xf735('0x7')](_0xf735('0xa'),auth[_0xf735('0x8')](),controller[_0xf735('0xb')]);router[_0xf735('0x7')](_0xf735('0xc'),auth[_0xf735('0x8')](),controller[_0xf735('0xd')]);router[_0xf735('0xe')]('/',auth[_0xf735('0x8')](),controller[_0xf735('0xf')]);router[_0xf735('0xe')](_0xf735('0x10'),auth['isAuthenticated'](),controller[_0xf735('0x11')]);router[_0xf735('0x12')](_0xf735('0xc'),auth[_0xf735('0x8')](),controller[_0xf735('0x13')]);router['delete'](_0xf735('0xc'),auth[_0xf735('0x8')](),controller[_0xf735('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb3f3=['connect-timeout','express','Router','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','/describe','describe','/opencontacts','/:id','show','create','getPreview','put','update','delete','destroy','exports','multer','util','path'];(function(_0x592863,_0x5584a2){var _0x274186=function(_0x5b49ec){while(--_0x5b49ec){_0x592863['push'](_0x592863['shift']());}};_0x274186(++_0x5584a2);}(_0xb3f3,0x1cb));var _0x3b3f=function(_0x3eef60,_0x9eb279){_0x3eef60=_0x3eef60-0x0;var _0x569efe=_0xb3f3[_0x3eef60];return _0x569efe;};'use strict';var multer=require(_0x3b3f('0x0'));var util=require(_0x3b3f('0x1'));var path=require(_0x3b3f('0x2'));var timeout=require(_0x3b3f('0x3'));var express=require(_0x3b3f('0x4'));var router=express[_0x3b3f('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3b3f('0x6'));var config=require('../../config/environment');var controller=require(_0x3b3f('0x7'));router[_0x3b3f('0x8')]('/',auth[_0x3b3f('0x9')](),controller['index']);router[_0x3b3f('0x8')](_0x3b3f('0xa'),auth[_0x3b3f('0x9')](),controller[_0x3b3f('0xb')]);router[_0x3b3f('0x8')](_0x3b3f('0xc'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x3b3f('0x8')](_0x3b3f('0xd'),auth[_0x3b3f('0x9')](),controller[_0x3b3f('0xe')]);router['post']('/',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0xf')]);router['post']('/preview',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0x10')]);router[_0x3b3f('0x11')]('/:id',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0x12')]);router[_0x3b3f('0x13')]('/:id',auth[_0x3b3f('0x9')](),controller[_0x3b3f('0x14')]);module[_0x3b3f('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 64f7fbf..56ee833 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 _0x5581=['INTEGER','contactListQueue','moment','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5581,0x115));var _0x1558=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x5581[_0x5d2803];return _0xdcad2c;};'use strict';var moment=require(_0x1558('0x0'));var Sequelize=require('sequelize');module[_0x1558('0x1')]={'phone':{'type':Sequelize[_0x1558('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1558('0x3')],'unique':_0x1558('0x4')},'ListId':{'type':Sequelize[_0x1558('0x3')],'unique':_0x1558('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x1558('0x4')}}; \ No newline at end of file +var _0x433a=['INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x4f0a61,_0x1df9a7){var _0x447ea6=function(_0x22577e){while(--_0x22577e){_0x4f0a61['push'](_0x4f0a61['shift']());}};_0x447ea6(++_0x1df9a7);}(_0x433a,0x14c));var _0xa433=function(_0x55f502,_0x5c0e22){_0x55f502=_0x55f502-0x0;var _0x108e6e=_0x433a[_0x55f502];return _0x108e6e;};'use strict';var moment=require(_0xa433('0x0'));var Sequelize=require(_0xa433('0x1'));module[_0xa433('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'ListId':{'type':Sequelize[_0xa433('0x3')],'unique':_0xa433('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa433('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 14564fc..fa4f880 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 _0x859e=['ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv'];(function(_0x5663b6,_0x1109bb){var _0x46e231=function(_0x348344){while(--_0x348344){_0x5663b6['push'](_0x5663b6['shift']());}};_0x46e231(++_0x1109bb);}(_0x859e,0x1ad));var _0xe859=function(_0x5e41fd,_0x151b04){_0x5e41fd=_0x5e41fd-0x0;var _0x25e59b=_0x859e[_0x5e41fd];return _0x25e59b;};'use strict';var emlformat=require(_0xe859('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe859('0x1'));var jsonpatch=require(_0xe859('0x2'));var rp=require(_0xe859('0x3'));var moment=require(_0xe859('0x4'));var BPromise=require(_0xe859('0x5'));var Mustache=require('mustache');var util=require(_0xe859('0x6'));var path=require(_0xe859('0x7'));var sox=require('sox');var csv=require(_0xe859('0x8'));var ejs=require(_0xe859('0x9'));var fs=require('fs');var fs_extra=require(_0xe859('0xa'));var _=require('lodash');var squel=require(_0xe859('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe859('0x8'));var querystring=require(_0xe859('0xc'));var Papa=require(_0xe859('0xd'));var Redis=require('ioredis');var authService=require(_0xe859('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xe859('0xf'));var hardwareService=require(_0xe859('0x10'));var logger=require(_0xe859('0x11'))(_0xe859('0x12'));var utils=require(_0xe859('0x13'));var config=require(_0xe859('0x14'));var licenseUtil=require(_0xe859('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa9aa2c,_0x5c8c3b){_0x5c8c3b=_0x5c8c3b||0xcc;return function(_0xde36b2){if(_0xde36b2){return _0xa9aa2c[_0xe859('0x16')](_0x5c8c3b);}return _0xa9aa2c[_0xe859('0x17')](_0x5c8c3b)[_0xe859('0x18')]();};}function respondWithResult(_0x237500,_0x44223e){_0x44223e=_0x44223e||0xc8;return function(_0x1e2eab){if(_0x1e2eab){return _0x237500[_0xe859('0x17')](_0x44223e)[_0xe859('0x19')](_0x1e2eab);}};}function respondWithFilteredResult(_0x35136a,_0x30f472){return function(_0x491218){if(_0x491218){var _0x4e4572=typeof _0x30f472[_0xe859('0x1a')]===_0xe859('0x1b')&&typeof _0x30f472['limit']===_0xe859('0x1b');var _0xa77a53=_0x491218['count'];var _0x43bdde=_0x4e4572?0x0:_0x30f472[_0xe859('0x1a')];var _0x10e463=_0x4e4572?_0x491218[_0xe859('0x1c')]:_0x30f472[_0xe859('0x1a')]+_0x30f472[_0xe859('0x1d')];var _0x279c85;if(_0x10e463>=_0xa77a53){_0x10e463=_0xa77a53;_0x279c85=0xc8;}else{_0x279c85=0xce;}_0x35136a[_0xe859('0x17')](_0x279c85);return _0x35136a[_0xe859('0x1e')](_0xe859('0x1f'),_0x43bdde+'-'+_0x10e463+'/'+_0xa77a53)['json'](_0x491218);}return null;};}function patchUpdates(_0x35e5fb){return function(_0x4d4804){try{jsonpatch[_0xe859('0x20')](_0x4d4804,_0x35e5fb,!![]);}catch(_0x409e80){return BPromise['reject'](_0x409e80);}return _0x4d4804['save']();};}function saveUpdates(_0x32d1bb,_0x3d37d9){return function(_0x33d8b4){if(_0x33d8b4){return _0x33d8b4[_0xe859('0x21')](_0x32d1bb)[_0xe859('0x22')](function(_0x17c7c9){return _0x17c7c9;});}return null;};}function removeEntity(_0x15e084,_0x31bf59){return function(_0x3358ca){if(_0x3358ca){return _0x3358ca[_0xe859('0x23')]()[_0xe859('0x22')](function(){_0x15e084[_0xe859('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df6a2,_0x49af49){return function(_0x233baa){if(!_0x233baa){_0x1df6a2[_0xe859('0x16')](0x194);}return _0x233baa;};}function handleError(_0x1ac541,_0x1ed929){_0x1ed929=_0x1ed929||0x1f4;return function(_0x14b719){logger[_0xe859('0x24')](_0x14b719[_0xe859('0x25')]);if(_0x14b719[_0xe859('0x26')]){delete _0x14b719['name'];}_0x1ac541[_0xe859('0x17')](_0x1ed929)[_0xe859('0x27')](_0x14b719);};}exports[_0xe859('0x28')]=function(_0x30f9ab,_0x56a3fd){var _0x788e50={},_0x292338={},_0x33241d={'count':0x0,'rows':[]};var _0x35073c=_[_0xe859('0x29')](db[_0xe859('0x2a')][_0xe859('0x2b')],function(_0x14ff8b){return{'name':_0x14ff8b[_0xe859('0x2c')],'type':_0x14ff8b[_0xe859('0x2d')][_0xe859('0x2e')]};});_0x292338[_0xe859('0x2f')]=_[_0xe859('0x29')](_0x35073c,_0xe859('0x26'));_0x292338['query']=_[_0xe859('0x30')](_0x30f9ab['query']);_0x292338['filters']=_[_0xe859('0x31')](_0x292338[_0xe859('0x2f')],_0x292338[_0xe859('0x32')]);_0x788e50[_0xe859('0x33')]=_[_0xe859('0x31')](_0x292338[_0xe859('0x2f')],qs[_0xe859('0x34')](_0x30f9ab[_0xe859('0x32')][_0xe859('0x34')]));_0x788e50[_0xe859('0x33')]=_0x788e50[_0xe859('0x33')][_0xe859('0x35')]?_0x788e50[_0xe859('0x33')]:_0x292338[_0xe859('0x2f')];if(!_0x30f9ab[_0xe859('0x32')][_0xe859('0x36')]('nolimit')){_0x788e50[_0xe859('0x1d')]=qs[_0xe859('0x1d')](_0x30f9ab[_0xe859('0x32')]['limit']);_0x788e50['offset']=qs[_0xe859('0x1a')](_0x30f9ab[_0xe859('0x32')][_0xe859('0x1a')]);}_0x788e50[_0xe859('0x37')]=qs[_0xe859('0x38')](_0x30f9ab[_0xe859('0x32')][_0xe859('0x38')]);_0x788e50[_0xe859('0x39')]=qs['filters'](_[_0xe859('0x3a')](_0x30f9ab[_0xe859('0x32')],_0x292338['filters']),_0x35073c);if(_0x30f9ab[_0xe859('0x32')][_0xe859('0x3b')]){_0x788e50[_0xe859('0x39')]=_['merge'](_0x788e50[_0xe859('0x39')],{'$or':_[_0xe859('0x29')](_0x35073c,function(_0x48e5ca){if(_0x48e5ca[_0xe859('0x2d')]!==_0xe859('0x3c')){var _0x4c7697={};_0x4c7697[_0x48e5ca[_0xe859('0x26')]]={'$like':'%'+_0x30f9ab[_0xe859('0x32')][_0xe859('0x3b')]+'%'};return _0x4c7697;}})});}_0x788e50=_[_0xe859('0x3d')]({},_0x788e50,_0x30f9ab[_0xe859('0x3e')]);var _0x4789f8={'where':_0x788e50['where']};return db['CmHopperBlack'][_0xe859('0x1c')](_0x4789f8)['then'](function(_0x5e41e7){_0x33241d[_0xe859('0x1c')]=_0x5e41e7;if(_0x30f9ab[_0xe859('0x32')][_0xe859('0x3f')]){_0x788e50[_0xe859('0x40')]=[{'all':!![]}];}return db[_0xe859('0x2a')][_0xe859('0x41')](_0x788e50);})[_0xe859('0x22')](function(_0x5d1c22){_0x33241d[_0xe859('0x42')]=_0x5d1c22;return _0x33241d;})[_0xe859('0x22')](respondWithFilteredResult(_0x56a3fd,_0x788e50))[_0xe859('0x43')](handleError(_0x56a3fd,null));};exports[_0xe859('0x44')]=function(_0x4d2696,_0x1f823a){var _0x2d2cff={'raw':!![],'where':{'id':_0x4d2696[_0xe859('0x45')]['id']}},_0x2747ee={};_0x2747ee[_0xe859('0x2f')]=_[_0xe859('0x30')](db[_0xe859('0x2a')][_0xe859('0x2b')]);_0x2747ee['query']=_[_0xe859('0x30')](_0x4d2696[_0xe859('0x32')]);_0x2747ee['filters']=_[_0xe859('0x31')](_0x2747ee[_0xe859('0x2f')],_0x2747ee[_0xe859('0x32')]);_0x2d2cff[_0xe859('0x33')]=_[_0xe859('0x31')](_0x2747ee[_0xe859('0x2f')],qs[_0xe859('0x34')](_0x4d2696[_0xe859('0x32')][_0xe859('0x34')]));_0x2d2cff[_0xe859('0x33')]=_0x2d2cff[_0xe859('0x33')]['length']?_0x2d2cff['attributes']:_0x2747ee['model'];if(_0x4d2696[_0xe859('0x32')][_0xe859('0x3f')]){_0x2d2cff[_0xe859('0x40')]=[{'all':!![]}];}_0x2d2cff=_['merge']({},_0x2d2cff,_0x4d2696[_0xe859('0x3e')]);return db[_0xe859('0x2a')]['find'](_0x2d2cff)[_0xe859('0x22')](handleEntityNotFound(_0x1f823a,null))[_0xe859('0x22')](respondWithResult(_0x1f823a,null))['catch'](handleError(_0x1f823a,null));};exports['update']=function(_0x1d403e,_0x169acd){if(_0x1d403e['body']['id']){delete _0x1d403e[_0xe859('0x46')]['id'];}return db[_0xe859('0x2a')][_0xe859('0x47')]({'where':{'id':_0x1d403e[_0xe859('0x45')]['id']}})[_0xe859('0x22')](handleEntityNotFound(_0x169acd,null))[_0xe859('0x22')](saveUpdates(_0x1d403e['body'],null))[_0xe859('0x22')](respondWithResult(_0x169acd,null))[_0xe859('0x43')](handleError(_0x169acd,null));};exports[_0xe859('0x23')]=function(_0x23453c,_0x15eb36){return db['CmHopperBlack']['find']({'where':{'id':_0x23453c[_0xe859('0x45')]['id']}})[_0xe859('0x22')](handleEntityNotFound(_0x15eb36,null))[_0xe859('0x22')](removeEntity(_0x15eb36,null))[_0xe859('0x43')](handleError(_0x15eb36,null));};exports['describe']=function(_0x5865b8,_0x53eea6){return db[_0xe859('0x2a')][_0xe859('0x48')]()[_0xe859('0x22')](respondWithResult(_0x53eea6,null))[_0xe859('0x43')](handleError(_0x53eea6,null));}; \ No newline at end of file +var _0x67a2=['nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','then','includeAll','include','rows','show','params','catch','update','find','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','error','name','index','CmHopperBlack','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','length','attributes'];(function(_0xb4ce16,_0x2bd30c){var _0x14055c=function(_0x16909e){while(--_0x16909e){_0xb4ce16['push'](_0xb4ce16['shift']());}};_0x14055c(++_0x2bd30c);}(_0x67a2,0xf4));var _0x267a=function(_0x3caae9,_0x2c9e39){_0x3caae9=_0x3caae9-0x0;var _0x115d3d=_0x67a2[_0x3caae9];return _0x115d3d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x267a('0x0'));var zipdir=require(_0x267a('0x1'));var jsonpatch=require(_0x267a('0x2'));var rp=require(_0x267a('0x3'));var moment=require(_0x267a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x267a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x267a('0x6'));var csv=require('to-csv');var ejs=require(_0x267a('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x267a('0x8'));var crypto=require('crypto');var jsforce=require(_0x267a('0x9'));var deskjs=require(_0x267a('0xa'));var toCsv=require(_0x267a('0xb'));var querystring=require(_0x267a('0xc'));var Papa=require(_0x267a('0xd'));var Redis=require(_0x267a('0xe'));var authService=require(_0x267a('0xf'));var qs=require(_0x267a('0x10'));var as=require(_0x267a('0x11'));var hardwareService=require(_0x267a('0x12'));var logger=require('../../config/logger')(_0x267a('0x13'));var utils=require(_0x267a('0x14'));var config=require(_0x267a('0x15'));var licenseUtil=require(_0x267a('0x16'));var db=require(_0x267a('0x17'))['db'];function respondWithStatusCode(_0x208531,_0x4c2192){_0x4c2192=_0x4c2192||0xcc;return function(_0x4b7c35){if(_0x4b7c35){return _0x208531[_0x267a('0x18')](_0x4c2192);}return _0x208531[_0x267a('0x19')](_0x4c2192)[_0x267a('0x1a')]();};}function respondWithResult(_0x151d2c,_0x1bf58c){_0x1bf58c=_0x1bf58c||0xc8;return function(_0x3d0177){if(_0x3d0177){return _0x151d2c[_0x267a('0x19')](_0x1bf58c)[_0x267a('0x1b')](_0x3d0177);}};}function respondWithFilteredResult(_0x9413e5,_0x4e0495){return function(_0xe00a46){if(_0xe00a46){var _0x1d3ba4=typeof _0x4e0495[_0x267a('0x1c')]===_0x267a('0x1d')&&typeof _0x4e0495[_0x267a('0x1e')]===_0x267a('0x1d');var _0x689a1f=_0xe00a46['count'];var _0x376631=_0x1d3ba4?0x0:_0x4e0495[_0x267a('0x1c')];var _0x455e57=_0x1d3ba4?_0xe00a46[_0x267a('0x1f')]:_0x4e0495['offset']+_0x4e0495[_0x267a('0x1e')];var _0x6bd6d8;if(_0x455e57>=_0x689a1f){_0x455e57=_0x689a1f;_0x6bd6d8=0xc8;}else{_0x6bd6d8=0xce;}_0x9413e5['status'](_0x6bd6d8);return _0x9413e5[_0x267a('0x20')]('Content-Range',_0x376631+'-'+_0x455e57+'/'+_0x689a1f)['json'](_0xe00a46);}return null;};}function patchUpdates(_0x5ddf4b){return function(_0x178cb3){try{jsonpatch[_0x267a('0x21')](_0x178cb3,_0x5ddf4b,!![]);}catch(_0x107a8e){return BPromise[_0x267a('0x22')](_0x107a8e);}return _0x178cb3[_0x267a('0x23')]();};}function saveUpdates(_0x5a0ee3,_0x143c17){return function(_0x16cd2a){if(_0x16cd2a){return _0x16cd2a['update'](_0x5a0ee3)['then'](function(_0x44116f){return _0x44116f;});}return null;};}function removeEntity(_0x24c6ad,_0x534b3d){return function(_0xb1103d){if(_0xb1103d){return _0xb1103d['destroy']()['then'](function(){_0x24c6ad[_0x267a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x575830,_0x70a0b3){return function(_0x40b7a7){if(!_0x40b7a7){_0x575830[_0x267a('0x18')](0x194);}return _0x40b7a7;};}function handleError(_0x17fc2b,_0x5b93f4){_0x5b93f4=_0x5b93f4||0x1f4;return function(_0x203fab){logger[_0x267a('0x24')](_0x203fab['stack']);if(_0x203fab['name']){delete _0x203fab[_0x267a('0x25')];}_0x17fc2b[_0x267a('0x19')](_0x5b93f4)['send'](_0x203fab);};}exports[_0x267a('0x26')]=function(_0xebec9e,_0x1f42b9){var _0x268db8={},_0x24f549={},_0x5ea173={'count':0x0,'rows':[]};var _0x469038=_['map'](db[_0x267a('0x27')][_0x267a('0x28')],function(_0x3ebb2f){return{'name':_0x3ebb2f[_0x267a('0x29')],'type':_0x3ebb2f['type'][_0x267a('0x2a')]};});_0x24f549['model']=_[_0x267a('0x2b')](_0x469038,_0x267a('0x25'));_0x24f549[_0x267a('0x2c')]=_[_0x267a('0x2d')](_0xebec9e[_0x267a('0x2c')]);_0x24f549[_0x267a('0x2e')]=_[_0x267a('0x2f')](_0x24f549[_0x267a('0x30')],_0x24f549[_0x267a('0x2c')]);_0x268db8['attributes']=_[_0x267a('0x2f')](_0x24f549[_0x267a('0x30')],qs['fields'](_0xebec9e[_0x267a('0x2c')][_0x267a('0x31')]));_0x268db8['attributes']=_0x268db8['attributes'][_0x267a('0x32')]?_0x268db8[_0x267a('0x33')]:_0x24f549[_0x267a('0x30')];if(!_0xebec9e[_0x267a('0x2c')]['hasOwnProperty'](_0x267a('0x34'))){_0x268db8[_0x267a('0x1e')]=qs[_0x267a('0x1e')](_0xebec9e[_0x267a('0x2c')][_0x267a('0x1e')]);_0x268db8[_0x267a('0x1c')]=qs['offset'](_0xebec9e[_0x267a('0x2c')][_0x267a('0x1c')]);}_0x268db8[_0x267a('0x35')]=qs[_0x267a('0x36')](_0xebec9e['query'][_0x267a('0x36')]);_0x268db8['where']=qs[_0x267a('0x2e')](_[_0x267a('0x37')](_0xebec9e[_0x267a('0x2c')],_0x24f549[_0x267a('0x2e')]),_0x469038);if(_0xebec9e[_0x267a('0x2c')][_0x267a('0x38')]){_0x268db8[_0x267a('0x39')]=_[_0x267a('0x3a')](_0x268db8[_0x267a('0x39')],{'$or':_[_0x267a('0x2b')](_0x469038,function(_0x5cb691){if(_0x5cb691[_0x267a('0x3b')]!==_0x267a('0x3c')){var _0x5c7ffd={};_0x5c7ffd[_0x5cb691['name']]={'$like':'%'+_0xebec9e[_0x267a('0x2c')]['filter']+'%'};return _0x5c7ffd;}})});}_0x268db8=_['merge']({},_0x268db8,_0xebec9e[_0x267a('0x3d')]);var _0x53cf98={'where':_0x268db8[_0x267a('0x39')]};return db[_0x267a('0x27')]['count'](_0x53cf98)[_0x267a('0x3e')](function(_0x37f9f8){_0x5ea173[_0x267a('0x1f')]=_0x37f9f8;if(_0xebec9e[_0x267a('0x2c')][_0x267a('0x3f')]){_0x268db8[_0x267a('0x40')]=[{'all':!![]}];}return db[_0x267a('0x27')]['findAll'](_0x268db8);})[_0x267a('0x3e')](function(_0x10e308){_0x5ea173[_0x267a('0x41')]=_0x10e308;return _0x5ea173;})['then'](respondWithFilteredResult(_0x1f42b9,_0x268db8))['catch'](handleError(_0x1f42b9,null));};exports[_0x267a('0x42')]=function(_0x3dd3cb,_0x14f6aa){var _0xbd067b={'raw':!![],'where':{'id':_0x3dd3cb[_0x267a('0x43')]['id']}},_0x218abc={};_0x218abc['model']=_[_0x267a('0x2d')](db[_0x267a('0x27')][_0x267a('0x28')]);_0x218abc['query']=_['keys'](_0x3dd3cb[_0x267a('0x2c')]);_0x218abc[_0x267a('0x2e')]=_[_0x267a('0x2f')](_0x218abc[_0x267a('0x30')],_0x218abc[_0x267a('0x2c')]);_0xbd067b[_0x267a('0x33')]=_[_0x267a('0x2f')](_0x218abc[_0x267a('0x30')],qs['fields'](_0x3dd3cb[_0x267a('0x2c')][_0x267a('0x31')]));_0xbd067b['attributes']=_0xbd067b[_0x267a('0x33')][_0x267a('0x32')]?_0xbd067b[_0x267a('0x33')]:_0x218abc[_0x267a('0x30')];if(_0x3dd3cb[_0x267a('0x2c')][_0x267a('0x3f')]){_0xbd067b[_0x267a('0x40')]=[{'all':!![]}];}_0xbd067b=_[_0x267a('0x3a')]({},_0xbd067b,_0x3dd3cb['options']);return db[_0x267a('0x27')]['find'](_0xbd067b)[_0x267a('0x3e')](handleEntityNotFound(_0x14f6aa,null))['then'](respondWithResult(_0x14f6aa,null))[_0x267a('0x44')](handleError(_0x14f6aa,null));};exports[_0x267a('0x45')]=function(_0x296a75,_0x23b71a){if(_0x296a75['body']['id']){delete _0x296a75['body']['id'];}return db[_0x267a('0x27')][_0x267a('0x46')]({'where':{'id':_0x296a75[_0x267a('0x43')]['id']}})[_0x267a('0x3e')](handleEntityNotFound(_0x23b71a,null))['then'](saveUpdates(_0x296a75[_0x267a('0x47')],null))[_0x267a('0x3e')](respondWithResult(_0x23b71a,null))[_0x267a('0x44')](handleError(_0x23b71a,null));};exports[_0x267a('0x48')]=function(_0x209f15,_0x19a238){return db[_0x267a('0x27')][_0x267a('0x46')]({'where':{'id':_0x209f15[_0x267a('0x43')]['id']}})[_0x267a('0x3e')](handleEntityNotFound(_0x19a238,null))['then'](removeEntity(_0x19a238,null))[_0x267a('0x44')](handleError(_0x19a238,null));};exports['describe']=function(_0x3a498a,_0x32bd7e){return db['CmHopperBlack'][_0x267a('0x49')]()['then'](respondWithResult(_0x32bd7e,null))[_0x267a('0x44')](handleError(_0x32bd7e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index b547d68..94cbb34 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 _0xa38f=['util','api','moment','bluebird','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash'];(function(_0x521c09,_0xdff407){var _0x13a1d6=function(_0x4627cd){while(--_0x4627cd){_0x521c09['push'](_0x521c09['shift']());}};_0x13a1d6(++_0xdff407);}(_0xa38f,0x1a6));var _0xfa38=function(_0x37d0ba,_0x2928cc){_0x37d0ba=_0x37d0ba-0x0;var _0x423f43=_0xa38f[_0x37d0ba];return _0x423f43;};'use strict';var _=require(_0xfa38('0x0'));var util=require(_0xfa38('0x1'));var logger=require('../../config/logger')(_0xfa38('0x2'));var moment=require(_0xfa38('0x3'));var BPromise=require(_0xfa38('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(_0xfa38('0x5'));module[_0xfa38('0x6')]=function(_0x426213,_0x372c77){return _0x426213[_0xfa38('0x7')](_0xfa38('0x8'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b5b=['api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0x2b5b,0x190));var _0xb2b5=function(_0x597c20,_0x22aad1){_0x597c20=_0x597c20-0x0;var _0x5b5e8f=_0x2b5b[_0x597c20];return _0x5b5e8f;};'use strict';var _=require(_0xb2b5('0x0'));var util=require(_0xb2b5('0x1'));var logger=require(_0xb2b5('0x2'))(_0xb2b5('0x3'));var moment=require(_0xb2b5('0x4'));var BPromise=require(_0xb2b5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b5('0x6'));var rimraf=require(_0xb2b5('0x7'));var config=require(_0xb2b5('0x8'));var attributes=require(_0xb2b5('0x9'));module[_0xb2b5('0xa')]=function(_0x2e5b2b,_0x167bdb){return _0x2e5b2b['define'](_0xb2b5('0xb'),attributes,{'tableName':_0xb2b5('0xc'),'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 722baaa..9893e06 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 _0xabec=['../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','update','body','UpdateCmHopperBlack','catch','DestroyCmHopperBlack','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0xabec,0x94));var _0xcabe=function(_0x2f8349,_0xc39962){_0x2f8349=_0x2f8349-0x0;var _0x2bac05=_0xabec[_0x2f8349];return _0x2bac05;};'use strict';var _=require('lodash');var util=require(_0xcabe('0x0'));var moment=require(_0xcabe('0x1'));var BPromise=require(_0xcabe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcabe('0x3'));var db=require(_0xcabe('0x4'))['db'];var utils=require(_0xcabe('0x5'));var logger=require(_0xcabe('0x6'))(_0xcabe('0x7'));var config=require(_0xcabe('0x8'));var jayson=require(_0xcabe('0x9'));var client=jayson[_0xcabe('0xa')][_0xcabe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x403420,_0x34a899,_0x5bc028){return new BPromise(function(_0x2686d1,_0x5b4435){return client[_0xcabe('0xc')](_0x403420,_0x5bc028)[_0xcabe('0xd')](function(_0x4e039a){logger[_0xcabe('0xe')](_0xcabe('0xf'),_0x34a899,_0xcabe('0x10'));logger[_0xcabe('0x11')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x34a899,_0xcabe('0x10'),JSON[_0xcabe('0x12')](_0x4e039a));if(_0x4e039a[_0xcabe('0x13')]){if(_0x4e039a[_0xcabe('0x13')][_0xcabe('0x14')]===0x1f4){logger[_0xcabe('0x13')](_0xcabe('0xf'),_0x34a899,_0x4e039a[_0xcabe('0x13')][_0xcabe('0x15')]);return _0x5b4435(_0x4e039a['error'][_0xcabe('0x15')]);}logger['error'](_0xcabe('0xf'),_0x34a899,_0x4e039a[_0xcabe('0x13')]['message']);return _0x2686d1(_0x4e039a[_0xcabe('0x13')][_0xcabe('0x15')]);}else{logger['info'](_0xcabe('0xf'),_0x34a899,_0xcabe('0x10'));_0x2686d1(_0x4e039a[_0xcabe('0x16')][_0xcabe('0x15')]);}})['catch'](function(_0xcffa09){logger[_0xcabe('0x13')](_0xcabe('0xf'),_0x34a899,_0xcffa09);_0x5b4435(_0xcffa09);});});}exports[_0xcabe('0x17')]=function(_0x3e8080){var _0x241cb6=this;return new Promise(function(_0x3cc035,_0x538647){return db[_0xcabe('0x18')][_0xcabe('0x19')]({'raw':_0x3e8080['options']?_0x3e8080[_0xcabe('0x1a')][_0xcabe('0x1b')]===undefined?!![]:![]:!![],'where':_0x3e8080[_0xcabe('0x1a')]?_0x3e8080['options'][_0xcabe('0x1c')]||null:null,'attributes':_0x3e8080[_0xcabe('0x1a')]?_0x3e8080['options'][_0xcabe('0x1d')]||null:null,'limit':_0x3e8080[_0xcabe('0x1a')]?_0x3e8080[_0xcabe('0x1a')][_0xcabe('0x1e')]||null:null,'include':_0x3e8080[_0xcabe('0x1a')]?_0x3e8080[_0xcabe('0x1a')][_0xcabe('0x1f')]?_[_0xcabe('0x20')](_0x3e8080[_0xcabe('0x1a')]['include'],function(_0x1ff89d){return{'model':db[_0x1ff89d[_0xcabe('0x21')]],'as':_0x1ff89d['as'],'attributes':_0x1ff89d[_0xcabe('0x1d')],'include':_0x1ff89d[_0xcabe('0x1f')]?_[_0xcabe('0x20')](_0x1ff89d[_0xcabe('0x1f')],function(_0x507748){return{'model':db[_0x507748[_0xcabe('0x21')]],'as':_0x507748['as'],'attributes':_0x507748['attributes'],'include':_0x507748[_0xcabe('0x1f')]?_['map'](_0x507748['include'],function(_0xf81af4){return{'model':db[_0xf81af4[_0xcabe('0x21')]],'as':_0xf81af4['as'],'attributes':_0xf81af4['attributes']};}):[]};}):[]};}):[]:[]})[_0xcabe('0xd')](function(_0x2f2c65){logger[_0xcabe('0xe')](_0xcabe('0x17'),_0x3e8080);logger[_0xcabe('0x11')]('GetCmHopperBlack',_0x3e8080,JSON[_0xcabe('0x12')](_0x2f2c65));_0x3cc035(_0x2f2c65);})['catch'](function(_0x2736ae){logger[_0xcabe('0x13')](_0xcabe('0x17'),_0x2736ae[_0xcabe('0x15')],_0x3e8080);_0x538647(_0x241cb6[_0xcabe('0x13')](0x1f4,_0x2736ae[_0xcabe('0x15')]));});});};exports['UpdateCmHopperBlack']=function(_0x17e1a6){var _0x219f66=this;return new Promise(function(_0x4a6a59,_0x28a70e){return db[_0xcabe('0x18')][_0xcabe('0x22')](_0x17e1a6[_0xcabe('0x23')],{'raw':_0x17e1a6['options']?_0x17e1a6[_0xcabe('0x1a')][_0xcabe('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e1a6[_0xcabe('0x1a')]?_0x17e1a6[_0xcabe('0x1a')][_0xcabe('0x1c')]||null:null,'attributes':_0x17e1a6[_0xcabe('0x1a')]?_0x17e1a6[_0xcabe('0x1a')][_0xcabe('0x1d')]||null:null,'limit':_0x17e1a6[_0xcabe('0x1a')]?_0x17e1a6[_0xcabe('0x1a')]['limit']||null:null})[_0xcabe('0xd')](function(_0x288e65){logger[_0xcabe('0xe')](_0xcabe('0x24'),_0x17e1a6);logger[_0xcabe('0x11')]('UpdateCmHopperBlack',_0x17e1a6,JSON[_0xcabe('0x12')](_0x288e65));_0x4a6a59(_0x288e65);})[_0xcabe('0x25')](function(_0x4c3fde){logger['error'](_0xcabe('0x24'),_0x4c3fde['message'],_0x17e1a6);_0x28a70e(_0x219f66[_0xcabe('0x13')](0x1f4,_0x4c3fde[_0xcabe('0x15')]));});});};exports['DestroyCmHopperBlack']=function(_0xef57fc){var _0x3ffb95=this;return new Promise(function(_0x4868dc,_0x2d1c3b){return db[_0xcabe('0x18')]['destroy']({'where':_0xef57fc[_0xcabe('0x1a')]?_0xef57fc[_0xcabe('0x1a')][_0xcabe('0x1c')]||null:null})['then'](function(_0x4c1b34){logger[_0xcabe('0xe')](_0xcabe('0x26'),_0xef57fc);logger['debug'](_0xcabe('0x26'),_0xef57fc,JSON[_0xcabe('0x12')](_0x4c1b34));_0x4868dc(_0x4c1b34);})['catch'](function(_0x189d9b){logger[_0xcabe('0x13')]('DestroyCmHopperBlack',_0x189d9b[_0xcabe('0x15')],_0xef57fc);_0x2d1c3b(_0x3ffb95[_0xcabe('0x13')](0x1f4,_0x189d9b[_0xcabe('0x15')]));});});}; \ No newline at end of file +var _0xf08a=['map','model','UpdateCmHopperBlack','limit','DestroyCmHopperBlack','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','include'];(function(_0x30c8e0,_0x215b56){var _0x50e2b5=function(_0x1f4074){while(--_0x1f4074){_0x30c8e0['push'](_0x30c8e0['shift']());}};_0x50e2b5(++_0x215b56);}(_0xf08a,0xb4));var _0xaf08=function(_0x593c0c,_0x233604){_0x593c0c=_0x593c0c-0x0;var _0x14878e=_0xf08a[_0x593c0c];return _0x14878e;};'use strict';var _=require(_0xaf08('0x0'));var util=require(_0xaf08('0x1'));var moment=require('moment');var BPromise=require(_0xaf08('0x2'));var rs=require(_0xaf08('0x3'));var fs=require('fs');var Redis=require(_0xaf08('0x4'));var db=require(_0xaf08('0x5'))['db'];var utils=require(_0xaf08('0x6'));var logger=require(_0xaf08('0x7'))(_0xaf08('0x8'));var config=require('../../config/environment');var jayson=require(_0xaf08('0x9'));var client=jayson[_0xaf08('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x218312,_0x32ad19,_0x1e07fc){return new BPromise(function(_0x553791,_0x5062e5){return client[_0xaf08('0xb')](_0x218312,_0x1e07fc)[_0xaf08('0xc')](function(_0x138215){logger[_0xaf08('0xd')](_0xaf08('0xe'),_0x32ad19,_0xaf08('0xf'));logger[_0xaf08('0x10')](_0xaf08('0x11'),_0x32ad19,_0xaf08('0xf'),JSON[_0xaf08('0x12')](_0x138215));if(_0x138215[_0xaf08('0x13')]){if(_0x138215[_0xaf08('0x13')]['code']===0x1f4){logger[_0xaf08('0x13')](_0xaf08('0xe'),_0x32ad19,_0x138215['error']['message']);return _0x5062e5(_0x138215[_0xaf08('0x13')][_0xaf08('0x14')]);}logger[_0xaf08('0x13')](_0xaf08('0xe'),_0x32ad19,_0x138215[_0xaf08('0x13')]['message']);return _0x553791(_0x138215[_0xaf08('0x13')][_0xaf08('0x14')]);}else{logger['info'](_0xaf08('0xe'),_0x32ad19,_0xaf08('0xf'));_0x553791(_0x138215[_0xaf08('0x15')][_0xaf08('0x14')]);}})[_0xaf08('0x16')](function(_0x45c31b){logger['error'](_0xaf08('0xe'),_0x32ad19,_0x45c31b);_0x5062e5(_0x45c31b);});});}exports[_0xaf08('0x17')]=function(_0x12fafa){var _0x44d67b=this;return new Promise(function(_0x3d8239,_0x3a5b06){return db[_0xaf08('0x18')]['findAll']({'raw':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1a')]===undefined?!![]:![]:!![],'where':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1b')]||null:null,'attributes':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1c')]||null:null,'limit':_0x12fafa['options']?_0x12fafa[_0xaf08('0x19')]['limit']||null:null,'include':_0x12fafa[_0xaf08('0x19')]?_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1d')]?_[_0xaf08('0x1e')](_0x12fafa[_0xaf08('0x19')][_0xaf08('0x1d')],function(_0x54aa8e){return{'model':db[_0x54aa8e[_0xaf08('0x1f')]],'as':_0x54aa8e['as'],'attributes':_0x54aa8e[_0xaf08('0x1c')],'include':_0x54aa8e['include']?_[_0xaf08('0x1e')](_0x54aa8e[_0xaf08('0x1d')],function(_0x794d83){return{'model':db[_0x794d83[_0xaf08('0x1f')]],'as':_0x794d83['as'],'attributes':_0x794d83[_0xaf08('0x1c')],'include':_0x794d83[_0xaf08('0x1d')]?_['map'](_0x794d83[_0xaf08('0x1d')],function(_0x517c99){return{'model':db[_0x517c99['model']],'as':_0x517c99['as'],'attributes':_0x517c99['attributes']};}):[]};}):[]};}):[]:[]})[_0xaf08('0xc')](function(_0x1cfbf2){logger['info'](_0xaf08('0x17'),_0x12fafa);logger[_0xaf08('0x10')](_0xaf08('0x17'),_0x12fafa,JSON[_0xaf08('0x12')](_0x1cfbf2));_0x3d8239(_0x1cfbf2);})[_0xaf08('0x16')](function(_0x3852c5){logger[_0xaf08('0x13')]('GetCmHopperBlack',_0x3852c5[_0xaf08('0x14')],_0x12fafa);_0x3a5b06(_0x44d67b['error'](0x1f4,_0x3852c5['message']));});});};exports[_0xaf08('0x20')]=function(_0x4a2ff7){var _0x2c81a2=this;return new Promise(function(_0x4886d,_0x3f2ef7){return db['CmHopperBlack']['update'](_0x4a2ff7['body'],{'raw':_0x4a2ff7['options']?_0x4a2ff7[_0xaf08('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a2ff7[_0xaf08('0x19')]?_0x4a2ff7[_0xaf08('0x19')]['where']||null:null,'attributes':_0x4a2ff7[_0xaf08('0x19')]?_0x4a2ff7[_0xaf08('0x19')][_0xaf08('0x1c')]||null:null,'limit':_0x4a2ff7[_0xaf08('0x19')]?_0x4a2ff7[_0xaf08('0x19')][_0xaf08('0x21')]||null:null})[_0xaf08('0xc')](function(_0x4e40f9){logger['info'](_0xaf08('0x20'),_0x4a2ff7);logger['debug'](_0xaf08('0x20'),_0x4a2ff7,JSON[_0xaf08('0x12')](_0x4e40f9));_0x4886d(_0x4e40f9);})[_0xaf08('0x16')](function(_0x3d2264){logger[_0xaf08('0x13')]('UpdateCmHopperBlack',_0x3d2264[_0xaf08('0x14')],_0x4a2ff7);_0x3f2ef7(_0x2c81a2[_0xaf08('0x13')](0x1f4,_0x3d2264[_0xaf08('0x14')]));});});};exports[_0xaf08('0x22')]=function(_0x55a23a){var _0x2dee8d=this;return new Promise(function(_0x3c87b8,_0x27368d){return db['CmHopperBlack']['destroy']({'where':_0x55a23a['options']?_0x55a23a[_0xaf08('0x19')]['where']||null:null})[_0xaf08('0xc')](function(_0x1edb7a){logger[_0xaf08('0xd')](_0xaf08('0x22'),_0x55a23a);logger[_0xaf08('0x10')]('DestroyCmHopperBlack',_0x55a23a,JSON['stringify'](_0x1edb7a));_0x3c87b8(_0x1edb7a);})[_0xaf08('0x16')](function(_0x52408a){logger[_0xaf08('0x13')]('DestroyCmHopperBlack',_0x52408a[_0xaf08('0x14')],_0x55a23a);_0x27368d(_0x2dee8d['error'](0x1f4,_0x52408a[_0xaf08('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index db55582..3c110e1 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 _0xdf55=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','delete','exports','multer','util','connect-timeout','express','fs-extra'];(function(_0x199394,_0x3d0297){var _0x61e770=function(_0x4615ba){while(--_0x4615ba){_0x199394['push'](_0x199394['shift']());}};_0x61e770(++_0x3d0297);}(_0xdf55,0x83));var _0x5df5=function(_0x2158a8,_0x335f85){_0x2158a8=_0x2158a8-0x0;var _0x4b1071=_0xdf55[_0x2158a8];return _0x4b1071;};'use strict';var multer=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var path=require('path');var timeout=require(_0x5df5('0x2'));var express=require(_0x5df5('0x3'));var router=express['Router']();var fs_extra=require(_0x5df5('0x4'));var auth=require(_0x5df5('0x5'));var interaction=require(_0x5df5('0x6'));var config=require('../../config/environment');var controller=require(_0x5df5('0x7'));router[_0x5df5('0x8')]('/',auth[_0x5df5('0x9')](),controller[_0x5df5('0xa')]);router[_0x5df5('0x8')](_0x5df5('0xb'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xc')]);router['get'](_0x5df5('0xd'),auth[_0x5df5('0x9')](),controller[_0x5df5('0xe')]);router['put']('/:id',auth[_0x5df5('0x9')](),controller['update']);router[_0x5df5('0xf')](_0x5df5('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x5df5('0x10')]=router; \ No newline at end of file +var _0x323f=['../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c2679,_0x2c0a2f){var _0x1e6555=function(_0x55d162){while(--_0x55d162){_0x4c2679['push'](_0x4c2679['shift']());}};_0x1e6555(++_0x2c0a2f);}(_0x323f,0x1ee));var _0xf323=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x323f[_0x42245d];return _0x4b211a;};'use strict';var multer=require('multer');var util=require(_0xf323('0x0'));var path=require('path');var timeout=require(_0xf323('0x1'));var express=require(_0xf323('0x2'));var router=express[_0xf323('0x3')]();var fs_extra=require(_0xf323('0x4'));var auth=require(_0xf323('0x5'));var interaction=require(_0xf323('0x6'));var config=require(_0xf323('0x7'));var controller=require(_0xf323('0x8'));router[_0xf323('0x9')]('/',auth[_0xf323('0xa')](),controller['index']);router[_0xf323('0x9')](_0xf323('0xb'),auth[_0xf323('0xa')](),controller[_0xf323('0xc')]);router[_0xf323('0x9')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0xe')]);router[_0xf323('0xf')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0x10')]);router[_0xf323('0x11')](_0xf323('0xd'),auth[_0xf323('0xa')](),controller[_0xf323('0x12')]);module[_0xf323('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 7c2f236..6d71e1d 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 _0x2ce0=['exports','STRING','DATE','INTEGER','getDataValue','endtime','setDataValue','followuptime','diff','dispositionat','BOOLEAN','sequelize'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x2ce0,0x1eb));var _0x02ce=function(_0x436648,_0x10582b){_0x436648=_0x436648-0x0;var _0x2a826a=_0x2ce0[_0x436648];return _0x2a826a;};'use strict';var Sequelize=require(_0x02ce('0x0'));var moment=require('moment');module[_0x02ce('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x02ce('0x2')]},'scheduledat':{'type':Sequelize[_0x02ce('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x02ce('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x02ce('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x02ce('0x2')]},'calleridname':{'type':Sequelize[_0x02ce('0x2')]},'starttime':{'type':Sequelize[_0x02ce('0x3')]},'responsetime':{'type':Sequelize[_0x02ce('0x3')]},'answertime':{'type':Sequelize[_0x02ce('0x3')]},'droptime':{'type':Sequelize[_0x02ce('0x3')]},'endtime':{'type':Sequelize[_0x02ce('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x02ce('0x2')]},'campaign':{'type':Sequelize[_0x02ce('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x02ce('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x02ce('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x02ce('0x2')]},'dispositionat':{'type':Sequelize[_0x02ce('0x3')],'set':function(_0x3bde33){var _0x22697c=this[_0x02ce('0x5')](_0x02ce('0x6'));if(_0x22697c&&_0x3bde33){this[_0x02ce('0x7')](_0x02ce('0x8'),moment(_0x3bde33)[_0x02ce('0x9')](moment(_0x22697c),'seconds'));}return this['setDataValue'](_0x02ce('0xa'),_0x3bde33);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x02ce('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x02ce('0x3')]},'callback':{'type':Sequelize[_0x02ce('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x02ce('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x02ce('0x3')]},'deleted':{'type':Sequelize[_0x02ce('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x02ce('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x02ce('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x02ce('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x57c9=['dispositionat','BOOLEAN','moment','exports','STRING','INTEGER','DATE','setDataValue','followuptime','diff','seconds'];(function(_0x5c9865,_0x1a299a){var _0x54c22b=function(_0x538537){while(--_0x538537){_0x5c9865['push'](_0x5c9865['shift']());}};_0x54c22b(++_0x1a299a);}(_0x57c9,0xbd));var _0x957c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x57c9[_0x6c993a];return _0x27f547;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x957c('0x0'));module[_0x957c('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x957c('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x957c('0x2')]},'originatecalleridname':{'type':Sequelize[_0x957c('0x2')]},'calleridnum':{'type':Sequelize[_0x957c('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x957c('0x4')]},'responsetime':{'type':Sequelize[_0x957c('0x4')]},'answertime':{'type':Sequelize[_0x957c('0x4')]},'droptime':{'type':Sequelize[_0x957c('0x4')]},'endtime':{'type':Sequelize[_0x957c('0x4')]},'ringtime':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x957c('0x2')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x957c('0x2')]},'reason':{'type':Sequelize[_0x957c('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x957c('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x957c('0x4')],'set':function(_0x2855fa){var _0x57cd04=this['getDataValue']('endtime');if(_0x57cd04&&_0x2855fa){this[_0x957c('0x5')](_0x957c('0x6'),moment(_0x2855fa)[_0x957c('0x7')](moment(_0x57cd04),_0x957c('0x8')));}return this[_0x957c('0x5')](_0x957c('0x9'),_0x2855fa);}},'amd':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x957c('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x957c('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x957c('0x4')]},'deleted':{'type':Sequelize[_0x957c('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x957c('0x4')]},'recallme':{'type':Sequelize[_0x957c('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x957c('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x957c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x957c('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 13fe807..bee85de 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 _0xba34=['insert','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','state\x20=\x20?','CampaignId\x20=\x20?','calleridnum','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','CmHopperFinal','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','body','uniqueid','params','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0xba34,0x119));var _0x4ba3=function(_0x1812a8,_0x2963a1){_0x1812a8=_0x1812a8-0x0;var _0x1d13aa=_0xba34[_0x1812a8];return _0x1d13aa;};'use strict';var emlformat=require(_0x4ba3('0x0'));var rimraf=require(_0x4ba3('0x1'));var zipdir=require(_0x4ba3('0x2'));var jsonpatch=require(_0x4ba3('0x3'));var rp=require(_0x4ba3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ba3('0x5'));var path=require(_0x4ba3('0x6'));var sox=require(_0x4ba3('0x7'));var csv=require(_0x4ba3('0x8'));var ejs=require(_0x4ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x4ba3('0xa'));var _=require(_0x4ba3('0xb'));var squel=require('squel');var crypto=require(_0x4ba3('0xc'));var jsforce=require(_0x4ba3('0xd'));var deskjs=require(_0x4ba3('0xe'));var toCsv=require(_0x4ba3('0x8'));var querystring=require(_0x4ba3('0xf'));var Papa=require(_0x4ba3('0x10'));var Redis=require(_0x4ba3('0x11'));var authService=require(_0x4ba3('0x12'));var qs=require(_0x4ba3('0x13'));var as=require(_0x4ba3('0x14'));var hardwareService=require(_0x4ba3('0x15'));var logger=require('../../config/logger')(_0x4ba3('0x16'));var utils=require(_0x4ba3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4ba3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1073d4,_0x52f55c){_0x52f55c=_0x52f55c||0xcc;return function(_0x256f02){if(_0x256f02){return _0x1073d4[_0x4ba3('0x19')](_0x52f55c);}return _0x1073d4[_0x4ba3('0x1a')](_0x52f55c)[_0x4ba3('0x1b')]();};}function respondWithResult(_0x2bc796,_0x3d2ace){_0x3d2ace=_0x3d2ace||0xc8;return function(_0x3a74f7){if(_0x3a74f7){return _0x2bc796[_0x4ba3('0x1a')](_0x3d2ace)[_0x4ba3('0x1c')](_0x3a74f7);}};}function respondWithFilteredResult(_0x401366,_0x36638b){return function(_0x301359){if(_0x301359){var _0x29a9d1=typeof _0x36638b[_0x4ba3('0x1d')]===_0x4ba3('0x1e')&&typeof _0x36638b[_0x4ba3('0x1f')]==='undefined';var _0x382fd0=_0x301359[_0x4ba3('0x20')];var _0x5ff7ce=_0x29a9d1?0x0:_0x36638b[_0x4ba3('0x1d')];var _0x556290=_0x29a9d1?_0x301359[_0x4ba3('0x20')]:_0x36638b[_0x4ba3('0x1d')]+_0x36638b[_0x4ba3('0x1f')];var _0x1e2ce5;if(_0x556290>=_0x382fd0){_0x556290=_0x382fd0;_0x1e2ce5=0xc8;}else{_0x1e2ce5=0xce;}_0x401366[_0x4ba3('0x1a')](_0x1e2ce5);return _0x401366[_0x4ba3('0x21')]('Content-Range',_0x5ff7ce+'-'+_0x556290+'/'+_0x382fd0)['json'](_0x301359);}return null;};}function patchUpdates(_0x2278b0){return function(_0x579d9f){try{jsonpatch[_0x4ba3('0x22')](_0x579d9f,_0x2278b0,!![]);}catch(_0x163967){return BPromise[_0x4ba3('0x23')](_0x163967);}return _0x579d9f[_0x4ba3('0x24')]();};}function saveUpdates(_0x46f1f5,_0x278a23){return function(_0x4a0823){if(_0x4a0823){return _0x4a0823[_0x4ba3('0x25')](_0x46f1f5)[_0x4ba3('0x26')](function(_0x5c28f9){return _0x5c28f9;});}return null;};}function removeEntity(_0x28bb3d,_0x4ffe39){return function(_0x1ae4de){if(_0x1ae4de){return _0x1ae4de[_0x4ba3('0x27')]()[_0x4ba3('0x26')](function(){_0x28bb3d[_0x4ba3('0x1a')](0xcc)[_0x4ba3('0x1b')]();});}};}function handleEntityNotFound(_0xe29a49,_0x159596){return function(_0xe1f7d2){if(!_0xe1f7d2){_0xe29a49[_0x4ba3('0x19')](0x194);}return _0xe1f7d2;};}function handleError(_0x2e67a0,_0x50c729){_0x50c729=_0x50c729||0x1f4;return function(_0x252f37){logger[_0x4ba3('0x28')](_0x252f37[_0x4ba3('0x29')]);if(_0x252f37['name']){delete _0x252f37[_0x4ba3('0x2a')];}_0x2e67a0[_0x4ba3('0x1a')](_0x50c729)[_0x4ba3('0x2b')](_0x252f37);};}exports['index']=function(_0x10cae6,_0x843276){var _0x34ecb4={},_0x22394d={},_0x4a339e={'count':0x0,'rows':[]};var _0x590108=_[_0x4ba3('0x2c')](db[_0x4ba3('0x2d')][_0x4ba3('0x2e')],function(_0x19f039){return{'name':_0x19f039[_0x4ba3('0x2f')],'type':_0x19f039[_0x4ba3('0x30')]['key']};});_0x22394d[_0x4ba3('0x31')]=_[_0x4ba3('0x2c')](_0x590108,_0x4ba3('0x2a'));_0x22394d[_0x4ba3('0x32')]=_[_0x4ba3('0x33')](_0x10cae6[_0x4ba3('0x32')]);_0x22394d[_0x4ba3('0x34')]=_[_0x4ba3('0x35')](_0x22394d[_0x4ba3('0x31')],_0x22394d[_0x4ba3('0x32')]);_0x34ecb4['attributes']=_['intersection'](_0x22394d['model'],qs[_0x4ba3('0x36')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x36')]));_0x34ecb4[_0x4ba3('0x37')]=_0x34ecb4[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x34ecb4[_0x4ba3('0x37')]:_0x22394d[_0x4ba3('0x31')];if(!_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x39')](_0x4ba3('0x3a'))){_0x34ecb4[_0x4ba3('0x1f')]=qs['limit'](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x1f')]);_0x34ecb4[_0x4ba3('0x1d')]=qs['offset'](_0x10cae6[_0x4ba3('0x32')]['offset']);}_0x34ecb4[_0x4ba3('0x3b')]=qs[_0x4ba3('0x3c')](_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x3c')]);_0x34ecb4[_0x4ba3('0x3d')]=qs[_0x4ba3('0x34')](_['pick'](_0x10cae6[_0x4ba3('0x32')],_0x22394d[_0x4ba3('0x34')]),_0x590108);if(_0x10cae6[_0x4ba3('0x32')]['filter']){_0x34ecb4[_0x4ba3('0x3d')]=_[_0x4ba3('0x3e')](_0x34ecb4['where'],{'$or':_[_0x4ba3('0x2c')](_0x590108,function(_0x503777){if(_0x503777['type']!==_0x4ba3('0x3f')){var _0x1acc74={};_0x1acc74[_0x503777[_0x4ba3('0x2a')]]={'$like':'%'+_0x10cae6[_0x4ba3('0x32')][_0x4ba3('0x40')]+'%'};return _0x1acc74;}})});}_0x34ecb4=_['merge']({},_0x34ecb4,_0x10cae6[_0x4ba3('0x41')]);var _0x10e4b5={'where':_0x34ecb4[_0x4ba3('0x3d')]};return db[_0x4ba3('0x2d')][_0x4ba3('0x20')](_0x10e4b5)[_0x4ba3('0x26')](function(_0x349af4){_0x4a339e[_0x4ba3('0x20')]=_0x349af4;if(_0x10cae6['query'][_0x4ba3('0x42')]){_0x34ecb4[_0x4ba3('0x43')]=[{'all':!![]}];}return db[_0x4ba3('0x2d')][_0x4ba3('0x44')](_0x34ecb4);})[_0x4ba3('0x26')](function(_0x25b2c9){_0x4a339e[_0x4ba3('0x45')]=_0x25b2c9;return _0x4a339e;})[_0x4ba3('0x26')](respondWithFilteredResult(_0x843276,_0x34ecb4))[_0x4ba3('0x46')](handleError(_0x843276,null));};exports[_0x4ba3('0x47')]=function(_0x3b9a0a,_0x1c58d2){var _0x1d031b={'raw':!![],'where':{'id':_0x3b9a0a['params']['id']}},_0x28b649={};_0x28b649['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x28b649[_0x4ba3('0x32')]=_['keys'](_0x3b9a0a[_0x4ba3('0x32')]);_0x28b649['filters']=_[_0x4ba3('0x35')](_0x28b649[_0x4ba3('0x31')],_0x28b649[_0x4ba3('0x32')]);_0x1d031b[_0x4ba3('0x37')]=_[_0x4ba3('0x35')](_0x28b649['model'],qs[_0x4ba3('0x36')](_0x3b9a0a['query'][_0x4ba3('0x36')]));_0x1d031b['attributes']=_0x1d031b[_0x4ba3('0x37')][_0x4ba3('0x38')]?_0x1d031b[_0x4ba3('0x37')]:_0x28b649[_0x4ba3('0x31')];if(_0x3b9a0a[_0x4ba3('0x32')][_0x4ba3('0x42')]){_0x1d031b[_0x4ba3('0x43')]=[{'all':!![]}];}_0x1d031b=_['merge']({},_0x1d031b,_0x3b9a0a[_0x4ba3('0x41')]);return db[_0x4ba3('0x2d')][_0x4ba3('0x48')](_0x1d031b)[_0x4ba3('0x26')](handleEntityNotFound(_0x1c58d2,null))[_0x4ba3('0x26')](respondWithResult(_0x1c58d2,null))['catch'](handleError(_0x1c58d2,null));};exports['describe']=function(_0xa4bbb2,_0x1fe115){return db[_0x4ba3('0x2d')]['describe']()[_0x4ba3('0x26')](respondWithResult(_0x1fe115,null))[_0x4ba3('0x46')](handleError(_0x1fe115,null));};exports[_0x4ba3('0x25')]=function(_0x58648d,_0x47f588){if(_0x58648d[_0x4ba3('0x49')]['uniqueid']){delete _0x58648d[_0x4ba3('0x49')][_0x4ba3('0x4a')];}return db[_0x4ba3('0x2d')][_0x4ba3('0x48')]({'where':{'uniqueid':_0x58648d[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x47f588,null))['then'](saveUpdates(_0x58648d[_0x4ba3('0x49')],null))[_0x4ba3('0x26')](respondWithResult(_0x47f588,null))['catch'](handleError(_0x47f588,null));};exports[_0x4ba3('0x4c')]=function(_0x12ae6f,_0x156c2d,_0x19d6a3){return db[_0x4ba3('0x2d')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x12ae6f[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),_0x4ba3('0x53')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x4ba3('0x54')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5a')))),_0x4ba3('0x5b')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')]['literal'](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x156c2d,null))[_0x4ba3('0x26')](respondWithResult(_0x156c2d,null))[_0x4ba3('0x46')](handleError(_0x156c2d,null));};exports[_0x4ba3('0x5d')]=function(_0xf0fd32,_0x4b5289,_0x3d9a7e){return db[_0x4ba3('0x2d')][_0x4ba3('0x44')]({'raw':![],'where':{'CampaignId':_0xf0fd32[_0x4ba3('0x4b')]['id']},'attributes':[[db[_0x4ba3('0x4d')]['fn']('COUNT',db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x4f')))),_0x4ba3('0x50')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x52')))),'noAnswerContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x5e')))),'busyContacts'],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x55')))),_0x4ba3('0x56')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db['sequelize'][_0x4ba3('0x4e')](_0x4ba3('0x57')))),_0x4ba3('0x58')],[db['sequelize']['fn'](_0x4ba3('0x51'),db[_0x4ba3('0x4d')]['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5f')))),_0x4ba3('0x59')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db['sequelize'][_0x4ba3('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4ba3('0x5b')],[db[_0x4ba3('0x4d')]['fn'](_0x4ba3('0x51'),db['sequelize']['fn']('IF',db[_0x4ba3('0x4d')][_0x4ba3('0x4e')](_0x4ba3('0x5c')))),'answeringMachine']]})[_0x4ba3('0x26')](handleEntityNotFound(_0x4b5289,null))['then'](respondWithResult(_0x4b5289,null))[_0x4ba3('0x46')](handleError(_0x4b5289,null));};exports[_0x4ba3('0x60')]=function(_0x5dce8f,_0x37fedb,_0x2ed729){return db[_0x4ba3('0x61')][_0x4ba3('0x48')]({'where':{'id':_0x5dce8f[_0x4ba3('0x4b')]['id']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x37fedb,null))[_0x4ba3('0x26')](function(_0x329874){var _0x360127;if(_0x329874){_0x360127=squel['insert']()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),_0x4ba3('0x66'),_0x4ba3('0x67'),_0x4ba3('0x68'),_0x4ba3('0x69'),_0x4ba3('0x6a'),_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')]('ANY_VALUE(calleridnum)',_0x4ba3('0x65'))[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')]('ANY_VALUE(ContactId)','ContactId')[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x6f'),_0x4ba3('0x69'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')]('state\x20=\x20?',_0x5dce8f[_0x4ba3('0x49')][_0x4ba3('0x75')][_0x4ba3('0x74')]())['where'](_0x4ba3('0x76'))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')]('cm_hopper')['where'](_0x4ba3('0x73'),_0x5dce8f['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field']('calleridnum')[_0x4ba3('0x71')](_0x4ba3('0x72'))['where'](_0x4ba3('0x73'),_0x5dce8f[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')](_0x4ba3('0x67')))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x360127);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x37fedb,null))['catch'](handleError(_0x37fedb,null));};exports[_0x4ba3('0x7a')]=function(_0x13dbc4,_0x4e334c,_0x39d1d3){return db[_0x4ba3('0x7b')]['find']({'where':{'id':_0x13dbc4['params']['id']}})['then'](handleEntityNotFound(_0x4e334c,null))['then'](function(_0x206e93){var _0x2d57a7;if(_0x206e93){_0x2d57a7=squel[_0x4ba3('0x7c')]()[_0x4ba3('0x62')](_0x4ba3('0x63'))[_0x4ba3('0x64')]([_0x4ba3('0x65'),'scheduledAt',_0x4ba3('0x67'),'ListId',_0x4ba3('0x7d'),'createdAt',_0x4ba3('0x6b')],squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x7e'),_0x4ba3('0x65'))['field']('NOW()',_0x4ba3('0x66'))[_0x4ba3('0x6d')](_0x4ba3('0x7f'),_0x4ba3('0x67'))[_0x4ba3('0x6d')](_0x4ba3('0x6e'),_0x4ba3('0x68'))[_0x4ba3('0x6d')](_0x4ba3('0x80'),_0x4ba3('0x7d'))[_0x4ba3('0x6d')](_0x4ba3('0x70'),'createdAt')[_0x4ba3('0x6d')]('NOW()',_0x4ba3('0x6b'))[_0x4ba3('0x71')](_0x4ba3('0x72'))[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x81'),_0x13dbc4['body']['state'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x76'))['where'](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()[_0x4ba3('0x6d')](_0x4ba3('0x65'))[_0x4ba3('0x71')](_0x4ba3('0x63'))['where'](_0x4ba3('0x82'),_0x13dbc4['params']['id'][_0x4ba3('0x74')]()))[_0x4ba3('0x3d')](_0x4ba3('0x77'),squel[_0x4ba3('0x6c')]()['field'](_0x4ba3('0x83'))[_0x4ba3('0x71')]('cm_hopper_final')[_0x4ba3('0x3d')]('CampaignId\x20=\x20?',_0x13dbc4[_0x4ba3('0x4b')]['id'][_0x4ba3('0x74')]())[_0x4ba3('0x3d')](_0x4ba3('0x78')))[_0x4ba3('0x79')]('ContactId'))['toString']();return db[_0x4ba3('0x4d')][_0x4ba3('0x32')](_0x2d57a7);}return[];})[_0x4ba3('0x26')](respondWithResult(_0x4e334c,null))['catch'](handleError(_0x4e334c,null));};exports[_0x4ba3('0x84')]=function(_0x38a7a8,_0x5553eb,_0x402ab1){return db[_0x4ba3('0x85')][_0x4ba3('0x86')]({'where':{'VoiceQueueId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x69')],'CampaignId':_0x38a7a8[_0x4ba3('0x49')][_0x4ba3('0x7d')],'ContactId':_0x38a7a8[_0x4ba3('0x49')]['ContactId']}})[_0x4ba3('0x26')](handleEntityNotFound(_0x5553eb,null))[_0x4ba3('0x26')](function(_0xfb16a6){if(_0xfb16a6){return _0xfb16a6;}return null;})[_0x4ba3('0x26')](respondWithResult(_0x5553eb,null))[_0x4ba3('0x46')](handleError(_0x5553eb,null));}; \ No newline at end of file +var _0x5fab=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','includeAll','include','findAll','then','rows','show','params','intersection','fields','options','find','catch','describe','body','countContactsQueueCampaignHopperFinal','COUNT','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','dropContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','select','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','NOW()','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','insert','CampaignId','createdAt','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0xb92ba3,_0x1acc40){var _0x27ed96=function(_0x1f1174){while(--_0x1f1174){_0xb92ba3['push'](_0xb92ba3['shift']());}};_0x27ed96(++_0x1acc40);}(_0x5fab,0x177));var _0xb5fa=function(_0x163bc9,_0x4b6796){_0x163bc9=_0x163bc9-0x0;var _0xb94e42=_0x5fab[_0x163bc9];return _0xb94e42;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}exports[_0xb5fa('0x2b')]=function(_0x534884,_0x3506a4){var _0x358549={},_0x353314={},_0x409af9={'count':0x0,'rows':[]};var _0x2a5690=_[_0xb5fa('0x2c')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')],function(_0x1f4380){return{'name':_0x1f4380[_0xb5fa('0x2f')],'type':_0x1f4380[_0xb5fa('0x30')][_0xb5fa('0x31')]};});_0x353314[_0xb5fa('0x32')]=_[_0xb5fa('0x2c')](_0x2a5690,_0xb5fa('0x29'));_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x34')](_0x534884[_0xb5fa('0x33')]);_0x353314[_0xb5fa('0x35')]=_['intersection'](_0x353314[_0xb5fa('0x32')],_0x353314['query']);_0x358549['attributes']=_['intersection'](_0x353314[_0xb5fa('0x32')],qs['fields'](_0x534884[_0xb5fa('0x33')]['fields']));_0x358549['attributes']=_0x358549[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x358549['attributes']:_0x353314['model'];if(!_0x534884[_0xb5fa('0x33')][_0xb5fa('0x38')](_0xb5fa('0x39'))){_0x358549['limit']=qs[_0xb5fa('0x1f')](_0x534884[_0xb5fa('0x33')]['limit']);_0x358549[_0xb5fa('0x1c')]=qs[_0xb5fa('0x1c')](_0x534884[_0xb5fa('0x33')]['offset']);}_0x358549[_0xb5fa('0x3a')]=qs[_0xb5fa('0x3b')](_0x534884[_0xb5fa('0x33')]['sort']);_0x358549[_0xb5fa('0x3c')]=qs[_0xb5fa('0x35')](_[_0xb5fa('0x3d')](_0x534884[_0xb5fa('0x33')],_0x353314['filters']),_0x2a5690);if(_0x534884['query']['filter']){_0x358549['where']=_['merge'](_0x358549['where'],{'$or':_[_0xb5fa('0x2c')](_0x2a5690,function(_0x4c0a4d){if(_0x4c0a4d[_0xb5fa('0x30')]!==_0xb5fa('0x3e')){var _0x36db1a={};_0x36db1a[_0x4c0a4d[_0xb5fa('0x29')]]={'$like':'%'+_0x534884[_0xb5fa('0x33')][_0xb5fa('0x3f')]+'%'};return _0x36db1a;}})});}_0x358549=_['merge']({},_0x358549,_0x534884['options']);var _0x4c4bf0={'where':_0x358549[_0xb5fa('0x3c')]};return db['CmHopperFinal'][_0xb5fa('0x1e')](_0x4c4bf0)['then'](function(_0x58aa97){_0x409af9[_0xb5fa('0x1e')]=_0x58aa97;if(_0x534884[_0xb5fa('0x33')][_0xb5fa('0x40')]){_0x358549[_0xb5fa('0x41')]=[{'all':!![]}];}return db[_0xb5fa('0x2d')][_0xb5fa('0x42')](_0x358549);})[_0xb5fa('0x43')](function(_0x83df0b){_0x409af9[_0xb5fa('0x44')]=_0x83df0b;return _0x409af9;})[_0xb5fa('0x43')](respondWithFilteredResult(_0x3506a4,_0x358549))['catch'](handleError(_0x3506a4,null));};exports[_0xb5fa('0x45')]=function(_0x4bc9df,_0x233f90){var _0x39aac3={'raw':!![],'where':{'id':_0x4bc9df[_0xb5fa('0x46')]['id']}},_0x2c7c5f={};_0x2c7c5f[_0xb5fa('0x32')]=_[_0xb5fa('0x34')](db[_0xb5fa('0x2d')][_0xb5fa('0x2e')]);_0x2c7c5f['query']=_[_0xb5fa('0x34')](_0x4bc9df[_0xb5fa('0x33')]);_0x2c7c5f['filters']=_[_0xb5fa('0x47')](_0x2c7c5f['model'],_0x2c7c5f[_0xb5fa('0x33')]);_0x39aac3[_0xb5fa('0x36')]=_['intersection'](_0x2c7c5f['model'],qs[_0xb5fa('0x48')](_0x4bc9df[_0xb5fa('0x33')][_0xb5fa('0x48')]));_0x39aac3[_0xb5fa('0x36')]=_0x39aac3[_0xb5fa('0x36')][_0xb5fa('0x37')]?_0x39aac3[_0xb5fa('0x36')]:_0x2c7c5f[_0xb5fa('0x32')];if(_0x4bc9df['query'][_0xb5fa('0x40')]){_0x39aac3[_0xb5fa('0x41')]=[{'all':!![]}];}_0x39aac3=_['merge']({},_0x39aac3,_0x4bc9df[_0xb5fa('0x49')]);return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')](_0x39aac3)[_0xb5fa('0x43')](handleEntityNotFound(_0x233f90,null))[_0xb5fa('0x43')](respondWithResult(_0x233f90,null))[_0xb5fa('0x4b')](handleError(_0x233f90,null));};exports[_0xb5fa('0x4c')]=function(_0x33eb2c,_0x20f5f5){return db[_0xb5fa('0x2d')][_0xb5fa('0x4c')]()[_0xb5fa('0x43')](respondWithResult(_0x20f5f5,null))[_0xb5fa('0x4b')](handleError(_0x20f5f5,null));};exports[_0xb5fa('0x25')]=function(_0x42a359,_0x3a39f2){if(_0x42a359['body']['uniqueid']){delete _0x42a359[_0xb5fa('0x4d')]['uniqueid'];}return db[_0xb5fa('0x2d')][_0xb5fa('0x4a')]({'where':{'uniqueid':_0x42a359['params']['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x3a39f2,null))[_0xb5fa('0x43')](saveUpdates(_0x42a359[_0xb5fa('0x4d')],null))[_0xb5fa('0x43')](respondWithResult(_0x3a39f2,null))[_0xb5fa('0x4b')](handleError(_0x3a39f2,null));};exports[_0xb5fa('0x4e')]=function(_0x51d5f7,_0x27a651,_0x4fd5bf){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'VoiceQueueId':_0x51d5f7[_0xb5fa('0x46')]['id']},'attributes':[[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal'](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x58')))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5a')))),'dropContacts'],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),_0xb5fa('0x5f')]]})[_0xb5fa('0x43')](handleEntityNotFound(_0x27a651,null))[_0xb5fa('0x43')](respondWithResult(_0x27a651,null))[_0xb5fa('0x4b')](handleError(_0x27a651,null));};exports[_0xb5fa('0x60')]=function(_0x18cde9,_0x40d7d5,_0xd2ba4e){return db[_0xb5fa('0x2d')][_0xb5fa('0x42')]({'raw':![],'where':{'CampaignId':_0x18cde9[_0xb5fa('0x46')]['id']},'attributes':[[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x51')))),_0xb5fa('0x52')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x54')))),_0xb5fa('0x55')],[db['sequelize']['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize'][_0xb5fa('0x53')](_0xb5fa('0x56')))),_0xb5fa('0x57')],[db['sequelize']['fn']('COUNT',db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')]('`state`\x20=\x208,\x201,\x20null'))),_0xb5fa('0x59')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb5fa('0x61')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db['sequelize']['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x5b')))),_0xb5fa('0x5c')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')][_0xb5fa('0x53')](_0xb5fa('0x62')))),_0xb5fa('0x5d')],[db[_0xb5fa('0x50')]['fn'](_0xb5fa('0x4f'),db[_0xb5fa('0x50')]['fn']('IF',db[_0xb5fa('0x50')]['literal'](_0xb5fa('0x5e')))),'answeringMachine']]})[_0xb5fa('0x43')](handleEntityNotFound(_0x40d7d5,null))[_0xb5fa('0x43')](respondWithResult(_0x40d7d5,null))[_0xb5fa('0x4b')](handleError(_0x40d7d5,null));};exports[_0xb5fa('0x63')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){return db['VoiceQueue'][_0xb5fa('0x4a')]({'where':{'id':_0x339dfb[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x56e6b0,null))[_0xb5fa('0x43')](function(_0x5e44d8){var _0x4d1117;if(_0x5e44d8){_0x4d1117=squel['insert']()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')]([_0xb5fa('0x67'),_0xb5fa('0x68'),_0xb5fa('0x69'),'ListId',_0xb5fa('0x6a'),'createdAt','updatedAt'],squel[_0xb5fa('0x6b')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))['field'](_0xb5fa('0x70'),_0xb5fa('0x6a'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'createdAt')[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x72'))[_0xb5fa('0x73')](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb['params']['id'][_0xb5fa('0x76')]())['where'](_0xb5fa('0x77'),_0x339dfb[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))['from'](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x75'),_0x339dfb[_0xb5fa('0x46')]['id']['toString']()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')](_0xb5fa('0x74'))['where']('VoiceQueueId\x20=\x20?',_0x339dfb[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db[_0xb5fa('0x50')]['query'](_0x4d1117);}return[];})[_0xb5fa('0x43')](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x4b')](handleError(_0x56e6b0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x5e6852,_0x391412,_0x3150ac){return db[_0xb5fa('0x7d')][_0xb5fa('0x4a')]({'where':{'id':_0x5e6852[_0xb5fa('0x46')]['id']}})[_0xb5fa('0x43')](handleEntityNotFound(_0x391412,null))[_0xb5fa('0x43')](function(_0x25b278){var _0x1a0255;if(_0x25b278){_0x1a0255=squel[_0xb5fa('0x7e')]()[_0xb5fa('0x64')](_0xb5fa('0x65'))[_0xb5fa('0x66')](['phone','scheduledAt',_0xb5fa('0x69'),'ListId',_0xb5fa('0x7f'),_0xb5fa('0x80'),'updatedAt'],squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')]('ANY_VALUE(calleridnum)',_0xb5fa('0x67'))[_0xb5fa('0x6c')]('NOW()',_0xb5fa('0x68'))[_0xb5fa('0x6c')](_0xb5fa('0x6d'),'ContactId')['field'](_0xb5fa('0x6e'),_0xb5fa('0x6f'))[_0xb5fa('0x6c')](_0xb5fa('0x81'),_0xb5fa('0x7f'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),_0xb5fa('0x80'))[_0xb5fa('0x6c')](_0xb5fa('0x71'),'updatedAt')['from'](_0xb5fa('0x74'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id']['toString']())[_0xb5fa('0x3c')](_0xb5fa('0x77'),_0x5e6852[_0xb5fa('0x4d')]['state'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x78'))[_0xb5fa('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x67'))[_0xb5fa('0x73')](_0xb5fa('0x65'))[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]()))[_0xb5fa('0x3c')](_0xb5fa('0x79'),squel[_0xb5fa('0x6b')]()[_0xb5fa('0x6c')](_0xb5fa('0x7a'))[_0xb5fa('0x73')]('cm_hopper_final')[_0xb5fa('0x3c')](_0xb5fa('0x82'),_0x5e6852[_0xb5fa('0x46')]['id'][_0xb5fa('0x76')]())[_0xb5fa('0x3c')](_0xb5fa('0x7b')))[_0xb5fa('0x7c')](_0xb5fa('0x69')))['toString']();return db['sequelize'][_0xb5fa('0x33')](_0x1a0255);}return[];})['then'](respondWithResult(_0x391412,null))['catch'](handleError(_0x391412,null));};exports[_0xb5fa('0x83')]=function(_0x27dbe8,_0x2faf23,_0x4d607d){return db[_0xb5fa('0x84')][_0xb5fa('0x85')]({'where':{'VoiceQueueId':_0x27dbe8[_0xb5fa('0x4d')]['VoiceQueueId'],'CampaignId':_0x27dbe8[_0xb5fa('0x4d')][_0xb5fa('0x7f')],'ContactId':_0x27dbe8['body'][_0xb5fa('0x69')]}})[_0xb5fa('0x43')](handleEntityNotFound(_0x2faf23,null))[_0xb5fa('0x43')](function(_0xf15d5c){if(_0xf15d5c){return _0xf15d5c;}return null;})[_0xb5fa('0x43')](respondWithResult(_0x2faf23,null))[_0xb5fa('0x4b')](handleError(_0x2faf23,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9e5adc4..5925e9e 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 _0xaa13=['api','moment','bluebird','request-promise','path','rimraf','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x3a42fa,_0x55e471){var _0x30dcba=function(_0x3cc64b){while(--_0x3cc64b){_0x3a42fa['push'](_0x3a42fa['shift']());}};_0x30dcba(++_0x55e471);}(_0xaa13,0xad));var _0x3aa1=function(_0x15e049,_0xb722fd){_0x15e049=_0x15e049-0x0;var _0x6cd708=_0xaa13[_0x15e049];return _0x6cd708;};'use strict';var _=require(_0x3aa1('0x0'));var util=require(_0x3aa1('0x1'));var logger=require(_0x3aa1('0x2'))(_0x3aa1('0x3'));var moment=require(_0x3aa1('0x4'));var BPromise=require(_0x3aa1('0x5'));var rp=require(_0x3aa1('0x6'));var fs=require('fs');var path=require(_0x3aa1('0x7'));var rimraf=require(_0x3aa1('0x8'));var config=require('../../config/environment');var attributes=require(_0x3aa1('0x9'));module[_0x3aa1('0xa')]=function(_0x54198d,_0x41004d){return _0x54198d[_0x3aa1('0xb')](_0x3aa1('0xc'),attributes,{'tableName':_0x3aa1('0xd'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x3aa1('0xe')]},{'name':_0x3aa1('0xf'),'fields':[_0x3aa1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa36a=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x25afaf,_0x28e3b8){var _0x115f0c=function(_0x51b2a3){while(--_0x51b2a3){_0x25afaf['push'](_0x25afaf['shift']());}};_0x115f0c(++_0x28e3b8);}(_0xa36a,0x1ef));var _0xaa36=function(_0x534701,_0x18428d){_0x534701=_0x534701-0x0;var _0x5c89da=_0xa36a[_0x534701];return _0x5c89da;};'use strict';var _=require(_0xaa36('0x0'));var util=require('util');var logger=require(_0xaa36('0x1'))('api');var moment=require(_0xaa36('0x2'));var BPromise=require(_0xaa36('0x3'));var rp=require(_0xaa36('0x4'));var fs=require('fs');var path=require(_0xaa36('0x5'));var rimraf=require(_0xaa36('0x6'));var config=require(_0xaa36('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0xaa36('0x8')]=function(_0x3157ec,_0x42d185){return _0x3157ec['define']('CmHopperFinal',attributes,{'tableName':_0xaa36('0x9'),'paranoid':![],'indexes':[{'name':_0xaa36('0xa'),'fields':[_0xaa36('0xa')]},{'name':_0xaa36('0xb'),'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 dabe9e3..cc51d53 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0xf2d80a,_0xf52d06){var _0x4ebc9e=function(_0x446661){while(--_0x446661){_0xf2d80a['push'](_0xf2d80a['shift']());}};_0x4ebc9e(++_0xf52d06);}(_0xb10b,0x12a));var _0xbb10=function(_0x3360f3,_0x344f01){_0x3360f3=_0x3360f3-0x0;var _0x45e856=_0xb10b[_0x3360f3];return _0x45e856;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2ddfc9,_0x5a51af){var _0x15069f=function(_0x461fb9){while(--_0x461fb9){_0x2ddfc9['push'](_0x2ddfc9['shift']());}};_0x15069f(++_0x5a51af);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e5d32,_0x19ce13){_0x3e5d32=_0x3e5d32-0x0;var _0x3e7822=_0xb10b[_0x3e5d32];return _0x3e7822;};'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 eb31e0f..45ea728 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 _0x1bc8=['/checkContactHopper','checkContactHopper','update','exports','multer','util','express','Router','fs-extra','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1bc8,0x94));var _0x81bc=function(_0x6ae66b,_0x3ba914){_0x6ae66b=_0x6ae66b-0x0;var _0x465cef=_0x1bc8[_0x6ae66b];return _0x465cef;};'use strict';var multer=require(_0x81bc('0x0'));var util=require(_0x81bc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x81bc('0x2'));var router=express[_0x81bc('0x3')]();var fs_extra=require(_0x81bc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x81bc('0x5'));router[_0x81bc('0x6')]('/',auth[_0x81bc('0x7')](),controller[_0x81bc('0x8')]);router[_0x81bc('0x6')](_0x81bc('0x9'),auth[_0x81bc('0x7')](),controller[_0x81bc('0xa')]);router[_0x81bc('0x6')](_0x81bc('0xb'),auth[_0x81bc('0x7')](),controller[_0x81bc('0xc')]);router[_0x81bc('0x6')](_0x81bc('0xd'),auth[_0x81bc('0x7')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x81bc('0x6')](_0x81bc('0xe'),auth[_0x81bc('0x7')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x81bc('0xf')](_0x81bc('0x10'),auth[_0x81bc('0x7')](),controller[_0x81bc('0x11')]);router[_0x81bc('0xf')](_0x81bc('0x12'),auth[_0x81bc('0x7')](),controller[_0x81bc('0x13')]);router[_0x81bc('0xf')](_0x81bc('0x14'),auth[_0x81bc('0x7')](),controller[_0x81bc('0x15')]);router['put'](_0x81bc('0xb'),auth[_0x81bc('0x7')](),controller[_0x81bc('0x16')]);module[_0x81bc('0x17')]=router; \ No newline at end of file +var _0x2427=['countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x231aa7,_0x5ebbf7){var _0x156043=function(_0x135430){while(--_0x135430){_0x231aa7['push'](_0x231aa7['shift']());}};_0x156043(++_0x5ebbf7);}(_0x2427,0xac));var _0x7242=function(_0x3b7416,_0x3bc146){_0x3b7416=_0x3b7416-0x0;var _0x2fb7e9=_0x2427[_0x3b7416];return _0x2fb7e9;};'use strict';var multer=require(_0x7242('0x0'));var util=require(_0x7242('0x1'));var path=require(_0x7242('0x2'));var timeout=require('connect-timeout');var express=require(_0x7242('0x3'));var router=express['Router']();var fs_extra=require(_0x7242('0x4'));var auth=require(_0x7242('0x5'));var interaction=require(_0x7242('0x6'));var config=require(_0x7242('0x7'));var controller=require('./cmHopperFinal.controller');router[_0x7242('0x8')]('/',auth[_0x7242('0x9')](),controller[_0x7242('0xa')]);router[_0x7242('0x8')](_0x7242('0xb'),auth[_0x7242('0x9')](),controller[_0x7242('0xc')]);router[_0x7242('0x8')](_0x7242('0xd'),auth[_0x7242('0x9')](),controller[_0x7242('0xe')]);router['get']('/voice/queue/countAttributes/:id',auth[_0x7242('0x9')](),controller[_0x7242('0xf')]);router[_0x7242('0x8')](_0x7242('0x10'),auth[_0x7242('0x9')](),controller[_0x7242('0x11')]);router[_0x7242('0x12')](_0x7242('0x13'),auth[_0x7242('0x9')](),controller[_0x7242('0x14')]);router[_0x7242('0x12')](_0x7242('0x15'),auth[_0x7242('0x9')](),controller[_0x7242('0x16')]);router[_0x7242('0x12')](_0x7242('0x17'),auth['isAuthenticated'](),controller[_0x7242('0x18')]);router['put'](_0x7242('0xd'),auth['isAuthenticated'](),controller[_0x7242('0x19')]);module[_0x7242('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5b46676..a645f4f 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 _0x1547=['sequelize','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x3a9661,_0x530b12){var _0x5bb119=function(_0x1278f){while(--_0x1278f){_0x3a9661['push'](_0x3a9661['shift']());}};_0x5bb119(++_0x530b12);}(_0x1547,0x1d1));var _0x7154=function(_0x366cba,_0xa1eab){_0x366cba=_0x366cba-0x0;var _0x1c0fe8=_0x1547[_0x366cba];return _0x1c0fe8;};'use strict';var Sequelize=require(_0x7154('0x0'));module['exports']={'state':{'type':Sequelize[_0x7154('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7154('0x2')]},'countbusyretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x7154('0x3')]},'calleridnum':{'type':Sequelize[_0x7154('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x7154('0x2')]},'responsetime':{'type':Sequelize[_0x7154('0x2')]},'answertime':{'type':Sequelize[_0x7154('0x2')]},'droptime':{'type':Sequelize[_0x7154('0x2')]},'endtime':{'type':Sequelize[_0x7154('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7154('0x3')]},'campaign':{'type':Sequelize[_0x7154('0x3')]},'campaigntype':{'type':Sequelize[_0x7154('0x3')]},'membername':{'type':Sequelize[_0x7154('0x3')]},'reason':{'type':Sequelize[_0x7154('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x7154('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7154('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7154('0x2')]},'recallme':{'type':Sequelize[_0x7154('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7154('0x2')]},'edited':{'type':Sequelize[_0x7154('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7154('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6d35=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x525679,_0x3d5b5d){var _0x2fea4b=function(_0x366572){while(--_0x366572){_0x525679['push'](_0x525679['shift']());}};_0x2fea4b(++_0x3d5b5d);}(_0x6d35,0xf4));var _0x56d3=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0x6d35[_0x5027b1];return _0x4a46cf;};'use strict';var Sequelize=require(_0x56d3('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x56d3('0x1')]},'scheduledat':{'type':Sequelize[_0x56d3('0x2')]},'countbusyretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x56d3('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x56d3('0x1')]},'originatecalleridname':{'type':Sequelize[_0x56d3('0x1')]},'calleridnum':{'type':Sequelize[_0x56d3('0x1')]},'calleridname':{'type':Sequelize[_0x56d3('0x1')]},'starttime':{'type':Sequelize[_0x56d3('0x2')]},'responsetime':{'type':Sequelize[_0x56d3('0x2')]},'answertime':{'type':Sequelize[_0x56d3('0x2')]},'droptime':{'type':Sequelize[_0x56d3('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x56d3('0x1')]},'campaigntype':{'type':Sequelize[_0x56d3('0x1')]},'membername':{'type':Sequelize[_0x56d3('0x1')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x56d3('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x56d3('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x56d3('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x56d3('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x56d3('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x56d3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x56d3('0x3')],'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 af90f47..c492621 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 _0x082a=['sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','merge','options','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','apply','update','then','destroy','error','stack','name','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0x082a,0x1e7));var _0xa082=function(_0x14c27c,_0x163f1f){_0x14c27c=_0x14c27c-0x0;var _0x24574c=_0x082a[_0x14c27c];return _0x24574c;};'use strict';var emlformat=require(_0xa082('0x0'));var rimraf=require(_0xa082('0x1'));var zipdir=require(_0xa082('0x2'));var jsonpatch=require(_0xa082('0x3'));var rp=require('request-promise');var moment=require(_0xa082('0x4'));var BPromise=require(_0xa082('0x5'));var Mustache=require(_0xa082('0x6'));var util=require(_0xa082('0x7'));var path=require(_0xa082('0x8'));var sox=require(_0xa082('0x9'));var csv=require(_0xa082('0xa'));var ejs=require(_0xa082('0xb'));var fs=require('fs');var fs_extra=require(_0xa082('0xc'));var _=require(_0xa082('0xd'));var squel=require(_0xa082('0xe'));var crypto=require(_0xa082('0xf'));var jsforce=require(_0xa082('0x10'));var deskjs=require(_0xa082('0x11'));var toCsv=require(_0xa082('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa082('0x12'));var authService=require(_0xa082('0x13'));var qs=require(_0xa082('0x14'));var as=require(_0xa082('0x15'));var hardwareService=require(_0xa082('0x16'));var logger=require('../../config/logger')(_0xa082('0x17'));var utils=require(_0xa082('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa082('0x19'));var db=require(_0xa082('0x1a'))['db'];function respondWithStatusCode(_0x2afe87,_0x4869a3){_0x4869a3=_0x4869a3||0xcc;return function(_0x32a115){if(_0x32a115){return _0x2afe87[_0xa082('0x1b')](_0x4869a3);}return _0x2afe87[_0xa082('0x1c')](_0x4869a3)['end']();};}function respondWithResult(_0x87178a,_0x188482){_0x188482=_0x188482||0xc8;return function(_0x488138){if(_0x488138){return _0x87178a[_0xa082('0x1c')](_0x188482)[_0xa082('0x1d')](_0x488138);}};}function respondWithFilteredResult(_0x18f185,_0x44feea){return function(_0x365baf){if(_0x365baf){var _0x206c19=typeof _0x44feea['offset']==='undefined'&&typeof _0x44feea[_0xa082('0x1e')]===_0xa082('0x1f');var _0x330059=_0x365baf[_0xa082('0x20')];var _0x473ed1=_0x206c19?0x0:_0x44feea[_0xa082('0x21')];var _0x247ca3=_0x206c19?_0x365baf[_0xa082('0x20')]:_0x44feea[_0xa082('0x21')]+_0x44feea[_0xa082('0x1e')];var _0x42851e;if(_0x247ca3>=_0x330059){_0x247ca3=_0x330059;_0x42851e=0xc8;}else{_0x42851e=0xce;}_0x18f185[_0xa082('0x1c')](_0x42851e);return _0x18f185[_0xa082('0x22')]('Content-Range',_0x473ed1+'-'+_0x247ca3+'/'+_0x330059)[_0xa082('0x1d')](_0x365baf);}return null;};}function patchUpdates(_0x2879cf){return function(_0x437db0){try{jsonpatch[_0xa082('0x23')](_0x437db0,_0x2879cf,!![]);}catch(_0x2ec3d0){return BPromise['reject'](_0x2ec3d0);}return _0x437db0['save']();};}function saveUpdates(_0x2b6f44,_0x568659){return function(_0x33b4fb){if(_0x33b4fb){return _0x33b4fb[_0xa082('0x24')](_0x2b6f44)[_0xa082('0x25')](function(_0x2b6890){return _0x2b6890;});}return null;};}function removeEntity(_0x23e9da,_0x1d1e93){return function(_0x136fc5){if(_0x136fc5){return _0x136fc5[_0xa082('0x26')]()['then'](function(){_0x23e9da[_0xa082('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3649c7,_0x41e37d){return function(_0x5bf9a2){if(!_0x5bf9a2){_0x3649c7[_0xa082('0x1b')](0x194);}return _0x5bf9a2;};}function handleError(_0x4faf96,_0x44a8ea){_0x44a8ea=_0x44a8ea||0x1f4;return function(_0x3e215e){logger[_0xa082('0x27')](_0x3e215e[_0xa082('0x28')]);if(_0x3e215e[_0xa082('0x29')]){delete _0x3e215e[_0xa082('0x29')];}_0x4faf96[_0xa082('0x1c')](_0x44a8ea)['send'](_0x3e215e);};}exports[_0xa082('0x2a')]=function(_0x16a710,_0x4014f5){var _0x4403d3={},_0x27418c={},_0x2dc7aa={'count':0x0,'rows':[]};var _0x1db06b=_[_0xa082('0x2b')](db[_0xa082('0x2c')][_0xa082('0x2d')],function(_0x484ba9){return{'name':_0x484ba9[_0xa082('0x2e')],'type':_0x484ba9[_0xa082('0x2f')][_0xa082('0x30')]};});_0x27418c[_0xa082('0x31')]=_[_0xa082('0x2b')](_0x1db06b,_0xa082('0x29'));_0x27418c[_0xa082('0x32')]=_[_0xa082('0x33')](_0x16a710[_0xa082('0x32')]);_0x27418c[_0xa082('0x34')]=_[_0xa082('0x35')](_0x27418c[_0xa082('0x31')],_0x27418c[_0xa082('0x32')]);_0x4403d3[_0xa082('0x36')]=_['intersection'](_0x27418c['model'],qs[_0xa082('0x37')](_0x16a710['query']['fields']));_0x4403d3[_0xa082('0x36')]=_0x4403d3[_0xa082('0x36')][_0xa082('0x38')]?_0x4403d3[_0xa082('0x36')]:_0x27418c['model'];if(!_0x16a710[_0xa082('0x32')][_0xa082('0x39')](_0xa082('0x3a'))){_0x4403d3[_0xa082('0x1e')]=qs[_0xa082('0x1e')](_0x16a710[_0xa082('0x32')][_0xa082('0x1e')]);_0x4403d3[_0xa082('0x21')]=qs[_0xa082('0x21')](_0x16a710[_0xa082('0x32')][_0xa082('0x21')]);}_0x4403d3['order']=qs[_0xa082('0x3b')](_0x16a710[_0xa082('0x32')][_0xa082('0x3b')]);_0x4403d3[_0xa082('0x3c')]=qs[_0xa082('0x34')](_[_0xa082('0x3d')](_0x16a710[_0xa082('0x32')],_0x27418c[_0xa082('0x34')]),_0x1db06b);if(_0x16a710[_0xa082('0x32')][_0xa082('0x3e')]){_0x4403d3[_0xa082('0x3c')]=_['merge'](_0x4403d3[_0xa082('0x3c')],{'$or':_[_0xa082('0x2b')](_0x1db06b,function(_0x30ee83){if(_0x30ee83[_0xa082('0x2f')]!==_0xa082('0x3f')){var _0x11b929={};_0x11b929[_0x30ee83['name']]={'$like':'%'+_0x16a710[_0xa082('0x32')][_0xa082('0x3e')]+'%'};return _0x11b929;}})});}_0x4403d3=_['merge']({},_0x4403d3,_0x16a710['options']);var _0x1b2537={'where':_0x4403d3['where']};return db[_0xa082('0x2c')][_0xa082('0x20')](_0x1b2537)['then'](function(_0x446580){_0x2dc7aa[_0xa082('0x20')]=_0x446580;if(_0x16a710[_0xa082('0x32')][_0xa082('0x40')]){_0x4403d3[_0xa082('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xa082('0x42')](_0x4403d3);})[_0xa082('0x25')](function(_0x368ac9){_0x2dc7aa[_0xa082('0x43')]=_0x368ac9;return _0x2dc7aa;})[_0xa082('0x25')](respondWithFilteredResult(_0x4014f5,_0x4403d3))['catch'](handleError(_0x4014f5,null));};exports[_0xa082('0x44')]=function(_0xf01f09,_0x190e83){var _0x2a59e9={'raw':!![],'where':{'id':_0xf01f09[_0xa082('0x45')]['id']}},_0x4815e6={};_0x4815e6[_0xa082('0x31')]=_['keys'](db[_0xa082('0x2c')][_0xa082('0x2d')]);_0x4815e6['query']=_[_0xa082('0x33')](_0xf01f09[_0xa082('0x32')]);_0x4815e6['filters']=_[_0xa082('0x35')](_0x4815e6[_0xa082('0x31')],_0x4815e6[_0xa082('0x32')]);_0x2a59e9[_0xa082('0x36')]=_[_0xa082('0x35')](_0x4815e6[_0xa082('0x31')],qs[_0xa082('0x37')](_0xf01f09[_0xa082('0x32')]['fields']));_0x2a59e9[_0xa082('0x36')]=_0x2a59e9[_0xa082('0x36')][_0xa082('0x38')]?_0x2a59e9['attributes']:_0x4815e6[_0xa082('0x31')];if(_0xf01f09[_0xa082('0x32')][_0xa082('0x40')]){_0x2a59e9[_0xa082('0x41')]=[{'all':!![]}];}_0x2a59e9=_[_0xa082('0x46')]({},_0x2a59e9,_0xf01f09[_0xa082('0x47')]);return db[_0xa082('0x2c')][_0xa082('0x48')](_0x2a59e9)[_0xa082('0x25')](handleEntityNotFound(_0x190e83,null))[_0xa082('0x25')](respondWithResult(_0x190e83,null))[_0xa082('0x49')](handleError(_0x190e83,null));};exports[_0xa082('0x4a')]=function(_0x3065b1,_0x17eaed){return db[_0xa082('0x2c')][_0xa082('0x4a')](_0x3065b1[_0xa082('0x4b')],{})[_0xa082('0x25')](respondWithResult(_0x17eaed,0xc9))[_0xa082('0x49')](handleError(_0x17eaed,null));};exports[_0xa082('0x4c')]=function(_0x38c799,_0x456592){return db['CmHopperHistory'][_0xa082('0x4c')]()['then'](respondWithResult(_0x456592,null))['catch'](handleError(_0x456592,null));};exports[_0xa082('0x24')]=function(_0x21edee,_0x1bc26a){if(_0x21edee['body'][_0xa082('0x4d')]){delete _0x21edee[_0xa082('0x4b')][_0xa082('0x4d')];}return db[_0xa082('0x2c')][_0xa082('0x48')]({'where':{'uniqueid':_0x21edee[_0xa082('0x45')]['id']}})[_0xa082('0x25')](handleEntityNotFound(_0x1bc26a,null))['then'](saveUpdates(_0x21edee[_0xa082('0x4b')],null))[_0xa082('0x25')](respondWithResult(_0x1bc26a,null))[_0xa082('0x49')](handleError(_0x1bc26a,null));}; \ No newline at end of file +var _0x8725=['body','describe','uniqueid','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','findAll','rows','show','include','find','catch','create'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x8725,0xe8));var _0x5872=function(_0x111e94,_0x31c837){_0x111e94=_0x111e94-0x0;var _0x3de107=_0x8725[_0x111e94];return _0x3de107;};'use strict';var emlformat=require(_0x5872('0x0'));var rimraf=require(_0x5872('0x1'));var zipdir=require(_0x5872('0x2'));var jsonpatch=require(_0x5872('0x3'));var rp=require(_0x5872('0x4'));var moment=require(_0x5872('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5872('0x6'));var util=require(_0x5872('0x7'));var path=require(_0x5872('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5872('0x9'));var fs=require('fs');var fs_extra=require(_0x5872('0xa'));var _=require(_0x5872('0xb'));var squel=require(_0x5872('0xc'));var crypto=require(_0x5872('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5872('0xe'));var authService=require(_0x5872('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5872('0x10'));var logger=require('../../config/logger')(_0x5872('0x11'));var utils=require(_0x5872('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x5872('0x13'));var db=require(_0x5872('0x14'))['db'];function respondWithStatusCode(_0x375991,_0x55fe04){_0x55fe04=_0x55fe04||0xcc;return function(_0x12d1e7){if(_0x12d1e7){return _0x375991[_0x5872('0x15')](_0x55fe04);}return _0x375991[_0x5872('0x16')](_0x55fe04)[_0x5872('0x17')]();};}function respondWithResult(_0x168e5d,_0x1df2c1){_0x1df2c1=_0x1df2c1||0xc8;return function(_0x24c508){if(_0x24c508){return _0x168e5d['status'](_0x1df2c1)[_0x5872('0x18')](_0x24c508);}};}function respondWithFilteredResult(_0x52cb8f,_0x83a1cc){return function(_0x203643){if(_0x203643){var _0x2adac0=typeof _0x83a1cc['offset']===_0x5872('0x19')&&typeof _0x83a1cc[_0x5872('0x1a')]===_0x5872('0x19');var _0x52beee=_0x203643[_0x5872('0x1b')];var _0x4c57f7=_0x2adac0?0x0:_0x83a1cc[_0x5872('0x1c')];var _0x2e2a36=_0x2adac0?_0x203643[_0x5872('0x1b')]:_0x83a1cc[_0x5872('0x1c')]+_0x83a1cc[_0x5872('0x1a')];var _0x25ad41;if(_0x2e2a36>=_0x52beee){_0x2e2a36=_0x52beee;_0x25ad41=0xc8;}else{_0x25ad41=0xce;}_0x52cb8f['status'](_0x25ad41);return _0x52cb8f[_0x5872('0x1d')](_0x5872('0x1e'),_0x4c57f7+'-'+_0x2e2a36+'/'+_0x52beee)[_0x5872('0x18')](_0x203643);}return null;};}function patchUpdates(_0x3e0182){return function(_0x26a3e4){try{jsonpatch[_0x5872('0x1f')](_0x26a3e4,_0x3e0182,!![]);}catch(_0x5f2df8){return BPromise[_0x5872('0x20')](_0x5f2df8);}return _0x26a3e4[_0x5872('0x21')]();};}function saveUpdates(_0x44c6e6,_0x4a57a2){return function(_0x3fb561){if(_0x3fb561){return _0x3fb561[_0x5872('0x22')](_0x44c6e6)[_0x5872('0x23')](function(_0x3eb7e5){return _0x3eb7e5;});}return null;};}function removeEntity(_0x23c5b9,_0x482ee2){return function(_0x2e55db){if(_0x2e55db){return _0x2e55db[_0x5872('0x24')]()['then'](function(){_0x23c5b9[_0x5872('0x16')](0xcc)[_0x5872('0x17')]();});}};}function handleEntityNotFound(_0x1d3fbe,_0x5e87c5){return function(_0xd645fa){if(!_0xd645fa){_0x1d3fbe[_0x5872('0x15')](0x194);}return _0xd645fa;};}function handleError(_0x13102a,_0x4e39f4){_0x4e39f4=_0x4e39f4||0x1f4;return function(_0x480858){logger[_0x5872('0x25')](_0x480858[_0x5872('0x26')]);if(_0x480858[_0x5872('0x27')]){delete _0x480858[_0x5872('0x27')];}_0x13102a['status'](_0x4e39f4)[_0x5872('0x28')](_0x480858);};}exports[_0x5872('0x29')]=function(_0x596d4b,_0x207496){var _0x444d46={},_0x28a74a={},_0x2478fb={'count':0x0,'rows':[]};var _0x64e226=_[_0x5872('0x2a')](db['CmHopperHistory']['rawAttributes'],function(_0x2fa2e3){return{'name':_0x2fa2e3[_0x5872('0x2b')],'type':_0x2fa2e3[_0x5872('0x2c')][_0x5872('0x2d')]};});_0x28a74a[_0x5872('0x2e')]=_[_0x5872('0x2a')](_0x64e226,'name');_0x28a74a[_0x5872('0x2f')]=_[_0x5872('0x30')](_0x596d4b[_0x5872('0x2f')]);_0x28a74a[_0x5872('0x31')]=_[_0x5872('0x32')](_0x28a74a['model'],_0x28a74a[_0x5872('0x2f')]);_0x444d46[_0x5872('0x33')]=_[_0x5872('0x32')](_0x28a74a['model'],qs[_0x5872('0x34')](_0x596d4b[_0x5872('0x2f')][_0x5872('0x34')]));_0x444d46['attributes']=_0x444d46[_0x5872('0x33')][_0x5872('0x35')]?_0x444d46[_0x5872('0x33')]:_0x28a74a[_0x5872('0x2e')];if(!_0x596d4b['query'][_0x5872('0x36')]('nolimit')){_0x444d46[_0x5872('0x1a')]=qs[_0x5872('0x1a')](_0x596d4b[_0x5872('0x2f')][_0x5872('0x1a')]);_0x444d46[_0x5872('0x1c')]=qs['offset'](_0x596d4b[_0x5872('0x2f')][_0x5872('0x1c')]);}_0x444d46[_0x5872('0x37')]=qs[_0x5872('0x38')](_0x596d4b['query'][_0x5872('0x38')]);_0x444d46[_0x5872('0x39')]=qs['filters'](_[_0x5872('0x3a')](_0x596d4b[_0x5872('0x2f')],_0x28a74a[_0x5872('0x31')]),_0x64e226);if(_0x596d4b[_0x5872('0x2f')][_0x5872('0x3b')]){_0x444d46['where']=_[_0x5872('0x3c')](_0x444d46[_0x5872('0x39')],{'$or':_[_0x5872('0x2a')](_0x64e226,function(_0x50091d){if(_0x50091d['type']!==_0x5872('0x3d')){var _0x81c5f7={};_0x81c5f7[_0x50091d[_0x5872('0x27')]]={'$like':'%'+_0x596d4b[_0x5872('0x2f')][_0x5872('0x3b')]+'%'};return _0x81c5f7;}})});}_0x444d46=_[_0x5872('0x3c')]({},_0x444d46,_0x596d4b[_0x5872('0x3e')]);var _0x59cce0={'where':_0x444d46['where']};return db[_0x5872('0x3f')][_0x5872('0x1b')](_0x59cce0)[_0x5872('0x23')](function(_0x1f4b5d){_0x2478fb[_0x5872('0x1b')]=_0x1f4b5d;if(_0x596d4b[_0x5872('0x2f')][_0x5872('0x40')]){_0x444d46['include']=[{'all':!![]}];}return db[_0x5872('0x3f')][_0x5872('0x41')](_0x444d46);})[_0x5872('0x23')](function(_0x5f54d2){_0x2478fb[_0x5872('0x42')]=_0x5f54d2;return _0x2478fb;})[_0x5872('0x23')](respondWithFilteredResult(_0x207496,_0x444d46))['catch'](handleError(_0x207496,null));};exports[_0x5872('0x43')]=function(_0x4e74ac,_0x416ec2){var _0x1d682b={'raw':!![],'where':{'id':_0x4e74ac['params']['id']}},_0x317556={};_0x317556['model']=_['keys'](db[_0x5872('0x3f')]['rawAttributes']);_0x317556['query']=_['keys'](_0x4e74ac[_0x5872('0x2f')]);_0x317556['filters']=_['intersection'](_0x317556[_0x5872('0x2e')],_0x317556[_0x5872('0x2f')]);_0x1d682b['attributes']=_[_0x5872('0x32')](_0x317556['model'],qs['fields'](_0x4e74ac[_0x5872('0x2f')][_0x5872('0x34')]));_0x1d682b['attributes']=_0x1d682b[_0x5872('0x33')][_0x5872('0x35')]?_0x1d682b[_0x5872('0x33')]:_0x317556[_0x5872('0x2e')];if(_0x4e74ac['query'][_0x5872('0x40')]){_0x1d682b[_0x5872('0x44')]=[{'all':!![]}];}_0x1d682b=_[_0x5872('0x3c')]({},_0x1d682b,_0x4e74ac[_0x5872('0x3e')]);return db[_0x5872('0x3f')][_0x5872('0x45')](_0x1d682b)[_0x5872('0x23')](handleEntityNotFound(_0x416ec2,null))[_0x5872('0x23')](respondWithResult(_0x416ec2,null))[_0x5872('0x46')](handleError(_0x416ec2,null));};exports[_0x5872('0x47')]=function(_0xefd33a,_0x5a43b3){return db[_0x5872('0x3f')][_0x5872('0x47')](_0xefd33a[_0x5872('0x48')],{})[_0x5872('0x23')](respondWithResult(_0x5a43b3,0xc9))[_0x5872('0x46')](handleError(_0x5a43b3,null));};exports[_0x5872('0x49')]=function(_0xd9b9af,_0x3a519b){return db[_0x5872('0x3f')][_0x5872('0x49')]()[_0x5872('0x23')](respondWithResult(_0x3a519b,null))[_0x5872('0x46')](handleError(_0x3a519b,null));};exports[_0x5872('0x22')]=function(_0x2eebef,_0x5ec007){if(_0x2eebef[_0x5872('0x48')][_0x5872('0x4a')]){delete _0x2eebef['body'][_0x5872('0x4a')];}return db[_0x5872('0x3f')]['find']({'where':{'uniqueid':_0x2eebef[_0x5872('0x4b')]['id']}})[_0x5872('0x23')](handleEntityNotFound(_0x5ec007,null))[_0x5872('0x23')](saveUpdates(_0x2eebef[_0x5872('0x48')],null))[_0x5872('0x23')](respondWithResult(_0x5ec007,null))[_0x5872('0x46')](handleError(_0x5ec007,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 5ee1ba3..67797d7 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 _0xea4e=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','moment','request-promise','path','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0xd0868c,_0x4d3f80){var _0x1eb994=function(_0x533414){while(--_0x533414){_0xd0868c['push'](_0xd0868c['shift']());}};_0x1eb994(++_0x4d3f80);}(_0xea4e,0x10c));var _0xeea4=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0xea4e[_0x32b542];return _0x554d54;};'use strict';var _=require(_0xeea4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeea4('0x1'));var BPromise=require('bluebird');var rp=require(_0xeea4('0x2'));var fs=require('fs');var path=require(_0xeea4('0x3'));var rimraf=require('rimraf');var config=require(_0xeea4('0x4'));var attributes=require(_0xeea4('0x5'));module[_0xeea4('0x6')]=function(_0x12e419,_0x297af5){return _0x12e419[_0xeea4('0x7')](_0xeea4('0x8'),attributes,{'tableName':_0xeea4('0x9'),'paranoid':![],'indexes':[{'name':_0xeea4('0xa'),'fields':['endtime']},{'name':_0xeea4('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf417=['../../config/logger','api','bluebird','rimraf','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util'];(function(_0x393ded,_0x47c302){var _0x2d321=function(_0x4d08fb){while(--_0x4d08fb){_0x393ded['push'](_0x393ded['shift']());}};_0x2d321(++_0x47c302);}(_0xf417,0x8f));var _0x7f41=function(_0x40b003,_0x3ae3aa){_0x40b003=_0x40b003-0x0;var _0x3d0edc=_0xf417[_0x40b003];return _0x3d0edc;};'use strict';var _=require('lodash');var util=require(_0x7f41('0x0'));var logger=require(_0x7f41('0x1'))(_0x7f41('0x2'));var moment=require('moment');var BPromise=require(_0x7f41('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f41('0x4'));var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x5ecdb2,_0x1775d8){return _0x5ecdb2['define'](_0x7f41('0x5'),attributes,{'tableName':_0x7f41('0x6'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x7f41('0x7')]},{'name':'uniqueid','fields':[_0x7f41('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 51c5a79..6af8af5 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 _0x0c39=['`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','catch','CreateCmHopperHistory','create','body','options','raw','CmHopperHistory','findAll','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null'];(function(_0x5ff517,_0x3e4ee0){var _0x19a245=function(_0x4c00ac){while(--_0x4c00ac){_0x5ff517['push'](_0x5ff517['shift']());}};_0x19a245(++_0x3e4ee0);}(_0x0c39,0x1b3));var _0x90c3=function(_0x5ba19c,_0x10f2a8){_0x5ba19c=_0x5ba19c-0x0;var _0x5f0089=_0x0c39[_0x5ba19c];return _0x5f0089;};'use strict';var _=require(_0x90c3('0x0'));var util=require(_0x90c3('0x1'));var moment=require('moment');var BPromise=require(_0x90c3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90c3('0x3'));var db=require(_0x90c3('0x4'))['db'];var utils=require(_0x90c3('0x5'));var logger=require('../../config/logger')(_0x90c3('0x6'));var config=require(_0x90c3('0x7'));var jayson=require(_0x90c3('0x8'));var client=jayson[_0x90c3('0x9')][_0x90c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5170d8,_0x4ccfd6,_0x292444){return new BPromise(function(_0x1b5dca,_0x351076){return client[_0x90c3('0xb')](_0x5170d8,_0x292444)[_0x90c3('0xc')](function(_0x2716e5){logger[_0x90c3('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x4ccfd6,_0x90c3('0xe'));logger[_0x90c3('0xf')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x4ccfd6,_0x90c3('0xe'),JSON[_0x90c3('0x10')](_0x2716e5));if(_0x2716e5[_0x90c3('0x11')]){if(_0x2716e5[_0x90c3('0x11')]['code']===0x1f4){logger[_0x90c3('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x4ccfd6,_0x2716e5[_0x90c3('0x11')]['message']);return _0x351076(_0x2716e5[_0x90c3('0x11')][_0x90c3('0x12')]);}logger['error'](_0x90c3('0x13'),_0x4ccfd6,_0x2716e5['error']['message']);return _0x1b5dca(_0x2716e5[_0x90c3('0x11')][_0x90c3('0x12')]);}else{logger[_0x90c3('0xd')](_0x90c3('0x13'),_0x4ccfd6,_0x90c3('0xe'));_0x1b5dca(_0x2716e5['result'][_0x90c3('0x12')]);}})[_0x90c3('0x14')](function(_0x3f2933){logger[_0x90c3('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x4ccfd6,_0x3f2933);_0x351076(_0x3f2933);});});}exports[_0x90c3('0x15')]=function(_0x3e41ad){var _0x327ca6=this;return new Promise(function(_0x1c9661,_0x2c7e6f){return db['CmHopperHistory'][_0x90c3('0x16')](_0x3e41ad[_0x90c3('0x17')],{'raw':_0x3e41ad['options']?_0x3e41ad[_0x90c3('0x18')][_0x90c3('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x16b19d){logger['info']('CreateCmHopperHistory',_0x3e41ad);logger[_0x90c3('0xf')](_0x90c3('0x15'),_0x3e41ad,JSON[_0x90c3('0x10')](_0x16b19d));_0x1c9661(_0x16b19d);})[_0x90c3('0x14')](function(_0x47f265){logger[_0x90c3('0x11')](_0x90c3('0x15'),_0x47f265[_0x90c3('0x12')],_0x3e41ad);_0x2c7e6f(_0x327ca6[_0x90c3('0x11')](0x1f4,_0x47f265[_0x90c3('0x12')]));});});};exports['AvgHandleTime']=function(_0x2d76df){var _0xc4d7ad=this;return new Promise(function(_0x22dc04,_0x1f17fc){return db[_0x90c3('0x1a')][_0x90c3('0x1b')]({'raw':_0x2d76df['options']?_0x2d76df['options'][_0x90c3('0x19')]===undefined?!![]:![]:!![],'where':_0x2d76df[_0x90c3('0x18')]?_0x2d76df[_0x90c3('0x18')]['where']||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x90c3('0x1c')][_0x90c3('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')](_0x90c3('0x1f')))),_0x90c3('0x20')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')](_0x90c3('0x22')))),_0x90c3('0x23')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x90c3('0x1e')](_0x90c3('0x24')))),_0x90c3('0x25')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x26'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x90c3('0x27')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x26'),db['sequelize']['fn']('IF',db[_0x90c3('0x1c')]['literal'](_0x90c3('0x28')))),_0x90c3('0x29')]]})[_0x90c3('0xc')](function(_0x4f2589){logger[_0x90c3('0xd')](_0x90c3('0x2a'),_0x2d76df);logger[_0x90c3('0xf')](_0x90c3('0x2a'),_0x2d76df,JSON[_0x90c3('0x10')](_0x4f2589));_0x22dc04(_0x4f2589);})[_0x90c3('0x14')](function(_0x4ccf47){logger['error'](_0x90c3('0x2a'),_0x4ccf47[_0x90c3('0x12')],_0x2d76df);_0x1f17fc(_0xc4d7ad[_0x90c3('0x11')](0x1f4,_0x4ccf47[_0x90c3('0x12')]));});});};exports[_0x90c3('0x2b')]=function(_0x44307a){var _0x536e60=this;return new Promise(function(_0x584010,_0x45fde2){return db[_0x90c3('0x1a')][_0x90c3('0x1b')]({'raw':_0x44307a[_0x90c3('0x18')]?_0x44307a[_0x90c3('0x18')][_0x90c3('0x19')]===undefined?!![]:![]:!![],'where':_0x44307a['options']?_0x44307a[_0x90c3('0x18')][_0x90c3('0x2c')]||null:null,'attributes':[[_0x90c3('0x2d'),_0x90c3('0x2e')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')](_0x90c3('0x2f')))),_0x90c3('0x30')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x90c3('0x1e')](_0x90c3('0x31')))),_0x90c3('0x32')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x90c3('0x33')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db['sequelize'][_0x90c3('0x1e')]('`state`\x20=\x205,\x201,\x20null'))),_0x90c3('0x34')],[db[_0x90c3('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x90c3('0x1c')]['literal'](_0x90c3('0x35')))),_0x90c3('0x36')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x90c3('0x37')))),_0x90c3('0x38')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db['sequelize']['fn']('IF',db[_0x90c3('0x1c')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x90c3('0x39')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db['sequelize']['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')](_0x90c3('0x3a')))),_0x90c3('0x3b')],[db[_0x90c3('0x1c')]['fn']('COUNT',db[_0x90c3('0x1c')]['fn']('IF',db['sequelize'][_0x90c3('0x1e')]('`state`\x20=\x2013,\x201,\x20null'))),_0x90c3('0x3c')],[db['sequelize']['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')]['literal'](_0x90c3('0x3d')))),'outboundOriginateFailureCallsDay'],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db['sequelize']['fn']('IF',db[_0x90c3('0x1c')]['literal'](_0x90c3('0x3e')))),_0x90c3('0x3f')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')]('`state`\x20=\x2016,\x201,\x20null'))),_0x90c3('0x40')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')](_0x90c3('0x41')))),_0x90c3('0x3f')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')](_0x90c3('0x42')))),_0x90c3('0x43')]],'group':[_0x90c3('0x2d')]})[_0x90c3('0xc')](function(_0x4fcc50){logger[_0x90c3('0xd')](_0x90c3('0x2b'),_0x44307a);logger[_0x90c3('0xf')](_0x90c3('0x2b'),_0x44307a,JSON[_0x90c3('0x10')](_0x4fcc50));_0x584010(_0x4fcc50);})[_0x90c3('0x14')](function(_0x4c05bb){logger[_0x90c3('0x11')](_0x90c3('0x2b'),_0x4c05bb[_0x90c3('0x12')],_0x44307a);_0x45fde2(_0x536e60[_0x90c3('0x11')](0x1f4,_0x4c05bb[_0x90c3('0x12')]));});});};exports[_0x90c3('0x44')]=function(_0x1f5125){var _0xfe5479=this;return new Promise(function(_0x206b83,_0x168b7b){return db[_0x90c3('0x1a')][_0x90c3('0x1b')]({'raw':_0x1f5125[_0x90c3('0x18')]?_0x1f5125[_0x90c3('0x18')][_0x90c3('0x19')]===undefined?!![]:![]:!![],'where':_0x1f5125[_0x90c3('0x18')]?_0x1f5125[_0x90c3('0x18')][_0x90c3('0x2c')]||null:null,'attributes':[[_0x90c3('0x2d'),_0x90c3('0x2e')],[db['sequelize']['fn'](_0x90c3('0x21'),db['sequelize']['col']('id')),_0x90c3('0x45')],[db[_0x90c3('0x1c')]['fn'](_0x90c3('0x21'),db[_0x90c3('0x1c')]['fn']('IF',db[_0x90c3('0x1c')][_0x90c3('0x1e')](_0x90c3('0x1f')))),_0x90c3('0x46')]],'group':[_0x90c3('0x2d')]})[_0x90c3('0xc')](function(_0x3f477d){logger[_0x90c3('0xd')](_0x90c3('0x44'),_0x1f5125);logger[_0x90c3('0xf')](_0x90c3('0x44'),_0x1f5125,JSON['stringify'](_0x3f477d));_0x206b83(_0x3f477d);})[_0x90c3('0x14')](function(_0x38b88f){logger[_0x90c3('0x11')](_0x90c3('0x44'),_0x38b88f[_0x90c3('0x12')],_0x1f5125);_0x168b7b(_0xfe5479[_0x90c3('0x11')](0x1f4,_0x38b88f[_0x90c3('0x12')]));});});}; \ No newline at end of file +var _0x131e=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','message','CmHopperHistory,\x20%s,\x20%s','catch','CmHopperHistory','create','options','raw','CreateCmHopperHistory','AvgHandleTime','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','where','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','GetCampaignHopperHistory','col','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x43b764,_0x22af88){var _0x394e8a=function(_0x284b6a){while(--_0x284b6a){_0x43b764['push'](_0x43b764['shift']());}};_0x394e8a(++_0x22af88);}(_0x131e,0x1ec));var _0xe131=function(_0x2d7c1b,_0x374c21){_0x2d7c1b=_0x2d7c1b-0x0;var _0x4d3f0e=_0x131e[_0x2d7c1b];return _0x4d3f0e;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe131('0x0'));var rs=require(_0xe131('0x1'));var fs=require('fs');var Redis=require(_0xe131('0x2'));var db=require(_0xe131('0x3'))['db'];var utils=require(_0xe131('0x4'));var logger=require(_0xe131('0x5'))('rpc');var config=require(_0xe131('0x6'));var jayson=require(_0xe131('0x7'));var client=jayson[_0xe131('0x8')][_0xe131('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1002a6,_0x48a90e,_0x5c4eb5){return new BPromise(function(_0x562617,_0x4bf386){return client[_0xe131('0xa')](_0x1002a6,_0x5c4eb5)[_0xe131('0xb')](function(_0x530ecb){logger[_0xe131('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,_0xe131('0xd'));logger[_0xe131('0xe')](_0xe131('0xf'),_0x48a90e,_0xe131('0xd'),JSON[_0xe131('0x10')](_0x530ecb));if(_0x530ecb[_0xe131('0x11')]){if(_0x530ecb[_0xe131('0x11')]['code']===0x1f4){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,_0x530ecb['error'][_0xe131('0x12')]);return _0x4bf386(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}logger[_0xe131('0x11')](_0xe131('0x13'),_0x48a90e,_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);return _0x562617(_0x530ecb[_0xe131('0x11')][_0xe131('0x12')]);}else{logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,'request\x20sent');_0x562617(_0x530ecb['result']['message']);}})[_0xe131('0x14')](function(_0x32091b){logger[_0xe131('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x48a90e,_0x32091b);_0x4bf386(_0x32091b);});});}exports['CreateCmHopperHistory']=function(_0x400f6b){var _0x2e2bf8=this;return new Promise(function(_0x3bbca8,_0x1a1e03){return db[_0xe131('0x15')][_0xe131('0x16')](_0x400f6b['body'],{'raw':_0x400f6b[_0xe131('0x17')]?_0x400f6b[_0xe131('0x17')][_0xe131('0x18')]===undefined?!![]:![]:!![]})[_0xe131('0xb')](function(_0x2d6c6b){logger['info']('CreateCmHopperHistory',_0x400f6b);logger[_0xe131('0xe')](_0xe131('0x19'),_0x400f6b,JSON['stringify'](_0x2d6c6b));_0x3bbca8(_0x2d6c6b);})[_0xe131('0x14')](function(_0x55b0c5){logger['error'](_0xe131('0x19'),_0x55b0c5[_0xe131('0x12')],_0x400f6b);_0x1a1e03(_0x2e2bf8[_0xe131('0x11')](0x1f4,_0x55b0c5[_0xe131('0x12')]));});});};exports[_0xe131('0x1a')]=function(_0x225278){var _0x2bcb68=this;return new Promise(function(_0x52c546,_0x2be2df){return db[_0xe131('0x15')]['findAll']({'raw':_0x225278['options']?_0x225278[_0xe131('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x225278[_0xe131('0x17')]?_0x225278[_0xe131('0x17')]['where']||null:null,'attributes':[[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['col']('id')),_0xe131('0x1d')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x1f')))),_0xe131('0x20')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x21')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xe131('0x1b')]['fn']('COUNT',db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x22'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x23')))),_0xe131('0x24')],[db[_0xe131('0x1b')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x25')))),_0xe131('0x26')]]})[_0xe131('0xb')](function(_0x44cc9f){logger[_0xe131('0xc')]('AvgHandleTime',_0x225278);logger['debug'](_0xe131('0x1a'),_0x225278,JSON['stringify'](_0x44cc9f));_0x52c546(_0x44cc9f);})[_0xe131('0x14')](function(_0x584cc9){logger[_0xe131('0x11')]('AvgHandleTime',_0x584cc9[_0xe131('0x12')],_0x225278);_0x2be2df(_0x2bcb68['error'](0x1f4,_0x584cc9[_0xe131('0x12')]));});});};exports[_0xe131('0x27')]=function(_0x38343c){var _0x2aa2e5=this;return new Promise(function(_0x9e35ed,_0x17016b){return db['CmHopperHistory'][_0xe131('0x28')]({'raw':_0x38343c['options']?_0x38343c[_0xe131('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x38343c[_0xe131('0x17')]?_0x38343c[_0xe131('0x17')][_0xe131('0x29')]||null:null,'attributes':[[_0xe131('0x2a'),_0xe131('0x2b')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x2c')))),_0xe131('0x2d')],[db['sequelize']['fn']('COUNT',db[_0xe131('0x1b')]['fn']('IF',db['sequelize']['literal'](_0xe131('0x2e')))),'outboundNoAnswerCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x1f')))),_0xe131('0x2f')],[db[_0xe131('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x30')))),'outboundBusyCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db['sequelize'][_0xe131('0x1e')](_0xe131('0x31')))),_0xe131('0x32')],[db['sequelize']['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x33')))),_0xe131('0x34')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x35')))),'outboundUnknownCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x36')))),'outboundBlacklistCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x37')))),_0xe131('0x38')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')]['literal'](_0xe131('0x39')))),'outboundRejectCallsDay'],[db['sequelize']['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x3a')))),_0xe131('0x3b')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db['sequelize']['fn']('IF',db['sequelize'][_0xe131('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xe131('0x2a')]})[_0xe131('0xb')](function(_0x32e45d){logger[_0xe131('0xc')](_0xe131('0x27'),_0x38343c);logger[_0xe131('0xe')]('GetVoiceQueueHopperHistory',_0x38343c,JSON['stringify'](_0x32e45d));_0x9e35ed(_0x32e45d);})[_0xe131('0x14')](function(_0xc3867d){logger['error'](_0xe131('0x27'),_0xc3867d[_0xe131('0x12')],_0x38343c);_0x17016b(_0x2aa2e5[_0xe131('0x11')](0x1f4,_0xc3867d[_0xe131('0x12')]));});});};exports[_0xe131('0x3c')]=function(_0x1338f3){var _0x4a9ad6=this;return new Promise(function(_0x23d880,_0x544b14){return db['CmHopperHistory'][_0xe131('0x28')]({'raw':_0x1338f3[_0xe131('0x17')]?_0x1338f3['options']['raw']===undefined?!![]:![]:!![],'where':_0x1338f3[_0xe131('0x17')]?_0x1338f3[_0xe131('0x17')][_0xe131('0x29')]||null:null,'attributes':[['campaign',_0xe131('0x2b')],[db[_0xe131('0x1b')]['fn'](_0xe131('0x1c'),db[_0xe131('0x1b')][_0xe131('0x3d')]('id')),'ivrTotalCallsDays'],[db[_0xe131('0x1b')]['fn']('COUNT',db[_0xe131('0x1b')]['fn']('IF',db[_0xe131('0x1b')][_0xe131('0x1e')](_0xe131('0x1f')))),'ivrAnswerCallsDay']],'group':['campaign']})['then'](function(_0x44552d){logger['info'](_0xe131('0x3c'),_0x1338f3);logger[_0xe131('0xe')](_0xe131('0x3c'),_0x1338f3,JSON[_0xe131('0x10')](_0x44552d));_0x23d880(_0x44552d);})[_0xe131('0x14')](function(_0x3f8f72){logger[_0xe131('0x11')](_0xe131('0x3c'),_0x3f8f72[_0xe131('0x12')],_0x1338f3);_0x544b14(_0x4a9ad6[_0xe131('0x11')](0x1f4,_0x3f8f72['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 9f3277a..41e2a9c 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 _0x230a=['Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','describe','isAuthenticated','show','put','/:id','update','util','path','connect-timeout','express'];(function(_0x1e6ac4,_0x14d3e1){var _0x562bd8=function(_0xc78bea){while(--_0xc78bea){_0x1e6ac4['push'](_0x1e6ac4['shift']());}};_0x562bd8(++_0x14d3e1);}(_0x230a,0xe6));var _0xa230=function(_0x36ad3f,_0x3fc7f0){_0x36ad3f=_0x36ad3f-0x0;var _0x242e46=_0x230a[_0x36ad3f];return _0x242e46;};'use strict';var multer=require('multer');var util=require(_0xa230('0x0'));var path=require(_0xa230('0x1'));var timeout=require(_0xa230('0x2'));var express=require(_0xa230('0x3'));var router=express[_0xa230('0x4')]();var fs_extra=require(_0xa230('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa230('0x6'));var config=require(_0xa230('0x7'));var controller=require(_0xa230('0x8'));router[_0xa230('0x9')]('/',auth['isAuthenticated'](),controller[_0xa230('0xa')]);router[_0xa230('0x9')](_0xa230('0xb'),auth['isAuthenticated'](),controller[_0xa230('0xc')]);router[_0xa230('0x9')]('/:id',auth[_0xa230('0xd')](),controller[_0xa230('0xe')]);router['post']('/',auth[_0xa230('0xd')](),controller['create']);router[_0xa230('0xf')](_0xa230('0x10'),auth[_0xa230('0xd')](),controller[_0xa230('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb61a=['get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x5c22a5,_0x59266a){var _0x365a7e=function(_0x21f059){while(--_0x21f059){_0x5c22a5['push'](_0x5c22a5['shift']());}};_0x365a7e(++_0x59266a);}(_0xb61a,0x71));var _0xab61=function(_0x316300,_0x2ea07a){_0x316300=_0x316300-0x0;var _0x6d6e6=_0xb61a[_0x316300];return _0x6d6e6;};'use strict';var multer=require(_0xab61('0x0'));var util=require(_0xab61('0x1'));var path=require(_0xab61('0x2'));var timeout=require('connect-timeout');var express=require(_0xab61('0x3'));var router=express[_0xab61('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab61('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0xab61('0x6')]('/',auth[_0xab61('0x7')](),controller[_0xab61('0x8')]);router[_0xab61('0x6')](_0xab61('0x9'),auth['isAuthenticated'](),controller[_0xab61('0xa')]);router[_0xab61('0x6')](_0xab61('0xb'),auth[_0xab61('0x7')](),controller[_0xab61('0xc')]);router[_0xab61('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xab61('0xe')](_0xab61('0xb'),auth[_0xab61('0x7')](),controller[_0xab61('0xf')]);module[_0xab61('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 351233a..fe4ec69 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 _0x1280=['STRING','name','sequelize','exports'];(function(_0x16fbbc,_0x54a1ee){var _0x300a0d=function(_0x3eebf9){while(--_0x3eebf9){_0x16fbbc['push'](_0x16fbbc['shift']());}};_0x300a0d(++_0x54a1ee);}(_0x1280,0xba));var _0x0128=function(_0x461886,_0x4fc171){_0x461886=_0x461886-0x0;var _0x295e0a=_0x1280[_0x461886];return _0x295e0a;};'use strict';var Sequelize=require(_0x0128('0x0'));module[_0x0128('0x1')]={'name':{'type':Sequelize[_0x0128('0x2')],'unique':_0x0128('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0128('0x2')]},'dialPrefix':{'type':Sequelize[_0x0128('0x2')]}}; \ No newline at end of file +var _0x861c=['exports','STRING','name','sequelize'];(function(_0x56fd30,_0x3df715){var _0x745b1=function(_0x230013){while(--_0x230013){_0x56fd30['push'](_0x56fd30['shift']());}};_0x745b1(++_0x3df715);}(_0x861c,0xdb));var _0xc861=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x861c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc861('0x0'));module[_0xc861('0x1')]={'name':{'type':Sequelize[_0xc861('0x2')],'unique':_0xc861('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc861('0x2')]},'dialPrefix':{'type':Sequelize[_0xc861('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 0918d54..40b8c43 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 _0xde66=['addDisposition','ListId','Disposition','findOne','nolimit','includeAll','removeDispositions','ids','tags','isArray','join','push','CmContact','omit','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','pick','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','User','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','count','limit','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','CmList','findAll','rows','show','params','length','include','find','catch','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xde66,0x1de));var _0x6de6=function(_0x35424f,_0x58b79f){_0x35424f=_0x35424f-0x0;var _0x380a86=_0xde66[_0x35424f];return _0x380a86;};'use strict';var emlformat=require(_0x6de6('0x0'));var rimraf=require(_0x6de6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6de6('0x2'));var rp=require(_0x6de6('0x3'));var moment=require(_0x6de6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6de6('0x5'));var path=require(_0x6de6('0x6'));var sox=require('sox');var csv=require(_0x6de6('0x7'));var ejs=require(_0x6de6('0x8'));var fs=require('fs');var fs_extra=require(_0x6de6('0x9'));var _=require('lodash');var squel=require(_0x6de6('0xa'));var crypto=require(_0x6de6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6de6('0xc'));var toCsv=require(_0x6de6('0x7'));var querystring=require(_0x6de6('0xd'));var Papa=require(_0x6de6('0xe'));var Redis=require(_0x6de6('0xf'));var authService=require(_0x6de6('0x10'));var qs=require(_0x6de6('0x11'));var as=require(_0x6de6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6de6('0x13'))('api');var utils=require(_0x6de6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6de6('0x15'));var db=require(_0x6de6('0x16'))['db'];config['redis']=_['defaults'](config[_0x6de6('0x17')],{'host':_0x6de6('0x18'),'port':0x18eb});var socket=require(_0x6de6('0x19'))(new Redis(config[_0x6de6('0x17')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x3e866e,_0x210008){_0x210008=_0x210008||0xcc;return function(_0x4d16b5){if(_0x4d16b5){return _0x3e866e[_0x6de6('0x1a')](_0x210008);}return _0x3e866e[_0x6de6('0x1b')](_0x210008)['end']();};}function respondWithResult(_0x1fcbc3,_0x570ba5){_0x570ba5=_0x570ba5||0xc8;return function(_0x3df087){if(_0x3df087){return _0x1fcbc3[_0x6de6('0x1b')](_0x570ba5)[_0x6de6('0x1c')](_0x3df087);}};}function respondWithFilteredResult(_0x32298d,_0x3c11ad){return function(_0x2f349d){if(_0x2f349d){var _0x3c8772=typeof _0x3c11ad[_0x6de6('0x1d')]===_0x6de6('0x1e')&&typeof _0x3c11ad['limit']===_0x6de6('0x1e');var _0xfd7f99=_0x2f349d[_0x6de6('0x1f')];var _0x271ab5=_0x3c8772?0x0:_0x3c11ad[_0x6de6('0x1d')];var _0x1517ab=_0x3c8772?_0x2f349d[_0x6de6('0x1f')]:_0x3c11ad[_0x6de6('0x1d')]+_0x3c11ad[_0x6de6('0x20')];var _0x14d650;if(_0x1517ab>=_0xfd7f99){_0x1517ab=_0xfd7f99;_0x14d650=0xc8;}else{_0x14d650=0xce;}_0x32298d[_0x6de6('0x1b')](_0x14d650);return _0x32298d['set']('Content-Range',_0x271ab5+'-'+_0x1517ab+'/'+_0xfd7f99)[_0x6de6('0x1c')](_0x2f349d);}return null;};}function patchUpdates(_0x5837bc){return function(_0x5666a8){try{jsonpatch[_0x6de6('0x21')](_0x5666a8,_0x5837bc,!![]);}catch(_0x182cb0){return BPromise['reject'](_0x182cb0);}return _0x5666a8[_0x6de6('0x22')]();};}function saveUpdates(_0x199f1c,_0xc804a3){return function(_0x550665){if(_0x550665){return _0x550665[_0x6de6('0x23')](_0x199f1c)[_0x6de6('0x24')](function(_0x57bc0b){return _0x57bc0b;});}return null;};}function removeEntity(_0x126ebf,_0x3bbf10){return function(_0x1623ea){if(_0x1623ea){return _0x1623ea[_0x6de6('0x25')]()['then'](function(){var _0x18cc3d=_0x1623ea[_0x6de6('0x26')]({'plain':!![]});var _0x40a48a='Lists';return db[_0x6de6('0x27')][_0x6de6('0x25')]({'where':{'type':_0x40a48a,'resourceId':_0x18cc3d['id']}})['then'](function(){return _0x1623ea;});})['then'](function(){_0x126ebf[_0x6de6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a41ca,_0x40b850){return function(_0x49fd81){if(!_0x49fd81){_0x5a41ca[_0x6de6('0x1a')](0x194);}return _0x49fd81;};}function handleError(_0x31e584,_0xf9d7be){_0xf9d7be=_0xf9d7be||0x1f4;return function(_0x4d5df8){logger[_0x6de6('0x28')](_0x4d5df8[_0x6de6('0x29')]);if(_0x4d5df8[_0x6de6('0x2a')]){delete _0x4d5df8[_0x6de6('0x2a')];}_0x31e584[_0x6de6('0x1b')](_0xf9d7be)['send'](_0x4d5df8);};}exports[_0x6de6('0x2b')]=function(_0x1c34c4,_0x391750){var _0x32aae8={},_0x26f2a1={},_0xeae334={'count':0x0,'rows':[]};var _0x2eb7a7=_[_0x6de6('0x2c')](db['CmList'][_0x6de6('0x2d')],function(_0x3cbff8){return{'name':_0x3cbff8[_0x6de6('0x2e')],'type':_0x3cbff8[_0x6de6('0x2f')][_0x6de6('0x30')]};});_0x26f2a1[_0x6de6('0x31')]=_[_0x6de6('0x2c')](_0x2eb7a7,_0x6de6('0x2a'));_0x26f2a1[_0x6de6('0x32')]=_[_0x6de6('0x33')](_0x1c34c4[_0x6de6('0x32')]);_0x26f2a1[_0x6de6('0x34')]=_[_0x6de6('0x35')](_0x26f2a1[_0x6de6('0x31')],_0x26f2a1[_0x6de6('0x32')]);_0x32aae8[_0x6de6('0x36')]=_['intersection'](_0x26f2a1[_0x6de6('0x31')],qs[_0x6de6('0x37')](_0x1c34c4['query'][_0x6de6('0x37')]));_0x32aae8[_0x6de6('0x36')]=_0x32aae8[_0x6de6('0x36')]['length']?_0x32aae8[_0x6de6('0x36')]:_0x26f2a1[_0x6de6('0x31')];if(!_0x1c34c4[_0x6de6('0x32')][_0x6de6('0x38')]('nolimit')){_0x32aae8[_0x6de6('0x20')]=qs[_0x6de6('0x20')](_0x1c34c4[_0x6de6('0x32')][_0x6de6('0x20')]);_0x32aae8[_0x6de6('0x1d')]=qs[_0x6de6('0x1d')](_0x1c34c4['query'][_0x6de6('0x1d')]);}_0x32aae8[_0x6de6('0x39')]=qs[_0x6de6('0x3a')](_0x1c34c4[_0x6de6('0x32')][_0x6de6('0x3a')]);_0x32aae8[_0x6de6('0x3b')]=qs[_0x6de6('0x34')](_['pick'](_0x1c34c4['query'],_0x26f2a1[_0x6de6('0x34')]),_0x2eb7a7);if(_0x1c34c4[_0x6de6('0x32')][_0x6de6('0x3c')]){_0x32aae8[_0x6de6('0x3b')]=_['merge'](_0x32aae8['where'],{'$or':_[_0x6de6('0x2c')](_0x2eb7a7,function(_0x4f539d){if(_0x4f539d['type']!==_0x6de6('0x3d')){var _0x2769be={};_0x2769be[_0x4f539d['name']]={'$like':'%'+_0x1c34c4['query']['filter']+'%'};return _0x2769be;}})});}_0x32aae8=_[_0x6de6('0x3e')]({},_0x32aae8,_0x1c34c4[_0x6de6('0x3f')]);var _0x46323e={'where':_0x32aae8[_0x6de6('0x3b')]};return db[_0x6de6('0x40')][_0x6de6('0x1f')](_0x46323e)['then'](function(_0x2071eb){_0xeae334['count']=_0x2071eb;if(_0x1c34c4[_0x6de6('0x32')]['includeAll']){_0x32aae8['include']=[{'all':!![]}];}return db[_0x6de6('0x40')][_0x6de6('0x41')](_0x32aae8);})[_0x6de6('0x24')](function(_0x4d313c){_0xeae334[_0x6de6('0x42')]=_0x4d313c;return _0xeae334;})[_0x6de6('0x24')](respondWithFilteredResult(_0x391750,_0x32aae8))['catch'](handleError(_0x391750,null));};exports[_0x6de6('0x43')]=function(_0x599ff7,_0x382071){var _0x1d6081={'raw':![],'where':{'id':_0x599ff7[_0x6de6('0x44')]['id']}},_0x2d37db={};_0x2d37db[_0x6de6('0x31')]=_[_0x6de6('0x33')](db[_0x6de6('0x40')][_0x6de6('0x2d')]);_0x2d37db[_0x6de6('0x32')]=_[_0x6de6('0x33')](_0x599ff7['query']);_0x2d37db[_0x6de6('0x34')]=_[_0x6de6('0x35')](_0x2d37db[_0x6de6('0x31')],_0x2d37db[_0x6de6('0x32')]);_0x1d6081['attributes']=_[_0x6de6('0x35')](_0x2d37db[_0x6de6('0x31')],qs[_0x6de6('0x37')](_0x599ff7[_0x6de6('0x32')][_0x6de6('0x37')]));_0x1d6081['attributes']=_0x1d6081[_0x6de6('0x36')][_0x6de6('0x45')]?_0x1d6081[_0x6de6('0x36')]:_0x2d37db[_0x6de6('0x31')];if(_0x599ff7[_0x6de6('0x32')]['includeAll']){_0x1d6081[_0x6de6('0x46')]=[{'all':!![]}];}_0x1d6081=_['merge']({},_0x1d6081,_0x599ff7[_0x6de6('0x3f')]);return db[_0x6de6('0x40')][_0x6de6('0x47')](_0x1d6081)['then'](handleEntityNotFound(_0x382071,null))['then'](respondWithResult(_0x382071,null))[_0x6de6('0x48')](handleError(_0x382071,null));};exports['create']=function(_0x38d120,_0x575207){return db['CmList']['create'](_0x38d120['body'],{})['then'](function(_0x362fff){var _0xfb46a4=_0x38d120[_0x6de6('0x49')][_0x6de6('0x26')]({'plain':!![]});if(!_0xfb46a4)throw new Error(_0x6de6('0x4a'));if(_0xfb46a4[_0x6de6('0x4b')]===_0x6de6('0x49')){var _0x26f699=_0x362fff[_0x6de6('0x26')]({'plain':!![]});var _0x223f0f='Lists';return db[_0x6de6('0x4c')]['find']({'where':{'name':_0x223f0f,'userProfileId':_0xfb46a4[_0x6de6('0x4d')]},'raw':!![]})[_0x6de6('0x24')](function(_0xf35cb7){if(_0xf35cb7&&_0xf35cb7['autoAssociation']===0x0){return db[_0x6de6('0x27')][_0x6de6('0x4e')]({'name':_0x26f699[_0x6de6('0x2a')],'resourceId':_0x26f699['id'],'type':_0xf35cb7[_0x6de6('0x2a')],'sectionId':_0xf35cb7['id']},{})[_0x6de6('0x24')](function(){return _0x362fff;});}else{return _0x362fff;}})[_0x6de6('0x48')](function(_0x5b0d06){logger['error'](_0x6de6('0x4f'),_0x5b0d06);throw _0x5b0d06;});}return _0x362fff;})[_0x6de6('0x24')](respondWithResult(_0x575207,0xc9))[_0x6de6('0x48')](handleError(_0x575207,null));};exports['update']=function(_0x1ddef7,_0xa2f048){if(_0x1ddef7[_0x6de6('0x50')]['id']){delete _0x1ddef7[_0x6de6('0x50')]['id'];}return db['CmList']['find']({'where':{'id':_0x1ddef7[_0x6de6('0x44')]['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0xa2f048,null))['then'](saveUpdates(_0x1ddef7['body'],null))['then'](respondWithResult(_0xa2f048,null))[_0x6de6('0x48')](handleError(_0xa2f048,null));};exports['destroy']=function(_0x2c17f9,_0x420029){return db[_0x6de6('0x40')][_0x6de6('0x47')]({'where':{'id':_0x2c17f9['params']['id']}})['then'](handleEntityNotFound(_0x420029,null))[_0x6de6('0x24')](removeEntity(_0x420029,null))[_0x6de6('0x48')](handleError(_0x420029,null));};exports[_0x6de6('0x51')]=function(_0x257b24,_0x2ff3e9){return db['CmList'][_0x6de6('0x51')]()[_0x6de6('0x24')](respondWithResult(_0x2ff3e9,null))['catch'](handleError(_0x2ff3e9,null));};exports[_0x6de6('0x52')]=function(_0x552783,_0x426296,_0x106ef7){if(_0x552783[_0x6de6('0x50')]['id']){delete _0x552783[_0x6de6('0x50')]['id'];}return db['CmList']['find']({'where':{'id':_0x552783[_0x6de6('0x44')]['id']}})['then'](handleEntityNotFound(_0x426296,null))['then'](function(_0x6f25ad){if(_0x6f25ad){_0x552783[_0x6de6('0x50')][_0x6de6('0x53')]=_0x6f25ad['id'];return db[_0x6de6('0x54')][_0x6de6('0x4e')](_0x552783[_0x6de6('0x50')]);}})['then'](respondWithResult(_0x426296,null))[_0x6de6('0x48')](handleError(_0x426296,null));};exports['getDispositions']=function(_0x259d9d,_0x4786fb,_0x40a1f4){var _0x389188={'raw':![],'where':{}};var _0x53debc={};var _0x3aeff={'count':0x0,'rows':[]};return db[_0x6de6('0x40')][_0x6de6('0x55')]({'where':{'id':_0x259d9d[_0x6de6('0x44')]['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0x4786fb,null))[_0x6de6('0x24')](function(_0xd611ad){if(_0xd611ad){_0x53debc['model']=_[_0x6de6('0x33')](db[_0x6de6('0x54')][_0x6de6('0x2d')]);_0x53debc[_0x6de6('0x32')]=_[_0x6de6('0x33')](_0x259d9d['query']);_0x53debc[_0x6de6('0x34')]=_['intersection'](_0x53debc[_0x6de6('0x31')],_0x53debc[_0x6de6('0x32')]);_0x389188[_0x6de6('0x36')]=_[_0x6de6('0x35')](_0x53debc[_0x6de6('0x31')],qs[_0x6de6('0x37')](_0x259d9d['query'][_0x6de6('0x37')]));_0x389188[_0x6de6('0x36')]=_0x389188[_0x6de6('0x36')]['length']?_0x389188[_0x6de6('0x36')]:_0x53debc[_0x6de6('0x31')];if(!_0x259d9d[_0x6de6('0x32')]['hasOwnProperty'](_0x6de6('0x56'))){_0x389188[_0x6de6('0x20')]=qs['limit'](_0x259d9d[_0x6de6('0x32')][_0x6de6('0x20')]);_0x389188['offset']=qs[_0x6de6('0x1d')](_0x259d9d[_0x6de6('0x32')]['offset']);}_0x389188[_0x6de6('0x39')]=qs[_0x6de6('0x3a')](_0x259d9d[_0x6de6('0x32')][_0x6de6('0x3a')]);_0x389188[_0x6de6('0x3b')]=qs[_0x6de6('0x34')](_['pick'](_0x259d9d[_0x6de6('0x32')],_0x53debc['filters']));_0x389188[_0x6de6('0x3b')][_0x6de6('0x53')]=_0xd611ad['id'];if(_0x259d9d[_0x6de6('0x32')][_0x6de6('0x3c')]){_0x389188['where']=_['merge'](_0x389188[_0x6de6('0x3b')],{'$or':_[_0x6de6('0x2c')](_0x389188['attributes'],function(_0x486c65){var _0x359389={};_0x359389[_0x486c65]={'$like':'%'+_0x259d9d[_0x6de6('0x32')][_0x6de6('0x3c')]+'%'};return _0x359389;})});}_0x389188=_[_0x6de6('0x3e')]({},_0x389188,_0x259d9d[_0x6de6('0x3f')]);return db[_0x6de6('0x54')]['count']({'where':_0x389188[_0x6de6('0x3b')]})['then'](function(_0x467d10){_0x3aeff[_0x6de6('0x1f')]=_0x467d10;if(_0x259d9d['query'][_0x6de6('0x57')]){_0x389188[_0x6de6('0x46')]=[{'all':!![]}];}return db[_0x6de6('0x54')][_0x6de6('0x41')](_0x389188);})[_0x6de6('0x24')](function(_0x3cfc56){_0x3aeff[_0x6de6('0x42')]=_0x3cfc56;return _0x3aeff;});}})[_0x6de6('0x24')](respondWithFilteredResult(_0x4786fb,_0x389188))['catch'](handleError(_0x4786fb,null));};exports[_0x6de6('0x58')]=function(_0x24b39f,_0x127607,_0x4e50e9){return db[_0x6de6('0x40')][_0x6de6('0x47')]({'where':{'id':_0x24b39f[_0x6de6('0x44')]['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0x127607,null))[_0x6de6('0x24')](function(_0xd80703){if(_0xd80703){return _0xd80703[_0x6de6('0x58')](_0x24b39f[_0x6de6('0x32')][_0x6de6('0x59')]);}})[_0x6de6('0x24')](respondWithStatusCode(_0x127607,null))[_0x6de6('0x48')](handleError(_0x127607,null));};exports['addContacts']=function(_0x42b11a,_0x2680a6,_0x56b2a5){return db[_0x6de6('0x40')][_0x6de6('0x47')]({'where':{'id':_0x42b11a[_0x6de6('0x44')]['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0x2680a6,null))['then'](function(_0x4391e9){if(_0x4391e9){var _0x3da458=[];var _0x33910a={'success':[],'errors':[]};return db['CmContact'][_0x6de6('0x51')]()[_0x6de6('0x24')](function(_0x29cf5d){if(_0x42b11a[_0x6de6('0x50')][_0x6de6('0x5a')]&&_[_0x6de6('0x5b')](_0x42b11a[_0x6de6('0x50')][_0x6de6('0x5a')])){if(_0x42b11a[_0x6de6('0x50')]['tags'][_0x6de6('0x45')]){_0x42b11a['body'][_0x6de6('0x5a')]=_0x42b11a[_0x6de6('0x50')][_0x6de6('0x5a')][_0x6de6('0x5c')](';')+';';}else{_0x42b11a[_0x6de6('0x50')][_0x6de6('0x5a')]=null;}}else{_0x42b11a[_0x6de6('0x50')]['tags']=null;}if(_0x42b11a[_0x6de6('0x50')]&&_['isArray'](_0x42b11a[_0x6de6('0x50')])){for(var _0x51609c=0x0;_0x51609c<_0x42b11a[_0x6de6('0x50')][_0x6de6('0x45')];_0x51609c+=0x1){_0x42b11a['body'][_0x51609c][_0x6de6('0x53')]=_0x42b11a['params']['id'];_0x3da458[_0x6de6('0x5d')](_0x42b11a[_0x6de6('0x50')][_0x51609c]);}return BPromise['each'](_0x3da458,function(_0xd83292){return db[_0x6de6('0x5e')]['create'](_[_0x6de6('0x5f')](_0xd83292,['ids','id'])||{},{'fields':_[_0x6de6('0x33')](_0x29cf5d),'raw':!![]})[_0x6de6('0x24')](function(_0x2bfd44){_0x33910a['success'][_0x6de6('0x5d')](_0x2bfd44[_0x6de6('0x60')]);})[_0x6de6('0x48')](function(_0x72b591){_0x33910a[_0x6de6('0x61')][_0x6de6('0x5d')]({'data':_0xd83292,'error':_0x72b591[_0x6de6('0x62')]});});})[_0x6de6('0x24')](function(_0xf09861){return _0x33910a;})[_0x6de6('0x48')](function(_0x2a36ca){return _0x2a36ca;});}else{_0x2680a6['status'](0x190)[_0x6de6('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x6de6('0x24')](respondWithResult(_0x2680a6,null))[_0x6de6('0x48')](handleError(_0x2680a6,null));};exports[_0x6de6('0x63')]=function(_0x17916e,_0x449504,_0x37fa78){var _0x4fcf67;return db[_0x6de6('0x40')][_0x6de6('0x47')]({'where':{'id':_0x17916e[_0x6de6('0x44')]['id']},'include':[{'model':db[_0x6de6('0x64')],'as':_0x6de6('0x65')}]})[_0x6de6('0x24')](handleEntityNotFound(_0x449504,null))[_0x6de6('0x24')](function(_0x19c955){if(_0x19c955){_0x4fcf67=_0x19c955;return db[_0x6de6('0x5e')][_0x6de6('0x2d')];}})[_0x6de6('0x24')](function(_0x1675ba){if(_0x1675ba){var _0x45d654={};var _0x5dcb8a={};_0x5dcb8a[_0x6de6('0x31')]=_[_0x6de6('0x66')](_['keys'](_0x1675ba),_[_0x6de6('0x2c')](_0x4fcf67[_0x6de6('0x65')],function(_0x496fa9){return util[_0x6de6('0x67')](_0x6de6('0x68'),_0x496fa9['id']);}));_0x5dcb8a[_0x6de6('0x32')]=_[_0x6de6('0x33')](_0x17916e[_0x6de6('0x32')]);_0x5dcb8a['filters']=_[_0x6de6('0x35')](_0x5dcb8a['model'],_0x5dcb8a[_0x6de6('0x32')]);_0x45d654[_0x6de6('0x36')]=_['intersection'](_0x5dcb8a[_0x6de6('0x31')],qs[_0x6de6('0x37')](_0x17916e['query']['fields']));_0x45d654[_0x6de6('0x36')]=_0x45d654[_0x6de6('0x36')][_0x6de6('0x45')]?_0x45d654[_0x6de6('0x36')]:_0x5dcb8a[_0x6de6('0x31')];if(!_0x17916e[_0x6de6('0x32')]['hasOwnProperty'](_0x6de6('0x56'))){_0x45d654[_0x6de6('0x20')]=qs['limit'](_0x17916e[_0x6de6('0x32')][_0x6de6('0x20')]);_0x45d654[_0x6de6('0x1d')]=qs[_0x6de6('0x1d')](_0x17916e[_0x6de6('0x32')][_0x6de6('0x1d')]);}_0x45d654[_0x6de6('0x39')]=qs[_0x6de6('0x3a')](_0x17916e[_0x6de6('0x32')][_0x6de6('0x3a')]);_0x45d654[_0x6de6('0x3b')]=qs['filters'](_['pick'](_0x17916e[_0x6de6('0x32')],_0x5dcb8a[_0x6de6('0x34')]));_0x45d654[_0x6de6('0x69')]=!![];if(_0x17916e['query'][_0x6de6('0x3c')]){_0x45d654[_0x6de6('0x3b')]=_[_0x6de6('0x3e')](_0x45d654[_0x6de6('0x3b')],{'$or':_['map'](_0x45d654[_0x6de6('0x36')],function(_0x4e1437){var _0x29c26f={};_0x29c26f[_0x4e1437]={'$like':'%'+_0x17916e[_0x6de6('0x32')]['filter']+'%'};return _0x29c26f;})});}_0x45d654=_[_0x6de6('0x3e')]({},_0x45d654,_0x17916e[_0x6de6('0x3f')]);return _0x4fcf67[_0x6de6('0x63')](_0x45d654);}})[_0x6de6('0x24')](respondWithResult(_0x449504,null))[_0x6de6('0x48')](handleError(_0x449504,null));};exports[_0x6de6('0x6a')]=function(_0xea68aa,_0x3633e7,_0x429c05){var _0x1132a1;return db['CmList'][_0x6de6('0x47')]({'where':{'id':_0xea68aa[_0x6de6('0x44')]['id']},'include':[{'model':db[_0x6de6('0x64')],'as':'CustomFields'}]})[_0x6de6('0x24')](handleEntityNotFound(_0x3633e7,null))[_0x6de6('0x24')](function(_0xd334db){if(_0xd334db){_0x1132a1=_0xd334db;return db[_0x6de6('0x5e')][_0x6de6('0x2d')];}})[_0x6de6('0x24')](function(_0x2b15dc){if(_0x2b15dc){var _0x245283={};var _0xed20f3={};_0xed20f3[_0x6de6('0x31')]=_['concat'](_[_0x6de6('0x33')](_0x2b15dc),_[_0x6de6('0x2c')](_0x1132a1[_0x6de6('0x65')],function(_0x1084b6){return util['format'](_0x6de6('0x68'),_0x1084b6['id']);}));_0xed20f3['query']=_[_0x6de6('0x33')](_0xea68aa['query']);_0xed20f3[_0x6de6('0x34')]=_[_0x6de6('0x35')](_0xed20f3[_0x6de6('0x31')],_0xed20f3[_0x6de6('0x32')]);_0x245283[_0x6de6('0x36')]=_['intersection'](_0xed20f3[_0x6de6('0x31')],qs[_0x6de6('0x37')](_0xea68aa[_0x6de6('0x32')][_0x6de6('0x37')]));_0x245283[_0x6de6('0x36')]=_0x245283[_0x6de6('0x36')][_0x6de6('0x45')]?_0x245283[_0x6de6('0x36')]:_0xed20f3['model'];if(!_0xea68aa[_0x6de6('0x32')][_0x6de6('0x38')](_0x6de6('0x56'))){_0x245283['limit']=qs['limit'](_0xea68aa['query'][_0x6de6('0x20')]);_0x245283['offset']=qs[_0x6de6('0x1d')](_0xea68aa[_0x6de6('0x32')][_0x6de6('0x1d')]);}_0x245283[_0x6de6('0x39')]=qs['sort'](_0xea68aa[_0x6de6('0x32')][_0x6de6('0x3a')]);_0x245283[_0x6de6('0x3b')]=qs[_0x6de6('0x34')](_[_0x6de6('0x6b')](_0xea68aa[_0x6de6('0x32')],_0xed20f3['filters']));_0x245283['raw']=!![];if(_0xea68aa['query'][_0x6de6('0x3c')]){_0x245283[_0x6de6('0x3b')]=_[_0x6de6('0x3e')](_0x245283[_0x6de6('0x3b')],{'$or':_[_0x6de6('0x2c')](_0x245283[_0x6de6('0x36')],function(_0x53e4bb){var _0x1e4fd5={};_0x1e4fd5[_0x53e4bb]={'$like':'%'+_0xea68aa[_0x6de6('0x32')][_0x6de6('0x3c')]+'%'};return _0x1e4fd5;})});}_0x245283=_[_0x6de6('0x3e')]({},_0x245283,_0xea68aa['options']);return _0x1132a1[_0x6de6('0x63')](_0x245283);}})[_0x6de6('0x24')](function(_0x4668b3){if(!_[_0x6de6('0x6c')](_0x4668b3)){var _0x15a8d4=toCsv(_0x4668b3);var _0x194d33=Date['now']();fs[_0x6de6('0x6d')](util[_0x6de6('0x67')](_0x6de6('0x6e'),_0x1132a1['id'],_0x194d33),_0x15a8d4);_0x3633e7[_0x6de6('0x6f')](_0x6de6('0x70'),_0x6de6('0x71')+util[_0x6de6('0x67')](_0x6de6('0x72'),_0x1132a1['id'],_0x194d33));_0x3633e7[_0x6de6('0x6f')]('Content-type',_0x6de6('0x73'));return _0x3633e7[_0x6de6('0x74')](util['format'](_0x6de6('0x6e'),_0x1132a1['id'],_0x194d33));}else{return _0x3633e7[_0x6de6('0x1a')](0xcc);}})['catch'](handleError(_0x3633e7,null));};exports[_0x6de6('0x75')]=function(_0x434e09,_0xbbe3ef,_0x5c6ac1){var _0x34fe5a;delete _0x434e09[_0x6de6('0x50')]['id'];return db[_0x6de6('0x40')][_0x6de6('0x55')]({'where':{'id':_0x434e09[_0x6de6('0x44')]['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0xbbe3ef,null))[_0x6de6('0x24')](function(_0xa5bc62){if(_0xa5bc62){return db[_0x6de6('0x76')][_0x6de6('0x77')](function(_0x4ebd8d){return db[_0x6de6('0x64')][_0x6de6('0x4e')](_0x434e09['body'],{'transaction':_0x4ebd8d})['then'](function(_0x23ce1f){_0x34fe5a=_0x23ce1f;return _0xa5bc62[_0x6de6('0x78')](_0x23ce1f,{'transaction':_0x4ebd8d});})[_0x6de6('0x24')](function(){var _0x112bef={'type':db['Sequelize'][_0x6de6('0x79')],'transaction':_0x4ebd8d};switch(_0x434e09[_0x6de6('0x50')][_0x6de6('0x2f')]){case'text':_0x112bef[_0x6de6('0x2f')]=db[_0x6de6('0x7a')][_0x6de6('0x79')];break;case _0x6de6('0x7b'):_0x112bef['type']=db[_0x6de6('0x7a')][_0x6de6('0x7c')];break;case _0x6de6('0x7d'):_0x112bef[_0x6de6('0x2f')]=db[_0x6de6('0x7a')][_0x6de6('0x7e')];_0x112bef[_0x6de6('0x7f')]=![];break;default:}return db['sequelize']['queryInterface'][_0x6de6('0x80')](_0x6de6('0x81'),util[_0x6de6('0x67')](_0x6de6('0x82'),_0x34fe5a['id']),_0x112bef);})[_0x6de6('0x24')](function(){return _0x34fe5a;});});}})[_0x6de6('0x24')](respondWithResult(_0xbbe3ef,null))['catch'](handleError(_0xbbe3ef,null));};exports[_0x6de6('0x83')]=function(_0x1548c6,_0x556b47,_0x58d126){var _0x465042={};var _0x5c1ad8={};var _0x29225d;var _0x347ced;return db[_0x6de6('0x40')][_0x6de6('0x55')]({'where':{'id':_0x1548c6[_0x6de6('0x44')]['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0x556b47,null))[_0x6de6('0x24')](function(_0x3dcfb8){if(_0x3dcfb8){_0x29225d=_0x3dcfb8;_0x5c1ad8[_0x6de6('0x31')]=_['keys'](db[_0x6de6('0x64')][_0x6de6('0x2d')]);_0x5c1ad8[_0x6de6('0x32')]=_[_0x6de6('0x33')](_0x1548c6[_0x6de6('0x32')]);_0x5c1ad8['filters']=_[_0x6de6('0x35')](_0x5c1ad8[_0x6de6('0x31')],_0x5c1ad8[_0x6de6('0x32')]);_0x465042['attributes']=_[_0x6de6('0x35')](_0x5c1ad8['model'],qs[_0x6de6('0x37')](_0x1548c6[_0x6de6('0x32')][_0x6de6('0x37')]));_0x465042[_0x6de6('0x36')]=_0x465042[_0x6de6('0x36')][_0x6de6('0x45')]?_0x465042['attributes']:_0x5c1ad8['model'];_0x465042[_0x6de6('0x39')]=qs['sort'](_0x1548c6[_0x6de6('0x32')][_0x6de6('0x3a')]);_0x465042[_0x6de6('0x3b')]=qs[_0x6de6('0x34')](_[_0x6de6('0x6b')](_0x1548c6['query'],_0x5c1ad8['filters']));_0x465042[_0x6de6('0x3b')]=_[_0x6de6('0x3e')](_0x465042['where'],{'$or':[{'ListId':_0x3dcfb8['id']},{'ListId':null}]});if(_0x1548c6[_0x6de6('0x32')]['filter']){_0x465042[_0x6de6('0x3b')]=_[_0x6de6('0x3e')](_0x465042['where'],{'$or':_['map'](_0x465042[_0x6de6('0x36')],function(_0x2226bb){var _0x38742a={};_0x38742a[_0x2226bb]={'$like':'%'+_0x1548c6[_0x6de6('0x32')][_0x6de6('0x3c')]+'%'};return _0x38742a;})});}_0x465042=_[_0x6de6('0x3e')]({},_0x465042,_0x1548c6['options']);return db[_0x6de6('0x64')]['findAndCountAll'](_0x465042);}})[_0x6de6('0x24')](respondWithResult(_0x556b47,null))['catch'](handleError(_0x556b47,null));};exports[_0x6de6('0x84')]=function(_0x6456e0,_0x39bc5f,_0x209a70){return db['CmList']['find']({'where':{'id':_0x6456e0['params']['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0x39bc5f,null))[_0x6de6('0x24')](function(_0x550277){if(_0x550277){return _0x550277['addAgents'](_0x6456e0[_0x6de6('0x50')]['ids'],_[_0x6de6('0x5f')](_0x6456e0[_0x6de6('0x50')],[_0x6de6('0x59'),'id'])||{})[_0x6de6('0x85')](function(_0xd612c2){for(var _0xa36793=0x0;_0xa36793<_0x6456e0['body'][_0x6de6('0x59')][_0x6de6('0x45')];_0xa36793+=0x1){socket['emit'](_0x6de6('0x86'),{'UserId':Number(_0x6456e0[_0x6de6('0x50')]['ids'][_0xa36793]),'CmListId':Number(_0x6456e0[_0x6de6('0x44')]['id'])});}return _0xd612c2;});}})[_0x6de6('0x24')](respondWithResult(_0x39bc5f,null))[_0x6de6('0x48')](handleError(_0x39bc5f,null));};exports[_0x6de6('0x87')]=function(_0x257aa3,_0x7b5200,_0x5a6796){return db[_0x6de6('0x40')]['find']({'where':{'id':_0x257aa3['params']['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0x7b5200,null))[_0x6de6('0x24')](function(_0x364693){if(_0x364693){return _0x364693[_0x6de6('0x87')](_0x257aa3['query'][_0x6de6('0x59')])['then'](function(){if(_[_0x6de6('0x5b')](_0x257aa3['query'][_0x6de6('0x59')])){for(var _0x36258e=0x0;_0x36258e<_0x257aa3[_0x6de6('0x32')][_0x6de6('0x59')]['length'];_0x36258e+=0x1){socket[_0x6de6('0x88')](_0x6de6('0x89'),{'UserId':Number(_0x257aa3[_0x6de6('0x32')]['ids'][_0x36258e]),'CmListId':Number(_0x257aa3[_0x6de6('0x44')]['id'])});}}else{socket[_0x6de6('0x88')](_0x6de6('0x89'),{'UserId':Number(_0x257aa3['query']['ids']),'CmListId':Number(_0x257aa3[_0x6de6('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x7b5200,null))[_0x6de6('0x48')](handleError(_0x7b5200,null));};exports['getAgents']=function(_0x2f5463,_0x260fa4,_0x59e115){var _0x59a050={};var _0x22dc86={};var _0x4fc6fd;var _0x4bda43;return db['CmList'][_0x6de6('0x55')]({'where':{'id':_0x2f5463[_0x6de6('0x44')]['id']}})[_0x6de6('0x24')](handleEntityNotFound(_0x260fa4,null))[_0x6de6('0x24')](function(_0x1885d7){if(_0x1885d7){_0x4fc6fd=_0x1885d7;_0x22dc86['model']=_[_0x6de6('0x33')](db[_0x6de6('0x8a')][_0x6de6('0x2d')]);_0x22dc86['query']=_['keys'](_0x2f5463[_0x6de6('0x32')]);_0x22dc86[_0x6de6('0x34')]=_[_0x6de6('0x35')](_0x22dc86[_0x6de6('0x31')],_0x22dc86['query']);_0x59a050[_0x6de6('0x36')]=_[_0x6de6('0x35')](_0x22dc86[_0x6de6('0x31')],qs[_0x6de6('0x37')](_0x2f5463['query'][_0x6de6('0x37')]));_0x59a050[_0x6de6('0x36')]=_0x59a050[_0x6de6('0x36')]['length']?_0x59a050[_0x6de6('0x36')]:_0x22dc86['model'];_0x59a050['order']=qs['sort'](_0x2f5463[_0x6de6('0x32')][_0x6de6('0x3a')]);_0x59a050[_0x6de6('0x3b')]=qs[_0x6de6('0x34')](_[_0x6de6('0x6b')](_0x2f5463[_0x6de6('0x32')],_0x22dc86['filters']));if(_0x2f5463['query'][_0x6de6('0x3c')]){_0x59a050[_0x6de6('0x3b')]=_[_0x6de6('0x3e')](_0x59a050[_0x6de6('0x3b')],{'$or':_['map'](_0x59a050[_0x6de6('0x36')],function(_0x1b9928){var _0x597cb0={};_0x597cb0[_0x1b9928]={'$like':'%'+_0x2f5463[_0x6de6('0x32')]['filter']+'%'};return _0x597cb0;})});}_0x59a050=_[_0x6de6('0x3e')]({},_0x59a050,_0x2f5463['options']);return _0x4fc6fd[_0x6de6('0x8b')](_0x59a050);}})[_0x6de6('0x24')](function(_0x29b1ea){if(_0x29b1ea){_0x4bda43=_0x29b1ea[_0x6de6('0x45')];if(!_0x2f5463['query'][_0x6de6('0x38')]('nolimit')){_0x59a050['limit']=qs['limit'](_0x2f5463[_0x6de6('0x32')][_0x6de6('0x20')]);_0x59a050['offset']=qs[_0x6de6('0x1d')](_0x2f5463[_0x6de6('0x32')][_0x6de6('0x1d')]);}return _0x4fc6fd[_0x6de6('0x8b')](_0x59a050);}})['then'](function(_0x5158da){if(_0x5158da){return _0x5158da?{'count':_0x4bda43,'rows':_0x5158da}:null;}})[_0x6de6('0x24')](respondWithResult(_0x260fa4,null))[_0x6de6('0x48')](handleError(_0x260fa4,null));}; \ No newline at end of file +var _0xdc55=['omit','spread','emit','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','get','Lists','error','stack','name','index','map','CmList','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','ids','CmContact','tags','isArray','push','each','success','dataValues','errors','message','Malformed\x20request\x20syntax','CustomFields','concat','format','cf_%d','nolimit','getContactsCsv','CmCustomField','raw','getContacts','now','writeFileSync','setHeader','attachment;\x20filename=','Content-type','text/csv','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','type','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%s','findAndCountAll','addAgents'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0xdc55,0x123));var _0x5dc5=function(_0x475d84,_0x106eab){_0x475d84=_0x475d84-0x0;var _0x304f4f=_0xdc55[_0x475d84];return _0x304f4f;};'use strict';var emlformat=require(_0x5dc5('0x0'));var rimraf=require(_0x5dc5('0x1'));var zipdir=require(_0x5dc5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5dc5('0x3'));var moment=require(_0x5dc5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5dc5('0x5'));var util=require(_0x5dc5('0x6'));var path=require('path');var sox=require(_0x5dc5('0x7'));var csv=require(_0x5dc5('0x8'));var ejs=require(_0x5dc5('0x9'));var fs=require('fs');var fs_extra=require(_0x5dc5('0xa'));var _=require(_0x5dc5('0xb'));var squel=require(_0x5dc5('0xc'));var crypto=require(_0x5dc5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dc5('0xe'));var toCsv=require(_0x5dc5('0x8'));var querystring=require(_0x5dc5('0xf'));var Papa=require(_0x5dc5('0x10'));var Redis=require('ioredis');var authService=require(_0x5dc5('0x11'));var qs=require(_0x5dc5('0x12'));var as=require(_0x5dc5('0x13'));var hardwareService=require(_0x5dc5('0x14'));var logger=require('../../config/logger')(_0x5dc5('0x15'));var utils=require(_0x5dc5('0x16'));var config=require(_0x5dc5('0x17'));var licenseUtil=require(_0x5dc5('0x18'));var db=require(_0x5dc5('0x19'))['db'];config[_0x5dc5('0x1a')]=_['defaults'](config[_0x5dc5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x5dc5('0x1b'))(new Redis(config[_0x5dc5('0x1a')]));require(_0x5dc5('0x1c'))[_0x5dc5('0x1d')](socket);function respondWithStatusCode(_0x10cc22,_0x3f7383){_0x3f7383=_0x3f7383||0xcc;return function(_0x56263a){if(_0x56263a){return _0x10cc22[_0x5dc5('0x1e')](_0x3f7383);}return _0x10cc22[_0x5dc5('0x1f')](_0x3f7383)[_0x5dc5('0x20')]();};}function respondWithResult(_0x1dcd74,_0x3387d1){_0x3387d1=_0x3387d1||0xc8;return function(_0xe556f7){if(_0xe556f7){return _0x1dcd74[_0x5dc5('0x1f')](_0x3387d1)[_0x5dc5('0x21')](_0xe556f7);}};}function respondWithFilteredResult(_0x2adbd6,_0x1a0b9b){return function(_0x2ba489){if(_0x2ba489){var _0x431362=typeof _0x1a0b9b[_0x5dc5('0x22')]===_0x5dc5('0x23')&&typeof _0x1a0b9b[_0x5dc5('0x24')]===_0x5dc5('0x23');var _0x146711=_0x2ba489['count'];var _0x5b8b8b=_0x431362?0x0:_0x1a0b9b[_0x5dc5('0x22')];var _0xc4f2dd=_0x431362?_0x2ba489[_0x5dc5('0x25')]:_0x1a0b9b[_0x5dc5('0x22')]+_0x1a0b9b[_0x5dc5('0x24')];var _0x5b0ae6;if(_0xc4f2dd>=_0x146711){_0xc4f2dd=_0x146711;_0x5b0ae6=0xc8;}else{_0x5b0ae6=0xce;}_0x2adbd6[_0x5dc5('0x1f')](_0x5b0ae6);return _0x2adbd6[_0x5dc5('0x26')]('Content-Range',_0x5b8b8b+'-'+_0xc4f2dd+'/'+_0x146711)['json'](_0x2ba489);}return null;};}function patchUpdates(_0x315f0d){return function(_0x20564a){try{jsonpatch[_0x5dc5('0x27')](_0x20564a,_0x315f0d,!![]);}catch(_0x46133e){return BPromise['reject'](_0x46133e);}return _0x20564a[_0x5dc5('0x28')]();};}function saveUpdates(_0x22cb5d,_0x52c624){return function(_0x149d7f){if(_0x149d7f){return _0x149d7f[_0x5dc5('0x29')](_0x22cb5d)[_0x5dc5('0x2a')](function(_0x4504d3){return _0x4504d3;});}return null;};}function removeEntity(_0x41570b,_0x298050){return function(_0x4a9187){if(_0x4a9187){return _0x4a9187[_0x5dc5('0x2b')]()[_0x5dc5('0x2a')](function(){var _0x5236d7=_0x4a9187[_0x5dc5('0x2c')]({'plain':!![]});var _0x253d29=_0x5dc5('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x253d29,'resourceId':_0x5236d7['id']}})[_0x5dc5('0x2a')](function(){return _0x4a9187;});})[_0x5dc5('0x2a')](function(){_0x41570b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d4ce1,_0x422371){return function(_0x123e9b){if(!_0x123e9b){_0x5d4ce1[_0x5dc5('0x1e')](0x194);}return _0x123e9b;};}function handleError(_0x3f5e63,_0xae2490){_0xae2490=_0xae2490||0x1f4;return function(_0x1b5196){logger[_0x5dc5('0x2e')](_0x1b5196[_0x5dc5('0x2f')]);if(_0x1b5196[_0x5dc5('0x30')]){delete _0x1b5196[_0x5dc5('0x30')];}_0x3f5e63[_0x5dc5('0x1f')](_0xae2490)['send'](_0x1b5196);};}exports[_0x5dc5('0x31')]=function(_0x4256ee,_0xb25c93){var _0x4c7c7f={},_0x35f6a1={},_0x41eda0={'count':0x0,'rows':[]};var _0x1dae41=_[_0x5dc5('0x32')](db[_0x5dc5('0x33')]['rawAttributes'],function(_0x370921){return{'name':_0x370921['fieldName'],'type':_0x370921['type'][_0x5dc5('0x34')]};});_0x35f6a1[_0x5dc5('0x35')]=_['map'](_0x1dae41,_0x5dc5('0x30'));_0x35f6a1[_0x5dc5('0x36')]=_[_0x5dc5('0x37')](_0x4256ee[_0x5dc5('0x36')]);_0x35f6a1[_0x5dc5('0x38')]=_['intersection'](_0x35f6a1[_0x5dc5('0x35')],_0x35f6a1[_0x5dc5('0x36')]);_0x4c7c7f[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x35f6a1[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x4c7c7f[_0x5dc5('0x39')]=_0x4c7c7f[_0x5dc5('0x39')][_0x5dc5('0x3c')]?_0x4c7c7f[_0x5dc5('0x39')]:_0x35f6a1['model'];if(!_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x3d')]('nolimit')){_0x4c7c7f[_0x5dc5('0x24')]=qs[_0x5dc5('0x24')](_0x4256ee['query'][_0x5dc5('0x24')]);_0x4c7c7f[_0x5dc5('0x22')]=qs[_0x5dc5('0x22')](_0x4256ee['query'][_0x5dc5('0x22')]);}_0x4c7c7f[_0x5dc5('0x3e')]=qs['sort'](_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x3f')]);_0x4c7c7f['where']=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x4256ee[_0x5dc5('0x36')],_0x35f6a1['filters']),_0x1dae41);if(_0x4256ee['query'][_0x5dc5('0x41')]){_0x4c7c7f[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x4c7c7f['where'],{'$or':_[_0x5dc5('0x32')](_0x1dae41,function(_0x59cacc){if(_0x59cacc['type']!==_0x5dc5('0x44')){var _0x1e545a={};_0x1e545a[_0x59cacc[_0x5dc5('0x30')]]={'$like':'%'+_0x4256ee[_0x5dc5('0x36')]['filter']+'%'};return _0x1e545a;}})});}_0x4c7c7f=_[_0x5dc5('0x43')]({},_0x4c7c7f,_0x4256ee[_0x5dc5('0x45')]);var _0x591ee2={'where':_0x4c7c7f['where']};return db[_0x5dc5('0x33')][_0x5dc5('0x25')](_0x591ee2)[_0x5dc5('0x2a')](function(_0x4bda32){_0x41eda0[_0x5dc5('0x25')]=_0x4bda32;if(_0x4256ee[_0x5dc5('0x36')][_0x5dc5('0x46')]){_0x4c7c7f[_0x5dc5('0x47')]=[{'all':!![]}];}return db['CmList'][_0x5dc5('0x48')](_0x4c7c7f);})[_0x5dc5('0x2a')](function(_0x1c3a63){_0x41eda0[_0x5dc5('0x49')]=_0x1c3a63;return _0x41eda0;})[_0x5dc5('0x2a')](respondWithFilteredResult(_0xb25c93,_0x4c7c7f))[_0x5dc5('0x4a')](handleError(_0xb25c93,null));};exports['show']=function(_0xd5f20c,_0x2b718e){var _0x281f90={'raw':![],'where':{'id':_0xd5f20c[_0x5dc5('0x4b')]['id']}},_0x37b0ae={};_0x37b0ae[_0x5dc5('0x35')]=_[_0x5dc5('0x37')](db[_0x5dc5('0x33')][_0x5dc5('0x4c')]);_0x37b0ae[_0x5dc5('0x36')]=_['keys'](_0xd5f20c[_0x5dc5('0x36')]);_0x37b0ae[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x37b0ae[_0x5dc5('0x35')],_0x37b0ae['query']);_0x281f90[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x37b0ae[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0xd5f20c['query']['fields']));_0x281f90[_0x5dc5('0x39')]=_0x281f90['attributes'][_0x5dc5('0x3c')]?_0x281f90['attributes']:_0x37b0ae[_0x5dc5('0x35')];if(_0xd5f20c[_0x5dc5('0x36')]['includeAll']){_0x281f90['include']=[{'all':!![]}];}_0x281f90=_[_0x5dc5('0x43')]({},_0x281f90,_0xd5f20c[_0x5dc5('0x45')]);return db[_0x5dc5('0x33')][_0x5dc5('0x4d')](_0x281f90)[_0x5dc5('0x2a')](handleEntityNotFound(_0x2b718e,null))[_0x5dc5('0x2a')](respondWithResult(_0x2b718e,null))['catch'](handleError(_0x2b718e,null));};exports[_0x5dc5('0x4e')]=function(_0x269b72,_0x1542db){return db[_0x5dc5('0x33')][_0x5dc5('0x4e')](_0x269b72[_0x5dc5('0x4f')],{})[_0x5dc5('0x2a')](function(_0x3a0195){var _0x86e36c=_0x269b72[_0x5dc5('0x50')][_0x5dc5('0x2c')]({'plain':!![]});if(!_0x86e36c)throw new Error(_0x5dc5('0x51'));if(_0x86e36c['role']===_0x5dc5('0x50')){var _0x54729e=_0x3a0195[_0x5dc5('0x2c')]({'plain':!![]});var _0x426f52=_0x5dc5('0x2d');return db['UserProfileSection'][_0x5dc5('0x4d')]({'where':{'name':_0x426f52,'userProfileId':_0x86e36c[_0x5dc5('0x52')]},'raw':!![]})[_0x5dc5('0x2a')](function(_0x5c7bcf){if(_0x5c7bcf&&_0x5c7bcf['autoAssociation']===0x0){return db[_0x5dc5('0x53')]['create']({'name':_0x54729e[_0x5dc5('0x30')],'resourceId':_0x54729e['id'],'type':_0x5c7bcf[_0x5dc5('0x30')],'sectionId':_0x5c7bcf['id']},{})[_0x5dc5('0x2a')](function(){return _0x3a0195;});}else{return _0x3a0195;}})[_0x5dc5('0x4a')](function(_0x56cc70){logger['error'](_0x5dc5('0x54'),_0x56cc70);throw _0x56cc70;});}return _0x3a0195;})[_0x5dc5('0x2a')](respondWithResult(_0x1542db,0xc9))[_0x5dc5('0x4a')](handleError(_0x1542db,null));};exports['update']=function(_0x143f4c,_0x31aedd){if(_0x143f4c[_0x5dc5('0x4f')]['id']){delete _0x143f4c[_0x5dc5('0x4f')]['id'];}return db[_0x5dc5('0x33')]['find']({'where':{'id':_0x143f4c[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x31aedd,null))[_0x5dc5('0x2a')](saveUpdates(_0x143f4c[_0x5dc5('0x4f')],null))[_0x5dc5('0x2a')](respondWithResult(_0x31aedd,null))[_0x5dc5('0x4a')](handleError(_0x31aedd,null));};exports[_0x5dc5('0x2b')]=function(_0x11332e,_0x36ca75){return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x11332e[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x36ca75,null))[_0x5dc5('0x2a')](removeEntity(_0x36ca75,null))[_0x5dc5('0x4a')](handleError(_0x36ca75,null));};exports[_0x5dc5('0x55')]=function(_0x34ded0,_0x536ad5){return db[_0x5dc5('0x33')][_0x5dc5('0x55')]()[_0x5dc5('0x2a')](respondWithResult(_0x536ad5,null))[_0x5dc5('0x4a')](handleError(_0x536ad5,null));};exports[_0x5dc5('0x56')]=function(_0x2f86c6,_0x550d0c,_0x3ea116){if(_0x2f86c6['body']['id']){delete _0x2f86c6[_0x5dc5('0x4f')]['id'];}return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x2f86c6[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x550d0c,null))[_0x5dc5('0x2a')](function(_0x395d8e){if(_0x395d8e){_0x2f86c6[_0x5dc5('0x4f')][_0x5dc5('0x57')]=_0x395d8e['id'];return db[_0x5dc5('0x58')][_0x5dc5('0x4e')](_0x2f86c6[_0x5dc5('0x4f')]);}})[_0x5dc5('0x2a')](respondWithResult(_0x550d0c,null))[_0x5dc5('0x4a')](handleError(_0x550d0c,null));};exports['getDispositions']=function(_0x1b3ccf,_0x3f9fdb,_0x327c0f){var _0x23bf78={'raw':![],'where':{}};var _0x4694e3={};var _0x404f1e={'count':0x0,'rows':[]};return db[_0x5dc5('0x33')][_0x5dc5('0x59')]({'where':{'id':_0x1b3ccf[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x3f9fdb,null))[_0x5dc5('0x2a')](function(_0x1e8e1a){if(_0x1e8e1a){_0x4694e3[_0x5dc5('0x35')]=_[_0x5dc5('0x37')](db[_0x5dc5('0x58')][_0x5dc5('0x4c')]);_0x4694e3[_0x5dc5('0x36')]=_['keys'](_0x1b3ccf[_0x5dc5('0x36')]);_0x4694e3['filters']=_[_0x5dc5('0x3a')](_0x4694e3[_0x5dc5('0x35')],_0x4694e3[_0x5dc5('0x36')]);_0x23bf78[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x4694e3[_0x5dc5('0x35')],qs['fields'](_0x1b3ccf['query'][_0x5dc5('0x3b')]));_0x23bf78[_0x5dc5('0x39')]=_0x23bf78[_0x5dc5('0x39')]['length']?_0x23bf78['attributes']:_0x4694e3[_0x5dc5('0x35')];if(!_0x1b3ccf['query'][_0x5dc5('0x3d')]('nolimit')){_0x23bf78[_0x5dc5('0x24')]=qs[_0x5dc5('0x24')](_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x24')]);_0x23bf78[_0x5dc5('0x22')]=qs['offset'](_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x22')]);}_0x23bf78[_0x5dc5('0x3e')]=qs['sort'](_0x1b3ccf['query'][_0x5dc5('0x3f')]);_0x23bf78[_0x5dc5('0x42')]=qs[_0x5dc5('0x38')](_['pick'](_0x1b3ccf[_0x5dc5('0x36')],_0x4694e3[_0x5dc5('0x38')]));_0x23bf78[_0x5dc5('0x42')][_0x5dc5('0x57')]=_0x1e8e1a['id'];if(_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x23bf78[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x23bf78[_0x5dc5('0x42')],{'$or':_['map'](_0x23bf78['attributes'],function(_0x4b01cc){var _0x5df7f0={};_0x5df7f0[_0x4b01cc]={'$like':'%'+_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x5df7f0;})});}_0x23bf78=_['merge']({},_0x23bf78,_0x1b3ccf[_0x5dc5('0x45')]);return db[_0x5dc5('0x58')][_0x5dc5('0x25')]({'where':_0x23bf78[_0x5dc5('0x42')]})[_0x5dc5('0x2a')](function(_0x4851ee){_0x404f1e['count']=_0x4851ee;if(_0x1b3ccf[_0x5dc5('0x36')][_0x5dc5('0x46')]){_0x23bf78[_0x5dc5('0x47')]=[{'all':!![]}];}return db[_0x5dc5('0x58')][_0x5dc5('0x48')](_0x23bf78);})[_0x5dc5('0x2a')](function(_0x361ab1){_0x404f1e['rows']=_0x361ab1;return _0x404f1e;});}})[_0x5dc5('0x2a')](respondWithFilteredResult(_0x3f9fdb,_0x23bf78))['catch'](handleError(_0x3f9fdb,null));};exports[_0x5dc5('0x5a')]=function(_0x53ac06,_0x55530a,_0x41cf1f){return db['CmList'][_0x5dc5('0x4d')]({'where':{'id':_0x53ac06[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x55530a,null))['then'](function(_0x4a5c53){if(_0x4a5c53){return _0x4a5c53[_0x5dc5('0x5a')](_0x53ac06['query'][_0x5dc5('0x5b')]);}})[_0x5dc5('0x2a')](respondWithStatusCode(_0x55530a,null))[_0x5dc5('0x4a')](handleError(_0x55530a,null));};exports['addContacts']=function(_0x2a6e47,_0x45a967,_0x3c64b6){return db[_0x5dc5('0x33')]['find']({'where':{'id':_0x2a6e47[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x45a967,null))[_0x5dc5('0x2a')](function(_0x47332f){if(_0x47332f){var _0x24de25=[];var _0x32ea03={'success':[],'errors':[]};return db[_0x5dc5('0x5c')][_0x5dc5('0x55')]()[_0x5dc5('0x2a')](function(_0x1c0aff){if(_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')]&&_['isArray'](_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')])){if(_0x2a6e47['body'][_0x5dc5('0x5d')][_0x5dc5('0x3c')]){_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')]=_0x2a6e47['body'][_0x5dc5('0x5d')]['join'](';')+';';}else{_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x5d')]=null;}}else{_0x2a6e47['body']['tags']=null;}if(_0x2a6e47['body']&&_[_0x5dc5('0x5e')](_0x2a6e47[_0x5dc5('0x4f')])){for(var _0x1fa0c8=0x0;_0x1fa0c8<_0x2a6e47[_0x5dc5('0x4f')][_0x5dc5('0x3c')];_0x1fa0c8+=0x1){_0x2a6e47['body'][_0x1fa0c8][_0x5dc5('0x57')]=_0x2a6e47[_0x5dc5('0x4b')]['id'];_0x24de25[_0x5dc5('0x5f')](_0x2a6e47[_0x5dc5('0x4f')][_0x1fa0c8]);}return BPromise[_0x5dc5('0x60')](_0x24de25,function(_0x3e4261){return db[_0x5dc5('0x5c')][_0x5dc5('0x4e')](_['omit'](_0x3e4261,[_0x5dc5('0x5b'),'id'])||{},{'fields':_[_0x5dc5('0x37')](_0x1c0aff),'raw':!![]})[_0x5dc5('0x2a')](function(_0x35ec12){_0x32ea03[_0x5dc5('0x61')][_0x5dc5('0x5f')](_0x35ec12[_0x5dc5('0x62')]);})[_0x5dc5('0x4a')](function(_0x23a99e){_0x32ea03[_0x5dc5('0x63')][_0x5dc5('0x5f')]({'data':_0x3e4261,'error':_0x23a99e[_0x5dc5('0x64')]});});})[_0x5dc5('0x2a')](function(_0x51ee58){return _0x32ea03;})[_0x5dc5('0x4a')](function(_0x2dfed9){return _0x2dfed9;});}else{_0x45a967[_0x5dc5('0x1f')](0x190)[_0x5dc5('0x21')]({'message':_0x5dc5('0x65')});}});}})[_0x5dc5('0x2a')](respondWithResult(_0x45a967,null))[_0x5dc5('0x4a')](handleError(_0x45a967,null));};exports['getContacts']=function(_0x4aafc7,_0x5735dc,_0x574457){var _0x4070b0;return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x4aafc7[_0x5dc5('0x4b')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x5dc5('0x66')}]})[_0x5dc5('0x2a')](handleEntityNotFound(_0x5735dc,null))['then'](function(_0x5ebc93){if(_0x5ebc93){_0x4070b0=_0x5ebc93;return db['CmContact']['rawAttributes'];}})[_0x5dc5('0x2a')](function(_0x5c596c){if(_0x5c596c){var _0x188ead={};var _0x2574a6={};_0x2574a6['model']=_[_0x5dc5('0x67')](_[_0x5dc5('0x37')](_0x5c596c),_['map'](_0x4070b0[_0x5dc5('0x66')],function(_0x3b815c){return util[_0x5dc5('0x68')](_0x5dc5('0x69'),_0x3b815c['id']);}));_0x2574a6[_0x5dc5('0x36')]=_[_0x5dc5('0x37')](_0x4aafc7[_0x5dc5('0x36')]);_0x2574a6['filters']=_['intersection'](_0x2574a6['model'],_0x2574a6[_0x5dc5('0x36')]);_0x188ead['attributes']=_[_0x5dc5('0x3a')](_0x2574a6[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x4aafc7[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x188ead[_0x5dc5('0x39')]=_0x188ead[_0x5dc5('0x39')][_0x5dc5('0x3c')]?_0x188ead[_0x5dc5('0x39')]:_0x2574a6[_0x5dc5('0x35')];if(!_0x4aafc7['query']['hasOwnProperty'](_0x5dc5('0x6a'))){_0x188ead[_0x5dc5('0x24')]=qs['limit'](_0x4aafc7['query'][_0x5dc5('0x24')]);_0x188ead['offset']=qs['offset'](_0x4aafc7['query'][_0x5dc5('0x22')]);}_0x188ead[_0x5dc5('0x3e')]=qs[_0x5dc5('0x3f')](_0x4aafc7['query'][_0x5dc5('0x3f')]);_0x188ead[_0x5dc5('0x42')]=qs[_0x5dc5('0x38')](_['pick'](_0x4aafc7[_0x5dc5('0x36')],_0x2574a6[_0x5dc5('0x38')]));_0x188ead['raw']=!![];if(_0x4aafc7['query']['filter']){_0x188ead[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x188ead[_0x5dc5('0x42')],{'$or':_[_0x5dc5('0x32')](_0x188ead[_0x5dc5('0x39')],function(_0x5d59fc){var _0x2f30af={};_0x2f30af[_0x5d59fc]={'$like':'%'+_0x4aafc7[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x2f30af;})});}_0x188ead=_[_0x5dc5('0x43')]({},_0x188ead,_0x4aafc7[_0x5dc5('0x45')]);return _0x4070b0['getContacts'](_0x188ead);}})[_0x5dc5('0x2a')](respondWithResult(_0x5735dc,null))[_0x5dc5('0x4a')](handleError(_0x5735dc,null));};exports[_0x5dc5('0x6b')]=function(_0x4dd445,_0xccf344,_0x43eb2f){var _0x78f036;return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x4dd445[_0x5dc5('0x4b')]['id']},'include':[{'model':db[_0x5dc5('0x6c')],'as':_0x5dc5('0x66')}]})[_0x5dc5('0x2a')](handleEntityNotFound(_0xccf344,null))['then'](function(_0x353066){if(_0x353066){_0x78f036=_0x353066;return db[_0x5dc5('0x5c')]['rawAttributes'];}})[_0x5dc5('0x2a')](function(_0x460d90){if(_0x460d90){var _0x5c3813={};var _0x1a0f6a={};_0x1a0f6a[_0x5dc5('0x35')]=_['concat'](_[_0x5dc5('0x37')](_0x460d90),_[_0x5dc5('0x32')](_0x78f036[_0x5dc5('0x66')],function(_0x4dc011){return util[_0x5dc5('0x68')](_0x5dc5('0x69'),_0x4dc011['id']);}));_0x1a0f6a['query']=_[_0x5dc5('0x37')](_0x4dd445[_0x5dc5('0x36')]);_0x1a0f6a[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x1a0f6a[_0x5dc5('0x35')],_0x1a0f6a[_0x5dc5('0x36')]);_0x5c3813['attributes']=_[_0x5dc5('0x3a')](_0x1a0f6a[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x5c3813['attributes']=_0x5c3813[_0x5dc5('0x39')]['length']?_0x5c3813[_0x5dc5('0x39')]:_0x1a0f6a[_0x5dc5('0x35')];if(!_0x4dd445['query'][_0x5dc5('0x3d')](_0x5dc5('0x6a'))){_0x5c3813[_0x5dc5('0x24')]=qs['limit'](_0x4dd445['query']['limit']);_0x5c3813['offset']=qs[_0x5dc5('0x22')](_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x22')]);}_0x5c3813[_0x5dc5('0x3e')]=qs[_0x5dc5('0x3f')](_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x3f')]);_0x5c3813['where']=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x4dd445[_0x5dc5('0x36')],_0x1a0f6a[_0x5dc5('0x38')]));_0x5c3813[_0x5dc5('0x6d')]=!![];if(_0x4dd445[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x5c3813['where']=_['merge'](_0x5c3813[_0x5dc5('0x42')],{'$or':_['map'](_0x5c3813[_0x5dc5('0x39')],function(_0x480d66){var _0x47b974={};_0x47b974[_0x480d66]={'$like':'%'+_0x4dd445['query'][_0x5dc5('0x41')]+'%'};return _0x47b974;})});}_0x5c3813=_['merge']({},_0x5c3813,_0x4dd445[_0x5dc5('0x45')]);return _0x78f036[_0x5dc5('0x6e')](_0x5c3813);}})['then'](function(_0x4ab455){if(!_['isEmpty'](_0x4ab455)){var _0x129a6f=toCsv(_0x4ab455);var _0x3ef645=Date[_0x5dc5('0x6f')]();fs[_0x5dc5('0x70')](util[_0x5dc5('0x68')]('/tmp/list_%d_%s.csv',_0x78f036['id'],_0x3ef645),_0x129a6f);_0xccf344[_0x5dc5('0x71')]('Content-disposition',_0x5dc5('0x72')+util[_0x5dc5('0x68')]('list_%d_%s.csv',_0x78f036['id'],_0x3ef645));_0xccf344[_0x5dc5('0x71')](_0x5dc5('0x73'),_0x5dc5('0x74'));return _0xccf344['download'](util[_0x5dc5('0x68')](_0x5dc5('0x75'),_0x78f036['id'],_0x3ef645));}else{return _0xccf344[_0x5dc5('0x1e')](0xcc);}})['catch'](handleError(_0xccf344,null));};exports[_0x5dc5('0x76')]=function(_0xb115d6,_0x3e2a1c,_0x1fd598){var _0xf4b66c;delete _0xb115d6[_0x5dc5('0x4f')]['id'];return db['CmList'][_0x5dc5('0x59')]({'where':{'id':_0xb115d6[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x3e2a1c,null))[_0x5dc5('0x2a')](function(_0x5369f3){if(_0x5369f3){return db[_0x5dc5('0x77')][_0x5dc5('0x78')](function(_0x8c604c){return db[_0x5dc5('0x6c')][_0x5dc5('0x4e')](_0xb115d6[_0x5dc5('0x4f')],{'transaction':_0x8c604c})[_0x5dc5('0x2a')](function(_0x1307f7){_0xf4b66c=_0x1307f7;return _0x5369f3[_0x5dc5('0x79')](_0x1307f7,{'transaction':_0x8c604c});})[_0x5dc5('0x2a')](function(){var _0x52fde7={'type':db[_0x5dc5('0x7a')][_0x5dc5('0x7b')],'transaction':_0x8c604c};switch(_0xb115d6[_0x5dc5('0x4f')][_0x5dc5('0x7c')]){case _0x5dc5('0x7d'):_0x52fde7['type']=db[_0x5dc5('0x7a')]['TEXT'];break;case _0x5dc5('0x7e'):_0x52fde7[_0x5dc5('0x7c')]=db['Sequelize'][_0x5dc5('0x7f')];break;case _0x5dc5('0x80'):_0x52fde7['type']=db[_0x5dc5('0x7a')][_0x5dc5('0x81')];_0x52fde7[_0x5dc5('0x82')]=![];break;default:}return db[_0x5dc5('0x77')]['queryInterface'][_0x5dc5('0x83')]('cm_contacts',util[_0x5dc5('0x68')](_0x5dc5('0x84'),_0xf4b66c['id']),_0x52fde7);})[_0x5dc5('0x2a')](function(){return _0xf4b66c;});});}})[_0x5dc5('0x2a')](respondWithResult(_0x3e2a1c,null))['catch'](handleError(_0x3e2a1c,null));};exports['getCustomFields']=function(_0x7a5b64,_0x48c65f,_0x7e888b){var _0x2925f5={};var _0x27fe42={};var _0x59a2ba;var _0x58d8b4;return db[_0x5dc5('0x33')][_0x5dc5('0x59')]({'where':{'id':_0x7a5b64['params']['id']}})['then'](handleEntityNotFound(_0x48c65f,null))[_0x5dc5('0x2a')](function(_0x3985cf){if(_0x3985cf){_0x59a2ba=_0x3985cf;_0x27fe42[_0x5dc5('0x35')]=_['keys'](db[_0x5dc5('0x6c')][_0x5dc5('0x4c')]);_0x27fe42['query']=_[_0x5dc5('0x37')](_0x7a5b64[_0x5dc5('0x36')]);_0x27fe42[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x27fe42[_0x5dc5('0x35')],_0x27fe42[_0x5dc5('0x36')]);_0x2925f5['attributes']=_[_0x5dc5('0x3a')](_0x27fe42[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x7a5b64[_0x5dc5('0x36')][_0x5dc5('0x3b')]));_0x2925f5['attributes']=_0x2925f5['attributes'][_0x5dc5('0x3c')]?_0x2925f5[_0x5dc5('0x39')]:_0x27fe42[_0x5dc5('0x35')];_0x2925f5['order']=qs['sort'](_0x7a5b64['query'][_0x5dc5('0x3f')]);_0x2925f5[_0x5dc5('0x42')]=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x7a5b64['query'],_0x27fe42[_0x5dc5('0x38')]));_0x2925f5[_0x5dc5('0x42')]=_[_0x5dc5('0x43')](_0x2925f5[_0x5dc5('0x42')],{'$or':[{'ListId':_0x3985cf['id']},{'ListId':null}]});if(_0x7a5b64[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x2925f5['where']=_[_0x5dc5('0x43')](_0x2925f5[_0x5dc5('0x42')],{'$or':_[_0x5dc5('0x32')](_0x2925f5[_0x5dc5('0x39')],function(_0x3350af){var _0x17a6a4={};_0x17a6a4[_0x3350af]={'$like':'%'+_0x7a5b64[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x17a6a4;})});}_0x2925f5=_[_0x5dc5('0x43')]({},_0x2925f5,_0x7a5b64['options']);return db[_0x5dc5('0x6c')][_0x5dc5('0x85')](_0x2925f5);}})['then'](respondWithResult(_0x48c65f,null))[_0x5dc5('0x4a')](handleError(_0x48c65f,null));};exports[_0x5dc5('0x86')]=function(_0x5da792,_0x549e45,_0x99ed69){return db[_0x5dc5('0x33')][_0x5dc5('0x4d')]({'where':{'id':_0x5da792['params']['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x549e45,null))[_0x5dc5('0x2a')](function(_0x3b8c2b){if(_0x3b8c2b){return _0x3b8c2b['addAgents'](_0x5da792['body'][_0x5dc5('0x5b')],_[_0x5dc5('0x87')](_0x5da792['body'],['ids','id'])||{})[_0x5dc5('0x88')](function(_0x169363){for(var _0x856c6b=0x0;_0x856c6b<_0x5da792[_0x5dc5('0x4f')]['ids']['length'];_0x856c6b+=0x1){socket[_0x5dc5('0x89')]('userCmList:save',{'UserId':Number(_0x5da792[_0x5dc5('0x4f')]['ids'][_0x856c6b]),'CmListId':Number(_0x5da792[_0x5dc5('0x4b')]['id'])});}return _0x169363;});}})[_0x5dc5('0x2a')](respondWithResult(_0x549e45,null))[_0x5dc5('0x4a')](handleError(_0x549e45,null));};exports[_0x5dc5('0x8a')]=function(_0x1cbb57,_0x58868a,_0x16105e){return db['CmList'][_0x5dc5('0x4d')]({'where':{'id':_0x1cbb57[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x58868a,null))[_0x5dc5('0x2a')](function(_0x7e614c){if(_0x7e614c){return _0x7e614c[_0x5dc5('0x8a')](_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')])[_0x5dc5('0x2a')](function(){if(_[_0x5dc5('0x5e')](_0x1cbb57[_0x5dc5('0x36')]['ids'])){for(var _0x2c6388=0x0;_0x2c6388<_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')][_0x5dc5('0x3c')];_0x2c6388+=0x1){socket[_0x5dc5('0x89')](_0x5dc5('0x8b'),{'UserId':Number(_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')][_0x2c6388]),'CmListId':Number(_0x1cbb57[_0x5dc5('0x4b')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x1cbb57[_0x5dc5('0x36')][_0x5dc5('0x5b')]),'CmListId':Number(_0x1cbb57[_0x5dc5('0x4b')]['id'])});}});}})[_0x5dc5('0x2a')](respondWithStatusCode(_0x58868a,null))['catch'](handleError(_0x58868a,null));};exports[_0x5dc5('0x8c')]=function(_0x1c55c1,_0x151303,_0x4a80fb){var _0x440d99={};var _0x97c6a7={};var _0x37e53a;var _0x2951a2;return db[_0x5dc5('0x33')][_0x5dc5('0x59')]({'where':{'id':_0x1c55c1[_0x5dc5('0x4b')]['id']}})[_0x5dc5('0x2a')](handleEntityNotFound(_0x151303,null))['then'](function(_0x48288a){if(_0x48288a){_0x37e53a=_0x48288a;_0x97c6a7[_0x5dc5('0x35')]=_['keys'](db[_0x5dc5('0x8d')][_0x5dc5('0x4c')]);_0x97c6a7[_0x5dc5('0x36')]=_[_0x5dc5('0x37')](_0x1c55c1['query']);_0x97c6a7[_0x5dc5('0x38')]=_[_0x5dc5('0x3a')](_0x97c6a7[_0x5dc5('0x35')],_0x97c6a7['query']);_0x440d99[_0x5dc5('0x39')]=_[_0x5dc5('0x3a')](_0x97c6a7[_0x5dc5('0x35')],qs[_0x5dc5('0x3b')](_0x1c55c1[_0x5dc5('0x36')]['fields']));_0x440d99[_0x5dc5('0x39')]=_0x440d99[_0x5dc5('0x39')]['length']?_0x440d99['attributes']:_0x97c6a7['model'];_0x440d99['order']=qs[_0x5dc5('0x3f')](_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x3f')]);_0x440d99['where']=qs[_0x5dc5('0x38')](_[_0x5dc5('0x40')](_0x1c55c1[_0x5dc5('0x36')],_0x97c6a7[_0x5dc5('0x38')]));if(_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x41')]){_0x440d99['where']=_[_0x5dc5('0x43')](_0x440d99[_0x5dc5('0x42')],{'$or':_[_0x5dc5('0x32')](_0x440d99[_0x5dc5('0x39')],function(_0x14db70){var _0x478e10={};_0x478e10[_0x14db70]={'$like':'%'+_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x41')]+'%'};return _0x478e10;})});}_0x440d99=_[_0x5dc5('0x43')]({},_0x440d99,_0x1c55c1[_0x5dc5('0x45')]);return _0x37e53a['getAgents'](_0x440d99);}})['then'](function(_0x4f0f91){if(_0x4f0f91){_0x2951a2=_0x4f0f91[_0x5dc5('0x3c')];if(!_0x1c55c1['query'][_0x5dc5('0x3d')](_0x5dc5('0x6a'))){_0x440d99[_0x5dc5('0x24')]=qs['limit'](_0x1c55c1[_0x5dc5('0x36')]['limit']);_0x440d99[_0x5dc5('0x22')]=qs[_0x5dc5('0x22')](_0x1c55c1[_0x5dc5('0x36')][_0x5dc5('0x22')]);}return _0x37e53a[_0x5dc5('0x8c')](_0x440d99);}})[_0x5dc5('0x2a')](function(_0x5e4233){if(_0x5e4233){return _0x5e4233?{'count':_0x2951a2,'rows':_0x5e4233}:null;}})[_0x5dc5('0x2a')](respondWithResult(_0x151303,null))[_0x5dc5('0x4a')](handleError(_0x151303,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 5824d5a..6fff87a 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(_0x27d0ad,_0x3f8bef){var _0x4eec43=function(_0x336bb6){while(--_0x336bb6){_0x27d0ad['push'](_0x27d0ad['shift']());}};_0x4eec43(++_0x3f8bef);}(_0x814b,0x1a2));var _0xb814=function(_0x2a8c21,_0x163576){_0x2a8c21=_0x2a8c21-0x0;var _0x5f3061=_0x814b[_0x2a8c21];return _0x5f3061;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x154d1e,_0x1f705a){var _0x17568e=function(_0x2da0bb){while(--_0x2da0bb){_0x154d1e['push'](_0x154d1e['shift']());}};_0x17568e(++_0x1f705a);}(_0x7217,0x19e));var _0x7721=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x7217[_0x297fd3];return _0x2af381;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 9b38789..21051ba 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 _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','../../config/logger','api'];(function(_0x453aa0,_0x1fd5d4){var _0x4f2810=function(_0x2980a3){while(--_0x2980a3){_0x453aa0['push'](_0x453aa0['shift']());}};_0x4f2810(++_0x1fd5d4);}(_0x1339,0x1ed));var _0x9133=function(_0x3a8e80,_0x4d3572){_0x3a8e80=_0x3a8e80-0x0;var _0xab658c=_0x1339[_0x3a8e80];return _0xab658c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./cmList.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb43b=['rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash','util','api','moment','bluebird','path'];(function(_0xf7be32,_0x1cd94a){var _0x4af2d3=function(_0x4b5640){while(--_0x4b5640){_0xf7be32['push'](_0xf7be32['shift']());}};_0x4af2d3(++_0x1cd94a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1682ed,_0x3af498){_0x1682ed=_0x1682ed-0x0;var _0x2cb645=_0xb43b[_0x1682ed];return _0x2cb645;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var moment=require(_0xbb43('0x3'));var BPromise=require(_0xbb43('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb43('0x5'));var rimraf=require(_0xbb43('0x6'));var config=require(_0xbb43('0x7'));var attributes=require(_0xbb43('0x8'));module['exports']=function(_0x491fb9,_0x378df5){return _0x491fb9['define'](_0xbb43('0x9'),attributes,{'tableName':_0xbb43('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 13ba309..3017300 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 _0xd94a=['ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','catch','moment'];(function(_0x4a271d,_0x1fb0ea){var _0x927bdb=function(_0x3c0984){while(--_0x3c0984){_0x4a271d['push'](_0x4a271d['shift']());}};_0x927bdb(++_0x1fb0ea);}(_0xd94a,0x1b8));var _0xad94=function(_0xcf0d77,_0x2195aa){_0xcf0d77=_0xcf0d77-0x0;var _0x13b05f=_0xd94a[_0xcf0d77];return _0x13b05f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xad94('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad94('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xad94('0x2'));var logger=require('../../config/logger')(_0xad94('0x3'));var config=require(_0xad94('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xad94('0x5')][_0xad94('0x6')]({'port':0x232a});config[_0xad94('0x7')]=_[_0xad94('0x8')](config[_0xad94('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xad94('0x9'))(new Redis(config[_0xad94('0x7')]));require(_0xad94('0xa'))[_0xad94('0xb')](socket);function respondWithRpcPromise(_0x4aaed2,_0x3b38f8,_0x1d11ef){return new BPromise(function(_0x4e1985,_0x69fcff){return client['request'](_0x4aaed2,_0x1d11ef)[_0xad94('0xc')](function(_0x4af9ee){logger[_0xad94('0xd')]('CmList,\x20%s,\x20%s',_0x3b38f8,_0xad94('0xe'));logger['debug'](_0xad94('0xf'),_0x3b38f8,'request\x20sent',JSON[_0xad94('0x10')](_0x4af9ee));if(_0x4af9ee[_0xad94('0x11')]){if(_0x4af9ee[_0xad94('0x11')]['code']===0x1f4){logger[_0xad94('0x11')](_0xad94('0x12'),_0x3b38f8,_0x4af9ee[_0xad94('0x11')][_0xad94('0x13')]);return _0x69fcff(_0x4af9ee['error'][_0xad94('0x13')]);}logger['error']('CmList,\x20%s,\x20%s',_0x3b38f8,_0x4af9ee[_0xad94('0x11')]['message']);return _0x4e1985(_0x4af9ee[_0xad94('0x11')][_0xad94('0x13')]);}else{logger['info'](_0xad94('0x12'),_0x3b38f8,_0xad94('0xe'));_0x4e1985(_0x4af9ee['result'][_0xad94('0x13')]);}})[_0xad94('0x14')](function(_0x552c92){logger[_0xad94('0x11')](_0xad94('0x12'),_0x3b38f8,_0x552c92);_0x69fcff(_0x552c92);});});} \ No newline at end of file +var _0xfa6a=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0xfa6a,0x1d9));var _0xafa6=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfa6a[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xafa6('0x0'));var util=require(_0xafa6('0x1'));var moment=require(_0xafa6('0x2'));var BPromise=require(_0xafa6('0x3'));var rs=require(_0xafa6('0x4'));var fs=require('fs');var Redis=require(_0xafa6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xafa6('0x6'));var logger=require('../../config/logger')(_0xafa6('0x7'));var config=require(_0xafa6('0x8'));var jayson=require(_0xafa6('0x9'));var client=jayson['client'][_0xafa6('0xa')]({'port':0x232a});config[_0xafa6('0xb')]=_[_0xafa6('0xc')](config['redis'],{'host':_0xafa6('0xd'),'port':0x18eb});var socket=require(_0xafa6('0xe'))(new Redis(config[_0xafa6('0xb')]));require('./cmList.socket')[_0xafa6('0xf')](socket);function respondWithRpcPromise(_0x513463,_0x24ad21,_0x442fa4){return new BPromise(function(_0x4b11a6,_0x215a34){return client[_0xafa6('0x10')](_0x513463,_0x442fa4)[_0xafa6('0x11')](function(_0xd7ef3f){logger[_0xafa6('0x12')](_0xafa6('0x13'),_0x24ad21,'request\x20sent');logger[_0xafa6('0x14')]('CmList,\x20%s,\x20%s,\x20%s',_0x24ad21,_0xafa6('0x15'),JSON[_0xafa6('0x16')](_0xd7ef3f));if(_0xd7ef3f[_0xafa6('0x17')]){if(_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x18')]===0x1f4){logger[_0xafa6('0x17')](_0xafa6('0x13'),_0x24ad21,_0xd7ef3f[_0xafa6('0x17')]['message']);return _0x215a34(_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x19')]);}logger[_0xafa6('0x17')](_0xafa6('0x13'),_0x24ad21,_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x19')]);return _0x4b11a6(_0xd7ef3f[_0xafa6('0x17')][_0xafa6('0x19')]);}else{logger[_0xafa6('0x12')](_0xafa6('0x13'),_0x24ad21,_0xafa6('0x15'));_0x4b11a6(_0xd7ef3f[_0xafa6('0x1a')][_0xafa6('0x19')]);}})[_0xafa6('0x1b')](function(_0x2e6612){logger[_0xafa6('0x17')](_0xafa6('0x13'),_0x24ad21,_0x2e6612);_0x215a34(_0x2e6612);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 76840ff..174d0ea 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 _0xd8a5=['register','length','./cmList.events','remove','update','emit','removeListener'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0xd8a5,0x160));var _0x5d8a=function(_0x37b213,_0x30399d){_0x37b213=_0x37b213-0x0;var _0x50c82f=_0xd8a5[_0x37b213];return _0x50c82f;};'use strict';var CmListEvents=require(_0x5d8a('0x0'));var events=['save',_0x5d8a('0x1'),_0x5d8a('0x2')];function createListener(_0x4f7eae,_0x363b44){return function(_0xf03a8f){_0x363b44[_0x5d8a('0x3')](_0x4f7eae,_0xf03a8f);};}function removeListener(_0x22863c,_0x821a16){return function(){CmListEvents[_0x5d8a('0x4')](_0x22863c,_0x821a16);};}exports[_0x5d8a('0x5')]=function(_0x38eaa5){for(var _0x1ef405=0x0,_0x46ab34=events[_0x5d8a('0x6')];_0x1ef405<_0x46ab34;_0x1ef405++){var _0x3514c5=events[_0x1ef405];var _0x32cd30=createListener('cmList:'+_0x3514c5,_0x38eaa5);CmListEvents['on'](_0x3514c5,_0x32cd30);}}; \ No newline at end of file +var _0xf409=['length','./cmList.events','save','remove','update','emit'];(function(_0x1ecb80,_0x2d11eb){var _0x3ecc7=function(_0x2a0bb1){while(--_0x2a0bb1){_0x1ecb80['push'](_0x1ecb80['shift']());}};_0x3ecc7(++_0x2d11eb);}(_0xf409,0x1cf));var _0x9f40=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xf409[_0x28d18d];return _0x470640;};'use strict';var CmListEvents=require(_0x9f40('0x0'));var events=[_0x9f40('0x1'),_0x9f40('0x2'),_0x9f40('0x3')];function createListener(_0x24f243,_0x303fc4){return function(_0x18da4f){_0x303fc4[_0x9f40('0x4')](_0x24f243,_0x18da4f);};}function removeListener(_0x491473,_0x4c1655){return function(){CmListEvents['removeListener'](_0x491473,_0x4c1655);};}exports['register']=function(_0x5d1e64){for(var _0x283e88=0x0,_0x355739=events[_0x9f40('0x5')];_0x283e88<_0x355739;_0x283e88++){var _0x16f95f=events[_0x283e88];var _0xcaf58=createListener('cmList:'+_0x16f95f,_0x5d1e64);CmListEvents['on'](_0x16f95f,_0xcaf58);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index e571bdf..2bd6bb0 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 _0x4131=['getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','create','/:id/contacts','addCustomField','/:id/users','addAgents','update','delete','/:id','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions'];(function(_0x5d4f12,_0x11e67c){var _0x4eb577=function(_0x4d7a2d){while(--_0x4d7a2d){_0x5d4f12['push'](_0x5d4f12['shift']());}};_0x4eb577(++_0x11e67c);}(_0x4131,0x107));var _0x1413=function(_0x83d48e,_0x507328){_0x83d48e=_0x83d48e-0x0;var _0x26f1d1=_0x4131[_0x83d48e];return _0x26f1d1;};'use strict';var multer=require(_0x1413('0x0'));var util=require(_0x1413('0x1'));var path=require('path');var timeout=require(_0x1413('0x2'));var express=require(_0x1413('0x3'));var router=express[_0x1413('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1413('0x5'));var interaction=require(_0x1413('0x6'));var config=require(_0x1413('0x7'));var controller=require(_0x1413('0x8'));router[_0x1413('0x9')]('/',auth[_0x1413('0xa')](),controller[_0x1413('0xb')]);router[_0x1413('0x9')](_0x1413('0xc'),auth[_0x1413('0xa')](),controller[_0x1413('0xd')]);router['get']('/:id',auth[_0x1413('0xa')](),controller[_0x1413('0xe')]);router[_0x1413('0x9')](_0x1413('0xf'),auth['isAuthenticated'](),controller[_0x1413('0x10')]);router[_0x1413('0x9')]('/:id/contacts',auth[_0x1413('0xa')](),controller[_0x1413('0x11')]);router[_0x1413('0x9')](_0x1413('0x12'),auth[_0x1413('0xa')](),controller[_0x1413('0x13')]);router[_0x1413('0x9')](_0x1413('0x14'),auth[_0x1413('0xa')](),controller[_0x1413('0x15')]);router[_0x1413('0x9')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x1413('0x16')]('/',auth['isAuthenticated'](),controller[_0x1413('0x17')]);router[_0x1413('0x16')](_0x1413('0xf'),auth[_0x1413('0xa')](),controller['addDisposition']);router['post'](_0x1413('0x18'),auth['isAuthenticated'](),controller['addContacts']);router[_0x1413('0x16')](_0x1413('0x14'),auth['isAuthenticated'](),controller[_0x1413('0x19')]);router['post'](_0x1413('0x1a'),auth['isAuthenticated'](),controller[_0x1413('0x1b')]);router['put']('/:id',auth[_0x1413('0xa')](),controller[_0x1413('0x1c')]);router[_0x1413('0x1d')](_0x1413('0x1e'),auth[_0x1413('0xa')](),controller[_0x1413('0x1f')]);router[_0x1413('0x1d')](_0x1413('0xf'),auth[_0x1413('0xa')](),controller[_0x1413('0x20')]);router[_0x1413('0x1d')](_0x1413('0x1a'),auth[_0x1413('0xa')](),controller[_0x1413('0x21')]);module[_0x1413('0x22')]=router; \ No newline at end of file +var _0x77b4=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addContacts','addCustomField','put','update','delete','destroy','removeDispositions','removeAgents'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x77b4,0x15f));var _0x477b=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x77b4[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0x477b('0x0'));var util=require(_0x477b('0x1'));var path=require('path');var timeout=require(_0x477b('0x2'));var express=require(_0x477b('0x3'));var router=express[_0x477b('0x4')]();var fs_extra=require(_0x477b('0x5'));var auth=require(_0x477b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x477b('0x7'));var controller=require(_0x477b('0x8'));router['get']('/',auth[_0x477b('0x9')](),controller[_0x477b('0xa')]);router[_0x477b('0xb')](_0x477b('0xc'),auth[_0x477b('0x9')](),controller[_0x477b('0xd')]);router[_0x477b('0xb')](_0x477b('0xe'),auth[_0x477b('0x9')](),controller['show']);router[_0x477b('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x477b('0xf')]);router['get'](_0x477b('0x10'),auth[_0x477b('0x9')](),controller[_0x477b('0x11')]);router[_0x477b('0xb')]('/:id/contacts/csv',auth[_0x477b('0x9')](),controller[_0x477b('0x12')]);router[_0x477b('0xb')](_0x477b('0x13'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x477b('0xb')](_0x477b('0x14'),auth[_0x477b('0x9')](),controller[_0x477b('0x15')]);router[_0x477b('0x16')]('/',auth['isAuthenticated'](),controller[_0x477b('0x17')]);router[_0x477b('0x16')](_0x477b('0x18'),auth[_0x477b('0x9')](),controller[_0x477b('0x19')]);router[_0x477b('0x16')](_0x477b('0x10'),auth[_0x477b('0x9')](),controller[_0x477b('0x1a')]);router[_0x477b('0x16')]('/:id/fields',auth[_0x477b('0x9')](),controller[_0x477b('0x1b')]);router[_0x477b('0x16')](_0x477b('0x14'),auth[_0x477b('0x9')](),controller['addAgents']);router[_0x477b('0x1c')](_0x477b('0xe'),auth[_0x477b('0x9')](),controller[_0x477b('0x1d')]);router[_0x477b('0x1e')](_0x477b('0xe'),auth['isAuthenticated'](),controller[_0x477b('0x1f')]);router['delete']('/:id/dispositions',auth[_0x477b('0x9')](),controller[_0x477b('0x20')]);router[_0x477b('0x1e')](_0x477b('0x14'),auth['isAuthenticated'](),controller[_0x477b('0x21')]);module[_0x477b('0x22')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index f433171..7cdb065 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 _0x8d01=['STRING','sequelize','exports','VIRTUAL','getDataValue','field'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8d01,0x193));var _0x18d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d01[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x18d0('0x0'));module[_0x18d0('0x1')]={'name':{'type':Sequelize[_0x18d0('0x2')],'get':function(_0x1f2688){return this[_0x18d0('0x3')](_0x18d0('0x4'));}},'field':{'type':Sequelize[_0x18d0('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x18d0('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x0fa6=['STRING','sequelize','getDataValue','field'];(function(_0x2703e1,_0x5c73fd){var _0x1b9789=function(_0x1ec8cb){while(--_0x1ec8cb){_0x2703e1['push'](_0x2703e1['shift']());}};_0x1b9789(++_0x5c73fd);}(_0x0fa6,0x119));var _0x60fa=function(_0x2dae1f,_0x1e28f3){_0x2dae1f=_0x2dae1f-0x0;var _0x55ad23=_0x0fa6[_0x2dae1f];return _0x55ad23;};'use strict';var Sequelize=require(_0x60fa('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4095af){return this[_0x60fa('0x1')](_0x60fa('0x2'));}},'field':{'type':Sequelize[_0x60fa('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0x60fa('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0x60fa('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 6edfb81..cd372d5 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(_0x433d97,_0x495b50){var _0x43cf0b=function(_0x138fe0){while(--_0x138fe0){_0x433d97['push'](_0x433d97['shift']());}};_0x43cf0b(++_0x495b50);}(_0x7a54,0x106));var _0x47a5=function(_0x2c1ed2,_0x58c006){_0x2c1ed2=_0x2c1ed2-0x0;var _0x42b32d=_0x7a54[_0x2c1ed2];return _0x42b32d;};'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(_0x23185b,_0x11b951){var _0x769759=function(_0x5348bd){while(--_0x5348bd){_0x23185b['push'](_0x23185b['shift']());}};_0x769759(++_0x11b951);}(_0x7a54,0x106));var _0x47a5=function(_0x20959f,_0x2426ec){_0x20959f=_0x20959f-0x0;var _0xa641e4=_0x7a54[_0x20959f];return _0xa641e4;};'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 0708136..8211974 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 _0xc5f4=['rimraf','./condition.attributes','exports','Condition','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc5f4,0x1ee));var _0x4c5f=function(_0x236b3b,_0xa0df33){_0x236b3b=_0x236b3b-0x0;var _0x427a57=_0xc5f4[_0x236b3b];return _0x427a57;};'use strict';var _=require(_0x4c5f('0x0'));var util=require(_0x4c5f('0x1'));var logger=require(_0x4c5f('0x2'))(_0x4c5f('0x3'));var moment=require(_0x4c5f('0x4'));var BPromise=require(_0x4c5f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4c5f('0x6'));var config=require('../../config/environment');var attributes=require(_0x4c5f('0x7'));module[_0x4c5f('0x8')]=function(_0x12d353,_0xaf45fb){return _0x12d353['define'](_0x4c5f('0x9'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x08df=['Condition','tools_conditions','lodash','util','moment','request-promise','path','rimraf','./condition.attributes','define'];(function(_0x241eb9,_0x5ccc3f){var _0x4f916b=function(_0x412d98){while(--_0x412d98){_0x241eb9['push'](_0x241eb9['shift']());}};_0x4f916b(++_0x5ccc3f);}(_0x08df,0x1c4));var _0xf08d=function(_0x506d83,_0x1899e9){_0x506d83=_0x506d83-0x0;var _0x335e8b=_0x08df[_0x506d83];return _0x335e8b;};'use strict';var _=require(_0xf08d('0x0'));var util=require(_0xf08d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf08d('0x2'));var BPromise=require('bluebird');var rp=require(_0xf08d('0x3'));var fs=require('fs');var path=require(_0xf08d('0x4'));var rimraf=require(_0xf08d('0x5'));var config=require('../../config/environment');var attributes=require(_0xf08d('0x6'));module['exports']=function(_0x115351,_0x47f9a2){return _0x115351[_0xf08d('0x7')](_0xf08d('0x8'),attributes,{'tableName':_0xf08d('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 4bbcaa0..8dc87ce 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 _0x20f7=['result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x68df7e,_0x272db2){var _0x34a71c=function(_0x253388){while(--_0x253388){_0x68df7e['push'](_0x68df7e['shift']());}};_0x34a71c(++_0x272db2);}(_0x20f7,0x17e));var _0x720f=function(_0x246380,_0x4b2a12){_0x246380=_0x246380-0x0;var _0x10fef8=_0x20f7[_0x246380];return _0x10fef8;};'use strict';var _=require(_0x720f('0x0'));var util=require(_0x720f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x720f('0x2'));var db=require(_0x720f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x720f('0x4'))(_0x720f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x720f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e274f,_0x50f481,_0x42fc0d){return new BPromise(function(_0x3b9d56,_0xc17120){return client[_0x720f('0x7')](_0x2e274f,_0x42fc0d)[_0x720f('0x8')](function(_0x10f7bb){logger[_0x720f('0x9')](_0x720f('0xa'),_0x50f481,_0x720f('0xb'));logger[_0x720f('0xc')](_0x720f('0xd'),_0x50f481,_0x720f('0xb'),JSON[_0x720f('0xe')](_0x10f7bb));if(_0x10f7bb[_0x720f('0xf')]){if(_0x10f7bb[_0x720f('0xf')]['code']===0x1f4){logger['error']('Condition,\x20%s,\x20%s',_0x50f481,_0x10f7bb[_0x720f('0xf')][_0x720f('0x10')]);return _0xc17120(_0x10f7bb[_0x720f('0xf')]['message']);}logger[_0x720f('0xf')](_0x720f('0xa'),_0x50f481,_0x10f7bb[_0x720f('0xf')][_0x720f('0x10')]);return _0x3b9d56(_0x10f7bb[_0x720f('0xf')][_0x720f('0x10')]);}else{logger[_0x720f('0x9')](_0x720f('0xa'),_0x50f481,_0x720f('0xb'));_0x3b9d56(_0x10f7bb[_0x720f('0x11')]['message']);}})[_0x720f('0x12')](function(_0x408a57){logger[_0x720f('0xf')]('Condition,\x20%s,\x20%s',_0x50f481,_0x408a57);_0xc17120(_0x408a57);});});} \ No newline at end of file +var _0x0b79=['http','request','then','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x0b79,0x113));var _0x90b7=function(_0x21a094,_0x2fd82f){_0x21a094=_0x21a094-0x0;var _0x308898=_0x0b79[_0x21a094];return _0x308898;};'use strict';var _=require(_0x90b7('0x0'));var util=require(_0x90b7('0x1'));var moment=require(_0x90b7('0x2'));var BPromise=require(_0x90b7('0x3'));var rs=require(_0x90b7('0x4'));var fs=require('fs');var Redis=require(_0x90b7('0x5'));var db=require(_0x90b7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x90b7('0x7'))(_0x90b7('0x8'));var config=require(_0x90b7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x90b7('0xa')][_0x90b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52bbb1,_0x49ced7,_0x2fa2a1){return new BPromise(function(_0x25d7f5,_0x43e8b){return client[_0x90b7('0xc')](_0x52bbb1,_0x2fa2a1)[_0x90b7('0xd')](function(_0x3b8935){logger['info'](_0x90b7('0xe'),_0x49ced7,_0x90b7('0xf'));logger['debug'](_0x90b7('0x10'),_0x49ced7,_0x90b7('0xf'),JSON[_0x90b7('0x11')](_0x3b8935));if(_0x3b8935[_0x90b7('0x12')]){if(_0x3b8935[_0x90b7('0x12')]['code']===0x1f4){logger['error'](_0x90b7('0xe'),_0x49ced7,_0x3b8935[_0x90b7('0x12')][_0x90b7('0x13')]);return _0x43e8b(_0x3b8935['error']['message']);}logger[_0x90b7('0x12')](_0x90b7('0xe'),_0x49ced7,_0x3b8935[_0x90b7('0x12')][_0x90b7('0x13')]);return _0x25d7f5(_0x3b8935['error'][_0x90b7('0x13')]);}else{logger[_0x90b7('0x14')](_0x90b7('0xe'),_0x49ced7,_0x90b7('0xf'));_0x25d7f5(_0x3b8935['result'][_0x90b7('0x13')]);}})[_0x90b7('0x15')](function(_0x22b8c7){logger[_0x90b7('0x12')]('Condition,\x20%s,\x20%s',_0x49ced7,_0x22b8c7);_0x43e8b(_0x22b8c7);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5036a22..781ed2f 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 _0xfd7e=['delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x245f71,_0x3d9ccb){var _0x3189d0=function(_0x465c1e){while(--_0x465c1e){_0x245f71['push'](_0x245f71['shift']());}};_0x3189d0(++_0x3d9ccb);}(_0xfd7e,0x83));var _0xefd7=function(_0xd4e5d2,_0x117b2b){_0xd4e5d2=_0xd4e5d2-0x0;var _0x2b6acc=_0xfd7e[_0xd4e5d2];return _0x2b6acc;};'use strict';var multer=require(_0xefd7('0x0'));var util=require(_0xefd7('0x1'));var path=require(_0xefd7('0x2'));var timeout=require(_0xefd7('0x3'));var express=require('express');var router=express[_0xefd7('0x4')]();var fs_extra=require(_0xefd7('0x5'));var auth=require(_0xefd7('0x6'));var interaction=require(_0xefd7('0x7'));var config=require('../../config/environment');var controller=require(_0xefd7('0x8'));router[_0xefd7('0x9')](_0xefd7('0xa'),auth[_0xefd7('0xb')](),controller[_0xefd7('0xc')]);router[_0xefd7('0xd')]('/:id',auth[_0xefd7('0xb')](),controller[_0xefd7('0xe')]);module[_0xefd7('0xf')]=router; \ No newline at end of file +var _0x91fa=['./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x91fa,0xbe));var _0xa91f=function(_0x594670,_0x4b9fdd){_0x594670=_0x594670-0x0;var _0x36a5b7=_0x91fa[_0x594670];return _0x36a5b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa91f('0x0'));var timeout=require(_0xa91f('0x1'));var express=require(_0xa91f('0x2'));var router=express['Router']();var fs_extra=require(_0xa91f('0x3'));var auth=require(_0xa91f('0x4'));var interaction=require(_0xa91f('0x5'));var config=require('../../config/environment');var controller=require(_0xa91f('0x6'));router[_0xa91f('0x7')]('/:id',auth[_0xa91f('0x8')](),controller[_0xa91f('0x9')]);router[_0xa91f('0xa')](_0xa91f('0xb'),auth[_0xa91f('0x8')](),controller[_0xa91f('0xc')]);module[_0xa91f('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 43cde9d..540393d 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 _0x2032=['name','exports','STRING'];(function(_0x51a828,_0x3aa9d8){var _0x5ca311=function(_0x2f7987){while(--_0x2f7987){_0x51a828['push'](_0x51a828['shift']());}};_0x5ca311(++_0x3aa9d8);}(_0x2032,0xd9));var _0x2203=function(_0x2284ee,_0x3350d4){_0x2284ee=_0x2284ee-0x0;var _0x52787b=_0x2032[_0x2284ee];return _0x52787b;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x757a=['exports','STRING'];(function(_0x3c84e5,_0x412c4a){var _0x4dd2e9=function(_0x1f6ed6){while(--_0x1f6ed6){_0x3c84e5['push'](_0x3c84e5['shift']());}};_0x4dd2e9(++_0x412c4a);}(_0x757a,0xde));var _0xa757=function(_0x14597,_0x152ce9){_0x14597=_0x14597-0x0;var _0x5dbdbf=_0x757a[_0x14597];return _0x5dbdbf;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 798bc68..b16366e 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 _0xb6a5=['update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','send','index','Dashboard','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','include','findAll','rows','catch','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','omit','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./dashboard.socket','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save'];(function(_0x45e8f7,_0x3709d0){var _0x17f099=function(_0x1df8e2){while(--_0x1df8e2){_0x45e8f7['push'](_0x45e8f7['shift']());}};_0x17f099(++_0x3709d0);}(_0xb6a5,0xce));var _0x5b6a=function(_0x1c5b34,_0x4c97dc){_0x1c5b34=_0x1c5b34-0x0;var _0x3510fd=_0xb6a5[_0x1c5b34];return _0x3510fd;};'use strict';var emlformat=require(_0x5b6a('0x0'));var rimraf=require(_0x5b6a('0x1'));var zipdir=require(_0x5b6a('0x2'));var jsonpatch=require(_0x5b6a('0x3'));var rp=require(_0x5b6a('0x4'));var moment=require('moment');var BPromise=require(_0x5b6a('0x5'));var Mustache=require('mustache');var util=require(_0x5b6a('0x6'));var path=require(_0x5b6a('0x7'));var sox=require('sox');var csv=require(_0x5b6a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b6a('0x9'));var _=require(_0x5b6a('0xa'));var squel=require('squel');var crypto=require(_0x5b6a('0xb'));var jsforce=require(_0x5b6a('0xc'));var deskjs=require(_0x5b6a('0xd'));var toCsv=require(_0x5b6a('0x8'));var querystring=require(_0x5b6a('0xe'));var Papa=require(_0x5b6a('0xf'));var Redis=require(_0x5b6a('0x10'));var authService=require(_0x5b6a('0x11'));var qs=require(_0x5b6a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b6a('0x13'));var logger=require(_0x5b6a('0x14'))(_0x5b6a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b6a('0x16'));var db=require(_0x5b6a('0x17'))['db'];config['redis']=_['defaults'](config[_0x5b6a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5b6a('0x19'))(new Redis(config[_0x5b6a('0x18')]));require(_0x5b6a('0x1a'))['register'](socket);function respondWithStatusCode(_0x2c51ae,_0x1f0931){_0x1f0931=_0x1f0931||0xcc;return function(_0x155f01){if(_0x155f01){return _0x2c51ae['sendStatus'](_0x1f0931);}return _0x2c51ae[_0x5b6a('0x1b')](_0x1f0931)[_0x5b6a('0x1c')]();};}function respondWithResult(_0x1b1244,_0xa47ffa){_0xa47ffa=_0xa47ffa||0xc8;return function(_0x31eb63){if(_0x31eb63){return _0x1b1244[_0x5b6a('0x1b')](_0xa47ffa)['json'](_0x31eb63);}};}function respondWithFilteredResult(_0x9939af,_0x1155f6){return function(_0x3802dd){if(_0x3802dd){var _0x1f8a9e=typeof _0x1155f6[_0x5b6a('0x1d')]===_0x5b6a('0x1e')&&typeof _0x1155f6[_0x5b6a('0x1f')]==='undefined';var _0x1041a6=_0x3802dd[_0x5b6a('0x20')];var _0x1fe5d6=_0x1f8a9e?0x0:_0x1155f6[_0x5b6a('0x1d')];var _0x1dc91d=_0x1f8a9e?_0x3802dd[_0x5b6a('0x20')]:_0x1155f6[_0x5b6a('0x1d')]+_0x1155f6[_0x5b6a('0x1f')];var _0x1bdff1;if(_0x1dc91d>=_0x1041a6){_0x1dc91d=_0x1041a6;_0x1bdff1=0xc8;}else{_0x1bdff1=0xce;}_0x9939af[_0x5b6a('0x1b')](_0x1bdff1);return _0x9939af[_0x5b6a('0x21')](_0x5b6a('0x22'),_0x1fe5d6+'-'+_0x1dc91d+'/'+_0x1041a6)[_0x5b6a('0x23')](_0x3802dd);}return null;};}function patchUpdates(_0x1a7752){return function(_0x312289){try{jsonpatch['apply'](_0x312289,_0x1a7752,!![]);}catch(_0x592fd6){return BPromise[_0x5b6a('0x24')](_0x592fd6);}return _0x312289[_0x5b6a('0x25')]();};}function saveUpdates(_0x4331fa,_0x509d0f){return function(_0x6607a2){if(_0x6607a2){return _0x6607a2[_0x5b6a('0x26')](_0x4331fa)[_0x5b6a('0x27')](function(_0x4c78a1){return _0x4c78a1;});}return null;};}function removeEntity(_0x5160fc,_0x114963){return function(_0x384b88){if(_0x384b88){return _0x384b88[_0x5b6a('0x28')]()['then'](function(){var _0x376de8=_0x384b88[_0x5b6a('0x29')]({'plain':!![]});var _0x275ed7=_0x5b6a('0x2a');return db[_0x5b6a('0x2b')][_0x5b6a('0x28')]({'where':{'type':_0x275ed7,'resourceId':_0x376de8['id']}})[_0x5b6a('0x27')](function(){return _0x384b88;});})[_0x5b6a('0x27')](function(){_0x5160fc[_0x5b6a('0x1b')](0xcc)[_0x5b6a('0x1c')]();});}};}function handleEntityNotFound(_0x2d0616,_0x1e3fc4){return function(_0xacaf78){if(!_0xacaf78){_0x2d0616[_0x5b6a('0x2c')](0x194);}return _0xacaf78;};}function handleError(_0x1fca59,_0x4c819a){_0x4c819a=_0x4c819a||0x1f4;return function(_0x305da2){logger[_0x5b6a('0x2d')](_0x305da2[_0x5b6a('0x2e')]);if(_0x305da2[_0x5b6a('0x2f')]){delete _0x305da2[_0x5b6a('0x2f')];}_0x1fca59['status'](_0x4c819a)[_0x5b6a('0x30')](_0x305da2);};}exports[_0x5b6a('0x31')]=function(_0xf96ccc,_0x195b5d){var _0x549dc1={},_0x309530={},_0x22af7d={'count':0x0,'rows':[]};var _0x2ac021=_['map'](db[_0x5b6a('0x32')][_0x5b6a('0x33')],function(_0x5458f0){return{'name':_0x5458f0['fieldName'],'type':_0x5458f0[_0x5b6a('0x34')][_0x5b6a('0x35')]};});_0x309530[_0x5b6a('0x36')]=_[_0x5b6a('0x37')](_0x2ac021,_0x5b6a('0x2f'));_0x309530[_0x5b6a('0x38')]=_[_0x5b6a('0x39')](_0xf96ccc[_0x5b6a('0x38')]);_0x309530[_0x5b6a('0x3a')]=_['intersection'](_0x309530[_0x5b6a('0x36')],_0x309530[_0x5b6a('0x38')]);_0x549dc1[_0x5b6a('0x3b')]=_[_0x5b6a('0x3c')](_0x309530[_0x5b6a('0x36')],qs[_0x5b6a('0x3d')](_0xf96ccc[_0x5b6a('0x38')]['fields']));_0x549dc1[_0x5b6a('0x3b')]=_0x549dc1[_0x5b6a('0x3b')][_0x5b6a('0x3e')]?_0x549dc1['attributes']:_0x309530['model'];if(!_0xf96ccc[_0x5b6a('0x38')][_0x5b6a('0x3f')](_0x5b6a('0x40'))){_0x549dc1[_0x5b6a('0x1f')]=qs['limit'](_0xf96ccc[_0x5b6a('0x38')][_0x5b6a('0x1f')]);_0x549dc1[_0x5b6a('0x1d')]=qs['offset'](_0xf96ccc[_0x5b6a('0x38')][_0x5b6a('0x1d')]);}_0x549dc1[_0x5b6a('0x41')]=qs[_0x5b6a('0x42')](_0xf96ccc[_0x5b6a('0x38')][_0x5b6a('0x42')]);_0x549dc1['where']=qs['filters'](_[_0x5b6a('0x43')](_0xf96ccc['query'],_0x309530[_0x5b6a('0x3a')]),_0x2ac021);if(_0xf96ccc['query']['filter']){_0x549dc1[_0x5b6a('0x44')]=_[_0x5b6a('0x45')](_0x549dc1[_0x5b6a('0x44')],{'$or':_['map'](_0x2ac021,function(_0xcbb4a2){if(_0xcbb4a2['type']!==_0x5b6a('0x46')){var _0x1e2a79={};_0x1e2a79[_0xcbb4a2[_0x5b6a('0x2f')]]={'$like':'%'+_0xf96ccc[_0x5b6a('0x38')]['filter']+'%'};return _0x1e2a79;}})});}_0x549dc1=_[_0x5b6a('0x45')]({},_0x549dc1,_0xf96ccc[_0x5b6a('0x47')]);var _0x164a9a={'where':_0x549dc1[_0x5b6a('0x44')]};return db['Dashboard'][_0x5b6a('0x20')](_0x164a9a)[_0x5b6a('0x27')](function(_0x5e7d93){_0x22af7d[_0x5b6a('0x20')]=_0x5e7d93;if(_0xf96ccc[_0x5b6a('0x38')]['includeAll']){_0x549dc1[_0x5b6a('0x48')]=[{'all':!![]}];}return db[_0x5b6a('0x32')][_0x5b6a('0x49')](_0x549dc1);})[_0x5b6a('0x27')](function(_0x5a10e8){_0x22af7d[_0x5b6a('0x4a')]=_0x5a10e8;return _0x22af7d;})['then'](respondWithFilteredResult(_0x195b5d,_0x549dc1))[_0x5b6a('0x4b')](handleError(_0x195b5d,null));};exports['show']=function(_0x543f9e,_0x561a14){var _0xf10173={'raw':![],'where':{'id':_0x543f9e['params']['id']}},_0x1ea490={};_0x1ea490[_0x5b6a('0x36')]=_['keys'](db[_0x5b6a('0x32')]['rawAttributes']);_0x1ea490[_0x5b6a('0x38')]=_[_0x5b6a('0x39')](_0x543f9e[_0x5b6a('0x38')]);_0x1ea490[_0x5b6a('0x3a')]=_[_0x5b6a('0x3c')](_0x1ea490[_0x5b6a('0x36')],_0x1ea490[_0x5b6a('0x38')]);_0xf10173[_0x5b6a('0x3b')]=_[_0x5b6a('0x3c')](_0x1ea490[_0x5b6a('0x36')],qs['fields'](_0x543f9e[_0x5b6a('0x38')][_0x5b6a('0x3d')]));_0xf10173[_0x5b6a('0x3b')]=_0xf10173[_0x5b6a('0x3b')][_0x5b6a('0x3e')]?_0xf10173[_0x5b6a('0x3b')]:_0x1ea490['model'];if(_0x543f9e[_0x5b6a('0x38')][_0x5b6a('0x4c')]){_0xf10173['include']=[{'all':!![]}];}_0xf10173=_[_0x5b6a('0x45')]({},_0xf10173,_0x543f9e[_0x5b6a('0x47')]);return db[_0x5b6a('0x32')][_0x5b6a('0x4d')](_0xf10173)[_0x5b6a('0x27')](handleEntityNotFound(_0x561a14,null))[_0x5b6a('0x27')](respondWithResult(_0x561a14,null))[_0x5b6a('0x4b')](handleError(_0x561a14,null));};exports[_0x5b6a('0x4e')]=function(_0x25ef14,_0x1db891){return db[_0x5b6a('0x32')][_0x5b6a('0x4e')](_0x25ef14[_0x5b6a('0x4f')],{})[_0x5b6a('0x27')](function(_0x1f4f17){var _0x32e74a=_0x25ef14['user']['get']({'plain':!![]});if(!_0x32e74a)throw new Error(_0x5b6a('0x50'));if(_0x32e74a[_0x5b6a('0x51')]===_0x5b6a('0x52')){var _0x26c1fd=_0x1f4f17[_0x5b6a('0x29')]({'plain':!![]});var _0x207521=_0x5b6a('0x2a');return db[_0x5b6a('0x53')][_0x5b6a('0x4d')]({'where':{'name':_0x207521,'userProfileId':_0x32e74a[_0x5b6a('0x54')]},'raw':!![]})[_0x5b6a('0x27')](function(_0x1363b1){if(_0x1363b1&&_0x1363b1[_0x5b6a('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x26c1fd['name'],'resourceId':_0x26c1fd['id'],'type':_0x1363b1[_0x5b6a('0x2f')],'sectionId':_0x1363b1['id']},{})[_0x5b6a('0x27')](function(){return _0x1f4f17;});}else{return _0x1f4f17;}})[_0x5b6a('0x4b')](function(_0x4f3526){logger[_0x5b6a('0x2d')](_0x5b6a('0x56'),_0x4f3526);throw _0x4f3526;});}return _0x1f4f17;})[_0x5b6a('0x27')](respondWithResult(_0x1db891,0xc9))[_0x5b6a('0x4b')](handleError(_0x1db891,null));};exports[_0x5b6a('0x57')]=function(_0x802088,_0x453f0c){var _0x4a6c2a={'where':{'id':_0x802088[_0x5b6a('0x58')]['id']}},_0x5f1b2b={};_0x5f1b2b[_0x5b6a('0x36')]=_[_0x5b6a('0x39')](db[_0x5b6a('0x32')][_0x5b6a('0x33')]);_0x4a6c2a[_0x5b6a('0x3b')]=_['intersection'](_0x5f1b2b[_0x5b6a('0x36')],qs[_0x5b6a('0x3d')](_0x802088[_0x5b6a('0x38')][_0x5b6a('0x3d')]));_0x4a6c2a['attributes']=_0x4a6c2a['attributes'][_0x5b6a('0x3e')]?_0x4a6c2a['attributes']:_0x5f1b2b[_0x5b6a('0x36')];if(_0x802088['query'][_0x5b6a('0x4c')]){_0x4a6c2a['include']=[{'all':!![]}];}_0x4a6c2a=_[_0x5b6a('0x45')]({},_0x4a6c2a,_0x802088['options']);return db[_0x5b6a('0x32')][_0x5b6a('0x4d')](_0x4a6c2a)[_0x5b6a('0x27')](handleEntityNotFound(_0x453f0c,null))[_0x5b6a('0x27')](function(_0x468828){if(_0x468828){var _0x1c0e7e=_0x468828['get']({'plain':!![]});_0x1c0e7e=qs['omit'](_0x1c0e7e,['id',_0x5b6a('0x59'),'updatedAt']);_0x802088[_0x5b6a('0x4f')]=_[_0x5b6a('0x5a')](_0x802088['body'],['id',_0x5b6a('0x59'),'updatedAt']);return db['Dashboard'][_0x5b6a('0x4e')](_[_0x5b6a('0x45')](_0x1c0e7e,_0x802088['body']),{'include':_0x802088['query'][_0x5b6a('0x4c')]?[{'all':!![]}]:undefined})[_0x5b6a('0x27')](function(_0xd27c8c){var _0x565a4a=_0x802088[_0x5b6a('0x52')]['get']({'plain':!![]});if(!_0x565a4a)throw new Error(_0x5b6a('0x50'));if(_0x565a4a[_0x5b6a('0x51')]===_0x5b6a('0x52')){var _0x888e0d=_0xd27c8c['get']({'plain':!![]});var _0x4720e1=_0x5b6a('0x2a');return db[_0x5b6a('0x53')][_0x5b6a('0x4d')]({'where':{'name':_0x4720e1,'userProfileId':_0x565a4a['userProfileId']},'raw':!![]})[_0x5b6a('0x27')](function(_0x6b3aaa){if(_0x6b3aaa&&_0x6b3aaa[_0x5b6a('0x55')]===0x0){return db[_0x5b6a('0x2b')][_0x5b6a('0x4e')]({'name':_0x888e0d['name'],'resourceId':_0x888e0d['id'],'type':_0x6b3aaa[_0x5b6a('0x2f')],'sectionId':_0x6b3aaa['id']},{})[_0x5b6a('0x27')](function(){return _0xd27c8c;});}else{return _0xd27c8c;}})['catch'](function(_0x32eefa){logger[_0x5b6a('0x2d')](_0x5b6a('0x56'),_0x32eefa);throw _0x32eefa;});}return _0xd27c8c;});}})[_0x5b6a('0x27')](respondWithResult(_0x453f0c,0xc9))['catch'](handleError(_0x453f0c,null));};exports['update']=function(_0x32c14d,_0x1dd815){if(_0x32c14d[_0x5b6a('0x4f')]['id']){delete _0x32c14d[_0x5b6a('0x4f')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x32c14d[_0x5b6a('0x58')]['id']}})[_0x5b6a('0x27')](handleEntityNotFound(_0x1dd815,null))[_0x5b6a('0x27')](saveUpdates(_0x32c14d[_0x5b6a('0x4f')],null))['then'](respondWithResult(_0x1dd815,null))[_0x5b6a('0x4b')](handleError(_0x1dd815,null));};exports[_0x5b6a('0x28')]=function(_0x3fd942,_0x357f3d){return db[_0x5b6a('0x32')]['find']({'where':{'id':_0x3fd942[_0x5b6a('0x58')]['id']}})[_0x5b6a('0x27')](handleEntityNotFound(_0x357f3d,null))[_0x5b6a('0x27')](removeEntity(_0x357f3d,null))[_0x5b6a('0x4b')](handleError(_0x357f3d,null));};function widgetAttributes(_0xf6a3d7){try{switch(_0xf6a3d7['type']){case'iframe':return[{'name':_0x5b6a('0x5b'),'value':_0xf6a3d7['attrUrl']||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x0]?_0xf6a3d7['attrs'][0x0][_0x5b6a('0x5d')]:undefined)||_0x5b6a('0x5e')}];case _0x5b6a('0x5f'):return[{'name':_0x5b6a('0x60'),'value':_0xf6a3d7[_0x5b6a('0x60')]||(_0xf6a3d7['attrs']&&_0xf6a3d7[_0x5b6a('0x5c')][0x0]?_0xf6a3d7['attrs'][0x0][_0x5b6a('0x5d')]:undefined)||''}];case _0x5b6a('0x61'):return[{'name':_0x5b6a('0x62'),'value':_0xf6a3d7[_0x5b6a('0x62')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x0]?_0xf6a3d7['attrs'][0x0][_0x5b6a('0x5d')]:undefined)||_0x5b6a('0x63')},{'name':'attrTimezone','value':_0xf6a3d7[_0x5b6a('0x64')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x1]?_0xf6a3d7['attrs'][0x1][_0x5b6a('0x5d')]:undefined)||_0x5b6a('0x65')},{'name':_0x5b6a('0x66'),'value':_0xf6a3d7[_0x5b6a('0x66')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x2]?_0xf6a3d7[_0x5b6a('0x5c')][0x2][_0x5b6a('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0x5b6a('0x67'),'value':_0xf6a3d7[_0x5b6a('0x67')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x0]?_0xf6a3d7[_0x5b6a('0x5c')][0x0][_0x5b6a('0x5d')]:undefined)||_0x5b6a('0x68')},{'name':_0x5b6a('0x69'),'value':_0xf6a3d7['attrVoiceQueues']||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7['attrs'][0x1]?_0xf6a3d7['attrs'][0x1][_0x5b6a('0x5d')]:undefined)||[]},{'name':_0x5b6a('0x66'),'value':_0xf6a3d7[_0x5b6a('0x66')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x2]?_0xf6a3d7[_0x5b6a('0x5c')][0x2][_0x5b6a('0x5d')]:undefined)||0x14}];case _0x5b6a('0x6a'):case'pie-chart':return[{'name':_0x5b6a('0x6b'),'value':_0xf6a3d7[_0x5b6a('0x6b')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x0]?_0xf6a3d7[_0x5b6a('0x5c')][0x0]['value']:undefined)||_0x5b6a('0x68')},{'name':'attrSerie2','value':_0xf6a3d7[_0x5b6a('0x6c')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x1]?_0xf6a3d7[_0x5b6a('0x5c')][0x1][_0x5b6a('0x5d')]:undefined)||null},{'name':_0x5b6a('0x6d'),'value':_0xf6a3d7[_0x5b6a('0x6d')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x2]?_0xf6a3d7[_0x5b6a('0x5c')][0x2]['value']:undefined)||null},{'name':_0x5b6a('0x69'),'value':_0xf6a3d7[_0x5b6a('0x69')]||(_0xf6a3d7['attrs']&&_0xf6a3d7[_0x5b6a('0x5c')][0x3]?_0xf6a3d7[_0x5b6a('0x5c')][0x3][_0x5b6a('0x5d')]:undefined)||[]}];case _0x5b6a('0x6e'):return[{'name':'attrReport','type':_0xf6a3d7[_0x5b6a('0x6f')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7['attrs'][0x0]?_0xf6a3d7['attrs'][0x0][_0x5b6a('0x34')]:undefined)||null,'value':_0xf6a3d7[_0x5b6a('0x70')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7['attrs'][0x0]?_0xf6a3d7[_0x5b6a('0x5c')][0x0][_0x5b6a('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0xf6a3d7[_0x5b6a('0x71')]||(_0xf6a3d7[_0x5b6a('0x5c')]&&_0xf6a3d7[_0x5b6a('0x5c')][0x1]?_0xf6a3d7[_0x5b6a('0x5c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x306cde){logger[_0x5b6a('0x2d')](_0x5b6a('0x72'),JSON[_0x5b6a('0x73')](_0x306cde));return[];}}exports[_0x5b6a('0x74')]=function(_0x54a6dd,_0x1bf0a9,_0x485f64){if(_0x54a6dd[_0x5b6a('0x4f')]['id']){delete _0x54a6dd['body']['id'];}return db[_0x5b6a('0x32')]['find']({'where':{'id':_0x54a6dd[_0x5b6a('0x58')]['id']}})[_0x5b6a('0x27')](handleEntityNotFound(_0x1bf0a9,null))[_0x5b6a('0x27')](function(_0x330bf9){if(_0x330bf9){_0x54a6dd[_0x5b6a('0x4f')][_0x5b6a('0x75')]=_0x330bf9['id'];_0x54a6dd['body']['attrs']=widgetAttributes(_0x54a6dd[_0x5b6a('0x4f')]);return db[_0x5b6a('0x76')][_0x5b6a('0x4e')](_0x54a6dd[_0x5b6a('0x4f')]);}})[_0x5b6a('0x27')](respondWithResult(_0x1bf0a9,null))[_0x5b6a('0x4b')](handleError(_0x1bf0a9,null));};exports[_0x5b6a('0x77')]=function(_0x29eabe,_0x716a5d,_0x1055b8){var _0x299912={};var _0x1e8bbe={};var _0x1b4018;var _0x5a7157;return db[_0x5b6a('0x32')][_0x5b6a('0x78')]({'where':{'id':_0x29eabe['params']['id']}})['then'](handleEntityNotFound(_0x716a5d,null))[_0x5b6a('0x27')](function(_0xe4fe48){if(_0xe4fe48){_0x1b4018=_0xe4fe48;_0x1e8bbe[_0x5b6a('0x36')]=_[_0x5b6a('0x39')](db['DashboardItem'][_0x5b6a('0x33')]);_0x1e8bbe['query']=_[_0x5b6a('0x39')](_0x29eabe[_0x5b6a('0x38')]);_0x1e8bbe['filters']=_[_0x5b6a('0x3c')](_0x1e8bbe[_0x5b6a('0x36')],_0x1e8bbe[_0x5b6a('0x38')]);_0x299912[_0x5b6a('0x3b')]=_[_0x5b6a('0x3c')](_0x1e8bbe[_0x5b6a('0x36')],qs[_0x5b6a('0x3d')](_0x29eabe[_0x5b6a('0x38')][_0x5b6a('0x3d')]));_0x299912[_0x5b6a('0x3b')]=_0x299912[_0x5b6a('0x3b')]['length']?_0x299912[_0x5b6a('0x3b')]:_0x1e8bbe[_0x5b6a('0x36')];_0x299912[_0x5b6a('0x41')]=qs[_0x5b6a('0x42')](_0x29eabe[_0x5b6a('0x38')][_0x5b6a('0x42')]);_0x299912[_0x5b6a('0x44')]=qs[_0x5b6a('0x3a')](_['pick'](_0x29eabe['query'],_0x1e8bbe[_0x5b6a('0x3a')]));if(_0x29eabe[_0x5b6a('0x38')][_0x5b6a('0x79')]){_0x299912[_0x5b6a('0x44')]=_[_0x5b6a('0x45')](_0x299912['where'],{'$or':_[_0x5b6a('0x37')](_0x299912[_0x5b6a('0x3b')],function(_0x480b51){var _0x2b87a5={};_0x2b87a5[_0x480b51]={'$like':'%'+_0x29eabe[_0x5b6a('0x38')]['filter']+'%'};return _0x2b87a5;})});}_0x299912=_[_0x5b6a('0x45')]({},_0x299912,_0x29eabe[_0x5b6a('0x47')]);return _0x1b4018[_0x5b6a('0x77')](_0x299912);}})[_0x5b6a('0x27')](function(_0x550b07){if(_0x550b07){_0x5a7157=_0x550b07[_0x5b6a('0x3e')];if(!_0x29eabe[_0x5b6a('0x38')]['hasOwnProperty']('nolimit')){_0x299912[_0x5b6a('0x1f')]=qs[_0x5b6a('0x1f')](_0x29eabe[_0x5b6a('0x38')][_0x5b6a('0x1f')]);_0x299912[_0x5b6a('0x1d')]=qs[_0x5b6a('0x1d')](_0x29eabe['query'][_0x5b6a('0x1d')]);}return _0x1b4018[_0x5b6a('0x77')](_0x299912);}})[_0x5b6a('0x27')](function(_0x32a35e){if(_0x32a35e){return _0x32a35e?{'count':_0x5a7157,'rows':_0x32a35e}:null;}})[_0x5b6a('0x27')](respondWithResult(_0x716a5d,null))[_0x5b6a('0x4b')](handleError(_0x716a5d,null));}; \ No newline at end of file +var _0x4445=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','get','CustomDashboards','error','stack','name','send','map','Dashboard','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','params','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','autoAssociation','update','iframe','attrs','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','findOne','pick','getItems','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service'];(function(_0x904143,_0x21f98b){var _0x5f3481=function(_0x4b6d50){while(--_0x4b6d50){_0x904143['push'](_0x904143['shift']());}};_0x5f3481(++_0x21f98b);}(_0x4445,0x1c7));var _0x5444=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0x4445[_0x33a694];return _0x41ff01;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5444('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5444('0x1'));var moment=require(_0x5444('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5444('0x3'));var util=require('util');var path=require(_0x5444('0x4'));var sox=require('sox');var csv=require(_0x5444('0x5'));var ejs=require(_0x5444('0x6'));var fs=require('fs');var fs_extra=require(_0x5444('0x7'));var _=require(_0x5444('0x8'));var squel=require(_0x5444('0x9'));var crypto=require(_0x5444('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5444('0x5'));var querystring=require(_0x5444('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5444('0xc'));var qs=require(_0x5444('0xd'));var as=require(_0x5444('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5444('0xf'))(_0x5444('0x10'));var utils=require(_0x5444('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5444('0x12'))['db'];config[_0x5444('0x13')]=_[_0x5444('0x14')](config[_0x5444('0x13')],{'host':_0x5444('0x15'),'port':0x18eb});var socket=require(_0x5444('0x16'))(new Redis(config[_0x5444('0x13')]));require(_0x5444('0x17'))[_0x5444('0x18')](socket);function respondWithStatusCode(_0x3dd579,_0x374924){_0x374924=_0x374924||0xcc;return function(_0x29f471){if(_0x29f471){return _0x3dd579[_0x5444('0x19')](_0x374924);}return _0x3dd579['status'](_0x374924)[_0x5444('0x1a')]();};}function respondWithResult(_0x47c02e,_0x27a360){_0x27a360=_0x27a360||0xc8;return function(_0x324471){if(_0x324471){return _0x47c02e[_0x5444('0x1b')](_0x27a360)[_0x5444('0x1c')](_0x324471);}};}function respondWithFilteredResult(_0x163e03,_0x167268){return function(_0xbeb9a7){if(_0xbeb9a7){var _0x1323bd=typeof _0x167268[_0x5444('0x1d')]===_0x5444('0x1e')&&typeof _0x167268[_0x5444('0x1f')]===_0x5444('0x1e');var _0x1deaa6=_0xbeb9a7[_0x5444('0x20')];var _0x8bc50a=_0x1323bd?0x0:_0x167268[_0x5444('0x1d')];var _0x5a5f81=_0x1323bd?_0xbeb9a7[_0x5444('0x20')]:_0x167268['offset']+_0x167268[_0x5444('0x1f')];var _0x533468;if(_0x5a5f81>=_0x1deaa6){_0x5a5f81=_0x1deaa6;_0x533468=0xc8;}else{_0x533468=0xce;}_0x163e03[_0x5444('0x1b')](_0x533468);return _0x163e03['set'](_0x5444('0x21'),_0x8bc50a+'-'+_0x5a5f81+'/'+_0x1deaa6)[_0x5444('0x1c')](_0xbeb9a7);}return null;};}function patchUpdates(_0x377525){return function(_0x4d094c){try{jsonpatch[_0x5444('0x22')](_0x4d094c,_0x377525,!![]);}catch(_0x577d40){return BPromise[_0x5444('0x23')](_0x577d40);}return _0x4d094c['save']();};}function saveUpdates(_0x26944c,_0x465019){return function(_0x4c0279){if(_0x4c0279){return _0x4c0279['update'](_0x26944c)[_0x5444('0x24')](function(_0x295f93){return _0x295f93;});}return null;};}function removeEntity(_0x53c9e5,_0x46ab6a){return function(_0x3a46ff){if(_0x3a46ff){return _0x3a46ff[_0x5444('0x25')]()[_0x5444('0x24')](function(){var _0x3e8b8e=_0x3a46ff[_0x5444('0x26')]({'plain':!![]});var _0x861544=_0x5444('0x27');return db['UserProfileResource'][_0x5444('0x25')]({'where':{'type':_0x861544,'resourceId':_0x3e8b8e['id']}})['then'](function(){return _0x3a46ff;});})['then'](function(){_0x53c9e5[_0x5444('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2271e2,_0x3e7e8b){return function(_0x3d1c95){if(!_0x3d1c95){_0x2271e2[_0x5444('0x19')](0x194);}return _0x3d1c95;};}function handleError(_0x2f6550,_0x9f7db9){_0x9f7db9=_0x9f7db9||0x1f4;return function(_0x15c867){logger[_0x5444('0x28')](_0x15c867[_0x5444('0x29')]);if(_0x15c867[_0x5444('0x2a')]){delete _0x15c867[_0x5444('0x2a')];}_0x2f6550[_0x5444('0x1b')](_0x9f7db9)[_0x5444('0x2b')](_0x15c867);};}exports['index']=function(_0x13901c,_0x5e1bde){var _0x33d7dd={},_0x2152d3={},_0x3cdb06={'count':0x0,'rows':[]};var _0x4aa457=_[_0x5444('0x2c')](db[_0x5444('0x2d')][_0x5444('0x2e')],function(_0x876422){return{'name':_0x876422['fieldName'],'type':_0x876422[_0x5444('0x2f')][_0x5444('0x30')]};});_0x2152d3[_0x5444('0x31')]=_['map'](_0x4aa457,_0x5444('0x2a'));_0x2152d3[_0x5444('0x32')]=_[_0x5444('0x33')](_0x13901c[_0x5444('0x32')]);_0x2152d3[_0x5444('0x34')]=_[_0x5444('0x35')](_0x2152d3['model'],_0x2152d3[_0x5444('0x32')]);_0x33d7dd['attributes']=_['intersection'](_0x2152d3[_0x5444('0x31')],qs['fields'](_0x13901c[_0x5444('0x32')][_0x5444('0x36')]));_0x33d7dd[_0x5444('0x37')]=_0x33d7dd['attributes'][_0x5444('0x38')]?_0x33d7dd[_0x5444('0x37')]:_0x2152d3[_0x5444('0x31')];if(!_0x13901c[_0x5444('0x32')][_0x5444('0x39')](_0x5444('0x3a'))){_0x33d7dd[_0x5444('0x1f')]=qs[_0x5444('0x1f')](_0x13901c[_0x5444('0x32')][_0x5444('0x1f')]);_0x33d7dd[_0x5444('0x1d')]=qs[_0x5444('0x1d')](_0x13901c[_0x5444('0x32')]['offset']);}_0x33d7dd[_0x5444('0x3b')]=qs[_0x5444('0x3c')](_0x13901c[_0x5444('0x32')][_0x5444('0x3c')]);_0x33d7dd[_0x5444('0x3d')]=qs[_0x5444('0x34')](_['pick'](_0x13901c[_0x5444('0x32')],_0x2152d3['filters']),_0x4aa457);if(_0x13901c[_0x5444('0x32')][_0x5444('0x3e')]){_0x33d7dd[_0x5444('0x3d')]=_[_0x5444('0x3f')](_0x33d7dd['where'],{'$or':_[_0x5444('0x2c')](_0x4aa457,function(_0x1bab3d){if(_0x1bab3d['type']!=='VIRTUAL'){var _0x501e5c={};_0x501e5c[_0x1bab3d[_0x5444('0x2a')]]={'$like':'%'+_0x13901c[_0x5444('0x32')][_0x5444('0x3e')]+'%'};return _0x501e5c;}})});}_0x33d7dd=_[_0x5444('0x3f')]({},_0x33d7dd,_0x13901c[_0x5444('0x40')]);var _0xbd8afb={'where':_0x33d7dd[_0x5444('0x3d')]};return db[_0x5444('0x2d')][_0x5444('0x20')](_0xbd8afb)['then'](function(_0x45de1d){_0x3cdb06[_0x5444('0x20')]=_0x45de1d;if(_0x13901c[_0x5444('0x32')][_0x5444('0x41')]){_0x33d7dd[_0x5444('0x42')]=[{'all':!![]}];}return db['Dashboard'][_0x5444('0x43')](_0x33d7dd);})[_0x5444('0x24')](function(_0x597869){_0x3cdb06[_0x5444('0x44')]=_0x597869;return _0x3cdb06;})[_0x5444('0x24')](respondWithFilteredResult(_0x5e1bde,_0x33d7dd))['catch'](handleError(_0x5e1bde,null));};exports['show']=function(_0x3e3a79,_0x3b0c){var _0x116296={'raw':![],'where':{'id':_0x3e3a79[_0x5444('0x45')]['id']}},_0x53f23d={};_0x53f23d[_0x5444('0x31')]=_['keys'](db[_0x5444('0x2d')]['rawAttributes']);_0x53f23d[_0x5444('0x32')]=_[_0x5444('0x33')](_0x3e3a79[_0x5444('0x32')]);_0x53f23d[_0x5444('0x34')]=_[_0x5444('0x35')](_0x53f23d[_0x5444('0x31')],_0x53f23d[_0x5444('0x32')]);_0x116296[_0x5444('0x37')]=_['intersection'](_0x53f23d['model'],qs[_0x5444('0x36')](_0x3e3a79['query'][_0x5444('0x36')]));_0x116296[_0x5444('0x37')]=_0x116296['attributes']['length']?_0x116296[_0x5444('0x37')]:_0x53f23d[_0x5444('0x31')];if(_0x3e3a79[_0x5444('0x32')][_0x5444('0x41')]){_0x116296['include']=[{'all':!![]}];}_0x116296=_[_0x5444('0x3f')]({},_0x116296,_0x3e3a79['options']);return db['Dashboard']['find'](_0x116296)[_0x5444('0x24')](handleEntityNotFound(_0x3b0c,null))['then'](respondWithResult(_0x3b0c,null))[_0x5444('0x46')](handleError(_0x3b0c,null));};exports[_0x5444('0x47')]=function(_0x1b6804,_0x33cefc){return db[_0x5444('0x2d')]['create'](_0x1b6804[_0x5444('0x48')],{})[_0x5444('0x24')](function(_0x4f6142){var _0x427e53=_0x1b6804['user'][_0x5444('0x26')]({'plain':!![]});if(!_0x427e53)throw new Error(_0x5444('0x49'));if(_0x427e53[_0x5444('0x4a')]===_0x5444('0x4b')){var _0x3c1567=_0x4f6142[_0x5444('0x26')]({'plain':!![]});var _0x24c982=_0x5444('0x27');return db[_0x5444('0x4c')][_0x5444('0x4d')]({'where':{'name':_0x24c982,'userProfileId':_0x427e53[_0x5444('0x4e')]},'raw':!![]})[_0x5444('0x24')](function(_0x5155f9){if(_0x5155f9&&_0x5155f9['autoAssociation']===0x0){return db[_0x5444('0x4f')][_0x5444('0x47')]({'name':_0x3c1567[_0x5444('0x2a')],'resourceId':_0x3c1567['id'],'type':_0x5155f9['name'],'sectionId':_0x5155f9['id']},{})['then'](function(){return _0x4f6142;});}else{return _0x4f6142;}})['catch'](function(_0x22334e){logger['error'](_0x5444('0x50'),_0x22334e);throw _0x22334e;});}return _0x4f6142;})[_0x5444('0x24')](respondWithResult(_0x33cefc,0xc9))[_0x5444('0x46')](handleError(_0x33cefc,null));};exports[_0x5444('0x51')]=function(_0x4594c1,_0x27cff7){var _0x347cfa={'where':{'id':_0x4594c1[_0x5444('0x45')]['id']}},_0x2fe29d={};_0x2fe29d[_0x5444('0x31')]=_[_0x5444('0x33')](db['Dashboard']['rawAttributes']);_0x347cfa[_0x5444('0x37')]=_[_0x5444('0x35')](_0x2fe29d[_0x5444('0x31')],qs[_0x5444('0x36')](_0x4594c1['query'][_0x5444('0x36')]));_0x347cfa['attributes']=_0x347cfa['attributes'][_0x5444('0x38')]?_0x347cfa[_0x5444('0x37')]:_0x2fe29d[_0x5444('0x31')];if(_0x4594c1[_0x5444('0x32')]['includeAll']){_0x347cfa[_0x5444('0x42')]=[{'all':!![]}];}_0x347cfa=_[_0x5444('0x3f')]({},_0x347cfa,_0x4594c1[_0x5444('0x40')]);return db[_0x5444('0x2d')]['find'](_0x347cfa)[_0x5444('0x24')](handleEntityNotFound(_0x27cff7,null))['then'](function(_0x162ab5){if(_0x162ab5){var _0x63cca9=_0x162ab5[_0x5444('0x26')]({'plain':!![]});_0x63cca9=qs['omit'](_0x63cca9,['id',_0x5444('0x52'),_0x5444('0x53')]);_0x4594c1[_0x5444('0x48')]=_[_0x5444('0x54')](_0x4594c1[_0x5444('0x48')],['id',_0x5444('0x52'),_0x5444('0x53')]);return db['Dashboard']['create'](_['merge'](_0x63cca9,_0x4594c1[_0x5444('0x48')]),{'include':_0x4594c1[_0x5444('0x32')][_0x5444('0x41')]?[{'all':!![]}]:undefined})[_0x5444('0x24')](function(_0x4a2575){var _0x5198da=_0x4594c1[_0x5444('0x4b')]['get']({'plain':!![]});if(!_0x5198da)throw new Error(_0x5444('0x49'));if(_0x5198da['role']==='user'){var _0x2549bd=_0x4a2575[_0x5444('0x26')]({'plain':!![]});var _0x47f474=_0x5444('0x27');return db[_0x5444('0x4c')]['find']({'where':{'name':_0x47f474,'userProfileId':_0x5198da['userProfileId']},'raw':!![]})['then'](function(_0x2f7dad){if(_0x2f7dad&&_0x2f7dad[_0x5444('0x55')]===0x0){return db[_0x5444('0x4f')]['create']({'name':_0x2549bd[_0x5444('0x2a')],'resourceId':_0x2549bd['id'],'type':_0x2f7dad[_0x5444('0x2a')],'sectionId':_0x2f7dad['id']},{})[_0x5444('0x24')](function(){return _0x4a2575;});}else{return _0x4a2575;}})['catch'](function(_0x3b6551){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b6551);throw _0x3b6551;});}return _0x4a2575;});}})[_0x5444('0x24')](respondWithResult(_0x27cff7,0xc9))[_0x5444('0x46')](handleError(_0x27cff7,null));};exports[_0x5444('0x56')]=function(_0x132188,_0x157767){if(_0x132188['body']['id']){delete _0x132188[_0x5444('0x48')]['id'];}return db[_0x5444('0x2d')]['find']({'where':{'id':_0x132188[_0x5444('0x45')]['id']}})[_0x5444('0x24')](handleEntityNotFound(_0x157767,null))['then'](saveUpdates(_0x132188[_0x5444('0x48')],null))[_0x5444('0x24')](respondWithResult(_0x157767,null))[_0x5444('0x46')](handleError(_0x157767,null));};exports[_0x5444('0x25')]=function(_0x38f938,_0x5e2c1b){return db[_0x5444('0x2d')]['find']({'where':{'id':_0x38f938[_0x5444('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e2c1b,null))[_0x5444('0x24')](removeEntity(_0x5e2c1b,null))['catch'](handleError(_0x5e2c1b,null));};function widgetAttributes(_0x2827ef){try{switch(_0x2827ef[_0x5444('0x2f')]){case _0x5444('0x57'):return[{'name':'attrUrl','value':_0x2827ef['attrUrl']||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef['attrs'][0x0]['value']:undefined)||'https://'}];case'custom':return[{'name':_0x5444('0x59'),'value':_0x2827ef[_0x5444('0x59')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0]['value']:undefined)||''}];case _0x5444('0x5a'):return[{'name':_0x5444('0x5b'),'value':_0x2827ef[_0x5444('0x5b')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef['attrs'][0x0][_0x5444('0x5c')]:undefined)||_0x5444('0x5d')},{'name':_0x5444('0x5e'),'value':_0x2827ef['attrTimezone']||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef['attrs'][0x1][_0x5444('0x5c')]:undefined)||_0x5444('0x5f')},{'name':_0x5444('0x60'),'value':_0x2827ef[_0x5444('0x60')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x2]?_0x2827ef[_0x5444('0x58')][0x2][_0x5444('0x5c')]:undefined)||0xc}];case _0x5444('0x61'):return[{'name':'attrMetric','value':_0x2827ef[_0x5444('0x62')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0][_0x5444('0x5c')]:undefined)||_0x5444('0x63')},{'name':'attrVoiceQueues','value':_0x2827ef[_0x5444('0x64')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef[_0x5444('0x58')][0x1][_0x5444('0x5c')]:undefined)||[]},{'name':_0x5444('0x60'),'value':_0x2827ef[_0x5444('0x60')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x2]?_0x2827ef[_0x5444('0x58')][0x2][_0x5444('0x5c')]:undefined)||0x14}];case _0x5444('0x65'):case _0x5444('0x66'):return[{'name':_0x5444('0x67'),'value':_0x2827ef[_0x5444('0x67')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0]['value']:undefined)||_0x5444('0x63')},{'name':_0x5444('0x68'),'value':_0x2827ef[_0x5444('0x68')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef[_0x5444('0x58')][0x1][_0x5444('0x5c')]:undefined)||null},{'name':_0x5444('0x69'),'value':_0x2827ef[_0x5444('0x69')]||(_0x2827ef['attrs']&&_0x2827ef[_0x5444('0x58')][0x2]?_0x2827ef[_0x5444('0x58')][0x2][_0x5444('0x5c')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x2827ef[_0x5444('0x64')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x3]?_0x2827ef[_0x5444('0x58')][0x3][_0x5444('0x5c')]:undefined)||[]}];case _0x5444('0x6a'):return[{'name':_0x5444('0x6b'),'type':_0x2827ef[_0x5444('0x6c')]||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef['attrs'][0x0][_0x5444('0x2f')]:undefined)||null,'value':_0x2827ef['attrReport']||(_0x2827ef[_0x5444('0x58')]&&_0x2827ef[_0x5444('0x58')][0x0]?_0x2827ef[_0x5444('0x58')][0x0][_0x5444('0x5c')]:undefined)||null},{'name':_0x5444('0x6d'),'value':_0x2827ef[_0x5444('0x6d')]||(_0x2827ef['attrs']&&_0x2827ef[_0x5444('0x58')][0x1]?_0x2827ef[_0x5444('0x58')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x26232d){logger['error'](_0x5444('0x6e'),JSON['stringify'](_0x26232d));return[];}}exports[_0x5444('0x6f')]=function(_0x243012,_0x183a61,_0x34194d){if(_0x243012['body']['id']){delete _0x243012[_0x5444('0x48')]['id'];}return db['Dashboard']['find']({'where':{'id':_0x243012[_0x5444('0x45')]['id']}})[_0x5444('0x24')](handleEntityNotFound(_0x183a61,null))[_0x5444('0x24')](function(_0x20d5cd){if(_0x20d5cd){_0x243012['body'][_0x5444('0x70')]=_0x20d5cd['id'];_0x243012[_0x5444('0x48')][_0x5444('0x58')]=widgetAttributes(_0x243012[_0x5444('0x48')]);return db[_0x5444('0x71')][_0x5444('0x47')](_0x243012['body']);}})[_0x5444('0x24')](respondWithResult(_0x183a61,null))[_0x5444('0x46')](handleError(_0x183a61,null));};exports['getItems']=function(_0x38f5f8,_0x41e31c,_0x5d4d87){var _0x4a6a17={};var _0x10ed39={};var _0x13173a;var _0x5201a7;return db[_0x5444('0x2d')][_0x5444('0x72')]({'where':{'id':_0x38f5f8[_0x5444('0x45')]['id']}})[_0x5444('0x24')](handleEntityNotFound(_0x41e31c,null))[_0x5444('0x24')](function(_0x3f9120){if(_0x3f9120){_0x13173a=_0x3f9120;_0x10ed39['model']=_[_0x5444('0x33')](db[_0x5444('0x71')][_0x5444('0x2e')]);_0x10ed39[_0x5444('0x32')]=_[_0x5444('0x33')](_0x38f5f8[_0x5444('0x32')]);_0x10ed39[_0x5444('0x34')]=_['intersection'](_0x10ed39['model'],_0x10ed39[_0x5444('0x32')]);_0x4a6a17[_0x5444('0x37')]=_['intersection'](_0x10ed39['model'],qs[_0x5444('0x36')](_0x38f5f8[_0x5444('0x32')][_0x5444('0x36')]));_0x4a6a17['attributes']=_0x4a6a17['attributes'][_0x5444('0x38')]?_0x4a6a17[_0x5444('0x37')]:_0x10ed39['model'];_0x4a6a17['order']=qs['sort'](_0x38f5f8[_0x5444('0x32')][_0x5444('0x3c')]);_0x4a6a17[_0x5444('0x3d')]=qs[_0x5444('0x34')](_[_0x5444('0x73')](_0x38f5f8['query'],_0x10ed39[_0x5444('0x34')]));if(_0x38f5f8['query'][_0x5444('0x3e')]){_0x4a6a17[_0x5444('0x3d')]=_[_0x5444('0x3f')](_0x4a6a17[_0x5444('0x3d')],{'$or':_[_0x5444('0x2c')](_0x4a6a17[_0x5444('0x37')],function(_0x4d92c4){var _0x44962c={};_0x44962c[_0x4d92c4]={'$like':'%'+_0x38f5f8[_0x5444('0x32')][_0x5444('0x3e')]+'%'};return _0x44962c;})});}_0x4a6a17=_[_0x5444('0x3f')]({},_0x4a6a17,_0x38f5f8[_0x5444('0x40')]);return _0x13173a[_0x5444('0x74')](_0x4a6a17);}})[_0x5444('0x24')](function(_0x161c09){if(_0x161c09){_0x5201a7=_0x161c09[_0x5444('0x38')];if(!_0x38f5f8[_0x5444('0x32')][_0x5444('0x39')]('nolimit')){_0x4a6a17['limit']=qs[_0x5444('0x1f')](_0x38f5f8['query'][_0x5444('0x1f')]);_0x4a6a17[_0x5444('0x1d')]=qs[_0x5444('0x1d')](_0x38f5f8[_0x5444('0x32')][_0x5444('0x1d')]);}return _0x13173a[_0x5444('0x74')](_0x4a6a17);}})[_0x5444('0x24')](function(_0x5b9180){if(_0x5b9180){return _0x5b9180?{'count':_0x5201a7,'rows':_0x5b9180}:null;}})['then'](respondWithResult(_0x41e31c,null))[_0x5444('0x46')](handleError(_0x41e31c,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 6120406..4cb6a68 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 _0x619b=['emit','hasOwnProperty','hook','exports','events','Dashboard','setMaxListeners','save'];(function(_0x3a5598,_0x2f16b8){var _0x55895c=function(_0x2b9143){while(--_0x2b9143){_0x3a5598['push'](_0x3a5598['shift']());}};_0x55895c(++_0x2f16b8);}(_0x619b,0x1e4));var _0xb619=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x619b[_0x28947d];return _0x12d2ee;};'use strict';var EventEmitter=require(_0xb619('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xb619('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb619('0x2')](0x0);var events={'afterCreate':_0xb619('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5599bf){return function(_0x178a03,_0x1b1871,_0x168206){DashboardEvents[_0xb619('0x4')](_0x5599bf+':'+_0x178a03['id'],_0x178a03);DashboardEvents['emit'](_0x5599bf,_0x178a03);_0x168206(null);};}for(var e in events){if(events[_0xb619('0x5')](e)){var event=events[e];Dashboard[_0xb619('0x6')](e,emitEvent(event));}}module[_0xb619('0x7')]=DashboardEvents; \ No newline at end of file +var _0x43ef=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x43ef,0x19a));var _0xf43e=function(_0x2c82fd,_0x125b21){_0x2c82fd=_0x2c82fd-0x0;var _0x844157=_0x43ef[_0x2c82fd];return _0x844157;};'use strict';var EventEmitter=require(_0xf43e('0x0'));var Dashboard=require(_0xf43e('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xf43e('0x2')](0x0);var events={'afterCreate':_0xf43e('0x3'),'afterUpdate':_0xf43e('0x4'),'afterDestroy':_0xf43e('0x5')};function emitEvent(_0x44e2ef){return function(_0x50d999,_0x3bd5f2,_0x5d5997){DashboardEvents[_0xf43e('0x6')](_0x44e2ef+':'+_0x50d999['id'],_0x50d999);DashboardEvents[_0xf43e('0x6')](_0x44e2ef,_0x50d999);_0x5d5997(null);};}for(var e in events){if(events[_0xf43e('0x7')](e)){var event=events[e];Dashboard[_0xf43e('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 80c9fc6..a0ea262 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 _0x6715=['Dashboard','dashboards','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define'];(function(_0x2acdbb,_0x5d93b7){var _0x219ac0=function(_0xc0c1da){while(--_0xc0c1da){_0x2acdbb['push'](_0x2acdbb['shift']());}};_0x219ac0(++_0x5d93b7);}(_0x6715,0x1ee));var _0x5671=function(_0x233506,_0x26012c){_0x233506=_0x233506-0x0;var _0x3dbb5f=_0x6715[_0x233506];return _0x3dbb5f;};'use strict';var _=require(_0x5671('0x0'));var util=require(_0x5671('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5671('0x2'));var BPromise=require(_0x5671('0x3'));var rp=require(_0x5671('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5671('0x5'));var config=require(_0x5671('0x6'));var attributes=require(_0x5671('0x7'));module[_0x5671('0x8')]=function(_0x41072a,_0x38b633){return _0x41072a[_0x5671('0x9')](_0x5671('0xa'),attributes,{'tableName':_0x5671('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcefa=['../../config/environment','./dashboard.attributes','Dashboard','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x34cf0b,_0x52db28){var _0x594d84=function(_0x435b15){while(--_0x435b15){_0x34cf0b['push'](_0x34cf0b['shift']());}};_0x594d84(++_0x52db28);}(_0xcefa,0x16b));var _0xacef=function(_0x28c7a7,_0x55a356){_0x28c7a7=_0x28c7a7-0x0;var _0x50610f=_0xcefa[_0x28c7a7];return _0x50610f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xacef('0x0'))(_0xacef('0x1'));var moment=require(_0xacef('0x2'));var BPromise=require(_0xacef('0x3'));var rp=require(_0xacef('0x4'));var fs=require('fs');var path=require(_0xacef('0x5'));var rimraf=require(_0xacef('0x6'));var config=require(_0xacef('0x7'));var attributes=require(_0xacef('0x8'));module['exports']=function(_0x200357,_0x4cca40){return _0x200357['define'](_0xacef('0x9'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index f013457..7cdbaad 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 _0x8593=['ioredis','../../mysqldb','../../config/environment','client','http','defaults','localhost','socket.io-emitter','./dashboard.socket','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','Dashboard,\x20%s,\x20%s','message','catch','util'];(function(_0x49011c,_0x4bf0ef){var _0xecd631=function(_0x3f5c70){while(--_0x3f5c70){_0x49011c['push'](_0x49011c['shift']());}};_0xecd631(++_0x4bf0ef);}(_0x8593,0x167));var _0x3859=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0x8593[_0x455c6c];return _0x488242;};'use strict';var _=require('lodash');var util=require(_0x3859('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3859('0x1'));var db=require(_0x3859('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3859('0x3'));var jayson=require('jayson/promise');var client=jayson[_0x3859('0x4')][_0x3859('0x5')]({'port':0x232a});config['redis']=_[_0x3859('0x6')](config['redis'],{'host':_0x3859('0x7'),'port':0x18eb});var socket=require(_0x3859('0x8'))(new Redis(config['redis']));require(_0x3859('0x9'))['register'](socket);function respondWithRpcPromise(_0x3d88ba,_0x42a308,_0x55bc78){return new BPromise(function(_0x186333,_0xd2694d){return client['request'](_0x3d88ba,_0x55bc78)[_0x3859('0xa')](function(_0x1a6297){logger[_0x3859('0xb')]('Dashboard,\x20%s,\x20%s',_0x42a308,_0x3859('0xc'));logger[_0x3859('0xd')](_0x3859('0xe'),_0x42a308,_0x3859('0xc'),JSON['stringify'](_0x1a6297));if(_0x1a6297[_0x3859('0xf')]){if(_0x1a6297[_0x3859('0xf')][_0x3859('0x10')]===0x1f4){logger[_0x3859('0xf')](_0x3859('0x11'),_0x42a308,_0x1a6297[_0x3859('0xf')][_0x3859('0x12')]);return _0xd2694d(_0x1a6297[_0x3859('0xf')][_0x3859('0x12')]);}logger[_0x3859('0xf')]('Dashboard,\x20%s,\x20%s',_0x42a308,_0x1a6297['error'][_0x3859('0x12')]);return _0x186333(_0x1a6297['error'][_0x3859('0x12')]);}else{logger[_0x3859('0xb')](_0x3859('0x11'),_0x42a308,_0x3859('0xc'));_0x186333(_0x1a6297['result'][_0x3859('0x12')]);}})[_0x3859('0x13')](function(_0x3525f5){logger[_0x3859('0xf')](_0x3859('0x11'),_0x42a308,_0x3525f5);_0xd2694d(_0x3525f5);});});} \ No newline at end of file +var _0x8946=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x14739a,_0x3ac4e5){var _0x654e91=function(_0x1d5fe6){while(--_0x1d5fe6){_0x14739a['push'](_0x14739a['shift']());}};_0x654e91(++_0x3ac4e5);}(_0x8946,0x13e));var _0x6894=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x8946[_0x5c9307];return _0x373e29;};'use strict';var _=require(_0x6894('0x0'));var util=require(_0x6894('0x1'));var moment=require(_0x6894('0x2'));var BPromise=require('bluebird');var rs=require(_0x6894('0x3'));var fs=require('fs');var Redis=require(_0x6894('0x4'));var db=require(_0x6894('0x5'))['db'];var utils=require(_0x6894('0x6'));var logger=require(_0x6894('0x7'))(_0x6894('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6894('0x9')][_0x6894('0xa')]({'port':0x232a});config[_0x6894('0xb')]=_[_0x6894('0xc')](config[_0x6894('0xb')],{'host':_0x6894('0xd'),'port':0x18eb});var socket=require(_0x6894('0xe'))(new Redis(config['redis']));require(_0x6894('0xf'))[_0x6894('0x10')](socket);function respondWithRpcPromise(_0x40fa15,_0x4ba833,_0x3ab706){return new BPromise(function(_0x35c521,_0x3ebf01){return client['request'](_0x40fa15,_0x3ab706)[_0x6894('0x11')](function(_0x1d915a){logger[_0x6894('0x12')](_0x6894('0x13'),_0x4ba833,_0x6894('0x14'));logger[_0x6894('0x15')](_0x6894('0x16'),_0x4ba833,'request\x20sent',JSON[_0x6894('0x17')](_0x1d915a));if(_0x1d915a[_0x6894('0x18')]){if(_0x1d915a[_0x6894('0x18')][_0x6894('0x19')]===0x1f4){logger[_0x6894('0x18')](_0x6894('0x13'),_0x4ba833,_0x1d915a['error'][_0x6894('0x1a')]);return _0x3ebf01(_0x1d915a[_0x6894('0x18')][_0x6894('0x1a')]);}logger[_0x6894('0x18')](_0x6894('0x13'),_0x4ba833,_0x1d915a[_0x6894('0x18')][_0x6894('0x1a')]);return _0x35c521(_0x1d915a[_0x6894('0x18')]['message']);}else{logger[_0x6894('0x12')](_0x6894('0x13'),_0x4ba833,_0x6894('0x14'));_0x35c521(_0x1d915a[_0x6894('0x1b')]['message']);}})[_0x6894('0x1c')](function(_0x20544c){logger[_0x6894('0x18')](_0x6894('0x13'),_0x4ba833,_0x20544c);_0x3ebf01(_0x20544c);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 4e9ee71..f020dbe 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 _0xdfd2=['length','dashboard:','save','update','emit','register'];(function(_0x4adaed,_0x4a2bb1){var _0x23456e=function(_0x1af9d1){while(--_0x1af9d1){_0x4adaed['push'](_0x4adaed['shift']());}};_0x23456e(++_0x4a2bb1);}(_0xdfd2,0xda));var _0x2dfd=function(_0x32b592,_0x431aee){_0x32b592=_0x32b592-0x0;var _0x340491=_0xdfd2[_0x32b592];return _0x340491;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2dfd('0x0'),'remove',_0x2dfd('0x1')];function createListener(_0xbf242e,_0x365b07){return function(_0x339ed2){_0x365b07[_0x2dfd('0x2')](_0xbf242e,_0x339ed2);};}function removeListener(_0x54bb6a,_0x5af67b){return function(){DashboardEvents['removeListener'](_0x54bb6a,_0x5af67b);};}exports[_0x2dfd('0x3')]=function(_0x4fdae0){for(var _0x31c9d9=0x0,_0x587733=events[_0x2dfd('0x4')];_0x31c9d9<_0x587733;_0x31c9d9++){var _0x4532b1=events[_0x31c9d9];var _0x2e8525=createListener(_0x2dfd('0x5')+_0x4532b1,_0x4fdae0);DashboardEvents['on'](_0x4532b1,_0x2e8525);}}; \ No newline at end of file +var _0xc131=['emit','length','dashboard:','./dashboard.events','save','remove'];(function(_0x49a3ab,_0x22d700){var _0x155ba8=function(_0x5cf86d){while(--_0x5cf86d){_0x49a3ab['push'](_0x49a3ab['shift']());}};_0x155ba8(++_0x22d700);}(_0xc131,0x153));var _0x1c13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc131[_0x321bb2];return _0x9c12ed;};'use strict';var DashboardEvents=require(_0x1c13('0x0'));var events=[_0x1c13('0x1'),_0x1c13('0x2'),'update'];function createListener(_0x255f5a,_0x5338a1){return function(_0x2c8104){_0x5338a1[_0x1c13('0x3')](_0x255f5a,_0x2c8104);};}function removeListener(_0x2bee9e,_0x17a8bc){return function(){DashboardEvents['removeListener'](_0x2bee9e,_0x17a8bc);};}exports['register']=function(_0x1aa577){for(var _0x4fb27c=0x0,_0x5d294f=events[_0x1c13('0x4')];_0x4fb27c<_0x5d294f;_0x4fb27c++){var _0x2ebb12=events[_0x4fb27c];var _0x4615cc=createListener(_0x1c13('0x5')+_0x2ebb12,_0x1aa577);DashboardEvents['on'](_0x2ebb12,_0x4615cc);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 0e7327a..0fd05a7 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 _0xd88c=['isAuthenticated','index','/:id/items','getItems','create','post','/:id/clone','clone','addItem','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x433b83,_0x16cf16){var _0x255f3a=function(_0x348512){while(--_0x348512){_0x433b83['push'](_0x433b83['shift']());}};_0x255f3a(++_0x16cf16);}(_0xd88c,0x99));var _0xcd88=function(_0x558097,_0x5a6cc2){_0x558097=_0x558097-0x0;var _0xe80464=_0xd88c[_0x558097];return _0xe80464;};'use strict';var multer=require(_0xcd88('0x0'));var util=require(_0xcd88('0x1'));var path=require('path');var timeout=require(_0xcd88('0x2'));var express=require(_0xcd88('0x3'));var router=express[_0xcd88('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcd88('0x5'));var config=require(_0xcd88('0x6'));var controller=require('./dashboard.controller');router[_0xcd88('0x7')]('/',auth[_0xcd88('0x8')](),controller[_0xcd88('0x9')]);router[_0xcd88('0x7')]('/:id',auth[_0xcd88('0x8')](),controller['show']);router[_0xcd88('0x7')](_0xcd88('0xa'),auth[_0xcd88('0x8')](),controller[_0xcd88('0xb')]);router['post']('/',auth[_0xcd88('0x8')](),controller[_0xcd88('0xc')]);router[_0xcd88('0xd')](_0xcd88('0xe'),auth[_0xcd88('0x8')](),controller[_0xcd88('0xf')]);router['post'](_0xcd88('0xa'),auth[_0xcd88('0x8')](),controller[_0xcd88('0x10')]);router[_0xcd88('0x11')](_0xcd88('0x12'),auth[_0xcd88('0x8')](),controller[_0xcd88('0x13')]);router[_0xcd88('0x14')](_0xcd88('0x12'),auth[_0xcd88('0x8')](),controller[_0xcd88('0x15')]);module[_0xcd88('0x16')]=router; \ No newline at end of file +var _0x9433=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','index','/:id','isAuthenticated','show','getItems','post','/:id/clone','clone','/:id/items','update','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x4953df,_0x249bd9){var _0x520bf9=function(_0x31ef4d){while(--_0x31ef4d){_0x4953df['push'](_0x4953df['shift']());}};_0x520bf9(++_0x249bd9);}(_0x9433,0x19a));var _0x3943=function(_0x13fe61,_0x257256){_0x13fe61=_0x13fe61-0x0;var _0x3c1e9f=_0x9433[_0x13fe61];return _0x3c1e9f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3943('0x0'));var timeout=require(_0x3943('0x1'));var express=require(_0x3943('0x2'));var router=express[_0x3943('0x3')]();var fs_extra=require(_0x3943('0x4'));var auth=require(_0x3943('0x5'));var interaction=require(_0x3943('0x6'));var config=require(_0x3943('0x7'));var controller=require(_0x3943('0x8'));router[_0x3943('0x9')]('/',auth['isAuthenticated'](),controller[_0x3943('0xa')]);router['get'](_0x3943('0xb'),auth[_0x3943('0xc')](),controller[_0x3943('0xd')]);router[_0x3943('0x9')]('/:id/items',auth['isAuthenticated'](),controller[_0x3943('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3943('0xf')](_0x3943('0x10'),auth[_0x3943('0xc')](),controller[_0x3943('0x11')]);router[_0x3943('0xf')](_0x3943('0x12'),auth[_0x3943('0xc')](),controller['addItem']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3943('0x13')]);router[_0x3943('0x14')]('/:id',auth[_0x3943('0xc')](),controller[_0x3943('0x15')]);module[_0x3943('0x16')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index bed22b7..4e545ae 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 _0x5496=['#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','INTEGER'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5496,0x175));var _0x6549=function(_0x5c9715,_0x5cca94){_0x5c9715=_0x5c9715-0x0;var _0x652029=_0x5496[_0x5c9715];return _0x652029;};'use strict';var Sequelize=require(_0x6549('0x0'));var squel=require(_0x6549('0x1'));var _=require(_0x6549('0x2'));module[_0x6549('0x3')]={'title':{'type':Sequelize[_0x6549('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x6549('0x5')]('long'),'get':function(){try{return JSON[_0x6549('0x6')](this[_0x6549('0x7')](_0x6549('0x8')));}catch(_0x4d0473){return[];}},'set':function(_0x5a4658){try{this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify'](_0x5a4658));}catch(_0x1ca8fc){this[_0x6549('0x9')](_0x6549('0x8'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x6549('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x6549('0xa')]},'col':{'type':Sequelize[_0x6549('0xa')]},'background':{'type':Sequelize[_0x6549('0x4')],'allowNull':![],'defaultValue':_0x6549('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x6549('0x4')]},'titleFontSize':{'type':Sequelize[_0x6549('0xa')],'defaultValue':0xc}}; \ No newline at end of file +var _0xbd51=['setDataValue','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','attrs','stringify'];(function(_0x217b70,_0x289ae3){var _0xc7b236=function(_0x3c24fc){while(--_0x3c24fc){_0x217b70['push'](_0x217b70['shift']());}};_0xc7b236(++_0x289ae3);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x466a38,_0x13e5e6){_0x466a38=_0x466a38-0x0;var _0x5cdb14=_0xbd51[_0x466a38];return _0x5cdb14;};'use strict';var Sequelize=require(_0x1bd5('0x0'));var squel=require('squel');var _=require(_0x1bd5('0x1'));module[_0x1bd5('0x2')]={'title':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1bd5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x1bd5('0x4')));}catch(_0x362b24){return[];}},'set':function(_0x43e6b6){try{this['setDataValue'](_0x1bd5('0x4'),JSON[_0x1bd5('0x5')](_0x43e6b6));}catch(_0x19077c){this[_0x1bd5('0x6')](_0x1bd5('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x1bd5('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1bd5('0x7')]},'col':{'type':Sequelize[_0x1bd5('0x7')]},'background':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1bd5('0x7')],'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 cf245ae..15b5304 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 _0x1e54=['web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','params','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','./dashboardItem.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','keys','DashboardItem','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','catch','find','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x1e54,0x1e4));var _0x41e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1e54[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41e5('0x0'));var zipdir=require(_0x41e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x41e5('0x2'));var moment=require('moment');var BPromise=require(_0x41e5('0x3'));var Mustache=require(_0x41e5('0x4'));var util=require(_0x41e5('0x5'));var path=require(_0x41e5('0x6'));var sox=require(_0x41e5('0x7'));var csv=require(_0x41e5('0x8'));var ejs=require(_0x41e5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41e5('0xa'));var squel=require('squel');var crypto=require(_0x41e5('0xb'));var jsforce=require(_0x41e5('0xc'));var deskjs=require(_0x41e5('0xd'));var toCsv=require(_0x41e5('0x8'));var querystring=require('querystring');var Papa=require(_0x41e5('0xe'));var Redis=require(_0x41e5('0xf'));var authService=require(_0x41e5('0x10'));var qs=require(_0x41e5('0x11'));var as=require(_0x41e5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x41e5('0x13'))(_0x41e5('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x41e5('0x15'));var db=require(_0x41e5('0x16'))['db'];config['redis']=_[_0x41e5('0x17')](config[_0x41e5('0x18')],{'host':_0x41e5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41e5('0x18')]));require(_0x41e5('0x1a'))[_0x41e5('0x1b')](socket);function respondWithStatusCode(_0x458ccc,_0x29a98c){_0x29a98c=_0x29a98c||0xcc;return function(_0x5806d9){if(_0x5806d9){return _0x458ccc[_0x41e5('0x1c')](_0x29a98c);}return _0x458ccc[_0x41e5('0x1d')](_0x29a98c)['end']();};}function respondWithResult(_0x512865,_0x13bc4f){_0x13bc4f=_0x13bc4f||0xc8;return function(_0x20c493){if(_0x20c493){return _0x512865[_0x41e5('0x1d')](_0x13bc4f)[_0x41e5('0x1e')](_0x20c493);}};}function respondWithFilteredResult(_0x233cc3,_0x2dcf8e){return function(_0x161e99){if(_0x161e99){var _0x1c6d51=typeof _0x2dcf8e[_0x41e5('0x1f')]===_0x41e5('0x20')&&typeof _0x2dcf8e[_0x41e5('0x21')]===_0x41e5('0x20');var _0x3ecebd=_0x161e99[_0x41e5('0x22')];var _0x1655c0=_0x1c6d51?0x0:_0x2dcf8e['offset'];var _0x50dd24=_0x1c6d51?_0x161e99['count']:_0x2dcf8e[_0x41e5('0x1f')]+_0x2dcf8e[_0x41e5('0x21')];var _0x207b45;if(_0x50dd24>=_0x3ecebd){_0x50dd24=_0x3ecebd;_0x207b45=0xc8;}else{_0x207b45=0xce;}_0x233cc3[_0x41e5('0x1d')](_0x207b45);return _0x233cc3[_0x41e5('0x23')](_0x41e5('0x24'),_0x1655c0+'-'+_0x50dd24+'/'+_0x3ecebd)['json'](_0x161e99);}return null;};}function patchUpdates(_0x1fabd4){return function(_0x160031){try{jsonpatch[_0x41e5('0x25')](_0x160031,_0x1fabd4,!![]);}catch(_0x29d88d){return BPromise[_0x41e5('0x26')](_0x29d88d);}return _0x160031[_0x41e5('0x27')]();};}function saveUpdates(_0x4da52f,_0x549e55){return function(_0x4303f8){if(_0x4303f8){return _0x4303f8[_0x41e5('0x28')](_0x4da52f)[_0x41e5('0x29')](function(_0x54c1ef){return _0x54c1ef;});}return null;};}function removeEntity(_0x33e76f,_0x4d394d){return function(_0x1a7eb3){if(_0x1a7eb3){return _0x1a7eb3[_0x41e5('0x2a')]()['then'](function(){_0x33e76f[_0x41e5('0x1d')](0xcc)[_0x41e5('0x2b')]();});}};}function handleEntityNotFound(_0x4f43c2,_0x3c22f9){return function(_0x42b7cb){if(!_0x42b7cb){_0x4f43c2[_0x41e5('0x1c')](0x194);}return _0x42b7cb;};}function handleError(_0xe4fb26,_0x335253){_0x335253=_0x335253||0x1f4;return function(_0x2038a1){logger[_0x41e5('0x2c')](_0x2038a1[_0x41e5('0x2d')]);if(_0x2038a1[_0x41e5('0x2e')]){delete _0x2038a1[_0x41e5('0x2e')];}_0xe4fb26[_0x41e5('0x1d')](_0x335253)[_0x41e5('0x2f')](_0x2038a1);};}exports[_0x41e5('0x30')]=function(_0x3fb169,_0x4ed1bb){var _0x2901b8={'raw':![],'where':{'id':_0x3fb169['params']['id']}},_0x3d587e={};_0x3d587e['model']=_[_0x41e5('0x31')](db[_0x41e5('0x32')]['rawAttributes']);_0x3d587e[_0x41e5('0x33')]=_['keys'](_0x3fb169['query']);_0x3d587e[_0x41e5('0x34')]=_['intersection'](_0x3d587e[_0x41e5('0x35')],_0x3d587e[_0x41e5('0x33')]);_0x2901b8[_0x41e5('0x36')]=_[_0x41e5('0x37')](_0x3d587e[_0x41e5('0x35')],qs[_0x41e5('0x38')](_0x3fb169[_0x41e5('0x33')][_0x41e5('0x38')]));_0x2901b8[_0x41e5('0x36')]=_0x2901b8[_0x41e5('0x36')][_0x41e5('0x39')]?_0x2901b8[_0x41e5('0x36')]:_0x3d587e[_0x41e5('0x35')];if(_0x3fb169[_0x41e5('0x33')][_0x41e5('0x3a')]){_0x2901b8[_0x41e5('0x3b')]=[{'all':!![]}];}_0x2901b8=_[_0x41e5('0x3c')]({},_0x2901b8,_0x3fb169[_0x41e5('0x3d')]);return db[_0x41e5('0x32')]['find'](_0x2901b8)[_0x41e5('0x29')](handleEntityNotFound(_0x4ed1bb,null))[_0x41e5('0x29')](respondWithResult(_0x4ed1bb,null))[_0x41e5('0x3e')](handleError(_0x4ed1bb,null));};exports[_0x41e5('0x2a')]=function(_0x25a3d3,_0x8a35b3){return db[_0x41e5('0x32')][_0x41e5('0x3f')]({'where':{'id':_0x25a3d3['params']['id']}})[_0x41e5('0x29')](handleEntityNotFound(_0x8a35b3,null))[_0x41e5('0x29')](removeEntity(_0x8a35b3,null))['catch'](handleError(_0x8a35b3,null));};function widgetAttributes(_0xeff219){try{switch(_0xeff219[_0x41e5('0x40')]){case _0x41e5('0x41'):return[{'name':_0x41e5('0x42'),'value':_0xeff219['attrUrl']||(_0xeff219['attrs']&&_0xeff219[_0x41e5('0x43')][0x0]?_0xeff219['attrs'][0x0][_0x41e5('0x44')]:undefined)||_0x41e5('0x45')}];case _0x41e5('0x46'):return[{'name':_0x41e5('0x47'),'value':_0xeff219['attrPath']||(_0xeff219[_0x41e5('0x43')]&&_0xeff219['attrs'][0x0]?_0xeff219['attrs'][0x0]['value']:undefined)||''}];case _0x41e5('0x48'):return[{'name':'attrHourFormat','value':_0xeff219['attrHourFormat']||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x0]?_0xeff219[_0x41e5('0x43')][0x0][_0x41e5('0x44')]:undefined)||_0x41e5('0x49')},{'name':_0x41e5('0x4a'),'value':_0xeff219[_0x41e5('0x4a')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x1]?_0xeff219[_0x41e5('0x43')][0x1][_0x41e5('0x44')]:undefined)||_0x41e5('0x4b')},{'name':_0x41e5('0x4c'),'value':_0xeff219[_0x41e5('0x4c')]||(_0xeff219['attrs']&&_0xeff219['attrs'][0x2]?_0xeff219[_0x41e5('0x43')][0x2][_0x41e5('0x44')]:undefined)||0xc}];case _0x41e5('0x4d'):return[{'name':_0x41e5('0x4e'),'value':_0xeff219[_0x41e5('0x4e')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x0]?_0xeff219[_0x41e5('0x43')][0x0][_0x41e5('0x44')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0xeff219[_0x41e5('0x4f')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x1]?_0xeff219[_0x41e5('0x43')][0x1]['value']:undefined)||[]},{'name':_0x41e5('0x4c'),'value':_0xeff219[_0x41e5('0x4c')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219['attrs'][0x2]?_0xeff219[_0x41e5('0x43')][0x2][_0x41e5('0x44')]:undefined)||0x14}];case _0x41e5('0x50'):case _0x41e5('0x51'):return[{'name':'attrSerie1','value':_0xeff219[_0x41e5('0x52')]||(_0xeff219['attrs']&&_0xeff219[_0x41e5('0x43')][0x0]?_0xeff219[_0x41e5('0x43')][0x0][_0x41e5('0x44')]:undefined)||_0x41e5('0x53')},{'name':'attrSerie2','value':_0xeff219[_0x41e5('0x54')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x1]?_0xeff219[_0x41e5('0x43')][0x1][_0x41e5('0x44')]:undefined)||null},{'name':_0x41e5('0x55'),'value':_0xeff219['attrSerie3']||(_0xeff219[_0x41e5('0x43')]&&_0xeff219['attrs'][0x2]?_0xeff219[_0x41e5('0x43')][0x2][_0x41e5('0x44')]:undefined)||null},{'name':'attrVoiceQueues','value':_0xeff219[_0x41e5('0x4f')]||(_0xeff219['attrs']&&_0xeff219['attrs'][0x3]?_0xeff219[_0x41e5('0x43')][0x3][_0x41e5('0x44')]:undefined)||[]}];case _0x41e5('0x56'):return[{'name':_0x41e5('0x57'),'type':_0xeff219[_0x41e5('0x58')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x0]?_0xeff219[_0x41e5('0x43')][0x0][_0x41e5('0x40')]:undefined)||null,'value':_0xeff219[_0x41e5('0x57')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x0]?_0xeff219[_0x41e5('0x43')][0x0][_0x41e5('0x44')]:undefined)||null},{'name':_0x41e5('0x59'),'value':_0xeff219[_0x41e5('0x59')]||(_0xeff219[_0x41e5('0x43')]&&_0xeff219[_0x41e5('0x43')][0x1]?_0xeff219[_0x41e5('0x43')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x36e578){logger[_0x41e5('0x2c')](_0x41e5('0x5a'),JSON[_0x41e5('0x5b')](_0x36e578));return[];}}exports[_0x41e5('0x5c')]=function(_0x39f33e,_0x19059a){if(_0x39f33e[_0x41e5('0x5d')]){_0x39f33e[_0x41e5('0x5d')][_0x41e5('0x43')]=widgetAttributes(_0x39f33e[_0x41e5('0x5d')]);}return db[_0x41e5('0x32')][_0x41e5('0x5c')](_0x39f33e[_0x41e5('0x5d')],{})[_0x41e5('0x29')](respondWithResult(_0x19059a,0xc9))[_0x41e5('0x3e')](handleError(_0x19059a,null));};exports[_0x41e5('0x28')]=function(_0x1ac674,_0x3e73fc){if(_0x1ac674[_0x41e5('0x5d')]['id']){delete _0x1ac674[_0x41e5('0x5d')]['id'];}_0x1ac674[_0x41e5('0x5d')]['attrs']=widgetAttributes(_0x1ac674[_0x41e5('0x5d')]);return db[_0x41e5('0x32')][_0x41e5('0x3f')]({'where':{'id':_0x1ac674[_0x41e5('0x5e')]['id']}})[_0x41e5('0x29')](handleEntityNotFound(_0x3e73fc,null))[_0x41e5('0x29')](saveUpdates(_0x1ac674[_0x41e5('0x5d')],null))[_0x41e5('0x29')](respondWithResult(_0x3e73fc,null))[_0x41e5('0x3e')](handleError(_0x3e73fc,null));}; \ No newline at end of file +var _0x3cc5=['error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','length','attributes','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','then','destroy'];(function(_0x7f11a6,_0x19e361){var _0xe79301=function(_0x13f589){while(--_0x13f589){_0x7f11a6['push'](_0x7f11a6['shift']());}};_0xe79301(++_0x19e361);}(_0x3cc5,0x91));var _0x53cc=function(_0x164d9e,_0xcf087e){_0x164d9e=_0x164d9e-0x0;var _0x4fbc03=_0x3cc5[_0x164d9e];return _0x4fbc03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x53cc('0x0'));var zipdir=require(_0x53cc('0x1'));var jsonpatch=require(_0x53cc('0x2'));var rp=require('request-promise');var moment=require(_0x53cc('0x3'));var BPromise=require(_0x53cc('0x4'));var Mustache=require(_0x53cc('0x5'));var util=require(_0x53cc('0x6'));var path=require(_0x53cc('0x7'));var sox=require(_0x53cc('0x8'));var csv=require(_0x53cc('0x9'));var ejs=require(_0x53cc('0xa'));var fs=require('fs');var fs_extra=require(_0x53cc('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x53cc('0xc'));var jsforce=require(_0x53cc('0xd'));var deskjs=require(_0x53cc('0xe'));var toCsv=require(_0x53cc('0x9'));var querystring=require(_0x53cc('0xf'));var Papa=require(_0x53cc('0x10'));var Redis=require(_0x53cc('0x11'));var authService=require(_0x53cc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x53cc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x53cc('0x14'))(_0x53cc('0x15'));var utils=require(_0x53cc('0x16'));var config=require(_0x53cc('0x17'));var licenseUtil=require(_0x53cc('0x18'));var db=require(_0x53cc('0x19'))['db'];config[_0x53cc('0x1a')]=_[_0x53cc('0x1b')](config[_0x53cc('0x1a')],{'host':_0x53cc('0x1c'),'port':0x18eb});var socket=require(_0x53cc('0x1d'))(new Redis(config[_0x53cc('0x1a')]));require('./dashboardItem.socket')[_0x53cc('0x1e')](socket);function respondWithStatusCode(_0x2e4582,_0x95a5bf){_0x95a5bf=_0x95a5bf||0xcc;return function(_0xe7f174){if(_0xe7f174){return _0x2e4582[_0x53cc('0x1f')](_0x95a5bf);}return _0x2e4582[_0x53cc('0x20')](_0x95a5bf)['end']();};}function respondWithResult(_0x9febf1,_0x14b82c){_0x14b82c=_0x14b82c||0xc8;return function(_0x125a9d){if(_0x125a9d){return _0x9febf1[_0x53cc('0x20')](_0x14b82c)['json'](_0x125a9d);}};}function respondWithFilteredResult(_0x26b545,_0x23d727){return function(_0x4862a9){if(_0x4862a9){var _0x20eb11=typeof _0x23d727[_0x53cc('0x21')]===_0x53cc('0x22')&&typeof _0x23d727[_0x53cc('0x23')]===_0x53cc('0x22');var _0x29a330=_0x4862a9[_0x53cc('0x24')];var _0x3e3849=_0x20eb11?0x0:_0x23d727['offset'];var _0x4c9c26=_0x20eb11?_0x4862a9[_0x53cc('0x24')]:_0x23d727[_0x53cc('0x21')]+_0x23d727[_0x53cc('0x23')];var _0x3f9b82;if(_0x4c9c26>=_0x29a330){_0x4c9c26=_0x29a330;_0x3f9b82=0xc8;}else{_0x3f9b82=0xce;}_0x26b545['status'](_0x3f9b82);return _0x26b545[_0x53cc('0x25')]('Content-Range',_0x3e3849+'-'+_0x4c9c26+'/'+_0x29a330)['json'](_0x4862a9);}return null;};}function patchUpdates(_0x26fbb3){return function(_0x44e5a9){try{jsonpatch[_0x53cc('0x26')](_0x44e5a9,_0x26fbb3,!![]);}catch(_0x40479d){return BPromise[_0x53cc('0x27')](_0x40479d);}return _0x44e5a9[_0x53cc('0x28')]();};}function saveUpdates(_0x502d93,_0x2e4f55){return function(_0x4496bf){if(_0x4496bf){return _0x4496bf['update'](_0x502d93)[_0x53cc('0x29')](function(_0x4e8312){return _0x4e8312;});}return null;};}function removeEntity(_0x4fa28e,_0x86610f){return function(_0x265172){if(_0x265172){return _0x265172[_0x53cc('0x2a')]()[_0x53cc('0x29')](function(){_0x4fa28e[_0x53cc('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8d9a,_0x589510){return function(_0x1fe9aa){if(!_0x1fe9aa){_0x3c8d9a[_0x53cc('0x1f')](0x194);}return _0x1fe9aa;};}function handleError(_0x1ba739,_0x1a9bf4){_0x1a9bf4=_0x1a9bf4||0x1f4;return function(_0x443faf){logger[_0x53cc('0x2b')](_0x443faf[_0x53cc('0x2c')]);if(_0x443faf[_0x53cc('0x2d')]){delete _0x443faf[_0x53cc('0x2d')];}_0x1ba739[_0x53cc('0x20')](_0x1a9bf4)[_0x53cc('0x2e')](_0x443faf);};}exports[_0x53cc('0x2f')]=function(_0x750cf5,_0x8f1f7a){var _0x2ae712={'raw':![],'where':{'id':_0x750cf5[_0x53cc('0x30')]['id']}},_0x40c858={};_0x40c858[_0x53cc('0x31')]=_[_0x53cc('0x32')](db[_0x53cc('0x33')][_0x53cc('0x34')]);_0x40c858[_0x53cc('0x35')]=_[_0x53cc('0x32')](_0x750cf5[_0x53cc('0x35')]);_0x40c858[_0x53cc('0x36')]=_['intersection'](_0x40c858[_0x53cc('0x31')],_0x40c858[_0x53cc('0x35')]);_0x2ae712['attributes']=_[_0x53cc('0x37')](_0x40c858[_0x53cc('0x31')],qs[_0x53cc('0x38')](_0x750cf5[_0x53cc('0x35')]['fields']));_0x2ae712['attributes']=_0x2ae712['attributes'][_0x53cc('0x39')]?_0x2ae712[_0x53cc('0x3a')]:_0x40c858[_0x53cc('0x31')];if(_0x750cf5[_0x53cc('0x35')][_0x53cc('0x3b')]){_0x2ae712[_0x53cc('0x3c')]=[{'all':!![]}];}_0x2ae712=_[_0x53cc('0x3d')]({},_0x2ae712,_0x750cf5['options']);return db[_0x53cc('0x33')][_0x53cc('0x3e')](_0x2ae712)['then'](handleEntityNotFound(_0x8f1f7a,null))[_0x53cc('0x29')](respondWithResult(_0x8f1f7a,null))[_0x53cc('0x3f')](handleError(_0x8f1f7a,null));};exports[_0x53cc('0x2a')]=function(_0x3e2ab8,_0x4d971f){return db[_0x53cc('0x33')][_0x53cc('0x3e')]({'where':{'id':_0x3e2ab8[_0x53cc('0x30')]['id']}})['then'](handleEntityNotFound(_0x4d971f,null))[_0x53cc('0x29')](removeEntity(_0x4d971f,null))[_0x53cc('0x3f')](handleError(_0x4d971f,null));};function widgetAttributes(_0x38735e){try{switch(_0x38735e[_0x53cc('0x40')]){case _0x53cc('0x41'):return[{'name':_0x53cc('0x42'),'value':_0x38735e[_0x53cc('0x42')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e['attrs'][0x0][_0x53cc('0x44')]:undefined)||_0x53cc('0x45')}];case _0x53cc('0x46'):return[{'name':_0x53cc('0x47'),'value':_0x38735e[_0x53cc('0x47')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0][_0x53cc('0x44')]:undefined)||''}];case _0x53cc('0x48'):return[{'name':_0x53cc('0x49'),'value':_0x38735e[_0x53cc('0x49')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||_0x53cc('0x4a')},{'name':_0x53cc('0x4b'),'value':_0x38735e[_0x53cc('0x4b')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x1]?_0x38735e[_0x53cc('0x43')][0x1]['value']:undefined)||_0x53cc('0x4c')},{'name':'attrFontSize','value':_0x38735e[_0x53cc('0x4d')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e['attrs'][0x2]?_0x38735e['attrs'][0x2][_0x53cc('0x44')]:undefined)||0xc}];case _0x53cc('0x4e'):return[{'name':_0x53cc('0x4f'),'value':_0x38735e[_0x53cc('0x4f')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x38735e[_0x53cc('0x50')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e['attrs'][0x1]?_0x38735e[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||[]},{'name':_0x53cc('0x4d'),'value':_0x38735e[_0x53cc('0x4d')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x2]?_0x38735e['attrs'][0x2][_0x53cc('0x44')]:undefined)||0x14}];case _0x53cc('0x51'):case _0x53cc('0x52'):return[{'name':_0x53cc('0x53'),'value':_0x38735e[_0x53cc('0x53')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||_0x53cc('0x54')},{'name':_0x53cc('0x55'),'value':_0x38735e[_0x53cc('0x55')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x1]?_0x38735e[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||null},{'name':'attrSerie3','value':_0x38735e[_0x53cc('0x56')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x2]?_0x38735e[_0x53cc('0x43')][0x2]['value']:undefined)||null},{'name':_0x53cc('0x50'),'value':_0x38735e[_0x53cc('0x50')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e['attrs'][0x3]?_0x38735e['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x38735e['reportType']||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0][_0x53cc('0x40')]:undefined)||null,'value':_0x38735e[_0x53cc('0x57')]||(_0x38735e['attrs']&&_0x38735e[_0x53cc('0x43')][0x0]?_0x38735e[_0x53cc('0x43')][0x0]['value']:undefined)||null},{'name':_0x53cc('0x58'),'value':_0x38735e[_0x53cc('0x58')]||(_0x38735e[_0x53cc('0x43')]&&_0x38735e[_0x53cc('0x43')][0x1]?_0x38735e[_0x53cc('0x43')][0x1][_0x53cc('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x5004b4){logger[_0x53cc('0x2b')](_0x53cc('0x59'),JSON[_0x53cc('0x5a')](_0x5004b4));return[];}}exports[_0x53cc('0x5b')]=function(_0xa72ee3,_0x1909ed){if(_0xa72ee3[_0x53cc('0x5c')]){_0xa72ee3[_0x53cc('0x5c')][_0x53cc('0x43')]=widgetAttributes(_0xa72ee3[_0x53cc('0x5c')]);}return db[_0x53cc('0x33')][_0x53cc('0x5b')](_0xa72ee3['body'],{})[_0x53cc('0x29')](respondWithResult(_0x1909ed,0xc9))['catch'](handleError(_0x1909ed,null));};exports[_0x53cc('0x5d')]=function(_0xac8be0,_0x52bfc0){if(_0xac8be0[_0x53cc('0x5c')]['id']){delete _0xac8be0[_0x53cc('0x5c')]['id'];}_0xac8be0[_0x53cc('0x5c')]['attrs']=widgetAttributes(_0xac8be0['body']);return db[_0x53cc('0x33')]['find']({'where':{'id':_0xac8be0[_0x53cc('0x30')]['id']}})[_0x53cc('0x29')](handleEntityNotFound(_0x52bfc0,null))[_0x53cc('0x29')](saveUpdates(_0xac8be0[_0x53cc('0x5c')],null))[_0x53cc('0x29')](respondWithResult(_0x52bfc0,null))['catch'](handleError(_0x52bfc0,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e340536..3c17265 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 _0x1c3b=['update','remove','emit','hasOwnProperty','hook','events','DashboardItem','save'];(function(_0x2da230,_0x5a5dfc){var _0x3504a9=function(_0x5bc685){while(--_0x5bc685){_0x2da230['push'](_0x2da230['shift']());}};_0x3504a9(++_0x5a5dfc);}(_0x1c3b,0xa5));var _0xb1c3=function(_0x3054ae,_0x27a59a){_0x3054ae=_0x3054ae-0x0;var _0x51d740=_0x1c3b[_0x3054ae];return _0x51d740;};'use strict';var EventEmitter=require(_0xb1c3('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xb1c3('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb1c3('0x2'),'afterUpdate':_0xb1c3('0x3'),'afterDestroy':_0xb1c3('0x4')};function emitEvent(_0x2603a3){return function(_0x7248ed,_0x1d4704,_0x23cd0c){DashboardItemEvents['emit'](_0x2603a3+':'+_0x7248ed['id'],_0x7248ed);DashboardItemEvents[_0xb1c3('0x5')](_0x2603a3,_0x7248ed);_0x23cd0c(null);};}for(var e in events){if(events[_0xb1c3('0x6')](e)){var event=events[e];DashboardItem[_0xb1c3('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xe43c=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem'];(function(_0x5d7d6c,_0x7eefd0){var _0x3c195c=function(_0x497b7e){while(--_0x497b7e){_0x5d7d6c['push'](_0x5d7d6c['shift']());}};_0x3c195c(++_0x7eefd0);}(_0xe43c,0x175));var _0xce43=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe43c[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require(_0xce43('0x0'));var DashboardItem=require(_0xce43('0x1'))['db'][_0xce43('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xce43('0x3'),'afterUpdate':_0xce43('0x4'),'afterDestroy':'remove'};function emitEvent(_0x487165){return function(_0x4fd04c,_0x4f5477,_0x592d7a){DashboardItemEvents[_0xce43('0x5')](_0x487165+':'+_0x4fd04c['id'],_0x4fd04c);DashboardItemEvents[_0xce43('0x5')](_0x487165,_0x4fd04c);_0x592d7a(null);};}for(var e in events){if(events[_0xce43('0x6')](e)){var event=events[e];DashboardItem[_0xce43('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 9dde065..11e8f86 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 _0xaeef=['define','DashboardItem','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x3e0078,_0x4fd8db){var _0x5e0e51=function(_0x41043b){while(--_0x41043b){_0x3e0078['push'](_0x3e0078['shift']());}};_0x5e0e51(++_0x4fd8db);}(_0xaeef,0x161));var _0xfaee=function(_0x13305f,_0x2e3133){_0x13305f=_0x13305f-0x0;var _0x4b29bc=_0xaeef[_0x13305f];return _0x4b29bc;};'use strict';var _=require(_0xfaee('0x0'));var util=require(_0xfaee('0x1'));var logger=require(_0xfaee('0x2'))(_0xfaee('0x3'));var moment=require('moment');var BPromise=require(_0xfaee('0x4'));var rp=require(_0xfaee('0x5'));var fs=require('fs');var path=require(_0xfaee('0x6'));var rimraf=require(_0xfaee('0x7'));var config=require(_0xfaee('0x8'));var attributes=require(_0xfaee('0x9'));module[_0xfaee('0xa')]=function(_0xb5ad67,_0x3b31c){return _0xb5ad67[_0xfaee('0xb')](_0xfaee('0xc'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4036=['./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4036,0x160));var _0x6403=function(_0x34b935,_0x1b0e16){_0x34b935=_0x34b935-0x0;var _0x4acb3c=_0x4036[_0x34b935];return _0x4acb3c;};'use strict';var _=require(_0x6403('0x0'));var util=require(_0x6403('0x1'));var logger=require(_0x6403('0x2'))(_0x6403('0x3'));var moment=require('moment');var BPromise=require(_0x6403('0x4'));var rp=require(_0x6403('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6403('0x6'));var config=require(_0x6403('0x7'));var attributes=require(_0x6403('0x8'));module[_0x6403('0x9')]=function(_0x8620d9,_0x47cb1a){return _0x8620d9['define'](_0x6403('0xa'),attributes,{'tableName':_0x6403('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 1197aef..1b963f2 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 _0xdaa1=['debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s'];(function(_0x7f039f,_0x235750){var _0x4f8c21=function(_0x12f353){while(--_0x12f353){_0x7f039f['push'](_0x7f039f['shift']());}};_0x4f8c21(++_0x235750);}(_0xdaa1,0x168));var _0x1daa=function(_0x138fc2,_0x44162e){_0x138fc2=_0x138fc2-0x0;var _0x18db99=_0xdaa1[_0x138fc2];return _0x18db99;};'use strict';var _=require('lodash');var util=require(_0x1daa('0x0'));var moment=require(_0x1daa('0x1'));var BPromise=require(_0x1daa('0x2'));var rs=require(_0x1daa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1daa('0x4'))['db'];var utils=require(_0x1daa('0x5'));var logger=require('../../config/logger')(_0x1daa('0x6'));var config=require(_0x1daa('0x7'));var jayson=require(_0x1daa('0x8'));var client=jayson[_0x1daa('0x9')][_0x1daa('0xa')]({'port':0x232a});config['redis']=_[_0x1daa('0xb')](config[_0x1daa('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1daa('0xd'))[_0x1daa('0xe')](socket);function respondWithRpcPromise(_0x442484,_0x294ffa,_0x3883d2){return new BPromise(function(_0x496a34,_0x2985e3){return client[_0x1daa('0xf')](_0x442484,_0x3883d2)['then'](function(_0x142eaa){logger[_0x1daa('0x10')](_0x1daa('0x11'),_0x294ffa,'request\x20sent');logger[_0x1daa('0x12')](_0x1daa('0x13'),_0x294ffa,_0x1daa('0x14'),JSON[_0x1daa('0x15')](_0x142eaa));if(_0x142eaa[_0x1daa('0x16')]){if(_0x142eaa['error'][_0x1daa('0x17')]===0x1f4){logger[_0x1daa('0x16')]('DashboardItem,\x20%s,\x20%s',_0x294ffa,_0x142eaa[_0x1daa('0x16')][_0x1daa('0x18')]);return _0x2985e3(_0x142eaa['error'][_0x1daa('0x18')]);}logger[_0x1daa('0x16')](_0x1daa('0x11'),_0x294ffa,_0x142eaa['error']['message']);return _0x496a34(_0x142eaa[_0x1daa('0x16')]['message']);}else{logger[_0x1daa('0x10')](_0x1daa('0x11'),_0x294ffa,_0x1daa('0x14'));_0x496a34(_0x142eaa[_0x1daa('0x19')][_0x1daa('0x18')]);}})[_0x1daa('0x1a')](function(_0x1580d8){logger[_0x1daa('0x16')](_0x1daa('0x11'),_0x294ffa,_0x1580d8);_0x2985e3(_0x1580d8);});});} \ No newline at end of file +var _0x6563=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result'];(function(_0x6c5e56,_0x5eac75){var _0x19552b=function(_0x490122){while(--_0x490122){_0x6c5e56['push'](_0x6c5e56['shift']());}};_0x19552b(++_0x5eac75);}(_0x6563,0x1c2));var _0x3656=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x6563[_0x35a274];return _0x40d905;};'use strict';var _=require(_0x3656('0x0'));var util=require(_0x3656('0x1'));var moment=require('moment');var BPromise=require(_0x3656('0x2'));var rs=require(_0x3656('0x3'));var fs=require('fs');var Redis=require(_0x3656('0x4'));var db=require(_0x3656('0x5'))['db'];var utils=require(_0x3656('0x6'));var logger=require(_0x3656('0x7'))(_0x3656('0x8'));var config=require(_0x3656('0x9'));var jayson=require(_0x3656('0xa'));var client=jayson[_0x3656('0xb')][_0x3656('0xc')]({'port':0x232a});config[_0x3656('0xd')]=_[_0x3656('0xe')](config[_0x3656('0xd')],{'host':_0x3656('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3656('0xd')]));require(_0x3656('0x10'))[_0x3656('0x11')](socket);function respondWithRpcPromise(_0x3cb18f,_0x44e305,_0x12f53d){return new BPromise(function(_0x2ba908,_0x48add4){return client[_0x3656('0x12')](_0x3cb18f,_0x12f53d)[_0x3656('0x13')](function(_0x4dc5eb){logger['info'](_0x3656('0x14'),_0x44e305,'request\x20sent');logger[_0x3656('0x15')](_0x3656('0x16'),_0x44e305,_0x3656('0x17'),JSON[_0x3656('0x18')](_0x4dc5eb));if(_0x4dc5eb[_0x3656('0x19')]){if(_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1a')]===0x1f4){logger[_0x3656('0x19')](_0x3656('0x14'),_0x44e305,_0x4dc5eb[_0x3656('0x19')]['message']);return _0x48add4(_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1b')]);}logger[_0x3656('0x19')](_0x3656('0x14'),_0x44e305,_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1b')]);return _0x2ba908(_0x4dc5eb[_0x3656('0x19')][_0x3656('0x1b')]);}else{logger[_0x3656('0x1c')]('DashboardItem,\x20%s,\x20%s',_0x44e305,'request\x20sent');_0x2ba908(_0x4dc5eb[_0x3656('0x1d')]['message']);}})['catch'](function(_0xb37993){logger[_0x3656('0x19')](_0x3656('0x14'),_0x44e305,_0xb37993);_0x48add4(_0xb37993);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index e20108c..4f99a65 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 _0x3bcf=['emit','register','length','dashboardItem:','./dashboardItem.events','remove'];(function(_0x1538bf,_0x1cb008){var _0x17605b=function(_0x4eeea8){while(--_0x4eeea8){_0x1538bf['push'](_0x1538bf['shift']());}};_0x17605b(++_0x1cb008);}(_0x3bcf,0xd6));var _0xf3bc=function(_0x2927d4,_0x5ac28c){_0x2927d4=_0x2927d4-0x0;var _0x5b5901=_0x3bcf[_0x2927d4];return _0x5b5901;};'use strict';var DashboardItemEvents=require(_0xf3bc('0x0'));var events=['save',_0xf3bc('0x1'),'update'];function createListener(_0x1f998b,_0x593e4b){return function(_0xec1429){_0x593e4b[_0xf3bc('0x2')](_0x1f998b,_0xec1429);};}function removeListener(_0x193ca2,_0x251f59){return function(){DashboardItemEvents['removeListener'](_0x193ca2,_0x251f59);};}exports[_0xf3bc('0x3')]=function(_0x33ccaf){for(var _0x382310=0x0,_0x4dfea9=events[_0xf3bc('0x4')];_0x382310<_0x4dfea9;_0x382310++){var _0x3a9009=events[_0x382310];var _0x279882=createListener(_0xf3bc('0x5')+_0x3a9009,_0x33ccaf);DashboardItemEvents['on'](_0x3a9009,_0x279882);}}; \ No newline at end of file +var _0xa61f=['save','remove','update','removeListener','register','length','dashboardItem:','./dashboardItem.events'];(function(_0x116538,_0x1d9449){var _0x521263=function(_0xc68ee7){while(--_0xc68ee7){_0x116538['push'](_0x116538['shift']());}};_0x521263(++_0x1d9449);}(_0xa61f,0x1df));var _0xfa61=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa61f[_0x8c43de];return _0xa6591b;};'use strict';var DashboardItemEvents=require(_0xfa61('0x0'));var events=[_0xfa61('0x1'),_0xfa61('0x2'),_0xfa61('0x3')];function createListener(_0xc9b3dc,_0x7114f6){return function(_0x9cded4){_0x7114f6['emit'](_0xc9b3dc,_0x9cded4);};}function removeListener(_0x20324f,_0x239853){return function(){DashboardItemEvents[_0xfa61('0x4')](_0x20324f,_0x239853);};}exports[_0xfa61('0x5')]=function(_0xc36448){for(var _0x2498fb=0x0,_0x3893b9=events[_0xfa61('0x6')];_0x2498fb<_0x3893b9;_0x2498fb++){var _0x2ff828=events[_0x2498fb];var _0x3196e1=createListener(_0xfa61('0x7')+_0x2ff828,_0xc36448);DashboardItemEvents['on'](_0x2ff828,_0x3196e1);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c10e06a..be02f96 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 _0x6672=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x469ac3,_0x181973){var _0x5309e1=function(_0x36d0b0){while(--_0x36d0b0){_0x469ac3['push'](_0x469ac3['shift']());}};_0x5309e1(++_0x181973);}(_0x6672,0x1cc));var _0x2667=function(_0x57e18a,_0x199383){_0x57e18a=_0x57e18a-0x0;var _0x1181c7=_0x6672[_0x57e18a];return _0x1181c7;};'use strict';var multer=require(_0x2667('0x0'));var util=require(_0x2667('0x1'));var path=require('path');var timeout=require(_0x2667('0x2'));var express=require(_0x2667('0x3'));var router=express[_0x2667('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2667('0x5'));var interaction=require(_0x2667('0x6'));var config=require(_0x2667('0x7'));var controller=require(_0x2667('0x8'));router[_0x2667('0x9')](_0x2667('0xa'),auth[_0x2667('0xb')](),controller[_0x2667('0xc')]);router[_0x2667('0xd')]('/',auth[_0x2667('0xb')](),controller[_0x2667('0xe')]);router[_0x2667('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2667('0x10')]);router[_0x2667('0x11')](_0x2667('0xa'),auth[_0x2667('0xb')](),controller[_0x2667('0x12')]);module[_0x2667('0x13')]=router; \ No newline at end of file +var _0xc60f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','post','put','update','destroy','exports','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc60f,0x1b2));var _0xfc60=function(_0x328bd3,_0x9cf5a5){_0x328bd3=_0x328bd3-0x0;var _0x458149=_0xc60f[_0x328bd3];return _0x458149;};'use strict';var multer=require('multer');var util=require(_0xfc60('0x0'));var path=require('path');var timeout=require(_0xfc60('0x1'));var express=require(_0xfc60('0x2'));var router=express[_0xfc60('0x3')]();var fs_extra=require(_0xfc60('0x4'));var auth=require(_0xfc60('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfc60('0x6'));var controller=require(_0xfc60('0x7'));router['get'](_0xfc60('0x8'),auth[_0xfc60('0x9')](),controller['show']);router[_0xfc60('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xfc60('0xb')](_0xfc60('0x8'),auth['isAuthenticated'](),controller[_0xfc60('0xc')]);router['delete']('/:id',auth[_0xfc60('0x9')](),controller[_0xfc60('0xd')]);module[_0xfc60('0xe')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index b09ec88..698f14d 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 _0x8c66=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x19441b,_0x5a239b){var _0x16bbd7=function(_0x4f8ecb){while(--_0x4f8ecb){_0x19441b['push'](_0x19441b['shift']());}};_0x16bbd7(++_0x5a239b);}(_0x8c66,0x11e));var _0x68c6=function(_0x1ae8ab,_0x6e5c2a){_0x1ae8ab=_0x1ae8ab-0x0;var _0x1ad705=_0x8c66[_0x1ae8ab];return _0x1ad705;};'use strict';var Sequelize=require(_0x68c6('0x0'));module[_0x68c6('0x1')]={'name':{'type':Sequelize[_0x68c6('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x68c6('0x3')](_0x68c6('0x4'),_0x68c6('0x5'),_0x68c6('0x6')),'allowNull':![],'defaultValue':_0x68c6('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfbec=['exports','STRING','ENUM','first','second','third','sequelize'];(function(_0x1fddfd,_0x153a74){var _0x595b32=function(_0x2512d4){while(--_0x2512d4){_0x1fddfd['push'](_0x1fddfd['shift']());}};_0x595b32(++_0x153a74);}(_0xfbec,0x13a));var _0xcfbe=function(_0x3735a8,_0x5ad001){_0x3735a8=_0x3735a8-0x0;var _0x516404=_0xfbec[_0x3735a8];return _0x516404;};'use strict';var Sequelize=require(_0xcfbe('0x0'));module[_0xcfbe('0x1')]={'name':{'type':Sequelize[_0xcfbe('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xcfbe('0x3')](_0xcfbe('0x4'),_0xcfbe('0x5'),_0xcfbe('0x6')),'allowNull':![],'defaultValue':_0xcfbe('0x4')},'description':{'type':Sequelize[_0xcfbe('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 3da203c..386d33b 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 _0x1a96=['mustache','path','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','merge','VIRTUAL','options','where','include','rows','catch','show','params','includeAll','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x1a96,0x1a3));var _0x61a9=function(_0x3bf15e,_0x1ddb76){_0x3bf15e=_0x3bf15e-0x0;var _0x355e4a=_0x1a96[_0x3bf15e];return _0x355e4a;};'use strict';var emlformat=require(_0x61a9('0x0'));var rimraf=require(_0x61a9('0x1'));var zipdir=require(_0x61a9('0x2'));var jsonpatch=require(_0x61a9('0x3'));var rp=require('request-promise');var moment=require(_0x61a9('0x4'));var BPromise=require(_0x61a9('0x5'));var Mustache=require(_0x61a9('0x6'));var util=require('util');var path=require(_0x61a9('0x7'));var sox=require(_0x61a9('0x8'));var csv=require(_0x61a9('0x9'));var ejs=require(_0x61a9('0xa'));var fs=require('fs');var fs_extra=require(_0x61a9('0xb'));var _=require('lodash');var squel=require(_0x61a9('0xc'));var crypto=require(_0x61a9('0xd'));var jsforce=require(_0x61a9('0xe'));var deskjs=require(_0x61a9('0xf'));var toCsv=require(_0x61a9('0x9'));var querystring=require('querystring');var Papa=require(_0x61a9('0x10'));var Redis=require(_0x61a9('0x11'));var authService=require(_0x61a9('0x12'));var qs=require(_0x61a9('0x13'));var as=require(_0x61a9('0x14'));var hardwareService=require(_0x61a9('0x15'));var logger=require(_0x61a9('0x16'))(_0x61a9('0x17'));var utils=require(_0x61a9('0x18'));var config=require(_0x61a9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x61a9('0x1a'))['db'];function respondWithStatusCode(_0x5f50ef,_0x1fea99){_0x1fea99=_0x1fea99||0xcc;return function(_0x6eafc3){if(_0x6eafc3){return _0x5f50ef[_0x61a9('0x1b')](_0x1fea99);}return _0x5f50ef[_0x61a9('0x1c')](_0x1fea99)[_0x61a9('0x1d')]();};}function respondWithResult(_0x301141,_0x14ce8f){_0x14ce8f=_0x14ce8f||0xc8;return function(_0x2390b7){if(_0x2390b7){return _0x301141[_0x61a9('0x1c')](_0x14ce8f)[_0x61a9('0x1e')](_0x2390b7);}};}function respondWithFilteredResult(_0x36c1a7,_0x34f0a2){return function(_0x5d760e){if(_0x5d760e){var _0x1a51e7=typeof _0x34f0a2[_0x61a9('0x1f')]===_0x61a9('0x20')&&typeof _0x34f0a2['limit']===_0x61a9('0x20');var _0x1382bd=_0x5d760e[_0x61a9('0x21')];var _0x2cd922=_0x1a51e7?0x0:_0x34f0a2[_0x61a9('0x1f')];var _0x5725a9=_0x1a51e7?_0x5d760e[_0x61a9('0x21')]:_0x34f0a2[_0x61a9('0x1f')]+_0x34f0a2['limit'];var _0x845292;if(_0x5725a9>=_0x1382bd){_0x5725a9=_0x1382bd;_0x845292=0xc8;}else{_0x845292=0xce;}_0x36c1a7[_0x61a9('0x1c')](_0x845292);return _0x36c1a7[_0x61a9('0x22')](_0x61a9('0x23'),_0x2cd922+'-'+_0x5725a9+'/'+_0x1382bd)[_0x61a9('0x1e')](_0x5d760e);}return null;};}function patchUpdates(_0x21a654){return function(_0x187b9f){try{jsonpatch[_0x61a9('0x24')](_0x187b9f,_0x21a654,!![]);}catch(_0x59729f){return BPromise['reject'](_0x59729f);}return _0x187b9f['save']();};}function saveUpdates(_0x35f3e6,_0x233bd5){return function(_0x223324){if(_0x223324){return _0x223324[_0x61a9('0x25')](_0x35f3e6)[_0x61a9('0x26')](function(_0x527496){return _0x527496;});}return null;};}function removeEntity(_0x2bd4d3,_0x17a342){return function(_0x59c059){if(_0x59c059){return _0x59c059['destroy']()[_0x61a9('0x26')](function(){var _0x15a531=_0x59c059[_0x61a9('0x27')]({'plain':!![]});var _0x641cee=_0x61a9('0x28');return db[_0x61a9('0x29')][_0x61a9('0x2a')]({'where':{'type':_0x641cee,'resourceId':_0x15a531['id']}})['then'](function(){return _0x59c059;});})[_0x61a9('0x26')](function(){_0x2bd4d3['status'](0xcc)[_0x61a9('0x1d')]();});}};}function handleEntityNotFound(_0xac2060,_0x2e9fed){return function(_0x2ce177){if(!_0x2ce177){_0xac2060[_0x61a9('0x1b')](0x194);}return _0x2ce177;};}function handleError(_0x2dc748,_0x4e033e){_0x4e033e=_0x4e033e||0x1f4;return function(_0x55d36f){logger[_0x61a9('0x2b')](_0x55d36f[_0x61a9('0x2c')]);if(_0x55d36f[_0x61a9('0x2d')]){delete _0x55d36f['name'];}_0x2dc748[_0x61a9('0x1c')](_0x4e033e)[_0x61a9('0x2e')](_0x55d36f);};}exports[_0x61a9('0x2f')]=function(_0x4a837e,_0x2d7779){var _0x10c5c0={},_0x1f7b8c={},_0x25bc9a={'count':0x0,'rows':[]};var _0x5042e7=_[_0x61a9('0x30')](db[_0x61a9('0x31')][_0x61a9('0x32')],function(_0x24db71){return{'name':_0x24db71[_0x61a9('0x33')],'type':_0x24db71[_0x61a9('0x34')]['key']};});_0x1f7b8c[_0x61a9('0x35')]=_[_0x61a9('0x30')](_0x5042e7,_0x61a9('0x2d'));_0x1f7b8c[_0x61a9('0x36')]=_[_0x61a9('0x37')](_0x4a837e[_0x61a9('0x36')]);_0x1f7b8c['filters']=_['intersection'](_0x1f7b8c[_0x61a9('0x35')],_0x1f7b8c[_0x61a9('0x36')]);_0x10c5c0[_0x61a9('0x38')]=_[_0x61a9('0x39')](_0x1f7b8c[_0x61a9('0x35')],qs[_0x61a9('0x3a')](_0x4a837e['query'][_0x61a9('0x3a')]));_0x10c5c0[_0x61a9('0x38')]=_0x10c5c0[_0x61a9('0x38')][_0x61a9('0x3b')]?_0x10c5c0['attributes']:_0x1f7b8c[_0x61a9('0x35')];if(!_0x4a837e[_0x61a9('0x36')][_0x61a9('0x3c')](_0x61a9('0x3d'))){_0x10c5c0[_0x61a9('0x3e')]=qs['limit'](_0x4a837e[_0x61a9('0x36')][_0x61a9('0x3e')]);_0x10c5c0[_0x61a9('0x1f')]=qs['offset'](_0x4a837e[_0x61a9('0x36')]['offset']);}_0x10c5c0[_0x61a9('0x3f')]=qs[_0x61a9('0x40')](_0x4a837e['query'][_0x61a9('0x40')]);_0x10c5c0['where']=qs[_0x61a9('0x41')](_['pick'](_0x4a837e[_0x61a9('0x36')],_0x1f7b8c[_0x61a9('0x41')]),_0x5042e7);if(_0x4a837e[_0x61a9('0x36')][_0x61a9('0x42')]){_0x10c5c0['where']=_[_0x61a9('0x43')](_0x10c5c0['where'],{'$or':_[_0x61a9('0x30')](_0x5042e7,function(_0x3e3222){if(_0x3e3222[_0x61a9('0x34')]!==_0x61a9('0x44')){var _0x1076a1={};_0x1076a1[_0x3e3222[_0x61a9('0x2d')]]={'$like':'%'+_0x4a837e[_0x61a9('0x36')][_0x61a9('0x42')]+'%'};return _0x1076a1;}})});}_0x10c5c0=_['merge']({},_0x10c5c0,_0x4a837e[_0x61a9('0x45')]);var _0x4790cd={'where':_0x10c5c0[_0x61a9('0x46')]};return db[_0x61a9('0x31')][_0x61a9('0x21')](_0x4790cd)[_0x61a9('0x26')](function(_0x2a3e84){_0x25bc9a[_0x61a9('0x21')]=_0x2a3e84;if(_0x4a837e['query']['includeAll']){_0x10c5c0[_0x61a9('0x47')]=[{'all':!![]}];}return db[_0x61a9('0x31')]['findAll'](_0x10c5c0);})[_0x61a9('0x26')](function(_0x3611bb){_0x25bc9a[_0x61a9('0x48')]=_0x3611bb;return _0x25bc9a;})[_0x61a9('0x26')](respondWithFilteredResult(_0x2d7779,_0x10c5c0))[_0x61a9('0x49')](handleError(_0x2d7779,null));};exports[_0x61a9('0x4a')]=function(_0x57601b,_0x2f4ac9){var _0x13d744={'raw':!![],'where':{'id':_0x57601b[_0x61a9('0x4b')]['id']}},_0xad567e={};_0xad567e[_0x61a9('0x35')]=_['keys'](db[_0x61a9('0x31')][_0x61a9('0x32')]);_0xad567e[_0x61a9('0x36')]=_[_0x61a9('0x37')](_0x57601b['query']);_0xad567e['filters']=_[_0x61a9('0x39')](_0xad567e[_0x61a9('0x35')],_0xad567e[_0x61a9('0x36')]);_0x13d744[_0x61a9('0x38')]=_[_0x61a9('0x39')](_0xad567e['model'],qs[_0x61a9('0x3a')](_0x57601b[_0x61a9('0x36')][_0x61a9('0x3a')]));_0x13d744[_0x61a9('0x38')]=_0x13d744['attributes'][_0x61a9('0x3b')]?_0x13d744[_0x61a9('0x38')]:_0xad567e[_0x61a9('0x35')];if(_0x57601b[_0x61a9('0x36')][_0x61a9('0x4c')]){_0x13d744['include']=[{'all':!![]}];}_0x13d744=_[_0x61a9('0x43')]({},_0x13d744,_0x57601b[_0x61a9('0x45')]);return db['Disposition'][_0x61a9('0x4d')](_0x13d744)['then'](handleEntityNotFound(_0x2f4ac9,null))['then'](respondWithResult(_0x2f4ac9,null))[_0x61a9('0x49')](handleError(_0x2f4ac9,null));};exports[_0x61a9('0x4e')]=function(_0x3d2e91,_0x5ebdf3){return db['Disposition'][_0x61a9('0x4e')](_0x3d2e91[_0x61a9('0x4f')],{})[_0x61a9('0x26')](function(_0x177a86){var _0x4dd32a=_0x3d2e91[_0x61a9('0x50')][_0x61a9('0x27')]({'plain':!![]});if(!_0x4dd32a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4dd32a[_0x61a9('0x51')]===_0x61a9('0x50')){var _0x5e1391=_0x177a86[_0x61a9('0x27')]({'plain':!![]});var _0x4ce222=_0x61a9('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4ce222,'userProfileId':_0x4dd32a[_0x61a9('0x52')]},'raw':!![]})[_0x61a9('0x26')](function(_0x5a73b1){if(_0x5a73b1&&_0x5a73b1[_0x61a9('0x53')]===0x0){return db[_0x61a9('0x29')][_0x61a9('0x4e')]({'name':_0x5e1391[_0x61a9('0x2d')],'resourceId':_0x5e1391['id'],'type':_0x5a73b1[_0x61a9('0x2d')],'sectionId':_0x5a73b1['id']},{})[_0x61a9('0x26')](function(){return _0x177a86;});}else{return _0x177a86;}})[_0x61a9('0x49')](function(_0x316785){logger[_0x61a9('0x2b')](_0x61a9('0x54'),_0x316785);throw _0x316785;});}return _0x177a86;})[_0x61a9('0x26')](respondWithResult(_0x5ebdf3,0xc9))[_0x61a9('0x49')](handleError(_0x5ebdf3,null));};exports[_0x61a9('0x25')]=function(_0x275212,_0x5ec26d){if(_0x275212[_0x61a9('0x4f')]['id']){delete _0x275212[_0x61a9('0x4f')]['id'];}return db[_0x61a9('0x31')][_0x61a9('0x4d')]({'where':{'id':_0x275212[_0x61a9('0x4b')]['id']}})[_0x61a9('0x26')](handleEntityNotFound(_0x5ec26d,null))[_0x61a9('0x26')](saveUpdates(_0x275212['body'],null))[_0x61a9('0x26')](respondWithResult(_0x5ec26d,null))[_0x61a9('0x49')](handleError(_0x5ec26d,null));};exports[_0x61a9('0x2a')]=function(_0x4ca663,_0x387cbd){return db['Disposition'][_0x61a9('0x4d')]({'where':{'id':_0x4ca663[_0x61a9('0x4b')]['id']}})['then'](handleEntityNotFound(_0x387cbd,null))[_0x61a9('0x26')](removeEntity(_0x387cbd,null))['catch'](handleError(_0x387cbd,null));}; \ No newline at end of file +var _0xd9ce=['ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','reject','save','update','then','Dispositions','UserProfileResource','destroy','end','error','name','send','index','Disposition','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','map','filter','merge','options','findAll','catch','show','params','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0xc91266,_0x5091fb){var _0x39014c=function(_0x13b392){while(--_0x13b392){_0xc91266['push'](_0xc91266['shift']());}};_0x39014c(++_0x5091fb);}(_0xd9ce,0xeb));var _0xed9c=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0xd9ce[_0x1221e8];return _0x3f3041;};'use strict';var emlformat=require(_0xed9c('0x0'));var rimraf=require(_0xed9c('0x1'));var zipdir=require(_0xed9c('0x2'));var jsonpatch=require(_0xed9c('0x3'));var rp=require(_0xed9c('0x4'));var moment=require(_0xed9c('0x5'));var BPromise=require(_0xed9c('0x6'));var Mustache=require(_0xed9c('0x7'));var util=require('util');var path=require(_0xed9c('0x8'));var sox=require(_0xed9c('0x9'));var csv=require(_0xed9c('0xa'));var ejs=require(_0xed9c('0xb'));var fs=require('fs');var fs_extra=require(_0xed9c('0xc'));var _=require(_0xed9c('0xd'));var squel=require('squel');var crypto=require(_0xed9c('0xe'));var jsforce=require(_0xed9c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xed9c('0x10'));var Papa=require('papaparse');var Redis=require(_0xed9c('0x11'));var authService=require(_0xed9c('0x12'));var qs=require(_0xed9c('0x13'));var as=require(_0xed9c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed9c('0x15'))(_0xed9c('0x16'));var utils=require(_0xed9c('0x17'));var config=require(_0xed9c('0x18'));var licenseUtil=require(_0xed9c('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52be22,_0x88a8f9){_0x88a8f9=_0x88a8f9||0xcc;return function(_0x2153be){if(_0x2153be){return _0x52be22[_0xed9c('0x1a')](_0x88a8f9);}return _0x52be22[_0xed9c('0x1b')](_0x88a8f9)['end']();};}function respondWithResult(_0x5a5d8d,_0x99a5ee){_0x99a5ee=_0x99a5ee||0xc8;return function(_0x50a934){if(_0x50a934){return _0x5a5d8d[_0xed9c('0x1b')](_0x99a5ee)[_0xed9c('0x1c')](_0x50a934);}};}function respondWithFilteredResult(_0x95f79,_0x3fd63e){return function(_0x737656){if(_0x737656){var _0x22a28d=typeof _0x3fd63e[_0xed9c('0x1d')]==='undefined'&&typeof _0x3fd63e[_0xed9c('0x1e')]===_0xed9c('0x1f');var _0x2d45d9=_0x737656['count'];var _0x485029=_0x22a28d?0x0:_0x3fd63e[_0xed9c('0x1d')];var _0x48b7b4=_0x22a28d?_0x737656[_0xed9c('0x20')]:_0x3fd63e[_0xed9c('0x1d')]+_0x3fd63e[_0xed9c('0x1e')];var _0x2d432e;if(_0x48b7b4>=_0x2d45d9){_0x48b7b4=_0x2d45d9;_0x2d432e=0xc8;}else{_0x2d432e=0xce;}_0x95f79[_0xed9c('0x1b')](_0x2d432e);return _0x95f79[_0xed9c('0x21')]('Content-Range',_0x485029+'-'+_0x48b7b4+'/'+_0x2d45d9)[_0xed9c('0x1c')](_0x737656);}return null;};}function patchUpdates(_0x32c67e){return function(_0x45dc96){try{jsonpatch['apply'](_0x45dc96,_0x32c67e,!![]);}catch(_0x129c5f){return BPromise[_0xed9c('0x22')](_0x129c5f);}return _0x45dc96[_0xed9c('0x23')]();};}function saveUpdates(_0xd5bac1,_0x55ef58){return function(_0x538a70){if(_0x538a70){return _0x538a70[_0xed9c('0x24')](_0xd5bac1)[_0xed9c('0x25')](function(_0xc7a92a){return _0xc7a92a;});}return null;};}function removeEntity(_0x2ae3ce,_0x1fd75d){return function(_0x340c6){if(_0x340c6){return _0x340c6['destroy']()[_0xed9c('0x25')](function(){var _0x5b771f=_0x340c6['get']({'plain':!![]});var _0x495055=_0xed9c('0x26');return db[_0xed9c('0x27')][_0xed9c('0x28')]({'where':{'type':_0x495055,'resourceId':_0x5b771f['id']}})[_0xed9c('0x25')](function(){return _0x340c6;});})['then'](function(){_0x2ae3ce[_0xed9c('0x1b')](0xcc)[_0xed9c('0x29')]();});}};}function handleEntityNotFound(_0x262f82,_0x519ad6){return function(_0xe3be1){if(!_0xe3be1){_0x262f82[_0xed9c('0x1a')](0x194);}return _0xe3be1;};}function handleError(_0x16396b,_0x397333){_0x397333=_0x397333||0x1f4;return function(_0x548eab){logger[_0xed9c('0x2a')](_0x548eab['stack']);if(_0x548eab[_0xed9c('0x2b')]){delete _0x548eab[_0xed9c('0x2b')];}_0x16396b[_0xed9c('0x1b')](_0x397333)[_0xed9c('0x2c')](_0x548eab);};}exports[_0xed9c('0x2d')]=function(_0x4ccb84,_0x55d27e){var _0x241372={},_0x9a2584={},_0x13d128={'count':0x0,'rows':[]};var _0xf6ddf4=_['map'](db[_0xed9c('0x2e')][_0xed9c('0x2f')],function(_0x34579c){return{'name':_0x34579c[_0xed9c('0x30')],'type':_0x34579c[_0xed9c('0x31')]['key']};});_0x9a2584[_0xed9c('0x32')]=_['map'](_0xf6ddf4,_0xed9c('0x2b'));_0x9a2584[_0xed9c('0x33')]=_[_0xed9c('0x34')](_0x4ccb84[_0xed9c('0x33')]);_0x9a2584[_0xed9c('0x35')]=_[_0xed9c('0x36')](_0x9a2584[_0xed9c('0x32')],_0x9a2584[_0xed9c('0x33')]);_0x241372[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x9a2584[_0xed9c('0x32')],qs[_0xed9c('0x38')](_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x38')]));_0x241372[_0xed9c('0x37')]=_0x241372[_0xed9c('0x37')]['length']?_0x241372[_0xed9c('0x37')]:_0x9a2584[_0xed9c('0x32')];if(!_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x39')]('nolimit')){_0x241372[_0xed9c('0x1e')]=qs[_0xed9c('0x1e')](_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x1e')]);_0x241372[_0xed9c('0x1d')]=qs[_0xed9c('0x1d')](_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x1d')]);}_0x241372[_0xed9c('0x3a')]=qs[_0xed9c('0x3b')](_0x4ccb84['query']['sort']);_0x241372[_0xed9c('0x3c')]=qs[_0xed9c('0x35')](_[_0xed9c('0x3d')](_0x4ccb84['query'],_0x9a2584[_0xed9c('0x35')]),_0xf6ddf4);if(_0x4ccb84['query']['filter']){_0x241372[_0xed9c('0x3c')]=_['merge'](_0x241372['where'],{'$or':_[_0xed9c('0x3e')](_0xf6ddf4,function(_0x4ccbbf){if(_0x4ccbbf[_0xed9c('0x31')]!=='VIRTUAL'){var _0x142634={};_0x142634[_0x4ccbbf['name']]={'$like':'%'+_0x4ccb84[_0xed9c('0x33')][_0xed9c('0x3f')]+'%'};return _0x142634;}})});}_0x241372=_[_0xed9c('0x40')]({},_0x241372,_0x4ccb84[_0xed9c('0x41')]);var _0x39ffb6={'where':_0x241372[_0xed9c('0x3c')]};return db[_0xed9c('0x2e')]['count'](_0x39ffb6)[_0xed9c('0x25')](function(_0x18918f){_0x13d128[_0xed9c('0x20')]=_0x18918f;if(_0x4ccb84['query']['includeAll']){_0x241372['include']=[{'all':!![]}];}return db['Disposition'][_0xed9c('0x42')](_0x241372);})[_0xed9c('0x25')](function(_0x30894d){_0x13d128['rows']=_0x30894d;return _0x13d128;})['then'](respondWithFilteredResult(_0x55d27e,_0x241372))[_0xed9c('0x43')](handleError(_0x55d27e,null));};exports[_0xed9c('0x44')]=function(_0x1a72a8,_0x2239ed){var _0x37f6c7={'raw':!![],'where':{'id':_0x1a72a8[_0xed9c('0x45')]['id']}},_0x15b5c1={};_0x15b5c1[_0xed9c('0x32')]=_[_0xed9c('0x34')](db[_0xed9c('0x2e')][_0xed9c('0x2f')]);_0x15b5c1[_0xed9c('0x33')]=_[_0xed9c('0x34')](_0x1a72a8['query']);_0x15b5c1['filters']=_['intersection'](_0x15b5c1['model'],_0x15b5c1[_0xed9c('0x33')]);_0x37f6c7[_0xed9c('0x37')]=_[_0xed9c('0x36')](_0x15b5c1[_0xed9c('0x32')],qs[_0xed9c('0x38')](_0x1a72a8[_0xed9c('0x33')][_0xed9c('0x38')]));_0x37f6c7['attributes']=_0x37f6c7['attributes'][_0xed9c('0x46')]?_0x37f6c7[_0xed9c('0x37')]:_0x15b5c1['model'];if(_0x1a72a8[_0xed9c('0x33')]['includeAll']){_0x37f6c7[_0xed9c('0x47')]=[{'all':!![]}];}_0x37f6c7=_[_0xed9c('0x40')]({},_0x37f6c7,_0x1a72a8[_0xed9c('0x41')]);return db[_0xed9c('0x2e')]['find'](_0x37f6c7)[_0xed9c('0x25')](handleEntityNotFound(_0x2239ed,null))[_0xed9c('0x25')](respondWithResult(_0x2239ed,null))[_0xed9c('0x43')](handleError(_0x2239ed,null));};exports[_0xed9c('0x48')]=function(_0x4b488e,_0x108c46){return db['Disposition']['create'](_0x4b488e[_0xed9c('0x49')],{})[_0xed9c('0x25')](function(_0x4c7467){var _0xa6f32a=_0x4b488e[_0xed9c('0x4a')]['get']({'plain':!![]});if(!_0xa6f32a)throw new Error(_0xed9c('0x4b'));if(_0xa6f32a[_0xed9c('0x4c')]==='user'){var _0x4f304a=_0x4c7467[_0xed9c('0x4d')]({'plain':!![]});var _0x3f6584=_0xed9c('0x26');return db[_0xed9c('0x4e')][_0xed9c('0x4f')]({'where':{'name':_0x3f6584,'userProfileId':_0xa6f32a[_0xed9c('0x50')]},'raw':!![]})[_0xed9c('0x25')](function(_0x23e3d6){if(_0x23e3d6&&_0x23e3d6['autoAssociation']===0x0){return db[_0xed9c('0x27')]['create']({'name':_0x4f304a[_0xed9c('0x2b')],'resourceId':_0x4f304a['id'],'type':_0x23e3d6['name'],'sectionId':_0x23e3d6['id']},{})['then'](function(){return _0x4c7467;});}else{return _0x4c7467;}})['catch'](function(_0x5e277a){logger[_0xed9c('0x2a')](_0xed9c('0x51'),_0x5e277a);throw _0x5e277a;});}return _0x4c7467;})['then'](respondWithResult(_0x108c46,0xc9))['catch'](handleError(_0x108c46,null));};exports[_0xed9c('0x24')]=function(_0x1aa564,_0x3b829b){if(_0x1aa564[_0xed9c('0x49')]['id']){delete _0x1aa564[_0xed9c('0x49')]['id'];}return db[_0xed9c('0x2e')][_0xed9c('0x4f')]({'where':{'id':_0x1aa564[_0xed9c('0x45')]['id']}})[_0xed9c('0x25')](handleEntityNotFound(_0x3b829b,null))[_0xed9c('0x25')](saveUpdates(_0x1aa564[_0xed9c('0x49')],null))[_0xed9c('0x25')](respondWithResult(_0x3b829b,null))[_0xed9c('0x43')](handleError(_0x3b829b,null));};exports[_0xed9c('0x28')]=function(_0x337c98,_0x2b32cb){return db['Disposition'][_0xed9c('0x4f')]({'where':{'id':_0x337c98[_0xed9c('0x45')]['id']}})['then'](handleEntityNotFound(_0x2b32cb,null))[_0xed9c('0x25')](removeEntity(_0x2b32cb,null))[_0xed9c('0x43')](handleError(_0x2b32cb,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 6ae05cf..7a21932 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 _0x8e90=['name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','lodash','../../config/logger','api','moment','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice'];(function(_0x88daf4,_0x143cd7){var _0x4799b4=function(_0x4a8ecc){while(--_0x4a8ecc){_0x88daf4['push'](_0x88daf4['shift']());}};_0x4799b4(++_0x143cd7);}(_0x8e90,0x1c0));var _0x08e9=function(_0x4738b7,_0x9096f0){_0x4738b7=_0x4738b7-0x0;var _0x47cb9e=_0x8e90[_0x4738b7];return _0x47cb9e;};'use strict';var _=require(_0x08e9('0x0'));var util=require('util');var logger=require(_0x08e9('0x1'))(_0x08e9('0x2'));var moment=require(_0x08e9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x08e9('0x4'));var rimraf=require('rimraf');var config=require(_0x08e9('0x5'));var attributes=require(_0x08e9('0x6'));module[_0x08e9('0x7')]=function(_0x29a4b5,_0x3fbfd4){return _0x29a4b5[_0x08e9('0x8')](_0x08e9('0x9'),attributes,{'tableName':_0x08e9('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x08e9('0xb'),'fields':[_0x08e9('0xc'),_0x08e9('0xd')]},{'unique':!![],'name':_0x08e9('0xe'),'fields':[_0x08e9('0xc'),_0x08e9('0xf')]},{'unique':!![],'name':_0x08e9('0x10'),'fields':['name',_0x08e9('0x11')]},{'unique':!![],'name':_0x08e9('0x12'),'fields':[_0x08e9('0xc'),_0x08e9('0x13')]},{'unique':!![],'name':'name_fax','fields':[_0x08e9('0xc'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':['name','OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dfe=['FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','util','../../config/logger','api','moment','request-promise','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms'];(function(_0x2871b8,_0x13642c){var _0x201ba3=function(_0x1df301){while(--_0x1df301){_0x2871b8['push'](_0x2871b8['shift']());}};_0x201ba3(++_0x13642c);}(_0x8dfe,0x72));var _0xe8df=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8dfe[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xe8df('0x0'));var logger=require(_0xe8df('0x1'))(_0xe8df('0x2'));var moment=require(_0xe8df('0x3'));var BPromise=require('bluebird');var rp=require(_0xe8df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe8df('0x5'));var attributes=require(_0xe8df('0x6'));module[_0xe8df('0x7')]=function(_0x301866,_0x5954c8){return _0x301866[_0xe8df('0x8')](_0xe8df('0x9'),attributes,{'tableName':_0xe8df('0xa'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe8df('0xb'),'fields':[_0xe8df('0xc'),_0xe8df('0xd')]},{'unique':!![],'name':_0xe8df('0xe'),'fields':[_0xe8df('0xc'),_0xe8df('0xf')]},{'unique':!![],'name':_0xe8df('0x10'),'fields':[_0xe8df('0xc'),'MailAccountId']},{'unique':!![],'name':_0xe8df('0x11'),'fields':[_0xe8df('0xc'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':['name',_0xe8df('0x12')]},{'unique':!![],'name':_0xe8df('0x13'),'fields':['name',_0xe8df('0x14')]},{'unique':!![],'name':_0xe8df('0x15'),'fields':[_0xe8df('0xc'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 4684325..718a469 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(_0x1d3b43,_0x2f5ee6){var _0x1afe79=function(_0x1bdfba){while(--_0x1bdfba){_0x1d3b43['push'](_0x1d3b43['shift']());}};_0x1afe79(++_0x2f5ee6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0xc9b778,_0x5abaaf){var _0x403bd6=function(_0x34ae83){while(--_0x34ae83){_0xc9b778['push'](_0xc9b778['shift']());}};_0x403bd6(++_0x5abaaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 617fc81..722e735 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 _0x4600=['post','create','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x5f546b,_0x263e5e){var _0x4352d1=function(_0x4ee486){while(--_0x4ee486){_0x5f546b['push'](_0x5f546b['shift']());}};_0x4352d1(++_0x263e5e);}(_0x4600,0x9e));var _0x0460=function(_0x36eafc,_0x23fc6e){_0x36eafc=_0x36eafc-0x0;var _0x412f49=_0x4600[_0x36eafc];return _0x412f49;};'use strict';var multer=require(_0x0460('0x0'));var util=require('util');var path=require(_0x0460('0x1'));var timeout=require(_0x0460('0x2'));var express=require(_0x0460('0x3'));var router=express[_0x0460('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0460('0x5'));var interaction=require(_0x0460('0x6'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x0460('0x7')]('/',auth[_0x0460('0x8')](),controller[_0x0460('0x9')]);router[_0x0460('0x7')](_0x0460('0xa'),auth[_0x0460('0x8')](),controller[_0x0460('0xb')]);router[_0x0460('0xc')]('/',auth[_0x0460('0x8')](),controller[_0x0460('0xd')]);router['put'](_0x0460('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x0460('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0460('0xf')]);module[_0x0460('0x10')]=router; \ No newline at end of file +var _0x0774=['./disposition.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x0774,0xb5));var _0x4077=function(_0x4d6afa,_0x145d5c){_0x4d6afa=_0x4d6afa-0x0;var _0x6e9052=_0x0774[_0x4d6afa];return _0x6e9052;};'use strict';var multer=require(_0x4077('0x0'));var util=require(_0x4077('0x1'));var path=require(_0x4077('0x2'));var timeout=require(_0x4077('0x3'));var express=require(_0x4077('0x4'));var router=express[_0x4077('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4077('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4077('0x7'));var controller=require(_0x4077('0x8'));router[_0x4077('0x9')]('/',auth[_0x4077('0xa')](),controller[_0x4077('0xb')]);router[_0x4077('0x9')](_0x4077('0xc'),auth[_0x4077('0xa')](),controller[_0x4077('0xd')]);router[_0x4077('0xe')]('/',auth[_0x4077('0xa')](),controller[_0x4077('0xf')]);router[_0x4077('0x10')]('/:id',auth[_0x4077('0xa')](),controller[_0x4077('0x11')]);router[_0x4077('0x12')](_0x4077('0xc'),auth[_0x4077('0xa')](),controller[_0x4077('0x13')]);module[_0x4077('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 5137a01..81aa754 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 _0x6752=['sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','9600','12000','14400','7200','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x187063,_0xbf4408){var _0x4a65f8=function(_0x132df9){while(--_0x132df9){_0x187063['push'](_0x187063['shift']());}};_0x4a65f8(++_0xbf4408);}(_0x6752,0x96));var _0x2675=function(_0x2ebd56,_0x3cb853){_0x2ebd56=_0x2ebd56-0x0;var _0xac3965=_0x6752[_0x2ebd56];return _0xac3965;};'use strict';var Sequelize=require(_0x2675('0x0'));module[_0x2675('0x1')]={'name':{'type':Sequelize[_0x2675('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2675('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x2675('0x3'),'no'),'defaultValue':_0x2675('0x3')},'headerinfo':{'type':Sequelize[_0x2675('0x2')],'defaultValue':_0x2675('0x4')},'localstationid':{'type':Sequelize[_0x2675('0x2')],'unique':_0x2675('0x5')},'minrate':{'type':Sequelize[_0x2675('0x6')](_0x2675('0x7'),_0x2675('0x8'),'7200',_0x2675('0x9'),_0x2675('0xa'),_0x2675('0xb')),'defaultValue':_0x2675('0x8')},'maxrate':{'type':Sequelize[_0x2675('0x6')]('2400',_0x2675('0x8'),_0x2675('0xc'),_0x2675('0x9'),_0x2675('0xa'),_0x2675('0xb')),'defaultValue':_0x2675('0xb')},'modem':{'type':Sequelize[_0x2675('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x2675('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2675('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x2675('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2675('0x6')](_0x2675('0xe'),_0x2675('0xf'),_0x2675('0x10'),_0x2675('0x11')),'defaultValue':_0x2675('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2675('0x12')],'defaultValue':function(){return _0x2675('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2675('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2675('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2675('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2675('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x2675('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x2675('0x14')],'defaultValue':![],'comment':_0x2675('0x16'),'set':function(_0x4e39f7){if(!_0x4e39f7)this['setDataValue'](_0x2675('0x17'),null);this['setDataValue'](_0x2675('0x18'),_0x4e39f7);}}}; \ No newline at end of file +var _0x7429=['2400','12000','INTEGER','SIP','IAX','DADHI','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','7200','9600','14400','4800'];(function(_0x2dc3e4,_0x1e1ef4){var _0xd4bf65=function(_0x56a2ef){while(--_0x56a2ef){_0x2dc3e4['push'](_0x2dc3e4['shift']());}};_0xd4bf65(++_0x1e1ef4);}(_0x7429,0x6f));var _0x9742=function(_0x33c4ce,_0x2b3233){_0x33c4ce=_0x33c4ce-0x0;var _0x5e1890=_0x7429[_0x33c4ce];return _0x5e1890;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9742('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x9742('0x1')](_0x9742('0x2'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x9742('0x0')],'defaultValue':_0x9742('0x3')},'localstationid':{'type':Sequelize[_0x9742('0x0')],'unique':_0x9742('0x4')},'minrate':{'type':Sequelize[_0x9742('0x1')]('2400','4800',_0x9742('0x5'),_0x9742('0x6'),'12000',_0x9742('0x7')),'defaultValue':_0x9742('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0x9742('0x9'),_0x9742('0x8'),_0x9742('0x5'),'9600',_0x9742('0xa'),'14400'),'defaultValue':_0x9742('0x7')},'modem':{'type':Sequelize[_0x9742('0x0')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x9742('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x9742('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x9742('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x9742('0xc'),_0x9742('0xd'),_0x9742('0xe'),'KHOMP'),'defaultValue':_0x9742('0xc')},'key':{'type':Sequelize[_0x9742('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9742('0xf');}},'notificationSound':{'type':Sequelize[_0x9742('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9742('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9742('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x9742('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x9742('0x10')],'defaultValue':![],'comment':_0x9742('0x12'),'set':function(_0x416614){if(!_0x416614)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9742('0x13')]('mandatoryDisposition',_0x416614);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 0af38c4..5a260eb 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 _0xe7d4=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','FaxAccounts','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','includeAll','findAll','rows','catch','show','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','params','destroy','describe','FaxAccountId','getDispositions','Disposition','include','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','findOne','CmContact','Contact','Owner','fullname','internal','Tag','color','tag','addApplications','FaxApplication','findAndCountAll','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','priority','appdata','Answer','push','CDR(type)=inbound-fax','Set','ecm','gateway','headerinfo','maxrate','minrate','modem','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','bulkCreate','tech','TrunkId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','attachments','join','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','filename','user','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2078b1,_0x3e048c){var _0x57b7e8=function(_0x556f44){while(--_0x556f44){_0x2078b1['push'](_0x2078b1['shift']());}};_0x57b7e8(++_0x3e048c);}(_0xe7d4,0xae));var _0x4e7d=function(_0x262db3,_0x1da8ba){_0x262db3=_0x262db3-0x0;var _0x3ea3b2=_0xe7d4[_0x262db3];return _0x3ea3b2;};'use strict';var emlformat=require(_0x4e7d('0x0'));var rimraf=require(_0x4e7d('0x1'));var zipdir=require(_0x4e7d('0x2'));var jsonpatch=require(_0x4e7d('0x3'));var rp=require(_0x4e7d('0x4'));var moment=require('moment');var BPromise=require(_0x4e7d('0x5'));var Mustache=require(_0x4e7d('0x6'));var util=require('util');var path=require(_0x4e7d('0x7'));var sox=require(_0x4e7d('0x8'));var csv=require(_0x4e7d('0x9'));var ejs=require(_0x4e7d('0xa'));var fs=require('fs');var fs_extra=require(_0x4e7d('0xb'));var _=require(_0x4e7d('0xc'));var squel=require(_0x4e7d('0xd'));var crypto=require(_0x4e7d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4e7d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e7d('0x10'));var Papa=require(_0x4e7d('0x11'));var Redis=require(_0x4e7d('0x12'));var authService=require(_0x4e7d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e7d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x4e7d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4e7d('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x4e7d('0x17')](config[_0x4e7d('0x18')],{'host':_0x4e7d('0x19'),'port':0x18eb});var socket=require(_0x4e7d('0x1a'))(new Redis(config[_0x4e7d('0x18')]));require(_0x4e7d('0x1b'))[_0x4e7d('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4e7d('0x1d')][_0x4e7d('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x4e7d('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x544209,_0x400025,_0x36feb6,_0x138f18){return new BPromise(function(_0x180120,_0x280604){var _0x31b23d=_0x138f18||client;return _0x31b23d[_0x4e7d('0x1f')](_0x544209,_0x36feb6)[_0x4e7d('0x20')](function(_0x15fef3){logger[_0x4e7d('0x21')](_0x4e7d('0x22'),_0x400025,'request\x20sent');logger['debug'](_0x4e7d('0x23'),_0x400025,'request\x20sent',JSON[_0x4e7d('0x24')](_0x15fef3));if(_0x15fef3[_0x4e7d('0x25')]){if(_0x15fef3[_0x4e7d('0x25')][_0x4e7d('0x26')]===0x1f4){logger[_0x4e7d('0x25')]('FaxAccount,\x20%s,\x20%s',_0x400025,_0x15fef3[_0x4e7d('0x25')]['message']);return _0x280604(_0x15fef3[_0x4e7d('0x25')][_0x4e7d('0x27')]);}logger['error'](_0x4e7d('0x22'),_0x400025,_0x15fef3[_0x4e7d('0x25')][_0x4e7d('0x27')]);return _0x180120(_0x15fef3[_0x4e7d('0x25')][_0x4e7d('0x27')]);}else{logger[_0x4e7d('0x21')](_0x4e7d('0x22'),_0x400025,'request\x20sent');_0x180120(_0x15fef3[_0x4e7d('0x28')]['message']);}})['catch'](function(_0x271c40){logger[_0x4e7d('0x25')]('FaxAccount,\x20%s,\x20%s',_0x400025,_0x271c40);_0x280604(_0x271c40);});});}function respondWithStatusCode(_0x12ba41,_0x1a390c){_0x1a390c=_0x1a390c||0xcc;return function(_0x5cf363){if(_0x5cf363){return _0x12ba41['sendStatus'](_0x1a390c);}return _0x12ba41[_0x4e7d('0x29')](_0x1a390c)['end']();};}function respondWithResult(_0x45d858,_0x3b1d21){_0x3b1d21=_0x3b1d21||0xc8;return function(_0x30d747){if(_0x30d747){return _0x45d858[_0x4e7d('0x29')](_0x3b1d21)[_0x4e7d('0x2a')](_0x30d747);}};}function respondWithFilteredResult(_0xa4f949,_0x1e92df){return function(_0xd306e0){if(_0xd306e0){var _0x2faa67=typeof _0x1e92df[_0x4e7d('0x2b')]==='undefined'&&typeof _0x1e92df['limit']===_0x4e7d('0x2c');var _0xef9a1d=_0xd306e0[_0x4e7d('0x2d')];var _0x8222e0=_0x2faa67?0x0:_0x1e92df[_0x4e7d('0x2b')];var _0x54253f=_0x2faa67?_0xd306e0[_0x4e7d('0x2d')]:_0x1e92df[_0x4e7d('0x2b')]+_0x1e92df['limit'];var _0x384816;if(_0x54253f>=_0xef9a1d){_0x54253f=_0xef9a1d;_0x384816=0xc8;}else{_0x384816=0xce;}_0xa4f949[_0x4e7d('0x29')](_0x384816);return _0xa4f949[_0x4e7d('0x2e')](_0x4e7d('0x2f'),_0x8222e0+'-'+_0x54253f+'/'+_0xef9a1d)[_0x4e7d('0x2a')](_0xd306e0);}return null;};}function patchUpdates(_0x1299af){return function(_0x2555cd){try{jsonpatch[_0x4e7d('0x30')](_0x2555cd,_0x1299af,!![]);}catch(_0x48b7fb){return BPromise[_0x4e7d('0x31')](_0x48b7fb);}return _0x2555cd['save']();};}function saveUpdates(_0x3e737a,_0x529df7){return function(_0x1f50c7){if(_0x1f50c7){return _0x1f50c7[_0x4e7d('0x32')](_0x3e737a)[_0x4e7d('0x20')](function(_0x2af526){return _0x2af526;});}return null;};}function removeEntity(_0x5f3e94,_0x42ffed){return function(_0x43583c){if(_0x43583c){return _0x43583c['destroy']()[_0x4e7d('0x20')](function(){var _0x349f8e=_0x43583c['get']({'plain':!![]});var _0x499995=_0x4e7d('0x33');return db[_0x4e7d('0x34')]['destroy']({'where':{'type':_0x499995,'resourceId':_0x349f8e['id']}})[_0x4e7d('0x20')](function(){return _0x43583c;});})[_0x4e7d('0x20')](function(){_0x5f3e94[_0x4e7d('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c5add,_0x4d233c){return function(_0x367b54){if(!_0x367b54){_0x5c5add[_0x4e7d('0x35')](0x194);}return _0x367b54;};}function handleError(_0x2afa87,_0x24cda7){_0x24cda7=_0x24cda7||0x1f4;return function(_0x5375e5){logger[_0x4e7d('0x25')](_0x5375e5[_0x4e7d('0x36')]);if(_0x5375e5[_0x4e7d('0x37')]){delete _0x5375e5[_0x4e7d('0x37')];}_0x2afa87[_0x4e7d('0x29')](_0x24cda7)[_0x4e7d('0x38')](_0x5375e5);};}exports[_0x4e7d('0x39')]=function(_0x122620,_0x419d08){var _0x4b4751={'include':[{'model':db[_0x4e7d('0x3a')],'as':_0x4e7d('0x3b')}]},_0x16a297={},_0x9ba250={'count':0x0,'rows':[]};var _0x4dda11=_[_0x4e7d('0x3c')](db[_0x4e7d('0x3d')][_0x4e7d('0x3e')],function(_0x21a161){return{'name':_0x21a161['fieldName'],'type':_0x21a161[_0x4e7d('0x3f')][_0x4e7d('0x40')]};});_0x16a297[_0x4e7d('0x41')]=_[_0x4e7d('0x3c')](_0x4dda11,_0x4e7d('0x37'));_0x16a297[_0x4e7d('0x42')]=_[_0x4e7d('0x43')](_0x122620[_0x4e7d('0x42')]);_0x16a297['filters']=_[_0x4e7d('0x44')](_0x16a297[_0x4e7d('0x41')],_0x16a297['query']);_0x4b4751['attributes']=_[_0x4e7d('0x44')](_0x16a297[_0x4e7d('0x41')],qs['fields'](_0x122620[_0x4e7d('0x42')][_0x4e7d('0x45')]));_0x4b4751[_0x4e7d('0x46')]=_0x4b4751[_0x4e7d('0x46')][_0x4e7d('0x47')]?_0x4b4751[_0x4e7d('0x46')]:_0x16a297[_0x4e7d('0x41')];if(!_0x122620['query'][_0x4e7d('0x48')](_0x4e7d('0x49'))){_0x4b4751['limit']=qs[_0x4e7d('0x4a')](_0x122620['query']['limit']);_0x4b4751['offset']=qs[_0x4e7d('0x2b')](_0x122620[_0x4e7d('0x42')]['offset']);}_0x4b4751[_0x4e7d('0x4b')]=qs['sort'](_0x122620['query'][_0x4e7d('0x4c')]);_0x4b4751['where']=qs[_0x4e7d('0x4d')](_[_0x4e7d('0x4e')](_0x122620[_0x4e7d('0x42')],_0x16a297[_0x4e7d('0x4d')]),_0x4dda11);if(_0x122620[_0x4e7d('0x42')][_0x4e7d('0x4f')]){_0x4b4751[_0x4e7d('0x50')]=_[_0x4e7d('0x51')](_0x4b4751['where'],{'$or':_[_0x4e7d('0x3c')](_0x4dda11,function(_0x17681e){if(_0x17681e[_0x4e7d('0x3f')]!=='VIRTUAL'){var _0x2a48be={};_0x2a48be[_0x17681e[_0x4e7d('0x37')]]={'$like':'%'+_0x122620[_0x4e7d('0x42')][_0x4e7d('0x4f')]+'%'};return _0x2a48be;}})});}_0x4b4751=_[_0x4e7d('0x51')]({},_0x4b4751,_0x122620['options']);var _0x357371={'where':_0x4b4751[_0x4e7d('0x50')]};return db[_0x4e7d('0x3d')][_0x4e7d('0x2d')](_0x357371)['then'](function(_0x27bbe4){_0x9ba250[_0x4e7d('0x2d')]=_0x27bbe4;if(_0x122620[_0x4e7d('0x42')][_0x4e7d('0x52')]){_0x4b4751['include']=[{'all':!![]}];}return db['FaxAccount'][_0x4e7d('0x53')](_0x4b4751);})[_0x4e7d('0x20')](function(_0x4485d7){_0x9ba250[_0x4e7d('0x54')]=_0x4485d7;return _0x9ba250;})['then'](respondWithFilteredResult(_0x419d08,_0x4b4751))[_0x4e7d('0x55')](handleError(_0x419d08,null));};exports[_0x4e7d('0x56')]=function(_0x1e1de4,_0x54d913){var _0x40b590={'raw':![],'where':{'id':_0x1e1de4['params']['id']},'include':[{'model':db[_0x4e7d('0x3a')],'as':_0x4e7d('0x3b')}]},_0x4fe37f={};_0x4fe37f[_0x4e7d('0x41')]=_['keys'](db[_0x4e7d('0x3d')][_0x4e7d('0x3e')]);_0x4fe37f[_0x4e7d('0x42')]=_[_0x4e7d('0x43')](_0x1e1de4['query']);_0x4fe37f[_0x4e7d('0x4d')]=_[_0x4e7d('0x44')](_0x4fe37f[_0x4e7d('0x41')],_0x4fe37f['query']);_0x40b590[_0x4e7d('0x46')]=_[_0x4e7d('0x44')](_0x4fe37f['model'],qs[_0x4e7d('0x45')](_0x1e1de4[_0x4e7d('0x42')][_0x4e7d('0x45')]));_0x40b590[_0x4e7d('0x46')]=_0x40b590[_0x4e7d('0x46')]['length']?_0x40b590[_0x4e7d('0x46')]:_0x4fe37f[_0x4e7d('0x41')];if(_0x1e1de4['query'][_0x4e7d('0x52')]){_0x40b590['include']=[{'all':!![]}];}_0x40b590=_[_0x4e7d('0x51')]({},_0x40b590,_0x1e1de4[_0x4e7d('0x57')]);return db[_0x4e7d('0x3d')][_0x4e7d('0x58')](_0x40b590)[_0x4e7d('0x20')](handleEntityNotFound(_0x54d913,null))[_0x4e7d('0x20')](respondWithResult(_0x54d913,null))[_0x4e7d('0x55')](handleError(_0x54d913,null));};exports['create']=function(_0x1318c7,_0x23f68e){return db[_0x4e7d('0x3d')][_0x4e7d('0x59')](_0x1318c7[_0x4e7d('0x5a')],{})[_0x4e7d('0x20')](function(_0x48a401){var _0x301fdc=_0x1318c7['user']['get']({'plain':!![]});if(!_0x301fdc)throw new Error(_0x4e7d('0x5b'));if(_0x301fdc[_0x4e7d('0x5c')]==='user'){var _0x43f14d=_0x48a401[_0x4e7d('0x5d')]({'plain':!![]});var _0x4dbedb='FaxAccounts';return db[_0x4e7d('0x5e')][_0x4e7d('0x58')]({'where':{'name':_0x4dbedb,'userProfileId':_0x301fdc[_0x4e7d('0x5f')]},'raw':!![]})[_0x4e7d('0x20')](function(_0x49eedc){if(_0x49eedc&&_0x49eedc[_0x4e7d('0x60')]===0x0){return db['UserProfileResource'][_0x4e7d('0x59')]({'name':_0x43f14d[_0x4e7d('0x37')],'resourceId':_0x43f14d['id'],'type':_0x49eedc[_0x4e7d('0x37')],'sectionId':_0x49eedc['id']},{})[_0x4e7d('0x20')](function(){return _0x48a401;});}else{return _0x48a401;}})[_0x4e7d('0x55')](function(_0xeb7c9f){logger[_0x4e7d('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xeb7c9f);throw _0xeb7c9f;});}return _0x48a401;})[_0x4e7d('0x20')](respondWithResult(_0x23f68e,0xc9))['catch'](handleError(_0x23f68e,null));};exports[_0x4e7d('0x32')]=function(_0x3bb5df,_0x2a060d){if(_0x3bb5df['body']['id']){delete _0x3bb5df['body']['id'];}return db[_0x4e7d('0x3d')][_0x4e7d('0x58')]({'where':{'id':_0x3bb5df[_0x4e7d('0x61')]['id']},'include':[{'model':db[_0x4e7d('0x3a')],'as':_0x4e7d('0x3b')}]})[_0x4e7d('0x20')](handleEntityNotFound(_0x2a060d,null))[_0x4e7d('0x20')](saveUpdates(_0x3bb5df[_0x4e7d('0x5a')],null))[_0x4e7d('0x20')](respondWithResult(_0x2a060d,null))['catch'](handleError(_0x2a060d,null));};exports[_0x4e7d('0x62')]=function(_0x36d1e4,_0x25670a){return db[_0x4e7d('0x3d')][_0x4e7d('0x58')]({'where':{'id':_0x36d1e4[_0x4e7d('0x61')]['id']}})['then'](handleEntityNotFound(_0x25670a,null))['then'](removeEntity(_0x25670a,null))[_0x4e7d('0x55')](handleError(_0x25670a,null));};exports[_0x4e7d('0x63')]=function(_0x6ad370,_0x2778f0){return db[_0x4e7d('0x3d')][_0x4e7d('0x63')]()[_0x4e7d('0x20')](respondWithResult(_0x2778f0,null))['catch'](handleError(_0x2778f0,null));};exports['addDisposition']=function(_0x2d4f89,_0x33000c,_0x2ca776){if(_0x2d4f89['body']['id']){delete _0x2d4f89['body']['id'];}return db[_0x4e7d('0x3d')][_0x4e7d('0x58')]({'where':{'id':_0x2d4f89['params']['id']}})[_0x4e7d('0x20')](handleEntityNotFound(_0x33000c,null))[_0x4e7d('0x20')](function(_0x4d1f9b){if(_0x4d1f9b){_0x2d4f89[_0x4e7d('0x5a')][_0x4e7d('0x64')]=_0x4d1f9b['id'];return db['Disposition'][_0x4e7d('0x59')](_0x2d4f89[_0x4e7d('0x5a')]);}})[_0x4e7d('0x20')](respondWithResult(_0x33000c,null))['catch'](handleError(_0x33000c,null));};exports[_0x4e7d('0x65')]=function(_0x121a4d,_0x108ac1,_0x2e05be){var _0x5d657a={'raw':![],'where':{}};var _0x3a96d5={};var _0x15d705={'count':0x0,'rows':[]};return db[_0x4e7d('0x3d')]['findOne']({'where':{'id':_0x121a4d[_0x4e7d('0x61')]['id']}})['then'](handleEntityNotFound(_0x108ac1,null))[_0x4e7d('0x20')](function(_0x485441){if(_0x485441){_0x3a96d5[_0x4e7d('0x41')]=_['keys'](db[_0x4e7d('0x66')][_0x4e7d('0x3e')]);_0x3a96d5['query']=_[_0x4e7d('0x43')](_0x121a4d[_0x4e7d('0x42')]);_0x3a96d5['filters']=_[_0x4e7d('0x44')](_0x3a96d5['model'],_0x3a96d5['query']);_0x5d657a[_0x4e7d('0x46')]=_[_0x4e7d('0x44')](_0x3a96d5['model'],qs['fields'](_0x121a4d[_0x4e7d('0x42')][_0x4e7d('0x45')]));_0x5d657a[_0x4e7d('0x46')]=_0x5d657a[_0x4e7d('0x46')][_0x4e7d('0x47')]?_0x5d657a[_0x4e7d('0x46')]:_0x3a96d5['model'];if(!_0x121a4d[_0x4e7d('0x42')][_0x4e7d('0x48')](_0x4e7d('0x49'))){_0x5d657a[_0x4e7d('0x4a')]=qs[_0x4e7d('0x4a')](_0x121a4d[_0x4e7d('0x42')][_0x4e7d('0x4a')]);_0x5d657a['offset']=qs[_0x4e7d('0x2b')](_0x121a4d['query'][_0x4e7d('0x2b')]);}_0x5d657a['order']=qs['sort'](_0x121a4d[_0x4e7d('0x42')]['sort']);_0x5d657a[_0x4e7d('0x50')]=qs[_0x4e7d('0x4d')](_[_0x4e7d('0x4e')](_0x121a4d[_0x4e7d('0x42')],_0x3a96d5[_0x4e7d('0x4d')]));_0x5d657a[_0x4e7d('0x50')][_0x4e7d('0x64')]=_0x485441['id'];if(_0x121a4d[_0x4e7d('0x42')][_0x4e7d('0x4f')]){_0x5d657a[_0x4e7d('0x50')]=_[_0x4e7d('0x51')](_0x5d657a[_0x4e7d('0x50')],{'$or':_['map'](_0x5d657a[_0x4e7d('0x46')],function(_0x43bb07){var _0x34d35b={};_0x34d35b[_0x43bb07]={'$like':'%'+_0x121a4d[_0x4e7d('0x42')][_0x4e7d('0x4f')]+'%'};return _0x34d35b;})});}_0x5d657a=_[_0x4e7d('0x51')]({},_0x5d657a,_0x121a4d['options']);return db[_0x4e7d('0x66')][_0x4e7d('0x2d')]({'where':_0x5d657a['where']})[_0x4e7d('0x20')](function(_0x20b4c0){_0x15d705['count']=_0x20b4c0;if(_0x121a4d['query'][_0x4e7d('0x52')]){_0x5d657a[_0x4e7d('0x67')]=[{'all':!![]}];}return db[_0x4e7d('0x66')][_0x4e7d('0x53')](_0x5d657a);})['then'](function(_0x1022c4){_0x15d705[_0x4e7d('0x54')]=_0x1022c4;return _0x15d705;});}})[_0x4e7d('0x20')](respondWithFilteredResult(_0x108ac1,_0x5d657a))[_0x4e7d('0x55')](handleError(_0x108ac1,null));};exports[_0x4e7d('0x68')]=function(_0x5e165a,_0xfbed85,_0x19f0a5){return db[_0x4e7d('0x3d')][_0x4e7d('0x58')]({'where':{'id':_0x5e165a[_0x4e7d('0x61')]['id']}})['then'](handleEntityNotFound(_0xfbed85,null))[_0x4e7d('0x20')](function(_0x2263b1){if(_0x2263b1){return _0x2263b1[_0x4e7d('0x68')](_0x5e165a[_0x4e7d('0x42')][_0x4e7d('0x69')]);}})['then'](respondWithStatusCode(_0xfbed85,null))[_0x4e7d('0x55')](handleError(_0xfbed85,null));};exports[_0x4e7d('0x6a')]=function(_0x1ba88a,_0x390f38,_0x1ff33c){if(_0x1ba88a['body']['id']){delete _0x1ba88a['body']['id'];}return db[_0x4e7d('0x3d')]['find']({'where':{'id':_0x1ba88a[_0x4e7d('0x61')]['id']}})['then'](handleEntityNotFound(_0x390f38,null))[_0x4e7d('0x20')](function(_0x225164){if(_0x225164){_0x1ba88a[_0x4e7d('0x5a')][_0x4e7d('0x64')]=_0x225164['id'];return db['CannedAnswer'][_0x4e7d('0x59')](_0x1ba88a[_0x4e7d('0x5a')]);}})[_0x4e7d('0x20')](respondWithResult(_0x390f38,null))['catch'](handleError(_0x390f38,null));};exports['getAnswers']=function(_0x4d9b9a,_0x45234b,_0x345d50){var _0x4af947={'raw':![],'where':{}};var _0x35adb3={};var _0x159c23={'count':0x0,'rows':[]};return db[_0x4e7d('0x3d')]['findOne']({'where':{'id':_0x4d9b9a[_0x4e7d('0x61')]['id']}})['then'](handleEntityNotFound(_0x45234b,null))[_0x4e7d('0x20')](function(_0x2a72f7){if(_0x2a72f7){_0x35adb3[_0x4e7d('0x41')]=_['keys'](db[_0x4e7d('0x6b')][_0x4e7d('0x3e')]);_0x35adb3[_0x4e7d('0x42')]=_['keys'](_0x4d9b9a[_0x4e7d('0x42')]);_0x35adb3['filters']=_[_0x4e7d('0x44')](_0x35adb3[_0x4e7d('0x41')],_0x35adb3[_0x4e7d('0x42')]);_0x4af947[_0x4e7d('0x46')]=_[_0x4e7d('0x44')](_0x35adb3['model'],qs['fields'](_0x4d9b9a['query'][_0x4e7d('0x45')]));_0x4af947['attributes']=_0x4af947[_0x4e7d('0x46')]['length']?_0x4af947['attributes']:_0x35adb3['model'];if(!_0x4d9b9a[_0x4e7d('0x42')][_0x4e7d('0x48')](_0x4e7d('0x49'))){_0x4af947[_0x4e7d('0x4a')]=qs[_0x4e7d('0x4a')](_0x4d9b9a[_0x4e7d('0x42')][_0x4e7d('0x4a')]);_0x4af947[_0x4e7d('0x2b')]=qs[_0x4e7d('0x2b')](_0x4d9b9a[_0x4e7d('0x42')][_0x4e7d('0x2b')]);}_0x4af947[_0x4e7d('0x4b')]=qs[_0x4e7d('0x4c')](_0x4d9b9a['query'][_0x4e7d('0x4c')]);_0x4af947[_0x4e7d('0x50')]=qs[_0x4e7d('0x4d')](_[_0x4e7d('0x4e')](_0x4d9b9a[_0x4e7d('0x42')],_0x35adb3[_0x4e7d('0x4d')]));_0x4af947['where'][_0x4e7d('0x64')]=_0x2a72f7['id'];if(_0x4d9b9a['query'][_0x4e7d('0x4f')]){_0x4af947[_0x4e7d('0x50')]=_[_0x4e7d('0x51')](_0x4af947['where'],{'$or':_[_0x4e7d('0x3c')](_0x4af947[_0x4e7d('0x46')],function(_0x1f17e4){var _0x1fbf11={};_0x1fbf11[_0x1f17e4]={'$like':'%'+_0x4d9b9a[_0x4e7d('0x42')][_0x4e7d('0x4f')]+'%'};return _0x1fbf11;})});}_0x4af947=_[_0x4e7d('0x51')]({},_0x4af947,_0x4d9b9a[_0x4e7d('0x57')]);return db[_0x4e7d('0x6b')]['count']({'where':_0x4af947[_0x4e7d('0x50')]})[_0x4e7d('0x20')](function(_0x2fad05){_0x159c23[_0x4e7d('0x2d')]=_0x2fad05;if(_0x4d9b9a[_0x4e7d('0x42')][_0x4e7d('0x52')]){_0x4af947['include']=[{'all':!![]}];}return db[_0x4e7d('0x6b')]['findAll'](_0x4af947);})[_0x4e7d('0x20')](function(_0x5cd2b4){_0x159c23[_0x4e7d('0x54')]=_0x5cd2b4;return _0x159c23;});}})['then'](respondWithFilteredResult(_0x45234b,_0x4af947))[_0x4e7d('0x55')](handleError(_0x45234b,null));};exports[_0x4e7d('0x6c')]=function(_0x536163,_0xa3fcd9,_0x1d071d){return db['FaxAccount'][_0x4e7d('0x58')]({'where':{'id':_0x536163[_0x4e7d('0x61')]['id']}})['then'](handleEntityNotFound(_0xa3fcd9,null))[_0x4e7d('0x20')](function(_0x5d50da){if(_0x5d50da){return _0x5d50da[_0x4e7d('0x6c')](_0x536163['query'][_0x4e7d('0x69')]);}})[_0x4e7d('0x20')](respondWithStatusCode(_0xa3fcd9,null))[_0x4e7d('0x55')](handleError(_0xa3fcd9,null));};exports[_0x4e7d('0x6d')]=function(_0x2049b7,_0x44cbbe,_0x32341d){return db[_0x4e7d('0x6e')][_0x4e7d('0x58')]({'where':{'id':_0x2049b7['params']['id']}})['then'](handleEntityNotFound(_0x44cbbe,null))['then'](function(_0x3b18f0){if(_0x3b18f0){return _0x3b18f0[_0x4e7d('0x6d')](_0x2049b7['body']['ids'],_[_0x4e7d('0x6f')](_0x2049b7[_0x4e7d('0x5a')],[_0x4e7d('0x69'),'id'])||{});}})['then'](respondWithResult(_0x44cbbe,null))[_0x4e7d('0x55')](handleError(_0x44cbbe,null));};exports[_0x4e7d('0x70')]=function(_0x4bd4de,_0x1283f5,_0x3ed1c5){var _0x50f0a4={'raw':![],'where':{}};var _0x23f85f={};var _0x2471e5={'count':0x0,'rows':[]};return db[_0x4e7d('0x3d')][_0x4e7d('0x71')]({'where':{'id':_0x4bd4de['params']['id']}})[_0x4e7d('0x20')](handleEntityNotFound(_0x1283f5,null))['then'](function(_0x56a3c6){if(_0x56a3c6){_0x23f85f[_0x4e7d('0x41')]=_[_0x4e7d('0x43')](db[_0x4e7d('0x6e')][_0x4e7d('0x3e')]);_0x23f85f[_0x4e7d('0x42')]=_[_0x4e7d('0x43')](_0x4bd4de[_0x4e7d('0x42')]);_0x23f85f[_0x4e7d('0x4d')]=_[_0x4e7d('0x44')](_0x23f85f[_0x4e7d('0x41')],_0x23f85f[_0x4e7d('0x42')]);_0x50f0a4[_0x4e7d('0x46')]=_[_0x4e7d('0x44')](_0x23f85f[_0x4e7d('0x41')],qs[_0x4e7d('0x45')](_0x4bd4de['query'][_0x4e7d('0x45')]));_0x50f0a4[_0x4e7d('0x46')]=_0x50f0a4['attributes'][_0x4e7d('0x47')]?_0x50f0a4['attributes']:_0x23f85f['model'];if(!_0x4bd4de[_0x4e7d('0x42')][_0x4e7d('0x48')]('nolimit')){_0x50f0a4[_0x4e7d('0x4a')]=qs['limit'](_0x4bd4de[_0x4e7d('0x42')][_0x4e7d('0x4a')]);_0x50f0a4[_0x4e7d('0x2b')]=qs[_0x4e7d('0x2b')](_0x4bd4de['query'][_0x4e7d('0x2b')]);}_0x50f0a4[_0x4e7d('0x4b')]=qs[_0x4e7d('0x4c')](_0x4bd4de[_0x4e7d('0x42')]['sort']);_0x50f0a4[_0x4e7d('0x50')]=qs[_0x4e7d('0x4d')](_[_0x4e7d('0x4e')](_0x4bd4de['query'],_0x23f85f['filters']));_0x50f0a4['where']['FaxAccountId']=_0x56a3c6['id'];if(_0x4bd4de['query'][_0x4e7d('0x4f')]){_0x50f0a4['where']=_[_0x4e7d('0x51')](_0x50f0a4['where'],{'$or':_[_0x4e7d('0x3c')](_0x50f0a4['attributes'],function(_0x1df009){var _0x2f00a6={};_0x2f00a6[_0x1df009]={'$like':'%'+_0x4bd4de['query'][_0x4e7d('0x4f')]+'%'};return _0x2f00a6;})});}_0x50f0a4=_['merge']({},_0x50f0a4,_0x4bd4de[_0x4e7d('0x57')]);return db['FaxInteraction'][_0x4e7d('0x2d')]({'where':_0x50f0a4[_0x4e7d('0x50')]})[_0x4e7d('0x20')](function(_0x36ecba){_0x2471e5[_0x4e7d('0x2d')]=_0x36ecba;if(_0x4bd4de[_0x4e7d('0x42')][_0x4e7d('0x52')]){_0x50f0a4['include']=[{'model':db[_0x4e7d('0x72')],'as':_0x4e7d('0x73'),'required':![]},{'model':db['User'],'as':_0x4e7d('0x74'),'attributes':['name',_0x4e7d('0x75'),_0x4e7d('0x76')],'required':![]},{'model':db[_0x4e7d('0x77')],'as':'Tags','attributes':['id',_0x4e7d('0x37'),_0x4e7d('0x78')],'where':_0x4bd4de[_0x4e7d('0x42')][_0x4e7d('0x79')]?{'id':_0x4bd4de[_0x4e7d('0x42')][_0x4e7d('0x79')]}:undefined,'required':_0x4bd4de[_0x4e7d('0x42')][_0x4e7d('0x79')]?!![]:![]}];}return db[_0x4e7d('0x6e')][_0x4e7d('0x53')](_0x50f0a4);})[_0x4e7d('0x20')](function(_0x302b9f){_0x2471e5[_0x4e7d('0x54')]=_0x302b9f;return _0x2471e5;});}})[_0x4e7d('0x20')](respondWithFilteredResult(_0x1283f5,_0x50f0a4))['catch'](handleError(_0x1283f5,null));};exports[_0x4e7d('0x7a')]=function(_0x34d27a,_0x1684be,_0x2339eb){return db['FaxAccount']['findOne']({'where':{'id':_0x34d27a[_0x4e7d('0x61')]['id']}})[_0x4e7d('0x20')](handleEntityNotFound(_0x1684be,null))[_0x4e7d('0x20')](function(_0x14d8ed){if(_0x14d8ed){return db['sequelize']['transaction'](function(_0x4d60a1){return db[_0x4e7d('0x7b')][_0x4e7d('0x62')]({'where':{'FaxAccountId':_0x34d27a[_0x4e7d('0x61')]['id']},'transaction':_0x4d60a1})['then'](function(_0x2fd4a0){var _0x48b8b4=_[_0x4e7d('0x3c')](_0x34d27a[_0x4e7d('0x5a')],function(_0x393dd1){_0x393dd1[_0x4e7d('0x64')]=_0x34d27a['params']['id'];return _0x393dd1;});return db[_0x4e7d('0x7b')]['bulkCreate'](_0x48b8b4,{'transaction':_0x4d60a1});});})[_0x4e7d('0x20')](function(){return db[_0x4e7d('0x7b')][_0x4e7d('0x7c')]({'where':{'FaxAccountId':_0x34d27a['params']['id']},'order':'priority'});});}})[_0x4e7d('0x20')](respondWithResult(_0x1684be,null))['catch'](handleError(_0x1684be,null));};exports[_0x4e7d('0x7d')]=function(_0x1d3d5c,_0x2207e1,_0x14996b){var _0x80a1bf={};var _0x32c575={};var _0x368a63;var _0x333f87;return db['FaxAccount'][_0x4e7d('0x71')]({'where':{'id':_0x1d3d5c['params']['id']}})[_0x4e7d('0x20')](handleEntityNotFound(_0x2207e1,null))[_0x4e7d('0x20')](function(_0x2f7ca1){if(_0x2f7ca1){_0x368a63=_0x2f7ca1;_0x32c575[_0x4e7d('0x41')]=_[_0x4e7d('0x43')](db[_0x4e7d('0x7b')][_0x4e7d('0x3e')]);_0x32c575[_0x4e7d('0x42')]=_[_0x4e7d('0x43')](_0x1d3d5c['query']);_0x32c575['filters']=_[_0x4e7d('0x44')](_0x32c575[_0x4e7d('0x41')],_0x32c575[_0x4e7d('0x42')]);_0x80a1bf['attributes']=_[_0x4e7d('0x44')](_0x32c575[_0x4e7d('0x41')],qs[_0x4e7d('0x45')](_0x1d3d5c[_0x4e7d('0x42')][_0x4e7d('0x45')]));_0x80a1bf[_0x4e7d('0x46')]=_0x80a1bf[_0x4e7d('0x46')]['length']?_0x80a1bf['attributes']:_0x32c575[_0x4e7d('0x41')];_0x80a1bf[_0x4e7d('0x4b')]=qs['sort'](_0x1d3d5c[_0x4e7d('0x42')]['sort']);_0x80a1bf[_0x4e7d('0x50')]=qs['filters'](_[_0x4e7d('0x4e')](_0x1d3d5c[_0x4e7d('0x42')],_0x32c575[_0x4e7d('0x4d')]));if(_0x1d3d5c[_0x4e7d('0x42')]['filter']){_0x80a1bf['where']=_[_0x4e7d('0x51')](_0x80a1bf[_0x4e7d('0x50')],{'$or':_[_0x4e7d('0x3c')](_0x80a1bf[_0x4e7d('0x46')],function(_0x4437a8){var _0x16d582={};_0x16d582[_0x4437a8]={'$like':'%'+_0x1d3d5c[_0x4e7d('0x42')][_0x4e7d('0x4f')]+'%'};return _0x16d582;})});}_0x80a1bf=_[_0x4e7d('0x51')]({},_0x80a1bf,_0x1d3d5c['options']);return _0x368a63[_0x4e7d('0x7d')](_0x80a1bf);}})['then'](function(_0x45baf5){if(_0x45baf5){_0x333f87=_0x45baf5['length'];if(!_0x1d3d5c['query'][_0x4e7d('0x48')](_0x4e7d('0x49'))){_0x80a1bf['limit']=qs[_0x4e7d('0x4a')](_0x1d3d5c[_0x4e7d('0x42')][_0x4e7d('0x4a')]);_0x80a1bf[_0x4e7d('0x2b')]=qs['offset'](_0x1d3d5c[_0x4e7d('0x42')][_0x4e7d('0x2b')]);}return _0x368a63[_0x4e7d('0x7d')](_0x80a1bf);}})[_0x4e7d('0x20')](function(_0x2a1479){if(_0x2a1479){return _0x2a1479?{'count':_0x333f87,'rows':_0x2a1479}:null;}})[_0x4e7d('0x20')](respondWithResult(_0x2207e1,null))['catch'](handleError(_0x2207e1,null));};function Extension(_0x160a01,_0x2e07df,_0x2adbe6,_0x10bf80){this[_0x4e7d('0x7e')]=_0x4e7d('0x7f');this['exten']=_0x160a01[_0x4e7d('0x80')];this[_0x4e7d('0x81')]=_0x10bf80;this[_0x4e7d('0x3f')]=_0x4e7d('0x82');this[_0x4e7d('0x83')]=_0x4e7d('0x84');this[_0x4e7d('0x64')]=_0x160a01['id'];this[_0x4e7d('0x85')]=_0x2e07df;this[_0x4e7d('0x86')]=_0x2adbe6;}function createExtensionsReciveFax(_0xcd38de){var _0x4e000b=0x1;var _0x3e3839=[];_0x3e3839['push'](new Extension(_0xcd38de,_0x4e000b,'',_0x4e7d('0x87')));_0x4e000b+=0x1;_0x3e3839[_0x4e7d('0x88')](new Extension(_0xcd38de,_0x4e000b,_0x4e7d('0x89'),_0x4e7d('0x8a')));_0x4e000b+=0x1;for(var _0x17622d in _0xcd38de){if(_0xcd38de[_0x4e7d('0x48')](_0x17622d)&&(_0x17622d===_0x4e7d('0x8b')||_0x17622d===_0x4e7d('0x80')||_0x17622d===_0x4e7d('0x8c')||_0x17622d==='faxdetect'||_0x17622d===_0x4e7d('0x8d')||_0x17622d===_0x4e7d('0x8e')||_0x17622d===_0x4e7d('0x8f')||_0x17622d===_0x4e7d('0x90')||_0x17622d==='t38timeout')){_0x3e3839[_0x4e7d('0x88')](new Extension(_0xcd38de,_0x4e000b,_0x4e7d('0x91')+_0x17622d+')='+_0xcd38de[_0x17622d],_0x4e7d('0x8a')));_0x4e000b+=0x1;}}_0x3e3839[_0x4e7d('0x88')](new Extension(_0xcd38de,_0x4e000b,'6',_0x4e7d('0x92')));_0x4e000b+=0x1;_0x3e3839['push'](new Extension(_0xcd38de,_0x4e000b,_0x4e7d('0x93'),_0x4e7d('0x94')));_0x4e000b=0x0;return _0x3e3839;}exports[_0x4e7d('0x95')]=function(_0x4622da,_0x204679,_0xfc909a){var _0x1a29eb;return db[_0x4e7d('0x96')]['transaction'](function(_0x13e53c){return db['FaxAccount']['create'](_0x4622da[_0x4e7d('0x5a')],{'transaction':_0x13e53c})[_0x4e7d('0x20')](function(_0x25a67a){_0x1a29eb=_0x25a67a[_0x4e7d('0x5d')]({'plain':!![]});return db['VoiceExtension'][_0x4e7d('0x97')](createExtensionsReciveFax(_0x1a29eb),{'transaction':_0x13e53c});});})['then'](function(){return _0x1a29eb;})[_0x4e7d('0x20')](respondWithResult(_0x204679,null))[_0x4e7d('0x55')](handleError(_0x204679,null));};exports['updateAccountApplications']=function(_0x3e8a06,_0x11fe69,_0x19798c){var _0x6f4ecd;return db[_0x4e7d('0x96')]['transaction'](function(_0x33e010){return db[_0x4e7d('0x3d')][_0x4e7d('0x32')](_0x3e8a06[_0x4e7d('0x5a')],{'where':{'id':_0x3e8a06[_0x4e7d('0x5a')]['id']},'transaction':_0x33e010})['then'](function(_0x53f3f9){return db['VoiceExtension'][_0x4e7d('0x62')]({'where':{'FaxAccountId':_0x3e8a06[_0x4e7d('0x5a')]['id']},'transaction':_0x33e010})['then'](function(_0x21967f){return db['VoiceExtension'][_0x4e7d('0x97')](createExtensionsReciveFax(_['omit'](_0x3e8a06[_0x4e7d('0x5a')],[_0x4e7d('0x98'),'key','createdAt','updatedAt',_0x4e7d('0x99'),'ListId'])),{'transaction':_0x33e010});});});})['then'](function(){return db[_0x4e7d('0x3d')][_0x4e7d('0x9a')](_0x3e8a06['body']['id']);})['then'](respondWithResult(_0x11fe69,null))[_0x4e7d('0x55')](handleError(_0x11fe69,null));};exports[_0x4e7d('0x9b')]=function(_0x3b3944,_0x41c416,_0x52b01d){var _0x46bccf={'raw':!![],'where':{}};var _0x4df5fd={};var _0x2ce292={'count':0x0,'rows':[]};return db['FaxAccount'][_0x4e7d('0x71')]({'where':{'id':_0x3b3944[_0x4e7d('0x61')]['id']}})[_0x4e7d('0x20')](handleEntityNotFound(_0x41c416,null))['then'](function(_0x3c2f45){if(_0x3c2f45){_0x4df5fd[_0x4e7d('0x41')]=_['keys'](db[_0x4e7d('0x9c')]['rawAttributes']);_0x4df5fd[_0x4e7d('0x42')]=_[_0x4e7d('0x43')](_0x3b3944[_0x4e7d('0x42')]);_0x4df5fd[_0x4e7d('0x4d')]=_['intersection'](_0x4df5fd[_0x4e7d('0x41')],_0x4df5fd[_0x4e7d('0x42')]);_0x46bccf[_0x4e7d('0x46')]=_[_0x4e7d('0x44')](_0x4df5fd[_0x4e7d('0x41')],qs[_0x4e7d('0x45')](_0x3b3944[_0x4e7d('0x42')][_0x4e7d('0x45')]));_0x46bccf['attributes']=_0x46bccf['attributes'][_0x4e7d('0x47')]?_0x46bccf['attributes']:_0x4df5fd[_0x4e7d('0x41')];if(!_0x3b3944[_0x4e7d('0x42')][_0x4e7d('0x48')](_0x4e7d('0x49'))){_0x46bccf[_0x4e7d('0x4a')]=qs[_0x4e7d('0x4a')](_0x3b3944[_0x4e7d('0x42')][_0x4e7d('0x4a')]);_0x46bccf[_0x4e7d('0x2b')]=qs[_0x4e7d('0x2b')](_0x3b3944['query'][_0x4e7d('0x2b')]);}_0x46bccf[_0x4e7d('0x4b')]=qs['sort'](_0x3b3944[_0x4e7d('0x42')][_0x4e7d('0x4c')]);_0x46bccf[_0x4e7d('0x50')]=qs[_0x4e7d('0x4d')](_[_0x4e7d('0x4e')](_0x3b3944['query'],_0x4df5fd[_0x4e7d('0x4d')]));_0x46bccf['where'][_0x4e7d('0x64')]=_0x3c2f45['id'];if(_0x3b3944['query']['filter']){_0x46bccf[_0x4e7d('0x50')]=_[_0x4e7d('0x51')](_0x46bccf[_0x4e7d('0x50')],{'$or':_[_0x4e7d('0x3c')](_0x46bccf[_0x4e7d('0x46')],function(_0x405c2c){var _0x118c35={};_0x118c35[_0x405c2c]={'$like':'%'+_0x3b3944[_0x4e7d('0x42')]['filter']+'%'};return _0x118c35;})});}if(_0x3b3944['query'][_0x4e7d('0x9d')]){var _0x5a5dfc=_0x3b3944[_0x4e7d('0x42')]['$gte']['split'](',');var _0x48de22={};_0x48de22[_0x5a5dfc[0x0]]={'$gte':moment(_0x5a5dfc[0x1])[_0x4e7d('0x9e')](_0x4e7d('0x9f'))};_0x46bccf[_0x4e7d('0x50')]=_[_0x4e7d('0x51')](_0x46bccf[_0x4e7d('0x50')],_0x48de22);}_0x46bccf=_[_0x4e7d('0x51')]({},_0x46bccf,_0x3b3944[_0x4e7d('0x57')]);return db[_0x4e7d('0x9c')][_0x4e7d('0x2d')]({'where':_0x46bccf[_0x4e7d('0x50')]})['then'](function(_0x420474){_0x2ce292[_0x4e7d('0x2d')]=_0x420474;if(_0x3b3944[_0x4e7d('0x42')][_0x4e7d('0x52')]){_0x46bccf[_0x4e7d('0x67')]=[{'all':!![]}];}return db['FaxMessage'][_0x4e7d('0x53')](_0x46bccf);})[_0x4e7d('0x20')](function(_0xb18a7b){_0x2ce292['rows']=_0xb18a7b;return _0x2ce292;});}})[_0x4e7d('0x20')](respondWithFilteredResult(_0x41c416,_0x46bccf))[_0x4e7d('0x55')](handleError(_0x41c416,null));};exports[_0x4e7d('0x38')]=function(_0x11cdc3,_0x359963,_0x8d4877){var _0x3abde7,_0x48065d={},_0x2a9fc2;if(_0x11cdc3[_0x4e7d('0x5a')]['to']){_0x2a9fc2=_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0];}return db[_0x4e7d('0x3d')][_0x4e7d('0x58')]({'where':{'id':_0x11cdc3[_0x4e7d('0x61')]['id']},'include':[{'model':db[_0x4e7d('0xa0')],'as':_0x4e7d('0xa1'),'include':[{'model':db[_0x4e7d('0x72')],'as':_0x4e7d('0xa2'),'where':{'fax':_0x2a9fc2},'limit':0x1,'order':[[_0x4e7d('0xa3'),'DESC']]}]}]})[_0x4e7d('0x20')](handleEntityNotFound(_0x359963,null))[_0x4e7d('0x20')](function(_0x400dba){_0x3abde7=_0x400dba;if(_0x11cdc3[_0x4e7d('0x5a')]['attachments']&&_0x11cdc3['body'][_0x4e7d('0xa4')][_0x4e7d('0x47')]){for(var _0x10abdf=0x0;_0x10abdf<_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa4')][_0x4e7d('0x47')];_0x10abdf+=0x1){_0x11cdc3['body']['attachments'][_0x10abdf]={'filename':_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa4')][_0x10abdf]['name'],'id':_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa4')][_0x10abdf]['id'],'path':path[_0x4e7d('0xa5')](config['root'],_0x4e7d('0xa6'),_0x11cdc3['body'][_0x4e7d('0xa4')][_0x10abdf]['basename'])};}}return respondWithRpcPromise(_0x4e7d('0xa7'),_0x4e7d('0xa7'),{'FaxAccountId':_[_0x4e7d('0xa8')](_0x11cdc3['params']['id'])?undefined:_0x11cdc3[_0x4e7d('0x61')]['id'],'path':_[_0x4e7d('0xa8')](_0x11cdc3[_0x4e7d('0x5a')]['attachments'][0x0][_0x4e7d('0x7')])?undefined:_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa4')][0x0][_0x4e7d('0x7')],'fax':_[_0x4e7d('0xa8')](_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0])?undefined:_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0]},client9002);})[_0x4e7d('0x20')](function(){if(_0x3abde7){if(_[_0x4e7d('0xa8')](_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa9')])){_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa9')]=util[_0x4e7d('0x9e')](_0x4e7d('0xaa'),_0x3abde7[_0x4e7d('0x37')],_0x3abde7['fax']);}if(_0x3abde7[_0x4e7d('0xa1')]){if(_0x3abde7[_0x4e7d('0xa1')][_0x4e7d('0xa2')][_0x4e7d('0x47')]){return _0x3abde7['List']['Contacts'][0x0];}else{return db[_0x4e7d('0x72')]['create'](_[_0x4e7d('0x17')](_0x11cdc3[_0x4e7d('0x5a')],{'firstName':_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0],'phone':_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0],'fax':_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0],'ListId':_0x3abde7['ListId']}));}}else{throw new Error(_0x4e7d('0xab'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0x4e7d('0x20')](function(_0x12a1a1){if(_0x12a1a1){return db[_0x4e7d('0x6e')][_0x4e7d('0x58')]({'where':{'ContactId':_0x12a1a1['id'],'closed':![],'FaxAccountId':_0x3abde7['id']}})[_0x4e7d('0x20')](function(_0x34a4dd){if(_0x34a4dd){return[_0x34a4dd,![]];}return db[_0x4e7d('0x6e')][_0x4e7d('0x59')]({'UserId':_0x11cdc3['user']['id'],'ContactId':_0x12a1a1['id'],'FaxAccountId':_0x3abde7['id'],'fax':_0x11cdc3['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x4e7d('0x51')](_0x11cdc3['body'],{'read':![],'body':_0x11cdc3['body']['attachments'][0x0][_0x4e7d('0xac')],'FaxAccountId':_0x3abde7['id'],'UserId':_0x11cdc3[_0x4e7d('0xad')]['id'],'ContactId':_0x12a1a1['id'],'AttachmentId':_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa4')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x4e7d('0xae')}]})['then'](function(_0x1a3f38){return[_0x1a3f38,!![]];});});}else{throw new Error(_0x4e7d('0xaf'));}})[_0x4e7d('0xb0')](function(_0x2595b4,_0xeac10b){if(_0xeac10b){return _0x2595b4;}return db[_0x4e7d('0x9c')][_0x4e7d('0x59')]({'direction':_0x4e7d('0xb1'),'read':![],'body':_0x11cdc3[_0x4e7d('0x5a')][_0x4e7d('0xa4')][0x0][_0x4e7d('0xac')],'FaxAccountId':_0x3abde7['id'],'FaxInteractionId':_0x2595b4['id'],'UserId':_0x11cdc3[_0x4e7d('0xad')]['id'],'ContactId':_0x2595b4[_0x4e7d('0xb2')],'AttachmentId':_0x11cdc3[_0x4e7d('0x5a')]['attachments'][0x0]['id']})[_0x4e7d('0x20')](function(_0x1de5c3){_0x2595b4['dataValues'][_0x4e7d('0xae')]=[];_0x2595b4[_0x4e7d('0xb3')][_0x4e7d('0xae')]['push'](_0x1de5c3[_0x4e7d('0xb3')]);return _0x2595b4;});})[_0x4e7d('0x20')](function(_0x107de7){respondWithRpcPromise(_0x4e7d('0xb4'),'SendFax',{'FaxAccountId':_[_0x4e7d('0xa8')](_0x11cdc3['params']['id'])?undefined:_0x11cdc3[_0x4e7d('0x61')]['id'],'path':_[_0x4e7d('0xa8')](_0x11cdc3[_0x4e7d('0x5a')]['attachments'][0x0][_0x4e7d('0x7')])?undefined:_0x11cdc3[_0x4e7d('0x5a')]['attachments'][0x0][_0x4e7d('0x7')],'fax':_[_0x4e7d('0xa8')](_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0])?undefined:_0x11cdc3[_0x4e7d('0x5a')]['to'][0x0],'AttachmentId':_0x11cdc3['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x347957){logger[_0x4e7d('0x21')]('SendFaxRpc,\x20%s',_0x347957);})[_0x4e7d('0x55')](function(_0x538912){logger[_0x4e7d('0x21')](_0x4e7d('0xb5'),_0x538912);});return _0x107de7;})['then'](respondWithResult(_0x359963,null))[_0x4e7d('0x55')](handleError(_0x359963,null));};exports[_0x4e7d('0xb6')]=function(_0x4afc10,_0x1680d8,_0x191e6b){return db[_0x4e7d('0x3d')][_0x4e7d('0x58')]({'where':{'id':_0x4afc10['params']['id']}})[_0x4e7d('0x20')](handleEntityNotFound(_0x1680d8,null))[_0x4e7d('0x20')](function(_0x1fda8c){if(_0x1fda8c){return _0x1fda8c[_0x4e7d('0xb6')](_0x4afc10[_0x4e7d('0x5a')][_0x4e7d('0x69')],_[_0x4e7d('0x6f')](_0x4afc10[_0x4e7d('0x5a')],[_0x4e7d('0x69'),'id'])||{})[_0x4e7d('0xb0')](function(_0x38c54e){for(var _0x153e78=0x0;_0x153e78<_0x4afc10[_0x4e7d('0x5a')]['ids'][_0x4e7d('0x47')];_0x153e78+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x4afc10['body'][_0x4e7d('0x69')][_0x153e78]),'FaxAccountId':Number(_0x4afc10[_0x4e7d('0x61')]['id'])});}return _0x38c54e;});}})[_0x4e7d('0x20')](respondWithResult(_0x1680d8,null))[_0x4e7d('0x55')](handleError(_0x1680d8,null));};exports[_0x4e7d('0xb7')]=function(_0x5f29a6,_0x37471c,_0x4755d1){return db[_0x4e7d('0x3d')][_0x4e7d('0x58')]({'where':{'id':_0x5f29a6['params']['id']}})[_0x4e7d('0x20')](handleEntityNotFound(_0x37471c,null))[_0x4e7d('0x20')](function(_0x15a6cb){if(_0x15a6cb){return _0x15a6cb[_0x4e7d('0xb7')](_0x5f29a6[_0x4e7d('0x42')][_0x4e7d('0x69')])[_0x4e7d('0x20')](function(){if(_[_0x4e7d('0xb8')](_0x5f29a6[_0x4e7d('0x42')][_0x4e7d('0x69')])){for(var _0xd6e3ca=0x0;_0xd6e3ca<_0x5f29a6['query']['ids'][_0x4e7d('0x47')];_0xd6e3ca+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x5f29a6['query']['ids'][_0xd6e3ca]),'FaxAccountId':Number(_0x5f29a6[_0x4e7d('0x61')]['id'])});}}else{socket[_0x4e7d('0xb9')]('userFaxAccount:remove',{'UserId':Number(_0x5f29a6[_0x4e7d('0x42')][_0x4e7d('0x69')]),'FaxAccountId':Number(_0x5f29a6['params']['id'])});}});}})['then'](respondWithStatusCode(_0x37471c,null))[_0x4e7d('0x55')](handleError(_0x37471c,null));};exports[_0x4e7d('0xba')]=function(_0x30a949,_0x45def8,_0x411b64){var _0x208718={};var _0x200138={};var _0x34152f;var _0x20bcd3;return db[_0x4e7d('0x3d')][_0x4e7d('0x71')]({'where':{'id':_0x30a949[_0x4e7d('0x61')]['id']}})['then'](handleEntityNotFound(_0x45def8,null))['then'](function(_0x18d2da){if(_0x18d2da){_0x34152f=_0x18d2da;_0x200138['model']=_[_0x4e7d('0x43')](db[_0x4e7d('0xbb')][_0x4e7d('0x3e')]);_0x200138['query']=_['keys'](_0x30a949['query']);_0x200138[_0x4e7d('0x4d')]=_[_0x4e7d('0x44')](_0x200138[_0x4e7d('0x41')],_0x200138[_0x4e7d('0x42')]);_0x208718[_0x4e7d('0x46')]=_[_0x4e7d('0x44')](_0x200138[_0x4e7d('0x41')],qs[_0x4e7d('0x45')](_0x30a949[_0x4e7d('0x42')][_0x4e7d('0x45')]));_0x208718[_0x4e7d('0x46')]=_0x208718[_0x4e7d('0x46')][_0x4e7d('0x47')]?_0x208718[_0x4e7d('0x46')]:_0x200138['model'];_0x208718['order']=qs[_0x4e7d('0x4c')](_0x30a949[_0x4e7d('0x42')][_0x4e7d('0x4c')]);_0x208718['where']=qs[_0x4e7d('0x4d')](_[_0x4e7d('0x4e')](_0x30a949[_0x4e7d('0x42')],_0x200138[_0x4e7d('0x4d')]));if(_0x30a949[_0x4e7d('0x42')][_0x4e7d('0x4f')]){_0x208718[_0x4e7d('0x50')]=_[_0x4e7d('0x51')](_0x208718['where'],{'$or':_[_0x4e7d('0x3c')](_0x208718[_0x4e7d('0x46')],function(_0x629d5e){var _0x1734ea={};_0x1734ea[_0x629d5e]={'$like':'%'+_0x30a949['query'][_0x4e7d('0x4f')]+'%'};return _0x1734ea;})});}_0x208718=_[_0x4e7d('0x51')]({},_0x208718,_0x30a949[_0x4e7d('0x57')]);return _0x34152f[_0x4e7d('0xba')](_0x208718);}})[_0x4e7d('0x20')](function(_0xc54edc){if(_0xc54edc){_0x20bcd3=_0xc54edc[_0x4e7d('0x47')];if(!_0x30a949[_0x4e7d('0x42')][_0x4e7d('0x48')](_0x4e7d('0x49'))){_0x208718['limit']=qs[_0x4e7d('0x4a')](_0x30a949['query'][_0x4e7d('0x4a')]);_0x208718[_0x4e7d('0x2b')]=qs[_0x4e7d('0x2b')](_0x30a949[_0x4e7d('0x42')][_0x4e7d('0x2b')]);}return _0x34152f[_0x4e7d('0xba')](_0x208718);}})[_0x4e7d('0x20')](function(_0x115bc3){if(_0x115bc3){return _0x115bc3?{'count':_0x20bcd3,'rows':_0x115bc3}:null;}})[_0x4e7d('0x20')](respondWithResult(_0x45def8,null))[_0x4e7d('0x55')](handleError(_0x45def8,null));}; \ No newline at end of file +var _0xc8e6=['tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','localstationid','app','description','Fax\x20Extension','priority','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updateAccountApplications','tech','createdAt','TrunkId','ListId','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','updatedAt','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','FaxInteraction','out','Contact\x20not\x20found','spread','filename','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','User','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','info','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','FaxAccounts','UserProfileResource','name','send','Pause','FaxAccount','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','params','keys','includeAll','include','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','nolimit','removeAnswers','addInteraction','omit','getInteractions','CmContact','Owner','fullname','Tag'];(function(_0xf840b2,_0x5a91db){var _0xe44c74=function(_0x959a91){while(--_0x959a91){_0xf840b2['push'](_0xf840b2['shift']());}};_0xe44c74(++_0x5a91db);}(_0xc8e6,0x1bf));var _0x6c8e=function(_0x22d72b,_0x112e6d){_0x22d72b=_0x22d72b-0x0;var _0x35f65f=_0xc8e6[_0x22d72b];return _0x35f65f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c8e('0x0'));var zipdir=require(_0x6c8e('0x1'));var jsonpatch=require(_0x6c8e('0x2'));var rp=require(_0x6c8e('0x3'));var moment=require('moment');var BPromise=require(_0x6c8e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6c8e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c8e('0x6'));var fs=require('fs');var fs_extra=require(_0x6c8e('0x7'));var _=require(_0x6c8e('0x8'));var squel=require(_0x6c8e('0x9'));var crypto=require(_0x6c8e('0xa'));var jsforce=require(_0x6c8e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6c8e('0xc'));var Redis=require(_0x6c8e('0xd'));var authService=require(_0x6c8e('0xe'));var qs=require(_0x6c8e('0xf'));var as=require(_0x6c8e('0x10'));var hardwareService=require(_0x6c8e('0x11'));var logger=require(_0x6c8e('0x12'))(_0x6c8e('0x13'));var utils=require(_0x6c8e('0x14'));var config=require(_0x6c8e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c8e('0x16'))['db'];config[_0x6c8e('0x17')]=_[_0x6c8e('0x18')](config[_0x6c8e('0x17')],{'host':_0x6c8e('0x19'),'port':0x18eb});var socket=require(_0x6c8e('0x1a'))(new Redis(config[_0x6c8e('0x17')]));require(_0x6c8e('0x1b'))[_0x6c8e('0x1c')](socket);var jayson=require(_0x6c8e('0x1d'));var client=jayson['client'][_0x6c8e('0x1e')]({'port':0x232c});var client9002=jayson[_0x6c8e('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f9aab,_0x7d0417,_0xaab19,_0xb7ad7a){return new BPromise(function(_0x1c0eb0,_0x66433e){var _0x5dac6d=_0xb7ad7a||client;return _0x5dac6d[_0x6c8e('0x20')](_0x3f9aab,_0xaab19)['then'](function(_0x18311b){logger[_0x6c8e('0x21')]('FaxAccount,\x20%s,\x20%s',_0x7d0417,_0x6c8e('0x22'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x7d0417,_0x6c8e('0x22'),JSON[_0x6c8e('0x23')](_0x18311b));if(_0x18311b['error']){if(_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x25')]===0x1f4){logger[_0x6c8e('0x24')](_0x6c8e('0x26'),_0x7d0417,_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x27')]);return _0x66433e(_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x27')]);}logger[_0x6c8e('0x24')]('FaxAccount,\x20%s,\x20%s',_0x7d0417,_0x18311b['error'][_0x6c8e('0x27')]);return _0x1c0eb0(_0x18311b[_0x6c8e('0x24')][_0x6c8e('0x27')]);}else{logger[_0x6c8e('0x21')](_0x6c8e('0x26'),_0x7d0417,'request\x20sent');_0x1c0eb0(_0x18311b[_0x6c8e('0x28')][_0x6c8e('0x27')]);}})[_0x6c8e('0x29')](function(_0x8eb86b){logger['error'](_0x6c8e('0x26'),_0x7d0417,_0x8eb86b);_0x66433e(_0x8eb86b);});});}function respondWithStatusCode(_0x1648f0,_0x38137b){_0x38137b=_0x38137b||0xcc;return function(_0xfb3044){if(_0xfb3044){return _0x1648f0['sendStatus'](_0x38137b);}return _0x1648f0[_0x6c8e('0x2a')](_0x38137b)[_0x6c8e('0x2b')]();};}function respondWithResult(_0x443b2d,_0x5550e2){_0x5550e2=_0x5550e2||0xc8;return function(_0x2128c1){if(_0x2128c1){return _0x443b2d[_0x6c8e('0x2a')](_0x5550e2)[_0x6c8e('0x2c')](_0x2128c1);}};}function respondWithFilteredResult(_0x47f2fe,_0x1343ae){return function(_0xb95dde){if(_0xb95dde){var _0x57cdd9=typeof _0x1343ae[_0x6c8e('0x2d')]===_0x6c8e('0x2e')&&typeof _0x1343ae[_0x6c8e('0x2f')]===_0x6c8e('0x2e');var _0x41abc5=_0xb95dde[_0x6c8e('0x30')];var _0x595199=_0x57cdd9?0x0:_0x1343ae[_0x6c8e('0x2d')];var _0x547154=_0x57cdd9?_0xb95dde[_0x6c8e('0x30')]:_0x1343ae['offset']+_0x1343ae[_0x6c8e('0x2f')];var _0x1d4266;if(_0x547154>=_0x41abc5){_0x547154=_0x41abc5;_0x1d4266=0xc8;}else{_0x1d4266=0xce;}_0x47f2fe[_0x6c8e('0x2a')](_0x1d4266);return _0x47f2fe[_0x6c8e('0x31')](_0x6c8e('0x32'),_0x595199+'-'+_0x547154+'/'+_0x41abc5)[_0x6c8e('0x2c')](_0xb95dde);}return null;};}function patchUpdates(_0x2825c7){return function(_0x136948){try{jsonpatch[_0x6c8e('0x33')](_0x136948,_0x2825c7,!![]);}catch(_0x3d732c){return BPromise['reject'](_0x3d732c);}return _0x136948[_0x6c8e('0x34')]();};}function saveUpdates(_0x4d1558,_0x179b83){return function(_0xa5a722){if(_0xa5a722){return _0xa5a722['update'](_0x4d1558)[_0x6c8e('0x35')](function(_0x45eee9){return _0x45eee9;});}return null;};}function removeEntity(_0x4af66b,_0x216fbc){return function(_0x311d83){if(_0x311d83){return _0x311d83[_0x6c8e('0x36')]()[_0x6c8e('0x35')](function(){var _0x310397=_0x311d83['get']({'plain':!![]});var _0x1465fa=_0x6c8e('0x37');return db[_0x6c8e('0x38')][_0x6c8e('0x36')]({'where':{'type':_0x1465fa,'resourceId':_0x310397['id']}})['then'](function(){return _0x311d83;});})[_0x6c8e('0x35')](function(){_0x4af66b['status'](0xcc)[_0x6c8e('0x2b')]();});}};}function handleEntityNotFound(_0x44dbad,_0xcc9dac){return function(_0x16beb0){if(!_0x16beb0){_0x44dbad['sendStatus'](0x194);}return _0x16beb0;};}function handleError(_0x50831b,_0x3aec8c){_0x3aec8c=_0x3aec8c||0x1f4;return function(_0x8e7595){logger[_0x6c8e('0x24')](_0x8e7595['stack']);if(_0x8e7595[_0x6c8e('0x39')]){delete _0x8e7595[_0x6c8e('0x39')];}_0x50831b[_0x6c8e('0x2a')](_0x3aec8c)[_0x6c8e('0x3a')](_0x8e7595);};}exports['index']=function(_0x24f6ba,_0x47aff9){var _0x54efde={'include':[{'model':db[_0x6c8e('0x3b')],'as':'mandatoryDispositionPause'}]},_0x263955={},_0x249c34={'count':0x0,'rows':[]};var _0x28be7c=_['map'](db[_0x6c8e('0x3c')][_0x6c8e('0x3d')],function(_0x438391){return{'name':_0x438391[_0x6c8e('0x3e')],'type':_0x438391[_0x6c8e('0x3f')][_0x6c8e('0x40')]};});_0x263955[_0x6c8e('0x41')]=_[_0x6c8e('0x42')](_0x28be7c,_0x6c8e('0x39'));_0x263955['query']=_['keys'](_0x24f6ba[_0x6c8e('0x43')]);_0x263955[_0x6c8e('0x44')]=_['intersection'](_0x263955[_0x6c8e('0x41')],_0x263955[_0x6c8e('0x43')]);_0x54efde[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0x263955[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x24f6ba[_0x6c8e('0x43')]['fields']));_0x54efde[_0x6c8e('0x45')]=_0x54efde[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x54efde[_0x6c8e('0x45')]:_0x263955[_0x6c8e('0x41')];if(!_0x24f6ba['query'][_0x6c8e('0x49')]('nolimit')){_0x54efde[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x24f6ba['query'][_0x6c8e('0x2f')]);_0x54efde[_0x6c8e('0x2d')]=qs['offset'](_0x24f6ba['query']['offset']);}_0x54efde['order']=qs[_0x6c8e('0x4a')](_0x24f6ba[_0x6c8e('0x43')][_0x6c8e('0x4a')]);_0x54efde[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x24f6ba[_0x6c8e('0x43')],_0x263955[_0x6c8e('0x44')]),_0x28be7c);if(_0x24f6ba[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x54efde[_0x6c8e('0x4b')]=_[_0x6c8e('0x4e')](_0x54efde[_0x6c8e('0x4b')],{'$or':_[_0x6c8e('0x42')](_0x28be7c,function(_0x20b236){if(_0x20b236[_0x6c8e('0x3f')]!==_0x6c8e('0x4f')){var _0x4d46ed={};_0x4d46ed[_0x20b236[_0x6c8e('0x39')]]={'$like':'%'+_0x24f6ba[_0x6c8e('0x43')]['filter']+'%'};return _0x4d46ed;}})});}_0x54efde=_[_0x6c8e('0x4e')]({},_0x54efde,_0x24f6ba[_0x6c8e('0x50')]);var _0x494029={'where':_0x54efde[_0x6c8e('0x4b')]};return db[_0x6c8e('0x3c')][_0x6c8e('0x30')](_0x494029)['then'](function(_0xd06c83){_0x249c34['count']=_0xd06c83;if(_0x24f6ba[_0x6c8e('0x43')]['includeAll']){_0x54efde['include']=[{'all':!![]}];}return db[_0x6c8e('0x3c')][_0x6c8e('0x51')](_0x54efde);})[_0x6c8e('0x35')](function(_0x23f675){_0x249c34[_0x6c8e('0x52')]=_0x23f675;return _0x249c34;})[_0x6c8e('0x35')](respondWithFilteredResult(_0x47aff9,_0x54efde))['catch'](handleError(_0x47aff9,null));};exports['show']=function(_0x128f07,_0x495d9d){var _0x22f850={'raw':![],'where':{'id':_0x128f07[_0x6c8e('0x53')]['id']},'include':[{'model':db[_0x6c8e('0x3b')],'as':'mandatoryDispositionPause'}]},_0x1af843={};_0x1af843[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x3c')][_0x6c8e('0x3d')]);_0x1af843[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x128f07[_0x6c8e('0x43')]);_0x1af843['filters']=_[_0x6c8e('0x46')](_0x1af843[_0x6c8e('0x41')],_0x1af843[_0x6c8e('0x43')]);_0x22f850[_0x6c8e('0x45')]=_['intersection'](_0x1af843['model'],qs[_0x6c8e('0x47')](_0x128f07[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x22f850[_0x6c8e('0x45')]=_0x22f850['attributes'][_0x6c8e('0x48')]?_0x22f850[_0x6c8e('0x45')]:_0x1af843[_0x6c8e('0x41')];if(_0x128f07[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x22f850[_0x6c8e('0x56')]=[{'all':!![]}];}_0x22f850=_[_0x6c8e('0x4e')]({},_0x22f850,_0x128f07[_0x6c8e('0x50')]);return db[_0x6c8e('0x3c')][_0x6c8e('0x57')](_0x22f850)[_0x6c8e('0x35')](handleEntityNotFound(_0x495d9d,null))[_0x6c8e('0x35')](respondWithResult(_0x495d9d,null))[_0x6c8e('0x29')](handleError(_0x495d9d,null));};exports['create']=function(_0x3b09f7,_0x43e48d){return db[_0x6c8e('0x3c')]['create'](_0x3b09f7[_0x6c8e('0x58')],{})[_0x6c8e('0x35')](function(_0x4fa72b){var _0x16af55=_0x3b09f7[_0x6c8e('0x59')][_0x6c8e('0x5a')]({'plain':!![]});if(!_0x16af55)throw new Error(_0x6c8e('0x5b'));if(_0x16af55[_0x6c8e('0x5c')]===_0x6c8e('0x59')){var _0x53926b=_0x4fa72b[_0x6c8e('0x5a')]({'plain':!![]});var _0x2d6438=_0x6c8e('0x37');return db['UserProfileSection'][_0x6c8e('0x57')]({'where':{'name':_0x2d6438,'userProfileId':_0x16af55['userProfileId']},'raw':!![]})[_0x6c8e('0x35')](function(_0x35b6fb){if(_0x35b6fb&&_0x35b6fb[_0x6c8e('0x5d')]===0x0){return db[_0x6c8e('0x38')][_0x6c8e('0x5e')]({'name':_0x53926b['name'],'resourceId':_0x53926b['id'],'type':_0x35b6fb[_0x6c8e('0x39')],'sectionId':_0x35b6fb['id']},{})[_0x6c8e('0x35')](function(){return _0x4fa72b;});}else{return _0x4fa72b;}})[_0x6c8e('0x29')](function(_0xd62644){logger[_0x6c8e('0x24')](_0x6c8e('0x5f'),_0xd62644);throw _0xd62644;});}return _0x4fa72b;})[_0x6c8e('0x35')](respondWithResult(_0x43e48d,0xc9))['catch'](handleError(_0x43e48d,null));};exports[_0x6c8e('0x60')]=function(_0x4697a3,_0x356334){if(_0x4697a3[_0x6c8e('0x58')]['id']){delete _0x4697a3[_0x6c8e('0x58')]['id'];}return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0x4697a3[_0x6c8e('0x53')]['id']},'include':[{'model':db['Pause'],'as':_0x6c8e('0x61')}]})[_0x6c8e('0x35')](handleEntityNotFound(_0x356334,null))['then'](saveUpdates(_0x4697a3[_0x6c8e('0x58')],null))[_0x6c8e('0x35')](respondWithResult(_0x356334,null))['catch'](handleError(_0x356334,null));};exports[_0x6c8e('0x36')]=function(_0x5b0f44,_0x316153){return db['FaxAccount']['find']({'where':{'id':_0x5b0f44['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x316153,null))[_0x6c8e('0x35')](removeEntity(_0x316153,null))[_0x6c8e('0x29')](handleError(_0x316153,null));};exports[_0x6c8e('0x62')]=function(_0x412f81,_0x599f73){return db[_0x6c8e('0x3c')][_0x6c8e('0x62')]()[_0x6c8e('0x35')](respondWithResult(_0x599f73,null))['catch'](handleError(_0x599f73,null));};exports[_0x6c8e('0x63')]=function(_0x588c3f,_0x1f67b3,_0x82a27b){if(_0x588c3f[_0x6c8e('0x58')]['id']){delete _0x588c3f[_0x6c8e('0x58')]['id'];}return db[_0x6c8e('0x3c')]['find']({'where':{'id':_0x588c3f[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x1f67b3,null))[_0x6c8e('0x35')](function(_0x49fbb5){if(_0x49fbb5){_0x588c3f[_0x6c8e('0x58')][_0x6c8e('0x64')]=_0x49fbb5['id'];return db[_0x6c8e('0x65')][_0x6c8e('0x5e')](_0x588c3f[_0x6c8e('0x58')]);}})['then'](respondWithResult(_0x1f67b3,null))[_0x6c8e('0x29')](handleError(_0x1f67b3,null));};exports['getDispositions']=function(_0x581fd8,_0xc986af,_0x44e821){var _0x594cfc={'raw':![],'where':{}};var _0x238a9f={};var _0x23599c={'count':0x0,'rows':[]};return db['FaxAccount'][_0x6c8e('0x66')]({'where':{'id':_0x581fd8[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0xc986af,null))[_0x6c8e('0x35')](function(_0x224feb){if(_0x224feb){_0x238a9f[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x65')][_0x6c8e('0x3d')]);_0x238a9f[_0x6c8e('0x43')]=_['keys'](_0x581fd8['query']);_0x238a9f[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0x238a9f[_0x6c8e('0x41')],_0x238a9f['query']);_0x594cfc[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0x238a9f[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x581fd8['query']['fields']));_0x594cfc['attributes']=_0x594cfc[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x594cfc[_0x6c8e('0x45')]:_0x238a9f[_0x6c8e('0x41')];if(!_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x49')]('nolimit')){_0x594cfc[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x2f')]);_0x594cfc[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}_0x594cfc[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x581fd8[_0x6c8e('0x43')]['sort']);_0x594cfc[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_['pick'](_0x581fd8[_0x6c8e('0x43')],_0x238a9f[_0x6c8e('0x44')]));_0x594cfc[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x224feb['id'];if(_0x581fd8['query'][_0x6c8e('0x4d')]){_0x594cfc['where']=_[_0x6c8e('0x4e')](_0x594cfc[_0x6c8e('0x4b')],{'$or':_[_0x6c8e('0x42')](_0x594cfc['attributes'],function(_0x4d5adc){var _0x4ff9b3={};_0x4ff9b3[_0x4d5adc]={'$like':'%'+_0x581fd8[_0x6c8e('0x43')]['filter']+'%'};return _0x4ff9b3;})});}_0x594cfc=_['merge']({},_0x594cfc,_0x581fd8[_0x6c8e('0x50')]);return db['Disposition'][_0x6c8e('0x30')]({'where':_0x594cfc[_0x6c8e('0x4b')]})['then'](function(_0x16fdb9){_0x23599c[_0x6c8e('0x30')]=_0x16fdb9;if(_0x581fd8[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x594cfc[_0x6c8e('0x56')]=[{'all':!![]}];}return db[_0x6c8e('0x65')][_0x6c8e('0x51')](_0x594cfc);})[_0x6c8e('0x35')](function(_0x3e43c1){_0x23599c['rows']=_0x3e43c1;return _0x23599c;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0xc986af,_0x594cfc))[_0x6c8e('0x29')](handleError(_0xc986af,null));};exports[_0x6c8e('0x68')]=function(_0x43bdd7,_0x2f01da,_0x3aa808){return db[_0x6c8e('0x3c')]['find']({'where':{'id':_0x43bdd7[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x2f01da,null))[_0x6c8e('0x35')](function(_0x3b7ef8){if(_0x3b7ef8){return _0x3b7ef8[_0x6c8e('0x68')](_0x43bdd7[_0x6c8e('0x43')][_0x6c8e('0x69')]);}})['then'](respondWithStatusCode(_0x2f01da,null))[_0x6c8e('0x29')](handleError(_0x2f01da,null));};exports[_0x6c8e('0x6a')]=function(_0x5a18cb,_0x4b471c,_0xf0a1a6){if(_0x5a18cb['body']['id']){delete _0x5a18cb['body']['id'];}return db[_0x6c8e('0x3c')][_0x6c8e('0x57')]({'where':{'id':_0x5a18cb['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x4b471c,null))[_0x6c8e('0x35')](function(_0x70d0d1){if(_0x70d0d1){_0x5a18cb[_0x6c8e('0x58')][_0x6c8e('0x64')]=_0x70d0d1['id'];return db['CannedAnswer'][_0x6c8e('0x5e')](_0x5a18cb[_0x6c8e('0x58')]);}})['then'](respondWithResult(_0x4b471c,null))[_0x6c8e('0x29')](handleError(_0x4b471c,null));};exports['getAnswers']=function(_0x5eabcb,_0x5674a0,_0x11690c){var _0x181a94={'raw':![],'where':{}};var _0x211d58={};var _0x457101={'count':0x0,'rows':[]};return db[_0x6c8e('0x3c')]['findOne']({'where':{'id':_0x5eabcb[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x5674a0,null))[_0x6c8e('0x35')](function(_0x187f7a){if(_0x187f7a){_0x211d58[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x6b')][_0x6c8e('0x3d')]);_0x211d58[_0x6c8e('0x43')]=_['keys'](_0x5eabcb[_0x6c8e('0x43')]);_0x211d58[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0x211d58[_0x6c8e('0x41')],_0x211d58[_0x6c8e('0x43')]);_0x181a94[_0x6c8e('0x45')]=_['intersection'](_0x211d58[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x5eabcb[_0x6c8e('0x43')]['fields']));_0x181a94[_0x6c8e('0x45')]=_0x181a94[_0x6c8e('0x45')]['length']?_0x181a94[_0x6c8e('0x45')]:_0x211d58[_0x6c8e('0x41')];if(!_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x49')](_0x6c8e('0x6c'))){_0x181a94[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x5eabcb['query'][_0x6c8e('0x2f')]);_0x181a94[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x5eabcb[_0x6c8e('0x43')]['offset']);}_0x181a94[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x4a')]);_0x181a94[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x5eabcb[_0x6c8e('0x43')],_0x211d58[_0x6c8e('0x44')]));_0x181a94[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x187f7a['id'];if(_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x181a94[_0x6c8e('0x4b')]=_['merge'](_0x181a94['where'],{'$or':_['map'](_0x181a94[_0x6c8e('0x45')],function(_0x37f6dc){var _0x4a91cc={};_0x4a91cc[_0x37f6dc]={'$like':'%'+_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x4a91cc;})});}_0x181a94=_[_0x6c8e('0x4e')]({},_0x181a94,_0x5eabcb['options']);return db[_0x6c8e('0x6b')]['count']({'where':_0x181a94['where']})['then'](function(_0x57603f){_0x457101[_0x6c8e('0x30')]=_0x57603f;if(_0x5eabcb[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x181a94[_0x6c8e('0x56')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x181a94);})[_0x6c8e('0x35')](function(_0x1fe5ab){_0x457101['rows']=_0x1fe5ab;return _0x457101;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0x5674a0,_0x181a94))['catch'](handleError(_0x5674a0,null));};exports[_0x6c8e('0x6d')]=function(_0xced51d,_0x21fca7,_0x145c4e){return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0xced51d[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x21fca7,null))[_0x6c8e('0x35')](function(_0x74531e){if(_0x74531e){return _0x74531e[_0x6c8e('0x6d')](_0xced51d[_0x6c8e('0x43')][_0x6c8e('0x69')]);}})[_0x6c8e('0x35')](respondWithStatusCode(_0x21fca7,null))[_0x6c8e('0x29')](handleError(_0x21fca7,null));};exports[_0x6c8e('0x6e')]=function(_0x5f189f,_0x6b4b28,_0xe35a8b){return db['FaxInteraction'][_0x6c8e('0x57')]({'where':{'id':_0x5f189f[_0x6c8e('0x53')]['id']}})['then'](handleEntityNotFound(_0x6b4b28,null))['then'](function(_0xbda0a9){if(_0xbda0a9){return _0xbda0a9[_0x6c8e('0x6e')](_0x5f189f[_0x6c8e('0x58')][_0x6c8e('0x69')],_[_0x6c8e('0x6f')](_0x5f189f[_0x6c8e('0x58')],['ids','id'])||{});}})[_0x6c8e('0x35')](respondWithResult(_0x6b4b28,null))['catch'](handleError(_0x6b4b28,null));};exports[_0x6c8e('0x70')]=function(_0x3d07ab,_0x1786a7,_0x10009a){var _0x7f6a64={'raw':![],'where':{}};var _0x1c928f={};var _0x6878f6={'count':0x0,'rows':[]};return db[_0x6c8e('0x3c')][_0x6c8e('0x66')]({'where':{'id':_0x3d07ab[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x1786a7,null))[_0x6c8e('0x35')](function(_0x312707){if(_0x312707){_0x1c928f['model']=_[_0x6c8e('0x54')](db['FaxInteraction']['rawAttributes']);_0x1c928f[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x3d07ab[_0x6c8e('0x43')]);_0x1c928f['filters']=_[_0x6c8e('0x46')](_0x1c928f['model'],_0x1c928f[_0x6c8e('0x43')]);_0x7f6a64[_0x6c8e('0x45')]=_['intersection'](_0x1c928f[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x7f6a64[_0x6c8e('0x45')]=_0x7f6a64[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x7f6a64['attributes']:_0x1c928f[_0x6c8e('0x41')];if(!_0x3d07ab[_0x6c8e('0x43')]['hasOwnProperty'](_0x6c8e('0x6c'))){_0x7f6a64[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x3d07ab[_0x6c8e('0x43')]['limit']);_0x7f6a64[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}_0x7f6a64[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x3d07ab['query'][_0x6c8e('0x4a')]);_0x7f6a64[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x3d07ab['query'],_0x1c928f[_0x6c8e('0x44')]));_0x7f6a64[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x312707['id'];if(_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x7f6a64[_0x6c8e('0x4b')]=_['merge'](_0x7f6a64[_0x6c8e('0x4b')],{'$or':_['map'](_0x7f6a64[_0x6c8e('0x45')],function(_0x4481bc){var _0x17a07c={};_0x17a07c[_0x4481bc]={'$like':'%'+_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x17a07c;})});}_0x7f6a64=_[_0x6c8e('0x4e')]({},_0x7f6a64,_0x3d07ab[_0x6c8e('0x50')]);return db['FaxInteraction']['count']({'where':_0x7f6a64[_0x6c8e('0x4b')]})[_0x6c8e('0x35')](function(_0x2b59eb){_0x6878f6['count']=_0x2b59eb;if(_0x3d07ab[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x7f6a64[_0x6c8e('0x56')]=[{'model':db[_0x6c8e('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x6c8e('0x72'),'attributes':[_0x6c8e('0x39'),_0x6c8e('0x73'),'internal'],'required':![]},{'model':db[_0x6c8e('0x74')],'as':'Tags','attributes':['id',_0x6c8e('0x39'),'color'],'where':_0x3d07ab[_0x6c8e('0x43')]['tag']?{'id':_0x3d07ab['query'][_0x6c8e('0x75')]}:undefined,'required':_0x3d07ab[_0x6c8e('0x43')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x6c8e('0x51')](_0x7f6a64);})[_0x6c8e('0x35')](function(_0x5c640d){_0x6878f6[_0x6c8e('0x52')]=_0x5c640d;return _0x6878f6;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0x1786a7,_0x7f6a64))[_0x6c8e('0x29')](handleError(_0x1786a7,null));};exports[_0x6c8e('0x76')]=function(_0xc08c89,_0x3212bd,_0x3480b5){return db[_0x6c8e('0x3c')][_0x6c8e('0x66')]({'where':{'id':_0xc08c89[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x3212bd,null))['then'](function(_0x200f47){if(_0x200f47){return db[_0x6c8e('0x77')][_0x6c8e('0x78')](function(_0xaee925){return db[_0x6c8e('0x79')][_0x6c8e('0x36')]({'where':{'FaxAccountId':_0xc08c89['params']['id']},'transaction':_0xaee925})[_0x6c8e('0x35')](function(_0x318cb2){var _0x4176eb=_[_0x6c8e('0x42')](_0xc08c89[_0x6c8e('0x58')],function(_0x141230){_0x141230[_0x6c8e('0x64')]=_0xc08c89[_0x6c8e('0x53')]['id'];return _0x141230;});return db['FaxApplication'][_0x6c8e('0x7a')](_0x4176eb,{'transaction':_0xaee925});});})[_0x6c8e('0x35')](function(){return db[_0x6c8e('0x79')][_0x6c8e('0x7b')]({'where':{'FaxAccountId':_0xc08c89[_0x6c8e('0x53')]['id']},'order':'priority'});});}})[_0x6c8e('0x35')](respondWithResult(_0x3212bd,null))[_0x6c8e('0x29')](handleError(_0x3212bd,null));};exports[_0x6c8e('0x7c')]=function(_0x1e1ae9,_0x21b3b2,_0x230e25){var _0x1bfa6f={};var _0x36d1c0={};var _0x5310fe;var _0xf3bcc7;return db['FaxAccount'][_0x6c8e('0x66')]({'where':{'id':_0x1e1ae9[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x21b3b2,null))[_0x6c8e('0x35')](function(_0x575bbe){if(_0x575bbe){_0x5310fe=_0x575bbe;_0x36d1c0[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x79')]['rawAttributes']);_0x36d1c0[_0x6c8e('0x43')]=_['keys'](_0x1e1ae9[_0x6c8e('0x43')]);_0x36d1c0['filters']=_[_0x6c8e('0x46')](_0x36d1c0[_0x6c8e('0x41')],_0x36d1c0[_0x6c8e('0x43')]);_0x1bfa6f[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0x36d1c0[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x1e1ae9[_0x6c8e('0x43')]['fields']));_0x1bfa6f['attributes']=_0x1bfa6f['attributes'][_0x6c8e('0x48')]?_0x1bfa6f['attributes']:_0x36d1c0[_0x6c8e('0x41')];_0x1bfa6f[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x1e1ae9['query'][_0x6c8e('0x4a')]);_0x1bfa6f['where']=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x1e1ae9[_0x6c8e('0x43')],_0x36d1c0[_0x6c8e('0x44')]));if(_0x1e1ae9[_0x6c8e('0x43')]['filter']){_0x1bfa6f['where']=_['merge'](_0x1bfa6f['where'],{'$or':_[_0x6c8e('0x42')](_0x1bfa6f[_0x6c8e('0x45')],function(_0x4cdb26){var _0x3a6c08={};_0x3a6c08[_0x4cdb26]={'$like':'%'+_0x1e1ae9[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x3a6c08;})});}_0x1bfa6f=_[_0x6c8e('0x4e')]({},_0x1bfa6f,_0x1e1ae9[_0x6c8e('0x50')]);return _0x5310fe[_0x6c8e('0x7c')](_0x1bfa6f);}})[_0x6c8e('0x35')](function(_0x1456ce){if(_0x1456ce){_0xf3bcc7=_0x1456ce[_0x6c8e('0x48')];if(!_0x1e1ae9[_0x6c8e('0x43')][_0x6c8e('0x49')](_0x6c8e('0x6c'))){_0x1bfa6f[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x1e1ae9['query'][_0x6c8e('0x2f')]);_0x1bfa6f[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x1e1ae9[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}return _0x5310fe[_0x6c8e('0x7c')](_0x1bfa6f);}})[_0x6c8e('0x35')](function(_0x36f4b6){if(_0x36f4b6){return _0x36f4b6?{'count':_0xf3bcc7,'rows':_0x36f4b6}:null;}})[_0x6c8e('0x35')](respondWithResult(_0x21b3b2,null))['catch'](handleError(_0x21b3b2,null));};function Extension(_0x477214,_0x350c6d,_0xfa12ba,_0x122fd7){this[_0x6c8e('0x7d')]='from-voip-provider';this['exten']=_0x477214[_0x6c8e('0x7e')];this[_0x6c8e('0x7f')]=_0x122fd7;this[_0x6c8e('0x3f')]='system';this[_0x6c8e('0x80')]=_0x6c8e('0x81');this[_0x6c8e('0x64')]=_0x477214['id'];this[_0x6c8e('0x82')]=_0x350c6d;this[_0x6c8e('0x83')]=_0xfa12ba;}function createExtensionsReciveFax(_0x54259f){var _0x25d1df=0x1;var _0xb48084=[];_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,'',_0x6c8e('0x85')));_0x25d1df+=0x1;_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,_0x6c8e('0x86'),_0x6c8e('0x87')));_0x25d1df+=0x1;for(var _0x1b2f0b in _0x54259f){if(_0x54259f[_0x6c8e('0x49')](_0x1b2f0b)&&(_0x1b2f0b==='ecm'||_0x1b2f0b===_0x6c8e('0x7e')||_0x1b2f0b===_0x6c8e('0x88')||_0x1b2f0b===_0x6c8e('0x89')||_0x1b2f0b===_0x6c8e('0x8a')||_0x1b2f0b===_0x6c8e('0x8b')||_0x1b2f0b==='minrate'||_0x1b2f0b==='modem'||_0x1b2f0b===_0x6c8e('0x8c'))){_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,_0x6c8e('0x8d')+_0x1b2f0b+')='+_0x54259f[_0x1b2f0b],_0x6c8e('0x87')));_0x25d1df+=0x1;}}_0xb48084['push'](new Extension(_0x54259f,_0x25d1df,'6',_0x6c8e('0x8e')));_0x25d1df+=0x1;_0xb48084[_0x6c8e('0x84')](new Extension(_0x54259f,_0x25d1df,_0x6c8e('0x8f'),_0x6c8e('0x90')));_0x25d1df=0x0;return _0xb48084;}exports[_0x6c8e('0x91')]=function(_0xa1ad76,_0x279400,_0x26a3d1){var _0x52087a;return db[_0x6c8e('0x77')][_0x6c8e('0x78')](function(_0x5568f6){return db['FaxAccount'][_0x6c8e('0x5e')](_0xa1ad76[_0x6c8e('0x58')],{'transaction':_0x5568f6})[_0x6c8e('0x35')](function(_0xd429d2){_0x52087a=_0xd429d2['get']({'plain':!![]});return db[_0x6c8e('0x92')][_0x6c8e('0x7a')](createExtensionsReciveFax(_0x52087a),{'transaction':_0x5568f6});});})[_0x6c8e('0x35')](function(){return _0x52087a;})['then'](respondWithResult(_0x279400,null))[_0x6c8e('0x29')](handleError(_0x279400,null));};exports[_0x6c8e('0x93')]=function(_0x23fe10,_0x74232c,_0x1aa38f){var _0x18c043;return db[_0x6c8e('0x77')][_0x6c8e('0x78')](function(_0x58c3ec){return db[_0x6c8e('0x3c')]['update'](_0x23fe10[_0x6c8e('0x58')],{'where':{'id':_0x23fe10['body']['id']},'transaction':_0x58c3ec})['then'](function(_0x2a51b4){return db[_0x6c8e('0x92')][_0x6c8e('0x36')]({'where':{'FaxAccountId':_0x23fe10[_0x6c8e('0x58')]['id']},'transaction':_0x58c3ec})[_0x6c8e('0x35')](function(_0xcaca12){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x23fe10[_0x6c8e('0x58')],[_0x6c8e('0x94'),_0x6c8e('0x40'),_0x6c8e('0x95'),'updatedAt',_0x6c8e('0x96'),_0x6c8e('0x97')])),{'transaction':_0x58c3ec});});});})[_0x6c8e('0x35')](function(){return db[_0x6c8e('0x3c')]['findById'](_0x23fe10[_0x6c8e('0x58')]['id']);})[_0x6c8e('0x35')](respondWithResult(_0x74232c,null))[_0x6c8e('0x29')](handleError(_0x74232c,null));};exports[_0x6c8e('0x98')]=function(_0x3173c,_0x4400dd,_0x21f54d){var _0x454616={'raw':!![],'where':{}};var _0x1c27f3={};var _0x22758d={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3173c['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0x4400dd,null))['then'](function(_0x462693){if(_0x462693){_0x1c27f3[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0x99')][_0x6c8e('0x3d')]);_0x1c27f3[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x3173c[_0x6c8e('0x43')]);_0x1c27f3[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0x1c27f3[_0x6c8e('0x41')],_0x1c27f3['query']);_0x454616['attributes']=_['intersection'](_0x1c27f3[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x454616[_0x6c8e('0x45')]=_0x454616[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x454616[_0x6c8e('0x45')]:_0x1c27f3[_0x6c8e('0x41')];if(!_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x49')](_0x6c8e('0x6c'))){_0x454616['limit']=qs[_0x6c8e('0x2f')](_0x3173c[_0x6c8e('0x43')]['limit']);_0x454616['offset']=qs[_0x6c8e('0x2d')](_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x2d')]);}_0x454616[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x3173c['query']['sort']);_0x454616[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x3173c[_0x6c8e('0x43')],_0x1c27f3[_0x6c8e('0x44')]));_0x454616[_0x6c8e('0x4b')][_0x6c8e('0x64')]=_0x462693['id'];if(_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x454616[_0x6c8e('0x4b')]=_[_0x6c8e('0x4e')](_0x454616[_0x6c8e('0x4b')],{'$or':_['map'](_0x454616[_0x6c8e('0x45')],function(_0x2faa7f){var _0x5371ed={};_0x5371ed[_0x2faa7f]={'$like':'%'+_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x4d')]+'%'};return _0x5371ed;})});}if(_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x9a')]){var _0x2a89f1=_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x9a')][_0x6c8e('0x9b')](',');var _0x324d3d={};_0x324d3d[_0x2a89f1[0x0]]={'$gte':moment(_0x2a89f1[0x1])[_0x6c8e('0x9c')](_0x6c8e('0x9d'))};_0x454616['where']=_[_0x6c8e('0x4e')](_0x454616[_0x6c8e('0x4b')],_0x324d3d);}_0x454616=_[_0x6c8e('0x4e')]({},_0x454616,_0x3173c[_0x6c8e('0x50')]);return db['FaxMessage'][_0x6c8e('0x30')]({'where':_0x454616[_0x6c8e('0x4b')]})[_0x6c8e('0x35')](function(_0x2e5879){_0x22758d[_0x6c8e('0x30')]=_0x2e5879;if(_0x3173c[_0x6c8e('0x43')][_0x6c8e('0x55')]){_0x454616[_0x6c8e('0x56')]=[{'all':!![]}];}return db[_0x6c8e('0x99')][_0x6c8e('0x51')](_0x454616);})[_0x6c8e('0x35')](function(_0x2ce2b0){_0x22758d[_0x6c8e('0x52')]=_0x2ce2b0;return _0x22758d;});}})[_0x6c8e('0x35')](respondWithFilteredResult(_0x4400dd,_0x454616))[_0x6c8e('0x29')](handleError(_0x4400dd,null));};exports[_0x6c8e('0x3a')]=function(_0x47d24a,_0xbfdda4,_0x13ebf1){var _0x483b0d,_0x16fe15={},_0x1af9fe;if(_0x47d24a[_0x6c8e('0x58')]['to']){_0x1af9fe=_0x47d24a[_0x6c8e('0x58')]['to'][0x0];}return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0x47d24a[_0x6c8e('0x53')]['id']},'include':[{'model':db['CmList'],'as':_0x6c8e('0x9e'),'include':[{'model':db[_0x6c8e('0x71')],'as':_0x6c8e('0x9f'),'where':{'fax':_0x1af9fe},'limit':0x1,'order':[[_0x6c8e('0xa0'),'DESC']]}]}]})[_0x6c8e('0x35')](handleEntityNotFound(_0xbfdda4,null))[_0x6c8e('0x35')](function(_0x943401){_0x483b0d=_0x943401;if(_0x47d24a['body']['attachments']&&_0x47d24a['body'][_0x6c8e('0xa1')][_0x6c8e('0x48')]){for(var _0x4584fa=0x0;_0x4584fa<_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][_0x6c8e('0x48')];_0x4584fa+=0x1){_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][_0x4584fa]={'filename':_0x47d24a[_0x6c8e('0x58')]['attachments'][_0x4584fa][_0x6c8e('0x39')],'id':_0x47d24a[_0x6c8e('0x58')]['attachments'][_0x4584fa]['id'],'path':path['join'](config[_0x6c8e('0xa2')],_0x6c8e('0xa3'),_0x47d24a[_0x6c8e('0x58')]['attachments'][_0x4584fa][_0x6c8e('0xa4')])};}}return respondWithRpcPromise(_0x6c8e('0xa5'),'CheckAfterSend',{'FaxAccountId':_['isNil'](_0x47d24a[_0x6c8e('0x53')]['id'])?undefined:_0x47d24a[_0x6c8e('0x53')]['id'],'path':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')]['attachments'][0x0][_0x6c8e('0x5')])?undefined:_0x47d24a['body']['attachments'][0x0]['path'],'fax':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')]['to'][0x0])?undefined:_0x47d24a['body']['to'][0x0]},client9002);})[_0x6c8e('0x35')](function(){if(_0x483b0d){if(_[_0x6c8e('0xa6')](_0x47d24a['body']['from'])){_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa7')]=util[_0x6c8e('0x9c')](_0x6c8e('0xa8'),_0x483b0d[_0x6c8e('0x39')],_0x483b0d['fax']);}if(_0x483b0d[_0x6c8e('0x9e')]){if(_0x483b0d['List'][_0x6c8e('0x9f')][_0x6c8e('0x48')]){return _0x483b0d[_0x6c8e('0x9e')][_0x6c8e('0x9f')][0x0];}else{return db[_0x6c8e('0x71')]['create'](_[_0x6c8e('0x18')](_0x47d24a[_0x6c8e('0x58')],{'firstName':_0x47d24a['body']['to'][0x0],'phone':_0x47d24a['body']['to'][0x0],'fax':_0x47d24a[_0x6c8e('0x58')]['to'][0x0],'ListId':_0x483b0d[_0x6c8e('0x97')]}));}}else{throw new Error(_0x6c8e('0xa9'));}}else{throw new Error(_0x6c8e('0xaa'));}})[_0x6c8e('0x35')](function(_0x24a873){if(_0x24a873){return db[_0x6c8e('0xab')][_0x6c8e('0x57')]({'where':{'ContactId':_0x24a873['id'],'closed':![],'FaxAccountId':_0x483b0d['id']}})[_0x6c8e('0x35')](function(_0x4c672a){if(_0x4c672a){return[_0x4c672a,![]];}return db['FaxInteraction']['create']({'UserId':_0x47d24a[_0x6c8e('0x59')]['id'],'ContactId':_0x24a873['id'],'FaxAccountId':_0x483b0d['id'],'fax':_0x47d24a[_0x6c8e('0x58')]['to'][0x0],'firstMsgDirection':_0x6c8e('0xac'),'Messages':[_[_0x6c8e('0x4e')](_0x47d24a[_0x6c8e('0x58')],{'read':![],'body':_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0]['filename'],'FaxAccountId':_0x483b0d['id'],'UserId':_0x47d24a[_0x6c8e('0x59')]['id'],'ContactId':_0x24a873['id'],'AttachmentId':_0x47d24a[_0x6c8e('0x58')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x6c8e('0x99')],'as':'Messages'}]})[_0x6c8e('0x35')](function(_0x560d14){return[_0x560d14,!![]];});});}else{throw new Error(_0x6c8e('0xad'));}})[_0x6c8e('0xae')](function(_0x4941b0,_0x51e4c1){if(_0x51e4c1){return _0x4941b0;}return db[_0x6c8e('0x99')]['create']({'direction':_0x6c8e('0xac'),'read':![],'body':_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0][_0x6c8e('0xaf')],'FaxAccountId':_0x483b0d['id'],'FaxInteractionId':_0x4941b0['id'],'UserId':_0x47d24a['user']['id'],'ContactId':_0x4941b0[_0x6c8e('0xb0')],'AttachmentId':_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0]['id']})[_0x6c8e('0x35')](function(_0xe300f9){_0x4941b0[_0x6c8e('0xb1')][_0x6c8e('0xb2')]=[];_0x4941b0[_0x6c8e('0xb1')][_0x6c8e('0xb2')][_0x6c8e('0x84')](_0xe300f9[_0x6c8e('0xb1')]);return _0x4941b0;});})[_0x6c8e('0x35')](function(_0x14f303){respondWithRpcPromise(_0x6c8e('0xb3'),_0x6c8e('0xb3'),{'FaxAccountId':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x53')]['id'])?undefined:_0x47d24a['params']['id'],'path':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')][_0x6c8e('0xa1')][0x0]['path'])?undefined:_0x47d24a[_0x6c8e('0x58')]['attachments'][0x0][_0x6c8e('0x5')],'fax':_[_0x6c8e('0xa6')](_0x47d24a[_0x6c8e('0x58')]['to'][0x0])?undefined:_0x47d24a[_0x6c8e('0x58')]['to'][0x0],'AttachmentId':_0x47d24a['body'][_0x6c8e('0xa1')][0x0]['id']},client9002)[_0x6c8e('0x35')](function(_0x16078f){logger['info'](_0x6c8e('0xb4'),_0x16078f);})[_0x6c8e('0x29')](function(_0x1a2b43){logger[_0x6c8e('0x21')](_0x6c8e('0xb4'),_0x1a2b43);});return _0x14f303;})[_0x6c8e('0x35')](respondWithResult(_0xbfdda4,null))[_0x6c8e('0x29')](handleError(_0xbfdda4,null));};exports[_0x6c8e('0xb5')]=function(_0x222a40,_0x2dca62,_0x4b5d1a){return db['FaxAccount'][_0x6c8e('0x57')]({'where':{'id':_0x222a40[_0x6c8e('0x53')]['id']}})['then'](handleEntityNotFound(_0x2dca62,null))[_0x6c8e('0x35')](function(_0x210881){if(_0x210881){return _0x210881[_0x6c8e('0xb5')](_0x222a40['body'][_0x6c8e('0x69')],_[_0x6c8e('0x6f')](_0x222a40['body'],[_0x6c8e('0x69'),'id'])||{})[_0x6c8e('0xae')](function(_0xcacb3a){for(var _0x185117=0x0;_0x185117<_0x222a40[_0x6c8e('0x58')][_0x6c8e('0x69')][_0x6c8e('0x48')];_0x185117+=0x1){socket[_0x6c8e('0xb6')](_0x6c8e('0xb7'),{'UserId':Number(_0x222a40[_0x6c8e('0x58')][_0x6c8e('0x69')][_0x185117]),'FaxAccountId':Number(_0x222a40[_0x6c8e('0x53')]['id'])});}return _0xcacb3a;});}})[_0x6c8e('0x35')](respondWithResult(_0x2dca62,null))[_0x6c8e('0x29')](handleError(_0x2dca62,null));};exports[_0x6c8e('0xb8')]=function(_0x43adf7,_0xbaf5a9,_0x1600a2){return db[_0x6c8e('0x3c')][_0x6c8e('0x57')]({'where':{'id':_0x43adf7[_0x6c8e('0x53')]['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0xbaf5a9,null))['then'](function(_0x1c27a1){if(_0x1c27a1){return _0x1c27a1['removeAgents'](_0x43adf7[_0x6c8e('0x43')][_0x6c8e('0x69')])[_0x6c8e('0x35')](function(){if(_['isArray'](_0x43adf7[_0x6c8e('0x43')][_0x6c8e('0x69')])){for(var _0x5c3b2a=0x0;_0x5c3b2a<_0x43adf7['query']['ids'][_0x6c8e('0x48')];_0x5c3b2a+=0x1){socket[_0x6c8e('0xb6')](_0x6c8e('0xb9'),{'UserId':Number(_0x43adf7[_0x6c8e('0x43')][_0x6c8e('0x69')][_0x5c3b2a]),'FaxAccountId':Number(_0x43adf7[_0x6c8e('0x53')]['id'])});}}else{socket[_0x6c8e('0xb6')](_0x6c8e('0xb9'),{'UserId':Number(_0x43adf7['query'][_0x6c8e('0x69')]),'FaxAccountId':Number(_0x43adf7[_0x6c8e('0x53')]['id'])});}});}})[_0x6c8e('0x35')](respondWithStatusCode(_0xbaf5a9,null))[_0x6c8e('0x29')](handleError(_0xbaf5a9,null));};exports[_0x6c8e('0xba')]=function(_0x501549,_0xe1f9c5,_0x437378){var _0x3b2e19={};var _0xcaeeec={};var _0x3c76da;var _0x1d5d6a;return db[_0x6c8e('0x3c')][_0x6c8e('0x66')]({'where':{'id':_0x501549['params']['id']}})[_0x6c8e('0x35')](handleEntityNotFound(_0xe1f9c5,null))[_0x6c8e('0x35')](function(_0x59067e){if(_0x59067e){_0x3c76da=_0x59067e;_0xcaeeec[_0x6c8e('0x41')]=_[_0x6c8e('0x54')](db[_0x6c8e('0xbb')][_0x6c8e('0x3d')]);_0xcaeeec[_0x6c8e('0x43')]=_[_0x6c8e('0x54')](_0x501549[_0x6c8e('0x43')]);_0xcaeeec[_0x6c8e('0x44')]=_[_0x6c8e('0x46')](_0xcaeeec[_0x6c8e('0x41')],_0xcaeeec[_0x6c8e('0x43')]);_0x3b2e19[_0x6c8e('0x45')]=_[_0x6c8e('0x46')](_0xcaeeec[_0x6c8e('0x41')],qs[_0x6c8e('0x47')](_0x501549[_0x6c8e('0x43')][_0x6c8e('0x47')]));_0x3b2e19[_0x6c8e('0x45')]=_0x3b2e19[_0x6c8e('0x45')][_0x6c8e('0x48')]?_0x3b2e19[_0x6c8e('0x45')]:_0xcaeeec[_0x6c8e('0x41')];_0x3b2e19[_0x6c8e('0x67')]=qs[_0x6c8e('0x4a')](_0x501549['query'][_0x6c8e('0x4a')]);_0x3b2e19[_0x6c8e('0x4b')]=qs[_0x6c8e('0x44')](_[_0x6c8e('0x4c')](_0x501549[_0x6c8e('0x43')],_0xcaeeec[_0x6c8e('0x44')]));if(_0x501549[_0x6c8e('0x43')][_0x6c8e('0x4d')]){_0x3b2e19[_0x6c8e('0x4b')]=_[_0x6c8e('0x4e')](_0x3b2e19[_0x6c8e('0x4b')],{'$or':_[_0x6c8e('0x42')](_0x3b2e19[_0x6c8e('0x45')],function(_0x534005){var _0x258d35={};_0x258d35[_0x534005]={'$like':'%'+_0x501549['query'][_0x6c8e('0x4d')]+'%'};return _0x258d35;})});}_0x3b2e19=_['merge']({},_0x3b2e19,_0x501549[_0x6c8e('0x50')]);return _0x3c76da[_0x6c8e('0xba')](_0x3b2e19);}})['then'](function(_0x5961a6){if(_0x5961a6){_0x1d5d6a=_0x5961a6[_0x6c8e('0x48')];if(!_0x501549[_0x6c8e('0x43')][_0x6c8e('0x49')]('nolimit')){_0x3b2e19[_0x6c8e('0x2f')]=qs[_0x6c8e('0x2f')](_0x501549['query']['limit']);_0x3b2e19[_0x6c8e('0x2d')]=qs[_0x6c8e('0x2d')](_0x501549['query'][_0x6c8e('0x2d')]);}return _0x3c76da[_0x6c8e('0xba')](_0x3b2e19);}})[_0x6c8e('0x35')](function(_0x469139){if(_0x469139){return _0x469139?{'count':_0x1d5d6a,'rows':_0x469139}:null;}})[_0x6c8e('0x35')](respondWithResult(_0xe1f9c5,null))[_0x6c8e('0x29')](handleError(_0xe1f9c5,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 6298f7a..67fc06f 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 _0xab90=['emit','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x2e766b,_0x51957f){var _0x308db5=function(_0x1ac822){while(--_0x1ac822){_0x2e766b['push'](_0x2e766b['shift']());}};_0x308db5(++_0x51957f);}(_0xab90,0x1b1));var _0x0ab9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xab90[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x0ab9('0x0'));var FaxAccount=require(_0x0ab9('0x1'))['db'][_0x0ab9('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0ab9('0x3')](0x0);var events={'afterCreate':_0x0ab9('0x4'),'afterUpdate':_0x0ab9('0x5'),'afterDestroy':_0x0ab9('0x6')};function emitEvent(_0x1d0be8){return function(_0x14c7f0,_0xdf6541,_0x7ef84e){FaxAccountEvents[_0x0ab9('0x7')](_0x1d0be8+':'+_0x14c7f0['id'],_0x14c7f0);FaxAccountEvents[_0x0ab9('0x7')](_0x1d0be8,_0x14c7f0);_0x7ef84e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x0ab9('0x8')](e,emitEvent(event));}}module[_0x0ab9('0x9')]=FaxAccountEvents; \ No newline at end of file +var _0x930a=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','FaxAccount'];(function(_0x228db1,_0x49fd76){var _0x518e68=function(_0x464072){while(--_0x464072){_0x228db1['push'](_0x228db1['shift']());}};_0x518e68(++_0x49fd76);}(_0x930a,0xf8));var _0xa930=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x930a[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0xa930('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xa930('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa930('0x2')](0x0);var events={'afterCreate':_0xa930('0x3'),'afterUpdate':_0xa930('0x4'),'afterDestroy':_0xa930('0x5')};function emitEvent(_0x2963a0){return function(_0x3ccf72,_0x485005,_0x3d1aee){FaxAccountEvents[_0xa930('0x6')](_0x2963a0+':'+_0x3ccf72['id'],_0x3ccf72);FaxAccountEvents[_0xa930('0x6')](_0x2963a0,_0x3ccf72);_0x3d1aee(null);};}for(var e in events){if(events[_0xa930('0x7')](e)){var event=events[e];FaxAccount[_0xa930('0x8')](e,emitEvent(event));}}module[_0xa930('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index bbf84a6..2280c44 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 _0x1e62=['fax_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x516ba0,_0x1ff037){var _0x11fc34=function(_0x547a8e){while(--_0x547a8e){_0x516ba0['push'](_0x516ba0['shift']());}};_0x11fc34(++_0x1ff037);}(_0x1e62,0xeb));var _0x21e6=function(_0x4aefb9,_0x43d581){_0x4aefb9=_0x4aefb9-0x0;var _0x34afa7=_0x1e62[_0x4aefb9];return _0x34afa7;};'use strict';var _=require('lodash');var util=require(_0x21e6('0x0'));var logger=require(_0x21e6('0x1'))(_0x21e6('0x2'));var moment=require('moment');var BPromise=require(_0x21e6('0x3'));var rp=require(_0x21e6('0x4'));var fs=require('fs');var path=require(_0x21e6('0x5'));var rimraf=require(_0x21e6('0x6'));var config=require(_0x21e6('0x7'));var attributes=require(_0x21e6('0x8'));module[_0x21e6('0x9')]=function(_0xf9bf7a,_0x1115bf){return _0xf9bf7a[_0x21e6('0xa')](_0x21e6('0xb'),attributes,{'tableName':_0x21e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b3b=['../../config/logger','api','moment','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x4a1835,_0xe4a237){var _0x203f1b=function(_0x52886e){while(--_0x52886e){_0x4a1835['push'](_0x4a1835['shift']());}};_0x203f1b(++_0xe4a237);}(_0x2b3b,0x136));var _0xb2b3=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x2b3b[_0x4b7b69];return _0x173b4c;};'use strict';var _=require(_0xb2b3('0x0'));var util=require(_0xb2b3('0x1'));var logger=require(_0xb2b3('0x2'))(_0xb2b3('0x3'));var moment=require(_0xb2b3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b3('0x5'));var rimraf=require(_0xb2b3('0x6'));var config=require(_0xb2b3('0x7'));var attributes=require(_0xb2b3('0x8'));module[_0xb2b3('0x9')]=function(_0x4d4941,_0x269fab){return _0x4d4941[_0xb2b3('0xa')](_0xb2b3('0xb'),attributes,{'tableName':_0xb2b3('0xc'),'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 e2af7fd..f083241 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 _0x5613=['length','defaults','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','get','autoclose','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','User','name','interaction','UserId','unshift','Start','startRouting','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','map','include','debug','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','find','account','List','DESC','FaxApplication','applications','Applications','list','orderBy','priority','asc','Contacts'];(function(_0x172bf6,_0x40b300){var _0x550678=function(_0x16e315){while(--_0x16e315){_0x172bf6['push'](_0x172bf6['shift']());}};_0x550678(++_0x40b300);}(_0x5613,0x71));var _0x3561=function(_0x418ff1,_0x1eb7c6){_0x418ff1=_0x418ff1-0x0;var _0x3b314c=_0x5613[_0x418ff1];return _0x3b314c;};'use strict';var _=require(_0x3561('0x0'));var util=require(_0x3561('0x1'));var moment=require('moment');var BPromise=require(_0x3561('0x2'));var rs=require(_0x3561('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3561('0x4'))['db'];var utils=require(_0x3561('0x5'));var logger=require(_0x3561('0x6'))(_0x3561('0x7'));var config=require(_0x3561('0x8'));var jayson=require(_0x3561('0x9'));var client=jayson[_0x3561('0xa')][_0x3561('0xb')]({'port':0x232c});config[_0x3561('0xc')]=_['defaults'](config[_0x3561('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3561('0xd'))(new Redis(config[_0x3561('0xc')]));require(_0x3561('0xe'))['register'](socket);function respondWithRpcPromise(_0x2546b6,_0x259596,_0x369b18){return new BPromise(function(_0x521498,_0x39ec94){return client['request'](_0x2546b6,_0x369b18)[_0x3561('0xf')](function(_0x22a020){logger[_0x3561('0x10')](_0x3561('0x11'),_0x259596,_0x3561('0x12'));logger['debug'](_0x3561('0x13'),_0x259596,_0x3561('0x12'),JSON[_0x3561('0x14')](_0x22a020));if(_0x22a020[_0x3561('0x15')]){if(_0x22a020['error'][_0x3561('0x16')]===0x1f4){logger[_0x3561('0x15')]('FaxAccount,\x20%s,\x20%s',_0x259596,_0x22a020[_0x3561('0x15')][_0x3561('0x17')]);return _0x39ec94(_0x22a020['error'][_0x3561('0x17')]);}logger[_0x3561('0x15')](_0x3561('0x11'),_0x259596,_0x22a020[_0x3561('0x15')]['message']);return _0x521498(_0x22a020[_0x3561('0x15')]['message']);}else{logger[_0x3561('0x10')]('FaxAccount,\x20%s,\x20%s',_0x259596,_0x3561('0x12'));_0x521498(_0x22a020[_0x3561('0x18')][_0x3561('0x17')]);}})[_0x3561('0x19')](function(_0x7c06b1){logger[_0x3561('0x15')](_0x3561('0x11'),_0x259596,_0x7c06b1);_0x39ec94(_0x7c06b1);});});}exports[_0x3561('0x1a')]=function(_0xcd12b1){var _0x3b3334=this;return new Promise(function(_0x510135,_0x13e5af){return db[_0x3561('0x1b')][_0x3561('0x1c')]({'raw':_0xcd12b1['options']?_0xcd12b1[_0x3561('0x1d')][_0x3561('0x1e')]===undefined?!![]:![]:!![],'where':_0xcd12b1['options']?_0xcd12b1[_0x3561('0x1d')][_0x3561('0x1f')]||null:null,'attributes':_0xcd12b1['options']?_0xcd12b1[_0x3561('0x1d')][_0x3561('0x20')]||null:null,'limit':_0xcd12b1[_0x3561('0x1d')]?_0xcd12b1[_0x3561('0x1d')][_0x3561('0x21')]||null:null,'include':_0xcd12b1[_0x3561('0x1d')]?_0xcd12b1['options']['include']?_[_0x3561('0x22')](_0xcd12b1['options'][_0x3561('0x23')],function(_0x5b19f5){return{'model':db[_0x5b19f5['model']],'as':_0x5b19f5['as'],'attributes':_0x5b19f5['attributes'],'include':_0x5b19f5[_0x3561('0x23')]?_[_0x3561('0x22')](_0x5b19f5[_0x3561('0x23')],function(_0x1820f5){return{'model':db[_0x1820f5['model']],'as':_0x1820f5['as'],'attributes':_0x1820f5[_0x3561('0x20')],'include':_0x1820f5[_0x3561('0x23')]?_[_0x3561('0x22')](_0x1820f5['include'],function(_0x16b6dd){return{'model':db[_0x16b6dd['model']],'as':_0x16b6dd['as'],'attributes':_0x16b6dd[_0x3561('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c84b1){logger['info'](_0x3561('0x1a'),_0xcd12b1);logger[_0x3561('0x24')]('GetFaxAccount',_0xcd12b1,JSON['stringify'](_0x2c84b1));_0x510135(_0x2c84b1);})[_0x3561('0x19')](function(_0x3e8340){logger[_0x3561('0x15')](_0x3561('0x1a'),_0x3e8340[_0x3561('0x17')],_0xcd12b1);_0x13e5af(_0x3b3334[_0x3561('0x15')](0x1f4,_0x3e8340[_0x3561('0x17')]));});});};exports['NotifyFaxAccount']=function(_0x408b23,_0x2458a5,_0x45ca19){var _0x36fb7e=this;return new Promise(function(_0x4ccb04,_0x59a7aa){var _0x2f9f8c={'body':_0x408b23[_0x3561('0x25')],'channel':_0x3561('0x26')};var _0x379a48=[];var _0x5cc270=[];var _0x55aa3a={};return db[_0x3561('0x27')]['describe']()[_0x3561('0xf')](function(_0x4fea43){if(!_0x4fea43){throw new db[(_0x3561('0x28'))][(_0x3561('0x29'))](_0x3561('0x2a'));}_0x379a48=_[_0x3561('0x2b')](_[_0x3561('0x2c')](_0x4fea43),['createdAt','updatedAt']);_0x5cc270=_[_0x3561('0x2b')](_[_0x3561('0x2c')](_0x4fea43),[_0x3561('0x2d'),_0x3561('0x2e'),_0x3561('0x2f'),'ListId']);if(_0x408b23[_0x3561('0x25')]['id']){delete _0x408b23['body']['id'];}if(_[_0x3561('0x30')](_0x408b23[_0x3561('0x25')][_0x3561('0x31')])){throw new db[(_0x3561('0x28'))][(_0x3561('0x29'))](_0x3561('0x32'));}if(_[_0x3561('0x30')](_0x408b23[_0x3561('0x25')][_0x3561('0x25')])||_0x408b23[_0x3561('0x25')][_0x3561('0x25')]===''){throw new db[(_0x3561('0x28'))][(_0x3561('0x29'))](_0x3561('0x33'));}if(_[_0x3561('0x30')](_0x408b23[_0x3561('0x25')][_0x3561('0x34')])){throw new db[(_0x3561('0x28'))]['ValidationError'](_0x3561('0x35')+_0x5cc270);}if(!_[_0x3561('0x36')](_0x5cc270,_0x408b23[_0x3561('0x25')][_0x3561('0x34')])){throw new db[(_0x3561('0x28'))][(_0x3561('0x29'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5cc270);}_0x55aa3a[_0x408b23[_0x3561('0x25')][_0x3561('0x34')]]=_0x408b23[_0x3561('0x25')]['from'];})[_0x3561('0xf')](function(){return db[_0x3561('0x1b')][_0x3561('0x37')]({'where':{'id':_0x408b23[_0x3561('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x3561('0x39'),'include':[{'model':db[_0x3561('0x27')],'as':'Contacts','where':_0x55aa3a,'limit':0x1,'order':[[_0x3561('0x2e'),_0x3561('0x3a')]]}]},{'model':db[_0x3561('0x3b')],'as':'Applications'}]});})[_0x3561('0xf')](function(_0x127415){if(_0x127415&&_0x127415[_0x3561('0x39')]){var _0x2b6045=_0x127415['get']({'plain':!![]});_0x2f9f8c[_0x3561('0x38')]=_0x2b6045;_0x2f9f8c[_0x3561('0x3c')]=_0x2b6045[_0x3561('0x3d')];_0x2f9f8c[_0x3561('0x3e')]=_0x2b6045['List'];_0x2f9f8c[_0x3561('0x3c')]=_[_0x3561('0x3f')](_0x2f9f8c[_0x3561('0x3c')],[_0x3561('0x40')],[_0x3561('0x41')]);if(_0x2f9f8c['account'][_0x3561('0x3d')]){delete _0x2f9f8c['account'][_0x3561('0x3d')];}if(_0x2f9f8c['account']['List']&&_0x2f9f8c[_0x3561('0x38')][_0x3561('0x39')][_0x3561('0x42')][_0x3561('0x43')]){return _0x2f9f8c[_0x3561('0x38')][_0x3561('0x39')][_0x3561('0x42')][0x0];}var _0x320e1f=_[_0x3561('0x44')](_0x408b23[_0x3561('0x25')],{'firstName':_0x408b23[_0x3561('0x25')]['from'],'ListId':_0x2b6045[_0x3561('0x45')]});_0x320e1f[_0x408b23[_0x3561('0x25')][_0x3561('0x34')]]=_0x408b23[_0x3561('0x25')]['from'];return db[_0x3561('0x27')][_0x3561('0x46')](_0x320e1f,{'fields':_0x379a48,'raw':!![]});}})['then'](function(_0x4cc56a){_0x2f9f8c[_0x3561('0x47')]=_0x4cc56a;if(_0x4cc56a){var _0x465bc7={'ContactId':_0x4cc56a['id'],'FaxAccountId':_0x408b23[_0x3561('0x38')]['id'],'fax':_0x4cc56a[_0x3561('0x26')]};return db['FaxInteraction'][_0x3561('0x37')]({'where':{'ContactId':_0x4cc56a['id'],'closed':![],'FaxAccountId':_0x408b23['account']['id']}})[_0x3561('0xf')](function(_0x48a19a){if(_0x48a19a){return[_0x48a19a,![]];}return db[_0x3561('0x48')][_0x3561('0x46')](_0x465bc7)[_0x3561('0xf')](function(_0x1451a3){return[_0x1451a3,!![]];});});}else{throw new Error(_0x3561('0x49'));}})[_0x3561('0x4a')](function(_0x49c6f5,_0x3768a7){var _0x4513eb=_0x49c6f5[_0x3561('0x4b')]({'plain':!![]});if(_0x3768a7){if(_0x2f9f8c[_0x3561('0x38')][_0x3561('0x4c')]){_0x2f9f8c[_0x3561('0x3c')]['push']({'id':0x0,'priority':_0x2f9f8c[_0x3561('0x3c')][_0x3561('0x43')]+0x1,'app':_0x3561('0x4d'),'appdata':'unmanaged','interval':_0x3561('0x4e')});}_0x4513eb[_0x3561('0x4f')]=!![];}else{_0x4513eb[_0x3561('0x4f')]=![];}_0x2f9f8c['interaction']=_0x4513eb;return db[_0x3561('0x50')][_0x3561('0x46')]({'body':_0x408b23['body'][_0x3561('0x25')],'FaxAccountId':_0x408b23['account']['id'],'FaxInteractionId':_0x49c6f5['id'],'direction':'in','ContactId':_0x49c6f5[_0x3561('0x51')],'AttachmentId':_0x408b23[_0x3561('0x25')][_0x3561('0x52')]});})['then'](function(_0x571c9e){_0x2f9f8c[_0x3561('0x17')]=_0x571c9e;if(_0x2f9f8c['interaction']['UserId']){return db[_0x3561('0x53')][_0x3561('0x37')]({'attributes':['id',_0x3561('0x54')],'where':{'id':_0x2f9f8c[_0x3561('0x55')][_0x3561('0x56')]}})[_0x3561('0xf')](function(_0x1b9024){if(_0x1b9024){_0x2f9f8c[_0x3561('0x3c')][_0x3561('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1b9024['name']+','+(_0x2f9f8c[_0x3561('0x38')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3561('0x58'),_0x3561('0x59'),_0x2f9f8c);});}return respondWithRpcPromise('Start','startRouting',_0x2f9f8c);})['then'](function(_0x3098dd){_0x4ccb04(_0x3098dd);})[_0x3561('0x19')](function(_0x774a55){_0x59a7aa(_0x36fb7e[_0x3561('0x15')](0x1f4,_0x774a55['message']));});});}; \ No newline at end of file +var _0xb299=['register','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','GetFaxAccount','FaxAccount','findAll','options','attributes','include','map','model','NotifyFaxAccount','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','find','account','CmList','List','Contacts','Applications','get','applications','list','orderBy','priority','length','defaults','FaxInteraction','spread','autoclose','push','close','unmanaged','created','interaction','FaxMessage','create','ContactId','AttachmentId','User','name','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0xb299,0x14d));var _0x9b29=function(_0x12264f,_0x257f83){_0x12264f=_0x12264f-0x0;var _0x143915=_0xb299[_0x12264f];return _0x143915;};'use strict';var _=require(_0x9b29('0x0'));var util=require('util');var moment=require(_0x9b29('0x1'));var BPromise=require(_0x9b29('0x2'));var rs=require(_0x9b29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9b29('0x4'));var logger=require(_0x9b29('0x5'))(_0x9b29('0x6'));var config=require(_0x9b29('0x7'));var jayson=require(_0x9b29('0x8'));var client=jayson[_0x9b29('0x9')][_0x9b29('0xa')]({'port':0x232c});config['redis']=_['defaults'](config[_0x9b29('0xb')],{'host':_0x9b29('0xc'),'port':0x18eb});var socket=require(_0x9b29('0xd'))(new Redis(config[_0x9b29('0xb')]));require(_0x9b29('0xe'))[_0x9b29('0xf')](socket);function respondWithRpcPromise(_0x5e9891,_0x54119b,_0x31fbe3){return new BPromise(function(_0x3a316c,_0x73cfef){return client['request'](_0x5e9891,_0x31fbe3)[_0x9b29('0x10')](function(_0x2015f7){logger[_0x9b29('0x11')]('FaxAccount,\x20%s,\x20%s',_0x54119b,_0x9b29('0x12'));logger[_0x9b29('0x13')](_0x9b29('0x14'),_0x54119b,_0x9b29('0x12'),JSON[_0x9b29('0x15')](_0x2015f7));if(_0x2015f7[_0x9b29('0x16')]){if(_0x2015f7[_0x9b29('0x16')][_0x9b29('0x17')]===0x1f4){logger[_0x9b29('0x16')]('FaxAccount,\x20%s,\x20%s',_0x54119b,_0x2015f7[_0x9b29('0x16')][_0x9b29('0x18')]);return _0x73cfef(_0x2015f7[_0x9b29('0x16')]['message']);}logger[_0x9b29('0x16')](_0x9b29('0x19'),_0x54119b,_0x2015f7[_0x9b29('0x16')]['message']);return _0x3a316c(_0x2015f7[_0x9b29('0x16')][_0x9b29('0x18')]);}else{logger[_0x9b29('0x11')](_0x9b29('0x19'),_0x54119b,'request\x20sent');_0x3a316c(_0x2015f7[_0x9b29('0x1a')][_0x9b29('0x18')]);}})[_0x9b29('0x1b')](function(_0x4b032b){logger[_0x9b29('0x16')](_0x9b29('0x19'),_0x54119b,_0x4b032b);_0x73cfef(_0x4b032b);});});}exports[_0x9b29('0x1c')]=function(_0x1f562f){var _0x2694e6=this;return new Promise(function(_0x153c29,_0x47fb91){return db[_0x9b29('0x1d')][_0x9b29('0x1e')]({'raw':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f[_0x9b29('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f['options']['where']||null:null,'attributes':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f['options'][_0x9b29('0x20')]||null:null,'limit':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f[_0x9b29('0x1f')]['limit']||null:null,'include':_0x1f562f[_0x9b29('0x1f')]?_0x1f562f[_0x9b29('0x1f')][_0x9b29('0x21')]?_[_0x9b29('0x22')](_0x1f562f['options'][_0x9b29('0x21')],function(_0x23cdb4){return{'model':db[_0x23cdb4[_0x9b29('0x23')]],'as':_0x23cdb4['as'],'attributes':_0x23cdb4[_0x9b29('0x20')],'include':_0x23cdb4[_0x9b29('0x21')]?_['map'](_0x23cdb4[_0x9b29('0x21')],function(_0x42a932){return{'model':db[_0x42a932[_0x9b29('0x23')]],'as':_0x42a932['as'],'attributes':_0x42a932[_0x9b29('0x20')],'include':_0x42a932[_0x9b29('0x21')]?_[_0x9b29('0x22')](_0x42a932['include'],function(_0xbff4ed){return{'model':db[_0xbff4ed[_0x9b29('0x23')]],'as':_0xbff4ed['as'],'attributes':_0xbff4ed[_0x9b29('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9b29('0x10')](function(_0x6694c6){logger[_0x9b29('0x11')](_0x9b29('0x1c'),_0x1f562f);logger[_0x9b29('0x13')](_0x9b29('0x1c'),_0x1f562f,JSON[_0x9b29('0x15')](_0x6694c6));_0x153c29(_0x6694c6);})[_0x9b29('0x1b')](function(_0x235d87){logger[_0x9b29('0x16')](_0x9b29('0x1c'),_0x235d87[_0x9b29('0x18')],_0x1f562f);_0x47fb91(_0x2694e6[_0x9b29('0x16')](0x1f4,_0x235d87[_0x9b29('0x18')]));});});};exports[_0x9b29('0x24')]=function(_0x52cf13,_0x2564b2,_0x2ee507){var _0x3e7d98=this;return new Promise(function(_0x2aea7e,_0x4de713){var _0x44bc6b={'body':_0x52cf13['body'],'channel':'fax'};var _0x5d6212=[];var _0x5c93e8=[];var _0x20d6aa={};return db[_0x9b29('0x25')]['describe']()[_0x9b29('0x10')](function(_0x1c3738){if(!_0x1c3738){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))](_0x9b29('0x28'));}_0x5d6212=_[_0x9b29('0x29')](_[_0x9b29('0x2a')](_0x1c3738),[_0x9b29('0x2b'),'updatedAt']);_0x5c93e8=_[_0x9b29('0x29')](_[_0x9b29('0x2a')](_0x1c3738),[_0x9b29('0x2b'),_0x9b29('0x2c'),_0x9b29('0x2d'),_0x9b29('0x2e')]);if(_0x52cf13[_0x9b29('0x2f')]['id']){delete _0x52cf13[_0x9b29('0x2f')]['id'];}if(_[_0x9b29('0x30')](_0x52cf13['body']['from'])){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))]('from\x20is\x20mandatory');}if(_[_0x9b29('0x30')](_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x2f')])||_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x2f')]===''){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))](_0x9b29('0x31'));}if(_[_0x9b29('0x30')](_0x52cf13['body'][_0x9b29('0x32')])){throw new db[(_0x9b29('0x26'))][(_0x9b29('0x27'))](_0x9b29('0x33')+_0x5c93e8);}if(!_['includes'](_0x5c93e8,_0x52cf13['body'][_0x9b29('0x32')])){throw new db['Sequelize'][(_0x9b29('0x27'))](_0x9b29('0x34')+_0x5c93e8);}_0x20d6aa[_0x52cf13['body'][_0x9b29('0x32')]]=_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x35')];})['then'](function(){return db[_0x9b29('0x1d')][_0x9b29('0x36')]({'where':{'id':_0x52cf13[_0x9b29('0x37')]['id']},'include':[{'model':db[_0x9b29('0x38')],'as':_0x9b29('0x39'),'include':[{'model':db['CmContact'],'as':_0x9b29('0x3a'),'where':_0x20d6aa,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['FaxApplication'],'as':_0x9b29('0x3b')}]});})['then'](function(_0x20b1b5){if(_0x20b1b5&&_0x20b1b5[_0x9b29('0x39')]){var _0x21efdf=_0x20b1b5[_0x9b29('0x3c')]({'plain':!![]});_0x44bc6b['account']=_0x21efdf;_0x44bc6b[_0x9b29('0x3d')]=_0x21efdf[_0x9b29('0x3b')];_0x44bc6b[_0x9b29('0x3e')]=_0x21efdf[_0x9b29('0x39')];_0x44bc6b[_0x9b29('0x3d')]=_[_0x9b29('0x3f')](_0x44bc6b[_0x9b29('0x3d')],[_0x9b29('0x40')],['asc']);if(_0x44bc6b[_0x9b29('0x37')][_0x9b29('0x3b')]){delete _0x44bc6b[_0x9b29('0x37')]['Applications'];}if(_0x44bc6b[_0x9b29('0x37')]['List']&&_0x44bc6b[_0x9b29('0x37')][_0x9b29('0x39')][_0x9b29('0x3a')][_0x9b29('0x41')]){return _0x44bc6b[_0x9b29('0x37')][_0x9b29('0x39')][_0x9b29('0x3a')][0x0];}var _0x209a66=_[_0x9b29('0x42')](_0x52cf13[_0x9b29('0x2f')],{'firstName':_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x35')],'ListId':_0x21efdf[_0x9b29('0x2e')]});_0x209a66[_0x52cf13[_0x9b29('0x2f')]['mapKey']]=_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x35')];return db[_0x9b29('0x25')]['create'](_0x209a66,{'fields':_0x5d6212,'raw':!![]});}})['then'](function(_0x64ae06){_0x44bc6b['contact']=_0x64ae06;if(_0x64ae06){var _0x110f40={'ContactId':_0x64ae06['id'],'FaxAccountId':_0x52cf13[_0x9b29('0x37')]['id'],'fax':_0x64ae06['fax']};return db[_0x9b29('0x43')]['find']({'where':{'ContactId':_0x64ae06['id'],'closed':![],'FaxAccountId':_0x52cf13[_0x9b29('0x37')]['id']}})[_0x9b29('0x10')](function(_0x1b7dcb){if(_0x1b7dcb){return[_0x1b7dcb,![]];}return db[_0x9b29('0x43')]['create'](_0x110f40)[_0x9b29('0x10')](function(_0x1a3511){return[_0x1a3511,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x9b29('0x44')](function(_0x49b76a,_0x2789de){var _0x1bad97=_0x49b76a[_0x9b29('0x3c')]({'plain':!![]});if(_0x2789de){if(_0x44bc6b[_0x9b29('0x37')][_0x9b29('0x45')]){_0x44bc6b['applications'][_0x9b29('0x46')]({'id':0x0,'priority':_0x44bc6b[_0x9b29('0x3d')][_0x9b29('0x41')]+0x1,'app':_0x9b29('0x47'),'appdata':_0x9b29('0x48'),'interval':'*,*,*,*'});}_0x1bad97[_0x9b29('0x49')]=!![];}else{_0x1bad97[_0x9b29('0x49')]=![];}_0x44bc6b[_0x9b29('0x4a')]=_0x1bad97;return db[_0x9b29('0x4b')][_0x9b29('0x4c')]({'body':_0x52cf13[_0x9b29('0x2f')]['body'],'FaxAccountId':_0x52cf13[_0x9b29('0x37')]['id'],'FaxInteractionId':_0x49b76a['id'],'direction':'in','ContactId':_0x49b76a[_0x9b29('0x4d')],'AttachmentId':_0x52cf13[_0x9b29('0x2f')][_0x9b29('0x4e')]});})['then'](function(_0x19ab80){_0x44bc6b[_0x9b29('0x18')]=_0x19ab80;if(_0x44bc6b[_0x9b29('0x4a')]['UserId']){return db[_0x9b29('0x4f')]['find']({'attributes':['id',_0x9b29('0x50')],'where':{'id':_0x44bc6b[_0x9b29('0x4a')][_0x9b29('0x51')]}})[_0x9b29('0x10')](function(_0x110c11){if(_0x110c11){_0x44bc6b[_0x9b29('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9b29('0x52'),'appdata':_0x110c11[_0x9b29('0x50')]+','+(_0x44bc6b['account'][_0x9b29('0x53')]||0xa),'interval':_0x9b29('0x54')});}return respondWithRpcPromise(_0x9b29('0x55'),_0x9b29('0x56'),_0x44bc6b);});}return respondWithRpcPromise('Start',_0x9b29('0x56'),_0x44bc6b);})[_0x9b29('0x10')](function(_0x2e2f93){_0x2aea7e(_0x2e2f93);})[_0x9b29('0x1b')](function(_0x4d1c69){_0x4de713(_0x3e7d98['error'](0x1f4,_0x4d1c69[_0x9b29('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 09e0083..cbbf8dd 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 _0xd489=['length','faxAccount:','./faxAccount.events','remove','update','emit','register'];(function(_0x207368,_0x20a552){var _0x367c2d=function(_0x5eec20){while(--_0x5eec20){_0x207368['push'](_0x207368['shift']());}};_0x367c2d(++_0x20a552);}(_0xd489,0xdb));var _0x9d48=function(_0x14774d,_0x38d99f){_0x14774d=_0x14774d-0x0;var _0x617dc=_0xd489[_0x14774d];return _0x617dc;};'use strict';var FaxAccountEvents=require(_0x9d48('0x0'));var events=['save',_0x9d48('0x1'),_0x9d48('0x2')];function createListener(_0x170fb6,_0x16bd17){return function(_0x175a90){_0x16bd17[_0x9d48('0x3')](_0x170fb6,_0x175a90);};}function removeListener(_0x2a1457,_0x16d1e8){return function(){FaxAccountEvents['removeListener'](_0x2a1457,_0x16d1e8);};}exports[_0x9d48('0x4')]=function(_0x2b1b28){for(var _0x1bcc2f=0x0,_0x47269b=events[_0x9d48('0x5')];_0x1bcc2f<_0x47269b;_0x1bcc2f++){var _0x5a8806=events[_0x1bcc2f];var _0x2541c3=createListener(_0x9d48('0x6')+_0x5a8806,_0x2b1b28);FaxAccountEvents['on'](_0x5a8806,_0x2541c3);}}; \ No newline at end of file +var _0x6b93=['save','remove','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x4521c2,_0x7360ee){var _0x120e1f=function(_0x3546e2){while(--_0x3546e2){_0x4521c2['push'](_0x4521c2['shift']());}};_0x120e1f(++_0x7360ee);}(_0x6b93,0xf7));var _0x36b9=function(_0x1c8418,_0x593434){_0x1c8418=_0x1c8418-0x0;var _0x301619=_0x6b93[_0x1c8418];return _0x301619;};'use strict';var FaxAccountEvents=require(_0x36b9('0x0'));var events=[_0x36b9('0x1'),_0x36b9('0x2'),'update'];function createListener(_0x1157ff,_0x5c2bee){return function(_0x4e0a99){_0x5c2bee[_0x36b9('0x3')](_0x1157ff,_0x4e0a99);};}function removeListener(_0x22db78,_0x3e9ae6){return function(){FaxAccountEvents[_0x36b9('0x4')](_0x22db78,_0x3e9ae6);};}exports[_0x36b9('0x5')]=function(_0x37f76d){for(var _0x170bd1=0x0,_0x2a654f=events[_0x36b9('0x6')];_0x170bd1<_0x2a654f;_0x170bd1++){var _0x5d78a4=events[_0x170bd1];var _0x150985=createListener(_0x36b9('0x7')+_0x5d78a4,_0x37f76d);FaxAccountEvents['on'](_0x5d78a4,_0x150985);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 1da34b8..1fb6b7b 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(_0x2efd91,_0x57381c){var _0x190bfa=function(_0x2f0622){while(--_0x2f0622){_0x2efd91['push'](_0x2efd91['shift']());}};_0x190bfa(++_0x57381c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x3512c3,_0x346843){var _0x3b2842=function(_0x49341b){while(--_0x49341b){_0x3512c3['push'](_0x3512c3['shift']());}};_0x3b2842(++_0x346843);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 ad13ce5..5369d22 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 _0x3099=['sequelize','STRING','TEXT'];(function(_0x4899e4,_0x573aa1){var _0x1f2b9d=function(_0x56c0d3){while(--_0x56c0d3){_0x4899e4['push'](_0x4899e4['shift']());}};_0x1f2b9d(++_0x573aa1);}(_0x3099,0x1f2));var _0x9309=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3099[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9309('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9309('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9309('0x2')]()},'description':{'type':Sequelize[_0x9309('0x1')]},'interval':{'type':Sequelize[_0x9309('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x3756=['STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x15d58c,_0x3054f3){var _0x2637fd=function(_0xb4b472){while(--_0xb4b472){_0x15d58c['push'](_0x15d58c['shift']());}};_0x2637fd(++_0x3054f3);}(_0x3756,0x112));var _0x6375=function(_0x5e3420,_0x4e3e54){_0x5e3420=_0x5e3420-0x0;var _0x30bb53=_0x3756[_0x5e3420];return _0x30bb53;};'use strict';var Sequelize=require(_0x6375('0x0'));module[_0x6375('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6375('0x2')],'allowNull':![],'defaultValue':_0x6375('0x3')},'appdata':{'type':Sequelize[_0x6375('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x6375('0x2')],'defaultValue':_0x6375('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 0f94cbc..c8c01f3 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 _0x44e7=['filter','merge','VIRTUAL','includeAll','include','findAll','show','params','length','options','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','FaxApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x531ee7,_0x43cad7){var _0x90a4bb=function(_0x2c4ead){while(--_0x2c4ead){_0x531ee7['push'](_0x531ee7['shift']());}};_0x90a4bb(++_0x43cad7);}(_0x44e7,0xfe));var _0x744e=function(_0x324e86,_0x81b1cb){_0x324e86=_0x324e86-0x0;var _0x592846=_0x44e7[_0x324e86];return _0x592846;};'use strict';var emlformat=require(_0x744e('0x0'));var rimraf=require(_0x744e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x744e('0x2'));var rp=require(_0x744e('0x3'));var moment=require('moment');var BPromise=require(_0x744e('0x4'));var Mustache=require(_0x744e('0x5'));var util=require(_0x744e('0x6'));var path=require(_0x744e('0x7'));var sox=require(_0x744e('0x8'));var csv=require(_0x744e('0x9'));var ejs=require(_0x744e('0xa'));var fs=require('fs');var fs_extra=require(_0x744e('0xb'));var _=require(_0x744e('0xc'));var squel=require(_0x744e('0xd'));var crypto=require(_0x744e('0xe'));var jsforce=require(_0x744e('0xf'));var deskjs=require(_0x744e('0x10'));var toCsv=require(_0x744e('0x9'));var querystring=require(_0x744e('0x11'));var Papa=require('papaparse');var Redis=require(_0x744e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x744e('0x13'));var as=require(_0x744e('0x14'));var hardwareService=require(_0x744e('0x15'));var logger=require(_0x744e('0x16'))(_0x744e('0x17'));var utils=require(_0x744e('0x18'));var config=require(_0x744e('0x19'));var licenseUtil=require(_0x744e('0x1a'));var db=require(_0x744e('0x1b'))['db'];function respondWithStatusCode(_0x53103d,_0x144c00){_0x144c00=_0x144c00||0xcc;return function(_0xb275f6){if(_0xb275f6){return _0x53103d['sendStatus'](_0x144c00);}return _0x53103d[_0x744e('0x1c')](_0x144c00)['end']();};}function respondWithResult(_0x4097a6,_0x40e621){_0x40e621=_0x40e621||0xc8;return function(_0x35f0cc){if(_0x35f0cc){return _0x4097a6['status'](_0x40e621)[_0x744e('0x1d')](_0x35f0cc);}};}function respondWithFilteredResult(_0x4942a4,_0x21880e){return function(_0xfa2c1c){if(_0xfa2c1c){var _0x52fc89=typeof _0x21880e['offset']===_0x744e('0x1e')&&typeof _0x21880e[_0x744e('0x1f')]===_0x744e('0x1e');var _0x47736c=_0xfa2c1c[_0x744e('0x20')];var _0x14a51b=_0x52fc89?0x0:_0x21880e[_0x744e('0x21')];var _0x691725=_0x52fc89?_0xfa2c1c[_0x744e('0x20')]:_0x21880e[_0x744e('0x21')]+_0x21880e[_0x744e('0x1f')];var _0x308b3f;if(_0x691725>=_0x47736c){_0x691725=_0x47736c;_0x308b3f=0xc8;}else{_0x308b3f=0xce;}_0x4942a4['status'](_0x308b3f);return _0x4942a4[_0x744e('0x22')](_0x744e('0x23'),_0x14a51b+'-'+_0x691725+'/'+_0x47736c)['json'](_0xfa2c1c);}return null;};}function patchUpdates(_0x40a2f7){return function(_0x2894aa){try{jsonpatch[_0x744e('0x24')](_0x2894aa,_0x40a2f7,!![]);}catch(_0x19877a){return BPromise[_0x744e('0x25')](_0x19877a);}return _0x2894aa[_0x744e('0x26')]();};}function saveUpdates(_0x426ea0,_0x2daeed){return function(_0x1e6591){if(_0x1e6591){return _0x1e6591[_0x744e('0x27')](_0x426ea0)[_0x744e('0x28')](function(_0x30f0e8){return _0x30f0e8;});}return null;};}function removeEntity(_0xe5acde,_0x5b7fb7){return function(_0x5925a0){if(_0x5925a0){return _0x5925a0[_0x744e('0x29')]()[_0x744e('0x28')](function(){_0xe5acde['status'](0xcc)[_0x744e('0x2a')]();});}};}function handleEntityNotFound(_0x5b08d8,_0x1ba0dc){return function(_0x1b301f){if(!_0x1b301f){_0x5b08d8[_0x744e('0x2b')](0x194);}return _0x1b301f;};}function handleError(_0x456967,_0xb59e04){_0xb59e04=_0xb59e04||0x1f4;return function(_0x3c02d2){logger[_0x744e('0x2c')](_0x3c02d2[_0x744e('0x2d')]);if(_0x3c02d2['name']){delete _0x3c02d2[_0x744e('0x2e')];}_0x456967[_0x744e('0x1c')](_0xb59e04)['send'](_0x3c02d2);};}exports[_0x744e('0x2f')]=function(_0x415c32,_0x404220){var _0x6c0bf4={},_0x237561={},_0x43f12f={'count':0x0,'rows':[]};var _0xef38a=_[_0x744e('0x30')](db[_0x744e('0x31')][_0x744e('0x32')],function(_0x15733f){return{'name':_0x15733f[_0x744e('0x33')],'type':_0x15733f[_0x744e('0x34')][_0x744e('0x35')]};});_0x237561['model']=_[_0x744e('0x30')](_0xef38a,_0x744e('0x2e'));_0x237561['query']=_[_0x744e('0x36')](_0x415c32[_0x744e('0x37')]);_0x237561[_0x744e('0x38')]=_[_0x744e('0x39')](_0x237561[_0x744e('0x3a')],_0x237561[_0x744e('0x37')]);_0x6c0bf4['attributes']=_[_0x744e('0x39')](_0x237561[_0x744e('0x3a')],qs[_0x744e('0x3b')](_0x415c32[_0x744e('0x37')][_0x744e('0x3b')]));_0x6c0bf4[_0x744e('0x3c')]=_0x6c0bf4[_0x744e('0x3c')]['length']?_0x6c0bf4[_0x744e('0x3c')]:_0x237561[_0x744e('0x3a')];if(!_0x415c32[_0x744e('0x37')][_0x744e('0x3d')](_0x744e('0x3e'))){_0x6c0bf4[_0x744e('0x1f')]=qs[_0x744e('0x1f')](_0x415c32['query']['limit']);_0x6c0bf4['offset']=qs[_0x744e('0x21')](_0x415c32[_0x744e('0x37')]['offset']);}_0x6c0bf4['order']=qs[_0x744e('0x3f')](_0x415c32['query'][_0x744e('0x3f')]);_0x6c0bf4[_0x744e('0x40')]=qs['filters'](_[_0x744e('0x41')](_0x415c32[_0x744e('0x37')],_0x237561['filters']),_0xef38a);if(_0x415c32[_0x744e('0x37')][_0x744e('0x42')]){_0x6c0bf4[_0x744e('0x40')]=_[_0x744e('0x43')](_0x6c0bf4[_0x744e('0x40')],{'$or':_['map'](_0xef38a,function(_0x5a3cda){if(_0x5a3cda['type']!==_0x744e('0x44')){var _0x22e80c={};_0x22e80c[_0x5a3cda['name']]={'$like':'%'+_0x415c32[_0x744e('0x37')][_0x744e('0x42')]+'%'};return _0x22e80c;}})});}_0x6c0bf4=_[_0x744e('0x43')]({},_0x6c0bf4,_0x415c32['options']);var _0x3e4062={'where':_0x6c0bf4[_0x744e('0x40')]};return db[_0x744e('0x31')][_0x744e('0x20')](_0x3e4062)[_0x744e('0x28')](function(_0x578b5d){_0x43f12f[_0x744e('0x20')]=_0x578b5d;if(_0x415c32[_0x744e('0x37')][_0x744e('0x45')]){_0x6c0bf4[_0x744e('0x46')]=[{'all':!![]}];}return db['FaxApplication'][_0x744e('0x47')](_0x6c0bf4);})['then'](function(_0x66e711){_0x43f12f['rows']=_0x66e711;return _0x43f12f;})[_0x744e('0x28')](respondWithFilteredResult(_0x404220,_0x6c0bf4))['catch'](handleError(_0x404220,null));};exports[_0x744e('0x48')]=function(_0x578b40,_0x14dcf3){var _0x563a33={'raw':!![],'where':{'id':_0x578b40[_0x744e('0x49')]['id']}},_0x16daf1={};_0x16daf1[_0x744e('0x3a')]=_['keys'](db[_0x744e('0x31')][_0x744e('0x32')]);_0x16daf1[_0x744e('0x37')]=_[_0x744e('0x36')](_0x578b40['query']);_0x16daf1[_0x744e('0x38')]=_[_0x744e('0x39')](_0x16daf1[_0x744e('0x3a')],_0x16daf1[_0x744e('0x37')]);_0x563a33[_0x744e('0x3c')]=_[_0x744e('0x39')](_0x16daf1['model'],qs['fields'](_0x578b40['query'][_0x744e('0x3b')]));_0x563a33[_0x744e('0x3c')]=_0x563a33['attributes'][_0x744e('0x4a')]?_0x563a33[_0x744e('0x3c')]:_0x16daf1[_0x744e('0x3a')];if(_0x578b40[_0x744e('0x37')]['includeAll']){_0x563a33[_0x744e('0x46')]=[{'all':!![]}];}_0x563a33=_[_0x744e('0x43')]({},_0x563a33,_0x578b40[_0x744e('0x4b')]);return db[_0x744e('0x31')][_0x744e('0x4c')](_0x563a33)[_0x744e('0x28')](handleEntityNotFound(_0x14dcf3,null))[_0x744e('0x28')](respondWithResult(_0x14dcf3,null))[_0x744e('0x4d')](handleError(_0x14dcf3,null));};exports['create']=function(_0x47cd14,_0xcfa4e4){return db['FaxApplication'][_0x744e('0x4e')](_0x47cd14[_0x744e('0x4f')],{})[_0x744e('0x28')](respondWithResult(_0xcfa4e4,0xc9))[_0x744e('0x4d')](handleError(_0xcfa4e4,null));};exports['update']=function(_0x38800c,_0x446b5c){if(_0x38800c['body']['id']){delete _0x38800c[_0x744e('0x4f')]['id'];}return db[_0x744e('0x31')]['find']({'where':{'id':_0x38800c[_0x744e('0x49')]['id']}})[_0x744e('0x28')](handleEntityNotFound(_0x446b5c,null))['then'](saveUpdates(_0x38800c['body'],null))[_0x744e('0x28')](respondWithResult(_0x446b5c,null))[_0x744e('0x4d')](handleError(_0x446b5c,null));};exports[_0x744e('0x29')]=function(_0x206af6,_0x49fc5e){return db['FaxApplication'][_0x744e('0x4c')]({'where':{'id':_0x206af6['params']['id']}})[_0x744e('0x28')](handleEntityNotFound(_0x49fc5e,null))[_0x744e('0x28')](removeEntity(_0x49fc5e,null))['catch'](handleError(_0x49fc5e,null));}; \ No newline at end of file +var _0xcc75=['stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','FaxApplication','findAll','rows','catch','show','keys','includeAll','find','create','body','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc75,0xfe));var _0x5cc7=function(_0x40f4b0,_0x31b96a){_0x40f4b0=_0x40f4b0-0x0;var _0x2294ba=_0xcc75[_0x40f4b0];return _0x2294ba;};'use strict';var emlformat=require(_0x5cc7('0x0'));var rimraf=require(_0x5cc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5cc7('0x2'));var moment=require(_0x5cc7('0x3'));var BPromise=require(_0x5cc7('0x4'));var Mustache=require(_0x5cc7('0x5'));var util=require('util');var path=require(_0x5cc7('0x6'));var sox=require(_0x5cc7('0x7'));var csv=require(_0x5cc7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cc7('0x9'));var _=require('lodash');var squel=require(_0x5cc7('0xa'));var crypto=require(_0x5cc7('0xb'));var jsforce=require(_0x5cc7('0xc'));var deskjs=require(_0x5cc7('0xd'));var toCsv=require(_0x5cc7('0x8'));var querystring=require(_0x5cc7('0xe'));var Papa=require(_0x5cc7('0xf'));var Redis=require(_0x5cc7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5cc7('0x11'));var as=require(_0x5cc7('0x12'));var hardwareService=require(_0x5cc7('0x13'));var logger=require(_0x5cc7('0x14'))(_0x5cc7('0x15'));var utils=require(_0x5cc7('0x16'));var config=require(_0x5cc7('0x17'));var licenseUtil=require(_0x5cc7('0x18'));var db=require(_0x5cc7('0x19'))['db'];function respondWithStatusCode(_0x3bbb76,_0x55c415){_0x55c415=_0x55c415||0xcc;return function(_0x12eb05){if(_0x12eb05){return _0x3bbb76['sendStatus'](_0x55c415);}return _0x3bbb76[_0x5cc7('0x1a')](_0x55c415)[_0x5cc7('0x1b')]();};}function respondWithResult(_0x2fd1a0,_0x44bc0b){_0x44bc0b=_0x44bc0b||0xc8;return function(_0x45ecae){if(_0x45ecae){return _0x2fd1a0['status'](_0x44bc0b)['json'](_0x45ecae);}};}function respondWithFilteredResult(_0x29aa84,_0x36aa55){return function(_0x1d0268){if(_0x1d0268){var _0x1ccb2d=typeof _0x36aa55[_0x5cc7('0x1c')]===_0x5cc7('0x1d')&&typeof _0x36aa55[_0x5cc7('0x1e')]===_0x5cc7('0x1d');var _0x19b816=_0x1d0268['count'];var _0x2ea75f=_0x1ccb2d?0x0:_0x36aa55[_0x5cc7('0x1c')];var _0x398efd=_0x1ccb2d?_0x1d0268[_0x5cc7('0x1f')]:_0x36aa55['offset']+_0x36aa55[_0x5cc7('0x1e')];var _0x55758f;if(_0x398efd>=_0x19b816){_0x398efd=_0x19b816;_0x55758f=0xc8;}else{_0x55758f=0xce;}_0x29aa84[_0x5cc7('0x1a')](_0x55758f);return _0x29aa84[_0x5cc7('0x20')](_0x5cc7('0x21'),_0x2ea75f+'-'+_0x398efd+'/'+_0x19b816)[_0x5cc7('0x22')](_0x1d0268);}return null;};}function patchUpdates(_0x59b72e){return function(_0x39965c){try{jsonpatch[_0x5cc7('0x23')](_0x39965c,_0x59b72e,!![]);}catch(_0x48b622){return BPromise['reject'](_0x48b622);}return _0x39965c['save']();};}function saveUpdates(_0x3ec316,_0x5f32c6){return function(_0x20b06d){if(_0x20b06d){return _0x20b06d['update'](_0x3ec316)[_0x5cc7('0x24')](function(_0x3e9e4a){return _0x3e9e4a;});}return null;};}function removeEntity(_0x346db8,_0x10010d){return function(_0x3d0fb3){if(_0x3d0fb3){return _0x3d0fb3['destroy']()['then'](function(){_0x346db8[_0x5cc7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d415c,_0x195e86){return function(_0x1cd0a8){if(!_0x1cd0a8){_0x3d415c['sendStatus'](0x194);}return _0x1cd0a8;};}function handleError(_0x3a89a9,_0x48b8fd){_0x48b8fd=_0x48b8fd||0x1f4;return function(_0x2ce27e){logger[_0x5cc7('0x25')](_0x2ce27e[_0x5cc7('0x26')]);if(_0x2ce27e[_0x5cc7('0x27')]){delete _0x2ce27e['name'];}_0x3a89a9['status'](_0x48b8fd)[_0x5cc7('0x28')](_0x2ce27e);};}exports[_0x5cc7('0x29')]=function(_0x3066a9,_0x16c267){var _0x5b68bd={},_0x39200f={},_0x9f3a77={'count':0x0,'rows':[]};var _0x32f86f=_[_0x5cc7('0x2a')](db['FaxApplication'][_0x5cc7('0x2b')],function(_0x5b6398){return{'name':_0x5b6398[_0x5cc7('0x2c')],'type':_0x5b6398[_0x5cc7('0x2d')][_0x5cc7('0x2e')]};});_0x39200f[_0x5cc7('0x2f')]=_[_0x5cc7('0x2a')](_0x32f86f,_0x5cc7('0x27'));_0x39200f['query']=_['keys'](_0x3066a9[_0x5cc7('0x30')]);_0x39200f[_0x5cc7('0x31')]=_['intersection'](_0x39200f[_0x5cc7('0x2f')],_0x39200f[_0x5cc7('0x30')]);_0x5b68bd[_0x5cc7('0x32')]=_[_0x5cc7('0x33')](_0x39200f[_0x5cc7('0x2f')],qs['fields'](_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x34')]));_0x5b68bd['attributes']=_0x5b68bd[_0x5cc7('0x32')][_0x5cc7('0x35')]?_0x5b68bd[_0x5cc7('0x32')]:_0x39200f[_0x5cc7('0x2f')];if(!_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x36')]('nolimit')){_0x5b68bd[_0x5cc7('0x1e')]=qs['limit'](_0x3066a9['query'][_0x5cc7('0x1e')]);_0x5b68bd[_0x5cc7('0x1c')]=qs['offset'](_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x1c')]);}_0x5b68bd[_0x5cc7('0x37')]=qs[_0x5cc7('0x38')](_0x3066a9[_0x5cc7('0x30')]['sort']);_0x5b68bd['where']=qs['filters'](_['pick'](_0x3066a9['query'],_0x39200f['filters']),_0x32f86f);if(_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x39')]){_0x5b68bd[_0x5cc7('0x3a')]=_[_0x5cc7('0x3b')](_0x5b68bd['where'],{'$or':_[_0x5cc7('0x2a')](_0x32f86f,function(_0x1d62b1){if(_0x1d62b1['type']!==_0x5cc7('0x3c')){var _0x229e14={};_0x229e14[_0x1d62b1['name']]={'$like':'%'+_0x3066a9[_0x5cc7('0x30')][_0x5cc7('0x39')]+'%'};return _0x229e14;}})});}_0x5b68bd=_[_0x5cc7('0x3b')]({},_0x5b68bd,_0x3066a9[_0x5cc7('0x3d')]);var _0x57aaf7={'where':_0x5b68bd['where']};return db['FaxApplication'][_0x5cc7('0x1f')](_0x57aaf7)[_0x5cc7('0x24')](function(_0x379b6d){_0x9f3a77[_0x5cc7('0x1f')]=_0x379b6d;if(_0x3066a9[_0x5cc7('0x30')]['includeAll']){_0x5b68bd['include']=[{'all':!![]}];}return db[_0x5cc7('0x3e')][_0x5cc7('0x3f')](_0x5b68bd);})['then'](function(_0x48bd62){_0x9f3a77[_0x5cc7('0x40')]=_0x48bd62;return _0x9f3a77;})[_0x5cc7('0x24')](respondWithFilteredResult(_0x16c267,_0x5b68bd))[_0x5cc7('0x41')](handleError(_0x16c267,null));};exports[_0x5cc7('0x42')]=function(_0x5a430c,_0x423bf4){var _0x46dc47={'raw':!![],'where':{'id':_0x5a430c['params']['id']}},_0x4f63bf={};_0x4f63bf[_0x5cc7('0x2f')]=_[_0x5cc7('0x43')](db['FaxApplication']['rawAttributes']);_0x4f63bf[_0x5cc7('0x30')]=_[_0x5cc7('0x43')](_0x5a430c[_0x5cc7('0x30')]);_0x4f63bf[_0x5cc7('0x31')]=_['intersection'](_0x4f63bf['model'],_0x4f63bf[_0x5cc7('0x30')]);_0x46dc47[_0x5cc7('0x32')]=_[_0x5cc7('0x33')](_0x4f63bf[_0x5cc7('0x2f')],qs['fields'](_0x5a430c['query'][_0x5cc7('0x34')]));_0x46dc47[_0x5cc7('0x32')]=_0x46dc47[_0x5cc7('0x32')][_0x5cc7('0x35')]?_0x46dc47[_0x5cc7('0x32')]:_0x4f63bf['model'];if(_0x5a430c[_0x5cc7('0x30')][_0x5cc7('0x44')]){_0x46dc47['include']=[{'all':!![]}];}_0x46dc47=_[_0x5cc7('0x3b')]({},_0x46dc47,_0x5a430c[_0x5cc7('0x3d')]);return db[_0x5cc7('0x3e')][_0x5cc7('0x45')](_0x46dc47)[_0x5cc7('0x24')](handleEntityNotFound(_0x423bf4,null))[_0x5cc7('0x24')](respondWithResult(_0x423bf4,null))[_0x5cc7('0x41')](handleError(_0x423bf4,null));};exports['create']=function(_0x52037a,_0x56e36e){return db['FaxApplication'][_0x5cc7('0x46')](_0x52037a[_0x5cc7('0x47')],{})[_0x5cc7('0x24')](respondWithResult(_0x56e36e,0xc9))[_0x5cc7('0x41')](handleError(_0x56e36e,null));};exports['update']=function(_0x625507,_0x2163c2){if(_0x625507[_0x5cc7('0x47')]['id']){delete _0x625507[_0x5cc7('0x47')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x625507['params']['id']}})['then'](handleEntityNotFound(_0x2163c2,null))[_0x5cc7('0x24')](saveUpdates(_0x625507['body'],null))['then'](respondWithResult(_0x2163c2,null))[_0x5cc7('0x41')](handleError(_0x2163c2,null));};exports[_0x5cc7('0x48')]=function(_0x217728,_0x44680f){return db['FaxApplication'][_0x5cc7('0x45')]({'where':{'id':_0x217728['params']['id']}})[_0x5cc7('0x24')](handleEntityNotFound(_0x44680f,null))[_0x5cc7('0x24')](removeEntity(_0x44680f,null))[_0x5cc7('0x41')](handleError(_0x44680f,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 37af7ec..5cb39e4 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 _0x297b=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication'];(function(_0x6b34a9,_0x5d3082){var _0x1940fb=function(_0x55f8f2){while(--_0x55f8f2){_0x6b34a9['push'](_0x6b34a9['shift']());}};_0x1940fb(++_0x5d3082);}(_0x297b,0x179));var _0xb297=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x297b[_0x36c6eb];return _0x30675b;};'use strict';var _=require('lodash');var util=require(_0xb297('0x0'));var logger=require(_0xb297('0x1'))(_0xb297('0x2'));var moment=require(_0xb297('0x3'));var BPromise=require(_0xb297('0x4'));var rp=require(_0xb297('0x5'));var fs=require('fs');var path=require(_0xb297('0x6'));var rimraf=require(_0xb297('0x7'));var config=require(_0xb297('0x8'));var attributes=require(_0xb297('0x9'));module[_0xb297('0xa')]=function(_0x4abe8c,_0x28f3fe){return _0x4abe8c[_0xb297('0xb')](_0xb297('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb297('0xd'),'collate':_0xb297('0xe')});}; \ No newline at end of file +var _0xdb67=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise'];(function(_0x1bdfea,_0x7c6945){var _0x2fe457=function(_0x2e801d){while(--_0x2e801d){_0x1bdfea['push'](_0x1bdfea['shift']());}};_0x2fe457(++_0x7c6945);}(_0xdb67,0x73));var _0x7db6=function(_0x63cf67,_0x1d6f39){_0x63cf67=_0x63cf67-0x0;var _0x38e135=_0xdb67[_0x63cf67];return _0x38e135;};'use strict';var _=require(_0x7db6('0x0'));var util=require(_0x7db6('0x1'));var logger=require('../../config/logger')(_0x7db6('0x2'));var moment=require('moment');var BPromise=require(_0x7db6('0x3'));var rp=require(_0x7db6('0x4'));var fs=require('fs');var path=require(_0x7db6('0x5'));var rimraf=require(_0x7db6('0x6'));var config=require(_0x7db6('0x7'));var attributes=require(_0x7db6('0x8'));module[_0x7db6('0x9')]=function(_0x13db9e,_0x128554){return _0x13db9e[_0x7db6('0xa')](_0x7db6('0xb'),attributes,{'tableName':_0x7db6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7db6('0xd'),'collate':_0x7db6('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index c6b24c6..70b2384 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 _0xd6bb=['message','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxApplication,\x20%s,\x20%s'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0xd6bb[_0x292f93];return _0x5a94b1;};'use strict';var _=require(_0xbd6b('0x0'));var util=require('util');var moment=require(_0xbd6b('0x1'));var BPromise=require(_0xbd6b('0x2'));var rs=require(_0xbd6b('0x3'));var fs=require('fs');var Redis=require(_0xbd6b('0x4'));var db=require(_0xbd6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd6b('0x6'))(_0xbd6b('0x7'));var config=require(_0xbd6b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbd6b('0x9')][_0xbd6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc309ad,_0x401153,_0x31cae6){return new BPromise(function(_0x315761,_0x146037){return client[_0xbd6b('0xb')](_0xc309ad,_0x31cae6)[_0xbd6b('0xc')](function(_0x276b6d){logger[_0xbd6b('0xd')]('FaxApplication,\x20%s,\x20%s',_0x401153,_0xbd6b('0xe'));logger[_0xbd6b('0xf')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x401153,_0xbd6b('0xe'),JSON[_0xbd6b('0x10')](_0x276b6d));if(_0x276b6d['error']){if(_0x276b6d[_0xbd6b('0x11')][_0xbd6b('0x12')]===0x1f4){logger[_0xbd6b('0x11')](_0xbd6b('0x13'),_0x401153,_0x276b6d[_0xbd6b('0x11')]['message']);return _0x146037(_0x276b6d[_0xbd6b('0x11')][_0xbd6b('0x14')]);}logger[_0xbd6b('0x11')](_0xbd6b('0x13'),_0x401153,_0x276b6d['error']['message']);return _0x315761(_0x276b6d[_0xbd6b('0x11')][_0xbd6b('0x14')]);}else{logger[_0xbd6b('0xd')](_0xbd6b('0x13'),_0x401153,_0xbd6b('0xe'));_0x315761(_0x276b6d[_0xbd6b('0x15')]['message']);}})[_0xbd6b('0x16')](function(_0x5f14e8){logger['error']('FaxApplication,\x20%s,\x20%s',_0x401153,_0x5f14e8);_0x146037(_0x5f14e8);});});}exports[_0xbd6b('0x17')]=function(_0x1c0cad){var _0x4293bc=this;return new Promise(function(_0x50d857,_0x2d6e07){return db[_0xbd6b('0x18')]['update'](_0x1c0cad[_0xbd6b('0x19')],{'raw':_0x1c0cad[_0xbd6b('0x1a')]?_0x1c0cad[_0xbd6b('0x1a')][_0xbd6b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c0cad[_0xbd6b('0x1a')]?_0x1c0cad['options'][_0xbd6b('0x1c')]||null:null,'attributes':_0x1c0cad[_0xbd6b('0x1a')]?_0x1c0cad[_0xbd6b('0x1a')][_0xbd6b('0x1d')]||null:null,'limit':_0x1c0cad[_0xbd6b('0x1a')]?_0x1c0cad[_0xbd6b('0x1a')]['limit']||null:null})[_0xbd6b('0xc')](function(_0x4f08b3){logger[_0xbd6b('0xd')](_0xbd6b('0x17'),_0x1c0cad);logger[_0xbd6b('0xf')]('UpdateFaxApplication',_0x1c0cad,JSON[_0xbd6b('0x10')](_0x4f08b3));_0x50d857(_0x4f08b3);})['catch'](function(_0x7f897a){logger[_0xbd6b('0x11')](_0xbd6b('0x17'),_0x7f897a[_0xbd6b('0x14')],_0x1c0cad);_0x2d6e07(_0x4293bc[_0xbd6b('0x11')](0x1f4,_0x7f897a[_0xbd6b('0x14')]));});});}; \ No newline at end of file +var _0x015d=['debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','update','options','where','attributes','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x261522,_0x1adc1f){var _0x98a25a=function(_0x1b0f9c){while(--_0x1b0f9c){_0x261522['push'](_0x261522['shift']());}};_0x98a25a(++_0x1adc1f);}(_0x015d,0xd2));var _0xd015=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x015d[_0x2ac71a];return _0x3ee904;};'use strict';var _=require(_0xd015('0x0'));var util=require(_0xd015('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd015('0x2'));var db=require(_0xd015('0x3'))['db'];var utils=require(_0xd015('0x4'));var logger=require(_0xd015('0x5'))(_0xd015('0x6'));var config=require(_0xd015('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd015('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bf4e5,_0x372066,_0x1b4ccf){return new BPromise(function(_0x36f494,_0x185df6){return client[_0xd015('0x9')](_0x1bf4e5,_0x1b4ccf)[_0xd015('0xa')](function(_0x5bf501){logger[_0xd015('0xb')](_0xd015('0xc'),_0x372066,_0xd015('0xd'));logger[_0xd015('0xe')](_0xd015('0xf'),_0x372066,_0xd015('0xd'),JSON[_0xd015('0x10')](_0x5bf501));if(_0x5bf501[_0xd015('0x11')]){if(_0x5bf501['error'][_0xd015('0x12')]===0x1f4){logger[_0xd015('0x11')]('FaxApplication,\x20%s,\x20%s',_0x372066,_0x5bf501[_0xd015('0x11')][_0xd015('0x13')]);return _0x185df6(_0x5bf501[_0xd015('0x11')]['message']);}logger[_0xd015('0x11')](_0xd015('0xc'),_0x372066,_0x5bf501[_0xd015('0x11')][_0xd015('0x13')]);return _0x36f494(_0x5bf501[_0xd015('0x11')][_0xd015('0x13')]);}else{logger[_0xd015('0xb')](_0xd015('0xc'),_0x372066,_0xd015('0xd'));_0x36f494(_0x5bf501[_0xd015('0x14')]['message']);}})['catch'](function(_0xdb2ce){logger['error'](_0xd015('0xc'),_0x372066,_0xdb2ce);_0x185df6(_0xdb2ce);});});}exports[_0xd015('0x15')]=function(_0x356dfe){var _0x4367e6=this;return new Promise(function(_0x1725c7,_0x2df0e1){return db[_0xd015('0x16')][_0xd015('0x17')](_0x356dfe['body'],{'raw':_0x356dfe[_0xd015('0x18')]?_0x356dfe['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x356dfe[_0xd015('0x18')]?_0x356dfe[_0xd015('0x18')][_0xd015('0x19')]||null:null,'attributes':_0x356dfe['options']?_0x356dfe['options'][_0xd015('0x1a')]||null:null,'limit':_0x356dfe[_0xd015('0x18')]?_0x356dfe[_0xd015('0x18')]['limit']||null:null})['then'](function(_0x4edd7a){logger[_0xd015('0xb')]('UpdateFaxApplication',_0x356dfe);logger[_0xd015('0xe')](_0xd015('0x15'),_0x356dfe,JSON[_0xd015('0x10')](_0x4edd7a));_0x1725c7(_0x4edd7a);})[_0xd015('0x1b')](function(_0x1f1ec6){logger['error'](_0xd015('0x15'),_0x1f1ec6[_0xd015('0x13')],_0x356dfe);_0x2df0e1(_0x4367e6[_0xd015('0x11')](0x1f4,_0x1f1ec6[_0xd015('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 0ca7629..8ad4cb6 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 _0x13f6=['delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','post','create','put','update'];(function(_0xf2c9d8,_0x484d2b){var _0x444964=function(_0x5d2a97){while(--_0x5d2a97){_0xf2c9d8['push'](_0xf2c9d8['shift']());}};_0x444964(++_0x484d2b);}(_0x13f6,0x124));var _0x613f=function(_0x5f5344,_0x3959a3){_0x5f5344=_0x5f5344-0x0;var _0x50a88d=_0x13f6[_0x5f5344];return _0x50a88d;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x613f('0xa')]('/',auth[_0x613f('0x8')](),controller[_0x613f('0xb')]);router[_0x613f('0xc')]('/:id',auth[_0x613f('0x8')](),controller[_0x613f('0xd')]);router[_0x613f('0xe')]('/:id',auth[_0x613f('0x8')](),controller[_0x613f('0xf')]);module[_0x613f('0x10')]=router; \ No newline at end of file +var _0xa571=['index','/:id','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated'];(function(_0x422525,_0x32fb15){var _0x5eeaca=function(_0x3516e3){while(--_0x3516e3){_0x422525['push'](_0x422525['shift']());}};_0x5eeaca(++_0x32fb15);}(_0xa571,0x107));var _0x1a57=function(_0x27a611,_0xe00621){_0x27a611=_0x27a611-0x0;var _0x39c5de=_0xa571[_0x27a611];return _0x39c5de;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./faxApplication.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0xb')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0xc')]);router['put'](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xf')]);module[_0x1a57('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index f4ebbc6..3e9509a 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 _0x9dc1=['out','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x30245b,_0x361b94){var _0x5348eb=function(_0x50d2f1){while(--_0x50d2f1){_0x30245b['push'](_0x30245b['shift']());}};_0x5348eb(++_0x361b94);}(_0x9dc1,0xc7));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x19dc('0x0')]={'closed':{'type':Sequelize[_0x19dc('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x19dc('0x2')]},'disposition':{'type':Sequelize[_0x19dc('0x3')]},'secondDisposition':{'type':Sequelize[_0x19dc('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x19dc('0x3')]},'read1stAt':{'type':Sequelize[_0x19dc('0x2')]},'fax':{'type':Sequelize[_0x19dc('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x19dc('0x4')]('in',_0x19dc('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x19dc('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xb7a1=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x52090d,_0x50b912){var _0x3233e4=function(_0x51a153){while(--_0x51a153){_0x52090d['push'](_0x52090d['shift']());}};_0x3233e4(++_0x50b912);}(_0xb7a1,0xe6));var _0x1b7a=function(_0x258d0f,_0x233084){_0x258d0f=_0x258d0f-0x0;var _0x44fc94=_0xb7a1[_0x258d0f];return _0x44fc94;};'use strict';var Sequelize=require(_0x1b7a('0x0'));module[_0x1b7a('0x1')]={'closed':{'type':Sequelize[_0x1b7a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1b7a('0x3')]},'disposition':{'type':Sequelize[_0x1b7a('0x4')]},'secondDisposition':{'type':Sequelize[_0x1b7a('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1b7a('0x4')]},'note':{'type':Sequelize[_0x1b7a('0x4')]},'read1stAt':{'type':Sequelize[_0x1b7a('0x3')]},'fax':{'type':Sequelize[_0x1b7a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x1b7a('0x5')]('in',_0x1b7a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1b7a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index d131599..72c0f2a 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 _0xe6af=['nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','compact','isEmpty','FaxAccountId','concat','createdAt','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','toString','sequelize','keyBy','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','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','show','params','FaxInteraction','include','merge','options','create','describe','FaxMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','setTags','omit','Tag','emit','faxInteractionTags:save','removeTags','download','unix','root','server','tmp','join','files','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','createReadStream','createWriteStream','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','Users','fullname','split','forEach','Tags','TagIds','catch','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0xcad01d,_0xef9abc){var _0x76a4a6=function(_0x15b2a4){while(--_0x15b2a4){_0xcad01d['push'](_0xcad01d['shift']());}};_0x76a4a6(++_0xef9abc);}(_0xe6af,0x91));var _0xfe6a=function(_0x4b6e92,_0x450ddb){_0x4b6e92=_0x4b6e92-0x0;var _0x265091=_0xe6af[_0x4b6e92];return _0x265091;};'use strict';var emlformat=require(_0xfe6a('0x0'));var rimraf=require(_0xfe6a('0x1'));var zipdir=require(_0xfe6a('0x2'));var jsonpatch=require(_0xfe6a('0x3'));var rp=require(_0xfe6a('0x4'));var moment=require(_0xfe6a('0x5'));var BPromise=require(_0xfe6a('0x6'));var Mustache=require(_0xfe6a('0x7'));var util=require(_0xfe6a('0x8'));var path=require(_0xfe6a('0x9'));var sox=require(_0xfe6a('0xa'));var csv=require(_0xfe6a('0xb'));var ejs=require(_0xfe6a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe6a('0xd'));var squel=require(_0xfe6a('0xe'));var crypto=require(_0xfe6a('0xf'));var jsforce=require(_0xfe6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xfe6a('0xb'));var querystring=require(_0xfe6a('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe6a('0x12'));var qs=require(_0xfe6a('0x13'));var as=require(_0xfe6a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe6a('0x15'))(_0xfe6a('0x16'));var utils=require(_0xfe6a('0x17'));var config=require(_0xfe6a('0x18'));var licenseUtil=require(_0xfe6a('0x19'));var db=require(_0xfe6a('0x1a'))['db'];config[_0xfe6a('0x1b')]=_['defaults'](config[_0xfe6a('0x1b')],{'host':_0xfe6a('0x1c'),'port':0x18eb});var socket=require(_0xfe6a('0x1d'))(new Redis(config[_0xfe6a('0x1b')]));require(_0xfe6a('0x1e'))[_0xfe6a('0x1f')](socket);function respondWithStatusCode(_0x387f61,_0x1bf154){_0x1bf154=_0x1bf154||0xcc;return function(_0x243078){if(_0x243078){return _0x387f61[_0xfe6a('0x20')](_0x1bf154);}return _0x387f61[_0xfe6a('0x21')](_0x1bf154)[_0xfe6a('0x22')]();};}function respondWithResult(_0x191a88,_0x262073){_0x262073=_0x262073||0xc8;return function(_0x2a19c5){if(_0x2a19c5){return _0x191a88['status'](_0x262073)['json'](_0x2a19c5);}};}function respondWithFilteredResult(_0x3de9c3,_0x1414cf){return function(_0xbd600){if(_0xbd600){var _0x4ca5fd=typeof _0x1414cf[_0xfe6a('0x23')]===_0xfe6a('0x24')&&typeof _0x1414cf[_0xfe6a('0x25')]==='undefined';var _0x450226=_0xbd600[_0xfe6a('0x26')];var _0x40a86c=_0x4ca5fd?0x0:_0x1414cf[_0xfe6a('0x23')];var _0x1950ec=_0x4ca5fd?_0xbd600['count']:_0x1414cf[_0xfe6a('0x23')]+_0x1414cf[_0xfe6a('0x25')];var _0x46e31e;if(_0x1950ec>=_0x450226){_0x1950ec=_0x450226;_0x46e31e=0xc8;}else{_0x46e31e=0xce;}_0x3de9c3['status'](_0x46e31e);return _0x3de9c3[_0xfe6a('0x27')](_0xfe6a('0x28'),_0x40a86c+'-'+_0x1950ec+'/'+_0x450226)[_0xfe6a('0x29')](_0xbd600);}return null;};}function patchUpdates(_0x23ee6a){return function(_0x46368a){try{jsonpatch[_0xfe6a('0x2a')](_0x46368a,_0x23ee6a,!![]);}catch(_0xd37a23){return BPromise[_0xfe6a('0x2b')](_0xd37a23);}return _0x46368a[_0xfe6a('0x2c')]();};}function saveUpdates(_0xd74388,_0x40d616){return function(_0x1ab758){if(_0x1ab758){return _0x1ab758[_0xfe6a('0x2d')](_0xd74388)[_0xfe6a('0x2e')](function(_0x5d1674){return _0x5d1674;});}return null;};}function removeEntity(_0x470d05,_0x419151){return function(_0x3771a5){if(_0x3771a5){return _0x3771a5[_0xfe6a('0x2f')]()['then'](function(){_0x470d05[_0xfe6a('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17f19d,_0x567a27){return function(_0x57feb4){if(!_0x57feb4){_0x17f19d[_0xfe6a('0x20')](0x194);}return _0x57feb4;};}function handleError(_0x1e8c6f,_0x466e82){_0x466e82=_0x466e82||0x1f4;return function(_0x366fba){logger[_0xfe6a('0x30')](_0x366fba[_0xfe6a('0x31')]);if(_0x366fba['name']){delete _0x366fba[_0xfe6a('0x32')];}_0x1e8c6f['status'](_0x466e82)[_0xfe6a('0x33')](_0x366fba);};}function getInteractionUsers(_0x37c975,_0x284888){return new BPromise(function(_0xfb770,_0x30bba8){try{if(_0x284888[_0x37c975['id']]){_0x37c975[_0xfe6a('0x34')]=_['map'](_0x284888[_0x37c975['id']],function(_0x12f57f){return{'id':_0x12f57f['id'],'fullname':_0x12f57f[_0xfe6a('0x35')]};});}}catch(_0x41ca83){_0x30bba8(_0x41ca83);}_0xfb770(_0x37c975);});}function getInteractionTags(_0x55961e,_0x253688){return new BPromise(function(_0x44da41,_0xd45530){try{if(_0x55961e['TagIds']){_0x55961e['Tags']=[];_0x55961e['TagIds'][_0xfe6a('0x36')](',')[_0xfe6a('0x37')](function(_0x4bfb6d){_0x55961e[_0xfe6a('0x38')]['push'](_0x253688[_0x4bfb6d]);});}delete _0x55961e[_0xfe6a('0x39')];}catch(_0x35646a){_0xd45530(_0x35646a);}_0x44da41(_0x55961e);});}function updateFaxInteraction(_0x5cbc0e,_0x2da91a,_0x4a6931){return new BPromise(function(_0x1e2de5,_0x5ec8e9){return getInteractionUsers(_0x5cbc0e,_0x4a6931)['then'](function(_0x12ba34){return getInteractionTags(_0x12ba34,_0x2da91a);})[_0xfe6a('0x2e')](function(_0x231b20){_0x1e2de5(_0x231b20);})[_0xfe6a('0x3a')](function(_0x1f44e0){_0x5ec8e9(_0x1f44e0);});});}exports['index']=function(_0x151fb6,_0x1c4af8){var _0x554a69={},_0x20bddb={},_0x10f969={'count':0x0,'rows':[]};var _0xffd293=_['map'](db['FaxInteraction'][_0xfe6a('0x3b')],function(_0x524f22){return{'name':_0x524f22[_0xfe6a('0x3c')],'type':_0x524f22[_0xfe6a('0x3d')][_0xfe6a('0x3e')]};});_0x20bddb['model']=_[_0xfe6a('0x3f')](_0xffd293,_0xfe6a('0x32'));_0x20bddb[_0xfe6a('0x40')]=_[_0xfe6a('0x41')](_0x151fb6[_0xfe6a('0x40')]);_0x20bddb[_0xfe6a('0x42')]=_[_0xfe6a('0x43')](_0x20bddb[_0xfe6a('0x44')],_0x20bddb[_0xfe6a('0x40')]);_0x554a69[_0xfe6a('0x45')]=_[_0xfe6a('0x43')](_0x20bddb['model'],qs[_0xfe6a('0x46')](_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x46')]));_0x554a69[_0xfe6a('0x45')]=_0x554a69[_0xfe6a('0x45')][_0xfe6a('0x47')]?_0x554a69[_0xfe6a('0x45')]:_0x20bddb['model'];if(!_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x48')](_0xfe6a('0x49'))){_0x554a69[_0xfe6a('0x25')]=qs[_0xfe6a('0x25')](_0x151fb6[_0xfe6a('0x40')]['limit']);_0x554a69[_0xfe6a('0x23')]=qs[_0xfe6a('0x23')](_0x151fb6[_0xfe6a('0x40')]['offset']);}_0x554a69[_0xfe6a('0x4a')]=qs[_0xfe6a('0x4b')](_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x4b')]);_0x554a69[_0xfe6a('0x4c')]=qs[_0xfe6a('0x42')](_[_0xfe6a('0x4d')](_0x151fb6[_0xfe6a('0x40')],_0x20bddb[_0xfe6a('0x42')]),_0xffd293);var _0xe8f221=[];var _0x1ab447=squel[_0xfe6a('0x4e')]()[_0xfe6a('0x4f')]('id')[_0xfe6a('0x4f')](_0xfe6a('0x32'))[_0xfe6a('0x4f')](_0xfe6a('0x50'))[_0xfe6a('0x51')](_0xfe6a('0x52'));var _0x597d24=squel['select']()[_0xfe6a('0x4f')](_0xfe6a('0x53'))[_0xfe6a('0x4f')](_0xfe6a('0x54'))['field']('ui.FaxInteractionId')[_0xfe6a('0x51')](_0xfe6a('0x55'),'ui')[_0xfe6a('0x56')](_0xfe6a('0x57'),'u','u.id\x20=\x20ui.UserId');var _0x55b524=squel[_0xfe6a('0x4e')]()['from'](_0xfe6a('0x58'),'i')[_0xfe6a('0x56')](_0xfe6a('0x59'),'c',_0xfe6a('0x5a'))[_0xfe6a('0x56')](_0xfe6a('0x57'),'o',_0xfe6a('0x5b'))[_0xfe6a('0x56')](_0xfe6a('0x5c'),'a',_0xfe6a('0x5d'))[_0xfe6a('0x56')](_0xfe6a('0x5e'),'me',_0xfe6a('0x5f'))[_0xfe6a('0x56')](_0xfe6a('0x60'),'it',_0xfe6a('0x61'))['left_join'](_0xfe6a('0x52'),'t',_0xfe6a('0x62'));var _0x171ee1=squel[_0xfe6a('0x63')]();var _0x55c115=[];var _0x4e1699=squel[_0xfe6a('0x63')]();var _0x4e9230;if(_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x64')]){_0x4e9230=as[_0xfe6a('0x65')](_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x64')]);var _0x477289=_0x4e9230['sqlOperator'];for(var _0x512721=0x0;_0x512721<_0x4e9230[_0xfe6a('0x66')]['length'];_0x512721++){var _0x60a86d=_0x4e9230[_0xfe6a('0x66')][_0x512721];var _0x344b1d='i';var _0x4297d4=_[_0xfe6a('0x67')](_0xffd293,[_0xfe6a('0x32'),_0x60a86d['field']]);if(!_0x4297d4){switch(_0x60a86d[_0xfe6a('0x4f')]){case'unreadMessages':if(_0x60a86d['value']==0x1){_0x55b524[_0xfe6a('0x68')]('`'+_0x60a86d[_0xfe6a('0x4f')]+_0xfe6a('0x69'));}else{_0x55b524[_0xfe6a('0x68')]('`'+_0x60a86d[_0xfe6a('0x4f')]+_0xfe6a('0x6a'));}break;case _0xfe6a('0x6b'):if(_0x60a86d[_0xfe6a('0x6c')]==='$substring'){if(_0x60a86d[_0xfe6a('0x6d')][_0xfe6a('0x36')]('\x20')[_0xfe6a('0x47')]>0x1){_0x171ee1[_0x477289](_0xfe6a('0x6e'),qs[_0xfe6a('0x6f')](_0x60a86d[_0xfe6a('0x6d')]),null);}else{var _0x8149cc='%'+_0x60a86d['value']+'%';_0x171ee1[_0x477289](_0xfe6a('0x70'),_0x8149cc,_0x8149cc,_0x8149cc);}}else{_0x4297d4=_[_0xfe6a('0x67')](_0xffd293,[_0xfe6a('0x32'),_0xfe6a('0x71')]);_0x60a86d[_0xfe6a('0x4f')]='ContactId';_0x3d4b89=as[_0xfe6a('0x72')](_0x344b1d,_0x4297d4[_0xfe6a('0x3d')],_0x60a86d);_0x171ee1[_0x477289](_0x3d4b89[_0xfe6a('0x73')],_0x3d4b89[_0xfe6a('0x6d')][_0xfe6a('0x74')],_0x3d4b89[_0xfe6a('0x6d')][_0xfe6a('0x22')]);}break;case'Tag':var _0x2a247d=_0x60a86d['value'][_0xfe6a('0x36')](',')[_0xfe6a('0x3f')](function(_0x52649a){return Number(_0x52649a);});_0x2a247d[_0xfe6a('0x37')](function(_0xbc12c5){_0x4e1699['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xbc12c5+',%');});_0x55c115=_[_0xfe6a('0x75')](_0x55c115,_0x2a247d);break;case _0xfe6a('0x76'):if(_0x60a86d['operator']==='$substring'){_0x171ee1[_0x477289](_0xfe6a('0x77'),'%'+_0x60a86d[_0xfe6a('0x6d')]+'%',null);}else{_0x4297d4=_[_0xfe6a('0x67')](_0xffd293,[_0xfe6a('0x32'),_0xfe6a('0x78')]);_0x60a86d[_0xfe6a('0x4f')]=_0xfe6a('0x78');_0x3d4b89=as[_0xfe6a('0x72')](_0x344b1d,_0x4297d4[_0xfe6a('0x3d')],_0x60a86d);_0x171ee1[_0x477289](_0x3d4b89[_0xfe6a('0x73')],_0x3d4b89[_0xfe6a('0x6d')]['start'],_0x3d4b89[_0xfe6a('0x6d')][_0xfe6a('0x22')]);}break;case _0xfe6a('0x79'):_0x3d4b89=as[_0xfe6a('0x72')]('me',null,_0x60a86d);_0x171ee1[_0x477289](_0x3d4b89[_0xfe6a('0x73')],_0x3d4b89[_0xfe6a('0x6d')][_0xfe6a('0x74')],_0x3d4b89[_0xfe6a('0x6d')]['end']);break;}}else{var _0x3d4b89=as[_0xfe6a('0x72')](_0x344b1d,_0x4297d4['type'],_0x60a86d);_0x171ee1[_0x477289](_0x3d4b89[_0xfe6a('0x73')],_0x3d4b89[_0xfe6a('0x6d')]['start'],_0x3d4b89['value'][_0xfe6a('0x22')]);}}}else{var _0x54e43e=_(_0x151fb6['query'])[_0xfe6a('0x41')]()['map'](function(_0x21e66e){return _['some'](_0xffd293,['name',_0x21e66e])?_0x21e66e:undefined;})[_0xfe6a('0x7a')]()['value']();if(!_[_0xfe6a('0x7b')](_0x54e43e)){_0x54e43e[_0xfe6a('0x37')](function(_0x1d92db){if(_0x1d92db===_0xfe6a('0x7c')){_0x55b524['where']('i.FaxAccountId\x20IN\x20?',[][_0xfe6a('0x7d')](_0x151fb6[_0xfe6a('0x40')][_0x1d92db]));}else if(_0x1d92db===_0xfe6a('0x7e')){var _0x181e25=JSON['parse'](_0x151fb6['query'][_0x1d92db])[_0xfe6a('0x7f')];var _0xfbe0e1=JSON['parse'](_0x151fb6[_0xfe6a('0x40')][_0x1d92db])['$lte'];_0x55b524[_0xfe6a('0x4c')](_0xfe6a('0x80'),_0x181e25,_0xfbe0e1);}else{if(_0x151fb6[_0xfe6a('0x40')][_0x1d92db]===_0xfe6a('0x81')){_0x55b524[_0xfe6a('0x4c')]('i.'+_0x1d92db+_0xfe6a('0x82'));}else{_0x55b524[_0xfe6a('0x4c')]('i.'+_0x1d92db+'\x20=\x20?',_0x151fb6['query'][_0x1d92db]);}}});}if(_0x151fb6[_0xfe6a('0x40')]['read']){if(_0x151fb6[_0xfe6a('0x40')]['read']==0x1){_0x55b524['having'](_0xfe6a('0x83'));}else{_0x55b524[_0xfe6a('0x68')]('`unreadMessages`\x20>\x200');}}if(_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x84')]){_0x55c115=_[_0xfe6a('0x85')](_0x151fb6[_0xfe6a('0x40')]['tag'])?_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x84')]:new Array(_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x84')]);_0x55c115[_0xfe6a('0x37')](function(_0x274202){_0x4e1699['or'](_0xfe6a('0x86'),'%,'+_0x274202+',%');});}if(_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x87')]){var _0x25a564=_0x151fb6['query'][_0xfe6a('0x87')]['replace']('\x5c','\x5c\x5c')[_0xfe6a('0x88')](/'/g,'\x27\x27');if(qs[_0xfe6a('0x89')](_0x25a564)){_0x171ee1['or'](_0xfe6a('0x8a'),_0x25a564+'%')['or'](_0xfe6a('0x8b'),_0x25a564+'%');}_0x171ee1['or'](_0xfe6a('0x8c'),_0x25a564+'%');}}_0x55b524[_0xfe6a('0x4c')](_0x171ee1);_0x55b524[_0xfe6a('0x8d')]('i.id');var _0x1102e8={'type':db[_0xfe6a('0x8e')]['QueryTypes'][_0xfe6a('0x8f')],'raw':!![]};var _0x4a99c3=_0x55b524[_0xfe6a('0x90')]();_0x4a99c3['field'](_0xfe6a('0x91'));_0x4a99c3[_0xfe6a('0x4f')](_0xfe6a('0x92'),_0xfe6a('0x93'));if(_0x554a69[_0xfe6a('0x4a')]){_0x554a69['order'][_0xfe6a('0x37')](function(_0x250bd4){var _0xf96212=_0x250bd4[0x0]==='contactName'?_0x250bd4[0x0]:'i.'+_0x250bd4[0x0];_0x55b524['order'](_0xf96212,_0x250bd4[0x1]===_0xfe6a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x55c115)){_0x55b524[_0xfe6a('0x68')](_0x4e1699);_0x4a99c3['where']('t.id\x20IN\x20?',_0x55c115);}BPromise[_0xfe6a('0x95')]()[_0xfe6a('0x2e')](function(){if(!_0x4e9230){if(_0x151fb6[_0xfe6a('0x40')]['FaxAccountId'])return;_0x4a99c3[_0xfe6a('0x4c')](_0xfe6a('0x96'));_0x55b524[_0xfe6a('0x4c')](_0xfe6a('0x96'));return;}if(_0x151fb6[_0xfe6a('0x97')][_0xfe6a('0x98')]!==_0xfe6a('0x99'))return;return _0x151fb6[_0xfe6a('0x97')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xfe6a('0x2e')](function(_0x5860d3){if(_[_0xfe6a('0x7b')](_0x5860d3)){_0x4a99c3[_0xfe6a('0x4c')](_0xfe6a('0x9a'));_0x55b524[_0xfe6a('0x4c')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x4a99c3[_0xfe6a('0x4c')](_0xfe6a('0x9b'),_[_0xfe6a('0x3f')](_0x5860d3,'id'));_0x55b524[_0xfe6a('0x4c')](_0xfe6a('0x9b'),_[_0xfe6a('0x3f')](_0x5860d3,'id'));}});})[_0xfe6a('0x2e')](function(){if(_0x151fb6[_0xfe6a('0x97')]['role']===_0xfe6a('0x99')&&!_0x4e9230&&!_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x7c')])return[];return db['sequelize']['query'](_0x4a99c3[_0xfe6a('0x9c')](),_0x1102e8);})[_0xfe6a('0x2e')](function(_0x3d838b){_0x10f969[_0xfe6a('0x26')]=_0x3d838b[_0xfe6a('0x47')];if(_0x10f969[_0xfe6a('0x26')]===0x0)return[];return db[_0xfe6a('0x9d')][_0xfe6a('0x40')](_0x1ab447[_0xfe6a('0x9c')](),_0x1102e8)['then'](function(_0x484e11){_0xe8f221=_[_0xfe6a('0x9e')](_0x484e11,'id');_0x1102e8=_['merge'](_0x1102e8,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x151fb6[_0xfe6a('0x40')][_0xfe6a('0x46')]){_0x554a69[_0xfe6a('0x45')][_0xfe6a('0x37')](function(_0x37f1b8){_0x55b524[_0xfe6a('0x4f')]('i.'+_0x37f1b8);});}else{_0x55b524[_0xfe6a('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfe6a('0x93'));_0x55b524[_0xfe6a('0x4f')]('a.key','Account.key');_0x55b524[_0xfe6a('0x4f')](_0xfe6a('0x9f'),'Account.mandatoryDisposition');_0x55b524['field'](_0xfe6a('0xa0'),'contactName');_0x55b524[_0xfe6a('0x4f')]('i.*');_0x55b524[_0xfe6a('0x4f')]('c.firstName',_0xfe6a('0xa1'));_0x55b524[_0xfe6a('0x4f')](_0xfe6a('0xa2'),_0xfe6a('0xa3'));_0x55b524[_0xfe6a('0x4f')](_0xfe6a('0xa4'),_0xfe6a('0xa5'));_0x55b524['field'](_0xfe6a('0xa6'),'Contact.phone');_0x55b524[_0xfe6a('0x4f')](_0xfe6a('0xa7'),_0xfe6a('0xa8'));_0x55b524[_0xfe6a('0x4f')](_0xfe6a('0xa9'),'Contact.fax');_0x55b524[_0xfe6a('0x4f')](_0xfe6a('0xaa'),'Owner.fullname');_0x55b524[_0xfe6a('0x4f')](_0xfe6a('0xab'),'Owner.internal');_0x55b524['field'](_0xfe6a('0xac'),'TagIds');}if(_0x554a69[_0xfe6a('0x25')])_0x55b524['limit'](_0x554a69[_0xfe6a('0x25')]);if(_0x554a69[_0xfe6a('0x23')])_0x55b524['offset'](_0x554a69[_0xfe6a('0x23')]);return db[_0xfe6a('0x9d')][_0xfe6a('0x40')](_0x55b524[_0xfe6a('0x9c')](),_0x1102e8);})['then'](function(_0x3b2d89){if(_0x3b2d89[_0xfe6a('0x47')]>0x0)_0x597d24[_0xfe6a('0x4c')](_0xfe6a('0xad'),_['map'](_0x3b2d89,'id'));return db[_0xfe6a('0x9d')]['query'](_0x597d24[_0xfe6a('0x9c')](),_0x1102e8)[_0xfe6a('0x2e')](function(_0x183afa){var _0x3109b0=_[_0xfe6a('0xae')](_0x183afa,'FaxInteractionId');var _0x1828cb=[];_0x3b2d89[_0xfe6a('0x37')](function(_0x521ef8){_0x1828cb[_0xfe6a('0xaf')](updateFaxInteraction(_0x521ef8,_0xe8f221,_0x3109b0));});return BPromise[_0xfe6a('0xb0')](_0x1828cb);});});})['then'](function(_0x9badb3){_0x10f969['rows']=_0x9badb3;return _0x10f969;})[_0xfe6a('0x2e')](respondWithFilteredResult(_0x1c4af8,_0x554a69))[_0xfe6a('0x3a')](handleError(_0x1c4af8,null));};exports[_0xfe6a('0xb1')]=function(_0x5b8683,_0x3f248e){var _0x462ce0={'raw':![],'where':{'id':_0x5b8683[_0xfe6a('0xb2')]['id']}},_0x3e2ed9={};_0x3e2ed9['model']=_[_0xfe6a('0x41')](db[_0xfe6a('0xb3')]['rawAttributes']);_0x3e2ed9[_0xfe6a('0x40')]=_['keys'](_0x5b8683[_0xfe6a('0x40')]);_0x3e2ed9[_0xfe6a('0x42')]=_['intersection'](_0x3e2ed9['model'],_0x3e2ed9[_0xfe6a('0x40')]);_0x462ce0[_0xfe6a('0x45')]=_[_0xfe6a('0x43')](_0x3e2ed9[_0xfe6a('0x44')],qs['fields'](_0x5b8683[_0xfe6a('0x40')]['fields']));_0x462ce0[_0xfe6a('0x45')]=_0x462ce0['attributes'][_0xfe6a('0x47')]?_0x462ce0[_0xfe6a('0x45')]:_0x3e2ed9[_0xfe6a('0x44')];if(_0x5b8683[_0xfe6a('0x40')]['includeAll']){_0x462ce0[_0xfe6a('0xb4')]=[{'all':!![]}];}_0x462ce0=_[_0xfe6a('0xb5')]({},_0x462ce0,_0x5b8683[_0xfe6a('0xb6')]);return db['FaxInteraction']['find'](_0x462ce0)[_0xfe6a('0x2e')](handleEntityNotFound(_0x3f248e,null))['then'](respondWithResult(_0x3f248e,null))['catch'](handleError(_0x3f248e,null));};exports[_0xfe6a('0xb7')]=function(_0x2f7371,_0x43f2da){return db[_0xfe6a('0xb3')][_0xfe6a('0xb7')](_0x2f7371['body'],{})['then'](respondWithResult(_0x43f2da,0xc9))[_0xfe6a('0x3a')](handleError(_0x43f2da,null));};exports[_0xfe6a('0x2d')]=function(_0x57a938,_0x35e779){if(_0x57a938[_0xfe6a('0x79')]['id']){delete _0x57a938[_0xfe6a('0x79')]['id'];}return db[_0xfe6a('0xb3')][_0xfe6a('0x67')]({'where':{'id':_0x57a938[_0xfe6a('0xb2')]['id']}})[_0xfe6a('0x2e')](handleEntityNotFound(_0x35e779,null))[_0xfe6a('0x2e')](saveUpdates(_0x57a938[_0xfe6a('0x79')],null))[_0xfe6a('0x2e')](respondWithResult(_0x35e779,null))[_0xfe6a('0x3a')](handleError(_0x35e779,null));};exports[_0xfe6a('0x2f')]=function(_0x308462,_0x1609c6){return db['FaxInteraction'][_0xfe6a('0x67')]({'where':{'id':_0x308462[_0xfe6a('0xb2')]['id']}})[_0xfe6a('0x2e')](handleEntityNotFound(_0x1609c6,null))[_0xfe6a('0x2e')](removeEntity(_0x1609c6,null))[_0xfe6a('0x3a')](handleError(_0x1609c6,null));};exports[_0xfe6a('0xb8')]=function(_0x5d2f4c,_0x2e167b){return db[_0xfe6a('0xb3')][_0xfe6a('0xb8')]()[_0xfe6a('0x2e')](respondWithResult(_0x2e167b,null))['catch'](handleError(_0x2e167b,null));};exports['addMessage']=function(_0x1ad56e,_0xc2afc7,_0xbc28e3){return db[_0xfe6a('0xb9')][_0xfe6a('0x67')]({'where':{'id':_0x1ad56e[_0xfe6a('0xb2')]['id']}})[_0xfe6a('0x2e')](handleEntityNotFound(_0xc2afc7,null))[_0xfe6a('0x2e')](function(_0x58271f){if(_0x58271f){return _0x58271f['addMessage'](_0x1ad56e[_0xfe6a('0x79')]['ids'],_['omit'](_0x1ad56e[_0xfe6a('0x79')],[_0xfe6a('0xba'),'id'])||{});}})['then'](respondWithResult(_0xc2afc7,null))[_0xfe6a('0x3a')](handleError(_0xc2afc7,null));};exports[_0xfe6a('0xbb')]=function(_0x45bda2,_0xb1a03e,_0x9d4f87){var _0x9035b0={'raw':![],'where':{}};var _0x38c8f9={};var _0x1d5d96={'count':0x0,'rows':[]};return db[_0xfe6a('0xb3')][_0xfe6a('0xbc')]({'where':{'id':_0x45bda2['params']['id']}})[_0xfe6a('0x2e')](handleEntityNotFound(_0xb1a03e,null))[_0xfe6a('0x2e')](function(_0x29000e){if(_0x29000e){_0x38c8f9['model']=_[_0xfe6a('0x41')](db['FaxMessage']['rawAttributes']);_0x38c8f9[_0xfe6a('0x40')]=_[_0xfe6a('0x41')](_0x45bda2['query']);_0x38c8f9[_0xfe6a('0x42')]=_[_0xfe6a('0x43')](_0x38c8f9[_0xfe6a('0x44')],_0x38c8f9[_0xfe6a('0x40')]);_0x9035b0[_0xfe6a('0x45')]=_[_0xfe6a('0x43')](_0x38c8f9[_0xfe6a('0x44')],qs[_0xfe6a('0x46')](_0x45bda2['query']['fields']));_0x9035b0[_0xfe6a('0x45')]=_0x9035b0[_0xfe6a('0x45')][_0xfe6a('0x47')]?_0x9035b0[_0xfe6a('0x45')]:_0x38c8f9['model'];if(!_0x45bda2[_0xfe6a('0x40')]['hasOwnProperty'](_0xfe6a('0x49'))){_0x9035b0[_0xfe6a('0x25')]=qs[_0xfe6a('0x25')](_0x45bda2[_0xfe6a('0x40')]['limit']);_0x9035b0[_0xfe6a('0x23')]=qs[_0xfe6a('0x23')](_0x45bda2[_0xfe6a('0x40')][_0xfe6a('0x23')]);}_0x9035b0[_0xfe6a('0x4a')]=qs[_0xfe6a('0x4b')](_0x45bda2['query'][_0xfe6a('0x4b')]);_0x9035b0[_0xfe6a('0x4c')]=qs[_0xfe6a('0x42')](_['pick'](_0x45bda2[_0xfe6a('0x40')],_0x38c8f9[_0xfe6a('0x42')]));_0x9035b0[_0xfe6a('0x4c')]['FaxInteractionId']=_0x29000e['id'];if(_0x45bda2[_0xfe6a('0x40')]['filter']){_0x9035b0[_0xfe6a('0x4c')]=_[_0xfe6a('0xb5')](_0x9035b0[_0xfe6a('0x4c')],{'$or':_[_0xfe6a('0x3f')](_0x9035b0[_0xfe6a('0x45')],function(_0x1a4734){var _0x29b34e={};_0x29b34e[_0x1a4734]={'$like':'%'+_0x45bda2[_0xfe6a('0x40')][_0xfe6a('0x87')]+'%'};return _0x29b34e;})});}if(_0x45bda2['query'][_0xfe6a('0x7f')]){var _0x2b27e5=_0x45bda2['query'][_0xfe6a('0x7f')]['split'](',');var _0x55f246={};_0x55f246[_0x2b27e5[0x0]]={'$gte':moment(_0x2b27e5[0x1])[_0xfe6a('0xbd')](_0xfe6a('0xbe'))};_0x9035b0[_0xfe6a('0x4c')]=_[_0xfe6a('0xb5')](_0x9035b0[_0xfe6a('0x4c')],_0x55f246);}_0x9035b0=_['merge']({},_0x9035b0,_0x45bda2['options']);return db[_0xfe6a('0xb9')][_0xfe6a('0x26')]({'where':_0x9035b0[_0xfe6a('0x4c')]})['then'](function(_0xf8c9f1){_0x1d5d96[_0xfe6a('0x26')]=_0xf8c9f1;if(_0x45bda2[_0xfe6a('0x40')][_0xfe6a('0xbf')]){_0x9035b0['include']=[{'all':!![]}];}return db[_0xfe6a('0xb9')][_0xfe6a('0xc0')](_0x9035b0);})[_0xfe6a('0x2e')](function(_0x50795c){_0x1d5d96[_0xfe6a('0xc1')]=_0x50795c;return _0x1d5d96;});}})[_0xfe6a('0x2e')](respondWithFilteredResult(_0xb1a03e,_0x9035b0))[_0xfe6a('0x3a')](handleError(_0xb1a03e,null));};exports[_0xfe6a('0xc2')]=function(_0x157c5a,_0x37d498,_0x2de635){return db[_0xfe6a('0xb3')][_0xfe6a('0x67')]({'where':{'id':_0x157c5a[_0xfe6a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x37d498,null))[_0xfe6a('0x2e')](function(_0x268d93){if(_0x268d93){return _0x268d93[_0xfe6a('0xc3')](_0x157c5a['body'][_0xfe6a('0xba')],_[_0xfe6a('0xc4')](_0x157c5a[_0xfe6a('0x79')],[_0xfe6a('0xba'),'id'])||{})['spread'](function(){return db[_0xfe6a('0xc5')]['findAll']({'attributes':['id',_0xfe6a('0x32'),_0xfe6a('0x50')],'where':{'id':_0x157c5a[_0xfe6a('0x79')]['ids']}});})[_0xfe6a('0x2e')](function(_0x30c508){socket[_0xfe6a('0xc6')](_0xfe6a('0xc7'),{'id':Number(_0x157c5a[_0xfe6a('0xb2')]['id']),'tags':_0x30c508||[]});return{'id':Number(_0x157c5a[_0xfe6a('0xb2')]['id']),'tags':_0x30c508||[]};});}})[_0xfe6a('0x2e')](respondWithResult(_0x37d498,null))['catch'](handleError(_0x37d498,null));};exports['removeTags']=function(_0x3209c9,_0x2457f0,_0xee49dd){return db[_0xfe6a('0xb3')][_0xfe6a('0x67')]({'where':{'id':_0x3209c9[_0xfe6a('0xb2')]['id']}})[_0xfe6a('0x2e')](handleEntityNotFound(_0x2457f0,null))[_0xfe6a('0x2e')](function(_0x5e6ccc){if(_0x5e6ccc){return _0x5e6ccc[_0xfe6a('0xc8')](_0x3209c9[_0xfe6a('0x40')][_0xfe6a('0xba')]);}})['then'](respondWithStatusCode(_0x2457f0,null))[_0xfe6a('0x3a')](handleError(_0x2457f0,null));};exports[_0xfe6a('0xc9')]=function(_0xd83255,_0x36b91b){var _0x4a35d7=moment()[_0xfe6a('0xca')]()['toString']();var _0x4eb2f5=path['join'](config[_0xfe6a('0xcb')],_0xfe6a('0xcc'),'files',_0xfe6a('0xcd'));var _0x40e6ec=path[_0xfe6a('0xce')](config[_0xfe6a('0xcb')],_0xfe6a('0xcc'),_0xfe6a('0xcf'),_0xfe6a('0xd0'));var _0xd95b4e=path[_0xfe6a('0xce')](_0x4eb2f5,_0x4a35d7);var _0x3830e1=util['format'](_0xfe6a('0xd1'),_0xd83255[_0xfe6a('0xb2')]['id'],_0x4a35d7);var _0x311865=path['join'](_0x4eb2f5,_0x3830e1);var _0x82b68b=[];_0x82b68b[_0xfe6a('0xaf')]({'model':db[_0xfe6a('0xd2')],'as':_0xfe6a('0xd2'),'raw':!![]});var _0x12880a=[{'model':db[_0xfe6a('0xb9')],'as':_0xfe6a('0xd3'),'attributes':['id',_0xfe6a('0x79'),'createdAt'],'include':_0x82b68b}];return db[_0xfe6a('0xb3')][_0xfe6a('0x67')]({'where':{'id':_0xd83255[_0xfe6a('0xb2')]['id']},'include':_0x12880a})[_0xfe6a('0x2e')](handleEntityNotFound(_0x36b91b,null))[_0xfe6a('0x2e')](function(_0x441bf5){if(_0x441bf5&&_0x441bf5[_0xfe6a('0xd3')]){var _0x1cdfc1=_0x441bf5['get']({'plain':!![]});fs[_0xfe6a('0xd4')](_0xd95b4e);for(var _0x1cf25f=0x0;_0x1cf25f<_0x1cdfc1[_0xfe6a('0xd3')][_0xfe6a('0x47')];_0x1cf25f++){var _0x416e95=_0x1cdfc1[_0xfe6a('0xd3')][_0x1cf25f]['Attachment'];if(_0x416e95){var _0x4e197c=path[_0xfe6a('0xce')](_0x40e6ec,_0x416e95[_0xfe6a('0xd5')]);if(fs['existsSync'](_0x4e197c)){fs[_0xfe6a('0xd6')](_0x4e197c)['pipe'](fs[_0xfe6a('0xd7')](path[_0xfe6a('0xce')](_0xd95b4e,_0x416e95[_0xfe6a('0xd5')])));}}}return BPromise[_0xfe6a('0x95')]()[_0xfe6a('0x2e')](function(){return new BPromise(function(_0xcff514,_0x40c9bc){zipdir(_0xd95b4e,{'saveTo':_0x311865},function(_0xc5ef47,_0xfbfa69){if(_0xc5ef47)return _0x40c9bc(_0xc5ef47);return _0xcff514(_0xfbfa69);});})[_0xfe6a('0x2e')](function(){return new BPromise(function(_0x21f53a,_0x41d4c4){rimraf(_0xd95b4e,function(_0x28657a){if(_0x28657a)_0x41d4c4(_0x28657a);return _0x21f53a();});});})[_0xfe6a('0x2e')](function(){return _0x36b91b[_0xfe6a('0xc9')](_0x311865,_0x3830e1,function(_0x3bdf68){if(_0x3bdf68){console[_0xfe6a('0xd8')]('err',_0x3bdf68);}else{fs[_0xfe6a('0xd9')](_0x311865);}});});});}else{return _0x36b91b[_0xfe6a('0x20')](0xc8);}})['catch'](handleError(_0x36b91b,null));}; \ No newline at end of file +var _0xe6ac=['map','fullname','TagIds','Tags','split','forEach','push','catch','FaxInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','$substring','value','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','UserId','buildExpression','keys','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','sequelize','merge','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','contactName','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','toString','groupBy','rows','show','includeAll','include','options','create','body','params','destroy','describe','addMessage','FaxMessage','ids','getMessages','findOne','FaxInteractionId','filter','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','resolve','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','then','end','stack','name','Users'];(function(_0x2b71e0,_0x313267){var _0x36ca99=function(_0x3bf6ee){while(--_0x3bf6ee){_0x2b71e0['push'](_0x2b71e0['shift']());}};_0x36ca99(++_0x313267);}(_0xe6ac,0xad));var _0xce6a=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0xe6ac[_0x4404ff];return _0x5e7b19;};'use strict';var emlformat=require(_0xce6a('0x0'));var rimraf=require(_0xce6a('0x1'));var zipdir=require(_0xce6a('0x2'));var jsonpatch=require(_0xce6a('0x3'));var rp=require(_0xce6a('0x4'));var moment=require(_0xce6a('0x5'));var BPromise=require(_0xce6a('0x6'));var Mustache=require(_0xce6a('0x7'));var util=require(_0xce6a('0x8'));var path=require(_0xce6a('0x9'));var sox=require('sox');var csv=require(_0xce6a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xce6a('0xb'));var squel=require(_0xce6a('0xc'));var crypto=require(_0xce6a('0xd'));var jsforce=require(_0xce6a('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xce6a('0xf'));var Papa=require('papaparse');var Redis=require(_0xce6a('0x10'));var authService=require(_0xce6a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xce6a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xce6a('0x13'));var config=require(_0xce6a('0x14'));var licenseUtil=require(_0xce6a('0x15'));var db=require(_0xce6a('0x16'))['db'];config[_0xce6a('0x17')]=_[_0xce6a('0x18')](config[_0xce6a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xce6a('0x19'))(new Redis(config[_0xce6a('0x17')]));require('./faxInteraction.socket')[_0xce6a('0x1a')](socket);function respondWithStatusCode(_0x3dc1da,_0x4ff403){_0x4ff403=_0x4ff403||0xcc;return function(_0xbbf06d){if(_0xbbf06d){return _0x3dc1da[_0xce6a('0x1b')](_0x4ff403);}return _0x3dc1da['status'](_0x4ff403)['end']();};}function respondWithResult(_0x45d368,_0x450609){_0x450609=_0x450609||0xc8;return function(_0x22cf85){if(_0x22cf85){return _0x45d368[_0xce6a('0x1c')](_0x450609)[_0xce6a('0x1d')](_0x22cf85);}};}function respondWithFilteredResult(_0x46d5ee,_0x44e583){return function(_0x591f74){if(_0x591f74){var _0x166d7f=typeof _0x44e583['offset']==='undefined'&&typeof _0x44e583[_0xce6a('0x1e')]===_0xce6a('0x1f');var _0x53ee1a=_0x591f74['count'];var _0x427ed5=_0x166d7f?0x0:_0x44e583[_0xce6a('0x20')];var _0x3f9a1e=_0x166d7f?_0x591f74[_0xce6a('0x21')]:_0x44e583['offset']+_0x44e583[_0xce6a('0x1e')];var _0x39813b;if(_0x3f9a1e>=_0x53ee1a){_0x3f9a1e=_0x53ee1a;_0x39813b=0xc8;}else{_0x39813b=0xce;}_0x46d5ee[_0xce6a('0x1c')](_0x39813b);return _0x46d5ee[_0xce6a('0x22')](_0xce6a('0x23'),_0x427ed5+'-'+_0x3f9a1e+'/'+_0x53ee1a)[_0xce6a('0x1d')](_0x591f74);}return null;};}function patchUpdates(_0x238f67){return function(_0xb98252){try{jsonpatch[_0xce6a('0x24')](_0xb98252,_0x238f67,!![]);}catch(_0x34e8bb){return BPromise['reject'](_0x34e8bb);}return _0xb98252[_0xce6a('0x25')]();};}function saveUpdates(_0x23cd82,_0xcfac82){return function(_0x163e7f){if(_0x163e7f){return _0x163e7f[_0xce6a('0x26')](_0x23cd82)[_0xce6a('0x27')](function(_0x488e4f){return _0x488e4f;});}return null;};}function removeEntity(_0x38e109,_0x3cc933){return function(_0x4705fd){if(_0x4705fd){return _0x4705fd['destroy']()[_0xce6a('0x27')](function(){_0x38e109[_0xce6a('0x1c')](0xcc)[_0xce6a('0x28')]();});}};}function handleEntityNotFound(_0x50b7ae,_0x53e66a){return function(_0x4792c7){if(!_0x4792c7){_0x50b7ae[_0xce6a('0x1b')](0x194);}return _0x4792c7;};}function handleError(_0x5970b3,_0x1b7a84){_0x1b7a84=_0x1b7a84||0x1f4;return function(_0x47c4ea){logger['error'](_0x47c4ea[_0xce6a('0x29')]);if(_0x47c4ea[_0xce6a('0x2a')]){delete _0x47c4ea[_0xce6a('0x2a')];}_0x5970b3[_0xce6a('0x1c')](_0x1b7a84)['send'](_0x47c4ea);};}function getInteractionUsers(_0x1ad956,_0x50e6ef){return new BPromise(function(_0x35ff7e,_0x4d24dd){try{if(_0x50e6ef[_0x1ad956['id']]){_0x1ad956[_0xce6a('0x2b')]=_[_0xce6a('0x2c')](_0x50e6ef[_0x1ad956['id']],function(_0x2a6f57){return{'id':_0x2a6f57['id'],'fullname':_0x2a6f57[_0xce6a('0x2d')]};});}}catch(_0x3fba32){_0x4d24dd(_0x3fba32);}_0x35ff7e(_0x1ad956);});}function getInteractionTags(_0x436e83,_0x36b436){return new BPromise(function(_0x3c5f8d,_0x21c8f1){try{if(_0x436e83[_0xce6a('0x2e')]){_0x436e83[_0xce6a('0x2f')]=[];_0x436e83[_0xce6a('0x2e')][_0xce6a('0x30')](',')[_0xce6a('0x31')](function(_0x274b58){_0x436e83['Tags'][_0xce6a('0x32')](_0x36b436[_0x274b58]);});}delete _0x436e83[_0xce6a('0x2e')];}catch(_0x2bf09f){_0x21c8f1(_0x2bf09f);}_0x3c5f8d(_0x436e83);});}function updateFaxInteraction(_0x348791,_0x3c09f1,_0x577efe){return new BPromise(function(_0x5819a8,_0x42f88e){return getInteractionUsers(_0x348791,_0x577efe)[_0xce6a('0x27')](function(_0x257a30){return getInteractionTags(_0x257a30,_0x3c09f1);})[_0xce6a('0x27')](function(_0x3d9d9c){_0x5819a8(_0x3d9d9c);})[_0xce6a('0x33')](function(_0x165811){_0x42f88e(_0x165811);});});}exports['index']=function(_0x5de566,_0xca1221){var _0x2548e3={},_0x5b44cb={},_0x2c4fb5={'count':0x0,'rows':[]};var _0x4ac409=_[_0xce6a('0x2c')](db[_0xce6a('0x34')][_0xce6a('0x35')],function(_0x2a31f5){return{'name':_0x2a31f5[_0xce6a('0x36')],'type':_0x2a31f5[_0xce6a('0x37')][_0xce6a('0x38')]};});_0x5b44cb[_0xce6a('0x39')]=_['map'](_0x4ac409,_0xce6a('0x2a'));_0x5b44cb['query']=_['keys'](_0x5de566[_0xce6a('0x3a')]);_0x5b44cb[_0xce6a('0x3b')]=_['intersection'](_0x5b44cb[_0xce6a('0x39')],_0x5b44cb[_0xce6a('0x3a')]);_0x2548e3['attributes']=_[_0xce6a('0x3c')](_0x5b44cb[_0xce6a('0x39')],qs[_0xce6a('0x3d')](_0x5de566[_0xce6a('0x3a')][_0xce6a('0x3d')]));_0x2548e3[_0xce6a('0x3e')]=_0x2548e3[_0xce6a('0x3e')][_0xce6a('0x3f')]?_0x2548e3[_0xce6a('0x3e')]:_0x5b44cb[_0xce6a('0x39')];if(!_0x5de566[_0xce6a('0x3a')][_0xce6a('0x40')](_0xce6a('0x41'))){_0x2548e3[_0xce6a('0x1e')]=qs[_0xce6a('0x1e')](_0x5de566['query']['limit']);_0x2548e3[_0xce6a('0x20')]=qs['offset'](_0x5de566[_0xce6a('0x3a')][_0xce6a('0x20')]);}_0x2548e3['order']=qs['sort'](_0x5de566['query'][_0xce6a('0x42')]);_0x2548e3[_0xce6a('0x43')]=qs['filters'](_[_0xce6a('0x44')](_0x5de566[_0xce6a('0x3a')],_0x5b44cb[_0xce6a('0x3b')]),_0x4ac409);var _0x31e996=[];var _0x5e92ee=squel[_0xce6a('0x45')]()[_0xce6a('0x46')]('id')[_0xce6a('0x46')]('name')['field'](_0xce6a('0x47'))[_0xce6a('0x48')](_0xce6a('0x49'));var _0x54fa55=squel[_0xce6a('0x45')]()[_0xce6a('0x46')]('u.id')[_0xce6a('0x46')](_0xce6a('0x4a'))['field'](_0xce6a('0x4b'))[_0xce6a('0x48')](_0xce6a('0x4c'),'ui')[_0xce6a('0x4d')](_0xce6a('0x4e'),'u',_0xce6a('0x4f'));var _0x45bbd9=squel[_0xce6a('0x45')]()[_0xce6a('0x48')](_0xce6a('0x50'),'i')[_0xce6a('0x4d')](_0xce6a('0x51'),'c',_0xce6a('0x52'))[_0xce6a('0x4d')](_0xce6a('0x4e'),'o',_0xce6a('0x53'))[_0xce6a('0x4d')](_0xce6a('0x54'),'a',_0xce6a('0x55'))[_0xce6a('0x4d')](_0xce6a('0x56'),'me',_0xce6a('0x57'))[_0xce6a('0x4d')](_0xce6a('0x58'),'it',_0xce6a('0x59'))[_0xce6a('0x4d')]('tools_tags','t',_0xce6a('0x5a'));var _0x36c463=squel[_0xce6a('0x5b')]();var _0x318fd1=[];var _0x5eec13=squel[_0xce6a('0x5b')]();var _0x1ab43a;if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x5c')]){_0x1ab43a=as[_0xce6a('0x5d')](_0x5de566[_0xce6a('0x3a')][_0xce6a('0x5c')]);var _0x5757a9=_0x1ab43a[_0xce6a('0x5e')];for(var _0x1bc244=0x0;_0x1bc244<_0x1ab43a[_0xce6a('0x5f')][_0xce6a('0x3f')];_0x1bc244++){var _0x112833=_0x1ab43a[_0xce6a('0x5f')][_0x1bc244];var _0x4f5179='i';var _0x450148=_[_0xce6a('0x60')](_0x4ac409,['name',_0x112833['field']]);if(!_0x450148){switch(_0x112833[_0xce6a('0x46')]){case _0xce6a('0x61'):if(_0x112833['value']==0x1){_0x45bbd9[_0xce6a('0x62')]('`'+_0x112833[_0xce6a('0x46')]+'`\x20=\x200');}else{_0x45bbd9[_0xce6a('0x62')]('`'+_0x112833['field']+_0xce6a('0x63'));}break;case _0xce6a('0x64'):if(_0x112833[_0xce6a('0x65')]===_0xce6a('0x66')){if(_0x112833[_0xce6a('0x67')][_0xce6a('0x30')]('\x20')[_0xce6a('0x3f')]>0x1){_0x36c463[_0x5757a9]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xce6a('0x68')](_0x112833[_0xce6a('0x67')]),null);}else{var _0x1cef6c='%'+_0x112833[_0xce6a('0x67')]+'%';_0x36c463[_0x5757a9](_0xce6a('0x69'),_0x1cef6c,_0x1cef6c,_0x1cef6c);}}else{_0x450148=_[_0xce6a('0x60')](_0x4ac409,[_0xce6a('0x2a'),_0xce6a('0x6a')]);_0x112833['field']=_0xce6a('0x6a');_0x3ecdad=as['buildExpression'](_0x4f5179,_0x450148[_0xce6a('0x37')],_0x112833);_0x36c463[_0x5757a9](_0x3ecdad[_0xce6a('0x6b')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x28')]);}break;case _0xce6a('0x6d'):var _0x320adc=_0x112833[_0xce6a('0x67')][_0xce6a('0x30')](',')['map'](function(_0x49e5ee){return Number(_0x49e5ee);});_0x320adc[_0xce6a('0x31')](function(_0x561fd1){_0x5eec13['or'](_0xce6a('0x6e'),'%,'+_0x561fd1+',%');});_0x318fd1=_['union'](_0x318fd1,_0x320adc);break;case _0xce6a('0x6f'):if(_0x112833[_0xce6a('0x65')]===_0xce6a('0x66')){_0x36c463[_0x5757a9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x112833['value']+'%',null);}else{_0x450148=_[_0xce6a('0x60')](_0x4ac409,[_0xce6a('0x2a'),_0xce6a('0x70')]);_0x112833[_0xce6a('0x46')]=_0xce6a('0x70');_0x3ecdad=as[_0xce6a('0x71')](_0x4f5179,_0x450148['type'],_0x112833);_0x36c463[_0x5757a9](_0x3ecdad['text'],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad[_0xce6a('0x67')]['end']);}break;case'body':_0x3ecdad=as[_0xce6a('0x71')]('me',null,_0x112833);_0x36c463[_0x5757a9](_0x3ecdad[_0xce6a('0x6b')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad['value']['end']);break;}}else{var _0x3ecdad=as[_0xce6a('0x71')](_0x4f5179,_0x450148[_0xce6a('0x37')],_0x112833);_0x36c463[_0x5757a9](_0x3ecdad[_0xce6a('0x6b')],_0x3ecdad[_0xce6a('0x67')][_0xce6a('0x6c')],_0x3ecdad['value'][_0xce6a('0x28')]);}}}else{var _0x93625a=_(_0x5de566[_0xce6a('0x3a')])[_0xce6a('0x72')]()[_0xce6a('0x2c')](function(_0x38b235){return _['some'](_0x4ac409,['name',_0x38b235])?_0x38b235:undefined;})[_0xce6a('0x73')]()[_0xce6a('0x67')]();if(!_[_0xce6a('0x74')](_0x93625a)){_0x93625a[_0xce6a('0x31')](function(_0x51a2c1){if(_0x51a2c1==='FaxAccountId'){_0x45bbd9['where'](_0xce6a('0x75'),[][_0xce6a('0x76')](_0x5de566['query'][_0x51a2c1]));}else if(_0x51a2c1===_0xce6a('0x77')){var _0x82466e=JSON[_0xce6a('0x78')](_0x5de566['query'][_0x51a2c1])[_0xce6a('0x79')];var _0x3a7e34=JSON[_0xce6a('0x78')](_0x5de566[_0xce6a('0x3a')][_0x51a2c1])[_0xce6a('0x7a')];_0x45bbd9[_0xce6a('0x43')](_0xce6a('0x7b'),_0x82466e,_0x3a7e34);}else{if(_0x5de566['query'][_0x51a2c1]===_0xce6a('0x7c')){_0x45bbd9[_0xce6a('0x43')]('i.'+_0x51a2c1+_0xce6a('0x7d'));}else{_0x45bbd9[_0xce6a('0x43')]('i.'+_0x51a2c1+_0xce6a('0x7e'),_0x5de566['query'][_0x51a2c1]);}}});}if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x7f')]){if(_0x5de566['query'][_0xce6a('0x7f')]==0x1){_0x45bbd9['having'](_0xce6a('0x80'));}else{_0x45bbd9[_0xce6a('0x62')](_0xce6a('0x81'));}}if(_0x5de566[_0xce6a('0x3a')]['tag']){_0x318fd1=_[_0xce6a('0x82')](_0x5de566['query']['tag'])?_0x5de566[_0xce6a('0x3a')][_0xce6a('0x83')]:new Array(_0x5de566['query'][_0xce6a('0x83')]);_0x318fd1[_0xce6a('0x31')](function(_0x1308c0){_0x5eec13['or'](_0xce6a('0x6e'),'%,'+_0x1308c0+',%');});}if(_0x5de566[_0xce6a('0x3a')]['filter']){var _0x27e8c6=_0x5de566[_0xce6a('0x3a')]['filter']['replace']('\x5c','\x5c\x5c')[_0xce6a('0x84')](/'/g,'\x27\x27');if(qs[_0xce6a('0x85')](_0x27e8c6)){_0x36c463['or'](_0xce6a('0x86'),_0x27e8c6+'%')['or'](_0xce6a('0x87'),_0x27e8c6+'%');}_0x36c463['or'](_0xce6a('0x88'),_0x27e8c6+'%');}}_0x45bbd9[_0xce6a('0x43')](_0x36c463);_0x45bbd9[_0xce6a('0x89')](_0xce6a('0x8a'));var _0x2958f7={'type':db['Sequelize'][_0xce6a('0x8b')][_0xce6a('0x8c')],'raw':!![]};var _0x524971=_0x45bbd9[_0xce6a('0x8d')]();_0x524971[_0xce6a('0x46')](_0xce6a('0x8a'));_0x524971[_0xce6a('0x46')](_0xce6a('0x8e'),_0xce6a('0x61'));if(_0x2548e3[_0xce6a('0x8f')]){_0x2548e3[_0xce6a('0x8f')][_0xce6a('0x31')](function(_0x2207c8){var _0x4bc354=_0x2207c8[0x0]==='contactName'?_0x2207c8[0x0]:'i.'+_0x2207c8[0x0];_0x45bbd9['order'](_0x4bc354,_0x2207c8[0x1]==='DESC'?![]:!![]);});}if(!_[_0xce6a('0x74')](_0x318fd1)){_0x45bbd9[_0xce6a('0x62')](_0x5eec13);_0x524971[_0xce6a('0x43')](_0xce6a('0x90'),_0x318fd1);}BPromise['resolve']()[_0xce6a('0x27')](function(){if(!_0x1ab43a){if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x91')])return;_0x524971['where'](_0xce6a('0x92'));_0x45bbd9[_0xce6a('0x43')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x5de566[_0xce6a('0x93')][_0xce6a('0x94')]!==_0xce6a('0x95'))return;return _0x5de566[_0xce6a('0x93')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xce6a('0x27')](function(_0x443dd4){if(_[_0xce6a('0x74')](_0x443dd4)){_0x524971[_0xce6a('0x43')]('i.FaxAccountId\x20IS\x20NULL');_0x45bbd9[_0xce6a('0x43')]('i.FaxAccountId\x20IS\x20NULL');}else{_0x524971[_0xce6a('0x43')](_0xce6a('0x75'),_['map'](_0x443dd4,'id'));_0x45bbd9[_0xce6a('0x43')](_0xce6a('0x75'),_[_0xce6a('0x2c')](_0x443dd4,'id'));}});})[_0xce6a('0x27')](function(){if(_0x5de566[_0xce6a('0x93')][_0xce6a('0x94')]===_0xce6a('0x95')&&!_0x1ab43a&&!_0x5de566[_0xce6a('0x3a')][_0xce6a('0x91')])return[];return db[_0xce6a('0x96')][_0xce6a('0x3a')](_0x524971['toString'](),_0x2958f7);})['then'](function(_0x1dc630){_0x2c4fb5['count']=_0x1dc630[_0xce6a('0x3f')];if(_0x2c4fb5[_0xce6a('0x21')]===0x0)return[];return db[_0xce6a('0x96')][_0xce6a('0x3a')](_0x5e92ee['toString'](),_0x2958f7)[_0xce6a('0x27')](function(_0x285a0c){_0x31e996=_['keyBy'](_0x285a0c,'id');_0x2958f7=_[_0xce6a('0x97')](_0x2958f7,{'model':db[_0xce6a('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5de566[_0xce6a('0x3a')][_0xce6a('0x3d')]){_0x2548e3[_0xce6a('0x3e')]['forEach'](function(_0x158e41){_0x45bbd9[_0xce6a('0x46')]('i.'+_0x158e41);});}else{_0x45bbd9[_0xce6a('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xce6a('0x61'));_0x45bbd9[_0xce6a('0x46')]('a.key',_0xce6a('0x98'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0x99'),'Account.mandatoryDisposition');_0x45bbd9['field'](_0xce6a('0x9a'),_0xce6a('0x9b'));_0x45bbd9[_0xce6a('0x46')]('i.*');_0x45bbd9['field'](_0xce6a('0x9c'),_0xce6a('0x9d'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0x9e'),'Contact.lastName');_0x45bbd9[_0xce6a('0x46')](_0xce6a('0x9f'),_0xce6a('0xa0'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0xa1'),_0xce6a('0xa2'));_0x45bbd9[_0xce6a('0x46')]('c.mobile','Contact.mobile');_0x45bbd9['field'](_0xce6a('0xa3'),_0xce6a('0xa4'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0xa5'),'Owner.fullname');_0x45bbd9[_0xce6a('0x46')]('o.internal',_0xce6a('0xa6'));_0x45bbd9[_0xce6a('0x46')](_0xce6a('0xa7'),_0xce6a('0x2e'));}if(_0x2548e3[_0xce6a('0x1e')])_0x45bbd9[_0xce6a('0x1e')](_0x2548e3[_0xce6a('0x1e')]);if(_0x2548e3[_0xce6a('0x20')])_0x45bbd9[_0xce6a('0x20')](_0x2548e3[_0xce6a('0x20')]);return db[_0xce6a('0x96')]['query'](_0x45bbd9['toString'](),_0x2958f7);})[_0xce6a('0x27')](function(_0x914b43){if(_0x914b43['length']>0x0)_0x54fa55[_0xce6a('0x43')](_0xce6a('0xa8'),_[_0xce6a('0x2c')](_0x914b43,'id'));return db[_0xce6a('0x96')][_0xce6a('0x3a')](_0x54fa55[_0xce6a('0xa9')](),_0x2958f7)[_0xce6a('0x27')](function(_0x284e8f){var _0xe5a3ff=_[_0xce6a('0xaa')](_0x284e8f,'FaxInteractionId');var _0x237025=[];_0x914b43[_0xce6a('0x31')](function(_0x19fdcc){_0x237025['push'](updateFaxInteraction(_0x19fdcc,_0x31e996,_0xe5a3ff));});return BPromise['all'](_0x237025);});});})[_0xce6a('0x27')](function(_0x45a8e6){_0x2c4fb5[_0xce6a('0xab')]=_0x45a8e6;return _0x2c4fb5;})['then'](respondWithFilteredResult(_0xca1221,_0x2548e3))['catch'](handleError(_0xca1221,null));};exports[_0xce6a('0xac')]=function(_0x19595c,_0x4a3bff){var _0x4fe3bf={'raw':![],'where':{'id':_0x19595c['params']['id']}},_0x4bd9b8={};_0x4bd9b8[_0xce6a('0x39')]=_[_0xce6a('0x72')](db[_0xce6a('0x34')][_0xce6a('0x35')]);_0x4bd9b8['query']=_['keys'](_0x19595c[_0xce6a('0x3a')]);_0x4bd9b8[_0xce6a('0x3b')]=_[_0xce6a('0x3c')](_0x4bd9b8[_0xce6a('0x39')],_0x4bd9b8[_0xce6a('0x3a')]);_0x4fe3bf[_0xce6a('0x3e')]=_[_0xce6a('0x3c')](_0x4bd9b8['model'],qs[_0xce6a('0x3d')](_0x19595c[_0xce6a('0x3a')][_0xce6a('0x3d')]));_0x4fe3bf['attributes']=_0x4fe3bf[_0xce6a('0x3e')]['length']?_0x4fe3bf['attributes']:_0x4bd9b8[_0xce6a('0x39')];if(_0x19595c[_0xce6a('0x3a')][_0xce6a('0xad')]){_0x4fe3bf[_0xce6a('0xae')]=[{'all':!![]}];}_0x4fe3bf=_[_0xce6a('0x97')]({},_0x4fe3bf,_0x19595c[_0xce6a('0xaf')]);return db[_0xce6a('0x34')]['find'](_0x4fe3bf)['then'](handleEntityNotFound(_0x4a3bff,null))[_0xce6a('0x27')](respondWithResult(_0x4a3bff,null))['catch'](handleError(_0x4a3bff,null));};exports[_0xce6a('0xb0')]=function(_0x460ce7,_0x32ce44){return db[_0xce6a('0x34')]['create'](_0x460ce7[_0xce6a('0xb1')],{})['then'](respondWithResult(_0x32ce44,0xc9))[_0xce6a('0x33')](handleError(_0x32ce44,null));};exports['update']=function(_0x51f6b5,_0x3a1caa){if(_0x51f6b5[_0xce6a('0xb1')]['id']){delete _0x51f6b5['body']['id'];}return db['FaxInteraction'][_0xce6a('0x60')]({'where':{'id':_0x51f6b5[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x3a1caa,null))[_0xce6a('0x27')](saveUpdates(_0x51f6b5[_0xce6a('0xb1')],null))[_0xce6a('0x27')](respondWithResult(_0x3a1caa,null))[_0xce6a('0x33')](handleError(_0x3a1caa,null));};exports[_0xce6a('0xb3')]=function(_0x227b04,_0x2bced9){return db[_0xce6a('0x34')][_0xce6a('0x60')]({'where':{'id':_0x227b04[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x2bced9,null))['then'](removeEntity(_0x2bced9,null))[_0xce6a('0x33')](handleError(_0x2bced9,null));};exports[_0xce6a('0xb4')]=function(_0x30cb46,_0x4dfe29){return db[_0xce6a('0x34')][_0xce6a('0xb4')]()[_0xce6a('0x27')](respondWithResult(_0x4dfe29,null))[_0xce6a('0x33')](handleError(_0x4dfe29,null));};exports[_0xce6a('0xb5')]=function(_0x50bbef,_0x4ea786,_0x4733fa){return db[_0xce6a('0xb6')]['find']({'where':{'id':_0x50bbef[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x4ea786,null))[_0xce6a('0x27')](function(_0x28df15){if(_0x28df15){return _0x28df15[_0xce6a('0xb5')](_0x50bbef[_0xce6a('0xb1')]['ids'],_['omit'](_0x50bbef[_0xce6a('0xb1')],[_0xce6a('0xb7'),'id'])||{});}})[_0xce6a('0x27')](respondWithResult(_0x4ea786,null))[_0xce6a('0x33')](handleError(_0x4ea786,null));};exports[_0xce6a('0xb8')]=function(_0x4684d3,_0x4d697c,_0x288521){var _0x15803f={'raw':![],'where':{}};var _0x1a6819={};var _0x472040={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xce6a('0xb9')]({'where':{'id':_0x4684d3[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x4d697c,null))[_0xce6a('0x27')](function(_0x12f168){if(_0x12f168){_0x1a6819[_0xce6a('0x39')]=_[_0xce6a('0x72')](db[_0xce6a('0xb6')][_0xce6a('0x35')]);_0x1a6819[_0xce6a('0x3a')]=_[_0xce6a('0x72')](_0x4684d3[_0xce6a('0x3a')]);_0x1a6819[_0xce6a('0x3b')]=_[_0xce6a('0x3c')](_0x1a6819[_0xce6a('0x39')],_0x1a6819[_0xce6a('0x3a')]);_0x15803f[_0xce6a('0x3e')]=_[_0xce6a('0x3c')](_0x1a6819[_0xce6a('0x39')],qs['fields'](_0x4684d3['query'][_0xce6a('0x3d')]));_0x15803f[_0xce6a('0x3e')]=_0x15803f[_0xce6a('0x3e')][_0xce6a('0x3f')]?_0x15803f[_0xce6a('0x3e')]:_0x1a6819[_0xce6a('0x39')];if(!_0x4684d3[_0xce6a('0x3a')]['hasOwnProperty'](_0xce6a('0x41'))){_0x15803f[_0xce6a('0x1e')]=qs['limit'](_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x1e')]);_0x15803f[_0xce6a('0x20')]=qs[_0xce6a('0x20')](_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x20')]);}_0x15803f[_0xce6a('0x8f')]=qs[_0xce6a('0x42')](_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x42')]);_0x15803f[_0xce6a('0x43')]=qs[_0xce6a('0x3b')](_[_0xce6a('0x44')](_0x4684d3[_0xce6a('0x3a')],_0x1a6819[_0xce6a('0x3b')]));_0x15803f['where'][_0xce6a('0xba')]=_0x12f168['id'];if(_0x4684d3['query']['filter']){_0x15803f['where']=_[_0xce6a('0x97')](_0x15803f[_0xce6a('0x43')],{'$or':_['map'](_0x15803f['attributes'],function(_0x3e7aee){var _0x37d7fc={};_0x37d7fc[_0x3e7aee]={'$like':'%'+_0x4684d3[_0xce6a('0x3a')][_0xce6a('0xbb')]+'%'};return _0x37d7fc;})});}if(_0x4684d3[_0xce6a('0x3a')][_0xce6a('0x79')]){var _0x16c50d=_0x4684d3[_0xce6a('0x3a')]['$gte'][_0xce6a('0x30')](',');var _0x1ac208={};_0x1ac208[_0x16c50d[0x0]]={'$gte':moment(_0x16c50d[0x1])['format'](_0xce6a('0xbc'))};_0x15803f['where']=_['merge'](_0x15803f[_0xce6a('0x43')],_0x1ac208);}_0x15803f=_[_0xce6a('0x97')]({},_0x15803f,_0x4684d3[_0xce6a('0xaf')]);return db[_0xce6a('0xb6')][_0xce6a('0x21')]({'where':_0x15803f[_0xce6a('0x43')]})[_0xce6a('0x27')](function(_0x4661e1){_0x472040[_0xce6a('0x21')]=_0x4661e1;if(_0x4684d3['query'][_0xce6a('0xad')]){_0x15803f[_0xce6a('0xae')]=[{'all':!![]}];}return db['FaxMessage'][_0xce6a('0xbd')](_0x15803f);})[_0xce6a('0x27')](function(_0x12c4dc){_0x472040['rows']=_0x12c4dc;return _0x472040;});}})[_0xce6a('0x27')](respondWithFilteredResult(_0x4d697c,_0x15803f))[_0xce6a('0x33')](handleError(_0x4d697c,null));};exports[_0xce6a('0xbe')]=function(_0xd7dca8,_0x53e24c,_0x500413){return db[_0xce6a('0x34')]['find']({'where':{'id':_0xd7dca8[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x53e24c,null))['then'](function(_0x1e1d39){if(_0x1e1d39){return _0x1e1d39[_0xce6a('0xbf')](_0xd7dca8[_0xce6a('0xb1')][_0xce6a('0xb7')],_[_0xce6a('0xc0')](_0xd7dca8['body'],[_0xce6a('0xb7'),'id'])||{})[_0xce6a('0xc1')](function(){return db[_0xce6a('0x6d')][_0xce6a('0xbd')]({'attributes':['id','name',_0xce6a('0x47')],'where':{'id':_0xd7dca8['body'][_0xce6a('0xb7')]}});})[_0xce6a('0x27')](function(_0x1b71f1){socket[_0xce6a('0xc2')](_0xce6a('0xc3'),{'id':Number(_0xd7dca8[_0xce6a('0xb2')]['id']),'tags':_0x1b71f1||[]});return{'id':Number(_0xd7dca8[_0xce6a('0xb2')]['id']),'tags':_0x1b71f1||[]};});}})[_0xce6a('0x27')](respondWithResult(_0x53e24c,null))['catch'](handleError(_0x53e24c,null));};exports[_0xce6a('0xc4')]=function(_0x350f07,_0x2cf687,_0x439ff3){return db['FaxInteraction']['find']({'where':{'id':_0x350f07[_0xce6a('0xb2')]['id']}})[_0xce6a('0x27')](handleEntityNotFound(_0x2cf687,null))[_0xce6a('0x27')](function(_0x5859c4){if(_0x5859c4){return _0x5859c4[_0xce6a('0xc4')](_0x350f07[_0xce6a('0x3a')][_0xce6a('0xb7')]);}})[_0xce6a('0x27')](respondWithStatusCode(_0x2cf687,null))[_0xce6a('0x33')](handleError(_0x2cf687,null));};exports['download']=function(_0x53f5d3,_0xe90131){var _0x4df1e3=moment()[_0xce6a('0xc5')]()[_0xce6a('0xa9')]();var _0x3b0ed9=path[_0xce6a('0xc6')](config[_0xce6a('0xc7')],_0xce6a('0xc8'),_0xce6a('0xc9'),_0xce6a('0xca'));var _0x102784=path[_0xce6a('0xc6')](config[_0xce6a('0xc7')],'server',_0xce6a('0xc9'),_0xce6a('0xcb'));var _0x53329c=path[_0xce6a('0xc6')](_0x3b0ed9,_0x4df1e3);var _0x1956bf=util[_0xce6a('0xcc')](_0xce6a('0xcd'),_0x53f5d3[_0xce6a('0xb2')]['id'],_0x4df1e3);var _0x55e694=path[_0xce6a('0xc6')](_0x3b0ed9,_0x1956bf);var _0x81290d=[];_0x81290d[_0xce6a('0x32')]({'model':db[_0xce6a('0xce')],'as':'Attachment','raw':!![]});var _0x453371=[{'model':db[_0xce6a('0xb6')],'as':_0xce6a('0xcf'),'attributes':['id',_0xce6a('0xb1'),_0xce6a('0x77')],'include':_0x81290d}];return db['FaxInteraction'][_0xce6a('0x60')]({'where':{'id':_0x53f5d3[_0xce6a('0xb2')]['id']},'include':_0x453371})[_0xce6a('0x27')](handleEntityNotFound(_0xe90131,null))[_0xce6a('0x27')](function(_0x435506){if(_0x435506&&_0x435506[_0xce6a('0xcf')]){var _0x3eb128=_0x435506[_0xce6a('0xd0')]({'plain':!![]});fs[_0xce6a('0xd1')](_0x53329c);for(var _0x377151=0x0;_0x377151<_0x3eb128['Messages'][_0xce6a('0x3f')];_0x377151++){var _0x320231=_0x3eb128['Messages'][_0x377151][_0xce6a('0xce')];if(_0x320231){var _0x5be33a=path[_0xce6a('0xc6')](_0x102784,_0x320231['basename']);if(fs[_0xce6a('0xd2')](_0x5be33a)){fs[_0xce6a('0xd3')](_0x5be33a)[_0xce6a('0xd4')](fs['createWriteStream'](path[_0xce6a('0xc6')](_0x53329c,_0x320231['basename'])));}}}return BPromise[_0xce6a('0xd5')]()[_0xce6a('0x27')](function(){return new BPromise(function(_0x3c50de,_0x11cfce){zipdir(_0x53329c,{'saveTo':_0x55e694},function(_0x474f5a,_0x3d3374){if(_0x474f5a)return _0x11cfce(_0x474f5a);return _0x3c50de(_0x3d3374);});})[_0xce6a('0x27')](function(){return new BPromise(function(_0x4858f7,_0x8aef52){rimraf(_0x53329c,function(_0x2375bd){if(_0x2375bd)_0x8aef52(_0x2375bd);return _0x4858f7();});});})[_0xce6a('0x27')](function(){return _0xe90131[_0xce6a('0xd6')](_0x55e694,_0x1956bf,function(_0x38384f){if(_0x38384f){console[_0xce6a('0xd7')](_0xce6a('0xd8'),_0x38384f);}else{fs['unlinkSync'](_0x55e694);}});});});}else{return _0xe90131['sendStatus'](0xc8);}})[_0xce6a('0x33')](handleError(_0xe90131,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 1650520..ad254a1 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 _0xdcb1=['../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','then','unreadMessages','length','emit','catch','hasOwnProperty','exports'];(function(_0x500a23,_0x47e157){var _0x27174a=function(_0x4b63b3){while(--_0x4b63b3){_0x500a23['push'](_0x500a23['shift']());}};_0x27174a(++_0x47e157);}(_0xdcb1,0x150));var _0x1dcb=function(_0x4680ed,_0x5a6f07){_0x4680ed=_0x4680ed-0x0;var _0xc6adf5=_0xdcb1[_0x4680ed];return _0xc6adf5;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x1dcb('0x0'))['db'][_0x1dcb('0x1')];var FaxMessage=require(_0x1dcb('0x0'))['db'][_0x1dcb('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1dcb('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1dcb('0x4'),'afterDestroy':_0x1dcb('0x5')};function emitEvent(_0x17d413){return function(_0x5d9fbf,_0x2d45da,_0xa21d61){_0x5d9fbf[_0x1dcb('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x34d549){_0x5d9fbf[_0x1dcb('0x7')](_0x1dcb('0x8'),_0x34d549['map'](function(_0x3358db){return{'id':_0x3358db['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x5d9fbf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1dcb('0x9')](function(_0x84315c){_0x5d9fbf['setDataValue'](_0x1dcb('0xa'),_0x84315c[_0x1dcb('0xb')]);FaxInteractionEvents[_0x1dcb('0xc')](_0x17d413+':'+_0x5d9fbf['id'],_0x5d9fbf);FaxInteractionEvents[_0x1dcb('0xc')](_0x17d413,_0x5d9fbf);_0xa21d61(null);})[_0x1dcb('0xd')](_0xa21d61(null));};}for(var e in events){if(events[_0x1dcb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1dcb('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x1046=['length','emit','hasOwnProperty','hook','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','findAll'];(function(_0x4ffa00,_0x5be360){var _0x231956=function(_0xe4f07a){while(--_0xe4f07a){_0x4ffa00['push'](_0x4ffa00['shift']());}};_0x231956(++_0x5be360);}(_0x1046,0xd4));var _0x6104=function(_0x3d2b6a,_0x5061d0){_0x3d2b6a=_0x3d2b6a-0x0;var _0x17d017=_0x1046[_0x3d2b6a];return _0x17d017;};'use strict';var EventEmitter=require(_0x6104('0x0'));var FaxInteraction=require(_0x6104('0x1'))['db'][_0x6104('0x2')];var FaxMessage=require(_0x6104('0x1'))['db'][_0x6104('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x6104('0x4')](0x0);var events={'afterCreate':_0x6104('0x5'),'afterUpdate':_0x6104('0x6'),'afterDestroy':_0x6104('0x7')};function emitEvent(_0x39c78b){return function(_0x3acce9,_0xd94be9,_0x2d85eb){_0x3acce9['getUsers']({'attributes':['id'],'raw':!![]})[_0x6104('0x8')](function(_0x41e6b7){_0x3acce9[_0x6104('0x9')](_0x6104('0xa'),_0x41e6b7['map'](function(_0x4a51de){return{'id':_0x4a51de['id']};}));return FaxMessage[_0x6104('0xb')]({'where':{'FaxInteractionId':_0x3acce9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x21a853){_0x3acce9[_0x6104('0x9')]('unreadMessages',_0x21a853[_0x6104('0xc')]);FaxInteractionEvents['emit'](_0x39c78b+':'+_0x3acce9['id'],_0x3acce9);FaxInteractionEvents[_0x6104('0xd')](_0x39c78b,_0x3acce9);_0x2d85eb(null);})['catch'](_0x2d85eb(null));};}for(var e in events){if(events[_0x6104('0xe')](e)){var event=events[e];FaxInteraction[_0x6104('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 9998751..cea0378 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 _0x55aa=['bluebird','request-promise','path','rimraf','./faxInteraction.attributes','fax_interactions','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment'];(function(_0x3318d6,_0x38865e){var _0x20a45a=function(_0x1cd0ec){while(--_0x1cd0ec){_0x3318d6['push'](_0x3318d6['shift']());}};_0x20a45a(++_0x38865e);}(_0x55aa,0x146));var _0xa55a=function(_0x2ef392,_0x4450d4){_0x2ef392=_0x2ef392-0x0;var _0x377c05=_0x55aa[_0x2ef392];return _0x377c05;};'use strict';var _=require('lodash');var util=require(_0xa55a('0x0'));var logger=require(_0xa55a('0x1'))(_0xa55a('0x2'));var moment=require(_0xa55a('0x3'));var BPromise=require(_0xa55a('0x4'));var rp=require(_0xa55a('0x5'));var fs=require('fs');var path=require(_0xa55a('0x6'));var rimraf=require(_0xa55a('0x7'));var config=require('../../config/environment');var attributes=require(_0xa55a('0x8'));module['exports']=function(_0x53cac0,_0x1142fc){return _0x53cac0['define']('FaxInteraction',attributes,{'tableName':_0xa55a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x27b11f,_0x34440d,_0x4487da){if(_0x27b11f['changed']('closed')){_0x27b11f['closedAt']=moment()['format'](_0xa55a('0xa'));}_0x4487da(null,_0x27b11f);}}});}; \ No newline at end of file +var _0x034d=['define','FaxInteraction','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports'];(function(_0x38ffd6,_0x54c358){var _0x131bdb=function(_0x36aac3){while(--_0x36aac3){_0x38ffd6['push'](_0x38ffd6['shift']());}};_0x131bdb(++_0x54c358);}(_0x034d,0x193));var _0xd034=function(_0x694103,_0x4801){_0x694103=_0x694103-0x0;var _0x1866c5=_0x034d[_0x694103];return _0x1866c5;};'use strict';var _=require(_0xd034('0x0'));var util=require(_0xd034('0x1'));var logger=require('../../config/logger')(_0xd034('0x2'));var moment=require(_0xd034('0x3'));var BPromise=require(_0xd034('0x4'));var rp=require(_0xd034('0x5'));var fs=require('fs');var path=require(_0xd034('0x6'));var rimraf=require(_0xd034('0x7'));var config=require(_0xd034('0x8'));var attributes=require(_0xd034('0x9'));module[_0xd034('0xa')]=function(_0x38ea51,_0x5ce09e){return _0x38ea51[_0xd034('0xb')](_0xd034('0xc'),attributes,{'tableName':_0xd034('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d82d9,_0x54221c,_0xee4c4e){if(_0x5d82d9[_0xd034('0xe')]('closed')){_0x5d82d9[_0xd034('0xf')]=moment()[_0xd034('0x10')](_0xd034('0x11'));}_0xee4c4e(null,_0x5d82d9);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 6096233..bdfc1a6 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 _0x8421=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','options','attributes','limit','then','stringify','find','where','addTags','body','ids','omit','spread','debug','AddTags','lodash','util','moment'];(function(_0x21dcb0,_0x5d5be0){var _0x544ccc=function(_0x4dd480){while(--_0x4dd480){_0x21dcb0['push'](_0x21dcb0['shift']());}};_0x544ccc(++_0x5d5be0);}(_0x8421,0x7e));var _0x1842=function(_0x2abbc7,_0x9d443){_0x2abbc7=_0x2abbc7-0x0;var _0x34ef5e=_0x8421[_0x2abbc7];return _0x34ef5e;};'use strict';var _=require(_0x1842('0x0'));var util=require(_0x1842('0x1'));var moment=require(_0x1842('0x2'));var BPromise=require(_0x1842('0x3'));var rs=require(_0x1842('0x4'));var fs=require('fs');var Redis=require(_0x1842('0x5'));var db=require(_0x1842('0x6'))['db'];var utils=require(_0x1842('0x7'));var logger=require(_0x1842('0x8'))(_0x1842('0x9'));var config=require(_0x1842('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1842('0xb')]({'port':0x232a});config[_0x1842('0xc')]=_[_0x1842('0xd')](config[_0x1842('0xc')],{'host':_0x1842('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1842('0xf'))[_0x1842('0x10')](socket);function respondWithRpcPromise(_0x45327b,_0x257c48,_0x22cc6c){return new BPromise(function(_0x289743,_0x3881f5){return client[_0x1842('0x11')](_0x45327b,_0x22cc6c)['then'](function(_0x43760a){logger[_0x1842('0x12')](_0x1842('0x13'),_0x257c48,_0x1842('0x14'));logger['debug'](_0x1842('0x15'),_0x257c48,_0x1842('0x14'),JSON['stringify'](_0x43760a));if(_0x43760a[_0x1842('0x16')]){if(_0x43760a[_0x1842('0x16')][_0x1842('0x17')]===0x1f4){logger[_0x1842('0x16')](_0x1842('0x13'),_0x257c48,_0x43760a[_0x1842('0x16')]['message']);return _0x3881f5(_0x43760a[_0x1842('0x16')][_0x1842('0x18')]);}logger[_0x1842('0x16')](_0x1842('0x13'),_0x257c48,_0x43760a[_0x1842('0x16')][_0x1842('0x18')]);return _0x289743(_0x43760a[_0x1842('0x16')]['message']);}else{logger[_0x1842('0x12')](_0x1842('0x13'),_0x257c48,_0x1842('0x14'));_0x289743(_0x43760a['result'][_0x1842('0x18')]);}})[_0x1842('0x19')](function(_0xb75860){logger['error'](_0x1842('0x13'),_0x257c48,_0xb75860);_0x3881f5(_0xb75860);});});}exports[_0x1842('0x1a')]=function(_0xe0a558){var _0xde298a=this;return new Promise(function(_0x20039d,_0xd138c8){return db[_0x1842('0x1b')][_0x1842('0x1c')](_0xe0a558['body'],{'raw':_0xe0a558['options']?_0xe0a558['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe0a558['options']?_0xe0a558[_0x1842('0x1d')]['where']||null:null,'attributes':_0xe0a558[_0x1842('0x1d')]?_0xe0a558[_0x1842('0x1d')][_0x1842('0x1e')]||null:null,'limit':_0xe0a558[_0x1842('0x1d')]?_0xe0a558[_0x1842('0x1d')][_0x1842('0x1f')]||null:null})[_0x1842('0x20')](function(_0x41e196){logger[_0x1842('0x12')](_0x1842('0x1a'),_0xe0a558);logger['debug'](_0x1842('0x1a'),_0xe0a558,JSON[_0x1842('0x21')](_0x41e196));_0x20039d(_0x41e196);})[_0x1842('0x19')](function(_0xd49be3){logger[_0x1842('0x16')](_0x1842('0x1a'),_0xd49be3[_0x1842('0x18')],_0xe0a558);_0xd138c8(_0xde298a[_0x1842('0x16')](0x1f4,_0xd49be3[_0x1842('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x2d9d4e){return new Promise(function(_0x47d894,_0x4a8b74){return db[_0x1842('0x1b')][_0x1842('0x22')]({'where':_0x2d9d4e['options']?_0x2d9d4e[_0x1842('0x1d')][_0x1842('0x23')]||null:null})['then'](function(_0x3feedb){if(_0x3feedb){return _0x3feedb[_0x1842('0x24')](_0x2d9d4e[_0x1842('0x25')][_0x1842('0x26')],_[_0x1842('0x27')](_0x2d9d4e['body'],[_0x1842('0x26'),'id'])||{});}})[_0x1842('0x28')](function(_0x73061c){logger[_0x1842('0x12')]('AddTags',_0x2d9d4e);logger[_0x1842('0x29')](_0x1842('0x2a'),_0x2d9d4e,JSON[_0x1842('0x21')](_0x73061c));_0x47d894(_0x73061c);})[_0x1842('0x19')](function(_0x104a2c){logger[_0x1842('0x16')](_0x1842('0x2a'),_0x104a2c[_0x1842('0x18')],_0x2d9d4e);_0x4a8b74(_this[_0x1842('0x16')](0x1f4,_0x104a2c[_0x1842('0x18')]));});});}; \ No newline at end of file +var _0xf1fe=['FaxInteraction','update','body','options','raw','where','limit','AddTagsToFaxInteraction','find','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','register','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateFaxInteraction'];(function(_0x6633d6,_0x19b0e0){var _0x2dcfe8=function(_0x293a0e){while(--_0x293a0e){_0x6633d6['push'](_0x6633d6['shift']());}};_0x2dcfe8(++_0x19b0e0);}(_0xf1fe,0xf6));var _0xef1f=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xf1fe[_0x8c1005];return _0x175354;};'use strict';var _=require(_0xef1f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xef1f('0x1'));var rs=require(_0xef1f('0x2'));var fs=require('fs');var Redis=require(_0xef1f('0x3'));var db=require(_0xef1f('0x4'))['db'];var utils=require(_0xef1f('0x5'));var logger=require('../../config/logger')(_0xef1f('0x6'));var config=require(_0xef1f('0x7'));var jayson=require(_0xef1f('0x8'));var client=jayson[_0xef1f('0x9')]['http']({'port':0x232a});config['redis']=_[_0xef1f('0xa')](config[_0xef1f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xef1f('0xc'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xef1f('0xd')](socket);function respondWithRpcPromise(_0xabb30d,_0x5ed75c,_0x50e6eb){return new BPromise(function(_0x18976f,_0x415a97){return client[_0xef1f('0xe')](_0xabb30d,_0x50e6eb)[_0xef1f('0xf')](function(_0xb528a2){logger['info'](_0xef1f('0x10'),_0x5ed75c,_0xef1f('0x11'));logger[_0xef1f('0x12')](_0xef1f('0x13'),_0x5ed75c,_0xef1f('0x11'),JSON[_0xef1f('0x14')](_0xb528a2));if(_0xb528a2[_0xef1f('0x15')]){if(_0xb528a2['error']['code']===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x5ed75c,_0xb528a2[_0xef1f('0x15')]['message']);return _0x415a97(_0xb528a2[_0xef1f('0x15')][_0xef1f('0x16')]);}logger[_0xef1f('0x15')](_0xef1f('0x10'),_0x5ed75c,_0xb528a2[_0xef1f('0x15')][_0xef1f('0x16')]);return _0x18976f(_0xb528a2[_0xef1f('0x15')][_0xef1f('0x16')]);}else{logger[_0xef1f('0x17')](_0xef1f('0x10'),_0x5ed75c,_0xef1f('0x11'));_0x18976f(_0xb528a2[_0xef1f('0x18')][_0xef1f('0x16')]);}})[_0xef1f('0x19')](function(_0x5d969a){logger[_0xef1f('0x15')](_0xef1f('0x10'),_0x5ed75c,_0x5d969a);_0x415a97(_0x5d969a);});});}exports[_0xef1f('0x1a')]=function(_0x34597b){var _0x2df76c=this;return new Promise(function(_0x54c2c6,_0x19f0d2){return db[_0xef1f('0x1b')][_0xef1f('0x1c')](_0x34597b[_0xef1f('0x1d')],{'raw':_0x34597b[_0xef1f('0x1e')]?_0x34597b[_0xef1f('0x1e')][_0xef1f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34597b['options']?_0x34597b[_0xef1f('0x1e')][_0xef1f('0x20')]||null:null,'attributes':_0x34597b[_0xef1f('0x1e')]?_0x34597b[_0xef1f('0x1e')]['attributes']||null:null,'limit':_0x34597b[_0xef1f('0x1e')]?_0x34597b[_0xef1f('0x1e')][_0xef1f('0x21')]||null:null})[_0xef1f('0xf')](function(_0x562f43){logger[_0xef1f('0x17')]('UpdateFaxInteraction',_0x34597b);logger[_0xef1f('0x12')](_0xef1f('0x1a'),_0x34597b,JSON[_0xef1f('0x14')](_0x562f43));_0x54c2c6(_0x562f43);})[_0xef1f('0x19')](function(_0x5a402c){logger[_0xef1f('0x15')](_0xef1f('0x1a'),_0x5a402c[_0xef1f('0x16')],_0x34597b);_0x19f0d2(_0x2df76c[_0xef1f('0x15')](0x1f4,_0x5a402c['message']));});});};exports[_0xef1f('0x22')]=function(_0x325767){return new Promise(function(_0x431cba,_0x30034f){return db[_0xef1f('0x1b')][_0xef1f('0x23')]({'where':_0x325767['options']?_0x325767[_0xef1f('0x1e')][_0xef1f('0x20')]||null:null})[_0xef1f('0xf')](function(_0x15372b){if(_0x15372b){return _0x15372b['addTags'](_0x325767[_0xef1f('0x1d')][_0xef1f('0x24')],_['omit'](_0x325767[_0xef1f('0x1d')],[_0xef1f('0x24'),'id'])||{});}})[_0xef1f('0x25')](function(_0xc7eb64){logger['info'](_0xef1f('0x26'),_0x325767);logger['debug']('AddTags',_0x325767,JSON[_0xef1f('0x14')](_0xc7eb64));_0x431cba(_0xc7eb64);})['catch'](function(_0x2e8b9f){logger[_0xef1f('0x15')](_0xef1f('0x26'),_0x2e8b9f['message'],_0x325767);_0x30034f(_this[_0xef1f('0x15')](0x1f4,_0x2e8b9f[_0xef1f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index fca4b71..8a38635 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 _0x7fb0=['register','length','./faxInteraction.events','save','remove','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7fb0,0x1b2));var _0x07fb=function(_0x24f1ba,_0x339097){_0x24f1ba=_0x24f1ba-0x0;var _0x5b48ac=_0x7fb0[_0x24f1ba];return _0x5b48ac;};'use strict';var FaxInteractionEvents=require(_0x07fb('0x0'));var events=[_0x07fb('0x1'),_0x07fb('0x2'),'update'];function createListener(_0x58a167,_0x123600){return function(_0x5c8824){_0x123600[_0x07fb('0x3')](_0x58a167,_0x5c8824);};}function removeListener(_0x534a8c,_0x56c0cd){return function(){FaxInteractionEvents['removeListener'](_0x534a8c,_0x56c0cd);};}exports[_0x07fb('0x4')]=function(_0x4bbbd8){for(var _0x5ee997=0x0,_0x3072de=events[_0x07fb('0x5')];_0x5ee997<_0x3072de;_0x5ee997++){var _0x356900=events[_0x5ee997];var _0x2657f8=createListener('faxInteraction:'+_0x356900,_0x4bbbd8);FaxInteractionEvents['on'](_0x356900,_0x2657f8);}}; \ No newline at end of file +var _0xafa9=['length','faxInteraction:','update','emit','removeListener','register'];(function(_0x1e2b9d,_0x425ca3){var _0x5ccc29=function(_0x59faea){while(--_0x59faea){_0x1e2b9d['push'](_0x1e2b9d['shift']());}};_0x5ccc29(++_0x425ca3);}(_0xafa9,0x17c));var _0x9afa=function(_0x2f50b6,_0xd09fe3){_0x2f50b6=_0x2f50b6-0x0;var _0x54b027=_0xafa9[_0x2f50b6];return _0x54b027;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove',_0x9afa('0x0')];function createListener(_0xd75cf8,_0x3a34a4){return function(_0x533013){_0x3a34a4[_0x9afa('0x1')](_0xd75cf8,_0x533013);};}function removeListener(_0x11c1e5,_0x3bcf34){return function(){FaxInteractionEvents[_0x9afa('0x2')](_0x11c1e5,_0x3bcf34);};}exports[_0x9afa('0x3')]=function(_0x2b5a12){for(var _0x148c53=0x0,_0x4d85fc=events[_0x9afa('0x4')];_0x148c53<_0x4d85fc;_0x148c53++){var _0x300306=events[_0x148c53];var _0x261c93=createListener(_0x9afa('0x5')+_0x300306,_0x2b5a12);FaxInteractionEvents['on'](_0x300306,_0x261c93);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 5dfce71..3ba2fa2 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 _0x9fe2=['index','describe','show','/:id/messages','getMessages','/:id/download','download','post','fax','faxinteraction:addtags','addTags','/:id','tracked','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','/:id/tags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated'];(function(_0xe38e0c,_0x5884ea){var _0x2c6987=function(_0x335bea){while(--_0x335bea){_0xe38e0c['push'](_0xe38e0c['shift']());}};_0x2c6987(++_0x5884ea);}(_0x9fe2,0x1a7));var _0x29fe=function(_0x5f438b,_0xf50a97){_0x5f438b=_0x5f438b-0x0;var _0x2fb15a=_0x9fe2[_0x5f438b];return _0x2fb15a;};'use strict';var multer=require(_0x29fe('0x0'));var util=require(_0x29fe('0x1'));var path=require(_0x29fe('0x2'));var timeout=require(_0x29fe('0x3'));var express=require(_0x29fe('0x4'));var router=express[_0x29fe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x29fe('0x6'));var interaction=require(_0x29fe('0x7'));var config=require('../../config/environment');var controller=require(_0x29fe('0x8'));router[_0x29fe('0x9')]('/',auth[_0x29fe('0xa')](),controller[_0x29fe('0xb')]);router['get']('/describe',auth[_0x29fe('0xa')](),controller[_0x29fe('0xc')]);router[_0x29fe('0x9')]('/:id',auth[_0x29fe('0xa')](),controller[_0x29fe('0xd')]);router['get'](_0x29fe('0xe'),auth[_0x29fe('0xa')](),controller[_0x29fe('0xf')]);router[_0x29fe('0x9')](_0x29fe('0x10'),auth[_0x29fe('0xa')](),controller[_0x29fe('0x11')]);router[_0x29fe('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x29fe('0x12')](_0x29fe('0xe'),auth[_0x29fe('0xa')](),controller['addMessage']);router[_0x29fe('0x12')]('/:id/tags',auth[_0x29fe('0xa')](),interaction['tracked'](_0x29fe('0x13'),_0x29fe('0x14')),controller[_0x29fe('0x15')]);router['put'](_0x29fe('0x16'),auth[_0x29fe('0xa')](),interaction[_0x29fe('0x17')]('fax',_0x29fe('0x18')),controller[_0x29fe('0x19')]);router['delete'](_0x29fe('0x16'),auth[_0x29fe('0xa')](),interaction[_0x29fe('0x17')]('fax',_0x29fe('0x1a')),controller[_0x29fe('0x1b')]);router[_0x29fe('0x1c')](_0x29fe('0x1d'),auth[_0x29fe('0xa')](),controller['removeTags']);module[_0x29fe('0x1e')]=router; \ No newline at end of file +var _0xb6c5=['exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','/:id/tags','removeTags'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xb6c5,0x1e1));var _0x5b6c=function(_0x79369d,_0xd6f3c){_0x79369d=_0x79369d-0x0;var _0x9da19f=_0xb6c5[_0x79369d];return _0x9da19f;};'use strict';var multer=require('multer');var util=require(_0x5b6c('0x0'));var path=require('path');var timeout=require(_0x5b6c('0x1'));var express=require('express');var router=express[_0x5b6c('0x2')]();var fs_extra=require(_0x5b6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5b6c('0x4'));var config=require(_0x5b6c('0x5'));var controller=require(_0x5b6c('0x6'));router['get']('/',auth[_0x5b6c('0x7')](),controller['index']);router[_0x5b6c('0x8')](_0x5b6c('0x9'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0xa')]);router['get'](_0x5b6c('0xb'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0xc')]);router[_0x5b6c('0x8')](_0x5b6c('0xd'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0xe')]);router[_0x5b6c('0x8')](_0x5b6c('0xf'),auth['isAuthenticated'](),controller[_0x5b6c('0x10')]);router[_0x5b6c('0x11')]('/',auth[_0x5b6c('0x7')](),controller[_0x5b6c('0x12')]);router[_0x5b6c('0x11')](_0x5b6c('0xd'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0x13')]);router[_0x5b6c('0x11')]('/:id/tags',auth[_0x5b6c('0x7')](),interaction[_0x5b6c('0x14')]('fax',_0x5b6c('0x15')),controller[_0x5b6c('0x16')]);router['put']('/:id',auth[_0x5b6c('0x7')](),interaction[_0x5b6c('0x14')](_0x5b6c('0x17'),_0x5b6c('0x18')),controller[_0x5b6c('0x19')]);router[_0x5b6c('0x1a')](_0x5b6c('0xb'),auth[_0x5b6c('0x7')](),interaction[_0x5b6c('0x14')](_0x5b6c('0x17'),_0x5b6c('0x1b')),controller[_0x5b6c('0x1c')]);router[_0x5b6c('0x1a')](_0x5b6c('0x1d'),auth[_0x5b6c('0x7')](),controller[_0x5b6c('0x1e')]);module[_0x5b6c('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 349724b..206eb7f 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 _0xcea5=['exports','TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x42d560,_0x2ae8b9){var _0x28c258=function(_0x4690ad){while(--_0x4690ad){_0x42d560['push'](_0x42d560['shift']());}};_0x28c258(++_0x2ae8b9);}(_0xcea5,0xed));var _0x5cea=function(_0x3f7a0d,_0x170e9d){_0x3f7a0d=_0x3f7a0d-0x0;var _0x12b1c5=_0xcea5[_0x3f7a0d];return _0x12b1c5;};'use strict';var Sequelize=require(_0x5cea('0x0'));module[_0x5cea('0x1')]={'body':{'type':Sequelize[_0x5cea('0x2')](_0x5cea('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5cea('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5cea('0x5')),'defaultValue':_0x5cea('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x5cea('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5cea('0x6')]}}; \ No newline at end of file +var _0x12c9=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x3fb122,_0xf2def0){var _0x1dbcbd=function(_0x2fe576){while(--_0x2fe576){_0x3fb122['push'](_0x3fb122['shift']());}};_0x1dbcbd(++_0xf2def0);}(_0x12c9,0x1c9));var _0x912c=function(_0x353e0c,_0x530a72){_0x353e0c=_0x353e0c-0x0;var _0x1ba0ed=_0x12c9[_0x353e0c];return _0x1ba0ed;};'use strict';var Sequelize=require(_0x912c('0x0'));module[_0x912c('0x1')]={'body':{'type':Sequelize[_0x912c('0x2')](_0x912c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x912c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x912c('0x5')),'defaultValue':_0x912c('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x912c('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x912c('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5fff415..50355c8 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 _0x5083=['../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','stack','name','send','index','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','FaxMessage','includeAll','include','findAll','rows','rawAttributes','find','update','body','params','destroy','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','EventManager','acceptmessage','reject','RejectMessage','rejectMessage','motionChannel','event','rejectmessage','create','CmContact','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x4cf726,_0x375b5b){var _0xe8280=function(_0x143384){while(--_0x143384){_0x4cf726['push'](_0x4cf726['shift']());}};_0xe8280(++_0x375b5b);}(_0x5083,0x111));var _0x3508=function(_0x4f4b98,_0x41b93c){_0x4f4b98=_0x4f4b98-0x0;var _0x1747b1=_0x5083[_0x4f4b98];return _0x1747b1;};'use strict';var emlformat=require(_0x3508('0x0'));var rimraf=require(_0x3508('0x1'));var zipdir=require(_0x3508('0x2'));var jsonpatch=require(_0x3508('0x3'));var rp=require(_0x3508('0x4'));var moment=require(_0x3508('0x5'));var BPromise=require(_0x3508('0x6'));var Mustache=require('mustache');var util=require(_0x3508('0x7'));var path=require(_0x3508('0x8'));var sox=require(_0x3508('0x9'));var csv=require(_0x3508('0xa'));var ejs=require(_0x3508('0xb'));var fs=require('fs');var fs_extra=require(_0x3508('0xc'));var _=require(_0x3508('0xd'));var squel=require('squel');var crypto=require(_0x3508('0xe'));var jsforce=require(_0x3508('0xf'));var deskjs=require(_0x3508('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3508('0x11'));var Papa=require('papaparse');var Redis=require(_0x3508('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3508('0x13'));var as=require(_0x3508('0x14'));var hardwareService=require(_0x3508('0x15'));var logger=require(_0x3508('0x16'))('api');var utils=require(_0x3508('0x17'));var config=require(_0x3508('0x18'));var licenseUtil=require(_0x3508('0x19'));var db=require(_0x3508('0x1a'))['db'];config[_0x3508('0x1b')]=_[_0x3508('0x1c')](config['redis'],{'host':_0x3508('0x1d'),'port':0x18eb});var socket=require(_0x3508('0x1e'))(new Redis(config[_0x3508('0x1b')]));require(_0x3508('0x1f'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x3508('0x20')][_0x3508('0x21')]({'port':0x232c});var client9002=jayson[_0x3508('0x20')][_0x3508('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x16f4fd,_0x501b6e,_0x43e2aa,_0xf3a0b6){return new BPromise(function(_0x24e7fe,_0x2851d5){var _0x493a73=_0xf3a0b6||client;return _0x493a73[_0x3508('0x22')](_0x16f4fd,_0x43e2aa)[_0x3508('0x23')](function(_0x511e1c){logger[_0x3508('0x24')](_0x3508('0x25'),_0x501b6e,_0x3508('0x26'));logger[_0x3508('0x27')](_0x3508('0x28'),_0x501b6e,_0x3508('0x26'),JSON[_0x3508('0x29')](_0x511e1c));if(_0x511e1c[_0x3508('0x2a')]){if(_0x511e1c[_0x3508('0x2a')][_0x3508('0x2b')]===0x1f4){logger[_0x3508('0x2a')](_0x3508('0x25'),_0x501b6e,_0x511e1c[_0x3508('0x2a')][_0x3508('0x2c')]);return _0x2851d5(_0x511e1c[_0x3508('0x2a')][_0x3508('0x2c')]);}logger[_0x3508('0x2a')]('FaxMessage,\x20%s,\x20%s',_0x501b6e,_0x511e1c[_0x3508('0x2a')][_0x3508('0x2c')]);return _0x24e7fe(_0x511e1c[_0x3508('0x2a')][_0x3508('0x2c')]);}else{logger[_0x3508('0x24')](_0x3508('0x25'),_0x501b6e,_0x3508('0x26'));_0x24e7fe(_0x511e1c[_0x3508('0x2d')][_0x3508('0x2c')]);}})[_0x3508('0x2e')](function(_0xfb6b0b){logger['error']('FaxMessage,\x20%s,\x20%s',_0x501b6e,_0xfb6b0b);_0x2851d5(_0xfb6b0b);});});}function respondWithStatusCode(_0x5c2e21,_0x21a04f){_0x21a04f=_0x21a04f||0xcc;return function(_0x4a519e){if(_0x4a519e){return _0x5c2e21[_0x3508('0x2f')](_0x21a04f);}return _0x5c2e21[_0x3508('0x30')](_0x21a04f)[_0x3508('0x31')]();};}function respondWithResult(_0x4c223a,_0x169ea1){_0x169ea1=_0x169ea1||0xc8;return function(_0xb41dc4){if(_0xb41dc4){return _0x4c223a[_0x3508('0x30')](_0x169ea1)[_0x3508('0x32')](_0xb41dc4);}};}function respondWithFilteredResult(_0x1485e6,_0xf6f065){return function(_0x44784a){if(_0x44784a){var _0x612b5=typeof _0xf6f065['offset']===_0x3508('0x33')&&typeof _0xf6f065[_0x3508('0x34')]===_0x3508('0x33');var _0x5cea73=_0x44784a[_0x3508('0x35')];var _0x39638c=_0x612b5?0x0:_0xf6f065[_0x3508('0x36')];var _0x18e385=_0x612b5?_0x44784a[_0x3508('0x35')]:_0xf6f065[_0x3508('0x36')]+_0xf6f065[_0x3508('0x34')];var _0x355318;if(_0x18e385>=_0x5cea73){_0x18e385=_0x5cea73;_0x355318=0xc8;}else{_0x355318=0xce;}_0x1485e6[_0x3508('0x30')](_0x355318);return _0x1485e6[_0x3508('0x37')](_0x3508('0x38'),_0x39638c+'-'+_0x18e385+'/'+_0x5cea73)[_0x3508('0x32')](_0x44784a);}return null;};}function patchUpdates(_0x79ffe3){return function(_0x5ce893){try{jsonpatch[_0x3508('0x39')](_0x5ce893,_0x79ffe3,!![]);}catch(_0x20d322){return BPromise['reject'](_0x20d322);}return _0x5ce893[_0x3508('0x3a')]();};}function saveUpdates(_0x9498b9,_0x456361){return function(_0x71a4b1){if(_0x71a4b1){return _0x71a4b1['update'](_0x9498b9)['then'](function(_0x5c0ae4){return _0x5c0ae4;});}return null;};}function removeEntity(_0x14c096,_0x2af395){return function(_0x53acab){if(_0x53acab){return _0x53acab['destroy']()['then'](function(){_0x14c096['status'](0xcc)[_0x3508('0x31')]();});}};}function handleEntityNotFound(_0x5e4d0d,_0x454b4d){return function(_0xf3b89f){if(!_0xf3b89f){_0x5e4d0d[_0x3508('0x2f')](0x194);}return _0xf3b89f;};}function handleError(_0x260cee,_0x29ecea){_0x29ecea=_0x29ecea||0x1f4;return function(_0x316672){logger[_0x3508('0x2a')](_0x316672[_0x3508('0x3b')]);if(_0x316672[_0x3508('0x3c')]){delete _0x316672['name'];}_0x260cee['status'](_0x29ecea)[_0x3508('0x3d')](_0x316672);};}exports[_0x3508('0x3e')]=function(_0x568024,_0x506fa9){var _0x376a2d={},_0x45a225={},_0x5da57d={'count':0x0,'rows':[]};var _0x34f210=_['map'](db['FaxMessage']['rawAttributes'],function(_0xc7af8e){return{'name':_0xc7af8e[_0x3508('0x3f')],'type':_0xc7af8e['type'][_0x3508('0x40')]};});_0x45a225[_0x3508('0x41')]=_[_0x3508('0x42')](_0x34f210,_0x3508('0x3c'));_0x45a225[_0x3508('0x43')]=_[_0x3508('0x44')](_0x568024['query']);_0x45a225[_0x3508('0x45')]=_[_0x3508('0x46')](_0x45a225['model'],_0x45a225[_0x3508('0x43')]);_0x376a2d['attributes']=_[_0x3508('0x46')](_0x45a225['model'],qs['fields'](_0x568024[_0x3508('0x43')][_0x3508('0x47')]));_0x376a2d[_0x3508('0x48')]=_0x376a2d['attributes'][_0x3508('0x49')]?_0x376a2d[_0x3508('0x48')]:_0x45a225[_0x3508('0x41')];if(!_0x568024['query'][_0x3508('0x4a')](_0x3508('0x4b'))){_0x376a2d['limit']=qs['limit'](_0x568024[_0x3508('0x43')][_0x3508('0x34')]);_0x376a2d[_0x3508('0x36')]=qs['offset'](_0x568024[_0x3508('0x43')][_0x3508('0x36')]);}_0x376a2d[_0x3508('0x4c')]=qs[_0x3508('0x4d')](_0x568024[_0x3508('0x43')]['sort']);_0x376a2d['where']=qs['filters'](_[_0x3508('0x4e')](_0x568024[_0x3508('0x43')],_0x45a225[_0x3508('0x45')]),_0x34f210);if(_0x568024[_0x3508('0x43')][_0x3508('0x4f')]){_0x376a2d['where']=_[_0x3508('0x50')](_0x376a2d[_0x3508('0x51')],{'$or':_[_0x3508('0x42')](_0x34f210,function(_0x173c7b){if(_0x173c7b[_0x3508('0x52')]!=='VIRTUAL'){var _0x3d1204={};_0x3d1204[_0x173c7b[_0x3508('0x3c')]]={'$like':'%'+_0x568024[_0x3508('0x43')][_0x3508('0x4f')]+'%'};return _0x3d1204;}})});}_0x376a2d=_[_0x3508('0x50')]({},_0x376a2d,_0x568024[_0x3508('0x53')]);var _0x51d9c2={'where':_0x376a2d[_0x3508('0x51')]};return db[_0x3508('0x54')][_0x3508('0x35')](_0x51d9c2)[_0x3508('0x23')](function(_0x32d1e0){_0x5da57d[_0x3508('0x35')]=_0x32d1e0;if(_0x568024['query'][_0x3508('0x55')]){_0x376a2d[_0x3508('0x56')]=[{'all':!![]}];}return db['FaxMessage'][_0x3508('0x57')](_0x376a2d);})[_0x3508('0x23')](function(_0x511bb7){_0x5da57d[_0x3508('0x58')]=_0x511bb7;return _0x5da57d;})[_0x3508('0x23')](respondWithFilteredResult(_0x506fa9,_0x376a2d))['catch'](handleError(_0x506fa9,null));};exports['show']=function(_0x629018,_0x15767c){var _0x27a996={'raw':!![],'where':{'id':_0x629018['params']['id']}},_0x13f614={};_0x13f614['model']=_['keys'](db['FaxMessage'][_0x3508('0x59')]);_0x13f614[_0x3508('0x43')]=_[_0x3508('0x44')](_0x629018[_0x3508('0x43')]);_0x13f614['filters']=_['intersection'](_0x13f614[_0x3508('0x41')],_0x13f614[_0x3508('0x43')]);_0x27a996[_0x3508('0x48')]=_[_0x3508('0x46')](_0x13f614[_0x3508('0x41')],qs['fields'](_0x629018['query'][_0x3508('0x47')]));_0x27a996[_0x3508('0x48')]=_0x27a996[_0x3508('0x48')][_0x3508('0x49')]?_0x27a996['attributes']:_0x13f614[_0x3508('0x41')];if(_0x629018[_0x3508('0x43')]['includeAll']){_0x27a996[_0x3508('0x56')]=[{'all':!![]}];}_0x27a996=_['merge']({},_0x27a996,_0x629018[_0x3508('0x53')]);return db[_0x3508('0x54')][_0x3508('0x5a')](_0x27a996)['then'](handleEntityNotFound(_0x15767c,null))[_0x3508('0x23')](respondWithResult(_0x15767c,null))[_0x3508('0x2e')](handleError(_0x15767c,null));};exports[_0x3508('0x5b')]=function(_0x1991ad,_0x1beb1d){if(_0x1991ad[_0x3508('0x5c')]['id']){delete _0x1991ad[_0x3508('0x5c')]['id'];}return db[_0x3508('0x54')][_0x3508('0x5a')]({'where':{'id':_0x1991ad[_0x3508('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1beb1d,null))['then'](saveUpdates(_0x1991ad['body'],null))['then'](respondWithResult(_0x1beb1d,null))['catch'](handleError(_0x1beb1d,null));};exports[_0x3508('0x5e')]=function(_0x5da5eb,_0x379af2){return db[_0x3508('0x54')]['find']({'where':{'id':_0x5da5eb[_0x3508('0x5d')]['id']}})[_0x3508('0x23')](handleEntityNotFound(_0x379af2,null))['then'](removeEntity(_0x379af2,null))['catch'](handleError(_0x379af2,null));};exports[_0x3508('0x5f')]=function(_0x427a15,_0x594fa2){return db[_0x3508('0x54')][_0x3508('0x5f')]()[_0x3508('0x23')](respondWithResult(_0x594fa2,null))['catch'](handleError(_0x594fa2,null));};var interaction_log=require(_0x3508('0x16'))(_0x3508('0x60'));exports[_0x3508('0x61')]=function(_0x49edd0,_0x4c9fdf,_0x3c981c){var _0x424f31={'agent':{},'channel':_0x3508('0x62')};if(_0x49edd0[_0x3508('0x5c')]['id']){delete _0x49edd0['body']['id'];}_0x49edd0['body'][_0x3508('0x63')]=!![];_0x49edd0[_0x3508('0x5c')]['readAt']=moment()[_0x3508('0x64')](_0x3508('0x65'));_0x49edd0['body'][_0x3508('0x66')]=_0x49edd0[_0x3508('0x5c')][_0x3508('0x66')]||_0x49edd0[_0x3508('0x67')]['id'];_0x424f31[_0x3508('0x68')]['id']=_0x49edd0[_0x3508('0x5c')][_0x3508('0x66')];return db[_0x3508('0x54')][_0x3508('0x5a')]({'where':{'id':_0x49edd0[_0x3508('0x5d')]['id'],'UserId':null}})[_0x3508('0x23')](handleEntityNotFound(_0x4c9fdf,null))[_0x3508('0x23')](saveUpdates(_0x49edd0[_0x3508('0x5c')],null))[_0x3508('0x23')](function(_0x36a18d){if(_0x36a18d){_0x424f31[_0x3508('0x2c')]=_0x36a18d[_0x3508('0x69')]({'plain':!![]});return db[_0x3508('0x6a')]['find']({'where':{'id':_0x36a18d[_0x3508('0x6b')]}});}return null;})[_0x3508('0x23')](handleEntityNotFound(_0x4c9fdf,null))[_0x3508('0x23')](function(_0x325f96){if(_0x325f96){return _0x325f96[_0x3508('0x5b')]({'UserId':_0x49edd0['body'][_0x3508('0x66')],'read1stAt':_[_0x3508('0x6c')](_0x325f96[_0x3508('0x6d')])?moment()[_0x3508('0x64')](_0x3508('0x65')):undefined});}return null;})['then'](function(_0x3fd6c1){if(_0x3fd6c1){_0x424f31[_0x3508('0x6e')]=_0x3fd6c1['get']({'plain':!![]});interaction_log['info'](_0x3508('0x6f'),_0x49edd0['user']['id'],_0x49edd0[_0x3508('0x67')][_0x3508('0x3c')],_0x49edd0[_0x3508('0x67')][_0x3508('0x70')],_0x424f31[_0x3508('0x6e')]['id'],_0x49edd0['body']?JSON[_0x3508('0x29')](_0x49edd0[_0x3508('0x5c')]):_0x3508('0x71'));return respondWithRpcPromise(_0x3508('0x72'),'acceptMessage',_0x424f31);}return null;})[_0x3508('0x23')](function(_0x5c5fde){var _0x6b94d5=_0x3508('0x73')+_0x5c5fde[_0x3508('0x2c')][_0x3508('0x74')];return db[_0x3508('0x75')][_0x3508('0x43')](_0x6b94d5,{'type':db[_0x3508('0x76')][_0x3508('0x77')][_0x3508('0x78')],'raw':!![]})['then'](function(_0x524083){return _0x524083;});})[_0x3508('0x23')](function(_0x4dcb74){if(_0x4dcb74){_0x424f31[_0x3508('0x2c')][_0x3508('0x79')]=_0x4dcb74[0x0];if(!_0x49edd0['body'][_0x3508('0x66')])return;return db[_0x3508('0x7a')][_0x3508('0x5a')]({'where':{'id':_0x49edd0[_0x3508('0x5c')][_0x3508('0x66')],'role':'agent'},'attributes':['id',_0x3508('0x3c'),_0x3508('0x7b'),'email',_0x3508('0x7c')],'raw':!![]});}return null;})['then'](function(_0x4bd67a){if(!_0x4bd67a)return null;_0x424f31['message'][_0x3508('0x68')]=_0x4bd67a;return _0x424f31;})['then'](function(_0x4cc4ed){if(_0x4cc4ed){if(_0x49edd0[_0x3508('0x5c')][_0x3508('0x7d')]){_0x424f31[_0x3508('0x2c')]['interface']=util[_0x3508('0x64')](_0x3508('0x7e'),_0x49edd0[_0x3508('0x67')][_0x3508('0x3c')]);_0x424f31[_0x3508('0x2c')][_0x3508('0x7f')]=_0x424f31[_0x3508('0x7f')];_0x424f31[_0x3508('0x2c')]['motionChannel']=_0x424f31[_0x3508('0x7f')];_0x424f31[_0x3508('0x2c')]['event']=_0x3508('0x61');return respondWithRpcPromise(_0x3508('0x80'),'EventManager',{'event':_0x3508('0x81'),'message':_0x424f31['message']},client9002)['then'](function(){return _0x424f31;});}return _0x424f31;}return null;})[_0x3508('0x23')](respondWithResult(_0x4c9fdf,null))['catch'](handleError(_0x4c9fdf,null));};var interaction_log=require(_0x3508('0x16'))('fax-interactions');exports[_0x3508('0x82')]=function(_0x5853ec,_0x45c45e,_0x317b91){var _0x21c854={'agent':{},'channel':_0x3508('0x62')};if(_0x5853ec[_0x3508('0x5c')]['id']){delete _0x5853ec[_0x3508('0x5c')]['id'];}_0x5853ec[_0x3508('0x5c')][_0x3508('0x66')]=_0x5853ec['body'][_0x3508('0x66')]||_0x5853ec[_0x3508('0x67')]['id'];_0x21c854[_0x3508('0x68')]['id']=_0x5853ec[_0x3508('0x5c')][_0x3508('0x66')];return db['FaxMessage'][_0x3508('0x5a')]({'where':{'id':_0x5853ec['params']['id'],'UserId':null}})[_0x3508('0x23')](handleEntityNotFound(_0x45c45e,null))['then'](function(_0xe5ef11){if(_0xe5ef11){_0x21c854['message']=_0xe5ef11[_0x3508('0x69')]({'plain':!![]});return db[_0x3508('0x6a')]['find']({'where':{'id':_0xe5ef11[_0x3508('0x6b')]}});}return null;})[_0x3508('0x23')](handleEntityNotFound(_0x45c45e,null))[_0x3508('0x23')](function(_0x24c41c){if(_0x24c41c){_0x21c854[_0x3508('0x6e')]=_0x24c41c[_0x3508('0x69')]({'plain':!![]});interaction_log[_0x3508('0x24')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5853ec[_0x3508('0x67')]['id'],_0x5853ec[_0x3508('0x67')]['name'],_0x5853ec['user'][_0x3508('0x70')],_0x21c854[_0x3508('0x6e')]['id'],_0x5853ec[_0x3508('0x5c')]?JSON['stringify'](_0x5853ec['body']):_0x3508('0x71'));return respondWithRpcPromise(_0x3508('0x83'),_0x3508('0x84'),_0x21c854);}return null;})[_0x3508('0x23')](function(_0x2b83b5){var _0x4dffc9=_0x3508('0x73')+_0x2b83b5[_0x3508('0x2c')][_0x3508('0x74')];return db[_0x3508('0x75')][_0x3508('0x43')](_0x4dffc9,{'type':db['Sequelize'][_0x3508('0x77')][_0x3508('0x78')],'raw':!![]})[_0x3508('0x23')](function(_0x21ffbd){return _0x21ffbd;});})[_0x3508('0x23')](function(_0x1f9507){if(_0x1f9507){_0x21c854['message']['contact']=_0x1f9507[0x0];if(!_0x5853ec['body'][_0x3508('0x66')])return;return db['User']['find']({'where':{'id':_0x5853ec[_0x3508('0x5c')][_0x3508('0x66')],'role':_0x3508('0x68')},'attributes':['id',_0x3508('0x3c'),'fullname','email',_0x3508('0x7c')],'raw':!![]});}return null;})[_0x3508('0x23')](function(_0x15bb9f){if(!_0x15bb9f)return null;_0x21c854[_0x3508('0x2c')]['agent']=_0x15bb9f;return _0x21c854;})[_0x3508('0x23')](function(_0x3b2bb9){if(_0x3b2bb9){_0x3b2bb9[_0x3508('0x2c')]['interface']=util[_0x3508('0x64')](_0x3508('0x7e'),_0x5853ec[_0x3508('0x67')][_0x3508('0x3c')]);_0x3b2bb9[_0x3508('0x2c')][_0x3508('0x7f')]=_0x21c854['channel'];_0x3b2bb9['message'][_0x3508('0x85')]=_0x21c854[_0x3508('0x7f')];_0x3b2bb9[_0x3508('0x2c')][_0x3508('0x86')]=_0x3508('0x82');respondWithRpcPromise(_0x3508('0x80'),'EventManager',{'event':_0x3508('0x87'),'message':_0x3b2bb9[_0x3508('0x2c')]},client9002);return _0x21c854;}return null;})['then'](respondWithResult(_0x45c45e,null))[_0x3508('0x2e')](handleError(_0x45c45e,null));};exports['create']=function(_0x8e21e8,_0x3bf2d6){var _0x5adbe9;return db[_0x3508('0x54')][_0x3508('0x88')](_0x8e21e8[_0x3508('0x5c')],{})[_0x3508('0x23')](function(_0x48ebfa){_0x5adbe9=_0x48ebfa;return db[_0x3508('0x89')]['findOne']({'where':{'id':_0x5adbe9['ContactId']}});})['then'](function(_0x3011ca){if(_[_0x3508('0x6c')](_0x3011ca)){return;}else{_0x5adbe9[_0x3508('0x62')]=_0x3011ca[_0x3508('0x62')];return db[_0x3508('0x8a')]['findOne']({'where':{'id':_0x5adbe9[_0x3508('0x8b')]}});}})[_0x3508('0x23')](function(_0x2b496e){return respondWithRpcPromise('SendFax',_0x3508('0x8c'),{'FaxAccountId':_['isNil'](_0x8e21e8[_0x3508('0x5c')])?undefined:_0x8e21e8[_0x3508('0x5c')][_0x3508('0x8d')],'path':_['isNil'](_0x2b496e)?undefined:util[_0x3508('0x64')](_0x3508('0x8e'),_0x2b496e[_0x3508('0x8f')]),'fax':_[_0x3508('0x6c')](_0x5adbe9[_0x3508('0x62')])?undefined:_0x5adbe9['fax'],'AttachmentId':_0x5adbe9[_0x3508('0x8b')]},client9002);})[_0x3508('0x23')](respondWithResult(_0x3bf2d6,0xc9))['catch'](handleError(_0x3bf2d6,null));};exports[_0x3508('0x90')]=function(_0x4b30ac,_0x68d43c){var _0x37e28c=path[_0x3508('0x91')](config[_0x3508('0x92')],_0x3508('0x93'),_0x3508('0x94'),'attachments');return db[_0x3508('0x54')][_0x3508('0x5a')]({'where':{'id':_0x4b30ac[_0x3508('0x5d')]['id']},'include':[{'model':db[_0x3508('0x8a')],'as':_0x3508('0x8a')}]})[_0x3508('0x23')](handleEntityNotFound(_0x68d43c,null))['then'](function(_0x3a6879){if(_0x3a6879){return _0x68d43c[_0x3508('0x90')](path[_0x3508('0x91')](_0x37e28c,_0x3a6879['Attachment'][_0x3508('0x8f')]));}})[_0x3508('0x2e')](handleError(_0x68d43c,null));}; \ No newline at end of file +var _0xc853=['includeAll','include','findAll','rows','params','length','options','find','body','describe','fax-interactions','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','FaxInteraction','read1stAt','interaction','info','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','accept','EventManager','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','ContactId','motionChannel','rejectmessage','create','CmContact','findOne','isNil','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','join','server','files','attachments','Attachment','download','basename','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','jayson/promise','client','http','request','then','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','send','index','map','FaxMessage','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3c2255,_0x3c8e01){var _0x19996c=function(_0x1b25a7){while(--_0x1b25a7){_0x3c2255['push'](_0x3c2255['shift']());}};_0x19996c(++_0x3c8e01);}(_0xc853,0xd1));var _0x3c85=function(_0x19024f,_0x5a4227){_0x19024f=_0x19024f-0x0;var _0x225877=_0xc853[_0x19024f];return _0x225877;};'use strict';var emlformat=require(_0x3c85('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3c85('0x1'));var rp=require(_0x3c85('0x2'));var moment=require('moment');var BPromise=require(_0x3c85('0x3'));var Mustache=require('mustache');var util=require(_0x3c85('0x4'));var path=require('path');var sox=require(_0x3c85('0x5'));var csv=require(_0x3c85('0x6'));var ejs=require(_0x3c85('0x7'));var fs=require('fs');var fs_extra=require(_0x3c85('0x8'));var _=require(_0x3c85('0x9'));var squel=require(_0x3c85('0xa'));var crypto=require(_0x3c85('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3c85('0xc'));var toCsv=require('to-csv');var querystring=require(_0x3c85('0xd'));var Papa=require('papaparse');var Redis=require(_0x3c85('0xe'));var authService=require(_0x3c85('0xf'));var qs=require(_0x3c85('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c85('0x11'))(_0x3c85('0x12'));var utils=require(_0x3c85('0x13'));var config=require(_0x3c85('0x14'));var licenseUtil=require(_0x3c85('0x15'));var db=require(_0x3c85('0x16'))['db'];config[_0x3c85('0x17')]=_[_0x3c85('0x18')](config[_0x3c85('0x17')],{'host':_0x3c85('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3c85('0x17')]));require(_0x3c85('0x1a'))['register'](socket);var jayson=require(_0x3c85('0x1b'));var client=jayson[_0x3c85('0x1c')][_0x3c85('0x1d')]({'port':0x232c});var client9002=jayson[_0x3c85('0x1c')][_0x3c85('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x413f52,_0x2afff3,_0x45c0aa,_0x3d5434){return new BPromise(function(_0x3bd1ed,_0x312ec9){var _0xf38995=_0x3d5434||client;return _0xf38995[_0x3c85('0x1e')](_0x413f52,_0x45c0aa)[_0x3c85('0x1f')](function(_0xe3b0c){logger['info'](_0x3c85('0x20'),_0x2afff3,'request\x20sent');logger[_0x3c85('0x21')](_0x3c85('0x22'),_0x2afff3,_0x3c85('0x23'),JSON[_0x3c85('0x24')](_0xe3b0c));if(_0xe3b0c[_0x3c85('0x25')]){if(_0xe3b0c[_0x3c85('0x25')][_0x3c85('0x26')]===0x1f4){logger[_0x3c85('0x25')](_0x3c85('0x20'),_0x2afff3,_0xe3b0c[_0x3c85('0x25')][_0x3c85('0x27')]);return _0x312ec9(_0xe3b0c['error'][_0x3c85('0x27')]);}logger[_0x3c85('0x25')](_0x3c85('0x20'),_0x2afff3,_0xe3b0c[_0x3c85('0x25')]['message']);return _0x3bd1ed(_0xe3b0c[_0x3c85('0x25')][_0x3c85('0x27')]);}else{logger['info'](_0x3c85('0x20'),_0x2afff3,_0x3c85('0x23'));_0x3bd1ed(_0xe3b0c[_0x3c85('0x28')]['message']);}})[_0x3c85('0x29')](function(_0x32501d){logger[_0x3c85('0x25')](_0x3c85('0x20'),_0x2afff3,_0x32501d);_0x312ec9(_0x32501d);});});}function respondWithStatusCode(_0x34951c,_0x270d97){_0x270d97=_0x270d97||0xcc;return function(_0x3b9fb3){if(_0x3b9fb3){return _0x34951c[_0x3c85('0x2a')](_0x270d97);}return _0x34951c[_0x3c85('0x2b')](_0x270d97)[_0x3c85('0x2c')]();};}function respondWithResult(_0x25f7d5,_0xadaede){_0xadaede=_0xadaede||0xc8;return function(_0x375afa){if(_0x375afa){return _0x25f7d5[_0x3c85('0x2b')](_0xadaede)[_0x3c85('0x2d')](_0x375afa);}};}function respondWithFilteredResult(_0x4a13dd,_0x59fd7a){return function(_0x2eb7de){if(_0x2eb7de){var _0x27a26a=typeof _0x59fd7a[_0x3c85('0x2e')]===_0x3c85('0x2f')&&typeof _0x59fd7a[_0x3c85('0x30')]===_0x3c85('0x2f');var _0x384f82=_0x2eb7de[_0x3c85('0x31')];var _0x566a85=_0x27a26a?0x0:_0x59fd7a['offset'];var _0x430bb0=_0x27a26a?_0x2eb7de[_0x3c85('0x31')]:_0x59fd7a[_0x3c85('0x2e')]+_0x59fd7a[_0x3c85('0x30')];var _0x2b9442;if(_0x430bb0>=_0x384f82){_0x430bb0=_0x384f82;_0x2b9442=0xc8;}else{_0x2b9442=0xce;}_0x4a13dd[_0x3c85('0x2b')](_0x2b9442);return _0x4a13dd[_0x3c85('0x32')]('Content-Range',_0x566a85+'-'+_0x430bb0+'/'+_0x384f82)[_0x3c85('0x2d')](_0x2eb7de);}return null;};}function patchUpdates(_0x42627a){return function(_0x1f26a5){try{jsonpatch[_0x3c85('0x33')](_0x1f26a5,_0x42627a,!![]);}catch(_0x2eb30b){return BPromise[_0x3c85('0x34')](_0x2eb30b);}return _0x1f26a5[_0x3c85('0x35')]();};}function saveUpdates(_0x4cf3fd,_0x2d4683){return function(_0x5ac7f4){if(_0x5ac7f4){return _0x5ac7f4[_0x3c85('0x36')](_0x4cf3fd)[_0x3c85('0x1f')](function(_0x472953){return _0x472953;});}return null;};}function removeEntity(_0x3821da,_0x16b546){return function(_0x38fe2e){if(_0x38fe2e){return _0x38fe2e[_0x3c85('0x37')]()[_0x3c85('0x1f')](function(){_0x3821da[_0x3c85('0x2b')](0xcc)[_0x3c85('0x2c')]();});}};}function handleEntityNotFound(_0x52fb44,_0xe4a37b){return function(_0x38025f){if(!_0x38025f){_0x52fb44['sendStatus'](0x194);}return _0x38025f;};}function handleError(_0x4777ec,_0x5cc617){_0x5cc617=_0x5cc617||0x1f4;return function(_0x2700c5){logger[_0x3c85('0x25')](_0x2700c5[_0x3c85('0x38')]);if(_0x2700c5[_0x3c85('0x39')]){delete _0x2700c5['name'];}_0x4777ec[_0x3c85('0x2b')](_0x5cc617)[_0x3c85('0x3a')](_0x2700c5);};}exports[_0x3c85('0x3b')]=function(_0x30af21,_0x30c00a){var _0x4c2776={},_0x4294c4={},_0x2d3320={'count':0x0,'rows':[]};var _0x1c02a6=_[_0x3c85('0x3c')](db[_0x3c85('0x3d')][_0x3c85('0x3e')],function(_0x3a403b){return{'name':_0x3a403b['fieldName'],'type':_0x3a403b[_0x3c85('0x3f')]['key']};});_0x4294c4[_0x3c85('0x40')]=_['map'](_0x1c02a6,_0x3c85('0x39'));_0x4294c4[_0x3c85('0x41')]=_[_0x3c85('0x42')](_0x30af21[_0x3c85('0x41')]);_0x4294c4[_0x3c85('0x43')]=_['intersection'](_0x4294c4[_0x3c85('0x40')],_0x4294c4[_0x3c85('0x41')]);_0x4c2776[_0x3c85('0x44')]=_[_0x3c85('0x45')](_0x4294c4['model'],qs['fields'](_0x30af21['query'][_0x3c85('0x46')]));_0x4c2776[_0x3c85('0x44')]=_0x4c2776[_0x3c85('0x44')]['length']?_0x4c2776[_0x3c85('0x44')]:_0x4294c4['model'];if(!_0x30af21[_0x3c85('0x41')][_0x3c85('0x47')](_0x3c85('0x48'))){_0x4c2776[_0x3c85('0x30')]=qs[_0x3c85('0x30')](_0x30af21[_0x3c85('0x41')][_0x3c85('0x30')]);_0x4c2776[_0x3c85('0x2e')]=qs[_0x3c85('0x2e')](_0x30af21[_0x3c85('0x41')][_0x3c85('0x2e')]);}_0x4c2776[_0x3c85('0x49')]=qs[_0x3c85('0x4a')](_0x30af21[_0x3c85('0x41')][_0x3c85('0x4a')]);_0x4c2776[_0x3c85('0x4b')]=qs['filters'](_[_0x3c85('0x4c')](_0x30af21[_0x3c85('0x41')],_0x4294c4['filters']),_0x1c02a6);if(_0x30af21[_0x3c85('0x41')][_0x3c85('0x4d')]){_0x4c2776[_0x3c85('0x4b')]=_[_0x3c85('0x4e')](_0x4c2776[_0x3c85('0x4b')],{'$or':_[_0x3c85('0x3c')](_0x1c02a6,function(_0x4bb197){if(_0x4bb197['type']!=='VIRTUAL'){var _0x43fa9a={};_0x43fa9a[_0x4bb197[_0x3c85('0x39')]]={'$like':'%'+_0x30af21[_0x3c85('0x41')][_0x3c85('0x4d')]+'%'};return _0x43fa9a;}})});}_0x4c2776=_[_0x3c85('0x4e')]({},_0x4c2776,_0x30af21['options']);var _0x37af3b={'where':_0x4c2776[_0x3c85('0x4b')]};return db['FaxMessage'][_0x3c85('0x31')](_0x37af3b)[_0x3c85('0x1f')](function(_0x49c5ee){_0x2d3320[_0x3c85('0x31')]=_0x49c5ee;if(_0x30af21['query'][_0x3c85('0x4f')]){_0x4c2776[_0x3c85('0x50')]=[{'all':!![]}];}return db[_0x3c85('0x3d')][_0x3c85('0x51')](_0x4c2776);})[_0x3c85('0x1f')](function(_0x559a73){_0x2d3320[_0x3c85('0x52')]=_0x559a73;return _0x2d3320;})[_0x3c85('0x1f')](respondWithFilteredResult(_0x30c00a,_0x4c2776))[_0x3c85('0x29')](handleError(_0x30c00a,null));};exports['show']=function(_0x42edc9,_0x1eb2d1){var _0x26d721={'raw':!![],'where':{'id':_0x42edc9[_0x3c85('0x53')]['id']}},_0x52e564={};_0x52e564[_0x3c85('0x40')]=_[_0x3c85('0x42')](db[_0x3c85('0x3d')]['rawAttributes']);_0x52e564['query']=_[_0x3c85('0x42')](_0x42edc9['query']);_0x52e564['filters']=_[_0x3c85('0x45')](_0x52e564[_0x3c85('0x40')],_0x52e564[_0x3c85('0x41')]);_0x26d721[_0x3c85('0x44')]=_['intersection'](_0x52e564['model'],qs[_0x3c85('0x46')](_0x42edc9['query'][_0x3c85('0x46')]));_0x26d721[_0x3c85('0x44')]=_0x26d721['attributes'][_0x3c85('0x54')]?_0x26d721[_0x3c85('0x44')]:_0x52e564[_0x3c85('0x40')];if(_0x42edc9['query'][_0x3c85('0x4f')]){_0x26d721[_0x3c85('0x50')]=[{'all':!![]}];}_0x26d721=_['merge']({},_0x26d721,_0x42edc9[_0x3c85('0x55')]);return db[_0x3c85('0x3d')][_0x3c85('0x56')](_0x26d721)[_0x3c85('0x1f')](handleEntityNotFound(_0x1eb2d1,null))[_0x3c85('0x1f')](respondWithResult(_0x1eb2d1,null))[_0x3c85('0x29')](handleError(_0x1eb2d1,null));};exports['update']=function(_0x452524,_0x3a0a7e){if(_0x452524[_0x3c85('0x57')]['id']){delete _0x452524['body']['id'];}return db['FaxMessage'][_0x3c85('0x56')]({'where':{'id':_0x452524['params']['id']}})[_0x3c85('0x1f')](handleEntityNotFound(_0x3a0a7e,null))['then'](saveUpdates(_0x452524[_0x3c85('0x57')],null))['then'](respondWithResult(_0x3a0a7e,null))[_0x3c85('0x29')](handleError(_0x3a0a7e,null));};exports['destroy']=function(_0x14bd2c,_0x501fdd){return db[_0x3c85('0x3d')][_0x3c85('0x56')]({'where':{'id':_0x14bd2c['params']['id']}})[_0x3c85('0x1f')](handleEntityNotFound(_0x501fdd,null))[_0x3c85('0x1f')](removeEntity(_0x501fdd,null))[_0x3c85('0x29')](handleError(_0x501fdd,null));};exports[_0x3c85('0x58')]=function(_0x2283bb,_0x64622e){return db['FaxMessage']['describe']()[_0x3c85('0x1f')](respondWithResult(_0x64622e,null))[_0x3c85('0x29')](handleError(_0x64622e,null));};var interaction_log=require('../../config/logger')(_0x3c85('0x59'));exports['accept']=function(_0x5e4956,_0x18d41e,_0x2cfef2){var _0x4a0125={'agent':{},'channel':_0x3c85('0x5a')};if(_0x5e4956[_0x3c85('0x57')]['id']){delete _0x5e4956[_0x3c85('0x57')]['id'];}_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5b')]=!![];_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5c')]=moment()[_0x3c85('0x5d')](_0x3c85('0x5e'));_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')]=_0x5e4956['body'][_0x3c85('0x5f')]||_0x5e4956[_0x3c85('0x60')]['id'];_0x4a0125['agent']['id']=_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')];return db[_0x3c85('0x3d')][_0x3c85('0x56')]({'where':{'id':_0x5e4956[_0x3c85('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x18d41e,null))[_0x3c85('0x1f')](saveUpdates(_0x5e4956['body'],null))['then'](function(_0x2819f5){if(_0x2819f5){_0x4a0125['message']=_0x2819f5[_0x3c85('0x61')]({'plain':!![]});return db[_0x3c85('0x62')][_0x3c85('0x56')]({'where':{'id':_0x2819f5['FaxInteractionId']}});}return null;})[_0x3c85('0x1f')](handleEntityNotFound(_0x18d41e,null))['then'](function(_0x5762fa){if(_0x5762fa){return _0x5762fa['update']({'UserId':_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')],'read1stAt':_['isNil'](_0x5762fa[_0x3c85('0x63')])?moment()[_0x3c85('0x5d')](_0x3c85('0x5e')):undefined});}return null;})[_0x3c85('0x1f')](function(_0x354719){if(_0x354719){_0x4a0125[_0x3c85('0x64')]=_0x354719['get']({'plain':!![]});interaction_log[_0x3c85('0x65')](_0x3c85('0x66'),_0x5e4956['user']['id'],_0x5e4956[_0x3c85('0x60')][_0x3c85('0x39')],_0x5e4956['user'][_0x3c85('0x67')],_0x4a0125['interaction']['id'],_0x5e4956[_0x3c85('0x57')]?JSON[_0x3c85('0x24')](_0x5e4956[_0x3c85('0x57')]):_0x3c85('0x68'));return respondWithRpcPromise(_0x3c85('0x69'),_0x3c85('0x6a'),_0x4a0125);}return null;})['then'](function(_0x1508a8){var _0x2f66d0=_0x3c85('0x6b')+_0x1508a8[_0x3c85('0x27')]['ContactId'];return db[_0x3c85('0x6c')][_0x3c85('0x41')](_0x2f66d0,{'type':db['Sequelize']['QueryTypes'][_0x3c85('0x6d')],'raw':!![]})[_0x3c85('0x1f')](function(_0x155c69){return _0x155c69;});})['then'](function(_0x56b8dc){if(_0x56b8dc){_0x4a0125['message'][_0x3c85('0x6e')]=_0x56b8dc[0x0];if(!_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')])return;return db[_0x3c85('0x6f')][_0x3c85('0x56')]({'where':{'id':_0x5e4956[_0x3c85('0x57')][_0x3c85('0x5f')],'role':_0x3c85('0x70')},'attributes':['id',_0x3c85('0x39'),_0x3c85('0x71'),_0x3c85('0x72'),_0x3c85('0x73')],'raw':!![]});}return null;})['then'](function(_0x1d074f){if(!_0x1d074f)return null;_0x4a0125[_0x3c85('0x27')][_0x3c85('0x70')]=_0x1d074f;return _0x4a0125;})[_0x3c85('0x1f')](function(_0x360389){if(_0x360389){if(_0x5e4956[_0x3c85('0x57')][_0x3c85('0x74')]){_0x4a0125[_0x3c85('0x27')][_0x3c85('0x75')]=util['format'](_0x3c85('0x76'),_0x5e4956[_0x3c85('0x60')][_0x3c85('0x39')]);_0x4a0125[_0x3c85('0x27')][_0x3c85('0x77')]=_0x4a0125[_0x3c85('0x77')];_0x4a0125[_0x3c85('0x27')]['motionChannel']=_0x4a0125[_0x3c85('0x77')];_0x4a0125[_0x3c85('0x27')][_0x3c85('0x78')]=_0x3c85('0x79');return respondWithRpcPromise(_0x3c85('0x7a'),_0x3c85('0x7a'),{'event':'acceptmessage','message':_0x4a0125[_0x3c85('0x27')]},client9002)['then'](function(){return _0x4a0125;});}return _0x4a0125;}return null;})[_0x3c85('0x1f')](respondWithResult(_0x18d41e,null))[_0x3c85('0x29')](handleError(_0x18d41e,null));};var interaction_log=require(_0x3c85('0x11'))(_0x3c85('0x59'));exports[_0x3c85('0x34')]=function(_0x5054d5,_0x50ca19,_0x232c70){var _0x3a6f17={'agent':{},'channel':'fax'};if(_0x5054d5[_0x3c85('0x57')]['id']){delete _0x5054d5[_0x3c85('0x57')]['id'];}_0x5054d5['body'][_0x3c85('0x5f')]=_0x5054d5[_0x3c85('0x57')]['UserId']||_0x5054d5[_0x3c85('0x60')]['id'];_0x3a6f17[_0x3c85('0x70')]['id']=_0x5054d5[_0x3c85('0x57')][_0x3c85('0x5f')];return db[_0x3c85('0x3d')][_0x3c85('0x56')]({'where':{'id':_0x5054d5[_0x3c85('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x50ca19,null))[_0x3c85('0x1f')](function(_0x54e365){if(_0x54e365){_0x3a6f17[_0x3c85('0x27')]=_0x54e365['get']({'plain':!![]});return db[_0x3c85('0x62')][_0x3c85('0x56')]({'where':{'id':_0x54e365[_0x3c85('0x7b')]}});}return null;})[_0x3c85('0x1f')](handleEntityNotFound(_0x50ca19,null))['then'](function(_0x3de4a1){if(_0x3de4a1){_0x3a6f17[_0x3c85('0x64')]=_0x3de4a1['get']({'plain':!![]});interaction_log[_0x3c85('0x65')](_0x3c85('0x7c'),_0x5054d5[_0x3c85('0x60')]['id'],_0x5054d5[_0x3c85('0x60')][_0x3c85('0x39')],_0x5054d5[_0x3c85('0x60')][_0x3c85('0x67')],_0x3a6f17[_0x3c85('0x64')]['id'],_0x5054d5[_0x3c85('0x57')]?JSON[_0x3c85('0x24')](_0x5054d5[_0x3c85('0x57')]):_0x3c85('0x68'));return respondWithRpcPromise('RejectMessage',_0x3c85('0x7d'),_0x3a6f17);}return null;})['then'](function(_0x378fe0){var _0x401d17=_0x3c85('0x6b')+_0x378fe0['message'][_0x3c85('0x7e')];return db['sequelize'][_0x3c85('0x41')](_0x401d17,{'type':db['Sequelize']['QueryTypes'][_0x3c85('0x6d')],'raw':!![]})[_0x3c85('0x1f')](function(_0x18f2fb){return _0x18f2fb;});})['then'](function(_0x284b2a){if(_0x284b2a){_0x3a6f17[_0x3c85('0x27')][_0x3c85('0x6e')]=_0x284b2a[0x0];if(!_0x5054d5[_0x3c85('0x57')][_0x3c85('0x5f')])return;return db[_0x3c85('0x6f')][_0x3c85('0x56')]({'where':{'id':_0x5054d5[_0x3c85('0x57')][_0x3c85('0x5f')],'role':_0x3c85('0x70')},'attributes':['id','name',_0x3c85('0x71'),'email',_0x3c85('0x73')],'raw':!![]});}return null;})[_0x3c85('0x1f')](function(_0x546058){if(!_0x546058)return null;_0x3a6f17[_0x3c85('0x27')][_0x3c85('0x70')]=_0x546058;return _0x3a6f17;})['then'](function(_0x225fc8){if(_0x225fc8){_0x225fc8[_0x3c85('0x27')][_0x3c85('0x75')]=util[_0x3c85('0x5d')](_0x3c85('0x76'),_0x5054d5[_0x3c85('0x60')]['name']);_0x225fc8[_0x3c85('0x27')][_0x3c85('0x77')]=_0x3a6f17[_0x3c85('0x77')];_0x225fc8[_0x3c85('0x27')][_0x3c85('0x7f')]=_0x3a6f17[_0x3c85('0x77')];_0x225fc8[_0x3c85('0x27')][_0x3c85('0x78')]=_0x3c85('0x34');respondWithRpcPromise(_0x3c85('0x7a'),_0x3c85('0x7a'),{'event':_0x3c85('0x80'),'message':_0x225fc8[_0x3c85('0x27')]},client9002);return _0x3a6f17;}return null;})['then'](respondWithResult(_0x50ca19,null))[_0x3c85('0x29')](handleError(_0x50ca19,null));};exports[_0x3c85('0x81')]=function(_0x963d5e,_0x44b75b){var _0x2687fb;return db[_0x3c85('0x3d')][_0x3c85('0x81')](_0x963d5e['body'],{})[_0x3c85('0x1f')](function(_0x47b9d9){_0x2687fb=_0x47b9d9;return db[_0x3c85('0x82')][_0x3c85('0x83')]({'where':{'id':_0x2687fb[_0x3c85('0x7e')]}});})[_0x3c85('0x1f')](function(_0x24cb90){if(_[_0x3c85('0x84')](_0x24cb90)){return;}else{_0x2687fb[_0x3c85('0x5a')]=_0x24cb90[_0x3c85('0x5a')];return db['Attachment'][_0x3c85('0x83')]({'where':{'id':_0x2687fb['AttachmentId']}});}})[_0x3c85('0x1f')](function(_0x2fe8ad){return respondWithRpcPromise(_0x3c85('0x85'),'SendFax',{'FaxAccountId':_[_0x3c85('0x84')](_0x963d5e[_0x3c85('0x57')])?undefined:_0x963d5e[_0x3c85('0x57')][_0x3c85('0x86')],'path':_['isNil'](_0x2fe8ad)?undefined:util['format'](_0x3c85('0x87'),_0x2fe8ad['basename']),'fax':_[_0x3c85('0x84')](_0x2687fb[_0x3c85('0x5a')])?undefined:_0x2687fb[_0x3c85('0x5a')],'AttachmentId':_0x2687fb[_0x3c85('0x88')]},client9002);})['then'](respondWithResult(_0x44b75b,0xc9))[_0x3c85('0x29')](handleError(_0x44b75b,null));};exports['download']=function(_0x48d06b,_0x3abb0e){var _0x26ac5f=path[_0x3c85('0x89')](config['root'],_0x3c85('0x8a'),_0x3c85('0x8b'),_0x3c85('0x8c'));return db[_0x3c85('0x3d')]['find']({'where':{'id':_0x48d06b[_0x3c85('0x53')]['id']},'include':[{'model':db['Attachment'],'as':_0x3c85('0x8d')}]})[_0x3c85('0x1f')](handleEntityNotFound(_0x3abb0e,null))[_0x3c85('0x1f')](function(_0x5088f5){if(_0x5088f5){return _0x3abb0e[_0x3c85('0x8e')](path[_0x3c85('0x89')](_0x26ac5f,_0x5088f5[_0x3c85('0x8d')][_0x3c85('0x8f')]));}})[_0x3c85('0x29')](handleError(_0x3abb0e,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 81e618b..a81ebc7 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 _0x576b=['emit','hasOwnProperty','hook','exports','setMaxListeners','save','remove'];(function(_0x321fcb,_0x244ff0){var _0xe1839a=function(_0x10dc2c){while(--_0x10dc2c){_0x321fcb['push'](_0x321fcb['shift']());}};_0xe1839a(++_0x244ff0);}(_0x576b,0x1d9));var _0xb576=function(_0x2b3ebc,_0x2d4e9a){_0x2b3ebc=_0x2b3ebc-0x0;var _0x1f0612=_0x576b[_0x2b3ebc];return _0x1f0612;};'use strict';var EventEmitter=require('events');var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xb576('0x0')](0x0);var events={'afterCreate':_0xb576('0x1'),'afterUpdate':'update','afterDestroy':_0xb576('0x2')};function emitEvent(_0x45dbdf){return function(_0x4e022a,_0x20cb85,_0x25bfec){FaxMessageEvents[_0xb576('0x3')](_0x45dbdf+':'+_0x4e022a['id'],_0x4e022a);FaxMessageEvents[_0xb576('0x3')](_0x45dbdf,_0x4e022a);_0x25bfec(null);};}for(var e in events){if(events[_0xb576('0x4')](e)){var event=events[e];FaxMessage[_0xb576('0x5')](e,emitEvent(event));}}module[_0xb576('0x6')]=FaxMessageEvents; \ No newline at end of file +var _0xcedf=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage'];(function(_0x3fca67,_0x2e419a){var _0x521248=function(_0x4cd267){while(--_0x4cd267){_0x3fca67['push'](_0x3fca67['shift']());}};_0x521248(++_0x2e419a);}(_0xcedf,0x1b6));var _0xfced=function(_0x3900b3,_0x400f56){_0x3900b3=_0x3900b3-0x0;var _0x53d047=_0xcedf[_0x3900b3];return _0x53d047;};'use strict';var EventEmitter=require(_0xfced('0x0'));var FaxMessage=require(_0xfced('0x1'))['db'][_0xfced('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xfced('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfced('0x4'),'afterDestroy':_0xfced('0x5')};function emitEvent(_0x4c426b){return function(_0x5b16af,_0x1dad76,_0x4a86d5){FaxMessageEvents[_0xfced('0x6')](_0x4c426b+':'+_0x5b16af['id'],_0x5b16af);FaxMessageEvents['emit'](_0x4c426b,_0x5b16af);_0x4a86d5(null);};}for(var e in events){if(events[_0xfced('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0xfced('0x8')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 4f25477..c2723a6 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 _0x9133=['body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','fax_messages'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x9133,0x86));var _0x3913=function(_0x235d85,_0x2db080){_0x235d85=_0x235d85-0x0;var _0x559ead=_0x9133[_0x235d85];return _0x559ead;};'use strict';var _=require(_0x3913('0x0'));var util=require(_0x3913('0x1'));var logger=require(_0x3913('0x2'))(_0x3913('0x3'));var moment=require(_0x3913('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3913('0x5'));var rimraf=require(_0x3913('0x6'));var config=require(_0x3913('0x7'));var attributes=require('./faxMessage.attributes');module[_0x3913('0x8')]=function(_0x3a410f,_0xdc9e2c){return _0x3a410f[_0x3913('0x9')]('FaxMessage',attributes,{'tableName':_0x3913('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x3913('0xb')],'type':_0x3913('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x569f14,_0x370a96,_0x57d4c2){var _0xca832=_0x3a410f[_0x3913('0xd')];var _0x532303=_0x569f14[_0x3913('0xe')]({'plain':!![]});if(_0x532303[_0x3913('0xf')]['toLowerCase']()==='in'||_0x532303[_0x3913('0xf')][_0x3913('0x10')]()===_0x3913('0x11')&&!_0x532303[_0x3913('0x12')]&&!_[_0x3913('0x13')](_0x532303[_0x3913('0x14')])){_0xca832['FaxInteraction'][_0x3913('0x15')]({'where':{'id':_0x532303[_0x3913('0x16')]}})[_0x3913('0x17')](function(_0xc2e5c1){if(_0xc2e5c1){_0xc2e5c1['update']({'lastMsgAt':_0x532303[_0x3913('0x18')],'lastMsgDirection':_0x532303[_0x3913('0xf')]['toLowerCase']()});}})[_0x3913('0x19')](function(_0x14f3a0){console[_0x3913('0x1a')](_0x14f3a0);});}_0x57d4c2();}},'charset':_0x3913('0x1b'),'collate':_0x3913('0x1c')});}; \ No newline at end of file +var _0x2ae5=['error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x2ae5,0x1a7));var _0x52ae=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x2ae5[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x52ae('0x0'));var util=require(_0x52ae('0x1'));var logger=require(_0x52ae('0x2'))(_0x52ae('0x3'));var moment=require(_0x52ae('0x4'));var BPromise=require(_0x52ae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x52ae('0x6'));var rimraf=require('rimraf');var config=require(_0x52ae('0x7'));var attributes=require('./faxMessage.attributes');module[_0x52ae('0x8')]=function(_0x368513,_0xf45f91){return _0x368513['define']('FaxMessage',attributes,{'tableName':_0x52ae('0x9'),'paranoid':![],'indexes':[{'name':_0x52ae('0xa'),'fields':[_0x52ae('0xb')],'type':_0x52ae('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a0b3d,_0x4a96a8,_0x6eb63e){var _0x42c505=_0x368513[_0x52ae('0xd')];var _0x21a661=_0x3a0b3d[_0x52ae('0xe')]({'plain':!![]});if(_0x21a661[_0x52ae('0xf')][_0x52ae('0x10')]()==='in'||_0x21a661[_0x52ae('0xf')][_0x52ae('0x10')]()===_0x52ae('0x11')&&!_0x21a661[_0x52ae('0x12')]&&!_['isNil'](_0x21a661[_0x52ae('0x13')])){_0x42c505[_0x52ae('0x14')][_0x52ae('0x15')]({'where':{'id':_0x21a661[_0x52ae('0x16')]}})[_0x52ae('0x17')](function(_0x34d71c){if(_0x34d71c){_0x34d71c[_0x52ae('0x18')]({'lastMsgAt':_0x21a661[_0x52ae('0x19')],'lastMsgDirection':_0x21a661[_0x52ae('0xf')][_0x52ae('0x10')]()});}})[_0x52ae('0x1a')](function(_0x57ff1c){console[_0x52ae('0x1b')](_0x57ff1c);});}_0x6eb63e();}},'charset':_0x52ae('0x1c'),'collate':_0x52ae('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index fde4819..55a4671 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 _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(_0x5c264f,_0x571dfa){var _0x57455c=function(_0x5eefbf){while(--_0x5eefbf){_0x5c264f['push'](_0x5c264f['shift']());}};_0x57455c(++_0x571dfa);}(_0x70e0,0x17b));var _0x070e=function(_0x111959,_0x32abbf){_0x111959=_0x111959-0x0;var _0x54d7b2=_0x70e0[_0x111959];return _0x54d7b2;};'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 +var _0x00bb=['redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','FaxMessage,\x20%s,\x20%s','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','update','attributes','UpdateFaxMessage','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5f17d0,_0x16a2cf){var _0x39c744=function(_0x58d5ae){while(--_0x58d5ae){_0x5f17d0['push'](_0x5f17d0['shift']());}};_0x39c744(++_0x16a2cf);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb00b('0x8')]=_[_0xb00b('0x9')](config[_0xb00b('0x8')],{'host':_0xb00b('0xa'),'port':0x18eb});var socket=require(_0xb00b('0xb'))(new Redis(config[_0xb00b('0x8')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x5154d9,_0x1e9b7b,_0x5851d4){return new BPromise(function(_0x46a25c,_0x28d3cc){return client['request'](_0x5154d9,_0x5851d4)[_0xb00b('0xc')](function(_0x5a63ed){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));logger[_0xb00b('0xe')](_0xb00b('0xf'),_0x1e9b7b,_0xb00b('0xd'),JSON[_0xb00b('0x10')](_0x5a63ed));if(_0x5a63ed[_0xb00b('0x11')]){if(_0x5a63ed['error'][_0xb00b('0x12')]===0x1f4){logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);return _0x28d3cc(_0x5a63ed['error']['message']);}logger[_0xb00b('0x11')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0x5a63ed['error'][_0xb00b('0x13')]);return _0x46a25c(_0x5a63ed[_0xb00b('0x11')][_0xb00b('0x13')]);}else{logger[_0xb00b('0x14')]('FaxMessage,\x20%s,\x20%s',_0x1e9b7b,_0xb00b('0xd'));_0x46a25c(_0x5a63ed['result'][_0xb00b('0x13')]);}})['catch'](function(_0x25d7a0){logger['error'](_0xb00b('0x15'),_0x1e9b7b,_0x25d7a0);_0x28d3cc(_0x25d7a0);});});}exports[_0xb00b('0x16')]=function(_0x53ee68){var _0x55770c=this;return new Promise(function(_0x2b0da1,_0x4a334b){return db[_0xb00b('0x17')][_0xb00b('0x18')](_0x53ee68[_0xb00b('0x19')],{'raw':_0x53ee68[_0xb00b('0x1a')]?_0x53ee68['options'][_0xb00b('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x25a973){logger[_0xb00b('0x14')]('CreateFaxMessage',_0x53ee68);logger[_0xb00b('0xe')](_0xb00b('0x16'),_0x53ee68,JSON['stringify'](_0x25a973));_0x2b0da1(_0x25a973);})[_0xb00b('0x1c')](function(_0x1f04d3){logger['error'](_0xb00b('0x16'),_0x1f04d3[_0xb00b('0x13')],_0x53ee68);_0x4a334b(_0x55770c[_0xb00b('0x11')](0x1f4,_0x1f04d3[_0xb00b('0x13')]));});});};exports['UpdateFaxMessage']=function(_0x50be6c){var _0x3785e9=this;return new Promise(function(_0x490380,_0x550587){return db['FaxMessage'][_0xb00b('0x1d')](_0x50be6c[_0xb00b('0x19')],{'raw':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')][_0xb00b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['where']||null:null,'attributes':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c['options'][_0xb00b('0x1e')]||null:null,'limit':_0x50be6c[_0xb00b('0x1a')]?_0x50be6c[_0xb00b('0x1a')]['limit']||null:null})[_0xb00b('0xc')](function(_0x280ed3){logger[_0xb00b('0x14')](_0xb00b('0x1f'),_0x50be6c);logger[_0xb00b('0xe')](_0xb00b('0x1f'),_0x50be6c,JSON[_0xb00b('0x10')](_0x280ed3));_0x490380(_0x280ed3);})[_0xb00b('0x1c')](function(_0x149c1a){logger['error'](_0xb00b('0x1f'),_0x149c1a[_0xb00b('0x13')],_0x50be6c);_0x550587(_0x3785e9['error'](0x1f4,_0x149c1a[_0xb00b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b758daf..e0ed13d 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 _0xf641=['register','faxMessage:','update','emit'];(function(_0x3f55de,_0x3ae98f){var _0x2698de=function(_0x48f021){while(--_0x48f021){_0x3f55de['push'](_0x3f55de['shift']());}};_0x2698de(++_0x3ae98f);}(_0xf641,0x1d6));var _0x1f64=function(_0x39414d,_0x26b932){_0x39414d=_0x39414d-0x0;var _0x5e2c82=_0xf641[_0x39414d];return _0x5e2c82;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=['save','remove',_0x1f64('0x0')];function createListener(_0x4067c9,_0xeb1960){return function(_0x2d568a){_0xeb1960[_0x1f64('0x1')](_0x4067c9,_0x2d568a);};}function removeListener(_0x4bcdd0,_0x4c5ff5){return function(){FaxMessageEvents['removeListener'](_0x4bcdd0,_0x4c5ff5);};}exports[_0x1f64('0x2')]=function(_0x45c952){for(var _0x3897b2=0x0,_0x523039=events['length'];_0x3897b2<_0x523039;_0x3897b2++){var _0x514ddc=events[_0x3897b2];var _0x327826=createListener(_0x1f64('0x3')+_0x514ddc,_0x45c952);FaxMessageEvents['on'](_0x514ddc,_0x327826);}}; \ No newline at end of file +var _0x7f15=['./faxMessage.events','save','remove','update','removeListener','register','length','faxMessage:'];(function(_0x4980e2,_0x200972){var _0x2b19ce=function(_0x473b31){while(--_0x473b31){_0x4980e2['push'](_0x4980e2['shift']());}};_0x2b19ce(++_0x200972);}(_0x7f15,0xa8));var _0x57f1=function(_0x46aaf8,_0x379b43){_0x46aaf8=_0x46aaf8-0x0;var _0x1cff12=_0x7f15[_0x46aaf8];return _0x1cff12;};'use strict';var FaxMessageEvents=require(_0x57f1('0x0'));var events=[_0x57f1('0x1'),_0x57f1('0x2'),_0x57f1('0x3')];function createListener(_0x1da6c6,_0x2da985){return function(_0x3085fb){_0x2da985['emit'](_0x1da6c6,_0x3085fb);};}function removeListener(_0x182c59,_0x3286b4){return function(){FaxMessageEvents[_0x57f1('0x4')](_0x182c59,_0x3286b4);};}exports[_0x57f1('0x5')]=function(_0x59997){for(var _0x214fa6=0x0,_0x9d1c78=events[_0x57f1('0x6')];_0x214fa6<_0x9d1c78;_0x214fa6++){var _0x5de9a1=events[_0x214fa6];var _0x4ff08b=createListener(_0x57f1('0x7')+_0x5de9a1,_0x59997);FaxMessageEvents['on'](_0x5de9a1,_0x4ff08b);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d56aeb9..e137567 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 _0xc788=['describe','/:id','show','post','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc788,0xc4));var _0x8c78=function(_0x111c47,_0x2c867b){_0x111c47=_0x111c47-0x0;var _0x30790f=_0xc788[_0x111c47];return _0x30790f;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var fs_extra=require(_0x8c78('0x4'));var auth=require(_0x8c78('0x5'));var interaction=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var controller=require('./faxMessage.controller');router[_0x8c78('0x8')]('/',auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0x8')](_0x8c78('0xb'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0x8')](_0x8c78('0xd'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);router[_0x8c78('0x8')]('/:id/download',auth[_0x8c78('0x9')](),controller['download']);router[_0x8c78('0xf')]('/',auth[_0x8c78('0x9')](),interaction['tracked'](_0x8c78('0x10'),_0x8c78('0x11')),controller['create']);router[_0x8c78('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8c78('0x13')]);router[_0x8c78('0x12')](_0x8c78('0x14'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x15')]);router[_0x8c78('0x12')](_0x8c78('0x16'),auth[_0x8c78('0x9')](),controller[_0x8c78('0x17')]);router[_0x8c78('0x18')]('/:id',auth[_0x8c78('0x9')](),controller[_0x8c78('0x19')]);module['exports']=router; \ No newline at end of file +var _0x7072=['/:id/download','download','post','tracked','fax','faxmessage:create','create','put','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4976ed,_0x5ff3ce){var _0x5122b4=function(_0x31184d){while(--_0x31184d){_0x4976ed['push'](_0x4976ed['shift']());}};_0x5122b4(++_0x5ff3ce);}(_0x7072,0x138));var _0x2707=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7072[_0xfae23b];return _0x200640;};'use strict';var multer=require('multer');var util=require(_0x2707('0x0'));var path=require(_0x2707('0x1'));var timeout=require(_0x2707('0x2'));var express=require(_0x2707('0x3'));var router=express[_0x2707('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2707('0x5'));var config=require('../../config/environment');var controller=require(_0x2707('0x6'));router[_0x2707('0x7')]('/',auth[_0x2707('0x8')](),controller[_0x2707('0x9')]);router[_0x2707('0x7')](_0x2707('0xa'),auth[_0x2707('0x8')](),controller[_0x2707('0xb')]);router[_0x2707('0x7')](_0x2707('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2707('0x7')](_0x2707('0xd'),auth[_0x2707('0x8')](),controller[_0x2707('0xe')]);router[_0x2707('0xf')]('/',auth[_0x2707('0x8')](),interaction[_0x2707('0x10')](_0x2707('0x11'),_0x2707('0x12')),controller[_0x2707('0x13')]);router[_0x2707('0x14')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['update']);router[_0x2707('0x14')]('/:id/accept',auth[_0x2707('0x8')](),controller[_0x2707('0x15')]);router[_0x2707('0x14')](_0x2707('0x16'),auth[_0x2707('0x8')](),controller['reject']);router[_0x2707('0x17')](_0x2707('0xc'),auth[_0x2707('0x8')](),controller['destroy']);module[_0x2707('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index e1a7404..4dae4d8 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 _0x60ca=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x2c3817,_0x1e9e7d){var _0x3a80a7=function(_0x157f7b){while(--_0x157f7b){_0x2c3817['push'](_0x2c3817['shift']());}};_0x3a80a7(++_0x1e9e7d);}(_0x60ca,0x92));var _0xa60c=function(_0x416014,_0x5e3650){_0x416014=_0x416014-0x0;var _0x44e54e=_0x60ca[_0x416014];return _0x44e54e;};'use strict';var Sequelize=require(_0xa60c('0x0'));module[_0xa60c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa60c('0x2')]},'timeout':{'type':Sequelize[_0xa60c('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa60c('0x4')](_0xa60c('0x5'),'beepall',_0xa60c('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa60c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2c27=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x314d55,_0x6a083){var _0x745d61=function(_0x4eb48c){while(--_0x4eb48c){_0x314d55['push'](_0x314d55['shift']());}};_0x745d61(++_0x6a083);}(_0x2c27,0x9f));var _0x72c2=function(_0x53e8b0,_0x2032a4){_0x53e8b0=_0x53e8b0-0x0;var _0x11c6a6=_0x2c27[_0x53e8b0];return _0x11c6a6;};'use strict';var Sequelize=require(_0x72c2('0x0'));module[_0x72c2('0x1')]={'name':{'type':Sequelize[_0x72c2('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x72c2('0x2')]},'timeout':{'type':Sequelize[_0x72c2('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x72c2('0x4'),_0x72c2('0x5'),_0x72c2('0x6')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x72c2('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 8d0b6c6..55a65ef 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 _0xeb69=['includeAll','include','findAll','rows','params','merge','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','rawAttributes','length','nolimit','pick','UserFaxQueue','User','findAndCountAll','UserId','agent','faxPause','updatedAt','%s/%s','SIP','createdAt','getTeams','order','hasOwnProperty','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','userFaxQueue:save','removeTeams','Team','select','field','from','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','forEach','emit','userFaxQueue:remove','addAgents','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','FaxQueues','stack','name','send','index','map','FaxQueue','fieldName','key','model','keys','query','filters','intersection','fields','attributes','sort','filter','where','type','VIRTUAL','options'];(function(_0x247d92,_0x85db3e){var _0x85d38b=function(_0x180604){while(--_0x180604){_0x247d92['push'](_0x247d92['shift']());}};_0x85d38b(++_0x85db3e);}(_0xeb69,0xd6));var _0x9eb6=function(_0x26379a,_0x56fd4b){_0x26379a=_0x26379a-0x0;var _0x354610=_0xeb69[_0x26379a];return _0x354610;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9eb6('0x0'));var zipdir=require(_0x9eb6('0x1'));var jsonpatch=require(_0x9eb6('0x2'));var rp=require(_0x9eb6('0x3'));var moment=require(_0x9eb6('0x4'));var BPromise=require(_0x9eb6('0x5'));var Mustache=require(_0x9eb6('0x6'));var util=require(_0x9eb6('0x7'));var path=require(_0x9eb6('0x8'));var sox=require(_0x9eb6('0x9'));var csv=require(_0x9eb6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9eb6('0xb'));var _=require('lodash');var squel=require(_0x9eb6('0xc'));var crypto=require('crypto');var jsforce=require(_0x9eb6('0xd'));var deskjs=require(_0x9eb6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9eb6('0xf'));var Papa=require(_0x9eb6('0x10'));var Redis=require('ioredis');var authService=require(_0x9eb6('0x11'));var qs=require(_0x9eb6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9eb6('0x13'));var logger=require(_0x9eb6('0x14'))(_0x9eb6('0x15'));var utils=require(_0x9eb6('0x16'));var config=require(_0x9eb6('0x17'));var licenseUtil=require(_0x9eb6('0x18'));var db=require(_0x9eb6('0x19'))['db'];config[_0x9eb6('0x1a')]=_[_0x9eb6('0x1b')](config[_0x9eb6('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x9eb6('0x1c'))(new Redis(config[_0x9eb6('0x1a')]));require(_0x9eb6('0x1d'))[_0x9eb6('0x1e')](socket);function respondWithStatusCode(_0x292285,_0x4f8d1f){_0x4f8d1f=_0x4f8d1f||0xcc;return function(_0x221aeb){if(_0x221aeb){return _0x292285[_0x9eb6('0x1f')](_0x4f8d1f);}return _0x292285[_0x9eb6('0x20')](_0x4f8d1f)[_0x9eb6('0x21')]();};}function respondWithResult(_0x72bed5,_0x58de46){_0x58de46=_0x58de46||0xc8;return function(_0x376493){if(_0x376493){return _0x72bed5['status'](_0x58de46)[_0x9eb6('0x22')](_0x376493);}};}function respondWithFilteredResult(_0x3243b3,_0x1215eb){return function(_0x68ee10){if(_0x68ee10){var _0x5f4f13=typeof _0x1215eb[_0x9eb6('0x23')]===_0x9eb6('0x24')&&typeof _0x1215eb[_0x9eb6('0x25')]===_0x9eb6('0x24');var _0x1bf501=_0x68ee10[_0x9eb6('0x26')];var _0x2921a7=_0x5f4f13?0x0:_0x1215eb['offset'];var _0x3e2984=_0x5f4f13?_0x68ee10[_0x9eb6('0x26')]:_0x1215eb['offset']+_0x1215eb[_0x9eb6('0x25')];var _0x1b8feb;if(_0x3e2984>=_0x1bf501){_0x3e2984=_0x1bf501;_0x1b8feb=0xc8;}else{_0x1b8feb=0xce;}_0x3243b3[_0x9eb6('0x20')](_0x1b8feb);return _0x3243b3[_0x9eb6('0x27')]('Content-Range',_0x2921a7+'-'+_0x3e2984+'/'+_0x1bf501)[_0x9eb6('0x22')](_0x68ee10);}return null;};}function patchUpdates(_0x27f7ab){return function(_0x4c88b3){try{jsonpatch[_0x9eb6('0x28')](_0x4c88b3,_0x27f7ab,!![]);}catch(_0x740fda){return BPromise[_0x9eb6('0x29')](_0x740fda);}return _0x4c88b3[_0x9eb6('0x2a')]();};}function saveUpdates(_0x100eaa,_0x322d78){return function(_0x5bd29c){if(_0x5bd29c){return _0x5bd29c['update'](_0x100eaa)[_0x9eb6('0x2b')](function(_0x24cd95){return _0x24cd95;});}return null;};}function removeEntity(_0x5a81b5,_0x2e48b1){return function(_0x2dc8cb){if(_0x2dc8cb){return _0x2dc8cb[_0x9eb6('0x2c')]()[_0x9eb6('0x2b')](function(){var _0x7b264e=_0x2dc8cb[_0x9eb6('0x2d')]({'plain':!![]});var _0x30086b=_0x9eb6('0x2e');return db['UserProfileResource']['destroy']({'where':{'type':_0x30086b,'resourceId':_0x7b264e['id']}})[_0x9eb6('0x2b')](function(){return _0x2dc8cb;});})[_0x9eb6('0x2b')](function(){_0x5a81b5[_0x9eb6('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x61036a,_0x4aede1){return function(_0x4da3a4){if(!_0x4da3a4){_0x61036a[_0x9eb6('0x1f')](0x194);}return _0x4da3a4;};}function handleError(_0x331f94,_0x13e509){_0x13e509=_0x13e509||0x1f4;return function(_0x23f2b5){logger['error'](_0x23f2b5[_0x9eb6('0x2f')]);if(_0x23f2b5[_0x9eb6('0x30')]){delete _0x23f2b5[_0x9eb6('0x30')];}_0x331f94['status'](_0x13e509)[_0x9eb6('0x31')](_0x23f2b5);};}exports[_0x9eb6('0x32')]=function(_0x12edbf,_0x2d9285){var _0x3633a3={},_0x11cf49={},_0x4e0013={'count':0x0,'rows':[]};var _0x444817=_[_0x9eb6('0x33')](db[_0x9eb6('0x34')]['rawAttributes'],function(_0x1d9ae4){return{'name':_0x1d9ae4[_0x9eb6('0x35')],'type':_0x1d9ae4['type'][_0x9eb6('0x36')]};});_0x11cf49[_0x9eb6('0x37')]=_[_0x9eb6('0x33')](_0x444817,'name');_0x11cf49['query']=_[_0x9eb6('0x38')](_0x12edbf[_0x9eb6('0x39')]);_0x11cf49[_0x9eb6('0x3a')]=_[_0x9eb6('0x3b')](_0x11cf49['model'],_0x11cf49[_0x9eb6('0x39')]);_0x3633a3['attributes']=_[_0x9eb6('0x3b')](_0x11cf49[_0x9eb6('0x37')],qs[_0x9eb6('0x3c')](_0x12edbf['query'][_0x9eb6('0x3c')]));_0x3633a3[_0x9eb6('0x3d')]=_0x3633a3[_0x9eb6('0x3d')]['length']?_0x3633a3[_0x9eb6('0x3d')]:_0x11cf49[_0x9eb6('0x37')];if(!_0x12edbf[_0x9eb6('0x39')]['hasOwnProperty']('nolimit')){_0x3633a3[_0x9eb6('0x25')]=qs['limit'](_0x12edbf[_0x9eb6('0x39')][_0x9eb6('0x25')]);_0x3633a3[_0x9eb6('0x23')]=qs[_0x9eb6('0x23')](_0x12edbf[_0x9eb6('0x39')]['offset']);}_0x3633a3['order']=qs[_0x9eb6('0x3e')](_0x12edbf['query'][_0x9eb6('0x3e')]);_0x3633a3['where']=qs['filters'](_['pick'](_0x12edbf['query'],_0x11cf49[_0x9eb6('0x3a')]),_0x444817);if(_0x12edbf[_0x9eb6('0x39')][_0x9eb6('0x3f')]){_0x3633a3[_0x9eb6('0x40')]=_['merge'](_0x3633a3['where'],{'$or':_[_0x9eb6('0x33')](_0x444817,function(_0x2799f4){if(_0x2799f4[_0x9eb6('0x41')]!==_0x9eb6('0x42')){var _0xe92c47={};_0xe92c47[_0x2799f4[_0x9eb6('0x30')]]={'$like':'%'+_0x12edbf[_0x9eb6('0x39')][_0x9eb6('0x3f')]+'%'};return _0xe92c47;}})});}_0x3633a3=_['merge']({},_0x3633a3,_0x12edbf[_0x9eb6('0x43')]);var _0x597169={'where':_0x3633a3['where']};return db[_0x9eb6('0x34')]['count'](_0x597169)[_0x9eb6('0x2b')](function(_0x256778){_0x4e0013[_0x9eb6('0x26')]=_0x256778;if(_0x12edbf[_0x9eb6('0x39')][_0x9eb6('0x44')]){_0x3633a3[_0x9eb6('0x45')]=[{'all':!![]}];}return db[_0x9eb6('0x34')][_0x9eb6('0x46')](_0x3633a3);})[_0x9eb6('0x2b')](function(_0x267e24){_0x4e0013[_0x9eb6('0x47')]=_0x267e24;return _0x4e0013;})[_0x9eb6('0x2b')](respondWithFilteredResult(_0x2d9285,_0x3633a3))['catch'](handleError(_0x2d9285,null));};exports['show']=function(_0x2dee1d,_0x4c8e68){var _0x50c568={'raw':!![],'where':{'id':_0x2dee1d[_0x9eb6('0x48')]['id']}},_0x19884b={};_0x19884b[_0x9eb6('0x37')]=_[_0x9eb6('0x38')](db[_0x9eb6('0x34')]['rawAttributes']);_0x19884b[_0x9eb6('0x39')]=_[_0x9eb6('0x38')](_0x2dee1d[_0x9eb6('0x39')]);_0x19884b[_0x9eb6('0x3a')]=_[_0x9eb6('0x3b')](_0x19884b['model'],_0x19884b[_0x9eb6('0x39')]);_0x50c568['attributes']=_[_0x9eb6('0x3b')](_0x19884b[_0x9eb6('0x37')],qs[_0x9eb6('0x3c')](_0x2dee1d[_0x9eb6('0x39')][_0x9eb6('0x3c')]));_0x50c568[_0x9eb6('0x3d')]=_0x50c568['attributes']['length']?_0x50c568[_0x9eb6('0x3d')]:_0x19884b[_0x9eb6('0x37')];if(_0x2dee1d['query'][_0x9eb6('0x44')]){_0x50c568[_0x9eb6('0x45')]=[{'all':!![]}];}_0x50c568=_[_0x9eb6('0x49')]({},_0x50c568,_0x2dee1d[_0x9eb6('0x43')]);return db[_0x9eb6('0x34')][_0x9eb6('0x4a')](_0x50c568)[_0x9eb6('0x2b')](handleEntityNotFound(_0x4c8e68,null))[_0x9eb6('0x2b')](respondWithResult(_0x4c8e68,null))[_0x9eb6('0x4b')](handleError(_0x4c8e68,null));};exports[_0x9eb6('0x4c')]=function(_0x119afc,_0x21170d){return db[_0x9eb6('0x34')][_0x9eb6('0x4c')](_0x119afc[_0x9eb6('0x4d')],{})[_0x9eb6('0x2b')](function(_0x4b0c65){var _0x2706fe=_0x119afc[_0x9eb6('0x4e')][_0x9eb6('0x2d')]({'plain':!![]});if(!_0x2706fe)throw new Error(_0x9eb6('0x4f'));if(_0x2706fe[_0x9eb6('0x50')]===_0x9eb6('0x4e')){var _0x43b90a=_0x4b0c65[_0x9eb6('0x2d')]({'plain':!![]});var _0x44f8fe=_0x9eb6('0x2e');return db[_0x9eb6('0x51')][_0x9eb6('0x4a')]({'where':{'name':_0x44f8fe,'userProfileId':_0x2706fe[_0x9eb6('0x52')]},'raw':!![]})[_0x9eb6('0x2b')](function(_0xaa8921){if(_0xaa8921&&_0xaa8921[_0x9eb6('0x53')]===0x0){return db[_0x9eb6('0x54')][_0x9eb6('0x4c')]({'name':_0x43b90a[_0x9eb6('0x30')],'resourceId':_0x43b90a['id'],'type':_0xaa8921[_0x9eb6('0x30')],'sectionId':_0xaa8921['id']},{})[_0x9eb6('0x2b')](function(){return _0x4b0c65;});}else{return _0x4b0c65;}})['catch'](function(_0x46596a){logger['error'](_0x9eb6('0x55'),_0x46596a);throw _0x46596a;});}return _0x4b0c65;})['then'](respondWithResult(_0x21170d,0xc9))[_0x9eb6('0x4b')](handleError(_0x21170d,null));};exports[_0x9eb6('0x56')]=function(_0x12d57b,_0x5b3ee6){if(_0x12d57b[_0x9eb6('0x4d')]['id']){delete _0x12d57b[_0x9eb6('0x4d')]['id'];}return db[_0x9eb6('0x34')][_0x9eb6('0x4a')]({'where':{'id':_0x12d57b[_0x9eb6('0x48')]['id']}})[_0x9eb6('0x2b')](handleEntityNotFound(_0x5b3ee6,null))[_0x9eb6('0x2b')](saveUpdates(_0x12d57b['body'],null))['then'](respondWithResult(_0x5b3ee6,null))[_0x9eb6('0x4b')](handleError(_0x5b3ee6,null));};exports[_0x9eb6('0x2c')]=function(_0x1c400c,_0x5a271f){return db[_0x9eb6('0x34')][_0x9eb6('0x4a')]({'where':{'id':_0x1c400c[_0x9eb6('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a271f,null))[_0x9eb6('0x2b')](removeEntity(_0x5a271f,null))[_0x9eb6('0x4b')](handleError(_0x5a271f,null));};exports['describe']=function(_0x1079b8,_0x55eef6){return db[_0x9eb6('0x34')][_0x9eb6('0x57')]()['then'](respondWithResult(_0x55eef6,null))['catch'](handleError(_0x55eef6,null));};exports[_0x9eb6('0x58')]=function(_0xa7a708,_0x5a973c,_0x45b8ac){var _0x2219fc={'raw':!![],'where':{}},_0x3c984c={},_0xe41347;return db['FaxQueue'][_0x9eb6('0x59')]({'where':{'id':_0xa7a708[_0x9eb6('0x48')]['id']}})[_0x9eb6('0x2b')](handleEntityNotFound(_0x5a973c,null))[_0x9eb6('0x2b')](function(_0x17b86a){if(_0x17b86a){_0xe41347=_0x17b86a[_0x9eb6('0x2d')]({'plain':!![]});_0x3c984c[_0x9eb6('0x37')]=_[_0x9eb6('0x38')](db['UserFaxQueue'][_0x9eb6('0x5a')]);_0x3c984c['query']=_['keys'](_0xa7a708[_0x9eb6('0x39')]);_0x3c984c[_0x9eb6('0x3a')]=_[_0x9eb6('0x3b')](_0x3c984c[_0x9eb6('0x37')],_0x3c984c[_0x9eb6('0x39')]);_0x2219fc[_0x9eb6('0x3d')]=_[_0x9eb6('0x3b')](_0x3c984c['model'],qs['fields'](_0xa7a708[_0x9eb6('0x39')][_0x9eb6('0x3c')]));_0x2219fc[_0x9eb6('0x3d')]=_0x2219fc['attributes'][_0x9eb6('0x5b')]?_0x2219fc[_0x9eb6('0x3d')]:_0x3c984c[_0x9eb6('0x37')];if(!_0xa7a708['query']['hasOwnProperty'](_0x9eb6('0x5c'))){_0x2219fc['limit']=qs[_0x9eb6('0x25')](_0xa7a708[_0x9eb6('0x39')][_0x9eb6('0x25')]);_0x2219fc[_0x9eb6('0x23')]=qs[_0x9eb6('0x23')](_0xa7a708[_0x9eb6('0x39')][_0x9eb6('0x23')]);}_0x2219fc['order']=qs['sort'](_0xa7a708[_0x9eb6('0x39')][_0x9eb6('0x3e')]);_0x2219fc[_0x9eb6('0x40')]=qs['filters'](_[_0x9eb6('0x5d')](_0xa7a708[_0x9eb6('0x39')],_0x3c984c[_0x9eb6('0x3a')]));_0x2219fc[_0x9eb6('0x40')]['FaxQueueId']=_0x17b86a['id'];if(_0xa7a708[_0x9eb6('0x39')]['filter']){_0x2219fc[_0x9eb6('0x40')]=_[_0x9eb6('0x49')](_0x2219fc[_0x9eb6('0x40')],{'$or':_[_0x9eb6('0x33')](_0x2219fc[_0x9eb6('0x3d')],function(_0x515b0f){var _0x301346={};_0x301346[_0x515b0f]={'$like':'%'+_0xa7a708[_0x9eb6('0x39')]['filter']+'%'};return _0x301346;})});}_0x2219fc=_['merge']({},_0x2219fc,_0xa7a708[_0x9eb6('0x43')]);return db[_0x9eb6('0x5e')][_0x9eb6('0x46')](_0x2219fc);}})[_0x9eb6('0x2b')](function(_0x51e6cf){if(_0x51e6cf){return db[_0x9eb6('0x5f')][_0x9eb6('0x60')]({'where':{'id':_[_0x9eb6('0x33')](_0x51e6cf,_0x9eb6('0x61')),'role':_0x9eb6('0x62')},'attributes':['id',_0x9eb6('0x30'),_0x9eb6('0x63'),_0x9eb6('0x64'),'createdAt']});}})[_0x9eb6('0x2b')](function(_0x10334d){if(_0x10334d){return{'count':_0x10334d[_0x9eb6('0x26')],'rows':_[_0x9eb6('0x33')](_0x10334d[_0x9eb6('0x47')],function(_0x3deb5a){return{'membername':_0x3deb5a[_0x9eb6('0x30')],'UserId':_0x3deb5a['id'],'queue_name':_0xe41347[_0x9eb6('0x30')],'FaxQueueId':_0xe41347['id'],'interface':util['format'](_0x9eb6('0x65'),_0x9eb6('0x66'),_0x3deb5a[_0x9eb6('0x30')]),'penalty':0x0,'paused':_0x3deb5a[_0x9eb6('0x63')],'createdAt':_0x3deb5a[_0x9eb6('0x67')],'updatedAt':_0x3deb5a[_0x9eb6('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9eb6('0x2b')](respondWithFilteredResult(_0x5a973c,_0x2219fc))[_0x9eb6('0x4b')](handleError(_0x5a973c,null));};exports[_0x9eb6('0x68')]=function(_0x42cb09,_0x3e3fca,_0x4801c5){var _0x52b735={};var _0x18d1ca={};var _0x34bc77;var _0x447b01;return db[_0x9eb6('0x34')][_0x9eb6('0x59')]({'where':{'id':_0x42cb09[_0x9eb6('0x48')]['id']}})[_0x9eb6('0x2b')](handleEntityNotFound(_0x3e3fca,null))[_0x9eb6('0x2b')](function(_0x5abb6c){if(_0x5abb6c){_0x34bc77=_0x5abb6c;_0x18d1ca[_0x9eb6('0x37')]=_[_0x9eb6('0x38')](db['Team'][_0x9eb6('0x5a')]);_0x18d1ca[_0x9eb6('0x39')]=_[_0x9eb6('0x38')](_0x42cb09[_0x9eb6('0x39')]);_0x18d1ca['filters']=_[_0x9eb6('0x3b')](_0x18d1ca[_0x9eb6('0x37')],_0x18d1ca['query']);_0x52b735[_0x9eb6('0x3d')]=_['intersection'](_0x18d1ca[_0x9eb6('0x37')],qs['fields'](_0x42cb09[_0x9eb6('0x39')][_0x9eb6('0x3c')]));_0x52b735[_0x9eb6('0x3d')]=_0x52b735[_0x9eb6('0x3d')][_0x9eb6('0x5b')]?_0x52b735['attributes']:_0x18d1ca[_0x9eb6('0x37')];_0x52b735[_0x9eb6('0x69')]=qs[_0x9eb6('0x3e')](_0x42cb09[_0x9eb6('0x39')][_0x9eb6('0x3e')]);_0x52b735['where']=qs['filters'](_[_0x9eb6('0x5d')](_0x42cb09[_0x9eb6('0x39')],_0x18d1ca[_0x9eb6('0x3a')]));if(_0x42cb09[_0x9eb6('0x39')][_0x9eb6('0x3f')]){_0x52b735[_0x9eb6('0x40')]=_[_0x9eb6('0x49')](_0x52b735[_0x9eb6('0x40')],{'$or':_[_0x9eb6('0x33')](_0x52b735[_0x9eb6('0x3d')],function(_0x2813a9){var _0x10a795={};_0x10a795[_0x2813a9]={'$like':'%'+_0x42cb09[_0x9eb6('0x39')][_0x9eb6('0x3f')]+'%'};return _0x10a795;})});}_0x52b735=_['merge']({},_0x52b735,_0x42cb09['options']);return _0x34bc77[_0x9eb6('0x68')](_0x52b735);}})[_0x9eb6('0x2b')](function(_0x42e01c){if(_0x42e01c){_0x447b01=_0x42e01c[_0x9eb6('0x5b')];if(!_0x42cb09['query'][_0x9eb6('0x6a')](_0x9eb6('0x5c'))){_0x52b735[_0x9eb6('0x25')]=qs['limit'](_0x42cb09[_0x9eb6('0x39')][_0x9eb6('0x25')]);_0x52b735[_0x9eb6('0x23')]=qs[_0x9eb6('0x23')](_0x42cb09[_0x9eb6('0x39')][_0x9eb6('0x23')]);}return _0x34bc77[_0x9eb6('0x68')](_0x52b735);}})[_0x9eb6('0x2b')](function(_0xe92e35){if(_0xe92e35){return _0xe92e35?{'count':_0x447b01,'rows':_0xe92e35}:null;}})[_0x9eb6('0x2b')](respondWithResult(_0x3e3fca,null))[_0x9eb6('0x4b')](handleError(_0x3e3fca,null));};exports[_0x9eb6('0x6b')]=function(_0x4c82a2,_0x4d9f92,_0x2121f2){var _0x19b69a=_0x4c82a2[_0x9eb6('0x4d')][_0x9eb6('0x6c')];return db['Team'][_0x9eb6('0x46')]({'where':{'id':_0x19b69a},'attributes':['id'],'include':[{'model':db[_0x9eb6('0x5f')],'as':_0x9eb6('0x6d'),'attributes':['id',_0x9eb6('0x30'),_0x9eb6('0x6e'),_0x9eb6('0x6f'),'interface'],'raw':!![]}]})[_0x9eb6('0x2b')](function(_0xb818a1){if(_0xb818a1){var _0x33cb5e=_[_0x9eb6('0x70')](_0xb818a1,function(_0x4ae410){var _0x41b0aa=_0x4ae410['get']({'plain':!![]});return _0x41b0aa['Agents'];});return db[_0x9eb6('0x34')][_0x9eb6('0x4a')]({'where':{'id':_0x4c82a2[_0x9eb6('0x48')]['id']}})[_0x9eb6('0x2b')](function(_0x221410){return db[_0x9eb6('0x71')]['transaction'](function(_0x1a7981){return _0x221410['addTeams'](_0x19b69a,{'transaction':_0x1a7981})[_0x9eb6('0x2b')](function(){return BPromise['each'](_0x33cb5e,function(_0xfb8764){return db[_0x9eb6('0x5e')]['findOrCreate']({'where':{'UserId':_0xfb8764['id'],'FaxQueueId':_0x4c82a2['params']['id']},'transaction':_0x1a7981});});})['then'](function(){_0x33cb5e['forEach'](function(_0x101794){socket['emit'](_0x9eb6('0x72'),{'UserId':_0x101794['id'],'FaxQueueId':_0x221410['id']});});});});});}})[_0x9eb6('0x2b')](respondWithStatusCode(_0x4d9f92,null))[_0x9eb6('0x4b')](handleError(_0x4d9f92,null));};exports[_0x9eb6('0x73')]=function(_0x466e51,_0x5d683b,_0x5c46c1){return db[_0x9eb6('0x74')][_0x9eb6('0x46')]({'where':{'id':_0x466e51[_0x9eb6('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9eb6('0x5f')],'as':_0x9eb6('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x9eb6('0x2b')](handleEntityNotFound(_0x5d683b,null))[_0x9eb6('0x2b')](function(_0x13a06a){var _0xb250ea=_['map'](_0x13a06a,'id');var _0x5aa892=[];var _0x40bf19=[];var _0x5bcffb=squel[_0x9eb6('0x75')]();_0x5bcffb[_0x9eb6('0x76')]('tq.TeamId')[_0x9eb6('0x77')]('team_has_fax_queues','tq')['join']('user_has_teams','ut',_0x9eb6('0x78'))[_0x9eb6('0x40')]('FaxQueueId\x20=\x20?',_0x466e51[_0x9eb6('0x48')]['id']);for(var _0x409fd4=0x0;_0x409fd4<_0x13a06a[_0x9eb6('0x5b')];_0x409fd4+=0x1){let _0x149231=_0x13a06a[_0x409fd4];for(var _0x4a84ba=0x0;_0x4a84ba<_0x149231['Agents'][_0x9eb6('0x5b')];_0x4a84ba+=0x1){let _0x92b9d0=_0x149231[_0x9eb6('0x6d')][_0x4a84ba];var _0x31be8e=_0x5bcffb[_0x9eb6('0x79')]();_0x31be8e['where'](_0x9eb6('0x7a'),_0x92b9d0['id']);_0x40bf19[_0x9eb6('0x7b')](db[_0x9eb6('0x71')][_0x9eb6('0x39')](_0x31be8e[_0x9eb6('0x7c')](),{'type':db[_0x9eb6('0x71')]['QueryTypes'][_0x9eb6('0x7d')]})[_0x9eb6('0x2b')](function(_0x272545){if(_0x272545['length']===0x1){return _0x92b9d0['id'];}else{var _0x4b6921=_[_0x9eb6('0x7e')](_[_0x9eb6('0x33')](_0x272545,_0x9eb6('0x7f')),function(_0x25f870){return _[_0x9eb6('0x80')](_0xb250ea,_0x25f870);});if(_0x4b6921){return _0x92b9d0['id'];}}}));}}return BPromise[_0x9eb6('0x81')](_0x40bf19)[_0x9eb6('0x2b')](function(_0x2ad8a3){_0x5aa892=_(_0x5aa892)[_0x9eb6('0x82')](_0x2ad8a3)[_0x9eb6('0x83')]()['value']();return db[_0x9eb6('0x34')][_0x9eb6('0x4a')]({'where':{'id':_0x466e51[_0x9eb6('0x48')]['id']}})['then'](function(_0x180fca){return db[_0x9eb6('0x71')][_0x9eb6('0x84')](function(_0x31e95c){return _0x180fca[_0x9eb6('0x73')](_0x466e51[_0x9eb6('0x39')]['ids'],{'transaction':_0x31e95c})['then'](function(){if(!_[_0x9eb6('0x85')](_0x5aa892)){return _0x180fca['removeAgents'](_0x5aa892,{'transaction':_0x31e95c});}})[_0x9eb6('0x2b')](function(){_0x5aa892[_0x9eb6('0x86')](function(_0x6b7543){socket[_0x9eb6('0x87')](_0x9eb6('0x88'),{'UserId':_0x6b7543,'FaxQueueId':_0x180fca['id']});});});});});});})[_0x9eb6('0x2b')](respondWithStatusCode(_0x5d683b,null))['catch'](handleError(_0x5d683b,null));};exports[_0x9eb6('0x89')]=function(_0x1b7ec6,_0x5cf7ed,_0x4e25c4){return db[_0x9eb6('0x34')][_0x9eb6('0x4a')]({'where':{'id':_0x1b7ec6[_0x9eb6('0x48')]['id']}})['then'](handleEntityNotFound(_0x5cf7ed,null))[_0x9eb6('0x2b')](function(_0x1f201c){if(_0x1f201c){return _0x1f201c[_0x9eb6('0x89')](_0x1b7ec6[_0x9eb6('0x4d')][_0x9eb6('0x6c')],_['omit'](_0x1b7ec6[_0x9eb6('0x4d')],[_0x9eb6('0x6c'),'id'])||{})['spread'](function(_0x471b28){for(var _0xce0c0d=0x0;_0xce0c0d<_0x1b7ec6[_0x9eb6('0x4d')]['ids'][_0x9eb6('0x5b')];_0xce0c0d+=0x1){socket['emit'](_0x9eb6('0x72'),{'UserId':Number(_0x1b7ec6['body']['ids'][_0xce0c0d]),'FaxQueueId':Number(_0x1b7ec6[_0x9eb6('0x48')]['id'])});}return _0x471b28;});}})[_0x9eb6('0x2b')](respondWithResult(_0x5cf7ed,null))['catch'](handleError(_0x5cf7ed,null));};exports[_0x9eb6('0x8a')]=function(_0x1f2fba,_0x3d71d5,_0x13cc43){return db['FaxQueue'][_0x9eb6('0x4a')]({'where':{'id':_0x1f2fba[_0x9eb6('0x48')]['id']}})[_0x9eb6('0x2b')](handleEntityNotFound(_0x3d71d5,null))[_0x9eb6('0x2b')](function(_0x1c3e39){if(_0x1c3e39){return _0x1c3e39[_0x9eb6('0x8a')](_0x1f2fba[_0x9eb6('0x39')]['ids'])['then'](function(){if(_[_0x9eb6('0x8b')](_0x1f2fba[_0x9eb6('0x39')]['ids'])){for(var _0x35f427=0x0;_0x35f427<_0x1f2fba[_0x9eb6('0x39')][_0x9eb6('0x6c')]['length'];_0x35f427+=0x1){socket[_0x9eb6('0x87')](_0x9eb6('0x88'),{'UserId':Number(_0x1f2fba[_0x9eb6('0x39')][_0x9eb6('0x6c')][_0x35f427]),'FaxQueueId':Number(_0x1f2fba['params']['id'])});}}else{socket[_0x9eb6('0x87')](_0x9eb6('0x88'),{'UserId':Number(_0x1f2fba['query']['ids']),'FaxQueueId':Number(_0x1f2fba[_0x9eb6('0x48')]['id'])});}});}})[_0x9eb6('0x2b')](respondWithStatusCode(_0x3d71d5,null))[_0x9eb6('0x4b')](handleError(_0x3d71d5,null));};exports[_0x9eb6('0x8c')]=function(_0x327a7a,_0x4e91de,_0x34c598){var _0x3839c3={};var _0x5b77bf={};var _0x21cb3f;var _0x5c065f;return db[_0x9eb6('0x34')][_0x9eb6('0x59')]({'where':{'id':_0x327a7a[_0x9eb6('0x48')]['id']}})[_0x9eb6('0x2b')](handleEntityNotFound(_0x4e91de,null))[_0x9eb6('0x2b')](function(_0x312a65){if(_0x312a65){_0x21cb3f=_0x312a65;_0x5b77bf[_0x9eb6('0x37')]=_[_0x9eb6('0x38')](db[_0x9eb6('0x5f')]['rawAttributes']);_0x5b77bf[_0x9eb6('0x39')]=_['keys'](_0x327a7a[_0x9eb6('0x39')]);_0x5b77bf['filters']=_[_0x9eb6('0x3b')](_0x5b77bf[_0x9eb6('0x37')],_0x5b77bf['query']);_0x3839c3[_0x9eb6('0x3d')]=_[_0x9eb6('0x3b')](_0x5b77bf['model'],qs[_0x9eb6('0x3c')](_0x327a7a[_0x9eb6('0x39')][_0x9eb6('0x3c')]));_0x3839c3[_0x9eb6('0x3d')]=_0x3839c3[_0x9eb6('0x3d')][_0x9eb6('0x5b')]?_0x3839c3[_0x9eb6('0x3d')]:_0x5b77bf['model'];_0x3839c3[_0x9eb6('0x69')]=qs[_0x9eb6('0x3e')](_0x327a7a['query'][_0x9eb6('0x3e')]);_0x3839c3[_0x9eb6('0x40')]=qs['filters'](_[_0x9eb6('0x5d')](_0x327a7a['query'],_0x5b77bf[_0x9eb6('0x3a')]));if(_0x327a7a[_0x9eb6('0x39')]['filter']){_0x3839c3[_0x9eb6('0x40')]=_[_0x9eb6('0x49')](_0x3839c3[_0x9eb6('0x40')],{'$or':_[_0x9eb6('0x33')](_0x3839c3[_0x9eb6('0x3d')],function(_0x4676db){var _0x57c847={};_0x57c847[_0x4676db]={'$like':'%'+_0x327a7a[_0x9eb6('0x39')][_0x9eb6('0x3f')]+'%'};return _0x57c847;})});}_0x3839c3=_[_0x9eb6('0x49')]({},_0x3839c3,_0x327a7a[_0x9eb6('0x43')]);return _0x21cb3f[_0x9eb6('0x8c')](_0x3839c3);}})[_0x9eb6('0x2b')](function(_0x8dc442){if(_0x8dc442){_0x5c065f=_0x8dc442['length'];if(!_0x327a7a[_0x9eb6('0x39')][_0x9eb6('0x6a')](_0x9eb6('0x5c'))){_0x3839c3['limit']=qs[_0x9eb6('0x25')](_0x327a7a[_0x9eb6('0x39')]['limit']);_0x3839c3[_0x9eb6('0x23')]=qs['offset'](_0x327a7a[_0x9eb6('0x39')][_0x9eb6('0x23')]);}return _0x21cb3f[_0x9eb6('0x8c')](_0x3839c3);}})[_0x9eb6('0x2b')](function(_0x43a9d4){if(_0x43a9d4){return _0x43a9d4?{'count':_0x5c065f,'rows':_0x43a9d4}:null;}})['then'](respondWithResult(_0x4e91de,null))[_0x9eb6('0x4b')](handleError(_0x4e91de,null));}; \ No newline at end of file +var _0x7ef2=['send','index','map','FaxQueue','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','params','rawAttributes','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','findOne','UserFaxQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','each','forEach','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','sequelize','toString','SELECT','every','TeamId','includes','all','compact','value','transaction','removeTeams','isEmpty','removeAgents','emit','userFaxQueue:remove','addAgents','userFaxQueue:save','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','status','end','json','offset','limit','undefined','count','Content-Range','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name'];(function(_0x3c6835,_0x952d5c){var _0x1adeb9=function(_0xfefab3){while(--_0xfefab3){_0x3c6835['push'](_0x3c6835['shift']());}};_0x1adeb9(++_0x952d5c);}(_0x7ef2,0xe9));var _0x27ef=function(_0x5cb070,_0x22677e){_0x5cb070=_0x5cb070-0x0;var _0x383029=_0x7ef2[_0x5cb070];return _0x383029;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x27ef('0x0'));var jsonpatch=require(_0x27ef('0x1'));var rp=require(_0x27ef('0x2'));var moment=require(_0x27ef('0x3'));var BPromise=require(_0x27ef('0x4'));var Mustache=require(_0x27ef('0x5'));var util=require(_0x27ef('0x6'));var path=require(_0x27ef('0x7'));var sox=require(_0x27ef('0x8'));var csv=require(_0x27ef('0x9'));var ejs=require(_0x27ef('0xa'));var fs=require('fs');var fs_extra=require(_0x27ef('0xb'));var _=require(_0x27ef('0xc'));var squel=require(_0x27ef('0xd'));var crypto=require(_0x27ef('0xe'));var jsforce=require(_0x27ef('0xf'));var deskjs=require(_0x27ef('0x10'));var toCsv=require(_0x27ef('0x9'));var querystring=require('querystring');var Papa=require(_0x27ef('0x11'));var Redis=require(_0x27ef('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x27ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x27ef('0x14'))(_0x27ef('0x15'));var utils=require(_0x27ef('0x16'));var config=require(_0x27ef('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x27ef('0x18')]=_['defaults'](config[_0x27ef('0x18')],{'host':_0x27ef('0x19'),'port':0x18eb});var socket=require(_0x27ef('0x1a'))(new Redis(config[_0x27ef('0x18')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x569a2e,_0x2aae0f){_0x2aae0f=_0x2aae0f||0xcc;return function(_0x30f834){if(_0x30f834){return _0x569a2e['sendStatus'](_0x2aae0f);}return _0x569a2e[_0x27ef('0x1b')](_0x2aae0f)[_0x27ef('0x1c')]();};}function respondWithResult(_0x3702f5,_0x14f1cc){_0x14f1cc=_0x14f1cc||0xc8;return function(_0x4a7992){if(_0x4a7992){return _0x3702f5[_0x27ef('0x1b')](_0x14f1cc)[_0x27ef('0x1d')](_0x4a7992);}};}function respondWithFilteredResult(_0xe4039b,_0x5f0f7b){return function(_0x517087){if(_0x517087){var _0x504023=typeof _0x5f0f7b[_0x27ef('0x1e')]==='undefined'&&typeof _0x5f0f7b[_0x27ef('0x1f')]===_0x27ef('0x20');var _0x4ff8bc=_0x517087['count'];var _0x5770df=_0x504023?0x0:_0x5f0f7b[_0x27ef('0x1e')];var _0x1a3e72=_0x504023?_0x517087[_0x27ef('0x21')]:_0x5f0f7b[_0x27ef('0x1e')]+_0x5f0f7b['limit'];var _0x2b928a;if(_0x1a3e72>=_0x4ff8bc){_0x1a3e72=_0x4ff8bc;_0x2b928a=0xc8;}else{_0x2b928a=0xce;}_0xe4039b[_0x27ef('0x1b')](_0x2b928a);return _0xe4039b['set'](_0x27ef('0x22'),_0x5770df+'-'+_0x1a3e72+'/'+_0x4ff8bc)[_0x27ef('0x1d')](_0x517087);}return null;};}function patchUpdates(_0x1e28b5){return function(_0x4cf8cd){try{jsonpatch['apply'](_0x4cf8cd,_0x1e28b5,!![]);}catch(_0x2d92f1){return BPromise[_0x27ef('0x23')](_0x2d92f1);}return _0x4cf8cd[_0x27ef('0x24')]();};}function saveUpdates(_0x303b43,_0x30ac73){return function(_0x5f0ce7){if(_0x5f0ce7){return _0x5f0ce7[_0x27ef('0x25')](_0x303b43)['then'](function(_0x34746c){return _0x34746c;});}return null;};}function removeEntity(_0x4b2d1e,_0x584535){return function(_0x3192c9){if(_0x3192c9){return _0x3192c9[_0x27ef('0x26')]()[_0x27ef('0x27')](function(){var _0x3a3993=_0x3192c9[_0x27ef('0x28')]({'plain':!![]});var _0x4a9897=_0x27ef('0x29');return db[_0x27ef('0x2a')][_0x27ef('0x26')]({'where':{'type':_0x4a9897,'resourceId':_0x3a3993['id']}})['then'](function(){return _0x3192c9;});})[_0x27ef('0x27')](function(){_0x4b2d1e[_0x27ef('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8e71,_0x177347){return function(_0x1a9a28){if(!_0x1a9a28){_0x5d8e71[_0x27ef('0x2b')](0x194);}return _0x1a9a28;};}function handleError(_0x431d1a,_0x2659a9){_0x2659a9=_0x2659a9||0x1f4;return function(_0x3adbf3){logger[_0x27ef('0x2c')](_0x3adbf3[_0x27ef('0x2d')]);if(_0x3adbf3[_0x27ef('0x2e')]){delete _0x3adbf3[_0x27ef('0x2e')];}_0x431d1a[_0x27ef('0x1b')](_0x2659a9)[_0x27ef('0x2f')](_0x3adbf3);};}exports[_0x27ef('0x30')]=function(_0x4f6ce5,_0xf0778a){var _0x5c24d9={},_0x2a6213={},_0x22f250={'count':0x0,'rows':[]};var _0x2bb94e=_[_0x27ef('0x31')](db[_0x27ef('0x32')]['rawAttributes'],function(_0x235d15){return{'name':_0x235d15[_0x27ef('0x33')],'type':_0x235d15[_0x27ef('0x34')][_0x27ef('0x35')]};});_0x2a6213['model']=_[_0x27ef('0x31')](_0x2bb94e,_0x27ef('0x2e'));_0x2a6213[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x4f6ce5[_0x27ef('0x36')]);_0x2a6213['filters']=_[_0x27ef('0x38')](_0x2a6213[_0x27ef('0x39')],_0x2a6213[_0x27ef('0x36')]);_0x5c24d9[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x2a6213['model'],qs[_0x27ef('0x3b')](_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x3b')]));_0x5c24d9['attributes']=_0x5c24d9[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x5c24d9[_0x27ef('0x3a')]:_0x2a6213[_0x27ef('0x39')];if(!_0x4f6ce5['query'][_0x27ef('0x3d')](_0x27ef('0x3e'))){_0x5c24d9[_0x27ef('0x1f')]=qs[_0x27ef('0x1f')](_0x4f6ce5[_0x27ef('0x36')]['limit']);_0x5c24d9[_0x27ef('0x1e')]=qs['offset'](_0x4f6ce5[_0x27ef('0x36')]['offset']);}_0x5c24d9[_0x27ef('0x3f')]=qs[_0x27ef('0x40')](_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x40')]);_0x5c24d9[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x4f6ce5['query'],_0x2a6213['filters']),_0x2bb94e);if(_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x44')]){_0x5c24d9[_0x27ef('0x41')]=_[_0x27ef('0x45')](_0x5c24d9[_0x27ef('0x41')],{'$or':_['map'](_0x2bb94e,function(_0x5345db){if(_0x5345db[_0x27ef('0x34')]!=='VIRTUAL'){var _0x550b37={};_0x550b37[_0x5345db[_0x27ef('0x2e')]]={'$like':'%'+_0x4f6ce5[_0x27ef('0x36')]['filter']+'%'};return _0x550b37;}})});}_0x5c24d9=_[_0x27ef('0x45')]({},_0x5c24d9,_0x4f6ce5['options']);var _0x112883={'where':_0x5c24d9[_0x27ef('0x41')]};return db[_0x27ef('0x32')][_0x27ef('0x21')](_0x112883)['then'](function(_0x365d0b){_0x22f250[_0x27ef('0x21')]=_0x365d0b;if(_0x4f6ce5[_0x27ef('0x36')][_0x27ef('0x46')]){_0x5c24d9[_0x27ef('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0x27ef('0x48')](_0x5c24d9);})['then'](function(_0x3b45f9){_0x22f250[_0x27ef('0x49')]=_0x3b45f9;return _0x22f250;})['then'](respondWithFilteredResult(_0xf0778a,_0x5c24d9))[_0x27ef('0x4a')](handleError(_0xf0778a,null));};exports['show']=function(_0x320e31,_0x5f2db2){var _0x151306={'raw':!![],'where':{'id':_0x320e31[_0x27ef('0x4b')]['id']}},_0x3593d4={};_0x3593d4[_0x27ef('0x39')]=_['keys'](db[_0x27ef('0x32')][_0x27ef('0x4c')]);_0x3593d4[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x320e31[_0x27ef('0x36')]);_0x3593d4['filters']=_[_0x27ef('0x38')](_0x3593d4[_0x27ef('0x39')],_0x3593d4[_0x27ef('0x36')]);_0x151306[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x3593d4['model'],qs[_0x27ef('0x3b')](_0x320e31[_0x27ef('0x36')][_0x27ef('0x3b')]));_0x151306[_0x27ef('0x3a')]=_0x151306[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x151306[_0x27ef('0x3a')]:_0x3593d4[_0x27ef('0x39')];if(_0x320e31[_0x27ef('0x36')][_0x27ef('0x46')]){_0x151306[_0x27ef('0x47')]=[{'all':!![]}];}_0x151306=_[_0x27ef('0x45')]({},_0x151306,_0x320e31[_0x27ef('0x4d')]);return db[_0x27ef('0x32')][_0x27ef('0x4e')](_0x151306)[_0x27ef('0x27')](handleEntityNotFound(_0x5f2db2,null))[_0x27ef('0x27')](respondWithResult(_0x5f2db2,null))[_0x27ef('0x4a')](handleError(_0x5f2db2,null));};exports[_0x27ef('0x4f')]=function(_0x528103,_0x1f1800){return db['FaxQueue'][_0x27ef('0x4f')](_0x528103[_0x27ef('0x50')],{})[_0x27ef('0x27')](function(_0x4ef289){var _0x179eb0=_0x528103[_0x27ef('0x51')][_0x27ef('0x28')]({'plain':!![]});if(!_0x179eb0)throw new Error(_0x27ef('0x52'));if(_0x179eb0[_0x27ef('0x53')]===_0x27ef('0x51')){var _0x4c122d=_0x4ef289[_0x27ef('0x28')]({'plain':!![]});var _0x16556f=_0x27ef('0x29');return db[_0x27ef('0x54')][_0x27ef('0x4e')]({'where':{'name':_0x16556f,'userProfileId':_0x179eb0[_0x27ef('0x55')]},'raw':!![]})[_0x27ef('0x27')](function(_0x4d1ec5){if(_0x4d1ec5&&_0x4d1ec5[_0x27ef('0x56')]===0x0){return db['UserProfileResource'][_0x27ef('0x4f')]({'name':_0x4c122d[_0x27ef('0x2e')],'resourceId':_0x4c122d['id'],'type':_0x4d1ec5[_0x27ef('0x2e')],'sectionId':_0x4d1ec5['id']},{})[_0x27ef('0x27')](function(){return _0x4ef289;});}else{return _0x4ef289;}})[_0x27ef('0x4a')](function(_0x1da0cd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1da0cd);throw _0x1da0cd;});}return _0x4ef289;})['then'](respondWithResult(_0x1f1800,0xc9))['catch'](handleError(_0x1f1800,null));};exports[_0x27ef('0x25')]=function(_0xf9a205,_0x59ac2c){if(_0xf9a205[_0x27ef('0x50')]['id']){delete _0xf9a205['body']['id'];}return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0xf9a205[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x59ac2c,null))[_0x27ef('0x27')](saveUpdates(_0xf9a205[_0x27ef('0x50')],null))[_0x27ef('0x27')](respondWithResult(_0x59ac2c,null))[_0x27ef('0x4a')](handleError(_0x59ac2c,null));};exports['destroy']=function(_0x3cc9c9,_0x574159){return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0x3cc9c9[_0x27ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x574159,null))[_0x27ef('0x27')](removeEntity(_0x574159,null))[_0x27ef('0x4a')](handleError(_0x574159,null));};exports[_0x27ef('0x57')]=function(_0x2440f2,_0x3b5d2e){return db[_0x27ef('0x32')][_0x27ef('0x57')]()['then'](respondWithResult(_0x3b5d2e,null))[_0x27ef('0x4a')](handleError(_0x3b5d2e,null));};exports['getMembers']=function(_0x20b04a,_0xc82468,_0x12a740){var _0x32e25f={'raw':!![],'where':{}},_0x43fb20={},_0x177ebf;return db[_0x27ef('0x32')][_0x27ef('0x58')]({'where':{'id':_0x20b04a[_0x27ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0xc82468,null))[_0x27ef('0x27')](function(_0x1e2c84){if(_0x1e2c84){_0x177ebf=_0x1e2c84[_0x27ef('0x28')]({'plain':!![]});_0x43fb20['model']=_[_0x27ef('0x37')](db[_0x27ef('0x59')]['rawAttributes']);_0x43fb20['query']=_[_0x27ef('0x37')](_0x20b04a[_0x27ef('0x36')]);_0x43fb20['filters']=_[_0x27ef('0x38')](_0x43fb20[_0x27ef('0x39')],_0x43fb20['query']);_0x32e25f[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x43fb20[_0x27ef('0x39')],qs[_0x27ef('0x3b')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x3b')]));_0x32e25f['attributes']=_0x32e25f[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x32e25f[_0x27ef('0x3a')]:_0x43fb20[_0x27ef('0x39')];if(!_0x20b04a[_0x27ef('0x36')][_0x27ef('0x3d')](_0x27ef('0x3e'))){_0x32e25f[_0x27ef('0x1f')]=qs[_0x27ef('0x1f')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x1f')]);_0x32e25f['offset']=qs[_0x27ef('0x1e')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x1e')]);}_0x32e25f[_0x27ef('0x3f')]=qs[_0x27ef('0x40')](_0x20b04a[_0x27ef('0x36')][_0x27ef('0x40')]);_0x32e25f[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x20b04a['query'],_0x43fb20[_0x27ef('0x42')]));_0x32e25f[_0x27ef('0x41')]['FaxQueueId']=_0x1e2c84['id'];if(_0x20b04a[_0x27ef('0x36')][_0x27ef('0x44')]){_0x32e25f[_0x27ef('0x41')]=_['merge'](_0x32e25f['where'],{'$or':_['map'](_0x32e25f['attributes'],function(_0x27ce4e){var _0x3eebf2={};_0x3eebf2[_0x27ce4e]={'$like':'%'+_0x20b04a[_0x27ef('0x36')][_0x27ef('0x44')]+'%'};return _0x3eebf2;})});}_0x32e25f=_[_0x27ef('0x45')]({},_0x32e25f,_0x20b04a['options']);return db[_0x27ef('0x59')][_0x27ef('0x48')](_0x32e25f);}})[_0x27ef('0x27')](function(_0x4ae705){if(_0x4ae705){return db[_0x27ef('0x5a')][_0x27ef('0x5b')]({'where':{'id':_[_0x27ef('0x31')](_0x4ae705,_0x27ef('0x5c')),'role':_0x27ef('0x5d')},'attributes':['id',_0x27ef('0x2e'),'faxPause',_0x27ef('0x5e'),_0x27ef('0x5f')]});}})[_0x27ef('0x27')](function(_0x61e964){if(_0x61e964){return{'count':_0x61e964[_0x27ef('0x21')],'rows':_[_0x27ef('0x31')](_0x61e964[_0x27ef('0x49')],function(_0x43a916){return{'membername':_0x43a916['name'],'UserId':_0x43a916['id'],'queue_name':_0x177ebf[_0x27ef('0x2e')],'FaxQueueId':_0x177ebf['id'],'interface':util[_0x27ef('0x60')](_0x27ef('0x61'),_0x27ef('0x62'),_0x43a916['name']),'penalty':0x0,'paused':_0x43a916[_0x27ef('0x63')],'createdAt':_0x43a916['createdAt'],'updatedAt':_0x43a916[_0x27ef('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x27ef('0x27')](respondWithFilteredResult(_0xc82468,_0x32e25f))[_0x27ef('0x4a')](handleError(_0xc82468,null));};exports[_0x27ef('0x64')]=function(_0x9d96ee,_0x583ef6,_0x4e45ac){var _0x47194c={};var _0x12ae65={};var _0x110391;var _0x4a4f1d;return db['FaxQueue'][_0x27ef('0x58')]({'where':{'id':_0x9d96ee[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x583ef6,null))[_0x27ef('0x27')](function(_0xcd45bc){if(_0xcd45bc){_0x110391=_0xcd45bc;_0x12ae65[_0x27ef('0x39')]=_[_0x27ef('0x37')](db[_0x27ef('0x65')][_0x27ef('0x4c')]);_0x12ae65[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x9d96ee['query']);_0x12ae65[_0x27ef('0x42')]=_['intersection'](_0x12ae65[_0x27ef('0x39')],_0x12ae65[_0x27ef('0x36')]);_0x47194c[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x12ae65['model'],qs[_0x27ef('0x3b')](_0x9d96ee[_0x27ef('0x36')]['fields']));_0x47194c[_0x27ef('0x3a')]=_0x47194c[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x47194c[_0x27ef('0x3a')]:_0x12ae65[_0x27ef('0x39')];_0x47194c['order']=qs['sort'](_0x9d96ee[_0x27ef('0x36')][_0x27ef('0x40')]);_0x47194c[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x9d96ee['query'],_0x12ae65['filters']));if(_0x9d96ee['query']['filter']){_0x47194c[_0x27ef('0x41')]=_['merge'](_0x47194c[_0x27ef('0x41')],{'$or':_[_0x27ef('0x31')](_0x47194c[_0x27ef('0x3a')],function(_0x4aa948){var _0x4b2e1c={};_0x4b2e1c[_0x4aa948]={'$like':'%'+_0x9d96ee['query'][_0x27ef('0x44')]+'%'};return _0x4b2e1c;})});}_0x47194c=_[_0x27ef('0x45')]({},_0x47194c,_0x9d96ee[_0x27ef('0x4d')]);return _0x110391['getTeams'](_0x47194c);}})[_0x27ef('0x27')](function(_0x242188){if(_0x242188){_0x4a4f1d=_0x242188[_0x27ef('0x3c')];if(!_0x9d96ee[_0x27ef('0x36')][_0x27ef('0x3d')](_0x27ef('0x3e'))){_0x47194c[_0x27ef('0x1f')]=qs['limit'](_0x9d96ee[_0x27ef('0x36')][_0x27ef('0x1f')]);_0x47194c[_0x27ef('0x1e')]=qs[_0x27ef('0x1e')](_0x9d96ee['query']['offset']);}return _0x110391[_0x27ef('0x64')](_0x47194c);}})[_0x27ef('0x27')](function(_0x57cf5f){if(_0x57cf5f){return _0x57cf5f?{'count':_0x4a4f1d,'rows':_0x57cf5f}:null;}})[_0x27ef('0x27')](respondWithResult(_0x583ef6,null))[_0x27ef('0x4a')](handleError(_0x583ef6,null));};exports[_0x27ef('0x66')]=function(_0xa54679,_0x1a0252,_0xb87686){var _0x408160=_0xa54679[_0x27ef('0x50')][_0x27ef('0x67')];return db[_0x27ef('0x65')][_0x27ef('0x48')]({'where':{'id':_0x408160},'attributes':['id'],'include':[{'model':db[_0x27ef('0x5a')],'as':_0x27ef('0x68'),'attributes':['id',_0x27ef('0x2e'),_0x27ef('0x69'),_0x27ef('0x6a'),_0x27ef('0x6b')],'raw':!![]}]})[_0x27ef('0x27')](function(_0x40a632){if(_0x40a632){var _0x383d6c=_[_0x27ef('0x6c')](_0x40a632,function(_0x309e4d){var _0x8599f2=_0x309e4d[_0x27ef('0x28')]({'plain':!![]});return _0x8599f2[_0x27ef('0x68')];});return db[_0x27ef('0x32')]['find']({'where':{'id':_0xa54679['params']['id']}})['then'](function(_0x3092bc){return db['sequelize']['transaction'](function(_0x2d1ef5){return _0x3092bc[_0x27ef('0x66')](_0x408160,{'transaction':_0x2d1ef5})[_0x27ef('0x27')](function(){return BPromise[_0x27ef('0x6d')](_0x383d6c,function(_0x15d24e){return db[_0x27ef('0x59')]['findOrCreate']({'where':{'UserId':_0x15d24e['id'],'FaxQueueId':_0xa54679[_0x27ef('0x4b')]['id']},'transaction':_0x2d1ef5});});})[_0x27ef('0x27')](function(){_0x383d6c[_0x27ef('0x6e')](function(_0x313eca){socket['emit']('userFaxQueue:save',{'UserId':_0x313eca['id'],'FaxQueueId':_0x3092bc['id']});});});});});}})[_0x27ef('0x27')](respondWithStatusCode(_0x1a0252,null))['catch'](handleError(_0x1a0252,null));};exports['removeTeams']=function(_0x325d7d,_0x46cb09,_0x23be8a){return db['Team'][_0x27ef('0x48')]({'where':{'id':_0x325d7d[_0x27ef('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0x27ef('0x5a')],'as':_0x27ef('0x68'),'attributes':['id'],'raw':!![]}]})[_0x27ef('0x27')](handleEntityNotFound(_0x46cb09,null))[_0x27ef('0x27')](function(_0x11baa0){var _0x2731c8=_[_0x27ef('0x31')](_0x11baa0,'id');var _0x337f99=[];var _0x5b673e=[];var _0x4f3a6d=squel[_0x27ef('0x6f')]();_0x4f3a6d[_0x27ef('0x70')](_0x27ef('0x71'))[_0x27ef('0x72')](_0x27ef('0x73'),'tq')[_0x27ef('0x74')](_0x27ef('0x75'),'ut',_0x27ef('0x76'))[_0x27ef('0x41')](_0x27ef('0x77'),_0x325d7d[_0x27ef('0x4b')]['id']);for(var _0x1f72fb=0x0;_0x1f72fb<_0x11baa0[_0x27ef('0x3c')];_0x1f72fb+=0x1){let _0x484c63=_0x11baa0[_0x1f72fb];for(var _0x37c857=0x0;_0x37c857<_0x484c63[_0x27ef('0x68')][_0x27ef('0x3c')];_0x37c857+=0x1){let _0x235836=_0x484c63[_0x27ef('0x68')][_0x37c857];var _0x1cda9a=_0x4f3a6d[_0x27ef('0x78')]();_0x1cda9a[_0x27ef('0x41')]('ut.UserId\x20=\x20?',_0x235836['id']);_0x5b673e['push'](db[_0x27ef('0x79')][_0x27ef('0x36')](_0x1cda9a[_0x27ef('0x7a')](),{'type':db[_0x27ef('0x79')]['QueryTypes'][_0x27ef('0x7b')]})['then'](function(_0x3d3802){if(_0x3d3802[_0x27ef('0x3c')]===0x1){return _0x235836['id'];}else{var _0x1fbf97=_[_0x27ef('0x7c')](_[_0x27ef('0x31')](_0x3d3802,_0x27ef('0x7d')),function(_0x5e8164){return _[_0x27ef('0x7e')](_0x2731c8,_0x5e8164);});if(_0x1fbf97){return _0x235836['id'];}}}));}}return BPromise[_0x27ef('0x7f')](_0x5b673e)[_0x27ef('0x27')](function(_0x21b0d6){_0x337f99=_(_0x337f99)['union'](_0x21b0d6)[_0x27ef('0x80')]()[_0x27ef('0x81')]();return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0x325d7d[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](function(_0x9ab7a2){return db[_0x27ef('0x79')][_0x27ef('0x82')](function(_0x35799a){return _0x9ab7a2[_0x27ef('0x83')](_0x325d7d[_0x27ef('0x36')][_0x27ef('0x67')],{'transaction':_0x35799a})[_0x27ef('0x27')](function(){if(!_[_0x27ef('0x84')](_0x337f99)){return _0x9ab7a2[_0x27ef('0x85')](_0x337f99,{'transaction':_0x35799a});}})[_0x27ef('0x27')](function(){_0x337f99[_0x27ef('0x6e')](function(_0x117e7a){socket[_0x27ef('0x86')](_0x27ef('0x87'),{'UserId':_0x117e7a,'FaxQueueId':_0x9ab7a2['id']});});});});});});})[_0x27ef('0x27')](respondWithStatusCode(_0x46cb09,null))['catch'](handleError(_0x46cb09,null));};exports[_0x27ef('0x88')]=function(_0x474f90,_0x541be5,_0x490910){return db[_0x27ef('0x32')][_0x27ef('0x4e')]({'where':{'id':_0x474f90['params']['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x541be5,null))['then'](function(_0xbd9e27){if(_0xbd9e27){return _0xbd9e27[_0x27ef('0x88')](_0x474f90['body']['ids'],_['omit'](_0x474f90['body'],[_0x27ef('0x67'),'id'])||{})['spread'](function(_0x121d56){for(var _0x50cf13=0x0;_0x50cf13<_0x474f90['body'][_0x27ef('0x67')]['length'];_0x50cf13+=0x1){socket[_0x27ef('0x86')](_0x27ef('0x89'),{'UserId':Number(_0x474f90[_0x27ef('0x50')][_0x27ef('0x67')][_0x50cf13]),'FaxQueueId':Number(_0x474f90[_0x27ef('0x4b')]['id'])});}return _0x121d56;});}})['then'](respondWithResult(_0x541be5,null))['catch'](handleError(_0x541be5,null));};exports[_0x27ef('0x85')]=function(_0x1de133,_0x419c41,_0x29bdfd){return db['FaxQueue']['find']({'where':{'id':_0x1de133[_0x27ef('0x4b')]['id']}})['then'](handleEntityNotFound(_0x419c41,null))['then'](function(_0x3186d9){if(_0x3186d9){return _0x3186d9['removeAgents'](_0x1de133[_0x27ef('0x36')][_0x27ef('0x67')])['then'](function(){if(_[_0x27ef('0x8a')](_0x1de133[_0x27ef('0x36')][_0x27ef('0x67')])){for(var _0x1c6851=0x0;_0x1c6851<_0x1de133['query'][_0x27ef('0x67')][_0x27ef('0x3c')];_0x1c6851+=0x1){socket[_0x27ef('0x86')](_0x27ef('0x87'),{'UserId':Number(_0x1de133[_0x27ef('0x36')][_0x27ef('0x67')][_0x1c6851]),'FaxQueueId':Number(_0x1de133['params']['id'])});}}else{socket[_0x27ef('0x86')](_0x27ef('0x87'),{'UserId':Number(_0x1de133['query'][_0x27ef('0x67')]),'FaxQueueId':Number(_0x1de133[_0x27ef('0x4b')]['id'])});}});}})[_0x27ef('0x27')](respondWithStatusCode(_0x419c41,null))[_0x27ef('0x4a')](handleError(_0x419c41,null));};exports[_0x27ef('0x8b')]=function(_0x1de56c,_0x5bf18e,_0x3dbf2f){var _0x81f758={};var _0x515ca8={};var _0x23569d;var _0x59a433;return db[_0x27ef('0x32')][_0x27ef('0x58')]({'where':{'id':_0x1de56c[_0x27ef('0x4b')]['id']}})[_0x27ef('0x27')](handleEntityNotFound(_0x5bf18e,null))[_0x27ef('0x27')](function(_0x220fbe){if(_0x220fbe){_0x23569d=_0x220fbe;_0x515ca8['model']=_[_0x27ef('0x37')](db[_0x27ef('0x5a')][_0x27ef('0x4c')]);_0x515ca8[_0x27ef('0x36')]=_[_0x27ef('0x37')](_0x1de56c[_0x27ef('0x36')]);_0x515ca8['filters']=_[_0x27ef('0x38')](_0x515ca8[_0x27ef('0x39')],_0x515ca8['query']);_0x81f758[_0x27ef('0x3a')]=_[_0x27ef('0x38')](_0x515ca8[_0x27ef('0x39')],qs[_0x27ef('0x3b')](_0x1de56c[_0x27ef('0x36')]['fields']));_0x81f758['attributes']=_0x81f758[_0x27ef('0x3a')][_0x27ef('0x3c')]?_0x81f758[_0x27ef('0x3a')]:_0x515ca8['model'];_0x81f758[_0x27ef('0x3f')]=qs[_0x27ef('0x40')](_0x1de56c[_0x27ef('0x36')]['sort']);_0x81f758[_0x27ef('0x41')]=qs[_0x27ef('0x42')](_[_0x27ef('0x43')](_0x1de56c[_0x27ef('0x36')],_0x515ca8[_0x27ef('0x42')]));if(_0x1de56c[_0x27ef('0x36')]['filter']){_0x81f758[_0x27ef('0x41')]=_['merge'](_0x81f758[_0x27ef('0x41')],{'$or':_[_0x27ef('0x31')](_0x81f758[_0x27ef('0x3a')],function(_0x189324){var _0x2bafd2={};_0x2bafd2[_0x189324]={'$like':'%'+_0x1de56c[_0x27ef('0x36')][_0x27ef('0x44')]+'%'};return _0x2bafd2;})});}_0x81f758=_[_0x27ef('0x45')]({},_0x81f758,_0x1de56c[_0x27ef('0x4d')]);return _0x23569d[_0x27ef('0x8b')](_0x81f758);}})['then'](function(_0x5c3edb){if(_0x5c3edb){_0x59a433=_0x5c3edb[_0x27ef('0x3c')];if(!_0x1de56c[_0x27ef('0x36')][_0x27ef('0x3d')]('nolimit')){_0x81f758[_0x27ef('0x1f')]=qs[_0x27ef('0x1f')](_0x1de56c[_0x27ef('0x36')]['limit']);_0x81f758['offset']=qs[_0x27ef('0x1e')](_0x1de56c[_0x27ef('0x36')][_0x27ef('0x1e')]);}return _0x23569d[_0x27ef('0x8b')](_0x81f758);}})['then'](function(_0x1ab23f){if(_0x1ab23f){return _0x1ab23f?{'count':_0x59a433,'rows':_0x1ab23f}:null;}})[_0x27ef('0x27')](respondWithResult(_0x5bf18e,null))['catch'](handleError(_0x5bf18e,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 7e7ccdf..93705c8 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 _0x51f3=['setMaxListeners','save','update','remove','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x46fd05,_0x2a121d){var _0xdcbee=function(_0x32967f){while(--_0x32967f){_0x46fd05['push'](_0x46fd05['shift']());}};_0xdcbee(++_0x2a121d);}(_0x51f3,0x66));var _0x351f=function(_0xeb0b2e,_0x2c150b){_0xeb0b2e=_0xeb0b2e-0x0;var _0x33884f=_0x51f3[_0xeb0b2e];return _0x33884f;};'use strict';var EventEmitter=require(_0x351f('0x0'));var FaxQueue=require(_0x351f('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x351f('0x2')](0x0);var events={'afterCreate':_0x351f('0x3'),'afterUpdate':_0x351f('0x4'),'afterDestroy':_0x351f('0x5')};function emitEvent(_0x23b2cb){return function(_0x50cd07,_0x26610b,_0x228c72){FaxQueueEvents['emit'](_0x23b2cb+':'+_0x50cd07['id'],_0x50cd07);FaxQueueEvents['emit'](_0x23b2cb,_0x50cd07);_0x228c72(null);};}for(var e in events){if(events[_0x351f('0x6')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x351f('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0xc89a=['hook','exports','../../mysqldb','update','remove','emit'];(function(_0xcaf5ea,_0x9412fc){var _0xaabcd6=function(_0x3246c4){while(--_0x3246c4){_0xcaf5ea['push'](_0xcaf5ea['shift']());}};_0xaabcd6(++_0x9412fc);}(_0xc89a,0x6e));var _0xac89=function(_0xbd4e93,_0x25b4ca){_0xbd4e93=_0xbd4e93-0x0;var _0x1da352=_0xc89a[_0xbd4e93];return _0x1da352;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xac89('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xac89('0x1'),'afterDestroy':_0xac89('0x2')};function emitEvent(_0x4fbe99){return function(_0x4c5bbd,_0x41f42c,_0x227d16){FaxQueueEvents[_0xac89('0x3')](_0x4fbe99+':'+_0x4c5bbd['id'],_0x4c5bbd);FaxQueueEvents[_0xac89('0x3')](_0x4fbe99,_0x4c5bbd);_0x227d16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xac89('0x4')](e,emitEvent(event));}}module[_0xac89('0x5')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index e9e92f7..c2aa9dc 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 _0xb0ae=['../../config/environment','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x11484b,_0x5023d0){var _0x581264=function(_0x32a6ca){while(--_0x32a6ca){_0x11484b['push'](_0x11484b['shift']());}};_0x581264(++_0x5023d0);}(_0xb0ae,0xc8));var _0xeb0a=function(_0x561ec6,_0x4aed7f){_0x561ec6=_0x561ec6-0x0;var _0x52073a=_0xb0ae[_0x561ec6];return _0x52073a;};'use strict';var _=require(_0xeb0a('0x0'));var util=require(_0xeb0a('0x1'));var logger=require(_0xeb0a('0x2'))(_0xeb0a('0x3'));var moment=require(_0xeb0a('0x4'));var BPromise=require('bluebird');var rp=require(_0xeb0a('0x5'));var fs=require('fs');var path=require(_0xeb0a('0x6'));var rimraf=require(_0xeb0a('0x7'));var config=require(_0xeb0a('0x8'));var attributes=require('./faxQueue.attributes');module[_0xeb0a('0x9')]=function(_0x2052ab,_0x3d351a){return _0x2052ab[_0xeb0a('0xa')](_0xeb0a('0xb'),attributes,{'tableName':_0xeb0a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x66da=['fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','FaxQueue'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x66da,0x1bd));var _0xa66d=function(_0x145b3c,_0x31ea4a){_0x145b3c=_0x145b3c-0x0;var _0x1b6e36=_0x66da[_0x145b3c];return _0x1b6e36;};'use strict';var _=require('lodash');var util=require(_0xa66d('0x0'));var logger=require(_0xa66d('0x1'))(_0xa66d('0x2'));var moment=require(_0xa66d('0x3'));var BPromise=require(_0xa66d('0x4'));var rp=require(_0xa66d('0x5'));var fs=require('fs');var path=require(_0xa66d('0x6'));var rimraf=require(_0xa66d('0x7'));var config=require('../../config/environment');var attributes=require(_0xa66d('0x8'));module[_0xa66d('0x9')]=function(_0x5bab50,_0x403e6a){return _0x5bab50['define'](_0xa66d('0xa'),attributes,{'tableName':_0xa66d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 65afdbc..720a815 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 _0xc8fe=['message','catch','findAll','options','raw','limit','map','include','attributes','model','then','GetFaxQueue','stringify','ShowFaxQueue','where','lodash','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./faxQueue.socket','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','FaxQueue,\x20%s,\x20%s'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0xc8fe,0x1a6));var _0xec8f=function(_0x1cdf3f,_0x502a57){_0x1cdf3f=_0x1cdf3f-0x0;var _0x5afc25=_0xc8fe[_0x1cdf3f];return _0x5afc25;};'use strict';var _=require(_0xec8f('0x0'));var util=require('util');var moment=require(_0xec8f('0x1'));var BPromise=require(_0xec8f('0x2'));var rs=require(_0xec8f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xec8f('0x4'));var jayson=require(_0xec8f('0x5'));var client=jayson[_0xec8f('0x6')][_0xec8f('0x7')]({'port':0x232a});config['redis']=_[_0xec8f('0x8')](config['redis'],{'host':_0xec8f('0x9'),'port':0x18eb});var socket=require(_0xec8f('0xa'))(new Redis(config[_0xec8f('0xb')]));require(_0xec8f('0xc'))[_0xec8f('0xd')](socket);function respondWithRpcPromise(_0x463eb9,_0x4cbc8e,_0x8d38e5){return new BPromise(function(_0x5bdc5e,_0x3eeb4a){return client[_0xec8f('0xe')](_0x463eb9,_0x8d38e5)['then'](function(_0xe4425a){logger[_0xec8f('0xf')]('FaxQueue,\x20%s,\x20%s',_0x4cbc8e,_0xec8f('0x10'));logger[_0xec8f('0x11')](_0xec8f('0x12'),_0x4cbc8e,_0xec8f('0x10'),JSON['stringify'](_0xe4425a));if(_0xe4425a[_0xec8f('0x13')]){if(_0xe4425a[_0xec8f('0x13')][_0xec8f('0x14')]===0x1f4){logger[_0xec8f('0x13')](_0xec8f('0x15'),_0x4cbc8e,_0xe4425a[_0xec8f('0x13')][_0xec8f('0x16')]);return _0x3eeb4a(_0xe4425a[_0xec8f('0x13')][_0xec8f('0x16')]);}logger[_0xec8f('0x13')]('FaxQueue,\x20%s,\x20%s',_0x4cbc8e,_0xe4425a[_0xec8f('0x13')][_0xec8f('0x16')]);return _0x5bdc5e(_0xe4425a[_0xec8f('0x13')][_0xec8f('0x16')]);}else{logger[_0xec8f('0xf')]('FaxQueue,\x20%s,\x20%s',_0x4cbc8e,_0xec8f('0x10'));_0x5bdc5e(_0xe4425a['result'][_0xec8f('0x16')]);}})[_0xec8f('0x17')](function(_0x2035d4){logger[_0xec8f('0x13')](_0xec8f('0x15'),_0x4cbc8e,_0x2035d4);_0x3eeb4a(_0x2035d4);});});}exports['GetFaxQueue']=function(_0x2d2d14){var _0x2e121c=this;return new Promise(function(_0x308528,_0x4381de){return db['FaxQueue'][_0xec8f('0x18')]({'raw':_0x2d2d14['options']?_0x2d2d14[_0xec8f('0x19')][_0xec8f('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d2d14[_0xec8f('0x19')]?_0x2d2d14['options']['where']||null:null,'attributes':_0x2d2d14['options']?_0x2d2d14['options']['attributes']||null:null,'limit':_0x2d2d14['options']?_0x2d2d14[_0xec8f('0x19')][_0xec8f('0x1b')]||null:null,'include':_0x2d2d14['options']?_0x2d2d14['options']['include']?_[_0xec8f('0x1c')](_0x2d2d14[_0xec8f('0x19')][_0xec8f('0x1d')],function(_0x4a9f03){return{'model':db[_0x4a9f03['model']],'as':_0x4a9f03['as'],'attributes':_0x4a9f03[_0xec8f('0x1e')],'include':_0x4a9f03['include']?_[_0xec8f('0x1c')](_0x4a9f03['include'],function(_0x44a4bf){return{'model':db[_0x44a4bf[_0xec8f('0x1f')]],'as':_0x44a4bf['as'],'attributes':_0x44a4bf['attributes'],'include':_0x44a4bf['include']?_['map'](_0x44a4bf[_0xec8f('0x1d')],function(_0x5ee437){return{'model':db[_0x5ee437[_0xec8f('0x1f')]],'as':_0x5ee437['as'],'attributes':_0x5ee437[_0xec8f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xec8f('0x20')](function(_0x2c5e1a){logger[_0xec8f('0xf')]('GetFaxQueue',_0x2d2d14);logger[_0xec8f('0x11')](_0xec8f('0x21'),_0x2d2d14,JSON[_0xec8f('0x22')](_0x2c5e1a));_0x308528(_0x2c5e1a);})[_0xec8f('0x17')](function(_0x41aea7){logger[_0xec8f('0x13')](_0xec8f('0x21'),_0x41aea7['message'],_0x2d2d14);_0x4381de(_0x2e121c['error'](0x1f4,_0x41aea7[_0xec8f('0x16')]));});});};exports[_0xec8f('0x23')]=function(_0x4c12e8){var _0x53885b=this;return new Promise(function(_0x4f8d5d,_0x4a346f){return db['FaxQueue']['find']({'raw':_0x4c12e8[_0xec8f('0x19')]?_0x4c12e8[_0xec8f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4c12e8['options']?_0x4c12e8[_0xec8f('0x19')][_0xec8f('0x24')]||null:null,'attributes':_0x4c12e8[_0xec8f('0x19')]?_0x4c12e8[_0xec8f('0x19')]['attributes']||null:null,'include':_0x4c12e8[_0xec8f('0x19')]?_0x4c12e8['options'][_0xec8f('0x1d')]?_[_0xec8f('0x1c')](_0x4c12e8['options']['include'],function(_0x554f11){return{'model':db[_0x554f11[_0xec8f('0x1f')]],'as':_0x554f11['as'],'attributes':_0x554f11['attributes'],'include':_0x554f11['include']?_[_0xec8f('0x1c')](_0x554f11[_0xec8f('0x1d')],function(_0x1ab999){return{'model':db[_0x1ab999['model']],'as':_0x1ab999['as'],'attributes':_0x1ab999['attributes'],'include':_0x1ab999['include']?_[_0xec8f('0x1c')](_0x1ab999[_0xec8f('0x1d')],function(_0x2a4d58){return{'model':db[_0x2a4d58[_0xec8f('0x1f')]],'as':_0x2a4d58['as'],'attributes':_0x2a4d58[_0xec8f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x372db3){logger[_0xec8f('0xf')](_0xec8f('0x23'),_0x4c12e8);logger['debug']('ShowFaxQueue',_0x4c12e8,JSON['stringify'](_0x372db3));_0x4f8d5d(_0x372db3);})[_0xec8f('0x17')](function(_0x5f4b15){logger[_0xec8f('0x13')](_0xec8f('0x23'),_0x5f4b15[_0xec8f('0x16')],_0x4c12e8);_0x4a346f(_0x53885b['error'](0x1f4,_0x5f4b15[_0xec8f('0x16')]));});});}; \ No newline at end of file +var _0x75d5=['error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','include','map','model','stringify','ShowFaxQueue','find','debug','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s'];(function(_0xdf3db6,_0x2a1952){var _0x4b7a65=function(_0x2953be){while(--_0x2953be){_0xdf3db6['push'](_0xdf3db6['shift']());}};_0x4b7a65(++_0x2a1952);}(_0x75d5,0x1a9));var _0x575d=function(_0x4a5bd2,_0x5e14ee){_0x4a5bd2=_0x4a5bd2-0x0;var _0x145e70=_0x75d5[_0x4a5bd2];return _0x145e70;};'use strict';var _=require(_0x575d('0x0'));var util=require(_0x575d('0x1'));var moment=require(_0x575d('0x2'));var BPromise=require(_0x575d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x575d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x575d('0x5'))(_0x575d('0x6'));var config=require('../../config/environment');var jayson=require(_0x575d('0x7'));var client=jayson[_0x575d('0x8')][_0x575d('0x9')]({'port':0x232a});config[_0x575d('0xa')]=_[_0x575d('0xb')](config[_0x575d('0xa')],{'host':_0x575d('0xc'),'port':0x18eb});var socket=require(_0x575d('0xd'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x28b618,_0x546235,_0x259713){return new BPromise(function(_0x2943de,_0x305c40){return client['request'](_0x28b618,_0x259713)[_0x575d('0xe')](function(_0x282b71){logger[_0x575d('0xf')](_0x575d('0x10'),_0x546235,_0x575d('0x11'));logger['debug'](_0x575d('0x12'),_0x546235,_0x575d('0x11'),JSON['stringify'](_0x282b71));if(_0x282b71[_0x575d('0x13')]){if(_0x282b71['error'][_0x575d('0x14')]===0x1f4){logger[_0x575d('0x13')](_0x575d('0x10'),_0x546235,_0x282b71[_0x575d('0x13')][_0x575d('0x15')]);return _0x305c40(_0x282b71[_0x575d('0x13')][_0x575d('0x15')]);}logger['error'](_0x575d('0x10'),_0x546235,_0x282b71[_0x575d('0x13')]['message']);return _0x2943de(_0x282b71['error'][_0x575d('0x15')]);}else{logger[_0x575d('0xf')](_0x575d('0x10'),_0x546235,_0x575d('0x11'));_0x2943de(_0x282b71[_0x575d('0x16')]['message']);}})[_0x575d('0x17')](function(_0x4dcb71){logger['error'](_0x575d('0x10'),_0x546235,_0x4dcb71);_0x305c40(_0x4dcb71);});});}exports[_0x575d('0x18')]=function(_0x241ecd){var _0x3561c1=this;return new Promise(function(_0x5de5b6,_0x45b690){return db[_0x575d('0x19')][_0x575d('0x1a')]({'raw':_0x241ecd[_0x575d('0x1b')]?_0x241ecd[_0x575d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x241ecd[_0x575d('0x1b')]?_0x241ecd['options'][_0x575d('0x1c')]||null:null,'attributes':_0x241ecd[_0x575d('0x1b')]?_0x241ecd[_0x575d('0x1b')][_0x575d('0x1d')]||null:null,'limit':_0x241ecd[_0x575d('0x1b')]?_0x241ecd[_0x575d('0x1b')]['limit']||null:null,'include':_0x241ecd[_0x575d('0x1b')]?_0x241ecd['options'][_0x575d('0x1e')]?_[_0x575d('0x1f')](_0x241ecd[_0x575d('0x1b')][_0x575d('0x1e')],function(_0xbf0284){return{'model':db[_0xbf0284[_0x575d('0x20')]],'as':_0xbf0284['as'],'attributes':_0xbf0284[_0x575d('0x1d')],'include':_0xbf0284['include']?_[_0x575d('0x1f')](_0xbf0284['include'],function(_0x5f0fd9){return{'model':db[_0x5f0fd9[_0x575d('0x20')]],'as':_0x5f0fd9['as'],'attributes':_0x5f0fd9[_0x575d('0x1d')],'include':_0x5f0fd9['include']?_[_0x575d('0x1f')](_0x5f0fd9[_0x575d('0x1e')],function(_0x15dc2b){return{'model':db[_0x15dc2b[_0x575d('0x20')]],'as':_0x15dc2b['as'],'attributes':_0x15dc2b[_0x575d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x575d('0xe')](function(_0x1026d3){logger['info'](_0x575d('0x18'),_0x241ecd);logger['debug']('GetFaxQueue',_0x241ecd,JSON[_0x575d('0x21')](_0x1026d3));_0x5de5b6(_0x1026d3);})[_0x575d('0x17')](function(_0x38c081){logger[_0x575d('0x13')](_0x575d('0x18'),_0x38c081['message'],_0x241ecd);_0x45b690(_0x3561c1[_0x575d('0x13')](0x1f4,_0x38c081['message']));});});};exports[_0x575d('0x22')]=function(_0x330055){var _0x12334a=this;return new Promise(function(_0x4ff248,_0x549b71){return db['FaxQueue'][_0x575d('0x23')]({'raw':_0x330055[_0x575d('0x1b')]?_0x330055['options']['raw']===undefined?!![]:![]:!![],'where':_0x330055[_0x575d('0x1b')]?_0x330055['options'][_0x575d('0x1c')]||null:null,'attributes':_0x330055[_0x575d('0x1b')]?_0x330055[_0x575d('0x1b')][_0x575d('0x1d')]||null:null,'include':_0x330055['options']?_0x330055[_0x575d('0x1b')][_0x575d('0x1e')]?_[_0x575d('0x1f')](_0x330055[_0x575d('0x1b')][_0x575d('0x1e')],function(_0x12911b){return{'model':db[_0x12911b[_0x575d('0x20')]],'as':_0x12911b['as'],'attributes':_0x12911b[_0x575d('0x1d')],'include':_0x12911b[_0x575d('0x1e')]?_['map'](_0x12911b['include'],function(_0x28f908){return{'model':db[_0x28f908['model']],'as':_0x28f908['as'],'attributes':_0x28f908['attributes'],'include':_0x28f908[_0x575d('0x1e')]?_['map'](_0x28f908[_0x575d('0x1e')],function(_0x572c34){return{'model':db[_0x572c34[_0x575d('0x20')]],'as':_0x572c34['as'],'attributes':_0x572c34[_0x575d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d209a){logger['info'](_0x575d('0x22'),_0x330055);logger[_0x575d('0x24')](_0x575d('0x22'),_0x330055,JSON[_0x575d('0x21')](_0x3d209a));_0x4ff248(_0x3d209a);})[_0x575d('0x17')](function(_0x3dd98f){logger[_0x575d('0x13')](_0x575d('0x22'),_0x3dd98f[_0x575d('0x15')],_0x330055);_0x549b71(_0x12334a[_0x575d('0x13')](0x1f4,_0x3dd98f['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index ceea87d..61744af 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 _0x7722=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x2ef1e4,_0x3a92f9){var _0x5757bf=function(_0xe58422){while(--_0xe58422){_0x2ef1e4['push'](_0x2ef1e4['shift']());}};_0x5757bf(++_0x3a92f9);}(_0x7722,0xdd));var _0x2772=function(_0x381538,_0x444fe3){_0x381538=_0x381538-0x0;var _0x3c5884=_0x7722[_0x381538];return _0x3c5884;};'use strict';var FaxQueueEvents=require(_0x2772('0x0'));var events=[_0x2772('0x1'),_0x2772('0x2'),'update'];function createListener(_0x106d7f,_0x5672a9){return function(_0x36f25a){_0x5672a9[_0x2772('0x3')](_0x106d7f,_0x36f25a);};}function removeListener(_0x61b780,_0x4079f9){return function(){FaxQueueEvents[_0x2772('0x4')](_0x61b780,_0x4079f9);};}exports[_0x2772('0x5')]=function(_0x4012c8){for(var _0x375b5a=0x0,_0x5333fc=events[_0x2772('0x6')];_0x375b5a<_0x5333fc;_0x375b5a++){var _0x204d74=events[_0x375b5a];var _0x5bae83=createListener(_0x2772('0x7')+_0x204d74,_0x4012c8);FaxQueueEvents['on'](_0x204d74,_0x5bae83);}}; \ No newline at end of file +var _0x0c75=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c75,0x185));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';var FaxQueueEvents=require(_0x50c7('0x0'));var events=[_0x50c7('0x1'),_0x50c7('0x2'),'update'];function createListener(_0x255f69,_0x3f81f7){return function(_0x316b7d){_0x3f81f7[_0x50c7('0x3')](_0x255f69,_0x316b7d);};}function removeListener(_0x5beff8,_0x467915){return function(){FaxQueueEvents[_0x50c7('0x4')](_0x5beff8,_0x467915);};}exports[_0x50c7('0x5')]=function(_0x429489){for(var _0x58016c=0x0,_0x3a4f88=events[_0x50c7('0x6')];_0x58016c<_0x3a4f88;_0x58016c++){var _0x58d137=events[_0x58016c];var _0x3b73c4=createListener(_0x50c7('0x7')+_0x58d137,_0x429489);FaxQueueEvents['on'](_0x58d137,_0x3b73c4);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index e346547..33cf25e 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 _0xaf1b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getTeams','/:id/users','getAgents','create','post','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x13841b,_0x551a20){var _0x388a17=function(_0xb7fe61){while(--_0xb7fe61){_0x13841b['push'](_0x13841b['shift']());}};_0x388a17(++_0x551a20);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x5c34e6,_0x1a75ce){_0x5c34e6=_0x5c34e6-0x0;var _0x177d2b=_0xaf1b[_0x5c34e6];return _0x177d2b;};'use strict';var multer=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var path=require(_0xbaf1('0x2'));var timeout=require(_0xbaf1('0x3'));var express=require(_0xbaf1('0x4'));var router=express[_0xbaf1('0x5')]();var fs_extra=require(_0xbaf1('0x6'));var auth=require(_0xbaf1('0x7'));var interaction=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var controller=require(_0xbaf1('0xa'));router[_0xbaf1('0xb')]('/',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0xd')]);router['get'](_0xbaf1('0xe'),auth['isAuthenticated'](),controller[_0xbaf1('0xf')]);router['get'](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x11')]);router['get'](_0xbaf1('0x12'),auth[_0xbaf1('0xc')](),controller['getMembers']);router[_0xbaf1('0xb')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x13')]);router[_0xbaf1('0xb')](_0xbaf1('0x14'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbaf1('0x16')]);router[_0xbaf1('0x17')](_0xbaf1('0x18'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x19')]);router[_0xbaf1('0x17')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1a')]);router[_0xbaf1('0x1b')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1c')]);router[_0xbaf1('0x1d')](_0xbaf1('0x10'),auth[_0xbaf1('0xc')](),controller['destroy']);router[_0xbaf1('0x1d')]('/:id/teams',auth[_0xbaf1('0xc')](),controller[_0xbaf1('0x1e')]);router[_0xbaf1('0x1d')](_0xbaf1('0x14'),auth['isAuthenticated'](),controller[_0xbaf1('0x1f')]);module['exports']=router; \ No newline at end of file +var _0x9fe7=['show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','index','/describe','describe','/:id','isAuthenticated'];(function(_0x1ce679,_0x50880e){var _0x168e70=function(_0x75fc75){while(--_0x75fc75){_0x1ce679['push'](_0x1ce679['shift']());}};_0x168e70(++_0x50880e);}(_0x9fe7,0x1df));var _0x79fe=function(_0x29a332,_0x841cd3){_0x29a332=_0x29a332-0x0;var _0xc2c815=_0x9fe7[_0x29a332];return _0xc2c815;};'use strict';var multer=require(_0x79fe('0x0'));var util=require(_0x79fe('0x1'));var path=require('path');var timeout=require(_0x79fe('0x2'));var express=require('express');var router=express[_0x79fe('0x3')]();var fs_extra=require(_0x79fe('0x4'));var auth=require(_0x79fe('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x79fe('0x6'));var controller=require(_0x79fe('0x7'));router[_0x79fe('0x8')]('/',auth['isAuthenticated'](),controller[_0x79fe('0x9')]);router[_0x79fe('0x8')](_0x79fe('0xa'),auth['isAuthenticated'](),controller[_0x79fe('0xb')]);router[_0x79fe('0x8')](_0x79fe('0xc'),auth[_0x79fe('0xd')](),controller[_0x79fe('0xe')]);router['get'](_0x79fe('0xf'),auth[_0x79fe('0xd')](),controller['getMembers']);router[_0x79fe('0x8')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x11')]);router['get'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x13')]);router[_0x79fe('0x14')]('/',auth[_0x79fe('0xd')](),controller[_0x79fe('0x15')]);router[_0x79fe('0x14')](_0x79fe('0x10'),auth['isAuthenticated'](),controller[_0x79fe('0x16')]);router[_0x79fe('0x14')](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x17')]);router[_0x79fe('0x18')]('/:id',auth[_0x79fe('0xd')](),controller[_0x79fe('0x19')]);router[_0x79fe('0x1a')](_0x79fe('0xc'),auth['isAuthenticated'](),controller[_0x79fe('0x1b')]);router[_0x79fe('0x1a')](_0x79fe('0x10'),auth[_0x79fe('0xd')](),controller['removeTeams']);router['delete'](_0x79fe('0x12'),auth[_0x79fe('0xd')](),controller[_0x79fe('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 3e5e304..f2c411c 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 _0x55ad=['DATE','moment','exports','STRING'];(function(_0x1a46a3,_0x3b9fc0){var _0xbdf881=function(_0x375103){while(--_0x375103){_0x1a46a3['push'](_0x1a46a3['shift']());}};_0xbdf881(++_0x3b9fc0);}(_0x55ad,0x1dd));var _0xd55a=function(_0x37b803,_0xb94c63){_0x37b803=_0x37b803-0x0;var _0x20a0f1=_0x55ad[_0x37b803];return _0x20a0f1;};'use strict';var moment=require(_0xd55a('0x0'));var Sequelize=require('sequelize');module[_0xd55a('0x1')]={'uniqueid':{'type':Sequelize[_0xd55a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd55a('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd55a('0x3')]},'acceptAt':{'type':Sequelize[_0xd55a('0x3')]},'exitAt':{'type':Sequelize[_0xd55a('0x3')]},'reason':{'type':Sequelize[_0xd55a('0x2')]}}; \ No newline at end of file +var _0x3ed6=['STRING','DATE','moment','exports'];(function(_0x2ba4aa,_0x3c30c0){var _0x43cd33=function(_0x3c06ae){while(--_0x3c06ae){_0x2ba4aa['push'](_0x2ba4aa['shift']());}};_0x43cd33(++_0x3c30c0);}(_0x3ed6,0x1c2));var _0x63ed=function(_0xeffb20,_0x32af68){_0xeffb20=_0xeffb20-0x0;var _0x4ec0f8=_0x3ed6[_0xeffb20];return _0x4ec0f8;};'use strict';var moment=require(_0x63ed('0x0'));var Sequelize=require('sequelize');module[_0x63ed('0x1')]={'uniqueid':{'type':Sequelize[_0x63ed('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x63ed('0x2')]},'joinAt':{'type':Sequelize[_0x63ed('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x63ed('0x3')]},'exitAt':{'type':Sequelize[_0x63ed('0x3')]},'reason':{'type':Sequelize[_0x63ed('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index ae00d76..a3a6f9e 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 _0x9090=['sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','FaxQueueReport','type','key','keys','query','filters','intersection','model','attributes','fields','length','order'];(function(_0x50c497,_0x46cfe1){var _0x32f046=function(_0x38ea2b){while(--_0x38ea2b){_0x50c497['push'](_0x50c497['shift']());}};_0x32f046(++_0x46cfe1);}(_0x9090,0x17f));var _0x0909=function(_0x5a5468,_0xbd874a){_0x5a5468=_0x5a5468-0x0;var _0x3c009c=_0x9090[_0x5a5468];return _0x3c009c;};'use strict';var emlformat=require(_0x0909('0x0'));var rimraf=require(_0x0909('0x1'));var zipdir=require(_0x0909('0x2'));var jsonpatch=require(_0x0909('0x3'));var rp=require(_0x0909('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0909('0x5'));var util=require(_0x0909('0x6'));var path=require(_0x0909('0x7'));var sox=require('sox');var csv=require(_0x0909('0x8'));var ejs=require(_0x0909('0x9'));var fs=require('fs');var fs_extra=require(_0x0909('0xa'));var _=require(_0x0909('0xb'));var squel=require(_0x0909('0xc'));var crypto=require(_0x0909('0xd'));var jsforce=require(_0x0909('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0909('0x8'));var querystring=require(_0x0909('0xf'));var Papa=require('papaparse');var Redis=require(_0x0909('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0909('0x11'));var as=require(_0x0909('0x12'));var hardwareService=require(_0x0909('0x13'));var logger=require(_0x0909('0x14'))('api');var utils=require(_0x0909('0x15'));var config=require(_0x0909('0x16'));var licenseUtil=require(_0x0909('0x17'));var db=require(_0x0909('0x18'))['db'];function respondWithStatusCode(_0x4e900a,_0x32f71a){_0x32f71a=_0x32f71a||0xcc;return function(_0x18c223){if(_0x18c223){return _0x4e900a[_0x0909('0x19')](_0x32f71a);}return _0x4e900a[_0x0909('0x1a')](_0x32f71a)[_0x0909('0x1b')]();};}function respondWithResult(_0xad78e9,_0x3bdd30){_0x3bdd30=_0x3bdd30||0xc8;return function(_0x1811da){if(_0x1811da){return _0xad78e9[_0x0909('0x1a')](_0x3bdd30)[_0x0909('0x1c')](_0x1811da);}};}function respondWithFilteredResult(_0x48ee40,_0x2c5892){return function(_0x1eb8be){if(_0x1eb8be){var _0x96edb6=typeof _0x2c5892[_0x0909('0x1d')]===_0x0909('0x1e')&&typeof _0x2c5892[_0x0909('0x1f')]===_0x0909('0x1e');var _0x14e44c=_0x1eb8be['count'];var _0x3a7089=_0x96edb6?0x0:_0x2c5892[_0x0909('0x1d')];var _0x14976d=_0x96edb6?_0x1eb8be['count']:_0x2c5892[_0x0909('0x1d')]+_0x2c5892[_0x0909('0x1f')];var _0x11455d;if(_0x14976d>=_0x14e44c){_0x14976d=_0x14e44c;_0x11455d=0xc8;}else{_0x11455d=0xce;}_0x48ee40['status'](_0x11455d);return _0x48ee40['set'](_0x0909('0x20'),_0x3a7089+'-'+_0x14976d+'/'+_0x14e44c)['json'](_0x1eb8be);}return null;};}function patchUpdates(_0xf0efcb){return function(_0x2ccf21){try{jsonpatch[_0x0909('0x21')](_0x2ccf21,_0xf0efcb,!![]);}catch(_0x3037c1){return BPromise[_0x0909('0x22')](_0x3037c1);}return _0x2ccf21[_0x0909('0x23')]();};}function saveUpdates(_0x4eec68,_0x46b384){return function(_0x519c9f){if(_0x519c9f){return _0x519c9f[_0x0909('0x24')](_0x4eec68)[_0x0909('0x25')](function(_0x2ea745){return _0x2ea745;});}return null;};}function removeEntity(_0x3e71b9,_0x332b07){return function(_0x510ba6){if(_0x510ba6){return _0x510ba6[_0x0909('0x26')]()[_0x0909('0x25')](function(){_0x3e71b9[_0x0909('0x1a')](0xcc)[_0x0909('0x1b')]();});}};}function handleEntityNotFound(_0xc879d8,_0x53d139){return function(_0x17d9a7){if(!_0x17d9a7){_0xc879d8[_0x0909('0x19')](0x194);}return _0x17d9a7;};}function handleError(_0x202b4c,_0x165847){_0x165847=_0x165847||0x1f4;return function(_0x59bee7){logger[_0x0909('0x27')](_0x59bee7['stack']);if(_0x59bee7['name']){delete _0x59bee7[_0x0909('0x28')];}_0x202b4c[_0x0909('0x1a')](_0x165847)['send'](_0x59bee7);};}exports[_0x0909('0x29')]=function(_0x33ce47,_0x28daaf){var _0x512d7e={},_0x3c7d32={},_0x2775a4={'count':0x0,'rows':[]};var _0xbc1276=_[_0x0909('0x2a')](db[_0x0909('0x2b')]['rawAttributes'],function(_0x1bd9ae){return{'name':_0x1bd9ae['fieldName'],'type':_0x1bd9ae[_0x0909('0x2c')][_0x0909('0x2d')]};});_0x3c7d32['model']=_[_0x0909('0x2a')](_0xbc1276,_0x0909('0x28'));_0x3c7d32['query']=_[_0x0909('0x2e')](_0x33ce47[_0x0909('0x2f')]);_0x3c7d32[_0x0909('0x30')]=_[_0x0909('0x31')](_0x3c7d32[_0x0909('0x32')],_0x3c7d32['query']);_0x512d7e[_0x0909('0x33')]=_[_0x0909('0x31')](_0x3c7d32[_0x0909('0x32')],qs[_0x0909('0x34')](_0x33ce47['query'][_0x0909('0x34')]));_0x512d7e[_0x0909('0x33')]=_0x512d7e[_0x0909('0x33')][_0x0909('0x35')]?_0x512d7e[_0x0909('0x33')]:_0x3c7d32[_0x0909('0x32')];if(!_0x33ce47[_0x0909('0x2f')]['hasOwnProperty']('nolimit')){_0x512d7e[_0x0909('0x1f')]=qs[_0x0909('0x1f')](_0x33ce47[_0x0909('0x2f')][_0x0909('0x1f')]);_0x512d7e[_0x0909('0x1d')]=qs['offset'](_0x33ce47[_0x0909('0x2f')]['offset']);}_0x512d7e[_0x0909('0x36')]=qs[_0x0909('0x37')](_0x33ce47[_0x0909('0x2f')][_0x0909('0x37')]);_0x512d7e[_0x0909('0x38')]=qs['filters'](_[_0x0909('0x39')](_0x33ce47['query'],_0x3c7d32[_0x0909('0x30')]),_0xbc1276);if(_0x33ce47[_0x0909('0x2f')][_0x0909('0x3a')]){_0x512d7e[_0x0909('0x38')]=_[_0x0909('0x3b')](_0x512d7e[_0x0909('0x38')],{'$or':_[_0x0909('0x2a')](_0xbc1276,function(_0x224c65){if(_0x224c65[_0x0909('0x2c')]!==_0x0909('0x3c')){var _0x547a66={};_0x547a66[_0x224c65[_0x0909('0x28')]]={'$like':'%'+_0x33ce47['query'][_0x0909('0x3a')]+'%'};return _0x547a66;}})});}_0x512d7e=_['merge']({},_0x512d7e,_0x33ce47[_0x0909('0x3d')]);var _0x31540b={'where':_0x512d7e[_0x0909('0x38')]};return db[_0x0909('0x2b')][_0x0909('0x3e')](_0x31540b)[_0x0909('0x25')](function(_0x190ef2){_0x2775a4[_0x0909('0x3e')]=_0x190ef2;if(_0x33ce47[_0x0909('0x2f')]['includeAll']){_0x512d7e[_0x0909('0x3f')]=[{'all':!![]}];}return db['FaxQueueReport'][_0x0909('0x40')](_0x512d7e);})['then'](function(_0x347bde){_0x2775a4[_0x0909('0x41')]=_0x347bde;return _0x2775a4;})[_0x0909('0x25')](respondWithFilteredResult(_0x28daaf,_0x512d7e))[_0x0909('0x42')](handleError(_0x28daaf,null));};exports['show']=function(_0x12caad,_0x196b13){var _0x1ea9f9={'raw':!![],'where':{'id':_0x12caad[_0x0909('0x43')]['id']}},_0x3e808e={};_0x3e808e['model']=_[_0x0909('0x2e')](db[_0x0909('0x2b')]['rawAttributes']);_0x3e808e[_0x0909('0x2f')]=_['keys'](_0x12caad[_0x0909('0x2f')]);_0x3e808e['filters']=_['intersection'](_0x3e808e[_0x0909('0x32')],_0x3e808e[_0x0909('0x2f')]);_0x1ea9f9['attributes']=_['intersection'](_0x3e808e[_0x0909('0x32')],qs['fields'](_0x12caad[_0x0909('0x2f')][_0x0909('0x34')]));_0x1ea9f9['attributes']=_0x1ea9f9['attributes']['length']?_0x1ea9f9[_0x0909('0x33')]:_0x3e808e[_0x0909('0x32')];if(_0x12caad[_0x0909('0x2f')][_0x0909('0x44')]){_0x1ea9f9['include']=[{'all':!![]}];}_0x1ea9f9=_[_0x0909('0x3b')]({},_0x1ea9f9,_0x12caad[_0x0909('0x3d')]);return db[_0x0909('0x2b')][_0x0909('0x45')](_0x1ea9f9)['then'](handleEntityNotFound(_0x196b13,null))['then'](respondWithResult(_0x196b13,null))[_0x0909('0x42')](handleError(_0x196b13,null));};exports[_0x0909('0x46')]=function(_0x3218c6,_0x285863){return db[_0x0909('0x2b')][_0x0909('0x46')](_0x3218c6[_0x0909('0x47')],{})[_0x0909('0x25')](respondWithResult(_0x285863,0xc9))['catch'](handleError(_0x285863,null));};exports[_0x0909('0x24')]=function(_0x2eaf27,_0x5e8f34){if(_0x2eaf27[_0x0909('0x47')]['id']){delete _0x2eaf27['body']['id'];}return db[_0x0909('0x2b')][_0x0909('0x45')]({'where':{'id':_0x2eaf27[_0x0909('0x43')]['id']}})[_0x0909('0x25')](handleEntityNotFound(_0x5e8f34,null))[_0x0909('0x25')](saveUpdates(_0x2eaf27[_0x0909('0x47')],null))[_0x0909('0x25')](respondWithResult(_0x5e8f34,null))['catch'](handleError(_0x5e8f34,null));};exports[_0x0909('0x26')]=function(_0x253884,_0x16c20a){return db[_0x0909('0x2b')][_0x0909('0x45')]({'where':{'id':_0x253884[_0x0909('0x43')]['id']}})['then'](handleEntityNotFound(_0x16c20a,null))[_0x0909('0x25')](removeEntity(_0x16c20a,null))['catch'](handleError(_0x16c20a,null));};exports['describe']=function(_0x5c0974,_0x5cf171){return db[_0x0909('0x2b')][_0x0909('0x48')]()['then'](respondWithResult(_0x5cf171,null))['catch'](handleError(_0x5cf171,null));}; \ No newline at end of file +var _0x8ccb=['lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','then','error','stack','send','FaxQueueReport','rawAttributes','type','model','name','query','filters','intersection','attributes','nolimit','order','sort','where','pick','merge','map','VIRTUAL','includeAll','findAll','rows','keys','fields','include','options','find','create','catch','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra'];(function(_0x5e9590,_0x390b30){var _0x3d0ecd=function(_0x4a1738){while(--_0x4a1738){_0x5e9590['push'](_0x5e9590['shift']());}};_0x3d0ecd(++_0x390b30);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x8ccb[_0x45d55e];return _0x29812a;};'use strict';var emlformat=require(_0xb8cc('0x0'));var rimraf=require(_0xb8cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8cc('0x2'));var rp=require(_0xb8cc('0x3'));var moment=require(_0xb8cc('0x4'));var BPromise=require(_0xb8cc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb8cc('0x6'));var sox=require(_0xb8cc('0x7'));var csv=require(_0xb8cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb8cc('0x9'));var _=require(_0xb8cc('0xa'));var squel=require(_0xb8cc('0xb'));var crypto=require('crypto');var jsforce=require(_0xb8cc('0xc'));var deskjs=require(_0xb8cc('0xd'));var toCsv=require(_0xb8cc('0x8'));var querystring=require('querystring');var Papa=require(_0xb8cc('0xe'));var Redis=require(_0xb8cc('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb8cc('0x10'));var hardwareService=require(_0xb8cc('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb8cc('0x12'));var config=require(_0xb8cc('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xb8cc('0x14'))['db'];function respondWithStatusCode(_0x2c1cbc,_0xfd89e0){_0xfd89e0=_0xfd89e0||0xcc;return function(_0x2875e0){if(_0x2875e0){return _0x2c1cbc[_0xb8cc('0x15')](_0xfd89e0);}return _0x2c1cbc[_0xb8cc('0x16')](_0xfd89e0)[_0xb8cc('0x17')]();};}function respondWithResult(_0x4983ae,_0x11ecf2){_0x11ecf2=_0x11ecf2||0xc8;return function(_0x5ec8a7){if(_0x5ec8a7){return _0x4983ae[_0xb8cc('0x16')](_0x11ecf2)[_0xb8cc('0x18')](_0x5ec8a7);}};}function respondWithFilteredResult(_0x183056,_0x5f3b91){return function(_0x1f8b8d){if(_0x1f8b8d){var _0x274cab=typeof _0x5f3b91[_0xb8cc('0x19')]==='undefined'&&typeof _0x5f3b91[_0xb8cc('0x1a')]==='undefined';var _0x131c44=_0x1f8b8d['count'];var _0x2ac4cc=_0x274cab?0x0:_0x5f3b91[_0xb8cc('0x19')];var _0x2b7130=_0x274cab?_0x1f8b8d[_0xb8cc('0x1b')]:_0x5f3b91[_0xb8cc('0x19')]+_0x5f3b91['limit'];var _0x1c1022;if(_0x2b7130>=_0x131c44){_0x2b7130=_0x131c44;_0x1c1022=0xc8;}else{_0x1c1022=0xce;}_0x183056[_0xb8cc('0x16')](_0x1c1022);return _0x183056[_0xb8cc('0x1c')]('Content-Range',_0x2ac4cc+'-'+_0x2b7130+'/'+_0x131c44)[_0xb8cc('0x18')](_0x1f8b8d);}return null;};}function patchUpdates(_0x1a81b4){return function(_0x4a7aac){try{jsonpatch[_0xb8cc('0x1d')](_0x4a7aac,_0x1a81b4,!![]);}catch(_0xe5ad50){return BPromise['reject'](_0xe5ad50);}return _0x4a7aac[_0xb8cc('0x1e')]();};}function saveUpdates(_0xdcb33d,_0xd1c676){return function(_0x1d372c){if(_0x1d372c){return _0x1d372c[_0xb8cc('0x1f')](_0xdcb33d)[_0xb8cc('0x20')](function(_0x1a0467){return _0x1a0467;});}return null;};}function removeEntity(_0x59608c,_0x50aa38){return function(_0x8b6b21){if(_0x8b6b21){return _0x8b6b21['destroy']()[_0xb8cc('0x20')](function(){_0x59608c['status'](0xcc)[_0xb8cc('0x17')]();});}};}function handleEntityNotFound(_0xbb1918,_0x335f32){return function(_0x77a162){if(!_0x77a162){_0xbb1918['sendStatus'](0x194);}return _0x77a162;};}function handleError(_0x2c4aa0,_0x2cc7f3){_0x2cc7f3=_0x2cc7f3||0x1f4;return function(_0x400de6){logger[_0xb8cc('0x21')](_0x400de6[_0xb8cc('0x22')]);if(_0x400de6['name']){delete _0x400de6['name'];}_0x2c4aa0[_0xb8cc('0x16')](_0x2cc7f3)[_0xb8cc('0x23')](_0x400de6);};}exports['index']=function(_0x3e4a37,_0x5cc936){var _0x23f204={},_0x2634a4={},_0x1d1514={'count':0x0,'rows':[]};var _0x118a18=_['map'](db[_0xb8cc('0x24')][_0xb8cc('0x25')],function(_0x282579){return{'name':_0x282579['fieldName'],'type':_0x282579[_0xb8cc('0x26')]['key']};});_0x2634a4[_0xb8cc('0x27')]=_['map'](_0x118a18,_0xb8cc('0x28'));_0x2634a4[_0xb8cc('0x29')]=_['keys'](_0x3e4a37[_0xb8cc('0x29')]);_0x2634a4[_0xb8cc('0x2a')]=_[_0xb8cc('0x2b')](_0x2634a4[_0xb8cc('0x27')],_0x2634a4[_0xb8cc('0x29')]);_0x23f204[_0xb8cc('0x2c')]=_[_0xb8cc('0x2b')](_0x2634a4['model'],qs['fields'](_0x3e4a37[_0xb8cc('0x29')]['fields']));_0x23f204[_0xb8cc('0x2c')]=_0x23f204['attributes']['length']?_0x23f204[_0xb8cc('0x2c')]:_0x2634a4[_0xb8cc('0x27')];if(!_0x3e4a37[_0xb8cc('0x29')]['hasOwnProperty'](_0xb8cc('0x2d'))){_0x23f204[_0xb8cc('0x1a')]=qs[_0xb8cc('0x1a')](_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x1a')]);_0x23f204[_0xb8cc('0x19')]=qs[_0xb8cc('0x19')](_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x19')]);}_0x23f204[_0xb8cc('0x2e')]=qs[_0xb8cc('0x2f')](_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x2f')]);_0x23f204[_0xb8cc('0x30')]=qs[_0xb8cc('0x2a')](_[_0xb8cc('0x31')](_0x3e4a37[_0xb8cc('0x29')],_0x2634a4[_0xb8cc('0x2a')]),_0x118a18);if(_0x3e4a37['query']['filter']){_0x23f204[_0xb8cc('0x30')]=_[_0xb8cc('0x32')](_0x23f204[_0xb8cc('0x30')],{'$or':_[_0xb8cc('0x33')](_0x118a18,function(_0x25cde5){if(_0x25cde5[_0xb8cc('0x26')]!==_0xb8cc('0x34')){var _0x1564e9={};_0x1564e9[_0x25cde5[_0xb8cc('0x28')]]={'$like':'%'+_0x3e4a37['query']['filter']+'%'};return _0x1564e9;}})});}_0x23f204=_['merge']({},_0x23f204,_0x3e4a37['options']);var _0xf7a2c={'where':_0x23f204['where']};return db[_0xb8cc('0x24')]['count'](_0xf7a2c)[_0xb8cc('0x20')](function(_0x23ece3){_0x1d1514[_0xb8cc('0x1b')]=_0x23ece3;if(_0x3e4a37[_0xb8cc('0x29')][_0xb8cc('0x35')]){_0x23f204['include']=[{'all':!![]}];}return db[_0xb8cc('0x24')][_0xb8cc('0x36')](_0x23f204);})[_0xb8cc('0x20')](function(_0x4d8942){_0x1d1514[_0xb8cc('0x37')]=_0x4d8942;return _0x1d1514;})['then'](respondWithFilteredResult(_0x5cc936,_0x23f204))['catch'](handleError(_0x5cc936,null));};exports['show']=function(_0x143679,_0xd54827){var _0x3d2f26={'raw':!![],'where':{'id':_0x143679['params']['id']}},_0x3f3a96={};_0x3f3a96['model']=_[_0xb8cc('0x38')](db['FaxQueueReport']['rawAttributes']);_0x3f3a96[_0xb8cc('0x29')]=_[_0xb8cc('0x38')](_0x143679[_0xb8cc('0x29')]);_0x3f3a96[_0xb8cc('0x2a')]=_['intersection'](_0x3f3a96[_0xb8cc('0x27')],_0x3f3a96[_0xb8cc('0x29')]);_0x3d2f26['attributes']=_[_0xb8cc('0x2b')](_0x3f3a96[_0xb8cc('0x27')],qs[_0xb8cc('0x39')](_0x143679[_0xb8cc('0x29')][_0xb8cc('0x39')]));_0x3d2f26[_0xb8cc('0x2c')]=_0x3d2f26[_0xb8cc('0x2c')]['length']?_0x3d2f26[_0xb8cc('0x2c')]:_0x3f3a96[_0xb8cc('0x27')];if(_0x143679[_0xb8cc('0x29')][_0xb8cc('0x35')]){_0x3d2f26[_0xb8cc('0x3a')]=[{'all':!![]}];}_0x3d2f26=_[_0xb8cc('0x32')]({},_0x3d2f26,_0x143679[_0xb8cc('0x3b')]);return db['FaxQueueReport'][_0xb8cc('0x3c')](_0x3d2f26)['then'](handleEntityNotFound(_0xd54827,null))['then'](respondWithResult(_0xd54827,null))['catch'](handleError(_0xd54827,null));};exports[_0xb8cc('0x3d')]=function(_0x1fe418,_0x210d59){return db[_0xb8cc('0x24')]['create'](_0x1fe418['body'],{})[_0xb8cc('0x20')](respondWithResult(_0x210d59,0xc9))[_0xb8cc('0x3e')](handleError(_0x210d59,null));};exports[_0xb8cc('0x1f')]=function(_0x3e5e32,_0x3216a4){if(_0x3e5e32[_0xb8cc('0x3f')]['id']){delete _0x3e5e32[_0xb8cc('0x3f')]['id'];}return db[_0xb8cc('0x24')][_0xb8cc('0x3c')]({'where':{'id':_0x3e5e32[_0xb8cc('0x40')]['id']}})['then'](handleEntityNotFound(_0x3216a4,null))[_0xb8cc('0x20')](saveUpdates(_0x3e5e32[_0xb8cc('0x3f')],null))[_0xb8cc('0x20')](respondWithResult(_0x3216a4,null))[_0xb8cc('0x3e')](handleError(_0x3216a4,null));};exports['destroy']=function(_0x2ac1be,_0x4688b4){return db[_0xb8cc('0x24')]['find']({'where':{'id':_0x2ac1be[_0xb8cc('0x40')]['id']}})[_0xb8cc('0x20')](handleEntityNotFound(_0x4688b4,null))[_0xb8cc('0x20')](removeEntity(_0x4688b4,null))['catch'](handleError(_0x4688b4,null));};exports[_0xb8cc('0x41')]=function(_0x289f6c,_0x563e4f){return db[_0xb8cc('0x24')][_0xb8cc('0x41')]()[_0xb8cc('0x20')](respondWithResult(_0x563e4f,null))['catch'](handleError(_0x563e4f,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 7a1b87c..c1918d6 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(_0x263c36,_0x3c9311){var _0xd13601=function(_0x11ae78){while(--_0x11ae78){_0x263c36['push'](_0x263c36['shift']());}};_0xd13601(++_0x3c9311);}(_0x7a54,0x106));var _0x47a5=function(_0x1f695c,_0x455caa){_0x1f695c=_0x1f695c-0x0;var _0x171bcf=_0x7a54[_0x1f695c];return _0x171bcf;};'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(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x43796a,_0x11cfcc){_0x43796a=_0x43796a-0x0;var _0x494964=_0x1cb9[_0x43796a];return _0x494964;};'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 6c774ea..34b2af8 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 _0xa0fb=['catch','CreateFaxQueueReport','create','body','options','raw','then','stringify','UpdateFaxQueueReport','FaxQueueReport','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x46612a,_0x487236){var _0x35dcce=function(_0x4add77){while(--_0x4add77){_0x46612a['push'](_0x46612a['shift']());}};_0x35dcce(++_0x487236);}(_0xa0fb,0xc5));var _0xba0f=function(_0x47618e,_0x15c22e){_0x47618e=_0x47618e-0x0;var _0x24747=_0xa0fb[_0x47618e];return _0x24747;};'use strict';var _=require(_0xba0f('0x0'));var util=require(_0xba0f('0x1'));var moment=require(_0xba0f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xba0f('0x3'));var db=require(_0xba0f('0x4'))['db'];var utils=require(_0xba0f('0x5'));var logger=require(_0xba0f('0x6'))('rpc');var config=require(_0xba0f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xba0f('0x8')][_0xba0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x480c7f,_0x1af7f9,_0x58e187){return new BPromise(function(_0x241622,_0x293f03){return client[_0xba0f('0xa')](_0x480c7f,_0x58e187)['then'](function(_0x532638){logger[_0xba0f('0xb')](_0xba0f('0xc'),_0x1af7f9,_0xba0f('0xd'));logger[_0xba0f('0xe')](_0xba0f('0xf'),_0x1af7f9,_0xba0f('0xd'),JSON['stringify'](_0x532638));if(_0x532638[_0xba0f('0x10')]){if(_0x532638['error'][_0xba0f('0x11')]===0x1f4){logger[_0xba0f('0x10')](_0xba0f('0xc'),_0x1af7f9,_0x532638[_0xba0f('0x10')]['message']);return _0x293f03(_0x532638[_0xba0f('0x10')][_0xba0f('0x12')]);}logger[_0xba0f('0x10')](_0xba0f('0xc'),_0x1af7f9,_0x532638[_0xba0f('0x10')]['message']);return _0x241622(_0x532638[_0xba0f('0x10')][_0xba0f('0x12')]);}else{logger[_0xba0f('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x1af7f9,_0xba0f('0xd'));_0x241622(_0x532638[_0xba0f('0x13')][_0xba0f('0x12')]);}})[_0xba0f('0x14')](function(_0x4feb32){logger[_0xba0f('0x10')](_0xba0f('0xc'),_0x1af7f9,_0x4feb32);_0x293f03(_0x4feb32);});});}exports[_0xba0f('0x15')]=function(_0x8c0470){var _0x5a2561=this;return new Promise(function(_0x278925,_0x1f59b7){return db['FaxQueueReport'][_0xba0f('0x16')](_0x8c0470[_0xba0f('0x17')],{'raw':_0x8c0470[_0xba0f('0x18')]?_0x8c0470[_0xba0f('0x18')][_0xba0f('0x19')]===undefined?!![]:![]:!![]})[_0xba0f('0x1a')](function(_0x1301de){logger['info'](_0xba0f('0x15'),_0x8c0470);logger[_0xba0f('0xe')]('CreateFaxQueueReport',_0x8c0470,JSON[_0xba0f('0x1b')](_0x1301de));_0x278925(_0x1301de);})[_0xba0f('0x14')](function(_0x442219){logger[_0xba0f('0x10')](_0xba0f('0x15'),_0x442219[_0xba0f('0x12')],_0x8c0470);_0x1f59b7(_0x5a2561[_0xba0f('0x10')](0x1f4,_0x442219[_0xba0f('0x12')]));});});};exports[_0xba0f('0x1c')]=function(_0x4b37a0){var _0x3d6d05=this;return new Promise(function(_0xf0b719,_0x43f98e){return db[_0xba0f('0x1d')]['update'](_0x4b37a0['body'],{'raw':_0x4b37a0[_0xba0f('0x18')]?_0x4b37a0['options'][_0xba0f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b37a0[_0xba0f('0x18')]?_0x4b37a0[_0xba0f('0x18')]['where']||null:null,'attributes':_0x4b37a0[_0xba0f('0x18')]?_0x4b37a0[_0xba0f('0x18')][_0xba0f('0x1e')]||null:null,'limit':_0x4b37a0['options']?_0x4b37a0['options']['limit']||null:null})[_0xba0f('0x1a')](function(_0x23fad7){logger['info'](_0xba0f('0x1c'),_0x4b37a0);logger[_0xba0f('0xe')](_0xba0f('0x1c'),_0x4b37a0,JSON[_0xba0f('0x1b')](_0x23fad7));_0xf0b719(_0x23fad7);})[_0xba0f('0x14')](function(_0x864a92){logger[_0xba0f('0x10')](_0xba0f('0x1c'),_0x864a92[_0xba0f('0x12')],_0x4b37a0);_0x43f98e(_0x3d6d05[_0xba0f('0x10')](0x1f4,_0x864a92[_0xba0f('0x12')]));});});}; \ No newline at end of file +var _0xe248=['where','attributes','limit','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','info','UpdateFaxQueueReport'];(function(_0x357a73,_0x57e4f7){var _0x491c14=function(_0x789389){while(--_0x789389){_0x357a73['push'](_0x357a73['shift']());}};_0x491c14(++_0x57e4f7);}(_0xe248,0x9a));var _0x8e24=function(_0x353a30,_0x50c68a){_0x353a30=_0x353a30-0x0;var _0x213161=_0xe248[_0x353a30];return _0x213161;};'use strict';var _=require(_0x8e24('0x0'));var util=require(_0x8e24('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8e24('0x2'));var fs=require('fs');var Redis=require(_0x8e24('0x3'));var db=require(_0x8e24('0x4'))['db'];var utils=require(_0x8e24('0x5'));var logger=require('../../config/logger')(_0x8e24('0x6'));var config=require(_0x8e24('0x7'));var jayson=require(_0x8e24('0x8'));var client=jayson[_0x8e24('0x9')][_0x8e24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2889ac,_0x2385b6,_0x1d8942){return new BPromise(function(_0x39dfaf,_0x523412){return client['request'](_0x2889ac,_0x1d8942)['then'](function(_0x3e963d){logger['info'](_0x8e24('0xb'),_0x2385b6,_0x8e24('0xc'));logger[_0x8e24('0xd')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2385b6,_0x8e24('0xc'),JSON[_0x8e24('0xe')](_0x3e963d));if(_0x3e963d[_0x8e24('0xf')]){if(_0x3e963d['error']['code']===0x1f4){logger[_0x8e24('0xf')](_0x8e24('0xb'),_0x2385b6,_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);return _0x523412(_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);}logger[_0x8e24('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x2385b6,_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);return _0x39dfaf(_0x3e963d[_0x8e24('0xf')][_0x8e24('0x10')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x2385b6,_0x8e24('0xc'));_0x39dfaf(_0x3e963d[_0x8e24('0x11')][_0x8e24('0x10')]);}})[_0x8e24('0x12')](function(_0x5447c5){logger[_0x8e24('0xf')](_0x8e24('0xb'),_0x2385b6,_0x5447c5);_0x523412(_0x5447c5);});});}exports[_0x8e24('0x13')]=function(_0x604150){var _0x2e1c98=this;return new Promise(function(_0x20affb,_0x166599){return db[_0x8e24('0x14')]['create'](_0x604150[_0x8e24('0x15')],{'raw':_0x604150[_0x8e24('0x16')]?_0x604150[_0x8e24('0x16')][_0x8e24('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x56f9b0){logger[_0x8e24('0x18')]('CreateFaxQueueReport',_0x604150);logger['debug'](_0x8e24('0x13'),_0x604150,JSON[_0x8e24('0xe')](_0x56f9b0));_0x20affb(_0x56f9b0);})[_0x8e24('0x12')](function(_0x56ba5a){logger[_0x8e24('0xf')](_0x8e24('0x13'),_0x56ba5a[_0x8e24('0x10')],_0x604150);_0x166599(_0x2e1c98['error'](0x1f4,_0x56ba5a[_0x8e24('0x10')]));});});};exports[_0x8e24('0x19')]=function(_0x49eb7e){var _0x1d693e=this;return new Promise(function(_0x591a7f,_0x2d303b){return db[_0x8e24('0x14')]['update'](_0x49eb7e[_0x8e24('0x15')],{'raw':_0x49eb7e['options']?_0x49eb7e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49eb7e[_0x8e24('0x16')]?_0x49eb7e[_0x8e24('0x16')][_0x8e24('0x1a')]||null:null,'attributes':_0x49eb7e[_0x8e24('0x16')]?_0x49eb7e[_0x8e24('0x16')][_0x8e24('0x1b')]||null:null,'limit':_0x49eb7e[_0x8e24('0x16')]?_0x49eb7e[_0x8e24('0x16')][_0x8e24('0x1c')]||null:null})[_0x8e24('0x1d')](function(_0x20b74b){logger[_0x8e24('0x18')](_0x8e24('0x19'),_0x49eb7e);logger['debug']('UpdateFaxQueueReport',_0x49eb7e,JSON['stringify'](_0x20b74b));_0x591a7f(_0x20b74b);})[_0x8e24('0x12')](function(_0x2cea9c){logger[_0x8e24('0xf')](_0x8e24('0x19'),_0x2cea9c[_0x8e24('0x10')],_0x49eb7e);_0x2d303b(_0x1d693e[_0x8e24('0xf')](0x1f4,_0x2cea9c[_0x8e24('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index c77c42e..000479c 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 _0x03e3=['describe','get','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','/describe'];(function(_0x492e7c,_0x4abcb5){var _0xa76c57=function(_0x3f65db){while(--_0x3f65db){_0x492e7c['push'](_0x492e7c['shift']());}};_0xa76c57(++_0x4abcb5);}(_0x03e3,0x1a2));var _0x303e=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x03e3[_0x160c73];return _0xd9302;};'use strict';var multer=require(_0x303e('0x0'));var util=require(_0x303e('0x1'));var path=require(_0x303e('0x2'));var timeout=require(_0x303e('0x3'));var express=require(_0x303e('0x4'));var router=express[_0x303e('0x5')]();var fs_extra=require(_0x303e('0x6'));var auth=require(_0x303e('0x7'));var interaction=require(_0x303e('0x8'));var config=require(_0x303e('0x9'));var controller=require(_0x303e('0xa'));router['get']('/',auth[_0x303e('0xb')](),controller[_0x303e('0xc')]);router['get'](_0x303e('0xd'),auth[_0x303e('0xb')](),controller[_0x303e('0xe')]);router[_0x303e('0xf')]('/:id',auth[_0x303e('0xb')](),controller[_0x303e('0x10')]);router[_0x303e('0x11')]('/',auth[_0x303e('0xb')](),controller[_0x303e('0x12')]);router[_0x303e('0x13')](_0x303e('0x14'),auth['isAuthenticated'](),controller[_0x303e('0x15')]);router[_0x303e('0x16')](_0x303e('0x14'),auth[_0x303e('0xb')](),controller['destroy']);module[_0x303e('0x17')]=router; \ No newline at end of file +var _0x1171=['create','put','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1171,0x115));var _0x1117=function(_0x414648,_0x34a290){_0x414648=_0x414648-0x0;var _0x3fae7=_0x1171[_0x414648];return _0x3fae7;};'use strict';var multer=require(_0x1117('0x0'));var util=require(_0x1117('0x1'));var path=require(_0x1117('0x2'));var timeout=require('connect-timeout');var express=require(_0x1117('0x3'));var router=express[_0x1117('0x4')]();var fs_extra=require(_0x1117('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1117('0x6'));var config=require(_0x1117('0x7'));var controller=require(_0x1117('0x8'));router[_0x1117('0x9')]('/',auth[_0x1117('0xa')](),controller[_0x1117('0xb')]);router[_0x1117('0x9')](_0x1117('0xc'),auth[_0x1117('0xa')](),controller[_0x1117('0xd')]);router['get'](_0x1117('0xe'),auth[_0x1117('0xa')](),controller[_0x1117('0xf')]);router[_0x1117('0x10')]('/',auth[_0x1117('0xa')](),controller[_0x1117('0x11')]);router[_0x1117('0x12')]('/:id',auth[_0x1117('0xa')](),controller['update']);router[_0x1117('0x13')](_0x1117('0xe'),auth['isAuthenticated'](),controller[_0x1117('0x14')]);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 e4da721..23238d9 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x9bde,0xe1));var _0xe9bd=function(_0x127f73,_0x268ac3){_0x127f73=_0x127f73-0x0;var _0x35020c=_0x9bde[_0x127f73];return _0x35020c;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4d561c,_0x5da229){var _0x2b7ed4=function(_0x579593){while(--_0x579593){_0x4d561c['push'](_0x4d561c['shift']());}};_0x2b7ed4(++_0x5da229);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0xcb91[_0x15ea09];return _0x3e9c78;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index d73c65d..7886e10 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 _0x52a1=['includeAll','include','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge'];(function(_0x5338fe,_0x5e71d1){var _0xf0a1be=function(_0x306a01){while(--_0x306a01){_0x5338fe['push'](_0x5338fe['shift']());}};_0xf0a1be(++_0x5e71d1);}(_0x52a1,0x1de));var _0x152a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x52a1[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x152a('0x0'));var rimraf=require(_0x152a('0x1'));var zipdir=require(_0x152a('0x2'));var jsonpatch=require(_0x152a('0x3'));var rp=require('request-promise');var moment=require(_0x152a('0x4'));var BPromise=require(_0x152a('0x5'));var Mustache=require(_0x152a('0x6'));var util=require(_0x152a('0x7'));var path=require(_0x152a('0x8'));var sox=require(_0x152a('0x9'));var csv=require(_0x152a('0xa'));var ejs=require(_0x152a('0xb'));var fs=require('fs');var fs_extra=require(_0x152a('0xc'));var _=require(_0x152a('0xd'));var squel=require(_0x152a('0xe'));var crypto=require(_0x152a('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x152a('0x10'));var toCsv=require(_0x152a('0xa'));var querystring=require(_0x152a('0x11'));var Papa=require(_0x152a('0x12'));var Redis=require(_0x152a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x152a('0x14'));var as=require(_0x152a('0x15'));var hardwareService=require(_0x152a('0x16'));var logger=require(_0x152a('0x17'))(_0x152a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x152a('0x19'));var db=require(_0x152a('0x1a'))['db'];function respondWithStatusCode(_0x55b785,_0x8cd479){_0x8cd479=_0x8cd479||0xcc;return function(_0x3086ac){if(_0x3086ac){return _0x55b785[_0x152a('0x1b')](_0x8cd479);}return _0x55b785[_0x152a('0x1c')](_0x8cd479)[_0x152a('0x1d')]();};}function respondWithResult(_0x4adb5a,_0x49e77b){_0x49e77b=_0x49e77b||0xc8;return function(_0x471254){if(_0x471254){return _0x4adb5a[_0x152a('0x1c')](_0x49e77b)[_0x152a('0x1e')](_0x471254);}};}function respondWithFilteredResult(_0x4de390,_0xbfc422){return function(_0x29b043){if(_0x29b043){var _0x5edd78=typeof _0xbfc422[_0x152a('0x1f')]===_0x152a('0x20')&&typeof _0xbfc422['limit']===_0x152a('0x20');var _0x5b3854=_0x29b043[_0x152a('0x21')];var _0x75a3d5=_0x5edd78?0x0:_0xbfc422[_0x152a('0x1f')];var _0x47699c=_0x5edd78?_0x29b043[_0x152a('0x21')]:_0xbfc422[_0x152a('0x1f')]+_0xbfc422[_0x152a('0x22')];var _0xddc6fc;if(_0x47699c>=_0x5b3854){_0x47699c=_0x5b3854;_0xddc6fc=0xc8;}else{_0xddc6fc=0xce;}_0x4de390[_0x152a('0x1c')](_0xddc6fc);return _0x4de390[_0x152a('0x23')](_0x152a('0x24'),_0x75a3d5+'-'+_0x47699c+'/'+_0x5b3854)[_0x152a('0x1e')](_0x29b043);}return null;};}function patchUpdates(_0x46f8e3){return function(_0x172ea9){try{jsonpatch[_0x152a('0x25')](_0x172ea9,_0x46f8e3,!![]);}catch(_0x114153){return BPromise['reject'](_0x114153);}return _0x172ea9[_0x152a('0x26')]();};}function saveUpdates(_0x349492,_0x306e80){return function(_0x3fc637){if(_0x3fc637){return _0x3fc637['update'](_0x349492)[_0x152a('0x27')](function(_0x49f6a2){return _0x49f6a2;});}return null;};}function removeEntity(_0x5b2ee4,_0x5772b7){return function(_0x5b1851){if(_0x5b1851){return _0x5b1851[_0x152a('0x28')]()['then'](function(){_0x5b2ee4[_0x152a('0x1c')](0xcc)[_0x152a('0x1d')]();});}};}function handleEntityNotFound(_0x407a6d,_0x27f4a9){return function(_0x56e52a){if(!_0x56e52a){_0x407a6d['sendStatus'](0x194);}return _0x56e52a;};}function handleError(_0x4c2676,_0xf57d9){_0xf57d9=_0xf57d9||0x1f4;return function(_0x2408a3){logger[_0x152a('0x29')](_0x2408a3[_0x152a('0x2a')]);if(_0x2408a3[_0x152a('0x2b')]){delete _0x2408a3['name'];}_0x4c2676[_0x152a('0x1c')](_0xf57d9)[_0x152a('0x2c')](_0x2408a3);};}exports[_0x152a('0x2d')]=function(_0x1a7632,_0x285f2a){var _0x37474d={},_0x209086={},_0x36d8c7={'count':0x0,'rows':[]};var _0x9047a4=_['map'](db[_0x152a('0x2e')][_0x152a('0x2f')],function(_0x3340d3){return{'name':_0x3340d3[_0x152a('0x30')],'type':_0x3340d3['type'][_0x152a('0x31')]};});_0x209086['model']=_[_0x152a('0x32')](_0x9047a4,_0x152a('0x2b'));_0x209086[_0x152a('0x33')]=_[_0x152a('0x34')](_0x1a7632[_0x152a('0x33')]);_0x209086[_0x152a('0x35')]=_[_0x152a('0x36')](_0x209086[_0x152a('0x37')],_0x209086[_0x152a('0x33')]);_0x37474d[_0x152a('0x38')]=_[_0x152a('0x36')](_0x209086[_0x152a('0x37')],qs[_0x152a('0x39')](_0x1a7632[_0x152a('0x33')][_0x152a('0x39')]));_0x37474d[_0x152a('0x38')]=_0x37474d['attributes'][_0x152a('0x3a')]?_0x37474d[_0x152a('0x38')]:_0x209086[_0x152a('0x37')];if(!_0x1a7632[_0x152a('0x33')][_0x152a('0x3b')](_0x152a('0x3c'))){_0x37474d[_0x152a('0x22')]=qs[_0x152a('0x22')](_0x1a7632[_0x152a('0x33')][_0x152a('0x22')]);_0x37474d[_0x152a('0x1f')]=qs['offset'](_0x1a7632['query']['offset']);}_0x37474d[_0x152a('0x3d')]=qs[_0x152a('0x3e')](_0x1a7632[_0x152a('0x33')][_0x152a('0x3e')]);_0x37474d['where']=qs['filters'](_['pick'](_0x1a7632[_0x152a('0x33')],_0x209086['filters']),_0x9047a4);if(_0x1a7632[_0x152a('0x33')][_0x152a('0x3f')]){_0x37474d[_0x152a('0x40')]=_['merge'](_0x37474d[_0x152a('0x40')],{'$or':_[_0x152a('0x32')](_0x9047a4,function(_0x344a00){if(_0x344a00[_0x152a('0x41')]!==_0x152a('0x42')){var _0x1f84c3={};_0x1f84c3[_0x344a00[_0x152a('0x2b')]]={'$like':'%'+_0x1a7632[_0x152a('0x33')][_0x152a('0x3f')]+'%'};return _0x1f84c3;}})});}_0x37474d=_[_0x152a('0x43')]({},_0x37474d,_0x1a7632['options']);var _0x70a6fb={'where':_0x37474d['where']};return db[_0x152a('0x2e')]['count'](_0x70a6fb)[_0x152a('0x27')](function(_0x1b541f){_0x36d8c7[_0x152a('0x21')]=_0x1b541f;if(_0x1a7632[_0x152a('0x33')][_0x152a('0x44')]){_0x37474d[_0x152a('0x45')]=[{'all':!![]}];}return db[_0x152a('0x2e')]['findAll'](_0x37474d);})[_0x152a('0x27')](function(_0x2f1714){_0x36d8c7[_0x152a('0x46')]=_0x2f1714;return _0x36d8c7;})[_0x152a('0x27')](respondWithFilteredResult(_0x285f2a,_0x37474d))[_0x152a('0x47')](handleError(_0x285f2a,null));};exports[_0x152a('0x48')]=function(_0x1cf61c,_0x2cf679){var _0x1a6a37={'raw':!![],'where':{'id':_0x1cf61c['params']['id']}},_0x5b4d75={};_0x5b4d75[_0x152a('0x37')]=_[_0x152a('0x34')](db[_0x152a('0x2e')][_0x152a('0x2f')]);_0x5b4d75['query']=_[_0x152a('0x34')](_0x1cf61c['query']);_0x5b4d75[_0x152a('0x35')]=_[_0x152a('0x36')](_0x5b4d75[_0x152a('0x37')],_0x5b4d75[_0x152a('0x33')]);_0x1a6a37['attributes']=_['intersection'](_0x5b4d75[_0x152a('0x37')],qs[_0x152a('0x39')](_0x1cf61c['query']['fields']));_0x1a6a37[_0x152a('0x38')]=_0x1a6a37[_0x152a('0x38')]['length']?_0x1a6a37[_0x152a('0x38')]:_0x5b4d75[_0x152a('0x37')];if(_0x1cf61c[_0x152a('0x33')][_0x152a('0x44')]){_0x1a6a37['include']=[{'all':!![]}];}_0x1a6a37=_[_0x152a('0x43')]({},_0x1a6a37,_0x1cf61c['options']);return db[_0x152a('0x2e')]['find'](_0x1a6a37)[_0x152a('0x27')](handleEntityNotFound(_0x2cf679,null))[_0x152a('0x27')](respondWithResult(_0x2cf679,null))[_0x152a('0x47')](handleError(_0x2cf679,null));};exports['create']=function(_0x477339,_0x4c8873){return db[_0x152a('0x2e')][_0x152a('0x49')](_0x477339[_0x152a('0x4a')],{})[_0x152a('0x27')](respondWithResult(_0x4c8873,0xc9))['catch'](handleError(_0x4c8873,null));};exports['update']=function(_0x4cb8fb,_0x42501b){if(_0x4cb8fb[_0x152a('0x4a')]['id']){delete _0x4cb8fb['body']['id'];}return db[_0x152a('0x2e')][_0x152a('0x4b')]({'where':{'id':_0x4cb8fb[_0x152a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x42501b,null))[_0x152a('0x27')](saveUpdates(_0x4cb8fb[_0x152a('0x4a')],null))[_0x152a('0x27')](respondWithResult(_0x42501b,null))[_0x152a('0x47')](handleError(_0x42501b,null));};exports['destroy']=function(_0x203cef,_0x482d7f){return db[_0x152a('0x2e')][_0x152a('0x4b')]({'where':{'id':_0x203cef['params']['id']}})[_0x152a('0x27')](handleEntityNotFound(_0x482d7f,null))['then'](removeEntity(_0x482d7f,null))[_0x152a('0x47')](handleError(_0x482d7f,null));};exports[_0x152a('0x4d')]=function(_0x379c7f,_0x71ca96){return db[_0x152a('0x2e')]['describe']()[_0x152a('0x27')](respondWithResult(_0x71ca96,null))['catch'](handleError(_0x71ca96,null));}; \ No newline at end of file +var _0x376e=['limit','count','apply','update','then','destroy','sendStatus','stack','name','rawAttributes','map','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','FaxTransferReport','includeAll','include','rows','params','length','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined'];(function(_0x4c356f,_0x2054c8){var _0x1c7630=function(_0x1f9773){while(--_0x1f9773){_0x4c356f['push'](_0x4c356f['shift']());}};_0x1c7630(++_0x2054c8);}(_0x376e,0x135));var _0xe376=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x376e[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xe376('0x0'));var rimraf=require(_0xe376('0x1'));var zipdir=require(_0xe376('0x2'));var jsonpatch=require(_0xe376('0x3'));var rp=require(_0xe376('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe376('0x5'));var util=require(_0xe376('0x6'));var path=require(_0xe376('0x7'));var sox=require(_0xe376('0x8'));var csv=require(_0xe376('0x9'));var ejs=require(_0xe376('0xa'));var fs=require('fs');var fs_extra=require(_0xe376('0xb'));var _=require(_0xe376('0xc'));var squel=require(_0xe376('0xd'));var crypto=require('crypto');var jsforce=require(_0xe376('0xe'));var deskjs=require(_0xe376('0xf'));var toCsv=require(_0xe376('0x9'));var querystring=require(_0xe376('0x10'));var Papa=require(_0xe376('0x11'));var Redis=require('ioredis');var authService=require(_0xe376('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe376('0x13'));var hardwareService=require(_0xe376('0x14'));var logger=require(_0xe376('0x15'))(_0xe376('0x16'));var utils=require('../../config/utils');var config=require(_0xe376('0x17'));var licenseUtil=require(_0xe376('0x18'));var db=require(_0xe376('0x19'))['db'];function respondWithStatusCode(_0x17a66f,_0x455ae0){_0x455ae0=_0x455ae0||0xcc;return function(_0x1a39ee){if(_0x1a39ee){return _0x17a66f['sendStatus'](_0x455ae0);}return _0x17a66f['status'](_0x455ae0)[_0xe376('0x1a')]();};}function respondWithResult(_0x2bad72,_0x1c9504){_0x1c9504=_0x1c9504||0xc8;return function(_0x1018be){if(_0x1018be){return _0x2bad72[_0xe376('0x1b')](_0x1c9504)[_0xe376('0x1c')](_0x1018be);}};}function respondWithFilteredResult(_0x3f7dfe,_0x5c855c){return function(_0x6519cf){if(_0x6519cf){var _0x58ccba=typeof _0x5c855c[_0xe376('0x1d')]===_0xe376('0x1e')&&typeof _0x5c855c[_0xe376('0x1f')]===_0xe376('0x1e');var _0x31157b=_0x6519cf[_0xe376('0x20')];var _0x236036=_0x58ccba?0x0:_0x5c855c[_0xe376('0x1d')];var _0x4d328d=_0x58ccba?_0x6519cf[_0xe376('0x20')]:_0x5c855c['offset']+_0x5c855c[_0xe376('0x1f')];var _0x49d9ac;if(_0x4d328d>=_0x31157b){_0x4d328d=_0x31157b;_0x49d9ac=0xc8;}else{_0x49d9ac=0xce;}_0x3f7dfe[_0xe376('0x1b')](_0x49d9ac);return _0x3f7dfe['set']('Content-Range',_0x236036+'-'+_0x4d328d+'/'+_0x31157b)[_0xe376('0x1c')](_0x6519cf);}return null;};}function patchUpdates(_0x4aff9a){return function(_0x53f2d0){try{jsonpatch[_0xe376('0x21')](_0x53f2d0,_0x4aff9a,!![]);}catch(_0x16bcdf){return BPromise['reject'](_0x16bcdf);}return _0x53f2d0['save']();};}function saveUpdates(_0x53973d,_0x2b2fc2){return function(_0x5d7f00){if(_0x5d7f00){return _0x5d7f00[_0xe376('0x22')](_0x53973d)[_0xe376('0x23')](function(_0xc01977){return _0xc01977;});}return null;};}function removeEntity(_0x55ca3c,_0x2198f1){return function(_0x69005){if(_0x69005){return _0x69005[_0xe376('0x24')]()[_0xe376('0x23')](function(){_0x55ca3c[_0xe376('0x1b')](0xcc)[_0xe376('0x1a')]();});}};}function handleEntityNotFound(_0x528a68,_0x5bc5f7){return function(_0xeb40f9){if(!_0xeb40f9){_0x528a68[_0xe376('0x25')](0x194);}return _0xeb40f9;};}function handleError(_0xbe17a7,_0x1ab5e1){_0x1ab5e1=_0x1ab5e1||0x1f4;return function(_0xf3fab){logger['error'](_0xf3fab[_0xe376('0x26')]);if(_0xf3fab[_0xe376('0x27')]){delete _0xf3fab[_0xe376('0x27')];}_0xbe17a7[_0xe376('0x1b')](_0x1ab5e1)['send'](_0xf3fab);};}exports['index']=function(_0x417d19,_0x5b27ee){var _0x570041={},_0x47fb24={},_0x5f106a={'count':0x0,'rows':[]};var _0x4f2d1e=_['map'](db['FaxTransferReport'][_0xe376('0x28')],function(_0x1e1abb){return{'name':_0x1e1abb['fieldName'],'type':_0x1e1abb['type']['key']};});_0x47fb24['model']=_[_0xe376('0x29')](_0x4f2d1e,_0xe376('0x27'));_0x47fb24[_0xe376('0x2a')]=_[_0xe376('0x2b')](_0x417d19[_0xe376('0x2a')]);_0x47fb24[_0xe376('0x2c')]=_[_0xe376('0x2d')](_0x47fb24[_0xe376('0x2e')],_0x47fb24['query']);_0x570041[_0xe376('0x2f')]=_[_0xe376('0x2d')](_0x47fb24[_0xe376('0x2e')],qs[_0xe376('0x30')](_0x417d19['query']['fields']));_0x570041[_0xe376('0x2f')]=_0x570041[_0xe376('0x2f')]['length']?_0x570041[_0xe376('0x2f')]:_0x47fb24[_0xe376('0x2e')];if(!_0x417d19[_0xe376('0x2a')]['hasOwnProperty']('nolimit')){_0x570041[_0xe376('0x1f')]=qs['limit'](_0x417d19['query'][_0xe376('0x1f')]);_0x570041[_0xe376('0x1d')]=qs[_0xe376('0x1d')](_0x417d19[_0xe376('0x2a')][_0xe376('0x1d')]);}_0x570041[_0xe376('0x31')]=qs[_0xe376('0x32')](_0x417d19['query'][_0xe376('0x32')]);_0x570041[_0xe376('0x33')]=qs[_0xe376('0x2c')](_[_0xe376('0x34')](_0x417d19[_0xe376('0x2a')],_0x47fb24[_0xe376('0x2c')]),_0x4f2d1e);if(_0x417d19[_0xe376('0x2a')]['filter']){_0x570041[_0xe376('0x33')]=_[_0xe376('0x35')](_0x570041[_0xe376('0x33')],{'$or':_[_0xe376('0x29')](_0x4f2d1e,function(_0x5f5508){if(_0x5f5508['type']!==_0xe376('0x36')){var _0x4c06c6={};_0x4c06c6[_0x5f5508[_0xe376('0x27')]]={'$like':'%'+_0x417d19[_0xe376('0x2a')][_0xe376('0x37')]+'%'};return _0x4c06c6;}})});}_0x570041=_[_0xe376('0x35')]({},_0x570041,_0x417d19[_0xe376('0x38')]);var _0x3cf492={'where':_0x570041[_0xe376('0x33')]};return db[_0xe376('0x39')]['count'](_0x3cf492)['then'](function(_0xd6f2c0){_0x5f106a[_0xe376('0x20')]=_0xd6f2c0;if(_0x417d19[_0xe376('0x2a')][_0xe376('0x3a')]){_0x570041[_0xe376('0x3b')]=[{'all':!![]}];}return db[_0xe376('0x39')]['findAll'](_0x570041);})[_0xe376('0x23')](function(_0x47c0e6){_0x5f106a[_0xe376('0x3c')]=_0x47c0e6;return _0x5f106a;})[_0xe376('0x23')](respondWithFilteredResult(_0x5b27ee,_0x570041))['catch'](handleError(_0x5b27ee,null));};exports['show']=function(_0x11764f,_0x5af945){var _0x47bd5f={'raw':!![],'where':{'id':_0x11764f[_0xe376('0x3d')]['id']}},_0x72a0f7={};_0x72a0f7[_0xe376('0x2e')]=_[_0xe376('0x2b')](db['FaxTransferReport']['rawAttributes']);_0x72a0f7[_0xe376('0x2a')]=_[_0xe376('0x2b')](_0x11764f[_0xe376('0x2a')]);_0x72a0f7[_0xe376('0x2c')]=_[_0xe376('0x2d')](_0x72a0f7[_0xe376('0x2e')],_0x72a0f7[_0xe376('0x2a')]);_0x47bd5f[_0xe376('0x2f')]=_['intersection'](_0x72a0f7[_0xe376('0x2e')],qs['fields'](_0x11764f[_0xe376('0x2a')][_0xe376('0x30')]));_0x47bd5f['attributes']=_0x47bd5f[_0xe376('0x2f')][_0xe376('0x3e')]?_0x47bd5f[_0xe376('0x2f')]:_0x72a0f7[_0xe376('0x2e')];if(_0x11764f[_0xe376('0x2a')][_0xe376('0x3a')]){_0x47bd5f[_0xe376('0x3b')]=[{'all':!![]}];}_0x47bd5f=_[_0xe376('0x35')]({},_0x47bd5f,_0x11764f['options']);return db[_0xe376('0x39')]['find'](_0x47bd5f)[_0xe376('0x23')](handleEntityNotFound(_0x5af945,null))[_0xe376('0x23')](respondWithResult(_0x5af945,null))[_0xe376('0x3f')](handleError(_0x5af945,null));};exports[_0xe376('0x40')]=function(_0x4e89e0,_0x2255e8){return db[_0xe376('0x39')][_0xe376('0x40')](_0x4e89e0['body'],{})[_0xe376('0x23')](respondWithResult(_0x2255e8,0xc9))[_0xe376('0x3f')](handleError(_0x2255e8,null));};exports[_0xe376('0x22')]=function(_0x48248d,_0x200605){if(_0x48248d[_0xe376('0x41')]['id']){delete _0x48248d[_0xe376('0x41')]['id'];}return db[_0xe376('0x39')][_0xe376('0x42')]({'where':{'id':_0x48248d[_0xe376('0x3d')]['id']}})['then'](handleEntityNotFound(_0x200605,null))[_0xe376('0x23')](saveUpdates(_0x48248d['body'],null))[_0xe376('0x23')](respondWithResult(_0x200605,null))[_0xe376('0x3f')](handleError(_0x200605,null));};exports['destroy']=function(_0x20d6c2,_0x3a5687){return db[_0xe376('0x39')]['find']({'where':{'id':_0x20d6c2[_0xe376('0x3d')]['id']}})[_0xe376('0x23')](handleEntityNotFound(_0x3a5687,null))[_0xe376('0x23')](removeEntity(_0x3a5687,null))[_0xe376('0x3f')](handleError(_0x3a5687,null));};exports[_0xe376('0x43')]=function(_0x4af566,_0x1b3d8a){return db[_0xe376('0x39')][_0xe376('0x43')]()[_0xe376('0x23')](respondWithResult(_0x1b3d8a,null))[_0xe376('0x3f')](handleError(_0x1b3d8a,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index bcfcd9a..a4134bf 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 _0x73f5=['uniqueid','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','FaxTransferReport','report_fax_transfer'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x73f5,0x181));var _0x573f=function(_0x26ae2f,_0x3f8e66){_0x26ae2f=_0x26ae2f-0x0;var _0x4da39a=_0x73f5[_0x26ae2f];return _0x4da39a;};'use strict';var _=require(_0x573f('0x0'));var util=require('util');var logger=require(_0x573f('0x1'))(_0x573f('0x2'));var moment=require(_0x573f('0x3'));var BPromise=require('bluebird');var rp=require(_0x573f('0x4'));var fs=require('fs');var path=require(_0x573f('0x5'));var rimraf=require(_0x573f('0x6'));var config=require(_0x573f('0x7'));var attributes=require('./faxTransferReport.attributes');module[_0x573f('0x8')]=function(_0x5b85ac,_0x4d7c1b){return _0x5b85ac['define'](_0x573f('0x9'),attributes,{'tableName':_0x573f('0xa'),'paranoid':![],'indexes':[{'name':_0x573f('0xb'),'fields':[_0x573f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x416b=['uniqueid','lodash','util','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer'];(function(_0x486f1d,_0x90c2b5){var _0x5a2c2d=function(_0x1a5f79){while(--_0x1a5f79){_0x486f1d['push'](_0x486f1d['shift']());}};_0x5a2c2d(++_0x90c2b5);}(_0x416b,0x1c8));var _0xb416=function(_0x146214,_0x13482f){_0x146214=_0x146214-0x0;var _0x2c2acb=_0x416b[_0x146214];return _0x2c2acb;};'use strict';var _=require(_0xb416('0x0'));var util=require(_0xb416('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb416('0x2'));var BPromise=require('bluebird');var rp=require(_0xb416('0x3'));var fs=require('fs');var path=require(_0xb416('0x4'));var rimraf=require(_0xb416('0x5'));var config=require(_0xb416('0x6'));var attributes=require(_0xb416('0x7'));module[_0xb416('0x8')]=function(_0x386517,_0x35bf96){return _0x386517[_0xb416('0x9')](_0xb416('0xa'),attributes,{'tableName':_0xb416('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb416('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 04a0374..f4004a5 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 _0xb7a7=['rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','FaxTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x33b9b7,_0x550d90){var _0x284272=function(_0x4e2795){while(--_0x4e2795){_0x33b9b7['push'](_0x33b9b7['shift']());}};_0x284272(++_0x550d90);}(_0xb7a7,0x1b1));var _0x7b7a=function(_0x40af73,_0x3a3d04){_0x40af73=_0x40af73-0x0;var _0x5ce832=_0xb7a7[_0x40af73];return _0x5ce832;};'use strict';var _=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var moment=require(_0x7b7a('0x2'));var BPromise=require(_0x7b7a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b7a('0x4'));var db=require(_0x7b7a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7a('0x6'))(_0x7b7a('0x7'));var config=require(_0x7b7a('0x8'));var jayson=require(_0x7b7a('0x9'));var client=jayson[_0x7b7a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39d129,_0x14e879,_0x463dfa){return new BPromise(function(_0x50d031,_0x1319d5){return client[_0x7b7a('0xb')](_0x39d129,_0x463dfa)[_0x7b7a('0xc')](function(_0x475172){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x14e879,_0x7b7a('0xd'));logger['debug'](_0x7b7a('0xe'),_0x14e879,_0x7b7a('0xd'),JSON[_0x7b7a('0xf')](_0x475172));if(_0x475172['error']){if(_0x475172['error']['code']===0x1f4){logger[_0x7b7a('0x10')](_0x7b7a('0x11'),_0x14e879,_0x475172[_0x7b7a('0x10')][_0x7b7a('0x12')]);return _0x1319d5(_0x475172[_0x7b7a('0x10')][_0x7b7a('0x12')]);}logger[_0x7b7a('0x10')](_0x7b7a('0x11'),_0x14e879,_0x475172[_0x7b7a('0x10')][_0x7b7a('0x12')]);return _0x50d031(_0x475172[_0x7b7a('0x10')][_0x7b7a('0x12')]);}else{logger[_0x7b7a('0x13')](_0x7b7a('0x11'),_0x14e879,'request\x20sent');_0x50d031(_0x475172[_0x7b7a('0x14')]['message']);}})[_0x7b7a('0x15')](function(_0x2e25d2){logger['error'](_0x7b7a('0x11'),_0x14e879,_0x2e25d2);_0x1319d5(_0x2e25d2);});});} \ No newline at end of file +var _0xce75=['request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http'];(function(_0x46a7ef,_0x3c7736){var _0x3e192c=function(_0xb6d42b){while(--_0xb6d42b){_0x46a7ef['push'](_0x46a7ef['shift']());}};_0x3e192c(++_0x3c7736);}(_0xce75,0x126));var _0x5ce7=function(_0x1096f4,_0x280cb5){_0x1096f4=_0x1096f4-0x0;var _0x2aaf97=_0xce75[_0x1096f4];return _0x2aaf97;};'use strict';var _=require(_0x5ce7('0x0'));var util=require(_0x5ce7('0x1'));var moment=require(_0x5ce7('0x2'));var BPromise=require(_0x5ce7('0x3'));var rs=require(_0x5ce7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ce7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ce7('0x6'))('rpc');var config=require(_0x5ce7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5ce7('0x8')][_0x5ce7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e51d7,_0x211c4d,_0x42742a){return new BPromise(function(_0xfa2a0c,_0xad88f0){return client[_0x5ce7('0xa')](_0x3e51d7,_0x42742a)['then'](function(_0x111bd6){logger[_0x5ce7('0xb')](_0x5ce7('0xc'),_0x211c4d,_0x5ce7('0xd'));logger[_0x5ce7('0xe')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x211c4d,_0x5ce7('0xd'),JSON['stringify'](_0x111bd6));if(_0x111bd6['error']){if(_0x111bd6[_0x5ce7('0xf')][_0x5ce7('0x10')]===0x1f4){logger[_0x5ce7('0xf')](_0x5ce7('0xc'),_0x211c4d,_0x111bd6[_0x5ce7('0xf')][_0x5ce7('0x11')]);return _0xad88f0(_0x111bd6[_0x5ce7('0xf')]['message']);}logger['error'](_0x5ce7('0xc'),_0x211c4d,_0x111bd6[_0x5ce7('0xf')][_0x5ce7('0x11')]);return _0xfa2a0c(_0x111bd6['error'][_0x5ce7('0x11')]);}else{logger[_0x5ce7('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x211c4d,_0x5ce7('0xd'));_0xfa2a0c(_0x111bd6[_0x5ce7('0x12')][_0x5ce7('0x11')]);}})['catch'](function(_0xeb3619){logger[_0x5ce7('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x211c4d,_0xeb3619);_0xad88f0(_0xeb3619);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index f0918c3..b92716c 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 _0x7a36=['show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7a36,0x170));var _0x67a3=function(_0x2aafd0,_0x28375d){_0x2aafd0=_0x2aafd0-0x0;var _0x178e8a=_0x7a36[_0x2aafd0];return _0x178e8a;};'use strict';var multer=require(_0x67a3('0x0'));var util=require('util');var path=require(_0x67a3('0x1'));var timeout=require(_0x67a3('0x2'));var express=require(_0x67a3('0x3'));var router=express[_0x67a3('0x4')]();var fs_extra=require(_0x67a3('0x5'));var auth=require(_0x67a3('0x6'));var interaction=require(_0x67a3('0x7'));var config=require(_0x67a3('0x8'));var controller=require(_0x67a3('0x9'));router[_0x67a3('0xa')]('/',auth['isAuthenticated'](),controller[_0x67a3('0xb')]);router[_0x67a3('0xa')](_0x67a3('0xc'),auth[_0x67a3('0xd')](),controller[_0x67a3('0xe')]);router[_0x67a3('0xa')](_0x67a3('0xf'),auth['isAuthenticated'](),controller[_0x67a3('0x10')]);router[_0x67a3('0x11')]('/',auth[_0x67a3('0xd')](),controller[_0x67a3('0x12')]);router[_0x67a3('0x13')](_0x67a3('0xf'),auth[_0x67a3('0xd')](),controller[_0x67a3('0x14')]);router[_0x67a3('0x15')](_0x67a3('0xf'),auth[_0x67a3('0xd')](),controller[_0x67a3('0x16')]);module[_0x67a3('0x17')]=router; \ No newline at end of file +var _0x32bd=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x32bd,0x8e));var _0xd32b=function(_0x3c9c95,_0x170256){_0x3c9c95=_0x3c9c95-0x0;var _0x1e3f99=_0x32bd[_0x3c9c95];return _0x1e3f99;};'use strict';var multer=require(_0xd32b('0x0'));var util=require(_0xd32b('0x1'));var path=require(_0xd32b('0x2'));var timeout=require(_0xd32b('0x3'));var express=require('express');var router=express[_0xd32b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd32b('0x5'));var interaction=require(_0xd32b('0x6'));var config=require('../../config/environment');var controller=require(_0xd32b('0x7'));router[_0xd32b('0x8')]('/',auth['isAuthenticated'](),controller[_0xd32b('0x9')]);router[_0xd32b('0x8')](_0xd32b('0xa'),auth[_0xd32b('0xb')](),controller[_0xd32b('0xc')]);router[_0xd32b('0x8')](_0xd32b('0xd'),auth[_0xd32b('0xb')](),controller[_0xd32b('0xe')]);router['post']('/',auth[_0xd32b('0xb')](),controller['create']);router[_0xd32b('0xf')](_0xd32b('0xd'),auth['isAuthenticated'](),controller[_0xd32b('0x10')]);router[_0xd32b('0x11')](_0xd32b('0xd'),auth[_0xd32b('0xb')](),controller[_0xd32b('0x12')]);module[_0xd32b('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index b3e3887..69e9e9a 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 _0xf729=['get','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','update','delete','destroy','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','index','/:id','show'];(function(_0x330208,_0xdd12d1){var _0x57e8c5=function(_0x1cfc88){while(--_0x1cfc88){_0x330208['push'](_0x330208['shift']());}};_0x57e8c5(++_0xdd12d1);}(_0xf729,0xf2));var _0x9f72=function(_0x40ae29,_0x47e304){_0x40ae29=_0x40ae29-0x0;var _0x277fda=_0xf729[_0x40ae29];return _0x277fda;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9f72('0x0'));var express=require(_0x9f72('0x1'));var router=express['Router']();var fs_extra=require(_0x9f72('0x2'));var auth=require(_0x9f72('0x3'));var interaction=require(_0x9f72('0x4'));var config=require(_0x9f72('0x5'));var controller=require(_0x9f72('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f72('0x7')]);router['get'](_0x9f72('0x8'),auth['isAuthenticated'](),controller[_0x9f72('0x9')]);router[_0x9f72('0xa')]('/:id/configurations',auth[_0x9f72('0xb')](),controller[_0x9f72('0xc')]);router[_0x9f72('0xa')](_0x9f72('0xd'),auth['isAuthenticated'](),controller[_0x9f72('0xe')]);router[_0x9f72('0xf')]('/',auth[_0x9f72('0xb')](),controller[_0x9f72('0x10')]);router[_0x9f72('0xf')](_0x9f72('0x11'),auth[_0x9f72('0xb')](),controller['addConfiguration']);router['put'](_0x9f72('0x8'),auth[_0x9f72('0xb')](),controller[_0x9f72('0x12')]);router[_0x9f72('0x13')](_0x9f72('0x8'),auth[_0x9f72('0xb')](),controller[_0x9f72('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb9e4=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xb9e4,0x140));var _0x4b9e=function(_0x18a197,_0x471864){_0x18a197=_0x18a197-0x0;var _0x13c07f=_0xb9e4[_0x18a197];return _0x13c07f;};'use strict';var multer=require(_0x4b9e('0x0'));var util=require(_0x4b9e('0x1'));var path=require(_0x4b9e('0x2'));var timeout=require(_0x4b9e('0x3'));var express=require('express');var router=express[_0x4b9e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4b9e('0x5'));var interaction=require(_0x4b9e('0x6'));var config=require(_0x4b9e('0x7'));var controller=require('./intDeskAccount.controller');router[_0x4b9e('0x8')]('/',auth[_0x4b9e('0x9')](),controller['index']);router[_0x4b9e('0x8')](_0x4b9e('0xa'),auth[_0x4b9e('0x9')](),controller[_0x4b9e('0xb')]);router[_0x4b9e('0x8')](_0x4b9e('0xc'),auth['isAuthenticated'](),controller[_0x4b9e('0xd')]);router['get'](_0x4b9e('0xe'),auth[_0x4b9e('0x9')](),controller['getFields']);router[_0x4b9e('0xf')]('/',auth[_0x4b9e('0x9')](),controller[_0x4b9e('0x10')]);router[_0x4b9e('0xf')](_0x4b9e('0xc'),auth[_0x4b9e('0x9')](),controller[_0x4b9e('0x11')]);router['put'](_0x4b9e('0xa'),auth['isAuthenticated'](),controller[_0x4b9e('0x12')]);router[_0x4b9e('0x13')](_0x4b9e('0xa'),auth['isAuthenticated'](),controller[_0x4b9e('0x14')]);module[_0x4b9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 444f0a6..0d08f89 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 _0xe2fe=['exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe2fe,0x120));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xee2f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xee2f('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xee2f('0x1')]},'authType':{'type':Sequelize['ENUM'](_0xee2f('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xee2f('0x1')]},'consumerKey':{'type':Sequelize[_0xee2f('0x1')]},'consumerSecret':{'type':Sequelize[_0xee2f('0x1')]},'token':{'type':Sequelize[_0xee2f('0x1')]},'tokenSecret':{'type':Sequelize[_0xee2f('0x1')]},'serverUrl':{'type':Sequelize[_0xee2f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4'),_0xee2f('0x5')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x7be4=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x140678,_0x22abb7){var _0x5db4d1=function(_0x77d3ed){while(--_0x77d3ed){_0x140678['push'](_0x140678['shift']());}};_0x5db4d1(++_0x22abb7);}(_0x7be4,0x7c));var _0x47be=function(_0x494990,_0x4267fd){_0x494990=_0x494990-0x0;var _0xd5649c=_0x7be4[_0x494990];return _0xd5649c;};'use strict';var Sequelize=require(_0x47be('0x0'));module[_0x47be('0x1')]={'name':{'type':Sequelize[_0x47be('0x2')]},'description':{'type':Sequelize[_0x47be('0x2')]},'username':{'type':Sequelize[_0x47be('0x2')]},'remoteUri':{'type':Sequelize[_0x47be('0x2')]},'authType':{'type':Sequelize[_0x47be('0x3')]('basic'),'defaultValue':_0x47be('0x4')},'password':{'type':Sequelize[_0x47be('0x2')]},'consumerKey':{'type':Sequelize[_0x47be('0x2')]},'consumerSecret':{'type':Sequelize[_0x47be('0x2')]},'token':{'type':Sequelize[_0x47be('0x2')]},'tokenSecret':{'type':Sequelize[_0x47be('0x2')]},'serverUrl':{'type':Sequelize[_0x47be('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x47be('0x3')](_0x47be('0x5'),_0x47be('0x6')),'defaultValue':_0x47be('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9821077..20d8cd8 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 _0x6ba2=['moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','findOne','DeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','slice','substring','lastIndexOf','format','%s/custom_fields','application/json','authType','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x6ba2,0x6b));var _0x26ba=function(_0x585276,_0x553f5a){_0x585276=_0x585276-0x0;var _0x4a7181=_0x6ba2[_0x585276];return _0x4a7181;};'use strict';var emlformat=require(_0x26ba('0x0'));var rimraf=require(_0x26ba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x26ba('0x2'));var rp=require(_0x26ba('0x3'));var moment=require(_0x26ba('0x4'));var BPromise=require(_0x26ba('0x5'));var Mustache=require('mustache');var util=require(_0x26ba('0x6'));var path=require('path');var sox=require(_0x26ba('0x7'));var csv=require(_0x26ba('0x8'));var ejs=require(_0x26ba('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26ba('0xa'));var squel=require(_0x26ba('0xb'));var crypto=require('crypto');var jsforce=require(_0x26ba('0xc'));var deskjs=require(_0x26ba('0xd'));var toCsv=require(_0x26ba('0x8'));var querystring=require('querystring');var Papa=require(_0x26ba('0xe'));var Redis=require(_0x26ba('0xf'));var authService=require(_0x26ba('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x26ba('0x11'));var hardwareService=require(_0x26ba('0x12'));var logger=require(_0x26ba('0x13'))('api');var utils=require(_0x26ba('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x26ba('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3afc76,_0x3dda4e){_0x3dda4e=_0x3dda4e||0xcc;return function(_0xbc906c){if(_0xbc906c){return _0x3afc76['sendStatus'](_0x3dda4e);}return _0x3afc76[_0x26ba('0x16')](_0x3dda4e)[_0x26ba('0x17')]();};}function respondWithResult(_0xe4fcf0,_0x10fbe2){_0x10fbe2=_0x10fbe2||0xc8;return function(_0x511b80){if(_0x511b80){return _0xe4fcf0[_0x26ba('0x16')](_0x10fbe2)[_0x26ba('0x18')](_0x511b80);}};}function respondWithFilteredResult(_0x5bdebb,_0xc2afbc){return function(_0x4fa3b9){if(_0x4fa3b9){var _0xc7650b=typeof _0xc2afbc[_0x26ba('0x19')]===_0x26ba('0x1a')&&typeof _0xc2afbc[_0x26ba('0x1b')]===_0x26ba('0x1a');var _0x7017a3=_0x4fa3b9[_0x26ba('0x1c')];var _0x4f73d3=_0xc7650b?0x0:_0xc2afbc['offset'];var _0x509585=_0xc7650b?_0x4fa3b9[_0x26ba('0x1c')]:_0xc2afbc['offset']+_0xc2afbc[_0x26ba('0x1b')];var _0x5c7114;if(_0x509585>=_0x7017a3){_0x509585=_0x7017a3;_0x5c7114=0xc8;}else{_0x5c7114=0xce;}_0x5bdebb[_0x26ba('0x16')](_0x5c7114);return _0x5bdebb['set'](_0x26ba('0x1d'),_0x4f73d3+'-'+_0x509585+'/'+_0x7017a3)[_0x26ba('0x18')](_0x4fa3b9);}return null;};}function patchUpdates(_0x41e73b){return function(_0x402299){try{jsonpatch[_0x26ba('0x1e')](_0x402299,_0x41e73b,!![]);}catch(_0x4ed878){return BPromise[_0x26ba('0x1f')](_0x4ed878);}return _0x402299[_0x26ba('0x20')]();};}function saveUpdates(_0x21ec60,_0x49de77){return function(_0x4eaf9b){if(_0x4eaf9b){return _0x4eaf9b[_0x26ba('0x21')](_0x21ec60)[_0x26ba('0x22')](function(_0x40f794){return _0x40f794;});}return null;};}function removeEntity(_0x41ae76,_0x17b798){return function(_0x6ac81b){if(_0x6ac81b){return _0x6ac81b[_0x26ba('0x23')]()[_0x26ba('0x22')](function(){_0x41ae76[_0x26ba('0x16')](0xcc)[_0x26ba('0x17')]();});}};}function handleEntityNotFound(_0x341e75,_0x56cacd){return function(_0x3c42d7){if(!_0x3c42d7){_0x341e75[_0x26ba('0x24')](0x194);}return _0x3c42d7;};}function handleError(_0x3b6890,_0x31f9aa){_0x31f9aa=_0x31f9aa||0x1f4;return function(_0x5d6ac1){logger[_0x26ba('0x25')](_0x5d6ac1[_0x26ba('0x26')]);if(_0x5d6ac1[_0x26ba('0x27')]){delete _0x5d6ac1['name'];}_0x3b6890[_0x26ba('0x16')](_0x31f9aa)['send'](_0x5d6ac1);};}exports[_0x26ba('0x28')]=function(_0x28646e,_0x498330){var _0x11f7c2={},_0x2d3272={},_0x2f8087={'count':0x0,'rows':[]};var _0x4b453b=_[_0x26ba('0x29')](db[_0x26ba('0x2a')][_0x26ba('0x2b')],function(_0x515e7f){return{'name':_0x515e7f[_0x26ba('0x2c')],'type':_0x515e7f[_0x26ba('0x2d')][_0x26ba('0x2e')]};});_0x2d3272['model']=_[_0x26ba('0x29')](_0x4b453b,_0x26ba('0x27'));_0x2d3272[_0x26ba('0x2f')]=_[_0x26ba('0x30')](_0x28646e[_0x26ba('0x2f')]);_0x2d3272[_0x26ba('0x31')]=_[_0x26ba('0x32')](_0x2d3272[_0x26ba('0x33')],_0x2d3272[_0x26ba('0x2f')]);_0x11f7c2['attributes']=_[_0x26ba('0x32')](_0x2d3272[_0x26ba('0x33')],qs[_0x26ba('0x34')](_0x28646e[_0x26ba('0x2f')]['fields']));_0x11f7c2[_0x26ba('0x35')]=_0x11f7c2[_0x26ba('0x35')][_0x26ba('0x36')]?_0x11f7c2[_0x26ba('0x35')]:_0x2d3272[_0x26ba('0x33')];if(!_0x28646e[_0x26ba('0x2f')][_0x26ba('0x37')](_0x26ba('0x38'))){_0x11f7c2[_0x26ba('0x1b')]=qs[_0x26ba('0x1b')](_0x28646e[_0x26ba('0x2f')][_0x26ba('0x1b')]);_0x11f7c2[_0x26ba('0x19')]=qs[_0x26ba('0x19')](_0x28646e[_0x26ba('0x2f')][_0x26ba('0x19')]);}_0x11f7c2[_0x26ba('0x39')]=qs[_0x26ba('0x3a')](_0x28646e[_0x26ba('0x2f')][_0x26ba('0x3a')]);_0x11f7c2[_0x26ba('0x3b')]=qs[_0x26ba('0x31')](_[_0x26ba('0x3c')](_0x28646e[_0x26ba('0x2f')],_0x2d3272[_0x26ba('0x31')]),_0x4b453b);if(_0x28646e[_0x26ba('0x2f')][_0x26ba('0x3d')]){_0x11f7c2[_0x26ba('0x3b')]=_[_0x26ba('0x3e')](_0x11f7c2[_0x26ba('0x3b')],{'$or':_[_0x26ba('0x29')](_0x4b453b,function(_0x4296ef){if(_0x4296ef[_0x26ba('0x2d')]!==_0x26ba('0x3f')){var _0x5e9aec={};_0x5e9aec[_0x4296ef['name']]={'$like':'%'+_0x28646e[_0x26ba('0x2f')]['filter']+'%'};return _0x5e9aec;}})});}_0x11f7c2=_[_0x26ba('0x3e')]({},_0x11f7c2,_0x28646e['options']);var _0x2dc42b={'where':_0x11f7c2[_0x26ba('0x3b')]};return db['DeskAccount'][_0x26ba('0x1c')](_0x2dc42b)[_0x26ba('0x22')](function(_0x2c7c29){_0x2f8087[_0x26ba('0x1c')]=_0x2c7c29;if(_0x28646e[_0x26ba('0x2f')][_0x26ba('0x40')]){_0x11f7c2[_0x26ba('0x41')]=[{'all':!![]}];}return db[_0x26ba('0x2a')]['findAll'](_0x11f7c2);})[_0x26ba('0x22')](function(_0x305092){_0x2f8087[_0x26ba('0x42')]=_0x305092;return _0x2f8087;})['then'](respondWithFilteredResult(_0x498330,_0x11f7c2))[_0x26ba('0x43')](handleError(_0x498330,null));};exports['show']=function(_0x321e08,_0x120255){var _0x1e6181={'raw':![],'where':{'id':_0x321e08[_0x26ba('0x44')]['id']}},_0x295890={};_0x295890[_0x26ba('0x33')]=_[_0x26ba('0x30')](db[_0x26ba('0x2a')]['rawAttributes']);_0x295890[_0x26ba('0x2f')]=_[_0x26ba('0x30')](_0x321e08[_0x26ba('0x2f')]);_0x295890[_0x26ba('0x31')]=_[_0x26ba('0x32')](_0x295890[_0x26ba('0x33')],_0x295890[_0x26ba('0x2f')]);_0x1e6181[_0x26ba('0x35')]=_[_0x26ba('0x32')](_0x295890[_0x26ba('0x33')],qs[_0x26ba('0x34')](_0x321e08[_0x26ba('0x2f')][_0x26ba('0x34')]));_0x1e6181[_0x26ba('0x35')]=_0x1e6181['attributes'][_0x26ba('0x36')]?_0x1e6181[_0x26ba('0x35')]:_0x295890[_0x26ba('0x33')];if(_0x321e08[_0x26ba('0x2f')][_0x26ba('0x40')]){_0x1e6181['include']=[{'all':!![]}];}_0x1e6181=_[_0x26ba('0x3e')]({},_0x1e6181,_0x321e08[_0x26ba('0x45')]);return db[_0x26ba('0x2a')][_0x26ba('0x46')](_0x1e6181)['then'](handleEntityNotFound(_0x120255,null))[_0x26ba('0x22')](respondWithResult(_0x120255,null))['catch'](handleError(_0x120255,null));};exports[_0x26ba('0x47')]=function(_0x35803c,_0x19cb8e){return db['DeskAccount']['create'](_0x35803c[_0x26ba('0x48')],{})[_0x26ba('0x22')](respondWithResult(_0x19cb8e,0xc9))[_0x26ba('0x43')](handleError(_0x19cb8e,null));};exports[_0x26ba('0x21')]=function(_0x5258ff,_0x27b424){if(_0x5258ff['body']['id']){delete _0x5258ff[_0x26ba('0x48')]['id'];}return db[_0x26ba('0x2a')]['find']({'where':{'id':_0x5258ff[_0x26ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x27b424,null))[_0x26ba('0x22')](saveUpdates(_0x5258ff[_0x26ba('0x48')],null))[_0x26ba('0x22')](respondWithResult(_0x27b424,null))['catch'](handleError(_0x27b424,null));};exports[_0x26ba('0x23')]=function(_0x16c3b6,_0x5169f1){return db[_0x26ba('0x2a')][_0x26ba('0x46')]({'where':{'id':_0x16c3b6[_0x26ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x5169f1,null))[_0x26ba('0x22')](removeEntity(_0x5169f1,null))[_0x26ba('0x43')](handleError(_0x5169f1,null));};exports['getConfigurations']=function(_0x3c6eba,_0x395876,_0x26821b){var _0x1060eb={};var _0x4d42f1={};var _0xd491e4;var _0x314d00;return db['DeskAccount'][_0x26ba('0x49')]({'where':{'id':_0x3c6eba[_0x26ba('0x44')]['id']}})[_0x26ba('0x22')](handleEntityNotFound(_0x395876,null))[_0x26ba('0x22')](function(_0x4c5f66){if(_0x4c5f66){_0xd491e4=_0x4c5f66;_0x4d42f1[_0x26ba('0x33')]=_[_0x26ba('0x30')](db[_0x26ba('0x4a')]['rawAttributes']);_0x4d42f1[_0x26ba('0x2f')]=_[_0x26ba('0x30')](_0x3c6eba[_0x26ba('0x2f')]);_0x4d42f1['filters']=_['intersection'](_0x4d42f1[_0x26ba('0x33')],_0x4d42f1[_0x26ba('0x2f')]);_0x1060eb[_0x26ba('0x35')]=_['intersection'](_0x4d42f1[_0x26ba('0x33')],qs['fields'](_0x3c6eba[_0x26ba('0x2f')][_0x26ba('0x34')]));_0x1060eb['attributes']=_0x1060eb['attributes'][_0x26ba('0x36')]?_0x1060eb['attributes']:_0x4d42f1['model'];_0x1060eb[_0x26ba('0x39')]=qs[_0x26ba('0x3a')](_0x3c6eba[_0x26ba('0x2f')][_0x26ba('0x3a')]);_0x1060eb[_0x26ba('0x3b')]=qs[_0x26ba('0x31')](_[_0x26ba('0x3c')](_0x3c6eba[_0x26ba('0x2f')],_0x4d42f1[_0x26ba('0x31')]));if(_0x3c6eba['query'][_0x26ba('0x3d')]){_0x1060eb['where']=_[_0x26ba('0x3e')](_0x1060eb[_0x26ba('0x3b')],{'$or':_['map'](_0x1060eb[_0x26ba('0x35')],function(_0x4a8cd5){var _0x2b9f85={};_0x2b9f85[_0x4a8cd5]={'$like':'%'+_0x3c6eba[_0x26ba('0x2f')][_0x26ba('0x3d')]+'%'};return _0x2b9f85;})});}_0x1060eb=_[_0x26ba('0x3e')]({},_0x1060eb,_0x3c6eba['options']);return _0xd491e4['getConfigurations'](_0x1060eb);}})['then'](function(_0x20a6de){if(_0x20a6de){_0x314d00=_0x20a6de[_0x26ba('0x36')];if(!_0x3c6eba[_0x26ba('0x2f')]['hasOwnProperty'](_0x26ba('0x38'))){_0x1060eb[_0x26ba('0x1b')]=qs['limit'](_0x3c6eba[_0x26ba('0x2f')][_0x26ba('0x1b')]);_0x1060eb[_0x26ba('0x19')]=qs[_0x26ba('0x19')](_0x3c6eba[_0x26ba('0x2f')][_0x26ba('0x19')]);}return _0xd491e4['getConfigurations'](_0x1060eb);}})['then'](function(_0x4c6381){if(_0x4c6381){return _0x4c6381?{'count':_0x314d00,'rows':_0x4c6381}:null;}})[_0x26ba('0x22')](respondWithResult(_0x395876,null))[_0x26ba('0x43')](handleError(_0x395876,null));};exports[_0x26ba('0x4b')]=function(_0x3fc7c5,_0x2f82ae,_0x299cbd){if(_0x3fc7c5[_0x26ba('0x48')]['id']){delete _0x3fc7c5[_0x26ba('0x48')]['id'];}return db[_0x26ba('0x2a')][_0x26ba('0x49')]({'where':{'id':_0x3fc7c5[_0x26ba('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f82ae,null))[_0x26ba('0x22')](function(_0x45e35c){if(_0x45e35c){_0x3fc7c5[_0x26ba('0x48')][_0x26ba('0x4c')]=_0x45e35c['id'];_0x3fc7c5[_0x26ba('0x48')][_0x26ba('0x4d')]=integrations[_0x26ba('0x4e')](_0x3fc7c5[_0x26ba('0x48')][_0x26ba('0x4f')],_0x3fc7c5['body'][_0x26ba('0x2d')]);_0x3fc7c5[_0x26ba('0x48')][_0x26ba('0x50')]=integrations['getDescriptions'](_0x3fc7c5[_0x26ba('0x48')]['channel'],_0x3fc7c5[_0x26ba('0x48')][_0x26ba('0x2d')]);return db['DeskConfiguration'][_0x26ba('0x47')](_0x3fc7c5['body'],{'include':[{'model':db[_0x26ba('0x51')],'as':'Subjects'},{'model':db[_0x26ba('0x51')],'as':_0x26ba('0x50')}]});}return null;})[_0x26ba('0x22')](respondWithResult(_0x2f82ae,null))[_0x26ba('0x43')](handleError(_0x2f82ae,null));};exports[_0x26ba('0x52')]=function(_0x3eb667,_0x322f88,_0xc9c82e){var _0x4e7ed0=[{'name':'priority','label':_0x26ba('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x54722b='';return db[_0x26ba('0x2a')]['findOne']({'where':{'id':_0x3eb667[_0x26ba('0x44')]['id']},'attributes':['id',_0x26ba('0x54'),'authType',_0x26ba('0x55'),_0x26ba('0x56'),_0x26ba('0x57'),_0x26ba('0x58'),'token','tokenSecret']})['then'](handleEntityNotFound(_0x322f88,null))['then'](function(_0x110fd3){if(_0x110fd3){_0x54722b=_0x110fd3[_0x26ba('0x54')];var _0x1ea157=_0x54722b[_0x26ba('0x59')](-0x1);if(_0x1ea157==='/'){_0x54722b=_0x54722b[_0x26ba('0x5a')](0x0,_0x54722b[_0x26ba('0x5b')](_0x1ea157));}var _0x3d3691={'method':'GET','uri':util[_0x26ba('0x5c')](_0x26ba('0x5d'),_0x54722b),'headers':{'Content-Type':_0x26ba('0x5e'),'Accept':_0x26ba('0x5e')},'json':!![]};if(_0x110fd3[_0x26ba('0x5f')]===_0x26ba('0x60')){_0x3d3691['headers'][_0x26ba('0x61')]=util['format'](_0x26ba('0x62'),new Buffer(util[_0x26ba('0x5c')](_0x26ba('0x63'),_0x110fd3[_0x26ba('0x55')],_0x110fd3['password']))[_0x26ba('0x64')](_0x26ba('0x65')));}return rp(_0x3d3691)[_0x26ba('0x22')](function(_0x3df407){return _0x4e7ed0[_0x26ba('0x66')](_[_0x26ba('0x29')](_0x3df407['_embedded'][_0x26ba('0x67')],function(_0x161860){return{'id':_0x161860[_0x26ba('0x27')],'name':_0x161860[_0x26ba('0x27')],'type':_0x161860[_0x26ba('0x2d')],'active':_0x161860['active'],'label':_0x161860[_0x26ba('0x68')],'custom':!![]};}));});}})['then'](function(_0x20aded){return{'count':_0x20aded[_0x26ba('0x36')],'rows':_0x20aded};})[_0x26ba('0x22')](respondWithResult(_0x322f88,null))['catch'](function(_0x47653a){var _0x347735=_0x3eb667[_0x26ba('0x2f')][_0x26ba('0x69')]?0x1f4:_0x47653a['statusCode']||0x1f4;logger[_0x26ba('0x25')](_0x26ba('0x6a'),_0x26ba('0x52'),_0x347735,JSON[_0x26ba('0x6b')](_0x47653a));delete _0x47653a[_0x26ba('0x27')];if(_0x347735===0x191){_0x347735=0x190;}_0x322f88[_0x26ba('0x16')](_0x347735)[_0x26ba('0x6c')](_0x3eb667['query'][_0x26ba('0x69')]?{'message':_0x26ba('0x6d'),'statusCode':_0x47653a[_0x26ba('0x6e')]}:_0x47653a);});}; \ No newline at end of file +var _0xa923=['hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','include','options','find','create','body','destroy','getConfigurations','findOne','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','Subjects','DeskField','getFields','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','application/json','basic','headers','format','Basic\x20%s','%s:%s','base64','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','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','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','reject','save','update','then','sendStatus','error','stack','name','send','map','DeskAccount','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length'];(function(_0x59f008,_0x38de75){var _0x11d453=function(_0x33ac91){while(--_0x33ac91){_0x59f008['push'](_0x59f008['shift']());}};_0x11d453(++_0x38de75);}(_0xa923,0xb3));var _0x3a92=function(_0x957f0d,_0x527a78){_0x957f0d=_0x957f0d-0x0;var _0x38bd17=_0xa923[_0x957f0d];return _0x38bd17;};'use strict';var emlformat=require(_0x3a92('0x0'));var rimraf=require(_0x3a92('0x1'));var zipdir=require(_0x3a92('0x2'));var jsonpatch=require(_0x3a92('0x3'));var rp=require(_0x3a92('0x4'));var moment=require(_0x3a92('0x5'));var BPromise=require(_0x3a92('0x6'));var Mustache=require(_0x3a92('0x7'));var util=require('util');var path=require(_0x3a92('0x8'));var sox=require(_0x3a92('0x9'));var csv=require(_0x3a92('0xa'));var ejs=require(_0x3a92('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a92('0xc'));var squel=require(_0x3a92('0xd'));var crypto=require(_0x3a92('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3a92('0xf'));var Papa=require(_0x3a92('0x10'));var Redis=require(_0x3a92('0x11'));var authService=require(_0x3a92('0x12'));var qs=require(_0x3a92('0x13'));var as=require(_0x3a92('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3a92('0x15'))(_0x3a92('0x16'));var utils=require(_0x3a92('0x17'));var config=require(_0x3a92('0x18'));var licenseUtil=require(_0x3a92('0x19'));var db=require(_0x3a92('0x1a'))['db'];var integrations=require(_0x3a92('0x1b'));function respondWithStatusCode(_0x51f0d4,_0x1d4935){_0x1d4935=_0x1d4935||0xcc;return function(_0x5f31c7){if(_0x5f31c7){return _0x51f0d4['sendStatus'](_0x1d4935);}return _0x51f0d4['status'](_0x1d4935)['end']();};}function respondWithResult(_0x3fb78c,_0x1891f6){_0x1891f6=_0x1891f6||0xc8;return function(_0x41cf56){if(_0x41cf56){return _0x3fb78c['status'](_0x1891f6)[_0x3a92('0x1c')](_0x41cf56);}};}function respondWithFilteredResult(_0x8c8544,_0x3e872f){return function(_0x274293){if(_0x274293){var _0x449d44=typeof _0x3e872f[_0x3a92('0x1d')]===_0x3a92('0x1e')&&typeof _0x3e872f[_0x3a92('0x1f')]===_0x3a92('0x1e');var _0x309d3e=_0x274293[_0x3a92('0x20')];var _0x30e1fa=_0x449d44?0x0:_0x3e872f['offset'];var _0xc77895=_0x449d44?_0x274293[_0x3a92('0x20')]:_0x3e872f['offset']+_0x3e872f[_0x3a92('0x1f')];var _0x3f7749;if(_0xc77895>=_0x309d3e){_0xc77895=_0x309d3e;_0x3f7749=0xc8;}else{_0x3f7749=0xce;}_0x8c8544[_0x3a92('0x21')](_0x3f7749);return _0x8c8544[_0x3a92('0x22')]('Content-Range',_0x30e1fa+'-'+_0xc77895+'/'+_0x309d3e)[_0x3a92('0x1c')](_0x274293);}return null;};}function patchUpdates(_0xd3f2d1){return function(_0x143d88){try{jsonpatch['apply'](_0x143d88,_0xd3f2d1,!![]);}catch(_0x11878b){return BPromise[_0x3a92('0x23')](_0x11878b);}return _0x143d88[_0x3a92('0x24')]();};}function saveUpdates(_0x48be79,_0x229a4d){return function(_0x21fe2b){if(_0x21fe2b){return _0x21fe2b[_0x3a92('0x25')](_0x48be79)[_0x3a92('0x26')](function(_0x48c7d9){return _0x48c7d9;});}return null;};}function removeEntity(_0x260b9d,_0x374ae5){return function(_0x23d376){if(_0x23d376){return _0x23d376['destroy']()[_0x3a92('0x26')](function(){_0x260b9d[_0x3a92('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fc332,_0x503e7b){return function(_0x6d96c8){if(!_0x6d96c8){_0x4fc332[_0x3a92('0x27')](0x194);}return _0x6d96c8;};}function handleError(_0x510e6a,_0x524902){_0x524902=_0x524902||0x1f4;return function(_0xcf91d7){logger[_0x3a92('0x28')](_0xcf91d7[_0x3a92('0x29')]);if(_0xcf91d7[_0x3a92('0x2a')]){delete _0xcf91d7['name'];}_0x510e6a[_0x3a92('0x21')](_0x524902)[_0x3a92('0x2b')](_0xcf91d7);};}exports['index']=function(_0x23b01b,_0x51a616){var _0x4b5211={},_0x13972e={},_0x3a0bff={'count':0x0,'rows':[]};var _0x561aa7=_[_0x3a92('0x2c')](db[_0x3a92('0x2d')][_0x3a92('0x2e')],function(_0xacb54d){return{'name':_0xacb54d[_0x3a92('0x2f')],'type':_0xacb54d[_0x3a92('0x30')]['key']};});_0x13972e[_0x3a92('0x31')]=_['map'](_0x561aa7,'name');_0x13972e['query']=_['keys'](_0x23b01b[_0x3a92('0x32')]);_0x13972e['filters']=_[_0x3a92('0x33')](_0x13972e['model'],_0x13972e[_0x3a92('0x32')]);_0x4b5211[_0x3a92('0x34')]=_[_0x3a92('0x33')](_0x13972e[_0x3a92('0x31')],qs['fields'](_0x23b01b[_0x3a92('0x32')][_0x3a92('0x35')]));_0x4b5211['attributes']=_0x4b5211[_0x3a92('0x34')][_0x3a92('0x36')]?_0x4b5211[_0x3a92('0x34')]:_0x13972e[_0x3a92('0x31')];if(!_0x23b01b[_0x3a92('0x32')][_0x3a92('0x37')](_0x3a92('0x38'))){_0x4b5211[_0x3a92('0x1f')]=qs[_0x3a92('0x1f')](_0x23b01b[_0x3a92('0x32')]['limit']);_0x4b5211[_0x3a92('0x1d')]=qs['offset'](_0x23b01b[_0x3a92('0x32')][_0x3a92('0x1d')]);}_0x4b5211[_0x3a92('0x39')]=qs[_0x3a92('0x3a')](_0x23b01b[_0x3a92('0x32')][_0x3a92('0x3a')]);_0x4b5211[_0x3a92('0x3b')]=qs['filters'](_['pick'](_0x23b01b[_0x3a92('0x32')],_0x13972e[_0x3a92('0x3c')]),_0x561aa7);if(_0x23b01b[_0x3a92('0x32')][_0x3a92('0x3d')]){_0x4b5211[_0x3a92('0x3b')]=_[_0x3a92('0x3e')](_0x4b5211[_0x3a92('0x3b')],{'$or':_['map'](_0x561aa7,function(_0x4572a2){if(_0x4572a2[_0x3a92('0x30')]!==_0x3a92('0x3f')){var _0x16c648={};_0x16c648[_0x4572a2[_0x3a92('0x2a')]]={'$like':'%'+_0x23b01b['query'][_0x3a92('0x3d')]+'%'};return _0x16c648;}})});}_0x4b5211=_[_0x3a92('0x3e')]({},_0x4b5211,_0x23b01b['options']);var _0x55a05c={'where':_0x4b5211['where']};return db[_0x3a92('0x2d')][_0x3a92('0x20')](_0x55a05c)[_0x3a92('0x26')](function(_0x318efa){_0x3a0bff[_0x3a92('0x20')]=_0x318efa;if(_0x23b01b[_0x3a92('0x32')][_0x3a92('0x40')]){_0x4b5211['include']=[{'all':!![]}];}return db['DeskAccount'][_0x3a92('0x41')](_0x4b5211);})['then'](function(_0x18a5c7){_0x3a0bff[_0x3a92('0x42')]=_0x18a5c7;return _0x3a0bff;})[_0x3a92('0x26')](respondWithFilteredResult(_0x51a616,_0x4b5211))[_0x3a92('0x43')](handleError(_0x51a616,null));};exports[_0x3a92('0x44')]=function(_0x45f477,_0x6c24db){var _0x2b1cf0={'raw':![],'where':{'id':_0x45f477[_0x3a92('0x45')]['id']}},_0x462cf3={};_0x462cf3[_0x3a92('0x31')]=_['keys'](db[_0x3a92('0x2d')][_0x3a92('0x2e')]);_0x462cf3[_0x3a92('0x32')]=_[_0x3a92('0x46')](_0x45f477[_0x3a92('0x32')]);_0x462cf3[_0x3a92('0x3c')]=_['intersection'](_0x462cf3[_0x3a92('0x31')],_0x462cf3['query']);_0x2b1cf0[_0x3a92('0x34')]=_[_0x3a92('0x33')](_0x462cf3[_0x3a92('0x31')],qs['fields'](_0x45f477[_0x3a92('0x32')][_0x3a92('0x35')]));_0x2b1cf0[_0x3a92('0x34')]=_0x2b1cf0['attributes'][_0x3a92('0x36')]?_0x2b1cf0[_0x3a92('0x34')]:_0x462cf3[_0x3a92('0x31')];if(_0x45f477[_0x3a92('0x32')][_0x3a92('0x40')]){_0x2b1cf0[_0x3a92('0x47')]=[{'all':!![]}];}_0x2b1cf0=_[_0x3a92('0x3e')]({},_0x2b1cf0,_0x45f477[_0x3a92('0x48')]);return db[_0x3a92('0x2d')][_0x3a92('0x49')](_0x2b1cf0)[_0x3a92('0x26')](handleEntityNotFound(_0x6c24db,null))['then'](respondWithResult(_0x6c24db,null))[_0x3a92('0x43')](handleError(_0x6c24db,null));};exports['create']=function(_0x1b438d,_0x5dabb5){return db['DeskAccount'][_0x3a92('0x4a')](_0x1b438d[_0x3a92('0x4b')],{})['then'](respondWithResult(_0x5dabb5,0xc9))[_0x3a92('0x43')](handleError(_0x5dabb5,null));};exports[_0x3a92('0x25')]=function(_0x38c4d4,_0x535c59){if(_0x38c4d4['body']['id']){delete _0x38c4d4[_0x3a92('0x4b')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0x38c4d4['params']['id']}})[_0x3a92('0x26')](handleEntityNotFound(_0x535c59,null))['then'](saveUpdates(_0x38c4d4[_0x3a92('0x4b')],null))['then'](respondWithResult(_0x535c59,null))['catch'](handleError(_0x535c59,null));};exports[_0x3a92('0x4c')]=function(_0x39345d,_0x3b9e88){return db['DeskAccount'][_0x3a92('0x49')]({'where':{'id':_0x39345d[_0x3a92('0x45')]['id']}})[_0x3a92('0x26')](handleEntityNotFound(_0x3b9e88,null))[_0x3a92('0x26')](removeEntity(_0x3b9e88,null))[_0x3a92('0x43')](handleError(_0x3b9e88,null));};exports[_0x3a92('0x4d')]=function(_0x380b3c,_0x19c1cd,_0x2e762f){var _0x17ab37={};var _0x18e190={};var _0x1bc348;var _0x100c25;return db['DeskAccount'][_0x3a92('0x4e')]({'where':{'id':_0x380b3c[_0x3a92('0x45')]['id']}})['then'](handleEntityNotFound(_0x19c1cd,null))[_0x3a92('0x26')](function(_0x42ac23){if(_0x42ac23){_0x1bc348=_0x42ac23;_0x18e190['model']=_[_0x3a92('0x46')](db['DeskConfiguration'][_0x3a92('0x2e')]);_0x18e190[_0x3a92('0x32')]=_['keys'](_0x380b3c[_0x3a92('0x32')]);_0x18e190[_0x3a92('0x3c')]=_[_0x3a92('0x33')](_0x18e190[_0x3a92('0x31')],_0x18e190['query']);_0x17ab37['attributes']=_[_0x3a92('0x33')](_0x18e190['model'],qs[_0x3a92('0x35')](_0x380b3c['query'][_0x3a92('0x35')]));_0x17ab37[_0x3a92('0x34')]=_0x17ab37[_0x3a92('0x34')][_0x3a92('0x36')]?_0x17ab37['attributes']:_0x18e190[_0x3a92('0x31')];_0x17ab37['order']=qs[_0x3a92('0x3a')](_0x380b3c['query']['sort']);_0x17ab37[_0x3a92('0x3b')]=qs[_0x3a92('0x3c')](_[_0x3a92('0x4f')](_0x380b3c[_0x3a92('0x32')],_0x18e190['filters']));if(_0x380b3c['query'][_0x3a92('0x3d')]){_0x17ab37['where']=_['merge'](_0x17ab37['where'],{'$or':_[_0x3a92('0x2c')](_0x17ab37[_0x3a92('0x34')],function(_0x78c81a){var _0x15daa6={};_0x15daa6[_0x78c81a]={'$like':'%'+_0x380b3c[_0x3a92('0x32')]['filter']+'%'};return _0x15daa6;})});}_0x17ab37=_[_0x3a92('0x3e')]({},_0x17ab37,_0x380b3c['options']);return _0x1bc348[_0x3a92('0x4d')](_0x17ab37);}})['then'](function(_0x2b3db6){if(_0x2b3db6){_0x100c25=_0x2b3db6[_0x3a92('0x36')];if(!_0x380b3c[_0x3a92('0x32')][_0x3a92('0x37')](_0x3a92('0x38'))){_0x17ab37['limit']=qs[_0x3a92('0x1f')](_0x380b3c[_0x3a92('0x32')][_0x3a92('0x1f')]);_0x17ab37[_0x3a92('0x1d')]=qs[_0x3a92('0x1d')](_0x380b3c[_0x3a92('0x32')][_0x3a92('0x1d')]);}return _0x1bc348[_0x3a92('0x4d')](_0x17ab37);}})[_0x3a92('0x26')](function(_0x2d61c6){if(_0x2d61c6){return _0x2d61c6?{'count':_0x100c25,'rows':_0x2d61c6}:null;}})[_0x3a92('0x26')](respondWithResult(_0x19c1cd,null))['catch'](handleError(_0x19c1cd,null));};exports[_0x3a92('0x50')]=function(_0x29ef29,_0x343f01,_0x44ee24){if(_0x29ef29[_0x3a92('0x4b')]['id']){delete _0x29ef29[_0x3a92('0x4b')]['id'];}return db[_0x3a92('0x2d')]['findOne']({'where':{'id':_0x29ef29[_0x3a92('0x45')]['id']}})[_0x3a92('0x26')](handleEntityNotFound(_0x343f01,null))['then'](function(_0x59348f){if(_0x59348f){_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x51')]=_0x59348f['id'];_0x29ef29[_0x3a92('0x4b')]['Subjects']=integrations[_0x3a92('0x52')](_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x53')],_0x29ef29['body'][_0x3a92('0x30')]);_0x29ef29['body'][_0x3a92('0x54')]=integrations[_0x3a92('0x55')](_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x53')],_0x29ef29[_0x3a92('0x4b')][_0x3a92('0x30')]);return db[_0x3a92('0x56')]['create'](_0x29ef29[_0x3a92('0x4b')],{'include':[{'model':db['DeskField'],'as':_0x3a92('0x57')},{'model':db[_0x3a92('0x58')],'as':'Descriptions'}]});}return null;})[_0x3a92('0x26')](respondWithResult(_0x343f01,null))[_0x3a92('0x43')](handleError(_0x343f01,null));};exports[_0x3a92('0x59')]=function(_0x23ec52,_0x19340a,_0xb0201c){var _0x353efd=[{'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 _0x548d6b='';return db[_0x3a92('0x2d')][_0x3a92('0x4e')]({'where':{'id':_0x23ec52[_0x3a92('0x45')]['id']},'attributes':['id',_0x3a92('0x5a'),_0x3a92('0x5b'),_0x3a92('0x5c'),_0x3a92('0x5d'),_0x3a92('0x5e'),_0x3a92('0x5f'),_0x3a92('0x60'),_0x3a92('0x61')]})['then'](handleEntityNotFound(_0x19340a,null))['then'](function(_0x1d01d5){if(_0x1d01d5){_0x548d6b=_0x1d01d5[_0x3a92('0x5a')];var _0x4b0e86=_0x548d6b[_0x3a92('0x62')](-0x1);if(_0x4b0e86==='/'){_0x548d6b=_0x548d6b[_0x3a92('0x63')](0x0,_0x548d6b[_0x3a92('0x64')](_0x4b0e86));}var _0x415cef={'method':_0x3a92('0x65'),'uri':util['format']('%s/custom_fields',_0x548d6b),'headers':{'Content-Type':_0x3a92('0x66'),'Accept':_0x3a92('0x66')},'json':!![]};if(_0x1d01d5[_0x3a92('0x5b')]===_0x3a92('0x67')){_0x415cef[_0x3a92('0x68')]['Authorization']=util[_0x3a92('0x69')](_0x3a92('0x6a'),new Buffer(util[_0x3a92('0x69')](_0x3a92('0x6b'),_0x1d01d5[_0x3a92('0x5c')],_0x1d01d5[_0x3a92('0x5d')]))['toString'](_0x3a92('0x6c')));}return rp(_0x415cef)[_0x3a92('0x26')](function(_0x331c77){return _0x353efd['concat'](_[_0x3a92('0x2c')](_0x331c77[_0x3a92('0x6d')][_0x3a92('0x6e')],function(_0xcda38b){return{'id':_0xcda38b['name'],'name':_0xcda38b[_0x3a92('0x2a')],'type':_0xcda38b[_0x3a92('0x30')],'active':_0xcda38b[_0x3a92('0x6f')],'label':_0xcda38b[_0x3a92('0x70')],'custom':!![]};}));});}})['then'](function(_0xf12eef){return{'count':_0xf12eef[_0x3a92('0x36')],'rows':_0xf12eef};})[_0x3a92('0x26')](respondWithResult(_0x19340a,null))[_0x3a92('0x43')](function(_0x424488){var _0x194211=_0x23ec52['query'][_0x3a92('0x71')]?0x1f4:_0x424488[_0x3a92('0x72')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x194211,JSON[_0x3a92('0x73')](_0x424488));delete _0x424488[_0x3a92('0x2a')];if(_0x194211===0x191){_0x194211=0x190;}_0x19340a[_0x3a92('0x21')](_0x194211)[_0x3a92('0x2b')](_0x23ec52[_0x3a92('0x32')][_0x3a92('0x71')]?{'message':_0x3a92('0x74'),'statusCode':_0x424488[_0x3a92('0x72')]}:_0x424488);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index ecd2902..3547c13 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 _0xfc08=['./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment'];(function(_0x12af72,_0x16c27e){var _0x393472=function(_0x2009c3){while(--_0x2009c3){_0x12af72['push'](_0x12af72['shift']());}};_0x393472(++_0x16c27e);}(_0xfc08,0x101));var _0x8fc0=function(_0x308d75,_0x33120e){_0x308d75=_0x308d75-0x0;var _0x573d5e=_0xfc08[_0x308d75];return _0x573d5e;};'use strict';var _=require(_0x8fc0('0x0'));var util=require(_0x8fc0('0x1'));var logger=require(_0x8fc0('0x2'))('api');var moment=require(_0x8fc0('0x3'));var BPromise=require('bluebird');var rp=require(_0x8fc0('0x4'));var fs=require('fs');var path=require(_0x8fc0('0x5'));var rimraf=require('rimraf');var config=require(_0x8fc0('0x6'));var attributes=require(_0x8fc0('0x7'));var integrations=require(_0x8fc0('0x8'));module['exports']=function(_0x122aa1,_0x560606){return _0x122aa1[_0x8fc0('0x9')](_0x8fc0('0xa'),attributes,{'tableName':_0x8fc0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd398=['../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','define','DeskAccount','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x1971ac,_0x115521){var _0x400354=function(_0x12719a){while(--_0x12719a){_0x1971ac['push'](_0x1971ac['shift']());}};_0x400354(++_0x115521);}(_0xd398,0x1d9));var _0x8d39=function(_0x6a9297,_0x5487ad){_0x6a9297=_0x6a9297-0x0;var _0x5ee147=_0xd398[_0x6a9297];return _0x5ee147;};'use strict';var _=require('lodash');var util=require(_0x8d39('0x0'));var logger=require(_0x8d39('0x1'))(_0x8d39('0x2'));var moment=require('moment');var BPromise=require(_0x8d39('0x3'));var rp=require(_0x8d39('0x4'));var fs=require('fs');var path=require(_0x8d39('0x5'));var rimraf=require(_0x8d39('0x6'));var config=require(_0x8d39('0x7'));var attributes=require(_0x8d39('0x8'));var integrations=require(_0x8d39('0x9'));module['exports']=function(_0x1ba747,_0x552fb9){return _0x1ba747[_0x8d39('0xa')](_0x8d39('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 743a556..55a1723 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 _0xb7cc=['debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','include','map','model','then','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xb7cc,0xbd));var _0xcb7c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xb7cc[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xcb7c('0x0'));var util=require(_0xcb7c('0x1'));var moment=require(_0xcb7c('0x2'));var BPromise=require('bluebird');var rs=require(_0xcb7c('0x3'));var fs=require('fs');var Redis=require(_0xcb7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcb7c('0x5'))(_0xcb7c('0x6'));var config=require(_0xcb7c('0x7'));var jayson=require(_0xcb7c('0x8'));var client=jayson[_0xcb7c('0x9')][_0xcb7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x409406,_0x148165,_0x5cde6e){return new BPromise(function(_0x373036,_0x145b95){return client[_0xcb7c('0xb')](_0x409406,_0x5cde6e)['then'](function(_0x419072){logger[_0xcb7c('0xc')](_0xcb7c('0xd'),_0x148165,_0xcb7c('0xe'));logger[_0xcb7c('0xf')](_0xcb7c('0x10'),_0x148165,_0xcb7c('0xe'),JSON[_0xcb7c('0x11')](_0x419072));if(_0x419072[_0xcb7c('0x12')]){if(_0x419072[_0xcb7c('0x12')][_0xcb7c('0x13')]===0x1f4){logger[_0xcb7c('0x12')]('DeskAccount,\x20%s,\x20%s',_0x148165,_0x419072[_0xcb7c('0x12')][_0xcb7c('0x14')]);return _0x145b95(_0x419072[_0xcb7c('0x12')][_0xcb7c('0x14')]);}logger[_0xcb7c('0x12')](_0xcb7c('0xd'),_0x148165,_0x419072[_0xcb7c('0x12')][_0xcb7c('0x14')]);return _0x373036(_0x419072[_0xcb7c('0x12')]['message']);}else{logger[_0xcb7c('0xc')](_0xcb7c('0xd'),_0x148165,_0xcb7c('0xe'));_0x373036(_0x419072['result'][_0xcb7c('0x14')]);}})[_0xcb7c('0x15')](function(_0x36c270){logger[_0xcb7c('0x12')]('DeskAccount,\x20%s,\x20%s',_0x148165,_0x36c270);_0x145b95(_0x36c270);});});}exports[_0xcb7c('0x16')]=function(_0x1d97ef){var _0x1604d7=this;return new Promise(function(_0x1be8ee,_0xfc146b){return db[_0xcb7c('0x17')][_0xcb7c('0x18')]({'raw':_0x1d97ef[_0xcb7c('0x19')]?_0x1d97ef[_0xcb7c('0x19')][_0xcb7c('0x1a')]===undefined?!![]:![]:!![],'where':_0x1d97ef['options']?_0x1d97ef[_0xcb7c('0x19')]['where']||null:null,'attributes':_0x1d97ef[_0xcb7c('0x19')]?_0x1d97ef[_0xcb7c('0x19')][_0xcb7c('0x1b')]||null:null,'limit':_0x1d97ef[_0xcb7c('0x19')]?_0x1d97ef['options']['limit']||null:null,'include':_0x1d97ef['options']?_0x1d97ef['options'][_0xcb7c('0x1c')]?_['map'](_0x1d97ef[_0xcb7c('0x19')][_0xcb7c('0x1c')],function(_0x320bb8){return{'model':db[_0x320bb8['model']],'as':_0x320bb8['as'],'attributes':_0x320bb8[_0xcb7c('0x1b')],'include':_0x320bb8[_0xcb7c('0x1c')]?_[_0xcb7c('0x1d')](_0x320bb8[_0xcb7c('0x1c')],function(_0x3901ae){return{'model':db[_0x3901ae[_0xcb7c('0x1e')]],'as':_0x3901ae['as'],'attributes':_0x3901ae['attributes'],'include':_0x3901ae[_0xcb7c('0x1c')]?_[_0xcb7c('0x1d')](_0x3901ae[_0xcb7c('0x1c')],function(_0x3677c9){return{'model':db[_0x3677c9['model']],'as':_0x3677c9['as'],'attributes':_0x3677c9[_0xcb7c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcb7c('0x1f')](function(_0x1d3105){logger[_0xcb7c('0xc')]('GetDeskAccount',_0x1d97ef);logger[_0xcb7c('0xf')](_0xcb7c('0x16'),_0x1d97ef,JSON['stringify'](_0x1d3105));_0x1be8ee(_0x1d3105);})[_0xcb7c('0x15')](function(_0x22aff){logger['error'](_0xcb7c('0x16'),_0x22aff[_0xcb7c('0x14')],_0x1d97ef);_0xfc146b(_0x1604d7[_0xcb7c('0x12')](0x1f4,_0x22aff[_0xcb7c('0x14')]));});});};exports[_0xcb7c('0x20')]=function(_0x5660ef){var _0x169b41=this;return new Promise(function(_0x37b618,_0x3e1c42){return db[_0xcb7c('0x17')][_0xcb7c('0x21')]({'raw':_0x5660ef[_0xcb7c('0x19')]?_0x5660ef[_0xcb7c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5660ef['options']?_0x5660ef['options']['where']||null:null,'attributes':_0x5660ef[_0xcb7c('0x19')]?_0x5660ef[_0xcb7c('0x19')]['attributes']||null:null,'include':_0x5660ef[_0xcb7c('0x19')]?_0x5660ef['options'][_0xcb7c('0x1c')]?_[_0xcb7c('0x1d')](_0x5660ef[_0xcb7c('0x19')][_0xcb7c('0x1c')],function(_0x20e219){return{'model':db[_0x20e219[_0xcb7c('0x1e')]],'as':_0x20e219['as'],'attributes':_0x20e219[_0xcb7c('0x1b')],'include':_0x20e219['include']?_[_0xcb7c('0x1d')](_0x20e219[_0xcb7c('0x1c')],function(_0x5909bb){return{'model':db[_0x5909bb[_0xcb7c('0x1e')]],'as':_0x5909bb['as'],'attributes':_0x5909bb['attributes'],'include':_0x5909bb[_0xcb7c('0x1c')]?_[_0xcb7c('0x1d')](_0x5909bb[_0xcb7c('0x1c')],function(_0x3d00c8){return{'model':db[_0x3d00c8['model']],'as':_0x3d00c8['as'],'attributes':_0x3d00c8[_0xcb7c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xcb7c('0x1f')](function(_0x3b928f){logger[_0xcb7c('0xc')](_0xcb7c('0x20'),_0x5660ef);logger['debug'](_0xcb7c('0x20'),_0x5660ef,JSON[_0xcb7c('0x11')](_0x3b928f));_0x37b618(_0x3b928f);})[_0xcb7c('0x15')](function(_0x3ba68e){logger[_0xcb7c('0x12')](_0xcb7c('0x20'),_0x3ba68e[_0xcb7c('0x14')],_0x5660ef);_0x3e1c42(_0x169b41[_0xcb7c('0x12')](0x1f4,_0x3ba68e['message']));});});}; \ No newline at end of file +var _0x513a=['code','message','request\x20sent','result','catch','GetDeskAccount','DeskAccount','options','where','attributes','include','model','map','ShowDeskAccount','find','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13d617,_0x34d3ce){var _0x381c74=function(_0x12b0f8){while(--_0x12b0f8){_0x13d617['push'](_0x13d617['shift']());}};_0x381c74(++_0x34d3ce);}(_0x513a,0x1cf));var _0xa513=function(_0x6d31bf,_0x30b243){_0x6d31bf=_0x6d31bf-0x0;var _0x367ef8=_0x513a[_0x6d31bf];return _0x367ef8;};'use strict';var _=require(_0xa513('0x0'));var util=require(_0xa513('0x1'));var moment=require('moment');var BPromise=require(_0xa513('0x2'));var rs=require(_0xa513('0x3'));var fs=require('fs');var Redis=require(_0xa513('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa513('0x5'));var config=require(_0xa513('0x6'));var jayson=require(_0xa513('0x7'));var client=jayson[_0xa513('0x8')][_0xa513('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x488435,_0x35bbd1,_0x290a96){return new BPromise(function(_0x3bc36f,_0x358c41){return client['request'](_0x488435,_0x290a96)[_0xa513('0xa')](function(_0xa7d948){logger[_0xa513('0xb')](_0xa513('0xc'),_0x35bbd1,'request\x20sent');logger[_0xa513('0xd')](_0xa513('0xe'),_0x35bbd1,'request\x20sent',JSON[_0xa513('0xf')](_0xa7d948));if(_0xa7d948[_0xa513('0x10')]){if(_0xa7d948[_0xa513('0x10')][_0xa513('0x11')]===0x1f4){logger[_0xa513('0x10')](_0xa513('0xc'),_0x35bbd1,_0xa7d948[_0xa513('0x10')]['message']);return _0x358c41(_0xa7d948[_0xa513('0x10')][_0xa513('0x12')]);}logger['error'](_0xa513('0xc'),_0x35bbd1,_0xa7d948['error'][_0xa513('0x12')]);return _0x3bc36f(_0xa7d948['error'][_0xa513('0x12')]);}else{logger[_0xa513('0xb')](_0xa513('0xc'),_0x35bbd1,_0xa513('0x13'));_0x3bc36f(_0xa7d948[_0xa513('0x14')][_0xa513('0x12')]);}})[_0xa513('0x15')](function(_0x2e346f){logger[_0xa513('0x10')](_0xa513('0xc'),_0x35bbd1,_0x2e346f);_0x358c41(_0x2e346f);});});}exports[_0xa513('0x16')]=function(_0xcbdc28){var _0x573c27=this;return new Promise(function(_0x33b4fa,_0x3e201d){return db[_0xa513('0x17')]['findAll']({'raw':_0xcbdc28['options']?_0xcbdc28['options']['raw']===undefined?!![]:![]:!![],'where':_0xcbdc28[_0xa513('0x18')]?_0xcbdc28['options'][_0xa513('0x19')]||null:null,'attributes':_0xcbdc28['options']?_0xcbdc28[_0xa513('0x18')][_0xa513('0x1a')]||null:null,'limit':_0xcbdc28[_0xa513('0x18')]?_0xcbdc28[_0xa513('0x18')]['limit']||null:null,'include':_0xcbdc28[_0xa513('0x18')]?_0xcbdc28['options']['include']?_['map'](_0xcbdc28[_0xa513('0x18')][_0xa513('0x1b')],function(_0x57b8e5){return{'model':db[_0x57b8e5[_0xa513('0x1c')]],'as':_0x57b8e5['as'],'attributes':_0x57b8e5['attributes'],'include':_0x57b8e5[_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x57b8e5[_0xa513('0x1b')],function(_0x5092dd){return{'model':db[_0x5092dd[_0xa513('0x1c')]],'as':_0x5092dd['as'],'attributes':_0x5092dd['attributes'],'include':_0x5092dd[_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x5092dd[_0xa513('0x1b')],function(_0x20d459){return{'model':db[_0x20d459[_0xa513('0x1c')]],'as':_0x20d459['as'],'attributes':_0x20d459[_0xa513('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa513('0xa')](function(_0x553d30){logger['info'](_0xa513('0x16'),_0xcbdc28);logger[_0xa513('0xd')](_0xa513('0x16'),_0xcbdc28,JSON[_0xa513('0xf')](_0x553d30));_0x33b4fa(_0x553d30);})[_0xa513('0x15')](function(_0x12313e){logger['error'](_0xa513('0x16'),_0x12313e[_0xa513('0x12')],_0xcbdc28);_0x3e201d(_0x573c27[_0xa513('0x10')](0x1f4,_0x12313e[_0xa513('0x12')]));});});};exports[_0xa513('0x1e')]=function(_0x24b9d6){var _0x30ca4b=this;return new Promise(function(_0x40ea33,_0x507193){return db['DeskAccount'][_0xa513('0x1f')]({'raw':_0x24b9d6['options']?_0x24b9d6[_0xa513('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x24b9d6[_0xa513('0x18')]?_0x24b9d6[_0xa513('0x18')][_0xa513('0x19')]||null:null,'attributes':_0x24b9d6['options']?_0x24b9d6['options']['attributes']||null:null,'include':_0x24b9d6[_0xa513('0x18')]?_0x24b9d6[_0xa513('0x18')][_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x24b9d6[_0xa513('0x18')]['include'],function(_0x537cc6){return{'model':db[_0x537cc6[_0xa513('0x1c')]],'as':_0x537cc6['as'],'attributes':_0x537cc6['attributes'],'include':_0x537cc6[_0xa513('0x1b')]?_[_0xa513('0x1d')](_0x537cc6[_0xa513('0x1b')],function(_0x25eace){return{'model':db[_0x25eace[_0xa513('0x1c')]],'as':_0x25eace['as'],'attributes':_0x25eace[_0xa513('0x1a')],'include':_0x25eace[_0xa513('0x1b')]?_['map'](_0x25eace[_0xa513('0x1b')],function(_0x59dae6){return{'model':db[_0x59dae6[_0xa513('0x1c')]],'as':_0x59dae6['as'],'attributes':_0x59dae6[_0xa513('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3ad5){logger['info'](_0xa513('0x1e'),_0x24b9d6);logger[_0xa513('0xd')](_0xa513('0x1e'),_0x24b9d6,JSON['stringify'](_0x2b3ad5));_0x40ea33(_0x2b3ad5);})[_0xa513('0x15')](function(_0x4b5897){logger[_0xa513('0x10')](_0xa513('0x1e'),_0x4b5897[_0xa513('0x12')],_0x24b9d6);_0x507193(_0x30ca4b[_0xa513('0x10')](0x1f4,_0x4b5897[_0xa513('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 5741799..4a58bae 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(_0x402a8d,_0x484c1a){var _0x3144bb=function(_0x4d2f2d){while(--_0x4d2f2d){_0x402a8d['push'](_0x402a8d['shift']());}};_0x3144bb(++_0x484c1a);}(_0xedd9,0xfc));var _0x9edd=function(_0x49ab57,_0xcf5107){_0x49ab57=_0x49ab57-0x0;var _0x3b40dc=_0xedd9[_0x49ab57];return _0x3b40dc;};'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(_0x2e7bb3,_0x4037b1){var _0x286c7a=function(_0x138cdf){while(--_0x138cdf){_0x2e7bb3['push'](_0x2e7bb3['shift']());}};_0x286c7a(++_0x4037b1);}(_0x008c,0x188));var _0xc008=function(_0x167914,_0x87b5a){_0x167914=_0x167914-0x0;var _0x5e5d79=_0x008c[_0x167914];return _0x5e5d79;};'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 db57317..d716f71 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 _0xf678=['sequelize','STRING'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xf678,0x1c8));var _0x8f67=function(_0x32c54a,_0x55ea95){_0x32c54a=_0x32c54a-0x0;var _0x17275f=_0xf678[_0x32c54a];return _0x17275f;};'use strict';var Sequelize=require(_0x8f67('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8f67('0x1')]}}; \ No newline at end of file +var _0x9cbd=['sequelize','STRING'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x9cbd,0x1ea));var _0xd9cb=function(_0x58a5ce,_0xa05f14){_0x58a5ce=_0x58a5ce-0x0;var _0x12b5b0=_0x9cbd[_0x58a5ce];return _0x12b5b0;};'use strict';var Sequelize=require(_0xd9cb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd9cb('0x1')]},'description':{'type':Sequelize[_0xd9cb('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 1e7047e..5176f74 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 _0x3d84=['ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','DeskConfiguration','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','catch','show','rawAttributes','create','body','find','params','getFields','findOne','DeskField','options','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv'];(function(_0x3e21f4,_0x43d310){var _0x40fc49=function(_0x54a8f6){while(--_0x54a8f6){_0x3e21f4['push'](_0x3e21f4['shift']());}};_0x40fc49(++_0x43d310);}(_0x3d84,0xf0));var _0x43d8=function(_0x5ee64e,_0x4ed333){_0x5ee64e=_0x5ee64e-0x0;var _0x463c9d=_0x3d84[_0x5ee64e];return _0x463c9d;};'use strict';var emlformat=require(_0x43d8('0x0'));var rimraf=require(_0x43d8('0x1'));var zipdir=require(_0x43d8('0x2'));var jsonpatch=require(_0x43d8('0x3'));var rp=require(_0x43d8('0x4'));var moment=require('moment');var BPromise=require(_0x43d8('0x5'));var Mustache=require(_0x43d8('0x6'));var util=require('util');var path=require('path');var sox=require(_0x43d8('0x7'));var csv=require(_0x43d8('0x8'));var ejs=require(_0x43d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x43d8('0xa'));var squel=require(_0x43d8('0xb'));var crypto=require(_0x43d8('0xc'));var jsforce=require(_0x43d8('0xd'));var deskjs=require(_0x43d8('0xe'));var toCsv=require(_0x43d8('0x8'));var querystring=require(_0x43d8('0xf'));var Papa=require(_0x43d8('0x10'));var Redis=require(_0x43d8('0x11'));var authService=require(_0x43d8('0x12'));var qs=require(_0x43d8('0x13'));var as=require(_0x43d8('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d8('0x15'))('api');var utils=require(_0x43d8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x43d8('0x17'))['db'];function respondWithStatusCode(_0x183e3f,_0x2e437d){_0x2e437d=_0x2e437d||0xcc;return function(_0x18989d){if(_0x18989d){return _0x183e3f['sendStatus'](_0x2e437d);}return _0x183e3f['status'](_0x2e437d)[_0x43d8('0x18')]();};}function respondWithResult(_0x53c42d,_0x11c9d2){_0x11c9d2=_0x11c9d2||0xc8;return function(_0x56747a){if(_0x56747a){return _0x53c42d[_0x43d8('0x19')](_0x11c9d2)[_0x43d8('0x1a')](_0x56747a);}};}function respondWithFilteredResult(_0x23861a,_0x36cb9d){return function(_0x2873be){if(_0x2873be){var _0xc92d51=typeof _0x36cb9d[_0x43d8('0x1b')]===_0x43d8('0x1c')&&typeof _0x36cb9d[_0x43d8('0x1d')]==='undefined';var _0x53a66f=_0x2873be[_0x43d8('0x1e')];var _0xf1ef8e=_0xc92d51?0x0:_0x36cb9d[_0x43d8('0x1b')];var _0x5920d6=_0xc92d51?_0x2873be[_0x43d8('0x1e')]:_0x36cb9d[_0x43d8('0x1b')]+_0x36cb9d['limit'];var _0x1ef8f4;if(_0x5920d6>=_0x53a66f){_0x5920d6=_0x53a66f;_0x1ef8f4=0xc8;}else{_0x1ef8f4=0xce;}_0x23861a['status'](_0x1ef8f4);return _0x23861a[_0x43d8('0x1f')](_0x43d8('0x20'),_0xf1ef8e+'-'+_0x5920d6+'/'+_0x53a66f)[_0x43d8('0x1a')](_0x2873be);}return null;};}function patchUpdates(_0x2e0adb){return function(_0x376338){try{jsonpatch['apply'](_0x376338,_0x2e0adb,!![]);}catch(_0x439a71){return BPromise[_0x43d8('0x21')](_0x439a71);}return _0x376338[_0x43d8('0x22')]();};}function saveUpdates(_0x5307ff,_0x32604d){return function(_0x3f9a09){if(_0x3f9a09){return _0x3f9a09[_0x43d8('0x23')](_0x5307ff)[_0x43d8('0x24')](function(_0x569e1d){return _0x569e1d;});}return null;};}function removeEntity(_0x1d66bd,_0x2bba76){return function(_0x235740){if(_0x235740){return _0x235740[_0x43d8('0x25')]()['then'](function(){_0x1d66bd[_0x43d8('0x19')](0xcc)[_0x43d8('0x18')]();});}};}function handleEntityNotFound(_0x1a3d43,_0x3029bc){return function(_0x5964e2){if(!_0x5964e2){_0x1a3d43[_0x43d8('0x26')](0x194);}return _0x5964e2;};}function handleError(_0x42f1a1,_0x5599d8){_0x5599d8=_0x5599d8||0x1f4;return function(_0x1e5430){logger['error'](_0x1e5430[_0x43d8('0x27')]);if(_0x1e5430[_0x43d8('0x28')]){delete _0x1e5430[_0x43d8('0x28')];}_0x42f1a1[_0x43d8('0x19')](_0x5599d8)[_0x43d8('0x29')](_0x1e5430);};}exports[_0x43d8('0x2a')]=function(_0x2ecfb5,_0x1fce18){var _0x5b16e8={},_0x5082f3={},_0x282a4c={'count':0x0,'rows':[]};var _0x3db32e=_[_0x43d8('0x2b')](db[_0x43d8('0x2c')]['rawAttributes'],function(_0x4291b0){return{'name':_0x4291b0['fieldName'],'type':_0x4291b0[_0x43d8('0x2d')][_0x43d8('0x2e')]};});_0x5082f3[_0x43d8('0x2f')]=_['map'](_0x3db32e,_0x43d8('0x28'));_0x5082f3[_0x43d8('0x30')]=_[_0x43d8('0x31')](_0x2ecfb5[_0x43d8('0x30')]);_0x5082f3[_0x43d8('0x32')]=_[_0x43d8('0x33')](_0x5082f3[_0x43d8('0x2f')],_0x5082f3[_0x43d8('0x30')]);_0x5b16e8['attributes']=_[_0x43d8('0x33')](_0x5082f3['model'],qs[_0x43d8('0x34')](_0x2ecfb5[_0x43d8('0x30')][_0x43d8('0x34')]));_0x5b16e8[_0x43d8('0x35')]=_0x5b16e8[_0x43d8('0x35')][_0x43d8('0x36')]?_0x5b16e8[_0x43d8('0x35')]:_0x5082f3[_0x43d8('0x2f')];if(!_0x2ecfb5['query'][_0x43d8('0x37')](_0x43d8('0x38'))){_0x5b16e8[_0x43d8('0x1d')]=qs['limit'](_0x2ecfb5[_0x43d8('0x30')]['limit']);_0x5b16e8[_0x43d8('0x1b')]=qs[_0x43d8('0x1b')](_0x2ecfb5[_0x43d8('0x30')][_0x43d8('0x1b')]);}_0x5b16e8[_0x43d8('0x39')]=qs[_0x43d8('0x3a')](_0x2ecfb5[_0x43d8('0x30')]['sort']);_0x5b16e8['where']=qs['filters'](_[_0x43d8('0x3b')](_0x2ecfb5['query'],_0x5082f3[_0x43d8('0x32')]),_0x3db32e);if(_0x2ecfb5['query'][_0x43d8('0x3c')]){_0x5b16e8[_0x43d8('0x3d')]=_['merge'](_0x5b16e8[_0x43d8('0x3d')],{'$or':_[_0x43d8('0x2b')](_0x3db32e,function(_0x2de844){if(_0x2de844[_0x43d8('0x2d')]!==_0x43d8('0x3e')){var _0x4684ac={};_0x4684ac[_0x2de844[_0x43d8('0x28')]]={'$like':'%'+_0x2ecfb5['query'][_0x43d8('0x3c')]+'%'};return _0x4684ac;}})});}_0x5b16e8=_[_0x43d8('0x3f')]({},_0x5b16e8,_0x2ecfb5['options']);var _0x408a51={'where':_0x5b16e8[_0x43d8('0x3d')]};return db[_0x43d8('0x2c')][_0x43d8('0x1e')](_0x408a51)[_0x43d8('0x24')](function(_0x2e9c77){_0x282a4c['count']=_0x2e9c77;if(_0x2ecfb5[_0x43d8('0x30')][_0x43d8('0x40')]){_0x5b16e8[_0x43d8('0x41')]=[{'all':!![]}];}return db[_0x43d8('0x2c')][_0x43d8('0x42')](_0x5b16e8);})[_0x43d8('0x24')](function(_0x493f97){_0x282a4c['rows']=_0x493f97;return _0x282a4c;})[_0x43d8('0x24')](respondWithFilteredResult(_0x1fce18,_0x5b16e8))[_0x43d8('0x43')](handleError(_0x1fce18,null));};exports[_0x43d8('0x44')]=function(_0x39a4d6,_0x5a35fe){var _0x2c17a2={'raw':![],'where':{'id':_0x39a4d6['params']['id']}},_0x247946={};_0x247946[_0x43d8('0x2f')]=_['keys'](db[_0x43d8('0x2c')][_0x43d8('0x45')]);_0x247946['query']=_['keys'](_0x39a4d6[_0x43d8('0x30')]);_0x247946[_0x43d8('0x32')]=_[_0x43d8('0x33')](_0x247946['model'],_0x247946[_0x43d8('0x30')]);_0x2c17a2[_0x43d8('0x35')]=_[_0x43d8('0x33')](_0x247946[_0x43d8('0x2f')],qs[_0x43d8('0x34')](_0x39a4d6[_0x43d8('0x30')][_0x43d8('0x34')]));_0x2c17a2['attributes']=_0x2c17a2[_0x43d8('0x35')]['length']?_0x2c17a2[_0x43d8('0x35')]:_0x247946['model'];if(_0x39a4d6[_0x43d8('0x30')][_0x43d8('0x40')]){_0x2c17a2[_0x43d8('0x41')]=[{'all':!![]}];}_0x2c17a2=_[_0x43d8('0x3f')]({},_0x2c17a2,_0x39a4d6['options']);return db[_0x43d8('0x2c')]['find'](_0x2c17a2)[_0x43d8('0x24')](handleEntityNotFound(_0x5a35fe,null))[_0x43d8('0x24')](respondWithResult(_0x5a35fe,null))['catch'](handleError(_0x5a35fe,null));};exports[_0x43d8('0x46')]=function(_0x3a060d,_0x39abab){return db['DeskConfiguration'][_0x43d8('0x46')](_0x3a060d[_0x43d8('0x47')],{})[_0x43d8('0x24')](respondWithResult(_0x39abab,0xc9))['catch'](handleError(_0x39abab,null));};exports[_0x43d8('0x23')]=function(_0x2da593,_0x347a43){if(_0x2da593[_0x43d8('0x47')]['id']){delete _0x2da593[_0x43d8('0x47')]['id'];}return db[_0x43d8('0x2c')]['find']({'where':{'id':_0x2da593['params']['id']}})[_0x43d8('0x24')](handleEntityNotFound(_0x347a43,null))[_0x43d8('0x24')](saveUpdates(_0x2da593[_0x43d8('0x47')],null))[_0x43d8('0x24')](respondWithResult(_0x347a43,null))[_0x43d8('0x43')](handleError(_0x347a43,null));};exports['destroy']=function(_0x4a19cb,_0xc9bff2){return db[_0x43d8('0x2c')][_0x43d8('0x48')]({'where':{'id':_0x4a19cb[_0x43d8('0x49')]['id']}})[_0x43d8('0x24')](handleEntityNotFound(_0xc9bff2,null))[_0x43d8('0x24')](removeEntity(_0xc9bff2,null))[_0x43d8('0x43')](handleError(_0xc9bff2,null));};exports[_0x43d8('0x4a')]=function(_0x16bfe8,_0x1470f7,_0x406d08){var _0x2a91a9={};var _0x583850={};var _0x2c9b5b;var _0x20a128;return db[_0x43d8('0x2c')][_0x43d8('0x4b')]({'where':{'id':_0x16bfe8[_0x43d8('0x49')]['id']}})[_0x43d8('0x24')](handleEntityNotFound(_0x1470f7,null))[_0x43d8('0x24')](function(_0x4d0f84){if(_0x4d0f84){_0x2c9b5b=_0x4d0f84;_0x583850[_0x43d8('0x2f')]=_['keys'](db[_0x43d8('0x4c')][_0x43d8('0x45')]);_0x583850[_0x43d8('0x30')]=_['keys'](_0x16bfe8[_0x43d8('0x30')]);_0x583850[_0x43d8('0x32')]=_['intersection'](_0x583850['model'],_0x583850[_0x43d8('0x30')]);_0x2a91a9[_0x43d8('0x35')]=_[_0x43d8('0x33')](_0x583850[_0x43d8('0x2f')],qs['fields'](_0x16bfe8[_0x43d8('0x30')][_0x43d8('0x34')]));_0x2a91a9['attributes']=_0x2a91a9[_0x43d8('0x35')][_0x43d8('0x36')]?_0x2a91a9['attributes']:_0x583850[_0x43d8('0x2f')];_0x2a91a9[_0x43d8('0x39')]=qs[_0x43d8('0x3a')](_0x16bfe8[_0x43d8('0x30')]['sort']);_0x2a91a9[_0x43d8('0x3d')]=qs[_0x43d8('0x32')](_[_0x43d8('0x3b')](_0x16bfe8[_0x43d8('0x30')],_0x583850[_0x43d8('0x32')]));if(_0x16bfe8[_0x43d8('0x30')][_0x43d8('0x3c')]){_0x2a91a9[_0x43d8('0x3d')]=_['merge'](_0x2a91a9['where'],{'$or':_[_0x43d8('0x2b')](_0x2a91a9['attributes'],function(_0x5e1201){var _0x3f318a={};_0x3f318a[_0x5e1201]={'$like':'%'+_0x16bfe8[_0x43d8('0x30')]['filter']+'%'};return _0x3f318a;})});}_0x2a91a9=_[_0x43d8('0x3f')]({},_0x2a91a9,_0x16bfe8[_0x43d8('0x4d')]);return _0x2c9b5b[_0x43d8('0x4a')](_0x2a91a9);}})['then'](function(_0x3da2f7){if(_0x3da2f7){_0x20a128=_0x3da2f7['length'];if(!_0x16bfe8['query'][_0x43d8('0x37')]('nolimit')){_0x2a91a9[_0x43d8('0x1d')]=qs['limit'](_0x16bfe8[_0x43d8('0x30')][_0x43d8('0x1d')]);_0x2a91a9[_0x43d8('0x1b')]=qs[_0x43d8('0x1b')](_0x16bfe8[_0x43d8('0x30')][_0x43d8('0x1b')]);}return _0x2c9b5b[_0x43d8('0x4a')](_0x2a91a9);}})[_0x43d8('0x24')](function(_0x422a54){if(_0x422a54){return _0x422a54?{'count':_0x20a128,'rows':_0x422a54}:null;}})[_0x43d8('0x24')](respondWithResult(_0x1470f7,null))['catch'](handleError(_0x1470f7,null));};exports['getSubjects']=function(_0x1f54d7,_0x5048db,_0xad784){var _0x1f80ea={};var _0x3e4794={};var _0x5f5cdb;var _0x42e530;return db[_0x43d8('0x2c')]['findOne']({'where':{'id':_0x1f54d7[_0x43d8('0x49')]['id']}})[_0x43d8('0x24')](handleEntityNotFound(_0x5048db,null))[_0x43d8('0x24')](function(_0x376154){if(_0x376154){_0x5f5cdb=_0x376154;_0x3e4794[_0x43d8('0x2f')]=_[_0x43d8('0x31')](db[_0x43d8('0x4c')]['rawAttributes']);_0x3e4794[_0x43d8('0x30')]=_[_0x43d8('0x31')](_0x1f54d7[_0x43d8('0x30')]);_0x3e4794[_0x43d8('0x32')]=_['intersection'](_0x3e4794[_0x43d8('0x2f')],_0x3e4794[_0x43d8('0x30')]);_0x1f80ea['attributes']=_['intersection'](_0x3e4794[_0x43d8('0x2f')],qs[_0x43d8('0x34')](_0x1f54d7[_0x43d8('0x30')]['fields']));_0x1f80ea[_0x43d8('0x35')]=_0x1f80ea[_0x43d8('0x35')][_0x43d8('0x36')]?_0x1f80ea['attributes']:_0x3e4794['model'];_0x1f80ea[_0x43d8('0x39')]=qs[_0x43d8('0x3a')](_0x1f54d7['query']['sort']);_0x1f80ea[_0x43d8('0x3d')]=qs[_0x43d8('0x32')](_['pick'](_0x1f54d7[_0x43d8('0x30')],_0x3e4794[_0x43d8('0x32')]));if(_0x1f54d7['query'][_0x43d8('0x3c')]){_0x1f80ea[_0x43d8('0x3d')]=_['merge'](_0x1f80ea[_0x43d8('0x3d')],{'$or':_['map'](_0x1f80ea[_0x43d8('0x35')],function(_0x1b4a77){var _0x5a8758={};_0x5a8758[_0x1b4a77]={'$like':'%'+_0x1f54d7[_0x43d8('0x30')][_0x43d8('0x3c')]+'%'};return _0x5a8758;})});}_0x1f80ea=_[_0x43d8('0x3f')]({},_0x1f80ea,_0x1f54d7[_0x43d8('0x4d')]);return _0x5f5cdb['getSubjects'](_0x1f80ea);}})[_0x43d8('0x24')](function(_0x4f0080){if(_0x4f0080){_0x42e530=_0x4f0080[_0x43d8('0x36')];if(!_0x1f54d7[_0x43d8('0x30')][_0x43d8('0x37')](_0x43d8('0x38'))){_0x1f80ea[_0x43d8('0x1d')]=qs[_0x43d8('0x1d')](_0x1f54d7[_0x43d8('0x30')][_0x43d8('0x1d')]);_0x1f80ea[_0x43d8('0x1b')]=qs['offset'](_0x1f54d7['query'][_0x43d8('0x1b')]);}return _0x5f5cdb['getSubjects'](_0x1f80ea);}})[_0x43d8('0x24')](function(_0x57a194){if(_0x57a194){return _0x57a194?{'count':_0x42e530,'rows':_0x57a194}:null;}})[_0x43d8('0x24')](respondWithResult(_0x5048db,null))['catch'](handleError(_0x5048db,null));};exports[_0x43d8('0x4e')]=function(_0x593a5f,_0x44c209,_0x54cd00){var _0x1256f3={};var _0x507dc1={};var _0x65a96;var _0x368f54;return db[_0x43d8('0x2c')][_0x43d8('0x4b')]({'where':{'id':_0x593a5f['params']['id']}})['then'](handleEntityNotFound(_0x44c209,null))[_0x43d8('0x24')](function(_0x1a1294){if(_0x1a1294){_0x65a96=_0x1a1294;_0x507dc1[_0x43d8('0x2f')]=_[_0x43d8('0x31')](db[_0x43d8('0x4c')]['rawAttributes']);_0x507dc1[_0x43d8('0x30')]=_['keys'](_0x593a5f[_0x43d8('0x30')]);_0x507dc1['filters']=_[_0x43d8('0x33')](_0x507dc1['model'],_0x507dc1[_0x43d8('0x30')]);_0x1256f3[_0x43d8('0x35')]=_[_0x43d8('0x33')](_0x507dc1[_0x43d8('0x2f')],qs[_0x43d8('0x34')](_0x593a5f[_0x43d8('0x30')]['fields']));_0x1256f3[_0x43d8('0x35')]=_0x1256f3['attributes'][_0x43d8('0x36')]?_0x1256f3['attributes']:_0x507dc1[_0x43d8('0x2f')];_0x1256f3['order']=qs['sort'](_0x593a5f['query'][_0x43d8('0x3a')]);_0x1256f3[_0x43d8('0x3d')]=qs[_0x43d8('0x32')](_[_0x43d8('0x3b')](_0x593a5f[_0x43d8('0x30')],_0x507dc1[_0x43d8('0x32')]));if(_0x593a5f['query'][_0x43d8('0x3c')]){_0x1256f3['where']=_[_0x43d8('0x3f')](_0x1256f3['where'],{'$or':_[_0x43d8('0x2b')](_0x1256f3['attributes'],function(_0x5d857c){var _0xc1eb4c={};_0xc1eb4c[_0x5d857c]={'$like':'%'+_0x593a5f[_0x43d8('0x30')]['filter']+'%'};return _0xc1eb4c;})});}_0x1256f3=_[_0x43d8('0x3f')]({},_0x1256f3,_0x593a5f['options']);return _0x65a96[_0x43d8('0x4e')](_0x1256f3);}})[_0x43d8('0x24')](function(_0x2a4129){if(_0x2a4129){_0x368f54=_0x2a4129[_0x43d8('0x36')];if(!_0x593a5f[_0x43d8('0x30')][_0x43d8('0x37')](_0x43d8('0x38'))){_0x1256f3['limit']=qs[_0x43d8('0x1d')](_0x593a5f['query']['limit']);_0x1256f3[_0x43d8('0x1b')]=qs[_0x43d8('0x1b')](_0x593a5f[_0x43d8('0x30')][_0x43d8('0x1b')]);}return _0x65a96['getDescriptions'](_0x1256f3);}})[_0x43d8('0x24')](function(_0x301b7c){if(_0x301b7c){return _0x301b7c?{'count':_0x368f54,'rows':_0x301b7c}:null;}})[_0x43d8('0x24')](respondWithResult(_0x44c209,null))[_0x43d8('0x43')](handleError(_0x44c209,null));};exports[_0x43d8('0x4f')]=function(_0x1bf631,_0x26fad5,_0x16006c){var _0x165a47={};var _0x342103={};var _0x2ad4b7;var _0x10c9ec;return db[_0x43d8('0x2c')][_0x43d8('0x4b')]({'where':{'id':_0x1bf631[_0x43d8('0x49')]['id']}})[_0x43d8('0x24')](handleEntityNotFound(_0x26fad5,null))[_0x43d8('0x24')](function(_0x352d1b){if(_0x352d1b){_0x2ad4b7=_0x352d1b;_0x342103['model']=_[_0x43d8('0x31')](db[_0x43d8('0x50')]['rawAttributes']);_0x342103[_0x43d8('0x30')]=_[_0x43d8('0x31')](_0x1bf631[_0x43d8('0x30')]);_0x342103[_0x43d8('0x32')]=_[_0x43d8('0x33')](_0x342103[_0x43d8('0x2f')],_0x342103['query']);_0x165a47[_0x43d8('0x35')]=_[_0x43d8('0x33')](_0x342103[_0x43d8('0x2f')],qs[_0x43d8('0x34')](_0x1bf631[_0x43d8('0x30')][_0x43d8('0x34')]));_0x165a47[_0x43d8('0x35')]=_0x165a47[_0x43d8('0x35')][_0x43d8('0x36')]?_0x165a47[_0x43d8('0x35')]:_0x342103[_0x43d8('0x2f')];_0x165a47[_0x43d8('0x39')]=qs[_0x43d8('0x3a')](_0x1bf631['query']['sort']);_0x165a47[_0x43d8('0x3d')]=qs[_0x43d8('0x32')](_['pick'](_0x1bf631[_0x43d8('0x30')],_0x342103[_0x43d8('0x32')]));if(_0x1bf631[_0x43d8('0x30')][_0x43d8('0x3c')]){_0x165a47[_0x43d8('0x3d')]=_[_0x43d8('0x3f')](_0x165a47[_0x43d8('0x3d')],{'$or':_[_0x43d8('0x2b')](_0x165a47[_0x43d8('0x35')],function(_0x75cbd8){var _0x1798ea={};_0x1798ea[_0x75cbd8]={'$like':'%'+_0x1bf631[_0x43d8('0x30')][_0x43d8('0x3c')]+'%'};return _0x1798ea;})});}_0x165a47=_[_0x43d8('0x3f')]({},_0x165a47,_0x1bf631[_0x43d8('0x4d')]);return _0x2ad4b7[_0x43d8('0x4f')](_0x165a47);}})['then'](function(_0xa107de){if(_0xa107de){_0x10c9ec=_0xa107de[_0x43d8('0x36')];if(!_0x1bf631['query'][_0x43d8('0x37')](_0x43d8('0x38'))){_0x165a47[_0x43d8('0x1d')]=qs[_0x43d8('0x1d')](_0x1bf631[_0x43d8('0x30')][_0x43d8('0x1d')]);_0x165a47[_0x43d8('0x1b')]=qs[_0x43d8('0x1b')](_0x1bf631[_0x43d8('0x30')][_0x43d8('0x1b')]);}return _0x2ad4b7[_0x43d8('0x4f')](_0x165a47);}})['then'](function(_0x42e36b){if(_0x42e36b){return _0x42e36b?{'count':_0x10c9ec,'rows':_0x42e36b}:null;}})['then'](respondWithResult(_0x26fad5,null))[_0x43d8('0x43')](handleError(_0x26fad5,null));};exports[_0x43d8('0x51')]=function(_0x1e079a,_0x55029e,_0x57bc58){if(_0x1e079a[_0x43d8('0x47')]['id']){delete _0x1e079a[_0x43d8('0x47')]['id'];}return db[_0x43d8('0x2c')][_0x43d8('0x4b')]({'where':{'id':_0x1e079a[_0x43d8('0x49')]['id']}})[_0x43d8('0x24')](handleEntityNotFound(_0x55029e,null))[_0x43d8('0x24')](function(_0x4fd1fa){if(_0x4fd1fa){return _0x4fd1fa[_0x43d8('0x51')](_0x1e079a[_0x43d8('0x47')][_0x43d8('0x52')]||[]);}return null;})[_0x43d8('0x24')](respondWithResult(_0x55029e,null))['catch'](handleError(_0x55029e,null));}; \ No newline at end of file +var _0xff69=['setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','error','stack','name','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','catch','show','options','create','body','find','params','getFields','findOne','DeskField','pick','getSubjects','getDescriptions','getTags','Tag'];(function(_0x211dca,_0x455ac7){var _0x21b582=function(_0x39dd6d){while(--_0x39dd6d){_0x211dca['push'](_0x211dca['shift']());}};_0x21b582(++_0x455ac7);}(_0xff69,0x14e));var _0x9ff6=function(_0x221272,_0x29146a){_0x221272=_0x221272-0x0;var _0xe0a9d7=_0xff69[_0x221272];return _0xe0a9d7;};'use strict';var emlformat=require(_0x9ff6('0x0'));var rimraf=require(_0x9ff6('0x1'));var zipdir=require(_0x9ff6('0x2'));var jsonpatch=require(_0x9ff6('0x3'));var rp=require(_0x9ff6('0x4'));var moment=require(_0x9ff6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9ff6('0x6'));var util=require(_0x9ff6('0x7'));var path=require('path');var sox=require(_0x9ff6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ff6('0x9'));var _=require(_0x9ff6('0xa'));var squel=require(_0x9ff6('0xb'));var crypto=require(_0x9ff6('0xc'));var jsforce=require(_0x9ff6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9ff6('0xe'));var querystring=require(_0x9ff6('0xf'));var Papa=require(_0x9ff6('0x10'));var Redis=require(_0x9ff6('0x11'));var authService=require(_0x9ff6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9ff6('0x13'));var hardwareService=require(_0x9ff6('0x14'));var logger=require(_0x9ff6('0x15'))(_0x9ff6('0x16'));var utils=require(_0x9ff6('0x17'));var config=require(_0x9ff6('0x18'));var licenseUtil=require(_0x9ff6('0x19'));var db=require(_0x9ff6('0x1a'))['db'];function respondWithStatusCode(_0x247dcb,_0x4045cf){_0x4045cf=_0x4045cf||0xcc;return function(_0x3a4cc3){if(_0x3a4cc3){return _0x247dcb[_0x9ff6('0x1b')](_0x4045cf);}return _0x247dcb[_0x9ff6('0x1c')](_0x4045cf)[_0x9ff6('0x1d')]();};}function respondWithResult(_0x3c4512,_0xc55c36){_0xc55c36=_0xc55c36||0xc8;return function(_0x439826){if(_0x439826){return _0x3c4512[_0x9ff6('0x1c')](_0xc55c36)[_0x9ff6('0x1e')](_0x439826);}};}function respondWithFilteredResult(_0x45331f,_0x556de0){return function(_0x7e351a){if(_0x7e351a){var _0x2d80e1=typeof _0x556de0[_0x9ff6('0x1f')]===_0x9ff6('0x20')&&typeof _0x556de0['limit']==='undefined';var _0x1e1606=_0x7e351a[_0x9ff6('0x21')];var _0x59af57=_0x2d80e1?0x0:_0x556de0['offset'];var _0x47e74e=_0x2d80e1?_0x7e351a[_0x9ff6('0x21')]:_0x556de0[_0x9ff6('0x1f')]+_0x556de0[_0x9ff6('0x22')];var _0x2e9ecc;if(_0x47e74e>=_0x1e1606){_0x47e74e=_0x1e1606;_0x2e9ecc=0xc8;}else{_0x2e9ecc=0xce;}_0x45331f[_0x9ff6('0x1c')](_0x2e9ecc);return _0x45331f[_0x9ff6('0x23')](_0x9ff6('0x24'),_0x59af57+'-'+_0x47e74e+'/'+_0x1e1606)['json'](_0x7e351a);}return null;};}function patchUpdates(_0x4dd046){return function(_0x39ebf0){try{jsonpatch[_0x9ff6('0x25')](_0x39ebf0,_0x4dd046,!![]);}catch(_0x5ab0b0){return BPromise[_0x9ff6('0x26')](_0x5ab0b0);}return _0x39ebf0[_0x9ff6('0x27')]();};}function saveUpdates(_0xd41ca7,_0x37e67c){return function(_0xba2ad){if(_0xba2ad){return _0xba2ad['update'](_0xd41ca7)[_0x9ff6('0x28')](function(_0xff03b){return _0xff03b;});}return null;};}function removeEntity(_0xccaa0a,_0x50f14d){return function(_0x53c05c){if(_0x53c05c){return _0x53c05c['destroy']()['then'](function(){_0xccaa0a[_0x9ff6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a4bc9,_0x5b528e){return function(_0x558323){if(!_0x558323){_0x3a4bc9[_0x9ff6('0x1b')](0x194);}return _0x558323;};}function handleError(_0x2667cb,_0x4c5bd7){_0x4c5bd7=_0x4c5bd7||0x1f4;return function(_0x4d9572){logger[_0x9ff6('0x29')](_0x4d9572[_0x9ff6('0x2a')]);if(_0x4d9572[_0x9ff6('0x2b')]){delete _0x4d9572[_0x9ff6('0x2b')];}_0x2667cb[_0x9ff6('0x1c')](_0x4c5bd7)['send'](_0x4d9572);};}exports['index']=function(_0x2a5828,_0x36c42a){var _0x2a3948={},_0x4c6c25={},_0x12d1cd={'count':0x0,'rows':[]};var _0x571d02=_[_0x9ff6('0x2c')](db[_0x9ff6('0x2d')][_0x9ff6('0x2e')],function(_0x578a6f){return{'name':_0x578a6f[_0x9ff6('0x2f')],'type':_0x578a6f[_0x9ff6('0x30')]['key']};});_0x4c6c25[_0x9ff6('0x31')]=_['map'](_0x571d02,'name');_0x4c6c25[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0x2a5828['query']);_0x4c6c25['filters']=_[_0x9ff6('0x34')](_0x4c6c25[_0x9ff6('0x31')],_0x4c6c25[_0x9ff6('0x32')]);_0x2a3948[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x4c6c25[_0x9ff6('0x31')],qs['fields'](_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x2a3948[_0x9ff6('0x35')]=_0x2a3948[_0x9ff6('0x35')][_0x9ff6('0x37')]?_0x2a3948['attributes']:_0x4c6c25[_0x9ff6('0x31')];if(!_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x38')](_0x9ff6('0x39'))){_0x2a3948[_0x9ff6('0x22')]=qs['limit'](_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x22')]);_0x2a3948['offset']=qs[_0x9ff6('0x1f')](_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}_0x2a3948[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0x2a5828['query']['sort']);_0x2a3948[_0x9ff6('0x3c')]=qs[_0x9ff6('0x3d')](_['pick'](_0x2a5828[_0x9ff6('0x32')],_0x4c6c25[_0x9ff6('0x3d')]),_0x571d02);if(_0x2a5828['query'][_0x9ff6('0x3e')]){_0x2a3948['where']=_['merge'](_0x2a3948[_0x9ff6('0x3c')],{'$or':_['map'](_0x571d02,function(_0x129a72){if(_0x129a72[_0x9ff6('0x30')]!=='VIRTUAL'){var _0x416d16={};_0x416d16[_0x129a72[_0x9ff6('0x2b')]]={'$like':'%'+_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0x416d16;}})});}_0x2a3948=_[_0x9ff6('0x3f')]({},_0x2a3948,_0x2a5828['options']);var _0x3d5930={'where':_0x2a3948['where']};return db['DeskConfiguration']['count'](_0x3d5930)['then'](function(_0x40477e){_0x12d1cd[_0x9ff6('0x21')]=_0x40477e;if(_0x2a5828[_0x9ff6('0x32')][_0x9ff6('0x40')]){_0x2a3948['include']=[{'all':!![]}];}return db[_0x9ff6('0x2d')][_0x9ff6('0x41')](_0x2a3948);})[_0x9ff6('0x28')](function(_0x23e390){_0x12d1cd['rows']=_0x23e390;return _0x12d1cd;})[_0x9ff6('0x28')](respondWithFilteredResult(_0x36c42a,_0x2a3948))[_0x9ff6('0x42')](handleError(_0x36c42a,null));};exports[_0x9ff6('0x43')]=function(_0x1bed06,_0x3bcd81){var _0x5012b4={'raw':![],'where':{'id':_0x1bed06['params']['id']}},_0x3f8c0a={};_0x3f8c0a['model']=_[_0x9ff6('0x33')](db[_0x9ff6('0x2d')][_0x9ff6('0x2e')]);_0x3f8c0a[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0x1bed06['query']);_0x3f8c0a['filters']=_[_0x9ff6('0x34')](_0x3f8c0a['model'],_0x3f8c0a['query']);_0x5012b4[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x3f8c0a[_0x9ff6('0x31')],qs[_0x9ff6('0x36')](_0x1bed06['query'][_0x9ff6('0x36')]));_0x5012b4[_0x9ff6('0x35')]=_0x5012b4[_0x9ff6('0x35')]['length']?_0x5012b4['attributes']:_0x3f8c0a[_0x9ff6('0x31')];if(_0x1bed06[_0x9ff6('0x32')][_0x9ff6('0x40')]){_0x5012b4['include']=[{'all':!![]}];}_0x5012b4=_['merge']({},_0x5012b4,_0x1bed06[_0x9ff6('0x44')]);return db[_0x9ff6('0x2d')]['find'](_0x5012b4)[_0x9ff6('0x28')](handleEntityNotFound(_0x3bcd81,null))[_0x9ff6('0x28')](respondWithResult(_0x3bcd81,null))[_0x9ff6('0x42')](handleError(_0x3bcd81,null));};exports[_0x9ff6('0x45')]=function(_0x3f647e,_0x4ec4e6){return db[_0x9ff6('0x2d')]['create'](_0x3f647e['body'],{})['then'](respondWithResult(_0x4ec4e6,0xc9))[_0x9ff6('0x42')](handleError(_0x4ec4e6,null));};exports['update']=function(_0x3b44f9,_0x3c12a3){if(_0x3b44f9[_0x9ff6('0x46')]['id']){delete _0x3b44f9[_0x9ff6('0x46')]['id'];}return db[_0x9ff6('0x2d')][_0x9ff6('0x47')]({'where':{'id':_0x3b44f9[_0x9ff6('0x48')]['id']}})['then'](handleEntityNotFound(_0x3c12a3,null))[_0x9ff6('0x28')](saveUpdates(_0x3b44f9['body'],null))[_0x9ff6('0x28')](respondWithResult(_0x3c12a3,null))[_0x9ff6('0x42')](handleError(_0x3c12a3,null));};exports['destroy']=function(_0xd49fff,_0x372270){return db[_0x9ff6('0x2d')]['find']({'where':{'id':_0xd49fff[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x372270,null))[_0x9ff6('0x28')](removeEntity(_0x372270,null))[_0x9ff6('0x42')](handleError(_0x372270,null));};exports[_0x9ff6('0x49')]=function(_0xb27f5,_0x389678,_0x312496){var _0x1b6f1b={};var _0x2012f1={};var _0x108b52;var _0x3215b4;return db[_0x9ff6('0x2d')][_0x9ff6('0x4a')]({'where':{'id':_0xb27f5[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x389678,null))['then'](function(_0x1dfb22){if(_0x1dfb22){_0x108b52=_0x1dfb22;_0x2012f1['model']=_['keys'](db[_0x9ff6('0x4b')][_0x9ff6('0x2e')]);_0x2012f1[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0xb27f5[_0x9ff6('0x32')]);_0x2012f1[_0x9ff6('0x3d')]=_[_0x9ff6('0x34')](_0x2012f1[_0x9ff6('0x31')],_0x2012f1[_0x9ff6('0x32')]);_0x1b6f1b['attributes']=_[_0x9ff6('0x34')](_0x2012f1[_0x9ff6('0x31')],qs[_0x9ff6('0x36')](_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x1b6f1b[_0x9ff6('0x35')]=_0x1b6f1b['attributes']['length']?_0x1b6f1b[_0x9ff6('0x35')]:_0x2012f1[_0x9ff6('0x31')];_0x1b6f1b[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0xb27f5[_0x9ff6('0x32')]['sort']);_0x1b6f1b[_0x9ff6('0x3c')]=qs['filters'](_[_0x9ff6('0x4c')](_0xb27f5[_0x9ff6('0x32')],_0x2012f1[_0x9ff6('0x3d')]));if(_0xb27f5[_0x9ff6('0x32')]['filter']){_0x1b6f1b[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0x1b6f1b[_0x9ff6('0x3c')],{'$or':_[_0x9ff6('0x2c')](_0x1b6f1b[_0x9ff6('0x35')],function(_0x61a2bd){var _0xc1b48d={};_0xc1b48d[_0x61a2bd]={'$like':'%'+_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0xc1b48d;})});}_0x1b6f1b=_[_0x9ff6('0x3f')]({},_0x1b6f1b,_0xb27f5[_0x9ff6('0x44')]);return _0x108b52[_0x9ff6('0x49')](_0x1b6f1b);}})['then'](function(_0x2a1270){if(_0x2a1270){_0x3215b4=_0x2a1270[_0x9ff6('0x37')];if(!_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x38')](_0x9ff6('0x39'))){_0x1b6f1b[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x22')]);_0x1b6f1b[_0x9ff6('0x1f')]=qs[_0x9ff6('0x1f')](_0xb27f5[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}return _0x108b52[_0x9ff6('0x49')](_0x1b6f1b);}})[_0x9ff6('0x28')](function(_0x5dc3d9){if(_0x5dc3d9){return _0x5dc3d9?{'count':_0x3215b4,'rows':_0x5dc3d9}:null;}})[_0x9ff6('0x28')](respondWithResult(_0x389678,null))['catch'](handleError(_0x389678,null));};exports['getSubjects']=function(_0xf61e7a,_0x469032,_0x4d43a5){var _0x5808ed={};var _0x598697={};var _0x40e135;var _0x196599;return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0xf61e7a[_0x9ff6('0x48')]['id']}})['then'](handleEntityNotFound(_0x469032,null))[_0x9ff6('0x28')](function(_0xd4c690){if(_0xd4c690){_0x40e135=_0xd4c690;_0x598697['model']=_[_0x9ff6('0x33')](db[_0x9ff6('0x4b')][_0x9ff6('0x2e')]);_0x598697['query']=_[_0x9ff6('0x33')](_0xf61e7a[_0x9ff6('0x32')]);_0x598697['filters']=_['intersection'](_0x598697[_0x9ff6('0x31')],_0x598697[_0x9ff6('0x32')]);_0x5808ed['attributes']=_['intersection'](_0x598697['model'],qs[_0x9ff6('0x36')](_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x5808ed[_0x9ff6('0x35')]=_0x5808ed[_0x9ff6('0x35')][_0x9ff6('0x37')]?_0x5808ed[_0x9ff6('0x35')]:_0x598697[_0x9ff6('0x31')];_0x5808ed[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x3b')]);_0x5808ed['where']=qs[_0x9ff6('0x3d')](_[_0x9ff6('0x4c')](_0xf61e7a[_0x9ff6('0x32')],_0x598697[_0x9ff6('0x3d')]));if(_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x3e')]){_0x5808ed[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0x5808ed['where'],{'$or':_[_0x9ff6('0x2c')](_0x5808ed[_0x9ff6('0x35')],function(_0x258c49){var _0x3a8301={};_0x3a8301[_0x258c49]={'$like':'%'+_0xf61e7a['query'][_0x9ff6('0x3e')]+'%'};return _0x3a8301;})});}_0x5808ed=_[_0x9ff6('0x3f')]({},_0x5808ed,_0xf61e7a[_0x9ff6('0x44')]);return _0x40e135[_0x9ff6('0x4d')](_0x5808ed);}})['then'](function(_0x34652e){if(_0x34652e){_0x196599=_0x34652e[_0x9ff6('0x37')];if(!_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x38')]('nolimit')){_0x5808ed[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0xf61e7a['query']['limit']);_0x5808ed[_0x9ff6('0x1f')]=qs[_0x9ff6('0x1f')](_0xf61e7a[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}return _0x40e135[_0x9ff6('0x4d')](_0x5808ed);}})[_0x9ff6('0x28')](function(_0x11289e){if(_0x11289e){return _0x11289e?{'count':_0x196599,'rows':_0x11289e}:null;}})[_0x9ff6('0x28')](respondWithResult(_0x469032,null))[_0x9ff6('0x42')](handleError(_0x469032,null));};exports[_0x9ff6('0x4e')]=function(_0x26339b,_0x141755,_0x34351a){var _0xae45f7={};var _0x296348={};var _0x4cb2aa;var _0x3bf444;return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0x26339b[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x141755,null))[_0x9ff6('0x28')](function(_0x313892){if(_0x313892){_0x4cb2aa=_0x313892;_0x296348['model']=_['keys'](db[_0x9ff6('0x4b')][_0x9ff6('0x2e')]);_0x296348[_0x9ff6('0x32')]=_[_0x9ff6('0x33')](_0x26339b['query']);_0x296348[_0x9ff6('0x3d')]=_[_0x9ff6('0x34')](_0x296348[_0x9ff6('0x31')],_0x296348[_0x9ff6('0x32')]);_0xae45f7[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x296348['model'],qs[_0x9ff6('0x36')](_0x26339b['query'][_0x9ff6('0x36')]));_0xae45f7['attributes']=_0xae45f7['attributes'][_0x9ff6('0x37')]?_0xae45f7[_0x9ff6('0x35')]:_0x296348['model'];_0xae45f7[_0x9ff6('0x3a')]=qs[_0x9ff6('0x3b')](_0x26339b[_0x9ff6('0x32')]['sort']);_0xae45f7[_0x9ff6('0x3c')]=qs[_0x9ff6('0x3d')](_[_0x9ff6('0x4c')](_0x26339b[_0x9ff6('0x32')],_0x296348[_0x9ff6('0x3d')]));if(_0x26339b['query']['filter']){_0xae45f7[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0xae45f7['where'],{'$or':_[_0x9ff6('0x2c')](_0xae45f7[_0x9ff6('0x35')],function(_0x3497e7){var _0x413d07={};_0x413d07[_0x3497e7]={'$like':'%'+_0x26339b[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0x413d07;})});}_0xae45f7=_[_0x9ff6('0x3f')]({},_0xae45f7,_0x26339b[_0x9ff6('0x44')]);return _0x4cb2aa[_0x9ff6('0x4e')](_0xae45f7);}})[_0x9ff6('0x28')](function(_0x3a81f6){if(_0x3a81f6){_0x3bf444=_0x3a81f6[_0x9ff6('0x37')];if(!_0x26339b['query']['hasOwnProperty'](_0x9ff6('0x39'))){_0xae45f7[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0x26339b['query'][_0x9ff6('0x22')]);_0xae45f7[_0x9ff6('0x1f')]=qs['offset'](_0x26339b[_0x9ff6('0x32')]['offset']);}return _0x4cb2aa[_0x9ff6('0x4e')](_0xae45f7);}})[_0x9ff6('0x28')](function(_0x310dd2){if(_0x310dd2){return _0x310dd2?{'count':_0x3bf444,'rows':_0x310dd2}:null;}})[_0x9ff6('0x28')](respondWithResult(_0x141755,null))[_0x9ff6('0x42')](handleError(_0x141755,null));};exports[_0x9ff6('0x4f')]=function(_0x242189,_0x2e1242,_0x5183a3){var _0x3f2c6a={};var _0x5b88ce={};var _0x70fee5;var _0x5f2be5;return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0x242189[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x2e1242,null))[_0x9ff6('0x28')](function(_0x129b79){if(_0x129b79){_0x70fee5=_0x129b79;_0x5b88ce[_0x9ff6('0x31')]=_[_0x9ff6('0x33')](db[_0x9ff6('0x50')]['rawAttributes']);_0x5b88ce['query']=_[_0x9ff6('0x33')](_0x242189['query']);_0x5b88ce[_0x9ff6('0x3d')]=_[_0x9ff6('0x34')](_0x5b88ce[_0x9ff6('0x31')],_0x5b88ce[_0x9ff6('0x32')]);_0x3f2c6a[_0x9ff6('0x35')]=_[_0x9ff6('0x34')](_0x5b88ce['model'],qs[_0x9ff6('0x36')](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x36')]));_0x3f2c6a[_0x9ff6('0x35')]=_0x3f2c6a[_0x9ff6('0x35')][_0x9ff6('0x37')]?_0x3f2c6a[_0x9ff6('0x35')]:_0x5b88ce[_0x9ff6('0x31')];_0x3f2c6a['order']=qs['sort'](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x3b')]);_0x3f2c6a[_0x9ff6('0x3c')]=qs['filters'](_[_0x9ff6('0x4c')](_0x242189[_0x9ff6('0x32')],_0x5b88ce[_0x9ff6('0x3d')]));if(_0x242189[_0x9ff6('0x32')]['filter']){_0x3f2c6a[_0x9ff6('0x3c')]=_[_0x9ff6('0x3f')](_0x3f2c6a[_0x9ff6('0x3c')],{'$or':_[_0x9ff6('0x2c')](_0x3f2c6a[_0x9ff6('0x35')],function(_0xfce8d0){var _0x266a36={};_0x266a36[_0xfce8d0]={'$like':'%'+_0x242189[_0x9ff6('0x32')][_0x9ff6('0x3e')]+'%'};return _0x266a36;})});}_0x3f2c6a=_['merge']({},_0x3f2c6a,_0x242189[_0x9ff6('0x44')]);return _0x70fee5[_0x9ff6('0x4f')](_0x3f2c6a);}})[_0x9ff6('0x28')](function(_0x4c2e5){if(_0x4c2e5){_0x5f2be5=_0x4c2e5[_0x9ff6('0x37')];if(!_0x242189[_0x9ff6('0x32')][_0x9ff6('0x38')](_0x9ff6('0x39'))){_0x3f2c6a[_0x9ff6('0x22')]=qs[_0x9ff6('0x22')](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x22')]);_0x3f2c6a[_0x9ff6('0x1f')]=qs[_0x9ff6('0x1f')](_0x242189[_0x9ff6('0x32')][_0x9ff6('0x1f')]);}return _0x70fee5[_0x9ff6('0x4f')](_0x3f2c6a);}})['then'](function(_0x56bdff){if(_0x56bdff){return _0x56bdff?{'count':_0x5f2be5,'rows':_0x56bdff}:null;}})['then'](respondWithResult(_0x2e1242,null))[_0x9ff6('0x42')](handleError(_0x2e1242,null));};exports[_0x9ff6('0x51')]=function(_0x38ca2d,_0x409321,_0x3a6375){if(_0x38ca2d['body']['id']){delete _0x38ca2d['body']['id'];}return db[_0x9ff6('0x2d')]['findOne']({'where':{'id':_0x38ca2d[_0x9ff6('0x48')]['id']}})[_0x9ff6('0x28')](handleEntityNotFound(_0x409321,null))['then'](function(_0x449ce2){if(_0x449ce2){return _0x449ce2[_0x9ff6('0x51')](_0x38ca2d[_0x9ff6('0x46')][_0x9ff6('0x52')]||[]);}return null;})[_0x9ff6('0x28')](respondWithResult(_0x409321,null))['catch'](handleError(_0x409321,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 0a5fd6f..196615b 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 _0x6910=['./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5fe8a7,_0x34ea66){var _0x10157a=function(_0x34410a){while(--_0x34410a){_0x5fe8a7['push'](_0x5fe8a7['shift']());}};_0x10157a(++_0x34ea66);}(_0x6910,0x157));var _0x0691=function(_0x7d6eca,_0x59d54a){_0x7d6eca=_0x7d6eca-0x0;var _0x128263=_0x6910[_0x7d6eca];return _0x128263;};'use strict';var _=require(_0x0691('0x0'));var util=require(_0x0691('0x1'));var logger=require(_0x0691('0x2'))(_0x0691('0x3'));var moment=require(_0x0691('0x4'));var BPromise=require(_0x0691('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0691('0x6'));var rimraf=require('rimraf');var config=require(_0x0691('0x7'));var attributes=require(_0x0691('0x8'));module[_0x0691('0x9')]=function(_0x2143dd,_0x19db1b){return _0x2143dd[_0x0691('0xa')](_0x0691('0xb'),attributes,{'tableName':_0x0691('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf86b=['../../config/environment','./intDeskConfiguration.attributes','exports','define','int_desk_configurations','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x984ff7,_0x3b21ee){var _0x41942a=function(_0x2c95d9){while(--_0x2c95d9){_0x984ff7['push'](_0x984ff7['shift']());}};_0x41942a(++_0x3b21ee);}(_0xf86b,0xd7));var _0xbf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbf86('0x0'))(_0xbf86('0x1'));var moment=require(_0xbf86('0x2'));var BPromise=require(_0xbf86('0x3'));var rp=require(_0xbf86('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbf86('0x5'));var attributes=require(_0xbf86('0x6'));module[_0xbf86('0x7')]=function(_0x367620,_0x459411){return _0x367620[_0xbf86('0x8')]('DeskConfiguration',attributes,{'tableName':_0xbf86('0x9'),'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 952d36c..692c999 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 _0xbac1=['code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x20d74f,_0x5c8bd1){var _0x175c82=function(_0xed6c8a){while(--_0xed6c8a){_0x20d74f['push'](_0x20d74f['shift']());}};_0x175c82(++_0x5c8bd1);}(_0xbac1,0x17f));var _0x1bac=function(_0xdfb5bb,_0x11e8b2){_0xdfb5bb=_0xdfb5bb-0x0;var _0x5bf349=_0xbac1[_0xdfb5bb];return _0x5bf349;};'use strict';var _=require('lodash');var util=require(_0x1bac('0x0'));var moment=require(_0x1bac('0x1'));var BPromise=require(_0x1bac('0x2'));var rs=require(_0x1bac('0x3'));var fs=require('fs');var Redis=require(_0x1bac('0x4'));var db=require(_0x1bac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1bac('0x6'))(_0x1bac('0x7'));var config=require(_0x1bac('0x8'));var jayson=require(_0x1bac('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22630c,_0x1e4f0e,_0x5441f0){return new BPromise(function(_0x1e6480,_0x86c896){return client[_0x1bac('0xa')](_0x22630c,_0x5441f0)['then'](function(_0x1f2f10){logger[_0x1bac('0xb')](_0x1bac('0xc'),_0x1e4f0e,_0x1bac('0xd'));logger['debug'](_0x1bac('0xe'),_0x1e4f0e,_0x1bac('0xd'),JSON[_0x1bac('0xf')](_0x1f2f10));if(_0x1f2f10[_0x1bac('0x10')]){if(_0x1f2f10[_0x1bac('0x10')][_0x1bac('0x11')]===0x1f4){logger[_0x1bac('0x10')](_0x1bac('0xc'),_0x1e4f0e,_0x1f2f10['error'][_0x1bac('0x12')]);return _0x86c896(_0x1f2f10['error']['message']);}logger[_0x1bac('0x10')](_0x1bac('0xc'),_0x1e4f0e,_0x1f2f10[_0x1bac('0x10')][_0x1bac('0x12')]);return _0x1e6480(_0x1f2f10[_0x1bac('0x10')]['message']);}else{logger[_0x1bac('0xb')]('DeskConfiguration,\x20%s,\x20%s',_0x1e4f0e,_0x1bac('0xd'));_0x1e6480(_0x1f2f10['result']['message']);}})[_0x1bac('0x13')](function(_0x4cb757){logger['error'](_0x1bac('0xc'),_0x1e4f0e,_0x4cb757);_0x86c896(_0x4cb757);});});} \ No newline at end of file +var _0x1fed=['debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0x1fed,0x1d3));var _0xd1fe=function(_0x3dd266,_0x4d919f){_0x3dd266=_0x3dd266-0x0;var _0x320665=_0x1fed[_0x3dd266];return _0x320665;};'use strict';var _=require(_0xd1fe('0x0'));var util=require('util');var moment=require(_0xd1fe('0x1'));var BPromise=require(_0xd1fe('0x2'));var rs=require(_0xd1fe('0x3'));var fs=require('fs');var Redis=require(_0xd1fe('0x4'));var db=require(_0xd1fe('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1fe('0x6'));var config=require('../../config/environment');var jayson=require(_0xd1fe('0x7'));var client=jayson[_0xd1fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x550fe4,_0x47fb79,_0x4ab4fc){return new BPromise(function(_0x187285,_0xa14551){return client[_0xd1fe('0x9')](_0x550fe4,_0x4ab4fc)[_0xd1fe('0xa')](function(_0x39e44a){logger['info'](_0xd1fe('0xb'),_0x47fb79,_0xd1fe('0xc'));logger[_0xd1fe('0xd')](_0xd1fe('0xe'),_0x47fb79,_0xd1fe('0xc'),JSON['stringify'](_0x39e44a));if(_0x39e44a[_0xd1fe('0xf')]){if(_0x39e44a[_0xd1fe('0xf')][_0xd1fe('0x10')]===0x1f4){logger[_0xd1fe('0xf')](_0xd1fe('0xb'),_0x47fb79,_0x39e44a['error'][_0xd1fe('0x11')]);return _0xa14551(_0x39e44a[_0xd1fe('0xf')]['message']);}logger[_0xd1fe('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x47fb79,_0x39e44a[_0xd1fe('0xf')][_0xd1fe('0x11')]);return _0x187285(_0x39e44a[_0xd1fe('0xf')][_0xd1fe('0x11')]);}else{logger[_0xd1fe('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x47fb79,_0xd1fe('0xc'));_0x187285(_0x39e44a[_0xd1fe('0x13')]['message']);}})['catch'](function(_0x11bdee){logger['error'](_0xd1fe('0xb'),_0x47fb79,_0x11bdee);_0xa14551(_0x11bdee);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 2b36edc..58b2da5 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 _0xc4b3=['../../components/auth/service','./intDeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2d3de6,_0x38de32){var _0x13064b=function(_0x57f91e){while(--_0x57f91e){_0x2d3de6['push'](_0x2d3de6['shift']());}};_0x13064b(++_0x38de32);}(_0xc4b3,0x192));var _0x3c4b=function(_0x1a5650,_0x4ac259){_0x1a5650=_0x1a5650-0x0;var _0x759866=_0xc4b3[_0x1a5650];return _0x759866;};'use strict';var multer=require(_0x3c4b('0x0'));var util=require(_0x3c4b('0x1'));var path=require(_0x3c4b('0x2'));var timeout=require(_0x3c4b('0x3'));var express=require('express');var router=express[_0x3c4b('0x4')]();var fs_extra=require(_0x3c4b('0x5'));var auth=require(_0x3c4b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c4b('0x7'));router[_0x3c4b('0x8')]('/',auth[_0x3c4b('0x9')](),controller['index']);router['get']('/:id',auth[_0x3c4b('0x9')](),controller[_0x3c4b('0xa')]);router[_0x3c4b('0xb')]('/',auth[_0x3c4b('0x9')](),controller[_0x3c4b('0xc')]);router[_0x3c4b('0xd')](_0x3c4b('0xe'),auth[_0x3c4b('0x9')](),controller[_0x3c4b('0xf')]);router[_0x3c4b('0x10')](_0x3c4b('0xe'),auth[_0x3c4b('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc4cf=['isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc4cf,0xc8));var _0xfc4c=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xc4cf[_0x411017];return _0x2adeea;};'use strict';var multer=require(_0xfc4c('0x0'));var util=require(_0xfc4c('0x1'));var path=require(_0xfc4c('0x2'));var timeout=require(_0xfc4c('0x3'));var express=require(_0xfc4c('0x4'));var router=express[_0xfc4c('0x5')]();var fs_extra=require(_0xfc4c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfc4c('0x7'));var config=require(_0xfc4c('0x8'));var controller=require('./intDeskField.controller');router['get']('/',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0xa')]);router[_0xfc4c('0xb')](_0xfc4c('0xc'),auth['isAuthenticated'](),controller[_0xfc4c('0xd')]);router[_0xfc4c('0xe')]('/',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0xf')]);router[_0xfc4c('0x10')](_0xfc4c('0xc'),auth[_0xfc4c('0x9')](),controller['update']);router['delete']('/:id',auth[_0xfc4c('0x9')](),controller[_0xfc4c('0x11')]);module[_0xfc4c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 5282adb..d88f054 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 _0x8757=['customVariable','keyValue','picklist','string','STRING','BOOLEAN','exports','ENUM','variable'];(function(_0x52ab55,_0x5b11c3){var _0x202876=function(_0x2598c3){while(--_0x2598c3){_0x52ab55['push'](_0x52ab55['shift']());}};_0x202876(++_0x5b11c3);}(_0x8757,0xba));var _0x7875=function(_0x53e774,_0x14d83a){_0x53e774=_0x53e774-0x0;var _0x40c965=_0x8757[_0x53e774];return _0x40c965;};'use strict';var Sequelize=require('sequelize');module[_0x7875('0x0')]={'type':{'type':Sequelize[_0x7875('0x1')]('string',_0x7875('0x2'),_0x7875('0x3'),_0x7875('0x4'),_0x7875('0x5')),'defaultValue':_0x7875('0x6')},'content':{'type':Sequelize[_0x7875('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7875('0x1')](_0x7875('0x6'),'variable',_0x7875('0x3'))},'keyContent':{'type':Sequelize[_0x7875('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7875('0x7')]},'customField':{'type':Sequelize[_0x7875('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7875('0x7')]}}; \ No newline at end of file +var _0x24dc=['string','STRING','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x24dc,0x197));var _0xc24d=function(_0x47c9fd,_0x2b1512){_0x47c9fd=_0x47c9fd-0x0;var _0x35ca44=_0x24dc[_0x47c9fd];return _0x35ca44;};'use strict';var Sequelize=require(_0xc24d('0x0'));module[_0xc24d('0x1')]={'type':{'type':Sequelize[_0xc24d('0x2')]('string',_0xc24d('0x3'),_0xc24d('0x4'),_0xc24d('0x5'),_0xc24d('0x6')),'defaultValue':_0xc24d('0x7')},'content':{'type':Sequelize[_0xc24d('0x8')]},'key':{'type':Sequelize[_0xc24d('0x8')]},'keyType':{'type':Sequelize[_0xc24d('0x2')](_0xc24d('0x7'),_0xc24d('0x3'),_0xc24d('0x4'))},'keyContent':{'type':Sequelize[_0xc24d('0x8')]},'idField':{'type':Sequelize[_0xc24d('0x8')]},'nameField':{'type':Sequelize[_0xc24d('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2290fd6..972f9eb 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 _0x812d=['status','end','undefined','limit','count','offset','Content-Range','json','apply','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','type','VIRTUAL','options','DeskField','includeAll','include','rows','show','params','keys','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5f1aaa,_0x381562){var _0x444677=function(_0x4154be){while(--_0x4154be){_0x5f1aaa['push'](_0x5f1aaa['shift']());}};_0x444677(++_0x381562);}(_0x812d,0x6e));var _0xd812=function(_0x53d120,_0x189061){_0x53d120=_0x53d120-0x0;var _0x5008c3=_0x812d[_0x53d120];return _0x5008c3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd812('0x0'));var zipdir=require(_0xd812('0x1'));var jsonpatch=require(_0xd812('0x2'));var rp=require(_0xd812('0x3'));var moment=require(_0xd812('0x4'));var BPromise=require(_0xd812('0x5'));var Mustache=require(_0xd812('0x6'));var util=require(_0xd812('0x7'));var path=require('path');var sox=require(_0xd812('0x8'));var csv=require(_0xd812('0x9'));var ejs=require(_0xd812('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd812('0xb'));var crypto=require(_0xd812('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd812('0xd'));var toCsv=require(_0xd812('0x9'));var querystring=require('querystring');var Papa=require(_0xd812('0xe'));var Redis=require(_0xd812('0xf'));var authService=require(_0xd812('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd812('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd812('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd812('0x13'));var db=require(_0xd812('0x14'))['db'];function respondWithStatusCode(_0x2d11f0,_0x4c14f4){_0x4c14f4=_0x4c14f4||0xcc;return function(_0x26a11e){if(_0x26a11e){return _0x2d11f0[_0xd812('0x15')](_0x4c14f4);}return _0x2d11f0[_0xd812('0x16')](_0x4c14f4)[_0xd812('0x17')]();};}function respondWithResult(_0x3e4ef2,_0x2625e5){_0x2625e5=_0x2625e5||0xc8;return function(_0x2bc66b){if(_0x2bc66b){return _0x3e4ef2[_0xd812('0x16')](_0x2625e5)['json'](_0x2bc66b);}};}function respondWithFilteredResult(_0x566a84,_0x5cb5e9){return function(_0x1cfb00){if(_0x1cfb00){var _0x51a0dd=typeof _0x5cb5e9['offset']===_0xd812('0x18')&&typeof _0x5cb5e9[_0xd812('0x19')]===_0xd812('0x18');var _0x24c4e4=_0x1cfb00[_0xd812('0x1a')];var _0x320d2d=_0x51a0dd?0x0:_0x5cb5e9[_0xd812('0x1b')];var _0x47d37b=_0x51a0dd?_0x1cfb00['count']:_0x5cb5e9[_0xd812('0x1b')]+_0x5cb5e9['limit'];var _0x359e6b;if(_0x47d37b>=_0x24c4e4){_0x47d37b=_0x24c4e4;_0x359e6b=0xc8;}else{_0x359e6b=0xce;}_0x566a84['status'](_0x359e6b);return _0x566a84['set'](_0xd812('0x1c'),_0x320d2d+'-'+_0x47d37b+'/'+_0x24c4e4)[_0xd812('0x1d')](_0x1cfb00);}return null;};}function patchUpdates(_0x2ce9bd){return function(_0x342752){try{jsonpatch[_0xd812('0x1e')](_0x342752,_0x2ce9bd,!![]);}catch(_0x4dba22){return BPromise['reject'](_0x4dba22);}return _0x342752['save']();};}function saveUpdates(_0x5e1894,_0x43dbc9){return function(_0x442aa5){if(_0x442aa5){return _0x442aa5['update'](_0x5e1894)[_0xd812('0x1f')](function(_0x55e061){return _0x55e061;});}return null;};}function removeEntity(_0x5c4dd0,_0x3f34e0){return function(_0x4522b4){if(_0x4522b4){return _0x4522b4[_0xd812('0x20')]()[_0xd812('0x1f')](function(){_0x5c4dd0['status'](0xcc)[_0xd812('0x17')]();});}};}function handleEntityNotFound(_0x2d51f6,_0x584669){return function(_0x40266e){if(!_0x40266e){_0x2d51f6[_0xd812('0x15')](0x194);}return _0x40266e;};}function handleError(_0x3e223b,_0x1dd1de){_0x1dd1de=_0x1dd1de||0x1f4;return function(_0x47d075){logger[_0xd812('0x21')](_0x47d075[_0xd812('0x22')]);if(_0x47d075[_0xd812('0x23')]){delete _0x47d075[_0xd812('0x23')];}_0x3e223b['status'](_0x1dd1de)['send'](_0x47d075);};}exports[_0xd812('0x24')]=function(_0x59d8e4,_0x1c843f){var _0xcda85={},_0x4c78eb={},_0x352a57={'count':0x0,'rows':[]};var _0x3331e0=_[_0xd812('0x25')](db['DeskField'][_0xd812('0x26')],function(_0x19b5e6){return{'name':_0x19b5e6[_0xd812('0x27')],'type':_0x19b5e6['type'][_0xd812('0x28')]};});_0x4c78eb['model']=_[_0xd812('0x25')](_0x3331e0,'name');_0x4c78eb['query']=_['keys'](_0x59d8e4[_0xd812('0x29')]);_0x4c78eb[_0xd812('0x2a')]=_[_0xd812('0x2b')](_0x4c78eb[_0xd812('0x2c')],_0x4c78eb['query']);_0xcda85[_0xd812('0x2d')]=_['intersection'](_0x4c78eb[_0xd812('0x2c')],qs[_0xd812('0x2e')](_0x59d8e4[_0xd812('0x29')]['fields']));_0xcda85[_0xd812('0x2d')]=_0xcda85[_0xd812('0x2d')][_0xd812('0x2f')]?_0xcda85[_0xd812('0x2d')]:_0x4c78eb[_0xd812('0x2c')];if(!_0x59d8e4[_0xd812('0x29')][_0xd812('0x30')]('nolimit')){_0xcda85[_0xd812('0x19')]=qs[_0xd812('0x19')](_0x59d8e4[_0xd812('0x29')]['limit']);_0xcda85[_0xd812('0x1b')]=qs[_0xd812('0x1b')](_0x59d8e4['query'][_0xd812('0x1b')]);}_0xcda85['order']=qs[_0xd812('0x31')](_0x59d8e4[_0xd812('0x29')]['sort']);_0xcda85['where']=qs['filters'](_['pick'](_0x59d8e4[_0xd812('0x29')],_0x4c78eb['filters']),_0x3331e0);if(_0x59d8e4['query'][_0xd812('0x32')]){_0xcda85[_0xd812('0x33')]=_[_0xd812('0x34')](_0xcda85[_0xd812('0x33')],{'$or':_[_0xd812('0x25')](_0x3331e0,function(_0x3f4dd2){if(_0x3f4dd2[_0xd812('0x35')]!==_0xd812('0x36')){var _0x2e10c3={};_0x2e10c3[_0x3f4dd2[_0xd812('0x23')]]={'$like':'%'+_0x59d8e4['query']['filter']+'%'};return _0x2e10c3;}})});}_0xcda85=_[_0xd812('0x34')]({},_0xcda85,_0x59d8e4[_0xd812('0x37')]);var _0x88f1ea={'where':_0xcda85['where']};return db[_0xd812('0x38')][_0xd812('0x1a')](_0x88f1ea)['then'](function(_0x26882d){_0x352a57[_0xd812('0x1a')]=_0x26882d;if(_0x59d8e4[_0xd812('0x29')][_0xd812('0x39')]){_0xcda85[_0xd812('0x3a')]=[{'all':!![]}];}return db[_0xd812('0x38')]['findAll'](_0xcda85);})[_0xd812('0x1f')](function(_0x4ba50e){_0x352a57[_0xd812('0x3b')]=_0x4ba50e;return _0x352a57;})[_0xd812('0x1f')](respondWithFilteredResult(_0x1c843f,_0xcda85))['catch'](handleError(_0x1c843f,null));};exports[_0xd812('0x3c')]=function(_0x23aa92,_0x302cab){var _0x4cf618={'raw':!![],'where':{'id':_0x23aa92[_0xd812('0x3d')]['id']}},_0x112a24={};_0x112a24['model']=_[_0xd812('0x3e')](db[_0xd812('0x38')][_0xd812('0x26')]);_0x112a24[_0xd812('0x29')]=_['keys'](_0x23aa92[_0xd812('0x29')]);_0x112a24[_0xd812('0x2a')]=_[_0xd812('0x2b')](_0x112a24[_0xd812('0x2c')],_0x112a24[_0xd812('0x29')]);_0x4cf618['attributes']=_['intersection'](_0x112a24[_0xd812('0x2c')],qs[_0xd812('0x2e')](_0x23aa92[_0xd812('0x29')]['fields']));_0x4cf618[_0xd812('0x2d')]=_0x4cf618[_0xd812('0x2d')][_0xd812('0x2f')]?_0x4cf618[_0xd812('0x2d')]:_0x112a24['model'];if(_0x23aa92[_0xd812('0x29')][_0xd812('0x39')]){_0x4cf618['include']=[{'all':!![]}];}_0x4cf618=_[_0xd812('0x34')]({},_0x4cf618,_0x23aa92[_0xd812('0x37')]);return db[_0xd812('0x38')][_0xd812('0x3f')](_0x4cf618)[_0xd812('0x1f')](handleEntityNotFound(_0x302cab,null))[_0xd812('0x1f')](respondWithResult(_0x302cab,null))[_0xd812('0x40')](handleError(_0x302cab,null));};exports['create']=function(_0x3acc07,_0x9e8ae){return db[_0xd812('0x38')]['create'](_0x3acc07[_0xd812('0x41')],{})[_0xd812('0x1f')](respondWithResult(_0x9e8ae,0xc9))['catch'](handleError(_0x9e8ae,null));};exports['update']=function(_0x397601,_0x509c15){if(_0x397601['body']['id']){delete _0x397601[_0xd812('0x41')]['id'];}return db[_0xd812('0x38')][_0xd812('0x3f')]({'where':{'id':_0x397601[_0xd812('0x3d')]['id']}})[_0xd812('0x1f')](handleEntityNotFound(_0x509c15,null))[_0xd812('0x1f')](saveUpdates(_0x397601[_0xd812('0x41')],null))[_0xd812('0x1f')](respondWithResult(_0x509c15,null))[_0xd812('0x40')](handleError(_0x509c15,null));};exports['destroy']=function(_0x50b5f7,_0x21758b){return db[_0xd812('0x38')][_0xd812('0x3f')]({'where':{'id':_0x50b5f7[_0xd812('0x3d')]['id']}})[_0xd812('0x1f')](handleEntityNotFound(_0x21758b,null))[_0xd812('0x1f')](removeEntity(_0x21758b,null))[_0xd812('0x40')](handleError(_0x21758b,null));}; \ No newline at end of file +var _0xf130=['name','index','DeskField','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','stack'];(function(_0x4627b7,_0x269344){var _0xf75718=function(_0x45c922){while(--_0x45c922){_0x4627b7['push'](_0x4627b7['shift']());}};_0xf75718(++_0x269344);}(_0xf130,0x149));var _0x0f13=function(_0x1f68dd,_0x40414e){_0x1f68dd=_0x1f68dd-0x0;var _0x5b72c9=_0xf130[_0x1f68dd];return _0x5b72c9;};'use strict';var emlformat=require(_0x0f13('0x0'));var rimraf=require(_0x0f13('0x1'));var zipdir=require(_0x0f13('0x2'));var jsonpatch=require(_0x0f13('0x3'));var rp=require(_0x0f13('0x4'));var moment=require(_0x0f13('0x5'));var BPromise=require(_0x0f13('0x6'));var Mustache=require(_0x0f13('0x7'));var util=require('util');var path=require(_0x0f13('0x8'));var sox=require(_0x0f13('0x9'));var csv=require(_0x0f13('0xa'));var ejs=require(_0x0f13('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f13('0xc'));var squel=require(_0x0f13('0xd'));var crypto=require(_0x0f13('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0f13('0xf'));var toCsv=require(_0x0f13('0xa'));var querystring=require(_0x0f13('0x10'));var Papa=require(_0x0f13('0x11'));var Redis=require(_0x0f13('0x12'));var authService=require(_0x0f13('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0f13('0x14'));var logger=require('../../config/logger')(_0x0f13('0x15'));var utils=require(_0x0f13('0x16'));var config=require(_0x0f13('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0f13('0x18'))['db'];function respondWithStatusCode(_0x216bb7,_0x3e7de8){_0x3e7de8=_0x3e7de8||0xcc;return function(_0x2ad79e){if(_0x2ad79e){return _0x216bb7[_0x0f13('0x19')](_0x3e7de8);}return _0x216bb7[_0x0f13('0x1a')](_0x3e7de8)['end']();};}function respondWithResult(_0x273e5f,_0x404631){_0x404631=_0x404631||0xc8;return function(_0x50f626){if(_0x50f626){return _0x273e5f[_0x0f13('0x1a')](_0x404631)[_0x0f13('0x1b')](_0x50f626);}};}function respondWithFilteredResult(_0x36c09e,_0xe171cd){return function(_0x187568){if(_0x187568){var _0x308893=typeof _0xe171cd[_0x0f13('0x1c')]===_0x0f13('0x1d')&&typeof _0xe171cd['limit']===_0x0f13('0x1d');var _0x2b4f43=_0x187568['count'];var _0x467e84=_0x308893?0x0:_0xe171cd['offset'];var _0xb8cb0f=_0x308893?_0x187568[_0x0f13('0x1e')]:_0xe171cd[_0x0f13('0x1c')]+_0xe171cd[_0x0f13('0x1f')];var _0x4c544e;if(_0xb8cb0f>=_0x2b4f43){_0xb8cb0f=_0x2b4f43;_0x4c544e=0xc8;}else{_0x4c544e=0xce;}_0x36c09e['status'](_0x4c544e);return _0x36c09e[_0x0f13('0x20')](_0x0f13('0x21'),_0x467e84+'-'+_0xb8cb0f+'/'+_0x2b4f43)[_0x0f13('0x1b')](_0x187568);}return null;};}function patchUpdates(_0x1ad99a){return function(_0x446ad4){try{jsonpatch[_0x0f13('0x22')](_0x446ad4,_0x1ad99a,!![]);}catch(_0x14f657){return BPromise[_0x0f13('0x23')](_0x14f657);}return _0x446ad4[_0x0f13('0x24')]();};}function saveUpdates(_0x728b17,_0x5994d0){return function(_0x58dc78){if(_0x58dc78){return _0x58dc78[_0x0f13('0x25')](_0x728b17)[_0x0f13('0x26')](function(_0x860f0c){return _0x860f0c;});}return null;};}function removeEntity(_0x2e71b4,_0x36b170){return function(_0x393f0e){if(_0x393f0e){return _0x393f0e['destroy']()[_0x0f13('0x26')](function(){_0x2e71b4[_0x0f13('0x1a')](0xcc)[_0x0f13('0x27')]();});}};}function handleEntityNotFound(_0x68dffc,_0x5a6aba){return function(_0x1e71b3){if(!_0x1e71b3){_0x68dffc['sendStatus'](0x194);}return _0x1e71b3;};}function handleError(_0x1509d5,_0x4426fa){_0x4426fa=_0x4426fa||0x1f4;return function(_0x1f5c7e){logger['error'](_0x1f5c7e[_0x0f13('0x28')]);if(_0x1f5c7e[_0x0f13('0x29')]){delete _0x1f5c7e[_0x0f13('0x29')];}_0x1509d5[_0x0f13('0x1a')](_0x4426fa)['send'](_0x1f5c7e);};}exports[_0x0f13('0x2a')]=function(_0x57195c,_0x57b9ed){var _0x513eed={},_0x3dfe41={},_0x155a00={'count':0x0,'rows':[]};var _0x2592b0=_['map'](db[_0x0f13('0x2b')][_0x0f13('0x2c')],function(_0x51a83d){return{'name':_0x51a83d['fieldName'],'type':_0x51a83d[_0x0f13('0x2d')][_0x0f13('0x2e')]};});_0x3dfe41['model']=_['map'](_0x2592b0,_0x0f13('0x29'));_0x3dfe41[_0x0f13('0x2f')]=_[_0x0f13('0x30')](_0x57195c[_0x0f13('0x2f')]);_0x3dfe41['filters']=_[_0x0f13('0x31')](_0x3dfe41[_0x0f13('0x32')],_0x3dfe41['query']);_0x513eed[_0x0f13('0x33')]=_[_0x0f13('0x31')](_0x3dfe41[_0x0f13('0x32')],qs[_0x0f13('0x34')](_0x57195c[_0x0f13('0x2f')]['fields']));_0x513eed['attributes']=_0x513eed['attributes'][_0x0f13('0x35')]?_0x513eed['attributes']:_0x3dfe41[_0x0f13('0x32')];if(!_0x57195c[_0x0f13('0x2f')][_0x0f13('0x36')](_0x0f13('0x37'))){_0x513eed['limit']=qs[_0x0f13('0x1f')](_0x57195c[_0x0f13('0x2f')][_0x0f13('0x1f')]);_0x513eed['offset']=qs[_0x0f13('0x1c')](_0x57195c[_0x0f13('0x2f')][_0x0f13('0x1c')]);}_0x513eed[_0x0f13('0x38')]=qs[_0x0f13('0x39')](_0x57195c['query'][_0x0f13('0x39')]);_0x513eed[_0x0f13('0x3a')]=qs['filters'](_['pick'](_0x57195c[_0x0f13('0x2f')],_0x3dfe41[_0x0f13('0x3b')]),_0x2592b0);if(_0x57195c[_0x0f13('0x2f')][_0x0f13('0x3c')]){_0x513eed['where']=_[_0x0f13('0x3d')](_0x513eed['where'],{'$or':_[_0x0f13('0x3e')](_0x2592b0,function(_0x7e19bd){if(_0x7e19bd[_0x0f13('0x2d')]!==_0x0f13('0x3f')){var _0x3eb593={};_0x3eb593[_0x7e19bd[_0x0f13('0x29')]]={'$like':'%'+_0x57195c[_0x0f13('0x2f')]['filter']+'%'};return _0x3eb593;}})});}_0x513eed=_['merge']({},_0x513eed,_0x57195c[_0x0f13('0x40')]);var _0x54b225={'where':_0x513eed[_0x0f13('0x3a')]};return db['DeskField'][_0x0f13('0x1e')](_0x54b225)[_0x0f13('0x26')](function(_0x1f7b0d){_0x155a00[_0x0f13('0x1e')]=_0x1f7b0d;if(_0x57195c['query'][_0x0f13('0x41')]){_0x513eed[_0x0f13('0x42')]=[{'all':!![]}];}return db['DeskField'][_0x0f13('0x43')](_0x513eed);})[_0x0f13('0x26')](function(_0x5d41d6){_0x155a00['rows']=_0x5d41d6;return _0x155a00;})[_0x0f13('0x26')](respondWithFilteredResult(_0x57b9ed,_0x513eed))[_0x0f13('0x44')](handleError(_0x57b9ed,null));};exports[_0x0f13('0x45')]=function(_0x33edc6,_0x31b5ec){var _0x4a9ecf={'raw':!![],'where':{'id':_0x33edc6[_0x0f13('0x46')]['id']}},_0x2d33da={};_0x2d33da['model']=_[_0x0f13('0x30')](db[_0x0f13('0x2b')][_0x0f13('0x2c')]);_0x2d33da[_0x0f13('0x2f')]=_[_0x0f13('0x30')](_0x33edc6['query']);_0x2d33da[_0x0f13('0x3b')]=_[_0x0f13('0x31')](_0x2d33da[_0x0f13('0x32')],_0x2d33da[_0x0f13('0x2f')]);_0x4a9ecf[_0x0f13('0x33')]=_[_0x0f13('0x31')](_0x2d33da[_0x0f13('0x32')],qs[_0x0f13('0x34')](_0x33edc6[_0x0f13('0x2f')][_0x0f13('0x34')]));_0x4a9ecf[_0x0f13('0x33')]=_0x4a9ecf['attributes'][_0x0f13('0x35')]?_0x4a9ecf[_0x0f13('0x33')]:_0x2d33da[_0x0f13('0x32')];if(_0x33edc6[_0x0f13('0x2f')]['includeAll']){_0x4a9ecf[_0x0f13('0x42')]=[{'all':!![]}];}_0x4a9ecf=_[_0x0f13('0x3d')]({},_0x4a9ecf,_0x33edc6[_0x0f13('0x40')]);return db[_0x0f13('0x2b')]['find'](_0x4a9ecf)[_0x0f13('0x26')](handleEntityNotFound(_0x31b5ec,null))[_0x0f13('0x26')](respondWithResult(_0x31b5ec,null))[_0x0f13('0x44')](handleError(_0x31b5ec,null));};exports[_0x0f13('0x47')]=function(_0x54ac44,_0x3d2199){return db[_0x0f13('0x2b')]['create'](_0x54ac44['body'],{})[_0x0f13('0x26')](respondWithResult(_0x3d2199,0xc9))[_0x0f13('0x44')](handleError(_0x3d2199,null));};exports[_0x0f13('0x25')]=function(_0x1f896d,_0x317691){if(_0x1f896d[_0x0f13('0x48')]['id']){delete _0x1f896d[_0x0f13('0x48')]['id'];}return db['DeskField'][_0x0f13('0x49')]({'where':{'id':_0x1f896d[_0x0f13('0x46')]['id']}})[_0x0f13('0x26')](handleEntityNotFound(_0x317691,null))[_0x0f13('0x26')](saveUpdates(_0x1f896d[_0x0f13('0x48')],null))['then'](respondWithResult(_0x317691,null))[_0x0f13('0x44')](handleError(_0x317691,null));};exports['destroy']=function(_0x1b07c6,_0x13d020){return db[_0x0f13('0x2b')][_0x0f13('0x49')]({'where':{'id':_0x1b07c6[_0x0f13('0x46')]['id']}})[_0x0f13('0x26')](handleEntityNotFound(_0x13d020,null))[_0x0f13('0x26')](removeEntity(_0x13d020,null))['catch'](handleError(_0x13d020,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 77df955..f763b2b 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 _0x9c97=['request-promise','rimraf','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index','FieldId','lodash','api','bluebird'];(function(_0x14f16e,_0x75f5fc){var _0x39f46b=function(_0x19ab98){while(--_0x19ab98){_0x14f16e['push'](_0x14f16e['shift']());}};_0x39f46b(++_0x75f5fc);}(_0x9c97,0xe4));var _0x79c9=function(_0x2ce1b9,_0xaa3183){_0x2ce1b9=_0x2ce1b9-0x0;var _0x236a8c=_0x9c97[_0x2ce1b9];return _0x236a8c;};'use strict';var _=require(_0x79c9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x79c9('0x1'));var moment=require('moment');var BPromise=require(_0x79c9('0x2'));var rp=require(_0x79c9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79c9('0x4'));var config=require('../../config/environment');var attributes=require(_0x79c9('0x5'));module[_0x79c9('0x6')]=function(_0x1fdd05,_0x34bfb0){return _0x1fdd05['define'](_0x79c9('0x7'),attributes,{'tableName':_0x79c9('0x8'),'paranoid':![],'indexes':[{'name':_0x79c9('0x9'),'fields':['idField',_0x79c9('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xffb2=['desk_unique_index','idField','lodash','api','moment','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField','int_desk_fields'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xffb2,0x120));var _0x2ffb=function(_0x2eb3db,_0x4a32c0){_0x2eb3db=_0x2eb3db-0x0;var _0x358f33=_0xffb2[_0x2eb3db];return _0x358f33;};'use strict';var _=require(_0x2ffb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2ffb('0x1'));var moment=require(_0x2ffb('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ffb('0x3'));var rimraf=require(_0x2ffb('0x4'));var config=require(_0x2ffb('0x5'));var attributes=require(_0x2ffb('0x6'));module['exports']=function(_0x810608,_0x1037bf){return _0x810608['define'](_0x2ffb('0x7'),attributes,{'tableName':_0x2ffb('0x8'),'paranoid':![],'indexes':[{'name':_0x2ffb('0x9'),'fields':[_0x2ffb('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 6d89d5e..379882a 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 _0x123e=['client','http','request','then','info','DeskField,\x20%s,\x20%s','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x123e,0x85));var _0xe123=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x123e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe123('0x0'));var util=require(_0xe123('0x1'));var moment=require(_0xe123('0x2'));var BPromise=require(_0xe123('0x3'));var rs=require(_0xe123('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe123('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe123('0x6'));var client=jayson[_0xe123('0x7')][_0xe123('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aa5a8,_0x246d7d,_0x562ef2){return new BPromise(function(_0x17ba79,_0x2bf5ba){return client[_0xe123('0x9')](_0x5aa5a8,_0x562ef2)[_0xe123('0xa')](function(_0x128ea3){logger[_0xe123('0xb')](_0xe123('0xc'),_0x246d7d,'request\x20sent');logger['debug'](_0xe123('0xd'),_0x246d7d,_0xe123('0xe'),JSON[_0xe123('0xf')](_0x128ea3));if(_0x128ea3[_0xe123('0x10')]){if(_0x128ea3['error'][_0xe123('0x11')]===0x1f4){logger[_0xe123('0x10')](_0xe123('0xc'),_0x246d7d,_0x128ea3[_0xe123('0x10')]['message']);return _0x2bf5ba(_0x128ea3[_0xe123('0x10')][_0xe123('0x12')]);}logger['error'](_0xe123('0xc'),_0x246d7d,_0x128ea3[_0xe123('0x10')][_0xe123('0x12')]);return _0x17ba79(_0x128ea3['error']['message']);}else{logger[_0xe123('0xb')](_0xe123('0xc'),_0x246d7d,_0xe123('0xe'));_0x17ba79(_0x128ea3[_0xe123('0x13')]['message']);}})['catch'](function(_0x53208a){logger[_0xe123('0x10')](_0xe123('0xc'),_0x246d7d,_0x53208a);_0x2bf5ba(_0x53208a);});});} \ No newline at end of file +var _0xf2fc=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x5cf52f,_0x2304cc){var _0x5b4b76=function(_0x3c408b){while(--_0x3c408b){_0x5cf52f['push'](_0x5cf52f['shift']());}};_0x5b4b76(++_0x2304cc);}(_0xf2fc,0x1b6));var _0xcf2f=function(_0x2215c7,_0x32f45a){_0x2215c7=_0x2215c7-0x0;var _0x58b1e1=_0xf2fc[_0x2215c7];return _0x58b1e1;};'use strict';var _=require(_0xcf2f('0x0'));var util=require(_0xcf2f('0x1'));var moment=require(_0xcf2f('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf2f('0x3'));var fs=require('fs');var Redis=require(_0xcf2f('0x4'));var db=require(_0xcf2f('0x5'))['db'];var utils=require(_0xcf2f('0x6'));var logger=require('../../config/logger')(_0xcf2f('0x7'));var config=require(_0xcf2f('0x8'));var jayson=require(_0xcf2f('0x9'));var client=jayson[_0xcf2f('0xa')][_0xcf2f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3689a0,_0x222703,_0x458465){return new BPromise(function(_0x30a0bd,_0x58a237){return client[_0xcf2f('0xc')](_0x3689a0,_0x458465)[_0xcf2f('0xd')](function(_0x5a8ce0){logger[_0xcf2f('0xe')](_0xcf2f('0xf'),_0x222703,_0xcf2f('0x10'));logger[_0xcf2f('0x11')]('DeskField,\x20%s,\x20%s,\x20%s',_0x222703,_0xcf2f('0x10'),JSON[_0xcf2f('0x12')](_0x5a8ce0));if(_0x5a8ce0[_0xcf2f('0x13')]){if(_0x5a8ce0[_0xcf2f('0x13')][_0xcf2f('0x14')]===0x1f4){logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x222703,_0x5a8ce0['error']['message']);return _0x58a237(_0x5a8ce0['error'][_0xcf2f('0x15')]);}logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x222703,_0x5a8ce0[_0xcf2f('0x13')][_0xcf2f('0x15')]);return _0x30a0bd(_0x5a8ce0[_0xcf2f('0x13')][_0xcf2f('0x15')]);}else{logger[_0xcf2f('0xe')](_0xcf2f('0xf'),_0x222703,'request\x20sent');_0x30a0bd(_0x5a8ce0[_0xcf2f('0x16')]['message']);}})['catch'](function(_0x45f4ea){logger[_0xcf2f('0x13')](_0xcf2f('0xf'),_0x222703,_0x45f4ea);_0x58a237(_0x45f4ea);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index e7a975c..d1c4d26 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 _0x8176=['create','addConfiguration','put','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','post'];(function(_0x2ead36,_0x29dda4){var _0x13d316=function(_0x398d48){while(--_0x398d48){_0x2ead36['push'](_0x2ead36['shift']());}};_0x13d316(++_0x29dda4);}(_0x8176,0xe1));var _0x6817=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x8176[_0x110c3d];return _0x226d67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6817('0x0'));var timeout=require(_0x6817('0x1'));var express=require(_0x6817('0x2'));var router=express[_0x6817('0x3')]();var fs_extra=require(_0x6817('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6817('0x5'));var config=require('../../config/environment');var controller=require(_0x6817('0x6'));router[_0x6817('0x7')]('/',auth[_0x6817('0x8')](),controller[_0x6817('0x9')]);router[_0x6817('0x7')](_0x6817('0xa'),auth[_0x6817('0x8')](),controller['show']);router[_0x6817('0x7')](_0x6817('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x6817('0x7')](_0x6817('0xc'),auth[_0x6817('0x8')](),controller[_0x6817('0xd')]);router[_0x6817('0xe')]('/',auth[_0x6817('0x8')](),controller[_0x6817('0xf')]);router[_0x6817('0xe')](_0x6817('0xb'),auth['isAuthenticated'](),controller[_0x6817('0x10')]);router[_0x6817('0x11')]('/:id',auth[_0x6817('0x8')](),controller[_0x6817('0x12')]);router[_0x6817('0x13')]('/:id',auth[_0x6817('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf246=['path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','post','/:id/configurations','addConfiguration','put','update','destroy','exports','multer'];(function(_0x1c5a1,_0x30f792){var _0x11a7c3=function(_0x95da12){while(--_0x95da12){_0x1c5a1['push'](_0x1c5a1['shift']());}};_0x11a7c3(++_0x30f792);}(_0xf246,0x107));var _0x6f24=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf246[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x6f24('0x0'));var util=require('util');var path=require(_0x6f24('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6f24('0x2')]();var fs_extra=require(_0x6f24('0x3'));var auth=require(_0x6f24('0x4'));var interaction=require(_0x6f24('0x5'));var config=require(_0x6f24('0x6'));var controller=require(_0x6f24('0x7'));router['get']('/',auth[_0x6f24('0x8')](),controller[_0x6f24('0x9')]);router[_0x6f24('0xa')](_0x6f24('0xb'),auth['isAuthenticated'](),controller[_0x6f24('0xc')]);router[_0x6f24('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6f24('0xd')]);router[_0x6f24('0xa')](_0x6f24('0xe'),auth[_0x6f24('0x8')](),controller['getFields']);router[_0x6f24('0xf')]('/',auth[_0x6f24('0x8')](),controller['create']);router[_0x6f24('0xf')](_0x6f24('0x10'),auth[_0x6f24('0x8')](),controller[_0x6f24('0x11')]);router[_0x6f24('0x12')]('/:id',auth[_0x6f24('0x8')](),controller[_0x6f24('0x13')]);router['delete'](_0x6f24('0xb'),auth[_0x6f24('0x8')](),controller[_0x6f24('0x14')]);module[_0x6f24('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 99282e0..8e86e09 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 _0x8911=['STRING','sequelize','exports'];(function(_0x185be4,_0x29e65f){var _0x42d3ed=function(_0xddf1a5){while(--_0xddf1a5){_0x185be4['push'](_0x185be4['shift']());}};_0x42d3ed(++_0x29e65f);}(_0x8911,0x76));var _0x1891=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8911[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1891('0x0'));module[_0x1891('0x1')]={'name':{'type':Sequelize[_0x1891('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x1891('0x2')]},'remoteUri':{'type':Sequelize[_0x1891('0x2')]},'tenantId':{'type':Sequelize[_0x1891('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1891('0x2')]},'serverUrl':{'type':Sequelize[_0x1891('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1891('0x2')]}}; \ No newline at end of file +var _0xaf90=['sequelize','exports','STRING'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0xaf90,0x93));var _0x0af9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xaf90[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0af9('0x0'));module[_0x0af9('0x1')]={'name':{'type':Sequelize[_0x0af9('0x2')]},'username':{'type':Sequelize[_0x0af9('0x2')]},'password':{'type':Sequelize[_0x0af9('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0af9('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'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 608f3f3..508c900 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 _0x093a=['index','map','Dynamics365Account','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','type','options','where','includeAll','include','catch','show','params','keys','find','create','update','body','getConfigurations','findOne','Dynamics365Configuration','order','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','exchangerate','followupby','importsequencenumber','kbarticleidname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','remoteUri','tenantId','clientSecret','slice','substring','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/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','lastIndexOf','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','DoubleAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','statusCode','test','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','UserLocalizedLabel','Label','Value','DisplayName','OptionSet','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send'];(function(_0x17b8a9,_0x3bbf58){var _0x4add80=function(_0x683126){while(--_0x683126){_0x17b8a9['push'](_0x17b8a9['shift']());}};_0x4add80(++_0x3bbf58);}(_0x093a,0x16a));var _0xa093=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x093a[_0x1cc8fe];return _0x230054;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa093('0x0'));var zipdir=require(_0xa093('0x1'));var jsonpatch=require(_0xa093('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa093('0x3'));var Mustache=require(_0xa093('0x4'));var util=require(_0xa093('0x5'));var path=require(_0xa093('0x6'));var sox=require(_0xa093('0x7'));var csv=require(_0xa093('0x8'));var ejs=require(_0xa093('0x9'));var fs=require('fs');var fs_extra=require(_0xa093('0xa'));var _=require(_0xa093('0xb'));var squel=require(_0xa093('0xc'));var crypto=require(_0xa093('0xd'));var jsforce=require(_0xa093('0xe'));var deskjs=require(_0xa093('0xf'));var toCsv=require(_0xa093('0x8'));var querystring=require(_0xa093('0x10'));var Papa=require(_0xa093('0x11'));var Redis=require(_0xa093('0x12'));var authService=require(_0xa093('0x13'));var qs=require(_0xa093('0x14'));var as=require(_0xa093('0x15'));var hardwareService=require(_0xa093('0x16'));var logger=require('../../config/logger')(_0xa093('0x17'));var utils=require(_0xa093('0x18'));var config=require(_0xa093('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa093('0x1a'))['db'];var integrations=require(_0xa093('0x1b'));function respondWithStatusCode(_0x306405,_0x33b118){_0x33b118=_0x33b118||0xcc;return function(_0x1171cb){if(_0x1171cb){return _0x306405[_0xa093('0x1c')](_0x33b118);}return _0x306405[_0xa093('0x1d')](_0x33b118)['end']();};}function respondWithResult(_0x108037,_0x56fc96){_0x56fc96=_0x56fc96||0xc8;return function(_0x1fffe5){if(_0x1fffe5){return _0x108037[_0xa093('0x1d')](_0x56fc96)[_0xa093('0x1e')](_0x1fffe5);}};}function respondWithFilteredResult(_0x2f8e67,_0x8245d8){return function(_0x26ac40){if(_0x26ac40){var _0x1f1889=typeof _0x8245d8[_0xa093('0x1f')]==='undefined'&&typeof _0x8245d8[_0xa093('0x20')]===_0xa093('0x21');var _0x2fcd3f=_0x26ac40[_0xa093('0x22')];var _0x14e352=_0x1f1889?0x0:_0x8245d8[_0xa093('0x1f')];var _0x362345=_0x1f1889?_0x26ac40['count']:_0x8245d8[_0xa093('0x1f')]+_0x8245d8['limit'];var _0x3c4c4b;if(_0x362345>=_0x2fcd3f){_0x362345=_0x2fcd3f;_0x3c4c4b=0xc8;}else{_0x3c4c4b=0xce;}_0x2f8e67['status'](_0x3c4c4b);return _0x2f8e67[_0xa093('0x23')](_0xa093('0x24'),_0x14e352+'-'+_0x362345+'/'+_0x2fcd3f)['json'](_0x26ac40);}return null;};}function patchUpdates(_0x3841c8){return function(_0x2c4cd4){try{jsonpatch[_0xa093('0x25')](_0x2c4cd4,_0x3841c8,!![]);}catch(_0x2332c6){return BPromise[_0xa093('0x26')](_0x2332c6);}return _0x2c4cd4['save']();};}function saveUpdates(_0x2fa9ca,_0x57125e){return function(_0x5a16bd){if(_0x5a16bd){return _0x5a16bd['update'](_0x2fa9ca)[_0xa093('0x27')](function(_0x329847){return _0x329847;});}return null;};}function removeEntity(_0x2e909d,_0x3aeb7f){return function(_0x38c9f3){if(_0x38c9f3){return _0x38c9f3[_0xa093('0x28')]()[_0xa093('0x27')](function(){_0x2e909d[_0xa093('0x1d')](0xcc)[_0xa093('0x29')]();});}};}function handleEntityNotFound(_0x536311,_0xd20fd){return function(_0x1ab00f){if(!_0x1ab00f){_0x536311[_0xa093('0x1c')](0x194);}return _0x1ab00f;};}function handleError(_0x36fd8f,_0x31909b){_0x31909b=_0x31909b||0x1f4;return function(_0x5f7bb7){logger[_0xa093('0x2a')](_0x5f7bb7[_0xa093('0x2b')]);if(_0x5f7bb7[_0xa093('0x2c')]){delete _0x5f7bb7[_0xa093('0x2c')];}_0x36fd8f['status'](_0x31909b)[_0xa093('0x2d')](_0x5f7bb7);};}exports[_0xa093('0x2e')]=function(_0x2d0e05,_0x238904){var _0xdae8ec={},_0x4cc949={},_0x507f20={'count':0x0,'rows':[]};var _0x26a606=_[_0xa093('0x2f')](db[_0xa093('0x30')][_0xa093('0x31')],function(_0x59a957){return{'name':_0x59a957['fieldName'],'type':_0x59a957['type'][_0xa093('0x32')]};});_0x4cc949['model']=_[_0xa093('0x2f')](_0x26a606,_0xa093('0x2c'));_0x4cc949[_0xa093('0x33')]=_['keys'](_0x2d0e05[_0xa093('0x33')]);_0x4cc949[_0xa093('0x34')]=_[_0xa093('0x35')](_0x4cc949[_0xa093('0x36')],_0x4cc949[_0xa093('0x33')]);_0xdae8ec[_0xa093('0x37')]=_[_0xa093('0x35')](_0x4cc949[_0xa093('0x36')],qs[_0xa093('0x38')](_0x2d0e05[_0xa093('0x33')][_0xa093('0x38')]));_0xdae8ec[_0xa093('0x37')]=_0xdae8ec['attributes'][_0xa093('0x39')]?_0xdae8ec['attributes']:_0x4cc949[_0xa093('0x36')];if(!_0x2d0e05[_0xa093('0x33')][_0xa093('0x3a')](_0xa093('0x3b'))){_0xdae8ec['limit']=qs[_0xa093('0x20')](_0x2d0e05['query'][_0xa093('0x20')]);_0xdae8ec[_0xa093('0x1f')]=qs[_0xa093('0x1f')](_0x2d0e05[_0xa093('0x33')][_0xa093('0x1f')]);}_0xdae8ec['order']=qs[_0xa093('0x3c')](_0x2d0e05['query'][_0xa093('0x3c')]);_0xdae8ec['where']=qs['filters'](_[_0xa093('0x3d')](_0x2d0e05[_0xa093('0x33')],_0x4cc949['filters']),_0x26a606);if(_0x2d0e05[_0xa093('0x33')][_0xa093('0x3e')]){_0xdae8ec['where']=_[_0xa093('0x3f')](_0xdae8ec['where'],{'$or':_[_0xa093('0x2f')](_0x26a606,function(_0x124b22){if(_0x124b22[_0xa093('0x40')]!=='VIRTUAL'){var _0x49d997={};_0x49d997[_0x124b22[_0xa093('0x2c')]]={'$like':'%'+_0x2d0e05[_0xa093('0x33')][_0xa093('0x3e')]+'%'};return _0x49d997;}})});}_0xdae8ec=_[_0xa093('0x3f')]({},_0xdae8ec,_0x2d0e05[_0xa093('0x41')]);var _0x22682e={'where':_0xdae8ec[_0xa093('0x42')]};return db[_0xa093('0x30')]['count'](_0x22682e)[_0xa093('0x27')](function(_0x5ab353){_0x507f20[_0xa093('0x22')]=_0x5ab353;if(_0x2d0e05[_0xa093('0x33')][_0xa093('0x43')]){_0xdae8ec[_0xa093('0x44')]=[{'all':!![]}];}return db[_0xa093('0x30')]['findAll'](_0xdae8ec);})[_0xa093('0x27')](function(_0x3fdc2b){_0x507f20['rows']=_0x3fdc2b;return _0x507f20;})[_0xa093('0x27')](respondWithFilteredResult(_0x238904,_0xdae8ec))[_0xa093('0x45')](handleError(_0x238904,null));};exports[_0xa093('0x46')]=function(_0x3303da,_0x58c10e){var _0x4205f8={'raw':![],'where':{'id':_0x3303da[_0xa093('0x47')]['id']}},_0x219dc6={};_0x219dc6[_0xa093('0x36')]=_[_0xa093('0x48')](db['Dynamics365Account'][_0xa093('0x31')]);_0x219dc6[_0xa093('0x33')]=_[_0xa093('0x48')](_0x3303da[_0xa093('0x33')]);_0x219dc6['filters']=_[_0xa093('0x35')](_0x219dc6[_0xa093('0x36')],_0x219dc6[_0xa093('0x33')]);_0x4205f8[_0xa093('0x37')]=_[_0xa093('0x35')](_0x219dc6[_0xa093('0x36')],qs[_0xa093('0x38')](_0x3303da[_0xa093('0x33')][_0xa093('0x38')]));_0x4205f8[_0xa093('0x37')]=_0x4205f8['attributes']['length']?_0x4205f8[_0xa093('0x37')]:_0x219dc6[_0xa093('0x36')];if(_0x3303da[_0xa093('0x33')][_0xa093('0x43')]){_0x4205f8[_0xa093('0x44')]=[{'all':!![]}];}_0x4205f8=_[_0xa093('0x3f')]({},_0x4205f8,_0x3303da[_0xa093('0x41')]);return db[_0xa093('0x30')][_0xa093('0x49')](_0x4205f8)[_0xa093('0x27')](handleEntityNotFound(_0x58c10e,null))[_0xa093('0x27')](respondWithResult(_0x58c10e,null))[_0xa093('0x45')](handleError(_0x58c10e,null));};exports[_0xa093('0x4a')]=function(_0x295c21,_0x25ca78){return db['Dynamics365Account']['create'](_0x295c21['body'],{})[_0xa093('0x27')](respondWithResult(_0x25ca78,0xc9))[_0xa093('0x45')](handleError(_0x25ca78,null));};exports[_0xa093('0x4b')]=function(_0x2fefaf,_0x44542f){if(_0x2fefaf[_0xa093('0x4c')]['id']){delete _0x2fefaf[_0xa093('0x4c')]['id'];}return db[_0xa093('0x30')]['find']({'where':{'id':_0x2fefaf[_0xa093('0x47')]['id']}})[_0xa093('0x27')](handleEntityNotFound(_0x44542f,null))[_0xa093('0x27')](saveUpdates(_0x2fefaf['body'],null))[_0xa093('0x27')](respondWithResult(_0x44542f,null))['catch'](handleError(_0x44542f,null));};exports['destroy']=function(_0x21b83f,_0x3dfc0b){return db['Dynamics365Account'][_0xa093('0x49')]({'where':{'id':_0x21b83f['params']['id']}})[_0xa093('0x27')](handleEntityNotFound(_0x3dfc0b,null))[_0xa093('0x27')](removeEntity(_0x3dfc0b,null))[_0xa093('0x45')](handleError(_0x3dfc0b,null));};exports[_0xa093('0x4d')]=function(_0x142ef0,_0x1fa6e3,_0x44e813){var _0x2985f0={};var _0x3397e4={};var _0x2915b1;var _0x14cd98;return db[_0xa093('0x30')][_0xa093('0x4e')]({'where':{'id':_0x142ef0[_0xa093('0x47')]['id']}})[_0xa093('0x27')](handleEntityNotFound(_0x1fa6e3,null))[_0xa093('0x27')](function(_0x567246){if(_0x567246){_0x2915b1=_0x567246;_0x3397e4[_0xa093('0x36')]=_[_0xa093('0x48')](db[_0xa093('0x4f')][_0xa093('0x31')]);_0x3397e4[_0xa093('0x33')]=_[_0xa093('0x48')](_0x142ef0[_0xa093('0x33')]);_0x3397e4['filters']=_['intersection'](_0x3397e4[_0xa093('0x36')],_0x3397e4['query']);_0x2985f0[_0xa093('0x37')]=_[_0xa093('0x35')](_0x3397e4[_0xa093('0x36')],qs[_0xa093('0x38')](_0x142ef0[_0xa093('0x33')]['fields']));_0x2985f0[_0xa093('0x37')]=_0x2985f0['attributes']['length']?_0x2985f0[_0xa093('0x37')]:_0x3397e4['model'];_0x2985f0[_0xa093('0x50')]=qs[_0xa093('0x3c')](_0x142ef0['query']['sort']);_0x2985f0[_0xa093('0x42')]=qs['filters'](_['pick'](_0x142ef0['query'],_0x3397e4[_0xa093('0x34')]));if(_0x142ef0[_0xa093('0x33')]['filter']){_0x2985f0[_0xa093('0x42')]=_[_0xa093('0x3f')](_0x2985f0['where'],{'$or':_[_0xa093('0x2f')](_0x2985f0['attributes'],function(_0x213944){var _0x38d2a6={};_0x38d2a6[_0x213944]={'$like':'%'+_0x142ef0[_0xa093('0x33')]['filter']+'%'};return _0x38d2a6;})});}_0x2985f0=_['merge']({},_0x2985f0,_0x142ef0[_0xa093('0x41')]);return _0x2915b1['getConfigurations'](_0x2985f0);}})[_0xa093('0x27')](function(_0x4d6c45){if(_0x4d6c45){_0x14cd98=_0x4d6c45['length'];if(!_0x142ef0[_0xa093('0x33')][_0xa093('0x3a')](_0xa093('0x3b'))){_0x2985f0[_0xa093('0x20')]=qs[_0xa093('0x20')](_0x142ef0[_0xa093('0x33')][_0xa093('0x20')]);_0x2985f0[_0xa093('0x1f')]=qs[_0xa093('0x1f')](_0x142ef0[_0xa093('0x33')][_0xa093('0x1f')]);}return _0x2915b1[_0xa093('0x4d')](_0x2985f0);}})[_0xa093('0x27')](function(_0x46ace8){if(_0x46ace8){return _0x46ace8?{'count':_0x14cd98,'rows':_0x46ace8}:null;}})[_0xa093('0x27')](respondWithResult(_0x1fa6e3,null))[_0xa093('0x45')](handleError(_0x1fa6e3,null));};exports['addConfiguration']=function(_0x4760fe,_0x4364dc,_0x6a6cce){if(_0x4760fe[_0xa093('0x4c')]['id']){delete _0x4760fe[_0xa093('0x4c')]['id'];}return db[_0xa093('0x30')][_0xa093('0x4e')]({'where':{'id':_0x4760fe[_0xa093('0x47')]['id']}})[_0xa093('0x27')](handleEntityNotFound(_0x4364dc,null))['then'](function(_0x19f9f5){if(_0x19f9f5){_0x4760fe['body'][_0xa093('0x51')]=_0x19f9f5['id'];_0x4760fe[_0xa093('0x4c')][_0xa093('0x52')]=integrations['getSubjects'](_0x4760fe[_0xa093('0x4c')][_0xa093('0x53')],_0x4760fe[_0xa093('0x4c')][_0xa093('0x40')]);_0x4760fe[_0xa093('0x4c')][_0xa093('0x54')]=integrations[_0xa093('0x55')](_0x4760fe[_0xa093('0x4c')][_0xa093('0x53')],_0x4760fe[_0xa093('0x4c')]['type']);return db['Dynamics365Configuration'][_0xa093('0x4a')](_0x4760fe[_0xa093('0x4c')],{'include':[{'model':db[_0xa093('0x56')],'as':_0xa093('0x52')},{'model':db[_0xa093('0x56')],'as':_0xa093('0x54')}]});}return null;})['then'](respondWithResult(_0x4364dc,null))['catch'](handleError(_0x4364dc,null));};exports[_0xa093('0x57')]=function(_0x4bacb1,_0x34011c,_0x1e8c01){var _0x442e07=_0x4bacb1[_0xa093('0x33')][_0xa093('0x58')];var _0x4adfe0=_0x442e07===_0xa093('0x59')?_0xa093('0x5a'):'PhoneCall';var _0x41d85c='';var _0xa281b7='';var _0x1d39b2='';var _0xc263fe='';var _0x4e416e='';var _0x193e01='';var _0x1edf16='';var _0x3a4109='';var _0x42d158=[_0xa093('0x5b'),_0xa093('0x5c'),_0xa093('0x5d'),_0xa093('0x5e'),'caseorigincode',_0xa093('0x5f'),'phonenumber',_0xa093('0x60'),_0xa093('0x61'),_0xa093('0x62')];var _0x6d0d5e=[_0xa093('0x63'),_0xa093('0x64'),'actualserviceunits',_0xa093('0x65'),_0xa093('0x66'),_0xa093('0x67'),_0xa093('0x68'),'contractidname',_0xa093('0x69'),_0xa093('0x6a'),_0xa093('0x6b'),'createdbyyominame','createdon',_0xa093('0x6c'),_0xa093('0x6d'),_0xa093('0x6e'),_0xa093('0x6f'),_0xa093('0x70'),'emailaddress',_0xa093('0x71'),_0xa093('0x72'),'entityimage_url','escalatedon',_0xa093('0x73'),'firstresponsebykpiidname',_0xa093('0x74'),_0xa093('0x75'),'influencescore',_0xa093('0x76'),'lastonholdtime','masteridname','modifiedbyexternalpartyname',_0xa093('0x77'),_0xa093('0x78'),_0xa093('0x79'),_0xa093('0x7a'),_0xa093('0x7b'),_0xa093('0x7c'),'msdyn_incidenttypename',_0xa093('0x7d'),_0xa093('0x7e'),_0xa093('0x7f'),'overriddencreatedon',_0xa093('0x80'),_0xa093('0x81'),_0xa093('0x82'),'parentcaseidname',_0xa093('0x83'),_0xa093('0x84'),_0xa093('0x85'),_0xa093('0x86'),_0xa093('0x87'),_0xa093('0x88'),_0xa093('0x89'),_0xa093('0x8a'),_0xa093('0x8b'),_0xa093('0x8c'),_0xa093('0x8d'),_0xa093('0x8e'),_0xa093('0x8f'),_0xa093('0x90'),_0xa093('0x91'),_0xa093('0x92'),'subjectidname','ticketnumber',_0xa093('0x93'),_0xa093('0x94'),'traversedpath',_0xa093('0x95'),'versionnumber'];var _0x5b384b=_0x42d158[_0xa093('0x96')](_0x6d0d5e);return db[_0xa093('0x30')]['findOne']({'where':{'id':_0x4bacb1['params']['id']},'attributes':['id',_0xa093('0x97'),_0xa093('0x98'),_0xa093('0x99'),_0xa093('0x9a'),'clientId',_0xa093('0x9b')]})[_0xa093('0x27')](handleEntityNotFound(_0x34011c,null))[_0xa093('0x27')](function(_0x1d98bb){if(_0x1d98bb){_0x3a4109=_0x1d98bb[_0xa093('0x99')];var _0xf33eaa=_0x3a4109[_0xa093('0x9c')](-0x1);if(_0xf33eaa==='/'){_0x3a4109=_0x3a4109[_0xa093('0x9d')](0x0,_0x3a4109['lastIndexOf'](_0xf33eaa));}_0x1edf16=util['format'](_0xa093('0x9e'),_0x3a4109);var _0x17fcc2={'method':_0xa093('0x9f'),'uri':_0xa093('0xa0')+_0x1d98bb[_0xa093('0x9a')]+_0xa093('0xa1'),'form':{'client_id':_0x1d98bb[_0xa093('0xa2')],'resource':_0x3a4109,'username':_0x1d98bb[_0xa093('0x97')],'password':_0x1d98bb[_0xa093('0x98')],'grant_type':_0xa093('0x98'),'client_secret':_0x1d98bb[_0xa093('0x9b')]},'json':!![]};return rp(_0x17fcc2);}})[_0xa093('0x27')](function(_0x3bea5b){_0x193e01=_0x3bea5b[_0xa093('0xa3')];var _0x3f278e={'method':_0xa093('0xa4'),'uri':encodeURI(_0x1edf16+_0xa093('0xa5')+_0x4adfe0+'\x27'),'headers':{'Authorization':_0xa093('0xa6')+_0x193e01,'If-None-Match':null,'OData-Version':_0xa093('0xa7')},'json':!![]};return rp(_0x3f278e);})['then'](function(_0x295280){var _0x36ef2b=_0x295280[_0xa093('0xa8')][0x0];var _0x34b4d6=_0x36ef2b[_0xa093('0xa9')];var _0x369999={'method':_0xa093('0xa4'),'uri':_0x1edf16+_0xa093('0xaa')+_0x34b4d6+_0xa093('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x193e01,'If-None-Match':null,'OData-Version':_0xa093('0xa7')},'json':!![]};return rp(_0x369999);})[_0xa093('0x27')](function(_0x25758e){_0x41d85c=_0x25758e;_0xa281b7=_0x41d85c[_0xa093('0xac')];_0xa281b7=_[_0xa093('0xad')](_0xa281b7,function(_0x2a5141){return!_0x5b384b[_0xa093('0xae')](_0x2a5141[_0xa093('0xaf')]);});var _0x51f94d=[];var _0x3fef03=[];_0xa281b7[_0xa093('0xb0')](function(_0x307cbd){if(_0x307cbd[_0xa093('0xb1')]){var _0x14de6e=_0x307cbd[_0xa093('0xb1')][_0xa093('0x9d')](_0x307cbd[_0xa093('0xb1')][_0xa093('0xb2')]('.')+0x1);if(_0x14de6e===_0xa093('0xb3')){_0x51f94d[_0xa093('0xb4')](getSelectList(_0x1edf16,_0x442e07,_0x3fef03,_0x41d85c[_0xa093('0xa9')],_0x307cbd[_0xa093('0xa9')],_0x193e01));}}});return Promise[_0xa093('0xb5')](_0x51f94d);})[_0xa093('0x27')](function(_0xa54597){_0x1d39b2=_0xa54597[0x0];var _0x2412ff=[];var _0x40121b=[];_0xa281b7[_0xa093('0xb0')](function(_0x54a4e0){if(!_[_0xa093('0xb6')](_0x54a4e0[_0xa093('0xb1')])){var _0x5d7916=_0x54a4e0[_0xa093('0xb1')][_0xa093('0x9d')](_0x54a4e0['@odata.type'][_0xa093('0xb2')]('.')+0x1);if(_0x5d7916===_0xa093('0xb7')){_0x2412ff[_0xa093('0xb4')](getBooleanList(_0x1edf16,_0x442e07,_0x40121b,_0x41d85c[_0xa093('0xa9')],_0x54a4e0[_0xa093('0xa9')],_0x193e01));}}});return Promise[_0xa093('0xb5')](_0x2412ff);})[_0xa093('0x27')](function(_0x1da772){_0xc263fe=_0x1da772[0x0];var _0x2af1ec=[];var _0x4b935c=[];_0xa281b7[_0xa093('0xb0')](function(_0x53704c){if(_0x53704c[_0xa093('0xb1')]){var _0x3cd99f=_0x53704c['@odata.type'][_0xa093('0x9d')](_0x53704c[_0xa093('0xb1')]['lastIndexOf']('.')+0x1);if(_0x3cd99f==='StringAttributeMetadata'||_0x3cd99f===_0xa093('0xb8')||_0x3cd99f==='BigIntAttributeMetadata'||_0x3cd99f==='IntegerAttributeMetadata'||_0x3cd99f==='MemoAttributeMetadata'||_0x3cd99f===_0xa093('0xb9')||_0x3cd99f===_0xa093('0xba')||_0x3cd99f==='EntityNameAttributeMetadata'||_0x3cd99f===_0xa093('0xbb')||_0x3cd99f==='DecimalAttributeMetadata'){_0x2af1ec['push'](getInputList(_0x1edf16,_0x442e07,_0x3cd99f,_0x4b935c,_0x41d85c[_0xa093('0xa9')],_0x53704c['MetadataId'],_0x193e01));}}});return Promise[_0xa093('0xb5')](_0x2af1ec);})[_0xa093('0x27')](function(_0x4da257){_0x4e416e=_0x4da257[0x0];var _0x102802=_0x1d39b2[_0xa093('0x96')](_0xc263fe)[_0xa093('0x96')](_0x4e416e);var _0x22105e={'count':_0x102802[_0xa093('0x39')],'rows':_0x102802};return _0x22105e;})['then'](respondWithResult(_0x34011c,null))[_0xa093('0x45')](function(_0x3b8992){var _0x22bcbe=_0x4bacb1[_0xa093('0x33')]['test']?0x1f4:_0x3b8992[_0xa093('0xbc')]||0x1f4;logger[_0xa093('0x2a')](_0x3b8992[_0xa093('0x2b')]);delete _0x3b8992[_0xa093('0x2c')];if(_0x22bcbe===0x191){_0x22bcbe=0x190;}_0x34011c[_0xa093('0x1d')](_0x22bcbe)['send'](_0x4bacb1['query'][_0xa093('0xbd')]?{'message':_0xa093('0xbe'),'statusCode':_0x3b8992[_0xa093('0xbc')]}:_0x3b8992);});};function getSelectList(_0x592b12,_0x4141df,_0x1e4624,_0x541b47,_0x429217,_0x360aea){var _0x57d1eb={'method':_0xa093('0xa4'),'uri':_0x592b12+_0xa093('0xaa')+_0x541b47+_0xa093('0xbf')+_0x429217+_0xa093('0xc0')+_0xa093('0xc1'),'headers':{'Authorization':_0xa093('0xa6')+_0x360aea,'If-None-Match':null,'OData-Version':_0xa093('0xa7')},'json':!![]};return rp(_0x57d1eb)[_0xa093('0x27')](function(_0x59bf25){var _0x17c5f6=[];var _0x271d92=_0x59bf25['OptionSet']['Options'];_0x271d92['forEach'](function(_0x1f02eb){_0x17c5f6[_0xa093('0xb4')]({'name':_0x1f02eb['Label'][_0xa093('0xc2')][_0xa093('0xc3')],'value':String(_0x1f02eb[_0xa093('0xc4')])});});var _0x2a78ad={'id':_0x4141df+'_'+_0x59bf25[_0xa093('0xaf')],'name':_0x59bf25[_0xa093('0xc5')][_0xa093('0xc2')][_0xa093('0xc3')],'custom':![],'options':_0x17c5f6};_0x1e4624['push'](_0x2a78ad);return _0x1e4624;});}function getBooleanList(_0x579a11,_0x5e1650,_0x5e69c1,_0x16cf48,_0x19d9a1,_0x433e39){var _0x47644f={'method':'GET','uri':_0x579a11+_0xa093('0xaa')+_0x16cf48+_0xa093('0xbf')+_0x19d9a1+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xa093('0xa6')+_0x433e39,'If-None-Match':null,'OData-Version':_0xa093('0xa7')},'json':!![]};return rp(_0x47644f)[_0xa093('0x27')](function(_0x951e8f){var _0xc522c5=[];_0xc522c5['push']({'name':_0x951e8f[_0xa093('0xc6')]['TrueOption'][_0xa093('0xc3')]['UserLocalizedLabel'][_0xa093('0xc3')],'value':_0xa093('0xc7')},{'name':_0x951e8f['OptionSet'][_0xa093('0xc8')][_0xa093('0xc3')][_0xa093('0xc2')][_0xa093('0xc3')],'value':_0xa093('0xc9')});var _0x1566a1={'id':_0x5e1650+'_'+_0x951e8f[_0xa093('0xaf')],'name':_0x951e8f[_0xa093('0xc5')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0xc522c5};_0x5e69c1[_0xa093('0xb4')](_0x1566a1);return _0x5e69c1;});}function getInputList(_0x134d39,_0x3e8ddd,_0x1d2552,_0x1d6994,_0x3e5ffd,_0x389069,_0x555ba1){var _0x5bc1c4={'method':_0xa093('0xa4'),'uri':_0x134d39+_0xa093('0xaa')+_0x3e5ffd+_0xa093('0xbf')+_0x389069+_0xa093('0xca')+_0x1d2552+_0xa093('0xcb'),'headers':{'Authorization':_0xa093('0xa6')+_0x555ba1,'If-None-Match':null,'OData-Version':_0xa093('0xa7')},'json':!![]};return rp(_0x5bc1c4)['then'](function(_0x483323){var _0x4c3366={'id':_0x3e8ddd+'_'+_0x483323['LogicalName'],'name':_0x483323[_0xa093('0xc5')][_0xa093('0xc2')]?_0x483323[_0xa093('0xc5')][_0xa093('0xc2')][_0xa093('0xc3')]:_0x483323[_0xa093('0xaf')],'custom':![],'options':[]};_0x1d6994[_0xa093('0xb4')](_0x4c3366);return _0x1d6994;});} \ No newline at end of file +var _0xb790=[')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','substring','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','rimraf','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','then','error','stack','name','send','index','Dynamics365Account','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','keys','options','catch','create','body','find','params','findOne','Dynamics365Configuration','order','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','getFields','PhoneCall','title','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','socialprofileidname','statecode','statuscode','subjectidname','transactioncurrencyidname','versionnumber','concat','username','password','clientId','slice','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId'];(function(_0x3c1328,_0x237895){var _0x3a0544=function(_0x5bf43c){while(--_0x5bf43c){_0x3c1328['push'](_0x3c1328['shift']());}};_0x3a0544(++_0x237895);}(_0xb790,0xe5));var _0x0b79=function(_0x475bf1,_0x5235b6){_0x475bf1=_0x475bf1-0x0;var _0x4095d1=_0xb790[_0x475bf1];return _0x4095d1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0b79('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0b79('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0b79('0x2'));var path=require(_0x0b79('0x3'));var sox=require('sox');var csv=require(_0x0b79('0x4'));var ejs=require(_0x0b79('0x5'));var fs=require('fs');var fs_extra=require(_0x0b79('0x6'));var _=require(_0x0b79('0x7'));var squel=require(_0x0b79('0x8'));var crypto=require(_0x0b79('0x9'));var jsforce=require(_0x0b79('0xa'));var deskjs=require(_0x0b79('0xb'));var toCsv=require(_0x0b79('0x4'));var querystring=require(_0x0b79('0xc'));var Papa=require(_0x0b79('0xd'));var Redis=require(_0x0b79('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b79('0xf'));var hardwareService=require(_0x0b79('0x10'));var logger=require(_0x0b79('0x11'))(_0x0b79('0x12'));var utils=require(_0x0b79('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0b79('0x14'));var db=require(_0x0b79('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x44c94c,_0x1c0a61){_0x1c0a61=_0x1c0a61||0xcc;return function(_0x439e12){if(_0x439e12){return _0x44c94c[_0x0b79('0x16')](_0x1c0a61);}return _0x44c94c['status'](_0x1c0a61)[_0x0b79('0x17')]();};}function respondWithResult(_0x4681e4,_0x162522){_0x162522=_0x162522||0xc8;return function(_0x39551a){if(_0x39551a){return _0x4681e4['status'](_0x162522)[_0x0b79('0x18')](_0x39551a);}};}function respondWithFilteredResult(_0x44f4f7,_0x5bf09b){return function(_0x1820fa){if(_0x1820fa){var _0x23d5c3=typeof _0x5bf09b[_0x0b79('0x19')]===_0x0b79('0x1a')&&typeof _0x5bf09b[_0x0b79('0x1b')]===_0x0b79('0x1a');var _0x4f4754=_0x1820fa[_0x0b79('0x1c')];var _0x55bc36=_0x23d5c3?0x0:_0x5bf09b['offset'];var _0x4e7614=_0x23d5c3?_0x1820fa[_0x0b79('0x1c')]:_0x5bf09b[_0x0b79('0x19')]+_0x5bf09b[_0x0b79('0x1b')];var _0x5579dd;if(_0x4e7614>=_0x4f4754){_0x4e7614=_0x4f4754;_0x5579dd=0xc8;}else{_0x5579dd=0xce;}_0x44f4f7[_0x0b79('0x1d')](_0x5579dd);return _0x44f4f7['set'](_0x0b79('0x1e'),_0x55bc36+'-'+_0x4e7614+'/'+_0x4f4754)[_0x0b79('0x18')](_0x1820fa);}return null;};}function patchUpdates(_0x8482ad){return function(_0x5b630c){try{jsonpatch[_0x0b79('0x1f')](_0x5b630c,_0x8482ad,!![]);}catch(_0x330027){return BPromise[_0x0b79('0x20')](_0x330027);}return _0x5b630c['save']();};}function saveUpdates(_0xa836a8,_0x58901a){return function(_0x5bd229){if(_0x5bd229){return _0x5bd229[_0x0b79('0x21')](_0xa836a8)['then'](function(_0x80fbe9){return _0x80fbe9;});}return null;};}function removeEntity(_0x235a7f,_0x3a04d3){return function(_0x136734){if(_0x136734){return _0x136734['destroy']()[_0x0b79('0x22')](function(){_0x235a7f[_0x0b79('0x1d')](0xcc)[_0x0b79('0x17')]();});}};}function handleEntityNotFound(_0x553ed1,_0x143ca2){return function(_0x316866){if(!_0x316866){_0x553ed1[_0x0b79('0x16')](0x194);}return _0x316866;};}function handleError(_0x4a2f93,_0x39b034){_0x39b034=_0x39b034||0x1f4;return function(_0x18a2ea){logger[_0x0b79('0x23')](_0x18a2ea[_0x0b79('0x24')]);if(_0x18a2ea[_0x0b79('0x25')]){delete _0x18a2ea['name'];}_0x4a2f93[_0x0b79('0x1d')](_0x39b034)[_0x0b79('0x26')](_0x18a2ea);};}exports[_0x0b79('0x27')]=function(_0x365ea4,_0x48756d){var _0x47cdf2={},_0x10f10c={},_0x5595fd={'count':0x0,'rows':[]};var _0x2f0639=_['map'](db[_0x0b79('0x28')][_0x0b79('0x29')],function(_0x19971a){return{'name':_0x19971a['fieldName'],'type':_0x19971a[_0x0b79('0x2a')]['key']};});_0x10f10c[_0x0b79('0x2b')]=_[_0x0b79('0x2c')](_0x2f0639,_0x0b79('0x25'));_0x10f10c['query']=_['keys'](_0x365ea4[_0x0b79('0x2d')]);_0x10f10c[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],_0x10f10c[_0x0b79('0x2d')]);_0x47cdf2[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x10f10c[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x47cdf2[_0x0b79('0x30')]=_0x47cdf2[_0x0b79('0x30')][_0x0b79('0x32')]?_0x47cdf2[_0x0b79('0x30')]:_0x10f10c[_0x0b79('0x2b')];if(!_0x365ea4['query']['hasOwnProperty'](_0x0b79('0x33'))){_0x47cdf2[_0x0b79('0x1b')]=qs[_0x0b79('0x1b')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x47cdf2[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x19')]);}_0x47cdf2['order']=qs[_0x0b79('0x34')](_0x365ea4[_0x0b79('0x2d')]['sort']);_0x47cdf2[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x365ea4[_0x0b79('0x2d')],_0x10f10c[_0x0b79('0x2e')]),_0x2f0639);if(_0x365ea4[_0x0b79('0x2d')]['filter']){_0x47cdf2[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x47cdf2[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x2f0639,function(_0x221ce3){if(_0x221ce3['type']!==_0x0b79('0x38')){var _0x5b8d0b={};_0x5b8d0b[_0x221ce3[_0x0b79('0x25')]]={'$like':'%'+_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x5b8d0b;}})});}_0x47cdf2=_['merge']({},_0x47cdf2,_0x365ea4['options']);var _0x564884={'where':_0x47cdf2[_0x0b79('0x35')]};return db['Dynamics365Account'][_0x0b79('0x1c')](_0x564884)[_0x0b79('0x22')](function(_0x293a33){_0x5595fd[_0x0b79('0x1c')]=_0x293a33;if(_0x365ea4[_0x0b79('0x2d')][_0x0b79('0x3a')]){_0x47cdf2[_0x0b79('0x3b')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x0b79('0x3c')](_0x47cdf2);})[_0x0b79('0x22')](function(_0x6f2200){_0x5595fd[_0x0b79('0x3d')]=_0x6f2200;return _0x5595fd;})[_0x0b79('0x22')](respondWithFilteredResult(_0x48756d,_0x47cdf2))['catch'](handleError(_0x48756d,null));};exports[_0x0b79('0x3e')]=function(_0x2b9f9f,_0x47f9e8){var _0x1a8e38={'raw':![],'where':{'id':_0x2b9f9f['params']['id']}},_0xb74c93={};_0xb74c93['model']=_[_0x0b79('0x3f')](db[_0x0b79('0x28')][_0x0b79('0x29')]);_0xb74c93[_0x0b79('0x2d')]=_['keys'](_0x2b9f9f[_0x0b79('0x2d')]);_0xb74c93[_0x0b79('0x2e')]=_[_0x0b79('0x2f')](_0xb74c93['model'],_0xb74c93[_0x0b79('0x2d')]);_0x1a8e38[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0xb74c93[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x2b9f9f[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x1a8e38[_0x0b79('0x30')]=_0x1a8e38[_0x0b79('0x30')][_0x0b79('0x32')]?_0x1a8e38[_0x0b79('0x30')]:_0xb74c93['model'];if(_0x2b9f9f['query'][_0x0b79('0x3a')]){_0x1a8e38[_0x0b79('0x3b')]=[{'all':!![]}];}_0x1a8e38=_[_0x0b79('0x37')]({},_0x1a8e38,_0x2b9f9f[_0x0b79('0x40')]);return db[_0x0b79('0x28')]['find'](_0x1a8e38)[_0x0b79('0x22')](handleEntityNotFound(_0x47f9e8,null))['then'](respondWithResult(_0x47f9e8,null))[_0x0b79('0x41')](handleError(_0x47f9e8,null));};exports[_0x0b79('0x42')]=function(_0x358bce,_0x25f719){return db[_0x0b79('0x28')][_0x0b79('0x42')](_0x358bce[_0x0b79('0x43')],{})[_0x0b79('0x22')](respondWithResult(_0x25f719,0xc9))[_0x0b79('0x41')](handleError(_0x25f719,null));};exports[_0x0b79('0x21')]=function(_0x362aa4,_0x21dc25){if(_0x362aa4[_0x0b79('0x43')]['id']){delete _0x362aa4[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x362aa4['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x21dc25,null))['then'](saveUpdates(_0x362aa4[_0x0b79('0x43')],null))[_0x0b79('0x22')](respondWithResult(_0x21dc25,null))[_0x0b79('0x41')](handleError(_0x21dc25,null));};exports['destroy']=function(_0x4172b9,_0x1862c4){return db[_0x0b79('0x28')][_0x0b79('0x44')]({'where':{'id':_0x4172b9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x1862c4,null))[_0x0b79('0x22')](removeEntity(_0x1862c4,null))[_0x0b79('0x41')](handleError(_0x1862c4,null));};exports['getConfigurations']=function(_0x1a6f6a,_0x472051,_0x17d0db){var _0x278d42={};var _0x7b9f57={};var _0x46eb9e;var _0x2309be;return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x1a6f6a['params']['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x472051,null))['then'](function(_0x1616fa){if(_0x1616fa){_0x46eb9e=_0x1616fa;_0x7b9f57[_0x0b79('0x2b')]=_['keys'](db[_0x0b79('0x47')][_0x0b79('0x29')]);_0x7b9f57[_0x0b79('0x2d')]=_[_0x0b79('0x3f')](_0x1a6f6a[_0x0b79('0x2d')]);_0x7b9f57[_0x0b79('0x2e')]=_['intersection'](_0x7b9f57['model'],_0x7b9f57[_0x0b79('0x2d')]);_0x278d42[_0x0b79('0x30')]=_[_0x0b79('0x2f')](_0x7b9f57[_0x0b79('0x2b')],qs[_0x0b79('0x31')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x31')]));_0x278d42[_0x0b79('0x30')]=_0x278d42[_0x0b79('0x30')][_0x0b79('0x32')]?_0x278d42['attributes']:_0x7b9f57[_0x0b79('0x2b')];_0x278d42[_0x0b79('0x48')]=qs[_0x0b79('0x34')](_0x1a6f6a[_0x0b79('0x2d')]['sort']);_0x278d42[_0x0b79('0x35')]=qs[_0x0b79('0x2e')](_[_0x0b79('0x36')](_0x1a6f6a[_0x0b79('0x2d')],_0x7b9f57[_0x0b79('0x2e')]));if(_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]){_0x278d42[_0x0b79('0x35')]=_[_0x0b79('0x37')](_0x278d42[_0x0b79('0x35')],{'$or':_[_0x0b79('0x2c')](_0x278d42[_0x0b79('0x30')],function(_0x2abb67){var _0x4416af={};_0x4416af[_0x2abb67]={'$like':'%'+_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x39')]+'%'};return _0x4416af;})});}_0x278d42=_['merge']({},_0x278d42,_0x1a6f6a['options']);return _0x46eb9e['getConfigurations'](_0x278d42);}})[_0x0b79('0x22')](function(_0xdf3b19){if(_0xdf3b19){_0x2309be=_0xdf3b19['length'];if(!_0x1a6f6a[_0x0b79('0x2d')]['hasOwnProperty']('nolimit')){_0x278d42[_0x0b79('0x1b')]=qs['limit'](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x1b')]);_0x278d42[_0x0b79('0x19')]=qs[_0x0b79('0x19')](_0x1a6f6a[_0x0b79('0x2d')][_0x0b79('0x19')]);}return _0x46eb9e['getConfigurations'](_0x278d42);}})['then'](function(_0x32aee1){if(_0x32aee1){return _0x32aee1?{'count':_0x2309be,'rows':_0x32aee1}:null;}})[_0x0b79('0x22')](respondWithResult(_0x472051,null))['catch'](handleError(_0x472051,null));};exports['addConfiguration']=function(_0x52acb9,_0x92fa34,_0x4922b1){if(_0x52acb9[_0x0b79('0x43')]['id']){delete _0x52acb9[_0x0b79('0x43')]['id'];}return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x52acb9[_0x0b79('0x45')]['id']}})[_0x0b79('0x22')](handleEntityNotFound(_0x92fa34,null))[_0x0b79('0x22')](function(_0x8ecdc9){if(_0x8ecdc9){_0x52acb9['body'][_0x0b79('0x49')]=_0x8ecdc9['id'];_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4a')]=integrations[_0x0b79('0x4b')](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9['body']['type']);_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4d')]=integrations['getDescriptions'](_0x52acb9[_0x0b79('0x43')][_0x0b79('0x4c')],_0x52acb9[_0x0b79('0x43')][_0x0b79('0x2a')]);return db[_0x0b79('0x47')][_0x0b79('0x42')](_0x52acb9[_0x0b79('0x43')],{'include':[{'model':db[_0x0b79('0x4e')],'as':_0x0b79('0x4a')},{'model':db[_0x0b79('0x4e')],'as':'Descriptions'}]});}return null;})[_0x0b79('0x22')](respondWithResult(_0x92fa34,null))[_0x0b79('0x41')](handleError(_0x92fa34,null));};exports[_0x0b79('0x4f')]=function(_0x21ee3b,_0x30c29c,_0x4d4bb3){var _0x1e8278=_0x21ee3b[_0x0b79('0x2d')]['ticketType'];var _0x4e7c7b=_0x1e8278==='incident'?'Incident':_0x0b79('0x50');var _0x26fc79='';var _0x5c8a1d='';var _0x3c15f4='';var _0x4e5ef4='';var _0x3a69fb='';var _0x253f93='';var _0x1d3cd7='';var _0xa5920f='';var _0x2e216d=[_0x0b79('0x51'),'description',_0x0b79('0x52'),_0x0b79('0x53'),_0x0b79('0x54'),'subject',_0x0b79('0x55'),_0x0b79('0x56'),_0x0b79('0x57'),_0x0b79('0x58')];var _0x570b45=[_0x0b79('0x59'),_0x0b79('0x5a'),'actualserviceunits',_0x0b79('0x5b'),_0x0b79('0x5c'),_0x0b79('0x5d'),_0x0b79('0x5e'),_0x0b79('0x5f'),_0x0b79('0x60'),'createdbyexternalpartyyominame','createdbyname',_0x0b79('0x61'),_0x0b79('0x62'),_0x0b79('0x63'),_0x0b79('0x64'),_0x0b79('0x65'),_0x0b79('0x66'),_0x0b79('0x67'),_0x0b79('0x68'),_0x0b79('0x69'),_0x0b79('0x6a'),_0x0b79('0x6b'),_0x0b79('0x6c'),_0x0b79('0x6d'),'firstresponsebykpiidname',_0x0b79('0x6e'),'importsequencenumber','influencescore',_0x0b79('0x6f'),_0x0b79('0x70'),'masteridname',_0x0b79('0x71'),_0x0b79('0x72'),'modifiedbyname',_0x0b79('0x73'),_0x0b79('0x74'),'modifiedonbehalfbyname',_0x0b79('0x75'),_0x0b79('0x76'),_0x0b79('0x77'),_0x0b79('0x78'),'onholdtime',_0x0b79('0x79'),_0x0b79('0x7a'),_0x0b79('0x7b'),'owneridyominame',_0x0b79('0x7c'),_0x0b79('0x7d'),_0x0b79('0x7e'),_0x0b79('0x7f'),_0x0b79('0x80'),_0x0b79('0x81'),_0x0b79('0x82'),_0x0b79('0x83'),_0x0b79('0x84'),_0x0b79('0x85'),_0x0b79('0x86'),_0x0b79('0x87'),'slainvokedidname','slaname',_0x0b79('0x88'),_0x0b79('0x89'),_0x0b79('0x8a'),_0x0b79('0x8b'),'ticketnumber','timezoneruleversionnumber',_0x0b79('0x8c'),'traversedpath','utcconversiontimezonecode',_0x0b79('0x8d')];var _0x4bf810=_0x2e216d[_0x0b79('0x8e')](_0x570b45);return db[_0x0b79('0x28')][_0x0b79('0x46')]({'where':{'id':_0x21ee3b[_0x0b79('0x45')]['id']},'attributes':['id',_0x0b79('0x8f'),_0x0b79('0x90'),'remoteUri','tenantId',_0x0b79('0x91'),'clientSecret']})[_0x0b79('0x22')](handleEntityNotFound(_0x30c29c,null))[_0x0b79('0x22')](function(_0x411a9f){if(_0x411a9f){_0xa5920f=_0x411a9f['remoteUri'];var _0x2662d2=_0xa5920f[_0x0b79('0x92')](-0x1);if(_0x2662d2==='/'){_0xa5920f=_0xa5920f['substring'](0x0,_0xa5920f[_0x0b79('0x93')](_0x2662d2));}_0x1d3cd7=util['format'](_0x0b79('0x94'),_0xa5920f);var _0x46b7a7={'method':_0x0b79('0x95'),'uri':_0x0b79('0x96')+_0x411a9f[_0x0b79('0x97')]+_0x0b79('0x98'),'form':{'client_id':_0x411a9f[_0x0b79('0x91')],'resource':_0xa5920f,'username':_0x411a9f[_0x0b79('0x8f')],'password':_0x411a9f['password'],'grant_type':_0x0b79('0x90'),'client_secret':_0x411a9f[_0x0b79('0x99')]},'json':!![]};return rp(_0x46b7a7);}})[_0x0b79('0x22')](function(_0x131c38){_0x253f93=_0x131c38['access_token'];var _0x3f360e={'method':_0x0b79('0x9a'),'uri':encodeURI(_0x1d3cd7+_0x0b79('0x9b')+_0x4e7c7b+'\x27'),'headers':{'Authorization':_0x0b79('0x9c')+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3f360e);})[_0x0b79('0x22')](function(_0x1261a2){var _0x530def=_0x1261a2['value'][0x0];var _0x4c5956=_0x530def[_0x0b79('0x9e')];var _0x39b1a2={'method':'GET','uri':_0x1d3cd7+'EntityDefinitions('+_0x4c5956+_0x0b79('0x9f'),'headers':{'Authorization':'Bearer\x20'+_0x253f93,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x39b1a2);})[_0x0b79('0x22')](function(_0x59a5bc){_0x26fc79=_0x59a5bc;_0x5c8a1d=_0x26fc79[_0x0b79('0xa0')];_0x5c8a1d=_['remove'](_0x5c8a1d,function(_0x12b003){return!_0x4bf810[_0x0b79('0xa1')](_0x12b003[_0x0b79('0xa2')]);});var _0x427131=[];var _0x19da21=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x42e594){if(_0x42e594[_0x0b79('0xa4')]){var _0x21225a=_0x42e594[_0x0b79('0xa4')][_0x0b79('0xa5')](_0x42e594[_0x0b79('0xa4')]['lastIndexOf']('.')+0x1);if(_0x21225a==='PicklistAttributeMetadata'){_0x427131[_0x0b79('0xa6')](getSelectList(_0x1d3cd7,_0x1e8278,_0x19da21,_0x26fc79[_0x0b79('0x9e')],_0x42e594[_0x0b79('0x9e')],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x427131);})['then'](function(_0x5a58eb){_0x3c15f4=_0x5a58eb[0x0];var _0x901f06=[];var _0x559f13=[];_0x5c8a1d['forEach'](function(_0x1ccf84){if(!_[_0x0b79('0xa8')](_0x1ccf84[_0x0b79('0xa4')])){var _0x502b33=_0x1ccf84['@odata.type'][_0x0b79('0xa5')](_0x1ccf84['@odata.type'][_0x0b79('0x93')]('.')+0x1);if(_0x502b33===_0x0b79('0xa9')){_0x901f06[_0x0b79('0xa6')](getBooleanList(_0x1d3cd7,_0x1e8278,_0x559f13,_0x26fc79[_0x0b79('0x9e')],_0x1ccf84[_0x0b79('0x9e')],_0x253f93));}}});return Promise['all'](_0x901f06);})[_0x0b79('0x22')](function(_0x347724){_0x4e5ef4=_0x347724[0x0];var _0x452ac=[];var _0x4bbdf9=[];_0x5c8a1d[_0x0b79('0xa3')](function(_0x129fce){if(_0x129fce[_0x0b79('0xa4')]){var _0x54a8e5=_0x129fce['@odata.type']['substring'](_0x129fce[_0x0b79('0xa4')][_0x0b79('0x93')]('.')+0x1);if(_0x54a8e5===_0x0b79('0xaa')||_0x54a8e5==='DoubleAttributeMetadata'||_0x54a8e5==='BigIntAttributeMetadata'||_0x54a8e5===_0x0b79('0xab')||_0x54a8e5==='MemoAttributeMetadata'||_0x54a8e5===_0x0b79('0xac')||_0x54a8e5===_0x0b79('0xad')||_0x54a8e5===_0x0b79('0xae')||_0x54a8e5==='StateAttributeMetadata'||_0x54a8e5===_0x0b79('0xaf')){_0x452ac['push'](getInputList(_0x1d3cd7,_0x1e8278,_0x54a8e5,_0x4bbdf9,_0x26fc79['MetadataId'],_0x129fce['MetadataId'],_0x253f93));}}});return Promise[_0x0b79('0xa7')](_0x452ac);})[_0x0b79('0x22')](function(_0x5234be){_0x3a69fb=_0x5234be[0x0];var _0x57cb37=_0x3c15f4[_0x0b79('0x8e')](_0x4e5ef4)[_0x0b79('0x8e')](_0x3a69fb);var _0x45ff53={'count':_0x57cb37['length'],'rows':_0x57cb37};return _0x45ff53;})[_0x0b79('0x22')](respondWithResult(_0x30c29c,null))['catch'](function(_0x1f56a6){var _0x131d18=_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?0x1f4:_0x1f56a6[_0x0b79('0xb1')]||0x1f4;logger[_0x0b79('0x23')](_0x1f56a6['stack']);delete _0x1f56a6[_0x0b79('0x25')];if(_0x131d18===0x191){_0x131d18=0x190;}_0x30c29c[_0x0b79('0x1d')](_0x131d18)[_0x0b79('0x26')](_0x21ee3b[_0x0b79('0x2d')][_0x0b79('0xb0')]?{'message':_0x0b79('0xb2'),'statusCode':_0x1f56a6[_0x0b79('0xb1')]}:_0x1f56a6);});};function getSelectList(_0x49414d,_0x2f157b,_0x1bad80,_0x5ed3b3,_0x3d3b5c,_0x309ab9){var _0x4ec192={'method':_0x0b79('0x9a'),'uri':_0x49414d+_0x0b79('0xb3')+_0x5ed3b3+_0x0b79('0xb4')+_0x3d3b5c+_0x0b79('0xb5')+_0x0b79('0xb6'),'headers':{'Authorization':_0x0b79('0x9c')+_0x309ab9,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x4ec192)[_0x0b79('0x22')](function(_0x1b294d){var _0x1d7f69=[];var _0x181ebf=_0x1b294d['OptionSet'][_0x0b79('0xb7')];_0x181ebf[_0x0b79('0xa3')](function(_0x2a50dc){_0x1d7f69['push']({'name':_0x2a50dc[_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':String(_0x2a50dc['Value'])});});var _0x38ddaa={'id':_0x2f157b+'_'+_0x1b294d[_0x0b79('0xa2')],'name':_0x1b294d[_0x0b79('0xba')]['UserLocalizedLabel'][_0x0b79('0xb8')],'custom':![],'options':_0x1d7f69};_0x1bad80[_0x0b79('0xa6')](_0x38ddaa);return _0x1bad80;});}function getBooleanList(_0x3e228c,_0x467bcf,_0x201d96,_0x19d668,_0x3b0107,_0x415f32){var _0x123c70={'method':_0x0b79('0x9a'),'uri':_0x3e228c+_0x0b79('0xb3')+_0x19d668+_0x0b79('0xb4')+_0x3b0107+_0x0b79('0xbb'),'headers':{'Authorization':_0x0b79('0x9c')+_0x415f32,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x123c70)['then'](function(_0xa34638){var _0x475264=[];_0x475264[_0x0b79('0xa6')]({'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbd')][_0x0b79('0xb8')][_0x0b79('0xb9')]['Label'],'value':_0x0b79('0xbe')},{'name':_0xa34638[_0x0b79('0xbc')][_0x0b79('0xbf')][_0x0b79('0xb8')][_0x0b79('0xb9')][_0x0b79('0xb8')],'value':_0x0b79('0xc0')});var _0x3a34c9={'id':_0x467bcf+'_'+_0xa34638[_0x0b79('0xa2')],'name':_0xa34638['DisplayName'][_0x0b79('0xb9')][_0x0b79('0xb8')],'custom':![],'options':_0x475264};_0x201d96[_0x0b79('0xa6')](_0x3a34c9);return _0x201d96;});}function getInputList(_0x2eebce,_0x449d0b,_0x523e8f,_0xa0dfef,_0x42e7e7,_0x30a3ba,_0x483e50){var _0x3b8b8d={'method':_0x0b79('0x9a'),'uri':_0x2eebce+_0x0b79('0xb3')+_0x42e7e7+_0x0b79('0xb4')+_0x30a3ba+_0x0b79('0xc1')+_0x523e8f+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x0b79('0x9c')+_0x483e50,'If-None-Match':null,'OData-Version':_0x0b79('0x9d')},'json':!![]};return rp(_0x3b8b8d)[_0x0b79('0x22')](function(_0xa4bbfa){var _0x31077c={'id':_0x449d0b+'_'+_0xa4bbfa[_0x0b79('0xa2')],'name':_0xa4bbfa[_0x0b79('0xba')][_0x0b79('0xb9')]?_0xa4bbfa['DisplayName'][_0x0b79('0xb9')]['Label']:_0xa4bbfa[_0x0b79('0xa2')],'custom':![],'options':[]};_0xa0dfef[_0x0b79('0xa6')](_0x31077c);return _0xa0dfef;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 225185c..9a1e0cf 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x5c20ab,_0x41cc57){var _0x2e7013=function(_0x43558d){while(--_0x43558d){_0x5c20ab['push'](_0x5c20ab['shift']());}};_0x2e7013(++_0x41cc57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x48e6c1,_0x2e0b0b){var _0x32df98=function(_0x2aa31b){while(--_0x2aa31b){_0x48e6c1['push'](_0x48e6c1['shift']());}};_0x32df98(++_0x2e0b0b);}(_0xe706,0xa3));var _0x6e70=function(_0x2ed4c9,_0x243771){_0x2ed4c9=_0x2ed4c9-0x0;var _0x237f0a=_0xe706[_0x2ed4c9];return _0x237f0a;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index f9b18f2..201f43e 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 _0xf94c=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetDynamics365Account','findAll','options','raw','attributes','limit','include','map','model','then','stringify','ShowDynamics365Account','Dynamics365Account','find','where','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x35687a,_0x4a07d3){var _0x37f8ef=function(_0x370bec){while(--_0x370bec){_0x35687a['push'](_0x35687a['shift']());}};_0x37f8ef(++_0x4a07d3);}(_0xf94c,0x1b6));var _0xcf94=function(_0x47dfd,_0x3a0993){_0x47dfd=_0x47dfd-0x0;var _0x3fd046=_0xf94c[_0x47dfd];return _0x3fd046;};'use strict';var _=require(_0xcf94('0x0'));var util=require(_0xcf94('0x1'));var moment=require(_0xcf94('0x2'));var BPromise=require(_0xcf94('0x3'));var rs=require(_0xcf94('0x4'));var fs=require('fs');var Redis=require(_0xcf94('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf94('0x6'));var logger=require('../../config/logger')(_0xcf94('0x7'));var config=require(_0xcf94('0x8'));var jayson=require(_0xcf94('0x9'));var client=jayson[_0xcf94('0xa')][_0xcf94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2db249,_0x6946e0,_0xbd8cca){return new BPromise(function(_0x272226,_0x566e01){return client[_0xcf94('0xc')](_0x2db249,_0xbd8cca)['then'](function(_0x13e708){logger[_0xcf94('0xd')](_0xcf94('0xe'),_0x6946e0,_0xcf94('0xf'));logger[_0xcf94('0x10')](_0xcf94('0x11'),_0x6946e0,'request\x20sent',JSON['stringify'](_0x13e708));if(_0x13e708[_0xcf94('0x12')]){if(_0x13e708['error'][_0xcf94('0x13')]===0x1f4){logger['error'](_0xcf94('0xe'),_0x6946e0,_0x13e708[_0xcf94('0x12')][_0xcf94('0x14')]);return _0x566e01(_0x13e708[_0xcf94('0x12')][_0xcf94('0x14')]);}logger[_0xcf94('0x12')](_0xcf94('0xe'),_0x6946e0,_0x13e708[_0xcf94('0x12')][_0xcf94('0x14')]);return _0x272226(_0x13e708['error']['message']);}else{logger[_0xcf94('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x6946e0,_0xcf94('0xf'));_0x272226(_0x13e708['result']['message']);}})[_0xcf94('0x15')](function(_0x39d099){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x6946e0,_0x39d099);_0x566e01(_0x39d099);});});}exports[_0xcf94('0x16')]=function(_0x3b6f89){var _0x21bad4=this;return new Promise(function(_0x5778c1,_0x5172a4){return db['Dynamics365Account'][_0xcf94('0x17')]({'raw':_0x3b6f89[_0xcf94('0x18')]?_0x3b6f89[_0xcf94('0x18')][_0xcf94('0x19')]===undefined?!![]:![]:!![],'where':_0x3b6f89['options']?_0x3b6f89[_0xcf94('0x18')]['where']||null:null,'attributes':_0x3b6f89[_0xcf94('0x18')]?_0x3b6f89[_0xcf94('0x18')][_0xcf94('0x1a')]||null:null,'limit':_0x3b6f89[_0xcf94('0x18')]?_0x3b6f89[_0xcf94('0x18')][_0xcf94('0x1b')]||null:null,'include':_0x3b6f89['options']?_0x3b6f89[_0xcf94('0x18')][_0xcf94('0x1c')]?_[_0xcf94('0x1d')](_0x3b6f89[_0xcf94('0x18')][_0xcf94('0x1c')],function(_0x5cf0f7){return{'model':db[_0x5cf0f7[_0xcf94('0x1e')]],'as':_0x5cf0f7['as'],'attributes':_0x5cf0f7[_0xcf94('0x1a')],'include':_0x5cf0f7[_0xcf94('0x1c')]?_[_0xcf94('0x1d')](_0x5cf0f7['include'],function(_0x50dea1){return{'model':db[_0x50dea1['model']],'as':_0x50dea1['as'],'attributes':_0x50dea1[_0xcf94('0x1a')],'include':_0x50dea1[_0xcf94('0x1c')]?_[_0xcf94('0x1d')](_0x50dea1[_0xcf94('0x1c')],function(_0x354316){return{'model':db[_0x354316[_0xcf94('0x1e')]],'as':_0x354316['as'],'attributes':_0x354316['attributes']};}):[]};}):[]};}):[]:[]})[_0xcf94('0x1f')](function(_0x1928ad){logger['info'](_0xcf94('0x16'),_0x3b6f89);logger[_0xcf94('0x10')](_0xcf94('0x16'),_0x3b6f89,JSON[_0xcf94('0x20')](_0x1928ad));_0x5778c1(_0x1928ad);})[_0xcf94('0x15')](function(_0x344cd6){logger[_0xcf94('0x12')](_0xcf94('0x16'),_0x344cd6[_0xcf94('0x14')],_0x3b6f89);_0x5172a4(_0x21bad4[_0xcf94('0x12')](0x1f4,_0x344cd6['message']));});});};exports[_0xcf94('0x21')]=function(_0x1157e7){var _0x599c20=this;return new Promise(function(_0x29a62d,_0x53f131){return db[_0xcf94('0x22')][_0xcf94('0x23')]({'raw':_0x1157e7['options']?_0x1157e7['options'][_0xcf94('0x19')]===undefined?!![]:![]:!![],'where':_0x1157e7['options']?_0x1157e7['options'][_0xcf94('0x24')]||null:null,'attributes':_0x1157e7[_0xcf94('0x18')]?_0x1157e7[_0xcf94('0x18')][_0xcf94('0x1a')]||null:null,'include':_0x1157e7['options']?_0x1157e7[_0xcf94('0x18')][_0xcf94('0x1c')]?_[_0xcf94('0x1d')](_0x1157e7[_0xcf94('0x18')]['include'],function(_0x5cb370){return{'model':db[_0x5cb370['model']],'as':_0x5cb370['as'],'attributes':_0x5cb370[_0xcf94('0x1a')],'include':_0x5cb370[_0xcf94('0x1c')]?_[_0xcf94('0x1d')](_0x5cb370['include'],function(_0xa6cec7){return{'model':db[_0xa6cec7[_0xcf94('0x1e')]],'as':_0xa6cec7['as'],'attributes':_0xa6cec7[_0xcf94('0x1a')],'include':_0xa6cec7[_0xcf94('0x1c')]?_[_0xcf94('0x1d')](_0xa6cec7['include'],function(_0x5b6aaa){return{'model':db[_0x5b6aaa['model']],'as':_0x5b6aaa['as'],'attributes':_0x5b6aaa[_0xcf94('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcf94('0x1f')](function(_0x5db943){logger[_0xcf94('0xd')](_0xcf94('0x21'),_0x1157e7);logger[_0xcf94('0x10')](_0xcf94('0x21'),_0x1157e7,JSON['stringify'](_0x5db943));_0x29a62d(_0x5db943);})[_0xcf94('0x15')](function(_0x4c72fa){logger[_0xcf94('0x12')]('ShowDynamics365Account',_0x4c72fa[_0xcf94('0x14')],_0x1157e7);_0x53f131(_0x599c20[_0xcf94('0x12')](0x1f4,_0x4c72fa[_0xcf94('0x14')]));});});}; \ No newline at end of file +var _0x9552=['jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','info','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','ShowDynamics365Account','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9552,0xa6));var _0x2955=function(_0x11945a,_0x527dbf){_0x11945a=_0x11945a-0x0;var _0x2bf2a2=_0x9552[_0x11945a];return _0x2bf2a2;};'use strict';var _=require(_0x2955('0x0'));var util=require(_0x2955('0x1'));var moment=require(_0x2955('0x2'));var BPromise=require(_0x2955('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2955('0x4'));var db=require(_0x2955('0x5'))['db'];var utils=require(_0x2955('0x6'));var logger=require(_0x2955('0x7'))('rpc');var config=require(_0x2955('0x8'));var jayson=require(_0x2955('0x9'));var client=jayson['client'][_0x2955('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x369606,_0x1fe420,_0x3c198d){return new BPromise(function(_0x515c98,_0x3313cd){return client[_0x2955('0xb')](_0x369606,_0x3c198d)[_0x2955('0xc')](function(_0x4309b4){logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x1fe420,_0x2955('0xd'));logger[_0x2955('0xe')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1fe420,_0x2955('0xd'),JSON[_0x2955('0xf')](_0x4309b4));if(_0x4309b4[_0x2955('0x10')]){if(_0x4309b4[_0x2955('0x10')][_0x2955('0x11')]===0x1f4){logger['error'](_0x2955('0x12'),_0x1fe420,_0x4309b4[_0x2955('0x10')]['message']);return _0x3313cd(_0x4309b4[_0x2955('0x10')][_0x2955('0x13')]);}logger['error'](_0x2955('0x12'),_0x1fe420,_0x4309b4['error'][_0x2955('0x13')]);return _0x515c98(_0x4309b4[_0x2955('0x10')][_0x2955('0x13')]);}else{logger[_0x2955('0x14')](_0x2955('0x12'),_0x1fe420,_0x2955('0xd'));_0x515c98(_0x4309b4[_0x2955('0x15')][_0x2955('0x13')]);}})[_0x2955('0x16')](function(_0x5a05aa){logger[_0x2955('0x10')](_0x2955('0x12'),_0x1fe420,_0x5a05aa);_0x3313cd(_0x5a05aa);});});}exports[_0x2955('0x17')]=function(_0x47597c){var _0x59ccf2=this;return new Promise(function(_0x41abe6,_0xc7f50){return db[_0x2955('0x18')][_0x2955('0x19')]({'raw':_0x47597c[_0x2955('0x1a')]?_0x47597c[_0x2955('0x1a')][_0x2955('0x1b')]===undefined?!![]:![]:!![],'where':_0x47597c[_0x2955('0x1a')]?_0x47597c['options'][_0x2955('0x1c')]||null:null,'attributes':_0x47597c[_0x2955('0x1a')]?_0x47597c['options']['attributes']||null:null,'limit':_0x47597c['options']?_0x47597c['options'][_0x2955('0x1d')]||null:null,'include':_0x47597c[_0x2955('0x1a')]?_0x47597c['options'][_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x47597c[_0x2955('0x1a')]['include'],function(_0x27da0a){return{'model':db[_0x27da0a[_0x2955('0x20')]],'as':_0x27da0a['as'],'attributes':_0x27da0a[_0x2955('0x21')],'include':_0x27da0a[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x27da0a[_0x2955('0x1e')],function(_0x3313ff){return{'model':db[_0x3313ff[_0x2955('0x20')]],'as':_0x3313ff['as'],'attributes':_0x3313ff[_0x2955('0x21')],'include':_0x3313ff[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x3313ff['include'],function(_0x57cf6a){return{'model':db[_0x57cf6a[_0x2955('0x20')]],'as':_0x57cf6a['as'],'attributes':_0x57cf6a[_0x2955('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2955('0xc')](function(_0x291291){logger[_0x2955('0x14')]('GetDynamics365Account',_0x47597c);logger[_0x2955('0xe')]('GetDynamics365Account',_0x47597c,JSON[_0x2955('0xf')](_0x291291));_0x41abe6(_0x291291);})['catch'](function(_0x5b6b28){logger[_0x2955('0x10')](_0x2955('0x17'),_0x5b6b28[_0x2955('0x13')],_0x47597c);_0xc7f50(_0x59ccf2[_0x2955('0x10')](0x1f4,_0x5b6b28[_0x2955('0x13')]));});});};exports[_0x2955('0x22')]=function(_0x40539f){var _0x52a2e3=this;return new Promise(function(_0x130184,_0x4989d2){return db[_0x2955('0x18')]['find']({'raw':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['where']||null:null,'attributes':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['attributes']||null:null,'include':_0x40539f[_0x2955('0x1a')]?_0x40539f[_0x2955('0x1a')]['include']?_[_0x2955('0x1f')](_0x40539f[_0x2955('0x1a')][_0x2955('0x1e')],function(_0x490e68){return{'model':db[_0x490e68[_0x2955('0x20')]],'as':_0x490e68['as'],'attributes':_0x490e68['attributes'],'include':_0x490e68[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x490e68[_0x2955('0x1e')],function(_0x13688e){return{'model':db[_0x13688e['model']],'as':_0x13688e['as'],'attributes':_0x13688e[_0x2955('0x21')],'include':_0x13688e[_0x2955('0x1e')]?_[_0x2955('0x1f')](_0x13688e['include'],function(_0x7d925){return{'model':db[_0x7d925['model']],'as':_0x7d925['as'],'attributes':_0x7d925[_0x2955('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2955('0xc')](function(_0x368a4f){logger['info'](_0x2955('0x22'),_0x40539f);logger[_0x2955('0xe')](_0x2955('0x22'),_0x40539f,JSON[_0x2955('0xf')](_0x368a4f));_0x130184(_0x368a4f);})[_0x2955('0x16')](function(_0x39c96b){logger[_0x2955('0x10')](_0x2955('0x22'),_0x39c96b[_0x2955('0x13')],_0x40539f);_0x4989d2(_0x52a2e3[_0x2955('0x10')](0x1f4,_0x39c96b[_0x2955('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9173ff6..00e90ae 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 _0x3458=['index','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','put','update','/:id','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','get'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x3458,0x92));var _0x8345=function(_0x15624d,_0x45f6f7){_0x15624d=_0x15624d-0x0;var _0x4c0e63=_0x3458[_0x15624d];return _0x4c0e63;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8345('0x0'));var timeout=require(_0x8345('0x1'));var express=require(_0x8345('0x2'));var router=express['Router']();var fs_extra=require(_0x8345('0x3'));var auth=require(_0x8345('0x4'));var interaction=require(_0x8345('0x5'));var config=require('../../config/environment');var controller=require(_0x8345('0x6'));router[_0x8345('0x7')]('/',auth['isAuthenticated'](),controller[_0x8345('0x8')]);router[_0x8345('0x7')]('/:id',auth[_0x8345('0x9')](),controller[_0x8345('0xa')]);router['get'](_0x8345('0xb'),auth[_0x8345('0x9')](),controller[_0x8345('0xc')]);router[_0x8345('0x7')](_0x8345('0xd'),auth[_0x8345('0x9')](),controller['getSubjects']);router[_0x8345('0x7')]('/:id/descriptions',auth[_0x8345('0x9')](),controller[_0x8345('0xe')]);router[_0x8345('0xf')]('/',auth[_0x8345('0x9')](),controller[_0x8345('0x10')]);router[_0x8345('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x8345('0x12')]);router['delete'](_0x8345('0x13'),auth[_0x8345('0x9')](),controller[_0x8345('0x14')]);module[_0x8345('0x15')]=router; \ No newline at end of file +var _0x90d0=['/:id/descriptions','create','put','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields'];(function(_0x15adc6,_0xbc8322){var _0x3bb841=function(_0x16945d){while(--_0x16945d){_0x15adc6['push'](_0x15adc6['shift']());}};_0x3bb841(++_0xbc8322);}(_0x90d0,0x10f));var _0x090d=function(_0x168ad0,_0x45e98b){_0x168ad0=_0x168ad0-0x0;var _0x3596fc=_0x90d0[_0x168ad0];return _0x3596fc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x090d('0x0'));var timeout=require(_0x090d('0x1'));var express=require('express');var router=express[_0x090d('0x2')]();var fs_extra=require(_0x090d('0x3'));var auth=require(_0x090d('0x4'));var interaction=require(_0x090d('0x5'));var config=require(_0x090d('0x6'));var controller=require(_0x090d('0x7'));router[_0x090d('0x8')]('/',auth[_0x090d('0x9')](),controller[_0x090d('0xa')]);router[_0x090d('0x8')](_0x090d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x090d('0x8')](_0x090d('0xc'),auth[_0x090d('0x9')](),controller[_0x090d('0xd')]);router['get']('/:id/subjects',auth[_0x090d('0x9')](),controller['getSubjects']);router['get'](_0x090d('0xe'),auth[_0x090d('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x090d('0x9')](),controller[_0x090d('0xf')]);router[_0x090d('0x10')](_0x090d('0xb'),auth[_0x090d('0x9')](),controller['update']);router['delete'](_0x090d('0xb'),auth[_0x090d('0x9')](),controller[_0x090d('0x11')]);module[_0x090d('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 2f74e66..92943d8 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 _0x980b=['incident','phonecall','STRING','ENUM'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x980b,0x86));var _0xb980=function(_0x2aa4a8,_0x3a163a){_0x2aa4a8=_0x2aa4a8-0x0;var _0x4989b4=_0x980b[_0x2aa4a8];return _0x4989b4;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb980('0x0')]},'description':{'type':Sequelize[_0xb980('0x0')]},'ticketType':{'type':Sequelize[_0xb980('0x1')](_0xb980('0x2'),_0xb980('0x3')),'defaultValue':_0xb980('0x2')}}; \ No newline at end of file +var _0x3546=['phonecall','sequelize','exports','STRING','incident'];(function(_0x93ec99,_0x3a86c0){var _0x8e429c=function(_0x2ebbed){while(--_0x2ebbed){_0x93ec99['push'](_0x93ec99['shift']());}};_0x8e429c(++_0x3a86c0);}(_0x3546,0x1a5));var _0x6354=function(_0x372515,_0xdd11f){_0x372515=_0x372515-0x0;var _0xa3bf4e=_0x3546[_0x372515];return _0xa3bf4e;};'use strict';var Sequelize=require(_0x6354('0x0'));module[_0x6354('0x1')]={'name':{'type':Sequelize[_0x6354('0x2')]},'description':{'type':Sequelize[_0x6354('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x6354('0x3'),_0x6354('0x4')),'defaultValue':_0x6354('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 9c4a828..046a2a0 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 _0x8b0b=['destroy','error','name','send','index','map','Dynamics365Configuration','type','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','catch','params','rawAttributes','includeAll','merge','find','create','body','getFields','findOne','hasOwnProperty','nolimit','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then'];(function(_0x3804da,_0x4b1678){var _0x1038e3=function(_0x46dbaf){while(--_0x46dbaf){_0x3804da['push'](_0x3804da['shift']());}};_0x1038e3(++_0x4b1678);}(_0x8b0b,0x75));var _0xb8b0=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x8b0b[_0x82129b];return _0x2ae5dc;};'use strict';var emlformat=require(_0xb8b0('0x0'));var rimraf=require(_0xb8b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb8b0('0x2'));var rp=require('request-promise');var moment=require(_0xb8b0('0x3'));var BPromise=require(_0xb8b0('0x4'));var Mustache=require('mustache');var util=require(_0xb8b0('0x5'));var path=require(_0xb8b0('0x6'));var sox=require('sox');var csv=require(_0xb8b0('0x7'));var ejs=require(_0xb8b0('0x8'));var fs=require('fs');var fs_extra=require(_0xb8b0('0x9'));var _=require(_0xb8b0('0xa'));var squel=require(_0xb8b0('0xb'));var crypto=require(_0xb8b0('0xc'));var jsforce=require(_0xb8b0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb8b0('0x7'));var querystring=require('querystring');var Papa=require(_0xb8b0('0xe'));var Redis=require(_0xb8b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb8b0('0x10'));var as=require(_0xb8b0('0x11'));var hardwareService=require(_0xb8b0('0x12'));var logger=require(_0xb8b0('0x13'))(_0xb8b0('0x14'));var utils=require(_0xb8b0('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb8b0('0x16'))['db'];function respondWithStatusCode(_0x1ed052,_0x26617b){_0x26617b=_0x26617b||0xcc;return function(_0xde38a4){if(_0xde38a4){return _0x1ed052[_0xb8b0('0x17')](_0x26617b);}return _0x1ed052[_0xb8b0('0x18')](_0x26617b)[_0xb8b0('0x19')]();};}function respondWithResult(_0xb8e06f,_0x2dec94){_0x2dec94=_0x2dec94||0xc8;return function(_0x841227){if(_0x841227){return _0xb8e06f[_0xb8b0('0x18')](_0x2dec94)[_0xb8b0('0x1a')](_0x841227);}};}function respondWithFilteredResult(_0x1f91d7,_0x49d891){return function(_0x1f66d5){if(_0x1f66d5){var _0x265e98=typeof _0x49d891[_0xb8b0('0x1b')]===_0xb8b0('0x1c')&&typeof _0x49d891[_0xb8b0('0x1d')]===_0xb8b0('0x1c');var _0x719295=_0x1f66d5[_0xb8b0('0x1e')];var _0x468e23=_0x265e98?0x0:_0x49d891[_0xb8b0('0x1b')];var _0x5bee0f=_0x265e98?_0x1f66d5['count']:_0x49d891[_0xb8b0('0x1b')]+_0x49d891[_0xb8b0('0x1d')];var _0x263115;if(_0x5bee0f>=_0x719295){_0x5bee0f=_0x719295;_0x263115=0xc8;}else{_0x263115=0xce;}_0x1f91d7['status'](_0x263115);return _0x1f91d7[_0xb8b0('0x1f')](_0xb8b0('0x20'),_0x468e23+'-'+_0x5bee0f+'/'+_0x719295)[_0xb8b0('0x1a')](_0x1f66d5);}return null;};}function patchUpdates(_0x551e35){return function(_0x4e9ce5){try{jsonpatch['apply'](_0x4e9ce5,_0x551e35,!![]);}catch(_0xd3bd34){return BPromise[_0xb8b0('0x21')](_0xd3bd34);}return _0x4e9ce5[_0xb8b0('0x22')]();};}function saveUpdates(_0x47c1a6,_0x5e3bc4){return function(_0xd9539a){if(_0xd9539a){return _0xd9539a[_0xb8b0('0x23')](_0x47c1a6)[_0xb8b0('0x24')](function(_0x2e6481){return _0x2e6481;});}return null;};}function removeEntity(_0x358b57,_0x534ddb){return function(_0xe413c){if(_0xe413c){return _0xe413c[_0xb8b0('0x25')]()[_0xb8b0('0x24')](function(){_0x358b57[_0xb8b0('0x18')](0xcc)[_0xb8b0('0x19')]();});}};}function handleEntityNotFound(_0x52bb90,_0x4d2ff5){return function(_0x1e8d62){if(!_0x1e8d62){_0x52bb90[_0xb8b0('0x17')](0x194);}return _0x1e8d62;};}function handleError(_0x85930a,_0x532ad6){_0x532ad6=_0x532ad6||0x1f4;return function(_0x54c1d5){logger[_0xb8b0('0x26')](_0x54c1d5['stack']);if(_0x54c1d5[_0xb8b0('0x27')]){delete _0x54c1d5['name'];}_0x85930a[_0xb8b0('0x18')](_0x532ad6)[_0xb8b0('0x28')](_0x54c1d5);};}exports[_0xb8b0('0x29')]=function(_0x1b75a6,_0x5120bb){var _0x4d2106={},_0x30d040={},_0x2f4f38={'count':0x0,'rows':[]};var _0x2497f9=_[_0xb8b0('0x2a')](db[_0xb8b0('0x2b')]['rawAttributes'],function(_0x3ff982){return{'name':_0x3ff982['fieldName'],'type':_0x3ff982[_0xb8b0('0x2c')]['key']};});_0x30d040[_0xb8b0('0x2d')]=_[_0xb8b0('0x2a')](_0x2497f9,_0xb8b0('0x27'));_0x30d040[_0xb8b0('0x2e')]=_[_0xb8b0('0x2f')](_0x1b75a6[_0xb8b0('0x2e')]);_0x30d040[_0xb8b0('0x30')]=_[_0xb8b0('0x31')](_0x30d040[_0xb8b0('0x2d')],_0x30d040[_0xb8b0('0x2e')]);_0x4d2106[_0xb8b0('0x32')]=_['intersection'](_0x30d040[_0xb8b0('0x2d')],qs[_0xb8b0('0x33')](_0x1b75a6[_0xb8b0('0x2e')][_0xb8b0('0x33')]));_0x4d2106[_0xb8b0('0x32')]=_0x4d2106[_0xb8b0('0x32')][_0xb8b0('0x34')]?_0x4d2106['attributes']:_0x30d040[_0xb8b0('0x2d')];if(!_0x1b75a6[_0xb8b0('0x2e')]['hasOwnProperty']('nolimit')){_0x4d2106['limit']=qs[_0xb8b0('0x1d')](_0x1b75a6[_0xb8b0('0x2e')][_0xb8b0('0x1d')]);_0x4d2106[_0xb8b0('0x1b')]=qs[_0xb8b0('0x1b')](_0x1b75a6['query'][_0xb8b0('0x1b')]);}_0x4d2106[_0xb8b0('0x35')]=qs[_0xb8b0('0x36')](_0x1b75a6[_0xb8b0('0x2e')][_0xb8b0('0x36')]);_0x4d2106[_0xb8b0('0x37')]=qs[_0xb8b0('0x30')](_[_0xb8b0('0x38')](_0x1b75a6[_0xb8b0('0x2e')],_0x30d040[_0xb8b0('0x30')]),_0x2497f9);if(_0x1b75a6['query'][_0xb8b0('0x39')]){_0x4d2106[_0xb8b0('0x37')]=_['merge'](_0x4d2106[_0xb8b0('0x37')],{'$or':_['map'](_0x2497f9,function(_0x5901b3){if(_0x5901b3['type']!==_0xb8b0('0x3a')){var _0x4a3248={};_0x4a3248[_0x5901b3[_0xb8b0('0x27')]]={'$like':'%'+_0x1b75a6[_0xb8b0('0x2e')][_0xb8b0('0x39')]+'%'};return _0x4a3248;}})});}_0x4d2106=_['merge']({},_0x4d2106,_0x1b75a6[_0xb8b0('0x3b')]);var _0x54e91a={'where':_0x4d2106[_0xb8b0('0x37')]};return db[_0xb8b0('0x2b')][_0xb8b0('0x1e')](_0x54e91a)[_0xb8b0('0x24')](function(_0x4bdd24){_0x2f4f38[_0xb8b0('0x1e')]=_0x4bdd24;if(_0x1b75a6[_0xb8b0('0x2e')]['includeAll']){_0x4d2106[_0xb8b0('0x3c')]=[{'all':!![]}];}return db[_0xb8b0('0x2b')][_0xb8b0('0x3d')](_0x4d2106);})[_0xb8b0('0x24')](function(_0x19fc0d){_0x2f4f38['rows']=_0x19fc0d;return _0x2f4f38;})[_0xb8b0('0x24')](respondWithFilteredResult(_0x5120bb,_0x4d2106))[_0xb8b0('0x3e')](handleError(_0x5120bb,null));};exports['show']=function(_0x44ea97,_0x1d6677){var _0x4e51df={'raw':![],'where':{'id':_0x44ea97[_0xb8b0('0x3f')]['id']}},_0x70c516={};_0x70c516[_0xb8b0('0x2d')]=_[_0xb8b0('0x2f')](db['Dynamics365Configuration'][_0xb8b0('0x40')]);_0x70c516['query']=_[_0xb8b0('0x2f')](_0x44ea97[_0xb8b0('0x2e')]);_0x70c516['filters']=_['intersection'](_0x70c516[_0xb8b0('0x2d')],_0x70c516[_0xb8b0('0x2e')]);_0x4e51df[_0xb8b0('0x32')]=_[_0xb8b0('0x31')](_0x70c516[_0xb8b0('0x2d')],qs[_0xb8b0('0x33')](_0x44ea97[_0xb8b0('0x2e')]['fields']));_0x4e51df[_0xb8b0('0x32')]=_0x4e51df[_0xb8b0('0x32')][_0xb8b0('0x34')]?_0x4e51df[_0xb8b0('0x32')]:_0x70c516[_0xb8b0('0x2d')];if(_0x44ea97[_0xb8b0('0x2e')][_0xb8b0('0x41')]){_0x4e51df[_0xb8b0('0x3c')]=[{'all':!![]}];}_0x4e51df=_[_0xb8b0('0x42')]({},_0x4e51df,_0x44ea97['options']);return db[_0xb8b0('0x2b')][_0xb8b0('0x43')](_0x4e51df)[_0xb8b0('0x24')](handleEntityNotFound(_0x1d6677,null))['then'](respondWithResult(_0x1d6677,null))[_0xb8b0('0x3e')](handleError(_0x1d6677,null));};exports['create']=function(_0x5358c5,_0x597b9e){return db[_0xb8b0('0x2b')][_0xb8b0('0x44')](_0x5358c5[_0xb8b0('0x45')],{})[_0xb8b0('0x24')](respondWithResult(_0x597b9e,0xc9))[_0xb8b0('0x3e')](handleError(_0x597b9e,null));};exports['update']=function(_0x50be60,_0x523ad8){if(_0x50be60[_0xb8b0('0x45')]['id']){delete _0x50be60[_0xb8b0('0x45')]['id'];}return db[_0xb8b0('0x2b')][_0xb8b0('0x43')]({'where':{'id':_0x50be60['params']['id']}})[_0xb8b0('0x24')](handleEntityNotFound(_0x523ad8,null))['then'](saveUpdates(_0x50be60[_0xb8b0('0x45')],null))[_0xb8b0('0x24')](respondWithResult(_0x523ad8,null))[_0xb8b0('0x3e')](handleError(_0x523ad8,null));};exports[_0xb8b0('0x25')]=function(_0x58c27b,_0x3f4042){return db['Dynamics365Configuration']['find']({'where':{'id':_0x58c27b[_0xb8b0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f4042,null))[_0xb8b0('0x24')](removeEntity(_0x3f4042,null))['catch'](handleError(_0x3f4042,null));};exports[_0xb8b0('0x46')]=function(_0x3d7d09,_0x350ac3,_0x1599fd){var _0x4c8491={};var _0x569024={};var _0x5bf123;var _0x57fbb6;return db[_0xb8b0('0x2b')][_0xb8b0('0x47')]({'where':{'id':_0x3d7d09['params']['id']}})[_0xb8b0('0x24')](handleEntityNotFound(_0x350ac3,null))[_0xb8b0('0x24')](function(_0x5b8bfe){if(_0x5b8bfe){_0x5bf123=_0x5b8bfe;_0x569024[_0xb8b0('0x2d')]=_[_0xb8b0('0x2f')](db['Dynamics365Field'][_0xb8b0('0x40')]);_0x569024[_0xb8b0('0x2e')]=_['keys'](_0x3d7d09[_0xb8b0('0x2e')]);_0x569024['filters']=_['intersection'](_0x569024[_0xb8b0('0x2d')],_0x569024['query']);_0x4c8491[_0xb8b0('0x32')]=_[_0xb8b0('0x31')](_0x569024[_0xb8b0('0x2d')],qs[_0xb8b0('0x33')](_0x3d7d09[_0xb8b0('0x2e')][_0xb8b0('0x33')]));_0x4c8491[_0xb8b0('0x32')]=_0x4c8491[_0xb8b0('0x32')][_0xb8b0('0x34')]?_0x4c8491['attributes']:_0x569024['model'];_0x4c8491[_0xb8b0('0x35')]=qs[_0xb8b0('0x36')](_0x3d7d09['query']['sort']);_0x4c8491['where']=qs['filters'](_[_0xb8b0('0x38')](_0x3d7d09[_0xb8b0('0x2e')],_0x569024['filters']));if(_0x3d7d09['query']['filter']){_0x4c8491[_0xb8b0('0x37')]=_[_0xb8b0('0x42')](_0x4c8491[_0xb8b0('0x37')],{'$or':_[_0xb8b0('0x2a')](_0x4c8491['attributes'],function(_0x3d7a4e){var _0x28f137={};_0x28f137[_0x3d7a4e]={'$like':'%'+_0x3d7d09[_0xb8b0('0x2e')][_0xb8b0('0x39')]+'%'};return _0x28f137;})});}_0x4c8491=_['merge']({},_0x4c8491,_0x3d7d09[_0xb8b0('0x3b')]);return _0x5bf123[_0xb8b0('0x46')](_0x4c8491);}})['then'](function(_0x4272f8){if(_0x4272f8){_0x57fbb6=_0x4272f8['length'];if(!_0x3d7d09[_0xb8b0('0x2e')][_0xb8b0('0x48')](_0xb8b0('0x49'))){_0x4c8491['limit']=qs[_0xb8b0('0x1d')](_0x3d7d09[_0xb8b0('0x2e')][_0xb8b0('0x1d')]);_0x4c8491[_0xb8b0('0x1b')]=qs[_0xb8b0('0x1b')](_0x3d7d09['query'][_0xb8b0('0x1b')]);}return _0x5bf123['getFields'](_0x4c8491);}})[_0xb8b0('0x24')](function(_0x1350c8){if(_0x1350c8){return _0x1350c8?{'count':_0x57fbb6,'rows':_0x1350c8}:null;}})[_0xb8b0('0x24')](respondWithResult(_0x350ac3,null))['catch'](handleError(_0x350ac3,null));};exports['getSubjects']=function(_0x10d80a,_0x92ff7a,_0x4eb74a){var _0x3844e7={};var _0x3f2f0b={};var _0x3575a3;var _0x5cc293;return db[_0xb8b0('0x2b')]['findOne']({'where':{'id':_0x10d80a[_0xb8b0('0x3f')]['id']}})[_0xb8b0('0x24')](handleEntityNotFound(_0x92ff7a,null))[_0xb8b0('0x24')](function(_0x51cfbc){if(_0x51cfbc){_0x3575a3=_0x51cfbc;_0x3f2f0b[_0xb8b0('0x2d')]=_['keys'](db[_0xb8b0('0x4a')]['rawAttributes']);_0x3f2f0b[_0xb8b0('0x2e')]=_[_0xb8b0('0x2f')](_0x10d80a[_0xb8b0('0x2e')]);_0x3f2f0b[_0xb8b0('0x30')]=_[_0xb8b0('0x31')](_0x3f2f0b[_0xb8b0('0x2d')],_0x3f2f0b[_0xb8b0('0x2e')]);_0x3844e7['attributes']=_[_0xb8b0('0x31')](_0x3f2f0b['model'],qs[_0xb8b0('0x33')](_0x10d80a[_0xb8b0('0x2e')]['fields']));_0x3844e7['attributes']=_0x3844e7[_0xb8b0('0x32')]['length']?_0x3844e7[_0xb8b0('0x32')]:_0x3f2f0b['model'];_0x3844e7['order']=qs[_0xb8b0('0x36')](_0x10d80a[_0xb8b0('0x2e')][_0xb8b0('0x36')]);_0x3844e7[_0xb8b0('0x37')]=qs[_0xb8b0('0x30')](_[_0xb8b0('0x38')](_0x10d80a['query'],_0x3f2f0b[_0xb8b0('0x30')]));if(_0x10d80a['query'][_0xb8b0('0x39')]){_0x3844e7['where']=_['merge'](_0x3844e7[_0xb8b0('0x37')],{'$or':_[_0xb8b0('0x2a')](_0x3844e7[_0xb8b0('0x32')],function(_0x24e582){var _0x5bb756={};_0x5bb756[_0x24e582]={'$like':'%'+_0x10d80a['query'][_0xb8b0('0x39')]+'%'};return _0x5bb756;})});}_0x3844e7=_[_0xb8b0('0x42')]({},_0x3844e7,_0x10d80a[_0xb8b0('0x3b')]);return _0x3575a3['getSubjects'](_0x3844e7);}})[_0xb8b0('0x24')](function(_0x4f3e6e){if(_0x4f3e6e){_0x5cc293=_0x4f3e6e[_0xb8b0('0x34')];if(!_0x10d80a['query']['hasOwnProperty'](_0xb8b0('0x49'))){_0x3844e7['limit']=qs['limit'](_0x10d80a['query']['limit']);_0x3844e7['offset']=qs[_0xb8b0('0x1b')](_0x10d80a[_0xb8b0('0x2e')]['offset']);}return _0x3575a3[_0xb8b0('0x4b')](_0x3844e7);}})[_0xb8b0('0x24')](function(_0xb87127){if(_0xb87127){return _0xb87127?{'count':_0x5cc293,'rows':_0xb87127}:null;}})[_0xb8b0('0x24')](respondWithResult(_0x92ff7a,null))[_0xb8b0('0x3e')](handleError(_0x92ff7a,null));};exports[_0xb8b0('0x4c')]=function(_0x3092b0,_0x156e44,_0x25dc77){var _0x1aa036={};var _0x25afa7={};var _0x5dab36;var _0x42ba7e;return db[_0xb8b0('0x2b')][_0xb8b0('0x47')]({'where':{'id':_0x3092b0[_0xb8b0('0x3f')]['id']}})[_0xb8b0('0x24')](handleEntityNotFound(_0x156e44,null))[_0xb8b0('0x24')](function(_0x13b0b8){if(_0x13b0b8){_0x5dab36=_0x13b0b8;_0x25afa7['model']=_[_0xb8b0('0x2f')](db[_0xb8b0('0x4a')][_0xb8b0('0x40')]);_0x25afa7[_0xb8b0('0x2e')]=_['keys'](_0x3092b0[_0xb8b0('0x2e')]);_0x25afa7[_0xb8b0('0x30')]=_['intersection'](_0x25afa7['model'],_0x25afa7[_0xb8b0('0x2e')]);_0x1aa036[_0xb8b0('0x32')]=_[_0xb8b0('0x31')](_0x25afa7[_0xb8b0('0x2d')],qs[_0xb8b0('0x33')](_0x3092b0[_0xb8b0('0x2e')][_0xb8b0('0x33')]));_0x1aa036[_0xb8b0('0x32')]=_0x1aa036[_0xb8b0('0x32')][_0xb8b0('0x34')]?_0x1aa036['attributes']:_0x25afa7[_0xb8b0('0x2d')];_0x1aa036[_0xb8b0('0x35')]=qs['sort'](_0x3092b0[_0xb8b0('0x2e')]['sort']);_0x1aa036[_0xb8b0('0x37')]=qs[_0xb8b0('0x30')](_[_0xb8b0('0x38')](_0x3092b0[_0xb8b0('0x2e')],_0x25afa7[_0xb8b0('0x30')]));if(_0x3092b0[_0xb8b0('0x2e')][_0xb8b0('0x39')]){_0x1aa036[_0xb8b0('0x37')]=_[_0xb8b0('0x42')](_0x1aa036[_0xb8b0('0x37')],{'$or':_[_0xb8b0('0x2a')](_0x1aa036[_0xb8b0('0x32')],function(_0x219394){var _0x54a151={};_0x54a151[_0x219394]={'$like':'%'+_0x3092b0[_0xb8b0('0x2e')][_0xb8b0('0x39')]+'%'};return _0x54a151;})});}_0x1aa036=_[_0xb8b0('0x42')]({},_0x1aa036,_0x3092b0[_0xb8b0('0x3b')]);return _0x5dab36[_0xb8b0('0x4c')](_0x1aa036);}})[_0xb8b0('0x24')](function(_0x54b824){if(_0x54b824){_0x42ba7e=_0x54b824[_0xb8b0('0x34')];if(!_0x3092b0[_0xb8b0('0x2e')]['hasOwnProperty'](_0xb8b0('0x49'))){_0x1aa036[_0xb8b0('0x1d')]=qs[_0xb8b0('0x1d')](_0x3092b0['query'][_0xb8b0('0x1d')]);_0x1aa036['offset']=qs[_0xb8b0('0x1b')](_0x3092b0[_0xb8b0('0x2e')][_0xb8b0('0x1b')]);}return _0x5dab36['getDescriptions'](_0x1aa036);}})[_0xb8b0('0x24')](function(_0x3e8cb4){if(_0x3e8cb4){return _0x3e8cb4?{'count':_0x42ba7e,'rows':_0x3e8cb4}:null;}})[_0xb8b0('0x24')](respondWithResult(_0x156e44,null))[_0xb8b0('0x3e')](handleError(_0x156e44,null));}; \ No newline at end of file +var _0xda56=['../../config/environment','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','error','name','send','map','Dynamics365Configuration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','fields','create','body','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils'];(function(_0x25806f,_0x16dbdd){var _0x163f12=function(_0x3d1990){while(--_0x3d1990){_0x25806f['push'](_0x25806f['shift']());}};_0x163f12(++_0x16dbdd);}(_0xda56,0x1ec));var _0x6da5=function(_0x1f9bc0,_0x1edaaf){_0x1f9bc0=_0x1f9bc0-0x0;var _0x40de7a=_0xda56[_0x1f9bc0];return _0x40de7a;};'use strict';var emlformat=require(_0x6da5('0x0'));var rimraf=require(_0x6da5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6da5('0x2'));var moment=require(_0x6da5('0x3'));var BPromise=require(_0x6da5('0x4'));var Mustache=require(_0x6da5('0x5'));var util=require('util');var path=require(_0x6da5('0x6'));var sox=require(_0x6da5('0x7'));var csv=require(_0x6da5('0x8'));var ejs=require(_0x6da5('0x9'));var fs=require('fs');var fs_extra=require(_0x6da5('0xa'));var _=require(_0x6da5('0xb'));var squel=require(_0x6da5('0xc'));var crypto=require('crypto');var jsforce=require(_0x6da5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6da5('0xe'));var authService=require(_0x6da5('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6da5('0x10'))(_0x6da5('0x11'));var utils=require(_0x6da5('0x12'));var config=require(_0x6da5('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x477a83,_0x23d87e){_0x23d87e=_0x23d87e||0xcc;return function(_0xc31ac7){if(_0xc31ac7){return _0x477a83[_0x6da5('0x14')](_0x23d87e);}return _0x477a83[_0x6da5('0x15')](_0x23d87e)[_0x6da5('0x16')]();};}function respondWithResult(_0x3b566b,_0x168596){_0x168596=_0x168596||0xc8;return function(_0x4ac254){if(_0x4ac254){return _0x3b566b[_0x6da5('0x15')](_0x168596)[_0x6da5('0x17')](_0x4ac254);}};}function respondWithFilteredResult(_0x4534ee,_0x44539d){return function(_0x196537){if(_0x196537){var _0x17aec6=typeof _0x44539d['offset']==='undefined'&&typeof _0x44539d[_0x6da5('0x18')]===_0x6da5('0x19');var _0x4beaf9=_0x196537[_0x6da5('0x1a')];var _0x37fcdf=_0x17aec6?0x0:_0x44539d[_0x6da5('0x1b')];var _0x198dbb=_0x17aec6?_0x196537[_0x6da5('0x1a')]:_0x44539d[_0x6da5('0x1b')]+_0x44539d[_0x6da5('0x18')];var _0xdda56f;if(_0x198dbb>=_0x4beaf9){_0x198dbb=_0x4beaf9;_0xdda56f=0xc8;}else{_0xdda56f=0xce;}_0x4534ee[_0x6da5('0x15')](_0xdda56f);return _0x4534ee[_0x6da5('0x1c')](_0x6da5('0x1d'),_0x37fcdf+'-'+_0x198dbb+'/'+_0x4beaf9)[_0x6da5('0x17')](_0x196537);}return null;};}function patchUpdates(_0x14f39a){return function(_0x4f527f){try{jsonpatch[_0x6da5('0x1e')](_0x4f527f,_0x14f39a,!![]);}catch(_0x3654f5){return BPromise['reject'](_0x3654f5);}return _0x4f527f[_0x6da5('0x1f')]();};}function saveUpdates(_0x525474,_0x573733){return function(_0x42d0cc){if(_0x42d0cc){return _0x42d0cc[_0x6da5('0x20')](_0x525474)[_0x6da5('0x21')](function(_0x10357b){return _0x10357b;});}return null;};}function removeEntity(_0x26c603,_0x3302bc){return function(_0x36b2d6){if(_0x36b2d6){return _0x36b2d6['destroy']()[_0x6da5('0x21')](function(){_0x26c603[_0x6da5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x425ade,_0x288084){return function(_0x41f116){if(!_0x41f116){_0x425ade[_0x6da5('0x14')](0x194);}return _0x41f116;};}function handleError(_0x24ed0c,_0x9dcde7){_0x9dcde7=_0x9dcde7||0x1f4;return function(_0x22534a){logger[_0x6da5('0x22')](_0x22534a['stack']);if(_0x22534a['name']){delete _0x22534a[_0x6da5('0x23')];}_0x24ed0c[_0x6da5('0x15')](_0x9dcde7)[_0x6da5('0x24')](_0x22534a);};}exports['index']=function(_0x225736,_0x38abcb){var _0x360bbb={},_0x23cca8={},_0x2edc75={'count':0x0,'rows':[]};var _0x36a2ce=_[_0x6da5('0x25')](db[_0x6da5('0x26')][_0x6da5('0x27')],function(_0x5f0fbb){return{'name':_0x5f0fbb[_0x6da5('0x28')],'type':_0x5f0fbb['type'][_0x6da5('0x29')]};});_0x23cca8['model']=_['map'](_0x36a2ce,'name');_0x23cca8[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x225736[_0x6da5('0x2a')]);_0x23cca8[_0x6da5('0x2c')]=_[_0x6da5('0x2d')](_0x23cca8[_0x6da5('0x2e')],_0x23cca8['query']);_0x360bbb[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x23cca8['model'],qs['fields'](_0x225736[_0x6da5('0x2a')]['fields']));_0x360bbb[_0x6da5('0x2f')]=_0x360bbb['attributes'][_0x6da5('0x30')]?_0x360bbb[_0x6da5('0x2f')]:_0x23cca8[_0x6da5('0x2e')];if(!_0x225736[_0x6da5('0x2a')][_0x6da5('0x31')](_0x6da5('0x32'))){_0x360bbb[_0x6da5('0x18')]=qs['limit'](_0x225736[_0x6da5('0x2a')][_0x6da5('0x18')]);_0x360bbb[_0x6da5('0x1b')]=qs['offset'](_0x225736[_0x6da5('0x2a')][_0x6da5('0x1b')]);}_0x360bbb[_0x6da5('0x33')]=qs[_0x6da5('0x34')](_0x225736['query'][_0x6da5('0x34')]);_0x360bbb[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x225736['query'],_0x23cca8[_0x6da5('0x2c')]),_0x36a2ce);if(_0x225736[_0x6da5('0x2a')]['filter']){_0x360bbb[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0x360bbb['where'],{'$or':_[_0x6da5('0x25')](_0x36a2ce,function(_0x4e9663){if(_0x4e9663[_0x6da5('0x38')]!=='VIRTUAL'){var _0x56ada4={};_0x56ada4[_0x4e9663[_0x6da5('0x23')]]={'$like':'%'+_0x225736[_0x6da5('0x2a')][_0x6da5('0x39')]+'%'};return _0x56ada4;}})});}_0x360bbb=_[_0x6da5('0x37')]({},_0x360bbb,_0x225736[_0x6da5('0x3a')]);var _0x2b0f66={'where':_0x360bbb[_0x6da5('0x35')]};return db[_0x6da5('0x26')][_0x6da5('0x1a')](_0x2b0f66)[_0x6da5('0x21')](function(_0x50a6cb){_0x2edc75[_0x6da5('0x1a')]=_0x50a6cb;if(_0x225736[_0x6da5('0x2a')][_0x6da5('0x3b')]){_0x360bbb[_0x6da5('0x3c')]=[{'all':!![]}];}return db[_0x6da5('0x26')][_0x6da5('0x3d')](_0x360bbb);})[_0x6da5('0x21')](function(_0x27113a){_0x2edc75[_0x6da5('0x3e')]=_0x27113a;return _0x2edc75;})[_0x6da5('0x21')](respondWithFilteredResult(_0x38abcb,_0x360bbb))[_0x6da5('0x3f')](handleError(_0x38abcb,null));};exports[_0x6da5('0x40')]=function(_0x564740,_0x842738){var _0x413e54={'raw':![],'where':{'id':_0x564740[_0x6da5('0x41')]['id']}},_0x2d18b0={};_0x2d18b0[_0x6da5('0x2e')]=_[_0x6da5('0x2b')](db[_0x6da5('0x26')][_0x6da5('0x27')]);_0x2d18b0[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x564740['query']);_0x2d18b0['filters']=_['intersection'](_0x2d18b0[_0x6da5('0x2e')],_0x2d18b0[_0x6da5('0x2a')]);_0x413e54[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x2d18b0[_0x6da5('0x2e')],qs[_0x6da5('0x42')](_0x564740[_0x6da5('0x2a')][_0x6da5('0x42')]));_0x413e54[_0x6da5('0x2f')]=_0x413e54[_0x6da5('0x2f')]['length']?_0x413e54['attributes']:_0x2d18b0['model'];if(_0x564740[_0x6da5('0x2a')][_0x6da5('0x3b')]){_0x413e54[_0x6da5('0x3c')]=[{'all':!![]}];}_0x413e54=_[_0x6da5('0x37')]({},_0x413e54,_0x564740[_0x6da5('0x3a')]);return db[_0x6da5('0x26')]['find'](_0x413e54)['then'](handleEntityNotFound(_0x842738,null))[_0x6da5('0x21')](respondWithResult(_0x842738,null))[_0x6da5('0x3f')](handleError(_0x842738,null));};exports[_0x6da5('0x43')]=function(_0x5c7839,_0x110b38){return db[_0x6da5('0x26')][_0x6da5('0x43')](_0x5c7839['body'],{})['then'](respondWithResult(_0x110b38,0xc9))[_0x6da5('0x3f')](handleError(_0x110b38,null));};exports['update']=function(_0x14af96,_0xd6e726){if(_0x14af96[_0x6da5('0x44')]['id']){delete _0x14af96[_0x6da5('0x44')]['id'];}return db[_0x6da5('0x26')]['find']({'where':{'id':_0x14af96[_0x6da5('0x41')]['id']}})['then'](handleEntityNotFound(_0xd6e726,null))[_0x6da5('0x21')](saveUpdates(_0x14af96[_0x6da5('0x44')],null))[_0x6da5('0x21')](respondWithResult(_0xd6e726,null))[_0x6da5('0x3f')](handleError(_0xd6e726,null));};exports['destroy']=function(_0x53c82c,_0x5d8dae){return db[_0x6da5('0x26')]['find']({'where':{'id':_0x53c82c[_0x6da5('0x41')]['id']}})[_0x6da5('0x21')](handleEntityNotFound(_0x5d8dae,null))[_0x6da5('0x21')](removeEntity(_0x5d8dae,null))[_0x6da5('0x3f')](handleError(_0x5d8dae,null));};exports['getFields']=function(_0x4a1515,_0x1ea98e,_0x4818f1){var _0xefc20d={};var _0x15845c={};var _0x254b58;var _0x3d5f6d;return db['Dynamics365Configuration'][_0x6da5('0x45')]({'where':{'id':_0x4a1515[_0x6da5('0x41')]['id']}})[_0x6da5('0x21')](handleEntityNotFound(_0x1ea98e,null))[_0x6da5('0x21')](function(_0x3125b7){if(_0x3125b7){_0x254b58=_0x3125b7;_0x15845c[_0x6da5('0x2e')]=_['keys'](db[_0x6da5('0x46')][_0x6da5('0x27')]);_0x15845c[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x4a1515[_0x6da5('0x2a')]);_0x15845c[_0x6da5('0x2c')]=_[_0x6da5('0x2d')](_0x15845c[_0x6da5('0x2e')],_0x15845c[_0x6da5('0x2a')]);_0xefc20d[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x15845c[_0x6da5('0x2e')],qs[_0x6da5('0x42')](_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x42')]));_0xefc20d[_0x6da5('0x2f')]=_0xefc20d['attributes']['length']?_0xefc20d['attributes']:_0x15845c['model'];_0xefc20d[_0x6da5('0x33')]=qs[_0x6da5('0x34')](_0x4a1515['query'][_0x6da5('0x34')]);_0xefc20d[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x4a1515[_0x6da5('0x2a')],_0x15845c[_0x6da5('0x2c')]));if(_0x4a1515['query'][_0x6da5('0x39')]){_0xefc20d[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0xefc20d['where'],{'$or':_[_0x6da5('0x25')](_0xefc20d['attributes'],function(_0x5d25e5){var _0x25736a={};_0x25736a[_0x5d25e5]={'$like':'%'+_0x4a1515[_0x6da5('0x2a')]['filter']+'%'};return _0x25736a;})});}_0xefc20d=_[_0x6da5('0x37')]({},_0xefc20d,_0x4a1515['options']);return _0x254b58['getFields'](_0xefc20d);}})[_0x6da5('0x21')](function(_0x588737){if(_0x588737){_0x3d5f6d=_0x588737[_0x6da5('0x30')];if(!_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x31')](_0x6da5('0x32'))){_0xefc20d[_0x6da5('0x18')]=qs[_0x6da5('0x18')](_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x18')]);_0xefc20d[_0x6da5('0x1b')]=qs[_0x6da5('0x1b')](_0x4a1515[_0x6da5('0x2a')][_0x6da5('0x1b')]);}return _0x254b58['getFields'](_0xefc20d);}})[_0x6da5('0x21')](function(_0x3d046a){if(_0x3d046a){return _0x3d046a?{'count':_0x3d5f6d,'rows':_0x3d046a}:null;}})[_0x6da5('0x21')](respondWithResult(_0x1ea98e,null))[_0x6da5('0x3f')](handleError(_0x1ea98e,null));};exports['getSubjects']=function(_0x5061f8,_0x392907,_0x4f2fe9){var _0x251626={};var _0x23303={};var _0x78e921;var _0x280add;return db[_0x6da5('0x26')][_0x6da5('0x45')]({'where':{'id':_0x5061f8[_0x6da5('0x41')]['id']}})[_0x6da5('0x21')](handleEntityNotFound(_0x392907,null))['then'](function(_0x3b930d){if(_0x3b930d){_0x78e921=_0x3b930d;_0x23303[_0x6da5('0x2e')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x23303[_0x6da5('0x2a')]=_['keys'](_0x5061f8[_0x6da5('0x2a')]);_0x23303[_0x6da5('0x2c')]=_[_0x6da5('0x2d')](_0x23303[_0x6da5('0x2e')],_0x23303[_0x6da5('0x2a')]);_0x251626[_0x6da5('0x2f')]=_[_0x6da5('0x2d')](_0x23303[_0x6da5('0x2e')],qs['fields'](_0x5061f8[_0x6da5('0x2a')][_0x6da5('0x42')]));_0x251626[_0x6da5('0x2f')]=_0x251626[_0x6da5('0x2f')]['length']?_0x251626[_0x6da5('0x2f')]:_0x23303[_0x6da5('0x2e')];_0x251626[_0x6da5('0x33')]=qs['sort'](_0x5061f8['query'][_0x6da5('0x34')]);_0x251626[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x5061f8[_0x6da5('0x2a')],_0x23303['filters']));if(_0x5061f8[_0x6da5('0x2a')][_0x6da5('0x39')]){_0x251626[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0x251626[_0x6da5('0x35')],{'$or':_[_0x6da5('0x25')](_0x251626[_0x6da5('0x2f')],function(_0x1bda35){var _0x127d65={};_0x127d65[_0x1bda35]={'$like':'%'+_0x5061f8[_0x6da5('0x2a')][_0x6da5('0x39')]+'%'};return _0x127d65;})});}_0x251626=_[_0x6da5('0x37')]({},_0x251626,_0x5061f8[_0x6da5('0x3a')]);return _0x78e921[_0x6da5('0x47')](_0x251626);}})[_0x6da5('0x21')](function(_0x952298){if(_0x952298){_0x280add=_0x952298['length'];if(!_0x5061f8['query'][_0x6da5('0x31')](_0x6da5('0x32'))){_0x251626[_0x6da5('0x18')]=qs['limit'](_0x5061f8[_0x6da5('0x2a')]['limit']);_0x251626[_0x6da5('0x1b')]=qs['offset'](_0x5061f8[_0x6da5('0x2a')]['offset']);}return _0x78e921[_0x6da5('0x47')](_0x251626);}})[_0x6da5('0x21')](function(_0x3a94e0){if(_0x3a94e0){return _0x3a94e0?{'count':_0x280add,'rows':_0x3a94e0}:null;}})['then'](respondWithResult(_0x392907,null))[_0x6da5('0x3f')](handleError(_0x392907,null));};exports[_0x6da5('0x48')]=function(_0x46c5e3,_0x4d1111,_0x336c3d){var _0x2dd379={};var _0x474a35={};var _0xdf825a;var _0x2bf4c5;return db[_0x6da5('0x26')]['findOne']({'where':{'id':_0x46c5e3[_0x6da5('0x41')]['id']}})['then'](handleEntityNotFound(_0x4d1111,null))[_0x6da5('0x21')](function(_0x4f3a8a){if(_0x4f3a8a){_0xdf825a=_0x4f3a8a;_0x474a35[_0x6da5('0x2e')]=_['keys'](db['Dynamics365Field'][_0x6da5('0x27')]);_0x474a35[_0x6da5('0x2a')]=_[_0x6da5('0x2b')](_0x46c5e3[_0x6da5('0x2a')]);_0x474a35[_0x6da5('0x2c')]=_['intersection'](_0x474a35[_0x6da5('0x2e')],_0x474a35[_0x6da5('0x2a')]);_0x2dd379['attributes']=_['intersection'](_0x474a35[_0x6da5('0x2e')],qs['fields'](_0x46c5e3['query'][_0x6da5('0x42')]));_0x2dd379[_0x6da5('0x2f')]=_0x2dd379[_0x6da5('0x2f')][_0x6da5('0x30')]?_0x2dd379[_0x6da5('0x2f')]:_0x474a35[_0x6da5('0x2e')];_0x2dd379[_0x6da5('0x33')]=qs['sort'](_0x46c5e3[_0x6da5('0x2a')]['sort']);_0x2dd379[_0x6da5('0x35')]=qs[_0x6da5('0x2c')](_[_0x6da5('0x36')](_0x46c5e3[_0x6da5('0x2a')],_0x474a35['filters']));if(_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x39')]){_0x2dd379[_0x6da5('0x35')]=_[_0x6da5('0x37')](_0x2dd379['where'],{'$or':_[_0x6da5('0x25')](_0x2dd379['attributes'],function(_0x251117){var _0x522445={};_0x522445[_0x251117]={'$like':'%'+_0x46c5e3['query'][_0x6da5('0x39')]+'%'};return _0x522445;})});}_0x2dd379=_['merge']({},_0x2dd379,_0x46c5e3[_0x6da5('0x3a')]);return _0xdf825a['getDescriptions'](_0x2dd379);}})['then'](function(_0xe85d73){if(_0xe85d73){_0x2bf4c5=_0xe85d73[_0x6da5('0x30')];if(!_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x31')](_0x6da5('0x32'))){_0x2dd379['limit']=qs[_0x6da5('0x18')](_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x18')]);_0x2dd379[_0x6da5('0x1b')]=qs['offset'](_0x46c5e3[_0x6da5('0x2a')][_0x6da5('0x1b')]);}return _0xdf825a[_0x6da5('0x48')](_0x2dd379);}})[_0x6da5('0x21')](function(_0x42fc05){if(_0x42fc05){return _0x42fc05?{'count':_0x2bf4c5,'rows':_0x42fc05}:null;}})['then'](respondWithResult(_0x4d1111,null))[_0x6da5('0x3f')](handleError(_0x4d1111,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index a695aa2..772e006 100644 --- a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js +++ b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x59145c,_0x94d69a){var _0x4651d0=function(_0x5705b1){while(--_0x5705b1){_0x59145c['push'](_0x59145c['shift']());}};_0x4651d0(++_0x94d69a);}(_0x70e0,0x17b));var _0x070e=function(_0x5a1b32,_0x125153){_0x5a1b32=_0x5a1b32-0x0;var _0x4f014a=_0x70e0[_0x5a1b32];return _0x4f014a;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6d6=['path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x22697e,_0x345986){var _0x5348a0=function(_0x2d1b10){while(--_0x2d1b10){_0x22697e['push'](_0x22697e['shift']());}};_0x5348a0(++_0x345986);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x302778,_0x1fa69b){_0x302778=_0x302778-0x0;var _0x3c1495=_0xd6d6[_0x302778];return _0x3c1495;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));module[_0x6d6d('0xa')]=function(_0x5702dc,_0x210ff7){return _0x5702dc[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index bcdf54b..48ec4e4 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 _0x5a2b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xe50e1,_0x30bf72){var _0x441f9a=function(_0x40ac92){while(--_0x40ac92){_0xe50e1['push'](_0xe50e1['shift']());}};_0x441f9a(++_0x30bf72);}(_0x5a2b,0x16f));var _0xb5a2=function(_0x57d36d,_0x2e13c1){_0x57d36d=_0x57d36d-0x0;var _0x1affe7=_0x5a2b[_0x57d36d];return _0x1affe7;};'use strict';var _=require(_0xb5a2('0x0'));var util=require(_0xb5a2('0x1'));var moment=require(_0xb5a2('0x2'));var BPromise=require('bluebird');var rs=require(_0xb5a2('0x3'));var fs=require('fs');var Redis=require(_0xb5a2('0x4'));var db=require(_0xb5a2('0x5'))['db'];var utils=require(_0xb5a2('0x6'));var logger=require(_0xb5a2('0x7'))(_0xb5a2('0x8'));var config=require(_0xb5a2('0x9'));var jayson=require(_0xb5a2('0xa'));var client=jayson[_0xb5a2('0xb')][_0xb5a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30ad34,_0x45939b,_0x5633eb){return new BPromise(function(_0x283d61,_0x16abe5){return client[_0xb5a2('0xd')](_0x30ad34,_0x5633eb)[_0xb5a2('0xe')](function(_0x1b0ff3){logger[_0xb5a2('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x45939b,_0xb5a2('0x10'));logger['debug'](_0xb5a2('0x11'),_0x45939b,_0xb5a2('0x10'),JSON[_0xb5a2('0x12')](_0x1b0ff3));if(_0x1b0ff3['error']){if(_0x1b0ff3[_0xb5a2('0x13')][_0xb5a2('0x14')]===0x1f4){logger[_0xb5a2('0x13')](_0xb5a2('0x15'),_0x45939b,_0x1b0ff3[_0xb5a2('0x13')][_0xb5a2('0x16')]);return _0x16abe5(_0x1b0ff3[_0xb5a2('0x13')]['message']);}logger[_0xb5a2('0x13')](_0xb5a2('0x15'),_0x45939b,_0x1b0ff3[_0xb5a2('0x13')][_0xb5a2('0x16')]);return _0x283d61(_0x1b0ff3[_0xb5a2('0x13')]['message']);}else{logger[_0xb5a2('0xf')](_0xb5a2('0x15'),_0x45939b,'request\x20sent');_0x283d61(_0x1b0ff3[_0xb5a2('0x17')][_0xb5a2('0x16')]);}})[_0xb5a2('0x18')](function(_0x4de437){logger[_0xb5a2('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x45939b,_0x4de437);_0x16abe5(_0x4de437);});});} \ No newline at end of file +var _0x96ae=['jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x42a46a,_0x21630f){var _0x1e619a=function(_0x55ccfc){while(--_0x55ccfc){_0x42a46a['push'](_0x42a46a['shift']());}};_0x1e619a(++_0x21630f);}(_0x96ae,0x15d));var _0xe96a=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x96ae[_0x153e7d];return _0x3c22dd;};'use strict';var _=require(_0xe96a('0x0'));var util=require(_0xe96a('0x1'));var moment=require(_0xe96a('0x2'));var BPromise=require(_0xe96a('0x3'));var rs=require(_0xe96a('0x4'));var fs=require('fs');var Redis=require(_0xe96a('0x5'));var db=require(_0xe96a('0x6'))['db'];var utils=require(_0xe96a('0x7'));var logger=require(_0xe96a('0x8'))(_0xe96a('0x9'));var config=require(_0xe96a('0xa'));var jayson=require(_0xe96a('0xb'));var client=jayson[_0xe96a('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52a8c6,_0x3df890,_0x2e19e4){return new BPromise(function(_0x15f62f,_0x9284bf){return client[_0xe96a('0xd')](_0x52a8c6,_0x2e19e4)[_0xe96a('0xe')](function(_0xcf3c4){logger[_0xe96a('0xf')](_0xe96a('0x10'),_0x3df890,_0xe96a('0x11'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3df890,_0xe96a('0x11'),JSON[_0xe96a('0x12')](_0xcf3c4));if(_0xcf3c4[_0xe96a('0x13')]){if(_0xcf3c4[_0xe96a('0x13')][_0xe96a('0x14')]===0x1f4){logger[_0xe96a('0x13')](_0xe96a('0x10'),_0x3df890,_0xcf3c4[_0xe96a('0x13')]['message']);return _0x9284bf(_0xcf3c4['error']['message']);}logger[_0xe96a('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3df890,_0xcf3c4['error'][_0xe96a('0x15')]);return _0x15f62f(_0xcf3c4[_0xe96a('0x13')][_0xe96a('0x15')]);}else{logger[_0xe96a('0xf')](_0xe96a('0x10'),_0x3df890,_0xe96a('0x11'));_0x15f62f(_0xcf3c4[_0xe96a('0x16')]['message']);}})[_0xe96a('0x17')](function(_0x13af93){logger['error'](_0xe96a('0x10'),_0x3df890,_0x13af93);_0x9284bf(_0x13af93);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 00d010e..ef11b0d 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 _0xe0e6=['path','express','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','/:id','isAuthenticated','show','post','create','put','delete','exports','multer','util'];(function(_0x412a0f,_0x3ceb63){var _0x416da0=function(_0x2a4246){while(--_0x2a4246){_0x412a0f['push'](_0x412a0f['shift']());}};_0x416da0(++_0x3ceb63);}(_0xe0e6,0x17e));var _0x6e0e=function(_0x435fa1,_0x58550a){_0x435fa1=_0x435fa1-0x0;var _0x845f9f=_0xe0e6[_0x435fa1];return _0x845f9f;};'use strict';var multer=require(_0x6e0e('0x0'));var util=require(_0x6e0e('0x1'));var path=require(_0x6e0e('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e0e('0x3'));var router=express['Router']();var fs_extra=require(_0x6e0e('0x4'));var auth=require(_0x6e0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6e0e('0x6'));var controller=require(_0x6e0e('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6e0e('0x8'),auth[_0x6e0e('0x9')](),controller[_0x6e0e('0xa')]);router[_0x6e0e('0xb')]('/',auth[_0x6e0e('0x9')](),controller[_0x6e0e('0xc')]);router[_0x6e0e('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6e0e('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6e0e('0xf')]=router; \ No newline at end of file +var _0x0de8=['show','create','put','/:id','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x1f8d04,_0x59b874){var _0x209eb0=function(_0x2df87e){while(--_0x2df87e){_0x1f8d04['push'](_0x1f8d04['shift']());}};_0x209eb0(++_0x59b874);}(_0x0de8,0x154));var _0x80de=function(_0x1c3dcf,_0x2bab00){_0x1c3dcf=_0x1c3dcf-0x0;var _0x343dc1=_0x0de8[_0x1c3dcf];return _0x343dc1;};'use strict';var multer=require('multer');var util=require(_0x80de('0x0'));var path=require(_0x80de('0x1'));var timeout=require('connect-timeout');var express=require(_0x80de('0x2'));var router=express[_0x80de('0x3')]();var fs_extra=require(_0x80de('0x4'));var auth=require(_0x80de('0x5'));var interaction=require(_0x80de('0x6'));var config=require(_0x80de('0x7'));var controller=require(_0x80de('0x8'));router[_0x80de('0x9')]('/',auth[_0x80de('0xa')](),controller[_0x80de('0xb')]);router[_0x80de('0x9')]('/:id',auth[_0x80de('0xa')](),controller[_0x80de('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x80de('0xd')]);router[_0x80de('0xe')](_0x80de('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x80de('0xf'),auth[_0x80de('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 1b34235..0ed3836 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 _0xbbab=['exports','ENUM','string','variable','keyValue','STRING','customVariable','sequelize'];(function(_0x282b5a,_0x37d92c){var _0x53c337=function(_0xc60d52){while(--_0xc60d52){_0x282b5a['push'](_0x282b5a['shift']());}};_0x53c337(++_0x37d92c);}(_0xbbab,0x67));var _0xbbba=function(_0x3cc94b,_0x5003e5){_0x3cc94b=_0x3cc94b-0x0;var _0x3eea94=_0xbbab[_0x3cc94b];return _0x3eea94;};'use strict';var Sequelize=require(_0xbbba('0x0'));module[_0xbbba('0x1')]={'type':{'type':Sequelize[_0xbbba('0x2')](_0xbbba('0x3'),_0xbbba('0x4'),'customVariable',_0xbbba('0x5'),'picklist'),'defaultValue':_0xbbba('0x3')},'content':{'type':Sequelize[_0xbbba('0x6')]},'key':{'type':Sequelize[_0xbbba('0x6')]},'keyType':{'type':Sequelize[_0xbbba('0x2')](_0xbbba('0x3'),'variable',_0xbbba('0x7'))},'keyContent':{'type':Sequelize[_0xbbba('0x6')]},'idField':{'type':Sequelize[_0xbbba('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbbba('0x6')]}}; \ No newline at end of file +var _0xde78=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x57cb3f,_0x12cc85){var _0x442523=function(_0x1e57ba){while(--_0x1e57ba){_0x57cb3f['push'](_0x57cb3f['shift']());}};_0x442523(++_0x12cc85);}(_0xde78,0x191));var _0x8de7=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0xde78[_0x450689];return _0x46ffb0;};'use strict';var Sequelize=require(_0x8de7('0x0'));module[_0x8de7('0x1')]={'type':{'type':Sequelize[_0x8de7('0x2')](_0x8de7('0x3'),_0x8de7('0x4'),_0x8de7('0x5'),_0x8de7('0x6'),_0x8de7('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8de7('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x8de7('0x3'),'variable',_0x8de7('0x5'))},'keyContent':{'type':Sequelize[_0x8de7('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8de7('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8de7('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7ec9773..2958fbc 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 _0xfd9c=['find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name','send','Dynamics365Field','fieldName','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','count','includeAll','findAll','rows','catch','params','intersection'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0xfd9c,0x1ed));var _0xcfd9=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0xfd9c[_0x5d9867];return _0x7d2118;};'use strict';var emlformat=require(_0xcfd9('0x0'));var rimraf=require(_0xcfd9('0x1'));var zipdir=require(_0xcfd9('0x2'));var jsonpatch=require(_0xcfd9('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xcfd9('0x4'));var Mustache=require(_0xcfd9('0x5'));var util=require(_0xcfd9('0x6'));var path=require('path');var sox=require(_0xcfd9('0x7'));var csv=require(_0xcfd9('0x8'));var ejs=require(_0xcfd9('0x9'));var fs=require('fs');var fs_extra=require(_0xcfd9('0xa'));var _=require(_0xcfd9('0xb'));var squel=require(_0xcfd9('0xc'));var crypto=require(_0xcfd9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcfd9('0xe'));var toCsv=require(_0xcfd9('0x8'));var querystring=require(_0xcfd9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcfd9('0x10'));var qs=require(_0xcfd9('0x11'));var as=require(_0xcfd9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcfd9('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xcfd9('0x14'));var licenseUtil=require(_0xcfd9('0x15'));var db=require(_0xcfd9('0x16'))['db'];function respondWithStatusCode(_0x59179b,_0x43f73a){_0x43f73a=_0x43f73a||0xcc;return function(_0x130757){if(_0x130757){return _0x59179b['sendStatus'](_0x43f73a);}return _0x59179b[_0xcfd9('0x17')](_0x43f73a)['end']();};}function respondWithResult(_0x16b083,_0x35b320){_0x35b320=_0x35b320||0xc8;return function(_0x28e9fc){if(_0x28e9fc){return _0x16b083['status'](_0x35b320)[_0xcfd9('0x18')](_0x28e9fc);}};}function respondWithFilteredResult(_0x513132,_0x4dc563){return function(_0x27ca1){if(_0x27ca1){var _0x57bd54=typeof _0x4dc563[_0xcfd9('0x19')]===_0xcfd9('0x1a')&&typeof _0x4dc563[_0xcfd9('0x1b')]==='undefined';var _0x852b27=_0x27ca1['count'];var _0x1f9850=_0x57bd54?0x0:_0x4dc563[_0xcfd9('0x19')];var _0x3edb41=_0x57bd54?_0x27ca1['count']:_0x4dc563['offset']+_0x4dc563[_0xcfd9('0x1b')];var _0x45ea40;if(_0x3edb41>=_0x852b27){_0x3edb41=_0x852b27;_0x45ea40=0xc8;}else{_0x45ea40=0xce;}_0x513132[_0xcfd9('0x17')](_0x45ea40);return _0x513132['set'](_0xcfd9('0x1c'),_0x1f9850+'-'+_0x3edb41+'/'+_0x852b27)[_0xcfd9('0x18')](_0x27ca1);}return null;};}function patchUpdates(_0x1fccb5){return function(_0xf77a35){try{jsonpatch[_0xcfd9('0x1d')](_0xf77a35,_0x1fccb5,!![]);}catch(_0x5cf160){return BPromise[_0xcfd9('0x1e')](_0x5cf160);}return _0xf77a35[_0xcfd9('0x1f')]();};}function saveUpdates(_0x1f5d0f,_0x9720fe){return function(_0x249e04){if(_0x249e04){return _0x249e04[_0xcfd9('0x20')](_0x1f5d0f)['then'](function(_0x5b7ac6){return _0x5b7ac6;});}return null;};}function removeEntity(_0x16378c,_0x15023a){return function(_0x28c469){if(_0x28c469){return _0x28c469[_0xcfd9('0x21')]()[_0xcfd9('0x22')](function(){_0x16378c[_0xcfd9('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c7a4b,_0x26d2fd){return function(_0x56a90a){if(!_0x56a90a){_0x5c7a4b[_0xcfd9('0x23')](0x194);}return _0x56a90a;};}function handleError(_0x3f706b,_0x55882b){_0x55882b=_0x55882b||0x1f4;return function(_0x16fbc){logger[_0xcfd9('0x24')](_0x16fbc['stack']);if(_0x16fbc[_0xcfd9('0x25')]){delete _0x16fbc[_0xcfd9('0x25')];}_0x3f706b['status'](_0x55882b)[_0xcfd9('0x26')](_0x16fbc);};}exports['index']=function(_0x38d816,_0x1c9443){var _0xa96cbc={},_0x5c2d0c={},_0x55eba0={'count':0x0,'rows':[]};var _0x5655a0=_['map'](db[_0xcfd9('0x27')]['rawAttributes'],function(_0x4bbe2){return{'name':_0x4bbe2[_0xcfd9('0x28')],'type':_0x4bbe2['type']['key']};});_0x5c2d0c[_0xcfd9('0x29')]=_[_0xcfd9('0x2a')](_0x5655a0,_0xcfd9('0x25'));_0x5c2d0c[_0xcfd9('0x2b')]=_[_0xcfd9('0x2c')](_0x38d816[_0xcfd9('0x2b')]);_0x5c2d0c['filters']=_['intersection'](_0x5c2d0c['model'],_0x5c2d0c[_0xcfd9('0x2b')]);_0xa96cbc[_0xcfd9('0x2d')]=_['intersection'](_0x5c2d0c[_0xcfd9('0x29')],qs[_0xcfd9('0x2e')](_0x38d816[_0xcfd9('0x2b')][_0xcfd9('0x2e')]));_0xa96cbc[_0xcfd9('0x2d')]=_0xa96cbc[_0xcfd9('0x2d')][_0xcfd9('0x2f')]?_0xa96cbc[_0xcfd9('0x2d')]:_0x5c2d0c[_0xcfd9('0x29')];if(!_0x38d816[_0xcfd9('0x2b')][_0xcfd9('0x30')](_0xcfd9('0x31'))){_0xa96cbc[_0xcfd9('0x1b')]=qs[_0xcfd9('0x1b')](_0x38d816[_0xcfd9('0x2b')][_0xcfd9('0x1b')]);_0xa96cbc[_0xcfd9('0x19')]=qs[_0xcfd9('0x19')](_0x38d816[_0xcfd9('0x2b')][_0xcfd9('0x19')]);}_0xa96cbc[_0xcfd9('0x32')]=qs[_0xcfd9('0x33')](_0x38d816[_0xcfd9('0x2b')][_0xcfd9('0x33')]);_0xa96cbc[_0xcfd9('0x34')]=qs[_0xcfd9('0x35')](_[_0xcfd9('0x36')](_0x38d816[_0xcfd9('0x2b')],_0x5c2d0c[_0xcfd9('0x35')]),_0x5655a0);if(_0x38d816[_0xcfd9('0x2b')]['filter']){_0xa96cbc[_0xcfd9('0x34')]=_['merge'](_0xa96cbc[_0xcfd9('0x34')],{'$or':_[_0xcfd9('0x2a')](_0x5655a0,function(_0x5189d2){if(_0x5189d2[_0xcfd9('0x37')]!==_0xcfd9('0x38')){var _0x58a2af={};_0x58a2af[_0x5189d2['name']]={'$like':'%'+_0x38d816[_0xcfd9('0x2b')][_0xcfd9('0x39')]+'%'};return _0x58a2af;}})});}_0xa96cbc=_[_0xcfd9('0x3a')]({},_0xa96cbc,_0x38d816[_0xcfd9('0x3b')]);var _0x3e2c9f={'where':_0xa96cbc[_0xcfd9('0x34')]};return db[_0xcfd9('0x27')][_0xcfd9('0x3c')](_0x3e2c9f)[_0xcfd9('0x22')](function(_0x3c21e5){_0x55eba0[_0xcfd9('0x3c')]=_0x3c21e5;if(_0x38d816[_0xcfd9('0x2b')][_0xcfd9('0x3d')]){_0xa96cbc['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0xcfd9('0x3e')](_0xa96cbc);})[_0xcfd9('0x22')](function(_0x3d99e3){_0x55eba0[_0xcfd9('0x3f')]=_0x3d99e3;return _0x55eba0;})[_0xcfd9('0x22')](respondWithFilteredResult(_0x1c9443,_0xa96cbc))[_0xcfd9('0x40')](handleError(_0x1c9443,null));};exports['show']=function(_0x162968,_0x34acd3){var _0x4634e4={'raw':!![],'where':{'id':_0x162968[_0xcfd9('0x41')]['id']}},_0x4ec932={};_0x4ec932[_0xcfd9('0x29')]=_[_0xcfd9('0x2c')](db[_0xcfd9('0x27')]['rawAttributes']);_0x4ec932['query']=_['keys'](_0x162968['query']);_0x4ec932[_0xcfd9('0x35')]=_['intersection'](_0x4ec932[_0xcfd9('0x29')],_0x4ec932['query']);_0x4634e4[_0xcfd9('0x2d')]=_[_0xcfd9('0x42')](_0x4ec932['model'],qs[_0xcfd9('0x2e')](_0x162968['query'][_0xcfd9('0x2e')]));_0x4634e4['attributes']=_0x4634e4[_0xcfd9('0x2d')]['length']?_0x4634e4[_0xcfd9('0x2d')]:_0x4ec932[_0xcfd9('0x29')];if(_0x162968[_0xcfd9('0x2b')][_0xcfd9('0x3d')]){_0x4634e4['include']=[{'all':!![]}];}_0x4634e4=_[_0xcfd9('0x3a')]({},_0x4634e4,_0x162968[_0xcfd9('0x3b')]);return db[_0xcfd9('0x27')][_0xcfd9('0x43')](_0x4634e4)[_0xcfd9('0x22')](handleEntityNotFound(_0x34acd3,null))[_0xcfd9('0x22')](respondWithResult(_0x34acd3,null))['catch'](handleError(_0x34acd3,null));};exports[_0xcfd9('0x44')]=function(_0x28d680,_0xf36334){return db[_0xcfd9('0x27')][_0xcfd9('0x44')](_0x28d680[_0xcfd9('0x45')],{})[_0xcfd9('0x22')](respondWithResult(_0xf36334,0xc9))['catch'](handleError(_0xf36334,null));};exports['update']=function(_0x59a470,_0x5283b7){if(_0x59a470[_0xcfd9('0x45')]['id']){delete _0x59a470[_0xcfd9('0x45')]['id'];}return db[_0xcfd9('0x27')][_0xcfd9('0x43')]({'where':{'id':_0x59a470[_0xcfd9('0x41')]['id']}})['then'](handleEntityNotFound(_0x5283b7,null))[_0xcfd9('0x22')](saveUpdates(_0x59a470['body'],null))[_0xcfd9('0x22')](respondWithResult(_0x5283b7,null))[_0xcfd9('0x40')](handleError(_0x5283b7,null));};exports[_0xcfd9('0x21')]=function(_0x1ca9b7,_0x37f653){return db[_0xcfd9('0x27')][_0xcfd9('0x43')]({'where':{'id':_0x1ca9b7[_0xcfd9('0x41')]['id']}})[_0xcfd9('0x22')](handleEntityNotFound(_0x37f653,null))[_0xcfd9('0x22')](removeEntity(_0x37f653,null))[_0xcfd9('0x40')](handleError(_0x37f653,null));}; \ No newline at end of file +var _0x0423=['error','name','send','index','Dynamics365Field','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','create','update','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','then','destroy'];(function(_0x345226,_0x11e2a4){var _0x19d5b2=function(_0x3ee84f){while(--_0x3ee84f){_0x345226['push'](_0x345226['shift']());}};_0x19d5b2(++_0x11e2a4);}(_0x0423,0xe8));var _0x3042=function(_0x57464e,_0x598b67){_0x57464e=_0x57464e-0x0;var _0x4af69f=_0x0423[_0x57464e];return _0x4af69f;};'use strict';var emlformat=require(_0x3042('0x0'));var rimraf=require(_0x3042('0x1'));var zipdir=require(_0x3042('0x2'));var jsonpatch=require(_0x3042('0x3'));var rp=require('request-promise');var moment=require(_0x3042('0x4'));var BPromise=require(_0x3042('0x5'));var Mustache=require('mustache');var util=require(_0x3042('0x6'));var path=require(_0x3042('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3042('0x8'));var _=require(_0x3042('0x9'));var squel=require(_0x3042('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3042('0xb'));var toCsv=require(_0x3042('0xc'));var querystring=require(_0x3042('0xd'));var Papa=require('papaparse');var Redis=require(_0x3042('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3042('0xf'));var hardwareService=require(_0x3042('0x10'));var logger=require(_0x3042('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3042('0x12'));var db=require(_0x3042('0x13'))['db'];function respondWithStatusCode(_0x4b69e0,_0x5b488c){_0x5b488c=_0x5b488c||0xcc;return function(_0x314fc5){if(_0x314fc5){return _0x4b69e0[_0x3042('0x14')](_0x5b488c);}return _0x4b69e0[_0x3042('0x15')](_0x5b488c)[_0x3042('0x16')]();};}function respondWithResult(_0x43238e,_0x381ad4){_0x381ad4=_0x381ad4||0xc8;return function(_0xaa6ea){if(_0xaa6ea){return _0x43238e[_0x3042('0x15')](_0x381ad4)[_0x3042('0x17')](_0xaa6ea);}};}function respondWithFilteredResult(_0xa23ad9,_0x18327c){return function(_0x4e3e80){if(_0x4e3e80){var _0x2629c9=typeof _0x18327c['offset']===_0x3042('0x18')&&typeof _0x18327c[_0x3042('0x19')]==='undefined';var _0x1cdd12=_0x4e3e80['count'];var _0x408d44=_0x2629c9?0x0:_0x18327c[_0x3042('0x1a')];var _0x578d45=_0x2629c9?_0x4e3e80[_0x3042('0x1b')]:_0x18327c['offset']+_0x18327c[_0x3042('0x19')];var _0x14df98;if(_0x578d45>=_0x1cdd12){_0x578d45=_0x1cdd12;_0x14df98=0xc8;}else{_0x14df98=0xce;}_0xa23ad9['status'](_0x14df98);return _0xa23ad9['set']('Content-Range',_0x408d44+'-'+_0x578d45+'/'+_0x1cdd12)[_0x3042('0x17')](_0x4e3e80);}return null;};}function patchUpdates(_0xc3e461){return function(_0x5dd239){try{jsonpatch[_0x3042('0x1c')](_0x5dd239,_0xc3e461,!![]);}catch(_0x5517bd){return BPromise[_0x3042('0x1d')](_0x5517bd);}return _0x5dd239['save']();};}function saveUpdates(_0x27ea33,_0x544154){return function(_0xcb0db9){if(_0xcb0db9){return _0xcb0db9['update'](_0x27ea33)[_0x3042('0x1e')](function(_0x1e2c0f){return _0x1e2c0f;});}return null;};}function removeEntity(_0x5994f3,_0x46fa0a){return function(_0x4714a4){if(_0x4714a4){return _0x4714a4[_0x3042('0x1f')]()[_0x3042('0x1e')](function(){_0x5994f3[_0x3042('0x15')](0xcc)[_0x3042('0x16')]();});}};}function handleEntityNotFound(_0x739636,_0x3e6516){return function(_0x6d8cce){if(!_0x6d8cce){_0x739636[_0x3042('0x14')](0x194);}return _0x6d8cce;};}function handleError(_0x539464,_0x5e4521){_0x5e4521=_0x5e4521||0x1f4;return function(_0x187f72){logger[_0x3042('0x20')](_0x187f72['stack']);if(_0x187f72[_0x3042('0x21')]){delete _0x187f72[_0x3042('0x21')];}_0x539464[_0x3042('0x15')](_0x5e4521)[_0x3042('0x22')](_0x187f72);};}exports[_0x3042('0x23')]=function(_0x5eb0da,_0x55deb6){var _0x21a534={},_0x1f3886={},_0x4c5961={'count':0x0,'rows':[]};var _0x269f27=_['map'](db[_0x3042('0x24')]['rawAttributes'],function(_0x55f24e){return{'name':_0x55f24e['fieldName'],'type':_0x55f24e['type']['key']};});_0x1f3886[_0x3042('0x25')]=_[_0x3042('0x26')](_0x269f27,_0x3042('0x21'));_0x1f3886[_0x3042('0x27')]=_[_0x3042('0x28')](_0x5eb0da[_0x3042('0x27')]);_0x1f3886['filters']=_[_0x3042('0x29')](_0x1f3886[_0x3042('0x25')],_0x1f3886['query']);_0x21a534['attributes']=_[_0x3042('0x29')](_0x1f3886[_0x3042('0x25')],qs[_0x3042('0x2a')](_0x5eb0da['query'][_0x3042('0x2a')]));_0x21a534[_0x3042('0x2b')]=_0x21a534['attributes'][_0x3042('0x2c')]?_0x21a534[_0x3042('0x2b')]:_0x1f3886['model'];if(!_0x5eb0da[_0x3042('0x27')][_0x3042('0x2d')](_0x3042('0x2e'))){_0x21a534['limit']=qs[_0x3042('0x19')](_0x5eb0da[_0x3042('0x27')][_0x3042('0x19')]);_0x21a534[_0x3042('0x1a')]=qs[_0x3042('0x1a')](_0x5eb0da[_0x3042('0x27')][_0x3042('0x1a')]);}_0x21a534['order']=qs[_0x3042('0x2f')](_0x5eb0da[_0x3042('0x27')][_0x3042('0x2f')]);_0x21a534[_0x3042('0x30')]=qs[_0x3042('0x31')](_[_0x3042('0x32')](_0x5eb0da[_0x3042('0x27')],_0x1f3886[_0x3042('0x31')]),_0x269f27);if(_0x5eb0da[_0x3042('0x27')]['filter']){_0x21a534[_0x3042('0x30')]=_[_0x3042('0x33')](_0x21a534[_0x3042('0x30')],{'$or':_[_0x3042('0x26')](_0x269f27,function(_0x103c93){if(_0x103c93[_0x3042('0x34')]!==_0x3042('0x35')){var _0x9a85b2={};_0x9a85b2[_0x103c93[_0x3042('0x21')]]={'$like':'%'+_0x5eb0da[_0x3042('0x27')]['filter']+'%'};return _0x9a85b2;}})});}_0x21a534=_[_0x3042('0x33')]({},_0x21a534,_0x5eb0da[_0x3042('0x36')]);var _0x338931={'where':_0x21a534['where']};return db[_0x3042('0x24')][_0x3042('0x1b')](_0x338931)[_0x3042('0x1e')](function(_0x15ff82){_0x4c5961['count']=_0x15ff82;if(_0x5eb0da[_0x3042('0x27')]['includeAll']){_0x21a534['include']=[{'all':!![]}];}return db[_0x3042('0x24')][_0x3042('0x37')](_0x21a534);})[_0x3042('0x1e')](function(_0x3fa2c6){_0x4c5961[_0x3042('0x38')]=_0x3fa2c6;return _0x4c5961;})['then'](respondWithFilteredResult(_0x55deb6,_0x21a534))[_0x3042('0x39')](handleError(_0x55deb6,null));};exports[_0x3042('0x3a')]=function(_0xe3275b,_0x3fd15e){var _0x57a6ef={'raw':!![],'where':{'id':_0xe3275b['params']['id']}},_0x504bfd={};_0x504bfd[_0x3042('0x25')]=_[_0x3042('0x28')](db[_0x3042('0x24')]['rawAttributes']);_0x504bfd['query']=_[_0x3042('0x28')](_0xe3275b[_0x3042('0x27')]);_0x504bfd['filters']=_[_0x3042('0x29')](_0x504bfd['model'],_0x504bfd[_0x3042('0x27')]);_0x57a6ef[_0x3042('0x2b')]=_[_0x3042('0x29')](_0x504bfd[_0x3042('0x25')],qs[_0x3042('0x2a')](_0xe3275b[_0x3042('0x27')]['fields']));_0x57a6ef[_0x3042('0x2b')]=_0x57a6ef[_0x3042('0x2b')][_0x3042('0x2c')]?_0x57a6ef['attributes']:_0x504bfd[_0x3042('0x25')];if(_0xe3275b[_0x3042('0x27')][_0x3042('0x3b')]){_0x57a6ef[_0x3042('0x3c')]=[{'all':!![]}];}_0x57a6ef=_[_0x3042('0x33')]({},_0x57a6ef,_0xe3275b[_0x3042('0x36')]);return db[_0x3042('0x24')]['find'](_0x57a6ef)[_0x3042('0x1e')](handleEntityNotFound(_0x3fd15e,null))['then'](respondWithResult(_0x3fd15e,null))['catch'](handleError(_0x3fd15e,null));};exports[_0x3042('0x3d')]=function(_0x5ef8d3,_0x456b36){return db[_0x3042('0x24')][_0x3042('0x3d')](_0x5ef8d3['body'],{})['then'](respondWithResult(_0x456b36,0xc9))['catch'](handleError(_0x456b36,null));};exports[_0x3042('0x3e')]=function(_0x3569bf,_0x2daa5a){if(_0x3569bf[_0x3042('0x3f')]['id']){delete _0x3569bf[_0x3042('0x3f')]['id'];}return db['Dynamics365Field'][_0x3042('0x40')]({'where':{'id':_0x3569bf[_0x3042('0x41')]['id']}})[_0x3042('0x1e')](handleEntityNotFound(_0x2daa5a,null))[_0x3042('0x1e')](saveUpdates(_0x3569bf[_0x3042('0x3f')],null))[_0x3042('0x1e')](respondWithResult(_0x2daa5a,null))['catch'](handleError(_0x2daa5a,null));};exports['destroy']=function(_0x1c1f9e,_0x248fd3){return db[_0x3042('0x24')][_0x3042('0x40')]({'where':{'id':_0x1c1f9e[_0x3042('0x41')]['id']}})[_0x3042('0x1e')](handleEntityNotFound(_0x248fd3,null))[_0x3042('0x1e')](removeEntity(_0x248fd3,null))[_0x3042('0x39')](handleError(_0x248fd3,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 1c02417..6ddabb4 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 _0x6e53=['path','rimraf','../../config/environment','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','api','moment','bluebird','request-promise'];(function(_0x20bfbc,_0x4d6306){var _0x530496=function(_0x2cb5fa){while(--_0x2cb5fa){_0x20bfbc['push'](_0x20bfbc['shift']());}};_0x530496(++_0x4d6306);}(_0x6e53,0x1dd));var _0x36e5=function(_0x2d1d37,_0x1048d8){_0x2d1d37=_0x2d1d37-0x0;var _0x3e9649=_0x6e53[_0x2d1d37];return _0x3e9649;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x36e5('0x0'));var moment=require(_0x36e5('0x1'));var BPromise=require(_0x36e5('0x2'));var rp=require(_0x36e5('0x3'));var fs=require('fs');var path=require(_0x36e5('0x4'));var rimraf=require(_0x36e5('0x5'));var config=require(_0x36e5('0x6'));var attributes=require('./intDynamics365Field.attributes');module[_0x36e5('0x7')]=function(_0x4ce358,_0x382ebe){return _0x4ce358['define'](_0x36e5('0x8'),attributes,{'tableName':_0x36e5('0x9'),'paranoid':![],'indexes':[{'name':_0x36e5('0xa'),'fields':[_0x36e5('0xb'),_0x36e5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7277=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','Dynamics365Field','int_dynamics365_fields','idField'];(function(_0x117dc6,_0x28f8b8){var _0x1f78a3=function(_0x432041){while(--_0x432041){_0x117dc6['push'](_0x117dc6['shift']());}};_0x1f78a3(++_0x28f8b8);}(_0x7277,0x15e));var _0x7727=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7277[_0xa8883];return _0x479426;};'use strict';var _=require(_0x7727('0x0'));var util=require(_0x7727('0x1'));var logger=require(_0x7727('0x2'))(_0x7727('0x3'));var moment=require(_0x7727('0x4'));var BPromise=require(_0x7727('0x5'));var rp=require(_0x7727('0x6'));var fs=require('fs');var path=require(_0x7727('0x7'));var rimraf=require(_0x7727('0x8'));var config=require(_0x7727('0x9'));var attributes=require(_0x7727('0xa'));module['exports']=function(_0x4950af,_0x2a58c2){return _0x4950af['define'](_0x7727('0xb'),attributes,{'tableName':_0x7727('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x7727('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index fe99b0f..9b0221c 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 _0x974b=['../../config/environment','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x5ea757,_0x51e935){var _0xcd5209=function(_0xef1de1){while(--_0xef1de1){_0x5ea757['push'](_0x5ea757['shift']());}};_0xcd5209(++_0x51e935);}(_0x974b,0x1e0));var _0xb974=function(_0x425d5e,_0x3b9040){_0x425d5e=_0x425d5e-0x0;var _0x3cc67b=_0x974b[_0x425d5e];return _0x3cc67b;};'use strict';var _=require(_0xb974('0x0'));var util=require(_0xb974('0x1'));var moment=require('moment');var BPromise=require(_0xb974('0x2'));var rs=require(_0xb974('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb974('0x4'))['db'];var utils=require(_0xb974('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb974('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb974('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x28b9bb,_0x1522c5,_0x27751d){return new BPromise(function(_0x960496,_0x47973e){return client[_0xb974('0x8')](_0x28b9bb,_0x27751d)[_0xb974('0x9')](function(_0x429636){logger[_0xb974('0xa')](_0xb974('0xb'),_0x1522c5,_0xb974('0xc'));logger['debug']('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x1522c5,_0xb974('0xc'),JSON[_0xb974('0xd')](_0x429636));if(_0x429636['error']){if(_0x429636[_0xb974('0xe')]['code']===0x1f4){logger[_0xb974('0xe')](_0xb974('0xb'),_0x1522c5,_0x429636['error'][_0xb974('0xf')]);return _0x47973e(_0x429636[_0xb974('0xe')]['message']);}logger[_0xb974('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x1522c5,_0x429636[_0xb974('0xe')][_0xb974('0xf')]);return _0x960496(_0x429636['error'][_0xb974('0xf')]);}else{logger[_0xb974('0xa')]('Dynamics365Field,\x20%s,\x20%s',_0x1522c5,'request\x20sent');_0x960496(_0x429636[_0xb974('0x10')][_0xb974('0xf')]);}})[_0xb974('0x11')](function(_0x547a2a){logger[_0xb974('0xe')](_0xb974('0xb'),_0x1522c5,_0x547a2a);_0x47973e(_0x547a2a);});});} \ No newline at end of file +var _0xf33a=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','message','info','result','util'];(function(_0x21d7b6,_0x3cd447){var _0x4742b1=function(_0x48d5b4){while(--_0x48d5b4){_0x21d7b6['push'](_0x21d7b6['shift']());}};_0x4742b1(++_0x3cd447);}(_0xf33a,0x1df));var _0xaf33=function(_0x5f2961,_0x377121){_0x5f2961=_0x5f2961-0x0;var _0xe5eb6b=_0xf33a[_0x5f2961];return _0xe5eb6b;};'use strict';var _=require('lodash');var util=require(_0xaf33('0x0'));var moment=require(_0xaf33('0x1'));var BPromise=require(_0xaf33('0x2'));var rs=require(_0xaf33('0x3'));var fs=require('fs');var Redis=require(_0xaf33('0x4'));var db=require(_0xaf33('0x5'))['db'];var utils=require(_0xaf33('0x6'));var logger=require(_0xaf33('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf33('0x8')][_0xaf33('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20e354,_0x21a935,_0x4e36c5){return new BPromise(function(_0x1c602f,_0x4f6fb1){return client[_0xaf33('0xa')](_0x20e354,_0x4e36c5)[_0xaf33('0xb')](function(_0x4e55ed){logger['info'](_0xaf33('0xc'),_0x21a935,_0xaf33('0xd'));logger[_0xaf33('0xe')](_0xaf33('0xf'),_0x21a935,_0xaf33('0xd'),JSON['stringify'](_0x4e55ed));if(_0x4e55ed[_0xaf33('0x10')]){if(_0x4e55ed[_0xaf33('0x10')]['code']===0x1f4){logger[_0xaf33('0x10')](_0xaf33('0xc'),_0x21a935,_0x4e55ed[_0xaf33('0x10')][_0xaf33('0x11')]);return _0x4f6fb1(_0x4e55ed[_0xaf33('0x10')][_0xaf33('0x11')]);}logger[_0xaf33('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x21a935,_0x4e55ed[_0xaf33('0x10')][_0xaf33('0x11')]);return _0x1c602f(_0x4e55ed['error'][_0xaf33('0x11')]);}else{logger[_0xaf33('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x21a935,_0xaf33('0xd'));_0x1c602f(_0x4e55ed[_0xaf33('0x13')][_0xaf33('0x11')]);}})['catch'](function(_0x2604c3){logger[_0xaf33('0x10')](_0xaf33('0xc'),_0x21a935,_0x2604c3);_0x4f6fb1(_0x2604c3);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 50a77c6..634fa8f 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 _0x18de=['addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getFields','post'];(function(_0x4cb433,_0x46d52d){var _0x1589a5=function(_0x2a1a3d){while(--_0x2a1a3d){_0x4cb433['push'](_0x4cb433['shift']());}};_0x1589a5(++_0x46d52d);}(_0x18de,0x116));var _0xe18d=function(_0x56791a,_0x36ddb0){_0x56791a=_0x56791a-0x0;var _0x2771ff=_0x18de[_0x56791a];return _0x2771ff;};'use strict';var multer=require(_0xe18d('0x0'));var util=require('util');var path=require(_0xe18d('0x1'));var timeout=require(_0xe18d('0x2'));var express=require(_0xe18d('0x3'));var router=express['Router']();var fs_extra=require(_0xe18d('0x4'));var auth=require(_0xe18d('0x5'));var interaction=require(_0xe18d('0x6'));var config=require(_0xe18d('0x7'));var controller=require(_0xe18d('0x8'));router[_0xe18d('0x9')]('/',auth[_0xe18d('0xa')](),controller[_0xe18d('0xb')]);router[_0xe18d('0x9')](_0xe18d('0xc'),auth[_0xe18d('0xa')](),controller[_0xe18d('0xd')]);router[_0xe18d('0x9')]('/:id/configurations',auth[_0xe18d('0xa')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xe18d('0xa')](),controller[_0xe18d('0xe')]);router['post']('/',auth[_0xe18d('0xa')](),controller['create']);router[_0xe18d('0xf')]('/:id/configurations',auth[_0xe18d('0xa')](),controller[_0xe18d('0x10')]);router['put'](_0xe18d('0xc'),auth['isAuthenticated'](),controller[_0xe18d('0x11')]);router[_0xe18d('0x12')]('/:id',auth[_0xe18d('0xa')](),controller[_0xe18d('0x13')]);module[_0xe18d('0x14')]=router; \ No newline at end of file +var _0xfb36=['getFields','post','create','addConfiguration','put','update','delete','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xfb36,0x7a));var _0x6fb3=function(_0x5c9baf,_0x547384){_0x5c9baf=_0x5c9baf-0x0;var _0x22b576=_0xfb36[_0x5c9baf];return _0x22b576;};'use strict';var multer=require(_0x6fb3('0x0'));var util=require(_0x6fb3('0x1'));var path=require('path');var timeout=require(_0x6fb3('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6fb3('0x3'));var auth=require(_0x6fb3('0x4'));var interaction=require(_0x6fb3('0x5'));var config=require(_0x6fb3('0x6'));var controller=require(_0x6fb3('0x7'));router[_0x6fb3('0x8')]('/',auth[_0x6fb3('0x9')](),controller[_0x6fb3('0xa')]);router[_0x6fb3('0x8')](_0x6fb3('0xb'),auth[_0x6fb3('0x9')](),controller[_0x6fb3('0xc')]);router['get'](_0x6fb3('0xd'),auth[_0x6fb3('0x9')](),controller[_0x6fb3('0xe')]);router['get'](_0x6fb3('0xf'),auth[_0x6fb3('0x9')](),controller[_0x6fb3('0x10')]);router[_0x6fb3('0x11')]('/',auth['isAuthenticated'](),controller[_0x6fb3('0x12')]);router['post'](_0x6fb3('0xd'),auth['isAuthenticated'](),controller[_0x6fb3('0x13')]);router[_0x6fb3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6fb3('0x15')]);router[_0x6fb3('0x16')](_0x6fb3('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 800cd68..b7e6322 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 _0xdd4f=['username','remoteUri','sequelize','STRING'];(function(_0x3875b1,_0x47cf1a){var _0x1e9c55=function(_0xc8e89b){while(--_0xc8e89b){_0x3875b1['push'](_0x3875b1['shift']());}};_0x1e9c55(++_0x47cf1a);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x25a4e5,_0x48bfe6){_0x25a4e5=_0x25a4e5-0x0;var _0x41111d=_0xdd4f[_0x25a4e5];return _0x41111d;};'use strict';var Sequelize=require(_0xfdd4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfdd4('0x1')],'unique':_0xfdd4('0x3')},'serverUrl':{'type':Sequelize[_0xfdd4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xfcbb=['exports','STRING','username','remoteUri','sequelize'];(function(_0x529739,_0x21a3dd){var _0x5b6951=function(_0x367a7a){while(--_0x367a7a){_0x529739['push'](_0x529739['shift']());}};_0x5b6951(++_0x21a3dd);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x5b95ef,_0x1cbf0b){_0x5b95ef=_0x5b95ef-0x0;var _0x36d8d4=_0xfcbb[_0x5b95ef];return _0x36d8d4;};'use strict';var Sequelize=require(_0xbfcb('0x0'));module[_0xbfcb('0x1')]={'name':{'type':Sequelize[_0xbfcb('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xbfcb('0x3')},'apiKey':{'type':Sequelize[_0xbfcb('0x2')]},'remoteUri':{'type':Sequelize[_0xbfcb('0x2')],'unique':_0xbfcb('0x4')},'serverUrl':{'type':Sequelize[_0xbfcb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 10b94ab..d7f1c68 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 _0x1d2d=['source','ticket_type','company','remove','default','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','then','destroy','error','stack','send','index','FreshdeskAccount','rawAttributes','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','filter','options','findAll','catch','includeAll','find','create','body','params','getConfigurations','FreshdeskConfiguration','hasOwnProperty','findOne','AccountId','Subjects','getSubjects','channel','FreshdeskField','Descriptions','remoteUri','slice','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','apiKey','toString','base64','requester','subject','agent','description','priority','group'];(function(_0x12afb6,_0x5ee0c1){var _0x59cf12=function(_0x528db6){while(--_0x528db6){_0x12afb6['push'](_0x12afb6['shift']());}};_0x59cf12(++_0x5ee0c1);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x1dbcba,_0x1c889b){_0x1dbcba=_0x1dbcba-0x0;var _0x166971=_0x1d2d[_0x1dbcba];return _0x166971;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];var integrations=require(_0xd1d2('0x1b'));function respondWithStatusCode(_0x129d8f,_0xc3ee82){_0xc3ee82=_0xc3ee82||0xcc;return function(_0x2df8a5){if(_0x2df8a5){return _0x129d8f[_0xd1d2('0x1c')](_0xc3ee82);}return _0x129d8f[_0xd1d2('0x1d')](_0xc3ee82)[_0xd1d2('0x1e')]();};}function respondWithResult(_0x4cf702,_0x2e7fec){_0x2e7fec=_0x2e7fec||0xc8;return function(_0x3c0296){if(_0x3c0296){return _0x4cf702[_0xd1d2('0x1d')](_0x2e7fec)['json'](_0x3c0296);}};}function respondWithFilteredResult(_0x35381b,_0xc36ce){return function(_0x208425){if(_0x208425){var _0x2f4cf9=typeof _0xc36ce[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0xc36ce[_0xd1d2('0x21')]==='undefined';var _0x539d5a=_0x208425[_0xd1d2('0x22')];var _0x55320b=_0x2f4cf9?0x0:_0xc36ce[_0xd1d2('0x1f')];var _0x42565b=_0x2f4cf9?_0x208425[_0xd1d2('0x22')]:_0xc36ce[_0xd1d2('0x1f')]+_0xc36ce['limit'];var _0x4f1201;if(_0x42565b>=_0x539d5a){_0x42565b=_0x539d5a;_0x4f1201=0xc8;}else{_0x4f1201=0xce;}_0x35381b[_0xd1d2('0x1d')](_0x4f1201);return _0x35381b['set']('Content-Range',_0x55320b+'-'+_0x42565b+'/'+_0x539d5a)[_0xd1d2('0x23')](_0x208425);}return null;};}function patchUpdates(_0x27e26b){return function(_0x3414ce){try{jsonpatch[_0xd1d2('0x24')](_0x3414ce,_0x27e26b,!![]);}catch(_0x596cd8){return BPromise[_0xd1d2('0x25')](_0x596cd8);}return _0x3414ce[_0xd1d2('0x26')]();};}function saveUpdates(_0x24b8db,_0x4eb082){return function(_0x59e72c){if(_0x59e72c){return _0x59e72c[_0xd1d2('0x27')](_0x24b8db)[_0xd1d2('0x28')](function(_0x19d535){return _0x19d535;});}return null;};}function removeEntity(_0x2f92ee,_0x3f229c){return function(_0x33a171){if(_0x33a171){return _0x33a171[_0xd1d2('0x29')]()['then'](function(){_0x2f92ee[_0xd1d2('0x1d')](0xcc)[_0xd1d2('0x1e')]();});}};}function handleEntityNotFound(_0x41330f,_0x2e1709){return function(_0x5d3ee1){if(!_0x5d3ee1){_0x41330f[_0xd1d2('0x1c')](0x194);}return _0x5d3ee1;};}function handleError(_0x28b8be,_0x34faf7){_0x34faf7=_0x34faf7||0x1f4;return function(_0xe6ef3c){logger[_0xd1d2('0x2a')](_0xe6ef3c[_0xd1d2('0x2b')]);if(_0xe6ef3c['name']){delete _0xe6ef3c['name'];}_0x28b8be[_0xd1d2('0x1d')](_0x34faf7)[_0xd1d2('0x2c')](_0xe6ef3c);};}exports[_0xd1d2('0x2d')]=function(_0x2b4c1f,_0xc815ea){var _0x48ade1={},_0x39d694={},_0x41171c={'count':0x0,'rows':[]};var _0x383947=_['map'](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')],function(_0xbd855a){return{'name':_0xbd855a['fieldName'],'type':_0xbd855a[_0xd1d2('0x30')][_0xd1d2('0x31')]};});_0x39d694[_0xd1d2('0x32')]=_[_0xd1d2('0x33')](_0x383947,_0xd1d2('0x34'));_0x39d694[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0x2b4c1f[_0xd1d2('0x35')]);_0x39d694[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],_0x39d694[_0xd1d2('0x35')]);_0x48ade1[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x39d694[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x48ade1['attributes']=_0x48ade1[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x48ade1[_0xd1d2('0x39')]:_0x39d694['model'];if(!_0x2b4c1f[_0xd1d2('0x35')]['hasOwnProperty']('nolimit')){_0x48ade1[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x21')]);_0x48ade1[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x2b4c1f['query'][_0xd1d2('0x1f')]);}_0x48ade1[_0xd1d2('0x3c')]=qs['sort'](_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x48ade1[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0x2b4c1f['query'],_0x39d694[_0xd1d2('0x37')]),_0x383947);if(_0x2b4c1f['query']['filter']){_0x48ade1['where']=_[_0xd1d2('0x3f')](_0x48ade1['where'],{'$or':_[_0xd1d2('0x33')](_0x383947,function(_0x4e7640){if(_0x4e7640['type']!=='VIRTUAL'){var _0x2dabfa={};_0x2dabfa[_0x4e7640[_0xd1d2('0x34')]]={'$like':'%'+_0x2b4c1f[_0xd1d2('0x35')][_0xd1d2('0x40')]+'%'};return _0x2dabfa;}})});}_0x48ade1=_[_0xd1d2('0x3f')]({},_0x48ade1,_0x2b4c1f[_0xd1d2('0x41')]);var _0x178f8b={'where':_0x48ade1[_0xd1d2('0x3e')]};return db[_0xd1d2('0x2e')][_0xd1d2('0x22')](_0x178f8b)[_0xd1d2('0x28')](function(_0x1fb5b5){_0x41171c[_0xd1d2('0x22')]=_0x1fb5b5;if(_0x2b4c1f[_0xd1d2('0x35')]['includeAll']){_0x48ade1['include']=[{'all':!![]}];}return db[_0xd1d2('0x2e')][_0xd1d2('0x42')](_0x48ade1);})[_0xd1d2('0x28')](function(_0x4d0fd9){_0x41171c['rows']=_0x4d0fd9;return _0x41171c;})[_0xd1d2('0x28')](respondWithFilteredResult(_0xc815ea,_0x48ade1))[_0xd1d2('0x43')](handleError(_0xc815ea,null));};exports['show']=function(_0x2fe92a,_0x4c5d49){var _0x5a3790={'raw':![],'where':{'id':_0x2fe92a['params']['id']}},_0x21eb24={};_0x21eb24['model']=_[_0xd1d2('0x36')](db[_0xd1d2('0x2e')][_0xd1d2('0x2f')]);_0x21eb24['query']=_[_0xd1d2('0x36')](_0x2fe92a[_0xd1d2('0x35')]);_0x21eb24[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x21eb24['model'],_0x21eb24[_0xd1d2('0x35')]);_0x5a3790[_0xd1d2('0x39')]=_['intersection'](_0x21eb24[_0xd1d2('0x32')],qs['fields'](_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x5a3790[_0xd1d2('0x39')]=_0x5a3790[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x5a3790['attributes']:_0x21eb24['model'];if(_0x2fe92a[_0xd1d2('0x35')][_0xd1d2('0x44')]){_0x5a3790['include']=[{'all':!![]}];}_0x5a3790=_[_0xd1d2('0x3f')]({},_0x5a3790,_0x2fe92a[_0xd1d2('0x41')]);return db[_0xd1d2('0x2e')][_0xd1d2('0x45')](_0x5a3790)[_0xd1d2('0x28')](handleEntityNotFound(_0x4c5d49,null))[_0xd1d2('0x28')](respondWithResult(_0x4c5d49,null))[_0xd1d2('0x43')](handleError(_0x4c5d49,null));};exports['create']=function(_0xed9e9,_0xc10c10){return db['FreshdeskAccount'][_0xd1d2('0x46')](_0xed9e9[_0xd1d2('0x47')],{})['then'](respondWithResult(_0xc10c10,0xc9))['catch'](handleError(_0xc10c10,null));};exports[_0xd1d2('0x27')]=function(_0x182ea8,_0x4cb376){if(_0x182ea8[_0xd1d2('0x47')]['id']){delete _0x182ea8[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x45')]({'where':{'id':_0x182ea8[_0xd1d2('0x48')]['id']}})['then'](handleEntityNotFound(_0x4cb376,null))['then'](saveUpdates(_0x182ea8[_0xd1d2('0x47')],null))['then'](respondWithResult(_0x4cb376,null))[_0xd1d2('0x43')](handleError(_0x4cb376,null));};exports[_0xd1d2('0x29')]=function(_0x4f4cb9,_0x389fcb){return db[_0xd1d2('0x2e')]['find']({'where':{'id':_0x4f4cb9['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x389fcb,null))[_0xd1d2('0x28')](removeEntity(_0x389fcb,null))[_0xd1d2('0x43')](handleError(_0x389fcb,null));};exports[_0xd1d2('0x49')]=function(_0xa013ce,_0x34a793,_0x1f6150){var _0x3411c8={};var _0x33e332={};var _0x5e15cb;var _0x1958f3;return db['FreshdeskAccount']['findOne']({'where':{'id':_0xa013ce[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x34a793,null))[_0xd1d2('0x28')](function(_0x47417f){if(_0x47417f){_0x5e15cb=_0x47417f;_0x33e332[_0xd1d2('0x32')]=_[_0xd1d2('0x36')](db[_0xd1d2('0x4a')][_0xd1d2('0x2f')]);_0x33e332[_0xd1d2('0x35')]=_[_0xd1d2('0x36')](_0xa013ce[_0xd1d2('0x35')]);_0x33e332[_0xd1d2('0x37')]=_[_0xd1d2('0x38')](_0x33e332['model'],_0x33e332['query']);_0x3411c8[_0xd1d2('0x39')]=_[_0xd1d2('0x38')](_0x33e332[_0xd1d2('0x32')],qs[_0xd1d2('0x3a')](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3a')]));_0x3411c8[_0xd1d2('0x39')]=_0x3411c8[_0xd1d2('0x39')][_0xd1d2('0x3b')]?_0x3411c8[_0xd1d2('0x39')]:_0x33e332[_0xd1d2('0x32')];_0x3411c8['order']=qs['sort'](_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x3d')]);_0x3411c8[_0xd1d2('0x3e')]=qs[_0xd1d2('0x37')](_['pick'](_0xa013ce[_0xd1d2('0x35')],_0x33e332[_0xd1d2('0x37')]));if(_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x40')]){_0x3411c8[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x3411c8[_0xd1d2('0x3e')],{'$or':_['map'](_0x3411c8[_0xd1d2('0x39')],function(_0x24d92c){var _0x1d8788={};_0x1d8788[_0x24d92c]={'$like':'%'+_0xa013ce['query']['filter']+'%'};return _0x1d8788;})});}_0x3411c8=_[_0xd1d2('0x3f')]({},_0x3411c8,_0xa013ce[_0xd1d2('0x41')]);return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0x598e6c){if(_0x598e6c){_0x1958f3=_0x598e6c[_0xd1d2('0x3b')];if(!_0xa013ce[_0xd1d2('0x35')][_0xd1d2('0x4b')]('nolimit')){_0x3411c8[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0xa013ce['query'][_0xd1d2('0x21')]);_0x3411c8[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0xa013ce[_0xd1d2('0x35')]['offset']);}return _0x5e15cb[_0xd1d2('0x49')](_0x3411c8);}})[_0xd1d2('0x28')](function(_0xd82d10){if(_0xd82d10){return _0xd82d10?{'count':_0x1958f3,'rows':_0xd82d10}:null;}})[_0xd1d2('0x28')](respondWithResult(_0x34a793,null))[_0xd1d2('0x43')](handleError(_0x34a793,null));};exports['addConfiguration']=function(_0x47aa13,_0x500465,_0x541676){if(_0x47aa13['body']['id']){delete _0x47aa13[_0xd1d2('0x47')]['id'];}return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x47aa13['params']['id']}})[_0xd1d2('0x28')](handleEntityNotFound(_0x500465,null))[_0xd1d2('0x28')](function(_0x22d617){if(_0x22d617){_0x47aa13['body'][_0xd1d2('0x4d')]=_0x22d617['id'];_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x4e')]=integrations[_0xd1d2('0x4f')](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13['body'][_0xd1d2('0x30')]);_0x47aa13[_0xd1d2('0x47')]['Descriptions']=integrations['getDescriptions'](_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x50')],_0x47aa13[_0xd1d2('0x47')][_0xd1d2('0x30')]);return db['FreshdeskConfiguration'][_0xd1d2('0x46')](_0x47aa13[_0xd1d2('0x47')],{'include':[{'model':db[_0xd1d2('0x51')],'as':_0xd1d2('0x4e')},{'model':db['FreshdeskField'],'as':_0xd1d2('0x52')}]});}return null;})[_0xd1d2('0x28')](respondWithResult(_0x500465,null))[_0xd1d2('0x43')](handleError(_0x500465,null));};exports['getFields']=function(_0x46ff4d,_0x1ae9af,_0x4c35cb){var _0x2175ab='';return db[_0xd1d2('0x2e')][_0xd1d2('0x4c')]({'where':{'id':_0x46ff4d[_0xd1d2('0x48')]['id']},'attributes':['id',_0xd1d2('0x53'),'apiKey']})[_0xd1d2('0x28')](handleEntityNotFound(_0x1ae9af,null))['then'](function(_0x4ec2e1){if(_0x4ec2e1){_0x2175ab=_0x4ec2e1['remoteUri'];var _0x502432=_0x2175ab[_0xd1d2('0x54')](-0x1);if(_0x502432==='/'){_0x2175ab=_0x2175ab['substring'](0x0,_0x2175ab[_0xd1d2('0x55')](_0x502432));}return rp({'method':'GET','uri':util[_0xd1d2('0x56')](_0xd1d2('0x57'),_0x2175ab,_0xd1d2('0x58')),'headers':{'Authorization':util[_0xd1d2('0x56')](_0xd1d2('0x59'),new Buffer(util[_0xd1d2('0x56')]('%s:X',_0x4ec2e1[_0xd1d2('0x5a')]))[_0xd1d2('0x5b')](_0xd1d2('0x5c')))},'json':!![]});}})[_0xd1d2('0x28')](function(_0x448134){if(_0x448134){var _0x2e8b15=[_0xd1d2('0x5d'),_0xd1d2('0x5e'),_0xd1d2('0x5f'),_0xd1d2('0x60'),'status',_0xd1d2('0x61'),_0xd1d2('0x62'),_0xd1d2('0x63'),_0xd1d2('0x64'),'group',_0xd1d2('0x65')];_[_0xd1d2('0x66')](_0x448134,function(_0xb7bf6a){return _0x2e8b15['includes'](_0xb7bf6a[_0xd1d2('0x34')])||!_0xb7bf6a[_0xd1d2('0x67')]&&_0xb7bf6a['type']!=='custom_text'&&_0xb7bf6a[_0xd1d2('0x30')]!==_0xd1d2('0x68');});return{'count':_0x448134[_0xd1d2('0x3b')],'rows':_[_0xd1d2('0x33')](_0x448134,function(_0x348b1d){return{'id':_0x348b1d[_0xd1d2('0x34')],'name':_0x348b1d[_0xd1d2('0x69')],'custom':!_0x348b1d['default'],'options':_0x348b1d[_0xd1d2('0x6a')]?_[_0xd1d2('0x33')](_0x348b1d[_0xd1d2('0x6a')],function(_0x24b8d1){return{'name':_[_0xd1d2('0x6b')](_0x24b8d1),'value':_0x24b8d1};}):[]};})};}})[_0xd1d2('0x28')](respondWithResult(_0x1ae9af,null))[_0xd1d2('0x43')](function(_0x3dbc87){var _0x44409e=_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6c')]?0x1f4:_0x3dbc87[_0xd1d2('0x6d')]||0x1f4;logger[_0xd1d2('0x2a')](_0xd1d2('0x6e'),'getFields',_0x44409e,JSON[_0xd1d2('0x6f')](_0x3dbc87));delete _0x3dbc87[_0xd1d2('0x34')];if(_0x44409e===0x191){_0x44409e=0x190;}_0x1ae9af[_0xd1d2('0x1d')](_0x44409e)[_0xd1d2('0x2c')](_0x46ff4d[_0xd1d2('0x35')][_0xd1d2('0x6c')]?{'message':_0xd1d2('0x70'),'statusCode':_0x3dbc87[_0xd1d2('0x6d')]}:_0x3dbc87);});}; \ No newline at end of file +var _0x2f38=['pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','length','include','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','Basic\x20%s','%s:X','toString','requester','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2f38,0x1a7));var _0x82f3=function(_0x391073,_0x2574ec){_0x391073=_0x391073-0x0;var _0x25ead0=_0x2f38[_0x391073];return _0x25ead0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82f3('0x1'));var rp=require(_0x82f3('0x2'));var moment=require(_0x82f3('0x3'));var BPromise=require(_0x82f3('0x4'));var Mustache=require(_0x82f3('0x5'));var util=require(_0x82f3('0x6'));var path=require('path');var sox=require(_0x82f3('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82f3('0x8'));var _=require(_0x82f3('0x9'));var squel=require(_0x82f3('0xa'));var crypto=require(_0x82f3('0xb'));var jsforce=require(_0x82f3('0xc'));var deskjs=require(_0x82f3('0xd'));var toCsv=require(_0x82f3('0xe'));var querystring=require(_0x82f3('0xf'));var Papa=require(_0x82f3('0x10'));var Redis=require(_0x82f3('0x11'));var authService=require(_0x82f3('0x12'));var qs=require(_0x82f3('0x13'));var as=require(_0x82f3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x82f3('0x15'))(_0x82f3('0x16'));var utils=require(_0x82f3('0x17'));var config=require(_0x82f3('0x18'));var licenseUtil=require(_0x82f3('0x19'));var db=require(_0x82f3('0x1a'))['db'];var integrations=require(_0x82f3('0x1b'));function respondWithStatusCode(_0x52a044,_0x561868){_0x561868=_0x561868||0xcc;return function(_0x19f218){if(_0x19f218){return _0x52a044[_0x82f3('0x1c')](_0x561868);}return _0x52a044['status'](_0x561868)[_0x82f3('0x1d')]();};}function respondWithResult(_0x2cca50,_0x3d34b2){_0x3d34b2=_0x3d34b2||0xc8;return function(_0xf7faa1){if(_0xf7faa1){return _0x2cca50[_0x82f3('0x1e')](_0x3d34b2)[_0x82f3('0x1f')](_0xf7faa1);}};}function respondWithFilteredResult(_0x4ad50f,_0x2621ae){return function(_0x2cafd6){if(_0x2cafd6){var _0x1b3b55=typeof _0x2621ae[_0x82f3('0x20')]===_0x82f3('0x21')&&typeof _0x2621ae[_0x82f3('0x22')]==='undefined';var _0x588386=_0x2cafd6[_0x82f3('0x23')];var _0x1cbb52=_0x1b3b55?0x0:_0x2621ae[_0x82f3('0x20')];var _0x404019=_0x1b3b55?_0x2cafd6[_0x82f3('0x23')]:_0x2621ae[_0x82f3('0x20')]+_0x2621ae['limit'];var _0x5e0eb7;if(_0x404019>=_0x588386){_0x404019=_0x588386;_0x5e0eb7=0xc8;}else{_0x5e0eb7=0xce;}_0x4ad50f[_0x82f3('0x1e')](_0x5e0eb7);return _0x4ad50f[_0x82f3('0x24')]('Content-Range',_0x1cbb52+'-'+_0x404019+'/'+_0x588386)['json'](_0x2cafd6);}return null;};}function patchUpdates(_0xe0c596){return function(_0xb85dff){try{jsonpatch[_0x82f3('0x25')](_0xb85dff,_0xe0c596,!![]);}catch(_0x1c7069){return BPromise[_0x82f3('0x26')](_0x1c7069);}return _0xb85dff[_0x82f3('0x27')]();};}function saveUpdates(_0x25f3b8,_0x11d076){return function(_0x507ad9){if(_0x507ad9){return _0x507ad9[_0x82f3('0x28')](_0x25f3b8)[_0x82f3('0x29')](function(_0x5ddf8c){return _0x5ddf8c;});}return null;};}function removeEntity(_0x5a5070,_0x2144a7){return function(_0x5a3982){if(_0x5a3982){return _0x5a3982[_0x82f3('0x2a')]()[_0x82f3('0x29')](function(){_0x5a5070[_0x82f3('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x402bff,_0xcd0d7){return function(_0xe66683){if(!_0xe66683){_0x402bff[_0x82f3('0x1c')](0x194);}return _0xe66683;};}function handleError(_0x3021d7,_0x48b7d3){_0x48b7d3=_0x48b7d3||0x1f4;return function(_0x405f1c){logger[_0x82f3('0x2b')](_0x405f1c[_0x82f3('0x2c')]);if(_0x405f1c['name']){delete _0x405f1c[_0x82f3('0x2d')];}_0x3021d7[_0x82f3('0x1e')](_0x48b7d3)[_0x82f3('0x2e')](_0x405f1c);};}exports[_0x82f3('0x2f')]=function(_0xf98e7f,_0x11141f){var _0x35d7c3={},_0x44f14d={},_0x1aa0e4={'count':0x0,'rows':[]};var _0x3bdc31=_[_0x82f3('0x30')](db[_0x82f3('0x31')][_0x82f3('0x32')],function(_0x1b0f43){return{'name':_0x1b0f43[_0x82f3('0x33')],'type':_0x1b0f43[_0x82f3('0x34')][_0x82f3('0x35')]};});_0x44f14d[_0x82f3('0x36')]=_[_0x82f3('0x30')](_0x3bdc31,'name');_0x44f14d[_0x82f3('0x37')]=_['keys'](_0xf98e7f[_0x82f3('0x37')]);_0x44f14d[_0x82f3('0x38')]=_[_0x82f3('0x39')](_0x44f14d[_0x82f3('0x36')],_0x44f14d[_0x82f3('0x37')]);_0x35d7c3['attributes']=_[_0x82f3('0x39')](_0x44f14d[_0x82f3('0x36')],qs[_0x82f3('0x3a')](_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x3a')]));_0x35d7c3['attributes']=_0x35d7c3[_0x82f3('0x3b')]['length']?_0x35d7c3[_0x82f3('0x3b')]:_0x44f14d['model'];if(!_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x3c')](_0x82f3('0x3d'))){_0x35d7c3['limit']=qs['limit'](_0xf98e7f['query'][_0x82f3('0x22')]);_0x35d7c3[_0x82f3('0x20')]=qs[_0x82f3('0x20')](_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x20')]);}_0x35d7c3[_0x82f3('0x3e')]=qs[_0x82f3('0x3f')](_0xf98e7f[_0x82f3('0x37')]['sort']);_0x35d7c3[_0x82f3('0x40')]=qs[_0x82f3('0x38')](_[_0x82f3('0x41')](_0xf98e7f['query'],_0x44f14d[_0x82f3('0x38')]),_0x3bdc31);if(_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x42')]){_0x35d7c3[_0x82f3('0x40')]=_['merge'](_0x35d7c3[_0x82f3('0x40')],{'$or':_[_0x82f3('0x30')](_0x3bdc31,function(_0x55a5b5){if(_0x55a5b5[_0x82f3('0x34')]!=='VIRTUAL'){var _0x1035f8={};_0x1035f8[_0x55a5b5[_0x82f3('0x2d')]]={'$like':'%'+_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x42')]+'%'};return _0x1035f8;}})});}_0x35d7c3=_[_0x82f3('0x43')]({},_0x35d7c3,_0xf98e7f[_0x82f3('0x44')]);var _0x19ac5b={'where':_0x35d7c3[_0x82f3('0x40')]};return db['FreshdeskAccount'][_0x82f3('0x23')](_0x19ac5b)['then'](function(_0x4d6df5){_0x1aa0e4[_0x82f3('0x23')]=_0x4d6df5;if(_0xf98e7f[_0x82f3('0x37')][_0x82f3('0x45')]){_0x35d7c3['include']=[{'all':!![]}];}return db[_0x82f3('0x31')][_0x82f3('0x46')](_0x35d7c3);})[_0x82f3('0x29')](function(_0x114dab){_0x1aa0e4[_0x82f3('0x47')]=_0x114dab;return _0x1aa0e4;})['then'](respondWithFilteredResult(_0x11141f,_0x35d7c3))[_0x82f3('0x48')](handleError(_0x11141f,null));};exports[_0x82f3('0x49')]=function(_0x23e765,_0xbfa034){var _0x1cc602={'raw':![],'where':{'id':_0x23e765[_0x82f3('0x4a')]['id']}},_0x20f934={};_0x20f934[_0x82f3('0x36')]=_[_0x82f3('0x4b')](db['FreshdeskAccount'][_0x82f3('0x32')]);_0x20f934[_0x82f3('0x37')]=_[_0x82f3('0x4b')](_0x23e765['query']);_0x20f934[_0x82f3('0x38')]=_[_0x82f3('0x39')](_0x20f934[_0x82f3('0x36')],_0x20f934[_0x82f3('0x37')]);_0x1cc602['attributes']=_[_0x82f3('0x39')](_0x20f934[_0x82f3('0x36')],qs['fields'](_0x23e765[_0x82f3('0x37')]['fields']));_0x1cc602[_0x82f3('0x3b')]=_0x1cc602[_0x82f3('0x3b')][_0x82f3('0x4c')]?_0x1cc602[_0x82f3('0x3b')]:_0x20f934[_0x82f3('0x36')];if(_0x23e765[_0x82f3('0x37')][_0x82f3('0x45')]){_0x1cc602[_0x82f3('0x4d')]=[{'all':!![]}];}_0x1cc602=_[_0x82f3('0x43')]({},_0x1cc602,_0x23e765[_0x82f3('0x44')]);return db[_0x82f3('0x31')][_0x82f3('0x4e')](_0x1cc602)[_0x82f3('0x29')](handleEntityNotFound(_0xbfa034,null))[_0x82f3('0x29')](respondWithResult(_0xbfa034,null))[_0x82f3('0x48')](handleError(_0xbfa034,null));};exports[_0x82f3('0x4f')]=function(_0x4aabc6,_0x5cbd4a){return db['FreshdeskAccount']['create'](_0x4aabc6['body'],{})['then'](respondWithResult(_0x5cbd4a,0xc9))['catch'](handleError(_0x5cbd4a,null));};exports[_0x82f3('0x28')]=function(_0xe1634b,_0xa9a615){if(_0xe1634b['body']['id']){delete _0xe1634b[_0x82f3('0x50')]['id'];}return db[_0x82f3('0x31')][_0x82f3('0x4e')]({'where':{'id':_0xe1634b[_0x82f3('0x4a')]['id']}})[_0x82f3('0x29')](handleEntityNotFound(_0xa9a615,null))[_0x82f3('0x29')](saveUpdates(_0xe1634b['body'],null))[_0x82f3('0x29')](respondWithResult(_0xa9a615,null))[_0x82f3('0x48')](handleError(_0xa9a615,null));};exports[_0x82f3('0x2a')]=function(_0x5dccdc,_0x381630){return db[_0x82f3('0x31')][_0x82f3('0x4e')]({'where':{'id':_0x5dccdc['params']['id']}})[_0x82f3('0x29')](handleEntityNotFound(_0x381630,null))[_0x82f3('0x29')](removeEntity(_0x381630,null))[_0x82f3('0x48')](handleError(_0x381630,null));};exports[_0x82f3('0x51')]=function(_0x16b5c8,_0x52279a,_0x29b6aa){var _0x30e55d={};var _0x8f83ac={};var _0xf2231b;var _0x116356;return db[_0x82f3('0x31')][_0x82f3('0x52')]({'where':{'id':_0x16b5c8[_0x82f3('0x4a')]['id']}})[_0x82f3('0x29')](handleEntityNotFound(_0x52279a,null))['then'](function(_0x2549ad){if(_0x2549ad){_0xf2231b=_0x2549ad;_0x8f83ac[_0x82f3('0x36')]=_[_0x82f3('0x4b')](db[_0x82f3('0x53')][_0x82f3('0x32')]);_0x8f83ac['query']=_[_0x82f3('0x4b')](_0x16b5c8[_0x82f3('0x37')]);_0x8f83ac[_0x82f3('0x38')]=_['intersection'](_0x8f83ac[_0x82f3('0x36')],_0x8f83ac[_0x82f3('0x37')]);_0x30e55d[_0x82f3('0x3b')]=_['intersection'](_0x8f83ac[_0x82f3('0x36')],qs[_0x82f3('0x3a')](_0x16b5c8['query'][_0x82f3('0x3a')]));_0x30e55d[_0x82f3('0x3b')]=_0x30e55d[_0x82f3('0x3b')][_0x82f3('0x4c')]?_0x30e55d[_0x82f3('0x3b')]:_0x8f83ac['model'];_0x30e55d[_0x82f3('0x3e')]=qs[_0x82f3('0x3f')](_0x16b5c8[_0x82f3('0x37')]['sort']);_0x30e55d[_0x82f3('0x40')]=qs['filters'](_[_0x82f3('0x41')](_0x16b5c8[_0x82f3('0x37')],_0x8f83ac['filters']));if(_0x16b5c8['query'][_0x82f3('0x42')]){_0x30e55d[_0x82f3('0x40')]=_[_0x82f3('0x43')](_0x30e55d[_0x82f3('0x40')],{'$or':_[_0x82f3('0x30')](_0x30e55d[_0x82f3('0x3b')],function(_0x38f6dd){var _0x35086c={};_0x35086c[_0x38f6dd]={'$like':'%'+_0x16b5c8[_0x82f3('0x37')][_0x82f3('0x42')]+'%'};return _0x35086c;})});}_0x30e55d=_[_0x82f3('0x43')]({},_0x30e55d,_0x16b5c8['options']);return _0xf2231b[_0x82f3('0x51')](_0x30e55d);}})[_0x82f3('0x29')](function(_0x369e2c){if(_0x369e2c){_0x116356=_0x369e2c['length'];if(!_0x16b5c8['query'][_0x82f3('0x3c')](_0x82f3('0x3d'))){_0x30e55d[_0x82f3('0x22')]=qs[_0x82f3('0x22')](_0x16b5c8['query'][_0x82f3('0x22')]);_0x30e55d[_0x82f3('0x20')]=qs['offset'](_0x16b5c8[_0x82f3('0x37')]['offset']);}return _0xf2231b['getConfigurations'](_0x30e55d);}})[_0x82f3('0x29')](function(_0x285372){if(_0x285372){return _0x285372?{'count':_0x116356,'rows':_0x285372}:null;}})['then'](respondWithResult(_0x52279a,null))['catch'](handleError(_0x52279a,null));};exports['addConfiguration']=function(_0x3d6f3b,_0x6c91a4,_0xe12c00){if(_0x3d6f3b[_0x82f3('0x50')]['id']){delete _0x3d6f3b['body']['id'];}return db[_0x82f3('0x31')][_0x82f3('0x52')]({'where':{'id':_0x3d6f3b[_0x82f3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6c91a4,null))[_0x82f3('0x29')](function(_0x364182){if(_0x364182){_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x54')]=_0x364182['id'];_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x55')]=integrations[_0x82f3('0x56')](_0x3d6f3b[_0x82f3('0x50')]['channel'],_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x34')]);_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x57')]=integrations[_0x82f3('0x58')](_0x3d6f3b[_0x82f3('0x50')][_0x82f3('0x59')],_0x3d6f3b['body'][_0x82f3('0x34')]);return db[_0x82f3('0x53')][_0x82f3('0x4f')](_0x3d6f3b['body'],{'include':[{'model':db[_0x82f3('0x5a')],'as':_0x82f3('0x55')},{'model':db[_0x82f3('0x5a')],'as':_0x82f3('0x57')}]});}return null;})[_0x82f3('0x29')](respondWithResult(_0x6c91a4,null))[_0x82f3('0x48')](handleError(_0x6c91a4,null));};exports[_0x82f3('0x5b')]=function(_0x250d31,_0x5e467d,_0x86e1c9){var _0x10f7e6='';return db[_0x82f3('0x31')]['findOne']({'where':{'id':_0x250d31[_0x82f3('0x4a')]['id']},'attributes':['id',_0x82f3('0x5c'),_0x82f3('0x5d')]})[_0x82f3('0x29')](handleEntityNotFound(_0x5e467d,null))[_0x82f3('0x29')](function(_0x41e3be){if(_0x41e3be){_0x10f7e6=_0x41e3be[_0x82f3('0x5c')];var _0x262ac9=_0x10f7e6[_0x82f3('0x5e')](-0x1);if(_0x262ac9==='/'){_0x10f7e6=_0x10f7e6[_0x82f3('0x5f')](0x0,_0x10f7e6[_0x82f3('0x60')](_0x262ac9));}return rp({'method':_0x82f3('0x61'),'uri':util[_0x82f3('0x62')](_0x82f3('0x63'),_0x10f7e6,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0x82f3('0x64'),new Buffer(util['format'](_0x82f3('0x65'),_0x41e3be[_0x82f3('0x5d')]))[_0x82f3('0x66')]('base64'))},'json':!![]});}})[_0x82f3('0x29')](function(_0x1910ba){if(_0x1910ba){var _0x3f0967=[_0x82f3('0x67'),_0x82f3('0x68'),_0x82f3('0x69'),_0x82f3('0x6a'),_0x82f3('0x1e'),_0x82f3('0x6b'),_0x82f3('0x6c'),_0x82f3('0x6d'),_0x82f3('0x6e'),_0x82f3('0x6c'),_0x82f3('0x6f')];_[_0x82f3('0x70')](_0x1910ba,function(_0x582e8f){return _0x3f0967[_0x82f3('0x71')](_0x582e8f[_0x82f3('0x2d')])||!_0x582e8f[_0x82f3('0x72')]&&_0x582e8f[_0x82f3('0x34')]!==_0x82f3('0x73')&&_0x582e8f[_0x82f3('0x34')]!==_0x82f3('0x74');});return{'count':_0x1910ba[_0x82f3('0x4c')],'rows':_[_0x82f3('0x30')](_0x1910ba,function(_0x16ab6c){return{'id':_0x16ab6c[_0x82f3('0x2d')],'name':_0x16ab6c[_0x82f3('0x75')],'custom':!_0x16ab6c[_0x82f3('0x72')],'options':_0x16ab6c['choices']?_[_0x82f3('0x30')](_0x16ab6c['choices'],function(_0x137cf3){return{'name':_[_0x82f3('0x76')](_0x137cf3),'value':_0x137cf3};}):[]};})};}})[_0x82f3('0x29')](respondWithResult(_0x5e467d,null))['catch'](function(_0x1573dc){var _0x85f2f4=_0x250d31['query']['test']?0x1f4:_0x1573dc[_0x82f3('0x77')]||0x1f4;logger[_0x82f3('0x2b')](_0x82f3('0x78'),'getFields',_0x85f2f4,JSON[_0x82f3('0x79')](_0x1573dc));delete _0x1573dc[_0x82f3('0x2d')];if(_0x85f2f4===0x191){_0x85f2f4=0x190;}_0x5e467d[_0x82f3('0x1e')](_0x85f2f4)[_0x82f3('0x2e')](_0x250d31[_0x82f3('0x37')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x1573dc['statusCode']}:_0x1573dc);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index c2176f0..164e957 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 _0x3517=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskAccount.attributes','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x2c174d,_0x354a00){var _0xb775bf=function(_0x2ca916){while(--_0x2ca916){_0x2c174d['push'](_0x2c174d['shift']());}};_0xb775bf(++_0x354a00);}(_0x3517,0xd1));var _0x7351=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x3517[_0x1627ae];return _0x34b38f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7351('0x0'))(_0x7351('0x1'));var moment=require(_0x7351('0x2'));var BPromise=require(_0x7351('0x3'));var rp=require(_0x7351('0x4'));var fs=require('fs');var path=require(_0x7351('0x5'));var rimraf=require(_0x7351('0x6'));var config=require('../../config/environment');var attributes=require(_0x7351('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1afb96,_0x5325e7){return _0x1afb96[_0x7351('0x8')](_0x7351('0x9'),attributes,{'tableName':_0x7351('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf104=['./intFreshdeskAccount.attributes','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e3099,_0x431ce0){var _0x32cbe1=function(_0x50077b){while(--_0x50077b){_0x5e3099['push'](_0x5e3099['shift']());}};_0x32cbe1(++_0x431ce0);}(_0xf104,0xfc));var _0x4f10=function(_0x476565,_0x22944d){_0x476565=_0x476565-0x0;var _0x4e8838=_0xf104[_0x476565];return _0x4e8838;};'use strict';var _=require('lodash');var util=require(_0x4f10('0x0'));var logger=require(_0x4f10('0x1'))(_0x4f10('0x2'));var moment=require('moment');var BPromise=require(_0x4f10('0x3'));var rp=require(_0x4f10('0x4'));var fs=require('fs');var path=require(_0x4f10('0x5'));var rimraf=require(_0x4f10('0x6'));var config=require(_0x4f10('0x7'));var attributes=require(_0x4f10('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x556788,_0x1e2e62){return _0x556788[_0x4f10('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 1fe5e96..687e18f 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 _0xb0e1=['FreshdeskAccount','options','raw','where','attributes','limit','map','include','model','then','ShowFreshdeskAccount','find','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetFreshdeskAccount'];(function(_0x2f678d,_0xbc405a){var _0x4799f8=function(_0x4e08e4){while(--_0x4e08e4){_0x2f678d['push'](_0x2f678d['shift']());}};_0x4799f8(++_0xbc405a);}(_0xb0e1,0xfb));var _0x1b0e=function(_0x2e9fbc,_0x143a7c){_0x2e9fbc=_0x2e9fbc-0x0;var _0x41eea8=_0xb0e1[_0x2e9fbc];return _0x41eea8;};'use strict';var _=require('lodash');var util=require(_0x1b0e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b0e('0x1'));var fs=require('fs');var Redis=require(_0x1b0e('0x2'));var db=require(_0x1b0e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1b0e('0x4'))(_0x1b0e('0x5'));var config=require(_0x1b0e('0x6'));var jayson=require(_0x1b0e('0x7'));var client=jayson[_0x1b0e('0x8')][_0x1b0e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bf5a7,_0x298793,_0x59af61){return new BPromise(function(_0x32e3e9,_0x4934e2){return client[_0x1b0e('0xa')](_0x1bf5a7,_0x59af61)['then'](function(_0x3b5843){logger['info'](_0x1b0e('0xb'),_0x298793,_0x1b0e('0xc'));logger[_0x1b0e('0xd')](_0x1b0e('0xe'),_0x298793,'request\x20sent',JSON[_0x1b0e('0xf')](_0x3b5843));if(_0x3b5843['error']){if(_0x3b5843[_0x1b0e('0x10')]['code']===0x1f4){logger[_0x1b0e('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x298793,_0x3b5843[_0x1b0e('0x10')][_0x1b0e('0x11')]);return _0x4934e2(_0x3b5843['error'][_0x1b0e('0x11')]);}logger[_0x1b0e('0x10')](_0x1b0e('0xb'),_0x298793,_0x3b5843[_0x1b0e('0x10')][_0x1b0e('0x11')]);return _0x32e3e9(_0x3b5843['error'][_0x1b0e('0x11')]);}else{logger[_0x1b0e('0x12')](_0x1b0e('0xb'),_0x298793,_0x1b0e('0xc'));_0x32e3e9(_0x3b5843[_0x1b0e('0x13')][_0x1b0e('0x11')]);}})['catch'](function(_0x5f0f7f){logger[_0x1b0e('0x10')](_0x1b0e('0xb'),_0x298793,_0x5f0f7f);_0x4934e2(_0x5f0f7f);});});}exports[_0x1b0e('0x14')]=function(_0x3f44d8){var _0x1c2ff1=this;return new Promise(function(_0x1518b7,_0x429bf8){return db[_0x1b0e('0x15')]['findAll']({'raw':_0x3f44d8[_0x1b0e('0x16')]?_0x3f44d8[_0x1b0e('0x16')][_0x1b0e('0x17')]===undefined?!![]:![]:!![],'where':_0x3f44d8['options']?_0x3f44d8[_0x1b0e('0x16')][_0x1b0e('0x18')]||null:null,'attributes':_0x3f44d8['options']?_0x3f44d8['options'][_0x1b0e('0x19')]||null:null,'limit':_0x3f44d8[_0x1b0e('0x16')]?_0x3f44d8[_0x1b0e('0x16')][_0x1b0e('0x1a')]||null:null,'include':_0x3f44d8[_0x1b0e('0x16')]?_0x3f44d8['options']['include']?_[_0x1b0e('0x1b')](_0x3f44d8[_0x1b0e('0x16')][_0x1b0e('0x1c')],function(_0x4591a4){return{'model':db[_0x4591a4['model']],'as':_0x4591a4['as'],'attributes':_0x4591a4[_0x1b0e('0x19')],'include':_0x4591a4[_0x1b0e('0x1c')]?_[_0x1b0e('0x1b')](_0x4591a4[_0x1b0e('0x1c')],function(_0x1190d8){return{'model':db[_0x1190d8[_0x1b0e('0x1d')]],'as':_0x1190d8['as'],'attributes':_0x1190d8[_0x1b0e('0x19')],'include':_0x1190d8[_0x1b0e('0x1c')]?_[_0x1b0e('0x1b')](_0x1190d8[_0x1b0e('0x1c')],function(_0x2c90e6){return{'model':db[_0x2c90e6[_0x1b0e('0x1d')]],'as':_0x2c90e6['as'],'attributes':_0x2c90e6[_0x1b0e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1b0e('0x1e')](function(_0x4199ec){logger[_0x1b0e('0x12')](_0x1b0e('0x14'),_0x3f44d8);logger[_0x1b0e('0xd')]('GetFreshdeskAccount',_0x3f44d8,JSON['stringify'](_0x4199ec));_0x1518b7(_0x4199ec);})['catch'](function(_0x212270){logger[_0x1b0e('0x10')]('GetFreshdeskAccount',_0x212270[_0x1b0e('0x11')],_0x3f44d8);_0x429bf8(_0x1c2ff1[_0x1b0e('0x10')](0x1f4,_0x212270[_0x1b0e('0x11')]));});});};exports[_0x1b0e('0x1f')]=function(_0x5c1085){var _0x4efb08=this;return new Promise(function(_0x1e378a,_0xad6085){return db['FreshdeskAccount'][_0x1b0e('0x20')]({'raw':_0x5c1085[_0x1b0e('0x16')]?_0x5c1085[_0x1b0e('0x16')][_0x1b0e('0x17')]===undefined?!![]:![]:!![],'where':_0x5c1085[_0x1b0e('0x16')]?_0x5c1085[_0x1b0e('0x16')]['where']||null:null,'attributes':_0x5c1085[_0x1b0e('0x16')]?_0x5c1085['options'][_0x1b0e('0x19')]||null:null,'include':_0x5c1085[_0x1b0e('0x16')]?_0x5c1085[_0x1b0e('0x16')][_0x1b0e('0x1c')]?_[_0x1b0e('0x1b')](_0x5c1085['options'][_0x1b0e('0x1c')],function(_0x213e84){return{'model':db[_0x213e84[_0x1b0e('0x1d')]],'as':_0x213e84['as'],'attributes':_0x213e84[_0x1b0e('0x19')],'include':_0x213e84[_0x1b0e('0x1c')]?_[_0x1b0e('0x1b')](_0x213e84[_0x1b0e('0x1c')],function(_0x2eb95d){return{'model':db[_0x2eb95d[_0x1b0e('0x1d')]],'as':_0x2eb95d['as'],'attributes':_0x2eb95d[_0x1b0e('0x19')],'include':_0x2eb95d['include']?_[_0x1b0e('0x1b')](_0x2eb95d[_0x1b0e('0x1c')],function(_0x5706e0){return{'model':db[_0x5706e0['model']],'as':_0x5706e0['as'],'attributes':_0x5706e0[_0x1b0e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1b0e('0x1e')](function(_0x44416e){logger[_0x1b0e('0x12')](_0x1b0e('0x1f'),_0x5c1085);logger[_0x1b0e('0xd')](_0x1b0e('0x1f'),_0x5c1085,JSON[_0x1b0e('0xf')](_0x44416e));_0x1e378a(_0x44416e);})[_0x1b0e('0x21')](function(_0x414ecc){logger[_0x1b0e('0x10')](_0x1b0e('0x1f'),_0x414ecc[_0x1b0e('0x11')],_0x5c1085);_0xad6085(_0x4efb08[_0x1b0e('0x10')](0x1f4,_0x414ecc[_0x1b0e('0x11')]));});});}; \ No newline at end of file +var _0x1eff=['FreshdeskAccount,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','include','model','attributes','map','debug','ShowFreshdeskAccount','find','where','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0x1eff,0xdc));var _0xf1ef=function(_0x1a87a9,_0x394c9f){_0x1a87a9=_0x1a87a9-0x0;var _0x481ee2=_0x1eff[_0x1a87a9];return _0x481ee2;};'use strict';var _=require(_0xf1ef('0x0'));var util=require('util');var moment=require(_0xf1ef('0x1'));var BPromise=require(_0xf1ef('0x2'));var rs=require(_0xf1ef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1ef('0x4'))['db'];var utils=require(_0xf1ef('0x5'));var logger=require('../../config/logger')(_0xf1ef('0x6'));var config=require(_0xf1ef('0x7'));var jayson=require(_0xf1ef('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x8b0d2f,_0x1682f1,_0x1b46bb){return new BPromise(function(_0x105d53,_0x100a1f){return client[_0xf1ef('0x9')](_0x8b0d2f,_0x1b46bb)[_0xf1ef('0xa')](function(_0x375b1c){logger['info'](_0xf1ef('0xb'),_0x1682f1,'request\x20sent');logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1682f1,'request\x20sent',JSON[_0xf1ef('0xc')](_0x375b1c));if(_0x375b1c['error']){if(_0x375b1c[_0xf1ef('0xd')][_0xf1ef('0xe')]===0x1f4){logger['error'](_0xf1ef('0xb'),_0x1682f1,_0x375b1c[_0xf1ef('0xd')][_0xf1ef('0xf')]);return _0x100a1f(_0x375b1c[_0xf1ef('0xd')][_0xf1ef('0xf')]);}logger[_0xf1ef('0xd')](_0xf1ef('0xb'),_0x1682f1,_0x375b1c['error'][_0xf1ef('0xf')]);return _0x105d53(_0x375b1c[_0xf1ef('0xd')]['message']);}else{logger[_0xf1ef('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1682f1,_0xf1ef('0x11'));_0x105d53(_0x375b1c['result'][_0xf1ef('0xf')]);}})[_0xf1ef('0x12')](function(_0xb0f621){logger[_0xf1ef('0xd')](_0xf1ef('0xb'),_0x1682f1,_0xb0f621);_0x100a1f(_0xb0f621);});});}exports[_0xf1ef('0x13')]=function(_0x2cc278){var _0x40e8fd=this;return new Promise(function(_0x39e59d,_0x44a77d){return db[_0xf1ef('0x14')][_0xf1ef('0x15')]({'raw':_0x2cc278[_0xf1ef('0x16')]?_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x17')]===undefined?!![]:![]:!![],'where':_0x2cc278[_0xf1ef('0x16')]?_0x2cc278[_0xf1ef('0x16')]['where']||null:null,'attributes':_0x2cc278[_0xf1ef('0x16')]?_0x2cc278[_0xf1ef('0x16')]['attributes']||null:null,'limit':_0x2cc278['options']?_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x18')]||null:null,'include':_0x2cc278['options']?_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x19')]?_['map'](_0x2cc278[_0xf1ef('0x16')][_0xf1ef('0x19')],function(_0x222c31){return{'model':db[_0x222c31[_0xf1ef('0x1a')]],'as':_0x222c31['as'],'attributes':_0x222c31[_0xf1ef('0x1b')],'include':_0x222c31[_0xf1ef('0x19')]?_['map'](_0x222c31[_0xf1ef('0x19')],function(_0x2dcc6b){return{'model':db[_0x2dcc6b[_0xf1ef('0x1a')]],'as':_0x2dcc6b['as'],'attributes':_0x2dcc6b[_0xf1ef('0x1b')],'include':_0x2dcc6b[_0xf1ef('0x19')]?_[_0xf1ef('0x1c')](_0x2dcc6b[_0xf1ef('0x19')],function(_0x189c81){return{'model':db[_0x189c81[_0xf1ef('0x1a')]],'as':_0x189c81['as'],'attributes':_0x189c81[_0xf1ef('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59ad58){logger[_0xf1ef('0x10')]('GetFreshdeskAccount',_0x2cc278);logger[_0xf1ef('0x1d')]('GetFreshdeskAccount',_0x2cc278,JSON[_0xf1ef('0xc')](_0x59ad58));_0x39e59d(_0x59ad58);})[_0xf1ef('0x12')](function(_0x28fe3a){logger[_0xf1ef('0xd')](_0xf1ef('0x13'),_0x28fe3a[_0xf1ef('0xf')],_0x2cc278);_0x44a77d(_0x40e8fd[_0xf1ef('0xd')](0x1f4,_0x28fe3a[_0xf1ef('0xf')]));});});};exports[_0xf1ef('0x1e')]=function(_0x434314){var _0x20dac6=this;return new Promise(function(_0x2ff705,_0xec90c9){return db[_0xf1ef('0x14')][_0xf1ef('0x1f')]({'raw':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')][_0xf1ef('0x17')]===undefined?!![]:![]:!![],'where':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')][_0xf1ef('0x20')]||null:null,'attributes':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')]['attributes']||null:null,'include':_0x434314[_0xf1ef('0x16')]?_0x434314[_0xf1ef('0x16')][_0xf1ef('0x19')]?_[_0xf1ef('0x1c')](_0x434314['options'][_0xf1ef('0x19')],function(_0x136716){return{'model':db[_0x136716[_0xf1ef('0x1a')]],'as':_0x136716['as'],'attributes':_0x136716[_0xf1ef('0x1b')],'include':_0x136716[_0xf1ef('0x19')]?_[_0xf1ef('0x1c')](_0x136716['include'],function(_0x54416b){return{'model':db[_0x54416b[_0xf1ef('0x1a')]],'as':_0x54416b['as'],'attributes':_0x54416b[_0xf1ef('0x1b')],'include':_0x54416b[_0xf1ef('0x19')]?_['map'](_0x54416b['include'],function(_0x4c9cb2){return{'model':db[_0x4c9cb2[_0xf1ef('0x1a')]],'as':_0x4c9cb2['as'],'attributes':_0x4c9cb2[_0xf1ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf1ef('0xa')](function(_0x450e1f){logger['info'](_0xf1ef('0x1e'),_0x434314);logger[_0xf1ef('0x1d')](_0xf1ef('0x1e'),_0x434314,JSON[_0xf1ef('0xc')](_0x450e1f));_0x2ff705(_0x450e1f);})[_0xf1ef('0x12')](function(_0x4dd437){logger[_0xf1ef('0xd')](_0xf1ef('0x1e'),_0x4dd437[_0xf1ef('0xf')],_0x434314);_0xec90c9(_0x20dac6[_0xf1ef('0xd')](0x1f4,_0x4dd437[_0xf1ef('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 9088d81..3f8607c 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 _0xbe55=['index','get','/:id','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated'];(function(_0x43ffa4,_0x655a2c){var _0x36c6e9=function(_0x31c4e3){while(--_0x31c4e3){_0x43ffa4['push'](_0x43ffa4['shift']());}};_0x36c6e9(++_0x655a2c);}(_0xbe55,0x8d));var _0x5be5=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xbe55[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require('multer');var util=require(_0x5be5('0x0'));var path=require(_0x5be5('0x1'));var timeout=require(_0x5be5('0x2'));var express=require('express');var router=express[_0x5be5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5be5('0x4'));var interaction=require(_0x5be5('0x5'));var config=require(_0x5be5('0x6'));var controller=require(_0x5be5('0x7'));router['get']('/',auth[_0x5be5('0x8')](),controller[_0x5be5('0x9')]);router[_0x5be5('0xa')](_0x5be5('0xb'),auth[_0x5be5('0x8')](),controller['show']);router[_0x5be5('0xa')](_0x5be5('0xc'),auth[_0x5be5('0x8')](),controller[_0x5be5('0xd')]);router[_0x5be5('0xa')](_0x5be5('0xe'),auth[_0x5be5('0x8')](),controller['getSubjects']);router[_0x5be5('0xa')](_0x5be5('0xf'),auth[_0x5be5('0x8')](),controller[_0x5be5('0x10')]);router[_0x5be5('0xa')]('/:id/tags',auth[_0x5be5('0x8')](),controller[_0x5be5('0x11')]);router[_0x5be5('0x12')]('/',auth[_0x5be5('0x8')](),controller[_0x5be5('0x13')]);router[_0x5be5('0x12')](_0x5be5('0x14'),auth[_0x5be5('0x8')](),controller['setTags']);router[_0x5be5('0x15')](_0x5be5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x5be5('0x16')](_0x5be5('0xb'),auth[_0x5be5('0x8')](),controller[_0x5be5('0x17')]);module[_0x5be5('0x18')]=router; \ No newline at end of file +var _0xe2f9=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x593f03,_0x4af84a){var _0x178299=function(_0x284500){while(--_0x284500){_0x593f03['push'](_0x593f03['shift']());}};_0x178299(++_0x4af84a);}(_0xe2f9,0x9e));var _0x9e2f=function(_0x461642,_0x45cedc){_0x461642=_0x461642-0x0;var _0x237f26=_0xe2f9[_0x461642];return _0x237f26;};'use strict';var multer=require(_0x9e2f('0x0'));var util=require(_0x9e2f('0x1'));var path=require(_0x9e2f('0x2'));var timeout=require(_0x9e2f('0x3'));var express=require('express');var router=express[_0x9e2f('0x4')]();var fs_extra=require(_0x9e2f('0x5'));var auth=require(_0x9e2f('0x6'));var interaction=require(_0x9e2f('0x7'));var config=require(_0x9e2f('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0x9e2f('0x9')](),controller[_0x9e2f('0xa')]);router[_0x9e2f('0xb')](_0x9e2f('0xc'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0xd')]);router[_0x9e2f('0xb')]('/:id/fields',auth[_0x9e2f('0x9')](),controller[_0x9e2f('0xe')]);router[_0x9e2f('0xb')](_0x9e2f('0xf'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x10')]);router[_0x9e2f('0xb')](_0x9e2f('0x11'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x12')]);router[_0x9e2f('0xb')](_0x9e2f('0x13'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x14')]);router[_0x9e2f('0x15')]('/',auth[_0x9e2f('0x9')](),controller['create']);router[_0x9e2f('0x15')](_0x9e2f('0x13'),auth[_0x9e2f('0x9')](),controller['setTags']);router[_0x9e2f('0x16')](_0x9e2f('0xc'),auth['isAuthenticated'](),controller[_0x9e2f('0x17')]);router[_0x9e2f('0x18')](_0x9e2f('0xc'),auth[_0x9e2f('0x9')](),controller[_0x9e2f('0x19')]);module[_0x9e2f('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 badd421..b6522cb 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 _0x3a9c=['STRING','sequelize','exports'];(function(_0x232046,_0x575366){var _0x35059f=function(_0x54d21c){while(--_0x54d21c){_0x232046['push'](_0x232046['shift']());}};_0x35059f(++_0x575366);}(_0x3a9c,0x1f3));var _0xc3a9=function(_0x130cb6,_0x466814){_0x130cb6=_0x130cb6-0x0;var _0x116fc6=_0x3a9c[_0x130cb6];return _0x116fc6;};'use strict';var Sequelize=require(_0xc3a9('0x0'));module[_0xc3a9('0x1')]={'name':{'type':Sequelize[_0xc3a9('0x2')]},'description':{'type':Sequelize[_0xc3a9('0x2')]}}; \ No newline at end of file +var _0x3d6f=['STRING','sequelize','exports'];(function(_0x22d1d0,_0x3ada30){var _0xb8f7f=function(_0x4c15ee){while(--_0x4c15ee){_0x22d1d0['push'](_0x22d1d0['shift']());}};_0xb8f7f(++_0x3ada30);}(_0x3d6f,0x8e));var _0xf3d6=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0x3d6f[_0x4c05da];return _0x1614db;};'use strict';var Sequelize=require(_0xf3d6('0x0'));module[_0xf3d6('0x1')]={'name':{'type':Sequelize[_0xf3d6('0x2')]},'description':{'type':Sequelize[_0xf3d6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index c425293..3360c8f 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 _0x5f04=['status','end','offset','limit','undefined','count','set','Content-Range','json','apply','update','then','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','intersection','attributes','fields','query','length','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','FreshdeskField','pick','getSubjects','getDescriptions','getTags','setTags','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x590381,_0x5c3948){var _0xe300df=function(_0x148e67){while(--_0x148e67){_0x590381['push'](_0x590381['shift']());}};_0xe300df(++_0x5c3948);}(_0x5f04,0xe1));var _0x45f0=function(_0x8f398c,_0x189cc6){_0x8f398c=_0x8f398c-0x0;var _0x22450c=_0x5f04[_0x8f398c];return _0x22450c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x45f0('0x0'));var rp=require(_0x45f0('0x1'));var moment=require(_0x45f0('0x2'));var BPromise=require(_0x45f0('0x3'));var Mustache=require(_0x45f0('0x4'));var util=require(_0x45f0('0x5'));var path=require(_0x45f0('0x6'));var sox=require(_0x45f0('0x7'));var csv=require('to-csv');var ejs=require(_0x45f0('0x8'));var fs=require('fs');var fs_extra=require(_0x45f0('0x9'));var _=require(_0x45f0('0xa'));var squel=require(_0x45f0('0xb'));var crypto=require(_0x45f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x45f0('0xd'));var toCsv=require(_0x45f0('0xe'));var querystring=require(_0x45f0('0xf'));var Papa=require(_0x45f0('0x10'));var Redis=require(_0x45f0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x45f0('0x12'));var as=require(_0x45f0('0x13'));var hardwareService=require(_0x45f0('0x14'));var logger=require(_0x45f0('0x15'))(_0x45f0('0x16'));var utils=require('../../config/utils');var config=require(_0x45f0('0x17'));var licenseUtil=require(_0x45f0('0x18'));var db=require(_0x45f0('0x19'))['db'];function respondWithStatusCode(_0x34dc88,_0x52beb4){_0x52beb4=_0x52beb4||0xcc;return function(_0x3a29ee){if(_0x3a29ee){return _0x34dc88[_0x45f0('0x1a')](_0x52beb4);}return _0x34dc88[_0x45f0('0x1b')](_0x52beb4)[_0x45f0('0x1c')]();};}function respondWithResult(_0x967f0d,_0x28c5fd){_0x28c5fd=_0x28c5fd||0xc8;return function(_0x4f4f58){if(_0x4f4f58){return _0x967f0d[_0x45f0('0x1b')](_0x28c5fd)['json'](_0x4f4f58);}};}function respondWithFilteredResult(_0x3cd6eb,_0x451470){return function(_0x161b44){if(_0x161b44){var _0x5d8c62=typeof _0x451470[_0x45f0('0x1d')]==='undefined'&&typeof _0x451470[_0x45f0('0x1e')]===_0x45f0('0x1f');var _0x23f936=_0x161b44[_0x45f0('0x20')];var _0x5df5a6=_0x5d8c62?0x0:_0x451470[_0x45f0('0x1d')];var _0x518b47=_0x5d8c62?_0x161b44[_0x45f0('0x20')]:_0x451470['offset']+_0x451470['limit'];var _0x759b44;if(_0x518b47>=_0x23f936){_0x518b47=_0x23f936;_0x759b44=0xc8;}else{_0x759b44=0xce;}_0x3cd6eb[_0x45f0('0x1b')](_0x759b44);return _0x3cd6eb[_0x45f0('0x21')](_0x45f0('0x22'),_0x5df5a6+'-'+_0x518b47+'/'+_0x23f936)[_0x45f0('0x23')](_0x161b44);}return null;};}function patchUpdates(_0x15ba79){return function(_0x46e969){try{jsonpatch[_0x45f0('0x24')](_0x46e969,_0x15ba79,!![]);}catch(_0x2f5b62){return BPromise['reject'](_0x2f5b62);}return _0x46e969['save']();};}function saveUpdates(_0x16337e,_0xdd4c3a){return function(_0x5c0aa2){if(_0x5c0aa2){return _0x5c0aa2[_0x45f0('0x25')](_0x16337e)[_0x45f0('0x26')](function(_0x5aaa76){return _0x5aaa76;});}return null;};}function removeEntity(_0x3764fc,_0x37e8eb){return function(_0xcef771){if(_0xcef771){return _0xcef771['destroy']()[_0x45f0('0x26')](function(){_0x3764fc['status'](0xcc)[_0x45f0('0x1c')]();});}};}function handleEntityNotFound(_0x44edd5,_0x345198){return function(_0x20ff69){if(!_0x20ff69){_0x44edd5['sendStatus'](0x194);}return _0x20ff69;};}function handleError(_0x26a328,_0x5f30a6){_0x5f30a6=_0x5f30a6||0x1f4;return function(_0x1bcfaa){logger['error'](_0x1bcfaa[_0x45f0('0x27')]);if(_0x1bcfaa[_0x45f0('0x28')]){delete _0x1bcfaa[_0x45f0('0x28')];}_0x26a328[_0x45f0('0x1b')](_0x5f30a6)[_0x45f0('0x29')](_0x1bcfaa);};}exports[_0x45f0('0x2a')]=function(_0x2b4469,_0x83ba93){var _0x1a7e22={},_0x366156={},_0x1f2bb9={'count':0x0,'rows':[]};var _0x3f32d7=_[_0x45f0('0x2b')](db[_0x45f0('0x2c')][_0x45f0('0x2d')],function(_0x96ab0c){return{'name':_0x96ab0c[_0x45f0('0x2e')],'type':_0x96ab0c[_0x45f0('0x2f')][_0x45f0('0x30')]};});_0x366156['model']=_[_0x45f0('0x2b')](_0x3f32d7,'name');_0x366156['query']=_['keys'](_0x2b4469['query']);_0x366156['filters']=_[_0x45f0('0x31')](_0x366156['model'],_0x366156['query']);_0x1a7e22[_0x45f0('0x32')]=_[_0x45f0('0x31')](_0x366156['model'],qs[_0x45f0('0x33')](_0x2b4469[_0x45f0('0x34')][_0x45f0('0x33')]));_0x1a7e22['attributes']=_0x1a7e22[_0x45f0('0x32')][_0x45f0('0x35')]?_0x1a7e22['attributes']:_0x366156[_0x45f0('0x36')];if(!_0x2b4469[_0x45f0('0x34')][_0x45f0('0x37')](_0x45f0('0x38'))){_0x1a7e22[_0x45f0('0x1e')]=qs[_0x45f0('0x1e')](_0x2b4469[_0x45f0('0x34')][_0x45f0('0x1e')]);_0x1a7e22['offset']=qs['offset'](_0x2b4469[_0x45f0('0x34')][_0x45f0('0x1d')]);}_0x1a7e22[_0x45f0('0x39')]=qs[_0x45f0('0x3a')](_0x2b4469[_0x45f0('0x34')][_0x45f0('0x3a')]);_0x1a7e22[_0x45f0('0x3b')]=qs[_0x45f0('0x3c')](_['pick'](_0x2b4469[_0x45f0('0x34')],_0x366156[_0x45f0('0x3c')]),_0x3f32d7);if(_0x2b4469['query'][_0x45f0('0x3d')]){_0x1a7e22[_0x45f0('0x3b')]=_[_0x45f0('0x3e')](_0x1a7e22[_0x45f0('0x3b')],{'$or':_[_0x45f0('0x2b')](_0x3f32d7,function(_0x41feb8){if(_0x41feb8[_0x45f0('0x2f')]!==_0x45f0('0x3f')){var _0x290217={};_0x290217[_0x41feb8[_0x45f0('0x28')]]={'$like':'%'+_0x2b4469['query'][_0x45f0('0x3d')]+'%'};return _0x290217;}})});}_0x1a7e22=_[_0x45f0('0x3e')]({},_0x1a7e22,_0x2b4469[_0x45f0('0x40')]);var _0x2f3ad5={'where':_0x1a7e22[_0x45f0('0x3b')]};return db[_0x45f0('0x2c')][_0x45f0('0x20')](_0x2f3ad5)[_0x45f0('0x26')](function(_0x276a8e){_0x1f2bb9[_0x45f0('0x20')]=_0x276a8e;if(_0x2b4469['query'][_0x45f0('0x41')]){_0x1a7e22[_0x45f0('0x42')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x45f0('0x43')](_0x1a7e22);})[_0x45f0('0x26')](function(_0x374e2c){_0x1f2bb9[_0x45f0('0x44')]=_0x374e2c;return _0x1f2bb9;})[_0x45f0('0x26')](respondWithFilteredResult(_0x83ba93,_0x1a7e22))[_0x45f0('0x45')](handleError(_0x83ba93,null));};exports[_0x45f0('0x46')]=function(_0x226897,_0x157a5d){var _0x2ba96d={'raw':![],'where':{'id':_0x226897[_0x45f0('0x47')]['id']}},_0x10dffe={};_0x10dffe[_0x45f0('0x36')]=_[_0x45f0('0x48')](db[_0x45f0('0x2c')]['rawAttributes']);_0x10dffe[_0x45f0('0x34')]=_['keys'](_0x226897[_0x45f0('0x34')]);_0x10dffe[_0x45f0('0x3c')]=_[_0x45f0('0x31')](_0x10dffe[_0x45f0('0x36')],_0x10dffe['query']);_0x2ba96d[_0x45f0('0x32')]=_[_0x45f0('0x31')](_0x10dffe[_0x45f0('0x36')],qs['fields'](_0x226897[_0x45f0('0x34')]['fields']));_0x2ba96d[_0x45f0('0x32')]=_0x2ba96d['attributes'][_0x45f0('0x35')]?_0x2ba96d[_0x45f0('0x32')]:_0x10dffe[_0x45f0('0x36')];if(_0x226897['query']['includeAll']){_0x2ba96d[_0x45f0('0x42')]=[{'all':!![]}];}_0x2ba96d=_[_0x45f0('0x3e')]({},_0x2ba96d,_0x226897[_0x45f0('0x40')]);return db[_0x45f0('0x2c')][_0x45f0('0x49')](_0x2ba96d)['then'](handleEntityNotFound(_0x157a5d,null))[_0x45f0('0x26')](respondWithResult(_0x157a5d,null))[_0x45f0('0x45')](handleError(_0x157a5d,null));};exports[_0x45f0('0x4a')]=function(_0x5eb4cc,_0x3b0665){return db[_0x45f0('0x2c')][_0x45f0('0x4a')](_0x5eb4cc[_0x45f0('0x4b')],{})['then'](respondWithResult(_0x3b0665,0xc9))[_0x45f0('0x45')](handleError(_0x3b0665,null));};exports[_0x45f0('0x25')]=function(_0x5517d5,_0xe08f4e){if(_0x5517d5[_0x45f0('0x4b')]['id']){delete _0x5517d5[_0x45f0('0x4b')]['id'];}return db[_0x45f0('0x2c')][_0x45f0('0x49')]({'where':{'id':_0x5517d5[_0x45f0('0x47')]['id']}})[_0x45f0('0x26')](handleEntityNotFound(_0xe08f4e,null))[_0x45f0('0x26')](saveUpdates(_0x5517d5[_0x45f0('0x4b')],null))[_0x45f0('0x26')](respondWithResult(_0xe08f4e,null))['catch'](handleError(_0xe08f4e,null));};exports['destroy']=function(_0x34c03d,_0x1dd93d){return db[_0x45f0('0x2c')][_0x45f0('0x49')]({'where':{'id':_0x34c03d[_0x45f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1dd93d,null))[_0x45f0('0x26')](removeEntity(_0x1dd93d,null))[_0x45f0('0x45')](handleError(_0x1dd93d,null));};exports[_0x45f0('0x4c')]=function(_0x552cdc,_0x36bafd,_0x410e85){var _0x1e62e1={};var _0x39a45c={};var _0x8698ee;var _0x2161b1;return db[_0x45f0('0x2c')][_0x45f0('0x4d')]({'where':{'id':_0x552cdc[_0x45f0('0x47')]['id']}})[_0x45f0('0x26')](handleEntityNotFound(_0x36bafd,null))[_0x45f0('0x26')](function(_0x499366){if(_0x499366){_0x8698ee=_0x499366;_0x39a45c[_0x45f0('0x36')]=_[_0x45f0('0x48')](db[_0x45f0('0x4e')][_0x45f0('0x2d')]);_0x39a45c[_0x45f0('0x34')]=_[_0x45f0('0x48')](_0x552cdc[_0x45f0('0x34')]);_0x39a45c[_0x45f0('0x3c')]=_[_0x45f0('0x31')](_0x39a45c['model'],_0x39a45c[_0x45f0('0x34')]);_0x1e62e1[_0x45f0('0x32')]=_['intersection'](_0x39a45c['model'],qs[_0x45f0('0x33')](_0x552cdc['query'][_0x45f0('0x33')]));_0x1e62e1[_0x45f0('0x32')]=_0x1e62e1[_0x45f0('0x32')][_0x45f0('0x35')]?_0x1e62e1[_0x45f0('0x32')]:_0x39a45c[_0x45f0('0x36')];_0x1e62e1[_0x45f0('0x39')]=qs[_0x45f0('0x3a')](_0x552cdc['query']['sort']);_0x1e62e1['where']=qs[_0x45f0('0x3c')](_[_0x45f0('0x4f')](_0x552cdc[_0x45f0('0x34')],_0x39a45c['filters']));if(_0x552cdc[_0x45f0('0x34')]['filter']){_0x1e62e1[_0x45f0('0x3b')]=_['merge'](_0x1e62e1['where'],{'$or':_[_0x45f0('0x2b')](_0x1e62e1[_0x45f0('0x32')],function(_0x48c8c8){var _0x174fb7={};_0x174fb7[_0x48c8c8]={'$like':'%'+_0x552cdc['query']['filter']+'%'};return _0x174fb7;})});}_0x1e62e1=_[_0x45f0('0x3e')]({},_0x1e62e1,_0x552cdc[_0x45f0('0x40')]);return _0x8698ee['getFields'](_0x1e62e1);}})['then'](function(_0x43175e){if(_0x43175e){_0x2161b1=_0x43175e[_0x45f0('0x35')];if(!_0x552cdc[_0x45f0('0x34')][_0x45f0('0x37')]('nolimit')){_0x1e62e1[_0x45f0('0x1e')]=qs[_0x45f0('0x1e')](_0x552cdc['query'][_0x45f0('0x1e')]);_0x1e62e1['offset']=qs[_0x45f0('0x1d')](_0x552cdc[_0x45f0('0x34')][_0x45f0('0x1d')]);}return _0x8698ee[_0x45f0('0x4c')](_0x1e62e1);}})['then'](function(_0x44a774){if(_0x44a774){return _0x44a774?{'count':_0x2161b1,'rows':_0x44a774}:null;}})['then'](respondWithResult(_0x36bafd,null))[_0x45f0('0x45')](handleError(_0x36bafd,null));};exports['getSubjects']=function(_0x2c0f48,_0x2b3b69,_0x2122bc){var _0x90b9e1={};var _0x314569={};var _0x19347c;var _0x4d33f9;return db[_0x45f0('0x2c')][_0x45f0('0x4d')]({'where':{'id':_0x2c0f48[_0x45f0('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b3b69,null))[_0x45f0('0x26')](function(_0x568dce){if(_0x568dce){_0x19347c=_0x568dce;_0x314569[_0x45f0('0x36')]=_[_0x45f0('0x48')](db['FreshdeskField']['rawAttributes']);_0x314569['query']=_[_0x45f0('0x48')](_0x2c0f48[_0x45f0('0x34')]);_0x314569['filters']=_[_0x45f0('0x31')](_0x314569[_0x45f0('0x36')],_0x314569['query']);_0x90b9e1[_0x45f0('0x32')]=_[_0x45f0('0x31')](_0x314569[_0x45f0('0x36')],qs[_0x45f0('0x33')](_0x2c0f48[_0x45f0('0x34')]['fields']));_0x90b9e1['attributes']=_0x90b9e1[_0x45f0('0x32')]['length']?_0x90b9e1[_0x45f0('0x32')]:_0x314569[_0x45f0('0x36')];_0x90b9e1[_0x45f0('0x39')]=qs['sort'](_0x2c0f48['query']['sort']);_0x90b9e1[_0x45f0('0x3b')]=qs[_0x45f0('0x3c')](_[_0x45f0('0x4f')](_0x2c0f48[_0x45f0('0x34')],_0x314569[_0x45f0('0x3c')]));if(_0x2c0f48[_0x45f0('0x34')][_0x45f0('0x3d')]){_0x90b9e1[_0x45f0('0x3b')]=_[_0x45f0('0x3e')](_0x90b9e1[_0x45f0('0x3b')],{'$or':_[_0x45f0('0x2b')](_0x90b9e1[_0x45f0('0x32')],function(_0x7bccdf){var _0x14c14c={};_0x14c14c[_0x7bccdf]={'$like':'%'+_0x2c0f48[_0x45f0('0x34')]['filter']+'%'};return _0x14c14c;})});}_0x90b9e1=_[_0x45f0('0x3e')]({},_0x90b9e1,_0x2c0f48[_0x45f0('0x40')]);return _0x19347c[_0x45f0('0x50')](_0x90b9e1);}})[_0x45f0('0x26')](function(_0x492d42){if(_0x492d42){_0x4d33f9=_0x492d42['length'];if(!_0x2c0f48['query']['hasOwnProperty'](_0x45f0('0x38'))){_0x90b9e1['limit']=qs[_0x45f0('0x1e')](_0x2c0f48[_0x45f0('0x34')]['limit']);_0x90b9e1['offset']=qs[_0x45f0('0x1d')](_0x2c0f48[_0x45f0('0x34')][_0x45f0('0x1d')]);}return _0x19347c['getSubjects'](_0x90b9e1);}})[_0x45f0('0x26')](function(_0x29bf70){if(_0x29bf70){return _0x29bf70?{'count':_0x4d33f9,'rows':_0x29bf70}:null;}})[_0x45f0('0x26')](respondWithResult(_0x2b3b69,null))[_0x45f0('0x45')](handleError(_0x2b3b69,null));};exports[_0x45f0('0x51')]=function(_0x348055,_0x564ea8,_0x2e14d6){var _0x232581={};var _0x10cc0e={};var _0x3a73ac;var _0x5f144f;return db['FreshdeskConfiguration'][_0x45f0('0x4d')]({'where':{'id':_0x348055['params']['id']}})[_0x45f0('0x26')](handleEntityNotFound(_0x564ea8,null))['then'](function(_0x33b9a8){if(_0x33b9a8){_0x3a73ac=_0x33b9a8;_0x10cc0e[_0x45f0('0x36')]=_[_0x45f0('0x48')](db['FreshdeskField'][_0x45f0('0x2d')]);_0x10cc0e[_0x45f0('0x34')]=_['keys'](_0x348055['query']);_0x10cc0e[_0x45f0('0x3c')]=_[_0x45f0('0x31')](_0x10cc0e[_0x45f0('0x36')],_0x10cc0e['query']);_0x232581['attributes']=_[_0x45f0('0x31')](_0x10cc0e[_0x45f0('0x36')],qs['fields'](_0x348055['query'][_0x45f0('0x33')]));_0x232581[_0x45f0('0x32')]=_0x232581[_0x45f0('0x32')][_0x45f0('0x35')]?_0x232581[_0x45f0('0x32')]:_0x10cc0e[_0x45f0('0x36')];_0x232581[_0x45f0('0x39')]=qs[_0x45f0('0x3a')](_0x348055['query'][_0x45f0('0x3a')]);_0x232581[_0x45f0('0x3b')]=qs['filters'](_[_0x45f0('0x4f')](_0x348055[_0x45f0('0x34')],_0x10cc0e[_0x45f0('0x3c')]));if(_0x348055[_0x45f0('0x34')][_0x45f0('0x3d')]){_0x232581['where']=_['merge'](_0x232581[_0x45f0('0x3b')],{'$or':_['map'](_0x232581[_0x45f0('0x32')],function(_0x2ff8aa){var _0x357ea0={};_0x357ea0[_0x2ff8aa]={'$like':'%'+_0x348055[_0x45f0('0x34')]['filter']+'%'};return _0x357ea0;})});}_0x232581=_[_0x45f0('0x3e')]({},_0x232581,_0x348055['options']);return _0x3a73ac[_0x45f0('0x51')](_0x232581);}})[_0x45f0('0x26')](function(_0x1a6e17){if(_0x1a6e17){_0x5f144f=_0x1a6e17[_0x45f0('0x35')];if(!_0x348055[_0x45f0('0x34')][_0x45f0('0x37')](_0x45f0('0x38'))){_0x232581['limit']=qs[_0x45f0('0x1e')](_0x348055[_0x45f0('0x34')]['limit']);_0x232581[_0x45f0('0x1d')]=qs[_0x45f0('0x1d')](_0x348055[_0x45f0('0x34')]['offset']);}return _0x3a73ac[_0x45f0('0x51')](_0x232581);}})[_0x45f0('0x26')](function(_0x24f17e){if(_0x24f17e){return _0x24f17e?{'count':_0x5f144f,'rows':_0x24f17e}:null;}})[_0x45f0('0x26')](respondWithResult(_0x564ea8,null))['catch'](handleError(_0x564ea8,null));};exports['getTags']=function(_0x32692b,_0x5cc447,_0x202648){var _0x49ef81={};var _0x212051={};var _0x49e82a;var _0x52df54;return db['FreshdeskConfiguration'][_0x45f0('0x4d')]({'where':{'id':_0x32692b['params']['id']}})[_0x45f0('0x26')](handleEntityNotFound(_0x5cc447,null))[_0x45f0('0x26')](function(_0xdce41b){if(_0xdce41b){_0x49e82a=_0xdce41b;_0x212051['model']=_[_0x45f0('0x48')](db['Tag'][_0x45f0('0x2d')]);_0x212051[_0x45f0('0x34')]=_['keys'](_0x32692b[_0x45f0('0x34')]);_0x212051[_0x45f0('0x3c')]=_['intersection'](_0x212051['model'],_0x212051[_0x45f0('0x34')]);_0x49ef81[_0x45f0('0x32')]=_[_0x45f0('0x31')](_0x212051[_0x45f0('0x36')],qs[_0x45f0('0x33')](_0x32692b['query']['fields']));_0x49ef81['attributes']=_0x49ef81[_0x45f0('0x32')]['length']?_0x49ef81['attributes']:_0x212051[_0x45f0('0x36')];_0x49ef81[_0x45f0('0x39')]=qs['sort'](_0x32692b[_0x45f0('0x34')]['sort']);_0x49ef81['where']=qs[_0x45f0('0x3c')](_['pick'](_0x32692b[_0x45f0('0x34')],_0x212051[_0x45f0('0x3c')]));if(_0x32692b[_0x45f0('0x34')][_0x45f0('0x3d')]){_0x49ef81[_0x45f0('0x3b')]=_[_0x45f0('0x3e')](_0x49ef81[_0x45f0('0x3b')],{'$or':_[_0x45f0('0x2b')](_0x49ef81[_0x45f0('0x32')],function(_0x55a1e4){var _0x43e835={};_0x43e835[_0x55a1e4]={'$like':'%'+_0x32692b['query'][_0x45f0('0x3d')]+'%'};return _0x43e835;})});}_0x49ef81=_[_0x45f0('0x3e')]({},_0x49ef81,_0x32692b[_0x45f0('0x40')]);return _0x49e82a[_0x45f0('0x52')](_0x49ef81);}})['then'](function(_0xc2316){if(_0xc2316){_0x52df54=_0xc2316[_0x45f0('0x35')];if(!_0x32692b['query'][_0x45f0('0x37')](_0x45f0('0x38'))){_0x49ef81[_0x45f0('0x1e')]=qs[_0x45f0('0x1e')](_0x32692b[_0x45f0('0x34')][_0x45f0('0x1e')]);_0x49ef81['offset']=qs[_0x45f0('0x1d')](_0x32692b[_0x45f0('0x34')][_0x45f0('0x1d')]);}return _0x49e82a[_0x45f0('0x52')](_0x49ef81);}})[_0x45f0('0x26')](function(_0xa46dfe){if(_0xa46dfe){return _0xa46dfe?{'count':_0x52df54,'rows':_0xa46dfe}:null;}})[_0x45f0('0x26')](respondWithResult(_0x5cc447,null))[_0x45f0('0x45')](handleError(_0x5cc447,null));};exports[_0x45f0('0x53')]=function(_0x5ef684,_0x58df7c,_0x43c084){if(_0x5ef684['body']['id']){delete _0x5ef684['body']['id'];}return db[_0x45f0('0x2c')][_0x45f0('0x4d')]({'where':{'id':_0x5ef684[_0x45f0('0x47')]['id']}})[_0x45f0('0x26')](handleEntityNotFound(_0x58df7c,null))[_0x45f0('0x26')](function(_0x3f1d8b){if(_0x3f1d8b){return _0x3f1d8b[_0x45f0('0x53')](_0x5ef684[_0x45f0('0x4b')]['ids']||[]);}return null;})['then'](respondWithResult(_0x58df7c,null))[_0x45f0('0x45')](handleError(_0x58df7c,null));}; \ No newline at end of file +var _0x2dc7=['attributes','find','create','body','findOne','FreshdeskField','getFields','getSubjects','rawAttributes','nolimit','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','map','FreshdeskConfiguration','type','query','keys','filters','intersection','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params'];(function(_0x15a40f,_0x80b57f){var _0x172d2a=function(_0x1cfc72){while(--_0x1cfc72){_0x15a40f['push'](_0x15a40f['shift']());}};_0x172d2a(++_0x80b57f);}(_0x2dc7,0x14e));var _0x72dc=function(_0x2c96f6,_0x877207){_0x2c96f6=_0x2c96f6-0x0;var _0x6d4808=_0x2dc7[_0x2c96f6];return _0x6d4808;};'use strict';var emlformat=require(_0x72dc('0x0'));var rimraf=require(_0x72dc('0x1'));var zipdir=require(_0x72dc('0x2'));var jsonpatch=require(_0x72dc('0x3'));var rp=require('request-promise');var moment=require(_0x72dc('0x4'));var BPromise=require(_0x72dc('0x5'));var Mustache=require(_0x72dc('0x6'));var util=require(_0x72dc('0x7'));var path=require(_0x72dc('0x8'));var sox=require(_0x72dc('0x9'));var csv=require(_0x72dc('0xa'));var ejs=require(_0x72dc('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x72dc('0xc'));var crypto=require('crypto');var jsforce=require(_0x72dc('0xd'));var deskjs=require(_0x72dc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x72dc('0xf'));var Papa=require(_0x72dc('0x10'));var Redis=require(_0x72dc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x72dc('0x12'));var as=require(_0x72dc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x72dc('0x14'));var utils=require(_0x72dc('0x15'));var config=require(_0x72dc('0x16'));var licenseUtil=require(_0x72dc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3760e0,_0x3998ad){_0x3998ad=_0x3998ad||0xcc;return function(_0x2cea31){if(_0x2cea31){return _0x3760e0[_0x72dc('0x18')](_0x3998ad);}return _0x3760e0[_0x72dc('0x19')](_0x3998ad)[_0x72dc('0x1a')]();};}function respondWithResult(_0x510a59,_0x5794eb){_0x5794eb=_0x5794eb||0xc8;return function(_0x40abdd){if(_0x40abdd){return _0x510a59[_0x72dc('0x19')](_0x5794eb)[_0x72dc('0x1b')](_0x40abdd);}};}function respondWithFilteredResult(_0x1d8013,_0x398452){return function(_0x123ab6){if(_0x123ab6){var _0x9f600d=typeof _0x398452[_0x72dc('0x1c')]==='undefined'&&typeof _0x398452[_0x72dc('0x1d')]==='undefined';var _0x22603d=_0x123ab6[_0x72dc('0x1e')];var _0x499379=_0x9f600d?0x0:_0x398452['offset'];var _0xdbc16d=_0x9f600d?_0x123ab6[_0x72dc('0x1e')]:_0x398452[_0x72dc('0x1c')]+_0x398452[_0x72dc('0x1d')];var _0x32c6bc;if(_0xdbc16d>=_0x22603d){_0xdbc16d=_0x22603d;_0x32c6bc=0xc8;}else{_0x32c6bc=0xce;}_0x1d8013[_0x72dc('0x19')](_0x32c6bc);return _0x1d8013[_0x72dc('0x1f')](_0x72dc('0x20'),_0x499379+'-'+_0xdbc16d+'/'+_0x22603d)[_0x72dc('0x1b')](_0x123ab6);}return null;};}function patchUpdates(_0x3131a0){return function(_0xd219d6){try{jsonpatch[_0x72dc('0x21')](_0xd219d6,_0x3131a0,!![]);}catch(_0x4e5fc3){return BPromise['reject'](_0x4e5fc3);}return _0xd219d6[_0x72dc('0x22')]();};}function saveUpdates(_0xa7c5ed,_0x2669e1){return function(_0x8610c3){if(_0x8610c3){return _0x8610c3[_0x72dc('0x23')](_0xa7c5ed)['then'](function(_0x14dea6){return _0x14dea6;});}return null;};}function removeEntity(_0x43a5a2,_0x45d7a0){return function(_0xeb4850){if(_0xeb4850){return _0xeb4850[_0x72dc('0x24')]()[_0x72dc('0x25')](function(){_0x43a5a2[_0x72dc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3906ab,_0x2bf99f){return function(_0xe8ce56){if(!_0xe8ce56){_0x3906ab[_0x72dc('0x18')](0x194);}return _0xe8ce56;};}function handleError(_0x266f0c,_0x3dafd5){_0x3dafd5=_0x3dafd5||0x1f4;return function(_0x4bfb58){logger['error'](_0x4bfb58[_0x72dc('0x26')]);if(_0x4bfb58['name']){delete _0x4bfb58[_0x72dc('0x27')];}_0x266f0c[_0x72dc('0x19')](_0x3dafd5)[_0x72dc('0x28')](_0x4bfb58);};}exports['index']=function(_0x17692d,_0x1a7203){var _0x4fe493={},_0x31c6a4={},_0x4d3c6e={'count':0x0,'rows':[]};var _0x312486=_[_0x72dc('0x29')](db[_0x72dc('0x2a')]['rawAttributes'],function(_0x53551a){return{'name':_0x53551a['fieldName'],'type':_0x53551a[_0x72dc('0x2b')]['key']};});_0x31c6a4['model']=_['map'](_0x312486,_0x72dc('0x27'));_0x31c6a4[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x17692d[_0x72dc('0x2c')]);_0x31c6a4[_0x72dc('0x2e')]=_[_0x72dc('0x2f')](_0x31c6a4[_0x72dc('0x30')],_0x31c6a4[_0x72dc('0x2c')]);_0x4fe493['attributes']=_['intersection'](_0x31c6a4[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x17692d['query'][_0x72dc('0x31')]));_0x4fe493['attributes']=_0x4fe493['attributes'][_0x72dc('0x32')]?_0x4fe493['attributes']:_0x31c6a4['model'];if(!_0x17692d[_0x72dc('0x2c')][_0x72dc('0x33')]('nolimit')){_0x4fe493[_0x72dc('0x1d')]=qs[_0x72dc('0x1d')](_0x17692d[_0x72dc('0x2c')]['limit']);_0x4fe493[_0x72dc('0x1c')]=qs[_0x72dc('0x1c')](_0x17692d[_0x72dc('0x2c')][_0x72dc('0x1c')]);}_0x4fe493[_0x72dc('0x34')]=qs[_0x72dc('0x35')](_0x17692d['query']['sort']);_0x4fe493[_0x72dc('0x36')]=qs['filters'](_[_0x72dc('0x37')](_0x17692d[_0x72dc('0x2c')],_0x31c6a4['filters']),_0x312486);if(_0x17692d[_0x72dc('0x2c')][_0x72dc('0x38')]){_0x4fe493[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x4fe493[_0x72dc('0x36')],{'$or':_[_0x72dc('0x29')](_0x312486,function(_0x271ff1){if(_0x271ff1[_0x72dc('0x2b')]!==_0x72dc('0x3a')){var _0x302fee={};_0x302fee[_0x271ff1['name']]={'$like':'%'+_0x17692d['query']['filter']+'%'};return _0x302fee;}})});}_0x4fe493=_[_0x72dc('0x39')]({},_0x4fe493,_0x17692d[_0x72dc('0x3b')]);var _0xb42c4d={'where':_0x4fe493[_0x72dc('0x36')]};return db[_0x72dc('0x2a')][_0x72dc('0x1e')](_0xb42c4d)[_0x72dc('0x25')](function(_0x120029){_0x4d3c6e[_0x72dc('0x1e')]=_0x120029;if(_0x17692d[_0x72dc('0x2c')][_0x72dc('0x3c')]){_0x4fe493[_0x72dc('0x3d')]=[{'all':!![]}];}return db[_0x72dc('0x2a')][_0x72dc('0x3e')](_0x4fe493);})['then'](function(_0x3e0bc5){_0x4d3c6e['rows']=_0x3e0bc5;return _0x4d3c6e;})[_0x72dc('0x25')](respondWithFilteredResult(_0x1a7203,_0x4fe493))[_0x72dc('0x3f')](handleError(_0x1a7203,null));};exports[_0x72dc('0x40')]=function(_0x580569,_0x3b8c85){var _0x31dad4={'raw':![],'where':{'id':_0x580569[_0x72dc('0x41')]['id']}},_0x5c99cc={};_0x5c99cc[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db['FreshdeskConfiguration']['rawAttributes']);_0x5c99cc[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x580569['query']);_0x5c99cc[_0x72dc('0x2e')]=_[_0x72dc('0x2f')](_0x5c99cc[_0x72dc('0x30')],_0x5c99cc[_0x72dc('0x2c')]);_0x31dad4['attributes']=_[_0x72dc('0x2f')](_0x5c99cc[_0x72dc('0x30')],qs['fields'](_0x580569[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x31dad4[_0x72dc('0x42')]=_0x31dad4[_0x72dc('0x42')]['length']?_0x31dad4[_0x72dc('0x42')]:_0x5c99cc[_0x72dc('0x30')];if(_0x580569[_0x72dc('0x2c')][_0x72dc('0x3c')]){_0x31dad4[_0x72dc('0x3d')]=[{'all':!![]}];}_0x31dad4=_[_0x72dc('0x39')]({},_0x31dad4,_0x580569[_0x72dc('0x3b')]);return db[_0x72dc('0x2a')][_0x72dc('0x43')](_0x31dad4)[_0x72dc('0x25')](handleEntityNotFound(_0x3b8c85,null))[_0x72dc('0x25')](respondWithResult(_0x3b8c85,null))[_0x72dc('0x3f')](handleError(_0x3b8c85,null));};exports[_0x72dc('0x44')]=function(_0x245329,_0x283058){return db[_0x72dc('0x2a')][_0x72dc('0x44')](_0x245329[_0x72dc('0x45')],{})[_0x72dc('0x25')](respondWithResult(_0x283058,0xc9))['catch'](handleError(_0x283058,null));};exports[_0x72dc('0x23')]=function(_0x5d1e99,_0x7a44c3){if(_0x5d1e99[_0x72dc('0x45')]['id']){delete _0x5d1e99[_0x72dc('0x45')]['id'];}return db[_0x72dc('0x2a')]['find']({'where':{'id':_0x5d1e99[_0x72dc('0x41')]['id']}})[_0x72dc('0x25')](handleEntityNotFound(_0x7a44c3,null))[_0x72dc('0x25')](saveUpdates(_0x5d1e99[_0x72dc('0x45')],null))['then'](respondWithResult(_0x7a44c3,null))[_0x72dc('0x3f')](handleError(_0x7a44c3,null));};exports[_0x72dc('0x24')]=function(_0x1a4516,_0x1546f9){return db[_0x72dc('0x2a')][_0x72dc('0x43')]({'where':{'id':_0x1a4516['params']['id']}})['then'](handleEntityNotFound(_0x1546f9,null))[_0x72dc('0x25')](removeEntity(_0x1546f9,null))[_0x72dc('0x3f')](handleError(_0x1546f9,null));};exports['getFields']=function(_0x8b2b9f,_0xfa8686,_0x3ab508){var _0x53603c={};var _0x50a697={};var _0xfa6d40;var _0x45ba52;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x8b2b9f['params']['id']}})['then'](handleEntityNotFound(_0xfa8686,null))[_0x72dc('0x25')](function(_0x12bd32){if(_0x12bd32){_0xfa6d40=_0x12bd32;_0x50a697[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db[_0x72dc('0x47')]['rawAttributes']);_0x50a697[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x8b2b9f[_0x72dc('0x2c')]);_0x50a697[_0x72dc('0x2e')]=_['intersection'](_0x50a697[_0x72dc('0x30')],_0x50a697['query']);_0x53603c[_0x72dc('0x42')]=_['intersection'](_0x50a697[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x8b2b9f[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x53603c[_0x72dc('0x42')]=_0x53603c[_0x72dc('0x42')][_0x72dc('0x32')]?_0x53603c[_0x72dc('0x42')]:_0x50a697[_0x72dc('0x30')];_0x53603c[_0x72dc('0x34')]=qs['sort'](_0x8b2b9f['query'][_0x72dc('0x35')]);_0x53603c['where']=qs[_0x72dc('0x2e')](_[_0x72dc('0x37')](_0x8b2b9f['query'],_0x50a697[_0x72dc('0x2e')]));if(_0x8b2b9f['query'][_0x72dc('0x38')]){_0x53603c[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x53603c[_0x72dc('0x36')],{'$or':_[_0x72dc('0x29')](_0x53603c[_0x72dc('0x42')],function(_0x4b118a){var _0x594bbc={};_0x594bbc[_0x4b118a]={'$like':'%'+_0x8b2b9f[_0x72dc('0x2c')]['filter']+'%'};return _0x594bbc;})});}_0x53603c=_[_0x72dc('0x39')]({},_0x53603c,_0x8b2b9f['options']);return _0xfa6d40[_0x72dc('0x48')](_0x53603c);}})[_0x72dc('0x25')](function(_0x40b36a){if(_0x40b36a){_0x45ba52=_0x40b36a[_0x72dc('0x32')];if(!_0x8b2b9f[_0x72dc('0x2c')][_0x72dc('0x33')]('nolimit')){_0x53603c['limit']=qs[_0x72dc('0x1d')](_0x8b2b9f[_0x72dc('0x2c')]['limit']);_0x53603c[_0x72dc('0x1c')]=qs[_0x72dc('0x1c')](_0x8b2b9f['query'][_0x72dc('0x1c')]);}return _0xfa6d40[_0x72dc('0x48')](_0x53603c);}})[_0x72dc('0x25')](function(_0x39fdd3){if(_0x39fdd3){return _0x39fdd3?{'count':_0x45ba52,'rows':_0x39fdd3}:null;}})[_0x72dc('0x25')](respondWithResult(_0xfa8686,null))['catch'](handleError(_0xfa8686,null));};exports[_0x72dc('0x49')]=function(_0x2fbfbb,_0xce2432,_0x3a8561){var _0x442c9b={};var _0xf8f316={};var _0x3d5955;var _0x2028d5;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x2fbfbb['params']['id']}})['then'](handleEntityNotFound(_0xce2432,null))[_0x72dc('0x25')](function(_0x112081){if(_0x112081){_0x3d5955=_0x112081;_0xf8f316[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db['FreshdeskField'][_0x72dc('0x4a')]);_0xf8f316[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x2fbfbb[_0x72dc('0x2c')]);_0xf8f316['filters']=_[_0x72dc('0x2f')](_0xf8f316['model'],_0xf8f316[_0x72dc('0x2c')]);_0x442c9b[_0x72dc('0x42')]=_[_0x72dc('0x2f')](_0xf8f316[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x2fbfbb['query'][_0x72dc('0x31')]));_0x442c9b[_0x72dc('0x42')]=_0x442c9b['attributes']['length']?_0x442c9b[_0x72dc('0x42')]:_0xf8f316[_0x72dc('0x30')];_0x442c9b[_0x72dc('0x34')]=qs['sort'](_0x2fbfbb[_0x72dc('0x2c')][_0x72dc('0x35')]);_0x442c9b[_0x72dc('0x36')]=qs[_0x72dc('0x2e')](_[_0x72dc('0x37')](_0x2fbfbb[_0x72dc('0x2c')],_0xf8f316[_0x72dc('0x2e')]));if(_0x2fbfbb[_0x72dc('0x2c')][_0x72dc('0x38')]){_0x442c9b[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x442c9b[_0x72dc('0x36')],{'$or':_[_0x72dc('0x29')](_0x442c9b[_0x72dc('0x42')],function(_0x2253e4){var _0x4a114a={};_0x4a114a[_0x2253e4]={'$like':'%'+_0x2fbfbb[_0x72dc('0x2c')][_0x72dc('0x38')]+'%'};return _0x4a114a;})});}_0x442c9b=_[_0x72dc('0x39')]({},_0x442c9b,_0x2fbfbb['options']);return _0x3d5955['getSubjects'](_0x442c9b);}})[_0x72dc('0x25')](function(_0x259f7e){if(_0x259f7e){_0x2028d5=_0x259f7e[_0x72dc('0x32')];if(!_0x2fbfbb['query'][_0x72dc('0x33')](_0x72dc('0x4b'))){_0x442c9b['limit']=qs[_0x72dc('0x1d')](_0x2fbfbb[_0x72dc('0x2c')]['limit']);_0x442c9b['offset']=qs[_0x72dc('0x1c')](_0x2fbfbb['query'][_0x72dc('0x1c')]);}return _0x3d5955['getSubjects'](_0x442c9b);}})[_0x72dc('0x25')](function(_0x2102b0){if(_0x2102b0){return _0x2102b0?{'count':_0x2028d5,'rows':_0x2102b0}:null;}})[_0x72dc('0x25')](respondWithResult(_0xce2432,null))['catch'](handleError(_0xce2432,null));};exports[_0x72dc('0x4c')]=function(_0x4ac2b7,_0x1f71a7,_0x1e0ae0){var _0x3b7d43={};var _0x46f208={};var _0x2b6a59;var _0x597bb2;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x4ac2b7[_0x72dc('0x41')]['id']}})[_0x72dc('0x25')](handleEntityNotFound(_0x1f71a7,null))['then'](function(_0x24b602){if(_0x24b602){_0x2b6a59=_0x24b602;_0x46f208[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db['FreshdeskField'][_0x72dc('0x4a')]);_0x46f208[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x4ac2b7[_0x72dc('0x2c')]);_0x46f208['filters']=_['intersection'](_0x46f208[_0x72dc('0x30')],_0x46f208[_0x72dc('0x2c')]);_0x3b7d43['attributes']=_[_0x72dc('0x2f')](_0x46f208['model'],qs[_0x72dc('0x31')](_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x3b7d43['attributes']=_0x3b7d43[_0x72dc('0x42')][_0x72dc('0x32')]?_0x3b7d43['attributes']:_0x46f208[_0x72dc('0x30')];_0x3b7d43['order']=qs[_0x72dc('0x35')](_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x35')]);_0x3b7d43['where']=qs[_0x72dc('0x2e')](_['pick'](_0x4ac2b7[_0x72dc('0x2c')],_0x46f208[_0x72dc('0x2e')]));if(_0x4ac2b7[_0x72dc('0x2c')]['filter']){_0x3b7d43[_0x72dc('0x36')]=_[_0x72dc('0x39')](_0x3b7d43['where'],{'$or':_[_0x72dc('0x29')](_0x3b7d43[_0x72dc('0x42')],function(_0x1c844f){var _0x399bfd={};_0x399bfd[_0x1c844f]={'$like':'%'+_0x4ac2b7[_0x72dc('0x2c')]['filter']+'%'};return _0x399bfd;})});}_0x3b7d43=_[_0x72dc('0x39')]({},_0x3b7d43,_0x4ac2b7[_0x72dc('0x3b')]);return _0x2b6a59[_0x72dc('0x4c')](_0x3b7d43);}})[_0x72dc('0x25')](function(_0x2cd34e){if(_0x2cd34e){_0x597bb2=_0x2cd34e[_0x72dc('0x32')];if(!_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x33')](_0x72dc('0x4b'))){_0x3b7d43[_0x72dc('0x1d')]=qs[_0x72dc('0x1d')](_0x4ac2b7['query'][_0x72dc('0x1d')]);_0x3b7d43['offset']=qs[_0x72dc('0x1c')](_0x4ac2b7[_0x72dc('0x2c')][_0x72dc('0x1c')]);}return _0x2b6a59['getDescriptions'](_0x3b7d43);}})['then'](function(_0x25460b){if(_0x25460b){return _0x25460b?{'count':_0x597bb2,'rows':_0x25460b}:null;}})[_0x72dc('0x25')](respondWithResult(_0x1f71a7,null))[_0x72dc('0x3f')](handleError(_0x1f71a7,null));};exports['getTags']=function(_0x298034,_0xe02a0d,_0x4bd256){var _0x35c364={};var _0x81b3bd={};var _0x50b495;var _0x40dd9d;return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x298034[_0x72dc('0x41')]['id']}})[_0x72dc('0x25')](handleEntityNotFound(_0xe02a0d,null))[_0x72dc('0x25')](function(_0x13c9e3){if(_0x13c9e3){_0x50b495=_0x13c9e3;_0x81b3bd[_0x72dc('0x30')]=_[_0x72dc('0x2d')](db[_0x72dc('0x4d')][_0x72dc('0x4a')]);_0x81b3bd[_0x72dc('0x2c')]=_[_0x72dc('0x2d')](_0x298034[_0x72dc('0x2c')]);_0x81b3bd[_0x72dc('0x2e')]=_[_0x72dc('0x2f')](_0x81b3bd[_0x72dc('0x30')],_0x81b3bd[_0x72dc('0x2c')]);_0x35c364[_0x72dc('0x42')]=_[_0x72dc('0x2f')](_0x81b3bd[_0x72dc('0x30')],qs[_0x72dc('0x31')](_0x298034[_0x72dc('0x2c')][_0x72dc('0x31')]));_0x35c364[_0x72dc('0x42')]=_0x35c364[_0x72dc('0x42')]['length']?_0x35c364[_0x72dc('0x42')]:_0x81b3bd['model'];_0x35c364[_0x72dc('0x34')]=qs[_0x72dc('0x35')](_0x298034[_0x72dc('0x2c')][_0x72dc('0x35')]);_0x35c364[_0x72dc('0x36')]=qs[_0x72dc('0x2e')](_[_0x72dc('0x37')](_0x298034[_0x72dc('0x2c')],_0x81b3bd[_0x72dc('0x2e')]));if(_0x298034[_0x72dc('0x2c')]['filter']){_0x35c364[_0x72dc('0x36')]=_['merge'](_0x35c364[_0x72dc('0x36')],{'$or':_['map'](_0x35c364['attributes'],function(_0x49b5f6){var _0x2f6d92={};_0x2f6d92[_0x49b5f6]={'$like':'%'+_0x298034[_0x72dc('0x2c')][_0x72dc('0x38')]+'%'};return _0x2f6d92;})});}_0x35c364=_[_0x72dc('0x39')]({},_0x35c364,_0x298034[_0x72dc('0x3b')]);return _0x50b495[_0x72dc('0x4e')](_0x35c364);}})[_0x72dc('0x25')](function(_0x280389){if(_0x280389){_0x40dd9d=_0x280389[_0x72dc('0x32')];if(!_0x298034[_0x72dc('0x2c')][_0x72dc('0x33')]('nolimit')){_0x35c364['limit']=qs[_0x72dc('0x1d')](_0x298034[_0x72dc('0x2c')][_0x72dc('0x1d')]);_0x35c364[_0x72dc('0x1c')]=qs[_0x72dc('0x1c')](_0x298034['query']['offset']);}return _0x50b495['getTags'](_0x35c364);}})[_0x72dc('0x25')](function(_0x491c47){if(_0x491c47){return _0x491c47?{'count':_0x40dd9d,'rows':_0x491c47}:null;}})[_0x72dc('0x25')](respondWithResult(_0xe02a0d,null))[_0x72dc('0x3f')](handleError(_0xe02a0d,null));};exports['setTags']=function(_0x2fd785,_0x2508de,_0x104a0){if(_0x2fd785[_0x72dc('0x45')]['id']){delete _0x2fd785[_0x72dc('0x45')]['id'];}return db[_0x72dc('0x2a')][_0x72dc('0x46')]({'where':{'id':_0x2fd785[_0x72dc('0x41')]['id']}})['then'](handleEntityNotFound(_0x2508de,null))[_0x72dc('0x25')](function(_0x3c265d){if(_0x3c265d){return _0x3c265d[_0x72dc('0x4f')](_0x2fd785[_0x72dc('0x45')]['ids']||[]);}return null;})[_0x72dc('0x25')](respondWithResult(_0x2508de,null))[_0x72dc('0x3f')](handleError(_0x2508de,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index a0c3c75..a8ff8e2 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 _0xeb82=['../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xeb82,0x9e));var _0x2eb8=function(_0x3cdcfb,_0x161e5c){_0x3cdcfb=_0x3cdcfb-0x0;var _0x59f5da=_0xeb82[_0x3cdcfb];return _0x59f5da;};'use strict';var _=require(_0x2eb8('0x0'));var util=require('util');var logger=require(_0x2eb8('0x1'))(_0x2eb8('0x2'));var moment=require(_0x2eb8('0x3'));var BPromise=require(_0x2eb8('0x4'));var rp=require(_0x2eb8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2eb8('0x6'));var config=require(_0x2eb8('0x7'));var attributes=require(_0x2eb8('0x8'));module['exports']=function(_0x19e620,_0x2974bf){return _0x19e620[_0x2eb8('0x9')](_0x2eb8('0xa'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa8e=['../../config/logger','bluebird','request-promise','path','../../config/environment','exports','int_freshdesk_configurations','lodash','util'];(function(_0x1713d1,_0x3eb828){var _0xe2a36f=function(_0x4b8592){while(--_0x4b8592){_0x1713d1['push'](_0x1713d1['shift']());}};_0xe2a36f(++_0x3eb828);}(_0xaa8e,0x97));var _0xeaa8=function(_0x4e3d14,_0x1cefe5){_0x4e3d14=_0x4e3d14-0x0;var _0x565920=_0xaa8e[_0x4e3d14];return _0x565920;};'use strict';var _=require(_0xeaa8('0x0'));var util=require(_0xeaa8('0x1'));var logger=require(_0xeaa8('0x2'))('api');var moment=require('moment');var BPromise=require(_0xeaa8('0x3'));var rp=require(_0xeaa8('0x4'));var fs=require('fs');var path=require(_0xeaa8('0x5'));var rimraf=require('rimraf');var config=require(_0xeaa8('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xeaa8('0x7')]=function(_0x26c0d5,_0xa3c74d){return _0x26c0d5['define']('FreshdeskConfiguration',attributes,{'tableName':_0xeaa8('0x8'),'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 f6cf512..97a0849 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 _0x3e57=['code','FreshdeskConfiguration,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','request','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1701ca,_0x265057){var _0x3f07a9=function(_0x30e204){while(--_0x30e204){_0x1701ca['push'](_0x1701ca['shift']());}};_0x3f07a9(++_0x265057);}(_0x3e57,0x195));var _0x73e5=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x3e57[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var util=require(_0x73e5('0x0'));var moment=require(_0x73e5('0x1'));var BPromise=require(_0x73e5('0x2'));var rs=require(_0x73e5('0x3'));var fs=require('fs');var Redis=require(_0x73e5('0x4'));var db=require(_0x73e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x73e5('0x6'))(_0x73e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x73e5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x580ae2,_0x5ad4bf,_0x426cb5){return new BPromise(function(_0x324fc8,_0x15463e){return client[_0x73e5('0x9')](_0x580ae2,_0x426cb5)['then'](function(_0x4bbeb3){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x5ad4bf,_0x73e5('0xa'));logger[_0x73e5('0xb')](_0x73e5('0xc'),_0x5ad4bf,'request\x20sent',JSON[_0x73e5('0xd')](_0x4bbeb3));if(_0x4bbeb3[_0x73e5('0xe')]){if(_0x4bbeb3[_0x73e5('0xe')][_0x73e5('0xf')]===0x1f4){logger[_0x73e5('0xe')](_0x73e5('0x10'),_0x5ad4bf,_0x4bbeb3[_0x73e5('0xe')][_0x73e5('0x11')]);return _0x15463e(_0x4bbeb3[_0x73e5('0xe')][_0x73e5('0x11')]);}logger['error'](_0x73e5('0x10'),_0x5ad4bf,_0x4bbeb3['error'][_0x73e5('0x11')]);return _0x324fc8(_0x4bbeb3[_0x73e5('0xe')][_0x73e5('0x11')]);}else{logger[_0x73e5('0x12')](_0x73e5('0x10'),_0x5ad4bf,_0x73e5('0xa'));_0x324fc8(_0x4bbeb3[_0x73e5('0x13')][_0x73e5('0x11')]);}})[_0x73e5('0x14')](function(_0x3344d6){logger[_0x73e5('0xe')](_0x73e5('0x10'),_0x5ad4bf,_0x3344d6);_0x15463e(_0x3344d6);});});} \ No newline at end of file +var _0x7e4c=['request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7e4c,0xfc));var _0xc7e4=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0x7e4c[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0xc7e4('0x0'));var util=require(_0xc7e4('0x1'));var moment=require(_0xc7e4('0x2'));var BPromise=require('bluebird');var rs=require(_0xc7e4('0x3'));var fs=require('fs');var Redis=require(_0xc7e4('0x4'));var db=require(_0xc7e4('0x5'))['db'];var utils=require(_0xc7e4('0x6'));var logger=require(_0xc7e4('0x7'))(_0xc7e4('0x8'));var config=require(_0xc7e4('0x9'));var jayson=require(_0xc7e4('0xa'));var client=jayson[_0xc7e4('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef416,_0x3a449,_0x51ac4d){return new BPromise(function(_0x824a78,_0xfe8223){return client[_0xc7e4('0xc')](_0x4ef416,_0x51ac4d)[_0xc7e4('0xd')](function(_0x14a9e1){logger[_0xc7e4('0xe')](_0xc7e4('0xf'),_0x3a449,_0xc7e4('0x10'));logger[_0xc7e4('0x11')](_0xc7e4('0x12'),_0x3a449,_0xc7e4('0x10'),JSON[_0xc7e4('0x13')](_0x14a9e1));if(_0x14a9e1['error']){if(_0x14a9e1[_0xc7e4('0x14')][_0xc7e4('0x15')]===0x1f4){logger['error'](_0xc7e4('0xf'),_0x3a449,_0x14a9e1[_0xc7e4('0x14')]['message']);return _0xfe8223(_0x14a9e1['error'][_0xc7e4('0x16')]);}logger[_0xc7e4('0x14')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a449,_0x14a9e1['error']['message']);return _0x824a78(_0x14a9e1[_0xc7e4('0x14')][_0xc7e4('0x16')]);}else{logger[_0xc7e4('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3a449,_0xc7e4('0x10'));_0x824a78(_0x14a9e1['result'][_0xc7e4('0x16')]);}})[_0xc7e4('0x17')](function(_0x1f4625){logger[_0xc7e4('0x14')](_0xc7e4('0xf'),_0x3a449,_0x1f4625);_0xfe8223(_0x1f4625);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index c450060..adba0a3 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 _0x4e16=['create','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x445ed8,_0x501476){var _0x2d4aab=function(_0x17703f){while(--_0x17703f){_0x445ed8['push'](_0x445ed8['shift']());}};_0x2d4aab(++_0x501476);}(_0x4e16,0x1e4));var _0x64e1=function(_0x39eee5,_0x22efe6){_0x39eee5=_0x39eee5-0x0;var _0x36ad23=_0x4e16[_0x39eee5];return _0x36ad23;};'use strict';var multer=require(_0x64e1('0x0'));var util=require(_0x64e1('0x1'));var path=require(_0x64e1('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x64e1('0x3')]();var fs_extra=require(_0x64e1('0x4'));var auth=require(_0x64e1('0x5'));var interaction=require(_0x64e1('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x64e1('0x7')]('/',auth[_0x64e1('0x8')](),controller[_0x64e1('0x9')]);router[_0x64e1('0x7')](_0x64e1('0xa'),auth['isAuthenticated'](),controller[_0x64e1('0xb')]);router['post']('/',auth[_0x64e1('0x8')](),controller[_0x64e1('0xc')]);router['put'](_0x64e1('0xa'),auth[_0x64e1('0x8')](),controller[_0x64e1('0xd')]);router[_0x64e1('0xe')]('/:id',auth[_0x64e1('0x8')](),controller['destroy']);module[_0x64e1('0xf')]=router; \ No newline at end of file +var _0x88e0=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','post','create','/:id','update','destroy','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x88e0,0x18d));var _0x088e=function(_0x23f125,_0x280031){_0x23f125=_0x23f125-0x0;var _0x2bb414=_0x88e0[_0x23f125];return _0x2bb414;};'use strict';var multer=require(_0x088e('0x0'));var util=require(_0x088e('0x1'));var path=require('path');var timeout=require(_0x088e('0x2'));var express=require(_0x088e('0x3'));var router=express[_0x088e('0x4')]();var fs_extra=require(_0x088e('0x5'));var auth=require(_0x088e('0x6'));var interaction=require(_0x088e('0x7'));var config=require(_0x088e('0x8'));var controller=require(_0x088e('0x9'));router[_0x088e('0xa')]('/',auth[_0x088e('0xb')](),controller[_0x088e('0xc')]);router[_0x088e('0xa')]('/:id',auth[_0x088e('0xb')](),controller['show']);router[_0x088e('0xd')]('/',auth[_0x088e('0xb')](),controller[_0x088e('0xe')]);router['put'](_0x088e('0xf'),auth['isAuthenticated'](),controller[_0x088e('0x10')]);router['delete'](_0x088e('0xf'),auth[_0x088e('0xb')](),controller[_0x088e('0x11')]);module[_0x088e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index e38cccd..acc8d41 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 _0x23af=['picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue'];(function(_0x42cede,_0x2c6fc4){var _0x349bab=function(_0x4c2726){while(--_0x4c2726){_0x42cede['push'](_0x42cede['shift']());}};_0x349bab(++_0x2c6fc4);}(_0x23af,0x1ab));var _0xf23a=function(_0x4278f5,_0xbcb85e){_0x4278f5=_0x4278f5-0x0;var _0x1bb0e2=_0x23af[_0x4278f5];return _0x1bb0e2;};'use strict';var Sequelize=require(_0xf23a('0x0'));module['exports']={'type':{'type':Sequelize[_0xf23a('0x1')]('string',_0xf23a('0x2'),_0xf23a('0x3'),_0xf23a('0x4'),_0xf23a('0x5')),'defaultValue':_0xf23a('0x6')},'content':{'type':Sequelize[_0xf23a('0x7')]},'key':{'type':Sequelize[_0xf23a('0x7')]},'keyType':{'type':Sequelize[_0xf23a('0x1')](_0xf23a('0x6'),_0xf23a('0x2'),_0xf23a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf23a('0x7')]},'customField':{'type':Sequelize[_0xf23a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf23a('0x7')]}}; \ No newline at end of file +var _0x11cc=['picklist','STRING','ENUM','string','variable','customVariable'];(function(_0x680be8,_0x27ad4f){var _0x5ef590=function(_0x2c98bb){while(--_0x2c98bb){_0x680be8['push'](_0x680be8['shift']());}};_0x5ef590(++_0x27ad4f);}(_0x11cc,0x6e));var _0xc11c=function(_0x395b75,_0x5e4170){_0x395b75=_0x395b75-0x0;var _0x21f76c=_0x11cc[_0x395b75];return _0x21f76c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc11c('0x0')](_0xc11c('0x1'),_0xc11c('0x2'),_0xc11c('0x3'),'keyValue',_0xc11c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc11c('0x5')]},'key':{'type':Sequelize[_0xc11c('0x5')]},'keyType':{'type':Sequelize[_0xc11c('0x0')](_0xc11c('0x1'),_0xc11c('0x2'),_0xc11c('0x3'))},'keyContent':{'type':Sequelize[_0xc11c('0x5')]},'idField':{'type':Sequelize[_0xc11c('0x5')]},'nameField':{'type':Sequelize[_0xc11c('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8a3dd31..af983ff 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 _0xa902=['sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','includeAll','include','FreshdeskField','findAll','rows','catch','params','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0xa902,0x8d));var _0x2a90=function(_0x4632cc,_0x23104b){_0x4632cc=_0x4632cc-0x0;var _0x134de3=_0xa902[_0x4632cc];return _0x134de3;};'use strict';var emlformat=require(_0x2a90('0x0'));var rimraf=require(_0x2a90('0x1'));var zipdir=require(_0x2a90('0x2'));var jsonpatch=require(_0x2a90('0x3'));var rp=require(_0x2a90('0x4'));var moment=require('moment');var BPromise=require(_0x2a90('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2a90('0x6'));var sox=require(_0x2a90('0x7'));var csv=require(_0x2a90('0x8'));var ejs=require(_0x2a90('0x9'));var fs=require('fs');var fs_extra=require(_0x2a90('0xa'));var _=require(_0x2a90('0xb'));var squel=require('squel');var crypto=require(_0x2a90('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a90('0x8'));var querystring=require(_0x2a90('0xd'));var Papa=require(_0x2a90('0xe'));var Redis=require(_0x2a90('0xf'));var authService=require(_0x2a90('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2a90('0x11'));var hardwareService=require(_0x2a90('0x12'));var logger=require(_0x2a90('0x13'))(_0x2a90('0x14'));var utils=require('../../config/utils');var config=require(_0x2a90('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a90('0x16'))['db'];function respondWithStatusCode(_0x57458a,_0x1f6953){_0x1f6953=_0x1f6953||0xcc;return function(_0x57aee3){if(_0x57aee3){return _0x57458a[_0x2a90('0x17')](_0x1f6953);}return _0x57458a[_0x2a90('0x18')](_0x1f6953)[_0x2a90('0x19')]();};}function respondWithResult(_0x4c328b,_0x56d1b8){_0x56d1b8=_0x56d1b8||0xc8;return function(_0x57227c){if(_0x57227c){return _0x4c328b[_0x2a90('0x18')](_0x56d1b8)[_0x2a90('0x1a')](_0x57227c);}};}function respondWithFilteredResult(_0x5a2682,_0x1ff63d){return function(_0x21c648){if(_0x21c648){var _0x312782=typeof _0x1ff63d[_0x2a90('0x1b')]===_0x2a90('0x1c')&&typeof _0x1ff63d[_0x2a90('0x1d')]===_0x2a90('0x1c');var _0x10cf94=_0x21c648[_0x2a90('0x1e')];var _0x5c3e4b=_0x312782?0x0:_0x1ff63d[_0x2a90('0x1b')];var _0x1d9a28=_0x312782?_0x21c648[_0x2a90('0x1e')]:_0x1ff63d['offset']+_0x1ff63d[_0x2a90('0x1d')];var _0x1f51a6;if(_0x1d9a28>=_0x10cf94){_0x1d9a28=_0x10cf94;_0x1f51a6=0xc8;}else{_0x1f51a6=0xce;}_0x5a2682[_0x2a90('0x18')](_0x1f51a6);return _0x5a2682[_0x2a90('0x1f')](_0x2a90('0x20'),_0x5c3e4b+'-'+_0x1d9a28+'/'+_0x10cf94)[_0x2a90('0x1a')](_0x21c648);}return null;};}function patchUpdates(_0x312cd5){return function(_0x114d42){try{jsonpatch[_0x2a90('0x21')](_0x114d42,_0x312cd5,!![]);}catch(_0x465284){return BPromise[_0x2a90('0x22')](_0x465284);}return _0x114d42[_0x2a90('0x23')]();};}function saveUpdates(_0x4fdd62,_0x3da7d0){return function(_0x217873){if(_0x217873){return _0x217873[_0x2a90('0x24')](_0x4fdd62)[_0x2a90('0x25')](function(_0x5912fd){return _0x5912fd;});}return null;};}function removeEntity(_0x180485,_0xd033d){return function(_0x4ed9e6){if(_0x4ed9e6){return _0x4ed9e6[_0x2a90('0x26')]()[_0x2a90('0x25')](function(){_0x180485[_0x2a90('0x18')](0xcc)[_0x2a90('0x19')]();});}};}function handleEntityNotFound(_0x2a212c,_0x1303d9){return function(_0x29ed73){if(!_0x29ed73){_0x2a212c[_0x2a90('0x17')](0x194);}return _0x29ed73;};}function handleError(_0x48c2f9,_0x27f883){_0x27f883=_0x27f883||0x1f4;return function(_0x17f978){logger[_0x2a90('0x27')](_0x17f978[_0x2a90('0x28')]);if(_0x17f978[_0x2a90('0x29')]){delete _0x17f978['name'];}_0x48c2f9['status'](_0x27f883)[_0x2a90('0x2a')](_0x17f978);};}exports['index']=function(_0x53391e,_0x4969c3){var _0x2d83b3={},_0x3c78f5={},_0x595638={'count':0x0,'rows':[]};var _0x5bd700=_[_0x2a90('0x2b')](db['FreshdeskField'][_0x2a90('0x2c')],function(_0x6892e1){return{'name':_0x6892e1[_0x2a90('0x2d')],'type':_0x6892e1[_0x2a90('0x2e')][_0x2a90('0x2f')]};});_0x3c78f5[_0x2a90('0x30')]=_[_0x2a90('0x2b')](_0x5bd700,'name');_0x3c78f5[_0x2a90('0x31')]=_[_0x2a90('0x32')](_0x53391e[_0x2a90('0x31')]);_0x3c78f5['filters']=_[_0x2a90('0x33')](_0x3c78f5[_0x2a90('0x30')],_0x3c78f5[_0x2a90('0x31')]);_0x2d83b3[_0x2a90('0x34')]=_['intersection'](_0x3c78f5[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x53391e[_0x2a90('0x31')][_0x2a90('0x35')]));_0x2d83b3[_0x2a90('0x34')]=_0x2d83b3[_0x2a90('0x34')]['length']?_0x2d83b3[_0x2a90('0x34')]:_0x3c78f5[_0x2a90('0x30')];if(!_0x53391e[_0x2a90('0x31')][_0x2a90('0x36')]('nolimit')){_0x2d83b3[_0x2a90('0x1d')]=qs[_0x2a90('0x1d')](_0x53391e['query'][_0x2a90('0x1d')]);_0x2d83b3[_0x2a90('0x1b')]=qs['offset'](_0x53391e['query'][_0x2a90('0x1b')]);}_0x2d83b3[_0x2a90('0x37')]=qs[_0x2a90('0x38')](_0x53391e['query'][_0x2a90('0x38')]);_0x2d83b3['where']=qs[_0x2a90('0x39')](_['pick'](_0x53391e[_0x2a90('0x31')],_0x3c78f5['filters']),_0x5bd700);if(_0x53391e['query'][_0x2a90('0x3a')]){_0x2d83b3['where']=_[_0x2a90('0x3b')](_0x2d83b3[_0x2a90('0x3c')],{'$or':_[_0x2a90('0x2b')](_0x5bd700,function(_0x573aee){if(_0x573aee[_0x2a90('0x2e')]!==_0x2a90('0x3d')){var _0x3be438={};_0x3be438[_0x573aee['name']]={'$like':'%'+_0x53391e[_0x2a90('0x31')][_0x2a90('0x3a')]+'%'};return _0x3be438;}})});}_0x2d83b3=_[_0x2a90('0x3b')]({},_0x2d83b3,_0x53391e['options']);var _0x1aa096={'where':_0x2d83b3[_0x2a90('0x3c')]};return db['FreshdeskField'][_0x2a90('0x1e')](_0x1aa096)[_0x2a90('0x25')](function(_0x2a6bea){_0x595638[_0x2a90('0x1e')]=_0x2a6bea;if(_0x53391e[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x2d83b3[_0x2a90('0x3f')]=[{'all':!![]}];}return db[_0x2a90('0x40')][_0x2a90('0x41')](_0x2d83b3);})[_0x2a90('0x25')](function(_0x45b41c){_0x595638[_0x2a90('0x42')]=_0x45b41c;return _0x595638;})[_0x2a90('0x25')](respondWithFilteredResult(_0x4969c3,_0x2d83b3))[_0x2a90('0x43')](handleError(_0x4969c3,null));};exports['show']=function(_0x45cbc2,_0x3a70fe){var _0x528b41={'raw':!![],'where':{'id':_0x45cbc2[_0x2a90('0x44')]['id']}},_0x1045bb={};_0x1045bb[_0x2a90('0x30')]=_[_0x2a90('0x32')](db[_0x2a90('0x40')]['rawAttributes']);_0x1045bb[_0x2a90('0x31')]=_['keys'](_0x45cbc2[_0x2a90('0x31')]);_0x1045bb['filters']=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],_0x1045bb[_0x2a90('0x31')]);_0x528b41[_0x2a90('0x34')]=_[_0x2a90('0x33')](_0x1045bb[_0x2a90('0x30')],qs[_0x2a90('0x35')](_0x45cbc2['query']['fields']));_0x528b41[_0x2a90('0x34')]=_0x528b41[_0x2a90('0x34')][_0x2a90('0x45')]?_0x528b41[_0x2a90('0x34')]:_0x1045bb[_0x2a90('0x30')];if(_0x45cbc2[_0x2a90('0x31')][_0x2a90('0x3e')]){_0x528b41[_0x2a90('0x3f')]=[{'all':!![]}];}_0x528b41=_['merge']({},_0x528b41,_0x45cbc2[_0x2a90('0x46')]);return db['FreshdeskField'][_0x2a90('0x47')](_0x528b41)[_0x2a90('0x25')](handleEntityNotFound(_0x3a70fe,null))['then'](respondWithResult(_0x3a70fe,null))[_0x2a90('0x43')](handleError(_0x3a70fe,null));};exports[_0x2a90('0x48')]=function(_0x280e63,_0x1d55db){return db[_0x2a90('0x40')][_0x2a90('0x48')](_0x280e63[_0x2a90('0x49')],{})['then'](respondWithResult(_0x1d55db,0xc9))['catch'](handleError(_0x1d55db,null));};exports[_0x2a90('0x24')]=function(_0x2611d0,_0x42c890){if(_0x2611d0[_0x2a90('0x49')]['id']){delete _0x2611d0[_0x2a90('0x49')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x2611d0[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x42c890,null))['then'](saveUpdates(_0x2611d0['body'],null))['then'](respondWithResult(_0x42c890,null))[_0x2a90('0x43')](handleError(_0x42c890,null));};exports['destroy']=function(_0x370da3,_0x3dfe72){return db[_0x2a90('0x40')][_0x2a90('0x47')]({'where':{'id':_0x370da3[_0x2a90('0x44')]['id']}})[_0x2a90('0x25')](handleEntityNotFound(_0x3dfe72,null))['then'](removeEntity(_0x3dfe72,null))[_0x2a90('0x43')](handleError(_0x3dfe72,null));}; \ No newline at end of file +var _0xa699=['index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','FreshdeskField','includeAll','include','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','send'];(function(_0x2dc860,_0x19a1af){var _0x335f46=function(_0x582a20){while(--_0x582a20){_0x2dc860['push'](_0x2dc860['shift']());}};_0x335f46(++_0x19a1af);}(_0xa699,0x6b));var _0x9a69=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xa699[_0x2aefb6];return _0x202772;};'use strict';var emlformat=require(_0x9a69('0x0'));var rimraf=require(_0x9a69('0x1'));var zipdir=require(_0x9a69('0x2'));var jsonpatch=require(_0x9a69('0x3'));var rp=require(_0x9a69('0x4'));var moment=require(_0x9a69('0x5'));var BPromise=require(_0x9a69('0x6'));var Mustache=require(_0x9a69('0x7'));var util=require(_0x9a69('0x8'));var path=require(_0x9a69('0x9'));var sox=require(_0x9a69('0xa'));var csv=require(_0x9a69('0xb'));var ejs=require(_0x9a69('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9a69('0xd'));var squel=require(_0x9a69('0xe'));var crypto=require(_0x9a69('0xf'));var jsforce=require(_0x9a69('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x9a69('0xb'));var querystring=require(_0x9a69('0x11'));var Papa=require(_0x9a69('0x12'));var Redis=require(_0x9a69('0x13'));var authService=require(_0x9a69('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9a69('0x15'));var logger=require('../../config/logger')(_0x9a69('0x16'));var utils=require(_0x9a69('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9a69('0x18'));var db=require(_0x9a69('0x19'))['db'];function respondWithStatusCode(_0x56e43f,_0x81dfb1){_0x81dfb1=_0x81dfb1||0xcc;return function(_0x2e613e){if(_0x2e613e){return _0x56e43f[_0x9a69('0x1a')](_0x81dfb1);}return _0x56e43f[_0x9a69('0x1b')](_0x81dfb1)[_0x9a69('0x1c')]();};}function respondWithResult(_0x70475b,_0x34b5b0){_0x34b5b0=_0x34b5b0||0xc8;return function(_0x2a5b83){if(_0x2a5b83){return _0x70475b[_0x9a69('0x1b')](_0x34b5b0)['json'](_0x2a5b83);}};}function respondWithFilteredResult(_0x2323ae,_0x17de41){return function(_0x2be3ec){if(_0x2be3ec){var _0x5e982d=typeof _0x17de41[_0x9a69('0x1d')]===_0x9a69('0x1e')&&typeof _0x17de41[_0x9a69('0x1f')]===_0x9a69('0x1e');var _0xed2c19=_0x2be3ec['count'];var _0x2e4264=_0x5e982d?0x0:_0x17de41[_0x9a69('0x1d')];var _0x186a5a=_0x5e982d?_0x2be3ec[_0x9a69('0x20')]:_0x17de41[_0x9a69('0x1d')]+_0x17de41[_0x9a69('0x1f')];var _0x2633d5;if(_0x186a5a>=_0xed2c19){_0x186a5a=_0xed2c19;_0x2633d5=0xc8;}else{_0x2633d5=0xce;}_0x2323ae[_0x9a69('0x1b')](_0x2633d5);return _0x2323ae[_0x9a69('0x21')](_0x9a69('0x22'),_0x2e4264+'-'+_0x186a5a+'/'+_0xed2c19)['json'](_0x2be3ec);}return null;};}function patchUpdates(_0x4d8db9){return function(_0x5ebb09){try{jsonpatch[_0x9a69('0x23')](_0x5ebb09,_0x4d8db9,!![]);}catch(_0x12ebe5){return BPromise['reject'](_0x12ebe5);}return _0x5ebb09[_0x9a69('0x24')]();};}function saveUpdates(_0x527ca6,_0x265291){return function(_0x4d6a93){if(_0x4d6a93){return _0x4d6a93['update'](_0x527ca6)['then'](function(_0x189989){return _0x189989;});}return null;};}function removeEntity(_0x5f4138,_0x140cbe){return function(_0x28f5f7){if(_0x28f5f7){return _0x28f5f7[_0x9a69('0x25')]()[_0x9a69('0x26')](function(){_0x5f4138['status'](0xcc)[_0x9a69('0x1c')]();});}};}function handleEntityNotFound(_0x5130b2,_0x203d32){return function(_0x4ef126){if(!_0x4ef126){_0x5130b2['sendStatus'](0x194);}return _0x4ef126;};}function handleError(_0xbcdcd9,_0xf6fea2){_0xf6fea2=_0xf6fea2||0x1f4;return function(_0x268cef){logger[_0x9a69('0x27')](_0x268cef[_0x9a69('0x28')]);if(_0x268cef[_0x9a69('0x29')]){delete _0x268cef[_0x9a69('0x29')];}_0xbcdcd9[_0x9a69('0x1b')](_0xf6fea2)[_0x9a69('0x2a')](_0x268cef);};}exports[_0x9a69('0x2b')]=function(_0x47916a,_0x1ff48e){var _0x165a87={},_0x5433b3={},_0x54e643={'count':0x0,'rows':[]};var _0x4b3539=_[_0x9a69('0x2c')](db['FreshdeskField'][_0x9a69('0x2d')],function(_0x2d15e3){return{'name':_0x2d15e3[_0x9a69('0x2e')],'type':_0x2d15e3[_0x9a69('0x2f')][_0x9a69('0x30')]};});_0x5433b3[_0x9a69('0x31')]=_[_0x9a69('0x2c')](_0x4b3539,_0x9a69('0x29'));_0x5433b3[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x47916a[_0x9a69('0x32')]);_0x5433b3[_0x9a69('0x34')]=_[_0x9a69('0x35')](_0x5433b3[_0x9a69('0x31')],_0x5433b3[_0x9a69('0x32')]);_0x165a87[_0x9a69('0x36')]=_[_0x9a69('0x35')](_0x5433b3['model'],qs['fields'](_0x47916a[_0x9a69('0x32')][_0x9a69('0x37')]));_0x165a87[_0x9a69('0x36')]=_0x165a87[_0x9a69('0x36')][_0x9a69('0x38')]?_0x165a87['attributes']:_0x5433b3['model'];if(!_0x47916a['query']['hasOwnProperty'](_0x9a69('0x39'))){_0x165a87[_0x9a69('0x1f')]=qs[_0x9a69('0x1f')](_0x47916a[_0x9a69('0x32')][_0x9a69('0x1f')]);_0x165a87[_0x9a69('0x1d')]=qs['offset'](_0x47916a['query'][_0x9a69('0x1d')]);}_0x165a87[_0x9a69('0x3a')]=qs[_0x9a69('0x3b')](_0x47916a['query'][_0x9a69('0x3b')]);_0x165a87[_0x9a69('0x3c')]=qs[_0x9a69('0x34')](_[_0x9a69('0x3d')](_0x47916a[_0x9a69('0x32')],_0x5433b3[_0x9a69('0x34')]),_0x4b3539);if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]){_0x165a87[_0x9a69('0x3c')]=_[_0x9a69('0x3f')](_0x165a87[_0x9a69('0x3c')],{'$or':_['map'](_0x4b3539,function(_0x1ac0b7){if(_0x1ac0b7['type']!=='VIRTUAL'){var _0x4cc399={};_0x4cc399[_0x1ac0b7['name']]={'$like':'%'+_0x47916a[_0x9a69('0x32')][_0x9a69('0x3e')]+'%'};return _0x4cc399;}})});}_0x165a87=_['merge']({},_0x165a87,_0x47916a['options']);var _0x5a1e62={'where':_0x165a87[_0x9a69('0x3c')]};return db[_0x9a69('0x40')][_0x9a69('0x20')](_0x5a1e62)['then'](function(_0x2ff507){_0x54e643[_0x9a69('0x20')]=_0x2ff507;if(_0x47916a[_0x9a69('0x32')][_0x9a69('0x41')]){_0x165a87[_0x9a69('0x42')]=[{'all':!![]}];}return db[_0x9a69('0x40')]['findAll'](_0x165a87);})[_0x9a69('0x26')](function(_0x27d0db){_0x54e643[_0x9a69('0x43')]=_0x27d0db;return _0x54e643;})[_0x9a69('0x26')](respondWithFilteredResult(_0x1ff48e,_0x165a87))['catch'](handleError(_0x1ff48e,null));};exports[_0x9a69('0x44')]=function(_0x373939,_0x5b309a){var _0x318de1={'raw':!![],'where':{'id':_0x373939[_0x9a69('0x45')]['id']}},_0x3c78e2={};_0x3c78e2['model']=_['keys'](db['FreshdeskField'][_0x9a69('0x2d')]);_0x3c78e2[_0x9a69('0x32')]=_[_0x9a69('0x33')](_0x373939[_0x9a69('0x32')]);_0x3c78e2['filters']=_[_0x9a69('0x35')](_0x3c78e2[_0x9a69('0x31')],_0x3c78e2[_0x9a69('0x32')]);_0x318de1[_0x9a69('0x36')]=_['intersection'](_0x3c78e2[_0x9a69('0x31')],qs[_0x9a69('0x37')](_0x373939[_0x9a69('0x32')][_0x9a69('0x37')]));_0x318de1['attributes']=_0x318de1[_0x9a69('0x36')]['length']?_0x318de1[_0x9a69('0x36')]:_0x3c78e2['model'];if(_0x373939[_0x9a69('0x32')]['includeAll']){_0x318de1[_0x9a69('0x42')]=[{'all':!![]}];}_0x318de1=_['merge']({},_0x318de1,_0x373939[_0x9a69('0x46')]);return db[_0x9a69('0x40')][_0x9a69('0x47')](_0x318de1)[_0x9a69('0x26')](handleEntityNotFound(_0x5b309a,null))['then'](respondWithResult(_0x5b309a,null))[_0x9a69('0x48')](handleError(_0x5b309a,null));};exports[_0x9a69('0x49')]=function(_0x77781d,_0x2537b0){return db[_0x9a69('0x40')][_0x9a69('0x49')](_0x77781d[_0x9a69('0x4a')],{})[_0x9a69('0x26')](respondWithResult(_0x2537b0,0xc9))[_0x9a69('0x48')](handleError(_0x2537b0,null));};exports['update']=function(_0x281ef0,_0x6046a7){if(_0x281ef0[_0x9a69('0x4a')]['id']){delete _0x281ef0[_0x9a69('0x4a')]['id'];}return db[_0x9a69('0x40')][_0x9a69('0x47')]({'where':{'id':_0x281ef0[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x6046a7,null))[_0x9a69('0x26')](saveUpdates(_0x281ef0[_0x9a69('0x4a')],null))[_0x9a69('0x26')](respondWithResult(_0x6046a7,null))[_0x9a69('0x48')](handleError(_0x6046a7,null));};exports[_0x9a69('0x25')]=function(_0x43b084,_0x18ab7a){return db['FreshdeskField'][_0x9a69('0x47')]({'where':{'id':_0x43b084[_0x9a69('0x45')]['id']}})[_0x9a69('0x26')](handleEntityNotFound(_0x18ab7a,null))[_0x9a69('0x26')](removeEntity(_0x18ab7a,null))[_0x9a69('0x48')](handleError(_0x18ab7a,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 5dc3f9d..74f2783 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 _0xc4a1=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x2eaff4,_0x4852b7){var _0x278c7a=function(_0x9a80f6){while(--_0x9a80f6){_0x2eaff4['push'](_0x2eaff4['shift']());}};_0x278c7a(++_0x4852b7);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x7eca25,_0x3cb2c5){_0x7eca25=_0x7eca25-0x0;var _0x38a809=_0xc4a1[_0x7eca25];return _0x38a809;};'use strict';var _=require(_0x1c4a('0x0'));var util=require('util');var logger=require(_0x1c4a('0x1'))(_0x1c4a('0x2'));var moment=require(_0x1c4a('0x3'));var BPromise=require('bluebird');var rp=require(_0x1c4a('0x4'));var fs=require('fs');var path=require(_0x1c4a('0x5'));var rimraf=require(_0x1c4a('0x6'));var config=require(_0x1c4a('0x7'));var attributes=require(_0x1c4a('0x8'));module[_0x1c4a('0x9')]=function(_0x2685b1,_0x4732b2){return _0x2685b1[_0x1c4a('0xa')](_0x1c4a('0xb'),attributes,{'tableName':_0x1c4a('0xc'),'paranoid':![],'indexes':[{'name':_0x1c4a('0xd'),'fields':[_0x1c4a('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d82=['api','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','FieldId','lodash'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x3d82,0x117));var _0x23d8=function(_0x17b6f9,_0x279598){_0x17b6f9=_0x17b6f9-0x0;var _0x1e2c1a=_0x3d82[_0x17b6f9];return _0x1e2c1a;};'use strict';var _=require(_0x23d8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x23d8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x23d8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23d8('0x3'));var config=require(_0x23d8('0x4'));var attributes=require(_0x23d8('0x5'));module[_0x23d8('0x6')]=function(_0x3a5203,_0x1aef23){return _0x3a5203['define'](_0x23d8('0x7'),attributes,{'tableName':_0x23d8('0x8'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x23d8('0x9')],'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 e177f40..4b54c31 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 _0xadf0=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x493df0,_0x3808fe){var _0x4b6a03=function(_0x4a4228){while(--_0x4a4228){_0x493df0['push'](_0x493df0['shift']());}};_0x4b6a03(++_0x3808fe);}(_0xadf0,0x120));var _0x0adf=function(_0x129d5b,_0x7c8c14){_0x129d5b=_0x129d5b-0x0;var _0x51a919=_0xadf0[_0x129d5b];return _0x51a919;};'use strict';var _=require(_0x0adf('0x0'));var util=require(_0x0adf('0x1'));var moment=require(_0x0adf('0x2'));var BPromise=require(_0x0adf('0x3'));var rs=require(_0x0adf('0x4'));var fs=require('fs');var Redis=require(_0x0adf('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0adf('0x6'));var logger=require('../../config/logger')(_0x0adf('0x7'));var config=require(_0x0adf('0x8'));var jayson=require(_0x0adf('0x9'));var client=jayson[_0x0adf('0xa')][_0x0adf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x198a9c,_0x4921e0,_0x44d8d4){return new BPromise(function(_0x1c7beb,_0x33c420){return client['request'](_0x198a9c,_0x44d8d4)['then'](function(_0x2ea8c4){logger['info'](_0x0adf('0xc'),_0x4921e0,_0x0adf('0xd'));logger[_0x0adf('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4921e0,_0x0adf('0xd'),JSON[_0x0adf('0xf')](_0x2ea8c4));if(_0x2ea8c4[_0x0adf('0x10')]){if(_0x2ea8c4[_0x0adf('0x10')][_0x0adf('0x11')]===0x1f4){logger[_0x0adf('0x10')](_0x0adf('0xc'),_0x4921e0,_0x2ea8c4[_0x0adf('0x10')]['message']);return _0x33c420(_0x2ea8c4[_0x0adf('0x10')][_0x0adf('0x12')]);}logger[_0x0adf('0x10')](_0x0adf('0xc'),_0x4921e0,_0x2ea8c4['error'][_0x0adf('0x12')]);return _0x1c7beb(_0x2ea8c4[_0x0adf('0x10')][_0x0adf('0x12')]);}else{logger[_0x0adf('0x13')](_0x0adf('0xc'),_0x4921e0,_0x0adf('0xd'));_0x1c7beb(_0x2ea8c4[_0x0adf('0x14')][_0x0adf('0x12')]);}})[_0x0adf('0x15')](function(_0x572752){logger[_0x0adf('0x10')](_0x0adf('0xc'),_0x4921e0,_0x572752);_0x33c420(_0x572752);});});} \ No newline at end of file +var _0xe397=['FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe397,0x172));var _0x7e39=function(_0x556c31,_0x27f18a){_0x556c31=_0x556c31-0x0;var _0x954887=_0xe397[_0x556c31];return _0x954887;};'use strict';var _=require(_0x7e39('0x0'));var util=require(_0x7e39('0x1'));var moment=require(_0x7e39('0x2'));var BPromise=require(_0x7e39('0x3'));var rs=require(_0x7e39('0x4'));var fs=require('fs');var Redis=require(_0x7e39('0x5'));var db=require(_0x7e39('0x6'))['db'];var utils=require(_0x7e39('0x7'));var logger=require('../../config/logger')(_0x7e39('0x8'));var config=require(_0x7e39('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7e39('0xa')][_0x7e39('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e6356,_0x3940c5,_0x2e58ea){return new BPromise(function(_0x12ada1,_0x18d354){return client[_0x7e39('0xc')](_0x1e6356,_0x2e58ea)['then'](function(_0x443ac7){logger[_0x7e39('0xd')](_0x7e39('0xe'),_0x3940c5,_0x7e39('0xf'));logger[_0x7e39('0x10')](_0x7e39('0x11'),_0x3940c5,_0x7e39('0xf'),JSON[_0x7e39('0x12')](_0x443ac7));if(_0x443ac7[_0x7e39('0x13')]){if(_0x443ac7[_0x7e39('0x13')][_0x7e39('0x14')]===0x1f4){logger[_0x7e39('0x13')](_0x7e39('0xe'),_0x3940c5,_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);return _0x18d354(_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);}logger[_0x7e39('0x13')](_0x7e39('0xe'),_0x3940c5,_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);return _0x12ada1(_0x443ac7[_0x7e39('0x13')][_0x7e39('0x15')]);}else{logger[_0x7e39('0xd')](_0x7e39('0xe'),_0x3940c5,_0x7e39('0xf'));_0x12ada1(_0x443ac7[_0x7e39('0x16')][_0x7e39('0x15')]);}})[_0x7e39('0x17')](function(_0x269868){logger[_0x7e39('0x13')](_0x7e39('0xe'),_0x3940c5,_0x269868);_0x18d354(_0x269868);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d19b48b..55b0f8f 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 _0xe511=['get','index','show','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x560110,_0x4c8b75){var _0x51abdf=function(_0x156738){while(--_0x156738){_0x560110['push'](_0x560110['shift']());}};_0x51abdf(++_0x4c8b75);}(_0xe511,0x16f));var _0x1e51=function(_0x33b09c,_0x1cc2a6){_0x33b09c=_0x33b09c-0x0;var _0x508ac6=_0xe511[_0x33b09c];return _0x508ac6;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x1e51('0xb')]);router[_0x1e51('0x8')](_0x1e51('0xc'),auth[_0x1e51('0xd')](),controller[_0x1e51('0xe')]);router[_0x1e51('0xf')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x10')]);router[_0x1e51('0xf')](_0x1e51('0x11'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x12')]);router[_0x1e51('0x13')]('/:id',auth[_0x1e51('0xd')](),controller[_0x1e51('0x14')]);router[_0x1e51('0x15')](_0x1e51('0x16'),auth[_0x1e51('0xd')](),controller[_0x1e51('0x17')]);module[_0x1e51('0x18')]=router; \ No newline at end of file +var _0xd87e=['post','create','addConfiguration','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','/:id','show','get','getConfigurations','/:id/fields','getFields'];(function(_0xc0eacc,_0x1ef0ad){var _0x1742a8=function(_0x3c413d){while(--_0x3c413d){_0xc0eacc['push'](_0xc0eacc['shift']());}};_0x1742a8(++_0x1ef0ad);}(_0xd87e,0x1bf));var _0xed87=function(_0x5f150e,_0x5e3a1e){_0x5f150e=_0x5f150e-0x0;var _0x2f6957=_0xd87e[_0x5f150e];return _0x2f6957;};'use strict';var multer=require(_0xed87('0x0'));var util=require(_0xed87('0x1'));var path=require('path');var timeout=require(_0xed87('0x2'));var express=require(_0xed87('0x3'));var router=express[_0xed87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xed87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed87('0x6'));var controller=require(_0xed87('0x7'));router['get']('/',auth[_0xed87('0x8')](),controller['index']);router['get'](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0xa')]);router[_0xed87('0xb')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0xc')]);router[_0xed87('0xb')](_0xed87('0xd'),auth[_0xed87('0x8')](),controller[_0xed87('0xe')]);router[_0xed87('0xf')]('/',auth['isAuthenticated'](),controller[_0xed87('0x10')]);router[_0xed87('0xf')]('/:id/configurations',auth[_0xed87('0x8')](),controller[_0xed87('0x11')]);router['put']('/:id',auth[_0xed87('0x8')](),controller[_0xed87('0x12')]);router[_0xed87('0x13')](_0xed87('0x9'),auth[_0xed87('0x8')](),controller[_0xed87('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 1cb0555..56d2958 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x16a261,_0x13d84f){var _0x40d449=function(_0x1a7435){while(--_0x1a7435){_0x16a261['push'](_0x16a261['shift']());}};_0x40d449(++_0x13d84f);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x1c19bf,_0x9576b6){_0x1c19bf=_0x1c19bf-0x0;var _0x2a279e=_0x4e2e[_0x1c19bf];return _0x2a279e;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd943=['exports','STRING','username','remoteUri','sequelize'];(function(_0x330e59,_0x31f733){var _0x26feeb=function(_0x350588){while(--_0x350588){_0x330e59['push'](_0x330e59['shift']());}};_0x26feeb(++_0x31f733);}(_0xd943,0x15d));var _0x3d94=function(_0x3457e8,_0x29054b){_0x3457e8=_0x3457e8-0x0;var _0x226a95=_0xd943[_0x3457e8];return _0x226a95;};'use strict';var Sequelize=require(_0x3d94('0x0'));module[_0x3d94('0x1')]={'name':{'type':Sequelize[_0x3d94('0x2')]},'description':{'type':Sequelize[_0x3d94('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x3d94('0x3')},'apiKey':{'type':Sequelize[_0x3d94('0x2')]},'remoteUri':{'type':Sequelize[_0x3d94('0x2')],'unique':_0x3d94('0x4')},'serverUrl':{'type':Sequelize[_0x3d94('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 9764a73..58138dd 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 _0xac1b=['VIRTUAL','FreshsalesAccount','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','findOne','order','AccountId','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','merge'];(function(_0x595c97,_0x52ee9e){var _0x44ad37=function(_0x3b99d5){while(--_0x3b99d5){_0x595c97['push'](_0x595c97['shift']());}};_0x44ad37(++_0x52ee9e);}(_0xac1b,0x1b4));var _0xbac1=function(_0x11f102,_0x7d3731){_0x11f102=_0x11f102-0x0;var _0x3423b4=_0xac1b[_0x11f102];return _0x3423b4;};'use strict';var emlformat=require(_0xbac1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbac1('0x1'));var jsonpatch=require(_0xbac1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbac1('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbac1('0x4'));var ejs=require(_0xbac1('0x5'));var fs=require('fs');var fs_extra=require(_0xbac1('0x6'));var _=require(_0xbac1('0x7'));var squel=require(_0xbac1('0x8'));var crypto=require(_0xbac1('0x9'));var jsforce=require(_0xbac1('0xa'));var deskjs=require(_0xbac1('0xb'));var toCsv=require(_0xbac1('0x4'));var querystring=require(_0xbac1('0xc'));var Papa=require('papaparse');var Redis=require(_0xbac1('0xd'));var authService=require(_0xbac1('0xe'));var qs=require(_0xbac1('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbac1('0x10'));var logger=require('../../config/logger')(_0xbac1('0x11'));var utils=require('../../config/utils');var config=require(_0xbac1('0x12'));var licenseUtil=require(_0xbac1('0x13'));var db=require(_0xbac1('0x14'))['db'];var integrations=require(_0xbac1('0x15'));function respondWithStatusCode(_0xdeff3e,_0x140c39){_0x140c39=_0x140c39||0xcc;return function(_0x372dd5){if(_0x372dd5){return _0xdeff3e[_0xbac1('0x16')](_0x140c39);}return _0xdeff3e[_0xbac1('0x17')](_0x140c39)[_0xbac1('0x18')]();};}function respondWithResult(_0x504653,_0x3a671b){_0x3a671b=_0x3a671b||0xc8;return function(_0x5e5383){if(_0x5e5383){return _0x504653[_0xbac1('0x17')](_0x3a671b)[_0xbac1('0x19')](_0x5e5383);}};}function respondWithFilteredResult(_0x7e525b,_0xcc6fb5){return function(_0x413504){if(_0x413504){var _0x30e983=typeof _0xcc6fb5[_0xbac1('0x1a')]===_0xbac1('0x1b')&&typeof _0xcc6fb5['limit']===_0xbac1('0x1b');var _0x13e597=_0x413504[_0xbac1('0x1c')];var _0x4caf89=_0x30e983?0x0:_0xcc6fb5[_0xbac1('0x1a')];var _0x8dcec2=_0x30e983?_0x413504['count']:_0xcc6fb5[_0xbac1('0x1a')]+_0xcc6fb5['limit'];var _0x1a3e23;if(_0x8dcec2>=_0x13e597){_0x8dcec2=_0x13e597;_0x1a3e23=0xc8;}else{_0x1a3e23=0xce;}_0x7e525b[_0xbac1('0x17')](_0x1a3e23);return _0x7e525b['set']('Content-Range',_0x4caf89+'-'+_0x8dcec2+'/'+_0x13e597)[_0xbac1('0x19')](_0x413504);}return null;};}function patchUpdates(_0xcdea3f){return function(_0x33e405){try{jsonpatch[_0xbac1('0x1d')](_0x33e405,_0xcdea3f,!![]);}catch(_0x163de7){return BPromise['reject'](_0x163de7);}return _0x33e405[_0xbac1('0x1e')]();};}function saveUpdates(_0x232fdf,_0x5bd27a){return function(_0x564f7f){if(_0x564f7f){return _0x564f7f[_0xbac1('0x1f')](_0x232fdf)[_0xbac1('0x20')](function(_0x583438){return _0x583438;});}return null;};}function removeEntity(_0x2aad66,_0xc7da39){return function(_0x10bd11){if(_0x10bd11){return _0x10bd11[_0xbac1('0x21')]()[_0xbac1('0x20')](function(){_0x2aad66[_0xbac1('0x17')](0xcc)[_0xbac1('0x18')]();});}};}function handleEntityNotFound(_0x390e5a,_0x396a32){return function(_0x16c97b){if(!_0x16c97b){_0x390e5a[_0xbac1('0x16')](0x194);}return _0x16c97b;};}function handleError(_0x2a907d,_0x4f6423){_0x4f6423=_0x4f6423||0x1f4;return function(_0x7f97f){logger[_0xbac1('0x22')](_0x7f97f[_0xbac1('0x23')]);if(_0x7f97f[_0xbac1('0x24')]){delete _0x7f97f[_0xbac1('0x24')];}_0x2a907d[_0xbac1('0x17')](_0x4f6423)['send'](_0x7f97f);};}exports[_0xbac1('0x25')]=function(_0x54f56b,_0x589844){var _0xd46798={},_0x1cd3e6={},_0x342f6c={'count':0x0,'rows':[]};var _0x34284e=_['map'](db['FreshsalesAccount'][_0xbac1('0x26')],function(_0x161ce3){return{'name':_0x161ce3[_0xbac1('0x27')],'type':_0x161ce3[_0xbac1('0x28')][_0xbac1('0x29')]};});_0x1cd3e6[_0xbac1('0x2a')]=_[_0xbac1('0x2b')](_0x34284e,_0xbac1('0x24'));_0x1cd3e6[_0xbac1('0x2c')]=_[_0xbac1('0x2d')](_0x54f56b[_0xbac1('0x2c')]);_0x1cd3e6['filters']=_[_0xbac1('0x2e')](_0x1cd3e6['model'],_0x1cd3e6[_0xbac1('0x2c')]);_0xd46798[_0xbac1('0x2f')]=_[_0xbac1('0x2e')](_0x1cd3e6[_0xbac1('0x2a')],qs['fields'](_0x54f56b[_0xbac1('0x2c')][_0xbac1('0x30')]));_0xd46798[_0xbac1('0x2f')]=_0xd46798[_0xbac1('0x2f')][_0xbac1('0x31')]?_0xd46798[_0xbac1('0x2f')]:_0x1cd3e6[_0xbac1('0x2a')];if(!_0x54f56b[_0xbac1('0x2c')][_0xbac1('0x32')](_0xbac1('0x33'))){_0xd46798[_0xbac1('0x34')]=qs[_0xbac1('0x34')](_0x54f56b[_0xbac1('0x2c')][_0xbac1('0x34')]);_0xd46798['offset']=qs['offset'](_0x54f56b['query']['offset']);}_0xd46798['order']=qs['sort'](_0x54f56b[_0xbac1('0x2c')][_0xbac1('0x35')]);_0xd46798[_0xbac1('0x36')]=qs[_0xbac1('0x37')](_[_0xbac1('0x38')](_0x54f56b['query'],_0x1cd3e6[_0xbac1('0x37')]),_0x34284e);if(_0x54f56b[_0xbac1('0x2c')][_0xbac1('0x39')]){_0xd46798[_0xbac1('0x36')]=_[_0xbac1('0x3a')](_0xd46798[_0xbac1('0x36')],{'$or':_[_0xbac1('0x2b')](_0x34284e,function(_0x2b4026){if(_0x2b4026[_0xbac1('0x28')]!==_0xbac1('0x3b')){var _0x19f708={};_0x19f708[_0x2b4026[_0xbac1('0x24')]]={'$like':'%'+_0x54f56b[_0xbac1('0x2c')][_0xbac1('0x39')]+'%'};return _0x19f708;}})});}_0xd46798=_[_0xbac1('0x3a')]({},_0xd46798,_0x54f56b['options']);var _0x2936ca={'where':_0xd46798[_0xbac1('0x36')]};return db[_0xbac1('0x3c')][_0xbac1('0x1c')](_0x2936ca)['then'](function(_0x4b065f){_0x342f6c[_0xbac1('0x1c')]=_0x4b065f;if(_0x54f56b[_0xbac1('0x2c')]['includeAll']){_0xd46798[_0xbac1('0x3d')]=[{'all':!![]}];}return db[_0xbac1('0x3c')][_0xbac1('0x3e')](_0xd46798);})[_0xbac1('0x20')](function(_0x537d39){_0x342f6c[_0xbac1('0x3f')]=_0x537d39;return _0x342f6c;})[_0xbac1('0x20')](respondWithFilteredResult(_0x589844,_0xd46798))[_0xbac1('0x40')](handleError(_0x589844,null));};exports[_0xbac1('0x41')]=function(_0x426d26,_0x6b5608){var _0x4f6d44={'raw':![],'where':{'id':_0x426d26[_0xbac1('0x42')]['id']}},_0x4c37c6={};_0x4c37c6['model']=_[_0xbac1('0x2d')](db[_0xbac1('0x3c')][_0xbac1('0x26')]);_0x4c37c6[_0xbac1('0x2c')]=_['keys'](_0x426d26[_0xbac1('0x2c')]);_0x4c37c6['filters']=_[_0xbac1('0x2e')](_0x4c37c6['model'],_0x4c37c6['query']);_0x4f6d44[_0xbac1('0x2f')]=_[_0xbac1('0x2e')](_0x4c37c6['model'],qs[_0xbac1('0x30')](_0x426d26[_0xbac1('0x2c')][_0xbac1('0x30')]));_0x4f6d44[_0xbac1('0x2f')]=_0x4f6d44[_0xbac1('0x2f')][_0xbac1('0x31')]?_0x4f6d44[_0xbac1('0x2f')]:_0x4c37c6['model'];if(_0x426d26['query'][_0xbac1('0x43')]){_0x4f6d44[_0xbac1('0x3d')]=[{'all':!![]}];}_0x4f6d44=_[_0xbac1('0x3a')]({},_0x4f6d44,_0x426d26[_0xbac1('0x44')]);return db['FreshsalesAccount'][_0xbac1('0x45')](_0x4f6d44)['then'](handleEntityNotFound(_0x6b5608,null))[_0xbac1('0x20')](respondWithResult(_0x6b5608,null))['catch'](handleError(_0x6b5608,null));};exports[_0xbac1('0x46')]=function(_0x3688b6,_0x11580c){return db[_0xbac1('0x3c')][_0xbac1('0x46')](_0x3688b6[_0xbac1('0x47')],{})[_0xbac1('0x20')](respondWithResult(_0x11580c,0xc9))['catch'](handleError(_0x11580c,null));};exports[_0xbac1('0x1f')]=function(_0x52d5e6,_0x37b12){if(_0x52d5e6[_0xbac1('0x47')]['id']){delete _0x52d5e6['body']['id'];}return db[_0xbac1('0x3c')][_0xbac1('0x45')]({'where':{'id':_0x52d5e6[_0xbac1('0x42')]['id']}})[_0xbac1('0x20')](handleEntityNotFound(_0x37b12,null))[_0xbac1('0x20')](saveUpdates(_0x52d5e6[_0xbac1('0x47')],null))[_0xbac1('0x20')](respondWithResult(_0x37b12,null))[_0xbac1('0x40')](handleError(_0x37b12,null));};exports['destroy']=function(_0x3f6b93,_0x4cc825){return db['FreshsalesAccount'][_0xbac1('0x45')]({'where':{'id':_0x3f6b93[_0xbac1('0x42')]['id']}})[_0xbac1('0x20')](handleEntityNotFound(_0x4cc825,null))['then'](removeEntity(_0x4cc825,null))[_0xbac1('0x40')](handleError(_0x4cc825,null));};exports['getConfigurations']=function(_0x138aea,_0x24ee48,_0x29cae6){var _0xc39aab={};var _0x2cf8ed={};var _0x410858;var _0x2080b3;return db[_0xbac1('0x3c')][_0xbac1('0x48')]({'where':{'id':_0x138aea[_0xbac1('0x42')]['id']}})['then'](handleEntityNotFound(_0x24ee48,null))[_0xbac1('0x20')](function(_0x4ee5e1){if(_0x4ee5e1){_0x410858=_0x4ee5e1;_0x2cf8ed[_0xbac1('0x2a')]=_['keys'](db['FreshsalesConfiguration'][_0xbac1('0x26')]);_0x2cf8ed[_0xbac1('0x2c')]=_[_0xbac1('0x2d')](_0x138aea[_0xbac1('0x2c')]);_0x2cf8ed['filters']=_[_0xbac1('0x2e')](_0x2cf8ed['model'],_0x2cf8ed['query']);_0xc39aab['attributes']=_['intersection'](_0x2cf8ed[_0xbac1('0x2a')],qs[_0xbac1('0x30')](_0x138aea['query'][_0xbac1('0x30')]));_0xc39aab[_0xbac1('0x2f')]=_0xc39aab['attributes'][_0xbac1('0x31')]?_0xc39aab[_0xbac1('0x2f')]:_0x2cf8ed[_0xbac1('0x2a')];_0xc39aab[_0xbac1('0x49')]=qs['sort'](_0x138aea['query'][_0xbac1('0x35')]);_0xc39aab[_0xbac1('0x36')]=qs['filters'](_[_0xbac1('0x38')](_0x138aea['query'],_0x2cf8ed['filters']));if(_0x138aea['query'][_0xbac1('0x39')]){_0xc39aab[_0xbac1('0x36')]=_[_0xbac1('0x3a')](_0xc39aab['where'],{'$or':_[_0xbac1('0x2b')](_0xc39aab[_0xbac1('0x2f')],function(_0x3f5d45){var _0x55026f={};_0x55026f[_0x3f5d45]={'$like':'%'+_0x138aea[_0xbac1('0x2c')]['filter']+'%'};return _0x55026f;})});}_0xc39aab=_[_0xbac1('0x3a')]({},_0xc39aab,_0x138aea[_0xbac1('0x44')]);return _0x410858['getConfigurations'](_0xc39aab);}})[_0xbac1('0x20')](function(_0x3aa4ad){if(_0x3aa4ad){_0x2080b3=_0x3aa4ad[_0xbac1('0x31')];if(!_0x138aea[_0xbac1('0x2c')][_0xbac1('0x32')](_0xbac1('0x33'))){_0xc39aab['limit']=qs[_0xbac1('0x34')](_0x138aea[_0xbac1('0x2c')]['limit']);_0xc39aab[_0xbac1('0x1a')]=qs[_0xbac1('0x1a')](_0x138aea[_0xbac1('0x2c')][_0xbac1('0x1a')]);}return _0x410858['getConfigurations'](_0xc39aab);}})['then'](function(_0x3d3970){if(_0x3d3970){return _0x3d3970?{'count':_0x2080b3,'rows':_0x3d3970}:null;}})[_0xbac1('0x20')](respondWithResult(_0x24ee48,null))[_0xbac1('0x40')](handleError(_0x24ee48,null));};exports['addConfiguration']=function(_0x232f42,_0x954e17,_0x2d3e3b){if(_0x232f42[_0xbac1('0x47')]['id']){delete _0x232f42['body']['id'];}return db[_0xbac1('0x3c')]['findOne']({'where':{'id':_0x232f42[_0xbac1('0x42')]['id']}})['then'](handleEntityNotFound(_0x954e17,null))[_0xbac1('0x20')](function(_0x3775f5){if(_0x3775f5){_0x232f42[_0xbac1('0x47')][_0xbac1('0x4a')]=_0x3775f5['id'];_0x232f42[_0xbac1('0x47')]['Subjects']=integrations['getSubjects'](_0x232f42['body'][_0xbac1('0x4b')],_0x232f42[_0xbac1('0x47')][_0xbac1('0x28')]);_0x232f42[_0xbac1('0x47')][_0xbac1('0x4c')]=integrations[_0xbac1('0x4d')](_0x232f42[_0xbac1('0x47')][_0xbac1('0x4b')],_0x232f42[_0xbac1('0x47')][_0xbac1('0x28')]);return db['FreshsalesConfiguration']['create'](_0x232f42[_0xbac1('0x47')],{'include':[{'model':db[_0xbac1('0x4e')],'as':_0xbac1('0x4f')},{'model':db[_0xbac1('0x4e')],'as':_0xbac1('0x4c')}]});}return null;})[_0xbac1('0x20')](respondWithResult(_0x954e17,null))[_0xbac1('0x40')](handleError(_0x954e17,null));};exports[_0xbac1('0x50')]=function(_0x1a591b,_0x2f5b32,_0x5cfc6d){var _0x5d47fb='';var _0x506171='';return db[_0xbac1('0x3c')][_0xbac1('0x48')]({'where':{'id':_0x1a591b[_0xbac1('0x42')]['id']},'attributes':['id',_0xbac1('0x51'),'remoteUri',_0xbac1('0x52')]})[_0xbac1('0x20')](handleEntityNotFound(_0x2f5b32,null))[_0xbac1('0x20')](function(_0x35324f){if(_0x35324f){_0x506171=_0x35324f[_0xbac1('0x51')];_0x5d47fb=_0x35324f[_0xbac1('0x53')];var _0x3ebe95=_0x35324f[_0xbac1('0x53')][_0xbac1('0x54')](-0x1);if(_0x3ebe95==='/'){_0x5d47fb=_0x5d47fb[_0xbac1('0x55')](0x0,_0x5d47fb[_0xbac1('0x56')](_0x3ebe95));}return rp({'method':_0xbac1('0x57'),'uri':util[_0xbac1('0x58')]('%s%s',_0x5d47fb,'/api/selector/owners'),'headers':{'Authorization':_0xbac1('0x59')+_0x35324f[_0xbac1('0x52')]},'json':!![]});}})['then'](function(_0x5a1e0f){if(_0x5a1e0f){var _0x228229=_0x5a1e0f[_0xbac1('0x5a')];var _0x4fa55c=![];var _0x3c320e=null;for(_0x3c320e=0x0;_0x3c320e<_0x228229['length'];_0x3c320e++){if(_0x228229[_0x3c320e][_0xbac1('0x5b')]===_0x506171){_0x4fa55c=!![];}}if(_0x4fa55c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xbac1('0x5c')});}}})[_0xbac1('0x20')](respondWithResult(_0x2f5b32,null))['catch'](function(_0x5b145f){var _0x45a838=_0x1a591b['query'][_0xbac1('0x5d')]?0x1f4:_0x5b145f[_0xbac1('0x5e')]||0x1f4;logger[_0xbac1('0x22')](_0xbac1('0x5f'),_0xbac1('0x50'),_0x45a838,JSON[_0xbac1('0x60')](_0x5b145f));delete _0x5b145f[_0xbac1('0x24')];if(_0x45a838===0x191){_0x45a838=0x190;}_0x2f5b32['status'](_0x45a838)[_0xbac1('0x61')](_0x1a591b['query'][_0xbac1('0x5d')]?{'message':_0xbac1('0x62'),'statusCode':_0x5b145f['statusCode']}:_0x5b145f);});}; \ No newline at end of file +var _0xd12a=['format','/api/selector/owners','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','includeAll','catch','show','include','options','create','body','find','getConfigurations','findOne','params','FreshsalesConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','GET'];(function(_0x3fb610,_0x228ec7){var _0x46fd28=function(_0x17ef49){while(--_0x17ef49){_0x3fb610['push'](_0x3fb610['shift']());}};_0x46fd28(++_0x228ec7);}(_0xd12a,0x6e));var _0xad12=function(_0x5956cf,_0x3f6868){_0x5956cf=_0x5956cf-0x0;var _0x1ded47=_0xd12a[_0x5956cf];return _0x1ded47;};'use strict';var emlformat=require(_0xad12('0x0'));var rimraf=require(_0xad12('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad12('0x2'));var rp=require(_0xad12('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xad12('0x4'));var util=require(_0xad12('0x5'));var path=require(_0xad12('0x6'));var sox=require(_0xad12('0x7'));var csv=require(_0xad12('0x8'));var ejs=require(_0xad12('0x9'));var fs=require('fs');var fs_extra=require(_0xad12('0xa'));var _=require(_0xad12('0xb'));var squel=require(_0xad12('0xc'));var crypto=require(_0xad12('0xd'));var jsforce=require(_0xad12('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xad12('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad12('0xf'));var authService=require(_0xad12('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xad12('0x11'));var hardwareService=require(_0xad12('0x12'));var logger=require(_0xad12('0x13'))(_0xad12('0x14'));var utils=require(_0xad12('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xad12('0x16'));var db=require(_0xad12('0x17'))['db'];var integrations=require(_0xad12('0x18'));function respondWithStatusCode(_0x5688ff,_0x4f2a42){_0x4f2a42=_0x4f2a42||0xcc;return function(_0x1ef8b6){if(_0x1ef8b6){return _0x5688ff[_0xad12('0x19')](_0x4f2a42);}return _0x5688ff[_0xad12('0x1a')](_0x4f2a42)[_0xad12('0x1b')]();};}function respondWithResult(_0x26f8c7,_0x35c054){_0x35c054=_0x35c054||0xc8;return function(_0x3a9432){if(_0x3a9432){return _0x26f8c7[_0xad12('0x1a')](_0x35c054)[_0xad12('0x1c')](_0x3a9432);}};}function respondWithFilteredResult(_0x3890eb,_0x11d150){return function(_0x110c0f){if(_0x110c0f){var _0x1edd64=typeof _0x11d150['offset']===_0xad12('0x1d')&&typeof _0x11d150[_0xad12('0x1e')]===_0xad12('0x1d');var _0x425231=_0x110c0f[_0xad12('0x1f')];var _0x2a05d3=_0x1edd64?0x0:_0x11d150[_0xad12('0x20')];var _0x317f40=_0x1edd64?_0x110c0f[_0xad12('0x1f')]:_0x11d150['offset']+_0x11d150[_0xad12('0x1e')];var _0x6f90fb;if(_0x317f40>=_0x425231){_0x317f40=_0x425231;_0x6f90fb=0xc8;}else{_0x6f90fb=0xce;}_0x3890eb['status'](_0x6f90fb);return _0x3890eb[_0xad12('0x21')]('Content-Range',_0x2a05d3+'-'+_0x317f40+'/'+_0x425231)['json'](_0x110c0f);}return null;};}function patchUpdates(_0x2f72f6){return function(_0x32ad90){try{jsonpatch[_0xad12('0x22')](_0x32ad90,_0x2f72f6,!![]);}catch(_0x522a47){return BPromise[_0xad12('0x23')](_0x522a47);}return _0x32ad90[_0xad12('0x24')]();};}function saveUpdates(_0x5c600c,_0x452d21){return function(_0x3b564e){if(_0x3b564e){return _0x3b564e['update'](_0x5c600c)[_0xad12('0x25')](function(_0x3669f9){return _0x3669f9;});}return null;};}function removeEntity(_0x1eb99c,_0x2b3851){return function(_0x364e9c){if(_0x364e9c){return _0x364e9c[_0xad12('0x26')]()[_0xad12('0x25')](function(){_0x1eb99c[_0xad12('0x1a')](0xcc)[_0xad12('0x1b')]();});}};}function handleEntityNotFound(_0xb57197,_0x443a7e){return function(_0x4def5d){if(!_0x4def5d){_0xb57197[_0xad12('0x19')](0x194);}return _0x4def5d;};}function handleError(_0x1bf4a9,_0xec1d74){_0xec1d74=_0xec1d74||0x1f4;return function(_0x2dd116){logger[_0xad12('0x27')](_0x2dd116['stack']);if(_0x2dd116[_0xad12('0x28')]){delete _0x2dd116['name'];}_0x1bf4a9['status'](_0xec1d74)[_0xad12('0x29')](_0x2dd116);};}exports[_0xad12('0x2a')]=function(_0x219dfd,_0x5b53a6){var _0x29c82d={},_0x686d75={},_0x10a86a={'count':0x0,'rows':[]};var _0x5a068e=_['map'](db[_0xad12('0x2b')][_0xad12('0x2c')],function(_0x4e4c1d){return{'name':_0x4e4c1d[_0xad12('0x2d')],'type':_0x4e4c1d[_0xad12('0x2e')][_0xad12('0x2f')]};});_0x686d75[_0xad12('0x30')]=_[_0xad12('0x31')](_0x5a068e,'name');_0x686d75[_0xad12('0x32')]=_[_0xad12('0x33')](_0x219dfd['query']);_0x686d75['filters']=_[_0xad12('0x34')](_0x686d75['model'],_0x686d75[_0xad12('0x32')]);_0x29c82d[_0xad12('0x35')]=_[_0xad12('0x34')](_0x686d75['model'],qs['fields'](_0x219dfd[_0xad12('0x32')][_0xad12('0x36')]));_0x29c82d[_0xad12('0x35')]=_0x29c82d[_0xad12('0x35')][_0xad12('0x37')]?_0x29c82d[_0xad12('0x35')]:_0x686d75[_0xad12('0x30')];if(!_0x219dfd[_0xad12('0x32')]['hasOwnProperty'](_0xad12('0x38'))){_0x29c82d[_0xad12('0x1e')]=qs[_0xad12('0x1e')](_0x219dfd[_0xad12('0x32')][_0xad12('0x1e')]);_0x29c82d['offset']=qs['offset'](_0x219dfd[_0xad12('0x32')]['offset']);}_0x29c82d[_0xad12('0x39')]=qs[_0xad12('0x3a')](_0x219dfd[_0xad12('0x32')][_0xad12('0x3a')]);_0x29c82d[_0xad12('0x3b')]=qs['filters'](_[_0xad12('0x3c')](_0x219dfd[_0xad12('0x32')],_0x686d75[_0xad12('0x3d')]),_0x5a068e);if(_0x219dfd[_0xad12('0x32')][_0xad12('0x3e')]){_0x29c82d[_0xad12('0x3b')]=_['merge'](_0x29c82d[_0xad12('0x3b')],{'$or':_[_0xad12('0x31')](_0x5a068e,function(_0x76cb4){if(_0x76cb4[_0xad12('0x2e')]!=='VIRTUAL'){var _0x29b95f={};_0x29b95f[_0x76cb4['name']]={'$like':'%'+_0x219dfd[_0xad12('0x32')][_0xad12('0x3e')]+'%'};return _0x29b95f;}})});}_0x29c82d=_[_0xad12('0x3f')]({},_0x29c82d,_0x219dfd['options']);var _0x21c925={'where':_0x29c82d[_0xad12('0x3b')]};return db[_0xad12('0x2b')][_0xad12('0x1f')](_0x21c925)[_0xad12('0x25')](function(_0x19c696){_0x10a86a[_0xad12('0x1f')]=_0x19c696;if(_0x219dfd[_0xad12('0x32')][_0xad12('0x40')]){_0x29c82d['include']=[{'all':!![]}];}return db[_0xad12('0x2b')]['findAll'](_0x29c82d);})[_0xad12('0x25')](function(_0x564a24){_0x10a86a['rows']=_0x564a24;return _0x10a86a;})[_0xad12('0x25')](respondWithFilteredResult(_0x5b53a6,_0x29c82d))[_0xad12('0x41')](handleError(_0x5b53a6,null));};exports[_0xad12('0x42')]=function(_0xba6585,_0x58fa2c){var _0x3e3356={'raw':![],'where':{'id':_0xba6585['params']['id']}},_0x29a7aa={};_0x29a7aa[_0xad12('0x30')]=_[_0xad12('0x33')](db[_0xad12('0x2b')][_0xad12('0x2c')]);_0x29a7aa['query']=_[_0xad12('0x33')](_0xba6585['query']);_0x29a7aa[_0xad12('0x3d')]=_[_0xad12('0x34')](_0x29a7aa[_0xad12('0x30')],_0x29a7aa[_0xad12('0x32')]);_0x3e3356['attributes']=_['intersection'](_0x29a7aa['model'],qs[_0xad12('0x36')](_0xba6585[_0xad12('0x32')][_0xad12('0x36')]));_0x3e3356[_0xad12('0x35')]=_0x3e3356[_0xad12('0x35')][_0xad12('0x37')]?_0x3e3356[_0xad12('0x35')]:_0x29a7aa[_0xad12('0x30')];if(_0xba6585[_0xad12('0x32')][_0xad12('0x40')]){_0x3e3356[_0xad12('0x43')]=[{'all':!![]}];}_0x3e3356=_['merge']({},_0x3e3356,_0xba6585[_0xad12('0x44')]);return db[_0xad12('0x2b')]['find'](_0x3e3356)[_0xad12('0x25')](handleEntityNotFound(_0x58fa2c,null))[_0xad12('0x25')](respondWithResult(_0x58fa2c,null))[_0xad12('0x41')](handleError(_0x58fa2c,null));};exports[_0xad12('0x45')]=function(_0x21c9d7,_0x1f8925){return db[_0xad12('0x2b')]['create'](_0x21c9d7[_0xad12('0x46')],{})[_0xad12('0x25')](respondWithResult(_0x1f8925,0xc9))[_0xad12('0x41')](handleError(_0x1f8925,null));};exports['update']=function(_0x2dc2fc,_0x581437){if(_0x2dc2fc[_0xad12('0x46')]['id']){delete _0x2dc2fc[_0xad12('0x46')]['id'];}return db[_0xad12('0x2b')][_0xad12('0x47')]({'where':{'id':_0x2dc2fc['params']['id']}})[_0xad12('0x25')](handleEntityNotFound(_0x581437,null))[_0xad12('0x25')](saveUpdates(_0x2dc2fc[_0xad12('0x46')],null))['then'](respondWithResult(_0x581437,null))[_0xad12('0x41')](handleError(_0x581437,null));};exports['destroy']=function(_0x3953a2,_0x59c272){return db[_0xad12('0x2b')]['find']({'where':{'id':_0x3953a2['params']['id']}})['then'](handleEntityNotFound(_0x59c272,null))[_0xad12('0x25')](removeEntity(_0x59c272,null))['catch'](handleError(_0x59c272,null));};exports[_0xad12('0x48')]=function(_0x37cc69,_0x596283,_0x88ccdd){var _0x2d2434={};var _0x284b24={};var _0x1d6295;var _0x30ea34;return db[_0xad12('0x2b')][_0xad12('0x49')]({'where':{'id':_0x37cc69[_0xad12('0x4a')]['id']}})[_0xad12('0x25')](handleEntityNotFound(_0x596283,null))['then'](function(_0x18772d){if(_0x18772d){_0x1d6295=_0x18772d;_0x284b24[_0xad12('0x30')]=_['keys'](db[_0xad12('0x4b')]['rawAttributes']);_0x284b24[_0xad12('0x32')]=_[_0xad12('0x33')](_0x37cc69[_0xad12('0x32')]);_0x284b24[_0xad12('0x3d')]=_['intersection'](_0x284b24[_0xad12('0x30')],_0x284b24[_0xad12('0x32')]);_0x2d2434[_0xad12('0x35')]=_['intersection'](_0x284b24[_0xad12('0x30')],qs[_0xad12('0x36')](_0x37cc69[_0xad12('0x32')][_0xad12('0x36')]));_0x2d2434[_0xad12('0x35')]=_0x2d2434['attributes'][_0xad12('0x37')]?_0x2d2434[_0xad12('0x35')]:_0x284b24['model'];_0x2d2434[_0xad12('0x39')]=qs[_0xad12('0x3a')](_0x37cc69[_0xad12('0x32')]['sort']);_0x2d2434[_0xad12('0x3b')]=qs[_0xad12('0x3d')](_['pick'](_0x37cc69[_0xad12('0x32')],_0x284b24[_0xad12('0x3d')]));if(_0x37cc69[_0xad12('0x32')][_0xad12('0x3e')]){_0x2d2434['where']=_['merge'](_0x2d2434['where'],{'$or':_[_0xad12('0x31')](_0x2d2434[_0xad12('0x35')],function(_0xc688ab){var _0x19aa90={};_0x19aa90[_0xc688ab]={'$like':'%'+_0x37cc69['query'][_0xad12('0x3e')]+'%'};return _0x19aa90;})});}_0x2d2434=_[_0xad12('0x3f')]({},_0x2d2434,_0x37cc69[_0xad12('0x44')]);return _0x1d6295[_0xad12('0x48')](_0x2d2434);}})['then'](function(_0x475c01){if(_0x475c01){_0x30ea34=_0x475c01[_0xad12('0x37')];if(!_0x37cc69['query'][_0xad12('0x4c')](_0xad12('0x38'))){_0x2d2434['limit']=qs['limit'](_0x37cc69[_0xad12('0x32')][_0xad12('0x1e')]);_0x2d2434[_0xad12('0x20')]=qs[_0xad12('0x20')](_0x37cc69[_0xad12('0x32')][_0xad12('0x20')]);}return _0x1d6295[_0xad12('0x48')](_0x2d2434);}})['then'](function(_0x266268){if(_0x266268){return _0x266268?{'count':_0x30ea34,'rows':_0x266268}:null;}})['then'](respondWithResult(_0x596283,null))[_0xad12('0x41')](handleError(_0x596283,null));};exports[_0xad12('0x4d')]=function(_0x4090aa,_0x4cb12d,_0x40d093){if(_0x4090aa[_0xad12('0x46')]['id']){delete _0x4090aa[_0xad12('0x46')]['id'];}return db[_0xad12('0x2b')]['findOne']({'where':{'id':_0x4090aa[_0xad12('0x4a')]['id']}})[_0xad12('0x25')](handleEntityNotFound(_0x4cb12d,null))[_0xad12('0x25')](function(_0x2abcd0){if(_0x2abcd0){_0x4090aa['body'][_0xad12('0x4e')]=_0x2abcd0['id'];_0x4090aa[_0xad12('0x46')][_0xad12('0x4f')]=integrations[_0xad12('0x50')](_0x4090aa[_0xad12('0x46')][_0xad12('0x51')],_0x4090aa[_0xad12('0x46')][_0xad12('0x2e')]);_0x4090aa[_0xad12('0x46')][_0xad12('0x52')]=integrations[_0xad12('0x53')](_0x4090aa[_0xad12('0x46')][_0xad12('0x51')],_0x4090aa[_0xad12('0x46')]['type']);return db[_0xad12('0x4b')][_0xad12('0x45')](_0x4090aa[_0xad12('0x46')],{'include':[{'model':db[_0xad12('0x54')],'as':_0xad12('0x4f')},{'model':db['FreshsalesField'],'as':_0xad12('0x52')}]});}return null;})[_0xad12('0x25')](respondWithResult(_0x4cb12d,null))[_0xad12('0x41')](handleError(_0x4cb12d,null));};exports[_0xad12('0x55')]=function(_0x148419,_0x26eed6,_0x4ee385){var _0x928d6b='';var _0xa65891='';return db[_0xad12('0x2b')][_0xad12('0x49')]({'where':{'id':_0x148419[_0xad12('0x4a')]['id']},'attributes':['id',_0xad12('0x56'),_0xad12('0x57'),_0xad12('0x58')]})[_0xad12('0x25')](handleEntityNotFound(_0x26eed6,null))[_0xad12('0x25')](function(_0x6c5dee){if(_0x6c5dee){_0xa65891=_0x6c5dee[_0xad12('0x56')];_0x928d6b=_0x6c5dee[_0xad12('0x57')];var _0x25de35=_0x6c5dee['remoteUri'][_0xad12('0x59')](-0x1);if(_0x25de35==='/'){_0x928d6b=_0x928d6b[_0xad12('0x5a')](0x0,_0x928d6b['lastIndexOf'](_0x25de35));}return rp({'method':_0xad12('0x5b'),'uri':util[_0xad12('0x5c')]('%s%s',_0x928d6b,_0xad12('0x5d')),'headers':{'Authorization':_0xad12('0x5e')+_0x6c5dee['apiKey']},'json':!![]});}})[_0xad12('0x25')](function(_0x21c77c){if(_0x21c77c){var _0x5b39c1=_0x21c77c[_0xad12('0x5f')];var _0x43c03c=![];var _0x5dd59c=null;for(_0x5dd59c=0x0;_0x5dd59c<_0x5b39c1['length'];_0x5dd59c++){if(_0x5b39c1[_0x5dd59c]['email']===_0xa65891){_0x43c03c=!![];}}if(_0x43c03c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xad12('0x60')});}}})[_0xad12('0x25')](respondWithResult(_0x26eed6,null))[_0xad12('0x41')](function(_0x2172e0){var _0x4a1f5d=_0x148419[_0xad12('0x32')][_0xad12('0x61')]?0x1f4:_0x2172e0[_0xad12('0x62')]||0x1f4;logger[_0xad12('0x27')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4a1f5d,JSON[_0xad12('0x63')](_0x2172e0));delete _0x2172e0[_0xad12('0x28')];if(_0x4a1f5d===0x191){_0x4a1f5d=0x190;}_0x26eed6[_0xad12('0x1a')](_0x4a1f5d)[_0xad12('0x29')](_0x148419[_0xad12('0x32')]['test']?{'message':_0xad12('0x64'),'statusCode':_0x2172e0[_0xad12('0x62')]}:_0x2172e0);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 3eacc97..0199aaf 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 _0x66fa=['exports','define','FreshsalesAccount','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x872236,_0xf48d8e){var _0x52f8a5=function(_0x5e92f2){while(--_0x5e92f2){_0x872236['push'](_0x872236['shift']());}};_0x52f8a5(++_0xf48d8e);}(_0x66fa,0x117));var _0xa66f=function(_0x2bca77,_0x1429e6){_0x2bca77=_0x2bca77-0x0;var _0x6810c1=_0x66fa[_0x2bca77];return _0x6810c1;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require('../../config/logger')(_0xa66f('0x2'));var moment=require(_0xa66f('0x3'));var BPromise=require(_0xa66f('0x4'));var rp=require(_0xa66f('0x5'));var fs=require('fs');var path=require(_0xa66f('0x6'));var rimraf=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xa66f('0x9')]=function(_0x20a150,_0x2f0b78){return _0x20a150[_0xa66f('0xa')](_0xa66f('0xb'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6050=['moment','bluebird','path','rimraf','../../config/environment','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x43b595,_0x15b51a){var _0x1338a5=function(_0x5c0782){while(--_0x5c0782){_0x43b595['push'](_0x43b595['shift']());}};_0x1338a5(++_0x15b51a);}(_0x6050,0x196));var _0x0605=function(_0x3004ba,_0x34ea1a){_0x3004ba=_0x3004ba-0x0;var _0x25e804=_0x6050[_0x3004ba];return _0x25e804;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xd78d96,_0x578623){return _0xd78d96['define']('FreshsalesAccount',attributes,{'tableName':_0x0605('0x9'),'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 d82826d..d93e24d 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 _0xd046=['ioredis','../../config/logger','../../config/environment','http','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','debug','find','ShowFreshsalesAccount','util','moment','bluebird'];(function(_0x2e08a7,_0x47f5b9){var _0x31cc86=function(_0x31b11d){while(--_0x31b11d){_0x2e08a7['push'](_0x2e08a7['shift']());}};_0x31cc86(++_0x47f5b9);}(_0xd046,0x129));var _0x6d04=function(_0x30b50d,_0x1100a4){_0x30b50d=_0x30b50d-0x0;var _0x53e9fb=_0xd046[_0x30b50d];return _0x53e9fb;};'use strict';var _=require('lodash');var util=require(_0x6d04('0x0'));var moment=require(_0x6d04('0x1'));var BPromise=require(_0x6d04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d04('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6d04('0x4'))('rpc');var config=require(_0x6d04('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6d04('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1968c4,_0x4f83bc,_0x569c7b){return new BPromise(function(_0x2e2c01,_0x42aa22){return client['request'](_0x1968c4,_0x569c7b)['then'](function(_0x27a3d6){logger['info'](_0x6d04('0x7'),_0x4f83bc,'request\x20sent');logger['debug']('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x4f83bc,_0x6d04('0x8'),JSON[_0x6d04('0x9')](_0x27a3d6));if(_0x27a3d6[_0x6d04('0xa')]){if(_0x27a3d6[_0x6d04('0xa')]['code']===0x1f4){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x42aa22(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);return _0x2e2c01(_0x27a3d6[_0x6d04('0xa')][_0x6d04('0xb')]);}else{logger[_0x6d04('0xc')](_0x6d04('0x7'),_0x4f83bc,_0x6d04('0x8'));_0x2e2c01(_0x27a3d6[_0x6d04('0xd')][_0x6d04('0xb')]);}})[_0x6d04('0xe')](function(_0xed5538){logger[_0x6d04('0xa')](_0x6d04('0x7'),_0x4f83bc,_0xed5538);_0x42aa22(_0xed5538);});});}exports[_0x6d04('0xf')]=function(_0x2bc798){var _0x3ad325=this;return new Promise(function(_0x4e93b5,_0x3657a1){return db[_0x6d04('0x10')][_0x6d04('0x11')]({'raw':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'where':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x2bc798[_0x6d04('0x12')]?_0x2bc798[_0x6d04('0x12')][_0x6d04('0x15')]||null:null,'limit':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options'][_0x6d04('0x16')]||null:null,'include':_0x2bc798[_0x6d04('0x12')]?_0x2bc798['options']['include']?_[_0x6d04('0x17')](_0x2bc798[_0x6d04('0x12')][_0x6d04('0x18')],function(_0xe8f198){return{'model':db[_0xe8f198[_0x6d04('0x19')]],'as':_0xe8f198['as'],'attributes':_0xe8f198[_0x6d04('0x15')],'include':_0xe8f198[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0xe8f198[_0x6d04('0x18')],function(_0x38e90f){return{'model':db[_0x38e90f[_0x6d04('0x19')]],'as':_0x38e90f['as'],'attributes':_0x38e90f[_0x6d04('0x15')],'include':_0x38e90f[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x38e90f['include'],function(_0x1dc29b){return{'model':db[_0x1dc29b[_0x6d04('0x19')]],'as':_0x1dc29b['as'],'attributes':_0x1dc29b[_0x6d04('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d04('0x1a')](function(_0x4256a3){logger[_0x6d04('0xc')]('GetFreshsalesAccount',_0x2bc798);logger[_0x6d04('0x1b')](_0x6d04('0xf'),_0x2bc798,JSON[_0x6d04('0x9')](_0x4256a3));_0x4e93b5(_0x4256a3);})[_0x6d04('0xe')](function(_0x2ed2bb){logger['error']('GetFreshsalesAccount',_0x2ed2bb['message'],_0x2bc798);_0x3657a1(_0x3ad325['error'](0x1f4,_0x2ed2bb[_0x6d04('0xb')]));});});};exports['ShowFreshsalesAccount']=function(_0x43eb48){var _0x4ed123=this;return new Promise(function(_0x26be38,_0xee1291){return db[_0x6d04('0x10')][_0x6d04('0x1c')]({'raw':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x13')]===undefined?!![]:![]:!![],'where':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x14')]||null:null,'attributes':_0x43eb48['options']?_0x43eb48['options'][_0x6d04('0x15')]||null:null,'include':_0x43eb48[_0x6d04('0x12')]?_0x43eb48[_0x6d04('0x12')][_0x6d04('0x18')]?_['map'](_0x43eb48[_0x6d04('0x12')][_0x6d04('0x18')],function(_0x40758d){return{'model':db[_0x40758d[_0x6d04('0x19')]],'as':_0x40758d['as'],'attributes':_0x40758d['attributes'],'include':_0x40758d[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x40758d[_0x6d04('0x18')],function(_0x184da2){return{'model':db[_0x184da2[_0x6d04('0x19')]],'as':_0x184da2['as'],'attributes':_0x184da2[_0x6d04('0x15')],'include':_0x184da2[_0x6d04('0x18')]?_[_0x6d04('0x17')](_0x184da2[_0x6d04('0x18')],function(_0x67e455){return{'model':db[_0x67e455[_0x6d04('0x19')]],'as':_0x67e455['as'],'attributes':_0x67e455[_0x6d04('0x15')]};}):[]};}):[]};}):[]:[]})[_0x6d04('0x1a')](function(_0x2c2203){logger[_0x6d04('0xc')]('ShowFreshsalesAccount',_0x43eb48);logger[_0x6d04('0x1b')]('ShowFreshsalesAccount',_0x43eb48,JSON[_0x6d04('0x9')](_0x2c2203));_0x26be38(_0x2c2203);})[_0x6d04('0xe')](function(_0x4c1908){logger[_0x6d04('0xa')](_0x6d04('0x1d'),_0x4c1908[_0x6d04('0xb')],_0x43eb48);_0xee1291(_0x4ed123[_0x6d04('0xa')](0x1f4,_0x4c1908[_0x6d04('0xb')]));});});}; \ No newline at end of file +var _0xe3da=['then','GetFreshsalesAccount','catch','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FreshsalesAccount','findAll','options','raw','attributes','limit','include','map','model'];(function(_0x4f36d9,_0x35e95d){var _0x17bb63=function(_0x282912){while(--_0x282912){_0x4f36d9['push'](_0x4f36d9['shift']());}};_0x17bb63(++_0x35e95d);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});}exports['GetFreshsalesAccount']=function(_0x3f8cf9){var _0x4cbe4e=this;return new Promise(function(_0x558e42,_0x4d931d){return db[_0xae3d('0x18')][_0xae3d('0x19')]({'raw':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x3f8cf9['options']?_0x3f8cf9[_0xae3d('0x1a')]['where']||null:null,'attributes':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'limit':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1d')]||null:null,'include':_0x3f8cf9[_0xae3d('0x1a')]?_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x3f8cf9[_0xae3d('0x1a')][_0xae3d('0x1e')],function(_0x37f5ff){return{'model':db[_0x37f5ff[_0xae3d('0x20')]],'as':_0x37f5ff['as'],'attributes':_0x37f5ff[_0xae3d('0x1c')],'include':_0x37f5ff[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x37f5ff[_0xae3d('0x1e')],function(_0x2131e9){return{'model':db[_0x2131e9[_0xae3d('0x20')]],'as':_0x2131e9['as'],'attributes':_0x2131e9['attributes'],'include':_0x2131e9[_0xae3d('0x1e')]?_[_0xae3d('0x1f')](_0x2131e9[_0xae3d('0x1e')],function(_0x52df0f){return{'model':db[_0x52df0f[_0xae3d('0x20')]],'as':_0x52df0f['as'],'attributes':_0x52df0f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x54c1e1){logger['info'](_0xae3d('0x22'),_0x3f8cf9);logger[_0xae3d('0x11')](_0xae3d('0x22'),_0x3f8cf9,JSON[_0xae3d('0x13')](_0x54c1e1));_0x558e42(_0x54c1e1);})[_0xae3d('0x23')](function(_0x561371){logger[_0xae3d('0x14')](_0xae3d('0x22'),_0x561371['message'],_0x3f8cf9);_0x4d931d(_0x4cbe4e[_0xae3d('0x14')](0x1f4,_0x561371[_0xae3d('0x16')]));});});};exports[_0xae3d('0x24')]=function(_0x46f484){var _0x432c04=this;return new Promise(function(_0x6ef13c,_0x5356d4){return db['FreshsalesAccount']['find']({'raw':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x46f484[_0xae3d('0x1a')]?_0x46f484['options'][_0xae3d('0x25')]||null:null,'attributes':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1c')]||null:null,'include':_0x46f484[_0xae3d('0x1a')]?_0x46f484[_0xae3d('0x1a')][_0xae3d('0x1e')]?_['map'](_0x46f484[_0xae3d('0x1a')]['include'],function(_0x55aae4){return{'model':db[_0x55aae4[_0xae3d('0x20')]],'as':_0x55aae4['as'],'attributes':_0x55aae4['attributes'],'include':_0x55aae4[_0xae3d('0x1e')]?_['map'](_0x55aae4['include'],function(_0x1a28b5){return{'model':db[_0x1a28b5[_0xae3d('0x20')]],'as':_0x1a28b5['as'],'attributes':_0x1a28b5[_0xae3d('0x1c')],'include':_0x1a28b5['include']?_[_0xae3d('0x1f')](_0x1a28b5['include'],function(_0xce647f){return{'model':db[_0xce647f[_0xae3d('0x20')]],'as':_0xce647f['as'],'attributes':_0xce647f[_0xae3d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xae3d('0x21')](function(_0x18c469){logger[_0xae3d('0xe')](_0xae3d('0x24'),_0x46f484);logger[_0xae3d('0x11')](_0xae3d('0x24'),_0x46f484,JSON[_0xae3d('0x13')](_0x18c469));_0x6ef13c(_0x18c469);})[_0xae3d('0x23')](function(_0x5543ee){logger['error'](_0xae3d('0x24'),_0x5543ee['message'],_0x46f484);_0x5356d4(_0x432c04[_0xae3d('0x14')](0x1f4,_0x5543ee[_0xae3d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b48553c..f7dda0a 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 _0x3571=['Router','../../config/environment','get','/:id','show','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','getFields','create','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3571,0x73));var _0x1357=function(_0x1c156e,_0x3263a6){_0x1c156e=_0x1c156e-0x0;var _0x58fc22=_0x3571[_0x1c156e];return _0x58fc22;};'use strict';var multer=require(_0x1357('0x0'));var util=require(_0x1357('0x1'));var path=require(_0x1357('0x2'));var timeout=require(_0x1357('0x3'));var express=require(_0x1357('0x4'));var router=express[_0x1357('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1357('0x6'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x1357('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1357('0x7')](_0x1357('0x8'),auth['isAuthenticated'](),controller[_0x1357('0x9')]);router[_0x1357('0x7')](_0x1357('0xa'),auth[_0x1357('0xb')](),controller[_0x1357('0xc')]);router[_0x1357('0x7')](_0x1357('0xd'),auth['isAuthenticated'](),controller[_0x1357('0xe')]);router[_0x1357('0x7')]('/:id/fields',auth[_0x1357('0xb')](),controller[_0x1357('0xf')]);router['post']('/',auth[_0x1357('0xb')](),controller[_0x1357('0x10')]);router['put'](_0x1357('0x8'),auth[_0x1357('0xb')](),controller[_0x1357('0x11')]);router[_0x1357('0x12')](_0x1357('0x8'),auth[_0x1357('0xb')](),controller['destroy']);module[_0x1357('0x13')]=router; \ No newline at end of file +var _0xcf7e=['/:id','show','/:id/descriptions','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf7e,0x1d9));var _0xecf7=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xcf7e[_0x5f09c5];return _0x426ad9;};'use strict';var multer=require(_0xecf7('0x0'));var util=require(_0xecf7('0x1'));var path=require(_0xecf7('0x2'));var timeout=require(_0xecf7('0x3'));var express=require(_0xecf7('0x4'));var router=express['Router']();var fs_extra=require(_0xecf7('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xecf7('0x6'));var controller=require(_0xecf7('0x7'));router[_0xecf7('0x8')]('/',auth[_0xecf7('0x9')](),controller[_0xecf7('0xa')]);router[_0xecf7('0x8')](_0xecf7('0xb'),auth[_0xecf7('0x9')](),controller[_0xecf7('0xc')]);router['get']('/:id/subjects',auth[_0xecf7('0x9')](),controller['getSubjects']);router[_0xecf7('0x8')](_0xecf7('0xd'),auth[_0xecf7('0x9')](),controller['getDescriptions']);router[_0xecf7('0x8')](_0xecf7('0xe'),auth[_0xecf7('0x9')](),controller[_0xecf7('0xf')]);router[_0xecf7('0x10')]('/',auth[_0xecf7('0x9')](),controller[_0xecf7('0x11')]);router[_0xecf7('0x12')]('/:id',auth[_0xecf7('0x9')](),controller[_0xecf7('0x13')]);router[_0xecf7('0x14')](_0xecf7('0xb'),auth[_0xecf7('0x9')](),controller[_0xecf7('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 427d013..4cd4265 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 _0x4e1e=['sequelize','exports'];(function(_0x3e6494,_0x1469e6){var _0x585837=function(_0x2138be){while(--_0x2138be){_0x3e6494['push'](_0x3e6494['shift']());}};_0x585837(++_0x1469e6);}(_0x4e1e,0x6a));var _0xe4e1=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x4e1e[_0x31172e];return _0x414ada;};'use strict';var Sequelize=require(_0xe4e1('0x0'));module[_0xe4e1('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x09a0=['sequelize','exports','STRING'];(function(_0x338bb6,_0x5504a6){var _0x2fb7a7=function(_0x693e01){while(--_0x693e01){_0x338bb6['push'](_0x338bb6['shift']());}};_0x2fb7a7(++_0x5504a6);}(_0x09a0,0x114));var _0x009a=function(_0xe9c061,_0x38ee98){_0xe9c061=_0xe9c061-0x0;var _0x289f96=_0x09a0[_0xe9c061];return _0x289f96;};'use strict';var Sequelize=require(_0x009a('0x0'));module[_0x009a('0x1')]={'name':{'type':Sequelize[_0x009a('0x2')]},'description':{'type':Sequelize[_0x009a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 0bce8d9..505438e 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 _0xa2e4=['bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','undefined','offset','Content-Range','apply','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','FreshsalesConfiguration','count','includeAll','include','findAll','rows','params','length','catch','create','body','find','destroy','findOne','getDescriptions','getFields','FreshsalesField','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x307bf6,_0x55bdd5){var _0x2878fc=function(_0x4fa44f){while(--_0x4fa44f){_0x307bf6['push'](_0x307bf6['shift']());}};_0x2878fc(++_0x55bdd5);}(_0xa2e4,0xee));var _0x4a2e=function(_0x380a3f,_0x202483){_0x380a3f=_0x380a3f-0x0;var _0x2b4eca=_0xa2e4[_0x380a3f];return _0x2b4eca;};'use strict';var emlformat=require(_0x4a2e('0x0'));var rimraf=require(_0x4a2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4a2e('0x2'));var rp=require(_0x4a2e('0x3'));var moment=require(_0x4a2e('0x4'));var BPromise=require(_0x4a2e('0x5'));var Mustache=require(_0x4a2e('0x6'));var util=require('util');var path=require(_0x4a2e('0x7'));var sox=require(_0x4a2e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a2e('0x9'));var _=require(_0x4a2e('0xa'));var squel=require(_0x4a2e('0xb'));var crypto=require(_0x4a2e('0xc'));var jsforce=require(_0x4a2e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4a2e('0xe'));var querystring=require(_0x4a2e('0xf'));var Papa=require(_0x4a2e('0x10'));var Redis=require('ioredis');var authService=require(_0x4a2e('0x11'));var qs=require(_0x4a2e('0x12'));var as=require(_0x4a2e('0x13'));var hardwareService=require(_0x4a2e('0x14'));var logger=require(_0x4a2e('0x15'))(_0x4a2e('0x16'));var utils=require('../../config/utils');var config=require(_0x4a2e('0x17'));var licenseUtil=require(_0x4a2e('0x18'));var db=require(_0x4a2e('0x19'))['db'];function respondWithStatusCode(_0x13a1e5,_0x7630ec){_0x7630ec=_0x7630ec||0xcc;return function(_0x22b00c){if(_0x22b00c){return _0x13a1e5[_0x4a2e('0x1a')](_0x7630ec);}return _0x13a1e5['status'](_0x7630ec)[_0x4a2e('0x1b')]();};}function respondWithResult(_0x153d3c,_0x3908c2){_0x3908c2=_0x3908c2||0xc8;return function(_0x1e2acb){if(_0x1e2acb){return _0x153d3c[_0x4a2e('0x1c')](_0x3908c2)[_0x4a2e('0x1d')](_0x1e2acb);}};}function respondWithFilteredResult(_0x2e6df5,_0x526b99){return function(_0x425e9c){if(_0x425e9c){var _0x27bc2b=typeof _0x526b99['offset']===_0x4a2e('0x1e')&&typeof _0x526b99['limit']===_0x4a2e('0x1e');var _0xc1ad80=_0x425e9c['count'];var _0x90b20=_0x27bc2b?0x0:_0x526b99[_0x4a2e('0x1f')];var _0x51fe3a=_0x27bc2b?_0x425e9c['count']:_0x526b99[_0x4a2e('0x1f')]+_0x526b99['limit'];var _0x3d4bba;if(_0x51fe3a>=_0xc1ad80){_0x51fe3a=_0xc1ad80;_0x3d4bba=0xc8;}else{_0x3d4bba=0xce;}_0x2e6df5[_0x4a2e('0x1c')](_0x3d4bba);return _0x2e6df5['set'](_0x4a2e('0x20'),_0x90b20+'-'+_0x51fe3a+'/'+_0xc1ad80)[_0x4a2e('0x1d')](_0x425e9c);}return null;};}function patchUpdates(_0x392ebf){return function(_0x7dd9e6){try{jsonpatch[_0x4a2e('0x21')](_0x7dd9e6,_0x392ebf,!![]);}catch(_0x47fe83){return BPromise[_0x4a2e('0x22')](_0x47fe83);}return _0x7dd9e6['save']();};}function saveUpdates(_0x40fa0d,_0x442a43){return function(_0x139e17){if(_0x139e17){return _0x139e17[_0x4a2e('0x23')](_0x40fa0d)[_0x4a2e('0x24')](function(_0x5c7fcd){return _0x5c7fcd;});}return null;};}function removeEntity(_0x556931,_0x1fdb9e){return function(_0x469859){if(_0x469859){return _0x469859['destroy']()['then'](function(){_0x556931[_0x4a2e('0x1c')](0xcc)[_0x4a2e('0x1b')]();});}};}function handleEntityNotFound(_0x5d85af,_0x16d7be){return function(_0x41564e){if(!_0x41564e){_0x5d85af['sendStatus'](0x194);}return _0x41564e;};}function handleError(_0x3de3a9,_0x1e05c1){_0x1e05c1=_0x1e05c1||0x1f4;return function(_0xfd5fa5){logger['error'](_0xfd5fa5[_0x4a2e('0x25')]);if(_0xfd5fa5[_0x4a2e('0x26')]){delete _0xfd5fa5[_0x4a2e('0x26')];}_0x3de3a9[_0x4a2e('0x1c')](_0x1e05c1)[_0x4a2e('0x27')](_0xfd5fa5);};}exports[_0x4a2e('0x28')]=function(_0x42b3e9,_0x29778e){var _0x1e3366={},_0x5042f7={},_0x35b9d9={'count':0x0,'rows':[]};var _0x52dab7=_[_0x4a2e('0x29')](db['FreshsalesConfiguration'][_0x4a2e('0x2a')],function(_0x2ccfd0){return{'name':_0x2ccfd0[_0x4a2e('0x2b')],'type':_0x2ccfd0[_0x4a2e('0x2c')][_0x4a2e('0x2d')]};});_0x5042f7[_0x4a2e('0x2e')]=_[_0x4a2e('0x29')](_0x52dab7,_0x4a2e('0x26'));_0x5042f7[_0x4a2e('0x2f')]=_[_0x4a2e('0x30')](_0x42b3e9['query']);_0x5042f7[_0x4a2e('0x31')]=_[_0x4a2e('0x32')](_0x5042f7[_0x4a2e('0x2e')],_0x5042f7['query']);_0x1e3366['attributes']=_[_0x4a2e('0x32')](_0x5042f7[_0x4a2e('0x2e')],qs['fields'](_0x42b3e9[_0x4a2e('0x2f')][_0x4a2e('0x33')]));_0x1e3366[_0x4a2e('0x34')]=_0x1e3366['attributes']['length']?_0x1e3366[_0x4a2e('0x34')]:_0x5042f7[_0x4a2e('0x2e')];if(!_0x42b3e9[_0x4a2e('0x2f')][_0x4a2e('0x35')](_0x4a2e('0x36'))){_0x1e3366[_0x4a2e('0x37')]=qs[_0x4a2e('0x37')](_0x42b3e9[_0x4a2e('0x2f')][_0x4a2e('0x37')]);_0x1e3366[_0x4a2e('0x1f')]=qs[_0x4a2e('0x1f')](_0x42b3e9[_0x4a2e('0x2f')][_0x4a2e('0x1f')]);}_0x1e3366[_0x4a2e('0x38')]=qs[_0x4a2e('0x39')](_0x42b3e9[_0x4a2e('0x2f')]['sort']);_0x1e3366['where']=qs[_0x4a2e('0x31')](_[_0x4a2e('0x3a')](_0x42b3e9[_0x4a2e('0x2f')],_0x5042f7['filters']),_0x52dab7);if(_0x42b3e9[_0x4a2e('0x2f')][_0x4a2e('0x3b')]){_0x1e3366[_0x4a2e('0x3c')]=_[_0x4a2e('0x3d')](_0x1e3366[_0x4a2e('0x3c')],{'$or':_['map'](_0x52dab7,function(_0x4161c1){if(_0x4161c1[_0x4a2e('0x2c')]!==_0x4a2e('0x3e')){var _0x25e6a0={};_0x25e6a0[_0x4161c1[_0x4a2e('0x26')]]={'$like':'%'+_0x42b3e9[_0x4a2e('0x2f')][_0x4a2e('0x3b')]+'%'};return _0x25e6a0;}})});}_0x1e3366=_['merge']({},_0x1e3366,_0x42b3e9[_0x4a2e('0x3f')]);var _0x7c96ff={'where':_0x1e3366[_0x4a2e('0x3c')]};return db[_0x4a2e('0x40')][_0x4a2e('0x41')](_0x7c96ff)[_0x4a2e('0x24')](function(_0x37e555){_0x35b9d9[_0x4a2e('0x41')]=_0x37e555;if(_0x42b3e9[_0x4a2e('0x2f')][_0x4a2e('0x42')]){_0x1e3366[_0x4a2e('0x43')]=[{'all':!![]}];}return db[_0x4a2e('0x40')][_0x4a2e('0x44')](_0x1e3366);})[_0x4a2e('0x24')](function(_0x5531f4){_0x35b9d9[_0x4a2e('0x45')]=_0x5531f4;return _0x35b9d9;})['then'](respondWithFilteredResult(_0x29778e,_0x1e3366))['catch'](handleError(_0x29778e,null));};exports['show']=function(_0x53eec2,_0x349a50){var _0x5f4f1b={'raw':![],'where':{'id':_0x53eec2[_0x4a2e('0x46')]['id']}},_0x2c2074={};_0x2c2074[_0x4a2e('0x2e')]=_['keys'](db[_0x4a2e('0x40')][_0x4a2e('0x2a')]);_0x2c2074['query']=_[_0x4a2e('0x30')](_0x53eec2['query']);_0x2c2074['filters']=_['intersection'](_0x2c2074['model'],_0x2c2074[_0x4a2e('0x2f')]);_0x5f4f1b[_0x4a2e('0x34')]=_[_0x4a2e('0x32')](_0x2c2074[_0x4a2e('0x2e')],qs[_0x4a2e('0x33')](_0x53eec2[_0x4a2e('0x2f')]['fields']));_0x5f4f1b[_0x4a2e('0x34')]=_0x5f4f1b['attributes'][_0x4a2e('0x47')]?_0x5f4f1b[_0x4a2e('0x34')]:_0x2c2074[_0x4a2e('0x2e')];if(_0x53eec2[_0x4a2e('0x2f')][_0x4a2e('0x42')]){_0x5f4f1b[_0x4a2e('0x43')]=[{'all':!![]}];}_0x5f4f1b=_[_0x4a2e('0x3d')]({},_0x5f4f1b,_0x53eec2[_0x4a2e('0x3f')]);return db[_0x4a2e('0x40')]['find'](_0x5f4f1b)[_0x4a2e('0x24')](handleEntityNotFound(_0x349a50,null))[_0x4a2e('0x24')](respondWithResult(_0x349a50,null))[_0x4a2e('0x48')](handleError(_0x349a50,null));};exports[_0x4a2e('0x49')]=function(_0x2a8202,_0x253569){return db['FreshsalesConfiguration']['create'](_0x2a8202[_0x4a2e('0x4a')],{})[_0x4a2e('0x24')](respondWithResult(_0x253569,0xc9))[_0x4a2e('0x48')](handleError(_0x253569,null));};exports[_0x4a2e('0x23')]=function(_0x480a59,_0x33a792){if(_0x480a59[_0x4a2e('0x4a')]['id']){delete _0x480a59[_0x4a2e('0x4a')]['id'];}return db[_0x4a2e('0x40')][_0x4a2e('0x4b')]({'where':{'id':_0x480a59['params']['id']}})['then'](handleEntityNotFound(_0x33a792,null))['then'](saveUpdates(_0x480a59['body'],null))[_0x4a2e('0x24')](respondWithResult(_0x33a792,null))[_0x4a2e('0x48')](handleError(_0x33a792,null));};exports[_0x4a2e('0x4c')]=function(_0x267240,_0x554001){return db['FreshsalesConfiguration'][_0x4a2e('0x4b')]({'where':{'id':_0x267240['params']['id']}})[_0x4a2e('0x24')](handleEntityNotFound(_0x554001,null))[_0x4a2e('0x24')](removeEntity(_0x554001,null))[_0x4a2e('0x48')](handleError(_0x554001,null));};exports['getSubjects']=function(_0x30adba,_0x576b36,_0x3fcd51){var _0x2b6d8c={};var _0x4f47ba={};var _0x3b8a28;var _0x256f69;return db[_0x4a2e('0x40')][_0x4a2e('0x4d')]({'where':{'id':_0x30adba[_0x4a2e('0x46')]['id']}})['then'](handleEntityNotFound(_0x576b36,null))[_0x4a2e('0x24')](function(_0x59984e){if(_0x59984e){_0x3b8a28=_0x59984e;_0x4f47ba[_0x4a2e('0x2e')]=_[_0x4a2e('0x30')](db['FreshsalesField'][_0x4a2e('0x2a')]);_0x4f47ba[_0x4a2e('0x2f')]=_[_0x4a2e('0x30')](_0x30adba[_0x4a2e('0x2f')]);_0x4f47ba[_0x4a2e('0x31')]=_['intersection'](_0x4f47ba[_0x4a2e('0x2e')],_0x4f47ba[_0x4a2e('0x2f')]);_0x2b6d8c[_0x4a2e('0x34')]=_[_0x4a2e('0x32')](_0x4f47ba[_0x4a2e('0x2e')],qs[_0x4a2e('0x33')](_0x30adba[_0x4a2e('0x2f')]['fields']));_0x2b6d8c[_0x4a2e('0x34')]=_0x2b6d8c['attributes']['length']?_0x2b6d8c[_0x4a2e('0x34')]:_0x4f47ba[_0x4a2e('0x2e')];_0x2b6d8c[_0x4a2e('0x38')]=qs['sort'](_0x30adba['query']['sort']);_0x2b6d8c[_0x4a2e('0x3c')]=qs[_0x4a2e('0x31')](_[_0x4a2e('0x3a')](_0x30adba[_0x4a2e('0x2f')],_0x4f47ba['filters']));if(_0x30adba['query'][_0x4a2e('0x3b')]){_0x2b6d8c[_0x4a2e('0x3c')]=_['merge'](_0x2b6d8c[_0x4a2e('0x3c')],{'$or':_['map'](_0x2b6d8c['attributes'],function(_0x3347b6){var _0x2d1732={};_0x2d1732[_0x3347b6]={'$like':'%'+_0x30adba[_0x4a2e('0x2f')]['filter']+'%'};return _0x2d1732;})});}_0x2b6d8c=_[_0x4a2e('0x3d')]({},_0x2b6d8c,_0x30adba[_0x4a2e('0x3f')]);return _0x3b8a28['getSubjects'](_0x2b6d8c);}})[_0x4a2e('0x24')](function(_0x11e38b){if(_0x11e38b){_0x256f69=_0x11e38b[_0x4a2e('0x47')];if(!_0x30adba[_0x4a2e('0x2f')]['hasOwnProperty'](_0x4a2e('0x36'))){_0x2b6d8c[_0x4a2e('0x37')]=qs[_0x4a2e('0x37')](_0x30adba[_0x4a2e('0x2f')][_0x4a2e('0x37')]);_0x2b6d8c[_0x4a2e('0x1f')]=qs[_0x4a2e('0x1f')](_0x30adba['query'][_0x4a2e('0x1f')]);}return _0x3b8a28['getSubjects'](_0x2b6d8c);}})[_0x4a2e('0x24')](function(_0x54ccb0){if(_0x54ccb0){return _0x54ccb0?{'count':_0x256f69,'rows':_0x54ccb0}:null;}})['then'](respondWithResult(_0x576b36,null))[_0x4a2e('0x48')](handleError(_0x576b36,null));};exports[_0x4a2e('0x4e')]=function(_0x5ccced,_0x552330,_0x4bd08e){var _0x5c458c={};var _0x49bc55={};var _0x1dc269;var _0x21bc1e;return db[_0x4a2e('0x40')]['findOne']({'where':{'id':_0x5ccced[_0x4a2e('0x46')]['id']}})[_0x4a2e('0x24')](handleEntityNotFound(_0x552330,null))['then'](function(_0x4fd8fd){if(_0x4fd8fd){_0x1dc269=_0x4fd8fd;_0x49bc55[_0x4a2e('0x2e')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x49bc55[_0x4a2e('0x2f')]=_[_0x4a2e('0x30')](_0x5ccced[_0x4a2e('0x2f')]);_0x49bc55[_0x4a2e('0x31')]=_[_0x4a2e('0x32')](_0x49bc55[_0x4a2e('0x2e')],_0x49bc55[_0x4a2e('0x2f')]);_0x5c458c['attributes']=_['intersection'](_0x49bc55['model'],qs[_0x4a2e('0x33')](_0x5ccced['query'][_0x4a2e('0x33')]));_0x5c458c[_0x4a2e('0x34')]=_0x5c458c[_0x4a2e('0x34')][_0x4a2e('0x47')]?_0x5c458c['attributes']:_0x49bc55[_0x4a2e('0x2e')];_0x5c458c['order']=qs[_0x4a2e('0x39')](_0x5ccced['query'][_0x4a2e('0x39')]);_0x5c458c[_0x4a2e('0x3c')]=qs['filters'](_[_0x4a2e('0x3a')](_0x5ccced[_0x4a2e('0x2f')],_0x49bc55[_0x4a2e('0x31')]));if(_0x5ccced['query'][_0x4a2e('0x3b')]){_0x5c458c[_0x4a2e('0x3c')]=_[_0x4a2e('0x3d')](_0x5c458c[_0x4a2e('0x3c')],{'$or':_[_0x4a2e('0x29')](_0x5c458c['attributes'],function(_0x45cd8e){var _0x4dd6f9={};_0x4dd6f9[_0x45cd8e]={'$like':'%'+_0x5ccced['query'][_0x4a2e('0x3b')]+'%'};return _0x4dd6f9;})});}_0x5c458c=_[_0x4a2e('0x3d')]({},_0x5c458c,_0x5ccced[_0x4a2e('0x3f')]);return _0x1dc269[_0x4a2e('0x4e')](_0x5c458c);}})['then'](function(_0x177337){if(_0x177337){_0x21bc1e=_0x177337[_0x4a2e('0x47')];if(!_0x5ccced[_0x4a2e('0x2f')][_0x4a2e('0x35')]('nolimit')){_0x5c458c[_0x4a2e('0x37')]=qs['limit'](_0x5ccced['query'][_0x4a2e('0x37')]);_0x5c458c[_0x4a2e('0x1f')]=qs[_0x4a2e('0x1f')](_0x5ccced[_0x4a2e('0x2f')][_0x4a2e('0x1f')]);}return _0x1dc269['getDescriptions'](_0x5c458c);}})[_0x4a2e('0x24')](function(_0x5b9c9b){if(_0x5b9c9b){return _0x5b9c9b?{'count':_0x21bc1e,'rows':_0x5b9c9b}:null;}})[_0x4a2e('0x24')](respondWithResult(_0x552330,null))[_0x4a2e('0x48')](handleError(_0x552330,null));};exports[_0x4a2e('0x4f')]=function(_0x4a7142,_0x511efb,_0x326b6d){var _0x3fa781={};var _0x4a91e6={};var _0x1d254f;var _0x26ae42;return db[_0x4a2e('0x40')][_0x4a2e('0x4d')]({'where':{'id':_0x4a7142[_0x4a2e('0x46')]['id']}})[_0x4a2e('0x24')](handleEntityNotFound(_0x511efb,null))[_0x4a2e('0x24')](function(_0x733029){if(_0x733029){_0x1d254f=_0x733029;_0x4a91e6[_0x4a2e('0x2e')]=_[_0x4a2e('0x30')](db[_0x4a2e('0x50')][_0x4a2e('0x2a')]);_0x4a91e6[_0x4a2e('0x2f')]=_[_0x4a2e('0x30')](_0x4a7142[_0x4a2e('0x2f')]);_0x4a91e6[_0x4a2e('0x31')]=_['intersection'](_0x4a91e6['model'],_0x4a91e6['query']);_0x3fa781[_0x4a2e('0x34')]=_[_0x4a2e('0x32')](_0x4a91e6['model'],qs[_0x4a2e('0x33')](_0x4a7142[_0x4a2e('0x2f')]['fields']));_0x3fa781[_0x4a2e('0x34')]=_0x3fa781[_0x4a2e('0x34')][_0x4a2e('0x47')]?_0x3fa781[_0x4a2e('0x34')]:_0x4a91e6['model'];_0x3fa781[_0x4a2e('0x38')]=qs['sort'](_0x4a7142[_0x4a2e('0x2f')]['sort']);_0x3fa781[_0x4a2e('0x3c')]=qs[_0x4a2e('0x31')](_[_0x4a2e('0x3a')](_0x4a7142[_0x4a2e('0x2f')],_0x4a91e6[_0x4a2e('0x31')]));if(_0x4a7142[_0x4a2e('0x2f')][_0x4a2e('0x3b')]){_0x3fa781['where']=_[_0x4a2e('0x3d')](_0x3fa781[_0x4a2e('0x3c')],{'$or':_[_0x4a2e('0x29')](_0x3fa781[_0x4a2e('0x34')],function(_0x16cd2b){var _0xbeae78={};_0xbeae78[_0x16cd2b]={'$like':'%'+_0x4a7142[_0x4a2e('0x2f')][_0x4a2e('0x3b')]+'%'};return _0xbeae78;})});}_0x3fa781=_['merge']({},_0x3fa781,_0x4a7142['options']);return _0x1d254f[_0x4a2e('0x4f')](_0x3fa781);}})[_0x4a2e('0x24')](function(_0x367f39){if(_0x367f39){_0x26ae42=_0x367f39[_0x4a2e('0x47')];if(!_0x4a7142[_0x4a2e('0x2f')][_0x4a2e('0x35')](_0x4a2e('0x36'))){_0x3fa781[_0x4a2e('0x37')]=qs[_0x4a2e('0x37')](_0x4a7142['query'][_0x4a2e('0x37')]);_0x3fa781[_0x4a2e('0x1f')]=qs[_0x4a2e('0x1f')](_0x4a7142[_0x4a2e('0x2f')]['offset']);}return _0x1d254f[_0x4a2e('0x4f')](_0x3fa781);}})[_0x4a2e('0x24')](function(_0x5a232f){if(_0x5a232f){return _0x5a232f?{'count':_0x26ae42,'rows':_0x5a232f}:null;}})[_0x4a2e('0x24')](respondWithResult(_0x511efb,null))['catch'](handleError(_0x511efb,null));}; \ No newline at end of file +var _0x0257=['query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','rawAttributes','create','body','params','destroy','find','getSubjects','findOne','order','FreshsalesField','getDescriptions','getFields','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','keys'];(function(_0x449e3e,_0x3e113e){var _0x6cc58a=function(_0x4d8c4d){while(--_0x4d8c4d){_0x449e3e['push'](_0x449e3e['shift']());}};_0x6cc58a(++_0x3e113e);}(_0x0257,0x159));var _0x7025=function(_0x5e2862,_0x4760eb){_0x5e2862=_0x5e2862-0x0;var _0x8dcad4=_0x0257[_0x5e2862];return _0x8dcad4;};'use strict';var emlformat=require(_0x7025('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7025('0x1'));var jsonpatch=require(_0x7025('0x2'));var rp=require(_0x7025('0x3'));var moment=require('moment');var BPromise=require(_0x7025('0x4'));var Mustache=require(_0x7025('0x5'));var util=require(_0x7025('0x6'));var path=require(_0x7025('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7025('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7025('0x9'));var squel=require('squel');var crypto=require(_0x7025('0xa'));var jsforce=require(_0x7025('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x7025('0xc'));var querystring=require(_0x7025('0xd'));var Papa=require(_0x7025('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7025('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7025('0x10'));var logger=require(_0x7025('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x7025('0x12'));var licenseUtil=require(_0x7025('0x13'));var db=require(_0x7025('0x14'))['db'];function respondWithStatusCode(_0x548a3b,_0xd5f61b){_0xd5f61b=_0xd5f61b||0xcc;return function(_0x203614){if(_0x203614){return _0x548a3b[_0x7025('0x15')](_0xd5f61b);}return _0x548a3b['status'](_0xd5f61b)[_0x7025('0x16')]();};}function respondWithResult(_0x2eb8da,_0x3beac6){_0x3beac6=_0x3beac6||0xc8;return function(_0x106a5b){if(_0x106a5b){return _0x2eb8da[_0x7025('0x17')](_0x3beac6)[_0x7025('0x18')](_0x106a5b);}};}function respondWithFilteredResult(_0x26cf0d,_0x368f4d){return function(_0x2b4dc7){if(_0x2b4dc7){var _0x19aba4=typeof _0x368f4d[_0x7025('0x19')]===_0x7025('0x1a')&&typeof _0x368f4d[_0x7025('0x1b')]===_0x7025('0x1a');var _0x3ff00c=_0x2b4dc7['count'];var _0x1fcde8=_0x19aba4?0x0:_0x368f4d[_0x7025('0x19')];var _0x1fa7f7=_0x19aba4?_0x2b4dc7[_0x7025('0x1c')]:_0x368f4d[_0x7025('0x19')]+_0x368f4d[_0x7025('0x1b')];var _0x116e6e;if(_0x1fa7f7>=_0x3ff00c){_0x1fa7f7=_0x3ff00c;_0x116e6e=0xc8;}else{_0x116e6e=0xce;}_0x26cf0d[_0x7025('0x17')](_0x116e6e);return _0x26cf0d[_0x7025('0x1d')](_0x7025('0x1e'),_0x1fcde8+'-'+_0x1fa7f7+'/'+_0x3ff00c)[_0x7025('0x18')](_0x2b4dc7);}return null;};}function patchUpdates(_0x20729e){return function(_0x24006e){try{jsonpatch['apply'](_0x24006e,_0x20729e,!![]);}catch(_0x605c58){return BPromise['reject'](_0x605c58);}return _0x24006e[_0x7025('0x1f')]();};}function saveUpdates(_0x4461c0,_0xf906b7){return function(_0x17d3bd){if(_0x17d3bd){return _0x17d3bd[_0x7025('0x20')](_0x4461c0)[_0x7025('0x21')](function(_0x5b9492){return _0x5b9492;});}return null;};}function removeEntity(_0x5a89bd,_0x4acf1e){return function(_0x52296a){if(_0x52296a){return _0x52296a['destroy']()[_0x7025('0x21')](function(){_0x5a89bd[_0x7025('0x17')](0xcc)[_0x7025('0x16')]();});}};}function handleEntityNotFound(_0xfedb2d,_0x135010){return function(_0x1b7e2b){if(!_0x1b7e2b){_0xfedb2d[_0x7025('0x15')](0x194);}return _0x1b7e2b;};}function handleError(_0x486882,_0x1d89c4){_0x1d89c4=_0x1d89c4||0x1f4;return function(_0x5f32a0){logger[_0x7025('0x22')](_0x5f32a0[_0x7025('0x23')]);if(_0x5f32a0['name']){delete _0x5f32a0[_0x7025('0x24')];}_0x486882[_0x7025('0x17')](_0x1d89c4)[_0x7025('0x25')](_0x5f32a0);};}exports[_0x7025('0x26')]=function(_0x4ec800,_0x1bfb6b){var _0x278372={},_0x1ab031={},_0x33bc57={'count':0x0,'rows':[]};var _0x4bde6c=_[_0x7025('0x27')](db[_0x7025('0x28')]['rawAttributes'],function(_0x52363a){return{'name':_0x52363a[_0x7025('0x29')],'type':_0x52363a[_0x7025('0x2a')][_0x7025('0x2b')]};});_0x1ab031['model']=_[_0x7025('0x27')](_0x4bde6c,_0x7025('0x24'));_0x1ab031['query']=_[_0x7025('0x2c')](_0x4ec800[_0x7025('0x2d')]);_0x1ab031[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0x1ab031[_0x7025('0x30')],_0x1ab031[_0x7025('0x2d')]);_0x278372['attributes']=_[_0x7025('0x2f')](_0x1ab031[_0x7025('0x30')],qs[_0x7025('0x31')](_0x4ec800[_0x7025('0x2d')]['fields']));_0x278372[_0x7025('0x32')]=_0x278372[_0x7025('0x32')][_0x7025('0x33')]?_0x278372[_0x7025('0x32')]:_0x1ab031[_0x7025('0x30')];if(!_0x4ec800[_0x7025('0x2d')][_0x7025('0x34')](_0x7025('0x35'))){_0x278372[_0x7025('0x1b')]=qs['limit'](_0x4ec800[_0x7025('0x2d')][_0x7025('0x1b')]);_0x278372[_0x7025('0x19')]=qs[_0x7025('0x19')](_0x4ec800[_0x7025('0x2d')][_0x7025('0x19')]);}_0x278372['order']=qs[_0x7025('0x36')](_0x4ec800['query']['sort']);_0x278372[_0x7025('0x37')]=qs[_0x7025('0x2e')](_[_0x7025('0x38')](_0x4ec800[_0x7025('0x2d')],_0x1ab031[_0x7025('0x2e')]),_0x4bde6c);if(_0x4ec800[_0x7025('0x2d')]['filter']){_0x278372[_0x7025('0x37')]=_[_0x7025('0x39')](_0x278372[_0x7025('0x37')],{'$or':_['map'](_0x4bde6c,function(_0x169a7f){if(_0x169a7f[_0x7025('0x2a')]!==_0x7025('0x3a')){var _0x51153b={};_0x51153b[_0x169a7f[_0x7025('0x24')]]={'$like':'%'+_0x4ec800[_0x7025('0x2d')][_0x7025('0x3b')]+'%'};return _0x51153b;}})});}_0x278372=_['merge']({},_0x278372,_0x4ec800[_0x7025('0x3c')]);var _0xbd0397={'where':_0x278372[_0x7025('0x37')]};return db['FreshsalesConfiguration'][_0x7025('0x1c')](_0xbd0397)[_0x7025('0x21')](function(_0x5667d1){_0x33bc57[_0x7025('0x1c')]=_0x5667d1;if(_0x4ec800[_0x7025('0x2d')][_0x7025('0x3d')]){_0x278372['include']=[{'all':!![]}];}return db[_0x7025('0x28')][_0x7025('0x3e')](_0x278372);})['then'](function(_0x3d0aed){_0x33bc57[_0x7025('0x3f')]=_0x3d0aed;return _0x33bc57;})[_0x7025('0x21')](respondWithFilteredResult(_0x1bfb6b,_0x278372))[_0x7025('0x40')](handleError(_0x1bfb6b,null));};exports[_0x7025('0x41')]=function(_0x406f72,_0x3b417a){var _0x31cdb9={'raw':![],'where':{'id':_0x406f72['params']['id']}},_0x41a663={};_0x41a663[_0x7025('0x30')]=_[_0x7025('0x2c')](db[_0x7025('0x28')][_0x7025('0x42')]);_0x41a663['query']=_[_0x7025('0x2c')](_0x406f72['query']);_0x41a663[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0x41a663[_0x7025('0x30')],_0x41a663[_0x7025('0x2d')]);_0x31cdb9[_0x7025('0x32')]=_[_0x7025('0x2f')](_0x41a663['model'],qs[_0x7025('0x31')](_0x406f72['query'][_0x7025('0x31')]));_0x31cdb9[_0x7025('0x32')]=_0x31cdb9['attributes'][_0x7025('0x33')]?_0x31cdb9[_0x7025('0x32')]:_0x41a663[_0x7025('0x30')];if(_0x406f72['query']['includeAll']){_0x31cdb9['include']=[{'all':!![]}];}_0x31cdb9=_['merge']({},_0x31cdb9,_0x406f72[_0x7025('0x3c')]);return db[_0x7025('0x28')]['find'](_0x31cdb9)[_0x7025('0x21')](handleEntityNotFound(_0x3b417a,null))['then'](respondWithResult(_0x3b417a,null))['catch'](handleError(_0x3b417a,null));};exports['create']=function(_0x65d820,_0x2293ba){return db[_0x7025('0x28')][_0x7025('0x43')](_0x65d820['body'],{})[_0x7025('0x21')](respondWithResult(_0x2293ba,0xc9))[_0x7025('0x40')](handleError(_0x2293ba,null));};exports[_0x7025('0x20')]=function(_0x10b93f,_0x547545){if(_0x10b93f[_0x7025('0x44')]['id']){delete _0x10b93f['body']['id'];}return db[_0x7025('0x28')]['find']({'where':{'id':_0x10b93f[_0x7025('0x45')]['id']}})['then'](handleEntityNotFound(_0x547545,null))[_0x7025('0x21')](saveUpdates(_0x10b93f[_0x7025('0x44')],null))[_0x7025('0x21')](respondWithResult(_0x547545,null))['catch'](handleError(_0x547545,null));};exports[_0x7025('0x46')]=function(_0x73a8d5,_0x1a9697){return db[_0x7025('0x28')][_0x7025('0x47')]({'where':{'id':_0x73a8d5[_0x7025('0x45')]['id']}})[_0x7025('0x21')](handleEntityNotFound(_0x1a9697,null))['then'](removeEntity(_0x1a9697,null))[_0x7025('0x40')](handleError(_0x1a9697,null));};exports[_0x7025('0x48')]=function(_0x317f5f,_0x3a1e82,_0x3744d5){var _0x2cc994={};var _0xe3a437={};var _0xac750c;var _0x11bb1f;return db['FreshsalesConfiguration'][_0x7025('0x49')]({'where':{'id':_0x317f5f['params']['id']}})['then'](handleEntityNotFound(_0x3a1e82,null))[_0x7025('0x21')](function(_0x3426a8){if(_0x3426a8){_0xac750c=_0x3426a8;_0xe3a437[_0x7025('0x30')]=_[_0x7025('0x2c')](db['FreshsalesField'][_0x7025('0x42')]);_0xe3a437['query']=_[_0x7025('0x2c')](_0x317f5f[_0x7025('0x2d')]);_0xe3a437[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0xe3a437[_0x7025('0x30')],_0xe3a437[_0x7025('0x2d')]);_0x2cc994[_0x7025('0x32')]=_[_0x7025('0x2f')](_0xe3a437['model'],qs[_0x7025('0x31')](_0x317f5f[_0x7025('0x2d')][_0x7025('0x31')]));_0x2cc994[_0x7025('0x32')]=_0x2cc994['attributes'][_0x7025('0x33')]?_0x2cc994[_0x7025('0x32')]:_0xe3a437[_0x7025('0x30')];_0x2cc994[_0x7025('0x4a')]=qs[_0x7025('0x36')](_0x317f5f[_0x7025('0x2d')][_0x7025('0x36')]);_0x2cc994[_0x7025('0x37')]=qs[_0x7025('0x2e')](_[_0x7025('0x38')](_0x317f5f['query'],_0xe3a437[_0x7025('0x2e')]));if(_0x317f5f[_0x7025('0x2d')][_0x7025('0x3b')]){_0x2cc994['where']=_[_0x7025('0x39')](_0x2cc994['where'],{'$or':_['map'](_0x2cc994[_0x7025('0x32')],function(_0x3b7432){var _0x4fc697={};_0x4fc697[_0x3b7432]={'$like':'%'+_0x317f5f[_0x7025('0x2d')]['filter']+'%'};return _0x4fc697;})});}_0x2cc994=_[_0x7025('0x39')]({},_0x2cc994,_0x317f5f['options']);return _0xac750c[_0x7025('0x48')](_0x2cc994);}})[_0x7025('0x21')](function(_0x4af205){if(_0x4af205){_0x11bb1f=_0x4af205[_0x7025('0x33')];if(!_0x317f5f[_0x7025('0x2d')]['hasOwnProperty'](_0x7025('0x35'))){_0x2cc994[_0x7025('0x1b')]=qs[_0x7025('0x1b')](_0x317f5f['query'][_0x7025('0x1b')]);_0x2cc994[_0x7025('0x19')]=qs[_0x7025('0x19')](_0x317f5f[_0x7025('0x2d')][_0x7025('0x19')]);}return _0xac750c[_0x7025('0x48')](_0x2cc994);}})[_0x7025('0x21')](function(_0x23768e){if(_0x23768e){return _0x23768e?{'count':_0x11bb1f,'rows':_0x23768e}:null;}})['then'](respondWithResult(_0x3a1e82,null))[_0x7025('0x40')](handleError(_0x3a1e82,null));};exports['getDescriptions']=function(_0x1b757a,_0xfedee9,_0x3657bb){var _0x13b2c8={};var _0x5855cf={};var _0x5969a3;var _0x3586f6;return db[_0x7025('0x28')][_0x7025('0x49')]({'where':{'id':_0x1b757a[_0x7025('0x45')]['id']}})[_0x7025('0x21')](handleEntityNotFound(_0xfedee9,null))[_0x7025('0x21')](function(_0x36f71a){if(_0x36f71a){_0x5969a3=_0x36f71a;_0x5855cf[_0x7025('0x30')]=_[_0x7025('0x2c')](db[_0x7025('0x4b')][_0x7025('0x42')]);_0x5855cf[_0x7025('0x2d')]=_[_0x7025('0x2c')](_0x1b757a['query']);_0x5855cf[_0x7025('0x2e')]=_[_0x7025('0x2f')](_0x5855cf['model'],_0x5855cf[_0x7025('0x2d')]);_0x13b2c8[_0x7025('0x32')]=_[_0x7025('0x2f')](_0x5855cf[_0x7025('0x30')],qs[_0x7025('0x31')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x31')]));_0x13b2c8[_0x7025('0x32')]=_0x13b2c8[_0x7025('0x32')][_0x7025('0x33')]?_0x13b2c8[_0x7025('0x32')]:_0x5855cf['model'];_0x13b2c8['order']=qs[_0x7025('0x36')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x36')]);_0x13b2c8[_0x7025('0x37')]=qs[_0x7025('0x2e')](_['pick'](_0x1b757a[_0x7025('0x2d')],_0x5855cf['filters']));if(_0x1b757a[_0x7025('0x2d')][_0x7025('0x3b')]){_0x13b2c8['where']=_[_0x7025('0x39')](_0x13b2c8[_0x7025('0x37')],{'$or':_[_0x7025('0x27')](_0x13b2c8[_0x7025('0x32')],function(_0x285b3a){var _0x12b3b5={};_0x12b3b5[_0x285b3a]={'$like':'%'+_0x1b757a[_0x7025('0x2d')][_0x7025('0x3b')]+'%'};return _0x12b3b5;})});}_0x13b2c8=_[_0x7025('0x39')]({},_0x13b2c8,_0x1b757a['options']);return _0x5969a3['getDescriptions'](_0x13b2c8);}})[_0x7025('0x21')](function(_0x30c4c5){if(_0x30c4c5){_0x3586f6=_0x30c4c5[_0x7025('0x33')];if(!_0x1b757a['query']['hasOwnProperty']('nolimit')){_0x13b2c8[_0x7025('0x1b')]=qs[_0x7025('0x1b')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x1b')]);_0x13b2c8['offset']=qs[_0x7025('0x19')](_0x1b757a[_0x7025('0x2d')][_0x7025('0x19')]);}return _0x5969a3[_0x7025('0x4c')](_0x13b2c8);}})[_0x7025('0x21')](function(_0x33780f){if(_0x33780f){return _0x33780f?{'count':_0x3586f6,'rows':_0x33780f}:null;}})[_0x7025('0x21')](respondWithResult(_0xfedee9,null))[_0x7025('0x40')](handleError(_0xfedee9,null));};exports[_0x7025('0x4d')]=function(_0x4bb841,_0x490245,_0x48e7db){var _0x5b7982={};var _0x2d3a28={};var _0x5cdbc4;var _0x32dbd4;return db[_0x7025('0x28')][_0x7025('0x49')]({'where':{'id':_0x4bb841[_0x7025('0x45')]['id']}})[_0x7025('0x21')](handleEntityNotFound(_0x490245,null))[_0x7025('0x21')](function(_0x29900e){if(_0x29900e){_0x5cdbc4=_0x29900e;_0x2d3a28[_0x7025('0x30')]=_[_0x7025('0x2c')](db[_0x7025('0x4b')][_0x7025('0x42')]);_0x2d3a28[_0x7025('0x2d')]=_[_0x7025('0x2c')](_0x4bb841[_0x7025('0x2d')]);_0x2d3a28['filters']=_[_0x7025('0x2f')](_0x2d3a28[_0x7025('0x30')],_0x2d3a28['query']);_0x5b7982[_0x7025('0x32')]=_[_0x7025('0x2f')](_0x2d3a28['model'],qs[_0x7025('0x31')](_0x4bb841['query']['fields']));_0x5b7982[_0x7025('0x32')]=_0x5b7982['attributes'][_0x7025('0x33')]?_0x5b7982['attributes']:_0x2d3a28[_0x7025('0x30')];_0x5b7982['order']=qs[_0x7025('0x36')](_0x4bb841[_0x7025('0x2d')][_0x7025('0x36')]);_0x5b7982['where']=qs[_0x7025('0x2e')](_['pick'](_0x4bb841[_0x7025('0x2d')],_0x2d3a28[_0x7025('0x2e')]));if(_0x4bb841[_0x7025('0x2d')][_0x7025('0x3b')]){_0x5b7982['where']=_['merge'](_0x5b7982[_0x7025('0x37')],{'$or':_['map'](_0x5b7982['attributes'],function(_0x1ac0d3){var _0x26e579={};_0x26e579[_0x1ac0d3]={'$like':'%'+_0x4bb841[_0x7025('0x2d')][_0x7025('0x3b')]+'%'};return _0x26e579;})});}_0x5b7982=_['merge']({},_0x5b7982,_0x4bb841[_0x7025('0x3c')]);return _0x5cdbc4['getFields'](_0x5b7982);}})['then'](function(_0x46b0f0){if(_0x46b0f0){_0x32dbd4=_0x46b0f0[_0x7025('0x33')];if(!_0x4bb841[_0x7025('0x2d')][_0x7025('0x34')]('nolimit')){_0x5b7982[_0x7025('0x1b')]=qs[_0x7025('0x1b')](_0x4bb841['query'][_0x7025('0x1b')]);_0x5b7982[_0x7025('0x19')]=qs['offset'](_0x4bb841[_0x7025('0x2d')][_0x7025('0x19')]);}return _0x5cdbc4[_0x7025('0x4d')](_0x5b7982);}})[_0x7025('0x21')](function(_0x5398f5){if(_0x5398f5){return _0x5398f5?{'count':_0x32dbd4,'rows':_0x5398f5}:null;}})[_0x7025('0x21')](respondWithResult(_0x490245,null))[_0x7025('0x40')](handleError(_0x490245,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 7984e83..c36f0be 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 _0x79ec=['bluebird','request-promise','path','../../config/environment','exports','define','FreshsalesConfiguration','lodash','util','../../config/logger','api'];(function(_0x2ff626,_0x49b089){var _0x2b65d6=function(_0x425b30){while(--_0x425b30){_0x2ff626['push'](_0x2ff626['shift']());}};_0x2b65d6(++_0x49b089);}(_0x79ec,0x172));var _0xc79e=function(_0x16ccc4,_0x439e40){_0x16ccc4=_0x16ccc4-0x0;var _0x2d3fd0=_0x79ec[_0x16ccc4];return _0x2d3fd0;};'use strict';var _=require(_0xc79e('0x0'));var util=require(_0xc79e('0x1'));var logger=require(_0xc79e('0x2'))(_0xc79e('0x3'));var moment=require('moment');var BPromise=require(_0xc79e('0x4'));var rp=require(_0xc79e('0x5'));var fs=require('fs');var path=require(_0xc79e('0x6'));var rimraf=require('rimraf');var config=require(_0xc79e('0x7'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0xc79e('0x8')]=function(_0xa0d435,_0x20dc48){return _0xa0d435[_0xc79e('0x9')](_0xc79e('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28f2=['bluebird','path','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','../../config/logger','api','moment'];(function(_0x2c922a,_0x205467){var _0x2cdb0c=function(_0x5648c7){while(--_0x5648c7){_0x2c922a['push'](_0x2c922a['shift']());}};_0x2cdb0c(++_0x205467);}(_0x28f2,0xac));var _0x228f=function(_0x3452e4,_0x5d52ca){_0x3452e4=_0x3452e4-0x0;var _0xac597c=_0x28f2[_0x3452e4];return _0xac597c;};'use strict';var _=require(_0x228f('0x0'));var util=require('util');var logger=require(_0x228f('0x1'))(_0x228f('0x2'));var moment=require(_0x228f('0x3'));var BPromise=require(_0x228f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x228f('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x228f('0x6'));module[_0x228f('0x7')]=function(_0x5182f0,_0x44dd53){return _0x5182f0[_0x228f('0x8')](_0x228f('0x9'),attributes,{'tableName':_0x228f('0xa'),'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 01d87b0..26b1535 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 _0x83a4=['code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4fd51c,_0x212fca){var _0xde5b62=function(_0x2b865c){while(--_0x2b865c){_0x4fd51c['push'](_0x4fd51c['shift']());}};_0xde5b62(++_0x212fca);}(_0x83a4,0x111));var _0x483a=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x83a4[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x483a('0x0'));var util=require(_0x483a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x483a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x483a('0x3'))(_0x483a('0x4'));var config=require('../../config/environment');var jayson=require(_0x483a('0x5'));var client=jayson[_0x483a('0x6')][_0x483a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb57252,_0x1998a1,_0x1582ac){return new BPromise(function(_0x2efd6d,_0x190f8b){return client['request'](_0xb57252,_0x1582ac)[_0x483a('0x8')](function(_0x2c3e61){logger[_0x483a('0x9')](_0x483a('0xa'),_0x1998a1,_0x483a('0xb'));logger['debug'](_0x483a('0xc'),_0x1998a1,_0x483a('0xb'),JSON[_0x483a('0xd')](_0x2c3e61));if(_0x2c3e61[_0x483a('0xe')]){if(_0x2c3e61[_0x483a('0xe')][_0x483a('0xf')]===0x1f4){logger[_0x483a('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1998a1,_0x2c3e61[_0x483a('0xe')]['message']);return _0x190f8b(_0x2c3e61[_0x483a('0xe')][_0x483a('0x10')]);}logger[_0x483a('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1998a1,_0x2c3e61[_0x483a('0xe')][_0x483a('0x10')]);return _0x2efd6d(_0x2c3e61[_0x483a('0xe')][_0x483a('0x10')]);}else{logger[_0x483a('0x9')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1998a1,'request\x20sent');_0x2efd6d(_0x2c3e61['result']['message']);}})[_0x483a('0x11')](function(_0x45709e){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x1998a1,_0x45709e);_0x190f8b(_0x45709e);});});} \ No newline at end of file +var _0x71c9=['util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x71c9,0x107));var _0x971c=function(_0x1ee5d8,_0x1ba59d){_0x1ee5d8=_0x1ee5d8-0x0;var _0x4640a0=_0x71c9[_0x1ee5d8];return _0x4640a0;};'use strict';var _=require(_0x971c('0x0'));var util=require(_0x971c('0x1'));var moment=require(_0x971c('0x2'));var BPromise=require(_0x971c('0x3'));var rs=require(_0x971c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x971c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x971c('0x6'));var jayson=require(_0x971c('0x7'));var client=jayson[_0x971c('0x8')][_0x971c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b81f6,_0x40fa61,_0x12eeb6){return new BPromise(function(_0xe988ba,_0x90235){return client[_0x971c('0xa')](_0x2b81f6,_0x12eeb6)[_0x971c('0xb')](function(_0x3ca9d5){logger[_0x971c('0xc')](_0x971c('0xd'),_0x40fa61,_0x971c('0xe'));logger[_0x971c('0xf')](_0x971c('0x10'),_0x40fa61,_0x971c('0xe'),JSON['stringify'](_0x3ca9d5));if(_0x3ca9d5[_0x971c('0x11')]){if(_0x3ca9d5['error'][_0x971c('0x12')]===0x1f4){logger[_0x971c('0x11')](_0x971c('0xd'),_0x40fa61,_0x3ca9d5['error'][_0x971c('0x13')]);return _0x90235(_0x3ca9d5[_0x971c('0x11')]['message']);}logger[_0x971c('0x11')](_0x971c('0xd'),_0x40fa61,_0x3ca9d5[_0x971c('0x11')][_0x971c('0x13')]);return _0xe988ba(_0x3ca9d5[_0x971c('0x11')][_0x971c('0x13')]);}else{logger[_0x971c('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x40fa61,_0x971c('0xe'));_0xe988ba(_0x3ca9d5[_0x971c('0x14')][_0x971c('0x13')]);}})[_0x971c('0x15')](function(_0x8a7b45){logger[_0x971c('0x11')](_0x971c('0xd'),_0x40fa61,_0x8a7b45);_0x90235(_0x8a7b45);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 77c3d0b..f8ef844 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 _0x2e31=['post','put','/:id','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','show'];(function(_0x4a3e92,_0x548ffb){var _0x5bcad2=function(_0x1c7c8a){while(--_0x1c7c8a){_0x4a3e92['push'](_0x4a3e92['shift']());}};_0x5bcad2(++_0x548ffb);}(_0x2e31,0x145));var _0x12e3=function(_0x325779,_0x598c85){_0x325779=_0x325779-0x0;var _0x3fe859=_0x2e31[_0x325779];return _0x3fe859;};'use strict';var multer=require(_0x12e3('0x0'));var util=require(_0x12e3('0x1'));var path=require(_0x12e3('0x2'));var timeout=require('connect-timeout');var express=require(_0x12e3('0x3'));var router=express[_0x12e3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x12e3('0x5'));var config=require(_0x12e3('0x6'));var controller=require(_0x12e3('0x7'));router['get']('/',auth[_0x12e3('0x8')](),controller[_0x12e3('0x9')]);router['get']('/:id',auth[_0x12e3('0x8')](),controller[_0x12e3('0xa')]);router[_0x12e3('0xb')]('/',auth[_0x12e3('0x8')](),controller['create']);router[_0x12e3('0xc')](_0x12e3('0xd'),auth[_0x12e3('0x8')](),controller['update']);router['delete'](_0x12e3('0xd'),auth[_0x12e3('0x8')](),controller[_0x12e3('0xe')]);module[_0x12e3('0xf')]=router; \ No newline at end of file +var _0xda65=['Router','fs-extra','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','express'];(function(_0x43e04b,_0x169a65){var _0x10aae0=function(_0x2ed67b){while(--_0x2ed67b){_0x43e04b['push'](_0x43e04b['shift']());}};_0x10aae0(++_0x169a65);}(_0xda65,0x1d0));var _0x5da6=function(_0x5a9bc8,_0x5bfe84){_0x5a9bc8=_0x5a9bc8-0x0;var _0x2f6e2b=_0xda65[_0x5a9bc8];return _0x2f6e2b;};'use strict';var multer=require(_0x5da6('0x0'));var util=require(_0x5da6('0x1'));var path=require(_0x5da6('0x2'));var timeout=require('connect-timeout');var express=require(_0x5da6('0x3'));var router=express[_0x5da6('0x4')]();var fs_extra=require(_0x5da6('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5da6('0x6'));var controller=require(_0x5da6('0x7'));router[_0x5da6('0x8')]('/',auth[_0x5da6('0x9')](),controller[_0x5da6('0xa')]);router['get'](_0x5da6('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5da6('0xc')]('/',auth['isAuthenticated'](),controller[_0x5da6('0xd')]);router[_0x5da6('0xe')](_0x5da6('0xb'),auth[_0x5da6('0x9')](),controller[_0x5da6('0xf')]);router[_0x5da6('0x10')](_0x5da6('0xb'),auth[_0x5da6('0x9')](),controller['destroy']);module[_0x5da6('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 0bc1ee0..3939da5 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 _0x35bf=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x35bf,0x1c8));var _0xf35b=function(_0x1de4e9,_0x1b12ff){_0x1de4e9=_0x1de4e9-0x0;var _0x5a2c02=_0x35bf[_0x1de4e9];return _0x5a2c02;};'use strict';var Sequelize=require(_0xf35b('0x0'));module[_0xf35b('0x1')]={'type':{'type':Sequelize[_0xf35b('0x2')](_0xf35b('0x3'),_0xf35b('0x4'),_0xf35b('0x5'),_0xf35b('0x6'),_0xf35b('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf35b('0x8')]},'key':{'type':Sequelize[_0xf35b('0x8')]},'keyType':{'type':Sequelize[_0xf35b('0x2')]('string',_0xf35b('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xf35b('0x8')]},'idField':{'type':Sequelize[_0xf35b('0x8')]},'nameField':{'type':Sequelize[_0xf35b('0x8')]},'customField':{'type':Sequelize[_0xf35b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf35b('0x8')]}}; \ No newline at end of file +var _0x4f36=['string','variable','customVariable','keyValue','STRING','BOOLEAN','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f36,0x14e));var _0x64f3=function(_0x10d618,_0x1f1c82){_0x10d618=_0x10d618-0x0;var _0x57d044=_0x4f36[_0x10d618];return _0x57d044;};'use strict';var Sequelize=require('sequelize');module[_0x64f3('0x0')]={'type':{'type':Sequelize[_0x64f3('0x1')](_0x64f3('0x2'),_0x64f3('0x3'),_0x64f3('0x4'),_0x64f3('0x5'),'picklist'),'defaultValue':_0x64f3('0x2')},'content':{'type':Sequelize[_0x64f3('0x6')]},'key':{'type':Sequelize[_0x64f3('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x64f3('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x64f3('0x6')]},'nameField':{'type':Sequelize[_0x64f3('0x6')]},'customField':{'type':Sequelize[_0x64f3('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x64f3('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index c8077be..e85e99b 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 _0xe881=['eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','query','intersection','model','fields','attributes','nolimit','sort','pick','filters','filter','where','merge','options','FreshsalesField','include','findAll','catch','show','params','keys','includeAll','find','create','body'];(function(_0x28a364,_0x5de163){var _0x11e7d6=function(_0x304ad3){while(--_0x304ad3){_0x28a364['push'](_0x28a364['shift']());}};_0x11e7d6(++_0x5de163);}(_0xe881,0x84));var _0x1e88=function(_0x14f458,_0x5dd219){_0x14f458=_0x14f458-0x0;var _0x4ff2da=_0xe881[_0x14f458];return _0x4ff2da;};'use strict';var emlformat=require(_0x1e88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1e88('0x1'));var jsonpatch=require(_0x1e88('0x2'));var rp=require(_0x1e88('0x3'));var moment=require('moment');var BPromise=require(_0x1e88('0x4'));var Mustache=require('mustache');var util=require(_0x1e88('0x5'));var path=require(_0x1e88('0x6'));var sox=require('sox');var csv=require(_0x1e88('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1e88('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1e88('0x9'));var deskjs=require(_0x1e88('0xa'));var toCsv=require(_0x1e88('0x7'));var querystring=require('querystring');var Papa=require(_0x1e88('0xb'));var Redis=require(_0x1e88('0xc'));var authService=require(_0x1e88('0xd'));var qs=require(_0x1e88('0xe'));var as=require(_0x1e88('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1e88('0x10'))('api');var utils=require(_0x1e88('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x1e88('0x12'));var db=require(_0x1e88('0x13'))['db'];function respondWithStatusCode(_0x22cf4c,_0x392bcb){_0x392bcb=_0x392bcb||0xcc;return function(_0x440111){if(_0x440111){return _0x22cf4c[_0x1e88('0x14')](_0x392bcb);}return _0x22cf4c['status'](_0x392bcb)[_0x1e88('0x15')]();};}function respondWithResult(_0x5c323a,_0x459f45){_0x459f45=_0x459f45||0xc8;return function(_0x280141){if(_0x280141){return _0x5c323a[_0x1e88('0x16')](_0x459f45)[_0x1e88('0x17')](_0x280141);}};}function respondWithFilteredResult(_0x39d37c,_0x3cd35e){return function(_0x46415c){if(_0x46415c){var _0x3725e8=typeof _0x3cd35e[_0x1e88('0x18')]===_0x1e88('0x19')&&typeof _0x3cd35e[_0x1e88('0x1a')]==='undefined';var _0x500d40=_0x46415c['count'];var _0x22b593=_0x3725e8?0x0:_0x3cd35e[_0x1e88('0x18')];var _0x2a851d=_0x3725e8?_0x46415c[_0x1e88('0x1b')]:_0x3cd35e['offset']+_0x3cd35e['limit'];var _0x41b09c;if(_0x2a851d>=_0x500d40){_0x2a851d=_0x500d40;_0x41b09c=0xc8;}else{_0x41b09c=0xce;}_0x39d37c['status'](_0x41b09c);return _0x39d37c[_0x1e88('0x1c')]('Content-Range',_0x22b593+'-'+_0x2a851d+'/'+_0x500d40)[_0x1e88('0x17')](_0x46415c);}return null;};}function patchUpdates(_0x462686){return function(_0x46716f){try{jsonpatch[_0x1e88('0x1d')](_0x46716f,_0x462686,!![]);}catch(_0x348d27){return BPromise['reject'](_0x348d27);}return _0x46716f[_0x1e88('0x1e')]();};}function saveUpdates(_0x2e2103,_0x444e42){return function(_0x2967b8){if(_0x2967b8){return _0x2967b8[_0x1e88('0x1f')](_0x2e2103)[_0x1e88('0x20')](function(_0x29b0a3){return _0x29b0a3;});}return null;};}function removeEntity(_0x4a4495,_0x3b8da4){return function(_0x5a66ce){if(_0x5a66ce){return _0x5a66ce[_0x1e88('0x21')]()['then'](function(){_0x4a4495[_0x1e88('0x16')](0xcc)[_0x1e88('0x15')]();});}};}function handleEntityNotFound(_0x1f146f,_0x2f27d6){return function(_0x6cce82){if(!_0x6cce82){_0x1f146f['sendStatus'](0x194);}return _0x6cce82;};}function handleError(_0x22a86a,_0x36a083){_0x36a083=_0x36a083||0x1f4;return function(_0x2c074f){logger[_0x1e88('0x22')](_0x2c074f['stack']);if(_0x2c074f[_0x1e88('0x23')]){delete _0x2c074f[_0x1e88('0x23')];}_0x22a86a[_0x1e88('0x16')](_0x36a083)[_0x1e88('0x24')](_0x2c074f);};}exports[_0x1e88('0x25')]=function(_0x49657f,_0x5b93ce){var _0x21e339={},_0x1f46a7={},_0x2ea60d={'count':0x0,'rows':[]};var _0x43e780=_[_0x1e88('0x26')](db['FreshsalesField'][_0x1e88('0x27')],function(_0x486217){return{'name':_0x486217[_0x1e88('0x28')],'type':_0x486217[_0x1e88('0x29')]['key']};});_0x1f46a7['model']=_[_0x1e88('0x26')](_0x43e780,_0x1e88('0x23'));_0x1f46a7['query']=_['keys'](_0x49657f[_0x1e88('0x2a')]);_0x1f46a7['filters']=_[_0x1e88('0x2b')](_0x1f46a7[_0x1e88('0x2c')],_0x1f46a7['query']);_0x21e339['attributes']=_[_0x1e88('0x2b')](_0x1f46a7[_0x1e88('0x2c')],qs[_0x1e88('0x2d')](_0x49657f[_0x1e88('0x2a')]['fields']));_0x21e339[_0x1e88('0x2e')]=_0x21e339[_0x1e88('0x2e')]['length']?_0x21e339[_0x1e88('0x2e')]:_0x1f46a7['model'];if(!_0x49657f[_0x1e88('0x2a')]['hasOwnProperty'](_0x1e88('0x2f'))){_0x21e339['limit']=qs['limit'](_0x49657f[_0x1e88('0x2a')][_0x1e88('0x1a')]);_0x21e339['offset']=qs[_0x1e88('0x18')](_0x49657f['query'][_0x1e88('0x18')]);}_0x21e339['order']=qs[_0x1e88('0x30')](_0x49657f['query'][_0x1e88('0x30')]);_0x21e339['where']=qs['filters'](_[_0x1e88('0x31')](_0x49657f['query'],_0x1f46a7[_0x1e88('0x32')]),_0x43e780);if(_0x49657f[_0x1e88('0x2a')][_0x1e88('0x33')]){_0x21e339[_0x1e88('0x34')]=_[_0x1e88('0x35')](_0x21e339[_0x1e88('0x34')],{'$or':_[_0x1e88('0x26')](_0x43e780,function(_0x553a11){if(_0x553a11[_0x1e88('0x29')]!=='VIRTUAL'){var _0x448603={};_0x448603[_0x553a11[_0x1e88('0x23')]]={'$like':'%'+_0x49657f[_0x1e88('0x2a')][_0x1e88('0x33')]+'%'};return _0x448603;}})});}_0x21e339=_['merge']({},_0x21e339,_0x49657f[_0x1e88('0x36')]);var _0x270599={'where':_0x21e339[_0x1e88('0x34')]};return db[_0x1e88('0x37')]['count'](_0x270599)[_0x1e88('0x20')](function(_0x248a50){_0x2ea60d[_0x1e88('0x1b')]=_0x248a50;if(_0x49657f[_0x1e88('0x2a')]['includeAll']){_0x21e339[_0x1e88('0x38')]=[{'all':!![]}];}return db[_0x1e88('0x37')][_0x1e88('0x39')](_0x21e339);})['then'](function(_0x23b51c){_0x2ea60d['rows']=_0x23b51c;return _0x2ea60d;})[_0x1e88('0x20')](respondWithFilteredResult(_0x5b93ce,_0x21e339))[_0x1e88('0x3a')](handleError(_0x5b93ce,null));};exports[_0x1e88('0x3b')]=function(_0x6b429b,_0x21f3ca){var _0x5a5484={'raw':!![],'where':{'id':_0x6b429b[_0x1e88('0x3c')]['id']}},_0xb4554={};_0xb4554[_0x1e88('0x2c')]=_[_0x1e88('0x3d')](db[_0x1e88('0x37')][_0x1e88('0x27')]);_0xb4554[_0x1e88('0x2a')]=_[_0x1e88('0x3d')](_0x6b429b[_0x1e88('0x2a')]);_0xb4554[_0x1e88('0x32')]=_[_0x1e88('0x2b')](_0xb4554['model'],_0xb4554[_0x1e88('0x2a')]);_0x5a5484[_0x1e88('0x2e')]=_[_0x1e88('0x2b')](_0xb4554['model'],qs[_0x1e88('0x2d')](_0x6b429b['query']['fields']));_0x5a5484['attributes']=_0x5a5484[_0x1e88('0x2e')]['length']?_0x5a5484[_0x1e88('0x2e')]:_0xb4554[_0x1e88('0x2c')];if(_0x6b429b[_0x1e88('0x2a')][_0x1e88('0x3e')]){_0x5a5484[_0x1e88('0x38')]=[{'all':!![]}];}_0x5a5484=_[_0x1e88('0x35')]({},_0x5a5484,_0x6b429b[_0x1e88('0x36')]);return db[_0x1e88('0x37')][_0x1e88('0x3f')](_0x5a5484)['then'](handleEntityNotFound(_0x21f3ca,null))[_0x1e88('0x20')](respondWithResult(_0x21f3ca,null))[_0x1e88('0x3a')](handleError(_0x21f3ca,null));};exports['create']=function(_0x895f26,_0x2e64f5){return db[_0x1e88('0x37')][_0x1e88('0x40')](_0x895f26[_0x1e88('0x41')],{})['then'](respondWithResult(_0x2e64f5,0xc9))[_0x1e88('0x3a')](handleError(_0x2e64f5,null));};exports['update']=function(_0x4392e3,_0x170126){if(_0x4392e3[_0x1e88('0x41')]['id']){delete _0x4392e3[_0x1e88('0x41')]['id'];}return db[_0x1e88('0x37')]['find']({'where':{'id':_0x4392e3['params']['id']}})[_0x1e88('0x20')](handleEntityNotFound(_0x170126,null))[_0x1e88('0x20')](saveUpdates(_0x4392e3[_0x1e88('0x41')],null))['then'](respondWithResult(_0x170126,null))['catch'](handleError(_0x170126,null));};exports[_0x1e88('0x21')]=function(_0x3c6334,_0x5f5153){return db[_0x1e88('0x37')]['find']({'where':{'id':_0x3c6334[_0x1e88('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5f5153,null))['then'](removeEntity(_0x5f5153,null))[_0x1e88('0x3a')](handleError(_0x5f5153,null));}; \ No newline at end of file +var _0xfbeb=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshsalesField','rawAttributes','type','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xfbeb,0x80));var _0xbfbe=function(_0x5d0207,_0x4000c4){_0x5d0207=_0x5d0207-0x0;var _0xf3e249=_0xfbeb[_0x5d0207];return _0xf3e249;};'use strict';var emlformat=require(_0xbfbe('0x0'));var rimraf=require(_0xbfbe('0x1'));var zipdir=require(_0xbfbe('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfbe('0x3'));var BPromise=require(_0xbfbe('0x4'));var Mustache=require(_0xbfbe('0x5'));var util=require(_0xbfbe('0x6'));var path=require(_0xbfbe('0x7'));var sox=require(_0xbfbe('0x8'));var csv=require(_0xbfbe('0x9'));var ejs=require(_0xbfbe('0xa'));var fs=require('fs');var fs_extra=require(_0xbfbe('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbfbe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbfbe('0xd'));var toCsv=require(_0xbfbe('0x9'));var querystring=require(_0xbfbe('0xe'));var Papa=require(_0xbfbe('0xf'));var Redis=require(_0xbfbe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbfbe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfbe('0x12'));var logger=require(_0xbfbe('0x13'))(_0xbfbe('0x14'));var utils=require(_0xbfbe('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xbfbe('0x16'))['db'];function respondWithStatusCode(_0x519aaf,_0xb53fd4){_0xb53fd4=_0xb53fd4||0xcc;return function(_0x3a3f10){if(_0x3a3f10){return _0x519aaf[_0xbfbe('0x17')](_0xb53fd4);}return _0x519aaf[_0xbfbe('0x18')](_0xb53fd4)[_0xbfbe('0x19')]();};}function respondWithResult(_0x1527ae,_0x526a56){_0x526a56=_0x526a56||0xc8;return function(_0x38e727){if(_0x38e727){return _0x1527ae['status'](_0x526a56)[_0xbfbe('0x1a')](_0x38e727);}};}function respondWithFilteredResult(_0x55c87f,_0x370519){return function(_0x2fae93){if(_0x2fae93){var _0x4385b9=typeof _0x370519[_0xbfbe('0x1b')]===_0xbfbe('0x1c')&&typeof _0x370519['limit']===_0xbfbe('0x1c');var _0x328ab5=_0x2fae93[_0xbfbe('0x1d')];var _0x34fd6f=_0x4385b9?0x0:_0x370519[_0xbfbe('0x1b')];var _0x236ebf=_0x4385b9?_0x2fae93['count']:_0x370519['offset']+_0x370519[_0xbfbe('0x1e')];var _0x179d9b;if(_0x236ebf>=_0x328ab5){_0x236ebf=_0x328ab5;_0x179d9b=0xc8;}else{_0x179d9b=0xce;}_0x55c87f[_0xbfbe('0x18')](_0x179d9b);return _0x55c87f[_0xbfbe('0x1f')](_0xbfbe('0x20'),_0x34fd6f+'-'+_0x236ebf+'/'+_0x328ab5)[_0xbfbe('0x1a')](_0x2fae93);}return null;};}function patchUpdates(_0x3ccbde){return function(_0x94969c){try{jsonpatch[_0xbfbe('0x21')](_0x94969c,_0x3ccbde,!![]);}catch(_0x223e89){return BPromise[_0xbfbe('0x22')](_0x223e89);}return _0x94969c[_0xbfbe('0x23')]();};}function saveUpdates(_0xccdfd6,_0xc3449a){return function(_0x214bae){if(_0x214bae){return _0x214bae['update'](_0xccdfd6)[_0xbfbe('0x24')](function(_0x3ec132){return _0x3ec132;});}return null;};}function removeEntity(_0x4c0e48,_0x46b54a){return function(_0x2ee4e1){if(_0x2ee4e1){return _0x2ee4e1[_0xbfbe('0x25')]()[_0xbfbe('0x24')](function(){_0x4c0e48[_0xbfbe('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7466,_0x58f5e4){return function(_0xeb99bb){if(!_0xeb99bb){_0x3f7466['sendStatus'](0x194);}return _0xeb99bb;};}function handleError(_0x3fcf4a,_0x1e2326){_0x1e2326=_0x1e2326||0x1f4;return function(_0x1606ba){logger[_0xbfbe('0x26')](_0x1606ba[_0xbfbe('0x27')]);if(_0x1606ba[_0xbfbe('0x28')]){delete _0x1606ba[_0xbfbe('0x28')];}_0x3fcf4a[_0xbfbe('0x18')](_0x1e2326)[_0xbfbe('0x29')](_0x1606ba);};}exports['index']=function(_0x1758bb,_0x6335a6){var _0x1a4b59={},_0x178727={},_0x39ee6a={'count':0x0,'rows':[]};var _0x25b4fc=_[_0xbfbe('0x2a')](db[_0xbfbe('0x2b')][_0xbfbe('0x2c')],function(_0x435299){return{'name':_0x435299['fieldName'],'type':_0x435299[_0xbfbe('0x2d')]['key']};});_0x178727[_0xbfbe('0x2e')]=_['map'](_0x25b4fc,_0xbfbe('0x28'));_0x178727[_0xbfbe('0x2f')]=_[_0xbfbe('0x30')](_0x1758bb['query']);_0x178727['filters']=_[_0xbfbe('0x31')](_0x178727['model'],_0x178727[_0xbfbe('0x2f')]);_0x1a4b59['attributes']=_[_0xbfbe('0x31')](_0x178727[_0xbfbe('0x2e')],qs['fields'](_0x1758bb[_0xbfbe('0x2f')][_0xbfbe('0x32')]));_0x1a4b59['attributes']=_0x1a4b59['attributes'][_0xbfbe('0x33')]?_0x1a4b59[_0xbfbe('0x34')]:_0x178727[_0xbfbe('0x2e')];if(!_0x1758bb[_0xbfbe('0x2f')][_0xbfbe('0x35')](_0xbfbe('0x36'))){_0x1a4b59[_0xbfbe('0x1e')]=qs['limit'](_0x1758bb['query'][_0xbfbe('0x1e')]);_0x1a4b59[_0xbfbe('0x1b')]=qs[_0xbfbe('0x1b')](_0x1758bb['query']['offset']);}_0x1a4b59[_0xbfbe('0x37')]=qs[_0xbfbe('0x38')](_0x1758bb[_0xbfbe('0x2f')]['sort']);_0x1a4b59[_0xbfbe('0x39')]=qs[_0xbfbe('0x3a')](_[_0xbfbe('0x3b')](_0x1758bb[_0xbfbe('0x2f')],_0x178727['filters']),_0x25b4fc);if(_0x1758bb['query'][_0xbfbe('0x3c')]){_0x1a4b59[_0xbfbe('0x39')]=_[_0xbfbe('0x3d')](_0x1a4b59[_0xbfbe('0x39')],{'$or':_['map'](_0x25b4fc,function(_0x258f6a){if(_0x258f6a['type']!==_0xbfbe('0x3e')){var _0x18f9ff={};_0x18f9ff[_0x258f6a['name']]={'$like':'%'+_0x1758bb['query'][_0xbfbe('0x3c')]+'%'};return _0x18f9ff;}})});}_0x1a4b59=_['merge']({},_0x1a4b59,_0x1758bb[_0xbfbe('0x3f')]);var _0x33a8a6={'where':_0x1a4b59['where']};return db[_0xbfbe('0x2b')]['count'](_0x33a8a6)[_0xbfbe('0x24')](function(_0x4ed2c3){_0x39ee6a[_0xbfbe('0x1d')]=_0x4ed2c3;if(_0x1758bb['query'][_0xbfbe('0x40')]){_0x1a4b59[_0xbfbe('0x41')]=[{'all':!![]}];}return db[_0xbfbe('0x2b')][_0xbfbe('0x42')](_0x1a4b59);})['then'](function(_0x36e03e){_0x39ee6a[_0xbfbe('0x43')]=_0x36e03e;return _0x39ee6a;})['then'](respondWithFilteredResult(_0x6335a6,_0x1a4b59))[_0xbfbe('0x44')](handleError(_0x6335a6,null));};exports[_0xbfbe('0x45')]=function(_0x41c5da,_0x5890d5){var _0x5190de={'raw':!![],'where':{'id':_0x41c5da[_0xbfbe('0x46')]['id']}},_0x2edeb8={};_0x2edeb8['model']=_['keys'](db['FreshsalesField'][_0xbfbe('0x2c')]);_0x2edeb8[_0xbfbe('0x2f')]=_[_0xbfbe('0x30')](_0x41c5da[_0xbfbe('0x2f')]);_0x2edeb8['filters']=_[_0xbfbe('0x31')](_0x2edeb8['model'],_0x2edeb8[_0xbfbe('0x2f')]);_0x5190de['attributes']=_[_0xbfbe('0x31')](_0x2edeb8[_0xbfbe('0x2e')],qs[_0xbfbe('0x32')](_0x41c5da['query'][_0xbfbe('0x32')]));_0x5190de[_0xbfbe('0x34')]=_0x5190de[_0xbfbe('0x34')][_0xbfbe('0x33')]?_0x5190de['attributes']:_0x2edeb8['model'];if(_0x41c5da['query'][_0xbfbe('0x40')]){_0x5190de[_0xbfbe('0x41')]=[{'all':!![]}];}_0x5190de=_[_0xbfbe('0x3d')]({},_0x5190de,_0x41c5da[_0xbfbe('0x3f')]);return db[_0xbfbe('0x2b')][_0xbfbe('0x47')](_0x5190de)[_0xbfbe('0x24')](handleEntityNotFound(_0x5890d5,null))[_0xbfbe('0x24')](respondWithResult(_0x5890d5,null))['catch'](handleError(_0x5890d5,null));};exports[_0xbfbe('0x48')]=function(_0x57eb4c,_0x16097f){return db[_0xbfbe('0x2b')][_0xbfbe('0x48')](_0x57eb4c['body'],{})['then'](respondWithResult(_0x16097f,0xc9))[_0xbfbe('0x44')](handleError(_0x16097f,null));};exports[_0xbfbe('0x49')]=function(_0x14b820,_0x1cbdfc){if(_0x14b820[_0xbfbe('0x4a')]['id']){delete _0x14b820[_0xbfbe('0x4a')]['id'];}return db['FreshsalesField'][_0xbfbe('0x47')]({'where':{'id':_0x14b820[_0xbfbe('0x46')]['id']}})['then'](handleEntityNotFound(_0x1cbdfc,null))[_0xbfbe('0x24')](saveUpdates(_0x14b820[_0xbfbe('0x4a')],null))[_0xbfbe('0x24')](respondWithResult(_0x1cbdfc,null))[_0xbfbe('0x44')](handleError(_0x1cbdfc,null));};exports[_0xbfbe('0x25')]=function(_0x5bb946,_0xd869cd){return db[_0xbfbe('0x2b')][_0xbfbe('0x47')]({'where':{'id':_0x5bb946[_0xbfbe('0x46')]['id']}})[_0xbfbe('0x24')](handleEntityNotFound(_0xd869cd,null))[_0xbfbe('0x24')](removeEntity(_0xd869cd,null))[_0xbfbe('0x44')](handleError(_0xd869cd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 37fe321..9ad5890 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 _0x9ccd=['../../config/logger','api','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ccd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd9cc('0x0'));var util=require('util');var logger=require(_0xd9cc('0x1'))(_0xd9cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd9cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd9cc('0x4'));var config=require(_0xd9cc('0x5'));var attributes=require(_0xd9cc('0x6'));module[_0xd9cc('0x7')]=function(_0x126f77,_0x113744){return _0x126f77[_0xd9cc('0x8')](_0xd9cc('0x9'),attributes,{'tableName':_0xd9cc('0xa'),'paranoid':![],'indexes':[{'name':_0xd9cc('0xb'),'fields':[_0xd9cc('0xc'),_0xd9cc('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd23d=['define','FreshsalesField','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./intFreshsalesField.attributes','exports'];(function(_0x4bafe6,_0x3cc7f1){var _0x35f3c3=function(_0x56e36e){while(--_0x56e36e){_0x4bafe6['push'](_0x4bafe6['shift']());}};_0x35f3c3(++_0x3cc7f1);}(_0xd23d,0xa0));var _0xdd23=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0xd23d[_0x33c9f8];return _0x2d7004;};'use strict';var _=require(_0xdd23('0x0'));var util=require(_0xdd23('0x1'));var logger=require(_0xdd23('0x2'))(_0xdd23('0x3'));var moment=require(_0xdd23('0x4'));var BPromise=require(_0xdd23('0x5'));var rp=require(_0xdd23('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdd23('0x7'));module[_0xdd23('0x8')]=function(_0x7232e8,_0xa5bdac){return _0x7232e8[_0xdd23('0x9')](_0xdd23('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xdd23('0xb'),_0xdd23('0xc')],'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 568afba..235d1da 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 _0xbd51=['FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x550430,_0x39ed19){_0x550430=_0x550430-0x0;var _0x412453=_0xbd51[_0x550430];return _0x412453;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x29abea,_0x30a385,_0x19077c){return new BPromise(function(_0x27d58f,_0xd8418f){return client['request'](_0x29abea,_0x19077c)[_0x1bd5('0x8')](function(_0x5c8e0d){logger[_0x1bd5('0x9')](_0x1bd5('0xa'),_0x30a385,_0x1bd5('0xb'));logger[_0x1bd5('0xc')](_0x1bd5('0xd'),_0x30a385,_0x1bd5('0xb'),JSON['stringify'](_0x5c8e0d));if(_0x5c8e0d[_0x1bd5('0xe')]){if(_0x5c8e0d['error'][_0x1bd5('0xf')]===0x1f4){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0xd8418f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);return _0x27d58f(_0x5c8e0d[_0x1bd5('0xe')][_0x1bd5('0x10')]);}else{logger['info']('FreshsalesField,\x20%s,\x20%s',_0x30a385,_0x1bd5('0xb'));_0x27d58f(_0x5c8e0d[_0x1bd5('0x11')][_0x1bd5('0x10')]);}})[_0x1bd5('0x12')](function(_0x43ea3e){logger[_0x1bd5('0xe')](_0x1bd5('0xa'),_0x30a385,_0x43ea3e);_0xd8418f(_0x43ea3e);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','FreshsalesField,\x20%s,\x20%s','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x3f0406,_0x3d338d){var _0x667f30=function(_0x5e5a7a){while(--_0x5e5a7a){_0x3f0406['push'](_0x3f0406['shift']());}};_0x667f30(++_0x3d338d);}(_0x4819,0xcd));var _0x9481=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0x4819[_0x4409e7];return _0x24c751;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 1ee00a8..517b160 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(_0x19cb3a,_0x2cd414){var _0xf5040d=function(_0x9d7002){while(--_0x9d7002){_0x19cb3a['push'](_0x19cb3a['shift']());}};_0xf5040d(++_0x2cd414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x22b513,_0xe1c1c5){var _0x7fd76c=function(_0x23a216){while(--_0x23a216){_0x22b513['push'](_0x22b513['shift']());}};_0x7fd76c(++_0xe1c1c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 ff02af9..a2c62b1 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 _0xe558=['sequelize','exports','STRING','username','ENUM','integrationTab','newTab'];(function(_0x2068bd,_0x585104){var _0x7596a7=function(_0x42fe03){while(--_0x42fe03){_0x2068bd['push'](_0x2068bd['shift']());}};_0x7596a7(++_0x585104);}(_0xe558,0x70));var _0x8e55=function(_0x3b4ec7,_0x5420b2){_0x3b4ec7=_0x3b4ec7-0x0;var _0x3906b2=_0xe558[_0x3b4ec7];return _0x3906b2;};'use strict';var Sequelize=require(_0x8e55('0x0'));module[_0x8e55('0x1')]={'name':{'type':Sequelize[_0x8e55('0x2')]},'description':{'type':Sequelize[_0x8e55('0x2')]},'username':{'type':Sequelize[_0x8e55('0x2')],'unique':_0x8e55('0x3')},'remoteUri':{'type':Sequelize[_0x8e55('0x2')]},'password':{'type':Sequelize[_0x8e55('0x2')]},'clientId':{'type':Sequelize[_0x8e55('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x8e55('0x2')]},'serverUrl':{'type':Sequelize[_0x8e55('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8e55('0x4')](_0x8e55('0x5'),_0x8e55('0x6')),'defaultValue':_0x8e55('0x5')}}; \ No newline at end of file +var _0xd1f1=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xd1f1,0xbc));var _0x1d1f=function(_0x213721,_0xc41653){_0x213721=_0x213721-0x0;var _0x6435ee=_0xd1f1[_0x213721];return _0x6435ee;};'use strict';var Sequelize=require(_0x1d1f('0x0'));module[_0x1d1f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1d1f('0x2')]},'username':{'type':Sequelize[_0x1d1f('0x2')],'unique':_0x1d1f('0x3')},'remoteUri':{'type':Sequelize[_0x1d1f('0x2')]},'password':{'type':Sequelize[_0x1d1f('0x2')]},'clientId':{'type':Sequelize[_0x1d1f('0x2')]},'clientSecret':{'type':Sequelize[_0x1d1f('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x1d1f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1d1f('0x4')](_0x1d1f('0x5'),_0x1d1f('0x6')),'defaultValue':_0x1d1f('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 67a4a26..39273ac 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 _0x5fbe=['zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','update','body','getConfigurations','params','length','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','substring','Connection','clientSecret','login','concat','isNil','ticketType','sobject','describe','OwnerId','IsReminderSet','IsRecurrence','Subject','Description','int','boolean','email','textarea','includes','label','custom','True','true','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send'];(function(_0x16e5bc,_0x4209bf){var _0x267b1b=function(_0x170b0f){while(--_0x170b0f){_0x16e5bc['push'](_0x16e5bc['shift']());}};_0x267b1b(++_0x4209bf);}(_0x5fbe,0x7b));var _0xe5fb=function(_0x280f6e,_0x533f19){_0x280f6e=_0x280f6e-0x0;var _0x510f3f=_0x5fbe[_0x280f6e];return _0x510f3f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe5fb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe5fb('0x1'));var moment=require(_0xe5fb('0x2'));var BPromise=require(_0xe5fb('0x3'));var Mustache=require(_0xe5fb('0x4'));var util=require(_0xe5fb('0x5'));var path=require(_0xe5fb('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe5fb('0x7'));var fs=require('fs');var fs_extra=require(_0xe5fb('0x8'));var _=require(_0xe5fb('0x9'));var squel=require(_0xe5fb('0xa'));var crypto=require(_0xe5fb('0xb'));var jsforce=require(_0xe5fb('0xc'));var deskjs=require(_0xe5fb('0xd'));var toCsv=require(_0xe5fb('0xe'));var querystring=require(_0xe5fb('0xf'));var Papa=require('papaparse');var Redis=require(_0xe5fb('0x10'));var authService=require(_0xe5fb('0x11'));var qs=require(_0xe5fb('0x12'));var as=require(_0xe5fb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5fb('0x14'))(_0xe5fb('0x15'));var utils=require(_0xe5fb('0x16'));var config=require(_0xe5fb('0x17'));var licenseUtil=require(_0xe5fb('0x18'));var db=require(_0xe5fb('0x19'))['db'];var integrations=require(_0xe5fb('0x1a'));function respondWithStatusCode(_0x3c12cb,_0x38770d){_0x38770d=_0x38770d||0xcc;return function(_0x27b5ba){if(_0x27b5ba){return _0x3c12cb[_0xe5fb('0x1b')](_0x38770d);}return _0x3c12cb[_0xe5fb('0x1c')](_0x38770d)[_0xe5fb('0x1d')]();};}function respondWithResult(_0x4d9f31,_0x2afda3){_0x2afda3=_0x2afda3||0xc8;return function(_0x10dd91){if(_0x10dd91){return _0x4d9f31[_0xe5fb('0x1c')](_0x2afda3)[_0xe5fb('0x1e')](_0x10dd91);}};}function respondWithFilteredResult(_0x3a38be,_0x277b82){return function(_0x7d01c0){if(_0x7d01c0){var _0x5f1750=typeof _0x277b82[_0xe5fb('0x1f')]===_0xe5fb('0x20')&&typeof _0x277b82[_0xe5fb('0x21')]==='undefined';var _0x2aa6f7=_0x7d01c0['count'];var _0x2eeaad=_0x5f1750?0x0:_0x277b82[_0xe5fb('0x1f')];var _0xb50ffb=_0x5f1750?_0x7d01c0[_0xe5fb('0x22')]:_0x277b82['offset']+_0x277b82[_0xe5fb('0x21')];var _0x3d9696;if(_0xb50ffb>=_0x2aa6f7){_0xb50ffb=_0x2aa6f7;_0x3d9696=0xc8;}else{_0x3d9696=0xce;}_0x3a38be[_0xe5fb('0x1c')](_0x3d9696);return _0x3a38be[_0xe5fb('0x23')](_0xe5fb('0x24'),_0x2eeaad+'-'+_0xb50ffb+'/'+_0x2aa6f7)[_0xe5fb('0x1e')](_0x7d01c0);}return null;};}function patchUpdates(_0xd9ed34){return function(_0xdfda0){try{jsonpatch[_0xe5fb('0x25')](_0xdfda0,_0xd9ed34,!![]);}catch(_0x155125){return BPromise['reject'](_0x155125);}return _0xdfda0[_0xe5fb('0x26')]();};}function saveUpdates(_0x167f5d,_0x19e574){return function(_0x39c001){if(_0x39c001){return _0x39c001['update'](_0x167f5d)[_0xe5fb('0x27')](function(_0xd57438){return _0xd57438;});}return null;};}function removeEntity(_0x1275de,_0x1e5420){return function(_0x3eee22){if(_0x3eee22){return _0x3eee22[_0xe5fb('0x28')]()[_0xe5fb('0x27')](function(){_0x1275de[_0xe5fb('0x1c')](0xcc)[_0xe5fb('0x1d')]();});}};}function handleEntityNotFound(_0x13432b,_0x134a28){return function(_0x41dea2){if(!_0x41dea2){_0x13432b[_0xe5fb('0x1b')](0x194);}return _0x41dea2;};}function handleError(_0x198019,_0xc16826){_0xc16826=_0xc16826||0x1f4;return function(_0x5d56ef){logger[_0xe5fb('0x29')](_0x5d56ef[_0xe5fb('0x2a')]);if(_0x5d56ef[_0xe5fb('0x2b')]){delete _0x5d56ef[_0xe5fb('0x2b')];}_0x198019[_0xe5fb('0x1c')](_0xc16826)['send'](_0x5d56ef);};}exports[_0xe5fb('0x2c')]=function(_0x5aa7a4,_0x422016){var _0xd97db6={},_0x1df56f={},_0x2ed88a={'count':0x0,'rows':[]};var _0x5562cd=_[_0xe5fb('0x2d')](db[_0xe5fb('0x2e')][_0xe5fb('0x2f')],function(_0x5e791c){return{'name':_0x5e791c[_0xe5fb('0x30')],'type':_0x5e791c[_0xe5fb('0x31')][_0xe5fb('0x32')]};});_0x1df56f[_0xe5fb('0x33')]=_[_0xe5fb('0x2d')](_0x5562cd,_0xe5fb('0x2b'));_0x1df56f[_0xe5fb('0x34')]=_['keys'](_0x5aa7a4[_0xe5fb('0x34')]);_0x1df56f[_0xe5fb('0x35')]=_['intersection'](_0x1df56f[_0xe5fb('0x33')],_0x1df56f['query']);_0xd97db6[_0xe5fb('0x36')]=_[_0xe5fb('0x37')](_0x1df56f[_0xe5fb('0x33')],qs[_0xe5fb('0x38')](_0x5aa7a4[_0xe5fb('0x34')]['fields']));_0xd97db6[_0xe5fb('0x36')]=_0xd97db6[_0xe5fb('0x36')]['length']?_0xd97db6[_0xe5fb('0x36')]:_0x1df56f[_0xe5fb('0x33')];if(!_0x5aa7a4[_0xe5fb('0x34')][_0xe5fb('0x39')](_0xe5fb('0x3a'))){_0xd97db6[_0xe5fb('0x21')]=qs['limit'](_0x5aa7a4[_0xe5fb('0x34')]['limit']);_0xd97db6['offset']=qs[_0xe5fb('0x1f')](_0x5aa7a4['query'][_0xe5fb('0x1f')]);}_0xd97db6[_0xe5fb('0x3b')]=qs[_0xe5fb('0x3c')](_0x5aa7a4['query'][_0xe5fb('0x3c')]);_0xd97db6[_0xe5fb('0x3d')]=qs[_0xe5fb('0x35')](_[_0xe5fb('0x3e')](_0x5aa7a4[_0xe5fb('0x34')],_0x1df56f[_0xe5fb('0x35')]),_0x5562cd);if(_0x5aa7a4[_0xe5fb('0x34')][_0xe5fb('0x3f')]){_0xd97db6['where']=_[_0xe5fb('0x40')](_0xd97db6[_0xe5fb('0x3d')],{'$or':_[_0xe5fb('0x2d')](_0x5562cd,function(_0x2e5901){if(_0x2e5901[_0xe5fb('0x31')]!==_0xe5fb('0x41')){var _0x9adfff={};_0x9adfff[_0x2e5901['name']]={'$like':'%'+_0x5aa7a4[_0xe5fb('0x34')][_0xe5fb('0x3f')]+'%'};return _0x9adfff;}})});}_0xd97db6=_['merge']({},_0xd97db6,_0x5aa7a4[_0xe5fb('0x42')]);var _0x14afb9={'where':_0xd97db6['where']};return db[_0xe5fb('0x2e')]['count'](_0x14afb9)['then'](function(_0x1b9adb){_0x2ed88a['count']=_0x1b9adb;if(_0x5aa7a4[_0xe5fb('0x34')][_0xe5fb('0x43')]){_0xd97db6[_0xe5fb('0x44')]=[{'all':!![]}];}return db[_0xe5fb('0x2e')][_0xe5fb('0x45')](_0xd97db6);})[_0xe5fb('0x27')](function(_0x1c95d1){_0x2ed88a[_0xe5fb('0x46')]=_0x1c95d1;return _0x2ed88a;})[_0xe5fb('0x27')](respondWithFilteredResult(_0x422016,_0xd97db6))[_0xe5fb('0x47')](handleError(_0x422016,null));};exports[_0xe5fb('0x48')]=function(_0x3bb1ac,_0x45a5de){var _0x2a8a6c={'raw':![],'where':{'id':_0x3bb1ac['params']['id']}},_0x1881fa={};_0x1881fa['model']=_['keys'](db[_0xe5fb('0x2e')]['rawAttributes']);_0x1881fa['query']=_[_0xe5fb('0x49')](_0x3bb1ac[_0xe5fb('0x34')]);_0x1881fa[_0xe5fb('0x35')]=_[_0xe5fb('0x37')](_0x1881fa[_0xe5fb('0x33')],_0x1881fa[_0xe5fb('0x34')]);_0x2a8a6c[_0xe5fb('0x36')]=_[_0xe5fb('0x37')](_0x1881fa[_0xe5fb('0x33')],qs[_0xe5fb('0x38')](_0x3bb1ac[_0xe5fb('0x34')][_0xe5fb('0x38')]));_0x2a8a6c[_0xe5fb('0x36')]=_0x2a8a6c['attributes']['length']?_0x2a8a6c['attributes']:_0x1881fa[_0xe5fb('0x33')];if(_0x3bb1ac[_0xe5fb('0x34')][_0xe5fb('0x43')]){_0x2a8a6c[_0xe5fb('0x44')]=[{'all':!![]}];}_0x2a8a6c=_['merge']({},_0x2a8a6c,_0x3bb1ac['options']);return db[_0xe5fb('0x2e')][_0xe5fb('0x4a')](_0x2a8a6c)[_0xe5fb('0x27')](handleEntityNotFound(_0x45a5de,null))['then'](respondWithResult(_0x45a5de,null))['catch'](handleError(_0x45a5de,null));};exports['create']=function(_0x53b301,_0x1e904a){return db[_0xe5fb('0x2e')]['create'](_0x53b301['body'],{})[_0xe5fb('0x27')](respondWithResult(_0x1e904a,0xc9))['catch'](handleError(_0x1e904a,null));};exports[_0xe5fb('0x4b')]=function(_0x371672,_0x28b4c8){if(_0x371672[_0xe5fb('0x4c')]['id']){delete _0x371672[_0xe5fb('0x4c')]['id'];}return db[_0xe5fb('0x2e')][_0xe5fb('0x4a')]({'where':{'id':_0x371672['params']['id']}})[_0xe5fb('0x27')](handleEntityNotFound(_0x28b4c8,null))[_0xe5fb('0x27')](saveUpdates(_0x371672['body'],null))['then'](respondWithResult(_0x28b4c8,null))[_0xe5fb('0x47')](handleError(_0x28b4c8,null));};exports['destroy']=function(_0xda5606,_0x20cf1e){return db[_0xe5fb('0x2e')]['find']({'where':{'id':_0xda5606['params']['id']}})['then'](handleEntityNotFound(_0x20cf1e,null))['then'](removeEntity(_0x20cf1e,null))['catch'](handleError(_0x20cf1e,null));};exports[_0xe5fb('0x4d')]=function(_0x570a5a,_0x4ae184,_0x973181){var _0x23f125={};var _0x4f4ecd={};var _0x16745e;var _0x5bd69a;return db['SalesforceAccount']['findOne']({'where':{'id':_0x570a5a[_0xe5fb('0x4e')]['id']}})[_0xe5fb('0x27')](handleEntityNotFound(_0x4ae184,null))['then'](function(_0x6346fa){if(_0x6346fa){_0x16745e=_0x6346fa;_0x4f4ecd[_0xe5fb('0x33')]=_[_0xe5fb('0x49')](db['SalesforceConfiguration'][_0xe5fb('0x2f')]);_0x4f4ecd['query']=_[_0xe5fb('0x49')](_0x570a5a[_0xe5fb('0x34')]);_0x4f4ecd[_0xe5fb('0x35')]=_[_0xe5fb('0x37')](_0x4f4ecd[_0xe5fb('0x33')],_0x4f4ecd['query']);_0x23f125['attributes']=_[_0xe5fb('0x37')](_0x4f4ecd['model'],qs['fields'](_0x570a5a['query'][_0xe5fb('0x38')]));_0x23f125[_0xe5fb('0x36')]=_0x23f125[_0xe5fb('0x36')][_0xe5fb('0x4f')]?_0x23f125[_0xe5fb('0x36')]:_0x4f4ecd[_0xe5fb('0x33')];_0x23f125['order']=qs['sort'](_0x570a5a[_0xe5fb('0x34')]['sort']);_0x23f125[_0xe5fb('0x3d')]=qs[_0xe5fb('0x35')](_['pick'](_0x570a5a[_0xe5fb('0x34')],_0x4f4ecd['filters']));if(_0x570a5a[_0xe5fb('0x34')][_0xe5fb('0x3f')]){_0x23f125[_0xe5fb('0x3d')]=_[_0xe5fb('0x40')](_0x23f125['where'],{'$or':_['map'](_0x23f125['attributes'],function(_0x15c8c5){var _0x23649c={};_0x23649c[_0x15c8c5]={'$like':'%'+_0x570a5a[_0xe5fb('0x34')]['filter']+'%'};return _0x23649c;})});}_0x23f125=_['merge']({},_0x23f125,_0x570a5a[_0xe5fb('0x42')]);return _0x16745e[_0xe5fb('0x4d')](_0x23f125);}})[_0xe5fb('0x27')](function(_0x2cd1ab){if(_0x2cd1ab){_0x5bd69a=_0x2cd1ab[_0xe5fb('0x4f')];if(!_0x570a5a['query']['hasOwnProperty'](_0xe5fb('0x3a'))){_0x23f125['limit']=qs['limit'](_0x570a5a['query'][_0xe5fb('0x21')]);_0x23f125[_0xe5fb('0x1f')]=qs[_0xe5fb('0x1f')](_0x570a5a[_0xe5fb('0x34')][_0xe5fb('0x1f')]);}return _0x16745e[_0xe5fb('0x4d')](_0x23f125);}})[_0xe5fb('0x27')](function(_0x5bfd9d){if(_0x5bfd9d){return _0x5bfd9d?{'count':_0x5bd69a,'rows':_0x5bfd9d}:null;}})[_0xe5fb('0x27')](respondWithResult(_0x4ae184,null))[_0xe5fb('0x47')](handleError(_0x4ae184,null));};exports['addConfiguration']=function(_0x1595a1,_0x28307c,_0x27527e){if(_0x1595a1['body']['id']){delete _0x1595a1['body']['id'];}return db[_0xe5fb('0x2e')][_0xe5fb('0x50')]({'where':{'id':_0x1595a1[_0xe5fb('0x4e')]['id']}})[_0xe5fb('0x27')](handleEntityNotFound(_0x28307c,null))[_0xe5fb('0x27')](function(_0x1f8baa){if(_0x1f8baa){_0x1595a1['body'][_0xe5fb('0x51')]=_0x1f8baa['id'];_0x1595a1[_0xe5fb('0x4c')][_0xe5fb('0x52')]=integrations[_0xe5fb('0x53')](_0x1595a1[_0xe5fb('0x4c')][_0xe5fb('0x54')],_0x1595a1[_0xe5fb('0x4c')][_0xe5fb('0x31')]);_0x1595a1[_0xe5fb('0x4c')][_0xe5fb('0x55')]=integrations[_0xe5fb('0x56')](_0x1595a1['body']['channel'],_0x1595a1['body'][_0xe5fb('0x31')]);return db['SalesforceConfiguration']['create'](_0x1595a1['body'],{'include':[{'model':db[_0xe5fb('0x57')],'as':'Subjects'},{'model':db[_0xe5fb('0x57')],'as':_0xe5fb('0x55')}]});}return null;})['then'](respondWithResult(_0x28307c,null))[_0xe5fb('0x47')](handleError(_0x28307c,null));};exports[_0xe5fb('0x58')]=function(_0x1c8977,_0x29c281,_0x10477a){var _0x190226;var _0x172855='';var _0x38cd17=_0xe5fb('0x59');return db[_0xe5fb('0x2e')][_0xe5fb('0x50')]({'where':{'id':_0x1c8977[_0xe5fb('0x4e')]['id']},'attributes':['id',_0xe5fb('0x5a'),_0xe5fb('0x5b'),'clientSecret',_0xe5fb('0x5c'),_0xe5fb('0x5d'),_0xe5fb('0x5e')]})[_0xe5fb('0x27')](handleEntityNotFound(_0x29c281,null))['then'](function(_0x1ae26e){if(_0x1ae26e){_0x172855=_0x1ae26e['remoteUri'];var _0x7712bc=_0x172855[_0xe5fb('0x5f')](-0x1);if(_0x7712bc==='/'){_0x172855=_0x172855[_0xe5fb('0x60')](0x0,_0x172855['lastIndexOf'](_0x7712bc));}_0x190226=new jsforce[(_0xe5fb('0x61'))]({'oauth2':{'loginUrl':_0x172855,'clientId':_0x1ae26e[_0xe5fb('0x5b')],'clientSecret':_0x1ae26e[_0xe5fb('0x62')]}});return _0x190226[_0xe5fb('0x63')](_0x1ae26e[_0xe5fb('0x5c')],_0x1ae26e[_0xe5fb('0x5d')][_0xe5fb('0x64')](_0x1ae26e[_0xe5fb('0x5e')]));}})[_0xe5fb('0x27')](function(_0x46a36a){if(_0x46a36a){if(!_[_0xe5fb('0x65')](_0x1c8977['query']['ticketType'])){_0x38cd17=_0x1c8977[_0xe5fb('0x34')][_0xe5fb('0x66')];}return _0x190226[_0xe5fb('0x67')](_0x38cd17)[_0xe5fb('0x68')]();}})[_0xe5fb('0x27')](function(_0x336a10){var _0x1a82ff=[_0xe5fb('0x69'),'ActivityDate',_0xe5fb('0x6a'),_0xe5fb('0x6b'),_0xe5fb('0x6c'),_0xe5fb('0x6d')];var _0x4e873b=['string',_0xe5fb('0x6e'),'picklist',_0xe5fb('0x6f'),_0xe5fb('0x70'),_0xe5fb('0x71'),'phone'];if(_0x336a10){_['remove'](_0x336a10[_0xe5fb('0x38')],function(_0x3d94c9){return _0x1a82ff[_0xe5fb('0x72')](_0x3d94c9[_0xe5fb('0x2b')])||!_0x4e873b[_0xe5fb('0x72')](_0x3d94c9[_0xe5fb('0x31')]);});return{'count':_0x336a10[_0xe5fb('0x38')][_0xe5fb('0x4f')],'rows':_[_0xe5fb('0x2d')](_0x336a10[_0xe5fb('0x38')],function(_0x20076d){return{'id':_0x20076d[_0xe5fb('0x2b')],'name':_0x20076d[_0xe5fb('0x73')],'custom':_0x20076d[_0xe5fb('0x74')],'options':_0x20076d['picklistValues'][_0xe5fb('0x4f')]>0x0?_['map'](_0x20076d['picklistValues'],function(_0x511419){return{'name':_0x511419[_0xe5fb('0x73')],'value':_0x511419['value']};}):_0x20076d[_0xe5fb('0x31')]==_0xe5fb('0x6f')?[{'name':_0xe5fb('0x75'),'value':_0xe5fb('0x76')},{'name':'False','value':'false'}]:[]};})};}})[_0xe5fb('0x27')](respondWithResult(_0x29c281,null))['catch'](function(_0x401fd5){var _0x505540=_0x1c8977[_0xe5fb('0x34')][_0xe5fb('0x77')]?0x1f4:_0x401fd5[_0xe5fb('0x78')]||0x1f4;logger['error'](_0xe5fb('0x79'),_0xe5fb('0x58'),_0x505540,JSON['stringify'](_0x401fd5));delete _0x401fd5['name'];if(_0x505540===0x191){_0x505540=0x190;}_0x29c281[_0xe5fb('0x1c')](_0x505540)[_0xe5fb('0x7a')](_0x1c8977['query'][_0xe5fb('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x401fd5[_0xe5fb('0x78')]}:_0x401fd5);});}; \ No newline at end of file +var _0xb007=['filters','attributes','length','hasOwnProperty','order','sort','filter','where','merge','options','SalesforceAccount','findAll','rows','catch','show','rawAttributes','intersection','fields','include','find','create','body','params','getConfigurations','SalesforceConfiguration','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','login','concat','securityToken','isNil','ticketType','describe','OwnerId','IsRecurrence','Subject','picklist','boolean','email','textarea','phone','includes','label','picklistValues','value','True','true','false','test','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys'];(function(_0x27e029,_0x17e305){var _0x29bf95=function(_0x4755a4){while(--_0x4755a4){_0x27e029['push'](_0x27e029['shift']());}};_0x29bf95(++_0x17e305);}(_0xb007,0x1bb));var _0x7b00=function(_0x5a5a52,_0xd7100b){_0x5a5a52=_0x5a5a52-0x0;var _0xf0b991=_0xb007[_0x5a5a52];return _0xf0b991;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7b00('0x0'));var zipdir=require(_0x7b00('0x1'));var jsonpatch=require(_0x7b00('0x2'));var rp=require('request-promise');var moment=require(_0x7b00('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b00('0x4'));var util=require(_0x7b00('0x5'));var path=require(_0x7b00('0x6'));var sox=require('sox');var csv=require(_0x7b00('0x7'));var ejs=require(_0x7b00('0x8'));var fs=require('fs');var fs_extra=require(_0x7b00('0x9'));var _=require(_0x7b00('0xa'));var squel=require(_0x7b00('0xb'));var crypto=require('crypto');var jsforce=require(_0x7b00('0xc'));var deskjs=require(_0x7b00('0xd'));var toCsv=require(_0x7b00('0x7'));var querystring=require(_0x7b00('0xe'));var Papa=require(_0x7b00('0xf'));var Redis=require(_0x7b00('0x10'));var authService=require(_0x7b00('0x11'));var qs=require(_0x7b00('0x12'));var as=require(_0x7b00('0x13'));var hardwareService=require(_0x7b00('0x14'));var logger=require('../../config/logger')(_0x7b00('0x15'));var utils=require(_0x7b00('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7b00('0x17'));var db=require(_0x7b00('0x18'))['db'];var integrations=require(_0x7b00('0x19'));function respondWithStatusCode(_0x389ef2,_0xae82e9){_0xae82e9=_0xae82e9||0xcc;return function(_0xf41a5e){if(_0xf41a5e){return _0x389ef2[_0x7b00('0x1a')](_0xae82e9);}return _0x389ef2[_0x7b00('0x1b')](_0xae82e9)[_0x7b00('0x1c')]();};}function respondWithResult(_0x1908d8,_0x202737){_0x202737=_0x202737||0xc8;return function(_0x35de96){if(_0x35de96){return _0x1908d8[_0x7b00('0x1b')](_0x202737)[_0x7b00('0x1d')](_0x35de96);}};}function respondWithFilteredResult(_0x1af45a,_0x31e190){return function(_0x3cab07){if(_0x3cab07){var _0x4e3689=typeof _0x31e190[_0x7b00('0x1e')]==='undefined'&&typeof _0x31e190[_0x7b00('0x1f')]===_0x7b00('0x20');var _0x4b1a83=_0x3cab07[_0x7b00('0x21')];var _0x3ee76c=_0x4e3689?0x0:_0x31e190[_0x7b00('0x1e')];var _0x49b505=_0x4e3689?_0x3cab07[_0x7b00('0x21')]:_0x31e190[_0x7b00('0x1e')]+_0x31e190['limit'];var _0x7375ee;if(_0x49b505>=_0x4b1a83){_0x49b505=_0x4b1a83;_0x7375ee=0xc8;}else{_0x7375ee=0xce;}_0x1af45a[_0x7b00('0x1b')](_0x7375ee);return _0x1af45a['set'](_0x7b00('0x22'),_0x3ee76c+'-'+_0x49b505+'/'+_0x4b1a83)[_0x7b00('0x1d')](_0x3cab07);}return null;};}function patchUpdates(_0x21f778){return function(_0x246cc3){try{jsonpatch[_0x7b00('0x23')](_0x246cc3,_0x21f778,!![]);}catch(_0xfc6cbd){return BPromise[_0x7b00('0x24')](_0xfc6cbd);}return _0x246cc3[_0x7b00('0x25')]();};}function saveUpdates(_0x4959ce,_0x13ff32){return function(_0x376c4d){if(_0x376c4d){return _0x376c4d[_0x7b00('0x26')](_0x4959ce)[_0x7b00('0x27')](function(_0x2d423e){return _0x2d423e;});}return null;};}function removeEntity(_0x234860,_0x4a2f85){return function(_0x36cbdb){if(_0x36cbdb){return _0x36cbdb[_0x7b00('0x28')]()[_0x7b00('0x27')](function(){_0x234860[_0x7b00('0x1b')](0xcc)[_0x7b00('0x1c')]();});}};}function handleEntityNotFound(_0x23de2b,_0x5a5161){return function(_0x129128){if(!_0x129128){_0x23de2b[_0x7b00('0x1a')](0x194);}return _0x129128;};}function handleError(_0x4bb079,_0x48c03a){_0x48c03a=_0x48c03a||0x1f4;return function(_0x5c2579){logger[_0x7b00('0x29')](_0x5c2579[_0x7b00('0x2a')]);if(_0x5c2579[_0x7b00('0x2b')]){delete _0x5c2579['name'];}_0x4bb079['status'](_0x48c03a)[_0x7b00('0x2c')](_0x5c2579);};}exports[_0x7b00('0x2d')]=function(_0x5dacff,_0x21f45b){var _0x3af700={},_0x184d35={},_0x4234d2={'count':0x0,'rows':[]};var _0x4c11ab=_[_0x7b00('0x2e')](db['SalesforceAccount']['rawAttributes'],function(_0x3d954d){return{'name':_0x3d954d[_0x7b00('0x2f')],'type':_0x3d954d[_0x7b00('0x30')][_0x7b00('0x31')]};});_0x184d35[_0x7b00('0x32')]=_[_0x7b00('0x2e')](_0x4c11ab,_0x7b00('0x2b'));_0x184d35[_0x7b00('0x33')]=_[_0x7b00('0x34')](_0x5dacff['query']);_0x184d35[_0x7b00('0x35')]=_['intersection'](_0x184d35[_0x7b00('0x32')],_0x184d35['query']);_0x3af700[_0x7b00('0x36')]=_['intersection'](_0x184d35['model'],qs['fields'](_0x5dacff[_0x7b00('0x33')]['fields']));_0x3af700[_0x7b00('0x36')]=_0x3af700[_0x7b00('0x36')][_0x7b00('0x37')]?_0x3af700[_0x7b00('0x36')]:_0x184d35['model'];if(!_0x5dacff[_0x7b00('0x33')][_0x7b00('0x38')]('nolimit')){_0x3af700[_0x7b00('0x1f')]=qs[_0x7b00('0x1f')](_0x5dacff[_0x7b00('0x33')][_0x7b00('0x1f')]);_0x3af700['offset']=qs['offset'](_0x5dacff[_0x7b00('0x33')][_0x7b00('0x1e')]);}_0x3af700[_0x7b00('0x39')]=qs[_0x7b00('0x3a')](_0x5dacff['query'][_0x7b00('0x3a')]);_0x3af700['where']=qs[_0x7b00('0x35')](_['pick'](_0x5dacff[_0x7b00('0x33')],_0x184d35['filters']),_0x4c11ab);if(_0x5dacff['query'][_0x7b00('0x3b')]){_0x3af700[_0x7b00('0x3c')]=_[_0x7b00('0x3d')](_0x3af700[_0x7b00('0x3c')],{'$or':_[_0x7b00('0x2e')](_0x4c11ab,function(_0x5abf43){if(_0x5abf43[_0x7b00('0x30')]!=='VIRTUAL'){var _0x4d3f67={};_0x4d3f67[_0x5abf43[_0x7b00('0x2b')]]={'$like':'%'+_0x5dacff['query'][_0x7b00('0x3b')]+'%'};return _0x4d3f67;}})});}_0x3af700=_['merge']({},_0x3af700,_0x5dacff[_0x7b00('0x3e')]);var _0x3d9ec8={'where':_0x3af700[_0x7b00('0x3c')]};return db[_0x7b00('0x3f')][_0x7b00('0x21')](_0x3d9ec8)['then'](function(_0x187857){_0x4234d2[_0x7b00('0x21')]=_0x187857;if(_0x5dacff['query']['includeAll']){_0x3af700['include']=[{'all':!![]}];}return db['SalesforceAccount'][_0x7b00('0x40')](_0x3af700);})['then'](function(_0x27aec8){_0x4234d2[_0x7b00('0x41')]=_0x27aec8;return _0x4234d2;})[_0x7b00('0x27')](respondWithFilteredResult(_0x21f45b,_0x3af700))[_0x7b00('0x42')](handleError(_0x21f45b,null));};exports[_0x7b00('0x43')]=function(_0x2a9bf5,_0x849b4f){var _0x3626a8={'raw':![],'where':{'id':_0x2a9bf5['params']['id']}},_0x2b9fdc={};_0x2b9fdc[_0x7b00('0x32')]=_['keys'](db['SalesforceAccount'][_0x7b00('0x44')]);_0x2b9fdc[_0x7b00('0x33')]=_[_0x7b00('0x34')](_0x2a9bf5[_0x7b00('0x33')]);_0x2b9fdc[_0x7b00('0x35')]=_['intersection'](_0x2b9fdc['model'],_0x2b9fdc[_0x7b00('0x33')]);_0x3626a8['attributes']=_[_0x7b00('0x45')](_0x2b9fdc[_0x7b00('0x32')],qs[_0x7b00('0x46')](_0x2a9bf5[_0x7b00('0x33')][_0x7b00('0x46')]));_0x3626a8[_0x7b00('0x36')]=_0x3626a8[_0x7b00('0x36')][_0x7b00('0x37')]?_0x3626a8['attributes']:_0x2b9fdc[_0x7b00('0x32')];if(_0x2a9bf5[_0x7b00('0x33')]['includeAll']){_0x3626a8[_0x7b00('0x47')]=[{'all':!![]}];}_0x3626a8=_[_0x7b00('0x3d')]({},_0x3626a8,_0x2a9bf5[_0x7b00('0x3e')]);return db[_0x7b00('0x3f')][_0x7b00('0x48')](_0x3626a8)[_0x7b00('0x27')](handleEntityNotFound(_0x849b4f,null))[_0x7b00('0x27')](respondWithResult(_0x849b4f,null))[_0x7b00('0x42')](handleError(_0x849b4f,null));};exports[_0x7b00('0x49')]=function(_0x11b181,_0x3c41d8){return db[_0x7b00('0x3f')][_0x7b00('0x49')](_0x11b181[_0x7b00('0x4a')],{})[_0x7b00('0x27')](respondWithResult(_0x3c41d8,0xc9))[_0x7b00('0x42')](handleError(_0x3c41d8,null));};exports[_0x7b00('0x26')]=function(_0x329c34,_0x49a3c3){if(_0x329c34[_0x7b00('0x4a')]['id']){delete _0x329c34['body']['id'];}return db[_0x7b00('0x3f')][_0x7b00('0x48')]({'where':{'id':_0x329c34[_0x7b00('0x4b')]['id']}})['then'](handleEntityNotFound(_0x49a3c3,null))[_0x7b00('0x27')](saveUpdates(_0x329c34[_0x7b00('0x4a')],null))[_0x7b00('0x27')](respondWithResult(_0x49a3c3,null))[_0x7b00('0x42')](handleError(_0x49a3c3,null));};exports[_0x7b00('0x28')]=function(_0x494adf,_0x42fea7){return db[_0x7b00('0x3f')][_0x7b00('0x48')]({'where':{'id':_0x494adf[_0x7b00('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42fea7,null))[_0x7b00('0x27')](removeEntity(_0x42fea7,null))[_0x7b00('0x42')](handleError(_0x42fea7,null));};exports[_0x7b00('0x4c')]=function(_0x588ca5,_0x10eefe,_0x5bff54){var _0x5b5adf={};var _0x2cdbd2={};var _0x5281c2;var _0x16a5ca;return db['SalesforceAccount']['findOne']({'where':{'id':_0x588ca5['params']['id']}})[_0x7b00('0x27')](handleEntityNotFound(_0x10eefe,null))['then'](function(_0x1ded0f){if(_0x1ded0f){_0x5281c2=_0x1ded0f;_0x2cdbd2['model']=_[_0x7b00('0x34')](db[_0x7b00('0x4d')]['rawAttributes']);_0x2cdbd2[_0x7b00('0x33')]=_[_0x7b00('0x34')](_0x588ca5[_0x7b00('0x33')]);_0x2cdbd2['filters']=_[_0x7b00('0x45')](_0x2cdbd2[_0x7b00('0x32')],_0x2cdbd2[_0x7b00('0x33')]);_0x5b5adf[_0x7b00('0x36')]=_[_0x7b00('0x45')](_0x2cdbd2[_0x7b00('0x32')],qs[_0x7b00('0x46')](_0x588ca5[_0x7b00('0x33')]['fields']));_0x5b5adf['attributes']=_0x5b5adf[_0x7b00('0x36')][_0x7b00('0x37')]?_0x5b5adf['attributes']:_0x2cdbd2['model'];_0x5b5adf[_0x7b00('0x39')]=qs[_0x7b00('0x3a')](_0x588ca5[_0x7b00('0x33')][_0x7b00('0x3a')]);_0x5b5adf[_0x7b00('0x3c')]=qs[_0x7b00('0x35')](_[_0x7b00('0x4e')](_0x588ca5[_0x7b00('0x33')],_0x2cdbd2[_0x7b00('0x35')]));if(_0x588ca5[_0x7b00('0x33')][_0x7b00('0x3b')]){_0x5b5adf[_0x7b00('0x3c')]=_['merge'](_0x5b5adf['where'],{'$or':_[_0x7b00('0x2e')](_0x5b5adf[_0x7b00('0x36')],function(_0x3d9c92){var _0x27c89e={};_0x27c89e[_0x3d9c92]={'$like':'%'+_0x588ca5['query'][_0x7b00('0x3b')]+'%'};return _0x27c89e;})});}_0x5b5adf=_[_0x7b00('0x3d')]({},_0x5b5adf,_0x588ca5[_0x7b00('0x3e')]);return _0x5281c2[_0x7b00('0x4c')](_0x5b5adf);}})[_0x7b00('0x27')](function(_0x203d18){if(_0x203d18){_0x16a5ca=_0x203d18[_0x7b00('0x37')];if(!_0x588ca5['query'][_0x7b00('0x38')](_0x7b00('0x4f'))){_0x5b5adf[_0x7b00('0x1f')]=qs[_0x7b00('0x1f')](_0x588ca5[_0x7b00('0x33')]['limit']);_0x5b5adf[_0x7b00('0x1e')]=qs[_0x7b00('0x1e')](_0x588ca5[_0x7b00('0x33')][_0x7b00('0x1e')]);}return _0x5281c2['getConfigurations'](_0x5b5adf);}})[_0x7b00('0x27')](function(_0x1bc7dd){if(_0x1bc7dd){return _0x1bc7dd?{'count':_0x16a5ca,'rows':_0x1bc7dd}:null;}})['then'](respondWithResult(_0x10eefe,null))['catch'](handleError(_0x10eefe,null));};exports[_0x7b00('0x50')]=function(_0xdb63a9,_0x1f9a05,_0x33665a){if(_0xdb63a9[_0x7b00('0x4a')]['id']){delete _0xdb63a9[_0x7b00('0x4a')]['id'];}return db[_0x7b00('0x3f')]['findOne']({'where':{'id':_0xdb63a9['params']['id']}})[_0x7b00('0x27')](handleEntityNotFound(_0x1f9a05,null))[_0x7b00('0x27')](function(_0x4cb0e3){if(_0x4cb0e3){_0xdb63a9['body'][_0x7b00('0x51')]=_0x4cb0e3['id'];_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x52')]=integrations[_0x7b00('0x53')](_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x54')],_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x30')]);_0xdb63a9[_0x7b00('0x4a')][_0x7b00('0x55')]=integrations[_0x7b00('0x56')](_0xdb63a9[_0x7b00('0x4a')]['channel'],_0xdb63a9[_0x7b00('0x4a')]['type']);return db[_0x7b00('0x4d')]['create'](_0xdb63a9[_0x7b00('0x4a')],{'include':[{'model':db[_0x7b00('0x57')],'as':_0x7b00('0x52')},{'model':db[_0x7b00('0x57')],'as':'Descriptions'}]});}return null;})[_0x7b00('0x27')](respondWithResult(_0x1f9a05,null))[_0x7b00('0x42')](handleError(_0x1f9a05,null));};exports[_0x7b00('0x58')]=function(_0x23bf87,_0x4e663b,_0x10e6f0){var _0x70ef93;var _0x566c8a='';var _0x49edfc=_0x7b00('0x59');return db[_0x7b00('0x3f')]['findOne']({'where':{'id':_0x23bf87[_0x7b00('0x4b')]['id']},'attributes':['id',_0x7b00('0x5a'),_0x7b00('0x5b'),_0x7b00('0x5c'),_0x7b00('0x5d'),_0x7b00('0x5e'),'securityToken']})[_0x7b00('0x27')](handleEntityNotFound(_0x4e663b,null))[_0x7b00('0x27')](function(_0x598f3b){if(_0x598f3b){_0x566c8a=_0x598f3b[_0x7b00('0x5a')];var _0x114ad8=_0x566c8a[_0x7b00('0x5f')](-0x1);if(_0x114ad8==='/'){_0x566c8a=_0x566c8a[_0x7b00('0x60')](0x0,_0x566c8a[_0x7b00('0x61')](_0x114ad8));}_0x70ef93=new jsforce[(_0x7b00('0x62'))]({'oauth2':{'loginUrl':_0x566c8a,'clientId':_0x598f3b[_0x7b00('0x5b')],'clientSecret':_0x598f3b['clientSecret']}});return _0x70ef93[_0x7b00('0x63')](_0x598f3b[_0x7b00('0x5d')],_0x598f3b[_0x7b00('0x5e')][_0x7b00('0x64')](_0x598f3b[_0x7b00('0x65')]));}})[_0x7b00('0x27')](function(_0x19c67f){if(_0x19c67f){if(!_[_0x7b00('0x66')](_0x23bf87[_0x7b00('0x33')][_0x7b00('0x67')])){_0x49edfc=_0x23bf87[_0x7b00('0x33')][_0x7b00('0x67')];}return _0x70ef93['sobject'](_0x49edfc)[_0x7b00('0x68')]();}})[_0x7b00('0x27')](function(_0x2ae9c2){var _0x218520=[_0x7b00('0x69'),'ActivityDate','IsReminderSet',_0x7b00('0x6a'),_0x7b00('0x6b'),'Description'];var _0x28e0e7=['string','int',_0x7b00('0x6c'),_0x7b00('0x6d'),_0x7b00('0x6e'),_0x7b00('0x6f'),_0x7b00('0x70')];if(_0x2ae9c2){_['remove'](_0x2ae9c2[_0x7b00('0x46')],function(_0x44c9ee){return _0x218520[_0x7b00('0x71')](_0x44c9ee[_0x7b00('0x2b')])||!_0x28e0e7[_0x7b00('0x71')](_0x44c9ee[_0x7b00('0x30')]);});return{'count':_0x2ae9c2[_0x7b00('0x46')][_0x7b00('0x37')],'rows':_[_0x7b00('0x2e')](_0x2ae9c2[_0x7b00('0x46')],function(_0x5050b9){return{'id':_0x5050b9['name'],'name':_0x5050b9[_0x7b00('0x72')],'custom':_0x5050b9['custom'],'options':_0x5050b9[_0x7b00('0x73')][_0x7b00('0x37')]>0x0?_[_0x7b00('0x2e')](_0x5050b9[_0x7b00('0x73')],function(_0x3d8b94){return{'name':_0x3d8b94[_0x7b00('0x72')],'value':_0x3d8b94[_0x7b00('0x74')]};}):_0x5050b9['type']==_0x7b00('0x6d')?[{'name':_0x7b00('0x75'),'value':_0x7b00('0x76')},{'name':'False','value':_0x7b00('0x77')}]:[]};})};}})[_0x7b00('0x27')](respondWithResult(_0x4e663b,null))[_0x7b00('0x42')](function(_0x2a61f9){var _0x4d077b=_0x23bf87['query'][_0x7b00('0x78')]?0x1f4:_0x2a61f9[_0x7b00('0x79')]||0x1f4;logger[_0x7b00('0x29')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4d077b,JSON[_0x7b00('0x7a')](_0x2a61f9));delete _0x2a61f9[_0x7b00('0x2b')];if(_0x4d077b===0x191){_0x4d077b=0x190;}_0x4e663b['status'](_0x4d077b)['send'](_0x23bf87['query'][_0x7b00('0x78')]?{'message':_0x7b00('0x7b'),'statusCode':_0x2a61f9['statusCode']}:_0x2a61f9);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 98ebbe3..18ec690 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 _0x83a8=['api','moment','bluebird','path','rimraf','../../config/environment','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger'];(function(_0x1ade4b,_0x55d6d6){var _0x10dc01=function(_0x45c737){while(--_0x45c737){_0x1ade4b['push'](_0x1ade4b['shift']());}};_0x10dc01(++_0x55d6d6);}(_0x83a8,0xf9));var _0x883a=function(_0x4dd427,_0x30bd28){_0x4dd427=_0x4dd427-0x0;var _0x3262a0=_0x83a8[_0x4dd427];return _0x3262a0;};'use strict';var _=require(_0x883a('0x0'));var util=require(_0x883a('0x1'));var logger=require(_0x883a('0x2'))(_0x883a('0x3'));var moment=require(_0x883a('0x4'));var BPromise=require(_0x883a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x883a('0x6'));var rimraf=require(_0x883a('0x7'));var config=require(_0x883a('0x8'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3eba51,_0x66cfd9){return _0x3eba51[_0x883a('0x9')](_0x883a('0xa'),attributes,{'tableName':_0x883a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x930e=['./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x223033,_0x51b86b){var _0x116577=function(_0x57bd62){while(--_0x57bd62){_0x223033['push'](_0x223033['shift']());}};_0x116577(++_0x51b86b);}(_0x930e,0x185));var _0xe930=function(_0x56d81f,_0x519a2e){_0x56d81f=_0x56d81f-0x0;var _0xf8a9dc=_0x930e[_0x56d81f];return _0xf8a9dc;};'use strict';var _=require(_0xe930('0x0'));var util=require('util');var logger=require(_0xe930('0x1'))('api');var moment=require(_0xe930('0x2'));var BPromise=require(_0xe930('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe930('0x4'));var rimraf=require(_0xe930('0x5'));var config=require(_0xe930('0x6'));var attributes=require(_0xe930('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xe930('0x8')]=function(_0xd4d873,_0x416c63){return _0xd4d873[_0xe930('0x9')](_0xe930('0xa'),attributes,{'tableName':_0xe930('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 67c2303..905c876 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 _0xb35b=['SalesforceAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSalesforceAccount'];(function(_0x20a1a5,_0x4fa090){var _0x25b9c2=function(_0x3d2d33){while(--_0x3d2d33){_0x20a1a5['push'](_0x20a1a5['shift']());}};_0x25b9c2(++_0x4fa090);}(_0xb35b,0xb6));var _0xbb35=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xb35b[_0x550d12];return _0x12103d;};'use strict';var _=require(_0xbb35('0x0'));var util=require(_0xbb35('0x1'));var moment=require('moment');var BPromise=require(_0xbb35('0x2'));var rs=require(_0xbb35('0x3'));var fs=require('fs');var Redis=require(_0xbb35('0x4'));var db=require(_0xbb35('0x5'))['db'];var utils=require(_0xbb35('0x6'));var logger=require(_0xbb35('0x7'))('rpc');var config=require(_0xbb35('0x8'));var jayson=require(_0xbb35('0x9'));var client=jayson[_0xbb35('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a8694,_0x2e38e6,_0x2dd0c4){return new BPromise(function(_0x32a797,_0x3626e6){return client[_0xbb35('0xb')](_0x1a8694,_0x2dd0c4)[_0xbb35('0xc')](function(_0x138c7c){logger[_0xbb35('0xd')](_0xbb35('0xe'),_0x2e38e6,_0xbb35('0xf'));logger[_0xbb35('0x10')](_0xbb35('0x11'),_0x2e38e6,_0xbb35('0xf'),JSON[_0xbb35('0x12')](_0x138c7c));if(_0x138c7c[_0xbb35('0x13')]){if(_0x138c7c[_0xbb35('0x13')][_0xbb35('0x14')]===0x1f4){logger[_0xbb35('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x2e38e6,_0x138c7c[_0xbb35('0x13')][_0xbb35('0x15')]);return _0x3626e6(_0x138c7c[_0xbb35('0x13')][_0xbb35('0x15')]);}logger[_0xbb35('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x2e38e6,_0x138c7c[_0xbb35('0x13')][_0xbb35('0x15')]);return _0x32a797(_0x138c7c[_0xbb35('0x13')][_0xbb35('0x15')]);}else{logger[_0xbb35('0xd')](_0xbb35('0xe'),_0x2e38e6,_0xbb35('0xf'));_0x32a797(_0x138c7c['result']['message']);}})[_0xbb35('0x16')](function(_0x285cd5){logger[_0xbb35('0x13')]('SalesforceAccount,\x20%s,\x20%s',_0x2e38e6,_0x285cd5);_0x3626e6(_0x285cd5);});});}exports[_0xbb35('0x17')]=function(_0x42973e){var _0x160bbb=this;return new Promise(function(_0x463f95,_0x11708b){return db['SalesforceAccount'][_0xbb35('0x18')]({'raw':_0x42973e[_0xbb35('0x19')]?_0x42973e[_0xbb35('0x19')][_0xbb35('0x1a')]===undefined?!![]:![]:!![],'where':_0x42973e[_0xbb35('0x19')]?_0x42973e['options'][_0xbb35('0x1b')]||null:null,'attributes':_0x42973e['options']?_0x42973e[_0xbb35('0x19')][_0xbb35('0x1c')]||null:null,'limit':_0x42973e[_0xbb35('0x19')]?_0x42973e[_0xbb35('0x19')][_0xbb35('0x1d')]||null:null,'include':_0x42973e[_0xbb35('0x19')]?_0x42973e[_0xbb35('0x19')][_0xbb35('0x1e')]?_[_0xbb35('0x1f')](_0x42973e['options'][_0xbb35('0x1e')],function(_0x1205c0){return{'model':db[_0x1205c0[_0xbb35('0x20')]],'as':_0x1205c0['as'],'attributes':_0x1205c0[_0xbb35('0x1c')],'include':_0x1205c0[_0xbb35('0x1e')]?_[_0xbb35('0x1f')](_0x1205c0[_0xbb35('0x1e')],function(_0x5624cc){return{'model':db[_0x5624cc[_0xbb35('0x20')]],'as':_0x5624cc['as'],'attributes':_0x5624cc['attributes'],'include':_0x5624cc[_0xbb35('0x1e')]?_[_0xbb35('0x1f')](_0x5624cc[_0xbb35('0x1e')],function(_0x1eae2a){return{'model':db[_0x1eae2a[_0xbb35('0x20')]],'as':_0x1eae2a['as'],'attributes':_0x1eae2a[_0xbb35('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbb35('0xc')](function(_0x21391d){logger['info'](_0xbb35('0x17'),_0x42973e);logger[_0xbb35('0x10')](_0xbb35('0x17'),_0x42973e,JSON[_0xbb35('0x12')](_0x21391d));_0x463f95(_0x21391d);})['catch'](function(_0x1b38b9){logger[_0xbb35('0x13')]('GetSalesforceAccount',_0x1b38b9[_0xbb35('0x15')],_0x42973e);_0x11708b(_0x160bbb['error'](0x1f4,_0x1b38b9[_0xbb35('0x15')]));});});};exports[_0xbb35('0x21')]=function(_0x2f7943){var _0x4f4335=this;return new Promise(function(_0x5df149,_0x19e59e){return db[_0xbb35('0x22')][_0xbb35('0x23')]({'raw':_0x2f7943[_0xbb35('0x19')]?_0x2f7943[_0xbb35('0x19')][_0xbb35('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f7943[_0xbb35('0x19')]?_0x2f7943[_0xbb35('0x19')][_0xbb35('0x1b')]||null:null,'attributes':_0x2f7943[_0xbb35('0x19')]?_0x2f7943[_0xbb35('0x19')][_0xbb35('0x1c')]||null:null,'include':_0x2f7943[_0xbb35('0x19')]?_0x2f7943[_0xbb35('0x19')][_0xbb35('0x1e')]?_[_0xbb35('0x1f')](_0x2f7943[_0xbb35('0x19')]['include'],function(_0x12083d){return{'model':db[_0x12083d[_0xbb35('0x20')]],'as':_0x12083d['as'],'attributes':_0x12083d[_0xbb35('0x1c')],'include':_0x12083d[_0xbb35('0x1e')]?_[_0xbb35('0x1f')](_0x12083d[_0xbb35('0x1e')],function(_0x16a208){return{'model':db[_0x16a208['model']],'as':_0x16a208['as'],'attributes':_0x16a208[_0xbb35('0x1c')],'include':_0x16a208[_0xbb35('0x1e')]?_[_0xbb35('0x1f')](_0x16a208['include'],function(_0x4c8922){return{'model':db[_0x4c8922[_0xbb35('0x20')]],'as':_0x4c8922['as'],'attributes':_0x4c8922[_0xbb35('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbb35('0xc')](function(_0x3239a6){logger[_0xbb35('0xd')](_0xbb35('0x21'),_0x2f7943);logger[_0xbb35('0x10')](_0xbb35('0x21'),_0x2f7943,JSON[_0xbb35('0x12')](_0x3239a6));_0x5df149(_0x3239a6);})[_0xbb35('0x16')](function(_0x4419cd){logger['error'](_0xbb35('0x21'),_0x4419cd['message'],_0x2f7943);_0x19e59e(_0x4f4335[_0xbb35('0x13')](0x1f4,_0x4419cd[_0xbb35('0x15')]));});});}; \ No newline at end of file +var _0x001e=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','map','include','model','attributes','catch','ShowSalesforceAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x627656,_0x222672){var _0x385571=function(_0xc95ee6){while(--_0xc95ee6){_0x627656['push'](_0x627656['shift']());}};_0x385571(++_0x222672);}(_0x001e,0x1b1));var _0xe001=function(_0x1ce65b,_0x1a8a61){_0x1ce65b=_0x1ce65b-0x0;var _0x49554d=_0x001e[_0x1ce65b];return _0x49554d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe001('0x0'));var BPromise=require(_0xe001('0x1'));var rs=require(_0xe001('0x2'));var fs=require('fs');var Redis=require(_0xe001('0x3'));var db=require(_0xe001('0x4'))['db'];var utils=require(_0xe001('0x5'));var logger=require(_0xe001('0x6'))(_0xe001('0x7'));var config=require(_0xe001('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe001('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e672a,_0x512a3c,_0x16692d){return new BPromise(function(_0x1f26b0,_0xb9546a){return client[_0xe001('0xa')](_0x4e672a,_0x16692d)[_0xe001('0xb')](function(_0x3f4ccf){logger[_0xe001('0xc')](_0xe001('0xd'),_0x512a3c,_0xe001('0xe'));logger[_0xe001('0xf')](_0xe001('0x10'),_0x512a3c,_0xe001('0xe'),JSON[_0xe001('0x11')](_0x3f4ccf));if(_0x3f4ccf['error']){if(_0x3f4ccf[_0xe001('0x12')][_0xe001('0x13')]===0x1f4){logger[_0xe001('0x12')](_0xe001('0xd'),_0x512a3c,_0x3f4ccf['error'][_0xe001('0x14')]);return _0xb9546a(_0x3f4ccf[_0xe001('0x12')]['message']);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x512a3c,_0x3f4ccf[_0xe001('0x12')][_0xe001('0x14')]);return _0x1f26b0(_0x3f4ccf[_0xe001('0x12')][_0xe001('0x14')]);}else{logger[_0xe001('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x512a3c,'request\x20sent');_0x1f26b0(_0x3f4ccf['result'][_0xe001('0x14')]);}})['catch'](function(_0x70f26c){logger[_0xe001('0x12')](_0xe001('0xd'),_0x512a3c,_0x70f26c);_0xb9546a(_0x70f26c);});});}exports[_0xe001('0x15')]=function(_0x272517){var _0x2c40d2=this;return new Promise(function(_0x33fac4,_0x19ea36){return db[_0xe001('0x16')][_0xe001('0x17')]({'raw':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')][_0xe001('0x19')]===undefined?!![]:![]:!![],'where':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')][_0xe001('0x1a')]||null:null,'attributes':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')]['attributes']||null:null,'limit':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')]['limit']||null:null,'include':_0x272517[_0xe001('0x18')]?_0x272517[_0xe001('0x18')]['include']?_[_0xe001('0x1b')](_0x272517[_0xe001('0x18')][_0xe001('0x1c')],function(_0xf2a0bf){return{'model':db[_0xf2a0bf[_0xe001('0x1d')]],'as':_0xf2a0bf['as'],'attributes':_0xf2a0bf[_0xe001('0x1e')],'include':_0xf2a0bf[_0xe001('0x1c')]?_['map'](_0xf2a0bf[_0xe001('0x1c')],function(_0x1971e){return{'model':db[_0x1971e[_0xe001('0x1d')]],'as':_0x1971e['as'],'attributes':_0x1971e[_0xe001('0x1e')],'include':_0x1971e[_0xe001('0x1c')]?_['map'](_0x1971e[_0xe001('0x1c')],function(_0xdb516){return{'model':db[_0xdb516[_0xe001('0x1d')]],'as':_0xdb516['as'],'attributes':_0xdb516[_0xe001('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x40c85d){logger[_0xe001('0xc')](_0xe001('0x15'),_0x272517);logger[_0xe001('0xf')](_0xe001('0x15'),_0x272517,JSON[_0xe001('0x11')](_0x40c85d));_0x33fac4(_0x40c85d);})[_0xe001('0x1f')](function(_0x238b36){logger[_0xe001('0x12')](_0xe001('0x15'),_0x238b36['message'],_0x272517);_0x19ea36(_0x2c40d2[_0xe001('0x12')](0x1f4,_0x238b36[_0xe001('0x14')]));});});};exports[_0xe001('0x20')]=function(_0x1e84d5){var _0xaa33bc=this;return new Promise(function(_0x5c714e,_0x513caf){return db[_0xe001('0x16')][_0xe001('0x21')]({'raw':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5[_0xe001('0x18')][_0xe001('0x19')]===undefined?!![]:![]:!![],'where':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5[_0xe001('0x18')][_0xe001('0x1a')]||null:null,'attributes':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5[_0xe001('0x18')][_0xe001('0x1e')]||null:null,'include':_0x1e84d5[_0xe001('0x18')]?_0x1e84d5['options']['include']?_[_0xe001('0x1b')](_0x1e84d5[_0xe001('0x18')][_0xe001('0x1c')],function(_0x2fdadc){return{'model':db[_0x2fdadc['model']],'as':_0x2fdadc['as'],'attributes':_0x2fdadc[_0xe001('0x1e')],'include':_0x2fdadc[_0xe001('0x1c')]?_[_0xe001('0x1b')](_0x2fdadc[_0xe001('0x1c')],function(_0x296367){return{'model':db[_0x296367[_0xe001('0x1d')]],'as':_0x296367['as'],'attributes':_0x296367['attributes'],'include':_0x296367[_0xe001('0x1c')]?_[_0xe001('0x1b')](_0x296367['include'],function(_0x4187da){return{'model':db[_0x4187da[_0xe001('0x1d')]],'as':_0x4187da['as'],'attributes':_0x4187da['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b7400){logger['info']('ShowSalesforceAccount',_0x1e84d5);logger['debug'](_0xe001('0x20'),_0x1e84d5,JSON[_0xe001('0x11')](_0x1b7400));_0x5c714e(_0x1b7400);})[_0xe001('0x1f')](function(_0x57356d){logger[_0xe001('0x12')](_0xe001('0x20'),_0x57356d['message'],_0x1e84d5);_0x513caf(_0xaa33bc[_0xe001('0x12')](0x1f4,_0x57356d[_0xe001('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 7cf55a2..c6eb3f5 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xdb28,0x106));var _0x8db2=function(_0x39c382,_0x49e969){_0x39c382=_0x39c382-0x0;var _0xf1d359=_0xdb28[_0x39c382];return _0xf1d359;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file +var _0x2032=['Router','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','exports','util','path','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2032,0xd9));var _0x2203=function(_0x3cd7c6,_0x5d985e){_0x3cd7c6=_0x3cd7c6-0x0;var _0x3b501a=_0x2032[_0x3cd7c6];return _0x3b501a;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x2203('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2203('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 3b9e8a8..63ca2b5 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 _0xb7e7=['lead','sequelize','STRING','ENUM','Case','contact_lead','contact','account'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xb7e7[_0x24259d];return _0x5a701;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x7b7e('0x2')]('Task',_0x7b7e('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x7b7e('0x2')](_0x7b7e('0x4'),_0x7b7e('0x5'),'lead','account_contact_lead',_0x7b7e('0x6')),'defaultValue':_0x7b7e('0x4')},'moduleCreate':{'type':Sequelize[_0x7b7e('0x2')]('nothing',_0x7b7e('0x5'),_0x7b7e('0x7'),_0x7b7e('0x6')),'defaultValue':_0x7b7e('0x7')},'leadId':{'type':Sequelize[_0x7b7e('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x7b7e('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x7b7e('0x1')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4d30=['nothing','sequelize','exports','STRING','Task','Case','ENUM','contact','lead','account','contact_lead'];(function(_0x554975,_0x4ddc6c){var _0x70a8e9=function(_0x37f5e6){while(--_0x37f5e6){_0x554975['push'](_0x554975['shift']());}};_0x70a8e9(++_0x4ddc6c);}(_0x4d30,0x1da));var _0x04d3=function(_0x3bd474,_0x4caaad){_0x3bd474=_0x3bd474-0x0;var _0x4bfaf3=_0x4d30[_0x3bd474];return _0x4bfaf3;};'use strict';var Sequelize=require(_0x04d3('0x0'));module[_0x04d3('0x1')]={'name':{'type':Sequelize[_0x04d3('0x2')]},'description':{'type':Sequelize[_0x04d3('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x04d3('0x3'),_0x04d3('0x4')),'defaultValue':_0x04d3('0x3')},'moduleSearch':{'type':Sequelize[_0x04d3('0x5')]('contact_lead',_0x04d3('0x6'),_0x04d3('0x7'),'account_contact_lead',_0x04d3('0x8')),'defaultValue':_0x04d3('0x9')},'moduleCreate':{'type':Sequelize[_0x04d3('0x5')](_0x04d3('0xa'),_0x04d3('0x6'),_0x04d3('0x7'),_0x04d3('0x8')),'defaultValue':_0x04d3('0x7')},'leadId':{'type':Sequelize[_0x04d3('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x04d3('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x04d3('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x04d3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 8cbd44a..27c4296 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 _0xaef9=['fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','findAll','rows','rawAttributes','include','find','catch','create','body','params','getFields','SalesforceField','pick','options','hasOwnProperty','getSubjects','findOne','getDescriptions','zip-dir'];(function(_0x121612,_0x1ce453){var _0x4ed46c=function(_0xe2314c){while(--_0xe2314c){_0x121612['push'](_0x121612['shift']());}};_0x4ed46c(++_0x1ce453);}(_0xaef9,0x13b));var _0x9aef=function(_0x566d8a,_0x3f2f19){_0x566d8a=_0x566d8a-0x0;var _0x5b22d1=_0xaef9[_0x566d8a];return _0x5b22d1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9aef('0x0'));var jsonpatch=require(_0x9aef('0x1'));var rp=require(_0x9aef('0x2'));var moment=require(_0x9aef('0x3'));var BPromise=require(_0x9aef('0x4'));var Mustache=require(_0x9aef('0x5'));var util=require(_0x9aef('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9aef('0x7'));var fs=require('fs');var fs_extra=require(_0x9aef('0x8'));var _=require(_0x9aef('0x9'));var squel=require(_0x9aef('0xa'));var crypto=require(_0x9aef('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9aef('0xc'));var querystring=require('querystring');var Papa=require(_0x9aef('0xd'));var Redis=require(_0x9aef('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9aef('0xf'));var hardwareService=require(_0x9aef('0x10'));var logger=require(_0x9aef('0x11'))(_0x9aef('0x12'));var utils=require(_0x9aef('0x13'));var config=require(_0x9aef('0x14'));var licenseUtil=require(_0x9aef('0x15'));var db=require(_0x9aef('0x16'))['db'];function respondWithStatusCode(_0x5d4238,_0x459a42){_0x459a42=_0x459a42||0xcc;return function(_0x540f44){if(_0x540f44){return _0x5d4238[_0x9aef('0x17')](_0x459a42);}return _0x5d4238[_0x9aef('0x18')](_0x459a42)[_0x9aef('0x19')]();};}function respondWithResult(_0x281dca,_0x5c5c77){_0x5c5c77=_0x5c5c77||0xc8;return function(_0x509eae){if(_0x509eae){return _0x281dca[_0x9aef('0x18')](_0x5c5c77)[_0x9aef('0x1a')](_0x509eae);}};}function respondWithFilteredResult(_0x2528b1,_0x123893){return function(_0x171220){if(_0x171220){var _0x4f7add=typeof _0x123893[_0x9aef('0x1b')]===_0x9aef('0x1c')&&typeof _0x123893[_0x9aef('0x1d')]===_0x9aef('0x1c');var _0x26a1d1=_0x171220['count'];var _0x39c114=_0x4f7add?0x0:_0x123893[_0x9aef('0x1b')];var _0x1c20ca=_0x4f7add?_0x171220[_0x9aef('0x1e')]:_0x123893[_0x9aef('0x1b')]+_0x123893[_0x9aef('0x1d')];var _0x1717d5;if(_0x1c20ca>=_0x26a1d1){_0x1c20ca=_0x26a1d1;_0x1717d5=0xc8;}else{_0x1717d5=0xce;}_0x2528b1[_0x9aef('0x18')](_0x1717d5);return _0x2528b1[_0x9aef('0x1f')]('Content-Range',_0x39c114+'-'+_0x1c20ca+'/'+_0x26a1d1)[_0x9aef('0x1a')](_0x171220);}return null;};}function patchUpdates(_0x427113){return function(_0x377c43){try{jsonpatch[_0x9aef('0x20')](_0x377c43,_0x427113,!![]);}catch(_0x4b7e62){return BPromise[_0x9aef('0x21')](_0x4b7e62);}return _0x377c43[_0x9aef('0x22')]();};}function saveUpdates(_0x173437,_0xdb887b){return function(_0x9d8943){if(_0x9d8943){return _0x9d8943[_0x9aef('0x23')](_0x173437)[_0x9aef('0x24')](function(_0x38a411){return _0x38a411;});}return null;};}function removeEntity(_0x47ac47,_0x445a5f){return function(_0xab565){if(_0xab565){return _0xab565['destroy']()[_0x9aef('0x24')](function(){_0x47ac47[_0x9aef('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1031f9,_0x17417e){return function(_0x326a16){if(!_0x326a16){_0x1031f9[_0x9aef('0x17')](0x194);}return _0x326a16;};}function handleError(_0x33b18a,_0x28da31){_0x28da31=_0x28da31||0x1f4;return function(_0x577144){logger['error'](_0x577144[_0x9aef('0x25')]);if(_0x577144[_0x9aef('0x26')]){delete _0x577144[_0x9aef('0x26')];}_0x33b18a[_0x9aef('0x18')](_0x28da31)[_0x9aef('0x27')](_0x577144);};}exports[_0x9aef('0x28')]=function(_0x387ebf,_0x5e96bd){var _0x5945f9={},_0x1a39bd={},_0x35f4ea={'count':0x0,'rows':[]};var _0x57e559=_[_0x9aef('0x29')](db[_0x9aef('0x2a')]['rawAttributes'],function(_0x3a6a25){return{'name':_0x3a6a25[_0x9aef('0x2b')],'type':_0x3a6a25[_0x9aef('0x2c')][_0x9aef('0x2d')]};});_0x1a39bd[_0x9aef('0x2e')]=_['map'](_0x57e559,_0x9aef('0x26'));_0x1a39bd[_0x9aef('0x2f')]=_[_0x9aef('0x30')](_0x387ebf[_0x9aef('0x2f')]);_0x1a39bd[_0x9aef('0x31')]=_['intersection'](_0x1a39bd[_0x9aef('0x2e')],_0x1a39bd[_0x9aef('0x2f')]);_0x5945f9[_0x9aef('0x32')]=_[_0x9aef('0x33')](_0x1a39bd['model'],qs['fields'](_0x387ebf[_0x9aef('0x2f')][_0x9aef('0x34')]));_0x5945f9[_0x9aef('0x32')]=_0x5945f9[_0x9aef('0x32')][_0x9aef('0x35')]?_0x5945f9[_0x9aef('0x32')]:_0x1a39bd[_0x9aef('0x2e')];if(!_0x387ebf['query']['hasOwnProperty'](_0x9aef('0x36'))){_0x5945f9[_0x9aef('0x1d')]=qs[_0x9aef('0x1d')](_0x387ebf['query']['limit']);_0x5945f9[_0x9aef('0x1b')]=qs[_0x9aef('0x1b')](_0x387ebf[_0x9aef('0x2f')]['offset']);}_0x5945f9[_0x9aef('0x37')]=qs[_0x9aef('0x38')](_0x387ebf[_0x9aef('0x2f')][_0x9aef('0x38')]);_0x5945f9[_0x9aef('0x39')]=qs['filters'](_['pick'](_0x387ebf[_0x9aef('0x2f')],_0x1a39bd[_0x9aef('0x31')]),_0x57e559);if(_0x387ebf[_0x9aef('0x2f')]['filter']){_0x5945f9[_0x9aef('0x39')]=_[_0x9aef('0x3a')](_0x5945f9[_0x9aef('0x39')],{'$or':_[_0x9aef('0x29')](_0x57e559,function(_0x2b7cb6){if(_0x2b7cb6[_0x9aef('0x2c')]!==_0x9aef('0x3b')){var _0x108d82={};_0x108d82[_0x2b7cb6[_0x9aef('0x26')]]={'$like':'%'+_0x387ebf[_0x9aef('0x2f')][_0x9aef('0x3c')]+'%'};return _0x108d82;}})});}_0x5945f9=_[_0x9aef('0x3a')]({},_0x5945f9,_0x387ebf['options']);var _0xf78b1f={'where':_0x5945f9[_0x9aef('0x39')]};return db['SalesforceConfiguration'][_0x9aef('0x1e')](_0xf78b1f)[_0x9aef('0x24')](function(_0x16ebf4){_0x35f4ea['count']=_0x16ebf4;if(_0x387ebf[_0x9aef('0x2f')][_0x9aef('0x3d')]){_0x5945f9['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0x9aef('0x3e')](_0x5945f9);})[_0x9aef('0x24')](function(_0x3c9d47){_0x35f4ea[_0x9aef('0x3f')]=_0x3c9d47;return _0x35f4ea;})[_0x9aef('0x24')](respondWithFilteredResult(_0x5e96bd,_0x5945f9))['catch'](handleError(_0x5e96bd,null));};exports['show']=function(_0x284ea0,_0x2e3732){var _0x1f054b={'raw':![],'where':{'id':_0x284ea0['params']['id']}},_0x25fbc3={};_0x25fbc3[_0x9aef('0x2e')]=_[_0x9aef('0x30')](db['SalesforceConfiguration'][_0x9aef('0x40')]);_0x25fbc3[_0x9aef('0x2f')]=_[_0x9aef('0x30')](_0x284ea0[_0x9aef('0x2f')]);_0x25fbc3['filters']=_[_0x9aef('0x33')](_0x25fbc3[_0x9aef('0x2e')],_0x25fbc3[_0x9aef('0x2f')]);_0x1f054b[_0x9aef('0x32')]=_['intersection'](_0x25fbc3[_0x9aef('0x2e')],qs[_0x9aef('0x34')](_0x284ea0[_0x9aef('0x2f')][_0x9aef('0x34')]));_0x1f054b[_0x9aef('0x32')]=_0x1f054b[_0x9aef('0x32')][_0x9aef('0x35')]?_0x1f054b[_0x9aef('0x32')]:_0x25fbc3[_0x9aef('0x2e')];if(_0x284ea0[_0x9aef('0x2f')]['includeAll']){_0x1f054b[_0x9aef('0x41')]=[{'all':!![]}];}_0x1f054b=_[_0x9aef('0x3a')]({},_0x1f054b,_0x284ea0['options']);return db[_0x9aef('0x2a')][_0x9aef('0x42')](_0x1f054b)[_0x9aef('0x24')](handleEntityNotFound(_0x2e3732,null))[_0x9aef('0x24')](respondWithResult(_0x2e3732,null))[_0x9aef('0x43')](handleError(_0x2e3732,null));};exports[_0x9aef('0x44')]=function(_0x2ce073,_0x17635c){return db['SalesforceConfiguration']['create'](_0x2ce073[_0x9aef('0x45')],{})[_0x9aef('0x24')](respondWithResult(_0x17635c,0xc9))[_0x9aef('0x43')](handleError(_0x17635c,null));};exports[_0x9aef('0x23')]=function(_0x445aef,_0x54cd3b){if(_0x445aef[_0x9aef('0x45')]['id']){delete _0x445aef['body']['id'];}return db[_0x9aef('0x2a')]['find']({'where':{'id':_0x445aef[_0x9aef('0x46')]['id']}})['then'](handleEntityNotFound(_0x54cd3b,null))[_0x9aef('0x24')](saveUpdates(_0x445aef[_0x9aef('0x45')],null))[_0x9aef('0x24')](respondWithResult(_0x54cd3b,null))['catch'](handleError(_0x54cd3b,null));};exports['destroy']=function(_0x4288dc,_0x43e8b3){return db['SalesforceConfiguration']['find']({'where':{'id':_0x4288dc[_0x9aef('0x46')]['id']}})[_0x9aef('0x24')](handleEntityNotFound(_0x43e8b3,null))[_0x9aef('0x24')](removeEntity(_0x43e8b3,null))['catch'](handleError(_0x43e8b3,null));};exports[_0x9aef('0x47')]=function(_0x115498,_0x1f07a6,_0x5d911f){var _0x1fd2b6={};var _0x41ced7={};var _0x260b9b;var _0x150a9e;return db[_0x9aef('0x2a')]['findOne']({'where':{'id':_0x115498['params']['id']}})['then'](handleEntityNotFound(_0x1f07a6,null))[_0x9aef('0x24')](function(_0x582123){if(_0x582123){_0x260b9b=_0x582123;_0x41ced7[_0x9aef('0x2e')]=_['keys'](db[_0x9aef('0x48')][_0x9aef('0x40')]);_0x41ced7['query']=_[_0x9aef('0x30')](_0x115498[_0x9aef('0x2f')]);_0x41ced7[_0x9aef('0x31')]=_['intersection'](_0x41ced7['model'],_0x41ced7[_0x9aef('0x2f')]);_0x1fd2b6[_0x9aef('0x32')]=_[_0x9aef('0x33')](_0x41ced7[_0x9aef('0x2e')],qs[_0x9aef('0x34')](_0x115498[_0x9aef('0x2f')]['fields']));_0x1fd2b6[_0x9aef('0x32')]=_0x1fd2b6[_0x9aef('0x32')]['length']?_0x1fd2b6[_0x9aef('0x32')]:_0x41ced7[_0x9aef('0x2e')];_0x1fd2b6[_0x9aef('0x37')]=qs[_0x9aef('0x38')](_0x115498[_0x9aef('0x2f')][_0x9aef('0x38')]);_0x1fd2b6[_0x9aef('0x39')]=qs[_0x9aef('0x31')](_[_0x9aef('0x49')](_0x115498[_0x9aef('0x2f')],_0x41ced7[_0x9aef('0x31')]));if(_0x115498[_0x9aef('0x2f')][_0x9aef('0x3c')]){_0x1fd2b6['where']=_[_0x9aef('0x3a')](_0x1fd2b6[_0x9aef('0x39')],{'$or':_[_0x9aef('0x29')](_0x1fd2b6[_0x9aef('0x32')],function(_0x1ffded){var _0x14eb35={};_0x14eb35[_0x1ffded]={'$like':'%'+_0x115498[_0x9aef('0x2f')][_0x9aef('0x3c')]+'%'};return _0x14eb35;})});}_0x1fd2b6=_[_0x9aef('0x3a')]({},_0x1fd2b6,_0x115498[_0x9aef('0x4a')]);return _0x260b9b[_0x9aef('0x47')](_0x1fd2b6);}})[_0x9aef('0x24')](function(_0x2c05fe){if(_0x2c05fe){_0x150a9e=_0x2c05fe[_0x9aef('0x35')];if(!_0x115498[_0x9aef('0x2f')][_0x9aef('0x4b')](_0x9aef('0x36'))){_0x1fd2b6[_0x9aef('0x1d')]=qs[_0x9aef('0x1d')](_0x115498['query'][_0x9aef('0x1d')]);_0x1fd2b6[_0x9aef('0x1b')]=qs[_0x9aef('0x1b')](_0x115498[_0x9aef('0x2f')][_0x9aef('0x1b')]);}return _0x260b9b[_0x9aef('0x47')](_0x1fd2b6);}})[_0x9aef('0x24')](function(_0x10c69d){if(_0x10c69d){return _0x10c69d?{'count':_0x150a9e,'rows':_0x10c69d}:null;}})[_0x9aef('0x24')](respondWithResult(_0x1f07a6,null))[_0x9aef('0x43')](handleError(_0x1f07a6,null));};exports[_0x9aef('0x4c')]=function(_0x4a26d7,_0x36330c,_0x3d67bd){var _0x744a64={};var _0x760314={};var _0x5022df;var _0x7c664e;return db['SalesforceConfiguration'][_0x9aef('0x4d')]({'where':{'id':_0x4a26d7['params']['id']}})['then'](handleEntityNotFound(_0x36330c,null))[_0x9aef('0x24')](function(_0x111cff){if(_0x111cff){_0x5022df=_0x111cff;_0x760314[_0x9aef('0x2e')]=_[_0x9aef('0x30')](db[_0x9aef('0x48')][_0x9aef('0x40')]);_0x760314[_0x9aef('0x2f')]=_[_0x9aef('0x30')](_0x4a26d7[_0x9aef('0x2f')]);_0x760314[_0x9aef('0x31')]=_[_0x9aef('0x33')](_0x760314[_0x9aef('0x2e')],_0x760314['query']);_0x744a64[_0x9aef('0x32')]=_[_0x9aef('0x33')](_0x760314['model'],qs[_0x9aef('0x34')](_0x4a26d7[_0x9aef('0x2f')]['fields']));_0x744a64[_0x9aef('0x32')]=_0x744a64[_0x9aef('0x32')][_0x9aef('0x35')]?_0x744a64['attributes']:_0x760314['model'];_0x744a64[_0x9aef('0x37')]=qs[_0x9aef('0x38')](_0x4a26d7[_0x9aef('0x2f')]['sort']);_0x744a64[_0x9aef('0x39')]=qs[_0x9aef('0x31')](_[_0x9aef('0x49')](_0x4a26d7['query'],_0x760314['filters']));if(_0x4a26d7[_0x9aef('0x2f')][_0x9aef('0x3c')]){_0x744a64[_0x9aef('0x39')]=_[_0x9aef('0x3a')](_0x744a64['where'],{'$or':_['map'](_0x744a64[_0x9aef('0x32')],function(_0x5f30be){var _0x870e79={};_0x870e79[_0x5f30be]={'$like':'%'+_0x4a26d7['query'][_0x9aef('0x3c')]+'%'};return _0x870e79;})});}_0x744a64=_['merge']({},_0x744a64,_0x4a26d7['options']);return _0x5022df[_0x9aef('0x4c')](_0x744a64);}})[_0x9aef('0x24')](function(_0x4df06f){if(_0x4df06f){_0x7c664e=_0x4df06f[_0x9aef('0x35')];if(!_0x4a26d7[_0x9aef('0x2f')]['hasOwnProperty'](_0x9aef('0x36'))){_0x744a64[_0x9aef('0x1d')]=qs[_0x9aef('0x1d')](_0x4a26d7[_0x9aef('0x2f')][_0x9aef('0x1d')]);_0x744a64[_0x9aef('0x1b')]=qs[_0x9aef('0x1b')](_0x4a26d7[_0x9aef('0x2f')][_0x9aef('0x1b')]);}return _0x5022df['getSubjects'](_0x744a64);}})['then'](function(_0xa75eca){if(_0xa75eca){return _0xa75eca?{'count':_0x7c664e,'rows':_0xa75eca}:null;}})[_0x9aef('0x24')](respondWithResult(_0x36330c,null))[_0x9aef('0x43')](handleError(_0x36330c,null));};exports['getDescriptions']=function(_0x33783c,_0x5793f9,_0x5bd2fd){var _0xb0164={};var _0x4941cc={};var _0x2ed064;var _0x5fa349;return db['SalesforceConfiguration'][_0x9aef('0x4d')]({'where':{'id':_0x33783c[_0x9aef('0x46')]['id']}})[_0x9aef('0x24')](handleEntityNotFound(_0x5793f9,null))[_0x9aef('0x24')](function(_0x549602){if(_0x549602){_0x2ed064=_0x549602;_0x4941cc[_0x9aef('0x2e')]=_[_0x9aef('0x30')](db[_0x9aef('0x48')][_0x9aef('0x40')]);_0x4941cc['query']=_[_0x9aef('0x30')](_0x33783c['query']);_0x4941cc['filters']=_[_0x9aef('0x33')](_0x4941cc[_0x9aef('0x2e')],_0x4941cc[_0x9aef('0x2f')]);_0xb0164[_0x9aef('0x32')]=_[_0x9aef('0x33')](_0x4941cc[_0x9aef('0x2e')],qs[_0x9aef('0x34')](_0x33783c[_0x9aef('0x2f')]['fields']));_0xb0164[_0x9aef('0x32')]=_0xb0164[_0x9aef('0x32')][_0x9aef('0x35')]?_0xb0164[_0x9aef('0x32')]:_0x4941cc[_0x9aef('0x2e')];_0xb0164[_0x9aef('0x37')]=qs[_0x9aef('0x38')](_0x33783c[_0x9aef('0x2f')][_0x9aef('0x38')]);_0xb0164['where']=qs['filters'](_[_0x9aef('0x49')](_0x33783c[_0x9aef('0x2f')],_0x4941cc[_0x9aef('0x31')]));if(_0x33783c[_0x9aef('0x2f')][_0x9aef('0x3c')]){_0xb0164['where']=_['merge'](_0xb0164[_0x9aef('0x39')],{'$or':_['map'](_0xb0164['attributes'],function(_0x16b9bb){var _0x415e1b={};_0x415e1b[_0x16b9bb]={'$like':'%'+_0x33783c[_0x9aef('0x2f')][_0x9aef('0x3c')]+'%'};return _0x415e1b;})});}_0xb0164=_['merge']({},_0xb0164,_0x33783c['options']);return _0x2ed064['getDescriptions'](_0xb0164);}})[_0x9aef('0x24')](function(_0xdcb31e){if(_0xdcb31e){_0x5fa349=_0xdcb31e[_0x9aef('0x35')];if(!_0x33783c[_0x9aef('0x2f')]['hasOwnProperty'](_0x9aef('0x36'))){_0xb0164[_0x9aef('0x1d')]=qs['limit'](_0x33783c[_0x9aef('0x2f')]['limit']);_0xb0164[_0x9aef('0x1b')]=qs[_0x9aef('0x1b')](_0x33783c[_0x9aef('0x2f')][_0x9aef('0x1b')]);}return _0x2ed064[_0x9aef('0x4e')](_0xb0164);}})[_0x9aef('0x24')](function(_0x2ca2a6){if(_0x2ca2a6){return _0x2ca2a6?{'count':_0x5fa349,'rows':_0x2ca2a6}:null;}})['then'](respondWithResult(_0x5793f9,null))['catch'](handleError(_0x5793f9,null));}; \ No newline at end of file +var _0x61c8=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','findOne','SalesforceField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','rawAttributes'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0x61c8,0x199));var _0x861c=function(_0x22491d,_0x3bad40){_0x22491d=_0x22491d-0x0;var _0x431173=_0x61c8[_0x22491d];return _0x431173;};'use strict';var emlformat=require(_0x861c('0x0'));var rimraf=require(_0x861c('0x1'));var zipdir=require(_0x861c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x861c('0x3'));var BPromise=require(_0x861c('0x4'));var Mustache=require(_0x861c('0x5'));var util=require(_0x861c('0x6'));var path=require(_0x861c('0x7'));var sox=require('sox');var csv=require(_0x861c('0x8'));var ejs=require(_0x861c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x861c('0xa'));var squel=require(_0x861c('0xb'));var crypto=require('crypto');var jsforce=require(_0x861c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x861c('0x8'));var querystring=require(_0x861c('0xd'));var Papa=require('papaparse');var Redis=require(_0x861c('0xe'));var authService=require(_0x861c('0xf'));var qs=require(_0x861c('0x10'));var as=require(_0x861c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x861c('0x12'));var licenseUtil=require(_0x861c('0x13'));var db=require(_0x861c('0x14'))['db'];function respondWithStatusCode(_0x2a7e22,_0x24b456){_0x24b456=_0x24b456||0xcc;return function(_0x59dbb6){if(_0x59dbb6){return _0x2a7e22['sendStatus'](_0x24b456);}return _0x2a7e22['status'](_0x24b456)[_0x861c('0x15')]();};}function respondWithResult(_0x3c2667,_0x142e5d){_0x142e5d=_0x142e5d||0xc8;return function(_0x6ccf72){if(_0x6ccf72){return _0x3c2667['status'](_0x142e5d)[_0x861c('0x16')](_0x6ccf72);}};}function respondWithFilteredResult(_0x216afc,_0x523a82){return function(_0x56a693){if(_0x56a693){var _0x2787ac=typeof _0x523a82[_0x861c('0x17')]===_0x861c('0x18')&&typeof _0x523a82['limit']==='undefined';var _0x590ee9=_0x56a693[_0x861c('0x19')];var _0x19c6d2=_0x2787ac?0x0:_0x523a82[_0x861c('0x17')];var _0x1cd16f=_0x2787ac?_0x56a693['count']:_0x523a82[_0x861c('0x17')]+_0x523a82['limit'];var _0x2d88a6;if(_0x1cd16f>=_0x590ee9){_0x1cd16f=_0x590ee9;_0x2d88a6=0xc8;}else{_0x2d88a6=0xce;}_0x216afc[_0x861c('0x1a')](_0x2d88a6);return _0x216afc[_0x861c('0x1b')](_0x861c('0x1c'),_0x19c6d2+'-'+_0x1cd16f+'/'+_0x590ee9)[_0x861c('0x16')](_0x56a693);}return null;};}function patchUpdates(_0x2b5500){return function(_0x105056){try{jsonpatch[_0x861c('0x1d')](_0x105056,_0x2b5500,!![]);}catch(_0x2acf77){return BPromise[_0x861c('0x1e')](_0x2acf77);}return _0x105056['save']();};}function saveUpdates(_0x486a0a,_0x4efe98){return function(_0x155d2b){if(_0x155d2b){return _0x155d2b[_0x861c('0x1f')](_0x486a0a)[_0x861c('0x20')](function(_0x503792){return _0x503792;});}return null;};}function removeEntity(_0x3636ed,_0x2cd4d0){return function(_0xd83bda){if(_0xd83bda){return _0xd83bda[_0x861c('0x21')]()[_0x861c('0x20')](function(){_0x3636ed['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e3a00,_0x429695){return function(_0x37f210){if(!_0x37f210){_0x3e3a00['sendStatus'](0x194);}return _0x37f210;};}function handleError(_0x2ae363,_0x21b778){_0x21b778=_0x21b778||0x1f4;return function(_0x383736){logger[_0x861c('0x22')](_0x383736[_0x861c('0x23')]);if(_0x383736[_0x861c('0x24')]){delete _0x383736[_0x861c('0x24')];}_0x2ae363['status'](_0x21b778)['send'](_0x383736);};}exports[_0x861c('0x25')]=function(_0x4a5a58,_0x5314b9){var _0x2ad63f={},_0x4c9e3d={},_0x3e90f0={'count':0x0,'rows':[]};var _0x3b3f69=_[_0x861c('0x26')](db[_0x861c('0x27')][_0x861c('0x28')],function(_0x4aa965){return{'name':_0x4aa965['fieldName'],'type':_0x4aa965[_0x861c('0x29')][_0x861c('0x2a')]};});_0x4c9e3d[_0x861c('0x2b')]=_[_0x861c('0x26')](_0x3b3f69,_0x861c('0x24'));_0x4c9e3d[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0x4a5a58[_0x861c('0x2c')]);_0x4c9e3d[_0x861c('0x2e')]=_[_0x861c('0x2f')](_0x4c9e3d[_0x861c('0x2b')],_0x4c9e3d[_0x861c('0x2c')]);_0x2ad63f[_0x861c('0x30')]=_[_0x861c('0x2f')](_0x4c9e3d[_0x861c('0x2b')],qs['fields'](_0x4a5a58[_0x861c('0x2c')][_0x861c('0x31')]));_0x2ad63f[_0x861c('0x30')]=_0x2ad63f[_0x861c('0x30')][_0x861c('0x32')]?_0x2ad63f[_0x861c('0x30')]:_0x4c9e3d[_0x861c('0x2b')];if(!_0x4a5a58[_0x861c('0x2c')][_0x861c('0x33')]('nolimit')){_0x2ad63f[_0x861c('0x34')]=qs[_0x861c('0x34')](_0x4a5a58[_0x861c('0x2c')]['limit']);_0x2ad63f['offset']=qs[_0x861c('0x17')](_0x4a5a58[_0x861c('0x2c')][_0x861c('0x17')]);}_0x2ad63f[_0x861c('0x35')]=qs[_0x861c('0x36')](_0x4a5a58[_0x861c('0x2c')][_0x861c('0x36')]);_0x2ad63f[_0x861c('0x37')]=qs[_0x861c('0x2e')](_[_0x861c('0x38')](_0x4a5a58[_0x861c('0x2c')],_0x4c9e3d[_0x861c('0x2e')]),_0x3b3f69);if(_0x4a5a58[_0x861c('0x2c')][_0x861c('0x39')]){_0x2ad63f[_0x861c('0x37')]=_[_0x861c('0x3a')](_0x2ad63f[_0x861c('0x37')],{'$or':_['map'](_0x3b3f69,function(_0x3d74ea){if(_0x3d74ea[_0x861c('0x29')]!=='VIRTUAL'){var _0x41ea26={};_0x41ea26[_0x3d74ea[_0x861c('0x24')]]={'$like':'%'+_0x4a5a58[_0x861c('0x2c')][_0x861c('0x39')]+'%'};return _0x41ea26;}})});}_0x2ad63f=_['merge']({},_0x2ad63f,_0x4a5a58[_0x861c('0x3b')]);var _0x423492={'where':_0x2ad63f['where']};return db[_0x861c('0x27')][_0x861c('0x19')](_0x423492)[_0x861c('0x20')](function(_0x2c1eb2){_0x3e90f0[_0x861c('0x19')]=_0x2c1eb2;if(_0x4a5a58[_0x861c('0x2c')]['includeAll']){_0x2ad63f[_0x861c('0x3c')]=[{'all':!![]}];}return db[_0x861c('0x27')][_0x861c('0x3d')](_0x2ad63f);})[_0x861c('0x20')](function(_0x2fe83d){_0x3e90f0['rows']=_0x2fe83d;return _0x3e90f0;})['then'](respondWithFilteredResult(_0x5314b9,_0x2ad63f))[_0x861c('0x3e')](handleError(_0x5314b9,null));};exports[_0x861c('0x3f')]=function(_0xdcacaa,_0x337167){var _0x2a1384={'raw':![],'where':{'id':_0xdcacaa[_0x861c('0x40')]['id']}},_0x467eb5={};_0x467eb5[_0x861c('0x2b')]=_[_0x861c('0x2d')](db[_0x861c('0x27')]['rawAttributes']);_0x467eb5[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0xdcacaa[_0x861c('0x2c')]);_0x467eb5['filters']=_[_0x861c('0x2f')](_0x467eb5[_0x861c('0x2b')],_0x467eb5[_0x861c('0x2c')]);_0x2a1384['attributes']=_[_0x861c('0x2f')](_0x467eb5[_0x861c('0x2b')],qs['fields'](_0xdcacaa[_0x861c('0x2c')][_0x861c('0x31')]));_0x2a1384[_0x861c('0x30')]=_0x2a1384[_0x861c('0x30')][_0x861c('0x32')]?_0x2a1384[_0x861c('0x30')]:_0x467eb5[_0x861c('0x2b')];if(_0xdcacaa[_0x861c('0x2c')][_0x861c('0x41')]){_0x2a1384['include']=[{'all':!![]}];}_0x2a1384=_['merge']({},_0x2a1384,_0xdcacaa[_0x861c('0x3b')]);return db['SalesforceConfiguration'][_0x861c('0x42')](_0x2a1384)[_0x861c('0x20')](handleEntityNotFound(_0x337167,null))['then'](respondWithResult(_0x337167,null))[_0x861c('0x3e')](handleError(_0x337167,null));};exports[_0x861c('0x43')]=function(_0xbc9c89,_0x269230){return db[_0x861c('0x27')][_0x861c('0x43')](_0xbc9c89[_0x861c('0x44')],{})['then'](respondWithResult(_0x269230,0xc9))[_0x861c('0x3e')](handleError(_0x269230,null));};exports[_0x861c('0x1f')]=function(_0x194a36,_0x3e43e5){if(_0x194a36[_0x861c('0x44')]['id']){delete _0x194a36['body']['id'];}return db[_0x861c('0x27')]['find']({'where':{'id':_0x194a36[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x3e43e5,null))['then'](saveUpdates(_0x194a36[_0x861c('0x44')],null))['then'](respondWithResult(_0x3e43e5,null))[_0x861c('0x3e')](handleError(_0x3e43e5,null));};exports[_0x861c('0x21')]=function(_0x185cb1,_0x4b7d6e){return db[_0x861c('0x27')][_0x861c('0x42')]({'where':{'id':_0x185cb1[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x4b7d6e,null))[_0x861c('0x20')](removeEntity(_0x4b7d6e,null))['catch'](handleError(_0x4b7d6e,null));};exports['getFields']=function(_0x287eef,_0xd5f67c,_0x397675){var _0x1d2f0b={};var _0x2b0c3d={};var _0x40e13e;var _0x573ba3;return db[_0x861c('0x27')][_0x861c('0x45')]({'where':{'id':_0x287eef[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0xd5f67c,null))[_0x861c('0x20')](function(_0x192165){if(_0x192165){_0x40e13e=_0x192165;_0x2b0c3d[_0x861c('0x2b')]=_[_0x861c('0x2d')](db[_0x861c('0x46')][_0x861c('0x28')]);_0x2b0c3d[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0x287eef['query']);_0x2b0c3d[_0x861c('0x2e')]=_['intersection'](_0x2b0c3d[_0x861c('0x2b')],_0x2b0c3d[_0x861c('0x2c')]);_0x1d2f0b[_0x861c('0x30')]=_[_0x861c('0x2f')](_0x2b0c3d[_0x861c('0x2b')],qs[_0x861c('0x31')](_0x287eef[_0x861c('0x2c')]['fields']));_0x1d2f0b[_0x861c('0x30')]=_0x1d2f0b[_0x861c('0x30')][_0x861c('0x32')]?_0x1d2f0b[_0x861c('0x30')]:_0x2b0c3d['model'];_0x1d2f0b[_0x861c('0x35')]=qs['sort'](_0x287eef[_0x861c('0x2c')][_0x861c('0x36')]);_0x1d2f0b[_0x861c('0x37')]=qs[_0x861c('0x2e')](_[_0x861c('0x38')](_0x287eef[_0x861c('0x2c')],_0x2b0c3d[_0x861c('0x2e')]));if(_0x287eef['query'][_0x861c('0x39')]){_0x1d2f0b[_0x861c('0x37')]=_[_0x861c('0x3a')](_0x1d2f0b[_0x861c('0x37')],{'$or':_[_0x861c('0x26')](_0x1d2f0b[_0x861c('0x30')],function(_0xb505d5){var _0x785543={};_0x785543[_0xb505d5]={'$like':'%'+_0x287eef[_0x861c('0x2c')][_0x861c('0x39')]+'%'};return _0x785543;})});}_0x1d2f0b=_[_0x861c('0x3a')]({},_0x1d2f0b,_0x287eef[_0x861c('0x3b')]);return _0x40e13e[_0x861c('0x47')](_0x1d2f0b);}})[_0x861c('0x20')](function(_0x3158b4){if(_0x3158b4){_0x573ba3=_0x3158b4[_0x861c('0x32')];if(!_0x287eef[_0x861c('0x2c')][_0x861c('0x33')](_0x861c('0x48'))){_0x1d2f0b[_0x861c('0x34')]=qs[_0x861c('0x34')](_0x287eef[_0x861c('0x2c')][_0x861c('0x34')]);_0x1d2f0b[_0x861c('0x17')]=qs[_0x861c('0x17')](_0x287eef[_0x861c('0x2c')][_0x861c('0x17')]);}return _0x40e13e['getFields'](_0x1d2f0b);}})[_0x861c('0x20')](function(_0x344aac){if(_0x344aac){return _0x344aac?{'count':_0x573ba3,'rows':_0x344aac}:null;}})['then'](respondWithResult(_0xd5f67c,null))[_0x861c('0x3e')](handleError(_0xd5f67c,null));};exports[_0x861c('0x49')]=function(_0xc9665e,_0x2c25d2,_0x5d921d){var _0x17a336={};var _0x2f5ee5={};var _0x32cd63;var _0x4e6f63;return db[_0x861c('0x27')][_0x861c('0x45')]({'where':{'id':_0xc9665e[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x2c25d2,null))[_0x861c('0x20')](function(_0x19d780){if(_0x19d780){_0x32cd63=_0x19d780;_0x2f5ee5['model']=_['keys'](db[_0x861c('0x46')][_0x861c('0x28')]);_0x2f5ee5[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0xc9665e[_0x861c('0x2c')]);_0x2f5ee5[_0x861c('0x2e')]=_[_0x861c('0x2f')](_0x2f5ee5[_0x861c('0x2b')],_0x2f5ee5[_0x861c('0x2c')]);_0x17a336[_0x861c('0x30')]=_['intersection'](_0x2f5ee5[_0x861c('0x2b')],qs[_0x861c('0x31')](_0xc9665e[_0x861c('0x2c')][_0x861c('0x31')]));_0x17a336[_0x861c('0x30')]=_0x17a336[_0x861c('0x30')][_0x861c('0x32')]?_0x17a336[_0x861c('0x30')]:_0x2f5ee5[_0x861c('0x2b')];_0x17a336[_0x861c('0x35')]=qs[_0x861c('0x36')](_0xc9665e[_0x861c('0x2c')]['sort']);_0x17a336[_0x861c('0x37')]=qs['filters'](_[_0x861c('0x38')](_0xc9665e['query'],_0x2f5ee5[_0x861c('0x2e')]));if(_0xc9665e[_0x861c('0x2c')][_0x861c('0x39')]){_0x17a336[_0x861c('0x37')]=_['merge'](_0x17a336[_0x861c('0x37')],{'$or':_['map'](_0x17a336[_0x861c('0x30')],function(_0x17d1d4){var _0x1279e9={};_0x1279e9[_0x17d1d4]={'$like':'%'+_0xc9665e[_0x861c('0x2c')]['filter']+'%'};return _0x1279e9;})});}_0x17a336=_[_0x861c('0x3a')]({},_0x17a336,_0xc9665e[_0x861c('0x3b')]);return _0x32cd63[_0x861c('0x49')](_0x17a336);}})[_0x861c('0x20')](function(_0x4b6e09){if(_0x4b6e09){_0x4e6f63=_0x4b6e09['length'];if(!_0xc9665e[_0x861c('0x2c')][_0x861c('0x33')]('nolimit')){_0x17a336[_0x861c('0x34')]=qs[_0x861c('0x34')](_0xc9665e['query'][_0x861c('0x34')]);_0x17a336['offset']=qs['offset'](_0xc9665e['query'][_0x861c('0x17')]);}return _0x32cd63[_0x861c('0x49')](_0x17a336);}})[_0x861c('0x20')](function(_0x38f088){if(_0x38f088){return _0x38f088?{'count':_0x4e6f63,'rows':_0x38f088}:null;}})[_0x861c('0x20')](respondWithResult(_0x2c25d2,null))[_0x861c('0x3e')](handleError(_0x2c25d2,null));};exports['getDescriptions']=function(_0x1615ce,_0x3d1e23,_0x8f288e){var _0x28509c={};var _0x2bcc37={};var _0x43c90a;var _0x43156b;return db[_0x861c('0x27')][_0x861c('0x45')]({'where':{'id':_0x1615ce[_0x861c('0x40')]['id']}})[_0x861c('0x20')](handleEntityNotFound(_0x3d1e23,null))[_0x861c('0x20')](function(_0x2b0048){if(_0x2b0048){_0x43c90a=_0x2b0048;_0x2bcc37['model']=_[_0x861c('0x2d')](db[_0x861c('0x46')][_0x861c('0x28')]);_0x2bcc37[_0x861c('0x2c')]=_[_0x861c('0x2d')](_0x1615ce[_0x861c('0x2c')]);_0x2bcc37['filters']=_[_0x861c('0x2f')](_0x2bcc37[_0x861c('0x2b')],_0x2bcc37[_0x861c('0x2c')]);_0x28509c['attributes']=_[_0x861c('0x2f')](_0x2bcc37[_0x861c('0x2b')],qs['fields'](_0x1615ce['query'][_0x861c('0x31')]));_0x28509c[_0x861c('0x30')]=_0x28509c[_0x861c('0x30')][_0x861c('0x32')]?_0x28509c['attributes']:_0x2bcc37[_0x861c('0x2b')];_0x28509c[_0x861c('0x35')]=qs[_0x861c('0x36')](_0x1615ce[_0x861c('0x2c')][_0x861c('0x36')]);_0x28509c['where']=qs[_0x861c('0x2e')](_[_0x861c('0x38')](_0x1615ce[_0x861c('0x2c')],_0x2bcc37[_0x861c('0x2e')]));if(_0x1615ce[_0x861c('0x2c')][_0x861c('0x39')]){_0x28509c['where']=_['merge'](_0x28509c[_0x861c('0x37')],{'$or':_[_0x861c('0x26')](_0x28509c[_0x861c('0x30')],function(_0x2470b3){var _0x399699={};_0x399699[_0x2470b3]={'$like':'%'+_0x1615ce['query'][_0x861c('0x39')]+'%'};return _0x399699;})});}_0x28509c=_[_0x861c('0x3a')]({},_0x28509c,_0x1615ce[_0x861c('0x3b')]);return _0x43c90a[_0x861c('0x4a')](_0x28509c);}})[_0x861c('0x20')](function(_0x1dacb4){if(_0x1dacb4){_0x43156b=_0x1dacb4[_0x861c('0x32')];if(!_0x1615ce[_0x861c('0x2c')][_0x861c('0x33')](_0x861c('0x48'))){_0x28509c[_0x861c('0x34')]=qs[_0x861c('0x34')](_0x1615ce[_0x861c('0x2c')][_0x861c('0x34')]);_0x28509c[_0x861c('0x17')]=qs['offset'](_0x1615ce['query']['offset']);}return _0x43c90a[_0x861c('0x4a')](_0x28509c);}})[_0x861c('0x20')](function(_0x147c54){if(_0x147c54){return _0x147c54?{'count':_0x43156b,'rows':_0x147c54}:null;}})[_0x861c('0x20')](respondWithResult(_0x3d1e23,null))['catch'](handleError(_0x3d1e23,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 5a69bc4..5ca0f97 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 _0x3fd3=['int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','SalesforceConfiguration'];(function(_0x148521,_0x5796d5){var _0x4f38df=function(_0x41689d){while(--_0x41689d){_0x148521['push'](_0x148521['shift']());}};_0x4f38df(++_0x5796d5);}(_0x3fd3,0x12d));var _0x33fd=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x3fd3[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0x33fd('0x0'));var util=require('util');var logger=require(_0x33fd('0x1'))(_0x33fd('0x2'));var moment=require(_0x33fd('0x3'));var BPromise=require(_0x33fd('0x4'));var rp=require(_0x33fd('0x5'));var fs=require('fs');var path=require(_0x33fd('0x6'));var rimraf=require('rimraf');var config=require(_0x33fd('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x33fd('0x8')]=function(_0x5d2e6c,_0x3adac2){return _0x5d2e6c[_0x33fd('0x9')](_0x33fd('0xa'),attributes,{'tableName':_0x33fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1232=['rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19116e,_0x5c9212){var _0x40ee7d=function(_0x41c788){while(--_0x41c788){_0x19116e['push'](_0x19116e['shift']());}};_0x40ee7d(++_0x5c9212);}(_0x1232,0x85));var _0x2123=function(_0x2dba56,_0x35ba5e){_0x2dba56=_0x2dba56-0x0;var _0x44f478=_0x1232[_0x2dba56];return _0x44f478;};'use strict';var _=require(_0x2123('0x0'));var util=require(_0x2123('0x1'));var logger=require(_0x2123('0x2'))(_0x2123('0x3'));var moment=require(_0x2123('0x4'));var BPromise=require(_0x2123('0x5'));var rp=require(_0x2123('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2123('0x7'));var config=require(_0x2123('0x8'));var attributes=require(_0x2123('0x9'));module[_0x2123('0xa')]=function(_0xa43a30,_0x437d41){return _0xa43a30[_0x2123('0xb')](_0x2123('0xc'),attributes,{'tableName':_0x2123('0xd'),'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 f3afd3b..b00458f 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 _0x8924=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','request\x20sent','debug','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x14d382,_0x54b6bd){var _0x31c6a7=function(_0xc9bb74){while(--_0xc9bb74){_0x14d382['push'](_0x14d382['shift']());}};_0x31c6a7(++_0x54b6bd);}(_0x8924,0x1f4));var _0x4892=function(_0x30c92b,_0x154324){_0x30c92b=_0x30c92b-0x0;var _0x33837b=_0x8924[_0x30c92b];return _0x33837b;};'use strict';var _=require(_0x4892('0x0'));var util=require(_0x4892('0x1'));var moment=require('moment');var BPromise=require(_0x4892('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4892('0x3'));var db=require(_0x4892('0x4'))['db'];var utils=require(_0x4892('0x5'));var logger=require(_0x4892('0x6'))('rpc');var config=require(_0x4892('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4892('0x8')][_0x4892('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e9792,_0xff4d59,_0x2c8ccf){return new BPromise(function(_0xdfbe38,_0x3f9adb){return client['request'](_0x1e9792,_0x2c8ccf)[_0x4892('0xa')](function(_0x3470a1){logger[_0x4892('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0xff4d59,_0x4892('0xc'));logger[_0x4892('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xff4d59,_0x4892('0xc'),JSON['stringify'](_0x3470a1));if(_0x3470a1[_0x4892('0xe')]){if(_0x3470a1['error'][_0x4892('0xf')]===0x1f4){logger['error'](_0x4892('0x10'),_0xff4d59,_0x3470a1[_0x4892('0xe')]['message']);return _0x3f9adb(_0x3470a1[_0x4892('0xe')]['message']);}logger[_0x4892('0xe')](_0x4892('0x10'),_0xff4d59,_0x3470a1['error'][_0x4892('0x11')]);return _0xdfbe38(_0x3470a1['error'][_0x4892('0x11')]);}else{logger[_0x4892('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0xff4d59,_0x4892('0xc'));_0xdfbe38(_0x3470a1[_0x4892('0x12')][_0x4892('0x11')]);}})[_0x4892('0x13')](function(_0x2e3431){logger[_0x4892('0xe')](_0x4892('0x10'),_0xff4d59,_0x2e3431);_0x3f9adb(_0x2e3431);});});} \ No newline at end of file +var _0xb4ea=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1974a1,_0x347db8){var _0x415789=function(_0x325524){while(--_0x325524){_0x1974a1['push'](_0x1974a1['shift']());}};_0x415789(++_0x347db8);}(_0xb4ea,0x1cc));var _0xab4e=function(_0x485c25,_0x4a4d8a){_0x485c25=_0x485c25-0x0;var _0x35e0dc=_0xb4ea[_0x485c25];return _0x35e0dc;};'use strict';var _=require(_0xab4e('0x0'));var util=require(_0xab4e('0x1'));var moment=require(_0xab4e('0x2'));var BPromise=require(_0xab4e('0x3'));var rs=require(_0xab4e('0x4'));var fs=require('fs');var Redis=require(_0xab4e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab4e('0x6'));var logger=require(_0xab4e('0x7'))(_0xab4e('0x8'));var config=require(_0xab4e('0x9'));var jayson=require(_0xab4e('0xa'));var client=jayson[_0xab4e('0xb')][_0xab4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x58e9cb,_0x3ce381,_0x44ed34){return new BPromise(function(_0x24e8c9,_0x2b3896){return client[_0xab4e('0xd')](_0x58e9cb,_0x44ed34)['then'](function(_0xb9861d){logger[_0xab4e('0xe')](_0xab4e('0xf'),_0x3ce381,_0xab4e('0x10'));logger['debug'](_0xab4e('0x11'),_0x3ce381,_0xab4e('0x10'),JSON[_0xab4e('0x12')](_0xb9861d));if(_0xb9861d[_0xab4e('0x13')]){if(_0xb9861d[_0xab4e('0x13')][_0xab4e('0x14')]===0x1f4){logger[_0xab4e('0x13')](_0xab4e('0xf'),_0x3ce381,_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);return _0x2b3896(_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);}logger[_0xab4e('0x13')](_0xab4e('0xf'),_0x3ce381,_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);return _0x24e8c9(_0xb9861d[_0xab4e('0x13')][_0xab4e('0x15')]);}else{logger[_0xab4e('0xe')](_0xab4e('0xf'),_0x3ce381,'request\x20sent');_0x24e8c9(_0xb9861d[_0xab4e('0x16')][_0xab4e('0x15')]);}})[_0xab4e('0x17')](function(_0x3ee88b){logger[_0xab4e('0x13')](_0xab4e('0xf'),_0x3ce381,_0x3ee88b);_0x2b3896(_0x3ee88b);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 92dcd89..c047a64 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 _0x3a09=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x555bbd,_0x196748){var _0x3184d7=function(_0x274943){while(--_0x274943){_0x555bbd['push'](_0x555bbd['shift']());}};_0x3184d7(++_0x196748);}(_0x3a09,0x1a3));var _0x93a0=function(_0x588cee,_0x1191da){_0x588cee=_0x588cee-0x0;var _0x123ee6=_0x3a09[_0x588cee];return _0x123ee6;};'use strict';var multer=require(_0x93a0('0x0'));var util=require(_0x93a0('0x1'));var path=require('path');var timeout=require(_0x93a0('0x2'));var express=require(_0x93a0('0x3'));var router=express[_0x93a0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x93a0('0x5'));var interaction=require(_0x93a0('0x6'));var config=require(_0x93a0('0x7'));var controller=require(_0x93a0('0x8'));router['get']('/',auth[_0x93a0('0x9')](),controller[_0x93a0('0xa')]);router[_0x93a0('0xb')](_0x93a0('0xc'),auth[_0x93a0('0x9')](),controller[_0x93a0('0xd')]);router[_0x93a0('0xe')]('/',auth[_0x93a0('0x9')](),controller[_0x93a0('0xf')]);router[_0x93a0('0x10')](_0x93a0('0xc'),auth['isAuthenticated'](),controller[_0x93a0('0x11')]);router[_0x93a0('0x12')](_0x93a0('0xc'),auth[_0x93a0('0x9')](),controller[_0x93a0('0x13')]);module[_0x93a0('0x14')]=router; \ No newline at end of file +var _0x00f9=['util','path','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','destroy','exports'];(function(_0x2c78a7,_0x467a15){var _0x11cf04=function(_0x215358){while(--_0x215358){_0x2c78a7['push'](_0x2c78a7['shift']());}};_0x11cf04(++_0x467a15);}(_0x00f9,0xf0));var _0x900f=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0x00f9[_0x3ba422];return _0x20b5dd;};'use strict';var multer=require('multer');var util=require(_0x900f('0x0'));var path=require(_0x900f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x900f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x900f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x900f('0x4'));var controller=require(_0x900f('0x5'));router[_0x900f('0x6')]('/',auth[_0x900f('0x7')](),controller[_0x900f('0x8')]);router['get'](_0x900f('0x9'),auth['isAuthenticated'](),controller[_0x900f('0xa')]);router[_0x900f('0xb')]('/',auth['isAuthenticated'](),controller[_0x900f('0xc')]);router['put']('/:id',auth[_0x900f('0x7')](),controller['update']);router['delete'](_0x900f('0x9'),auth['isAuthenticated'](),controller[_0x900f('0xd')]);module[_0x900f('0xe')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 44a2028..3a1cf57 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 _0xf97a=['keyValue','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x55030d,_0x20117f){var _0x24ed0b=function(_0xa088de){while(--_0xa088de){_0x55030d['push'](_0x55030d['shift']());}};_0x24ed0b(++_0x20117f);}(_0xf97a,0x95));var _0xaf97=function(_0x12819e,_0x533cc9){_0x12819e=_0x12819e-0x0;var _0x5615b1=_0xf97a[_0x12819e];return _0x5615b1;};'use strict';var Sequelize=require(_0xaf97('0x0'));module[_0xaf97('0x1')]={'type':{'type':Sequelize[_0xaf97('0x2')](_0xaf97('0x3'),_0xaf97('0x4'),'customVariable',_0xaf97('0x5'),'picklist'),'defaultValue':_0xaf97('0x3')},'content':{'type':Sequelize[_0xaf97('0x6')]},'key':{'type':Sequelize[_0xaf97('0x6')]},'keyType':{'type':Sequelize[_0xaf97('0x2')](_0xaf97('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xaf97('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd6b4=['ENUM','string','variable','customVariable','picklist','STRING','sequelize','exports'];(function(_0xa735c4,_0x3d5f93){var _0x534982=function(_0x57dd9f){while(--_0x57dd9f){_0xa735c4['push'](_0xa735c4['shift']());}};_0x534982(++_0x3d5f93);}(_0xd6b4,0x9e));var _0x4d6b=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd6b4[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x4d6b('0x0'));module[_0x4d6b('0x1')]={'type':{'type':Sequelize[_0x4d6b('0x2')](_0x4d6b('0x3'),_0x4d6b('0x4'),_0x4d6b('0x5'),'keyValue',_0x4d6b('0x6')),'defaultValue':_0x4d6b('0x3')},'content':{'type':Sequelize[_0x4d6b('0x7')]},'key':{'type':Sequelize[_0x4d6b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x4d6b('0x3'),_0x4d6b('0x4'),_0x4d6b('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4d6b('0x7')]},'variableName':{'type':Sequelize[_0x4d6b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 6004172..07d40aa 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 _0x7c3c=['Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','then','includeAll','include','findAll','catch','show','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','count','offset','set'];(function(_0x4d9c3b,_0x3c4663){var _0x35c391=function(_0x22ac2e){while(--_0x22ac2e){_0x4d9c3b['push'](_0x4d9c3b['shift']());}};_0x35c391(++_0x3c4663);}(_0x7c3c,0x7a));var _0xc7c3=function(_0x5efe28,_0x410eb8){_0x5efe28=_0x5efe28-0x0;var _0x260c7a=_0x7c3c[_0x5efe28];return _0x260c7a;};'use strict';var emlformat=require(_0xc7c3('0x0'));var rimraf=require(_0xc7c3('0x1'));var zipdir=require(_0xc7c3('0x2'));var jsonpatch=require(_0xc7c3('0x3'));var rp=require(_0xc7c3('0x4'));var moment=require(_0xc7c3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc7c3('0x6'));var util=require(_0xc7c3('0x7'));var path=require(_0xc7c3('0x8'));var sox=require(_0xc7c3('0x9'));var csv=require(_0xc7c3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc7c3('0xb'));var _=require(_0xc7c3('0xc'));var squel=require(_0xc7c3('0xd'));var crypto=require(_0xc7c3('0xe'));var jsforce=require(_0xc7c3('0xf'));var deskjs=require(_0xc7c3('0x10'));var toCsv=require(_0xc7c3('0xa'));var querystring=require(_0xc7c3('0x11'));var Papa=require(_0xc7c3('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc7c3('0x13'));var as=require(_0xc7c3('0x14'));var hardwareService=require(_0xc7c3('0x15'));var logger=require(_0xc7c3('0x16'))(_0xc7c3('0x17'));var utils=require(_0xc7c3('0x18'));var config=require(_0xc7c3('0x19'));var licenseUtil=require(_0xc7c3('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3de230,_0x3db08a){_0x3db08a=_0x3db08a||0xcc;return function(_0x2ace42){if(_0x2ace42){return _0x3de230['sendStatus'](_0x3db08a);}return _0x3de230[_0xc7c3('0x1b')](_0x3db08a)['end']();};}function respondWithResult(_0x5d1b3c,_0x409f7f){_0x409f7f=_0x409f7f||0xc8;return function(_0x2a93fd){if(_0x2a93fd){return _0x5d1b3c[_0xc7c3('0x1b')](_0x409f7f)[_0xc7c3('0x1c')](_0x2a93fd);}};}function respondWithFilteredResult(_0x3ba8d0,_0x14773c){return function(_0x5c98b1){if(_0x5c98b1){var _0x420734=typeof _0x14773c['offset']===_0xc7c3('0x1d')&&typeof _0x14773c[_0xc7c3('0x1e')]===_0xc7c3('0x1d');var _0x5e8673=_0x5c98b1[_0xc7c3('0x1f')];var _0x2b18ea=_0x420734?0x0:_0x14773c[_0xc7c3('0x20')];var _0x3b599f=_0x420734?_0x5c98b1[_0xc7c3('0x1f')]:_0x14773c['offset']+_0x14773c[_0xc7c3('0x1e')];var _0x4a38f0;if(_0x3b599f>=_0x5e8673){_0x3b599f=_0x5e8673;_0x4a38f0=0xc8;}else{_0x4a38f0=0xce;}_0x3ba8d0['status'](_0x4a38f0);return _0x3ba8d0[_0xc7c3('0x21')](_0xc7c3('0x22'),_0x2b18ea+'-'+_0x3b599f+'/'+_0x5e8673)[_0xc7c3('0x1c')](_0x5c98b1);}return null;};}function patchUpdates(_0x3e9130){return function(_0x50ddf6){try{jsonpatch[_0xc7c3('0x23')](_0x50ddf6,_0x3e9130,!![]);}catch(_0x3750f9){return BPromise[_0xc7c3('0x24')](_0x3750f9);}return _0x50ddf6[_0xc7c3('0x25')]();};}function saveUpdates(_0x53a486,_0x5ad51d){return function(_0x3be65c){if(_0x3be65c){return _0x3be65c[_0xc7c3('0x26')](_0x53a486)['then'](function(_0x2e7dd6){return _0x2e7dd6;});}return null;};}function removeEntity(_0x4eec32,_0x2abe2d){return function(_0x306fc5){if(_0x306fc5){return _0x306fc5[_0xc7c3('0x27')]()['then'](function(){_0x4eec32[_0xc7c3('0x1b')](0xcc)[_0xc7c3('0x28')]();});}};}function handleEntityNotFound(_0x3a76e1,_0x1a4bc2){return function(_0x5ec686){if(!_0x5ec686){_0x3a76e1[_0xc7c3('0x29')](0x194);}return _0x5ec686;};}function handleError(_0x822fa2,_0x288017){_0x288017=_0x288017||0x1f4;return function(_0xbd97c5){logger[_0xc7c3('0x2a')](_0xbd97c5[_0xc7c3('0x2b')]);if(_0xbd97c5[_0xc7c3('0x2c')]){delete _0xbd97c5[_0xc7c3('0x2c')];}_0x822fa2['status'](_0x288017)[_0xc7c3('0x2d')](_0xbd97c5);};}exports['index']=function(_0x2319de,_0x1bc308){var _0x58074b={},_0x1c0767={},_0x8fa037={'count':0x0,'rows':[]};var _0x14a492=_[_0xc7c3('0x2e')](db[_0xc7c3('0x2f')][_0xc7c3('0x30')],function(_0xddce8b){return{'name':_0xddce8b[_0xc7c3('0x31')],'type':_0xddce8b['type'][_0xc7c3('0x32')]};});_0x1c0767[_0xc7c3('0x33')]=_[_0xc7c3('0x2e')](_0x14a492,'name');_0x1c0767['query']=_[_0xc7c3('0x34')](_0x2319de['query']);_0x1c0767[_0xc7c3('0x35')]=_[_0xc7c3('0x36')](_0x1c0767[_0xc7c3('0x33')],_0x1c0767[_0xc7c3('0x37')]);_0x58074b[_0xc7c3('0x38')]=_['intersection'](_0x1c0767[_0xc7c3('0x33')],qs[_0xc7c3('0x39')](_0x2319de[_0xc7c3('0x37')][_0xc7c3('0x39')]));_0x58074b[_0xc7c3('0x38')]=_0x58074b[_0xc7c3('0x38')][_0xc7c3('0x3a')]?_0x58074b[_0xc7c3('0x38')]:_0x1c0767['model'];if(!_0x2319de[_0xc7c3('0x37')][_0xc7c3('0x3b')](_0xc7c3('0x3c'))){_0x58074b[_0xc7c3('0x1e')]=qs[_0xc7c3('0x1e')](_0x2319de['query'][_0xc7c3('0x1e')]);_0x58074b['offset']=qs[_0xc7c3('0x20')](_0x2319de[_0xc7c3('0x37')]['offset']);}_0x58074b['order']=qs[_0xc7c3('0x3d')](_0x2319de[_0xc7c3('0x37')]['sort']);_0x58074b['where']=qs[_0xc7c3('0x35')](_['pick'](_0x2319de[_0xc7c3('0x37')],_0x1c0767['filters']),_0x14a492);if(_0x2319de[_0xc7c3('0x37')][_0xc7c3('0x3e')]){_0x58074b[_0xc7c3('0x3f')]=_[_0xc7c3('0x40')](_0x58074b[_0xc7c3('0x3f')],{'$or':_[_0xc7c3('0x2e')](_0x14a492,function(_0x3cac95){if(_0x3cac95[_0xc7c3('0x41')]!==_0xc7c3('0x42')){var _0x4d1e56={};_0x4d1e56[_0x3cac95['name']]={'$like':'%'+_0x2319de[_0xc7c3('0x37')][_0xc7c3('0x3e')]+'%'};return _0x4d1e56;}})});}_0x58074b=_[_0xc7c3('0x40')]({},_0x58074b,_0x2319de['options']);var _0x4c1132={'where':_0x58074b['where']};return db[_0xc7c3('0x2f')][_0xc7c3('0x1f')](_0x4c1132)[_0xc7c3('0x43')](function(_0x3a67f8){_0x8fa037['count']=_0x3a67f8;if(_0x2319de[_0xc7c3('0x37')][_0xc7c3('0x44')]){_0x58074b[_0xc7c3('0x45')]=[{'all':!![]}];}return db['SalesforceField'][_0xc7c3('0x46')](_0x58074b);})[_0xc7c3('0x43')](function(_0x2949a5){_0x8fa037['rows']=_0x2949a5;return _0x8fa037;})[_0xc7c3('0x43')](respondWithFilteredResult(_0x1bc308,_0x58074b))[_0xc7c3('0x47')](handleError(_0x1bc308,null));};exports[_0xc7c3('0x48')]=function(_0x398165,_0x158a14){var _0x5c1789={'raw':!![],'where':{'id':_0x398165['params']['id']}},_0x476802={};_0x476802['model']=_[_0xc7c3('0x34')](db['SalesforceField']['rawAttributes']);_0x476802[_0xc7c3('0x37')]=_[_0xc7c3('0x34')](_0x398165['query']);_0x476802[_0xc7c3('0x35')]=_[_0xc7c3('0x36')](_0x476802[_0xc7c3('0x33')],_0x476802[_0xc7c3('0x37')]);_0x5c1789['attributes']=_['intersection'](_0x476802[_0xc7c3('0x33')],qs[_0xc7c3('0x39')](_0x398165[_0xc7c3('0x37')][_0xc7c3('0x39')]));_0x5c1789[_0xc7c3('0x38')]=_0x5c1789['attributes']['length']?_0x5c1789['attributes']:_0x476802['model'];if(_0x398165[_0xc7c3('0x37')]['includeAll']){_0x5c1789[_0xc7c3('0x45')]=[{'all':!![]}];}_0x5c1789=_[_0xc7c3('0x40')]({},_0x5c1789,_0x398165[_0xc7c3('0x49')]);return db[_0xc7c3('0x2f')]['find'](_0x5c1789)['then'](handleEntityNotFound(_0x158a14,null))['then'](respondWithResult(_0x158a14,null))[_0xc7c3('0x47')](handleError(_0x158a14,null));};exports[_0xc7c3('0x4a')]=function(_0x1db255,_0x2548fa){return db[_0xc7c3('0x2f')][_0xc7c3('0x4a')](_0x1db255[_0xc7c3('0x4b')],{})[_0xc7c3('0x43')](respondWithResult(_0x2548fa,0xc9))[_0xc7c3('0x47')](handleError(_0x2548fa,null));};exports[_0xc7c3('0x26')]=function(_0x5d0820,_0x22a47b){if(_0x5d0820['body']['id']){delete _0x5d0820['body']['id'];}return db[_0xc7c3('0x2f')][_0xc7c3('0x4c')]({'where':{'id':_0x5d0820[_0xc7c3('0x4d')]['id']}})[_0xc7c3('0x43')](handleEntityNotFound(_0x22a47b,null))['then'](saveUpdates(_0x5d0820[_0xc7c3('0x4b')],null))[_0xc7c3('0x43')](respondWithResult(_0x22a47b,null))[_0xc7c3('0x47')](handleError(_0x22a47b,null));};exports[_0xc7c3('0x27')]=function(_0x118998,_0x55e786){return db[_0xc7c3('0x2f')][_0xc7c3('0x4c')]({'where':{'id':_0x118998[_0xc7c3('0x4d')]['id']}})[_0xc7c3('0x43')](handleEntityNotFound(_0x55e786,null))['then'](removeEntity(_0x55e786,null))[_0xc7c3('0x47')](handleError(_0x55e786,null));}; \ No newline at end of file +var _0x8ba1=['../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','index','SalesforceField','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x8ba1,0x119));var _0x18ba=function(_0xdca38e,_0x30cd5f){_0xdca38e=_0xdca38e-0x0;var _0x45eb3d=_0x8ba1[_0xdca38e];return _0x45eb3d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x18ba('0x0'));var jsonpatch=require(_0x18ba('0x1'));var rp=require(_0x18ba('0x2'));var moment=require(_0x18ba('0x3'));var BPromise=require(_0x18ba('0x4'));var Mustache=require('mustache');var util=require(_0x18ba('0x5'));var path=require(_0x18ba('0x6'));var sox=require(_0x18ba('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x18ba('0x8'));var _=require(_0x18ba('0x9'));var squel=require(_0x18ba('0xa'));var crypto=require('crypto');var jsforce=require(_0x18ba('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x18ba('0xc'));var querystring=require(_0x18ba('0xd'));var Papa=require(_0x18ba('0xe'));var Redis=require(_0x18ba('0xf'));var authService=require(_0x18ba('0x10'));var qs=require(_0x18ba('0x11'));var as=require(_0x18ba('0x12'));var hardwareService=require(_0x18ba('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x18ba('0x14'));var config=require(_0x18ba('0x15'));var licenseUtil=require(_0x18ba('0x16'));var db=require(_0x18ba('0x17'))['db'];function respondWithStatusCode(_0x5bd288,_0x443718){_0x443718=_0x443718||0xcc;return function(_0x45da64){if(_0x45da64){return _0x5bd288['sendStatus'](_0x443718);}return _0x5bd288[_0x18ba('0x18')](_0x443718)['end']();};}function respondWithResult(_0xb710bd,_0x4f8df5){_0x4f8df5=_0x4f8df5||0xc8;return function(_0x5881c2){if(_0x5881c2){return _0xb710bd[_0x18ba('0x18')](_0x4f8df5)[_0x18ba('0x19')](_0x5881c2);}};}function respondWithFilteredResult(_0x51076f,_0x277097){return function(_0x1566c0){if(_0x1566c0){var _0x2ada0b=typeof _0x277097[_0x18ba('0x1a')]===_0x18ba('0x1b')&&typeof _0x277097[_0x18ba('0x1c')]==='undefined';var _0x4553af=_0x1566c0['count'];var _0x2181a5=_0x2ada0b?0x0:_0x277097[_0x18ba('0x1a')];var _0x3cc163=_0x2ada0b?_0x1566c0[_0x18ba('0x1d')]:_0x277097[_0x18ba('0x1a')]+_0x277097[_0x18ba('0x1c')];var _0x57ee29;if(_0x3cc163>=_0x4553af){_0x3cc163=_0x4553af;_0x57ee29=0xc8;}else{_0x57ee29=0xce;}_0x51076f[_0x18ba('0x18')](_0x57ee29);return _0x51076f['set'](_0x18ba('0x1e'),_0x2181a5+'-'+_0x3cc163+'/'+_0x4553af)['json'](_0x1566c0);}return null;};}function patchUpdates(_0x153435){return function(_0x2fe94d){try{jsonpatch[_0x18ba('0x1f')](_0x2fe94d,_0x153435,!![]);}catch(_0x5dbece){return BPromise[_0x18ba('0x20')](_0x5dbece);}return _0x2fe94d[_0x18ba('0x21')]();};}function saveUpdates(_0x1177fe,_0x31796e){return function(_0x194716){if(_0x194716){return _0x194716['update'](_0x1177fe)[_0x18ba('0x22')](function(_0x256713){return _0x256713;});}return null;};}function removeEntity(_0x412e76,_0x4246ea){return function(_0x77dbc1){if(_0x77dbc1){return _0x77dbc1[_0x18ba('0x23')]()[_0x18ba('0x22')](function(){_0x412e76[_0x18ba('0x18')](0xcc)[_0x18ba('0x24')]();});}};}function handleEntityNotFound(_0x123e18,_0x862046){return function(_0x3e4bef){if(!_0x3e4bef){_0x123e18[_0x18ba('0x25')](0x194);}return _0x3e4bef;};}function handleError(_0x2c60e0,_0x19599f){_0x19599f=_0x19599f||0x1f4;return function(_0x17f988){logger[_0x18ba('0x26')](_0x17f988[_0x18ba('0x27')]);if(_0x17f988[_0x18ba('0x28')]){delete _0x17f988['name'];}_0x2c60e0[_0x18ba('0x18')](_0x19599f)[_0x18ba('0x29')](_0x17f988);};}exports[_0x18ba('0x2a')]=function(_0x425a6b,_0x1d0ffb){var _0x457693={},_0x141728={},_0x322647={'count':0x0,'rows':[]};var _0x58052d=_['map'](db[_0x18ba('0x2b')]['rawAttributes'],function(_0x10eb3c){return{'name':_0x10eb3c[_0x18ba('0x2c')],'type':_0x10eb3c[_0x18ba('0x2d')][_0x18ba('0x2e')]};});_0x141728[_0x18ba('0x2f')]=_[_0x18ba('0x30')](_0x58052d,'name');_0x141728['query']=_[_0x18ba('0x31')](_0x425a6b[_0x18ba('0x32')]);_0x141728[_0x18ba('0x33')]=_[_0x18ba('0x34')](_0x141728[_0x18ba('0x2f')],_0x141728['query']);_0x457693[_0x18ba('0x35')]=_[_0x18ba('0x34')](_0x141728['model'],qs[_0x18ba('0x36')](_0x425a6b[_0x18ba('0x32')][_0x18ba('0x36')]));_0x457693[_0x18ba('0x35')]=_0x457693[_0x18ba('0x35')][_0x18ba('0x37')]?_0x457693['attributes']:_0x141728[_0x18ba('0x2f')];if(!_0x425a6b[_0x18ba('0x32')][_0x18ba('0x38')](_0x18ba('0x39'))){_0x457693['limit']=qs['limit'](_0x425a6b[_0x18ba('0x32')][_0x18ba('0x1c')]);_0x457693['offset']=qs[_0x18ba('0x1a')](_0x425a6b['query'][_0x18ba('0x1a')]);}_0x457693[_0x18ba('0x3a')]=qs[_0x18ba('0x3b')](_0x425a6b['query'][_0x18ba('0x3b')]);_0x457693[_0x18ba('0x3c')]=qs[_0x18ba('0x33')](_[_0x18ba('0x3d')](_0x425a6b[_0x18ba('0x32')],_0x141728[_0x18ba('0x33')]),_0x58052d);if(_0x425a6b[_0x18ba('0x32')][_0x18ba('0x3e')]){_0x457693[_0x18ba('0x3c')]=_[_0x18ba('0x3f')](_0x457693[_0x18ba('0x3c')],{'$or':_[_0x18ba('0x30')](_0x58052d,function(_0x4b14d7){if(_0x4b14d7['type']!==_0x18ba('0x40')){var _0x1a93bc={};_0x1a93bc[_0x4b14d7[_0x18ba('0x28')]]={'$like':'%'+_0x425a6b[_0x18ba('0x32')][_0x18ba('0x3e')]+'%'};return _0x1a93bc;}})});}_0x457693=_[_0x18ba('0x3f')]({},_0x457693,_0x425a6b[_0x18ba('0x41')]);var _0x1df212={'where':_0x457693['where']};return db[_0x18ba('0x2b')][_0x18ba('0x1d')](_0x1df212)['then'](function(_0x263575){_0x322647[_0x18ba('0x1d')]=_0x263575;if(_0x425a6b['query'][_0x18ba('0x42')]){_0x457693['include']=[{'all':!![]}];}return db[_0x18ba('0x2b')][_0x18ba('0x43')](_0x457693);})[_0x18ba('0x22')](function(_0x77f74f){_0x322647[_0x18ba('0x44')]=_0x77f74f;return _0x322647;})[_0x18ba('0x22')](respondWithFilteredResult(_0x1d0ffb,_0x457693))[_0x18ba('0x45')](handleError(_0x1d0ffb,null));};exports[_0x18ba('0x46')]=function(_0x392cb2,_0x7765b6){var _0x10673e={'raw':!![],'where':{'id':_0x392cb2[_0x18ba('0x47')]['id']}},_0x1c09b4={};_0x1c09b4['model']=_[_0x18ba('0x31')](db['SalesforceField'][_0x18ba('0x48')]);_0x1c09b4[_0x18ba('0x32')]=_[_0x18ba('0x31')](_0x392cb2[_0x18ba('0x32')]);_0x1c09b4[_0x18ba('0x33')]=_[_0x18ba('0x34')](_0x1c09b4['model'],_0x1c09b4['query']);_0x10673e[_0x18ba('0x35')]=_[_0x18ba('0x34')](_0x1c09b4[_0x18ba('0x2f')],qs[_0x18ba('0x36')](_0x392cb2[_0x18ba('0x32')][_0x18ba('0x36')]));_0x10673e[_0x18ba('0x35')]=_0x10673e[_0x18ba('0x35')][_0x18ba('0x37')]?_0x10673e['attributes']:_0x1c09b4['model'];if(_0x392cb2[_0x18ba('0x32')][_0x18ba('0x42')]){_0x10673e[_0x18ba('0x49')]=[{'all':!![]}];}_0x10673e=_[_0x18ba('0x3f')]({},_0x10673e,_0x392cb2[_0x18ba('0x41')]);return db[_0x18ba('0x2b')]['find'](_0x10673e)[_0x18ba('0x22')](handleEntityNotFound(_0x7765b6,null))[_0x18ba('0x22')](respondWithResult(_0x7765b6,null))['catch'](handleError(_0x7765b6,null));};exports[_0x18ba('0x4a')]=function(_0x2ae15e,_0x3674b1){return db['SalesforceField'][_0x18ba('0x4a')](_0x2ae15e[_0x18ba('0x4b')],{})['then'](respondWithResult(_0x3674b1,0xc9))[_0x18ba('0x45')](handleError(_0x3674b1,null));};exports['update']=function(_0x2c25c5,_0x11b3d7){if(_0x2c25c5[_0x18ba('0x4b')]['id']){delete _0x2c25c5['body']['id'];}return db['SalesforceField']['find']({'where':{'id':_0x2c25c5[_0x18ba('0x47')]['id']}})['then'](handleEntityNotFound(_0x11b3d7,null))[_0x18ba('0x22')](saveUpdates(_0x2c25c5[_0x18ba('0x4b')],null))[_0x18ba('0x22')](respondWithResult(_0x11b3d7,null))[_0x18ba('0x45')](handleError(_0x11b3d7,null));};exports['destroy']=function(_0x2ab54a,_0x514925){return db[_0x18ba('0x2b')]['find']({'where':{'id':_0x2ab54a[_0x18ba('0x47')]['id']}})[_0x18ba('0x22')](handleEntityNotFound(_0x514925,null))[_0x18ba('0x22')](removeEntity(_0x514925,null))[_0x18ba('0x45')](handleError(_0x514925,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 8dca204..e6ca090 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 _0x1450=['../../config/environment','./intSalesforceField.attributes','SalesforceField','salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4793fa,_0x4fd5bb){var _0x568033=function(_0x4889e9){while(--_0x4889e9){_0x4793fa['push'](_0x4793fa['shift']());}};_0x568033(++_0x4fd5bb);}(_0x1450,0x164));var _0x0145=function(_0xb56e59,_0x3cd78f){_0xb56e59=_0xb56e59-0x0;var _0x3382dc=_0x1450[_0xb56e59];return _0x3382dc;};'use strict';var _=require(_0x0145('0x0'));var util=require(_0x0145('0x1'));var logger=require(_0x0145('0x2'))(_0x0145('0x3'));var moment=require(_0x0145('0x4'));var BPromise=require(_0x0145('0x5'));var rp=require(_0x0145('0x6'));var fs=require('fs');var path=require(_0x0145('0x7'));var rimraf=require('rimraf');var config=require(_0x0145('0x8'));var attributes=require(_0x0145('0x9'));module['exports']=function(_0xecc2ab,_0x57226f){return _0xecc2ab['define'](_0x0145('0xa'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x0145('0xb'),'fields':[_0x0145('0xc'),_0x0145('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x950e=['salesforce_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields'];(function(_0x17a9dd,_0x578863){var _0x10d833=function(_0x8bcb36){while(--_0x8bcb36){_0x17a9dd['push'](_0x17a9dd['shift']());}};_0x10d833(++_0x578863);}(_0x950e,0xf1));var _0xe950=function(_0x31d866,_0x1e1e3b){_0x31d866=_0x31d866-0x0;var _0x399948=_0x950e[_0x31d866];return _0x399948;};'use strict';var _=require(_0xe950('0x0'));var util=require(_0xe950('0x1'));var logger=require(_0xe950('0x2'))(_0xe950('0x3'));var moment=require(_0xe950('0x4'));var BPromise=require(_0xe950('0x5'));var rp=require(_0xe950('0x6'));var fs=require('fs');var path=require(_0xe950('0x7'));var rimraf=require(_0xe950('0x8'));var config=require(_0xe950('0x9'));var attributes=require(_0xe950('0xa'));module[_0xe950('0xb')]=function(_0x57fe83,_0x5ee161){return _0x57fe83['define'](_0xe950('0xc'),attributes,{'tableName':_0xe950('0xd'),'paranoid':![],'indexes':[{'name':_0xe950('0xe'),'fields':[_0xe950('0xf'),_0xe950('0x10')],'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 c6f7ac7..bacd98a 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 _0xa0d8=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SalesforceField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa0d8,0x11b));var _0x8a0d=function(_0x172090,_0x4621c4){_0x172090=_0x172090-0x0;var _0x21a08e=_0xa0d8[_0x172090];return _0x21a08e;};'use strict';var _=require(_0x8a0d('0x0'));var util=require(_0x8a0d('0x1'));var moment=require(_0x8a0d('0x2'));var BPromise=require(_0x8a0d('0x3'));var rs=require(_0x8a0d('0x4'));var fs=require('fs');var Redis=require(_0x8a0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a0d('0x6'));var logger=require('../../config/logger')(_0x8a0d('0x7'));var config=require(_0x8a0d('0x8'));var jayson=require(_0x8a0d('0x9'));var client=jayson[_0x8a0d('0xa')][_0x8a0d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d3253,_0x20009a,_0x378eea){return new BPromise(function(_0x1dacfe,_0x13f78d){return client[_0x8a0d('0xc')](_0x1d3253,_0x378eea)[_0x8a0d('0xd')](function(_0x452b48){logger[_0x8a0d('0xe')]('SalesforceField,\x20%s,\x20%s',_0x20009a,'request\x20sent');logger[_0x8a0d('0xf')](_0x8a0d('0x10'),_0x20009a,_0x8a0d('0x11'),JSON[_0x8a0d('0x12')](_0x452b48));if(_0x452b48['error']){if(_0x452b48['error']['code']===0x1f4){logger['error']('SalesforceField,\x20%s,\x20%s',_0x20009a,_0x452b48[_0x8a0d('0x13')][_0x8a0d('0x14')]);return _0x13f78d(_0x452b48['error'][_0x8a0d('0x14')]);}logger[_0x8a0d('0x13')](_0x8a0d('0x15'),_0x20009a,_0x452b48[_0x8a0d('0x13')][_0x8a0d('0x14')]);return _0x1dacfe(_0x452b48[_0x8a0d('0x13')][_0x8a0d('0x14')]);}else{logger['info'](_0x8a0d('0x15'),_0x20009a,'request\x20sent');_0x1dacfe(_0x452b48[_0x8a0d('0x16')][_0x8a0d('0x14')]);}})[_0x8a0d('0x17')](function(_0x362fda){logger[_0x8a0d('0x13')](_0x8a0d('0x15'),_0x20009a,_0x362fda);_0x13f78d(_0x362fda);});});} \ No newline at end of file +var _0x9f62=['SalesforceField,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x9f62,0x68));var _0x29f6=function(_0x518e84,_0x4c3e3a){_0x518e84=_0x518e84-0x0;var _0x5ec2d6=_0x9f62[_0x518e84];return _0x5ec2d6;};'use strict';var _=require(_0x29f6('0x0'));var util=require(_0x29f6('0x1'));var moment=require(_0x29f6('0x2'));var BPromise=require(_0x29f6('0x3'));var rs=require(_0x29f6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29f6('0x5'));var logger=require(_0x29f6('0x6'))(_0x29f6('0x7'));var config=require(_0x29f6('0x8'));var jayson=require(_0x29f6('0x9'));var client=jayson[_0x29f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa5cf36,_0x55a306,_0x3f44ee){return new BPromise(function(_0x4db0bc,_0x2d7658){return client[_0x29f6('0xb')](_0xa5cf36,_0x3f44ee)[_0x29f6('0xc')](function(_0x1025eb){logger[_0x29f6('0xd')](_0x29f6('0xe'),_0x55a306,_0x29f6('0xf'));logger['debug'](_0x29f6('0x10'),_0x55a306,_0x29f6('0xf'),JSON['stringify'](_0x1025eb));if(_0x1025eb[_0x29f6('0x11')]){if(_0x1025eb[_0x29f6('0x11')]['code']===0x1f4){logger[_0x29f6('0x11')]('SalesforceField,\x20%s,\x20%s',_0x55a306,_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);return _0x2d7658(_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);}logger[_0x29f6('0x11')]('SalesforceField,\x20%s,\x20%s',_0x55a306,_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);return _0x4db0bc(_0x1025eb[_0x29f6('0x11')][_0x29f6('0x12')]);}else{logger[_0x29f6('0xd')](_0x29f6('0xe'),_0x55a306,'request\x20sent');_0x4db0bc(_0x1025eb['result'][_0x29f6('0x12')]);}})[_0x29f6('0x13')](function(_0x5c35a7){logger[_0x29f6('0x11')](_0x29f6('0xe'),_0x55a306,_0x5c35a7);_0x2d7658(_0x5c35a7);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7374831..b75c776 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 _0x3f19=['delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update'];(function(_0xf4d8ce,_0x40958d){var _0x402583=function(_0x2b93d4){while(--_0x2b93d4){_0xf4d8ce['push'](_0xf4d8ce['shift']());}};_0x402583(++_0x40958d);}(_0x3f19,0xc0));var _0x93f1=function(_0x41f936,_0x217ec3){_0x41f936=_0x41f936-0x0;var _0x11a6fe=_0x3f19[_0x41f936];return _0x11a6fe;};'use strict';var multer=require(_0x93f1('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x93f1('0x1'));var router=express['Router']();var fs_extra=require(_0x93f1('0x2'));var auth=require(_0x93f1('0x3'));var interaction=require(_0x93f1('0x4'));var config=require(_0x93f1('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x93f1('0x6')]('/',auth[_0x93f1('0x7')](),controller[_0x93f1('0x8')]);router[_0x93f1('0x6')](_0x93f1('0x9'),auth[_0x93f1('0x7')](),controller['show']);router[_0x93f1('0x6')](_0x93f1('0xa'),auth[_0x93f1('0x7')](),controller[_0x93f1('0xb')]);router[_0x93f1('0x6')]('/:id/fields',auth[_0x93f1('0x7')](),controller[_0x93f1('0xc')]);router[_0x93f1('0xd')]('/',auth[_0x93f1('0x7')](),controller[_0x93f1('0xe')]);router[_0x93f1('0xd')](_0x93f1('0xa'),auth[_0x93f1('0x7')](),controller[_0x93f1('0xf')]);router[_0x93f1('0x10')]('/:id',auth[_0x93f1('0x7')](),controller[_0x93f1('0x11')]);router[_0x93f1('0x12')](_0x93f1('0x9'),auth['isAuthenticated'](),controller[_0x93f1('0x13')]);module[_0x93f1('0x14')]=router; \ No newline at end of file +var _0x2504=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getFields','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x574233,_0x5ca3ff){var _0x5595ab=function(_0x196e2b){while(--_0x196e2b){_0x574233['push'](_0x574233['shift']());}};_0x5595ab(++_0x5ca3ff);}(_0x2504,0xee));var _0x4250=function(_0x2d0f26,_0x209a8c){_0x2d0f26=_0x2d0f26-0x0;var _0x35dfd5=_0x2504[_0x2d0f26];return _0x35dfd5;};'use strict';var multer=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var path=require(_0x4250('0x2'));var timeout=require(_0x4250('0x3'));var express=require(_0x4250('0x4'));var router=express[_0x4250('0x5')]();var fs_extra=require(_0x4250('0x6'));var auth=require(_0x4250('0x7'));var interaction=require(_0x4250('0x8'));var config=require(_0x4250('0x9'));var controller=require(_0x4250('0xa'));router[_0x4250('0xb')]('/',auth['isAuthenticated'](),controller[_0x4250('0xc')]);router['get']('/:id',auth[_0x4250('0xd')](),controller[_0x4250('0xe')]);router[_0x4250('0xb')](_0x4250('0xf'),auth[_0x4250('0xd')](),controller['getConfigurations']);router[_0x4250('0xb')]('/:id/fields',auth[_0x4250('0xd')](),controller[_0x4250('0x10')]);router['post']('/',auth[_0x4250('0xd')](),controller['create']);router['post'](_0x4250('0xf'),auth[_0x4250('0xd')](),controller[_0x4250('0x11')]);router[_0x4250('0x12')](_0x4250('0x13'),auth['isAuthenticated'](),controller[_0x4250('0x14')]);router[_0x4250('0x15')](_0x4250('0x13'),auth[_0x4250('0xd')](),controller[_0x4250('0x16')]);module[_0x4250('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index bab32ff..a48d9e2 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 _0x6b4b=['remoteUri','sequelize','exports','STRING'];(function(_0x689e16,_0x176daf){var _0xf6f855=function(_0x3c4b0d){while(--_0x3c4b0d){_0x689e16['push'](_0x689e16['shift']());}};_0xf6f855(++_0x176daf);}(_0x6b4b,0x14d));var _0xb6b4=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x6b4b[_0x4dc7b9];return _0x3ab114;};'use strict';var Sequelize=require(_0xb6b4('0x0'));module[_0xb6b4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0xb6b4('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb6b4('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1b42=['username','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x1b42,0x13f));var _0x21b4=function(_0x465a8a,_0x3617ac){_0x465a8a=_0x465a8a-0x0;var _0x143d84=_0x1b42[_0x465a8a];return _0x143d84;};'use strict';var Sequelize=require('sequelize');module[_0x21b4('0x0')]={'name':{'type':Sequelize[_0x21b4('0x1')]},'description':{'type':Sequelize[_0x21b4('0x1')]},'username':{'type':Sequelize[_0x21b4('0x1')],'unique':_0x21b4('0x2')},'password':{'type':Sequelize[_0x21b4('0x1')]},'email':{'type':Sequelize[_0x21b4('0x1')]},'remoteUri':{'type':Sequelize[_0x21b4('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x21b4('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index dad5656..79ff433 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 _0x40be=['approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','sla_due','approval','due_date','reopen_count','correlation_id','location','email','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','forEach','internalType','all','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','inactive','false','value','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','reject','update','then','end','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','length','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','order','addConfiguration','AccountId','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','work_end','reopened_time'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x40be,0x19f));var _0xe40b=function(_0x327403,_0x330f97){_0x327403=_0x327403-0x0;var _0xb97db5=_0x40be[_0x327403];return _0xb97db5;};'use strict';var emlformat=require(_0xe40b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe40b('0x1'));var jsonpatch=require(_0xe40b('0x2'));var rp=require(_0xe40b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe40b('0x4'));var util=require(_0xe40b('0x5'));var path=require(_0xe40b('0x6'));var sox=require(_0xe40b('0x7'));var csv=require(_0xe40b('0x8'));var ejs=require(_0xe40b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe40b('0xa'));var squel=require(_0xe40b('0xb'));var crypto=require(_0xe40b('0xc'));var jsforce=require(_0xe40b('0xd'));var deskjs=require(_0xe40b('0xe'));var toCsv=require(_0xe40b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe40b('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe40b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe40b('0x11'));var utils=require(_0xe40b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xe40b('0x13'));var db=require(_0xe40b('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3c7740,_0x23a683){_0x23a683=_0x23a683||0xcc;return function(_0x48532b){if(_0x48532b){return _0x3c7740[_0xe40b('0x15')](_0x23a683);}return _0x3c7740['status'](_0x23a683)['end']();};}function respondWithResult(_0x1b8e59,_0x5d8386){_0x5d8386=_0x5d8386||0xc8;return function(_0x23b17a){if(_0x23b17a){return _0x1b8e59[_0xe40b('0x16')](_0x5d8386)[_0xe40b('0x17')](_0x23b17a);}};}function respondWithFilteredResult(_0x26eaad,_0x3a331f){return function(_0x2eec82){if(_0x2eec82){var _0x26053c=typeof _0x3a331f['offset']===_0xe40b('0x18')&&typeof _0x3a331f[_0xe40b('0x19')]===_0xe40b('0x18');var _0x40430c=_0x2eec82[_0xe40b('0x1a')];var _0x106e96=_0x26053c?0x0:_0x3a331f[_0xe40b('0x1b')];var _0x21c7ce=_0x26053c?_0x2eec82['count']:_0x3a331f[_0xe40b('0x1b')]+_0x3a331f[_0xe40b('0x19')];var _0x16d13f;if(_0x21c7ce>=_0x40430c){_0x21c7ce=_0x40430c;_0x16d13f=0xc8;}else{_0x16d13f=0xce;}_0x26eaad[_0xe40b('0x16')](_0x16d13f);return _0x26eaad['set']('Content-Range',_0x106e96+'-'+_0x21c7ce+'/'+_0x40430c)[_0xe40b('0x17')](_0x2eec82);}return null;};}function patchUpdates(_0x113635){return function(_0x3610ea){try{jsonpatch['apply'](_0x3610ea,_0x113635,!![]);}catch(_0x159ca2){return BPromise[_0xe40b('0x1c')](_0x159ca2);}return _0x3610ea['save']();};}function saveUpdates(_0x51848d,_0x232043){return function(_0x5c397a){if(_0x5c397a){return _0x5c397a[_0xe40b('0x1d')](_0x51848d)[_0xe40b('0x1e')](function(_0x2ee04c){return _0x2ee04c;});}return null;};}function removeEntity(_0x329383,_0x1154b5){return function(_0x3c02d3){if(_0x3c02d3){return _0x3c02d3['destroy']()[_0xe40b('0x1e')](function(){_0x329383['status'](0xcc)[_0xe40b('0x1f')]();});}};}function handleEntityNotFound(_0x31f7d5,_0x7f1e0a){return function(_0x41f37a){if(!_0x41f37a){_0x31f7d5[_0xe40b('0x15')](0x194);}return _0x41f37a;};}function handleError(_0x2d29dd,_0x385f11){_0x385f11=_0x385f11||0x1f4;return function(_0xfb7fed){logger[_0xe40b('0x20')](_0xfb7fed[_0xe40b('0x21')]);if(_0xfb7fed[_0xe40b('0x22')]){delete _0xfb7fed[_0xe40b('0x22')];}_0x2d29dd[_0xe40b('0x16')](_0x385f11)[_0xe40b('0x23')](_0xfb7fed);};}exports[_0xe40b('0x24')]=function(_0x5bc7fb,_0x3d48c4){var _0x35fefb={},_0xa04275={},_0x31adf5={'count':0x0,'rows':[]};var _0x3db048=_[_0xe40b('0x25')](db[_0xe40b('0x26')][_0xe40b('0x27')],function(_0x33f26f){return{'name':_0x33f26f[_0xe40b('0x28')],'type':_0x33f26f[_0xe40b('0x29')]['key']};});_0xa04275[_0xe40b('0x2a')]=_[_0xe40b('0x25')](_0x3db048,_0xe40b('0x22'));_0xa04275['query']=_['keys'](_0x5bc7fb[_0xe40b('0x2b')]);_0xa04275[_0xe40b('0x2c')]=_[_0xe40b('0x2d')](_0xa04275[_0xe40b('0x2a')],_0xa04275['query']);_0x35fefb[_0xe40b('0x2e')]=_[_0xe40b('0x2d')](_0xa04275[_0xe40b('0x2a')],qs['fields'](_0x5bc7fb[_0xe40b('0x2b')][_0xe40b('0x2f')]));_0x35fefb[_0xe40b('0x2e')]=_0x35fefb[_0xe40b('0x2e')]['length']?_0x35fefb[_0xe40b('0x2e')]:_0xa04275[_0xe40b('0x2a')];if(!_0x5bc7fb[_0xe40b('0x2b')][_0xe40b('0x30')](_0xe40b('0x31'))){_0x35fefb['limit']=qs[_0xe40b('0x19')](_0x5bc7fb[_0xe40b('0x2b')][_0xe40b('0x19')]);_0x35fefb['offset']=qs[_0xe40b('0x1b')](_0x5bc7fb['query'][_0xe40b('0x1b')]);}_0x35fefb['order']=qs[_0xe40b('0x32')](_0x5bc7fb[_0xe40b('0x2b')]['sort']);_0x35fefb[_0xe40b('0x33')]=qs[_0xe40b('0x2c')](_[_0xe40b('0x34')](_0x5bc7fb[_0xe40b('0x2b')],_0xa04275[_0xe40b('0x2c')]),_0x3db048);if(_0x5bc7fb['query'][_0xe40b('0x35')]){_0x35fefb[_0xe40b('0x33')]=_['merge'](_0x35fefb['where'],{'$or':_[_0xe40b('0x25')](_0x3db048,function(_0xaa43be){if(_0xaa43be['type']!==_0xe40b('0x36')){var _0x29d9f6={};_0x29d9f6[_0xaa43be[_0xe40b('0x22')]]={'$like':'%'+_0x5bc7fb[_0xe40b('0x2b')][_0xe40b('0x35')]+'%'};return _0x29d9f6;}})});}_0x35fefb=_[_0xe40b('0x37')]({},_0x35fefb,_0x5bc7fb[_0xe40b('0x38')]);var _0x28d1ec={'where':_0x35fefb[_0xe40b('0x33')]};return db[_0xe40b('0x26')][_0xe40b('0x1a')](_0x28d1ec)['then'](function(_0xa4bdce){_0x31adf5[_0xe40b('0x1a')]=_0xa4bdce;if(_0x5bc7fb[_0xe40b('0x2b')][_0xe40b('0x39')]){_0x35fefb[_0xe40b('0x3a')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x35fefb);})[_0xe40b('0x1e')](function(_0x4c8f49){_0x31adf5[_0xe40b('0x3b')]=_0x4c8f49;return _0x31adf5;})[_0xe40b('0x1e')](respondWithFilteredResult(_0x3d48c4,_0x35fefb))[_0xe40b('0x3c')](handleError(_0x3d48c4,null));};exports[_0xe40b('0x3d')]=function(_0x378272,_0x157f73){var _0x3ccb42={'raw':![],'where':{'id':_0x378272[_0xe40b('0x3e')]['id']}},_0x2e359d={};_0x2e359d[_0xe40b('0x2a')]=_['keys'](db[_0xe40b('0x26')][_0xe40b('0x27')]);_0x2e359d[_0xe40b('0x2b')]=_[_0xe40b('0x3f')](_0x378272[_0xe40b('0x2b')]);_0x2e359d['filters']=_[_0xe40b('0x2d')](_0x2e359d['model'],_0x2e359d['query']);_0x3ccb42[_0xe40b('0x2e')]=_[_0xe40b('0x2d')](_0x2e359d['model'],qs['fields'](_0x378272['query']['fields']));_0x3ccb42[_0xe40b('0x2e')]=_0x3ccb42[_0xe40b('0x2e')][_0xe40b('0x40')]?_0x3ccb42['attributes']:_0x2e359d[_0xe40b('0x2a')];if(_0x378272['query']['includeAll']){_0x3ccb42[_0xe40b('0x3a')]=[{'all':!![]}];}_0x3ccb42=_[_0xe40b('0x37')]({},_0x3ccb42,_0x378272['options']);return db[_0xe40b('0x26')][_0xe40b('0x41')](_0x3ccb42)[_0xe40b('0x1e')](handleEntityNotFound(_0x157f73,null))[_0xe40b('0x1e')](respondWithResult(_0x157f73,null))[_0xe40b('0x3c')](handleError(_0x157f73,null));};exports['create']=function(_0x3197f8,_0x180900){return db[_0xe40b('0x26')][_0xe40b('0x42')](_0x3197f8[_0xe40b('0x43')],{})['then'](respondWithResult(_0x180900,0xc9))['catch'](handleError(_0x180900,null));};exports[_0xe40b('0x1d')]=function(_0xfaeb54,_0x350386){if(_0xfaeb54[_0xe40b('0x43')]['id']){delete _0xfaeb54[_0xe40b('0x43')]['id'];}return db['ServicenowAccount'][_0xe40b('0x41')]({'where':{'id':_0xfaeb54[_0xe40b('0x3e')]['id']}})[_0xe40b('0x1e')](handleEntityNotFound(_0x350386,null))['then'](saveUpdates(_0xfaeb54[_0xe40b('0x43')],null))[_0xe40b('0x1e')](respondWithResult(_0x350386,null))[_0xe40b('0x3c')](handleError(_0x350386,null));};exports[_0xe40b('0x44')]=function(_0x59f648,_0x101485){return db['ServicenowAccount'][_0xe40b('0x41')]({'where':{'id':_0x59f648[_0xe40b('0x3e')]['id']}})[_0xe40b('0x1e')](handleEntityNotFound(_0x101485,null))[_0xe40b('0x1e')](removeEntity(_0x101485,null))['catch'](handleError(_0x101485,null));};exports[_0xe40b('0x45')]=function(_0xc3faaf,_0x271fef,_0x38834e){var _0x36cb3f={};var _0x497d97={};var _0x2f483f;var _0x5482c7;return db[_0xe40b('0x26')][_0xe40b('0x46')]({'where':{'id':_0xc3faaf[_0xe40b('0x3e')]['id']}})[_0xe40b('0x1e')](handleEntityNotFound(_0x271fef,null))['then'](function(_0x5b9918){if(_0x5b9918){_0x2f483f=_0x5b9918;_0x497d97[_0xe40b('0x2a')]=_[_0xe40b('0x3f')](db[_0xe40b('0x47')][_0xe40b('0x27')]);_0x497d97[_0xe40b('0x2b')]=_[_0xe40b('0x3f')](_0xc3faaf[_0xe40b('0x2b')]);_0x497d97[_0xe40b('0x2c')]=_[_0xe40b('0x2d')](_0x497d97[_0xe40b('0x2a')],_0x497d97[_0xe40b('0x2b')]);_0x36cb3f[_0xe40b('0x2e')]=_[_0xe40b('0x2d')](_0x497d97['model'],qs[_0xe40b('0x2f')](_0xc3faaf[_0xe40b('0x2b')][_0xe40b('0x2f')]));_0x36cb3f[_0xe40b('0x2e')]=_0x36cb3f['attributes'][_0xe40b('0x40')]?_0x36cb3f[_0xe40b('0x2e')]:_0x497d97['model'];_0x36cb3f[_0xe40b('0x48')]=qs[_0xe40b('0x32')](_0xc3faaf[_0xe40b('0x2b')][_0xe40b('0x32')]);_0x36cb3f[_0xe40b('0x33')]=qs['filters'](_[_0xe40b('0x34')](_0xc3faaf[_0xe40b('0x2b')],_0x497d97['filters']));if(_0xc3faaf[_0xe40b('0x2b')][_0xe40b('0x35')]){_0x36cb3f[_0xe40b('0x33')]=_['merge'](_0x36cb3f[_0xe40b('0x33')],{'$or':_[_0xe40b('0x25')](_0x36cb3f[_0xe40b('0x2e')],function(_0x4387ac){var _0x28bfcc={};_0x28bfcc[_0x4387ac]={'$like':'%'+_0xc3faaf[_0xe40b('0x2b')][_0xe40b('0x35')]+'%'};return _0x28bfcc;})});}_0x36cb3f=_['merge']({},_0x36cb3f,_0xc3faaf[_0xe40b('0x38')]);return _0x2f483f[_0xe40b('0x45')](_0x36cb3f);}})['then'](function(_0x342f8f){if(_0x342f8f){_0x5482c7=_0x342f8f[_0xe40b('0x40')];if(!_0xc3faaf[_0xe40b('0x2b')]['hasOwnProperty'](_0xe40b('0x31'))){_0x36cb3f[_0xe40b('0x19')]=qs[_0xe40b('0x19')](_0xc3faaf[_0xe40b('0x2b')][_0xe40b('0x19')]);_0x36cb3f['offset']=qs[_0xe40b('0x1b')](_0xc3faaf[_0xe40b('0x2b')][_0xe40b('0x1b')]);}return _0x2f483f[_0xe40b('0x45')](_0x36cb3f);}})[_0xe40b('0x1e')](function(_0x1903cc){if(_0x1903cc){return _0x1903cc?{'count':_0x5482c7,'rows':_0x1903cc}:null;}})['then'](respondWithResult(_0x271fef,null))[_0xe40b('0x3c')](handleError(_0x271fef,null));};exports[_0xe40b('0x49')]=function(_0x37f0f2,_0x251f15,_0x5e6a6e){if(_0x37f0f2[_0xe40b('0x43')]['id']){delete _0x37f0f2[_0xe40b('0x43')]['id'];}return db[_0xe40b('0x26')][_0xe40b('0x46')]({'where':{'id':_0x37f0f2[_0xe40b('0x3e')]['id']}})[_0xe40b('0x1e')](handleEntityNotFound(_0x251f15,null))[_0xe40b('0x1e')](function(_0x4d5e70){if(_0x4d5e70){_0x37f0f2[_0xe40b('0x43')][_0xe40b('0x4a')]=_0x4d5e70['id'];_0x37f0f2[_0xe40b('0x43')]['Subjects']=integrations['getSubjects'](_0x37f0f2[_0xe40b('0x43')][_0xe40b('0x4b')],_0x37f0f2[_0xe40b('0x43')][_0xe40b('0x29')]);_0x37f0f2['body'][_0xe40b('0x4c')]=integrations[_0xe40b('0x4d')](_0x37f0f2[_0xe40b('0x43')][_0xe40b('0x4b')],_0x37f0f2[_0xe40b('0x43')]['type']);return db[_0xe40b('0x47')][_0xe40b('0x42')](_0x37f0f2[_0xe40b('0x43')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0xe40b('0x4e')],'as':_0xe40b('0x4c')}]});}return null;})[_0xe40b('0x1e')](respondWithResult(_0x251f15,null))['catch'](handleError(_0x251f15,null));};exports['getFields']=function(_0x574b57,_0x4a6988,_0xe19ceb){var _0x51937c=[_0xe40b('0x4f'),_0xe40b('0x50'),_0xe40b('0x51'),_0xe40b('0x52'),'close_code',_0xe40b('0x53'),_0xe40b('0x54'),_0xe40b('0x55'),_0xe40b('0x56')];var _0x3b519e=[_0xe40b('0x57'),'made_sla','caused_by',_0xe40b('0x58'),_0xe40b('0x59'),_0xe40b('0x5a'),_0xe40b('0x5b'),_0xe40b('0x50'),_0xe40b('0x5c'),_0xe40b('0x5d'),_0xe40b('0x5e'),_0xe40b('0x5f'),'opened_by',_0xe40b('0x60'),_0xe40b('0x61'),'sys_domain',_0xe40b('0x62'),_0xe40b('0x63'),_0xe40b('0x51'),_0xe40b('0x48'),_0xe40b('0x64'),_0xe40b('0x65'),'cmdb_ci','delivery_plan',_0xe40b('0x66'),_0xe40b('0x67'),_0xe40b('0x68'),_0xe40b('0x69'),_0xe40b('0x6a'),_0xe40b('0x6b'),_0xe40b('0x6c'),_0xe40b('0x6d'),'expected_start',_0xe40b('0x6e'),'business_duration','group_list',_0xe40b('0x6f'),_0xe40b('0x70'),'resolved_at','caller_id',_0xe40b('0x71'),'subcategory',_0xe40b('0x72'),_0xe40b('0x73'),'close_code',_0xe40b('0x74'),'delivery_task',_0xe40b('0x75'),_0xe40b('0x76'),_0xe40b('0x77'),_0xe40b('0x78'),_0xe40b('0x79'),_0xe40b('0x7a'),_0xe40b('0x53'),_0xe40b('0x7b'),_0xe40b('0x7c'),_0xe40b('0x7d'),_0xe40b('0x7e'),_0xe40b('0x7f'),_0xe40b('0x80'),'contact_type',_0xe40b('0x81'),_0xe40b('0x54'),_0xe40b('0x82'),_0xe40b('0x83'),_0xe40b('0x84'),_0xe40b('0x85'),_0xe40b('0x86'),'assigned_to',_0xe40b('0x55'),'comments',_0xe40b('0x87'),_0xe40b('0x88'),'comments_and_work_notes',_0xe40b('0x89'),'sys_mod_count',_0xe40b('0x8a'),'sys_tags','escalation','upon_approval',_0xe40b('0x8b'),_0xe40b('0x8c'),_0xe40b('0x56')];var _0x371dcb='';var _0x52332f='';var _0x55ba8c=[];var _0x22b523='';var _0x11f7cf='';var _0x16aa67=[];var _0x3984c8='';var _0x1e9054='';var _0x404d1b={};var _0x4b9fbc='';return db[_0xe40b('0x26')][_0xe40b('0x46')]({'where':{'id':_0x574b57[_0xe40b('0x3e')]['id']},'attributes':['id','username','password',_0xe40b('0x8d'),_0xe40b('0x8e'),'serverUrl']})[_0xe40b('0x1e')](handleEntityNotFound(_0x4a6988,null))[_0xe40b('0x1e')](function(_0x51a4ca){if(_0x51a4ca){_0x4b9fbc=_0x51a4ca['remoteUri'];var _0xed7db5=_0x4b9fbc[_0xe40b('0x8f')](-0x1);if(_0xed7db5==='/'){_0x4b9fbc=_0x4b9fbc[_0xe40b('0x90')](0x0,_0x4b9fbc[_0xe40b('0x91')](_0xed7db5));}_0x1e9054=util[_0xe40b('0x92')](_0xe40b('0x93'),_0x4b9fbc);_0x3984c8=util[_0xe40b('0x92')](_0xe40b('0x94'),_0x4b9fbc);_0x404d1b={'user':_0x51a4ca['username'],'pass':_0x51a4ca[_0xe40b('0x95')]};var _0x339109={'method':_0xe40b('0x96'),'uri':_0x1e9054+_0xe40b('0x97'),'auth':_0x404d1b,'json':!![]};return rp(_0x339109);}})['then'](function(_0x567334){if(_0x567334['result'][_0xe40b('0x40')]>0x0){_0x371dcb=_0x567334[_0xe40b('0x98')];}console[_0xe40b('0x99')](_0xe40b('0x9a'),_0x371dcb);_0x16aa67=[];_0x52332f=Object[_0xe40b('0x9b')]([],_0x371dcb);_[_0xe40b('0x9c')](_0x52332f,function(_0x136826){return!_0x51937c['includes'](_0x136826[_0xe40b('0x22')]);});_0x52332f[_0xe40b('0x9d')](function(_0x50f804){var _0x28fb4c=createFieldObject(_0x3984c8,_0x404d1b,_0x50f804[_0xe40b('0x9e')],_0x50f804[_0xe40b('0x22')],_0x50f804['label'],![]);_0x16aa67['push'](_0x28fb4c);});return Promise[_0xe40b('0x9f')](_0x16aa67);})[_0xe40b('0x1e')](function(_0x1fcd36){_0x55ba8c=_0x1fcd36;_0x22b523=Object[_0xe40b('0x9b')]([],_0x371dcb);console[_0xe40b('0x99')]('TCL:\x20_object',_0x371dcb);_[_0xe40b('0x9c')](_0x22b523,function(_0x44832b){return _0x3b519e[_0xe40b('0xa0')](_0x44832b['name']);});console[_0xe40b('0x99')](_0xe40b('0xa1'),_0x22b523);_0x16aa67=[];_0x22b523['forEach'](function(_0xdda6f5){var _0x4f86a8=createFieldObject(_0x3984c8,_0x404d1b,_0xdda6f5[_0xe40b('0x9e')],_0xdda6f5[_0xe40b('0x22')],_0xdda6f5[_0xe40b('0xa2')],!![]);_0x16aa67[_0xe40b('0xa3')](_0x4f86a8);});return Promise['all'](_0x16aa67);})[_0xe40b('0x1e')](function(_0x822309){_0x11f7cf=_0x822309;var _0x212479=_0x55ba8c[_0xe40b('0xa4')](_0x11f7cf);return{'count':_0x212479[_0xe40b('0x40')],'rows':_0x212479};})['then'](respondWithResult(_0x4a6988,null))[_0xe40b('0x3c')](function(_0x141281){console[_0xe40b('0x99')](_0xe40b('0xa5')+_0x141281);var _0x40b01d=_0x574b57[_0xe40b('0x2b')][_0xe40b('0xa6')]?0x1f4:_0x141281[_0xe40b('0xa7')]||0x1f4;logger[_0xe40b('0x20')](_0x141281[_0xe40b('0x21')]);delete _0x141281[_0xe40b('0x22')];if(_0x40b01d===0x191){_0x40b01d=0x190;}_0x4a6988[_0xe40b('0x16')](_0x40b01d)[_0xe40b('0x23')](_0x574b57[_0xe40b('0x2b')]['test']?{'message':_0xe40b('0xa8'),'statusCode':_0x141281['statusCode']}:_0x141281);});};function createFieldObject(_0x3d67b3,_0x4c3f06,_0x4c01b6,_0xcd3fcf,_0x3a596a,_0x282978){return new Promise(function(_0x5ec9c3,_0x415fb7){var _0x1844fc={'id':_0xcd3fcf,'name':_0x3a596a,'custom':_0x282978};if(_0x4c01b6===_0xe40b('0xa9')){_0x1844fc[_0xe40b('0x38')]=[{'name':_0xe40b('0xaa'),'value':_0xe40b('0xab')},{'name':_0xe40b('0xac'),'value':'false'}];_0x5ec9c3(_0x1844fc);}else{var _0xc23797={'method':_0xe40b('0x96'),'uri':_0x3d67b3+'sys_choice?sysparm_query=name=incident^element='+_0xcd3fcf,'auth':_0x4c3f06,'json':!![]};return rp(_0xc23797)[_0xe40b('0x1e')](function(_0x3e10ab){var _0x3c5e1f=[];if(_0x3e10ab[_0xe40b('0x98')]['length']>0x0){_0x3e10ab[_0xe40b('0x98')][_0xe40b('0x9d')](function(_0x8beb01){if(_0x8beb01[_0xe40b('0xad')]===_0xe40b('0xae')){var _0x17821c={'name':_0x8beb01[_0xe40b('0xa2')],'value':_0x8beb01[_0xe40b('0xaf')]};_0x3c5e1f[_0xe40b('0xa3')](_0x17821c);}});}_0x1844fc[_0xe40b('0x38')]=_0x3c5e1f;if(_0x1844fc['options'][_0xe40b('0x40')]>0x0){_0x5ec9c3(_0x1844fc);}else{if(_0x282978==![]){_0x5ec9c3();}else{_0x5ec9c3(_0x1844fc);}}});}});} \ No newline at end of file +var _0x8bea=['inactive','value','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','ServicenowConfiguration','getConfigurations','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','opened_at','group_list','work_end','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','includes','forEach','internalType','label','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','push','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','true','false','sys_choice?sysparm_query=name=incident^element='];(function(_0x5d2f3c,_0x27d2db){var _0x21f77a=function(_0x5e3eae){while(--_0x5e3eae){_0x5d2f3c['push'](_0x5d2f3c['shift']());}};_0x21f77a(++_0x27d2db);}(_0x8bea,0xc1));var _0xa8be=function(_0x473ac3,_0xf8066a){_0x473ac3=_0x473ac3-0x0;var _0x563cfd=_0x8bea[_0x473ac3];return _0x563cfd;};'use strict';var emlformat=require(_0xa8be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa8be('0x1'));var jsonpatch=require(_0xa8be('0x2'));var rp=require('request-promise');var moment=require(_0xa8be('0x3'));var BPromise=require(_0xa8be('0x4'));var Mustache=require(_0xa8be('0x5'));var util=require(_0xa8be('0x6'));var path=require(_0xa8be('0x7'));var sox=require(_0xa8be('0x8'));var csv=require(_0xa8be('0x9'));var ejs=require(_0xa8be('0xa'));var fs=require('fs');var fs_extra=require(_0xa8be('0xb'));var _=require(_0xa8be('0xc'));var squel=require(_0xa8be('0xd'));var crypto=require(_0xa8be('0xe'));var jsforce=require(_0xa8be('0xf'));var deskjs=require(_0xa8be('0x10'));var toCsv=require(_0xa8be('0x9'));var querystring=require(_0xa8be('0x11'));var Papa=require(_0xa8be('0x12'));var Redis=require(_0xa8be('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xa8be('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa8be('0x15'))('api');var utils=require(_0xa8be('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xa8be('0x17'));function respondWithStatusCode(_0x19bc0f,_0x4adf5c){_0x4adf5c=_0x4adf5c||0xcc;return function(_0x44167d){if(_0x44167d){return _0x19bc0f[_0xa8be('0x18')](_0x4adf5c);}return _0x19bc0f['status'](_0x4adf5c)['end']();};}function respondWithResult(_0x5885f2,_0x11a122){_0x11a122=_0x11a122||0xc8;return function(_0x4615d1){if(_0x4615d1){return _0x5885f2[_0xa8be('0x19')](_0x11a122)[_0xa8be('0x1a')](_0x4615d1);}};}function respondWithFilteredResult(_0x29e2bc,_0x187bb1){return function(_0x2351cb){if(_0x2351cb){var _0x2942fd=typeof _0x187bb1[_0xa8be('0x1b')]===_0xa8be('0x1c')&&typeof _0x187bb1[_0xa8be('0x1d')]==='undefined';var _0x2e6164=_0x2351cb['count'];var _0x495460=_0x2942fd?0x0:_0x187bb1[_0xa8be('0x1b')];var _0x69e0f=_0x2942fd?_0x2351cb[_0xa8be('0x1e')]:_0x187bb1[_0xa8be('0x1b')]+_0x187bb1[_0xa8be('0x1d')];var _0x195fad;if(_0x69e0f>=_0x2e6164){_0x69e0f=_0x2e6164;_0x195fad=0xc8;}else{_0x195fad=0xce;}_0x29e2bc[_0xa8be('0x19')](_0x195fad);return _0x29e2bc[_0xa8be('0x1f')](_0xa8be('0x20'),_0x495460+'-'+_0x69e0f+'/'+_0x2e6164)[_0xa8be('0x1a')](_0x2351cb);}return null;};}function patchUpdates(_0x40d1ac){return function(_0x580bfd){try{jsonpatch[_0xa8be('0x21')](_0x580bfd,_0x40d1ac,!![]);}catch(_0x305437){return BPromise[_0xa8be('0x22')](_0x305437);}return _0x580bfd[_0xa8be('0x23')]();};}function saveUpdates(_0x1cb876,_0x5dc77a){return function(_0x315c4b){if(_0x315c4b){return _0x315c4b[_0xa8be('0x24')](_0x1cb876)[_0xa8be('0x25')](function(_0x219ce8){return _0x219ce8;});}return null;};}function removeEntity(_0x3f1302,_0x4b60ec){return function(_0x5865f5){if(_0x5865f5){return _0x5865f5[_0xa8be('0x26')]()[_0xa8be('0x25')](function(){_0x3f1302['status'](0xcc)[_0xa8be('0x27')]();});}};}function handleEntityNotFound(_0x3a67ce,_0xd09b78){return function(_0x1273e3){if(!_0x1273e3){_0x3a67ce[_0xa8be('0x18')](0x194);}return _0x1273e3;};}function handleError(_0x411a28,_0x1f09cc){_0x1f09cc=_0x1f09cc||0x1f4;return function(_0x3b406b){logger[_0xa8be('0x28')](_0x3b406b[_0xa8be('0x29')]);if(_0x3b406b[_0xa8be('0x2a')]){delete _0x3b406b['name'];}_0x411a28[_0xa8be('0x19')](_0x1f09cc)[_0xa8be('0x2b')](_0x3b406b);};}exports[_0xa8be('0x2c')]=function(_0x5abdc9,_0x4b461f){var _0x462971={},_0x3b607e={},_0x43ff41={'count':0x0,'rows':[]};var _0x2b3e2c=_[_0xa8be('0x2d')](db[_0xa8be('0x2e')][_0xa8be('0x2f')],function(_0x110f16){return{'name':_0x110f16[_0xa8be('0x30')],'type':_0x110f16[_0xa8be('0x31')][_0xa8be('0x32')]};});_0x3b607e[_0xa8be('0x33')]=_[_0xa8be('0x2d')](_0x2b3e2c,'name');_0x3b607e[_0xa8be('0x34')]=_[_0xa8be('0x35')](_0x5abdc9[_0xa8be('0x34')]);_0x3b607e[_0xa8be('0x36')]=_['intersection'](_0x3b607e['model'],_0x3b607e[_0xa8be('0x34')]);_0x462971[_0xa8be('0x37')]=_[_0xa8be('0x38')](_0x3b607e[_0xa8be('0x33')],qs[_0xa8be('0x39')](_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x39')]));_0x462971['attributes']=_0x462971[_0xa8be('0x37')][_0xa8be('0x3a')]?_0x462971['attributes']:_0x3b607e[_0xa8be('0x33')];if(!_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x3b')]('nolimit')){_0x462971[_0xa8be('0x1d')]=qs[_0xa8be('0x1d')](_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x1d')]);_0x462971[_0xa8be('0x1b')]=qs['offset'](_0x5abdc9[_0xa8be('0x34')][_0xa8be('0x1b')]);}_0x462971[_0xa8be('0x3c')]=qs[_0xa8be('0x3d')](_0x5abdc9['query'][_0xa8be('0x3d')]);_0x462971[_0xa8be('0x3e')]=qs[_0xa8be('0x36')](_[_0xa8be('0x3f')](_0x5abdc9[_0xa8be('0x34')],_0x3b607e[_0xa8be('0x36')]),_0x2b3e2c);if(_0x5abdc9['query'][_0xa8be('0x40')]){_0x462971[_0xa8be('0x3e')]=_['merge'](_0x462971[_0xa8be('0x3e')],{'$or':_[_0xa8be('0x2d')](_0x2b3e2c,function(_0x17838){if(_0x17838['type']!==_0xa8be('0x41')){var _0x4fdb8b={};_0x4fdb8b[_0x17838[_0xa8be('0x2a')]]={'$like':'%'+_0x5abdc9[_0xa8be('0x34')]['filter']+'%'};return _0x4fdb8b;}})});}_0x462971=_[_0xa8be('0x42')]({},_0x462971,_0x5abdc9[_0xa8be('0x43')]);var _0x2af2d2={'where':_0x462971[_0xa8be('0x3e')]};return db['ServicenowAccount'][_0xa8be('0x1e')](_0x2af2d2)[_0xa8be('0x25')](function(_0x59389f){_0x43ff41[_0xa8be('0x1e')]=_0x59389f;if(_0x5abdc9['query'][_0xa8be('0x44')]){_0x462971[_0xa8be('0x45')]=[{'all':!![]}];}return db[_0xa8be('0x2e')]['findAll'](_0x462971);})['then'](function(_0x417a7e){_0x43ff41[_0xa8be('0x46')]=_0x417a7e;return _0x43ff41;})[_0xa8be('0x25')](respondWithFilteredResult(_0x4b461f,_0x462971))[_0xa8be('0x47')](handleError(_0x4b461f,null));};exports['show']=function(_0x423e12,_0x1dff47){var _0x87cedd={'raw':![],'where':{'id':_0x423e12[_0xa8be('0x48')]['id']}},_0x3ebea2={};_0x3ebea2[_0xa8be('0x33')]=_[_0xa8be('0x35')](db['ServicenowAccount'][_0xa8be('0x2f')]);_0x3ebea2[_0xa8be('0x34')]=_[_0xa8be('0x35')](_0x423e12[_0xa8be('0x34')]);_0x3ebea2[_0xa8be('0x36')]=_[_0xa8be('0x38')](_0x3ebea2[_0xa8be('0x33')],_0x3ebea2[_0xa8be('0x34')]);_0x87cedd[_0xa8be('0x37')]=_[_0xa8be('0x38')](_0x3ebea2[_0xa8be('0x33')],qs['fields'](_0x423e12[_0xa8be('0x34')][_0xa8be('0x39')]));_0x87cedd['attributes']=_0x87cedd[_0xa8be('0x37')]['length']?_0x87cedd[_0xa8be('0x37')]:_0x3ebea2[_0xa8be('0x33')];if(_0x423e12[_0xa8be('0x34')][_0xa8be('0x44')]){_0x87cedd[_0xa8be('0x45')]=[{'all':!![]}];}_0x87cedd=_[_0xa8be('0x42')]({},_0x87cedd,_0x423e12['options']);return db['ServicenowAccount'][_0xa8be('0x49')](_0x87cedd)['then'](handleEntityNotFound(_0x1dff47,null))[_0xa8be('0x25')](respondWithResult(_0x1dff47,null))[_0xa8be('0x47')](handleError(_0x1dff47,null));};exports['create']=function(_0x5061b2,_0x26c073){return db[_0xa8be('0x2e')][_0xa8be('0x4a')](_0x5061b2['body'],{})[_0xa8be('0x25')](respondWithResult(_0x26c073,0xc9))['catch'](handleError(_0x26c073,null));};exports['update']=function(_0x3cf8e5,_0x2beae6){if(_0x3cf8e5[_0xa8be('0x4b')]['id']){delete _0x3cf8e5[_0xa8be('0x4b')]['id'];}return db[_0xa8be('0x2e')][_0xa8be('0x49')]({'where':{'id':_0x3cf8e5['params']['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0x2beae6,null))['then'](saveUpdates(_0x3cf8e5[_0xa8be('0x4b')],null))['then'](respondWithResult(_0x2beae6,null))[_0xa8be('0x47')](handleError(_0x2beae6,null));};exports[_0xa8be('0x26')]=function(_0x3b78d0,_0x53841f){return db[_0xa8be('0x2e')][_0xa8be('0x49')]({'where':{'id':_0x3b78d0[_0xa8be('0x48')]['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0x53841f,null))[_0xa8be('0x25')](removeEntity(_0x53841f,null))[_0xa8be('0x47')](handleError(_0x53841f,null));};exports['getConfigurations']=function(_0x5caee5,_0x2cfc79,_0x5a249b){var _0x5a9757={};var _0x2054eb={};var _0x246434;var _0x24aa97;return db[_0xa8be('0x2e')]['findOne']({'where':{'id':_0x5caee5[_0xa8be('0x48')]['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0x2cfc79,null))[_0xa8be('0x25')](function(_0xccf577){if(_0xccf577){_0x246434=_0xccf577;_0x2054eb[_0xa8be('0x33')]=_[_0xa8be('0x35')](db[_0xa8be('0x4c')][_0xa8be('0x2f')]);_0x2054eb['query']=_[_0xa8be('0x35')](_0x5caee5['query']);_0x2054eb[_0xa8be('0x36')]=_[_0xa8be('0x38')](_0x2054eb[_0xa8be('0x33')],_0x2054eb['query']);_0x5a9757[_0xa8be('0x37')]=_[_0xa8be('0x38')](_0x2054eb[_0xa8be('0x33')],qs[_0xa8be('0x39')](_0x5caee5[_0xa8be('0x34')][_0xa8be('0x39')]));_0x5a9757[_0xa8be('0x37')]=_0x5a9757[_0xa8be('0x37')]['length']?_0x5a9757['attributes']:_0x2054eb[_0xa8be('0x33')];_0x5a9757[_0xa8be('0x3c')]=qs[_0xa8be('0x3d')](_0x5caee5[_0xa8be('0x34')][_0xa8be('0x3d')]);_0x5a9757[_0xa8be('0x3e')]=qs[_0xa8be('0x36')](_[_0xa8be('0x3f')](_0x5caee5['query'],_0x2054eb['filters']));if(_0x5caee5[_0xa8be('0x34')][_0xa8be('0x40')]){_0x5a9757[_0xa8be('0x3e')]=_[_0xa8be('0x42')](_0x5a9757[_0xa8be('0x3e')],{'$or':_[_0xa8be('0x2d')](_0x5a9757[_0xa8be('0x37')],function(_0x21dd08){var _0xa8f6f1={};_0xa8f6f1[_0x21dd08]={'$like':'%'+_0x5caee5[_0xa8be('0x34')][_0xa8be('0x40')]+'%'};return _0xa8f6f1;})});}_0x5a9757=_[_0xa8be('0x42')]({},_0x5a9757,_0x5caee5[_0xa8be('0x43')]);return _0x246434[_0xa8be('0x4d')](_0x5a9757);}})[_0xa8be('0x25')](function(_0x4be63e){if(_0x4be63e){_0x24aa97=_0x4be63e['length'];if(!_0x5caee5['query'][_0xa8be('0x3b')](_0xa8be('0x4e'))){_0x5a9757[_0xa8be('0x1d')]=qs[_0xa8be('0x1d')](_0x5caee5[_0xa8be('0x34')]['limit']);_0x5a9757[_0xa8be('0x1b')]=qs[_0xa8be('0x1b')](_0x5caee5[_0xa8be('0x34')][_0xa8be('0x1b')]);}return _0x246434[_0xa8be('0x4d')](_0x5a9757);}})[_0xa8be('0x25')](function(_0x554013){if(_0x554013){return _0x554013?{'count':_0x24aa97,'rows':_0x554013}:null;}})['then'](respondWithResult(_0x2cfc79,null))[_0xa8be('0x47')](handleError(_0x2cfc79,null));};exports[_0xa8be('0x4f')]=function(_0x3db698,_0xf7f533,_0x263f61){if(_0x3db698[_0xa8be('0x4b')]['id']){delete _0x3db698[_0xa8be('0x4b')]['id'];}return db[_0xa8be('0x2e')][_0xa8be('0x50')]({'where':{'id':_0x3db698[_0xa8be('0x48')]['id']}})[_0xa8be('0x25')](handleEntityNotFound(_0xf7f533,null))[_0xa8be('0x25')](function(_0x2e2b8a){if(_0x2e2b8a){_0x3db698[_0xa8be('0x4b')][_0xa8be('0x51')]=_0x2e2b8a['id'];_0x3db698['body'][_0xa8be('0x52')]=integrations[_0xa8be('0x53')](_0x3db698['body'][_0xa8be('0x54')],_0x3db698[_0xa8be('0x4b')][_0xa8be('0x31')]);_0x3db698['body'][_0xa8be('0x55')]=integrations[_0xa8be('0x56')](_0x3db698['body']['channel'],_0x3db698[_0xa8be('0x4b')][_0xa8be('0x31')]);return db[_0xa8be('0x4c')]['create'](_0x3db698[_0xa8be('0x4b')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0xa8be('0x55')}]});}return null;})[_0xa8be('0x25')](respondWithResult(_0xf7f533,null))['catch'](handleError(_0xf7f533,null));};exports[_0xa8be('0x57')]=function(_0x509ab6,_0x3337e7,_0x1102c3){var _0x20f01a=[_0xa8be('0x58'),_0xa8be('0x59'),_0xa8be('0x5a'),_0xa8be('0x5b'),_0xa8be('0x5c'),_0xa8be('0x5d'),'incident_state',_0xa8be('0x5e'),_0xa8be('0x5f')];var _0x2bb54e=[_0xa8be('0x60'),_0xa8be('0x58'),_0xa8be('0x61'),_0xa8be('0x62'),_0xa8be('0x63'),_0xa8be('0x64'),_0xa8be('0x65'),_0xa8be('0x59'),_0xa8be('0x66'),_0xa8be('0x67'),'resolved_by',_0xa8be('0x68'),_0xa8be('0x69'),_0xa8be('0x6a'),_0xa8be('0x6b'),_0xa8be('0x6c'),_0xa8be('0x6d'),_0xa8be('0x6e'),_0xa8be('0x5a'),_0xa8be('0x3c'),'calendar_stc','closed_at',_0xa8be('0x6f'),_0xa8be('0x70'),_0xa8be('0x71'),_0xa8be('0x72'),_0xa8be('0x73'),_0xa8be('0x74'),_0xa8be('0x75'),_0xa8be('0x76'),_0xa8be('0x77'),_0xa8be('0x78'),'expected_start',_0xa8be('0x79'),'business_duration',_0xa8be('0x7a'),_0xa8be('0x7b'),'reopened_time',_0xa8be('0x7c'),_0xa8be('0x7d'),_0xa8be('0x7e'),'subcategory',_0xa8be('0x7f'),_0xa8be('0x80'),_0xa8be('0x5c'),_0xa8be('0x81'),_0xa8be('0x82'),_0xa8be('0x83'),_0xa8be('0x84'),_0xa8be('0x85'),_0xa8be('0x86'),_0xa8be('0x87'),_0xa8be('0x88'),_0xa8be('0x5d'),_0xa8be('0x89'),_0xa8be('0x8a'),_0xa8be('0x8b'),'follow_up',_0xa8be('0x8c'),_0xa8be('0x8d'),'contact_type',_0xa8be('0x8e'),_0xa8be('0x8f'),_0xa8be('0x90'),_0xa8be('0x91'),_0xa8be('0x92'),_0xa8be('0x93'),_0xa8be('0x94'),'assigned_to','severity','comments','sla_due',_0xa8be('0x95'),_0xa8be('0x96'),_0xa8be('0x97'),_0xa8be('0x98'),_0xa8be('0x99'),_0xa8be('0x9a'),_0xa8be('0x9b'),_0xa8be('0x9c'),_0xa8be('0x9d'),_0xa8be('0x9e'),'category'];var _0xdda2c='';var _0x106080='';var _0x90d4e3=[];var _0x21c60e='';var _0x3e78b5='';var _0x4add54=[];var _0x223a93='';var _0x26177d='';var _0x7e8ff5={};var _0x1371b8='';return db[_0xa8be('0x2e')][_0xa8be('0x50')]({'where':{'id':_0x509ab6[_0xa8be('0x48')]['id']},'attributes':['id',_0xa8be('0x9f'),_0xa8be('0xa0'),_0xa8be('0xa1'),_0xa8be('0xa2'),_0xa8be('0xa3')]})['then'](handleEntityNotFound(_0x3337e7,null))['then'](function(_0xab502d){if(_0xab502d){_0x1371b8=_0xab502d[_0xa8be('0xa2')];var _0x4ea35a=_0x1371b8[_0xa8be('0xa4')](-0x1);if(_0x4ea35a==='/'){_0x1371b8=_0x1371b8['substring'](0x0,_0x1371b8[_0xa8be('0xa5')](_0x4ea35a));}_0x26177d=util[_0xa8be('0xa6')]('%s/api/now/doc/table/schema/',_0x1371b8);_0x223a93=util[_0xa8be('0xa6')](_0xa8be('0xa7'),_0x1371b8);_0x7e8ff5={'user':_0xab502d['username'],'pass':_0xab502d[_0xa8be('0xa0')]};var _0x3ca0c2={'method':_0xa8be('0xa8'),'uri':_0x26177d+'incident?sysparm_display_value=all','auth':_0x7e8ff5,'json':!![]};return rp(_0x3ca0c2);}})[_0xa8be('0x25')](function(_0x3604d8){if(_0x3604d8[_0xa8be('0xa9')][_0xa8be('0x3a')]>0x0){_0xdda2c=_0x3604d8[_0xa8be('0xa9')];}console[_0xa8be('0xaa')](_0xa8be('0xab'),_0xdda2c);_0x4add54=[];_0x106080=Object['assign']([],_0xdda2c);_['remove'](_0x106080,function(_0x19c250){return!_0x20f01a[_0xa8be('0xac')](_0x19c250[_0xa8be('0x2a')]);});_0x106080[_0xa8be('0xad')](function(_0x110562){var _0x483a6c=createFieldObject(_0x223a93,_0x7e8ff5,_0x110562[_0xa8be('0xae')],_0x110562[_0xa8be('0x2a')],_0x110562[_0xa8be('0xaf')],![]);_0x4add54['push'](_0x483a6c);});return Promise[_0xa8be('0xb0')](_0x4add54);})['then'](function(_0x119453){_0x90d4e3=_0x119453;_0x21c60e=Object['assign']([],_0xdda2c);console['log'](_0xa8be('0xb1'),_0xdda2c);_['remove'](_0x21c60e,function(_0x57600c){return _0x2bb54e[_0xa8be('0xac')](_0x57600c[_0xa8be('0x2a')]);});console[_0xa8be('0xaa')](_0xa8be('0xb2'),_0x21c60e);_0x4add54=[];_0x21c60e[_0xa8be('0xad')](function(_0x5f17c6){var _0x178e0=createFieldObject(_0x223a93,_0x7e8ff5,_0x5f17c6[_0xa8be('0xae')],_0x5f17c6[_0xa8be('0x2a')],_0x5f17c6['label'],!![]);_0x4add54[_0xa8be('0xb3')](_0x178e0);});return Promise[_0xa8be('0xb0')](_0x4add54);})[_0xa8be('0x25')](function(_0x1fa9b2){_0x3e78b5=_0x1fa9b2;var _0x314beb=_0x90d4e3[_0xa8be('0xb4')](_0x3e78b5);return{'count':_0x314beb['length'],'rows':_0x314beb};})[_0xa8be('0x25')](respondWithResult(_0x3337e7,null))[_0xa8be('0x47')](function(_0x4c40c9){console['log'](_0xa8be('0xb5')+_0x4c40c9);var _0x12a0ba=_0x509ab6[_0xa8be('0x34')][_0xa8be('0xb6')]?0x1f4:_0x4c40c9[_0xa8be('0xb7')]||0x1f4;logger[_0xa8be('0x28')](_0x4c40c9[_0xa8be('0x29')]);delete _0x4c40c9['name'];if(_0x12a0ba===0x191){_0x12a0ba=0x190;}_0x3337e7['status'](_0x12a0ba)[_0xa8be('0x2b')](_0x509ab6[_0xa8be('0x34')]['test']?{'message':_0xa8be('0xb8'),'statusCode':_0x4c40c9['statusCode']}:_0x4c40c9);});};function createFieldObject(_0x30ad28,_0x4c0ec8,_0x428f12,_0x28292b,_0x5048bb,_0x529984){return new Promise(function(_0x417f38,_0x7fc350){var _0x2badb1={'id':_0x28292b,'name':_0x5048bb,'custom':_0x529984};if(_0x428f12===_0xa8be('0xb9')){_0x2badb1[_0xa8be('0x43')]=[{'name':'True','value':_0xa8be('0xba')},{'name':'False','value':_0xa8be('0xbb')}];_0x417f38(_0x2badb1);}else{var _0x52c301={'method':_0xa8be('0xa8'),'uri':_0x30ad28+_0xa8be('0xbc')+_0x28292b,'auth':_0x4c0ec8,'json':!![]};return rp(_0x52c301)[_0xa8be('0x25')](function(_0x144b30){var _0x411eff=[];if(_0x144b30[_0xa8be('0xa9')][_0xa8be('0x3a')]>0x0){_0x144b30['result'][_0xa8be('0xad')](function(_0x1ea095){if(_0x1ea095[_0xa8be('0xbd')]===_0xa8be('0xbb')){var _0x1cd2ec={'name':_0x1ea095[_0xa8be('0xaf')],'value':_0x1ea095[_0xa8be('0xbe')]};_0x411eff['push'](_0x1cd2ec);}});}_0x2badb1[_0xa8be('0x43')]=_0x411eff;if(_0x2badb1[_0xa8be('0x43')][_0xa8be('0x3a')]>0x0){_0x417f38(_0x2badb1);}else{if(_0x529984==![]){_0x417f38();}else{_0x417f38(_0x2badb1);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index e625993..b531c2d 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 _0xfcf0=['lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xfcf0,0x138));var _0x0fcf=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xfcf0[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));var integrations=require(_0x0fcf('0x9'));module[_0x0fcf('0xa')]=function(_0x1a7b03,_0x61bbb9){return _0x1a7b03[_0x0fcf('0xb')]('ServicenowAccount',attributes,{'tableName':_0x0fcf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c6=['rimraf','../../components/integrations/configuration','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x512001,_0x5b1940){var _0x3ffddf=function(_0x221200){while(--_0x221200){_0x512001['push'](_0x512001['shift']());}};_0x3ffddf(++_0x5b1940);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x2ba8e7,_0x5dd591){_0x2ba8e7=_0x2ba8e7-0x0;var _0x427856=_0xc1c6[_0x2ba8e7];return _0x427856;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x6c1c('0x7'));module['exports']=function(_0x50c1bb,_0x582bec){return _0x50c1bb[_0x6c1c('0x8')](_0x6c1c('0x9'),attributes,{'tableName':_0x6c1c('0xa'),'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 b652d14..cc9648a 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 _0x4c32=['where','attributes','include','map','model','ShowServicenowAccount','find','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','ServicenowAccount,\x20%s,\x20%s','message','catch','GetServicenowAccount','options','raw'];(function(_0x575756,_0x237f42){var _0xec2295=function(_0x101cb6){while(--_0x101cb6){_0x575756['push'](_0x575756['shift']());}};_0xec2295(++_0x237f42);}(_0x4c32,0x83));var _0x24c3=function(_0x3207aa,_0xe86a72){_0x3207aa=_0x3207aa-0x0;var _0x51758f=_0x4c32[_0x3207aa];return _0x51758f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x24c3('0x0'));var BPromise=require(_0x24c3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24c3('0x2'));var db=require(_0x24c3('0x3'))['db'];var utils=require(_0x24c3('0x4'));var logger=require(_0x24c3('0x5'))(_0x24c3('0x6'));var config=require(_0x24c3('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x24c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12231a,_0x29c79a,_0x1b32c3){return new BPromise(function(_0x1ed7f1,_0x420219){return client[_0x24c3('0x9')](_0x12231a,_0x1b32c3)[_0x24c3('0xa')](function(_0x598571){logger[_0x24c3('0xb')]('ServicenowAccount,\x20%s,\x20%s',_0x29c79a,_0x24c3('0xc'));logger[_0x24c3('0xd')](_0x24c3('0xe'),_0x29c79a,_0x24c3('0xc'),JSON[_0x24c3('0xf')](_0x598571));if(_0x598571['error']){if(_0x598571['error'][_0x24c3('0x10')]===0x1f4){logger[_0x24c3('0x11')](_0x24c3('0x12'),_0x29c79a,_0x598571['error'][_0x24c3('0x13')]);return _0x420219(_0x598571[_0x24c3('0x11')]['message']);}logger['error'](_0x24c3('0x12'),_0x29c79a,_0x598571[_0x24c3('0x11')]['message']);return _0x1ed7f1(_0x598571[_0x24c3('0x11')][_0x24c3('0x13')]);}else{logger[_0x24c3('0xb')](_0x24c3('0x12'),_0x29c79a,_0x24c3('0xc'));_0x1ed7f1(_0x598571['result']['message']);}})[_0x24c3('0x14')](function(_0x3ba5c4){logger[_0x24c3('0x11')](_0x24c3('0x12'),_0x29c79a,_0x3ba5c4);_0x420219(_0x3ba5c4);});});}exports[_0x24c3('0x15')]=function(_0x45ef39){var _0x276f4f=this;return new Promise(function(_0x2b7e57,_0x1c888e){return db['ServicenowAccount']['findAll']({'raw':_0x45ef39['options']?_0x45ef39[_0x24c3('0x16')][_0x24c3('0x17')]===undefined?!![]:![]:!![],'where':_0x45ef39['options']?_0x45ef39[_0x24c3('0x16')][_0x24c3('0x18')]||null:null,'attributes':_0x45ef39['options']?_0x45ef39['options'][_0x24c3('0x19')]||null:null,'limit':_0x45ef39[_0x24c3('0x16')]?_0x45ef39[_0x24c3('0x16')]['limit']||null:null,'include':_0x45ef39[_0x24c3('0x16')]?_0x45ef39[_0x24c3('0x16')][_0x24c3('0x1a')]?_[_0x24c3('0x1b')](_0x45ef39[_0x24c3('0x16')][_0x24c3('0x1a')],function(_0x1b5449){return{'model':db[_0x1b5449[_0x24c3('0x1c')]],'as':_0x1b5449['as'],'attributes':_0x1b5449['attributes'],'include':_0x1b5449[_0x24c3('0x1a')]?_[_0x24c3('0x1b')](_0x1b5449[_0x24c3('0x1a')],function(_0x294964){return{'model':db[_0x294964[_0x24c3('0x1c')]],'as':_0x294964['as'],'attributes':_0x294964[_0x24c3('0x19')],'include':_0x294964[_0x24c3('0x1a')]?_['map'](_0x294964[_0x24c3('0x1a')],function(_0x7c012c){return{'model':db[_0x7c012c[_0x24c3('0x1c')]],'as':_0x7c012c['as'],'attributes':_0x7c012c['attributes']};}):[]};}):[]};}):[]:[]})[_0x24c3('0xa')](function(_0x3e5321){logger['info'](_0x24c3('0x15'),_0x45ef39);logger[_0x24c3('0xd')](_0x24c3('0x15'),_0x45ef39,JSON[_0x24c3('0xf')](_0x3e5321));_0x2b7e57(_0x3e5321);})[_0x24c3('0x14')](function(_0x1689e3){logger[_0x24c3('0x11')](_0x24c3('0x15'),_0x1689e3[_0x24c3('0x13')],_0x45ef39);_0x1c888e(_0x276f4f[_0x24c3('0x11')](0x1f4,_0x1689e3['message']));});});};exports[_0x24c3('0x1d')]=function(_0x3c93a5){var _0x20ab16=this;return new Promise(function(_0x3eec8d,_0x12498f){return db['ServicenowAccount'][_0x24c3('0x1e')]({'raw':_0x3c93a5[_0x24c3('0x16')]?_0x3c93a5[_0x24c3('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x3c93a5['options']?_0x3c93a5[_0x24c3('0x16')][_0x24c3('0x18')]||null:null,'attributes':_0x3c93a5[_0x24c3('0x16')]?_0x3c93a5[_0x24c3('0x16')]['attributes']||null:null,'include':_0x3c93a5['options']?_0x3c93a5[_0x24c3('0x16')][_0x24c3('0x1a')]?_[_0x24c3('0x1b')](_0x3c93a5[_0x24c3('0x16')][_0x24c3('0x1a')],function(_0x4fa810){return{'model':db[_0x4fa810[_0x24c3('0x1c')]],'as':_0x4fa810['as'],'attributes':_0x4fa810[_0x24c3('0x19')],'include':_0x4fa810[_0x24c3('0x1a')]?_[_0x24c3('0x1b')](_0x4fa810['include'],function(_0x2151e8){return{'model':db[_0x2151e8[_0x24c3('0x1c')]],'as':_0x2151e8['as'],'attributes':_0x2151e8[_0x24c3('0x19')],'include':_0x2151e8[_0x24c3('0x1a')]?_[_0x24c3('0x1b')](_0x2151e8[_0x24c3('0x1a')],function(_0x35fdb7){return{'model':db[_0x35fdb7[_0x24c3('0x1c')]],'as':_0x35fdb7['as'],'attributes':_0x35fdb7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x242957){logger['info'](_0x24c3('0x1d'),_0x3c93a5);logger['debug'](_0x24c3('0x1d'),_0x3c93a5,JSON['stringify'](_0x242957));_0x3eec8d(_0x242957);})[_0x24c3('0x14')](function(_0x476e99){logger['error'](_0x24c3('0x1d'),_0x476e99[_0x24c3('0x13')],_0x3c93a5);_0x12498f(_0x20ab16[_0x24c3('0x11')](0x1f4,_0x476e99['message']));});});}; \ No newline at end of file +var _0x895d=['ServicenowAccount','findAll','options','where','limit','map','include','attributes','model','catch','ShowServicenowAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','error','ServicenowAccount,\x20%s,\x20%s','message','result','GetServicenowAccount'];(function(_0x58765f,_0x10e464){var _0x834973=function(_0xb7eb02){while(--_0xb7eb02){_0x58765f['push'](_0x58765f['shift']());}};_0x834973(++_0x10e464);}(_0x895d,0xd9));var _0xd895=function(_0x434161,_0x48bf7d){_0x434161=_0x434161-0x0;var _0x51f6fc=_0x895d[_0x434161];return _0x51f6fc;};'use strict';var _=require(_0xd895('0x0'));var util=require(_0xd895('0x1'));var moment=require(_0xd895('0x2'));var BPromise=require(_0xd895('0x3'));var rs=require(_0xd895('0x4'));var fs=require('fs');var Redis=require(_0xd895('0x5'));var db=require(_0xd895('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd895('0x7'))('rpc');var config=require(_0xd895('0x8'));var jayson=require(_0xd895('0x9'));var client=jayson[_0xd895('0xa')][_0xd895('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b7c5a,_0x178fed,_0x4ae4c6){return new BPromise(function(_0x2e78e2,_0x1bba65){return client['request'](_0x5b7c5a,_0x4ae4c6)[_0xd895('0xc')](function(_0x2f8a2a){logger[_0xd895('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x178fed,'request\x20sent');logger[_0xd895('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x178fed,_0xd895('0xf'),JSON['stringify'](_0x2f8a2a));if(_0x2f8a2a[_0xd895('0x10')]){if(_0x2f8a2a['error']['code']===0x1f4){logger[_0xd895('0x10')](_0xd895('0x11'),_0x178fed,_0x2f8a2a[_0xd895('0x10')][_0xd895('0x12')]);return _0x1bba65(_0x2f8a2a[_0xd895('0x10')][_0xd895('0x12')]);}logger['error'](_0xd895('0x11'),_0x178fed,_0x2f8a2a[_0xd895('0x10')][_0xd895('0x12')]);return _0x2e78e2(_0x2f8a2a[_0xd895('0x10')]['message']);}else{logger[_0xd895('0xd')](_0xd895('0x11'),_0x178fed,'request\x20sent');_0x2e78e2(_0x2f8a2a[_0xd895('0x13')][_0xd895('0x12')]);}})['catch'](function(_0xf68cfd){logger[_0xd895('0x10')](_0xd895('0x11'),_0x178fed,_0xf68cfd);_0x1bba65(_0xf68cfd);});});}exports[_0xd895('0x14')]=function(_0x486e0d){var _0x5478c2=this;return new Promise(function(_0x4a3378,_0x5a99b9){return db[_0xd895('0x15')][_0xd895('0x16')]({'raw':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')][_0xd895('0x18')]||null:null,'attributes':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')]['attributes']||null:null,'limit':_0x486e0d['options']?_0x486e0d[_0xd895('0x17')][_0xd895('0x19')]||null:null,'include':_0x486e0d[_0xd895('0x17')]?_0x486e0d[_0xd895('0x17')]['include']?_[_0xd895('0x1a')](_0x486e0d[_0xd895('0x17')][_0xd895('0x1b')],function(_0x32a618){return{'model':db[_0x32a618['model']],'as':_0x32a618['as'],'attributes':_0x32a618[_0xd895('0x1c')],'include':_0x32a618['include']?_['map'](_0x32a618[_0xd895('0x1b')],function(_0x557317){return{'model':db[_0x557317[_0xd895('0x1d')]],'as':_0x557317['as'],'attributes':_0x557317[_0xd895('0x1c')],'include':_0x557317[_0xd895('0x1b')]?_[_0xd895('0x1a')](_0x557317['include'],function(_0x4e8d27){return{'model':db[_0x4e8d27[_0xd895('0x1d')]],'as':_0x4e8d27['as'],'attributes':_0x4e8d27['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3da657){logger[_0xd895('0xd')]('GetServicenowAccount',_0x486e0d);logger[_0xd895('0xe')](_0xd895('0x14'),_0x486e0d,JSON['stringify'](_0x3da657));_0x4a3378(_0x3da657);})[_0xd895('0x1e')](function(_0x11c8c3){logger[_0xd895('0x10')](_0xd895('0x14'),_0x11c8c3['message'],_0x486e0d);_0x5a99b9(_0x5478c2[_0xd895('0x10')](0x1f4,_0x11c8c3['message']));});});};exports[_0xd895('0x1f')]=function(_0x1850e3){var _0x2ed3cb=this;return new Promise(function(_0x4b1d6b,_0x19dffa){return db[_0xd895('0x15')][_0xd895('0x20')]({'raw':_0x1850e3[_0xd895('0x17')]?_0x1850e3[_0xd895('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1850e3['options']?_0x1850e3['options']['where']||null:null,'attributes':_0x1850e3[_0xd895('0x17')]?_0x1850e3[_0xd895('0x17')]['attributes']||null:null,'include':_0x1850e3[_0xd895('0x17')]?_0x1850e3[_0xd895('0x17')][_0xd895('0x1b')]?_['map'](_0x1850e3[_0xd895('0x17')][_0xd895('0x1b')],function(_0x445c99){return{'model':db[_0x445c99[_0xd895('0x1d')]],'as':_0x445c99['as'],'attributes':_0x445c99[_0xd895('0x1c')],'include':_0x445c99[_0xd895('0x1b')]?_[_0xd895('0x1a')](_0x445c99['include'],function(_0x506131){return{'model':db[_0x506131[_0xd895('0x1d')]],'as':_0x506131['as'],'attributes':_0x506131[_0xd895('0x1c')],'include':_0x506131[_0xd895('0x1b')]?_[_0xd895('0x1a')](_0x506131[_0xd895('0x1b')],function(_0x5e4360){return{'model':db[_0x5e4360[_0xd895('0x1d')]],'as':_0x5e4360['as'],'attributes':_0x5e4360['attributes']};}):[]};}):[]};}):[]:[]})[_0xd895('0xc')](function(_0x3c1e8d){logger[_0xd895('0xd')]('ShowServicenowAccount',_0x1850e3);logger[_0xd895('0xe')](_0xd895('0x1f'),_0x1850e3,JSON[_0xd895('0x21')](_0x3c1e8d));_0x4b1d6b(_0x3c1e8d);})[_0xd895('0x1e')](function(_0x281eb5){logger[_0xd895('0x10')]('ShowServicenowAccount',_0x281eb5[_0xd895('0x12')],_0x1850e3);_0x19dffa(_0x2ed3cb['error'](0x1f4,_0x281eb5['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 7c5c6b2..08fc11d 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 _0x9210=['/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','getFields','/:id/subjects','getDescriptions','post','create','put','delete'];(function(_0xf24bed,_0x2f79ef){var _0x1f2e58=function(_0x466aee){while(--_0x466aee){_0xf24bed['push'](_0xf24bed['shift']());}};_0x1f2e58(++_0x2f79ef);}(_0x9210,0x137));var _0x0921=function(_0xf07ca4,_0x5a9936){_0xf07ca4=_0xf07ca4-0x0;var _0x3601d7=_0x9210[_0xf07ca4];return _0x3601d7;};'use strict';var multer=require(_0x0921('0x0'));var util=require(_0x0921('0x1'));var path=require(_0x0921('0x2'));var timeout=require(_0x0921('0x3'));var express=require(_0x0921('0x4'));var router=express[_0x0921('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0921('0x6'));var config=require(_0x0921('0x7'));var controller=require(_0x0921('0x8'));router[_0x0921('0x9')]('/',auth[_0x0921('0xa')](),controller[_0x0921('0xb')]);router['get']('/:id',auth[_0x0921('0xa')](),controller['show']);router[_0x0921('0x9')]('/:id/fields',auth[_0x0921('0xa')](),controller[_0x0921('0xc')]);router[_0x0921('0x9')](_0x0921('0xd'),auth[_0x0921('0xa')](),controller['getSubjects']);router[_0x0921('0x9')]('/:id/descriptions',auth[_0x0921('0xa')](),controller[_0x0921('0xe')]);router[_0x0921('0xf')]('/',auth[_0x0921('0xa')](),controller[_0x0921('0x10')]);router[_0x0921('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0921('0x12')](_0x0921('0x13'),auth[_0x0921('0xa')](),controller[_0x0921('0x14')]);module[_0x0921('0x15')]=router; \ No newline at end of file +var _0x8754=['/:id/descriptions','getDescriptions','put','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8754,0x195));var _0x4875=function(_0x400fbb,_0x1a6b82){_0x400fbb=_0x400fbb-0x0;var _0x44fb45=_0x8754[_0x400fbb];return _0x44fb45;};'use strict';var multer=require(_0x4875('0x0'));var util=require('util');var path=require(_0x4875('0x1'));var timeout=require('connect-timeout');var express=require(_0x4875('0x2'));var router=express[_0x4875('0x3')]();var fs_extra=require(_0x4875('0x4'));var auth=require(_0x4875('0x5'));var interaction=require(_0x4875('0x6'));var config=require(_0x4875('0x7'));var controller=require(_0x4875('0x8'));router[_0x4875('0x9')]('/',auth[_0x4875('0xa')](),controller[_0x4875('0xb')]);router[_0x4875('0x9')](_0x4875('0xc'),auth['isAuthenticated'](),controller[_0x4875('0xd')]);router[_0x4875('0x9')](_0x4875('0xe'),auth[_0x4875('0xa')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x4875('0xa')](),controller['getSubjects']);router[_0x4875('0x9')](_0x4875('0xf'),auth[_0x4875('0xa')](),controller[_0x4875('0x10')]);router['post']('/',auth[_0x4875('0xa')](),controller['create']);router[_0x4875('0x11')](_0x4875('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4875('0x12')](_0x4875('0xc'),auth[_0x4875('0xa')](),controller[_0x4875('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index eff31c8..6bf67db 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 _0x441c=['STRING','sequelize','exports'];(function(_0x3ac204,_0x2186c1){var _0x299176=function(_0x2980cd){while(--_0x2980cd){_0x3ac204['push'](_0x3ac204['shift']());}};_0x299176(++_0x2186c1);}(_0x441c,0x19f));var _0xc441=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x441c[_0x339129];return _0x1570df;};'use strict';var Sequelize=require(_0xc441('0x0'));module[_0xc441('0x1')]={'name':{'type':Sequelize[_0xc441('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa3d3=['sequelize','STRING'];(function(_0x5ecff9,_0x473070){var _0x5e1415=function(_0x3c34a1){while(--_0x3c34a1){_0x5ecff9['push'](_0x5ecff9['shift']());}};_0x5e1415(++_0x473070);}(_0xa3d3,0xdc));var _0x3a3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa3d3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3a3d('0x0'));module['exports']={'name':{'type':Sequelize[_0x3a3d('0x1')]},'description':{'type':Sequelize[_0x3a3d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index eaf152c..d1eb233 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 _0x38c3=['count','Content-Range','json','reject','then','destroy','sendStatus','error','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','ServicenowConfiguration','rows','catch','show','params','length','create','update','body','find','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','undefined','limit'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x38c3,0x7e));var _0x338c=function(_0x155af3,_0x4b7f9a){_0x155af3=_0x155af3-0x0;var _0x15a675=_0x38c3[_0x155af3];return _0x15a675;};'use strict';var emlformat=require(_0x338c('0x0'));var rimraf=require(_0x338c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x338c('0x2'));var rp=require(_0x338c('0x3'));var moment=require(_0x338c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x338c('0x5'));var util=require(_0x338c('0x6'));var path=require(_0x338c('0x7'));var sox=require(_0x338c('0x8'));var csv=require('to-csv');var ejs=require(_0x338c('0x9'));var fs=require('fs');var fs_extra=require(_0x338c('0xa'));var _=require(_0x338c('0xb'));var squel=require(_0x338c('0xc'));var crypto=require(_0x338c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x338c('0xe'));var Redis=require('ioredis');var authService=require(_0x338c('0xf'));var qs=require(_0x338c('0x10'));var as=require(_0x338c('0x11'));var hardwareService=require(_0x338c('0x12'));var logger=require(_0x338c('0x13'))(_0x338c('0x14'));var utils=require('../../config/utils');var config=require(_0x338c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x338c('0x16'))['db'];function respondWithStatusCode(_0x56a345,_0x41c135){_0x41c135=_0x41c135||0xcc;return function(_0x485102){if(_0x485102){return _0x56a345['sendStatus'](_0x41c135);}return _0x56a345[_0x338c('0x17')](_0x41c135)[_0x338c('0x18')]();};}function respondWithResult(_0x40262e,_0x5d85c0){_0x5d85c0=_0x5d85c0||0xc8;return function(_0xc9f7b1){if(_0xc9f7b1){return _0x40262e[_0x338c('0x17')](_0x5d85c0)['json'](_0xc9f7b1);}};}function respondWithFilteredResult(_0x1c1330,_0x3fb442){return function(_0x2c9b51){if(_0x2c9b51){var _0x5396d7=typeof _0x3fb442[_0x338c('0x19')]===_0x338c('0x1a')&&typeof _0x3fb442[_0x338c('0x1b')]===_0x338c('0x1a');var _0x18e3dc=_0x2c9b51[_0x338c('0x1c')];var _0x2c17ff=_0x5396d7?0x0:_0x3fb442[_0x338c('0x19')];var _0x560df9=_0x5396d7?_0x2c9b51[_0x338c('0x1c')]:_0x3fb442[_0x338c('0x19')]+_0x3fb442[_0x338c('0x1b')];var _0xeaa3f9;if(_0x560df9>=_0x18e3dc){_0x560df9=_0x18e3dc;_0xeaa3f9=0xc8;}else{_0xeaa3f9=0xce;}_0x1c1330['status'](_0xeaa3f9);return _0x1c1330['set'](_0x338c('0x1d'),_0x2c17ff+'-'+_0x560df9+'/'+_0x18e3dc)[_0x338c('0x1e')](_0x2c9b51);}return null;};}function patchUpdates(_0x1dd80e){return function(_0x3b1171){try{jsonpatch['apply'](_0x3b1171,_0x1dd80e,!![]);}catch(_0x1efa26){return BPromise[_0x338c('0x1f')](_0x1efa26);}return _0x3b1171['save']();};}function saveUpdates(_0x323f3b,_0x529b8a){return function(_0x3fb217){if(_0x3fb217){return _0x3fb217['update'](_0x323f3b)[_0x338c('0x20')](function(_0x2753ef){return _0x2753ef;});}return null;};}function removeEntity(_0x3a69d7,_0x251fc1){return function(_0x6170b5){if(_0x6170b5){return _0x6170b5[_0x338c('0x21')]()['then'](function(){_0x3a69d7[_0x338c('0x17')](0xcc)[_0x338c('0x18')]();});}};}function handleEntityNotFound(_0x1995c0,_0x32df14){return function(_0x21c186){if(!_0x21c186){_0x1995c0[_0x338c('0x22')](0x194);}return _0x21c186;};}function handleError(_0x5674b7,_0x2c8986){_0x2c8986=_0x2c8986||0x1f4;return function(_0x5d04a2){logger[_0x338c('0x23')](_0x5d04a2['stack']);if(_0x5d04a2[_0x338c('0x24')]){delete _0x5d04a2[_0x338c('0x24')];}_0x5674b7[_0x338c('0x17')](_0x2c8986)[_0x338c('0x25')](_0x5d04a2);};}exports['index']=function(_0xdcd97,_0xf4bc63){var _0x2ca444={},_0x351e54={},_0x1a1943={'count':0x0,'rows':[]};var _0x17db86=_['map'](db['ServicenowConfiguration'][_0x338c('0x26')],function(_0x3d974e){return{'name':_0x3d974e[_0x338c('0x27')],'type':_0x3d974e[_0x338c('0x28')][_0x338c('0x29')]};});_0x351e54[_0x338c('0x2a')]=_[_0x338c('0x2b')](_0x17db86,_0x338c('0x24'));_0x351e54[_0x338c('0x2c')]=_[_0x338c('0x2d')](_0xdcd97['query']);_0x351e54['filters']=_[_0x338c('0x2e')](_0x351e54['model'],_0x351e54[_0x338c('0x2c')]);_0x2ca444[_0x338c('0x2f')]=_[_0x338c('0x2e')](_0x351e54[_0x338c('0x2a')],qs['fields'](_0xdcd97[_0x338c('0x2c')][_0x338c('0x30')]));_0x2ca444[_0x338c('0x2f')]=_0x2ca444[_0x338c('0x2f')]['length']?_0x2ca444[_0x338c('0x2f')]:_0x351e54['model'];if(!_0xdcd97[_0x338c('0x2c')][_0x338c('0x31')](_0x338c('0x32'))){_0x2ca444['limit']=qs[_0x338c('0x1b')](_0xdcd97[_0x338c('0x2c')][_0x338c('0x1b')]);_0x2ca444[_0x338c('0x19')]=qs[_0x338c('0x19')](_0xdcd97['query'][_0x338c('0x19')]);}_0x2ca444[_0x338c('0x33')]=qs[_0x338c('0x34')](_0xdcd97['query']['sort']);_0x2ca444[_0x338c('0x35')]=qs[_0x338c('0x36')](_[_0x338c('0x37')](_0xdcd97[_0x338c('0x2c')],_0x351e54[_0x338c('0x36')]),_0x17db86);if(_0xdcd97[_0x338c('0x2c')][_0x338c('0x38')]){_0x2ca444[_0x338c('0x35')]=_['merge'](_0x2ca444[_0x338c('0x35')],{'$or':_[_0x338c('0x2b')](_0x17db86,function(_0x211eb9){if(_0x211eb9[_0x338c('0x28')]!==_0x338c('0x39')){var _0x5e9adc={};_0x5e9adc[_0x211eb9[_0x338c('0x24')]]={'$like':'%'+_0xdcd97[_0x338c('0x2c')][_0x338c('0x38')]+'%'};return _0x5e9adc;}})});}_0x2ca444=_[_0x338c('0x3a')]({},_0x2ca444,_0xdcd97[_0x338c('0x3b')]);var _0x2c3ff9={'where':_0x2ca444['where']};return db['ServicenowConfiguration']['count'](_0x2c3ff9)[_0x338c('0x20')](function(_0x52afd4){_0x1a1943[_0x338c('0x1c')]=_0x52afd4;if(_0xdcd97[_0x338c('0x2c')][_0x338c('0x3c')]){_0x2ca444[_0x338c('0x3d')]=[{'all':!![]}];}return db[_0x338c('0x3e')]['findAll'](_0x2ca444);})[_0x338c('0x20')](function(_0x2a9a67){_0x1a1943[_0x338c('0x3f')]=_0x2a9a67;return _0x1a1943;})[_0x338c('0x20')](respondWithFilteredResult(_0xf4bc63,_0x2ca444))[_0x338c('0x40')](handleError(_0xf4bc63,null));};exports[_0x338c('0x41')]=function(_0x1d671b,_0x5577d5){var _0x229dbf={'raw':![],'where':{'id':_0x1d671b[_0x338c('0x42')]['id']}},_0x4469f0={};_0x4469f0['model']=_[_0x338c('0x2d')](db['ServicenowConfiguration']['rawAttributes']);_0x4469f0[_0x338c('0x2c')]=_['keys'](_0x1d671b[_0x338c('0x2c')]);_0x4469f0[_0x338c('0x36')]=_['intersection'](_0x4469f0[_0x338c('0x2a')],_0x4469f0[_0x338c('0x2c')]);_0x229dbf[_0x338c('0x2f')]=_[_0x338c('0x2e')](_0x4469f0[_0x338c('0x2a')],qs[_0x338c('0x30')](_0x1d671b['query']['fields']));_0x229dbf[_0x338c('0x2f')]=_0x229dbf[_0x338c('0x2f')][_0x338c('0x43')]?_0x229dbf[_0x338c('0x2f')]:_0x4469f0[_0x338c('0x2a')];if(_0x1d671b[_0x338c('0x2c')][_0x338c('0x3c')]){_0x229dbf[_0x338c('0x3d')]=[{'all':!![]}];}_0x229dbf=_['merge']({},_0x229dbf,_0x1d671b[_0x338c('0x3b')]);return db[_0x338c('0x3e')]['find'](_0x229dbf)[_0x338c('0x20')](handleEntityNotFound(_0x5577d5,null))[_0x338c('0x20')](respondWithResult(_0x5577d5,null))[_0x338c('0x40')](handleError(_0x5577d5,null));};exports[_0x338c('0x44')]=function(_0x19490b,_0x2cece9){return db[_0x338c('0x3e')][_0x338c('0x44')](_0x19490b['body'],{})[_0x338c('0x20')](respondWithResult(_0x2cece9,0xc9))[_0x338c('0x40')](handleError(_0x2cece9,null));};exports[_0x338c('0x45')]=function(_0x38514d,_0x1be00c){if(_0x38514d[_0x338c('0x46')]['id']){delete _0x38514d[_0x338c('0x46')]['id'];}return db[_0x338c('0x3e')][_0x338c('0x47')]({'where':{'id':_0x38514d[_0x338c('0x42')]['id']}})[_0x338c('0x20')](handleEntityNotFound(_0x1be00c,null))['then'](saveUpdates(_0x38514d[_0x338c('0x46')],null))[_0x338c('0x20')](respondWithResult(_0x1be00c,null))['catch'](handleError(_0x1be00c,null));};exports[_0x338c('0x21')]=function(_0x3d184c,_0x3a5aac){return db[_0x338c('0x3e')]['find']({'where':{'id':_0x3d184c[_0x338c('0x42')]['id']}})[_0x338c('0x20')](handleEntityNotFound(_0x3a5aac,null))[_0x338c('0x20')](removeEntity(_0x3a5aac,null))[_0x338c('0x40')](handleError(_0x3a5aac,null));};exports[_0x338c('0x48')]=function(_0xc4d876,_0x55ca99,_0x2a9d62){var _0x521f42={};var _0x54040d={};var _0x52fc2c;var _0x326687;return db[_0x338c('0x3e')][_0x338c('0x49')]({'where':{'id':_0xc4d876['params']['id']}})[_0x338c('0x20')](handleEntityNotFound(_0x55ca99,null))[_0x338c('0x20')](function(_0x14747f){if(_0x14747f){_0x52fc2c=_0x14747f;_0x54040d[_0x338c('0x2a')]=_[_0x338c('0x2d')](db[_0x338c('0x4a')][_0x338c('0x26')]);_0x54040d[_0x338c('0x2c')]=_['keys'](_0xc4d876[_0x338c('0x2c')]);_0x54040d['filters']=_['intersection'](_0x54040d[_0x338c('0x2a')],_0x54040d['query']);_0x521f42['attributes']=_[_0x338c('0x2e')](_0x54040d[_0x338c('0x2a')],qs[_0x338c('0x30')](_0xc4d876[_0x338c('0x2c')][_0x338c('0x30')]));_0x521f42[_0x338c('0x2f')]=_0x521f42[_0x338c('0x2f')]['length']?_0x521f42[_0x338c('0x2f')]:_0x54040d[_0x338c('0x2a')];_0x521f42['order']=qs[_0x338c('0x34')](_0xc4d876[_0x338c('0x2c')][_0x338c('0x34')]);_0x521f42['where']=qs[_0x338c('0x36')](_['pick'](_0xc4d876[_0x338c('0x2c')],_0x54040d[_0x338c('0x36')]));if(_0xc4d876[_0x338c('0x2c')][_0x338c('0x38')]){_0x521f42[_0x338c('0x35')]=_[_0x338c('0x3a')](_0x521f42[_0x338c('0x35')],{'$or':_[_0x338c('0x2b')](_0x521f42[_0x338c('0x2f')],function(_0x4e8260){var _0x5c7a91={};_0x5c7a91[_0x4e8260]={'$like':'%'+_0xc4d876[_0x338c('0x2c')][_0x338c('0x38')]+'%'};return _0x5c7a91;})});}_0x521f42=_[_0x338c('0x3a')]({},_0x521f42,_0xc4d876['options']);return _0x52fc2c[_0x338c('0x48')](_0x521f42);}})['then'](function(_0x30f0dd){if(_0x30f0dd){_0x326687=_0x30f0dd[_0x338c('0x43')];if(!_0xc4d876[_0x338c('0x2c')][_0x338c('0x31')](_0x338c('0x32'))){_0x521f42[_0x338c('0x1b')]=qs[_0x338c('0x1b')](_0xc4d876[_0x338c('0x2c')]['limit']);_0x521f42[_0x338c('0x19')]=qs[_0x338c('0x19')](_0xc4d876[_0x338c('0x2c')][_0x338c('0x19')]);}return _0x52fc2c[_0x338c('0x48')](_0x521f42);}})[_0x338c('0x20')](function(_0x36fa00){if(_0x36fa00){return _0x36fa00?{'count':_0x326687,'rows':_0x36fa00}:null;}})[_0x338c('0x20')](respondWithResult(_0x55ca99,null))[_0x338c('0x40')](handleError(_0x55ca99,null));};exports[_0x338c('0x4b')]=function(_0x36ddcc,_0xa3adf5,_0x34903e){var _0x5209d6={};var _0x10c0d7={};var _0x23205f;var _0x166a15;return db[_0x338c('0x3e')][_0x338c('0x49')]({'where':{'id':_0x36ddcc['params']['id']}})[_0x338c('0x20')](handleEntityNotFound(_0xa3adf5,null))[_0x338c('0x20')](function(_0x45e9d7){if(_0x45e9d7){_0x23205f=_0x45e9d7;_0x10c0d7[_0x338c('0x2a')]=_[_0x338c('0x2d')](db['ServicenowField'][_0x338c('0x26')]);_0x10c0d7[_0x338c('0x2c')]=_[_0x338c('0x2d')](_0x36ddcc['query']);_0x10c0d7[_0x338c('0x36')]=_[_0x338c('0x2e')](_0x10c0d7[_0x338c('0x2a')],_0x10c0d7[_0x338c('0x2c')]);_0x5209d6[_0x338c('0x2f')]=_['intersection'](_0x10c0d7['model'],qs[_0x338c('0x30')](_0x36ddcc[_0x338c('0x2c')][_0x338c('0x30')]));_0x5209d6['attributes']=_0x5209d6[_0x338c('0x2f')][_0x338c('0x43')]?_0x5209d6[_0x338c('0x2f')]:_0x10c0d7[_0x338c('0x2a')];_0x5209d6['order']=qs['sort'](_0x36ddcc[_0x338c('0x2c')][_0x338c('0x34')]);_0x5209d6[_0x338c('0x35')]=qs[_0x338c('0x36')](_['pick'](_0x36ddcc[_0x338c('0x2c')],_0x10c0d7[_0x338c('0x36')]));if(_0x36ddcc['query'][_0x338c('0x38')]){_0x5209d6[_0x338c('0x35')]=_[_0x338c('0x3a')](_0x5209d6['where'],{'$or':_[_0x338c('0x2b')](_0x5209d6[_0x338c('0x2f')],function(_0x3e9cad){var _0x1a0a4d={};_0x1a0a4d[_0x3e9cad]={'$like':'%'+_0x36ddcc[_0x338c('0x2c')][_0x338c('0x38')]+'%'};return _0x1a0a4d;})});}_0x5209d6=_[_0x338c('0x3a')]({},_0x5209d6,_0x36ddcc[_0x338c('0x3b')]);return _0x23205f['getSubjects'](_0x5209d6);}})['then'](function(_0x51b22c){if(_0x51b22c){_0x166a15=_0x51b22c['length'];if(!_0x36ddcc[_0x338c('0x2c')]['hasOwnProperty'](_0x338c('0x32'))){_0x5209d6[_0x338c('0x1b')]=qs[_0x338c('0x1b')](_0x36ddcc[_0x338c('0x2c')][_0x338c('0x1b')]);_0x5209d6[_0x338c('0x19')]=qs[_0x338c('0x19')](_0x36ddcc['query'][_0x338c('0x19')]);}return _0x23205f['getSubjects'](_0x5209d6);}})[_0x338c('0x20')](function(_0x572800){if(_0x572800){return _0x572800?{'count':_0x166a15,'rows':_0x572800}:null;}})[_0x338c('0x20')](respondWithResult(_0xa3adf5,null))[_0x338c('0x40')](handleError(_0xa3adf5,null));};exports[_0x338c('0x4c')]=function(_0x25ff8b,_0x5e6d1b,_0x78a133){var _0x299e0a={};var _0x4c24c7={};var _0x446eb6;var _0x1e82df;return db[_0x338c('0x3e')][_0x338c('0x49')]({'where':{'id':_0x25ff8b[_0x338c('0x42')]['id']}})[_0x338c('0x20')](handleEntityNotFound(_0x5e6d1b,null))[_0x338c('0x20')](function(_0x4f7a86){if(_0x4f7a86){_0x446eb6=_0x4f7a86;_0x4c24c7[_0x338c('0x2a')]=_['keys'](db[_0x338c('0x4a')][_0x338c('0x26')]);_0x4c24c7['query']=_[_0x338c('0x2d')](_0x25ff8b[_0x338c('0x2c')]);_0x4c24c7[_0x338c('0x36')]=_[_0x338c('0x2e')](_0x4c24c7[_0x338c('0x2a')],_0x4c24c7['query']);_0x299e0a['attributes']=_[_0x338c('0x2e')](_0x4c24c7[_0x338c('0x2a')],qs[_0x338c('0x30')](_0x25ff8b[_0x338c('0x2c')][_0x338c('0x30')]));_0x299e0a[_0x338c('0x2f')]=_0x299e0a[_0x338c('0x2f')][_0x338c('0x43')]?_0x299e0a[_0x338c('0x2f')]:_0x4c24c7['model'];_0x299e0a[_0x338c('0x33')]=qs[_0x338c('0x34')](_0x25ff8b[_0x338c('0x2c')][_0x338c('0x34')]);_0x299e0a['where']=qs[_0x338c('0x36')](_[_0x338c('0x37')](_0x25ff8b[_0x338c('0x2c')],_0x4c24c7[_0x338c('0x36')]));if(_0x25ff8b['query'][_0x338c('0x38')]){_0x299e0a[_0x338c('0x35')]=_['merge'](_0x299e0a['where'],{'$or':_[_0x338c('0x2b')](_0x299e0a[_0x338c('0x2f')],function(_0x13ccf3){var _0x131ccf={};_0x131ccf[_0x13ccf3]={'$like':'%'+_0x25ff8b[_0x338c('0x2c')][_0x338c('0x38')]+'%'};return _0x131ccf;})});}_0x299e0a=_[_0x338c('0x3a')]({},_0x299e0a,_0x25ff8b[_0x338c('0x3b')]);return _0x446eb6['getDescriptions'](_0x299e0a);}})[_0x338c('0x20')](function(_0x15c6db){if(_0x15c6db){_0x1e82df=_0x15c6db['length'];if(!_0x25ff8b[_0x338c('0x2c')][_0x338c('0x31')]('nolimit')){_0x299e0a['limit']=qs[_0x338c('0x1b')](_0x25ff8b[_0x338c('0x2c')][_0x338c('0x1b')]);_0x299e0a[_0x338c('0x19')]=qs[_0x338c('0x19')](_0x25ff8b['query'][_0x338c('0x19')]);}return _0x446eb6['getDescriptions'](_0x299e0a);}})['then'](function(_0x535134){if(_0x535134){return _0x535134?{'count':_0x1e82df,'rows':_0x535134}:null;}})[_0x338c('0x20')](respondWithResult(_0x5e6d1b,null))[_0x338c('0x40')](handleError(_0x5e6d1b,null));}; \ No newline at end of file +var _0xa05e=['body','find','getFields','findOne','ServicenowField','order','hasOwnProperty','getSubjects','getDescriptions','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','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','create'];(function(_0x4f1fc6,_0x3ff605){var _0x54f24a=function(_0x6030e1){while(--_0x6030e1){_0x4f1fc6['push'](_0x4f1fc6['shift']());}};_0x54f24a(++_0x3ff605);}(_0xa05e,0x1ad));var _0xea05=function(_0x9d567,_0x2494bd){_0x9d567=_0x9d567-0x0;var _0x4d68c6=_0xa05e[_0x9d567];return _0x4d68c6;};'use strict';var emlformat=require(_0xea05('0x0'));var rimraf=require(_0xea05('0x1'));var zipdir=require(_0xea05('0x2'));var jsonpatch=require(_0xea05('0x3'));var rp=require(_0xea05('0x4'));var moment=require(_0xea05('0x5'));var BPromise=require(_0xea05('0x6'));var Mustache=require(_0xea05('0x7'));var util=require(_0xea05('0x8'));var path=require(_0xea05('0x9'));var sox=require(_0xea05('0xa'));var csv=require(_0xea05('0xb'));var ejs=require(_0xea05('0xc'));var fs=require('fs');var fs_extra=require(_0xea05('0xd'));var _=require(_0xea05('0xe'));var squel=require('squel');var crypto=require(_0xea05('0xf'));var jsforce=require(_0xea05('0x10'));var deskjs=require(_0xea05('0x11'));var toCsv=require(_0xea05('0xb'));var querystring=require('querystring');var Papa=require(_0xea05('0x12'));var Redis=require('ioredis');var authService=require(_0xea05('0x13'));var qs=require(_0xea05('0x14'));var as=require(_0xea05('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xea05('0x16'))(_0xea05('0x17'));var utils=require(_0xea05('0x18'));var config=require(_0xea05('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xea05('0x1a'))['db'];function respondWithStatusCode(_0x1ac528,_0x3b5df3){_0x3b5df3=_0x3b5df3||0xcc;return function(_0x21eaf6){if(_0x21eaf6){return _0x1ac528[_0xea05('0x1b')](_0x3b5df3);}return _0x1ac528[_0xea05('0x1c')](_0x3b5df3)[_0xea05('0x1d')]();};}function respondWithResult(_0x10de35,_0x2a53ff){_0x2a53ff=_0x2a53ff||0xc8;return function(_0x51c634){if(_0x51c634){return _0x10de35['status'](_0x2a53ff)[_0xea05('0x1e')](_0x51c634);}};}function respondWithFilteredResult(_0x584e0c,_0x591e99){return function(_0x221a70){if(_0x221a70){var _0x3743a4=typeof _0x591e99[_0xea05('0x1f')]===_0xea05('0x20')&&typeof _0x591e99[_0xea05('0x21')]===_0xea05('0x20');var _0x548b3b=_0x221a70['count'];var _0x4b3496=_0x3743a4?0x0:_0x591e99[_0xea05('0x1f')];var _0x53e55a=_0x3743a4?_0x221a70[_0xea05('0x22')]:_0x591e99[_0xea05('0x1f')]+_0x591e99[_0xea05('0x21')];var _0x2cfa69;if(_0x53e55a>=_0x548b3b){_0x53e55a=_0x548b3b;_0x2cfa69=0xc8;}else{_0x2cfa69=0xce;}_0x584e0c[_0xea05('0x1c')](_0x2cfa69);return _0x584e0c[_0xea05('0x23')](_0xea05('0x24'),_0x4b3496+'-'+_0x53e55a+'/'+_0x548b3b)['json'](_0x221a70);}return null;};}function patchUpdates(_0x39977b){return function(_0x2e56b4){try{jsonpatch[_0xea05('0x25')](_0x2e56b4,_0x39977b,!![]);}catch(_0x38927d){return BPromise[_0xea05('0x26')](_0x38927d);}return _0x2e56b4[_0xea05('0x27')]();};}function saveUpdates(_0x5488b7,_0x5313fa){return function(_0x582f55){if(_0x582f55){return _0x582f55[_0xea05('0x28')](_0x5488b7)[_0xea05('0x29')](function(_0x3644ad){return _0x3644ad;});}return null;};}function removeEntity(_0x48ce66,_0x274605){return function(_0x56c4f1){if(_0x56c4f1){return _0x56c4f1[_0xea05('0x2a')]()['then'](function(){_0x48ce66['status'](0xcc)[_0xea05('0x1d')]();});}};}function handleEntityNotFound(_0x32b205,_0x149748){return function(_0x8c2ac4){if(!_0x8c2ac4){_0x32b205[_0xea05('0x1b')](0x194);}return _0x8c2ac4;};}function handleError(_0x38ef82,_0x53e209){_0x53e209=_0x53e209||0x1f4;return function(_0x57bed6){logger['error'](_0x57bed6['stack']);if(_0x57bed6[_0xea05('0x2b')]){delete _0x57bed6[_0xea05('0x2b')];}_0x38ef82['status'](_0x53e209)[_0xea05('0x2c')](_0x57bed6);};}exports[_0xea05('0x2d')]=function(_0x4045d6,_0x19f42e){var _0xfa9b84={},_0x22817f={},_0x333540={'count':0x0,'rows':[]};var _0x351460=_['map'](db[_0xea05('0x2e')][_0xea05('0x2f')],function(_0x2a7516){return{'name':_0x2a7516[_0xea05('0x30')],'type':_0x2a7516[_0xea05('0x31')][_0xea05('0x32')]};});_0x22817f[_0xea05('0x33')]=_[_0xea05('0x34')](_0x351460,_0xea05('0x2b'));_0x22817f['query']=_[_0xea05('0x35')](_0x4045d6[_0xea05('0x36')]);_0x22817f[_0xea05('0x37')]=_['intersection'](_0x22817f[_0xea05('0x33')],_0x22817f[_0xea05('0x36')]);_0xfa9b84[_0xea05('0x38')]=_[_0xea05('0x39')](_0x22817f[_0xea05('0x33')],qs[_0xea05('0x3a')](_0x4045d6[_0xea05('0x36')][_0xea05('0x3a')]));_0xfa9b84[_0xea05('0x38')]=_0xfa9b84[_0xea05('0x38')][_0xea05('0x3b')]?_0xfa9b84[_0xea05('0x38')]:_0x22817f['model'];if(!_0x4045d6[_0xea05('0x36')]['hasOwnProperty'](_0xea05('0x3c'))){_0xfa9b84[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x4045d6[_0xea05('0x36')]['limit']);_0xfa9b84[_0xea05('0x1f')]=qs['offset'](_0x4045d6[_0xea05('0x36')]['offset']);}_0xfa9b84['order']=qs[_0xea05('0x3d')](_0x4045d6['query']['sort']);_0xfa9b84[_0xea05('0x3e')]=qs[_0xea05('0x37')](_[_0xea05('0x3f')](_0x4045d6[_0xea05('0x36')],_0x22817f[_0xea05('0x37')]),_0x351460);if(_0x4045d6['query'][_0xea05('0x40')]){_0xfa9b84['where']=_[_0xea05('0x41')](_0xfa9b84[_0xea05('0x3e')],{'$or':_[_0xea05('0x34')](_0x351460,function(_0x157cfa){if(_0x157cfa[_0xea05('0x31')]!==_0xea05('0x42')){var _0x49e9c0={};_0x49e9c0[_0x157cfa['name']]={'$like':'%'+_0x4045d6[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0x49e9c0;}})});}_0xfa9b84=_[_0xea05('0x41')]({},_0xfa9b84,_0x4045d6[_0xea05('0x43')]);var _0xcd2ae5={'where':_0xfa9b84[_0xea05('0x3e')]};return db[_0xea05('0x2e')][_0xea05('0x22')](_0xcd2ae5)[_0xea05('0x29')](function(_0x1f8026){_0x333540[_0xea05('0x22')]=_0x1f8026;if(_0x4045d6[_0xea05('0x36')]['includeAll']){_0xfa9b84[_0xea05('0x44')]=[{'all':!![]}];}return db[_0xea05('0x2e')][_0xea05('0x45')](_0xfa9b84);})[_0xea05('0x29')](function(_0x2a28fa){_0x333540[_0xea05('0x46')]=_0x2a28fa;return _0x333540;})[_0xea05('0x29')](respondWithFilteredResult(_0x19f42e,_0xfa9b84))[_0xea05('0x47')](handleError(_0x19f42e,null));};exports[_0xea05('0x48')]=function(_0x2f5e14,_0x3ffa45){var _0x444bc0={'raw':![],'where':{'id':_0x2f5e14[_0xea05('0x49')]['id']}},_0x38c61a={};_0x38c61a[_0xea05('0x33')]=_[_0xea05('0x35')](db[_0xea05('0x2e')][_0xea05('0x2f')]);_0x38c61a[_0xea05('0x36')]=_[_0xea05('0x35')](_0x2f5e14[_0xea05('0x36')]);_0x38c61a['filters']=_[_0xea05('0x39')](_0x38c61a[_0xea05('0x33')],_0x38c61a[_0xea05('0x36')]);_0x444bc0[_0xea05('0x38')]=_[_0xea05('0x39')](_0x38c61a[_0xea05('0x33')],qs[_0xea05('0x3a')](_0x2f5e14[_0xea05('0x36')]['fields']));_0x444bc0[_0xea05('0x38')]=_0x444bc0['attributes']['length']?_0x444bc0[_0xea05('0x38')]:_0x38c61a[_0xea05('0x33')];if(_0x2f5e14[_0xea05('0x36')]['includeAll']){_0x444bc0[_0xea05('0x44')]=[{'all':!![]}];}_0x444bc0=_['merge']({},_0x444bc0,_0x2f5e14['options']);return db[_0xea05('0x2e')]['find'](_0x444bc0)['then'](handleEntityNotFound(_0x3ffa45,null))['then'](respondWithResult(_0x3ffa45,null))[_0xea05('0x47')](handleError(_0x3ffa45,null));};exports[_0xea05('0x4a')]=function(_0x325558,_0x3c5c5e){return db[_0xea05('0x2e')]['create'](_0x325558[_0xea05('0x4b')],{})[_0xea05('0x29')](respondWithResult(_0x3c5c5e,0xc9))['catch'](handleError(_0x3c5c5e,null));};exports[_0xea05('0x28')]=function(_0x4801f1,_0x28c5a8){if(_0x4801f1['body']['id']){delete _0x4801f1['body']['id'];}return db[_0xea05('0x2e')][_0xea05('0x4c')]({'where':{'id':_0x4801f1[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x28c5a8,null))['then'](saveUpdates(_0x4801f1[_0xea05('0x4b')],null))[_0xea05('0x29')](respondWithResult(_0x28c5a8,null))[_0xea05('0x47')](handleError(_0x28c5a8,null));};exports[_0xea05('0x2a')]=function(_0x1ba41f,_0x30dfdb){return db['ServicenowConfiguration']['find']({'where':{'id':_0x1ba41f[_0xea05('0x49')]['id']}})['then'](handleEntityNotFound(_0x30dfdb,null))[_0xea05('0x29')](removeEntity(_0x30dfdb,null))['catch'](handleError(_0x30dfdb,null));};exports[_0xea05('0x4d')]=function(_0x3f6d23,_0x34b7b7,_0x5b783c){var _0x3edd07={};var _0x2c9ece={};var _0x2f3ffe;var _0x5856ef;return db['ServicenowConfiguration'][_0xea05('0x4e')]({'where':{'id':_0x3f6d23[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x34b7b7,null))['then'](function(_0x113abf){if(_0x113abf){_0x2f3ffe=_0x113abf;_0x2c9ece[_0xea05('0x33')]=_['keys'](db[_0xea05('0x4f')]['rawAttributes']);_0x2c9ece['query']=_['keys'](_0x3f6d23[_0xea05('0x36')]);_0x2c9ece[_0xea05('0x37')]=_[_0xea05('0x39')](_0x2c9ece[_0xea05('0x33')],_0x2c9ece[_0xea05('0x36')]);_0x3edd07[_0xea05('0x38')]=_[_0xea05('0x39')](_0x2c9ece['model'],qs[_0xea05('0x3a')](_0x3f6d23[_0xea05('0x36')][_0xea05('0x3a')]));_0x3edd07[_0xea05('0x38')]=_0x3edd07[_0xea05('0x38')][_0xea05('0x3b')]?_0x3edd07['attributes']:_0x2c9ece[_0xea05('0x33')];_0x3edd07[_0xea05('0x50')]=qs['sort'](_0x3f6d23[_0xea05('0x36')][_0xea05('0x3d')]);_0x3edd07[_0xea05('0x3e')]=qs[_0xea05('0x37')](_[_0xea05('0x3f')](_0x3f6d23['query'],_0x2c9ece['filters']));if(_0x3f6d23[_0xea05('0x36')]['filter']){_0x3edd07[_0xea05('0x3e')]=_[_0xea05('0x41')](_0x3edd07['where'],{'$or':_[_0xea05('0x34')](_0x3edd07[_0xea05('0x38')],function(_0x51547d){var _0x200d83={};_0x200d83[_0x51547d]={'$like':'%'+_0x3f6d23[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0x200d83;})});}_0x3edd07=_['merge']({},_0x3edd07,_0x3f6d23[_0xea05('0x43')]);return _0x2f3ffe[_0xea05('0x4d')](_0x3edd07);}})['then'](function(_0x1250a0){if(_0x1250a0){_0x5856ef=_0x1250a0[_0xea05('0x3b')];if(!_0x3f6d23[_0xea05('0x36')][_0xea05('0x51')](_0xea05('0x3c'))){_0x3edd07[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x3f6d23[_0xea05('0x36')][_0xea05('0x21')]);_0x3edd07[_0xea05('0x1f')]=qs[_0xea05('0x1f')](_0x3f6d23[_0xea05('0x36')]['offset']);}return _0x2f3ffe['getFields'](_0x3edd07);}})[_0xea05('0x29')](function(_0x41fdca){if(_0x41fdca){return _0x41fdca?{'count':_0x5856ef,'rows':_0x41fdca}:null;}})['then'](respondWithResult(_0x34b7b7,null))[_0xea05('0x47')](handleError(_0x34b7b7,null));};exports[_0xea05('0x52')]=function(_0x2158e9,_0x3da7ee,_0x48deb5){var _0x2b1bc2={};var _0x549cae={};var _0x289ac7;var _0x5d3e27;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x2158e9[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x3da7ee,null))[_0xea05('0x29')](function(_0x485328){if(_0x485328){_0x289ac7=_0x485328;_0x549cae[_0xea05('0x33')]=_[_0xea05('0x35')](db[_0xea05('0x4f')][_0xea05('0x2f')]);_0x549cae[_0xea05('0x36')]=_[_0xea05('0x35')](_0x2158e9[_0xea05('0x36')]);_0x549cae['filters']=_[_0xea05('0x39')](_0x549cae[_0xea05('0x33')],_0x549cae[_0xea05('0x36')]);_0x2b1bc2['attributes']=_[_0xea05('0x39')](_0x549cae['model'],qs[_0xea05('0x3a')](_0x2158e9[_0xea05('0x36')]['fields']));_0x2b1bc2[_0xea05('0x38')]=_0x2b1bc2['attributes'][_0xea05('0x3b')]?_0x2b1bc2[_0xea05('0x38')]:_0x549cae['model'];_0x2b1bc2[_0xea05('0x50')]=qs[_0xea05('0x3d')](_0x2158e9[_0xea05('0x36')]['sort']);_0x2b1bc2[_0xea05('0x3e')]=qs[_0xea05('0x37')](_[_0xea05('0x3f')](_0x2158e9['query'],_0x549cae[_0xea05('0x37')]));if(_0x2158e9[_0xea05('0x36')][_0xea05('0x40')]){_0x2b1bc2[_0xea05('0x3e')]=_['merge'](_0x2b1bc2[_0xea05('0x3e')],{'$or':_['map'](_0x2b1bc2[_0xea05('0x38')],function(_0x2af9a6){var _0xddb686={};_0xddb686[_0x2af9a6]={'$like':'%'+_0x2158e9[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0xddb686;})});}_0x2b1bc2=_[_0xea05('0x41')]({},_0x2b1bc2,_0x2158e9[_0xea05('0x43')]);return _0x289ac7['getSubjects'](_0x2b1bc2);}})[_0xea05('0x29')](function(_0x1ca142){if(_0x1ca142){_0x5d3e27=_0x1ca142[_0xea05('0x3b')];if(!_0x2158e9[_0xea05('0x36')][_0xea05('0x51')](_0xea05('0x3c'))){_0x2b1bc2[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x2158e9[_0xea05('0x36')]['limit']);_0x2b1bc2[_0xea05('0x1f')]=qs[_0xea05('0x1f')](_0x2158e9['query']['offset']);}return _0x289ac7[_0xea05('0x52')](_0x2b1bc2);}})['then'](function(_0x412ea1){if(_0x412ea1){return _0x412ea1?{'count':_0x5d3e27,'rows':_0x412ea1}:null;}})[_0xea05('0x29')](respondWithResult(_0x3da7ee,null))[_0xea05('0x47')](handleError(_0x3da7ee,null));};exports[_0xea05('0x53')]=function(_0x27017b,_0x53595d,_0x544f74){var _0x22f2f7={};var _0x505a2b={};var _0x5ecf41;var _0x3f2018;return db[_0xea05('0x2e')][_0xea05('0x4e')]({'where':{'id':_0x27017b[_0xea05('0x49')]['id']}})[_0xea05('0x29')](handleEntityNotFound(_0x53595d,null))[_0xea05('0x29')](function(_0x2237fc){if(_0x2237fc){_0x5ecf41=_0x2237fc;_0x505a2b['model']=_[_0xea05('0x35')](db[_0xea05('0x4f')][_0xea05('0x2f')]);_0x505a2b[_0xea05('0x36')]=_[_0xea05('0x35')](_0x27017b[_0xea05('0x36')]);_0x505a2b[_0xea05('0x37')]=_[_0xea05('0x39')](_0x505a2b[_0xea05('0x33')],_0x505a2b[_0xea05('0x36')]);_0x22f2f7[_0xea05('0x38')]=_[_0xea05('0x39')](_0x505a2b['model'],qs[_0xea05('0x3a')](_0x27017b['query'][_0xea05('0x3a')]));_0x22f2f7[_0xea05('0x38')]=_0x22f2f7['attributes'][_0xea05('0x3b')]?_0x22f2f7[_0xea05('0x38')]:_0x505a2b[_0xea05('0x33')];_0x22f2f7[_0xea05('0x50')]=qs[_0xea05('0x3d')](_0x27017b[_0xea05('0x36')]['sort']);_0x22f2f7[_0xea05('0x3e')]=qs[_0xea05('0x37')](_['pick'](_0x27017b[_0xea05('0x36')],_0x505a2b['filters']));if(_0x27017b['query'][_0xea05('0x40')]){_0x22f2f7['where']=_[_0xea05('0x41')](_0x22f2f7[_0xea05('0x3e')],{'$or':_['map'](_0x22f2f7[_0xea05('0x38')],function(_0x57f81e){var _0x2a7a23={};_0x2a7a23[_0x57f81e]={'$like':'%'+_0x27017b[_0xea05('0x36')][_0xea05('0x40')]+'%'};return _0x2a7a23;})});}_0x22f2f7=_[_0xea05('0x41')]({},_0x22f2f7,_0x27017b['options']);return _0x5ecf41[_0xea05('0x53')](_0x22f2f7);}})['then'](function(_0x4e4d99){if(_0x4e4d99){_0x3f2018=_0x4e4d99['length'];if(!_0x27017b['query'][_0xea05('0x51')](_0xea05('0x3c'))){_0x22f2f7[_0xea05('0x21')]=qs[_0xea05('0x21')](_0x27017b[_0xea05('0x36')][_0xea05('0x21')]);_0x22f2f7[_0xea05('0x1f')]=qs[_0xea05('0x1f')](_0x27017b[_0xea05('0x36')][_0xea05('0x1f')]);}return _0x5ecf41[_0xea05('0x53')](_0x22f2f7);}})['then'](function(_0x518100){if(_0x518100){return _0x518100?{'count':_0x3f2018,'rows':_0x518100}:null;}})[_0xea05('0x29')](respondWithResult(_0x53595d,null))[_0xea05('0x47')](handleError(_0x53595d,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index a9b398d..05e7a5e 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 _0x9703=['api','moment','request-promise','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','../../config/logger'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9703,0xdb));var _0x3970=function(_0x408fe0,_0x2b49c0){_0x408fe0=_0x408fe0-0x0;var _0x21b8b1=_0x9703[_0x408fe0];return _0x21b8b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3970('0x0'))(_0x3970('0x1'));var moment=require(_0x3970('0x2'));var BPromise=require('bluebird');var rp=require(_0x3970('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3970('0x4'));var config=require('../../config/environment');var attributes=require(_0x3970('0x5'));module[_0x3970('0x6')]=function(_0x5cdfda,_0x5669ec){return _0x5cdfda[_0x3970('0x7')](_0x3970('0x8'),attributes,{'tableName':_0x3970('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09df=['../../config/environment','./intServicenowConfiguration.attributes','define','int_servicenow_configurations','lodash','util','api','request-promise'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x09df,0x164));var _0xf09d=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x09df[_0x4f5108];return _0x2d56ca;};'use strict';var _=require(_0xf09d('0x0'));var util=require(_0xf09d('0x1'));var logger=require('../../config/logger')(_0xf09d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf09d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf09d('0x4'));var attributes=require(_0xf09d('0x5'));module['exports']=function(_0x4db4e7,_0x4b452b){return _0x4db4e7[_0xf09d('0x6')]('ServicenowConfiguration',attributes,{'tableName':_0xf09d('0x7'),'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 15f2c72..25c2e36 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 _0x103f=['http','request','then','info','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0x103f,0x13e));var _0xf103=function(_0x5d0e81,_0x48584c){_0x5d0e81=_0x5d0e81-0x0;var _0x405bf9=_0x103f[_0x5d0e81];return _0x405bf9;};'use strict';var _=require(_0xf103('0x0'));var util=require(_0xf103('0x1'));var moment=require(_0xf103('0x2'));var BPromise=require(_0xf103('0x3'));var rs=require(_0xf103('0x4'));var fs=require('fs');var Redis=require(_0xf103('0x5'));var db=require(_0xf103('0x6'))['db'];var utils=require(_0xf103('0x7'));var logger=require(_0xf103('0x8'))(_0xf103('0x9'));var config=require('../../config/environment');var jayson=require(_0xf103('0xa'));var client=jayson[_0xf103('0xb')][_0xf103('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x211dbc,_0x36d86b,_0x3cfbd1){return new BPromise(function(_0x37e92b,_0x3c9eac){return client[_0xf103('0xd')](_0x211dbc,_0x3cfbd1)[_0xf103('0xe')](function(_0x2e0f75){logger[_0xf103('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x36d86b,_0xf103('0x10'));logger['debug'](_0xf103('0x11'),_0x36d86b,'request\x20sent',JSON['stringify'](_0x2e0f75));if(_0x2e0f75[_0xf103('0x12')]){if(_0x2e0f75[_0xf103('0x12')]['code']===0x1f4){logger[_0xf103('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x36d86b,_0x2e0f75['error']['message']);return _0x3c9eac(_0x2e0f75[_0xf103('0x12')]['message']);}logger[_0xf103('0x12')](_0xf103('0x13'),_0x36d86b,_0x2e0f75['error'][_0xf103('0x14')]);return _0x37e92b(_0x2e0f75[_0xf103('0x12')]['message']);}else{logger[_0xf103('0xf')](_0xf103('0x13'),_0x36d86b,'request\x20sent');_0x37e92b(_0x2e0f75[_0xf103('0x15')]['message']);}})['catch'](function(_0x1900fc){logger[_0xf103('0x12')](_0xf103('0x13'),_0x36d86b,_0x1900fc);_0x3c9eac(_0x1900fc);});});} \ No newline at end of file +var _0x4f61=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x55320c,_0x130a6f){var _0x3e2c1c=function(_0x1db21b){while(--_0x1db21b){_0x55320c['push'](_0x55320c['shift']());}};_0x3e2c1c(++_0x130a6f);}(_0x4f61,0x149));var _0x14f6=function(_0x3ce3fe,_0x16a3ce){_0x3ce3fe=_0x3ce3fe-0x0;var _0x575fa6=_0x4f61[_0x3ce3fe];return _0x575fa6;};'use strict';var _=require(_0x14f6('0x0'));var util=require(_0x14f6('0x1'));var moment=require(_0x14f6('0x2'));var BPromise=require('bluebird');var rs=require(_0x14f6('0x3'));var fs=require('fs');var Redis=require(_0x14f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x14f6('0x5'));var logger=require(_0x14f6('0x6'))(_0x14f6('0x7'));var config=require(_0x14f6('0x8'));var jayson=require(_0x14f6('0x9'));var client=jayson[_0x14f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41fd96,_0x14123a,_0x2fcb1e){return new BPromise(function(_0xa85b5b,_0x23af1f){return client['request'](_0x41fd96,_0x2fcb1e)[_0x14f6('0xb')](function(_0x1b7c50){logger[_0x14f6('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14123a,_0x14f6('0xd'));logger[_0x14f6('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x14123a,_0x14f6('0xd'),JSON[_0x14f6('0xf')](_0x1b7c50));if(_0x1b7c50[_0x14f6('0x10')]){if(_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x11')]===0x1f4){logger['error'](_0x14f6('0x12'),_0x14123a,_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x13')]);return _0x23af1f(_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x13')]);}logger[_0x14f6('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14123a,_0x1b7c50[_0x14f6('0x10')][_0x14f6('0x13')]);return _0xa85b5b(_0x1b7c50['error'][_0x14f6('0x13')]);}else{logger[_0x14f6('0xc')](_0x14f6('0x12'),_0x14123a,_0x14f6('0xd'));_0xa85b5b(_0x1b7c50[_0x14f6('0x14')][_0x14f6('0x13')]);}})[_0x14f6('0x15')](function(_0x18cced){logger[_0x14f6('0x10')](_0x14f6('0x12'),_0x14123a,_0x18cced);_0x23af1f(_0x18cced);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index fa518e9..18ec5bf 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 _0xf3b3=['destroy','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','show','post','create','put','/:id','delete'];(function(_0x53d147,_0x374811){var _0xec8694=function(_0x52e774){while(--_0x52e774){_0x53d147['push'](_0x53d147['shift']());}};_0xec8694(++_0x374811);}(_0xf3b3,0x17c));var _0x3f3b=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xf3b3[_0x3fba9f];return _0x192cf1;};'use strict';var multer=require('multer');var util=require(_0x3f3b('0x0'));var path=require(_0x3f3b('0x1'));var timeout=require(_0x3f3b('0x2'));var express=require(_0x3f3b('0x3'));var router=express[_0x3f3b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3f3b('0x5'));var config=require(_0x3f3b('0x6'));var controller=require(_0x3f3b('0x7'));router[_0x3f3b('0x8')]('/',auth[_0x3f3b('0x9')](),controller['index']);router[_0x3f3b('0x8')]('/:id',auth[_0x3f3b('0x9')](),controller[_0x3f3b('0xa')]);router[_0x3f3b('0xb')]('/',auth['isAuthenticated'](),controller[_0x3f3b('0xc')]);router[_0x3f3b('0xd')](_0x3f3b('0xe'),auth[_0x3f3b('0x9')](),controller['update']);router[_0x3f3b('0xf')](_0x3f3b('0xe'),auth[_0x3f3b('0x9')](),controller[_0x3f3b('0x10')]);module[_0x3f3b('0x11')]=router; \ No newline at end of file +var _0x2635=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','destroy','exports','multer'];(function(_0x5c705f,_0xae3dfd){var _0x31d0ce=function(_0x4b58b2){while(--_0x4b58b2){_0x5c705f['push'](_0x5c705f['shift']());}};_0x31d0ce(++_0xae3dfd);}(_0x2635,0x175));var _0x5263=function(_0x4ff8e6,_0xfa7e41){_0x4ff8e6=_0x4ff8e6-0x0;var _0x33de7c=_0x2635[_0x4ff8e6];return _0x33de7c;};'use strict';var multer=require(_0x5263('0x0'));var util=require('util');var path=require(_0x5263('0x1'));var timeout=require('connect-timeout');var express=require(_0x5263('0x2'));var router=express[_0x5263('0x3')]();var fs_extra=require(_0x5263('0x4'));var auth=require(_0x5263('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5263('0x6'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x5263('0x7')](),controller[_0x5263('0x8')]);router[_0x5263('0x9')](_0x5263('0xa'),auth[_0x5263('0x7')](),controller[_0x5263('0xb')]);router[_0x5263('0xc')]('/',auth[_0x5263('0x7')](),controller[_0x5263('0xd')]);router[_0x5263('0xe')](_0x5263('0xa'),auth[_0x5263('0x7')](),controller['update']);router['delete'](_0x5263('0xa'),auth[_0x5263('0x7')](),controller[_0x5263('0xf')]);module[_0x5263('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index ef31aa5..20763cf 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 _0xc107=['string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc107,0xc5));var _0x7c10=function(_0x36f3b7,_0x140c39){_0x36f3b7=_0x36f3b7-0x0;var _0x27491d=_0xc107[_0x36f3b7];return _0x27491d;};'use strict';var Sequelize=require(_0x7c10('0x0'));module[_0x7c10('0x1')]={'type':{'type':Sequelize[_0x7c10('0x2')](_0x7c10('0x3'),'variable',_0x7c10('0x4'),_0x7c10('0x5'),_0x7c10('0x6')),'defaultValue':_0x7c10('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7c10('0x7')]},'keyType':{'type':Sequelize[_0x7c10('0x2')](_0x7c10('0x3'),_0x7c10('0x8'),_0x7c10('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7c10('0x7')]},'nameField':{'type':Sequelize[_0x7c10('0x7')]},'customField':{'type':Sequelize[_0x7c10('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7c10('0x7')]}}; \ No newline at end of file +var _0x8305=['string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x5861c6,_0xb11481){var _0x1cc9df=function(_0x1008e1){while(--_0x1008e1){_0x5861c6['push'](_0x5861c6['shift']());}};_0x1cc9df(++_0xb11481);}(_0x8305,0xd6));var _0x5830=function(_0x56a13d,_0x283398){_0x56a13d=_0x56a13d-0x0;var _0x5ada39=_0x8305[_0x56a13d];return _0x5ada39;};'use strict';var Sequelize=require(_0x5830('0x0'));module[_0x5830('0x1')]={'type':{'type':Sequelize['ENUM'](_0x5830('0x2'),'variable',_0x5830('0x3'),_0x5830('0x4'),'picklist'),'defaultValue':_0x5830('0x2')},'content':{'type':Sequelize[_0x5830('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5830('0x6')](_0x5830('0x2'),_0x5830('0x7'),_0x5830('0x3'))},'keyContent':{'type':Sequelize[_0x5830('0x5')]},'idField':{'type':Sequelize[_0x5830('0x5')]},'nameField':{'type':Sequelize[_0x5830('0x5')]},'customField':{'type':Sequelize[_0x5830('0x8')],'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 0082016..b6c260d 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 _0x3c0f=['merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','name','index','map','ServicenowField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x2602a5,_0x99d68e){var _0x69e892=function(_0x26dd28){while(--_0x26dd28){_0x2602a5['push'](_0x2602a5['shift']());}};_0x69e892(++_0x99d68e);}(_0x3c0f,0xf3));var _0xf3c0=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0x3c0f[_0x1fc122];return _0xa2cb13;};'use strict';var emlformat=require(_0xf3c0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf3c0('0x1'));var moment=require(_0xf3c0('0x2'));var BPromise=require(_0xf3c0('0x3'));var Mustache=require(_0xf3c0('0x4'));var util=require(_0xf3c0('0x5'));var path=require(_0xf3c0('0x6'));var sox=require(_0xf3c0('0x7'));var csv=require(_0xf3c0('0x8'));var ejs=require(_0xf3c0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf3c0('0xa'));var squel=require(_0xf3c0('0xb'));var crypto=require('crypto');var jsforce=require(_0xf3c0('0xc'));var deskjs=require(_0xf3c0('0xd'));var toCsv=require(_0xf3c0('0x8'));var querystring=require(_0xf3c0('0xe'));var Papa=require('papaparse');var Redis=require(_0xf3c0('0xf'));var authService=require(_0xf3c0('0x10'));var qs=require(_0xf3c0('0x11'));var as=require(_0xf3c0('0x12'));var hardwareService=require(_0xf3c0('0x13'));var logger=require(_0xf3c0('0x14'))(_0xf3c0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf3c0('0x16'));var db=require(_0xf3c0('0x17'))['db'];function respondWithStatusCode(_0x9c4dda,_0x40bbb2){_0x40bbb2=_0x40bbb2||0xcc;return function(_0x421c3e){if(_0x421c3e){return _0x9c4dda[_0xf3c0('0x18')](_0x40bbb2);}return _0x9c4dda['status'](_0x40bbb2)[_0xf3c0('0x19')]();};}function respondWithResult(_0x47a6ea,_0x16a369){_0x16a369=_0x16a369||0xc8;return function(_0x55fb02){if(_0x55fb02){return _0x47a6ea[_0xf3c0('0x1a')](_0x16a369)[_0xf3c0('0x1b')](_0x55fb02);}};}function respondWithFilteredResult(_0x5e0391,_0x51d85a){return function(_0x4d1062){if(_0x4d1062){var _0x1567dc=typeof _0x51d85a[_0xf3c0('0x1c')]===_0xf3c0('0x1d')&&typeof _0x51d85a[_0xf3c0('0x1e')]===_0xf3c0('0x1d');var _0x27604a=_0x4d1062['count'];var _0x3fe7da=_0x1567dc?0x0:_0x51d85a['offset'];var _0x1fed4b=_0x1567dc?_0x4d1062[_0xf3c0('0x1f')]:_0x51d85a[_0xf3c0('0x1c')]+_0x51d85a[_0xf3c0('0x1e')];var _0x2b2098;if(_0x1fed4b>=_0x27604a){_0x1fed4b=_0x27604a;_0x2b2098=0xc8;}else{_0x2b2098=0xce;}_0x5e0391['status'](_0x2b2098);return _0x5e0391['set'](_0xf3c0('0x20'),_0x3fe7da+'-'+_0x1fed4b+'/'+_0x27604a)[_0xf3c0('0x1b')](_0x4d1062);}return null;};}function patchUpdates(_0x3fbd4e){return function(_0x461d42){try{jsonpatch[_0xf3c0('0x21')](_0x461d42,_0x3fbd4e,!![]);}catch(_0x2a9c8f){return BPromise[_0xf3c0('0x22')](_0x2a9c8f);}return _0x461d42[_0xf3c0('0x23')]();};}function saveUpdates(_0x2de323,_0x572d8c){return function(_0x4110df){if(_0x4110df){return _0x4110df[_0xf3c0('0x24')](_0x2de323)[_0xf3c0('0x25')](function(_0x3a77f4){return _0x3a77f4;});}return null;};}function removeEntity(_0x5f38a4,_0x283e84){return function(_0x570a6a){if(_0x570a6a){return _0x570a6a['destroy']()[_0xf3c0('0x25')](function(){_0x5f38a4[_0xf3c0('0x1a')](0xcc)[_0xf3c0('0x19')]();});}};}function handleEntityNotFound(_0x231dd7,_0x51a762){return function(_0x477d43){if(!_0x477d43){_0x231dd7[_0xf3c0('0x18')](0x194);}return _0x477d43;};}function handleError(_0x164f27,_0x3b9f12){_0x3b9f12=_0x3b9f12||0x1f4;return function(_0x3a2ceb){logger[_0xf3c0('0x26')](_0x3a2ceb['stack']);if(_0x3a2ceb[_0xf3c0('0x27')]){delete _0x3a2ceb[_0xf3c0('0x27')];}_0x164f27[_0xf3c0('0x1a')](_0x3b9f12)['send'](_0x3a2ceb);};}exports[_0xf3c0('0x28')]=function(_0xf6d67,_0x44487a){var _0x5688c7={},_0x53b8ba={},_0x5732a4={'count':0x0,'rows':[]};var _0x3993ed=_[_0xf3c0('0x29')](db[_0xf3c0('0x2a')][_0xf3c0('0x2b')],function(_0x2a4259){return{'name':_0x2a4259[_0xf3c0('0x2c')],'type':_0x2a4259['type'][_0xf3c0('0x2d')]};});_0x53b8ba[_0xf3c0('0x2e')]=_[_0xf3c0('0x29')](_0x3993ed,_0xf3c0('0x27'));_0x53b8ba[_0xf3c0('0x2f')]=_[_0xf3c0('0x30')](_0xf6d67[_0xf3c0('0x2f')]);_0x53b8ba[_0xf3c0('0x31')]=_[_0xf3c0('0x32')](_0x53b8ba[_0xf3c0('0x2e')],_0x53b8ba[_0xf3c0('0x2f')]);_0x5688c7['attributes']=_['intersection'](_0x53b8ba[_0xf3c0('0x2e')],qs[_0xf3c0('0x33')](_0xf6d67[_0xf3c0('0x2f')][_0xf3c0('0x33')]));_0x5688c7[_0xf3c0('0x34')]=_0x5688c7[_0xf3c0('0x34')][_0xf3c0('0x35')]?_0x5688c7['attributes']:_0x53b8ba[_0xf3c0('0x2e')];if(!_0xf6d67[_0xf3c0('0x2f')][_0xf3c0('0x36')](_0xf3c0('0x37'))){_0x5688c7[_0xf3c0('0x1e')]=qs[_0xf3c0('0x1e')](_0xf6d67[_0xf3c0('0x2f')]['limit']);_0x5688c7[_0xf3c0('0x1c')]=qs[_0xf3c0('0x1c')](_0xf6d67[_0xf3c0('0x2f')][_0xf3c0('0x1c')]);}_0x5688c7[_0xf3c0('0x38')]=qs['sort'](_0xf6d67[_0xf3c0('0x2f')][_0xf3c0('0x39')]);_0x5688c7[_0xf3c0('0x3a')]=qs[_0xf3c0('0x31')](_[_0xf3c0('0x3b')](_0xf6d67[_0xf3c0('0x2f')],_0x53b8ba[_0xf3c0('0x31')]),_0x3993ed);if(_0xf6d67[_0xf3c0('0x2f')][_0xf3c0('0x3c')]){_0x5688c7[_0xf3c0('0x3a')]=_[_0xf3c0('0x3d')](_0x5688c7[_0xf3c0('0x3a')],{'$or':_[_0xf3c0('0x29')](_0x3993ed,function(_0x41d958){if(_0x41d958[_0xf3c0('0x3e')]!==_0xf3c0('0x3f')){var _0x55a490={};_0x55a490[_0x41d958['name']]={'$like':'%'+_0xf6d67['query'][_0xf3c0('0x3c')]+'%'};return _0x55a490;}})});}_0x5688c7=_[_0xf3c0('0x3d')]({},_0x5688c7,_0xf6d67[_0xf3c0('0x40')]);var _0xaa04e1={'where':_0x5688c7[_0xf3c0('0x3a')]};return db[_0xf3c0('0x2a')][_0xf3c0('0x1f')](_0xaa04e1)['then'](function(_0x54c57a){_0x5732a4['count']=_0x54c57a;if(_0xf6d67[_0xf3c0('0x2f')][_0xf3c0('0x41')]){_0x5688c7[_0xf3c0('0x42')]=[{'all':!![]}];}return db[_0xf3c0('0x2a')][_0xf3c0('0x43')](_0x5688c7);})[_0xf3c0('0x25')](function(_0x130651){_0x5732a4[_0xf3c0('0x44')]=_0x130651;return _0x5732a4;})['then'](respondWithFilteredResult(_0x44487a,_0x5688c7))[_0xf3c0('0x45')](handleError(_0x44487a,null));};exports[_0xf3c0('0x46')]=function(_0x1454ad,_0x787539){var _0x50f14e={'raw':!![],'where':{'id':_0x1454ad[_0xf3c0('0x47')]['id']}},_0x146f4e={};_0x146f4e['model']=_[_0xf3c0('0x30')](db[_0xf3c0('0x2a')][_0xf3c0('0x2b')]);_0x146f4e[_0xf3c0('0x2f')]=_[_0xf3c0('0x30')](_0x1454ad['query']);_0x146f4e[_0xf3c0('0x31')]=_[_0xf3c0('0x32')](_0x146f4e[_0xf3c0('0x2e')],_0x146f4e[_0xf3c0('0x2f')]);_0x50f14e['attributes']=_[_0xf3c0('0x32')](_0x146f4e['model'],qs[_0xf3c0('0x33')](_0x1454ad[_0xf3c0('0x2f')][_0xf3c0('0x33')]));_0x50f14e[_0xf3c0('0x34')]=_0x50f14e[_0xf3c0('0x34')][_0xf3c0('0x35')]?_0x50f14e['attributes']:_0x146f4e[_0xf3c0('0x2e')];if(_0x1454ad[_0xf3c0('0x2f')][_0xf3c0('0x41')]){_0x50f14e[_0xf3c0('0x42')]=[{'all':!![]}];}_0x50f14e=_['merge']({},_0x50f14e,_0x1454ad[_0xf3c0('0x40')]);return db[_0xf3c0('0x2a')][_0xf3c0('0x48')](_0x50f14e)[_0xf3c0('0x25')](handleEntityNotFound(_0x787539,null))[_0xf3c0('0x25')](respondWithResult(_0x787539,null))[_0xf3c0('0x45')](handleError(_0x787539,null));};exports[_0xf3c0('0x49')]=function(_0x373f0b,_0x18b868){return db[_0xf3c0('0x2a')][_0xf3c0('0x49')](_0x373f0b[_0xf3c0('0x4a')],{})['then'](respondWithResult(_0x18b868,0xc9))[_0xf3c0('0x45')](handleError(_0x18b868,null));};exports[_0xf3c0('0x24')]=function(_0xa325f6,_0x5bf232){if(_0xa325f6['body']['id']){delete _0xa325f6['body']['id'];}return db[_0xf3c0('0x2a')]['find']({'where':{'id':_0xa325f6['params']['id']}})[_0xf3c0('0x25')](handleEntityNotFound(_0x5bf232,null))[_0xf3c0('0x25')](saveUpdates(_0xa325f6[_0xf3c0('0x4a')],null))[_0xf3c0('0x25')](respondWithResult(_0x5bf232,null))[_0xf3c0('0x45')](handleError(_0x5bf232,null));};exports[_0xf3c0('0x4b')]=function(_0x5e16e8,_0x2e3b4){return db[_0xf3c0('0x2a')][_0xf3c0('0x48')]({'where':{'id':_0x5e16e8[_0xf3c0('0x47')]['id']}})['then'](handleEntityNotFound(_0x2e3b4,null))[_0xf3c0('0x25')](removeEntity(_0x2e3b4,null))[_0xf3c0('0x45')](handleError(_0x2e3b4,null));}; \ No newline at end of file +var _0x6d8f=['json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','map','ServicenowField','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','sort','pick','filters','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','keys','rawAttributes','find','create','body','update','params','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6d8f,0x175));var _0xf6d8=function(_0x33c147,_0xd24400){_0x33c147=_0x33c147-0x0;var _0x216d7d=_0x6d8f[_0x33c147];return _0x216d7d;};'use strict';var emlformat=require(_0xf6d8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf6d8('0x1'));var rp=require(_0xf6d8('0x2'));var moment=require(_0xf6d8('0x3'));var BPromise=require(_0xf6d8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf6d8('0x5'));var sox=require(_0xf6d8('0x6'));var csv=require(_0xf6d8('0x7'));var ejs=require(_0xf6d8('0x8'));var fs=require('fs');var fs_extra=require(_0xf6d8('0x9'));var _=require(_0xf6d8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6d8('0x7'));var querystring=require(_0xf6d8('0xb'));var Papa=require(_0xf6d8('0xc'));var Redis=require(_0xf6d8('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf6d8('0xe'));var hardwareService=require(_0xf6d8('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xf6d8('0x10'));var config=require(_0xf6d8('0x11'));var licenseUtil=require(_0xf6d8('0x12'));var db=require(_0xf6d8('0x13'))['db'];function respondWithStatusCode(_0x34f377,_0x4b93ae){_0x4b93ae=_0x4b93ae||0xcc;return function(_0x39e739){if(_0x39e739){return _0x34f377[_0xf6d8('0x14')](_0x4b93ae);}return _0x34f377[_0xf6d8('0x15')](_0x4b93ae)[_0xf6d8('0x16')]();};}function respondWithResult(_0x4971e3,_0x48c087){_0x48c087=_0x48c087||0xc8;return function(_0x4b207b){if(_0x4b207b){return _0x4971e3[_0xf6d8('0x15')](_0x48c087)[_0xf6d8('0x17')](_0x4b207b);}};}function respondWithFilteredResult(_0x3dc204,_0x5a1814){return function(_0x15f81e){if(_0x15f81e){var _0x54147c=typeof _0x5a1814[_0xf6d8('0x18')]===_0xf6d8('0x19')&&typeof _0x5a1814[_0xf6d8('0x1a')]===_0xf6d8('0x19');var _0x3b592e=_0x15f81e[_0xf6d8('0x1b')];var _0x7cb8c=_0x54147c?0x0:_0x5a1814[_0xf6d8('0x18')];var _0x27fc91=_0x54147c?_0x15f81e['count']:_0x5a1814[_0xf6d8('0x18')]+_0x5a1814['limit'];var _0xdda570;if(_0x27fc91>=_0x3b592e){_0x27fc91=_0x3b592e;_0xdda570=0xc8;}else{_0xdda570=0xce;}_0x3dc204['status'](_0xdda570);return _0x3dc204[_0xf6d8('0x1c')]('Content-Range',_0x7cb8c+'-'+_0x27fc91+'/'+_0x3b592e)[_0xf6d8('0x17')](_0x15f81e);}return null;};}function patchUpdates(_0x53c9c6){return function(_0x3094d3){try{jsonpatch[_0xf6d8('0x1d')](_0x3094d3,_0x53c9c6,!![]);}catch(_0x3e66e4){return BPromise[_0xf6d8('0x1e')](_0x3e66e4);}return _0x3094d3['save']();};}function saveUpdates(_0x32c224,_0x1f32ed){return function(_0x3573b1){if(_0x3573b1){return _0x3573b1['update'](_0x32c224)[_0xf6d8('0x1f')](function(_0x2a7d58){return _0x2a7d58;});}return null;};}function removeEntity(_0x852561,_0x21d79a){return function(_0x441d0b){if(_0x441d0b){return _0x441d0b[_0xf6d8('0x20')]()[_0xf6d8('0x1f')](function(){_0x852561[_0xf6d8('0x15')](0xcc)[_0xf6d8('0x16')]();});}};}function handleEntityNotFound(_0x346a90,_0x13e875){return function(_0x2f231f){if(!_0x2f231f){_0x346a90['sendStatus'](0x194);}return _0x2f231f;};}function handleError(_0x2f346f,_0x5a921c){_0x5a921c=_0x5a921c||0x1f4;return function(_0x4933fc){logger[_0xf6d8('0x21')](_0x4933fc['stack']);if(_0x4933fc[_0xf6d8('0x22')]){delete _0x4933fc[_0xf6d8('0x22')];}_0x2f346f[_0xf6d8('0x15')](_0x5a921c)[_0xf6d8('0x23')](_0x4933fc);};}exports['index']=function(_0x4dc7f7,_0x41187b){var _0x5e1186={},_0xada864={},_0x48c8c4={'count':0x0,'rows':[]};var _0x59ad95=_[_0xf6d8('0x24')](db[_0xf6d8('0x25')]['rawAttributes'],function(_0x3a7219){return{'name':_0x3a7219[_0xf6d8('0x26')],'type':_0x3a7219[_0xf6d8('0x27')][_0xf6d8('0x28')]};});_0xada864['model']=_[_0xf6d8('0x24')](_0x59ad95,_0xf6d8('0x22'));_0xada864[_0xf6d8('0x29')]=_['keys'](_0x4dc7f7[_0xf6d8('0x29')]);_0xada864['filters']=_[_0xf6d8('0x2a')](_0xada864[_0xf6d8('0x2b')],_0xada864[_0xf6d8('0x29')]);_0x5e1186[_0xf6d8('0x2c')]=_[_0xf6d8('0x2a')](_0xada864[_0xf6d8('0x2b')],qs[_0xf6d8('0x2d')](_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x2d')]));_0x5e1186[_0xf6d8('0x2c')]=_0x5e1186[_0xf6d8('0x2c')]['length']?_0x5e1186[_0xf6d8('0x2c')]:_0xada864[_0xf6d8('0x2b')];if(!_0x4dc7f7['query'][_0xf6d8('0x2e')]('nolimit')){_0x5e1186[_0xf6d8('0x1a')]=qs[_0xf6d8('0x1a')](_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x1a')]);_0x5e1186[_0xf6d8('0x18')]=qs['offset'](_0x4dc7f7['query']['offset']);}_0x5e1186['order']=qs[_0xf6d8('0x2f')](_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x2f')]);_0x5e1186['where']=qs['filters'](_[_0xf6d8('0x30')](_0x4dc7f7[_0xf6d8('0x29')],_0xada864[_0xf6d8('0x31')]),_0x59ad95);if(_0x4dc7f7[_0xf6d8('0x29')]['filter']){_0x5e1186[_0xf6d8('0x32')]=_[_0xf6d8('0x33')](_0x5e1186[_0xf6d8('0x32')],{'$or':_[_0xf6d8('0x24')](_0x59ad95,function(_0x62509c){if(_0x62509c[_0xf6d8('0x27')]!==_0xf6d8('0x34')){var _0x577c6e={};_0x577c6e[_0x62509c[_0xf6d8('0x22')]]={'$like':'%'+_0x4dc7f7['query']['filter']+'%'};return _0x577c6e;}})});}_0x5e1186=_[_0xf6d8('0x33')]({},_0x5e1186,_0x4dc7f7[_0xf6d8('0x35')]);var _0x27380b={'where':_0x5e1186[_0xf6d8('0x32')]};return db[_0xf6d8('0x25')][_0xf6d8('0x1b')](_0x27380b)[_0xf6d8('0x1f')](function(_0x5c0284){_0x48c8c4[_0xf6d8('0x1b')]=_0x5c0284;if(_0x4dc7f7[_0xf6d8('0x29')][_0xf6d8('0x36')]){_0x5e1186[_0xf6d8('0x37')]=[{'all':!![]}];}return db[_0xf6d8('0x25')]['findAll'](_0x5e1186);})['then'](function(_0x2e982f){_0x48c8c4[_0xf6d8('0x38')]=_0x2e982f;return _0x48c8c4;})[_0xf6d8('0x1f')](respondWithFilteredResult(_0x41187b,_0x5e1186))[_0xf6d8('0x39')](handleError(_0x41187b,null));};exports[_0xf6d8('0x3a')]=function(_0x8b414,_0x2db6b8){var _0x56509a={'raw':!![],'where':{'id':_0x8b414['params']['id']}},_0x37e8f9={};_0x37e8f9['model']=_[_0xf6d8('0x3b')](db[_0xf6d8('0x25')][_0xf6d8('0x3c')]);_0x37e8f9[_0xf6d8('0x29')]=_[_0xf6d8('0x3b')](_0x8b414[_0xf6d8('0x29')]);_0x37e8f9[_0xf6d8('0x31')]=_[_0xf6d8('0x2a')](_0x37e8f9['model'],_0x37e8f9[_0xf6d8('0x29')]);_0x56509a[_0xf6d8('0x2c')]=_[_0xf6d8('0x2a')](_0x37e8f9[_0xf6d8('0x2b')],qs[_0xf6d8('0x2d')](_0x8b414[_0xf6d8('0x29')][_0xf6d8('0x2d')]));_0x56509a['attributes']=_0x56509a['attributes']['length']?_0x56509a['attributes']:_0x37e8f9[_0xf6d8('0x2b')];if(_0x8b414['query'][_0xf6d8('0x36')]){_0x56509a[_0xf6d8('0x37')]=[{'all':!![]}];}_0x56509a=_[_0xf6d8('0x33')]({},_0x56509a,_0x8b414[_0xf6d8('0x35')]);return db[_0xf6d8('0x25')][_0xf6d8('0x3d')](_0x56509a)['then'](handleEntityNotFound(_0x2db6b8,null))[_0xf6d8('0x1f')](respondWithResult(_0x2db6b8,null))[_0xf6d8('0x39')](handleError(_0x2db6b8,null));};exports[_0xf6d8('0x3e')]=function(_0x169c1c,_0x3c96d7){return db['ServicenowField']['create'](_0x169c1c[_0xf6d8('0x3f')],{})[_0xf6d8('0x1f')](respondWithResult(_0x3c96d7,0xc9))['catch'](handleError(_0x3c96d7,null));};exports[_0xf6d8('0x40')]=function(_0x44edba,_0x3b640b){if(_0x44edba['body']['id']){delete _0x44edba['body']['id'];}return db['ServicenowField'][_0xf6d8('0x3d')]({'where':{'id':_0x44edba[_0xf6d8('0x41')]['id']}})[_0xf6d8('0x1f')](handleEntityNotFound(_0x3b640b,null))['then'](saveUpdates(_0x44edba[_0xf6d8('0x3f')],null))[_0xf6d8('0x1f')](respondWithResult(_0x3b640b,null))['catch'](handleError(_0x3b640b,null));};exports[_0xf6d8('0x20')]=function(_0x34494a,_0x4a7690){return db[_0xf6d8('0x25')][_0xf6d8('0x3d')]({'where':{'id':_0x34494a['params']['id']}})[_0xf6d8('0x1f')](handleEntityNotFound(_0x4a7690,null))[_0xf6d8('0x1f')](removeEntity(_0x4a7690,null))[_0xf6d8('0x39')](handleError(_0x4a7690,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index b946f5e..eb94242 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 _0x9c63=['moment','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','idField','FieldId','lodash','util','../../config/logger'];(function(_0xfa874a,_0x990e70){var _0x3ffce4=function(_0x583540){while(--_0x583540){_0xfa874a['push'](_0xfa874a['shift']());}};_0x3ffce4(++_0x990e70);}(_0x9c63,0x173));var _0x39c6=function(_0x75fe86,_0x5c1d96){_0x75fe86=_0x75fe86-0x0;var _0x4f520e=_0x9c63[_0x75fe86];return _0x4f520e;};'use strict';var _=require(_0x39c6('0x0'));var util=require(_0x39c6('0x1'));var logger=require(_0x39c6('0x2'))('api');var moment=require(_0x39c6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x39c6('0x4'));var config=require('../../config/environment');var attributes=require(_0x39c6('0x5'));module[_0x39c6('0x6')]=function(_0xdc399e,_0x31aa6e){return _0xdc399e[_0x39c6('0x7')](_0x39c6('0x8'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x39c6('0x9'),_0x39c6('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d6a=['FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ServicenowField','int_servicenow_fields','idField'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x7d6a,0x1a1));var _0xa7d6=function(_0x39b7db,_0xbe4c47){_0x39b7db=_0x39b7db-0x0;var _0x2432ac=_0x7d6a[_0x39b7db];return _0x2432ac;};'use strict';var _=require(_0xa7d6('0x0'));var util=require(_0xa7d6('0x1'));var logger=require('../../config/logger')(_0xa7d6('0x2'));var moment=require(_0xa7d6('0x3'));var BPromise=require(_0xa7d6('0x4'));var rp=require(_0xa7d6('0x5'));var fs=require('fs');var path=require(_0xa7d6('0x6'));var rimraf=require(_0xa7d6('0x7'));var config=require(_0xa7d6('0x8'));var attributes=require('./intServicenowField.attributes');module['exports']=function(_0x32d87c,_0xf44687){return _0x32d87c['define'](_0xa7d6('0x9'),attributes,{'tableName':_0xa7d6('0xa'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xa7d6('0xb'),_0xa7d6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 205bf4f..05879f7 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 _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x49e04e,_0x1a1692){var _0x213b7d=function(_0x1a4d65){while(--_0x1a4d65){_0x49e04e['push'](_0x49e04e['shift']());}};_0x213b7d(++_0x1a1692);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x18bbe6,_0x4bac8e){var _0x116eb7=function(_0x6729b0){while(--_0x6729b0){_0x18bbe6['push'](_0x18bbe6['shift']());}};_0x116eb7(++_0x4bac8e);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4deaa4,_0x17621f){_0x4deaa4=_0x4deaa4-0x0;var _0x45d54c=_0xb43b[_0x4deaa4];return _0x45d54c;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('ServicenowField,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 626d5b7..41a9a12 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(_0x373062,_0xdc394c){var _0xe11625=function(_0x1c8563){while(--_0x1c8563){_0x373062['push'](_0x373062['shift']());}};_0xe11625(++_0xdc394c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x1080a2,_0x510e98){var _0x406abe=function(_0x3b770c){while(--_0x3b770c){_0x1080a2['push'](_0x1080a2['shift']());}};_0x406abe(++_0x510e98);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 6976d64..50e3926 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(_0x15d8f5,_0x5d7981){var _0x169cab=function(_0x53d271){while(--_0x53d271){_0x15d8f5['push'](_0x15d8f5['shift']());}};_0x169cab(++_0x5d7981);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0xa56d66,_0x2db568){var _0x5c1953=function(_0x4e1aa8){while(--_0x4e1aa8){_0xa56d66['push'](_0xa56d66['shift']());}};_0x5c1953(++_0x2db568);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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 10f59b4..1023911 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 _0xd673=['remove','label','values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','index','map','SugarcrmAccount','type','key','name','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','keys','rawAttributes','include','find','body','destroy','findOne','SugarcrmConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','create','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','direction','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','Calls'];(function(_0x4bd10b,_0x1f55bd){var _0xa490b7=function(_0x3c4697){while(--_0x3c4697){_0x4bd10b['push'](_0x4bd10b['shift']());}};_0xa490b7(++_0x1f55bd);}(_0xd673,0x1f1));var _0x3d67=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd673[_0x59ee6f];return _0x4c0979;};'use strict';var emlformat=require(_0x3d67('0x0'));var rimraf=require(_0x3d67('0x1'));var zipdir=require(_0x3d67('0x2'));var jsonpatch=require(_0x3d67('0x3'));var rp=require(_0x3d67('0x4'));var moment=require(_0x3d67('0x5'));var BPromise=require(_0x3d67('0x6'));var Mustache=require(_0x3d67('0x7'));var util=require(_0x3d67('0x8'));var path=require(_0x3d67('0x9'));var sox=require(_0x3d67('0xa'));var csv=require(_0x3d67('0xb'));var ejs=require(_0x3d67('0xc'));var fs=require('fs');var fs_extra=require(_0x3d67('0xd'));var _=require(_0x3d67('0xe'));var squel=require(_0x3d67('0xf'));var crypto=require(_0x3d67('0x10'));var jsforce=require(_0x3d67('0x11'));var deskjs=require(_0x3d67('0x12'));var toCsv=require(_0x3d67('0xb'));var querystring=require(_0x3d67('0x13'));var Papa=require(_0x3d67('0x14'));var Redis=require(_0x3d67('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x3d67('0x16'));var as=require(_0x3d67('0x17'));var hardwareService=require(_0x3d67('0x18'));var logger=require(_0x3d67('0x19'))(_0x3d67('0x1a'));var utils=require(_0x3d67('0x1b'));var config=require(_0x3d67('0x1c'));var licenseUtil=require(_0x3d67('0x1d'));var db=require('../../mysqldb')['db'];var integrations=require(_0x3d67('0x1e'));function respondWithStatusCode(_0x3b5d7b,_0x41bb90){_0x41bb90=_0x41bb90||0xcc;return function(_0x4bdaa9){if(_0x4bdaa9){return _0x3b5d7b['sendStatus'](_0x41bb90);}return _0x3b5d7b[_0x3d67('0x1f')](_0x41bb90)[_0x3d67('0x20')]();};}function respondWithResult(_0x63df64,_0x59410e){_0x59410e=_0x59410e||0xc8;return function(_0x10f1ca){if(_0x10f1ca){return _0x63df64[_0x3d67('0x1f')](_0x59410e)[_0x3d67('0x21')](_0x10f1ca);}};}function respondWithFilteredResult(_0x378b2f,_0x5ad3fc){return function(_0x18d4d2){if(_0x18d4d2){var _0x3127bc=typeof _0x5ad3fc[_0x3d67('0x22')]===_0x3d67('0x23')&&typeof _0x5ad3fc['limit']===_0x3d67('0x23');var _0x17b342=_0x18d4d2[_0x3d67('0x24')];var _0x3630f7=_0x3127bc?0x0:_0x5ad3fc[_0x3d67('0x22')];var _0x3a4ce0=_0x3127bc?_0x18d4d2['count']:_0x5ad3fc[_0x3d67('0x22')]+_0x5ad3fc[_0x3d67('0x25')];var _0x1dcf77;if(_0x3a4ce0>=_0x17b342){_0x3a4ce0=_0x17b342;_0x1dcf77=0xc8;}else{_0x1dcf77=0xce;}_0x378b2f[_0x3d67('0x1f')](_0x1dcf77);return _0x378b2f[_0x3d67('0x26')](_0x3d67('0x27'),_0x3630f7+'-'+_0x3a4ce0+'/'+_0x17b342)[_0x3d67('0x21')](_0x18d4d2);}return null;};}function patchUpdates(_0x3c99d4){return function(_0x166074){try{jsonpatch[_0x3d67('0x28')](_0x166074,_0x3c99d4,!![]);}catch(_0x3fac87){return BPromise['reject'](_0x3fac87);}return _0x166074[_0x3d67('0x29')]();};}function saveUpdates(_0x6bc244,_0x440925){return function(_0x1bd22d){if(_0x1bd22d){return _0x1bd22d[_0x3d67('0x2a')](_0x6bc244)[_0x3d67('0x2b')](function(_0x3a3680){return _0x3a3680;});}return null;};}function removeEntity(_0x19b06d,_0x3348b3){return function(_0x118bc5){if(_0x118bc5){return _0x118bc5['destroy']()[_0x3d67('0x2b')](function(){_0x19b06d[_0x3d67('0x1f')](0xcc)[_0x3d67('0x20')]();});}};}function handleEntityNotFound(_0x10a636,_0x30d938){return function(_0x12c6e4){if(!_0x12c6e4){_0x10a636[_0x3d67('0x2c')](0x194);}return _0x12c6e4;};}function handleError(_0x3663ee,_0x40e90a){_0x40e90a=_0x40e90a||0x1f4;return function(_0x4f4be2){logger[_0x3d67('0x2d')](_0x4f4be2[_0x3d67('0x2e')]);if(_0x4f4be2['name']){delete _0x4f4be2['name'];}_0x3663ee[_0x3d67('0x1f')](_0x40e90a)['send'](_0x4f4be2);};}exports[_0x3d67('0x2f')]=function(_0xa7483e,_0x1643e9){var _0x792ae8={},_0x5e7b72={},_0xbcc65d={'count':0x0,'rows':[]};var _0x3931c8=_[_0x3d67('0x30')](db[_0x3d67('0x31')]['rawAttributes'],function(_0x3bb72d){return{'name':_0x3bb72d['fieldName'],'type':_0x3bb72d[_0x3d67('0x32')][_0x3d67('0x33')]};});_0x5e7b72['model']=_[_0x3d67('0x30')](_0x3931c8,_0x3d67('0x34'));_0x5e7b72[_0x3d67('0x35')]=_['keys'](_0xa7483e[_0x3d67('0x35')]);_0x5e7b72[_0x3d67('0x36')]=_[_0x3d67('0x37')](_0x5e7b72[_0x3d67('0x38')],_0x5e7b72[_0x3d67('0x35')]);_0x792ae8['attributes']=_[_0x3d67('0x37')](_0x5e7b72[_0x3d67('0x38')],qs[_0x3d67('0x39')](_0xa7483e[_0x3d67('0x35')][_0x3d67('0x39')]));_0x792ae8[_0x3d67('0x3a')]=_0x792ae8['attributes'][_0x3d67('0x3b')]?_0x792ae8[_0x3d67('0x3a')]:_0x5e7b72['model'];if(!_0xa7483e['query'][_0x3d67('0x3c')](_0x3d67('0x3d'))){_0x792ae8[_0x3d67('0x25')]=qs[_0x3d67('0x25')](_0xa7483e[_0x3d67('0x35')][_0x3d67('0x25')]);_0x792ae8[_0x3d67('0x22')]=qs[_0x3d67('0x22')](_0xa7483e[_0x3d67('0x35')][_0x3d67('0x22')]);}_0x792ae8[_0x3d67('0x3e')]=qs['sort'](_0xa7483e['query'][_0x3d67('0x3f')]);_0x792ae8[_0x3d67('0x40')]=qs[_0x3d67('0x36')](_[_0x3d67('0x41')](_0xa7483e[_0x3d67('0x35')],_0x5e7b72['filters']),_0x3931c8);if(_0xa7483e[_0x3d67('0x35')][_0x3d67('0x42')]){_0x792ae8[_0x3d67('0x40')]=_[_0x3d67('0x43')](_0x792ae8[_0x3d67('0x40')],{'$or':_['map'](_0x3931c8,function(_0x3c9639){if(_0x3c9639[_0x3d67('0x32')]!==_0x3d67('0x44')){var _0x1f3906={};_0x1f3906[_0x3c9639[_0x3d67('0x34')]]={'$like':'%'+_0xa7483e[_0x3d67('0x35')][_0x3d67('0x42')]+'%'};return _0x1f3906;}})});}_0x792ae8=_[_0x3d67('0x43')]({},_0x792ae8,_0xa7483e[_0x3d67('0x45')]);var _0x3169c6={'where':_0x792ae8[_0x3d67('0x40')]};return db[_0x3d67('0x31')][_0x3d67('0x24')](_0x3169c6)[_0x3d67('0x2b')](function(_0x5ac5cd){_0xbcc65d[_0x3d67('0x24')]=_0x5ac5cd;if(_0xa7483e[_0x3d67('0x35')][_0x3d67('0x46')]){_0x792ae8['include']=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x792ae8);})['then'](function(_0x5561d6){_0xbcc65d['rows']=_0x5561d6;return _0xbcc65d;})['then'](respondWithFilteredResult(_0x1643e9,_0x792ae8))[_0x3d67('0x47')](handleError(_0x1643e9,null));};exports[_0x3d67('0x48')]=function(_0x4afec8,_0x5e4d0f){var _0x2ad29d={'raw':![],'where':{'id':_0x4afec8[_0x3d67('0x49')]['id']}},_0x5dc29f={};_0x5dc29f[_0x3d67('0x38')]=_[_0x3d67('0x4a')](db[_0x3d67('0x31')][_0x3d67('0x4b')]);_0x5dc29f[_0x3d67('0x35')]=_[_0x3d67('0x4a')](_0x4afec8[_0x3d67('0x35')]);_0x5dc29f[_0x3d67('0x36')]=_[_0x3d67('0x37')](_0x5dc29f['model'],_0x5dc29f['query']);_0x2ad29d[_0x3d67('0x3a')]=_[_0x3d67('0x37')](_0x5dc29f['model'],qs['fields'](_0x4afec8[_0x3d67('0x35')][_0x3d67('0x39')]));_0x2ad29d[_0x3d67('0x3a')]=_0x2ad29d[_0x3d67('0x3a')]['length']?_0x2ad29d[_0x3d67('0x3a')]:_0x5dc29f[_0x3d67('0x38')];if(_0x4afec8[_0x3d67('0x35')][_0x3d67('0x46')]){_0x2ad29d[_0x3d67('0x4c')]=[{'all':!![]}];}_0x2ad29d=_[_0x3d67('0x43')]({},_0x2ad29d,_0x4afec8[_0x3d67('0x45')]);return db[_0x3d67('0x31')][_0x3d67('0x4d')](_0x2ad29d)[_0x3d67('0x2b')](handleEntityNotFound(_0x5e4d0f,null))['then'](respondWithResult(_0x5e4d0f,null))[_0x3d67('0x47')](handleError(_0x5e4d0f,null));};exports['create']=function(_0x33d2dd,_0x399d18){return db[_0x3d67('0x31')]['create'](_0x33d2dd[_0x3d67('0x4e')],{})[_0x3d67('0x2b')](respondWithResult(_0x399d18,0xc9))['catch'](handleError(_0x399d18,null));};exports[_0x3d67('0x2a')]=function(_0x91f1de,_0xbb2b23){if(_0x91f1de[_0x3d67('0x4e')]['id']){delete _0x91f1de[_0x3d67('0x4e')]['id'];}return db[_0x3d67('0x31')][_0x3d67('0x4d')]({'where':{'id':_0x91f1de['params']['id']}})['then'](handleEntityNotFound(_0xbb2b23,null))['then'](saveUpdates(_0x91f1de[_0x3d67('0x4e')],null))['then'](respondWithResult(_0xbb2b23,null))['catch'](handleError(_0xbb2b23,null));};exports[_0x3d67('0x4f')]=function(_0x5ca5c6,_0x3af514){return db[_0x3d67('0x31')]['find']({'where':{'id':_0x5ca5c6['params']['id']}})['then'](handleEntityNotFound(_0x3af514,null))[_0x3d67('0x2b')](removeEntity(_0x3af514,null))['catch'](handleError(_0x3af514,null));};exports['getConfigurations']=function(_0x25018e,_0x222952,_0x37e7cf){var _0x2b08e8={};var _0x439c2d={};var _0x39129a;var _0x389c70;return db[_0x3d67('0x31')][_0x3d67('0x50')]({'where':{'id':_0x25018e[_0x3d67('0x49')]['id']}})[_0x3d67('0x2b')](handleEntityNotFound(_0x222952,null))['then'](function(_0x1b0f9a){if(_0x1b0f9a){_0x39129a=_0x1b0f9a;_0x439c2d[_0x3d67('0x38')]=_['keys'](db[_0x3d67('0x51')][_0x3d67('0x4b')]);_0x439c2d[_0x3d67('0x35')]=_[_0x3d67('0x4a')](_0x25018e[_0x3d67('0x35')]);_0x439c2d[_0x3d67('0x36')]=_[_0x3d67('0x37')](_0x439c2d[_0x3d67('0x38')],_0x439c2d[_0x3d67('0x35')]);_0x2b08e8[_0x3d67('0x3a')]=_['intersection'](_0x439c2d[_0x3d67('0x38')],qs[_0x3d67('0x39')](_0x25018e[_0x3d67('0x35')][_0x3d67('0x39')]));_0x2b08e8['attributes']=_0x2b08e8['attributes'][_0x3d67('0x3b')]?_0x2b08e8[_0x3d67('0x3a')]:_0x439c2d[_0x3d67('0x38')];_0x2b08e8[_0x3d67('0x3e')]=qs[_0x3d67('0x3f')](_0x25018e[_0x3d67('0x35')][_0x3d67('0x3f')]);_0x2b08e8[_0x3d67('0x40')]=qs[_0x3d67('0x36')](_[_0x3d67('0x41')](_0x25018e[_0x3d67('0x35')],_0x439c2d[_0x3d67('0x36')]));if(_0x25018e[_0x3d67('0x35')][_0x3d67('0x42')]){_0x2b08e8[_0x3d67('0x40')]=_[_0x3d67('0x43')](_0x2b08e8[_0x3d67('0x40')],{'$or':_[_0x3d67('0x30')](_0x2b08e8['attributes'],function(_0x693af3){var _0x44ae61={};_0x44ae61[_0x693af3]={'$like':'%'+_0x25018e['query'][_0x3d67('0x42')]+'%'};return _0x44ae61;})});}_0x2b08e8=_[_0x3d67('0x43')]({},_0x2b08e8,_0x25018e[_0x3d67('0x45')]);return _0x39129a[_0x3d67('0x52')](_0x2b08e8);}})[_0x3d67('0x2b')](function(_0x276f39){if(_0x276f39){_0x389c70=_0x276f39['length'];if(!_0x25018e[_0x3d67('0x35')][_0x3d67('0x3c')]('nolimit')){_0x2b08e8['limit']=qs[_0x3d67('0x25')](_0x25018e[_0x3d67('0x35')]['limit']);_0x2b08e8[_0x3d67('0x22')]=qs['offset'](_0x25018e[_0x3d67('0x35')]['offset']);}return _0x39129a['getConfigurations'](_0x2b08e8);}})[_0x3d67('0x2b')](function(_0xb3ff8e){if(_0xb3ff8e){return _0xb3ff8e?{'count':_0x389c70,'rows':_0xb3ff8e}:null;}})[_0x3d67('0x2b')](respondWithResult(_0x222952,null))['catch'](handleError(_0x222952,null));};exports[_0x3d67('0x53')]=function(_0x21f2bc,_0x54c2e9,_0x4435c4){if(_0x21f2bc[_0x3d67('0x4e')]['id']){delete _0x21f2bc['body']['id'];}return db['SugarcrmAccount']['findOne']({'where':{'id':_0x21f2bc[_0x3d67('0x49')]['id']}})[_0x3d67('0x2b')](handleEntityNotFound(_0x54c2e9,null))[_0x3d67('0x2b')](function(_0x93de38){if(_0x93de38){_0x21f2bc[_0x3d67('0x4e')][_0x3d67('0x54')]=_0x93de38['id'];_0x21f2bc[_0x3d67('0x4e')][_0x3d67('0x55')]=integrations[_0x3d67('0x56')](_0x21f2bc[_0x3d67('0x4e')]['channel'],_0x21f2bc[_0x3d67('0x4e')][_0x3d67('0x32')]);_0x21f2bc[_0x3d67('0x4e')][_0x3d67('0x57')]=integrations[_0x3d67('0x58')](_0x21f2bc['body'][_0x3d67('0x59')],_0x21f2bc['body'][_0x3d67('0x32')]);return db[_0x3d67('0x51')][_0x3d67('0x5a')](_0x21f2bc[_0x3d67('0x4e')],{'include':[{'model':db[_0x3d67('0x5b')],'as':_0x3d67('0x55')},{'model':db[_0x3d67('0x5b')],'as':_0x3d67('0x57')}]});}return null;})[_0x3d67('0x2b')](respondWithResult(_0x54c2e9,null))[_0x3d67('0x47')](handleError(_0x54c2e9,null));};exports[_0x3d67('0x5c')]=function(_0x3eda13,_0x3da75a,_0xbcd878){var _0x43ecf6='';var _0x15b2b3=['id',_0x3d67('0x34'),_0x3d67('0x5d'),'created_by','description',_0x3d67('0x5e'),_0x3d67('0x5f'),'duration_minutes','parent_id','parent_type','parent_name',_0x3d67('0x60')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x3eda13[_0x3d67('0x49')]['id']},'attributes':['id',_0x3d67('0x61'),_0x3d67('0x62'),_0x3d67('0x63')]})[_0x3d67('0x2b')](handleEntityNotFound(_0x3da75a,null))[_0x3d67('0x2b')](function(_0x588f99){if(_0x588f99){_0x43ecf6=_0x588f99[_0x3d67('0x63')];var _0x5e3e9f=_0x43ecf6[_0x3d67('0x64')](-0x1);if(_0x5e3e9f==='/'){_0x43ecf6=_0x43ecf6[_0x3d67('0x65')](0x0,_0x43ecf6['lastIndexOf'](_0x5e3e9f));}return rp({'method':_0x3d67('0x66'),'uri':util[_0x3d67('0x67')](_0x3d67('0x68'),_0x43ecf6,_0x3d67('0x69')),'json':!![],'form':{'method':_0x3d67('0x6a'),'input_type':_0x3d67('0x6b'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x588f99['username'],'password':_0x588f99[_0x3d67('0x62')],'encryption':_0x3d67('0x6c')},'application':_0x3d67('0x6d')})}});}})[_0x3d67('0x2b')](function(_0x5526f8){if(_0x5526f8&&_0x5526f8['name']!=='Invalid\x20Login'&&_0x5526f8[_0x3d67('0x34')]!==_0x3d67('0x6e')){return rp({'method':_0x3d67('0x66'),'uri':util['format']('%s%s',_0x43ecf6,_0x3d67('0x69')),'json':!![],'form':{'method':_0x3d67('0x6f'),'input_type':'JSON','response_type':_0x3d67('0x6b'),'rest_data':JSON['stringify']({'session':_0x5526f8['id'],'module_name':_0x3d67('0x70')})}})[_0x3d67('0x2b')](function(_0x178d38){if(_0x178d38){var _0x3a187a=_['values'](_0x178d38['module_fields']);_[_0x3d67('0x71')](_0x3a187a,function(_0x136ab0){return _0x15b2b3['includes'](_0x136ab0[_0x3d67('0x34')]);});return{'count':_0x3a187a[_0x3d67('0x3b')],'rows':_['map'](_0x3a187a,function(_0x50eb1c){return{'id':_0x50eb1c[_0x3d67('0x34')],'name':_0x50eb1c[_0x3d67('0x72')],'custom':_['endsWith'](_0x50eb1c['name'],'_c')?!![]:![],'options':_0x50eb1c[_0x3d67('0x45')]?_[_0x3d67('0x30')](_[_0x3d67('0x73')](_0x50eb1c[_0x3d67('0x45')]),function(_0xe6458d){return{'name':_0xe6458d['value'],'value':_0xe6458d[_0x3d67('0x34')]};}):[]};})};}})[_0x3d67('0x2b')](respondWithResult(_0x3da75a,null))[_0x3d67('0x47')](function(_0xfadaf9){var _0x4189cf=_0x3eda13[_0x3d67('0x35')][_0x3d67('0x74')]?0x1f4:_0xfadaf9[_0x3d67('0x75')]||0x1f4;logger[_0x3d67('0x2d')](_0x3d67('0x76'),'getFields',_0x4189cf,JSON[_0x3d67('0x77')](_0xfadaf9));delete _0xfadaf9[_0x3d67('0x34')];if(_0x4189cf===0x191){_0x4189cf=0x190;}_0x3da75a['status'](_0x4189cf)[_0x3d67('0x78')](_0x3eda13[_0x3d67('0x35')][_0x3d67('0x74')]?{'message':'Wrong\x20credentials','statusCode':_0xfadaf9['statusCode']}:_0xfadaf9);});}else{var _0x3b0a03=0x1f4;_0x3da75a[_0x3d67('0x1f')](_0x3b0a03)[_0x3d67('0x78')]({'message':_0x3d67('0x79'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x0f1e=['nolimit','sort','pick','filters','filter','where','VIRTUAL','options','SugarcrmAccount','includeAll','rows','params','include','merge','catch','create','body','find','findOne','SugarcrmConfiguration','length','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','date_start','duration_hours','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','module_fields','label','endsWith','values','value','test','statusCode','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','fields','query','hasOwnProperty'];(function(_0xdb200d,_0x4cd806){var _0x36a104=function(_0x57be33){while(--_0x57be33){_0xdb200d['push'](_0xdb200d['shift']());}};_0x36a104(++_0x4cd806);}(_0x0f1e,0x1a7));var _0xe0f1=function(_0x508a19,_0xba5af1){_0x508a19=_0x508a19-0x0;var _0x2b2393=_0x0f1e[_0x508a19];return _0x2b2393;};'use strict';var emlformat=require(_0xe0f1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0f1('0x1'));var jsonpatch=require(_0xe0f1('0x2'));var rp=require(_0xe0f1('0x3'));var moment=require(_0xe0f1('0x4'));var BPromise=require(_0xe0f1('0x5'));var Mustache=require('mustache');var util=require(_0xe0f1('0x6'));var path=require('path');var sox=require(_0xe0f1('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe0f1('0x8'));var _=require(_0xe0f1('0x9'));var squel=require(_0xe0f1('0xa'));var crypto=require(_0xe0f1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0f1('0xc'));var toCsv=require(_0xe0f1('0xd'));var querystring=require(_0xe0f1('0xe'));var Papa=require('papaparse');var Redis=require(_0xe0f1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe0f1('0x10'));var as=require(_0xe0f1('0x11'));var hardwareService=require(_0xe0f1('0x12'));var logger=require(_0xe0f1('0x13'))(_0xe0f1('0x14'));var utils=require(_0xe0f1('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe0f1('0x16'));var db=require(_0xe0f1('0x17'))['db'];var integrations=require(_0xe0f1('0x18'));function respondWithStatusCode(_0x2b0c28,_0x124473){_0x124473=_0x124473||0xcc;return function(_0x36c888){if(_0x36c888){return _0x2b0c28[_0xe0f1('0x19')](_0x124473);}return _0x2b0c28[_0xe0f1('0x1a')](_0x124473)[_0xe0f1('0x1b')]();};}function respondWithResult(_0x487923,_0x1ba556){_0x1ba556=_0x1ba556||0xc8;return function(_0x2207af){if(_0x2207af){return _0x487923['status'](_0x1ba556)[_0xe0f1('0x1c')](_0x2207af);}};}function respondWithFilteredResult(_0x27cdbe,_0x1c6bc9){return function(_0xf8618d){if(_0xf8618d){var _0x31fe6c=typeof _0x1c6bc9[_0xe0f1('0x1d')]===_0xe0f1('0x1e')&&typeof _0x1c6bc9[_0xe0f1('0x1f')]===_0xe0f1('0x1e');var _0x2dd285=_0xf8618d[_0xe0f1('0x20')];var _0x3a516c=_0x31fe6c?0x0:_0x1c6bc9[_0xe0f1('0x1d')];var _0x495680=_0x31fe6c?_0xf8618d[_0xe0f1('0x20')]:_0x1c6bc9[_0xe0f1('0x1d')]+_0x1c6bc9[_0xe0f1('0x1f')];var _0xb86750;if(_0x495680>=_0x2dd285){_0x495680=_0x2dd285;_0xb86750=0xc8;}else{_0xb86750=0xce;}_0x27cdbe[_0xe0f1('0x1a')](_0xb86750);return _0x27cdbe[_0xe0f1('0x21')](_0xe0f1('0x22'),_0x3a516c+'-'+_0x495680+'/'+_0x2dd285)[_0xe0f1('0x1c')](_0xf8618d);}return null;};}function patchUpdates(_0x48afa0){return function(_0x63fdfc){try{jsonpatch[_0xe0f1('0x23')](_0x63fdfc,_0x48afa0,!![]);}catch(_0x11e65f){return BPromise[_0xe0f1('0x24')](_0x11e65f);}return _0x63fdfc[_0xe0f1('0x25')]();};}function saveUpdates(_0x22353d,_0xf3cf5a){return function(_0x5cabaa){if(_0x5cabaa){return _0x5cabaa[_0xe0f1('0x26')](_0x22353d)['then'](function(_0x31b3a7){return _0x31b3a7;});}return null;};}function removeEntity(_0x186b6d,_0x26e01d){return function(_0x4e9eaa){if(_0x4e9eaa){return _0x4e9eaa[_0xe0f1('0x27')]()[_0xe0f1('0x28')](function(){_0x186b6d['status'](0xcc)[_0xe0f1('0x1b')]();});}};}function handleEntityNotFound(_0x5d8281,_0x4c1b77){return function(_0x11f7a0){if(!_0x11f7a0){_0x5d8281['sendStatus'](0x194);}return _0x11f7a0;};}function handleError(_0x3f5cca,_0x4040cb){_0x4040cb=_0x4040cb||0x1f4;return function(_0x12df6){logger[_0xe0f1('0x29')](_0x12df6[_0xe0f1('0x2a')]);if(_0x12df6[_0xe0f1('0x2b')]){delete _0x12df6[_0xe0f1('0x2b')];}_0x3f5cca[_0xe0f1('0x1a')](_0x4040cb)['send'](_0x12df6);};}exports[_0xe0f1('0x2c')]=function(_0x42e098,_0x379ec1){var _0x594f6a={},_0x2ac7e0={},_0x5c7865={'count':0x0,'rows':[]};var _0x5b4076=_[_0xe0f1('0x2d')](db['SugarcrmAccount'][_0xe0f1('0x2e')],function(_0x5b6b2e){return{'name':_0x5b6b2e[_0xe0f1('0x2f')],'type':_0x5b6b2e[_0xe0f1('0x30')][_0xe0f1('0x31')]};});_0x2ac7e0[_0xe0f1('0x32')]=_[_0xe0f1('0x2d')](_0x5b4076,_0xe0f1('0x2b'));_0x2ac7e0['query']=_[_0xe0f1('0x33')](_0x42e098['query']);_0x2ac7e0['filters']=_[_0xe0f1('0x34')](_0x2ac7e0[_0xe0f1('0x32')],_0x2ac7e0['query']);_0x594f6a[_0xe0f1('0x35')]=_[_0xe0f1('0x34')](_0x2ac7e0[_0xe0f1('0x32')],qs[_0xe0f1('0x36')](_0x42e098['query'][_0xe0f1('0x36')]));_0x594f6a[_0xe0f1('0x35')]=_0x594f6a[_0xe0f1('0x35')]['length']?_0x594f6a[_0xe0f1('0x35')]:_0x2ac7e0['model'];if(!_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x38')](_0xe0f1('0x39'))){_0x594f6a[_0xe0f1('0x1f')]=qs[_0xe0f1('0x1f')](_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x1f')]);_0x594f6a[_0xe0f1('0x1d')]=qs[_0xe0f1('0x1d')](_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x1d')]);}_0x594f6a['order']=qs[_0xe0f1('0x3a')](_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x3a')]);_0x594f6a['where']=qs['filters'](_[_0xe0f1('0x3b')](_0x42e098['query'],_0x2ac7e0[_0xe0f1('0x3c')]),_0x5b4076);if(_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x3d')]){_0x594f6a[_0xe0f1('0x3e')]=_['merge'](_0x594f6a[_0xe0f1('0x3e')],{'$or':_['map'](_0x5b4076,function(_0x953282){if(_0x953282[_0xe0f1('0x30')]!==_0xe0f1('0x3f')){var _0x45eac7={};_0x45eac7[_0x953282[_0xe0f1('0x2b')]]={'$like':'%'+_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x3d')]+'%'};return _0x45eac7;}})});}_0x594f6a=_['merge']({},_0x594f6a,_0x42e098[_0xe0f1('0x40')]);var _0x4aac47={'where':_0x594f6a[_0xe0f1('0x3e')]};return db[_0xe0f1('0x41')]['count'](_0x4aac47)['then'](function(_0xd0b5d6){_0x5c7865[_0xe0f1('0x20')]=_0xd0b5d6;if(_0x42e098[_0xe0f1('0x37')][_0xe0f1('0x42')]){_0x594f6a['include']=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x594f6a);})[_0xe0f1('0x28')](function(_0x59f50b){_0x5c7865[_0xe0f1('0x43')]=_0x59f50b;return _0x5c7865;})[_0xe0f1('0x28')](respondWithFilteredResult(_0x379ec1,_0x594f6a))['catch'](handleError(_0x379ec1,null));};exports['show']=function(_0x2d7999,_0x2b1d4e){var _0x449d90={'raw':![],'where':{'id':_0x2d7999[_0xe0f1('0x44')]['id']}},_0x2d7e10={};_0x2d7e10[_0xe0f1('0x32')]=_[_0xe0f1('0x33')](db[_0xe0f1('0x41')][_0xe0f1('0x2e')]);_0x2d7e10['query']=_['keys'](_0x2d7999['query']);_0x2d7e10['filters']=_[_0xe0f1('0x34')](_0x2d7e10['model'],_0x2d7e10[_0xe0f1('0x37')]);_0x449d90[_0xe0f1('0x35')]=_[_0xe0f1('0x34')](_0x2d7e10[_0xe0f1('0x32')],qs['fields'](_0x2d7999[_0xe0f1('0x37')][_0xe0f1('0x36')]));_0x449d90[_0xe0f1('0x35')]=_0x449d90['attributes']['length']?_0x449d90['attributes']:_0x2d7e10[_0xe0f1('0x32')];if(_0x2d7999[_0xe0f1('0x37')][_0xe0f1('0x42')]){_0x449d90[_0xe0f1('0x45')]=[{'all':!![]}];}_0x449d90=_[_0xe0f1('0x46')]({},_0x449d90,_0x2d7999[_0xe0f1('0x40')]);return db['SugarcrmAccount']['find'](_0x449d90)[_0xe0f1('0x28')](handleEntityNotFound(_0x2b1d4e,null))['then'](respondWithResult(_0x2b1d4e,null))[_0xe0f1('0x47')](handleError(_0x2b1d4e,null));};exports[_0xe0f1('0x48')]=function(_0x1400c8,_0x26be8b){return db['SugarcrmAccount'][_0xe0f1('0x48')](_0x1400c8[_0xe0f1('0x49')],{})['then'](respondWithResult(_0x26be8b,0xc9))[_0xe0f1('0x47')](handleError(_0x26be8b,null));};exports[_0xe0f1('0x26')]=function(_0x1a2d7d,_0x35b28d){if(_0x1a2d7d['body']['id']){delete _0x1a2d7d[_0xe0f1('0x49')]['id'];}return db[_0xe0f1('0x41')]['find']({'where':{'id':_0x1a2d7d[_0xe0f1('0x44')]['id']}})[_0xe0f1('0x28')](handleEntityNotFound(_0x35b28d,null))[_0xe0f1('0x28')](saveUpdates(_0x1a2d7d['body'],null))[_0xe0f1('0x28')](respondWithResult(_0x35b28d,null))[_0xe0f1('0x47')](handleError(_0x35b28d,null));};exports['destroy']=function(_0x2d543a,_0x1bd98d){return db[_0xe0f1('0x41')][_0xe0f1('0x4a')]({'where':{'id':_0x2d543a[_0xe0f1('0x44')]['id']}})[_0xe0f1('0x28')](handleEntityNotFound(_0x1bd98d,null))[_0xe0f1('0x28')](removeEntity(_0x1bd98d,null))[_0xe0f1('0x47')](handleError(_0x1bd98d,null));};exports['getConfigurations']=function(_0x1cf417,_0x5b6a8a,_0x871751){var _0x456c10={};var _0x4ba46e={};var _0xe52bd0;var _0x4f85be;return db[_0xe0f1('0x41')][_0xe0f1('0x4b')]({'where':{'id':_0x1cf417[_0xe0f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b6a8a,null))[_0xe0f1('0x28')](function(_0x1c2513){if(_0x1c2513){_0xe52bd0=_0x1c2513;_0x4ba46e[_0xe0f1('0x32')]=_[_0xe0f1('0x33')](db[_0xe0f1('0x4c')][_0xe0f1('0x2e')]);_0x4ba46e['query']=_[_0xe0f1('0x33')](_0x1cf417[_0xe0f1('0x37')]);_0x4ba46e[_0xe0f1('0x3c')]=_['intersection'](_0x4ba46e[_0xe0f1('0x32')],_0x4ba46e[_0xe0f1('0x37')]);_0x456c10[_0xe0f1('0x35')]=_['intersection'](_0x4ba46e[_0xe0f1('0x32')],qs['fields'](_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x36')]));_0x456c10[_0xe0f1('0x35')]=_0x456c10[_0xe0f1('0x35')][_0xe0f1('0x4d')]?_0x456c10['attributes']:_0x4ba46e[_0xe0f1('0x32')];_0x456c10['order']=qs[_0xe0f1('0x3a')](_0x1cf417['query'][_0xe0f1('0x3a')]);_0x456c10[_0xe0f1('0x3e')]=qs[_0xe0f1('0x3c')](_[_0xe0f1('0x3b')](_0x1cf417[_0xe0f1('0x37')],_0x4ba46e[_0xe0f1('0x3c')]));if(_0x1cf417[_0xe0f1('0x37')]['filter']){_0x456c10[_0xe0f1('0x3e')]=_[_0xe0f1('0x46')](_0x456c10['where'],{'$or':_[_0xe0f1('0x2d')](_0x456c10[_0xe0f1('0x35')],function(_0x430ebb){var _0xb86993={};_0xb86993[_0x430ebb]={'$like':'%'+_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x3d')]+'%'};return _0xb86993;})});}_0x456c10=_[_0xe0f1('0x46')]({},_0x456c10,_0x1cf417[_0xe0f1('0x40')]);return _0xe52bd0[_0xe0f1('0x4e')](_0x456c10);}})['then'](function(_0x3352b2){if(_0x3352b2){_0x4f85be=_0x3352b2[_0xe0f1('0x4d')];if(!_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x38')]('nolimit')){_0x456c10[_0xe0f1('0x1f')]=qs[_0xe0f1('0x1f')](_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x1f')]);_0x456c10['offset']=qs['offset'](_0x1cf417[_0xe0f1('0x37')][_0xe0f1('0x1d')]);}return _0xe52bd0['getConfigurations'](_0x456c10);}})['then'](function(_0x215b27){if(_0x215b27){return _0x215b27?{'count':_0x4f85be,'rows':_0x215b27}:null;}})[_0xe0f1('0x28')](respondWithResult(_0x5b6a8a,null))['catch'](handleError(_0x5b6a8a,null));};exports[_0xe0f1('0x4f')]=function(_0xb0c2ff,_0x59d990,_0x1c440a){if(_0xb0c2ff[_0xe0f1('0x49')]['id']){delete _0xb0c2ff['body']['id'];}return db[_0xe0f1('0x41')][_0xe0f1('0x4b')]({'where':{'id':_0xb0c2ff[_0xe0f1('0x44')]['id']}})['then'](handleEntityNotFound(_0x59d990,null))[_0xe0f1('0x28')](function(_0x32758d){if(_0x32758d){_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x50')]=_0x32758d['id'];_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x51')]=integrations['getSubjects'](_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x52')],_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x30')]);_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x53')]=integrations['getDescriptions'](_0xb0c2ff[_0xe0f1('0x49')]['channel'],_0xb0c2ff[_0xe0f1('0x49')][_0xe0f1('0x30')]);return db[_0xe0f1('0x4c')][_0xe0f1('0x48')](_0xb0c2ff['body'],{'include':[{'model':db[_0xe0f1('0x54')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xe0f1('0x53')}]});}return null;})[_0xe0f1('0x28')](respondWithResult(_0x59d990,null))[_0xe0f1('0x47')](handleError(_0x59d990,null));};exports[_0xe0f1('0x55')]=function(_0x53b378,_0x23cc01,_0x457135){var _0xa5312f='';var _0x35ce22=['id',_0xe0f1('0x2b'),_0xe0f1('0x56'),'created_by','description',_0xe0f1('0x57'),_0xe0f1('0x58'),'duration_minutes',_0xe0f1('0x59'),_0xe0f1('0x5a'),_0xe0f1('0x5b'),_0xe0f1('0x5c')];return db[_0xe0f1('0x41')]['findOne']({'where':{'id':_0x53b378['params']['id']},'attributes':['id','username',_0xe0f1('0x5d'),_0xe0f1('0x5e')]})[_0xe0f1('0x28')](handleEntityNotFound(_0x23cc01,null))['then'](function(_0x29557b){if(_0x29557b){_0xa5312f=_0x29557b[_0xe0f1('0x5e')];var _0x3d2465=_0xa5312f[_0xe0f1('0x5f')](-0x1);if(_0x3d2465==='/'){_0xa5312f=_0xa5312f[_0xe0f1('0x60')](0x0,_0xa5312f[_0xe0f1('0x61')](_0x3d2465));}return rp({'method':_0xe0f1('0x62'),'uri':util[_0xe0f1('0x63')](_0xe0f1('0x64'),_0xa5312f,_0xe0f1('0x65')),'json':!![],'form':{'method':_0xe0f1('0x66'),'input_type':_0xe0f1('0x67'),'response_type':_0xe0f1('0x67'),'rest_data':JSON[_0xe0f1('0x68')]({'user_auth':{'user_name':_0x29557b[_0xe0f1('0x69')],'password':_0x29557b[_0xe0f1('0x5d')],'encryption':_0xe0f1('0x6a')},'application':_0xe0f1('0x6b')})}});}})[_0xe0f1('0x28')](function(_0x9344d9){if(_0x9344d9&&_0x9344d9[_0xe0f1('0x2b')]!==_0xe0f1('0x6c')&&_0x9344d9['name']!==_0xe0f1('0x6d')){return rp({'method':_0xe0f1('0x62'),'uri':util[_0xe0f1('0x63')](_0xe0f1('0x64'),_0xa5312f,_0xe0f1('0x65')),'json':!![],'form':{'method':_0xe0f1('0x6e'),'input_type':_0xe0f1('0x67'),'response_type':_0xe0f1('0x67'),'rest_data':JSON[_0xe0f1('0x68')]({'session':_0x9344d9['id'],'module_name':'Calls'})}})[_0xe0f1('0x28')](function(_0x50bc7e){if(_0x50bc7e){var _0x4b2b7a=_['values'](_0x50bc7e[_0xe0f1('0x6f')]);_['remove'](_0x4b2b7a,function(_0x35943f){return _0x35ce22['includes'](_0x35943f[_0xe0f1('0x2b')]);});return{'count':_0x4b2b7a['length'],'rows':_[_0xe0f1('0x2d')](_0x4b2b7a,function(_0x24db46){return{'id':_0x24db46[_0xe0f1('0x2b')],'name':_0x24db46[_0xe0f1('0x70')],'custom':_[_0xe0f1('0x71')](_0x24db46[_0xe0f1('0x2b')],'_c')?!![]:![],'options':_0x24db46[_0xe0f1('0x40')]?_[_0xe0f1('0x2d')](_[_0xe0f1('0x72')](_0x24db46[_0xe0f1('0x40')]),function(_0x4cf9d0){return{'name':_0x4cf9d0[_0xe0f1('0x73')],'value':_0x4cf9d0[_0xe0f1('0x2b')]};}):[]};})};}})[_0xe0f1('0x28')](respondWithResult(_0x23cc01,null))[_0xe0f1('0x47')](function(_0x1d9191){var _0x13596f=_0x53b378['query'][_0xe0f1('0x74')]?0x1f4:_0x1d9191[_0xe0f1('0x75')]||0x1f4;logger[_0xe0f1('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xe0f1('0x55'),_0x13596f,JSON[_0xe0f1('0x68')](_0x1d9191));delete _0x1d9191[_0xe0f1('0x2b')];if(_0x13596f===0x191){_0x13596f=0x190;}_0x23cc01[_0xe0f1('0x1a')](_0x13596f)[_0xe0f1('0x76')](_0x53b378[_0xe0f1('0x37')][_0xe0f1('0x74')]?{'message':_0xe0f1('0x77'),'statusCode':_0x1d9191[_0xe0f1('0x75')]}:_0x1d9191);});}else{var _0x355e6b=0x1f4;_0x23cc01[_0xe0f1('0x1a')](_0x355e6b)['send']({'message':_0xe0f1('0x77'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index eec814c..94df2e0 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 _0xcf33=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x5a19f4,_0x541be7){var _0x304b93=function(_0x3af042){while(--_0x3af042){_0x5a19f4['push'](_0x5a19f4['shift']());}};_0x304b93(++_0x541be7);}(_0xcf33,0x114));var _0x3cf3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xcf33[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var logger=require(_0x3cf3('0x2'))('api');var moment=require(_0x3cf3('0x3'));var BPromise=require('bluebird');var rp=require(_0x3cf3('0x4'));var fs=require('fs');var path=require(_0x3cf3('0x5'));var rimraf=require(_0x3cf3('0x6'));var config=require('../../config/environment');var attributes=require(_0x3cf3('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x3cf3('0x8')]=function(_0x37897f,_0x539e1e){return _0x37897f[_0x3cf3('0x9')](_0x3cf3('0xa'),attributes,{'tableName':_0x3cf3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x95a6=['request-promise','path','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird'];(function(_0x499c61,_0x3a0666){var _0x2eaaae=function(_0x314857){while(--_0x314857){_0x499c61['push'](_0x499c61['shift']());}};_0x2eaaae(++_0x3a0666);}(_0x95a6,0xe5));var _0x695a=function(_0x307d4c,_0x25fbcb){_0x307d4c=_0x307d4c-0x0;var _0x3d872f=_0x95a6[_0x307d4c];return _0x3d872f;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var logger=require('../../config/logger')(_0x695a('0x2'));var moment=require(_0x695a('0x3'));var BPromise=require(_0x695a('0x4'));var rp=require(_0x695a('0x5'));var fs=require('fs');var path=require(_0x695a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x695a('0x7'));var integrations=require(_0x695a('0x8'));module[_0x695a('0x9')]=function(_0xe45b1d,_0x4160bc){return _0xe45b1d[_0x695a('0xa')](_0x695a('0xb'),attributes,{'tableName':_0x695a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 2a9c036..df30e6a 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 _0x8807=['SugarcrmAccount','findAll','options','raw','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','where','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x5017c0,_0x1a6afd){var _0x58962d=function(_0x328195){while(--_0x328195){_0x5017c0['push'](_0x5017c0['shift']());}};_0x58962d(++_0x1a6afd);}(_0x8807,0xc3));var _0x7880=function(_0x51b648,_0x3af80d){_0x51b648=_0x51b648-0x0;var _0x58a6e5=_0x8807[_0x51b648];return _0x58a6e5;};'use strict';var _=require(_0x7880('0x0'));var util=require(_0x7880('0x1'));var moment=require(_0x7880('0x2'));var BPromise=require('bluebird');var rs=require(_0x7880('0x3'));var fs=require('fs');var Redis=require(_0x7880('0x4'));var db=require(_0x7880('0x5'))['db'];var utils=require(_0x7880('0x6'));var logger=require('../../config/logger')(_0x7880('0x7'));var config=require(_0x7880('0x8'));var jayson=require(_0x7880('0x9'));var client=jayson[_0x7880('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24f7f3,_0x497aa9,_0x5e2ec9){return new BPromise(function(_0x319f65,_0x260f9f){return client[_0x7880('0xb')](_0x24f7f3,_0x5e2ec9)[_0x7880('0xc')](function(_0x2d48fa){logger[_0x7880('0xd')](_0x7880('0xe'),_0x497aa9,_0x7880('0xf'));logger[_0x7880('0x10')](_0x7880('0x11'),_0x497aa9,_0x7880('0xf'),JSON['stringify'](_0x2d48fa));if(_0x2d48fa[_0x7880('0x12')]){if(_0x2d48fa[_0x7880('0x12')]['code']===0x1f4){logger[_0x7880('0x12')](_0x7880('0xe'),_0x497aa9,_0x2d48fa[_0x7880('0x12')][_0x7880('0x13')]);return _0x260f9f(_0x2d48fa[_0x7880('0x12')]['message']);}logger['error'](_0x7880('0xe'),_0x497aa9,_0x2d48fa['error']['message']);return _0x319f65(_0x2d48fa[_0x7880('0x12')]['message']);}else{logger[_0x7880('0xd')](_0x7880('0xe'),_0x497aa9,'request\x20sent');_0x319f65(_0x2d48fa[_0x7880('0x14')]['message']);}})['catch'](function(_0x19e727){logger[_0x7880('0x12')](_0x7880('0xe'),_0x497aa9,_0x19e727);_0x260f9f(_0x19e727);});});}exports['GetSugarcrmAccount']=function(_0x593bed){var _0x9e99=this;return new Promise(function(_0x16aa87,_0x539450){return db[_0x7880('0x15')][_0x7880('0x16')]({'raw':_0x593bed[_0x7880('0x17')]?_0x593bed['options'][_0x7880('0x18')]===undefined?!![]:![]:!![],'where':_0x593bed[_0x7880('0x17')]?_0x593bed[_0x7880('0x17')]['where']||null:null,'attributes':_0x593bed[_0x7880('0x17')]?_0x593bed[_0x7880('0x17')][_0x7880('0x19')]||null:null,'limit':_0x593bed[_0x7880('0x17')]?_0x593bed['options'][_0x7880('0x1a')]||null:null,'include':_0x593bed[_0x7880('0x17')]?_0x593bed[_0x7880('0x17')][_0x7880('0x1b')]?_[_0x7880('0x1c')](_0x593bed['options'][_0x7880('0x1b')],function(_0x47df39){return{'model':db[_0x47df39[_0x7880('0x1d')]],'as':_0x47df39['as'],'attributes':_0x47df39[_0x7880('0x19')],'include':_0x47df39[_0x7880('0x1b')]?_[_0x7880('0x1c')](_0x47df39[_0x7880('0x1b')],function(_0x38dcb6){return{'model':db[_0x38dcb6['model']],'as':_0x38dcb6['as'],'attributes':_0x38dcb6[_0x7880('0x19')],'include':_0x38dcb6[_0x7880('0x1b')]?_[_0x7880('0x1c')](_0x38dcb6[_0x7880('0x1b')],function(_0x5c1497){return{'model':db[_0x5c1497[_0x7880('0x1d')]],'as':_0x5c1497['as'],'attributes':_0x5c1497[_0x7880('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7880('0xc')](function(_0x4dc927){logger[_0x7880('0xd')](_0x7880('0x1e'),_0x593bed);logger[_0x7880('0x10')](_0x7880('0x1e'),_0x593bed,JSON['stringify'](_0x4dc927));_0x16aa87(_0x4dc927);})['catch'](function(_0x4e3eb5){logger[_0x7880('0x12')](_0x7880('0x1e'),_0x4e3eb5[_0x7880('0x13')],_0x593bed);_0x539450(_0x9e99[_0x7880('0x12')](0x1f4,_0x4e3eb5[_0x7880('0x13')]));});});};exports[_0x7880('0x1f')]=function(_0x3904f5){var _0x3ab1d5=this;return new Promise(function(_0x15e2eb,_0x548476){return db['SugarcrmAccount'][_0x7880('0x20')]({'raw':_0x3904f5[_0x7880('0x17')]?_0x3904f5[_0x7880('0x17')][_0x7880('0x18')]===undefined?!![]:![]:!![],'where':_0x3904f5[_0x7880('0x17')]?_0x3904f5['options'][_0x7880('0x21')]||null:null,'attributes':_0x3904f5[_0x7880('0x17')]?_0x3904f5['options']['attributes']||null:null,'include':_0x3904f5['options']?_0x3904f5[_0x7880('0x17')][_0x7880('0x1b')]?_[_0x7880('0x1c')](_0x3904f5[_0x7880('0x17')]['include'],function(_0x5d312f){return{'model':db[_0x5d312f[_0x7880('0x1d')]],'as':_0x5d312f['as'],'attributes':_0x5d312f[_0x7880('0x19')],'include':_0x5d312f[_0x7880('0x1b')]?_['map'](_0x5d312f[_0x7880('0x1b')],function(_0x4adbe4){return{'model':db[_0x4adbe4[_0x7880('0x1d')]],'as':_0x4adbe4['as'],'attributes':_0x4adbe4[_0x7880('0x19')],'include':_0x4adbe4['include']?_[_0x7880('0x1c')](_0x4adbe4['include'],function(_0x4f2d6c){return{'model':db[_0x4f2d6c[_0x7880('0x1d')]],'as':_0x4f2d6c['as'],'attributes':_0x4f2d6c[_0x7880('0x19')]};}):[]};}):[]};}):[]:[]})[_0x7880('0xc')](function(_0x18e30a){logger['info'](_0x7880('0x1f'),_0x3904f5);logger[_0x7880('0x10')](_0x7880('0x1f'),_0x3904f5,JSON[_0x7880('0x22')](_0x18e30a));_0x15e2eb(_0x18e30a);})[_0x7880('0x23')](function(_0x585f56){logger[_0x7880('0x12')](_0x7880('0x1f'),_0x585f56[_0x7880('0x13')],_0x3904f5);_0x548476(_0x3ab1d5[_0x7880('0x12')](0x1f4,_0x585f56[_0x7880('0x13')]));});});}; \ No newline at end of file +var _0x0039=['raw','where','attributes','limit','map','model','include','debug','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SugarcrmAccount,\x20%s,\x20%s','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options'];(function(_0x3a23f1,_0x401962){var _0x484219=function(_0x2d862b){while(--_0x2d862b){_0x3a23f1['push'](_0x3a23f1['shift']());}};_0x484219(++_0x401962);}(_0x0039,0x15d));var _0x9003=function(_0x6e1a41,_0x18b6d3){_0x6e1a41=_0x6e1a41-0x0;var _0x2114f9=_0x0039[_0x6e1a41];return _0x2114f9;};'use strict';var _=require(_0x9003('0x0'));var util=require(_0x9003('0x1'));var moment=require(_0x9003('0x2'));var BPromise=require(_0x9003('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9003('0x4'));var db=require(_0x9003('0x5'))['db'];var utils=require(_0x9003('0x6'));var logger=require('../../config/logger')(_0x9003('0x7'));var config=require(_0x9003('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x47600a,_0x2dc0d6,_0x36d178){return new BPromise(function(_0x41245a,_0x1f6245){return client[_0x9003('0x9')](_0x47600a,_0x36d178)[_0x9003('0xa')](function(_0x5aae03){logger[_0x9003('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x2dc0d6,_0x9003('0xc'));logger['debug'](_0x9003('0xd'),_0x2dc0d6,_0x9003('0xc'),JSON[_0x9003('0xe')](_0x5aae03));if(_0x5aae03[_0x9003('0xf')]){if(_0x5aae03[_0x9003('0xf')][_0x9003('0x10')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x2dc0d6,_0x5aae03['error'][_0x9003('0x11')]);return _0x1f6245(_0x5aae03[_0x9003('0xf')]['message']);}logger['error'](_0x9003('0x12'),_0x2dc0d6,_0x5aae03[_0x9003('0xf')]['message']);return _0x41245a(_0x5aae03['error'][_0x9003('0x11')]);}else{logger[_0x9003('0xb')](_0x9003('0x12'),_0x2dc0d6,_0x9003('0xc'));_0x41245a(_0x5aae03[_0x9003('0x13')][_0x9003('0x11')]);}})[_0x9003('0x14')](function(_0x566325){logger[_0x9003('0xf')](_0x9003('0x12'),_0x2dc0d6,_0x566325);_0x1f6245(_0x566325);});});}exports[_0x9003('0x15')]=function(_0x938139){var _0x5399b0=this;return new Promise(function(_0x2ebe1c,_0x2fac88){return db[_0x9003('0x16')][_0x9003('0x17')]({'raw':_0x938139['options']?_0x938139[_0x9003('0x18')][_0x9003('0x19')]===undefined?!![]:![]:!![],'where':_0x938139['options']?_0x938139[_0x9003('0x18')][_0x9003('0x1a')]||null:null,'attributes':_0x938139['options']?_0x938139[_0x9003('0x18')][_0x9003('0x1b')]||null:null,'limit':_0x938139[_0x9003('0x18')]?_0x938139[_0x9003('0x18')][_0x9003('0x1c')]||null:null,'include':_0x938139[_0x9003('0x18')]?_0x938139[_0x9003('0x18')]['include']?_[_0x9003('0x1d')](_0x938139['options']['include'],function(_0x434cd7){return{'model':db[_0x434cd7[_0x9003('0x1e')]],'as':_0x434cd7['as'],'attributes':_0x434cd7[_0x9003('0x1b')],'include':_0x434cd7[_0x9003('0x1f')]?_[_0x9003('0x1d')](_0x434cd7[_0x9003('0x1f')],function(_0x40aa81){return{'model':db[_0x40aa81[_0x9003('0x1e')]],'as':_0x40aa81['as'],'attributes':_0x40aa81[_0x9003('0x1b')],'include':_0x40aa81[_0x9003('0x1f')]?_[_0x9003('0x1d')](_0x40aa81['include'],function(_0x3da81c){return{'model':db[_0x3da81c[_0x9003('0x1e')]],'as':_0x3da81c['as'],'attributes':_0x3da81c[_0x9003('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9003('0xa')](function(_0x385c03){logger[_0x9003('0xb')](_0x9003('0x15'),_0x938139);logger[_0x9003('0x20')](_0x9003('0x15'),_0x938139,JSON[_0x9003('0xe')](_0x385c03));_0x2ebe1c(_0x385c03);})['catch'](function(_0x2ab72e){logger[_0x9003('0xf')](_0x9003('0x15'),_0x2ab72e[_0x9003('0x11')],_0x938139);_0x2fac88(_0x5399b0[_0x9003('0xf')](0x1f4,_0x2ab72e[_0x9003('0x11')]));});});};exports[_0x9003('0x21')]=function(_0x3ecd89){var _0x4ffe5c=this;return new Promise(function(_0x5489ce,_0x59e3b8){return db['SugarcrmAccount']['find']({'raw':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89['options'][_0x9003('0x19')]===undefined?!![]:![]:!![],'where':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89[_0x9003('0x18')][_0x9003('0x1a')]||null:null,'attributes':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89['options'][_0x9003('0x1b')]||null:null,'include':_0x3ecd89[_0x9003('0x18')]?_0x3ecd89['options']['include']?_[_0x9003('0x1d')](_0x3ecd89[_0x9003('0x18')][_0x9003('0x1f')],function(_0x1e07aa){return{'model':db[_0x1e07aa[_0x9003('0x1e')]],'as':_0x1e07aa['as'],'attributes':_0x1e07aa[_0x9003('0x1b')],'include':_0x1e07aa[_0x9003('0x1f')]?_[_0x9003('0x1d')](_0x1e07aa[_0x9003('0x1f')],function(_0x40c585){return{'model':db[_0x40c585['model']],'as':_0x40c585['as'],'attributes':_0x40c585[_0x9003('0x1b')],'include':_0x40c585[_0x9003('0x1f')]?_['map'](_0x40c585[_0x9003('0x1f')],function(_0x3a19ff){return{'model':db[_0x3a19ff[_0x9003('0x1e')]],'as':_0x3a19ff['as'],'attributes':_0x3a19ff[_0x9003('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b69da){logger['info'](_0x9003('0x21'),_0x3ecd89);logger[_0x9003('0x20')](_0x9003('0x21'),_0x3ecd89,JSON[_0x9003('0xe')](_0x4b69da));_0x5489ce(_0x4b69da);})['catch'](function(_0x4e3c4f){logger[_0x9003('0xf')](_0x9003('0x21'),_0x4e3c4f[_0x9003('0x11')],_0x3ecd89);_0x59e3b8(_0x4ffe5c[_0x9003('0xf')](0x1f4,_0x4e3c4f[_0x9003('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index f5501b2..f32f07d 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 _0x0be7=['fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','destroy','exports','multer','util','path','express'];(function(_0x4f705c,_0x2f8534){var _0x4b2f2f=function(_0x115df3){while(--_0x115df3){_0x4f705c['push'](_0x4f705c['shift']());}};_0x4b2f2f(++_0x2f8534);}(_0x0be7,0x161));var _0x70be=function(_0x59a424,_0x357aa5){_0x59a424=_0x59a424-0x0;var _0x3c85da=_0x0be7[_0x59a424];return _0x3c85da;};'use strict';var multer=require(_0x70be('0x0'));var util=require(_0x70be('0x1'));var path=require(_0x70be('0x2'));var timeout=require('connect-timeout');var express=require(_0x70be('0x3'));var router=express['Router']();var fs_extra=require(_0x70be('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x70be('0x5'));var config=require(_0x70be('0x6'));var controller=require(_0x70be('0x7'));router[_0x70be('0x8')]('/',auth['isAuthenticated'](),controller[_0x70be('0x9')]);router[_0x70be('0x8')](_0x70be('0xa'),auth[_0x70be('0xb')](),controller['show']);router[_0x70be('0x8')](_0x70be('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x70be('0x8')](_0x70be('0xd'),auth[_0x70be('0xb')](),controller['getSubjects']);router[_0x70be('0x8')](_0x70be('0xe'),auth[_0x70be('0xb')](),controller[_0x70be('0xf')]);router[_0x70be('0x10')]('/',auth[_0x70be('0xb')](),controller[_0x70be('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x70be('0x12')]);router['delete'](_0x70be('0xa'),auth[_0x70be('0xb')](),controller[_0x70be('0x13')]);module[_0x70be('0x14')]=router; \ No newline at end of file +var _0x0f4e=['create','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/descriptions'];(function(_0x15b962,_0x4bd809){var _0xe4676b=function(_0x3b7e44){while(--_0x3b7e44){_0x15b962['push'](_0x15b962['shift']());}};_0xe4676b(++_0x4bd809);}(_0x0f4e,0x194));var _0xe0f4=function(_0x19d24c,_0x62bc50){_0x19d24c=_0x19d24c-0x0;var _0x2fae8d=_0x0f4e[_0x19d24c];return _0x2fae8d;};'use strict';var multer=require('multer');var util=require(_0xe0f4('0x0'));var path=require('path');var timeout=require(_0xe0f4('0x1'));var express=require(_0xe0f4('0x2'));var router=express[_0xe0f4('0x3')]();var fs_extra=require(_0xe0f4('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe0f4('0x5'));var config=require(_0xe0f4('0x6'));var controller=require(_0xe0f4('0x7'));router[_0xe0f4('0x8')]('/',auth['isAuthenticated'](),controller[_0xe0f4('0x9')]);router['get'](_0xe0f4('0xa'),auth[_0xe0f4('0xb')](),controller[_0xe0f4('0xc')]);router[_0xe0f4('0x8')](_0xe0f4('0xd'),auth[_0xe0f4('0xb')](),controller[_0xe0f4('0xe')]);router[_0xe0f4('0x8')]('/:id/subjects',auth[_0xe0f4('0xb')](),controller['getSubjects']);router['get'](_0xe0f4('0xf'),auth[_0xe0f4('0xb')](),controller['getDescriptions']);router['post']('/',auth[_0xe0f4('0xb')](),controller[_0xe0f4('0x10')]);router['put'](_0xe0f4('0xa'),auth[_0xe0f4('0xb')](),controller[_0xe0f4('0x11')]);router['delete'](_0xe0f4('0xa'),auth['isAuthenticated'](),controller[_0xe0f4('0x12')]);module[_0xe0f4('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 40ad6b9..b994f1c 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 _0x4ec8=['exports','STRING'];(function(_0x575a38,_0x2e83d7){var _0x5a7bdd=function(_0x1bf478){while(--_0x1bf478){_0x575a38['push'](_0x575a38['shift']());}};_0x5a7bdd(++_0x2e83d7);}(_0x4ec8,0x152));var _0x84ec=function(_0x406dc3,_0x4628af){_0x406dc3=_0x406dc3-0x0;var _0x41ca2f=_0x4ec8[_0x406dc3];return _0x41ca2f;};'use strict';var Sequelize=require('sequelize');module[_0x84ec('0x0')]={'name':{'type':Sequelize[_0x84ec('0x1')]},'description':{'type':Sequelize[_0x84ec('0x1')]}}; \ No newline at end of file +var _0x8951=['sequelize'];(function(_0x59d938,_0x39d421){var _0x46aa4c=function(_0x377a04){while(--_0x377a04){_0x59d938['push'](_0x59d938['shift']());}};_0x46aa4c(++_0x39d421);}(_0x8951,0xb3));var _0x1895=function(_0x1dd4d2,_0x369502){_0x1dd4d2=_0x1dd4d2-0x0;var _0x43b1b1=_0x8951[_0x1dd4d2];return _0x43b1b1;};'use strict';var Sequelize=require(_0x1895('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 22fa6ad..3cf83c1 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 _0x123e=['fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','map','VIRTUAL','options','includeAll','rows','catch','params','include','find','create','body','update','getFields','findOne','SugarcrmField','sort','merge','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs'];(function(_0x55388f,_0x25b707){var _0x205f32=function(_0x2e71ce){while(--_0x2e71ce){_0x55388f['push'](_0x55388f['shift']());}};_0x205f32(++_0x25b707);}(_0x123e,0x1d6));var _0xe123=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x123e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xe123('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe123('0x1'));var jsonpatch=require(_0xe123('0x2'));var rp=require(_0xe123('0x3'));var moment=require(_0xe123('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe123('0x5'));var util=require(_0xe123('0x6'));var path=require(_0xe123('0x7'));var sox=require('sox');var csv=require(_0xe123('0x8'));var ejs=require(_0xe123('0x9'));var fs=require('fs');var fs_extra=require(_0xe123('0xa'));var _=require('lodash');var squel=require(_0xe123('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe123('0x8'));var querystring=require(_0xe123('0xc'));var Papa=require(_0xe123('0xd'));var Redis=require('ioredis');var authService=require(_0xe123('0xe'));var qs=require(_0xe123('0xf'));var as=require(_0xe123('0x10'));var hardwareService=require(_0xe123('0x11'));var logger=require(_0xe123('0x12'))('api');var utils=require(_0xe123('0x13'));var config=require(_0xe123('0x14'));var licenseUtil=require(_0xe123('0x15'));var db=require(_0xe123('0x16'))['db'];function respondWithStatusCode(_0x1f9f01,_0x1816a7){_0x1816a7=_0x1816a7||0xcc;return function(_0x29e6b2){if(_0x29e6b2){return _0x1f9f01[_0xe123('0x17')](_0x1816a7);}return _0x1f9f01[_0xe123('0x18')](_0x1816a7)[_0xe123('0x19')]();};}function respondWithResult(_0x10b874,_0x339b5b){_0x339b5b=_0x339b5b||0xc8;return function(_0x1ba3b4){if(_0x1ba3b4){return _0x10b874[_0xe123('0x18')](_0x339b5b)['json'](_0x1ba3b4);}};}function respondWithFilteredResult(_0x287af3,_0x2a38cd){return function(_0x347918){if(_0x347918){var _0x49ed10=typeof _0x2a38cd[_0xe123('0x1a')]===_0xe123('0x1b')&&typeof _0x2a38cd[_0xe123('0x1c')]===_0xe123('0x1b');var _0x68e252=_0x347918[_0xe123('0x1d')];var _0x51dd02=_0x49ed10?0x0:_0x2a38cd['offset'];var _0x20942a=_0x49ed10?_0x347918[_0xe123('0x1d')]:_0x2a38cd[_0xe123('0x1a')]+_0x2a38cd['limit'];var _0x4a76fe;if(_0x20942a>=_0x68e252){_0x20942a=_0x68e252;_0x4a76fe=0xc8;}else{_0x4a76fe=0xce;}_0x287af3[_0xe123('0x18')](_0x4a76fe);return _0x287af3[_0xe123('0x1e')](_0xe123('0x1f'),_0x51dd02+'-'+_0x20942a+'/'+_0x68e252)[_0xe123('0x20')](_0x347918);}return null;};}function patchUpdates(_0x38def1){return function(_0xfc8242){try{jsonpatch[_0xe123('0x21')](_0xfc8242,_0x38def1,!![]);}catch(_0x2f3623){return BPromise[_0xe123('0x22')](_0x2f3623);}return _0xfc8242[_0xe123('0x23')]();};}function saveUpdates(_0x256c61,_0x1bbab8){return function(_0x3a26d8){if(_0x3a26d8){return _0x3a26d8['update'](_0x256c61)[_0xe123('0x24')](function(_0x5001ce){return _0x5001ce;});}return null;};}function removeEntity(_0x8d5c3f,_0x497786){return function(_0x184395){if(_0x184395){return _0x184395[_0xe123('0x25')]()['then'](function(){_0x8d5c3f[_0xe123('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4d37,_0x5e33c4){return function(_0x168d75){if(!_0x168d75){_0x5a4d37[_0xe123('0x17')](0x194);}return _0x168d75;};}function handleError(_0x5a5861,_0x3ee482){_0x3ee482=_0x3ee482||0x1f4;return function(_0x592731){logger['error'](_0x592731[_0xe123('0x26')]);if(_0x592731[_0xe123('0x27')]){delete _0x592731[_0xe123('0x27')];}_0x5a5861[_0xe123('0x18')](_0x3ee482)[_0xe123('0x28')](_0x592731);};}exports[_0xe123('0x29')]=function(_0x3e27cb,_0xab065a){var _0x34dc68={},_0x536462={},_0x454544={'count':0x0,'rows':[]};var _0x500c8a=_['map'](db[_0xe123('0x2a')][_0xe123('0x2b')],function(_0x460ed0){return{'name':_0x460ed0[_0xe123('0x2c')],'type':_0x460ed0[_0xe123('0x2d')][_0xe123('0x2e')]};});_0x536462['model']=_['map'](_0x500c8a,_0xe123('0x27'));_0x536462[_0xe123('0x2f')]=_[_0xe123('0x30')](_0x3e27cb['query']);_0x536462[_0xe123('0x31')]=_[_0xe123('0x32')](_0x536462[_0xe123('0x33')],_0x536462['query']);_0x34dc68[_0xe123('0x34')]=_[_0xe123('0x32')](_0x536462[_0xe123('0x33')],qs[_0xe123('0x35')](_0x3e27cb['query']['fields']));_0x34dc68[_0xe123('0x34')]=_0x34dc68[_0xe123('0x34')][_0xe123('0x36')]?_0x34dc68[_0xe123('0x34')]:_0x536462['model'];if(!_0x3e27cb['query'][_0xe123('0x37')](_0xe123('0x38'))){_0x34dc68[_0xe123('0x1c')]=qs[_0xe123('0x1c')](_0x3e27cb[_0xe123('0x2f')][_0xe123('0x1c')]);_0x34dc68[_0xe123('0x1a')]=qs['offset'](_0x3e27cb[_0xe123('0x2f')][_0xe123('0x1a')]);}_0x34dc68[_0xe123('0x39')]=qs['sort'](_0x3e27cb[_0xe123('0x2f')]['sort']);_0x34dc68[_0xe123('0x3a')]=qs['filters'](_[_0xe123('0x3b')](_0x3e27cb[_0xe123('0x2f')],_0x536462[_0xe123('0x31')]),_0x500c8a);if(_0x3e27cb[_0xe123('0x2f')][_0xe123('0x3c')]){_0x34dc68[_0xe123('0x3a')]=_['merge'](_0x34dc68[_0xe123('0x3a')],{'$or':_[_0xe123('0x3d')](_0x500c8a,function(_0x500384){if(_0x500384['type']!==_0xe123('0x3e')){var _0x2c53fb={};_0x2c53fb[_0x500384[_0xe123('0x27')]]={'$like':'%'+_0x3e27cb[_0xe123('0x2f')][_0xe123('0x3c')]+'%'};return _0x2c53fb;}})});}_0x34dc68=_['merge']({},_0x34dc68,_0x3e27cb[_0xe123('0x3f')]);var _0x51dc1a={'where':_0x34dc68['where']};return db[_0xe123('0x2a')][_0xe123('0x1d')](_0x51dc1a)['then'](function(_0x12c208){_0x454544[_0xe123('0x1d')]=_0x12c208;if(_0x3e27cb['query'][_0xe123('0x40')]){_0x34dc68['include']=[{'all':!![]}];}return db[_0xe123('0x2a')]['findAll'](_0x34dc68);})[_0xe123('0x24')](function(_0x130ca3){_0x454544[_0xe123('0x41')]=_0x130ca3;return _0x454544;})['then'](respondWithFilteredResult(_0xab065a,_0x34dc68))[_0xe123('0x42')](handleError(_0xab065a,null));};exports['show']=function(_0x4e1308,_0x34ff7e){var _0x2aa86a={'raw':![],'where':{'id':_0x4e1308[_0xe123('0x43')]['id']}},_0x50a67e={};_0x50a67e[_0xe123('0x33')]=_['keys'](db['SugarcrmConfiguration'][_0xe123('0x2b')]);_0x50a67e[_0xe123('0x2f')]=_[_0xe123('0x30')](_0x4e1308[_0xe123('0x2f')]);_0x50a67e['filters']=_[_0xe123('0x32')](_0x50a67e['model'],_0x50a67e[_0xe123('0x2f')]);_0x2aa86a['attributes']=_['intersection'](_0x50a67e['model'],qs['fields'](_0x4e1308['query']['fields']));_0x2aa86a[_0xe123('0x34')]=_0x2aa86a[_0xe123('0x34')][_0xe123('0x36')]?_0x2aa86a[_0xe123('0x34')]:_0x50a67e[_0xe123('0x33')];if(_0x4e1308[_0xe123('0x2f')]['includeAll']){_0x2aa86a[_0xe123('0x44')]=[{'all':!![]}];}_0x2aa86a=_['merge']({},_0x2aa86a,_0x4e1308[_0xe123('0x3f')]);return db['SugarcrmConfiguration'][_0xe123('0x45')](_0x2aa86a)['then'](handleEntityNotFound(_0x34ff7e,null))[_0xe123('0x24')](respondWithResult(_0x34ff7e,null))[_0xe123('0x42')](handleError(_0x34ff7e,null));};exports[_0xe123('0x46')]=function(_0x480d92,_0x43cfde){return db['SugarcrmConfiguration'][_0xe123('0x46')](_0x480d92[_0xe123('0x47')],{})['then'](respondWithResult(_0x43cfde,0xc9))[_0xe123('0x42')](handleError(_0x43cfde,null));};exports[_0xe123('0x48')]=function(_0x524bc2,_0x2a3650){if(_0x524bc2[_0xe123('0x47')]['id']){delete _0x524bc2[_0xe123('0x47')]['id'];}return db['SugarcrmConfiguration']['find']({'where':{'id':_0x524bc2[_0xe123('0x43')]['id']}})[_0xe123('0x24')](handleEntityNotFound(_0x2a3650,null))[_0xe123('0x24')](saveUpdates(_0x524bc2['body'],null))['then'](respondWithResult(_0x2a3650,null))[_0xe123('0x42')](handleError(_0x2a3650,null));};exports[_0xe123('0x25')]=function(_0x1835fa,_0x89a6e1){return db[_0xe123('0x2a')][_0xe123('0x45')]({'where':{'id':_0x1835fa[_0xe123('0x43')]['id']}})[_0xe123('0x24')](handleEntityNotFound(_0x89a6e1,null))[_0xe123('0x24')](removeEntity(_0x89a6e1,null))[_0xe123('0x42')](handleError(_0x89a6e1,null));};exports[_0xe123('0x49')]=function(_0x100660,_0x1ac787,_0x4969a8){var _0x1d8107={};var _0x26be06={};var _0x5151a8;var _0x26a62d;return db[_0xe123('0x2a')][_0xe123('0x4a')]({'where':{'id':_0x100660['params']['id']}})[_0xe123('0x24')](handleEntityNotFound(_0x1ac787,null))[_0xe123('0x24')](function(_0x133c56){if(_0x133c56){_0x5151a8=_0x133c56;_0x26be06[_0xe123('0x33')]=_['keys'](db[_0xe123('0x4b')][_0xe123('0x2b')]);_0x26be06[_0xe123('0x2f')]=_[_0xe123('0x30')](_0x100660[_0xe123('0x2f')]);_0x26be06[_0xe123('0x31')]=_[_0xe123('0x32')](_0x26be06[_0xe123('0x33')],_0x26be06[_0xe123('0x2f')]);_0x1d8107[_0xe123('0x34')]=_[_0xe123('0x32')](_0x26be06['model'],qs[_0xe123('0x35')](_0x100660[_0xe123('0x2f')][_0xe123('0x35')]));_0x1d8107[_0xe123('0x34')]=_0x1d8107[_0xe123('0x34')]['length']?_0x1d8107['attributes']:_0x26be06['model'];_0x1d8107[_0xe123('0x39')]=qs[_0xe123('0x4c')](_0x100660[_0xe123('0x2f')][_0xe123('0x4c')]);_0x1d8107[_0xe123('0x3a')]=qs[_0xe123('0x31')](_['pick'](_0x100660['query'],_0x26be06[_0xe123('0x31')]));if(_0x100660[_0xe123('0x2f')][_0xe123('0x3c')]){_0x1d8107[_0xe123('0x3a')]=_['merge'](_0x1d8107['where'],{'$or':_[_0xe123('0x3d')](_0x1d8107[_0xe123('0x34')],function(_0x53a427){var _0x13a652={};_0x13a652[_0x53a427]={'$like':'%'+_0x100660[_0xe123('0x2f')][_0xe123('0x3c')]+'%'};return _0x13a652;})});}_0x1d8107=_[_0xe123('0x4d')]({},_0x1d8107,_0x100660[_0xe123('0x3f')]);return _0x5151a8['getFields'](_0x1d8107);}})['then'](function(_0x1c6a68){if(_0x1c6a68){_0x26a62d=_0x1c6a68[_0xe123('0x36')];if(!_0x100660[_0xe123('0x2f')][_0xe123('0x37')](_0xe123('0x38'))){_0x1d8107[_0xe123('0x1c')]=qs[_0xe123('0x1c')](_0x100660[_0xe123('0x2f')]['limit']);_0x1d8107[_0xe123('0x1a')]=qs[_0xe123('0x1a')](_0x100660[_0xe123('0x2f')][_0xe123('0x1a')]);}return _0x5151a8[_0xe123('0x49')](_0x1d8107);}})[_0xe123('0x24')](function(_0x19bc56){if(_0x19bc56){return _0x19bc56?{'count':_0x26a62d,'rows':_0x19bc56}:null;}})['then'](respondWithResult(_0x1ac787,null))[_0xe123('0x42')](handleError(_0x1ac787,null));};exports[_0xe123('0x4e')]=function(_0x829ab4,_0x1c6222,_0x148a2a){var _0x2a7128={};var _0x23cc40={};var _0xa295a9;var _0x1fd591;return db[_0xe123('0x2a')][_0xe123('0x4a')]({'where':{'id':_0x829ab4[_0xe123('0x43')]['id']}})['then'](handleEntityNotFound(_0x1c6222,null))[_0xe123('0x24')](function(_0x4f1e90){if(_0x4f1e90){_0xa295a9=_0x4f1e90;_0x23cc40[_0xe123('0x33')]=_[_0xe123('0x30')](db[_0xe123('0x4b')][_0xe123('0x2b')]);_0x23cc40[_0xe123('0x2f')]=_['keys'](_0x829ab4[_0xe123('0x2f')]);_0x23cc40[_0xe123('0x31')]=_[_0xe123('0x32')](_0x23cc40[_0xe123('0x33')],_0x23cc40[_0xe123('0x2f')]);_0x2a7128[_0xe123('0x34')]=_[_0xe123('0x32')](_0x23cc40['model'],qs[_0xe123('0x35')](_0x829ab4['query']['fields']));_0x2a7128['attributes']=_0x2a7128[_0xe123('0x34')][_0xe123('0x36')]?_0x2a7128[_0xe123('0x34')]:_0x23cc40[_0xe123('0x33')];_0x2a7128[_0xe123('0x39')]=qs[_0xe123('0x4c')](_0x829ab4['query'][_0xe123('0x4c')]);_0x2a7128[_0xe123('0x3a')]=qs[_0xe123('0x31')](_['pick'](_0x829ab4[_0xe123('0x2f')],_0x23cc40[_0xe123('0x31')]));if(_0x829ab4[_0xe123('0x2f')][_0xe123('0x3c')]){_0x2a7128[_0xe123('0x3a')]=_[_0xe123('0x4d')](_0x2a7128[_0xe123('0x3a')],{'$or':_[_0xe123('0x3d')](_0x2a7128[_0xe123('0x34')],function(_0x1a2d28){var _0x5d69c9={};_0x5d69c9[_0x1a2d28]={'$like':'%'+_0x829ab4[_0xe123('0x2f')][_0xe123('0x3c')]+'%'};return _0x5d69c9;})});}_0x2a7128=_[_0xe123('0x4d')]({},_0x2a7128,_0x829ab4[_0xe123('0x3f')]);return _0xa295a9['getSubjects'](_0x2a7128);}})['then'](function(_0x379916){if(_0x379916){_0x1fd591=_0x379916[_0xe123('0x36')];if(!_0x829ab4['query'][_0xe123('0x37')](_0xe123('0x38'))){_0x2a7128[_0xe123('0x1c')]=qs[_0xe123('0x1c')](_0x829ab4[_0xe123('0x2f')][_0xe123('0x1c')]);_0x2a7128[_0xe123('0x1a')]=qs['offset'](_0x829ab4[_0xe123('0x2f')][_0xe123('0x1a')]);}return _0xa295a9[_0xe123('0x4e')](_0x2a7128);}})[_0xe123('0x24')](function(_0x299eb8){if(_0x299eb8){return _0x299eb8?{'count':_0x1fd591,'rows':_0x299eb8}:null;}})[_0xe123('0x24')](respondWithResult(_0x1c6222,null))[_0xe123('0x42')](handleError(_0x1c6222,null));};exports[_0xe123('0x4f')]=function(_0x3d8c5f,_0x2a67a0,_0x64271c){var _0x7c1bae={};var _0x29c5e1={};var _0x4b5591;var _0x264a31;return db['SugarcrmConfiguration'][_0xe123('0x4a')]({'where':{'id':_0x3d8c5f['params']['id']}})['then'](handleEntityNotFound(_0x2a67a0,null))['then'](function(_0x4088a6){if(_0x4088a6){_0x4b5591=_0x4088a6;_0x29c5e1[_0xe123('0x33')]=_['keys'](db['SugarcrmField'][_0xe123('0x2b')]);_0x29c5e1[_0xe123('0x2f')]=_[_0xe123('0x30')](_0x3d8c5f[_0xe123('0x2f')]);_0x29c5e1[_0xe123('0x31')]=_[_0xe123('0x32')](_0x29c5e1[_0xe123('0x33')],_0x29c5e1[_0xe123('0x2f')]);_0x7c1bae[_0xe123('0x34')]=_[_0xe123('0x32')](_0x29c5e1[_0xe123('0x33')],qs[_0xe123('0x35')](_0x3d8c5f[_0xe123('0x2f')][_0xe123('0x35')]));_0x7c1bae[_0xe123('0x34')]=_0x7c1bae[_0xe123('0x34')][_0xe123('0x36')]?_0x7c1bae[_0xe123('0x34')]:_0x29c5e1[_0xe123('0x33')];_0x7c1bae[_0xe123('0x39')]=qs[_0xe123('0x4c')](_0x3d8c5f[_0xe123('0x2f')][_0xe123('0x4c')]);_0x7c1bae[_0xe123('0x3a')]=qs['filters'](_['pick'](_0x3d8c5f[_0xe123('0x2f')],_0x29c5e1[_0xe123('0x31')]));if(_0x3d8c5f[_0xe123('0x2f')][_0xe123('0x3c')]){_0x7c1bae[_0xe123('0x3a')]=_[_0xe123('0x4d')](_0x7c1bae[_0xe123('0x3a')],{'$or':_[_0xe123('0x3d')](_0x7c1bae[_0xe123('0x34')],function(_0x27e272){var _0x5b8919={};_0x5b8919[_0x27e272]={'$like':'%'+_0x3d8c5f[_0xe123('0x2f')][_0xe123('0x3c')]+'%'};return _0x5b8919;})});}_0x7c1bae=_[_0xe123('0x4d')]({},_0x7c1bae,_0x3d8c5f[_0xe123('0x3f')]);return _0x4b5591[_0xe123('0x4f')](_0x7c1bae);}})['then'](function(_0x3f9d46){if(_0x3f9d46){_0x264a31=_0x3f9d46[_0xe123('0x36')];if(!_0x3d8c5f[_0xe123('0x2f')]['hasOwnProperty'](_0xe123('0x38'))){_0x7c1bae['limit']=qs[_0xe123('0x1c')](_0x3d8c5f[_0xe123('0x2f')]['limit']);_0x7c1bae[_0xe123('0x1a')]=qs[_0xe123('0x1a')](_0x3d8c5f[_0xe123('0x2f')][_0xe123('0x1a')]);}return _0x4b5591[_0xe123('0x4f')](_0x7c1bae);}})[_0xe123('0x24')](function(_0x5fc29c){if(_0x5fc29c){return _0x5fc29c?{'count':_0x264a31,'rows':_0x5fc29c}:null;}})[_0xe123('0x24')](respondWithResult(_0x2a67a0,null))['catch'](handleError(_0x2a67a0,null));}; \ No newline at end of file +var _0xb554=['order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','fields','create','body','find','catch','getFields','findOne','SugarcrmField','length','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','apply','reject','then','destroy','error','name','index','map','SugarcrmConfiguration','rawAttributes','type','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit'];(function(_0x472524,_0x5b149c){var _0x362ff6=function(_0xf61431){while(--_0xf61431){_0x472524['push'](_0x472524['shift']());}};_0x362ff6(++_0x5b149c);}(_0xb554,0x14c));var _0x4b55=function(_0x4c47f4,_0x1d3141){_0x4c47f4=_0x4c47f4-0x0;var _0x9b41e6=_0xb554[_0x4c47f4];return _0x9b41e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4b55('0x0'));var zipdir=require(_0x4b55('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b55('0x2'));var moment=require(_0x4b55('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4b55('0x4'));var path=require(_0x4b55('0x5'));var sox=require('sox');var csv=require(_0x4b55('0x6'));var ejs=require(_0x4b55('0x7'));var fs=require('fs');var fs_extra=require(_0x4b55('0x8'));var _=require(_0x4b55('0x9'));var squel=require(_0x4b55('0xa'));var crypto=require(_0x4b55('0xb'));var jsforce=require(_0x4b55('0xc'));var deskjs=require(_0x4b55('0xd'));var toCsv=require(_0x4b55('0x6'));var querystring=require(_0x4b55('0xe'));var Papa=require(_0x4b55('0xf'));var Redis=require(_0x4b55('0x10'));var authService=require(_0x4b55('0x11'));var qs=require(_0x4b55('0x12'));var as=require(_0x4b55('0x13'));var hardwareService=require(_0x4b55('0x14'));var logger=require(_0x4b55('0x15'))(_0x4b55('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4b55('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37b690,_0x2ee079){_0x2ee079=_0x2ee079||0xcc;return function(_0xcd91a8){if(_0xcd91a8){return _0x37b690[_0x4b55('0x18')](_0x2ee079);}return _0x37b690[_0x4b55('0x19')](_0x2ee079)[_0x4b55('0x1a')]();};}function respondWithResult(_0x4dbdf5,_0x8b787){_0x8b787=_0x8b787||0xc8;return function(_0x51cc7f){if(_0x51cc7f){return _0x4dbdf5['status'](_0x8b787)[_0x4b55('0x1b')](_0x51cc7f);}};}function respondWithFilteredResult(_0x3fe142,_0x4ccafb){return function(_0x2a1a09){if(_0x2a1a09){var _0x2ee040=typeof _0x4ccafb['offset']===_0x4b55('0x1c')&&typeof _0x4ccafb['limit']==='undefined';var _0x58e788=_0x2a1a09[_0x4b55('0x1d')];var _0x2eb910=_0x2ee040?0x0:_0x4ccafb[_0x4b55('0x1e')];var _0x30eb9d=_0x2ee040?_0x2a1a09[_0x4b55('0x1d')]:_0x4ccafb['offset']+_0x4ccafb['limit'];var _0x37df40;if(_0x30eb9d>=_0x58e788){_0x30eb9d=_0x58e788;_0x37df40=0xc8;}else{_0x37df40=0xce;}_0x3fe142[_0x4b55('0x19')](_0x37df40);return _0x3fe142[_0x4b55('0x1f')](_0x4b55('0x20'),_0x2eb910+'-'+_0x30eb9d+'/'+_0x58e788)[_0x4b55('0x1b')](_0x2a1a09);}return null;};}function patchUpdates(_0x4bca6d){return function(_0x4b448a){try{jsonpatch[_0x4b55('0x21')](_0x4b448a,_0x4bca6d,!![]);}catch(_0x1a7919){return BPromise[_0x4b55('0x22')](_0x1a7919);}return _0x4b448a['save']();};}function saveUpdates(_0x29bec4,_0x54b4e9){return function(_0x14d59e){if(_0x14d59e){return _0x14d59e['update'](_0x29bec4)[_0x4b55('0x23')](function(_0x1d7368){return _0x1d7368;});}return null;};}function removeEntity(_0xa2186,_0x527045){return function(_0x45e1cd){if(_0x45e1cd){return _0x45e1cd[_0x4b55('0x24')]()[_0x4b55('0x23')](function(){_0xa2186['status'](0xcc)[_0x4b55('0x1a')]();});}};}function handleEntityNotFound(_0x241d4a,_0x43b4fb){return function(_0x411ffc){if(!_0x411ffc){_0x241d4a[_0x4b55('0x18')](0x194);}return _0x411ffc;};}function handleError(_0xf93bec,_0x3adf20){_0x3adf20=_0x3adf20||0x1f4;return function(_0x5251d0){logger[_0x4b55('0x25')](_0x5251d0['stack']);if(_0x5251d0[_0x4b55('0x26')]){delete _0x5251d0[_0x4b55('0x26')];}_0xf93bec[_0x4b55('0x19')](_0x3adf20)['send'](_0x5251d0);};}exports[_0x4b55('0x27')]=function(_0x2153a8,_0x1148c2){var _0x23a882={},_0x1c2997={},_0x4cfb4f={'count':0x0,'rows':[]};var _0x640326=_[_0x4b55('0x28')](db[_0x4b55('0x29')][_0x4b55('0x2a')],function(_0xc97c00){return{'name':_0xc97c00['fieldName'],'type':_0xc97c00[_0x4b55('0x2b')]['key']};});_0x1c2997[_0x4b55('0x2c')]=_[_0x4b55('0x28')](_0x640326,_0x4b55('0x26'));_0x1c2997['query']=_[_0x4b55('0x2d')](_0x2153a8[_0x4b55('0x2e')]);_0x1c2997[_0x4b55('0x2f')]=_[_0x4b55('0x30')](_0x1c2997['model'],_0x1c2997[_0x4b55('0x2e')]);_0x23a882[_0x4b55('0x31')]=_[_0x4b55('0x30')](_0x1c2997[_0x4b55('0x2c')],qs['fields'](_0x2153a8[_0x4b55('0x2e')]['fields']));_0x23a882[_0x4b55('0x31')]=_0x23a882['attributes']['length']?_0x23a882[_0x4b55('0x31')]:_0x1c2997[_0x4b55('0x2c')];if(!_0x2153a8[_0x4b55('0x2e')][_0x4b55('0x32')](_0x4b55('0x33'))){_0x23a882[_0x4b55('0x34')]=qs[_0x4b55('0x34')](_0x2153a8[_0x4b55('0x2e')]['limit']);_0x23a882[_0x4b55('0x1e')]=qs['offset'](_0x2153a8[_0x4b55('0x2e')][_0x4b55('0x1e')]);}_0x23a882[_0x4b55('0x35')]=qs[_0x4b55('0x36')](_0x2153a8['query'][_0x4b55('0x36')]);_0x23a882[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x2153a8['query'],_0x1c2997[_0x4b55('0x2f')]),_0x640326);if(_0x2153a8[_0x4b55('0x2e')][_0x4b55('0x39')]){_0x23a882[_0x4b55('0x37')]=_[_0x4b55('0x3a')](_0x23a882[_0x4b55('0x37')],{'$or':_[_0x4b55('0x28')](_0x640326,function(_0x3e59e1){if(_0x3e59e1['type']!==_0x4b55('0x3b')){var _0x5a6283={};_0x5a6283[_0x3e59e1[_0x4b55('0x26')]]={'$like':'%'+_0x2153a8[_0x4b55('0x2e')]['filter']+'%'};return _0x5a6283;}})});}_0x23a882=_[_0x4b55('0x3a')]({},_0x23a882,_0x2153a8[_0x4b55('0x3c')]);var _0x4cf4be={'where':_0x23a882['where']};return db[_0x4b55('0x29')][_0x4b55('0x1d')](_0x4cf4be)[_0x4b55('0x23')](function(_0xe9373f){_0x4cfb4f[_0x4b55('0x1d')]=_0xe9373f;if(_0x2153a8['query'][_0x4b55('0x3d')]){_0x23a882[_0x4b55('0x3e')]=[{'all':!![]}];}return db[_0x4b55('0x29')]['findAll'](_0x23a882);})['then'](function(_0x12417f){_0x4cfb4f[_0x4b55('0x3f')]=_0x12417f;return _0x4cfb4f;})[_0x4b55('0x23')](respondWithFilteredResult(_0x1148c2,_0x23a882))['catch'](handleError(_0x1148c2,null));};exports[_0x4b55('0x40')]=function(_0x5cc48e,_0x3b3e87){var _0x18e43b={'raw':![],'where':{'id':_0x5cc48e[_0x4b55('0x41')]['id']}},_0x456bcd={};_0x456bcd[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x29')][_0x4b55('0x2a')]);_0x456bcd[_0x4b55('0x2e')]=_[_0x4b55('0x2d')](_0x5cc48e[_0x4b55('0x2e')]);_0x456bcd[_0x4b55('0x2f')]=_[_0x4b55('0x30')](_0x456bcd[_0x4b55('0x2c')],_0x456bcd['query']);_0x18e43b['attributes']=_[_0x4b55('0x30')](_0x456bcd[_0x4b55('0x2c')],qs[_0x4b55('0x42')](_0x5cc48e[_0x4b55('0x2e')][_0x4b55('0x42')]));_0x18e43b['attributes']=_0x18e43b[_0x4b55('0x31')]['length']?_0x18e43b['attributes']:_0x456bcd[_0x4b55('0x2c')];if(_0x5cc48e['query'][_0x4b55('0x3d')]){_0x18e43b['include']=[{'all':!![]}];}_0x18e43b=_[_0x4b55('0x3a')]({},_0x18e43b,_0x5cc48e[_0x4b55('0x3c')]);return db[_0x4b55('0x29')]['find'](_0x18e43b)[_0x4b55('0x23')](handleEntityNotFound(_0x3b3e87,null))[_0x4b55('0x23')](respondWithResult(_0x3b3e87,null))['catch'](handleError(_0x3b3e87,null));};exports[_0x4b55('0x43')]=function(_0x4b7bcb,_0x29a7a7){return db['SugarcrmConfiguration']['create'](_0x4b7bcb['body'],{})[_0x4b55('0x23')](respondWithResult(_0x29a7a7,0xc9))['catch'](handleError(_0x29a7a7,null));};exports['update']=function(_0x5f38e1,_0xe46d38){if(_0x5f38e1[_0x4b55('0x44')]['id']){delete _0x5f38e1[_0x4b55('0x44')]['id'];}return db['SugarcrmConfiguration'][_0x4b55('0x45')]({'where':{'id':_0x5f38e1[_0x4b55('0x41')]['id']}})[_0x4b55('0x23')](handleEntityNotFound(_0xe46d38,null))['then'](saveUpdates(_0x5f38e1[_0x4b55('0x44')],null))[_0x4b55('0x23')](respondWithResult(_0xe46d38,null))[_0x4b55('0x46')](handleError(_0xe46d38,null));};exports[_0x4b55('0x24')]=function(_0x207a1b,_0x127eed){return db[_0x4b55('0x29')][_0x4b55('0x45')]({'where':{'id':_0x207a1b[_0x4b55('0x41')]['id']}})['then'](handleEntityNotFound(_0x127eed,null))[_0x4b55('0x23')](removeEntity(_0x127eed,null))[_0x4b55('0x46')](handleError(_0x127eed,null));};exports[_0x4b55('0x47')]=function(_0x2a0808,_0x3e1c5d,_0xacbd55){var _0x2bdaa2={};var _0x2c0ed8={};var _0x258c2d;var _0xca1ea0;return db['SugarcrmConfiguration'][_0x4b55('0x48')]({'where':{'id':_0x2a0808[_0x4b55('0x41')]['id']}})['then'](handleEntityNotFound(_0x3e1c5d,null))[_0x4b55('0x23')](function(_0x230907){if(_0x230907){_0x258c2d=_0x230907;_0x2c0ed8[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x49')][_0x4b55('0x2a')]);_0x2c0ed8[_0x4b55('0x2e')]=_[_0x4b55('0x2d')](_0x2a0808['query']);_0x2c0ed8['filters']=_[_0x4b55('0x30')](_0x2c0ed8[_0x4b55('0x2c')],_0x2c0ed8[_0x4b55('0x2e')]);_0x2bdaa2['attributes']=_['intersection'](_0x2c0ed8[_0x4b55('0x2c')],qs[_0x4b55('0x42')](_0x2a0808[_0x4b55('0x2e')]['fields']));_0x2bdaa2[_0x4b55('0x31')]=_0x2bdaa2[_0x4b55('0x31')]['length']?_0x2bdaa2[_0x4b55('0x31')]:_0x2c0ed8['model'];_0x2bdaa2[_0x4b55('0x35')]=qs['sort'](_0x2a0808[_0x4b55('0x2e')]['sort']);_0x2bdaa2[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x2a0808[_0x4b55('0x2e')],_0x2c0ed8['filters']));if(_0x2a0808['query'][_0x4b55('0x39')]){_0x2bdaa2[_0x4b55('0x37')]=_[_0x4b55('0x3a')](_0x2bdaa2['where'],{'$or':_['map'](_0x2bdaa2['attributes'],function(_0x24d15b){var _0x2a5f71={};_0x2a5f71[_0x24d15b]={'$like':'%'+_0x2a0808[_0x4b55('0x2e')][_0x4b55('0x39')]+'%'};return _0x2a5f71;})});}_0x2bdaa2=_[_0x4b55('0x3a')]({},_0x2bdaa2,_0x2a0808[_0x4b55('0x3c')]);return _0x258c2d[_0x4b55('0x47')](_0x2bdaa2);}})[_0x4b55('0x23')](function(_0x50ce3e){if(_0x50ce3e){_0xca1ea0=_0x50ce3e['length'];if(!_0x2a0808[_0x4b55('0x2e')]['hasOwnProperty']('nolimit')){_0x2bdaa2[_0x4b55('0x34')]=qs[_0x4b55('0x34')](_0x2a0808['query'][_0x4b55('0x34')]);_0x2bdaa2[_0x4b55('0x1e')]=qs[_0x4b55('0x1e')](_0x2a0808[_0x4b55('0x2e')][_0x4b55('0x1e')]);}return _0x258c2d[_0x4b55('0x47')](_0x2bdaa2);}})['then'](function(_0x25a611){if(_0x25a611){return _0x25a611?{'count':_0xca1ea0,'rows':_0x25a611}:null;}})[_0x4b55('0x23')](respondWithResult(_0x3e1c5d,null))[_0x4b55('0x46')](handleError(_0x3e1c5d,null));};exports['getSubjects']=function(_0x32211e,_0xd3025d,_0x560c7a){var _0x4cd693={};var _0x57e67a={};var _0x25ea53;var _0x10a6d9;return db[_0x4b55('0x29')]['findOne']({'where':{'id':_0x32211e[_0x4b55('0x41')]['id']}})[_0x4b55('0x23')](handleEntityNotFound(_0xd3025d,null))[_0x4b55('0x23')](function(_0x96b7f7){if(_0x96b7f7){_0x25ea53=_0x96b7f7;_0x57e67a[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x49')][_0x4b55('0x2a')]);_0x57e67a[_0x4b55('0x2e')]=_[_0x4b55('0x2d')](_0x32211e['query']);_0x57e67a['filters']=_[_0x4b55('0x30')](_0x57e67a['model'],_0x57e67a[_0x4b55('0x2e')]);_0x4cd693[_0x4b55('0x31')]=_['intersection'](_0x57e67a[_0x4b55('0x2c')],qs['fields'](_0x32211e['query'][_0x4b55('0x42')]));_0x4cd693[_0x4b55('0x31')]=_0x4cd693[_0x4b55('0x31')][_0x4b55('0x4a')]?_0x4cd693[_0x4b55('0x31')]:_0x57e67a['model'];_0x4cd693['order']=qs['sort'](_0x32211e[_0x4b55('0x2e')][_0x4b55('0x36')]);_0x4cd693[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x32211e['query'],_0x57e67a[_0x4b55('0x2f')]));if(_0x32211e[_0x4b55('0x2e')][_0x4b55('0x39')]){_0x4cd693[_0x4b55('0x37')]=_[_0x4b55('0x3a')](_0x4cd693[_0x4b55('0x37')],{'$or':_['map'](_0x4cd693[_0x4b55('0x31')],function(_0x5d68c8){var _0x313f80={};_0x313f80[_0x5d68c8]={'$like':'%'+_0x32211e[_0x4b55('0x2e')]['filter']+'%'};return _0x313f80;})});}_0x4cd693=_[_0x4b55('0x3a')]({},_0x4cd693,_0x32211e[_0x4b55('0x3c')]);return _0x25ea53[_0x4b55('0x4b')](_0x4cd693);}})[_0x4b55('0x23')](function(_0x501c85){if(_0x501c85){_0x10a6d9=_0x501c85['length'];if(!_0x32211e[_0x4b55('0x2e')][_0x4b55('0x32')]('nolimit')){_0x4cd693[_0x4b55('0x34')]=qs['limit'](_0x32211e[_0x4b55('0x2e')]['limit']);_0x4cd693[_0x4b55('0x1e')]=qs[_0x4b55('0x1e')](_0x32211e[_0x4b55('0x2e')][_0x4b55('0x1e')]);}return _0x25ea53[_0x4b55('0x4b')](_0x4cd693);}})[_0x4b55('0x23')](function(_0x185510){if(_0x185510){return _0x185510?{'count':_0x10a6d9,'rows':_0x185510}:null;}})[_0x4b55('0x23')](respondWithResult(_0xd3025d,null))['catch'](handleError(_0xd3025d,null));};exports[_0x4b55('0x4c')]=function(_0x3678fe,_0x54ee1c,_0x304069){var _0x152be4={};var _0x27bc63={};var _0x1c8f37;var _0x4740ac;return db['SugarcrmConfiguration'][_0x4b55('0x48')]({'where':{'id':_0x3678fe[_0x4b55('0x41')]['id']}})[_0x4b55('0x23')](handleEntityNotFound(_0x54ee1c,null))[_0x4b55('0x23')](function(_0x30f137){if(_0x30f137){_0x1c8f37=_0x30f137;_0x27bc63[_0x4b55('0x2c')]=_[_0x4b55('0x2d')](db[_0x4b55('0x49')][_0x4b55('0x2a')]);_0x27bc63[_0x4b55('0x2e')]=_['keys'](_0x3678fe[_0x4b55('0x2e')]);_0x27bc63[_0x4b55('0x2f')]=_[_0x4b55('0x30')](_0x27bc63[_0x4b55('0x2c')],_0x27bc63[_0x4b55('0x2e')]);_0x152be4[_0x4b55('0x31')]=_[_0x4b55('0x30')](_0x27bc63[_0x4b55('0x2c')],qs[_0x4b55('0x42')](_0x3678fe[_0x4b55('0x2e')]['fields']));_0x152be4['attributes']=_0x152be4['attributes'][_0x4b55('0x4a')]?_0x152be4[_0x4b55('0x31')]:_0x27bc63[_0x4b55('0x2c')];_0x152be4[_0x4b55('0x35')]=qs[_0x4b55('0x36')](_0x3678fe['query'][_0x4b55('0x36')]);_0x152be4[_0x4b55('0x37')]=qs[_0x4b55('0x2f')](_[_0x4b55('0x38')](_0x3678fe[_0x4b55('0x2e')],_0x27bc63[_0x4b55('0x2f')]));if(_0x3678fe[_0x4b55('0x2e')][_0x4b55('0x39')]){_0x152be4['where']=_[_0x4b55('0x3a')](_0x152be4[_0x4b55('0x37')],{'$or':_[_0x4b55('0x28')](_0x152be4[_0x4b55('0x31')],function(_0xe1b131){var _0x43733d={};_0x43733d[_0xe1b131]={'$like':'%'+_0x3678fe[_0x4b55('0x2e')]['filter']+'%'};return _0x43733d;})});}_0x152be4=_['merge']({},_0x152be4,_0x3678fe[_0x4b55('0x3c')]);return _0x1c8f37[_0x4b55('0x4c')](_0x152be4);}})[_0x4b55('0x23')](function(_0x27e067){if(_0x27e067){_0x4740ac=_0x27e067[_0x4b55('0x4a')];if(!_0x3678fe['query'][_0x4b55('0x32')](_0x4b55('0x33'))){_0x152be4[_0x4b55('0x34')]=qs['limit'](_0x3678fe[_0x4b55('0x2e')][_0x4b55('0x34')]);_0x152be4['offset']=qs[_0x4b55('0x1e')](_0x3678fe['query'][_0x4b55('0x1e')]);}return _0x1c8f37['getDescriptions'](_0x152be4);}})[_0x4b55('0x23')](function(_0x371cc9){if(_0x371cc9){return _0x371cc9?{'count':_0x4740ac,'rows':_0x371cc9}:null;}})['then'](respondWithResult(_0x54ee1c,null))['catch'](handleError(_0x54ee1c,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index c80aea0..c03e768 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 _0xa67b=['SugarcrmConfiguration','int_sugarcrm_configurations','api','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa67b,0xca));var _0xba67=function(_0x5166c2,_0x28916a){_0x5166c2=_0x5166c2-0x0;var _0xf56f8=_0xa67b[_0x5166c2];return _0xf56f8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xba67('0x0'));var moment=require(_0xba67('0x1'));var BPromise=require(_0xba67('0x2'));var rp=require(_0xba67('0x3'));var fs=require('fs');var path=require(_0xba67('0x4'));var rimraf=require('rimraf');var config=require(_0xba67('0x5'));var attributes=require(_0xba67('0x6'));module[_0xba67('0x7')]=function(_0x2812de,_0x4b7bde){return _0x2812de['define'](_0xba67('0x8'),attributes,{'tableName':_0xba67('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa17c=['path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xa17c,0x1da));var _0xca17=function(_0x7c4840,_0x43dc5c){_0x7c4840=_0x7c4840-0x0;var _0x1a19a5=_0xa17c[_0x7c4840];return _0x1a19a5;};'use strict';var _=require(_0xca17('0x0'));var util=require(_0xca17('0x1'));var logger=require(_0xca17('0x2'))(_0xca17('0x3'));var moment=require('moment');var BPromise=require(_0xca17('0x4'));var rp=require(_0xca17('0x5'));var fs=require('fs');var path=require(_0xca17('0x6'));var rimraf=require(_0xca17('0x7'));var config=require(_0xca17('0x8'));var attributes=require(_0xca17('0x9'));module['exports']=function(_0x5fd126,_0x2051f1){return _0x5fd126[_0xca17('0xa')]('SugarcrmConfiguration',attributes,{'tableName':_0xca17('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 6844a34..75cdb3d 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 _0xca59=['../../config/environment','jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x49d876,_0x2ec0fb){var _0x445d67=function(_0x1f4bfd){while(--_0x1f4bfd){_0x49d876['push'](_0x49d876['shift']());}};_0x445d67(++_0x2ec0fb);}(_0xca59,0x160));var _0x9ca5=function(_0x542ec7,_0x2a5fe0){_0x542ec7=_0x542ec7-0x0;var _0x1b2a54=_0xca59[_0x542ec7];return _0x1b2a54;};'use strict';var _=require(_0x9ca5('0x0'));var util=require(_0x9ca5('0x1'));var moment=require(_0x9ca5('0x2'));var BPromise=require(_0x9ca5('0x3'));var rs=require(_0x9ca5('0x4'));var fs=require('fs');var Redis=require(_0x9ca5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ca5('0x6'));var logger=require(_0x9ca5('0x7'))('rpc');var config=require(_0x9ca5('0x8'));var jayson=require(_0x9ca5('0x9'));var client=jayson[_0x9ca5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4afe5d,_0x2b904d,_0x559d3d){return new BPromise(function(_0x1f34bb,_0x5c818c){return client['request'](_0x4afe5d,_0x559d3d)[_0x9ca5('0xb')](function(_0x3b38a8){logger[_0x9ca5('0xc')](_0x9ca5('0xd'),_0x2b904d,_0x9ca5('0xe'));logger[_0x9ca5('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2b904d,_0x9ca5('0xe'),JSON[_0x9ca5('0x10')](_0x3b38a8));if(_0x3b38a8[_0x9ca5('0x11')]){if(_0x3b38a8[_0x9ca5('0x11')][_0x9ca5('0x12')]===0x1f4){logger[_0x9ca5('0x11')](_0x9ca5('0xd'),_0x2b904d,_0x3b38a8[_0x9ca5('0x11')][_0x9ca5('0x13')]);return _0x5c818c(_0x3b38a8[_0x9ca5('0x11')]['message']);}logger[_0x9ca5('0x11')](_0x9ca5('0xd'),_0x2b904d,_0x3b38a8[_0x9ca5('0x11')][_0x9ca5('0x13')]);return _0x1f34bb(_0x3b38a8[_0x9ca5('0x11')][_0x9ca5('0x13')]);}else{logger[_0x9ca5('0xc')](_0x9ca5('0xd'),_0x2b904d,_0x9ca5('0xe'));_0x1f34bb(_0x3b38a8['result'][_0x9ca5('0x13')]);}})['catch'](function(_0x28151b){logger[_0x9ca5('0x11')](_0x9ca5('0xd'),_0x2b904d,_0x28151b);_0x5c818c(_0x28151b);});});} \ No newline at end of file +var _0x5e01=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x5e01,0xe9));var _0x15e0=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0x5e01[_0x2338fa];return _0x42df9b;};'use strict';var _=require(_0x15e0('0x0'));var util=require(_0x15e0('0x1'));var moment=require(_0x15e0('0x2'));var BPromise=require(_0x15e0('0x3'));var rs=require(_0x15e0('0x4'));var fs=require('fs');var Redis=require(_0x15e0('0x5'));var db=require(_0x15e0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x15e0('0x7'))('rpc');var config=require(_0x15e0('0x8'));var jayson=require(_0x15e0('0x9'));var client=jayson[_0x15e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x174a43,_0x11b46c,_0x3a1821){return new BPromise(function(_0x1c2cd4,_0x171caa){return client[_0x15e0('0xb')](_0x174a43,_0x3a1821)[_0x15e0('0xc')](function(_0xf39ef4){logger[_0x15e0('0xd')](_0x15e0('0xe'),_0x11b46c,_0x15e0('0xf'));logger[_0x15e0('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x11b46c,_0x15e0('0xf'),JSON[_0x15e0('0x11')](_0xf39ef4));if(_0xf39ef4['error']){if(_0xf39ef4[_0x15e0('0x12')]['code']===0x1f4){logger[_0x15e0('0x12')](_0x15e0('0xe'),_0x11b46c,_0xf39ef4['error'][_0x15e0('0x13')]);return _0x171caa(_0xf39ef4[_0x15e0('0x12')]['message']);}logger['error'](_0x15e0('0xe'),_0x11b46c,_0xf39ef4[_0x15e0('0x12')]['message']);return _0x1c2cd4(_0xf39ef4[_0x15e0('0x12')][_0x15e0('0x13')]);}else{logger[_0x15e0('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x11b46c,_0x15e0('0xf'));_0x1c2cd4(_0xf39ef4['result']['message']);}})[_0x15e0('0x14')](function(_0x5dede5){logger[_0x15e0('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x11b46c,_0x5dede5);_0x171caa(_0x5dede5);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 3483565..dc25e69 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 _0xa2ff=['put','/:id','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create'];(function(_0x548bde,_0x56f82b){var _0x1a7719=function(_0x50eec8){while(--_0x50eec8){_0x548bde['push'](_0x548bde['shift']());}};_0x1a7719(++_0x56f82b);}(_0xa2ff,0x16d));var _0xfa2f=function(_0x43691d,_0x4dd415){_0x43691d=_0x43691d-0x0;var _0x17750d=_0xa2ff[_0x43691d];return _0x17750d;};'use strict';var multer=require(_0xfa2f('0x0'));var util=require('util');var path=require(_0xfa2f('0x1'));var timeout=require('connect-timeout');var express=require(_0xfa2f('0x2'));var router=express['Router']();var fs_extra=require(_0xfa2f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfa2f('0x4'));var config=require(_0xfa2f('0x5'));var controller=require(_0xfa2f('0x6'));router[_0xfa2f('0x7')]('/',auth[_0xfa2f('0x8')](),controller[_0xfa2f('0x9')]);router[_0xfa2f('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xfa2f('0xa')]);router[_0xfa2f('0xb')]('/',auth[_0xfa2f('0x8')](),controller[_0xfa2f('0xc')]);router[_0xfa2f('0xd')](_0xfa2f('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xfa2f('0xf')](_0xfa2f('0xe'),auth[_0xfa2f('0x8')](),controller[_0xfa2f('0x10')]);module[_0xfa2f('0x11')]=router; \ No newline at end of file +var _0x102e=['fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','express','Router'];(function(_0x598770,_0x3e6195){var _0x571b76=function(_0x8cef66){while(--_0x8cef66){_0x598770['push'](_0x598770['shift']());}};_0x571b76(++_0x3e6195);}(_0x102e,0x9f));var _0xe102=function(_0x1e80f7,_0x51070a){_0x1e80f7=_0x1e80f7-0x0;var _0x361cb6=_0x102e[_0x1e80f7];return _0x361cb6;};'use strict';var multer=require(_0xe102('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe102('0x1'));var router=express[_0xe102('0x2')]();var fs_extra=require(_0xe102('0x3'));var auth=require(_0xe102('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe102('0x5'));var controller=require(_0xe102('0x6'));router[_0xe102('0x7')]('/',auth['isAuthenticated'](),controller[_0xe102('0x8')]);router[_0xe102('0x7')](_0xe102('0x9'),auth[_0xe102('0xa')](),controller[_0xe102('0xb')]);router[_0xe102('0xc')]('/',auth['isAuthenticated'](),controller[_0xe102('0xd')]);router[_0xe102('0xe')](_0xe102('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe102('0xf')](_0xe102('0x9'),auth[_0xe102('0xa')](),controller[_0xe102('0x10')]);module[_0xe102('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index de7d429..b1b5e3c 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 _0xc328=['ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN'];(function(_0x5732d6,_0x2c9500){var _0x3a1a0f=function(_0x5ae05e){while(--_0x5ae05e){_0x5732d6['push'](_0x5732d6['shift']());}};_0x3a1a0f(++_0x2c9500);}(_0xc328,0x157));var _0x8c32=function(_0x277608,_0xd6374){_0x277608=_0x277608-0x0;var _0x1efced=_0xc328[_0x277608];return _0x1efced;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8c32('0x0')](_0x8c32('0x1'),_0x8c32('0x2'),_0x8c32('0x3'),'keyValue',_0x8c32('0x4')),'defaultValue':_0x8c32('0x1')},'content':{'type':Sequelize[_0x8c32('0x5')]},'key':{'type':Sequelize[_0x8c32('0x5')]},'keyType':{'type':Sequelize[_0x8c32('0x0')](_0x8c32('0x1'),_0x8c32('0x2'),_0x8c32('0x3'))},'keyContent':{'type':Sequelize[_0x8c32('0x5')]},'idField':{'type':Sequelize[_0x8c32('0x5')]},'nameField':{'type':Sequelize[_0x8c32('0x5')]},'customField':{'type':Sequelize[_0x8c32('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa716=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x204b90,_0x35b72a){var _0x5c2e67=function(_0x14a78e){while(--_0x14a78e){_0x204b90['push'](_0x204b90['shift']());}};_0x5c2e67(++_0x35b72a);}(_0xa716,0x76));var _0x6a71=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xa716[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x6a71('0x0'));module[_0x6a71('0x1')]={'type':{'type':Sequelize[_0x6a71('0x2')](_0x6a71('0x3'),_0x6a71('0x4'),_0x6a71('0x5'),_0x6a71('0x6'),_0x6a71('0x7')),'defaultValue':_0x6a71('0x3')},'content':{'type':Sequelize[_0x6a71('0x8')]},'key':{'type':Sequelize[_0x6a71('0x8')]},'keyType':{'type':Sequelize[_0x6a71('0x2')](_0x6a71('0x3'),_0x6a71('0x4'),_0x6a71('0x5'))},'keyContent':{'type':Sequelize[_0x6a71('0x8')]},'idField':{'type':Sequelize[_0x6a71('0x8')]},'nameField':{'type':Sequelize[_0x6a71('0x8')]},'customField':{'type':Sequelize[_0x6a71('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 415af6a..117b534 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 _0xdf77=['rawAttributes','fields','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','limit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','params'];(function(_0x24f6c2,_0x23ac0a){var _0x1bb521=function(_0x2781f9){while(--_0x2781f9){_0x24f6c2['push'](_0x24f6c2['shift']());}};_0x1bb521(++_0x23ac0a);}(_0xdf77,0x142));var _0x7df7=function(_0x3b0689,_0x3996ef){_0x3b0689=_0x3b0689-0x0;var _0xb1338b=_0xdf77[_0x3b0689];return _0xb1338b;};'use strict';var emlformat=require(_0x7df7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7df7('0x1'));var jsonpatch=require(_0x7df7('0x2'));var rp=require(_0x7df7('0x3'));var moment=require(_0x7df7('0x4'));var BPromise=require(_0x7df7('0x5'));var Mustache=require(_0x7df7('0x6'));var util=require(_0x7df7('0x7'));var path=require(_0x7df7('0x8'));var sox=require(_0x7df7('0x9'));var csv=require(_0x7df7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7df7('0xb'));var _=require(_0x7df7('0xc'));var squel=require(_0x7df7('0xd'));var crypto=require(_0x7df7('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7df7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7df7('0x10'));var Papa=require('papaparse');var Redis=require(_0x7df7('0x11'));var authService=require(_0x7df7('0x12'));var qs=require(_0x7df7('0x13'));var as=require(_0x7df7('0x14'));var hardwareService=require(_0x7df7('0x15'));var logger=require(_0x7df7('0x16'))(_0x7df7('0x17'));var utils=require(_0x7df7('0x18'));var config=require(_0x7df7('0x19'));var licenseUtil=require(_0x7df7('0x1a'));var db=require(_0x7df7('0x1b'))['db'];function respondWithStatusCode(_0x59699d,_0x560280){_0x560280=_0x560280||0xcc;return function(_0x5047ba){if(_0x5047ba){return _0x59699d[_0x7df7('0x1c')](_0x560280);}return _0x59699d[_0x7df7('0x1d')](_0x560280)[_0x7df7('0x1e')]();};}function respondWithResult(_0x2334a6,_0x97f870){_0x97f870=_0x97f870||0xc8;return function(_0x346179){if(_0x346179){return _0x2334a6[_0x7df7('0x1d')](_0x97f870)[_0x7df7('0x1f')](_0x346179);}};}function respondWithFilteredResult(_0x19bfee,_0x394ac8){return function(_0x44a905){if(_0x44a905){var _0x5b5759=typeof _0x394ac8[_0x7df7('0x20')]==='undefined'&&typeof _0x394ac8['limit']===_0x7df7('0x21');var _0x22c5fa=_0x44a905[_0x7df7('0x22')];var _0x239c8c=_0x5b5759?0x0:_0x394ac8[_0x7df7('0x20')];var _0x50cab0=_0x5b5759?_0x44a905[_0x7df7('0x22')]:_0x394ac8[_0x7df7('0x20')]+_0x394ac8['limit'];var _0x3b565c;if(_0x50cab0>=_0x22c5fa){_0x50cab0=_0x22c5fa;_0x3b565c=0xc8;}else{_0x3b565c=0xce;}_0x19bfee['status'](_0x3b565c);return _0x19bfee[_0x7df7('0x23')](_0x7df7('0x24'),_0x239c8c+'-'+_0x50cab0+'/'+_0x22c5fa)[_0x7df7('0x1f')](_0x44a905);}return null;};}function patchUpdates(_0x3a84a7){return function(_0x213cb9){try{jsonpatch[_0x7df7('0x25')](_0x213cb9,_0x3a84a7,!![]);}catch(_0x2068fe){return BPromise['reject'](_0x2068fe);}return _0x213cb9[_0x7df7('0x26')]();};}function saveUpdates(_0x55a0a3,_0x5dd874){return function(_0x1219ca){if(_0x1219ca){return _0x1219ca[_0x7df7('0x27')](_0x55a0a3)[_0x7df7('0x28')](function(_0x5a0e60){return _0x5a0e60;});}return null;};}function removeEntity(_0x3d9a73,_0x178f4d){return function(_0x2d19d8){if(_0x2d19d8){return _0x2d19d8[_0x7df7('0x29')]()['then'](function(){_0x3d9a73[_0x7df7('0x1d')](0xcc)[_0x7df7('0x1e')]();});}};}function handleEntityNotFound(_0x4c81b1,_0x260c18){return function(_0x2fa275){if(!_0x2fa275){_0x4c81b1[_0x7df7('0x1c')](0x194);}return _0x2fa275;};}function handleError(_0x1600cf,_0x5d9828){_0x5d9828=_0x5d9828||0x1f4;return function(_0x120a5e){logger[_0x7df7('0x2a')](_0x120a5e[_0x7df7('0x2b')]);if(_0x120a5e[_0x7df7('0x2c')]){delete _0x120a5e[_0x7df7('0x2c')];}_0x1600cf[_0x7df7('0x1d')](_0x5d9828)[_0x7df7('0x2d')](_0x120a5e);};}exports[_0x7df7('0x2e')]=function(_0x180016,_0x38234e){var _0x66d926={},_0x4a24dc={},_0x6e96e8={'count':0x0,'rows':[]};var _0x278d0e=_[_0x7df7('0x2f')](db[_0x7df7('0x30')]['rawAttributes'],function(_0x31b71a){return{'name':_0x31b71a[_0x7df7('0x31')],'type':_0x31b71a[_0x7df7('0x32')][_0x7df7('0x33')]};});_0x4a24dc[_0x7df7('0x34')]=_[_0x7df7('0x2f')](_0x278d0e,_0x7df7('0x2c'));_0x4a24dc[_0x7df7('0x35')]=_[_0x7df7('0x36')](_0x180016[_0x7df7('0x35')]);_0x4a24dc[_0x7df7('0x37')]=_[_0x7df7('0x38')](_0x4a24dc['model'],_0x4a24dc[_0x7df7('0x35')]);_0x66d926[_0x7df7('0x39')]=_[_0x7df7('0x38')](_0x4a24dc['model'],qs['fields'](_0x180016['query']['fields']));_0x66d926[_0x7df7('0x39')]=_0x66d926[_0x7df7('0x39')][_0x7df7('0x3a')]?_0x66d926[_0x7df7('0x39')]:_0x4a24dc[_0x7df7('0x34')];if(!_0x180016['query']['hasOwnProperty']('nolimit')){_0x66d926[_0x7df7('0x3b')]=qs[_0x7df7('0x3b')](_0x180016[_0x7df7('0x35')]['limit']);_0x66d926[_0x7df7('0x20')]=qs['offset'](_0x180016['query']['offset']);}_0x66d926[_0x7df7('0x3c')]=qs[_0x7df7('0x3d')](_0x180016[_0x7df7('0x35')][_0x7df7('0x3d')]);_0x66d926['where']=qs['filters'](_[_0x7df7('0x3e')](_0x180016[_0x7df7('0x35')],_0x4a24dc[_0x7df7('0x37')]),_0x278d0e);if(_0x180016[_0x7df7('0x35')]['filter']){_0x66d926[_0x7df7('0x3f')]=_[_0x7df7('0x40')](_0x66d926[_0x7df7('0x3f')],{'$or':_['map'](_0x278d0e,function(_0x37166b){if(_0x37166b[_0x7df7('0x32')]!=='VIRTUAL'){var _0x3b8672={};_0x3b8672[_0x37166b[_0x7df7('0x2c')]]={'$like':'%'+_0x180016[_0x7df7('0x35')][_0x7df7('0x41')]+'%'};return _0x3b8672;}})});}_0x66d926=_[_0x7df7('0x40')]({},_0x66d926,_0x180016[_0x7df7('0x42')]);var _0x272443={'where':_0x66d926[_0x7df7('0x3f')]};return db[_0x7df7('0x30')][_0x7df7('0x22')](_0x272443)[_0x7df7('0x28')](function(_0x3deffa){_0x6e96e8['count']=_0x3deffa;if(_0x180016[_0x7df7('0x35')][_0x7df7('0x43')]){_0x66d926[_0x7df7('0x44')]=[{'all':!![]}];}return db[_0x7df7('0x30')][_0x7df7('0x45')](_0x66d926);})[_0x7df7('0x28')](function(_0x2fb6df){_0x6e96e8[_0x7df7('0x46')]=_0x2fb6df;return _0x6e96e8;})['then'](respondWithFilteredResult(_0x38234e,_0x66d926))['catch'](handleError(_0x38234e,null));};exports[_0x7df7('0x47')]=function(_0x1e6705,_0x3d71cd){var _0x549cb1={'raw':!![],'where':{'id':_0x1e6705[_0x7df7('0x48')]['id']}},_0x1d98d7={};_0x1d98d7['model']=_[_0x7df7('0x36')](db[_0x7df7('0x30')][_0x7df7('0x49')]);_0x1d98d7[_0x7df7('0x35')]=_['keys'](_0x1e6705['query']);_0x1d98d7[_0x7df7('0x37')]=_['intersection'](_0x1d98d7['model'],_0x1d98d7[_0x7df7('0x35')]);_0x549cb1[_0x7df7('0x39')]=_[_0x7df7('0x38')](_0x1d98d7[_0x7df7('0x34')],qs[_0x7df7('0x4a')](_0x1e6705['query'][_0x7df7('0x4a')]));_0x549cb1[_0x7df7('0x39')]=_0x549cb1[_0x7df7('0x39')][_0x7df7('0x3a')]?_0x549cb1[_0x7df7('0x39')]:_0x1d98d7['model'];if(_0x1e6705[_0x7df7('0x35')][_0x7df7('0x43')]){_0x549cb1[_0x7df7('0x44')]=[{'all':!![]}];}_0x549cb1=_[_0x7df7('0x40')]({},_0x549cb1,_0x1e6705['options']);return db[_0x7df7('0x30')][_0x7df7('0x4b')](_0x549cb1)[_0x7df7('0x28')](handleEntityNotFound(_0x3d71cd,null))[_0x7df7('0x28')](respondWithResult(_0x3d71cd,null))[_0x7df7('0x4c')](handleError(_0x3d71cd,null));};exports['create']=function(_0x2cca7c,_0x31769e){return db[_0x7df7('0x30')][_0x7df7('0x4d')](_0x2cca7c[_0x7df7('0x4e')],{})[_0x7df7('0x28')](respondWithResult(_0x31769e,0xc9))[_0x7df7('0x4c')](handleError(_0x31769e,null));};exports[_0x7df7('0x27')]=function(_0x269335,_0x17ada2){if(_0x269335['body']['id']){delete _0x269335[_0x7df7('0x4e')]['id'];}return db[_0x7df7('0x30')][_0x7df7('0x4b')]({'where':{'id':_0x269335[_0x7df7('0x48')]['id']}})['then'](handleEntityNotFound(_0x17ada2,null))[_0x7df7('0x28')](saveUpdates(_0x269335[_0x7df7('0x4e')],null))[_0x7df7('0x28')](respondWithResult(_0x17ada2,null))['catch'](handleError(_0x17ada2,null));};exports[_0x7df7('0x29')]=function(_0x5c82b7,_0x45be9a){return db[_0x7df7('0x30')]['find']({'where':{'id':_0x5c82b7[_0x7df7('0x48')]['id']}})[_0x7df7('0x28')](handleEntityNotFound(_0x45be9a,null))[_0x7df7('0x28')](removeEntity(_0x45be9a,null))[_0x7df7('0x4c')](handleError(_0x45be9a,null));}; \ No newline at end of file +var _0x6414=['bluebird','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmField','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x4c7241,_0x1a26fe){var _0xf6002f=function(_0x1e30d1){while(--_0x1e30d1){_0x4c7241['push'](_0x4c7241['shift']());}};_0xf6002f(++_0x1a26fe);}(_0x6414,0xcd));var _0x4641=function(_0x3b1763,_0x3f22d7){_0x3b1763=_0x3b1763-0x0;var _0xa96936=_0x6414[_0x3b1763];return _0xa96936;};'use strict';var emlformat=require(_0x4641('0x0'));var rimraf=require(_0x4641('0x1'));var zipdir=require(_0x4641('0x2'));var jsonpatch=require(_0x4641('0x3'));var rp=require('request-promise');var moment=require(_0x4641('0x4'));var BPromise=require(_0x4641('0x5'));var Mustache=require('mustache');var util=require(_0x4641('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x4641('0x7'));var ejs=require(_0x4641('0x8'));var fs=require('fs');var fs_extra=require(_0x4641('0x9'));var _=require('lodash');var squel=require(_0x4641('0xa'));var crypto=require(_0x4641('0xb'));var jsforce=require(_0x4641('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4641('0x7'));var querystring=require(_0x4641('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4641('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4641('0xf'));var hardwareService=require(_0x4641('0x10'));var logger=require(_0x4641('0x11'))(_0x4641('0x12'));var utils=require(_0x4641('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4641('0x14'))['db'];function respondWithStatusCode(_0x5f7ba0,_0x25d08c){_0x25d08c=_0x25d08c||0xcc;return function(_0x2ea614){if(_0x2ea614){return _0x5f7ba0[_0x4641('0x15')](_0x25d08c);}return _0x5f7ba0[_0x4641('0x16')](_0x25d08c)[_0x4641('0x17')]();};}function respondWithResult(_0x4427bb,_0x4a90e2){_0x4a90e2=_0x4a90e2||0xc8;return function(_0x188b15){if(_0x188b15){return _0x4427bb[_0x4641('0x16')](_0x4a90e2)['json'](_0x188b15);}};}function respondWithFilteredResult(_0x517d77,_0x11760b){return function(_0x8b3018){if(_0x8b3018){var _0x490608=typeof _0x11760b[_0x4641('0x18')]===_0x4641('0x19')&&typeof _0x11760b['limit']==='undefined';var _0xb8d0fe=_0x8b3018[_0x4641('0x1a')];var _0x5af3be=_0x490608?0x0:_0x11760b[_0x4641('0x18')];var _0x21be76=_0x490608?_0x8b3018[_0x4641('0x1a')]:_0x11760b[_0x4641('0x18')]+_0x11760b[_0x4641('0x1b')];var _0x45bcd3;if(_0x21be76>=_0xb8d0fe){_0x21be76=_0xb8d0fe;_0x45bcd3=0xc8;}else{_0x45bcd3=0xce;}_0x517d77['status'](_0x45bcd3);return _0x517d77[_0x4641('0x1c')](_0x4641('0x1d'),_0x5af3be+'-'+_0x21be76+'/'+_0xb8d0fe)['json'](_0x8b3018);}return null;};}function patchUpdates(_0x4ee3e6){return function(_0x4ce8cb){try{jsonpatch[_0x4641('0x1e')](_0x4ce8cb,_0x4ee3e6,!![]);}catch(_0x30a0df){return BPromise['reject'](_0x30a0df);}return _0x4ce8cb[_0x4641('0x1f')]();};}function saveUpdates(_0x257ac9,_0x50e801){return function(_0x2aed7c){if(_0x2aed7c){return _0x2aed7c[_0x4641('0x20')](_0x257ac9)[_0x4641('0x21')](function(_0x8a1e){return _0x8a1e;});}return null;};}function removeEntity(_0x1622f1,_0x55af3f){return function(_0x48699e){if(_0x48699e){return _0x48699e[_0x4641('0x22')]()['then'](function(){_0x1622f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24dc31,_0x4ecff3){return function(_0x55db85){if(!_0x55db85){_0x24dc31[_0x4641('0x15')](0x194);}return _0x55db85;};}function handleError(_0x453fee,_0x21266d){_0x21266d=_0x21266d||0x1f4;return function(_0x2d951d){logger[_0x4641('0x23')](_0x2d951d[_0x4641('0x24')]);if(_0x2d951d[_0x4641('0x25')]){delete _0x2d951d['name'];}_0x453fee[_0x4641('0x16')](_0x21266d)[_0x4641('0x26')](_0x2d951d);};}exports[_0x4641('0x27')]=function(_0x19b8fd,_0x4006e8){var _0x42e662={},_0x6101db={},_0x5989ad={'count':0x0,'rows':[]};var _0x2dc4dd=_[_0x4641('0x28')](db[_0x4641('0x29')]['rawAttributes'],function(_0x3b7ded){return{'name':_0x3b7ded['fieldName'],'type':_0x3b7ded[_0x4641('0x2a')]['key']};});_0x6101db[_0x4641('0x2b')]=_[_0x4641('0x28')](_0x2dc4dd,_0x4641('0x25'));_0x6101db[_0x4641('0x2c')]=_[_0x4641('0x2d')](_0x19b8fd[_0x4641('0x2c')]);_0x6101db[_0x4641('0x2e')]=_['intersection'](_0x6101db[_0x4641('0x2b')],_0x6101db[_0x4641('0x2c')]);_0x42e662[_0x4641('0x2f')]=_[_0x4641('0x30')](_0x6101db[_0x4641('0x2b')],qs[_0x4641('0x31')](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x31')]));_0x42e662[_0x4641('0x2f')]=_0x42e662['attributes'][_0x4641('0x32')]?_0x42e662[_0x4641('0x2f')]:_0x6101db['model'];if(!_0x19b8fd[_0x4641('0x2c')][_0x4641('0x33')](_0x4641('0x34'))){_0x42e662[_0x4641('0x1b')]=qs[_0x4641('0x1b')](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x1b')]);_0x42e662[_0x4641('0x18')]=qs[_0x4641('0x18')](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x18')]);}_0x42e662[_0x4641('0x35')]=qs['sort'](_0x19b8fd[_0x4641('0x2c')][_0x4641('0x36')]);_0x42e662[_0x4641('0x37')]=qs[_0x4641('0x2e')](_[_0x4641('0x38')](_0x19b8fd[_0x4641('0x2c')],_0x6101db['filters']),_0x2dc4dd);if(_0x19b8fd[_0x4641('0x2c')][_0x4641('0x39')]){_0x42e662['where']=_[_0x4641('0x3a')](_0x42e662[_0x4641('0x37')],{'$or':_[_0x4641('0x28')](_0x2dc4dd,function(_0x620532){if(_0x620532[_0x4641('0x2a')]!==_0x4641('0x3b')){var _0x4d97a8={};_0x4d97a8[_0x620532[_0x4641('0x25')]]={'$like':'%'+_0x19b8fd['query'][_0x4641('0x39')]+'%'};return _0x4d97a8;}})});}_0x42e662=_[_0x4641('0x3a')]({},_0x42e662,_0x19b8fd['options']);var _0x5c8e1d={'where':_0x42e662[_0x4641('0x37')]};return db[_0x4641('0x29')][_0x4641('0x1a')](_0x5c8e1d)[_0x4641('0x21')](function(_0xfa59df){_0x5989ad[_0x4641('0x1a')]=_0xfa59df;if(_0x19b8fd[_0x4641('0x2c')][_0x4641('0x3c')]){_0x42e662[_0x4641('0x3d')]=[{'all':!![]}];}return db[_0x4641('0x29')]['findAll'](_0x42e662);})[_0x4641('0x21')](function(_0x5e90be){_0x5989ad[_0x4641('0x3e')]=_0x5e90be;return _0x5989ad;})[_0x4641('0x21')](respondWithFilteredResult(_0x4006e8,_0x42e662))[_0x4641('0x3f')](handleError(_0x4006e8,null));};exports[_0x4641('0x40')]=function(_0x179af0,_0xc2cbbe){var _0x237836={'raw':!![],'where':{'id':_0x179af0[_0x4641('0x41')]['id']}},_0x5b199f={};_0x5b199f[_0x4641('0x2b')]=_[_0x4641('0x2d')](db[_0x4641('0x29')][_0x4641('0x42')]);_0x5b199f['query']=_[_0x4641('0x2d')](_0x179af0[_0x4641('0x2c')]);_0x5b199f['filters']=_[_0x4641('0x30')](_0x5b199f[_0x4641('0x2b')],_0x5b199f[_0x4641('0x2c')]);_0x237836['attributes']=_[_0x4641('0x30')](_0x5b199f['model'],qs[_0x4641('0x31')](_0x179af0['query'][_0x4641('0x31')]));_0x237836['attributes']=_0x237836[_0x4641('0x2f')]['length']?_0x237836[_0x4641('0x2f')]:_0x5b199f[_0x4641('0x2b')];if(_0x179af0[_0x4641('0x2c')]['includeAll']){_0x237836[_0x4641('0x3d')]=[{'all':!![]}];}_0x237836=_['merge']({},_0x237836,_0x179af0['options']);return db[_0x4641('0x29')][_0x4641('0x43')](_0x237836)['then'](handleEntityNotFound(_0xc2cbbe,null))['then'](respondWithResult(_0xc2cbbe,null))['catch'](handleError(_0xc2cbbe,null));};exports[_0x4641('0x44')]=function(_0x3aa0ff,_0x352f8c){return db[_0x4641('0x29')]['create'](_0x3aa0ff['body'],{})[_0x4641('0x21')](respondWithResult(_0x352f8c,0xc9))['catch'](handleError(_0x352f8c,null));};exports[_0x4641('0x20')]=function(_0x2d8c69,_0x1a9203){if(_0x2d8c69[_0x4641('0x45')]['id']){delete _0x2d8c69[_0x4641('0x45')]['id'];}return db[_0x4641('0x29')][_0x4641('0x43')]({'where':{'id':_0x2d8c69[_0x4641('0x41')]['id']}})[_0x4641('0x21')](handleEntityNotFound(_0x1a9203,null))[_0x4641('0x21')](saveUpdates(_0x2d8c69[_0x4641('0x45')],null))[_0x4641('0x21')](respondWithResult(_0x1a9203,null))[_0x4641('0x3f')](handleError(_0x1a9203,null));};exports['destroy']=function(_0x494d30,_0x4ed9f2){return db[_0x4641('0x29')][_0x4641('0x43')]({'where':{'id':_0x494d30[_0x4641('0x41')]['id']}})[_0x4641('0x21')](handleEntityNotFound(_0x4ed9f2,null))[_0x4641('0x21')](removeEntity(_0x4ed9f2,null))['catch'](handleError(_0x4ed9f2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 2f159ec..0efba96 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 _0x2807=['api','moment','request-promise','path','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x316904,_0x1e8b77){var _0xfa9a21=function(_0x2b75ae){while(--_0x2b75ae){_0x316904['push'](_0x316904['shift']());}};_0xfa9a21(++_0x1e8b77);}(_0x2807,0x108));var _0x7280=function(_0x54dcf3,_0x456746){_0x54dcf3=_0x54dcf3-0x0;var _0x33e984=_0x2807[_0x54dcf3];return _0x33e984;};'use strict';var _=require(_0x7280('0x0'));var util=require('util');var logger=require(_0x7280('0x1'))(_0x7280('0x2'));var moment=require(_0x7280('0x3'));var BPromise=require('bluebird');var rp=require(_0x7280('0x4'));var fs=require('fs');var path=require(_0x7280('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7280('0x6'));module[_0x7280('0x7')]=function(_0x1ccd85,_0x2fd987){return _0x1ccd85[_0x7280('0x8')](_0x7280('0x9'),attributes,{'tableName':_0x7280('0xa'),'paranoid':![],'indexes':[{'name':_0x7280('0xb'),'fields':[_0x7280('0xc'),_0x7280('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1eaf=['idField','FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','./intSugarcrmField.attributes','define','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x3a3e4f,_0x5b0b27){var _0x5841a6=function(_0x36da29){while(--_0x36da29){_0x3a3e4f['push'](_0x3a3e4f['shift']());}};_0x5841a6(++_0x5b0b27);}(_0x1eaf,0x1af));var _0xf1ea=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x1eaf[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xf1ea('0x0'));var util=require(_0xf1ea('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf1ea('0x2'));var BPromise=require(_0xf1ea('0x3'));var rp=require(_0xf1ea('0x4'));var fs=require('fs');var path=require(_0xf1ea('0x5'));var rimraf=require(_0xf1ea('0x6'));var config=require('../../config/environment');var attributes=require(_0xf1ea('0x7'));module['exports']=function(_0x45979e,_0x356fa4){return _0x45979e[_0xf1ea('0x8')]('SugarcrmField',attributes,{'tableName':_0xf1ea('0x9'),'paranoid':![],'indexes':[{'name':_0xf1ea('0xa'),'fields':[_0xf1ea('0xb'),_0xf1ea('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 3a878bf..c5ad0bc 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 _0x55c0=['moment','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x350957,_0x2fed9f){var _0x575eb8=function(_0x133662){while(--_0x133662){_0x350957['push'](_0x350957['shift']());}};_0x575eb8(++_0x2fed9f);}(_0x55c0,0x1de));var _0x055c=function(_0x99ff94,_0x47a1b1){_0x99ff94=_0x99ff94-0x0;var _0x1b5bc0=_0x55c0[_0x99ff94];return _0x1b5bc0;};'use strict';var _=require(_0x055c('0x0'));var util=require(_0x055c('0x1'));var moment=require(_0x055c('0x2'));var BPromise=require('bluebird');var rs=require(_0x055c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x055c('0x5'));var jayson=require(_0x055c('0x6'));var client=jayson[_0x055c('0x7')][_0x055c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bce58,_0x544665,_0x3d512f){return new BPromise(function(_0x3e4a21,_0x30e07d){return client['request'](_0x4bce58,_0x3d512f)[_0x055c('0x9')](function(_0x2eddf7){logger[_0x055c('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x544665,_0x055c('0xb'));logger[_0x055c('0xc')](_0x055c('0xd'),_0x544665,_0x055c('0xb'),JSON['stringify'](_0x2eddf7));if(_0x2eddf7[_0x055c('0xe')]){if(_0x2eddf7[_0x055c('0xe')][_0x055c('0xf')]===0x1f4){logger[_0x055c('0xe')](_0x055c('0x10'),_0x544665,_0x2eddf7[_0x055c('0xe')][_0x055c('0x11')]);return _0x30e07d(_0x2eddf7[_0x055c('0xe')]['message']);}logger[_0x055c('0xe')](_0x055c('0x10'),_0x544665,_0x2eddf7[_0x055c('0xe')][_0x055c('0x11')]);return _0x3e4a21(_0x2eddf7[_0x055c('0xe')][_0x055c('0x11')]);}else{logger[_0x055c('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x544665,_0x055c('0xb'));_0x3e4a21(_0x2eddf7[_0x055c('0x12')][_0x055c('0x11')]);}})[_0x055c('0x13')](function(_0x31b40c){logger[_0x055c('0xe')](_0x055c('0x10'),_0x544665,_0x31b40c);_0x30e07d(_0x31b40c);});});} \ No newline at end of file +var _0xc05c=['rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5b733d,_0x272606){var _0x2b7995=function(_0x1e5bf8){while(--_0x1e5bf8){_0x5b733d['push'](_0x5b733d['shift']());}};_0x2b7995(++_0x272606);}(_0xc05c,0x143));var _0xcc05=function(_0xc0dc5,_0x4739b7){_0xc0dc5=_0xc0dc5-0x0;var _0x3a6255=_0xc05c[_0xc0dc5];return _0x3a6255;};'use strict';var _=require(_0xcc05('0x0'));var util=require('util');var moment=require(_0xcc05('0x1'));var BPromise=require(_0xcc05('0x2'));var rs=require(_0xcc05('0x3'));var fs=require('fs');var Redis=require(_0xcc05('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc05('0x5'));var logger=require(_0xcc05('0x6'))(_0xcc05('0x7'));var config=require(_0xcc05('0x8'));var jayson=require(_0xcc05('0x9'));var client=jayson[_0xcc05('0xa')][_0xcc05('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1655e3,_0x313a43,_0x5a6ccc){return new BPromise(function(_0x2cee00,_0x309b06){return client['request'](_0x1655e3,_0x5a6ccc)[_0xcc05('0xc')](function(_0x4f0e09){logger['info'](_0xcc05('0xd'),_0x313a43,_0xcc05('0xe'));logger['debug'](_0xcc05('0xf'),_0x313a43,_0xcc05('0xe'),JSON[_0xcc05('0x10')](_0x4f0e09));if(_0x4f0e09[_0xcc05('0x11')]){if(_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x12')]===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x313a43,_0x4f0e09[_0xcc05('0x11')]['message']);return _0x309b06(_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x13')]);}logger[_0xcc05('0x11')](_0xcc05('0xd'),_0x313a43,_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x13')]);return _0x2cee00(_0x4f0e09[_0xcc05('0x11')][_0xcc05('0x13')]);}else{logger[_0xcc05('0x14')](_0xcc05('0xd'),_0x313a43,'request\x20sent');_0x2cee00(_0x4f0e09[_0xcc05('0x15')][_0xcc05('0x13')]);}})['catch'](function(_0x3e51dc){logger[_0xcc05('0x11')](_0xcc05('0xd'),_0x313a43,_0x3e51dc);_0x309b06(_0x3e51dc);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 14667b5..0f174f4 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 _0x6a24=['../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x50414c,_0x177356){var _0x1fc887=function(_0x59ae75){while(--_0x59ae75){_0x50414c['push'](_0x50414c['shift']());}};_0x1fc887(++_0x177356);}(_0x6a24,0xd1));var _0x46a2=function(_0x2f52f8,_0x4b1f53){_0x2f52f8=_0x2f52f8-0x0;var _0xdcde13=_0x6a24[_0x2f52f8];return _0xdcde13;};'use strict';var multer=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var path=require('path');var timeout=require(_0x46a2('0x2'));var express=require(_0x46a2('0x3'));var router=express[_0x46a2('0x4')]();var fs_extra=require(_0x46a2('0x5'));var auth=require(_0x46a2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x46a2('0x7'));var controller=require(_0x46a2('0x8'));router['get']('/',auth[_0x46a2('0x9')](),controller[_0x46a2('0xa')]);router['get']('/:id',auth[_0x46a2('0x9')](),controller[_0x46a2('0xb')]);router['get'](_0x46a2('0xc'),auth['isAuthenticated'](),controller[_0x46a2('0xd')]);router['get'](_0x46a2('0xe'),auth[_0x46a2('0x9')](),controller[_0x46a2('0xf')]);router[_0x46a2('0x10')]('/',auth[_0x46a2('0x9')](),controller[_0x46a2('0x11')]);router[_0x46a2('0x10')](_0x46a2('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x46a2('0x12')](_0x46a2('0x13'),auth['isAuthenticated'](),controller[_0x46a2('0x14')]);router[_0x46a2('0x15')](_0x46a2('0x13'),auth[_0x46a2('0x9')](),controller[_0x46a2('0x16')]);module[_0x46a2('0x17')]=router; \ No newline at end of file +var _0x534d=['/:id','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x534d,0x79));var _0xd534=function(_0x103b67,_0x800ef7){_0x103b67=_0x103b67-0x0;var _0x11650f=_0x534d[_0x103b67];return _0x11650f;};'use strict';var multer=require(_0xd534('0x0'));var util=require(_0xd534('0x1'));var path=require(_0xd534('0x2'));var timeout=require(_0xd534('0x3'));var express=require(_0xd534('0x4'));var router=express[_0xd534('0x5')]();var fs_extra=require(_0xd534('0x6'));var auth=require(_0xd534('0x7'));var interaction=require(_0xd534('0x8'));var config=require(_0xd534('0x9'));var controller=require(_0xd534('0xa'));router[_0xd534('0xb')]('/',auth[_0xd534('0xc')](),controller[_0xd534('0xd')]);router[_0xd534('0xb')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0xf')]);router[_0xd534('0xb')]('/:id/configurations',auth[_0xd534('0xc')](),controller[_0xd534('0x10')]);router[_0xd534('0xb')](_0xd534('0x11'),auth[_0xd534('0xc')](),controller['getFields']);router[_0xd534('0x12')]('/',auth[_0xd534('0xc')](),controller[_0xd534('0x13')]);router[_0xd534('0x12')](_0xd534('0x14'),auth[_0xd534('0xc')](),controller[_0xd534('0x15')]);router[_0xd534('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd534('0x17')]);router[_0xd534('0x18')](_0xd534('0xe'),auth[_0xd534('0xc')](),controller[_0xd534('0x19')]);module[_0xd534('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 38c4f8a..6d8eeff 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 _0x52b6=['exports','STRING','HelpDesk','sequelize'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x52b6,0x10b));var _0x652b=function(_0x302548,_0x428c39){_0x302548=_0x302548-0x0;var _0x184523=_0x52b6[_0x302548];return _0x184523;};'use strict';var Sequelize=require(_0x652b('0x0'));module[_0x652b('0x1')]={'name':{'type':Sequelize[_0x652b('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x652b('0x2')]},'username':{'type':Sequelize[_0x652b('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x652b('0x2')],'allowNull':![],'defaultValue':_0x652b('0x3')},'remoteUri':{'type':Sequelize[_0x652b('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x652b('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x652b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x61b6=['exports','STRING'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x61b6,0x106));var _0x661b=function(_0x595c09,_0x5c53fe){_0x595c09=_0x595c09-0x0;var _0xaac9e=_0x61b6[_0x595c09];return _0xaac9e;};'use strict';var Sequelize=require('sequelize');module[_0x661b('0x0')]={'name':{'type':Sequelize[_0x661b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x661b('0x1')]},'username':{'type':Sequelize[_0x661b('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x661b('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 81652b6..a6173c9 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 _0x7cca=['update','params','destroy','getConfigurations','VtigerConfiguration','order','options','hasOwnProperty','nolimit','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','slice','substring','%s/webservice.php','GET','getchallenge','success','POST','token','describe','autogenerated','reference','owner','includes','remove','result','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','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','status','end','limit','undefined','count','offset','set','json','then','sendStatus','name','send','index','map','VtigerAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','include','catch','show','includeAll','find','create','body'];(function(_0x4d20a3,_0x1e35cb){var _0x417c4d=function(_0x2a3d8e){while(--_0x2a3d8e){_0x4d20a3['push'](_0x4d20a3['shift']());}};_0x417c4d(++_0x1e35cb);}(_0x7cca,0xac));var _0xa7cc=function(_0xd31a3a,_0x4ffb6b){_0xd31a3a=_0xd31a3a-0x0;var _0x2f4d86=_0x7cca[_0xd31a3a];return _0x2f4d86;};'use strict';var emlformat=require(_0xa7cc('0x0'));var rimraf=require(_0xa7cc('0x1'));var zipdir=require(_0xa7cc('0x2'));var jsonpatch=require(_0xa7cc('0x3'));var rp=require(_0xa7cc('0x4'));var moment=require('moment');var BPromise=require(_0xa7cc('0x5'));var Mustache=require(_0xa7cc('0x6'));var util=require(_0xa7cc('0x7'));var path=require(_0xa7cc('0x8'));var sox=require(_0xa7cc('0x9'));var csv=require(_0xa7cc('0xa'));var ejs=require(_0xa7cc('0xb'));var fs=require('fs');var fs_extra=require(_0xa7cc('0xc'));var _=require('lodash');var squel=require(_0xa7cc('0xd'));var crypto=require(_0xa7cc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa7cc('0xf'));var toCsv=require(_0xa7cc('0xa'));var querystring=require('querystring');var Papa=require(_0xa7cc('0x10'));var Redis=require(_0xa7cc('0x11'));var authService=require(_0xa7cc('0x12'));var qs=require(_0xa7cc('0x13'));var as=require(_0xa7cc('0x14'));var hardwareService=require(_0xa7cc('0x15'));var logger=require(_0xa7cc('0x16'))(_0xa7cc('0x17'));var utils=require('../../config/utils');var config=require(_0xa7cc('0x18'));var licenseUtil=require(_0xa7cc('0x19'));var db=require(_0xa7cc('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x14956d,_0xa14851){_0xa14851=_0xa14851||0xcc;return function(_0x111696){if(_0x111696){return _0x14956d['sendStatus'](_0xa14851);}return _0x14956d[_0xa7cc('0x1b')](_0xa14851)[_0xa7cc('0x1c')]();};}function respondWithResult(_0x4ff8a1,_0x503a00){_0x503a00=_0x503a00||0xc8;return function(_0x495b85){if(_0x495b85){return _0x4ff8a1['status'](_0x503a00)['json'](_0x495b85);}};}function respondWithFilteredResult(_0x20016c,_0x48d540){return function(_0x65f1fd){if(_0x65f1fd){var _0x2151f4=typeof _0x48d540['offset']==='undefined'&&typeof _0x48d540[_0xa7cc('0x1d')]===_0xa7cc('0x1e');var _0x5b2155=_0x65f1fd[_0xa7cc('0x1f')];var _0x319248=_0x2151f4?0x0:_0x48d540[_0xa7cc('0x20')];var _0x45350c=_0x2151f4?_0x65f1fd[_0xa7cc('0x1f')]:_0x48d540['offset']+_0x48d540[_0xa7cc('0x1d')];var _0x2992aa;if(_0x45350c>=_0x5b2155){_0x45350c=_0x5b2155;_0x2992aa=0xc8;}else{_0x2992aa=0xce;}_0x20016c['status'](_0x2992aa);return _0x20016c[_0xa7cc('0x21')]('Content-Range',_0x319248+'-'+_0x45350c+'/'+_0x5b2155)[_0xa7cc('0x22')](_0x65f1fd);}return null;};}function patchUpdates(_0x4e8913){return function(_0x296547){try{jsonpatch['apply'](_0x296547,_0x4e8913,!![]);}catch(_0x2db5a7){return BPromise['reject'](_0x2db5a7);}return _0x296547['save']();};}function saveUpdates(_0x5ce182,_0x3e319e){return function(_0x4791b2){if(_0x4791b2){return _0x4791b2['update'](_0x5ce182)[_0xa7cc('0x23')](function(_0x53ed68){return _0x53ed68;});}return null;};}function removeEntity(_0x6fae85,_0x4091d3){return function(_0xc8216a){if(_0xc8216a){return _0xc8216a['destroy']()[_0xa7cc('0x23')](function(){_0x6fae85['status'](0xcc)[_0xa7cc('0x1c')]();});}};}function handleEntityNotFound(_0x590cdc,_0x4e4373){return function(_0x222fe5){if(!_0x222fe5){_0x590cdc[_0xa7cc('0x24')](0x194);}return _0x222fe5;};}function handleError(_0x376aed,_0x5a4a67){_0x5a4a67=_0x5a4a67||0x1f4;return function(_0x1e8093){logger['error'](_0x1e8093['stack']);if(_0x1e8093[_0xa7cc('0x25')]){delete _0x1e8093['name'];}_0x376aed[_0xa7cc('0x1b')](_0x5a4a67)[_0xa7cc('0x26')](_0x1e8093);};}exports[_0xa7cc('0x27')]=function(_0x3f1f88,_0x5f3e67){var _0x29b9e4={},_0x20071f={},_0x4f6df0={'count':0x0,'rows':[]};var _0x1ea599=_[_0xa7cc('0x28')](db[_0xa7cc('0x29')][_0xa7cc('0x2a')],function(_0x1dac9f){return{'name':_0x1dac9f['fieldName'],'type':_0x1dac9f[_0xa7cc('0x2b')][_0xa7cc('0x2c')]};});_0x20071f[_0xa7cc('0x2d')]=_['map'](_0x1ea599,_0xa7cc('0x25'));_0x20071f['query']=_[_0xa7cc('0x2e')](_0x3f1f88[_0xa7cc('0x2f')]);_0x20071f[_0xa7cc('0x30')]=_[_0xa7cc('0x31')](_0x20071f['model'],_0x20071f[_0xa7cc('0x2f')]);_0x29b9e4['attributes']=_['intersection'](_0x20071f[_0xa7cc('0x2d')],qs[_0xa7cc('0x32')](_0x3f1f88[_0xa7cc('0x2f')][_0xa7cc('0x32')]));_0x29b9e4[_0xa7cc('0x33')]=_0x29b9e4[_0xa7cc('0x33')][_0xa7cc('0x34')]?_0x29b9e4['attributes']:_0x20071f['model'];if(!_0x3f1f88[_0xa7cc('0x2f')]['hasOwnProperty']('nolimit')){_0x29b9e4['limit']=qs[_0xa7cc('0x1d')](_0x3f1f88[_0xa7cc('0x2f')][_0xa7cc('0x1d')]);_0x29b9e4[_0xa7cc('0x20')]=qs[_0xa7cc('0x20')](_0x3f1f88[_0xa7cc('0x2f')][_0xa7cc('0x20')]);}_0x29b9e4['order']=qs[_0xa7cc('0x35')](_0x3f1f88['query']['sort']);_0x29b9e4[_0xa7cc('0x36')]=qs[_0xa7cc('0x30')](_[_0xa7cc('0x37')](_0x3f1f88[_0xa7cc('0x2f')],_0x20071f[_0xa7cc('0x30')]),_0x1ea599);if(_0x3f1f88[_0xa7cc('0x2f')]['filter']){_0x29b9e4[_0xa7cc('0x36')]=_[_0xa7cc('0x38')](_0x29b9e4['where'],{'$or':_[_0xa7cc('0x28')](_0x1ea599,function(_0x237d27){if(_0x237d27[_0xa7cc('0x2b')]!==_0xa7cc('0x39')){var _0x299306={};_0x299306[_0x237d27[_0xa7cc('0x25')]]={'$like':'%'+_0x3f1f88[_0xa7cc('0x2f')][_0xa7cc('0x3a')]+'%'};return _0x299306;}})});}_0x29b9e4=_[_0xa7cc('0x38')]({},_0x29b9e4,_0x3f1f88['options']);var _0x275596={'where':_0x29b9e4['where']};return db[_0xa7cc('0x29')][_0xa7cc('0x1f')](_0x275596)[_0xa7cc('0x23')](function(_0x4a5ab3){_0x4f6df0[_0xa7cc('0x1f')]=_0x4a5ab3;if(_0x3f1f88[_0xa7cc('0x2f')]['includeAll']){_0x29b9e4[_0xa7cc('0x3b')]=[{'all':!![]}];}return db[_0xa7cc('0x29')]['findAll'](_0x29b9e4);})[_0xa7cc('0x23')](function(_0x2c2ba3){_0x4f6df0['rows']=_0x2c2ba3;return _0x4f6df0;})['then'](respondWithFilteredResult(_0x5f3e67,_0x29b9e4))[_0xa7cc('0x3c')](handleError(_0x5f3e67,null));};exports[_0xa7cc('0x3d')]=function(_0x4672a0,_0x2782d7){var _0xab2eb6={'raw':![],'where':{'id':_0x4672a0['params']['id']}},_0x4b9bd1={};_0x4b9bd1[_0xa7cc('0x2d')]=_[_0xa7cc('0x2e')](db[_0xa7cc('0x29')][_0xa7cc('0x2a')]);_0x4b9bd1[_0xa7cc('0x2f')]=_[_0xa7cc('0x2e')](_0x4672a0[_0xa7cc('0x2f')]);_0x4b9bd1[_0xa7cc('0x30')]=_[_0xa7cc('0x31')](_0x4b9bd1[_0xa7cc('0x2d')],_0x4b9bd1[_0xa7cc('0x2f')]);_0xab2eb6['attributes']=_['intersection'](_0x4b9bd1[_0xa7cc('0x2d')],qs[_0xa7cc('0x32')](_0x4672a0[_0xa7cc('0x2f')][_0xa7cc('0x32')]));_0xab2eb6[_0xa7cc('0x33')]=_0xab2eb6[_0xa7cc('0x33')]['length']?_0xab2eb6[_0xa7cc('0x33')]:_0x4b9bd1[_0xa7cc('0x2d')];if(_0x4672a0[_0xa7cc('0x2f')][_0xa7cc('0x3e')]){_0xab2eb6['include']=[{'all':!![]}];}_0xab2eb6=_[_0xa7cc('0x38')]({},_0xab2eb6,_0x4672a0['options']);return db[_0xa7cc('0x29')][_0xa7cc('0x3f')](_0xab2eb6)['then'](handleEntityNotFound(_0x2782d7,null))['then'](respondWithResult(_0x2782d7,null))[_0xa7cc('0x3c')](handleError(_0x2782d7,null));};exports['create']=function(_0x33c1db,_0x444c80){return db['VtigerAccount'][_0xa7cc('0x40')](_0x33c1db[_0xa7cc('0x41')],{})[_0xa7cc('0x23')](respondWithResult(_0x444c80,0xc9))[_0xa7cc('0x3c')](handleError(_0x444c80,null));};exports[_0xa7cc('0x42')]=function(_0x43e9e6,_0x3c120e){if(_0x43e9e6['body']['id']){delete _0x43e9e6[_0xa7cc('0x41')]['id'];}return db['VtigerAccount'][_0xa7cc('0x3f')]({'where':{'id':_0x43e9e6[_0xa7cc('0x43')]['id']}})[_0xa7cc('0x23')](handleEntityNotFound(_0x3c120e,null))[_0xa7cc('0x23')](saveUpdates(_0x43e9e6[_0xa7cc('0x41')],null))[_0xa7cc('0x23')](respondWithResult(_0x3c120e,null))[_0xa7cc('0x3c')](handleError(_0x3c120e,null));};exports[_0xa7cc('0x44')]=function(_0x5f111e,_0x3daa9d){return db[_0xa7cc('0x29')]['find']({'where':{'id':_0x5f111e[_0xa7cc('0x43')]['id']}})[_0xa7cc('0x23')](handleEntityNotFound(_0x3daa9d,null))[_0xa7cc('0x23')](removeEntity(_0x3daa9d,null))[_0xa7cc('0x3c')](handleError(_0x3daa9d,null));};exports[_0xa7cc('0x45')]=function(_0x2aa26d,_0x5db8a8,_0x8ba062){var _0x51987a={};var _0x54ab04={};var _0x23016e;var _0x5f4cca;return db[_0xa7cc('0x29')]['findOne']({'where':{'id':_0x2aa26d[_0xa7cc('0x43')]['id']}})[_0xa7cc('0x23')](handleEntityNotFound(_0x5db8a8,null))[_0xa7cc('0x23')](function(_0x7fc3f7){if(_0x7fc3f7){_0x23016e=_0x7fc3f7;_0x54ab04[_0xa7cc('0x2d')]=_[_0xa7cc('0x2e')](db[_0xa7cc('0x46')][_0xa7cc('0x2a')]);_0x54ab04[_0xa7cc('0x2f')]=_[_0xa7cc('0x2e')](_0x2aa26d[_0xa7cc('0x2f')]);_0x54ab04[_0xa7cc('0x30')]=_['intersection'](_0x54ab04['model'],_0x54ab04[_0xa7cc('0x2f')]);_0x51987a['attributes']=_[_0xa7cc('0x31')](_0x54ab04[_0xa7cc('0x2d')],qs[_0xa7cc('0x32')](_0x2aa26d['query'][_0xa7cc('0x32')]));_0x51987a['attributes']=_0x51987a[_0xa7cc('0x33')][_0xa7cc('0x34')]?_0x51987a[_0xa7cc('0x33')]:_0x54ab04['model'];_0x51987a[_0xa7cc('0x47')]=qs[_0xa7cc('0x35')](_0x2aa26d[_0xa7cc('0x2f')]['sort']);_0x51987a[_0xa7cc('0x36')]=qs[_0xa7cc('0x30')](_[_0xa7cc('0x37')](_0x2aa26d[_0xa7cc('0x2f')],_0x54ab04[_0xa7cc('0x30')]));if(_0x2aa26d[_0xa7cc('0x2f')][_0xa7cc('0x3a')]){_0x51987a[_0xa7cc('0x36')]=_[_0xa7cc('0x38')](_0x51987a[_0xa7cc('0x36')],{'$or':_[_0xa7cc('0x28')](_0x51987a[_0xa7cc('0x33')],function(_0x8b34d0){var _0x2700f7={};_0x2700f7[_0x8b34d0]={'$like':'%'+_0x2aa26d[_0xa7cc('0x2f')][_0xa7cc('0x3a')]+'%'};return _0x2700f7;})});}_0x51987a=_[_0xa7cc('0x38')]({},_0x51987a,_0x2aa26d[_0xa7cc('0x48')]);return _0x23016e[_0xa7cc('0x45')](_0x51987a);}})[_0xa7cc('0x23')](function(_0x22cc23){if(_0x22cc23){_0x5f4cca=_0x22cc23[_0xa7cc('0x34')];if(!_0x2aa26d[_0xa7cc('0x2f')][_0xa7cc('0x49')](_0xa7cc('0x4a'))){_0x51987a[_0xa7cc('0x1d')]=qs[_0xa7cc('0x1d')](_0x2aa26d[_0xa7cc('0x2f')][_0xa7cc('0x1d')]);_0x51987a[_0xa7cc('0x20')]=qs[_0xa7cc('0x20')](_0x2aa26d['query']['offset']);}return _0x23016e[_0xa7cc('0x45')](_0x51987a);}})[_0xa7cc('0x23')](function(_0x4f4379){if(_0x4f4379){return _0x4f4379?{'count':_0x5f4cca,'rows':_0x4f4379}:null;}})[_0xa7cc('0x23')](respondWithResult(_0x5db8a8,null))[_0xa7cc('0x3c')](handleError(_0x5db8a8,null));};exports['addConfiguration']=function(_0x59a931,_0x55b768,_0x260ab4){if(_0x59a931['body']['id']){delete _0x59a931[_0xa7cc('0x41')]['id'];}return db[_0xa7cc('0x29')][_0xa7cc('0x4b')]({'where':{'id':_0x59a931[_0xa7cc('0x43')]['id']}})[_0xa7cc('0x23')](handleEntityNotFound(_0x55b768,null))[_0xa7cc('0x23')](function(_0x11022b){if(_0x11022b){_0x59a931[_0xa7cc('0x41')][_0xa7cc('0x4c')]=_0x11022b['id'];_0x59a931[_0xa7cc('0x41')][_0xa7cc('0x4d')]=integrations[_0xa7cc('0x4e')](_0x59a931[_0xa7cc('0x41')]['channel'],_0x59a931[_0xa7cc('0x41')][_0xa7cc('0x2b')]);_0x59a931[_0xa7cc('0x41')][_0xa7cc('0x4f')]=integrations[_0xa7cc('0x50')](_0x59a931['body'][_0xa7cc('0x51')],_0x59a931[_0xa7cc('0x41')][_0xa7cc('0x2b')]);return db[_0xa7cc('0x46')]['create'](_0x59a931['body'],{'include':[{'model':db[_0xa7cc('0x52')],'as':'Subjects'},{'model':db[_0xa7cc('0x52')],'as':_0xa7cc('0x4f')}]});}return null;})[_0xa7cc('0x23')](respondWithResult(_0x55b768,null))[_0xa7cc('0x3c')](handleError(_0x55b768,null));};var md5=require(_0xa7cc('0x53'));exports[_0xa7cc('0x54')]=function(_0x108f6f,_0x4a8058,_0x36b458){var _0xcb98ac=null;var _0x1a98d2=null;var _0x2560c6=null;var _0x18d80c=null;var _0x44539a='';return db['VtigerAccount'][_0xa7cc('0x4b')]({'where':{'id':_0x108f6f[_0xa7cc('0x43')]['id']},'attributes':['id',_0xa7cc('0x25'),_0xa7cc('0x55'),'description',_0xa7cc('0x56'),_0xa7cc('0x57'),'serverUrl','accessKey']})[_0xa7cc('0x23')](handleEntityNotFound(_0x4a8058,null))[_0xa7cc('0x23')](function(_0x4d5c06){if(_0x4d5c06){_0xcb98ac=_0x4d5c06['username'];_0x1a98d2=_0x4d5c06[_0xa7cc('0x58')];_0x2560c6=_0x4d5c06['moduleName'];_0x44539a=_0x4d5c06['remoteUri'];var _0x2ad29d=_0x44539a[_0xa7cc('0x59')](-0x1);if(_0x2ad29d==='/'){_0x44539a=_0x44539a[_0xa7cc('0x5a')](0x0,_0x44539a['lastIndexOf'](_0x2ad29d));}_0x18d80c=util['format'](_0xa7cc('0x5b'),_0x44539a);var _0x4d7b4e={'method':_0xa7cc('0x5c'),'uri':_0x18d80c,'qs':{'operation':_0xa7cc('0x5d'),'username':_0x4d5c06[_0xa7cc('0x55')]},'json':!![]};return rp(_0x4d7b4e);}})[_0xa7cc('0x23')](function(_0x35a383){if(_0x35a383[_0xa7cc('0x5e')]){var _0x48f54f={'method':_0xa7cc('0x5f'),'uri':_0x18d80c,'form':{'operation':'login','username':_0xcb98ac,'accessKey':md5(_0x35a383['result'][_0xa7cc('0x60')]+_0x1a98d2)},'json':!![]};return rp(_0x48f54f);}})[_0xa7cc('0x23')](function(_0x4f3885){if(_0x4f3885[_0xa7cc('0x5e')]){var _0x4e0325={'method':_0xa7cc('0x5c'),'uri':_0x18d80c,'qs':{'operation':_0xa7cc('0x61'),'username':_0xcb98ac,'sessionName':_0x4f3885['result']['sessionName'],'elementType':_0x2560c6},'json':!![]};return rp(_0x4e0325);}})[_0xa7cc('0x23')](function(_0x3336ad){if(_0x3336ad[_0xa7cc('0x5e')]){var _0x394303=[_0xa7cc('0x62'),_0xa7cc('0x63'),_0xa7cc('0x64')];_['remove'](_0x3336ad['result'][_0xa7cc('0x32')],function(_0x552809){return _0x394303[_0xa7cc('0x65')](_0x552809[_0xa7cc('0x2b')][_0xa7cc('0x25')]);});_[_0xa7cc('0x66')](_0x3336ad[_0xa7cc('0x67')]['fields'],function(_0x4e6deb){return _0x4e6deb[_0xa7cc('0x68')]===_0xa7cc('0x69');});return{'count':_0x3336ad[_0xa7cc('0x67')][_0xa7cc('0x32')][_0xa7cc('0x34')],'rows':_['map'](_0x3336ad[_0xa7cc('0x67')][_0xa7cc('0x32')],function(_0x7eb7a4){return{'id':_0x7eb7a4[_0xa7cc('0x25')],'name':_0x7eb7a4[_0xa7cc('0x6a')],'custom':_[_0xa7cc('0x6b')](_0x7eb7a4[_0xa7cc('0x25')],'cf_')?!![]:![],'options':_0x7eb7a4['type'][_0xa7cc('0x25')]===_0xa7cc('0x6c')&&_0x7eb7a4[_0xa7cc('0x2b')]['picklistValues'][_0xa7cc('0x34')]>0x0?_[_0xa7cc('0x28')](_0x7eb7a4['type'][_0xa7cc('0x6d')],function(_0x35f4c6){return{'name':_0x35f4c6[_0xa7cc('0x6a')],'value':_0x35f4c6[_0xa7cc('0x6e')]};}):[]};})};}})[_0xa7cc('0x23')](respondWithResult(_0x4a8058,null))[_0xa7cc('0x3c')](function(_0x33362a){console[_0xa7cc('0x6f')](_0xa7cc('0x70')+_0x33362a);var _0x275d7c=_0x108f6f[_0xa7cc('0x2f')][_0xa7cc('0x71')]?0x1f4:_0x33362a[_0xa7cc('0x72')]||0x1f4;logger[_0xa7cc('0x73')](_0xa7cc('0x74'),_0xa7cc('0x54'),_0x275d7c,JSON[_0xa7cc('0x75')](_0x33362a));delete _0x33362a[_0xa7cc('0x25')];if(_0x275d7c===0x191){_0x275d7c=0x190;}_0x4a8058[_0xa7cc('0x1b')](_0x275d7c)[_0xa7cc('0x26')](_0x108f6f[_0xa7cc('0x2f')]['test']?{'message':_0xa7cc('0x76'),'statusCode':_0x33362a[_0xa7cc('0x72')]}:_0x33362a);});}; \ No newline at end of file +var _0xdc2e=['login','result','token','success','describe','sessionName','reference','remove','includes','false','label','startsWith','cf_','picklist','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../components/integrations/configuration','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','sendStatus','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','keys','find','create','catch','update','body','params','destroy','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','moduleName','remoteUri','username','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','POST'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdc2e,0x89));var _0xedc2=function(_0x120b23,_0xb9810f){_0x120b23=_0x120b23-0x0;var _0x2958eb=_0xdc2e[_0x120b23];return _0x2958eb;};'use strict';var emlformat=require(_0xedc2('0x0'));var rimraf=require(_0xedc2('0x1'));var zipdir=require(_0xedc2('0x2'));var jsonpatch=require(_0xedc2('0x3'));var rp=require(_0xedc2('0x4'));var moment=require(_0xedc2('0x5'));var BPromise=require(_0xedc2('0x6'));var Mustache=require(_0xedc2('0x7'));var util=require('util');var path=require(_0xedc2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xedc2('0x9'));var fs=require('fs');var fs_extra=require(_0xedc2('0xa'));var _=require(_0xedc2('0xb'));var squel=require(_0xedc2('0xc'));var crypto=require('crypto');var jsforce=require(_0xedc2('0xd'));var deskjs=require(_0xedc2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xedc2('0xf'));var Papa=require(_0xedc2('0x10'));var Redis=require(_0xedc2('0x11'));var authService=require(_0xedc2('0x12'));var qs=require(_0xedc2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedc2('0x14'));var logger=require(_0xedc2('0x15'))('api');var utils=require(_0xedc2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xedc2('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xedc2('0x18'));function respondWithStatusCode(_0x2a0cf2,_0x233f68){_0x233f68=_0x233f68||0xcc;return function(_0x1b1b39){if(_0x1b1b39){return _0x2a0cf2['sendStatus'](_0x233f68);}return _0x2a0cf2['status'](_0x233f68)['end']();};}function respondWithResult(_0x7dbdfa,_0x1aef68){_0x1aef68=_0x1aef68||0xc8;return function(_0x4c5004){if(_0x4c5004){return _0x7dbdfa[_0xedc2('0x19')](_0x1aef68)['json'](_0x4c5004);}};}function respondWithFilteredResult(_0x1e8522,_0x42f72c){return function(_0xf8c2d4){if(_0xf8c2d4){var _0x588e47=typeof _0x42f72c[_0xedc2('0x1a')]===_0xedc2('0x1b')&&typeof _0x42f72c[_0xedc2('0x1c')]==='undefined';var _0x454906=_0xf8c2d4[_0xedc2('0x1d')];var _0x948d88=_0x588e47?0x0:_0x42f72c[_0xedc2('0x1a')];var _0x295fb6=_0x588e47?_0xf8c2d4[_0xedc2('0x1d')]:_0x42f72c[_0xedc2('0x1a')]+_0x42f72c[_0xedc2('0x1c')];var _0x522349;if(_0x295fb6>=_0x454906){_0x295fb6=_0x454906;_0x522349=0xc8;}else{_0x522349=0xce;}_0x1e8522[_0xedc2('0x19')](_0x522349);return _0x1e8522[_0xedc2('0x1e')](_0xedc2('0x1f'),_0x948d88+'-'+_0x295fb6+'/'+_0x454906)['json'](_0xf8c2d4);}return null;};}function patchUpdates(_0x4592f3){return function(_0x4a3dbe){try{jsonpatch[_0xedc2('0x20')](_0x4a3dbe,_0x4592f3,!![]);}catch(_0x3a1c97){return BPromise[_0xedc2('0x21')](_0x3a1c97);}return _0x4a3dbe[_0xedc2('0x22')]();};}function saveUpdates(_0x418902,_0x10c364){return function(_0x2ec0d0){if(_0x2ec0d0){return _0x2ec0d0['update'](_0x418902)[_0xedc2('0x23')](function(_0x2605f7){return _0x2605f7;});}return null;};}function removeEntity(_0x1070b2,_0x437873){return function(_0x5956d2){if(_0x5956d2){return _0x5956d2['destroy']()['then'](function(){_0x1070b2[_0xedc2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c3531,_0xfb5462){return function(_0xfef468){if(!_0xfef468){_0x2c3531[_0xedc2('0x24')](0x194);}return _0xfef468;};}function handleError(_0x342a1f,_0x26a365){_0x26a365=_0x26a365||0x1f4;return function(_0x32c261){logger[_0xedc2('0x25')](_0x32c261['stack']);if(_0x32c261[_0xedc2('0x26')]){delete _0x32c261['name'];}_0x342a1f[_0xedc2('0x19')](_0x26a365)[_0xedc2('0x27')](_0x32c261);};}exports[_0xedc2('0x28')]=function(_0x368ba0,_0x70add5){var _0x3e073c={},_0x586514={},_0x8cb1b4={'count':0x0,'rows':[]};var _0x32d3ce=_[_0xedc2('0x29')](db[_0xedc2('0x2a')][_0xedc2('0x2b')],function(_0x156919){return{'name':_0x156919[_0xedc2('0x2c')],'type':_0x156919[_0xedc2('0x2d')][_0xedc2('0x2e')]};});_0x586514[_0xedc2('0x2f')]=_[_0xedc2('0x29')](_0x32d3ce,_0xedc2('0x26'));_0x586514[_0xedc2('0x30')]=_['keys'](_0x368ba0['query']);_0x586514['filters']=_['intersection'](_0x586514[_0xedc2('0x2f')],_0x586514[_0xedc2('0x30')]);_0x3e073c[_0xedc2('0x31')]=_[_0xedc2('0x32')](_0x586514[_0xedc2('0x2f')],qs[_0xedc2('0x33')](_0x368ba0[_0xedc2('0x30')]['fields']));_0x3e073c['attributes']=_0x3e073c['attributes'][_0xedc2('0x34')]?_0x3e073c[_0xedc2('0x31')]:_0x586514['model'];if(!_0x368ba0[_0xedc2('0x30')][_0xedc2('0x35')]('nolimit')){_0x3e073c[_0xedc2('0x1c')]=qs['limit'](_0x368ba0[_0xedc2('0x30')][_0xedc2('0x1c')]);_0x3e073c[_0xedc2('0x1a')]=qs[_0xedc2('0x1a')](_0x368ba0[_0xedc2('0x30')]['offset']);}_0x3e073c[_0xedc2('0x36')]=qs[_0xedc2('0x37')](_0x368ba0[_0xedc2('0x30')][_0xedc2('0x37')]);_0x3e073c[_0xedc2('0x38')]=qs[_0xedc2('0x39')](_[_0xedc2('0x3a')](_0x368ba0[_0xedc2('0x30')],_0x586514[_0xedc2('0x39')]),_0x32d3ce);if(_0x368ba0[_0xedc2('0x30')][_0xedc2('0x3b')]){_0x3e073c[_0xedc2('0x38')]=_['merge'](_0x3e073c[_0xedc2('0x38')],{'$or':_[_0xedc2('0x29')](_0x32d3ce,function(_0x35c25e){if(_0x35c25e[_0xedc2('0x2d')]!=='VIRTUAL'){var _0x2a5d15={};_0x2a5d15[_0x35c25e[_0xedc2('0x26')]]={'$like':'%'+_0x368ba0[_0xedc2('0x30')][_0xedc2('0x3b')]+'%'};return _0x2a5d15;}})});}_0x3e073c=_[_0xedc2('0x3c')]({},_0x3e073c,_0x368ba0[_0xedc2('0x3d')]);var _0x2f8f8d={'where':_0x3e073c['where']};return db['VtigerAccount'][_0xedc2('0x1d')](_0x2f8f8d)[_0xedc2('0x23')](function(_0x3239b6){_0x8cb1b4[_0xedc2('0x1d')]=_0x3239b6;if(_0x368ba0['query'][_0xedc2('0x3e')]){_0x3e073c[_0xedc2('0x3f')]=[{'all':!![]}];}return db[_0xedc2('0x2a')][_0xedc2('0x40')](_0x3e073c);})['then'](function(_0x342b49){_0x8cb1b4[_0xedc2('0x41')]=_0x342b49;return _0x8cb1b4;})['then'](respondWithFilteredResult(_0x70add5,_0x3e073c))['catch'](handleError(_0x70add5,null));};exports['show']=function(_0x10ed67,_0x93900d){var _0x5e23cd={'raw':![],'where':{'id':_0x10ed67['params']['id']}},_0x323b28={};_0x323b28['model']=_[_0xedc2('0x42')](db[_0xedc2('0x2a')][_0xedc2('0x2b')]);_0x323b28[_0xedc2('0x30')]=_[_0xedc2('0x42')](_0x10ed67[_0xedc2('0x30')]);_0x323b28[_0xedc2('0x39')]=_[_0xedc2('0x32')](_0x323b28[_0xedc2('0x2f')],_0x323b28['query']);_0x5e23cd[_0xedc2('0x31')]=_[_0xedc2('0x32')](_0x323b28[_0xedc2('0x2f')],qs[_0xedc2('0x33')](_0x10ed67['query'][_0xedc2('0x33')]));_0x5e23cd[_0xedc2('0x31')]=_0x5e23cd[_0xedc2('0x31')]['length']?_0x5e23cd[_0xedc2('0x31')]:_0x323b28[_0xedc2('0x2f')];if(_0x10ed67[_0xedc2('0x30')][_0xedc2('0x3e')]){_0x5e23cd[_0xedc2('0x3f')]=[{'all':!![]}];}_0x5e23cd=_[_0xedc2('0x3c')]({},_0x5e23cd,_0x10ed67[_0xedc2('0x3d')]);return db[_0xedc2('0x2a')][_0xedc2('0x43')](_0x5e23cd)['then'](handleEntityNotFound(_0x93900d,null))['then'](respondWithResult(_0x93900d,null))['catch'](handleError(_0x93900d,null));};exports['create']=function(_0x4002a7,_0x49c18f){return db[_0xedc2('0x2a')][_0xedc2('0x44')](_0x4002a7['body'],{})[_0xedc2('0x23')](respondWithResult(_0x49c18f,0xc9))[_0xedc2('0x45')](handleError(_0x49c18f,null));};exports[_0xedc2('0x46')]=function(_0x39ac0c,_0x2244dc){if(_0x39ac0c[_0xedc2('0x47')]['id']){delete _0x39ac0c['body']['id'];}return db[_0xedc2('0x2a')]['find']({'where':{'id':_0x39ac0c[_0xedc2('0x48')]['id']}})[_0xedc2('0x23')](handleEntityNotFound(_0x2244dc,null))[_0xedc2('0x23')](saveUpdates(_0x39ac0c[_0xedc2('0x47')],null))['then'](respondWithResult(_0x2244dc,null))['catch'](handleError(_0x2244dc,null));};exports[_0xedc2('0x49')]=function(_0x5e5f31,_0x2abb9c){return db[_0xedc2('0x2a')][_0xedc2('0x43')]({'where':{'id':_0x5e5f31[_0xedc2('0x48')]['id']}})['then'](handleEntityNotFound(_0x2abb9c,null))[_0xedc2('0x23')](removeEntity(_0x2abb9c,null))['catch'](handleError(_0x2abb9c,null));};exports[_0xedc2('0x4a')]=function(_0x4149a6,_0x1b4a32,_0x1bf26c){var _0x8a2cc0={};var _0x2c0852={};var _0x3427c6;var _0x1116d9;return db[_0xedc2('0x2a')][_0xedc2('0x4b')]({'where':{'id':_0x4149a6[_0xedc2('0x48')]['id']}})[_0xedc2('0x23')](handleEntityNotFound(_0x1b4a32,null))[_0xedc2('0x23')](function(_0xf0dc64){if(_0xf0dc64){_0x3427c6=_0xf0dc64;_0x2c0852[_0xedc2('0x2f')]=_[_0xedc2('0x42')](db[_0xedc2('0x4c')]['rawAttributes']);_0x2c0852[_0xedc2('0x30')]=_[_0xedc2('0x42')](_0x4149a6[_0xedc2('0x30')]);_0x2c0852[_0xedc2('0x39')]=_['intersection'](_0x2c0852[_0xedc2('0x2f')],_0x2c0852[_0xedc2('0x30')]);_0x8a2cc0[_0xedc2('0x31')]=_[_0xedc2('0x32')](_0x2c0852[_0xedc2('0x2f')],qs[_0xedc2('0x33')](_0x4149a6[_0xedc2('0x30')]['fields']));_0x8a2cc0[_0xedc2('0x31')]=_0x8a2cc0[_0xedc2('0x31')]['length']?_0x8a2cc0[_0xedc2('0x31')]:_0x2c0852[_0xedc2('0x2f')];_0x8a2cc0[_0xedc2('0x36')]=qs[_0xedc2('0x37')](_0x4149a6[_0xedc2('0x30')][_0xedc2('0x37')]);_0x8a2cc0[_0xedc2('0x38')]=qs['filters'](_[_0xedc2('0x3a')](_0x4149a6[_0xedc2('0x30')],_0x2c0852[_0xedc2('0x39')]));if(_0x4149a6[_0xedc2('0x30')][_0xedc2('0x3b')]){_0x8a2cc0[_0xedc2('0x38')]=_[_0xedc2('0x3c')](_0x8a2cc0[_0xedc2('0x38')],{'$or':_[_0xedc2('0x29')](_0x8a2cc0['attributes'],function(_0x2ec907){var _0x1dc9b4={};_0x1dc9b4[_0x2ec907]={'$like':'%'+_0x4149a6[_0xedc2('0x30')]['filter']+'%'};return _0x1dc9b4;})});}_0x8a2cc0=_[_0xedc2('0x3c')]({},_0x8a2cc0,_0x4149a6[_0xedc2('0x3d')]);return _0x3427c6['getConfigurations'](_0x8a2cc0);}})[_0xedc2('0x23')](function(_0x36611b){if(_0x36611b){_0x1116d9=_0x36611b[_0xedc2('0x34')];if(!_0x4149a6[_0xedc2('0x30')][_0xedc2('0x35')](_0xedc2('0x4d'))){_0x8a2cc0[_0xedc2('0x1c')]=qs[_0xedc2('0x1c')](_0x4149a6[_0xedc2('0x30')]['limit']);_0x8a2cc0['offset']=qs[_0xedc2('0x1a')](_0x4149a6[_0xedc2('0x30')][_0xedc2('0x1a')]);}return _0x3427c6[_0xedc2('0x4a')](_0x8a2cc0);}})[_0xedc2('0x23')](function(_0x3c111e){if(_0x3c111e){return _0x3c111e?{'count':_0x1116d9,'rows':_0x3c111e}:null;}})[_0xedc2('0x23')](respondWithResult(_0x1b4a32,null))['catch'](handleError(_0x1b4a32,null));};exports[_0xedc2('0x4e')]=function(_0x696fd8,_0x889ac4,_0x4165a8){if(_0x696fd8['body']['id']){delete _0x696fd8[_0xedc2('0x47')]['id'];}return db['VtigerAccount'][_0xedc2('0x4b')]({'where':{'id':_0x696fd8[_0xedc2('0x48')]['id']}})[_0xedc2('0x23')](handleEntityNotFound(_0x889ac4,null))[_0xedc2('0x23')](function(_0x6c8996){if(_0x6c8996){_0x696fd8[_0xedc2('0x47')][_0xedc2('0x4f')]=_0x6c8996['id'];_0x696fd8[_0xedc2('0x47')][_0xedc2('0x50')]=integrations[_0xedc2('0x51')](_0x696fd8[_0xedc2('0x47')]['channel'],_0x696fd8[_0xedc2('0x47')][_0xedc2('0x2d')]);_0x696fd8[_0xedc2('0x47')][_0xedc2('0x52')]=integrations[_0xedc2('0x53')](_0x696fd8['body'][_0xedc2('0x54')],_0x696fd8[_0xedc2('0x47')][_0xedc2('0x2d')]);return db['VtigerConfiguration'][_0xedc2('0x44')](_0x696fd8['body'],{'include':[{'model':db[_0xedc2('0x55')],'as':_0xedc2('0x50')},{'model':db[_0xedc2('0x55')],'as':'Descriptions'}]});}return null;})[_0xedc2('0x23')](respondWithResult(_0x889ac4,null))['catch'](handleError(_0x889ac4,null));};var md5=require(_0xedc2('0x56'));exports[_0xedc2('0x57')]=function(_0x37dddf,_0x5a87e7,_0x543446){var _0x41030b=null;var _0x199672=null;var _0x5d0da4=null;var _0x3f604b=null;var _0xe56c71='';return db[_0xedc2('0x2a')][_0xedc2('0x4b')]({'where':{'id':_0x37dddf[_0xedc2('0x48')]['id']},'attributes':['id',_0xedc2('0x26'),'username','description',_0xedc2('0x58'),_0xedc2('0x59'),'serverUrl','accessKey']})['then'](handleEntityNotFound(_0x5a87e7,null))[_0xedc2('0x23')](function(_0x1fe068){if(_0x1fe068){_0x41030b=_0x1fe068[_0xedc2('0x5a')];_0x199672=_0x1fe068[_0xedc2('0x5b')];_0x5d0da4=_0x1fe068[_0xedc2('0x58')];_0xe56c71=_0x1fe068[_0xedc2('0x59')];var _0x1faf3f=_0xe56c71[_0xedc2('0x5c')](-0x1);if(_0x1faf3f==='/'){_0xe56c71=_0xe56c71[_0xedc2('0x5d')](0x0,_0xe56c71['lastIndexOf'](_0x1faf3f));}_0x3f604b=util[_0xedc2('0x5e')](_0xedc2('0x5f'),_0xe56c71);var _0x4ae0ba={'method':_0xedc2('0x60'),'uri':_0x3f604b,'qs':{'operation':_0xedc2('0x61'),'username':_0x1fe068[_0xedc2('0x5a')]},'json':!![]};return rp(_0x4ae0ba);}})[_0xedc2('0x23')](function(_0x1e0fcc){if(_0x1e0fcc['success']){var _0x3f7a2b={'method':_0xedc2('0x62'),'uri':_0x3f604b,'form':{'operation':_0xedc2('0x63'),'username':_0x41030b,'accessKey':md5(_0x1e0fcc[_0xedc2('0x64')][_0xedc2('0x65')]+_0x199672)},'json':!![]};return rp(_0x3f7a2b);}})['then'](function(_0x1b734a){if(_0x1b734a[_0xedc2('0x66')]){var _0x2a37dd={'method':_0xedc2('0x60'),'uri':_0x3f604b,'qs':{'operation':_0xedc2('0x67'),'username':_0x41030b,'sessionName':_0x1b734a[_0xedc2('0x64')][_0xedc2('0x68')],'elementType':_0x5d0da4},'json':!![]};return rp(_0x2a37dd);}})[_0xedc2('0x23')](function(_0x35520b){if(_0x35520b[_0xedc2('0x66')]){var _0x46d0e1=['autogenerated',_0xedc2('0x69'),'owner'];_[_0xedc2('0x6a')](_0x35520b[_0xedc2('0x64')][_0xedc2('0x33')],function(_0x5d70ef){return _0x46d0e1[_0xedc2('0x6b')](_0x5d70ef[_0xedc2('0x2d')][_0xedc2('0x26')]);});_[_0xedc2('0x6a')](_0x35520b['result']['fields'],function(_0x114758){return _0x114758['editable']===_0xedc2('0x6c');});return{'count':_0x35520b[_0xedc2('0x64')]['fields']['length'],'rows':_[_0xedc2('0x29')](_0x35520b[_0xedc2('0x64')][_0xedc2('0x33')],function(_0x1d3969){return{'id':_0x1d3969[_0xedc2('0x26')],'name':_0x1d3969[_0xedc2('0x6d')],'custom':_[_0xedc2('0x6e')](_0x1d3969[_0xedc2('0x26')],_0xedc2('0x6f'))?!![]:![],'options':_0x1d3969[_0xedc2('0x2d')][_0xedc2('0x26')]===_0xedc2('0x70')&&_0x1d3969['type']['picklistValues'][_0xedc2('0x34')]>0x0?_[_0xedc2('0x29')](_0x1d3969[_0xedc2('0x2d')]['picklistValues'],function(_0x43ba0d){return{'name':_0x43ba0d[_0xedc2('0x6d')],'value':_0x43ba0d['value']};}):[]};})};}})['then'](respondWithResult(_0x5a87e7,null))[_0xedc2('0x45')](function(_0x42accd){console['log'](_0xedc2('0x71')+_0x42accd);var _0x75bbbb=_0x37dddf['query']['test']?0x1f4:_0x42accd[_0xedc2('0x72')]||0x1f4;logger[_0xedc2('0x25')](_0xedc2('0x73'),_0xedc2('0x57'),_0x75bbbb,JSON[_0xedc2('0x74')](_0x42accd));delete _0x42accd[_0xedc2('0x26')];if(_0x75bbbb===0x191){_0x75bbbb=0x190;}_0x5a87e7[_0xedc2('0x19')](_0x75bbbb)[_0xedc2('0x27')](_0x37dddf[_0xedc2('0x30')][_0xedc2('0x75')]?{'message':'Wrong\x20credentials','statusCode':_0x42accd[_0xedc2('0x72')]}:_0x42accd);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 0689e92..5901ca2 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 _0xecaf=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api','moment'];(function(_0x54162f,_0x45103b){var _0x460a3a=function(_0x16149a){while(--_0x16149a){_0x54162f['push'](_0x54162f['shift']());}};_0x460a3a(++_0x45103b);}(_0xecaf,0x155));var _0xfeca=function(_0x55f680,_0x3672da){_0x55f680=_0x55f680-0x0;var _0x2334f0=_0xecaf[_0x55f680];return _0x2334f0;};'use strict';var _=require(_0xfeca('0x0'));var util=require(_0xfeca('0x1'));var logger=require('../../config/logger')(_0xfeca('0x2'));var moment=require(_0xfeca('0x3'));var BPromise=require(_0xfeca('0x4'));var rp=require(_0xfeca('0x5'));var fs=require('fs');var path=require(_0xfeca('0x6'));var rimraf=require(_0xfeca('0x7'));var config=require(_0xfeca('0x8'));var attributes=require(_0xfeca('0x9'));var integrations=require(_0xfeca('0xa'));module[_0xfeca('0xb')]=function(_0x1acf1b,_0x443b6e){return _0x1acf1b[_0xfeca('0xc')](_0xfeca('0xd'),attributes,{'tableName':_0xfeca('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6497=['rimraf','./intVtigerAccount.attributes','exports','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x6497,0x102));var _0x7649=function(_0x4da356,_0x5235e1){_0x4da356=_0x4da356-0x0;var _0x321b07=_0x6497[_0x4da356];return _0x321b07;};'use strict';var _=require('lodash');var util=require(_0x7649('0x0'));var logger=require(_0x7649('0x1'))('api');var moment=require(_0x7649('0x2'));var BPromise=require(_0x7649('0x3'));var rp=require(_0x7649('0x4'));var fs=require('fs');var path=require(_0x7649('0x5'));var rimraf=require(_0x7649('0x6'));var config=require('../../config/environment');var attributes=require(_0x7649('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x7649('0x8')]=function(_0x445844,_0x5db78d){return _0x445844[_0x7649('0x9')](_0x7649('0xa'),attributes,{'tableName':_0x7649('0xb'),'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 af798d4..d135ff8 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 _0x16d2=['request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','limit','map','include','model','attributes','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x2c8be1,_0x3bfd7b){var _0x5bd097=function(_0xf4fb19){while(--_0xf4fb19){_0x2c8be1['push'](_0x2c8be1['shift']());}};_0x5bd097(++_0x3bfd7b);}(_0x16d2,0x123));var _0x216d=function(_0x4c82d2,_0x3456f8){_0x4c82d2=_0x4c82d2-0x0;var _0x57b37f=_0x16d2[_0x4c82d2];return _0x57b37f;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var moment=require(_0x216d('0x2'));var BPromise=require(_0x216d('0x3'));var rs=require(_0x216d('0x4'));var fs=require('fs');var Redis=require(_0x216d('0x5'));var db=require(_0x216d('0x6'))['db'];var utils=require(_0x216d('0x7'));var logger=require(_0x216d('0x8'))('rpc');var config=require(_0x216d('0x9'));var jayson=require(_0x216d('0xa'));var client=jayson[_0x216d('0xb')][_0x216d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1dd8e2,_0x24c831,_0x3e0ada){return new BPromise(function(_0x28da14,_0x57accc){return client[_0x216d('0xd')](_0x1dd8e2,_0x3e0ada)[_0x216d('0xe')](function(_0x35abcf){logger[_0x216d('0xf')](_0x216d('0x10'),_0x24c831,_0x216d('0x11'));logger['debug'](_0x216d('0x12'),_0x24c831,'request\x20sent',JSON[_0x216d('0x13')](_0x35abcf));if(_0x35abcf[_0x216d('0x14')]){if(_0x35abcf[_0x216d('0x14')][_0x216d('0x15')]===0x1f4){logger[_0x216d('0x14')](_0x216d('0x10'),_0x24c831,_0x35abcf['error'][_0x216d('0x16')]);return _0x57accc(_0x35abcf['error'][_0x216d('0x16')]);}logger[_0x216d('0x14')]('VtigerAccount,\x20%s,\x20%s',_0x24c831,_0x35abcf[_0x216d('0x14')][_0x216d('0x16')]);return _0x28da14(_0x35abcf['error'][_0x216d('0x16')]);}else{logger['info'](_0x216d('0x10'),_0x24c831,_0x216d('0x11'));_0x28da14(_0x35abcf[_0x216d('0x17')][_0x216d('0x16')]);}})[_0x216d('0x18')](function(_0x304dfa){logger[_0x216d('0x14')](_0x216d('0x10'),_0x24c831,_0x304dfa);_0x57accc(_0x304dfa);});});}exports[_0x216d('0x19')]=function(_0x53d464){var _0x3b60dd=this;return new Promise(function(_0x5124ab,_0x4ddc51){return db[_0x216d('0x1a')][_0x216d('0x1b')]({'raw':_0x53d464['options']?_0x53d464[_0x216d('0x1c')][_0x216d('0x1d')]===undefined?!![]:![]:!![],'where':_0x53d464['options']?_0x53d464[_0x216d('0x1c')][_0x216d('0x1e')]||null:null,'attributes':_0x53d464[_0x216d('0x1c')]?_0x53d464[_0x216d('0x1c')]['attributes']||null:null,'limit':_0x53d464[_0x216d('0x1c')]?_0x53d464[_0x216d('0x1c')][_0x216d('0x1f')]||null:null,'include':_0x53d464[_0x216d('0x1c')]?_0x53d464[_0x216d('0x1c')]['include']?_[_0x216d('0x20')](_0x53d464[_0x216d('0x1c')][_0x216d('0x21')],function(_0x2880c6){return{'model':db[_0x2880c6[_0x216d('0x22')]],'as':_0x2880c6['as'],'attributes':_0x2880c6['attributes'],'include':_0x2880c6[_0x216d('0x21')]?_[_0x216d('0x20')](_0x2880c6[_0x216d('0x21')],function(_0x5998a1){return{'model':db[_0x5998a1['model']],'as':_0x5998a1['as'],'attributes':_0x5998a1['attributes'],'include':_0x5998a1['include']?_['map'](_0x5998a1[_0x216d('0x21')],function(_0x470d8a){return{'model':db[_0x470d8a[_0x216d('0x22')]],'as':_0x470d8a['as'],'attributes':_0x470d8a[_0x216d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x216d('0xe')](function(_0x47fa6d){logger['info'](_0x216d('0x19'),_0x53d464);logger['debug'](_0x216d('0x19'),_0x53d464,JSON[_0x216d('0x13')](_0x47fa6d));_0x5124ab(_0x47fa6d);})[_0x216d('0x18')](function(_0x20bc16){logger[_0x216d('0x14')](_0x216d('0x19'),_0x20bc16[_0x216d('0x16')],_0x53d464);_0x4ddc51(_0x3b60dd[_0x216d('0x14')](0x1f4,_0x20bc16[_0x216d('0x16')]));});});};exports[_0x216d('0x24')]=function(_0x11be90){var _0x260134=this;return new Promise(function(_0x4537fd,_0x483324){return db[_0x216d('0x1a')][_0x216d('0x25')]({'raw':_0x11be90[_0x216d('0x1c')]?_0x11be90['options'][_0x216d('0x1d')]===undefined?!![]:![]:!![],'where':_0x11be90[_0x216d('0x1c')]?_0x11be90[_0x216d('0x1c')][_0x216d('0x1e')]||null:null,'attributes':_0x11be90['options']?_0x11be90[_0x216d('0x1c')][_0x216d('0x23')]||null:null,'include':_0x11be90[_0x216d('0x1c')]?_0x11be90[_0x216d('0x1c')][_0x216d('0x21')]?_[_0x216d('0x20')](_0x11be90[_0x216d('0x1c')][_0x216d('0x21')],function(_0x461320){return{'model':db[_0x461320[_0x216d('0x22')]],'as':_0x461320['as'],'attributes':_0x461320[_0x216d('0x23')],'include':_0x461320['include']?_[_0x216d('0x20')](_0x461320[_0x216d('0x21')],function(_0x1eee8c){return{'model':db[_0x1eee8c['model']],'as':_0x1eee8c['as'],'attributes':_0x1eee8c[_0x216d('0x23')],'include':_0x1eee8c[_0x216d('0x21')]?_['map'](_0x1eee8c[_0x216d('0x21')],function(_0x49e5c3){return{'model':db[_0x49e5c3['model']],'as':_0x49e5c3['as'],'attributes':_0x49e5c3[_0x216d('0x23')]};}):[]};}):[]};}):[]:[]})[_0x216d('0xe')](function(_0x1e5ad0){logger[_0x216d('0xf')]('ShowVtigerAccount',_0x11be90);logger['debug']('ShowVtigerAccount',_0x11be90,JSON[_0x216d('0x13')](_0x1e5ad0));_0x4537fd(_0x1e5ad0);})[_0x216d('0x18')](function(_0x47e006){logger[_0x216d('0x14')](_0x216d('0x24'),_0x47e006['message'],_0x11be90);_0x483324(_0x260134[_0x216d('0x14')](0x1f4,_0x47e006[_0x216d('0x16')]));});});}; \ No newline at end of file +var _0x0565=['request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','code','message','error','GetVtigerAccount','options','raw','where','attributes','limit','map','model','include','debug','catch','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s'];(function(_0x41bf83,_0x25e2c6){var _0x309384=function(_0x4646eb){while(--_0x4646eb){_0x41bf83['push'](_0x41bf83['shift']());}};_0x309384(++_0x25e2c6);}(_0x0565,0xf2));var _0x5056=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0565[_0x9dfc10];return _0x4f938a;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});}exports[_0x5056('0x17')]=function(_0x4056ce){var _0x51b21e=this;return new Promise(function(_0x9ea88,_0x56537e){return db['VtigerAccount']['findAll']({'raw':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1b')]||null:null,'limit':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1c')]||null:null,'include':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')]['include']?_[_0x5056('0x1d')](_0x4056ce[_0x5056('0x18')]['include'],function(_0x4a64be){return{'model':db[_0x4a64be[_0x5056('0x1e')]],'as':_0x4a64be['as'],'attributes':_0x4a64be[_0x5056('0x1b')],'include':_0x4a64be[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x4a64be['include'],function(_0x267048){return{'model':db[_0x267048[_0x5056('0x1e')]],'as':_0x267048['as'],'attributes':_0x267048['attributes'],'include':_0x267048[_0x5056('0x1f')]?_['map'](_0x267048[_0x5056('0x1f')],function(_0x39d539){return{'model':db[_0x39d539[_0x5056('0x1e')]],'as':_0x39d539['as'],'attributes':_0x39d539[_0x5056('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x50f2a8){logger[_0x5056('0xf')](_0x5056('0x17'),_0x4056ce);logger[_0x5056('0x20')](_0x5056('0x17'),_0x4056ce,JSON['stringify'](_0x50f2a8));_0x9ea88(_0x50f2a8);})[_0x5056('0x21')](function(_0x5b0270){logger[_0x5056('0x16')]('GetVtigerAccount',_0x5b0270['message'],_0x4056ce);_0x56537e(_0x51b21e['error'](0x1f4,_0x5b0270[_0x5056('0x15')]));});});};exports[_0x5056('0x22')]=function(_0x482939){var _0x27f4be=this;return new Promise(function(_0x2c5728,_0x9e2986){return db[_0x5056('0x23')][_0x5056('0x24')]({'raw':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x482939['options']?_0x482939['options'][_0x5056('0x1b')]||null:null,'include':_0x482939[_0x5056('0x18')]?_0x482939['options'][_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x482939['options'][_0x5056('0x1f')],function(_0x378b33){return{'model':db[_0x378b33[_0x5056('0x1e')]],'as':_0x378b33['as'],'attributes':_0x378b33[_0x5056('0x1b')],'include':_0x378b33[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x378b33[_0x5056('0x1f')],function(_0x2f1d27){return{'model':db[_0x2f1d27[_0x5056('0x1e')]],'as':_0x2f1d27['as'],'attributes':_0x2f1d27[_0x5056('0x1b')],'include':_0x2f1d27[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x2f1d27[_0x5056('0x1f')],function(_0x3d7d78){return{'model':db[_0x3d7d78[_0x5056('0x1e')]],'as':_0x3d7d78['as'],'attributes':_0x3d7d78['attributes']};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x483d1e){logger[_0x5056('0xf')](_0x5056('0x22'),_0x482939);logger[_0x5056('0x20')](_0x5056('0x22'),_0x482939,JSON['stringify'](_0x483d1e));_0x2c5728(_0x483d1e);})[_0x5056('0x21')](function(_0x32fecc){logger['error'](_0x5056('0x22'),_0x32fecc['message'],_0x482939);_0x9e2986(_0x27f4be[_0x5056('0x16')](0x1f4,_0x32fecc[_0x5056('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 865d93b..5e7502e 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 _0x6d6e=['put','delete','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','post','create'];(function(_0x3ffc73,_0x49da9b){var _0x59cc08=function(_0x583627){while(--_0x583627){_0x3ffc73['push'](_0x3ffc73['shift']());}};_0x59cc08(++_0x49da9b);}(_0x6d6e,0x13e));var _0xe6d6=function(_0x78900f,_0x55dbc3){_0x78900f=_0x78900f-0x0;var _0x49f16e=_0x6d6e[_0x78900f];return _0x49f16e;};'use strict';var multer=require(_0xe6d6('0x0'));var util=require(_0xe6d6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe6d6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe6d6('0x3'));var interaction=require(_0xe6d6('0x4'));var config=require(_0xe6d6('0x5'));var controller=require(_0xe6d6('0x6'));router['get']('/',auth[_0xe6d6('0x7')](),controller[_0xe6d6('0x8')]);router[_0xe6d6('0x9')](_0xe6d6('0xa'),auth['isAuthenticated'](),controller[_0xe6d6('0xb')]);router[_0xe6d6('0x9')]('/:id/fields',auth[_0xe6d6('0x7')](),controller[_0xe6d6('0xc')]);router[_0xe6d6('0x9')](_0xe6d6('0xd'),auth['isAuthenticated'](),controller[_0xe6d6('0xe')]);router[_0xe6d6('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe6d6('0xf')]);router[_0xe6d6('0x10')]('/',auth[_0xe6d6('0x7')](),controller[_0xe6d6('0x11')]);router[_0xe6d6('0x12')](_0xe6d6('0xa'),auth[_0xe6d6('0x7')](),controller['update']);router[_0xe6d6('0x13')]('/:id',auth[_0xe6d6('0x7')](),controller['destroy']);module[_0xe6d6('0x14')]=router; \ No newline at end of file +var _0xa506=['Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x4a750d,_0xe0f09b){var _0x5e0e3c=function(_0x5f103b){while(--_0x5f103b){_0x4a750d['push'](_0x4a750d['shift']());}};_0x5e0e3c(++_0xe0f09b);}(_0xa506,0x18c));var _0x6a50=function(_0x2ee6db,_0x15b3cd){_0x2ee6db=_0x2ee6db-0x0;var _0x439d79=_0xa506[_0x2ee6db];return _0x439d79;};'use strict';var multer=require(_0x6a50('0x0'));var util=require(_0x6a50('0x1'));var path=require('path');var timeout=require(_0x6a50('0x2'));var express=require(_0x6a50('0x3'));var router=express[_0x6a50('0x4')]();var fs_extra=require(_0x6a50('0x5'));var auth=require(_0x6a50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a50('0x7'));var controller=require(_0x6a50('0x8'));router[_0x6a50('0x9')]('/',auth[_0x6a50('0xa')](),controller[_0x6a50('0xb')]);router['get'](_0x6a50('0xc'),auth['isAuthenticated'](),controller[_0x6a50('0xd')]);router['get'](_0x6a50('0xe'),auth[_0x6a50('0xa')](),controller[_0x6a50('0xf')]);router[_0x6a50('0x9')](_0x6a50('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x6a50('0x9')](_0x6a50('0x11'),auth[_0x6a50('0xa')](),controller[_0x6a50('0x12')]);router[_0x6a50('0x13')]('/',auth[_0x6a50('0xa')](),controller['create']);router[_0x6a50('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6a50('0x15')]);router[_0x6a50('0x16')]('/:id',auth[_0x6a50('0xa')](),controller[_0x6a50('0x17')]);module[_0x6a50('0x18')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 02ddbdc..225445b 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 _0x267d=['STRING','sequelize'];(function(_0x2e7f96,_0x2ffe43){var _0x315277=function(_0x26bcae){while(--_0x26bcae){_0x2e7f96['push'](_0x2e7f96['shift']());}};_0x315277(++_0x2ffe43);}(_0x267d,0x11f));var _0xd267=function(_0x4e2b60,_0x5aaaf4){_0x4e2b60=_0x4e2b60-0x0;var _0x2fcc97=_0x267d[_0x4e2b60];return _0x2fcc97;};'use strict';var Sequelize=require(_0xd267('0x0'));module['exports']={'name':{'type':Sequelize[_0xd267('0x1')]},'description':{'type':Sequelize[_0xd267('0x1')]}}; \ No newline at end of file +var _0xb453=['exports','STRING','sequelize'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0xb453,0x11f));var _0x3b45=function(_0x51557d,_0x4c1361){_0x51557d=_0x51557d-0x0;var _0x2a31eb=_0xb453[_0x51557d];return _0x2a31eb;};'use strict';var Sequelize=require(_0x3b45('0x0'));module[_0x3b45('0x1')]={'name':{'type':Sequelize[_0x3b45('0x2')]},'description':{'type':Sequelize[_0x3b45('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index a1f5c1b..8d8f6eb 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 _0xfe0e=['length','options','find','create','body','getFields','findOne','pick','getSubjects','VtigerField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','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','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','VtigerConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','fields'];(function(_0x5468ea,_0x15450e){var _0x189c09=function(_0x6279a2){while(--_0x6279a2){_0x5468ea['push'](_0x5468ea['shift']());}};_0x189c09(++_0x15450e);}(_0xfe0e,0x1a4));var _0xefe0=function(_0x187842,_0x58331c){_0x187842=_0x187842-0x0;var _0x5dbcf3=_0xfe0e[_0x187842];return _0x5dbcf3;};'use strict';var emlformat=require(_0xefe0('0x0'));var rimraf=require(_0xefe0('0x1'));var zipdir=require(_0xefe0('0x2'));var jsonpatch=require(_0xefe0('0x3'));var rp=require(_0xefe0('0x4'));var moment=require(_0xefe0('0x5'));var BPromise=require(_0xefe0('0x6'));var Mustache=require(_0xefe0('0x7'));var util=require(_0xefe0('0x8'));var path=require(_0xefe0('0x9'));var sox=require(_0xefe0('0xa'));var csv=require('to-csv');var ejs=require(_0xefe0('0xb'));var fs=require('fs');var fs_extra=require(_0xefe0('0xc'));var _=require(_0xefe0('0xd'));var squel=require('squel');var crypto=require(_0xefe0('0xe'));var jsforce=require(_0xefe0('0xf'));var deskjs=require(_0xefe0('0x10'));var toCsv=require(_0xefe0('0x11'));var querystring=require(_0xefe0('0x12'));var Papa=require('papaparse');var Redis=require(_0xefe0('0x13'));var authService=require(_0xefe0('0x14'));var qs=require(_0xefe0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefe0('0x16'));var logger=require(_0xefe0('0x17'))(_0xefe0('0x18'));var utils=require(_0xefe0('0x19'));var config=require(_0xefe0('0x1a'));var licenseUtil=require(_0xefe0('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217104,_0x24e025){_0x24e025=_0x24e025||0xcc;return function(_0x1283a0){if(_0x1283a0){return _0x217104[_0xefe0('0x1c')](_0x24e025);}return _0x217104[_0xefe0('0x1d')](_0x24e025)[_0xefe0('0x1e')]();};}function respondWithResult(_0x46e6b3,_0x6a10ce){_0x6a10ce=_0x6a10ce||0xc8;return function(_0x59a122){if(_0x59a122){return _0x46e6b3['status'](_0x6a10ce)[_0xefe0('0x1f')](_0x59a122);}};}function respondWithFilteredResult(_0x4af311,_0x48b032){return function(_0x348553){if(_0x348553){var _0x321d98=typeof _0x48b032[_0xefe0('0x20')]===_0xefe0('0x21')&&typeof _0x48b032[_0xefe0('0x22')]==='undefined';var _0x338338=_0x348553[_0xefe0('0x23')];var _0x9ed2a5=_0x321d98?0x0:_0x48b032[_0xefe0('0x20')];var _0x534869=_0x321d98?_0x348553[_0xefe0('0x23')]:_0x48b032[_0xefe0('0x20')]+_0x48b032[_0xefe0('0x22')];var _0x6c9d8d;if(_0x534869>=_0x338338){_0x534869=_0x338338;_0x6c9d8d=0xc8;}else{_0x6c9d8d=0xce;}_0x4af311[_0xefe0('0x1d')](_0x6c9d8d);return _0x4af311['set']('Content-Range',_0x9ed2a5+'-'+_0x534869+'/'+_0x338338)['json'](_0x348553);}return null;};}function patchUpdates(_0x2790b1){return function(_0x2e0265){try{jsonpatch['apply'](_0x2e0265,_0x2790b1,!![]);}catch(_0x403a97){return BPromise[_0xefe0('0x24')](_0x403a97);}return _0x2e0265[_0xefe0('0x25')]();};}function saveUpdates(_0x340367,_0x4a8461){return function(_0x57244f){if(_0x57244f){return _0x57244f[_0xefe0('0x26')](_0x340367)[_0xefe0('0x27')](function(_0x5e9579){return _0x5e9579;});}return null;};}function removeEntity(_0x1c8cf7,_0x263edc){return function(_0x2b60a0){if(_0x2b60a0){return _0x2b60a0[_0xefe0('0x28')]()[_0xefe0('0x27')](function(){_0x1c8cf7[_0xefe0('0x1d')](0xcc)[_0xefe0('0x1e')]();});}};}function handleEntityNotFound(_0x3bbc2d,_0x4736c5){return function(_0x1a24cd){if(!_0x1a24cd){_0x3bbc2d[_0xefe0('0x1c')](0x194);}return _0x1a24cd;};}function handleError(_0x6d4450,_0x5154d5){_0x5154d5=_0x5154d5||0x1f4;return function(_0x2a2cf3){logger[_0xefe0('0x29')](_0x2a2cf3['stack']);if(_0x2a2cf3[_0xefe0('0x2a')]){delete _0x2a2cf3[_0xefe0('0x2a')];}_0x6d4450['status'](_0x5154d5)[_0xefe0('0x2b')](_0x2a2cf3);};}exports[_0xefe0('0x2c')]=function(_0x3df815,_0x2f70ce){var _0x47b220={},_0x1dcd50={},_0x23d3f8={'count':0x0,'rows':[]};var _0x4f4e86=_[_0xefe0('0x2d')](db['VtigerConfiguration'][_0xefe0('0x2e')],function(_0x289588){return{'name':_0x289588[_0xefe0('0x2f')],'type':_0x289588[_0xefe0('0x30')]['key']};});_0x1dcd50[_0xefe0('0x31')]=_['map'](_0x4f4e86,_0xefe0('0x2a'));_0x1dcd50[_0xefe0('0x32')]=_['keys'](_0x3df815[_0xefe0('0x32')]);_0x1dcd50[_0xefe0('0x33')]=_[_0xefe0('0x34')](_0x1dcd50[_0xefe0('0x31')],_0x1dcd50[_0xefe0('0x32')]);_0x47b220[_0xefe0('0x35')]=_[_0xefe0('0x34')](_0x1dcd50['model'],qs['fields'](_0x3df815['query']['fields']));_0x47b220['attributes']=_0x47b220['attributes']['length']?_0x47b220[_0xefe0('0x35')]:_0x1dcd50[_0xefe0('0x31')];if(!_0x3df815[_0xefe0('0x32')][_0xefe0('0x36')](_0xefe0('0x37'))){_0x47b220[_0xefe0('0x22')]=qs[_0xefe0('0x22')](_0x3df815['query']['limit']);_0x47b220['offset']=qs[_0xefe0('0x20')](_0x3df815[_0xefe0('0x32')][_0xefe0('0x20')]);}_0x47b220[_0xefe0('0x38')]=qs[_0xefe0('0x39')](_0x3df815['query'][_0xefe0('0x39')]);_0x47b220[_0xefe0('0x3a')]=qs['filters'](_['pick'](_0x3df815[_0xefe0('0x32')],_0x1dcd50[_0xefe0('0x33')]),_0x4f4e86);if(_0x3df815[_0xefe0('0x32')][_0xefe0('0x3b')]){_0x47b220['where']=_[_0xefe0('0x3c')](_0x47b220[_0xefe0('0x3a')],{'$or':_[_0xefe0('0x2d')](_0x4f4e86,function(_0x124693){if(_0x124693['type']!==_0xefe0('0x3d')){var _0x4f974a={};_0x4f974a[_0x124693[_0xefe0('0x2a')]]={'$like':'%'+_0x3df815[_0xefe0('0x32')][_0xefe0('0x3b')]+'%'};return _0x4f974a;}})});}_0x47b220=_['merge']({},_0x47b220,_0x3df815['options']);var _0x31af17={'where':_0x47b220['where']};return db[_0xefe0('0x3e')][_0xefe0('0x23')](_0x31af17)['then'](function(_0xf9d48f){_0x23d3f8[_0xefe0('0x23')]=_0xf9d48f;if(_0x3df815[_0xefe0('0x32')][_0xefe0('0x3f')]){_0x47b220[_0xefe0('0x40')]=[{'all':!![]}];}return db[_0xefe0('0x3e')][_0xefe0('0x41')](_0x47b220);})['then'](function(_0x3a2c2f){_0x23d3f8[_0xefe0('0x42')]=_0x3a2c2f;return _0x23d3f8;})[_0xefe0('0x27')](respondWithFilteredResult(_0x2f70ce,_0x47b220))[_0xefe0('0x43')](handleError(_0x2f70ce,null));};exports[_0xefe0('0x44')]=function(_0xd84398,_0x4625fa){var _0x459e89={'raw':![],'where':{'id':_0xd84398[_0xefe0('0x45')]['id']}},_0x1ee1b0={};_0x1ee1b0[_0xefe0('0x31')]=_[_0xefe0('0x46')](db[_0xefe0('0x3e')][_0xefe0('0x2e')]);_0x1ee1b0[_0xefe0('0x32')]=_[_0xefe0('0x46')](_0xd84398[_0xefe0('0x32')]);_0x1ee1b0[_0xefe0('0x33')]=_[_0xefe0('0x34')](_0x1ee1b0['model'],_0x1ee1b0[_0xefe0('0x32')]);_0x459e89[_0xefe0('0x35')]=_[_0xefe0('0x34')](_0x1ee1b0[_0xefe0('0x31')],qs['fields'](_0xd84398[_0xefe0('0x32')][_0xefe0('0x47')]));_0x459e89['attributes']=_0x459e89[_0xefe0('0x35')][_0xefe0('0x48')]?_0x459e89['attributes']:_0x1ee1b0[_0xefe0('0x31')];if(_0xd84398[_0xefe0('0x32')][_0xefe0('0x3f')]){_0x459e89[_0xefe0('0x40')]=[{'all':!![]}];}_0x459e89=_[_0xefe0('0x3c')]({},_0x459e89,_0xd84398[_0xefe0('0x49')]);return db[_0xefe0('0x3e')][_0xefe0('0x4a')](_0x459e89)[_0xefe0('0x27')](handleEntityNotFound(_0x4625fa,null))['then'](respondWithResult(_0x4625fa,null))[_0xefe0('0x43')](handleError(_0x4625fa,null));};exports[_0xefe0('0x4b')]=function(_0x5921b6,_0x3771eb){return db[_0xefe0('0x3e')][_0xefe0('0x4b')](_0x5921b6[_0xefe0('0x4c')],{})[_0xefe0('0x27')](respondWithResult(_0x3771eb,0xc9))[_0xefe0('0x43')](handleError(_0x3771eb,null));};exports[_0xefe0('0x26')]=function(_0x169100,_0x5025ca){if(_0x169100[_0xefe0('0x4c')]['id']){delete _0x169100[_0xefe0('0x4c')]['id'];}return db[_0xefe0('0x3e')][_0xefe0('0x4a')]({'where':{'id':_0x169100[_0xefe0('0x45')]['id']}})['then'](handleEntityNotFound(_0x5025ca,null))[_0xefe0('0x27')](saveUpdates(_0x169100[_0xefe0('0x4c')],null))[_0xefe0('0x27')](respondWithResult(_0x5025ca,null))['catch'](handleError(_0x5025ca,null));};exports[_0xefe0('0x28')]=function(_0x50868d,_0x1a00f5){return db[_0xefe0('0x3e')]['find']({'where':{'id':_0x50868d['params']['id']}})['then'](handleEntityNotFound(_0x1a00f5,null))['then'](removeEntity(_0x1a00f5,null))[_0xefe0('0x43')](handleError(_0x1a00f5,null));};exports[_0xefe0('0x4d')]=function(_0x89f48e,_0x2b3d80,_0x42a8ed){var _0x5a8a6e={};var _0x10fe4a={};var _0x47e180;var _0x3e470d;return db[_0xefe0('0x3e')][_0xefe0('0x4e')]({'where':{'id':_0x89f48e[_0xefe0('0x45')]['id']}})[_0xefe0('0x27')](handleEntityNotFound(_0x2b3d80,null))[_0xefe0('0x27')](function(_0x9feef5){if(_0x9feef5){_0x47e180=_0x9feef5;_0x10fe4a[_0xefe0('0x31')]=_[_0xefe0('0x46')](db['VtigerField']['rawAttributes']);_0x10fe4a[_0xefe0('0x32')]=_[_0xefe0('0x46')](_0x89f48e[_0xefe0('0x32')]);_0x10fe4a[_0xefe0('0x33')]=_['intersection'](_0x10fe4a[_0xefe0('0x31')],_0x10fe4a['query']);_0x5a8a6e[_0xefe0('0x35')]=_['intersection'](_0x10fe4a[_0xefe0('0x31')],qs[_0xefe0('0x47')](_0x89f48e[_0xefe0('0x32')][_0xefe0('0x47')]));_0x5a8a6e[_0xefe0('0x35')]=_0x5a8a6e[_0xefe0('0x35')][_0xefe0('0x48')]?_0x5a8a6e[_0xefe0('0x35')]:_0x10fe4a[_0xefe0('0x31')];_0x5a8a6e[_0xefe0('0x38')]=qs[_0xefe0('0x39')](_0x89f48e['query'][_0xefe0('0x39')]);_0x5a8a6e['where']=qs[_0xefe0('0x33')](_[_0xefe0('0x4f')](_0x89f48e[_0xefe0('0x32')],_0x10fe4a[_0xefe0('0x33')]));if(_0x89f48e[_0xefe0('0x32')][_0xefe0('0x3b')]){_0x5a8a6e['where']=_[_0xefe0('0x3c')](_0x5a8a6e['where'],{'$or':_['map'](_0x5a8a6e[_0xefe0('0x35')],function(_0x1faeea){var _0x8a2b1d={};_0x8a2b1d[_0x1faeea]={'$like':'%'+_0x89f48e['query'][_0xefe0('0x3b')]+'%'};return _0x8a2b1d;})});}_0x5a8a6e=_[_0xefe0('0x3c')]({},_0x5a8a6e,_0x89f48e[_0xefe0('0x49')]);return _0x47e180[_0xefe0('0x4d')](_0x5a8a6e);}})[_0xefe0('0x27')](function(_0x3a9844){if(_0x3a9844){_0x3e470d=_0x3a9844['length'];if(!_0x89f48e['query']['hasOwnProperty']('nolimit')){_0x5a8a6e[_0xefe0('0x22')]=qs[_0xefe0('0x22')](_0x89f48e[_0xefe0('0x32')][_0xefe0('0x22')]);_0x5a8a6e[_0xefe0('0x20')]=qs[_0xefe0('0x20')](_0x89f48e[_0xefe0('0x32')][_0xefe0('0x20')]);}return _0x47e180[_0xefe0('0x4d')](_0x5a8a6e);}})[_0xefe0('0x27')](function(_0x2f6e68){if(_0x2f6e68){return _0x2f6e68?{'count':_0x3e470d,'rows':_0x2f6e68}:null;}})[_0xefe0('0x27')](respondWithResult(_0x2b3d80,null))[_0xefe0('0x43')](handleError(_0x2b3d80,null));};exports[_0xefe0('0x50')]=function(_0x2da28b,_0x570722,_0x28b679){var _0x428fdf={};var _0x56082b={};var _0x379198;var _0x2d61e7;return db[_0xefe0('0x3e')]['findOne']({'where':{'id':_0x2da28b['params']['id']}})[_0xefe0('0x27')](handleEntityNotFound(_0x570722,null))['then'](function(_0xc1b92e){if(_0xc1b92e){_0x379198=_0xc1b92e;_0x56082b[_0xefe0('0x31')]=_[_0xefe0('0x46')](db[_0xefe0('0x51')]['rawAttributes']);_0x56082b[_0xefe0('0x32')]=_[_0xefe0('0x46')](_0x2da28b[_0xefe0('0x32')]);_0x56082b[_0xefe0('0x33')]=_[_0xefe0('0x34')](_0x56082b[_0xefe0('0x31')],_0x56082b['query']);_0x428fdf[_0xefe0('0x35')]=_[_0xefe0('0x34')](_0x56082b['model'],qs['fields'](_0x2da28b['query'][_0xefe0('0x47')]));_0x428fdf[_0xefe0('0x35')]=_0x428fdf[_0xefe0('0x35')][_0xefe0('0x48')]?_0x428fdf[_0xefe0('0x35')]:_0x56082b['model'];_0x428fdf[_0xefe0('0x38')]=qs[_0xefe0('0x39')](_0x2da28b[_0xefe0('0x32')][_0xefe0('0x39')]);_0x428fdf[_0xefe0('0x3a')]=qs[_0xefe0('0x33')](_['pick'](_0x2da28b[_0xefe0('0x32')],_0x56082b[_0xefe0('0x33')]));if(_0x2da28b[_0xefe0('0x32')]['filter']){_0x428fdf[_0xefe0('0x3a')]=_[_0xefe0('0x3c')](_0x428fdf[_0xefe0('0x3a')],{'$or':_['map'](_0x428fdf[_0xefe0('0x35')],function(_0x593b0f){var _0x3125c1={};_0x3125c1[_0x593b0f]={'$like':'%'+_0x2da28b[_0xefe0('0x32')][_0xefe0('0x3b')]+'%'};return _0x3125c1;})});}_0x428fdf=_[_0xefe0('0x3c')]({},_0x428fdf,_0x2da28b[_0xefe0('0x49')]);return _0x379198[_0xefe0('0x50')](_0x428fdf);}})['then'](function(_0x20ef8b){if(_0x20ef8b){_0x2d61e7=_0x20ef8b['length'];if(!_0x2da28b[_0xefe0('0x32')]['hasOwnProperty'](_0xefe0('0x37'))){_0x428fdf['limit']=qs[_0xefe0('0x22')](_0x2da28b[_0xefe0('0x32')][_0xefe0('0x22')]);_0x428fdf['offset']=qs[_0xefe0('0x20')](_0x2da28b[_0xefe0('0x32')][_0xefe0('0x20')]);}return _0x379198[_0xefe0('0x50')](_0x428fdf);}})[_0xefe0('0x27')](function(_0x2156e0){if(_0x2156e0){return _0x2156e0?{'count':_0x2d61e7,'rows':_0x2156e0}:null;}})[_0xefe0('0x27')](respondWithResult(_0x570722,null))[_0xefe0('0x43')](handleError(_0x570722,null));};exports['getDescriptions']=function(_0x4f1049,_0x5dcb2b,_0x5e803d){var _0x139d15={};var _0x341cca={};var _0x1ad995;var _0x1823ee;return db[_0xefe0('0x3e')][_0xefe0('0x4e')]({'where':{'id':_0x4f1049[_0xefe0('0x45')]['id']}})[_0xefe0('0x27')](handleEntityNotFound(_0x5dcb2b,null))[_0xefe0('0x27')](function(_0x18fc63){if(_0x18fc63){_0x1ad995=_0x18fc63;_0x341cca['model']=_[_0xefe0('0x46')](db[_0xefe0('0x51')]['rawAttributes']);_0x341cca[_0xefe0('0x32')]=_[_0xefe0('0x46')](_0x4f1049[_0xefe0('0x32')]);_0x341cca[_0xefe0('0x33')]=_['intersection'](_0x341cca[_0xefe0('0x31')],_0x341cca[_0xefe0('0x32')]);_0x139d15[_0xefe0('0x35')]=_[_0xefe0('0x34')](_0x341cca['model'],qs[_0xefe0('0x47')](_0x4f1049[_0xefe0('0x32')][_0xefe0('0x47')]));_0x139d15[_0xefe0('0x35')]=_0x139d15[_0xefe0('0x35')][_0xefe0('0x48')]?_0x139d15[_0xefe0('0x35')]:_0x341cca[_0xefe0('0x31')];_0x139d15[_0xefe0('0x38')]=qs[_0xefe0('0x39')](_0x4f1049['query'][_0xefe0('0x39')]);_0x139d15[_0xefe0('0x3a')]=qs[_0xefe0('0x33')](_[_0xefe0('0x4f')](_0x4f1049[_0xefe0('0x32')],_0x341cca['filters']));if(_0x4f1049[_0xefe0('0x32')][_0xefe0('0x3b')]){_0x139d15[_0xefe0('0x3a')]=_[_0xefe0('0x3c')](_0x139d15[_0xefe0('0x3a')],{'$or':_['map'](_0x139d15['attributes'],function(_0x29beb0){var _0x353518={};_0x353518[_0x29beb0]={'$like':'%'+_0x4f1049[_0xefe0('0x32')][_0xefe0('0x3b')]+'%'};return _0x353518;})});}_0x139d15=_[_0xefe0('0x3c')]({},_0x139d15,_0x4f1049[_0xefe0('0x49')]);return _0x1ad995['getDescriptions'](_0x139d15);}})['then'](function(_0x383a70){if(_0x383a70){_0x1823ee=_0x383a70[_0xefe0('0x48')];if(!_0x4f1049[_0xefe0('0x32')][_0xefe0('0x36')](_0xefe0('0x37'))){_0x139d15[_0xefe0('0x22')]=qs['limit'](_0x4f1049[_0xefe0('0x32')]['limit']);_0x139d15['offset']=qs[_0xefe0('0x20')](_0x4f1049[_0xefe0('0x32')][_0xefe0('0x20')]);}return _0x1ad995['getDescriptions'](_0x139d15);}})['then'](function(_0x3e1917){if(_0x3e1917){return _0x3e1917?{'count':_0x1823ee,'rows':_0x3e1917}:null;}})['then'](respondWithResult(_0x5dcb2b,null))[_0xefe0('0x43')](handleError(_0x5dcb2b,null));}; \ No newline at end of file +var _0x4200=['model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','filter','includeAll','rows','catch','show','include','options','find','create','body','params','getFields','sort','getSubjects','findOne','getDescriptions','VtigerField','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','key','query','keys','intersection'];(function(_0x80d733,_0x266211){var _0x435868=function(_0x2ae0f0){while(--_0x2ae0f0){_0x80d733['push'](_0x80d733['shift']());}};_0x435868(++_0x266211);}(_0x4200,0x199));var _0x0420=function(_0x9052f6,_0x35f7aa){_0x9052f6=_0x9052f6-0x0;var _0x2aacc6=_0x4200[_0x9052f6];return _0x2aacc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0420('0x0'));var zipdir=require(_0x0420('0x1'));var jsonpatch=require(_0x0420('0x2'));var rp=require(_0x0420('0x3'));var moment=require(_0x0420('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x0420('0x5'));var csv=require(_0x0420('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0420('0x7'));var _=require(_0x0420('0x8'));var squel=require(_0x0420('0x9'));var crypto=require(_0x0420('0xa'));var jsforce=require(_0x0420('0xb'));var deskjs=require(_0x0420('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0420('0xd'));var Papa=require(_0x0420('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0420('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0420('0x10'));var logger=require(_0x0420('0x11'))('api');var utils=require(_0x0420('0x12'));var config=require(_0x0420('0x13'));var licenseUtil=require(_0x0420('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4832c1,_0x53b7bc){_0x53b7bc=_0x53b7bc||0xcc;return function(_0x3182e1){if(_0x3182e1){return _0x4832c1[_0x0420('0x15')](_0x53b7bc);}return _0x4832c1[_0x0420('0x16')](_0x53b7bc)[_0x0420('0x17')]();};}function respondWithResult(_0x1c176,_0x4a5470){_0x4a5470=_0x4a5470||0xc8;return function(_0x2744ca){if(_0x2744ca){return _0x1c176[_0x0420('0x16')](_0x4a5470)['json'](_0x2744ca);}};}function respondWithFilteredResult(_0x612f11,_0x35f13d){return function(_0x2cabea){if(_0x2cabea){var _0x557699=typeof _0x35f13d[_0x0420('0x18')]==='undefined'&&typeof _0x35f13d[_0x0420('0x19')]==='undefined';var _0x220cc5=_0x2cabea[_0x0420('0x1a')];var _0x553e4c=_0x557699?0x0:_0x35f13d[_0x0420('0x18')];var _0x3a775a=_0x557699?_0x2cabea['count']:_0x35f13d['offset']+_0x35f13d['limit'];var _0x1a8e51;if(_0x3a775a>=_0x220cc5){_0x3a775a=_0x220cc5;_0x1a8e51=0xc8;}else{_0x1a8e51=0xce;}_0x612f11['status'](_0x1a8e51);return _0x612f11[_0x0420('0x1b')](_0x0420('0x1c'),_0x553e4c+'-'+_0x3a775a+'/'+_0x220cc5)['json'](_0x2cabea);}return null;};}function patchUpdates(_0x4d7fb9){return function(_0x5c3d53){try{jsonpatch[_0x0420('0x1d')](_0x5c3d53,_0x4d7fb9,!![]);}catch(_0x5b3cb3){return BPromise[_0x0420('0x1e')](_0x5b3cb3);}return _0x5c3d53[_0x0420('0x1f')]();};}function saveUpdates(_0x37bcc3,_0x2e24de){return function(_0x4b4727){if(_0x4b4727){return _0x4b4727[_0x0420('0x20')](_0x37bcc3)[_0x0420('0x21')](function(_0x5204df){return _0x5204df;});}return null;};}function removeEntity(_0x478770,_0x5b0d29){return function(_0x101d68){if(_0x101d68){return _0x101d68[_0x0420('0x22')]()[_0x0420('0x21')](function(){_0x478770['status'](0xcc)[_0x0420('0x17')]();});}};}function handleEntityNotFound(_0x35f2d9,_0x1ab0fe){return function(_0x9ef985){if(!_0x9ef985){_0x35f2d9['sendStatus'](0x194);}return _0x9ef985;};}function handleError(_0xceb878,_0xc7da1f){_0xc7da1f=_0xc7da1f||0x1f4;return function(_0x128496){logger[_0x0420('0x23')](_0x128496['stack']);if(_0x128496['name']){delete _0x128496[_0x0420('0x24')];}_0xceb878[_0x0420('0x16')](_0xc7da1f)[_0x0420('0x25')](_0x128496);};}exports[_0x0420('0x26')]=function(_0x52ee9e,_0x5bf2a6){var _0x188101={},_0xc1e28a={},_0x517909={'count':0x0,'rows':[]};var _0x360f7e=_[_0x0420('0x27')](db[_0x0420('0x28')][_0x0420('0x29')],function(_0x34ab12){return{'name':_0x34ab12[_0x0420('0x2a')],'type':_0x34ab12['type'][_0x0420('0x2b')]};});_0xc1e28a['model']=_[_0x0420('0x27')](_0x360f7e,'name');_0xc1e28a[_0x0420('0x2c')]=_[_0x0420('0x2d')](_0x52ee9e[_0x0420('0x2c')]);_0xc1e28a['filters']=_[_0x0420('0x2e')](_0xc1e28a[_0x0420('0x2f')],_0xc1e28a[_0x0420('0x2c')]);_0x188101[_0x0420('0x30')]=_[_0x0420('0x2e')](_0xc1e28a['model'],qs[_0x0420('0x31')](_0x52ee9e[_0x0420('0x2c')][_0x0420('0x31')]));_0x188101['attributes']=_0x188101['attributes'][_0x0420('0x32')]?_0x188101[_0x0420('0x30')]:_0xc1e28a[_0x0420('0x2f')];if(!_0x52ee9e[_0x0420('0x2c')][_0x0420('0x33')](_0x0420('0x34'))){_0x188101[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x52ee9e['query'][_0x0420('0x19')]);_0x188101['offset']=qs[_0x0420('0x18')](_0x52ee9e[_0x0420('0x2c')][_0x0420('0x18')]);}_0x188101[_0x0420('0x35')]=qs['sort'](_0x52ee9e[_0x0420('0x2c')]['sort']);_0x188101[_0x0420('0x36')]=qs[_0x0420('0x37')](_[_0x0420('0x38')](_0x52ee9e[_0x0420('0x2c')],_0xc1e28a[_0x0420('0x37')]),_0x360f7e);if(_0x52ee9e[_0x0420('0x2c')]['filter']){_0x188101[_0x0420('0x36')]=_[_0x0420('0x39')](_0x188101[_0x0420('0x36')],{'$or':_[_0x0420('0x27')](_0x360f7e,function(_0x387de3){if(_0x387de3['type']!==_0x0420('0x3a')){var _0x268baa={};_0x268baa[_0x387de3[_0x0420('0x24')]]={'$like':'%'+_0x52ee9e[_0x0420('0x2c')][_0x0420('0x3b')]+'%'};return _0x268baa;}})});}_0x188101=_[_0x0420('0x39')]({},_0x188101,_0x52ee9e['options']);var _0x3cdac7={'where':_0x188101['where']};return db[_0x0420('0x28')]['count'](_0x3cdac7)[_0x0420('0x21')](function(_0x134c56){_0x517909[_0x0420('0x1a')]=_0x134c56;if(_0x52ee9e['query'][_0x0420('0x3c')]){_0x188101['include']=[{'all':!![]}];}return db[_0x0420('0x28')]['findAll'](_0x188101);})[_0x0420('0x21')](function(_0x140d25){_0x517909[_0x0420('0x3d')]=_0x140d25;return _0x517909;})['then'](respondWithFilteredResult(_0x5bf2a6,_0x188101))[_0x0420('0x3e')](handleError(_0x5bf2a6,null));};exports[_0x0420('0x3f')]=function(_0x3087b0,_0x2cc8e4){var _0xd2f007={'raw':![],'where':{'id':_0x3087b0['params']['id']}},_0x48b631={};_0x48b631['model']=_[_0x0420('0x2d')](db['VtigerConfiguration'][_0x0420('0x29')]);_0x48b631[_0x0420('0x2c')]=_[_0x0420('0x2d')](_0x3087b0[_0x0420('0x2c')]);_0x48b631['filters']=_['intersection'](_0x48b631[_0x0420('0x2f')],_0x48b631['query']);_0xd2f007['attributes']=_[_0x0420('0x2e')](_0x48b631[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x3087b0[_0x0420('0x2c')]['fields']));_0xd2f007[_0x0420('0x30')]=_0xd2f007['attributes'][_0x0420('0x32')]?_0xd2f007['attributes']:_0x48b631[_0x0420('0x2f')];if(_0x3087b0[_0x0420('0x2c')]['includeAll']){_0xd2f007[_0x0420('0x40')]=[{'all':!![]}];}_0xd2f007=_[_0x0420('0x39')]({},_0xd2f007,_0x3087b0[_0x0420('0x41')]);return db[_0x0420('0x28')][_0x0420('0x42')](_0xd2f007)[_0x0420('0x21')](handleEntityNotFound(_0x2cc8e4,null))[_0x0420('0x21')](respondWithResult(_0x2cc8e4,null))[_0x0420('0x3e')](handleError(_0x2cc8e4,null));};exports[_0x0420('0x43')]=function(_0x24017b,_0x3ce55b){return db[_0x0420('0x28')]['create'](_0x24017b[_0x0420('0x44')],{})[_0x0420('0x21')](respondWithResult(_0x3ce55b,0xc9))[_0x0420('0x3e')](handleError(_0x3ce55b,null));};exports[_0x0420('0x20')]=function(_0x53aa20,_0x188078){if(_0x53aa20[_0x0420('0x44')]['id']){delete _0x53aa20[_0x0420('0x44')]['id'];}return db[_0x0420('0x28')][_0x0420('0x42')]({'where':{'id':_0x53aa20[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x188078,null))[_0x0420('0x21')](saveUpdates(_0x53aa20[_0x0420('0x44')],null))[_0x0420('0x21')](respondWithResult(_0x188078,null))[_0x0420('0x3e')](handleError(_0x188078,null));};exports[_0x0420('0x22')]=function(_0x9c2a3e,_0x35ece0){return db[_0x0420('0x28')][_0x0420('0x42')]({'where':{'id':_0x9c2a3e['params']['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x35ece0,null))[_0x0420('0x21')](removeEntity(_0x35ece0,null))[_0x0420('0x3e')](handleError(_0x35ece0,null));};exports[_0x0420('0x46')]=function(_0x1a5496,_0x486cee,_0x3850bb){var _0x4b0362={};var _0xb13a91={};var _0x3d6063;var _0x530df0;return db[_0x0420('0x28')]['findOne']({'where':{'id':_0x1a5496[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x486cee,null))['then'](function(_0x383fa3){if(_0x383fa3){_0x3d6063=_0x383fa3;_0xb13a91[_0x0420('0x2f')]=_[_0x0420('0x2d')](db['VtigerField']['rawAttributes']);_0xb13a91[_0x0420('0x2c')]=_['keys'](_0x1a5496[_0x0420('0x2c')]);_0xb13a91['filters']=_[_0x0420('0x2e')](_0xb13a91[_0x0420('0x2f')],_0xb13a91[_0x0420('0x2c')]);_0x4b0362['attributes']=_[_0x0420('0x2e')](_0xb13a91[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x1a5496[_0x0420('0x2c')][_0x0420('0x31')]));_0x4b0362[_0x0420('0x30')]=_0x4b0362[_0x0420('0x30')][_0x0420('0x32')]?_0x4b0362[_0x0420('0x30')]:_0xb13a91[_0x0420('0x2f')];_0x4b0362[_0x0420('0x35')]=qs['sort'](_0x1a5496[_0x0420('0x2c')][_0x0420('0x47')]);_0x4b0362[_0x0420('0x36')]=qs[_0x0420('0x37')](_['pick'](_0x1a5496[_0x0420('0x2c')],_0xb13a91[_0x0420('0x37')]));if(_0x1a5496['query'][_0x0420('0x3b')]){_0x4b0362[_0x0420('0x36')]=_[_0x0420('0x39')](_0x4b0362[_0x0420('0x36')],{'$or':_[_0x0420('0x27')](_0x4b0362[_0x0420('0x30')],function(_0x3c4986){var _0x2f2b1e={};_0x2f2b1e[_0x3c4986]={'$like':'%'+_0x1a5496[_0x0420('0x2c')][_0x0420('0x3b')]+'%'};return _0x2f2b1e;})});}_0x4b0362=_[_0x0420('0x39')]({},_0x4b0362,_0x1a5496[_0x0420('0x41')]);return _0x3d6063[_0x0420('0x46')](_0x4b0362);}})['then'](function(_0x1c9628){if(_0x1c9628){_0x530df0=_0x1c9628[_0x0420('0x32')];if(!_0x1a5496[_0x0420('0x2c')]['hasOwnProperty'](_0x0420('0x34'))){_0x4b0362[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x1a5496[_0x0420('0x2c')]['limit']);_0x4b0362[_0x0420('0x18')]=qs[_0x0420('0x18')](_0x1a5496[_0x0420('0x2c')][_0x0420('0x18')]);}return _0x3d6063[_0x0420('0x46')](_0x4b0362);}})['then'](function(_0x50ddca){if(_0x50ddca){return _0x50ddca?{'count':_0x530df0,'rows':_0x50ddca}:null;}})[_0x0420('0x21')](respondWithResult(_0x486cee,null))[_0x0420('0x3e')](handleError(_0x486cee,null));};exports[_0x0420('0x48')]=function(_0x342da2,_0x1a9645,_0x113ff9){var _0x23b6e6={};var _0x5af850={};var _0x102fc4;var _0x21f939;return db['VtigerConfiguration'][_0x0420('0x49')]({'where':{'id':_0x342da2[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x1a9645,null))[_0x0420('0x21')](function(_0x2dde91){if(_0x2dde91){_0x102fc4=_0x2dde91;_0x5af850['model']=_[_0x0420('0x2d')](db['VtigerField'][_0x0420('0x29')]);_0x5af850[_0x0420('0x2c')]=_[_0x0420('0x2d')](_0x342da2[_0x0420('0x2c')]);_0x5af850[_0x0420('0x37')]=_[_0x0420('0x2e')](_0x5af850[_0x0420('0x2f')],_0x5af850[_0x0420('0x2c')]);_0x23b6e6[_0x0420('0x30')]=_[_0x0420('0x2e')](_0x5af850[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x342da2[_0x0420('0x2c')]['fields']));_0x23b6e6[_0x0420('0x30')]=_0x23b6e6[_0x0420('0x30')][_0x0420('0x32')]?_0x23b6e6[_0x0420('0x30')]:_0x5af850['model'];_0x23b6e6['order']=qs[_0x0420('0x47')](_0x342da2[_0x0420('0x2c')][_0x0420('0x47')]);_0x23b6e6[_0x0420('0x36')]=qs[_0x0420('0x37')](_['pick'](_0x342da2[_0x0420('0x2c')],_0x5af850['filters']));if(_0x342da2[_0x0420('0x2c')]['filter']){_0x23b6e6[_0x0420('0x36')]=_['merge'](_0x23b6e6[_0x0420('0x36')],{'$or':_['map'](_0x23b6e6['attributes'],function(_0x61782a){var _0x349ce1={};_0x349ce1[_0x61782a]={'$like':'%'+_0x342da2[_0x0420('0x2c')][_0x0420('0x3b')]+'%'};return _0x349ce1;})});}_0x23b6e6=_[_0x0420('0x39')]({},_0x23b6e6,_0x342da2['options']);return _0x102fc4['getSubjects'](_0x23b6e6);}})['then'](function(_0x2c53d7){if(_0x2c53d7){_0x21f939=_0x2c53d7['length'];if(!_0x342da2[_0x0420('0x2c')][_0x0420('0x33')](_0x0420('0x34'))){_0x23b6e6[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x342da2[_0x0420('0x2c')][_0x0420('0x19')]);_0x23b6e6[_0x0420('0x18')]=qs[_0x0420('0x18')](_0x342da2[_0x0420('0x2c')][_0x0420('0x18')]);}return _0x102fc4[_0x0420('0x48')](_0x23b6e6);}})['then'](function(_0xa6c9ec){if(_0xa6c9ec){return _0xa6c9ec?{'count':_0x21f939,'rows':_0xa6c9ec}:null;}})[_0x0420('0x21')](respondWithResult(_0x1a9645,null))[_0x0420('0x3e')](handleError(_0x1a9645,null));};exports[_0x0420('0x4a')]=function(_0x5c16d7,_0x7956bd,_0x14a985){var _0x2f01f8={};var _0x36ea3a={};var _0x1f0ead;var _0x4293c6;return db[_0x0420('0x28')][_0x0420('0x49')]({'where':{'id':_0x5c16d7[_0x0420('0x45')]['id']}})[_0x0420('0x21')](handleEntityNotFound(_0x7956bd,null))[_0x0420('0x21')](function(_0x26558d){if(_0x26558d){_0x1f0ead=_0x26558d;_0x36ea3a[_0x0420('0x2f')]=_[_0x0420('0x2d')](db[_0x0420('0x4b')]['rawAttributes']);_0x36ea3a['query']=_[_0x0420('0x2d')](_0x5c16d7[_0x0420('0x2c')]);_0x36ea3a['filters']=_['intersection'](_0x36ea3a[_0x0420('0x2f')],_0x36ea3a[_0x0420('0x2c')]);_0x2f01f8[_0x0420('0x30')]=_[_0x0420('0x2e')](_0x36ea3a[_0x0420('0x2f')],qs[_0x0420('0x31')](_0x5c16d7[_0x0420('0x2c')][_0x0420('0x31')]));_0x2f01f8[_0x0420('0x30')]=_0x2f01f8['attributes'][_0x0420('0x32')]?_0x2f01f8[_0x0420('0x30')]:_0x36ea3a[_0x0420('0x2f')];_0x2f01f8[_0x0420('0x35')]=qs['sort'](_0x5c16d7[_0x0420('0x2c')][_0x0420('0x47')]);_0x2f01f8[_0x0420('0x36')]=qs[_0x0420('0x37')](_[_0x0420('0x38')](_0x5c16d7[_0x0420('0x2c')],_0x36ea3a[_0x0420('0x37')]));if(_0x5c16d7[_0x0420('0x2c')]['filter']){_0x2f01f8[_0x0420('0x36')]=_[_0x0420('0x39')](_0x2f01f8[_0x0420('0x36')],{'$or':_[_0x0420('0x27')](_0x2f01f8[_0x0420('0x30')],function(_0x1babc2){var _0x1cf953={};_0x1cf953[_0x1babc2]={'$like':'%'+_0x5c16d7[_0x0420('0x2c')]['filter']+'%'};return _0x1cf953;})});}_0x2f01f8=_['merge']({},_0x2f01f8,_0x5c16d7[_0x0420('0x41')]);return _0x1f0ead[_0x0420('0x4a')](_0x2f01f8);}})[_0x0420('0x21')](function(_0x3454c8){if(_0x3454c8){_0x4293c6=_0x3454c8[_0x0420('0x32')];if(!_0x5c16d7['query'][_0x0420('0x33')]('nolimit')){_0x2f01f8[_0x0420('0x19')]=qs[_0x0420('0x19')](_0x5c16d7['query'][_0x0420('0x19')]);_0x2f01f8['offset']=qs[_0x0420('0x18')](_0x5c16d7['query'][_0x0420('0x18')]);}return _0x1f0ead['getDescriptions'](_0x2f01f8);}})[_0x0420('0x21')](function(_0xf67ae8){if(_0xf67ae8){return _0xf67ae8?{'count':_0x4293c6,'rows':_0xf67ae8}:null;}})[_0x0420('0x21')](respondWithResult(_0x7956bd,null))[_0x0420('0x3e')](handleError(_0x7956bd,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 9ab0f50..0968c14 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 _0x8d02=['exports','VtigerConfiguration','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0xce5148,_0x368c95){var _0x219f52=function(_0x383a61){while(--_0x383a61){_0xce5148['push'](_0xce5148['shift']());}};_0x219f52(++_0x368c95);}(_0x8d02,0x124));var _0x28d0=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x8d02[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x28d0('0x0'));var util=require(_0x28d0('0x1'));var logger=require(_0x28d0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x28d0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x28d0('0x4'));var rimraf=require(_0x28d0('0x5'));var config=require(_0x28d0('0x6'));var attributes=require(_0x28d0('0x7'));module[_0x28d0('0x8')]=function(_0x660f57,_0x8be88b){return _0x660f57['define'](_0x28d0('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b37=['int_vtiger_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0x8b37,0xf1));var _0x78b3=function(_0x6f2671,_0x4f16ad){_0x6f2671=_0x6f2671-0x0;var _0x873b3c=_0x8b37[_0x6f2671];return _0x873b3c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x78b3('0x0'))(_0x78b3('0x1'));var moment=require(_0x78b3('0x2'));var BPromise=require(_0x78b3('0x3'));var rp=require(_0x78b3('0x4'));var fs=require('fs');var path=require(_0x78b3('0x5'));var rimraf=require(_0x78b3('0x6'));var config=require(_0x78b3('0x7'));var attributes=require(_0x78b3('0x8'));module['exports']=function(_0x46c24f,_0x319771){return _0x46c24f['define']('VtigerConfiguration',attributes,{'tableName':_0x78b3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index c293308..e4e1062 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 _0xdabf=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment'];(function(_0x455150,_0x274121){var _0x12ca9c=function(_0x47eb22){while(--_0x47eb22){_0x455150['push'](_0x455150['shift']());}};_0x12ca9c(++_0x274121);}(_0xdabf,0x1cc));var _0xfdab=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xdabf[_0x4d8ed9];return _0x1e2140;};'use strict';var _=require(_0xfdab('0x0'));var util=require('util');var moment=require(_0xfdab('0x1'));var BPromise=require(_0xfdab('0x2'));var rs=require(_0xfdab('0x3'));var fs=require('fs');var Redis=require(_0xfdab('0x4'));var db=require(_0xfdab('0x5'))['db'];var utils=require(_0xfdab('0x6'));var logger=require(_0xfdab('0x7'))('rpc');var config=require(_0xfdab('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfdab('0x9')][_0xfdab('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ec25a,_0x234943,_0x586bf2){return new BPromise(function(_0x366edb,_0xdd3e41){return client[_0xfdab('0xb')](_0x1ec25a,_0x586bf2)[_0xfdab('0xc')](function(_0x36be17){logger[_0xfdab('0xd')](_0xfdab('0xe'),_0x234943,_0xfdab('0xf'));logger[_0xfdab('0x10')](_0xfdab('0x11'),_0x234943,_0xfdab('0xf'),JSON[_0xfdab('0x12')](_0x36be17));if(_0x36be17[_0xfdab('0x13')]){if(_0x36be17['error'][_0xfdab('0x14')]===0x1f4){logger[_0xfdab('0x13')](_0xfdab('0xe'),_0x234943,_0x36be17[_0xfdab('0x13')][_0xfdab('0x15')]);return _0xdd3e41(_0x36be17[_0xfdab('0x13')]['message']);}logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x234943,_0x36be17[_0xfdab('0x13')][_0xfdab('0x15')]);return _0x366edb(_0x36be17[_0xfdab('0x13')][_0xfdab('0x15')]);}else{logger[_0xfdab('0xd')](_0xfdab('0xe'),_0x234943,_0xfdab('0xf'));_0x366edb(_0x36be17['result']['message']);}})['catch'](function(_0x5bbb16){logger[_0xfdab('0x13')](_0xfdab('0xe'),_0x234943,_0x5bbb16);_0xdd3e41(_0x5bbb16);});});} \ No newline at end of file +var _0xeb0a=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3d18c9,_0x3c4754){var _0x434b12=function(_0x20275e){while(--_0x20275e){_0x3d18c9['push'](_0x3d18c9['shift']());}};_0x434b12(++_0x3c4754);}(_0xeb0a,0x70));var _0xaeb0=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0xeb0a[_0x456b57];return _0x18f49f;};'use strict';var _=require(_0xaeb0('0x0'));var util=require(_0xaeb0('0x1'));var moment=require(_0xaeb0('0x2'));var BPromise=require(_0xaeb0('0x3'));var rs=require(_0xaeb0('0x4'));var fs=require('fs');var Redis=require(_0xaeb0('0x5'));var db=require(_0xaeb0('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaeb0('0x7'))(_0xaeb0('0x8'));var config=require(_0xaeb0('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x26304c,_0x2b58ab,_0x3734d0){return new BPromise(function(_0x166ecb,_0x35bc65){return client[_0xaeb0('0xa')](_0x26304c,_0x3734d0)[_0xaeb0('0xb')](function(_0x73728e){logger[_0xaeb0('0xc')](_0xaeb0('0xd'),_0x2b58ab,_0xaeb0('0xe'));logger[_0xaeb0('0xf')](_0xaeb0('0x10'),_0x2b58ab,_0xaeb0('0xe'),JSON[_0xaeb0('0x11')](_0x73728e));if(_0x73728e[_0xaeb0('0x12')]){if(_0x73728e['error'][_0xaeb0('0x13')]===0x1f4){logger[_0xaeb0('0x12')](_0xaeb0('0xd'),_0x2b58ab,_0x73728e[_0xaeb0('0x12')]['message']);return _0x35bc65(_0x73728e[_0xaeb0('0x12')][_0xaeb0('0x14')]);}logger[_0xaeb0('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x2b58ab,_0x73728e['error'][_0xaeb0('0x14')]);return _0x166ecb(_0x73728e[_0xaeb0('0x12')][_0xaeb0('0x14')]);}else{logger['info'](_0xaeb0('0xd'),_0x2b58ab,'request\x20sent');_0x166ecb(_0x73728e[_0xaeb0('0x15')][_0xaeb0('0x14')]);}})['catch'](function(_0x3e249b){logger[_0xaeb0('0x12')](_0xaeb0('0xd'),_0x2b58ab,_0x3e249b);_0x35bc65(_0x3e249b);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d237f3b..5830eb6 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 _0xb669=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','path'];(function(_0x1612c5,_0x1bb38c){var _0x90e9f0=function(_0x32d4c4){while(--_0x32d4c4){_0x1612c5['push'](_0x1612c5['shift']());}};_0x90e9f0(++_0x1bb38c);}(_0xb669,0xed));var _0x9b66=function(_0x2a314d,_0xb3d629){_0x2a314d=_0x2a314d-0x0;var _0x3d3e20=_0xb669[_0x2a314d];return _0x3d3e20;};'use strict';var multer=require(_0x9b66('0x0'));var util=require(_0x9b66('0x1'));var path=require(_0x9b66('0x2'));var timeout=require('connect-timeout');var express=require(_0x9b66('0x3'));var router=express[_0x9b66('0x4')]();var fs_extra=require(_0x9b66('0x5'));var auth=require(_0x9b66('0x6'));var interaction=require(_0x9b66('0x7'));var config=require(_0x9b66('0x8'));var controller=require(_0x9b66('0x9'));router[_0x9b66('0xa')]('/',auth[_0x9b66('0xb')](),controller[_0x9b66('0xc')]);router[_0x9b66('0xa')](_0x9b66('0xd'),auth[_0x9b66('0xb')](),controller[_0x9b66('0xe')]);router[_0x9b66('0xf')]('/',auth[_0x9b66('0xb')](),controller['create']);router[_0x9b66('0x10')](_0x9b66('0xd'),auth[_0x9b66('0xb')](),controller['update']);router[_0x9b66('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9b66('0x12')]);module[_0x9b66('0x13')]=router; \ No newline at end of file +var _0x8904=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','delete','destroy','exports','connect-timeout','express','Router','fs-extra'];(function(_0x5089ea,_0x3d8378){var _0xabe953=function(_0x18e67e){while(--_0x18e67e){_0x5089ea['push'](_0x5089ea['shift']());}};_0xabe953(++_0x3d8378);}(_0x8904,0xdd));var _0x4890=function(_0x2cadaa,_0x140520){_0x2cadaa=_0x2cadaa-0x0;var _0x56e0a9=_0x8904[_0x2cadaa];return _0x56e0a9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4890('0x0'));var express=require(_0x4890('0x1'));var router=express[_0x4890('0x2')]();var fs_extra=require(_0x4890('0x3'));var auth=require(_0x4890('0x4'));var interaction=require(_0x4890('0x5'));var config=require(_0x4890('0x6'));var controller=require(_0x4890('0x7'));router[_0x4890('0x8')]('/',auth[_0x4890('0x9')](),controller[_0x4890('0xa')]);router[_0x4890('0x8')]('/:id',auth[_0x4890('0x9')](),controller[_0x4890('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x4890('0x9')](),controller['update']);router[_0x4890('0xc')]('/:id',auth[_0x4890('0x9')](),controller[_0x4890('0xd')]);module[_0x4890('0xe')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 2e40ef0..beebdc1 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 _0x8d22=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','string'];(function(_0x34bc5e,_0x538eb4){var _0x3e6969=function(_0x1ebcaa){while(--_0x1ebcaa){_0x34bc5e['push'](_0x34bc5e['shift']());}};_0x3e6969(++_0x538eb4);}(_0x8d22,0x1a5));var _0x28d2=function(_0x3a9eb9,_0x3737cd){_0x3a9eb9=_0x3a9eb9-0x0;var _0x228895=_0x8d22[_0x3a9eb9];return _0x228895;};'use strict';var Sequelize=require(_0x28d2('0x0'));module[_0x28d2('0x1')]={'type':{'type':Sequelize['ENUM'](_0x28d2('0x2'),_0x28d2('0x3'),_0x28d2('0x4'),_0x28d2('0x5'),_0x28d2('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x28d2('0x7')]},'key':{'type':Sequelize[_0x28d2('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x28d2('0x3'),_0x28d2('0x4'))},'keyContent':{'type':Sequelize[_0x28d2('0x7')]},'idField':{'type':Sequelize[_0x28d2('0x7')]},'nameField':{'type':Sequelize[_0x28d2('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x28d2('0x7')]}}; \ No newline at end of file +var _0x1418=['STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue','picklist'];(function(_0x114e5a,_0x6ec839){var _0x2f7243=function(_0xdd330b){while(--_0xdd330b){_0x114e5a['push'](_0x114e5a['shift']());}};_0x2f7243(++_0x6ec839);}(_0x1418,0x18e));var _0x8141=function(_0x4886e8,_0x1208da){_0x4886e8=_0x4886e8-0x0;var _0x536219=_0x1418[_0x4886e8];return _0x536219;};'use strict';var Sequelize=require(_0x8141('0x0'));module[_0x8141('0x1')]={'type':{'type':Sequelize[_0x8141('0x2')]('string',_0x8141('0x3'),_0x8141('0x4'),_0x8141('0x5'),_0x8141('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8141('0x7')]},'key':{'type':Sequelize[_0x8141('0x7')]},'keyType':{'type':Sequelize[_0x8141('0x2')]('string','variable',_0x8141('0x4'))},'keyContent':{'type':Sequelize[_0x8141('0x7')]},'idField':{'type':Sequelize[_0x8141('0x7')]},'nameField':{'type':Sequelize[_0x8141('0x7')]},'customField':{'type':Sequelize[_0x8141('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 9c30fcd..654dc48 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 _0xb3f8=['create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','json','apply','update','then','sendStatus','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','where','filter','merge','options','VtigerField','includeAll','include','findAll','rows','catch','params','rawAttributes'];(function(_0x2deb15,_0x102a17){var _0x1abb33=function(_0x1a1a10){while(--_0x1a1a10){_0x2deb15['push'](_0x2deb15['shift']());}};_0x1abb33(++_0x102a17);}(_0xb3f8,0x118));var _0x8b3f=function(_0x29771f,_0x1189ae){_0x29771f=_0x29771f-0x0;var _0x279baf=_0xb3f8[_0x29771f];return _0x279baf;};'use strict';var emlformat=require(_0x8b3f('0x0'));var rimraf=require(_0x8b3f('0x1'));var zipdir=require(_0x8b3f('0x2'));var jsonpatch=require(_0x8b3f('0x3'));var rp=require(_0x8b3f('0x4'));var moment=require(_0x8b3f('0x5'));var BPromise=require(_0x8b3f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x8b3f('0x7'));var csv=require(_0x8b3f('0x8'));var ejs=require(_0x8b3f('0x9'));var fs=require('fs');var fs_extra=require(_0x8b3f('0xa'));var _=require(_0x8b3f('0xb'));var squel=require(_0x8b3f('0xc'));var crypto=require(_0x8b3f('0xd'));var jsforce=require(_0x8b3f('0xe'));var deskjs=require(_0x8b3f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8b3f('0x10'));var Papa=require(_0x8b3f('0x11'));var Redis=require(_0x8b3f('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b3f('0x13'))(_0x8b3f('0x14'));var utils=require(_0x8b3f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8b3f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56e6fb,_0x23b1cf){_0x23b1cf=_0x23b1cf||0xcc;return function(_0x576255){if(_0x576255){return _0x56e6fb['sendStatus'](_0x23b1cf);}return _0x56e6fb[_0x8b3f('0x17')](_0x23b1cf)[_0x8b3f('0x18')]();};}function respondWithResult(_0x56df02,_0x544aa2){_0x544aa2=_0x544aa2||0xc8;return function(_0x4af814){if(_0x4af814){return _0x56df02[_0x8b3f('0x17')](_0x544aa2)['json'](_0x4af814);}};}function respondWithFilteredResult(_0x141dae,_0x39e17f){return function(_0x1487ed){if(_0x1487ed){var _0x3c72f5=typeof _0x39e17f[_0x8b3f('0x19')]===_0x8b3f('0x1a')&&typeof _0x39e17f[_0x8b3f('0x1b')]===_0x8b3f('0x1a');var _0x209161=_0x1487ed[_0x8b3f('0x1c')];var _0x20e713=_0x3c72f5?0x0:_0x39e17f['offset'];var _0x53d6b9=_0x3c72f5?_0x1487ed[_0x8b3f('0x1c')]:_0x39e17f[_0x8b3f('0x19')]+_0x39e17f[_0x8b3f('0x1b')];var _0x53bdcc;if(_0x53d6b9>=_0x209161){_0x53d6b9=_0x209161;_0x53bdcc=0xc8;}else{_0x53bdcc=0xce;}_0x141dae[_0x8b3f('0x17')](_0x53bdcc);return _0x141dae[_0x8b3f('0x1d')]('Content-Range',_0x20e713+'-'+_0x53d6b9+'/'+_0x209161)[_0x8b3f('0x1e')](_0x1487ed);}return null;};}function patchUpdates(_0x33f428){return function(_0x528199){try{jsonpatch[_0x8b3f('0x1f')](_0x528199,_0x33f428,!![]);}catch(_0x4a7995){return BPromise['reject'](_0x4a7995);}return _0x528199['save']();};}function saveUpdates(_0x312b86,_0xfc27f1){return function(_0x2f2711){if(_0x2f2711){return _0x2f2711[_0x8b3f('0x20')](_0x312b86)[_0x8b3f('0x21')](function(_0x48ed32){return _0x48ed32;});}return null;};}function removeEntity(_0x489faa,_0x51abb1){return function(_0x4bf7f1){if(_0x4bf7f1){return _0x4bf7f1['destroy']()[_0x8b3f('0x21')](function(){_0x489faa[_0x8b3f('0x17')](0xcc)[_0x8b3f('0x18')]();});}};}function handleEntityNotFound(_0x570af2,_0x545f18){return function(_0x4d249f){if(!_0x4d249f){_0x570af2[_0x8b3f('0x22')](0x194);}return _0x4d249f;};}function handleError(_0x24b294,_0x4c9ec3){_0x4c9ec3=_0x4c9ec3||0x1f4;return function(_0x3c3876){logger[_0x8b3f('0x23')](_0x3c3876['stack']);if(_0x3c3876['name']){delete _0x3c3876[_0x8b3f('0x24')];}_0x24b294['status'](_0x4c9ec3)[_0x8b3f('0x25')](_0x3c3876);};}exports[_0x8b3f('0x26')]=function(_0x79c7b5,_0x4ca0b4){var _0x42f565={},_0x3b338f={},_0x1197b9={'count':0x0,'rows':[]};var _0x42558f=_[_0x8b3f('0x27')](db['VtigerField']['rawAttributes'],function(_0x4f00d9){return{'name':_0x4f00d9[_0x8b3f('0x28')],'type':_0x4f00d9[_0x8b3f('0x29')][_0x8b3f('0x2a')]};});_0x3b338f[_0x8b3f('0x2b')]=_['map'](_0x42558f,_0x8b3f('0x24'));_0x3b338f[_0x8b3f('0x2c')]=_[_0x8b3f('0x2d')](_0x79c7b5['query']);_0x3b338f[_0x8b3f('0x2e')]=_['intersection'](_0x3b338f[_0x8b3f('0x2b')],_0x3b338f[_0x8b3f('0x2c')]);_0x42f565[_0x8b3f('0x2f')]=_[_0x8b3f('0x30')](_0x3b338f['model'],qs[_0x8b3f('0x31')](_0x79c7b5[_0x8b3f('0x2c')]['fields']));_0x42f565[_0x8b3f('0x2f')]=_0x42f565[_0x8b3f('0x2f')][_0x8b3f('0x32')]?_0x42f565[_0x8b3f('0x2f')]:_0x3b338f[_0x8b3f('0x2b')];if(!_0x79c7b5[_0x8b3f('0x2c')][_0x8b3f('0x33')]('nolimit')){_0x42f565[_0x8b3f('0x1b')]=qs[_0x8b3f('0x1b')](_0x79c7b5[_0x8b3f('0x2c')]['limit']);_0x42f565[_0x8b3f('0x19')]=qs[_0x8b3f('0x19')](_0x79c7b5[_0x8b3f('0x2c')][_0x8b3f('0x19')]);}_0x42f565['order']=qs['sort'](_0x79c7b5['query'][_0x8b3f('0x34')]);_0x42f565[_0x8b3f('0x35')]=qs['filters'](_['pick'](_0x79c7b5[_0x8b3f('0x2c')],_0x3b338f[_0x8b3f('0x2e')]),_0x42558f);if(_0x79c7b5[_0x8b3f('0x2c')][_0x8b3f('0x36')]){_0x42f565[_0x8b3f('0x35')]=_['merge'](_0x42f565[_0x8b3f('0x35')],{'$or':_[_0x8b3f('0x27')](_0x42558f,function(_0x406566){if(_0x406566[_0x8b3f('0x29')]!=='VIRTUAL'){var _0x332d4f={};_0x332d4f[_0x406566[_0x8b3f('0x24')]]={'$like':'%'+_0x79c7b5[_0x8b3f('0x2c')]['filter']+'%'};return _0x332d4f;}})});}_0x42f565=_[_0x8b3f('0x37')]({},_0x42f565,_0x79c7b5[_0x8b3f('0x38')]);var _0x520e96={'where':_0x42f565['where']};return db[_0x8b3f('0x39')][_0x8b3f('0x1c')](_0x520e96)[_0x8b3f('0x21')](function(_0x33eeb6){_0x1197b9['count']=_0x33eeb6;if(_0x79c7b5[_0x8b3f('0x2c')][_0x8b3f('0x3a')]){_0x42f565[_0x8b3f('0x3b')]=[{'all':!![]}];}return db['VtigerField'][_0x8b3f('0x3c')](_0x42f565);})[_0x8b3f('0x21')](function(_0x16b0a6){_0x1197b9[_0x8b3f('0x3d')]=_0x16b0a6;return _0x1197b9;})['then'](respondWithFilteredResult(_0x4ca0b4,_0x42f565))[_0x8b3f('0x3e')](handleError(_0x4ca0b4,null));};exports['show']=function(_0x87f1d,_0x3db52c){var _0x3c63e8={'raw':!![],'where':{'id':_0x87f1d[_0x8b3f('0x3f')]['id']}},_0x4ce12d={};_0x4ce12d[_0x8b3f('0x2b')]=_['keys'](db[_0x8b3f('0x39')][_0x8b3f('0x40')]);_0x4ce12d['query']=_[_0x8b3f('0x2d')](_0x87f1d[_0x8b3f('0x2c')]);_0x4ce12d[_0x8b3f('0x2e')]=_[_0x8b3f('0x30')](_0x4ce12d[_0x8b3f('0x2b')],_0x4ce12d[_0x8b3f('0x2c')]);_0x3c63e8['attributes']=_[_0x8b3f('0x30')](_0x4ce12d[_0x8b3f('0x2b')],qs[_0x8b3f('0x31')](_0x87f1d[_0x8b3f('0x2c')]['fields']));_0x3c63e8['attributes']=_0x3c63e8[_0x8b3f('0x2f')]['length']?_0x3c63e8[_0x8b3f('0x2f')]:_0x4ce12d['model'];if(_0x87f1d[_0x8b3f('0x2c')][_0x8b3f('0x3a')]){_0x3c63e8[_0x8b3f('0x3b')]=[{'all':!![]}];}_0x3c63e8=_[_0x8b3f('0x37')]({},_0x3c63e8,_0x87f1d['options']);return db[_0x8b3f('0x39')]['find'](_0x3c63e8)[_0x8b3f('0x21')](handleEntityNotFound(_0x3db52c,null))[_0x8b3f('0x21')](respondWithResult(_0x3db52c,null))[_0x8b3f('0x3e')](handleError(_0x3db52c,null));};exports[_0x8b3f('0x41')]=function(_0x41e250,_0x5d1352){return db[_0x8b3f('0x39')][_0x8b3f('0x41')](_0x41e250[_0x8b3f('0x42')],{})[_0x8b3f('0x21')](respondWithResult(_0x5d1352,0xc9))['catch'](handleError(_0x5d1352,null));};exports[_0x8b3f('0x20')]=function(_0x5a1f96,_0x19c0af){if(_0x5a1f96[_0x8b3f('0x42')]['id']){delete _0x5a1f96[_0x8b3f('0x42')]['id'];}return db[_0x8b3f('0x39')][_0x8b3f('0x43')]({'where':{'id':_0x5a1f96[_0x8b3f('0x3f')]['id']}})[_0x8b3f('0x21')](handleEntityNotFound(_0x19c0af,null))['then'](saveUpdates(_0x5a1f96[_0x8b3f('0x42')],null))[_0x8b3f('0x21')](respondWithResult(_0x19c0af,null))[_0x8b3f('0x3e')](handleError(_0x19c0af,null));};exports[_0x8b3f('0x44')]=function(_0x4ea856,_0x186203){return db['VtigerField'][_0x8b3f('0x43')]({'where':{'id':_0x4ea856['params']['id']}})[_0x8b3f('0x21')](handleEntityNotFound(_0x186203,null))[_0x8b3f('0x21')](removeEntity(_0x186203,null))['catch'](handleError(_0x186203,null));}; \ No newline at end of file +var _0x4ee2=['keys','query','filters','attributes','intersection','fields','length','nolimit','sort','pick','filter','merge','VIRTUAL','where','includeAll','show','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','map','VtigerField','rawAttributes','fieldName','type','key','model'];(function(_0x3fdcf6,_0x2fc65c){var _0x6348fd=function(_0x107b40){while(--_0x107b40){_0x3fdcf6['push'](_0x3fdcf6['shift']());}};_0x6348fd(++_0x2fc65c);}(_0x4ee2,0x1e4));var _0x24ee=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4ee2[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x24ee('0x0'));var rimraf=require(_0x24ee('0x1'));var zipdir=require(_0x24ee('0x2'));var jsonpatch=require(_0x24ee('0x3'));var rp=require(_0x24ee('0x4'));var moment=require(_0x24ee('0x5'));var BPromise=require(_0x24ee('0x6'));var Mustache=require(_0x24ee('0x7'));var util=require(_0x24ee('0x8'));var path=require(_0x24ee('0x9'));var sox=require(_0x24ee('0xa'));var csv=require(_0x24ee('0xb'));var ejs=require(_0x24ee('0xc'));var fs=require('fs');var fs_extra=require(_0x24ee('0xd'));var _=require(_0x24ee('0xe'));var squel=require(_0x24ee('0xf'));var crypto=require(_0x24ee('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x24ee('0x11'));var toCsv=require('to-csv');var querystring=require(_0x24ee('0x12'));var Papa=require(_0x24ee('0x13'));var Redis=require(_0x24ee('0x14'));var authService=require(_0x24ee('0x15'));var qs=require(_0x24ee('0x16'));var as=require(_0x24ee('0x17'));var hardwareService=require(_0x24ee('0x18'));var logger=require(_0x24ee('0x19'))(_0x24ee('0x1a'));var utils=require(_0x24ee('0x1b'));var config=require(_0x24ee('0x1c'));var licenseUtil=require('../../config/license/util');var db=require(_0x24ee('0x1d'))['db'];function respondWithStatusCode(_0x7834bd,_0x37ffe0){_0x37ffe0=_0x37ffe0||0xcc;return function(_0x3b577d){if(_0x3b577d){return _0x7834bd[_0x24ee('0x1e')](_0x37ffe0);}return _0x7834bd[_0x24ee('0x1f')](_0x37ffe0)[_0x24ee('0x20')]();};}function respondWithResult(_0x31c204,_0x46e301){_0x46e301=_0x46e301||0xc8;return function(_0x144753){if(_0x144753){return _0x31c204['status'](_0x46e301)['json'](_0x144753);}};}function respondWithFilteredResult(_0x4e7792,_0x2461ab){return function(_0x118ce8){if(_0x118ce8){var _0x2b811e=typeof _0x2461ab[_0x24ee('0x21')]==='undefined'&&typeof _0x2461ab[_0x24ee('0x22')]===_0x24ee('0x23');var _0x226f1a=_0x118ce8[_0x24ee('0x24')];var _0x499c3e=_0x2b811e?0x0:_0x2461ab[_0x24ee('0x21')];var _0x23c7d9=_0x2b811e?_0x118ce8[_0x24ee('0x24')]:_0x2461ab[_0x24ee('0x21')]+_0x2461ab[_0x24ee('0x22')];var _0x156fc0;if(_0x23c7d9>=_0x226f1a){_0x23c7d9=_0x226f1a;_0x156fc0=0xc8;}else{_0x156fc0=0xce;}_0x4e7792[_0x24ee('0x1f')](_0x156fc0);return _0x4e7792[_0x24ee('0x25')](_0x24ee('0x26'),_0x499c3e+'-'+_0x23c7d9+'/'+_0x226f1a)[_0x24ee('0x27')](_0x118ce8);}return null;};}function patchUpdates(_0x2dfb40){return function(_0x1a2c0c){try{jsonpatch['apply'](_0x1a2c0c,_0x2dfb40,!![]);}catch(_0x1eb3c4){return BPromise[_0x24ee('0x28')](_0x1eb3c4);}return _0x1a2c0c[_0x24ee('0x29')]();};}function saveUpdates(_0xa811d2,_0xccd92a){return function(_0x360604){if(_0x360604){return _0x360604[_0x24ee('0x2a')](_0xa811d2)[_0x24ee('0x2b')](function(_0x2758c6){return _0x2758c6;});}return null;};}function removeEntity(_0x575c81,_0x3f8a4b){return function(_0x257a61){if(_0x257a61){return _0x257a61[_0x24ee('0x2c')]()[_0x24ee('0x2b')](function(){_0x575c81[_0x24ee('0x1f')](0xcc)[_0x24ee('0x20')]();});}};}function handleEntityNotFound(_0x5bf822,_0x2cfb7e){return function(_0xf15d52){if(!_0xf15d52){_0x5bf822['sendStatus'](0x194);}return _0xf15d52;};}function handleError(_0x5923c9,_0x14e6b8){_0x14e6b8=_0x14e6b8||0x1f4;return function(_0x279bdf){logger['error'](_0x279bdf[_0x24ee('0x2d')]);if(_0x279bdf[_0x24ee('0x2e')]){delete _0x279bdf[_0x24ee('0x2e')];}_0x5923c9[_0x24ee('0x1f')](_0x14e6b8)[_0x24ee('0x2f')](_0x279bdf);};}exports['index']=function(_0x32e44e,_0x4f9b00){var _0x216c9c={},_0x8f9d30={},_0x5e4f07={'count':0x0,'rows':[]};var _0xdfd584=_[_0x24ee('0x30')](db[_0x24ee('0x31')][_0x24ee('0x32')],function(_0x5516f4){return{'name':_0x5516f4[_0x24ee('0x33')],'type':_0x5516f4[_0x24ee('0x34')][_0x24ee('0x35')]};});_0x8f9d30[_0x24ee('0x36')]=_[_0x24ee('0x30')](_0xdfd584,_0x24ee('0x2e'));_0x8f9d30['query']=_[_0x24ee('0x37')](_0x32e44e[_0x24ee('0x38')]);_0x8f9d30[_0x24ee('0x39')]=_['intersection'](_0x8f9d30[_0x24ee('0x36')],_0x8f9d30[_0x24ee('0x38')]);_0x216c9c[_0x24ee('0x3a')]=_[_0x24ee('0x3b')](_0x8f9d30[_0x24ee('0x36')],qs['fields'](_0x32e44e[_0x24ee('0x38')][_0x24ee('0x3c')]));_0x216c9c['attributes']=_0x216c9c[_0x24ee('0x3a')][_0x24ee('0x3d')]?_0x216c9c[_0x24ee('0x3a')]:_0x8f9d30[_0x24ee('0x36')];if(!_0x32e44e['query']['hasOwnProperty'](_0x24ee('0x3e'))){_0x216c9c['limit']=qs[_0x24ee('0x22')](_0x32e44e['query'][_0x24ee('0x22')]);_0x216c9c[_0x24ee('0x21')]=qs[_0x24ee('0x21')](_0x32e44e['query'][_0x24ee('0x21')]);}_0x216c9c['order']=qs[_0x24ee('0x3f')](_0x32e44e[_0x24ee('0x38')]['sort']);_0x216c9c['where']=qs[_0x24ee('0x39')](_[_0x24ee('0x40')](_0x32e44e[_0x24ee('0x38')],_0x8f9d30[_0x24ee('0x39')]),_0xdfd584);if(_0x32e44e[_0x24ee('0x38')][_0x24ee('0x41')]){_0x216c9c['where']=_[_0x24ee('0x42')](_0x216c9c['where'],{'$or':_['map'](_0xdfd584,function(_0x3edb9d){if(_0x3edb9d[_0x24ee('0x34')]!==_0x24ee('0x43')){var _0x126293={};_0x126293[_0x3edb9d[_0x24ee('0x2e')]]={'$like':'%'+_0x32e44e[_0x24ee('0x38')][_0x24ee('0x41')]+'%'};return _0x126293;}})});}_0x216c9c=_['merge']({},_0x216c9c,_0x32e44e['options']);var _0x4ee70c={'where':_0x216c9c[_0x24ee('0x44')]};return db['VtigerField'][_0x24ee('0x24')](_0x4ee70c)[_0x24ee('0x2b')](function(_0x59313e){_0x5e4f07[_0x24ee('0x24')]=_0x59313e;if(_0x32e44e[_0x24ee('0x38')][_0x24ee('0x45')]){_0x216c9c['include']=[{'all':!![]}];}return db[_0x24ee('0x31')]['findAll'](_0x216c9c);})['then'](function(_0x3d4058){_0x5e4f07['rows']=_0x3d4058;return _0x5e4f07;})[_0x24ee('0x2b')](respondWithFilteredResult(_0x4f9b00,_0x216c9c))['catch'](handleError(_0x4f9b00,null));};exports[_0x24ee('0x46')]=function(_0x100ded,_0x39e5c4){var _0x4f57f9={'raw':!![],'where':{'id':_0x100ded['params']['id']}},_0x4c89dd={};_0x4c89dd[_0x24ee('0x36')]=_[_0x24ee('0x37')](db['VtigerField'][_0x24ee('0x32')]);_0x4c89dd[_0x24ee('0x38')]=_[_0x24ee('0x37')](_0x100ded[_0x24ee('0x38')]);_0x4c89dd[_0x24ee('0x39')]=_[_0x24ee('0x3b')](_0x4c89dd[_0x24ee('0x36')],_0x4c89dd['query']);_0x4f57f9['attributes']=_[_0x24ee('0x3b')](_0x4c89dd[_0x24ee('0x36')],qs[_0x24ee('0x3c')](_0x100ded[_0x24ee('0x38')][_0x24ee('0x3c')]));_0x4f57f9['attributes']=_0x4f57f9[_0x24ee('0x3a')]['length']?_0x4f57f9[_0x24ee('0x3a')]:_0x4c89dd[_0x24ee('0x36')];if(_0x100ded[_0x24ee('0x38')]['includeAll']){_0x4f57f9['include']=[{'all':!![]}];}_0x4f57f9=_[_0x24ee('0x42')]({},_0x4f57f9,_0x100ded[_0x24ee('0x47')]);return db[_0x24ee('0x31')][_0x24ee('0x48')](_0x4f57f9)[_0x24ee('0x2b')](handleEntityNotFound(_0x39e5c4,null))['then'](respondWithResult(_0x39e5c4,null))[_0x24ee('0x49')](handleError(_0x39e5c4,null));};exports[_0x24ee('0x4a')]=function(_0x51a243,_0x41ced8){return db['VtigerField'][_0x24ee('0x4a')](_0x51a243[_0x24ee('0x4b')],{})[_0x24ee('0x2b')](respondWithResult(_0x41ced8,0xc9))[_0x24ee('0x49')](handleError(_0x41ced8,null));};exports[_0x24ee('0x2a')]=function(_0x29bf64,_0x348de6){if(_0x29bf64['body']['id']){delete _0x29bf64[_0x24ee('0x4b')]['id'];}return db[_0x24ee('0x31')]['find']({'where':{'id':_0x29bf64[_0x24ee('0x4c')]['id']}})['then'](handleEntityNotFound(_0x348de6,null))[_0x24ee('0x2b')](saveUpdates(_0x29bf64[_0x24ee('0x4b')],null))['then'](respondWithResult(_0x348de6,null))[_0x24ee('0x49')](handleError(_0x348de6,null));};exports['destroy']=function(_0x4e950d,_0x56cc9b){return db['VtigerField'][_0x24ee('0x48')]({'where':{'id':_0x4e950d['params']['id']}})[_0x24ee('0x2b')](handleEntityNotFound(_0x56cc9b,null))[_0x24ee('0x2b')](removeEntity(_0x56cc9b,null))[_0x24ee('0x49')](handleError(_0x56cc9b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 48db0cf..b7667d8 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 _0x2fc8=['./intVtigerField.attributes','exports','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xb2eebb,_0x570e3d){var _0x457547=function(_0x5dede7){while(--_0x5dede7){_0xb2eebb['push'](_0xb2eebb['shift']());}};_0x457547(++_0x570e3d);}(_0x2fc8,0x1c7));var _0x82fc=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x2fc8[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x82fc('0x0'));var util=require(_0x82fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82fc('0x2'));var BPromise=require(_0x82fc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x82fc('0x4'));var rimraf=require(_0x82fc('0x5'));var config=require(_0x82fc('0x6'));var attributes=require(_0x82fc('0x7'));module[_0x82fc('0x8')]=function(_0x192d4d,_0x503226){return _0x192d4d['define'](_0x82fc('0x9'),attributes,{'tableName':_0x82fc('0xa'),'paranoid':![],'indexes':[{'name':_0x82fc('0xb'),'fields':[_0x82fc('0xc'),_0x82fc('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf692=['request-promise','path','../../config/environment','./intVtigerField.attributes','exports','int_vtiger_fields','vtiger_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird'];(function(_0x22e58f,_0x306c63){var _0x1c3325=function(_0x27dcc1){while(--_0x27dcc1){_0x22e58f['push'](_0x22e58f['shift']());}};_0x1c3325(++_0x306c63);}(_0xf692,0x7e));var _0x2f69=function(_0x11c8b5,_0x1d08a6){_0x11c8b5=_0x11c8b5-0x0;var _0x33c453=_0xf692[_0x11c8b5];return _0x33c453;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2f69('0x0'))(_0x2f69('0x1'));var moment=require(_0x2f69('0x2'));var BPromise=require(_0x2f69('0x3'));var rp=require(_0x2f69('0x4'));var fs=require('fs');var path=require(_0x2f69('0x5'));var rimraf=require('rimraf');var config=require(_0x2f69('0x6'));var attributes=require(_0x2f69('0x7'));module[_0x2f69('0x8')]=function(_0x4a7384,_0x32cd6f){return _0x4a7384['define']('VtigerField',attributes,{'tableName':_0x2f69('0x9'),'paranoid':![],'indexes':[{'name':_0x2f69('0xa'),'fields':[_0x2f69('0xb'),_0x2f69('0xc')],'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 48a1b73..0a6446f 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 _0x9cac=['../../config/logger','rpc','../../config/environment','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x3421af,_0x1b2ef0){var _0x4bd69f=function(_0x210cb3){while(--_0x210cb3){_0x3421af['push'](_0x3421af['shift']());}};_0x4bd69f(++_0x1b2ef0);}(_0x9cac,0xb7));var _0xc9ca=function(_0x4a9b62,_0x416738){_0x4a9b62=_0x4a9b62-0x0;var _0x3ed0e1=_0x9cac[_0x4a9b62];return _0x3ed0e1;};'use strict';var _=require(_0xc9ca('0x0'));var util=require('util');var moment=require(_0xc9ca('0x1'));var BPromise=require(_0xc9ca('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9ca('0x3'));var db=require(_0xc9ca('0x4'))['db'];var utils=require(_0xc9ca('0x5'));var logger=require(_0xc9ca('0x6'))(_0xc9ca('0x7'));var config=require(_0xc9ca('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc9ca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fcae7,_0x3f5372,_0x29d9d7){return new BPromise(function(_0x538443,_0x7fa9d3){return client[_0xc9ca('0xa')](_0x4fcae7,_0x29d9d7)[_0xc9ca('0xb')](function(_0x459c0d){logger[_0xc9ca('0xc')](_0xc9ca('0xd'),_0x3f5372,_0xc9ca('0xe'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x3f5372,'request\x20sent',JSON[_0xc9ca('0xf')](_0x459c0d));if(_0x459c0d[_0xc9ca('0x10')]){if(_0x459c0d[_0xc9ca('0x10')][_0xc9ca('0x11')]===0x1f4){logger[_0xc9ca('0x10')](_0xc9ca('0xd'),_0x3f5372,_0x459c0d['error'][_0xc9ca('0x12')]);return _0x7fa9d3(_0x459c0d[_0xc9ca('0x10')][_0xc9ca('0x12')]);}logger[_0xc9ca('0x10')](_0xc9ca('0xd'),_0x3f5372,_0x459c0d[_0xc9ca('0x10')][_0xc9ca('0x12')]);return _0x538443(_0x459c0d[_0xc9ca('0x10')][_0xc9ca('0x12')]);}else{logger['info'](_0xc9ca('0xd'),_0x3f5372,_0xc9ca('0xe'));_0x538443(_0x459c0d[_0xc9ca('0x13')][_0xc9ca('0x12')]);}})[_0xc9ca('0x14')](function(_0xad7c39){logger[_0xc9ca('0x10')](_0xc9ca('0xd'),_0x3f5372,_0xad7c39);_0x7fa9d3(_0xad7c39);});});} \ No newline at end of file +var _0x68c8=['VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x587bbb,_0x42462e){var _0x31b085=function(_0x119406){while(--_0x119406){_0x587bbb['push'](_0x587bbb['shift']());}};_0x31b085(++_0x42462e);}(_0x68c8,0x16f));var _0x868c=function(_0xcc7d70,_0x47606e){_0xcc7d70=_0xcc7d70-0x0;var _0x292342=_0x68c8[_0xcc7d70];return _0x292342;};'use strict';var _=require(_0x868c('0x0'));var util=require(_0x868c('0x1'));var moment=require(_0x868c('0x2'));var BPromise=require(_0x868c('0x3'));var rs=require(_0x868c('0x4'));var fs=require('fs');var Redis=require(_0x868c('0x5'));var db=require(_0x868c('0x6'))['db'];var utils=require(_0x868c('0x7'));var logger=require(_0x868c('0x8'))(_0x868c('0x9'));var config=require('../../config/environment');var jayson=require(_0x868c('0xa'));var client=jayson['client'][_0x868c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4005d3,_0x1899f6,_0x53f4fe){return new BPromise(function(_0x275f61,_0x3ef654){return client[_0x868c('0xc')](_0x4005d3,_0x53f4fe)[_0x868c('0xd')](function(_0x3b4a88){logger['info'](_0x868c('0xe'),_0x1899f6,_0x868c('0xf'));logger[_0x868c('0x10')](_0x868c('0x11'),_0x1899f6,'request\x20sent',JSON[_0x868c('0x12')](_0x3b4a88));if(_0x3b4a88['error']){if(_0x3b4a88['error']['code']===0x1f4){logger[_0x868c('0x13')](_0x868c('0xe'),_0x1899f6,_0x3b4a88[_0x868c('0x13')]['message']);return _0x3ef654(_0x3b4a88[_0x868c('0x13')][_0x868c('0x14')]);}logger[_0x868c('0x13')]('VtigerField,\x20%s,\x20%s',_0x1899f6,_0x3b4a88[_0x868c('0x13')][_0x868c('0x14')]);return _0x275f61(_0x3b4a88['error'][_0x868c('0x14')]);}else{logger[_0x868c('0x15')](_0x868c('0xe'),_0x1899f6,_0x868c('0xf'));_0x275f61(_0x3b4a88[_0x868c('0x16')][_0x868c('0x14')]);}})[_0x868c('0x17')](function(_0x50f172){logger[_0x868c('0x13')](_0x868c('0xe'),_0x1899f6,_0x50f172);_0x3ef654(_0x50f172);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 2a253bf..bbfa679 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 _0x4c85=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','index','get','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','/:id','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x22435e,_0x46fa1a){var _0x10bff6=function(_0x214e4a){while(--_0x214e4a){_0x22435e['push'](_0x22435e['shift']());}};_0x10bff6(++_0x46fa1a);}(_0x4c85,0xec));var _0x54c8=function(_0x4f79d4,_0xc4d05b){_0x4f79d4=_0x4f79d4-0x0;var _0x3917a7=_0x4c85[_0x4f79d4];return _0x3917a7;};'use strict';var multer=require(_0x54c8('0x0'));var util=require(_0x54c8('0x1'));var path=require('path');var timeout=require(_0x54c8('0x2'));var express=require(_0x54c8('0x3'));var router=express[_0x54c8('0x4')]();var fs_extra=require(_0x54c8('0x5'));var auth=require(_0x54c8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x54c8('0x7'));var controller=require(_0x54c8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x54c8('0x9')]);router[_0x54c8('0xa')]('/:id',auth[_0x54c8('0xb')](),controller[_0x54c8('0xc')]);router[_0x54c8('0xa')]('/:id/configurations',auth[_0x54c8('0xb')](),controller[_0x54c8('0xd')]);router[_0x54c8('0xa')](_0x54c8('0xe'),auth[_0x54c8('0xb')](),controller[_0x54c8('0xf')]);router[_0x54c8('0x10')]('/',auth[_0x54c8('0xb')](),controller[_0x54c8('0x11')]);router[_0x54c8('0x10')](_0x54c8('0x12'),auth[_0x54c8('0xb')](),controller[_0x54c8('0x13')]);router['put'](_0x54c8('0x14'),auth[_0x54c8('0xb')](),controller[_0x54c8('0x15')]);router['delete']('/:id',auth[_0x54c8('0xb')](),controller[_0x54c8('0x16')]);module[_0x54c8('0x17')]=router; \ No newline at end of file +var _0xfab1=['show','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xfab1,0xe5));var _0x1fab=function(_0xad9b66,_0x4a6b2c){_0xad9b66=_0xad9b66-0x0;var _0x3e4c3f=_0xfab1[_0xad9b66];return _0x3e4c3f;};'use strict';var multer=require(_0x1fab('0x0'));var util=require(_0x1fab('0x1'));var path=require(_0x1fab('0x2'));var timeout=require(_0x1fab('0x3'));var express=require(_0x1fab('0x4'));var router=express[_0x1fab('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x1fab('0x6'));var interaction=require(_0x1fab('0x7'));var config=require(_0x1fab('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x1fab('0x9')](),controller[_0x1fab('0xa')]);router['get']('/:id',auth[_0x1fab('0x9')](),controller[_0x1fab('0xb')]);router[_0x1fab('0xc')](_0x1fab('0xd'),auth[_0x1fab('0x9')](),controller['getConfigurations']);router['get'](_0x1fab('0xe'),auth['isAuthenticated'](),controller[_0x1fab('0xf')]);router[_0x1fab('0x10')]('/',auth[_0x1fab('0x9')](),controller[_0x1fab('0x11')]);router[_0x1fab('0x10')](_0x1fab('0xd'),auth[_0x1fab('0x9')](),controller[_0x1fab('0x12')]);router[_0x1fab('0x13')](_0x1fab('0x14'),auth[_0x1fab('0x9')](),controller[_0x1fab('0x15')]);router['delete'](_0x1fab('0x14'),auth[_0x1fab('0x9')](),controller[_0x1fab('0x16')]);module[_0x1fab('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index ecaf4fb..83b3793 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 _0xd916=['integrationTab','newTab','sequelize','exports','STRING','ENUM','password'];(function(_0x565b58,_0xa40fda){var _0x4ea2e7=function(_0x56f96c){while(--_0x56f96c){_0x565b58['push'](_0x565b58['shift']());}};_0x4ea2e7(++_0xa40fda);}(_0xd916,0x18a));var _0x6d91=function(_0x476f49,_0x105660){_0x476f49=_0x476f49-0x0;var _0x48addd=_0xd916[_0x476f49];return _0x48addd;};'use strict';var Sequelize=require(_0x6d91('0x0'));module[_0x6d91('0x1')]={'name':{'type':Sequelize[_0x6d91('0x2')]},'description':{'type':Sequelize[_0x6d91('0x2')]},'username':{'type':Sequelize[_0x6d91('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6d91('0x2')]},'token':{'type':Sequelize[_0x6d91('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x6d91('0x3')](_0x6d91('0x4'),'token'),'defaultValue':_0x6d91('0x4')},'serverUrl':{'type':Sequelize[_0x6d91('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6d91('0x3')](_0x6d91('0x5'),_0x6d91('0x6')),'defaultValue':_0x6d91('0x5')}}; \ No newline at end of file +var _0x68b3=['token','ENUM','integrationTab','newTab','sequelize','exports','STRING','remoteUri','password'];(function(_0x2e6cf5,_0x495b7d){var _0x356021=function(_0x5f7bae){while(--_0x5f7bae){_0x2e6cf5['push'](_0x2e6cf5['shift']());}};_0x356021(++_0x495b7d);}(_0x68b3,0x1d8));var _0x368b=function(_0x159d86,_0xdae0c7){_0x159d86=_0x159d86-0x0;var _0x38cb1d=_0x68b3[_0x159d86];return _0x38cb1d;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')]},'description':{'type':Sequelize[_0x368b('0x2')]},'username':{'type':Sequelize[_0x368b('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x368b('0x2')]},'token':{'type':Sequelize[_0x368b('0x2')]},'remoteUri':{'type':Sequelize[_0x368b('0x2')],'unique':_0x368b('0x3')},'authType':{'type':Sequelize['ENUM'](_0x368b('0x4'),_0x368b('0x5')),'defaultValue':_0x368b('0x4')},'serverUrl':{'type':Sequelize[_0x368b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x368b('0x6')](_0x368b('0x7'),_0x368b('0x8')),'defaultValue':_0x368b('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 95925cb..4802151 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 _0x2e54=['position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','params','intersection','options','create','body','find','getConfigurations','findOne','ZendeskConfiguration','length','sort','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','format','%s/%s','Basic\x20%s','%s:%s','headers','%s/token:%s','toString','Sequelize','ValidationError','subject','description','group','assignee','remove','ticket_fields'];(function(_0x590776,_0x843c7e){var _0x55ad22=function(_0x191e81){while(--_0x191e81){_0x590776['push'](_0x590776['shift']());}};_0x55ad22(++_0x843c7e);}(_0x2e54,0x1dd));var _0x42e5=function(_0x5553a,_0x4eed0d){_0x5553a=_0x5553a-0x0;var _0x1345ce=_0x2e54[_0x5553a];return _0x1345ce;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];var integrations=require(_0x42e5('0x18'));function respondWithStatusCode(_0x4530ba,_0x41598d){_0x41598d=_0x41598d||0xcc;return function(_0x144fb4){if(_0x144fb4){return _0x4530ba[_0x42e5('0x19')](_0x41598d);}return _0x4530ba[_0x42e5('0x1a')](_0x41598d)[_0x42e5('0x1b')]();};}function respondWithResult(_0x447648,_0x23957f){_0x23957f=_0x23957f||0xc8;return function(_0x51b2f4){if(_0x51b2f4){return _0x447648[_0x42e5('0x1a')](_0x23957f)[_0x42e5('0x1c')](_0x51b2f4);}};}function respondWithFilteredResult(_0x4034bd,_0x388300){return function(_0x2f4999){if(_0x2f4999){var _0x263a3d=typeof _0x388300[_0x42e5('0x1d')]===_0x42e5('0x1e')&&typeof _0x388300[_0x42e5('0x1f')]===_0x42e5('0x1e');var _0x22655f=_0x2f4999[_0x42e5('0x20')];var _0x11550e=_0x263a3d?0x0:_0x388300[_0x42e5('0x1d')];var _0x54fcfc=_0x263a3d?_0x2f4999[_0x42e5('0x20')]:_0x388300['offset']+_0x388300['limit'];var _0x14d16d;if(_0x54fcfc>=_0x22655f){_0x54fcfc=_0x22655f;_0x14d16d=0xc8;}else{_0x14d16d=0xce;}_0x4034bd[_0x42e5('0x1a')](_0x14d16d);return _0x4034bd['set'](_0x42e5('0x21'),_0x11550e+'-'+_0x54fcfc+'/'+_0x22655f)[_0x42e5('0x1c')](_0x2f4999);}return null;};}function patchUpdates(_0x1c2169){return function(_0x3fde76){try{jsonpatch[_0x42e5('0x22')](_0x3fde76,_0x1c2169,!![]);}catch(_0xa6825e){return BPromise[_0x42e5('0x23')](_0xa6825e);}return _0x3fde76['save']();};}function saveUpdates(_0x4da508,_0x283d44){return function(_0x52d319){if(_0x52d319){return _0x52d319[_0x42e5('0x24')](_0x4da508)[_0x42e5('0x25')](function(_0x37d10e){return _0x37d10e;});}return null;};}function removeEntity(_0x49490f,_0x32380f){return function(_0x5d6b24){if(_0x5d6b24){return _0x5d6b24[_0x42e5('0x26')]()[_0x42e5('0x25')](function(){_0x49490f[_0x42e5('0x1a')](0xcc)[_0x42e5('0x1b')]();});}};}function handleEntityNotFound(_0x4638bc,_0x4f52b2){return function(_0x4fb147){if(!_0x4fb147){_0x4638bc[_0x42e5('0x19')](0x194);}return _0x4fb147;};}function handleError(_0x534a26,_0x56f812){_0x56f812=_0x56f812||0x1f4;return function(_0x1b60be){logger['error'](_0x1b60be[_0x42e5('0x27')]);if(_0x1b60be[_0x42e5('0x28')]){delete _0x1b60be[_0x42e5('0x28')];}_0x534a26[_0x42e5('0x1a')](_0x56f812)[_0x42e5('0x29')](_0x1b60be);};}exports[_0x42e5('0x2a')]=function(_0x59a46b,_0x3e2ea5){var _0x201d9e={},_0x39f763={},_0x2c53d4={'count':0x0,'rows':[]};var _0x1d22ba=_[_0x42e5('0x2b')](db[_0x42e5('0x2c')][_0x42e5('0x2d')],function(_0x5a4930){return{'name':_0x5a4930[_0x42e5('0x2e')],'type':_0x5a4930[_0x42e5('0x2f')][_0x42e5('0x30')]};});_0x39f763[_0x42e5('0x31')]=_['map'](_0x1d22ba,_0x42e5('0x28'));_0x39f763[_0x42e5('0x32')]=_[_0x42e5('0x33')](_0x59a46b[_0x42e5('0x32')]);_0x39f763['filters']=_['intersection'](_0x39f763[_0x42e5('0x31')],_0x39f763['query']);_0x201d9e[_0x42e5('0x34')]=_['intersection'](_0x39f763[_0x42e5('0x31')],qs[_0x42e5('0x35')](_0x59a46b[_0x42e5('0x32')]['fields']));_0x201d9e[_0x42e5('0x34')]=_0x201d9e[_0x42e5('0x34')]['length']?_0x201d9e[_0x42e5('0x34')]:_0x39f763['model'];if(!_0x59a46b[_0x42e5('0x32')][_0x42e5('0x36')](_0x42e5('0x37'))){_0x201d9e[_0x42e5('0x1f')]=qs[_0x42e5('0x1f')](_0x59a46b[_0x42e5('0x32')][_0x42e5('0x1f')]);_0x201d9e['offset']=qs['offset'](_0x59a46b[_0x42e5('0x32')][_0x42e5('0x1d')]);}_0x201d9e[_0x42e5('0x38')]=qs['sort'](_0x59a46b['query']['sort']);_0x201d9e['where']=qs[_0x42e5('0x39')](_[_0x42e5('0x3a')](_0x59a46b[_0x42e5('0x32')],_0x39f763[_0x42e5('0x39')]),_0x1d22ba);if(_0x59a46b[_0x42e5('0x32')][_0x42e5('0x3b')]){_0x201d9e[_0x42e5('0x3c')]=_[_0x42e5('0x3d')](_0x201d9e['where'],{'$or':_[_0x42e5('0x2b')](_0x1d22ba,function(_0x587832){if(_0x587832[_0x42e5('0x2f')]!==_0x42e5('0x3e')){var _0x340caf={};_0x340caf[_0x587832[_0x42e5('0x28')]]={'$like':'%'+_0x59a46b[_0x42e5('0x32')][_0x42e5('0x3b')]+'%'};return _0x340caf;}})});}_0x201d9e=_[_0x42e5('0x3d')]({},_0x201d9e,_0x59a46b['options']);var _0x20f372={'where':_0x201d9e[_0x42e5('0x3c')]};return db['ZendeskAccount'][_0x42e5('0x20')](_0x20f372)['then'](function(_0x53b0bd){_0x2c53d4['count']=_0x53b0bd;if(_0x59a46b[_0x42e5('0x32')][_0x42e5('0x3f')]){_0x201d9e[_0x42e5('0x40')]=[{'all':!![]}];}return db[_0x42e5('0x2c')][_0x42e5('0x41')](_0x201d9e);})[_0x42e5('0x25')](function(_0x1fbde){_0x2c53d4['rows']=_0x1fbde;return _0x2c53d4;})[_0x42e5('0x25')](respondWithFilteredResult(_0x3e2ea5,_0x201d9e))[_0x42e5('0x42')](handleError(_0x3e2ea5,null));};exports['show']=function(_0x398b73,_0x1c697a){var _0x5db771={'raw':![],'where':{'id':_0x398b73[_0x42e5('0x43')]['id']}},_0x33054f={};_0x33054f[_0x42e5('0x31')]=_[_0x42e5('0x33')](db[_0x42e5('0x2c')]['rawAttributes']);_0x33054f[_0x42e5('0x32')]=_[_0x42e5('0x33')](_0x398b73[_0x42e5('0x32')]);_0x33054f[_0x42e5('0x39')]=_['intersection'](_0x33054f[_0x42e5('0x31')],_0x33054f[_0x42e5('0x32')]);_0x5db771[_0x42e5('0x34')]=_[_0x42e5('0x44')](_0x33054f[_0x42e5('0x31')],qs[_0x42e5('0x35')](_0x398b73[_0x42e5('0x32')][_0x42e5('0x35')]));_0x5db771['attributes']=_0x5db771[_0x42e5('0x34')]['length']?_0x5db771['attributes']:_0x33054f[_0x42e5('0x31')];if(_0x398b73[_0x42e5('0x32')][_0x42e5('0x3f')]){_0x5db771[_0x42e5('0x40')]=[{'all':!![]}];}_0x5db771=_[_0x42e5('0x3d')]({},_0x5db771,_0x398b73[_0x42e5('0x45')]);return db[_0x42e5('0x2c')]['find'](_0x5db771)[_0x42e5('0x25')](handleEntityNotFound(_0x1c697a,null))[_0x42e5('0x25')](respondWithResult(_0x1c697a,null))[_0x42e5('0x42')](handleError(_0x1c697a,null));};exports[_0x42e5('0x46')]=function(_0x1086b2,_0xc8de4d){return db[_0x42e5('0x2c')][_0x42e5('0x46')](_0x1086b2['body'],{})[_0x42e5('0x25')](respondWithResult(_0xc8de4d,0xc9))[_0x42e5('0x42')](handleError(_0xc8de4d,null));};exports[_0x42e5('0x24')]=function(_0x48757e,_0x2ab52a){if(_0x48757e[_0x42e5('0x47')]['id']){delete _0x48757e[_0x42e5('0x47')]['id'];}return db[_0x42e5('0x2c')][_0x42e5('0x48')]({'where':{'id':_0x48757e['params']['id']}})[_0x42e5('0x25')](handleEntityNotFound(_0x2ab52a,null))['then'](saveUpdates(_0x48757e[_0x42e5('0x47')],null))[_0x42e5('0x25')](respondWithResult(_0x2ab52a,null))[_0x42e5('0x42')](handleError(_0x2ab52a,null));};exports['destroy']=function(_0x50f59c,_0x4f0639){return db[_0x42e5('0x2c')][_0x42e5('0x48')]({'where':{'id':_0x50f59c[_0x42e5('0x43')]['id']}})[_0x42e5('0x25')](handleEntityNotFound(_0x4f0639,null))['then'](removeEntity(_0x4f0639,null))[_0x42e5('0x42')](handleError(_0x4f0639,null));};exports[_0x42e5('0x49')]=function(_0x18cedc,_0x504110,_0x34e169){var _0x5070aa={};var _0x319088={};var _0x2583cd;var _0x53e29b;return db[_0x42e5('0x2c')][_0x42e5('0x4a')]({'where':{'id':_0x18cedc[_0x42e5('0x43')]['id']}})[_0x42e5('0x25')](handleEntityNotFound(_0x504110,null))[_0x42e5('0x25')](function(_0x3f043f){if(_0x3f043f){_0x2583cd=_0x3f043f;_0x319088[_0x42e5('0x31')]=_[_0x42e5('0x33')](db[_0x42e5('0x4b')][_0x42e5('0x2d')]);_0x319088['query']=_[_0x42e5('0x33')](_0x18cedc[_0x42e5('0x32')]);_0x319088[_0x42e5('0x39')]=_[_0x42e5('0x44')](_0x319088[_0x42e5('0x31')],_0x319088['query']);_0x5070aa[_0x42e5('0x34')]=_[_0x42e5('0x44')](_0x319088[_0x42e5('0x31')],qs[_0x42e5('0x35')](_0x18cedc['query']['fields']));_0x5070aa['attributes']=_0x5070aa[_0x42e5('0x34')][_0x42e5('0x4c')]?_0x5070aa['attributes']:_0x319088[_0x42e5('0x31')];_0x5070aa[_0x42e5('0x38')]=qs[_0x42e5('0x4d')](_0x18cedc[_0x42e5('0x32')][_0x42e5('0x4d')]);_0x5070aa[_0x42e5('0x3c')]=qs[_0x42e5('0x39')](_[_0x42e5('0x3a')](_0x18cedc[_0x42e5('0x32')],_0x319088['filters']));if(_0x18cedc[_0x42e5('0x32')]['filter']){_0x5070aa[_0x42e5('0x3c')]=_[_0x42e5('0x3d')](_0x5070aa[_0x42e5('0x3c')],{'$or':_[_0x42e5('0x2b')](_0x5070aa[_0x42e5('0x34')],function(_0x3b46d2){var _0x248cb8={};_0x248cb8[_0x3b46d2]={'$like':'%'+_0x18cedc[_0x42e5('0x32')][_0x42e5('0x3b')]+'%'};return _0x248cb8;})});}_0x5070aa=_[_0x42e5('0x3d')]({},_0x5070aa,_0x18cedc[_0x42e5('0x45')]);return _0x2583cd['getConfigurations'](_0x5070aa);}})[_0x42e5('0x25')](function(_0x4ff58c){if(_0x4ff58c){_0x53e29b=_0x4ff58c[_0x42e5('0x4c')];if(!_0x18cedc['query'][_0x42e5('0x36')](_0x42e5('0x37'))){_0x5070aa['limit']=qs[_0x42e5('0x1f')](_0x18cedc[_0x42e5('0x32')]['limit']);_0x5070aa[_0x42e5('0x1d')]=qs[_0x42e5('0x1d')](_0x18cedc['query'][_0x42e5('0x1d')]);}return _0x2583cd[_0x42e5('0x49')](_0x5070aa);}})[_0x42e5('0x25')](function(_0x57814b){if(_0x57814b){return _0x57814b?{'count':_0x53e29b,'rows':_0x57814b}:null;}})[_0x42e5('0x25')](respondWithResult(_0x504110,null))[_0x42e5('0x42')](handleError(_0x504110,null));};exports[_0x42e5('0x4e')]=function(_0x78394d,_0x57368e,_0x42db50){if(_0x78394d['body']['id']){delete _0x78394d[_0x42e5('0x47')]['id'];}return db[_0x42e5('0x2c')][_0x42e5('0x4a')]({'where':{'id':_0x78394d[_0x42e5('0x43')]['id']}})[_0x42e5('0x25')](handleEntityNotFound(_0x57368e,null))[_0x42e5('0x25')](function(_0x15ff42){if(_0x15ff42){_0x78394d['body'][_0x42e5('0x4f')]=_0x15ff42['id'];_0x78394d[_0x42e5('0x47')][_0x42e5('0x50')]=integrations[_0x42e5('0x51')](_0x78394d[_0x42e5('0x47')][_0x42e5('0x52')],_0x78394d[_0x42e5('0x47')][_0x42e5('0x2f')]);_0x78394d[_0x42e5('0x47')]['Descriptions']=integrations[_0x42e5('0x53')](_0x78394d[_0x42e5('0x47')][_0x42e5('0x52')],_0x78394d[_0x42e5('0x47')]['type']);return db[_0x42e5('0x4b')][_0x42e5('0x46')](_0x78394d[_0x42e5('0x47')],{'include':[{'model':db[_0x42e5('0x54')],'as':'Subjects'},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x42e5('0x25')](respondWithResult(_0x57368e,null))[_0x42e5('0x42')](handleError(_0x57368e,null));};exports[_0x42e5('0x55')]=function(_0x2ce1d4,_0xb198d,_0x14d111){var _0x1cfe79='';return db[_0x42e5('0x2c')][_0x42e5('0x4a')]({'where':{'id':_0x2ce1d4['params']['id']},'attributes':['id',_0x42e5('0x56'),_0x42e5('0x57'),_0x42e5('0x58'),_0x42e5('0x59'),_0x42e5('0x5a')]})[_0x42e5('0x25')](handleEntityNotFound(_0xb198d,null))[_0x42e5('0x25')](function(_0x147613){if(_0x147613){_0x1cfe79=_0x147613['remoteUri'];var _0x548f8a=_0x1cfe79[_0x42e5('0x5b')](-0x1);if(_0x548f8a==='/'){_0x1cfe79=_0x1cfe79[_0x42e5('0x5c')](0x0,_0x1cfe79['lastIndexOf'](_0x548f8a));}var _0x4b9559={'method':'GET','uri':util[_0x42e5('0x5d')](_0x42e5('0x5e'),_0x1cfe79,'ticket_fields'),'json':!![]};switch(_0x147613[_0x42e5('0x59')]){case _0x42e5('0x57'):_0x4b9559['headers']={'Authorization':util[_0x42e5('0x5d')](_0x42e5('0x5f'),new Buffer(util['format'](_0x42e5('0x60'),_0x147613['username'],_0x147613['password']))['toString']('base64'))};break;case _0x42e5('0x58'):_0x4b9559[_0x42e5('0x61')]={'Authorization':util['format'](_0x42e5('0x5f'),new Buffer(util[_0x42e5('0x5d')](_0x42e5('0x62'),_0x147613[_0x42e5('0x56')],_0x147613[_0x42e5('0x58')]))[_0x42e5('0x63')]('base64'))};break;default:throw new db[(_0x42e5('0x64'))][(_0x42e5('0x65'))]('Unknown\x20authentication\x20type');}return rp(_0x4b9559);}})['then'](function(_0x2faf9b){if(_0x2faf9b){var _0xfa822e=[_0x42e5('0x66'),_0x42e5('0x67'),_0x42e5('0x68'),_0x42e5('0x69')];_[_0x42e5('0x6a')](_0x2faf9b['ticket_fields'],function(_0x5a1b63){return _0xfa822e['includes'](_0x5a1b63['type']);});return{'count':_0x2faf9b[_0x42e5('0x6b')][_0x42e5('0x4c')],'rows':_['map'](_0x2faf9b[_0x42e5('0x6b')],function(_0x5debb1){return{'id':_0x5debb1['id'],'name':_0x5debb1[_0x42e5('0x6c')]>0x7?_0x5debb1[_0x42e5('0x6d')]:_0x5debb1[_0x42e5('0x2f')],'custom':_0x5debb1[_0x42e5('0x6c')]>0x7?!![]:![],'options':_0x5debb1[_0x42e5('0x6e')]?_0x5debb1[_0x42e5('0x6e')]:_0x5debb1[_0x42e5('0x6f')]?_0x5debb1[_0x42e5('0x6f')]:[]};})};}})[_0x42e5('0x25')](respondWithResult(_0xb198d,null))[_0x42e5('0x42')](function(_0x1ee9b2){var _0x78573b=_0x2ce1d4[_0x42e5('0x32')][_0x42e5('0x70')]?0x1f4:_0x1ee9b2[_0x42e5('0x71')]||0x1f4;logger[_0x42e5('0x72')](_0x42e5('0x73'),_0x42e5('0x55'),_0x78573b,JSON['stringify'](_0x1ee9b2));delete _0x1ee9b2[_0x42e5('0x28')];if(_0x78573b===0x191){_0x78573b=0x190;}_0xb198d[_0x42e5('0x1a')](_0x78573b)[_0x42e5('0x29')](_0x2ce1d4[_0x42e5('0x32')][_0x42e5('0x70')]?{'message':_0x42e5('0x74'),'statusCode':_0x1ee9b2[_0x42e5('0x71')]}:_0x1ee9b2);});}; \ No newline at end of file +var _0xeffd=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','set','Content-Range','save','update','destroy','then','sendStatus','error','stack','send','index','map','ZendeskAccount','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','create','body','find','findOne','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','ZendeskConfiguration','ZendeskField','Descriptions','password','token','authType','remoteUri','slice','substring','lastIndexOf','GET','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s:%s','username','toString','%s/token:%s','base64','Sequelize','Unknown\x20authentication\x20type','subject','group','assignee','remove','title','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','name','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2378ad,_0x38b7fc){var _0xd43e31=function(_0x309780){while(--_0x309780){_0x2378ad['push'](_0x2378ad['shift']());}};_0xd43e31(++_0x38b7fc);}(_0xeffd,0x6b));var _0xdeff=function(_0x34bb12,_0x40ee99){_0x34bb12=_0x34bb12-0x0;var _0x26e6e7=_0xeffd[_0x34bb12];return _0x26e6e7;};'use strict';var emlformat=require(_0xdeff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdeff('0x1'));var jsonpatch=require(_0xdeff('0x2'));var rp=require(_0xdeff('0x3'));var moment=require(_0xdeff('0x4'));var BPromise=require(_0xdeff('0x5'));var Mustache=require(_0xdeff('0x6'));var util=require(_0xdeff('0x7'));var path=require(_0xdeff('0x8'));var sox=require(_0xdeff('0x9'));var csv=require(_0xdeff('0xa'));var ejs=require(_0xdeff('0xb'));var fs=require('fs');var fs_extra=require(_0xdeff('0xc'));var _=require(_0xdeff('0xd'));var squel=require(_0xdeff('0xe'));var crypto=require(_0xdeff('0xf'));var jsforce=require(_0xdeff('0x10'));var deskjs=require(_0xdeff('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdeff('0x12'));var Papa=require(_0xdeff('0x13'));var Redis=require(_0xdeff('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdeff('0x15'));var as=require(_0xdeff('0x16'));var hardwareService=require(_0xdeff('0x17'));var logger=require(_0xdeff('0x18'))(_0xdeff('0x19'));var utils=require(_0xdeff('0x1a'));var config=require(_0xdeff('0x1b'));var licenseUtil=require(_0xdeff('0x1c'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdeff('0x1d'));function respondWithStatusCode(_0x116bf9,_0x4952f2){_0x4952f2=_0x4952f2||0xcc;return function(_0x2e614c){if(_0x2e614c){return _0x116bf9['sendStatus'](_0x4952f2);}return _0x116bf9['status'](_0x4952f2)[_0xdeff('0x1e')]();};}function respondWithResult(_0x47410f,_0x1585e8){_0x1585e8=_0x1585e8||0xc8;return function(_0xb4bc82){if(_0xb4bc82){return _0x47410f['status'](_0x1585e8)[_0xdeff('0x1f')](_0xb4bc82);}};}function respondWithFilteredResult(_0x314ded,_0xea6c4){return function(_0x391633){if(_0x391633){var _0x3dbba1=typeof _0xea6c4[_0xdeff('0x20')]==='undefined'&&typeof _0xea6c4['limit']===_0xdeff('0x21');var _0x4cf724=_0x391633['count'];var _0x35635f=_0x3dbba1?0x0:_0xea6c4[_0xdeff('0x20')];var _0x4b14b6=_0x3dbba1?_0x391633[_0xdeff('0x22')]:_0xea6c4[_0xdeff('0x20')]+_0xea6c4[_0xdeff('0x23')];var _0x3a677a;if(_0x4b14b6>=_0x4cf724){_0x4b14b6=_0x4cf724;_0x3a677a=0xc8;}else{_0x3a677a=0xce;}_0x314ded[_0xdeff('0x24')](_0x3a677a);return _0x314ded[_0xdeff('0x25')](_0xdeff('0x26'),_0x35635f+'-'+_0x4b14b6+'/'+_0x4cf724)[_0xdeff('0x1f')](_0x391633);}return null;};}function patchUpdates(_0x488faa){return function(_0x5591fa){try{jsonpatch['apply'](_0x5591fa,_0x488faa,!![]);}catch(_0x2f3fd6){return BPromise['reject'](_0x2f3fd6);}return _0x5591fa[_0xdeff('0x27')]();};}function saveUpdates(_0x91c0b4,_0x543653){return function(_0x18338c){if(_0x18338c){return _0x18338c[_0xdeff('0x28')](_0x91c0b4)['then'](function(_0x5dbe96){return _0x5dbe96;});}return null;};}function removeEntity(_0x3b2554,_0x15c425){return function(_0x253eed){if(_0x253eed){return _0x253eed[_0xdeff('0x29')]()[_0xdeff('0x2a')](function(){_0x3b2554['status'](0xcc)[_0xdeff('0x1e')]();});}};}function handleEntityNotFound(_0x412db3,_0x3741fb){return function(_0x393659){if(!_0x393659){_0x412db3[_0xdeff('0x2b')](0x194);}return _0x393659;};}function handleError(_0x35823c,_0x3d0111){_0x3d0111=_0x3d0111||0x1f4;return function(_0x52ea5d){logger[_0xdeff('0x2c')](_0x52ea5d[_0xdeff('0x2d')]);if(_0x52ea5d['name']){delete _0x52ea5d['name'];}_0x35823c[_0xdeff('0x24')](_0x3d0111)[_0xdeff('0x2e')](_0x52ea5d);};}exports[_0xdeff('0x2f')]=function(_0xcb819c,_0x533069){var _0xf9b278={},_0xbc75ee={},_0x4e0ff2={'count':0x0,'rows':[]};var _0x331ddc=_[_0xdeff('0x30')](db[_0xdeff('0x31')]['rawAttributes'],function(_0x59f7a0){return{'name':_0x59f7a0[_0xdeff('0x32')],'type':_0x59f7a0['type'][_0xdeff('0x33')]};});_0xbc75ee[_0xdeff('0x34')]=_[_0xdeff('0x30')](_0x331ddc,'name');_0xbc75ee[_0xdeff('0x35')]=_['keys'](_0xcb819c['query']);_0xbc75ee[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0xbc75ee[_0xdeff('0x34')],_0xbc75ee[_0xdeff('0x35')]);_0xf9b278['attributes']=_[_0xdeff('0x37')](_0xbc75ee[_0xdeff('0x34')],qs[_0xdeff('0x38')](_0xcb819c[_0xdeff('0x35')][_0xdeff('0x38')]));_0xf9b278[_0xdeff('0x39')]=_0xf9b278[_0xdeff('0x39')]['length']?_0xf9b278[_0xdeff('0x39')]:_0xbc75ee['model'];if(!_0xcb819c[_0xdeff('0x35')][_0xdeff('0x3a')](_0xdeff('0x3b'))){_0xf9b278[_0xdeff('0x23')]=qs[_0xdeff('0x23')](_0xcb819c[_0xdeff('0x35')]['limit']);_0xf9b278[_0xdeff('0x20')]=qs[_0xdeff('0x20')](_0xcb819c['query'][_0xdeff('0x20')]);}_0xf9b278[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_0xcb819c[_0xdeff('0x35')][_0xdeff('0x3d')]);_0xf9b278[_0xdeff('0x3e')]=qs[_0xdeff('0x36')](_[_0xdeff('0x3f')](_0xcb819c['query'],_0xbc75ee[_0xdeff('0x36')]),_0x331ddc);if(_0xcb819c['query'][_0xdeff('0x40')]){_0xf9b278[_0xdeff('0x3e')]=_[_0xdeff('0x41')](_0xf9b278['where'],{'$or':_[_0xdeff('0x30')](_0x331ddc,function(_0x280a86){if(_0x280a86[_0xdeff('0x42')]!==_0xdeff('0x43')){var _0x226028={};_0x226028[_0x280a86['name']]={'$like':'%'+_0xcb819c[_0xdeff('0x35')]['filter']+'%'};return _0x226028;}})});}_0xf9b278=_[_0xdeff('0x41')]({},_0xf9b278,_0xcb819c[_0xdeff('0x44')]);var _0x518280={'where':_0xf9b278[_0xdeff('0x3e')]};return db[_0xdeff('0x31')][_0xdeff('0x22')](_0x518280)[_0xdeff('0x2a')](function(_0x3e2be3){_0x4e0ff2['count']=_0x3e2be3;if(_0xcb819c[_0xdeff('0x35')][_0xdeff('0x45')]){_0xf9b278[_0xdeff('0x46')]=[{'all':!![]}];}return db[_0xdeff('0x31')][_0xdeff('0x47')](_0xf9b278);})['then'](function(_0x5f1110){_0x4e0ff2[_0xdeff('0x48')]=_0x5f1110;return _0x4e0ff2;})[_0xdeff('0x2a')](respondWithFilteredResult(_0x533069,_0xf9b278))[_0xdeff('0x49')](handleError(_0x533069,null));};exports[_0xdeff('0x4a')]=function(_0x3c4fd2,_0x289f70){var _0x2cd68a={'raw':![],'where':{'id':_0x3c4fd2[_0xdeff('0x4b')]['id']}},_0x4f02f5={};_0x4f02f5[_0xdeff('0x34')]=_[_0xdeff('0x4c')](db['ZendeskAccount'][_0xdeff('0x4d')]);_0x4f02f5[_0xdeff('0x35')]=_[_0xdeff('0x4c')](_0x3c4fd2[_0xdeff('0x35')]);_0x4f02f5['filters']=_[_0xdeff('0x37')](_0x4f02f5[_0xdeff('0x34')],_0x4f02f5[_0xdeff('0x35')]);_0x2cd68a[_0xdeff('0x39')]=_[_0xdeff('0x37')](_0x4f02f5[_0xdeff('0x34')],qs[_0xdeff('0x38')](_0x3c4fd2[_0xdeff('0x35')]['fields']));_0x2cd68a[_0xdeff('0x39')]=_0x2cd68a[_0xdeff('0x39')][_0xdeff('0x4e')]?_0x2cd68a[_0xdeff('0x39')]:_0x4f02f5[_0xdeff('0x34')];if(_0x3c4fd2['query'][_0xdeff('0x45')]){_0x2cd68a[_0xdeff('0x46')]=[{'all':!![]}];}_0x2cd68a=_[_0xdeff('0x41')]({},_0x2cd68a,_0x3c4fd2[_0xdeff('0x44')]);return db[_0xdeff('0x31')]['find'](_0x2cd68a)[_0xdeff('0x2a')](handleEntityNotFound(_0x289f70,null))['then'](respondWithResult(_0x289f70,null))[_0xdeff('0x49')](handleError(_0x289f70,null));};exports[_0xdeff('0x4f')]=function(_0x1bf17c,_0x46c428){return db[_0xdeff('0x31')][_0xdeff('0x4f')](_0x1bf17c['body'],{})['then'](respondWithResult(_0x46c428,0xc9))[_0xdeff('0x49')](handleError(_0x46c428,null));};exports[_0xdeff('0x28')]=function(_0x3dc206,_0x49de92){if(_0x3dc206['body']['id']){delete _0x3dc206[_0xdeff('0x50')]['id'];}return db[_0xdeff('0x31')]['find']({'where':{'id':_0x3dc206[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0x49de92,null))[_0xdeff('0x2a')](saveUpdates(_0x3dc206['body'],null))[_0xdeff('0x2a')](respondWithResult(_0x49de92,null))[_0xdeff('0x49')](handleError(_0x49de92,null));};exports[_0xdeff('0x29')]=function(_0x59ae32,_0xce8379){return db[_0xdeff('0x31')][_0xdeff('0x51')]({'where':{'id':_0x59ae32[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0xce8379,null))[_0xdeff('0x2a')](removeEntity(_0xce8379,null))[_0xdeff('0x49')](handleError(_0xce8379,null));};exports['getConfigurations']=function(_0x4517d1,_0x1b90a9,_0x5e0c60){var _0xe5a773={};var _0x1b676b={};var _0x2967b4;var _0x33482b;return db[_0xdeff('0x31')][_0xdeff('0x52')]({'where':{'id':_0x4517d1[_0xdeff('0x4b')]['id']}})[_0xdeff('0x2a')](handleEntityNotFound(_0x1b90a9,null))['then'](function(_0x1b7eb3){if(_0x1b7eb3){_0x2967b4=_0x1b7eb3;_0x1b676b[_0xdeff('0x34')]=_[_0xdeff('0x4c')](db['ZendeskConfiguration']['rawAttributes']);_0x1b676b[_0xdeff('0x35')]=_[_0xdeff('0x4c')](_0x4517d1[_0xdeff('0x35')]);_0x1b676b[_0xdeff('0x36')]=_[_0xdeff('0x37')](_0x1b676b[_0xdeff('0x34')],_0x1b676b['query']);_0xe5a773['attributes']=_[_0xdeff('0x37')](_0x1b676b[_0xdeff('0x34')],qs['fields'](_0x4517d1['query'][_0xdeff('0x38')]));_0xe5a773[_0xdeff('0x39')]=_0xe5a773['attributes'][_0xdeff('0x4e')]?_0xe5a773[_0xdeff('0x39')]:_0x1b676b['model'];_0xe5a773[_0xdeff('0x3c')]=qs[_0xdeff('0x3d')](_0x4517d1['query'][_0xdeff('0x3d')]);_0xe5a773[_0xdeff('0x3e')]=qs['filters'](_[_0xdeff('0x3f')](_0x4517d1[_0xdeff('0x35')],_0x1b676b[_0xdeff('0x36')]));if(_0x4517d1['query']['filter']){_0xe5a773[_0xdeff('0x3e')]=_['merge'](_0xe5a773[_0xdeff('0x3e')],{'$or':_[_0xdeff('0x30')](_0xe5a773[_0xdeff('0x39')],function(_0x34d033){var _0x300955={};_0x300955[_0x34d033]={'$like':'%'+_0x4517d1['query']['filter']+'%'};return _0x300955;})});}_0xe5a773=_[_0xdeff('0x41')]({},_0xe5a773,_0x4517d1[_0xdeff('0x44')]);return _0x2967b4[_0xdeff('0x53')](_0xe5a773);}})[_0xdeff('0x2a')](function(_0x106976){if(_0x106976){_0x33482b=_0x106976[_0xdeff('0x4e')];if(!_0x4517d1['query'][_0xdeff('0x3a')]('nolimit')){_0xe5a773[_0xdeff('0x23')]=qs[_0xdeff('0x23')](_0x4517d1[_0xdeff('0x35')][_0xdeff('0x23')]);_0xe5a773[_0xdeff('0x20')]=qs[_0xdeff('0x20')](_0x4517d1[_0xdeff('0x35')][_0xdeff('0x20')]);}return _0x2967b4[_0xdeff('0x53')](_0xe5a773);}})['then'](function(_0x43f74){if(_0x43f74){return _0x43f74?{'count':_0x33482b,'rows':_0x43f74}:null;}})['then'](respondWithResult(_0x1b90a9,null))[_0xdeff('0x49')](handleError(_0x1b90a9,null));};exports[_0xdeff('0x54')]=function(_0x5a51d4,_0x286e4d,_0x492372){if(_0x5a51d4[_0xdeff('0x50')]['id']){delete _0x5a51d4['body']['id'];}return db['ZendeskAccount'][_0xdeff('0x52')]({'where':{'id':_0x5a51d4[_0xdeff('0x4b')]['id']}})['then'](handleEntityNotFound(_0x286e4d,null))[_0xdeff('0x2a')](function(_0x196e90){if(_0x196e90){_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x55')]=_0x196e90['id'];_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x56')]=integrations[_0xdeff('0x57')](_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x58')],_0x5a51d4['body'][_0xdeff('0x42')]);_0x5a51d4[_0xdeff('0x50')]['Descriptions']=integrations['getDescriptions'](_0x5a51d4[_0xdeff('0x50')][_0xdeff('0x58')],_0x5a51d4['body'][_0xdeff('0x42')]);return db[_0xdeff('0x59')][_0xdeff('0x4f')](_0x5a51d4[_0xdeff('0x50')],{'include':[{'model':db[_0xdeff('0x5a')],'as':_0xdeff('0x56')},{'model':db[_0xdeff('0x5a')],'as':_0xdeff('0x5b')}]});}return null;})[_0xdeff('0x2a')](respondWithResult(_0x286e4d,null))[_0xdeff('0x49')](handleError(_0x286e4d,null));};exports['getFields']=function(_0x221af0,_0x169145,_0x190191){var _0x44bad3='';return db[_0xdeff('0x31')]['findOne']({'where':{'id':_0x221af0['params']['id']},'attributes':['id','username',_0xdeff('0x5c'),_0xdeff('0x5d'),_0xdeff('0x5e'),_0xdeff('0x5f')]})['then'](handleEntityNotFound(_0x169145,null))['then'](function(_0x19de80){if(_0x19de80){_0x44bad3=_0x19de80[_0xdeff('0x5f')];var _0x46e1d5=_0x44bad3[_0xdeff('0x60')](-0x1);if(_0x46e1d5==='/'){_0x44bad3=_0x44bad3[_0xdeff('0x61')](0x0,_0x44bad3[_0xdeff('0x62')](_0x46e1d5));}var _0x1eb1a3={'method':_0xdeff('0x63'),'uri':util['format'](_0xdeff('0x64'),_0x44bad3,_0xdeff('0x65')),'json':!![]};switch(_0x19de80[_0xdeff('0x5e')]){case _0xdeff('0x5c'):_0x1eb1a3[_0xdeff('0x66')]={'Authorization':util[_0xdeff('0x67')](_0xdeff('0x68'),new Buffer(util[_0xdeff('0x67')](_0xdeff('0x69'),_0x19de80[_0xdeff('0x6a')],_0x19de80[_0xdeff('0x5c')]))[_0xdeff('0x6b')]('base64'))};break;case _0xdeff('0x5d'):_0x1eb1a3[_0xdeff('0x66')]={'Authorization':util[_0xdeff('0x67')]('Basic\x20%s',new Buffer(util[_0xdeff('0x67')](_0xdeff('0x6c'),_0x19de80[_0xdeff('0x6a')],_0x19de80[_0xdeff('0x5d')]))['toString'](_0xdeff('0x6d')))};break;default:throw new db[(_0xdeff('0x6e'))]['ValidationError'](_0xdeff('0x6f'));}return rp(_0x1eb1a3);}})[_0xdeff('0x2a')](function(_0x1430e8){if(_0x1430e8){var _0x1cc1d3=[_0xdeff('0x70'),'description',_0xdeff('0x71'),_0xdeff('0x72')];_[_0xdeff('0x73')](_0x1430e8[_0xdeff('0x65')],function(_0xe85561){return _0x1cc1d3['includes'](_0xe85561[_0xdeff('0x42')]);});return{'count':_0x1430e8[_0xdeff('0x65')]['length'],'rows':_[_0xdeff('0x30')](_0x1430e8[_0xdeff('0x65')],function(_0x1fe603){return{'id':_0x1fe603['id'],'name':_0x1fe603['position']>0x7?_0x1fe603[_0xdeff('0x74')]:_0x1fe603[_0xdeff('0x42')],'custom':_0x1fe603['position']>0x7?!![]:![],'options':_0x1fe603[_0xdeff('0x75')]?_0x1fe603[_0xdeff('0x75')]:_0x1fe603[_0xdeff('0x76')]?_0x1fe603[_0xdeff('0x76')]:[]};})};}})['then'](respondWithResult(_0x169145,null))[_0xdeff('0x49')](function(_0x3b8f20){var _0x14a77f=_0x221af0[_0xdeff('0x35')][_0xdeff('0x77')]?0x1f4:_0x3b8f20[_0xdeff('0x78')]||0x1f4;logger[_0xdeff('0x2c')](_0xdeff('0x79'),_0xdeff('0x7a'),_0x14a77f,JSON['stringify'](_0x3b8f20));delete _0x3b8f20[_0xdeff('0x7b')];if(_0x14a77f===0x191){_0x14a77f=0x190;}_0x169145['status'](_0x14a77f)[_0xdeff('0x2e')](_0x221af0['query']['test']?{'message':_0xdeff('0x7c'),'statusCode':_0x3b8f20[_0xdeff('0x78')]}:_0x3b8f20);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index dca2730..d7a6e28 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 _0x0b7c=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3e0afa,_0xc68abb){var _0x1ae2e2=function(_0x1eda4e){while(--_0x1eda4e){_0x3e0afa['push'](_0x3e0afa['shift']());}};_0x1ae2e2(++_0xc68abb);}(_0x0b7c,0x1ac));var _0xc0b7=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x0b7c[_0x234ce7];return _0x57c561;};'use strict';var _=require('lodash');var util=require(_0xc0b7('0x0'));var logger=require(_0xc0b7('0x1'))(_0xc0b7('0x2'));var moment=require(_0xc0b7('0x3'));var BPromise=require(_0xc0b7('0x4'));var rp=require(_0xc0b7('0x5'));var fs=require('fs');var path=require(_0xc0b7('0x6'));var rimraf=require(_0xc0b7('0x7'));var config=require(_0xc0b7('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xc0b7('0x9'));module[_0xc0b7('0xa')]=function(_0x42fcba,_0x50d99b){return _0x42fcba[_0xc0b7('0xb')](_0xc0b7('0xc'),attributes,{'tableName':_0xc0b7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb68=['moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','../../config/logger','api'];(function(_0x3b4f45,_0x1661db){var _0xb725ae=function(_0x277895){while(--_0x277895){_0x3b4f45['push'](_0x3b4f45['shift']());}};_0xb725ae(++_0x1661db);}(_0xfb68,0xc0));var _0x8fb6=function(_0x48e2e1,_0xb5ed3f){_0x48e2e1=_0x48e2e1-0x0;var _0x5c19eb=_0xfb68[_0x48e2e1];return _0x5c19eb;};'use strict';var _=require(_0x8fb6('0x0'));var util=require('util');var logger=require(_0x8fb6('0x1'))(_0x8fb6('0x2'));var moment=require(_0x8fb6('0x3'));var BPromise=require(_0x8fb6('0x4'));var rp=require(_0x8fb6('0x5'));var fs=require('fs');var path=require(_0x8fb6('0x6'));var rimraf=require(_0x8fb6('0x7'));var config=require(_0x8fb6('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x8fb6('0x9'));module[_0x8fb6('0xa')]=function(_0x2a1971,_0x477143){return _0x2a1971[_0x8fb6('0xb')]('ZendeskAccount',attributes,{'tableName':_0x8fb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index bed5be4..75f3ef8 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 _0xb658=['model','debug','ShowZendeskAccount','ZendeskAccount','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','catch','GetZendeskAccount','findAll','options','where','attributes','include','map'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0xb658,0x15a));var _0x8b65=function(_0x11a8a8,_0x3852b9){_0x11a8a8=_0x11a8a8-0x0;var _0x2b7e70=_0xb658[_0x11a8a8];return _0x2b7e70;};'use strict';var _=require(_0x8b65('0x0'));var util=require('util');var moment=require(_0x8b65('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b65('0x2'));var fs=require('fs');var Redis=require(_0x8b65('0x3'));var db=require(_0x8b65('0x4'))['db'];var utils=require(_0x8b65('0x5'));var logger=require(_0x8b65('0x6'))(_0x8b65('0x7'));var config=require('../../config/environment');var jayson=require(_0x8b65('0x8'));var client=jayson['client'][_0x8b65('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5dccd1,_0x2c725e,_0x402f47){return new BPromise(function(_0x3f6b11,_0x22fe59){return client[_0x8b65('0xa')](_0x5dccd1,_0x402f47)[_0x8b65('0xb')](function(_0xc2192f){logger[_0x8b65('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x2c725e,'request\x20sent');logger['debug'](_0x8b65('0xd'),_0x2c725e,'request\x20sent',JSON[_0x8b65('0xe')](_0xc2192f));if(_0xc2192f[_0x8b65('0xf')]){if(_0xc2192f['error'][_0x8b65('0x10')]===0x1f4){logger[_0x8b65('0xf')](_0x8b65('0x11'),_0x2c725e,_0xc2192f['error'][_0x8b65('0x12')]);return _0x22fe59(_0xc2192f[_0x8b65('0xf')]['message']);}logger[_0x8b65('0xf')](_0x8b65('0x11'),_0x2c725e,_0xc2192f['error'][_0x8b65('0x12')]);return _0x3f6b11(_0xc2192f[_0x8b65('0xf')]['message']);}else{logger['info'](_0x8b65('0x11'),_0x2c725e,_0x8b65('0x13'));_0x3f6b11(_0xc2192f['result']['message']);}})[_0x8b65('0x14')](function(_0x5a6275){logger[_0x8b65('0xf')](_0x8b65('0x11'),_0x2c725e,_0x5a6275);_0x22fe59(_0x5a6275);});});}exports[_0x8b65('0x15')]=function(_0x355397){var _0x15227=this;return new Promise(function(_0x5b5b8b,_0x882970){return db['ZendeskAccount'][_0x8b65('0x16')]({'raw':_0x355397[_0x8b65('0x17')]?_0x355397[_0x8b65('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x355397[_0x8b65('0x17')]?_0x355397[_0x8b65('0x17')][_0x8b65('0x18')]||null:null,'attributes':_0x355397[_0x8b65('0x17')]?_0x355397[_0x8b65('0x17')][_0x8b65('0x19')]||null:null,'limit':_0x355397[_0x8b65('0x17')]?_0x355397['options']['limit']||null:null,'include':_0x355397[_0x8b65('0x17')]?_0x355397[_0x8b65('0x17')][_0x8b65('0x1a')]?_[_0x8b65('0x1b')](_0x355397[_0x8b65('0x17')][_0x8b65('0x1a')],function(_0x4bd194){return{'model':db[_0x4bd194[_0x8b65('0x1c')]],'as':_0x4bd194['as'],'attributes':_0x4bd194[_0x8b65('0x19')],'include':_0x4bd194[_0x8b65('0x1a')]?_[_0x8b65('0x1b')](_0x4bd194[_0x8b65('0x1a')],function(_0x47b4ca){return{'model':db[_0x47b4ca[_0x8b65('0x1c')]],'as':_0x47b4ca['as'],'attributes':_0x47b4ca[_0x8b65('0x19')],'include':_0x47b4ca[_0x8b65('0x1a')]?_['map'](_0x47b4ca[_0x8b65('0x1a')],function(_0x4c84b4){return{'model':db[_0x4c84b4['model']],'as':_0x4c84b4['as'],'attributes':_0x4c84b4[_0x8b65('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8b65('0xb')](function(_0x194bf8){logger[_0x8b65('0xc')](_0x8b65('0x15'),_0x355397);logger[_0x8b65('0x1d')](_0x8b65('0x15'),_0x355397,JSON[_0x8b65('0xe')](_0x194bf8));_0x5b5b8b(_0x194bf8);})['catch'](function(_0xbeef8c){logger[_0x8b65('0xf')](_0x8b65('0x15'),_0xbeef8c[_0x8b65('0x12')],_0x355397);_0x882970(_0x15227[_0x8b65('0xf')](0x1f4,_0xbeef8c['message']));});});};exports[_0x8b65('0x1e')]=function(_0x1fe749){var _0x146d7c=this;return new Promise(function(_0x1c6977,_0x5baf7e){return db[_0x8b65('0x1f')][_0x8b65('0x20')]({'raw':_0x1fe749[_0x8b65('0x17')]?_0x1fe749[_0x8b65('0x17')][_0x8b65('0x21')]===undefined?!![]:![]:!![],'where':_0x1fe749[_0x8b65('0x17')]?_0x1fe749[_0x8b65('0x17')]['where']||null:null,'attributes':_0x1fe749[_0x8b65('0x17')]?_0x1fe749[_0x8b65('0x17')]['attributes']||null:null,'include':_0x1fe749[_0x8b65('0x17')]?_0x1fe749[_0x8b65('0x17')][_0x8b65('0x1a')]?_[_0x8b65('0x1b')](_0x1fe749[_0x8b65('0x17')][_0x8b65('0x1a')],function(_0x33f348){return{'model':db[_0x33f348[_0x8b65('0x1c')]],'as':_0x33f348['as'],'attributes':_0x33f348[_0x8b65('0x19')],'include':_0x33f348['include']?_[_0x8b65('0x1b')](_0x33f348[_0x8b65('0x1a')],function(_0x1a8342){return{'model':db[_0x1a8342[_0x8b65('0x1c')]],'as':_0x1a8342['as'],'attributes':_0x1a8342['attributes'],'include':_0x1a8342['include']?_['map'](_0x1a8342[_0x8b65('0x1a')],function(_0x3e4be6){return{'model':db[_0x3e4be6[_0x8b65('0x1c')]],'as':_0x3e4be6['as'],'attributes':_0x3e4be6[_0x8b65('0x19')]};}):[]};}):[]};}):[]:[]})[_0x8b65('0xb')](function(_0x15d90d){logger[_0x8b65('0xc')](_0x8b65('0x1e'),_0x1fe749);logger[_0x8b65('0x1d')]('ShowZendeskAccount',_0x1fe749,JSON['stringify'](_0x15d90d));_0x1c6977(_0x15d90d);})[_0x8b65('0x14')](function(_0x42989b){logger['error']('ShowZendeskAccount',_0x42989b[_0x8b65('0x12')],_0x1fe749);_0x5baf7e(_0x146d7c[_0x8b65('0xf')](0x1f4,_0x42989b['message']));});});}; \ No newline at end of file +var _0xed48=['result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetZendeskAccount','ShowZendeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0xed48,0x176));var _0x8ed4=function(_0x3f9ac2,_0x1b670b){_0x3f9ac2=_0x3f9ac2-0x0;var _0xe6a436=_0xed48[_0x3f9ac2];return _0xe6a436;};'use strict';var _=require(_0x8ed4('0x0'));var util=require(_0x8ed4('0x1'));var moment=require('moment');var BPromise=require(_0x8ed4('0x2'));var rs=require(_0x8ed4('0x3'));var fs=require('fs');var Redis=require(_0x8ed4('0x4'));var db=require(_0x8ed4('0x5'))['db'];var utils=require(_0x8ed4('0x6'));var logger=require('../../config/logger')(_0x8ed4('0x7'));var config=require(_0x8ed4('0x8'));var jayson=require(_0x8ed4('0x9'));var client=jayson[_0x8ed4('0xa')][_0x8ed4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x196d77,_0x1c7326,_0x3eebe9){return new BPromise(function(_0x51d223,_0x46cebb){return client[_0x8ed4('0xc')](_0x196d77,_0x3eebe9)[_0x8ed4('0xd')](function(_0x398983){logger['info'](_0x8ed4('0xe'),_0x1c7326,_0x8ed4('0xf'));logger[_0x8ed4('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x1c7326,_0x8ed4('0xf'),JSON[_0x8ed4('0x11')](_0x398983));if(_0x398983[_0x8ed4('0x12')]){if(_0x398983['error'][_0x8ed4('0x13')]===0x1f4){logger[_0x8ed4('0x12')](_0x8ed4('0xe'),_0x1c7326,_0x398983[_0x8ed4('0x12')]['message']);return _0x46cebb(_0x398983[_0x8ed4('0x12')][_0x8ed4('0x14')]);}logger[_0x8ed4('0x12')](_0x8ed4('0xe'),_0x1c7326,_0x398983[_0x8ed4('0x12')]['message']);return _0x51d223(_0x398983['error']['message']);}else{logger[_0x8ed4('0x15')](_0x8ed4('0xe'),_0x1c7326,_0x8ed4('0xf'));_0x51d223(_0x398983[_0x8ed4('0x16')][_0x8ed4('0x14')]);}})[_0x8ed4('0x17')](function(_0x5f45ca){logger[_0x8ed4('0x12')](_0x8ed4('0xe'),_0x1c7326,_0x5f45ca);_0x46cebb(_0x5f45ca);});});}exports['GetZendeskAccount']=function(_0x28f775){var _0x38cce4=this;return new Promise(function(_0x7a606d,_0x7644d2){return db['ZendeskAccount'][_0x8ed4('0x18')]({'raw':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1a')]===undefined?!![]:![]:!![],'where':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1b')]||null:null,'attributes':_0x28f775[_0x8ed4('0x19')]?_0x28f775['options'][_0x8ed4('0x1c')]||null:null,'limit':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1d')]||null:null,'include':_0x28f775[_0x8ed4('0x19')]?_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x28f775[_0x8ed4('0x19')][_0x8ed4('0x1e')],function(_0x19b966){return{'model':db[_0x19b966[_0x8ed4('0x20')]],'as':_0x19b966['as'],'attributes':_0x19b966['attributes'],'include':_0x19b966['include']?_['map'](_0x19b966[_0x8ed4('0x1e')],function(_0x404167){return{'model':db[_0x404167[_0x8ed4('0x20')]],'as':_0x404167['as'],'attributes':_0x404167[_0x8ed4('0x1c')],'include':_0x404167[_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x404167[_0x8ed4('0x1e')],function(_0x5a1f70){return{'model':db[_0x5a1f70['model']],'as':_0x5a1f70['as'],'attributes':_0x5a1f70['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x46acaf){logger[_0x8ed4('0x15')](_0x8ed4('0x21'),_0x28f775);logger[_0x8ed4('0x10')](_0x8ed4('0x21'),_0x28f775,JSON[_0x8ed4('0x11')](_0x46acaf));_0x7a606d(_0x46acaf);})[_0x8ed4('0x17')](function(_0x29b578){logger[_0x8ed4('0x12')](_0x8ed4('0x21'),_0x29b578[_0x8ed4('0x14')],_0x28f775);_0x7644d2(_0x38cce4[_0x8ed4('0x12')](0x1f4,_0x29b578['message']));});});};exports[_0x8ed4('0x22')]=function(_0x10785a){var _0x31507f=this;return new Promise(function(_0x4cbad3,_0xf41044){return db['ZendeskAccount'][_0x8ed4('0x23')]({'raw':_0x10785a[_0x8ed4('0x19')]?_0x10785a[_0x8ed4('0x19')][_0x8ed4('0x1a')]===undefined?!![]:![]:!![],'where':_0x10785a['options']?_0x10785a[_0x8ed4('0x19')][_0x8ed4('0x1b')]||null:null,'attributes':_0x10785a[_0x8ed4('0x19')]?_0x10785a['options'][_0x8ed4('0x1c')]||null:null,'include':_0x10785a[_0x8ed4('0x19')]?_0x10785a['options'][_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x10785a[_0x8ed4('0x19')]['include'],function(_0x367e85){return{'model':db[_0x367e85[_0x8ed4('0x20')]],'as':_0x367e85['as'],'attributes':_0x367e85[_0x8ed4('0x1c')],'include':_0x367e85[_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x367e85[_0x8ed4('0x1e')],function(_0x85a246){return{'model':db[_0x85a246[_0x8ed4('0x20')]],'as':_0x85a246['as'],'attributes':_0x85a246[_0x8ed4('0x1c')],'include':_0x85a246[_0x8ed4('0x1e')]?_[_0x8ed4('0x1f')](_0x85a246['include'],function(_0x56cd6c){return{'model':db[_0x56cd6c[_0x8ed4('0x20')]],'as':_0x56cd6c['as'],'attributes':_0x56cd6c[_0x8ed4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x255898){logger['info'](_0x8ed4('0x22'),_0x10785a);logger[_0x8ed4('0x10')]('ShowZendeskAccount',_0x10785a,JSON[_0x8ed4('0x11')](_0x255898));_0x4cbad3(_0x255898);})[_0x8ed4('0x17')](function(_0x3572e8){logger['error'](_0x8ed4('0x22'),_0x3572e8[_0x8ed4('0x14')],_0x10785a);_0xf41044(_0x31507f[_0x8ed4('0x12')](0x1f4,_0x3572e8[_0x8ed4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2588ba1..6e684c7 100644 --- a/server/api/intZendeskConfiguration/index.js +++ b/server/api/intZendeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36ee=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','update','delete','destroy','exports','path','express'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x36ee,0xe8));var _0xe36e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x36ee[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36e('0x0'));var timeout=require('connect-timeout');var express=require(_0xe36e('0x1'));var router=express[_0xe36e('0x2')]();var fs_extra=require(_0xe36e('0x3'));var auth=require(_0xe36e('0x4'));var interaction=require(_0xe36e('0x5'));var config=require(_0xe36e('0x6'));var controller=require(_0xe36e('0x7'));router[_0xe36e('0x8')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0xa')]);router[_0xe36e('0x8')](_0xe36e('0xb'),auth['isAuthenticated'](),controller[_0xe36e('0xc')]);router['get'](_0xe36e('0xd'),auth[_0xe36e('0x9')](),controller[_0xe36e('0xe')]);router['get'](_0xe36e('0xf'),auth['isAuthenticated'](),controller[_0xe36e('0x10')]);router[_0xe36e('0x8')](_0xe36e('0x11'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x12')]);router[_0xe36e('0x8')](_0xe36e('0x13'),auth[_0xe36e('0x9')](),controller['getTags']);router[_0xe36e('0x14')]('/',auth[_0xe36e('0x9')](),controller[_0xe36e('0x15')]);router[_0xe36e('0x14')]('/:id/tags',auth[_0xe36e('0x9')](),controller['setTags']);router['put'](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x16')]);router[_0xe36e('0x17')](_0xe36e('0xb'),auth[_0xe36e('0x9')](),controller[_0xe36e('0x18')]);module[_0xe36e('0x19')]=router; \ No newline at end of file +var _0xb7e7=['delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','put','update'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0xb7e7[_0x424a9a];return _0xa7831c;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0x8')](_0x7b7e('0xb'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0x8')](_0x7b7e('0xe'),auth['isAuthenticated'](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x8')](_0x7b7e('0x10'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x8')](_0x7b7e('0x12'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x13')]);router['post']('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x14')]);router['post'](_0x7b7e('0x12'),auth['isAuthenticated'](),controller['setTags']);router[_0x7b7e('0x15')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x16')]);router[_0x7b7e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x7b7e('0x18')]);module[_0x7b7e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index daf112a..9590a27 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 _0x86ec=['STRING','exports'];(function(_0x1e1dbe,_0x281ab8){var _0x47a25b=function(_0x346265){while(--_0x346265){_0x1e1dbe['push'](_0x1e1dbe['shift']());}};_0x47a25b(++_0x281ab8);}(_0x86ec,0xd5));var _0xc86e=function(_0x574ff5,_0x53bd54){_0x574ff5=_0x574ff5-0x0;var _0x449e2d=_0x86ec[_0x574ff5];return _0x449e2d;};'use strict';var Sequelize=require('sequelize');module[_0xc86e('0x0')]={'name':{'type':Sequelize[_0xc86e('0x1')]},'description':{'type':Sequelize[_0xc86e('0x1')]}}; \ No newline at end of file +var _0x2cc5=['STRING'];(function(_0xa4928c,_0x16b89c){var _0x27cc29=function(_0x14b819){while(--_0x14b819){_0xa4928c['push'](_0xa4928c['shift']());}};_0x27cc29(++_0x16b89c);}(_0x2cc5,0x182));var _0x52cc=function(_0x3b3fe4,_0x2ecb64){_0x3b3fe4=_0x3b3fe4-0x0;var _0x1158de=_0x2cc5[_0x3b3fe4];return _0x1158de;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x52cc('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 8345209..7bbbb81 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 _0x821d=['ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','ZendeskConfiguration','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','getFields','findOne','ZendeskField','getSubjects','order','getDescriptions','getTags','Tag','ids','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox'];(function(_0x486cbf,_0x3d9e95){var _0xe50206=function(_0x16cb6e){while(--_0x16cb6e){_0x486cbf['push'](_0x486cbf['shift']());}};_0xe50206(++_0x3d9e95);}(_0x821d,0x197));var _0xd821=function(_0x3bdf5a,_0x278b1c){_0x3bdf5a=_0x3bdf5a-0x0;var _0x5e7823=_0x821d[_0x3bdf5a];return _0x5e7823;};'use strict';var emlformat=require(_0xd821('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd821('0x1'));var jsonpatch=require(_0xd821('0x2'));var rp=require(_0xd821('0x3'));var moment=require('moment');var BPromise=require(_0xd821('0x4'));var Mustache=require(_0xd821('0x5'));var util=require('util');var path=require(_0xd821('0x6'));var sox=require(_0xd821('0x7'));var csv=require('to-csv');var ejs=require(_0xd821('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd821('0x9'));var squel=require(_0xd821('0xa'));var crypto=require('crypto');var jsforce=require(_0xd821('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd821('0xc'));var Papa=require(_0xd821('0xd'));var Redis=require(_0xd821('0xe'));var authService=require(_0xd821('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd821('0x10'));var hardwareService=require(_0xd821('0x11'));var logger=require('../../config/logger')(_0xd821('0x12'));var utils=require('../../config/utils');var config=require(_0xd821('0x13'));var licenseUtil=require(_0xd821('0x14'));var db=require(_0xd821('0x15'))['db'];function respondWithStatusCode(_0x4a010c,_0x1ac0c5){_0x1ac0c5=_0x1ac0c5||0xcc;return function(_0x5cbb37){if(_0x5cbb37){return _0x4a010c[_0xd821('0x16')](_0x1ac0c5);}return _0x4a010c[_0xd821('0x17')](_0x1ac0c5)[_0xd821('0x18')]();};}function respondWithResult(_0x46c91b,_0x2bb673){_0x2bb673=_0x2bb673||0xc8;return function(_0x12ad9d){if(_0x12ad9d){return _0x46c91b[_0xd821('0x17')](_0x2bb673)[_0xd821('0x19')](_0x12ad9d);}};}function respondWithFilteredResult(_0x55a99b,_0x5c37e5){return function(_0xf31d3f){if(_0xf31d3f){var _0x1ee904=typeof _0x5c37e5[_0xd821('0x1a')]===_0xd821('0x1b')&&typeof _0x5c37e5[_0xd821('0x1c')]==='undefined';var _0x3cfe67=_0xf31d3f[_0xd821('0x1d')];var _0xcbd6c5=_0x1ee904?0x0:_0x5c37e5[_0xd821('0x1a')];var _0x4d9574=_0x1ee904?_0xf31d3f[_0xd821('0x1d')]:_0x5c37e5[_0xd821('0x1a')]+_0x5c37e5[_0xd821('0x1c')];var _0x6b1661;if(_0x4d9574>=_0x3cfe67){_0x4d9574=_0x3cfe67;_0x6b1661=0xc8;}else{_0x6b1661=0xce;}_0x55a99b[_0xd821('0x17')](_0x6b1661);return _0x55a99b['set'](_0xd821('0x1e'),_0xcbd6c5+'-'+_0x4d9574+'/'+_0x3cfe67)[_0xd821('0x19')](_0xf31d3f);}return null;};}function patchUpdates(_0x120fe4){return function(_0xb50181){try{jsonpatch[_0xd821('0x1f')](_0xb50181,_0x120fe4,!![]);}catch(_0x2b1d5f){return BPromise[_0xd821('0x20')](_0x2b1d5f);}return _0xb50181[_0xd821('0x21')]();};}function saveUpdates(_0x1bc769,_0x553db6){return function(_0x531dd0){if(_0x531dd0){return _0x531dd0[_0xd821('0x22')](_0x1bc769)[_0xd821('0x23')](function(_0x1c531f){return _0x1c531f;});}return null;};}function removeEntity(_0xb9d2e8,_0x2b4bfb){return function(_0x2f2368){if(_0x2f2368){return _0x2f2368['destroy']()[_0xd821('0x23')](function(){_0xb9d2e8[_0xd821('0x17')](0xcc)[_0xd821('0x18')]();});}};}function handleEntityNotFound(_0x4d5b24,_0x16aaa7){return function(_0x3ee582){if(!_0x3ee582){_0x4d5b24[_0xd821('0x16')](0x194);}return _0x3ee582;};}function handleError(_0x2b6d0c,_0x3bf49b){_0x3bf49b=_0x3bf49b||0x1f4;return function(_0x13a5bb){logger[_0xd821('0x24')](_0x13a5bb[_0xd821('0x25')]);if(_0x13a5bb[_0xd821('0x26')]){delete _0x13a5bb[_0xd821('0x26')];}_0x2b6d0c[_0xd821('0x17')](_0x3bf49b)[_0xd821('0x27')](_0x13a5bb);};}exports['index']=function(_0x43f106,_0x397d99){var _0x5373bc={},_0x75df15={},_0x1b592a={'count':0x0,'rows':[]};var _0x90f37=_[_0xd821('0x28')](db['ZendeskConfiguration'][_0xd821('0x29')],function(_0x18fcaf){return{'name':_0x18fcaf[_0xd821('0x2a')],'type':_0x18fcaf['type'][_0xd821('0x2b')]};});_0x75df15[_0xd821('0x2c')]=_['map'](_0x90f37,'name');_0x75df15['query']=_[_0xd821('0x2d')](_0x43f106['query']);_0x75df15[_0xd821('0x2e')]=_[_0xd821('0x2f')](_0x75df15['model'],_0x75df15[_0xd821('0x30')]);_0x5373bc[_0xd821('0x31')]=_[_0xd821('0x2f')](_0x75df15['model'],qs[_0xd821('0x32')](_0x43f106[_0xd821('0x30')][_0xd821('0x32')]));_0x5373bc[_0xd821('0x31')]=_0x5373bc['attributes'][_0xd821('0x33')]?_0x5373bc[_0xd821('0x31')]:_0x75df15[_0xd821('0x2c')];if(!_0x43f106[_0xd821('0x30')][_0xd821('0x34')](_0xd821('0x35'))){_0x5373bc[_0xd821('0x1c')]=qs[_0xd821('0x1c')](_0x43f106[_0xd821('0x30')][_0xd821('0x1c')]);_0x5373bc['offset']=qs[_0xd821('0x1a')](_0x43f106[_0xd821('0x30')][_0xd821('0x1a')]);}_0x5373bc['order']=qs[_0xd821('0x36')](_0x43f106['query'][_0xd821('0x36')]);_0x5373bc[_0xd821('0x37')]=qs['filters'](_[_0xd821('0x38')](_0x43f106['query'],_0x75df15[_0xd821('0x2e')]),_0x90f37);if(_0x43f106[_0xd821('0x30')][_0xd821('0x39')]){_0x5373bc[_0xd821('0x37')]=_[_0xd821('0x3a')](_0x5373bc[_0xd821('0x37')],{'$or':_[_0xd821('0x28')](_0x90f37,function(_0x1933e7){if(_0x1933e7[_0xd821('0x3b')]!==_0xd821('0x3c')){var _0x2779ad={};_0x2779ad[_0x1933e7[_0xd821('0x26')]]={'$like':'%'+_0x43f106[_0xd821('0x30')]['filter']+'%'};return _0x2779ad;}})});}_0x5373bc=_[_0xd821('0x3a')]({},_0x5373bc,_0x43f106[_0xd821('0x3d')]);var _0x1e647f={'where':_0x5373bc['where']};return db[_0xd821('0x3e')][_0xd821('0x1d')](_0x1e647f)[_0xd821('0x23')](function(_0x593841){_0x1b592a[_0xd821('0x1d')]=_0x593841;if(_0x43f106[_0xd821('0x30')]['includeAll']){_0x5373bc[_0xd821('0x3f')]=[{'all':!![]}];}return db[_0xd821('0x3e')][_0xd821('0x40')](_0x5373bc);})[_0xd821('0x23')](function(_0xf37e5a){_0x1b592a[_0xd821('0x41')]=_0xf37e5a;return _0x1b592a;})[_0xd821('0x23')](respondWithFilteredResult(_0x397d99,_0x5373bc))[_0xd821('0x42')](handleError(_0x397d99,null));};exports[_0xd821('0x43')]=function(_0x4c1a6e,_0x5b4862){var _0x76a3f1={'raw':![],'where':{'id':_0x4c1a6e[_0xd821('0x44')]['id']}},_0x5e5c62={};_0x5e5c62['model']=_[_0xd821('0x2d')](db[_0xd821('0x3e')][_0xd821('0x29')]);_0x5e5c62[_0xd821('0x30')]=_[_0xd821('0x2d')](_0x4c1a6e['query']);_0x5e5c62['filters']=_[_0xd821('0x2f')](_0x5e5c62['model'],_0x5e5c62[_0xd821('0x30')]);_0x76a3f1[_0xd821('0x31')]=_[_0xd821('0x2f')](_0x5e5c62[_0xd821('0x2c')],qs[_0xd821('0x32')](_0x4c1a6e[_0xd821('0x30')][_0xd821('0x32')]));_0x76a3f1[_0xd821('0x31')]=_0x76a3f1[_0xd821('0x31')]['length']?_0x76a3f1[_0xd821('0x31')]:_0x5e5c62['model'];if(_0x4c1a6e[_0xd821('0x30')][_0xd821('0x45')]){_0x76a3f1[_0xd821('0x3f')]=[{'all':!![]}];}_0x76a3f1=_[_0xd821('0x3a')]({},_0x76a3f1,_0x4c1a6e[_0xd821('0x3d')]);return db['ZendeskConfiguration'][_0xd821('0x46')](_0x76a3f1)['then'](handleEntityNotFound(_0x5b4862,null))[_0xd821('0x23')](respondWithResult(_0x5b4862,null))[_0xd821('0x42')](handleError(_0x5b4862,null));};exports['create']=function(_0x13aaab,_0xbceeef){return db['ZendeskConfiguration'][_0xd821('0x47')](_0x13aaab[_0xd821('0x48')],{})[_0xd821('0x23')](respondWithResult(_0xbceeef,0xc9))[_0xd821('0x42')](handleError(_0xbceeef,null));};exports['update']=function(_0x2b07d5,_0xf78962){if(_0x2b07d5['body']['id']){delete _0x2b07d5[_0xd821('0x48')]['id'];}return db['ZendeskConfiguration'][_0xd821('0x46')]({'where':{'id':_0x2b07d5[_0xd821('0x44')]['id']}})[_0xd821('0x23')](handleEntityNotFound(_0xf78962,null))[_0xd821('0x23')](saveUpdates(_0x2b07d5[_0xd821('0x48')],null))[_0xd821('0x23')](respondWithResult(_0xf78962,null))[_0xd821('0x42')](handleError(_0xf78962,null));};exports[_0xd821('0x49')]=function(_0x3a6f94,_0x2f81e5){return db['ZendeskConfiguration']['find']({'where':{'id':_0x3a6f94[_0xd821('0x44')]['id']}})[_0xd821('0x23')](handleEntityNotFound(_0x2f81e5,null))[_0xd821('0x23')](removeEntity(_0x2f81e5,null))['catch'](handleError(_0x2f81e5,null));};exports[_0xd821('0x4a')]=function(_0xe5eb7d,_0x540e65,_0x42c9d8){var _0x18f283={};var _0x9b2737={};var _0x666028;var _0x2ca629;return db[_0xd821('0x3e')][_0xd821('0x4b')]({'where':{'id':_0xe5eb7d[_0xd821('0x44')]['id']}})[_0xd821('0x23')](handleEntityNotFound(_0x540e65,null))['then'](function(_0x2990a8){if(_0x2990a8){_0x666028=_0x2990a8;_0x9b2737[_0xd821('0x2c')]=_['keys'](db[_0xd821('0x4c')][_0xd821('0x29')]);_0x9b2737[_0xd821('0x30')]=_[_0xd821('0x2d')](_0xe5eb7d[_0xd821('0x30')]);_0x9b2737[_0xd821('0x2e')]=_[_0xd821('0x2f')](_0x9b2737[_0xd821('0x2c')],_0x9b2737[_0xd821('0x30')]);_0x18f283[_0xd821('0x31')]=_[_0xd821('0x2f')](_0x9b2737[_0xd821('0x2c')],qs[_0xd821('0x32')](_0xe5eb7d['query'][_0xd821('0x32')]));_0x18f283[_0xd821('0x31')]=_0x18f283['attributes'][_0xd821('0x33')]?_0x18f283[_0xd821('0x31')]:_0x9b2737['model'];_0x18f283['order']=qs[_0xd821('0x36')](_0xe5eb7d[_0xd821('0x30')][_0xd821('0x36')]);_0x18f283['where']=qs['filters'](_[_0xd821('0x38')](_0xe5eb7d[_0xd821('0x30')],_0x9b2737[_0xd821('0x2e')]));if(_0xe5eb7d[_0xd821('0x30')]['filter']){_0x18f283['where']=_[_0xd821('0x3a')](_0x18f283[_0xd821('0x37')],{'$or':_[_0xd821('0x28')](_0x18f283[_0xd821('0x31')],function(_0x897f3e){var _0x1627c7={};_0x1627c7[_0x897f3e]={'$like':'%'+_0xe5eb7d['query'][_0xd821('0x39')]+'%'};return _0x1627c7;})});}_0x18f283=_[_0xd821('0x3a')]({},_0x18f283,_0xe5eb7d[_0xd821('0x3d')]);return _0x666028[_0xd821('0x4a')](_0x18f283);}})['then'](function(_0x457bf7){if(_0x457bf7){_0x2ca629=_0x457bf7['length'];if(!_0xe5eb7d['query']['hasOwnProperty'](_0xd821('0x35'))){_0x18f283['limit']=qs[_0xd821('0x1c')](_0xe5eb7d['query'][_0xd821('0x1c')]);_0x18f283[_0xd821('0x1a')]=qs['offset'](_0xe5eb7d[_0xd821('0x30')][_0xd821('0x1a')]);}return _0x666028[_0xd821('0x4a')](_0x18f283);}})[_0xd821('0x23')](function(_0x7eac58){if(_0x7eac58){return _0x7eac58?{'count':_0x2ca629,'rows':_0x7eac58}:null;}})['then'](respondWithResult(_0x540e65,null))[_0xd821('0x42')](handleError(_0x540e65,null));};exports[_0xd821('0x4d')]=function(_0x3c37cb,_0x378788,_0x22f852){var _0x3370d9={};var _0x34b654={};var _0x2f3293;var _0xe4da0e;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x3c37cb['params']['id']}})[_0xd821('0x23')](handleEntityNotFound(_0x378788,null))[_0xd821('0x23')](function(_0x2b8663){if(_0x2b8663){_0x2f3293=_0x2b8663;_0x34b654['model']=_[_0xd821('0x2d')](db['ZendeskField'][_0xd821('0x29')]);_0x34b654[_0xd821('0x30')]=_[_0xd821('0x2d')](_0x3c37cb[_0xd821('0x30')]);_0x34b654['filters']=_[_0xd821('0x2f')](_0x34b654[_0xd821('0x2c')],_0x34b654[_0xd821('0x30')]);_0x3370d9['attributes']=_[_0xd821('0x2f')](_0x34b654[_0xd821('0x2c')],qs[_0xd821('0x32')](_0x3c37cb[_0xd821('0x30')][_0xd821('0x32')]));_0x3370d9[_0xd821('0x31')]=_0x3370d9[_0xd821('0x31')][_0xd821('0x33')]?_0x3370d9['attributes']:_0x34b654[_0xd821('0x2c')];_0x3370d9[_0xd821('0x4e')]=qs[_0xd821('0x36')](_0x3c37cb['query']['sort']);_0x3370d9[_0xd821('0x37')]=qs[_0xd821('0x2e')](_[_0xd821('0x38')](_0x3c37cb['query'],_0x34b654[_0xd821('0x2e')]));if(_0x3c37cb[_0xd821('0x30')][_0xd821('0x39')]){_0x3370d9[_0xd821('0x37')]=_[_0xd821('0x3a')](_0x3370d9[_0xd821('0x37')],{'$or':_[_0xd821('0x28')](_0x3370d9[_0xd821('0x31')],function(_0x3d4b47){var _0x3a87c9={};_0x3a87c9[_0x3d4b47]={'$like':'%'+_0x3c37cb[_0xd821('0x30')]['filter']+'%'};return _0x3a87c9;})});}_0x3370d9=_[_0xd821('0x3a')]({},_0x3370d9,_0x3c37cb[_0xd821('0x3d')]);return _0x2f3293[_0xd821('0x4d')](_0x3370d9);}})[_0xd821('0x23')](function(_0x6714c6){if(_0x6714c6){_0xe4da0e=_0x6714c6['length'];if(!_0x3c37cb['query']['hasOwnProperty']('nolimit')){_0x3370d9[_0xd821('0x1c')]=qs['limit'](_0x3c37cb[_0xd821('0x30')][_0xd821('0x1c')]);_0x3370d9[_0xd821('0x1a')]=qs[_0xd821('0x1a')](_0x3c37cb[_0xd821('0x30')]['offset']);}return _0x2f3293[_0xd821('0x4d')](_0x3370d9);}})[_0xd821('0x23')](function(_0x4a026d){if(_0x4a026d){return _0x4a026d?{'count':_0xe4da0e,'rows':_0x4a026d}:null;}})[_0xd821('0x23')](respondWithResult(_0x378788,null))[_0xd821('0x42')](handleError(_0x378788,null));};exports[_0xd821('0x4f')]=function(_0x4f25b8,_0x1bcf07,_0x4363c7){var _0x4f08bb={};var _0x21dea1={};var _0x2a6b5d;var _0x1e1d68;return db[_0xd821('0x3e')][_0xd821('0x4b')]({'where':{'id':_0x4f25b8[_0xd821('0x44')]['id']}})[_0xd821('0x23')](handleEntityNotFound(_0x1bcf07,null))[_0xd821('0x23')](function(_0x26784f){if(_0x26784f){_0x2a6b5d=_0x26784f;_0x21dea1[_0xd821('0x2c')]=_[_0xd821('0x2d')](db[_0xd821('0x4c')]['rawAttributes']);_0x21dea1[_0xd821('0x30')]=_[_0xd821('0x2d')](_0x4f25b8[_0xd821('0x30')]);_0x21dea1[_0xd821('0x2e')]=_[_0xd821('0x2f')](_0x21dea1[_0xd821('0x2c')],_0x21dea1[_0xd821('0x30')]);_0x4f08bb[_0xd821('0x31')]=_[_0xd821('0x2f')](_0x21dea1[_0xd821('0x2c')],qs['fields'](_0x4f25b8[_0xd821('0x30')][_0xd821('0x32')]));_0x4f08bb['attributes']=_0x4f08bb[_0xd821('0x31')][_0xd821('0x33')]?_0x4f08bb[_0xd821('0x31')]:_0x21dea1[_0xd821('0x2c')];_0x4f08bb[_0xd821('0x4e')]=qs[_0xd821('0x36')](_0x4f25b8[_0xd821('0x30')][_0xd821('0x36')]);_0x4f08bb[_0xd821('0x37')]=qs[_0xd821('0x2e')](_['pick'](_0x4f25b8[_0xd821('0x30')],_0x21dea1['filters']));if(_0x4f25b8[_0xd821('0x30')][_0xd821('0x39')]){_0x4f08bb[_0xd821('0x37')]=_['merge'](_0x4f08bb[_0xd821('0x37')],{'$or':_[_0xd821('0x28')](_0x4f08bb[_0xd821('0x31')],function(_0x122288){var _0x30bdf1={};_0x30bdf1[_0x122288]={'$like':'%'+_0x4f25b8[_0xd821('0x30')][_0xd821('0x39')]+'%'};return _0x30bdf1;})});}_0x4f08bb=_['merge']({},_0x4f08bb,_0x4f25b8[_0xd821('0x3d')]);return _0x2a6b5d[_0xd821('0x4f')](_0x4f08bb);}})[_0xd821('0x23')](function(_0x2655cc){if(_0x2655cc){_0x1e1d68=_0x2655cc[_0xd821('0x33')];if(!_0x4f25b8['query'][_0xd821('0x34')](_0xd821('0x35'))){_0x4f08bb['limit']=qs['limit'](_0x4f25b8[_0xd821('0x30')][_0xd821('0x1c')]);_0x4f08bb['offset']=qs[_0xd821('0x1a')](_0x4f25b8[_0xd821('0x30')][_0xd821('0x1a')]);}return _0x2a6b5d['getDescriptions'](_0x4f08bb);}})[_0xd821('0x23')](function(_0x288bf7){if(_0x288bf7){return _0x288bf7?{'count':_0x1e1d68,'rows':_0x288bf7}:null;}})['then'](respondWithResult(_0x1bcf07,null))['catch'](handleError(_0x1bcf07,null));};exports[_0xd821('0x50')]=function(_0x2a0c26,_0x3dba3c,_0x9ce62a){var _0x4935b1={};var _0x218290={};var _0x2fdcf9;var _0x3b6155;return db[_0xd821('0x3e')][_0xd821('0x4b')]({'where':{'id':_0x2a0c26[_0xd821('0x44')]['id']}})['then'](handleEntityNotFound(_0x3dba3c,null))['then'](function(_0x41cc0d){if(_0x41cc0d){_0x2fdcf9=_0x41cc0d;_0x218290[_0xd821('0x2c')]=_[_0xd821('0x2d')](db[_0xd821('0x51')][_0xd821('0x29')]);_0x218290[_0xd821('0x30')]=_[_0xd821('0x2d')](_0x2a0c26[_0xd821('0x30')]);_0x218290[_0xd821('0x2e')]=_[_0xd821('0x2f')](_0x218290[_0xd821('0x2c')],_0x218290['query']);_0x4935b1[_0xd821('0x31')]=_[_0xd821('0x2f')](_0x218290[_0xd821('0x2c')],qs['fields'](_0x2a0c26[_0xd821('0x30')]['fields']));_0x4935b1['attributes']=_0x4935b1['attributes'][_0xd821('0x33')]?_0x4935b1[_0xd821('0x31')]:_0x218290[_0xd821('0x2c')];_0x4935b1[_0xd821('0x4e')]=qs['sort'](_0x2a0c26[_0xd821('0x30')][_0xd821('0x36')]);_0x4935b1[_0xd821('0x37')]=qs[_0xd821('0x2e')](_[_0xd821('0x38')](_0x2a0c26[_0xd821('0x30')],_0x218290[_0xd821('0x2e')]));if(_0x2a0c26[_0xd821('0x30')]['filter']){_0x4935b1[_0xd821('0x37')]=_[_0xd821('0x3a')](_0x4935b1[_0xd821('0x37')],{'$or':_[_0xd821('0x28')](_0x4935b1[_0xd821('0x31')],function(_0x38c490){var _0x28b20b={};_0x28b20b[_0x38c490]={'$like':'%'+_0x2a0c26['query'][_0xd821('0x39')]+'%'};return _0x28b20b;})});}_0x4935b1=_[_0xd821('0x3a')]({},_0x4935b1,_0x2a0c26['options']);return _0x2fdcf9[_0xd821('0x50')](_0x4935b1);}})[_0xd821('0x23')](function(_0x4401e7){if(_0x4401e7){_0x3b6155=_0x4401e7[_0xd821('0x33')];if(!_0x2a0c26[_0xd821('0x30')]['hasOwnProperty'](_0xd821('0x35'))){_0x4935b1['limit']=qs[_0xd821('0x1c')](_0x2a0c26[_0xd821('0x30')][_0xd821('0x1c')]);_0x4935b1[_0xd821('0x1a')]=qs[_0xd821('0x1a')](_0x2a0c26[_0xd821('0x30')][_0xd821('0x1a')]);}return _0x2fdcf9['getTags'](_0x4935b1);}})['then'](function(_0x244485){if(_0x244485){return _0x244485?{'count':_0x3b6155,'rows':_0x244485}:null;}})['then'](respondWithResult(_0x3dba3c,null))[_0xd821('0x42')](handleError(_0x3dba3c,null));};exports['setTags']=function(_0x116938,_0x3c95c6,_0x270f75){if(_0x116938[_0xd821('0x48')]['id']){delete _0x116938[_0xd821('0x48')]['id'];}return db[_0xd821('0x3e')][_0xd821('0x4b')]({'where':{'id':_0x116938[_0xd821('0x44')]['id']}})[_0xd821('0x23')](handleEntityNotFound(_0x3c95c6,null))['then'](function(_0x44fade){if(_0x44fade){return _0x44fade['setTags'](_0x116938['body'][_0xd821('0x52')]||[]);}return null;})[_0xd821('0x23')](respondWithResult(_0x3c95c6,null))[_0xd821('0x42')](handleError(_0x3c95c6,null));}; \ No newline at end of file +var _0x94c1=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','keys','find','create','body','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','set'];(function(_0x1a47a8,_0x399f70){var _0x50fe0c=function(_0x378cb9){while(--_0x378cb9){_0x1a47a8['push'](_0x1a47a8['shift']());}};_0x50fe0c(++_0x399f70);}(_0x94c1,0x8d));var _0x194c=function(_0x4d0af5,_0x55dc07){_0x4d0af5=_0x4d0af5-0x0;var _0x5d0b82=_0x94c1[_0x4d0af5];return _0x5d0b82;};'use strict';var emlformat=require(_0x194c('0x0'));var rimraf=require(_0x194c('0x1'));var zipdir=require(_0x194c('0x2'));var jsonpatch=require(_0x194c('0x3'));var rp=require(_0x194c('0x4'));var moment=require(_0x194c('0x5'));var BPromise=require(_0x194c('0x6'));var Mustache=require(_0x194c('0x7'));var util=require(_0x194c('0x8'));var path=require('path');var sox=require(_0x194c('0x9'));var csv=require(_0x194c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x194c('0xb'));var _=require(_0x194c('0xc'));var squel=require(_0x194c('0xd'));var crypto=require('crypto');var jsforce=require(_0x194c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x194c('0xf'));var Papa=require(_0x194c('0x10'));var Redis=require(_0x194c('0x11'));var authService=require(_0x194c('0x12'));var qs=require(_0x194c('0x13'));var as=require(_0x194c('0x14'));var hardwareService=require(_0x194c('0x15'));var logger=require('../../config/logger')(_0x194c('0x16'));var utils=require(_0x194c('0x17'));var config=require(_0x194c('0x18'));var licenseUtil=require(_0x194c('0x19'));var db=require(_0x194c('0x1a'))['db'];function respondWithStatusCode(_0x42fc3f,_0x117d32){_0x117d32=_0x117d32||0xcc;return function(_0x2ed6ac){if(_0x2ed6ac){return _0x42fc3f['sendStatus'](_0x117d32);}return _0x42fc3f[_0x194c('0x1b')](_0x117d32)[_0x194c('0x1c')]();};}function respondWithResult(_0xcbff5a,_0x57cb53){_0x57cb53=_0x57cb53||0xc8;return function(_0x18a07e){if(_0x18a07e){return _0xcbff5a[_0x194c('0x1b')](_0x57cb53)[_0x194c('0x1d')](_0x18a07e);}};}function respondWithFilteredResult(_0x164c2f,_0x11fd34){return function(_0x4c55c7){if(_0x4c55c7){var _0x86fbfc=typeof _0x11fd34['offset']==='undefined'&&typeof _0x11fd34[_0x194c('0x1e')]==='undefined';var _0x278fae=_0x4c55c7['count'];var _0x343b9e=_0x86fbfc?0x0:_0x11fd34['offset'];var _0x2ff535=_0x86fbfc?_0x4c55c7[_0x194c('0x1f')]:_0x11fd34['offset']+_0x11fd34[_0x194c('0x1e')];var _0x15c31a;if(_0x2ff535>=_0x278fae){_0x2ff535=_0x278fae;_0x15c31a=0xc8;}else{_0x15c31a=0xce;}_0x164c2f[_0x194c('0x1b')](_0x15c31a);return _0x164c2f[_0x194c('0x20')](_0x194c('0x21'),_0x343b9e+'-'+_0x2ff535+'/'+_0x278fae)[_0x194c('0x1d')](_0x4c55c7);}return null;};}function patchUpdates(_0x31bf80){return function(_0x342094){try{jsonpatch[_0x194c('0x22')](_0x342094,_0x31bf80,!![]);}catch(_0x1df771){return BPromise[_0x194c('0x23')](_0x1df771);}return _0x342094[_0x194c('0x24')]();};}function saveUpdates(_0x53a8c8,_0x3a2a30){return function(_0x379ffc){if(_0x379ffc){return _0x379ffc[_0x194c('0x25')](_0x53a8c8)[_0x194c('0x26')](function(_0x2adec8){return _0x2adec8;});}return null;};}function removeEntity(_0x590deb,_0x549f89){return function(_0x480eec){if(_0x480eec){return _0x480eec[_0x194c('0x27')]()[_0x194c('0x26')](function(){_0x590deb[_0x194c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4308fb,_0x37a899){return function(_0x32fca3){if(!_0x32fca3){_0x4308fb[_0x194c('0x28')](0x194);}return _0x32fca3;};}function handleError(_0x1593f9,_0x358830){_0x358830=_0x358830||0x1f4;return function(_0x328567){logger[_0x194c('0x29')](_0x328567[_0x194c('0x2a')]);if(_0x328567[_0x194c('0x2b')]){delete _0x328567[_0x194c('0x2b')];}_0x1593f9[_0x194c('0x1b')](_0x358830)[_0x194c('0x2c')](_0x328567);};}exports[_0x194c('0x2d')]=function(_0x3ef61c,_0x218563){var _0x7c770={},_0x7da156={},_0x3a1a5d={'count':0x0,'rows':[]};var _0x30f465=_[_0x194c('0x2e')](db[_0x194c('0x2f')][_0x194c('0x30')],function(_0x1d17cc){return{'name':_0x1d17cc['fieldName'],'type':_0x1d17cc[_0x194c('0x31')][_0x194c('0x32')]};});_0x7da156[_0x194c('0x33')]=_[_0x194c('0x2e')](_0x30f465,_0x194c('0x2b'));_0x7da156['query']=_['keys'](_0x3ef61c[_0x194c('0x34')]);_0x7da156[_0x194c('0x35')]=_[_0x194c('0x36')](_0x7da156[_0x194c('0x33')],_0x7da156['query']);_0x7c770[_0x194c('0x37')]=_[_0x194c('0x36')](_0x7da156[_0x194c('0x33')],qs[_0x194c('0x38')](_0x3ef61c['query'][_0x194c('0x38')]));_0x7c770[_0x194c('0x37')]=_0x7c770[_0x194c('0x37')][_0x194c('0x39')]?_0x7c770[_0x194c('0x37')]:_0x7da156[_0x194c('0x33')];if(!_0x3ef61c['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x7c770[_0x194c('0x1e')]=qs['limit'](_0x3ef61c[_0x194c('0x34')][_0x194c('0x1e')]);_0x7c770[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0x3ef61c['query'][_0x194c('0x3c')]);}_0x7c770[_0x194c('0x3d')]=qs[_0x194c('0x3e')](_0x3ef61c[_0x194c('0x34')][_0x194c('0x3e')]);_0x7c770[_0x194c('0x3f')]=qs['filters'](_[_0x194c('0x40')](_0x3ef61c[_0x194c('0x34')],_0x7da156['filters']),_0x30f465);if(_0x3ef61c[_0x194c('0x34')][_0x194c('0x41')]){_0x7c770[_0x194c('0x3f')]=_[_0x194c('0x42')](_0x7c770[_0x194c('0x3f')],{'$or':_[_0x194c('0x2e')](_0x30f465,function(_0x390050){if(_0x390050[_0x194c('0x31')]!==_0x194c('0x43')){var _0x27c6a5={};_0x27c6a5[_0x390050[_0x194c('0x2b')]]={'$like':'%'+_0x3ef61c[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x27c6a5;}})});}_0x7c770=_['merge']({},_0x7c770,_0x3ef61c[_0x194c('0x44')]);var _0x2dc62f={'where':_0x7c770[_0x194c('0x3f')]};return db[_0x194c('0x2f')][_0x194c('0x1f')](_0x2dc62f)[_0x194c('0x26')](function(_0x5c32f0){_0x3a1a5d[_0x194c('0x1f')]=_0x5c32f0;if(_0x3ef61c[_0x194c('0x34')][_0x194c('0x45')]){_0x7c770[_0x194c('0x46')]=[{'all':!![]}];}return db[_0x194c('0x2f')]['findAll'](_0x7c770);})[_0x194c('0x26')](function(_0x2e8947){_0x3a1a5d['rows']=_0x2e8947;return _0x3a1a5d;})[_0x194c('0x26')](respondWithFilteredResult(_0x218563,_0x7c770))[_0x194c('0x47')](handleError(_0x218563,null));};exports[_0x194c('0x48')]=function(_0x510360,_0x3b7229){var _0x3abc48={'raw':![],'where':{'id':_0x510360['params']['id']}},_0x729c23={};_0x729c23[_0x194c('0x33')]=_['keys'](db[_0x194c('0x2f')][_0x194c('0x30')]);_0x729c23[_0x194c('0x34')]=_[_0x194c('0x49')](_0x510360[_0x194c('0x34')]);_0x729c23[_0x194c('0x35')]=_[_0x194c('0x36')](_0x729c23[_0x194c('0x33')],_0x729c23[_0x194c('0x34')]);_0x3abc48['attributes']=_[_0x194c('0x36')](_0x729c23['model'],qs[_0x194c('0x38')](_0x510360['query'][_0x194c('0x38')]));_0x3abc48[_0x194c('0x37')]=_0x3abc48['attributes']['length']?_0x3abc48[_0x194c('0x37')]:_0x729c23[_0x194c('0x33')];if(_0x510360[_0x194c('0x34')]['includeAll']){_0x3abc48[_0x194c('0x46')]=[{'all':!![]}];}_0x3abc48=_[_0x194c('0x42')]({},_0x3abc48,_0x510360[_0x194c('0x44')]);return db[_0x194c('0x2f')][_0x194c('0x4a')](_0x3abc48)[_0x194c('0x26')](handleEntityNotFound(_0x3b7229,null))[_0x194c('0x26')](respondWithResult(_0x3b7229,null))[_0x194c('0x47')](handleError(_0x3b7229,null));};exports[_0x194c('0x4b')]=function(_0x301fc2,_0x444da0){return db['ZendeskConfiguration']['create'](_0x301fc2['body'],{})[_0x194c('0x26')](respondWithResult(_0x444da0,0xc9))[_0x194c('0x47')](handleError(_0x444da0,null));};exports[_0x194c('0x25')]=function(_0x67ed71,_0x4674fa){if(_0x67ed71['body']['id']){delete _0x67ed71[_0x194c('0x4c')]['id'];}return db[_0x194c('0x2f')]['find']({'where':{'id':_0x67ed71[_0x194c('0x4d')]['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x4674fa,null))[_0x194c('0x26')](saveUpdates(_0x67ed71[_0x194c('0x4c')],null))['then'](respondWithResult(_0x4674fa,null))['catch'](handleError(_0x4674fa,null));};exports[_0x194c('0x27')]=function(_0x2157d2,_0x4eeb6e){return db[_0x194c('0x2f')][_0x194c('0x4a')]({'where':{'id':_0x2157d2[_0x194c('0x4d')]['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x4eeb6e,null))['then'](removeEntity(_0x4eeb6e,null))['catch'](handleError(_0x4eeb6e,null));};exports[_0x194c('0x4e')]=function(_0xadc571,_0x18d95f,_0x5ccc8f){var _0x269c61={};var _0x2830d3={};var _0x49e45e;var _0x179898;return db['ZendeskConfiguration'][_0x194c('0x4f')]({'where':{'id':_0xadc571['params']['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x18d95f,null))[_0x194c('0x26')](function(_0x120ac5){if(_0x120ac5){_0x49e45e=_0x120ac5;_0x2830d3[_0x194c('0x33')]=_[_0x194c('0x49')](db[_0x194c('0x50')][_0x194c('0x30')]);_0x2830d3[_0x194c('0x34')]=_[_0x194c('0x49')](_0xadc571['query']);_0x2830d3['filters']=_[_0x194c('0x36')](_0x2830d3['model'],_0x2830d3[_0x194c('0x34')]);_0x269c61[_0x194c('0x37')]=_[_0x194c('0x36')](_0x2830d3['model'],qs['fields'](_0xadc571[_0x194c('0x34')]['fields']));_0x269c61[_0x194c('0x37')]=_0x269c61[_0x194c('0x37')][_0x194c('0x39')]?_0x269c61['attributes']:_0x2830d3[_0x194c('0x33')];_0x269c61[_0x194c('0x3d')]=qs[_0x194c('0x3e')](_0xadc571[_0x194c('0x34')]['sort']);_0x269c61[_0x194c('0x3f')]=qs[_0x194c('0x35')](_['pick'](_0xadc571[_0x194c('0x34')],_0x2830d3[_0x194c('0x35')]));if(_0xadc571['query']['filter']){_0x269c61[_0x194c('0x3f')]=_[_0x194c('0x42')](_0x269c61['where'],{'$or':_[_0x194c('0x2e')](_0x269c61[_0x194c('0x37')],function(_0x37bf67){var _0x2883fd={};_0x2883fd[_0x37bf67]={'$like':'%'+_0xadc571[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x2883fd;})});}_0x269c61=_[_0x194c('0x42')]({},_0x269c61,_0xadc571[_0x194c('0x44')]);return _0x49e45e['getFields'](_0x269c61);}})['then'](function(_0x1f5a5b){if(_0x1f5a5b){_0x179898=_0x1f5a5b['length'];if(!_0xadc571['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x269c61[_0x194c('0x1e')]=qs[_0x194c('0x1e')](_0xadc571[_0x194c('0x34')][_0x194c('0x1e')]);_0x269c61[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0xadc571[_0x194c('0x34')]['offset']);}return _0x49e45e['getFields'](_0x269c61);}})[_0x194c('0x26')](function(_0x57fa4b){if(_0x57fa4b){return _0x57fa4b?{'count':_0x179898,'rows':_0x57fa4b}:null;}})[_0x194c('0x26')](respondWithResult(_0x18d95f,null))['catch'](handleError(_0x18d95f,null));};exports[_0x194c('0x51')]=function(_0x16e6e0,_0x2186ab,_0x23e617){var _0x5c3663={};var _0x48d62b={};var _0x4ad142;var _0x7a48c4;return db['ZendeskConfiguration'][_0x194c('0x4f')]({'where':{'id':_0x16e6e0['params']['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x2186ab,null))[_0x194c('0x26')](function(_0x11eeb3){if(_0x11eeb3){_0x4ad142=_0x11eeb3;_0x48d62b[_0x194c('0x33')]=_[_0x194c('0x49')](db['ZendeskField'][_0x194c('0x30')]);_0x48d62b[_0x194c('0x34')]=_[_0x194c('0x49')](_0x16e6e0['query']);_0x48d62b[_0x194c('0x35')]=_[_0x194c('0x36')](_0x48d62b[_0x194c('0x33')],_0x48d62b[_0x194c('0x34')]);_0x5c3663[_0x194c('0x37')]=_[_0x194c('0x36')](_0x48d62b[_0x194c('0x33')],qs[_0x194c('0x38')](_0x16e6e0[_0x194c('0x34')][_0x194c('0x38')]));_0x5c3663[_0x194c('0x37')]=_0x5c3663[_0x194c('0x37')][_0x194c('0x39')]?_0x5c3663[_0x194c('0x37')]:_0x48d62b['model'];_0x5c3663['order']=qs['sort'](_0x16e6e0[_0x194c('0x34')][_0x194c('0x3e')]);_0x5c3663[_0x194c('0x3f')]=qs[_0x194c('0x35')](_['pick'](_0x16e6e0[_0x194c('0x34')],_0x48d62b['filters']));if(_0x16e6e0[_0x194c('0x34')][_0x194c('0x41')]){_0x5c3663[_0x194c('0x3f')]=_['merge'](_0x5c3663['where'],{'$or':_[_0x194c('0x2e')](_0x5c3663['attributes'],function(_0x21142e){var _0x3488d7={};_0x3488d7[_0x21142e]={'$like':'%'+_0x16e6e0[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x3488d7;})});}_0x5c3663=_[_0x194c('0x42')]({},_0x5c3663,_0x16e6e0[_0x194c('0x44')]);return _0x4ad142['getSubjects'](_0x5c3663);}})['then'](function(_0x568bc1){if(_0x568bc1){_0x7a48c4=_0x568bc1[_0x194c('0x39')];if(!_0x16e6e0['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x5c3663[_0x194c('0x1e')]=qs['limit'](_0x16e6e0[_0x194c('0x34')]['limit']);_0x5c3663[_0x194c('0x3c')]=qs['offset'](_0x16e6e0[_0x194c('0x34')][_0x194c('0x3c')]);}return _0x4ad142[_0x194c('0x51')](_0x5c3663);}})[_0x194c('0x26')](function(_0xcea924){if(_0xcea924){return _0xcea924?{'count':_0x7a48c4,'rows':_0xcea924}:null;}})['then'](respondWithResult(_0x2186ab,null))[_0x194c('0x47')](handleError(_0x2186ab,null));};exports[_0x194c('0x52')]=function(_0x4850c2,_0x778b0f,_0x3647ea){var _0x337327={};var _0x4cde1e={};var _0x10f477;var _0x2db5d3;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4850c2['params']['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x778b0f,null))[_0x194c('0x26')](function(_0x257f4e){if(_0x257f4e){_0x10f477=_0x257f4e;_0x4cde1e['model']=_['keys'](db[_0x194c('0x50')][_0x194c('0x30')]);_0x4cde1e[_0x194c('0x34')]=_[_0x194c('0x49')](_0x4850c2[_0x194c('0x34')]);_0x4cde1e[_0x194c('0x35')]=_[_0x194c('0x36')](_0x4cde1e[_0x194c('0x33')],_0x4cde1e[_0x194c('0x34')]);_0x337327[_0x194c('0x37')]=_['intersection'](_0x4cde1e['model'],qs[_0x194c('0x38')](_0x4850c2[_0x194c('0x34')]['fields']));_0x337327[_0x194c('0x37')]=_0x337327[_0x194c('0x37')][_0x194c('0x39')]?_0x337327['attributes']:_0x4cde1e[_0x194c('0x33')];_0x337327[_0x194c('0x3d')]=qs[_0x194c('0x3e')](_0x4850c2[_0x194c('0x34')][_0x194c('0x3e')]);_0x337327[_0x194c('0x3f')]=qs[_0x194c('0x35')](_[_0x194c('0x40')](_0x4850c2[_0x194c('0x34')],_0x4cde1e[_0x194c('0x35')]));if(_0x4850c2['query']['filter']){_0x337327[_0x194c('0x3f')]=_[_0x194c('0x42')](_0x337327[_0x194c('0x3f')],{'$or':_[_0x194c('0x2e')](_0x337327[_0x194c('0x37')],function(_0x42024e){var _0x570cc8={};_0x570cc8[_0x42024e]={'$like':'%'+_0x4850c2[_0x194c('0x34')][_0x194c('0x41')]+'%'};return _0x570cc8;})});}_0x337327=_[_0x194c('0x42')]({},_0x337327,_0x4850c2[_0x194c('0x44')]);return _0x10f477[_0x194c('0x52')](_0x337327);}})[_0x194c('0x26')](function(_0x5207a2){if(_0x5207a2){_0x2db5d3=_0x5207a2[_0x194c('0x39')];if(!_0x4850c2['query'][_0x194c('0x3a')](_0x194c('0x3b'))){_0x337327[_0x194c('0x1e')]=qs[_0x194c('0x1e')](_0x4850c2[_0x194c('0x34')][_0x194c('0x1e')]);_0x337327[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0x4850c2[_0x194c('0x34')]['offset']);}return _0x10f477[_0x194c('0x52')](_0x337327);}})['then'](function(_0x5aa534){if(_0x5aa534){return _0x5aa534?{'count':_0x2db5d3,'rows':_0x5aa534}:null;}})[_0x194c('0x26')](respondWithResult(_0x778b0f,null))[_0x194c('0x47')](handleError(_0x778b0f,null));};exports[_0x194c('0x53')]=function(_0xd67071,_0x4e0d8b,_0x19bfbd){var _0x18f8d0={};var _0x2ce3bc={};var _0x294701;var _0x505ad2;return db[_0x194c('0x2f')][_0x194c('0x4f')]({'where':{'id':_0xd67071[_0x194c('0x4d')]['id']}})[_0x194c('0x26')](handleEntityNotFound(_0x4e0d8b,null))[_0x194c('0x26')](function(_0x38163f){if(_0x38163f){_0x294701=_0x38163f;_0x2ce3bc[_0x194c('0x33')]=_['keys'](db[_0x194c('0x54')][_0x194c('0x30')]);_0x2ce3bc[_0x194c('0x34')]=_[_0x194c('0x49')](_0xd67071[_0x194c('0x34')]);_0x2ce3bc[_0x194c('0x35')]=_[_0x194c('0x36')](_0x2ce3bc['model'],_0x2ce3bc[_0x194c('0x34')]);_0x18f8d0['attributes']=_[_0x194c('0x36')](_0x2ce3bc[_0x194c('0x33')],qs[_0x194c('0x38')](_0xd67071['query'][_0x194c('0x38')]));_0x18f8d0[_0x194c('0x37')]=_0x18f8d0['attributes'][_0x194c('0x39')]?_0x18f8d0[_0x194c('0x37')]:_0x2ce3bc['model'];_0x18f8d0['order']=qs[_0x194c('0x3e')](_0xd67071['query'][_0x194c('0x3e')]);_0x18f8d0[_0x194c('0x3f')]=qs[_0x194c('0x35')](_[_0x194c('0x40')](_0xd67071[_0x194c('0x34')],_0x2ce3bc[_0x194c('0x35')]));if(_0xd67071[_0x194c('0x34')]['filter']){_0x18f8d0['where']=_[_0x194c('0x42')](_0x18f8d0[_0x194c('0x3f')],{'$or':_[_0x194c('0x2e')](_0x18f8d0['attributes'],function(_0x4a4c6e){var _0x16a228={};_0x16a228[_0x4a4c6e]={'$like':'%'+_0xd67071[_0x194c('0x34')]['filter']+'%'};return _0x16a228;})});}_0x18f8d0=_[_0x194c('0x42')]({},_0x18f8d0,_0xd67071[_0x194c('0x44')]);return _0x294701[_0x194c('0x53')](_0x18f8d0);}})[_0x194c('0x26')](function(_0x48761c){if(_0x48761c){_0x505ad2=_0x48761c['length'];if(!_0xd67071[_0x194c('0x34')][_0x194c('0x3a')](_0x194c('0x3b'))){_0x18f8d0['limit']=qs[_0x194c('0x1e')](_0xd67071[_0x194c('0x34')][_0x194c('0x1e')]);_0x18f8d0[_0x194c('0x3c')]=qs[_0x194c('0x3c')](_0xd67071[_0x194c('0x34')]['offset']);}return _0x294701[_0x194c('0x53')](_0x18f8d0);}})[_0x194c('0x26')](function(_0x2c0c2b){if(_0x2c0c2b){return _0x2c0c2b?{'count':_0x505ad2,'rows':_0x2c0c2b}:null;}})['then'](respondWithResult(_0x4e0d8b,null))[_0x194c('0x47')](handleError(_0x4e0d8b,null));};exports[_0x194c('0x55')]=function(_0x19a68e,_0x2fbaa8,_0x1cd419){if(_0x19a68e[_0x194c('0x4c')]['id']){delete _0x19a68e['body']['id'];}return db[_0x194c('0x2f')]['findOne']({'where':{'id':_0x19a68e[_0x194c('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2fbaa8,null))[_0x194c('0x26')](function(_0x45b9ea){if(_0x45b9ea){return _0x45b9ea[_0x194c('0x55')](_0x19a68e[_0x194c('0x4c')][_0x194c('0x56')]||[]);}return null;})['then'](respondWithResult(_0x2fbaa8,null))['catch'](handleError(_0x2fbaa8,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 5380c9b..9dba9ba 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 _0x6a95=['bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x16916b,_0x520c80){var _0x12fd40=function(_0x3eedf6){while(--_0x3eedf6){_0x16916b['push'](_0x16916b['shift']());}};_0x12fd40(++_0x520c80);}(_0x6a95,0x1db));var _0x56a9=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x6a95[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var logger=require(_0x56a9('0x2'))(_0x56a9('0x3'));var moment=require(_0x56a9('0x4'));var BPromise=require(_0x56a9('0x5'));var rp=require(_0x56a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56a9('0x7'));var attributes=require(_0x56a9('0x8'));module[_0x56a9('0x9')]=function(_0x2eb132,_0x3c15b6){return _0x2eb132[_0x56a9('0xa')](_0x56a9('0xb'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6a95=['bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x259e09,_0x43dc8e){var _0x221f0f=function(_0xc75af){while(--_0xc75af){_0x259e09['push'](_0x259e09['shift']());}};_0x221f0f(++_0x43dc8e);}(_0x6a95,0x1db));var _0x56a9=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x6a95[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x56a9('0x0'));var util=require(_0x56a9('0x1'));var logger=require(_0x56a9('0x2'))(_0x56a9('0x3'));var moment=require(_0x56a9('0x4'));var BPromise=require(_0x56a9('0x5'));var rp=require(_0x56a9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x56a9('0x7'));var attributes=require(_0x56a9('0x8'));module[_0x56a9('0x9')]=function(_0x2eb132,_0x3c15b6){return _0x2eb132[_0x56a9('0xa')](_0x56a9('0xb'),attributes,{'tableName':'int_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 8667561..195387d 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 _0x306c=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x306c,0xf4));var _0xc306=function(_0x42c439,_0x147593){_0x42c439=_0x42c439-0x0;var _0x16d8a3=_0x306c[_0x42c439];return _0x16d8a3;};'use strict';var _=require(_0xc306('0x0'));var util=require(_0xc306('0x1'));var moment=require(_0xc306('0x2'));var BPromise=require(_0xc306('0x3'));var rs=require(_0xc306('0x4'));var fs=require('fs');var Redis=require(_0xc306('0x5'));var db=require(_0xc306('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc306('0x7'));var config=require(_0xc306('0x8'));var jayson=require(_0xc306('0x9'));var client=jayson[_0xc306('0xa')][_0xc306('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b8717,_0x4a9c79,_0x33e7d3){return new BPromise(function(_0xf4d555,_0x5f28e7){return client[_0xc306('0xc')](_0x4b8717,_0x33e7d3)[_0xc306('0xd')](function(_0x451e90){logger[_0xc306('0xe')](_0xc306('0xf'),_0x4a9c79,_0xc306('0x10'));logger[_0xc306('0x11')](_0xc306('0x12'),_0x4a9c79,_0xc306('0x10'),JSON[_0xc306('0x13')](_0x451e90));if(_0x451e90[_0xc306('0x14')]){if(_0x451e90[_0xc306('0x14')][_0xc306('0x15')]===0x1f4){logger[_0xc306('0x14')](_0xc306('0xf'),_0x4a9c79,_0x451e90[_0xc306('0x14')]['message']);return _0x5f28e7(_0x451e90[_0xc306('0x14')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x4a9c79,_0x451e90[_0xc306('0x14')]['message']);return _0xf4d555(_0x451e90[_0xc306('0x14')][_0xc306('0x16')]);}else{logger[_0xc306('0xe')](_0xc306('0xf'),_0x4a9c79,_0xc306('0x10'));_0xf4d555(_0x451e90[_0xc306('0x17')][_0xc306('0x16')]);}})[_0xc306('0x18')](function(_0x1f2c60){logger[_0xc306('0x14')](_0xc306('0xf'),_0x4a9c79,_0x1f2c60);_0x5f28e7(_0x1f2c60);});});} \ No newline at end of file +var _0x960f=['code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x58ced6,_0x329875){var _0x1b613a=function(_0x4d6f67){while(--_0x4d6f67){_0x58ced6['push'](_0x58ced6['shift']());}};_0x1b613a(++_0x329875);}(_0x960f,0x64));var _0xf960=function(_0x388b47,_0x5cdac5){_0x388b47=_0x388b47-0x0;var _0x4859df=_0x960f[_0x388b47];return _0x4859df;};'use strict';var _=require(_0xf960('0x0'));var util=require(_0xf960('0x1'));var moment=require(_0xf960('0x2'));var BPromise=require(_0xf960('0x3'));var rs=require(_0xf960('0x4'));var fs=require('fs');var Redis=require(_0xf960('0x5'));var db=require(_0xf960('0x6'))['db'];var utils=require(_0xf960('0x7'));var logger=require(_0xf960('0x8'))(_0xf960('0x9'));var config=require(_0xf960('0xa'));var jayson=require(_0xf960('0xb'));var client=jayson[_0xf960('0xc')][_0xf960('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5df453,_0x5040ff,_0x21fdc8){return new BPromise(function(_0x1b62b9,_0x91b887){return client[_0xf960('0xe')](_0x5df453,_0x21fdc8)[_0xf960('0xf')](function(_0x9babf2){logger['info'](_0xf960('0x10'),_0x5040ff,_0xf960('0x11'));logger[_0xf960('0x12')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5040ff,'request\x20sent',JSON['stringify'](_0x9babf2));if(_0x9babf2[_0xf960('0x13')]){if(_0x9babf2[_0xf960('0x13')][_0xf960('0x14')]===0x1f4){logger[_0xf960('0x13')](_0xf960('0x10'),_0x5040ff,_0x9babf2['error'][_0xf960('0x15')]);return _0x91b887(_0x9babf2[_0xf960('0x13')][_0xf960('0x15')]);}logger[_0xf960('0x13')](_0xf960('0x10'),_0x5040ff,_0x9babf2[_0xf960('0x13')][_0xf960('0x15')]);return _0x1b62b9(_0x9babf2['error'][_0xf960('0x15')]);}else{logger[_0xf960('0x16')](_0xf960('0x10'),_0x5040ff,'request\x20sent');_0x1b62b9(_0x9babf2[_0xf960('0x17')][_0xf960('0x15')]);}})['catch'](function(_0x113b35){logger[_0xf960('0x13')](_0xf960('0x10'),_0x5040ff,_0x113b35);_0x91b887(_0x113b35);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index cafb3ea..2ddafa0 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 _0xb297=['util','path','connect-timeout','express','Router','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb297,0x1c8));var _0x7b29=function(_0x4f6d08,_0x1b3dd0){_0x4f6d08=_0x4f6d08-0x0;var _0x53a9c6=_0xb297[_0x4f6d08];return _0x53a9c6;};'use strict';var multer=require('multer');var util=require(_0x7b29('0x0'));var path=require(_0x7b29('0x1'));var timeout=require(_0x7b29('0x2'));var express=require(_0x7b29('0x3'));var router=express[_0x7b29('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7b29('0x5'));var config=require('../../config/environment');var controller=require(_0x7b29('0x6'));router[_0x7b29('0x7')]('/',auth[_0x7b29('0x8')](),controller[_0x7b29('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7b29('0xa')]);router[_0x7b29('0xb')]('/',auth[_0x7b29('0x8')](),controller[_0x7b29('0xc')]);router[_0x7b29('0xd')](_0x7b29('0xe'),auth[_0x7b29('0x8')](),controller[_0x7b29('0xf')]);router[_0x7b29('0x10')](_0x7b29('0xe'),auth[_0x7b29('0x8')](),controller[_0x7b29('0x11')]);module[_0x7b29('0x12')]=router; \ No newline at end of file +var _0x0fbb=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer'];(function(_0x2cad67,_0x30a165){var _0x557943=function(_0x1f677b){while(--_0x1f677b){_0x2cad67['push'](_0x2cad67['shift']());}};_0x557943(++_0x30a165);}(_0x0fbb,0x125));var _0xb0fb=function(_0x474391,_0x40de11){_0x474391=_0x474391-0x0;var _0x3e292f=_0x0fbb[_0x474391];return _0x3e292f;};'use strict';var multer=require(_0xb0fb('0x0'));var util=require(_0xb0fb('0x1'));var path=require(_0xb0fb('0x2'));var timeout=require(_0xb0fb('0x3'));var express=require(_0xb0fb('0x4'));var router=express[_0xb0fb('0x5')]();var fs_extra=require(_0xb0fb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb0fb('0x7'));var config=require(_0xb0fb('0x8'));var controller=require(_0xb0fb('0x9'));router[_0xb0fb('0xa')]('/',auth['isAuthenticated'](),controller[_0xb0fb('0xb')]);router[_0xb0fb('0xa')](_0xb0fb('0xc'),auth[_0xb0fb('0xd')](),controller[_0xb0fb('0xe')]);router[_0xb0fb('0xf')]('/',auth['isAuthenticated'](),controller[_0xb0fb('0x10')]);router[_0xb0fb('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb0fb('0x12')]);router[_0xb0fb('0x13')](_0xb0fb('0xc'),auth[_0xb0fb('0xd')](),controller[_0xb0fb('0x14')]);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 a5e131c..080dbb8 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 _0xb083=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0xb083,0x19d));var _0x3b08=function(_0x1cb1fe,_0x216fc8){_0x1cb1fe=_0x1cb1fe-0x0;var _0x52a813=_0xb083[_0x1cb1fe];return _0x52a813;};'use strict';var Sequelize=require(_0x3b08('0x0'));module['exports']={'type':{'type':Sequelize[_0x3b08('0x1')](_0x3b08('0x2'),_0x3b08('0x3'),_0x3b08('0x4'),'keyValue',_0x3b08('0x5')),'defaultValue':_0x3b08('0x2')},'content':{'type':Sequelize[_0x3b08('0x6')]},'key':{'type':Sequelize[_0x3b08('0x6')]},'keyType':{'type':Sequelize[_0x3b08('0x1')](_0x3b08('0x2'),_0x3b08('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3b08('0x6')]},'idField':{'type':Sequelize[_0x3b08('0x6')]},'nameField':{'type':Sequelize[_0x3b08('0x6')]},'customField':{'type':Sequelize[_0x3b08('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3b08('0x6')]}}; \ No newline at end of file +var _0x5ecf=['variable','BOOLEAN','ENUM','string','keyValue','picklist','STRING'];(function(_0x29a2f0,_0x58b1e1){var _0x6a49d1=function(_0x3dead9){while(--_0x3dead9){_0x29a2f0['push'](_0x29a2f0['shift']());}};_0x6a49d1(++_0x58b1e1);}(_0x5ecf,0x136));var _0xf5ec=function(_0x4e94ad,_0x127aba){_0x4e94ad=_0x4e94ad-0x0;var _0x2be377=_0x5ecf[_0x4e94ad];return _0x2be377;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf5ec('0x0')](_0xf5ec('0x1'),'variable','customVariable',_0xf5ec('0x2'),_0xf5ec('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf5ec('0x4')]},'key':{'type':Sequelize[_0xf5ec('0x4')]},'keyType':{'type':Sequelize[_0xf5ec('0x0')](_0xf5ec('0x1'),_0xf5ec('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf5ec('0x4')]},'nameField':{'type':Sequelize[_0xf5ec('0x4')]},'customField':{'type':Sequelize[_0xf5ec('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf5ec('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 98d9e1d..adf2c42 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 _0x67ed=['find','create','body','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','error','stack','name','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options'];(function(_0x424468,_0x5d8df0){var _0x314059=function(_0x58c6ad){while(--_0x58c6ad){_0x424468['push'](_0x424468['shift']());}};_0x314059(++_0x5d8df0);}(_0x67ed,0xde));var _0xd67e=function(_0x5cd494,_0x54174d){_0x5cd494=_0x5cd494-0x0;var _0x32de0e=_0x67ed[_0x5cd494];return _0x32de0e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd67e('0x0'));var zipdir=require(_0xd67e('0x1'));var jsonpatch=require(_0xd67e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd67e('0x3'));var Mustache=require(_0xd67e('0x4'));var util=require(_0xd67e('0x5'));var path=require(_0xd67e('0x6'));var sox=require(_0xd67e('0x7'));var csv=require(_0xd67e('0x8'));var ejs=require(_0xd67e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd67e('0xa'));var squel=require(_0xd67e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd67e('0xc'));var toCsv=require(_0xd67e('0x8'));var querystring=require(_0xd67e('0xd'));var Papa=require(_0xd67e('0xe'));var Redis=require('ioredis');var authService=require(_0xd67e('0xf'));var qs=require(_0xd67e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd67e('0x11'));var logger=require(_0xd67e('0x12'))(_0xd67e('0x13'));var utils=require(_0xd67e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd67e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50b3ec,_0x25b209){_0x25b209=_0x25b209||0xcc;return function(_0x194077){if(_0x194077){return _0x50b3ec[_0xd67e('0x16')](_0x25b209);}return _0x50b3ec[_0xd67e('0x17')](_0x25b209)[_0xd67e('0x18')]();};}function respondWithResult(_0xa6acd3,_0x1aaa04){_0x1aaa04=_0x1aaa04||0xc8;return function(_0xac1a18){if(_0xac1a18){return _0xa6acd3[_0xd67e('0x17')](_0x1aaa04)[_0xd67e('0x19')](_0xac1a18);}};}function respondWithFilteredResult(_0xcf86c1,_0x44c14d){return function(_0x74523){if(_0x74523){var _0x367832=typeof _0x44c14d[_0xd67e('0x1a')]===_0xd67e('0x1b')&&typeof _0x44c14d['limit']==='undefined';var _0xe3a9c5=_0x74523[_0xd67e('0x1c')];var _0x493f89=_0x367832?0x0:_0x44c14d[_0xd67e('0x1a')];var _0x1a06e4=_0x367832?_0x74523[_0xd67e('0x1c')]:_0x44c14d[_0xd67e('0x1a')]+_0x44c14d[_0xd67e('0x1d')];var _0x3fbe2b;if(_0x1a06e4>=_0xe3a9c5){_0x1a06e4=_0xe3a9c5;_0x3fbe2b=0xc8;}else{_0x3fbe2b=0xce;}_0xcf86c1['status'](_0x3fbe2b);return _0xcf86c1[_0xd67e('0x1e')]('Content-Range',_0x493f89+'-'+_0x1a06e4+'/'+_0xe3a9c5)['json'](_0x74523);}return null;};}function patchUpdates(_0x22e885){return function(_0x379792){try{jsonpatch[_0xd67e('0x1f')](_0x379792,_0x22e885,!![]);}catch(_0xa76b3c){return BPromise[_0xd67e('0x20')](_0xa76b3c);}return _0x379792['save']();};}function saveUpdates(_0x3a4b90,_0x225c6f){return function(_0x1cbb61){if(_0x1cbb61){return _0x1cbb61[_0xd67e('0x21')](_0x3a4b90)[_0xd67e('0x22')](function(_0x3bee99){return _0x3bee99;});}return null;};}function removeEntity(_0x55122c,_0x4f79f8){return function(_0x1b9ec9){if(_0x1b9ec9){return _0x1b9ec9[_0xd67e('0x23')]()['then'](function(){_0x55122c[_0xd67e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a7f71,_0x460e04){return function(_0x4b07df){if(!_0x4b07df){_0x4a7f71[_0xd67e('0x16')](0x194);}return _0x4b07df;};}function handleError(_0x1451e4,_0xeea4c6){_0xeea4c6=_0xeea4c6||0x1f4;return function(_0x5a56e6){logger[_0xd67e('0x24')](_0x5a56e6[_0xd67e('0x25')]);if(_0x5a56e6[_0xd67e('0x26')]){delete _0x5a56e6[_0xd67e('0x26')];}_0x1451e4[_0xd67e('0x17')](_0xeea4c6)['send'](_0x5a56e6);};}exports[_0xd67e('0x27')]=function(_0x406394,_0x44e703){var _0x59bc64={},_0x15d842={},_0x2059e4={'count':0x0,'rows':[]};var _0x228b7f=_[_0xd67e('0x28')](db[_0xd67e('0x29')][_0xd67e('0x2a')],function(_0x5b0ee6){return{'name':_0x5b0ee6[_0xd67e('0x2b')],'type':_0x5b0ee6[_0xd67e('0x2c')][_0xd67e('0x2d')]};});_0x15d842[_0xd67e('0x2e')]=_[_0xd67e('0x28')](_0x228b7f,_0xd67e('0x26'));_0x15d842[_0xd67e('0x2f')]=_[_0xd67e('0x30')](_0x406394[_0xd67e('0x2f')]);_0x15d842['filters']=_[_0xd67e('0x31')](_0x15d842[_0xd67e('0x2e')],_0x15d842[_0xd67e('0x2f')]);_0x59bc64['attributes']=_['intersection'](_0x15d842[_0xd67e('0x2e')],qs['fields'](_0x406394[_0xd67e('0x2f')]['fields']));_0x59bc64['attributes']=_0x59bc64[_0xd67e('0x32')][_0xd67e('0x33')]?_0x59bc64[_0xd67e('0x32')]:_0x15d842['model'];if(!_0x406394[_0xd67e('0x2f')][_0xd67e('0x34')](_0xd67e('0x35'))){_0x59bc64[_0xd67e('0x1d')]=qs[_0xd67e('0x1d')](_0x406394['query']['limit']);_0x59bc64['offset']=qs[_0xd67e('0x1a')](_0x406394[_0xd67e('0x2f')]['offset']);}_0x59bc64[_0xd67e('0x36')]=qs[_0xd67e('0x37')](_0x406394['query'][_0xd67e('0x37')]);_0x59bc64['where']=qs['filters'](_['pick'](_0x406394[_0xd67e('0x2f')],_0x15d842[_0xd67e('0x38')]),_0x228b7f);if(_0x406394[_0xd67e('0x2f')][_0xd67e('0x39')]){_0x59bc64[_0xd67e('0x3a')]=_[_0xd67e('0x3b')](_0x59bc64['where'],{'$or':_[_0xd67e('0x28')](_0x228b7f,function(_0x1a48bb){if(_0x1a48bb[_0xd67e('0x2c')]!==_0xd67e('0x3c')){var _0x1a8874={};_0x1a8874[_0x1a48bb[_0xd67e('0x26')]]={'$like':'%'+_0x406394['query'][_0xd67e('0x39')]+'%'};return _0x1a8874;}})});}_0x59bc64=_[_0xd67e('0x3b')]({},_0x59bc64,_0x406394['options']);var _0x515f1f={'where':_0x59bc64['where']};return db[_0xd67e('0x29')][_0xd67e('0x1c')](_0x515f1f)[_0xd67e('0x22')](function(_0x5f538b){_0x2059e4[_0xd67e('0x1c')]=_0x5f538b;if(_0x406394['query'][_0xd67e('0x3d')]){_0x59bc64['include']=[{'all':!![]}];}return db[_0xd67e('0x29')][_0xd67e('0x3e')](_0x59bc64);})[_0xd67e('0x22')](function(_0x32a112){_0x2059e4[_0xd67e('0x3f')]=_0x32a112;return _0x2059e4;})[_0xd67e('0x22')](respondWithFilteredResult(_0x44e703,_0x59bc64))[_0xd67e('0x40')](handleError(_0x44e703,null));};exports[_0xd67e('0x41')]=function(_0x3c0051,_0x5489b2){var _0x354938={'raw':!![],'where':{'id':_0x3c0051[_0xd67e('0x42')]['id']}},_0x504689={};_0x504689[_0xd67e('0x2e')]=_[_0xd67e('0x30')](db['ZendeskField'][_0xd67e('0x2a')]);_0x504689[_0xd67e('0x2f')]=_[_0xd67e('0x30')](_0x3c0051[_0xd67e('0x2f')]);_0x504689['filters']=_[_0xd67e('0x31')](_0x504689[_0xd67e('0x2e')],_0x504689['query']);_0x354938[_0xd67e('0x32')]=_[_0xd67e('0x31')](_0x504689[_0xd67e('0x2e')],qs[_0xd67e('0x43')](_0x3c0051[_0xd67e('0x2f')][_0xd67e('0x43')]));_0x354938['attributes']=_0x354938[_0xd67e('0x32')][_0xd67e('0x33')]?_0x354938['attributes']:_0x504689[_0xd67e('0x2e')];if(_0x3c0051[_0xd67e('0x2f')]['includeAll']){_0x354938[_0xd67e('0x44')]=[{'all':!![]}];}_0x354938=_[_0xd67e('0x3b')]({},_0x354938,_0x3c0051[_0xd67e('0x45')]);return db[_0xd67e('0x29')][_0xd67e('0x46')](_0x354938)[_0xd67e('0x22')](handleEntityNotFound(_0x5489b2,null))[_0xd67e('0x22')](respondWithResult(_0x5489b2,null))['catch'](handleError(_0x5489b2,null));};exports[_0xd67e('0x47')]=function(_0xec76fa,_0x16c5cf){return db[_0xd67e('0x29')][_0xd67e('0x47')](_0xec76fa[_0xd67e('0x48')],{})[_0xd67e('0x22')](respondWithResult(_0x16c5cf,0xc9))[_0xd67e('0x40')](handleError(_0x16c5cf,null));};exports[_0xd67e('0x21')]=function(_0x531b80,_0x94770){if(_0x531b80['body']['id']){delete _0x531b80[_0xd67e('0x48')]['id'];}return db[_0xd67e('0x29')][_0xd67e('0x46')]({'where':{'id':_0x531b80[_0xd67e('0x42')]['id']}})['then'](handleEntityNotFound(_0x94770,null))[_0xd67e('0x22')](saveUpdates(_0x531b80[_0xd67e('0x48')],null))['then'](respondWithResult(_0x94770,null))[_0xd67e('0x40')](handleError(_0x94770,null));};exports[_0xd67e('0x23')]=function(_0x51dd76,_0x1f60f3){return db[_0xd67e('0x29')]['find']({'where':{'id':_0x51dd76['params']['id']}})['then'](handleEntityNotFound(_0x1f60f3,null))['then'](removeEntity(_0x1f60f3,null))[_0xd67e('0x40')](handleError(_0x1f60f3,null));}; \ No newline at end of file +var _0x1b73=['include','options','find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','error','stack','name','map','ZendeskField','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','findAll','rows','show','params','includeAll'];(function(_0x52b789,_0x2f27d2){var _0x1ce5a8=function(_0x50f4fe){while(--_0x50f4fe){_0x52b789['push'](_0x52b789['shift']());}};_0x1ce5a8(++_0x2f27d2);}(_0x1b73,0x1d5));var _0x31b7=function(_0x3c5611,_0x3900d0){_0x3c5611=_0x3c5611-0x0;var _0x43286e=_0x1b73[_0x3c5611];return _0x43286e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x31b7('0x0'));var zipdir=require(_0x31b7('0x1'));var jsonpatch=require(_0x31b7('0x2'));var rp=require(_0x31b7('0x3'));var moment=require('moment');var BPromise=require(_0x31b7('0x4'));var Mustache=require('mustache');var util=require(_0x31b7('0x5'));var path=require(_0x31b7('0x6'));var sox=require('sox');var csv=require(_0x31b7('0x7'));var ejs=require(_0x31b7('0x8'));var fs=require('fs');var fs_extra=require(_0x31b7('0x9'));var _=require('lodash');var squel=require(_0x31b7('0xa'));var crypto=require(_0x31b7('0xb'));var jsforce=require(_0x31b7('0xc'));var deskjs=require(_0x31b7('0xd'));var toCsv=require(_0x31b7('0x7'));var querystring=require(_0x31b7('0xe'));var Papa=require(_0x31b7('0xf'));var Redis=require('ioredis');var authService=require(_0x31b7('0x10'));var qs=require(_0x31b7('0x11'));var as=require(_0x31b7('0x12'));var hardwareService=require(_0x31b7('0x13'));var logger=require(_0x31b7('0x14'))(_0x31b7('0x15'));var utils=require(_0x31b7('0x16'));var config=require(_0x31b7('0x17'));var licenseUtil=require(_0x31b7('0x18'));var db=require(_0x31b7('0x19'))['db'];function respondWithStatusCode(_0x492612,_0x32afeb){_0x32afeb=_0x32afeb||0xcc;return function(_0x55e1bb){if(_0x55e1bb){return _0x492612[_0x31b7('0x1a')](_0x32afeb);}return _0x492612[_0x31b7('0x1b')](_0x32afeb)[_0x31b7('0x1c')]();};}function respondWithResult(_0x1969d2,_0x7988e2){_0x7988e2=_0x7988e2||0xc8;return function(_0x34e917){if(_0x34e917){return _0x1969d2[_0x31b7('0x1b')](_0x7988e2)['json'](_0x34e917);}};}function respondWithFilteredResult(_0x1e93fb,_0x491c98){return function(_0x210f18){if(_0x210f18){var _0xf213c9=typeof _0x491c98['offset']===_0x31b7('0x1d')&&typeof _0x491c98[_0x31b7('0x1e')]===_0x31b7('0x1d');var _0x39eee9=_0x210f18[_0x31b7('0x1f')];var _0x5f3245=_0xf213c9?0x0:_0x491c98[_0x31b7('0x20')];var _0x437eba=_0xf213c9?_0x210f18[_0x31b7('0x1f')]:_0x491c98[_0x31b7('0x20')]+_0x491c98[_0x31b7('0x1e')];var _0x4b8ab1;if(_0x437eba>=_0x39eee9){_0x437eba=_0x39eee9;_0x4b8ab1=0xc8;}else{_0x4b8ab1=0xce;}_0x1e93fb[_0x31b7('0x1b')](_0x4b8ab1);return _0x1e93fb[_0x31b7('0x21')](_0x31b7('0x22'),_0x5f3245+'-'+_0x437eba+'/'+_0x39eee9)[_0x31b7('0x23')](_0x210f18);}return null;};}function patchUpdates(_0x5b56bc){return function(_0x892fe4){try{jsonpatch[_0x31b7('0x24')](_0x892fe4,_0x5b56bc,!![]);}catch(_0x424318){return BPromise[_0x31b7('0x25')](_0x424318);}return _0x892fe4['save']();};}function saveUpdates(_0x33dd04,_0x20cb03){return function(_0x250574){if(_0x250574){return _0x250574[_0x31b7('0x26')](_0x33dd04)[_0x31b7('0x27')](function(_0x2d24bf){return _0x2d24bf;});}return null;};}function removeEntity(_0x36492c,_0x20e5b0){return function(_0x3b0eff){if(_0x3b0eff){return _0x3b0eff['destroy']()[_0x31b7('0x27')](function(){_0x36492c[_0x31b7('0x1b')](0xcc)[_0x31b7('0x1c')]();});}};}function handleEntityNotFound(_0x2c993b,_0x4e5673){return function(_0xb8a998){if(!_0xb8a998){_0x2c993b['sendStatus'](0x194);}return _0xb8a998;};}function handleError(_0x3dd60d,_0x2da751){_0x2da751=_0x2da751||0x1f4;return function(_0x14b63f){logger[_0x31b7('0x28')](_0x14b63f[_0x31b7('0x29')]);if(_0x14b63f[_0x31b7('0x2a')]){delete _0x14b63f[_0x31b7('0x2a')];}_0x3dd60d[_0x31b7('0x1b')](_0x2da751)['send'](_0x14b63f);};}exports['index']=function(_0x503549,_0x46508a){var _0x39521d={},_0x2a7c54={},_0x4f5e1d={'count':0x0,'rows':[]};var _0x169238=_[_0x31b7('0x2b')](db[_0x31b7('0x2c')][_0x31b7('0x2d')],function(_0x58a87e){return{'name':_0x58a87e[_0x31b7('0x2e')],'type':_0x58a87e[_0x31b7('0x2f')]['key']};});_0x2a7c54['model']=_[_0x31b7('0x2b')](_0x169238,_0x31b7('0x2a'));_0x2a7c54[_0x31b7('0x30')]=_[_0x31b7('0x31')](_0x503549['query']);_0x2a7c54['filters']=_[_0x31b7('0x32')](_0x2a7c54[_0x31b7('0x33')],_0x2a7c54[_0x31b7('0x30')]);_0x39521d[_0x31b7('0x34')]=_[_0x31b7('0x32')](_0x2a7c54['model'],qs['fields'](_0x503549[_0x31b7('0x30')][_0x31b7('0x35')]));_0x39521d['attributes']=_0x39521d[_0x31b7('0x34')][_0x31b7('0x36')]?_0x39521d['attributes']:_0x2a7c54[_0x31b7('0x33')];if(!_0x503549[_0x31b7('0x30')][_0x31b7('0x37')](_0x31b7('0x38'))){_0x39521d[_0x31b7('0x1e')]=qs[_0x31b7('0x1e')](_0x503549[_0x31b7('0x30')][_0x31b7('0x1e')]);_0x39521d[_0x31b7('0x20')]=qs[_0x31b7('0x20')](_0x503549[_0x31b7('0x30')][_0x31b7('0x20')]);}_0x39521d[_0x31b7('0x39')]=qs['sort'](_0x503549['query'][_0x31b7('0x3a')]);_0x39521d[_0x31b7('0x3b')]=qs[_0x31b7('0x3c')](_[_0x31b7('0x3d')](_0x503549[_0x31b7('0x30')],_0x2a7c54[_0x31b7('0x3c')]),_0x169238);if(_0x503549[_0x31b7('0x30')][_0x31b7('0x3e')]){_0x39521d[_0x31b7('0x3b')]=_[_0x31b7('0x3f')](_0x39521d['where'],{'$or':_[_0x31b7('0x2b')](_0x169238,function(_0xfd4863){if(_0xfd4863[_0x31b7('0x2f')]!==_0x31b7('0x40')){var _0x5c9cec={};_0x5c9cec[_0xfd4863[_0x31b7('0x2a')]]={'$like':'%'+_0x503549[_0x31b7('0x30')]['filter']+'%'};return _0x5c9cec;}})});}_0x39521d=_[_0x31b7('0x3f')]({},_0x39521d,_0x503549['options']);var _0x587506={'where':_0x39521d[_0x31b7('0x3b')]};return db[_0x31b7('0x2c')][_0x31b7('0x1f')](_0x587506)[_0x31b7('0x27')](function(_0x3d0413){_0x4f5e1d['count']=_0x3d0413;if(_0x503549[_0x31b7('0x30')]['includeAll']){_0x39521d['include']=[{'all':!![]}];}return db['ZendeskField'][_0x31b7('0x41')](_0x39521d);})[_0x31b7('0x27')](function(_0x1527b3){_0x4f5e1d[_0x31b7('0x42')]=_0x1527b3;return _0x4f5e1d;})[_0x31b7('0x27')](respondWithFilteredResult(_0x46508a,_0x39521d))['catch'](handleError(_0x46508a,null));};exports[_0x31b7('0x43')]=function(_0x5d1f25,_0xef2b18){var _0x3caab0={'raw':!![],'where':{'id':_0x5d1f25[_0x31b7('0x44')]['id']}},_0x41c92e={};_0x41c92e['model']=_[_0x31b7('0x31')](db[_0x31b7('0x2c')][_0x31b7('0x2d')]);_0x41c92e['query']=_[_0x31b7('0x31')](_0x5d1f25['query']);_0x41c92e[_0x31b7('0x3c')]=_[_0x31b7('0x32')](_0x41c92e['model'],_0x41c92e[_0x31b7('0x30')]);_0x3caab0[_0x31b7('0x34')]=_[_0x31b7('0x32')](_0x41c92e[_0x31b7('0x33')],qs['fields'](_0x5d1f25[_0x31b7('0x30')]['fields']));_0x3caab0['attributes']=_0x3caab0[_0x31b7('0x34')][_0x31b7('0x36')]?_0x3caab0[_0x31b7('0x34')]:_0x41c92e[_0x31b7('0x33')];if(_0x5d1f25['query'][_0x31b7('0x45')]){_0x3caab0[_0x31b7('0x46')]=[{'all':!![]}];}_0x3caab0=_['merge']({},_0x3caab0,_0x5d1f25[_0x31b7('0x47')]);return db[_0x31b7('0x2c')][_0x31b7('0x48')](_0x3caab0)['then'](handleEntityNotFound(_0xef2b18,null))[_0x31b7('0x27')](respondWithResult(_0xef2b18,null))[_0x31b7('0x49')](handleError(_0xef2b18,null));};exports[_0x31b7('0x4a')]=function(_0x164115,_0x345059){return db[_0x31b7('0x2c')][_0x31b7('0x4a')](_0x164115[_0x31b7('0x4b')],{})['then'](respondWithResult(_0x345059,0xc9))[_0x31b7('0x49')](handleError(_0x345059,null));};exports['update']=function(_0x5a72ee,_0x22cc77){if(_0x5a72ee[_0x31b7('0x4b')]['id']){delete _0x5a72ee[_0x31b7('0x4b')]['id'];}return db[_0x31b7('0x2c')]['find']({'where':{'id':_0x5a72ee[_0x31b7('0x44')]['id']}})[_0x31b7('0x27')](handleEntityNotFound(_0x22cc77,null))[_0x31b7('0x27')](saveUpdates(_0x5a72ee['body'],null))[_0x31b7('0x27')](respondWithResult(_0x22cc77,null))[_0x31b7('0x49')](handleError(_0x22cc77,null));};exports[_0x31b7('0x4c')]=function(_0x3b5868,_0x2bf59c){return db[_0x31b7('0x2c')][_0x31b7('0x48')]({'where':{'id':_0x3b5868[_0x31b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x2bf59c,null))['then'](removeEntity(_0x2bf59c,null))[_0x31b7('0x49')](handleError(_0x2bf59c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 0448152..2822d86 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 _0x3a13=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intZendeskField.attributes','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0xea4cab,_0x195433){var _0x1cbcc4=function(_0x67eb44){while(--_0x67eb44){_0xea4cab['push'](_0xea4cab['shift']());}};_0x1cbcc4(++_0x195433);}(_0x3a13,0x138));var _0x33a1=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x3a13[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x33a1('0x0'));var util=require(_0x33a1('0x1'));var logger=require(_0x33a1('0x2'))('api');var moment=require(_0x33a1('0x3'));var BPromise=require(_0x33a1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33a1('0x5'));var rimraf=require(_0x33a1('0x6'));var config=require('../../config/environment');var attributes=require(_0x33a1('0x7'));module['exports']=function(_0x1103a7,_0x506636){return _0x1103a7[_0x33a1('0x8')](_0x33a1('0x9'),attributes,{'tableName':_0x33a1('0xa'),'paranoid':![],'indexes':[{'name':_0x33a1('0xb'),'fields':[_0x33a1('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x01cb=['define','ZendeskField','zendesk_unique_index','idField','FieldId','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01cb,0x67));var _0xb01c=function(_0x4c3ffe,_0x457374){_0x4c3ffe=_0x4c3ffe-0x0;var _0x28d3eb=_0x01cb[_0x4c3ffe];return _0x28d3eb;};'use strict';var _=require('lodash');var util=require(_0xb01c('0x0'));var logger=require(_0xb01c('0x1'))(_0xb01c('0x2'));var moment=require('moment');var BPromise=require(_0xb01c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb01c('0x4'));var rimraf=require(_0xb01c('0x5'));var config=require(_0xb01c('0x6'));var attributes=require(_0xb01c('0x7'));module[_0xb01c('0x8')]=function(_0x319e96,_0x1da2aa){return _0x319e96[_0xb01c('0x9')](_0xb01c('0xa'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xb01c('0xb'),'fields':[_0xb01c('0xc'),_0xb01c('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 90fb125..e72d931 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 _0x77fd=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x35fe1d,_0x277871){var _0x59ae61=function(_0x350605){while(--_0x350605){_0x35fe1d['push'](_0x35fe1d['shift']());}};_0x59ae61(++_0x277871);}(_0x77fd,0x84));var _0xd77f=function(_0x436ef9,_0xb38e34){_0x436ef9=_0x436ef9-0x0;var _0x27c385=_0x77fd[_0x436ef9];return _0x27c385;};'use strict';var _=require(_0xd77f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd77f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd77f('0x2'));var db=require(_0xd77f('0x3'))['db'];var utils=require(_0xd77f('0x4'));var logger=require(_0xd77f('0x5'))(_0xd77f('0x6'));var config=require('../../config/environment');var jayson=require(_0xd77f('0x7'));var client=jayson[_0xd77f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x284ab0,_0x43d17e,_0x57011a){return new BPromise(function(_0xf5fdcd,_0x114837){return client['request'](_0x284ab0,_0x57011a)[_0xd77f('0x9')](function(_0x3e8e8f){logger[_0xd77f('0xa')](_0xd77f('0xb'),_0x43d17e,_0xd77f('0xc'));logger['debug'](_0xd77f('0xd'),_0x43d17e,_0xd77f('0xc'),JSON[_0xd77f('0xe')](_0x3e8e8f));if(_0x3e8e8f['error']){if(_0x3e8e8f['error']['code']===0x1f4){logger[_0xd77f('0xf')](_0xd77f('0xb'),_0x43d17e,_0x3e8e8f['error'][_0xd77f('0x10')]);return _0x114837(_0x3e8e8f[_0xd77f('0xf')]['message']);}logger[_0xd77f('0xf')]('ZendeskField,\x20%s,\x20%s',_0x43d17e,_0x3e8e8f['error'][_0xd77f('0x10')]);return _0xf5fdcd(_0x3e8e8f['error'][_0xd77f('0x10')]);}else{logger[_0xd77f('0xa')](_0xd77f('0xb'),_0x43d17e,'request\x20sent');_0xf5fdcd(_0x3e8e8f[_0xd77f('0x11')][_0xd77f('0x10')]);}})[_0xd77f('0x12')](function(_0x561bdb){logger[_0xd77f('0xf')](_0xd77f('0xb'),_0x43d17e,_0x561bdb);_0x114837(_0x561bdb);});});} \ No newline at end of file +var _0x97b7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x97b7,0x1ce));var _0x797b=function(_0x3d7559,_0x2bef9f){_0x3d7559=_0x3d7559-0x0;var _0x577b3d=_0x97b7[_0x3d7559];return _0x577b3d;};'use strict';var _=require(_0x797b('0x0'));var util=require('util');var moment=require(_0x797b('0x1'));var BPromise=require(_0x797b('0x2'));var rs=require(_0x797b('0x3'));var fs=require('fs');var Redis=require(_0x797b('0x4'));var db=require(_0x797b('0x5'))['db'];var utils=require(_0x797b('0x6'));var logger=require('../../config/logger')(_0x797b('0x7'));var config=require(_0x797b('0x8'));var jayson=require(_0x797b('0x9'));var client=jayson[_0x797b('0xa')][_0x797b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x506658,_0x2a07c0,_0x4755f1){return new BPromise(function(_0x237eb3,_0x3bfcdc){return client[_0x797b('0xc')](_0x506658,_0x4755f1)['then'](function(_0x5b6368){logger[_0x797b('0xd')](_0x797b('0xe'),_0x2a07c0,_0x797b('0xf'));logger[_0x797b('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x2a07c0,'request\x20sent',JSON[_0x797b('0x11')](_0x5b6368));if(_0x5b6368['error']){if(_0x5b6368[_0x797b('0x12')][_0x797b('0x13')]===0x1f4){logger[_0x797b('0x12')](_0x797b('0xe'),_0x2a07c0,_0x5b6368['error'][_0x797b('0x14')]);return _0x3bfcdc(_0x5b6368[_0x797b('0x12')][_0x797b('0x14')]);}logger[_0x797b('0x12')]('ZendeskField,\x20%s,\x20%s',_0x2a07c0,_0x5b6368[_0x797b('0x12')][_0x797b('0x14')]);return _0x237eb3(_0x5b6368['error'][_0x797b('0x14')]);}else{logger['info'](_0x797b('0xe'),_0x2a07c0,_0x797b('0xf'));_0x237eb3(_0x5b6368[_0x797b('0x15')][_0x797b('0x14')]);}})[_0x797b('0x16')](function(_0x21c324){logger[_0x797b('0x12')](_0x797b('0xe'),_0x2a07c0,_0x21c324);_0x3bfcdc(_0x21c324);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 0584e8d..6b24c4a 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 _0xcd5e=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','getConfigurations','/:id/fields','post','create','/:id/configurations','update'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xcd5e,0x95));var _0xecd5=function(_0x50ce1f,_0x202786){_0x50ce1f=_0x50ce1f-0x0;var _0x31b84c=_0xcd5e[_0x50ce1f];return _0x31b84c;};'use strict';var multer=require(_0xecd5('0x0'));var util=require(_0xecd5('0x1'));var path=require(_0xecd5('0x2'));var timeout=require(_0xecd5('0x3'));var express=require(_0xecd5('0x4'));var router=express[_0xecd5('0x5')]();var fs_extra=require(_0xecd5('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xecd5('0x7'));var config=require(_0xecd5('0x8'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xecd5('0x9')](),controller['index']);router['get'](_0xecd5('0xa'),auth[_0xecd5('0x9')](),controller[_0xecd5('0xb')]);router[_0xecd5('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xecd5('0xd')]);router[_0xecd5('0xc')](_0xecd5('0xe'),auth[_0xecd5('0x9')](),controller['getFields']);router[_0xecd5('0xf')]('/',auth['isAuthenticated'](),controller[_0xecd5('0x10')]);router[_0xecd5('0xf')](_0xecd5('0x11'),auth[_0xecd5('0x9')](),controller['addConfiguration']);router['put'](_0xecd5('0xa'),auth['isAuthenticated'](),controller[_0xecd5('0x12')]);router['delete'](_0xecd5('0xa'),auth['isAuthenticated'](),controller[_0xecd5('0x13')]);module[_0xecd5('0x14')]=router; \ No newline at end of file +var _0xba62=['/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','/:id','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3ac7e6,_0x392fe5){var _0x592a9b=function(_0x515656){while(--_0x515656){_0x3ac7e6['push'](_0x3ac7e6['shift']());}};_0x592a9b(++_0x392fe5);}(_0xba62,0xb3));var _0x2ba6=function(_0x21ccfc,_0x48834e){_0x21ccfc=_0x21ccfc-0x0;var _0x279454=_0xba62[_0x21ccfc];return _0x279454;};'use strict';var multer=require('multer');var util=require(_0x2ba6('0x0'));var path=require(_0x2ba6('0x1'));var timeout=require(_0x2ba6('0x2'));var express=require('express');var router=express[_0x2ba6('0x3')]();var fs_extra=require(_0x2ba6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2ba6('0x5'));var config=require(_0x2ba6('0x6'));var controller=require('./intZohoAccount.controller');router[_0x2ba6('0x7')]('/',auth[_0x2ba6('0x8')](),controller[_0x2ba6('0x9')]);router[_0x2ba6('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x2ba6('0x7')](_0x2ba6('0xa'),auth[_0x2ba6('0x8')](),controller[_0x2ba6('0xb')]);router['get'](_0x2ba6('0xc'),auth[_0x2ba6('0x8')](),controller[_0x2ba6('0xd')]);router[_0x2ba6('0xe')]('/',auth[_0x2ba6('0x8')](),controller[_0x2ba6('0xf')]);router[_0x2ba6('0xe')]('/:id/configurations',auth[_0x2ba6('0x8')](),controller[_0x2ba6('0x10')]);router['put'](_0x2ba6('0x11'),auth[_0x2ba6('0x8')](),controller['update']);router[_0x2ba6('0x12')](_0x2ba6('0x11'),auth[_0x2ba6('0x8')](),controller[_0x2ba6('0x13')]);module[_0x2ba6('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 81f5d54..5355e44 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 _0xec56=['STRING','sequelize'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xec56,0x1bd));var _0x6ec5=function(_0x3f1c0d,_0x2c2626){_0x3f1c0d=_0x3f1c0d-0x0;var _0x39d0ae=_0xec56[_0x3f1c0d];return _0x39d0ae;};'use strict';var Sequelize=require(_0x6ec5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6ec5('0x1')]},'host':{'type':Sequelize[_0x6ec5('0x1')]},'zone':{'type':Sequelize[_0x6ec5('0x1')]},'clientId':{'type':Sequelize[_0x6ec5('0x1')]},'clientSecret':{'type':Sequelize[_0x6ec5('0x1')]},'serverUrl':{'type':Sequelize[_0x6ec5('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0x6ec5('0x1')]},'refreshToken':{'type':Sequelize[_0x6ec5('0x1')]}}; \ No newline at end of file +var _0x41bb=['exports','STRING','sequelize'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0x41bb,0xc5));var _0xb41b=function(_0x2e323f,_0x4d5934){_0x2e323f=_0x2e323f-0x0;var _0x3052da=_0x41bb[_0x2e323f];return _0x3052da;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f79387d..580b2c1 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 _0xa072=['test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','ZohoAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','type','VIRTUAL','count','includeAll','findAll','rows','catch','params','rawAttributes','include','create','body','find','getConfigurations','findOne','ZohoConfiguration','options','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','serverUrl','code','host','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Owner','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values'];(function(_0x10ac8e,_0x47f8f4){var _0x53d5fb=function(_0x45a75){while(--_0x45a75){_0x10ac8e['push'](_0x10ac8e['shift']());}};_0x53d5fb(++_0x47f8f4);}(_0xa072,0x18f));var _0x2a07=function(_0x44d869,_0x49425f){_0x44d869=_0x44d869-0x0;var _0x1ed521=_0xa072[_0x44d869];return _0x1ed521;};'use strict';var emlformat=require(_0x2a07('0x0'));var rimraf=require(_0x2a07('0x1'));var zipdir=require(_0x2a07('0x2'));var jsonpatch=require(_0x2a07('0x3'));var rp=require(_0x2a07('0x4'));var moment=require(_0x2a07('0x5'));var BPromise=require(_0x2a07('0x6'));var Mustache=require(_0x2a07('0x7'));var util=require('util');var path=require(_0x2a07('0x8'));var sox=require(_0x2a07('0x9'));var csv=require(_0x2a07('0xa'));var ejs=require(_0x2a07('0xb'));var fs=require('fs');var fs_extra=require(_0x2a07('0xc'));var _=require(_0x2a07('0xd'));var squel=require(_0x2a07('0xe'));var crypto=require(_0x2a07('0xf'));var jsforce=require(_0x2a07('0x10'));var deskjs=require(_0x2a07('0x11'));var toCsv=require(_0x2a07('0xa'));var querystring=require('querystring');var Papa=require(_0x2a07('0x12'));var Redis=require(_0x2a07('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2a07('0x14'));var hardwareService=require(_0x2a07('0x15'));var logger=require(_0x2a07('0x16'))(_0x2a07('0x17'));var utils=require(_0x2a07('0x18'));var config=require(_0x2a07('0x19'));var licenseUtil=require(_0x2a07('0x1a'));var db=require(_0x2a07('0x1b'))['db'];var integrations=require(_0x2a07('0x1c'));function respondWithStatusCode(_0x3208d8,_0x59b39e){_0x59b39e=_0x59b39e||0xcc;return function(_0x266745){if(_0x266745){return _0x3208d8[_0x2a07('0x1d')](_0x59b39e);}return _0x3208d8[_0x2a07('0x1e')](_0x59b39e)[_0x2a07('0x1f')]();};}function respondWithResult(_0xfbea6b,_0x44bc65){_0x44bc65=_0x44bc65||0xc8;return function(_0x32b187){if(_0x32b187){return _0xfbea6b[_0x2a07('0x1e')](_0x44bc65)[_0x2a07('0x20')](_0x32b187);}};}function respondWithFilteredResult(_0x502728,_0x3df8ae){return function(_0x399879){if(_0x399879){var _0x5cb9bb=typeof _0x3df8ae[_0x2a07('0x21')]==='undefined'&&typeof _0x3df8ae[_0x2a07('0x22')]===_0x2a07('0x23');var _0x48abef=_0x399879['count'];var _0xfcde13=_0x5cb9bb?0x0:_0x3df8ae[_0x2a07('0x21')];var _0x4ad294=_0x5cb9bb?_0x399879['count']:_0x3df8ae[_0x2a07('0x21')]+_0x3df8ae[_0x2a07('0x22')];var _0x475fdb;if(_0x4ad294>=_0x48abef){_0x4ad294=_0x48abef;_0x475fdb=0xc8;}else{_0x475fdb=0xce;}_0x502728['status'](_0x475fdb);return _0x502728[_0x2a07('0x24')](_0x2a07('0x25'),_0xfcde13+'-'+_0x4ad294+'/'+_0x48abef)[_0x2a07('0x20')](_0x399879);}return null;};}function patchUpdates(_0x1aa6cb){return function(_0x633ccb){try{jsonpatch[_0x2a07('0x26')](_0x633ccb,_0x1aa6cb,!![]);}catch(_0x8c7111){return BPromise['reject'](_0x8c7111);}return _0x633ccb['save']();};}function saveUpdates(_0x29895c,_0x55508d){return function(_0x33073f){if(_0x33073f){return _0x33073f[_0x2a07('0x27')](_0x29895c)[_0x2a07('0x28')](function(_0x1c3b6d){return _0x1c3b6d;});}return null;};}function removeEntity(_0x1fdd3f,_0x4df89b){return function(_0x4e7406){if(_0x4e7406){return _0x4e7406[_0x2a07('0x29')]()['then'](function(){_0x1fdd3f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x230204,_0x2becfc){return function(_0x4ba308){if(!_0x4ba308){_0x230204[_0x2a07('0x1d')](0x194);}return _0x4ba308;};}function handleError(_0x44a5bb,_0xe6803){_0xe6803=_0xe6803||0x1f4;return function(_0x44e06a){logger[_0x2a07('0x2a')](_0x44e06a[_0x2a07('0x2b')]);if(_0x44e06a[_0x2a07('0x2c')]){delete _0x44e06a[_0x2a07('0x2c')];}_0x44a5bb[_0x2a07('0x1e')](_0xe6803)[_0x2a07('0x2d')](_0x44e06a);};}exports[_0x2a07('0x2e')]=function(_0x383ad3,_0x4ccf72){var _0x4f0663={},_0x379d22={},_0x118e7e={'count':0x0,'rows':[]};var _0x5b2721=_['map'](db[_0x2a07('0x2f')]['rawAttributes'],function(_0x4b2c5f){return{'name':_0x4b2c5f[_0x2a07('0x30')],'type':_0x4b2c5f['type'][_0x2a07('0x31')]};});_0x379d22[_0x2a07('0x32')]=_['map'](_0x5b2721,_0x2a07('0x2c'));_0x379d22[_0x2a07('0x33')]=_[_0x2a07('0x34')](_0x383ad3[_0x2a07('0x33')]);_0x379d22[_0x2a07('0x35')]=_[_0x2a07('0x36')](_0x379d22[_0x2a07('0x32')],_0x379d22[_0x2a07('0x33')]);_0x4f0663[_0x2a07('0x37')]=_[_0x2a07('0x36')](_0x379d22[_0x2a07('0x32')],qs[_0x2a07('0x38')](_0x383ad3[_0x2a07('0x33')][_0x2a07('0x38')]));_0x4f0663[_0x2a07('0x37')]=_0x4f0663[_0x2a07('0x37')][_0x2a07('0x39')]?_0x4f0663[_0x2a07('0x37')]:_0x379d22['model'];if(!_0x383ad3[_0x2a07('0x33')][_0x2a07('0x3a')](_0x2a07('0x3b'))){_0x4f0663[_0x2a07('0x22')]=qs[_0x2a07('0x22')](_0x383ad3[_0x2a07('0x33')][_0x2a07('0x22')]);_0x4f0663['offset']=qs[_0x2a07('0x21')](_0x383ad3['query'][_0x2a07('0x21')]);}_0x4f0663[_0x2a07('0x3c')]=qs[_0x2a07('0x3d')](_0x383ad3['query']['sort']);_0x4f0663['where']=qs[_0x2a07('0x35')](_[_0x2a07('0x3e')](_0x383ad3[_0x2a07('0x33')],_0x379d22[_0x2a07('0x35')]),_0x5b2721);if(_0x383ad3[_0x2a07('0x33')][_0x2a07('0x3f')]){_0x4f0663['where']=_[_0x2a07('0x40')](_0x4f0663[_0x2a07('0x41')],{'$or':_[_0x2a07('0x42')](_0x5b2721,function(_0x3369f2){if(_0x3369f2[_0x2a07('0x43')]!==_0x2a07('0x44')){var _0x1e4a57={};_0x1e4a57[_0x3369f2[_0x2a07('0x2c')]]={'$like':'%'+_0x383ad3[_0x2a07('0x33')][_0x2a07('0x3f')]+'%'};return _0x1e4a57;}})});}_0x4f0663=_[_0x2a07('0x40')]({},_0x4f0663,_0x383ad3['options']);var _0x24883c={'where':_0x4f0663[_0x2a07('0x41')]};return db[_0x2a07('0x2f')]['count'](_0x24883c)[_0x2a07('0x28')](function(_0x3d694c){_0x118e7e[_0x2a07('0x45')]=_0x3d694c;if(_0x383ad3[_0x2a07('0x33')][_0x2a07('0x46')]){_0x4f0663['include']=[{'all':!![]}];}return db[_0x2a07('0x2f')][_0x2a07('0x47')](_0x4f0663);})[_0x2a07('0x28')](function(_0x2a9391){_0x118e7e[_0x2a07('0x48')]=_0x2a9391;return _0x118e7e;})[_0x2a07('0x28')](respondWithFilteredResult(_0x4ccf72,_0x4f0663))[_0x2a07('0x49')](handleError(_0x4ccf72,null));};exports['show']=function(_0x33fc84,_0x5e9c50){var _0x5ad35b={'raw':![],'where':{'id':_0x33fc84[_0x2a07('0x4a')]['id']}},_0x48ca9c={};_0x48ca9c[_0x2a07('0x32')]=_['keys'](db[_0x2a07('0x2f')][_0x2a07('0x4b')]);_0x48ca9c[_0x2a07('0x33')]=_[_0x2a07('0x34')](_0x33fc84[_0x2a07('0x33')]);_0x48ca9c[_0x2a07('0x35')]=_[_0x2a07('0x36')](_0x48ca9c[_0x2a07('0x32')],_0x48ca9c['query']);_0x5ad35b['attributes']=_[_0x2a07('0x36')](_0x48ca9c[_0x2a07('0x32')],qs[_0x2a07('0x38')](_0x33fc84[_0x2a07('0x33')][_0x2a07('0x38')]));_0x5ad35b['attributes']=_0x5ad35b['attributes'][_0x2a07('0x39')]?_0x5ad35b[_0x2a07('0x37')]:_0x48ca9c['model'];if(_0x33fc84[_0x2a07('0x33')][_0x2a07('0x46')]){_0x5ad35b[_0x2a07('0x4c')]=[{'all':!![]}];}_0x5ad35b=_['merge']({},_0x5ad35b,_0x33fc84['options']);return db[_0x2a07('0x2f')]['find'](_0x5ad35b)[_0x2a07('0x28')](handleEntityNotFound(_0x5e9c50,null))['then'](respondWithResult(_0x5e9c50,null))[_0x2a07('0x49')](handleError(_0x5e9c50,null));};exports[_0x2a07('0x4d')]=function(_0x3ca209,_0x571ad5){return db['ZohoAccount'][_0x2a07('0x4d')](_0x3ca209[_0x2a07('0x4e')],{})['then'](respondWithResult(_0x571ad5,0xc9))[_0x2a07('0x49')](handleError(_0x571ad5,null));};exports['update']=function(_0x5cda1f,_0xf3a98){if(_0x5cda1f[_0x2a07('0x4e')]['id']){delete _0x5cda1f[_0x2a07('0x4e')]['id'];}return db[_0x2a07('0x2f')][_0x2a07('0x4f')]({'where':{'id':_0x5cda1f[_0x2a07('0x4a')]['id']}})[_0x2a07('0x28')](handleEntityNotFound(_0xf3a98,null))[_0x2a07('0x28')](saveUpdates(_0x5cda1f['body'],null))[_0x2a07('0x28')](respondWithResult(_0xf3a98,null))[_0x2a07('0x49')](handleError(_0xf3a98,null));};exports[_0x2a07('0x29')]=function(_0x53a233,_0x97bf63){return db[_0x2a07('0x2f')][_0x2a07('0x4f')]({'where':{'id':_0x53a233[_0x2a07('0x4a')]['id']}})[_0x2a07('0x28')](handleEntityNotFound(_0x97bf63,null))['then'](removeEntity(_0x97bf63,null))[_0x2a07('0x49')](handleError(_0x97bf63,null));};exports[_0x2a07('0x50')]=function(_0x468c7b,_0x174bae,_0x357565){var _0x35aba3={};var _0x1ef84c={};var _0x3591ab;var _0x9ebeb2;return db['ZohoAccount'][_0x2a07('0x51')]({'where':{'id':_0x468c7b[_0x2a07('0x4a')]['id']}})['then'](handleEntityNotFound(_0x174bae,null))[_0x2a07('0x28')](function(_0x325c92){if(_0x325c92){_0x3591ab=_0x325c92;_0x1ef84c[_0x2a07('0x32')]=_[_0x2a07('0x34')](db[_0x2a07('0x52')][_0x2a07('0x4b')]);_0x1ef84c[_0x2a07('0x33')]=_[_0x2a07('0x34')](_0x468c7b[_0x2a07('0x33')]);_0x1ef84c[_0x2a07('0x35')]=_['intersection'](_0x1ef84c[_0x2a07('0x32')],_0x1ef84c[_0x2a07('0x33')]);_0x35aba3[_0x2a07('0x37')]=_[_0x2a07('0x36')](_0x1ef84c[_0x2a07('0x32')],qs['fields'](_0x468c7b[_0x2a07('0x33')][_0x2a07('0x38')]));_0x35aba3[_0x2a07('0x37')]=_0x35aba3[_0x2a07('0x37')]['length']?_0x35aba3['attributes']:_0x1ef84c[_0x2a07('0x32')];_0x35aba3['order']=qs[_0x2a07('0x3d')](_0x468c7b[_0x2a07('0x33')][_0x2a07('0x3d')]);_0x35aba3['where']=qs[_0x2a07('0x35')](_[_0x2a07('0x3e')](_0x468c7b['query'],_0x1ef84c[_0x2a07('0x35')]));if(_0x468c7b[_0x2a07('0x33')][_0x2a07('0x3f')]){_0x35aba3[_0x2a07('0x41')]=_['merge'](_0x35aba3[_0x2a07('0x41')],{'$or':_[_0x2a07('0x42')](_0x35aba3[_0x2a07('0x37')],function(_0x55ac6b){var _0x4219df={};_0x4219df[_0x55ac6b]={'$like':'%'+_0x468c7b[_0x2a07('0x33')][_0x2a07('0x3f')]+'%'};return _0x4219df;})});}_0x35aba3=_['merge']({},_0x35aba3,_0x468c7b[_0x2a07('0x53')]);return _0x3591ab['getConfigurations'](_0x35aba3);}})['then'](function(_0x2f2c5f){if(_0x2f2c5f){_0x9ebeb2=_0x2f2c5f['length'];if(!_0x468c7b[_0x2a07('0x33')]['hasOwnProperty'](_0x2a07('0x3b'))){_0x35aba3['limit']=qs[_0x2a07('0x22')](_0x468c7b[_0x2a07('0x33')][_0x2a07('0x22')]);_0x35aba3[_0x2a07('0x21')]=qs[_0x2a07('0x21')](_0x468c7b[_0x2a07('0x33')][_0x2a07('0x21')]);}return _0x3591ab[_0x2a07('0x50')](_0x35aba3);}})[_0x2a07('0x28')](function(_0x2dc964){if(_0x2dc964){return _0x2dc964?{'count':_0x9ebeb2,'rows':_0x2dc964}:null;}})[_0x2a07('0x28')](respondWithResult(_0x174bae,null))['catch'](handleError(_0x174bae,null));};exports[_0x2a07('0x54')]=function(_0x7d2e88,_0x730a4e,_0x5bafe3){if(_0x7d2e88['body']['id']){delete _0x7d2e88[_0x2a07('0x4e')]['id'];}return db[_0x2a07('0x2f')][_0x2a07('0x51')]({'where':{'id':_0x7d2e88[_0x2a07('0x4a')]['id']}})[_0x2a07('0x28')](handleEntityNotFound(_0x730a4e,null))['then'](function(_0x40466b){if(_0x40466b){_0x7d2e88[_0x2a07('0x4e')]['AccountId']=_0x40466b['id'];_0x7d2e88[_0x2a07('0x4e')][_0x2a07('0x55')]=integrations[_0x2a07('0x56')](_0x7d2e88[_0x2a07('0x4e')][_0x2a07('0x57')],_0x7d2e88['body'][_0x2a07('0x43')]);_0x7d2e88[_0x2a07('0x4e')][_0x2a07('0x58')]=integrations[_0x2a07('0x59')](_0x7d2e88[_0x2a07('0x4e')]['channel'],_0x7d2e88[_0x2a07('0x4e')][_0x2a07('0x43')]);return db[_0x2a07('0x52')][_0x2a07('0x4d')](_0x7d2e88[_0x2a07('0x4e')],{'include':[{'model':db[_0x2a07('0x5a')],'as':_0x2a07('0x55')},{'model':db[_0x2a07('0x5a')],'as':_0x2a07('0x58')}]});}return null;})[_0x2a07('0x28')](respondWithResult(_0x730a4e,null))[_0x2a07('0x49')](handleError(_0x730a4e,null));};function getAccessToken(_0x1c13ec){return new Promise(function(_0x4242d7,_0x342751){var _0x5639c1;switch(_0x1c13ec[_0x2a07('0x5b')]){case'US':_0x5639c1=_0x2a07('0x5c');break;case'AU':_0x5639c1=_0x2a07('0x5d');break;case'EU':_0x5639c1='https://accounts.zoho.eu';break;case'IN':_0x5639c1=_0x2a07('0x5e');break;case'CN':_0x5639c1=_0x2a07('0x5f');break;default:_0x5639c1='https://accounts.zoho.eu';break;}var _0x3847b1={'method':_0x2a07('0x60'),'uri':_0x5639c1+_0x2a07('0x61'),'qs':{'refresh_token':_0x1c13ec[_0x2a07('0x62')],'client_id':_0x1c13ec[_0x2a07('0x63')],'client_secret':_0x1c13ec['clientSecret'],'grant_type':_0x2a07('0x64')},'json':!![]};return rp(_0x3847b1)['then'](function(_0x4431af){if(_0x4431af['access_token']){_0x4242d7(_0x4431af[_0x2a07('0x65')]);}else{_0x342751(_0x2a07('0x66'));}})[_0x2a07('0x49')](function(_0x5daeac){_0x342751(_0x5daeac);});});}exports[_0x2a07('0x67')]=function(_0xa13075,_0x599ad1,_0x2a8227){var _0x3ceb5e,_0x485efe,_0x26c152,_0x11c2ac,_0x4167e9;return db[_0x2a07('0x2f')]['findOne']({'where':{'id':_0xa13075[_0x2a07('0x4a')]['id']},'attributes':['id','host',_0x2a07('0x5b'),_0x2a07('0x63'),_0x2a07('0x68'),_0x2a07('0x69'),_0x2a07('0x6a'),_0x2a07('0x62')]})[_0x2a07('0x28')](handleEntityNotFound(_0x599ad1,null))[_0x2a07('0x28')](function(_0x2097ca){_0x4167e9=_0x2097ca;_0x3ceb5e=_0x4167e9[_0x2a07('0x6b')];_0x485efe=_0x3ceb5e==='zoho.eu'?'eu':'com';_0x26c152=_0x4167e9[_0x2a07('0x69')];var _0x1bc54f=_0x26c152[_0x2a07('0x6c')](-0x1);if(_0x1bc54f==='/'||_0x1bc54f==='\x5c'||_0x1bc54f===':'){_0x26c152=_0x26c152[_0x2a07('0x6d')](0x0,_0x26c152[_0x2a07('0x6e')](_0x1bc54f));}if(!_0x4167e9[_0x2a07('0x62')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x4167e9);})[_0x2a07('0x28')](function(_0x16578e){if(_0x16578e){return rp({'method':_0x2a07('0x6f'),'uri':util['format'](_0x2a07('0x70'),_0x485efe),'qs':{'module':_0x2a07('0x71')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x16578e},'json':!![]});}})[_0x2a07('0x28')](function(_0xfc0887){if(_0xfc0887){if(_0xfc0887[_0x2a07('0x72')]&&_0xfc0887['response']['error']){throw new Error(_0xfc0887[_0x2a07('0x72')][_0x2a07('0x2a')][_0x2a07('0x73')]);}var _0x7a801a=[];var _0x3114cb=[];var _0x37c95c=[_0x2a07('0x74'),'Subject','Description',_0x2a07('0x75'),'Call_Duration',_0x2a07('0x76'),_0x2a07('0x77'),_0x2a07('0x78')];_0x3114cb=_[_0x2a07('0x79')](_0xfc0887[_0x2a07('0x38')],function(_0x48c0db){return _0x37c95c['includes'](_0x48c0db[_0x2a07('0x7a')]);});for(var _0x50218f=0x0;_0x50218f<_0x3114cb['length'];_0x50218f++){if(_0x3114cb[_0x50218f][_0x2a07('0x7b')]===![]){_0x7a801a[_0x2a07('0x7c')]({'id':_0x3114cb[_0x50218f]['id'],'name':_0x3114cb[_0x50218f][_0x2a07('0x7d')],'custom':_0x3114cb[_0x50218f][_0x2a07('0x7e')],'options':_0x3114cb[_0x50218f]['data_type']===_0x2a07('0x7f')&&_0x3114cb[_0x50218f][_0x2a07('0x80')][_0x2a07('0x39')]>-0x1?_[_0x2a07('0x42')](_0x3114cb[_0x50218f][_0x2a07('0x80')],function(_0x3ffb9c){return{'name':_0x3ffb9c,'value':_0x3ffb9c};}):[]});}}return{'count':_0x7a801a['length'],'rows':_0x7a801a};}else{return{'count':0x0,'rows':[]};}})[_0x2a07('0x28')](respondWithResult(_0x599ad1,null))[_0x2a07('0x49')](function(_0x56a9ad){var _0x1d35f7=_0xa13075['query'][_0x2a07('0x81')]?0x1f4:_0x56a9ad[_0x2a07('0x82')]||0x1f4;logger[_0x2a07('0x2a')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1d35f7,JSON['stringify'](_0x56a9ad));delete _0x56a9ad[_0x2a07('0x2c')];if(_0x1d35f7===0x191){_0x1d35f7=0x190;}_0x599ad1[_0x2a07('0x1e')](_0x1d35f7)['send'](_0xa13075[_0x2a07('0x33')][_0x2a07('0x81')]?{'message':_0x2a07('0x83'),'statusCode':_0x56a9ad['statusCode']}:_0x56a9ad);});}; \ No newline at end of file +var _0x720d=['hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','params','ZohoAccount','length','include','create','body','update','find','getConfigurations','findOne','pick','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoConfiguration','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','zone','serverUrl','code','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','system_mandatory','display_label','custom_field','data_type','pick_list_values','stringify','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x720d,0xb7));var _0xd720=function(_0x78ea1a,_0x2275eb){_0x78ea1a=_0x78ea1a-0x0;var _0x53d92e=_0x720d[_0x78ea1a];return _0x53d92e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd720('0x0'));var zipdir=require(_0xd720('0x1'));var jsonpatch=require(_0xd720('0x2'));var rp=require(_0xd720('0x3'));var moment=require(_0xd720('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd720('0x5'));var util=require(_0xd720('0x6'));var path=require(_0xd720('0x7'));var sox=require('sox');var csv=require(_0xd720('0x8'));var ejs=require(_0xd720('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd720('0xa'));var squel=require('squel');var crypto=require(_0xd720('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd720('0xc'));var toCsv=require(_0xd720('0x8'));var querystring=require('querystring');var Papa=require(_0xd720('0xd'));var Redis=require('ioredis');var authService=require(_0xd720('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd720('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd720('0x10'))('api');var utils=require(_0xd720('0x11'));var config=require(_0xd720('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd720('0x13'));function respondWithStatusCode(_0x6001ce,_0xef731f){_0xef731f=_0xef731f||0xcc;return function(_0x187a82){if(_0x187a82){return _0x6001ce[_0xd720('0x14')](_0xef731f);}return _0x6001ce[_0xd720('0x15')](_0xef731f)[_0xd720('0x16')]();};}function respondWithResult(_0x365ac5,_0x560ed7){_0x560ed7=_0x560ed7||0xc8;return function(_0x164ecc){if(_0x164ecc){return _0x365ac5[_0xd720('0x15')](_0x560ed7)['json'](_0x164ecc);}};}function respondWithFilteredResult(_0x4a1551,_0x3fccee){return function(_0x3c5dca){if(_0x3c5dca){var _0x317947=typeof _0x3fccee[_0xd720('0x17')]===_0xd720('0x18')&&typeof _0x3fccee[_0xd720('0x19')]===_0xd720('0x18');var _0x2ca01d=_0x3c5dca[_0xd720('0x1a')];var _0xdd4b57=_0x317947?0x0:_0x3fccee[_0xd720('0x17')];var _0x41b4b2=_0x317947?_0x3c5dca[_0xd720('0x1a')]:_0x3fccee['offset']+_0x3fccee[_0xd720('0x19')];var _0x4ec711;if(_0x41b4b2>=_0x2ca01d){_0x41b4b2=_0x2ca01d;_0x4ec711=0xc8;}else{_0x4ec711=0xce;}_0x4a1551[_0xd720('0x15')](_0x4ec711);return _0x4a1551[_0xd720('0x1b')](_0xd720('0x1c'),_0xdd4b57+'-'+_0x41b4b2+'/'+_0x2ca01d)[_0xd720('0x1d')](_0x3c5dca);}return null;};}function patchUpdates(_0x2751b0){return function(_0x2999f7){try{jsonpatch['apply'](_0x2999f7,_0x2751b0,!![]);}catch(_0x11ae53){return BPromise[_0xd720('0x1e')](_0x11ae53);}return _0x2999f7[_0xd720('0x1f')]();};}function saveUpdates(_0x4777c1,_0x302e25){return function(_0x12db1f){if(_0x12db1f){return _0x12db1f['update'](_0x4777c1)['then'](function(_0x4cb08b){return _0x4cb08b;});}return null;};}function removeEntity(_0xc5f264,_0x3e9151){return function(_0x8b3f00){if(_0x8b3f00){return _0x8b3f00[_0xd720('0x20')]()[_0xd720('0x21')](function(){_0xc5f264[_0xd720('0x15')](0xcc)[_0xd720('0x16')]();});}};}function handleEntityNotFound(_0x43a56c,_0xe64601){return function(_0x498665){if(!_0x498665){_0x43a56c[_0xd720('0x14')](0x194);}return _0x498665;};}function handleError(_0x22a909,_0x396749){_0x396749=_0x396749||0x1f4;return function(_0x2a6067){logger[_0xd720('0x22')](_0x2a6067[_0xd720('0x23')]);if(_0x2a6067[_0xd720('0x24')]){delete _0x2a6067[_0xd720('0x24')];}_0x22a909[_0xd720('0x15')](_0x396749)[_0xd720('0x25')](_0x2a6067);};}exports[_0xd720('0x26')]=function(_0x434641,_0xb5029c){var _0x3c382b={},_0x21d255={},_0x655a3e={'count':0x0,'rows':[]};var _0x3101bd=_[_0xd720('0x27')](db['ZohoAccount'][_0xd720('0x28')],function(_0x428ed2){return{'name':_0x428ed2[_0xd720('0x29')],'type':_0x428ed2[_0xd720('0x2a')][_0xd720('0x2b')]};});_0x21d255['model']=_[_0xd720('0x27')](_0x3101bd,_0xd720('0x24'));_0x21d255[_0xd720('0x2c')]=_[_0xd720('0x2d')](_0x434641[_0xd720('0x2c')]);_0x21d255[_0xd720('0x2e')]=_['intersection'](_0x21d255[_0xd720('0x2f')],_0x21d255[_0xd720('0x2c')]);_0x3c382b[_0xd720('0x30')]=_[_0xd720('0x31')](_0x21d255[_0xd720('0x2f')],qs[_0xd720('0x32')](_0x434641[_0xd720('0x2c')]['fields']));_0x3c382b[_0xd720('0x30')]=_0x3c382b['attributes']['length']?_0x3c382b[_0xd720('0x30')]:_0x21d255[_0xd720('0x2f')];if(!_0x434641[_0xd720('0x2c')][_0xd720('0x33')](_0xd720('0x34'))){_0x3c382b[_0xd720('0x19')]=qs[_0xd720('0x19')](_0x434641[_0xd720('0x2c')][_0xd720('0x19')]);_0x3c382b[_0xd720('0x17')]=qs[_0xd720('0x17')](_0x434641[_0xd720('0x2c')][_0xd720('0x17')]);}_0x3c382b[_0xd720('0x35')]=qs[_0xd720('0x36')](_0x434641[_0xd720('0x2c')][_0xd720('0x36')]);_0x3c382b['where']=qs[_0xd720('0x2e')](_['pick'](_0x434641['query'],_0x21d255['filters']),_0x3101bd);if(_0x434641['query']['filter']){_0x3c382b['where']=_['merge'](_0x3c382b[_0xd720('0x37')],{'$or':_[_0xd720('0x27')](_0x3101bd,function(_0x4c53c6){if(_0x4c53c6['type']!=='VIRTUAL'){var _0x56f9ba={};_0x56f9ba[_0x4c53c6['name']]={'$like':'%'+_0x434641[_0xd720('0x2c')][_0xd720('0x38')]+'%'};return _0x56f9ba;}})});}_0x3c382b=_[_0xd720('0x39')]({},_0x3c382b,_0x434641[_0xd720('0x3a')]);var _0x463681={'where':_0x3c382b['where']};return db['ZohoAccount'][_0xd720('0x1a')](_0x463681)[_0xd720('0x21')](function(_0x4567c4){_0x655a3e[_0xd720('0x1a')]=_0x4567c4;if(_0x434641[_0xd720('0x2c')][_0xd720('0x3b')]){_0x3c382b['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xd720('0x3c')](_0x3c382b);})[_0xd720('0x21')](function(_0x41d6ff){_0x655a3e['rows']=_0x41d6ff;return _0x655a3e;})['then'](respondWithFilteredResult(_0xb5029c,_0x3c382b))[_0xd720('0x3d')](handleError(_0xb5029c,null));};exports['show']=function(_0x553872,_0x4cbf0b){var _0x1e053f={'raw':![],'where':{'id':_0x553872[_0xd720('0x3e')]['id']}},_0x344fe4={};_0x344fe4[_0xd720('0x2f')]=_['keys'](db[_0xd720('0x3f')][_0xd720('0x28')]);_0x344fe4[_0xd720('0x2c')]=_[_0xd720('0x2d')](_0x553872['query']);_0x344fe4[_0xd720('0x2e')]=_[_0xd720('0x31')](_0x344fe4[_0xd720('0x2f')],_0x344fe4[_0xd720('0x2c')]);_0x1e053f[_0xd720('0x30')]=_[_0xd720('0x31')](_0x344fe4[_0xd720('0x2f')],qs['fields'](_0x553872[_0xd720('0x2c')]['fields']));_0x1e053f[_0xd720('0x30')]=_0x1e053f[_0xd720('0x30')][_0xd720('0x40')]?_0x1e053f[_0xd720('0x30')]:_0x344fe4[_0xd720('0x2f')];if(_0x553872[_0xd720('0x2c')]['includeAll']){_0x1e053f[_0xd720('0x41')]=[{'all':!![]}];}_0x1e053f=_['merge']({},_0x1e053f,_0x553872[_0xd720('0x3a')]);return db['ZohoAccount']['find'](_0x1e053f)[_0xd720('0x21')](handleEntityNotFound(_0x4cbf0b,null))['then'](respondWithResult(_0x4cbf0b,null))['catch'](handleError(_0x4cbf0b,null));};exports[_0xd720('0x42')]=function(_0x5a0e76,_0x132b53){return db[_0xd720('0x3f')][_0xd720('0x42')](_0x5a0e76[_0xd720('0x43')],{})[_0xd720('0x21')](respondWithResult(_0x132b53,0xc9))['catch'](handleError(_0x132b53,null));};exports[_0xd720('0x44')]=function(_0x5ab0f4,_0x1bf18a){if(_0x5ab0f4[_0xd720('0x43')]['id']){delete _0x5ab0f4[_0xd720('0x43')]['id'];}return db[_0xd720('0x3f')]['find']({'where':{'id':_0x5ab0f4[_0xd720('0x3e')]['id']}})[_0xd720('0x21')](handleEntityNotFound(_0x1bf18a,null))[_0xd720('0x21')](saveUpdates(_0x5ab0f4[_0xd720('0x43')],null))[_0xd720('0x21')](respondWithResult(_0x1bf18a,null))[_0xd720('0x3d')](handleError(_0x1bf18a,null));};exports[_0xd720('0x20')]=function(_0x4180aa,_0x4dab9e){return db[_0xd720('0x3f')][_0xd720('0x45')]({'where':{'id':_0x4180aa[_0xd720('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4dab9e,null))[_0xd720('0x21')](removeEntity(_0x4dab9e,null))['catch'](handleError(_0x4dab9e,null));};exports[_0xd720('0x46')]=function(_0x518f8f,_0x7fd1aa,_0x4a0961){var _0x300dc2={};var _0x1340f3={};var _0x432a9d;var _0x211aad;return db[_0xd720('0x3f')][_0xd720('0x47')]({'where':{'id':_0x518f8f['params']['id']}})[_0xd720('0x21')](handleEntityNotFound(_0x7fd1aa,null))[_0xd720('0x21')](function(_0x5098d9){if(_0x5098d9){_0x432a9d=_0x5098d9;_0x1340f3['model']=_[_0xd720('0x2d')](db['ZohoConfiguration'][_0xd720('0x28')]);_0x1340f3['query']=_[_0xd720('0x2d')](_0x518f8f[_0xd720('0x2c')]);_0x1340f3[_0xd720('0x2e')]=_[_0xd720('0x31')](_0x1340f3[_0xd720('0x2f')],_0x1340f3['query']);_0x300dc2[_0xd720('0x30')]=_[_0xd720('0x31')](_0x1340f3[_0xd720('0x2f')],qs[_0xd720('0x32')](_0x518f8f[_0xd720('0x2c')]['fields']));_0x300dc2[_0xd720('0x30')]=_0x300dc2[_0xd720('0x30')][_0xd720('0x40')]?_0x300dc2['attributes']:_0x1340f3[_0xd720('0x2f')];_0x300dc2[_0xd720('0x35')]=qs[_0xd720('0x36')](_0x518f8f[_0xd720('0x2c')][_0xd720('0x36')]);_0x300dc2[_0xd720('0x37')]=qs[_0xd720('0x2e')](_[_0xd720('0x48')](_0x518f8f[_0xd720('0x2c')],_0x1340f3[_0xd720('0x2e')]));if(_0x518f8f[_0xd720('0x2c')][_0xd720('0x38')]){_0x300dc2[_0xd720('0x37')]=_[_0xd720('0x39')](_0x300dc2[_0xd720('0x37')],{'$or':_[_0xd720('0x27')](_0x300dc2[_0xd720('0x30')],function(_0x309026){var _0x5c9ee2={};_0x5c9ee2[_0x309026]={'$like':'%'+_0x518f8f['query'][_0xd720('0x38')]+'%'};return _0x5c9ee2;})});}_0x300dc2=_['merge']({},_0x300dc2,_0x518f8f['options']);return _0x432a9d[_0xd720('0x46')](_0x300dc2);}})[_0xd720('0x21')](function(_0x5872af){if(_0x5872af){_0x211aad=_0x5872af[_0xd720('0x40')];if(!_0x518f8f[_0xd720('0x2c')][_0xd720('0x33')]('nolimit')){_0x300dc2[_0xd720('0x19')]=qs[_0xd720('0x19')](_0x518f8f[_0xd720('0x2c')]['limit']);_0x300dc2[_0xd720('0x17')]=qs[_0xd720('0x17')](_0x518f8f[_0xd720('0x2c')][_0xd720('0x17')]);}return _0x432a9d['getConfigurations'](_0x300dc2);}})[_0xd720('0x21')](function(_0x3e5cf9){if(_0x3e5cf9){return _0x3e5cf9?{'count':_0x211aad,'rows':_0x3e5cf9}:null;}})[_0xd720('0x21')](respondWithResult(_0x7fd1aa,null))['catch'](handleError(_0x7fd1aa,null));};exports['addConfiguration']=function(_0x486c41,_0x5927e3,_0xa9261){if(_0x486c41[_0xd720('0x43')]['id']){delete _0x486c41[_0xd720('0x43')]['id'];}return db[_0xd720('0x3f')][_0xd720('0x47')]({'where':{'id':_0x486c41['params']['id']}})[_0xd720('0x21')](handleEntityNotFound(_0x5927e3,null))[_0xd720('0x21')](function(_0x40480b){if(_0x40480b){_0x486c41['body'][_0xd720('0x49')]=_0x40480b['id'];_0x486c41[_0xd720('0x43')][_0xd720('0x4a')]=integrations[_0xd720('0x4b')](_0x486c41['body'][_0xd720('0x4c')],_0x486c41[_0xd720('0x43')][_0xd720('0x2a')]);_0x486c41[_0xd720('0x43')]['Descriptions']=integrations[_0xd720('0x4d')](_0x486c41[_0xd720('0x43')]['channel'],_0x486c41[_0xd720('0x43')][_0xd720('0x2a')]);return db[_0xd720('0x4e')]['create'](_0x486c41[_0xd720('0x43')],{'include':[{'model':db[_0xd720('0x4f')],'as':_0xd720('0x4a')},{'model':db[_0xd720('0x4f')],'as':'Descriptions'}]});}return null;})[_0xd720('0x21')](respondWithResult(_0x5927e3,null))[_0xd720('0x3d')](handleError(_0x5927e3,null));};function getAccessToken(_0xcc2a5c){return new Promise(function(_0x131b03,_0xf31448){var _0x422f01;switch(_0xcc2a5c['zone']){case'US':_0x422f01='https://accounts.zoho.com';break;case'AU':_0x422f01=_0xd720('0x50');break;case'EU':_0x422f01='https://accounts.zoho.eu';break;case'IN':_0x422f01=_0xd720('0x51');break;case'CN':_0x422f01=_0xd720('0x52');break;default:_0x422f01=_0xd720('0x53');break;}var _0x6fdd9d={'method':_0xd720('0x54'),'uri':_0x422f01+_0xd720('0x55'),'qs':{'refresh_token':_0xcc2a5c['refreshToken'],'client_id':_0xcc2a5c[_0xd720('0x56')],'client_secret':_0xcc2a5c[_0xd720('0x57')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x6fdd9d)['then'](function(_0x12fe2a){if(_0x12fe2a[_0xd720('0x58')]){_0x131b03(_0x12fe2a[_0xd720('0x58')]);}else{_0xf31448(_0xd720('0x59'));}})[_0xd720('0x3d')](function(_0x3904a7){_0xf31448(_0x3904a7);});});}exports[_0xd720('0x5a')]=function(_0x5007db,_0x4c2c9a,_0xeafec4){var _0x52b3a9,_0x490769,_0x14a6e3,_0x3c90ca,_0x20df61;return db[_0xd720('0x3f')]['findOne']({'where':{'id':_0x5007db[_0xd720('0x3e')]['id']},'attributes':['id','host',_0xd720('0x5b'),_0xd720('0x56'),_0xd720('0x57'),_0xd720('0x5c'),_0xd720('0x5d'),'refreshToken']})[_0xd720('0x21')](handleEntityNotFound(_0x4c2c9a,null))['then'](function(_0x3b5ed9){_0x20df61=_0x3b5ed9;_0x52b3a9=_0x20df61['host'];_0x490769=_0x52b3a9==='zoho.eu'?'eu':'com';_0x14a6e3=_0x20df61[_0xd720('0x5c')];var _0x12a16b=_0x14a6e3[_0xd720('0x5e')](-0x1);if(_0x12a16b==='/'||_0x12a16b==='\x5c'||_0x12a16b===':'){_0x14a6e3=_0x14a6e3[_0xd720('0x5f')](0x0,_0x14a6e3['lastIndexOf'](_0x12a16b));}if(!_0x20df61['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x20df61);})['then'](function(_0x132c5d){if(_0x132c5d){return rp({'method':_0xd720('0x60'),'uri':util[_0xd720('0x61')](_0xd720('0x62'),_0x490769),'qs':{'module':'Calls'},'headers':{'Authorization':_0xd720('0x63')+_0x132c5d},'json':!![]});}})['then'](function(_0xc69f1e){if(_0xc69f1e){if(_0xc69f1e['response']&&_0xc69f1e[_0xd720('0x64')]['error']){throw new Error(_0xc69f1e[_0xd720('0x64')]['error'][_0xd720('0x65')]);}var _0x2ebc77=[];var _0x59e976=[];var _0xea70ca=['Owner',_0xd720('0x66'),_0xd720('0x67'),_0xd720('0x68'),_0xd720('0x69'),_0xd720('0x6a'),_0xd720('0x6b'),_0xd720('0x6c')];_0x59e976=_['remove'](_0xc69f1e[_0xd720('0x32')],function(_0x358ab3){return _0xea70ca[_0xd720('0x6d')](_0x358ab3['api_name']);});for(var _0x45c16e=0x0;_0x45c16e<_0x59e976[_0xd720('0x40')];_0x45c16e++){if(_0x59e976[_0x45c16e][_0xd720('0x6e')]===![]){_0x2ebc77['push']({'id':_0x59e976[_0x45c16e]['id'],'name':_0x59e976[_0x45c16e][_0xd720('0x6f')],'custom':_0x59e976[_0x45c16e][_0xd720('0x70')],'options':_0x59e976[_0x45c16e][_0xd720('0x71')]==='picklist'&&_0x59e976[_0x45c16e][_0xd720('0x72')][_0xd720('0x40')]>-0x1?_['map'](_0x59e976[_0x45c16e][_0xd720('0x72')],function(_0x249ec0){return{'name':_0x249ec0,'value':_0x249ec0};}):[]});}}return{'count':_0x2ebc77[_0xd720('0x40')],'rows':_0x2ebc77};}else{return{'count':0x0,'rows':[]};}})[_0xd720('0x21')](respondWithResult(_0x4c2c9a,null))['catch'](function(_0x46e9cc){var _0x6ca3a1=_0x5007db[_0xd720('0x2c')]['test']?0x1f4:_0x46e9cc['statusCode']||0x1f4;logger[_0xd720('0x22')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x6ca3a1,JSON[_0xd720('0x73')](_0x46e9cc));delete _0x46e9cc[_0xd720('0x24')];if(_0x6ca3a1===0x191){_0x6ca3a1=0x190;}_0x4c2c9a[_0xd720('0x15')](_0x6ca3a1)[_0xd720('0x25')](_0x5007db[_0xd720('0x2c')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x46e9cc[_0xd720('0x74')]}:_0x46e9cc);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 70ff52b..6898177 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 _0x4964=['zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','inspect','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','https://accounts.zoho.com.au','lodash','util','api','moment','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','clientId','clientSecret','code','host','serverUrl','slice','substring','lastIndexOf'];(function(_0x33e3b7,_0x439b79){var _0x36b7b2=function(_0x58d972){while(--_0x58d972){_0x33e3b7['push'](_0x33e3b7['shift']());}};_0x36b7b2(++_0x439b79);}(_0x4964,0x134));var _0x4496=function(_0x43115e,_0x1b5e72){_0x43115e=_0x43115e-0x0;var _0xa8b789=_0x4964[_0x43115e];return _0xa8b789;};'use strict';var _=require(_0x4496('0x0'));var util=require(_0x4496('0x1'));var logger=require('../../config/logger')(_0x4496('0x2'));var moment=require(_0x4496('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4496('0x4'));var config=require(_0x4496('0x5'));var attributes=require(_0x4496('0x6'));var integrations=require(_0x4496('0x7'));module[_0x4496('0x8')]=function(_0xbf5548,_0x42438a){return _0xbf5548[_0x4496('0x9')]('ZohoAccount',attributes,{'tableName':_0x4496('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5c9e3a,_0x5c76c5,_0x4fba37){if(_0x5c9e3a[_0x4496('0xb')]('zone')||_0x5c9e3a[_0x4496('0xb')]('serverUrl')||_0x5c9e3a[_0x4496('0xb')](_0x4496('0xc'))||_0x5c9e3a['changed'](_0x4496('0xd'))||_0x5c9e3a[_0x4496('0xb')](_0x4496('0xe'))||_0x5c9e3a[_0x4496('0xb')](_0x4496('0xf'))){var _0x176453,_0x10ee72;_0x176453=_0x5c9e3a[_0x4496('0x10')];var _0x38da7e=_0x176453[_0x4496('0x11')](-0x1);if(_0x38da7e==='/'||_0x38da7e==='\x5c'||_0x38da7e===':'){_0x176453=_0x176453[_0x4496('0x12')](0x0,_0x176453[_0x4496('0x13')](_0x38da7e));}switch(_0x5c9e3a[_0x4496('0x14')]){case'US':_0x10ee72=_0x4496('0x15');break;case'AU':_0x10ee72='https://accounts.zoho.com.au';break;case'IN':_0x10ee72=_0x4496('0x16');break;case'CN':_0x10ee72='https://accounts.zoho.com.cn';break;default:_0x10ee72=_0x4496('0x17');break;}var _0x25013e={'method':_0x4496('0x18'),'uri':_0x10ee72+_0x4496('0x19'),'form':{'grant_type':_0x4496('0x1a'),'client_id':_0x5c9e3a[_0x4496('0xc')],'client_secret':_0x5c9e3a[_0x4496('0xd')],'redirect_uri':_0x5c9e3a['serverUrl'],'code':_0x5c9e3a[_0x4496('0xe')]},'headers':{'Content-Type':_0x4496('0x1b')}};return rp(_0x25013e)[_0x4496('0x1c')](function(_0x579878){var _0x53a961=JSON[_0x4496('0x1d')](_0x579878);if(_0x53a961[_0x4496('0x1e')]){_0x5c9e3a[_0x4496('0x1f')]=_0x53a961[_0x4496('0x1e')];logger[_0x4496('0x20')](util[_0x4496('0x21')](_0x4496('0x22'),_0x5c9e3a[_0x4496('0x23')],_0x5c9e3a['id']));}else{logger[_0x4496('0x24')](util[_0x4496('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c9e3a['name'],_0x5c9e3a['id']),util[_0x4496('0x25')](_0x53a961,{'showHidden':![],'depth':null}));}return _0x4fba37(null,_0x5c76c5);})[_0x4496('0x26')](function(_0x17be03){logger['error'](util[_0x4496('0x21')](_0x4496('0x27'),_0x5c9e3a['name'],_0x5c9e3a['id']),util[_0x4496('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x4fba37(_0x17be03);});}else{return _0x4fba37(null,_0x5c76c5);}},'beforeUpdate':function(_0x335311,_0x5d755c,_0x42d7cb){if(_0x335311['changed'](_0x4496('0x14'))||_0x335311['changed'](_0x4496('0x10'))||_0x335311['changed']('clientId')||_0x335311[_0x4496('0xb')](_0x4496('0xd'))||_0x335311[_0x4496('0xb')](_0x4496('0xe'))||_0x335311['changed']('host')){var _0x4d96f4,_0x1eabf2;_0x4d96f4=_0x335311[_0x4496('0x10')];var _0xa93b3c=_0x4d96f4['slice'](-0x1);if(_0xa93b3c==='/'||_0xa93b3c==='\x5c'||_0xa93b3c===':'){_0x4d96f4=_0x4d96f4[_0x4496('0x12')](0x0,_0x4d96f4['lastIndexOf'](_0xa93b3c));}switch(_0x335311[_0x4496('0x14')]){case'US':_0x1eabf2=_0x4496('0x15');break;case'AU':_0x1eabf2=_0x4496('0x28');break;case'IN':_0x1eabf2='https://accounts.zoho.in';break;case'CN':_0x1eabf2='https://accounts.zoho.com.cn';break;default:_0x1eabf2=_0x4496('0x17');break;}var _0x59c339={'method':_0x4496('0x18'),'uri':_0x1eabf2+_0x4496('0x19'),'form':{'grant_type':'authorization_code','client_id':_0x335311[_0x4496('0xc')],'client_secret':_0x335311[_0x4496('0xd')],'redirect_uri':_0x335311[_0x4496('0x10')],'code':_0x335311[_0x4496('0xe')]},'headers':{'Content-Type':_0x4496('0x1b')}};return rp(_0x59c339)[_0x4496('0x1c')](function(_0x46b116){var _0x55240e=JSON[_0x4496('0x1d')](_0x46b116);if(_0x55240e['refresh_token']){_0x335311[_0x4496('0x1f')]=_0x55240e[_0x4496('0x1e')];logger[_0x4496('0x20')](util[_0x4496('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x335311[_0x4496('0x23')],_0x335311['id']));}else{logger[_0x4496('0x24')](util[_0x4496('0x21')](_0x4496('0x27'),_0x335311[_0x4496('0x23')],_0x335311['id']),util['inspect'](_0x55240e,{'showHidden':![],'depth':null}));}return _0x42d7cb(null,_0x5d755c);})[_0x4496('0x26')](function(_0x479c03){logger[_0x4496('0x24')](util[_0x4496('0x21')](_0x4496('0x27'),_0x335311[_0x4496('0x23')],_0x335311['id']),util[_0x4496('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x42d7cb(_0x479c03);});}else{return _0x42d7cb(null,_0x5d755c);}}}});}; \ No newline at end of file +var _0xeb8a=['name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','substring','lastIndexOf','parse','refresh_token','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d'];(function(_0x263ac8,_0xf75a48){var _0x37196f=function(_0x3f9652){while(--_0x3f9652){_0x263ac8['push'](_0x263ac8['shift']());}};_0x37196f(++_0xf75a48);}(_0xeb8a,0x18d));var _0xaeb8=function(_0x31a004,_0x52a3c4){_0x31a004=_0x31a004-0x0;var _0x5bc6bc=_0xeb8a[_0x31a004];return _0x5bc6bc;};'use strict';var _=require(_0xaeb8('0x0'));var util=require('util');var logger=require(_0xaeb8('0x1'))(_0xaeb8('0x2'));var moment=require(_0xaeb8('0x3'));var BPromise=require('bluebird');var rp=require(_0xaeb8('0x4'));var fs=require('fs');var path=require(_0xaeb8('0x5'));var rimraf=require('rimraf');var config=require(_0xaeb8('0x6'));var attributes=require(_0xaeb8('0x7'));var integrations=require(_0xaeb8('0x8'));module[_0xaeb8('0x9')]=function(_0x511b44,_0x241d8b){return _0x511b44[_0xaeb8('0xa')](_0xaeb8('0xb'),attributes,{'tableName':_0xaeb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4252f3,_0x5c4308,_0x45cbd6){if(_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0xe'))||_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0xf'))||_0x4252f3['changed'](_0xaeb8('0x10'))||_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0x11'))||_0x4252f3[_0xaeb8('0xd')](_0xaeb8('0x12'))||_0x4252f3[_0xaeb8('0xd')]('host')){var _0x5c7ef7,_0x4bec6b;_0x5c7ef7=_0x4252f3[_0xaeb8('0xf')];var _0x54458e=_0x5c7ef7[_0xaeb8('0x13')](-0x1);if(_0x54458e==='/'||_0x54458e==='\x5c'||_0x54458e===':'){_0x5c7ef7=_0x5c7ef7['substring'](0x0,_0x5c7ef7['lastIndexOf'](_0x54458e));}switch(_0x4252f3[_0xaeb8('0xe')]){case'US':_0x4bec6b=_0xaeb8('0x14');break;case'AU':_0x4bec6b=_0xaeb8('0x15');break;case'IN':_0x4bec6b=_0xaeb8('0x16');break;case'CN':_0x4bec6b=_0xaeb8('0x17');break;default:_0x4bec6b=_0xaeb8('0x18');break;}var _0x7362cd={'method':_0xaeb8('0x19'),'uri':_0x4bec6b+_0xaeb8('0x1a'),'form':{'grant_type':_0xaeb8('0x1b'),'client_id':_0x4252f3['clientId'],'client_secret':_0x4252f3[_0xaeb8('0x11')],'redirect_uri':_0x4252f3['serverUrl'],'code':_0x4252f3['code']},'headers':{'Content-Type':_0xaeb8('0x1c')}};return rp(_0x7362cd)[_0xaeb8('0x1d')](function(_0x25bf35){var _0xf309f6=JSON['parse'](_0x25bf35);if(_0xf309f6['refresh_token']){_0x4252f3[_0xaeb8('0x1e')]=_0xf309f6['refresh_token'];logger['info'](util[_0xaeb8('0x1f')](_0xaeb8('0x20'),_0x4252f3[_0xaeb8('0x21')],_0x4252f3['id']));}else{logger[_0xaeb8('0x22')](util[_0xaeb8('0x1f')](_0xaeb8('0x23'),_0x4252f3[_0xaeb8('0x21')],_0x4252f3['id']),util[_0xaeb8('0x24')](_0xf309f6,{'showHidden':![],'depth':null}));}return _0x45cbd6(null,_0x5c4308);})[_0xaeb8('0x25')](function(_0xb6d17){logger[_0xaeb8('0x22')](util[_0xaeb8('0x1f')](_0xaeb8('0x23'),_0x4252f3[_0xaeb8('0x21')],_0x4252f3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x45cbd6(_0xb6d17);});}else{return _0x45cbd6(null,_0x5c4308);}},'beforeUpdate':function(_0x1aa9c8,_0x5a2273,_0x56cffa){if(_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0xe'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0xf'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x10'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x11'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x12'))||_0x1aa9c8[_0xaeb8('0xd')](_0xaeb8('0x26'))){var _0x4146df,_0x1fddad;_0x4146df=_0x1aa9c8[_0xaeb8('0xf')];var _0x61e13a=_0x4146df[_0xaeb8('0x13')](-0x1);if(_0x61e13a==='/'||_0x61e13a==='\x5c'||_0x61e13a===':'){_0x4146df=_0x4146df[_0xaeb8('0x27')](0x0,_0x4146df[_0xaeb8('0x28')](_0x61e13a));}switch(_0x1aa9c8[_0xaeb8('0xe')]){case'US':_0x1fddad=_0xaeb8('0x14');break;case'AU':_0x1fddad='https://accounts.zoho.com.au';break;case'IN':_0x1fddad='https://accounts.zoho.in';break;case'CN':_0x1fddad='https://accounts.zoho.com.cn';break;default:_0x1fddad='https://accounts.zoho.eu';break;}var _0x4b2555={'method':'POST','uri':_0x1fddad+_0xaeb8('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x1aa9c8[_0xaeb8('0x10')],'client_secret':_0x1aa9c8[_0xaeb8('0x11')],'redirect_uri':_0x1aa9c8[_0xaeb8('0xf')],'code':_0x1aa9c8['code']},'headers':{'Content-Type':_0xaeb8('0x1c')}};return rp(_0x4b2555)[_0xaeb8('0x1d')](function(_0x37b430){var _0x1b40ab=JSON[_0xaeb8('0x29')](_0x37b430);if(_0x1b40ab['refresh_token']){_0x1aa9c8['refreshToken']=_0x1b40ab[_0xaeb8('0x2a')];logger['info'](util[_0xaeb8('0x1f')](_0xaeb8('0x20'),_0x1aa9c8[_0xaeb8('0x21')],_0x1aa9c8['id']));}else{logger[_0xaeb8('0x22')](util['format'](_0xaeb8('0x23'),_0x1aa9c8[_0xaeb8('0x21')],_0x1aa9c8['id']),util[_0xaeb8('0x24')](_0x1b40ab,{'showHidden':![],'depth':null}));}return _0x56cffa(null,_0x5a2273);})[_0xaeb8('0x25')](function(_0x522ba4){logger[_0xaeb8('0x22')](util[_0xaeb8('0x1f')](_0xaeb8('0x23'),_0x1aa9c8[_0xaeb8('0x21')],_0x1aa9c8['id']),util[_0xaeb8('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x56cffa(_0x522ba4);});}else{return _0x56cffa(null,_0x5a2273);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 3bfabf7..f37b55c 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 _0xdc91=['limit','include','map','model','attributes','debug','ShowZohoAccount','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw'];(function(_0x356cd8,_0x4f8d77){var _0x45779a=function(_0x9fbd92){while(--_0x9fbd92){_0x356cd8['push'](_0x356cd8['shift']());}};_0x45779a(++_0x4f8d77);}(_0xdc91,0x8b));var _0x1dc9=function(_0x1d30bc,_0x6f5f13){_0x1d30bc=_0x1d30bc-0x0;var _0x104a7d=_0xdc91[_0x1d30bc];return _0x104a7d;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});}exports[_0x1dc9('0x15')]=function(_0x197bcd){var _0x335590=this;return new Promise(function(_0x1e845a,_0x2442d0){return db[_0x1dc9('0x16')][_0x1dc9('0x17')]({'raw':_0x197bcd[_0x1dc9('0x18')]?_0x197bcd[_0x1dc9('0x18')][_0x1dc9('0x19')]===undefined?!![]:![]:!![],'where':_0x197bcd[_0x1dc9('0x18')]?_0x197bcd['options']['where']||null:null,'attributes':_0x197bcd[_0x1dc9('0x18')]?_0x197bcd['options']['attributes']||null:null,'limit':_0x197bcd['options']?_0x197bcd[_0x1dc9('0x18')][_0x1dc9('0x1a')]||null:null,'include':_0x197bcd[_0x1dc9('0x18')]?_0x197bcd[_0x1dc9('0x18')][_0x1dc9('0x1b')]?_[_0x1dc9('0x1c')](_0x197bcd[_0x1dc9('0x18')]['include'],function(_0x240365){return{'model':db[_0x240365[_0x1dc9('0x1d')]],'as':_0x240365['as'],'attributes':_0x240365[_0x1dc9('0x1e')],'include':_0x240365['include']?_[_0x1dc9('0x1c')](_0x240365[_0x1dc9('0x1b')],function(_0xec8330){return{'model':db[_0xec8330[_0x1dc9('0x1d')]],'as':_0xec8330['as'],'attributes':_0xec8330[_0x1dc9('0x1e')],'include':_0xec8330[_0x1dc9('0x1b')]?_[_0x1dc9('0x1c')](_0xec8330[_0x1dc9('0x1b')],function(_0x3e70c3){return{'model':db[_0x3e70c3['model']],'as':_0x3e70c3['as'],'attributes':_0x3e70c3['attributes']};}):[]};}):[]};}):[]:[]})[_0x1dc9('0xb')](function(_0x770848){logger[_0x1dc9('0xc')](_0x1dc9('0x15'),_0x197bcd);logger[_0x1dc9('0x1f')](_0x1dc9('0x15'),_0x197bcd,JSON[_0x1dc9('0x10')](_0x770848));_0x1e845a(_0x770848);})[_0x1dc9('0x14')](function(_0x16b71d){logger['error'](_0x1dc9('0x15'),_0x16b71d[_0x1dc9('0x13')],_0x197bcd);_0x2442d0(_0x335590[_0x1dc9('0x11')](0x1f4,_0x16b71d[_0x1dc9('0x13')]));});});};exports[_0x1dc9('0x20')]=function(_0x3946ea){var _0x54fe2a=this;return new Promise(function(_0x549e1f,_0x63d4b1){return db[_0x1dc9('0x16')]['find']({'raw':_0x3946ea[_0x1dc9('0x18')]?_0x3946ea[_0x1dc9('0x18')][_0x1dc9('0x19')]===undefined?!![]:![]:!![],'where':_0x3946ea['options']?_0x3946ea[_0x1dc9('0x18')]['where']||null:null,'attributes':_0x3946ea[_0x1dc9('0x18')]?_0x3946ea['options']['attributes']||null:null,'include':_0x3946ea[_0x1dc9('0x18')]?_0x3946ea[_0x1dc9('0x18')][_0x1dc9('0x1b')]?_[_0x1dc9('0x1c')](_0x3946ea['options'][_0x1dc9('0x1b')],function(_0x4d2a03){return{'model':db[_0x4d2a03[_0x1dc9('0x1d')]],'as':_0x4d2a03['as'],'attributes':_0x4d2a03[_0x1dc9('0x1e')],'include':_0x4d2a03[_0x1dc9('0x1b')]?_[_0x1dc9('0x1c')](_0x4d2a03[_0x1dc9('0x1b')],function(_0x2d3b0b){return{'model':db[_0x2d3b0b[_0x1dc9('0x1d')]],'as':_0x2d3b0b['as'],'attributes':_0x2d3b0b[_0x1dc9('0x1e')],'include':_0x2d3b0b['include']?_['map'](_0x2d3b0b[_0x1dc9('0x1b')],function(_0x26c6f6){return{'model':db[_0x26c6f6[_0x1dc9('0x1d')]],'as':_0x26c6f6['as'],'attributes':_0x26c6f6[_0x1dc9('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a9ab6){logger['info'](_0x1dc9('0x20'),_0x3946ea);logger[_0x1dc9('0x1f')](_0x1dc9('0x20'),_0x3946ea,JSON[_0x1dc9('0x10')](_0x3a9ab6));_0x549e1f(_0x3a9ab6);})[_0x1dc9('0x14')](function(_0xe5e152){logger['error'](_0x1dc9('0x20'),_0xe5e152[_0x1dc9('0x13')],_0x3946ea);_0x63d4b1(_0x54fe2a[_0x1dc9('0x11')](0x1f4,_0xe5e152[_0x1dc9('0x13')]));});});}; \ No newline at end of file +var _0x61f1=['findAll','options','raw','where','attributes','include','model','map','stringify','ShowZohoAccount','util','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZohoAccount','ZohoAccount'];(function(_0x4ddfe1,_0x35939d){var _0x4aaf51=function(_0x1e99a0){while(--_0x1e99a0){_0x4ddfe1['push'](_0x4ddfe1['shift']());}};_0x4aaf51(++_0x35939d);}(_0x61f1,0x18a));var _0x161f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61f1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x161f('0x0'));var moment=require('moment');var BPromise=require(_0x161f('0x1'));var rs=require(_0x161f('0x2'));var fs=require('fs');var Redis=require(_0x161f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x161f('0x4'))(_0x161f('0x5'));var config=require('../../config/environment');var jayson=require(_0x161f('0x6'));var client=jayson[_0x161f('0x7')][_0x161f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf8174c,_0xd1ad5d,_0x4ff5e1){return new BPromise(function(_0x910af4,_0x31f44e){return client[_0x161f('0x9')](_0xf8174c,_0x4ff5e1)[_0x161f('0xa')](function(_0x24bc8a){logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,_0x161f('0xd'));logger[_0x161f('0xe')](_0x161f('0xf'),_0xd1ad5d,_0x161f('0xd'),JSON['stringify'](_0x24bc8a));if(_0x24bc8a[_0x161f('0x10')]){if(_0x24bc8a[_0x161f('0x10')][_0x161f('0x11')]===0x1f4){logger[_0x161f('0x10')](_0x161f('0xc'),_0xd1ad5d,_0x24bc8a['error'][_0x161f('0x12')]);return _0x31f44e(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}logger[_0x161f('0x10')]('ZohoAccount,\x20%s,\x20%s',_0xd1ad5d,_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);return _0x910af4(_0x24bc8a[_0x161f('0x10')][_0x161f('0x12')]);}else{logger[_0x161f('0xb')](_0x161f('0xc'),_0xd1ad5d,'request\x20sent');_0x910af4(_0x24bc8a['result'][_0x161f('0x12')]);}})[_0x161f('0x13')](function(_0x189a95){logger['error'](_0x161f('0xc'),_0xd1ad5d,_0x189a95);_0x31f44e(_0x189a95);});});}exports[_0x161f('0x14')]=function(_0x2cf920){var _0x561a13=this;return new Promise(function(_0x420818,_0x5943e7){return db[_0x161f('0x15')][_0x161f('0x16')]({'raw':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x18')]===undefined?!![]:![]:!![],'where':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x19')]||null:null,'attributes':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x1a')]||null:null,'limit':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')]['limit']||null:null,'include':_0x2cf920[_0x161f('0x17')]?_0x2cf920[_0x161f('0x17')][_0x161f('0x1b')]?_['map'](_0x2cf920['options'][_0x161f('0x1b')],function(_0xaf2a44){return{'model':db[_0xaf2a44[_0x161f('0x1c')]],'as':_0xaf2a44['as'],'attributes':_0xaf2a44[_0x161f('0x1a')],'include':_0xaf2a44[_0x161f('0x1b')]?_['map'](_0xaf2a44[_0x161f('0x1b')],function(_0x2b501f){return{'model':db[_0x2b501f[_0x161f('0x1c')]],'as':_0x2b501f['as'],'attributes':_0x2b501f['attributes'],'include':_0x2b501f[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x2b501f[_0x161f('0x1b')],function(_0x413c75){return{'model':db[_0x413c75[_0x161f('0x1c')]],'as':_0x413c75['as'],'attributes':_0x413c75[_0x161f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x168b66){logger[_0x161f('0xb')](_0x161f('0x14'),_0x2cf920);logger[_0x161f('0xe')](_0x161f('0x14'),_0x2cf920,JSON[_0x161f('0x1e')](_0x168b66));_0x420818(_0x168b66);})['catch'](function(_0x18e910){logger[_0x161f('0x10')](_0x161f('0x14'),_0x18e910['message'],_0x2cf920);_0x5943e7(_0x561a13[_0x161f('0x10')](0x1f4,_0x18e910[_0x161f('0x12')]));});});};exports[_0x161f('0x1f')]=function(_0x389c45){var _0x27ebc7=this;return new Promise(function(_0x2f570e,_0x2bd3b0){return db[_0x161f('0x15')]['find']({'raw':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x18')]===undefined?!![]:![]:!![],'where':_0x389c45[_0x161f('0x17')]?_0x389c45['options']['where']||null:null,'attributes':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x1a')]||null:null,'include':_0x389c45['options']?_0x389c45[_0x161f('0x17')][_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x389c45[_0x161f('0x17')]['include'],function(_0x3ea752){return{'model':db[_0x3ea752['model']],'as':_0x3ea752['as'],'attributes':_0x3ea752[_0x161f('0x1a')],'include':_0x3ea752[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x3ea752[_0x161f('0x1b')],function(_0x34a923){return{'model':db[_0x34a923[_0x161f('0x1c')]],'as':_0x34a923['as'],'attributes':_0x34a923[_0x161f('0x1a')],'include':_0x34a923[_0x161f('0x1b')]?_[_0x161f('0x1d')](_0x34a923[_0x161f('0x1b')],function(_0x4b90cb){return{'model':db[_0x4b90cb[_0x161f('0x1c')]],'as':_0x4b90cb['as'],'attributes':_0x4b90cb['attributes']};}):[]};}):[]};}):[]:[]})[_0x161f('0xa')](function(_0x2387da){logger['info'](_0x161f('0x1f'),_0x389c45);logger[_0x161f('0xe')](_0x161f('0x1f'),_0x389c45,JSON[_0x161f('0x1e')](_0x2387da));_0x2f570e(_0x2387da);})['catch'](function(_0xc63286){logger[_0x161f('0x10')]('ShowZohoAccount',_0xc63286['message'],_0x389c45);_0x2bd3b0(_0x27ebc7['error'](0x1f4,_0xc63286[_0x161f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1f69e53..6bbe38b 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 _0xcff4=['post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0xf738ad,_0x5e1d7f){var _0x598570=function(_0x35088e){while(--_0x35088e){_0xf738ad['push'](_0xf738ad['shift']());}};_0x598570(++_0x5e1d7f);}(_0xcff4,0x14c));var _0x4cff=function(_0x39c109,_0x5b9664){_0x39c109=_0x39c109-0x0;var _0x2d0203=_0xcff4[_0x39c109];return _0x2d0203;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4cff('0x0'));var timeout=require(_0x4cff('0x1'));var express=require(_0x4cff('0x2'));var router=express[_0x4cff('0x3')]();var fs_extra=require(_0x4cff('0x4'));var auth=require(_0x4cff('0x5'));var interaction=require(_0x4cff('0x6'));var config=require(_0x4cff('0x7'));var controller=require(_0x4cff('0x8'));router[_0x4cff('0x9')]('/',auth[_0x4cff('0xa')](),controller['index']);router[_0x4cff('0x9')](_0x4cff('0xb'),auth[_0x4cff('0xa')](),controller[_0x4cff('0xc')]);router[_0x4cff('0x9')](_0x4cff('0xd'),auth[_0x4cff('0xa')](),controller[_0x4cff('0xe')]);router['get'](_0x4cff('0xf'),auth[_0x4cff('0xa')](),controller[_0x4cff('0x10')]);router[_0x4cff('0x9')](_0x4cff('0x11'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0x4cff('0x12')]('/',auth['isAuthenticated'](),controller[_0x4cff('0x13')]);router[_0x4cff('0x14')](_0x4cff('0xb'),auth[_0x4cff('0xa')](),controller[_0x4cff('0x15')]);router[_0x4cff('0x16')](_0x4cff('0xb'),auth[_0x4cff('0xa')](),controller[_0x4cff('0x17')]);module[_0x4cff('0x18')]=router; \ No newline at end of file +var _0xe875=['show','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0x6d8818,_0x5ccad0){var _0x545a0b=function(_0x35403d){while(--_0x35403d){_0x6d8818['push'](_0x6d8818['shift']());}};_0x545a0b(++_0x5ccad0);}(_0xe875,0xcc));var _0x5e87=function(_0x358eea,_0x2d7a1f){_0x358eea=_0x358eea-0x0;var _0x5332a5=_0xe875[_0x358eea];return _0x5332a5;};'use strict';var multer=require(_0x5e87('0x0'));var util=require('util');var path=require(_0x5e87('0x1'));var timeout=require(_0x5e87('0x2'));var express=require(_0x5e87('0x3'));var router=express[_0x5e87('0x4')]();var fs_extra=require(_0x5e87('0x5'));var auth=require(_0x5e87('0x6'));var interaction=require(_0x5e87('0x7'));var config=require(_0x5e87('0x8'));var controller=require(_0x5e87('0x9'));router[_0x5e87('0xa')]('/',auth[_0x5e87('0xb')](),controller['index']);router[_0x5e87('0xa')]('/:id',auth[_0x5e87('0xb')](),controller[_0x5e87('0xc')]);router[_0x5e87('0xa')]('/:id/fields',auth[_0x5e87('0xb')](),controller[_0x5e87('0xd')]);router[_0x5e87('0xa')](_0x5e87('0xe'),auth[_0x5e87('0xb')](),controller[_0x5e87('0xf')]);router['get'](_0x5e87('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x5e87('0xb')](),controller[_0x5e87('0x11')]);router[_0x5e87('0x12')](_0x5e87('0x13'),auth[_0x5e87('0xb')](),controller[_0x5e87('0x14')]);router[_0x5e87('0x15')](_0x5e87('0x13'),auth[_0x5e87('0xb')](),controller[_0x5e87('0x16')]);module[_0x5e87('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9971965..201a0f3 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 _0x8bf8=['exports','STRING','ENUM','lead','contact','nothing'];(function(_0xe81b78,_0x53fc81){var _0x197fc1=function(_0x1f9e48){while(--_0x1f9e48){_0xe81b78['push'](_0xe81b78['shift']());}};_0x197fc1(++_0x53fc81);}(_0x8bf8,0x11a));var _0x88bf=function(_0x158270,_0x441e1a){_0x158270=_0x158270-0x0;var _0x47bdb4=_0x8bf8[_0x158270];return _0x47bdb4;};'use strict';var Sequelize=require('sequelize');module[_0x88bf('0x0')]={'name':{'type':Sequelize[_0x88bf('0x1')]},'moduleCreate':{'type':Sequelize[_0x88bf('0x2')](_0x88bf('0x3'),_0x88bf('0x4'),_0x88bf('0x5')),'defaultValue':_0x88bf('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x88bf('0x4'),_0x88bf('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x88bf('0x1')]}}; \ No newline at end of file +var _0x619f=['contact','sequelize','exports','STRING','lead','nothing','ENUM'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x619f,0x14a));var _0xf619=function(_0x25d81b,_0x2e9ff5){_0x25d81b=_0x25d81b-0x0;var _0x1b1fdb=_0x619f[_0x25d81b];return _0x1b1fdb;};'use strict';var Sequelize=require(_0xf619('0x0'));module[_0xf619('0x1')]={'name':{'type':Sequelize[_0xf619('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xf619('0x3'),'contact',_0xf619('0x4')),'defaultValue':_0xf619('0x3')},'moduleSearch':{'type':Sequelize[_0xf619('0x5')]('contact_lead',_0xf619('0x6'),_0xf619('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 3fdbdb4..19d8019 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 _0xce9a=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','pick','where','merge','filter','includeAll','ZohoConfiguration','findAll','rows','catch','show','params','fields','options','find','create','body','getFields','findOne','ZohoField','order','getSubjects','hasOwnProperty','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x475c55,_0x21dc63){var _0x475eef=function(_0x4d2bb0){while(--_0x4d2bb0){_0x475c55['push'](_0x475c55['shift']());}};_0x475eef(++_0x21dc63);}(_0xce9a,0xe8));var _0xace9=function(_0x420a3c,_0x559882){_0x420a3c=_0x420a3c-0x0;var _0xb5a625=_0xce9a[_0x420a3c];return _0xb5a625;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xace9('0x0'));var zipdir=require(_0xace9('0x1'));var jsonpatch=require(_0xace9('0x2'));var rp=require(_0xace9('0x3'));var moment=require(_0xace9('0x4'));var BPromise=require(_0xace9('0x5'));var Mustache=require(_0xace9('0x6'));var util=require(_0xace9('0x7'));var path=require(_0xace9('0x8'));var sox=require(_0xace9('0x9'));var csv=require(_0xace9('0xa'));var ejs=require(_0xace9('0xb'));var fs=require('fs');var fs_extra=require(_0xace9('0xc'));var _=require(_0xace9('0xd'));var squel=require(_0xace9('0xe'));var crypto=require(_0xace9('0xf'));var jsforce=require(_0xace9('0x10'));var deskjs=require(_0xace9('0x11'));var toCsv=require(_0xace9('0xa'));var querystring=require(_0xace9('0x12'));var Papa=require(_0xace9('0x13'));var Redis=require(_0xace9('0x14'));var authService=require(_0xace9('0x15'));var qs=require(_0xace9('0x16'));var as=require(_0xace9('0x17'));var hardwareService=require(_0xace9('0x18'));var logger=require('../../config/logger')(_0xace9('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xace9('0x1a'));var db=require(_0xace9('0x1b'))['db'];function respondWithStatusCode(_0x298145,_0x2a28e2){_0x2a28e2=_0x2a28e2||0xcc;return function(_0x5e56d9){if(_0x5e56d9){return _0x298145[_0xace9('0x1c')](_0x2a28e2);}return _0x298145[_0xace9('0x1d')](_0x2a28e2)[_0xace9('0x1e')]();};}function respondWithResult(_0x236e73,_0x252910){_0x252910=_0x252910||0xc8;return function(_0x1b4a4f){if(_0x1b4a4f){return _0x236e73[_0xace9('0x1d')](_0x252910)[_0xace9('0x1f')](_0x1b4a4f);}};}function respondWithFilteredResult(_0x5eeaa7,_0x4eb222){return function(_0x3fec33){if(_0x3fec33){var _0x4754e6=typeof _0x4eb222[_0xace9('0x20')]===_0xace9('0x21')&&typeof _0x4eb222[_0xace9('0x22')]===_0xace9('0x21');var _0x3305b7=_0x3fec33['count'];var _0x186f99=_0x4754e6?0x0:_0x4eb222['offset'];var _0x525071=_0x4754e6?_0x3fec33[_0xace9('0x23')]:_0x4eb222[_0xace9('0x20')]+_0x4eb222['limit'];var _0x57c6b5;if(_0x525071>=_0x3305b7){_0x525071=_0x3305b7;_0x57c6b5=0xc8;}else{_0x57c6b5=0xce;}_0x5eeaa7[_0xace9('0x1d')](_0x57c6b5);return _0x5eeaa7['set']('Content-Range',_0x186f99+'-'+_0x525071+'/'+_0x3305b7)[_0xace9('0x1f')](_0x3fec33);}return null;};}function patchUpdates(_0x24ec47){return function(_0x112ca5){try{jsonpatch[_0xace9('0x24')](_0x112ca5,_0x24ec47,!![]);}catch(_0x1ddab4){return BPromise[_0xace9('0x25')](_0x1ddab4);}return _0x112ca5[_0xace9('0x26')]();};}function saveUpdates(_0x552567,_0x27c42f){return function(_0x4733b2){if(_0x4733b2){return _0x4733b2[_0xace9('0x27')](_0x552567)[_0xace9('0x28')](function(_0x285c69){return _0x285c69;});}return null;};}function removeEntity(_0x5c30fa,_0x1158c7){return function(_0x449ddc){if(_0x449ddc){return _0x449ddc[_0xace9('0x29')]()[_0xace9('0x28')](function(){_0x5c30fa[_0xace9('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29dd2a,_0x1d51c2){return function(_0x1a4b87){if(!_0x1a4b87){_0x29dd2a[_0xace9('0x1c')](0x194);}return _0x1a4b87;};}function handleError(_0x3e7863,_0x2c719b){_0x2c719b=_0x2c719b||0x1f4;return function(_0x14e961){logger['error'](_0x14e961[_0xace9('0x2a')]);if(_0x14e961[_0xace9('0x2b')]){delete _0x14e961[_0xace9('0x2b')];}_0x3e7863[_0xace9('0x1d')](_0x2c719b)[_0xace9('0x2c')](_0x14e961);};}exports[_0xace9('0x2d')]=function(_0x12cca6,_0x1aa820){var _0x580475={},_0x2ac9e5={},_0x2a620e={'count':0x0,'rows':[]};var _0x5519ec=_[_0xace9('0x2e')](db['ZohoConfiguration'][_0xace9('0x2f')],function(_0x8e5aa){return{'name':_0x8e5aa[_0xace9('0x30')],'type':_0x8e5aa[_0xace9('0x31')][_0xace9('0x32')]};});_0x2ac9e5[_0xace9('0x33')]=_[_0xace9('0x2e')](_0x5519ec,'name');_0x2ac9e5[_0xace9('0x34')]=_[_0xace9('0x35')](_0x12cca6[_0xace9('0x34')]);_0x2ac9e5[_0xace9('0x36')]=_[_0xace9('0x37')](_0x2ac9e5[_0xace9('0x33')],_0x2ac9e5[_0xace9('0x34')]);_0x580475[_0xace9('0x38')]=_[_0xace9('0x37')](_0x2ac9e5[_0xace9('0x33')],qs['fields'](_0x12cca6[_0xace9('0x34')]['fields']));_0x580475[_0xace9('0x38')]=_0x580475[_0xace9('0x38')][_0xace9('0x39')]?_0x580475[_0xace9('0x38')]:_0x2ac9e5[_0xace9('0x33')];if(!_0x12cca6['query']['hasOwnProperty'](_0xace9('0x3a'))){_0x580475[_0xace9('0x22')]=qs[_0xace9('0x22')](_0x12cca6[_0xace9('0x34')][_0xace9('0x22')]);_0x580475[_0xace9('0x20')]=qs[_0xace9('0x20')](_0x12cca6[_0xace9('0x34')][_0xace9('0x20')]);}_0x580475['order']=qs[_0xace9('0x3b')](_0x12cca6[_0xace9('0x34')][_0xace9('0x3b')]);_0x580475['where']=qs[_0xace9('0x36')](_[_0xace9('0x3c')](_0x12cca6[_0xace9('0x34')],_0x2ac9e5[_0xace9('0x36')]),_0x5519ec);if(_0x12cca6[_0xace9('0x34')]['filter']){_0x580475[_0xace9('0x3d')]=_[_0xace9('0x3e')](_0x580475[_0xace9('0x3d')],{'$or':_[_0xace9('0x2e')](_0x5519ec,function(_0x24c8d3){if(_0x24c8d3[_0xace9('0x31')]!=='VIRTUAL'){var _0x522d97={};_0x522d97[_0x24c8d3[_0xace9('0x2b')]]={'$like':'%'+_0x12cca6[_0xace9('0x34')][_0xace9('0x3f')]+'%'};return _0x522d97;}})});}_0x580475=_[_0xace9('0x3e')]({},_0x580475,_0x12cca6['options']);var _0x24b226={'where':_0x580475[_0xace9('0x3d')]};return db['ZohoConfiguration']['count'](_0x24b226)[_0xace9('0x28')](function(_0x406441){_0x2a620e[_0xace9('0x23')]=_0x406441;if(_0x12cca6[_0xace9('0x34')][_0xace9('0x40')]){_0x580475['include']=[{'all':!![]}];}return db[_0xace9('0x41')][_0xace9('0x42')](_0x580475);})['then'](function(_0xd6fb38){_0x2a620e[_0xace9('0x43')]=_0xd6fb38;return _0x2a620e;})[_0xace9('0x28')](respondWithFilteredResult(_0x1aa820,_0x580475))[_0xace9('0x44')](handleError(_0x1aa820,null));};exports[_0xace9('0x45')]=function(_0x32e500,_0x4ad6d2){var _0x3f150f={'raw':![],'where':{'id':_0x32e500[_0xace9('0x46')]['id']}},_0x36dca2={};_0x36dca2[_0xace9('0x33')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x36dca2[_0xace9('0x34')]=_[_0xace9('0x35')](_0x32e500[_0xace9('0x34')]);_0x36dca2[_0xace9('0x36')]=_[_0xace9('0x37')](_0x36dca2[_0xace9('0x33')],_0x36dca2[_0xace9('0x34')]);_0x3f150f[_0xace9('0x38')]=_[_0xace9('0x37')](_0x36dca2['model'],qs[_0xace9('0x47')](_0x32e500[_0xace9('0x34')][_0xace9('0x47')]));_0x3f150f['attributes']=_0x3f150f[_0xace9('0x38')][_0xace9('0x39')]?_0x3f150f[_0xace9('0x38')]:_0x36dca2[_0xace9('0x33')];if(_0x32e500['query'][_0xace9('0x40')]){_0x3f150f['include']=[{'all':!![]}];}_0x3f150f=_['merge']({},_0x3f150f,_0x32e500[_0xace9('0x48')]);return db[_0xace9('0x41')][_0xace9('0x49')](_0x3f150f)[_0xace9('0x28')](handleEntityNotFound(_0x4ad6d2,null))[_0xace9('0x28')](respondWithResult(_0x4ad6d2,null))[_0xace9('0x44')](handleError(_0x4ad6d2,null));};exports[_0xace9('0x4a')]=function(_0x3c8718,_0x20d7b7){return db[_0xace9('0x41')][_0xace9('0x4a')](_0x3c8718['body'],{})[_0xace9('0x28')](respondWithResult(_0x20d7b7,0xc9))[_0xace9('0x44')](handleError(_0x20d7b7,null));};exports[_0xace9('0x27')]=function(_0x4a0475,_0x5ab271){if(_0x4a0475[_0xace9('0x4b')]['id']){delete _0x4a0475[_0xace9('0x4b')]['id'];}return db[_0xace9('0x41')][_0xace9('0x49')]({'where':{'id':_0x4a0475[_0xace9('0x46')]['id']}})[_0xace9('0x28')](handleEntityNotFound(_0x5ab271,null))[_0xace9('0x28')](saveUpdates(_0x4a0475[_0xace9('0x4b')],null))[_0xace9('0x28')](respondWithResult(_0x5ab271,null))[_0xace9('0x44')](handleError(_0x5ab271,null));};exports[_0xace9('0x29')]=function(_0xba27c,_0x155918){return db['ZohoConfiguration']['find']({'where':{'id':_0xba27c[_0xace9('0x46')]['id']}})['then'](handleEntityNotFound(_0x155918,null))[_0xace9('0x28')](removeEntity(_0x155918,null))[_0xace9('0x44')](handleError(_0x155918,null));};exports[_0xace9('0x4c')]=function(_0x45dd05,_0x10bd52,_0x3b9c21){var _0xf03658={};var _0x4c2490={};var _0x5cd9bd;var _0x17cc6c;return db[_0xace9('0x41')][_0xace9('0x4d')]({'where':{'id':_0x45dd05[_0xace9('0x46')]['id']}})[_0xace9('0x28')](handleEntityNotFound(_0x10bd52,null))[_0xace9('0x28')](function(_0x2f3d92){if(_0x2f3d92){_0x5cd9bd=_0x2f3d92;_0x4c2490[_0xace9('0x33')]=_[_0xace9('0x35')](db[_0xace9('0x4e')][_0xace9('0x2f')]);_0x4c2490[_0xace9('0x34')]=_[_0xace9('0x35')](_0x45dd05[_0xace9('0x34')]);_0x4c2490[_0xace9('0x36')]=_[_0xace9('0x37')](_0x4c2490['model'],_0x4c2490[_0xace9('0x34')]);_0xf03658[_0xace9('0x38')]=_[_0xace9('0x37')](_0x4c2490[_0xace9('0x33')],qs[_0xace9('0x47')](_0x45dd05[_0xace9('0x34')][_0xace9('0x47')]));_0xf03658[_0xace9('0x38')]=_0xf03658[_0xace9('0x38')][_0xace9('0x39')]?_0xf03658['attributes']:_0x4c2490[_0xace9('0x33')];_0xf03658[_0xace9('0x4f')]=qs[_0xace9('0x3b')](_0x45dd05['query'][_0xace9('0x3b')]);_0xf03658[_0xace9('0x3d')]=qs[_0xace9('0x36')](_['pick'](_0x45dd05[_0xace9('0x34')],_0x4c2490[_0xace9('0x36')]));if(_0x45dd05[_0xace9('0x34')]['filter']){_0xf03658[_0xace9('0x3d')]=_[_0xace9('0x3e')](_0xf03658[_0xace9('0x3d')],{'$or':_[_0xace9('0x2e')](_0xf03658[_0xace9('0x38')],function(_0x95d30d){var _0x237bc4={};_0x237bc4[_0x95d30d]={'$like':'%'+_0x45dd05[_0xace9('0x34')][_0xace9('0x3f')]+'%'};return _0x237bc4;})});}_0xf03658=_[_0xace9('0x3e')]({},_0xf03658,_0x45dd05['options']);return _0x5cd9bd[_0xace9('0x4c')](_0xf03658);}})[_0xace9('0x28')](function(_0x28fde8){if(_0x28fde8){_0x17cc6c=_0x28fde8[_0xace9('0x39')];if(!_0x45dd05[_0xace9('0x34')]['hasOwnProperty'](_0xace9('0x3a'))){_0xf03658['limit']=qs[_0xace9('0x22')](_0x45dd05[_0xace9('0x34')]['limit']);_0xf03658[_0xace9('0x20')]=qs[_0xace9('0x20')](_0x45dd05[_0xace9('0x34')][_0xace9('0x20')]);}return _0x5cd9bd['getFields'](_0xf03658);}})[_0xace9('0x28')](function(_0x1e4816){if(_0x1e4816){return _0x1e4816?{'count':_0x17cc6c,'rows':_0x1e4816}:null;}})[_0xace9('0x28')](respondWithResult(_0x10bd52,null))[_0xace9('0x44')](handleError(_0x10bd52,null));};exports['getSubjects']=function(_0x5a6706,_0x220518,_0x562423){var _0x422027={};var _0x1ac5af={};var _0x393669;var _0x2cbbb4;return db[_0xace9('0x41')][_0xace9('0x4d')]({'where':{'id':_0x5a6706[_0xace9('0x46')]['id']}})[_0xace9('0x28')](handleEntityNotFound(_0x220518,null))['then'](function(_0x3591a3){if(_0x3591a3){_0x393669=_0x3591a3;_0x1ac5af[_0xace9('0x33')]=_[_0xace9('0x35')](db[_0xace9('0x4e')]['rawAttributes']);_0x1ac5af[_0xace9('0x34')]=_['keys'](_0x5a6706['query']);_0x1ac5af[_0xace9('0x36')]=_[_0xace9('0x37')](_0x1ac5af[_0xace9('0x33')],_0x1ac5af[_0xace9('0x34')]);_0x422027[_0xace9('0x38')]=_[_0xace9('0x37')](_0x1ac5af[_0xace9('0x33')],qs[_0xace9('0x47')](_0x5a6706[_0xace9('0x34')]['fields']));_0x422027[_0xace9('0x38')]=_0x422027[_0xace9('0x38')]['length']?_0x422027['attributes']:_0x1ac5af[_0xace9('0x33')];_0x422027[_0xace9('0x4f')]=qs[_0xace9('0x3b')](_0x5a6706[_0xace9('0x34')][_0xace9('0x3b')]);_0x422027[_0xace9('0x3d')]=qs[_0xace9('0x36')](_['pick'](_0x5a6706[_0xace9('0x34')],_0x1ac5af[_0xace9('0x36')]));if(_0x5a6706[_0xace9('0x34')][_0xace9('0x3f')]){_0x422027[_0xace9('0x3d')]=_['merge'](_0x422027[_0xace9('0x3d')],{'$or':_[_0xace9('0x2e')](_0x422027[_0xace9('0x38')],function(_0x486fdb){var _0x399f7f={};_0x399f7f[_0x486fdb]={'$like':'%'+_0x5a6706['query']['filter']+'%'};return _0x399f7f;})});}_0x422027=_['merge']({},_0x422027,_0x5a6706[_0xace9('0x48')]);return _0x393669[_0xace9('0x50')](_0x422027);}})['then'](function(_0x1c1f47){if(_0x1c1f47){_0x2cbbb4=_0x1c1f47[_0xace9('0x39')];if(!_0x5a6706['query'][_0xace9('0x51')](_0xace9('0x3a'))){_0x422027[_0xace9('0x22')]=qs['limit'](_0x5a6706[_0xace9('0x34')]['limit']);_0x422027['offset']=qs[_0xace9('0x20')](_0x5a6706['query'][_0xace9('0x20')]);}return _0x393669[_0xace9('0x50')](_0x422027);}})[_0xace9('0x28')](function(_0x5f3d08){if(_0x5f3d08){return _0x5f3d08?{'count':_0x2cbbb4,'rows':_0x5f3d08}:null;}})[_0xace9('0x28')](respondWithResult(_0x220518,null))[_0xace9('0x44')](handleError(_0x220518,null));};exports[_0xace9('0x52')]=function(_0x2340b4,_0x250e35,_0x4951ed){var _0x24bae2={};var _0x1c1365={};var _0x3c63b3;var _0x2718b2;return db[_0xace9('0x41')][_0xace9('0x4d')]({'where':{'id':_0x2340b4[_0xace9('0x46')]['id']}})[_0xace9('0x28')](handleEntityNotFound(_0x250e35,null))[_0xace9('0x28')](function(_0x499f89){if(_0x499f89){_0x3c63b3=_0x499f89;_0x1c1365[_0xace9('0x33')]=_['keys'](db[_0xace9('0x4e')]['rawAttributes']);_0x1c1365[_0xace9('0x34')]=_[_0xace9('0x35')](_0x2340b4[_0xace9('0x34')]);_0x1c1365[_0xace9('0x36')]=_[_0xace9('0x37')](_0x1c1365[_0xace9('0x33')],_0x1c1365['query']);_0x24bae2[_0xace9('0x38')]=_['intersection'](_0x1c1365[_0xace9('0x33')],qs['fields'](_0x2340b4[_0xace9('0x34')][_0xace9('0x47')]));_0x24bae2[_0xace9('0x38')]=_0x24bae2[_0xace9('0x38')][_0xace9('0x39')]?_0x24bae2[_0xace9('0x38')]:_0x1c1365[_0xace9('0x33')];_0x24bae2[_0xace9('0x4f')]=qs[_0xace9('0x3b')](_0x2340b4['query']['sort']);_0x24bae2[_0xace9('0x3d')]=qs[_0xace9('0x36')](_[_0xace9('0x3c')](_0x2340b4[_0xace9('0x34')],_0x1c1365[_0xace9('0x36')]));if(_0x2340b4['query'][_0xace9('0x3f')]){_0x24bae2[_0xace9('0x3d')]=_[_0xace9('0x3e')](_0x24bae2['where'],{'$or':_[_0xace9('0x2e')](_0x24bae2['attributes'],function(_0xb696b3){var _0x7e0307={};_0x7e0307[_0xb696b3]={'$like':'%'+_0x2340b4[_0xace9('0x34')]['filter']+'%'};return _0x7e0307;})});}_0x24bae2=_[_0xace9('0x3e')]({},_0x24bae2,_0x2340b4[_0xace9('0x48')]);return _0x3c63b3[_0xace9('0x52')](_0x24bae2);}})[_0xace9('0x28')](function(_0x472afa){if(_0x472afa){_0x2718b2=_0x472afa[_0xace9('0x39')];if(!_0x2340b4[_0xace9('0x34')][_0xace9('0x51')](_0xace9('0x3a'))){_0x24bae2['limit']=qs[_0xace9('0x22')](_0x2340b4['query'][_0xace9('0x22')]);_0x24bae2[_0xace9('0x20')]=qs[_0xace9('0x20')](_0x2340b4[_0xace9('0x34')][_0xace9('0x20')]);}return _0x3c63b3[_0xace9('0x52')](_0x24bae2);}})[_0xace9('0x28')](function(_0x4b3def){if(_0x4b3def){return _0x4b3def?{'count':_0x2718b2,'rows':_0x4b3def}:null;}})[_0xace9('0x28')](respondWithResult(_0x250e35,null))[_0xace9('0x44')](handleError(_0x250e35,null));}; \ No newline at end of file +var _0x2973=['catch','show','params','keys','create','body','find','ZohoField','order','getFields','nolimit','getSubjects','getDescriptions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','rawAttributes','type','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','ZohoConfiguration','findAll','rows'];(function(_0x3bc72b,_0x34bc37){var _0x519a42=function(_0x244dd2){while(--_0x244dd2){_0x3bc72b['push'](_0x3bc72b['shift']());}};_0x519a42(++_0x34bc37);}(_0x2973,0xb6));var _0x3297=function(_0x11c0cb,_0x4476aa){_0x11c0cb=_0x11c0cb-0x0;var _0x3dbf20=_0x2973[_0x11c0cb];return _0x3dbf20;};'use strict';var emlformat=require(_0x3297('0x0'));var rimraf=require(_0x3297('0x1'));var zipdir=require(_0x3297('0x2'));var jsonpatch=require(_0x3297('0x3'));var rp=require(_0x3297('0x4'));var moment=require(_0x3297('0x5'));var BPromise=require(_0x3297('0x6'));var Mustache=require(_0x3297('0x7'));var util=require(_0x3297('0x8'));var path=require('path');var sox=require(_0x3297('0x9'));var csv=require(_0x3297('0xa'));var ejs=require(_0x3297('0xb'));var fs=require('fs');var fs_extra=require(_0x3297('0xc'));var _=require(_0x3297('0xd'));var squel=require('squel');var crypto=require(_0x3297('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3297('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3297('0x10'));var Papa=require(_0x3297('0x11'));var Redis=require(_0x3297('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3297('0x13'));var as=require(_0x3297('0x14'));var hardwareService=require(_0x3297('0x15'));var logger=require(_0x3297('0x16'))(_0x3297('0x17'));var utils=require(_0x3297('0x18'));var config=require(_0x3297('0x19'));var licenseUtil=require(_0x3297('0x1a'));var db=require(_0x3297('0x1b'))['db'];function respondWithStatusCode(_0x2fda51,_0x32de89){_0x32de89=_0x32de89||0xcc;return function(_0x3cfdb9){if(_0x3cfdb9){return _0x2fda51[_0x3297('0x1c')](_0x32de89);}return _0x2fda51[_0x3297('0x1d')](_0x32de89)[_0x3297('0x1e')]();};}function respondWithResult(_0xe8877,_0x4c3bd4){_0x4c3bd4=_0x4c3bd4||0xc8;return function(_0x228b5b){if(_0x228b5b){return _0xe8877[_0x3297('0x1d')](_0x4c3bd4)[_0x3297('0x1f')](_0x228b5b);}};}function respondWithFilteredResult(_0x125d05,_0x187f6f){return function(_0x337815){if(_0x337815){var _0x399bec=typeof _0x187f6f[_0x3297('0x20')]===_0x3297('0x21')&&typeof _0x187f6f[_0x3297('0x22')]==='undefined';var _0x2d26a4=_0x337815[_0x3297('0x23')];var _0x263b4b=_0x399bec?0x0:_0x187f6f[_0x3297('0x20')];var _0x50ac34=_0x399bec?_0x337815[_0x3297('0x23')]:_0x187f6f[_0x3297('0x20')]+_0x187f6f[_0x3297('0x22')];var _0x2c148b;if(_0x50ac34>=_0x2d26a4){_0x50ac34=_0x2d26a4;_0x2c148b=0xc8;}else{_0x2c148b=0xce;}_0x125d05[_0x3297('0x1d')](_0x2c148b);return _0x125d05['set'](_0x3297('0x24'),_0x263b4b+'-'+_0x50ac34+'/'+_0x2d26a4)[_0x3297('0x1f')](_0x337815);}return null;};}function patchUpdates(_0x23603a){return function(_0x35357f){try{jsonpatch[_0x3297('0x25')](_0x35357f,_0x23603a,!![]);}catch(_0x5bdb11){return BPromise[_0x3297('0x26')](_0x5bdb11);}return _0x35357f[_0x3297('0x27')]();};}function saveUpdates(_0x4b13d8,_0x14d23f){return function(_0x93e80b){if(_0x93e80b){return _0x93e80b[_0x3297('0x28')](_0x4b13d8)[_0x3297('0x29')](function(_0x938efd){return _0x938efd;});}return null;};}function removeEntity(_0x185d4d,_0x365890){return function(_0x3d727b){if(_0x3d727b){return _0x3d727b[_0x3297('0x2a')]()[_0x3297('0x29')](function(){_0x185d4d[_0x3297('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee6ec,_0x3bd754){return function(_0x1d24a8){if(!_0x1d24a8){_0x2ee6ec[_0x3297('0x1c')](0x194);}return _0x1d24a8;};}function handleError(_0x5e7f58,_0x5910d8){_0x5910d8=_0x5910d8||0x1f4;return function(_0x3a02a2){logger[_0x3297('0x2b')](_0x3a02a2[_0x3297('0x2c')]);if(_0x3a02a2['name']){delete _0x3a02a2['name'];}_0x5e7f58[_0x3297('0x1d')](_0x5910d8)['send'](_0x3a02a2);};}exports[_0x3297('0x2d')]=function(_0x18fe1a,_0x547a7d){var _0x1bd69d={},_0x4d6b07={},_0x39e167={'count':0x0,'rows':[]};var _0x21f79c=_[_0x3297('0x2e')](db['ZohoConfiguration'][_0x3297('0x2f')],function(_0x5fcaae){return{'name':_0x5fcaae['fieldName'],'type':_0x5fcaae[_0x3297('0x30')]['key']};});_0x4d6b07[_0x3297('0x31')]=_[_0x3297('0x2e')](_0x21f79c,_0x3297('0x32'));_0x4d6b07['query']=_['keys'](_0x18fe1a[_0x3297('0x33')]);_0x4d6b07[_0x3297('0x34')]=_[_0x3297('0x35')](_0x4d6b07['model'],_0x4d6b07[_0x3297('0x33')]);_0x1bd69d['attributes']=_[_0x3297('0x35')](_0x4d6b07[_0x3297('0x31')],qs[_0x3297('0x36')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x36')]));_0x1bd69d['attributes']=_0x1bd69d[_0x3297('0x37')][_0x3297('0x38')]?_0x1bd69d['attributes']:_0x4d6b07[_0x3297('0x31')];if(!_0x18fe1a[_0x3297('0x33')][_0x3297('0x39')]('nolimit')){_0x1bd69d['limit']=qs[_0x3297('0x22')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x22')]);_0x1bd69d[_0x3297('0x20')]=qs[_0x3297('0x20')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x20')]);}_0x1bd69d['order']=qs[_0x3297('0x3a')](_0x18fe1a[_0x3297('0x33')][_0x3297('0x3a')]);_0x1bd69d['where']=qs[_0x3297('0x34')](_[_0x3297('0x3b')](_0x18fe1a[_0x3297('0x33')],_0x4d6b07[_0x3297('0x34')]),_0x21f79c);if(_0x18fe1a[_0x3297('0x33')]['filter']){_0x1bd69d[_0x3297('0x3c')]=_[_0x3297('0x3d')](_0x1bd69d['where'],{'$or':_[_0x3297('0x2e')](_0x21f79c,function(_0x3d6cdc){if(_0x3d6cdc[_0x3297('0x30')]!==_0x3297('0x3e')){var _0x474b8f={};_0x474b8f[_0x3d6cdc[_0x3297('0x32')]]={'$like':'%'+_0x18fe1a[_0x3297('0x33')][_0x3297('0x3f')]+'%'};return _0x474b8f;}})});}_0x1bd69d=_[_0x3297('0x3d')]({},_0x1bd69d,_0x18fe1a[_0x3297('0x40')]);var _0x773459={'where':_0x1bd69d[_0x3297('0x3c')]};return db['ZohoConfiguration'][_0x3297('0x23')](_0x773459)['then'](function(_0x330524){_0x39e167[_0x3297('0x23')]=_0x330524;if(_0x18fe1a[_0x3297('0x33')][_0x3297('0x41')]){_0x1bd69d[_0x3297('0x42')]=[{'all':!![]}];}return db[_0x3297('0x43')][_0x3297('0x44')](_0x1bd69d);})['then'](function(_0x4e0644){_0x39e167[_0x3297('0x45')]=_0x4e0644;return _0x39e167;})[_0x3297('0x29')](respondWithFilteredResult(_0x547a7d,_0x1bd69d))[_0x3297('0x46')](handleError(_0x547a7d,null));};exports[_0x3297('0x47')]=function(_0xba8c02,_0x5b648e){var _0x4d75ce={'raw':![],'where':{'id':_0xba8c02[_0x3297('0x48')]['id']}},_0x5ca846={};_0x5ca846['model']=_[_0x3297('0x49')](db['ZohoConfiguration'][_0x3297('0x2f')]);_0x5ca846[_0x3297('0x33')]=_[_0x3297('0x49')](_0xba8c02[_0x3297('0x33')]);_0x5ca846[_0x3297('0x34')]=_[_0x3297('0x35')](_0x5ca846[_0x3297('0x31')],_0x5ca846[_0x3297('0x33')]);_0x4d75ce[_0x3297('0x37')]=_[_0x3297('0x35')](_0x5ca846[_0x3297('0x31')],qs[_0x3297('0x36')](_0xba8c02[_0x3297('0x33')][_0x3297('0x36')]));_0x4d75ce[_0x3297('0x37')]=_0x4d75ce[_0x3297('0x37')][_0x3297('0x38')]?_0x4d75ce['attributes']:_0x5ca846['model'];if(_0xba8c02[_0x3297('0x33')][_0x3297('0x41')]){_0x4d75ce[_0x3297('0x42')]=[{'all':!![]}];}_0x4d75ce=_['merge']({},_0x4d75ce,_0xba8c02[_0x3297('0x40')]);return db[_0x3297('0x43')]['find'](_0x4d75ce)['then'](handleEntityNotFound(_0x5b648e,null))[_0x3297('0x29')](respondWithResult(_0x5b648e,null))[_0x3297('0x46')](handleError(_0x5b648e,null));};exports[_0x3297('0x4a')]=function(_0x409e85,_0x24dc6b){return db['ZohoConfiguration']['create'](_0x409e85[_0x3297('0x4b')],{})[_0x3297('0x29')](respondWithResult(_0x24dc6b,0xc9))[_0x3297('0x46')](handleError(_0x24dc6b,null));};exports[_0x3297('0x28')]=function(_0x1df3b8,_0x22cda5){if(_0x1df3b8[_0x3297('0x4b')]['id']){delete _0x1df3b8[_0x3297('0x4b')]['id'];}return db[_0x3297('0x43')][_0x3297('0x4c')]({'where':{'id':_0x1df3b8[_0x3297('0x48')]['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x22cda5,null))[_0x3297('0x29')](saveUpdates(_0x1df3b8[_0x3297('0x4b')],null))['then'](respondWithResult(_0x22cda5,null))['catch'](handleError(_0x22cda5,null));};exports[_0x3297('0x2a')]=function(_0x52580b,_0x24570f){return db[_0x3297('0x43')][_0x3297('0x4c')]({'where':{'id':_0x52580b['params']['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x24570f,null))['then'](removeEntity(_0x24570f,null))[_0x3297('0x46')](handleError(_0x24570f,null));};exports['getFields']=function(_0x51b471,_0x15fbd7,_0x84f34){var _0x1bea0f={};var _0x831f2a={};var _0x58b5bc;var _0x3d5a86;return db[_0x3297('0x43')]['findOne']({'where':{'id':_0x51b471['params']['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x15fbd7,null))['then'](function(_0x50a327){if(_0x50a327){_0x58b5bc=_0x50a327;_0x831f2a[_0x3297('0x31')]=_['keys'](db[_0x3297('0x4d')][_0x3297('0x2f')]);_0x831f2a['query']=_[_0x3297('0x49')](_0x51b471[_0x3297('0x33')]);_0x831f2a[_0x3297('0x34')]=_[_0x3297('0x35')](_0x831f2a['model'],_0x831f2a[_0x3297('0x33')]);_0x1bea0f['attributes']=_[_0x3297('0x35')](_0x831f2a[_0x3297('0x31')],qs[_0x3297('0x36')](_0x51b471[_0x3297('0x33')][_0x3297('0x36')]));_0x1bea0f[_0x3297('0x37')]=_0x1bea0f[_0x3297('0x37')][_0x3297('0x38')]?_0x1bea0f[_0x3297('0x37')]:_0x831f2a[_0x3297('0x31')];_0x1bea0f[_0x3297('0x4e')]=qs[_0x3297('0x3a')](_0x51b471[_0x3297('0x33')][_0x3297('0x3a')]);_0x1bea0f[_0x3297('0x3c')]=qs['filters'](_[_0x3297('0x3b')](_0x51b471[_0x3297('0x33')],_0x831f2a[_0x3297('0x34')]));if(_0x51b471[_0x3297('0x33')][_0x3297('0x3f')]){_0x1bea0f[_0x3297('0x3c')]=_['merge'](_0x1bea0f[_0x3297('0x3c')],{'$or':_[_0x3297('0x2e')](_0x1bea0f['attributes'],function(_0x226c0e){var _0x3bdce9={};_0x3bdce9[_0x226c0e]={'$like':'%'+_0x51b471[_0x3297('0x33')]['filter']+'%'};return _0x3bdce9;})});}_0x1bea0f=_[_0x3297('0x3d')]({},_0x1bea0f,_0x51b471['options']);return _0x58b5bc[_0x3297('0x4f')](_0x1bea0f);}})['then'](function(_0xcc8bc){if(_0xcc8bc){_0x3d5a86=_0xcc8bc[_0x3297('0x38')];if(!_0x51b471[_0x3297('0x33')][_0x3297('0x39')](_0x3297('0x50'))){_0x1bea0f[_0x3297('0x22')]=qs[_0x3297('0x22')](_0x51b471[_0x3297('0x33')]['limit']);_0x1bea0f[_0x3297('0x20')]=qs[_0x3297('0x20')](_0x51b471[_0x3297('0x33')]['offset']);}return _0x58b5bc['getFields'](_0x1bea0f);}})[_0x3297('0x29')](function(_0x567810){if(_0x567810){return _0x567810?{'count':_0x3d5a86,'rows':_0x567810}:null;}})[_0x3297('0x29')](respondWithResult(_0x15fbd7,null))[_0x3297('0x46')](handleError(_0x15fbd7,null));};exports[_0x3297('0x51')]=function(_0x2f1d97,_0x1703ab,_0x23cac4){var _0x27a485={};var _0x1bf9c2={};var _0x32fd14;var _0x2a132b;return db[_0x3297('0x43')]['findOne']({'where':{'id':_0x2f1d97[_0x3297('0x48')]['id']}})[_0x3297('0x29')](handleEntityNotFound(_0x1703ab,null))[_0x3297('0x29')](function(_0x3ed1f6){if(_0x3ed1f6){_0x32fd14=_0x3ed1f6;_0x1bf9c2['model']=_[_0x3297('0x49')](db['ZohoField'][_0x3297('0x2f')]);_0x1bf9c2['query']=_[_0x3297('0x49')](_0x2f1d97['query']);_0x1bf9c2[_0x3297('0x34')]=_[_0x3297('0x35')](_0x1bf9c2['model'],_0x1bf9c2[_0x3297('0x33')]);_0x27a485[_0x3297('0x37')]=_[_0x3297('0x35')](_0x1bf9c2[_0x3297('0x31')],qs[_0x3297('0x36')](_0x2f1d97[_0x3297('0x33')][_0x3297('0x36')]));_0x27a485[_0x3297('0x37')]=_0x27a485[_0x3297('0x37')][_0x3297('0x38')]?_0x27a485[_0x3297('0x37')]:_0x1bf9c2[_0x3297('0x31')];_0x27a485[_0x3297('0x4e')]=qs[_0x3297('0x3a')](_0x2f1d97[_0x3297('0x33')][_0x3297('0x3a')]);_0x27a485[_0x3297('0x3c')]=qs[_0x3297('0x34')](_[_0x3297('0x3b')](_0x2f1d97[_0x3297('0x33')],_0x1bf9c2['filters']));if(_0x2f1d97['query'][_0x3297('0x3f')]){_0x27a485[_0x3297('0x3c')]=_['merge'](_0x27a485[_0x3297('0x3c')],{'$or':_[_0x3297('0x2e')](_0x27a485[_0x3297('0x37')],function(_0x622856){var _0x2b00e0={};_0x2b00e0[_0x622856]={'$like':'%'+_0x2f1d97['query'][_0x3297('0x3f')]+'%'};return _0x2b00e0;})});}_0x27a485=_['merge']({},_0x27a485,_0x2f1d97[_0x3297('0x40')]);return _0x32fd14[_0x3297('0x51')](_0x27a485);}})[_0x3297('0x29')](function(_0x3bba23){if(_0x3bba23){_0x2a132b=_0x3bba23[_0x3297('0x38')];if(!_0x2f1d97[_0x3297('0x33')][_0x3297('0x39')](_0x3297('0x50'))){_0x27a485[_0x3297('0x22')]=qs['limit'](_0x2f1d97[_0x3297('0x33')]['limit']);_0x27a485['offset']=qs[_0x3297('0x20')](_0x2f1d97[_0x3297('0x33')]['offset']);}return _0x32fd14[_0x3297('0x51')](_0x27a485);}})[_0x3297('0x29')](function(_0x592dae){if(_0x592dae){return _0x592dae?{'count':_0x2a132b,'rows':_0x592dae}:null;}})['then'](respondWithResult(_0x1703ab,null))[_0x3297('0x46')](handleError(_0x1703ab,null));};exports[_0x3297('0x52')]=function(_0x5ccd83,_0xb4c8ec,_0x104eea){var _0x380386={};var _0x4be106={};var _0x4de3fe;var _0x3d14a0;return db['ZohoConfiguration'][_0x3297('0x53')]({'where':{'id':_0x5ccd83[_0x3297('0x48')]['id']}})[_0x3297('0x29')](handleEntityNotFound(_0xb4c8ec,null))[_0x3297('0x29')](function(_0x55e7dd){if(_0x55e7dd){_0x4de3fe=_0x55e7dd;_0x4be106[_0x3297('0x31')]=_[_0x3297('0x49')](db['ZohoField'][_0x3297('0x2f')]);_0x4be106[_0x3297('0x33')]=_[_0x3297('0x49')](_0x5ccd83['query']);_0x4be106[_0x3297('0x34')]=_[_0x3297('0x35')](_0x4be106[_0x3297('0x31')],_0x4be106[_0x3297('0x33')]);_0x380386['attributes']=_[_0x3297('0x35')](_0x4be106[_0x3297('0x31')],qs[_0x3297('0x36')](_0x5ccd83[_0x3297('0x33')]['fields']));_0x380386[_0x3297('0x37')]=_0x380386['attributes'][_0x3297('0x38')]?_0x380386[_0x3297('0x37')]:_0x4be106[_0x3297('0x31')];_0x380386[_0x3297('0x4e')]=qs[_0x3297('0x3a')](_0x5ccd83['query'][_0x3297('0x3a')]);_0x380386[_0x3297('0x3c')]=qs['filters'](_[_0x3297('0x3b')](_0x5ccd83[_0x3297('0x33')],_0x4be106[_0x3297('0x34')]));if(_0x5ccd83[_0x3297('0x33')][_0x3297('0x3f')]){_0x380386[_0x3297('0x3c')]=_[_0x3297('0x3d')](_0x380386['where'],{'$or':_['map'](_0x380386['attributes'],function(_0x9672ec){var _0x2465e5={};_0x2465e5[_0x9672ec]={'$like':'%'+_0x5ccd83['query'][_0x3297('0x3f')]+'%'};return _0x2465e5;})});}_0x380386=_['merge']({},_0x380386,_0x5ccd83[_0x3297('0x40')]);return _0x4de3fe[_0x3297('0x52')](_0x380386);}})[_0x3297('0x29')](function(_0x3c8a06){if(_0x3c8a06){_0x3d14a0=_0x3c8a06[_0x3297('0x38')];if(!_0x5ccd83['query']['hasOwnProperty'](_0x3297('0x50'))){_0x380386[_0x3297('0x22')]=qs[_0x3297('0x22')](_0x5ccd83[_0x3297('0x33')][_0x3297('0x22')]);_0x380386['offset']=qs['offset'](_0x5ccd83[_0x3297('0x33')][_0x3297('0x20')]);}return _0x4de3fe[_0x3297('0x52')](_0x380386);}})['then'](function(_0x43ada3){if(_0x43ada3){return _0x43ada3?{'count':_0x3d14a0,'rows':_0x43ada3}:null;}})['then'](respondWithResult(_0xb4c8ec,null))['catch'](handleError(_0xb4c8ec,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 2589234..c0df220 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 _0xfd89=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','lodash'];(function(_0x419824,_0x3d9262){var _0x5e31da=function(_0x57eed0){while(--_0x57eed0){_0x419824['push'](_0x419824['shift']());}};_0x5e31da(++_0x3d9262);}(_0xfd89,0x128));var _0x9fd8=function(_0x2be67e,_0x1eb320){_0x2be67e=_0x2be67e-0x0;var _0x20d6d9=_0xfd89[_0x2be67e];return _0x20d6d9;};'use strict';var _=require(_0x9fd8('0x0'));var util=require('util');var logger=require(_0x9fd8('0x1'))(_0x9fd8('0x2'));var moment=require('moment');var BPromise=require(_0x9fd8('0x3'));var rp=require(_0x9fd8('0x4'));var fs=require('fs');var path=require(_0x9fd8('0x5'));var rimraf=require(_0x9fd8('0x6'));var config=require(_0x9fd8('0x7'));var attributes=require(_0x9fd8('0x8'));module[_0x9fd8('0x9')]=function(_0x39ac38,_0x1081cc){return _0x39ac38[_0x9fd8('0xa')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa30c=['rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x217010,_0x57aeff){var _0x2d99b8=function(_0x1cddf7){while(--_0x1cddf7){_0x217010['push'](_0x217010['shift']());}};_0x2d99b8(++_0x57aeff);}(_0xa30c,0x69));var _0xca30=function(_0x198d9,_0x48217c){_0x198d9=_0x198d9-0x0;var _0x51e065=_0xa30c[_0x198d9];return _0x51e065;};'use strict';var _=require(_0xca30('0x0'));var util=require(_0xca30('0x1'));var logger=require(_0xca30('0x2'))(_0xca30('0x3'));var moment=require('moment');var BPromise=require(_0xca30('0x4'));var rp=require(_0xca30('0x5'));var fs=require('fs');var path=require(_0xca30('0x6'));var rimraf=require(_0xca30('0x7'));var config=require(_0xca30('0x8'));var attributes=require(_0xca30('0x9'));module[_0xca30('0xa')]=function(_0x42e0a8,_0x16fe9a){return _0x42e0a8[_0xca30('0xb')](_0xca30('0xc'),attributes,{'tableName':_0xca30('0xd'),'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 4977714..f8470a4 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 _0x3050=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1b53d2,_0x2d3a5b){var _0x1ce9af=function(_0x57fab1){while(--_0x57fab1){_0x1b53d2['push'](_0x1b53d2['shift']());}};_0x1ce9af(++_0x2d3a5b);}(_0x3050,0xa4));var _0x0305=function(_0x33efc2,_0x43e4d4){_0x33efc2=_0x33efc2-0x0;var _0x1e3bfd=_0x3050[_0x33efc2];return _0x1e3bfd;};'use strict';var _=require(_0x0305('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0305('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0305('0x2'));var db=require(_0x0305('0x3'))['db'];var utils=require(_0x0305('0x4'));var logger=require(_0x0305('0x5'))(_0x0305('0x6'));var config=require(_0x0305('0x7'));var jayson=require(_0x0305('0x8'));var client=jayson['client'][_0x0305('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4fa9ed,_0x23cb67,_0x4e1949){return new BPromise(function(_0x13fe0c,_0x57770b){return client[_0x0305('0xa')](_0x4fa9ed,_0x4e1949)[_0x0305('0xb')](function(_0x558a77){logger[_0x0305('0xc')](_0x0305('0xd'),_0x23cb67,_0x0305('0xe'));logger[_0x0305('0xf')](_0x0305('0x10'),_0x23cb67,_0x0305('0xe'),JSON['stringify'](_0x558a77));if(_0x558a77[_0x0305('0x11')]){if(_0x558a77[_0x0305('0x11')][_0x0305('0x12')]===0x1f4){logger[_0x0305('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x23cb67,_0x558a77[_0x0305('0x11')][_0x0305('0x13')]);return _0x57770b(_0x558a77[_0x0305('0x11')][_0x0305('0x13')]);}logger[_0x0305('0x11')](_0x0305('0xd'),_0x23cb67,_0x558a77[_0x0305('0x11')][_0x0305('0x13')]);return _0x13fe0c(_0x558a77[_0x0305('0x11')][_0x0305('0x13')]);}else{logger[_0x0305('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x23cb67,_0x0305('0xe'));_0x13fe0c(_0x558a77[_0x0305('0x14')]['message']);}})[_0x0305('0x15')](function(_0x34dbb3){logger[_0x0305('0x11')](_0x0305('0xd'),_0x23cb67,_0x34dbb3);_0x57770b(_0x34dbb3);});});} \ No newline at end of file +var _0xc217=['ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x348c13,_0x492072){var _0x3528f7=function(_0x570007){while(--_0x570007){_0x348c13['push'](_0x348c13['shift']());}};_0x3528f7(++_0x492072);}(_0xc217,0x11d));var _0x7c21=function(_0x25b4a4,_0x2e081b){_0x25b4a4=_0x25b4a4-0x0;var _0x707267=_0xc217[_0x25b4a4];return _0x707267;};'use strict';var _=require('lodash');var util=require(_0x7c21('0x0'));var moment=require(_0x7c21('0x1'));var BPromise=require(_0x7c21('0x2'));var rs=require(_0x7c21('0x3'));var fs=require('fs');var Redis=require(_0x7c21('0x4'));var db=require(_0x7c21('0x5'))['db'];var utils=require(_0x7c21('0x6'));var logger=require('../../config/logger')(_0x7c21('0x7'));var config=require(_0x7c21('0x8'));var jayson=require(_0x7c21('0x9'));var client=jayson['client'][_0x7c21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1339ce,_0x534367,_0x31d6ee){return new BPromise(function(_0x4d6182,_0x980d39){return client[_0x7c21('0xb')](_0x1339ce,_0x31d6ee)[_0x7c21('0xc')](function(_0x225ca6){logger[_0x7c21('0xd')](_0x7c21('0xe'),_0x534367,'request\x20sent');logger[_0x7c21('0xf')](_0x7c21('0x10'),_0x534367,_0x7c21('0x11'),JSON[_0x7c21('0x12')](_0x225ca6));if(_0x225ca6[_0x7c21('0x13')]){if(_0x225ca6[_0x7c21('0x13')][_0x7c21('0x14')]===0x1f4){logger['error'](_0x7c21('0xe'),_0x534367,_0x225ca6['error']['message']);return _0x980d39(_0x225ca6[_0x7c21('0x13')][_0x7c21('0x15')]);}logger[_0x7c21('0x13')](_0x7c21('0xe'),_0x534367,_0x225ca6[_0x7c21('0x13')][_0x7c21('0x15')]);return _0x4d6182(_0x225ca6['error'][_0x7c21('0x15')]);}else{logger[_0x7c21('0xd')](_0x7c21('0xe'),_0x534367,_0x7c21('0x11'));_0x4d6182(_0x225ca6['result']['message']);}})[_0x7c21('0x16')](function(_0x8a4266){logger['error'](_0x7c21('0xe'),_0x534367,_0x8a4266);_0x980d39(_0x8a4266);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index a697065..317ff21 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 _0xb630=['./intZohoField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5b109e,_0x138cda){var _0x232280=function(_0x241950){while(--_0x241950){_0x5b109e['push'](_0x5b109e['shift']());}};_0x232280(++_0x138cda);}(_0xb630,0x1b1));var _0x0b63=function(_0x5abf7a,_0x4d16bb){_0x5abf7a=_0x5abf7a-0x0;var _0x17350f=_0xb630[_0x5abf7a];return _0x17350f;};'use strict';var multer=require(_0x0b63('0x0'));var util=require('util');var path=require(_0x0b63('0x1'));var timeout=require(_0x0b63('0x2'));var express=require(_0x0b63('0x3'));var router=express[_0x0b63('0x4')]();var fs_extra=require(_0x0b63('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0b63('0x6'));var config=require(_0x0b63('0x7'));var controller=require(_0x0b63('0x8'));router[_0x0b63('0x9')]('/',auth['isAuthenticated'](),controller[_0x0b63('0xa')]);router[_0x0b63('0x9')](_0x0b63('0xb'),auth[_0x0b63('0xc')](),controller[_0x0b63('0xd')]);router[_0x0b63('0xe')]('/',auth[_0x0b63('0xc')](),controller[_0x0b63('0xf')]);router[_0x0b63('0x10')]('/:id',auth[_0x0b63('0xc')](),controller[_0x0b63('0x11')]);router[_0x0b63('0x12')](_0x0b63('0xb'),auth[_0x0b63('0xc')](),controller[_0x0b63('0x13')]);module[_0x0b63('0x14')]=router; \ No newline at end of file +var _0x6081=['./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x6081,0x71));var _0x1608=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6081[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x1608('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1608('0x1'));var express=require(_0x1608('0x2'));var router=express[_0x1608('0x3')]();var fs_extra=require(_0x1608('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1608('0x5'));var controller=require(_0x1608('0x6'));router[_0x1608('0x7')]('/',auth[_0x1608('0x8')](),controller[_0x1608('0x9')]);router[_0x1608('0x7')](_0x1608('0xa'),auth['isAuthenticated'](),controller[_0x1608('0xb')]);router[_0x1608('0xc')]('/',auth[_0x1608('0x8')](),controller['create']);router[_0x1608('0xd')](_0x1608('0xa'),auth[_0x1608('0x8')](),controller[_0x1608('0xe')]);router['delete'](_0x1608('0xa'),auth[_0x1608('0x8')](),controller[_0x1608('0xf')]);module[_0x1608('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 6391180..9142373 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 _0x0ab7=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4f768a,_0x413685){var _0x4ab541=function(_0x213c3a){while(--_0x213c3a){_0x4f768a['push'](_0x4f768a['shift']());}};_0x4ab541(++_0x413685);}(_0x0ab7,0x66));var _0x70ab=function(_0x9e0aeb,_0x306893){_0x9e0aeb=_0x9e0aeb-0x0;var _0x52f7b2=_0x0ab7[_0x9e0aeb];return _0x52f7b2;};'use strict';var Sequelize=require(_0x70ab('0x0'));module[_0x70ab('0x1')]={'type':{'type':Sequelize[_0x70ab('0x2')](_0x70ab('0x3'),_0x70ab('0x4'),_0x70ab('0x5'),_0x70ab('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x70ab('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x70ab('0x2')](_0x70ab('0x3'),_0x70ab('0x4'),_0x70ab('0x5'))},'keyContent':{'type':Sequelize[_0x70ab('0x7')]},'idField':{'type':Sequelize[_0x70ab('0x7')]},'nameField':{'type':Sequelize[_0x70ab('0x7')]},'customField':{'type':Sequelize[_0x70ab('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x70ab('0x7')]}}; \ No newline at end of file +var _0xd1e0=['customVariable','keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xd1e0,0x1ad));var _0x0d1e=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0xd1e0[_0x454165];return _0x56db53;};'use strict';var Sequelize=require(_0x0d1e('0x0'));module[_0x0d1e('0x1')]={'type':{'type':Sequelize[_0x0d1e('0x2')]('string','variable',_0x0d1e('0x3'),_0x0d1e('0x4'),'picklist'),'defaultValue':_0x0d1e('0x5')},'content':{'type':Sequelize[_0x0d1e('0x6')]},'key':{'type':Sequelize[_0x0d1e('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x0d1e('0x5'),_0x0d1e('0x7'),_0x0d1e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0d1e('0x6')]},'nameField':{'type':Sequelize[_0x0d1e('0x6')]},'customField':{'type':Sequelize[_0x0d1e('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 c350c4f..2e5e2b3 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 _0x70b8=['intersection','attributes','fields','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','filters','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x2abebf,_0x146340){var _0x2af99b=function(_0x524f36){while(--_0x524f36){_0x2abebf['push'](_0x2abebf['shift']());}};_0x2af99b(++_0x146340);}(_0x70b8,0xf4));var _0x870b=function(_0x33140b,_0x4e6776){_0x33140b=_0x33140b-0x0;var _0x238cb9=_0x70b8[_0x33140b];return _0x238cb9;};'use strict';var emlformat=require(_0x870b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x870b('0x1'));var jsonpatch=require(_0x870b('0x2'));var rp=require(_0x870b('0x3'));var moment=require(_0x870b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x870b('0x5'));var util=require(_0x870b('0x6'));var path=require(_0x870b('0x7'));var sox=require(_0x870b('0x8'));var csv=require('to-csv');var ejs=require(_0x870b('0x9'));var fs=require('fs');var fs_extra=require(_0x870b('0xa'));var _=require('lodash');var squel=require(_0x870b('0xb'));var crypto=require(_0x870b('0xc'));var jsforce=require(_0x870b('0xd'));var deskjs=require(_0x870b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x870b('0xf'));var Papa=require(_0x870b('0x10'));var Redis=require(_0x870b('0x11'));var authService=require(_0x870b('0x12'));var qs=require(_0x870b('0x13'));var as=require(_0x870b('0x14'));var hardwareService=require(_0x870b('0x15'));var logger=require(_0x870b('0x16'))(_0x870b('0x17'));var utils=require(_0x870b('0x18'));var config=require(_0x870b('0x19'));var licenseUtil=require(_0x870b('0x1a'));var db=require(_0x870b('0x1b'))['db'];function respondWithStatusCode(_0x173828,_0x2c0908){_0x2c0908=_0x2c0908||0xcc;return function(_0x4fb015){if(_0x4fb015){return _0x173828[_0x870b('0x1c')](_0x2c0908);}return _0x173828[_0x870b('0x1d')](_0x2c0908)[_0x870b('0x1e')]();};}function respondWithResult(_0x2ea5ad,_0x33e84b){_0x33e84b=_0x33e84b||0xc8;return function(_0x395aeb){if(_0x395aeb){return _0x2ea5ad[_0x870b('0x1d')](_0x33e84b)[_0x870b('0x1f')](_0x395aeb);}};}function respondWithFilteredResult(_0x5289ed,_0x2a1021){return function(_0x4df387){if(_0x4df387){var _0x14e820=typeof _0x2a1021[_0x870b('0x20')]===_0x870b('0x21')&&typeof _0x2a1021['limit']===_0x870b('0x21');var _0x30734b=_0x4df387[_0x870b('0x22')];var _0x1051fd=_0x14e820?0x0:_0x2a1021[_0x870b('0x20')];var _0x4a3c9f=_0x14e820?_0x4df387[_0x870b('0x22')]:_0x2a1021[_0x870b('0x20')]+_0x2a1021[_0x870b('0x23')];var _0x3a01d3;if(_0x4a3c9f>=_0x30734b){_0x4a3c9f=_0x30734b;_0x3a01d3=0xc8;}else{_0x3a01d3=0xce;}_0x5289ed[_0x870b('0x1d')](_0x3a01d3);return _0x5289ed[_0x870b('0x24')](_0x870b('0x25'),_0x1051fd+'-'+_0x4a3c9f+'/'+_0x30734b)[_0x870b('0x1f')](_0x4df387);}return null;};}function patchUpdates(_0x534641){return function(_0x5d449f){try{jsonpatch[_0x870b('0x26')](_0x5d449f,_0x534641,!![]);}catch(_0x4682e0){return BPromise['reject'](_0x4682e0);}return _0x5d449f[_0x870b('0x27')]();};}function saveUpdates(_0x21f4e5,_0x1a1c2b){return function(_0x3904d7){if(_0x3904d7){return _0x3904d7['update'](_0x21f4e5)[_0x870b('0x28')](function(_0x318435){return _0x318435;});}return null;};}function removeEntity(_0x479d86,_0x4a058a){return function(_0x55b567){if(_0x55b567){return _0x55b567[_0x870b('0x29')]()['then'](function(){_0x479d86[_0x870b('0x1d')](0xcc)[_0x870b('0x1e')]();});}};}function handleEntityNotFound(_0x169d61,_0x481c51){return function(_0x28a8fa){if(!_0x28a8fa){_0x169d61['sendStatus'](0x194);}return _0x28a8fa;};}function handleError(_0x54926d,_0x4a484b){_0x4a484b=_0x4a484b||0x1f4;return function(_0x392186){logger[_0x870b('0x2a')](_0x392186[_0x870b('0x2b')]);if(_0x392186[_0x870b('0x2c')]){delete _0x392186[_0x870b('0x2c')];}_0x54926d[_0x870b('0x1d')](_0x4a484b)[_0x870b('0x2d')](_0x392186);};}exports[_0x870b('0x2e')]=function(_0x58e04b,_0x223f8b){var _0x2914e3={},_0x10e601={},_0x3b7b79={'count':0x0,'rows':[]};var _0xc263b3=_[_0x870b('0x2f')](db[_0x870b('0x30')][_0x870b('0x31')],function(_0x113713){return{'name':_0x113713[_0x870b('0x32')],'type':_0x113713[_0x870b('0x33')][_0x870b('0x34')]};});_0x10e601[_0x870b('0x35')]=_[_0x870b('0x2f')](_0xc263b3,'name');_0x10e601[_0x870b('0x36')]=_[_0x870b('0x37')](_0x58e04b[_0x870b('0x36')]);_0x10e601['filters']=_[_0x870b('0x38')](_0x10e601[_0x870b('0x35')],_0x10e601[_0x870b('0x36')]);_0x2914e3[_0x870b('0x39')]=_[_0x870b('0x38')](_0x10e601[_0x870b('0x35')],qs[_0x870b('0x3a')](_0x58e04b[_0x870b('0x36')]['fields']));_0x2914e3['attributes']=_0x2914e3[_0x870b('0x39')]['length']?_0x2914e3[_0x870b('0x39')]:_0x10e601[_0x870b('0x35')];if(!_0x58e04b['query']['hasOwnProperty']('nolimit')){_0x2914e3[_0x870b('0x23')]=qs[_0x870b('0x23')](_0x58e04b[_0x870b('0x36')][_0x870b('0x23')]);_0x2914e3[_0x870b('0x20')]=qs[_0x870b('0x20')](_0x58e04b[_0x870b('0x36')][_0x870b('0x20')]);}_0x2914e3['order']=qs[_0x870b('0x3b')](_0x58e04b['query'][_0x870b('0x3b')]);_0x2914e3['where']=qs['filters'](_['pick'](_0x58e04b[_0x870b('0x36')],_0x10e601['filters']),_0xc263b3);if(_0x58e04b[_0x870b('0x36')][_0x870b('0x3c')]){_0x2914e3[_0x870b('0x3d')]=_[_0x870b('0x3e')](_0x2914e3['where'],{'$or':_[_0x870b('0x2f')](_0xc263b3,function(_0x51e99e){if(_0x51e99e['type']!=='VIRTUAL'){var _0x2f1dea={};_0x2f1dea[_0x51e99e[_0x870b('0x2c')]]={'$like':'%'+_0x58e04b[_0x870b('0x36')][_0x870b('0x3c')]+'%'};return _0x2f1dea;}})});}_0x2914e3=_[_0x870b('0x3e')]({},_0x2914e3,_0x58e04b[_0x870b('0x3f')]);var _0xd0e4f9={'where':_0x2914e3[_0x870b('0x3d')]};return db[_0x870b('0x30')]['count'](_0xd0e4f9)['then'](function(_0x309994){_0x3b7b79[_0x870b('0x22')]=_0x309994;if(_0x58e04b[_0x870b('0x36')][_0x870b('0x40')]){_0x2914e3[_0x870b('0x41')]=[{'all':!![]}];}return db[_0x870b('0x30')][_0x870b('0x42')](_0x2914e3);})[_0x870b('0x28')](function(_0x480a1e){_0x3b7b79[_0x870b('0x43')]=_0x480a1e;return _0x3b7b79;})[_0x870b('0x28')](respondWithFilteredResult(_0x223f8b,_0x2914e3))[_0x870b('0x44')](handleError(_0x223f8b,null));};exports[_0x870b('0x45')]=function(_0x105665,_0x23b8c9){var _0x4afa5e={'raw':!![],'where':{'id':_0x105665[_0x870b('0x46')]['id']}},_0x561b78={};_0x561b78[_0x870b('0x35')]=_[_0x870b('0x37')](db['ZohoField'][_0x870b('0x31')]);_0x561b78[_0x870b('0x36')]=_[_0x870b('0x37')](_0x105665[_0x870b('0x36')]);_0x561b78[_0x870b('0x47')]=_[_0x870b('0x38')](_0x561b78[_0x870b('0x35')],_0x561b78[_0x870b('0x36')]);_0x4afa5e['attributes']=_[_0x870b('0x38')](_0x561b78['model'],qs[_0x870b('0x3a')](_0x105665[_0x870b('0x36')][_0x870b('0x3a')]));_0x4afa5e[_0x870b('0x39')]=_0x4afa5e['attributes']['length']?_0x4afa5e[_0x870b('0x39')]:_0x561b78[_0x870b('0x35')];if(_0x105665[_0x870b('0x36')][_0x870b('0x40')]){_0x4afa5e[_0x870b('0x41')]=[{'all':!![]}];}_0x4afa5e=_[_0x870b('0x3e')]({},_0x4afa5e,_0x105665['options']);return db[_0x870b('0x30')]['find'](_0x4afa5e)['then'](handleEntityNotFound(_0x23b8c9,null))['then'](respondWithResult(_0x23b8c9,null))[_0x870b('0x44')](handleError(_0x23b8c9,null));};exports[_0x870b('0x48')]=function(_0x4ff9b0,_0x48d861){return db[_0x870b('0x30')][_0x870b('0x48')](_0x4ff9b0[_0x870b('0x49')],{})[_0x870b('0x28')](respondWithResult(_0x48d861,0xc9))[_0x870b('0x44')](handleError(_0x48d861,null));};exports['update']=function(_0x3e9fe3,_0x4a182d){if(_0x3e9fe3[_0x870b('0x49')]['id']){delete _0x3e9fe3[_0x870b('0x49')]['id'];}return db[_0x870b('0x30')][_0x870b('0x4a')]({'where':{'id':_0x3e9fe3['params']['id']}})['then'](handleEntityNotFound(_0x4a182d,null))['then'](saveUpdates(_0x3e9fe3[_0x870b('0x49')],null))['then'](respondWithResult(_0x4a182d,null))[_0x870b('0x44')](handleError(_0x4a182d,null));};exports[_0x870b('0x29')]=function(_0x1a2011,_0x160454){return db[_0x870b('0x30')][_0x870b('0x4a')]({'where':{'id':_0x1a2011[_0x870b('0x46')]['id']}})[_0x870b('0x28')](handleEntityNotFound(_0x160454,null))['then'](removeEntity(_0x160454,null))['catch'](handleError(_0x160454,null));}; \ No newline at end of file +var _0x062f=['end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','stack','name','index','map','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','fields','model','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','ZohoField','includeAll','include','rows','show','length','catch','create','body','find','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','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'];(function(_0xdcf76b,_0x51f542){var _0x5bd42f=function(_0x4d615b){while(--_0x4d615b){_0xdcf76b['push'](_0xdcf76b['shift']());}};_0x5bd42f(++_0x51f542);}(_0x062f,0xc7));var _0xf062=function(_0x3b6cc7,_0x5df0c1){_0x3b6cc7=_0x3b6cc7-0x0;var _0x37f564=_0x062f[_0x3b6cc7];return _0x37f564;};'use strict';var emlformat=require(_0xf062('0x0'));var rimraf=require(_0xf062('0x1'));var zipdir=require(_0xf062('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf062('0x3'));var moment=require(_0xf062('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf062('0x5'));var util=require(_0xf062('0x6'));var path=require(_0xf062('0x7'));var sox=require(_0xf062('0x8'));var csv=require(_0xf062('0x9'));var ejs=require(_0xf062('0xa'));var fs=require('fs');var fs_extra=require(_0xf062('0xb'));var _=require(_0xf062('0xc'));var squel=require('squel');var crypto=require(_0xf062('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf062('0xe'));var toCsv=require(_0xf062('0x9'));var querystring=require(_0xf062('0xf'));var Papa=require(_0xf062('0x10'));var Redis=require(_0xf062('0x11'));var authService=require(_0xf062('0x12'));var qs=require(_0xf062('0x13'));var as=require(_0xf062('0x14'));var hardwareService=require(_0xf062('0x15'));var logger=require('../../config/logger')(_0xf062('0x16'));var utils=require(_0xf062('0x17'));var config=require(_0xf062('0x18'));var licenseUtil=require(_0xf062('0x19'));var db=require(_0xf062('0x1a'))['db'];function respondWithStatusCode(_0x53f702,_0x5b65d7){_0x5b65d7=_0x5b65d7||0xcc;return function(_0x4f7e75){if(_0x4f7e75){return _0x53f702[_0xf062('0x1b')](_0x5b65d7);}return _0x53f702[_0xf062('0x1c')](_0x5b65d7)[_0xf062('0x1d')]();};}function respondWithResult(_0x4a69e2,_0x1d1386){_0x1d1386=_0x1d1386||0xc8;return function(_0x1379ab){if(_0x1379ab){return _0x4a69e2[_0xf062('0x1c')](_0x1d1386)[_0xf062('0x1e')](_0x1379ab);}};}function respondWithFilteredResult(_0x125f07,_0x1f45c8){return function(_0x2fa18b){if(_0x2fa18b){var _0xd3d37f=typeof _0x1f45c8[_0xf062('0x1f')]==='undefined'&&typeof _0x1f45c8[_0xf062('0x20')]===_0xf062('0x21');var _0x4cf6f7=_0x2fa18b[_0xf062('0x22')];var _0x1e285c=_0xd3d37f?0x0:_0x1f45c8[_0xf062('0x1f')];var _0x151eea=_0xd3d37f?_0x2fa18b[_0xf062('0x22')]:_0x1f45c8[_0xf062('0x1f')]+_0x1f45c8[_0xf062('0x20')];var _0x588e8d;if(_0x151eea>=_0x4cf6f7){_0x151eea=_0x4cf6f7;_0x588e8d=0xc8;}else{_0x588e8d=0xce;}_0x125f07[_0xf062('0x1c')](_0x588e8d);return _0x125f07[_0xf062('0x23')](_0xf062('0x24'),_0x1e285c+'-'+_0x151eea+'/'+_0x4cf6f7)['json'](_0x2fa18b);}return null;};}function patchUpdates(_0x1914b8){return function(_0x49b97b){try{jsonpatch[_0xf062('0x25')](_0x49b97b,_0x1914b8,!![]);}catch(_0x147b57){return BPromise[_0xf062('0x26')](_0x147b57);}return _0x49b97b[_0xf062('0x27')]();};}function saveUpdates(_0x574b3b,_0x1f37a3){return function(_0xbc5b7){if(_0xbc5b7){return _0xbc5b7[_0xf062('0x28')](_0x574b3b)[_0xf062('0x29')](function(_0x53b98e){return _0x53b98e;});}return null;};}function removeEntity(_0x51eb88,_0x5dd182){return function(_0x2eb076){if(_0x2eb076){return _0x2eb076['destroy']()[_0xf062('0x29')](function(){_0x51eb88['status'](0xcc)[_0xf062('0x1d')]();});}};}function handleEntityNotFound(_0x199173,_0x233369){return function(_0x41896b){if(!_0x41896b){_0x199173[_0xf062('0x1b')](0x194);}return _0x41896b;};}function handleError(_0x33761b,_0x16cc2f){_0x16cc2f=_0x16cc2f||0x1f4;return function(_0x57916f){logger['error'](_0x57916f[_0xf062('0x2a')]);if(_0x57916f[_0xf062('0x2b')]){delete _0x57916f[_0xf062('0x2b')];}_0x33761b[_0xf062('0x1c')](_0x16cc2f)['send'](_0x57916f);};}exports[_0xf062('0x2c')]=function(_0x5e796c,_0x2def01){var _0x42d30e={},_0x136e5b={},_0x16bf0={'count':0x0,'rows':[]};var _0x424572=_[_0xf062('0x2d')](db['ZohoField'][_0xf062('0x2e')],function(_0x34e32d){return{'name':_0x34e32d[_0xf062('0x2f')],'type':_0x34e32d[_0xf062('0x30')]['key']};});_0x136e5b['model']=_[_0xf062('0x2d')](_0x424572,_0xf062('0x2b'));_0x136e5b[_0xf062('0x31')]=_[_0xf062('0x32')](_0x5e796c['query']);_0x136e5b[_0xf062('0x33')]=_['intersection'](_0x136e5b['model'],_0x136e5b[_0xf062('0x31')]);_0x42d30e[_0xf062('0x34')]=_[_0xf062('0x35')](_0x136e5b['model'],qs[_0xf062('0x36')](_0x5e796c[_0xf062('0x31')][_0xf062('0x36')]));_0x42d30e[_0xf062('0x34')]=_0x42d30e[_0xf062('0x34')]['length']?_0x42d30e['attributes']:_0x136e5b[_0xf062('0x37')];if(!_0x5e796c[_0xf062('0x31')][_0xf062('0x38')]('nolimit')){_0x42d30e[_0xf062('0x20')]=qs['limit'](_0x5e796c[_0xf062('0x31')]['limit']);_0x42d30e[_0xf062('0x1f')]=qs[_0xf062('0x1f')](_0x5e796c['query'][_0xf062('0x1f')]);}_0x42d30e[_0xf062('0x39')]=qs[_0xf062('0x3a')](_0x5e796c[_0xf062('0x31')][_0xf062('0x3a')]);_0x42d30e[_0xf062('0x3b')]=qs[_0xf062('0x33')](_['pick'](_0x5e796c[_0xf062('0x31')],_0x136e5b[_0xf062('0x33')]),_0x424572);if(_0x5e796c['query']['filter']){_0x42d30e[_0xf062('0x3b')]=_[_0xf062('0x3c')](_0x42d30e[_0xf062('0x3b')],{'$or':_[_0xf062('0x2d')](_0x424572,function(_0x5644c7){if(_0x5644c7[_0xf062('0x30')]!==_0xf062('0x3d')){var _0x288e1f={};_0x288e1f[_0x5644c7['name']]={'$like':'%'+_0x5e796c[_0xf062('0x31')][_0xf062('0x3e')]+'%'};return _0x288e1f;}})});}_0x42d30e=_[_0xf062('0x3c')]({},_0x42d30e,_0x5e796c[_0xf062('0x3f')]);var _0x25780e={'where':_0x42d30e['where']};return db[_0xf062('0x40')][_0xf062('0x22')](_0x25780e)[_0xf062('0x29')](function(_0x430a4d){_0x16bf0[_0xf062('0x22')]=_0x430a4d;if(_0x5e796c[_0xf062('0x31')][_0xf062('0x41')]){_0x42d30e[_0xf062('0x42')]=[{'all':!![]}];}return db[_0xf062('0x40')]['findAll'](_0x42d30e);})['then'](function(_0x580e79){_0x16bf0[_0xf062('0x43')]=_0x580e79;return _0x16bf0;})['then'](respondWithFilteredResult(_0x2def01,_0x42d30e))['catch'](handleError(_0x2def01,null));};exports[_0xf062('0x44')]=function(_0x122c52,_0x9ca013){var _0x11a67a={'raw':!![],'where':{'id':_0x122c52['params']['id']}},_0x5e7de8={};_0x5e7de8[_0xf062('0x37')]=_[_0xf062('0x32')](db[_0xf062('0x40')][_0xf062('0x2e')]);_0x5e7de8['query']=_[_0xf062('0x32')](_0x122c52[_0xf062('0x31')]);_0x5e7de8[_0xf062('0x33')]=_['intersection'](_0x5e7de8[_0xf062('0x37')],_0x5e7de8[_0xf062('0x31')]);_0x11a67a[_0xf062('0x34')]=_[_0xf062('0x35')](_0x5e7de8[_0xf062('0x37')],qs['fields'](_0x122c52[_0xf062('0x31')]['fields']));_0x11a67a[_0xf062('0x34')]=_0x11a67a[_0xf062('0x34')][_0xf062('0x45')]?_0x11a67a[_0xf062('0x34')]:_0x5e7de8[_0xf062('0x37')];if(_0x122c52[_0xf062('0x31')][_0xf062('0x41')]){_0x11a67a[_0xf062('0x42')]=[{'all':!![]}];}_0x11a67a=_[_0xf062('0x3c')]({},_0x11a67a,_0x122c52[_0xf062('0x3f')]);return db[_0xf062('0x40')]['find'](_0x11a67a)[_0xf062('0x29')](handleEntityNotFound(_0x9ca013,null))[_0xf062('0x29')](respondWithResult(_0x9ca013,null))[_0xf062('0x46')](handleError(_0x9ca013,null));};exports[_0xf062('0x47')]=function(_0x5e92d8,_0x3a4dfa){return db[_0xf062('0x40')][_0xf062('0x47')](_0x5e92d8[_0xf062('0x48')],{})[_0xf062('0x29')](respondWithResult(_0x3a4dfa,0xc9))['catch'](handleError(_0x3a4dfa,null));};exports[_0xf062('0x28')]=function(_0x4bd864,_0x4384ad){if(_0x4bd864['body']['id']){delete _0x4bd864['body']['id'];}return db[_0xf062('0x40')][_0xf062('0x49')]({'where':{'id':_0x4bd864[_0xf062('0x4a')]['id']}})[_0xf062('0x29')](handleEntityNotFound(_0x4384ad,null))[_0xf062('0x29')](saveUpdates(_0x4bd864[_0xf062('0x48')],null))[_0xf062('0x29')](respondWithResult(_0x4384ad,null))[_0xf062('0x46')](handleError(_0x4384ad,null));};exports[_0xf062('0x4b')]=function(_0x5734c8,_0x52ace5){return db[_0xf062('0x40')]['find']({'where':{'id':_0x5734c8[_0xf062('0x4a')]['id']}})[_0xf062('0x29')](handleEntityNotFound(_0x52ace5,null))[_0xf062('0x29')](removeEntity(_0x52ace5,null))[_0xf062('0x46')](handleError(_0x52ace5,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 870465a..c438362 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 _0x2542=['../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x25d4ee,_0xc95872){var _0x214a35=function(_0x4285a0){while(--_0x4285a0){_0x25d4ee['push'](_0x25d4ee['shift']());}};_0x214a35(++_0xc95872);}(_0x2542,0x169));var _0x2254=function(_0x56e15c,_0x114451){_0x56e15c=_0x56e15c-0x0;var _0x394e32=_0x2542[_0x56e15c];return _0x394e32;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var logger=require(_0x2254('0x2'))(_0x2254('0x3'));var moment=require('moment');var BPromise=require(_0x2254('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2254('0x5'));var rimraf=require(_0x2254('0x6'));var config=require(_0x2254('0x7'));var attributes=require(_0x2254('0x8'));module[_0x2254('0x9')]=function(_0x508183,_0x19ad3c){return _0x508183[_0x2254('0xa')](_0x2254('0xb'),attributes,{'tableName':_0x2254('0xc'),'paranoid':![],'indexes':[{'name':_0x2254('0xd'),'fields':[_0x2254('0xe'),_0x2254('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3a6d=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x149d60,_0x48c0c7){var _0x4d086a=function(_0x2af776){while(--_0x2af776){_0x149d60['push'](_0x149d60['shift']());}};_0x4d086a(++_0x48c0c7);}(_0x3a6d,0x143));var _0xd3a6=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3a6d[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x1fc450,_0x25b042){return _0x1fc450[_0xd3a6('0xa')]('ZohoField',attributes,{'tableName':_0xd3a6('0xb'),'paranoid':![],'indexes':[{'name':_0xd3a6('0xc'),'fields':[_0xd3a6('0xd'),_0xd3a6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 7142898..fadf641 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 _0x5cc4=['info','ZohoField,\x20%s,\x20%s','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x39f097,_0x17116b){var _0x544f6a=function(_0x457caf){while(--_0x457caf){_0x39f097['push'](_0x39f097['shift']());}};_0x544f6a(++_0x17116b);}(_0x5cc4,0x8c));var _0x45cc=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5cc4[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x45cc('0x0'));var util=require(_0x45cc('0x1'));var moment=require(_0x45cc('0x2'));var BPromise=require(_0x45cc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x45cc('0x4'));var logger=require('../../config/logger')(_0x45cc('0x5'));var config=require(_0x45cc('0x6'));var jayson=require(_0x45cc('0x7'));var client=jayson[_0x45cc('0x8')][_0x45cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x169450,_0x50515c,_0x1fb564){return new BPromise(function(_0x2cde3c,_0x113caa){return client[_0x45cc('0xa')](_0x169450,_0x1fb564)[_0x45cc('0xb')](function(_0x889205){logger[_0x45cc('0xc')](_0x45cc('0xd'),_0x50515c,'request\x20sent');logger['debug'](_0x45cc('0xe'),_0x50515c,_0x45cc('0xf'),JSON['stringify'](_0x889205));if(_0x889205[_0x45cc('0x10')]){if(_0x889205['error'][_0x45cc('0x11')]===0x1f4){logger[_0x45cc('0x10')](_0x45cc('0xd'),_0x50515c,_0x889205[_0x45cc('0x10')][_0x45cc('0x12')]);return _0x113caa(_0x889205['error'][_0x45cc('0x12')]);}logger['error'](_0x45cc('0xd'),_0x50515c,_0x889205[_0x45cc('0x10')]['message']);return _0x2cde3c(_0x889205['error'][_0x45cc('0x12')]);}else{logger[_0x45cc('0xc')](_0x45cc('0xd'),_0x50515c,'request\x20sent');_0x2cde3c(_0x889205['result'][_0x45cc('0x12')]);}})['catch'](function(_0x291c36){logger[_0x45cc('0x10')](_0x45cc('0xd'),_0x50515c,_0x291c36);_0x113caa(_0x291c36);});});} \ No newline at end of file +var _0x9f7b=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x32e353,_0x505d1c){var _0x18de11=function(_0x5a39b0){while(--_0x5a39b0){_0x32e353['push'](_0x32e353['shift']());}};_0x18de11(++_0x505d1c);}(_0x9f7b,0x158));var _0xb9f7=function(_0x1f0937,_0x45f287){_0x1f0937=_0x1f0937-0x0;var _0x2e9e5a=_0x9f7b[_0x1f0937];return _0x2e9e5a;};'use strict';var _=require(_0xb9f7('0x0'));var util=require(_0xb9f7('0x1'));var moment=require(_0xb9f7('0x2'));var BPromise=require(_0xb9f7('0x3'));var rs=require(_0xb9f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9f7('0x5'))['db'];var utils=require(_0xb9f7('0x6'));var logger=require(_0xb9f7('0x7'))(_0xb9f7('0x8'));var config=require(_0xb9f7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb9f7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43898b,_0x328029,_0x464811){return new BPromise(function(_0x2a0ce9,_0x30752c){return client[_0xb9f7('0xb')](_0x43898b,_0x464811)[_0xb9f7('0xc')](function(_0x358e49){logger[_0xb9f7('0xd')](_0xb9f7('0xe'),_0x328029,_0xb9f7('0xf'));logger[_0xb9f7('0x10')](_0xb9f7('0x11'),_0x328029,'request\x20sent',JSON[_0xb9f7('0x12')](_0x358e49));if(_0x358e49[_0xb9f7('0x13')]){if(_0x358e49['error'][_0xb9f7('0x14')]===0x1f4){logger[_0xb9f7('0x13')](_0xb9f7('0xe'),_0x328029,_0x358e49[_0xb9f7('0x13')][_0xb9f7('0x15')]);return _0x30752c(_0x358e49[_0xb9f7('0x13')][_0xb9f7('0x15')]);}logger['error'](_0xb9f7('0xe'),_0x328029,_0x358e49[_0xb9f7('0x13')]['message']);return _0x2a0ce9(_0x358e49[_0xb9f7('0x13')][_0xb9f7('0x15')]);}else{logger[_0xb9f7('0xd')](_0xb9f7('0xe'),_0x328029,_0xb9f7('0xf'));_0x2a0ce9(_0x358e49[_0xb9f7('0x16')][_0xb9f7('0x15')]);}})[_0xb9f7('0x17')](function(_0x438692){logger[_0xb9f7('0x13')]('ZohoField,\x20%s,\x20%s',_0x328029,_0x438692);_0x30752c(_0x438692);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index c7c69ad..a8fabe4 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5dde91,_0x3bb66e){var _0x402888=function(_0x3ee674){while(--_0x3ee674){_0x5dde91['push'](_0x5dde91['shift']());}};_0x402888(++_0x3bb66e);}(_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 +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b85e4,_0x290269){var _0xfc5d72=function(_0x3d3ce1){while(--_0x3d3ce1){_0x3b85e4['push'](_0x3b85e4['shift']());}};_0xfc5d72(++_0x290269);}(_0xe706,0xa3));var _0x6e70=function(_0x1eaf9a,_0x4a10c3){_0x1eaf9a=_0x1eaf9a-0x0;var _0x1fbedb=_0xe706[_0x1eaf9a];return _0x1fbedb;};'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 82fbafe..e90e273 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 _0x50c1=['sequelize','STRING','unique_name_and_version','app.js','BOOLEAN','state'];(function(_0x2dfe60,_0x6a8271){var _0x21c607=function(_0x39085b){while(--_0x39085b){_0x2dfe60['push'](_0x2dfe60['shift']());}};_0x21c607(++_0x6a8271);}(_0x50c1,0x1b6));var _0x150c=function(_0xd0b8a0,_0x1b9fc1){_0xd0b8a0=_0xd0b8a0-0x0;var _0x56e44e=_0x50c1[_0xd0b8a0];return _0x56e44e;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize[_0x150c('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x150c('0x1')],'allowNull':![],'unique':_0x150c('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x150c('0x3')},'filename':{'type':Sequelize[_0x150c('0x1')]},'path':{'type':Sequelize[_0x150c('0x1')]},'type':{'type':Sequelize[_0x150c('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x150c('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x150c('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x150c('0x1')],'unique':_0x150c('0x5')},'description':{'type':Sequelize[_0x150c('0x1')]},'title':{'type':Sequelize[_0x150c('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x150c('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xac99=['sequelize','exports','STRING','unique_name_and_version','INTEGER','state'];(function(_0x4c9858,_0x1c1118){var _0x3dbcb3=function(_0x4899e1){while(--_0x4899e1){_0x4c9858['push'](_0x4c9858['shift']());}};_0x3dbcb3(++_0x1c1118);}(_0xac99,0x108));var _0x9ac9=function(_0xe4d35a,_0x4bd94d){_0xe4d35a=_0xe4d35a-0x0;var _0x249363=_0xac99[_0xe4d35a];return _0x249363;};'use strict';var Sequelize=require(_0x9ac9('0x0'));module[_0x9ac9('0x1')]={'name':{'type':Sequelize[_0x9ac9('0x2')],'allowNull':![],'unique':_0x9ac9('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9ac9('0x3')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x9ac9('0x2')]},'type':{'type':Sequelize[_0x9ac9('0x2')]},'size':{'type':Sequelize[_0x9ac9('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x9ac9('0x2')],'unique':_0x9ac9('0x5')},'description':{'type':Sequelize[_0x9ac9('0x2')]},'title':{'type':Sequelize[_0x9ac9('0x2')]},'remoteUri':{'type':Sequelize[_0x9ac9('0x2')]},'link':{'type':Sequelize[_0x9ac9('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 58465a5..8ef08b2 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 _0xc6ac=['type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','show','params','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','error','name','send','Integration','rawAttributes','fieldName'];(function(_0x189a72,_0x4ac342){var _0x2b457a=function(_0x151b57){while(--_0x151b57){_0x189a72['push'](_0x189a72['shift']());}};_0x2b457a(++_0x4ac342);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x4c28cc,_0x26389e){_0x4c28cc=_0x4c28cc-0x0;var _0xc785b9=_0xc6ac[_0x4c28cc];return _0xc785b9;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59ce6d,_0xf0f6d5){_0xf0f6d5=_0xf0f6d5||0xcc;return function(_0x211444){if(_0x211444){return _0x59ce6d[_0xcc6a('0x1b')](_0xf0f6d5);}return _0x59ce6d['status'](_0xf0f6d5)['end']();};}function respondWithResult(_0x369dc1,_0xcb9e2e){_0xcb9e2e=_0xcb9e2e||0xc8;return function(_0x43710d){if(_0x43710d){return _0x369dc1[_0xcc6a('0x1c')](_0xcb9e2e)[_0xcc6a('0x1d')](_0x43710d);}};}function respondWithFilteredResult(_0x337ec5,_0x4133fa){return function(_0x403b18){if(_0x403b18){var _0x56ffb0=typeof _0x4133fa['offset']==='undefined'&&typeof _0x4133fa[_0xcc6a('0x1e')]===_0xcc6a('0x1f');var _0x307f2a=_0x403b18[_0xcc6a('0x20')];var _0x33079c=_0x56ffb0?0x0:_0x4133fa[_0xcc6a('0x21')];var _0x2d9585=_0x56ffb0?_0x403b18[_0xcc6a('0x20')]:_0x4133fa[_0xcc6a('0x21')]+_0x4133fa[_0xcc6a('0x1e')];var _0x1d20a3;if(_0x2d9585>=_0x307f2a){_0x2d9585=_0x307f2a;_0x1d20a3=0xc8;}else{_0x1d20a3=0xce;}_0x337ec5['status'](_0x1d20a3);return _0x337ec5[_0xcc6a('0x22')](_0xcc6a('0x23'),_0x33079c+'-'+_0x2d9585+'/'+_0x307f2a)[_0xcc6a('0x1d')](_0x403b18);}return null;};}function patchUpdates(_0x368a6e){return function(_0x1495d8){try{jsonpatch[_0xcc6a('0x24')](_0x1495d8,_0x368a6e,!![]);}catch(_0x36c80f){return BPromise[_0xcc6a('0x25')](_0x36c80f);}return _0x1495d8[_0xcc6a('0x26')]();};}function saveUpdates(_0x19d32c,_0x329d17){return function(_0x845088){if(_0x845088){return _0x845088['update'](_0x19d32c)[_0xcc6a('0x27')](function(_0x3a081e){return _0x3a081e;});}return null;};}function removeEntity(_0x38f812,_0x581aae){return function(_0x10016a){if(_0x10016a){return _0x10016a[_0xcc6a('0x28')]()[_0xcc6a('0x27')](function(){_0x38f812[_0xcc6a('0x1c')](0xcc)[_0xcc6a('0x29')]();});}};}function handleEntityNotFound(_0x5fc697,_0x50abc1){return function(_0x26def8){if(!_0x26def8){_0x5fc697[_0xcc6a('0x1b')](0x194);}return _0x26def8;};}function handleError(_0x3514f3,_0x5f27e5){_0x5f27e5=_0x5f27e5||0x1f4;return function(_0x3afb3a){logger[_0xcc6a('0x2a')](_0x3afb3a['stack']);if(_0x3afb3a[_0xcc6a('0x2b')]){delete _0x3afb3a[_0xcc6a('0x2b')];}_0x3514f3[_0xcc6a('0x1c')](_0x5f27e5)[_0xcc6a('0x2c')](_0x3afb3a);};}exports['index']=function(_0x194aab,_0x3cf14c){var _0x2c6d88={},_0x4f176b={},_0x2590a2={'count':0x0,'rows':[]};var _0x5308d4=_['map'](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')],function(_0x3aa315){return{'name':_0x3aa315[_0xcc6a('0x2f')],'type':_0x3aa315[_0xcc6a('0x30')][_0xcc6a('0x31')]};});_0x4f176b['model']=_[_0xcc6a('0x32')](_0x5308d4,_0xcc6a('0x2b'));_0x4f176b[_0xcc6a('0x33')]=_[_0xcc6a('0x34')](_0x194aab[_0xcc6a('0x33')]);_0x4f176b[_0xcc6a('0x35')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],_0x4f176b['query']);_0x2c6d88[_0xcc6a('0x38')]=_[_0xcc6a('0x36')](_0x4f176b[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x39')]));_0x2c6d88[_0xcc6a('0x38')]=_0x2c6d88['attributes'][_0xcc6a('0x3a')]?_0x2c6d88['attributes']:_0x4f176b['model'];if(!_0x194aab['query'][_0xcc6a('0x3b')](_0xcc6a('0x3c'))){_0x2c6d88[_0xcc6a('0x1e')]=qs[_0xcc6a('0x1e')](_0x194aab[_0xcc6a('0x33')]['limit']);_0x2c6d88['offset']=qs[_0xcc6a('0x21')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x21')]);}_0x2c6d88['order']=qs[_0xcc6a('0x3d')](_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x3d')]);_0x2c6d88[_0xcc6a('0x3e')]=qs[_0xcc6a('0x35')](_[_0xcc6a('0x3f')](_0x194aab[_0xcc6a('0x33')],_0x4f176b[_0xcc6a('0x35')]),_0x5308d4);if(_0x194aab[_0xcc6a('0x33')][_0xcc6a('0x40')]){_0x2c6d88[_0xcc6a('0x3e')]=_[_0xcc6a('0x41')](_0x2c6d88[_0xcc6a('0x3e')],{'$or':_[_0xcc6a('0x32')](_0x5308d4,function(_0x262a1e){if(_0x262a1e[_0xcc6a('0x30')]!==_0xcc6a('0x42')){var _0x386cbc={};_0x386cbc[_0x262a1e['name']]={'$like':'%'+_0x194aab['query'][_0xcc6a('0x40')]+'%'};return _0x386cbc;}})});}_0x2c6d88=_[_0xcc6a('0x41')]({},_0x2c6d88,_0x194aab[_0xcc6a('0x43')]);var _0x1fd8e1={'where':_0x2c6d88[_0xcc6a('0x3e')]};return db[_0xcc6a('0x2d')][_0xcc6a('0x20')](_0x1fd8e1)[_0xcc6a('0x27')](function(_0x49b65c){_0x2590a2['count']=_0x49b65c;if(_0x194aab[_0xcc6a('0x33')]['includeAll']){_0x2c6d88['include']=[{'all':!![]}];}return db['Integration'][_0xcc6a('0x44')](_0x2c6d88);})[_0xcc6a('0x27')](function(_0xb42897){_0x2590a2[_0xcc6a('0x45')]=_0xb42897;return _0x2590a2;})[_0xcc6a('0x27')](respondWithFilteredResult(_0x3cf14c,_0x2c6d88))['catch'](handleError(_0x3cf14c,null));};exports[_0xcc6a('0x46')]=function(_0xfbb079,_0x17e5a0){var _0x2f966f={'raw':![],'where':{'id':_0xfbb079[_0xcc6a('0x47')]['id']}},_0x14ca90={};_0x14ca90['model']=_[_0xcc6a('0x34')](db[_0xcc6a('0x2d')][_0xcc6a('0x2e')]);_0x14ca90[_0xcc6a('0x33')]=_['keys'](_0xfbb079[_0xcc6a('0x33')]);_0x14ca90['filters']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],_0x14ca90[_0xcc6a('0x33')]);_0x2f966f['attributes']=_[_0xcc6a('0x36')](_0x14ca90[_0xcc6a('0x37')],qs[_0xcc6a('0x39')](_0xfbb079['query']['fields']));_0x2f966f[_0xcc6a('0x38')]=_0x2f966f[_0xcc6a('0x38')][_0xcc6a('0x3a')]?_0x2f966f[_0xcc6a('0x38')]:_0x14ca90[_0xcc6a('0x37')];if(_0xfbb079['query'][_0xcc6a('0x48')]){_0x2f966f[_0xcc6a('0x49')]=[{'all':!![]}];}_0x2f966f=_['merge']({},_0x2f966f,_0xfbb079[_0xcc6a('0x43')]);return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')](_0x2f966f)[_0xcc6a('0x27')](handleEntityNotFound(_0x17e5a0,null))[_0xcc6a('0x27')](respondWithResult(_0x17e5a0,null))[_0xcc6a('0x4b')](handleError(_0x17e5a0,null));};exports['create']=function(_0x4e1a0b,_0x47c999){return db[_0xcc6a('0x2d')][_0xcc6a('0x4c')](_0x4e1a0b[_0xcc6a('0x4d')],{})[_0xcc6a('0x27')](respondWithResult(_0x47c999,0xc9))['catch'](handleError(_0x47c999,null));};exports[_0xcc6a('0x4e')]=function(_0x5e7bab,_0x3aa7dd){if(_0x5e7bab[_0xcc6a('0x4d')]['id']){delete _0x5e7bab[_0xcc6a('0x4d')]['id'];}return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x5e7bab[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3aa7dd,null))[_0xcc6a('0x27')](saveUpdates(_0x5e7bab[_0xcc6a('0x4d')],null))[_0xcc6a('0x27')](respondWithResult(_0x3aa7dd,null))[_0xcc6a('0x4b')](handleError(_0x3aa7dd,null));};exports[_0xcc6a('0x28')]=function(_0x362bf6,_0x431684){return db[_0xcc6a('0x2d')][_0xcc6a('0x4a')]({'where':{'id':_0x362bf6[_0xcc6a('0x47')]['id']}})['then'](handleEntityNotFound(_0x431684,null))[_0xcc6a('0x27')](removeEntity(_0x431684,null))[_0xcc6a('0x4b')](handleError(_0x431684,null));}; \ No newline at end of file +var _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x12bcae,_0x47dc50){var _0x2405c4=function(_0x5d4cf5){while(--_0x5d4cf5){_0x12bcae['push'](_0x12bcae['shift']());}};_0x2405c4(++_0x47dc50);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x53b38f,_0x3d9918){_0x53b38f=_0x53b38f-0x0;var _0x51069f=_0xc1c6[_0x53b38f];return _0x51069f;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 20babed..1ed700c 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 _0x8394=['exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes'];(function(_0x98ab4c,_0x30b70c){var _0x5a1b72=function(_0x3c5843){while(--_0x3c5843){_0x98ab4c['push'](_0x98ab4c['shift']());}};_0x5a1b72(++_0x30b70c);}(_0x8394,0x1ee));var _0x4839=function(_0x18c313,_0x2a277a){_0x18c313=_0x18c313-0x0;var _0x1b6482=_0x8394[_0x18c313];return _0x1b6482;};'use strict';var _=require(_0x4839('0x0'));var util=require(_0x4839('0x1'));var logger=require(_0x4839('0x2'))(_0x4839('0x3'));var moment=require(_0x4839('0x4'));var BPromise=require(_0x4839('0x5'));var rp=require(_0x4839('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4839('0x7'));var config=require(_0x4839('0x8'));var attributes=require(_0x4839('0x9'));module[_0x4839('0xa')]=function(_0x5d2dc6,_0x52dca6){return _0x5d2dc6[_0x4839('0xb')](_0x4839('0xc'),attributes,{'tableName':_0x4839('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc33f=['./integration.attributes','exports','define','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x1e921e,_0x4ae8dc){var _0x526f3c=function(_0x1ca975){while(--_0x1ca975){_0x1e921e['push'](_0x1e921e['shift']());}};_0x526f3c(++_0x4ae8dc);}(_0xc33f,0x11a));var _0xfc33=function(_0x154d1e,_0x1f705a){_0x154d1e=_0x154d1e-0x0;var _0x17568e=_0xc33f[_0x154d1e];return _0x17568e;};'use strict';var _=require(_0xfc33('0x0'));var util=require(_0xfc33('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xfc33('0x2'));var rp=require(_0xfc33('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc33('0x4'));var config=require(_0xfc33('0x5'));var attributes=require(_0xfc33('0x6'));module[_0xfc33('0x7')]=function(_0x119152,_0x1e286e){return _0x119152[_0xfc33('0x8')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 6577a48..16757f1 100644 --- a/server/api/integration/integration.rpc.js +++ b/server/api/integration/integration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xc2c7,0x134));var _0x7c2c=function(_0x24fedf,_0x5bea07){_0x24fedf=_0x24fedf-0x0;var _0x4536f0=_0xc2c7[_0x24fedf];return _0x4536f0;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x169125,_0x1d493d){var _0x16b8ae=function(_0x2a5457){while(--_0x2a5457){_0x169125['push'](_0x169125['shift']());}};_0x16b8ae(++_0x1d493d);}(_0xdb28,0x106));var _0x8db2=function(_0x2571e3,_0x358e7d){_0x2571e3=_0x2571e3-0x0;var _0x2e5043=_0xdb28[_0x2571e3];return _0x2e5043;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index cf2cfb2..14b0c2a 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 _0x4137=['show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x4137,0xf8));var _0x7413=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4137[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var timeout=require(_0x7413('0x3'));var express=require(_0x7413('0x4'));var router=express[_0x7413('0x5')]();var fs_extra=require(_0x7413('0x6'));var auth=require(_0x7413('0x7'));var interaction=require(_0x7413('0x8'));var config=require(_0x7413('0x9'));var controller=require(_0x7413('0xa'));router[_0x7413('0xb')]('/',auth['isAuthenticated'](),controller[_0x7413('0xc')]);router[_0x7413('0xb')](_0x7413('0xd'),auth[_0x7413('0xe')](),controller['describe']);router[_0x7413('0xb')](_0x7413('0xf'),auth['isAuthenticated'](),controller[_0x7413('0x10')]);router[_0x7413('0x11')]('/',auth['isAuthenticated'](),controller[_0x7413('0x12')]);router[_0x7413('0x13')](_0x7413('0xf'),auth[_0x7413('0xe')](),controller[_0x7413('0x14')]);router['delete'](_0x7413('0xf'),auth[_0x7413('0xe')](),controller['destroy']);module[_0x7413('0x15')]=router; \ No newline at end of file +var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x58e92d,_0x1181bd){var _0x45d179=function(_0xf162a4){while(--_0xf162a4){_0x58e92d['push'](_0x58e92d['shift']());}};_0x45d179(++_0x1181bd);}(_0x1a85,0x178));var _0x51a8=function(_0x4689d0,_0x5a28c5){_0x4689d0=_0x4689d0-0x0;var _0xb61270=_0x1a85[_0x4689d0];return _0xb61270;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index c1d9af0..967f58d 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 _0x7147=['INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','sequelize','exports','STRING'];(function(_0x3c2a85,_0x1fa509){var _0x438e13=function(_0x32c79c){while(--_0x32c79c){_0x3c2a85['push'](_0x3c2a85['shift']());}};_0x438e13(++_0x1fa509);}(_0x7147,0x179));var _0x7714=function(_0xd3348b,_0x288d47){_0xd3348b=_0xd3348b-0x0;var _0x583cdc=_0x7147[_0xd3348b];return _0x583cdc;};'use strict';var Sequelize=require(_0x7714('0x0'));module[_0x7714('0x1')]={'integration':{'type':Sequelize[_0x7714('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x7714('0x2')]},'ticketId':{'type':Sequelize[_0x7714('0x2')]},'integrationId':{'type':Sequelize[_0x7714('0x3')]},'contacts':{'type':Sequelize[_0x7714('0x2')]},'uniqueid':{'type':Sequelize[_0x7714('0x2')]},'calleridnum':{'type':Sequelize[_0x7714('0x2')]},'calleridname':{'type':Sequelize[_0x7714('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7714('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7714('0x4')]},'agentconnectAt':{'type':Sequelize[_0x7714('0x4')]},'holdtime':{'type':Sequelize[_0x7714('0x3')]},'agentcomplete':{'type':Sequelize[_0x7714('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7714('0x4')]},'talktime':{'type':Sequelize[_0x7714('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7714('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x7714('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7714('0x4')]},'agentdump':{'type':Sequelize[_0x7714('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7714('0x4')]},'lastevent':{'type':Sequelize[_0x7714('0x2')]},'channel':{'type':Sequelize[_0x7714('0x2')]},'channelstate':{'type':Sequelize[_0x7714('0x3')]},'channelstatedesc':{'type':Sequelize[_0x7714('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7714('0x2')]},'connectedlinename':{'type':Sequelize[_0x7714('0x2')]},'language':{'type':Sequelize[_0x7714('0x2')]},'accountcode':{'type':Sequelize[_0x7714('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x7714('0x2')]},'priority':{'type':Sequelize[_0x7714('0x2')]},'destchannel':{'type':Sequelize[_0x7714('0x2')]},'destchannelstate':{'type':Sequelize[_0x7714('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x7714('0x2')]},'destcalleridnum':{'type':Sequelize[_0x7714('0x2')]},'destcalleridname':{'type':Sequelize[_0x7714('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x7714('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7714('0x2')]},'destcontext':{'type':Sequelize[_0x7714('0x2')]},'destexten':{'type':Sequelize[_0x7714('0x2')]},'destpriority':{'type':Sequelize[_0x7714('0x2')]},'destuniqueid':{'type':Sequelize[_0x7714('0x2')]},'messageId':{'type':Sequelize[_0x7714('0x2')]},'inReplyTo':{'type':Sequelize[_0x7714('0x2')]},'subject':{'type':Sequelize[_0x7714('0x2')]},'from':{'type':Sequelize[_0x7714('0x2')]},'to':{'type':Sequelize[_0x7714('0x2')]},'cc':{'type':Sequelize[_0x7714('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x7714('0x6')]},'text':{'type':Sequelize[_0x7714('0x6')]},'status':{'type':Sequelize[_0x7714('0x7')](_0x7714('0x8'),'SENDING',_0x7714('0x9'),'FAILED')},'url':{'type':Sequelize[_0x7714('0x2')]},'app':{'type':Sequelize[_0x7714('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x7714('0x3')]}}; \ No newline at end of file +var _0xc575=['FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x2e8b3f,_0x3eaa5a){var _0x251aab=function(_0x47c84b){while(--_0x47c84b){_0x2e8b3f['push'](_0x2e8b3f['shift']());}};_0x251aab(++_0x3eaa5a);}(_0xc575,0x9d));var _0x5c57=function(_0x240860,_0x20c04d){_0x240860=_0x240860-0x0;var _0x40e288=_0xc575[_0x240860];return _0x40e288;};'use strict';var Sequelize=require(_0x5c57('0x0'));module[_0x5c57('0x1')]={'integration':{'type':Sequelize[_0x5c57('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x5c57('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x5c57('0x3')]},'contacts':{'type':Sequelize[_0x5c57('0x2')]},'uniqueid':{'type':Sequelize[_0x5c57('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5c57('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5c57('0x2')]},'membername':{'type':Sequelize[_0x5c57('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5c57('0x4')]},'agentconnectAt':{'type':Sequelize[_0x5c57('0x4')]},'holdtime':{'type':Sequelize[_0x5c57('0x3')]},'agentcomplete':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5c57('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5c57('0x3')]},'reason':{'type':Sequelize[_0x5c57('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5c57('0x4')]},'agentdump':{'type':Sequelize[_0x5c57('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x5c57('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x5c57('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5c57('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5c57('0x2')]},'connectedlinename':{'type':Sequelize[_0x5c57('0x2')]},'language':{'type':Sequelize[_0x5c57('0x2')]},'accountcode':{'type':Sequelize[_0x5c57('0x2')]},'context':{'type':Sequelize[_0x5c57('0x2')]},'exten':{'type':Sequelize[_0x5c57('0x2')]},'priority':{'type':Sequelize[_0x5c57('0x2')]},'destchannel':{'type':Sequelize[_0x5c57('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5c57('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5c57('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5c57('0x2')]},'destaccountcode':{'type':Sequelize[_0x5c57('0x2')]},'destcontext':{'type':Sequelize[_0x5c57('0x2')]},'destexten':{'type':Sequelize[_0x5c57('0x2')]},'destpriority':{'type':Sequelize[_0x5c57('0x2')]},'destuniqueid':{'type':Sequelize[_0x5c57('0x2')]},'messageId':{'type':Sequelize[_0x5c57('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x5c57('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x5c57('0x2')]},'cc':{'type':Sequelize[_0x5c57('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x5c57('0x6')]},'text':{'type':Sequelize[_0x5c57('0x6')]},'status':{'type':Sequelize[_0x5c57('0x7')](_0x5c57('0x8'),_0x5c57('0x9'),_0x5c57('0xa'),_0x5c57('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5c57('0x2')]},'appdata':{'type':Sequelize[_0x5c57('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 11a0306..ebe5e3c 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 _0x533a=['destroy','sendStatus','error','stack','name','send','map','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','offset','sort','pick','filter','merge','where','includeAll','include','findAll','params','options','catch','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x31544d,_0xc3624f){var _0x514218=function(_0x236b42){while(--_0x236b42){_0x31544d['push'](_0x31544d['shift']());}};_0x514218(++_0xc3624f);}(_0x533a,0xf0));var _0xa533=function(_0x3434d7,_0x4d4eb0){_0x3434d7=_0x3434d7-0x0;var _0x51eebd=_0x533a[_0x3434d7];return _0x51eebd;};'use strict';var emlformat=require(_0xa533('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa533('0x1'));var jsonpatch=require(_0xa533('0x2'));var rp=require(_0xa533('0x3'));var moment=require(_0xa533('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa533('0x5'));var sox=require(_0xa533('0x6'));var csv=require(_0xa533('0x7'));var ejs=require(_0xa533('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa533('0x9'));var squel=require(_0xa533('0xa'));var crypto=require('crypto');var jsforce=require(_0xa533('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa533('0xc'));var Papa=require('papaparse');var Redis=require(_0xa533('0xd'));var authService=require(_0xa533('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa533('0xf'))(_0xa533('0x10'));var utils=require(_0xa533('0x11'));var config=require(_0xa533('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xa533('0x13'))['db'];function respondWithStatusCode(_0x1f19c6,_0x5525a2){_0x5525a2=_0x5525a2||0xcc;return function(_0x85a2d6){if(_0x85a2d6){return _0x1f19c6['sendStatus'](_0x5525a2);}return _0x1f19c6[_0xa533('0x14')](_0x5525a2)[_0xa533('0x15')]();};}function respondWithResult(_0x301faa,_0x3976a8){_0x3976a8=_0x3976a8||0xc8;return function(_0x50fb55){if(_0x50fb55){return _0x301faa[_0xa533('0x14')](_0x3976a8)[_0xa533('0x16')](_0x50fb55);}};}function respondWithFilteredResult(_0x3a600e,_0x51cfdf){return function(_0x832432){if(_0x832432){var _0x5f5525=typeof _0x51cfdf['offset']===_0xa533('0x17')&&typeof _0x51cfdf[_0xa533('0x18')]===_0xa533('0x17');var _0x274a32=_0x832432[_0xa533('0x19')];var _0x1e531d=_0x5f5525?0x0:_0x51cfdf['offset'];var _0x1e738a=_0x5f5525?_0x832432[_0xa533('0x19')]:_0x51cfdf['offset']+_0x51cfdf[_0xa533('0x18')];var _0x569bac;if(_0x1e738a>=_0x274a32){_0x1e738a=_0x274a32;_0x569bac=0xc8;}else{_0x569bac=0xce;}_0x3a600e['status'](_0x569bac);return _0x3a600e[_0xa533('0x1a')](_0xa533('0x1b'),_0x1e531d+'-'+_0x1e738a+'/'+_0x274a32)['json'](_0x832432);}return null;};}function patchUpdates(_0x3d7e70){return function(_0x47238c){try{jsonpatch[_0xa533('0x1c')](_0x47238c,_0x3d7e70,!![]);}catch(_0x38939e){return BPromise['reject'](_0x38939e);}return _0x47238c[_0xa533('0x1d')]();};}function saveUpdates(_0x2a887f,_0x7d03c3){return function(_0x59b4b9){if(_0x59b4b9){return _0x59b4b9[_0xa533('0x1e')](_0x2a887f)[_0xa533('0x1f')](function(_0x5902f4){return _0x5902f4;});}return null;};}function removeEntity(_0x19188a,_0x5938db){return function(_0x4bd8e0){if(_0x4bd8e0){return _0x4bd8e0[_0xa533('0x20')]()['then'](function(){_0x19188a[_0xa533('0x14')](0xcc)[_0xa533('0x15')]();});}};}function handleEntityNotFound(_0x468b0a,_0x163299){return function(_0x5bfd0e){if(!_0x5bfd0e){_0x468b0a[_0xa533('0x21')](0x194);}return _0x5bfd0e;};}function handleError(_0x27852d,_0x316ec0){_0x316ec0=_0x316ec0||0x1f4;return function(_0x55e93f){logger[_0xa533('0x22')](_0x55e93f[_0xa533('0x23')]);if(_0x55e93f[_0xa533('0x24')]){delete _0x55e93f[_0xa533('0x24')];}_0x27852d['status'](_0x316ec0)[_0xa533('0x25')](_0x55e93f);};}exports['index']=function(_0x570ade,_0x2f19a9){var _0x3efe2d={},_0x3cad0b={},_0x52526c={'count':0x0,'rows':[]};var _0x4e143b=_[_0xa533('0x26')](db[_0xa533('0x27')][_0xa533('0x28')],function(_0x41c9d6){return{'name':_0x41c9d6['fieldName'],'type':_0x41c9d6[_0xa533('0x29')][_0xa533('0x2a')]};});_0x3cad0b[_0xa533('0x2b')]=_[_0xa533('0x26')](_0x4e143b,_0xa533('0x24'));_0x3cad0b[_0xa533('0x2c')]=_[_0xa533('0x2d')](_0x570ade[_0xa533('0x2c')]);_0x3cad0b[_0xa533('0x2e')]=_['intersection'](_0x3cad0b['model'],_0x3cad0b[_0xa533('0x2c')]);_0x3efe2d[_0xa533('0x2f')]=_[_0xa533('0x30')](_0x3cad0b[_0xa533('0x2b')],qs['fields'](_0x570ade[_0xa533('0x2c')][_0xa533('0x31')]));_0x3efe2d[_0xa533('0x2f')]=_0x3efe2d['attributes'][_0xa533('0x32')]?_0x3efe2d['attributes']:_0x3cad0b[_0xa533('0x2b')];if(!_0x570ade[_0xa533('0x2c')][_0xa533('0x33')]('nolimit')){_0x3efe2d[_0xa533('0x18')]=qs['limit'](_0x570ade[_0xa533('0x2c')][_0xa533('0x18')]);_0x3efe2d[_0xa533('0x34')]=qs[_0xa533('0x34')](_0x570ade['query'][_0xa533('0x34')]);}_0x3efe2d['order']=qs[_0xa533('0x35')](_0x570ade[_0xa533('0x2c')][_0xa533('0x35')]);_0x3efe2d['where']=qs[_0xa533('0x2e')](_[_0xa533('0x36')](_0x570ade[_0xa533('0x2c')],_0x3cad0b['filters']),_0x4e143b);if(_0x570ade[_0xa533('0x2c')][_0xa533('0x37')]){_0x3efe2d['where']=_[_0xa533('0x38')](_0x3efe2d[_0xa533('0x39')],{'$or':_[_0xa533('0x26')](_0x4e143b,function(_0x5b318e){if(_0x5b318e[_0xa533('0x29')]!=='VIRTUAL'){var _0x24c2b8={};_0x24c2b8[_0x5b318e[_0xa533('0x24')]]={'$like':'%'+_0x570ade['query']['filter']+'%'};return _0x24c2b8;}})});}_0x3efe2d=_[_0xa533('0x38')]({},_0x3efe2d,_0x570ade['options']);var _0x182ec2={'where':_0x3efe2d['where']};return db[_0xa533('0x27')]['count'](_0x182ec2)[_0xa533('0x1f')](function(_0x16bcc8){_0x52526c[_0xa533('0x19')]=_0x16bcc8;if(_0x570ade['query'][_0xa533('0x3a')]){_0x3efe2d[_0xa533('0x3b')]=[{'all':!![]}];}return db[_0xa533('0x27')][_0xa533('0x3c')](_0x3efe2d);})['then'](function(_0x51c153){_0x52526c['rows']=_0x51c153;return _0x52526c;})[_0xa533('0x1f')](respondWithFilteredResult(_0x2f19a9,_0x3efe2d))['catch'](handleError(_0x2f19a9,null));};exports['show']=function(_0x341603,_0x244f57){var _0x1f5da7={'raw':![],'where':{'id':_0x341603[_0xa533('0x3d')]['id']}},_0x4b3026={};_0x4b3026[_0xa533('0x2b')]=_[_0xa533('0x2d')](db['IntegrationReport']['rawAttributes']);_0x4b3026[_0xa533('0x2c')]=_[_0xa533('0x2d')](_0x341603['query']);_0x4b3026['filters']=_[_0xa533('0x30')](_0x4b3026[_0xa533('0x2b')],_0x4b3026[_0xa533('0x2c')]);_0x1f5da7[_0xa533('0x2f')]=_['intersection'](_0x4b3026[_0xa533('0x2b')],qs[_0xa533('0x31')](_0x341603[_0xa533('0x2c')][_0xa533('0x31')]));_0x1f5da7[_0xa533('0x2f')]=_0x1f5da7[_0xa533('0x2f')][_0xa533('0x32')]?_0x1f5da7[_0xa533('0x2f')]:_0x4b3026['model'];if(_0x341603[_0xa533('0x2c')][_0xa533('0x3a')]){_0x1f5da7[_0xa533('0x3b')]=[{'all':!![]}];}_0x1f5da7=_[_0xa533('0x38')]({},_0x1f5da7,_0x341603[_0xa533('0x3e')]);return db['IntegrationReport']['find'](_0x1f5da7)[_0xa533('0x1f')](handleEntityNotFound(_0x244f57,null))['then'](respondWithResult(_0x244f57,null))[_0xa533('0x3f')](handleError(_0x244f57,null));};exports[_0xa533('0x40')]=function(_0x195cc4,_0xe5640d){return db['IntegrationReport'][_0xa533('0x40')](_0x195cc4['body'],{})[_0xa533('0x1f')](respondWithResult(_0xe5640d,0xc9))[_0xa533('0x3f')](handleError(_0xe5640d,null));};exports[_0xa533('0x1e')]=function(_0x59dc52,_0xe1917b){if(_0x59dc52['body']['id']){delete _0x59dc52[_0xa533('0x41')]['id'];}return db[_0xa533('0x27')][_0xa533('0x42')]({'where':{'id':_0x59dc52[_0xa533('0x3d')]['id']}})[_0xa533('0x1f')](handleEntityNotFound(_0xe1917b,null))[_0xa533('0x1f')](saveUpdates(_0x59dc52[_0xa533('0x41')],null))[_0xa533('0x1f')](respondWithResult(_0xe1917b,null))[_0xa533('0x3f')](handleError(_0xe1917b,null));};exports[_0xa533('0x20')]=function(_0x539b68,_0x2664a1){return db['IntegrationReport']['find']({'where':{'id':_0x539b68['params']['id']}})[_0xa533('0x1f')](handleEntityNotFound(_0x2664a1,null))[_0xa533('0x1f')](removeEntity(_0x2664a1,null))[_0xa533('0x3f')](handleError(_0x2664a1,null));};exports[_0xa533('0x43')]=function(_0x58e6b9,_0x38aa28){return db[_0xa533('0x27')][_0xa533('0x43')]()[_0xa533('0x1f')](respondWithResult(_0x38aa28,null))[_0xa533('0x3f')](handleError(_0x38aa28,null));}; \ No newline at end of file +var _0x86c6=['includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','index','IntegrationReport','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x86c6,0xf9));var _0x686c=function(_0x55e1a3,_0x1a203d){_0x55e1a3=_0x55e1a3-0x0;var _0x397fc7=_0x86c6[_0x55e1a3];return _0x397fc7;};'use strict';var emlformat=require(_0x686c('0x0'));var rimraf=require(_0x686c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x686c('0x2'));var rp=require(_0x686c('0x3'));var moment=require(_0x686c('0x4'));var BPromise=require(_0x686c('0x5'));var Mustache=require('mustache');var util=require(_0x686c('0x6'));var path=require(_0x686c('0x7'));var sox=require(_0x686c('0x8'));var csv=require('to-csv');var ejs=require(_0x686c('0x9'));var fs=require('fs');var fs_extra=require(_0x686c('0xa'));var _=require(_0x686c('0xb'));var squel=require(_0x686c('0xc'));var crypto=require(_0x686c('0xd'));var jsforce=require(_0x686c('0xe'));var deskjs=require(_0x686c('0xf'));var toCsv=require(_0x686c('0x10'));var querystring=require(_0x686c('0x11'));var Papa=require(_0x686c('0x12'));var Redis=require(_0x686c('0x13'));var authService=require(_0x686c('0x14'));var qs=require(_0x686c('0x15'));var as=require(_0x686c('0x16'));var hardwareService=require(_0x686c('0x17'));var logger=require(_0x686c('0x18'))(_0x686c('0x19'));var utils=require(_0x686c('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x143b41,_0x4e9a79){_0x4e9a79=_0x4e9a79||0xcc;return function(_0x3ab0b4){if(_0x3ab0b4){return _0x143b41[_0x686c('0x1b')](_0x4e9a79);}return _0x143b41[_0x686c('0x1c')](_0x4e9a79)['end']();};}function respondWithResult(_0x292529,_0x4a3604){_0x4a3604=_0x4a3604||0xc8;return function(_0x4b3807){if(_0x4b3807){return _0x292529[_0x686c('0x1c')](_0x4a3604)['json'](_0x4b3807);}};}function respondWithFilteredResult(_0x5f11c5,_0x52dab0){return function(_0x19fb05){if(_0x19fb05){var _0x4b58f4=typeof _0x52dab0[_0x686c('0x1d')]==='undefined'&&typeof _0x52dab0[_0x686c('0x1e')]===_0x686c('0x1f');var _0x34f73c=_0x19fb05[_0x686c('0x20')];var _0x1227ad=_0x4b58f4?0x0:_0x52dab0[_0x686c('0x1d')];var _0x542298=_0x4b58f4?_0x19fb05[_0x686c('0x20')]:_0x52dab0[_0x686c('0x1d')]+_0x52dab0['limit'];var _0x57c302;if(_0x542298>=_0x34f73c){_0x542298=_0x34f73c;_0x57c302=0xc8;}else{_0x57c302=0xce;}_0x5f11c5['status'](_0x57c302);return _0x5f11c5[_0x686c('0x21')](_0x686c('0x22'),_0x1227ad+'-'+_0x542298+'/'+_0x34f73c)[_0x686c('0x23')](_0x19fb05);}return null;};}function patchUpdates(_0x279977){return function(_0x3597d8){try{jsonpatch[_0x686c('0x24')](_0x3597d8,_0x279977,!![]);}catch(_0x2953a6){return BPromise[_0x686c('0x25')](_0x2953a6);}return _0x3597d8[_0x686c('0x26')]();};}function saveUpdates(_0xb8592f,_0x4e0240){return function(_0x225a02){if(_0x225a02){return _0x225a02[_0x686c('0x27')](_0xb8592f)[_0x686c('0x28')](function(_0x465fb4){return _0x465fb4;});}return null;};}function removeEntity(_0xeb7b7f,_0x2ce628){return function(_0x270304){if(_0x270304){return _0x270304[_0x686c('0x29')]()[_0x686c('0x28')](function(){_0xeb7b7f[_0x686c('0x1c')](0xcc)[_0x686c('0x2a')]();});}};}function handleEntityNotFound(_0x710a18,_0x51742c){return function(_0x30c1d9){if(!_0x30c1d9){_0x710a18[_0x686c('0x1b')](0x194);}return _0x30c1d9;};}function handleError(_0x24e900,_0x6220e4){_0x6220e4=_0x6220e4||0x1f4;return function(_0x4afe2b){logger[_0x686c('0x2b')](_0x4afe2b[_0x686c('0x2c')]);if(_0x4afe2b[_0x686c('0x2d')]){delete _0x4afe2b[_0x686c('0x2d')];}_0x24e900[_0x686c('0x1c')](_0x6220e4)['send'](_0x4afe2b);};}exports[_0x686c('0x2e')]=function(_0x74cc3f,_0x1b2f7f){var _0x5c1440={},_0x3801e3={},_0x2ac74d={'count':0x0,'rows':[]};var _0x381078=_['map'](db[_0x686c('0x2f')]['rawAttributes'],function(_0x40defb){return{'name':_0x40defb[_0x686c('0x30')],'type':_0x40defb[_0x686c('0x31')][_0x686c('0x32')]};});_0x3801e3['model']=_[_0x686c('0x33')](_0x381078,'name');_0x3801e3[_0x686c('0x34')]=_['keys'](_0x74cc3f[_0x686c('0x34')]);_0x3801e3['filters']=_[_0x686c('0x35')](_0x3801e3[_0x686c('0x36')],_0x3801e3[_0x686c('0x34')]);_0x5c1440[_0x686c('0x37')]=_[_0x686c('0x35')](_0x3801e3[_0x686c('0x36')],qs['fields'](_0x74cc3f[_0x686c('0x34')][_0x686c('0x38')]));_0x5c1440[_0x686c('0x37')]=_0x5c1440[_0x686c('0x37')][_0x686c('0x39')]?_0x5c1440[_0x686c('0x37')]:_0x3801e3[_0x686c('0x36')];if(!_0x74cc3f['query'][_0x686c('0x3a')](_0x686c('0x3b'))){_0x5c1440['limit']=qs[_0x686c('0x1e')](_0x74cc3f[_0x686c('0x34')]['limit']);_0x5c1440[_0x686c('0x1d')]=qs[_0x686c('0x1d')](_0x74cc3f['query'][_0x686c('0x1d')]);}_0x5c1440['order']=qs[_0x686c('0x3c')](_0x74cc3f[_0x686c('0x34')]['sort']);_0x5c1440[_0x686c('0x3d')]=qs[_0x686c('0x3e')](_[_0x686c('0x3f')](_0x74cc3f[_0x686c('0x34')],_0x3801e3['filters']),_0x381078);if(_0x74cc3f[_0x686c('0x34')][_0x686c('0x40')]){_0x5c1440['where']=_[_0x686c('0x41')](_0x5c1440[_0x686c('0x3d')],{'$or':_[_0x686c('0x33')](_0x381078,function(_0x4d2ee8){if(_0x4d2ee8[_0x686c('0x31')]!=='VIRTUAL'){var _0x308030={};_0x308030[_0x4d2ee8[_0x686c('0x2d')]]={'$like':'%'+_0x74cc3f[_0x686c('0x34')][_0x686c('0x40')]+'%'};return _0x308030;}})});}_0x5c1440=_[_0x686c('0x41')]({},_0x5c1440,_0x74cc3f[_0x686c('0x42')]);var _0x1d3ea4={'where':_0x5c1440[_0x686c('0x3d')]};return db['IntegrationReport'][_0x686c('0x20')](_0x1d3ea4)[_0x686c('0x28')](function(_0x35388b){_0x2ac74d[_0x686c('0x20')]=_0x35388b;if(_0x74cc3f[_0x686c('0x34')][_0x686c('0x43')]){_0x5c1440[_0x686c('0x44')]=[{'all':!![]}];}return db['IntegrationReport'][_0x686c('0x45')](_0x5c1440);})[_0x686c('0x28')](function(_0x3772ac){_0x2ac74d['rows']=_0x3772ac;return _0x2ac74d;})[_0x686c('0x28')](respondWithFilteredResult(_0x1b2f7f,_0x5c1440))['catch'](handleError(_0x1b2f7f,null));};exports[_0x686c('0x46')]=function(_0x36a481,_0x511cb0){var _0x236b62={'raw':![],'where':{'id':_0x36a481[_0x686c('0x47')]['id']}},_0x3b3427={};_0x3b3427[_0x686c('0x36')]=_[_0x686c('0x48')](db['IntegrationReport'][_0x686c('0x49')]);_0x3b3427['query']=_[_0x686c('0x48')](_0x36a481[_0x686c('0x34')]);_0x3b3427[_0x686c('0x3e')]=_[_0x686c('0x35')](_0x3b3427[_0x686c('0x36')],_0x3b3427['query']);_0x236b62[_0x686c('0x37')]=_['intersection'](_0x3b3427['model'],qs['fields'](_0x36a481[_0x686c('0x34')][_0x686c('0x38')]));_0x236b62[_0x686c('0x37')]=_0x236b62['attributes'][_0x686c('0x39')]?_0x236b62[_0x686c('0x37')]:_0x3b3427[_0x686c('0x36')];if(_0x36a481['query']['includeAll']){_0x236b62[_0x686c('0x44')]=[{'all':!![]}];}_0x236b62=_[_0x686c('0x41')]({},_0x236b62,_0x36a481[_0x686c('0x42')]);return db[_0x686c('0x2f')][_0x686c('0x4a')](_0x236b62)[_0x686c('0x28')](handleEntityNotFound(_0x511cb0,null))['then'](respondWithResult(_0x511cb0,null))[_0x686c('0x4b')](handleError(_0x511cb0,null));};exports[_0x686c('0x4c')]=function(_0x427abe,_0x1fa1c9){return db['IntegrationReport'][_0x686c('0x4c')](_0x427abe[_0x686c('0x4d')],{})[_0x686c('0x28')](respondWithResult(_0x1fa1c9,0xc9))[_0x686c('0x4b')](handleError(_0x1fa1c9,null));};exports[_0x686c('0x27')]=function(_0xee6d52,_0x4879df){if(_0xee6d52[_0x686c('0x4d')]['id']){delete _0xee6d52['body']['id'];}return db[_0x686c('0x2f')][_0x686c('0x4a')]({'where':{'id':_0xee6d52[_0x686c('0x47')]['id']}})['then'](handleEntityNotFound(_0x4879df,null))[_0x686c('0x28')](saveUpdates(_0xee6d52[_0x686c('0x4d')],null))[_0x686c('0x28')](respondWithResult(_0x4879df,null))[_0x686c('0x4b')](handleError(_0x4879df,null));};exports[_0x686c('0x29')]=function(_0x3d6548,_0x2fca03){return db[_0x686c('0x2f')]['find']({'where':{'id':_0x3d6548[_0x686c('0x47')]['id']}})[_0x686c('0x28')](handleEntityNotFound(_0x2fca03,null))['then'](removeEntity(_0x2fca03,null))['catch'](handleError(_0x2fca03,null));};exports[_0x686c('0x4e')]=function(_0x2b6fa6,_0x45b450){return db[_0x686c('0x2f')][_0x686c('0x4e')]()[_0x686c('0x28')](respondWithResult(_0x45b450,null))[_0x686c('0x4b')](handleError(_0x45b450,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 2788dfa..1639ec4 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 _0xec6c=['define','report_integration','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./integrationReport.attributes','exports'];(function(_0xe0ce61,_0x18fab9){var _0x2f187c=function(_0x2f73b3){while(--_0x2f73b3){_0xe0ce61['push'](_0xe0ce61['shift']());}};_0x2f187c(++_0x18fab9);}(_0xec6c,0x9e));var _0xcec6=function(_0x3d6f9a,_0x3414ac){_0x3d6f9a=_0x3d6f9a-0x0;var _0x3a0983=_0xec6c[_0x3d6f9a];return _0x3a0983;};'use strict';var _=require(_0xcec6('0x0'));var util=require(_0xcec6('0x1'));var logger=require(_0xcec6('0x2'))('api');var moment=require(_0xcec6('0x3'));var BPromise=require(_0xcec6('0x4'));var rp=require(_0xcec6('0x5'));var fs=require('fs');var path=require(_0xcec6('0x6'));var rimraf=require('rimraf');var config=require(_0xcec6('0x7'));var attributes=require(_0xcec6('0x8'));module[_0xcec6('0x9')]=function(_0x304259,_0x23aece){return _0x304259[_0xcec6('0xa')]('IntegrationReport',attributes,{'tableName':_0xcec6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad87=['IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xad87,0x1af));var _0x7ad8=function(_0x1e2321,_0x3ae1c5){_0x1e2321=_0x1e2321-0x0;var _0x1d346d=_0xad87[_0x1e2321];return _0x1d346d;};'use strict';var _=require(_0x7ad8('0x0'));var util=require(_0x7ad8('0x1'));var logger=require(_0x7ad8('0x2'))(_0x7ad8('0x3'));var moment=require(_0x7ad8('0x4'));var BPromise=require(_0x7ad8('0x5'));var rp=require(_0x7ad8('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ad8('0x7'));var config=require(_0x7ad8('0x8'));var attributes=require('./integrationReport.attributes');module[_0x7ad8('0x9')]=function(_0x3d87b,_0x2f4c2a){return _0x3d87b[_0x7ad8('0xa')](_0x7ad8('0xb'),attributes,{'tableName':_0x7ad8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 2462851..3512143 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 _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x687b,0x14a));var _0xb687=function(_0x15f852,_0x530d85){_0x15f852=_0x15f852-0x0;var _0x387460=_0x687b[_0x15f852];return _0x387460;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file +var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x1248eb,_0x465f4b){var _0x37b15b=function(_0x213937){while(--_0x213937){_0x1248eb['push'](_0x1248eb['shift']());}};_0x37b15b(++_0x465f4b);}(_0x2675,0x75));var _0x5267=function(_0x16dc2a,_0x109ce4){_0x16dc2a=_0x16dc2a-0x0;var _0x5ab8e6=_0x2675[_0x16dc2a];return _0x5ab8e6;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index bca2e06..9d3e56f 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 _0x07d7=['get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x07d7,0x85));var _0x707d=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x07d7[_0x204eb7];return _0x37e444;};'use strict';var multer=require(_0x707d('0x0'));var util=require(_0x707d('0x1'));var path=require(_0x707d('0x2'));var timeout=require(_0x707d('0x3'));var express=require(_0x707d('0x4'));var router=express[_0x707d('0x5')]();var fs_extra=require(_0x707d('0x6'));var auth=require(_0x707d('0x7'));var interaction=require(_0x707d('0x8'));var config=require(_0x707d('0x9'));var controller=require(_0x707d('0xa'));router[_0x707d('0xb')]('/',auth[_0x707d('0xc')](),controller[_0x707d('0xd')]);router[_0x707d('0xb')](_0x707d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x707d('0xb')](_0x707d('0xf'),auth[_0x707d('0xc')](),controller[_0x707d('0x10')]);router[_0x707d('0x11')]('/',auth['isAuthenticated'](),controller[_0x707d('0x12')]);router[_0x707d('0x11')](_0x707d('0xf'),auth['isAuthenticated'](),controller[_0x707d('0x13')]);router[_0x707d('0x11')](_0x707d('0x14'),auth['isAuthenticated'](),controller['addIntervals']);router['put'](_0x707d('0xe'),auth[_0x707d('0xc')](),controller[_0x707d('0x15')]);router['delete'](_0x707d('0xe'),auth['isAuthenticated'](),controller[_0x707d('0x16')]);module[_0x707d('0x17')]=router; \ No newline at end of file +var _0xd916=['create','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals'];(function(_0x4b0621,_0x1144a1){var _0x560690=function(_0x41dca3){while(--_0x41dca3){_0x4b0621['push'](_0x4b0621['shift']());}};_0x560690(++_0x1144a1);}(_0xd916,0x18a));var _0x6d91=function(_0x603c53,_0xf08acd){_0x603c53=_0x603c53-0x0;var _0x23734a=_0xd916[_0x603c53];return _0x23734a;};'use strict';var multer=require(_0x6d91('0x0'));var util=require(_0x6d91('0x1'));var path=require(_0x6d91('0x2'));var timeout=require(_0x6d91('0x3'));var express=require(_0x6d91('0x4'));var router=express['Router']();var fs_extra=require(_0x6d91('0x5'));var auth=require(_0x6d91('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6d91('0x7'));router[_0x6d91('0x8')]('/',auth['isAuthenticated'](),controller[_0x6d91('0x9')]);router[_0x6d91('0x8')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0xc')]);router[_0x6d91('0x8')](_0x6d91('0xd'),auth['isAuthenticated'](),controller['getIntervals']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d91('0xe')]);router[_0x6d91('0xf')](_0x6d91('0xd'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x10')]);router['post'](_0x6d91('0x11'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x12')]);router[_0x6d91('0x13')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x14')]);router[_0x6d91('0x15')](_0x6d91('0xa'),auth[_0x6d91('0xb')](),controller[_0x6d91('0x16')]);module[_0x6d91('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 489b70c..9b4e741 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 _0x7ec2=['sequelize','exports','STRING'];(function(_0xf0d85a,_0x2b9465){var _0x44a9ee=function(_0x17eeb3){while(--_0x17eeb3){_0xf0d85a['push'](_0xf0d85a['shift']());}};_0x44a9ee(++_0x2b9465);}(_0x7ec2,0x135));var _0x27ec=function(_0x16a947,_0x34fd18){_0x16a947=_0x16a947-0x0;var _0xab967d=_0x7ec2[_0x16a947];return _0xab967d;};'use strict';var Sequelize=require(_0x27ec('0x0'));module[_0x27ec('0x1')]={'name':{'type':Sequelize[_0x27ec('0x2')]},'description':{'type':Sequelize[_0x27ec('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xc436=['STRING','sequelize','exports'];(function(_0x256422,_0x367394){var _0x55dddc=function(_0x1594bc){while(--_0x1594bc){_0x256422['push'](_0x256422['shift']());}};_0x55dddc(++_0x367394);}(_0xc436,0x97));var _0x6c43=function(_0x9e5cfb,_0x5e1a0f){_0x9e5cfb=_0x9e5cfb-0x0;var _0x5a3140=_0xc436[_0x9e5cfb];return _0x5a3140;};'use strict';var Sequelize=require(_0x6c43('0x0'));module[_0x6c43('0x1')]={'name':{'type':Sequelize[_0x6c43('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index e9572a2..36653d5 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 _0x9e17=['length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','catch','role','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','IntervalId','getIntervals','order','pick','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','get','UserProfileResource','end','sendStatus','stack','name','map','Interval','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields'];(function(_0x51731f,_0x29ce41){var _0x169540=function(_0x4d8ac1){while(--_0x4d8ac1){_0x51731f['push'](_0x51731f['shift']());}};_0x169540(++_0x29ce41);}(_0x9e17,0xcb));var _0x79e1=function(_0x57f4de,_0x57c7ae){_0x57f4de=_0x57f4de-0x0;var _0x1edd7b=_0x9e17[_0x57f4de];return _0x1edd7b;};'use strict';var emlformat=require(_0x79e1('0x0'));var rimraf=require(_0x79e1('0x1'));var zipdir=require(_0x79e1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x79e1('0x3'));var moment=require(_0x79e1('0x4'));var BPromise=require(_0x79e1('0x5'));var Mustache=require('mustache');var util=require(_0x79e1('0x6'));var path=require(_0x79e1('0x7'));var sox=require(_0x79e1('0x8'));var csv=require(_0x79e1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x79e1('0xa'));var squel=require(_0x79e1('0xb'));var crypto=require(_0x79e1('0xc'));var jsforce=require(_0x79e1('0xd'));var deskjs=require(_0x79e1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x79e1('0xf'));var Redis=require(_0x79e1('0x10'));var authService=require(_0x79e1('0x11'));var qs=require(_0x79e1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x79e1('0x13'))(_0x79e1('0x14'));var utils=require('../../config/utils');var config=require(_0x79e1('0x15'));var licenseUtil=require(_0x79e1('0x16'));var db=require(_0x79e1('0x17'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2ddd53,_0x38010a){_0x38010a=_0x38010a||0xcc;return function(_0x578ec6){if(_0x578ec6){return _0x2ddd53['sendStatus'](_0x38010a);}return _0x2ddd53['status'](_0x38010a)['end']();};}function respondWithResult(_0x1e48fc,_0x47e7de){_0x47e7de=_0x47e7de||0xc8;return function(_0x415f4){if(_0x415f4){return _0x1e48fc[_0x79e1('0x18')](_0x47e7de)['json'](_0x415f4);}};}function respondWithFilteredResult(_0x1a20e1,_0x31e9d0){return function(_0x338c7c){if(_0x338c7c){var _0x3553e6=typeof _0x31e9d0['offset']===_0x79e1('0x19')&&typeof _0x31e9d0[_0x79e1('0x1a')]===_0x79e1('0x19');var _0x445b2f=_0x338c7c[_0x79e1('0x1b')];var _0x30b962=_0x3553e6?0x0:_0x31e9d0[_0x79e1('0x1c')];var _0x221f8d=_0x3553e6?_0x338c7c['count']:_0x31e9d0[_0x79e1('0x1c')]+_0x31e9d0[_0x79e1('0x1a')];var _0x23f727;if(_0x221f8d>=_0x445b2f){_0x221f8d=_0x445b2f;_0x23f727=0xc8;}else{_0x23f727=0xce;}_0x1a20e1[_0x79e1('0x18')](_0x23f727);return _0x1a20e1[_0x79e1('0x1d')](_0x79e1('0x1e'),_0x30b962+'-'+_0x221f8d+'/'+_0x445b2f)[_0x79e1('0x1f')](_0x338c7c);}return null;};}function patchUpdates(_0x1ab5db){return function(_0xa00838){try{jsonpatch[_0x79e1('0x20')](_0xa00838,_0x1ab5db,!![]);}catch(_0x53a020){return BPromise['reject'](_0x53a020);}return _0xa00838[_0x79e1('0x21')]();};}function saveUpdates(_0x8e5005,_0x12bf57){return function(_0x4c6faa){if(_0x4c6faa){return _0x4c6faa[_0x79e1('0x22')](_0x8e5005)[_0x79e1('0x23')](function(_0x5e0664){return _0x5e0664;});}return null;};}function removeEntity(_0x3a5c40,_0x535493){return function(_0x4282cb){if(_0x4282cb){return _0x4282cb[_0x79e1('0x24')]()[_0x79e1('0x23')](function(){var _0x31b075=_0x4282cb[_0x79e1('0x25')]({'plain':!![]});var _0x35c5e4='Intervals';return db[_0x79e1('0x26')][_0x79e1('0x24')]({'where':{'type':_0x35c5e4,'resourceId':_0x31b075['id']}})[_0x79e1('0x23')](function(){return _0x4282cb;});})[_0x79e1('0x23')](function(){_0x3a5c40['status'](0xcc)[_0x79e1('0x27')]();});}};}function handleEntityNotFound(_0x152312,_0x390311){return function(_0x14e08e){if(!_0x14e08e){_0x152312[_0x79e1('0x28')](0x194);}return _0x14e08e;};}function handleError(_0x172f59,_0x1153ee){_0x1153ee=_0x1153ee||0x1f4;return function(_0x13272f){logger['error'](_0x13272f[_0x79e1('0x29')]);if(_0x13272f['name']){delete _0x13272f[_0x79e1('0x2a')];}_0x172f59['status'](_0x1153ee)['send'](_0x13272f);};}exports['index']=function(_0x3a24ef,_0x1ca5a3){var _0x4ea9c9={},_0x184637={},_0x301afd={'count':0x0,'rows':[]};var _0x538199=_[_0x79e1('0x2b')](db[_0x79e1('0x2c')][_0x79e1('0x2d')],function(_0xc1bc){return{'name':_0xc1bc['fieldName'],'type':_0xc1bc[_0x79e1('0x2e')][_0x79e1('0x2f')]};});_0x184637['model']=_['map'](_0x538199,_0x79e1('0x2a'));_0x184637['query']=_[_0x79e1('0x30')](_0x3a24ef[_0x79e1('0x31')]);_0x184637[_0x79e1('0x32')]=_[_0x79e1('0x33')](_0x184637[_0x79e1('0x34')],_0x184637[_0x79e1('0x31')]);_0x4ea9c9[_0x79e1('0x35')]=_['intersection'](_0x184637[_0x79e1('0x34')],qs[_0x79e1('0x36')](_0x3a24ef['query'][_0x79e1('0x36')]));_0x4ea9c9[_0x79e1('0x35')]=_0x4ea9c9['attributes'][_0x79e1('0x37')]?_0x4ea9c9[_0x79e1('0x35')]:_0x184637[_0x79e1('0x34')];if(!_0x3a24ef[_0x79e1('0x31')][_0x79e1('0x38')](_0x79e1('0x39'))){_0x4ea9c9[_0x79e1('0x1a')]=qs[_0x79e1('0x1a')](_0x3a24ef['query']['limit']);_0x4ea9c9['offset']=qs['offset'](_0x3a24ef['query'][_0x79e1('0x1c')]);}_0x4ea9c9['order']=qs['sort'](_0x3a24ef[_0x79e1('0x31')][_0x79e1('0x3a')]);_0x4ea9c9[_0x79e1('0x3b')]=qs[_0x79e1('0x32')](_['pick'](_0x3a24ef[_0x79e1('0x31')],_0x184637[_0x79e1('0x32')]),_0x538199);if(_0x3a24ef[_0x79e1('0x31')][_0x79e1('0x3c')]){_0x4ea9c9[_0x79e1('0x3b')]=_[_0x79e1('0x3d')](_0x4ea9c9[_0x79e1('0x3b')],{'$or':_['map'](_0x538199,function(_0x539397){if(_0x539397[_0x79e1('0x2e')]!==_0x79e1('0x3e')){var _0x1e47dd={};_0x1e47dd[_0x539397['name']]={'$like':'%'+_0x3a24ef['query'][_0x79e1('0x3c')]+'%'};return _0x1e47dd;}})});}_0x4ea9c9=_[_0x79e1('0x3d')]({},_0x4ea9c9,_0x3a24ef[_0x79e1('0x3f')]);var _0x5342cc={'where':_0x4ea9c9[_0x79e1('0x3b')]};return db['Interval'][_0x79e1('0x1b')](_0x5342cc)[_0x79e1('0x23')](function(_0x2baf2a){_0x301afd[_0x79e1('0x1b')]=_0x2baf2a;if(_0x3a24ef[_0x79e1('0x31')][_0x79e1('0x40')]){_0x4ea9c9['include']=[{'all':!![]}];}return db['Interval'][_0x79e1('0x41')](_0x4ea9c9);})[_0x79e1('0x23')](function(_0x23ede2){_0x301afd[_0x79e1('0x42')]=_0x23ede2;return _0x301afd;})[_0x79e1('0x23')](respondWithFilteredResult(_0x1ca5a3,_0x4ea9c9))['catch'](handleError(_0x1ca5a3,null));};exports['show']=function(_0x34d380,_0x104b09){var _0x38b442={'raw':!![],'where':{'id':_0x34d380[_0x79e1('0x43')]['id']}},_0x22f8e8={};_0x22f8e8['model']=_[_0x79e1('0x30')](db[_0x79e1('0x2c')][_0x79e1('0x2d')]);_0x22f8e8[_0x79e1('0x31')]=_[_0x79e1('0x30')](_0x34d380[_0x79e1('0x31')]);_0x22f8e8['filters']=_[_0x79e1('0x33')](_0x22f8e8[_0x79e1('0x34')],_0x22f8e8['query']);_0x38b442[_0x79e1('0x35')]=_[_0x79e1('0x33')](_0x22f8e8[_0x79e1('0x34')],qs[_0x79e1('0x36')](_0x34d380[_0x79e1('0x31')]['fields']));_0x38b442['attributes']=_0x38b442[_0x79e1('0x35')]['length']?_0x38b442['attributes']:_0x22f8e8[_0x79e1('0x34')];if(_0x34d380['query'][_0x79e1('0x40')]){_0x38b442[_0x79e1('0x44')]=[{'all':!![]}];}_0x38b442=_[_0x79e1('0x3d')]({},_0x38b442,_0x34d380[_0x79e1('0x3f')]);return db[_0x79e1('0x2c')][_0x79e1('0x45')](_0x38b442)[_0x79e1('0x23')](handleEntityNotFound(_0x104b09,null))[_0x79e1('0x23')](respondWithResult(_0x104b09,null))[_0x79e1('0x46')](handleError(_0x104b09,null));};exports['create']=function(_0x346b56,_0xe9a91b){return db[_0x79e1('0x2c')]['create'](_0x346b56['body'],{})[_0x79e1('0x23')](function(_0x1241fc){var _0x57d566=_0x346b56['user'][_0x79e1('0x25')]({'plain':!![]});if(!_0x57d566)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57d566[_0x79e1('0x47')]==='user'){var _0x3c14bb=_0x1241fc[_0x79e1('0x25')]({'plain':!![]});var _0x1cdb8e='Intervals';return db['UserProfileSection'][_0x79e1('0x45')]({'where':{'name':_0x1cdb8e,'userProfileId':_0x57d566[_0x79e1('0x48')]},'raw':!![]})['then'](function(_0x6f321e){if(_0x6f321e&&_0x6f321e['autoAssociation']===0x0){return db[_0x79e1('0x26')][_0x79e1('0x49')]({'name':_0x3c14bb[_0x79e1('0x2a')],'resourceId':_0x3c14bb['id'],'type':_0x6f321e[_0x79e1('0x2a')],'sectionId':_0x6f321e['id']},{})['then'](function(){return _0x1241fc;});}else{return _0x1241fc;}})[_0x79e1('0x46')](function(_0x1fbf70){logger[_0x79e1('0x4a')](_0x79e1('0x4b'),_0x1fbf70);throw _0x1fbf70;});}return _0x1241fc;})[_0x79e1('0x23')](respondWithResult(_0xe9a91b,0xc9))['catch'](handleError(_0xe9a91b,null));};exports[_0x79e1('0x22')]=function(_0x167fdb,_0x2de6eb){if(_0x167fdb[_0x79e1('0x4c')]['id']){delete _0x167fdb[_0x79e1('0x4c')]['id'];}return db[_0x79e1('0x2c')][_0x79e1('0x45')]({'where':{'id':_0x167fdb[_0x79e1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2de6eb,null))['then'](saveUpdates(_0x167fdb['body'],null))[_0x79e1('0x23')](respondWithResult(_0x2de6eb,null))['catch'](handleError(_0x2de6eb,null));};exports[_0x79e1('0x24')]=function(_0x2afd79,_0x33ed00){return db[_0x79e1('0x2c')][_0x79e1('0x45')]({'where':{'id':_0x2afd79['params']['id']}})[_0x79e1('0x23')](handleEntityNotFound(_0x33ed00,null))[_0x79e1('0x23')](removeEntity(_0x33ed00,null))[_0x79e1('0x46')](handleError(_0x33ed00,null));};exports['addInterval']=function(_0x40ede0,_0x5dfb40,_0x2ac083){if(_0x40ede0[_0x79e1('0x4c')]['id']){delete _0x40ede0[_0x79e1('0x4c')]['id'];}return db[_0x79e1('0x2c')][_0x79e1('0x45')]({'where':{'id':_0x40ede0[_0x79e1('0x43')]['id']}})['then'](handleEntityNotFound(_0x5dfb40,null))[_0x79e1('0x23')](function(_0x37196e){if(_0x37196e){_0x40ede0[_0x79e1('0x4c')][_0x79e1('0x4d')]=_0x37196e['id'];return db[_0x79e1('0x2c')][_0x79e1('0x49')](_0x40ede0[_0x79e1('0x4c')]);}})[_0x79e1('0x23')](respondWithResult(_0x5dfb40,null))['catch'](handleError(_0x5dfb40,null));};exports[_0x79e1('0x4e')]=function(_0x3c8233,_0x1d4853,_0x9ccbf1){var _0x448e87={};var _0x87fe5={};var _0xee0f6d;var _0x3904b8;return db['Interval']['findOne']({'where':{'id':_0x3c8233['params']['id']}})[_0x79e1('0x23')](handleEntityNotFound(_0x1d4853,null))[_0x79e1('0x23')](function(_0x499e48){if(_0x499e48){_0xee0f6d=_0x499e48;_0x87fe5[_0x79e1('0x34')]=_[_0x79e1('0x30')](db[_0x79e1('0x2c')][_0x79e1('0x2d')]);_0x87fe5[_0x79e1('0x31')]=_['keys'](_0x3c8233['query']);_0x87fe5[_0x79e1('0x32')]=_['intersection'](_0x87fe5[_0x79e1('0x34')],_0x87fe5[_0x79e1('0x31')]);_0x448e87[_0x79e1('0x35')]=_[_0x79e1('0x33')](_0x87fe5[_0x79e1('0x34')],qs[_0x79e1('0x36')](_0x3c8233['query']['fields']));_0x448e87[_0x79e1('0x35')]=_0x448e87[_0x79e1('0x35')]['length']?_0x448e87[_0x79e1('0x35')]:_0x87fe5['model'];_0x448e87[_0x79e1('0x4f')]=qs['sort'](_0x3c8233[_0x79e1('0x31')][_0x79e1('0x3a')]);_0x448e87['where']=qs[_0x79e1('0x32')](_[_0x79e1('0x50')](_0x3c8233[_0x79e1('0x31')],_0x87fe5['filters']));if(_0x3c8233[_0x79e1('0x31')][_0x79e1('0x3c')]){_0x448e87['where']=_[_0x79e1('0x3d')](_0x448e87[_0x79e1('0x3b')],{'$or':_['map'](_0x448e87[_0x79e1('0x35')],function(_0x15d56c){var _0x1bfb36={};_0x1bfb36[_0x15d56c]={'$like':'%'+_0x3c8233[_0x79e1('0x31')][_0x79e1('0x3c')]+'%'};return _0x1bfb36;})});}_0x448e87=_[_0x79e1('0x3d')]({},_0x448e87,_0x3c8233[_0x79e1('0x3f')]);return _0xee0f6d['getIntervals'](_0x448e87);}})[_0x79e1('0x23')](function(_0x41d4ba){if(_0x41d4ba){_0x3904b8=_0x41d4ba['length'];if(!_0x3c8233['query'][_0x79e1('0x38')](_0x79e1('0x39'))){_0x448e87[_0x79e1('0x1a')]=qs['limit'](_0x3c8233[_0x79e1('0x31')]['limit']);_0x448e87['offset']=qs[_0x79e1('0x1c')](_0x3c8233[_0x79e1('0x31')][_0x79e1('0x1c')]);}return _0xee0f6d['getIntervals'](_0x448e87);}})['then'](function(_0x46d4de){if(_0x46d4de){return _0x46d4de?{'count':_0x3904b8,'rows':_0x46d4de}:null;}})['then'](respondWithResult(_0x1d4853,null))[_0x79e1('0x46')](handleError(_0x1d4853,null));};exports[_0x79e1('0x51')]=function(_0x4d67e2,_0x8bfd33,_0x441ada){return db[_0x79e1('0x2c')][_0x79e1('0x52')]({'where':{'id':_0x4d67e2['params']['id']}})[_0x79e1('0x23')](handleEntityNotFound(_0x8bfd33,null))[_0x79e1('0x23')](function(_0x16c0cc){if(_0x16c0cc){return db[_0x79e1('0x53')][_0x79e1('0x54')](function(_0x4b27d1){return db[_0x79e1('0x2c')][_0x79e1('0x24')]({'where':{'IntervalId':_0x4d67e2[_0x79e1('0x43')]['id']},'transaction':_0x4b27d1})[_0x79e1('0x23')](function(_0xa88814){var _0x293456=_[_0x79e1('0x2b')](_0x4d67e2[_0x79e1('0x4c')],function(_0x30847f){delete _0x30847f['id'];_0x30847f[_0x79e1('0x4d')]=_0x4d67e2[_0x79e1('0x43')]['id'];return _0x30847f;});return db[_0x79e1('0x2c')][_0x79e1('0x55')](_0x293456,{'transaction':_0x4b27d1});});})['then'](function(){return db['Interval']['findAll']({'where':{'IntervalId':_0x4d67e2['params']['id']}});});}})[_0x79e1('0x23')](respondWithResult(_0x8bfd33,null))[_0x79e1('0x46')](handleError(_0x8bfd33,null));}; \ No newline at end of file +var _0xe96c=['Intervals','UserProfileSection','find','userProfileId','params','addInterval','getIntervals','findOne','keys','hasOwnProperty','nolimit','addIntervals','sequelize','IntervalId','bulkCreate','findAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','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/extensions/rewrite','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0xe96c,0x1e6));var _0xce96=function(_0xd75219,_0x430bc1){_0xd75219=_0xd75219-0x0;var _0x38cc9f=_0xe96c[_0xd75219];return _0x38cc9f;};'use strict';var emlformat=require(_0xce96('0x0'));var rimraf=require(_0xce96('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce96('0x2'));var rp=require(_0xce96('0x3'));var moment=require(_0xce96('0x4'));var BPromise=require(_0xce96('0x5'));var Mustache=require(_0xce96('0x6'));var util=require('util');var path=require(_0xce96('0x7'));var sox=require(_0xce96('0x8'));var csv=require(_0xce96('0x9'));var ejs=require(_0xce96('0xa'));var fs=require('fs');var fs_extra=require(_0xce96('0xb'));var _=require(_0xce96('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xce96('0xd'));var toCsv=require(_0xce96('0x9'));var querystring=require(_0xce96('0xe'));var Papa=require(_0xce96('0xf'));var Redis=require(_0xce96('0x10'));var authService=require(_0xce96('0x11'));var qs=require(_0xce96('0x12'));var as=require(_0xce96('0x13'));var hardwareService=require(_0xce96('0x14'));var logger=require(_0xce96('0x15'))(_0xce96('0x16'));var utils=require(_0xce96('0x17'));var config=require(_0xce96('0x18'));var licenseUtil=require(_0xce96('0x19'));var db=require(_0xce96('0x1a'))['db'];var extensions=require(_0xce96('0x1b'));function respondWithStatusCode(_0x39d3c2,_0x49dfba){_0x49dfba=_0x49dfba||0xcc;return function(_0x54c90b){if(_0x54c90b){return _0x39d3c2[_0xce96('0x1c')](_0x49dfba);}return _0x39d3c2[_0xce96('0x1d')](_0x49dfba)['end']();};}function respondWithResult(_0x3132ed,_0x3f8335){_0x3f8335=_0x3f8335||0xc8;return function(_0x583b43){if(_0x583b43){return _0x3132ed['status'](_0x3f8335)['json'](_0x583b43);}};}function respondWithFilteredResult(_0x21c518,_0x1d2467){return function(_0x3214a8){if(_0x3214a8){var _0x2a4ae6=typeof _0x1d2467[_0xce96('0x1e')]===_0xce96('0x1f')&&typeof _0x1d2467[_0xce96('0x20')]===_0xce96('0x1f');var _0x5a7a05=_0x3214a8[_0xce96('0x21')];var _0x49c2f9=_0x2a4ae6?0x0:_0x1d2467[_0xce96('0x1e')];var _0x592834=_0x2a4ae6?_0x3214a8['count']:_0x1d2467['offset']+_0x1d2467[_0xce96('0x20')];var _0x210d27;if(_0x592834>=_0x5a7a05){_0x592834=_0x5a7a05;_0x210d27=0xc8;}else{_0x210d27=0xce;}_0x21c518[_0xce96('0x1d')](_0x210d27);return _0x21c518[_0xce96('0x22')](_0xce96('0x23'),_0x49c2f9+'-'+_0x592834+'/'+_0x5a7a05)[_0xce96('0x24')](_0x3214a8);}return null;};}function patchUpdates(_0x771bdc){return function(_0x5bcc3b){try{jsonpatch[_0xce96('0x25')](_0x5bcc3b,_0x771bdc,!![]);}catch(_0x49c39c){return BPromise[_0xce96('0x26')](_0x49c39c);}return _0x5bcc3b[_0xce96('0x27')]();};}function saveUpdates(_0x28d86f,_0x1c6a00){return function(_0x29408f){if(_0x29408f){return _0x29408f[_0xce96('0x28')](_0x28d86f)[_0xce96('0x29')](function(_0x3efc56){return _0x3efc56;});}return null;};}function removeEntity(_0x2d6804,_0x2d72d9){return function(_0x4856b3){if(_0x4856b3){return _0x4856b3[_0xce96('0x2a')]()[_0xce96('0x29')](function(){var _0x3ecedd=_0x4856b3[_0xce96('0x2b')]({'plain':!![]});var _0x4ec479='Intervals';return db[_0xce96('0x2c')][_0xce96('0x2a')]({'where':{'type':_0x4ec479,'resourceId':_0x3ecedd['id']}})[_0xce96('0x29')](function(){return _0x4856b3;});})[_0xce96('0x29')](function(){_0x2d6804[_0xce96('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fb93f,_0x2c8f8d){return function(_0x5bed6e){if(!_0x5bed6e){_0x3fb93f['sendStatus'](0x194);}return _0x5bed6e;};}function handleError(_0x10e0f1,_0x5121eb){_0x5121eb=_0x5121eb||0x1f4;return function(_0x524c6f){logger['error'](_0x524c6f[_0xce96('0x2d')]);if(_0x524c6f[_0xce96('0x2e')]){delete _0x524c6f[_0xce96('0x2e')];}_0x10e0f1[_0xce96('0x1d')](_0x5121eb)[_0xce96('0x2f')](_0x524c6f);};}exports[_0xce96('0x30')]=function(_0x19cfa6,_0x271901){var _0x26695a={},_0x13d251={},_0x5acc5d={'count':0x0,'rows':[]};var _0x1dee96=_[_0xce96('0x31')](db[_0xce96('0x32')][_0xce96('0x33')],function(_0x2639c6){return{'name':_0x2639c6[_0xce96('0x34')],'type':_0x2639c6[_0xce96('0x35')]['key']};});_0x13d251[_0xce96('0x36')]=_[_0xce96('0x31')](_0x1dee96,_0xce96('0x2e'));_0x13d251[_0xce96('0x37')]=_['keys'](_0x19cfa6[_0xce96('0x37')]);_0x13d251['filters']=_[_0xce96('0x38')](_0x13d251[_0xce96('0x36')],_0x13d251[_0xce96('0x37')]);_0x26695a[_0xce96('0x39')]=_[_0xce96('0x38')](_0x13d251[_0xce96('0x36')],qs[_0xce96('0x3a')](_0x19cfa6[_0xce96('0x37')][_0xce96('0x3a')]));_0x26695a[_0xce96('0x39')]=_0x26695a['attributes'][_0xce96('0x3b')]?_0x26695a[_0xce96('0x39')]:_0x13d251['model'];if(!_0x19cfa6[_0xce96('0x37')]['hasOwnProperty']('nolimit')){_0x26695a[_0xce96('0x20')]=qs[_0xce96('0x20')](_0x19cfa6[_0xce96('0x37')][_0xce96('0x20')]);_0x26695a[_0xce96('0x1e')]=qs[_0xce96('0x1e')](_0x19cfa6[_0xce96('0x37')]['offset']);}_0x26695a[_0xce96('0x3c')]=qs[_0xce96('0x3d')](_0x19cfa6['query'][_0xce96('0x3d')]);_0x26695a[_0xce96('0x3e')]=qs['filters'](_['pick'](_0x19cfa6['query'],_0x13d251[_0xce96('0x3f')]),_0x1dee96);if(_0x19cfa6[_0xce96('0x37')][_0xce96('0x40')]){_0x26695a['where']=_[_0xce96('0x41')](_0x26695a[_0xce96('0x3e')],{'$or':_[_0xce96('0x31')](_0x1dee96,function(_0x1ad1f8){if(_0x1ad1f8[_0xce96('0x35')]!==_0xce96('0x42')){var _0x25c879={};_0x25c879[_0x1ad1f8[_0xce96('0x2e')]]={'$like':'%'+_0x19cfa6['query']['filter']+'%'};return _0x25c879;}})});}_0x26695a=_[_0xce96('0x41')]({},_0x26695a,_0x19cfa6[_0xce96('0x43')]);var _0x49235d={'where':_0x26695a[_0xce96('0x3e')]};return db[_0xce96('0x32')]['count'](_0x49235d)['then'](function(_0x3e32fe){_0x5acc5d[_0xce96('0x21')]=_0x3e32fe;if(_0x19cfa6[_0xce96('0x37')][_0xce96('0x44')]){_0x26695a['include']=[{'all':!![]}];}return db[_0xce96('0x32')]['findAll'](_0x26695a);})[_0xce96('0x29')](function(_0x4dfce1){_0x5acc5d[_0xce96('0x45')]=_0x4dfce1;return _0x5acc5d;})[_0xce96('0x29')](respondWithFilteredResult(_0x271901,_0x26695a))[_0xce96('0x46')](handleError(_0x271901,null));};exports[_0xce96('0x47')]=function(_0x1c75a0,_0x482b78){var _0x2abb80={'raw':!![],'where':{'id':_0x1c75a0['params']['id']}},_0x512b8c={};_0x512b8c['model']=_['keys'](db['Interval']['rawAttributes']);_0x512b8c[_0xce96('0x37')]=_['keys'](_0x1c75a0[_0xce96('0x37')]);_0x512b8c[_0xce96('0x3f')]=_[_0xce96('0x38')](_0x512b8c[_0xce96('0x36')],_0x512b8c['query']);_0x2abb80['attributes']=_[_0xce96('0x38')](_0x512b8c[_0xce96('0x36')],qs['fields'](_0x1c75a0[_0xce96('0x37')][_0xce96('0x3a')]));_0x2abb80[_0xce96('0x39')]=_0x2abb80[_0xce96('0x39')][_0xce96('0x3b')]?_0x2abb80[_0xce96('0x39')]:_0x512b8c[_0xce96('0x36')];if(_0x1c75a0['query'][_0xce96('0x44')]){_0x2abb80[_0xce96('0x48')]=[{'all':!![]}];}_0x2abb80=_[_0xce96('0x41')]({},_0x2abb80,_0x1c75a0[_0xce96('0x43')]);return db[_0xce96('0x32')]['find'](_0x2abb80)[_0xce96('0x29')](handleEntityNotFound(_0x482b78,null))[_0xce96('0x29')](respondWithResult(_0x482b78,null))[_0xce96('0x46')](handleError(_0x482b78,null));};exports[_0xce96('0x49')]=function(_0x3a9aa4,_0x241f8b){return db[_0xce96('0x32')][_0xce96('0x49')](_0x3a9aa4[_0xce96('0x4a')],{})[_0xce96('0x29')](function(_0xc6d178){var _0x5e7f1a=_0x3a9aa4[_0xce96('0x4b')][_0xce96('0x2b')]({'plain':!![]});if(!_0x5e7f1a)throw new Error(_0xce96('0x4c'));if(_0x5e7f1a[_0xce96('0x4d')]===_0xce96('0x4b')){var _0x2c7758=_0xc6d178[_0xce96('0x2b')]({'plain':!![]});var _0x5407ee=_0xce96('0x4e');return db[_0xce96('0x4f')][_0xce96('0x50')]({'where':{'name':_0x5407ee,'userProfileId':_0x5e7f1a[_0xce96('0x51')]},'raw':!![]})[_0xce96('0x29')](function(_0x234041){if(_0x234041&&_0x234041['autoAssociation']===0x0){return db[_0xce96('0x2c')][_0xce96('0x49')]({'name':_0x2c7758[_0xce96('0x2e')],'resourceId':_0x2c7758['id'],'type':_0x234041['name'],'sectionId':_0x234041['id']},{})[_0xce96('0x29')](function(){return _0xc6d178;});}else{return _0xc6d178;}})[_0xce96('0x46')](function(_0x55433f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x55433f);throw _0x55433f;});}return _0xc6d178;})[_0xce96('0x29')](respondWithResult(_0x241f8b,0xc9))[_0xce96('0x46')](handleError(_0x241f8b,null));};exports['update']=function(_0x5bd6f2,_0xdf29c6){if(_0x5bd6f2[_0xce96('0x4a')]['id']){delete _0x5bd6f2[_0xce96('0x4a')]['id'];}return db['Interval'][_0xce96('0x50')]({'where':{'id':_0x5bd6f2[_0xce96('0x52')]['id']}})[_0xce96('0x29')](handleEntityNotFound(_0xdf29c6,null))['then'](saveUpdates(_0x5bd6f2[_0xce96('0x4a')],null))[_0xce96('0x29')](respondWithResult(_0xdf29c6,null))[_0xce96('0x46')](handleError(_0xdf29c6,null));};exports[_0xce96('0x2a')]=function(_0x3ff6c4,_0x17ca9c){return db[_0xce96('0x32')][_0xce96('0x50')]({'where':{'id':_0x3ff6c4[_0xce96('0x52')]['id']}})['then'](handleEntityNotFound(_0x17ca9c,null))[_0xce96('0x29')](removeEntity(_0x17ca9c,null))[_0xce96('0x46')](handleError(_0x17ca9c,null));};exports[_0xce96('0x53')]=function(_0x57265a,_0x103a85,_0x326177){if(_0x57265a[_0xce96('0x4a')]['id']){delete _0x57265a[_0xce96('0x4a')]['id'];}return db[_0xce96('0x32')][_0xce96('0x50')]({'where':{'id':_0x57265a[_0xce96('0x52')]['id']}})[_0xce96('0x29')](handleEntityNotFound(_0x103a85,null))['then'](function(_0x43a8c3){if(_0x43a8c3){_0x57265a[_0xce96('0x4a')]['IntervalId']=_0x43a8c3['id'];return db[_0xce96('0x32')][_0xce96('0x49')](_0x57265a[_0xce96('0x4a')]);}})[_0xce96('0x29')](respondWithResult(_0x103a85,null))[_0xce96('0x46')](handleError(_0x103a85,null));};exports[_0xce96('0x54')]=function(_0x50b7a9,_0x2bccb2,_0x5b3288){var _0x95b819={};var _0x435382={};var _0x3678b3;var _0x41ae46;return db[_0xce96('0x32')][_0xce96('0x55')]({'where':{'id':_0x50b7a9['params']['id']}})[_0xce96('0x29')](handleEntityNotFound(_0x2bccb2,null))[_0xce96('0x29')](function(_0x6a2b47){if(_0x6a2b47){_0x3678b3=_0x6a2b47;_0x435382[_0xce96('0x36')]=_[_0xce96('0x56')](db[_0xce96('0x32')]['rawAttributes']);_0x435382[_0xce96('0x37')]=_[_0xce96('0x56')](_0x50b7a9['query']);_0x435382[_0xce96('0x3f')]=_[_0xce96('0x38')](_0x435382[_0xce96('0x36')],_0x435382['query']);_0x95b819[_0xce96('0x39')]=_[_0xce96('0x38')](_0x435382['model'],qs[_0xce96('0x3a')](_0x50b7a9[_0xce96('0x37')][_0xce96('0x3a')]));_0x95b819[_0xce96('0x39')]=_0x95b819[_0xce96('0x39')][_0xce96('0x3b')]?_0x95b819[_0xce96('0x39')]:_0x435382['model'];_0x95b819[_0xce96('0x3c')]=qs['sort'](_0x50b7a9[_0xce96('0x37')]['sort']);_0x95b819[_0xce96('0x3e')]=qs[_0xce96('0x3f')](_['pick'](_0x50b7a9[_0xce96('0x37')],_0x435382[_0xce96('0x3f')]));if(_0x50b7a9['query'][_0xce96('0x40')]){_0x95b819[_0xce96('0x3e')]=_['merge'](_0x95b819[_0xce96('0x3e')],{'$or':_[_0xce96('0x31')](_0x95b819[_0xce96('0x39')],function(_0x9117e2){var _0x40382={};_0x40382[_0x9117e2]={'$like':'%'+_0x50b7a9[_0xce96('0x37')][_0xce96('0x40')]+'%'};return _0x40382;})});}_0x95b819=_['merge']({},_0x95b819,_0x50b7a9[_0xce96('0x43')]);return _0x3678b3[_0xce96('0x54')](_0x95b819);}})['then'](function(_0x176397){if(_0x176397){_0x41ae46=_0x176397[_0xce96('0x3b')];if(!_0x50b7a9[_0xce96('0x37')][_0xce96('0x57')](_0xce96('0x58'))){_0x95b819[_0xce96('0x20')]=qs[_0xce96('0x20')](_0x50b7a9[_0xce96('0x37')][_0xce96('0x20')]);_0x95b819[_0xce96('0x1e')]=qs['offset'](_0x50b7a9[_0xce96('0x37')][_0xce96('0x1e')]);}return _0x3678b3[_0xce96('0x54')](_0x95b819);}})[_0xce96('0x29')](function(_0x6d4232){if(_0x6d4232){return _0x6d4232?{'count':_0x41ae46,'rows':_0x6d4232}:null;}})[_0xce96('0x29')](respondWithResult(_0x2bccb2,null))[_0xce96('0x46')](handleError(_0x2bccb2,null));};exports[_0xce96('0x59')]=function(_0x43705e,_0x1842a7,_0x24ff59){return db['Interval'][_0xce96('0x55')]({'where':{'id':_0x43705e[_0xce96('0x52')]['id']}})[_0xce96('0x29')](handleEntityNotFound(_0x1842a7,null))[_0xce96('0x29')](function(_0x2d472d){if(_0x2d472d){return db[_0xce96('0x5a')]['transaction'](function(_0x3f39a7){return db[_0xce96('0x32')][_0xce96('0x2a')]({'where':{'IntervalId':_0x43705e['params']['id']},'transaction':_0x3f39a7})[_0xce96('0x29')](function(_0x193288){var _0x53ee3c=_[_0xce96('0x31')](_0x43705e['body'],function(_0x5e937d){delete _0x5e937d['id'];_0x5e937d[_0xce96('0x5b')]=_0x43705e[_0xce96('0x52')]['id'];return _0x5e937d;});return db[_0xce96('0x32')][_0xce96('0x5c')](_0x53ee3c,{'transaction':_0x3f39a7});});})[_0xce96('0x29')](function(){return db['Interval'][_0xce96('0x5d')]({'where':{'IntervalId':_0x43705e[_0xce96('0x52')]['id']}});});}})[_0xce96('0x29')](respondWithResult(_0x1842a7,null))[_0xce96('0x46')](handleError(_0x1842a7,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 244c2b9..8d03ecd 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 _0x147c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','Interval','tools_intervals','rewrite','lodash'];(function(_0x274411,_0x132894){var _0x4a0b1f=function(_0x5e4b06){while(--_0x5e4b06){_0x274411['push'](_0x274411['shift']());}};_0x4a0b1f(++_0x132894);}(_0x147c,0x144));var _0xc147=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x147c[_0x57add2];return _0x4e3670;};'use strict';var _=require(_0xc147('0x0'));var util=require('util');var logger=require(_0xc147('0x1'))(_0xc147('0x2'));var moment=require(_0xc147('0x3'));var BPromise=require(_0xc147('0x4'));var rp=require(_0xc147('0x5'));var fs=require('fs');var path=require(_0xc147('0x6'));var rimraf=require(_0xc147('0x7'));var config=require(_0xc147('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0xc147('0x9'));module['exports']=function(_0x44356f,_0x3c8409){return _0x44356f['define'](_0xc147('0xa'),attributes,{'tableName':_0xc147('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x218ec6,_0x484959){extensions[_0xc147('0xc')](_0x44356f,_0x218ec6);},'afterBulkCreate':function(_0x377c16,_0x2ae19e,_0x3b1f6b){_0x3b1f6b();extensions[_0xc147('0xc')](_0x44356f,_0x377c16[0x0]);},'afterUpdate':function(_0x210786,_0x1b1174){extensions['rewrite'](_0x44356f,_0x210786);},'afterDestroy':function(_0x351a31,_0x27bfeb){extensions[_0xc147('0xc')](_0x44356f,_0x351a31);}}});}; \ No newline at end of file +var _0x1dcc=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite'];(function(_0x48bba8,_0x1ba99f){var _0x191ebc=function(_0x115226){while(--_0x115226){_0x48bba8['push'](_0x48bba8['shift']());}};_0x191ebc(++_0x1ba99f);}(_0x1dcc,0x8c));var _0xc1dc=function(_0x5bdb21,_0x5069db){_0x5bdb21=_0x5bdb21-0x0;var _0x59222d=_0x1dcc[_0x5bdb21];return _0x59222d;};'use strict';var _=require(_0xc1dc('0x0'));var util=require(_0xc1dc('0x1'));var logger=require(_0xc1dc('0x2'))('api');var moment=require(_0xc1dc('0x3'));var BPromise=require(_0xc1dc('0x4'));var rp=require(_0xc1dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc1dc('0x6'));var config=require('../../config/environment');var attributes=require(_0xc1dc('0x7'));var extensions=require(_0xc1dc('0x8'));module[_0xc1dc('0x9')]=function(_0x155803,_0x552593){return _0x155803[_0xc1dc('0xa')](_0xc1dc('0xb'),attributes,{'tableName':_0xc1dc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x56679b,_0x1731e8){extensions[_0xc1dc('0xd')](_0x155803,_0x56679b);},'afterBulkCreate':function(_0x296abc,_0x5208aa,_0x40fc24){_0x40fc24();extensions['rewrite'](_0x155803,_0x296abc[0x0]);},'afterUpdate':function(_0x566693,_0xffa5f8){extensions[_0xc1dc('0xd')](_0x155803,_0x566693);},'afterDestroy':function(_0x775fea,_0x1c577e){extensions[_0xc1dc('0xd')](_0x155803,_0x775fea);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 8b568e9..df35a42 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(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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(_0x4854d6,_0x2f1264){var _0x3885c0=function(_0x4d564d){while(--_0x4d564d){_0x4854d6['push'](_0x4854d6['shift']());}};_0x3885c0(++_0x2f1264);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'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 4da3208..b3ce4c3 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 _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xb10b,0x12a));var _0xbb10=function(_0x3feec6,_0x4db012){_0x3feec6=_0x3feec6-0x0;var _0x56d5e2=_0xb10b[_0x3feec6];return _0x56d5e2;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router; \ No newline at end of file +var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4880fd,_0x2cc70d){_0x4880fd=_0x4880fd-0x0;var _0x4a4b50=_0x0b0e[_0x4880fd];return _0x4a4b50;};'use strict';var express=require(_0xe0b0('0x0'));var router=express['Router']();var auth=require(_0xe0b0('0x1'));var controller=require('./jira.controller');router[_0xe0b0('0x2')]('/',auth[_0xe0b0('0x3')](),controller[_0xe0b0('0x4')]);module[_0xe0b0('0x5')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 2bcae30..ebde0dc 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 _0x6b13=['request','setEncoding','utf8','data','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','connection','socket','remoteAddress','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','stringify','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0x6b13,0x1ac));var _0x36b1=function(_0x3fee7e,_0xcaeb28){_0x3fee7e=_0x3fee7e-0x0;var _0x200ed5=_0x6b13[_0x3fee7e];return _0x200ed5;};'use strict';var BPromise=require('bluebird');var https=require(_0x36b1('0x0'));var logger=require(_0x36b1('0x1'))(_0x36b1('0x2'));var USERNAME='support';var PASSWORD=_0x36b1('0x3');function openIssue(_0x3c98ce,_0x1815c7){var _0x1d34cd={'fields':{'project':{'key':_0x3c98ce[_0x36b1('0x4')]||_0x36b1('0x5')},'summary':(_0x3c98ce['summary']||'Report')+'\x20from\x20'+_0x3c98ce['ip'],'description':_0x3c98ce['description']||JSON[_0x36b1('0x6')](_0x3c98ce),'issuetype':{'name':_0x3c98ce['issuetype']||_0x36b1('0x7')}}};_0x1d34cd[_0x36b1('0x8')][_0x36b1('0x9')]=_0x3c98ce[_0x36b1('0xa')];_0x1d34cd['fields'][_0x36b1('0xb')]=_0x3c98ce['oldToken'];_0x1d34cd['fields'][_0x36b1('0xc')]=_0x3c98ce[_0x36b1('0xd')];_0x1d34cd[_0x36b1('0x8')][_0x36b1('0xe')]=_0x3c98ce['name'];_0x1d34cd[_0x36b1('0x8')]['customfield_11504']=_0x3c98ce[_0x36b1('0xf')];_0x1d34cd[_0x36b1('0x8')][_0x36b1('0x10')]=_0x3c98ce['ip'];var _0x5bedec={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x36b1('0x11'),'method':_0x36b1('0x12'),'timeout':0x4e20,'headers':{'Content-Type':_0x36b1('0x13'),'Authorization':_0x36b1('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x36b1('0x15')](_0x36b1('0x16'))}};var _0x375439=JSON[_0x36b1('0x6')](_0x1d34cd);var _0x5e39d9=https[_0x36b1('0x17')](_0x5bedec,function(_0x51f732){_0x51f732[_0x36b1('0x18')](_0x36b1('0x19'));var _0x4d7bf7='';_0x51f732['on'](_0x36b1('0x1a'),function(_0x5b69fa){_0x4d7bf7+=_0x5b69fa;});_0x51f732['on']('end',function(){if(_0x1815c7){return _0x1815c7[_0x36b1('0x1b')](_0x51f732[_0x36b1('0x1c')])[_0x36b1('0x1d')](JSON[_0x36b1('0x1e')](_0x4d7bf7));}});});_0x5e39d9['on']('error',function(_0x54b424){if(_0x1815c7){return _0x1815c7[_0x36b1('0x1b')](0x1f4)[_0x36b1('0x1d')]({'errors':[{'message':_0x36b1('0x1f'),'type':_0x36b1('0x20')}]});}});_0x5e39d9[_0x36b1('0x21')](_0x375439);_0x5e39d9['end']();}exports[_0x36b1('0x22')]=openIssue;exports[_0x36b1('0x23')]=function(_0x3d8ed5,_0x192a0d){_0x3d8ed5[_0x36b1('0x24')]['ip']=_0x3d8ed5[_0x36b1('0x25')]['x-forwarded-for']||_0x3d8ed5[_0x36b1('0x26')]['remoteAddress']||_0x3d8ed5[_0x36b1('0x27')]['remoteAddress']||_0x3d8ed5['connection']['socket'][_0x36b1('0x28')];return openIssue(_0x3d8ed5[_0x36b1('0x24')],_0x192a0d);}; \ No newline at end of file +var _0xc2d8=['write','openIssue','send','body','connection','remoteAddress','socket','bluebird','https','../../config/logger','3eAmWpBVP0','key','MOTGUI','summary','Report','description','stringify','Bug','fields','customfield_11500','email','oldToken','newToken','customfield_11503','name','reason','track.xcallymotion.com','/rest/api/2/issue','toString','base64','request','setEncoding','utf8','data','end','statusCode','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xc2d8,0xd4));var _0x8c2d=function(_0x1b1dbd,_0x2fe3e2){_0x1b1dbd=_0x1b1dbd-0x0;var _0x3a3fcd=_0xc2d8[_0x1b1dbd];return _0x3a3fcd;};'use strict';var BPromise=require(_0x8c2d('0x0'));var https=require(_0x8c2d('0x1'));var logger=require(_0x8c2d('0x2'))('api');var USERNAME='support';var PASSWORD=_0x8c2d('0x3');function openIssue(_0x4fcda9,_0x2206b5){var _0x8a0dff={'fields':{'project':{'key':_0x4fcda9[_0x8c2d('0x4')]||_0x8c2d('0x5')},'summary':(_0x4fcda9[_0x8c2d('0x6')]||_0x8c2d('0x7'))+'\x20from\x20'+_0x4fcda9['ip'],'description':_0x4fcda9[_0x8c2d('0x8')]||JSON[_0x8c2d('0x9')](_0x4fcda9),'issuetype':{'name':_0x4fcda9['issuetype']||_0x8c2d('0xa')}}};_0x8a0dff[_0x8c2d('0xb')][_0x8c2d('0xc')]=_0x4fcda9[_0x8c2d('0xd')];_0x8a0dff[_0x8c2d('0xb')]['customfield_11501']=_0x4fcda9[_0x8c2d('0xe')];_0x8a0dff[_0x8c2d('0xb')]['customfield_11502']=_0x4fcda9[_0x8c2d('0xf')];_0x8a0dff[_0x8c2d('0xb')][_0x8c2d('0x10')]=_0x4fcda9[_0x8c2d('0x11')];_0x8a0dff[_0x8c2d('0xb')]['customfield_11504']=_0x4fcda9[_0x8c2d('0x12')];_0x8a0dff[_0x8c2d('0xb')]['customfield_10102']=_0x4fcda9['ip'];var _0x573f52={'host':_0x8c2d('0x13'),'port':0x1bb,'path':_0x8c2d('0x14'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x8c2d('0x15')](_0x8c2d('0x16'))}};var _0x3b496e=JSON['stringify'](_0x8a0dff);var _0xed67fc=https[_0x8c2d('0x17')](_0x573f52,function(_0x8b4825){_0x8b4825[_0x8c2d('0x18')](_0x8c2d('0x19'));var _0x388b12='';_0x8b4825['on'](_0x8c2d('0x1a'),function(_0x1efb8a){_0x388b12+=_0x1efb8a;});_0x8b4825['on'](_0x8c2d('0x1b'),function(){if(_0x2206b5){return _0x2206b5['status'](_0x8b4825[_0x8c2d('0x1c')])[_0x8c2d('0x1d')](JSON['parse'](_0x388b12));}});});_0xed67fc['on'](_0x8c2d('0x1e'),function(_0x3de061){if(_0x2206b5){return _0x2206b5[_0x8c2d('0x1f')](0x1f4)[_0x8c2d('0x1d')]({'errors':[{'message':_0x8c2d('0x20'),'type':_0x8c2d('0x21')}]});}});_0xed67fc[_0x8c2d('0x22')](_0x3b496e);_0xed67fc[_0x8c2d('0x1b')]();}exports[_0x8c2d('0x23')]=openIssue;exports[_0x8c2d('0x24')]=function(_0x24991e,_0x3582c5){_0x24991e[_0x8c2d('0x25')]['ip']=_0x24991e['headers']['x-forwarded-for']||_0x24991e[_0x8c2d('0x26')][_0x8c2d('0x27')]||_0x24991e[_0x8c2d('0x28')][_0x8c2d('0x27')]||_0x24991e['connection']['socket']['remoteAddress'];return openIssue(_0x24991e[_0x8c2d('0x25')],_0x3582c5);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 3261a0d..c13736b 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 _0x70e0=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','isAuthenticated','describe','get','/:id','show','post','put','update','delete','destroy','exports','multer'];(function(_0x339c91,_0x25890b){var _0x6d483b=function(_0x460ba7){while(--_0x460ba7){_0x339c91['push'](_0x339c91['shift']());}};_0x6d483b(++_0x25890b);}(_0x70e0,0x17b));var _0x070e=function(_0xfd4a44,_0x1828c5){_0xfd4a44=_0xfd4a44-0x0;var _0x4ec3d4=_0x70e0[_0xfd4a44];return _0x4ec3d4;};'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'](),controller['create']);router[_0x070e('0xe')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x11')]);module[_0x070e('0x12')]=router; \ No newline at end of file +var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x5ecc63,_0x110d0d){var _0x56e65f=function(_0x138202){while(--_0x138202){_0x5ecc63['push'](_0x5ecc63['shift']());}};_0x56e65f(++_0x110d0d);}(_0x91a7,0xe7));var _0x791a=function(_0x35b19d,_0x585ab5){_0x35b19d=_0x35b19d-0x0;var _0x571f72=_0x91a7[_0x35b19d];return _0x571f72;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 82e52aa..fe5876f 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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x12d207,_0x4a94f4){_0x12d207=_0x12d207-0x0;var _0x20fdfe=_0x7a54[_0x12d207];return _0x20fdfe;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x7a54,0x106));var _0x47a5=function(_0xf832b2,_0x2d53ce){_0xf832b2=_0xf832b2-0x0;var _0x23f114=_0x7a54[_0xf832b2];return _0x23f114;};'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 4fe8d13..ce4643a 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 _0x41ec=['merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','JscriptyAnswerReport','include','create','body','find','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where'];(function(_0x4f7468,_0x1a632b){var _0x5b860f=function(_0x394d47){while(--_0x394d47){_0x4f7468['push'](_0x4f7468['shift']());}};_0x5b860f(++_0x1a632b);}(_0x41ec,0x143));var _0xc41e=function(_0xf5b99c,_0x1916f8){_0xf5b99c=_0xf5b99c-0x0;var _0x36de0b=_0x41ec[_0xf5b99c];return _0x36de0b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc41e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc41e('0x1'));var rp=require(_0xc41e('0x2'));var moment=require('moment');var BPromise=require(_0xc41e('0x3'));var Mustache=require(_0xc41e('0x4'));var util=require(_0xc41e('0x5'));var path=require(_0xc41e('0x6'));var sox=require(_0xc41e('0x7'));var csv=require(_0xc41e('0x8'));var ejs=require(_0xc41e('0x9'));var fs=require('fs');var fs_extra=require(_0xc41e('0xa'));var _=require(_0xc41e('0xb'));var squel=require(_0xc41e('0xc'));var crypto=require(_0xc41e('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc41e('0xe'));var toCsv=require(_0xc41e('0x8'));var querystring=require(_0xc41e('0xf'));var Papa=require(_0xc41e('0x10'));var Redis=require(_0xc41e('0x11'));var authService=require(_0xc41e('0x12'));var qs=require(_0xc41e('0x13'));var as=require(_0xc41e('0x14'));var hardwareService=require(_0xc41e('0x15'));var logger=require(_0xc41e('0x16'))(_0xc41e('0x17'));var utils=require('../../config/utils');var config=require(_0xc41e('0x18'));var licenseUtil=require(_0xc41e('0x19'));var db=require(_0xc41e('0x1a'))['db'];function respondWithStatusCode(_0x3d7280,_0x11a117){_0x11a117=_0x11a117||0xcc;return function(_0x433ca9){if(_0x433ca9){return _0x3d7280[_0xc41e('0x1b')](_0x11a117);}return _0x3d7280[_0xc41e('0x1c')](_0x11a117)['end']();};}function respondWithResult(_0x3b3900,_0x6b614a){_0x6b614a=_0x6b614a||0xc8;return function(_0xcd58a0){if(_0xcd58a0){return _0x3b3900[_0xc41e('0x1c')](_0x6b614a)['json'](_0xcd58a0);}};}function respondWithFilteredResult(_0x5c705e,_0x4f960d){return function(_0x28eb53){if(_0x28eb53){var _0x4293a5=typeof _0x4f960d['offset']===_0xc41e('0x1d')&&typeof _0x4f960d[_0xc41e('0x1e')]==='undefined';var _0x4e7aa3=_0x28eb53[_0xc41e('0x1f')];var _0x5c0517=_0x4293a5?0x0:_0x4f960d[_0xc41e('0x20')];var _0x23c9b6=_0x4293a5?_0x28eb53['count']:_0x4f960d[_0xc41e('0x20')]+_0x4f960d[_0xc41e('0x1e')];var _0xee0f01;if(_0x23c9b6>=_0x4e7aa3){_0x23c9b6=_0x4e7aa3;_0xee0f01=0xc8;}else{_0xee0f01=0xce;}_0x5c705e[_0xc41e('0x1c')](_0xee0f01);return _0x5c705e[_0xc41e('0x21')](_0xc41e('0x22'),_0x5c0517+'-'+_0x23c9b6+'/'+_0x4e7aa3)[_0xc41e('0x23')](_0x28eb53);}return null;};}function patchUpdates(_0x57e0c4){return function(_0x239c25){try{jsonpatch[_0xc41e('0x24')](_0x239c25,_0x57e0c4,!![]);}catch(_0x3f26d5){return BPromise['reject'](_0x3f26d5);}return _0x239c25[_0xc41e('0x25')]();};}function saveUpdates(_0x408d27,_0x814a72){return function(_0x490cc3){if(_0x490cc3){return _0x490cc3[_0xc41e('0x26')](_0x408d27)[_0xc41e('0x27')](function(_0x602bd7){return _0x602bd7;});}return null;};}function removeEntity(_0x4adaad,_0x5a06dd){return function(_0x4c20b1){if(_0x4c20b1){return _0x4c20b1[_0xc41e('0x28')]()[_0xc41e('0x27')](function(){_0x4adaad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a3e0d,_0x1c33a6){return function(_0x1ad4c7){if(!_0x1ad4c7){_0x5a3e0d[_0xc41e('0x1b')](0x194);}return _0x1ad4c7;};}function handleError(_0x467672,_0x1c6a2a){_0x1c6a2a=_0x1c6a2a||0x1f4;return function(_0x580b9e){logger[_0xc41e('0x29')](_0x580b9e[_0xc41e('0x2a')]);if(_0x580b9e[_0xc41e('0x2b')]){delete _0x580b9e['name'];}_0x467672[_0xc41e('0x1c')](_0x1c6a2a)[_0xc41e('0x2c')](_0x580b9e);};}exports['index']=function(_0x25b319,_0x12536e){var _0x5c2c62={},_0xcb3a15={},_0x2fa98a={'count':0x0,'rows':[]};var _0x17246e=_[_0xc41e('0x2d')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x541ac4){return{'name':_0x541ac4[_0xc41e('0x2e')],'type':_0x541ac4[_0xc41e('0x2f')][_0xc41e('0x30')]};});_0xcb3a15[_0xc41e('0x31')]=_[_0xc41e('0x2d')](_0x17246e,_0xc41e('0x2b'));_0xcb3a15[_0xc41e('0x32')]=_['keys'](_0x25b319[_0xc41e('0x32')]);_0xcb3a15[_0xc41e('0x33')]=_[_0xc41e('0x34')](_0xcb3a15['model'],_0xcb3a15[_0xc41e('0x32')]);_0x5c2c62['attributes']=_[_0xc41e('0x34')](_0xcb3a15[_0xc41e('0x31')],qs[_0xc41e('0x35')](_0x25b319[_0xc41e('0x32')]['fields']));_0x5c2c62['attributes']=_0x5c2c62[_0xc41e('0x36')][_0xc41e('0x37')]?_0x5c2c62[_0xc41e('0x36')]:_0xcb3a15[_0xc41e('0x31')];if(!_0x25b319[_0xc41e('0x32')][_0xc41e('0x38')]('nolimit')){_0x5c2c62[_0xc41e('0x1e')]=qs[_0xc41e('0x1e')](_0x25b319[_0xc41e('0x32')]['limit']);_0x5c2c62[_0xc41e('0x20')]=qs[_0xc41e('0x20')](_0x25b319['query'][_0xc41e('0x20')]);}_0x5c2c62[_0xc41e('0x39')]=qs[_0xc41e('0x3a')](_0x25b319[_0xc41e('0x32')][_0xc41e('0x3a')]);_0x5c2c62['where']=qs['filters'](_[_0xc41e('0x3b')](_0x25b319[_0xc41e('0x32')],_0xcb3a15[_0xc41e('0x33')]),_0x17246e);if(_0x25b319[_0xc41e('0x32')][_0xc41e('0x3c')]){_0x5c2c62[_0xc41e('0x3d')]=_[_0xc41e('0x3e')](_0x5c2c62[_0xc41e('0x3d')],{'$or':_[_0xc41e('0x2d')](_0x17246e,function(_0x4de59a){if(_0x4de59a['type']!==_0xc41e('0x3f')){var _0xfd6ff6={};_0xfd6ff6[_0x4de59a[_0xc41e('0x2b')]]={'$like':'%'+_0x25b319[_0xc41e('0x32')][_0xc41e('0x3c')]+'%'};return _0xfd6ff6;}})});}_0x5c2c62=_[_0xc41e('0x3e')]({},_0x5c2c62,_0x25b319[_0xc41e('0x40')]);var _0x150f30={'where':_0x5c2c62['where']};return db['JscriptyAnswerReport'][_0xc41e('0x1f')](_0x150f30)[_0xc41e('0x27')](function(_0x10cfed){_0x2fa98a['count']=_0x10cfed;if(_0x25b319['query'][_0xc41e('0x41')]){_0x5c2c62['include']=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x5c2c62);})['then'](function(_0x3c30e2){_0x2fa98a[_0xc41e('0x42')]=_0x3c30e2;return _0x2fa98a;})[_0xc41e('0x27')](respondWithFilteredResult(_0x12536e,_0x5c2c62))[_0xc41e('0x43')](handleError(_0x12536e,null));};exports[_0xc41e('0x44')]=function(_0x206aa1,_0x4bb1f6){var _0x28d15d={'raw':!![],'where':{'id':_0x206aa1[_0xc41e('0x45')]['id']}},_0x1a3e67={};_0x1a3e67[_0xc41e('0x31')]=_[_0xc41e('0x46')](db[_0xc41e('0x47')]['rawAttributes']);_0x1a3e67[_0xc41e('0x32')]=_[_0xc41e('0x46')](_0x206aa1['query']);_0x1a3e67[_0xc41e('0x33')]=_[_0xc41e('0x34')](_0x1a3e67['model'],_0x1a3e67[_0xc41e('0x32')]);_0x28d15d['attributes']=_[_0xc41e('0x34')](_0x1a3e67[_0xc41e('0x31')],qs[_0xc41e('0x35')](_0x206aa1['query'][_0xc41e('0x35')]));_0x28d15d[_0xc41e('0x36')]=_0x28d15d['attributes']['length']?_0x28d15d['attributes']:_0x1a3e67['model'];if(_0x206aa1[_0xc41e('0x32')]['includeAll']){_0x28d15d[_0xc41e('0x48')]=[{'all':!![]}];}_0x28d15d=_['merge']({},_0x28d15d,_0x206aa1['options']);return db[_0xc41e('0x47')]['find'](_0x28d15d)[_0xc41e('0x27')](handleEntityNotFound(_0x4bb1f6,null))[_0xc41e('0x27')](respondWithResult(_0x4bb1f6,null))[_0xc41e('0x43')](handleError(_0x4bb1f6,null));};exports[_0xc41e('0x49')]=function(_0x46aef6,_0x31b393){return db[_0xc41e('0x47')][_0xc41e('0x49')](_0x46aef6[_0xc41e('0x4a')],{})[_0xc41e('0x27')](respondWithResult(_0x31b393,0xc9))[_0xc41e('0x43')](handleError(_0x31b393,null));};exports['update']=function(_0x4b67d4,_0x1cdf49){if(_0x4b67d4[_0xc41e('0x4a')]['id']){delete _0x4b67d4[_0xc41e('0x4a')]['id'];}return db['JscriptyAnswerReport'][_0xc41e('0x4b')]({'where':{'id':_0x4b67d4[_0xc41e('0x45')]['id']}})[_0xc41e('0x27')](handleEntityNotFound(_0x1cdf49,null))[_0xc41e('0x27')](saveUpdates(_0x4b67d4[_0xc41e('0x4a')],null))[_0xc41e('0x27')](respondWithResult(_0x1cdf49,null))[_0xc41e('0x43')](handleError(_0x1cdf49,null));};exports['destroy']=function(_0x3c867a,_0x317eba){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x3c867a[_0xc41e('0x45')]['id']}})[_0xc41e('0x27')](handleEntityNotFound(_0x317eba,null))[_0xc41e('0x27')](removeEntity(_0x317eba,null))[_0xc41e('0x43')](handleError(_0x317eba,null));};exports[_0xc41e('0x4c')]=function(_0x53a799,_0x576831){return db[_0xc41e('0x47')]['describe']()[_0xc41e('0x27')](respondWithResult(_0x576831,null))['catch'](handleError(_0x576831,null));}; \ No newline at end of file +var _0xbeea=['stack','name','index','map','JscriptyAnswerReport','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','update','destroy','then','sendStatus'];(function(_0x23071e,_0x4df73d){var _0x397837=function(_0x3a1e44){while(--_0x3a1e44){_0x23071e['push'](_0x23071e['shift']());}};_0x397837(++_0x4df73d);}(_0xbeea,0xb1));var _0xabee=function(_0x3374db,_0x3b178c){_0x3374db=_0x3374db-0x0;var _0x4d8156=_0xbeea[_0x3374db];return _0x4d8156;};'use strict';var emlformat=require(_0xabee('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xabee('0x1'));var jsonpatch=require(_0xabee('0x2'));var rp=require(_0xabee('0x3'));var moment=require('moment');var BPromise=require(_0xabee('0x4'));var Mustache=require('mustache');var util=require(_0xabee('0x5'));var path=require(_0xabee('0x6'));var sox=require(_0xabee('0x7'));var csv=require(_0xabee('0x8'));var ejs=require(_0xabee('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabee('0xa'));var crypto=require(_0xabee('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabee('0xc'));var toCsv=require('to-csv');var querystring=require(_0xabee('0xd'));var Papa=require(_0xabee('0xe'));var Redis=require(_0xabee('0xf'));var authService=require(_0xabee('0x10'));var qs=require(_0xabee('0x11'));var as=require(_0xabee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xabee('0x13'))(_0xabee('0x14'));var utils=require(_0xabee('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xabee('0x16'));var db=require(_0xabee('0x17'))['db'];function respondWithStatusCode(_0x16d6a5,_0x49fb73){_0x49fb73=_0x49fb73||0xcc;return function(_0x5915a1){if(_0x5915a1){return _0x16d6a5['sendStatus'](_0x49fb73);}return _0x16d6a5['status'](_0x49fb73)['end']();};}function respondWithResult(_0x113c5c,_0x370a4e){_0x370a4e=_0x370a4e||0xc8;return function(_0x38ba29){if(_0x38ba29){return _0x113c5c[_0xabee('0x18')](_0x370a4e)[_0xabee('0x19')](_0x38ba29);}};}function respondWithFilteredResult(_0x5e94ff,_0x177670){return function(_0x2d85a4){if(_0x2d85a4){var _0x2f1107=typeof _0x177670[_0xabee('0x1a')]===_0xabee('0x1b')&&typeof _0x177670[_0xabee('0x1c')]===_0xabee('0x1b');var _0x5a9562=_0x2d85a4[_0xabee('0x1d')];var _0x112bb9=_0x2f1107?0x0:_0x177670[_0xabee('0x1a')];var _0x471b24=_0x2f1107?_0x2d85a4[_0xabee('0x1d')]:_0x177670[_0xabee('0x1a')]+_0x177670['limit'];var _0x47fa3f;if(_0x471b24>=_0x5a9562){_0x471b24=_0x5a9562;_0x47fa3f=0xc8;}else{_0x47fa3f=0xce;}_0x5e94ff[_0xabee('0x18')](_0x47fa3f);return _0x5e94ff['set']('Content-Range',_0x112bb9+'-'+_0x471b24+'/'+_0x5a9562)[_0xabee('0x19')](_0x2d85a4);}return null;};}function patchUpdates(_0x443301){return function(_0x3dd1ff){try{jsonpatch[_0xabee('0x1e')](_0x3dd1ff,_0x443301,!![]);}catch(_0x2b66f5){return BPromise['reject'](_0x2b66f5);}return _0x3dd1ff[_0xabee('0x1f')]();};}function saveUpdates(_0x54014d,_0x4f5501){return function(_0x4926d7){if(_0x4926d7){return _0x4926d7[_0xabee('0x20')](_0x54014d)['then'](function(_0x870569){return _0x870569;});}return null;};}function removeEntity(_0x2834e3,_0x520bc){return function(_0x15a36c){if(_0x15a36c){return _0x15a36c[_0xabee('0x21')]()[_0xabee('0x22')](function(){_0x2834e3[_0xabee('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdbbf57,_0xfc419d){return function(_0x42277e){if(!_0x42277e){_0xdbbf57[_0xabee('0x23')](0x194);}return _0x42277e;};}function handleError(_0x4ae65e,_0x2aa470){_0x2aa470=_0x2aa470||0x1f4;return function(_0x123d58){logger['error'](_0x123d58[_0xabee('0x24')]);if(_0x123d58[_0xabee('0x25')]){delete _0x123d58[_0xabee('0x25')];}_0x4ae65e[_0xabee('0x18')](_0x2aa470)['send'](_0x123d58);};}exports[_0xabee('0x26')]=function(_0x2b7464,_0x1b5aee){var _0x37e780={},_0x1c4f51={},_0x116e41={'count':0x0,'rows':[]};var _0x3df00d=_[_0xabee('0x27')](db[_0xabee('0x28')]['rawAttributes'],function(_0x2a2441){return{'name':_0x2a2441['fieldName'],'type':_0x2a2441[_0xabee('0x29')][_0xabee('0x2a')]};});_0x1c4f51[_0xabee('0x2b')]=_[_0xabee('0x27')](_0x3df00d,'name');_0x1c4f51[_0xabee('0x2c')]=_['keys'](_0x2b7464[_0xabee('0x2c')]);_0x1c4f51['filters']=_[_0xabee('0x2d')](_0x1c4f51['model'],_0x1c4f51['query']);_0x37e780[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x1c4f51[_0xabee('0x2b')],qs[_0xabee('0x2f')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x2f')]));_0x37e780[_0xabee('0x2e')]=_0x37e780[_0xabee('0x2e')]['length']?_0x37e780[_0xabee('0x2e')]:_0x1c4f51[_0xabee('0x2b')];if(!_0x2b7464[_0xabee('0x2c')][_0xabee('0x30')](_0xabee('0x31'))){_0x37e780[_0xabee('0x1c')]=qs[_0xabee('0x1c')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1c')]);_0x37e780[_0xabee('0x1a')]=qs[_0xabee('0x1a')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x1a')]);}_0x37e780[_0xabee('0x32')]=qs[_0xabee('0x33')](_0x2b7464[_0xabee('0x2c')][_0xabee('0x33')]);_0x37e780['where']=qs['filters'](_[_0xabee('0x34')](_0x2b7464[_0xabee('0x2c')],_0x1c4f51[_0xabee('0x35')]),_0x3df00d);if(_0x2b7464[_0xabee('0x2c')]['filter']){_0x37e780[_0xabee('0x36')]=_[_0xabee('0x37')](_0x37e780[_0xabee('0x36')],{'$or':_['map'](_0x3df00d,function(_0x1a48d5){if(_0x1a48d5['type']!==_0xabee('0x38')){var _0x879d31={};_0x879d31[_0x1a48d5[_0xabee('0x25')]]={'$like':'%'+_0x2b7464[_0xabee('0x2c')]['filter']+'%'};return _0x879d31;}})});}_0x37e780=_['merge']({},_0x37e780,_0x2b7464[_0xabee('0x39')]);var _0xb76b1d={'where':_0x37e780[_0xabee('0x36')]};return db[_0xabee('0x28')][_0xabee('0x1d')](_0xb76b1d)['then'](function(_0x229b00){_0x116e41[_0xabee('0x1d')]=_0x229b00;if(_0x2b7464['query'][_0xabee('0x3a')]){_0x37e780[_0xabee('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xabee('0x3c')](_0x37e780);})[_0xabee('0x22')](function(_0x3f05ee){_0x116e41[_0xabee('0x3d')]=_0x3f05ee;return _0x116e41;})[_0xabee('0x22')](respondWithFilteredResult(_0x1b5aee,_0x37e780))[_0xabee('0x3e')](handleError(_0x1b5aee,null));};exports[_0xabee('0x3f')]=function(_0x4ee7e6,_0x36fc07){var _0x22fc91={'raw':!![],'where':{'id':_0x4ee7e6['params']['id']}},_0x206350={};_0x206350[_0xabee('0x2b')]=_[_0xabee('0x40')](db['JscriptyAnswerReport'][_0xabee('0x41')]);_0x206350[_0xabee('0x2c')]=_['keys'](_0x4ee7e6[_0xabee('0x2c')]);_0x206350[_0xabee('0x35')]=_[_0xabee('0x2d')](_0x206350[_0xabee('0x2b')],_0x206350[_0xabee('0x2c')]);_0x22fc91[_0xabee('0x2e')]=_[_0xabee('0x2d')](_0x206350['model'],qs[_0xabee('0x2f')](_0x4ee7e6[_0xabee('0x2c')][_0xabee('0x2f')]));_0x22fc91['attributes']=_0x22fc91[_0xabee('0x2e')][_0xabee('0x42')]?_0x22fc91['attributes']:_0x206350['model'];if(_0x4ee7e6['query'][_0xabee('0x3a')]){_0x22fc91[_0xabee('0x3b')]=[{'all':!![]}];}_0x22fc91=_['merge']({},_0x22fc91,_0x4ee7e6['options']);return db[_0xabee('0x28')][_0xabee('0x43')](_0x22fc91)[_0xabee('0x22')](handleEntityNotFound(_0x36fc07,null))[_0xabee('0x22')](respondWithResult(_0x36fc07,null))[_0xabee('0x3e')](handleError(_0x36fc07,null));};exports[_0xabee('0x44')]=function(_0x430b08,_0x307d34){return db[_0xabee('0x28')][_0xabee('0x44')](_0x430b08[_0xabee('0x45')],{})[_0xabee('0x22')](respondWithResult(_0x307d34,0xc9))[_0xabee('0x3e')](handleError(_0x307d34,null));};exports[_0xabee('0x20')]=function(_0x3e277d,_0x252f60){if(_0x3e277d[_0xabee('0x45')]['id']){delete _0x3e277d[_0xabee('0x45')]['id'];}return db['JscriptyAnswerReport'][_0xabee('0x43')]({'where':{'id':_0x3e277d[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x252f60,null))['then'](saveUpdates(_0x3e277d[_0xabee('0x45')],null))[_0xabee('0x22')](respondWithResult(_0x252f60,null))[_0xabee('0x3e')](handleError(_0x252f60,null));};exports[_0xabee('0x21')]=function(_0xe2433f,_0x3d819a){return db[_0xabee('0x28')]['find']({'where':{'id':_0xe2433f[_0xabee('0x46')]['id']}})['then'](handleEntityNotFound(_0x3d819a,null))[_0xabee('0x22')](removeEntity(_0x3d819a,null))[_0xabee('0x3e')](handleError(_0x3d819a,null));};exports['describe']=function(_0x3ebd50,_0x3aaf14){return db[_0xabee('0x28')]['describe']()[_0xabee('0x22')](respondWithResult(_0x3aaf14,null))['catch'](handleError(_0x3aaf14,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index b780819..6dcb9a4 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 _0xcfc4=['define','report_jscripty_answers','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x5cb634,_0x3fd713){var _0x2369f6=function(_0xc99da0){while(--_0xc99da0){_0x5cb634['push'](_0x5cb634['shift']());}};_0x2369f6(++_0x3fd713);}(_0xcfc4,0x120));var _0x4cfc=function(_0x50acb7,_0x16121a){_0x50acb7=_0x50acb7-0x0;var _0x29b76e=_0xcfc4[_0x50acb7];return _0x29b76e;};'use strict';var _=require(_0x4cfc('0x0'));var util=require(_0x4cfc('0x1'));var logger=require(_0x4cfc('0x2'))('api');var moment=require(_0x4cfc('0x3'));var BPromise=require('bluebird');var rp=require(_0x4cfc('0x4'));var fs=require('fs');var path=require(_0x4cfc('0x5'));var rimraf=require(_0x4cfc('0x6'));var config=require(_0x4cfc('0x7'));var attributes=require(_0x4cfc('0x8'));module['exports']=function(_0x537a15,_0x4106a2){return _0x537a15[_0x4cfc('0x9')]('JscriptyAnswerReport',attributes,{'tableName':_0x4cfc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed2d=['rimraf','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2b3cad,_0x573629){var _0x2175c4=function(_0x2f5a4f){while(--_0x2f5a4f){_0x2b3cad['push'](_0x2b3cad['shift']());}};_0x2175c4(++_0x573629);}(_0xed2d,0x116));var _0xded2=function(_0x3b7b42,_0x31badd){_0x3b7b42=_0x3b7b42-0x0;var _0x1ebaad=_0xed2d[_0x3b7b42];return _0x1ebaad;};'use strict';var _=require(_0xded2('0x0'));var util=require(_0xded2('0x1'));var logger=require(_0xded2('0x2'))(_0xded2('0x3'));var moment=require(_0xded2('0x4'));var BPromise=require(_0xded2('0x5'));var rp=require(_0xded2('0x6'));var fs=require('fs');var path=require(_0xded2('0x7'));var rimraf=require(_0xded2('0x8'));var config=require(_0xded2('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x1e6a19,_0x188d59){return _0x1e6a19[_0xded2('0xa')](_0xded2('0xb'),attributes,{'tableName':_0xded2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 49dc4fa..9623893 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 _0xe216=['debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyAnswerReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','request\x20sent'];(function(_0x1f1dd4,_0x3094f4){var _0x48aeed=function(_0x328709){while(--_0x328709){_0x1f1dd4['push'](_0x1f1dd4['shift']());}};_0x48aeed(++_0x3094f4);}(_0xe216,0x99));var _0x6e21=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0xe216[_0x35d775];return _0x59384d;};'use strict';var _=require(_0x6e21('0x0'));var util=require(_0x6e21('0x1'));var moment=require(_0x6e21('0x2'));var BPromise=require(_0x6e21('0x3'));var rs=require(_0x6e21('0x4'));var fs=require('fs');var Redis=require(_0x6e21('0x5'));var db=require(_0x6e21('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e21('0x7'))(_0x6e21('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6e21('0x9')][_0x6e21('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d504f,_0x3e6a8c,_0xbd45c7){return new BPromise(function(_0x24d0a0,_0x1fa73b){return client[_0x6e21('0xb')](_0x2d504f,_0xbd45c7)[_0x6e21('0xc')](function(_0x24a3c4){logger[_0x6e21('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3e6a8c,_0x6e21('0xe'));logger[_0x6e21('0xf')](_0x6e21('0x10'),_0x3e6a8c,_0x6e21('0xe'),JSON[_0x6e21('0x11')](_0x24a3c4));if(_0x24a3c4[_0x6e21('0x12')]){if(_0x24a3c4[_0x6e21('0x12')][_0x6e21('0x13')]===0x1f4){logger[_0x6e21('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3e6a8c,_0x24a3c4[_0x6e21('0x12')][_0x6e21('0x14')]);return _0x1fa73b(_0x24a3c4[_0x6e21('0x12')]['message']);}logger[_0x6e21('0x12')](_0x6e21('0x15'),_0x3e6a8c,_0x24a3c4[_0x6e21('0x12')][_0x6e21('0x14')]);return _0x24d0a0(_0x24a3c4[_0x6e21('0x12')][_0x6e21('0x14')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x3e6a8c,_0x6e21('0xe'));_0x24d0a0(_0x24a3c4[_0x6e21('0x16')][_0x6e21('0x14')]);}})[_0x6e21('0x17')](function(_0x3879ac){logger['error'](_0x6e21('0x15'),_0x3e6a8c,_0x3879ac);_0x1fa73b(_0x3879ac);});});} \ No newline at end of file +var _0x4e44=['code','message','info','result','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x2b683f,_0x32bf74){var _0x39866d=function(_0x5e54a6){while(--_0x5e54a6){_0x2b683f['push'](_0x2b683f['shift']());}};_0x39866d(++_0x32bf74);}(_0x4e44,0xac));var _0x44e4=function(_0x362968,_0x1d7f9c){_0x362968=_0x362968-0x0;var _0x1551dc=_0x4e44[_0x362968];return _0x1551dc;};'use strict';var _=require(_0x44e4('0x0'));var util=require(_0x44e4('0x1'));var moment=require('moment');var BPromise=require(_0x44e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44e4('0x3'));var logger=require(_0x44e4('0x4'))(_0x44e4('0x5'));var config=require(_0x44e4('0x6'));var jayson=require(_0x44e4('0x7'));var client=jayson[_0x44e4('0x8')][_0x44e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f52c9,_0x4f1cf9,_0x119b28){return new BPromise(function(_0x2a4d18,_0x367934){return client[_0x44e4('0xa')](_0x4f52c9,_0x119b28)[_0x44e4('0xb')](function(_0x3f12cf){logger['info'](_0x44e4('0xc'),_0x4f1cf9,_0x44e4('0xd'));logger[_0x44e4('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4f1cf9,_0x44e4('0xd'),JSON[_0x44e4('0xf')](_0x3f12cf));if(_0x3f12cf[_0x44e4('0x10')]){if(_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x11')]===0x1f4){logger[_0x44e4('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4f1cf9,_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x12')]);return _0x367934(_0x3f12cf[_0x44e4('0x10')]['message']);}logger[_0x44e4('0x10')](_0x44e4('0xc'),_0x4f1cf9,_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x12')]);return _0x2a4d18(_0x3f12cf[_0x44e4('0x10')][_0x44e4('0x12')]);}else{logger[_0x44e4('0x13')](_0x44e4('0xc'),_0x4f1cf9,'request\x20sent');_0x2a4d18(_0x3f12cf[_0x44e4('0x14')][_0x44e4('0x12')]);}})['catch'](function(_0x53daa7){logger[_0x44e4('0x10')](_0x44e4('0xc'),_0x4f1cf9,_0x53daa7);_0x367934(_0x53daa7);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index fddeeba..e62c1b0 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 _0x6b0d=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','getSessions','/:id/summary','30s','getSummary','post','clone','put','update','delete'];(function(_0x4b2c55,_0x4491ac){var _0x51f5d3=function(_0x502341){while(--_0x502341){_0x4b2c55['push'](_0x4b2c55['shift']());}};_0x51f5d3(++_0x4491ac);}(_0x6b0d,0xe7));var _0xd6b0=function(_0x2a3130,_0x2ed361){_0x2a3130=_0x2a3130-0x0;var _0x237bb4=_0x6b0d[_0x2a3130];return _0x237bb4;};'use strict';var multer=require(_0xd6b0('0x0'));var util=require('util');var path=require(_0xd6b0('0x1'));var timeout=require(_0xd6b0('0x2'));var express=require('express');var router=express[_0xd6b0('0x3')]();var fs_extra=require(_0xd6b0('0x4'));var auth=require(_0xd6b0('0x5'));var interaction=require(_0xd6b0('0x6'));var config=require(_0xd6b0('0x7'));var controller=require('./jscriptyProject.controller');router['get']('/',auth[_0xd6b0('0x8')](),controller[_0xd6b0('0x9')]);router[_0xd6b0('0xa')](_0xd6b0('0xb'),auth['isAuthenticated'](),controller[_0xd6b0('0xc')]);router['get']('/:id/sessions',auth[_0xd6b0('0x8')](),controller[_0xd6b0('0xd')]);router[_0xd6b0('0xa')]('/:id/answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0xd6b0('0xa')](_0xd6b0('0xe'),auth[_0xd6b0('0x8')](),timeout(_0xd6b0('0xf')),controller[_0xd6b0('0x10')]);router[_0xd6b0('0x11')]('/',auth[_0xd6b0('0x8')](),controller['create']);router[_0xd6b0('0x11')]('/:id/clone',auth[_0xd6b0('0x8')](),controller[_0xd6b0('0x12')]);router[_0xd6b0('0x13')](_0xd6b0('0xb'),auth['isAuthenticated'](),controller[_0xd6b0('0x14')]);router[_0xd6b0('0x15')]('/:id',auth[_0xd6b0('0x8')](),controller['destroy']);module[_0xd6b0('0x16')]=router; \ No newline at end of file +var _0x6a89=['put','update','delete','/:id','destroy','multer','path','Router','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','isAuthenticated','show','/:id/sessions','getSessions','30s','post','create','/:id/clone','clone'];(function(_0x651ed,_0x596993){var _0x55781b=function(_0x14aa4c){while(--_0x14aa4c){_0x651ed['push'](_0x651ed['shift']());}};_0x55781b(++_0x596993);}(_0x6a89,0x17b));var _0x96a8=function(_0x4adf67,_0x8cf7a7){_0x4adf67=_0x4adf67-0x0;var _0x52ae16=_0x6a89[_0x4adf67];return _0x52ae16;};'use strict';var multer=require(_0x96a8('0x0'));var util=require('util');var path=require(_0x96a8('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x96a8('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x96a8('0x3'));var config=require(_0x96a8('0x4'));var controller=require(_0x96a8('0x5'));router[_0x96a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x96a8('0x7')]);router['get']('/:id',auth[_0x96a8('0x8')](),controller[_0x96a8('0x9')]);router['get'](_0x96a8('0xa'),auth[_0x96a8('0x8')](),controller[_0x96a8('0xb')]);router[_0x96a8('0x6')]('/:id/answers',auth[_0x96a8('0x8')](),controller['getAnswers']);router[_0x96a8('0x6')]('/:id/summary',auth['isAuthenticated'](),timeout(_0x96a8('0xc')),controller['getSummary']);router[_0x96a8('0xd')]('/',auth['isAuthenticated'](),controller[_0x96a8('0xe')]);router[_0x96a8('0xd')](_0x96a8('0xf'),auth['isAuthenticated'](),controller[_0x96a8('0x10')]);router[_0x96a8('0x11')]('/:id',auth[_0x96a8('0x8')](),controller[_0x96a8('0x12')]);router[_0x96a8('0x13')](_0x96a8('0x14'),auth[_0x96a8('0x8')](),controller[_0x96a8('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 44af4a7..b847337 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 _0xc778=['STRING','name','TEXT','long','setDataValue','formData','stringify','isString','format','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0xc778,0x11c));var _0x8c77=function(_0x3c601f,_0x47d7aa){_0x3c601f=_0x3c601f-0x0;var _0x49f522=_0xc778[_0x3c601f];return _0x49f522;};'use strict';var Sequelize=require(_0x8c77('0x0'));var _=require(_0x8c77('0x1'));var util=require(_0x8c77('0x2'));module[_0x8c77('0x3')]={'name':{'type':Sequelize[_0x8c77('0x4')],'unique':_0x8c77('0x5')},'description':{'type':Sequelize[_0x8c77('0x4')]},'formData':{'type':Sequelize[_0x8c77('0x6')](_0x8c77('0x7')),'set':function(_0xc25514){if(_['isObjectLike'](_0xc25514)){this[_0x8c77('0x8')](_0x8c77('0x9'),JSON[_0x8c77('0xa')](_0xc25514));}else if(_[_0x8c77('0xb')](_0xc25514)){this[_0x8c77('0x8')](_0x8c77('0x9'),_0xc25514);}else{this[_0x8c77('0x8')](_0x8c77('0x9'),util[_0x8c77('0xc')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x8c77('0xd')]('name')||'',this[_0x8c77('0xd')](_0x8c77('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x8c77('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8c77('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xbdca=['isObjectLike','formData','stringify','isString','setDataValue','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT'];(function(_0x3ae4fe,_0x2738e8){var _0x196d4b=function(_0x36a8d){while(--_0x36a8d){_0x3ae4fe['push'](_0x3ae4fe['shift']());}};_0x196d4b(++_0x2738e8);}(_0xbdca,0xda));var _0xabdc=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbdca[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0xabdc('0x0'));var _=require(_0xabdc('0x1'));var util=require(_0xabdc('0x2'));module[_0xabdc('0x3')]={'name':{'type':Sequelize[_0xabdc('0x4')],'unique':_0xabdc('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xabdc('0x6')]('long'),'set':function(_0x334459){if(_[_0xabdc('0x7')](_0x334459)){this['setDataValue'](_0xabdc('0x8'),JSON[_0xabdc('0x9')](_0x334459));}else if(_[_0xabdc('0xa')](_0x334459)){this[_0xabdc('0xb')](_0xabdc('0x8'),_0x334459);}else{this['setDataValue'](_0xabdc('0x8'),util['format'](_0xabdc('0xc'),this[_0xabdc('0xd')](_0xabdc('0x5'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xabdc('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xabdc('0xe')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 7adabf7..11a62b8 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 _0x56fe=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','update','then','get','Projects','UserProfileResource','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','JscriptyProject','includeAll','findAll','rows','catch','show','include','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','find','omit','createdAt','updatedAt','destroy','getSessions','findOne','JscriptySessionReport','getAnswers','JscriptyAnswerReport','ProjectId','fromCharCode','indexOf','toString','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','download','eml-format','rimraf','request-promise','moment','mustache','util','path','sox'];(function(_0x295e3d,_0x48c6a4){var _0x5a576a=function(_0x439cb4){while(--_0x439cb4){_0x295e3d['push'](_0x295e3d['shift']());}};_0x5a576a(++_0x48c6a4);}(_0x56fe,0xe4));var _0xe56f=function(_0xd92570,_0x406e94){_0xd92570=_0xd92570-0x0;var _0x7f1f1e=_0x56fe[_0xd92570];return _0x7f1f1e;};'use strict';var emlformat=require(_0xe56f('0x0'));var rimraf=require(_0xe56f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe56f('0x2'));var moment=require(_0xe56f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe56f('0x4'));var util=require(_0xe56f('0x5'));var path=require(_0xe56f('0x6'));var sox=require(_0xe56f('0x7'));var csv=require('to-csv');var ejs=require(_0xe56f('0x8'));var fs=require('fs');var fs_extra=require(_0xe56f('0x9'));var _=require(_0xe56f('0xa'));var squel=require('squel');var crypto=require(_0xe56f('0xb'));var jsforce=require(_0xe56f('0xc'));var deskjs=require(_0xe56f('0xd'));var toCsv=require(_0xe56f('0xe'));var querystring=require('querystring');var Papa=require(_0xe56f('0xf'));var Redis=require(_0xe56f('0x10'));var authService=require(_0xe56f('0x11'));var qs=require(_0xe56f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe56f('0x13'));var logger=require(_0xe56f('0x14'))(_0xe56f('0x15'));var utils=require(_0xe56f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe56f('0x17'));var db=require(_0xe56f('0x18'))['db'];function respondWithStatusCode(_0x58f742,_0x179a25){_0x179a25=_0x179a25||0xcc;return function(_0x28eb4b){if(_0x28eb4b){return _0x58f742['sendStatus'](_0x179a25);}return _0x58f742[_0xe56f('0x19')](_0x179a25)['end']();};}function respondWithResult(_0x5132b8,_0x5aa3ef){_0x5aa3ef=_0x5aa3ef||0xc8;return function(_0x478d2f){if(_0x478d2f){return _0x5132b8[_0xe56f('0x19')](_0x5aa3ef)[_0xe56f('0x1a')](_0x478d2f);}};}function respondWithFilteredResult(_0x224bb8,_0x5b1f2d){return function(_0x1b9664){if(_0x1b9664){var _0x78e227=typeof _0x5b1f2d[_0xe56f('0x1b')]===_0xe56f('0x1c')&&typeof _0x5b1f2d[_0xe56f('0x1d')]==='undefined';var _0x28b0a6=_0x1b9664[_0xe56f('0x1e')];var _0x2cdbd5=_0x78e227?0x0:_0x5b1f2d[_0xe56f('0x1b')];var _0x51b12b=_0x78e227?_0x1b9664[_0xe56f('0x1e')]:_0x5b1f2d[_0xe56f('0x1b')]+_0x5b1f2d[_0xe56f('0x1d')];var _0x452b0a;if(_0x51b12b>=_0x28b0a6){_0x51b12b=_0x28b0a6;_0x452b0a=0xc8;}else{_0x452b0a=0xce;}_0x224bb8[_0xe56f('0x19')](_0x452b0a);return _0x224bb8[_0xe56f('0x1f')]('Content-Range',_0x2cdbd5+'-'+_0x51b12b+'/'+_0x28b0a6)[_0xe56f('0x1a')](_0x1b9664);}return null;};}function patchUpdates(_0x2a8bce){return function(_0x194527){try{jsonpatch[_0xe56f('0x20')](_0x194527,_0x2a8bce,!![]);}catch(_0x589fa4){return BPromise['reject'](_0x589fa4);}return _0x194527['save']();};}function saveUpdates(_0x17630c,_0x561ca2){return function(_0x44b56c){if(_0x44b56c){return _0x44b56c[_0xe56f('0x21')](_0x17630c)['then'](function(_0x57d562){return _0x57d562;});}return null;};}function removeEntity(_0xd49941,_0x3918af){return function(_0x2f44f7){if(_0x2f44f7){return _0x2f44f7['destroy']()[_0xe56f('0x22')](function(){var _0x37862a=_0x2f44f7[_0xe56f('0x23')]({'plain':!![]});var _0x2a4863=_0xe56f('0x24');return db[_0xe56f('0x25')]['destroy']({'where':{'type':_0x2a4863,'resourceId':_0x37862a['id']}})[_0xe56f('0x22')](function(){return _0x2f44f7;});})['then'](function(){_0xd49941[_0xe56f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2284,_0x3c07e1){return function(_0x2bb033){if(!_0x2bb033){_0x1b2284[_0xe56f('0x26')](0x194);}return _0x2bb033;};}function handleError(_0x26f743,_0x47cf01){_0x47cf01=_0x47cf01||0x1f4;return function(_0x2933e6){logger['error'](_0x2933e6[_0xe56f('0x27')]);if(_0x2933e6[_0xe56f('0x28')]){delete _0x2933e6[_0xe56f('0x28')];}_0x26f743[_0xe56f('0x19')](_0x47cf01)[_0xe56f('0x29')](_0x2933e6);};}exports[_0xe56f('0x2a')]=function(_0x4a7c49,_0x4ebde4){var _0x1bcd06={},_0x57be4e={},_0x3bea1a={'count':0x0,'rows':[]};var _0x520acd=_[_0xe56f('0x2b')](db['JscriptyProject'][_0xe56f('0x2c')],function(_0x6da47f){return{'name':_0x6da47f[_0xe56f('0x2d')],'type':_0x6da47f[_0xe56f('0x2e')][_0xe56f('0x2f')]};});_0x57be4e['model']=_[_0xe56f('0x2b')](_0x520acd,_0xe56f('0x28'));_0x57be4e[_0xe56f('0x30')]=_[_0xe56f('0x31')](_0x4a7c49[_0xe56f('0x30')]);_0x57be4e[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0x57be4e[_0xe56f('0x34')],_0x57be4e['query']);_0x1bcd06[_0xe56f('0x35')]=_[_0xe56f('0x33')](_0x57be4e[_0xe56f('0x34')],qs['fields'](_0x4a7c49[_0xe56f('0x30')][_0xe56f('0x36')]));_0x1bcd06['attributes']=_0x1bcd06['attributes'][_0xe56f('0x37')]?_0x1bcd06[_0xe56f('0x35')]:_0x57be4e['model'];if(!_0x4a7c49[_0xe56f('0x30')][_0xe56f('0x38')](_0xe56f('0x39'))){_0x1bcd06[_0xe56f('0x1d')]=qs['limit'](_0x4a7c49['query'][_0xe56f('0x1d')]);_0x1bcd06[_0xe56f('0x1b')]=qs['offset'](_0x4a7c49[_0xe56f('0x30')]['offset']);}_0x1bcd06[_0xe56f('0x3a')]=qs[_0xe56f('0x3b')](_0x4a7c49[_0xe56f('0x30')][_0xe56f('0x3b')]);_0x1bcd06['where']=qs[_0xe56f('0x32')](_[_0xe56f('0x3c')](_0x4a7c49[_0xe56f('0x30')],_0x57be4e[_0xe56f('0x32')]),_0x520acd);if(_0x4a7c49[_0xe56f('0x30')]['filter']){_0x1bcd06[_0xe56f('0x3d')]=_[_0xe56f('0x3e')](_0x1bcd06[_0xe56f('0x3d')],{'$or':_['map'](_0x520acd,function(_0x3ccecf){if(_0x3ccecf[_0xe56f('0x2e')]!==_0xe56f('0x3f')){var _0x394dd6={};_0x394dd6[_0x3ccecf[_0xe56f('0x28')]]={'$like':'%'+_0x4a7c49[_0xe56f('0x30')][_0xe56f('0x40')]+'%'};return _0x394dd6;}})});}_0x1bcd06=_['merge']({},_0x1bcd06,_0x4a7c49[_0xe56f('0x41')]);var _0x4815b3={'where':_0x1bcd06[_0xe56f('0x3d')]};return db[_0xe56f('0x42')][_0xe56f('0x1e')](_0x4815b3)['then'](function(_0x43ebd0){_0x3bea1a[_0xe56f('0x1e')]=_0x43ebd0;if(_0x4a7c49[_0xe56f('0x30')][_0xe56f('0x43')]){_0x1bcd06['include']=[{'all':!![]}];}return db[_0xe56f('0x42')][_0xe56f('0x44')](_0x1bcd06);})[_0xe56f('0x22')](function(_0x39cba7){_0x3bea1a[_0xe56f('0x45')]=_0x39cba7;return _0x3bea1a;})[_0xe56f('0x22')](respondWithFilteredResult(_0x4ebde4,_0x1bcd06))[_0xe56f('0x46')](handleError(_0x4ebde4,null));};exports[_0xe56f('0x47')]=function(_0x241c0e,_0x500787){var _0x13b68e={'raw':![],'where':{'id':_0x241c0e['params']['id']}},_0x2fb604={};_0x2fb604[_0xe56f('0x34')]=_['keys'](db['JscriptyProject'][_0xe56f('0x2c')]);_0x2fb604[_0xe56f('0x30')]=_[_0xe56f('0x31')](_0x241c0e[_0xe56f('0x30')]);_0x2fb604['filters']=_[_0xe56f('0x33')](_0x2fb604[_0xe56f('0x34')],_0x2fb604[_0xe56f('0x30')]);_0x13b68e['attributes']=_[_0xe56f('0x33')](_0x2fb604[_0xe56f('0x34')],qs[_0xe56f('0x36')](_0x241c0e[_0xe56f('0x30')][_0xe56f('0x36')]));_0x13b68e['attributes']=_0x13b68e[_0xe56f('0x35')][_0xe56f('0x37')]?_0x13b68e[_0xe56f('0x35')]:_0x2fb604[_0xe56f('0x34')];if(_0x241c0e[_0xe56f('0x30')][_0xe56f('0x43')]){_0x13b68e[_0xe56f('0x48')]=[{'all':!![]}];}_0x13b68e=_[_0xe56f('0x3e')]({},_0x13b68e,_0x241c0e[_0xe56f('0x41')]);return db[_0xe56f('0x42')]['find'](_0x13b68e)[_0xe56f('0x22')](handleEntityNotFound(_0x500787,null))[_0xe56f('0x22')](respondWithResult(_0x500787,null))[_0xe56f('0x46')](handleError(_0x500787,null));};exports['create']=function(_0x520757,_0x4a3f82){return db[_0xe56f('0x42')]['create'](_0x520757[_0xe56f('0x49')],{})['then'](function(_0x32b5d8){var _0x1a22dc=_0x520757[_0xe56f('0x4a')][_0xe56f('0x23')]({'plain':!![]});if(!_0x1a22dc)throw new Error(_0xe56f('0x4b'));if(_0x1a22dc[_0xe56f('0x4c')]==='user'){var _0x21a4f4=_0x32b5d8[_0xe56f('0x23')]({'plain':!![]});var _0x3f325b=_0xe56f('0x24');return db[_0xe56f('0x4d')]['find']({'where':{'name':_0x3f325b,'userProfileId':_0x1a22dc[_0xe56f('0x4e')]},'raw':!![]})[_0xe56f('0x22')](function(_0x2ec304){if(_0x2ec304&&_0x2ec304[_0xe56f('0x4f')]===0x0){return db['UserProfileResource'][_0xe56f('0x50')]({'name':_0x21a4f4[_0xe56f('0x28')],'resourceId':_0x21a4f4['id'],'type':_0x2ec304[_0xe56f('0x28')],'sectionId':_0x2ec304['id']},{})[_0xe56f('0x22')](function(){return _0x32b5d8;});}else{return _0x32b5d8;}})[_0xe56f('0x46')](function(_0x11df5){logger[_0xe56f('0x51')](_0xe56f('0x52'),_0x11df5);throw _0x11df5;});}return _0x32b5d8;})[_0xe56f('0x22')](respondWithResult(_0x4a3f82,0xc9))['catch'](handleError(_0x4a3f82,null));};exports[_0xe56f('0x53')]=function(_0x2d15e6,_0x51e137){var _0x3b6956={'where':{'id':_0x2d15e6[_0xe56f('0x54')]['id']}},_0x42e905={};_0x42e905['model']=_[_0xe56f('0x31')](db[_0xe56f('0x42')]['rawAttributes']);_0x3b6956[_0xe56f('0x35')]=_[_0xe56f('0x33')](_0x42e905[_0xe56f('0x34')],qs[_0xe56f('0x36')](_0x2d15e6[_0xe56f('0x30')][_0xe56f('0x36')]));_0x3b6956[_0xe56f('0x35')]=_0x3b6956[_0xe56f('0x35')][_0xe56f('0x37')]?_0x3b6956[_0xe56f('0x35')]:_0x42e905[_0xe56f('0x34')];if(_0x2d15e6['query'][_0xe56f('0x43')]){_0x3b6956[_0xe56f('0x48')]=[{'all':!![]}];}_0x3b6956=_[_0xe56f('0x3e')]({},_0x3b6956,_0x2d15e6[_0xe56f('0x41')]);return db['JscriptyProject'][_0xe56f('0x55')](_0x3b6956)['then'](handleEntityNotFound(_0x51e137,null))['then'](function(_0x2fa839){if(_0x2fa839){var _0x49e277=_0x2fa839[_0xe56f('0x23')]({'plain':!![]});_0x49e277=qs[_0xe56f('0x56')](_0x49e277,['id',_0xe56f('0x57'),_0xe56f('0x58')]);_0x2d15e6['body']=_['omit'](_0x2d15e6[_0xe56f('0x49')],['id',_0xe56f('0x57'),'updatedAt']);return db['JscriptyProject'][_0xe56f('0x50')](_[_0xe56f('0x3e')](_0x49e277,_0x2d15e6[_0xe56f('0x49')]),{'include':_0x2d15e6[_0xe56f('0x30')][_0xe56f('0x43')]?[{'all':!![]}]:undefined})[_0xe56f('0x22')](function(_0x5490c8){var _0x4bac19=_0x2d15e6[_0xe56f('0x4a')]['get']({'plain':!![]});if(!_0x4bac19)throw new Error(_0xe56f('0x4b'));if(_0x4bac19['role']===_0xe56f('0x4a')){var _0x2a8177=_0x5490c8[_0xe56f('0x23')]({'plain':!![]});var _0x104d51=_0xe56f('0x24');return db[_0xe56f('0x4d')][_0xe56f('0x55')]({'where':{'name':_0x104d51,'userProfileId':_0x4bac19[_0xe56f('0x4e')]},'raw':!![]})[_0xe56f('0x22')](function(_0x5938bc){if(_0x5938bc&&_0x5938bc[_0xe56f('0x4f')]===0x0){return db[_0xe56f('0x25')]['create']({'name':_0x2a8177[_0xe56f('0x28')],'resourceId':_0x2a8177['id'],'type':_0x5938bc['name'],'sectionId':_0x5938bc['id']},{})[_0xe56f('0x22')](function(){return _0x5490c8;});}else{return _0x5490c8;}})['catch'](function(_0x287e6b){logger['error'](_0xe56f('0x52'),_0x287e6b);throw _0x287e6b;});}return _0x5490c8;});}})['then'](respondWithResult(_0x51e137,0xc9))['catch'](handleError(_0x51e137,null));};exports[_0xe56f('0x21')]=function(_0x3d0cb0,_0x13b29b){if(_0x3d0cb0[_0xe56f('0x49')]['id']){delete _0x3d0cb0[_0xe56f('0x49')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x3d0cb0['params']['id']}})[_0xe56f('0x22')](handleEntityNotFound(_0x13b29b,null))[_0xe56f('0x22')](saveUpdates(_0x3d0cb0[_0xe56f('0x49')],null))[_0xe56f('0x22')](respondWithResult(_0x13b29b,null))[_0xe56f('0x46')](handleError(_0x13b29b,null));};exports[_0xe56f('0x59')]=function(_0x3752d9,_0x1d807e){return db[_0xe56f('0x42')][_0xe56f('0x55')]({'where':{'id':_0x3752d9[_0xe56f('0x54')]['id']}})[_0xe56f('0x22')](handleEntityNotFound(_0x1d807e,null))[_0xe56f('0x22')](removeEntity(_0x1d807e,null))[_0xe56f('0x46')](handleError(_0x1d807e,null));};exports[_0xe56f('0x5a')]=function(_0x4c7781,_0x4c96ca,_0x9679c9){var _0x2a266d={'raw':!![],'where':{}};var _0xc15eb2={};var _0x12f4c6={'count':0x0,'rows':[]};return db[_0xe56f('0x42')][_0xe56f('0x5b')]({'where':{'id':_0x4c7781['params']['id']}})[_0xe56f('0x22')](handleEntityNotFound(_0x4c96ca,null))[_0xe56f('0x22')](function(_0x310017){if(_0x310017){_0xc15eb2[_0xe56f('0x34')]=_[_0xe56f('0x31')](db[_0xe56f('0x5c')]['rawAttributes']);_0xc15eb2[_0xe56f('0x30')]=_['keys'](_0x4c7781[_0xe56f('0x30')]);_0xc15eb2[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0xc15eb2[_0xe56f('0x34')],_0xc15eb2[_0xe56f('0x30')]);_0x2a266d['attributes']=_['intersection'](_0xc15eb2['model'],qs['fields'](_0x4c7781['query'][_0xe56f('0x36')]));_0x2a266d['attributes']=_0x2a266d[_0xe56f('0x35')][_0xe56f('0x37')]?_0x2a266d[_0xe56f('0x35')]:_0xc15eb2[_0xe56f('0x34')];if(!_0x4c7781[_0xe56f('0x30')][_0xe56f('0x38')](_0xe56f('0x39'))){_0x2a266d[_0xe56f('0x1d')]=qs['limit'](_0x4c7781[_0xe56f('0x30')][_0xe56f('0x1d')]);_0x2a266d['offset']=qs[_0xe56f('0x1b')](_0x4c7781[_0xe56f('0x30')]['offset']);}_0x2a266d[_0xe56f('0x3a')]=qs[_0xe56f('0x3b')](_0x4c7781[_0xe56f('0x30')][_0xe56f('0x3b')]);_0x2a266d[_0xe56f('0x3d')]=qs[_0xe56f('0x32')](_[_0xe56f('0x3c')](_0x4c7781['query'],_0xc15eb2[_0xe56f('0x32')]));_0x2a266d[_0xe56f('0x3d')]['ProjectId']=_0x310017['id'];if(_0x4c7781[_0xe56f('0x30')]['filter']){_0x2a266d[_0xe56f('0x3d')]=_[_0xe56f('0x3e')](_0x2a266d[_0xe56f('0x3d')],{'$or':_[_0xe56f('0x2b')](_0x2a266d[_0xe56f('0x35')],function(_0x31b70a){var _0x2504e7={};_0x2504e7[_0x31b70a]={'$like':'%'+_0x4c7781[_0xe56f('0x30')][_0xe56f('0x40')]+'%'};return _0x2504e7;})});}_0x2a266d=_[_0xe56f('0x3e')]({},_0x2a266d,_0x4c7781[_0xe56f('0x41')]);return db[_0xe56f('0x5c')][_0xe56f('0x1e')]({'where':_0x2a266d['where']})[_0xe56f('0x22')](function(_0x33eb53){_0x12f4c6[_0xe56f('0x1e')]=_0x33eb53;if(_0x4c7781[_0xe56f('0x30')][_0xe56f('0x43')]){_0x2a266d[_0xe56f('0x48')]=[{'all':!![]}];}return db[_0xe56f('0x5c')][_0xe56f('0x44')](_0x2a266d);})['then'](function(_0x2475e3){_0x12f4c6[_0xe56f('0x45')]=_0x2475e3;return _0x12f4c6;});}})[_0xe56f('0x22')](respondWithFilteredResult(_0x4c96ca,_0x2a266d))['catch'](handleError(_0x4c96ca,null));};exports[_0xe56f('0x5d')]=function(_0x243ce6,_0x1be3ba,_0x22ecc5){var _0x48edc1={'raw':!![],'where':{}};var _0x17d801={};var _0x4ed725={'count':0x0,'rows':[]};return db[_0xe56f('0x42')][_0xe56f('0x5b')]({'where':{'id':_0x243ce6['params']['id']}})[_0xe56f('0x22')](handleEntityNotFound(_0x1be3ba,null))[_0xe56f('0x22')](function(_0x43ea17){if(_0x43ea17){_0x17d801['model']=_[_0xe56f('0x31')](db[_0xe56f('0x5e')][_0xe56f('0x2c')]);_0x17d801[_0xe56f('0x30')]=_[_0xe56f('0x31')](_0x243ce6[_0xe56f('0x30')]);_0x17d801[_0xe56f('0x32')]=_[_0xe56f('0x33')](_0x17d801[_0xe56f('0x34')],_0x17d801['query']);_0x48edc1[_0xe56f('0x35')]=_[_0xe56f('0x33')](_0x17d801['model'],qs[_0xe56f('0x36')](_0x243ce6[_0xe56f('0x30')][_0xe56f('0x36')]));_0x48edc1[_0xe56f('0x35')]=_0x48edc1['attributes'][_0xe56f('0x37')]?_0x48edc1['attributes']:_0x17d801[_0xe56f('0x34')];if(!_0x243ce6[_0xe56f('0x30')][_0xe56f('0x38')](_0xe56f('0x39'))){_0x48edc1[_0xe56f('0x1d')]=qs[_0xe56f('0x1d')](_0x243ce6[_0xe56f('0x30')][_0xe56f('0x1d')]);_0x48edc1[_0xe56f('0x1b')]=qs[_0xe56f('0x1b')](_0x243ce6[_0xe56f('0x30')][_0xe56f('0x1b')]);}_0x48edc1[_0xe56f('0x3a')]=qs[_0xe56f('0x3b')](_0x243ce6[_0xe56f('0x30')][_0xe56f('0x3b')]);_0x48edc1[_0xe56f('0x3d')]=qs[_0xe56f('0x32')](_[_0xe56f('0x3c')](_0x243ce6[_0xe56f('0x30')],_0x17d801['filters']));_0x48edc1[_0xe56f('0x3d')][_0xe56f('0x5f')]=_0x43ea17['id'];if(_0x243ce6[_0xe56f('0x30')][_0xe56f('0x40')]){_0x48edc1[_0xe56f('0x3d')]=_[_0xe56f('0x3e')](_0x48edc1['where'],{'$or':_[_0xe56f('0x2b')](_0x48edc1[_0xe56f('0x35')],function(_0x9ee179){var _0x4cd51d={};_0x4cd51d[_0x9ee179]={'$like':'%'+_0x243ce6['query'][_0xe56f('0x40')]+'%'};return _0x4cd51d;})});}_0x48edc1=_[_0xe56f('0x3e')]({},_0x48edc1,_0x243ce6[_0xe56f('0x41')]);return db[_0xe56f('0x5e')][_0xe56f('0x1e')]({'where':_0x48edc1[_0xe56f('0x3d')]})[_0xe56f('0x22')](function(_0x14a90d){_0x4ed725[_0xe56f('0x1e')]=_0x14a90d;if(_0x243ce6[_0xe56f('0x30')][_0xe56f('0x43')]){_0x48edc1['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xe56f('0x44')](_0x48edc1);})[_0xe56f('0x22')](function(_0xd92a10){_0x4ed725['rows']=_0xd92a10;return _0x4ed725;});}})[_0xe56f('0x22')](respondWithFilteredResult(_0x1be3ba,_0x48edc1))['catch'](handleError(_0x1be3ba,null));};function char(_0x305cc1){return'number'===typeof _0x305cc1?String[_0xe56f('0x60')][_0xe56f('0x20')](null,arguments):_0x305cc1;}function needsEncapsulation(_0xd59a9f){return!!_0xd59a9f&&(_0xd59a9f['toString']()[_0xe56f('0x61')](char(0xd))>=0x0||_0xd59a9f[_0xe56f('0x62')]()[_0xe56f('0x61')](char(0xa))>=0x0||_0xd59a9f[_0xe56f('0x62')]()['indexOf'](char(0x2c))>=0x0||_0xd59a9f[_0xe56f('0x62')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x3551d5){var _0x1010e8=char(0x22),_0x41ce4e='\x5c'+char(0x22),_0x2de67d=_0x3551d5[_0xe56f('0x62')]()['replace'](new RegExp(_0x1010e8,'g'),_0x41ce4e);return _0x1010e8+_0x2de67d+_0x1010e8;}exports['getSummary']=function(_0x48de58,_0x34b783,_0x110413){var _0x57bf9c,_0x1ad982;var _0x2a6d34={'where':{'ProjectId':_0x48de58[_0xe56f('0x54')]['id']}};if(_0x48de58[_0xe56f('0x30')][_0xe56f('0x63')]){_0x2a6d34['where'][_0xe56f('0x64')]=JSON[_0xe56f('0x65')](_0x48de58[_0xe56f('0x30')][_0xe56f('0x63')]);}return db[_0xe56f('0x5c')]['findAll'](_0x2a6d34)['then'](handleEntityNotFound(_0x34b783,null))[_0xe56f('0x22')](function(_0x2304e4){if(_0x2304e4){_0x57bf9c=_0x2304e4;return db['JscriptyQuestionReport'][_0xe56f('0x44')]({'where':{'SessionId':{'$in':_['map'](_0x57bf9c,'id')},'ProjectId':_0x48de58['params']['id']},'order':_0xe56f('0x66')});}})[_0xe56f('0x22')](handleEntityNotFound(_0x34b783,null))[_0xe56f('0x22')](function(_0xc27ec9){if(_0xc27ec9){_0x1ad982=_0xc27ec9;var _0x562e89={};for(var _0x40e89f=0x0,_0x15f39f=_0x1ad982[_0xe56f('0x37')];_0x40e89f<_0x15f39f;_0x40e89f++){if(!_0x562e89[_0xe56f('0x38')](_0x1ad982[_0x40e89f][_0xe56f('0x67')])){_0x562e89[_0x1ad982[_0x40e89f]['questionId']]=needsEncapsulation(_0x1ad982[_0x40e89f][_0xe56f('0x68')])?encapsulate(_0x1ad982[_0x40e89f]['question']):_0x1ad982[_0x40e89f][_0xe56f('0x68')];}}var _0x1057fb=[],_0x38f221={};for(var _0x68b2cc=0x0,_0x3d2bf9=_0x57bf9c['length'];_0x68b2cc<_0x3d2bf9;_0x68b2cc++){_0x38f221={'ProjectId':_0x48de58[_0xe56f('0x54')]['id'],'SessionId':_0x57bf9c[_0x68b2cc]['id'],'StartTime':moment(_0x57bf9c[_0x68b2cc][_0xe56f('0x64')])[_0xe56f('0x69')](_0xe56f('0x6a'))};for(var _0x5eea97=0x0,_0x102941=_0x1ad982[_0xe56f('0x37')];_0x5eea97<_0x102941;_0x5eea97++){if(_0x1ad982[_0x5eea97][_0xe56f('0x6b')]==_0x57bf9c[_0x68b2cc]['id']&&_0x562e89[_0xe56f('0x38')](_0x1ad982[_0x5eea97][_0xe56f('0x67')])){_0x38f221[_0x562e89[_0x1ad982[_0x5eea97][_0xe56f('0x67')]]]=_0x1ad982[_0x5eea97][_0xe56f('0x6c')];}}for(var _0x3b3bce in _0x562e89){if(!_0x38f221[_0xe56f('0x38')](_0x562e89[_0x3b3bce])){_0x38f221[_0x562e89[_0x3b3bce]]=null;}}_0x1057fb[_0xe56f('0x6d')](_0x38f221);}return _0x1057fb;}})[_0xe56f('0x22')](function(_0x581f51){if(!_[_0xe56f('0x6e')](_0x581f51)){var _0xd948=toCsv(_0x581f51);var _0x417926=Date['now']();fs[_0xe56f('0x6f')](util[_0xe56f('0x69')](_0xe56f('0x70'),_0x48de58[_0xe56f('0x54')]['id'],_0x417926),_0xd948);_0x34b783[_0xe56f('0x71')](_0xe56f('0x72'),_0xe56f('0x73')+util[_0xe56f('0x69')](_0xe56f('0x74'),_0x48de58['params']['id'],_0x417926));_0x34b783[_0xe56f('0x71')]('Content-type','text/csv');return _0x34b783[_0xe56f('0x75')](util[_0xe56f('0x69')](_0xe56f('0x70'),_0x48de58[_0xe56f('0x54')]['id'],_0x417926));}else{return _0x34b783[_0xe56f('0x26')](0xcc);}})[_0xe56f('0x46')](handleError(_0x34b783,null));}; \ No newline at end of file +var _0x0d8b=['mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','reject','save','update','then','get','Projects','UserProfileResource','destroy','end','error','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','keys','create','body','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2f1951,_0x42b796){var _0x12a0a5=function(_0x11123c){while(--_0x11123c){_0x2f1951['push'](_0x2f1951['shift']());}};_0x12a0a5(++_0x42b796);}(_0x0d8b,0x1e6));var _0xb0d8=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x0d8b[_0x5538d5];return _0x323b1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb0d8('0x0'));var zipdir=require(_0xb0d8('0x1'));var jsonpatch=require(_0xb0d8('0x2'));var rp=require(_0xb0d8('0x3'));var moment=require(_0xb0d8('0x4'));var BPromise=require(_0xb0d8('0x5'));var Mustache=require(_0xb0d8('0x6'));var util=require('util');var path=require(_0xb0d8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb0d8('0x8'));var fs=require('fs');var fs_extra=require(_0xb0d8('0x9'));var _=require(_0xb0d8('0xa'));var squel=require(_0xb0d8('0xb'));var crypto=require(_0xb0d8('0xc'));var jsforce=require(_0xb0d8('0xd'));var deskjs=require(_0xb0d8('0xe'));var toCsv=require(_0xb0d8('0xf'));var querystring=require(_0xb0d8('0x10'));var Papa=require('papaparse');var Redis=require(_0xb0d8('0x11'));var authService=require(_0xb0d8('0x12'));var qs=require(_0xb0d8('0x13'));var as=require(_0xb0d8('0x14'));var hardwareService=require(_0xb0d8('0x15'));var logger=require('../../config/logger')(_0xb0d8('0x16'));var utils=require(_0xb0d8('0x17'));var config=require(_0xb0d8('0x18'));var licenseUtil=require(_0xb0d8('0x19'));var db=require(_0xb0d8('0x1a'))['db'];function respondWithStatusCode(_0x1bd3b3,_0x461cec){_0x461cec=_0x461cec||0xcc;return function(_0x2d3763){if(_0x2d3763){return _0x1bd3b3[_0xb0d8('0x1b')](_0x461cec);}return _0x1bd3b3[_0xb0d8('0x1c')](_0x461cec)['end']();};}function respondWithResult(_0x51d290,_0x5af20f){_0x5af20f=_0x5af20f||0xc8;return function(_0x444109){if(_0x444109){return _0x51d290[_0xb0d8('0x1c')](_0x5af20f)[_0xb0d8('0x1d')](_0x444109);}};}function respondWithFilteredResult(_0x2a7ffa,_0x109e40){return function(_0x1ab147){if(_0x1ab147){var _0x198645=typeof _0x109e40[_0xb0d8('0x1e')]===_0xb0d8('0x1f')&&typeof _0x109e40[_0xb0d8('0x20')]==='undefined';var _0x10f772=_0x1ab147[_0xb0d8('0x21')];var _0x3b3695=_0x198645?0x0:_0x109e40[_0xb0d8('0x1e')];var _0x4cfb37=_0x198645?_0x1ab147[_0xb0d8('0x21')]:_0x109e40[_0xb0d8('0x1e')]+_0x109e40[_0xb0d8('0x20')];var _0x484bcb;if(_0x4cfb37>=_0x10f772){_0x4cfb37=_0x10f772;_0x484bcb=0xc8;}else{_0x484bcb=0xce;}_0x2a7ffa['status'](_0x484bcb);return _0x2a7ffa['set']('Content-Range',_0x3b3695+'-'+_0x4cfb37+'/'+_0x10f772)[_0xb0d8('0x1d')](_0x1ab147);}return null;};}function patchUpdates(_0x1b2428){return function(_0x2db988){try{jsonpatch['apply'](_0x2db988,_0x1b2428,!![]);}catch(_0x55c840){return BPromise[_0xb0d8('0x22')](_0x55c840);}return _0x2db988[_0xb0d8('0x23')]();};}function saveUpdates(_0x18e202,_0x481e86){return function(_0xa63793){if(_0xa63793){return _0xa63793[_0xb0d8('0x24')](_0x18e202)[_0xb0d8('0x25')](function(_0x17d953){return _0x17d953;});}return null;};}function removeEntity(_0x2e20c9,_0x2b504e){return function(_0x52fab8){if(_0x52fab8){return _0x52fab8['destroy']()[_0xb0d8('0x25')](function(){var _0x14a553=_0x52fab8[_0xb0d8('0x26')]({'plain':!![]});var _0x503bdf=_0xb0d8('0x27');return db[_0xb0d8('0x28')][_0xb0d8('0x29')]({'where':{'type':_0x503bdf,'resourceId':_0x14a553['id']}})['then'](function(){return _0x52fab8;});})[_0xb0d8('0x25')](function(){_0x2e20c9[_0xb0d8('0x1c')](0xcc)[_0xb0d8('0x2a')]();});}};}function handleEntityNotFound(_0x45bd09,_0x83d3f2){return function(_0x427c6f){if(!_0x427c6f){_0x45bd09[_0xb0d8('0x1b')](0x194);}return _0x427c6f;};}function handleError(_0x42c467,_0x19277e){_0x19277e=_0x19277e||0x1f4;return function(_0x4c99e1){logger[_0xb0d8('0x2b')](_0x4c99e1['stack']);if(_0x4c99e1[_0xb0d8('0x2c')]){delete _0x4c99e1[_0xb0d8('0x2c')];}_0x42c467[_0xb0d8('0x1c')](_0x19277e)[_0xb0d8('0x2d')](_0x4c99e1);};}exports[_0xb0d8('0x2e')]=function(_0x4de8c9,_0x50b797){var _0x37bf88={},_0x3d5a95={},_0x5d4d0f={'count':0x0,'rows':[]};var _0x5044a4=_['map'](db['JscriptyProject'][_0xb0d8('0x2f')],function(_0x2c8737){return{'name':_0x2c8737[_0xb0d8('0x30')],'type':_0x2c8737[_0xb0d8('0x31')]['key']};});_0x3d5a95[_0xb0d8('0x32')]=_[_0xb0d8('0x33')](_0x5044a4,_0xb0d8('0x2c'));_0x3d5a95[_0xb0d8('0x34')]=_['keys'](_0x4de8c9[_0xb0d8('0x34')]);_0x3d5a95[_0xb0d8('0x35')]=_[_0xb0d8('0x36')](_0x3d5a95['model'],_0x3d5a95[_0xb0d8('0x34')]);_0x37bf88[_0xb0d8('0x37')]=_['intersection'](_0x3d5a95[_0xb0d8('0x32')],qs['fields'](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x38')]));_0x37bf88['attributes']=_0x37bf88[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x37bf88[_0xb0d8('0x37')]:_0x3d5a95['model'];if(!_0x4de8c9['query'][_0xb0d8('0x3a')](_0xb0d8('0x3b'))){_0x37bf88['limit']=qs['limit'](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x20')]);_0x37bf88[_0xb0d8('0x1e')]=qs[_0xb0d8('0x1e')](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x1e')]);}_0x37bf88[_0xb0d8('0x3c')]=qs[_0xb0d8('0x3d')](_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x3d')]);_0x37bf88[_0xb0d8('0x3e')]=qs[_0xb0d8('0x35')](_[_0xb0d8('0x3f')](_0x4de8c9[_0xb0d8('0x34')],_0x3d5a95[_0xb0d8('0x35')]),_0x5044a4);if(_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x40')]){_0x37bf88[_0xb0d8('0x3e')]=_[_0xb0d8('0x41')](_0x37bf88[_0xb0d8('0x3e')],{'$or':_[_0xb0d8('0x33')](_0x5044a4,function(_0x15d5af){if(_0x15d5af[_0xb0d8('0x31')]!==_0xb0d8('0x42')){var _0x13acc4={};_0x13acc4[_0x15d5af['name']]={'$like':'%'+_0x4de8c9[_0xb0d8('0x34')][_0xb0d8('0x40')]+'%'};return _0x13acc4;}})});}_0x37bf88=_[_0xb0d8('0x41')]({},_0x37bf88,_0x4de8c9[_0xb0d8('0x43')]);var _0x323280={'where':_0x37bf88[_0xb0d8('0x3e')]};return db['JscriptyProject'][_0xb0d8('0x21')](_0x323280)[_0xb0d8('0x25')](function(_0x68f363){_0x5d4d0f[_0xb0d8('0x21')]=_0x68f363;if(_0x4de8c9['query'][_0xb0d8('0x44')]){_0x37bf88[_0xb0d8('0x45')]=[{'all':!![]}];}return db[_0xb0d8('0x46')][_0xb0d8('0x47')](_0x37bf88);})[_0xb0d8('0x25')](function(_0x1d03ed){_0x5d4d0f[_0xb0d8('0x48')]=_0x1d03ed;return _0x5d4d0f;})[_0xb0d8('0x25')](respondWithFilteredResult(_0x50b797,_0x37bf88))[_0xb0d8('0x49')](handleError(_0x50b797,null));};exports[_0xb0d8('0x4a')]=function(_0x154510,_0x34ac15){var _0x104d86={'raw':![],'where':{'id':_0x154510[_0xb0d8('0x4b')]['id']}},_0x54518b={};_0x54518b[_0xb0d8('0x32')]=_[_0xb0d8('0x4c')](db[_0xb0d8('0x46')][_0xb0d8('0x2f')]);_0x54518b[_0xb0d8('0x34')]=_[_0xb0d8('0x4c')](_0x154510['query']);_0x54518b['filters']=_[_0xb0d8('0x36')](_0x54518b[_0xb0d8('0x32')],_0x54518b['query']);_0x104d86[_0xb0d8('0x37')]=_['intersection'](_0x54518b[_0xb0d8('0x32')],qs['fields'](_0x154510[_0xb0d8('0x34')][_0xb0d8('0x38')]));_0x104d86[_0xb0d8('0x37')]=_0x104d86[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x104d86[_0xb0d8('0x37')]:_0x54518b[_0xb0d8('0x32')];if(_0x154510['query'][_0xb0d8('0x44')]){_0x104d86['include']=[{'all':!![]}];}_0x104d86=_[_0xb0d8('0x41')]({},_0x104d86,_0x154510[_0xb0d8('0x43')]);return db[_0xb0d8('0x46')]['find'](_0x104d86)[_0xb0d8('0x25')](handleEntityNotFound(_0x34ac15,null))[_0xb0d8('0x25')](respondWithResult(_0x34ac15,null))['catch'](handleError(_0x34ac15,null));};exports[_0xb0d8('0x4d')]=function(_0x580176,_0x5e1631){return db[_0xb0d8('0x46')][_0xb0d8('0x4d')](_0x580176[_0xb0d8('0x4e')],{})[_0xb0d8('0x25')](function(_0x3af9f7){var _0x35e011=_0x580176[_0xb0d8('0x4f')]['get']({'plain':!![]});if(!_0x35e011)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35e011[_0xb0d8('0x50')]==='user'){var _0x1e5717=_0x3af9f7[_0xb0d8('0x26')]({'plain':!![]});var _0x53527c=_0xb0d8('0x27');return db[_0xb0d8('0x51')][_0xb0d8('0x52')]({'where':{'name':_0x53527c,'userProfileId':_0x35e011[_0xb0d8('0x53')]},'raw':!![]})[_0xb0d8('0x25')](function(_0xc53131){if(_0xc53131&&_0xc53131[_0xb0d8('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x1e5717[_0xb0d8('0x2c')],'resourceId':_0x1e5717['id'],'type':_0xc53131['name'],'sectionId':_0xc53131['id']},{})[_0xb0d8('0x25')](function(){return _0x3af9f7;});}else{return _0x3af9f7;}})[_0xb0d8('0x49')](function(_0x3a8562){logger[_0xb0d8('0x2b')](_0xb0d8('0x55'),_0x3a8562);throw _0x3a8562;});}return _0x3af9f7;})[_0xb0d8('0x25')](respondWithResult(_0x5e1631,0xc9))[_0xb0d8('0x49')](handleError(_0x5e1631,null));};exports[_0xb0d8('0x56')]=function(_0x149bb7,_0x439967){var _0x410145={'where':{'id':_0x149bb7[_0xb0d8('0x4b')]['id']}},_0x12719a={};_0x12719a[_0xb0d8('0x32')]=_[_0xb0d8('0x4c')](db[_0xb0d8('0x46')][_0xb0d8('0x2f')]);_0x410145[_0xb0d8('0x37')]=_[_0xb0d8('0x36')](_0x12719a['model'],qs[_0xb0d8('0x38')](_0x149bb7['query'][_0xb0d8('0x38')]));_0x410145[_0xb0d8('0x37')]=_0x410145[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x410145[_0xb0d8('0x37')]:_0x12719a[_0xb0d8('0x32')];if(_0x149bb7['query']['includeAll']){_0x410145['include']=[{'all':!![]}];}_0x410145=_['merge']({},_0x410145,_0x149bb7['options']);return db[_0xb0d8('0x46')]['find'](_0x410145)['then'](handleEntityNotFound(_0x439967,null))[_0xb0d8('0x25')](function(_0xf507b9){if(_0xf507b9){var _0x26c477=_0xf507b9[_0xb0d8('0x26')]({'plain':!![]});_0x26c477=qs['omit'](_0x26c477,['id',_0xb0d8('0x57'),_0xb0d8('0x58')]);_0x149bb7[_0xb0d8('0x4e')]=_[_0xb0d8('0x59')](_0x149bb7['body'],['id',_0xb0d8('0x57'),_0xb0d8('0x58')]);return db[_0xb0d8('0x46')][_0xb0d8('0x4d')](_[_0xb0d8('0x41')](_0x26c477,_0x149bb7[_0xb0d8('0x4e')]),{'include':_0x149bb7[_0xb0d8('0x34')][_0xb0d8('0x44')]?[{'all':!![]}]:undefined})[_0xb0d8('0x25')](function(_0x653f37){var _0x3d9f63=_0x149bb7[_0xb0d8('0x4f')][_0xb0d8('0x26')]({'plain':!![]});if(!_0x3d9f63)throw new Error(_0xb0d8('0x5a'));if(_0x3d9f63['role']==='user'){var _0x5b488e=_0x653f37[_0xb0d8('0x26')]({'plain':!![]});var _0x2b5d51=_0xb0d8('0x27');return db[_0xb0d8('0x51')][_0xb0d8('0x52')]({'where':{'name':_0x2b5d51,'userProfileId':_0x3d9f63[_0xb0d8('0x53')]},'raw':!![]})[_0xb0d8('0x25')](function(_0x42719b){if(_0x42719b&&_0x42719b[_0xb0d8('0x54')]===0x0){return db[_0xb0d8('0x28')][_0xb0d8('0x4d')]({'name':_0x5b488e[_0xb0d8('0x2c')],'resourceId':_0x5b488e['id'],'type':_0x42719b['name'],'sectionId':_0x42719b['id']},{})[_0xb0d8('0x25')](function(){return _0x653f37;});}else{return _0x653f37;}})[_0xb0d8('0x49')](function(_0x38ff00){logger[_0xb0d8('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38ff00);throw _0x38ff00;});}return _0x653f37;});}})[_0xb0d8('0x25')](respondWithResult(_0x439967,0xc9))[_0xb0d8('0x49')](handleError(_0x439967,null));};exports[_0xb0d8('0x24')]=function(_0x5e4ebf,_0x5eee29){if(_0x5e4ebf[_0xb0d8('0x4e')]['id']){delete _0x5e4ebf[_0xb0d8('0x4e')]['id'];}return db['JscriptyProject'][_0xb0d8('0x52')]({'where':{'id':_0x5e4ebf[_0xb0d8('0x4b')]['id']}})[_0xb0d8('0x25')](handleEntityNotFound(_0x5eee29,null))['then'](saveUpdates(_0x5e4ebf[_0xb0d8('0x4e')],null))[_0xb0d8('0x25')](respondWithResult(_0x5eee29,null))['catch'](handleError(_0x5eee29,null));};exports[_0xb0d8('0x29')]=function(_0x4881c0,_0x5bba4d){return db[_0xb0d8('0x46')][_0xb0d8('0x52')]({'where':{'id':_0x4881c0[_0xb0d8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5bba4d,null))[_0xb0d8('0x25')](removeEntity(_0x5bba4d,null))[_0xb0d8('0x49')](handleError(_0x5bba4d,null));};exports[_0xb0d8('0x5b')]=function(_0x4e64ad,_0x30632b,_0x28840e){var _0x1f8782={'raw':!![],'where':{}};var _0x41be7a={};var _0x31feca={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xb0d8('0x5c')]({'where':{'id':_0x4e64ad[_0xb0d8('0x4b')]['id']}})[_0xb0d8('0x25')](handleEntityNotFound(_0x30632b,null))[_0xb0d8('0x25')](function(_0x333c9c){if(_0x333c9c){_0x41be7a['model']=_[_0xb0d8('0x4c')](db[_0xb0d8('0x5d')][_0xb0d8('0x2f')]);_0x41be7a['query']=_['keys'](_0x4e64ad[_0xb0d8('0x34')]);_0x41be7a['filters']=_[_0xb0d8('0x36')](_0x41be7a[_0xb0d8('0x32')],_0x41be7a[_0xb0d8('0x34')]);_0x1f8782[_0xb0d8('0x37')]=_[_0xb0d8('0x36')](_0x41be7a['model'],qs[_0xb0d8('0x38')](_0x4e64ad[_0xb0d8('0x34')]['fields']));_0x1f8782['attributes']=_0x1f8782[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x1f8782[_0xb0d8('0x37')]:_0x41be7a[_0xb0d8('0x32')];if(!_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x3a')](_0xb0d8('0x3b'))){_0x1f8782[_0xb0d8('0x20')]=qs[_0xb0d8('0x20')](_0x4e64ad['query']['limit']);_0x1f8782[_0xb0d8('0x1e')]=qs[_0xb0d8('0x1e')](_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x1e')]);}_0x1f8782['order']=qs['sort'](_0x4e64ad['query'][_0xb0d8('0x3d')]);_0x1f8782['where']=qs[_0xb0d8('0x35')](_['pick'](_0x4e64ad[_0xb0d8('0x34')],_0x41be7a[_0xb0d8('0x35')]));_0x1f8782[_0xb0d8('0x3e')]['ProjectId']=_0x333c9c['id'];if(_0x4e64ad[_0xb0d8('0x34')]['filter']){_0x1f8782[_0xb0d8('0x3e')]=_[_0xb0d8('0x41')](_0x1f8782['where'],{'$or':_[_0xb0d8('0x33')](_0x1f8782[_0xb0d8('0x37')],function(_0x423640){var _0x580cb0={};_0x580cb0[_0x423640]={'$like':'%'+_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x40')]+'%'};return _0x580cb0;})});}_0x1f8782=_['merge']({},_0x1f8782,_0x4e64ad[_0xb0d8('0x43')]);return db[_0xb0d8('0x5d')][_0xb0d8('0x21')]({'where':_0x1f8782['where']})[_0xb0d8('0x25')](function(_0x1a26ae){_0x31feca[_0xb0d8('0x21')]=_0x1a26ae;if(_0x4e64ad[_0xb0d8('0x34')][_0xb0d8('0x44')]){_0x1f8782[_0xb0d8('0x45')]=[{'all':!![]}];}return db[_0xb0d8('0x5d')][_0xb0d8('0x47')](_0x1f8782);})['then'](function(_0xa5944){_0x31feca['rows']=_0xa5944;return _0x31feca;});}})[_0xb0d8('0x25')](respondWithFilteredResult(_0x30632b,_0x1f8782))[_0xb0d8('0x49')](handleError(_0x30632b,null));};exports['getAnswers']=function(_0x217a88,_0xf3a09b,_0x364bc0){var _0x47ddd8={'raw':!![],'where':{}};var _0x417fea={};var _0x1f5a71={'count':0x0,'rows':[]};return db[_0xb0d8('0x46')][_0xb0d8('0x5c')]({'where':{'id':_0x217a88[_0xb0d8('0x4b')]['id']}})['then'](handleEntityNotFound(_0xf3a09b,null))[_0xb0d8('0x25')](function(_0x30676f){if(_0x30676f){_0x417fea[_0xb0d8('0x32')]=_[_0xb0d8('0x4c')](db['JscriptyAnswerReport']['rawAttributes']);_0x417fea[_0xb0d8('0x34')]=_[_0xb0d8('0x4c')](_0x217a88[_0xb0d8('0x34')]);_0x417fea[_0xb0d8('0x35')]=_[_0xb0d8('0x36')](_0x417fea['model'],_0x417fea[_0xb0d8('0x34')]);_0x47ddd8['attributes']=_[_0xb0d8('0x36')](_0x417fea['model'],qs[_0xb0d8('0x38')](_0x217a88[_0xb0d8('0x34')]['fields']));_0x47ddd8[_0xb0d8('0x37')]=_0x47ddd8[_0xb0d8('0x37')][_0xb0d8('0x39')]?_0x47ddd8[_0xb0d8('0x37')]:_0x417fea['model'];if(!_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x3a')]('nolimit')){_0x47ddd8[_0xb0d8('0x20')]=qs['limit'](_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x20')]);_0x47ddd8[_0xb0d8('0x1e')]=qs[_0xb0d8('0x1e')](_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x1e')]);}_0x47ddd8[_0xb0d8('0x3c')]=qs[_0xb0d8('0x3d')](_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x3d')]);_0x47ddd8[_0xb0d8('0x3e')]=qs[_0xb0d8('0x35')](_[_0xb0d8('0x3f')](_0x217a88[_0xb0d8('0x34')],_0x417fea[_0xb0d8('0x35')]));_0x47ddd8[_0xb0d8('0x3e')][_0xb0d8('0x5e')]=_0x30676f['id'];if(_0x217a88[_0xb0d8('0x34')][_0xb0d8('0x40')]){_0x47ddd8['where']=_['merge'](_0x47ddd8[_0xb0d8('0x3e')],{'$or':_[_0xb0d8('0x33')](_0x47ddd8[_0xb0d8('0x37')],function(_0x4e26a3){var _0x296e50={};_0x296e50[_0x4e26a3]={'$like':'%'+_0x217a88[_0xb0d8('0x34')]['filter']+'%'};return _0x296e50;})});}_0x47ddd8=_['merge']({},_0x47ddd8,_0x217a88[_0xb0d8('0x43')]);return db[_0xb0d8('0x5f')][_0xb0d8('0x21')]({'where':_0x47ddd8['where']})[_0xb0d8('0x25')](function(_0x228c68){_0x1f5a71[_0xb0d8('0x21')]=_0x228c68;if(_0x217a88[_0xb0d8('0x34')]['includeAll']){_0x47ddd8['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xb0d8('0x47')](_0x47ddd8);})[_0xb0d8('0x25')](function(_0x3f05ab){_0x1f5a71[_0xb0d8('0x48')]=_0x3f05ab;return _0x1f5a71;});}})[_0xb0d8('0x25')](respondWithFilteredResult(_0xf3a09b,_0x47ddd8))[_0xb0d8('0x49')](handleError(_0xf3a09b,null));};function char(_0xc2d3d7){return _0xb0d8('0x60')===typeof _0xc2d3d7?String[_0xb0d8('0x61')][_0xb0d8('0x62')](null,arguments):_0xc2d3d7;}function needsEncapsulation(_0x110a80){return!!_0x110a80&&(_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0xd))>=0x0||_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0xa))>=0x0||_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0x2c))>=0x0||_0x110a80[_0xb0d8('0x63')]()[_0xb0d8('0x64')](char(0x22))>=0x0);}function encapsulate(_0x86076){var _0x409314=char(0x22),_0xdb9ec5='\x5c'+char(0x22),_0x3f3ad3=_0x86076[_0xb0d8('0x63')]()[_0xb0d8('0x65')](new RegExp(_0x409314,'g'),_0xdb9ec5);return _0x409314+_0x3f3ad3+_0x409314;}exports[_0xb0d8('0x66')]=function(_0x454a72,_0x89f865,_0x28272d){var _0x274f02,_0x3b4615;var _0x59e37e={'where':{'ProjectId':_0x454a72[_0xb0d8('0x4b')]['id']}};if(_0x454a72[_0xb0d8('0x34')][_0xb0d8('0x67')]){_0x59e37e[_0xb0d8('0x3e')]['starttime']=JSON['parse'](_0x454a72[_0xb0d8('0x34')]['startTime']);}return db[_0xb0d8('0x5d')][_0xb0d8('0x47')](_0x59e37e)[_0xb0d8('0x25')](handleEntityNotFound(_0x89f865,null))['then'](function(_0x56880b){if(_0x56880b){_0x274f02=_0x56880b;return db[_0xb0d8('0x68')][_0xb0d8('0x47')]({'where':{'SessionId':{'$in':_[_0xb0d8('0x33')](_0x274f02,'id')},'ProjectId':_0x454a72['params']['id']},'order':_0xb0d8('0x69')});}})['then'](handleEntityNotFound(_0x89f865,null))[_0xb0d8('0x25')](function(_0xe6f09b){if(_0xe6f09b){_0x3b4615=_0xe6f09b;var _0x3bf01d={};for(var _0x36c918=0x0,_0x56fb32=_0x3b4615[_0xb0d8('0x39')];_0x36c918<_0x56fb32;_0x36c918++){if(!_0x3bf01d[_0xb0d8('0x3a')](_0x3b4615[_0x36c918][_0xb0d8('0x6a')])){_0x3bf01d[_0x3b4615[_0x36c918][_0xb0d8('0x6a')]]=needsEncapsulation(_0x3b4615[_0x36c918][_0xb0d8('0x6b')])?encapsulate(_0x3b4615[_0x36c918][_0xb0d8('0x6b')]):_0x3b4615[_0x36c918]['question'];}}var _0x51d2be=[],_0x1862e8={};for(var _0x1e2f0a=0x0,_0x5c8939=_0x274f02['length'];_0x1e2f0a<_0x5c8939;_0x1e2f0a++){_0x1862e8={'ProjectId':_0x454a72[_0xb0d8('0x4b')]['id'],'SessionId':_0x274f02[_0x1e2f0a]['id'],'StartTime':moment(_0x274f02[_0x1e2f0a][_0xb0d8('0x6c')])[_0xb0d8('0x6d')](_0xb0d8('0x6e'))};for(var _0x10cc87=0x0,_0x4c0a60=_0x3b4615[_0xb0d8('0x39')];_0x10cc87<_0x4c0a60;_0x10cc87++){if(_0x3b4615[_0x10cc87][_0xb0d8('0x6f')]==_0x274f02[_0x1e2f0a]['id']&&_0x3bf01d[_0xb0d8('0x3a')](_0x3b4615[_0x10cc87][_0xb0d8('0x6a')])){_0x1862e8[_0x3bf01d[_0x3b4615[_0x10cc87][_0xb0d8('0x6a')]]]=_0x3b4615[_0x10cc87]['answer'];}}for(var _0x1190d0 in _0x3bf01d){if(!_0x1862e8[_0xb0d8('0x3a')](_0x3bf01d[_0x1190d0])){_0x1862e8[_0x3bf01d[_0x1190d0]]=null;}}_0x51d2be[_0xb0d8('0x70')](_0x1862e8);}return _0x51d2be;}})[_0xb0d8('0x25')](function(_0x4b1dcb){if(!_['isEmpty'](_0x4b1dcb)){var _0x3135ba=toCsv(_0x4b1dcb);var _0x42b5e6=Date[_0xb0d8('0x71')]();fs[_0xb0d8('0x72')](util[_0xb0d8('0x6d')](_0xb0d8('0x73'),_0x454a72[_0xb0d8('0x4b')]['id'],_0x42b5e6),_0x3135ba);_0x89f865[_0xb0d8('0x74')](_0xb0d8('0x75'),_0xb0d8('0x76')+util[_0xb0d8('0x6d')](_0xb0d8('0x77'),_0x454a72[_0xb0d8('0x4b')]['id'],_0x42b5e6));_0x89f865[_0xb0d8('0x74')](_0xb0d8('0x78'),_0xb0d8('0x79'));return _0x89f865[_0xb0d8('0x7a')](util[_0xb0d8('0x6d')](_0xb0d8('0x73'),_0x454a72[_0xb0d8('0x4b')]['id'],_0x42b5e6));}else{return _0x89f865[_0xb0d8('0x1b')](0xcc);}})['catch'](handleError(_0x89f865,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 4f2bec4..b7d774d 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 _0xbe52=['../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x223324,_0x1d1539){var _0x299cb1=function(_0x59b5ed){while(--_0x59b5ed){_0x223324['push'](_0x223324['shift']());}};_0x299cb1(++_0x1d1539);}(_0xbe52,0x164));var _0x2be5=function(_0x3d02ea,_0x4f7329){_0x3d02ea=_0x3d02ea-0x0;var _0x577443=_0xbe52[_0x3d02ea];return _0x577443;};'use strict';var _=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var logger=require(_0x2be5('0x2'))(_0x2be5('0x3'));var moment=require(_0x2be5('0x4'));var BPromise=require('bluebird');var rp=require(_0x2be5('0x5'));var fs=require('fs');var path=require(_0x2be5('0x6'));var rimraf=require(_0x2be5('0x7'));var config=require(_0x2be5('0x8'));var attributes=require(_0x2be5('0x9'));module[_0x2be5('0xa')]=function(_0x39dc18,_0x13fadf){return _0x39dc18[_0x2be5('0xb')](_0x2be5('0xc'),attributes,{'tableName':_0x2be5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcca7=['request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x4a05e7,_0x22f0df){var _0x126423=function(_0x58f08c){while(--_0x58f08c){_0x4a05e7['push'](_0x4a05e7['shift']());}};_0x126423(++_0x22f0df);}(_0xcca7,0x1aa));var _0x7cca=function(_0x1f7420,_0x46922d){_0x1f7420=_0x1f7420-0x0;var _0x5574ac=_0xcca7[_0x1f7420];return _0x5574ac;};'use strict';var _=require(_0x7cca('0x0'));var util=require(_0x7cca('0x1'));var logger=require(_0x7cca('0x2'))(_0x7cca('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7cca('0x5'));var config=require(_0x7cca('0x6'));var attributes=require(_0x7cca('0x7'));module[_0x7cca('0x8')]=function(_0x1c6c95,_0xe70805){return _0x1c6c95['define']('JscriptyProject',attributes,{'tableName':_0x7cca('0x9'),'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 268c604..68199f1 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1736f2,_0x1269a9){var _0x35001d=function(_0x22718c){while(--_0x22718c){_0x1736f2['push'](_0x1736f2['shift']());}};_0x35001d(++_0x1269a9);}(_0xe706,0xa3));var _0x6e70=function(_0xd8efb0,_0x2fb48b){_0xd8efb0=_0xd8efb0-0x0;var _0x3d962c=_0xe706[_0xd8efb0];return _0x3d962c;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file +var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xac4a,0x13f));var _0xaac4=function(_0x1075dc,_0x22dfae){_0x1075dc=_0x1075dc-0x0;var _0x3409e9=_0xac4a[_0x1075dc];return _0x3409e9;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 4f4f2de..3d1ee41 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 _0x3106=['create','put','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','get','/:id','show','post'];(function(_0x52adee,_0x20252d){var _0x29e410=function(_0x4b7403){while(--_0x4b7403){_0x52adee['push'](_0x52adee['shift']());}};_0x29e410(++_0x20252d);}(_0x3106,0xc3));var _0x6310=function(_0x338189,_0x2bf249){_0x338189=_0x338189-0x0;var _0x2ba81a=_0x3106[_0x338189];return _0x2ba81a;};'use strict';var multer=require(_0x6310('0x0'));var util=require('util');var path=require(_0x6310('0x1'));var timeout=require(_0x6310('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6310('0x3'));var auth=require(_0x6310('0x4'));var interaction=require(_0x6310('0x5'));var config=require(_0x6310('0x6'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth[_0x6310('0x7')](),controller[_0x6310('0x8')]);router['get'](_0x6310('0x9'),auth[_0x6310('0x7')](),controller['describe']);router[_0x6310('0xa')](_0x6310('0xb'),auth[_0x6310('0x7')](),controller[_0x6310('0xc')]);router[_0x6310('0xd')]('/',auth[_0x6310('0x7')](),controller[_0x6310('0xe')]);router[_0x6310('0xf')](_0x6310('0xb'),auth[_0x6310('0x7')](),controller['update']);router[_0x6310('0x10')](_0x6310('0xb'),auth[_0x6310('0x7')](),controller[_0x6310('0x11')]);module[_0x6310('0x12')]=router; \ No newline at end of file +var _0xeaa8=['create','put','/:id','update','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','show','post'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xeaa8,0x16b));var _0x8eaa=function(_0x5ae58c,_0x29a28c){_0x5ae58c=_0x5ae58c-0x0;var _0x4bc987=_0xeaa8[_0x5ae58c];return _0x4bc987;};'use strict';var multer=require('multer');var util=require(_0x8eaa('0x0'));var path=require(_0x8eaa('0x1'));var timeout=require(_0x8eaa('0x2'));var express=require('express');var router=express[_0x8eaa('0x3')]();var fs_extra=require(_0x8eaa('0x4'));var auth=require(_0x8eaa('0x5'));var interaction=require(_0x8eaa('0x6'));var config=require(_0x8eaa('0x7'));var controller=require(_0x8eaa('0x8'));router[_0x8eaa('0x9')]('/',auth[_0x8eaa('0xa')](),controller[_0x8eaa('0xb')]);router['get'](_0x8eaa('0xc'),auth[_0x8eaa('0xa')](),controller['describe']);router[_0x8eaa('0x9')]('/:id',auth[_0x8eaa('0xa')](),controller[_0x8eaa('0xd')]);router[_0x8eaa('0xe')]('/',auth[_0x8eaa('0xa')](),controller[_0x8eaa('0xf')]);router[_0x8eaa('0x10')](_0x8eaa('0x11'),auth[_0x8eaa('0xa')](),controller[_0x8eaa('0x12')]);router['delete'](_0x8eaa('0x11'),auth[_0x8eaa('0xa')](),controller[_0x8eaa('0x13')]);module[_0x8eaa('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 247ce8d..2d3e51a 100644 --- a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js +++ b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x214a19,_0x4b0b2f){_0x214a19=_0x214a19-0x0;var _0x5f4fbc=_0x7a54[_0x214a19];return _0x5f4fbc;};'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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x26065f,_0x503b08){_0x26065f=_0x26065f-0x0;var _0x23f851=_0x7a54[_0x26065f];return _0x23f851;};'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 22cc66e..4da5233 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 _0x3d0d=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','rawAttributes','keys','length','include','find','create','body','destroy','describe','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x5a9f90,_0x4a2f0d){var _0x353b1c=function(_0x20cfd1){while(--_0x20cfd1){_0x5a9f90['push'](_0x5a9f90['shift']());}};_0x353b1c(++_0x4a2f0d);}(_0x3d0d,0x82));var _0xd3d0=function(_0x996310,_0x22ffe1){_0x996310=_0x996310-0x0;var _0x46587a=_0x3d0d[_0x996310];return _0x46587a;};'use strict';var emlformat=require(_0xd3d0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd3d0('0x1'));var BPromise=require(_0xd3d0('0x2'));var Mustache=require(_0xd3d0('0x3'));var util=require(_0xd3d0('0x4'));var path=require(_0xd3d0('0x5'));var sox=require(_0xd3d0('0x6'));var csv=require(_0xd3d0('0x7'));var ejs=require(_0xd3d0('0x8'));var fs=require('fs');var fs_extra=require(_0xd3d0('0x9'));var _=require(_0xd3d0('0xa'));var squel=require(_0xd3d0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd3d0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd3d0('0xd'));var Papa=require(_0xd3d0('0xe'));var Redis=require(_0xd3d0('0xf'));var authService=require(_0xd3d0('0x10'));var qs=require(_0xd3d0('0x11'));var as=require(_0xd3d0('0x12'));var hardwareService=require(_0xd3d0('0x13'));var logger=require(_0xd3d0('0x14'))(_0xd3d0('0x15'));var utils=require(_0xd3d0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd3d0('0x17'));var db=require(_0xd3d0('0x18'))['db'];function respondWithStatusCode(_0x52b25c,_0x3bd696){_0x3bd696=_0x3bd696||0xcc;return function(_0xe5fe05){if(_0xe5fe05){return _0x52b25c[_0xd3d0('0x19')](_0x3bd696);}return _0x52b25c[_0xd3d0('0x1a')](_0x3bd696)[_0xd3d0('0x1b')]();};}function respondWithResult(_0x430ac0,_0x5c429e){_0x5c429e=_0x5c429e||0xc8;return function(_0x4117e6){if(_0x4117e6){return _0x430ac0[_0xd3d0('0x1a')](_0x5c429e)[_0xd3d0('0x1c')](_0x4117e6);}};}function respondWithFilteredResult(_0x47a832,_0x16a9e4){return function(_0x2fcaab){if(_0x2fcaab){var _0x13fba4=typeof _0x16a9e4[_0xd3d0('0x1d')]===_0xd3d0('0x1e')&&typeof _0x16a9e4[_0xd3d0('0x1f')]==='undefined';var _0x21fb26=_0x2fcaab[_0xd3d0('0x20')];var _0xf28842=_0x13fba4?0x0:_0x16a9e4[_0xd3d0('0x1d')];var _0x4ffd8a=_0x13fba4?_0x2fcaab[_0xd3d0('0x20')]:_0x16a9e4[_0xd3d0('0x1d')]+_0x16a9e4[_0xd3d0('0x1f')];var _0x5bad3b;if(_0x4ffd8a>=_0x21fb26){_0x4ffd8a=_0x21fb26;_0x5bad3b=0xc8;}else{_0x5bad3b=0xce;}_0x47a832[_0xd3d0('0x1a')](_0x5bad3b);return _0x47a832[_0xd3d0('0x21')](_0xd3d0('0x22'),_0xf28842+'-'+_0x4ffd8a+'/'+_0x21fb26)['json'](_0x2fcaab);}return null;};}function patchUpdates(_0x13fceb){return function(_0x18a39e){try{jsonpatch[_0xd3d0('0x23')](_0x18a39e,_0x13fceb,!![]);}catch(_0xa7efc2){return BPromise[_0xd3d0('0x24')](_0xa7efc2);}return _0x18a39e[_0xd3d0('0x25')]();};}function saveUpdates(_0x5a5982,_0xcd4cf1){return function(_0x361bc1){if(_0x361bc1){return _0x361bc1[_0xd3d0('0x26')](_0x5a5982)[_0xd3d0('0x27')](function(_0x12d9ef){return _0x12d9ef;});}return null;};}function removeEntity(_0x2a91b9,_0x24745c){return function(_0x1336eb){if(_0x1336eb){return _0x1336eb['destroy']()['then'](function(){_0x2a91b9['status'](0xcc)[_0xd3d0('0x1b')]();});}};}function handleEntityNotFound(_0x185c7f,_0x54ae4b){return function(_0xd1f5cd){if(!_0xd1f5cd){_0x185c7f[_0xd3d0('0x19')](0x194);}return _0xd1f5cd;};}function handleError(_0x32fe0b,_0x15467e){_0x15467e=_0x15467e||0x1f4;return function(_0x4a5c06){logger[_0xd3d0('0x28')](_0x4a5c06[_0xd3d0('0x29')]);if(_0x4a5c06[_0xd3d0('0x2a')]){delete _0x4a5c06[_0xd3d0('0x2a')];}_0x32fe0b['status'](_0x15467e)[_0xd3d0('0x2b')](_0x4a5c06);};}exports[_0xd3d0('0x2c')]=function(_0x5d661c,_0x3a24d7){var _0x52c2c4={},_0x4c182a={},_0x473a81={'count':0x0,'rows':[]};var _0xeeced0=_[_0xd3d0('0x2d')](db[_0xd3d0('0x2e')]['rawAttributes'],function(_0x81f47a){return{'name':_0x81f47a[_0xd3d0('0x2f')],'type':_0x81f47a[_0xd3d0('0x30')][_0xd3d0('0x31')]};});_0x4c182a[_0xd3d0('0x32')]=_[_0xd3d0('0x2d')](_0xeeced0,_0xd3d0('0x2a'));_0x4c182a[_0xd3d0('0x33')]=_['keys'](_0x5d661c[_0xd3d0('0x33')]);_0x4c182a[_0xd3d0('0x34')]=_[_0xd3d0('0x35')](_0x4c182a[_0xd3d0('0x32')],_0x4c182a[_0xd3d0('0x33')]);_0x52c2c4[_0xd3d0('0x36')]=_[_0xd3d0('0x35')](_0x4c182a['model'],qs[_0xd3d0('0x37')](_0x5d661c['query'][_0xd3d0('0x37')]));_0x52c2c4[_0xd3d0('0x36')]=_0x52c2c4[_0xd3d0('0x36')]['length']?_0x52c2c4[_0xd3d0('0x36')]:_0x4c182a[_0xd3d0('0x32')];if(!_0x5d661c[_0xd3d0('0x33')][_0xd3d0('0x38')](_0xd3d0('0x39'))){_0x52c2c4[_0xd3d0('0x1f')]=qs[_0xd3d0('0x1f')](_0x5d661c[_0xd3d0('0x33')][_0xd3d0('0x1f')]);_0x52c2c4[_0xd3d0('0x1d')]=qs['offset'](_0x5d661c[_0xd3d0('0x33')][_0xd3d0('0x1d')]);}_0x52c2c4['order']=qs[_0xd3d0('0x3a')](_0x5d661c[_0xd3d0('0x33')][_0xd3d0('0x3a')]);_0x52c2c4[_0xd3d0('0x3b')]=qs[_0xd3d0('0x34')](_[_0xd3d0('0x3c')](_0x5d661c[_0xd3d0('0x33')],_0x4c182a['filters']),_0xeeced0);if(_0x5d661c[_0xd3d0('0x33')][_0xd3d0('0x3d')]){_0x52c2c4[_0xd3d0('0x3b')]=_['merge'](_0x52c2c4['where'],{'$or':_[_0xd3d0('0x2d')](_0xeeced0,function(_0x21d91b){if(_0x21d91b[_0xd3d0('0x30')]!==_0xd3d0('0x3e')){var _0x4bb7bd={};_0x4bb7bd[_0x21d91b[_0xd3d0('0x2a')]]={'$like':'%'+_0x5d661c['query']['filter']+'%'};return _0x4bb7bd;}})});}_0x52c2c4=_[_0xd3d0('0x3f')]({},_0x52c2c4,_0x5d661c[_0xd3d0('0x40')]);var _0x356c3c={'where':_0x52c2c4[_0xd3d0('0x3b')]};return db[_0xd3d0('0x2e')][_0xd3d0('0x20')](_0x356c3c)[_0xd3d0('0x27')](function(_0x22d012){_0x473a81[_0xd3d0('0x20')]=_0x22d012;if(_0x5d661c[_0xd3d0('0x33')][_0xd3d0('0x41')]){_0x52c2c4['include']=[{'all':!![]}];}return db[_0xd3d0('0x2e')]['findAll'](_0x52c2c4);})[_0xd3d0('0x27')](function(_0x1ef8c7){_0x473a81[_0xd3d0('0x42')]=_0x1ef8c7;return _0x473a81;})[_0xd3d0('0x27')](respondWithFilteredResult(_0x3a24d7,_0x52c2c4))[_0xd3d0('0x43')](handleError(_0x3a24d7,null));};exports[_0xd3d0('0x44')]=function(_0x1e2fe0,_0x1f66f8){var _0x49b176={'raw':!![],'where':{'id':_0x1e2fe0[_0xd3d0('0x45')]['id']}},_0x4393e6={};_0x4393e6['model']=_['keys'](db[_0xd3d0('0x2e')][_0xd3d0('0x46')]);_0x4393e6['query']=_[_0xd3d0('0x47')](_0x1e2fe0[_0xd3d0('0x33')]);_0x4393e6['filters']=_[_0xd3d0('0x35')](_0x4393e6[_0xd3d0('0x32')],_0x4393e6['query']);_0x49b176[_0xd3d0('0x36')]=_[_0xd3d0('0x35')](_0x4393e6[_0xd3d0('0x32')],qs['fields'](_0x1e2fe0[_0xd3d0('0x33')][_0xd3d0('0x37')]));_0x49b176[_0xd3d0('0x36')]=_0x49b176[_0xd3d0('0x36')][_0xd3d0('0x48')]?_0x49b176[_0xd3d0('0x36')]:_0x4393e6[_0xd3d0('0x32')];if(_0x1e2fe0[_0xd3d0('0x33')][_0xd3d0('0x41')]){_0x49b176[_0xd3d0('0x49')]=[{'all':!![]}];}_0x49b176=_['merge']({},_0x49b176,_0x1e2fe0['options']);return db['JscriptyQuestionReport'][_0xd3d0('0x4a')](_0x49b176)[_0xd3d0('0x27')](handleEntityNotFound(_0x1f66f8,null))[_0xd3d0('0x27')](respondWithResult(_0x1f66f8,null))['catch'](handleError(_0x1f66f8,null));};exports[_0xd3d0('0x4b')]=function(_0x156d5c,_0x4b2f7c){return db[_0xd3d0('0x2e')][_0xd3d0('0x4b')](_0x156d5c[_0xd3d0('0x4c')],{})['then'](respondWithResult(_0x4b2f7c,0xc9))['catch'](handleError(_0x4b2f7c,null));};exports[_0xd3d0('0x26')]=function(_0x55ac4d,_0x270a0e){if(_0x55ac4d[_0xd3d0('0x4c')]['id']){delete _0x55ac4d['body']['id'];}return db[_0xd3d0('0x2e')][_0xd3d0('0x4a')]({'where':{'id':_0x55ac4d[_0xd3d0('0x45')]['id']}})[_0xd3d0('0x27')](handleEntityNotFound(_0x270a0e,null))[_0xd3d0('0x27')](saveUpdates(_0x55ac4d[_0xd3d0('0x4c')],null))['then'](respondWithResult(_0x270a0e,null))[_0xd3d0('0x43')](handleError(_0x270a0e,null));};exports[_0xd3d0('0x4d')]=function(_0x1e2b6b,_0x514d6a){return db[_0xd3d0('0x2e')]['find']({'where':{'id':_0x1e2b6b[_0xd3d0('0x45')]['id']}})['then'](handleEntityNotFound(_0x514d6a,null))[_0xd3d0('0x27')](removeEntity(_0x514d6a,null))[_0xd3d0('0x43')](handleError(_0x514d6a,null));};exports[_0xd3d0('0x4e')]=function(_0x5a7435,_0x468582){return db[_0xd3d0('0x2e')][_0xd3d0('0x4e')]()['then'](respondWithResult(_0x468582,null))[_0xd3d0('0x43')](handleError(_0x468582,null));}; \ No newline at end of file +var _0x77ac=['offset','Content-Range','apply','reject','save','destroy','then','end','error','name','index','map','JscriptyQuestionReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','params','fields','include','find','create','body','update','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','limit','undefined','count'];(function(_0x4735c8,_0x299642){var _0x5c0a52=function(_0x1cfed9){while(--_0x1cfed9){_0x4735c8['push'](_0x4735c8['shift']());}};_0x5c0a52(++_0x299642);}(_0x77ac,0x1a3));var _0xc77a=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x77ac[_0xd1d19a];return _0x52a79d;};'use strict';var emlformat=require(_0xc77a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc77a('0x1'));var jsonpatch=require(_0xc77a('0x2'));var rp=require(_0xc77a('0x3'));var moment=require(_0xc77a('0x4'));var BPromise=require(_0xc77a('0x5'));var Mustache=require(_0xc77a('0x6'));var util=require(_0xc77a('0x7'));var path=require(_0xc77a('0x8'));var sox=require(_0xc77a('0x9'));var csv=require(_0xc77a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc77a('0xb'));var _=require(_0xc77a('0xc'));var squel=require(_0xc77a('0xd'));var crypto=require(_0xc77a('0xe'));var jsforce=require(_0xc77a('0xf'));var deskjs=require(_0xc77a('0x10'));var toCsv=require(_0xc77a('0xa'));var querystring=require('querystring');var Papa=require(_0xc77a('0x11'));var Redis=require(_0xc77a('0x12'));var authService=require(_0xc77a('0x13'));var qs=require(_0xc77a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc77a('0x15'));var logger=require(_0xc77a('0x16'))('api');var utils=require(_0xc77a('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc77a('0x18'))['db'];function respondWithStatusCode(_0xff736b,_0x5a9362){_0x5a9362=_0x5a9362||0xcc;return function(_0x3f35b7){if(_0x3f35b7){return _0xff736b[_0xc77a('0x19')](_0x5a9362);}return _0xff736b['status'](_0x5a9362)['end']();};}function respondWithResult(_0x130586,_0x54a9b0){_0x54a9b0=_0x54a9b0||0xc8;return function(_0x39cc55){if(_0x39cc55){return _0x130586[_0xc77a('0x1a')](_0x54a9b0)[_0xc77a('0x1b')](_0x39cc55);}};}function respondWithFilteredResult(_0x43a7ea,_0x5a6124){return function(_0x51133e){if(_0x51133e){var _0x160a35=typeof _0x5a6124['offset']==='undefined'&&typeof _0x5a6124[_0xc77a('0x1c')]===_0xc77a('0x1d');var _0x35a4d2=_0x51133e[_0xc77a('0x1e')];var _0x1243dc=_0x160a35?0x0:_0x5a6124[_0xc77a('0x1f')];var _0x4122bf=_0x160a35?_0x51133e[_0xc77a('0x1e')]:_0x5a6124[_0xc77a('0x1f')]+_0x5a6124[_0xc77a('0x1c')];var _0x418569;if(_0x4122bf>=_0x35a4d2){_0x4122bf=_0x35a4d2;_0x418569=0xc8;}else{_0x418569=0xce;}_0x43a7ea[_0xc77a('0x1a')](_0x418569);return _0x43a7ea['set'](_0xc77a('0x20'),_0x1243dc+'-'+_0x4122bf+'/'+_0x35a4d2)[_0xc77a('0x1b')](_0x51133e);}return null;};}function patchUpdates(_0xb1cc56){return function(_0x2bf6ba){try{jsonpatch[_0xc77a('0x21')](_0x2bf6ba,_0xb1cc56,!![]);}catch(_0x49c3b5){return BPromise[_0xc77a('0x22')](_0x49c3b5);}return _0x2bf6ba[_0xc77a('0x23')]();};}function saveUpdates(_0x4292b8,_0x46a962){return function(_0x54f5c0){if(_0x54f5c0){return _0x54f5c0['update'](_0x4292b8)['then'](function(_0x1353bc){return _0x1353bc;});}return null;};}function removeEntity(_0x1b04c6,_0x221eb9){return function(_0x45baae){if(_0x45baae){return _0x45baae[_0xc77a('0x24')]()[_0xc77a('0x25')](function(){_0x1b04c6[_0xc77a('0x1a')](0xcc)[_0xc77a('0x26')]();});}};}function handleEntityNotFound(_0x2dd453,_0x43c9f5){return function(_0x132a6f){if(!_0x132a6f){_0x2dd453[_0xc77a('0x19')](0x194);}return _0x132a6f;};}function handleError(_0x26d418,_0x268745){_0x268745=_0x268745||0x1f4;return function(_0x44f22a){logger[_0xc77a('0x27')](_0x44f22a['stack']);if(_0x44f22a[_0xc77a('0x28')]){delete _0x44f22a[_0xc77a('0x28')];}_0x26d418[_0xc77a('0x1a')](_0x268745)['send'](_0x44f22a);};}exports[_0xc77a('0x29')]=function(_0x4422ab,_0x164942){var _0x2b2543={},_0x57d31d={},_0x10cb2a={'count':0x0,'rows':[]};var _0x25e5b2=_[_0xc77a('0x2a')](db[_0xc77a('0x2b')]['rawAttributes'],function(_0x4a0d6a){return{'name':_0x4a0d6a[_0xc77a('0x2c')],'type':_0x4a0d6a[_0xc77a('0x2d')][_0xc77a('0x2e')]};});_0x57d31d[_0xc77a('0x2f')]=_[_0xc77a('0x2a')](_0x25e5b2,'name');_0x57d31d['query']=_[_0xc77a('0x30')](_0x4422ab[_0xc77a('0x31')]);_0x57d31d[_0xc77a('0x32')]=_[_0xc77a('0x33')](_0x57d31d[_0xc77a('0x2f')],_0x57d31d['query']);_0x2b2543['attributes']=_[_0xc77a('0x33')](_0x57d31d[_0xc77a('0x2f')],qs['fields'](_0x4422ab[_0xc77a('0x31')]['fields']));_0x2b2543[_0xc77a('0x34')]=_0x2b2543[_0xc77a('0x34')][_0xc77a('0x35')]?_0x2b2543[_0xc77a('0x34')]:_0x57d31d['model'];if(!_0x4422ab['query'][_0xc77a('0x36')]('nolimit')){_0x2b2543[_0xc77a('0x1c')]=qs['limit'](_0x4422ab[_0xc77a('0x31')][_0xc77a('0x1c')]);_0x2b2543[_0xc77a('0x1f')]=qs[_0xc77a('0x1f')](_0x4422ab[_0xc77a('0x31')][_0xc77a('0x1f')]);}_0x2b2543[_0xc77a('0x37')]=qs[_0xc77a('0x38')](_0x4422ab[_0xc77a('0x31')][_0xc77a('0x38')]);_0x2b2543[_0xc77a('0x39')]=qs[_0xc77a('0x32')](_[_0xc77a('0x3a')](_0x4422ab[_0xc77a('0x31')],_0x57d31d[_0xc77a('0x32')]),_0x25e5b2);if(_0x4422ab[_0xc77a('0x31')]['filter']){_0x2b2543[_0xc77a('0x39')]=_[_0xc77a('0x3b')](_0x2b2543[_0xc77a('0x39')],{'$or':_['map'](_0x25e5b2,function(_0xaea4c4){if(_0xaea4c4[_0xc77a('0x2d')]!==_0xc77a('0x3c')){var _0x3c221d={};_0x3c221d[_0xaea4c4[_0xc77a('0x28')]]={'$like':'%'+_0x4422ab['query'][_0xc77a('0x3d')]+'%'};return _0x3c221d;}})});}_0x2b2543=_[_0xc77a('0x3b')]({},_0x2b2543,_0x4422ab[_0xc77a('0x3e')]);var _0x3b5db2={'where':_0x2b2543[_0xc77a('0x39')]};return db[_0xc77a('0x2b')][_0xc77a('0x1e')](_0x3b5db2)['then'](function(_0x39fa52){_0x10cb2a[_0xc77a('0x1e')]=_0x39fa52;if(_0x4422ab[_0xc77a('0x31')][_0xc77a('0x3f')]){_0x2b2543['include']=[{'all':!![]}];}return db[_0xc77a('0x2b')][_0xc77a('0x40')](_0x2b2543);})[_0xc77a('0x25')](function(_0x28bd0c){_0x10cb2a[_0xc77a('0x41')]=_0x28bd0c;return _0x10cb2a;})[_0xc77a('0x25')](respondWithFilteredResult(_0x164942,_0x2b2543))[_0xc77a('0x42')](handleError(_0x164942,null));};exports['show']=function(_0x66115,_0x68cc60){var _0x328933={'raw':!![],'where':{'id':_0x66115[_0xc77a('0x43')]['id']}},_0xb1f89c={};_0xb1f89c[_0xc77a('0x2f')]=_[_0xc77a('0x30')](db[_0xc77a('0x2b')]['rawAttributes']);_0xb1f89c[_0xc77a('0x31')]=_['keys'](_0x66115['query']);_0xb1f89c[_0xc77a('0x32')]=_['intersection'](_0xb1f89c[_0xc77a('0x2f')],_0xb1f89c[_0xc77a('0x31')]);_0x328933[_0xc77a('0x34')]=_[_0xc77a('0x33')](_0xb1f89c[_0xc77a('0x2f')],qs['fields'](_0x66115[_0xc77a('0x31')][_0xc77a('0x44')]));_0x328933[_0xc77a('0x34')]=_0x328933['attributes'][_0xc77a('0x35')]?_0x328933[_0xc77a('0x34')]:_0xb1f89c[_0xc77a('0x2f')];if(_0x66115['query']['includeAll']){_0x328933[_0xc77a('0x45')]=[{'all':!![]}];}_0x328933=_[_0xc77a('0x3b')]({},_0x328933,_0x66115[_0xc77a('0x3e')]);return db[_0xc77a('0x2b')][_0xc77a('0x46')](_0x328933)['then'](handleEntityNotFound(_0x68cc60,null))[_0xc77a('0x25')](respondWithResult(_0x68cc60,null))[_0xc77a('0x42')](handleError(_0x68cc60,null));};exports[_0xc77a('0x47')]=function(_0x3dfc92,_0xe190da){return db[_0xc77a('0x2b')][_0xc77a('0x47')](_0x3dfc92[_0xc77a('0x48')],{})['then'](respondWithResult(_0xe190da,0xc9))[_0xc77a('0x42')](handleError(_0xe190da,null));};exports[_0xc77a('0x49')]=function(_0x2de406,_0x38994e){if(_0x2de406[_0xc77a('0x48')]['id']){delete _0x2de406[_0xc77a('0x48')]['id'];}return db[_0xc77a('0x2b')][_0xc77a('0x46')]({'where':{'id':_0x2de406[_0xc77a('0x43')]['id']}})[_0xc77a('0x25')](handleEntityNotFound(_0x38994e,null))[_0xc77a('0x25')](saveUpdates(_0x2de406[_0xc77a('0x48')],null))[_0xc77a('0x25')](respondWithResult(_0x38994e,null))['catch'](handleError(_0x38994e,null));};exports['destroy']=function(_0x3126f7,_0x1ca974){return db[_0xc77a('0x2b')][_0xc77a('0x46')]({'where':{'id':_0x3126f7['params']['id']}})[_0xc77a('0x25')](handleEntityNotFound(_0x1ca974,null))[_0xc77a('0x25')](removeEntity(_0x1ca974,null))[_0xc77a('0x42')](handleError(_0x1ca974,null));};exports['describe']=function(_0x206dd8,_0x1fe2ca){return db['JscriptyQuestionReport'][_0xc77a('0x4a')]()[_0xc77a('0x25')](respondWithResult(_0x1fe2ca,null))[_0xc77a('0x42')](handleError(_0x1fe2ca,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 3acbc05..b91c294 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 _0x1d58=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x1e0b5e,_0x353205){var _0x3f7d59=function(_0x56ae8a){while(--_0x56ae8a){_0x1e0b5e['push'](_0x1e0b5e['shift']());}};_0x3f7d59(++_0x353205);}(_0x1d58,0xf6));var _0x81d5=function(_0x533f6d,_0x5469e7){_0x533f6d=_0x533f6d-0x0;var _0x26ca6a=_0x1d58[_0x533f6d];return _0x26ca6a;};'use strict';var _=require(_0x81d5('0x0'));var util=require(_0x81d5('0x1'));var logger=require(_0x81d5('0x2'))(_0x81d5('0x3'));var moment=require(_0x81d5('0x4'));var BPromise=require(_0x81d5('0x5'));var rp=require(_0x81d5('0x6'));var fs=require('fs');var path=require(_0x81d5('0x7'));var rimraf=require(_0x81d5('0x8'));var config=require(_0x81d5('0x9'));var attributes=require(_0x81d5('0xa'));module['exports']=function(_0x41ab44,_0x558f1d){return _0x41ab44['define'](_0x81d5('0xb'),attributes,{'tableName':_0x81d5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb6b=['request-promise','path','../../config/environment','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','bluebird'];(function(_0x499b56,_0x175726){var _0x4fa77f=function(_0x46ac23){while(--_0x46ac23){_0x499b56['push'](_0x499b56['shift']());}};_0x4fa77f(++_0x175726);}(_0xdb6b,0x10f));var _0xbdb6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdb6b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xbdb6('0x0'));var util=require(_0xbdb6('0x1'));var logger=require('../../config/logger')(_0xbdb6('0x2'));var moment=require('moment');var BPromise=require(_0xbdb6('0x3'));var rp=require(_0xbdb6('0x4'));var fs=require('fs');var path=require(_0xbdb6('0x5'));var rimraf=require('rimraf');var config=require(_0xbdb6('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xbdb6('0x7')]=function(_0x3946cd,_0x592af8){return _0x3946cd[_0xbdb6('0x8')](_0xbdb6('0x9'),attributes,{'tableName':_0xbdb6('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 66e727e..4cc3699 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 _0x9201=['http','request','then','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x9201,0xf4));var _0x1920=function(_0x10d149,_0x4771ac){_0x10d149=_0x10d149-0x0;var _0x29590a=_0x9201[_0x10d149];return _0x29590a;};'use strict';var _=require('lodash');var util=require(_0x1920('0x0'));var moment=require(_0x1920('0x1'));var BPromise=require('bluebird');var rs=require(_0x1920('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1920('0x3'));var logger=require(_0x1920('0x4'))('rpc');var config=require(_0x1920('0x5'));var jayson=require(_0x1920('0x6'));var client=jayson[_0x1920('0x7')][_0x1920('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x477282,_0x4cc308,_0x53dc57){return new BPromise(function(_0x5c6d01,_0xda9122){return client[_0x1920('0x9')](_0x477282,_0x53dc57)[_0x1920('0xa')](function(_0xf956ba){logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4cc308,_0x1920('0xb'));logger[_0x1920('0xc')](_0x1920('0xd'),_0x4cc308,'request\x20sent',JSON['stringify'](_0xf956ba));if(_0xf956ba[_0x1920('0xe')]){if(_0xf956ba[_0x1920('0xe')][_0x1920('0xf')]===0x1f4){logger[_0x1920('0xe')](_0x1920('0x10'),_0x4cc308,_0xf956ba[_0x1920('0xe')][_0x1920('0x11')]);return _0xda9122(_0xf956ba[_0x1920('0xe')][_0x1920('0x11')]);}logger[_0x1920('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4cc308,_0xf956ba[_0x1920('0xe')][_0x1920('0x11')]);return _0x5c6d01(_0xf956ba[_0x1920('0xe')]['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4cc308,'request\x20sent');_0x5c6d01(_0xf956ba['result'][_0x1920('0x11')]);}})['catch'](function(_0x2d3b53){logger[_0x1920('0xe')](_0x1920('0x10'),_0x4cc308,_0x2d3b53);_0xda9122(_0x2d3b53);});});} \ No newline at end of file +var _0x7929=['request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x7929,0xe4));var _0x9792=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7929[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0x9792('0x0'));var util=require(_0x9792('0x1'));var moment=require('moment');var BPromise=require(_0x9792('0x2'));var rs=require(_0x9792('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9792('0x4'));var config=require(_0x9792('0x5'));var jayson=require(_0x9792('0x6'));var client=jayson['client'][_0x9792('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x21a0ab,_0x46fddf,_0x5e9649){return new BPromise(function(_0x1df1fa,_0x275833){return client[_0x9792('0x8')](_0x21a0ab,_0x5e9649)[_0x9792('0x9')](function(_0x34025f){logger[_0x9792('0xa')](_0x9792('0xb'),_0x46fddf,_0x9792('0xc'));logger['debug'](_0x9792('0xd'),_0x46fddf,_0x9792('0xc'),JSON[_0x9792('0xe')](_0x34025f));if(_0x34025f['error']){if(_0x34025f[_0x9792('0xf')][_0x9792('0x10')]===0x1f4){logger[_0x9792('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x46fddf,_0x34025f['error'][_0x9792('0x11')]);return _0x275833(_0x34025f[_0x9792('0xf')][_0x9792('0x11')]);}logger[_0x9792('0xf')](_0x9792('0xb'),_0x46fddf,_0x34025f['error'][_0x9792('0x11')]);return _0x1df1fa(_0x34025f[_0x9792('0xf')][_0x9792('0x11')]);}else{logger['info'](_0x9792('0xb'),_0x46fddf,_0x9792('0xc'));_0x1df1fa(_0x34025f[_0x9792('0x12')][_0x9792('0x11')]);}})[_0x9792('0x13')](function(_0x5d785a){logger[_0x9792('0xf')](_0x9792('0xb'),_0x46fddf,_0x5d785a);_0x275833(_0x5d785a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 85cce6a..f9cbeb1 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 _0xbc13=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','/:id/questions','getQuestions','post','create','put','update','exports','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbc13,0xa1));var _0x3bc1=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xbc13[_0x40ddc0];return _0x1aebf1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3bc1('0x0'));var timeout=require(_0x3bc1('0x1'));var express=require('express');var router=express[_0x3bc1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3bc1('0x3'));var interaction=require(_0x3bc1('0x4'));var config=require(_0x3bc1('0x5'));var controller=require('./jscriptySessionReport.controller');router[_0x3bc1('0x6')]('/',auth['isAuthenticated'](),controller[_0x3bc1('0x7')]);router['get'](_0x3bc1('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x3bc1('0x6')](_0x3bc1('0x9'),auth[_0x3bc1('0xa')](),controller['show']);router['get'](_0x3bc1('0xb'),auth[_0x3bc1('0xa')](),controller[_0x3bc1('0xc')]);router[_0x3bc1('0xd')]('/',auth['isAuthenticated'](),controller[_0x3bc1('0xe')]);router[_0x3bc1('0xf')](_0x3bc1('0x9'),auth[_0x3bc1('0xa')](),controller[_0x3bc1('0x10')]);router['delete'](_0x3bc1('0x9'),auth[_0x3bc1('0xa')](),controller['destroy']);module[_0x3bc1('0x11')]=router; \ No newline at end of file +var _0xc461=['update','delete','destroy','multer','path','connect-timeout','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','create'];(function(_0x56d16b,_0x21a53c){var _0x28ff30=function(_0x3aeadb){while(--_0x3aeadb){_0x56d16b['push'](_0x56d16b['shift']());}};_0x28ff30(++_0x21a53c);}(_0xc461,0xd3));var _0x1c46=function(_0x21e679,_0x53b326){_0x21e679=_0x21e679-0x0;var _0x2e1f70=_0xc461[_0x21e679];return _0x2e1f70;};'use strict';var multer=require(_0x1c46('0x0'));var util=require('util');var path=require(_0x1c46('0x1'));var timeout=require(_0x1c46('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1c46('0x3'));router[_0x1c46('0x4')]('/',auth[_0x1c46('0x5')](),controller[_0x1c46('0x6')]);router[_0x1c46('0x4')](_0x1c46('0x7'),auth[_0x1c46('0x5')](),controller[_0x1c46('0x8')]);router['get'](_0x1c46('0x9'),auth[_0x1c46('0x5')](),controller[_0x1c46('0xa')]);router[_0x1c46('0x4')](_0x1c46('0xb'),auth[_0x1c46('0x5')](),controller['getQuestions']);router['post']('/',auth[_0x1c46('0x5')](),controller[_0x1c46('0xc')]);router['put'](_0x1c46('0x9'),auth[_0x1c46('0x5')](),controller[_0x1c46('0xd')]);router[_0x1c46('0xe')](_0x1c46('0x9'),auth[_0x1c46('0x5')](),controller[_0x1c46('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index c6e29dc..fa27fe5 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 _0x43a5=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','sequelize','exports'];(function(_0x28c608,_0x432ee1){var _0x3ace3e=function(_0xea6cf7){while(--_0xea6cf7){_0x28c608['push'](_0x28c608['shift']());}};_0x3ace3e(++_0x432ee1);}(_0x43a5,0x196));var _0x543a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x43a5[_0x122ef9];return _0x42fba0;};'use strict';var moment=require('moment');var Sequelize=require(_0x543a('0x0'));module[_0x543a('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x5b324c){this['setDataValue'](_0x543a('0x2'),_0x5b324c);this['setDataValue'](_0x543a('0x3'),moment()[_0x543a('0x4')](_0x543a('0x5')));}},'endtime':{'type':Sequelize[_0x543a('0x6')]},'membername':{'type':Sequelize[_0x543a('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x543a('0x7')]},'uniqueid':{'type':Sequelize[_0x543a('0x7')]},'calleridname':{'type':Sequelize[_0x543a('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7dbe=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','exports','setDataValue'];(function(_0x4f229e,_0x1b1e6c){var _0x407c5e=function(_0x1f094f){while(--_0x1f094f){_0x4f229e['push'](_0x4f229e['shift']());}};_0x407c5e(++_0x1b1e6c);}(_0x7dbe,0x183));var _0xe7db=function(_0x190e91,_0x44c97a){_0x190e91=_0x190e91-0x0;var _0x1f0fdd=_0x7dbe[_0x190e91];return _0x1f0fdd;};'use strict';var moment=require(_0xe7db('0x0'));var Sequelize=require('sequelize');module[_0xe7db('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x58de97){this[_0xe7db('0x2')](_0xe7db('0x3'),_0x58de97);this['setDataValue'](_0xe7db('0x4'),moment()[_0xe7db('0x5')](_0xe7db('0x6')));}},'endtime':{'type':Sequelize[_0xe7db('0x7')]},'membername':{'type':Sequelize[_0xe7db('0x8')]},'projectname':{'type':Sequelize[_0xe7db('0x8')]},'queue':{'type':Sequelize[_0xe7db('0x8')]},'uniqueid':{'type':Sequelize[_0xe7db('0x8')]},'calleridname':{'type':Sequelize[_0xe7db('0x8')]},'calleridnum':{'type':Sequelize[_0xe7db('0x8')]},'completed':{'type':Sequelize[_0xe7db('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 a68b792..d416080 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 _0x1bb6=['status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','describe','getQuestions','hasOwnProperty','pick','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x1bb6,0xe1));var _0x61bb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1bb6[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0x61bb('0x0'));var rimraf=require(_0x61bb('0x1'));var zipdir=require(_0x61bb('0x2'));var jsonpatch=require(_0x61bb('0x3'));var rp=require(_0x61bb('0x4'));var moment=require(_0x61bb('0x5'));var BPromise=require(_0x61bb('0x6'));var Mustache=require('mustache');var util=require(_0x61bb('0x7'));var path=require(_0x61bb('0x8'));var sox=require(_0x61bb('0x9'));var csv=require(_0x61bb('0xa'));var ejs=require(_0x61bb('0xb'));var fs=require('fs');var fs_extra=require(_0x61bb('0xc'));var _=require(_0x61bb('0xd'));var squel=require(_0x61bb('0xe'));var crypto=require(_0x61bb('0xf'));var jsforce=require(_0x61bb('0x10'));var deskjs=require(_0x61bb('0x11'));var toCsv=require('to-csv');var querystring=require(_0x61bb('0x12'));var Papa=require(_0x61bb('0x13'));var Redis=require(_0x61bb('0x14'));var authService=require(_0x61bb('0x15'));var qs=require(_0x61bb('0x16'));var as=require(_0x61bb('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x61bb('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x61bb('0x19'));var licenseUtil=require(_0x61bb('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x464312,_0xf2d5b2){_0xf2d5b2=_0xf2d5b2||0xcc;return function(_0x1929a5){if(_0x1929a5){return _0x464312['sendStatus'](_0xf2d5b2);}return _0x464312['status'](_0xf2d5b2)['end']();};}function respondWithResult(_0x3d22b9,_0x4fa253){_0x4fa253=_0x4fa253||0xc8;return function(_0x23e7d6){if(_0x23e7d6){return _0x3d22b9[_0x61bb('0x1b')](_0x4fa253)['json'](_0x23e7d6);}};}function respondWithFilteredResult(_0x2fe76e,_0x2cea67){return function(_0x28e22c){if(_0x28e22c){var _0x53983d=typeof _0x2cea67[_0x61bb('0x1c')]==='undefined'&&typeof _0x2cea67[_0x61bb('0x1d')]===_0x61bb('0x1e');var _0x3b56d2=_0x28e22c[_0x61bb('0x1f')];var _0x30eecf=_0x53983d?0x0:_0x2cea67['offset'];var _0x142c0e=_0x53983d?_0x28e22c[_0x61bb('0x1f')]:_0x2cea67[_0x61bb('0x1c')]+_0x2cea67[_0x61bb('0x1d')];var _0x3d9e23;if(_0x142c0e>=_0x3b56d2){_0x142c0e=_0x3b56d2;_0x3d9e23=0xc8;}else{_0x3d9e23=0xce;}_0x2fe76e['status'](_0x3d9e23);return _0x2fe76e[_0x61bb('0x20')](_0x61bb('0x21'),_0x30eecf+'-'+_0x142c0e+'/'+_0x3b56d2)[_0x61bb('0x22')](_0x28e22c);}return null;};}function patchUpdates(_0x353ec4){return function(_0xb2e5f){try{jsonpatch[_0x61bb('0x23')](_0xb2e5f,_0x353ec4,!![]);}catch(_0x249b1f){return BPromise['reject'](_0x249b1f);}return _0xb2e5f[_0x61bb('0x24')]();};}function saveUpdates(_0x20e59c,_0x1ac93c){return function(_0x3c2047){if(_0x3c2047){return _0x3c2047[_0x61bb('0x25')](_0x20e59c)[_0x61bb('0x26')](function(_0x3e9998){return _0x3e9998;});}return null;};}function removeEntity(_0x11d3b8,_0x40d4fc){return function(_0x144528){if(_0x144528){return _0x144528[_0x61bb('0x27')]()[_0x61bb('0x26')](function(){_0x11d3b8[_0x61bb('0x1b')](0xcc)[_0x61bb('0x28')]();});}};}function handleEntityNotFound(_0x4f82d7,_0x37eae2){return function(_0x540705){if(!_0x540705){_0x4f82d7[_0x61bb('0x29')](0x194);}return _0x540705;};}function handleError(_0x19102f,_0xb88446){_0xb88446=_0xb88446||0x1f4;return function(_0x556fa0){logger[_0x61bb('0x2a')](_0x556fa0[_0x61bb('0x2b')]);if(_0x556fa0['name']){delete _0x556fa0[_0x61bb('0x2c')];}_0x19102f['status'](_0xb88446)[_0x61bb('0x2d')](_0x556fa0);};}exports[_0x61bb('0x2e')]=function(_0x1d7ae2,_0x77fe54){var _0x3ead3e={},_0x593db8={},_0x3c7632={'count':0x0,'rows':[]};var _0x46339d=_['map'](db[_0x61bb('0x2f')][_0x61bb('0x30')],function(_0x20896){return{'name':_0x20896[_0x61bb('0x31')],'type':_0x20896[_0x61bb('0x32')]['key']};});_0x593db8['model']=_[_0x61bb('0x33')](_0x46339d,'name');_0x593db8['query']=_[_0x61bb('0x34')](_0x1d7ae2[_0x61bb('0x35')]);_0x593db8[_0x61bb('0x36')]=_[_0x61bb('0x37')](_0x593db8[_0x61bb('0x38')],_0x593db8[_0x61bb('0x35')]);_0x3ead3e[_0x61bb('0x39')]=_[_0x61bb('0x37')](_0x593db8[_0x61bb('0x38')],qs[_0x61bb('0x3a')](_0x1d7ae2[_0x61bb('0x35')][_0x61bb('0x3a')]));_0x3ead3e[_0x61bb('0x39')]=_0x3ead3e[_0x61bb('0x39')][_0x61bb('0x3b')]?_0x3ead3e['attributes']:_0x593db8[_0x61bb('0x38')];if(!_0x1d7ae2[_0x61bb('0x35')]['hasOwnProperty'](_0x61bb('0x3c'))){_0x3ead3e['limit']=qs[_0x61bb('0x1d')](_0x1d7ae2['query']['limit']);_0x3ead3e[_0x61bb('0x1c')]=qs['offset'](_0x1d7ae2[_0x61bb('0x35')][_0x61bb('0x1c')]);}_0x3ead3e[_0x61bb('0x3d')]=qs[_0x61bb('0x3e')](_0x1d7ae2[_0x61bb('0x35')][_0x61bb('0x3e')]);_0x3ead3e[_0x61bb('0x3f')]=qs['filters'](_['pick'](_0x1d7ae2[_0x61bb('0x35')],_0x593db8[_0x61bb('0x36')]),_0x46339d);if(_0x1d7ae2[_0x61bb('0x35')][_0x61bb('0x40')]){_0x3ead3e[_0x61bb('0x3f')]=_[_0x61bb('0x41')](_0x3ead3e[_0x61bb('0x3f')],{'$or':_[_0x61bb('0x33')](_0x46339d,function(_0x547bf4){if(_0x547bf4[_0x61bb('0x32')]!==_0x61bb('0x42')){var _0x294028={};_0x294028[_0x547bf4[_0x61bb('0x2c')]]={'$like':'%'+_0x1d7ae2['query']['filter']+'%'};return _0x294028;}})});}_0x3ead3e=_[_0x61bb('0x41')]({},_0x3ead3e,_0x1d7ae2['options']);var _0x4611b0={'where':_0x3ead3e['where']};return db['JscriptySessionReport'][_0x61bb('0x1f')](_0x4611b0)[_0x61bb('0x26')](function(_0xb743fc){_0x3c7632['count']=_0xb743fc;if(_0x1d7ae2[_0x61bb('0x35')][_0x61bb('0x43')]){_0x3ead3e[_0x61bb('0x44')]=[{'all':!![]}];}return db[_0x61bb('0x2f')][_0x61bb('0x45')](_0x3ead3e);})[_0x61bb('0x26')](function(_0x1286c8){_0x3c7632[_0x61bb('0x46')]=_0x1286c8;return _0x3c7632;})['then'](respondWithFilteredResult(_0x77fe54,_0x3ead3e))['catch'](handleError(_0x77fe54,null));};exports[_0x61bb('0x47')]=function(_0x1e29ea,_0x2e6ab4){var _0x25221b={'raw':!![],'where':{'id':_0x1e29ea['params']['id']}},_0x3fd694={};_0x3fd694[_0x61bb('0x38')]=_[_0x61bb('0x34')](db['JscriptySessionReport'][_0x61bb('0x30')]);_0x3fd694['query']=_['keys'](_0x1e29ea[_0x61bb('0x35')]);_0x3fd694[_0x61bb('0x36')]=_[_0x61bb('0x37')](_0x3fd694[_0x61bb('0x38')],_0x3fd694[_0x61bb('0x35')]);_0x25221b[_0x61bb('0x39')]=_[_0x61bb('0x37')](_0x3fd694[_0x61bb('0x38')],qs[_0x61bb('0x3a')](_0x1e29ea[_0x61bb('0x35')][_0x61bb('0x3a')]));_0x25221b[_0x61bb('0x39')]=_0x25221b[_0x61bb('0x39')][_0x61bb('0x3b')]?_0x25221b[_0x61bb('0x39')]:_0x3fd694[_0x61bb('0x38')];if(_0x1e29ea[_0x61bb('0x35')][_0x61bb('0x43')]){_0x25221b[_0x61bb('0x44')]=[{'all':!![]}];}_0x25221b=_['merge']({},_0x25221b,_0x1e29ea[_0x61bb('0x48')]);return db['JscriptySessionReport'][_0x61bb('0x49')](_0x25221b)[_0x61bb('0x26')](handleEntityNotFound(_0x2e6ab4,null))[_0x61bb('0x26')](respondWithResult(_0x2e6ab4,null))[_0x61bb('0x4a')](handleError(_0x2e6ab4,null));};exports[_0x61bb('0x4b')]=function(_0x412881,_0x278ba5){return db[_0x61bb('0x2f')][_0x61bb('0x4b')](_0x412881[_0x61bb('0x4c')],{})[_0x61bb('0x26')](respondWithResult(_0x278ba5,0xc9))[_0x61bb('0x4a')](handleError(_0x278ba5,null));};exports[_0x61bb('0x25')]=function(_0x575108,_0x54ad2c){if(_0x575108[_0x61bb('0x4c')]['id']){delete _0x575108[_0x61bb('0x4c')]['id'];}return db[_0x61bb('0x2f')][_0x61bb('0x49')]({'where':{'id':_0x575108[_0x61bb('0x4d')]['id']}})[_0x61bb('0x26')](handleEntityNotFound(_0x54ad2c,null))[_0x61bb('0x26')](saveUpdates(_0x575108[_0x61bb('0x4c')],null))[_0x61bb('0x26')](respondWithResult(_0x54ad2c,null))[_0x61bb('0x4a')](handleError(_0x54ad2c,null));};exports[_0x61bb('0x27')]=function(_0x55dbe2,_0x4f3d7d){return db['JscriptySessionReport'][_0x61bb('0x49')]({'where':{'id':_0x55dbe2[_0x61bb('0x4d')]['id']}})[_0x61bb('0x26')](handleEntityNotFound(_0x4f3d7d,null))[_0x61bb('0x26')](removeEntity(_0x4f3d7d,null))['catch'](handleError(_0x4f3d7d,null));};exports['describe']=function(_0x358227,_0x642881){return db[_0x61bb('0x2f')][_0x61bb('0x4e')]()[_0x61bb('0x26')](respondWithResult(_0x642881,null))[_0x61bb('0x4a')](handleError(_0x642881,null));};exports[_0x61bb('0x4f')]=function(_0x595194,_0x25192c,_0x4da0bc){var _0x529e0c={'raw':!![],'where':{}};var _0x7ed585={};var _0x1555d5={'count':0x0,'rows':[]};return db[_0x61bb('0x2f')]['findOne']({'where':{'id':_0x595194[_0x61bb('0x4d')]['id']}})[_0x61bb('0x26')](handleEntityNotFound(_0x25192c,null))[_0x61bb('0x26')](function(_0x3ee7ac){if(_0x3ee7ac){_0x7ed585[_0x61bb('0x38')]=_['keys'](db['JscriptyQuestionReport'][_0x61bb('0x30')]);_0x7ed585['query']=_[_0x61bb('0x34')](_0x595194[_0x61bb('0x35')]);_0x7ed585[_0x61bb('0x36')]=_['intersection'](_0x7ed585[_0x61bb('0x38')],_0x7ed585[_0x61bb('0x35')]);_0x529e0c[_0x61bb('0x39')]=_['intersection'](_0x7ed585['model'],qs[_0x61bb('0x3a')](_0x595194[_0x61bb('0x35')][_0x61bb('0x3a')]));_0x529e0c['attributes']=_0x529e0c[_0x61bb('0x39')][_0x61bb('0x3b')]?_0x529e0c['attributes']:_0x7ed585[_0x61bb('0x38')];if(!_0x595194[_0x61bb('0x35')][_0x61bb('0x50')](_0x61bb('0x3c'))){_0x529e0c['limit']=qs['limit'](_0x595194['query']['limit']);_0x529e0c[_0x61bb('0x1c')]=qs[_0x61bb('0x1c')](_0x595194[_0x61bb('0x35')][_0x61bb('0x1c')]);}_0x529e0c[_0x61bb('0x3d')]=qs[_0x61bb('0x3e')](_0x595194[_0x61bb('0x35')]['sort']);_0x529e0c['where']=qs[_0x61bb('0x36')](_[_0x61bb('0x51')](_0x595194[_0x61bb('0x35')],_0x7ed585[_0x61bb('0x36')]));_0x529e0c['where'][_0x61bb('0x52')]=_0x3ee7ac['id'];if(_0x595194[_0x61bb('0x35')][_0x61bb('0x40')]){_0x529e0c[_0x61bb('0x3f')]=_[_0x61bb('0x41')](_0x529e0c[_0x61bb('0x3f')],{'$or':_[_0x61bb('0x33')](_0x529e0c[_0x61bb('0x39')],function(_0x4605e1){var _0x2baa90={};_0x2baa90[_0x4605e1]={'$like':'%'+_0x595194[_0x61bb('0x35')]['filter']+'%'};return _0x2baa90;})});}_0x529e0c=_['merge']({},_0x529e0c,_0x595194[_0x61bb('0x48')]);return db[_0x61bb('0x53')]['count']({'where':_0x529e0c[_0x61bb('0x3f')]})[_0x61bb('0x26')](function(_0x13611e){_0x1555d5['count']=_0x13611e;if(_0x595194[_0x61bb('0x35')][_0x61bb('0x43')]){_0x529e0c[_0x61bb('0x44')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0x61bb('0x45')](_0x529e0c);})['then'](function(_0x58730d){_0x1555d5[_0x61bb('0x46')]=_0x58730d;return _0x1555d5;});}})[_0x61bb('0x26')](respondWithFilteredResult(_0x25192c,_0x529e0c))[_0x61bb('0x4a')](handleError(_0x25192c,null));}; \ No newline at end of file +var _0x48da=['moment','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','JscriptySessionReport','includeAll','findAll','rows','catch','show','params','keys','include','create','body','find','describe','getQuestions','findOne','nolimit','order','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2d0818,_0x16d1a9){var _0x466400=function(_0x3955d1){while(--_0x3955d1){_0x2d0818['push'](_0x2d0818['shift']());}};_0x466400(++_0x16d1a9);}(_0x48da,0x13c));var _0xa48d=function(_0x566a0f,_0x728aab){_0x566a0f=_0x566a0f-0x0;var _0x382bb5=_0x48da[_0x566a0f];return _0x382bb5;};'use strict';var emlformat=require(_0xa48d('0x0'));var rimraf=require(_0xa48d('0x1'));var zipdir=require(_0xa48d('0x2'));var jsonpatch=require(_0xa48d('0x3'));var rp=require('request-promise');var moment=require(_0xa48d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa48d('0x5'));var util=require(_0xa48d('0x6'));var path=require(_0xa48d('0x7'));var sox=require('sox');var csv=require(_0xa48d('0x8'));var ejs=require(_0xa48d('0x9'));var fs=require('fs');var fs_extra=require(_0xa48d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa48d('0xb'));var jsforce=require(_0xa48d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa48d('0x8'));var querystring=require(_0xa48d('0xd'));var Papa=require(_0xa48d('0xe'));var Redis=require(_0xa48d('0xf'));var authService=require(_0xa48d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa48d('0x11'));var hardwareService=require(_0xa48d('0x12'));var logger=require(_0xa48d('0x13'))(_0xa48d('0x14'));var utils=require(_0xa48d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa48d('0x16'));var db=require(_0xa48d('0x17'))['db'];function respondWithStatusCode(_0x31ebc9,_0x41ebae){_0x41ebae=_0x41ebae||0xcc;return function(_0x4fb588){if(_0x4fb588){return _0x31ebc9[_0xa48d('0x18')](_0x41ebae);}return _0x31ebc9[_0xa48d('0x19')](_0x41ebae)[_0xa48d('0x1a')]();};}function respondWithResult(_0x23a5f0,_0x721c82){_0x721c82=_0x721c82||0xc8;return function(_0x1b7b75){if(_0x1b7b75){return _0x23a5f0[_0xa48d('0x19')](_0x721c82)[_0xa48d('0x1b')](_0x1b7b75);}};}function respondWithFilteredResult(_0x430db7,_0x427ee9){return function(_0x4efeb8){if(_0x4efeb8){var _0x4b1088=typeof _0x427ee9[_0xa48d('0x1c')]===_0xa48d('0x1d')&&typeof _0x427ee9[_0xa48d('0x1e')]==='undefined';var _0x137e7a=_0x4efeb8[_0xa48d('0x1f')];var _0x32548b=_0x4b1088?0x0:_0x427ee9['offset'];var _0x5d0ce7=_0x4b1088?_0x4efeb8[_0xa48d('0x1f')]:_0x427ee9[_0xa48d('0x1c')]+_0x427ee9[_0xa48d('0x1e')];var _0x21d980;if(_0x5d0ce7>=_0x137e7a){_0x5d0ce7=_0x137e7a;_0x21d980=0xc8;}else{_0x21d980=0xce;}_0x430db7['status'](_0x21d980);return _0x430db7['set'](_0xa48d('0x20'),_0x32548b+'-'+_0x5d0ce7+'/'+_0x137e7a)['json'](_0x4efeb8);}return null;};}function patchUpdates(_0x229eab){return function(_0x5515fb){try{jsonpatch[_0xa48d('0x21')](_0x5515fb,_0x229eab,!![]);}catch(_0x184a43){return BPromise[_0xa48d('0x22')](_0x184a43);}return _0x5515fb[_0xa48d('0x23')]();};}function saveUpdates(_0x58a537,_0x547089){return function(_0x36901b){if(_0x36901b){return _0x36901b[_0xa48d('0x24')](_0x58a537)[_0xa48d('0x25')](function(_0x3c0dba){return _0x3c0dba;});}return null;};}function removeEntity(_0x8b2017,_0x1e4a49){return function(_0x4ac801){if(_0x4ac801){return _0x4ac801[_0xa48d('0x26')]()['then'](function(){_0x8b2017[_0xa48d('0x19')](0xcc)[_0xa48d('0x1a')]();});}};}function handleEntityNotFound(_0x4c3d1b,_0x10914a){return function(_0x576023){if(!_0x576023){_0x4c3d1b[_0xa48d('0x18')](0x194);}return _0x576023;};}function handleError(_0x24e52e,_0x57d242){_0x57d242=_0x57d242||0x1f4;return function(_0x542ffb){logger[_0xa48d('0x27')](_0x542ffb['stack']);if(_0x542ffb[_0xa48d('0x28')]){delete _0x542ffb[_0xa48d('0x28')];}_0x24e52e[_0xa48d('0x19')](_0x57d242)['send'](_0x542ffb);};}exports['index']=function(_0x4c2b99,_0x16333a){var _0xfd3758={},_0x5815da={},_0x24592f={'count':0x0,'rows':[]};var _0x5bbaa7=_[_0xa48d('0x29')](db['JscriptySessionReport'][_0xa48d('0x2a')],function(_0x1ce6e5){return{'name':_0x1ce6e5[_0xa48d('0x2b')],'type':_0x1ce6e5[_0xa48d('0x2c')][_0xa48d('0x2d')]};});_0x5815da[_0xa48d('0x2e')]=_[_0xa48d('0x29')](_0x5bbaa7,_0xa48d('0x28'));_0x5815da[_0xa48d('0x2f')]=_['keys'](_0x4c2b99[_0xa48d('0x2f')]);_0x5815da['filters']=_[_0xa48d('0x30')](_0x5815da['model'],_0x5815da[_0xa48d('0x2f')]);_0xfd3758[_0xa48d('0x31')]=_[_0xa48d('0x30')](_0x5815da['model'],qs['fields'](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x32')]));_0xfd3758[_0xa48d('0x31')]=_0xfd3758[_0xa48d('0x31')][_0xa48d('0x33')]?_0xfd3758[_0xa48d('0x31')]:_0x5815da['model'];if(!_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x34')]('nolimit')){_0xfd3758[_0xa48d('0x1e')]=qs['limit'](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x1e')]);_0xfd3758['offset']=qs['offset'](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x1c')]);}_0xfd3758['order']=qs[_0xa48d('0x35')](_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x35')]);_0xfd3758[_0xa48d('0x36')]=qs['filters'](_[_0xa48d('0x37')](_0x4c2b99[_0xa48d('0x2f')],_0x5815da[_0xa48d('0x38')]),_0x5bbaa7);if(_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x39')]){_0xfd3758['where']=_[_0xa48d('0x3a')](_0xfd3758[_0xa48d('0x36')],{'$or':_[_0xa48d('0x29')](_0x5bbaa7,function(_0x12e64a){if(_0x12e64a[_0xa48d('0x2c')]!==_0xa48d('0x3b')){var _0xe6ac8={};_0xe6ac8[_0x12e64a[_0xa48d('0x28')]]={'$like':'%'+_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x39')]+'%'};return _0xe6ac8;}})});}_0xfd3758=_['merge']({},_0xfd3758,_0x4c2b99[_0xa48d('0x3c')]);var _0x55b3e2={'where':_0xfd3758[_0xa48d('0x36')]};return db[_0xa48d('0x3d')][_0xa48d('0x1f')](_0x55b3e2)[_0xa48d('0x25')](function(_0x321716){_0x24592f[_0xa48d('0x1f')]=_0x321716;if(_0x4c2b99[_0xa48d('0x2f')][_0xa48d('0x3e')]){_0xfd3758['include']=[{'all':!![]}];}return db[_0xa48d('0x3d')][_0xa48d('0x3f')](_0xfd3758);})[_0xa48d('0x25')](function(_0x49d2ec){_0x24592f[_0xa48d('0x40')]=_0x49d2ec;return _0x24592f;})[_0xa48d('0x25')](respondWithFilteredResult(_0x16333a,_0xfd3758))[_0xa48d('0x41')](handleError(_0x16333a,null));};exports[_0xa48d('0x42')]=function(_0xe9f0ba,_0x209f9e){var _0x76481d={'raw':!![],'where':{'id':_0xe9f0ba[_0xa48d('0x43')]['id']}},_0x6083fe={};_0x6083fe[_0xa48d('0x2e')]=_['keys'](db['JscriptySessionReport'][_0xa48d('0x2a')]);_0x6083fe[_0xa48d('0x2f')]=_[_0xa48d('0x44')](_0xe9f0ba['query']);_0x6083fe[_0xa48d('0x38')]=_[_0xa48d('0x30')](_0x6083fe['model'],_0x6083fe[_0xa48d('0x2f')]);_0x76481d[_0xa48d('0x31')]=_['intersection'](_0x6083fe[_0xa48d('0x2e')],qs[_0xa48d('0x32')](_0xe9f0ba['query']['fields']));_0x76481d[_0xa48d('0x31')]=_0x76481d[_0xa48d('0x31')]['length']?_0x76481d['attributes']:_0x6083fe[_0xa48d('0x2e')];if(_0xe9f0ba[_0xa48d('0x2f')][_0xa48d('0x3e')]){_0x76481d[_0xa48d('0x45')]=[{'all':!![]}];}_0x76481d=_['merge']({},_0x76481d,_0xe9f0ba[_0xa48d('0x3c')]);return db['JscriptySessionReport']['find'](_0x76481d)[_0xa48d('0x25')](handleEntityNotFound(_0x209f9e,null))[_0xa48d('0x25')](respondWithResult(_0x209f9e,null))[_0xa48d('0x41')](handleError(_0x209f9e,null));};exports[_0xa48d('0x46')]=function(_0x56ac39,_0x586f1e){return db[_0xa48d('0x3d')]['create'](_0x56ac39[_0xa48d('0x47')],{})[_0xa48d('0x25')](respondWithResult(_0x586f1e,0xc9))['catch'](handleError(_0x586f1e,null));};exports[_0xa48d('0x24')]=function(_0x223765,_0x3c5934){if(_0x223765['body']['id']){delete _0x223765[_0xa48d('0x47')]['id'];}return db['JscriptySessionReport'][_0xa48d('0x48')]({'where':{'id':_0x223765['params']['id']}})[_0xa48d('0x25')](handleEntityNotFound(_0x3c5934,null))[_0xa48d('0x25')](saveUpdates(_0x223765['body'],null))[_0xa48d('0x25')](respondWithResult(_0x3c5934,null))['catch'](handleError(_0x3c5934,null));};exports['destroy']=function(_0x1f0b73,_0x16d094){return db['JscriptySessionReport']['find']({'where':{'id':_0x1f0b73['params']['id']}})[_0xa48d('0x25')](handleEntityNotFound(_0x16d094,null))[_0xa48d('0x25')](removeEntity(_0x16d094,null))[_0xa48d('0x41')](handleError(_0x16d094,null));};exports[_0xa48d('0x49')]=function(_0x9fd1ed,_0x2d6d81){return db[_0xa48d('0x3d')]['describe']()[_0xa48d('0x25')](respondWithResult(_0x2d6d81,null))[_0xa48d('0x41')](handleError(_0x2d6d81,null));};exports[_0xa48d('0x4a')]=function(_0x47a772,_0x22daaa,_0x4a8242){var _0x5e41d6={'raw':!![],'where':{}};var _0x16e310={};var _0x180ad6={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xa48d('0x4b')]({'where':{'id':_0x47a772['params']['id']}})[_0xa48d('0x25')](handleEntityNotFound(_0x22daaa,null))[_0xa48d('0x25')](function(_0x1e6d63){if(_0x1e6d63){_0x16e310[_0xa48d('0x2e')]=_[_0xa48d('0x44')](db['JscriptyQuestionReport'][_0xa48d('0x2a')]);_0x16e310[_0xa48d('0x2f')]=_[_0xa48d('0x44')](_0x47a772[_0xa48d('0x2f')]);_0x16e310[_0xa48d('0x38')]=_[_0xa48d('0x30')](_0x16e310[_0xa48d('0x2e')],_0x16e310[_0xa48d('0x2f')]);_0x5e41d6['attributes']=_[_0xa48d('0x30')](_0x16e310[_0xa48d('0x2e')],qs[_0xa48d('0x32')](_0x47a772[_0xa48d('0x2f')][_0xa48d('0x32')]));_0x5e41d6['attributes']=_0x5e41d6['attributes'][_0xa48d('0x33')]?_0x5e41d6['attributes']:_0x16e310[_0xa48d('0x2e')];if(!_0x47a772['query'][_0xa48d('0x34')](_0xa48d('0x4c'))){_0x5e41d6[_0xa48d('0x1e')]=qs['limit'](_0x47a772['query']['limit']);_0x5e41d6[_0xa48d('0x1c')]=qs['offset'](_0x47a772['query']['offset']);}_0x5e41d6[_0xa48d('0x4d')]=qs[_0xa48d('0x35')](_0x47a772[_0xa48d('0x2f')][_0xa48d('0x35')]);_0x5e41d6['where']=qs[_0xa48d('0x38')](_[_0xa48d('0x37')](_0x47a772[_0xa48d('0x2f')],_0x16e310[_0xa48d('0x38')]));_0x5e41d6[_0xa48d('0x36')][_0xa48d('0x4e')]=_0x1e6d63['id'];if(_0x47a772[_0xa48d('0x2f')][_0xa48d('0x39')]){_0x5e41d6[_0xa48d('0x36')]=_[_0xa48d('0x3a')](_0x5e41d6[_0xa48d('0x36')],{'$or':_['map'](_0x5e41d6[_0xa48d('0x31')],function(_0x9f7e66){var _0x3bd1c3={};_0x3bd1c3[_0x9f7e66]={'$like':'%'+_0x47a772['query'][_0xa48d('0x39')]+'%'};return _0x3bd1c3;})});}_0x5e41d6=_[_0xa48d('0x3a')]({},_0x5e41d6,_0x47a772[_0xa48d('0x3c')]);return db[_0xa48d('0x4f')][_0xa48d('0x1f')]({'where':_0x5e41d6[_0xa48d('0x36')]})['then'](function(_0x2c2a02){_0x180ad6[_0xa48d('0x1f')]=_0x2c2a02;if(_0x47a772[_0xa48d('0x2f')][_0xa48d('0x3e')]){_0x5e41d6[_0xa48d('0x45')]=[{'all':!![]}];}return db[_0xa48d('0x4f')]['findAll'](_0x5e41d6);})['then'](function(_0x3df79f){_0x180ad6[_0xa48d('0x40')]=_0x3df79f;return _0x180ad6;});}})[_0xa48d('0x25')](respondWithFilteredResult(_0x22daaa,_0x5e41d6))[_0xa48d('0x41')](handleError(_0x22daaa,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 6f5c964..77e8c32 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 _0x6455=['request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird'];(function(_0x56d674,_0xee31de){var _0x1d339a=function(_0x21ab31){while(--_0x21ab31){_0x56d674['push'](_0x56d674['shift']());}};_0x1d339a(++_0xee31de);}(_0x6455,0x97));var _0x5645=function(_0x16cf48,_0x2b543e){_0x16cf48=_0x16cf48-0x0;var _0x9b4f40=_0x6455[_0x16cf48];return _0x9b4f40;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038b=['report_jscripty_sessions','util','../../config/logger','api','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x5a948b,_0x59a3e5){var _0x49561f=function(_0x5b3d21){while(--_0x5b3d21){_0x5a948b['push'](_0x5a948b['shift']());}};_0x49561f(++_0x59a3e5);}(_0x038b,0x114));var _0xb038=function(_0xc66bb4,_0x1a4c72){_0xc66bb4=_0xc66bb4-0x0;var _0x3165fb=_0x038b[_0xc66bb4];return _0x3165fb;};'use strict';var _=require('lodash');var util=require(_0xb038('0x0'));var logger=require(_0xb038('0x1'))(_0xb038('0x2'));var moment=require('moment');var BPromise=require(_0xb038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb038('0x4'));var rimraf=require(_0xb038('0x5'));var config=require('../../config/environment');var attributes=require(_0xb038('0x6'));module[_0xb038('0x7')]=function(_0x4fe092,_0x54e1e7){return _0x4fe092[_0xb038('0x8')](_0xb038('0x9'),attributes,{'tableName':_0xb038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index dc5743b..93e34f5 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 _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x248ed1,_0xe6d777){var _0x20b010=function(_0x6113de){while(--_0x6113de){_0x248ed1['push'](_0x248ed1['shift']());}};_0x20b010(++_0xe6d777);}(_0x7880,0x1f4));var _0x0788=function(_0x48e6f1,_0x1bd3e8){_0x48e6f1=_0x48e6f1-0x0;var _0x154ae1=_0x7880[_0x48e6f1];return _0x154ae1;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});} \ No newline at end of file +var _0xe3da=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s'];(function(_0x333e36,_0x3766b7){var _0x3a6847=function(_0x374481){while(--_0x374481){_0x333e36['push'](_0x333e36['shift']());}};_0x3a6847(++_0x3766b7);}(_0xe3da,0x1cd));var _0xae3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe3da[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var moment=require(_0xae3d('0x2'));var BPromise=require(_0xae3d('0x3'));var rs=require(_0xae3d('0x4'));var fs=require('fs');var Redis=require(_0xae3d('0x5'));var db=require(_0xae3d('0x6'))['db'];var utils=require(_0xae3d('0x7'));var logger=require(_0xae3d('0x8'))(_0xae3d('0x9'));var config=require(_0xae3d('0xa'));var jayson=require(_0xae3d('0xb'));var client=jayson[_0xae3d('0xc')][_0xae3d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476579,_0x33c089,_0x583b98){return new BPromise(function(_0x2a5c45,_0x3d6650){return client['request'](_0x476579,_0x583b98)['then'](function(_0x459592){logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));logger[_0xae3d('0x11')](_0xae3d('0x12'),_0x33c089,'request\x20sent',JSON[_0xae3d('0x13')](_0x459592));if(_0x459592['error']){if(_0x459592[_0xae3d('0x14')][_0xae3d('0x15')]===0x1f4){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592['error'][_0xae3d('0x16')]);return _0x3d6650(_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);}logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0x459592[_0xae3d('0x14')][_0xae3d('0x16')]);return _0x2a5c45(_0x459592['error'][_0xae3d('0x16')]);}else{logger[_0xae3d('0xe')](_0xae3d('0xf'),_0x33c089,_0xae3d('0x10'));_0x2a5c45(_0x459592[_0xae3d('0x17')][_0xae3d('0x16')]);}})['catch'](function(_0xe925fd){logger[_0xae3d('0x14')](_0xae3d('0xf'),_0x33c089,_0xe925fd);_0x3d6650(_0xe925fd);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e084c39..8c68ebe 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 _0x2e3b=['/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','put'];(function(_0x59cd1c,_0x57ecf7){var _0x5d5203=function(_0xed95d7){while(--_0xed95d7){_0x59cd1c['push'](_0x59cd1c['shift']());}};_0x5d5203(++_0x57ecf7);}(_0x2e3b,0x81));var _0xb2e3=function(_0x177585,_0x482643){_0x177585=_0x177585-0x0;var _0x436a02=_0x2e3b[_0x177585];return _0x436a02;};'use strict';var multer=require('multer');var util=require(_0xb2e3('0x0'));var path=require(_0xb2e3('0x1'));var timeout=require(_0xb2e3('0x2'));var express=require(_0xb2e3('0x3'));var router=express[_0xb2e3('0x4')]();var fs_extra=require(_0xb2e3('0x5'));var auth=require(_0xb2e3('0x6'));var interaction=require(_0xb2e3('0x7'));var config=require('../../config/environment');var controller=require(_0xb2e3('0x8'));router[_0xb2e3('0x9')]('/',controller['index']);router[_0xb2e3('0xa')](_0xb2e3('0xb'),auth['isAuthenticated'](),controller[_0xb2e3('0xc')]);module[_0xb2e3('0xd')]=router; \ No newline at end of file +var _0x2208=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','/:id','isAuthenticated','update','exports'];(function(_0x177829,_0x54889b){var _0xdd4d18=function(_0x28bc53){while(--_0x28bc53){_0x177829['push'](_0x177829['shift']());}};_0xdd4d18(++_0x54889b);}(_0x2208,0x11e));var _0x8220=function(_0x83ca54,_0x59f6b7){_0x83ca54=_0x83ca54-0x0;var _0xfdc56f=_0x2208[_0x83ca54];return _0xfdc56f;};'use strict';var multer=require('multer');var util=require(_0x8220('0x0'));var path=require('path');var timeout=require(_0x8220('0x1'));var express=require('express');var router=express[_0x8220('0x2')]();var fs_extra=require(_0x8220('0x3'));var auth=require(_0x8220('0x4'));var interaction=require(_0x8220('0x5'));var config=require(_0x8220('0x6'));var controller=require(_0x8220('0x7'));router['get']('/',controller[_0x8220('0x8')]);router['put'](_0x8220('0x9'),auth[_0x8220('0xa')](),controller[_0x8220('0xb')]);module[_0x8220('0xc')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 6b54d35..77e5942 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 _0x1720=['INTEGER','TEXT','STRING'];(function(_0x7f9068,_0x29bf72){var _0x40a1ab=function(_0x5d3c50){while(--_0x5d3c50){_0x7f9068['push'](_0x7f9068['shift']());}};_0x40a1ab(++_0x29bf72);}(_0x1720,0x7c));var _0x0172=function(_0x1e8ab9,_0x41b71b){_0x1e8ab9=_0x1e8ab9-0x0;var _0x46b280=_0x1720[_0x1e8ab9];return _0x46b280;};'use strict';var Sequelize=require('sequelize');module['exports']={'license':{'type':Sequelize[_0x0172('0x0')]},'data1':{'type':Sequelize[_0x0172('0x1')]},'data2':{'type':Sequelize[_0x0172('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x0172('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6b87=['TEXT','STRING','INTEGER','sequelize','exports'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0x6b87,0x175));var _0x76b8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6b87[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x76b8('0x0'));module[_0x76b8('0x1')]={'license':{'type':Sequelize[_0x76b8('0x2')]},'data1':{'type':Sequelize[_0x76b8('0x3')]},'data2':{'type':Sequelize[_0x76b8('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x76b8('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 98a8bed..fae4d96 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 _0xabce=['status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','model','keys','License','rawAttributes','query','intersection','attributes','fields','merge','getLicense','catch','find','get','body','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xb4acb8,_0xb9fff4){var _0x5b2d42=function(_0x364386){while(--_0x364386){_0xb4acb8['push'](_0xb4acb8['shift']());}};_0x5b2d42(++_0xb9fff4);}(_0xabce,0x103));var _0xeabc=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0xabce[_0x2cf2e9];return _0xd3670d;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){_0x3854d2['status'](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4d4e29,_0x811f0d){return function(_0x12acbd){if(!_0x12acbd){_0x4d4e29[_0xeabc('0x26')](0x194);}return _0x12acbd;};}function handleError(_0x3f194e,_0x3a1a04){_0x3a1a04=_0x3a1a04||0x1f4;return function(_0x137293){logger[_0xeabc('0x27')](_0x137293['stack']);if(_0x137293['name']){delete _0x137293[_0xeabc('0x28')];}_0x3f194e['status'](_0x3a1a04)[_0xeabc('0x29')](_0x137293);};}var utilLicense=require(_0xeabc('0x18'));exports['index']=function(_0x2163e6,_0x38572d){var _0x2b568f={'raw':!![],'where':{'id':0x1}},_0x2f8633={};_0x2f8633[_0xeabc('0x2a')]=_[_0xeabc('0x2b')](db[_0xeabc('0x2c')][_0xeabc('0x2d')]);_0x2f8633[_0xeabc('0x2e')]=_['keys'](_0x2163e6[_0xeabc('0x2e')]);_0x2f8633['filters']=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],_0x2f8633[_0xeabc('0x2e')]);_0x2b568f[_0xeabc('0x30')]=_[_0xeabc('0x2f')](_0x2f8633[_0xeabc('0x2a')],qs[_0xeabc('0x31')](_0x2163e6['query'][_0xeabc('0x31')]));_0x2b568f[_0xeabc('0x30')]=_0x2b568f[_0xeabc('0x30')]['length']?_0x2b568f[_0xeabc('0x30')]:_0x2f8633[_0xeabc('0x2a')];_0x2b568f=_[_0xeabc('0x32')]({},_0x2b568f,_0x2163e6['options']);return utilLicense[_0xeabc('0x33')](_0x2b568f)[_0xeabc('0x25')](respondWithResult(_0x38572d,null))[_0xeabc('0x34')](handleError(_0x38572d,null));};exports['update']=function(_0xf98c7c,_0x286203){if(_0xf98c7c['body']['id']){delete _0xf98c7c['body']['id'];}return db[_0xeabc('0x2c')][_0xeabc('0x35')]({'where':{'id':_0xf98c7c['params']['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x286203,null))[_0xeabc('0x25')](function(_0x3edee7){var _0x10434e=_0x3edee7[_0xeabc('0x36')]({'plain':!![]});return utilLicense['checkLicense'](_0x10434e,_0xf98c7c[_0xeabc('0x37')]['key']);})[_0xeabc('0x25')](function(_0x2bda29){if(!_0x2bda29[_0xeabc('0x38')]){return saveUpdates(_0xf98c7c['body'],null);}return _0x2bda29;})['then'](respondWithResult(_0x286203,null))[_0xeabc('0x34')](handleError(_0x286203,null));}; \ No newline at end of file +var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xf494,0x1c6));var _0x4f49=function(_0x2afd47,_0x59ccbb){_0x2afd47=_0x2afd47-0x0;var _0x5d95bd=_0xf494[_0x2afd47];return _0x5d95bd;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index ce47adb..8dd7927 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 _0x1927=['license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','define','License'];(function(_0x555902,_0x13f976){var _0x1b31e6=function(_0x3d1449){while(--_0x3d1449){_0x555902['push'](_0x555902['shift']());}};_0x1b31e6(++_0x13f976);}(_0x1927,0x7f));var _0x7192=function(_0x52ac6b,_0xb00fc8){_0x52ac6b=_0x52ac6b-0x0;var _0x2473af=_0x1927[_0x52ac6b];return _0x2473af;};'use strict';var _=require(_0x7192('0x0'));var util=require(_0x7192('0x1'));var logger=require(_0x7192('0x2'))(_0x7192('0x3'));var moment=require(_0x7192('0x4'));var BPromise=require(_0x7192('0x5'));var rp=require(_0x7192('0x6'));var fs=require('fs');var path=require(_0x7192('0x7'));var rimraf=require(_0x7192('0x8'));var config=require(_0x7192('0x9'));var attributes=require(_0x7192('0xa'));module['exports']=function(_0x459560,_0x1e36b7){return _0x459560[_0x7192('0xb')](_0x7192('0xc'),attributes,{'tableName':_0x7192('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf662=['api','bluebird','rimraf','../../config/environment','./license.attributes','exports','define','License','license','util'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0xf662,0x17b));var _0x2f66=function(_0xa8d7ef,_0x4b8b3d){_0xa8d7ef=_0xa8d7ef-0x0;var _0x239d5e=_0xf662[_0xa8d7ef];return _0x239d5e;};'use strict';var _=require('lodash');var util=require(_0x2f66('0x0'));var logger=require('../../config/logger')(_0x2f66('0x1'));var moment=require('moment');var BPromise=require(_0x2f66('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2f66('0x3'));var config=require(_0x2f66('0x4'));var attributes=require(_0x2f66('0x5'));module[_0x2f66('0x6')]=function(_0x43572d,_0x1d0c1e){return _0x43572d[_0x2f66('0x7')](_0x2f66('0x8'),attributes,{'tableName':_0x2f66('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index bba4a61..cdae2c6 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 _0x53fd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x2ff8ae,_0x459670){var _0x52d112=function(_0x1388eb){while(--_0x1388eb){_0x2ff8ae['push'](_0x2ff8ae['shift']());}};_0x52d112(++_0x459670);}(_0x53fd,0x1ae));var _0xd53f=function(_0xf02b3f,_0x4aaf47){_0xf02b3f=_0xf02b3f-0x0;var _0x51d908=_0x53fd[_0xf02b3f];return _0x51d908;};'use strict';var _=require(_0xd53f('0x0'));var util=require(_0xd53f('0x1'));var moment=require(_0xd53f('0x2'));var BPromise=require(_0xd53f('0x3'));var rs=require(_0xd53f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd53f('0x5'))['db'];var utils=require(_0xd53f('0x6'));var logger=require(_0xd53f('0x7'))(_0xd53f('0x8'));var config=require(_0xd53f('0x9'));var jayson=require(_0xd53f('0xa'));var client=jayson[_0xd53f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x387062,_0x32d16b,_0x41f437){return new BPromise(function(_0x19f314,_0x4f2ddb){return client[_0xd53f('0xc')](_0x387062,_0x41f437)[_0xd53f('0xd')](function(_0x5d57ca){logger[_0xd53f('0xe')](_0xd53f('0xf'),_0x32d16b,_0xd53f('0x10'));logger[_0xd53f('0x11')](_0xd53f('0x12'),_0x32d16b,_0xd53f('0x10'),JSON[_0xd53f('0x13')](_0x5d57ca));if(_0x5d57ca[_0xd53f('0x14')]){if(_0x5d57ca[_0xd53f('0x14')]['code']===0x1f4){logger[_0xd53f('0x14')](_0xd53f('0xf'),_0x32d16b,_0x5d57ca[_0xd53f('0x14')][_0xd53f('0x15')]);return _0x4f2ddb(_0x5d57ca[_0xd53f('0x14')][_0xd53f('0x15')]);}logger[_0xd53f('0x14')](_0xd53f('0xf'),_0x32d16b,_0x5d57ca[_0xd53f('0x14')][_0xd53f('0x15')]);return _0x19f314(_0x5d57ca['error'][_0xd53f('0x15')]);}else{logger[_0xd53f('0xe')](_0xd53f('0xf'),_0x32d16b,_0xd53f('0x10'));_0x19f314(_0x5d57ca['result'][_0xd53f('0x15')]);}})[_0xd53f('0x16')](function(_0x5c61b5){logger['error']('License,\x20%s,\x20%s',_0x32d16b,_0x5c61b5);_0x4f2ddb(_0x5c61b5);});});} \ No newline at end of file +var _0xfc94=['request','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http'];(function(_0x53a356,_0x9da31a){var _0xc2b531=function(_0x393f2b){while(--_0x393f2b){_0x53a356['push'](_0x53a356['shift']());}};_0xc2b531(++_0x9da31a);}(_0xfc94,0x81));var _0x4fc9=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xfc94[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x4fc9('0x0'));var util=require(_0x4fc9('0x1'));var moment=require(_0x4fc9('0x2'));var BPromise=require(_0x4fc9('0x3'));var rs=require(_0x4fc9('0x4'));var fs=require('fs');var Redis=require(_0x4fc9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4fc9('0x6'));var logger=require('../../config/logger')(_0x4fc9('0x7'));var config=require(_0x4fc9('0x8'));var jayson=require(_0x4fc9('0x9'));var client=jayson['client'][_0x4fc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bbd56,_0xa132fb,_0x1b1262){return new BPromise(function(_0x53ea10,_0x50c44d){return client[_0x4fc9('0xb')](_0x2bbd56,_0x1b1262)['then'](function(_0x1bf222){logger[_0x4fc9('0xc')](_0x4fc9('0xd'),_0xa132fb,_0x4fc9('0xe'));logger['debug'](_0x4fc9('0xf'),_0xa132fb,'request\x20sent',JSON['stringify'](_0x1bf222));if(_0x1bf222['error']){if(_0x1bf222[_0x4fc9('0x10')]['code']===0x1f4){logger['error'](_0x4fc9('0xd'),_0xa132fb,_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);return _0x50c44d(_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);}logger[_0x4fc9('0x10')](_0x4fc9('0xd'),_0xa132fb,_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);return _0x53ea10(_0x1bf222[_0x4fc9('0x10')][_0x4fc9('0x11')]);}else{logger[_0x4fc9('0xc')](_0x4fc9('0xd'),_0xa132fb,_0x4fc9('0xe'));_0x53ea10(_0x1bf222[_0x4fc9('0x12')][_0x4fc9('0x11')]);}})[_0x4fc9('0x13')](function(_0x402f04){logger[_0x4fc9('0x10')](_0x4fc9('0xd'),_0xa132fb,_0x402f04);_0x50c44d(_0x402f04);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index e9c2364..6606a85 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 _0x50c8=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','getInteractions','/:id/applications','/:id/messages','/:id/verify','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','/:id/interactions','addApplications','/:id/send','send','put','delete','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index'];(function(_0x901852,_0x1d74f6){var _0x18da1d=function(_0x343c3d){while(--_0x343c3d){_0x901852['push'](_0x901852['shift']());}};_0x18da1d(++_0x1d74f6);}(_0x50c8,0xe3));var _0x850c=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x50c8[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x850c('0x0'));var util=require(_0x850c('0x1'));var path=require(_0x850c('0x2'));var timeout=require(_0x850c('0x3'));var express=require(_0x850c('0x4'));var router=express[_0x850c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x850c('0x6'));var interaction=require(_0x850c('0x7'));var config=require(_0x850c('0x8'));var controller=require(_0x850c('0x9'));router[_0x850c('0xa')]('/',auth[_0x850c('0xb')](),controller[_0x850c('0xc')]);router[_0x850c('0xa')](_0x850c('0xd'),auth[_0x850c('0xb')](),controller[_0x850c('0xe')]);router[_0x850c('0xa')](_0x850c('0xf'),auth['isAuthenticated'](),controller[_0x850c('0x10')]);router['get'](_0x850c('0x11'),auth[_0x850c('0xb')](),controller[_0x850c('0x12')]);router[_0x850c('0xa')](_0x850c('0x13'),auth['isAuthenticated'](),controller[_0x850c('0x14')]);router['get']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x850c('0x15')]);router[_0x850c('0xa')]('/:id/out_servers',auth['isAuthenticated'](),controller['getSmtp']);router['get']('/:id/interactions',auth[_0x850c('0xb')](),controller[_0x850c('0x16')]);router[_0x850c('0xa')](_0x850c('0x17'),auth[_0x850c('0xb')](),controller['getApplications']);router[_0x850c('0xa')](_0x850c('0x18'),auth['isAuthenticated'](),controller['getMessages']);router[_0x850c('0xa')](_0x850c('0x19'),auth[_0x850c('0xb')](),controller['verifySmtp']);router[_0x850c('0xa')](_0x850c('0x1a'),auth[_0x850c('0xb')](),controller[_0x850c('0x1b')]);router[_0x850c('0x1c')](_0x850c('0x11'),auth['isAuthenticated'](),controller[_0x850c('0x1d')]);router['post'](_0x850c('0x13'),auth[_0x850c('0xb')](),controller[_0x850c('0x1e')]);router[_0x850c('0x1c')]('/',auth[_0x850c('0xb')](),controller[_0x850c('0x1f')]);router[_0x850c('0x1c')](_0x850c('0x20'),auth[_0x850c('0xb')](),controller[_0x850c('0x21')]);router[_0x850c('0x1c')](_0x850c('0x22'),auth[_0x850c('0xb')](),controller[_0x850c('0x23')]);router[_0x850c('0x1c')](_0x850c('0x24'),auth[_0x850c('0xb')](),controller['addInteraction']);router[_0x850c('0x1c')](_0x850c('0x17'),auth[_0x850c('0xb')](),controller[_0x850c('0x25')]);router['post'](_0x850c('0x26'),auth[_0x850c('0xb')](),controller[_0x850c('0x27')]);router[_0x850c('0x1c')]('/:id/users',auth[_0x850c('0xb')](),controller['addAgents']);router[_0x850c('0x28')]('/:id',auth[_0x850c('0xb')](),controller['update']);router[_0x850c('0x29')](_0x850c('0x11'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x850c('0x29')](_0x850c('0x13'),auth[_0x850c('0xb')](),controller[_0x850c('0x2a')]);router[_0x850c('0x29')](_0x850c('0x20'),auth['isAuthenticated'](),controller[_0x850c('0x2b')]);router[_0x850c('0x29')](_0x850c('0x22'),auth[_0x850c('0xb')](),controller[_0x850c('0x2c')]);router[_0x850c('0x29')]('/:id',auth[_0x850c('0xb')](),controller[_0x850c('0x2d')]);router[_0x850c('0x29')](_0x850c('0x1a'),auth[_0x850c('0xb')](),controller[_0x850c('0x2e')]);module[_0x850c('0x2f')]=router; \ No newline at end of file +var _0x150d=['post','create','/:id/in_servers','addImap','addSmtp','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeImap','removeSmtp','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailAccount.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','addAnswer'];(function(_0x15f152,_0x5a0e30){var _0x265946=function(_0x485683){while(--_0x485683){_0x15f152['push'](_0x15f152['shift']());}};_0x265946(++_0x5a0e30);}(_0x150d,0x1d9));var _0xd150=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0x150d[_0x4df1f5];return _0x56585b;};'use strict';var multer=require(_0xd150('0x0'));var util=require(_0xd150('0x1'));var path=require(_0xd150('0x2'));var timeout=require(_0xd150('0x3'));var express=require(_0xd150('0x4'));var router=express[_0xd150('0x5')]();var fs_extra=require(_0xd150('0x6'));var auth=require(_0xd150('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd150('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xd150('0x9')]);router[_0xd150('0xa')](_0xd150('0xb'),auth[_0xd150('0xc')](),controller['describe']);router[_0xd150('0xa')](_0xd150('0xd'),auth[_0xd150('0xc')](),controller[_0xd150('0xe')]);router[_0xd150('0xa')](_0xd150('0xf'),auth['isAuthenticated'](),controller[_0xd150('0x10')]);router[_0xd150('0xa')](_0xd150('0x11'),auth[_0xd150('0xc')](),controller[_0xd150('0x12')]);router[_0xd150('0xa')]('/:id/in_servers',auth[_0xd150('0xc')](),controller[_0xd150('0x13')]);router['get'](_0xd150('0x14'),auth[_0xd150('0xc')](),controller[_0xd150('0x15')]);router[_0xd150('0xa')](_0xd150('0x16'),auth['isAuthenticated'](),controller[_0xd150('0x17')]);router['get'](_0xd150('0x18'),auth[_0xd150('0xc')](),controller[_0xd150('0x19')]);router['get']('/:id/messages',auth[_0xd150('0xc')](),controller[_0xd150('0x1a')]);router[_0xd150('0xa')](_0xd150('0x1b'),auth[_0xd150('0xc')](),controller[_0xd150('0x1c')]);router['get'](_0xd150('0x1d'),auth[_0xd150('0xc')](),controller[_0xd150('0x1e')]);router['post'](_0xd150('0xf'),auth[_0xd150('0xc')](),controller[_0xd150('0x1f')]);router['post'](_0xd150('0x11'),auth[_0xd150('0xc')](),controller[_0xd150('0x20')]);router[_0xd150('0x21')]('/',auth[_0xd150('0xc')](),controller[_0xd150('0x22')]);router[_0xd150('0x21')](_0xd150('0x23'),auth[_0xd150('0xc')](),controller[_0xd150('0x24')]);router['post'](_0xd150('0x14'),auth[_0xd150('0xc')](),controller[_0xd150('0x25')]);router['post'](_0xd150('0x16'),auth[_0xd150('0xc')](),controller[_0xd150('0x26')]);router[_0xd150('0x21')](_0xd150('0x18'),auth['isAuthenticated'](),controller[_0xd150('0x27')]);router['post'](_0xd150('0x28'),auth['isAuthenticated'](),controller['send']);router[_0xd150('0x21')]('/:id/users',auth['isAuthenticated'](),controller[_0xd150('0x29')]);router['put'](_0xd150('0xd'),auth[_0xd150('0xc')](),controller[_0xd150('0x2a')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0xd150('0x2b')](_0xd150('0x11'),auth[_0xd150('0xc')](),controller['removeAnswers']);router[_0xd150('0x2b')]('/:id/in_servers',auth[_0xd150('0xc')](),controller[_0xd150('0x2c')]);router[_0xd150('0x2b')](_0xd150('0x14'),auth['isAuthenticated'](),controller[_0xd150('0x2d')]);router[_0xd150('0x2b')]('/:id',auth[_0xd150('0xc')](),controller['destroy']);router[_0xd150('0x2b')]('/:id/users',auth[_0xd150('0xc')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 95d316c..bfc5219 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 _0x3c17=['mandatoryDisposition','sequelize','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x3f1b36,_0x205b14){var _0x56a704=function(_0x3fc084){while(--_0x3fc084){_0x3f1b36['push'](_0x3f1b36['shift']());}};_0x56a704(++_0x205b14);}(_0x3c17,0x1a1));var _0x73c1=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x3c17[_0x54d4fe];return _0x1ab5bb;};'use strict';var Sequelize=require(_0x73c1('0x0'));module['exports']={'description':{'type':Sequelize[_0x73c1('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x73c1('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x73c1('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x73c1('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x73c1('0x3')]},'markAsUnread':{'type':Sequelize[_0x73c1('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x73c1('0x1')],'allowNull':![],'defaultValue':_0x73c1('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x73c1('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x73c1('0x6');}},'notificationSound':{'type':Sequelize[_0x73c1('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x73c1('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x73c1('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x73c1('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x73c1('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x73c1('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x73c1('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x73c1('0x2')],'defaultValue':![],'comment':_0x73c1('0x9'),'set':function(_0x4e5bc6){if(!_0x4e5bc6)this['setDataValue'](_0x73c1('0xa'),null);this[_0x73c1('0xb')](_0x73c1('0xc'),_0x4e5bc6);}}}; \ No newline at end of file +var _0xde6c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xde6c,0x119));var _0xcde6=function(_0x482e30,_0x11c205){_0x482e30=_0x482e30-0x0;var _0x59bf70=_0xde6c[_0x482e30];return _0x59bf70;};'use strict';var Sequelize=require(_0xcde6('0x0'));module[_0xcde6('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xcde6('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xcde6('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xcde6('0x4')]},'markAsUnread':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xcde6('0x2')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xcde6('0x5')](0x2)[_0xcde6('0x6')],'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[_0xcde6('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcde6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcde6('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcde6('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcde6('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xcde6('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xcde6('0x8'),'set':function(_0x38e9ee){if(!_0x38e9ee)this[_0xcde6('0x9')](_0xcde6('0xa'),null);this[_0xcde6('0x9')](_0xcde6('0xb'),_0x38e9ee);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 2d7459c..affad98 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 _0x90ef=['getDispositions','findOne','hasOwnProperty','include','removeDispositions','ids','addAnswer','create','getAnswers','CannedAnswer','removeAnswers','email','ListId','isNil','active','description','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','cservice','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','addSmtp','removeSmtp','setSmtp','addInteraction','getInteractions','MailInteraction','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','MailApplication','bulkCreate','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Interaction','Messages','VerifySmtp','Sequelize','ValidationError','addAgents','omit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','emit','getAgents','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','html-to-text','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','jayson/promise','client','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','show','MailServerIn','fields','find','body','params','describe','addDisposition','MailAccountId','Disposition'];(function(_0x560bd4,_0x4605d0){var _0x2e82b9=function(_0x18d411){while(--_0x18d411){_0x560bd4['push'](_0x560bd4['shift']());}};_0x2e82b9(++_0x4605d0);}(_0x90ef,0x122));var _0xf90e=function(_0x59f044,_0x2377ff){_0x59f044=_0x59f044-0x0;var _0x24540d=_0x90ef[_0x59f044];return _0x24540d;};'use strict';var emlformat=require(_0xf90e('0x0'));var rimraf=require(_0xf90e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf90e('0x2'));var rp=require(_0xf90e('0x3'));var moment=require('moment');var BPromise=require(_0xf90e('0x4'));var Mustache=require(_0xf90e('0x5'));var util=require(_0xf90e('0x6'));var path=require(_0xf90e('0x7'));var sox=require(_0xf90e('0x8'));var csv=require(_0xf90e('0x9'));var ejs=require(_0xf90e('0xa'));var fs=require('fs');var fs_extra=require(_0xf90e('0xb'));var _=require(_0xf90e('0xc'));var squel=require(_0xf90e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf90e('0xe'));var deskjs=require(_0xf90e('0xf'));var toCsv=require(_0xf90e('0x9'));var querystring=require(_0xf90e('0x10'));var Papa=require('papaparse');var htmlToText=require(_0xf90e('0x11'));var juice=require('juice');var Redis=require(_0xf90e('0x12'));var authService=require(_0xf90e('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf90e('0x14'));var utils=require(_0xf90e('0x15'));var config=require(_0xf90e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf90e('0x17'))['db'];config['redis']=_[_0xf90e('0x18')](config[_0xf90e('0x19')],{'host':_0xf90e('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf90e('0x19')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xf90e('0x1b'));var client=jayson[_0xf90e('0x1c')]['http']({'port':0x232b});function respondWithRpcPromise(_0xe20017,_0x190ec9,_0x3be049,_0x156df8){return new BPromise(function(_0xbca7b4,_0x461210){var _0x5b5fad=_0x156df8||client;return _0x5b5fad[_0xf90e('0x1d')](_0xe20017,_0x3be049)[_0xf90e('0x1e')](function(_0x34451c){logger[_0xf90e('0x1f')]('MailAccount,\x20%s,\x20%s',_0x190ec9,_0xf90e('0x20'));logger['debug'](_0xf90e('0x21'),_0x190ec9,'request\x20sent',JSON[_0xf90e('0x22')](_0x34451c));if(_0x34451c['error']){if(_0x34451c['error'][_0xf90e('0x23')]===0x1f4){logger[_0xf90e('0x24')](_0xf90e('0x25'),_0x190ec9,_0x34451c[_0xf90e('0x24')][_0xf90e('0x26')]);return _0x461210(_0x34451c['error'][_0xf90e('0x26')]);}logger['error'](_0xf90e('0x25'),_0x190ec9,_0x34451c[_0xf90e('0x24')]['message']);return _0xbca7b4(_0x34451c[_0xf90e('0x24')][_0xf90e('0x26')]);}else{logger[_0xf90e('0x1f')]('MailAccount,\x20%s,\x20%s',_0x190ec9,'request\x20sent');_0xbca7b4(_0x34451c[_0xf90e('0x27')][_0xf90e('0x26')]);}})[_0xf90e('0x28')](function(_0x146bbd){logger[_0xf90e('0x24')](_0xf90e('0x25'),_0x190ec9,_0x146bbd);_0x461210(_0x146bbd);});});}function respondWithStatusCode(_0x4573e4,_0x426d02){_0x426d02=_0x426d02||0xcc;return function(_0x534119){if(_0x534119){return _0x4573e4[_0xf90e('0x29')](_0x426d02);}return _0x4573e4['status'](_0x426d02)[_0xf90e('0x2a')]();};}function respondWithResult(_0x1ce2a2,_0x1bb5f7){_0x1bb5f7=_0x1bb5f7||0xc8;return function(_0x1943c6){if(_0x1943c6){return _0x1ce2a2[_0xf90e('0x2b')](_0x1bb5f7)['json'](_0x1943c6);}};}function respondWithFilteredResult(_0x3092a5,_0x172ed2){return function(_0x15575b){if(_0x15575b){var _0x43015b=typeof _0x172ed2[_0xf90e('0x2c')]===_0xf90e('0x2d')&&typeof _0x172ed2[_0xf90e('0x2e')]==='undefined';var _0x57a0d3=_0x15575b[_0xf90e('0x2f')];var _0x42c5fb=_0x43015b?0x0:_0x172ed2[_0xf90e('0x2c')];var _0x2986d1=_0x43015b?_0x15575b[_0xf90e('0x2f')]:_0x172ed2[_0xf90e('0x2c')]+_0x172ed2['limit'];var _0x2b0c53;if(_0x2986d1>=_0x57a0d3){_0x2986d1=_0x57a0d3;_0x2b0c53=0xc8;}else{_0x2b0c53=0xce;}_0x3092a5[_0xf90e('0x2b')](_0x2b0c53);return _0x3092a5[_0xf90e('0x30')](_0xf90e('0x31'),_0x42c5fb+'-'+_0x2986d1+'/'+_0x57a0d3)[_0xf90e('0x32')](_0x15575b);}return null;};}function patchUpdates(_0x4700ee){return function(_0x1f4ea7){try{jsonpatch[_0xf90e('0x33')](_0x1f4ea7,_0x4700ee,!![]);}catch(_0x17f125){return BPromise[_0xf90e('0x34')](_0x17f125);}return _0x1f4ea7[_0xf90e('0x35')]();};}function saveUpdates(_0x53406c,_0x159c6d){return function(_0x3f3690){if(_0x3f3690){return _0x3f3690[_0xf90e('0x36')](_0x53406c)['then'](function(_0x1364e2){return _0x1364e2;});}return null;};}function removeEntity(_0x2a07bb,_0x26fd8a){return function(_0x5a1c32){if(_0x5a1c32){return _0x5a1c32[_0xf90e('0x37')]()[_0xf90e('0x1e')](function(){var _0x536a34=_0x5a1c32[_0xf90e('0x38')]({'plain':!![]});var _0x397593=_0xf90e('0x39');return db[_0xf90e('0x3a')][_0xf90e('0x37')]({'where':{'type':_0x397593,'resourceId':_0x536a34['id']}})[_0xf90e('0x1e')](function(){return _0x5a1c32;});})[_0xf90e('0x1e')](function(){_0x2a07bb['status'](0xcc)[_0xf90e('0x2a')]();});}};}function handleEntityNotFound(_0x3c5756,_0x44f131){return function(_0x4893f3){if(!_0x4893f3){_0x3c5756['sendStatus'](0x194);}return _0x4893f3;};}function handleError(_0x2316f5,_0x1bd1b3){_0x1bd1b3=_0x1bd1b3||0x1f4;return function(_0x29ec42){logger[_0xf90e('0x24')](_0x29ec42[_0xf90e('0x3b')]);if(_0x29ec42[_0xf90e('0x3c')]){delete _0x29ec42[_0xf90e('0x3c')];}_0x2316f5[_0xf90e('0x2b')](_0x1bd1b3)[_0xf90e('0x3d')](_0x29ec42);};}exports[_0xf90e('0x3e')]=function(_0x438e79,_0x1780dc){var _0x5bd814={'include':[{'model':db['MailServerIn'],'as':_0xf90e('0x3f')},{'model':db[_0xf90e('0x40')],'as':_0xf90e('0x41')},{'model':db[_0xf90e('0x42')],'as':_0xf90e('0x43')}]},_0x2fb532={},_0xb4d237={'count':0x0,'rows':[]};var _0x352ae8=_[_0xf90e('0x44')](db[_0xf90e('0x45')][_0xf90e('0x46')],function(_0x55eea0){return{'name':_0x55eea0[_0xf90e('0x47')],'type':_0x55eea0[_0xf90e('0x48')][_0xf90e('0x49')]};});_0x2fb532[_0xf90e('0x4a')]=_[_0xf90e('0x44')](_0x352ae8,_0xf90e('0x3c'));_0x2fb532[_0xf90e('0x4b')]=_[_0xf90e('0x4c')](_0x438e79[_0xf90e('0x4b')]);_0x2fb532[_0xf90e('0x4d')]=_[_0xf90e('0x4e')](_0x2fb532[_0xf90e('0x4a')],_0x2fb532['query']);_0x5bd814[_0xf90e('0x4f')]=_['intersection'](_0x2fb532[_0xf90e('0x4a')],qs['fields'](_0x438e79['query']['fields']));_0x5bd814['attributes']=_0x5bd814[_0xf90e('0x4f')][_0xf90e('0x50')]?_0x5bd814[_0xf90e('0x4f')]:_0x2fb532['model'];if(!_0x438e79[_0xf90e('0x4b')]['hasOwnProperty'](_0xf90e('0x51'))){_0x5bd814[_0xf90e('0x2e')]=qs[_0xf90e('0x2e')](_0x438e79[_0xf90e('0x4b')][_0xf90e('0x2e')]);_0x5bd814[_0xf90e('0x2c')]=qs[_0xf90e('0x2c')](_0x438e79['query']['offset']);}_0x5bd814[_0xf90e('0x52')]=qs[_0xf90e('0x53')](_0x438e79[_0xf90e('0x4b')][_0xf90e('0x53')]);_0x5bd814['where']=qs['filters'](_[_0xf90e('0x54')](_0x438e79[_0xf90e('0x4b')],_0x2fb532['filters']),_0x352ae8);if(_0x438e79['query'][_0xf90e('0x55')]){_0x5bd814[_0xf90e('0x56')]=_[_0xf90e('0x57')](_0x5bd814[_0xf90e('0x56')],{'$or':_['map'](_0x352ae8,function(_0x617721){if(_0x617721['type']!=='VIRTUAL'){var _0x6569fa={};_0x6569fa[_0x617721[_0xf90e('0x3c')]]={'$like':'%'+_0x438e79[_0xf90e('0x4b')][_0xf90e('0x55')]+'%'};return _0x6569fa;}})});}_0x5bd814=_['merge']({},_0x5bd814,_0x438e79[_0xf90e('0x58')]);var _0x27ebc7={'where':_0x5bd814[_0xf90e('0x56')]};return db[_0xf90e('0x45')]['count'](_0x27ebc7)[_0xf90e('0x1e')](function(_0x487f2a){_0xb4d237['count']=_0x487f2a;if(_0x438e79[_0xf90e('0x4b')][_0xf90e('0x59')]){_0x5bd814['include']=[{'all':!![]}];}return db[_0xf90e('0x45')][_0xf90e('0x5a')](_0x5bd814);})[_0xf90e('0x1e')](function(_0x8c6646){_0xb4d237[_0xf90e('0x5b')]=_0x8c6646;return _0xb4d237;})[_0xf90e('0x1e')](respondWithFilteredResult(_0x1780dc,_0x5bd814))[_0xf90e('0x28')](handleError(_0x1780dc,null));};exports[_0xf90e('0x5c')]=function(_0x474c0c,_0x5b7051){var _0x580e70={'raw':![],'where':{'id':_0x474c0c['params']['id']},'include':[{'model':db[_0xf90e('0x5d')],'as':_0xf90e('0x3f')},{'model':db['MailServerOut'],'as':_0xf90e('0x41')},{'model':db[_0xf90e('0x42')],'as':_0xf90e('0x43')}]},_0x5889de={};_0x5889de[_0xf90e('0x4a')]=_[_0xf90e('0x4c')](db['MailAccount'][_0xf90e('0x46')]);_0x5889de[_0xf90e('0x4b')]=_[_0xf90e('0x4c')](_0x474c0c[_0xf90e('0x4b')]);_0x5889de[_0xf90e('0x4d')]=_[_0xf90e('0x4e')](_0x5889de[_0xf90e('0x4a')],_0x5889de['query']);_0x580e70[_0xf90e('0x4f')]=_[_0xf90e('0x4e')](_0x5889de[_0xf90e('0x4a')],qs['fields'](_0x474c0c['query'][_0xf90e('0x5e')]));_0x580e70[_0xf90e('0x4f')]=_0x580e70[_0xf90e('0x4f')]['length']?_0x580e70[_0xf90e('0x4f')]:_0x5889de['model'];if(_0x474c0c[_0xf90e('0x4b')][_0xf90e('0x59')]){_0x580e70['include']=[{'all':!![]}];}_0x580e70=_[_0xf90e('0x57')]({},_0x580e70,_0x474c0c[_0xf90e('0x58')]);return db[_0xf90e('0x45')][_0xf90e('0x5f')](_0x580e70)[_0xf90e('0x1e')](handleEntityNotFound(_0x5b7051,null))['then'](respondWithResult(_0x5b7051,null))['catch'](handleError(_0x5b7051,null));};exports[_0xf90e('0x36')]=function(_0x3ced7d,_0x4764af){if(_0x3ced7d[_0xf90e('0x60')]['id']){delete _0x3ced7d['body']['id'];}return db[_0xf90e('0x45')]['find']({'where':{'id':_0x3ced7d[_0xf90e('0x61')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xf90e('0x3f')},{'model':db[_0xf90e('0x40')],'as':_0xf90e('0x41')},{'model':db['Pause'],'as':_0xf90e('0x43')}]})['then'](handleEntityNotFound(_0x4764af,null))[_0xf90e('0x1e')](saveUpdates(_0x3ced7d[_0xf90e('0x60')],null))[_0xf90e('0x1e')](function(_0x17ded6){if(_0x17ded6&&_0x3ced7d['body'][_0xf90e('0x3f')]){return db[_0xf90e('0x5d')][_0xf90e('0x36')](_0x3ced7d['body'][_0xf90e('0x3f')],{'where':{'MailAccountId':_0x17ded6['id']}})[_0xf90e('0x1e')](function(){return _0x17ded6;});}return _0x17ded6;})[_0xf90e('0x1e')](function(_0x4f40b5){if(_0x4f40b5&&_0x3ced7d[_0xf90e('0x60')]['Smtp']){return db[_0xf90e('0x40')][_0xf90e('0x36')](_0x3ced7d['body'][_0xf90e('0x41')],{'where':{'MailAccountId':_0x4f40b5['id']}})['then'](function(){return _0x4f40b5;});}return _0x4f40b5;})[_0xf90e('0x1e')](respondWithResult(_0x4764af,null))[_0xf90e('0x28')](handleError(_0x4764af,null));};exports[_0xf90e('0x62')]=function(_0x1503ff,_0x587554){return db[_0xf90e('0x45')][_0xf90e('0x62')]()[_0xf90e('0x1e')](respondWithResult(_0x587554,null))['catch'](handleError(_0x587554,null));};exports[_0xf90e('0x63')]=function(_0x3caf49,_0x27d790,_0x5e4c36){if(_0x3caf49[_0xf90e('0x60')]['id']){delete _0x3caf49[_0xf90e('0x60')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x3caf49['params']['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x27d790,null))[_0xf90e('0x1e')](function(_0x69bf53){if(_0x69bf53){_0x3caf49[_0xf90e('0x60')][_0xf90e('0x64')]=_0x69bf53['id'];return db[_0xf90e('0x65')]['create'](_0x3caf49[_0xf90e('0x60')]);}})[_0xf90e('0x1e')](respondWithResult(_0x27d790,null))['catch'](handleError(_0x27d790,null));};exports[_0xf90e('0x66')]=function(_0x29aad5,_0x20901e,_0x13a192){var _0x2cec17={'raw':![],'where':{}};var _0x531454={};var _0x59850e={'count':0x0,'rows':[]};return db[_0xf90e('0x45')][_0xf90e('0x67')]({'where':{'id':_0x29aad5[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x20901e,null))[_0xf90e('0x1e')](function(_0x4e44d5){if(_0x4e44d5){_0x531454[_0xf90e('0x4a')]=_['keys'](db[_0xf90e('0x65')]['rawAttributes']);_0x531454['query']=_[_0xf90e('0x4c')](_0x29aad5[_0xf90e('0x4b')]);_0x531454[_0xf90e('0x4d')]=_['intersection'](_0x531454['model'],_0x531454['query']);_0x2cec17[_0xf90e('0x4f')]=_[_0xf90e('0x4e')](_0x531454[_0xf90e('0x4a')],qs[_0xf90e('0x5e')](_0x29aad5[_0xf90e('0x4b')][_0xf90e('0x5e')]));_0x2cec17['attributes']=_0x2cec17['attributes']['length']?_0x2cec17[_0xf90e('0x4f')]:_0x531454[_0xf90e('0x4a')];if(!_0x29aad5[_0xf90e('0x4b')][_0xf90e('0x68')](_0xf90e('0x51'))){_0x2cec17[_0xf90e('0x2e')]=qs[_0xf90e('0x2e')](_0x29aad5[_0xf90e('0x4b')]['limit']);_0x2cec17[_0xf90e('0x2c')]=qs[_0xf90e('0x2c')](_0x29aad5[_0xf90e('0x4b')][_0xf90e('0x2c')]);}_0x2cec17[_0xf90e('0x52')]=qs[_0xf90e('0x53')](_0x29aad5['query'][_0xf90e('0x53')]);_0x2cec17[_0xf90e('0x56')]=qs[_0xf90e('0x4d')](_[_0xf90e('0x54')](_0x29aad5[_0xf90e('0x4b')],_0x531454['filters']));_0x2cec17[_0xf90e('0x56')][_0xf90e('0x64')]=_0x4e44d5['id'];if(_0x29aad5[_0xf90e('0x4b')][_0xf90e('0x55')]){_0x2cec17[_0xf90e('0x56')]=_[_0xf90e('0x57')](_0x2cec17['where'],{'$or':_[_0xf90e('0x44')](_0x2cec17[_0xf90e('0x4f')],function(_0x11d721){var _0x164b46={};_0x164b46[_0x11d721]={'$like':'%'+_0x29aad5['query']['filter']+'%'};return _0x164b46;})});}_0x2cec17=_[_0xf90e('0x57')]({},_0x2cec17,_0x29aad5[_0xf90e('0x58')]);return db[_0xf90e('0x65')][_0xf90e('0x2f')]({'where':_0x2cec17[_0xf90e('0x56')]})[_0xf90e('0x1e')](function(_0x9cd842){_0x59850e[_0xf90e('0x2f')]=_0x9cd842;if(_0x29aad5['query'][_0xf90e('0x59')]){_0x2cec17[_0xf90e('0x69')]=[{'all':!![]}];}return db[_0xf90e('0x65')][_0xf90e('0x5a')](_0x2cec17);})['then'](function(_0x1fda8f){_0x59850e['rows']=_0x1fda8f;return _0x59850e;});}})['then'](respondWithFilteredResult(_0x20901e,_0x2cec17))[_0xf90e('0x28')](handleError(_0x20901e,null));};exports[_0xf90e('0x6a')]=function(_0x58dcd1,_0x83469f,_0x4a3d18){return db[_0xf90e('0x45')]['find']({'where':{'id':_0x58dcd1[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x83469f,null))['then'](function(_0x528548){if(_0x528548){return _0x528548['removeDispositions'](_0x58dcd1['query'][_0xf90e('0x6b')]);}})['then'](respondWithStatusCode(_0x83469f,null))['catch'](handleError(_0x83469f,null));};exports[_0xf90e('0x6c')]=function(_0x1cf131,_0xfdfc9f,_0x4fbf52){if(_0x1cf131[_0xf90e('0x60')]['id']){delete _0x1cf131[_0xf90e('0x60')]['id'];}return db['MailAccount'][_0xf90e('0x5f')]({'where':{'id':_0x1cf131[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0xfdfc9f,null))['then'](function(_0x520e65){if(_0x520e65){_0x1cf131[_0xf90e('0x60')][_0xf90e('0x64')]=_0x520e65['id'];return db['CannedAnswer'][_0xf90e('0x6d')](_0x1cf131['body']);}})[_0xf90e('0x1e')](respondWithResult(_0xfdfc9f,null))['catch'](handleError(_0xfdfc9f,null));};exports[_0xf90e('0x6e')]=function(_0x3c61a1,_0x2f6bf6,_0x170a5a){var _0x81eb8={'raw':![],'where':{}};var _0x1ae2c5={};var _0x108726={'count':0x0,'rows':[]};return db[_0xf90e('0x45')][_0xf90e('0x67')]({'where':{'id':_0x3c61a1['params']['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x2f6bf6,null))['then'](function(_0x466392){if(_0x466392){_0x1ae2c5[_0xf90e('0x4a')]=_[_0xf90e('0x4c')](db[_0xf90e('0x6f')][_0xf90e('0x46')]);_0x1ae2c5[_0xf90e('0x4b')]=_[_0xf90e('0x4c')](_0x3c61a1[_0xf90e('0x4b')]);_0x1ae2c5[_0xf90e('0x4d')]=_['intersection'](_0x1ae2c5[_0xf90e('0x4a')],_0x1ae2c5['query']);_0x81eb8[_0xf90e('0x4f')]=_[_0xf90e('0x4e')](_0x1ae2c5[_0xf90e('0x4a')],qs[_0xf90e('0x5e')](_0x3c61a1[_0xf90e('0x4b')][_0xf90e('0x5e')]));_0x81eb8[_0xf90e('0x4f')]=_0x81eb8[_0xf90e('0x4f')][_0xf90e('0x50')]?_0x81eb8[_0xf90e('0x4f')]:_0x1ae2c5[_0xf90e('0x4a')];if(!_0x3c61a1['query'][_0xf90e('0x68')](_0xf90e('0x51'))){_0x81eb8['limit']=qs['limit'](_0x3c61a1['query']['limit']);_0x81eb8[_0xf90e('0x2c')]=qs[_0xf90e('0x2c')](_0x3c61a1[_0xf90e('0x4b')][_0xf90e('0x2c')]);}_0x81eb8[_0xf90e('0x52')]=qs['sort'](_0x3c61a1[_0xf90e('0x4b')]['sort']);_0x81eb8[_0xf90e('0x56')]=qs[_0xf90e('0x4d')](_['pick'](_0x3c61a1[_0xf90e('0x4b')],_0x1ae2c5['filters']));_0x81eb8['where'][_0xf90e('0x64')]=_0x466392['id'];if(_0x3c61a1['query'][_0xf90e('0x55')]){_0x81eb8[_0xf90e('0x56')]=_[_0xf90e('0x57')](_0x81eb8[_0xf90e('0x56')],{'$or':_[_0xf90e('0x44')](_0x81eb8[_0xf90e('0x4f')],function(_0x1e2f9f){var _0x491f3f={};_0x491f3f[_0x1e2f9f]={'$like':'%'+_0x3c61a1[_0xf90e('0x4b')][_0xf90e('0x55')]+'%'};return _0x491f3f;})});}_0x81eb8=_[_0xf90e('0x57')]({},_0x81eb8,_0x3c61a1[_0xf90e('0x58')]);return db[_0xf90e('0x6f')][_0xf90e('0x2f')]({'where':_0x81eb8[_0xf90e('0x56')]})[_0xf90e('0x1e')](function(_0x15ad7f){_0x108726[_0xf90e('0x2f')]=_0x15ad7f;if(_0x3c61a1[_0xf90e('0x4b')][_0xf90e('0x59')]){_0x81eb8[_0xf90e('0x69')]=[{'all':!![]}];}return db[_0xf90e('0x6f')][_0xf90e('0x5a')](_0x81eb8);})['then'](function(_0x3b9a05){_0x108726[_0xf90e('0x5b')]=_0x3b9a05;return _0x108726;});}})['then'](respondWithFilteredResult(_0x2f6bf6,_0x81eb8))[_0xf90e('0x28')](handleError(_0x2f6bf6,null));};exports[_0xf90e('0x70')]=function(_0x4d7a2f,_0x159e47,_0x47cef2){return db[_0xf90e('0x45')][_0xf90e('0x5f')]({'where':{'id':_0x4d7a2f[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x159e47,null))['then'](function(_0x32ff7d){if(_0x32ff7d){return _0x32ff7d[_0xf90e('0x70')](_0x4d7a2f[_0xf90e('0x4b')]['ids']);}})[_0xf90e('0x1e')](respondWithStatusCode(_0x159e47,null))[_0xf90e('0x28')](handleError(_0x159e47,null));};exports[_0xf90e('0x6d')]=function(_0x21313c,_0x3a952a){var _0x283002={'name':_0x21313c[_0xf90e('0x60')][_0xf90e('0x3c')],'key':_0x21313c[_0xf90e('0x60')][_0xf90e('0x49')],'email':_0x21313c[_0xf90e('0x60')][_0xf90e('0x71')],'ListId':_0x21313c['body'][_0xf90e('0x72')],'active':!_[_0xf90e('0x73')](_0x21313c[_0xf90e('0x60')][_0xf90e('0x74')])?_0x21313c[_0xf90e('0x60')]['active']:!![],'description':_0x21313c[_0xf90e('0x60')][_0xf90e('0x75')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x21313c['body']['cservice'])){if(_0x21313c[_0xf90e('0x60')][_0xf90e('0x76')]){_0x283002[_0xf90e('0x3f')][_0xf90e('0x77')]=_0x283002[_0xf90e('0x41')]['user']=_0x21313c[_0xf90e('0x60')][_0xf90e('0x78')];_0x283002[_0xf90e('0x3f')][_0xf90e('0x79')]=_0x283002[_0xf90e('0x41')][_0xf90e('0x7a')]=_0x21313c[_0xf90e('0x60')][_0xf90e('0x7b')];}else{_0x283002[_0xf90e('0x3f')][_0xf90e('0x7c')]=_0x283002[_0xf90e('0x41')][_0xf90e('0x7c')]=![];}_0x283002[_0xf90e('0x3f')]['host']=_0x21313c[_0xf90e('0x60')]['Imap'][_0xf90e('0x7d')];_0x283002[_0xf90e('0x3f')][_0xf90e('0x7e')]=_0x21313c[_0xf90e('0x60')][_0xf90e('0x3f')][_0xf90e('0x7e')];_0x283002[_0xf90e('0x41')][_0xf90e('0x7d')]=_0x21313c[_0xf90e('0x60')][_0xf90e('0x41')][_0xf90e('0x7d')];_0x283002['Smtp'][_0xf90e('0x7e')]=_0x21313c[_0xf90e('0x60')][_0xf90e('0x41')][_0xf90e('0x7e')];}else{_0x283002['Imap'][_0xf90e('0x7f')]=_0x283002['Smtp']['service']=_0x21313c[_0xf90e('0x60')][_0xf90e('0x80')];_0x283002[_0xf90e('0x3f')]['user']=_0x283002[_0xf90e('0x41')]['user']=_0x21313c[_0xf90e('0x60')][_0xf90e('0x78')];_0x283002['Imap'][_0xf90e('0x79')]=_0x283002[_0xf90e('0x41')][_0xf90e('0x7a')]=_0x21313c[_0xf90e('0x60')][_0xf90e('0x7b')];}return db[_0xf90e('0x45')][_0xf90e('0x6d')](_0x283002,{'include':[{'model':db[_0xf90e('0x40')],'as':'Smtp'},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xf90e('0x1e')](function(_0x47b933){var _0x33f0a5=_0x21313c[_0xf90e('0x77')]['get']({'plain':!![]});if(!_0x33f0a5)throw new Error(_0xf90e('0x81'));if(_0x33f0a5[_0xf90e('0x82')]===_0xf90e('0x77')){var _0x157b04=_0x47b933[_0xf90e('0x38')]({'plain':!![]});return db[_0xf90e('0x83')][_0xf90e('0x5f')]({'where':{'name':_0xf90e('0x39'),'userProfileId':_0x33f0a5[_0xf90e('0x84')]},'raw':!![]})[_0xf90e('0x1e')](function(_0x2bfa27){if(_0x2bfa27&&_0x2bfa27['autoAssociation']===0x0){return db[_0xf90e('0x3a')]['create']({'name':_0x157b04[_0xf90e('0x3c')],'resourceId':_0x157b04['id'],'type':_0x2bfa27[_0xf90e('0x3c')],'sectionId':_0x2bfa27['id']},{})[_0xf90e('0x1e')](function(){return _0x47b933;});}else{return _0x47b933;}})['catch'](function(_0x1d3397){logger['error'](_0xf90e('0x85'),_0x1d3397);throw _0x1d3397;});}return _0x47b933;})[_0xf90e('0x1e')](respondWithResult(_0x3a952a,0xc9))[_0xf90e('0x28')](handleError(_0x3a952a,null));};exports[_0xf90e('0x86')]=function(_0x535323,_0x382886,_0xcb5a9b){return db[_0xf90e('0x45')][_0xf90e('0x67')]({'where':{'id':_0x535323[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x382886,null))[_0xf90e('0x1e')](function(_0x1670cb){if(_0x1670cb){return _0x1670cb['getImap']();}return null;})[_0xf90e('0x1e')](respondWithResult(_0x382886,null))['catch'](handleError(_0x382886,null));};exports[_0xf90e('0x87')]=function(_0x197d36,_0x17a070,_0x300f2c){if(_0x197d36['body']['id']){delete _0x197d36[_0xf90e('0x60')]['id'];}return db[_0xf90e('0x45')][_0xf90e('0x5f')]({'where':{'id':_0x197d36[_0xf90e('0x61')]['id']}})['then'](handleEntityNotFound(_0x17a070,null))[_0xf90e('0x1e')](function(_0x2803a4){if(_0x2803a4){_0x197d36[_0xf90e('0x60')]['MailAccountId']=_0x2803a4['id'];return db[_0xf90e('0x5d')]['create'](_0x197d36[_0xf90e('0x60')]);}})['then'](respondWithResult(_0x17a070,null))[_0xf90e('0x28')](handleError(_0x17a070,null));};exports['removeImap']=function(_0x1e47f4,_0xbe4b58,_0xb59310){return db['MailAccount'][_0xf90e('0x67')]({'where':{'id':_0x1e47f4['params']['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0xbe4b58,null))['then'](function(_0x3dc644){if(_0x3dc644){return _0x3dc644[_0xf90e('0x88')](null);}return null;})['then'](respondWithStatusCode(_0xbe4b58,null))[_0xf90e('0x28')](handleError(_0xbe4b58,null));};exports['getSmtp']=function(_0x59e5f8,_0x4bc49d,_0x2e76e1){return db[_0xf90e('0x45')][_0xf90e('0x67')]({'where':{'id':_0x59e5f8['params']['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x4bc49d,null))[_0xf90e('0x1e')](function(_0x46a1c8){if(_0x46a1c8){return _0x46a1c8['getSmtp']();}return null;})['then'](respondWithResult(_0x4bc49d,null))[_0xf90e('0x28')](handleError(_0x4bc49d,null));};exports[_0xf90e('0x89')]=function(_0x3ea1dc,_0x21e815,_0x4a9e64){if(_0x3ea1dc[_0xf90e('0x60')]['id']){delete _0x3ea1dc[_0xf90e('0x60')]['id'];}return db['MailAccount'][_0xf90e('0x5f')]({'where':{'id':_0x3ea1dc['params']['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x21e815,null))[_0xf90e('0x1e')](function(_0x48e982){if(_0x48e982){_0x3ea1dc[_0xf90e('0x60')]['MailAccountId']=_0x48e982['id'];return db[_0xf90e('0x40')]['create'](_0x3ea1dc[_0xf90e('0x60')]);}})[_0xf90e('0x1e')](respondWithResult(_0x21e815,null))[_0xf90e('0x28')](handleError(_0x21e815,null));};exports[_0xf90e('0x8a')]=function(_0x1934ca,_0x873d54,_0x5927ca){return db[_0xf90e('0x45')][_0xf90e('0x67')]({'where':{'id':_0x1934ca[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x873d54,null))['then'](function(_0xcc5c87){if(_0xcc5c87){return _0xcc5c87[_0xf90e('0x8b')](null);}return null;})['then'](respondWithStatusCode(_0x873d54,null))[_0xf90e('0x28')](handleError(_0x873d54,null));};exports[_0xf90e('0x8c')]=function(_0x315357,_0x13c051,_0x4fb4b5){return db['MailInteraction']['find']({'where':{'id':_0x315357[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x13c051,null))[_0xf90e('0x1e')](function(_0x156931){if(_0x156931){return _0x156931[_0xf90e('0x8c')](_0x315357[_0xf90e('0x60')][_0xf90e('0x6b')],_['omit'](_0x315357[_0xf90e('0x60')],['ids','id'])||{});}})[_0xf90e('0x1e')](respondWithResult(_0x13c051,null))[_0xf90e('0x28')](handleError(_0x13c051,null));};exports[_0xf90e('0x8d')]=function(_0x223699,_0x5be5e6,_0x3120f4){var _0x30d4c2={'raw':![],'where':{}};var _0x34fa11={};var _0x1cc5a5={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x223699[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x5be5e6,null))[_0xf90e('0x1e')](function(_0x33a79d){if(_0x33a79d){_0x34fa11['model']=_[_0xf90e('0x4c')](db[_0xf90e('0x8e')][_0xf90e('0x46')]);_0x34fa11[_0xf90e('0x4b')]=_[_0xf90e('0x4c')](_0x223699[_0xf90e('0x4b')]);_0x34fa11['filters']=_[_0xf90e('0x4e')](_0x34fa11[_0xf90e('0x4a')],_0x34fa11['query']);_0x30d4c2[_0xf90e('0x4f')]=_[_0xf90e('0x4e')](_0x34fa11[_0xf90e('0x4a')],qs[_0xf90e('0x5e')](_0x223699[_0xf90e('0x4b')][_0xf90e('0x5e')]));_0x30d4c2['attributes']=_0x30d4c2[_0xf90e('0x4f')][_0xf90e('0x50')]?_0x30d4c2[_0xf90e('0x4f')]:_0x34fa11[_0xf90e('0x4a')];if(!_0x223699[_0xf90e('0x4b')]['hasOwnProperty'](_0xf90e('0x51'))){_0x30d4c2[_0xf90e('0x2e')]=qs[_0xf90e('0x2e')](_0x223699[_0xf90e('0x4b')][_0xf90e('0x2e')]);_0x30d4c2[_0xf90e('0x2c')]=qs[_0xf90e('0x2c')](_0x223699[_0xf90e('0x4b')][_0xf90e('0x2c')]);}_0x30d4c2[_0xf90e('0x52')]=qs[_0xf90e('0x53')](_0x223699['query'][_0xf90e('0x53')]);_0x30d4c2[_0xf90e('0x56')]=qs[_0xf90e('0x4d')](_['pick'](_0x223699['query'],_0x34fa11[_0xf90e('0x4d')]));_0x30d4c2['where'][_0xf90e('0x64')]=_0x33a79d['id'];if(_0x223699[_0xf90e('0x4b')]['filter']){_0x30d4c2[_0xf90e('0x56')]=_['merge'](_0x30d4c2['where'],{'$or':_['map'](_0x30d4c2[_0xf90e('0x4f')],function(_0x3e959b){var _0x28017a={};_0x28017a[_0x3e959b]={'$like':'%'+_0x223699[_0xf90e('0x4b')][_0xf90e('0x55')]+'%'};return _0x28017a;})});}_0x30d4c2=_['merge']({},_0x30d4c2,_0x223699[_0xf90e('0x58')]);return db[_0xf90e('0x8e')]['count']({'where':_0x30d4c2[_0xf90e('0x56')]})['then'](function(_0x52fd0c){_0x1cc5a5[_0xf90e('0x2f')]=_0x52fd0c;if(_0x223699['query'][_0xf90e('0x59')]){_0x30d4c2[_0xf90e('0x69')]=[{'model':db[_0xf90e('0x8f')],'as':'Contact','required':![]},{'model':db[_0xf90e('0x90')],'as':_0xf90e('0x91'),'attributes':[_0xf90e('0x3c'),_0xf90e('0x92'),_0xf90e('0x93')],'required':![]},{'model':db[_0xf90e('0x94')],'as':_0xf90e('0x95'),'attributes':['id','name',_0xf90e('0x96')],'where':_0x223699[_0xf90e('0x4b')][_0xf90e('0x97')]?{'id':_0x223699[_0xf90e('0x4b')][_0xf90e('0x97')]}:undefined,'required':_0x223699[_0xf90e('0x4b')][_0xf90e('0x97')]?!![]:![]}];}return db[_0xf90e('0x8e')][_0xf90e('0x5a')](_0x30d4c2);})[_0xf90e('0x1e')](function(_0x2f974a){_0x1cc5a5[_0xf90e('0x5b')]=_0x2f974a;return _0x1cc5a5;});}})['then'](respondWithFilteredResult(_0x5be5e6,_0x30d4c2))['catch'](handleError(_0x5be5e6,null));};exports[_0xf90e('0x98')]=function(_0x32ad65,_0x289196,_0x73eec7){return db[_0xf90e('0x45')][_0xf90e('0x67')]({'where':{'id':_0x32ad65[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x289196,null))['then'](function(_0x243c64){if(_0x243c64){return db['sequelize'][_0xf90e('0x99')](function(_0x3c831c){return db[_0xf90e('0x9a')]['destroy']({'where':{'MailAccountId':_0x32ad65[_0xf90e('0x61')]['id']},'transaction':_0x3c831c})[_0xf90e('0x1e')](function(_0x1a7a91){var _0x161628=_[_0xf90e('0x44')](_0x32ad65[_0xf90e('0x60')],function(_0x255cda){_0x255cda[_0xf90e('0x64')]=_0x32ad65['params']['id'];return _0x255cda;});return db[_0xf90e('0x9a')][_0xf90e('0x9b')](_0x161628,{'transaction':_0x3c831c});});})['then'](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x32ad65[_0xf90e('0x61')]['id']},'order':'priority'});});}})[_0xf90e('0x1e')](respondWithResult(_0x289196,null))[_0xf90e('0x28')](handleError(_0x289196,null));};exports['getApplications']=function(_0x56b5f0,_0x4c42a0,_0x22a998){var _0xaff9c5={};var _0x1f17ab={};var _0x1e1abb;var _0x5c9102;return db[_0xf90e('0x45')][_0xf90e('0x67')]({'where':{'id':_0x56b5f0[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x4c42a0,null))[_0xf90e('0x1e')](function(_0x1a9c0e){if(_0x1a9c0e){_0x1e1abb=_0x1a9c0e;_0x1f17ab[_0xf90e('0x4a')]=_[_0xf90e('0x4c')](db[_0xf90e('0x9a')][_0xf90e('0x46')]);_0x1f17ab['query']=_[_0xf90e('0x4c')](_0x56b5f0['query']);_0x1f17ab['filters']=_['intersection'](_0x1f17ab['model'],_0x1f17ab[_0xf90e('0x4b')]);_0xaff9c5['attributes']=_[_0xf90e('0x4e')](_0x1f17ab['model'],qs[_0xf90e('0x5e')](_0x56b5f0['query'][_0xf90e('0x5e')]));_0xaff9c5[_0xf90e('0x4f')]=_0xaff9c5[_0xf90e('0x4f')][_0xf90e('0x50')]?_0xaff9c5[_0xf90e('0x4f')]:_0x1f17ab['model'];_0xaff9c5[_0xf90e('0x52')]=qs['sort'](_0x56b5f0['query']['sort']);_0xaff9c5[_0xf90e('0x56')]=qs[_0xf90e('0x4d')](_[_0xf90e('0x54')](_0x56b5f0['query'],_0x1f17ab[_0xf90e('0x4d')]));if(_0x56b5f0['query'][_0xf90e('0x55')]){_0xaff9c5[_0xf90e('0x56')]=_[_0xf90e('0x57')](_0xaff9c5[_0xf90e('0x56')],{'$or':_['map'](_0xaff9c5[_0xf90e('0x4f')],function(_0x18a829){var _0x1e38f1={};_0x1e38f1[_0x18a829]={'$like':'%'+_0x56b5f0[_0xf90e('0x4b')][_0xf90e('0x55')]+'%'};return _0x1e38f1;})});}_0xaff9c5=_['merge']({},_0xaff9c5,_0x56b5f0[_0xf90e('0x58')]);return _0x1e1abb['getApplications'](_0xaff9c5);}})[_0xf90e('0x1e')](function(_0x3aaa30){if(_0x3aaa30){_0x5c9102=_0x3aaa30[_0xf90e('0x50')];if(!_0x56b5f0[_0xf90e('0x4b')][_0xf90e('0x68')](_0xf90e('0x51'))){_0xaff9c5[_0xf90e('0x2e')]=qs[_0xf90e('0x2e')](_0x56b5f0[_0xf90e('0x4b')]['limit']);_0xaff9c5[_0xf90e('0x2c')]=qs[_0xf90e('0x2c')](_0x56b5f0[_0xf90e('0x4b')][_0xf90e('0x2c')]);}return _0x1e1abb['getApplications'](_0xaff9c5);}})[_0xf90e('0x1e')](function(_0x3c896b){if(_0x3c896b){return _0x3c896b?{'count':_0x5c9102,'rows':_0x3c896b}:null;}})['then'](respondWithResult(_0x4c42a0,null))['catch'](handleError(_0x4c42a0,null));};exports['getMessages']=function(_0x5e9347,_0x1ffa35,_0x4951b2){var _0xd3a5e6={'raw':!![],'where':{}};var _0x19a9d6={};var _0x447a71={'count':0x0,'rows':[]};return db[_0xf90e('0x45')]['findOne']({'where':{'id':_0x5e9347[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x1ffa35,null))[_0xf90e('0x1e')](function(_0x230116){if(_0x230116){_0x19a9d6['model']=_[_0xf90e('0x4c')](db[_0xf90e('0x9c')]['rawAttributes']);_0x19a9d6[_0xf90e('0x4b')]=_['keys'](_0x5e9347['query']);_0x19a9d6[_0xf90e('0x4d')]=_[_0xf90e('0x4e')](_0x19a9d6[_0xf90e('0x4a')],_0x19a9d6[_0xf90e('0x4b')]);_0xd3a5e6[_0xf90e('0x4f')]=_['intersection'](_0x19a9d6[_0xf90e('0x4a')],qs['fields'](_0x5e9347[_0xf90e('0x4b')][_0xf90e('0x5e')]));_0xd3a5e6[_0xf90e('0x4f')]=_0xd3a5e6[_0xf90e('0x4f')][_0xf90e('0x50')]?_0xd3a5e6[_0xf90e('0x4f')]:_0x19a9d6[_0xf90e('0x4a')];if(!_0x5e9347['query'][_0xf90e('0x68')]('nolimit')){_0xd3a5e6[_0xf90e('0x2e')]=qs['limit'](_0x5e9347[_0xf90e('0x4b')][_0xf90e('0x2e')]);_0xd3a5e6[_0xf90e('0x2c')]=qs['offset'](_0x5e9347['query'][_0xf90e('0x2c')]);}_0xd3a5e6[_0xf90e('0x52')]=qs[_0xf90e('0x53')](_0x5e9347[_0xf90e('0x4b')]['sort']);_0xd3a5e6['where']=qs[_0xf90e('0x4d')](_[_0xf90e('0x54')](_0x5e9347['query'],_0x19a9d6[_0xf90e('0x4d')]));_0xd3a5e6['where'][_0xf90e('0x64')]=_0x230116['id'];if(_0x5e9347[_0xf90e('0x4b')][_0xf90e('0x55')]){_0xd3a5e6[_0xf90e('0x56')]=_[_0xf90e('0x57')](_0xd3a5e6[_0xf90e('0x56')],{'$or':_[_0xf90e('0x44')](_0xd3a5e6[_0xf90e('0x4f')],function(_0x6b2cc){var _0x299b5e={};_0x299b5e[_0x6b2cc]={'$like':'%'+_0x5e9347[_0xf90e('0x4b')][_0xf90e('0x55')]+'%'};return _0x299b5e;})});}if(_0x5e9347[_0xf90e('0x4b')][_0xf90e('0x9d')]){var _0x53b8b5=_0x5e9347['query']['$gte'][_0xf90e('0x9e')](',');var _0x3cfb81={};_0x3cfb81[_0x53b8b5[0x0]]={'$gte':moment(_0x53b8b5[0x1])[_0xf90e('0x9f')](_0xf90e('0xa0'))};_0xd3a5e6[_0xf90e('0x56')]=_[_0xf90e('0x57')](_0xd3a5e6['where'],_0x3cfb81);}_0xd3a5e6=_[_0xf90e('0x57')]({},_0xd3a5e6,_0x5e9347[_0xf90e('0x58')]);return db[_0xf90e('0x9c')][_0xf90e('0x2f')]({'where':_0xd3a5e6[_0xf90e('0x56')]})[_0xf90e('0x1e')](function(_0x5f2485){_0x447a71[_0xf90e('0x2f')]=_0x5f2485;if(_0x5e9347[_0xf90e('0x4b')]['includeAll']){_0xd3a5e6[_0xf90e('0x69')]=[{'all':!![]}];}return db[_0xf90e('0x9c')][_0xf90e('0x5a')](_0xd3a5e6);})[_0xf90e('0x1e')](function(_0x47dfe8){if(_0x5e9347[_0xf90e('0x4b')][_0xf90e('0xa1')]===_0xf90e('0xa2')){for(var _0x437e0f=0x0;_0x437e0f<_0x47dfe8[_0xf90e('0x50')];_0x437e0f++){_0x47dfe8[_0x437e0f][_0xf90e('0x60')]=juice(_0x47dfe8[_0x437e0f][_0xf90e('0x60')]);}}_0x447a71[_0xf90e('0x5b')]=_0x47dfe8;return _0x447a71;});}})['then'](respondWithFilteredResult(_0x1ffa35,_0xd3a5e6))[_0xf90e('0x28')](handleError(_0x1ffa35,null));};exports[_0xf90e('0x3d')]=function(_0x4166e1,_0x497d22,_0xf10f19){var _0x2e3258,_0x1e3710={},_0x57149d;if(_0x4166e1[_0xf90e('0x60')]['to']){_0x57149d=_0x4166e1[_0xf90e('0x60')]['to']['split'](',')[0x0];}return db['MailAccount']['find']({'where':{'id':_0x4166e1['params']['id']},'include':[{'model':db[_0xf90e('0xa3')],'as':_0xf90e('0xa4'),'include':[{'model':db[_0xf90e('0x8f')],'as':_0xf90e('0xa5'),'where':{'email':_0x57149d},'limit':0x1,'order':[[_0xf90e('0xa6'),_0xf90e('0xa7')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xf90e('0x1e')](handleEntityNotFound(_0x497d22,null))['then'](function(_0x307a15){if(_0x307a15){_0x2e3258=_0x307a15;if(_0x307a15[_0xf90e('0x41')]){if(_['isNil'](_0x4166e1[_0xf90e('0x60')][_0xf90e('0xa8')])){_0x4166e1[_0xf90e('0x60')][_0xf90e('0xa8')]=util[_0xf90e('0x9f')](_0xf90e('0xa9'),_0x307a15[_0xf90e('0x3c')],_0x307a15[_0xf90e('0x71')]||_0x307a15[_0xf90e('0x41')][_0xf90e('0x77')]);}if(_0x4166e1[_0xf90e('0x60')][_0xf90e('0xaa')]&&_0x4166e1[_0xf90e('0x60')][_0xf90e('0xaa')][_0xf90e('0x50')]){for(var _0x436caa=0x0;_0x436caa<_0x4166e1[_0xf90e('0x60')][_0xf90e('0xaa')][_0xf90e('0x50')];_0x436caa+=0x1){_0x4166e1['body'][_0xf90e('0xaa')][_0x436caa]={'filename':_0x4166e1[_0xf90e('0x60')][_0xf90e('0xaa')][_0x436caa][_0xf90e('0x3c')],'path':path[_0xf90e('0xab')](config['root'],_0xf90e('0xac'),_0x4166e1[_0xf90e('0x60')][_0xf90e('0xaa')][_0x436caa][_0xf90e('0xad')])};}}var _0x588b7a={'tls':{'rejectUnauthorized':![]}};if(_[_0xf90e('0x73')](_0x307a15['Smtp'][_0xf90e('0x7f')])){if(_0x307a15[_0xf90e('0x41')][_0xf90e('0x7c')]){_0x588b7a[_0xf90e('0xae')]={'user':_0x307a15[_0xf90e('0x41')]['user'],'pass':_0x307a15[_0xf90e('0x41')][_0xf90e('0x7a')]};}_0x588b7a['host']=_0x307a15['Smtp'][_0xf90e('0x7d')];_0x588b7a[_0xf90e('0x7e')]=_0x307a15[_0xf90e('0x41')][_0xf90e('0x7e')];_0x588b7a[_0xf90e('0xaf')]=_0x307a15['Smtp']['secure'];}else{_0x588b7a[_0xf90e('0x7f')]=_0x307a15[_0xf90e('0x41')][_0xf90e('0x7f')];_0x588b7a['auth']={'user':_0x307a15[_0xf90e('0x41')]['user'],'pass':_0x307a15[_0xf90e('0x41')][_0xf90e('0x7a')]};}return respondWithRpcPromise(_0xf90e('0xb0'),_0xf90e('0xb1'),{'account':_0x588b7a,'message':_0x4166e1[_0xf90e('0x60')]});}else{throw new Error(_0xf90e('0xb2'));}}})[_0xf90e('0x1e')](function(_0x56aa25){if(_0x56aa25){_0x1e3710=_0x56aa25;if(_0x2e3258[_0xf90e('0xa4')]){if(_0x2e3258[_0xf90e('0xa4')][_0xf90e('0xa5')][_0xf90e('0x50')]){return _0x2e3258['List'][_0xf90e('0xa5')][0x0];}else{return db['CmContact'][_0xf90e('0x6d')](_[_0xf90e('0x18')](_0x4166e1[_0xf90e('0x60')],{'firstName':_0x4166e1['body']['to'],'email':_0x4166e1['body']['to'],'phone':_0x4166e1[_0xf90e('0x60')]['to'],'ListId':_0x2e3258[_0xf90e('0x72')]}));}}else{throw new Error(_0xf90e('0xb2'));}}})['then'](function(_0xdd69b2){if(_0xdd69b2){var _0x1e9f6e={'UserId':_0x4166e1['user']['id'],'ContactId':_0xdd69b2['id'],'MailAccountId':_0x2e3258['id'],'inReplyTo':_0x1e3710[_0xf90e('0xb3')],'to':_0x4166e1[_0xf90e('0x60')][_0xf90e('0xa8')],'cc':_0x4166e1[_0xf90e('0x60')]['cc'],'subject':_0x4166e1[_0xf90e('0x60')][_0xf90e('0xb4')],'attach':_0x4166e1['body'][_0xf90e('0xb5')],'firstMsgDirection':_0xf90e('0xb6'),'lastMsgAt':moment()[_0xf90e('0x9f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xf90e('0xb6'),'Messages':[_[_0xf90e('0x57')](_0x4166e1[_0xf90e('0x60')],{'messageId':_0x1e3710['messageId'],'sentAt':moment()[_0xf90e('0x9f')](_0xf90e('0xa0')),'read':!![],'MailAccountId':_0x2e3258['id'],'UserId':_0x4166e1['user']['id'],'ContactId':_0xdd69b2['id']})]};if(_0x4166e1[_0xf90e('0x60')][_0xf90e('0xb7')]){_0x1e9f6e=_[_0xf90e('0x57')](_0x1e9f6e,_0x4166e1['body'][_0xf90e('0xb7')]);}return db[_0xf90e('0x8e')][_0xf90e('0x6d')](_0x1e9f6e,{'include':[{'model':db[_0xf90e('0x9c')],'as':_0xf90e('0xb8')}]});}})[_0xf90e('0x1e')](respondWithResult(_0x497d22,null))[_0xf90e('0x28')](handleError(_0x497d22,null));};exports['verifySmtp']=function(_0x354c39,_0x1c8baf,_0x1cfbdb){return db['MailAccount'][_0xf90e('0x5f')]({'where':{'id':_0x354c39[_0xf90e('0x61')]['id']},'include':[{'model':db[_0xf90e('0x40')],'as':_0xf90e('0x41'),'raw':!![]}]})['then'](handleEntityNotFound(_0x1c8baf,null))[_0xf90e('0x1e')](function(_0x2de707){if(_0x2de707&&_0x2de707['Smtp']){var _0x589364={'id':_0x2de707['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2de707[_0xf90e('0x41')][_0xf90e('0x7f')]){_0x589364['service']=_0x2de707[_0xf90e('0x41')][_0xf90e('0x7f')];}else{_0x589364['host']=_0x2de707['Smtp'][_0xf90e('0x7d')];_0x589364[_0xf90e('0x7e')]=_0x2de707[_0xf90e('0x41')][_0xf90e('0x7e')];_0x589364[_0xf90e('0xaf')]=_0x2de707['Smtp'][_0xf90e('0xaf')];}if(_0x2de707[_0xf90e('0x41')][_0xf90e('0x7c')]){_0x589364[_0xf90e('0xae')]={'user':_0x2de707[_0xf90e('0x41')][_0xf90e('0x77')],'pass':_0x2de707[_0xf90e('0x41')][_0xf90e('0x7a')]};}return respondWithRpcPromise(_0xf90e('0xb9'),'verifySmtp',{'account':_0x589364});}})[_0xf90e('0x1e')](respondWithResult(_0x1c8baf,null))[_0xf90e('0x28')](handleError(_0x1c8baf,null));};exports['destroy']=function(_0x4e5e8f,_0xb52ca5){return db[_0xf90e('0x45')]['find']({'where':{'id':_0x4e5e8f[_0xf90e('0x61')]['id']}})['then'](handleEntityNotFound(_0xb52ca5,null))[_0xf90e('0x1e')](function(_0x15588c){if(_0x15588c&&_0x15588c[_0xf90e('0x7f')]){throw new db[(_0xf90e('0xba'))][(_0xf90e('0xbb'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x15588c;})['then'](removeEntity(_0xb52ca5,null))['catch'](handleError(_0xb52ca5,null));};exports[_0xf90e('0xbc')]=function(_0x1ae5a3,_0x2a8abe,_0x571338){return db[_0xf90e('0x45')][_0xf90e('0x5f')]({'where':{'id':_0x1ae5a3['params']['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x2a8abe,null))[_0xf90e('0x1e')](function(_0x569bc6){if(_0x569bc6){return _0x569bc6['addAgents'](_0x1ae5a3['body'][_0xf90e('0x6b')],_[_0xf90e('0xbd')](_0x1ae5a3['body'],['ids','id'])||{})['spread'](function(_0x2cdf48){for(var _0xb5f438=0x0;_0xb5f438<_0x1ae5a3[_0xf90e('0x60')][_0xf90e('0x6b')][_0xf90e('0x50')];_0xb5f438+=0x1){socket['emit'](_0xf90e('0xbe'),{'UserId':Number(_0x1ae5a3[_0xf90e('0x60')][_0xf90e('0x6b')][_0xb5f438]),'MailAccountId':Number(_0x1ae5a3[_0xf90e('0x61')]['id'])});}return _0x2cdf48;});}})['then'](respondWithResult(_0x2a8abe,null))[_0xf90e('0x28')](handleError(_0x2a8abe,null));};exports[_0xf90e('0xbf')]=function(_0x387be0,_0x3501ed,_0x4c3d7d){return db[_0xf90e('0x45')][_0xf90e('0x5f')]({'where':{'id':_0x387be0[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x3501ed,null))['then'](function(_0x28a40d){if(_0x28a40d){return _0x28a40d['removeAgents'](_0x387be0[_0xf90e('0x4b')][_0xf90e('0x6b')])['then'](function(){if(_[_0xf90e('0xc0')](_0x387be0['query'][_0xf90e('0x6b')])){for(var _0x38efcf=0x0;_0x38efcf<_0x387be0['query']['ids']['length'];_0x38efcf+=0x1){socket['emit'](_0xf90e('0xc1'),{'UserId':Number(_0x387be0[_0xf90e('0x4b')][_0xf90e('0x6b')][_0x38efcf]),'MailAccountId':Number(_0x387be0[_0xf90e('0x61')]['id'])});}}else{socket[_0xf90e('0xc2')](_0xf90e('0xc1'),{'UserId':Number(_0x387be0[_0xf90e('0x4b')][_0xf90e('0x6b')]),'MailAccountId':Number(_0x387be0[_0xf90e('0x61')]['id'])});}});}})[_0xf90e('0x1e')](respondWithStatusCode(_0x3501ed,null))[_0xf90e('0x28')](handleError(_0x3501ed,null));};exports[_0xf90e('0xc3')]=function(_0x56d7fe,_0x2b2851,_0x33b647){var _0x6a2ed={};var _0x4cf9fe={};var _0x483f2f;var _0x51a1b2;return db['MailAccount'][_0xf90e('0x67')]({'where':{'id':_0x56d7fe[_0xf90e('0x61')]['id']}})[_0xf90e('0x1e')](handleEntityNotFound(_0x2b2851,null))[_0xf90e('0x1e')](function(_0x968edc){if(_0x968edc){_0x483f2f=_0x968edc;_0x4cf9fe[_0xf90e('0x4a')]=_['keys'](db['User']['rawAttributes']);_0x4cf9fe[_0xf90e('0x4b')]=_['keys'](_0x56d7fe['query']);_0x4cf9fe[_0xf90e('0x4d')]=_['intersection'](_0x4cf9fe[_0xf90e('0x4a')],_0x4cf9fe['query']);_0x6a2ed[_0xf90e('0x4f')]=_[_0xf90e('0x4e')](_0x4cf9fe[_0xf90e('0x4a')],qs[_0xf90e('0x5e')](_0x56d7fe[_0xf90e('0x4b')][_0xf90e('0x5e')]));_0x6a2ed['attributes']=_0x6a2ed['attributes'][_0xf90e('0x50')]?_0x6a2ed[_0xf90e('0x4f')]:_0x4cf9fe[_0xf90e('0x4a')];_0x6a2ed[_0xf90e('0x52')]=qs['sort'](_0x56d7fe[_0xf90e('0x4b')]['sort']);_0x6a2ed[_0xf90e('0x56')]=qs[_0xf90e('0x4d')](_['pick'](_0x56d7fe['query'],_0x4cf9fe[_0xf90e('0x4d')]));if(_0x56d7fe[_0xf90e('0x4b')]['filter']){_0x6a2ed[_0xf90e('0x56')]=_[_0xf90e('0x57')](_0x6a2ed[_0xf90e('0x56')],{'$or':_[_0xf90e('0x44')](_0x6a2ed[_0xf90e('0x4f')],function(_0x58fc11){var _0x147aa6={};_0x147aa6[_0x58fc11]={'$like':'%'+_0x56d7fe[_0xf90e('0x4b')][_0xf90e('0x55')]+'%'};return _0x147aa6;})});}_0x6a2ed=_[_0xf90e('0x57')]({},_0x6a2ed,_0x56d7fe[_0xf90e('0x58')]);return _0x483f2f[_0xf90e('0xc3')](_0x6a2ed);}})[_0xf90e('0x1e')](function(_0xfd3b1e){if(_0xfd3b1e){_0x51a1b2=_0xfd3b1e[_0xf90e('0x50')];if(!_0x56d7fe['query'][_0xf90e('0x68')](_0xf90e('0x51'))){_0x6a2ed['limit']=qs['limit'](_0x56d7fe[_0xf90e('0x4b')][_0xf90e('0x2e')]);_0x6a2ed[_0xf90e('0x2c')]=qs[_0xf90e('0x2c')](_0x56d7fe[_0xf90e('0x4b')][_0xf90e('0x2c')]);}return _0x483f2f[_0xf90e('0xc3')](_0x6a2ed);}})[_0xf90e('0x1e')](function(_0x21f07d){if(_0x21f07d){return _0x21f07d?{'count':_0x51a1b2,'rows':_0x21f07d}:null;}})['then'](respondWithResult(_0x2b2851,null))[_0xf90e('0x28')](handleError(_0x2b2851,null));}; \ No newline at end of file +var _0x199f=['verifySmtp','Sequelize','ValidationError','addAgents','spread','emit','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','juice','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','end','stack','name','index','MailServerIn','MailServerOut','Smtp','Pause','MailAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','include','findAll','rows','catch','show','Imap','keys','includeAll','find','body','params','mandatoryDispositionPause','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','isNil','cauthentication','user','cuser','pass','authentication','host','port','service','cservice','password','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','User','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','MailApplication','findAndCountAll','priority','getApplications','MailMessage','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','send','updatedAt','DESC','from','format','%s\x20<%s>','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','List','Contacts','messageId','attach','out','Interaction','Messages'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x199f,0x185));var _0xf199=function(_0x4d389d,_0xec145d){_0x4d389d=_0x4d389d-0x0;var _0x22bd25=_0x199f[_0x4d389d];return _0x22bd25;};'use strict';var emlformat=require(_0xf199('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf199('0x1'));var jsonpatch=require(_0xf199('0x2'));var rp=require(_0xf199('0x3'));var moment=require(_0xf199('0x4'));var BPromise=require(_0xf199('0x5'));var Mustache=require('mustache');var util=require(_0xf199('0x6'));var path=require(_0xf199('0x7'));var sox=require('sox');var csv=require(_0xf199('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf199('0x9'));var squel=require(_0xf199('0xa'));var crypto=require(_0xf199('0xb'));var jsforce=require(_0xf199('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf199('0x8'));var querystring=require(_0xf199('0xd'));var Papa=require(_0xf199('0xe'));var htmlToText=require('html-to-text');var juice=require(_0xf199('0xf'));var Redis=require(_0xf199('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf199('0x11'));var hardwareService=require(_0xf199('0x12'));var logger=require(_0xf199('0x13'))('api');var utils=require(_0xf199('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf199('0x15'));var db=require(_0xf199('0x16'))['db'];config[_0xf199('0x17')]=_['defaults'](config['redis'],{'host':_0xf199('0x18'),'port':0x18eb});var socket=require(_0xf199('0x19'))(new Redis(config[_0xf199('0x17')]));require(_0xf199('0x1a'))[_0xf199('0x1b')](socket);var jayson=require(_0xf199('0x1c'));var client=jayson[_0xf199('0x1d')][_0xf199('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x6dcb68,_0x336a89,_0x31906b,_0x59ce7b){return new BPromise(function(_0x1d3c68,_0x38eeaf){var _0x375dde=_0x59ce7b||client;return _0x375dde[_0xf199('0x1f')](_0x6dcb68,_0x31906b)[_0xf199('0x20')](function(_0x146076){logger[_0xf199('0x21')](_0xf199('0x22'),_0x336a89,_0xf199('0x23'));logger[_0xf199('0x24')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x336a89,_0xf199('0x23'),JSON['stringify'](_0x146076));if(_0x146076[_0xf199('0x25')]){if(_0x146076[_0xf199('0x25')][_0xf199('0x26')]===0x1f4){logger[_0xf199('0x25')](_0xf199('0x22'),_0x336a89,_0x146076[_0xf199('0x25')]['message']);return _0x38eeaf(_0x146076[_0xf199('0x25')][_0xf199('0x27')]);}logger[_0xf199('0x25')](_0xf199('0x22'),_0x336a89,_0x146076['error']['message']);return _0x1d3c68(_0x146076[_0xf199('0x25')][_0xf199('0x27')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x336a89,_0xf199('0x23'));_0x1d3c68(_0x146076['result'][_0xf199('0x27')]);}})['catch'](function(_0x401315){logger['error'](_0xf199('0x22'),_0x336a89,_0x401315);_0x38eeaf(_0x401315);});});}function respondWithStatusCode(_0x5cd605,_0x4e2813){_0x4e2813=_0x4e2813||0xcc;return function(_0x2d2fad){if(_0x2d2fad){return _0x5cd605[_0xf199('0x28')](_0x4e2813);}return _0x5cd605[_0xf199('0x29')](_0x4e2813)['end']();};}function respondWithResult(_0x719732,_0x578cfd){_0x578cfd=_0x578cfd||0xc8;return function(_0x13cc1f){if(_0x13cc1f){return _0x719732['status'](_0x578cfd)[_0xf199('0x2a')](_0x13cc1f);}};}function respondWithFilteredResult(_0x49a654,_0x17b58c){return function(_0x529f5a){if(_0x529f5a){var _0x2b76bd=typeof _0x17b58c[_0xf199('0x2b')]===_0xf199('0x2c')&&typeof _0x17b58c[_0xf199('0x2d')]===_0xf199('0x2c');var _0x2b4c22=_0x529f5a[_0xf199('0x2e')];var _0x2bbf03=_0x2b76bd?0x0:_0x17b58c[_0xf199('0x2b')];var _0x51e308=_0x2b76bd?_0x529f5a[_0xf199('0x2e')]:_0x17b58c[_0xf199('0x2b')]+_0x17b58c[_0xf199('0x2d')];var _0x16b37b;if(_0x51e308>=_0x2b4c22){_0x51e308=_0x2b4c22;_0x16b37b=0xc8;}else{_0x16b37b=0xce;}_0x49a654[_0xf199('0x29')](_0x16b37b);return _0x49a654[_0xf199('0x2f')](_0xf199('0x30'),_0x2bbf03+'-'+_0x51e308+'/'+_0x2b4c22)['json'](_0x529f5a);}return null;};}function patchUpdates(_0xee16bd){return function(_0x448b25){try{jsonpatch[_0xf199('0x31')](_0x448b25,_0xee16bd,!![]);}catch(_0x3429e1){return BPromise[_0xf199('0x32')](_0x3429e1);}return _0x448b25[_0xf199('0x33')]();};}function saveUpdates(_0x3bbc05,_0x55e11c){return function(_0x5ca726){if(_0x5ca726){return _0x5ca726[_0xf199('0x34')](_0x3bbc05)['then'](function(_0x871ef0){return _0x871ef0;});}return null;};}function removeEntity(_0x4d9aad,_0x230703){return function(_0x3119fb){if(_0x3119fb){return _0x3119fb[_0xf199('0x35')]()[_0xf199('0x20')](function(){var _0x26d575=_0x3119fb[_0xf199('0x36')]({'plain':!![]});var _0x1ad378=_0xf199('0x37');return db[_0xf199('0x38')]['destroy']({'where':{'type':_0x1ad378,'resourceId':_0x26d575['id']}})[_0xf199('0x20')](function(){return _0x3119fb;});})['then'](function(){_0x4d9aad[_0xf199('0x29')](0xcc)[_0xf199('0x39')]();});}};}function handleEntityNotFound(_0x16d9dd,_0x3a8795){return function(_0x504ec3){if(!_0x504ec3){_0x16d9dd['sendStatus'](0x194);}return _0x504ec3;};}function handleError(_0x26fb96,_0x3f5db8){_0x3f5db8=_0x3f5db8||0x1f4;return function(_0x4f4bd1){logger[_0xf199('0x25')](_0x4f4bd1[_0xf199('0x3a')]);if(_0x4f4bd1[_0xf199('0x3b')]){delete _0x4f4bd1[_0xf199('0x3b')];}_0x26fb96[_0xf199('0x29')](_0x3f5db8)['send'](_0x4f4bd1);};}exports[_0xf199('0x3c')]=function(_0x4115a6,_0x3a1287){var _0x1398b7={'include':[{'model':db[_0xf199('0x3d')],'as':'Imap'},{'model':db[_0xf199('0x3e')],'as':_0xf199('0x3f')},{'model':db[_0xf199('0x40')],'as':'mandatoryDispositionPause'}]},_0xf32ce6={},_0x17aaf6={'count':0x0,'rows':[]};var _0x22028b=_['map'](db[_0xf199('0x41')][_0xf199('0x42')],function(_0x33f95a){return{'name':_0x33f95a['fieldName'],'type':_0x33f95a[_0xf199('0x43')][_0xf199('0x44')]};});_0xf32ce6[_0xf199('0x45')]=_['map'](_0x22028b,'name');_0xf32ce6[_0xf199('0x46')]=_['keys'](_0x4115a6[_0xf199('0x46')]);_0xf32ce6[_0xf199('0x47')]=_[_0xf199('0x48')](_0xf32ce6[_0xf199('0x45')],_0xf32ce6[_0xf199('0x46')]);_0x1398b7[_0xf199('0x49')]=_['intersection'](_0xf32ce6['model'],qs[_0xf199('0x4a')](_0x4115a6[_0xf199('0x46')][_0xf199('0x4a')]));_0x1398b7[_0xf199('0x49')]=_0x1398b7[_0xf199('0x49')][_0xf199('0x4b')]?_0x1398b7[_0xf199('0x49')]:_0xf32ce6[_0xf199('0x45')];if(!_0x4115a6[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0x1398b7['limit']=qs['limit'](_0x4115a6[_0xf199('0x46')][_0xf199('0x2d')]);_0x1398b7['offset']=qs[_0xf199('0x2b')](_0x4115a6[_0xf199('0x46')][_0xf199('0x2b')]);}_0x1398b7[_0xf199('0x4e')]=qs[_0xf199('0x4f')](_0x4115a6['query'][_0xf199('0x4f')]);_0x1398b7[_0xf199('0x50')]=qs[_0xf199('0x47')](_['pick'](_0x4115a6[_0xf199('0x46')],_0xf32ce6[_0xf199('0x47')]),_0x22028b);if(_0x4115a6[_0xf199('0x46')][_0xf199('0x51')]){_0x1398b7[_0xf199('0x50')]=_[_0xf199('0x52')](_0x1398b7[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x22028b,function(_0x16af95){if(_0x16af95['type']!=='VIRTUAL'){var _0x1449c9={};_0x1449c9[_0x16af95['name']]={'$like':'%'+_0x4115a6[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x1449c9;}})});}_0x1398b7=_['merge']({},_0x1398b7,_0x4115a6[_0xf199('0x54')]);var _0x4b1168={'where':_0x1398b7[_0xf199('0x50')]};return db[_0xf199('0x41')]['count'](_0x4b1168)[_0xf199('0x20')](function(_0x15281b){_0x17aaf6[_0xf199('0x2e')]=_0x15281b;if(_0x4115a6[_0xf199('0x46')]['includeAll']){_0x1398b7[_0xf199('0x55')]=[{'all':!![]}];}return db[_0xf199('0x41')][_0xf199('0x56')](_0x1398b7);})[_0xf199('0x20')](function(_0x3b2f08){_0x17aaf6[_0xf199('0x57')]=_0x3b2f08;return _0x17aaf6;})[_0xf199('0x20')](respondWithFilteredResult(_0x3a1287,_0x1398b7))[_0xf199('0x58')](handleError(_0x3a1287,null));};exports[_0xf199('0x59')]=function(_0x17b33c,_0x1b2f6a){var _0x1d96f3={'raw':![],'where':{'id':_0x17b33c['params']['id']},'include':[{'model':db[_0xf199('0x3d')],'as':_0xf199('0x5a')},{'model':db[_0xf199('0x3e')],'as':'Smtp'},{'model':db[_0xf199('0x40')],'as':'mandatoryDispositionPause'}]},_0x4a7936={};_0x4a7936[_0xf199('0x45')]=_[_0xf199('0x5b')](db['MailAccount']['rawAttributes']);_0x4a7936[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x17b33c['query']);_0x4a7936['filters']=_[_0xf199('0x48')](_0x4a7936[_0xf199('0x45')],_0x4a7936[_0xf199('0x46')]);_0x1d96f3[_0xf199('0x49')]=_[_0xf199('0x48')](_0x4a7936[_0xf199('0x45')],qs['fields'](_0x17b33c[_0xf199('0x46')]['fields']));_0x1d96f3[_0xf199('0x49')]=_0x1d96f3[_0xf199('0x49')][_0xf199('0x4b')]?_0x1d96f3[_0xf199('0x49')]:_0x4a7936[_0xf199('0x45')];if(_0x17b33c[_0xf199('0x46')][_0xf199('0x5c')]){_0x1d96f3[_0xf199('0x55')]=[{'all':!![]}];}_0x1d96f3=_[_0xf199('0x52')]({},_0x1d96f3,_0x17b33c[_0xf199('0x54')]);return db['MailAccount'][_0xf199('0x5d')](_0x1d96f3)[_0xf199('0x20')](handleEntityNotFound(_0x1b2f6a,null))['then'](respondWithResult(_0x1b2f6a,null))[_0xf199('0x58')](handleError(_0x1b2f6a,null));};exports[_0xf199('0x34')]=function(_0x894a3f,_0x5979ce){if(_0x894a3f[_0xf199('0x5e')]['id']){delete _0x894a3f[_0xf199('0x5e')]['id'];}return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x894a3f[_0xf199('0x5f')]['id']},'include':[{'model':db[_0xf199('0x3d')],'as':'Imap'},{'model':db[_0xf199('0x3e')],'as':'Smtp'},{'model':db[_0xf199('0x40')],'as':_0xf199('0x60')}]})[_0xf199('0x20')](handleEntityNotFound(_0x5979ce,null))[_0xf199('0x20')](saveUpdates(_0x894a3f[_0xf199('0x5e')],null))[_0xf199('0x20')](function(_0x40d6ba){if(_0x40d6ba&&_0x894a3f[_0xf199('0x5e')][_0xf199('0x5a')]){return db[_0xf199('0x3d')][_0xf199('0x34')](_0x894a3f[_0xf199('0x5e')][_0xf199('0x5a')],{'where':{'MailAccountId':_0x40d6ba['id']}})[_0xf199('0x20')](function(){return _0x40d6ba;});}return _0x40d6ba;})[_0xf199('0x20')](function(_0x53044f){if(_0x53044f&&_0x894a3f[_0xf199('0x5e')][_0xf199('0x3f')]){return db[_0xf199('0x3e')][_0xf199('0x34')](_0x894a3f[_0xf199('0x5e')][_0xf199('0x3f')],{'where':{'MailAccountId':_0x53044f['id']}})['then'](function(){return _0x53044f;});}return _0x53044f;})['then'](respondWithResult(_0x5979ce,null))[_0xf199('0x58')](handleError(_0x5979ce,null));};exports[_0xf199('0x61')]=function(_0x376029,_0x74ff99){return db[_0xf199('0x41')][_0xf199('0x61')]()['then'](respondWithResult(_0x74ff99,null))[_0xf199('0x58')](handleError(_0x74ff99,null));};exports[_0xf199('0x62')]=function(_0x3d9b20,_0x588572,_0x4ed96a){if(_0x3d9b20['body']['id']){delete _0x3d9b20[_0xf199('0x5e')]['id'];}return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x3d9b20[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x588572,null))[_0xf199('0x20')](function(_0x252ff6){if(_0x252ff6){_0x3d9b20[_0xf199('0x5e')][_0xf199('0x63')]=_0x252ff6['id'];return db[_0xf199('0x64')][_0xf199('0x65')](_0x3d9b20[_0xf199('0x5e')]);}})[_0xf199('0x20')](respondWithResult(_0x588572,null))[_0xf199('0x58')](handleError(_0x588572,null));};exports[_0xf199('0x66')]=function(_0x19c0bf,_0x4700a0,_0x466627){var _0x77fa51={'raw':![],'where':{}};var _0x20bf93={};var _0x4c3ce4={'count':0x0,'rows':[]};return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x19c0bf[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x4700a0,null))['then'](function(_0x1d1565){if(_0x1d1565){_0x20bf93[_0xf199('0x45')]=_['keys'](db['Disposition']['rawAttributes']);_0x20bf93[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x19c0bf[_0xf199('0x46')]);_0x20bf93[_0xf199('0x47')]=_['intersection'](_0x20bf93[_0xf199('0x45')],_0x20bf93[_0xf199('0x46')]);_0x77fa51[_0xf199('0x49')]=_[_0xf199('0x48')](_0x20bf93[_0xf199('0x45')],qs['fields'](_0x19c0bf[_0xf199('0x46')][_0xf199('0x4a')]));_0x77fa51[_0xf199('0x49')]=_0x77fa51['attributes'][_0xf199('0x4b')]?_0x77fa51[_0xf199('0x49')]:_0x20bf93[_0xf199('0x45')];if(!_0x19c0bf['query'][_0xf199('0x4c')]('nolimit')){_0x77fa51[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x19c0bf['query'][_0xf199('0x2d')]);_0x77fa51[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x19c0bf['query'][_0xf199('0x2b')]);}_0x77fa51['order']=qs[_0xf199('0x4f')](_0x19c0bf[_0xf199('0x46')][_0xf199('0x4f')]);_0x77fa51[_0xf199('0x50')]=qs['filters'](_[_0xf199('0x68')](_0x19c0bf['query'],_0x20bf93[_0xf199('0x47')]));_0x77fa51[_0xf199('0x50')]['MailAccountId']=_0x1d1565['id'];if(_0x19c0bf['query'][_0xf199('0x51')]){_0x77fa51['where']=_[_0xf199('0x52')](_0x77fa51[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x77fa51[_0xf199('0x49')],function(_0x35acfa){var _0x4e5f7c={};_0x4e5f7c[_0x35acfa]={'$like':'%'+_0x19c0bf[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x4e5f7c;})});}_0x77fa51=_['merge']({},_0x77fa51,_0x19c0bf[_0xf199('0x54')]);return db[_0xf199('0x64')][_0xf199('0x2e')]({'where':_0x77fa51[_0xf199('0x50')]})[_0xf199('0x20')](function(_0xb25da2){_0x4c3ce4[_0xf199('0x2e')]=_0xb25da2;if(_0x19c0bf[_0xf199('0x46')]['includeAll']){_0x77fa51[_0xf199('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xf199('0x56')](_0x77fa51);})[_0xf199('0x20')](function(_0x21f6bb){_0x4c3ce4[_0xf199('0x57')]=_0x21f6bb;return _0x4c3ce4;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x4700a0,_0x77fa51))[_0xf199('0x58')](handleError(_0x4700a0,null));};exports[_0xf199('0x69')]=function(_0x1b0357,_0x567520,_0x3dc5d4){return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x1b0357['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x567520,null))['then'](function(_0x17a20d){if(_0x17a20d){return _0x17a20d['removeDispositions'](_0x1b0357['query'][_0xf199('0x6a')]);}})['then'](respondWithStatusCode(_0x567520,null))['catch'](handleError(_0x567520,null));};exports[_0xf199('0x6b')]=function(_0x360e0b,_0xcba034,_0x476c93){if(_0x360e0b[_0xf199('0x5e')]['id']){delete _0x360e0b[_0xf199('0x5e')]['id'];}return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x360e0b[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0xcba034,null))[_0xf199('0x20')](function(_0xd3e4c1){if(_0xd3e4c1){_0x360e0b[_0xf199('0x5e')][_0xf199('0x63')]=_0xd3e4c1['id'];return db[_0xf199('0x6c')]['create'](_0x360e0b[_0xf199('0x5e')]);}})['then'](respondWithResult(_0xcba034,null))[_0xf199('0x58')](handleError(_0xcba034,null));};exports[_0xf199('0x6d')]=function(_0x49ba40,_0x3b5386,_0x3f76de){var _0x35e068={'raw':![],'where':{}};var _0x22be60={};var _0x6677e4={'count':0x0,'rows':[]};return db[_0xf199('0x41')]['findOne']({'where':{'id':_0x49ba40[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x3b5386,null))[_0xf199('0x20')](function(_0x2d917f){if(_0x2d917f){_0x22be60[_0xf199('0x45')]=_[_0xf199('0x5b')](db['CannedAnswer']['rawAttributes']);_0x22be60['query']=_['keys'](_0x49ba40[_0xf199('0x46')]);_0x22be60[_0xf199('0x47')]=_[_0xf199('0x48')](_0x22be60['model'],_0x22be60['query']);_0x35e068['attributes']=_[_0xf199('0x48')](_0x22be60['model'],qs[_0xf199('0x4a')](_0x49ba40['query'][_0xf199('0x4a')]));_0x35e068[_0xf199('0x49')]=_0x35e068[_0xf199('0x49')][_0xf199('0x4b')]?_0x35e068[_0xf199('0x49')]:_0x22be60[_0xf199('0x45')];if(!_0x49ba40[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0x35e068[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x49ba40[_0xf199('0x46')][_0xf199('0x2d')]);_0x35e068['offset']=qs[_0xf199('0x2b')](_0x49ba40[_0xf199('0x46')][_0xf199('0x2b')]);}_0x35e068['order']=qs[_0xf199('0x4f')](_0x49ba40[_0xf199('0x46')][_0xf199('0x4f')]);_0x35e068['where']=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x49ba40[_0xf199('0x46')],_0x22be60[_0xf199('0x47')]));_0x35e068['where'][_0xf199('0x63')]=_0x2d917f['id'];if(_0x49ba40['query'][_0xf199('0x51')]){_0x35e068[_0xf199('0x50')]=_[_0xf199('0x52')](_0x35e068[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x35e068[_0xf199('0x49')],function(_0x2a3c23){var _0x41459b={};_0x41459b[_0x2a3c23]={'$like':'%'+_0x49ba40[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x41459b;})});}_0x35e068=_['merge']({},_0x35e068,_0x49ba40['options']);return db[_0xf199('0x6c')][_0xf199('0x2e')]({'where':_0x35e068[_0xf199('0x50')]})[_0xf199('0x20')](function(_0x1f726d){_0x6677e4[_0xf199('0x2e')]=_0x1f726d;if(_0x49ba40[_0xf199('0x46')][_0xf199('0x5c')]){_0x35e068[_0xf199('0x55')]=[{'all':!![]}];}return db[_0xf199('0x6c')]['findAll'](_0x35e068);})[_0xf199('0x20')](function(_0x51936e){_0x6677e4['rows']=_0x51936e;return _0x6677e4;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x3b5386,_0x35e068))[_0xf199('0x58')](handleError(_0x3b5386,null));};exports[_0xf199('0x6e')]=function(_0x2558f0,_0x230f38,_0x4c47c8){return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x2558f0[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x230f38,null))[_0xf199('0x20')](function(_0x4c974e){if(_0x4c974e){return _0x4c974e['removeAnswers'](_0x2558f0['query'][_0xf199('0x6a')]);}})[_0xf199('0x20')](respondWithStatusCode(_0x230f38,null))['catch'](handleError(_0x230f38,null));};exports[_0xf199('0x65')]=function(_0x8f93ac,_0x17ce0f){var _0x47207e={'name':_0x8f93ac['body'][_0xf199('0x3b')],'key':_0x8f93ac[_0xf199('0x5e')]['key'],'email':_0x8f93ac['body'][_0xf199('0x6f')],'ListId':_0x8f93ac[_0xf199('0x5e')][_0xf199('0x70')],'active':!_['isNil'](_0x8f93ac[_0xf199('0x5e')]['active'])?_0x8f93ac['body'][_0xf199('0x71')]:!![],'description':_0x8f93ac[_0xf199('0x5e')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xf199('0x72')](_0x8f93ac[_0xf199('0x5e')]['cservice'])){if(_0x8f93ac['body'][_0xf199('0x73')]){_0x47207e[_0xf199('0x5a')][_0xf199('0x74')]=_0x47207e['Smtp'][_0xf199('0x74')]=_0x8f93ac['body'][_0xf199('0x75')];_0x47207e[_0xf199('0x5a')]['password']=_0x47207e[_0xf199('0x3f')][_0xf199('0x76')]=_0x8f93ac[_0xf199('0x5e')]['cpassword'];}else{_0x47207e[_0xf199('0x5a')]['authentication']=_0x47207e[_0xf199('0x3f')][_0xf199('0x77')]=![];}_0x47207e[_0xf199('0x5a')][_0xf199('0x78')]=_0x8f93ac['body']['Imap'][_0xf199('0x78')];_0x47207e['Imap'][_0xf199('0x79')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x5a')][_0xf199('0x79')];_0x47207e[_0xf199('0x3f')][_0xf199('0x78')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x3f')]['host'];_0x47207e[_0xf199('0x3f')][_0xf199('0x79')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x3f')][_0xf199('0x79')];}else{_0x47207e[_0xf199('0x5a')][_0xf199('0x7a')]=_0x47207e[_0xf199('0x3f')]['service']=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x7b')];_0x47207e['Imap'][_0xf199('0x74')]=_0x47207e[_0xf199('0x3f')]['user']=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x75')];_0x47207e[_0xf199('0x5a')][_0xf199('0x7c')]=_0x47207e[_0xf199('0x3f')][_0xf199('0x76')]=_0x8f93ac[_0xf199('0x5e')][_0xf199('0x7d')];}return db[_0xf199('0x41')][_0xf199('0x65')](_0x47207e,{'include':[{'model':db[_0xf199('0x3e')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0xf199('0x5a')}]})['then'](function(_0x854aa9){var _0x4a5e51=_0x8f93ac['user'][_0xf199('0x36')]({'plain':!![]});if(!_0x4a5e51)throw new Error(_0xf199('0x7e'));if(_0x4a5e51[_0xf199('0x7f')]===_0xf199('0x74')){var _0x3c6559=_0x854aa9[_0xf199('0x36')]({'plain':!![]});return db['UserProfileSection'][_0xf199('0x5d')]({'where':{'name':_0xf199('0x37'),'userProfileId':_0x4a5e51['userProfileId']},'raw':!![]})[_0xf199('0x20')](function(_0x4e929f){if(_0x4e929f&&_0x4e929f[_0xf199('0x80')]===0x0){return db['UserProfileResource'][_0xf199('0x65')]({'name':_0x3c6559[_0xf199('0x3b')],'resourceId':_0x3c6559['id'],'type':_0x4e929f['name'],'sectionId':_0x4e929f['id']},{})[_0xf199('0x20')](function(){return _0x854aa9;});}else{return _0x854aa9;}})[_0xf199('0x58')](function(_0x2fcf2d){logger[_0xf199('0x25')](_0xf199('0x81'),_0x2fcf2d);throw _0x2fcf2d;});}return _0x854aa9;})[_0xf199('0x20')](respondWithResult(_0x17ce0f,0xc9))[_0xf199('0x58')](handleError(_0x17ce0f,null));};exports[_0xf199('0x82')]=function(_0x439854,_0x3acda8,_0x42c3f2){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x439854['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x3acda8,null))[_0xf199('0x20')](function(_0x5c26b1){if(_0x5c26b1){return _0x5c26b1[_0xf199('0x82')]();}return null;})[_0xf199('0x20')](respondWithResult(_0x3acda8,null))[_0xf199('0x58')](handleError(_0x3acda8,null));};exports['addImap']=function(_0x4a79ff,_0x548e45,_0x270798){if(_0x4a79ff[_0xf199('0x5e')]['id']){delete _0x4a79ff[_0xf199('0x5e')]['id'];}return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x4a79ff[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x548e45,null))['then'](function(_0x2c081f){if(_0x2c081f){_0x4a79ff[_0xf199('0x5e')][_0xf199('0x63')]=_0x2c081f['id'];return db[_0xf199('0x3d')]['create'](_0x4a79ff['body']);}})[_0xf199('0x20')](respondWithResult(_0x548e45,null))['catch'](handleError(_0x548e45,null));};exports[_0xf199('0x83')]=function(_0x3c4427,_0x32d045,_0x759982){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x3c4427[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x32d045,null))[_0xf199('0x20')](function(_0x5ee990){if(_0x5ee990){return _0x5ee990[_0xf199('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x32d045,null))[_0xf199('0x58')](handleError(_0x32d045,null));};exports[_0xf199('0x85')]=function(_0x3c1d27,_0x366cf0,_0x315830){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x3c1d27[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x366cf0,null))['then'](function(_0xff3f90){if(_0xff3f90){return _0xff3f90[_0xf199('0x85')]();}return null;})[_0xf199('0x20')](respondWithResult(_0x366cf0,null))[_0xf199('0x58')](handleError(_0x366cf0,null));};exports[_0xf199('0x86')]=function(_0x4a821a,_0x436761,_0x3e9743){if(_0x4a821a['body']['id']){delete _0x4a821a[_0xf199('0x5e')]['id'];}return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x4a821a['params']['id']}})['then'](handleEntityNotFound(_0x436761,null))[_0xf199('0x20')](function(_0x5097b5){if(_0x5097b5){_0x4a821a[_0xf199('0x5e')][_0xf199('0x63')]=_0x5097b5['id'];return db[_0xf199('0x3e')][_0xf199('0x65')](_0x4a821a[_0xf199('0x5e')]);}})['then'](respondWithResult(_0x436761,null))[_0xf199('0x58')](handleError(_0x436761,null));};exports[_0xf199('0x87')]=function(_0x592411,_0x315264,_0x33be4a){return db[_0xf199('0x41')]['findOne']({'where':{'id':_0x592411['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x315264,null))[_0xf199('0x20')](function(_0x40e7b6){if(_0x40e7b6){return _0x40e7b6[_0xf199('0x88')](null);}return null;})[_0xf199('0x20')](respondWithStatusCode(_0x315264,null))[_0xf199('0x58')](handleError(_0x315264,null));};exports[_0xf199('0x89')]=function(_0x35c329,_0xfc791e,_0x2e50e8){return db[_0xf199('0x8a')][_0xf199('0x5d')]({'where':{'id':_0x35c329[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0xfc791e,null))['then'](function(_0x52003d){if(_0x52003d){return _0x52003d[_0xf199('0x89')](_0x35c329[_0xf199('0x5e')]['ids'],_[_0xf199('0x8b')](_0x35c329[_0xf199('0x5e')],['ids','id'])||{});}})[_0xf199('0x20')](respondWithResult(_0xfc791e,null))[_0xf199('0x58')](handleError(_0xfc791e,null));};exports[_0xf199('0x8c')]=function(_0x39f88a,_0x6699ce,_0x177e97){var _0x728f33={'raw':![],'where':{}};var _0x34d49c={};var _0x105858={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x39f88a['params']['id']}})['then'](handleEntityNotFound(_0x6699ce,null))[_0xf199('0x20')](function(_0x57a1b6){if(_0x57a1b6){_0x34d49c[_0xf199('0x45')]=_[_0xf199('0x5b')](db['MailInteraction'][_0xf199('0x42')]);_0x34d49c[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x39f88a[_0xf199('0x46')]);_0x34d49c[_0xf199('0x47')]=_[_0xf199('0x48')](_0x34d49c[_0xf199('0x45')],_0x34d49c[_0xf199('0x46')]);_0x728f33[_0xf199('0x49')]=_[_0xf199('0x48')](_0x34d49c[_0xf199('0x45')],qs[_0xf199('0x4a')](_0x39f88a[_0xf199('0x46')][_0xf199('0x4a')]));_0x728f33[_0xf199('0x49')]=_0x728f33[_0xf199('0x49')][_0xf199('0x4b')]?_0x728f33['attributes']:_0x34d49c[_0xf199('0x45')];if(!_0x39f88a['query'][_0xf199('0x4c')]('nolimit')){_0x728f33[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x39f88a[_0xf199('0x46')][_0xf199('0x2d')]);_0x728f33[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x39f88a[_0xf199('0x46')][_0xf199('0x2b')]);}_0x728f33[_0xf199('0x4e')]=qs[_0xf199('0x4f')](_0x39f88a['query'][_0xf199('0x4f')]);_0x728f33[_0xf199('0x50')]=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x39f88a[_0xf199('0x46')],_0x34d49c[_0xf199('0x47')]));_0x728f33['where']['MailAccountId']=_0x57a1b6['id'];if(_0x39f88a[_0xf199('0x46')][_0xf199('0x51')]){_0x728f33['where']=_['merge'](_0x728f33[_0xf199('0x50')],{'$or':_['map'](_0x728f33[_0xf199('0x49')],function(_0x525ff5){var _0x28a224={};_0x28a224[_0x525ff5]={'$like':'%'+_0x39f88a[_0xf199('0x46')][_0xf199('0x51')]+'%'};return _0x28a224;})});}_0x728f33=_[_0xf199('0x52')]({},_0x728f33,_0x39f88a['options']);return db[_0xf199('0x8a')][_0xf199('0x2e')]({'where':_0x728f33[_0xf199('0x50')]})[_0xf199('0x20')](function(_0x3b5d16){_0x105858[_0xf199('0x2e')]=_0x3b5d16;if(_0x39f88a[_0xf199('0x46')][_0xf199('0x5c')]){_0x728f33['include']=[{'model':db[_0xf199('0x8d')],'as':'Contact','required':![]},{'model':db[_0xf199('0x8e')],'as':'Owner','attributes':['name',_0xf199('0x8f'),_0xf199('0x90')],'required':![]},{'model':db[_0xf199('0x91')],'as':_0xf199('0x92'),'attributes':['id','name',_0xf199('0x93')],'where':_0x39f88a[_0xf199('0x46')][_0xf199('0x94')]?{'id':_0x39f88a[_0xf199('0x46')]['tag']}:undefined,'required':_0x39f88a[_0xf199('0x46')]['tag']?!![]:![]}];}return db[_0xf199('0x8a')]['findAll'](_0x728f33);})[_0xf199('0x20')](function(_0x6a0d7b){_0x105858[_0xf199('0x57')]=_0x6a0d7b;return _0x105858;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x6699ce,_0x728f33))['catch'](handleError(_0x6699ce,null));};exports[_0xf199('0x95')]=function(_0x512dcf,_0x17f1c7,_0x515484){return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x512dcf['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x17f1c7,null))[_0xf199('0x20')](function(_0x411af8){if(_0x411af8){return db['sequelize'][_0xf199('0x96')](function(_0x4e095a){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x512dcf[_0xf199('0x5f')]['id']},'transaction':_0x4e095a})[_0xf199('0x20')](function(_0xb316ef){var _0x5e0c51=_[_0xf199('0x53')](_0x512dcf[_0xf199('0x5e')],function(_0x594f40){_0x594f40[_0xf199('0x63')]=_0x512dcf['params']['id'];return _0x594f40;});return db[_0xf199('0x97')]['bulkCreate'](_0x5e0c51,{'transaction':_0x4e095a});});})[_0xf199('0x20')](function(){return db[_0xf199('0x97')][_0xf199('0x98')]({'where':{'MailAccountId':_0x512dcf[_0xf199('0x5f')]['id']},'order':_0xf199('0x99')});});}})[_0xf199('0x20')](respondWithResult(_0x17f1c7,null))[_0xf199('0x58')](handleError(_0x17f1c7,null));};exports[_0xf199('0x9a')]=function(_0x596d42,_0x38253b,_0x2ed7aa){var _0x33269b={};var _0x5b494a={};var _0x432821;var _0x1470e6;return db['MailAccount'][_0xf199('0x67')]({'where':{'id':_0x596d42[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x38253b,null))[_0xf199('0x20')](function(_0x42611b){if(_0x42611b){_0x432821=_0x42611b;_0x5b494a[_0xf199('0x45')]=_[_0xf199('0x5b')](db['MailApplication'][_0xf199('0x42')]);_0x5b494a[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x596d42['query']);_0x5b494a[_0xf199('0x47')]=_['intersection'](_0x5b494a[_0xf199('0x45')],_0x5b494a[_0xf199('0x46')]);_0x33269b[_0xf199('0x49')]=_[_0xf199('0x48')](_0x5b494a['model'],qs['fields'](_0x596d42[_0xf199('0x46')]['fields']));_0x33269b['attributes']=_0x33269b[_0xf199('0x49')][_0xf199('0x4b')]?_0x33269b[_0xf199('0x49')]:_0x5b494a[_0xf199('0x45')];_0x33269b['order']=qs[_0xf199('0x4f')](_0x596d42[_0xf199('0x46')][_0xf199('0x4f')]);_0x33269b[_0xf199('0x50')]=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x596d42[_0xf199('0x46')],_0x5b494a[_0xf199('0x47')]));if(_0x596d42[_0xf199('0x46')][_0xf199('0x51')]){_0x33269b[_0xf199('0x50')]=_['merge'](_0x33269b[_0xf199('0x50')],{'$or':_[_0xf199('0x53')](_0x33269b[_0xf199('0x49')],function(_0x4a1147){var _0x4d29ec={};_0x4d29ec[_0x4a1147]={'$like':'%'+_0x596d42['query'][_0xf199('0x51')]+'%'};return _0x4d29ec;})});}_0x33269b=_[_0xf199('0x52')]({},_0x33269b,_0x596d42[_0xf199('0x54')]);return _0x432821[_0xf199('0x9a')](_0x33269b);}})[_0xf199('0x20')](function(_0x387be1){if(_0x387be1){_0x1470e6=_0x387be1['length'];if(!_0x596d42[_0xf199('0x46')][_0xf199('0x4c')]('nolimit')){_0x33269b[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x596d42[_0xf199('0x46')]['limit']);_0x33269b[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x596d42[_0xf199('0x46')][_0xf199('0x2b')]);}return _0x432821[_0xf199('0x9a')](_0x33269b);}})[_0xf199('0x20')](function(_0x569b95){if(_0x569b95){return _0x569b95?{'count':_0x1470e6,'rows':_0x569b95}:null;}})[_0xf199('0x20')](respondWithResult(_0x38253b,null))['catch'](handleError(_0x38253b,null));};exports['getMessages']=function(_0x635e07,_0x5109b0,_0x435bd7){var _0xd0f8c8={'raw':!![],'where':{}};var _0x16d5f3={};var _0x178fd2={'count':0x0,'rows':[]};return db[_0xf199('0x41')]['findOne']({'where':{'id':_0x635e07[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x5109b0,null))[_0xf199('0x20')](function(_0xf4a12b){if(_0xf4a12b){_0x16d5f3['model']=_[_0xf199('0x5b')](db[_0xf199('0x9b')][_0xf199('0x42')]);_0x16d5f3[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x635e07['query']);_0x16d5f3[_0xf199('0x47')]=_[_0xf199('0x48')](_0x16d5f3[_0xf199('0x45')],_0x16d5f3[_0xf199('0x46')]);_0xd0f8c8['attributes']=_[_0xf199('0x48')](_0x16d5f3['model'],qs[_0xf199('0x4a')](_0x635e07[_0xf199('0x46')][_0xf199('0x4a')]));_0xd0f8c8[_0xf199('0x49')]=_0xd0f8c8[_0xf199('0x49')][_0xf199('0x4b')]?_0xd0f8c8['attributes']:_0x16d5f3['model'];if(!_0x635e07[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0xd0f8c8[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x635e07[_0xf199('0x46')]['limit']);_0xd0f8c8[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x635e07[_0xf199('0x46')][_0xf199('0x2b')]);}_0xd0f8c8[_0xf199('0x4e')]=qs['sort'](_0x635e07[_0xf199('0x46')][_0xf199('0x4f')]);_0xd0f8c8[_0xf199('0x50')]=qs[_0xf199('0x47')](_['pick'](_0x635e07[_0xf199('0x46')],_0x16d5f3[_0xf199('0x47')]));_0xd0f8c8['where'][_0xf199('0x63')]=_0xf4a12b['id'];if(_0x635e07[_0xf199('0x46')][_0xf199('0x51')]){_0xd0f8c8['where']=_[_0xf199('0x52')](_0xd0f8c8[_0xf199('0x50')],{'$or':_['map'](_0xd0f8c8[_0xf199('0x49')],function(_0x233560){var _0x49ac30={};_0x49ac30[_0x233560]={'$like':'%'+_0x635e07[_0xf199('0x46')]['filter']+'%'};return _0x49ac30;})});}if(_0x635e07['query']['$gte']){var _0x443295=_0x635e07[_0xf199('0x46')]['$gte'][_0xf199('0x9c')](',');var _0x166906={};_0x166906[_0x443295[0x0]]={'$gte':moment(_0x443295[0x1])['format'](_0xf199('0x9d'))};_0xd0f8c8[_0xf199('0x50')]=_['merge'](_0xd0f8c8['where'],_0x166906);}_0xd0f8c8=_['merge']({},_0xd0f8c8,_0x635e07[_0xf199('0x54')]);return db[_0xf199('0x9b')][_0xf199('0x2e')]({'where':_0xd0f8c8[_0xf199('0x50')]})[_0xf199('0x20')](function(_0x5e5f2a){_0x178fd2[_0xf199('0x2e')]=_0x5e5f2a;if(_0x635e07[_0xf199('0x46')][_0xf199('0x5c')]){_0xd0f8c8[_0xf199('0x55')]=[{'all':!![]}];}return db['MailMessage'][_0xf199('0x56')](_0xd0f8c8);})['then'](function(_0x499325){if(_0x635e07[_0xf199('0x46')][_0xf199('0x9e')]==='true'){for(var _0xb55994=0x0;_0xb55994<_0x499325[_0xf199('0x4b')];_0xb55994++){_0x499325[_0xb55994][_0xf199('0x5e')]=juice(_0x499325[_0xb55994][_0xf199('0x5e')]);}}_0x178fd2[_0xf199('0x57')]=_0x499325;return _0x178fd2;});}})[_0xf199('0x20')](respondWithFilteredResult(_0x5109b0,_0xd0f8c8))['catch'](handleError(_0x5109b0,null));};exports[_0xf199('0x9f')]=function(_0x3f3a5e,_0x5c7940,_0x2d6917){var _0x4cf939,_0x3b1c28={},_0x4623b1;if(_0x3f3a5e[_0xf199('0x5e')]['to']){_0x4623b1=_0x3f3a5e[_0xf199('0x5e')]['to'][_0xf199('0x9c')](',')[0x0];}return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0x3f3a5e[_0xf199('0x5f')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xf199('0x8d')],'as':'Contacts','where':{'email':_0x4623b1},'limit':0x1,'order':[[_0xf199('0xa0'),_0xf199('0xa1')]]}]},{'model':db[_0xf199('0x3e')],'as':_0xf199('0x3f'),'raw':!![]}]})[_0xf199('0x20')](handleEntityNotFound(_0x5c7940,null))[_0xf199('0x20')](function(_0x27a35c){if(_0x27a35c){_0x4cf939=_0x27a35c;if(_0x27a35c[_0xf199('0x3f')]){if(_[_0xf199('0x72')](_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa2')])){_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa2')]=util[_0xf199('0xa3')](_0xf199('0xa4'),_0x27a35c['name'],_0x27a35c[_0xf199('0x6f')]||_0x27a35c[_0xf199('0x3f')][_0xf199('0x74')]);}if(_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')]&&_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')]['length']){for(var _0x1a80c2=0x0;_0x1a80c2<_0x3f3a5e[_0xf199('0x5e')]['attachments'][_0xf199('0x4b')];_0x1a80c2+=0x1){_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')][_0x1a80c2]={'filename':_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')][_0x1a80c2][_0xf199('0x3b')],'path':path['join'](config[_0xf199('0xa6')],_0xf199('0xa7'),_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xa5')][_0x1a80c2][_0xf199('0xa8')])};}}var _0x3b1379={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x27a35c[_0xf199('0x3f')][_0xf199('0x7a')])){if(_0x27a35c[_0xf199('0x3f')][_0xf199('0x77')]){_0x3b1379[_0xf199('0xa9')]={'user':_0x27a35c['Smtp'][_0xf199('0x74')],'pass':_0x27a35c[_0xf199('0x3f')][_0xf199('0x76')]};}_0x3b1379[_0xf199('0x78')]=_0x27a35c[_0xf199('0x3f')]['host'];_0x3b1379[_0xf199('0x79')]=_0x27a35c['Smtp'][_0xf199('0x79')];_0x3b1379[_0xf199('0xaa')]=_0x27a35c[_0xf199('0x3f')]['secure'];}else{_0x3b1379[_0xf199('0x7a')]=_0x27a35c[_0xf199('0x3f')][_0xf199('0x7a')];_0x3b1379[_0xf199('0xa9')]={'user':_0x27a35c[_0xf199('0x3f')][_0xf199('0x74')],'pass':_0x27a35c[_0xf199('0x3f')]['pass']};}return respondWithRpcPromise(_0xf199('0xab'),_0xf199('0xac'),{'account':_0x3b1379,'message':_0x3f3a5e[_0xf199('0x5e')]});}else{throw new Error(_0xf199('0xad'));}}})[_0xf199('0x20')](function(_0x7bcee3){if(_0x7bcee3){_0x3b1c28=_0x7bcee3;if(_0x4cf939[_0xf199('0xae')]){if(_0x4cf939['List'][_0xf199('0xaf')][_0xf199('0x4b')]){return _0x4cf939[_0xf199('0xae')][_0xf199('0xaf')][0x0];}else{return db['CmContact'][_0xf199('0x65')](_['defaults'](_0x3f3a5e[_0xf199('0x5e')],{'firstName':_0x3f3a5e[_0xf199('0x5e')]['to'],'email':_0x3f3a5e['body']['to'],'phone':_0x3f3a5e[_0xf199('0x5e')]['to'],'ListId':_0x4cf939[_0xf199('0x70')]}));}}else{throw new Error(_0xf199('0xad'));}}})['then'](function(_0x4c48c2){if(_0x4c48c2){var _0x45dbba={'UserId':_0x3f3a5e[_0xf199('0x74')]['id'],'ContactId':_0x4c48c2['id'],'MailAccountId':_0x4cf939['id'],'inReplyTo':_0x3b1c28[_0xf199('0xb0')],'to':_0x3f3a5e['body'][_0xf199('0xa2')],'cc':_0x3f3a5e['body']['cc'],'subject':_0x3f3a5e[_0xf199('0x5e')]['subject'],'attach':_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xb1')],'firstMsgDirection':_0xf199('0xb2'),'lastMsgAt':moment()[_0xf199('0xa3')](_0xf199('0x9d')),'lastMsgDirection':_0xf199('0xb2'),'Messages':[_[_0xf199('0x52')](_0x3f3a5e['body'],{'messageId':_0x3b1c28[_0xf199('0xb0')],'sentAt':moment()[_0xf199('0xa3')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x4cf939['id'],'UserId':_0x3f3a5e[_0xf199('0x74')]['id'],'ContactId':_0x4c48c2['id']})]};if(_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xb3')]){_0x45dbba=_['merge'](_0x45dbba,_0x3f3a5e[_0xf199('0x5e')][_0xf199('0xb3')]);}return db[_0xf199('0x8a')][_0xf199('0x65')](_0x45dbba,{'include':[{'model':db[_0xf199('0x9b')],'as':_0xf199('0xb4')}]});}})[_0xf199('0x20')](respondWithResult(_0x5c7940,null))[_0xf199('0x58')](handleError(_0x5c7940,null));};exports[_0xf199('0xb5')]=function(_0x1fbd9e,_0x23a31f,_0x1731df){return db[_0xf199('0x41')][_0xf199('0x5d')]({'where':{'id':_0x1fbd9e[_0xf199('0x5f')]['id']},'include':[{'model':db[_0xf199('0x3e')],'as':_0xf199('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x23a31f,null))[_0xf199('0x20')](function(_0x3cadcc){if(_0x3cadcc&&_0x3cadcc[_0xf199('0x3f')]){var _0xe42016={'id':_0x3cadcc['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3cadcc[_0xf199('0x3f')][_0xf199('0x7a')]){_0xe42016[_0xf199('0x7a')]=_0x3cadcc[_0xf199('0x3f')][_0xf199('0x7a')];}else{_0xe42016[_0xf199('0x78')]=_0x3cadcc[_0xf199('0x3f')][_0xf199('0x78')];_0xe42016['port']=_0x3cadcc['Smtp'][_0xf199('0x79')];_0xe42016[_0xf199('0xaa')]=_0x3cadcc[_0xf199('0x3f')]['secure'];}if(_0x3cadcc[_0xf199('0x3f')][_0xf199('0x77')]){_0xe42016[_0xf199('0xa9')]={'user':_0x3cadcc[_0xf199('0x3f')][_0xf199('0x74')],'pass':_0x3cadcc[_0xf199('0x3f')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0xf199('0xb5'),{'account':_0xe42016});}})[_0xf199('0x20')](respondWithResult(_0x23a31f,null))[_0xf199('0x58')](handleError(_0x23a31f,null));};exports[_0xf199('0x35')]=function(_0xcfb8a0,_0x10c569){return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0xcfb8a0['params']['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x10c569,null))['then'](function(_0xd07017){if(_0xd07017&&_0xd07017['service']){throw new db[(_0xf199('0xb6'))][(_0xf199('0xb7'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0xd07017;})[_0xf199('0x20')](removeEntity(_0x10c569,null))[_0xf199('0x58')](handleError(_0x10c569,null));};exports[_0xf199('0xb8')]=function(_0xa4ae4c,_0x5a951c,_0x25cc44){return db['MailAccount'][_0xf199('0x5d')]({'where':{'id':_0xa4ae4c[_0xf199('0x5f')]['id']}})[_0xf199('0x20')](handleEntityNotFound(_0x5a951c,null))[_0xf199('0x20')](function(_0x20c35a){if(_0x20c35a){return _0x20c35a[_0xf199('0xb8')](_0xa4ae4c[_0xf199('0x5e')][_0xf199('0x6a')],_[_0xf199('0x8b')](_0xa4ae4c['body'],[_0xf199('0x6a'),'id'])||{})[_0xf199('0xb9')](function(_0x38a4cd){for(var _0x406f24=0x0;_0x406f24<_0xa4ae4c['body'][_0xf199('0x6a')][_0xf199('0x4b')];_0x406f24+=0x1){socket[_0xf199('0xba')]('userMailAccount:save',{'UserId':Number(_0xa4ae4c[_0xf199('0x5e')][_0xf199('0x6a')][_0x406f24]),'MailAccountId':Number(_0xa4ae4c[_0xf199('0x5f')]['id'])});}return _0x38a4cd;});}})['then'](respondWithResult(_0x5a951c,null))[_0xf199('0x58')](handleError(_0x5a951c,null));};exports['removeAgents']=function(_0x2c025a,_0x29d5f9,_0x47b66f){return db[_0xf199('0x41')]['find']({'where':{'id':_0x2c025a[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x29d5f9,null))[_0xf199('0x20')](function(_0x1432a1){if(_0x1432a1){return _0x1432a1[_0xf199('0xbb')](_0x2c025a[_0xf199('0x46')][_0xf199('0x6a')])[_0xf199('0x20')](function(){if(_[_0xf199('0xbc')](_0x2c025a[_0xf199('0x46')][_0xf199('0x6a')])){for(var _0x56d38c=0x0;_0x56d38c<_0x2c025a['query'][_0xf199('0x6a')][_0xf199('0x4b')];_0x56d38c+=0x1){socket[_0xf199('0xba')]('userMailAccount:remove',{'UserId':Number(_0x2c025a[_0xf199('0x46')][_0xf199('0x6a')][_0x56d38c]),'MailAccountId':Number(_0x2c025a[_0xf199('0x5f')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x2c025a[_0xf199('0x46')]['ids']),'MailAccountId':Number(_0x2c025a[_0xf199('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x29d5f9,null))[_0xf199('0x58')](handleError(_0x29d5f9,null));};exports[_0xf199('0xbd')]=function(_0x56d57c,_0x36179f,_0x4a3943){var _0x5c7b08={};var _0x1245d1={};var _0x1c5ec7;var _0x56c822;return db[_0xf199('0x41')][_0xf199('0x67')]({'where':{'id':_0x56d57c[_0xf199('0x5f')]['id']}})['then'](handleEntityNotFound(_0x36179f,null))[_0xf199('0x20')](function(_0x44ad83){if(_0x44ad83){_0x1c5ec7=_0x44ad83;_0x1245d1[_0xf199('0x45')]=_[_0xf199('0x5b')](db[_0xf199('0x8e')][_0xf199('0x42')]);_0x1245d1[_0xf199('0x46')]=_[_0xf199('0x5b')](_0x56d57c[_0xf199('0x46')]);_0x1245d1[_0xf199('0x47')]=_[_0xf199('0x48')](_0x1245d1['model'],_0x1245d1[_0xf199('0x46')]);_0x5c7b08[_0xf199('0x49')]=_[_0xf199('0x48')](_0x1245d1['model'],qs[_0xf199('0x4a')](_0x56d57c[_0xf199('0x46')]['fields']));_0x5c7b08[_0xf199('0x49')]=_0x5c7b08[_0xf199('0x49')][_0xf199('0x4b')]?_0x5c7b08[_0xf199('0x49')]:_0x1245d1[_0xf199('0x45')];_0x5c7b08['order']=qs[_0xf199('0x4f')](_0x56d57c[_0xf199('0x46')][_0xf199('0x4f')]);_0x5c7b08['where']=qs[_0xf199('0x47')](_[_0xf199('0x68')](_0x56d57c['query'],_0x1245d1[_0xf199('0x47')]));if(_0x56d57c['query']['filter']){_0x5c7b08['where']=_['merge'](_0x5c7b08['where'],{'$or':_[_0xf199('0x53')](_0x5c7b08[_0xf199('0x49')],function(_0x5f5c9c){var _0x1949fe={};_0x1949fe[_0x5f5c9c]={'$like':'%'+_0x56d57c['query'][_0xf199('0x51')]+'%'};return _0x1949fe;})});}_0x5c7b08=_['merge']({},_0x5c7b08,_0x56d57c['options']);return _0x1c5ec7[_0xf199('0xbd')](_0x5c7b08);}})['then'](function(_0x2fdf76){if(_0x2fdf76){_0x56c822=_0x2fdf76[_0xf199('0x4b')];if(!_0x56d57c[_0xf199('0x46')][_0xf199('0x4c')](_0xf199('0x4d'))){_0x5c7b08[_0xf199('0x2d')]=qs[_0xf199('0x2d')](_0x56d57c[_0xf199('0x46')][_0xf199('0x2d')]);_0x5c7b08[_0xf199('0x2b')]=qs[_0xf199('0x2b')](_0x56d57c[_0xf199('0x46')][_0xf199('0x2b')]);}return _0x1c5ec7[_0xf199('0xbd')](_0x5c7b08);}})[_0xf199('0x20')](function(_0x3bd9e3){if(_0x3bd9e3){return _0x3bd9e3?{'count':_0x56c822,'rows':_0x3bd9e3}:null;}})[_0xf199('0x20')](respondWithResult(_0x36179f,null))['catch'](handleError(_0x36179f,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index fc847e2..cca01e3 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 _0x5c82=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x11410b,_0x468780){var _0x58372a=function(_0x1ae2f9){while(--_0x1ae2f9){_0x11410b['push'](_0x11410b['shift']());}};_0x58372a(++_0x468780);}(_0x5c82,0x198));var _0x25c8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c82[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x25c8('0x0'));var MailAccount=require(_0x25c8('0x1'))['db'][_0x25c8('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x25c8('0x3')](0x0);var events={'afterCreate':_0x25c8('0x4'),'afterUpdate':_0x25c8('0x5'),'afterDestroy':_0x25c8('0x6')};function emitEvent(_0x2dced6){return function(_0x3167d2,_0x1dc4fd,_0x38d038){MailAccountEvents[_0x25c8('0x7')](_0x2dced6+':'+_0x3167d2['id'],_0x3167d2);MailAccountEvents[_0x25c8('0x7')](_0x2dced6,_0x3167d2);_0x38d038(null);};}for(var e in events){if(events[_0x25c8('0x8')](e)){var event=events[e];MailAccount[_0x25c8('0x9')](e,emitEvent(event));}}module[_0x25c8('0xa')]=MailAccountEvents; \ No newline at end of file +var _0x8506=['update','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners'];(function(_0x1a4eb4,_0x56849d){var _0x29b00f=function(_0x171fe9){while(--_0x171fe9){_0x1a4eb4['push'](_0x1a4eb4['shift']());}};_0x29b00f(++_0x56849d);}(_0x8506,0xe8));var _0x6850=function(_0x1a6379,_0x1b415d){_0x1a6379=_0x1a6379-0x0;var _0x1d0132=_0x8506[_0x1a6379];return _0x1d0132;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x6850('0x0'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6850('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6850('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2e0f9d){return function(_0x204a8a,_0x321eff,_0x5e9ff2){MailAccountEvents[_0x6850('0x3')](_0x2e0f9d+':'+_0x204a8a['id'],_0x204a8a);MailAccountEvents[_0x6850('0x3')](_0x2e0f9d,_0x204a8a);_0x5e9ff2(null);};}for(var e in events){if(events[_0x6850('0x4')](e)){var event=events[e];MailAccount[_0x6850('0x5')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index d09ed03..5d08abf 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 _0xe9aa=['moment','request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','../../config/logger','api'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0xe9aa,0x153));var _0xae9a=function(_0x5b716e,_0x993657){_0x5b716e=_0x5b716e-0x0;var _0x44159a=_0xe9aa[_0x5b716e];return _0x44159a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae9a('0x0'))(_0xae9a('0x1'));var moment=require(_0xae9a('0x2'));var BPromise=require('bluebird');var rp=require(_0xae9a('0x3'));var fs=require('fs');var path=require(_0xae9a('0x4'));var rimraf=require(_0xae9a('0x5'));var config=require('../../config/environment');var attributes=require(_0xae9a('0x6'));module[_0xae9a('0x7')]=function(_0x589b94,_0x3d7463){return _0x589b94[_0xae9a('0x8')](_0xae9a('0x9'),attributes,{'tableName':_0xae9a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf67c=['moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','api'];(function(_0x374ab5,_0x4d7bcb){var _0x88912e=function(_0x364807){while(--_0x364807){_0x374ab5['push'](_0x374ab5['shift']());}};_0x88912e(++_0x4d7bcb);}(_0xf67c,0x135));var _0xcf67=function(_0x492686,_0x4ac9e8){_0x492686=_0x492686-0x0;var _0x246b7b=_0xf67c[_0x492686];return _0x246b7b;};'use strict';var _=require(_0xcf67('0x0'));var util=require(_0xcf67('0x1'));var logger=require('../../config/logger')(_0xcf67('0x2'));var moment=require(_0xcf67('0x3'));var BPromise=require(_0xcf67('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf67('0x5'));var rimraf=require(_0xcf67('0x6'));var config=require(_0xcf67('0x7'));var attributes=require(_0xcf67('0x8'));module[_0xcf67('0x9')]=function(_0x1de815,_0xfd8d11){return _0x1de815[_0xcf67('0xa')](_0xcf67('0xb'),attributes,{'tableName':_0xcf67('0xc'),'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 39f7e09..7a056a3 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 _0x5afe=['mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','from','account','List','Contacts','MailApplication','MailServerOut','Smtp','omit','Applications','applications','priority','asc','autoclose','push','close','*,*,*,*','length','create','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','spread','update','attach','interaction','get','created','originTo','originCc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','unshift','agent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','MailAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','GetMailAccount','find','ShowMailAccount','NotifyMailAccount','body','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5afe,0xf7));var _0xe5af=function(_0x190725,_0x4c879f){_0x190725=_0x190725-0x0;var _0x4fe2de=_0x5afe[_0x190725];return _0x4fe2de;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe5af('0x0'));var BPromise=require(_0xe5af('0x1'));var rs=require(_0xe5af('0x2'));var fs=require('fs');var Redis=require(_0xe5af('0x3'));var db=require(_0xe5af('0x4'))['db'];var utils=require(_0xe5af('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xe5af('0x6'));var jayson=require(_0xe5af('0x7'));var client=jayson[_0xe5af('0x8')]['http']({'port':0x232c});config[_0xe5af('0x9')]=_[_0xe5af('0xa')](config[_0xe5af('0x9')],{'host':_0xe5af('0xb'),'port':0x18eb});var socket=require(_0xe5af('0xc'))(new Redis(config[_0xe5af('0x9')]));require(_0xe5af('0xd'))[_0xe5af('0xe')](socket);function respondWithRpcPromise(_0x559273,_0x42f604,_0xc249f5){return new BPromise(function(_0x2d827f,_0x440d3f){return client[_0xe5af('0xf')](_0x559273,_0xc249f5)['then'](function(_0x532676){logger['info'](_0xe5af('0x10'),_0x42f604,'request\x20sent');logger[_0xe5af('0x11')](_0xe5af('0x12'),_0x42f604,'request\x20sent',JSON[_0xe5af('0x13')](_0x532676));if(_0x532676[_0xe5af('0x14')]){if(_0x532676[_0xe5af('0x14')][_0xe5af('0x15')]===0x1f4){logger['error'](_0xe5af('0x10'),_0x42f604,_0x532676[_0xe5af('0x14')][_0xe5af('0x16')]);return _0x440d3f(_0x532676[_0xe5af('0x14')][_0xe5af('0x16')]);}logger[_0xe5af('0x14')](_0xe5af('0x10'),_0x42f604,_0x532676[_0xe5af('0x14')][_0xe5af('0x16')]);return _0x2d827f(_0x532676[_0xe5af('0x14')][_0xe5af('0x16')]);}else{logger[_0xe5af('0x17')](_0xe5af('0x10'),_0x42f604,_0xe5af('0x18'));_0x2d827f(_0x532676[_0xe5af('0x19')]['message']);}})[_0xe5af('0x1a')](function(_0x274241){logger[_0xe5af('0x14')](_0xe5af('0x10'),_0x42f604,_0x274241);_0x440d3f(_0x274241);});});}exports['GetMailAccount']=function(_0x3bbd5e){var _0x2f08ec=this;return new Promise(function(_0x137cbe,_0x3e5486){return db[_0xe5af('0x1b')][_0xe5af('0x1c')]({'raw':_0x3bbd5e[_0xe5af('0x1d')]?_0x3bbd5e[_0xe5af('0x1d')][_0xe5af('0x1e')]===undefined?!![]:![]:!![],'where':_0x3bbd5e['options']?_0x3bbd5e['options'][_0xe5af('0x1f')]||null:null,'attributes':_0x3bbd5e[_0xe5af('0x1d')]?_0x3bbd5e[_0xe5af('0x1d')]['attributes']||null:null,'limit':_0x3bbd5e['options']?_0x3bbd5e[_0xe5af('0x1d')][_0xe5af('0x20')]||null:null,'include':_0x3bbd5e[_0xe5af('0x1d')]?_0x3bbd5e[_0xe5af('0x1d')][_0xe5af('0x21')]?_['map'](_0x3bbd5e[_0xe5af('0x1d')][_0xe5af('0x21')],function(_0x4b7961){return{'model':db[_0x4b7961['model']],'as':_0x4b7961['as'],'attributes':_0x4b7961['attributes'],'include':_0x4b7961['include']?_[_0xe5af('0x22')](_0x4b7961[_0xe5af('0x21')],function(_0x396e3c){return{'model':db[_0x396e3c[_0xe5af('0x23')]],'as':_0x396e3c['as'],'attributes':_0x396e3c[_0xe5af('0x24')],'include':_0x396e3c[_0xe5af('0x21')]?_['map'](_0x396e3c[_0xe5af('0x21')],function(_0x4bbfc4){return{'model':db[_0x4bbfc4['model']],'as':_0x4bbfc4['as'],'attributes':_0x4bbfc4[_0xe5af('0x24')]};}):[]};}):[]};}):[]:[]})[_0xe5af('0x25')](function(_0xa90ccc){logger[_0xe5af('0x17')](_0xe5af('0x26'),_0x3bbd5e);logger[_0xe5af('0x11')](_0xe5af('0x26'),_0x3bbd5e,JSON[_0xe5af('0x13')](_0xa90ccc));_0x137cbe(_0xa90ccc);})[_0xe5af('0x1a')](function(_0x17d74c){logger[_0xe5af('0x14')](_0xe5af('0x26'),_0x17d74c['message'],_0x3bbd5e);_0x3e5486(_0x2f08ec[_0xe5af('0x14')](0x1f4,_0x17d74c[_0xe5af('0x16')]));});});};exports['ShowMailAccount']=function(_0x19a839){var _0x1d5a1a=this;return new Promise(function(_0x1204da,_0x2b5540){return db[_0xe5af('0x1b')][_0xe5af('0x27')]({'raw':_0x19a839['options']?_0x19a839[_0xe5af('0x1d')][_0xe5af('0x1e')]===undefined?!![]:![]:!![],'where':_0x19a839[_0xe5af('0x1d')]?_0x19a839[_0xe5af('0x1d')][_0xe5af('0x1f')]||null:null,'attributes':_0x19a839[_0xe5af('0x1d')]?_0x19a839[_0xe5af('0x1d')][_0xe5af('0x24')]||null:null,'include':_0x19a839[_0xe5af('0x1d')]?_0x19a839[_0xe5af('0x1d')][_0xe5af('0x21')]?_[_0xe5af('0x22')](_0x19a839[_0xe5af('0x1d')][_0xe5af('0x21')],function(_0x54352a){return{'model':db[_0x54352a[_0xe5af('0x23')]],'as':_0x54352a['as'],'attributes':_0x54352a[_0xe5af('0x24')],'include':_0x54352a['include']?_[_0xe5af('0x22')](_0x54352a['include'],function(_0x265b76){return{'model':db[_0x265b76['model']],'as':_0x265b76['as'],'attributes':_0x265b76[_0xe5af('0x24')],'include':_0x265b76[_0xe5af('0x21')]?_[_0xe5af('0x22')](_0x265b76[_0xe5af('0x21')],function(_0xd5584a){return{'model':db[_0xd5584a[_0xe5af('0x23')]],'as':_0xd5584a['as'],'attributes':_0xd5584a['attributes']};}):[]};}):[]};}):[]:[]})[_0xe5af('0x25')](function(_0x12ba31){logger[_0xe5af('0x17')](_0xe5af('0x28'),_0x19a839);logger[_0xe5af('0x11')](_0xe5af('0x28'),_0x19a839,JSON[_0xe5af('0x13')](_0x12ba31));_0x1204da(_0x12ba31);})['catch'](function(_0x22b2e8){logger[_0xe5af('0x14')](_0xe5af('0x28'),_0x22b2e8['message'],_0x19a839);_0x2b5540(_0x1d5a1a[_0xe5af('0x14')](0x1f4,_0x22b2e8[_0xe5af('0x16')]));});});};exports[_0xe5af('0x29')]=function(_0x38f2c4){var _0x15b960=this;return new Promise(function(_0x10959d,_0x4581c6){var _0xe8001b={'body':_0x38f2c4[_0xe5af('0x2a')],'channel':'mail'};var _0x16aa51=_['difference'](_['keys'](db[_0xe5af('0x2b')]['rawAttributes']),[_0xe5af('0x2c'),_0xe5af('0x2d'),_0xe5af('0x2e'),_0xe5af('0x2f')]);var _0x594cb2=![];if(_0x38f2c4[_0xe5af('0x2a')]['id']){delete _0x38f2c4[_0xe5af('0x2a')]['id'];}if(_['isNil'](_0x38f2c4['body']['from'])){return _0x4581c6(_0x15b960['error'](0x1f4,'from\x20is\x20mandatory'));}if(_[_0xe5af('0x30')](_0x38f2c4['body'][_0xe5af('0x2a')])||_0x38f2c4['body'][_0xe5af('0x2a')]===''){return _0x4581c6(_0x15b960[_0xe5af('0x14')](0x1f4,_0xe5af('0x31')));}if(_[_0xe5af('0x30')](_0x38f2c4['body']['mapKey'])){return _0x4581c6(_0x15b960[_0xe5af('0x14')](0x1f4,_0xe5af('0x32')+_0x16aa51));}if(!_[_0xe5af('0x33')](_0x16aa51,_0x38f2c4['body']['mapKey'])){return _0x4581c6(_0x15b960[_0xe5af('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16aa51));}var _0x176551={};_0x176551[_0x38f2c4['body'][_0xe5af('0x34')]]=_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x35')];return db[_0xe5af('0x1b')][_0xe5af('0x27')]({'where':{'id':_0x38f2c4[_0xe5af('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0xe5af('0x37'),'include':[{'model':db['CmContact'],'as':_0xe5af('0x38'),'where':_0x176551,'limit':0x1,'order':[[_0xe5af('0x2d'),'DESC']]}]},{'model':db[_0xe5af('0x39')],'as':'Applications'},{'model':db[_0xe5af('0x3a')],'as':_0xe5af('0x3b')}]})['then'](function(_0x42ff29){if(_0x42ff29&&_0x42ff29[_0xe5af('0x37')]){var _0x1e0c0e=_0x42ff29['get']({'plain':!![]});_0xe8001b[_0xe5af('0x36')]=_[_0xe5af('0x3c')](_0x1e0c0e,[_0xe5af('0x3d'),'List']);_0xe8001b[_0xe5af('0x3e')]=_0x1e0c0e['Applications'];_0xe8001b['list']=_0x1e0c0e[_0xe5af('0x37')];_0xe8001b[_0xe5af('0x3e')]=_['orderBy'](_0xe8001b[_0xe5af('0x3e')],[_0xe5af('0x3f')],[_0xe5af('0x40')]);if(_0xe8001b[_0xe5af('0x36')]&&_0xe8001b[_0xe5af('0x36')][_0xe5af('0x41')]){_0xe8001b[_0xe5af('0x3e')][_0xe5af('0x42')]({'id':0x0,'priority':_0xe8001b[_0xe5af('0x3e')]['length']+0x1,'app':_0xe5af('0x43'),'appdata':_0xe5af('0x41'),'interval':_0xe5af('0x44')});}if(_0xe8001b[_0xe5af('0x36')][_0xe5af('0x3d')]){delete _0xe8001b[_0xe5af('0x36')][_0xe5af('0x3d')];}if(_0xe8001b[_0xe5af('0x36')][_0xe5af('0x37')]){delete _0xe8001b[_0xe5af('0x36')][_0xe5af('0x37')];}if(_0x1e0c0e[_0xe5af('0x37')][_0xe5af('0x38')][_0xe5af('0x45')]){return _0x1e0c0e[_0xe5af('0x37')]['Contacts'][0x0];}var _0x4b528e=_[_0xe5af('0xa')](_0x38f2c4[_0xe5af('0x2a')],{'firstName':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x35')],'ListId':_0x1e0c0e[_0xe5af('0x2f')]});_0x4b528e[_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x34')]]=_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x35')];return db[_0xe5af('0x2b')][_0xe5af('0x46')](_0x4b528e);}else{throw new Error('List\x20not\x20found');}})[_0xe5af('0x25')](function(_0x472fc8){_0xe8001b[_0xe5af('0x47')]=_0x472fc8;if(_0x472fc8){if(!_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x48')]){_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x48')]=rs[_0xe5af('0x49')]()+'\x20'+_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x35')];}var _0x1f2da4={'ContactId':_0x472fc8['id'],'MailAccountId':_0x38f2c4[_0xe5af('0x36')]['id'],'inReplyTo':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x48')],'to':_0x38f2c4['body'][_0xe5af('0x16')][_0xe5af('0x35')],'cc':_0x38f2c4['body'][_0xe5af('0x16')]['cc'],'subject':_0x38f2c4['body'][_0xe5af('0x16')][_0xe5af('0x4a')],'attach':_0x38f2c4['body']['message']['attach'],'lastMsgAt':moment()[_0xe5af('0x4b')](_0xe5af('0x4c')),'lastMsgDirection':'in'};return db[_0xe5af('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x38f2c4[_0xe5af('0x36')]['id']},'include':[{'model':db[_0xe5af('0x4e')],'as':'Messages','attributes':[_0xe5af('0x48')],'where':{'messageId':_0x38f2c4['body'][_0xe5af('0x16')][_0xe5af('0x4f')]}}]})[_0xe5af('0x25')](function(_0x333302){if(_0x333302){return[_0x333302,![]];}return db[_0xe5af('0x4d')][_0xe5af('0x46')](_0x1f2da4)['then'](function(_0x42deca){return[_0x42deca,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xe5af('0x50')](function(_0x2a719a,_0xe96e46){if(_0x2a719a){_0x594cb2=_0xe96e46;if(!_0xe96e46){return _0x2a719a[_0xe5af('0x51')]({'inReplyTo':_0x38f2c4['body'][_0xe5af('0x16')][_0xe5af('0x48')],'to':_0x38f2c4['body'][_0xe5af('0x16')][_0xe5af('0x35')],'cc':_0x38f2c4['body']['message']['cc'],'subject':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')]['subject'],'attach':_0x2a719a[_0xe5af('0x52')]?_0x2a719a['attach']:_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x52')],'substatus':null,'substatusAt':moment()[_0xe5af('0x4b')](_0xe5af('0x4c')),'lastMsgAt':moment()[_0xe5af('0x4b')](_0xe5af('0x4c')),'lastMsgDirection':'in'});}else{return _0x2a719a;}}})[_0xe5af('0x25')](function(_0x581fc9){_0xe8001b[_0xe5af('0x53')]=_0x581fc9[_0xe5af('0x54')]({'plain':!![]});_0xe8001b['interaction'][_0xe5af('0x55')]=_0x594cb2;return db['MailMessage'][_0xe5af('0x46')]({'body':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x2a')],'MailAccountId':_0x38f2c4[_0xe5af('0x36')]['id'],'MailInteractionId':_0x581fc9['id'],'direction':'in','ContactId':_0xe8001b[_0xe5af('0x47')]['id'],'messageId':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')]['messageId'],'from':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x35')],'to':_0x38f2c4['body']['message']['to'],'cc':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')]['cc'],'subject':_0x38f2c4[_0xe5af('0x2a')]['message']['subject'],'attach':_0x38f2c4[_0xe5af('0x2a')]['message'][_0xe5af('0x52')],'Attachments':_0x38f2c4['body']['message']['attachments'],'originTo':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x56')],'originCc':_0x38f2c4['body'][_0xe5af('0x16')][_0xe5af('0x57')],'bcc':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')]['bcc'],'ChatWebsiteId':_0x38f2c4['body'][_0xe5af('0x16')]['ChatWebsiteId']||null,'originChannel':_0x38f2c4[_0xe5af('0x2a')][_0xe5af('0x16')][_0xe5af('0x58')]||_0xe5af('0x59'),'ChatOfflineMessageId':_0x38f2c4['body'][_0xe5af('0x16')][_0xe5af('0x5a')]||null},{'include':[{'model':db[_0xe5af('0x5b')],'as':_0xe5af('0x5c')}]});})[_0xe5af('0x25')](function(_0x4e1972){_0xe8001b[_0xe5af('0x16')]=_0x4e1972;if(_0xe8001b[_0xe5af('0x53')][_0xe5af('0x5d')]){return db[_0xe5af('0x5e')]['find']({'attributes':['id','name'],'where':{'id':_0xe8001b[_0xe5af('0x53')][_0xe5af('0x5d')]}})[_0xe5af('0x25')](function(_0x1dc107){if(_0x1dc107){_0xe8001b['applications'][_0xe5af('0x5f')]({'id':0x0,'priority':0x0,'app':_0xe5af('0x60'),'appdata':_0x1dc107['name']+','+(_0xe8001b[_0xe5af('0x36')]['waitForTheAssignedAgent']||0xa),'interval':_0xe5af('0x44')});}return respondWithRpcPromise(_0xe5af('0x61'),_0xe5af('0x62'),_0xe8001b);});}return respondWithRpcPromise('Start','startRouting',_0xe8001b);})[_0xe5af('0x25')](function(_0x41957d){_0x10959d(_0x41957d);})[_0xe5af('0x1a')](function(_0x367212){_0x4581c6(_0x15b960[_0xe5af('0x14')](0x1f4,_0x367212[_0xe5af('0x16')]));});});}; \ No newline at end of file +var _0xd97d=['CmContact','Contacts','updatedAt','MailApplication','MailServerOut','Smtp','get','Applications','list','applications','orderBy','priority','autoclose','push','length','close','ListId','List\x20not\x20found','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','create','update','interaction','created','attachments','originTo','bcc','ChatWebsiteId','Attachment','Attachments','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetMailAccount','findAll','options','raw','attributes','limit','map','include','model','ShowMailAccount','MailAccount','find','where','NotifyMailAccount','mail','difference','keys','rawAttributes','body','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List'];(function(_0x1b9ac6,_0x5c7912){var _0x13517a=function(_0x5664ab){while(--_0x5664ab){_0x1b9ac6['push'](_0x1b9ac6['shift']());}};_0x13517a(++_0x5c7912);}(_0xd97d,0x15a));var _0xdd97=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0xd97d[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xdd97('0x0'));var util=require('util');var moment=require(_0xdd97('0x1'));var BPromise=require(_0xdd97('0x2'));var rs=require(_0xdd97('0x3'));var fs=require('fs');var Redis=require(_0xdd97('0x4'));var db=require(_0xdd97('0x5'))['db'];var utils=require(_0xdd97('0x6'));var logger=require(_0xdd97('0x7'))('rpc');var config=require(_0xdd97('0x8'));var jayson=require(_0xdd97('0x9'));var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0xdd97('0xa')](config['redis'],{'host':_0xdd97('0xb'),'port':0x18eb});var socket=require(_0xdd97('0xc'))(new Redis(config['redis']));require(_0xdd97('0xd'))['register'](socket);function respondWithRpcPromise(_0x4d1922,_0x34d2b5,_0x242642){return new BPromise(function(_0x44aef1,_0x8f08dd){return client['request'](_0x4d1922,_0x242642)[_0xdd97('0xe')](function(_0x363ec2){logger[_0xdd97('0xf')](_0xdd97('0x10'),_0x34d2b5,'request\x20sent');logger[_0xdd97('0x11')](_0xdd97('0x12'),_0x34d2b5,'request\x20sent',JSON[_0xdd97('0x13')](_0x363ec2));if(_0x363ec2[_0xdd97('0x14')]){if(_0x363ec2['error'][_0xdd97('0x15')]===0x1f4){logger[_0xdd97('0x14')]('MailAccount,\x20%s,\x20%s',_0x34d2b5,_0x363ec2[_0xdd97('0x14')][_0xdd97('0x16')]);return _0x8f08dd(_0x363ec2['error']['message']);}logger[_0xdd97('0x14')]('MailAccount,\x20%s,\x20%s',_0x34d2b5,_0x363ec2[_0xdd97('0x14')]['message']);return _0x44aef1(_0x363ec2[_0xdd97('0x14')]['message']);}else{logger['info'](_0xdd97('0x10'),_0x34d2b5,_0xdd97('0x17'));_0x44aef1(_0x363ec2[_0xdd97('0x18')][_0xdd97('0x16')]);}})[_0xdd97('0x19')](function(_0x1ade87){logger[_0xdd97('0x14')]('MailAccount,\x20%s,\x20%s',_0x34d2b5,_0x1ade87);_0x8f08dd(_0x1ade87);});});}exports[_0xdd97('0x1a')]=function(_0x8ca394){var _0x5bb496=this;return new Promise(function(_0x43c048,_0x5c2340){return db['MailAccount'][_0xdd97('0x1b')]({'raw':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')][_0xdd97('0x1d')]===undefined?!![]:![]:!![],'where':_0x8ca394['options']?_0x8ca394[_0xdd97('0x1c')]['where']||null:null,'attributes':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')][_0xdd97('0x1e')]||null:null,'limit':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')][_0xdd97('0x1f')]||null:null,'include':_0x8ca394[_0xdd97('0x1c')]?_0x8ca394[_0xdd97('0x1c')]['include']?_[_0xdd97('0x20')](_0x8ca394['options'][_0xdd97('0x21')],function(_0x5ae2ca){return{'model':db[_0x5ae2ca[_0xdd97('0x22')]],'as':_0x5ae2ca['as'],'attributes':_0x5ae2ca[_0xdd97('0x1e')],'include':_0x5ae2ca[_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x5ae2ca[_0xdd97('0x21')],function(_0x564eea){return{'model':db[_0x564eea['model']],'as':_0x564eea['as'],'attributes':_0x564eea['attributes'],'include':_0x564eea['include']?_[_0xdd97('0x20')](_0x564eea[_0xdd97('0x21')],function(_0xabb41a){return{'model':db[_0xabb41a[_0xdd97('0x22')]],'as':_0xabb41a['as'],'attributes':_0xabb41a[_0xdd97('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47c028){logger['info'](_0xdd97('0x1a'),_0x8ca394);logger[_0xdd97('0x11')](_0xdd97('0x1a'),_0x8ca394,JSON[_0xdd97('0x13')](_0x47c028));_0x43c048(_0x47c028);})[_0xdd97('0x19')](function(_0x1a0653){logger[_0xdd97('0x14')]('GetMailAccount',_0x1a0653['message'],_0x8ca394);_0x5c2340(_0x5bb496[_0xdd97('0x14')](0x1f4,_0x1a0653['message']));});});};exports[_0xdd97('0x23')]=function(_0x11f6ca){var _0x462bf3=this;return new Promise(function(_0x3ed807,_0x311b46){return db[_0xdd97('0x24')][_0xdd97('0x25')]({'raw':_0x11f6ca['options']?_0x11f6ca[_0xdd97('0x1c')][_0xdd97('0x1d')]===undefined?!![]:![]:!![],'where':_0x11f6ca['options']?_0x11f6ca[_0xdd97('0x1c')][_0xdd97('0x26')]||null:null,'attributes':_0x11f6ca[_0xdd97('0x1c')]?_0x11f6ca[_0xdd97('0x1c')]['attributes']||null:null,'include':_0x11f6ca['options']?_0x11f6ca['options'][_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x11f6ca[_0xdd97('0x1c')][_0xdd97('0x21')],function(_0x5b08ea){return{'model':db[_0x5b08ea[_0xdd97('0x22')]],'as':_0x5b08ea['as'],'attributes':_0x5b08ea[_0xdd97('0x1e')],'include':_0x5b08ea[_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x5b08ea['include'],function(_0x1bb375){return{'model':db[_0x1bb375[_0xdd97('0x22')]],'as':_0x1bb375['as'],'attributes':_0x1bb375[_0xdd97('0x1e')],'include':_0x1bb375[_0xdd97('0x21')]?_[_0xdd97('0x20')](_0x1bb375[_0xdd97('0x21')],function(_0x43b2ff){return{'model':db[_0x43b2ff[_0xdd97('0x22')]],'as':_0x43b2ff['as'],'attributes':_0x43b2ff[_0xdd97('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa4879b){logger[_0xdd97('0xf')]('ShowMailAccount',_0x11f6ca);logger[_0xdd97('0x11')](_0xdd97('0x23'),_0x11f6ca,JSON[_0xdd97('0x13')](_0xa4879b));_0x3ed807(_0xa4879b);})[_0xdd97('0x19')](function(_0x1a1c2d){logger['error'](_0xdd97('0x23'),_0x1a1c2d['message'],_0x11f6ca);_0x311b46(_0x462bf3[_0xdd97('0x14')](0x1f4,_0x1a1c2d[_0xdd97('0x16')]));});});};exports[_0xdd97('0x27')]=function(_0x5f08f8){var _0x56d99f=this;return new Promise(function(_0x1a1e50,_0x2a2161){var _0x4bcf4f={'body':_0x5f08f8['body'],'channel':_0xdd97('0x28')};var _0x46d241=_[_0xdd97('0x29')](_[_0xdd97('0x2a')](db['CmContact'][_0xdd97('0x2b')]),['createdAt','updatedAt','CompanyId','ListId']);var _0x4dcc59=![];if(_0x5f08f8['body']['id']){delete _0x5f08f8['body']['id'];}if(_['isNil'](_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2d')])){return _0x2a2161(_0x56d99f['error'](0x1f4,_0xdd97('0x2e')));}if(_[_0xdd97('0x2f')](_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2c')])||_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2c')]===''){return _0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xdd97('0x2f')](_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x30')])){return _0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,_0xdd97('0x31')+_0x46d241));}if(!_['includes'](_0x46d241,_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x30')])){return _0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,_0xdd97('0x32')+_0x46d241));}var _0x573600={};_0x573600[_0x5f08f8['body'][_0xdd97('0x30')]]=_0x5f08f8['body']['from'];return db['MailAccount'][_0xdd97('0x25')]({'where':{'id':_0x5f08f8[_0xdd97('0x33')]['id']},'include':[{'model':db[_0xdd97('0x34')],'as':_0xdd97('0x35'),'include':[{'model':db[_0xdd97('0x36')],'as':_0xdd97('0x37'),'where':_0x573600,'limit':0x1,'order':[[_0xdd97('0x38'),'DESC']]}]},{'model':db[_0xdd97('0x39')],'as':'Applications'},{'model':db[_0xdd97('0x3a')],'as':_0xdd97('0x3b')}]})[_0xdd97('0xe')](function(_0x45ba42){if(_0x45ba42&&_0x45ba42['List']){var _0xbbf8d2=_0x45ba42[_0xdd97('0x3c')]({'plain':!![]});_0x4bcf4f[_0xdd97('0x33')]=_['omit'](_0xbbf8d2,[_0xdd97('0x3d'),_0xdd97('0x35')]);_0x4bcf4f['applications']=_0xbbf8d2['Applications'];_0x4bcf4f[_0xdd97('0x3e')]=_0xbbf8d2[_0xdd97('0x35')];_0x4bcf4f[_0xdd97('0x3f')]=_[_0xdd97('0x40')](_0x4bcf4f[_0xdd97('0x3f')],[_0xdd97('0x41')],['asc']);if(_0x4bcf4f[_0xdd97('0x33')]&&_0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x42')]){_0x4bcf4f['applications'][_0xdd97('0x43')]({'id':0x0,'priority':_0x4bcf4f[_0xdd97('0x3f')][_0xdd97('0x44')]+0x1,'app':_0xdd97('0x45'),'appdata':_0xdd97('0x42'),'interval':'*,*,*,*'});}if(_0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x3d')]){delete _0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x3d')];}if(_0x4bcf4f[_0xdd97('0x33')]['List']){delete _0x4bcf4f['account'][_0xdd97('0x35')];}if(_0xbbf8d2[_0xdd97('0x35')][_0xdd97('0x37')][_0xdd97('0x44')]){return _0xbbf8d2[_0xdd97('0x35')]['Contacts'][0x0];}var _0xd7476a=_[_0xdd97('0xa')](_0x5f08f8[_0xdd97('0x2c')],{'firstName':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2d')],'ListId':_0xbbf8d2[_0xdd97('0x46')]});_0xd7476a[_0x5f08f8[_0xdd97('0x2c')]['mapKey']]=_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x2d')];return db['CmContact']['create'](_0xd7476a);}else{throw new Error(_0xdd97('0x47'));}})[_0xdd97('0xe')](function(_0x2f6ab2){_0x4bcf4f['contact']=_0x2f6ab2;if(_0x2f6ab2){if(!_0x5f08f8['body'][_0xdd97('0x16')]['messageId']){_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x48')]=rs[_0xdd97('0x49')]()+'\x20'+_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x2d')];}var _0x57f8ee={'ContactId':_0x2f6ab2['id'],'MailAccountId':_0x5f08f8[_0xdd97('0x33')]['id'],'inReplyTo':_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x48')],'to':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x2d')],'cc':_0x5f08f8[_0xdd97('0x2c')]['message']['cc'],'subject':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x4a')],'attach':_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x4b')],'lastMsgAt':moment()[_0xdd97('0x4c')](_0xdd97('0x4d')),'lastMsgDirection':'in'};return db[_0xdd97('0x4e')]['find']({'where':{'closed':![],'MailAccountId':_0x5f08f8[_0xdd97('0x33')]['id']},'include':[{'model':db[_0xdd97('0x4f')],'as':'Messages','attributes':[_0xdd97('0x48')],'where':{'messageId':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x50')]}}]})['then'](function(_0x4f0eec){if(_0x4f0eec){return[_0x4f0eec,![]];}return db['MailInteraction'][_0xdd97('0x51')](_0x57f8ee)[_0xdd97('0xe')](function(_0x21959b){return[_0x21959b,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0xf5dfc5,_0x3ae2f4){if(_0xf5dfc5){_0x4dcc59=_0x3ae2f4;if(!_0x3ae2f4){return _0xf5dfc5[_0xdd97('0x52')]({'inReplyTo':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x48')],'to':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x2d')],'cc':_0x5f08f8['body'][_0xdd97('0x16')]['cc'],'subject':_0x5f08f8['body'][_0xdd97('0x16')][_0xdd97('0x4a')],'attach':_0xf5dfc5[_0xdd97('0x4b')]?_0xf5dfc5['attach']:_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x4b')],'substatus':null,'substatusAt':moment()[_0xdd97('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0xf5dfc5;}}})[_0xdd97('0xe')](function(_0x186f57){_0x4bcf4f['interaction']=_0x186f57['get']({'plain':!![]});_0x4bcf4f[_0xdd97('0x53')][_0xdd97('0x54')]=_0x4dcc59;return db['MailMessage']['create']({'body':_0x5f08f8[_0xdd97('0x2c')]['body'],'MailAccountId':_0x5f08f8[_0xdd97('0x33')]['id'],'MailInteractionId':_0x186f57['id'],'direction':'in','ContactId':_0x4bcf4f['contact']['id'],'messageId':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x48')],'from':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x2d')],'to':_0x5f08f8['body']['message']['to'],'cc':_0x5f08f8['body'][_0xdd97('0x16')]['cc'],'subject':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x4a')],'attach':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x4b')],'Attachments':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x55')],'originTo':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x56')],'originCc':_0x5f08f8['body'][_0xdd97('0x16')]['originCc'],'bcc':_0x5f08f8[_0xdd97('0x2c')]['message'][_0xdd97('0x57')],'ChatWebsiteId':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')][_0xdd97('0x58')]||null,'originChannel':_0x5f08f8[_0xdd97('0x2c')][_0xdd97('0x16')]['originChannel']||'Email','ChatOfflineMessageId':_0x5f08f8['body']['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xdd97('0x59')],'as':_0xdd97('0x5a')}]});})[_0xdd97('0xe')](function(_0x5ea145){_0x4bcf4f['message']=_0x5ea145;if(_0x4bcf4f['interaction'][_0xdd97('0x5b')]){return db[_0xdd97('0x5c')][_0xdd97('0x25')]({'attributes':['id','name'],'where':{'id':_0x4bcf4f[_0xdd97('0x53')]['UserId']}})[_0xdd97('0xe')](function(_0x1bf8a8){if(_0x1bf8a8){_0x4bcf4f[_0xdd97('0x3f')][_0xdd97('0x5d')]({'id':0x0,'priority':0x0,'app':_0xdd97('0x5e'),'appdata':_0x1bf8a8[_0xdd97('0x5f')]+','+(_0x4bcf4f[_0xdd97('0x33')][_0xdd97('0x60')]||0xa),'interval':_0xdd97('0x61')});}return respondWithRpcPromise(_0xdd97('0x62'),_0xdd97('0x63'),_0x4bcf4f);});}return respondWithRpcPromise(_0xdd97('0x62'),_0xdd97('0x63'),_0x4bcf4f);})['then'](function(_0x135f27){_0x1a1e50(_0x135f27);})[_0xdd97('0x19')](function(_0x4bebbb){_0x2a2161(_0x56d99f[_0xdd97('0x14')](0x1f4,_0x4bebbb[_0xdd97('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index cc8e233..e528ab0 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 _0x13c9=['remove','removeListener','length','mailAccount:','save'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x13c9,0x1c1));var _0x913c=function(_0x236cd6,_0x25afb1){_0x236cd6=_0x236cd6-0x0;var _0x1ef66d=_0x13c9[_0x236cd6];return _0x1ef66d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x913c('0x0'),_0x913c('0x1'),'update'];function createListener(_0x635577,_0xfd36cc){return function(_0x193b82){_0xfd36cc['emit'](_0x635577,_0x193b82);};}function removeListener(_0x2cc2ee,_0x14c2c8){return function(){MailAccountEvents[_0x913c('0x2')](_0x2cc2ee,_0x14c2c8);};}exports['register']=function(_0x4b265f){for(var _0x2c4741=0x0,_0x52e125=events[_0x913c('0x3')];_0x2c4741<_0x52e125;_0x2c4741++){var _0x26a913=events[_0x2c4741];var _0x2e6bc7=createListener(_0x913c('0x4')+_0x26a913,_0x4b265f);MailAccountEvents['on'](_0x26a913,_0x2e6bc7);}}; \ No newline at end of file +var _0x54e1=['save','remove','emit','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x224ee1,_0x3361bc){var _0xa84cef=function(_0x35b854){while(--_0x35b854){_0x224ee1['push'](_0x224ee1['shift']());}};_0xa84cef(++_0x3361bc);}(_0x54e1,0x147));var _0x154e=function(_0x498bd1,_0x4c6432){_0x498bd1=_0x498bd1-0x0;var _0xb3a5ce=_0x54e1[_0x498bd1];return _0xb3a5ce;};'use strict';var MailAccountEvents=require(_0x154e('0x0'));var events=[_0x154e('0x1'),_0x154e('0x2'),'update'];function createListener(_0x1e7a9b,_0x2be9eb){return function(_0x5b1b4d){_0x2be9eb[_0x154e('0x3')](_0x1e7a9b,_0x5b1b4d);};}function removeListener(_0x2de1b1,_0x487cca){return function(){MailAccountEvents[_0x154e('0x4')](_0x2de1b1,_0x487cca);};}exports[_0x154e('0x5')]=function(_0x183fde){for(var _0xcef47b=0x0,_0x1b77be=events[_0x154e('0x6')];_0xcef47b<_0x1b77be;_0xcef47b++){var _0x3dd4a3=events[_0xcef47b];var _0x1bb413=createListener(_0x154e('0x7')+_0x3dd4a3,_0x183fde);MailAccountEvents['on'](_0x3dd4a3,_0x1bb413);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 1c9bc16..4aef332 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 _0x9b72=['update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated'];(function(_0x176cbe,_0xfbbda6){var _0x1490cc=function(_0x12e158){while(--_0x12e158){_0x176cbe['push'](_0x176cbe['shift']());}};_0x1490cc(++_0xfbbda6);}(_0x9b72,0x18b));var _0x29b7=function(_0x384baf,_0x71ea46){_0x384baf=_0x384baf-0x0;var _0x79fb9b=_0x9b72[_0x384baf];return _0x79fb9b;};'use strict';var multer=require(_0x29b7('0x0'));var util=require(_0x29b7('0x1'));var path=require('path');var timeout=require(_0x29b7('0x2'));var express=require(_0x29b7('0x3'));var router=express[_0x29b7('0x4')]();var fs_extra=require(_0x29b7('0x5'));var auth=require(_0x29b7('0x6'));var interaction=require(_0x29b7('0x7'));var config=require(_0x29b7('0x8'));var controller=require(_0x29b7('0x9'));router[_0x29b7('0xa')](_0x29b7('0xb'),auth['isAuthenticated'](),controller['show']);router['put'](_0x29b7('0xb'),auth[_0x29b7('0xc')](),controller[_0x29b7('0xd')]);router[_0x29b7('0xe')](_0x29b7('0xb'),auth[_0x29b7('0xc')](),controller[_0x29b7('0xf')]);module[_0x29b7('0x10')]=router; \ No newline at end of file +var _0xd8db=['../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','show','put','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x14275a,_0x428065){var _0x2df137=function(_0x2c975e){while(--_0x2c975e){_0x14275a['push'](_0x14275a['shift']());}};_0x2df137(++_0x428065);}(_0xd8db,0x116));var _0xbd8d=function(_0xca5fbd,_0x479c8e){_0xca5fbd=_0xca5fbd-0x0;var _0x5ee881=_0xd8db[_0xca5fbd];return _0x5ee881;};'use strict';var multer=require(_0xbd8d('0x0'));var util=require(_0xbd8d('0x1'));var path=require('path');var timeout=require(_0xbd8d('0x2'));var express=require(_0xbd8d('0x3'));var router=express[_0xbd8d('0x4')]();var fs_extra=require(_0xbd8d('0x5'));var auth=require(_0xbd8d('0x6'));var interaction=require(_0xbd8d('0x7'));var config=require(_0xbd8d('0x8'));var controller=require(_0xbd8d('0x9'));router[_0xbd8d('0xa')](_0xbd8d('0xb'),auth['isAuthenticated'](),controller[_0xbd8d('0xc')]);router[_0xbd8d('0xd')]('/:id',auth[_0xbd8d('0xe')](),controller[_0xbd8d('0xf')]);router[_0xbd8d('0x10')](_0xbd8d('0xb'),auth['isAuthenticated'](),controller[_0xbd8d('0x11')]);module[_0xbd8d('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 984a94b..6e78b64 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 _0xd868=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x2abac3,_0x1f93ff){var _0x53f037=function(_0xf31896){while(--_0xf31896){_0x2abac3['push'](_0x2abac3['shift']());}};_0x53f037(++_0x1f93ff);}(_0xd868,0x108));var _0x8d86=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xd868[_0x1b349a];return _0x5d1f7c;};'use strict';var Sequelize=require(_0x8d86('0x0'));module[_0x8d86('0x1')]={'priority':{'type':Sequelize[_0x8d86('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8d86('0x3')},'appdata':{'type':Sequelize[_0x8d86('0x4')]()},'description':{'type':Sequelize[_0x8d86('0x5')]},'interval':{'type':Sequelize[_0x8d86('0x5')],'defaultValue':_0x8d86('0x6')}}; \ No newline at end of file +var _0xbaeb=['TEXT','sequelize','STRING','noop'];(function(_0x4b809b,_0x5de1c6){var _0x338f37=function(_0x189771){while(--_0x189771){_0x4b809b['push'](_0x4b809b['shift']());}};_0x338f37(++_0x5de1c6);}(_0xbaeb,0x1e9));var _0xbbae=function(_0x143934,_0x611d46){_0x143934=_0x143934-0x0;var _0x891032=_0xbaeb[_0x143934];return _0x891032;};'use strict';var Sequelize=require(_0xbbae('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xbbae('0x1')],'allowNull':![],'defaultValue':_0xbbae('0x2')},'appdata':{'type':Sequelize[_0xbbae('0x3')]()},'description':{'type':Sequelize[_0xbbae('0x1')]},'interval':{'type':Sequelize[_0xbbae('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 7710554..e8fb363 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 _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x199cef,_0x1b995c){var _0x33416c=function(_0x592638){while(--_0x592638){_0x199cef['push'](_0x199cef['shift']());}};_0x33416c(++_0x1b995c);}(_0xac4a,0x13f));var _0xaac4=function(_0xf7b7cd,_0x34973a){_0xf7b7cd=_0xf7b7cd-0x0;var _0x1d0ab1=_0xac4a[_0xf7b7cd];return _0x1d0ab1;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file +var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x470212,_0x1387de){var _0x5083cb=function(_0x3bec27){while(--_0x3bec27){_0x470212['push'](_0x470212['shift']());}};_0x5083cb(++_0x1387de);}(_0x9bde,0xe1));var _0xe9bd=function(_0x557531,_0x2bc75c){_0x557531=_0x557531-0x0;var _0x480dcd=_0x9bde[_0x557531];return _0x480dcd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index adee251..2e28220 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 _0x8704=['MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailApplication.attributes','define'];(function(_0x265586,_0x4d07be){var _0x3bb8e4=function(_0x45e2af){while(--_0x45e2af){_0x265586['push'](_0x265586['shift']());}};_0x3bb8e4(++_0x4d07be);}(_0x8704,0xff));var _0x4870=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x8704[_0x1c34e7];return _0x378cb1;};'use strict';var _=require(_0x4870('0x0'));var util=require(_0x4870('0x1'));var logger=require(_0x4870('0x2'))(_0x4870('0x3'));var moment=require(_0x4870('0x4'));var BPromise=require(_0x4870('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4870('0x6'));var rimraf=require(_0x4870('0x7'));var config=require(_0x4870('0x8'));var attributes=require(_0x4870('0x9'));module['exports']=function(_0x3a917d,_0x4de560){return _0x3a917d[_0x4870('0xa')](_0x4870('0xb'),attributes,{'tableName':_0x4870('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4870('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xeed8=['bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x1fb014,_0x14614e){var _0x5c0ac2=function(_0x45a63d){while(--_0x45a63d){_0x1fb014['push'](_0x1fb014['shift']());}};_0x5c0ac2(++_0x14614e);}(_0xeed8,0x1ce));var _0x8eed=function(_0x10f0a5,_0x42ecec){_0x10f0a5=_0x10f0a5-0x0;var _0x1849cb=_0xeed8[_0x10f0a5];return _0x1849cb;};'use strict';var _=require(_0x8eed('0x0'));var util=require(_0x8eed('0x1'));var logger=require('../../config/logger')(_0x8eed('0x2'));var moment=require('moment');var BPromise=require(_0x8eed('0x3'));var rp=require(_0x8eed('0x4'));var fs=require('fs');var path=require(_0x8eed('0x5'));var rimraf=require(_0x8eed('0x6'));var config=require(_0x8eed('0x7'));var attributes=require(_0x8eed('0x8'));module[_0x8eed('0x9')]=function(_0x53a3a3,_0x2bb404){return _0x53a3a3[_0x8eed('0xa')](_0x8eed('0xb'),attributes,{'tableName':_0x8eed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8eed('0xd'),'collate':_0x8eed('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 158d5ea..5909f64 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 _0x3164=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateMailApplication','update','body','options','raw','where','attributes','limit','debug','catch','lodash','util','moment'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x3164,0x85));var _0x4316=function(_0x292b9d,_0x123322){_0x292b9d=_0x292b9d-0x0;var _0x33621e=_0x3164[_0x292b9d];return _0x33621e;};'use strict';var _=require(_0x4316('0x0'));var util=require(_0x4316('0x1'));var moment=require(_0x4316('0x2'));var BPromise=require(_0x4316('0x3'));var rs=require(_0x4316('0x4'));var fs=require('fs');var Redis=require(_0x4316('0x5'));var db=require(_0x4316('0x6'))['db'];var utils=require(_0x4316('0x7'));var logger=require(_0x4316('0x8'))(_0x4316('0x9'));var config=require(_0x4316('0xa'));var jayson=require(_0x4316('0xb'));var client=jayson[_0x4316('0xc')][_0x4316('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5ed321,_0x49bdbc,_0x375ce2){return new BPromise(function(_0x242b12,_0x257af9){return client[_0x4316('0xe')](_0x5ed321,_0x375ce2)[_0x4316('0xf')](function(_0x3e64f0){logger[_0x4316('0x10')](_0x4316('0x11'),_0x49bdbc,_0x4316('0x12'));logger['debug'](_0x4316('0x13'),_0x49bdbc,_0x4316('0x12'),JSON[_0x4316('0x14')](_0x3e64f0));if(_0x3e64f0[_0x4316('0x15')]){if(_0x3e64f0[_0x4316('0x15')][_0x4316('0x16')]===0x1f4){logger['error'](_0x4316('0x11'),_0x49bdbc,_0x3e64f0[_0x4316('0x15')]['message']);return _0x257af9(_0x3e64f0['error'][_0x4316('0x17')]);}logger[_0x4316('0x15')]('MailApplication,\x20%s,\x20%s',_0x49bdbc,_0x3e64f0[_0x4316('0x15')][_0x4316('0x17')]);return _0x242b12(_0x3e64f0['error'][_0x4316('0x17')]);}else{logger[_0x4316('0x10')](_0x4316('0x11'),_0x49bdbc,'request\x20sent');_0x242b12(_0x3e64f0['result']['message']);}})['catch'](function(_0x200452){logger['error'](_0x4316('0x11'),_0x49bdbc,_0x200452);_0x257af9(_0x200452);});});}exports[_0x4316('0x18')]=function(_0x249811){var _0x11e492=this;return new Promise(function(_0x66b713,_0x4736bb){return db['MailApplication'][_0x4316('0x19')](_0x249811[_0x4316('0x1a')],{'raw':_0x249811[_0x4316('0x1b')]?_0x249811[_0x4316('0x1b')][_0x4316('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x249811[_0x4316('0x1b')]?_0x249811[_0x4316('0x1b')][_0x4316('0x1d')]||null:null,'attributes':_0x249811[_0x4316('0x1b')]?_0x249811['options'][_0x4316('0x1e')]||null:null,'limit':_0x249811['options']?_0x249811['options'][_0x4316('0x1f')]||null:null})[_0x4316('0xf')](function(_0x16dcf7){logger[_0x4316('0x10')](_0x4316('0x18'),_0x249811);logger[_0x4316('0x20')](_0x4316('0x18'),_0x249811,JSON[_0x4316('0x14')](_0x16dcf7));_0x66b713(_0x16dcf7);})[_0x4316('0x21')](function(_0x36f38a){logger['error'](_0x4316('0x18'),_0x36f38a[_0x4316('0x17')],_0x249811);_0x4736bb(_0x11e492[_0x4316('0x15')](0x1f4,_0x36f38a[_0x4316('0x17')]));});});}; \ No newline at end of file +var _0x975f=['where','attributes','debug','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x975f,0x10c));var _0xf975=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x975f[_0x3acee8];return _0x5046cc;};'use strict';var _=require('lodash');var util=require(_0xf975('0x0'));var moment=require(_0xf975('0x1'));var BPromise=require(_0xf975('0x2'));var rs=require(_0xf975('0x3'));var fs=require('fs');var Redis=require(_0xf975('0x4'));var db=require(_0xf975('0x5'))['db'];var utils=require(_0xf975('0x6'));var logger=require(_0xf975('0x7'))(_0xf975('0x8'));var config=require(_0xf975('0x9'));var jayson=require(_0xf975('0xa'));var client=jayson[_0xf975('0xb')][_0xf975('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c08a1,_0x2a41e5,_0x37bc87){return new BPromise(function(_0xc2bd83,_0xcd1ea2){return client[_0xf975('0xd')](_0x4c08a1,_0x37bc87)[_0xf975('0xe')](function(_0x388b42){logger[_0xf975('0xf')](_0xf975('0x10'),_0x2a41e5,_0xf975('0x11'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x2a41e5,'request\x20sent',JSON['stringify'](_0x388b42));if(_0x388b42[_0xf975('0x12')]){if(_0x388b42[_0xf975('0x12')][_0xf975('0x13')]===0x1f4){logger[_0xf975('0x12')]('MailApplication,\x20%s,\x20%s',_0x2a41e5,_0x388b42['error']['message']);return _0xcd1ea2(_0x388b42[_0xf975('0x12')]['message']);}logger[_0xf975('0x12')]('MailApplication,\x20%s,\x20%s',_0x2a41e5,_0x388b42[_0xf975('0x12')][_0xf975('0x14')]);return _0xc2bd83(_0x388b42[_0xf975('0x12')]['message']);}else{logger[_0xf975('0xf')](_0xf975('0x10'),_0x2a41e5,_0xf975('0x11'));_0xc2bd83(_0x388b42[_0xf975('0x15')][_0xf975('0x14')]);}})[_0xf975('0x16')](function(_0x26a9a6){logger[_0xf975('0x12')]('MailApplication,\x20%s,\x20%s',_0x2a41e5,_0x26a9a6);_0xcd1ea2(_0x26a9a6);});});}exports[_0xf975('0x17')]=function(_0x10952e){var _0x50c695=this;return new Promise(function(_0x5af1ce,_0xde36e8){return db[_0xf975('0x18')][_0xf975('0x19')](_0x10952e[_0xf975('0x1a')],{'raw':_0x10952e[_0xf975('0x1b')]?_0x10952e[_0xf975('0x1b')][_0xf975('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10952e[_0xf975('0x1b')]?_0x10952e[_0xf975('0x1b')][_0xf975('0x1d')]||null:null,'attributes':_0x10952e['options']?_0x10952e[_0xf975('0x1b')][_0xf975('0x1e')]||null:null,'limit':_0x10952e['options']?_0x10952e[_0xf975('0x1b')]['limit']||null:null})[_0xf975('0xe')](function(_0x41b7eb){logger[_0xf975('0xf')](_0xf975('0x17'),_0x10952e);logger[_0xf975('0x1f')](_0xf975('0x17'),_0x10952e,JSON[_0xf975('0x20')](_0x41b7eb));_0x5af1ce(_0x41b7eb);})[_0xf975('0x16')](function(_0x4f9c4c){logger[_0xf975('0x12')](_0xf975('0x17'),_0x4f9c4c['message'],_0x10952e);_0xde36e8(_0x50c695['error'](0x1f4,_0x4f9c4c[_0xf975('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 58deb28..db4408f 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 _0x1ae2=['Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','describe','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','mail','mailinteraction:addtags','/:id','tracked','mailinteraction:destroy','delete','/:id/tags','removeTags','exports'];(function(_0x2f023d,_0x29dfe5){var _0x4ef240=function(_0x49f1ec){while(--_0x49f1ec){_0x2f023d['push'](_0x2f023d['shift']());}};_0x4ef240(++_0x29dfe5);}(_0x1ae2,0xe6));var _0x21ae=function(_0x44010d,_0x1d63be){_0x44010d=_0x44010d-0x0;var _0x1b1494=_0x1ae2[_0x44010d];return _0x1b1494;};'use strict';var express=require('express');var router=express[_0x21ae('0x0')]();var auth=require(_0x21ae('0x1'));var interaction=require(_0x21ae('0x2'));var controller=require(_0x21ae('0x3'));router[_0x21ae('0x4')]('/',auth[_0x21ae('0x5')](),controller['index']);router[_0x21ae('0x4')]('/describe',auth[_0x21ae('0x5')](),controller[_0x21ae('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x21ae('0x4')](_0x21ae('0x7'),auth[_0x21ae('0x5')](),controller[_0x21ae('0x8')]);router[_0x21ae('0x4')](_0x21ae('0x9'),auth[_0x21ae('0x5')](),controller[_0x21ae('0xa')]);router[_0x21ae('0xb')]('/',auth[_0x21ae('0x5')](),controller[_0x21ae('0xc')]);router[_0x21ae('0xb')](_0x21ae('0x7'),auth[_0x21ae('0x5')](),controller[_0x21ae('0xd')]);router[_0x21ae('0xb')]('/:id/tags',auth[_0x21ae('0x5')](),interaction['tracked'](_0x21ae('0xe'),_0x21ae('0xf')),controller['addTags']);router['put'](_0x21ae('0x10'),auth['isAuthenticated'](),interaction['tracked'](_0x21ae('0xe'),'mailinteraction:update'),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),interaction[_0x21ae('0x11')](_0x21ae('0xe'),_0x21ae('0x12')),controller['destroy']);router[_0x21ae('0x13')](_0x21ae('0x14'),auth[_0x21ae('0x5')](),controller[_0x21ae('0x15')]);module[_0x21ae('0x16')]=router; \ No newline at end of file +var _0xb7e3=['index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','addTags','put','mail','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','express','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated'];(function(_0x1a3adb,_0x4c3a94){var _0x53aead=function(_0x961dea){while(--_0x961dea){_0x1a3adb['push'](_0x1a3adb['shift']());}};_0x53aead(++_0x4c3a94);}(_0xb7e3,0x1bb));var _0x3b7e=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xb7e3[_0x5ce8b9];return _0xe34be0;};'use strict';var express=require(_0x3b7e('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3b7e('0x1'));var controller=require(_0x3b7e('0x2'));router[_0x3b7e('0x3')]('/',auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x5')]);router['get'](_0x3b7e('0x6'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x7')]);router['get'](_0x3b7e('0x8'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x9')]);router['get'](_0x3b7e('0xa'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0xb')]);router['get'](_0x3b7e('0xc'),auth['isAuthenticated'](),controller[_0x3b7e('0xd')]);router[_0x3b7e('0xe')]('/',auth[_0x3b7e('0x4')](),controller[_0x3b7e('0xf')]);router[_0x3b7e('0xe')](_0x3b7e('0xa'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x10')]);router[_0x3b7e('0xe')](_0x3b7e('0x11'),auth[_0x3b7e('0x4')](),interaction[_0x3b7e('0x12')]('mail','mailinteraction:addtags'),controller[_0x3b7e('0x13')]);router[_0x3b7e('0x14')]('/:id',auth[_0x3b7e('0x4')](),interaction['tracked'](_0x3b7e('0x15'),_0x3b7e('0x16')),controller[_0x3b7e('0x17')]);router[_0x3b7e('0x18')](_0x3b7e('0x8'),auth[_0x3b7e('0x4')](),interaction[_0x3b7e('0x12')](_0x3b7e('0x15'),_0x3b7e('0x19')),controller[_0x3b7e('0x1a')]);router[_0x3b7e('0x18')](_0x3b7e('0x11'),auth[_0x3b7e('0x4')](),controller[_0x3b7e('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 1fe5d4b..869a089 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 _0x84af=['STRING','TEXT','BOOLEAN','DATE','ENUM','out','sequelize'];(function(_0x593b76,_0x31f2a7){var _0xa8b246=function(_0x5055c2){while(--_0x5055c2){_0x593b76['push'](_0x593b76['shift']());}};_0xa8b246(++_0x31f2a7);}(_0x84af,0x195));var _0xf84a=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x84af[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require(_0xf84a('0x0'));var iconv=require('iconv');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf84a('0x1')]},'secondDisposition':{'type':Sequelize[_0xf84a('0x1')]},'thirdDisposition':{'type':Sequelize[_0xf84a('0x1')]},'note':{'type':Sequelize[_0xf84a('0x1')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xf84a('0x1')]},'cc':{'type':Sequelize[_0xf84a('0x2')]('long')},'subject':{'type':Sequelize[_0xf84a('0x2')]()},'attach':{'type':Sequelize[_0xf84a('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xf84a('0x4')]},'substatus':{'type':Sequelize[_0xf84a('0x1')](0x3c)},'substatusAt':{'type':Sequelize[_0xf84a('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xf84a('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf84a('0x5')]('in',_0xf84a('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8e8d=['BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8e8d,0x13d));var _0xd8e8=function(_0x3a549f,_0x38fbe0){_0x3a549f=_0x3a549f-0x0;var _0x434ee6=_0x8e8d[_0x3a549f];return _0x434ee6;};'use strict';var Sequelize=require(_0xd8e8('0x0'));var iconv=require(_0xd8e8('0x1'));module[_0xd8e8('0x2')]={'closed':{'type':Sequelize[_0xd8e8('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd8e8('0x4')]},'disposition':{'type':Sequelize[_0xd8e8('0x5')]},'secondDisposition':{'type':Sequelize[_0xd8e8('0x5')]},'thirdDisposition':{'type':Sequelize[_0xd8e8('0x5')]},'note':{'type':Sequelize[_0xd8e8('0x5')]},'inReplyTo':{'type':Sequelize[_0xd8e8('0x5')](0x1fe)},'to':{'type':Sequelize[_0xd8e8('0x5')]},'cc':{'type':Sequelize[_0xd8e8('0x6')](_0xd8e8('0x7'))},'subject':{'type':Sequelize[_0xd8e8('0x6')]()},'attach':{'type':Sequelize[_0xd8e8('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0xd8e8('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xd8e8('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xd8e8('0x8')]('in',_0xd8e8('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xd8e8('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xd8e8('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 939e03c..6e18e39 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 _0xd947=['params','includeAll','include','options','create','body','describe','addMessage','ids','omit','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','setTags','spread','findAll','emit','mailInteractionTags:save','removeTags','download','join','root','server','files','attachments','Messages','bcc','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','eml-format','rimraf','bluebird','util','path','squel','ioredis','../../components/parsers/advancedSearch','../../config/environment','html-entities','defaults','socket.io-emitter','./mailInteraction.socket','register','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','MailMessage','out','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','model','query','intersection','attributes','hasOwnProperty','nolimit','order','sort','filters','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','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','split','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','keys','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','SELECT','clone','contactName','t.id\x20IN\x20?','i.MailAccountId\x20IS\x20NOT\x20NULL','user','i.MailAccountId\x20IS\x20NULL','role','agent','toString','sequelize','keyBy','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.createdAt','i.updatedAt','i.closed','i.attach','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','MailInteractionId','Setting','enableEmailPreview','rows'];(function(_0x31344e,_0x174103){var _0x7edc9f=function(_0x11ce45){while(--_0x11ce45){_0x31344e['push'](_0x31344e['shift']());}};_0x7edc9f(++_0x174103);}(_0xd947,0x1f3));var _0x7d94=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xd947[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x7d94('0x0'));var rimraf=require(_0x7d94('0x1'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0x7d94('0x2'));var util=require(_0x7d94('0x3'));var path=require(_0x7d94('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7d94('0x5'));var juice=require('juice');var Redis=require(_0x7d94('0x6'));var qs=require('../../components/parsers/qs');var as=require(_0x7d94('0x7'));var logger=require('../../config/logger')('api');var config=require(_0x7d94('0x8'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x7d94('0x9'));config['redis']=_[_0x7d94('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7d94('0xb'))(new Redis(config['redis']));require(_0x7d94('0xc'))[_0x7d94('0xd')](socket);function respondWithStatusCode(_0x458959,_0x440d15){_0x440d15=_0x440d15||0xcc;return function(_0x4b21a9){if(_0x4b21a9){return _0x458959['sendStatus'](_0x440d15);}return _0x458959[_0x7d94('0xe')](_0x440d15)[_0x7d94('0xf')]();};}function respondWithResult(_0x4df2c5,_0x45228b){_0x45228b=_0x45228b||0xc8;return function(_0x3ca2e0){if(_0x3ca2e0){return _0x4df2c5[_0x7d94('0xe')](_0x45228b)['json'](_0x3ca2e0);}};}function respondWithFilteredResult(_0xa9a2d0,_0x241261){return function(_0x2b6f56){if(_0x2b6f56){var _0x450774=typeof _0x241261[_0x7d94('0x10')]==='undefined'&&typeof _0x241261['limit']===_0x7d94('0x11');var _0x16ea7e=_0x2b6f56['count'];var _0x5b3623=_0x450774?0x0:_0x241261[_0x7d94('0x10')];var _0x1fc393=_0x450774?_0x2b6f56[_0x7d94('0x12')]:_0x241261[_0x7d94('0x10')]+_0x241261[_0x7d94('0x13')];var _0x3c323a;if(_0x1fc393>=_0x16ea7e){_0x1fc393=_0x16ea7e;_0x3c323a=0xc8;}else{_0x3c323a=0xce;}_0xa9a2d0[_0x7d94('0xe')](_0x3c323a);return _0xa9a2d0[_0x7d94('0x14')](_0x7d94('0x15'),_0x5b3623+'-'+_0x1fc393+'/'+_0x16ea7e)[_0x7d94('0x16')](_0x2b6f56);}return null;};}function saveUpdates(_0x469d0b){return function(_0xe6be17){if(_0xe6be17){return _0xe6be17[_0x7d94('0x17')](_0x469d0b)[_0x7d94('0x18')](function(_0x38e3df){return _0x38e3df;});}return null;};}function removeEntity(_0x5f0a14){return function(_0x5277f3){if(_0x5277f3){return _0x5277f3[_0x7d94('0x19')]()[_0x7d94('0x18')](function(){_0x5f0a14[_0x7d94('0xe')](0xcc)[_0x7d94('0xf')]();});}};}function handleEntityNotFound(_0xa99744){return function(_0x884391){if(!_0x884391){_0xa99744[_0x7d94('0x1a')](0x194);}return _0x884391;};}function handleError(_0x52fdc0,_0x3bf852){_0x3bf852=_0x3bf852||0x1f4;return function(_0x1b8f2e){logger[_0x7d94('0x1b')](_0x1b8f2e[_0x7d94('0x1c')]);if(_0x1b8f2e[_0x7d94('0x1d')]){delete _0x1b8f2e[_0x7d94('0x1d')];}_0x52fdc0['status'](_0x3bf852)[_0x7d94('0x1e')](_0x1b8f2e);};}function getInteractionUsers(_0x3367c9,_0x4a6516){return new BPromise(function(_0x116e85,_0x3b3140){try{if(_0x4a6516[_0x3367c9['id']]){_0x3367c9[_0x7d94('0x1f')]=_[_0x7d94('0x20')](_0x4a6516[_0x3367c9['id']],function(_0x481cbf){return{'id':_0x481cbf['id'],'fullname':_0x481cbf[_0x7d94('0x21')]};});}}catch(_0x115fd2){_0x3b3140(_0x115fd2);}_0x116e85(_0x3367c9);});}function getInteractionTags(_0x10fc04,_0x69a61c){return new BPromise(function(_0x3e476d,_0x34e480){try{if(_0x10fc04[_0x7d94('0x22')]){_0x10fc04[_0x7d94('0x23')]=[];_0x10fc04[_0x7d94('0x22')]['split'](',')[_0x7d94('0x24')](function(_0x1d314c){_0x10fc04[_0x7d94('0x23')][_0x7d94('0x25')](_0x69a61c[_0x1d314c]);});}delete _0x10fc04[_0x7d94('0x22')];}catch(_0x28a152){_0x34e480(_0x28a152);}_0x3e476d(_0x10fc04);});}function getLastMessageText(_0x44767b){return new BPromise(function(_0x21a233,_0xefe7c0){return db[_0x7d94('0x26')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x44767b['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x7d94('0x27')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0x7d94('0x18')](function(_0x49e350){if(_0x49e350&&_0x49e350[_0x7d94('0x28')]){_0x44767b[_0x7d94('0x29')]=_[_0x7d94('0x2a')](_0x49e350[_0x7d94('0x28')]);}_0x21a233(_0x44767b);})[_0x7d94('0x2b')](function(_0x5505ca){_0xefe7c0(_0x5505ca);});});}function updateMailInteraction(_0x92ed60,_0x1a15fc,_0x453387,_0x4c1298){return new BPromise(function(_0x143f03,_0x42b71f){return getInteractionUsers(_0x92ed60,_0x453387)[_0x7d94('0x18')](function(_0x2e498d){return getInteractionTags(_0x2e498d,_0x1a15fc);})[_0x7d94('0x18')](function(_0x437beb){if(_0x4c1298){_0x143f03(getLastMessageText(_0x437beb));}else{_0x143f03(_0x437beb);}})[_0x7d94('0x2b')](function(_0x419461){_0x42b71f(_0x419461);});});}exports[_0x7d94('0x2c')]=function(_0x510a87,_0x539ce0){var _0x215815={},_0x34229d={},_0x57fe05={'count':0x0,'rows':[]};var _0x6288a0=_[_0x7d94('0x20')](db[_0x7d94('0x2d')][_0x7d94('0x2e')],function(_0x3fa82f){return{'name':_0x3fa82f[_0x7d94('0x2f')],'type':_0x3fa82f['type']['key']};});_0x34229d[_0x7d94('0x30')]=_[_0x7d94('0x20')](_0x6288a0,_0x7d94('0x1d'));_0x34229d[_0x7d94('0x31')]=_['keys'](_0x510a87[_0x7d94('0x31')]);_0x34229d['filters']=_[_0x7d94('0x32')](_0x34229d[_0x7d94('0x30')],_0x34229d[_0x7d94('0x31')]);_0x215815[_0x7d94('0x33')]=_[_0x7d94('0x32')](_0x34229d[_0x7d94('0x30')],qs['fields'](_0x510a87['query']['fields']));_0x215815[_0x7d94('0x33')]=_0x215815[_0x7d94('0x33')]['length']?_0x215815[_0x7d94('0x33')]:_0x34229d[_0x7d94('0x30')];if(!_0x510a87[_0x7d94('0x31')][_0x7d94('0x34')](_0x7d94('0x35'))){_0x215815['limit']=qs[_0x7d94('0x13')](_0x510a87['query'][_0x7d94('0x13')]);_0x215815[_0x7d94('0x10')]=qs['offset'](_0x510a87['query'][_0x7d94('0x10')]);}_0x215815[_0x7d94('0x36')]=qs[_0x7d94('0x37')](_0x510a87[_0x7d94('0x31')][_0x7d94('0x37')]);_0x215815['where']=qs[_0x7d94('0x38')](_['pick'](_0x510a87[_0x7d94('0x31')],_0x34229d[_0x7d94('0x38')]),_0x6288a0);var _0x521a62=[];var _0x22f8eb=squel[_0x7d94('0x39')]()[_0x7d94('0x3a')]('id')[_0x7d94('0x3a')]('name')[_0x7d94('0x3a')](_0x7d94('0x3b'))[_0x7d94('0x3c')](_0x7d94('0x3d'));var _0x1879bd=squel[_0x7d94('0x39')]()[_0x7d94('0x3a')](_0x7d94('0x3e'))[_0x7d94('0x3a')](_0x7d94('0x3f'))['field'](_0x7d94('0x40'))[_0x7d94('0x3c')](_0x7d94('0x41'),'ui')[_0x7d94('0x42')](_0x7d94('0x43'),'u',_0x7d94('0x44'));var _0xd2754f=squel[_0x7d94('0x39')]()['from'](_0x7d94('0x45'),'i')[_0x7d94('0x42')](_0x7d94('0x46'),'c',_0x7d94('0x47'))[_0x7d94('0x42')](_0x7d94('0x43'),'o',_0x7d94('0x48'))[_0x7d94('0x42')](_0x7d94('0x49'),'a',_0x7d94('0x4a'))[_0x7d94('0x42')](_0x7d94('0x4b'),'me',_0x7d94('0x4c'))[_0x7d94('0x42')](_0x7d94('0x4d'),'it',_0x7d94('0x4e'))['left_join'](_0x7d94('0x3d'),'t',_0x7d94('0x4f'));var _0x30f5d5=squel[_0x7d94('0x50')]();var _0x251459=[];var _0x479537=squel[_0x7d94('0x50')]();var _0x5e883c;if(_0x510a87[_0x7d94('0x31')][_0x7d94('0x51')]){_0x5e883c=as[_0x7d94('0x52')](_0x510a87[_0x7d94('0x31')][_0x7d94('0x51')]);var _0x4c339d=_0x5e883c[_0x7d94('0x53')];for(var _0x40fc1a=0x0;_0x40fc1a<_0x5e883c[_0x7d94('0x54')][_0x7d94('0x55')];_0x40fc1a++){var _0xc50106=_0x5e883c[_0x7d94('0x54')][_0x40fc1a];var _0x9b58b9='i';var _0x2505e7=_[_0x7d94('0x56')](_0x6288a0,[_0x7d94('0x1d'),_0xc50106['field']]);if(!_0x2505e7){switch(_0xc50106[_0x7d94('0x3a')]){case _0x7d94('0x57'):if(_0xc50106[_0x7d94('0x58')]==0x1){_0xd2754f[_0x7d94('0x59')]('`'+_0xc50106[_0x7d94('0x3a')]+'`\x20=\x200');}else{_0xd2754f[_0x7d94('0x59')]('`'+_0xc50106[_0x7d94('0x3a')]+_0x7d94('0x5a'));}break;case _0x7d94('0x5b'):if(_0xc50106[_0x7d94('0x5c')]==='$substring'){if(_0xc50106[_0x7d94('0x58')][_0x7d94('0x5d')]('\x20')[_0x7d94('0x55')]>0x1){_0x30f5d5[_0x4c339d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0xc50106[_0x7d94('0x58')]),null);}else{var _0x4f8c47='%'+_0xc50106[_0x7d94('0x58')]+'%';_0x30f5d5[_0x4c339d](_0x7d94('0x5e'),_0x4f8c47,_0x4f8c47,_0x4f8c47);}}else{_0x2505e7=_[_0x7d94('0x56')](_0x6288a0,[_0x7d94('0x1d'),'ContactId']);_0xc50106[_0x7d94('0x3a')]=_0x7d94('0x5f');_0x317b61=as[_0x7d94('0x60')](_0x9b58b9,_0x2505e7[_0x7d94('0x61')],_0xc50106);_0x30f5d5[_0x4c339d](_0x317b61[_0x7d94('0x62')],_0x317b61[_0x7d94('0x58')][_0x7d94('0x63')],_0x317b61['value'][_0x7d94('0xf')]);}break;case _0x7d94('0x64'):var _0x43c288=_0xc50106['value'][_0x7d94('0x5d')](',')[_0x7d94('0x20')](function(_0x3bd11c){return Number(_0x3bd11c);});_0x43c288[_0x7d94('0x24')](function(_0x4d6199){_0x479537['or'](_0x7d94('0x65'),'%,'+_0x4d6199+',%');});_0x251459=_[_0x7d94('0x66')](_0x251459,_0x43c288);break;case _0x7d94('0x67'):if(_0xc50106[_0x7d94('0x5c')]===_0x7d94('0x68')){_0x30f5d5[_0x4c339d](_0x7d94('0x69'),'%'+_0xc50106[_0x7d94('0x58')]+'%',null);}else{_0x2505e7=_['find'](_0x6288a0,['name','UserId']);_0xc50106[_0x7d94('0x3a')]=_0x7d94('0x6a');_0x317b61=as[_0x7d94('0x60')](_0x9b58b9,_0x2505e7[_0x7d94('0x61')],_0xc50106);_0x30f5d5[_0x4c339d](_0x317b61[_0x7d94('0x62')],_0x317b61['value'][_0x7d94('0x63')],_0x317b61['value'][_0x7d94('0xf')]);}break;case'plainBody':_0x317b61=as[_0x7d94('0x60')]('me',null,_0xc50106);_0x30f5d5[_0x4c339d](_0x317b61[_0x7d94('0x62')],_0x317b61['value'][_0x7d94('0x63')],_0x317b61['value']['end']);break;}}else{var _0x317b61=as['buildExpression'](_0x9b58b9,_0x2505e7[_0x7d94('0x61')],_0xc50106);_0x30f5d5[_0x4c339d](_0x317b61['text'],_0x317b61[_0x7d94('0x58')][_0x7d94('0x63')],_0x317b61[_0x7d94('0x58')][_0x7d94('0xf')]);}}}else{var _0x46dbf5=_(_0x510a87['query'])[_0x7d94('0x6b')]()[_0x7d94('0x20')](function(_0x8b51ab){return _[_0x7d94('0x6c')](_0x6288a0,[_0x7d94('0x1d'),_0x8b51ab])?_0x8b51ab:undefined;})[_0x7d94('0x6d')]()[_0x7d94('0x58')]();if(!_[_0x7d94('0x6e')](_0x46dbf5)){_0x46dbf5[_0x7d94('0x24')](function(_0x12acb9){if(_0x12acb9===_0x7d94('0x6f')){_0xd2754f['where'](_0x7d94('0x70'),[][_0x7d94('0x71')](_0x510a87[_0x7d94('0x31')][_0x12acb9]));}else if(_0x12acb9===_0x7d94('0x72')){var _0x35f845=JSON[_0x7d94('0x73')](_0x510a87['query'][_0x12acb9])[_0x7d94('0x74')];var _0x1ba0c9=JSON['parse'](_0x510a87[_0x7d94('0x31')][_0x12acb9])[_0x7d94('0x75')];_0xd2754f[_0x7d94('0x76')](_0x7d94('0x77'),_0x35f845,_0x1ba0c9);}else{if(_0x510a87[_0x7d94('0x31')][_0x12acb9]===_0x7d94('0x78')){_0xd2754f[_0x7d94('0x76')]('i.'+_0x12acb9+_0x7d94('0x79'));}else{_0xd2754f[_0x7d94('0x76')]('i.'+_0x12acb9+_0x7d94('0x7a'),_0x510a87[_0x7d94('0x31')][_0x12acb9]);}}});}if(_0x510a87['query']['read']){if(_0x510a87[_0x7d94('0x31')][_0x7d94('0x7b')]==0x1){_0xd2754f[_0x7d94('0x59')](_0x7d94('0x7c'));}else{_0xd2754f['having']('`unreadMessages`\x20>\x200');}}if(_0x510a87[_0x7d94('0x31')][_0x7d94('0x7d')]){_0x251459=_['isArray'](_0x510a87[_0x7d94('0x31')][_0x7d94('0x7d')])?_0x510a87['query'][_0x7d94('0x7d')]:new Array(_0x510a87[_0x7d94('0x31')][_0x7d94('0x7d')]);_0x251459[_0x7d94('0x24')](function(_0x70f3c8){_0x479537['or'](_0x7d94('0x65'),'%,'+_0x70f3c8+',%');});}if(_0x510a87[_0x7d94('0x31')][_0x7d94('0x7e')]){var _0x3db966=_0x510a87[_0x7d94('0x31')][_0x7d94('0x7e')][_0x7d94('0x7f')]('\x5c','\x5c\x5c')[_0x7d94('0x7f')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3db966)){_0x30f5d5['or'](_0x7d94('0x80'),_0x3db966+'%');}else if(qs[_0x7d94('0x81')](_0x3db966)){_0x30f5d5['or']('c.email\x20LIKE\x20?',_0x3db966+'%');}else{_0x30f5d5['or'](_0x7d94('0x82'),qs[_0x7d94('0x83')](_0x3db966))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x7d94('0x83')](_0x3db966));}}}_0xd2754f[_0x7d94('0x76')](_0x30f5d5);_0xd2754f[_0x7d94('0x84')](_0x7d94('0x85'));var _0x22e838={'type':db['Sequelize']['QueryTypes'][_0x7d94('0x86')],'raw':!![]};var _0x936b5a=_0xd2754f[_0x7d94('0x87')]();_0x936b5a[_0x7d94('0x3a')](_0x7d94('0x85'));_0x936b5a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7d94('0x57'));if(_0x215815['order']){_0x215815[_0x7d94('0x36')][_0x7d94('0x24')](function(_0x1f14a7){var _0x29fe5a=_0x1f14a7[0x0]===_0x7d94('0x88')?_0x1f14a7[0x0]:'i.'+_0x1f14a7[0x0];_0xd2754f[_0x7d94('0x36')](_0x29fe5a,_0x1f14a7[0x1]==='DESC'?![]:!![]);});}if(!_[_0x7d94('0x6e')](_0x251459)){_0xd2754f['having'](_0x479537);_0x936b5a['where'](_0x7d94('0x89'),_0x251459);}BPromise['resolve']()[_0x7d94('0x18')](function(){if(!_0x5e883c){if(_0x510a87[_0x7d94('0x31')][_0x7d94('0x6f')])return;_0x936b5a[_0x7d94('0x76')](_0x7d94('0x8a'));_0xd2754f[_0x7d94('0x76')](_0x7d94('0x8a'));return;}if(_0x510a87[_0x7d94('0x8b')]['role']!=='agent')return;return _0x510a87[_0x7d94('0x8b')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x7d94('0x18')](function(_0xa625cd){if(_[_0x7d94('0x6e')](_0xa625cd)){_0x936b5a[_0x7d94('0x76')](_0x7d94('0x8c'));_0xd2754f[_0x7d94('0x76')](_0x7d94('0x8c'));}else{_0x936b5a[_0x7d94('0x76')]('i.MailAccountId\x20IN\x20?',_['map'](_0xa625cd,'id'));_0xd2754f['where'](_0x7d94('0x70'),_['map'](_0xa625cd,'id'));}});})[_0x7d94('0x18')](function(){if(_0x510a87[_0x7d94('0x8b')][_0x7d94('0x8d')]===_0x7d94('0x8e')&&!_0x5e883c&&!_0x510a87[_0x7d94('0x31')][_0x7d94('0x6f')])return[];return db['sequelize'][_0x7d94('0x31')](_0x936b5a[_0x7d94('0x8f')](),_0x22e838);})[_0x7d94('0x18')](function(_0x9df74e){_0x57fe05['count']=_0x9df74e['length'];if(_0x57fe05[_0x7d94('0x12')]===0x0)return[];return db[_0x7d94('0x90')][_0x7d94('0x31')](_0x22f8eb[_0x7d94('0x8f')](),_0x22e838)[_0x7d94('0x18')](function(_0x4825ed){_0x521a62=_[_0x7d94('0x91')](_0x4825ed,'id');_0x22e838=_[_0x7d94('0x92')](_0x22e838,{'model':db[_0x7d94('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x510a87[_0x7d94('0x31')][_0x7d94('0x93')]){_0x215815[_0x7d94('0x33')]['forEach'](function(_0xe3465f){_0xd2754f[_0x7d94('0x3a')]('i.'+_0xe3465f);});}else{_0xd2754f['field'](_0x7d94('0x94'),_0x7d94('0x57'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0x95'),'Account.key');_0xd2754f[_0x7d94('0x3a')](_0x7d94('0x96'),_0x7d94('0x97'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0x98'),_0x7d94('0x88'));_0xd2754f['field'](_0x7d94('0x85'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0x99'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0x9a'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0x9b'));_0xd2754f[_0x7d94('0x3a')]('i.closedAt');_0xd2754f['field'](_0x7d94('0x9c'));_0xd2754f[_0x7d94('0x3a')]('i.lastMsgAt');_0xd2754f[_0x7d94('0x3a')]('i.lastMsgDirection');_0xd2754f[_0x7d94('0x3a')](_0x7d94('0x9d'));_0xd2754f['field'](_0x7d94('0x9e'));_0xd2754f['field'](_0x7d94('0x9f'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa0'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa1'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa2'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa3'));_0xd2754f[_0x7d94('0x3a')]('i.MailAccountId');_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa4'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa5'),'Contact.firstName');_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa6'),_0x7d94('0xa7'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xa8'),_0x7d94('0xa9'));_0xd2754f[_0x7d94('0x3a')]('c.phone',_0x7d94('0xaa'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xab'),_0x7d94('0xac'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xad'),_0x7d94('0xae'));_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xaf'),'Owner.fullname');_0xd2754f[_0x7d94('0x3a')](_0x7d94('0xb0'),_0x7d94('0xb1'));_0xd2754f[_0x7d94('0x3a')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x7d94('0x22'));}if(_0x215815[_0x7d94('0x13')])_0xd2754f[_0x7d94('0x13')](_0x215815[_0x7d94('0x13')]);if(_0x215815[_0x7d94('0x10')])_0xd2754f[_0x7d94('0x10')](_0x215815[_0x7d94('0x10')]);return db[_0x7d94('0x90')][_0x7d94('0x31')](_0xd2754f['toString'](),_0x22e838);})[_0x7d94('0x18')](function(_0x36b445){if(_0x36b445[_0x7d94('0x55')]>0x0)_0x1879bd['where']('ui.MailInteractionId\x20IN\x20?',_[_0x7d94('0x20')](_0x36b445,'id'));return db[_0x7d94('0x90')][_0x7d94('0x31')](_0x1879bd[_0x7d94('0x8f')](),_0x22e838)[_0x7d94('0x18')](function(_0x8cf84c){var _0xf67ca3=_['groupBy'](_0x8cf84c,_0x7d94('0xb2'));var _0x2a225c=[];return db[_0x7d94('0xb3')]['findOne']({'attributes':[_0x7d94('0xb4')],'raw':!![]})[_0x7d94('0x18')](function(_0x511d82){var _0x4e9194=_0x511d82[_0x7d94('0xb4')];_0x36b445['forEach'](function(_0x107519){_0x2a225c[_0x7d94('0x25')](updateMailInteraction(_0x107519,_0x521a62,_0xf67ca3,_0x4e9194));});return BPromise['all'](_0x2a225c);});});});})['then'](function(_0x43c752){_0x57fe05[_0x7d94('0xb5')]=_0x43c752;return _0x57fe05;})['then'](respondWithFilteredResult(_0x539ce0,_0x215815))[_0x7d94('0x2b')](handleError(_0x539ce0,null));};exports['show']=function(_0x210462,_0x4a6c41){var _0x530a6a={'raw':![],'where':{'id':_0x210462[_0x7d94('0xb6')]['id']}},_0x48a89a={};_0x48a89a[_0x7d94('0x30')]=_['keys'](db[_0x7d94('0x2d')]['rawAttributes']);_0x48a89a[_0x7d94('0x31')]=_['keys'](_0x210462['query']);_0x48a89a[_0x7d94('0x38')]=_[_0x7d94('0x32')](_0x48a89a['model'],_0x48a89a[_0x7d94('0x31')]);_0x530a6a['attributes']=_['intersection'](_0x48a89a[_0x7d94('0x30')],qs[_0x7d94('0x93')](_0x210462[_0x7d94('0x31')][_0x7d94('0x93')]));_0x530a6a[_0x7d94('0x33')]=_0x530a6a['attributes'][_0x7d94('0x55')]?_0x530a6a[_0x7d94('0x33')]:_0x48a89a[_0x7d94('0x30')];if(_0x210462[_0x7d94('0x31')][_0x7d94('0xb7')]){_0x530a6a[_0x7d94('0xb8')]=[{'all':!![]}];}_0x530a6a=_[_0x7d94('0x92')]({},_0x530a6a,_0x210462[_0x7d94('0xb9')]);return db['MailInteraction'][_0x7d94('0x56')](_0x530a6a)[_0x7d94('0x18')](handleEntityNotFound(_0x4a6c41,null))['then'](respondWithResult(_0x4a6c41,null))[_0x7d94('0x2b')](handleError(_0x4a6c41,null));};exports[_0x7d94('0xba')]=function(_0x4029d6,_0x4a7986){return db[_0x7d94('0x2d')][_0x7d94('0xba')](_0x4029d6[_0x7d94('0xbb')],{})[_0x7d94('0x18')](respondWithResult(_0x4a7986,0xc9))[_0x7d94('0x2b')](handleError(_0x4a7986,null));};exports[_0x7d94('0x17')]=function(_0x28c2e2,_0x5126f1){if(_0x28c2e2['body']['id']){delete _0x28c2e2['body']['id'];}return db[_0x7d94('0x2d')][_0x7d94('0x56')]({'where':{'id':_0x28c2e2['params']['id']}})['then'](handleEntityNotFound(_0x5126f1,null))[_0x7d94('0x18')](saveUpdates(_0x28c2e2[_0x7d94('0xbb')],null))[_0x7d94('0x18')](respondWithResult(_0x5126f1,null))[_0x7d94('0x2b')](handleError(_0x5126f1,null));};exports['destroy']=function(_0x4a56cd,_0x4b7406){return db['MailInteraction'][_0x7d94('0x56')]({'where':{'id':_0x4a56cd[_0x7d94('0xb6')]['id']}})[_0x7d94('0x18')](handleEntityNotFound(_0x4b7406,null))[_0x7d94('0x18')](removeEntity(_0x4b7406,null))['catch'](handleError(_0x4b7406,null));};exports['describe']=function(_0xfd19d0,_0x4180a8){return db['MailInteraction'][_0x7d94('0xbc')]()['then'](respondWithResult(_0x4180a8,null))['catch'](handleError(_0x4180a8,null));};exports[_0x7d94('0xbd')]=function(_0x312e1d,_0x1ee71a){return db['MailMessage'][_0x7d94('0x56')]({'where':{'id':_0x312e1d['params']['id']}})[_0x7d94('0x18')](handleEntityNotFound(_0x1ee71a,null))[_0x7d94('0x18')](function(_0x4a926f){if(_0x4a926f){return _0x4a926f[_0x7d94('0xbd')](_0x312e1d['body'][_0x7d94('0xbe')],_[_0x7d94('0xbf')](_0x312e1d[_0x7d94('0xbb')],[_0x7d94('0xbe'),'id'])||{});}})[_0x7d94('0x18')](respondWithResult(_0x1ee71a,null))[_0x7d94('0x2b')](handleError(_0x1ee71a,null));};exports[_0x7d94('0xc0')]=function(_0x42fdcc,_0xa3175b){var _0x592b7d={'raw':![],'where':{}};var _0x24e2bd={};var _0xced42e={'count':0x0,'rows':[]};return db[_0x7d94('0x2d')][_0x7d94('0xc1')]({'where':{'id':_0x42fdcc['params']['id']}})[_0x7d94('0x18')](handleEntityNotFound(_0xa3175b,null))[_0x7d94('0x18')](function(_0x5da5c2){if(_0x5da5c2){_0x24e2bd['model']=_[_0x7d94('0x6b')](db['MailMessage']['rawAttributes']);_0x24e2bd[_0x7d94('0x31')]=_[_0x7d94('0x6b')](_0x42fdcc[_0x7d94('0x31')]);_0x24e2bd[_0x7d94('0x38')]=_[_0x7d94('0x32')](_0x24e2bd[_0x7d94('0x30')],_0x24e2bd['query']);_0x592b7d[_0x7d94('0x33')]=_[_0x7d94('0x32')](_0x24e2bd[_0x7d94('0x30')],qs[_0x7d94('0x93')](_0x42fdcc[_0x7d94('0x31')][_0x7d94('0x93')]));_0x592b7d[_0x7d94('0x33')]=_0x592b7d[_0x7d94('0x33')][_0x7d94('0x55')]?_0x592b7d[_0x7d94('0x33')]:_0x24e2bd[_0x7d94('0x30')];if(!_0x42fdcc['query'][_0x7d94('0x34')](_0x7d94('0x35'))){_0x592b7d[_0x7d94('0x13')]=qs[_0x7d94('0x13')](_0x42fdcc[_0x7d94('0x31')][_0x7d94('0x13')]);_0x592b7d[_0x7d94('0x10')]=qs[_0x7d94('0x10')](_0x42fdcc[_0x7d94('0x31')][_0x7d94('0x10')]);}_0x592b7d[_0x7d94('0x36')]=qs[_0x7d94('0x37')](_0x42fdcc['query'][_0x7d94('0x37')]);_0x592b7d[_0x7d94('0x76')]=qs['filters'](_[_0x7d94('0xc2')](_0x42fdcc[_0x7d94('0x31')],_0x24e2bd[_0x7d94('0x38')]));_0x592b7d[_0x7d94('0x76')][_0x7d94('0xb2')]=_0x5da5c2['id'];if(_0x42fdcc[_0x7d94('0x31')][_0x7d94('0x7e')]){_0x592b7d['where']=_['merge'](_0x592b7d['where'],{'$or':_[_0x7d94('0x20')](_0x592b7d[_0x7d94('0x33')],function(_0x1bc9e0){var _0x3fec21={};_0x3fec21[_0x1bc9e0]={'$like':'%'+_0x42fdcc['query'][_0x7d94('0x7e')]+'%'};return _0x3fec21;})});}if(_0x42fdcc['query'][_0x7d94('0x74')]){var _0x58582c=_0x42fdcc[_0x7d94('0x31')][_0x7d94('0x74')]['split'](',');var _0x37758c={};_0x37758c[_0x58582c[0x0]]={'$gte':moment(_0x58582c[0x1])[_0x7d94('0xc3')](_0x7d94('0xc4'))};_0x592b7d[_0x7d94('0x76')]=_['merge'](_0x592b7d['where'],_0x37758c);}_0x592b7d=_[_0x7d94('0x92')]({},_0x592b7d,_0x42fdcc['options']);return db[_0x7d94('0x26')][_0x7d94('0x12')]({'where':_0x592b7d['where']})[_0x7d94('0x18')](function(_0x59754f){_0xced42e[_0x7d94('0x12')]=_0x59754f;if(_0x42fdcc['query'][_0x7d94('0xb7')]){_0x592b7d['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x592b7d);})[_0x7d94('0x18')](function(_0x177378){if(_0x42fdcc['query'][_0x7d94('0xc5')]===_0x7d94('0xc6')){for(var _0x57012d=0x0;_0x57012d<_0x177378[_0x7d94('0x55')];_0x57012d++){_0x177378[_0x57012d][_0x7d94('0xbb')]=juice(_0x177378[_0x57012d][_0x7d94('0xbb')]);}}_0xced42e[_0x7d94('0xb5')]=_0x177378;return _0xced42e;});}})[_0x7d94('0x18')](respondWithFilteredResult(_0xa3175b,_0x592b7d))[_0x7d94('0x2b')](handleError(_0xa3175b,null));};exports['addTags']=function(_0x4394b6,_0x2f6d72){return db['MailInteraction']['find']({'where':{'id':_0x4394b6[_0x7d94('0xb6')]['id']}})[_0x7d94('0x18')](handleEntityNotFound(_0x2f6d72,null))[_0x7d94('0x18')](function(_0x3d6ef5){if(_0x3d6ef5){return _0x3d6ef5[_0x7d94('0xc7')](_0x4394b6['body'][_0x7d94('0xbe')],_['omit'](_0x4394b6['body'],[_0x7d94('0xbe'),'id'])||{})[_0x7d94('0xc8')](function(){return db[_0x7d94('0x64')][_0x7d94('0xc9')]({'attributes':['id',_0x7d94('0x1d'),'color'],'where':{'id':_0x4394b6['body'][_0x7d94('0xbe')]}});})['then'](function(_0x14b7f3){socket[_0x7d94('0xca')](_0x7d94('0xcb'),{'id':Number(_0x4394b6['params']['id']),'tags':_0x14b7f3||[]});return{'id':Number(_0x4394b6[_0x7d94('0xb6')]['id']),'tags':_0x14b7f3||[]};});}})[_0x7d94('0x18')](respondWithResult(_0x2f6d72,null))[_0x7d94('0x2b')](handleError(_0x2f6d72,null));};exports[_0x7d94('0xcc')]=function(_0x261849,_0x51deb5){return db[_0x7d94('0x2d')]['find']({'where':{'id':_0x261849[_0x7d94('0xb6')]['id']}})[_0x7d94('0x18')](handleEntityNotFound(_0x51deb5,null))[_0x7d94('0x18')](function(_0x34bebe){if(_0x34bebe){return _0x34bebe[_0x7d94('0xcc')](_0x261849[_0x7d94('0x31')][_0x7d94('0xbe')]);}})[_0x7d94('0x18')](respondWithStatusCode(_0x51deb5,null))[_0x7d94('0x2b')](handleError(_0x51deb5,null));};exports[_0x7d94('0xcd')]=function(_0x540544,_0xcc91cb){var _0x53aeb6=moment()['unix']()[_0x7d94('0x8f')]();var _0x4be4b0=path[_0x7d94('0xce')](config[_0x7d94('0xcf')],_0x7d94('0xd0'),_0x7d94('0xd1'),'tmp');var _0x3f9d0b=path[_0x7d94('0xce')](config[_0x7d94('0xcf')],_0x7d94('0xd0'),'files',_0x7d94('0xd2'));var _0x38acbf=path['join'](_0x4be4b0,_0x53aeb6);var _0x4015bc=util['format']('transcript-%d-%s.zip',_0x540544[_0x7d94('0xb6')]['id'],_0x53aeb6);var _0x2b50a5=path[_0x7d94('0xce')](_0x4be4b0,_0x4015bc);var _0x99dc6f=[];if(_0x540544[_0x7d94('0x31')][_0x7d94('0xd2')]){_0x99dc6f['push']({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x43d00d=[{'model':db[_0x7d94('0x26')],'as':_0x7d94('0xd3'),'attributes':['id',_0x7d94('0xbb'),_0x7d94('0x3c'),'to','cc',_0x7d94('0xd4'),'subject','createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x99dc6f}];return db[_0x7d94('0x2d')][_0x7d94('0x56')]({'where':{'id':_0x540544[_0x7d94('0xb6')]['id']},'include':_0x43d00d})[_0x7d94('0x18')](handleEntityNotFound(_0xcc91cb,null))['then'](function(_0x2619ec){if(_0x2619ec&&_0x2619ec[_0x7d94('0xd3')]){var _0xd127b3=_0x2619ec[_0x7d94('0xd5')]({'plain':!![]});fs[_0x7d94('0xd6')](_0x38acbf);return BPromise[_0x7d94('0xd7')](_0xd127b3[_0x7d94('0xd3')],function(_0x208011,_0x4257d6){var _0x23346a={'from':_0x208011[_0x7d94('0x3c')],'to':_0x208011['to'],'subject':_0x208011['subject'],'html':htmlEntities[_0x7d94('0xd8')](_0x208011['body']),'headers':{'Date':moment(_0x208011[_0x7d94('0x72')])[_0x7d94('0xc3')](_0x7d94('0xd9'))},'attachments':[]};if(_0x208011['cc']){_0x23346a[_0x7d94('0xda')]['Cc']=_0x208011['cc'];}if(_0x208011[_0x7d94('0xd4')]){_0x23346a[_0x7d94('0xda')][_0x7d94('0xdb')]=_0x208011[_0x7d94('0xd4')];}return new BPromise(function(_0x27449d,_0x4b6bb7){if(_0x208011['Attachments']){for(var _0x2c990f=0x0;_0x2c990f<_0x208011[_0x7d94('0xdc')]['length'];_0x2c990f++){var _0x321708=_0x208011[_0x7d94('0xdc')][_0x2c990f];var _0x1c4208=path['join'](_0x3f9d0b,_0x321708[_0x7d94('0xdd')]);if(fs[_0x7d94('0xde')](_0x1c4208)){_0x23346a[_0x7d94('0xd2')][_0x7d94('0x25')]({'name':_0x321708[_0x7d94('0x1d')],'contentType':_0x321708['type'],'data':fs[_0x7d94('0xdf')](_0x1c4208)});}}}emlformat[_0x7d94('0xe0')](_0x23346a,function(_0x313641,_0x63ec67){if(_0x313641)return _0x4b6bb7(_0x313641);fs[_0x7d94('0xe1')](path[_0x7d94('0xce')](_0x38acbf,util['format'](_0x7d94('0xe2'),_0x4257d6)),_0x63ec67);return _0x27449d(_0x63ec67);});});})[_0x7d94('0x18')](function(){return new BPromise(function(_0x233990,_0x31677d){zipdir(_0x38acbf,{'saveTo':_0x2b50a5},function(_0x4b5169,_0x511ad8){if(_0x4b5169)return _0x31677d(_0x4b5169);return _0x233990(_0x511ad8);});})['then'](function(){return new BPromise(function(_0x1a9dfc,_0x5dcee5){rimraf(_0x38acbf,function(_0xecf5e6){if(_0xecf5e6)_0x5dcee5(_0xecf5e6);return _0x1a9dfc();});});})[_0x7d94('0x18')](function(){return _0xcc91cb[_0x7d94('0xcd')](_0x2b50a5,_0x4015bc,function(_0x4640b5){if(!_0x4640b5)fs['unlinkSync'](_0x2b50a5);});});});}else{return _0xcc91cb[_0x7d94('0x1a')](0xc8);}})[_0x7d94('0x2b')](handleError(_0xcc91cb,null));}; \ No newline at end of file +var _0x42db=['MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','start','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','isArray','filter','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','sequelize','toString','count','merge','Account.key','a.mandatoryDisposition','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.ContactId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','filters','options','create','body','params','destroy','describe','addMessage','ids','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','true','addTags','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','zip-dir','moment','util','path','squel','juice','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','Content-Range','update','then','name','send','map','fullname','TagIds','Tags','split','forEach','push','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','field','color','from','select','u.id','u.fullname','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','it.MailInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','length'];(function(_0x401e64,_0x5bf90a){var _0x31a5f7=function(_0x546026){while(--_0x546026){_0x401e64['push'](_0x401e64['shift']());}};_0x31a5f7(++_0x5bf90a);}(_0x42db,0x88));var _0xb42d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x42db[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb42d('0x0'));var zipdir=require(_0xb42d('0x1'));var moment=require(_0xb42d('0x2'));var BPromise=require('bluebird');var util=require(_0xb42d('0x3'));var path=require(_0xb42d('0x4'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb42d('0x5'));var juice=require(_0xb42d('0x6'));var Redis=require(_0xb42d('0x7'));var qs=require('../../components/parsers/qs');var as=require(_0xb42d('0x8'));var logger=require('../../config/logger')(_0xb42d('0x9'));var config=require(_0xb42d('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xb42d('0xb')](config['redis'],{'host':_0xb42d('0xc'),'port':0x18eb});var socket=require(_0xb42d('0xd'))(new Redis(config['redis']));require(_0xb42d('0xe'))[_0xb42d('0xf')](socket);function respondWithStatusCode(_0x4008e9,_0x5f4fa3){_0x5f4fa3=_0x5f4fa3||0xcc;return function(_0x508625){if(_0x508625){return _0x4008e9[_0xb42d('0x10')](_0x5f4fa3);}return _0x4008e9[_0xb42d('0x11')](_0x5f4fa3)[_0xb42d('0x12')]();};}function respondWithResult(_0xb50d7,_0x338310){_0x338310=_0x338310||0xc8;return function(_0x224815){if(_0x224815){return _0xb50d7[_0xb42d('0x11')](_0x338310)[_0xb42d('0x13')](_0x224815);}};}function respondWithFilteredResult(_0x4cf9fe,_0x422349){return function(_0x18eb56){if(_0x18eb56){var _0x3de172=typeof _0x422349[_0xb42d('0x14')]==='undefined'&&typeof _0x422349['limit']===_0xb42d('0x15');var _0x173222=_0x18eb56['count'];var _0x70439e=_0x3de172?0x0:_0x422349[_0xb42d('0x14')];var _0x46ab5d=_0x3de172?_0x18eb56['count']:_0x422349['offset']+_0x422349[_0xb42d('0x16')];var _0x4252bd;if(_0x46ab5d>=_0x173222){_0x46ab5d=_0x173222;_0x4252bd=0xc8;}else{_0x4252bd=0xce;}_0x4cf9fe[_0xb42d('0x11')](_0x4252bd);return _0x4cf9fe['set'](_0xb42d('0x17'),_0x70439e+'-'+_0x46ab5d+'/'+_0x173222)[_0xb42d('0x13')](_0x18eb56);}return null;};}function saveUpdates(_0x536730){return function(_0x20f210){if(_0x20f210){return _0x20f210[_0xb42d('0x18')](_0x536730)[_0xb42d('0x19')](function(_0x4d437b){return _0x4d437b;});}return null;};}function removeEntity(_0x4cc21b){return function(_0x51e25b){if(_0x51e25b){return _0x51e25b['destroy']()['then'](function(){_0x4cc21b[_0xb42d('0x11')](0xcc)[_0xb42d('0x12')]();});}};}function handleEntityNotFound(_0x4806e3){return function(_0x136d64){if(!_0x136d64){_0x4806e3[_0xb42d('0x10')](0x194);}return _0x136d64;};}function handleError(_0x5620c9,_0x2fde60){_0x2fde60=_0x2fde60||0x1f4;return function(_0x266880){logger['error'](_0x266880['stack']);if(_0x266880['name']){delete _0x266880[_0xb42d('0x1a')];}_0x5620c9[_0xb42d('0x11')](_0x2fde60)[_0xb42d('0x1b')](_0x266880);};}function getInteractionUsers(_0x3460ce,_0x45ab91){return new BPromise(function(_0x11185d,_0x23d38e){try{if(_0x45ab91[_0x3460ce['id']]){_0x3460ce['Users']=_[_0xb42d('0x1c')](_0x45ab91[_0x3460ce['id']],function(_0x36c17c){return{'id':_0x36c17c['id'],'fullname':_0x36c17c[_0xb42d('0x1d')]};});}}catch(_0x1e7254){_0x23d38e(_0x1e7254);}_0x11185d(_0x3460ce);});}function getInteractionTags(_0x13d458,_0x443b63){return new BPromise(function(_0x5b88af,_0x3803a8){try{if(_0x13d458[_0xb42d('0x1e')]){_0x13d458[_0xb42d('0x1f')]=[];_0x13d458[_0xb42d('0x1e')][_0xb42d('0x20')](',')[_0xb42d('0x21')](function(_0x267380){_0x13d458['Tags'][_0xb42d('0x22')](_0x443b63[_0x267380]);});}delete _0x13d458[_0xb42d('0x1e')];}catch(_0x5a332c){_0x3803a8(_0x5a332c);}_0x5b88af(_0x13d458);});}function getLastMessageText(_0x6eee98){return new BPromise(function(_0x378b68,_0x25f0aa){return db[_0xb42d('0x23')][_0xb42d('0x24')]({'where':{'$and':[{'MailInteractionId':_0x6eee98['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb42d('0x25')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb42d('0x26')],'order':_0xb42d('0x27'),'raw':!![]})[_0xb42d('0x19')](function(_0x274c1f){if(_0x274c1f&&_0x274c1f[_0xb42d('0x26')]){_0x6eee98[_0xb42d('0x28')]=_[_0xb42d('0x29')](_0x274c1f[_0xb42d('0x26')]);}_0x378b68(_0x6eee98);})[_0xb42d('0x2a')](function(_0x5fc085){_0x25f0aa(_0x5fc085);});});}function updateMailInteraction(_0x182b75,_0x34df4,_0x559029,_0x272ce8){return new BPromise(function(_0x2e52a3,_0x3e62eb){return getInteractionUsers(_0x182b75,_0x559029)[_0xb42d('0x19')](function(_0x37b04d){return getInteractionTags(_0x37b04d,_0x34df4);})['then'](function(_0x3ccf53){if(_0x272ce8){_0x2e52a3(getLastMessageText(_0x3ccf53));}else{_0x2e52a3(_0x3ccf53);}})[_0xb42d('0x2a')](function(_0x530597){_0x3e62eb(_0x530597);});});}exports[_0xb42d('0x2b')]=function(_0x3d1cc6,_0x2b9962){var _0x3d280e={},_0xd23970={},_0x457741={'count':0x0,'rows':[]};var _0x435676=_['map'](db[_0xb42d('0x2c')][_0xb42d('0x2d')],function(_0x40a503){return{'name':_0x40a503[_0xb42d('0x2e')],'type':_0x40a503['type']['key']};});_0xd23970[_0xb42d('0x2f')]=_[_0xb42d('0x1c')](_0x435676,'name');_0xd23970[_0xb42d('0x30')]=_[_0xb42d('0x31')](_0x3d1cc6[_0xb42d('0x30')]);_0xd23970['filters']=_['intersection'](_0xd23970[_0xb42d('0x2f')],_0xd23970[_0xb42d('0x30')]);_0x3d280e[_0xb42d('0x32')]=_[_0xb42d('0x33')](_0xd23970['model'],qs['fields'](_0x3d1cc6['query'][_0xb42d('0x34')]));_0x3d280e['attributes']=_0x3d280e[_0xb42d('0x32')]['length']?_0x3d280e['attributes']:_0xd23970['model'];if(!_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x35')](_0xb42d('0x36'))){_0x3d280e[_0xb42d('0x16')]=qs[_0xb42d('0x16')](_0x3d1cc6[_0xb42d('0x30')]['limit']);_0x3d280e[_0xb42d('0x14')]=qs[_0xb42d('0x14')](_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x14')]);}_0x3d280e['order']=qs[_0xb42d('0x37')](_0x3d1cc6[_0xb42d('0x30')]['sort']);_0x3d280e[_0xb42d('0x38')]=qs['filters'](_[_0xb42d('0x39')](_0x3d1cc6[_0xb42d('0x30')],_0xd23970['filters']),_0x435676);var _0x1bbbd3=[];var _0x3fa743=squel['select']()['field']('id')['field'](_0xb42d('0x1a'))[_0xb42d('0x3a')](_0xb42d('0x3b'))[_0xb42d('0x3c')]('tools_tags');var _0x1e1b65=squel[_0xb42d('0x3d')]()[_0xb42d('0x3a')](_0xb42d('0x3e'))['field'](_0xb42d('0x3f'))[_0xb42d('0x3a')](_0xb42d('0x40'))[_0xb42d('0x3c')]('user_has_mail_interactions','ui')[_0xb42d('0x41')](_0xb42d('0x42'),'u',_0xb42d('0x43'));var _0x78811f=squel[_0xb42d('0x3d')]()[_0xb42d('0x3c')]('mail_interactions','i')[_0xb42d('0x41')]('cm_contacts','c',_0xb42d('0x44'))['left_join'](_0xb42d('0x42'),'o',_0xb42d('0x45'))[_0xb42d('0x41')](_0xb42d('0x46'),'a',_0xb42d('0x47'))[_0xb42d('0x41')](_0xb42d('0x48'),'me','me.MailInteractionId\x20=\x20i.id')['left_join']('mail_interaction_has_tags','it',_0xb42d('0x49'))[_0xb42d('0x41')](_0xb42d('0x4a'),'t',_0xb42d('0x4b'));var _0x19d9d1=squel[_0xb42d('0x4c')]();var _0x3d526a=[];var _0x116b86=squel['expr']();var _0x3f2694;if(_0x3d1cc6['query']['search']){_0x3f2694=as[_0xb42d('0x4d')](_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x4e')]);var _0x1a64e6=_0x3f2694['sqlOperator'];for(var _0x5f3440=0x0;_0x5f3440<_0x3f2694[_0xb42d('0x4f')]['length'];_0x5f3440++){var _0x3da68a=_0x3f2694[_0xb42d('0x4f')][_0x5f3440];var _0x329ccf='i';var _0x22dea1=_[_0xb42d('0x50')](_0x435676,[_0xb42d('0x1a'),_0x3da68a[_0xb42d('0x3a')]]);if(!_0x22dea1){switch(_0x3da68a['field']){case _0xb42d('0x51'):if(_0x3da68a[_0xb42d('0x52')]==0x1){_0x78811f[_0xb42d('0x53')]('`'+_0x3da68a[_0xb42d('0x3a')]+_0xb42d('0x54'));}else{_0x78811f['having']('`'+_0x3da68a[_0xb42d('0x3a')]+_0xb42d('0x55'));}break;case _0xb42d('0x56'):if(_0x3da68a[_0xb42d('0x57')]===_0xb42d('0x58')){if(_0x3da68a[_0xb42d('0x52')][_0xb42d('0x20')]('\x20')[_0xb42d('0x59')]>0x1){_0x19d9d1[_0x1a64e6](_0xb42d('0x5a'),qs[_0xb42d('0x5b')](_0x3da68a['value']),null);}else{var _0xeb6be='%'+_0x3da68a[_0xb42d('0x52')]+'%';_0x19d9d1[_0x1a64e6](_0xb42d('0x5c'),_0xeb6be,_0xeb6be,_0xeb6be);}}else{_0x22dea1=_['find'](_0x435676,[_0xb42d('0x1a'),_0xb42d('0x5d')]);_0x3da68a['field']=_0xb42d('0x5d');_0x54d39b=as[_0xb42d('0x5e')](_0x329ccf,_0x22dea1[_0xb42d('0x5f')],_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b[_0xb42d('0x60')],_0x54d39b[_0xb42d('0x52')]['start'],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x12')]);}break;case _0xb42d('0x61'):var _0x3b3846=_0x3da68a[_0xb42d('0x52')][_0xb42d('0x20')](',')[_0xb42d('0x1c')](function(_0x4f70e4){return Number(_0x4f70e4);});_0x3b3846['forEach'](function(_0x22d9b6){_0x116b86['or'](_0xb42d('0x62'),'%,'+_0x22d9b6+',%');});_0x3d526a=_['union'](_0x3d526a,_0x3b3846);break;case _0xb42d('0x63'):if(_0x3da68a[_0xb42d('0x57')]===_0xb42d('0x58')){_0x19d9d1[_0x1a64e6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3da68a[_0xb42d('0x52')]+'%',null);}else{_0x22dea1=_[_0xb42d('0x50')](_0x435676,['name',_0xb42d('0x64')]);_0x3da68a['field']='UserId';_0x54d39b=as[_0xb42d('0x5e')](_0x329ccf,_0x22dea1[_0xb42d('0x5f')],_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b[_0xb42d('0x60')],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x65')],_0x54d39b[_0xb42d('0x52')]['end']);}break;case _0xb42d('0x26'):_0x54d39b=as[_0xb42d('0x5e')]('me',null,_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b['text'],_0x54d39b[_0xb42d('0x52')]['start'],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x12')]);break;}}else{var _0x54d39b=as[_0xb42d('0x5e')](_0x329ccf,_0x22dea1['type'],_0x3da68a);_0x19d9d1[_0x1a64e6](_0x54d39b[_0xb42d('0x60')],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x65')],_0x54d39b[_0xb42d('0x52')][_0xb42d('0x12')]);}}}else{var _0x14a400=_(_0x3d1cc6['query'])[_0xb42d('0x31')]()[_0xb42d('0x1c')](function(_0x45a622){return _[_0xb42d('0x66')](_0x435676,[_0xb42d('0x1a'),_0x45a622])?_0x45a622:undefined;})[_0xb42d('0x67')]()['value']();if(!_[_0xb42d('0x68')](_0x14a400)){_0x14a400[_0xb42d('0x21')](function(_0x3d11da){if(_0x3d11da===_0xb42d('0x69')){_0x78811f[_0xb42d('0x38')](_0xb42d('0x6a'),[][_0xb42d('0x6b')](_0x3d1cc6[_0xb42d('0x30')][_0x3d11da]));}else if(_0x3d11da===_0xb42d('0x6c')){var _0x5e5f02=JSON[_0xb42d('0x6d')](_0x3d1cc6['query'][_0x3d11da])[_0xb42d('0x6e')];var _0x2bfb8a=JSON[_0xb42d('0x6d')](_0x3d1cc6[_0xb42d('0x30')][_0x3d11da])[_0xb42d('0x6f')];_0x78811f['where'](_0xb42d('0x70'),_0x5e5f02,_0x2bfb8a);}else{if(_0x3d1cc6[_0xb42d('0x30')][_0x3d11da]===_0xb42d('0x71')){_0x78811f['where']('i.'+_0x3d11da+_0xb42d('0x72'));}else{_0x78811f[_0xb42d('0x38')]('i.'+_0x3d11da+_0xb42d('0x73'),_0x3d1cc6[_0xb42d('0x30')][_0x3d11da]);}}});}if(_0x3d1cc6[_0xb42d('0x30')]['read']){if(_0x3d1cc6['query']['read']==0x1){_0x78811f[_0xb42d('0x53')]('`unreadMessages`\x20=\x200');}else{_0x78811f['having'](_0xb42d('0x74'));}}if(_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')]){_0x3d526a=_[_0xb42d('0x76')](_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')])?_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')]:new Array(_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x75')]);_0x3d526a[_0xb42d('0x21')](function(_0x29426a){_0x116b86['or'](_0xb42d('0x62'),'%,'+_0x29426a+',%');});}if(_0x3d1cc6['query'][_0xb42d('0x77')]){var _0x1c0fb9=_0x3d1cc6['query']['filter']['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1c0fb9)){_0x19d9d1['or'](_0xb42d('0x78'),_0x1c0fb9+'%');}else if(qs[_0xb42d('0x79')](_0x1c0fb9)){_0x19d9d1['or'](_0xb42d('0x7a'),_0x1c0fb9+'%');}else{_0x19d9d1['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb42d('0x5b')](_0x1c0fb9))['or'](_0xb42d('0x7b'),qs[_0xb42d('0x5b')](_0x1c0fb9));}}}_0x78811f[_0xb42d('0x38')](_0x19d9d1);_0x78811f['group'](_0xb42d('0x7c'));var _0x593884={'type':db[_0xb42d('0x7d')][_0xb42d('0x7e')][_0xb42d('0x7f')],'raw':!![]};var _0x3996b0=_0x78811f['clone']();_0x3996b0['field'](_0xb42d('0x7c'));_0x3996b0[_0xb42d('0x3a')](_0xb42d('0x80'),'unreadMessages');if(_0x3d280e[_0xb42d('0x81')]){_0x3d280e['order'][_0xb42d('0x21')](function(_0x2ae92d){var _0x45936a=_0x2ae92d[0x0]===_0xb42d('0x82')?_0x2ae92d[0x0]:'i.'+_0x2ae92d[0x0];_0x78811f[_0xb42d('0x81')](_0x45936a,_0x2ae92d[0x1]===_0xb42d('0x83')?![]:!![]);});}if(!_[_0xb42d('0x68')](_0x3d526a)){_0x78811f[_0xb42d('0x53')](_0x116b86);_0x3996b0[_0xb42d('0x38')](_0xb42d('0x84'),_0x3d526a);}BPromise[_0xb42d('0x85')]()[_0xb42d('0x19')](function(){if(!_0x3f2694){if(_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x69')])return;_0x3996b0[_0xb42d('0x38')](_0xb42d('0x86'));_0x78811f[_0xb42d('0x38')](_0xb42d('0x86'));return;}if(_0x3d1cc6[_0xb42d('0x87')][_0xb42d('0x88')]!==_0xb42d('0x89'))return;return _0x3d1cc6[_0xb42d('0x87')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0xb42d('0x19')](function(_0x21248f){if(_[_0xb42d('0x68')](_0x21248f)){_0x3996b0[_0xb42d('0x38')](_0xb42d('0x8a'));_0x78811f[_0xb42d('0x38')](_0xb42d('0x8a'));}else{_0x3996b0[_0xb42d('0x38')](_0xb42d('0x6a'),_[_0xb42d('0x1c')](_0x21248f,'id'));_0x78811f[_0xb42d('0x38')]('i.MailAccountId\x20IN\x20?',_['map'](_0x21248f,'id'));}});})['then'](function(){if(_0x3d1cc6[_0xb42d('0x87')][_0xb42d('0x88')]==='agent'&&!_0x3f2694&&!_0x3d1cc6[_0xb42d('0x30')][_0xb42d('0x69')])return[];return db[_0xb42d('0x8b')]['query'](_0x3996b0[_0xb42d('0x8c')](),_0x593884);})['then'](function(_0x2b64c7){_0x457741[_0xb42d('0x8d')]=_0x2b64c7[_0xb42d('0x59')];if(_0x457741[_0xb42d('0x8d')]===0x0)return[];return db[_0xb42d('0x8b')][_0xb42d('0x30')](_0x3fa743[_0xb42d('0x8c')](),_0x593884)[_0xb42d('0x19')](function(_0x290b6a){_0x1bbbd3=_['keyBy'](_0x290b6a,'id');_0x593884=_[_0xb42d('0x8e')](_0x593884,{'model':db[_0xb42d('0x2c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d1cc6[_0xb42d('0x30')]['fields']){_0x3d280e[_0xb42d('0x32')]['forEach'](function(_0x120aea){_0x78811f[_0xb42d('0x3a')]('i.'+_0x120aea);});}else{_0x78811f[_0xb42d('0x3a')](_0xb42d('0x80'),'unreadMessages');_0x78811f[_0xb42d('0x3a')]('a.key',_0xb42d('0x8f'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x90'),'Account.mandatoryDisposition');_0x78811f[_0xb42d('0x3a')]('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');_0x78811f['field']('i.id');_0x78811f[_0xb42d('0x3a')]('i.createdAt');_0x78811f[_0xb42d('0x3a')](_0xb42d('0x91'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x92'));_0x78811f['field'](_0xb42d('0x93'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x94'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x95'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x96'));_0x78811f['field'](_0xb42d('0x97'));_0x78811f[_0xb42d('0x3a')]('i.disposition');_0x78811f[_0xb42d('0x3a')](_0xb42d('0x98'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x99'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9a'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9b'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9c'));_0x78811f[_0xb42d('0x3a')]('i.MailAccountId');_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9d'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0x9e'),_0xb42d('0x9f'));_0x78811f[_0xb42d('0x3a')]('c.lastName',_0xb42d('0xa0'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa1'),_0xb42d('0xa2'));_0x78811f['field'](_0xb42d('0xa3'),_0xb42d('0xa4'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa5'),_0xb42d('0xa6'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa7'),_0xb42d('0xa8'));_0x78811f[_0xb42d('0x3a')](_0xb42d('0xa9'),_0xb42d('0xaa'));_0x78811f[_0xb42d('0x3a')]('o.internal',_0xb42d('0xab'));_0x78811f['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb42d('0x1e'));}if(_0x3d280e[_0xb42d('0x16')])_0x78811f[_0xb42d('0x16')](_0x3d280e[_0xb42d('0x16')]);if(_0x3d280e[_0xb42d('0x14')])_0x78811f[_0xb42d('0x14')](_0x3d280e[_0xb42d('0x14')]);return db[_0xb42d('0x8b')][_0xb42d('0x30')](_0x78811f[_0xb42d('0x8c')](),_0x593884);})['then'](function(_0x363279){if(_0x363279['length']>0x0)_0x1e1b65[_0xb42d('0x38')](_0xb42d('0xac'),_[_0xb42d('0x1c')](_0x363279,'id'));return db[_0xb42d('0x8b')][_0xb42d('0x30')](_0x1e1b65[_0xb42d('0x8c')](),_0x593884)[_0xb42d('0x19')](function(_0x322cd5){var _0x113798=_[_0xb42d('0xad')](_0x322cd5,_0xb42d('0xae'));var _0x49aac7=[];return db[_0xb42d('0xaf')][_0xb42d('0x24')]({'attributes':[_0xb42d('0xb0')],'raw':!![]})[_0xb42d('0x19')](function(_0x1ed2ef){var _0x5dfdba=_0x1ed2ef['enableEmailPreview'];_0x363279[_0xb42d('0x21')](function(_0x2ff488){_0x49aac7[_0xb42d('0x22')](updateMailInteraction(_0x2ff488,_0x1bbbd3,_0x113798,_0x5dfdba));});return BPromise[_0xb42d('0xb1')](_0x49aac7);});});});})[_0xb42d('0x19')](function(_0x3c0b06){_0x457741[_0xb42d('0xb2')]=_0x3c0b06;return _0x457741;})['then'](respondWithFilteredResult(_0x2b9962,_0x3d280e))[_0xb42d('0x2a')](handleError(_0x2b9962,null));};exports[_0xb42d('0xb3')]=function(_0x3c1c52,_0x4e6ba1){var _0xce5c82={'raw':![],'where':{'id':_0x3c1c52['params']['id']}},_0x3dc75c={};_0x3dc75c[_0xb42d('0x2f')]=_['keys'](db[_0xb42d('0x2c')]['rawAttributes']);_0x3dc75c[_0xb42d('0x30')]=_[_0xb42d('0x31')](_0x3c1c52[_0xb42d('0x30')]);_0x3dc75c[_0xb42d('0xb4')]=_[_0xb42d('0x33')](_0x3dc75c[_0xb42d('0x2f')],_0x3dc75c[_0xb42d('0x30')]);_0xce5c82['attributes']=_[_0xb42d('0x33')](_0x3dc75c[_0xb42d('0x2f')],qs['fields'](_0x3c1c52[_0xb42d('0x30')][_0xb42d('0x34')]));_0xce5c82[_0xb42d('0x32')]=_0xce5c82['attributes'][_0xb42d('0x59')]?_0xce5c82[_0xb42d('0x32')]:_0x3dc75c[_0xb42d('0x2f')];if(_0x3c1c52[_0xb42d('0x30')]['includeAll']){_0xce5c82['include']=[{'all':!![]}];}_0xce5c82=_['merge']({},_0xce5c82,_0x3c1c52[_0xb42d('0xb5')]);return db['MailInteraction'][_0xb42d('0x50')](_0xce5c82)[_0xb42d('0x19')](handleEntityNotFound(_0x4e6ba1,null))[_0xb42d('0x19')](respondWithResult(_0x4e6ba1,null))[_0xb42d('0x2a')](handleError(_0x4e6ba1,null));};exports[_0xb42d('0xb6')]=function(_0x5e1f76,_0x222900){return db[_0xb42d('0x2c')][_0xb42d('0xb6')](_0x5e1f76['body'],{})[_0xb42d('0x19')](respondWithResult(_0x222900,0xc9))[_0xb42d('0x2a')](handleError(_0x222900,null));};exports['update']=function(_0x3a2d32,_0x512d9f){if(_0x3a2d32[_0xb42d('0xb7')]['id']){delete _0x3a2d32[_0xb42d('0xb7')]['id'];}return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x3a2d32[_0xb42d('0xb8')]['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x512d9f,null))[_0xb42d('0x19')](saveUpdates(_0x3a2d32[_0xb42d('0xb7')],null))['then'](respondWithResult(_0x512d9f,null))[_0xb42d('0x2a')](handleError(_0x512d9f,null));};exports[_0xb42d('0xb9')]=function(_0x1493fe,_0x24b2c7){return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x1493fe[_0xb42d('0xb8')]['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x24b2c7,null))[_0xb42d('0x19')](removeEntity(_0x24b2c7,null))['catch'](handleError(_0x24b2c7,null));};exports[_0xb42d('0xba')]=function(_0x4d29d7,_0x224b39){return db[_0xb42d('0x2c')][_0xb42d('0xba')]()[_0xb42d('0x19')](respondWithResult(_0x224b39,null))[_0xb42d('0x2a')](handleError(_0x224b39,null));};exports[_0xb42d('0xbb')]=function(_0x3a2fae,_0x2daefb){return db['MailMessage'][_0xb42d('0x50')]({'where':{'id':_0x3a2fae['params']['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x2daefb,null))[_0xb42d('0x19')](function(_0x128687){if(_0x128687){return _0x128687[_0xb42d('0xbb')](_0x3a2fae[_0xb42d('0xb7')][_0xb42d('0xbc')],_['omit'](_0x3a2fae[_0xb42d('0xb7')],[_0xb42d('0xbc'),'id'])||{});}})['then'](respondWithResult(_0x2daefb,null))['catch'](handleError(_0x2daefb,null));};exports['getMessages']=function(_0x1c8a04,_0x45fa49){var _0x16cb1c={'raw':![],'where':{}};var _0x15d0d7={};var _0x8a0c27={'count':0x0,'rows':[]};return db[_0xb42d('0x2c')]['findOne']({'where':{'id':_0x1c8a04[_0xb42d('0xb8')]['id']}})['then'](handleEntityNotFound(_0x45fa49,null))[_0xb42d('0x19')](function(_0xc3a62){if(_0xc3a62){_0x15d0d7[_0xb42d('0x2f')]=_['keys'](db[_0xb42d('0x23')][_0xb42d('0x2d')]);_0x15d0d7['query']=_[_0xb42d('0x31')](_0x1c8a04[_0xb42d('0x30')]);_0x15d0d7[_0xb42d('0xb4')]=_[_0xb42d('0x33')](_0x15d0d7[_0xb42d('0x2f')],_0x15d0d7[_0xb42d('0x30')]);_0x16cb1c[_0xb42d('0x32')]=_[_0xb42d('0x33')](_0x15d0d7[_0xb42d('0x2f')],qs['fields'](_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x34')]));_0x16cb1c[_0xb42d('0x32')]=_0x16cb1c[_0xb42d('0x32')][_0xb42d('0x59')]?_0x16cb1c[_0xb42d('0x32')]:_0x15d0d7[_0xb42d('0x2f')];if(!_0x1c8a04[_0xb42d('0x30')]['hasOwnProperty']('nolimit')){_0x16cb1c[_0xb42d('0x16')]=qs[_0xb42d('0x16')](_0x1c8a04[_0xb42d('0x30')]['limit']);_0x16cb1c[_0xb42d('0x14')]=qs[_0xb42d('0x14')](_0x1c8a04[_0xb42d('0x30')]['offset']);}_0x16cb1c[_0xb42d('0x81')]=qs[_0xb42d('0x37')](_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x37')]);_0x16cb1c['where']=qs[_0xb42d('0xb4')](_[_0xb42d('0x39')](_0x1c8a04[_0xb42d('0x30')],_0x15d0d7[_0xb42d('0xb4')]));_0x16cb1c[_0xb42d('0x38')]['MailInteractionId']=_0xc3a62['id'];if(_0x1c8a04['query'][_0xb42d('0x77')]){_0x16cb1c[_0xb42d('0x38')]=_['merge'](_0x16cb1c[_0xb42d('0x38')],{'$or':_[_0xb42d('0x1c')](_0x16cb1c['attributes'],function(_0x21fb3f){var _0x23fc0b={};_0x23fc0b[_0x21fb3f]={'$like':'%'+_0x1c8a04[_0xb42d('0x30')]['filter']+'%'};return _0x23fc0b;})});}if(_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x6e')]){var _0x11318c=_0x1c8a04[_0xb42d('0x30')][_0xb42d('0x6e')][_0xb42d('0x20')](',');var _0x5a7e47={};_0x5a7e47[_0x11318c[0x0]]={'$gte':moment(_0x11318c[0x1])[_0xb42d('0xbd')](_0xb42d('0xbe'))};_0x16cb1c[_0xb42d('0x38')]=_[_0xb42d('0x8e')](_0x16cb1c[_0xb42d('0x38')],_0x5a7e47);}_0x16cb1c=_['merge']({},_0x16cb1c,_0x1c8a04[_0xb42d('0xb5')]);return db['MailMessage']['count']({'where':_0x16cb1c['where']})[_0xb42d('0x19')](function(_0x1f9104){_0x8a0c27[_0xb42d('0x8d')]=_0x1f9104;if(_0x1c8a04[_0xb42d('0x30')][_0xb42d('0xbf')]){_0x16cb1c[_0xb42d('0xc0')]=[{'all':!![]}];}return db[_0xb42d('0x23')][_0xb42d('0xc1')](_0x16cb1c);})[_0xb42d('0x19')](function(_0x854519){if(_0x1c8a04[_0xb42d('0x30')]['inlineCss']===_0xb42d('0xc2')){for(var _0x292a29=0x0;_0x292a29<_0x854519[_0xb42d('0x59')];_0x292a29++){_0x854519[_0x292a29][_0xb42d('0xb7')]=juice(_0x854519[_0x292a29]['body']);}}_0x8a0c27['rows']=_0x854519;return _0x8a0c27;});}})['then'](respondWithFilteredResult(_0x45fa49,_0x16cb1c))[_0xb42d('0x2a')](handleError(_0x45fa49,null));};exports[_0xb42d('0xc3')]=function(_0x363049,_0x4cce3d){return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x363049['params']['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x4cce3d,null))[_0xb42d('0x19')](function(_0x680b73){if(_0x680b73){return _0x680b73[_0xb42d('0xc4')](_0x363049[_0xb42d('0xb7')]['ids'],_[_0xb42d('0xc5')](_0x363049[_0xb42d('0xb7')],[_0xb42d('0xbc'),'id'])||{})[_0xb42d('0xc6')](function(){return db[_0xb42d('0x61')]['findAll']({'attributes':['id',_0xb42d('0x1a'),_0xb42d('0x3b')],'where':{'id':_0x363049[_0xb42d('0xb7')][_0xb42d('0xbc')]}});})['then'](function(_0x109966){socket[_0xb42d('0xc7')](_0xb42d('0xc8'),{'id':Number(_0x363049[_0xb42d('0xb8')]['id']),'tags':_0x109966||[]});return{'id':Number(_0x363049['params']['id']),'tags':_0x109966||[]};});}})[_0xb42d('0x19')](respondWithResult(_0x4cce3d,null))[_0xb42d('0x2a')](handleError(_0x4cce3d,null));};exports[_0xb42d('0xc9')]=function(_0x3690bf,_0x23c24d){return db[_0xb42d('0x2c')][_0xb42d('0x50')]({'where':{'id':_0x3690bf['params']['id']}})[_0xb42d('0x19')](handleEntityNotFound(_0x23c24d,null))[_0xb42d('0x19')](function(_0x213a15){if(_0x213a15){return _0x213a15[_0xb42d('0xc9')](_0x3690bf[_0xb42d('0x30')][_0xb42d('0xbc')]);}})[_0xb42d('0x19')](respondWithStatusCode(_0x23c24d,null))[_0xb42d('0x2a')](handleError(_0x23c24d,null));};exports[_0xb42d('0xca')]=function(_0x5c08b6,_0x402239){var _0x41ecec=moment()['unix']()[_0xb42d('0x8c')]();var _0xc9df2c=path[_0xb42d('0xcb')](config['root'],_0xb42d('0xcc'),_0xb42d('0xcd'),_0xb42d('0xce'));var _0x754434=path[_0xb42d('0xcb')](config[_0xb42d('0xcf')],'server','files',_0xb42d('0xd0'));var _0x3c54b9=path[_0xb42d('0xcb')](_0xc9df2c,_0x41ecec);var _0x1af614=util['format'](_0xb42d('0xd1'),_0x5c08b6[_0xb42d('0xb8')]['id'],_0x41ecec);var _0x32a172=path['join'](_0xc9df2c,_0x1af614);var _0x597fd1=[];if(_0x5c08b6['query']['attachments']){_0x597fd1[_0xb42d('0x22')]({'model':db['Attachment'],'as':_0xb42d('0xd2'),'raw':!![]});}var _0x159589=[{'model':db[_0xb42d('0x23')],'as':_0xb42d('0xd3'),'attributes':['id',_0xb42d('0xb7'),_0xb42d('0x3c'),'to','cc',_0xb42d('0xd4'),_0xb42d('0xd5'),'createdAt'],'where':{'secret':![]},'order':qs[_0xb42d('0x37')]('id'),'include':_0x597fd1}];return db['MailInteraction'][_0xb42d('0x50')]({'where':{'id':_0x5c08b6['params']['id']},'include':_0x159589})[_0xb42d('0x19')](handleEntityNotFound(_0x402239,null))['then'](function(_0x229615){if(_0x229615&&_0x229615[_0xb42d('0xd3')]){var _0x462fa8=_0x229615['get']({'plain':!![]});fs[_0xb42d('0xd6')](_0x3c54b9);return BPromise['each'](_0x462fa8[_0xb42d('0xd3')],function(_0x8b326,_0xefd46f){var _0x2f4935={'from':_0x8b326['from'],'to':_0x8b326['to'],'subject':_0x8b326[_0xb42d('0xd5')],'html':htmlEntities[_0xb42d('0xd7')](_0x8b326['body']),'headers':{'Date':moment(_0x8b326[_0xb42d('0x6c')])['format'](_0xb42d('0xd8'))},'attachments':[]};if(_0x8b326['cc']){_0x2f4935[_0xb42d('0xd9')]['Cc']=_0x8b326['cc'];}if(_0x8b326['bcc']){_0x2f4935['headers'][_0xb42d('0xda')]=_0x8b326[_0xb42d('0xd4')];}return new BPromise(function(_0x398942,_0x18e6e0){if(_0x8b326[_0xb42d('0xd2')]){for(var _0x55a0e1=0x0;_0x55a0e1<_0x8b326[_0xb42d('0xd2')][_0xb42d('0x59')];_0x55a0e1++){var _0x552783=_0x8b326[_0xb42d('0xd2')][_0x55a0e1];var _0x240587=path[_0xb42d('0xcb')](_0x754434,_0x552783[_0xb42d('0xdb')]);if(fs[_0xb42d('0xdc')](_0x240587)){_0x2f4935[_0xb42d('0xd0')]['push']({'name':_0x552783['name'],'contentType':_0x552783[_0xb42d('0x5f')],'data':fs[_0xb42d('0xdd')](_0x240587)});}}}emlformat[_0xb42d('0xde')](_0x2f4935,function(_0x17f27a,_0x12c8c9){if(_0x17f27a)return _0x18e6e0(_0x17f27a);fs[_0xb42d('0xdf')](path['join'](_0x3c54b9,util['format'](_0xb42d('0xe0'),_0xefd46f)),_0x12c8c9);return _0x398942(_0x12c8c9);});});})[_0xb42d('0x19')](function(){return new BPromise(function(_0x2e5b48,_0x3a75d2){zipdir(_0x3c54b9,{'saveTo':_0x32a172},function(_0xb491e9,_0x41f895){if(_0xb491e9)return _0x3a75d2(_0xb491e9);return _0x2e5b48(_0x41f895);});})[_0xb42d('0x19')](function(){return new BPromise(function(_0x124ee2,_0x2741e4){rimraf(_0x3c54b9,function(_0x3a0118){if(_0x3a0118)_0x2741e4(_0x3a0118);return _0x124ee2();});});})[_0xb42d('0x19')](function(){return _0x402239[_0xb42d('0xca')](_0x32a172,_0x1af614,function(_0x18d3c8){if(!_0x18d3c8)fs[_0xb42d('0xe1')](_0x32a172);});});});}else{return _0x402239[_0xb42d('0x10')](0xc8);}})[_0xb42d('0x2a')](handleError(_0x402239,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 692ea9e..62a4577 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 _0x0e04=['unreadMessages','emit','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','getUsers','then','setDataValue'];(function(_0x343bac,_0x3d81fb){var _0x4435bf=function(_0x35620d){while(--_0x35620d){_0x343bac['push'](_0x343bac['shift']());}};_0x4435bf(++_0x3d81fb);}(_0x0e04,0x1f4));var _0x40e0=function(_0x4afad7,_0x260925){_0x4afad7=_0x4afad7-0x0;var _0x2fe38f=_0x0e04[_0x4afad7];return _0x2fe38f;};'use strict';var EventEmitter=require(_0x40e0('0x0'));var MailInteraction=require(_0x40e0('0x1'))['db'][_0x40e0('0x2')];var MailMessage=require(_0x40e0('0x1'))['db'][_0x40e0('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x40e0('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x40e0('0x5'),'afterDestroy':_0x40e0('0x6')};function emitEvent(_0x1b8a09){return function(_0x489d60,_0x11517b,_0x585a0f){_0x489d60[_0x40e0('0x7')]({'attributes':['id'],'raw':!![]})[_0x40e0('0x8')](function(_0x44bf16){_0x489d60[_0x40e0('0x9')]('Users',_0x44bf16['map'](function(_0x2d4e39){return{'id':_0x2d4e39['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x489d60['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x394dad){_0x489d60['setDataValue'](_0x40e0('0xa'),_0x394dad['length']);MailInteractionEvents[_0x40e0('0xb')](_0x1b8a09+':'+_0x489d60['id'],_0x489d60);MailInteractionEvents[_0x40e0('0xb')](_0x1b8a09,_0x489d60);_0x585a0f(null);})[_0x40e0('0xc')](_0x585a0f(null));};}for(var e in events){if(events[_0x40e0('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x40e0('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x22b3=['MailMessage','setMaxListeners','save','remove','then','Users','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','events','../../mysqldb','MailInteraction'];(function(_0x44aa85,_0x49d95e){var _0x9447e1=function(_0x7e0959){while(--_0x7e0959){_0x44aa85['push'](_0x44aa85['shift']());}};_0x9447e1(++_0x49d95e);}(_0x22b3,0x1cd));var _0x322b=function(_0x2c69c2,_0x1c0226){_0x2c69c2=_0x2c69c2-0x0;var _0x189018=_0x22b3[_0x2c69c2];return _0x189018;};'use strict';var EventEmitter=require(_0x322b('0x0'));var MailInteraction=require(_0x322b('0x1'))['db'][_0x322b('0x2')];var MailMessage=require(_0x322b('0x1'))['db'][_0x322b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x322b('0x4')](0x0);var events={'afterCreate':_0x322b('0x5'),'afterUpdate':'update','afterDestroy':_0x322b('0x6')};function emitEvent(_0x56d261){return function(_0x324eb9,_0xe00e0f,_0x375132){_0x324eb9['getUsers']({'attributes':['id'],'raw':!![]})[_0x322b('0x7')](function(_0xa6cabf){_0x324eb9['setDataValue'](_0x322b('0x8'),_0xa6cabf['map'](function(_0x5b6088){return{'id':_0x5b6088['id']};}));return MailMessage[_0x322b('0x9')]({'where':{'MailInteractionId':_0x324eb9['id'],'direction':'in','read':![]},'raw':!![]});})[_0x322b('0x7')](function(_0x8a08a0){_0x324eb9[_0x322b('0xa')](_0x322b('0xb'),_0x8a08a0['length']);MailInteractionEvents[_0x322b('0xc')](_0x56d261+':'+_0x324eb9['id'],_0x324eb9);MailInteractionEvents[_0x322b('0xc')](_0x56d261,_0x324eb9);_0x375132(null);})[_0x322b('0xd')](_0x375132(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x322b('0xe')](e,emitEvent(event));}}module[_0x322b('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index ad197eb..9115066 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 _0x2974=['closedAt','substatusAt','changed','models','get','MailMessage','update','then','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed'];(function(_0x36290e,_0x328f43){var _0x56eba4=function(_0x42369c){while(--_0x42369c){_0x36290e['push'](_0x36290e['shift']());}};_0x56eba4(++_0x328f43);}(_0x2974,0xea));var _0x4297=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x2974[_0x541ea6];return _0x3c3e84;};'use strict';var _=require(_0x4297('0x0'));var util=require(_0x4297('0x1'));var logger=require(_0x4297('0x2'))(_0x4297('0x3'));var moment=require(_0x4297('0x4'));var BPromise=require(_0x4297('0x5'));var rp=require(_0x4297('0x6'));var fs=require('fs');var path=require(_0x4297('0x7'));var rimraf=require(_0x4297('0x8'));var config=require(_0x4297('0x9'));var attributes=require(_0x4297('0xa'));module[_0x4297('0xb')]=function(_0x5edb36,_0x52bd10){return _0x5edb36[_0x4297('0xc')](_0x4297('0xd'),attributes,{'tableName':_0x4297('0xe'),'paranoid':![],'indexes':[{'name':_0x4297('0xf'),'fields':[_0x4297('0x10'),'to'],'type':_0x4297('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x40d7e9,_0x333fef,_0x32bf93){if(_0x40d7e9[_0x4297('0x12')]){_0x40d7e9['substatusAt']=moment()[_0x4297('0x13')](_0x4297('0x14'));}if(_0x40d7e9[_0x4297('0x15')]){_0x40d7e9[_0x4297('0x16')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x32bf93(null,_0x333fef);},'beforeUpdate':function(_0x45b6a5,_0x4ac1d3,_0x3a8a8e){if(_0x45b6a5['changed'](_0x4297('0x12'))){_0x45b6a5[_0x4297('0x17')]=_0x45b6a5[_0x4297('0x12')]?moment()[_0x4297('0x13')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x45b6a5[_0x4297('0x18')](_0x4297('0x15'))){_0x45b6a5['closedAt']=moment()[_0x4297('0x13')](_0x4297('0x14'));_0x45b6a5[_0x4297('0x12')]=null;_0x45b6a5[_0x4297('0x17')]=null;}_0x3a8a8e(null,_0x45b6a5);},'afterUpdate':function(_0x116a2c,_0xee3180,_0x252745){var _0x52358c=_0x5edb36[_0x4297('0x19')];var _0x20bee1=_0x116a2c[_0x4297('0x1a')]({'plain':!![]});if(_0x20bee1[_0x4297('0x15')]){return _0x52358c[_0x4297('0x1b')][_0x4297('0x1c')]({'read':!![]},{'where':{'MailInteractionId':_0x20bee1['id']}})[_0x4297('0x1d')](function(){_0x252745();})[_0x4297('0x1e')](function(_0x4ec87f){_0x252745(_0x4ec87f);});}else{_0x252745();}}},'charset':_0x4297('0x1f'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1de9=['closedAt','changed','closed','models','MailMessage','update','then','catch','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1de9,0x1d4));var _0x91de=function(_0xaba8c1,_0x3c6ad7){_0xaba8c1=_0xaba8c1-0x0;var _0x3cbe20=_0x1de9[_0xaba8c1];return _0x3cbe20;};'use strict';var _=require(_0x91de('0x0'));var util=require('util');var logger=require(_0x91de('0x1'))(_0x91de('0x2'));var moment=require(_0x91de('0x3'));var BPromise=require(_0x91de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91de('0x5'));var rimraf=require(_0x91de('0x6'));var config=require(_0x91de('0x7'));var attributes=require(_0x91de('0x8'));module[_0x91de('0x9')]=function(_0x4a9be4,_0x538a27){return _0x4a9be4['define'](_0x91de('0xa'),attributes,{'tableName':_0x91de('0xb'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x91de('0xc'),'to'],'type':_0x91de('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8eac8b,_0x462952,_0x2b49fe){if(_0x8eac8b[_0x91de('0xe')]){_0x8eac8b[_0x91de('0xf')]=moment()[_0x91de('0x10')](_0x91de('0x11'));}if(_0x8eac8b['closed']){_0x8eac8b[_0x91de('0x12')]=moment()[_0x91de('0x10')](_0x91de('0x11'));}_0x2b49fe(null,_0x462952);},'beforeUpdate':function(_0x14c493,_0x364243,_0x540dcf){if(_0x14c493[_0x91de('0x13')](_0x91de('0xe'))){_0x14c493[_0x91de('0xf')]=_0x14c493[_0x91de('0xe')]?moment()[_0x91de('0x10')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x14c493['changed'](_0x91de('0x14'))){_0x14c493[_0x91de('0x12')]=moment()[_0x91de('0x10')](_0x91de('0x11'));_0x14c493[_0x91de('0xe')]=null;_0x14c493[_0x91de('0xf')]=null;}_0x540dcf(null,_0x14c493);},'afterUpdate':function(_0x3b1275,_0x14775d,_0x2d314f){var _0x591f93=_0x4a9be4[_0x91de('0x15')];var _0x43c044=_0x3b1275['get']({'plain':!![]});if(_0x43c044[_0x91de('0x14')]){return _0x591f93[_0x91de('0x16')][_0x91de('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x43c044['id']}})[_0x91de('0x18')](function(){_0x2d314f();})[_0x91de('0x19')](function(_0x51147d){_0x2d314f(_0x51147d);});}else{_0x2d314f();}}},'charset':_0x91de('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 34a9953..679893b 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 _0x1a44=['code','message','result','catch','MailInteraction','update','body','options','raw','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x18b287,_0x5054c0){var _0x65525a=function(_0x27e545){while(--_0x27e545){_0x18b287['push'](_0x18b287['shift']());}};_0x65525a(++_0x5054c0);}(_0x1a44,0xc4));var _0x41a4=function(_0xc8657f,_0x50e9cf){_0xc8657f=_0xc8657f-0x0;var _0x2b943d=_0x1a44[_0xc8657f];return _0x2b943d;};'use strict';var _=require(_0x41a4('0x0'));var util=require('util');var moment=require(_0x41a4('0x1'));var BPromise=require(_0x41a4('0x2'));var rs=require(_0x41a4('0x3'));var fs=require('fs');var Redis=require(_0x41a4('0x4'));var db=require(_0x41a4('0x5'))['db'];var utils=require(_0x41a4('0x6'));var logger=require(_0x41a4('0x7'))('rpc');var config=require(_0x41a4('0x8'));var jayson=require(_0x41a4('0x9'));var client=jayson[_0x41a4('0xa')][_0x41a4('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x41a4('0xc')],{'host':_0x41a4('0xd'),'port':0x18eb});var socket=require(_0x41a4('0xe'))(new Redis(config[_0x41a4('0xc')]));require(_0x41a4('0xf'))['register'](socket);function respondWithRpcPromise(_0x529061,_0x477815,_0x162699){return new BPromise(function(_0x791a3,_0xd32dcc){return client[_0x41a4('0x10')](_0x529061,_0x162699)[_0x41a4('0x11')](function(_0x4fb927){logger[_0x41a4('0x12')](_0x41a4('0x13'),_0x477815,_0x41a4('0x14'));logger[_0x41a4('0x15')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x477815,_0x41a4('0x14'),JSON[_0x41a4('0x16')](_0x4fb927));if(_0x4fb927['error']){if(_0x4fb927[_0x41a4('0x17')][_0x41a4('0x18')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x477815,_0x4fb927[_0x41a4('0x17')][_0x41a4('0x19')]);return _0xd32dcc(_0x4fb927[_0x41a4('0x17')][_0x41a4('0x19')]);}logger[_0x41a4('0x17')]('MailInteraction,\x20%s,\x20%s',_0x477815,_0x4fb927[_0x41a4('0x17')]['message']);return _0x791a3(_0x4fb927[_0x41a4('0x17')][_0x41a4('0x19')]);}else{logger[_0x41a4('0x12')](_0x41a4('0x13'),_0x477815,_0x41a4('0x14'));_0x791a3(_0x4fb927[_0x41a4('0x1a')][_0x41a4('0x19')]);}})[_0x41a4('0x1b')](function(_0x9449ab){logger[_0x41a4('0x17')](_0x41a4('0x13'),_0x477815,_0x9449ab);_0xd32dcc(_0x9449ab);});});}exports['UpdateMailInteraction']=function(_0x2faa2a){var _0x2f80bd=this;return new Promise(function(_0x347403,_0x5be9bd){return db[_0x41a4('0x1c')][_0x41a4('0x1d')](_0x2faa2a[_0x41a4('0x1e')],{'raw':_0x2faa2a[_0x41a4('0x1f')]?_0x2faa2a['options'][_0x41a4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2faa2a[_0x41a4('0x1f')]?_0x2faa2a['options'][_0x41a4('0x21')]||null:null,'attributes':_0x2faa2a['options']?_0x2faa2a[_0x41a4('0x1f')][_0x41a4('0x22')]||null:null,'limit':_0x2faa2a[_0x41a4('0x1f')]?_0x2faa2a[_0x41a4('0x1f')][_0x41a4('0x23')]||null:null})[_0x41a4('0x11')](function(_0x1209e7){logger[_0x41a4('0x12')](_0x41a4('0x24'),_0x2faa2a);logger[_0x41a4('0x15')](_0x41a4('0x24'),_0x2faa2a,JSON[_0x41a4('0x16')](_0x1209e7));_0x347403(_0x1209e7);})['catch'](function(_0x3be091){logger[_0x41a4('0x17')](_0x41a4('0x24'),_0x3be091['message'],_0x2faa2a);_0x5be9bd(_0x2f80bd[_0x41a4('0x17')](0x1f4,_0x3be091[_0x41a4('0x19')]));});});};exports[_0x41a4('0x25')]=function(_0x298073){return new Promise(function(_0x4b2f83,_0x2f7305){return db['MailInteraction'][_0x41a4('0x26')]({'where':_0x298073[_0x41a4('0x1f')]?_0x298073[_0x41a4('0x1f')]['where']||null:null})[_0x41a4('0x11')](function(_0x2fd09d){if(_0x2fd09d){return _0x2fd09d[_0x41a4('0x27')](_0x298073[_0x41a4('0x1e')][_0x41a4('0x28')],_[_0x41a4('0x29')](_0x298073[_0x41a4('0x1e')],[_0x41a4('0x28'),'id'])||{});}})[_0x41a4('0x2a')](function(_0x507c7a){logger[_0x41a4('0x12')](_0x41a4('0x2b'),_0x298073);logger['debug']('AddTags',_0x298073,JSON[_0x41a4('0x16')](_0x507c7a));_0x4b2f83(_0x507c7a);})[_0x41a4('0x1b')](function(_0x5efed5){logger[_0x41a4('0x17')](_0x41a4('0x2b'),_0x5efed5[_0x41a4('0x19')],_0x298073);_0x2f7305(_this[_0x41a4('0x17')](0x1f4,_0x5efed5[_0x41a4('0x19')]));});});}; \ No newline at end of file +var _0xd38e=['update','options','raw','attributes','limit','find','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','debug','stringify','error','message','MailInteraction,\x20%s,\x20%s','request\x20sent','result','catch','UpdateMailInteraction','MailInteraction'];(function(_0x6c1e7e,_0x2fa894){var _0xb3ca54=function(_0x57735c){while(--_0x57735c){_0x6c1e7e['push'](_0x6c1e7e['shift']());}};_0xb3ca54(++_0x2fa894);}(_0xd38e,0x17d));var _0xed38=function(_0x35418c,_0x3c284e){_0x35418c=_0x35418c-0x0;var _0x2fcf61=_0xd38e[_0x35418c];return _0x2fcf61;};'use strict';var _=require(_0xed38('0x0'));var util=require('util');var moment=require(_0xed38('0x1'));var BPromise=require(_0xed38('0x2'));var rs=require(_0xed38('0x3'));var fs=require('fs');var Redis=require(_0xed38('0x4'));var db=require(_0xed38('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xed38('0x6'))(_0xed38('0x7'));var config=require(_0xed38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xed38('0x9')][_0xed38('0xa')]({'port':0x232a});config[_0xed38('0xb')]=_['defaults'](config[_0xed38('0xb')],{'host':_0xed38('0xc'),'port':0x18eb});var socket=require(_0xed38('0xd'))(new Redis(config['redis']));require(_0xed38('0xe'))[_0xed38('0xf')](socket);function respondWithRpcPromise(_0x4773e0,_0x39edca,_0x5f2844){return new BPromise(function(_0x31661c,_0xaafa55){return client[_0xed38('0x10')](_0x4773e0,_0x5f2844)[_0xed38('0x11')](function(_0x1a7d01){logger[_0xed38('0x12')]('MailInteraction,\x20%s,\x20%s',_0x39edca,'request\x20sent');logger[_0xed38('0x13')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x39edca,'request\x20sent',JSON[_0xed38('0x14')](_0x1a7d01));if(_0x1a7d01[_0xed38('0x15')]){if(_0x1a7d01[_0xed38('0x15')]['code']===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0x39edca,_0x1a7d01['error']['message']);return _0xaafa55(_0x1a7d01[_0xed38('0x15')][_0xed38('0x16')]);}logger[_0xed38('0x15')](_0xed38('0x17'),_0x39edca,_0x1a7d01[_0xed38('0x15')][_0xed38('0x16')]);return _0x31661c(_0x1a7d01['error'][_0xed38('0x16')]);}else{logger['info'](_0xed38('0x17'),_0x39edca,_0xed38('0x18'));_0x31661c(_0x1a7d01[_0xed38('0x19')][_0xed38('0x16')]);}})[_0xed38('0x1a')](function(_0x57b7c9){logger[_0xed38('0x15')](_0xed38('0x17'),_0x39edca,_0x57b7c9);_0xaafa55(_0x57b7c9);});});}exports[_0xed38('0x1b')]=function(_0x13b0ab){var _0x3d6e67=this;return new Promise(function(_0x252224,_0x278bc3){return db[_0xed38('0x1c')][_0xed38('0x1d')](_0x13b0ab['body'],{'raw':_0x13b0ab[_0xed38('0x1e')]?_0x13b0ab[_0xed38('0x1e')][_0xed38('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13b0ab[_0xed38('0x1e')]?_0x13b0ab[_0xed38('0x1e')]['where']||null:null,'attributes':_0x13b0ab[_0xed38('0x1e')]?_0x13b0ab['options'][_0xed38('0x20')]||null:null,'limit':_0x13b0ab['options']?_0x13b0ab['options'][_0xed38('0x21')]||null:null})[_0xed38('0x11')](function(_0x20a274){logger[_0xed38('0x12')]('UpdateMailInteraction',_0x13b0ab);logger[_0xed38('0x13')](_0xed38('0x1b'),_0x13b0ab,JSON[_0xed38('0x14')](_0x20a274));_0x252224(_0x20a274);})[_0xed38('0x1a')](function(_0x5c05fa){logger['error']('UpdateMailInteraction',_0x5c05fa[_0xed38('0x16')],_0x13b0ab);_0x278bc3(_0x3d6e67[_0xed38('0x15')](0x1f4,_0x5c05fa[_0xed38('0x16')]));});});};exports['AddTagsToMailInteraction']=function(_0x426601){return new Promise(function(_0x3e874e,_0x3b141c){return db[_0xed38('0x1c')][_0xed38('0x22')]({'where':_0x426601[_0xed38('0x1e')]?_0x426601[_0xed38('0x1e')]['where']||null:null})[_0xed38('0x11')](function(_0x5c5094){if(_0x5c5094){return _0x5c5094[_0xed38('0x23')](_0x426601[_0xed38('0x24')][_0xed38('0x25')],_[_0xed38('0x26')](_0x426601[_0xed38('0x24')],[_0xed38('0x25'),'id'])||{});}})[_0xed38('0x27')](function(_0xa00407){logger[_0xed38('0x12')](_0xed38('0x28'),_0x426601);logger[_0xed38('0x13')](_0xed38('0x28'),_0x426601,JSON['stringify'](_0xa00407));_0x3e874e(_0xa00407);})['catch'](function(_0x36fd74){logger[_0xed38('0x15')](_0xed38('0x28'),_0x36fd74[_0xed38('0x16')],_0x426601);_0x3b141c(_this[_0xed38('0x15')](0x1f4,_0x36fd74[_0xed38('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index ee4d02b..1291021 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 _0xb245=['update','removeListener','register','length','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xb245,0xdd));var _0x5b24=function(_0x51b07e,_0x2e2a3a){_0x51b07e=_0x51b07e-0x0;var _0x4fdb4f=_0xb245[_0x51b07e];return _0x4fdb4f;};'use strict';var MailInteractionEvents=require(_0x5b24('0x0'));var events=[_0x5b24('0x1'),_0x5b24('0x2'),_0x5b24('0x3')];function createListener(_0x18337e,_0x289301){return function(_0x5ae12e){_0x289301['emit'](_0x18337e,_0x5ae12e);};}function removeListener(_0x3878f3,_0x52d856){return function(){MailInteractionEvents[_0x5b24('0x4')](_0x3878f3,_0x52d856);};}exports[_0x5b24('0x5')]=function(_0x3d2d71){for(var _0x746f80=0x0,_0x3c8afe=events[_0x5b24('0x6')];_0x746f80<_0x3c8afe;_0x746f80++){var _0x358493=events[_0x746f80];var _0x1cdef4=createListener(_0x5b24('0x7')+_0x358493,_0x3d2d71);MailInteractionEvents['on'](_0x358493,_0x1cdef4);}}; \ No newline at end of file +var _0x38a3=['./mailInteraction.events','save','remove','update','removeListener','register','length','mailInteraction:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x38a3,0x1b0));var _0x338a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x38a3[_0xfae23b];return _0x200640;};'use strict';var MailInteractionEvents=require(_0x338a('0x0'));var events=[_0x338a('0x1'),_0x338a('0x2'),_0x338a('0x3')];function createListener(_0x59c06e,_0x5484aa){return function(_0x24caff){_0x5484aa['emit'](_0x59c06e,_0x24caff);};}function removeListener(_0x12d480,_0x5c1d91){return function(){MailInteractionEvents[_0x338a('0x4')](_0x12d480,_0x5c1d91);};}exports[_0x338a('0x5')]=function(_0x499533){for(var _0x412489=0x0,_0x23e2e6=events[_0x338a('0x6')];_0x412489<_0x23e2e6;_0x412489++){var _0x1b0a99=events[_0x412489];var _0x25ce8b=createListener(_0x338a('0x7')+_0x1b0a99,_0x499533);MailInteractionEvents['on'](_0x1b0a99,_0x25ce8b);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c7568f6..0a9b33b 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 _0x07be=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','describe','/:id','show','/:id/download','download','post','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer'];(function(_0x52bc53,_0x29d09d){var _0x36d12b=function(_0x1cd325){while(--_0x1cd325){_0x52bc53['push'](_0x52bc53['shift']());}};_0x36d12b(++_0x29d09d);}(_0x07be,0xfb));var _0xe07b=function(_0x22d027,_0x33af02){_0x22d027=_0x22d027-0x0;var _0x1c3f52=_0x07be[_0x22d027];return _0x1c3f52;};'use strict';var multer=require(_0xe07b('0x0'));var util=require(_0xe07b('0x1'));var path=require(_0xe07b('0x2'));var timeout=require(_0xe07b('0x3'));var express=require('express');var router=express[_0xe07b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe07b('0x5'));var interaction=require(_0xe07b('0x6'));var config=require(_0xe07b('0x7'));var controller=require(_0xe07b('0x8'));router['get']('/',auth[_0xe07b('0x9')](),controller[_0xe07b('0xa')]);router[_0xe07b('0xb')]('/describe',auth[_0xe07b('0x9')](),controller[_0xe07b('0xc')]);router[_0xe07b('0xb')](_0xe07b('0xd'),auth[_0xe07b('0x9')](),controller[_0xe07b('0xe')]);router[_0xe07b('0xb')](_0xe07b('0xf'),auth[_0xe07b('0x9')](),controller[_0xe07b('0x10')]);router[_0xe07b('0x11')]('/',auth['isAuthenticated'](),interaction['tracked']('mail',_0xe07b('0x12')),controller[_0xe07b('0x13')]);router[_0xe07b('0x14')](_0xe07b('0xd'),auth['isAuthenticated'](),controller['update']);router['put'](_0xe07b('0x15'),auth[_0xe07b('0x9')](),controller[_0xe07b('0x16')]);router['put'](_0xe07b('0x17'),auth[_0xe07b('0x9')](),controller[_0xe07b('0x18')]);router[_0xe07b('0x19')](_0xe07b('0xd'),auth[_0xe07b('0x9')](),controller[_0xe07b('0x1a')]);module[_0xe07b('0x1b')]=router; \ No newline at end of file +var _0xe852=['tracked','mail','mailmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download'];(function(_0x4bc478,_0x417178){var _0x44ac19=function(_0xf35604){while(--_0xf35604){_0x4bc478['push'](_0x4bc478['shift']());}};_0x44ac19(++_0x417178);}(_0xe852,0x7f));var _0x2e85=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xe852[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0x2e85('0x0'));var util=require(_0x2e85('0x1'));var path=require(_0x2e85('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e85('0x3'));var router=express[_0x2e85('0x4')]();var fs_extra=require(_0x2e85('0x5'));var auth=require(_0x2e85('0x6'));var interaction=require(_0x2e85('0x7'));var config=require(_0x2e85('0x8'));var controller=require(_0x2e85('0x9'));router[_0x2e85('0xa')]('/',auth[_0x2e85('0xb')](),controller[_0x2e85('0xc')]);router['get'](_0x2e85('0xd'),auth[_0x2e85('0xb')](),controller['describe']);router[_0x2e85('0xa')](_0x2e85('0xe'),auth[_0x2e85('0xb')](),controller[_0x2e85('0xf')]);router[_0x2e85('0xa')](_0x2e85('0x10'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x11')]);router['post']('/',auth[_0x2e85('0xb')](),interaction[_0x2e85('0x12')](_0x2e85('0x13'),_0x2e85('0x14')),controller['create']);router[_0x2e85('0x15')](_0x2e85('0xe'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x16')]);router[_0x2e85('0x15')](_0x2e85('0x17'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x18')]);router[_0x2e85('0x15')](_0x2e85('0x19'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x1a')]);router['delete'](_0x2e85('0xe'),auth[_0x2e85('0xb')](),controller[_0x2e85('0x1b')]);module[_0x2e85('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 68e43c3..89a9566 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 _0x1046=['medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','Email','Chat','sequelize','exports','TEXT','long'];(function(_0x56119a,_0x3bd053){var _0x4d44fb=function(_0x18471b){while(--_0x18471b){_0x56119a['push'](_0x56119a['shift']());}};_0x4d44fb(++_0x3bd053);}(_0x1046,0x134));var _0x6104=function(_0x414575,_0x21ee23){_0x414575=_0x414575-0x0;var _0x29b04f=_0x1046[_0x414575];return _0x29b04f;};'use strict';var Sequelize=require(_0x6104('0x0'));var _=require('lodash');module[_0x6104('0x1')]={'body':{'type':Sequelize[_0x6104('0x2')](_0x6104('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x6104('0x2')](_0x6104('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x6104('0x5')]('in',_0x6104('0x6')),'defaultValue':_0x6104('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6104('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x6104('0x2')](_0x6104('0x3'))},'cc':{'type':Sequelize[_0x6104('0x2')](_0x6104('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x6104('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x6104('0x8')]},'attach':{'type':Sequelize[_0x6104('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x6104('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x6104('0x8')]},'originTo':{'type':Sequelize[_0x6104('0x2')](_0x6104('0x3'))},'originCc':{'type':Sequelize[_0x6104('0x2')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0x6104('0xb'),_0x6104('0xc')),'defaultValue':_0x6104('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x2171=['Chat','sequelize','lodash','exports','long','ENUM','out','TEXT','DATE','Email'];(function(_0xd2d450,_0x4f1aef){var _0x378757=function(_0x1e451d){while(--_0x1e451d){_0xd2d450['push'](_0xd2d450['shift']());}};_0x378757(++_0x4f1aef);}(_0x2171,0x1b9));var _0x1217=function(_0xf879bb,_0x5aaebf){_0xf879bb=_0xf879bb-0x0;var _0x277abc=_0x2171[_0xf879bb];return _0x277abc;};'use strict';var Sequelize=require(_0x1217('0x0'));var _=require(_0x1217('0x1'));module[_0x1217('0x2')]={'body':{'type':Sequelize['TEXT'](_0x1217('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x1217('0x4')]('in',_0x1217('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x1217('0x6')]('long')},'cc':{'type':Sequelize['TEXT'](_0x1217('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x1217('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x1217('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x1217('0x7')]},'originTo':{'type':Sequelize[_0x1217('0x6')](_0x1217('0x3'))},'originCc':{'type':Sequelize[_0x1217('0x6')](_0x1217('0x3'))},'originChannel':{'type':Sequelize[_0x1217('0x4')](_0x1217('0x8'),_0x1217('0x9')),'defaultValue':_0x1217('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index a6ba66b..3724959 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 _0x6be6=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','show','rawAttributes','body','find','params','describe','create','direction','secret','split','MailAccountId','Contacts','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','root','basename','List','CmContact','ListId','List\x20not\x20found','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','get','MailInteractionId','read1stAt','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteraction','role','null','RejectMessage','rejectMessage','QueryTypes','SELECT','reject','download','join','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','update','then','destroy','end','sendStatus','name','send','map','MailMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1590bb,_0x1b3dcf){var _0x5d76a0=function(_0x92afd6){while(--_0x92afd6){_0x1590bb['push'](_0x1590bb['shift']());}};_0x5d76a0(++_0x1b3dcf);}(_0x6be6,0x10d));var _0x66be=function(_0x523ce3,_0x112c31){_0x523ce3=_0x523ce3-0x0;var _0x576c82=_0x6be6[_0x523ce3];return _0x576c82;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require(_0x66be('0x0'));var util=require(_0x66be('0x1'));var path=require(_0x66be('0x2'));var fs=require('fs');var _=require(_0x66be('0x3'));var Redis=require(_0x66be('0x4'));var htmlToText=require(_0x66be('0x5'));var qs=require(_0x66be('0x6'));var logger=require(_0x66be('0x7'))(_0x66be('0x8'));var interaction_log=require(_0x66be('0x7'))(_0x66be('0x9'));var config=require(_0x66be('0xa'));var db=require(_0x66be('0xb'))['db'];config[_0x66be('0xc')]=_[_0x66be('0xd')](config[_0x66be('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x66be('0xe'))(new Redis(config[_0x66be('0xc')]));var htmlEntities=require(_0x66be('0xf'));require(_0x66be('0x10'))[_0x66be('0x11')](socket);var jayson=require(_0x66be('0x12'));var client=jayson[_0x66be('0x13')][_0x66be('0x14')]({'port':0x232c});var client9003=jayson[_0x66be('0x13')]['http']({'port':0x232b});var client9002=jayson[_0x66be('0x13')][_0x66be('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x4faf02,_0x520c5f,_0x19558a,_0x5b0752){return new BPromise(function(_0x64b1a1,_0xe063b){var _0x499dd5=_0x5b0752||client;return _0x499dd5[_0x66be('0x15')](_0x4faf02,_0x19558a)['then'](function(_0x68ccbf){logger[_0x66be('0x16')](_0x66be('0x17'),_0x520c5f,_0x66be('0x18'));logger[_0x66be('0x19')](_0x66be('0x1a'),_0x520c5f,'request\x20sent',JSON[_0x66be('0x1b')](_0x68ccbf));if(_0x68ccbf['error']){if(_0x68ccbf['error']['code']===0x1f4){logger[_0x66be('0x1c')](_0x66be('0x17'),_0x520c5f,_0x68ccbf[_0x66be('0x1c')][_0x66be('0x1d')]);return _0xe063b(_0x68ccbf[_0x66be('0x1c')][_0x66be('0x1d')]);}logger['error'](_0x66be('0x17'),_0x520c5f,_0x68ccbf[_0x66be('0x1c')][_0x66be('0x1d')]);return _0x64b1a1(_0x68ccbf[_0x66be('0x1c')][_0x66be('0x1d')]);}else{logger[_0x66be('0x16')]('MailMessage,\x20%s,\x20%s',_0x520c5f,_0x66be('0x18'));_0x64b1a1(_0x68ccbf[_0x66be('0x1e')][_0x66be('0x1d')]);}})[_0x66be('0x1f')](function(_0x2730a3){logger[_0x66be('0x1c')](_0x66be('0x17'),_0x520c5f,_0x2730a3);_0xe063b(_0x2730a3);});});}function respondWithResult(_0xe4f05d,_0x326444){_0x326444=_0x326444||0xc8;return function(_0x5a7cf6){if(_0x5a7cf6){return _0xe4f05d[_0x66be('0x20')](_0x326444)[_0x66be('0x21')](_0x5a7cf6);}};}function respondWithFilteredResult(_0x2f1a12,_0x189f82){return function(_0x141a3f){if(_0x141a3f){var _0x271add=typeof _0x189f82[_0x66be('0x22')]===_0x66be('0x23')&&typeof _0x189f82[_0x66be('0x24')]===_0x66be('0x23');var _0x12356f=_0x141a3f[_0x66be('0x25')];var _0x3cd8fb=_0x271add?0x0:_0x189f82[_0x66be('0x22')];var _0x10bba3=_0x271add?_0x141a3f[_0x66be('0x25')]:_0x189f82['offset']+_0x189f82[_0x66be('0x24')];var _0x2a4597;if(_0x10bba3>=_0x12356f){_0x10bba3=_0x12356f;_0x2a4597=0xc8;}else{_0x2a4597=0xce;}_0x2f1a12[_0x66be('0x20')](_0x2a4597);return _0x2f1a12[_0x66be('0x26')]('Content-Range',_0x3cd8fb+'-'+_0x10bba3+'/'+_0x12356f)['json'](_0x141a3f);}return null;};}function saveUpdates(_0x49dd7a){return function(_0x314975){if(_0x314975){return _0x314975[_0x66be('0x27')](_0x49dd7a)[_0x66be('0x28')](function(_0x48c4fc){return _0x48c4fc;});}return null;};}function removeEntity(_0xb5cb1c){return function(_0x8063e8){if(_0x8063e8){return _0x8063e8[_0x66be('0x29')]()[_0x66be('0x28')](function(){_0xb5cb1c[_0x66be('0x20')](0xcc)[_0x66be('0x2a')]();});}};}function handleEntityNotFound(_0x3ac661){return function(_0x7838fb){if(!_0x7838fb){_0x3ac661[_0x66be('0x2b')](0x194);}return _0x7838fb;};}function handleError(_0x3d0c12,_0x2ec154){_0x2ec154=_0x2ec154||0x1f4;return function(_0xd24038){logger['error'](_0xd24038['stack']);if(_0xd24038[_0x66be('0x2c')]){delete _0xd24038[_0x66be('0x2c')];}_0x3d0c12[_0x66be('0x20')](_0x2ec154)[_0x66be('0x2d')](_0xd24038);};}exports['index']=function(_0x4eaa3b,_0x29e211){var _0x53eddd={},_0xcd72a8={},_0x1b0e2d={'count':0x0,'rows':[]};var _0x4c619c=_[_0x66be('0x2e')](db[_0x66be('0x2f')]['rawAttributes'],function(_0x2dcc2e){return{'name':_0x2dcc2e[_0x66be('0x30')],'type':_0x2dcc2e[_0x66be('0x31')][_0x66be('0x32')]};});_0xcd72a8[_0x66be('0x33')]=_['map'](_0x4c619c,_0x66be('0x2c'));_0xcd72a8[_0x66be('0x34')]=_[_0x66be('0x35')](_0x4eaa3b[_0x66be('0x34')]);_0xcd72a8[_0x66be('0x36')]=_[_0x66be('0x37')](_0xcd72a8['model'],_0xcd72a8[_0x66be('0x34')]);_0x53eddd[_0x66be('0x38')]=_[_0x66be('0x37')](_0xcd72a8[_0x66be('0x33')],qs[_0x66be('0x39')](_0x4eaa3b[_0x66be('0x34')][_0x66be('0x39')]));_0x53eddd['attributes']=_0x53eddd[_0x66be('0x38')][_0x66be('0x3a')]?_0x53eddd[_0x66be('0x38')]:_0xcd72a8['model'];if(!_0x4eaa3b[_0x66be('0x34')][_0x66be('0x3b')](_0x66be('0x3c'))){_0x53eddd[_0x66be('0x24')]=qs[_0x66be('0x24')](_0x4eaa3b[_0x66be('0x34')][_0x66be('0x24')]);_0x53eddd[_0x66be('0x22')]=qs[_0x66be('0x22')](_0x4eaa3b[_0x66be('0x34')][_0x66be('0x22')]);}_0x53eddd[_0x66be('0x3d')]=qs[_0x66be('0x3e')](_0x4eaa3b[_0x66be('0x34')][_0x66be('0x3e')]);_0x53eddd['where']=qs[_0x66be('0x36')](_[_0x66be('0x3f')](_0x4eaa3b['query'],_0xcd72a8[_0x66be('0x36')]),_0x4c619c);if(_0x4eaa3b[_0x66be('0x34')][_0x66be('0x40')]){_0x53eddd[_0x66be('0x41')]=_['merge'](_0x53eddd[_0x66be('0x41')],{'$or':_[_0x66be('0x2e')](_0x4c619c,function(_0x379a16){if(_0x379a16['type']!==_0x66be('0x42')){var _0x4ed0b1={};_0x4ed0b1[_0x379a16[_0x66be('0x2c')]]={'$like':'%'+_0x4eaa3b['query'][_0x66be('0x40')]+'%'};return _0x4ed0b1;}})});}_0x53eddd=_['merge']({},_0x53eddd,_0x4eaa3b[_0x66be('0x43')]);var _0x18c85e={'where':_0x53eddd[_0x66be('0x41')]};return db['MailMessage'][_0x66be('0x25')](_0x18c85e)[_0x66be('0x28')](function(_0x29ccca){_0x1b0e2d[_0x66be('0x25')]=_0x29ccca;if(_0x4eaa3b[_0x66be('0x34')][_0x66be('0x44')]){_0x53eddd['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x53eddd);})[_0x66be('0x28')](function(_0xed8aeb){_0x1b0e2d['rows']=_0xed8aeb;return _0x1b0e2d;})[_0x66be('0x28')](respondWithFilteredResult(_0x29e211,_0x53eddd))[_0x66be('0x1f')](handleError(_0x29e211,null));};exports[_0x66be('0x45')]=function(_0x3b138a,_0x4caf4d){var _0x2ba688={'raw':!![],'where':{'id':_0x3b138a['params']['id']}},_0x3cf96b={};_0x3cf96b[_0x66be('0x33')]=_[_0x66be('0x35')](db[_0x66be('0x2f')][_0x66be('0x46')]);_0x3cf96b[_0x66be('0x34')]=_['keys'](_0x3b138a[_0x66be('0x34')]);_0x3cf96b['filters']=_[_0x66be('0x37')](_0x3cf96b[_0x66be('0x33')],_0x3cf96b['query']);_0x2ba688['attributes']=_[_0x66be('0x37')](_0x3cf96b[_0x66be('0x33')],qs[_0x66be('0x39')](_0x3b138a[_0x66be('0x34')]['fields']));_0x2ba688[_0x66be('0x38')]=_0x2ba688[_0x66be('0x38')]['length']?_0x2ba688[_0x66be('0x38')]:_0x3cf96b['model'];if(_0x3b138a[_0x66be('0x34')][_0x66be('0x44')]){_0x2ba688['include']=[{'all':!![]}];}_0x2ba688=_['merge']({},_0x2ba688,_0x3b138a[_0x66be('0x43')]);return db[_0x66be('0x2f')]['find'](_0x2ba688)['then'](handleEntityNotFound(_0x4caf4d,null))[_0x66be('0x28')](respondWithResult(_0x4caf4d,null))['catch'](handleError(_0x4caf4d,null));};exports[_0x66be('0x27')]=function(_0x1485bf,_0x45c905){if(_0x1485bf[_0x66be('0x47')]['id']){delete _0x1485bf['body']['id'];}return db[_0x66be('0x2f')][_0x66be('0x48')]({'where':{'id':_0x1485bf['params']['id']}})[_0x66be('0x28')](handleEntityNotFound(_0x45c905,null))[_0x66be('0x28')](saveUpdates(_0x1485bf['body'],null))[_0x66be('0x28')](respondWithResult(_0x45c905,null))[_0x66be('0x1f')](handleError(_0x45c905,null));};exports['destroy']=function(_0x3f656d,_0x517597){return db[_0x66be('0x2f')][_0x66be('0x48')]({'where':{'id':_0x3f656d[_0x66be('0x49')]['id']}})['then'](handleEntityNotFound(_0x517597,null))[_0x66be('0x28')](removeEntity(_0x517597,null))['catch'](handleError(_0x517597,null));};exports[_0x66be('0x4a')]=function(_0x13d7c4,_0x21983d){return db[_0x66be('0x2f')][_0x66be('0x4a')]()[_0x66be('0x28')](respondWithResult(_0x21983d,null))[_0x66be('0x1f')](handleError(_0x21983d,null));};exports[_0x66be('0x4b')]=function(_0x5c7da4,_0x3351fa){return db[_0x66be('0x2f')][_0x66be('0x4b')](_0x5c7da4[_0x66be('0x47')])[_0x66be('0x28')](function(_0x2a6531){if(_0x2a6531){if(_0x2a6531[_0x66be('0x4c')]==='out'&&!_0x2a6531[_0x66be('0x4d')]){var _0x5b41f2,_0x8ff5e6,_0x3e5906;if(_0x5c7da4[_0x66be('0x47')]['to']){_0x8ff5e6=_0x5c7da4[_0x66be('0x47')]['to'][_0x66be('0x4e')](',')[0x0];}return db['MailAccount']['findOne']({'where':{'id':_0x2a6531[_0x66be('0x4f')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x66be('0x50'),'where':{'email':_0x8ff5e6},'limit':0x1,'order':[[_0x66be('0x51'),_0x66be('0x52')]]}]},{'model':db['MailServerOut'],'as':_0x66be('0x53'),'raw':!![]}]})['then'](function(_0x46bbcd){_0x5b41f2=_0x46bbcd;if(_0x5b41f2&&_0x5b41f2[_0x66be('0x53')]){var _0x40011d={'tls':{'rejectUnauthorized':![]}};if(_[_0x66be('0x54')](_0x5b41f2[_0x66be('0x53')]['service'])){_0x40011d[_0x66be('0x55')]=_0x5b41f2[_0x66be('0x53')]['host'];_0x40011d[_0x66be('0x56')]=_0x5b41f2[_0x66be('0x53')][_0x66be('0x56')];_0x40011d['secure']=_0x5b41f2[_0x66be('0x53')][_0x66be('0x57')];if(_0x5b41f2[_0x66be('0x53')][_0x66be('0x58')]){_0x40011d[_0x66be('0x59')]={'user':_0x5b41f2[_0x66be('0x53')][_0x66be('0x5a')],'pass':_0x5b41f2[_0x66be('0x53')][_0x66be('0x5b')]};}}else{_0x40011d[_0x66be('0x5c')]=_0x5b41f2[_0x66be('0x53')][_0x66be('0x5c')];_0x40011d['auth']={'user':_0x5b41f2[_0x66be('0x53')]['user'],'pass':_0x5b41f2[_0x66be('0x53')][_0x66be('0x5b')]};_0x40011d[_0x66be('0x57')]=_0x5b41f2['Smtp'][_0x66be('0x57')];}if(_0x5c7da4[_0x66be('0x47')]['attachments']&&_0x5c7da4[_0x66be('0x47')][_0x66be('0x5d')][_0x66be('0x3a')]){for(var _0x170951=0x0;_0x170951<_0x5c7da4['body'][_0x66be('0x5d')][_0x66be('0x3a')];_0x170951+=0x1){_0x5c7da4[_0x66be('0x47')]['attachments'][_0x170951]={'filename':_0x5c7da4[_0x66be('0x47')]['attachments'][_0x170951][_0x66be('0x2c')],'path':path['join'](config[_0x66be('0x5e')],'server/files/attachments',_0x5c7da4[_0x66be('0x47')][_0x66be('0x5d')][_0x170951][_0x66be('0x5f')])};}}_0x3e5906={'account':_0x40011d,'message':_0x5c7da4[_0x66be('0x47')]};return;}})['then'](function(){if(_0x5b41f2[_0x66be('0x60')]){if(_0x5b41f2[_0x66be('0x60')][_0x66be('0x50')]['length']){return _0x5b41f2[_0x66be('0x60')][_0x66be('0x50')][0x0];}else{return db[_0x66be('0x61')][_0x66be('0x4b')](_[_0x66be('0xd')](_0x5c7da4[_0x66be('0x47')],{'firstName':_0x5c7da4[_0x66be('0x47')]['to'],'email':_0x5c7da4[_0x66be('0x47')]['to'],'phone':_0x5c7da4[_0x66be('0x47')]['to'],'ListId':_0x5b41f2[_0x66be('0x62')]}));}}else{throw new Error(_0x66be('0x63'));}})[_0x66be('0x28')](function(){if(_0x3e5906){return respondWithRpcPromise('SendMail',_0x66be('0x64'),_0x3e5906,client9003)[_0x66be('0x28')](function(_0x197412){return _0x2a6531[_0x66be('0x27')]({'read':!![],'messageId':_0x197412[_0x66be('0x65')],'sentAt':moment()['format'](_0x66be('0x66'))});})[_0x66be('0x1f')](function(_0x540d99){logger[_0x66be('0x1c')]('%s',JSON[_0x66be('0x1b')](_0x540d99));return _0x2a6531;});}return _0x2a6531;});}return _0x2a6531;}})[_0x66be('0x28')](respondWithResult(_0x3351fa,0xc9))[_0x66be('0x1f')](handleError(_0x3351fa,null));};exports[_0x66be('0x67')]=function(_0x518181,_0x529485){var _0x47ee83={'agent':{},'channel':_0x66be('0x68')};if(_0x518181[_0x66be('0x47')]['id']){delete _0x518181['body']['id'];}_0x518181[_0x66be('0x47')][_0x66be('0x69')]=!![];_0x518181[_0x66be('0x47')][_0x66be('0x6a')]=moment()['format'](_0x66be('0x66'));_0x518181[_0x66be('0x47')][_0x66be('0x6b')]=_0x518181[_0x66be('0x47')][_0x66be('0x6b')]||_0x518181[_0x66be('0x5a')]['id'];_0x47ee83['agent']['id']=_0x518181[_0x66be('0x47')][_0x66be('0x6b')];return db[_0x66be('0x2f')][_0x66be('0x48')]({'where':{'id':_0x518181[_0x66be('0x49')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x529485,null))[_0x66be('0x28')](saveUpdates(_0x518181['body'],null))[_0x66be('0x28')](function(_0x40efbd){if(_0x40efbd){_0x47ee83['message']=_0x40efbd[_0x66be('0x6c')]({'plain':!![]});return db['MailInteraction'][_0x66be('0x48')]({'where':{'id':_0x40efbd[_0x66be('0x6d')]}});}return null;})[_0x66be('0x28')](handleEntityNotFound(_0x529485,null))['then'](function(_0x3389eb){if(_0x3389eb){return _0x3389eb[_0x66be('0x27')]({'UserId':_0x518181[_0x66be('0x47')][_0x66be('0x6b')],'read1stAt':_[_0x66be('0x54')](_0x3389eb[_0x66be('0x6e')])?moment()[_0x66be('0x6f')](_0x66be('0x66')):undefined});}return null;})[_0x66be('0x28')](function(_0xa7fa05){if(_0xa7fa05){_0x47ee83[_0x66be('0x70')]=_0xa7fa05[_0x66be('0x6c')]({'plain':!![]});interaction_log['info'](_0x66be('0x71'),_0x518181[_0x66be('0x5a')]['id'],_0x518181['user'][_0x66be('0x2c')],_0x518181['user']['role'],_0x47ee83['interaction']['id'],_0x518181['body']?JSON['stringify'](_0x518181[_0x66be('0x47')]):'null');return respondWithRpcPromise(_0x66be('0x72'),_0x66be('0x73'),_0x47ee83);}return null;})[_0x66be('0x28')](function(_0x26f321){var _0x783a10=_0x66be('0x74')+_0x26f321[_0x66be('0x1d')][_0x66be('0x75')];return db[_0x66be('0x76')][_0x66be('0x34')](_0x783a10,{'type':db[_0x66be('0x77')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x39b9b1){return _0x39b9b1;});})['then'](function(_0x2c83b8){if(_0x2c83b8){_0x47ee83[_0x66be('0x1d')][_0x66be('0x78')]=_0x2c83b8[0x0];if(!_0x518181[_0x66be('0x47')][_0x66be('0x6b')])return;return db[_0x66be('0x79')]['find']({'where':{'id':_0x518181[_0x66be('0x47')][_0x66be('0x6b')],'role':_0x66be('0x7a')},'attributes':['id',_0x66be('0x2c'),_0x66be('0x7b'),_0x66be('0x7c'),_0x66be('0x7d')],'raw':!![]});}return null;})[_0x66be('0x28')](function(_0x4c8e7a){if(!_0x4c8e7a)return null;_0x47ee83['message']['agent']=_0x4c8e7a;return _0x47ee83;})['then'](function(_0x2a4418){if(_0x2a4418){if(_0x518181[_0x66be('0x47')][_0x66be('0x7e')]){_0x47ee83[_0x66be('0x1d')][_0x66be('0x7f')]=util['format'](_0x66be('0x80'),_0x518181[_0x66be('0x5a')]['name']);_0x47ee83[_0x66be('0x1d')][_0x66be('0x81')]=_0x47ee83[_0x66be('0x81')];_0x47ee83[_0x66be('0x1d')][_0x66be('0x82')]=_0x47ee83[_0x66be('0x81')];_0x47ee83[_0x66be('0x1d')][_0x66be('0x83')]=_0x66be('0x67');_0x47ee83['message']['body']=htmlToText[_0x66be('0x84')](_0x47ee83[_0x66be('0x1d')][_0x66be('0x47')]);return respondWithRpcPromise(_0x66be('0x85'),_0x66be('0x85'),{'event':_0x66be('0x86'),'message':_0x47ee83[_0x66be('0x1d')]},client9002)[_0x66be('0x28')](function(){return _0x47ee83;});}return _0x47ee83;}return null;})[_0x66be('0x28')](respondWithResult(_0x529485,null))[_0x66be('0x1f')](handleError(_0x529485,null));};exports['reject']=function(_0x46833f,_0x2de207){var _0x2860df={'agent':{},'channel':_0x66be('0x68')};if(_0x46833f[_0x66be('0x47')]['id']){delete _0x46833f[_0x66be('0x47')]['id'];}_0x46833f['body'][_0x66be('0x6b')]=_0x46833f[_0x66be('0x47')][_0x66be('0x6b')]||_0x46833f[_0x66be('0x5a')]['id'];_0x2860df[_0x66be('0x7a')]['id']=_0x46833f[_0x66be('0x47')][_0x66be('0x6b')];return db[_0x66be('0x2f')][_0x66be('0x48')]({'where':{'id':_0x46833f['params']['id'],'UserId':null}})[_0x66be('0x28')](handleEntityNotFound(_0x2de207,null))['then'](function(_0x2b6e1f){if(_0x2b6e1f){_0x2860df[_0x66be('0x1d')]=_0x2b6e1f[_0x66be('0x6c')]({'plain':!![]});return db[_0x66be('0x87')]['find']({'where':{'id':_0x2b6e1f[_0x66be('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x2de207,null))[_0x66be('0x28')](function(_0x143395){if(_0x143395){_0x2860df[_0x66be('0x70')]=_0x143395[_0x66be('0x6c')]({'plain':!![]});interaction_log[_0x66be('0x16')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x46833f[_0x66be('0x5a')]['id'],_0x46833f[_0x66be('0x5a')][_0x66be('0x2c')],_0x46833f[_0x66be('0x5a')][_0x66be('0x88')],_0x2860df[_0x66be('0x70')]['id'],_0x46833f['body']?JSON[_0x66be('0x1b')](_0x46833f[_0x66be('0x47')]):_0x66be('0x89'));return respondWithRpcPromise(_0x66be('0x8a'),_0x66be('0x8b'),_0x2860df);}return null;})[_0x66be('0x28')](function(_0x31f111){var _0x37b624=_0x66be('0x74')+_0x31f111[_0x66be('0x1d')][_0x66be('0x75')];return db['sequelize'][_0x66be('0x34')](_0x37b624,{'type':db['Sequelize'][_0x66be('0x8c')][_0x66be('0x8d')],'raw':!![]})[_0x66be('0x28')](function(_0x212371){return _0x212371;});})[_0x66be('0x28')](function(_0x25f9da){if(_0x25f9da){_0x2860df[_0x66be('0x1d')][_0x66be('0x78')]=_0x25f9da[0x0];if(!_0x46833f[_0x66be('0x47')][_0x66be('0x6b')])return;return db['User']['find']({'where':{'id':_0x46833f['body']['UserId'],'role':_0x66be('0x7a')},'attributes':['id',_0x66be('0x2c'),'fullname',_0x66be('0x7c'),_0x66be('0x7d')],'raw':!![]});}return null;})[_0x66be('0x28')](function(_0x4355f9){if(!_0x4355f9)return null;_0x2860df[_0x66be('0x1d')][_0x66be('0x7a')]=_0x4355f9;return _0x2860df;})[_0x66be('0x28')](function(_0xf9a3be){if(_0xf9a3be){_0xf9a3be[_0x66be('0x1d')][_0x66be('0x7f')]=util['format']('SIP/%s',_0x46833f[_0x66be('0x5a')][_0x66be('0x2c')]);_0xf9a3be['message'][_0x66be('0x81')]=_0x2860df[_0x66be('0x81')];_0xf9a3be[_0x66be('0x1d')][_0x66be('0x82')]=_0x2860df['channel'];_0xf9a3be[_0x66be('0x1d')][_0x66be('0x83')]=_0x66be('0x8e');_0xf9a3be[_0x66be('0x1d')][_0x66be('0x47')]=htmlToText[_0x66be('0x84')](_0x2860df[_0x66be('0x1d')][_0x66be('0x47')]);respondWithRpcPromise('EventManager',_0x66be('0x85'),{'event':'rejectmessage','message':_0xf9a3be[_0x66be('0x1d')]},client9002);return _0x2860df;}return null;})[_0x66be('0x28')](respondWithResult(_0x2de207,null))[_0x66be('0x1f')](handleError(_0x2de207,null));};exports[_0x66be('0x8f')]=function(_0x1b3cd2,_0x3dcd0f){var _0xf174d7=moment()['unix']()['toString']();var _0x1cbebc=path[_0x66be('0x90')](config[_0x66be('0x5e')],_0x66be('0x91'),_0x66be('0x92'),_0x66be('0x93'));var _0x388da9=path[_0x66be('0x90')](config[_0x66be('0x5e')],_0x66be('0x91'),_0x66be('0x92'),_0x66be('0x5d'));var _0x2b6086=util[_0x66be('0x6f')](_0x66be('0x94'),_0xf174d7);return db['MailMessage'][_0x66be('0x48')]({'where':{'id':_0x1b3cd2[_0x66be('0x49')]['id']},'attributes':['id',_0x66be('0x47'),_0x66be('0x95'),'to','cc','bcc',_0x66be('0x96'),_0x66be('0x97')],'include':_0x1b3cd2[_0x66be('0x34')][_0x66be('0x5d')]?[{'model':db[_0x66be('0x98')],'as':_0x66be('0x99')}]:undefined})[_0x66be('0x28')](handleEntityNotFound(_0x3dcd0f,null))['then'](function(_0x241fdb){if(_0x241fdb){var _0x4087fa=_0x241fdb;var _0x5997fa={'from':_0x4087fa[_0x66be('0x95')],'to':_0x4087fa['to'],'subject':_0x4087fa[_0x66be('0x96')],'html':htmlEntities[_0x66be('0x9a')](_0x4087fa[_0x66be('0x47')]),'headers':{'Date':moment(_0x4087fa[_0x66be('0x97')])[_0x66be('0x6f')](_0x66be('0x9b'))},'attachments':[]};if(_0x241fdb['cc']){_0x5997fa['headers']['Cc']=_0x241fdb['cc'];}if(_0x241fdb[_0x66be('0x9c')]){_0x5997fa['headers'][_0x66be('0x9d')]=_0x241fdb[_0x66be('0x9c')];}return new BPromise(function(_0x17b947,_0x39a20e){if(_0x241fdb['Attachments']){for(var _0x3ef59a=0x0;_0x3ef59a<_0x241fdb[_0x66be('0x99')][_0x66be('0x3a')];_0x3ef59a++){var _0x282d15=_0x241fdb[_0x66be('0x99')][_0x3ef59a];var _0x17b9a7=path[_0x66be('0x90')](_0x388da9,_0x282d15[_0x66be('0x5f')]);if(fs[_0x66be('0x9e')](_0x17b9a7)){_0x5997fa[_0x66be('0x5d')][_0x66be('0x9f')]({'name':_0x282d15['name'],'contentType':_0x282d15[_0x66be('0x31')],'data':fs[_0x66be('0xa0')](_0x17b9a7)});}}}emlformat[_0x66be('0xa1')](_0x5997fa,function(_0x4279bd,_0x1ab8ce){if(_0x4279bd)return _0x39a20e(_0x4279bd);fs[_0x66be('0xa2')](path[_0x66be('0x90')](_0x1cbebc,_0x2b6086),_0x1ab8ce);return _0x17b947(_0x1ab8ce);});});}})['then'](function(_0x506ba7){if(_0x506ba7){return _0x3dcd0f[_0x66be('0x8f')](path['join'](_0x1cbebc,_0x2b6086),_0x2b6086,function(_0x363149){if(!_0x363149)fs[_0x66be('0xa3')](path[_0x66be('0x90')](_0x1cbebc,_0x2b6086));});}})[_0x66be('0x1f')](handleError(_0x3dcd0f,null));}; \ No newline at end of file +var _0xb1c5=['Attachments','basename','push','readFileSync','build','eml-format','moment','bluebird','util','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','html-entities','./mailMessage.socket','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','name','send','index','MailMessage','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','options','includeAll','include','rows','params','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','attachments','join','root','server/files/attachments','List\x20not\x20found','SendMail','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','format','UserId','agent','get','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','contact','email','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','mail','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','fullname','internal','motionChannel','reject','rejectmessage','download','unix','toString','server','files','tmp','from','bcc','subject','createdAt','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc'];(function(_0x3aa2ea,_0xed17f1){var _0x197755=function(_0x39e0b5){while(--_0x39e0b5){_0x3aa2ea['push'](_0x3aa2ea['shift']());}};_0x197755(++_0xed17f1);}(_0xb1c5,0xa6));var _0x5b1c=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xb1c5[_0x25e7cb];return _0x375d92;};'use strict';var emlformat=require(_0x5b1c('0x0'));var moment=require(_0x5b1c('0x1'));var BPromise=require(_0x5b1c('0x2'));var util=require(_0x5b1c('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x5b1c('0x4'));var Redis=require(_0x5b1c('0x5'));var htmlToText=require(_0x5b1c('0x6'));var qs=require(_0x5b1c('0x7'));var logger=require(_0x5b1c('0x8'))(_0x5b1c('0x9'));var interaction_log=require(_0x5b1c('0x8'))(_0x5b1c('0xa'));var config=require(_0x5b1c('0xb'));var db=require('../../mysqldb')['db'];config[_0x5b1c('0xc')]=_[_0x5b1c('0xd')](config[_0x5b1c('0xc')],{'host':_0x5b1c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b1c('0xc')]));var htmlEntities=require(_0x5b1c('0xf'));require(_0x5b1c('0x10'))['register'](socket);var jayson=require(_0x5b1c('0x11'));var client=jayson[_0x5b1c('0x12')][_0x5b1c('0x13')]({'port':0x232c});var client9003=jayson['client']['http']({'port':0x232b});var client9002=jayson[_0x5b1c('0x12')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4394cf,_0x2ba4c2,_0x360f69,_0x80f479){return new BPromise(function(_0x3c310e,_0x40d998){var _0x18a079=_0x80f479||client;return _0x18a079[_0x5b1c('0x14')](_0x4394cf,_0x360f69)['then'](function(_0x322543){logger[_0x5b1c('0x15')](_0x5b1c('0x16'),_0x2ba4c2,_0x5b1c('0x17'));logger[_0x5b1c('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2ba4c2,_0x5b1c('0x17'),JSON[_0x5b1c('0x19')](_0x322543));if(_0x322543[_0x5b1c('0x1a')]){if(_0x322543[_0x5b1c('0x1a')][_0x5b1c('0x1b')]===0x1f4){logger[_0x5b1c('0x1a')](_0x5b1c('0x16'),_0x2ba4c2,_0x322543[_0x5b1c('0x1a')][_0x5b1c('0x1c')]);return _0x40d998(_0x322543[_0x5b1c('0x1a')][_0x5b1c('0x1c')]);}logger[_0x5b1c('0x1a')](_0x5b1c('0x16'),_0x2ba4c2,_0x322543['error'][_0x5b1c('0x1c')]);return _0x3c310e(_0x322543['error'][_0x5b1c('0x1c')]);}else{logger['info'](_0x5b1c('0x16'),_0x2ba4c2,_0x5b1c('0x17'));_0x3c310e(_0x322543[_0x5b1c('0x1d')][_0x5b1c('0x1c')]);}})[_0x5b1c('0x1e')](function(_0x5b5fc9){logger[_0x5b1c('0x1a')]('MailMessage,\x20%s,\x20%s',_0x2ba4c2,_0x5b5fc9);_0x40d998(_0x5b5fc9);});});}function respondWithResult(_0x4a4559,_0x267ed6){_0x267ed6=_0x267ed6||0xc8;return function(_0x14d855){if(_0x14d855){return _0x4a4559[_0x5b1c('0x1f')](_0x267ed6)[_0x5b1c('0x20')](_0x14d855);}};}function respondWithFilteredResult(_0x50e8b6,_0x5e7191){return function(_0x57f06c){if(_0x57f06c){var _0x3ad860=typeof _0x5e7191[_0x5b1c('0x21')]===_0x5b1c('0x22')&&typeof _0x5e7191[_0x5b1c('0x23')]==='undefined';var _0x5d2b9c=_0x57f06c['count'];var _0x2c525d=_0x3ad860?0x0:_0x5e7191[_0x5b1c('0x21')];var _0x1750ec=_0x3ad860?_0x57f06c[_0x5b1c('0x24')]:_0x5e7191[_0x5b1c('0x21')]+_0x5e7191[_0x5b1c('0x23')];var _0x4128f0;if(_0x1750ec>=_0x5d2b9c){_0x1750ec=_0x5d2b9c;_0x4128f0=0xc8;}else{_0x4128f0=0xce;}_0x50e8b6[_0x5b1c('0x1f')](_0x4128f0);return _0x50e8b6[_0x5b1c('0x25')](_0x5b1c('0x26'),_0x2c525d+'-'+_0x1750ec+'/'+_0x5d2b9c)[_0x5b1c('0x20')](_0x57f06c);}return null;};}function saveUpdates(_0x15104f){return function(_0xcd0e21){if(_0xcd0e21){return _0xcd0e21[_0x5b1c('0x27')](_0x15104f)[_0x5b1c('0x28')](function(_0x3a080a){return _0x3a080a;});}return null;};}function removeEntity(_0x39b839){return function(_0x524ab1){if(_0x524ab1){return _0x524ab1[_0x5b1c('0x29')]()[_0x5b1c('0x28')](function(){_0x39b839[_0x5b1c('0x1f')](0xcc)[_0x5b1c('0x2a')]();});}};}function handleEntityNotFound(_0x20576f){return function(_0x1d3f84){if(!_0x1d3f84){_0x20576f['sendStatus'](0x194);}return _0x1d3f84;};}function handleError(_0x5a134b,_0x5d6966){_0x5d6966=_0x5d6966||0x1f4;return function(_0x23eda2){logger[_0x5b1c('0x1a')](_0x23eda2['stack']);if(_0x23eda2[_0x5b1c('0x2b')]){delete _0x23eda2[_0x5b1c('0x2b')];}_0x5a134b[_0x5b1c('0x1f')](_0x5d6966)[_0x5b1c('0x2c')](_0x23eda2);};}exports[_0x5b1c('0x2d')]=function(_0x348191,_0x3cf8a3){var _0x5937a8={},_0x5a92c0={},_0xac627={'count':0x0,'rows':[]};var _0x50c0ff=_['map'](db[_0x5b1c('0x2e')][_0x5b1c('0x2f')],function(_0x40c83d){return{'name':_0x40c83d['fieldName'],'type':_0x40c83d['type'][_0x5b1c('0x30')]};});_0x5a92c0[_0x5b1c('0x31')]=_['map'](_0x50c0ff,_0x5b1c('0x2b'));_0x5a92c0[_0x5b1c('0x32')]=_[_0x5b1c('0x33')](_0x348191[_0x5b1c('0x32')]);_0x5a92c0[_0x5b1c('0x34')]=_[_0x5b1c('0x35')](_0x5a92c0[_0x5b1c('0x31')],_0x5a92c0[_0x5b1c('0x32')]);_0x5937a8['attributes']=_[_0x5b1c('0x35')](_0x5a92c0[_0x5b1c('0x31')],qs[_0x5b1c('0x36')](_0x348191['query']['fields']));_0x5937a8[_0x5b1c('0x37')]=_0x5937a8[_0x5b1c('0x37')][_0x5b1c('0x38')]?_0x5937a8[_0x5b1c('0x37')]:_0x5a92c0['model'];if(!_0x348191[_0x5b1c('0x32')][_0x5b1c('0x39')](_0x5b1c('0x3a'))){_0x5937a8[_0x5b1c('0x23')]=qs['limit'](_0x348191[_0x5b1c('0x32')][_0x5b1c('0x23')]);_0x5937a8[_0x5b1c('0x21')]=qs['offset'](_0x348191[_0x5b1c('0x32')][_0x5b1c('0x21')]);}_0x5937a8[_0x5b1c('0x3b')]=qs['sort'](_0x348191[_0x5b1c('0x32')][_0x5b1c('0x3c')]);_0x5937a8[_0x5b1c('0x3d')]=qs['filters'](_[_0x5b1c('0x3e')](_0x348191['query'],_0x5a92c0[_0x5b1c('0x34')]),_0x50c0ff);if(_0x348191['query'][_0x5b1c('0x3f')]){_0x5937a8['where']=_[_0x5b1c('0x40')](_0x5937a8[_0x5b1c('0x3d')],{'$or':_[_0x5b1c('0x41')](_0x50c0ff,function(_0x31c929){if(_0x31c929[_0x5b1c('0x42')]!=='VIRTUAL'){var _0x563b68={};_0x563b68[_0x31c929[_0x5b1c('0x2b')]]={'$like':'%'+_0x348191[_0x5b1c('0x32')][_0x5b1c('0x3f')]+'%'};return _0x563b68;}})});}_0x5937a8=_[_0x5b1c('0x40')]({},_0x5937a8,_0x348191[_0x5b1c('0x43')]);var _0x2c8858={'where':_0x5937a8['where']};return db[_0x5b1c('0x2e')]['count'](_0x2c8858)['then'](function(_0xb65fb){_0xac627[_0x5b1c('0x24')]=_0xb65fb;if(_0x348191[_0x5b1c('0x32')][_0x5b1c('0x44')]){_0x5937a8[_0x5b1c('0x45')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x5937a8);})[_0x5b1c('0x28')](function(_0x2fdd02){_0xac627[_0x5b1c('0x46')]=_0x2fdd02;return _0xac627;})[_0x5b1c('0x28')](respondWithFilteredResult(_0x3cf8a3,_0x5937a8))[_0x5b1c('0x1e')](handleError(_0x3cf8a3,null));};exports['show']=function(_0x51089e,_0x360d05){var _0x688edd={'raw':!![],'where':{'id':_0x51089e[_0x5b1c('0x47')]['id']}},_0x334815={};_0x334815[_0x5b1c('0x31')]=_[_0x5b1c('0x33')](db[_0x5b1c('0x2e')][_0x5b1c('0x2f')]);_0x334815['query']=_[_0x5b1c('0x33')](_0x51089e[_0x5b1c('0x32')]);_0x334815[_0x5b1c('0x34')]=_[_0x5b1c('0x35')](_0x334815[_0x5b1c('0x31')],_0x334815[_0x5b1c('0x32')]);_0x688edd['attributes']=_[_0x5b1c('0x35')](_0x334815['model'],qs[_0x5b1c('0x36')](_0x51089e[_0x5b1c('0x32')]['fields']));_0x688edd[_0x5b1c('0x37')]=_0x688edd['attributes'][_0x5b1c('0x38')]?_0x688edd[_0x5b1c('0x37')]:_0x334815['model'];if(_0x51089e[_0x5b1c('0x32')][_0x5b1c('0x44')]){_0x688edd[_0x5b1c('0x45')]=[{'all':!![]}];}_0x688edd=_[_0x5b1c('0x40')]({},_0x688edd,_0x51089e[_0x5b1c('0x43')]);return db[_0x5b1c('0x2e')][_0x5b1c('0x48')](_0x688edd)[_0x5b1c('0x28')](handleEntityNotFound(_0x360d05,null))[_0x5b1c('0x28')](respondWithResult(_0x360d05,null))['catch'](handleError(_0x360d05,null));};exports['update']=function(_0x24e825,_0x574ebb){if(_0x24e825[_0x5b1c('0x49')]['id']){delete _0x24e825[_0x5b1c('0x49')]['id'];}return db['MailMessage'][_0x5b1c('0x48')]({'where':{'id':_0x24e825[_0x5b1c('0x47')]['id']}})[_0x5b1c('0x28')](handleEntityNotFound(_0x574ebb,null))['then'](saveUpdates(_0x24e825['body'],null))[_0x5b1c('0x28')](respondWithResult(_0x574ebb,null))[_0x5b1c('0x1e')](handleError(_0x574ebb,null));};exports[_0x5b1c('0x29')]=function(_0x35529b,_0x4d54bb){return db[_0x5b1c('0x2e')]['find']({'where':{'id':_0x35529b['params']['id']}})[_0x5b1c('0x28')](handleEntityNotFound(_0x4d54bb,null))[_0x5b1c('0x28')](removeEntity(_0x4d54bb,null))[_0x5b1c('0x1e')](handleError(_0x4d54bb,null));};exports[_0x5b1c('0x4a')]=function(_0x1c8809,_0x1154de){return db['MailMessage'][_0x5b1c('0x4a')]()[_0x5b1c('0x28')](respondWithResult(_0x1154de,null))[_0x5b1c('0x1e')](handleError(_0x1154de,null));};exports[_0x5b1c('0x4b')]=function(_0x39b97d,_0x3252c1){return db[_0x5b1c('0x2e')]['create'](_0x39b97d[_0x5b1c('0x49')])[_0x5b1c('0x28')](function(_0x4fa868){if(_0x4fa868){if(_0x4fa868[_0x5b1c('0x4c')]===_0x5b1c('0x4d')&&!_0x4fa868[_0x5b1c('0x4e')]){var _0x539579,_0x2afaff,_0x252bf1;if(_0x39b97d[_0x5b1c('0x49')]['to']){_0x2afaff=_0x39b97d[_0x5b1c('0x49')]['to'][_0x5b1c('0x4f')](',')[0x0];}return db[_0x5b1c('0x50')][_0x5b1c('0x51')]({'where':{'id':_0x4fa868[_0x5b1c('0x52')]},'include':[{'model':db['CmList'],'as':_0x5b1c('0x53'),'include':[{'model':db[_0x5b1c('0x54')],'as':_0x5b1c('0x55'),'where':{'email':_0x2afaff},'limit':0x1,'order':[[_0x5b1c('0x56'),_0x5b1c('0x57')]]}]},{'model':db[_0x5b1c('0x58')],'as':_0x5b1c('0x59'),'raw':!![]}]})['then'](function(_0x122583){_0x539579=_0x122583;if(_0x539579&&_0x539579[_0x5b1c('0x59')]){var _0x569162={'tls':{'rejectUnauthorized':![]}};if(_[_0x5b1c('0x5a')](_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5b')])){_0x569162[_0x5b1c('0x5c')]=_0x539579['Smtp']['host'];_0x569162[_0x5b1c('0x5d')]=_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5d')];_0x569162[_0x5b1c('0x5e')]=_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5e')];if(_0x539579[_0x5b1c('0x59')]['authentication']){_0x569162[_0x5b1c('0x5f')]={'user':_0x539579[_0x5b1c('0x59')][_0x5b1c('0x60')],'pass':_0x539579[_0x5b1c('0x59')][_0x5b1c('0x61')]};}}else{_0x569162['service']=_0x539579[_0x5b1c('0x59')][_0x5b1c('0x5b')];_0x569162[_0x5b1c('0x5f')]={'user':_0x539579['Smtp'][_0x5b1c('0x60')],'pass':_0x539579[_0x5b1c('0x59')]['pass']};_0x569162[_0x5b1c('0x5e')]=_0x539579['Smtp'][_0x5b1c('0x5e')];}if(_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')]&&_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')][_0x5b1c('0x38')]){for(var _0xaaefda=0x0;_0xaaefda<_0x39b97d[_0x5b1c('0x49')]['attachments']['length'];_0xaaefda+=0x1){_0x39b97d['body'][_0x5b1c('0x62')][_0xaaefda]={'filename':_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')][_0xaaefda][_0x5b1c('0x2b')],'path':path[_0x5b1c('0x63')](config[_0x5b1c('0x64')],_0x5b1c('0x65'),_0x39b97d[_0x5b1c('0x49')][_0x5b1c('0x62')][_0xaaefda]['basename'])};}}_0x252bf1={'account':_0x569162,'message':_0x39b97d['body']};return;}})[_0x5b1c('0x28')](function(){if(_0x539579[_0x5b1c('0x53')]){if(_0x539579['List'][_0x5b1c('0x55')][_0x5b1c('0x38')]){return _0x539579['List'][_0x5b1c('0x55')][0x0];}else{return db['CmContact']['create'](_[_0x5b1c('0xd')](_0x39b97d[_0x5b1c('0x49')],{'firstName':_0x39b97d[_0x5b1c('0x49')]['to'],'email':_0x39b97d['body']['to'],'phone':_0x39b97d['body']['to'],'ListId':_0x539579['ListId']}));}}else{throw new Error(_0x5b1c('0x66'));}})[_0x5b1c('0x28')](function(){if(_0x252bf1){return respondWithRpcPromise(_0x5b1c('0x67'),'sendMail',_0x252bf1,client9003)[_0x5b1c('0x28')](function(_0x4435fe){return _0x4fa868['update']({'read':!![],'messageId':_0x4435fe['messageId'],'sentAt':moment()['format'](_0x5b1c('0x68'))});})['catch'](function(_0xf67389){logger['error']('%s',JSON[_0x5b1c('0x19')](_0xf67389));return _0x4fa868;});}return _0x4fa868;});}return _0x4fa868;}})[_0x5b1c('0x28')](respondWithResult(_0x3252c1,0xc9))[_0x5b1c('0x1e')](handleError(_0x3252c1,null));};exports[_0x5b1c('0x69')]=function(_0x566f2b,_0x207754){var _0x15679d={'agent':{},'channel':'mail'};if(_0x566f2b[_0x5b1c('0x49')]['id']){delete _0x566f2b[_0x5b1c('0x49')]['id'];}_0x566f2b[_0x5b1c('0x49')][_0x5b1c('0x6a')]=!![];_0x566f2b['body'][_0x5b1c('0x6b')]=moment()[_0x5b1c('0x6c')](_0x5b1c('0x68'));_0x566f2b['body'][_0x5b1c('0x6d')]=_0x566f2b[_0x5b1c('0x49')][_0x5b1c('0x6d')]||_0x566f2b['user']['id'];_0x15679d[_0x5b1c('0x6e')]['id']=_0x566f2b['body'][_0x5b1c('0x6d')];return db[_0x5b1c('0x2e')][_0x5b1c('0x48')]({'where':{'id':_0x566f2b[_0x5b1c('0x47')]['id'],'UserId':null}})[_0x5b1c('0x28')](handleEntityNotFound(_0x207754,null))[_0x5b1c('0x28')](saveUpdates(_0x566f2b[_0x5b1c('0x49')],null))[_0x5b1c('0x28')](function(_0x5d3ef9){if(_0x5d3ef9){_0x15679d['message']=_0x5d3ef9[_0x5b1c('0x6f')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x5d3ef9[_0x5b1c('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x207754,null))[_0x5b1c('0x28')](function(_0x270f04){if(_0x270f04){return _0x270f04[_0x5b1c('0x27')]({'UserId':_0x566f2b['body'][_0x5b1c('0x6d')],'read1stAt':_['isNil'](_0x270f04[_0x5b1c('0x71')])?moment()['format'](_0x5b1c('0x68')):undefined});}return null;})[_0x5b1c('0x28')](function(_0x2cbc8f){if(_0x2cbc8f){_0x15679d['interaction']=_0x2cbc8f['get']({'plain':!![]});interaction_log[_0x5b1c('0x15')](_0x5b1c('0x72'),_0x566f2b['user']['id'],_0x566f2b[_0x5b1c('0x60')][_0x5b1c('0x2b')],_0x566f2b[_0x5b1c('0x60')][_0x5b1c('0x73')],_0x15679d[_0x5b1c('0x74')]['id'],_0x566f2b[_0x5b1c('0x49')]?JSON['stringify'](_0x566f2b['body']):_0x5b1c('0x75'));return respondWithRpcPromise(_0x5b1c('0x76'),_0x5b1c('0x77'),_0x15679d);}return null;})[_0x5b1c('0x28')](function(_0x3ccc9d){var _0x430463='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ccc9d['message'][_0x5b1c('0x78')];return db[_0x5b1c('0x79')][_0x5b1c('0x32')](_0x430463,{'type':db['Sequelize'][_0x5b1c('0x7a')]['SELECT'],'raw':!![]})[_0x5b1c('0x28')](function(_0x22d686){return _0x22d686;});})[_0x5b1c('0x28')](function(_0x591b4a){if(_0x591b4a){_0x15679d[_0x5b1c('0x1c')][_0x5b1c('0x7b')]=_0x591b4a[0x0];if(!_0x566f2b[_0x5b1c('0x49')][_0x5b1c('0x6d')])return;return db['User'][_0x5b1c('0x48')]({'where':{'id':_0x566f2b['body']['UserId'],'role':_0x5b1c('0x6e')},'attributes':['id',_0x5b1c('0x2b'),'fullname',_0x5b1c('0x7c'),'internal'],'raw':!![]});}return null;})[_0x5b1c('0x28')](function(_0xef270c){if(!_0xef270c)return null;_0x15679d[_0x5b1c('0x1c')][_0x5b1c('0x6e')]=_0xef270c;return _0x15679d;})[_0x5b1c('0x28')](function(_0x36b238){if(_0x36b238){if(_0x566f2b['body']['manual']){_0x15679d['message'][_0x5b1c('0x7d')]=util[_0x5b1c('0x6c')](_0x5b1c('0x7e'),_0x566f2b['user'][_0x5b1c('0x2b')]);_0x15679d[_0x5b1c('0x1c')]['channel']=_0x15679d[_0x5b1c('0x7f')];_0x15679d[_0x5b1c('0x1c')]['motionChannel']=_0x15679d[_0x5b1c('0x7f')];_0x15679d[_0x5b1c('0x1c')][_0x5b1c('0x80')]=_0x5b1c('0x69');_0x15679d['message'][_0x5b1c('0x49')]=htmlToText[_0x5b1c('0x81')](_0x15679d['message']['body']);return respondWithRpcPromise(_0x5b1c('0x82'),_0x5b1c('0x82'),{'event':_0x5b1c('0x83'),'message':_0x15679d[_0x5b1c('0x1c')]},client9002)[_0x5b1c('0x28')](function(){return _0x15679d;});}return _0x15679d;}return null;})[_0x5b1c('0x28')](respondWithResult(_0x207754,null))[_0x5b1c('0x1e')](handleError(_0x207754,null));};exports['reject']=function(_0x3131af,_0x24ae78){var _0x504214={'agent':{},'channel':_0x5b1c('0x84')};if(_0x3131af[_0x5b1c('0x49')]['id']){delete _0x3131af[_0x5b1c('0x49')]['id'];}_0x3131af[_0x5b1c('0x49')][_0x5b1c('0x6d')]=_0x3131af[_0x5b1c('0x49')][_0x5b1c('0x6d')]||_0x3131af['user']['id'];_0x504214[_0x5b1c('0x6e')]['id']=_0x3131af[_0x5b1c('0x49')][_0x5b1c('0x6d')];return db['MailMessage'][_0x5b1c('0x48')]({'where':{'id':_0x3131af['params']['id'],'UserId':null}})[_0x5b1c('0x28')](handleEntityNotFound(_0x24ae78,null))['then'](function(_0x5ee332){if(_0x5ee332){_0x504214['message']=_0x5ee332[_0x5b1c('0x6f')]({'plain':!![]});return db[_0x5b1c('0x85')]['find']({'where':{'id':_0x5ee332[_0x5b1c('0x70')]}});}return null;})['then'](handleEntityNotFound(_0x24ae78,null))[_0x5b1c('0x28')](function(_0x735546){if(_0x735546){_0x504214[_0x5b1c('0x74')]=_0x735546[_0x5b1c('0x6f')]({'plain':!![]});interaction_log['info'](_0x5b1c('0x86'),_0x3131af[_0x5b1c('0x60')]['id'],_0x3131af['user'][_0x5b1c('0x2b')],_0x3131af[_0x5b1c('0x60')][_0x5b1c('0x73')],_0x504214['interaction']['id'],_0x3131af[_0x5b1c('0x49')]?JSON['stringify'](_0x3131af[_0x5b1c('0x49')]):_0x5b1c('0x75'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x504214);}return null;})[_0x5b1c('0x28')](function(_0x1abd32){var _0x44d3a8=_0x5b1c('0x87')+_0x1abd32[_0x5b1c('0x1c')]['ContactId'];return db[_0x5b1c('0x79')][_0x5b1c('0x32')](_0x44d3a8,{'type':db[_0x5b1c('0x88')][_0x5b1c('0x7a')][_0x5b1c('0x89')],'raw':!![]})[_0x5b1c('0x28')](function(_0x50dfeb){return _0x50dfeb;});})['then'](function(_0x4287ba){if(_0x4287ba){_0x504214['message'][_0x5b1c('0x7b')]=_0x4287ba[0x0];if(!_0x3131af['body'][_0x5b1c('0x6d')])return;return db['User'][_0x5b1c('0x48')]({'where':{'id':_0x3131af[_0x5b1c('0x49')]['UserId'],'role':_0x5b1c('0x6e')},'attributes':['id',_0x5b1c('0x2b'),_0x5b1c('0x8a'),'email',_0x5b1c('0x8b')],'raw':!![]});}return null;})[_0x5b1c('0x28')](function(_0x3fc443){if(!_0x3fc443)return null;_0x504214['message'][_0x5b1c('0x6e')]=_0x3fc443;return _0x504214;})['then'](function(_0x386a43){if(_0x386a43){_0x386a43[_0x5b1c('0x1c')]['interface']=util['format'](_0x5b1c('0x7e'),_0x3131af[_0x5b1c('0x60')][_0x5b1c('0x2b')]);_0x386a43[_0x5b1c('0x1c')][_0x5b1c('0x7f')]=_0x504214[_0x5b1c('0x7f')];_0x386a43[_0x5b1c('0x1c')][_0x5b1c('0x8c')]=_0x504214[_0x5b1c('0x7f')];_0x386a43['message'][_0x5b1c('0x80')]=_0x5b1c('0x8d');_0x386a43[_0x5b1c('0x1c')]['body']=htmlToText[_0x5b1c('0x81')](_0x504214[_0x5b1c('0x1c')][_0x5b1c('0x49')]);respondWithRpcPromise(_0x5b1c('0x82'),_0x5b1c('0x82'),{'event':_0x5b1c('0x8e'),'message':_0x386a43['message']},client9002);return _0x504214;}return null;})[_0x5b1c('0x28')](respondWithResult(_0x24ae78,null))['catch'](handleError(_0x24ae78,null));};exports[_0x5b1c('0x8f')]=function(_0x230480,_0x17362b){var _0x4f267a=moment()[_0x5b1c('0x90')]()[_0x5b1c('0x91')]();var _0x5cf33b=path[_0x5b1c('0x63')](config[_0x5b1c('0x64')],_0x5b1c('0x92'),_0x5b1c('0x93'),_0x5b1c('0x94'));var _0x24acc3=path[_0x5b1c('0x63')](config[_0x5b1c('0x64')],_0x5b1c('0x92'),_0x5b1c('0x93'),_0x5b1c('0x62'));var _0x25acf9=util[_0x5b1c('0x6c')]('message-%s.eml',_0x4f267a);return db[_0x5b1c('0x2e')][_0x5b1c('0x48')]({'where':{'id':_0x230480[_0x5b1c('0x47')]['id']},'attributes':['id','body',_0x5b1c('0x95'),'to','cc',_0x5b1c('0x96'),_0x5b1c('0x97'),_0x5b1c('0x98')],'include':_0x230480[_0x5b1c('0x32')][_0x5b1c('0x62')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x5b1c('0x28')](handleEntityNotFound(_0x17362b,null))[_0x5b1c('0x28')](function(_0x412030){if(_0x412030){var _0x34ec54=_0x412030;var _0x4687cb={'from':_0x34ec54[_0x5b1c('0x95')],'to':_0x34ec54['to'],'subject':_0x34ec54[_0x5b1c('0x97')],'html':htmlEntities[_0x5b1c('0x99')](_0x34ec54[_0x5b1c('0x49')]),'headers':{'Date':moment(_0x34ec54['createdAt'])['format'](_0x5b1c('0x9a'))},'attachments':[]};if(_0x412030['cc']){_0x4687cb['headers']['Cc']=_0x412030['cc'];}if(_0x412030[_0x5b1c('0x96')]){_0x4687cb['headers'][_0x5b1c('0x9b')]=_0x412030[_0x5b1c('0x96')];}return new BPromise(function(_0x2d05c6,_0xacf407){if(_0x412030[_0x5b1c('0x9c')]){for(var _0x97e27d=0x0;_0x97e27d<_0x412030[_0x5b1c('0x9c')][_0x5b1c('0x38')];_0x97e27d++){var _0x27fcbd=_0x412030[_0x5b1c('0x9c')][_0x97e27d];var _0x565fab=path[_0x5b1c('0x63')](_0x24acc3,_0x27fcbd[_0x5b1c('0x9d')]);if(fs['existsSync'](_0x565fab)){_0x4687cb[_0x5b1c('0x62')][_0x5b1c('0x9e')]({'name':_0x27fcbd[_0x5b1c('0x2b')],'contentType':_0x27fcbd[_0x5b1c('0x42')],'data':fs[_0x5b1c('0x9f')](_0x565fab)});}}}emlformat[_0x5b1c('0xa0')](_0x4687cb,function(_0x33ccaf,_0xfd14f5){if(_0x33ccaf)return _0xacf407(_0x33ccaf);fs['writeFileSync'](path[_0x5b1c('0x63')](_0x5cf33b,_0x25acf9),_0xfd14f5);return _0x2d05c6(_0xfd14f5);});});}})[_0x5b1c('0x28')](function(_0x7e7ad3){if(_0x7e7ad3){return _0x17362b['download'](path[_0x5b1c('0x63')](_0x5cf33b,_0x25acf9),_0x25acf9,function(_0x27b0e0){if(!_0x27b0e0)fs['unlinkSync'](path[_0x5b1c('0x63')](_0x5cf33b,_0x25acf9));});}})[_0x5b1c('0x1e')](handleError(_0x17362b,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index a818f19..dbe666c 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 _0x92e8=['hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','remove','emit'];(function(_0x39b118,_0x2bfacb){var _0x3cc8f2=function(_0x18abed){while(--_0x18abed){_0x39b118['push'](_0x39b118['shift']());}};_0x3cc8f2(++_0x2bfacb);}(_0x92e8,0x85));var _0x892e=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0x92e8[_0x5beda8];return _0x2aa042;};'use strict';var EventEmitter=require(_0x892e('0x0'));var MailMessage=require(_0x892e('0x1'))['db'][_0x892e('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x892e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x892e('0x4'),'afterDestroy':_0x892e('0x5')};function emitEvent(_0x54cfc9){return function(_0x1d6ccb,_0xcd828a,_0x298972){MailMessageEvents[_0x892e('0x6')](_0x54cfc9+':'+_0x1d6ccb['id'],_0x1d6ccb);MailMessageEvents['emit'](_0x54cfc9,_0x1d6ccb);_0x298972(null);};}for(var e in events){if(events[_0x892e('0x7')](e)){var event=events[e];MailMessage[_0x892e('0x8')](e,emitEvent(event));}}module[_0x892e('0x9')]=MailMessageEvents; \ No newline at end of file +var _0xa11b=['hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit'];(function(_0x4cc03b,_0x299f1c){var _0xf0358c=function(_0x3d0da8){while(--_0x3d0da8){_0x4cc03b['push'](_0x4cc03b['shift']());}};_0xf0358c(++_0x299f1c);}(_0xa11b,0x1bb));var _0xba11=function(_0x2e3756,_0x32670f){_0x2e3756=_0x2e3756-0x0;var _0x442861=_0xa11b[_0x2e3756];return _0x442861;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xba11('0x0'))['db'][_0xba11('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xba11('0x2')](0x0);var events={'afterCreate':_0xba11('0x3'),'afterUpdate':_0xba11('0x4'),'afterDestroy':_0xba11('0x5')};function emitEvent(_0x4d254e){return function(_0x3dc2fa,_0x1dd19d,_0x1bc8df){MailMessageEvents[_0xba11('0x6')](_0x4d254e+':'+_0x3dc2fa['id'],_0x3dc2fa);MailMessageEvents['emit'](_0x4d254e,_0x3dc2fa);_0x1bc8df(null);};}for(var e in events){if(events[_0xba11('0x7')](e)){var event=events[e];MailMessage[_0xba11('0x8')](e,emitEvent(event));}}module[_0xba11('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 42697dc..e05c580 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 _0xc777=['createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','html-to-text','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','body','fromString','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','update'];(function(_0xf915a7,_0x3c5104){var _0x714195=function(_0x1529cf){while(--_0x1529cf){_0xf915a7['push'](_0xf915a7['shift']());}};_0x714195(++_0x3c5104);}(_0xc777,0xb8));var _0x7c77=function(_0x3eebe0,_0x26f63f){_0x3eebe0=_0x3eebe0-0x0;var _0x1a942f=_0xc777[_0x3eebe0];return _0x1a942f;};'use strict';var _=require(_0x7c77('0x0'));var util=require(_0x7c77('0x1'));var logger=require(_0x7c77('0x2'))('api');var moment=require(_0x7c77('0x3'));var BPromise=require(_0x7c77('0x4'));var rp=require(_0x7c77('0x5'));var htmlToText=require(_0x7c77('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7c77('0x7'));var attributes=require(_0x7c77('0x8'));module['exports']=function(_0x5c412b,_0x1ef4b3){return _0x5c412b['define'](_0x7c77('0x9'),attributes,{'tableName':_0x7c77('0xa'),'paranoid':![],'indexes':[{'name':_0x7c77('0xb'),'fields':[_0x7c77('0xb')]},{'name':_0x7c77('0xc'),'fields':[_0x7c77('0xd'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x105c6c,_0x3d076a,_0x2744d3){if(_0x105c6c[_0x7c77('0xe')]){_0x105c6c['plainBody']=htmlToText[_0x7c77('0xf')](_0x105c6c[_0x7c77('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2744d3(null,_0x3d076a);},'afterCreate':function(_0x47763e,_0x5bcdd9,_0x10eb4a){var _0x3ebe00=_0x5c412b['models'];var _0xe88235=_0x47763e[_0x7c77('0x10')]({'plain':!![]});if(_0xe88235[_0x7c77('0x11')]['toLowerCase']()==='in'||_0xe88235[_0x7c77('0x11')][_0x7c77('0x12')]()===_0x7c77('0x13')&&!_0xe88235[_0x7c77('0x14')]&&!_['isNil'](_0xe88235[_0x7c77('0x15')])){_0x3ebe00[_0x7c77('0x16')][_0x7c77('0x17')]({'where':{'id':_0xe88235[_0x7c77('0x18')]}})['then'](function(_0x5214f1){if(_0x5214f1){_0x5214f1[_0x7c77('0x19')]({'lastMsgAt':_0xe88235[_0x7c77('0x1a')],'lastMsgDirection':_0xe88235[_0x7c77('0x11')][_0x7c77('0x12')]()});}})[_0x7c77('0x1b')](function(_0x14d4bd){console[_0x7c77('0x1c')](_0x14d4bd);});}_0x10eb4a();}},'charset':'utf8mb4','collate':_0x7c77('0x1d')});}; \ No newline at end of file +var _0x1b98=['UserId','MailInteraction','findOne','then','createdAt','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','direction','toLowerCase','out','secret'];(function(_0x820e1b,_0x2119c1){var _0x3f75f8=function(_0x555ec0){while(--_0x555ec0){_0x820e1b['push'](_0x820e1b['shift']());}};_0x3f75f8(++_0x2119c1);}(_0x1b98,0x16e));var _0x81b9=function(_0x2e9d3c,_0x34c14f){_0x2e9d3c=_0x2e9d3c-0x0;var _0x20ebc1=_0x1b98[_0x2e9d3c];return _0x20ebc1;};'use strict';var _=require('lodash');var util=require(_0x81b9('0x0'));var logger=require(_0x81b9('0x1'))(_0x81b9('0x2'));var moment=require(_0x81b9('0x3'));var BPromise=require(_0x81b9('0x4'));var rp=require(_0x81b9('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x81b9('0x6'));var rimraf=require('rimraf');var config=require(_0x81b9('0x7'));var attributes=require(_0x81b9('0x8'));module[_0x81b9('0x9')]=function(_0x314ee7,_0x6b8224){return _0x314ee7[_0x81b9('0xa')](_0x81b9('0xb'),attributes,{'tableName':_0x81b9('0xc'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x81b9('0xd')]},{'name':_0x81b9('0xe'),'fields':[_0x81b9('0xf'),_0x81b9('0x10')],'type':_0x81b9('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5f5d40,_0x4c737e,_0x47be58){if(_0x5f5d40[_0x81b9('0x12')]){_0x5f5d40['plainBody']=htmlToText['fromString'](_0x5f5d40[_0x81b9('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x47be58(null,_0x4c737e);},'afterCreate':function(_0xd56044,_0x3b16f6,_0x4626ba){var _0x5a8755=_0x314ee7[_0x81b9('0x13')];var _0x26f122=_0xd56044['get']({'plain':!![]});if(_0x26f122[_0x81b9('0x14')]['toLowerCase']()==='in'||_0x26f122['direction'][_0x81b9('0x15')]()===_0x81b9('0x16')&&!_0x26f122[_0x81b9('0x17')]&&!_['isNil'](_0x26f122[_0x81b9('0x18')])){_0x5a8755[_0x81b9('0x19')][_0x81b9('0x1a')]({'where':{'id':_0x26f122['MailInteractionId']}})[_0x81b9('0x1b')](function(_0x185703){if(_0x185703){_0x185703['update']({'lastMsgAt':_0x26f122[_0x81b9('0x1c')],'lastMsgDirection':_0x26f122[_0x81b9('0x14')][_0x81b9('0x15')]()});}})['catch'](function(_0x257fc7){console['error'](_0x257fc7);});}_0x4626ba();}},'charset':_0x81b9('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 f3a0cc3..4792372 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 _0x8952=['error','message','MailMessage,\x20%s,\x20%s','result','catch','create','body','options','raw','CreateMailMessage','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','then','info','request\x20sent','debug','stringify','code'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x8952,0x17e));var _0x2895=function(_0x186e2d,_0x1b93d7){_0x186e2d=_0x186e2d-0x0;var _0x38d87e=_0x8952[_0x186e2d];return _0x38d87e;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('MailMessage,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});}exports['CreateMailMessage']=function(_0x493851){var _0x442cfa=this;return new Promise(function(_0x12c2fb,_0x3ec4da){return db['MailMessage'][_0x2895('0x1a')](_0x493851[_0x2895('0x1b')],{'raw':_0x493851[_0x2895('0x1c')]?_0x493851[_0x2895('0x1c')][_0x2895('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x30c6c3){logger[_0x2895('0x10')]('CreateMailMessage',_0x493851);logger[_0x2895('0x12')](_0x2895('0x1e'),_0x493851,JSON[_0x2895('0x13')](_0x30c6c3));_0x12c2fb(_0x30c6c3);})['catch'](function(_0x4e884f){logger[_0x2895('0x15')](_0x2895('0x1e'),_0x4e884f[_0x2895('0x16')],_0x493851);_0x3ec4da(_0x442cfa['error'](0x1f4,_0x4e884f[_0x2895('0x16')]));});});}; \ No newline at end of file +var _0x0598=['CreateMailMessage','lodash','util','bluebird','../../mysqldb','../../config/utils','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','MailMessage','create','body','raw'];(function(_0x25ccbe,_0xc935c0){var _0x289529=function(_0x478776){while(--_0x478776){_0x25ccbe['push'](_0x25ccbe['shift']());}};_0x289529(++_0xc935c0);}(_0x0598,0x92));var _0x8059=function(_0x54b0a5,_0x14387f){_0x54b0a5=_0x54b0a5-0x0;var _0x3a9b71=_0x0598[_0x54b0a5];return _0x3a9b71;};'use strict';var _=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var moment=require('moment');var BPromise=require(_0x8059('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8059('0x3'))['db'];var utils=require(_0x8059('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8059('0x5'));var client=jayson[_0x8059('0x6')]['http']({'port':0x232a});config['redis']=_[_0x8059('0x7')](config[_0x8059('0x8')],{'host':_0x8059('0x9'),'port':0x18eb});var socket=require(_0x8059('0xa'))(new Redis(config['redis']));require('./mailMessage.socket')[_0x8059('0xb')](socket);function respondWithRpcPromise(_0x1bf5fd,_0x336f85,_0x5097d6){return new BPromise(function(_0x283b63,_0x52a60d){return client['request'](_0x1bf5fd,_0x5097d6)[_0x8059('0xc')](function(_0x4109a9){logger['info']('MailMessage,\x20%s,\x20%s',_0x336f85,'request\x20sent');logger[_0x8059('0xd')](_0x8059('0xe'),_0x336f85,_0x8059('0xf'),JSON[_0x8059('0x10')](_0x4109a9));if(_0x4109a9[_0x8059('0x11')]){if(_0x4109a9['error'][_0x8059('0x12')]===0x1f4){logger['error'](_0x8059('0x13'),_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x52a60d(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x336f85,_0x4109a9['error'][_0x8059('0x14')]);return _0x283b63(_0x4109a9[_0x8059('0x11')][_0x8059('0x14')]);}else{logger[_0x8059('0x15')](_0x8059('0x13'),_0x336f85,'request\x20sent');_0x283b63(_0x4109a9[_0x8059('0x16')][_0x8059('0x14')]);}})[_0x8059('0x17')](function(_0x1c4566){logger['error'](_0x8059('0x13'),_0x336f85,_0x1c4566);_0x52a60d(_0x1c4566);});});}exports['CreateMailMessage']=function(_0x113f42){var _0x493825=this;return new Promise(function(_0x1857c1,_0x56d794){return db[_0x8059('0x18')][_0x8059('0x19')](_0x113f42[_0x8059('0x1a')],{'raw':_0x113f42['options']?_0x113f42['options'][_0x8059('0x1b')]===undefined?!![]:![]:!![]})[_0x8059('0xc')](function(_0x32aeda){logger[_0x8059('0x15')]('CreateMailMessage',_0x113f42);logger[_0x8059('0xd')](_0x8059('0x1c'),_0x113f42,JSON[_0x8059('0x10')](_0x32aeda));_0x1857c1(_0x32aeda);})['catch'](function(_0xe9a72d){logger[_0x8059('0x11')](_0x8059('0x1c'),_0xe9a72d[_0x8059('0x14')],_0x113f42);_0x56d794(_0x493825['error'](0x1f4,_0xe9a72d[_0x8059('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 9d10926..487ff1a 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 _0xefbf=['mailMessage:','./mailMessage.events','save','emit','removeListener','length'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xefbf,0xa3));var _0xfefb=function(_0x1c2b7e,_0x3f942f){_0x1c2b7e=_0x1c2b7e-0x0;var _0x44223d=_0xefbf[_0x1c2b7e];return _0x44223d;};'use strict';var MailMessageEvents=require(_0xfefb('0x0'));var events=[_0xfefb('0x1'),'remove','update'];function createListener(_0x5f199d,_0x24d740){return function(_0x4589ac){_0x24d740[_0xfefb('0x2')](_0x5f199d,_0x4589ac);};}function removeListener(_0x36eb23,_0x79ca1d){return function(){MailMessageEvents[_0xfefb('0x3')](_0x36eb23,_0x79ca1d);};}exports['register']=function(_0xaac208){for(var _0x58c767=0x0,_0x7851d4=events[_0xfefb('0x4')];_0x58c767<_0x7851d4;_0x58c767++){var _0x5706f5=events[_0x58c767];var _0x18ffe2=createListener(_0xfefb('0x5')+_0x5706f5,_0xaac208);MailMessageEvents['on'](_0x5706f5,_0x18ffe2);}}; \ No newline at end of file +var _0x136c=['emit','removeListener','register','length','./mailMessage.events','save','update'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x136c,0x1d2));var _0xc136=function(_0x1648a6,_0x38e0f3){_0x1648a6=_0x1648a6-0x0;var _0x161a07=_0x136c[_0x1648a6];return _0x161a07;};'use strict';var MailMessageEvents=require(_0xc136('0x0'));var events=[_0xc136('0x1'),'remove',_0xc136('0x2')];function createListener(_0x3b4cbd,_0x34c789){return function(_0x15181c){_0x34c789[_0xc136('0x3')](_0x3b4cbd,_0x15181c);};}function removeListener(_0x9e2e9d,_0x19565a){return function(){MailMessageEvents[_0xc136('0x4')](_0x9e2e9d,_0x19565a);};}exports[_0xc136('0x5')]=function(_0x586570){for(var _0x1ac41b=0x0,_0x594112=events[_0xc136('0x6')];_0x1ac41b<_0x594112;_0x1ac41b++){var _0x3993f2=events[_0x1ac41b];var _0x1804c1=createListener('mailMessage:'+_0x3993f2,_0x586570);MailMessageEvents['on'](_0x3993f2,_0x1804c1);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 9d8572b..3558403 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 _0xdd0f=['/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailQueue.controller','get','/describe','/:id','isAuthenticated','show','/:id/members','/:id/teams','post','create','addTeams'];(function(_0x159690,_0x3cd945){var _0xb5dc5=function(_0xe2fc9d){while(--_0xe2fc9d){_0x159690['push'](_0x159690['shift']());}};_0xb5dc5(++_0x3cd945);}(_0xdd0f,0x71));var _0xfdd0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xdd0f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xfdd0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfdd0('0x1'));var router=express[_0xfdd0('0x2')]();var fs_extra=require(_0xfdd0('0x3'));var auth=require(_0xfdd0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xfdd0('0x5'));var controller=require(_0xfdd0('0x6'));router[_0xfdd0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfdd0('0x7')](_0xfdd0('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0xfdd0('0x7')](_0xfdd0('0x9'),auth[_0xfdd0('0xa')](),controller[_0xfdd0('0xb')]);router[_0xfdd0('0x7')](_0xfdd0('0xc'),auth[_0xfdd0('0xa')](),controller['getMembers']);router[_0xfdd0('0x7')](_0xfdd0('0xd'),auth[_0xfdd0('0xa')](),controller['getTeams']);router[_0xfdd0('0x7')]('/:id/users',auth[_0xfdd0('0xa')](),controller['getAgents']);router[_0xfdd0('0xe')]('/',auth['isAuthenticated'](),controller[_0xfdd0('0xf')]);router['post']('/:id/teams',auth[_0xfdd0('0xa')](),controller[_0xfdd0('0x10')]);router[_0xfdd0('0xe')](_0xfdd0('0x11'),auth['isAuthenticated'](),controller[_0xfdd0('0x12')]);router[_0xfdd0('0x13')]('/:id',auth[_0xfdd0('0xa')](),controller[_0xfdd0('0x14')]);router[_0xfdd0('0x15')]('/:id',auth[_0xfdd0('0xa')](),controller[_0xfdd0('0x16')]);router[_0xfdd0('0x15')](_0xfdd0('0xd'),auth[_0xfdd0('0xa')](),controller[_0xfdd0('0x17')]);router[_0xfdd0('0x15')]('/:id/users',auth[_0xfdd0('0xa')](),controller[_0xfdd0('0x18')]);module[_0xfdd0('0x19')]=router; \ No newline at end of file +var _0x0e3a=['post','addTeams','/:id/users','put','/:id','update','destroy','removeTeams','delete','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','getMembers','/:id/teams','getTeams','getAgents'];(function(_0x2b30fb,_0x33508d){var _0x3826e4=function(_0x34468f){while(--_0x34468f){_0x2b30fb['push'](_0x2b30fb['shift']());}};_0x3826e4(++_0x33508d);}(_0x0e3a,0x107));var _0xa0e3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0e3a[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xa0e3('0x0'));var util=require(_0xa0e3('0x1'));var path=require('path');var timeout=require(_0xa0e3('0x2'));var express=require('express');var router=express[_0xa0e3('0x3')]();var fs_extra=require(_0xa0e3('0x4'));var auth=require(_0xa0e3('0x5'));var interaction=require(_0xa0e3('0x6'));var config=require(_0xa0e3('0x7'));var controller=require('./mailQueue.controller');router[_0xa0e3('0x8')]('/',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xa')]);router[_0xa0e3('0x8')](_0xa0e3('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa0e3('0x8')]('/:id',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xc')]);router[_0xa0e3('0x8')]('/:id/members',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xd')]);router['get'](_0xa0e3('0xe'),auth[_0xa0e3('0x9')](),controller[_0xa0e3('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0xa0e3('0x10')]);router['post']('/',auth[_0xa0e3('0x9')](),controller['create']);router[_0xa0e3('0x11')]('/:id/teams',auth[_0xa0e3('0x9')](),controller[_0xa0e3('0x12')]);router[_0xa0e3('0x11')](_0xa0e3('0x13'),auth[_0xa0e3('0x9')](),controller['addAgents']);router[_0xa0e3('0x14')](_0xa0e3('0x15'),auth['isAuthenticated'](),controller[_0xa0e3('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa0e3('0x17')]);router['delete'](_0xa0e3('0xe'),auth[_0xa0e3('0x9')](),controller[_0xa0e3('0x18')]);router[_0xa0e3('0x19')]('/:id/users',auth['isAuthenticated'](),controller[_0xa0e3('0x1a')]);module[_0xa0e3('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index ae661ab..5ca868e 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 _0xb748=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xb748,0xdb));var _0x8b74=function(_0x3b7d06,_0x15a968){_0x3b7d06=_0x3b7d06-0x0;var _0x111352=_0xb748[_0x3b7d06];return _0x111352;};'use strict';var Sequelize=require('sequelize');module[_0x8b74('0x0')]={'name':{'type':Sequelize[_0x8b74('0x1')],'unique':_0x8b74('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8b74('0x1')]},'timeout':{'type':Sequelize[_0x8b74('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x8b74('0x4'),_0x8b74('0x5'),_0x8b74('0x6'))}}; \ No newline at end of file +var _0xed81=['ENUM','beepall','sequelize','STRING','name','INTEGER'];(function(_0x2480e0,_0x291db4){var _0x397756=function(_0x199868){while(--_0x199868){_0x2480e0['push'](_0x2480e0['shift']());}};_0x397756(++_0x291db4);}(_0xed81,0x194));var _0x1ed8=function(_0x1de10d,_0xd2d326){_0x1de10d=_0x1de10d-0x0;var _0x58c616=_0xed81[_0x1de10d];return _0x58c616;};'use strict';var Sequelize=require(_0x1ed8('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ed8('0x1')],'unique':_0x1ed8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1ed8('0x1')]},'timeout':{'type':Sequelize[_0x1ed8('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1ed8('0x4')]('rrmemory',_0x1ed8('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 510b7f3..b272540 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 _0x3822=['Content-Range','apply','reject','update','destroy','get','MailQueues','UserProfileResource','then','stack','name','send','rawAttributes','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','where','filter','MailQueue','includeAll','findAll','rows','catch','show','params','include','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','MailQueueId','User','findAndCountAll','agent','mailPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','voicePause','flatMap','sequelize','transaction','each','removeTeams','ids','Agents','select','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','all','union','forEach','emit','addAgents','omit','spread','removeAgents','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','offset','undefined','count','set'];(function(_0x2efe62,_0x303d5e){var _0x4f534f=function(_0x47c69b){while(--_0x47c69b){_0x2efe62['push'](_0x2efe62['shift']());}};_0x4f534f(++_0x303d5e);}(_0x3822,0x65));var _0x2382=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3822[_0x1928c9];return _0x51b5fb;};'use strict';var emlformat=require(_0x2382('0x0'));var rimraf=require(_0x2382('0x1'));var zipdir=require(_0x2382('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2382('0x3'));var Mustache=require(_0x2382('0x4'));var util=require(_0x2382('0x5'));var path=require(_0x2382('0x6'));var sox=require('sox');var csv=require(_0x2382('0x7'));var ejs=require(_0x2382('0x8'));var fs=require('fs');var fs_extra=require(_0x2382('0x9'));var _=require(_0x2382('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2382('0xb'));var toCsv=require(_0x2382('0x7'));var querystring=require('querystring');var Papa=require(_0x2382('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2382('0xd'));var hardwareService=require(_0x2382('0xe'));var logger=require(_0x2382('0xf'))('api');var utils=require(_0x2382('0x10'));var config=require(_0x2382('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x2382('0x12'))['db'];config[_0x2382('0x13')]=_['defaults'](config[_0x2382('0x13')],{'host':_0x2382('0x14'),'port':0x18eb});var socket=require(_0x2382('0x15'))(new Redis(config[_0x2382('0x13')]));require('./mailQueue.socket')[_0x2382('0x16')](socket);function respondWithStatusCode(_0x1ba57d,_0x12e67d){_0x12e67d=_0x12e67d||0xcc;return function(_0x5f31e4){if(_0x5f31e4){return _0x1ba57d['sendStatus'](_0x12e67d);}return _0x1ba57d[_0x2382('0x17')](_0x12e67d)[_0x2382('0x18')]();};}function respondWithResult(_0x884891,_0x525fa2){_0x525fa2=_0x525fa2||0xc8;return function(_0xe49e06){if(_0xe49e06){return _0x884891[_0x2382('0x17')](_0x525fa2)[_0x2382('0x19')](_0xe49e06);}};}function respondWithFilteredResult(_0x16ee2d,_0x41ed3c){return function(_0x14b793){if(_0x14b793){var _0xcc3f25=typeof _0x41ed3c[_0x2382('0x1a')]===_0x2382('0x1b')&&typeof _0x41ed3c['limit']===_0x2382('0x1b');var _0x1497a2=_0x14b793[_0x2382('0x1c')];var _0x376470=_0xcc3f25?0x0:_0x41ed3c[_0x2382('0x1a')];var _0x59b0d3=_0xcc3f25?_0x14b793['count']:_0x41ed3c[_0x2382('0x1a')]+_0x41ed3c['limit'];var _0x5958c6;if(_0x59b0d3>=_0x1497a2){_0x59b0d3=_0x1497a2;_0x5958c6=0xc8;}else{_0x5958c6=0xce;}_0x16ee2d[_0x2382('0x17')](_0x5958c6);return _0x16ee2d[_0x2382('0x1d')](_0x2382('0x1e'),_0x376470+'-'+_0x59b0d3+'/'+_0x1497a2)[_0x2382('0x19')](_0x14b793);}return null;};}function patchUpdates(_0xc4b2){return function(_0x22ee7b){try{jsonpatch[_0x2382('0x1f')](_0x22ee7b,_0xc4b2,!![]);}catch(_0x5f260c){return BPromise[_0x2382('0x20')](_0x5f260c);}return _0x22ee7b['save']();};}function saveUpdates(_0x3fd63a,_0x580a91){return function(_0xa8e1a6){if(_0xa8e1a6){return _0xa8e1a6[_0x2382('0x21')](_0x3fd63a)['then'](function(_0x196eeb){return _0x196eeb;});}return null;};}function removeEntity(_0x3009e0,_0x4cd540){return function(_0x1b0db8){if(_0x1b0db8){return _0x1b0db8[_0x2382('0x22')]()['then'](function(){var _0x421bef=_0x1b0db8[_0x2382('0x23')]({'plain':!![]});var _0x5bcd9b=_0x2382('0x24');return db[_0x2382('0x25')][_0x2382('0x22')]({'where':{'type':_0x5bcd9b,'resourceId':_0x421bef['id']}})[_0x2382('0x26')](function(){return _0x1b0db8;});})[_0x2382('0x26')](function(){_0x3009e0[_0x2382('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f2750,_0x3d89c4){return function(_0x513b0f){if(!_0x513b0f){_0x1f2750['sendStatus'](0x194);}return _0x513b0f;};}function handleError(_0x471707,_0x39c8d9){_0x39c8d9=_0x39c8d9||0x1f4;return function(_0x5bd84c){logger['error'](_0x5bd84c[_0x2382('0x27')]);if(_0x5bd84c[_0x2382('0x28')]){delete _0x5bd84c['name'];}_0x471707[_0x2382('0x17')](_0x39c8d9)[_0x2382('0x29')](_0x5bd84c);};}exports['index']=function(_0x492707,_0x3dac25){var _0xebd576={},_0x4200cb={},_0x3146bc={'count':0x0,'rows':[]};var _0x1d5a01=_['map'](db['MailQueue'][_0x2382('0x2a')],function(_0x26308c){return{'name':_0x26308c['fieldName'],'type':_0x26308c[_0x2382('0x2b')][_0x2382('0x2c')]};});_0x4200cb['model']=_[_0x2382('0x2d')](_0x1d5a01,'name');_0x4200cb[_0x2382('0x2e')]=_[_0x2382('0x2f')](_0x492707[_0x2382('0x2e')]);_0x4200cb['filters']=_[_0x2382('0x30')](_0x4200cb[_0x2382('0x31')],_0x4200cb[_0x2382('0x2e')]);_0xebd576[_0x2382('0x32')]=_['intersection'](_0x4200cb['model'],qs['fields'](_0x492707[_0x2382('0x2e')][_0x2382('0x33')]));_0xebd576[_0x2382('0x32')]=_0xebd576[_0x2382('0x32')][_0x2382('0x34')]?_0xebd576[_0x2382('0x32')]:_0x4200cb[_0x2382('0x31')];if(!_0x492707[_0x2382('0x2e')][_0x2382('0x35')]('nolimit')){_0xebd576[_0x2382('0x36')]=qs[_0x2382('0x36')](_0x492707[_0x2382('0x2e')]['limit']);_0xebd576['offset']=qs[_0x2382('0x1a')](_0x492707[_0x2382('0x2e')][_0x2382('0x1a')]);}_0xebd576[_0x2382('0x37')]=qs['sort'](_0x492707['query'][_0x2382('0x38')]);_0xebd576['where']=qs[_0x2382('0x39')](_[_0x2382('0x3a')](_0x492707[_0x2382('0x2e')],_0x4200cb['filters']),_0x1d5a01);if(_0x492707['query']['filter']){_0xebd576[_0x2382('0x3b')]=_['merge'](_0xebd576[_0x2382('0x3b')],{'$or':_[_0x2382('0x2d')](_0x1d5a01,function(_0x4642db){if(_0x4642db['type']!=='VIRTUAL'){var _0x30f79b={};_0x30f79b[_0x4642db[_0x2382('0x28')]]={'$like':'%'+_0x492707[_0x2382('0x2e')][_0x2382('0x3c')]+'%'};return _0x30f79b;}})});}_0xebd576=_['merge']({},_0xebd576,_0x492707['options']);var _0x348c15={'where':_0xebd576[_0x2382('0x3b')]};return db[_0x2382('0x3d')]['count'](_0x348c15)['then'](function(_0x6ccbb9){_0x3146bc['count']=_0x6ccbb9;if(_0x492707[_0x2382('0x2e')][_0x2382('0x3e')]){_0xebd576['include']=[{'all':!![]}];}return db[_0x2382('0x3d')][_0x2382('0x3f')](_0xebd576);})[_0x2382('0x26')](function(_0x3e0664){_0x3146bc[_0x2382('0x40')]=_0x3e0664;return _0x3146bc;})[_0x2382('0x26')](respondWithFilteredResult(_0x3dac25,_0xebd576))[_0x2382('0x41')](handleError(_0x3dac25,null));};exports[_0x2382('0x42')]=function(_0x308d77,_0x42d520){var _0x1b490d={'raw':!![],'where':{'id':_0x308d77[_0x2382('0x43')]['id']}},_0x4129bc={};_0x4129bc[_0x2382('0x31')]=_['keys'](db[_0x2382('0x3d')][_0x2382('0x2a')]);_0x4129bc[_0x2382('0x2e')]=_[_0x2382('0x2f')](_0x308d77[_0x2382('0x2e')]);_0x4129bc[_0x2382('0x39')]=_[_0x2382('0x30')](_0x4129bc[_0x2382('0x31')],_0x4129bc[_0x2382('0x2e')]);_0x1b490d[_0x2382('0x32')]=_[_0x2382('0x30')](_0x4129bc[_0x2382('0x31')],qs[_0x2382('0x33')](_0x308d77[_0x2382('0x2e')][_0x2382('0x33')]));_0x1b490d[_0x2382('0x32')]=_0x1b490d[_0x2382('0x32')][_0x2382('0x34')]?_0x1b490d[_0x2382('0x32')]:_0x4129bc['model'];if(_0x308d77['query'][_0x2382('0x3e')]){_0x1b490d[_0x2382('0x44')]=[{'all':!![]}];}_0x1b490d=_[_0x2382('0x45')]({},_0x1b490d,_0x308d77[_0x2382('0x46')]);return db['MailQueue']['find'](_0x1b490d)[_0x2382('0x26')](handleEntityNotFound(_0x42d520,null))['then'](respondWithResult(_0x42d520,null))[_0x2382('0x41')](handleError(_0x42d520,null));};exports[_0x2382('0x47')]=function(_0x30b58d,_0x203f92){return db[_0x2382('0x3d')][_0x2382('0x47')](_0x30b58d[_0x2382('0x48')],{})[_0x2382('0x26')](function(_0x131788){var _0x17d025=_0x30b58d[_0x2382('0x49')]['get']({'plain':!![]});if(!_0x17d025)throw new Error(_0x2382('0x4a'));if(_0x17d025[_0x2382('0x4b')]===_0x2382('0x49')){var _0x35b8a6=_0x131788[_0x2382('0x23')]({'plain':!![]});var _0x48750d='MailQueues';return db[_0x2382('0x4c')][_0x2382('0x4d')]({'where':{'name':_0x48750d,'userProfileId':_0x17d025[_0x2382('0x4e')]},'raw':!![]})[_0x2382('0x26')](function(_0x498b6e){if(_0x498b6e&&_0x498b6e['autoAssociation']===0x0){return db[_0x2382('0x25')][_0x2382('0x47')]({'name':_0x35b8a6[_0x2382('0x28')],'resourceId':_0x35b8a6['id'],'type':_0x498b6e['name'],'sectionId':_0x498b6e['id']},{})[_0x2382('0x26')](function(){return _0x131788;});}else{return _0x131788;}})['catch'](function(_0x36d320){logger['error'](_0x2382('0x4f'),_0x36d320);throw _0x36d320;});}return _0x131788;})[_0x2382('0x26')](respondWithResult(_0x203f92,0xc9))[_0x2382('0x41')](handleError(_0x203f92,null));};exports[_0x2382('0x21')]=function(_0x4c2d47,_0x10d5b1){if(_0x4c2d47[_0x2382('0x48')]['id']){delete _0x4c2d47[_0x2382('0x48')]['id'];}return db[_0x2382('0x3d')][_0x2382('0x4d')]({'where':{'id':_0x4c2d47[_0x2382('0x43')]['id']}})[_0x2382('0x26')](handleEntityNotFound(_0x10d5b1,null))['then'](saveUpdates(_0x4c2d47[_0x2382('0x48')],null))['then'](respondWithResult(_0x10d5b1,null))[_0x2382('0x41')](handleError(_0x10d5b1,null));};exports['destroy']=function(_0x36f738,_0x21720f){return db[_0x2382('0x3d')]['find']({'where':{'id':_0x36f738['params']['id']}})['then'](handleEntityNotFound(_0x21720f,null))['then'](removeEntity(_0x21720f,null))[_0x2382('0x41')](handleError(_0x21720f,null));};exports[_0x2382('0x50')]=function(_0xd90a44,_0x4a1ecb){return db[_0x2382('0x3d')]['describe']()[_0x2382('0x26')](respondWithResult(_0x4a1ecb,null))['catch'](handleError(_0x4a1ecb,null));};exports[_0x2382('0x51')]=function(_0x27d125,_0x44bedc,_0x1eaf31){var _0x4dd686={'raw':!![],'where':{}},_0x3ac444={},_0x1cdf86;return db[_0x2382('0x3d')][_0x2382('0x52')]({'where':{'id':_0x27d125[_0x2382('0x43')]['id']}})['then'](handleEntityNotFound(_0x44bedc,null))[_0x2382('0x26')](function(_0x1c31b0){if(_0x1c31b0){_0x1cdf86=_0x1c31b0[_0x2382('0x23')]({'plain':!![]});_0x3ac444[_0x2382('0x31')]=_[_0x2382('0x2f')](db[_0x2382('0x53')][_0x2382('0x2a')]);_0x3ac444[_0x2382('0x2e')]=_[_0x2382('0x2f')](_0x27d125[_0x2382('0x2e')]);_0x3ac444[_0x2382('0x39')]=_['intersection'](_0x3ac444[_0x2382('0x31')],_0x3ac444[_0x2382('0x2e')]);_0x4dd686[_0x2382('0x32')]=_['intersection'](_0x3ac444[_0x2382('0x31')],qs[_0x2382('0x33')](_0x27d125['query']['fields']));_0x4dd686['attributes']=_0x4dd686[_0x2382('0x32')][_0x2382('0x34')]?_0x4dd686['attributes']:_0x3ac444['model'];if(!_0x27d125['query'][_0x2382('0x35')](_0x2382('0x54'))){_0x4dd686[_0x2382('0x36')]=qs[_0x2382('0x36')](_0x27d125[_0x2382('0x2e')]['limit']);_0x4dd686['offset']=qs[_0x2382('0x1a')](_0x27d125['query']['offset']);}_0x4dd686[_0x2382('0x37')]=qs[_0x2382('0x38')](_0x27d125[_0x2382('0x2e')]['sort']);_0x4dd686[_0x2382('0x3b')]=qs['filters'](_[_0x2382('0x3a')](_0x27d125['query'],_0x3ac444[_0x2382('0x39')]));_0x4dd686['where'][_0x2382('0x55')]=_0x1c31b0['id'];if(_0x27d125[_0x2382('0x2e')][_0x2382('0x3c')]){_0x4dd686[_0x2382('0x3b')]=_[_0x2382('0x45')](_0x4dd686[_0x2382('0x3b')],{'$or':_[_0x2382('0x2d')](_0x4dd686['attributes'],function(_0x124c78){var _0x5c8873={};_0x5c8873[_0x124c78]={'$like':'%'+_0x27d125['query'][_0x2382('0x3c')]+'%'};return _0x5c8873;})});}_0x4dd686=_[_0x2382('0x45')]({},_0x4dd686,_0x27d125[_0x2382('0x46')]);return db[_0x2382('0x53')][_0x2382('0x3f')](_0x4dd686);}})[_0x2382('0x26')](function(_0x579e38){if(_0x579e38){return db[_0x2382('0x56')][_0x2382('0x57')]({'where':{'id':_[_0x2382('0x2d')](_0x579e38,'UserId'),'role':_0x2382('0x58')},'attributes':['id',_0x2382('0x28'),_0x2382('0x59'),'updatedAt',_0x2382('0x5a')]});}})[_0x2382('0x26')](function(_0x46bb87){if(_0x46bb87){return{'count':_0x46bb87[_0x2382('0x1c')],'rows':_[_0x2382('0x2d')](_0x46bb87[_0x2382('0x40')],function(_0xcd3b65){return{'membername':_0xcd3b65[_0x2382('0x28')],'UserId':_0xcd3b65['id'],'queue_name':_0x1cdf86['name'],'MailQueueId':_0x1cdf86['id'],'interface':util[_0x2382('0x5b')](_0x2382('0x5c'),_0x2382('0x5d'),_0xcd3b65['name']),'penalty':0x0,'paused':_0xcd3b65[_0x2382('0x59')],'createdAt':_0xcd3b65['createdAt'],'updatedAt':_0xcd3b65[_0x2382('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x44bedc,_0x4dd686))['catch'](handleError(_0x44bedc,null));};exports[_0x2382('0x5f')]=function(_0x26320e,_0x54891b,_0x5eabaa){var _0x59079d={};var _0x1a573f={};var _0x497f70;var _0x3600e1;return db[_0x2382('0x3d')][_0x2382('0x52')]({'where':{'id':_0x26320e[_0x2382('0x43')]['id']}})[_0x2382('0x26')](handleEntityNotFound(_0x54891b,null))['then'](function(_0x4ea6ac){if(_0x4ea6ac){_0x497f70=_0x4ea6ac;_0x1a573f[_0x2382('0x31')]=_[_0x2382('0x2f')](db[_0x2382('0x60')][_0x2382('0x2a')]);_0x1a573f[_0x2382('0x2e')]=_[_0x2382('0x2f')](_0x26320e[_0x2382('0x2e')]);_0x1a573f[_0x2382('0x39')]=_[_0x2382('0x30')](_0x1a573f[_0x2382('0x31')],_0x1a573f[_0x2382('0x2e')]);_0x59079d[_0x2382('0x32')]=_['intersection'](_0x1a573f[_0x2382('0x31')],qs[_0x2382('0x33')](_0x26320e['query'][_0x2382('0x33')]));_0x59079d[_0x2382('0x32')]=_0x59079d[_0x2382('0x32')][_0x2382('0x34')]?_0x59079d['attributes']:_0x1a573f[_0x2382('0x31')];_0x59079d[_0x2382('0x37')]=qs[_0x2382('0x38')](_0x26320e[_0x2382('0x2e')][_0x2382('0x38')]);_0x59079d[_0x2382('0x3b')]=qs['filters'](_[_0x2382('0x3a')](_0x26320e[_0x2382('0x2e')],_0x1a573f[_0x2382('0x39')]));if(_0x26320e[_0x2382('0x2e')][_0x2382('0x3c')]){_0x59079d['where']=_[_0x2382('0x45')](_0x59079d[_0x2382('0x3b')],{'$or':_[_0x2382('0x2d')](_0x59079d[_0x2382('0x32')],function(_0x28008b){var _0x69a17={};_0x69a17[_0x28008b]={'$like':'%'+_0x26320e[_0x2382('0x2e')][_0x2382('0x3c')]+'%'};return _0x69a17;})});}_0x59079d=_[_0x2382('0x45')]({},_0x59079d,_0x26320e[_0x2382('0x46')]);return _0x497f70[_0x2382('0x5f')](_0x59079d);}})[_0x2382('0x26')](function(_0x33f24f){if(_0x33f24f){_0x3600e1=_0x33f24f[_0x2382('0x34')];if(!_0x26320e['query'][_0x2382('0x35')]('nolimit')){_0x59079d[_0x2382('0x36')]=qs[_0x2382('0x36')](_0x26320e[_0x2382('0x2e')][_0x2382('0x36')]);_0x59079d['offset']=qs[_0x2382('0x1a')](_0x26320e[_0x2382('0x2e')][_0x2382('0x1a')]);}return _0x497f70[_0x2382('0x5f')](_0x59079d);}})[_0x2382('0x26')](function(_0x22344b){if(_0x22344b){return _0x22344b?{'count':_0x3600e1,'rows':_0x22344b}:null;}})[_0x2382('0x26')](respondWithResult(_0x54891b,null))[_0x2382('0x41')](handleError(_0x54891b,null));};exports[_0x2382('0x61')]=function(_0x5b65b5,_0x4effea,_0x301e81){var _0x2419db=_0x5b65b5[_0x2382('0x48')]['ids'];return db[_0x2382('0x60')][_0x2382('0x3f')]({'where':{'id':_0x2419db},'attributes':['id'],'include':[{'model':db[_0x2382('0x56')],'as':'Agents','attributes':['id',_0x2382('0x28'),'online',_0x2382('0x62'),'interface'],'raw':!![]}]})[_0x2382('0x26')](function(_0x128267){if(_0x128267){var _0x514eb9=_[_0x2382('0x63')](_0x128267,function(_0x2f76c7){var _0x300039=_0x2f76c7[_0x2382('0x23')]({'plain':!![]});return _0x300039['Agents'];});return db[_0x2382('0x3d')][_0x2382('0x4d')]({'where':{'id':_0x5b65b5[_0x2382('0x43')]['id']}})[_0x2382('0x26')](function(_0x5f236d){return db[_0x2382('0x64')][_0x2382('0x65')](function(_0xa14b8a){return _0x5f236d[_0x2382('0x61')](_0x2419db,{'transaction':_0xa14b8a})[_0x2382('0x26')](function(){return BPromise[_0x2382('0x66')](_0x514eb9,function(_0x1f3295){return db[_0x2382('0x53')]['findOrCreate']({'where':{'UserId':_0x1f3295['id'],'MailQueueId':_0x5b65b5[_0x2382('0x43')]['id']},'transaction':_0xa14b8a});});})[_0x2382('0x26')](function(){_0x514eb9['forEach'](function(_0x38fabd){socket['emit']('userMailQueue:save',{'UserId':_0x38fabd['id'],'MailQueueId':_0x5f236d['id']});});});});});}})[_0x2382('0x26')](respondWithStatusCode(_0x4effea,null))[_0x2382('0x41')](handleError(_0x4effea,null));};exports[_0x2382('0x67')]=function(_0x4c99c2,_0x9d7c57,_0x270cad){return db[_0x2382('0x60')][_0x2382('0x3f')]({'where':{'id':_0x4c99c2[_0x2382('0x2e')][_0x2382('0x68')]},'attributes':['id'],'include':[{'model':db[_0x2382('0x56')],'as':_0x2382('0x69'),'attributes':['id'],'raw':!![]}]})[_0x2382('0x26')](handleEntityNotFound(_0x9d7c57,null))[_0x2382('0x26')](function(_0x374fee){var _0x27a522=_[_0x2382('0x2d')](_0x374fee,'id');var _0x22086b=[];var _0x597fe6=[];var _0x3c02f3=squel[_0x2382('0x6a')]();_0x3c02f3[_0x2382('0x6b')]('tq.TeamId')[_0x2382('0x6c')](_0x2382('0x6d'),'tq')[_0x2382('0x6e')](_0x2382('0x6f'),'ut',_0x2382('0x70'))[_0x2382('0x3b')](_0x2382('0x71'),_0x4c99c2[_0x2382('0x43')]['id']);for(var _0x325203=0x0;_0x325203<_0x374fee['length'];_0x325203+=0x1){let _0x4f40da=_0x374fee[_0x325203];for(var _0x526366=0x0;_0x526366<_0x4f40da[_0x2382('0x69')]['length'];_0x526366+=0x1){let _0x3365b7=_0x4f40da[_0x2382('0x69')][_0x526366];var _0x5bd269=_0x3c02f3[_0x2382('0x72')]();_0x5bd269[_0x2382('0x3b')](_0x2382('0x73'),_0x3365b7['id']);_0x597fe6[_0x2382('0x74')](db['sequelize'][_0x2382('0x2e')](_0x5bd269['toString'](),{'type':db['sequelize'][_0x2382('0x75')][_0x2382('0x76')]})['then'](function(_0x3e935f){if(_0x3e935f['length']===0x1){return _0x3365b7['id'];}else{var _0x419558=_['every'](_[_0x2382('0x2d')](_0x3e935f,_0x2382('0x77')),function(_0xe08d86){return _['includes'](_0x27a522,_0xe08d86);});if(_0x419558){return _0x3365b7['id'];}}}));}}return BPromise[_0x2382('0x78')](_0x597fe6)['then'](function(_0x8c1ca5){_0x22086b=_(_0x22086b)[_0x2382('0x79')](_0x8c1ca5)['compact']()['value']();return db['MailQueue'][_0x2382('0x4d')]({'where':{'id':_0x4c99c2[_0x2382('0x43')]['id']}})['then'](function(_0x2cb645){return db[_0x2382('0x64')]['transaction'](function(_0x10c01d){return _0x2cb645[_0x2382('0x67')](_0x4c99c2['query'][_0x2382('0x68')],{'transaction':_0x10c01d})[_0x2382('0x26')](function(){if(!_['isEmpty'](_0x22086b)){return _0x2cb645['removeAgents'](_0x22086b,{'transaction':_0x10c01d});}})[_0x2382('0x26')](function(){_0x22086b[_0x2382('0x7a')](function(_0x2f3c99){socket[_0x2382('0x7b')]('userMailQueue:remove',{'UserId':_0x2f3c99,'MailQueueId':_0x2cb645['id']});});});});});});})[_0x2382('0x26')](respondWithStatusCode(_0x9d7c57,null))[_0x2382('0x41')](handleError(_0x9d7c57,null));};exports['addAgents']=function(_0x28ceda,_0x5563d9,_0x447990){return db[_0x2382('0x3d')]['find']({'where':{'id':_0x28ceda[_0x2382('0x43')]['id']}})['then'](handleEntityNotFound(_0x5563d9,null))[_0x2382('0x26')](function(_0x5e34a1){if(_0x5e34a1){return _0x5e34a1[_0x2382('0x7c')](_0x28ceda['body'][_0x2382('0x68')],_[_0x2382('0x7d')](_0x28ceda['body'],[_0x2382('0x68'),'id'])||{})[_0x2382('0x7e')](function(_0x274c55){for(var _0x34a1f8=0x0;_0x34a1f8<_0x28ceda[_0x2382('0x48')]['ids'][_0x2382('0x34')];_0x34a1f8+=0x1){socket[_0x2382('0x7b')]('userMailQueue:save',{'UserId':Number(_0x28ceda[_0x2382('0x48')][_0x2382('0x68')][_0x34a1f8]),'MailQueueId':Number(_0x28ceda['params']['id'])});}return _0x274c55;});}})[_0x2382('0x26')](respondWithResult(_0x5563d9,null))[_0x2382('0x41')](handleError(_0x5563d9,null));};exports[_0x2382('0x7f')]=function(_0x1f0cf8,_0x2ebe97,_0x26b6d3){return db[_0x2382('0x3d')][_0x2382('0x4d')]({'where':{'id':_0x1f0cf8[_0x2382('0x43')]['id']}})[_0x2382('0x26')](handleEntityNotFound(_0x2ebe97,null))[_0x2382('0x26')](function(_0x28db93){if(_0x28db93){return _0x28db93[_0x2382('0x7f')](_0x1f0cf8[_0x2382('0x2e')][_0x2382('0x68')])[_0x2382('0x26')](function(){if(_[_0x2382('0x80')](_0x1f0cf8['query'][_0x2382('0x68')])){for(var _0x43e8f5=0x0;_0x43e8f5<_0x1f0cf8[_0x2382('0x2e')][_0x2382('0x68')][_0x2382('0x34')];_0x43e8f5+=0x1){socket[_0x2382('0x7b')](_0x2382('0x81'),{'UserId':Number(_0x1f0cf8['query']['ids'][_0x43e8f5]),'MailQueueId':Number(_0x1f0cf8[_0x2382('0x43')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x1f0cf8[_0x2382('0x2e')][_0x2382('0x68')]),'MailQueueId':Number(_0x1f0cf8[_0x2382('0x43')]['id'])});}});}})[_0x2382('0x26')](respondWithStatusCode(_0x2ebe97,null))['catch'](handleError(_0x2ebe97,null));};exports[_0x2382('0x82')]=function(_0x5bc79d,_0x73a0c5,_0x3a8e0a){var _0x3f0418={};var _0x23300b={};var _0x48755b;var _0x558298;return db[_0x2382('0x3d')][_0x2382('0x52')]({'where':{'id':_0x5bc79d[_0x2382('0x43')]['id']}})[_0x2382('0x26')](handleEntityNotFound(_0x73a0c5,null))[_0x2382('0x26')](function(_0xf8b1f8){if(_0xf8b1f8){_0x48755b=_0xf8b1f8;_0x23300b[_0x2382('0x31')]=_[_0x2382('0x2f')](db[_0x2382('0x56')][_0x2382('0x2a')]);_0x23300b['query']=_[_0x2382('0x2f')](_0x5bc79d[_0x2382('0x2e')]);_0x23300b[_0x2382('0x39')]=_[_0x2382('0x30')](_0x23300b[_0x2382('0x31')],_0x23300b[_0x2382('0x2e')]);_0x3f0418[_0x2382('0x32')]=_[_0x2382('0x30')](_0x23300b[_0x2382('0x31')],qs[_0x2382('0x33')](_0x5bc79d['query']['fields']));_0x3f0418[_0x2382('0x32')]=_0x3f0418[_0x2382('0x32')][_0x2382('0x34')]?_0x3f0418['attributes']:_0x23300b[_0x2382('0x31')];_0x3f0418[_0x2382('0x37')]=qs[_0x2382('0x38')](_0x5bc79d['query'][_0x2382('0x38')]);_0x3f0418['where']=qs[_0x2382('0x39')](_[_0x2382('0x3a')](_0x5bc79d['query'],_0x23300b['filters']));if(_0x5bc79d['query']['filter']){_0x3f0418[_0x2382('0x3b')]=_['merge'](_0x3f0418['where'],{'$or':_[_0x2382('0x2d')](_0x3f0418[_0x2382('0x32')],function(_0x4c9898){var _0x54761c={};_0x54761c[_0x4c9898]={'$like':'%'+_0x5bc79d[_0x2382('0x2e')]['filter']+'%'};return _0x54761c;})});}_0x3f0418=_[_0x2382('0x45')]({},_0x3f0418,_0x5bc79d[_0x2382('0x46')]);return _0x48755b['getAgents'](_0x3f0418);}})[_0x2382('0x26')](function(_0x23a0db){if(_0x23a0db){_0x558298=_0x23a0db[_0x2382('0x34')];if(!_0x5bc79d[_0x2382('0x2e')][_0x2382('0x35')](_0x2382('0x54'))){_0x3f0418[_0x2382('0x36')]=qs[_0x2382('0x36')](_0x5bc79d['query'][_0x2382('0x36')]);_0x3f0418[_0x2382('0x1a')]=qs[_0x2382('0x1a')](_0x5bc79d[_0x2382('0x2e')][_0x2382('0x1a')]);}return _0x48755b['getAgents'](_0x3f0418);}})[_0x2382('0x26')](function(_0x56a8e1){if(_0x56a8e1){return _0x56a8e1?{'count':_0x558298,'rows':_0x56a8e1}:null;}})[_0x2382('0x26')](respondWithResult(_0x73a0c5,null))['catch'](handleError(_0x73a0c5,null));}; \ No newline at end of file +var _0xb05d=['params','rawAttributes','include','create','body','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','nolimit','pick','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','union','value','isEmpty','removeAgents','forEach','userMailQueue:remove','omit','spread','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','index','MailQueue','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show'];(function(_0x1dc591,_0x22643a){var _0x2d107b=function(_0x2acfbf){while(--_0x2acfbf){_0x1dc591['push'](_0x1dc591['shift']());}};_0x2d107b(++_0x22643a);}(_0xb05d,0x1d9));var _0xdb05=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0xb05d[_0x22b39b];return _0x280e1d;};'use strict';var emlformat=require(_0xdb05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb05('0x1'));var jsonpatch=require(_0xdb05('0x2'));var rp=require('request-promise');var moment=require(_0xdb05('0x3'));var BPromise=require(_0xdb05('0x4'));var Mustache=require(_0xdb05('0x5'));var util=require(_0xdb05('0x6'));var path=require(_0xdb05('0x7'));var sox=require(_0xdb05('0x8'));var csv=require(_0xdb05('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdb05('0xa'));var squel=require('squel');var crypto=require(_0xdb05('0xb'));var jsforce=require(_0xdb05('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdb05('0x9'));var querystring=require(_0xdb05('0xd'));var Papa=require('papaparse');var Redis=require(_0xdb05('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xdb05('0xf'));var as=require(_0xdb05('0x10'));var hardwareService=require(_0xdb05('0x11'));var logger=require(_0xdb05('0x12'))(_0xdb05('0x13'));var utils=require(_0xdb05('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdb05('0x15'))['db'];config['redis']=_['defaults'](config[_0xdb05('0x16')],{'host':_0xdb05('0x17'),'port':0x18eb});var socket=require(_0xdb05('0x18'))(new Redis(config[_0xdb05('0x16')]));require(_0xdb05('0x19'))['register'](socket);function respondWithStatusCode(_0x13f732,_0x17fa58){_0x17fa58=_0x17fa58||0xcc;return function(_0x27dd6e){if(_0x27dd6e){return _0x13f732[_0xdb05('0x1a')](_0x17fa58);}return _0x13f732[_0xdb05('0x1b')](_0x17fa58)[_0xdb05('0x1c')]();};}function respondWithResult(_0x341739,_0x53234b){_0x53234b=_0x53234b||0xc8;return function(_0x42b2cd){if(_0x42b2cd){return _0x341739['status'](_0x53234b)[_0xdb05('0x1d')](_0x42b2cd);}};}function respondWithFilteredResult(_0x5c1d22,_0x34399f){return function(_0x870eec){if(_0x870eec){var _0x805a5c=typeof _0x34399f[_0xdb05('0x1e')]===_0xdb05('0x1f')&&typeof _0x34399f[_0xdb05('0x20')]===_0xdb05('0x1f');var _0x1e64a1=_0x870eec[_0xdb05('0x21')];var _0x4a4e52=_0x805a5c?0x0:_0x34399f[_0xdb05('0x1e')];var _0x4189f9=_0x805a5c?_0x870eec[_0xdb05('0x21')]:_0x34399f[_0xdb05('0x1e')]+_0x34399f[_0xdb05('0x20')];var _0x211248;if(_0x4189f9>=_0x1e64a1){_0x4189f9=_0x1e64a1;_0x211248=0xc8;}else{_0x211248=0xce;}_0x5c1d22[_0xdb05('0x1b')](_0x211248);return _0x5c1d22[_0xdb05('0x22')](_0xdb05('0x23'),_0x4a4e52+'-'+_0x4189f9+'/'+_0x1e64a1)[_0xdb05('0x1d')](_0x870eec);}return null;};}function patchUpdates(_0x9dea2c){return function(_0x52e6ef){try{jsonpatch[_0xdb05('0x24')](_0x52e6ef,_0x9dea2c,!![]);}catch(_0x5f4b0c){return BPromise['reject'](_0x5f4b0c);}return _0x52e6ef[_0xdb05('0x25')]();};}function saveUpdates(_0x53786d,_0x1664c6){return function(_0x12b7f3){if(_0x12b7f3){return _0x12b7f3[_0xdb05('0x26')](_0x53786d)[_0xdb05('0x27')](function(_0x35c67e){return _0x35c67e;});}return null;};}function removeEntity(_0x385ac2,_0x4fe53a){return function(_0x5a1a73){if(_0x5a1a73){return _0x5a1a73[_0xdb05('0x28')]()[_0xdb05('0x27')](function(){var _0x37d1f7=_0x5a1a73['get']({'plain':!![]});var _0x5a4936=_0xdb05('0x29');return db[_0xdb05('0x2a')]['destroy']({'where':{'type':_0x5a4936,'resourceId':_0x37d1f7['id']}})[_0xdb05('0x27')](function(){return _0x5a1a73;});})[_0xdb05('0x27')](function(){_0x385ac2[_0xdb05('0x1b')](0xcc)[_0xdb05('0x1c')]();});}};}function handleEntityNotFound(_0x22666e,_0x1454f9){return function(_0x31755d){if(!_0x31755d){_0x22666e[_0xdb05('0x1a')](0x194);}return _0x31755d;};}function handleError(_0x256005,_0x31bd49){_0x31bd49=_0x31bd49||0x1f4;return function(_0x2fa3c5){logger[_0xdb05('0x2b')](_0x2fa3c5[_0xdb05('0x2c')]);if(_0x2fa3c5[_0xdb05('0x2d')]){delete _0x2fa3c5[_0xdb05('0x2d')];}_0x256005[_0xdb05('0x1b')](_0x31bd49)['send'](_0x2fa3c5);};}exports[_0xdb05('0x2e')]=function(_0x2c9398,_0x5f234){var _0xe32c67={},_0x5e0311={},_0x5d8c67={'count':0x0,'rows':[]};var _0x428908=_['map'](db[_0xdb05('0x2f')]['rawAttributes'],function(_0x387b23){return{'name':_0x387b23['fieldName'],'type':_0x387b23['type']['key']};});_0x5e0311['model']=_[_0xdb05('0x30')](_0x428908,_0xdb05('0x2d'));_0x5e0311[_0xdb05('0x31')]=_[_0xdb05('0x32')](_0x2c9398['query']);_0x5e0311[_0xdb05('0x33')]=_['intersection'](_0x5e0311[_0xdb05('0x34')],_0x5e0311[_0xdb05('0x31')]);_0xe32c67[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x5e0311[_0xdb05('0x34')],qs[_0xdb05('0x37')](_0x2c9398[_0xdb05('0x31')]['fields']));_0xe32c67['attributes']=_0xe32c67[_0xdb05('0x35')][_0xdb05('0x38')]?_0xe32c67[_0xdb05('0x35')]:_0x5e0311[_0xdb05('0x34')];if(!_0x2c9398[_0xdb05('0x31')][_0xdb05('0x39')]('nolimit')){_0xe32c67[_0xdb05('0x20')]=qs[_0xdb05('0x20')](_0x2c9398[_0xdb05('0x31')]['limit']);_0xe32c67[_0xdb05('0x1e')]=qs[_0xdb05('0x1e')](_0x2c9398['query'][_0xdb05('0x1e')]);}_0xe32c67[_0xdb05('0x3a')]=qs[_0xdb05('0x3b')](_0x2c9398[_0xdb05('0x31')]['sort']);_0xe32c67[_0xdb05('0x3c')]=qs[_0xdb05('0x33')](_['pick'](_0x2c9398['query'],_0x5e0311[_0xdb05('0x33')]),_0x428908);if(_0x2c9398['query'][_0xdb05('0x3d')]){_0xe32c67[_0xdb05('0x3c')]=_[_0xdb05('0x3e')](_0xe32c67[_0xdb05('0x3c')],{'$or':_[_0xdb05('0x30')](_0x428908,function(_0x137ac2){if(_0x137ac2[_0xdb05('0x3f')]!==_0xdb05('0x40')){var _0x4011c3={};_0x4011c3[_0x137ac2['name']]={'$like':'%'+_0x2c9398[_0xdb05('0x31')][_0xdb05('0x3d')]+'%'};return _0x4011c3;}})});}_0xe32c67=_[_0xdb05('0x3e')]({},_0xe32c67,_0x2c9398[_0xdb05('0x41')]);var _0x21b52d={'where':_0xe32c67[_0xdb05('0x3c')]};return db[_0xdb05('0x2f')]['count'](_0x21b52d)[_0xdb05('0x27')](function(_0x4082bd){_0x5d8c67[_0xdb05('0x21')]=_0x4082bd;if(_0x2c9398[_0xdb05('0x31')][_0xdb05('0x42')]){_0xe32c67['include']=[{'all':!![]}];}return db['MailQueue'][_0xdb05('0x43')](_0xe32c67);})[_0xdb05('0x27')](function(_0x48a7d8){_0x5d8c67[_0xdb05('0x44')]=_0x48a7d8;return _0x5d8c67;})[_0xdb05('0x27')](respondWithFilteredResult(_0x5f234,_0xe32c67))[_0xdb05('0x45')](handleError(_0x5f234,null));};exports[_0xdb05('0x46')]=function(_0x551b20,_0x8d421f){var _0x522b4f={'raw':!![],'where':{'id':_0x551b20[_0xdb05('0x47')]['id']}},_0x7c970e={};_0x7c970e['model']=_['keys'](db[_0xdb05('0x2f')][_0xdb05('0x48')]);_0x7c970e[_0xdb05('0x31')]=_[_0xdb05('0x32')](_0x551b20[_0xdb05('0x31')]);_0x7c970e['filters']=_[_0xdb05('0x36')](_0x7c970e['model'],_0x7c970e[_0xdb05('0x31')]);_0x522b4f[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x7c970e['model'],qs['fields'](_0x551b20[_0xdb05('0x31')][_0xdb05('0x37')]));_0x522b4f['attributes']=_0x522b4f[_0xdb05('0x35')][_0xdb05('0x38')]?_0x522b4f[_0xdb05('0x35')]:_0x7c970e[_0xdb05('0x34')];if(_0x551b20[_0xdb05('0x31')][_0xdb05('0x42')]){_0x522b4f[_0xdb05('0x49')]=[{'all':!![]}];}_0x522b4f=_[_0xdb05('0x3e')]({},_0x522b4f,_0x551b20['options']);return db['MailQueue']['find'](_0x522b4f)[_0xdb05('0x27')](handleEntityNotFound(_0x8d421f,null))[_0xdb05('0x27')](respondWithResult(_0x8d421f,null))[_0xdb05('0x45')](handleError(_0x8d421f,null));};exports[_0xdb05('0x4a')]=function(_0x1b878f,_0x333d1f){return db[_0xdb05('0x2f')][_0xdb05('0x4a')](_0x1b878f[_0xdb05('0x4b')],{})[_0xdb05('0x27')](function(_0x370f8f){var _0x17f21=_0x1b878f['user'][_0xdb05('0x4c')]({'plain':!![]});if(!_0x17f21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x17f21[_0xdb05('0x4d')]==='user'){var _0x43b671=_0x370f8f[_0xdb05('0x4c')]({'plain':!![]});var _0x41630d=_0xdb05('0x29');return db[_0xdb05('0x4e')][_0xdb05('0x4f')]({'where':{'name':_0x41630d,'userProfileId':_0x17f21[_0xdb05('0x50')]},'raw':!![]})[_0xdb05('0x27')](function(_0x385554){if(_0x385554&&_0x385554[_0xdb05('0x51')]===0x0){return db['UserProfileResource'][_0xdb05('0x4a')]({'name':_0x43b671['name'],'resourceId':_0x43b671['id'],'type':_0x385554[_0xdb05('0x2d')],'sectionId':_0x385554['id']},{})[_0xdb05('0x27')](function(){return _0x370f8f;});}else{return _0x370f8f;}})['catch'](function(_0x371620){logger[_0xdb05('0x2b')](_0xdb05('0x52'),_0x371620);throw _0x371620;});}return _0x370f8f;})[_0xdb05('0x27')](respondWithResult(_0x333d1f,0xc9))[_0xdb05('0x45')](handleError(_0x333d1f,null));};exports[_0xdb05('0x26')]=function(_0x163d62,_0x384bc8){if(_0x163d62[_0xdb05('0x4b')]['id']){delete _0x163d62[_0xdb05('0x4b')]['id'];}return db['MailQueue'][_0xdb05('0x4f')]({'where':{'id':_0x163d62[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x384bc8,null))['then'](saveUpdates(_0x163d62[_0xdb05('0x4b')],null))[_0xdb05('0x27')](respondWithResult(_0x384bc8,null))[_0xdb05('0x45')](handleError(_0x384bc8,null));};exports[_0xdb05('0x28')]=function(_0x5457aa,_0x35fef8){return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x5457aa[_0xdb05('0x47')]['id']}})['then'](handleEntityNotFound(_0x35fef8,null))['then'](removeEntity(_0x35fef8,null))[_0xdb05('0x45')](handleError(_0x35fef8,null));};exports[_0xdb05('0x53')]=function(_0x4cb84d,_0x228149){return db[_0xdb05('0x2f')][_0xdb05('0x53')]()[_0xdb05('0x27')](respondWithResult(_0x228149,null))[_0xdb05('0x45')](handleError(_0x228149,null));};exports[_0xdb05('0x54')]=function(_0x4fac2b,_0x44f0a1,_0x5726e0){var _0x447218={'raw':!![],'where':{}},_0x5c0b06={},_0x3179b4;return db[_0xdb05('0x2f')]['findOne']({'where':{'id':_0x4fac2b[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x44f0a1,null))['then'](function(_0x4b1ea0){if(_0x4b1ea0){_0x3179b4=_0x4b1ea0[_0xdb05('0x4c')]({'plain':!![]});_0x5c0b06[_0xdb05('0x34')]=_[_0xdb05('0x32')](db['UserMailQueue'][_0xdb05('0x48')]);_0x5c0b06[_0xdb05('0x31')]=_['keys'](_0x4fac2b[_0xdb05('0x31')]);_0x5c0b06['filters']=_[_0xdb05('0x36')](_0x5c0b06[_0xdb05('0x34')],_0x5c0b06['query']);_0x447218[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x5c0b06[_0xdb05('0x34')],qs['fields'](_0x4fac2b['query']['fields']));_0x447218[_0xdb05('0x35')]=_0x447218['attributes']['length']?_0x447218[_0xdb05('0x35')]:_0x5c0b06['model'];if(!_0x4fac2b['query']['hasOwnProperty'](_0xdb05('0x55'))){_0x447218[_0xdb05('0x20')]=qs[_0xdb05('0x20')](_0x4fac2b['query'][_0xdb05('0x20')]);_0x447218['offset']=qs[_0xdb05('0x1e')](_0x4fac2b[_0xdb05('0x31')][_0xdb05('0x1e')]);}_0x447218['order']=qs[_0xdb05('0x3b')](_0x4fac2b[_0xdb05('0x31')][_0xdb05('0x3b')]);_0x447218[_0xdb05('0x3c')]=qs[_0xdb05('0x33')](_[_0xdb05('0x56')](_0x4fac2b[_0xdb05('0x31')],_0x5c0b06[_0xdb05('0x33')]));_0x447218['where'][_0xdb05('0x57')]=_0x4b1ea0['id'];if(_0x4fac2b[_0xdb05('0x31')][_0xdb05('0x3d')]){_0x447218[_0xdb05('0x3c')]=_[_0xdb05('0x3e')](_0x447218['where'],{'$or':_[_0xdb05('0x30')](_0x447218['attributes'],function(_0x5f1ca1){var _0x1f6e55={};_0x1f6e55[_0x5f1ca1]={'$like':'%'+_0x4fac2b['query'][_0xdb05('0x3d')]+'%'};return _0x1f6e55;})});}_0x447218=_[_0xdb05('0x3e')]({},_0x447218,_0x4fac2b['options']);return db[_0xdb05('0x58')][_0xdb05('0x43')](_0x447218);}})[_0xdb05('0x27')](function(_0x26083c){if(_0x26083c){return db[_0xdb05('0x59')][_0xdb05('0x5a')]({'where':{'id':_['map'](_0x26083c,_0xdb05('0x5b')),'role':_0xdb05('0x5c')},'attributes':['id',_0xdb05('0x2d'),'mailPause','updatedAt',_0xdb05('0x5d')]});}})[_0xdb05('0x27')](function(_0x34593e){if(_0x34593e){return{'count':_0x34593e['count'],'rows':_[_0xdb05('0x30')](_0x34593e['rows'],function(_0x2079c8){return{'membername':_0x2079c8['name'],'UserId':_0x2079c8['id'],'queue_name':_0x3179b4[_0xdb05('0x2d')],'MailQueueId':_0x3179b4['id'],'interface':util[_0xdb05('0x5e')](_0xdb05('0x5f'),_0xdb05('0x60'),_0x2079c8[_0xdb05('0x2d')]),'penalty':0x0,'paused':_0x2079c8['mailPause'],'createdAt':_0x2079c8[_0xdb05('0x5d')],'updatedAt':_0x2079c8[_0xdb05('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdb05('0x27')](respondWithFilteredResult(_0x44f0a1,_0x447218))[_0xdb05('0x45')](handleError(_0x44f0a1,null));};exports[_0xdb05('0x62')]=function(_0x5a56cc,_0x2609b6,_0x50bece){var _0x4f04ef={};var _0x5ec74a={};var _0x33a616;var _0x5a553d;return db[_0xdb05('0x2f')][_0xdb05('0x63')]({'where':{'id':_0x5a56cc[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x2609b6,null))['then'](function(_0x942173){if(_0x942173){_0x33a616=_0x942173;_0x5ec74a[_0xdb05('0x34')]=_[_0xdb05('0x32')](db[_0xdb05('0x64')][_0xdb05('0x48')]);_0x5ec74a[_0xdb05('0x31')]=_[_0xdb05('0x32')](_0x5a56cc[_0xdb05('0x31')]);_0x5ec74a['filters']=_[_0xdb05('0x36')](_0x5ec74a['model'],_0x5ec74a[_0xdb05('0x31')]);_0x4f04ef['attributes']=_[_0xdb05('0x36')](_0x5ec74a[_0xdb05('0x34')],qs['fields'](_0x5a56cc[_0xdb05('0x31')]['fields']));_0x4f04ef[_0xdb05('0x35')]=_0x4f04ef[_0xdb05('0x35')][_0xdb05('0x38')]?_0x4f04ef['attributes']:_0x5ec74a['model'];_0x4f04ef['order']=qs[_0xdb05('0x3b')](_0x5a56cc[_0xdb05('0x31')]['sort']);_0x4f04ef[_0xdb05('0x3c')]=qs[_0xdb05('0x33')](_[_0xdb05('0x56')](_0x5a56cc[_0xdb05('0x31')],_0x5ec74a[_0xdb05('0x33')]));if(_0x5a56cc['query'][_0xdb05('0x3d')]){_0x4f04ef[_0xdb05('0x3c')]=_['merge'](_0x4f04ef[_0xdb05('0x3c')],{'$or':_[_0xdb05('0x30')](_0x4f04ef[_0xdb05('0x35')],function(_0x3342ce){var _0x1669c6={};_0x1669c6[_0x3342ce]={'$like':'%'+_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x3d')]+'%'};return _0x1669c6;})});}_0x4f04ef=_[_0xdb05('0x3e')]({},_0x4f04ef,_0x5a56cc[_0xdb05('0x41')]);return _0x33a616[_0xdb05('0x62')](_0x4f04ef);}})['then'](function(_0x524fdf){if(_0x524fdf){_0x5a553d=_0x524fdf[_0xdb05('0x38')];if(!_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x39')](_0xdb05('0x55'))){_0x4f04ef['limit']=qs[_0xdb05('0x20')](_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x20')]);_0x4f04ef[_0xdb05('0x1e')]=qs[_0xdb05('0x1e')](_0x5a56cc[_0xdb05('0x31')][_0xdb05('0x1e')]);}return _0x33a616[_0xdb05('0x62')](_0x4f04ef);}})[_0xdb05('0x27')](function(_0x1f98bb){if(_0x1f98bb){return _0x1f98bb?{'count':_0x5a553d,'rows':_0x1f98bb}:null;}})[_0xdb05('0x27')](respondWithResult(_0x2609b6,null))['catch'](handleError(_0x2609b6,null));};exports[_0xdb05('0x65')]=function(_0x44cc02,_0x378227,_0x259f9c){var _0x5ca47d=_0x44cc02['body'][_0xdb05('0x66')];return db[_0xdb05('0x64')]['findAll']({'where':{'id':_0x5ca47d},'attributes':['id'],'include':[{'model':db[_0xdb05('0x59')],'as':'Agents','attributes':['id','name',_0xdb05('0x67'),'voicePause',_0xdb05('0x68')],'raw':!![]}]})[_0xdb05('0x27')](function(_0x380c47){if(_0x380c47){var _0x29ba38=_[_0xdb05('0x69')](_0x380c47,function(_0x472e60){var _0x2697e3=_0x472e60[_0xdb05('0x4c')]({'plain':!![]});return _0x2697e3[_0xdb05('0x6a')];});return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x44cc02['params']['id']}})[_0xdb05('0x27')](function(_0x1d9694){return db[_0xdb05('0x6b')][_0xdb05('0x6c')](function(_0x53be8a){return _0x1d9694['addTeams'](_0x5ca47d,{'transaction':_0x53be8a})['then'](function(){return BPromise[_0xdb05('0x6d')](_0x29ba38,function(_0x1218e8){return db[_0xdb05('0x58')][_0xdb05('0x6e')]({'where':{'UserId':_0x1218e8['id'],'MailQueueId':_0x44cc02[_0xdb05('0x47')]['id']},'transaction':_0x53be8a});});})[_0xdb05('0x27')](function(){_0x29ba38['forEach'](function(_0x12eb7e){socket['emit'](_0xdb05('0x6f'),{'UserId':_0x12eb7e['id'],'MailQueueId':_0x1d9694['id']});});});});});}})[_0xdb05('0x27')](respondWithStatusCode(_0x378227,null))[_0xdb05('0x45')](handleError(_0x378227,null));};exports[_0xdb05('0x70')]=function(_0x2e0cad,_0x5e62fe,_0x1d642d){return db['Team'][_0xdb05('0x43')]({'where':{'id':_0x2e0cad['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdb05('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xdb05('0x27')](handleEntityNotFound(_0x5e62fe,null))[_0xdb05('0x27')](function(_0x2b4c99){var _0x399233=_[_0xdb05('0x30')](_0x2b4c99,'id');var _0x5bf9b0=[];var _0x8da08f=[];var _0x479096=squel[_0xdb05('0x71')]();_0x479096[_0xdb05('0x72')]('tq.TeamId')[_0xdb05('0x73')](_0xdb05('0x74'),'tq')[_0xdb05('0x75')](_0xdb05('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdb05('0x3c')]('MailQueueId\x20=\x20?',_0x2e0cad[_0xdb05('0x47')]['id']);for(var _0x1bd1fe=0x0;_0x1bd1fe<_0x2b4c99['length'];_0x1bd1fe+=0x1){let _0x58d534=_0x2b4c99[_0x1bd1fe];for(var _0xe5078d=0x0;_0xe5078d<_0x58d534[_0xdb05('0x6a')][_0xdb05('0x38')];_0xe5078d+=0x1){let _0x297291=_0x58d534['Agents'][_0xe5078d];var _0x4fd566=_0x479096[_0xdb05('0x77')]();_0x4fd566[_0xdb05('0x3c')](_0xdb05('0x78'),_0x297291['id']);_0x8da08f[_0xdb05('0x79')](db['sequelize'][_0xdb05('0x31')](_0x4fd566[_0xdb05('0x7a')](),{'type':db[_0xdb05('0x6b')]['QueryTypes']['SELECT']})[_0xdb05('0x27')](function(_0x4f9ce1){if(_0x4f9ce1[_0xdb05('0x38')]===0x1){return _0x297291['id'];}else{var _0x2e3a11=_[_0xdb05('0x7b')](_['map'](_0x4f9ce1,_0xdb05('0x7c')),function(_0x54ce4e){return _[_0xdb05('0x7d')](_0x399233,_0x54ce4e);});if(_0x2e3a11){return _0x297291['id'];}}}));}}return BPromise['all'](_0x8da08f)[_0xdb05('0x27')](function(_0x5f3e32){_0x5bf9b0=_(_0x5bf9b0)[_0xdb05('0x7e')](_0x5f3e32)['compact']()[_0xdb05('0x7f')]();return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x2e0cad[_0xdb05('0x47')]['id']}})['then'](function(_0x4bcf5e){return db[_0xdb05('0x6b')][_0xdb05('0x6c')](function(_0x5826de){return _0x4bcf5e[_0xdb05('0x70')](_0x2e0cad[_0xdb05('0x31')][_0xdb05('0x66')],{'transaction':_0x5826de})[_0xdb05('0x27')](function(){if(!_[_0xdb05('0x80')](_0x5bf9b0)){return _0x4bcf5e[_0xdb05('0x81')](_0x5bf9b0,{'transaction':_0x5826de});}})[_0xdb05('0x27')](function(){_0x5bf9b0[_0xdb05('0x82')](function(_0x521a3a){socket['emit'](_0xdb05('0x83'),{'UserId':_0x521a3a,'MailQueueId':_0x4bcf5e['id']});});});});});});})[_0xdb05('0x27')](respondWithStatusCode(_0x5e62fe,null))[_0xdb05('0x45')](handleError(_0x5e62fe,null));};exports['addAgents']=function(_0x7608e0,_0x5657b1,_0x45f25d){return db['MailQueue']['find']({'where':{'id':_0x7608e0[_0xdb05('0x47')]['id']}})['then'](handleEntityNotFound(_0x5657b1,null))[_0xdb05('0x27')](function(_0x57d140){if(_0x57d140){return _0x57d140['addAgents'](_0x7608e0[_0xdb05('0x4b')][_0xdb05('0x66')],_[_0xdb05('0x84')](_0x7608e0[_0xdb05('0x4b')],['ids','id'])||{})[_0xdb05('0x85')](function(_0xcd1e41){for(var _0x14112a=0x0;_0x14112a<_0x7608e0['body']['ids'][_0xdb05('0x38')];_0x14112a+=0x1){socket[_0xdb05('0x86')](_0xdb05('0x6f'),{'UserId':Number(_0x7608e0[_0xdb05('0x4b')][_0xdb05('0x66')][_0x14112a]),'MailQueueId':Number(_0x7608e0['params']['id'])});}return _0xcd1e41;});}})[_0xdb05('0x27')](respondWithResult(_0x5657b1,null))['catch'](handleError(_0x5657b1,null));};exports['removeAgents']=function(_0x3e9426,_0x296017,_0x36c75f){return db[_0xdb05('0x2f')][_0xdb05('0x4f')]({'where':{'id':_0x3e9426[_0xdb05('0x47')]['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x296017,null))['then'](function(_0x20b996){if(_0x20b996){return _0x20b996[_0xdb05('0x81')](_0x3e9426[_0xdb05('0x31')][_0xdb05('0x66')])[_0xdb05('0x27')](function(){if(_['isArray'](_0x3e9426['query'][_0xdb05('0x66')])){for(var _0x491a25=0x0;_0x491a25<_0x3e9426[_0xdb05('0x31')][_0xdb05('0x66')][_0xdb05('0x38')];_0x491a25+=0x1){socket[_0xdb05('0x86')](_0xdb05('0x83'),{'UserId':Number(_0x3e9426[_0xdb05('0x31')][_0xdb05('0x66')][_0x491a25]),'MailQueueId':Number(_0x3e9426[_0xdb05('0x47')]['id'])});}}else{socket[_0xdb05('0x86')](_0xdb05('0x83'),{'UserId':Number(_0x3e9426['query']['ids']),'MailQueueId':Number(_0x3e9426[_0xdb05('0x47')]['id'])});}});}})[_0xdb05('0x27')](respondWithStatusCode(_0x296017,null))[_0xdb05('0x45')](handleError(_0x296017,null));};exports[_0xdb05('0x87')]=function(_0x771a5f,_0x39c156,_0x593a00){var _0x8e4c29={};var _0x59e75e={};var _0x50596f;var _0x27ff8f;return db['MailQueue'][_0xdb05('0x63')]({'where':{'id':_0x771a5f['params']['id']}})[_0xdb05('0x27')](handleEntityNotFound(_0x39c156,null))[_0xdb05('0x27')](function(_0x54af3b){if(_0x54af3b){_0x50596f=_0x54af3b;_0x59e75e[_0xdb05('0x34')]=_['keys'](db['User'][_0xdb05('0x48')]);_0x59e75e['query']=_[_0xdb05('0x32')](_0x771a5f[_0xdb05('0x31')]);_0x59e75e[_0xdb05('0x33')]=_[_0xdb05('0x36')](_0x59e75e[_0xdb05('0x34')],_0x59e75e[_0xdb05('0x31')]);_0x8e4c29[_0xdb05('0x35')]=_[_0xdb05('0x36')](_0x59e75e[_0xdb05('0x34')],qs[_0xdb05('0x37')](_0x771a5f[_0xdb05('0x31')][_0xdb05('0x37')]));_0x8e4c29[_0xdb05('0x35')]=_0x8e4c29[_0xdb05('0x35')]['length']?_0x8e4c29[_0xdb05('0x35')]:_0x59e75e[_0xdb05('0x34')];_0x8e4c29[_0xdb05('0x3a')]=qs[_0xdb05('0x3b')](_0x771a5f[_0xdb05('0x31')]['sort']);_0x8e4c29[_0xdb05('0x3c')]=qs['filters'](_[_0xdb05('0x56')](_0x771a5f['query'],_0x59e75e['filters']));if(_0x771a5f[_0xdb05('0x31')][_0xdb05('0x3d')]){_0x8e4c29['where']=_['merge'](_0x8e4c29['where'],{'$or':_[_0xdb05('0x30')](_0x8e4c29[_0xdb05('0x35')],function(_0x2ea56f){var _0x196e2c={};_0x196e2c[_0x2ea56f]={'$like':'%'+_0x771a5f['query']['filter']+'%'};return _0x196e2c;})});}_0x8e4c29=_[_0xdb05('0x3e')]({},_0x8e4c29,_0x771a5f[_0xdb05('0x41')]);return _0x50596f[_0xdb05('0x87')](_0x8e4c29);}})[_0xdb05('0x27')](function(_0x1b88fd){if(_0x1b88fd){_0x27ff8f=_0x1b88fd[_0xdb05('0x38')];if(!_0x771a5f[_0xdb05('0x31')]['hasOwnProperty'](_0xdb05('0x55'))){_0x8e4c29['limit']=qs[_0xdb05('0x20')](_0x771a5f[_0xdb05('0x31')][_0xdb05('0x20')]);_0x8e4c29['offset']=qs[_0xdb05('0x1e')](_0x771a5f[_0xdb05('0x31')][_0xdb05('0x1e')]);}return _0x50596f[_0xdb05('0x87')](_0x8e4c29);}})[_0xdb05('0x27')](function(_0x446873){if(_0x446873){return _0x446873?{'count':_0x27ff8f,'rows':_0x446873}:null;}})['then'](respondWithResult(_0x39c156,null))[_0xdb05('0x45')](handleError(_0x39c156,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 26124db..5ae9a5e 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 _0xb0b8=['remove','emit','hasOwnProperty','exports','../../mysqldb','MailQueue','setMaxListeners','save','update'];(function(_0x260a40,_0x40b958){var _0x5f5da2=function(_0x24002a){while(--_0x24002a){_0x260a40['push'](_0x260a40['shift']());}};_0x5f5da2(++_0x40b958);}(_0xb0b8,0x187));var _0x8b0b=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0xb0b8[_0x4fd109];return _0x30f0a6;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x8b0b('0x0'))['db'][_0x8b0b('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8b0b('0x2')](0x0);var events={'afterCreate':_0x8b0b('0x3'),'afterUpdate':_0x8b0b('0x4'),'afterDestroy':_0x8b0b('0x5')};function emitEvent(_0x14301d){return function(_0x3d268c,_0x8058c,_0x139133){MailQueueEvents[_0x8b0b('0x6')](_0x14301d+':'+_0x3d268c['id'],_0x3d268c);MailQueueEvents[_0x8b0b('0x6')](_0x14301d,_0x3d268c);_0x139133(null);};}for(var e in events){if(events[_0x8b0b('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x8b0b('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x2b42=['exports','events','../../mysqldb','MailQueue','setMaxListeners','remove','emit','hook'];(function(_0x149337,_0x27a7b3){var _0x52b3f6=function(_0x48102f){while(--_0x48102f){_0x149337['push'](_0x149337['shift']());}};_0x52b3f6(++_0x27a7b3);}(_0x2b42,0x101));var _0x22b4=function(_0x1ec65c,_0x354923){_0x1ec65c=_0x1ec65c-0x0;var _0x5249c2=_0x2b42[_0x1ec65c];return _0x5249c2;};'use strict';var EventEmitter=require(_0x22b4('0x0'));var MailQueue=require(_0x22b4('0x1'))['db'][_0x22b4('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x22b4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x22b4('0x4')};function emitEvent(_0x4deb81){return function(_0x1268fc,_0x591563,_0x547657){MailQueueEvents['emit'](_0x4deb81+':'+_0x1268fc['id'],_0x1268fc);MailQueueEvents[_0x22b4('0x5')](_0x4deb81,_0x1268fc);_0x547657(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x22b4('0x6')](e,emitEvent(event));}}module[_0x22b4('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 0f53e1a..ec71b34 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 _0xffc3=['util','moment','bluebird','request-promise','rimraf','../../config/environment','exports','MailQueue','mail_queues','lodash'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xffc3,0x17b));var _0x3ffc=function(_0x39b730,_0x3406c8){_0x39b730=_0x39b730-0x0;var _0x2d4b92=_0xffc3[_0x39b730];return _0x2d4b92;};'use strict';var _=require(_0x3ffc('0x0'));var util=require(_0x3ffc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3ffc('0x2'));var BPromise=require(_0x3ffc('0x3'));var rp=require(_0x3ffc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3ffc('0x5'));var config=require(_0x3ffc('0x6'));var attributes=require('./mailQueue.attributes');module[_0x3ffc('0x7')]=function(_0x4945c4,_0x2bf3df){return _0x4945c4['define'](_0x3ffc('0x8'),attributes,{'tableName':_0x3ffc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65b1=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x1620d2,_0x798f79){var _0xb63a8d=function(_0x414068){while(--_0x414068){_0x1620d2['push'](_0x1620d2['shift']());}};_0xb63a8d(++_0x798f79);}(_0x65b1,0x1e7));var _0x165b=function(_0x14cddd,_0xd110fd){_0x14cddd=_0x14cddd-0x0;var _0x5e0bf8=_0x65b1[_0x14cddd];return _0x5e0bf8;};'use strict';var _=require(_0x165b('0x0'));var util=require(_0x165b('0x1'));var logger=require(_0x165b('0x2'))(_0x165b('0x3'));var moment=require(_0x165b('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x165b('0x5'));var rimraf=require(_0x165b('0x6'));var config=require(_0x165b('0x7'));var attributes=require(_0x165b('0x8'));module[_0x165b('0x9')]=function(_0x97ca70,_0xbbf379){return _0x97ca70[_0x165b('0xa')](_0x165b('0xb'),attributes,{'tableName':_0x165b('0xc'),'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 27f17a4..c0cb133 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 _0xaf4c=['GetMailQueue','MailQueue','findAll','options','raw','attributes','include','map','model','ShowMailQueue','find','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','stringify','error','code','message','MailQueue,\x20%s,\x20%s','result','catch'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0x541198,_0x574cba){_0x541198=_0x541198-0x0;var _0x7c9ea9=_0xaf4c[_0x541198];return _0x7c9ea9;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var moment=require(_0xcaf4('0x1'));var BPromise=require('bluebird');var rs=require(_0xcaf4('0x2'));var fs=require('fs');var Redis=require(_0xcaf4('0x3'));var db=require(_0xcaf4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcaf4('0x5'))(_0xcaf4('0x6'));var config=require(_0xcaf4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcaf4('0x8')]['http']({'port':0x232a});config[_0xcaf4('0x9')]=_[_0xcaf4('0xa')](config[_0xcaf4('0x9')],{'host':_0xcaf4('0xb'),'port':0x18eb});var socket=require(_0xcaf4('0xc'))(new Redis(config[_0xcaf4('0x9')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2191f5,_0x30773e,_0x154e38){return new BPromise(function(_0x1c411e,_0x27930f){return client[_0xcaf4('0xd')](_0x2191f5,_0x154e38)[_0xcaf4('0xe')](function(_0x13a6d2){logger[_0xcaf4('0xf')]('MailQueue,\x20%s,\x20%s',_0x30773e,_0xcaf4('0x10'));logger[_0xcaf4('0x11')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x30773e,_0xcaf4('0x10'),JSON[_0xcaf4('0x12')](_0x13a6d2));if(_0x13a6d2[_0xcaf4('0x13')]){if(_0x13a6d2['error'][_0xcaf4('0x14')]===0x1f4){logger[_0xcaf4('0x13')]('MailQueue,\x20%s,\x20%s',_0x30773e,_0x13a6d2[_0xcaf4('0x13')]['message']);return _0x27930f(_0x13a6d2[_0xcaf4('0x13')][_0xcaf4('0x15')]);}logger[_0xcaf4('0x13')](_0xcaf4('0x16'),_0x30773e,_0x13a6d2[_0xcaf4('0x13')][_0xcaf4('0x15')]);return _0x1c411e(_0x13a6d2['error'][_0xcaf4('0x15')]);}else{logger['info'](_0xcaf4('0x16'),_0x30773e,'request\x20sent');_0x1c411e(_0x13a6d2[_0xcaf4('0x17')][_0xcaf4('0x15')]);}})[_0xcaf4('0x18')](function(_0x4e174d){logger['error'](_0xcaf4('0x16'),_0x30773e,_0x4e174d);_0x27930f(_0x4e174d);});});}exports[_0xcaf4('0x19')]=function(_0x23db74){var _0x2c4b02=this;return new Promise(function(_0x28b378,_0x596997){return db[_0xcaf4('0x1a')][_0xcaf4('0x1b')]({'raw':_0x23db74[_0xcaf4('0x1c')]?_0x23db74['options'][_0xcaf4('0x1d')]===undefined?!![]:![]:!![],'where':_0x23db74[_0xcaf4('0x1c')]?_0x23db74[_0xcaf4('0x1c')]['where']||null:null,'attributes':_0x23db74[_0xcaf4('0x1c')]?_0x23db74['options'][_0xcaf4('0x1e')]||null:null,'limit':_0x23db74[_0xcaf4('0x1c')]?_0x23db74[_0xcaf4('0x1c')]['limit']||null:null,'include':_0x23db74[_0xcaf4('0x1c')]?_0x23db74[_0xcaf4('0x1c')][_0xcaf4('0x1f')]?_[_0xcaf4('0x20')](_0x23db74['options'][_0xcaf4('0x1f')],function(_0xf9fe54){return{'model':db[_0xf9fe54['model']],'as':_0xf9fe54['as'],'attributes':_0xf9fe54[_0xcaf4('0x1e')],'include':_0xf9fe54[_0xcaf4('0x1f')]?_[_0xcaf4('0x20')](_0xf9fe54[_0xcaf4('0x1f')],function(_0x25beed){return{'model':db[_0x25beed[_0xcaf4('0x21')]],'as':_0x25beed['as'],'attributes':_0x25beed[_0xcaf4('0x1e')],'include':_0x25beed['include']?_[_0xcaf4('0x20')](_0x25beed[_0xcaf4('0x1f')],function(_0x237077){return{'model':db[_0x237077['model']],'as':_0x237077['as'],'attributes':_0x237077[_0xcaf4('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcaf4('0xe')](function(_0x1fca09){logger[_0xcaf4('0xf')](_0xcaf4('0x19'),_0x23db74);logger[_0xcaf4('0x11')](_0xcaf4('0x19'),_0x23db74,JSON['stringify'](_0x1fca09));_0x28b378(_0x1fca09);})[_0xcaf4('0x18')](function(_0x5c355e){logger['error'](_0xcaf4('0x19'),_0x5c355e['message'],_0x23db74);_0x596997(_0x2c4b02[_0xcaf4('0x13')](0x1f4,_0x5c355e['message']));});});};exports[_0xcaf4('0x22')]=function(_0x5141bf){var _0x3d101a=this;return new Promise(function(_0xac02f,_0x252d4a){return db[_0xcaf4('0x1a')][_0xcaf4('0x23')]({'raw':_0x5141bf[_0xcaf4('0x1c')]?_0x5141bf[_0xcaf4('0x1c')][_0xcaf4('0x1d')]===undefined?!![]:![]:!![],'where':_0x5141bf['options']?_0x5141bf[_0xcaf4('0x1c')][_0xcaf4('0x24')]||null:null,'attributes':_0x5141bf[_0xcaf4('0x1c')]?_0x5141bf[_0xcaf4('0x1c')][_0xcaf4('0x1e')]||null:null,'include':_0x5141bf['options']?_0x5141bf['options']['include']?_['map'](_0x5141bf['options'][_0xcaf4('0x1f')],function(_0x37ed8f){return{'model':db[_0x37ed8f[_0xcaf4('0x21')]],'as':_0x37ed8f['as'],'attributes':_0x37ed8f['attributes'],'include':_0x37ed8f[_0xcaf4('0x1f')]?_[_0xcaf4('0x20')](_0x37ed8f[_0xcaf4('0x1f')],function(_0x363e6f){return{'model':db[_0x363e6f['model']],'as':_0x363e6f['as'],'attributes':_0x363e6f['attributes'],'include':_0x363e6f['include']?_['map'](_0x363e6f['include'],function(_0x297cfd){return{'model':db[_0x297cfd[_0xcaf4('0x21')]],'as':_0x297cfd['as'],'attributes':_0x297cfd['attributes']};}):[]};}):[]};}):[]:[]})[_0xcaf4('0xe')](function(_0xc78b8c){logger['info'](_0xcaf4('0x22'),_0x5141bf);logger[_0xcaf4('0x11')](_0xcaf4('0x22'),_0x5141bf,JSON['stringify'](_0xc78b8c));_0xac02f(_0xc78b8c);})['catch'](function(_0x1c1841){logger[_0xcaf4('0x13')](_0xcaf4('0x22'),_0x1c1841[_0xcaf4('0x15')],_0x5141bf);_0x252d4a(_0x3d101a['error'](0x1f4,_0x1c1841[_0xcaf4('0x15')]));});});}; \ No newline at end of file +var _0xd1f5=['ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include','model','map','ShowMailQueue','find','lodash','moment','bluebird'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd1f5,0x1de));var _0x5d1f=function(_0x1a6152,_0x55b74b){_0x1a6152=_0x1a6152-0x0;var _0x10ecc6=_0xd1f5[_0x1a6152];return _0x10ecc6;};'use strict';var _=require(_0x5d1f('0x0'));var util=require('util');var moment=require(_0x5d1f('0x1'));var BPromise=require(_0x5d1f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d1f('0x3'));var db=require(_0x5d1f('0x4'))['db'];var utils=require(_0x5d1f('0x5'));var logger=require('../../config/logger')(_0x5d1f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x5d1f('0x7')]({'port':0x232a});config[_0x5d1f('0x8')]=_[_0x5d1f('0x9')](config[_0x5d1f('0x8')],{'host':_0x5d1f('0xa'),'port':0x18eb});var socket=require(_0x5d1f('0xb'))(new Redis(config[_0x5d1f('0x8')]));require('./mailQueue.socket')[_0x5d1f('0xc')](socket);function respondWithRpcPromise(_0x153ac4,_0x2f7114,_0x512d32){return new BPromise(function(_0x15a5bc,_0xe240d5){return client['request'](_0x153ac4,_0x512d32)[_0x5d1f('0xd')](function(_0x471003){logger[_0x5d1f('0xe')](_0x5d1f('0xf'),_0x2f7114,_0x5d1f('0x10'));logger[_0x5d1f('0x11')](_0x5d1f('0x12'),_0x2f7114,'request\x20sent',JSON[_0x5d1f('0x13')](_0x471003));if(_0x471003[_0x5d1f('0x14')]){if(_0x471003[_0x5d1f('0x14')][_0x5d1f('0x15')]===0x1f4){logger['error'](_0x5d1f('0xf'),_0x2f7114,_0x471003[_0x5d1f('0x14')][_0x5d1f('0x16')]);return _0xe240d5(_0x471003['error'][_0x5d1f('0x16')]);}logger[_0x5d1f('0x14')](_0x5d1f('0xf'),_0x2f7114,_0x471003['error'][_0x5d1f('0x16')]);return _0x15a5bc(_0x471003[_0x5d1f('0x14')][_0x5d1f('0x16')]);}else{logger['info'](_0x5d1f('0xf'),_0x2f7114,'request\x20sent');_0x15a5bc(_0x471003[_0x5d1f('0x17')]['message']);}})[_0x5d1f('0x18')](function(_0xd97672){logger['error']('MailQueue,\x20%s,\x20%s',_0x2f7114,_0xd97672);_0xe240d5(_0xd97672);});});}exports[_0x5d1f('0x19')]=function(_0x4515d5){var _0x194df1=this;return new Promise(function(_0x28f373,_0x2b8a57){return db[_0x5d1f('0x1a')]['findAll']({'raw':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5['options'][_0x5d1f('0x1c')]===undefined?!![]:![]:!![],'where':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x1d')]||null:null,'attributes':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x1e')]||null:null,'limit':_0x4515d5[_0x5d1f('0x1b')]?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x1f')]||null:null,'include':_0x4515d5['options']?_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x20')]?_['map'](_0x4515d5[_0x5d1f('0x1b')][_0x5d1f('0x20')],function(_0x5286e7){return{'model':db[_0x5286e7[_0x5d1f('0x21')]],'as':_0x5286e7['as'],'attributes':_0x5286e7['attributes'],'include':_0x5286e7[_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x5286e7['include'],function(_0x449f6d){return{'model':db[_0x449f6d[_0x5d1f('0x21')]],'as':_0x449f6d['as'],'attributes':_0x449f6d[_0x5d1f('0x1e')],'include':_0x449f6d[_0x5d1f('0x20')]?_['map'](_0x449f6d[_0x5d1f('0x20')],function(_0x143a70){return{'model':db[_0x143a70[_0x5d1f('0x21')]],'as':_0x143a70['as'],'attributes':_0x143a70['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d1f('0xd')](function(_0x17b8e0){logger[_0x5d1f('0xe')](_0x5d1f('0x19'),_0x4515d5);logger['debug'](_0x5d1f('0x19'),_0x4515d5,JSON['stringify'](_0x17b8e0));_0x28f373(_0x17b8e0);})[_0x5d1f('0x18')](function(_0x489ec4){logger[_0x5d1f('0x14')](_0x5d1f('0x19'),_0x489ec4[_0x5d1f('0x16')],_0x4515d5);_0x2b8a57(_0x194df1[_0x5d1f('0x14')](0x1f4,_0x489ec4[_0x5d1f('0x16')]));});});};exports[_0x5d1f('0x23')]=function(_0x1062d3){var _0x2deb35=this;return new Promise(function(_0x1c5bd6,_0x4169ce){return db[_0x5d1f('0x1a')][_0x5d1f('0x24')]({'raw':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3['options'][_0x5d1f('0x1c')]===undefined?!![]:![]:!![],'where':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3[_0x5d1f('0x1b')][_0x5d1f('0x1d')]||null:null,'attributes':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3[_0x5d1f('0x1b')][_0x5d1f('0x1e')]||null:null,'include':_0x1062d3[_0x5d1f('0x1b')]?_0x1062d3['options'][_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x1062d3[_0x5d1f('0x1b')][_0x5d1f('0x20')],function(_0x47aeea){return{'model':db[_0x47aeea[_0x5d1f('0x21')]],'as':_0x47aeea['as'],'attributes':_0x47aeea[_0x5d1f('0x1e')],'include':_0x47aeea[_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x47aeea['include'],function(_0x3ea0b1){return{'model':db[_0x3ea0b1[_0x5d1f('0x21')]],'as':_0x3ea0b1['as'],'attributes':_0x3ea0b1[_0x5d1f('0x1e')],'include':_0x3ea0b1[_0x5d1f('0x20')]?_[_0x5d1f('0x22')](_0x3ea0b1['include'],function(_0x4c1a06){return{'model':db[_0x4c1a06[_0x5d1f('0x21')]],'as':_0x4c1a06['as'],'attributes':_0x4c1a06[_0x5d1f('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5d1f('0xd')](function(_0x3e6b27){logger[_0x5d1f('0xe')]('ShowMailQueue',_0x1062d3);logger[_0x5d1f('0x11')](_0x5d1f('0x23'),_0x1062d3,JSON['stringify'](_0x3e6b27));_0x1c5bd6(_0x3e6b27);})['catch'](function(_0x17d4b8){logger[_0x5d1f('0x14')](_0x5d1f('0x23'),_0x17d4b8['message'],_0x1062d3);_0x4169ce(_0x2deb35['error'](0x1f4,_0x17d4b8[_0x5d1f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index bfbdd13..a6cec9a 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 _0xc35f=['emit','mailQueue:','./mailQueue.events','save','remove','update'];(function(_0x348056,_0x4b9e53){var _0x6d580c=function(_0x30c7d0){while(--_0x30c7d0){_0x348056['push'](_0x348056['shift']());}};_0x6d580c(++_0x4b9e53);}(_0xc35f,0x1ca));var _0xfc35=function(_0x3d7734,_0x19179e){_0x3d7734=_0x3d7734-0x0;var _0x2a3275=_0xc35f[_0x3d7734];return _0x2a3275;};'use strict';var MailQueueEvents=require(_0xfc35('0x0'));var events=[_0xfc35('0x1'),_0xfc35('0x2'),_0xfc35('0x3')];function createListener(_0x4eeb60,_0x2db65f){return function(_0x1e038c){_0x2db65f[_0xfc35('0x4')](_0x4eeb60,_0x1e038c);};}function removeListener(_0x54ce0c,_0x4739a0){return function(){MailQueueEvents['removeListener'](_0x54ce0c,_0x4739a0);};}exports['register']=function(_0x6d47a0){for(var _0x1991a5=0x0,_0x4c92db=events['length'];_0x1991a5<_0x4c92db;_0x1991a5++){var _0x4283cd=events[_0x1991a5];var _0x290dcc=createListener(_0xfc35('0x5')+_0x4283cd,_0x6d47a0);MailQueueEvents['on'](_0x4283cd,_0x290dcc);}}; \ No newline at end of file +var _0x2b63=['emit','removeListener','mailQueue:','./mailQueue.events','save'];(function(_0x457e9f,_0x4fbeee){var _0x5e72e6=function(_0xe7e24b){while(--_0xe7e24b){_0x457e9f['push'](_0x457e9f['shift']());}};_0x5e72e6(++_0x4fbeee);}(_0x2b63,0x1d4));var _0x32b6=function(_0x172da4,_0x3780c0){_0x172da4=_0x172da4-0x0;var _0x5c64df=_0x2b63[_0x172da4];return _0x5c64df;};'use strict';var MailQueueEvents=require(_0x32b6('0x0'));var events=[_0x32b6('0x1'),'remove','update'];function createListener(_0x570232,_0x2aa67e){return function(_0x4f27e8){_0x2aa67e[_0x32b6('0x2')](_0x570232,_0x4f27e8);};}function removeListener(_0x3860d9,_0x599fb8){return function(){MailQueueEvents[_0x32b6('0x3')](_0x3860d9,_0x599fb8);};}exports['register']=function(_0x155610){for(var _0x163005=0x0,_0x1ad155=events['length'];_0x163005<_0x1ad155;_0x163005++){var _0x344f64=events[_0x163005];var _0x5667c9=createListener(_0x32b6('0x4')+_0x344f64,_0x155610);MailQueueEvents['on'](_0x344f64,_0x5667c9);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 656c57a..e917cc5 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 _0xb08c=['../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x18e178,_0x45d677){var _0x51ed6c=function(_0x5779){while(--_0x5779){_0x18e178['push'](_0x18e178['shift']());}};_0x51ed6c(++_0x45d677);}(_0xb08c,0x19b));var _0xcb08=function(_0x18cccf,_0x25e8cd){_0x18cccf=_0x18cccf-0x0;var _0x4e56cc=_0xb08c[_0x18cccf];return _0x4e56cc;};'use strict';var multer=require(_0xcb08('0x0'));var util=require(_0xcb08('0x1'));var path=require(_0xcb08('0x2'));var timeout=require(_0xcb08('0x3'));var express=require(_0xcb08('0x4'));var router=express[_0xcb08('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcb08('0x6'));var config=require(_0xcb08('0x7'));var controller=require(_0xcb08('0x8'));router[_0xcb08('0x9')]('/',auth[_0xcb08('0xa')](),controller[_0xcb08('0xb')]);router[_0xcb08('0x9')](_0xcb08('0xc'),auth['isAuthenticated'](),controller[_0xcb08('0xd')]);router[_0xcb08('0x9')](_0xcb08('0xe'),auth['isAuthenticated'](),controller[_0xcb08('0xf')]);router[_0xcb08('0x10')]('/',auth[_0xcb08('0xa')](),controller[_0xcb08('0x11')]);router['put'](_0xcb08('0xe'),auth[_0xcb08('0xa')](),controller[_0xcb08('0x12')]);router[_0xcb08('0x13')]('/:id',auth[_0xcb08('0xa')](),controller[_0xcb08('0x14')]);module[_0xcb08('0x15')]=router; \ No newline at end of file +var _0xd158=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','/describe','get','/:id','show','create','put','update','delete','exports'];(function(_0x136c89,_0xe605ff){var _0x33ea8b=function(_0x2b75f5){while(--_0x2b75f5){_0x136c89['push'](_0x136c89['shift']());}};_0x33ea8b(++_0xe605ff);}(_0xd158,0xbd));var _0x8d15=function(_0x41d5ee,_0x2a7dfe){_0x41d5ee=_0x41d5ee-0x0;var _0x41fbb5=_0xd158[_0x41d5ee];return _0x41fbb5;};'use strict';var multer=require(_0x8d15('0x0'));var util=require(_0x8d15('0x1'));var path=require(_0x8d15('0x2'));var timeout=require(_0x8d15('0x3'));var express=require(_0x8d15('0x4'));var router=express['Router']();var fs_extra=require(_0x8d15('0x5'));var auth=require(_0x8d15('0x6'));var interaction=require(_0x8d15('0x7'));var config=require(_0x8d15('0x8'));var controller=require(_0x8d15('0x9'));router['get']('/',auth[_0x8d15('0xa')](),controller[_0x8d15('0xb')]);router['get'](_0x8d15('0xc'),auth[_0x8d15('0xa')](),controller['describe']);router[_0x8d15('0xd')](_0x8d15('0xe'),auth[_0x8d15('0xa')](),controller[_0x8d15('0xf')]);router['post']('/',auth[_0x8d15('0xa')](),controller[_0x8d15('0x10')]);router[_0x8d15('0x11')]('/:id',auth[_0x8d15('0xa')](),controller[_0x8d15('0x12')]);router[_0x8d15('0x13')](_0x8d15('0xe'),auth[_0x8d15('0xa')](),controller['destroy']);module[_0x8d15('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 5e867a1..565d570 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 _0x3ec7=['exports','STRING','DATE','sequelize'];(function(_0x5ba4ab,_0x5645a7){var _0x336f0a=function(_0x451998){while(--_0x451998){_0x5ba4ab['push'](_0x5ba4ab['shift']());}};_0x336f0a(++_0x5645a7);}(_0x3ec7,0x1e7));var _0x73ec=function(_0x36d3d2,_0x46f429){_0x36d3d2=_0x36d3d2-0x0;var _0x24c778=_0x3ec7[_0x36d3d2];return _0x24c778;};'use strict';var moment=require('moment');var Sequelize=require(_0x73ec('0x0'));module[_0x73ec('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x73ec('0x2')]},'joinAt':{'type':Sequelize[_0x73ec('0x3')]},'leaveAt':{'type':Sequelize[_0x73ec('0x3')]},'acceptAt':{'type':Sequelize[_0x73ec('0x3')]},'exitAt':{'type':Sequelize[_0x73ec('0x3')]},'reason':{'type':Sequelize[_0x73ec('0x2')]}}; \ No newline at end of file +var _0xe51b=['STRING','DATE','moment','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe51b,0x92));var _0xbe51=function(_0x4d2cba,_0x92444a){_0x4d2cba=_0x4d2cba-0x0;var _0x4e954a=_0xe51b[_0x4d2cba];return _0x4e954a;};'use strict';var moment=require(_0xbe51('0x0'));var Sequelize=require(_0xbe51('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbe51('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xbe51('0x2')]},'joinAt':{'type':Sequelize[_0xbe51('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbe51('0x3')]},'exitAt':{'type':Sequelize[_0xbe51('0x3')]},'reason':{'type':Sequelize[_0xbe51('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 5a5bddc..262458a 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 _0x7046=['map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','MailQueueReport','includeAll','include','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','name','send'];(function(_0x330b9f,_0x872b7c){var _0x5a672b=function(_0xc1da7){while(--_0xc1da7){_0x330b9f['push'](_0x330b9f['shift']());}};_0x5a672b(++_0x872b7c);}(_0x7046,0x144));var _0x6704=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7046[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x6704('0x0'));var rimraf=require(_0x6704('0x1'));var zipdir=require(_0x6704('0x2'));var jsonpatch=require(_0x6704('0x3'));var rp=require('request-promise');var moment=require(_0x6704('0x4'));var BPromise=require(_0x6704('0x5'));var Mustache=require(_0x6704('0x6'));var util=require('util');var path=require(_0x6704('0x7'));var sox=require(_0x6704('0x8'));var csv=require(_0x6704('0x9'));var ejs=require(_0x6704('0xa'));var fs=require('fs');var fs_extra=require(_0x6704('0xb'));var _=require('lodash');var squel=require(_0x6704('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6704('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6704('0xe'));var Redis=require(_0x6704('0xf'));var authService=require(_0x6704('0x10'));var qs=require(_0x6704('0x11'));var as=require(_0x6704('0x12'));var hardwareService=require(_0x6704('0x13'));var logger=require(_0x6704('0x14'))(_0x6704('0x15'));var utils=require('../../config/utils');var config=require(_0x6704('0x16'));var licenseUtil=require(_0x6704('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2feb52,_0x1db0ad){_0x1db0ad=_0x1db0ad||0xcc;return function(_0x327e03){if(_0x327e03){return _0x2feb52[_0x6704('0x18')](_0x1db0ad);}return _0x2feb52[_0x6704('0x19')](_0x1db0ad)[_0x6704('0x1a')]();};}function respondWithResult(_0x17b9bc,_0x2da4df){_0x2da4df=_0x2da4df||0xc8;return function(_0x24ece3){if(_0x24ece3){return _0x17b9bc['status'](_0x2da4df)[_0x6704('0x1b')](_0x24ece3);}};}function respondWithFilteredResult(_0x1752bc,_0x35082b){return function(_0x4fef80){if(_0x4fef80){var _0x11782a=typeof _0x35082b[_0x6704('0x1c')]===_0x6704('0x1d')&&typeof _0x35082b[_0x6704('0x1e')]===_0x6704('0x1d');var _0x5adb35=_0x4fef80[_0x6704('0x1f')];var _0x31d732=_0x11782a?0x0:_0x35082b[_0x6704('0x1c')];var _0xe49450=_0x11782a?_0x4fef80[_0x6704('0x1f')]:_0x35082b['offset']+_0x35082b[_0x6704('0x1e')];var _0x2f6eae;if(_0xe49450>=_0x5adb35){_0xe49450=_0x5adb35;_0x2f6eae=0xc8;}else{_0x2f6eae=0xce;}_0x1752bc[_0x6704('0x19')](_0x2f6eae);return _0x1752bc[_0x6704('0x20')](_0x6704('0x21'),_0x31d732+'-'+_0xe49450+'/'+_0x5adb35)[_0x6704('0x1b')](_0x4fef80);}return null;};}function patchUpdates(_0x42b27f){return function(_0x5bb33e){try{jsonpatch[_0x6704('0x22')](_0x5bb33e,_0x42b27f,!![]);}catch(_0xf6d433){return BPromise[_0x6704('0x23')](_0xf6d433);}return _0x5bb33e['save']();};}function saveUpdates(_0x4dca58,_0x48d829){return function(_0x3e183b){if(_0x3e183b){return _0x3e183b[_0x6704('0x24')](_0x4dca58)[_0x6704('0x25')](function(_0x41f89e){return _0x41f89e;});}return null;};}function removeEntity(_0x56d1e1,_0xf2c459){return function(_0xabb97a){if(_0xabb97a){return _0xabb97a[_0x6704('0x26')]()[_0x6704('0x25')](function(){_0x56d1e1[_0x6704('0x19')](0xcc)[_0x6704('0x1a')]();});}};}function handleEntityNotFound(_0x2acafd,_0x5d50ff){return function(_0x896227){if(!_0x896227){_0x2acafd[_0x6704('0x18')](0x194);}return _0x896227;};}function handleError(_0x36bea4,_0x1bdfee){_0x1bdfee=_0x1bdfee||0x1f4;return function(_0x118d93){logger['error'](_0x118d93['stack']);if(_0x118d93[_0x6704('0x27')]){delete _0x118d93[_0x6704('0x27')];}_0x36bea4[_0x6704('0x19')](_0x1bdfee)[_0x6704('0x28')](_0x118d93);};}exports['index']=function(_0x1def46,_0x18cd98){var _0x5c229d={},_0x588814={},_0x16e749={'count':0x0,'rows':[]};var _0x5363c9=_[_0x6704('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x7e193e){return{'name':_0x7e193e[_0x6704('0x2a')],'type':_0x7e193e[_0x6704('0x2b')]['key']};});_0x588814[_0x6704('0x2c')]=_[_0x6704('0x29')](_0x5363c9,_0x6704('0x27'));_0x588814[_0x6704('0x2d')]=_[_0x6704('0x2e')](_0x1def46[_0x6704('0x2d')]);_0x588814[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],_0x588814[_0x6704('0x2d')]);_0x5c229d[_0x6704('0x31')]=_[_0x6704('0x30')](_0x588814[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x1def46[_0x6704('0x2d')][_0x6704('0x32')]));_0x5c229d[_0x6704('0x31')]=_0x5c229d[_0x6704('0x31')][_0x6704('0x33')]?_0x5c229d[_0x6704('0x31')]:_0x588814[_0x6704('0x2c')];if(!_0x1def46[_0x6704('0x2d')][_0x6704('0x34')](_0x6704('0x35'))){_0x5c229d[_0x6704('0x1e')]=qs['limit'](_0x1def46['query']['limit']);_0x5c229d[_0x6704('0x1c')]=qs[_0x6704('0x1c')](_0x1def46[_0x6704('0x2d')]['offset']);}_0x5c229d[_0x6704('0x36')]=qs['sort'](_0x1def46[_0x6704('0x2d')][_0x6704('0x37')]);_0x5c229d[_0x6704('0x38')]=qs[_0x6704('0x2f')](_[_0x6704('0x39')](_0x1def46[_0x6704('0x2d')],_0x588814[_0x6704('0x2f')]),_0x5363c9);if(_0x1def46[_0x6704('0x2d')]['filter']){_0x5c229d['where']=_[_0x6704('0x3a')](_0x5c229d[_0x6704('0x38')],{'$or':_['map'](_0x5363c9,function(_0x48f3c2){if(_0x48f3c2[_0x6704('0x2b')]!=='VIRTUAL'){var _0xd7e27b={};_0xd7e27b[_0x48f3c2[_0x6704('0x27')]]={'$like':'%'+_0x1def46[_0x6704('0x2d')][_0x6704('0x3b')]+'%'};return _0xd7e27b;}})});}_0x5c229d=_['merge']({},_0x5c229d,_0x1def46[_0x6704('0x3c')]);var _0x1ee017={'where':_0x5c229d['where']};return db[_0x6704('0x3d')]['count'](_0x1ee017)[_0x6704('0x25')](function(_0x714c83){_0x16e749[_0x6704('0x1f')]=_0x714c83;if(_0x1def46['query'][_0x6704('0x3e')]){_0x5c229d[_0x6704('0x3f')]=[{'all':!![]}];}return db[_0x6704('0x3d')]['findAll'](_0x5c229d);})[_0x6704('0x25')](function(_0x444d36){_0x16e749[_0x6704('0x40')]=_0x444d36;return _0x16e749;})[_0x6704('0x25')](respondWithFilteredResult(_0x18cd98,_0x5c229d))['catch'](handleError(_0x18cd98,null));};exports[_0x6704('0x41')]=function(_0x50cc74,_0x2defda){var _0x45a217={'raw':!![],'where':{'id':_0x50cc74[_0x6704('0x42')]['id']}},_0x10fc26={};_0x10fc26['model']=_['keys'](db['MailQueueReport'][_0x6704('0x43')]);_0x10fc26['query']=_[_0x6704('0x2e')](_0x50cc74['query']);_0x10fc26[_0x6704('0x2f')]=_[_0x6704('0x30')](_0x10fc26['model'],_0x10fc26[_0x6704('0x2d')]);_0x45a217[_0x6704('0x31')]=_[_0x6704('0x30')](_0x10fc26[_0x6704('0x2c')],qs[_0x6704('0x32')](_0x50cc74['query'][_0x6704('0x32')]));_0x45a217[_0x6704('0x31')]=_0x45a217[_0x6704('0x31')][_0x6704('0x33')]?_0x45a217[_0x6704('0x31')]:_0x10fc26['model'];if(_0x50cc74[_0x6704('0x2d')]['includeAll']){_0x45a217[_0x6704('0x3f')]=[{'all':!![]}];}_0x45a217=_[_0x6704('0x3a')]({},_0x45a217,_0x50cc74[_0x6704('0x3c')]);return db[_0x6704('0x3d')][_0x6704('0x44')](_0x45a217)['then'](handleEntityNotFound(_0x2defda,null))[_0x6704('0x25')](respondWithResult(_0x2defda,null))[_0x6704('0x45')](handleError(_0x2defda,null));};exports['create']=function(_0x1b9d36,_0x17a98a){return db[_0x6704('0x3d')][_0x6704('0x46')](_0x1b9d36[_0x6704('0x47')],{})[_0x6704('0x25')](respondWithResult(_0x17a98a,0xc9))['catch'](handleError(_0x17a98a,null));};exports[_0x6704('0x24')]=function(_0x5b0713,_0xb73442){if(_0x5b0713['body']['id']){delete _0x5b0713[_0x6704('0x47')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x5b0713[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0xb73442,null))[_0x6704('0x25')](saveUpdates(_0x5b0713[_0x6704('0x47')],null))[_0x6704('0x25')](respondWithResult(_0xb73442,null))[_0x6704('0x45')](handleError(_0xb73442,null));};exports['destroy']=function(_0x5b9e28,_0x254cf7){return db[_0x6704('0x3d')][_0x6704('0x44')]({'where':{'id':_0x5b9e28[_0x6704('0x42')]['id']}})[_0x6704('0x25')](handleEntityNotFound(_0x254cf7,null))[_0x6704('0x25')](removeEntity(_0x254cf7,null))[_0x6704('0x45')](handleError(_0x254cf7,null));};exports[_0x6704('0x48')]=function(_0x1fcfb0,_0x44e4a5){return db[_0x6704('0x3d')][_0x6704('0x48')]()[_0x6704('0x25')](respondWithResult(_0x44e4a5,null))[_0x6704('0x45')](handleError(_0x44e4a5,null));}; \ No newline at end of file +var _0x3d04=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','MailQueueReport','rows','catch','show','params','rawAttributes','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset'];(function(_0x1b633a,_0x56b65b){var _0x5e2d0c=function(_0x4f3a75){while(--_0x4f3a75){_0x1b633a['push'](_0x1b633a['shift']());}};_0x5e2d0c(++_0x56b65b);}(_0x3d04,0xbe));var _0x43d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3d04[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x43d0('0x0'));var rimraf=require(_0x43d0('0x1'));var zipdir=require(_0x43d0('0x2'));var jsonpatch=require(_0x43d0('0x3'));var rp=require(_0x43d0('0x4'));var moment=require(_0x43d0('0x5'));var BPromise=require(_0x43d0('0x6'));var Mustache=require(_0x43d0('0x7'));var util=require('util');var path=require(_0x43d0('0x8'));var sox=require(_0x43d0('0x9'));var csv=require(_0x43d0('0xa'));var ejs=require(_0x43d0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x43d0('0xc'));var deskjs=require(_0x43d0('0xd'));var toCsv=require(_0x43d0('0xa'));var querystring=require(_0x43d0('0xe'));var Papa=require(_0x43d0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43d0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43d0('0x11'))(_0x43d0('0x12'));var utils=require(_0x43d0('0x13'));var config=require(_0x43d0('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x43d0('0x15'))['db'];function respondWithStatusCode(_0x23daaa,_0x546b23){_0x546b23=_0x546b23||0xcc;return function(_0x29773b){if(_0x29773b){return _0x23daaa[_0x43d0('0x16')](_0x546b23);}return _0x23daaa[_0x43d0('0x17')](_0x546b23)['end']();};}function respondWithResult(_0xd262a8,_0x2454fa){_0x2454fa=_0x2454fa||0xc8;return function(_0x436130){if(_0x436130){return _0xd262a8['status'](_0x2454fa)[_0x43d0('0x18')](_0x436130);}};}function respondWithFilteredResult(_0x357f87,_0x44e6ec){return function(_0x1218b5){if(_0x1218b5){var _0x91b4a1=typeof _0x44e6ec['offset']==='undefined'&&typeof _0x44e6ec[_0x43d0('0x19')]===_0x43d0('0x1a');var _0x35decf=_0x1218b5['count'];var _0x2c641e=_0x91b4a1?0x0:_0x44e6ec['offset'];var _0x2c9d06=_0x91b4a1?_0x1218b5[_0x43d0('0x1b')]:_0x44e6ec[_0x43d0('0x1c')]+_0x44e6ec['limit'];var _0x3d7dcc;if(_0x2c9d06>=_0x35decf){_0x2c9d06=_0x35decf;_0x3d7dcc=0xc8;}else{_0x3d7dcc=0xce;}_0x357f87[_0x43d0('0x17')](_0x3d7dcc);return _0x357f87['set'](_0x43d0('0x1d'),_0x2c641e+'-'+_0x2c9d06+'/'+_0x35decf)[_0x43d0('0x18')](_0x1218b5);}return null;};}function patchUpdates(_0x348429){return function(_0x248622){try{jsonpatch[_0x43d0('0x1e')](_0x248622,_0x348429,!![]);}catch(_0x28381b){return BPromise[_0x43d0('0x1f')](_0x28381b);}return _0x248622[_0x43d0('0x20')]();};}function saveUpdates(_0x30febc,_0xc8a644){return function(_0xec5f07){if(_0xec5f07){return _0xec5f07[_0x43d0('0x21')](_0x30febc)[_0x43d0('0x22')](function(_0xbc72e6){return _0xbc72e6;});}return null;};}function removeEntity(_0x2efd77,_0x48aa18){return function(_0x2c7b24){if(_0x2c7b24){return _0x2c7b24[_0x43d0('0x23')]()['then'](function(){_0x2efd77[_0x43d0('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29c111,_0x44497b){return function(_0x5dd310){if(!_0x5dd310){_0x29c111[_0x43d0('0x16')](0x194);}return _0x5dd310;};}function handleError(_0x238c64,_0x5ac4c0){_0x5ac4c0=_0x5ac4c0||0x1f4;return function(_0x12df30){logger[_0x43d0('0x24')](_0x12df30[_0x43d0('0x25')]);if(_0x12df30['name']){delete _0x12df30[_0x43d0('0x26')];}_0x238c64[_0x43d0('0x17')](_0x5ac4c0)[_0x43d0('0x27')](_0x12df30);};}exports[_0x43d0('0x28')]=function(_0x37d78f,_0x440ecb){var _0x31a057={},_0x4a3cd4={},_0x2b0784={'count':0x0,'rows':[]};var _0x2f5bc5=_[_0x43d0('0x29')](db['MailQueueReport']['rawAttributes'],function(_0x52c37b){return{'name':_0x52c37b[_0x43d0('0x2a')],'type':_0x52c37b[_0x43d0('0x2b')][_0x43d0('0x2c')]};});_0x4a3cd4[_0x43d0('0x2d')]=_[_0x43d0('0x29')](_0x2f5bc5,_0x43d0('0x26'));_0x4a3cd4['query']=_[_0x43d0('0x2e')](_0x37d78f[_0x43d0('0x2f')]);_0x4a3cd4[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],_0x4a3cd4[_0x43d0('0x2f')]);_0x31a057[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x4a3cd4[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x37d78f[_0x43d0('0x2f')]['fields']));_0x31a057[_0x43d0('0x32')]=_0x31a057[_0x43d0('0x32')][_0x43d0('0x34')]?_0x31a057[_0x43d0('0x32')]:_0x4a3cd4['model'];if(!_0x37d78f[_0x43d0('0x2f')]['hasOwnProperty'](_0x43d0('0x35'))){_0x31a057[_0x43d0('0x19')]=qs['limit'](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x19')]);_0x31a057[_0x43d0('0x1c')]=qs[_0x43d0('0x1c')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x1c')]);}_0x31a057[_0x43d0('0x36')]=qs[_0x43d0('0x37')](_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x37')]);_0x31a057[_0x43d0('0x38')]=qs['filters'](_[_0x43d0('0x39')](_0x37d78f[_0x43d0('0x2f')],_0x4a3cd4[_0x43d0('0x30')]),_0x2f5bc5);if(_0x37d78f[_0x43d0('0x2f')][_0x43d0('0x3a')]){_0x31a057[_0x43d0('0x38')]=_[_0x43d0('0x3b')](_0x31a057[_0x43d0('0x38')],{'$or':_[_0x43d0('0x29')](_0x2f5bc5,function(_0x43bcc5){if(_0x43bcc5[_0x43d0('0x2b')]!==_0x43d0('0x3c')){var _0x19843c={};_0x19843c[_0x43bcc5[_0x43d0('0x26')]]={'$like':'%'+_0x37d78f['query'][_0x43d0('0x3a')]+'%'};return _0x19843c;}})});}_0x31a057=_[_0x43d0('0x3b')]({},_0x31a057,_0x37d78f[_0x43d0('0x3d')]);var _0xc3f9c7={'where':_0x31a057[_0x43d0('0x38')]};return db[_0x43d0('0x3e')][_0x43d0('0x1b')](_0xc3f9c7)[_0x43d0('0x22')](function(_0x4ae965){_0x2b0784['count']=_0x4ae965;if(_0x37d78f[_0x43d0('0x2f')]['includeAll']){_0x31a057['include']=[{'all':!![]}];}return db[_0x43d0('0x3e')]['findAll'](_0x31a057);})[_0x43d0('0x22')](function(_0x5027d0){_0x2b0784[_0x43d0('0x3f')]=_0x5027d0;return _0x2b0784;})['then'](respondWithFilteredResult(_0x440ecb,_0x31a057))[_0x43d0('0x40')](handleError(_0x440ecb,null));};exports[_0x43d0('0x41')]=function(_0x468b32,_0x4e817e){var _0x3eb2e9={'raw':!![],'where':{'id':_0x468b32[_0x43d0('0x42')]['id']}},_0x520406={};_0x520406['model']=_['keys'](db[_0x43d0('0x3e')][_0x43d0('0x43')]);_0x520406['query']=_[_0x43d0('0x2e')](_0x468b32[_0x43d0('0x2f')]);_0x520406[_0x43d0('0x30')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],_0x520406['query']);_0x3eb2e9[_0x43d0('0x32')]=_[_0x43d0('0x31')](_0x520406[_0x43d0('0x2d')],qs[_0x43d0('0x33')](_0x468b32['query'][_0x43d0('0x33')]));_0x3eb2e9[_0x43d0('0x32')]=_0x3eb2e9[_0x43d0('0x32')][_0x43d0('0x34')]?_0x3eb2e9[_0x43d0('0x32')]:_0x520406['model'];if(_0x468b32[_0x43d0('0x2f')][_0x43d0('0x44')]){_0x3eb2e9['include']=[{'all':!![]}];}_0x3eb2e9=_[_0x43d0('0x3b')]({},_0x3eb2e9,_0x468b32[_0x43d0('0x3d')]);return db[_0x43d0('0x3e')]['find'](_0x3eb2e9)[_0x43d0('0x22')](handleEntityNotFound(_0x4e817e,null))['then'](respondWithResult(_0x4e817e,null))[_0x43d0('0x40')](handleError(_0x4e817e,null));};exports['create']=function(_0x1f55e9,_0x269d99){return db[_0x43d0('0x3e')][_0x43d0('0x45')](_0x1f55e9[_0x43d0('0x46')],{})['then'](respondWithResult(_0x269d99,0xc9))[_0x43d0('0x40')](handleError(_0x269d99,null));};exports['update']=function(_0x5a6364,_0x3e7392){if(_0x5a6364[_0x43d0('0x46')]['id']){delete _0x5a6364[_0x43d0('0x46')]['id'];}return db[_0x43d0('0x3e')][_0x43d0('0x47')]({'where':{'id':_0x5a6364[_0x43d0('0x42')]['id']}})[_0x43d0('0x22')](handleEntityNotFound(_0x3e7392,null))[_0x43d0('0x22')](saveUpdates(_0x5a6364[_0x43d0('0x46')],null))[_0x43d0('0x22')](respondWithResult(_0x3e7392,null))[_0x43d0('0x40')](handleError(_0x3e7392,null));};exports['destroy']=function(_0x338203,_0xd78af1){return db[_0x43d0('0x3e')]['find']({'where':{'id':_0x338203[_0x43d0('0x42')]['id']}})['then'](handleEntityNotFound(_0xd78af1,null))['then'](removeEntity(_0xd78af1,null))[_0x43d0('0x40')](handleError(_0xd78af1,null));};exports[_0x43d0('0x48')]=function(_0x234571,_0x127815){return db[_0x43d0('0x3e')]['describe']()['then'](respondWithResult(_0x127815,null))[_0x43d0('0x40')](handleError(_0x127815,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 23543e1..b2fae88 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 _0x263d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash'];(function(_0x582e67,_0x463401){var _0x40002c=function(_0x556e21){while(--_0x556e21){_0x582e67['push'](_0x582e67['shift']());}};_0x40002c(++_0x463401);}(_0x263d,0x8b));var _0xd263=function(_0x534c8f,_0x500079){_0x534c8f=_0x534c8f-0x0;var _0x5a57f5=_0x263d[_0x534c8f];return _0x5a57f5;};'use strict';var _=require(_0xd263('0x0'));var util=require('util');var logger=require(_0xd263('0x1'))(_0xd263('0x2'));var moment=require(_0xd263('0x3'));var BPromise=require(_0xd263('0x4'));var rp=require(_0xd263('0x5'));var fs=require('fs');var path=require(_0xd263('0x6'));var rimraf=require(_0xd263('0x7'));var config=require(_0xd263('0x8'));var attributes=require(_0xd263('0x9'));module[_0xd263('0xa')]=function(_0x39b82e,_0x9dcb7e){return _0x39b82e['define'](_0xd263('0xb'),attributes,{'tableName':_0xd263('0xc'),'paranoid':![],'indexes':[{'name':_0xd263('0xd'),'fields':[_0xd263('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc87b=['define','report_mail_queue','uniqueid','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x294a84,_0x24aec2){var _0x16ee8e=function(_0x2c7ab9){while(--_0x2c7ab9){_0x294a84['push'](_0x294a84['shift']());}};_0x16ee8e(++_0x24aec2);}(_0xc87b,0x1a3));var _0xbc87=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc87b[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xbc87('0x0'));var util=require(_0xbc87('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbc87('0x2'));var BPromise=require(_0xbc87('0x3'));var rp=require(_0xbc87('0x4'));var fs=require('fs');var path=require(_0xbc87('0x5'));var rimraf=require(_0xbc87('0x6'));var config=require(_0xbc87('0x7'));var attributes=require(_0xbc87('0x8'));module[_0xbc87('0x9')]=function(_0x183471,_0x4e2c23){return _0x183471[_0xbc87('0xa')]('MailQueueReport',attributes,{'tableName':_0xbc87('0xb'),'paranoid':![],'indexes':[{'name':_0xbc87('0xc'),'fields':[_0xbc87('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3fb1b34..985f7e7 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x563b7f,_0x28baef){var _0xb93eb5=function(_0x41b9a6){while(--_0x41b9a6){_0x563b7f['push'](_0x563b7f['shift']());}};_0xb93eb5(++_0x28baef);}(_0x1261,0x144));var _0x1126=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0x1261[_0x32e649];return _0x14d386;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});}; \ No newline at end of file +var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e83b8,_0x49eef9){var _0x4acbdd=function(_0x426787){while(--_0x426787){_0x2e83b8['push'](_0x2e83b8['shift']());}};_0x4acbdd(++_0x49eef9);}(_0x326f,0xd1));var _0xf326=function(_0x38b37d,_0x2bb2ab){_0x38b37d=_0x38b37d-0x0;var _0x19b0cb=_0x326f[_0x38b37d];return _0x19b0cb;};'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')]('MailQueueReport,\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')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 4cfc287..f7f6f75 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5cbd7b,_0x207439){var _0x3fdfb8=function(_0x4eb12e){while(--_0x4eb12e){_0x5cbd7b['push'](_0x5cbd7b['shift']());}};_0x3fdfb8(++_0x207439);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2ba054,_0x4cfa79){var _0x5d2153=function(_0xd698b4){while(--_0xd698b4){_0x2ba054['push'](_0x2ba054['shift']());}};_0x5d2153(++_0x4cfa79);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index a93b99f..92fc82a 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 _0xbdb7=['INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x358fd3,_0x4a9c44){var _0x1ad0f3=function(_0x3c098d){while(--_0x3c098d){_0x358fd3['push'](_0x358fd3['shift']());}};_0x1ad0f3(++_0x4a9c44);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x32b79a,_0xd2538a){_0x32b79a=_0x32b79a-0x0;var _0x483450=_0xbdb7[_0x32b79a];return _0x483450;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'description':{'type':Sequelize[_0x7bdb('0x2')]},'host':{'type':Sequelize[_0x7bdb('0x2')]},'authentication':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7bdb('0x2')]},'password':{'type':Sequelize[_0x7bdb('0x2')]},'port':{'type':Sequelize[_0x7bdb('0x4')]},'tls':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x7bdb('0x2')]}}; \ No newline at end of file +var _0xb9be=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x247aab,_0x6d308){var _0x198cd0=function(_0x2bf3a4){while(--_0x2bf3a4){_0x247aab['push'](_0x247aab['shift']());}};_0x198cd0(++_0x6d308);}(_0xb9be,0xc5));var _0xeb9b=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xb9be[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'description':{'type':Sequelize[_0xeb9b('0x2')]},'host':{'type':Sequelize[_0xeb9b('0x2')]},'authentication':{'type':Sequelize[_0xeb9b('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xeb9b('0x2')]},'password':{'type':Sequelize[_0xeb9b('0x2')]},'port':{'type':Sequelize[_0xeb9b('0x4')]},'tls':{'type':Sequelize[_0xeb9b('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xeb9b('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xeb9b('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 5a46dd4..7406e66 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 _0xaf57=['rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x586adc,_0x2271e1){var _0x1aefbf=function(_0x287992){while(--_0x287992){_0x586adc['push'](_0x586adc['shift']());}};_0x1aefbf(++_0x2271e1);}(_0xaf57,0x84));var _0x7af5=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xaf57[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x7af5('0x0'));var util=require(_0x7af5('0x1'));var logger=require(_0x7af5('0x2'))(_0x7af5('0x3'));var moment=require(_0x7af5('0x4'));var BPromise=require(_0x7af5('0x5'));var rp=require(_0x7af5('0x6'));var fs=require('fs');var path=require(_0x7af5('0x7'));var rimraf=require(_0x7af5('0x8'));var config=require(_0x7af5('0x9'));var attributes=require(_0x7af5('0xa'));module[_0x7af5('0xb')]=function(_0x2b0e16,_0x3f2b1c){return _0x2b0e16['define'](_0x7af5('0xc'),attributes,{'tableName':_0x7af5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0f1=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','define','mail_servers_in'];(function(_0xeb43fe,_0x1a7d0b){var _0x255db1=function(_0x2f0ddb){while(--_0x2f0ddb){_0xeb43fe['push'](_0xeb43fe['shift']());}};_0x255db1(++_0x1a7d0b);}(_0xc0f1,0x9c));var _0x1c0f=function(_0x46ee3c,_0x1c08f0){_0x46ee3c=_0x46ee3c-0x0;var _0x530a97=_0xc0f1[_0x46ee3c];return _0x530a97;};'use strict';var _=require(_0x1c0f('0x0'));var util=require('util');var logger=require(_0x1c0f('0x1'))(_0x1c0f('0x2'));var moment=require(_0x1c0f('0x3'));var BPromise=require(_0x1c0f('0x4'));var rp=require(_0x1c0f('0x5'));var fs=require('fs');var path=require(_0x1c0f('0x6'));var rimraf=require(_0x1c0f('0x7'));var config=require('../../config/environment');var attributes=require(_0x1c0f('0x8'));module[_0x1c0f('0x9')]=function(_0x4a7621,_0x585c6f){return _0x4a7621[_0x1c0f('0xa')]('MailServerIn',attributes,{'tableName':_0x1c0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index d505ae5..dd73b02 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 _0xe7c2=['message','result','catch','MailServerIn','findAll','options','raw','where','include','model','attributes','map','debug','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','error'];(function(_0x3c4508,_0x448513){var _0x276254=function(_0x12786c){while(--_0x12786c){_0x3c4508['push'](_0x3c4508['shift']());}};_0x276254(++_0x448513);}(_0xe7c2,0xc8));var _0x2e7c=function(_0x136909,_0x1a2ee2){_0x136909=_0x136909-0x0;var _0x15a410=_0xe7c2[_0x136909];return _0x15a410;};'use strict';var _=require(_0x2e7c('0x0'));var util=require(_0x2e7c('0x1'));var moment=require(_0x2e7c('0x2'));var BPromise=require(_0x2e7c('0x3'));var rs=require(_0x2e7c('0x4'));var fs=require('fs');var Redis=require(_0x2e7c('0x5'));var db=require(_0x2e7c('0x6'))['db'];var utils=require(_0x2e7c('0x7'));var logger=require(_0x2e7c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2e7c('0x9'));var client=jayson['client'][_0x2e7c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x375302,_0x3b45e1,_0x5bbaaa){return new BPromise(function(_0x2bbbbc,_0x205aec){return client['request'](_0x375302,_0x5bbaaa)[_0x2e7c('0xb')](function(_0x4a96cb){logger[_0x2e7c('0xc')](_0x2e7c('0xd'),_0x3b45e1,_0x2e7c('0xe'));logger['debug'](_0x2e7c('0xf'),_0x3b45e1,_0x2e7c('0xe'),JSON['stringify'](_0x4a96cb));if(_0x4a96cb[_0x2e7c('0x10')]){if(_0x4a96cb[_0x2e7c('0x10')]['code']===0x1f4){logger[_0x2e7c('0x10')](_0x2e7c('0xd'),_0x3b45e1,_0x4a96cb[_0x2e7c('0x10')][_0x2e7c('0x11')]);return _0x205aec(_0x4a96cb[_0x2e7c('0x10')][_0x2e7c('0x11')]);}logger[_0x2e7c('0x10')](_0x2e7c('0xd'),_0x3b45e1,_0x4a96cb[_0x2e7c('0x10')][_0x2e7c('0x11')]);return _0x2bbbbc(_0x4a96cb['error'][_0x2e7c('0x11')]);}else{logger[_0x2e7c('0xc')]('MailServerIn,\x20%s,\x20%s',_0x3b45e1,_0x2e7c('0xe'));_0x2bbbbc(_0x4a96cb[_0x2e7c('0x12')][_0x2e7c('0x11')]);}})[_0x2e7c('0x13')](function(_0x3c31ed){logger[_0x2e7c('0x10')]('MailServerIn,\x20%s,\x20%s',_0x3b45e1,_0x3c31ed);_0x205aec(_0x3c31ed);});});}exports['GetMailServerIn']=function(_0x2d56a2){var _0x336ffc=this;return new Promise(function(_0x22cac0,_0x23dfa4){return db[_0x2e7c('0x14')][_0x2e7c('0x15')]({'raw':_0x2d56a2['options']?_0x2d56a2[_0x2e7c('0x16')][_0x2e7c('0x17')]===undefined?!![]:![]:!![],'where':_0x2d56a2[_0x2e7c('0x16')]?_0x2d56a2[_0x2e7c('0x16')][_0x2e7c('0x18')]||null:null,'attributes':_0x2d56a2[_0x2e7c('0x16')]?_0x2d56a2[_0x2e7c('0x16')]['attributes']||null:null,'limit':_0x2d56a2[_0x2e7c('0x16')]?_0x2d56a2['options']['limit']||null:null,'include':_0x2d56a2[_0x2e7c('0x16')]?_0x2d56a2[_0x2e7c('0x16')]['include']?_['map'](_0x2d56a2['options'][_0x2e7c('0x19')],function(_0x32e9c8){return{'model':db[_0x32e9c8[_0x2e7c('0x1a')]],'as':_0x32e9c8['as'],'attributes':_0x32e9c8[_0x2e7c('0x1b')],'include':_0x32e9c8[_0x2e7c('0x19')]?_[_0x2e7c('0x1c')](_0x32e9c8['include'],function(_0x1bd59e){return{'model':db[_0x1bd59e[_0x2e7c('0x1a')]],'as':_0x1bd59e['as'],'attributes':_0x1bd59e[_0x2e7c('0x1b')],'include':_0x1bd59e[_0x2e7c('0x19')]?_[_0x2e7c('0x1c')](_0x1bd59e[_0x2e7c('0x19')],function(_0x442eef){return{'model':db[_0x442eef[_0x2e7c('0x1a')]],'as':_0x442eef['as'],'attributes':_0x442eef[_0x2e7c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2e7c('0xb')](function(_0x54889f){logger[_0x2e7c('0xc')]('GetMailServerIn',_0x2d56a2);logger[_0x2e7c('0x1d')](_0x2e7c('0x1e'),_0x2d56a2,JSON['stringify'](_0x54889f));_0x22cac0(_0x54889f);})['catch'](function(_0x5b518a){logger[_0x2e7c('0x10')](_0x2e7c('0x1e'),_0x5b518a['message'],_0x2d56a2);_0x23dfa4(_0x336ffc[_0x2e7c('0x10')](0x1f4,_0x5b518a[_0x2e7c('0x11')]));});});}; \ No newline at end of file +var _0xfa38=['request\x20sent','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s','result','catch','GetMailServerIn','findAll','options','raw','limit','include','model','map','attributes','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfa38,0x97));var _0x8fa3=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xfa38[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x8fa3('0x0'));var util=require(_0x8fa3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8fa3('0x2'));var fs=require('fs');var Redis=require(_0x8fa3('0x3'));var db=require(_0x8fa3('0x4'))['db'];var utils=require(_0x8fa3('0x5'));var logger=require('../../config/logger')(_0x8fa3('0x6'));var config=require(_0x8fa3('0x7'));var jayson=require(_0x8fa3('0x8'));var client=jayson[_0x8fa3('0x9')][_0x8fa3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x355cb3,_0x29f09c,_0x49308e){return new BPromise(function(_0x16766a,_0x28e31a){return client[_0x8fa3('0xb')](_0x355cb3,_0x49308e)[_0x8fa3('0xc')](function(_0xab324b){logger[_0x8fa3('0xd')]('MailServerIn,\x20%s,\x20%s',_0x29f09c,_0x8fa3('0xe'));logger['debug'](_0x8fa3('0xf'),_0x29f09c,'request\x20sent',JSON[_0x8fa3('0x10')](_0xab324b));if(_0xab324b[_0x8fa3('0x11')]){if(_0xab324b['error'][_0x8fa3('0x12')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x29f09c,_0xab324b[_0x8fa3('0x11')][_0x8fa3('0x13')]);return _0x28e31a(_0xab324b[_0x8fa3('0x11')][_0x8fa3('0x13')]);}logger[_0x8fa3('0x11')]('MailServerIn,\x20%s,\x20%s',_0x29f09c,_0xab324b['error'][_0x8fa3('0x13')]);return _0x16766a(_0xab324b[_0x8fa3('0x11')][_0x8fa3('0x13')]);}else{logger[_0x8fa3('0xd')](_0x8fa3('0x14'),_0x29f09c,_0x8fa3('0xe'));_0x16766a(_0xab324b[_0x8fa3('0x15')][_0x8fa3('0x13')]);}})[_0x8fa3('0x16')](function(_0x57fa5f){logger[_0x8fa3('0x11')](_0x8fa3('0x14'),_0x29f09c,_0x57fa5f);_0x28e31a(_0x57fa5f);});});}exports[_0x8fa3('0x17')]=function(_0x7027e4){var _0x406eee=this;return new Promise(function(_0x1051ea,_0x51da07){return db['MailServerIn'][_0x8fa3('0x18')]({'raw':_0x7027e4[_0x8fa3('0x19')]?_0x7027e4[_0x8fa3('0x19')][_0x8fa3('0x1a')]===undefined?!![]:![]:!![],'where':_0x7027e4[_0x8fa3('0x19')]?_0x7027e4[_0x8fa3('0x19')]['where']||null:null,'attributes':_0x7027e4['options']?_0x7027e4['options']['attributes']||null:null,'limit':_0x7027e4['options']?_0x7027e4[_0x8fa3('0x19')][_0x8fa3('0x1b')]||null:null,'include':_0x7027e4[_0x8fa3('0x19')]?_0x7027e4[_0x8fa3('0x19')][_0x8fa3('0x1c')]?_['map'](_0x7027e4[_0x8fa3('0x19')]['include'],function(_0x5adb7a){return{'model':db[_0x5adb7a[_0x8fa3('0x1d')]],'as':_0x5adb7a['as'],'attributes':_0x5adb7a['attributes'],'include':_0x5adb7a[_0x8fa3('0x1c')]?_[_0x8fa3('0x1e')](_0x5adb7a[_0x8fa3('0x1c')],function(_0xa652ab){return{'model':db[_0xa652ab[_0x8fa3('0x1d')]],'as':_0xa652ab['as'],'attributes':_0xa652ab[_0x8fa3('0x1f')],'include':_0xa652ab['include']?_['map'](_0xa652ab['include'],function(_0x2a3f20){return{'model':db[_0x2a3f20['model']],'as':_0x2a3f20['as'],'attributes':_0x2a3f20['attributes']};}):[]};}):[]};}):[]:[]})[_0x8fa3('0xc')](function(_0x1902ba){logger[_0x8fa3('0xd')](_0x8fa3('0x17'),_0x7027e4);logger[_0x8fa3('0x20')](_0x8fa3('0x17'),_0x7027e4,JSON[_0x8fa3('0x10')](_0x1902ba));_0x1051ea(_0x1902ba);})['catch'](function(_0x12a2d0){logger[_0x8fa3('0x11')](_0x8fa3('0x17'),_0x12a2d0[_0x8fa3('0x13')],_0x7027e4);_0x51da07(_0x406eee[_0x8fa3('0x11')](0x1f4,_0x12a2d0['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 3f1e302..3db394f 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(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x7a54,0x106));var _0x47a5=function(_0x3f6100,_0x21347b){_0x3f6100=_0x3f6100-0x0;var _0x3fd05d=_0x7a54[_0x3f6100];return _0x3fd05d;};'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(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x7a54,0x106));var _0x47a5=function(_0x286153,_0x1ebcab){_0x286153=_0x286153-0x0;var _0x49494e=_0x7a54[_0x286153];return _0x49494e;};'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 0983180..d4fbce9 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 _0x88a1=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x256e93,_0x27eb0a){var _0x1fd812=function(_0xddd8c0){while(--_0xddd8c0){_0x256e93['push'](_0x256e93['shift']());}};_0x1fd812(++_0x27eb0a);}(_0x88a1,0x1c7));var _0x188a=function(_0x495e9f,_0x1b1d80){_0x495e9f=_0x495e9f-0x0;var _0xb249d2=_0x88a1[_0x495e9f];return _0xb249d2;};'use strict';var Sequelize=require(_0x188a('0x0'));module['exports']={'description':{'type':Sequelize[_0x188a('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x188a('0x1')]},'pass':{'type':Sequelize[_0x188a('0x1')]},'port':{'type':Sequelize[_0x188a('0x2')]},'secure':{'type':Sequelize[_0x188a('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9341=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x3d1b15,_0x34943b){var _0x702086=function(_0x492375){while(--_0x492375){_0x3d1b15['push'](_0x3d1b15['shift']());}};_0x702086(++_0x34943b);}(_0x9341,0xc8));var _0x1934=function(_0x55d27a,_0x2ef299){_0x55d27a=_0x55d27a-0x0;var _0x58963e=_0x9341[_0x55d27a];return _0x58963e;};'use strict';var Sequelize=require(_0x1934('0x0'));module[_0x1934('0x1')]={'description':{'type':Sequelize[_0x1934('0x2')]},'host':{'type':Sequelize[_0x1934('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x1934('0x2')]},'port':{'type':Sequelize[_0x1934('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x1934('0x2')]},'authentication':{'type':Sequelize[_0x1934('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 a18239a..ec90b9f 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 _0x389b=['fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','MailServerOut','includeAll','rows','catch','show','params','keys','create','update','body','find','eml-format','rimraf','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','model','query','attributes','intersection'];(function(_0x240d87,_0x3a43a3){var _0x37ffe0=function(_0x59986c){while(--_0x59986c){_0x240d87['push'](_0x240d87['shift']());}};_0x37ffe0(++_0x3a43a3);}(_0x389b,0x1c8));var _0xb389=function(_0x10345e,_0x4f4ff4){_0x10345e=_0x10345e-0x0;var _0x19e40a=_0x389b[_0x10345e];return _0x19e40a;};'use strict';var emlformat=require(_0xb389('0x0'));var rimraf=require(_0xb389('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb389('0x2'));var Mustache=require(_0xb389('0x3'));var util=require(_0xb389('0x4'));var path=require(_0xb389('0x5'));var sox=require('sox');var csv=require(_0xb389('0x6'));var ejs=require(_0xb389('0x7'));var fs=require('fs');var fs_extra=require(_0xb389('0x8'));var _=require('lodash');var squel=require(_0xb389('0x9'));var crypto=require(_0xb389('0xa'));var jsforce=require(_0xb389('0xb'));var deskjs=require(_0xb389('0xc'));var toCsv=require(_0xb389('0x6'));var querystring=require(_0xb389('0xd'));var Papa=require(_0xb389('0xe'));var Redis=require(_0xb389('0xf'));var authService=require(_0xb389('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb389('0x11'));var hardwareService=require(_0xb389('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xb389('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb389('0x14'));var db=require(_0xb389('0x15'))['db'];function respondWithStatusCode(_0x5453c5,_0x34d86e){_0x34d86e=_0x34d86e||0xcc;return function(_0xe97082){if(_0xe97082){return _0x5453c5['sendStatus'](_0x34d86e);}return _0x5453c5['status'](_0x34d86e)[_0xb389('0x16')]();};}function respondWithResult(_0xf5a05e,_0x3a6d1f){_0x3a6d1f=_0x3a6d1f||0xc8;return function(_0x32be0c){if(_0x32be0c){return _0xf5a05e[_0xb389('0x17')](_0x3a6d1f)[_0xb389('0x18')](_0x32be0c);}};}function respondWithFilteredResult(_0x27c1fb,_0x2b1d93){return function(_0x43e283){if(_0x43e283){var _0x515038=typeof _0x2b1d93['offset']===_0xb389('0x19')&&typeof _0x2b1d93[_0xb389('0x1a')]===_0xb389('0x19');var _0x34e47f=_0x43e283[_0xb389('0x1b')];var _0xce705a=_0x515038?0x0:_0x2b1d93[_0xb389('0x1c')];var _0x1cd28e=_0x515038?_0x43e283[_0xb389('0x1b')]:_0x2b1d93[_0xb389('0x1c')]+_0x2b1d93['limit'];var _0x2cfb50;if(_0x1cd28e>=_0x34e47f){_0x1cd28e=_0x34e47f;_0x2cfb50=0xc8;}else{_0x2cfb50=0xce;}_0x27c1fb['status'](_0x2cfb50);return _0x27c1fb[_0xb389('0x1d')](_0xb389('0x1e'),_0xce705a+'-'+_0x1cd28e+'/'+_0x34e47f)[_0xb389('0x18')](_0x43e283);}return null;};}function patchUpdates(_0x1e9e38){return function(_0x2c2ae4){try{jsonpatch[_0xb389('0x1f')](_0x2c2ae4,_0x1e9e38,!![]);}catch(_0xa1cc10){return BPromise[_0xb389('0x20')](_0xa1cc10);}return _0x2c2ae4[_0xb389('0x21')]();};}function saveUpdates(_0x7fafb0,_0x4c00af){return function(_0x5b5f17){if(_0x5b5f17){return _0x5b5f17['update'](_0x7fafb0)[_0xb389('0x22')](function(_0x3d452b){return _0x3d452b;});}return null;};}function removeEntity(_0x29bd67,_0x10e4f7){return function(_0x15a4bb){if(_0x15a4bb){return _0x15a4bb[_0xb389('0x23')]()[_0xb389('0x22')](function(){_0x29bd67[_0xb389('0x17')](0xcc)[_0xb389('0x16')]();});}};}function handleEntityNotFound(_0x9afcf3,_0x291a2c){return function(_0x15d7f8){if(!_0x15d7f8){_0x9afcf3[_0xb389('0x24')](0x194);}return _0x15d7f8;};}function handleError(_0x29400d,_0x2ce36d){_0x2ce36d=_0x2ce36d||0x1f4;return function(_0x4e139a){logger[_0xb389('0x25')](_0x4e139a['stack']);if(_0x4e139a[_0xb389('0x26')]){delete _0x4e139a['name'];}_0x29400d[_0xb389('0x17')](_0x2ce36d)[_0xb389('0x27')](_0x4e139a);};}exports[_0xb389('0x28')]=function(_0x6ff35d,_0x1b58c0){var _0x57579d={},_0x33b22d={},_0x4df776={'count':0x0,'rows':[]};var _0x2de37=_[_0xb389('0x29')](db['MailServerOut'][_0xb389('0x2a')],function(_0x38cdfb){return{'name':_0x38cdfb[_0xb389('0x2b')],'type':_0x38cdfb['type']['key']};});_0x33b22d[_0xb389('0x2c')]=_['map'](_0x2de37,'name');_0x33b22d[_0xb389('0x2d')]=_['keys'](_0x6ff35d[_0xb389('0x2d')]);_0x33b22d['filters']=_['intersection'](_0x33b22d[_0xb389('0x2c')],_0x33b22d[_0xb389('0x2d')]);_0x57579d[_0xb389('0x2e')]=_[_0xb389('0x2f')](_0x33b22d[_0xb389('0x2c')],qs[_0xb389('0x30')](_0x6ff35d[_0xb389('0x2d')][_0xb389('0x30')]));_0x57579d[_0xb389('0x2e')]=_0x57579d[_0xb389('0x2e')][_0xb389('0x31')]?_0x57579d[_0xb389('0x2e')]:_0x33b22d[_0xb389('0x2c')];if(!_0x6ff35d['query'][_0xb389('0x32')](_0xb389('0x33'))){_0x57579d[_0xb389('0x1a')]=qs[_0xb389('0x1a')](_0x6ff35d[_0xb389('0x2d')]['limit']);_0x57579d[_0xb389('0x1c')]=qs[_0xb389('0x1c')](_0x6ff35d[_0xb389('0x2d')][_0xb389('0x1c')]);}_0x57579d[_0xb389('0x34')]=qs[_0xb389('0x35')](_0x6ff35d[_0xb389('0x2d')]['sort']);_0x57579d[_0xb389('0x36')]=qs[_0xb389('0x37')](_[_0xb389('0x38')](_0x6ff35d[_0xb389('0x2d')],_0x33b22d[_0xb389('0x37')]),_0x2de37);if(_0x6ff35d['query'][_0xb389('0x39')]){_0x57579d[_0xb389('0x36')]=_[_0xb389('0x3a')](_0x57579d[_0xb389('0x36')],{'$or':_['map'](_0x2de37,function(_0x5027c6){if(_0x5027c6[_0xb389('0x3b')]!==_0xb389('0x3c')){var _0x18ea37={};_0x18ea37[_0x5027c6[_0xb389('0x26')]]={'$like':'%'+_0x6ff35d['query'][_0xb389('0x39')]+'%'};return _0x18ea37;}})});}_0x57579d=_['merge']({},_0x57579d,_0x6ff35d['options']);var _0x161990={'where':_0x57579d['where']};return db[_0xb389('0x3d')]['count'](_0x161990)['then'](function(_0xd73aa1){_0x4df776[_0xb389('0x1b')]=_0xd73aa1;if(_0x6ff35d[_0xb389('0x2d')][_0xb389('0x3e')]){_0x57579d['include']=[{'all':!![]}];}return db[_0xb389('0x3d')]['findAll'](_0x57579d);})[_0xb389('0x22')](function(_0xa8782){_0x4df776[_0xb389('0x3f')]=_0xa8782;return _0x4df776;})['then'](respondWithFilteredResult(_0x1b58c0,_0x57579d))[_0xb389('0x40')](handleError(_0x1b58c0,null));};exports[_0xb389('0x41')]=function(_0x58cdf4,_0xfab785){var _0x52c487={'raw':!![],'where':{'id':_0x58cdf4[_0xb389('0x42')]['id']}},_0x27fd44={};_0x27fd44[_0xb389('0x2c')]=_[_0xb389('0x43')](db[_0xb389('0x3d')][_0xb389('0x2a')]);_0x27fd44[_0xb389('0x2d')]=_['keys'](_0x58cdf4[_0xb389('0x2d')]);_0x27fd44['filters']=_[_0xb389('0x2f')](_0x27fd44[_0xb389('0x2c')],_0x27fd44[_0xb389('0x2d')]);_0x52c487[_0xb389('0x2e')]=_[_0xb389('0x2f')](_0x27fd44['model'],qs[_0xb389('0x30')](_0x58cdf4[_0xb389('0x2d')][_0xb389('0x30')]));_0x52c487[_0xb389('0x2e')]=_0x52c487[_0xb389('0x2e')][_0xb389('0x31')]?_0x52c487[_0xb389('0x2e')]:_0x27fd44[_0xb389('0x2c')];if(_0x58cdf4[_0xb389('0x2d')][_0xb389('0x3e')]){_0x52c487['include']=[{'all':!![]}];}_0x52c487=_[_0xb389('0x3a')]({},_0x52c487,_0x58cdf4['options']);return db[_0xb389('0x3d')]['find'](_0x52c487)['then'](handleEntityNotFound(_0xfab785,null))['then'](respondWithResult(_0xfab785,null))['catch'](handleError(_0xfab785,null));};exports[_0xb389('0x44')]=function(_0x41d63d,_0x36e2ad){return db['MailServerOut'][_0xb389('0x44')](_0x41d63d['body'],{})[_0xb389('0x22')](respondWithResult(_0x36e2ad,0xc9))[_0xb389('0x40')](handleError(_0x36e2ad,null));};exports[_0xb389('0x45')]=function(_0x601865,_0x29995a){if(_0x601865[_0xb389('0x46')]['id']){delete _0x601865['body']['id'];}return db[_0xb389('0x3d')][_0xb389('0x47')]({'where':{'id':_0x601865['params']['id']}})['then'](handleEntityNotFound(_0x29995a,null))[_0xb389('0x22')](saveUpdates(_0x601865[_0xb389('0x46')],null))[_0xb389('0x22')](respondWithResult(_0x29995a,null))[_0xb389('0x40')](handleError(_0x29995a,null));};exports[_0xb389('0x23')]=function(_0x2cc584,_0x452046){return db[_0xb389('0x3d')][_0xb389('0x47')]({'where':{'id':_0x2cc584[_0xb389('0x42')]['id']}})[_0xb389('0x22')](handleEntityNotFound(_0x452046,null))[_0xb389('0x22')](removeEntity(_0x452046,null))['catch'](handleError(_0x452046,null));}; \ No newline at end of file +var _0x2d54=['find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','index','MailServerOut','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','keys','includeAll','options'];(function(_0x2eaa6b,_0x5f3658){var _0x4770c9=function(_0x1a22a2){while(--_0x1a22a2){_0x2eaa6b['push'](_0x2eaa6b['shift']());}};_0x4770c9(++_0x5f3658);}(_0x2d54,0xdc));var _0x42d5=function(_0x4e752e,_0x479543){_0x4e752e=_0x4e752e-0x0;var _0x2392b0=_0x2d54[_0x4e752e];return _0x2392b0;};'use strict';var emlformat=require(_0x42d5('0x0'));var rimraf=require(_0x42d5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x42d5('0x2'));var rp=require(_0x42d5('0x3'));var moment=require(_0x42d5('0x4'));var BPromise=require(_0x42d5('0x5'));var Mustache=require('mustache');var util=require(_0x42d5('0x6'));var path=require('path');var sox=require(_0x42d5('0x7'));var csv=require(_0x42d5('0x8'));var ejs=require(_0x42d5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x42d5('0xa'));var squel=require(_0x42d5('0xb'));var crypto=require(_0x42d5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x42d5('0x8'));var querystring=require(_0x42d5('0xd'));var Papa=require('papaparse');var Redis=require(_0x42d5('0xe'));var authService=require(_0x42d5('0xf'));var qs=require(_0x42d5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x42d5('0x11'));var logger=require(_0x42d5('0x12'))('api');var utils=require(_0x42d5('0x13'));var config=require(_0x42d5('0x14'));var licenseUtil=require(_0x42d5('0x15'));var db=require(_0x42d5('0x16'))['db'];function respondWithStatusCode(_0x190cf1,_0x41cc6e){_0x41cc6e=_0x41cc6e||0xcc;return function(_0x1764ca){if(_0x1764ca){return _0x190cf1['sendStatus'](_0x41cc6e);}return _0x190cf1[_0x42d5('0x17')](_0x41cc6e)['end']();};}function respondWithResult(_0x17b7de,_0x420e3a){_0x420e3a=_0x420e3a||0xc8;return function(_0x10dfd3){if(_0x10dfd3){return _0x17b7de[_0x42d5('0x17')](_0x420e3a)[_0x42d5('0x18')](_0x10dfd3);}};}function respondWithFilteredResult(_0x5ef7da,_0x3d20a5){return function(_0x2763f0){if(_0x2763f0){var _0x1d380a=typeof _0x3d20a5[_0x42d5('0x19')]===_0x42d5('0x1a')&&typeof _0x3d20a5[_0x42d5('0x1b')]===_0x42d5('0x1a');var _0x172232=_0x2763f0[_0x42d5('0x1c')];var _0x8cbe9c=_0x1d380a?0x0:_0x3d20a5['offset'];var _0x113136=_0x1d380a?_0x2763f0[_0x42d5('0x1c')]:_0x3d20a5[_0x42d5('0x19')]+_0x3d20a5[_0x42d5('0x1b')];var _0x52d60f;if(_0x113136>=_0x172232){_0x113136=_0x172232;_0x52d60f=0xc8;}else{_0x52d60f=0xce;}_0x5ef7da[_0x42d5('0x17')](_0x52d60f);return _0x5ef7da[_0x42d5('0x1d')](_0x42d5('0x1e'),_0x8cbe9c+'-'+_0x113136+'/'+_0x172232)[_0x42d5('0x18')](_0x2763f0);}return null;};}function patchUpdates(_0x5c35e3){return function(_0x25c802){try{jsonpatch[_0x42d5('0x1f')](_0x25c802,_0x5c35e3,!![]);}catch(_0x3e2e47){return BPromise['reject'](_0x3e2e47);}return _0x25c802[_0x42d5('0x20')]();};}function saveUpdates(_0x31cc7b,_0x2f6387){return function(_0x17ae3d){if(_0x17ae3d){return _0x17ae3d[_0x42d5('0x21')](_0x31cc7b)['then'](function(_0x5209f7){return _0x5209f7;});}return null;};}function removeEntity(_0xdc4a24,_0x41c02c){return function(_0x40b1c0){if(_0x40b1c0){return _0x40b1c0[_0x42d5('0x22')]()[_0x42d5('0x23')](function(){_0xdc4a24[_0x42d5('0x17')](0xcc)[_0x42d5('0x24')]();});}};}function handleEntityNotFound(_0x43717a,_0x37d7ff){return function(_0x50b53f){if(!_0x50b53f){_0x43717a['sendStatus'](0x194);}return _0x50b53f;};}function handleError(_0x100f84,_0x41b3b3){_0x41b3b3=_0x41b3b3||0x1f4;return function(_0x6a5025){logger[_0x42d5('0x25')](_0x6a5025[_0x42d5('0x26')]);if(_0x6a5025[_0x42d5('0x27')]){delete _0x6a5025[_0x42d5('0x27')];}_0x100f84[_0x42d5('0x17')](_0x41b3b3)['send'](_0x6a5025);};}exports[_0x42d5('0x28')]=function(_0x4d45d4,_0x533a61){var _0x16db02={},_0xc564eb={},_0x54ff3f={'count':0x0,'rows':[]};var _0x10f6ba=_['map'](db[_0x42d5('0x29')][_0x42d5('0x2a')],function(_0x5ea847){return{'name':_0x5ea847[_0x42d5('0x2b')],'type':_0x5ea847['type']['key']};});_0xc564eb[_0x42d5('0x2c')]=_[_0x42d5('0x2d')](_0x10f6ba,_0x42d5('0x27'));_0xc564eb[_0x42d5('0x2e')]=_['keys'](_0x4d45d4[_0x42d5('0x2e')]);_0xc564eb[_0x42d5('0x2f')]=_['intersection'](_0xc564eb['model'],_0xc564eb['query']);_0x16db02[_0x42d5('0x30')]=_[_0x42d5('0x31')](_0xc564eb['model'],qs[_0x42d5('0x32')](_0x4d45d4['query'][_0x42d5('0x32')]));_0x16db02[_0x42d5('0x30')]=_0x16db02[_0x42d5('0x30')][_0x42d5('0x33')]?_0x16db02[_0x42d5('0x30')]:_0xc564eb[_0x42d5('0x2c')];if(!_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x34')]('nolimit')){_0x16db02['limit']=qs[_0x42d5('0x1b')](_0x4d45d4[_0x42d5('0x2e')]['limit']);_0x16db02[_0x42d5('0x19')]=qs[_0x42d5('0x19')](_0x4d45d4['query'][_0x42d5('0x19')]);}_0x16db02[_0x42d5('0x35')]=qs[_0x42d5('0x36')](_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x36')]);_0x16db02[_0x42d5('0x37')]=qs['filters'](_[_0x42d5('0x38')](_0x4d45d4[_0x42d5('0x2e')],_0xc564eb[_0x42d5('0x2f')]),_0x10f6ba);if(_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x39')]){_0x16db02[_0x42d5('0x37')]=_[_0x42d5('0x3a')](_0x16db02['where'],{'$or':_[_0x42d5('0x2d')](_0x10f6ba,function(_0x509074){if(_0x509074['type']!==_0x42d5('0x3b')){var _0x20ddbb={};_0x20ddbb[_0x509074[_0x42d5('0x27')]]={'$like':'%'+_0x4d45d4[_0x42d5('0x2e')][_0x42d5('0x39')]+'%'};return _0x20ddbb;}})});}_0x16db02=_[_0x42d5('0x3a')]({},_0x16db02,_0x4d45d4['options']);var _0x298d4a={'where':_0x16db02[_0x42d5('0x37')]};return db[_0x42d5('0x29')]['count'](_0x298d4a)[_0x42d5('0x23')](function(_0x5d3530){_0x54ff3f[_0x42d5('0x1c')]=_0x5d3530;if(_0x4d45d4['query']['includeAll']){_0x16db02[_0x42d5('0x3c')]=[{'all':!![]}];}return db[_0x42d5('0x29')][_0x42d5('0x3d')](_0x16db02);})[_0x42d5('0x23')](function(_0x48380f){_0x54ff3f[_0x42d5('0x3e')]=_0x48380f;return _0x54ff3f;})['then'](respondWithFilteredResult(_0x533a61,_0x16db02))[_0x42d5('0x3f')](handleError(_0x533a61,null));};exports[_0x42d5('0x40')]=function(_0x3fc517,_0x887baf){var _0x4f8d3a={'raw':!![],'where':{'id':_0x3fc517['params']['id']}},_0x8875d6={};_0x8875d6['model']=_[_0x42d5('0x41')](db[_0x42d5('0x29')][_0x42d5('0x2a')]);_0x8875d6[_0x42d5('0x2e')]=_[_0x42d5('0x41')](_0x3fc517[_0x42d5('0x2e')]);_0x8875d6[_0x42d5('0x2f')]=_[_0x42d5('0x31')](_0x8875d6['model'],_0x8875d6[_0x42d5('0x2e')]);_0x4f8d3a['attributes']=_['intersection'](_0x8875d6[_0x42d5('0x2c')],qs[_0x42d5('0x32')](_0x3fc517[_0x42d5('0x2e')][_0x42d5('0x32')]));_0x4f8d3a[_0x42d5('0x30')]=_0x4f8d3a[_0x42d5('0x30')][_0x42d5('0x33')]?_0x4f8d3a[_0x42d5('0x30')]:_0x8875d6[_0x42d5('0x2c')];if(_0x3fc517['query'][_0x42d5('0x42')]){_0x4f8d3a[_0x42d5('0x3c')]=[{'all':!![]}];}_0x4f8d3a=_[_0x42d5('0x3a')]({},_0x4f8d3a,_0x3fc517[_0x42d5('0x43')]);return db[_0x42d5('0x29')][_0x42d5('0x44')](_0x4f8d3a)[_0x42d5('0x23')](handleEntityNotFound(_0x887baf,null))[_0x42d5('0x23')](respondWithResult(_0x887baf,null))['catch'](handleError(_0x887baf,null));};exports[_0x42d5('0x45')]=function(_0x39611e,_0x57a8b4){return db['MailServerOut'][_0x42d5('0x45')](_0x39611e[_0x42d5('0x46')],{})[_0x42d5('0x23')](respondWithResult(_0x57a8b4,0xc9))[_0x42d5('0x3f')](handleError(_0x57a8b4,null));};exports['update']=function(_0xf863d2,_0x2b3910){if(_0xf863d2[_0x42d5('0x46')]['id']){delete _0xf863d2[_0x42d5('0x46')]['id'];}return db[_0x42d5('0x29')][_0x42d5('0x44')]({'where':{'id':_0xf863d2[_0x42d5('0x47')]['id']}})['then'](handleEntityNotFound(_0x2b3910,null))['then'](saveUpdates(_0xf863d2[_0x42d5('0x46')],null))[_0x42d5('0x23')](respondWithResult(_0x2b3910,null))[_0x42d5('0x3f')](handleError(_0x2b3910,null));};exports['destroy']=function(_0x34c240,_0x1db3a9){return db[_0x42d5('0x29')][_0x42d5('0x44')]({'where':{'id':_0x34c240[_0x42d5('0x47')]['id']}})[_0x42d5('0x23')](handleEntityNotFound(_0x1db3a9,null))[_0x42d5('0x23')](removeEntity(_0x1db3a9,null))[_0x42d5('0x3f')](handleError(_0x1db3a9,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 6d6b446..40c73d8 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 _0x0952=['path','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird'];(function(_0x2c74f4,_0x57fd68){var _0x2d4e8d=function(_0x498759){while(--_0x498759){_0x2c74f4['push'](_0x2c74f4['shift']());}};_0x2d4e8d(++_0x57fd68);}(_0x0952,0x67));var _0x2095=function(_0x56da23,_0x5b86b0){_0x56da23=_0x56da23-0x0;var _0x3e7ebe=_0x0952[_0x56da23];return _0x3e7ebe;};'use strict';var _=require(_0x2095('0x0'));var util=require(_0x2095('0x1'));var logger=require(_0x2095('0x2'))(_0x2095('0x3'));var moment=require('moment');var BPromise=require(_0x2095('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2095('0x5'));var rimraf=require('rimraf');var config=require(_0x2095('0x6'));var attributes=require(_0x2095('0x7'));module[_0x2095('0x8')]=function(_0x41db20,_0x1b53df){return _0x41db20[_0x2095('0x9')](_0x2095('0xa'),attributes,{'tableName':_0x2095('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2829=['path','rimraf','../../config/environment','exports','define','MailServerOut','util','../../config/logger','api','bluebird','request-promise'];(function(_0x260fcf,_0x4e8797){var _0x36d3f3=function(_0xe4c422){while(--_0xe4c422){_0x260fcf['push'](_0x260fcf['shift']());}};_0x36d3f3(++_0x4e8797);}(_0x2829,0x12f));var _0x9282=function(_0x40748f,_0x5eb440){_0x40748f=_0x40748f-0x0;var _0x3e26a2=_0x2829[_0x40748f];return _0x3e26a2;};'use strict';var _=require('lodash');var util=require(_0x9282('0x0'));var logger=require(_0x9282('0x1'))(_0x9282('0x2'));var moment=require('moment');var BPromise=require(_0x9282('0x3'));var rp=require(_0x9282('0x4'));var fs=require('fs');var path=require(_0x9282('0x5'));var rimraf=require(_0x9282('0x6'));var config=require(_0x9282('0x7'));var attributes=require('./mailServerOut.attributes');module[_0x9282('0x8')]=function(_0x5b74b6,_0x5990bd){return _0x5b74b6[_0x9282('0x9')](_0x9282('0xa'),attributes,{'tableName':'mail_servers_out','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 feaeee8..577133c 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(_0x3474ff,_0x40113a){var _0x5a4a67=function(_0x2b4121){while(--_0x2b4121){_0x3474ff['push'](_0x3474ff['shift']());}};_0x5a4a67(++_0x40113a);}(_0x1261,0x144));var _0x1126=function(_0x42d1f8,_0x22e529){_0x42d1f8=_0x42d1f8-0x0;var _0x40d234=_0x1261[_0x42d1f8];return _0x40d234;};'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 _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x1bde0a,_0x141cba){_0x1bde0a=_0x1bde0a-0x0;var _0x48a569=_0x7a54[_0x1bde0a];return _0x48a569;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index b6dd0c5..b074720 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 _0x87ec=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x13e1d6,_0x3407b8){var _0x9efcef=function(_0x1366fa){while(--_0x1366fa){_0x13e1d6['push'](_0x13e1d6['shift']());}};_0x9efcef(++_0x3407b8);}(_0x87ec,0x11f));var _0xc87e=function(_0x833395,_0x1d8c06){_0x833395=_0x833395-0x0;var _0x17475b=_0x87ec[_0x833395];return _0x17475b;};'use strict';var multer=require(_0xc87e('0x0'));var util=require(_0xc87e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc87e('0x2'));var router=express[_0xc87e('0x3')]();var fs_extra=require(_0xc87e('0x4'));var auth=require(_0xc87e('0x5'));var interaction=require(_0xc87e('0x6'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0xc87e('0x7')]('/',auth[_0xc87e('0x8')](),controller[_0xc87e('0x9')]);router[_0xc87e('0x7')]('/describe',auth[_0xc87e('0x8')](),controller['describe']);router[_0xc87e('0x7')](_0xc87e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc87e('0xb')]('/',auth[_0xc87e('0x8')](),controller[_0xc87e('0xc')]);router[_0xc87e('0xd')](_0xc87e('0xa'),auth[_0xc87e('0x8')](),controller[_0xc87e('0xe')]);router[_0xc87e('0xf')](_0xc87e('0xa'),auth[_0xc87e('0x8')](),controller[_0xc87e('0x10')]);module[_0xc87e('0x11')]=router; \ No newline at end of file +var _0x8ee2=['../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0x8ee2,0xac));var _0x28ee=function(_0x24502c,_0x491def){_0x24502c=_0x24502c-0x0;var _0x219d69=_0x8ee2[_0x24502c];return _0x219d69;};'use strict';var multer=require('multer');var util=require(_0x28ee('0x0'));var path=require(_0x28ee('0x1'));var timeout=require(_0x28ee('0x2'));var express=require(_0x28ee('0x3'));var router=express[_0x28ee('0x4')]();var fs_extra=require(_0x28ee('0x5'));var auth=require(_0x28ee('0x6'));var interaction=require(_0x28ee('0x7'));var config=require(_0x28ee('0x8'));var controller=require(_0x28ee('0x9'));router[_0x28ee('0xa')]('/',auth[_0x28ee('0xb')](),controller[_0x28ee('0xc')]);router['get']('/describe',auth[_0x28ee('0xb')](),controller[_0x28ee('0xd')]);router[_0x28ee('0xa')](_0x28ee('0xe'),auth[_0x28ee('0xb')](),controller['show']);router['post']('/',auth[_0x28ee('0xb')](),controller['create']);router[_0x28ee('0xf')](_0x28ee('0xe'),auth[_0x28ee('0xb')](),controller['update']);router[_0x28ee('0x10')](_0x28ee('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x28ee('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index cd38e8a..d3a18ef 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 _0x8375=['sequelize','exports','STRING'];(function(_0x1070b2,_0x1b7f65){var _0x271966=function(_0x56357d){while(--_0x56357d){_0x1070b2['push'](_0x1070b2['shift']());}};_0x271966(++_0x1b7f65);}(_0x8375,0xa8));var _0x5837=function(_0x52706c,_0x42d008){_0x52706c=_0x52706c-0x0;var _0xb59c9f=_0x8375[_0x52706c];return _0xb59c9f;};'use strict';var Sequelize=require(_0x5837('0x0'));module[_0x5837('0x1')]={'name':{'type':Sequelize[_0x5837('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5837('0x2')]}}; \ No newline at end of file +var _0x81c6=['exports'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x81c6,0x1d5));var _0x681c=function(_0x388c1c,_0x45ac57){_0x388c1c=_0x388c1c-0x0;var _0x2dada8=_0x81c6[_0x388c1c];return _0x2dada8;};'use strict';var Sequelize=require('sequelize');module[_0x681c('0x0')]={'name':{'type':Sequelize['STRING'],'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 29f6cef..8ac0602 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 _0xd75c=['where','filters','pick','filter','merge','map','type','VIRTUAL','options','MailSubstatus','includeAll','include','findAll','rows','catch','show','keys','find','create','body','params','describe','eml-format','zip-dir','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x1e43bf,_0x2ed581){var _0x1c4e4d=function(_0x11c742){while(--_0x11c742){_0x1e43bf['push'](_0x1e43bf['shift']());}};_0x1c4e4d(++_0x2ed581);}(_0xd75c,0xae));var _0xcd75=function(_0x147acb,_0x27af54){_0x147acb=_0x147acb-0x0;var _0x4a69f5=_0xd75c[_0x147acb];return _0x4a69f5;};'use strict';var emlformat=require(_0xcd75('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd75('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcd75('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xcd75('0x3'));var util=require('util');var path=require(_0xcd75('0x4'));var sox=require(_0xcd75('0x5'));var csv=require(_0xcd75('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd75('0x7'));var _=require(_0xcd75('0x8'));var squel=require(_0xcd75('0x9'));var crypto=require(_0xcd75('0xa'));var jsforce=require(_0xcd75('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcd75('0x6'));var querystring=require(_0xcd75('0xc'));var Papa=require(_0xcd75('0xd'));var Redis=require('ioredis');var authService=require(_0xcd75('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcd75('0xf'));var hardwareService=require(_0xcd75('0x10'));var logger=require(_0xcd75('0x11'))(_0xcd75('0x12'));var utils=require(_0xcd75('0x13'));var config=require(_0xcd75('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd75('0x15'))['db'];function respondWithStatusCode(_0x242355,_0x1007b9){_0x1007b9=_0x1007b9||0xcc;return function(_0x50ba42){if(_0x50ba42){return _0x242355['sendStatus'](_0x1007b9);}return _0x242355[_0xcd75('0x16')](_0x1007b9)['end']();};}function respondWithResult(_0x299e2f,_0x1bbd8c){_0x1bbd8c=_0x1bbd8c||0xc8;return function(_0x2fa7b7){if(_0x2fa7b7){return _0x299e2f['status'](_0x1bbd8c)['json'](_0x2fa7b7);}};}function respondWithFilteredResult(_0x29df01,_0x288cef){return function(_0x155ed8){if(_0x155ed8){var _0x9631a4=typeof _0x288cef['offset']===_0xcd75('0x17')&&typeof _0x288cef[_0xcd75('0x18')]===_0xcd75('0x17');var _0x485427=_0x155ed8['count'];var _0x16dab5=_0x9631a4?0x0:_0x288cef[_0xcd75('0x19')];var _0x5d5d7a=_0x9631a4?_0x155ed8[_0xcd75('0x1a')]:_0x288cef[_0xcd75('0x19')]+_0x288cef[_0xcd75('0x18')];var _0x3d68b1;if(_0x5d5d7a>=_0x485427){_0x5d5d7a=_0x485427;_0x3d68b1=0xc8;}else{_0x3d68b1=0xce;}_0x29df01['status'](_0x3d68b1);return _0x29df01['set'](_0xcd75('0x1b'),_0x16dab5+'-'+_0x5d5d7a+'/'+_0x485427)['json'](_0x155ed8);}return null;};}function patchUpdates(_0xb12bef){return function(_0xa48f8a){try{jsonpatch[_0xcd75('0x1c')](_0xa48f8a,_0xb12bef,!![]);}catch(_0x5c9dd1){return BPromise[_0xcd75('0x1d')](_0x5c9dd1);}return _0xa48f8a[_0xcd75('0x1e')]();};}function saveUpdates(_0x33e078,_0x1c3abf){return function(_0x33cbd5){if(_0x33cbd5){return _0x33cbd5[_0xcd75('0x1f')](_0x33e078)[_0xcd75('0x20')](function(_0x254937){return _0x254937;});}return null;};}function removeEntity(_0x103bc1,_0x250156){return function(_0x15c839){if(_0x15c839){return _0x15c839[_0xcd75('0x21')]()[_0xcd75('0x20')](function(){_0x103bc1['status'](0xcc)[_0xcd75('0x22')]();});}};}function handleEntityNotFound(_0x32fb39,_0x20db36){return function(_0x28f316){if(!_0x28f316){_0x32fb39[_0xcd75('0x23')](0x194);}return _0x28f316;};}function handleError(_0x474bbf,_0x369787){_0x369787=_0x369787||0x1f4;return function(_0xe0a429){logger[_0xcd75('0x24')](_0xe0a429[_0xcd75('0x25')]);if(_0xe0a429[_0xcd75('0x26')]){delete _0xe0a429['name'];}_0x474bbf[_0xcd75('0x16')](_0x369787)[_0xcd75('0x27')](_0xe0a429);};}exports[_0xcd75('0x28')]=function(_0x4aa0cf,_0x1e9f85){var _0x337df7={},_0x1cae90={},_0x4e7bc4={'count':0x0,'rows':[]};var _0x525a09=_['map'](db['MailSubstatus'][_0xcd75('0x29')],function(_0x4cc30c){return{'name':_0x4cc30c[_0xcd75('0x2a')],'type':_0x4cc30c['type'][_0xcd75('0x2b')]};});_0x1cae90['model']=_['map'](_0x525a09,_0xcd75('0x26'));_0x1cae90[_0xcd75('0x2c')]=_['keys'](_0x4aa0cf['query']);_0x1cae90['filters']=_[_0xcd75('0x2d')](_0x1cae90[_0xcd75('0x2e')],_0x1cae90['query']);_0x337df7['attributes']=_[_0xcd75('0x2d')](_0x1cae90[_0xcd75('0x2e')],qs[_0xcd75('0x2f')](_0x4aa0cf[_0xcd75('0x2c')][_0xcd75('0x2f')]));_0x337df7[_0xcd75('0x30')]=_0x337df7[_0xcd75('0x30')][_0xcd75('0x31')]?_0x337df7[_0xcd75('0x30')]:_0x1cae90[_0xcd75('0x2e')];if(!_0x4aa0cf['query'][_0xcd75('0x32')](_0xcd75('0x33'))){_0x337df7[_0xcd75('0x18')]=qs[_0xcd75('0x18')](_0x4aa0cf['query'][_0xcd75('0x18')]);_0x337df7[_0xcd75('0x19')]=qs[_0xcd75('0x19')](_0x4aa0cf[_0xcd75('0x2c')][_0xcd75('0x19')]);}_0x337df7[_0xcd75('0x34')]=qs['sort'](_0x4aa0cf[_0xcd75('0x2c')][_0xcd75('0x35')]);_0x337df7[_0xcd75('0x36')]=qs[_0xcd75('0x37')](_[_0xcd75('0x38')](_0x4aa0cf[_0xcd75('0x2c')],_0x1cae90[_0xcd75('0x37')]),_0x525a09);if(_0x4aa0cf['query'][_0xcd75('0x39')]){_0x337df7[_0xcd75('0x36')]=_[_0xcd75('0x3a')](_0x337df7[_0xcd75('0x36')],{'$or':_[_0xcd75('0x3b')](_0x525a09,function(_0x3be175){if(_0x3be175[_0xcd75('0x3c')]!==_0xcd75('0x3d')){var _0x5ec450={};_0x5ec450[_0x3be175[_0xcd75('0x26')]]={'$like':'%'+_0x4aa0cf[_0xcd75('0x2c')][_0xcd75('0x39')]+'%'};return _0x5ec450;}})});}_0x337df7=_['merge']({},_0x337df7,_0x4aa0cf[_0xcd75('0x3e')]);var _0x2e336a={'where':_0x337df7[_0xcd75('0x36')]};return db[_0xcd75('0x3f')]['count'](_0x2e336a)[_0xcd75('0x20')](function(_0x2e9927){_0x4e7bc4[_0xcd75('0x1a')]=_0x2e9927;if(_0x4aa0cf[_0xcd75('0x2c')][_0xcd75('0x40')]){_0x337df7[_0xcd75('0x41')]=[{'all':!![]}];}return db[_0xcd75('0x3f')][_0xcd75('0x42')](_0x337df7);})['then'](function(_0x2844eb){_0x4e7bc4[_0xcd75('0x43')]=_0x2844eb;return _0x4e7bc4;})['then'](respondWithFilteredResult(_0x1e9f85,_0x337df7))[_0xcd75('0x44')](handleError(_0x1e9f85,null));};exports[_0xcd75('0x45')]=function(_0x863576,_0x32549c){var _0x3f77d4={'raw':!![],'where':{'id':_0x863576['params']['id']}},_0x1b0317={};_0x1b0317[_0xcd75('0x2e')]=_[_0xcd75('0x46')](db[_0xcd75('0x3f')][_0xcd75('0x29')]);_0x1b0317[_0xcd75('0x2c')]=_[_0xcd75('0x46')](_0x863576[_0xcd75('0x2c')]);_0x1b0317[_0xcd75('0x37')]=_[_0xcd75('0x2d')](_0x1b0317['model'],_0x1b0317[_0xcd75('0x2c')]);_0x3f77d4[_0xcd75('0x30')]=_[_0xcd75('0x2d')](_0x1b0317[_0xcd75('0x2e')],qs['fields'](_0x863576[_0xcd75('0x2c')][_0xcd75('0x2f')]));_0x3f77d4['attributes']=_0x3f77d4[_0xcd75('0x30')]['length']?_0x3f77d4[_0xcd75('0x30')]:_0x1b0317[_0xcd75('0x2e')];if(_0x863576[_0xcd75('0x2c')]['includeAll']){_0x3f77d4['include']=[{'all':!![]}];}_0x3f77d4=_[_0xcd75('0x3a')]({},_0x3f77d4,_0x863576[_0xcd75('0x3e')]);return db['MailSubstatus'][_0xcd75('0x47')](_0x3f77d4)[_0xcd75('0x20')](handleEntityNotFound(_0x32549c,null))['then'](respondWithResult(_0x32549c,null))[_0xcd75('0x44')](handleError(_0x32549c,null));};exports[_0xcd75('0x48')]=function(_0x293d6f,_0x2fd675){return db[_0xcd75('0x3f')][_0xcd75('0x48')](_0x293d6f[_0xcd75('0x49')],{})[_0xcd75('0x20')](respondWithResult(_0x2fd675,0xc9))[_0xcd75('0x44')](handleError(_0x2fd675,null));};exports[_0xcd75('0x1f')]=function(_0x356b8a,_0x4c0d85){if(_0x356b8a[_0xcd75('0x49')]['id']){delete _0x356b8a[_0xcd75('0x49')]['id'];}return db['MailSubstatus'][_0xcd75('0x47')]({'where':{'id':_0x356b8a[_0xcd75('0x4a')]['id']}})[_0xcd75('0x20')](handleEntityNotFound(_0x4c0d85,null))[_0xcd75('0x20')](saveUpdates(_0x356b8a[_0xcd75('0x49')],null))['then'](respondWithResult(_0x4c0d85,null))[_0xcd75('0x44')](handleError(_0x4c0d85,null));};exports[_0xcd75('0x21')]=function(_0x2074b2,_0x5dff02){return db['MailSubstatus'][_0xcd75('0x47')]({'where':{'id':_0x2074b2['params']['id']}})['then'](handleEntityNotFound(_0x5dff02,null))[_0xcd75('0x20')](removeEntity(_0x5dff02,null))[_0xcd75('0x44')](handleError(_0x5dff02,null));};exports[_0xcd75('0x4b')]=function(_0x549530,_0x2124be){return db[_0xcd75('0x3f')][_0xcd75('0x4b')]()[_0xcd75('0x20')](respondWithResult(_0x2124be,null))[_0xcd75('0x44')](handleError(_0x2124be,null));}; \ No newline at end of file +var _0xa75d=['create','body','describe','eml-format','rimraf','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','merge','where','VIRTUAL','MailSubstatus','includeAll','include','findAll','rows','catch','show','params','model','keys','options','find'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0xa75d,0xea));var _0xda75=function(_0x1a60bb,_0x28aa67){_0x1a60bb=_0x1a60bb-0x0;var _0x41c815=_0xa75d[_0x1a60bb];return _0x41c815;};'use strict';var emlformat=require(_0xda75('0x0'));var rimraf=require(_0xda75('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xda75('0x2'));var Mustache=require('mustache');var util=require(_0xda75('0x3'));var path=require(_0xda75('0x4'));var sox=require(_0xda75('0x5'));var csv=require(_0xda75('0x6'));var ejs=require(_0xda75('0x7'));var fs=require('fs');var fs_extra=require(_0xda75('0x8'));var _=require(_0xda75('0x9'));var squel=require('squel');var crypto=require(_0xda75('0xa'));var jsforce=require(_0xda75('0xb'));var deskjs=require(_0xda75('0xc'));var toCsv=require('to-csv');var querystring=require(_0xda75('0xd'));var Papa=require(_0xda75('0xe'));var Redis=require(_0xda75('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xda75('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda75('0x11'));var logger=require(_0xda75('0x12'))(_0xda75('0x13'));var utils=require('../../config/utils');var config=require(_0xda75('0x14'));var licenseUtil=require(_0xda75('0x15'));var db=require(_0xda75('0x16'))['db'];function respondWithStatusCode(_0x1eda9b,_0x2e95fe){_0x2e95fe=_0x2e95fe||0xcc;return function(_0x464623){if(_0x464623){return _0x1eda9b['sendStatus'](_0x2e95fe);}return _0x1eda9b[_0xda75('0x17')](_0x2e95fe)[_0xda75('0x18')]();};}function respondWithResult(_0x454ff4,_0x55ff98){_0x55ff98=_0x55ff98||0xc8;return function(_0x3ef809){if(_0x3ef809){return _0x454ff4['status'](_0x55ff98)[_0xda75('0x19')](_0x3ef809);}};}function respondWithFilteredResult(_0x34f0b4,_0xf37fa6){return function(_0x5ec5ee){if(_0x5ec5ee){var _0x3db21d=typeof _0xf37fa6['offset']==='undefined'&&typeof _0xf37fa6[_0xda75('0x1a')]===_0xda75('0x1b');var _0x3fe3eb=_0x5ec5ee[_0xda75('0x1c')];var _0x1a44c9=_0x3db21d?0x0:_0xf37fa6['offset'];var _0x4b64cb=_0x3db21d?_0x5ec5ee[_0xda75('0x1c')]:_0xf37fa6['offset']+_0xf37fa6[_0xda75('0x1a')];var _0x54a82b;if(_0x4b64cb>=_0x3fe3eb){_0x4b64cb=_0x3fe3eb;_0x54a82b=0xc8;}else{_0x54a82b=0xce;}_0x34f0b4[_0xda75('0x17')](_0x54a82b);return _0x34f0b4[_0xda75('0x1d')](_0xda75('0x1e'),_0x1a44c9+'-'+_0x4b64cb+'/'+_0x3fe3eb)[_0xda75('0x19')](_0x5ec5ee);}return null;};}function patchUpdates(_0x526ace){return function(_0x305935){try{jsonpatch[_0xda75('0x1f')](_0x305935,_0x526ace,!![]);}catch(_0x70e22c){return BPromise['reject'](_0x70e22c);}return _0x305935['save']();};}function saveUpdates(_0x13a867,_0x4b5874){return function(_0x282757){if(_0x282757){return _0x282757[_0xda75('0x20')](_0x13a867)[_0xda75('0x21')](function(_0x151f83){return _0x151f83;});}return null;};}function removeEntity(_0x578a81,_0x67ec2b){return function(_0x4a0286){if(_0x4a0286){return _0x4a0286[_0xda75('0x22')]()[_0xda75('0x21')](function(){_0x578a81['status'](0xcc)[_0xda75('0x18')]();});}};}function handleEntityNotFound(_0x31cded,_0x4d7371){return function(_0x241288){if(!_0x241288){_0x31cded[_0xda75('0x23')](0x194);}return _0x241288;};}function handleError(_0x13ab28,_0x401444){_0x401444=_0x401444||0x1f4;return function(_0x1e3003){logger[_0xda75('0x24')](_0x1e3003[_0xda75('0x25')]);if(_0x1e3003[_0xda75('0x26')]){delete _0x1e3003[_0xda75('0x26')];}_0x13ab28[_0xda75('0x17')](_0x401444)[_0xda75('0x27')](_0x1e3003);};}exports[_0xda75('0x28')]=function(_0x449037,_0x539a7b){var _0x406749={},_0x404cae={},_0x4b112c={'count':0x0,'rows':[]};var _0x1e61c8=_[_0xda75('0x29')](db['MailSubstatus'][_0xda75('0x2a')],function(_0x4b84ac){return{'name':_0x4b84ac[_0xda75('0x2b')],'type':_0x4b84ac[_0xda75('0x2c')][_0xda75('0x2d')]};});_0x404cae['model']=_[_0xda75('0x29')](_0x1e61c8,_0xda75('0x26'));_0x404cae[_0xda75('0x2e')]=_['keys'](_0x449037[_0xda75('0x2e')]);_0x404cae[_0xda75('0x2f')]=_[_0xda75('0x30')](_0x404cae['model'],_0x404cae[_0xda75('0x2e')]);_0x406749[_0xda75('0x31')]=_[_0xda75('0x30')](_0x404cae['model'],qs['fields'](_0x449037[_0xda75('0x2e')][_0xda75('0x32')]));_0x406749['attributes']=_0x406749['attributes'][_0xda75('0x33')]?_0x406749[_0xda75('0x31')]:_0x404cae['model'];if(!_0x449037[_0xda75('0x2e')][_0xda75('0x34')](_0xda75('0x35'))){_0x406749[_0xda75('0x1a')]=qs['limit'](_0x449037[_0xda75('0x2e')][_0xda75('0x1a')]);_0x406749[_0xda75('0x36')]=qs['offset'](_0x449037[_0xda75('0x2e')][_0xda75('0x36')]);}_0x406749[_0xda75('0x37')]=qs[_0xda75('0x38')](_0x449037['query'][_0xda75('0x38')]);_0x406749['where']=qs[_0xda75('0x2f')](_[_0xda75('0x39')](_0x449037[_0xda75('0x2e')],_0x404cae[_0xda75('0x2f')]),_0x1e61c8);if(_0x449037[_0xda75('0x2e')][_0xda75('0x3a')]){_0x406749['where']=_[_0xda75('0x3b')](_0x406749[_0xda75('0x3c')],{'$or':_['map'](_0x1e61c8,function(_0x589f04){if(_0x589f04[_0xda75('0x2c')]!==_0xda75('0x3d')){var _0xb0a483={};_0xb0a483[_0x589f04[_0xda75('0x26')]]={'$like':'%'+_0x449037['query'][_0xda75('0x3a')]+'%'};return _0xb0a483;}})});}_0x406749=_['merge']({},_0x406749,_0x449037['options']);var _0x230f88={'where':_0x406749[_0xda75('0x3c')]};return db[_0xda75('0x3e')]['count'](_0x230f88)[_0xda75('0x21')](function(_0x5e6d1a){_0x4b112c[_0xda75('0x1c')]=_0x5e6d1a;if(_0x449037['query'][_0xda75('0x3f')]){_0x406749[_0xda75('0x40')]=[{'all':!![]}];}return db['MailSubstatus'][_0xda75('0x41')](_0x406749);})[_0xda75('0x21')](function(_0x4c90ce){_0x4b112c[_0xda75('0x42')]=_0x4c90ce;return _0x4b112c;})[_0xda75('0x21')](respondWithFilteredResult(_0x539a7b,_0x406749))[_0xda75('0x43')](handleError(_0x539a7b,null));};exports[_0xda75('0x44')]=function(_0x4cf836,_0x52f3c6){var _0x4dcc3b={'raw':!![],'where':{'id':_0x4cf836[_0xda75('0x45')]['id']}},_0x592199={};_0x592199[_0xda75('0x46')]=_[_0xda75('0x47')](db[_0xda75('0x3e')]['rawAttributes']);_0x592199['query']=_[_0xda75('0x47')](_0x4cf836['query']);_0x592199['filters']=_[_0xda75('0x30')](_0x592199['model'],_0x592199['query']);_0x4dcc3b[_0xda75('0x31')]=_[_0xda75('0x30')](_0x592199[_0xda75('0x46')],qs['fields'](_0x4cf836['query'][_0xda75('0x32')]));_0x4dcc3b[_0xda75('0x31')]=_0x4dcc3b['attributes'][_0xda75('0x33')]?_0x4dcc3b[_0xda75('0x31')]:_0x592199[_0xda75('0x46')];if(_0x4cf836[_0xda75('0x2e')][_0xda75('0x3f')]){_0x4dcc3b[_0xda75('0x40')]=[{'all':!![]}];}_0x4dcc3b=_['merge']({},_0x4dcc3b,_0x4cf836[_0xda75('0x48')]);return db[_0xda75('0x3e')][_0xda75('0x49')](_0x4dcc3b)[_0xda75('0x21')](handleEntityNotFound(_0x52f3c6,null))[_0xda75('0x21')](respondWithResult(_0x52f3c6,null))[_0xda75('0x43')](handleError(_0x52f3c6,null));};exports[_0xda75('0x4a')]=function(_0x56f46a,_0x3071c1){return db[_0xda75('0x3e')][_0xda75('0x4a')](_0x56f46a[_0xda75('0x4b')],{})[_0xda75('0x21')](respondWithResult(_0x3071c1,0xc9))[_0xda75('0x43')](handleError(_0x3071c1,null));};exports['update']=function(_0x2097c4,_0x44d0d6){if(_0x2097c4['body']['id']){delete _0x2097c4[_0xda75('0x4b')]['id'];}return db[_0xda75('0x3e')][_0xda75('0x49')]({'where':{'id':_0x2097c4['params']['id']}})[_0xda75('0x21')](handleEntityNotFound(_0x44d0d6,null))[_0xda75('0x21')](saveUpdates(_0x2097c4['body'],null))[_0xda75('0x21')](respondWithResult(_0x44d0d6,null))[_0xda75('0x43')](handleError(_0x44d0d6,null));};exports['destroy']=function(_0x35543d,_0x5eaafe){return db['MailSubstatus'][_0xda75('0x49')]({'where':{'id':_0x35543d['params']['id']}})['then'](handleEntityNotFound(_0x5eaafe,null))[_0xda75('0x21')](removeEntity(_0x5eaafe,null))[_0xda75('0x43')](handleError(_0x5eaafe,null));};exports['describe']=function(_0x2f1d35,_0x22121c){return db[_0xda75('0x3e')][_0xda75('0x4c')]()[_0xda75('0x21')](respondWithResult(_0x22121c,null))[_0xda75('0x43')](handleError(_0x22121c,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index b4e171d..bd5663a 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 _0x931d=['./mailSubstatus.attributes','define','MailSubstatus','lodash','api','request-promise','path','rimraf','../../config/environment'];(function(_0x4e3ac5,_0x18d402){var _0x3b408f=function(_0xd0214a){while(--_0xd0214a){_0x4e3ac5['push'](_0x4e3ac5['shift']());}};_0x3b408f(++_0x18d402);}(_0x931d,0xed));var _0xd931=function(_0x540eb8,_0x4c9bb4){_0x540eb8=_0x540eb8-0x0;var _0x587e07=_0x931d[_0x540eb8];return _0x587e07;};'use strict';var _=require(_0xd931('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd931('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd931('0x2'));var fs=require('fs');var path=require(_0xd931('0x3'));var rimraf=require(_0xd931('0x4'));var config=require(_0xd931('0x5'));var attributes=require(_0xd931('0x6'));module['exports']=function(_0x3c04b4,_0x4484d2){return _0x3c04b4[_0xd931('0x7')](_0xd931('0x8'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd892=['api','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger'];(function(_0xc40850,_0x5de9ce){var _0x3b415c=function(_0x2ad960){while(--_0x2ad960){_0xc40850['push'](_0xc40850['shift']());}};_0x3b415c(++_0x5de9ce);}(_0xd892,0x13f));var _0x2d89=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd892[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x2d89('0x0'));var util=require(_0x2d89('0x1'));var logger=require(_0x2d89('0x2'))(_0x2d89('0x3'));var moment=require('moment');var BPromise=require(_0x2d89('0x4'));var rp=require(_0x2d89('0x5'));var fs=require('fs');var path=require(_0x2d89('0x6'));var rimraf=require(_0x2d89('0x7'));var config=require(_0x2d89('0x8'));var attributes=require(_0x2d89('0x9'));module[_0x2d89('0xa')]=function(_0x5a7b62,_0x3b0327){return _0x5a7b62[_0x2d89('0xb')](_0x2d89('0xc'),attributes,{'tableName':_0x2d89('0xd'),'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 1fbd0ae..b4b8570 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 _0x5eff=['error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x41c047,_0x4208a1){var _0x113197=function(_0x67db0e){while(--_0x67db0e){_0x41c047['push'](_0x41c047['shift']());}};_0x113197(++_0x4208a1);}(_0x5eff,0x156));var _0xf5ef=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x5eff[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf5ef('0x0'));var BPromise=require('bluebird');var rs=require(_0xf5ef('0x1'));var fs=require('fs');var Redis=require(_0xf5ef('0x2'));var db=require(_0xf5ef('0x3'))['db'];var utils=require(_0xf5ef('0x4'));var logger=require(_0xf5ef('0x5'))(_0xf5ef('0x6'));var config=require(_0xf5ef('0x7'));var jayson=require(_0xf5ef('0x8'));var client=jayson['client'][_0xf5ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb09594,_0x2b0c8c,_0x16cddd){return new BPromise(function(_0x5d0414,_0x5f4e83){return client[_0xf5ef('0xa')](_0xb09594,_0x16cddd)[_0xf5ef('0xb')](function(_0x4b7ddf){logger['info'](_0xf5ef('0xc'),_0x2b0c8c,_0xf5ef('0xd'));logger[_0xf5ef('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2b0c8c,_0xf5ef('0xd'),JSON['stringify'](_0x4b7ddf));if(_0x4b7ddf['error']){if(_0x4b7ddf[_0xf5ef('0xf')][_0xf5ef('0x10')]===0x1f4){logger['error']('MailSubstatus,\x20%s,\x20%s',_0x2b0c8c,_0x4b7ddf[_0xf5ef('0xf')]['message']);return _0x5f4e83(_0x4b7ddf[_0xf5ef('0xf')][_0xf5ef('0x11')]);}logger[_0xf5ef('0xf')](_0xf5ef('0xc'),_0x2b0c8c,_0x4b7ddf[_0xf5ef('0xf')]['message']);return _0x5d0414(_0x4b7ddf[_0xf5ef('0xf')][_0xf5ef('0x11')]);}else{logger[_0xf5ef('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x2b0c8c,_0xf5ef('0xd'));_0x5d0414(_0x4b7ddf[_0xf5ef('0x13')][_0xf5ef('0x11')]);}})[_0xf5ef('0x14')](function(_0x160264){logger[_0xf5ef('0xf')](_0xf5ef('0xc'),_0x2b0c8c,_0x160264);_0x5f4e83(_0x160264);});});} \ No newline at end of file +var _0x37b6=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailSubstatus,\x20%s,\x20%s','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x37b6,0x119));var _0x637b=function(_0x4b6944,_0xeb95e3){_0x4b6944=_0x4b6944-0x0;var _0x1bf147=_0x37b6[_0x4b6944];return _0x1bf147;};'use strict';var _=require(_0x637b('0x0'));var util=require(_0x637b('0x1'));var moment=require(_0x637b('0x2'));var BPromise=require(_0x637b('0x3'));var rs=require(_0x637b('0x4'));var fs=require('fs');var Redis=require(_0x637b('0x5'));var db=require(_0x637b('0x6'))['db'];var utils=require(_0x637b('0x7'));var logger=require(_0x637b('0x8'))(_0x637b('0x9'));var config=require('../../config/environment');var jayson=require(_0x637b('0xa'));var client=jayson[_0x637b('0xb')][_0x637b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5583f9,_0x34afa4,_0x152940){return new BPromise(function(_0x320814,_0x214e2c){return client[_0x637b('0xd')](_0x5583f9,_0x152940)['then'](function(_0x30da91){logger[_0x637b('0xe')](_0x637b('0xf'),_0x34afa4,'request\x20sent');logger[_0x637b('0x10')](_0x637b('0x11'),_0x34afa4,_0x637b('0x12'),JSON[_0x637b('0x13')](_0x30da91));if(_0x30da91[_0x637b('0x14')]){if(_0x30da91[_0x637b('0x14')][_0x637b('0x15')]===0x1f4){logger[_0x637b('0x14')](_0x637b('0xf'),_0x34afa4,_0x30da91['error'][_0x637b('0x16')]);return _0x214e2c(_0x30da91['error'][_0x637b('0x16')]);}logger['error'](_0x637b('0xf'),_0x34afa4,_0x30da91[_0x637b('0x14')][_0x637b('0x16')]);return _0x320814(_0x30da91[_0x637b('0x14')][_0x637b('0x16')]);}else{logger[_0x637b('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x34afa4,_0x637b('0x12'));_0x320814(_0x30da91[_0x637b('0x17')][_0x637b('0x16')]);}})[_0x637b('0x18')](function(_0x74ee9c){logger[_0x637b('0x14')](_0x637b('0xf'),_0x34afa4,_0x74ee9c);_0x214e2c(_0x74ee9c);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 6701857..0c29db9 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 _0x3367=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy'];(function(_0xa5ce24,_0x59ccd0){var _0x48133f=function(_0x5b11e4){while(--_0x5b11e4){_0xa5ce24['push'](_0xa5ce24['shift']());}};_0x48133f(++_0x59ccd0);}(_0x3367,0x1b6));var _0x7336=function(_0x4f78f4,_0x530fb1){_0x4f78f4=_0x4f78f4-0x0;var _0x3d70e8=_0x3367[_0x4f78f4];return _0x3d70e8;};'use strict';var multer=require(_0x7336('0x0'));var util=require(_0x7336('0x1'));var path=require(_0x7336('0x2'));var timeout=require(_0x7336('0x3'));var express=require('express');var router=express[_0x7336('0x4')]();var fs_extra=require(_0x7336('0x5'));var auth=require(_0x7336('0x6'));var interaction=require(_0x7336('0x7'));var config=require(_0x7336('0x8'));var controller=require(_0x7336('0x9'));router[_0x7336('0xa')]('/',auth[_0x7336('0xb')](),controller[_0x7336('0xc')]);router[_0x7336('0xa')](_0x7336('0xd'),auth[_0x7336('0xb')](),controller[_0x7336('0xe')]);router[_0x7336('0xa')](_0x7336('0xf'),auth[_0x7336('0xb')](),controller[_0x7336('0x10')]);router[_0x7336('0x11')]('/',auth[_0x7336('0xb')](),controller[_0x7336('0x12')]);router['put'](_0x7336('0xf'),auth[_0x7336('0xb')](),controller[_0x7336('0x13')]);router[_0x7336('0x14')]('/:id',auth[_0x7336('0xb')](),controller[_0x7336('0x15')]);module[_0x7336('0x16')]=router; \ No newline at end of file +var _0xf5e3=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','/describe','post','create','put','/:id','delete','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf5e3,0x1e0));var _0x3f5e=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xf5e3[_0x5608a3];return _0x1ed50a;};'use strict';var multer=require(_0x3f5e('0x0'));var util=require(_0x3f5e('0x1'));var path=require(_0x3f5e('0x2'));var timeout=require(_0x3f5e('0x3'));var express=require(_0x3f5e('0x4'));var router=express[_0x3f5e('0x5')]();var fs_extra=require(_0x3f5e('0x6'));var auth=require(_0x3f5e('0x7'));var interaction=require(_0x3f5e('0x8'));var config=require(_0x3f5e('0x9'));var controller=require(_0x3f5e('0xa'));router['get']('/',auth[_0x3f5e('0xb')](),controller['index']);router[_0x3f5e('0xc')](_0x3f5e('0xd'),auth[_0x3f5e('0xb')](),controller['describe']);router['get']('/:id',auth[_0x3f5e('0xb')](),controller['show']);router[_0x3f5e('0xe')]('/',auth[_0x3f5e('0xb')](),controller[_0x3f5e('0xf')]);router[_0x3f5e('0x10')](_0x3f5e('0x11'),auth[_0x3f5e('0xb')](),controller['update']);router[_0x3f5e('0x12')](_0x3f5e('0x11'),auth[_0x3f5e('0xb')](),controller[_0x3f5e('0x13')]);module[_0x3f5e('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index eb9ba5b..fe48314 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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x2d85a6,_0x3fb70b){var _0x1e9138=function(_0x2c1682){while(--_0x2c1682){_0x2d85a6['push'](_0x2d85a6['shift']());}};_0x1e9138(++_0x3fb70b);}(_0xedd9,0xfc));var _0x9edd=function(_0x53db6c,_0x4b4946){_0x53db6c=_0x53db6c-0x0;var _0x16678d=_0xedd9[_0x53db6c];return _0x16678d;};'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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x4a1430,_0x503a3c){var _0x48317c=function(_0x291bab){while(--_0x291bab){_0x4a1430['push'](_0x4a1430['shift']());}};_0x48317c(++_0x503a3c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x00bb[_0x411add];return _0x238242;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 70966aa..129be65 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 _0xe7dc=['to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','json','offset','undefined','count','limit','set','apply','reject','save','update','destroy','end','sendStatus','stack','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x37f73c,_0x2844bf){var _0x5b7116=function(_0x335b2f){while(--_0x335b2f){_0x37f73c['push'](_0x37f73c['shift']());}};_0x5b7116(++_0x2844bf);}(_0xe7dc,0xd3));var _0xce7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe7dc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xce7d('0x0'));var rimraf=require(_0xce7d('0x1'));var zipdir=require(_0xce7d('0x2'));var jsonpatch=require(_0xce7d('0x3'));var rp=require(_0xce7d('0x4'));var moment=require('moment');var BPromise=require(_0xce7d('0x5'));var Mustache=require(_0xce7d('0x6'));var util=require('util');var path=require(_0xce7d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce7d('0x8'));var fs=require('fs');var fs_extra=require(_0xce7d('0x9'));var _=require(_0xce7d('0xa'));var squel=require('squel');var crypto=require(_0xce7d('0xb'));var jsforce=require(_0xce7d('0xc'));var deskjs=require(_0xce7d('0xd'));var toCsv=require(_0xce7d('0xe'));var querystring=require(_0xce7d('0xf'));var Papa=require(_0xce7d('0x10'));var Redis=require('ioredis');var authService=require(_0xce7d('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce7d('0x12'));var logger=require(_0xce7d('0x13'))(_0xce7d('0x14'));var utils=require(_0xce7d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xce7d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x179caf,_0x328113){_0x328113=_0x328113||0xcc;return function(_0x218f3e){if(_0x218f3e){return _0x179caf['sendStatus'](_0x328113);}return _0x179caf[_0xce7d('0x17')](_0x328113)['end']();};}function respondWithResult(_0x4834cd,_0xeaed6e){_0xeaed6e=_0xeaed6e||0xc8;return function(_0x5e5823){if(_0x5e5823){return _0x4834cd['status'](_0xeaed6e)[_0xce7d('0x18')](_0x5e5823);}};}function respondWithFilteredResult(_0x3825b3,_0x4bd6ae){return function(_0x5d236b){if(_0x5d236b){var _0x5776e4=typeof _0x4bd6ae[_0xce7d('0x19')]==='undefined'&&typeof _0x4bd6ae['limit']===_0xce7d('0x1a');var _0x1e96f8=_0x5d236b['count'];var _0xe5cdd1=_0x5776e4?0x0:_0x4bd6ae['offset'];var _0x1f5e5c=_0x5776e4?_0x5d236b[_0xce7d('0x1b')]:_0x4bd6ae[_0xce7d('0x19')]+_0x4bd6ae[_0xce7d('0x1c')];var _0xdba7c1;if(_0x1f5e5c>=_0x1e96f8){_0x1f5e5c=_0x1e96f8;_0xdba7c1=0xc8;}else{_0xdba7c1=0xce;}_0x3825b3[_0xce7d('0x17')](_0xdba7c1);return _0x3825b3[_0xce7d('0x1d')]('Content-Range',_0xe5cdd1+'-'+_0x1f5e5c+'/'+_0x1e96f8)[_0xce7d('0x18')](_0x5d236b);}return null;};}function patchUpdates(_0x3431b5){return function(_0x59289d){try{jsonpatch[_0xce7d('0x1e')](_0x59289d,_0x3431b5,!![]);}catch(_0x33571b){return BPromise[_0xce7d('0x1f')](_0x33571b);}return _0x59289d[_0xce7d('0x20')]();};}function saveUpdates(_0x249454,_0x5d9f82){return function(_0x2947b4){if(_0x2947b4){return _0x2947b4[_0xce7d('0x21')](_0x249454)['then'](function(_0x5fcc9e){return _0x5fcc9e;});}return null;};}function removeEntity(_0x42b8ad,_0x15f1df){return function(_0x1621da){if(_0x1621da){return _0x1621da[_0xce7d('0x22')]()['then'](function(){_0x42b8ad[_0xce7d('0x17')](0xcc)[_0xce7d('0x23')]();});}};}function handleEntityNotFound(_0x49fca8,_0x2d82e7){return function(_0x4060b3){if(!_0x4060b3){_0x49fca8[_0xce7d('0x24')](0x194);}return _0x4060b3;};}function handleError(_0x42cf98,_0x48f526){_0x48f526=_0x48f526||0x1f4;return function(_0x4ac208){logger['error'](_0x4ac208[_0xce7d('0x25')]);if(_0x4ac208[_0xce7d('0x26')]){delete _0x4ac208[_0xce7d('0x26')];}_0x42cf98[_0xce7d('0x17')](_0x48f526)['send'](_0x4ac208);};}exports[_0xce7d('0x27')]=function(_0x39274f,_0x2ae73b){var _0x1c9a93={},_0x2cdc34={},_0x3951e8={'count':0x0,'rows':[]};var _0x349f31=_[_0xce7d('0x28')](db[_0xce7d('0x29')][_0xce7d('0x2a')],function(_0x2a9a8e){return{'name':_0x2a9a8e[_0xce7d('0x2b')],'type':_0x2a9a8e[_0xce7d('0x2c')][_0xce7d('0x2d')]};});_0x2cdc34[_0xce7d('0x2e')]=_[_0xce7d('0x28')](_0x349f31,_0xce7d('0x26'));_0x2cdc34['query']=_['keys'](_0x39274f[_0xce7d('0x2f')]);_0x2cdc34[_0xce7d('0x30')]=_[_0xce7d('0x31')](_0x2cdc34[_0xce7d('0x2e')],_0x2cdc34[_0xce7d('0x2f')]);_0x1c9a93[_0xce7d('0x32')]=_[_0xce7d('0x31')](_0x2cdc34['model'],qs[_0xce7d('0x33')](_0x39274f[_0xce7d('0x2f')][_0xce7d('0x33')]));_0x1c9a93[_0xce7d('0x32')]=_0x1c9a93[_0xce7d('0x32')][_0xce7d('0x34')]?_0x1c9a93[_0xce7d('0x32')]:_0x2cdc34[_0xce7d('0x2e')];if(!_0x39274f[_0xce7d('0x2f')][_0xce7d('0x35')](_0xce7d('0x36'))){_0x1c9a93[_0xce7d('0x1c')]=qs[_0xce7d('0x1c')](_0x39274f['query']['limit']);_0x1c9a93[_0xce7d('0x19')]=qs['offset'](_0x39274f[_0xce7d('0x2f')]['offset']);}_0x1c9a93['order']=qs[_0xce7d('0x37')](_0x39274f[_0xce7d('0x2f')][_0xce7d('0x37')]);_0x1c9a93['where']=qs[_0xce7d('0x30')](_[_0xce7d('0x38')](_0x39274f['query'],_0x2cdc34['filters']),_0x349f31);if(_0x39274f[_0xce7d('0x2f')][_0xce7d('0x39')]){_0x1c9a93[_0xce7d('0x3a')]=_[_0xce7d('0x3b')](_0x1c9a93[_0xce7d('0x3a')],{'$or':_[_0xce7d('0x28')](_0x349f31,function(_0x46ce4e){if(_0x46ce4e['type']!==_0xce7d('0x3c')){var _0x4ac98b={};_0x4ac98b[_0x46ce4e['name']]={'$like':'%'+_0x39274f['query'][_0xce7d('0x39')]+'%'};return _0x4ac98b;}})});}_0x1c9a93=_[_0xce7d('0x3b')]({},_0x1c9a93,_0x39274f[_0xce7d('0x3d')]);var _0x2815a1={'where':_0x1c9a93[_0xce7d('0x3a')]};return db['MailTransferReport'][_0xce7d('0x1b')](_0x2815a1)[_0xce7d('0x3e')](function(_0x1af2cc){_0x3951e8[_0xce7d('0x1b')]=_0x1af2cc;if(_0x39274f[_0xce7d('0x2f')][_0xce7d('0x3f')]){_0x1c9a93[_0xce7d('0x40')]=[{'all':!![]}];}return db[_0xce7d('0x29')][_0xce7d('0x41')](_0x1c9a93);})['then'](function(_0x46025a){_0x3951e8[_0xce7d('0x42')]=_0x46025a;return _0x3951e8;})['then'](respondWithFilteredResult(_0x2ae73b,_0x1c9a93))['catch'](handleError(_0x2ae73b,null));};exports[_0xce7d('0x43')]=function(_0x462994,_0x133d5c){var _0x2ea0dc={'raw':!![],'where':{'id':_0x462994[_0xce7d('0x44')]['id']}},_0x181e93={};_0x181e93['model']=_[_0xce7d('0x45')](db[_0xce7d('0x29')][_0xce7d('0x2a')]);_0x181e93['query']=_[_0xce7d('0x45')](_0x462994[_0xce7d('0x2f')]);_0x181e93[_0xce7d('0x30')]=_[_0xce7d('0x31')](_0x181e93['model'],_0x181e93[_0xce7d('0x2f')]);_0x2ea0dc[_0xce7d('0x32')]=_[_0xce7d('0x31')](_0x181e93[_0xce7d('0x2e')],qs['fields'](_0x462994[_0xce7d('0x2f')]['fields']));_0x2ea0dc['attributes']=_0x2ea0dc[_0xce7d('0x32')][_0xce7d('0x34')]?_0x2ea0dc['attributes']:_0x181e93[_0xce7d('0x2e')];if(_0x462994[_0xce7d('0x2f')]['includeAll']){_0x2ea0dc['include']=[{'all':!![]}];}_0x2ea0dc=_[_0xce7d('0x3b')]({},_0x2ea0dc,_0x462994[_0xce7d('0x3d')]);return db[_0xce7d('0x29')][_0xce7d('0x46')](_0x2ea0dc)[_0xce7d('0x3e')](handleEntityNotFound(_0x133d5c,null))[_0xce7d('0x3e')](respondWithResult(_0x133d5c,null))[_0xce7d('0x47')](handleError(_0x133d5c,null));};exports[_0xce7d('0x48')]=function(_0x206a6f,_0x1d98f2){return db[_0xce7d('0x29')][_0xce7d('0x48')](_0x206a6f[_0xce7d('0x49')],{})[_0xce7d('0x3e')](respondWithResult(_0x1d98f2,0xc9))[_0xce7d('0x47')](handleError(_0x1d98f2,null));};exports[_0xce7d('0x21')]=function(_0x158aa5,_0x30a5fa){if(_0x158aa5[_0xce7d('0x49')]['id']){delete _0x158aa5[_0xce7d('0x49')]['id'];}return db['MailTransferReport'][_0xce7d('0x46')]({'where':{'id':_0x158aa5[_0xce7d('0x44')]['id']}})[_0xce7d('0x3e')](handleEntityNotFound(_0x30a5fa,null))[_0xce7d('0x3e')](saveUpdates(_0x158aa5[_0xce7d('0x49')],null))[_0xce7d('0x3e')](respondWithResult(_0x30a5fa,null))[_0xce7d('0x47')](handleError(_0x30a5fa,null));};exports['destroy']=function(_0x1e6d20,_0xd92e21){return db[_0xce7d('0x29')][_0xce7d('0x46')]({'where':{'id':_0x1e6d20['params']['id']}})[_0xce7d('0x3e')](handleEntityNotFound(_0xd92e21,null))[_0xce7d('0x3e')](removeEntity(_0xd92e21,null))['catch'](handleError(_0xd92e21,null));};exports[_0xce7d('0x4a')]=function(_0x1b82b0,_0x5b25a4){return db[_0xce7d('0x29')][_0xce7d('0x4a')]()['then'](respondWithResult(_0x5b25a4,null))[_0xce7d('0x47')](handleError(_0x5b25a4,null));}; \ No newline at end of file +var _0x569d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','name','index','map','MailTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring'];(function(_0x4fb570,_0xbb8ef8){var _0x44a1a7=function(_0x386b93){while(--_0x386b93){_0x4fb570['push'](_0x4fb570['shift']());}};_0x44a1a7(++_0xbb8ef8);}(_0x569d,0x1eb));var _0xd569=function(_0x182094,_0x269200){_0x182094=_0x182094-0x0;var _0x2e74ff=_0x569d[_0x182094];return _0x2e74ff;};'use strict';var emlformat=require(_0xd569('0x0'));var rimraf=require(_0xd569('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd569('0x2'));var BPromise=require(_0xd569('0x3'));var Mustache=require(_0xd569('0x4'));var util=require(_0xd569('0x5'));var path=require(_0xd569('0x6'));var sox=require('sox');var csv=require(_0xd569('0x7'));var ejs=require(_0xd569('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd569('0x9'));var crypto=require('crypto');var jsforce=require(_0xd569('0xa'));var deskjs=require(_0xd569('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd569('0xc'));var Papa=require(_0xd569('0xd'));var Redis=require(_0xd569('0xe'));var authService=require(_0xd569('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd569('0x10'));var hardwareService=require(_0xd569('0x11'));var logger=require(_0xd569('0x12'))(_0xd569('0x13'));var utils=require(_0xd569('0x14'));var config=require(_0xd569('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd569('0x16'))['db'];function respondWithStatusCode(_0x26d707,_0x223a72){_0x223a72=_0x223a72||0xcc;return function(_0x1a5e9a){if(_0x1a5e9a){return _0x26d707[_0xd569('0x17')](_0x223a72);}return _0x26d707[_0xd569('0x18')](_0x223a72)['end']();};}function respondWithResult(_0x27ac39,_0x1a3a9c){_0x1a3a9c=_0x1a3a9c||0xc8;return function(_0x16034d){if(_0x16034d){return _0x27ac39['status'](_0x1a3a9c)[_0xd569('0x19')](_0x16034d);}};}function respondWithFilteredResult(_0x492e56,_0x282ac7){return function(_0x5dfce2){if(_0x5dfce2){var _0x2be6f3=typeof _0x282ac7[_0xd569('0x1a')]===_0xd569('0x1b')&&typeof _0x282ac7[_0xd569('0x1c')]==='undefined';var _0xaacad=_0x5dfce2[_0xd569('0x1d')];var _0x338c47=_0x2be6f3?0x0:_0x282ac7[_0xd569('0x1a')];var _0x1e5f8c=_0x2be6f3?_0x5dfce2[_0xd569('0x1d')]:_0x282ac7[_0xd569('0x1a')]+_0x282ac7[_0xd569('0x1c')];var _0x5a379e;if(_0x1e5f8c>=_0xaacad){_0x1e5f8c=_0xaacad;_0x5a379e=0xc8;}else{_0x5a379e=0xce;}_0x492e56['status'](_0x5a379e);return _0x492e56[_0xd569('0x1e')](_0xd569('0x1f'),_0x338c47+'-'+_0x1e5f8c+'/'+_0xaacad)['json'](_0x5dfce2);}return null;};}function patchUpdates(_0x587983){return function(_0x561f9c){try{jsonpatch[_0xd569('0x20')](_0x561f9c,_0x587983,!![]);}catch(_0x1704d3){return BPromise[_0xd569('0x21')](_0x1704d3);}return _0x561f9c[_0xd569('0x22')]();};}function saveUpdates(_0x2ed673,_0x6b6b94){return function(_0x3fae39){if(_0x3fae39){return _0x3fae39[_0xd569('0x23')](_0x2ed673)['then'](function(_0x5a4451){return _0x5a4451;});}return null;};}function removeEntity(_0x40fb61,_0x5a49e0){return function(_0x3d5fd6){if(_0x3d5fd6){return _0x3d5fd6[_0xd569('0x24')]()[_0xd569('0x25')](function(){_0x40fb61[_0xd569('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11f9ac,_0x420390){return function(_0x12e5e1){if(!_0x12e5e1){_0x11f9ac[_0xd569('0x17')](0x194);}return _0x12e5e1;};}function handleError(_0x31ea53,_0x1c213f){_0x1c213f=_0x1c213f||0x1f4;return function(_0x35bb48){logger['error'](_0x35bb48['stack']);if(_0x35bb48[_0xd569('0x26')]){delete _0x35bb48['name'];}_0x31ea53[_0xd569('0x18')](_0x1c213f)['send'](_0x35bb48);};}exports[_0xd569('0x27')]=function(_0x49759f,_0x5b5a70){var _0x108879={},_0x49a0c7={},_0x49a6a5={'count':0x0,'rows':[]};var _0x557ea8=_[_0xd569('0x28')](db[_0xd569('0x29')][_0xd569('0x2a')],function(_0x21a8f2){return{'name':_0x21a8f2['fieldName'],'type':_0x21a8f2[_0xd569('0x2b')][_0xd569('0x2c')]};});_0x49a0c7[_0xd569('0x2d')]=_[_0xd569('0x28')](_0x557ea8,_0xd569('0x26'));_0x49a0c7[_0xd569('0x2e')]=_[_0xd569('0x2f')](_0x49759f['query']);_0x49a0c7[_0xd569('0x30')]=_[_0xd569('0x31')](_0x49a0c7[_0xd569('0x2d')],_0x49a0c7[_0xd569('0x2e')]);_0x108879[_0xd569('0x32')]=_[_0xd569('0x31')](_0x49a0c7[_0xd569('0x2d')],qs['fields'](_0x49759f[_0xd569('0x2e')][_0xd569('0x33')]));_0x108879['attributes']=_0x108879[_0xd569('0x32')][_0xd569('0x34')]?_0x108879['attributes']:_0x49a0c7[_0xd569('0x2d')];if(!_0x49759f[_0xd569('0x2e')]['hasOwnProperty'](_0xd569('0x35'))){_0x108879[_0xd569('0x1c')]=qs['limit'](_0x49759f[_0xd569('0x2e')][_0xd569('0x1c')]);_0x108879[_0xd569('0x1a')]=qs[_0xd569('0x1a')](_0x49759f['query'][_0xd569('0x1a')]);}_0x108879[_0xd569('0x36')]=qs[_0xd569('0x37')](_0x49759f[_0xd569('0x2e')][_0xd569('0x37')]);_0x108879['where']=qs[_0xd569('0x30')](_[_0xd569('0x38')](_0x49759f[_0xd569('0x2e')],_0x49a0c7[_0xd569('0x30')]),_0x557ea8);if(_0x49759f[_0xd569('0x2e')][_0xd569('0x39')]){_0x108879['where']=_[_0xd569('0x3a')](_0x108879[_0xd569('0x3b')],{'$or':_[_0xd569('0x28')](_0x557ea8,function(_0x11bb4a){if(_0x11bb4a[_0xd569('0x2b')]!==_0xd569('0x3c')){var _0x26df41={};_0x26df41[_0x11bb4a[_0xd569('0x26')]]={'$like':'%'+_0x49759f[_0xd569('0x2e')][_0xd569('0x39')]+'%'};return _0x26df41;}})});}_0x108879=_['merge']({},_0x108879,_0x49759f[_0xd569('0x3d')]);var _0x156839={'where':_0x108879[_0xd569('0x3b')]};return db[_0xd569('0x29')][_0xd569('0x1d')](_0x156839)[_0xd569('0x25')](function(_0x53d8de){_0x49a6a5[_0xd569('0x1d')]=_0x53d8de;if(_0x49759f[_0xd569('0x2e')][_0xd569('0x3e')]){_0x108879[_0xd569('0x3f')]=[{'all':!![]}];}return db[_0xd569('0x29')][_0xd569('0x40')](_0x108879);})['then'](function(_0x257f69){_0x49a6a5['rows']=_0x257f69;return _0x49a6a5;})[_0xd569('0x25')](respondWithFilteredResult(_0x5b5a70,_0x108879))[_0xd569('0x41')](handleError(_0x5b5a70,null));};exports[_0xd569('0x42')]=function(_0x244087,_0x4bfdc7){var _0x3139d9={'raw':!![],'where':{'id':_0x244087[_0xd569('0x43')]['id']}},_0x3664bf={};_0x3664bf[_0xd569('0x2d')]=_['keys'](db[_0xd569('0x29')]['rawAttributes']);_0x3664bf[_0xd569('0x2e')]=_['keys'](_0x244087[_0xd569('0x2e')]);_0x3664bf[_0xd569('0x30')]=_['intersection'](_0x3664bf[_0xd569('0x2d')],_0x3664bf[_0xd569('0x2e')]);_0x3139d9[_0xd569('0x32')]=_[_0xd569('0x31')](_0x3664bf[_0xd569('0x2d')],qs[_0xd569('0x33')](_0x244087[_0xd569('0x2e')][_0xd569('0x33')]));_0x3139d9[_0xd569('0x32')]=_0x3139d9[_0xd569('0x32')]['length']?_0x3139d9[_0xd569('0x32')]:_0x3664bf[_0xd569('0x2d')];if(_0x244087['query'][_0xd569('0x3e')]){_0x3139d9[_0xd569('0x3f')]=[{'all':!![]}];}_0x3139d9=_['merge']({},_0x3139d9,_0x244087['options']);return db[_0xd569('0x29')][_0xd569('0x44')](_0x3139d9)['then'](handleEntityNotFound(_0x4bfdc7,null))[_0xd569('0x25')](respondWithResult(_0x4bfdc7,null))[_0xd569('0x41')](handleError(_0x4bfdc7,null));};exports['create']=function(_0x3dc731,_0x376e73){return db[_0xd569('0x29')][_0xd569('0x45')](_0x3dc731[_0xd569('0x46')],{})[_0xd569('0x25')](respondWithResult(_0x376e73,0xc9))[_0xd569('0x41')](handleError(_0x376e73,null));};exports[_0xd569('0x23')]=function(_0x111c20,_0x5776c3){if(_0x111c20[_0xd569('0x46')]['id']){delete _0x111c20[_0xd569('0x46')]['id'];}return db[_0xd569('0x29')][_0xd569('0x44')]({'where':{'id':_0x111c20[_0xd569('0x43')]['id']}})['then'](handleEntityNotFound(_0x5776c3,null))[_0xd569('0x25')](saveUpdates(_0x111c20[_0xd569('0x46')],null))['then'](respondWithResult(_0x5776c3,null))[_0xd569('0x41')](handleError(_0x5776c3,null));};exports['destroy']=function(_0x26d498,_0x2b065d){return db['MailTransferReport'][_0xd569('0x44')]({'where':{'id':_0x26d498[_0xd569('0x43')]['id']}})[_0xd569('0x25')](handleEntityNotFound(_0x2b065d,null))[_0xd569('0x25')](removeEntity(_0x2b065d,null))[_0xd569('0x41')](handleError(_0x2b065d,null));};exports[_0xd569('0x47')]=function(_0x4f11a5,_0xfa0584){return db[_0xd569('0x29')][_0xd569('0x47')]()[_0xd569('0x25')](respondWithResult(_0xfa0584,null))[_0xd569('0x41')](handleError(_0xfa0584,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 91c1a88..2ede282 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 _0xdcf0=['./mailTransferReport.attributes','exports','MailTransferReport','uniqueid','lodash','util','api','moment','request-promise','../../config/environment'];(function(_0x1f0dcf,_0x231032){var _0x1b5c6a=function(_0x219d89){while(--_0x219d89){_0x1f0dcf['push'](_0x1f0dcf['shift']());}};_0x1b5c6a(++_0x231032);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x4892c8,_0x575dd1){_0x4892c8=_0x4892c8-0x0;var _0x8cd3cb=_0xdcf0[_0x4892c8];return _0x8cd3cb;};'use strict';var _=require(_0x0dcf('0x0'));var util=require(_0x0dcf('0x1'));var logger=require('../../config/logger')(_0x0dcf('0x2'));var moment=require(_0x0dcf('0x3'));var BPromise=require('bluebird');var rp=require(_0x0dcf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0dcf('0x5'));var attributes=require(_0x0dcf('0x6'));module[_0x0dcf('0x7')]=function(_0x2586c8,_0x1367df){return _0x2586c8['define'](_0x0dcf('0x8'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x0dcf('0x9'),'fields':[_0x0dcf('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x142c=['./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x142c,0x86));var _0xc142=function(_0x4742d0,_0x3667bd){_0x4742d0=_0x4742d0-0x0;var _0x43bc00=_0x142c[_0x4742d0];return _0x43bc00;};'use strict';var _=require(_0xc142('0x0'));var util=require('util');var logger=require(_0xc142('0x1'))(_0xc142('0x2'));var moment=require(_0xc142('0x3'));var BPromise=require('bluebird');var rp=require(_0xc142('0x4'));var fs=require('fs');var path=require(_0xc142('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc142('0x6'));module['exports']=function(_0x4033e9,_0x53b32f){return _0x4033e9[_0xc142('0x7')](_0xc142('0x8'),attributes,{'tableName':_0xc142('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 9189cc0..acaaf98 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 _0xf658=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x29835c,_0x3504c2){var _0x3c4ac0=function(_0x334b01){while(--_0x334b01){_0x29835c['push'](_0x29835c['shift']());}};_0x3c4ac0(++_0x3504c2);}(_0xf658,0x1ba));var _0x8f65=function(_0x13872d,_0x1e4cc4){_0x13872d=_0x13872d-0x0;var _0x1e71b8=_0xf658[_0x13872d];return _0x1e71b8;};'use strict';var _=require(_0x8f65('0x0'));var util=require('util');var moment=require(_0x8f65('0x1'));var BPromise=require(_0x8f65('0x2'));var rs=require(_0x8f65('0x3'));var fs=require('fs');var Redis=require(_0x8f65('0x4'));var db=require(_0x8f65('0x5'))['db'];var utils=require(_0x8f65('0x6'));var logger=require(_0x8f65('0x7'))('rpc');var config=require(_0x8f65('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8f65('0x9')][_0x8f65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x20a478,_0x51d4a7,_0x1c875e){return new BPromise(function(_0x496354,_0x2ab604){return client[_0x8f65('0xb')](_0x20a478,_0x1c875e)[_0x8f65('0xc')](function(_0x3c8fa8){logger[_0x8f65('0xd')](_0x8f65('0xe'),_0x51d4a7,_0x8f65('0xf'));logger['debug'](_0x8f65('0x10'),_0x51d4a7,_0x8f65('0xf'),JSON['stringify'](_0x3c8fa8));if(_0x3c8fa8[_0x8f65('0x11')]){if(_0x3c8fa8[_0x8f65('0x11')][_0x8f65('0x12')]===0x1f4){logger['error'](_0x8f65('0xe'),_0x51d4a7,_0x3c8fa8['error'][_0x8f65('0x13')]);return _0x2ab604(_0x3c8fa8[_0x8f65('0x11')][_0x8f65('0x13')]);}logger[_0x8f65('0x11')](_0x8f65('0xe'),_0x51d4a7,_0x3c8fa8[_0x8f65('0x11')]['message']);return _0x496354(_0x3c8fa8[_0x8f65('0x11')]['message']);}else{logger[_0x8f65('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x51d4a7,_0x8f65('0xf'));_0x496354(_0x3c8fa8[_0x8f65('0x14')][_0x8f65('0x13')]);}})[_0x8f65('0x15')](function(_0x687961){logger[_0x8f65('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x51d4a7,_0x687961);_0x2ab604(_0x687961);});});} \ No newline at end of file +var _0x0713=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x486dbe,_0x261b87){var _0x2b384b=function(_0x2e2c13){while(--_0x2e2c13){_0x486dbe['push'](_0x486dbe['shift']());}};_0x2b384b(++_0x261b87);}(_0x0713,0x9d));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3071('0x0'));var moment=require(_0x3071('0x1'));var BPromise=require('bluebird');var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3071('0x3'));var logger=require(_0x3071('0x4'))(_0x3071('0x5'));var config=require(_0x3071('0x6'));var jayson=require(_0x3071('0x7'));var client=jayson[_0x3071('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2120b3,_0x2d7142,_0x2a9940){return new BPromise(function(_0x17bd7c,_0x4a1bfb){return client[_0x3071('0x9')](_0x2120b3,_0x2a9940)[_0x3071('0xa')](function(_0x15d878){logger[_0x3071('0xb')](_0x3071('0xc'),_0x2d7142,_0x3071('0xd'));logger[_0x3071('0xe')](_0x3071('0xf'),_0x2d7142,_0x3071('0xd'),JSON[_0x3071('0x10')](_0x15d878));if(_0x15d878[_0x3071('0x11')]){if(_0x15d878[_0x3071('0x11')][_0x3071('0x12')]===0x1f4){logger[_0x3071('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2d7142,_0x15d878[_0x3071('0x11')][_0x3071('0x13')]);return _0x4a1bfb(_0x15d878[_0x3071('0x11')]['message']);}logger[_0x3071('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x2d7142,_0x15d878['error']['message']);return _0x17bd7c(_0x15d878[_0x3071('0x11')][_0x3071('0x13')]);}else{logger['info'](_0x3071('0xc'),_0x2d7142,'request\x20sent');_0x17bd7c(_0x15d878[_0x3071('0x14')][_0x3071('0x13')]);}})['catch'](function(_0x5c79e6){logger[_0x3071('0x11')](_0x3071('0xc'),_0x2d7142,_0x5c79e6);_0x4a1bfb(_0x5c79e6);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index be74981..56ac57d 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 _0xea89=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','create','put','/:id','update','delete','destroy'];(function(_0x25b241,_0x4686dc){var _0x3c787b=function(_0x257396){while(--_0x257396){_0x25b241['push'](_0x25b241['shift']());}};_0x3c787b(++_0x4686dc);}(_0xea89,0x19f));var _0x9ea8=function(_0xd0a4bb,_0x3b77c3){_0xd0a4bb=_0xd0a4bb-0x0;var _0x36fbd9=_0xea89[_0xd0a4bb];return _0x36fbd9;};'use strict';var multer=require(_0x9ea8('0x0'));var util=require(_0x9ea8('0x1'));var path=require(_0x9ea8('0x2'));var timeout=require(_0x9ea8('0x3'));var express=require('express');var router=express[_0x9ea8('0x4')]();var fs_extra=require(_0x9ea8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9ea8('0x6'));var config=require('../../config/environment');var controller=require(_0x9ea8('0x7'));router[_0x9ea8('0x8')]('/',auth[_0x9ea8('0x9')](),controller['index']);router[_0x9ea8('0x8')](_0x9ea8('0xa'),auth[_0x9ea8('0x9')](),controller['describe']);router[_0x9ea8('0x8')]('/:id',auth[_0x9ea8('0x9')](),controller['show']);router['post']('/',auth[_0x9ea8('0x9')](),controller[_0x9ea8('0xb')]);router[_0x9ea8('0xc')](_0x9ea8('0xd'),auth[_0x9ea8('0x9')](),controller[_0x9ea8('0xe')]);router[_0x9ea8('0xf')](_0x9ea8('0xd'),auth['isAuthenticated'](),controller[_0x9ea8('0x10')]);module[_0x9ea8('0x11')]=router; \ No newline at end of file +var _0xe96e=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','describe','/:id','post','create','update','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5897fd,_0x4cb296){var _0x16bd0d=function(_0x15e2da){while(--_0x15e2da){_0x5897fd['push'](_0x5897fd['shift']());}};_0x16bd0d(++_0x4cb296);}(_0xe96e,0x181));var _0xee96=function(_0x57bbb6,_0xf8575d){_0x57bbb6=_0x57bbb6-0x0;var _0x167c4f=_0xe96e[_0x57bbb6];return _0x167c4f;};'use strict';var multer=require(_0xee96('0x0'));var util=require(_0xee96('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee96('0x2')]();var fs_extra=require(_0xee96('0x3'));var auth=require(_0xee96('0x4'));var interaction=require(_0xee96('0x5'));var config=require(_0xee96('0x6'));var controller=require(_0xee96('0x7'));router[_0xee96('0x8')]('/',auth[_0xee96('0x9')](),controller[_0xee96('0xa')]);router[_0xee96('0x8')]('/describe',auth[_0xee96('0x9')](),controller[_0xee96('0xb')]);router[_0xee96('0x8')](_0xee96('0xc'),auth[_0xee96('0x9')](),controller['show']);router[_0xee96('0xd')]('/',auth[_0xee96('0x9')](),controller[_0xee96('0xe')]);router['put'](_0xee96('0xc'),auth[_0xee96('0x9')](),controller[_0xee96('0xf')]);router['delete'](_0xee96('0xc'),auth[_0xee96('0x9')](),controller[_0xee96('0x10')]);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 22e3c6f..4ad6b5a 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 _0x0aaf=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue'];(function(_0x46e68b,_0x48e7aa){var _0x44cdae=function(_0x36e8d4){while(--_0x36e8d4){_0x46e68b['push'](_0x46e68b['shift']());}};_0x44cdae(++_0x48e7aa);}(_0x0aaf,0x1c8));var _0xf0aa=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0x0aaf[_0x5c9f56];return _0x2a726b;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xf0aa('0x0')]={'channel':{'type':Sequelize[_0xf0aa('0x1')]},'membername':{'type':Sequelize[_0xf0aa('0x1')]},'interface':{'type':Sequelize[_0xf0aa('0x1')]},'type':{'type':Sequelize[_0xf0aa('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xf0aa('0x2')},'duration':{'type':Sequelize[_0xf0aa('0x3')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf0aa('0x4')],'set':function(_0x4c20b5){var _0x752f1b=moment(_0x4c20b5);var _0x4c2d11=moment(this[_0xf0aa('0x5')](_0xf0aa('0x6')));var _0x38bf88=_0x752f1b['diff'](_0x4c2d11,_0xf0aa('0x7'));this[_0xf0aa('0x8')]('exitAt',_0x4c20b5);this[_0xf0aa('0x8')](_0xf0aa('0x9'),_0x38bf88||null);}},'data1':{'type':Sequelize[_0xf0aa('0x1')],'comment':_0xf0aa('0xa')},'data2':{'type':Sequelize[_0xf0aa('0x1')],'comment':_0xf0aa('0xb')},'data3':{'type':Sequelize[_0xf0aa('0x1')],'comment':_0xf0aa('0xc')},'data4':{'type':Sequelize[_0xf0aa('0x1')],'comment':_0xf0aa('0xd')},'data5':{'type':Sequelize[_0xf0aa('0x1')],'comment':_0xf0aa('0xe')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xf0aa('0x1')]}}; \ No newline at end of file +var _0x0eec=['diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x0eec,0xac));var _0xc0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eec[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc0ee('0x0'));var moment=require('moment');module['exports']={'channel':{'type':Sequelize[_0xc0ee('0x1')]},'membername':{'type':Sequelize[_0xc0ee('0x1')]},'interface':{'type':Sequelize[_0xc0ee('0x1')]},'type':{'type':Sequelize[_0xc0ee('0x1')],'defaultValue':_0xc0ee('0x2'),'comment':_0xc0ee('0x3')},'duration':{'type':Sequelize[_0xc0ee('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc0ee('0x5')],'set':function(_0x4db3d6){var _0x218797=moment(_0x4db3d6);var _0x39022a=moment(this[_0xc0ee('0x6')](_0xc0ee('0x7')));var _0x38b387=_0x218797[_0xc0ee('0x8')](_0x39022a,_0xc0ee('0x9'));this['setDataValue'](_0xc0ee('0xa'),_0x4db3d6);this[_0xc0ee('0xb')](_0xc0ee('0xc'),_0x38b387||null);}},'data1':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0xd')},'data2':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xc0ee('0xf')},'data4':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0x10')},'data5':{'type':Sequelize[_0xc0ee('0x1')],'comment':_0xc0ee('0x11')},'role':{'type':Sequelize[_0xc0ee('0x1')]},'internal':{'type':Sequelize[_0xc0ee('0x4')]},'uniqueid':{'type':Sequelize[_0xc0ee('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 521aa8d..a43f760 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 _0x9c44=['catch','params','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','MemberReport','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows'];(function(_0x66050b,_0x1c121f){var _0x20f0aa=function(_0x54786e){while(--_0x54786e){_0x66050b['push'](_0x66050b['shift']());}};_0x20f0aa(++_0x1c121f);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={},_0x46e04d={},_0x4f28a2={'count':0x0,'rows':[]};var _0x6329b3=_[_0x49c4('0x29')](db[_0x49c4('0x2a')][_0x49c4('0x2b')],function(_0x17b50f){return{'name':_0x17b50f[_0x49c4('0x2c')],'type':_0x17b50f[_0x49c4('0x2d')]['key']};});_0x46e04d['model']=_['map'](_0x6329b3,_0x49c4('0x26'));_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d[_0x49c4('0x30')]=_['intersection'](_0x46e04d[_0x49c4('0x31')],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x46e04d['model'],qs['fields'](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x2b2793[_0x49c4('0x32')]=_0x2b2793[_0x49c4('0x32')][_0x49c4('0x35')]?_0x2b2793['attributes']:_0x46e04d[_0x49c4('0x31')];if(!_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x36')]('nolimit')){_0x2b2793['limit']=qs[_0x49c4('0x1b')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x1b')]);_0x2b2793[_0x49c4('0x19')]=qs[_0x49c4('0x19')](_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x19')]);}_0x2b2793[_0x49c4('0x37')]=qs[_0x49c4('0x38')](_0x5987ae['query'][_0x49c4('0x38')]);_0x2b2793['where']=qs[_0x49c4('0x30')](_[_0x49c4('0x39')](_0x5987ae[_0x49c4('0x2e')],_0x46e04d[_0x49c4('0x30')]),_0x6329b3);if(_0x5987ae['query'][_0x49c4('0x3a')]){_0x2b2793[_0x49c4('0x3b')]=_[_0x49c4('0x3c')](_0x2b2793['where'],{'$or':_[_0x49c4('0x29')](_0x6329b3,function(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x2d')]!==_0x49c4('0x3d')){var _0x1ba7a0={};_0x1ba7a0[_0x21d8c7[_0x49c4('0x26')]]={'$like':'%'+_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x3a')]+'%'};return _0x1ba7a0;}})});}_0x2b2793=_[_0x49c4('0x3c')]({},_0x2b2793,_0x5987ae[_0x49c4('0x3e')]);var _0x1e506a={'where':_0x2b2793['where']};return db[_0x49c4('0x2a')][_0x49c4('0x1c')](_0x1e506a)[_0x49c4('0x3f')](function(_0x23aa32){_0x4f28a2[_0x49c4('0x1c')]=_0x23aa32;if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x2b2793[_0x49c4('0x41')]=[{'all':!![]}];}return db[_0x49c4('0x2a')][_0x49c4('0x42')](_0x2b2793);})[_0x49c4('0x3f')](function(_0xa3d59e){_0x4f28a2[_0x49c4('0x43')]=_0xa3d59e;return _0x4f28a2;})['then'](respondWithFilteredResult(_0x889909,_0x2b2793))[_0x49c4('0x44')](handleError(_0x889909,null));};exports['show']=function(_0x104efb,_0x4915bc){var _0x28d4fb={'raw':!![],'where':{'id':_0x104efb[_0x49c4('0x45')]['id']}},_0x1480da={};_0x1480da[_0x49c4('0x31')]=_['keys'](db['MemberReport'][_0x49c4('0x2b')]);_0x1480da[_0x49c4('0x2e')]=_[_0x49c4('0x2f')](_0x104efb[_0x49c4('0x2e')]);_0x1480da['filters']=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],_0x1480da[_0x49c4('0x2e')]);_0x28d4fb[_0x49c4('0x32')]=_[_0x49c4('0x33')](_0x1480da[_0x49c4('0x31')],qs[_0x49c4('0x34')](_0x104efb[_0x49c4('0x2e')][_0x49c4('0x34')]));_0x28d4fb['attributes']=_0x28d4fb[_0x49c4('0x32')]['length']?_0x28d4fb[_0x49c4('0x32')]:_0x1480da[_0x49c4('0x31')];if(_0x104efb[_0x49c4('0x2e')][_0x49c4('0x40')]){_0x28d4fb[_0x49c4('0x41')]=[{'all':!![]}];}_0x28d4fb=_['merge']({},_0x28d4fb,_0x104efb[_0x49c4('0x3e')]);return db[_0x49c4('0x2a')][_0x49c4('0x46')](_0x28d4fb)[_0x49c4('0x3f')](handleEntityNotFound(_0x4915bc,null))[_0x49c4('0x3f')](respondWithResult(_0x4915bc,null))[_0x49c4('0x44')](handleError(_0x4915bc,null));};exports[_0x49c4('0x47')]=function(_0x4d89e0,_0x3bac1b){return db['MemberReport'][_0x49c4('0x47')](_0x4d89e0[_0x49c4('0x48')],{})[_0x49c4('0x3f')](respondWithResult(_0x3bac1b,0xc9))[_0x49c4('0x44')](handleError(_0x3bac1b,null));};exports[_0x49c4('0x22')]=function(_0x30bea5,_0x2c6be1){if(_0x30bea5['body']['id']){delete _0x30bea5[_0x49c4('0x48')]['id'];}return db[_0x49c4('0x2a')]['find']({'where':{'id':_0x30bea5[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x2c6be1,null))[_0x49c4('0x3f')](saveUpdates(_0x30bea5[_0x49c4('0x48')],null))['then'](respondWithResult(_0x2c6be1,null))['catch'](handleError(_0x2c6be1,null));};exports[_0x49c4('0x23')]=function(_0x4e8221,_0x4597c3){return db[_0x49c4('0x2a')][_0x49c4('0x46')]({'where':{'id':_0x4e8221[_0x49c4('0x45')]['id']}})[_0x49c4('0x3f')](handleEntityNotFound(_0x4597c3,null))[_0x49c4('0x3f')](removeEntity(_0x4597c3,null))[_0x49c4('0x44')](handleError(_0x4597c3,null));};exports['describe']=function(_0x1f26c2,_0x1550ce){return db[_0x49c4('0x2a')][_0x49c4('0x49')]()[_0x49c4('0x3f')](respondWithResult(_0x1550ce,null))[_0x49c4('0x44')](handleError(_0x1550ce,null));}; \ No newline at end of file +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(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xedd9,0xfc));var _0x9edd=function(_0xb36bbe,_0x132332){_0xb36bbe=_0xb36bbe-0x0;var _0x40d32b=_0xedd9[_0xb36bbe];return _0x40d32b;};'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 9398729..5a8d7d9 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 _0x3464=['rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x10e665,_0x3cd26e){var _0x5a29f7=function(_0x1df686){while(--_0x1df686){_0x10e665['push'](_0x10e665['shift']());}};_0x5a29f7(++_0x3cd26e);}(_0x3464,0x16e));var _0x4346=function(_0xaf29e1,_0xf2e6c2){_0xaf29e1=_0xaf29e1-0x0;var _0x482f5d=_0x3464[_0xaf29e1];return _0x482f5d;};'use strict';var _=require(_0x4346('0x0'));var util=require(_0x4346('0x1'));var logger=require(_0x4346('0x2'))(_0x4346('0x3'));var moment=require(_0x4346('0x4'));var BPromise=require(_0x4346('0x5'));var rp=require(_0x4346('0x6'));var fs=require('fs');var path=require(_0x4346('0x7'));var rimraf=require(_0x4346('0x8'));var config=require(_0x4346('0x9'));var attributes=require(_0x4346('0xa'));module['exports']=function(_0x4b6e76,_0x5e4afb){return _0x4b6e76[_0x4346('0xb')](_0x4346('0xc'),attributes,{'tableName':_0x4346('0xd'),'paranoid':![],'indexes':[{'name':_0x4346('0xe'),'fields':[_0x4346('0xf'),_0x4346('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e4e=['moment','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','api'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x1e4e,0x18c));var _0xe1e4=function(_0x2b4e47,_0x35fab7){_0x2b4e47=_0x2b4e47-0x0;var _0xa7e29a=_0x1e4e[_0x2b4e47];return _0xa7e29a;};'use strict';var _=require(_0xe1e4('0x0'));var util=require(_0xe1e4('0x1'));var logger=require(_0xe1e4('0x2'))(_0xe1e4('0x3'));var moment=require(_0xe1e4('0x4'));var BPromise=require('bluebird');var rp=require(_0xe1e4('0x5'));var fs=require('fs');var path=require(_0xe1e4('0x6'));var rimraf=require(_0xe1e4('0x7'));var config=require(_0xe1e4('0x8'));var attributes=require(_0xe1e4('0x9'));module[_0xe1e4('0xa')]=function(_0x3c444d,_0x22e3a8){return _0x3c444d[_0xe1e4('0xb')](_0xe1e4('0xc'),attributes,{'tableName':_0xe1e4('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xe1e4('0xe'),_0xe1e4('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 a185c38..c45aeb5 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 _0xd9c8=['MemberReport','options','where','attributes','include','map','model','debug','CreateMemberReport','create','body','raw','UpdateMemberReport','update','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport'];(function(_0x454165,_0x1f3e74){var _0x56db53=function(_0x23388c){while(--_0x23388c){_0x454165['push'](_0x454165['shift']());}};_0x56db53(++_0x1f3e74);}(_0xd9c8,0x15c));var _0x8d9c=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xd9c8[_0x36eaaa];return _0x461349;};'use strict';var _=require(_0x8d9c('0x0'));var util=require(_0x8d9c('0x1'));var moment=require('moment');var BPromise=require(_0x8d9c('0x2'));var rs=require(_0x8d9c('0x3'));var fs=require('fs');var Redis=require(_0x8d9c('0x4'));var db=require(_0x8d9c('0x5'))['db'];var utils=require(_0x8d9c('0x6'));var logger=require(_0x8d9c('0x7'))(_0x8d9c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x8d9c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ebb5a,_0x475edd,_0x49c96f){return new BPromise(function(_0x3790f6,_0x3de357){return client[_0x8d9c('0xa')](_0x1ebb5a,_0x49c96f)[_0x8d9c('0xb')](function(_0x2db4b3){logger[_0x8d9c('0xc')](_0x8d9c('0xd'),_0x475edd,_0x8d9c('0xe'));logger['debug'](_0x8d9c('0xf'),_0x475edd,'request\x20sent',JSON[_0x8d9c('0x10')](_0x2db4b3));if(_0x2db4b3['error']){if(_0x2db4b3[_0x8d9c('0x11')]['code']===0x1f4){logger['error'](_0x8d9c('0xd'),_0x475edd,_0x2db4b3['error'][_0x8d9c('0x12')]);return _0x3de357(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);return _0x3790f6(_0x2db4b3[_0x8d9c('0x11')][_0x8d9c('0x12')]);}else{logger[_0x8d9c('0xc')]('MemberReport,\x20%s,\x20%s',_0x475edd,_0x8d9c('0xe'));_0x3790f6(_0x2db4b3[_0x8d9c('0x13')][_0x8d9c('0x12')]);}})[_0x8d9c('0x14')](function(_0x1a071d){logger[_0x8d9c('0x11')](_0x8d9c('0xd'),_0x475edd,_0x1a071d);_0x3de357(_0x1a071d);});});}exports[_0x8d9c('0x15')]=function(_0x1ed27d){var _0x44896d=this;return new Promise(function(_0x48fffd,_0x105952){return db[_0x8d9c('0x16')]['findAll']({'raw':_0x1ed27d[_0x8d9c('0x17')]?_0x1ed27d[_0x8d9c('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1ed27d[_0x8d9c('0x17')]?_0x1ed27d[_0x8d9c('0x17')][_0x8d9c('0x18')]||null:null,'attributes':_0x1ed27d[_0x8d9c('0x17')]?_0x1ed27d['options'][_0x8d9c('0x19')]||null:null,'limit':_0x1ed27d[_0x8d9c('0x17')]?_0x1ed27d['options']['limit']||null:null,'include':_0x1ed27d[_0x8d9c('0x17')]?_0x1ed27d[_0x8d9c('0x17')][_0x8d9c('0x1a')]?_[_0x8d9c('0x1b')](_0x1ed27d[_0x8d9c('0x17')][_0x8d9c('0x1a')],function(_0x14dd83){return{'model':db[_0x14dd83['model']],'as':_0x14dd83['as'],'attributes':_0x14dd83[_0x8d9c('0x19')],'include':_0x14dd83['include']?_[_0x8d9c('0x1b')](_0x14dd83[_0x8d9c('0x1a')],function(_0x416a80){return{'model':db[_0x416a80[_0x8d9c('0x1c')]],'as':_0x416a80['as'],'attributes':_0x416a80[_0x8d9c('0x19')],'include':_0x416a80[_0x8d9c('0x1a')]?_[_0x8d9c('0x1b')](_0x416a80['include'],function(_0x57be56){return{'model':db[_0x57be56['model']],'as':_0x57be56['as'],'attributes':_0x57be56['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a78b1){logger[_0x8d9c('0xc')](_0x8d9c('0x15'),_0x1ed27d);logger[_0x8d9c('0x1d')]('GetMemberReport',_0x1ed27d,JSON[_0x8d9c('0x10')](_0x1a78b1));_0x48fffd(_0x1a78b1);})[_0x8d9c('0x14')](function(_0x59e24b){logger['error'](_0x8d9c('0x15'),_0x59e24b['message'],_0x1ed27d);_0x105952(_0x44896d[_0x8d9c('0x11')](0x1f4,_0x59e24b[_0x8d9c('0x12')]));});});};exports[_0x8d9c('0x1e')]=function(_0x582485){var _0x5eaa3e=this;return new Promise(function(_0x3ddf0c,_0x1e8c44){return db[_0x8d9c('0x16')][_0x8d9c('0x1f')](_0x582485[_0x8d9c('0x20')],{'raw':_0x582485['options']?_0x582485['options'][_0x8d9c('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x299030){logger[_0x8d9c('0xc')]('CreateMemberReport',_0x582485);logger[_0x8d9c('0x1d')](_0x8d9c('0x1e'),_0x582485,JSON[_0x8d9c('0x10')](_0x299030));_0x3ddf0c(_0x299030);})[_0x8d9c('0x14')](function(_0x35c124){logger[_0x8d9c('0x11')](_0x8d9c('0x1e'),_0x35c124[_0x8d9c('0x12')],_0x582485);_0x1e8c44(_0x5eaa3e[_0x8d9c('0x11')](0x1f4,_0x35c124[_0x8d9c('0x12')]));});});};exports[_0x8d9c('0x22')]=function(_0x3ec24){var _0x1d230f=this;return new Promise(function(_0x54c4e6,_0x5f330e){return db[_0x8d9c('0x16')][_0x8d9c('0x23')](_0x3ec24[_0x8d9c('0x20')],{'raw':_0x3ec24['options']?_0x3ec24[_0x8d9c('0x17')][_0x8d9c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ec24[_0x8d9c('0x17')]?_0x3ec24[_0x8d9c('0x17')][_0x8d9c('0x18')]||null:null,'attributes':_0x3ec24[_0x8d9c('0x17')]?_0x3ec24[_0x8d9c('0x17')]['attributes']||null:null,'limit':_0x3ec24[_0x8d9c('0x17')]?_0x3ec24['options'][_0x8d9c('0x24')]||null:null})['then'](function(_0x5cc87c){logger[_0x8d9c('0xc')](_0x8d9c('0x22'),_0x3ec24);logger[_0x8d9c('0x1d')](_0x8d9c('0x22'),_0x3ec24,JSON[_0x8d9c('0x10')](_0x5cc87c));_0x54c4e6(_0x5cc87c);})['catch'](function(_0x533e8a){logger[_0x8d9c('0x11')](_0x8d9c('0x22'),_0x533e8a[_0x8d9c('0x12')],_0x3ec24);_0x5f330e(_0x1d230f[_0x8d9c('0x11')](0x1f4,_0x533e8a[_0x8d9c('0x12')]));});});}; \ No newline at end of file +var _0x5031=['options','attributes','limit','include','map','model','CreateMemberReport','raw','update','body','where','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','findAll'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5031,0x144));var _0x1503=function(_0x323190,_0x27cb59){_0x323190=_0x323190-0x0;var _0x357ad0=_0x5031[_0x323190];return _0x357ad0;};'use strict';var _=require(_0x1503('0x0'));var util=require(_0x1503('0x1'));var moment=require(_0x1503('0x2'));var BPromise=require(_0x1503('0x3'));var rs=require(_0x1503('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1503('0x5'));var logger=require(_0x1503('0x6'))(_0x1503('0x7'));var config=require(_0x1503('0x8'));var jayson=require(_0x1503('0x9'));var client=jayson[_0x1503('0xa')][_0x1503('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x114bec,_0x2db96e,_0x4c93e7){return new BPromise(function(_0x2007d0,_0x2dddb6){return client['request'](_0x114bec,_0x4c93e7)[_0x1503('0xc')](function(_0x466900){logger[_0x1503('0xd')](_0x1503('0xe'),_0x2db96e,_0x1503('0xf'));logger[_0x1503('0x10')](_0x1503('0x11'),_0x2db96e,_0x1503('0xf'),JSON[_0x1503('0x12')](_0x466900));if(_0x466900[_0x1503('0x13')]){if(_0x466900['error'][_0x1503('0x14')]===0x1f4){logger[_0x1503('0x13')](_0x1503('0xe'),_0x2db96e,_0x466900[_0x1503('0x13')][_0x1503('0x15')]);return _0x2dddb6(_0x466900['error'][_0x1503('0x15')]);}logger[_0x1503('0x13')](_0x1503('0xe'),_0x2db96e,_0x466900[_0x1503('0x13')][_0x1503('0x15')]);return _0x2007d0(_0x466900[_0x1503('0x13')][_0x1503('0x15')]);}else{logger[_0x1503('0xd')](_0x1503('0xe'),_0x2db96e,_0x1503('0xf'));_0x2007d0(_0x466900[_0x1503('0x16')][_0x1503('0x15')]);}})[_0x1503('0x17')](function(_0x33dae9){logger[_0x1503('0x13')](_0x1503('0xe'),_0x2db96e,_0x33dae9);_0x2dddb6(_0x33dae9);});});}exports[_0x1503('0x18')]=function(_0x3dc3c5){var _0x401b1b=this;return new Promise(function(_0x4c7390,_0x3f8c15){return db[_0x1503('0x19')][_0x1503('0x1a')]({'raw':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5[_0x1503('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3dc3c5['options']?_0x3dc3c5['options']['where']||null:null,'attributes':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5[_0x1503('0x1b')][_0x1503('0x1c')]||null:null,'limit':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5['options'][_0x1503('0x1d')]||null:null,'include':_0x3dc3c5[_0x1503('0x1b')]?_0x3dc3c5[_0x1503('0x1b')][_0x1503('0x1e')]?_[_0x1503('0x1f')](_0x3dc3c5[_0x1503('0x1b')][_0x1503('0x1e')],function(_0xde9620){return{'model':db[_0xde9620[_0x1503('0x20')]],'as':_0xde9620['as'],'attributes':_0xde9620['attributes'],'include':_0xde9620[_0x1503('0x1e')]?_['map'](_0xde9620[_0x1503('0x1e')],function(_0x2e8ee1){return{'model':db[_0x2e8ee1[_0x1503('0x20')]],'as':_0x2e8ee1['as'],'attributes':_0x2e8ee1[_0x1503('0x1c')],'include':_0x2e8ee1['include']?_[_0x1503('0x1f')](_0x2e8ee1[_0x1503('0x1e')],function(_0x1116b0){return{'model':db[_0x1116b0[_0x1503('0x20')]],'as':_0x1116b0['as'],'attributes':_0x1116b0[_0x1503('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1503('0xc')](function(_0x4cab3a){logger[_0x1503('0xd')](_0x1503('0x18'),_0x3dc3c5);logger[_0x1503('0x10')](_0x1503('0x18'),_0x3dc3c5,JSON[_0x1503('0x12')](_0x4cab3a));_0x4c7390(_0x4cab3a);})[_0x1503('0x17')](function(_0x3e7b2b){logger[_0x1503('0x13')](_0x1503('0x18'),_0x3e7b2b[_0x1503('0x15')],_0x3dc3c5);_0x3f8c15(_0x401b1b['error'](0x1f4,_0x3e7b2b[_0x1503('0x15')]));});});};exports[_0x1503('0x21')]=function(_0x131c4f){var _0x53acd7=this;return new Promise(function(_0x58b2fc,_0x52ecd2){return db[_0x1503('0x19')]['create'](_0x131c4f['body'],{'raw':_0x131c4f[_0x1503('0x1b')]?_0x131c4f[_0x1503('0x1b')][_0x1503('0x22')]===undefined?!![]:![]:!![]})[_0x1503('0xc')](function(_0x5d170e){logger[_0x1503('0xd')]('CreateMemberReport',_0x131c4f);logger[_0x1503('0x10')](_0x1503('0x21'),_0x131c4f,JSON[_0x1503('0x12')](_0x5d170e));_0x58b2fc(_0x5d170e);})[_0x1503('0x17')](function(_0x4d87a7){logger[_0x1503('0x13')](_0x1503('0x21'),_0x4d87a7['message'],_0x131c4f);_0x52ecd2(_0x53acd7[_0x1503('0x13')](0x1f4,_0x4d87a7[_0x1503('0x15')]));});});};exports['UpdateMemberReport']=function(_0x201b5b){var _0x2d9beb=this;return new Promise(function(_0x2989b3,_0x204ec4){return db['MemberReport'][_0x1503('0x23')](_0x201b5b[_0x1503('0x24')],{'raw':_0x201b5b[_0x1503('0x1b')]?_0x201b5b[_0x1503('0x1b')][_0x1503('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x201b5b['options']?_0x201b5b[_0x1503('0x1b')][_0x1503('0x25')]||null:null,'attributes':_0x201b5b['options']?_0x201b5b[_0x1503('0x1b')][_0x1503('0x1c')]||null:null,'limit':_0x201b5b[_0x1503('0x1b')]?_0x201b5b[_0x1503('0x1b')]['limit']||null:null})['then'](function(_0x1e4fc6){logger[_0x1503('0xd')](_0x1503('0x26'),_0x201b5b);logger[_0x1503('0x10')](_0x1503('0x26'),_0x201b5b,JSON[_0x1503('0x12')](_0x1e4fc6));_0x2989b3(_0x1e4fc6);})[_0x1503('0x17')](function(_0xbf77a5){logger[_0x1503('0x13')](_0x1503('0x26'),_0xbf77a5[_0x1503('0x15')],_0x201b5b);_0x204ec4(_0x2d9beb[_0x1503('0x13')](0x1f4,_0xbf77a5[_0x1503('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index e62ef60..21fd154 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 _0x18ff=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','path','connect-timeout','express'];(function(_0x5db4c8,_0x46462a){var _0x27d8c2=function(_0x5d8128){while(--_0x5d8128){_0x5db4c8['push'](_0x5db4c8['shift']());}};_0x27d8c2(++_0x46462a);}(_0x18ff,0x80));var _0xf18f=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x18ff[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xf18f('0x0'));var util=require('util');var path=require(_0xf18f('0x1'));var timeout=require(_0xf18f('0x2'));var express=require(_0xf18f('0x3'));var router=express[_0xf18f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xf18f('0x5'));var interaction=require(_0xf18f('0x6'));var config=require(_0xf18f('0x7'));var controller=require(_0xf18f('0x8'));router[_0xf18f('0x9')]('/',controller[_0xf18f('0xa')]);module[_0xf18f('0xb')]=router; \ No newline at end of file +var _0x82e3=['../../components/interaction/service','./migration.controller','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5984d5,_0x32f65f){var _0x45e517=function(_0x403c3d){while(--_0x403c3d){_0x5984d5['push'](_0x5984d5['shift']());}};_0x45e517(++_0x32f65f);}(_0x82e3,0x1aa));var _0x382e=function(_0x5d05fc,_0x2dc690){_0x5d05fc=_0x5d05fc-0x0;var _0x363c83=_0x82e3[_0x5d05fc];return _0x363c83;};'use strict';var multer=require(_0x382e('0x0'));var util=require(_0x382e('0x1'));var path=require('path');var timeout=require(_0x382e('0x2'));var express=require(_0x382e('0x3'));var router=express[_0x382e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x382e('0x5'));var interaction=require(_0x382e('0x6'));var config=require('../../config/environment');var controller=require(_0x382e('0x7'));router['get']('/',controller['index']);module[_0x382e('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 78e2ed1..ef86509 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 _0x3aae=['exports','STRING','sequelize'];(function(_0x55e09b,_0x515d4a){var _0x31de02=function(_0x412f6a){while(--_0x412f6a){_0x55e09b['push'](_0x55e09b['shift']());}};_0x31de02(++_0x515d4a);}(_0x3aae,0x170));var _0xe3aa=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3aae[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xe3aa('0x0'));module[_0xe3aa('0x1')]={'version':{'type':Sequelize[_0xe3aa('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x5f2c=['exports','STRING','version','sequelize'];(function(_0x91e035,_0xc4e4bc){var _0x1b763a=function(_0x5a4394){while(--_0x5a4394){_0x91e035['push'](_0x91e035['shift']());}};_0x1b763a(++_0xc4e4bc);}(_0x5f2c,0x6f));var _0xc5f2=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f2c[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require(_0xc5f2('0x0'));module[_0xc5f2('0x1')]={'version':{'type':Sequelize[_0xc5f2('0x2')],'unique':_0xc5f2('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 0606e60..ad45a29 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 _0x7c52=['type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','VIRTUAL','name','merge','options','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','index','map','Migration','rawAttributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7c52,0x12d));var _0x27c5=function(_0x522e5c,_0x2f6dc4){_0x522e5c=_0x522e5c-0x0;var _0x59f504=_0x7c52[_0x522e5c];return _0x59f504;};'use strict';var emlformat=require(_0x27c5('0x0'));var rimraf=require(_0x27c5('0x1'));var zipdir=require(_0x27c5('0x2'));var jsonpatch=require(_0x27c5('0x3'));var rp=require(_0x27c5('0x4'));var moment=require(_0x27c5('0x5'));var BPromise=require(_0x27c5('0x6'));var Mustache=require(_0x27c5('0x7'));var util=require(_0x27c5('0x8'));var path=require(_0x27c5('0x9'));var sox=require(_0x27c5('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x27c5('0xb'));var _=require(_0x27c5('0xc'));var squel=require(_0x27c5('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x27c5('0xe'));var toCsv=require(_0x27c5('0xf'));var querystring=require(_0x27c5('0x10'));var Papa=require(_0x27c5('0x11'));var Redis=require(_0x27c5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27c5('0x13'));var as=require(_0x27c5('0x14'));var hardwareService=require(_0x27c5('0x15'));var logger=require(_0x27c5('0x16'))(_0x27c5('0x17'));var utils=require(_0x27c5('0x18'));var config=require(_0x27c5('0x19'));var licenseUtil=require(_0x27c5('0x1a'));var db=require(_0x27c5('0x1b'))['db'];function respondWithStatusCode(_0x233944,_0x12f92a){_0x12f92a=_0x12f92a||0xcc;return function(_0x110d27){if(_0x110d27){return _0x233944[_0x27c5('0x1c')](_0x12f92a);}return _0x233944[_0x27c5('0x1d')](_0x12f92a)[_0x27c5('0x1e')]();};}function respondWithResult(_0x76452a,_0x269c64){_0x269c64=_0x269c64||0xc8;return function(_0x3058c8){if(_0x3058c8){return _0x76452a[_0x27c5('0x1d')](_0x269c64)[_0x27c5('0x1f')](_0x3058c8);}};}function respondWithFilteredResult(_0x2a1f0c,_0xe81c01){return function(_0x47a194){if(_0x47a194){var _0x48ef67=typeof _0xe81c01[_0x27c5('0x20')]===_0x27c5('0x21')&&typeof _0xe81c01[_0x27c5('0x22')]===_0x27c5('0x21');var _0x3f2159=_0x47a194[_0x27c5('0x23')];var _0x37b180=_0x48ef67?0x0:_0xe81c01[_0x27c5('0x20')];var _0x5b9caf=_0x48ef67?_0x47a194[_0x27c5('0x23')]:_0xe81c01['offset']+_0xe81c01[_0x27c5('0x22')];var _0x1ebe41;if(_0x5b9caf>=_0x3f2159){_0x5b9caf=_0x3f2159;_0x1ebe41=0xc8;}else{_0x1ebe41=0xce;}_0x2a1f0c[_0x27c5('0x1d')](_0x1ebe41);return _0x2a1f0c[_0x27c5('0x24')](_0x27c5('0x25'),_0x37b180+'-'+_0x5b9caf+'/'+_0x3f2159)[_0x27c5('0x1f')](_0x47a194);}return null;};}function patchUpdates(_0x3c0694){return function(_0x1a5f40){try{jsonpatch['apply'](_0x1a5f40,_0x3c0694,!![]);}catch(_0x1c4b2e){return BPromise[_0x27c5('0x26')](_0x1c4b2e);}return _0x1a5f40[_0x27c5('0x27')]();};}function saveUpdates(_0x49422f,_0x4a1c3c){return function(_0x57129d){if(_0x57129d){return _0x57129d[_0x27c5('0x28')](_0x49422f)[_0x27c5('0x29')](function(_0x36fe3a){return _0x36fe3a;});}return null;};}function removeEntity(_0xe949ef,_0x446b96){return function(_0x243308){if(_0x243308){return _0x243308[_0x27c5('0x2a')]()['then'](function(){_0xe949ef[_0x27c5('0x1d')](0xcc)[_0x27c5('0x1e')]();});}};}function handleEntityNotFound(_0x45c4a5,_0x25e95d){return function(_0x56487a){if(!_0x56487a){_0x45c4a5[_0x27c5('0x1c')](0x194);}return _0x56487a;};}function handleError(_0x1a7b87,_0x482861){_0x482861=_0x482861||0x1f4;return function(_0x5ce6c1){logger[_0x27c5('0x2b')](_0x5ce6c1[_0x27c5('0x2c')]);if(_0x5ce6c1['name']){delete _0x5ce6c1['name'];}_0x1a7b87[_0x27c5('0x1d')](_0x482861)['send'](_0x5ce6c1);};}exports[_0x27c5('0x2d')]=function(_0x5ef174,_0x3a64e9){var _0x2d5528={},_0x4a1310={},_0x1f3dfb={'count':0x0,'rows':[]};var _0x5d90f3=_[_0x27c5('0x2e')](db[_0x27c5('0x2f')][_0x27c5('0x30')],function(_0xf51ebe){return{'name':_0xf51ebe['fieldName'],'type':_0xf51ebe[_0x27c5('0x31')][_0x27c5('0x32')]};});_0x4a1310[_0x27c5('0x33')]=_[_0x27c5('0x2e')](_0x5d90f3,'name');_0x4a1310[_0x27c5('0x34')]=_[_0x27c5('0x35')](_0x5ef174['query']);_0x4a1310['filters']=_[_0x27c5('0x36')](_0x4a1310[_0x27c5('0x33')],_0x4a1310[_0x27c5('0x34')]);_0x2d5528[_0x27c5('0x37')]=_[_0x27c5('0x36')](_0x4a1310[_0x27c5('0x33')],qs[_0x27c5('0x38')](_0x5ef174[_0x27c5('0x34')]['fields']));_0x2d5528[_0x27c5('0x37')]=_0x2d5528[_0x27c5('0x37')][_0x27c5('0x39')]?_0x2d5528['attributes']:_0x4a1310[_0x27c5('0x33')];if(!_0x5ef174[_0x27c5('0x34')][_0x27c5('0x3a')](_0x27c5('0x3b'))){_0x2d5528['limit']=qs[_0x27c5('0x22')](_0x5ef174[_0x27c5('0x34')]['limit']);_0x2d5528['offset']=qs[_0x27c5('0x20')](_0x5ef174[_0x27c5('0x34')][_0x27c5('0x20')]);}_0x2d5528['order']=qs['sort'](_0x5ef174[_0x27c5('0x34')][_0x27c5('0x3c')]);_0x2d5528[_0x27c5('0x3d')]=qs['filters'](_[_0x27c5('0x3e')](_0x5ef174[_0x27c5('0x34')],_0x4a1310[_0x27c5('0x3f')]),_0x5d90f3);if(_0x5ef174[_0x27c5('0x34')]['filter']){_0x2d5528['where']=_['merge'](_0x2d5528['where'],{'$or':_[_0x27c5('0x2e')](_0x5d90f3,function(_0x45265e){if(_0x45265e[_0x27c5('0x31')]!==_0x27c5('0x40')){var _0x294b95={};_0x294b95[_0x45265e[_0x27c5('0x41')]]={'$like':'%'+_0x5ef174[_0x27c5('0x34')]['filter']+'%'};return _0x294b95;}})});}_0x2d5528=_[_0x27c5('0x42')]({},_0x2d5528,_0x5ef174[_0x27c5('0x43')]);var _0x51a4ba={'where':_0x2d5528[_0x27c5('0x3d')]};return db[_0x27c5('0x2f')][_0x27c5('0x23')](_0x51a4ba)[_0x27c5('0x29')](function(_0x23c1e3){_0x1f3dfb[_0x27c5('0x23')]=_0x23c1e3;if(_0x5ef174[_0x27c5('0x34')]['includeAll']){_0x2d5528['include']=[{'all':!![]}];}return db[_0x27c5('0x2f')]['findAll'](_0x2d5528);})[_0x27c5('0x29')](function(_0x133a26){_0x1f3dfb[_0x27c5('0x44')]=_0x133a26;return _0x1f3dfb;})[_0x27c5('0x29')](respondWithFilteredResult(_0x3a64e9,_0x2d5528))[_0x27c5('0x45')](handleError(_0x3a64e9,null));}; \ No newline at end of file +var _0x0b1c=['rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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','status','end','json','undefined','offset','limit','reject','save','update','then','destroy','sendStatus','error','name','index','map','Migration'];(function(_0x1fbd48,_0x45bb24){var _0x26695a=function(_0x1e9f19){while(--_0x1e9f19){_0x1fbd48['push'](_0x1fbd48['shift']());}};_0x26695a(++_0x45bb24);}(_0x0b1c,0xe0));var _0xc0b1=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x0b1c[_0xf71120];return _0xbe2fd3;};'use strict';var emlformat=require(_0xc0b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc0b1('0x1'));var jsonpatch=require(_0xc0b1('0x2'));var rp=require(_0xc0b1('0x3'));var moment=require(_0xc0b1('0x4'));var BPromise=require(_0xc0b1('0x5'));var Mustache=require(_0xc0b1('0x6'));var util=require(_0xc0b1('0x7'));var path=require(_0xc0b1('0x8'));var sox=require(_0xc0b1('0x9'));var csv=require(_0xc0b1('0xa'));var ejs=require(_0xc0b1('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc0b1('0xc'));var squel=require(_0xc0b1('0xd'));var crypto=require(_0xc0b1('0xe'));var jsforce=require(_0xc0b1('0xf'));var deskjs=require(_0xc0b1('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc0b1('0x11'));var Papa=require('papaparse');var Redis=require(_0xc0b1('0x12'));var authService=require(_0xc0b1('0x13'));var qs=require(_0xc0b1('0x14'));var as=require(_0xc0b1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0b1('0x16'))(_0xc0b1('0x17'));var utils=require(_0xc0b1('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc0b1('0x19'));var db=require(_0xc0b1('0x1a'))['db'];function respondWithStatusCode(_0x3d83bc,_0x22e891){_0x22e891=_0x22e891||0xcc;return function(_0x3b9296){if(_0x3b9296){return _0x3d83bc['sendStatus'](_0x22e891);}return _0x3d83bc[_0xc0b1('0x1b')](_0x22e891)[_0xc0b1('0x1c')]();};}function respondWithResult(_0x40fcbc,_0x25869a){_0x25869a=_0x25869a||0xc8;return function(_0xf3730){if(_0xf3730){return _0x40fcbc[_0xc0b1('0x1b')](_0x25869a)[_0xc0b1('0x1d')](_0xf3730);}};}function respondWithFilteredResult(_0x534efb,_0x18c709){return function(_0x21c124){if(_0x21c124){var _0x5e8477=typeof _0x18c709['offset']==='undefined'&&typeof _0x18c709['limit']===_0xc0b1('0x1e');var _0x30e662=_0x21c124['count'];var _0x46f78f=_0x5e8477?0x0:_0x18c709[_0xc0b1('0x1f')];var _0x2e1d7e=_0x5e8477?_0x21c124['count']:_0x18c709[_0xc0b1('0x1f')]+_0x18c709[_0xc0b1('0x20')];var _0x3283bb;if(_0x2e1d7e>=_0x30e662){_0x2e1d7e=_0x30e662;_0x3283bb=0xc8;}else{_0x3283bb=0xce;}_0x534efb['status'](_0x3283bb);return _0x534efb['set']('Content-Range',_0x46f78f+'-'+_0x2e1d7e+'/'+_0x30e662)[_0xc0b1('0x1d')](_0x21c124);}return null;};}function patchUpdates(_0x162046){return function(_0x41e88f){try{jsonpatch['apply'](_0x41e88f,_0x162046,!![]);}catch(_0x350c3d){return BPromise[_0xc0b1('0x21')](_0x350c3d);}return _0x41e88f[_0xc0b1('0x22')]();};}function saveUpdates(_0x532f96,_0x1479d7){return function(_0x39d1d8){if(_0x39d1d8){return _0x39d1d8[_0xc0b1('0x23')](_0x532f96)[_0xc0b1('0x24')](function(_0x220bd2){return _0x220bd2;});}return null;};}function removeEntity(_0x52936e,_0x484592){return function(_0x305e36){if(_0x305e36){return _0x305e36[_0xc0b1('0x25')]()[_0xc0b1('0x24')](function(){_0x52936e['status'](0xcc)[_0xc0b1('0x1c')]();});}};}function handleEntityNotFound(_0x30b8a4,_0x50f81c){return function(_0x2420b3){if(!_0x2420b3){_0x30b8a4[_0xc0b1('0x26')](0x194);}return _0x2420b3;};}function handleError(_0x1b2da6,_0x5829d9){_0x5829d9=_0x5829d9||0x1f4;return function(_0x1786bc){logger[_0xc0b1('0x27')](_0x1786bc['stack']);if(_0x1786bc[_0xc0b1('0x28')]){delete _0x1786bc['name'];}_0x1b2da6[_0xc0b1('0x1b')](_0x5829d9)['send'](_0x1786bc);};}exports[_0xc0b1('0x29')]=function(_0x39198d,_0x47feaf){var _0x44c815={},_0x27a8c7={},_0x2f03d1={'count':0x0,'rows':[]};var _0x3b0ced=_[_0xc0b1('0x2a')](db[_0xc0b1('0x2b')][_0xc0b1('0x2c')],function(_0x3f1ca1){return{'name':_0x3f1ca1['fieldName'],'type':_0x3f1ca1[_0xc0b1('0x2d')][_0xc0b1('0x2e')]};});_0x27a8c7['model']=_[_0xc0b1('0x2a')](_0x3b0ced,_0xc0b1('0x28'));_0x27a8c7[_0xc0b1('0x2f')]=_[_0xc0b1('0x30')](_0x39198d[_0xc0b1('0x2f')]);_0x27a8c7[_0xc0b1('0x31')]=_[_0xc0b1('0x32')](_0x27a8c7[_0xc0b1('0x33')],_0x27a8c7[_0xc0b1('0x2f')]);_0x44c815[_0xc0b1('0x34')]=_['intersection'](_0x27a8c7['model'],qs[_0xc0b1('0x35')](_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x35')]));_0x44c815[_0xc0b1('0x34')]=_0x44c815['attributes'][_0xc0b1('0x36')]?_0x44c815[_0xc0b1('0x34')]:_0x27a8c7[_0xc0b1('0x33')];if(!_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x37')]('nolimit')){_0x44c815[_0xc0b1('0x20')]=qs[_0xc0b1('0x20')](_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x20')]);_0x44c815['offset']=qs[_0xc0b1('0x1f')](_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x1f')]);}_0x44c815[_0xc0b1('0x38')]=qs['sort'](_0x39198d['query'][_0xc0b1('0x39')]);_0x44c815[_0xc0b1('0x3a')]=qs[_0xc0b1('0x31')](_[_0xc0b1('0x3b')](_0x39198d[_0xc0b1('0x2f')],_0x27a8c7[_0xc0b1('0x31')]),_0x3b0ced);if(_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x3c')]){_0x44c815[_0xc0b1('0x3a')]=_[_0xc0b1('0x3d')](_0x44c815[_0xc0b1('0x3a')],{'$or':_['map'](_0x3b0ced,function(_0x3d4396){if(_0x3d4396[_0xc0b1('0x2d')]!==_0xc0b1('0x3e')){var _0x1684a1={};_0x1684a1[_0x3d4396['name']]={'$like':'%'+_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x3c')]+'%'};return _0x1684a1;}})});}_0x44c815=_['merge']({},_0x44c815,_0x39198d['options']);var _0x146ac7={'where':_0x44c815['where']};return db[_0xc0b1('0x2b')]['count'](_0x146ac7)[_0xc0b1('0x24')](function(_0x560f86){_0x2f03d1['count']=_0x560f86;if(_0x39198d[_0xc0b1('0x2f')][_0xc0b1('0x3f')]){_0x44c815['include']=[{'all':!![]}];}return db[_0xc0b1('0x2b')][_0xc0b1('0x40')](_0x44c815);})[_0xc0b1('0x24')](function(_0x288030){_0x2f03d1[_0xc0b1('0x41')]=_0x288030;return _0x2f03d1;})[_0xc0b1('0x24')](respondWithFilteredResult(_0x47feaf,_0x44c815))[_0xc0b1('0x42')](handleError(_0x47feaf,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 27738c0..45ae516 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 _0xb8ac=['moment','bluebird','request-promise','path','rimraf','./migration.attributes','exports','define','migrations','lodash','util','../../config/logger'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xb8ac,0x129));var _0xcb8a=function(_0x270b65,_0x4cd905){_0x270b65=_0x270b65-0x0;var _0x2a5508=_0xb8ac[_0x270b65];return _0x2a5508;};'use strict';var _=require(_0xcb8a('0x0'));var util=require(_0xcb8a('0x1'));var logger=require(_0xcb8a('0x2'))('api');var moment=require(_0xcb8a('0x3'));var BPromise=require(_0xcb8a('0x4'));var rp=require(_0xcb8a('0x5'));var fs=require('fs');var path=require(_0xcb8a('0x6'));var rimraf=require(_0xcb8a('0x7'));var config=require('../../config/environment');var attributes=require(_0xcb8a('0x8'));module[_0xcb8a('0x9')]=function(_0x4a5cc3,_0x44f4a9){return _0x4a5cc3[_0xcb8a('0xa')]('Migration',attributes,{'tableName':_0xcb8a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd82a=['../../config/logger','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util'];(function(_0x43b058,_0xcab0cc){var _0x45a9e0=function(_0x533692){while(--_0x533692){_0x43b058['push'](_0x43b058['shift']());}};_0x45a9e0(++_0xcab0cc);}(_0xd82a,0x76));var _0xad82=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xd82a[_0x4d613c];return _0x301fe3;};'use strict';var _=require(_0xad82('0x0'));var util=require(_0xad82('0x1'));var logger=require(_0xad82('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xad82('0x3'));var fs=require('fs');var path=require(_0xad82('0x4'));var rimraf=require(_0xad82('0x5'));var config=require(_0xad82('0x6'));var attributes=require(_0xad82('0x7'));module[_0xad82('0x8')]=function(_0x5d5558,_0xede954){return _0x5d5558[_0xad82('0x9')](_0xad82('0xa'),attributes,{'tableName':_0xad82('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 32514b9..021ddc5 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 _0x6953=['catch','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x6953,0x91));var _0x3695=function(_0x3c52b8,_0x2aa85e){_0x3c52b8=_0x3c52b8-0x0;var _0x3406cb=_0x6953[_0x3c52b8];return _0x3406cb;};'use strict';var _=require(_0x3695('0x0'));var util=require(_0x3695('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3695('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x3695('0x3'));var logger=require(_0x3695('0x4'))(_0x3695('0x5'));var config=require('../../config/environment');var jayson=require(_0x3695('0x6'));var client=jayson['client'][_0x3695('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14eb32,_0x912099,_0x1a4e75){return new BPromise(function(_0x301e46,_0x4e337b){return client[_0x3695('0x8')](_0x14eb32,_0x1a4e75)['then'](function(_0x1fcd43){logger['info']('Migration,\x20%s,\x20%s',_0x912099,_0x3695('0x9'));logger['debug'](_0x3695('0xa'),_0x912099,_0x3695('0x9'),JSON[_0x3695('0xb')](_0x1fcd43));if(_0x1fcd43[_0x3695('0xc')]){if(_0x1fcd43[_0x3695('0xc')][_0x3695('0xd')]===0x1f4){logger['error'](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x4e337b(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}logger[_0x3695('0xc')](_0x3695('0xe'),_0x912099,_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);return _0x301e46(_0x1fcd43[_0x3695('0xc')][_0x3695('0xf')]);}else{logger['info'](_0x3695('0xe'),_0x912099,_0x3695('0x9'));_0x301e46(_0x1fcd43[_0x3695('0x10')][_0x3695('0xf')]);}})[_0x3695('0x11')](function(_0x1973ee){logger[_0x3695('0xc')]('Migration,\x20%s,\x20%s',_0x912099,_0x1973ee);_0x4e337b(_0x1973ee);});});} \ No newline at end of file +var _0x54f3=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util'];(function(_0x570fa1,_0x56bc22){var _0x28e39d=function(_0x2670c0){while(--_0x2670c0){_0x570fa1['push'](_0x570fa1['shift']());}};_0x28e39d(++_0x56bc22);}(_0x54f3,0x120));var _0x354f=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x54f3[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0x354f('0x0'));var moment=require(_0x354f('0x1'));var BPromise=require(_0x354f('0x2'));var rs=require(_0x354f('0x3'));var fs=require('fs');var Redis=require(_0x354f('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x354f('0x5'))(_0x354f('0x6'));var config=require(_0x354f('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x354f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cd16,_0x1da503,_0x4311ad){return new BPromise(function(_0x2f111a,_0x173e1d){return client['request'](_0x51cd16,_0x4311ad)[_0x354f('0x9')](function(_0x5d1e5d){logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,'request\x20sent');logger['debug'](_0x354f('0xc'),_0x1da503,_0x354f('0xd'),JSON['stringify'](_0x5d1e5d));if(_0x5d1e5d[_0x354f('0xe')]){if(_0x5d1e5d[_0x354f('0xe')]['code']===0x1f4){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x173e1d(_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);}logger[_0x354f('0xe')]('Migration,\x20%s,\x20%s',_0x1da503,_0x5d1e5d[_0x354f('0xe')][_0x354f('0xf')]);return _0x2f111a(_0x5d1e5d[_0x354f('0xe')]['message']);}else{logger[_0x354f('0xa')](_0x354f('0xb'),_0x1da503,_0x354f('0xd'));_0x2f111a(_0x5d1e5d['result']['message']);}})[_0x354f('0x10')](function(_0x1d7627){logger[_0x354f('0xe')](_0x354f('0xb'),_0x1da503,_0x1d7627);_0x173e1d(_0x1d7627);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 30af637..d5773d7 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 _0x1ccb=['/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated'];(function(_0x2ccf4d,_0x2a8b52){var _0x5807ae=function(_0x37f0d1){while(--_0x37f0d1){_0x2ccf4d['push'](_0x2ccf4d['shift']());}};_0x5807ae(++_0x2a8b52);}(_0x1ccb,0x105));var _0xb1cc=function(_0xab16f4,_0x3ea7f1){_0xab16f4=_0xab16f4-0x0;var _0x785d32=_0x1ccb[_0xab16f4];return _0x785d32;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb1cc('0x0'));var timeout=require(_0xb1cc('0x1'));var express=require(_0xb1cc('0x2'));var router=express['Router']();var fs_extra=require(_0xb1cc('0x3'));var auth=require(_0xb1cc('0x4'));var interaction=require(_0xb1cc('0x5'));var config=require('../../config/environment');var controller=require(_0xb1cc('0x6'));router[_0xb1cc('0x7')]('/',auth[_0xb1cc('0x8')](),controller['index']);router['get'](_0xb1cc('0x9'),auth[_0xb1cc('0x8')](),controller[_0xb1cc('0xa')]);router[_0xb1cc('0xb')]('/',auth[_0xb1cc('0x8')](),controller[_0xb1cc('0xc')]);router[_0xb1cc('0xd')]('/:id',auth[_0xb1cc('0x8')](),controller[_0xb1cc('0xe')]);router[_0xb1cc('0xf')]('/:id',auth[_0xb1cc('0x8')](),controller[_0xb1cc('0x10')]);module[_0xb1cc('0x11')]=router; \ No newline at end of file +var _0x2c24=['../../components/auth/service','../../components/interaction/service','./network.controller','get','index','/:id','isAuthenticated','show','post','update','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x58e989,_0x2b6e4a){var _0x2bf9bd=function(_0x583536){while(--_0x583536){_0x58e989['push'](_0x58e989['shift']());}};_0x2bf9bd(++_0x2b6e4a);}(_0x2c24,0x1e6));var _0x42c2=function(_0x2d197b,_0x358ea1){_0x2d197b=_0x2d197b-0x0;var _0x24232d=_0x2c24[_0x2d197b];return _0x24232d;};'use strict';var multer=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var path=require(_0x42c2('0x2'));var timeout=require(_0x42c2('0x3'));var express=require(_0x42c2('0x4'));var router=express[_0x42c2('0x5')]();var fs_extra=require(_0x42c2('0x6'));var auth=require(_0x42c2('0x7'));var interaction=require(_0x42c2('0x8'));var config=require('../../config/environment');var controller=require(_0x42c2('0x9'));router[_0x42c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x42c2('0xb')]);router[_0x42c2('0xa')](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0xe')]);router[_0x42c2('0xf')]('/',auth[_0x42c2('0xd')](),controller['create']);router['put'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0x10')]);router['delete'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller['destroy']);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 42a5f97..27250fe 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 _0x70b3=['turn','STRING','exports','ENUM','localnet','stun'];(function(_0x21d6ff,_0xb9d12e){var _0x67f3c2=function(_0x153335){while(--_0x153335){_0x21d6ff['push'](_0x21d6ff['shift']());}};_0x67f3c2(++_0xb9d12e);}(_0x70b3,0x10a));var _0x370b=function(_0x229a5f,_0x35c405){_0x229a5f=_0x229a5f-0x0;var _0x28c669=_0x70b3[_0x229a5f];return _0x28c669;};'use strict';var Sequelize=require('sequelize');module[_0x370b('0x0')]={'type':{'type':Sequelize[_0x370b('0x1')](_0x370b('0x2'),'externip',_0x370b('0x3'),_0x370b('0x4'))},'value':{'type':Sequelize[_0x370b('0x5')]},'username':{'type':Sequelize[_0x370b('0x5')]},'password':{'type':Sequelize[_0x370b('0x5')]}}; \ No newline at end of file +var _0xde19=['localnet','externip','stun','turn','STRING','sequelize','ENUM'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xde19,0x75));var _0x9de1=function(_0x3c40f4,_0x500b8a){_0x3c40f4=_0x3c40f4-0x0;var _0x1209d=_0xde19[_0x3c40f4];return _0x1209d;};'use strict';var Sequelize=require(_0x9de1('0x0'));module['exports']={'type':{'type':Sequelize[_0x9de1('0x1')](_0x9de1('0x2'),_0x9de1('0x3'),_0x9de1('0x4'),_0x9de1('0x5'))},'value':{'type':Sequelize[_0x9de1('0x6')]},'username':{'type':Sequelize[_0x9de1('0x6')]},'password':{'type':Sequelize[_0x9de1('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 058d63f..7c898c2 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 _0xdb6f=['request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','reject','then','destroy','name','send','index','map','Network','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','show','rawAttributes','length','includeAll','include','create','body','STUN','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','toUpperCase','TURN','readFileSync','join','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','transaction','find','params','findAll','/etc/asterisk/stun_xcally.conf','update','server/files/templates/network.ejs','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x34aaac,_0x5db142){var _0x1aec62=function(_0xd1bb7a){while(--_0xd1bb7a){_0x34aaac['push'](_0x34aaac['shift']());}};_0x1aec62(++_0x5db142);}(_0xdb6f,0x64));var _0xfdb6=function(_0x13fb4f,_0x42f6af){_0x13fb4f=_0x13fb4f-0x0;var _0x298a4e=_0xdb6f[_0x13fb4f];return _0x298a4e;};'use strict';var emlformat=require(_0xfdb6('0x0'));var rimraf=require(_0xfdb6('0x1'));var zipdir=require(_0xfdb6('0x2'));var jsonpatch=require(_0xfdb6('0x3'));var rp=require(_0xfdb6('0x4'));var moment=require(_0xfdb6('0x5'));var BPromise=require(_0xfdb6('0x6'));var Mustache=require(_0xfdb6('0x7'));var util=require(_0xfdb6('0x8'));var path=require('path');var sox=require(_0xfdb6('0x9'));var csv=require(_0xfdb6('0xa'));var ejs=require(_0xfdb6('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfdb6('0xc'));var squel=require(_0xfdb6('0xd'));var crypto=require(_0xfdb6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xfdb6('0xf'));var toCsv=require(_0xfdb6('0xa'));var querystring=require(_0xfdb6('0x10'));var Papa=require(_0xfdb6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfdb6('0x12'));var as=require(_0xfdb6('0x13'));var hardwareService=require(_0xfdb6('0x14'));var logger=require(_0xfdb6('0x15'))(_0xfdb6('0x16'));var utils=require(_0xfdb6('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfdb6('0x18'));var db=require(_0xfdb6('0x19'))['db'];var jayson=require(_0xfdb6('0x1a'));var client=jayson['client'][_0xfdb6('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3595ab,_0x4b8b61,_0x34a490,_0xb3f045){return new BPromise(function(_0x3ffea2,_0x3dd485){var _0x147753=_0xb3f045||client;return _0x147753[_0xfdb6('0x1c')](_0x3595ab,_0x34a490)['then'](function(_0x2c1724){logger[_0xfdb6('0x1d')](_0xfdb6('0x1e'),_0x4b8b61,_0xfdb6('0x1f'));logger[_0xfdb6('0x20')](_0xfdb6('0x21'),_0x4b8b61,_0xfdb6('0x1f'),JSON['stringify'](_0x2c1724));if(_0x2c1724[_0xfdb6('0x22')]){if(_0x2c1724[_0xfdb6('0x22')][_0xfdb6('0x23')]===0x1f4){logger[_0xfdb6('0x22')](_0xfdb6('0x1e'),_0x4b8b61,_0x2c1724[_0xfdb6('0x22')][_0xfdb6('0x24')]);return _0x3dd485(_0x2c1724[_0xfdb6('0x22')]['message']);}logger[_0xfdb6('0x22')](_0xfdb6('0x1e'),_0x4b8b61,_0x2c1724[_0xfdb6('0x22')][_0xfdb6('0x24')]);return _0x3ffea2(_0x2c1724[_0xfdb6('0x22')][_0xfdb6('0x24')]);}else{logger[_0xfdb6('0x1d')](_0xfdb6('0x1e'),_0x4b8b61,'request\x20sent');_0x3ffea2(_0x2c1724[_0xfdb6('0x25')][_0xfdb6('0x24')]);}})[_0xfdb6('0x26')](function(_0x1c1ccd){logger[_0xfdb6('0x22')](_0xfdb6('0x1e'),_0x4b8b61,_0x1c1ccd);_0x3dd485(_0x1c1ccd);});});}function respondWithStatusCode(_0x4c268b,_0x570944){_0x570944=_0x570944||0xcc;return function(_0x41936a){if(_0x41936a){return _0x4c268b[_0xfdb6('0x27')](_0x570944);}return _0x4c268b[_0xfdb6('0x28')](_0x570944)['end']();};}function respondWithResult(_0x38f8a5,_0x47d140){_0x47d140=_0x47d140||0xc8;return function(_0x253515){if(_0x253515){return _0x38f8a5[_0xfdb6('0x28')](_0x47d140)[_0xfdb6('0x29')](_0x253515);}};}function respondWithFilteredResult(_0x58f298,_0x464554){return function(_0x1b7103){if(_0x1b7103){var _0x51d348=typeof _0x464554[_0xfdb6('0x2a')]===_0xfdb6('0x2b')&&typeof _0x464554[_0xfdb6('0x2c')]==='undefined';var _0x526e09=_0x1b7103[_0xfdb6('0x2d')];var _0x37c7a9=_0x51d348?0x0:_0x464554[_0xfdb6('0x2a')];var _0x3fc3ed=_0x51d348?_0x1b7103['count']:_0x464554[_0xfdb6('0x2a')]+_0x464554[_0xfdb6('0x2c')];var _0x4903fe;if(_0x3fc3ed>=_0x526e09){_0x3fc3ed=_0x526e09;_0x4903fe=0xc8;}else{_0x4903fe=0xce;}_0x58f298[_0xfdb6('0x28')](_0x4903fe);return _0x58f298['set']('Content-Range',_0x37c7a9+'-'+_0x3fc3ed+'/'+_0x526e09)['json'](_0x1b7103);}return null;};}function patchUpdates(_0x142449){return function(_0x18622e){try{jsonpatch['apply'](_0x18622e,_0x142449,!![]);}catch(_0x4f56ff){return BPromise[_0xfdb6('0x2e')](_0x4f56ff);}return _0x18622e['save']();};}function saveUpdates(_0x36e6c5,_0x205b43){return function(_0x9e391){if(_0x9e391){return _0x9e391['update'](_0x36e6c5)[_0xfdb6('0x2f')](function(_0x44a936){return _0x44a936;});}return null;};}function removeEntity(_0x29885e,_0xa433a){return function(_0xe83742){if(_0xe83742){return _0xe83742[_0xfdb6('0x30')]()[_0xfdb6('0x2f')](function(){_0x29885e[_0xfdb6('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d299c,_0x2355b6){return function(_0x3f5931){if(!_0x3f5931){_0x5d299c['sendStatus'](0x194);}return _0x3f5931;};}function handleError(_0x2cec22,_0x208cc9){_0x208cc9=_0x208cc9||0x1f4;return function(_0x1f7061){logger[_0xfdb6('0x22')](_0x1f7061['stack']);if(_0x1f7061['name']){delete _0x1f7061[_0xfdb6('0x31')];}_0x2cec22[_0xfdb6('0x28')](_0x208cc9)[_0xfdb6('0x32')](_0x1f7061);};}exports[_0xfdb6('0x33')]=function(_0x3f9e6d,_0xb837e2){var _0x4be630={},_0x436b7e={},_0x472a38={'count':0x0,'rows':[]};var _0x1129a8=_[_0xfdb6('0x34')](db[_0xfdb6('0x35')]['rawAttributes'],function(_0x42732b){return{'name':_0x42732b[_0xfdb6('0x36')],'type':_0x42732b[_0xfdb6('0x37')]['key']};});_0x436b7e['model']=_[_0xfdb6('0x34')](_0x1129a8,_0xfdb6('0x31'));_0x436b7e[_0xfdb6('0x38')]=_[_0xfdb6('0x39')](_0x3f9e6d[_0xfdb6('0x38')]);_0x436b7e['filters']=_[_0xfdb6('0x3a')](_0x436b7e[_0xfdb6('0x3b')],_0x436b7e[_0xfdb6('0x38')]);_0x4be630[_0xfdb6('0x3c')]=_[_0xfdb6('0x3a')](_0x436b7e['model'],qs[_0xfdb6('0x3d')](_0x3f9e6d[_0xfdb6('0x38')][_0xfdb6('0x3d')]));_0x4be630[_0xfdb6('0x3c')]=_0x4be630[_0xfdb6('0x3c')]['length']?_0x4be630[_0xfdb6('0x3c')]:_0x436b7e[_0xfdb6('0x3b')];if(!_0x3f9e6d['query'][_0xfdb6('0x3e')](_0xfdb6('0x3f'))){_0x4be630[_0xfdb6('0x2c')]=qs[_0xfdb6('0x2c')](_0x3f9e6d['query'][_0xfdb6('0x2c')]);_0x4be630[_0xfdb6('0x2a')]=qs[_0xfdb6('0x2a')](_0x3f9e6d[_0xfdb6('0x38')][_0xfdb6('0x2a')]);}_0x4be630[_0xfdb6('0x40')]=qs[_0xfdb6('0x41')](_0x3f9e6d[_0xfdb6('0x38')][_0xfdb6('0x41')]);_0x4be630[_0xfdb6('0x42')]=qs[_0xfdb6('0x43')](_[_0xfdb6('0x44')](_0x3f9e6d[_0xfdb6('0x38')],_0x436b7e[_0xfdb6('0x43')]),_0x1129a8);if(_0x3f9e6d[_0xfdb6('0x38')][_0xfdb6('0x45')]){_0x4be630[_0xfdb6('0x42')]=_[_0xfdb6('0x46')](_0x4be630[_0xfdb6('0x42')],{'$or':_[_0xfdb6('0x34')](_0x1129a8,function(_0x32e372){if(_0x32e372[_0xfdb6('0x37')]!==_0xfdb6('0x47')){var _0x34d86b={};_0x34d86b[_0x32e372[_0xfdb6('0x31')]]={'$like':'%'+_0x3f9e6d[_0xfdb6('0x38')]['filter']+'%'};return _0x34d86b;}})});}_0x4be630=_[_0xfdb6('0x46')]({},_0x4be630,_0x3f9e6d[_0xfdb6('0x48')]);var _0x2e8ca4={'where':_0x4be630[_0xfdb6('0x42')]};return db[_0xfdb6('0x35')]['count'](_0x2e8ca4)['then'](function(_0x5f44e3){_0x472a38[_0xfdb6('0x2d')]=_0x5f44e3;if(_0x3f9e6d['query']['includeAll']){_0x4be630['include']=[{'all':!![]}];}return db[_0xfdb6('0x35')]['findAll'](_0x4be630);})[_0xfdb6('0x2f')](function(_0x50a7f3){_0x472a38['rows']=_0x50a7f3;return _0x472a38;})['then'](respondWithFilteredResult(_0xb837e2,_0x4be630))[_0xfdb6('0x26')](handleError(_0xb837e2,null));};exports[_0xfdb6('0x49')]=function(_0x145b46,_0x3add07){var _0x519ed0={'raw':!![],'where':{'id':_0x145b46['params']['id']}},_0xc2806c={};_0xc2806c[_0xfdb6('0x3b')]=_[_0xfdb6('0x39')](db[_0xfdb6('0x35')][_0xfdb6('0x4a')]);_0xc2806c['query']=_[_0xfdb6('0x39')](_0x145b46[_0xfdb6('0x38')]);_0xc2806c[_0xfdb6('0x43')]=_[_0xfdb6('0x3a')](_0xc2806c['model'],_0xc2806c[_0xfdb6('0x38')]);_0x519ed0[_0xfdb6('0x3c')]=_[_0xfdb6('0x3a')](_0xc2806c[_0xfdb6('0x3b')],qs[_0xfdb6('0x3d')](_0x145b46[_0xfdb6('0x38')][_0xfdb6('0x3d')]));_0x519ed0[_0xfdb6('0x3c')]=_0x519ed0['attributes'][_0xfdb6('0x4b')]?_0x519ed0[_0xfdb6('0x3c')]:_0xc2806c[_0xfdb6('0x3b')];if(_0x145b46['query'][_0xfdb6('0x4c')]){_0x519ed0[_0xfdb6('0x4d')]=[{'all':!![]}];}_0x519ed0=_['merge']({},_0x519ed0,_0x145b46[_0xfdb6('0x48')]);return db[_0xfdb6('0x35')]['find'](_0x519ed0)['then'](handleEntityNotFound(_0x3add07,null))[_0xfdb6('0x2f')](respondWithResult(_0x3add07,null))[_0xfdb6('0x26')](handleError(_0x3add07,null));};exports[_0xfdb6('0x4e')]=function(_0x1b304b,_0xccbef6,_0x43963c){var _0x54ecaf;return db['sequelize']['transaction'](function(_0x4d36ad){return db['Network']['create'](_0x1b304b[_0xfdb6('0x4f')],{'raw':!![]})[_0xfdb6('0x2f')](function(_0x28208a){_0x54ecaf=_0x28208a;return db[_0xfdb6('0x35')]['findAll']({'where':{'type':_0x1b304b[_0xfdb6('0x4f')][_0xfdb6('0x37')]},'raw':!![]});})['then'](function(_0xf5bed5){if(_0x54ecaf[_0xfdb6('0x37')]['toUpperCase']()==_0xfdb6('0x50')){var _0x3c4c56=fs['readFileSync'](path['join'](config[_0xfdb6('0x51')],_0xfdb6('0x52')),_0xfdb6('0x53'));var _0xe318ce=ejs[_0xfdb6('0x54')](_0x3c4c56,{'networks':_0xf5bed5||[]});fs[_0xfdb6('0x55')]('/etc/asterisk/stun_xcally.conf',_0xe318ce);return respondWithRpcPromise('Reload',_0xfdb6('0x4e'),{'module':'res_stun_monitor.so'});}else if(_0x54ecaf['type'][_0xfdb6('0x56')]()==_0xfdb6('0x57')){var _0x59475d=fs[_0xfdb6('0x58')](path[_0xfdb6('0x59')](config[_0xfdb6('0x51')],'server/files/templates/turn_multiple.ejs'),_0xfdb6('0x53'));var _0xf32d37=ejs[_0xfdb6('0x54')](_0x59475d,{'networks':_0xf5bed5||[]});fs['writeFileSync'](_0xfdb6('0x5a'),_0xf32d37);return respondWithRpcPromise(_0xfdb6('0x5b'),_0xfdb6('0x4e'),{'module':_0xfdb6('0x5c')});}else{var _0x106117=fs[_0xfdb6('0x58')](path[_0xfdb6('0x59')](config[_0xfdb6('0x51')],'server/files/templates/network.ejs'),_0xfdb6('0x53'));var _0xbbe0b5=ejs[_0xfdb6('0x54')](_0x106117,{'networks':_0xf5bed5||[]});fs[_0xfdb6('0x55')](util[_0xfdb6('0x5d')](_0xfdb6('0x5e'),_0x1b304b[_0xfdb6('0x4f')][_0xfdb6('0x37')][_0xfdb6('0x5f')]()),_0xbbe0b5);return respondWithRpcPromise(_0xfdb6('0x5b'),'create',{'module':'chan_sip.so'});}return null;})[_0xfdb6('0x2f')](function(){return _0x54ecaf;});})[_0xfdb6('0x2f')](respondWithResult(_0xccbef6,0xc9))[_0xfdb6('0x26')](handleError(_0xccbef6,null));};exports['update']=function(_0x4e68cc,_0x4d5e7f,_0x4be3c9){var _0x2a3028;return db['sequelize'][_0xfdb6('0x60')](function(_0x1aa08c){return db[_0xfdb6('0x35')][_0xfdb6('0x61')]({'where':{'id':_0x4e68cc[_0xfdb6('0x62')]['id']}})[_0xfdb6('0x2f')](handleEntityNotFound(_0x4d5e7f,null))['then'](saveUpdates(_0x4e68cc[_0xfdb6('0x4f')],null))[_0xfdb6('0x2f')](function(_0xf08fdf){if(_0xf08fdf){_0x2a3028=_0xf08fdf;return db[_0xfdb6('0x35')][_0xfdb6('0x63')]({'where':{'type':_0x2a3028[_0xfdb6('0x37')]},'raw':!![]});}return null;})['then'](function(_0x4fc19b){if(_0x2a3028[_0xfdb6('0x37')][_0xfdb6('0x56')]()==_0xfdb6('0x50')){var _0x3bfe4f=fs[_0xfdb6('0x58')](path[_0xfdb6('0x59')](config[_0xfdb6('0x51')],_0xfdb6('0x52')),_0xfdb6('0x53'));var _0x3da980=ejs['render'](_0x3bfe4f,{'networks':_0x4fc19b||[]});fs['writeFileSync'](_0xfdb6('0x64'),_0x3da980);return respondWithRpcPromise('Reload',_0xfdb6('0x65'),{'module':_0xfdb6('0x5c')});}else if(_0x2a3028[_0xfdb6('0x37')][_0xfdb6('0x56')]()==_0xfdb6('0x57')){var _0x3e9ba8=fs[_0xfdb6('0x58')](path[_0xfdb6('0x59')](config[_0xfdb6('0x51')],'server/files/templates/turn_multiple.ejs'),_0xfdb6('0x53'));var _0x5537f7=ejs[_0xfdb6('0x54')](_0x3e9ba8,{'networks':_0x4fc19b||[]});fs[_0xfdb6('0x55')](_0xfdb6('0x5a'),_0x5537f7);return respondWithRpcPromise(_0xfdb6('0x5b'),_0xfdb6('0x65'),{'module':_0xfdb6('0x5c')});}else{var _0x25200a=fs[_0xfdb6('0x58')](path[_0xfdb6('0x59')](config[_0xfdb6('0x51')],_0xfdb6('0x66')),_0xfdb6('0x53'));var _0x2137d4=ejs['render'](_0x25200a,{'networks':_0x4fc19b||[]});fs['writeFileSync'](util['format'](_0xfdb6('0x5e'),_0x4e68cc[_0xfdb6('0x4f')][_0xfdb6('0x37')][_0xfdb6('0x5f')]()),_0x2137d4);return respondWithRpcPromise(_0xfdb6('0x5b'),_0xfdb6('0x65'),{'module':_0xfdb6('0x67')});}return null;})[_0xfdb6('0x2f')](function(_0x2f8412){if(_0x2f8412){return _0x2a3028;}return null;});})['then'](respondWithResult(_0x4d5e7f,null))[_0xfdb6('0x26')](handleError(_0x4d5e7f,null));};exports[_0xfdb6('0x30')]=function(_0x221b05,_0x48c7d7,_0x117335){var _0x303645;return db[_0xfdb6('0x35')][_0xfdb6('0x61')]({'where':{'id':_0x221b05[_0xfdb6('0x62')]['id']}})['then'](function(_0x3f6e84){_0x303645=_0x3f6e84;return _0x3f6e84;})[_0xfdb6('0x2f')](handleEntityNotFound(_0x48c7d7,null))[_0xfdb6('0x2f')](removeEntity(_0x48c7d7,null))[_0xfdb6('0x2f')](function(){if(_0x303645){return db[_0xfdb6('0x35')][_0xfdb6('0x63')]({'where':{'type':_0x303645['type']},'raw':!![]});}})[_0xfdb6('0x2f')](function(_0x172221){if(_0x303645[_0xfdb6('0x37')][_0xfdb6('0x56')]()==_0xfdb6('0x50')){var _0x2cf406=fs['readFileSync'](path[_0xfdb6('0x59')](config[_0xfdb6('0x51')],_0xfdb6('0x52')),_0xfdb6('0x53'));var _0x5691b4=ejs[_0xfdb6('0x54')](_0x2cf406,{'networks':_0x172221||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x5691b4);return respondWithRpcPromise(_0xfdb6('0x5b'),_0xfdb6('0x30'),{'module':_0xfdb6('0x5c')});}else if(_0x303645['type'][_0xfdb6('0x56')]()==_0xfdb6('0x57')){var _0x49f754=fs['readFileSync'](path[_0xfdb6('0x59')](config[_0xfdb6('0x51')],'server/files/templates/turn_multiple.ejs'),_0xfdb6('0x53'));var _0x299f03=ejs[_0xfdb6('0x54')](_0x49f754,{'networks':_0x172221||[]});fs['writeFileSync'](_0xfdb6('0x5a'),_0x299f03);return respondWithRpcPromise(_0xfdb6('0x5b'),_0xfdb6('0x30'),{'module':_0xfdb6('0x5c')});}else{var _0x31d0f7=fs[_0xfdb6('0x58')](path['join'](config['root'],_0xfdb6('0x66')),_0xfdb6('0x53'));var _0x5bcc1a=ejs[_0xfdb6('0x54')](_0x31d0f7,{'networks':_0x172221||[]});fs['writeFileSync'](util['format'](_0xfdb6('0x5e'),_0x221b05['body'][_0xfdb6('0x37')][_0xfdb6('0x5f')]()),_0x5bcc1a);return respondWithRpcPromise(_0xfdb6('0x5b'),'destroy',{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x48c7d7,null));}; \ No newline at end of file +var _0x8f2f=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','sendStatus','stack','name','send','map','Network','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','find','transaction','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','create','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','readFileSync','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','STUN','TURN','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra'];(function(_0x432ef8,_0x467038){var _0x9bf102=function(_0x198b88){while(--_0x198b88){_0x432ef8['push'](_0x432ef8['shift']());}};_0x9bf102(++_0x467038);}(_0x8f2f,0x1b6));var _0xf8f2=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x8f2f[_0x5608a3];return _0x1ed50a;};'use strict';var emlformat=require(_0xf8f2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf8f2('0x1'));var rp=require(_0xf8f2('0x2'));var moment=require(_0xf8f2('0x3'));var BPromise=require(_0xf8f2('0x4'));var Mustache=require(_0xf8f2('0x5'));var util=require('util');var path=require(_0xf8f2('0x6'));var sox=require('sox');var csv=require(_0xf8f2('0x7'));var ejs=require(_0xf8f2('0x8'));var fs=require('fs');var fs_extra=require(_0xf8f2('0x9'));var _=require(_0xf8f2('0xa'));var squel=require('squel');var crypto=require(_0xf8f2('0xb'));var jsforce=require(_0xf8f2('0xc'));var deskjs=require(_0xf8f2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf8f2('0xe'));var Papa=require(_0xf8f2('0xf'));var Redis=require(_0xf8f2('0x10'));var authService=require(_0xf8f2('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8f2('0x12'));var logger=require(_0xf8f2('0x13'))(_0xf8f2('0x14'));var utils=require(_0xf8f2('0x15'));var config=require(_0xf8f2('0x16'));var licenseUtil=require(_0xf8f2('0x17'));var db=require(_0xf8f2('0x18'))['db'];var jayson=require(_0xf8f2('0x19'));var client=jayson[_0xf8f2('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b97be,_0x3ed894,_0x427d9e,_0x1f5fe1){return new BPromise(function(_0x4c4455,_0x473dc9){var _0x1303f6=_0x1f5fe1||client;return _0x1303f6[_0xf8f2('0x1b')](_0x3b97be,_0x427d9e)[_0xf8f2('0x1c')](function(_0x335cb4){logger[_0xf8f2('0x1d')]('Network,\x20%s,\x20%s',_0x3ed894,_0xf8f2('0x1e'));logger[_0xf8f2('0x1f')](_0xf8f2('0x20'),_0x3ed894,_0xf8f2('0x1e'),JSON[_0xf8f2('0x21')](_0x335cb4));if(_0x335cb4[_0xf8f2('0x22')]){if(_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x23')]===0x1f4){logger[_0xf8f2('0x22')](_0xf8f2('0x24'),_0x3ed894,_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x25')]);return _0x473dc9(_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x25')]);}logger[_0xf8f2('0x22')]('Network,\x20%s,\x20%s',_0x3ed894,_0x335cb4[_0xf8f2('0x22')]['message']);return _0x4c4455(_0x335cb4[_0xf8f2('0x22')][_0xf8f2('0x25')]);}else{logger[_0xf8f2('0x1d')](_0xf8f2('0x24'),_0x3ed894,_0xf8f2('0x1e'));_0x4c4455(_0x335cb4[_0xf8f2('0x26')]['message']);}})[_0xf8f2('0x27')](function(_0x5ebadc){logger[_0xf8f2('0x22')](_0xf8f2('0x24'),_0x3ed894,_0x5ebadc);_0x473dc9(_0x5ebadc);});});}function respondWithStatusCode(_0x4d6c48,_0xda70ae){_0xda70ae=_0xda70ae||0xcc;return function(_0x43d3f4){if(_0x43d3f4){return _0x4d6c48['sendStatus'](_0xda70ae);}return _0x4d6c48[_0xf8f2('0x28')](_0xda70ae)[_0xf8f2('0x29')]();};}function respondWithResult(_0xf135d,_0x47816d){_0x47816d=_0x47816d||0xc8;return function(_0x1f16b5){if(_0x1f16b5){return _0xf135d[_0xf8f2('0x28')](_0x47816d)['json'](_0x1f16b5);}};}function respondWithFilteredResult(_0x102f4f,_0x1f370a){return function(_0xea99ae){if(_0xea99ae){var _0x329d28=typeof _0x1f370a[_0xf8f2('0x2a')]===_0xf8f2('0x2b')&&typeof _0x1f370a['limit']===_0xf8f2('0x2b');var _0xfaccc4=_0xea99ae[_0xf8f2('0x2c')];var _0x435392=_0x329d28?0x0:_0x1f370a['offset'];var _0x4f124e=_0x329d28?_0xea99ae[_0xf8f2('0x2c')]:_0x1f370a[_0xf8f2('0x2a')]+_0x1f370a[_0xf8f2('0x2d')];var _0x3b5c72;if(_0x4f124e>=_0xfaccc4){_0x4f124e=_0xfaccc4;_0x3b5c72=0xc8;}else{_0x3b5c72=0xce;}_0x102f4f[_0xf8f2('0x28')](_0x3b5c72);return _0x102f4f[_0xf8f2('0x2e')](_0xf8f2('0x2f'),_0x435392+'-'+_0x4f124e+'/'+_0xfaccc4)[_0xf8f2('0x30')](_0xea99ae);}return null;};}function patchUpdates(_0x5b8193){return function(_0x1ec3db){try{jsonpatch[_0xf8f2('0x31')](_0x1ec3db,_0x5b8193,!![]);}catch(_0x3e128e){return BPromise[_0xf8f2('0x32')](_0x3e128e);}return _0x1ec3db[_0xf8f2('0x33')]();};}function saveUpdates(_0xb54663,_0x1cf1ac){return function(_0x4c3674){if(_0x4c3674){return _0x4c3674[_0xf8f2('0x34')](_0xb54663)[_0xf8f2('0x1c')](function(_0x212fe0){return _0x212fe0;});}return null;};}function removeEntity(_0x3dfe9c,_0x2eaf61){return function(_0x27bc53){if(_0x27bc53){return _0x27bc53['destroy']()[_0xf8f2('0x1c')](function(){_0x3dfe9c[_0xf8f2('0x28')](0xcc)[_0xf8f2('0x29')]();});}};}function handleEntityNotFound(_0x4d9508,_0x3c5e5){return function(_0x24698d){if(!_0x24698d){_0x4d9508[_0xf8f2('0x35')](0x194);}return _0x24698d;};}function handleError(_0x485f34,_0x56d0a3){_0x56d0a3=_0x56d0a3||0x1f4;return function(_0xf7ca6b){logger[_0xf8f2('0x22')](_0xf7ca6b[_0xf8f2('0x36')]);if(_0xf7ca6b[_0xf8f2('0x37')]){delete _0xf7ca6b[_0xf8f2('0x37')];}_0x485f34[_0xf8f2('0x28')](_0x56d0a3)[_0xf8f2('0x38')](_0xf7ca6b);};}exports['index']=function(_0x3a0c54,_0x2bb185){var _0xc3f34e={},_0x2873d0={},_0xbe44fa={'count':0x0,'rows':[]};var _0x635ecc=_[_0xf8f2('0x39')](db[_0xf8f2('0x3a')][_0xf8f2('0x3b')],function(_0xc50645){return{'name':_0xc50645[_0xf8f2('0x3c')],'type':_0xc50645[_0xf8f2('0x3d')][_0xf8f2('0x3e')]};});_0x2873d0['model']=_[_0xf8f2('0x39')](_0x635ecc,_0xf8f2('0x37'));_0x2873d0['query']=_[_0xf8f2('0x3f')](_0x3a0c54[_0xf8f2('0x40')]);_0x2873d0['filters']=_[_0xf8f2('0x41')](_0x2873d0[_0xf8f2('0x42')],_0x2873d0['query']);_0xc3f34e['attributes']=_[_0xf8f2('0x41')](_0x2873d0[_0xf8f2('0x42')],qs[_0xf8f2('0x43')](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x43')]));_0xc3f34e['attributes']=_0xc3f34e[_0xf8f2('0x44')][_0xf8f2('0x45')]?_0xc3f34e[_0xf8f2('0x44')]:_0x2873d0[_0xf8f2('0x42')];if(!_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x46')](_0xf8f2('0x47'))){_0xc3f34e[_0xf8f2('0x2d')]=qs[_0xf8f2('0x2d')](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x2d')]);_0xc3f34e[_0xf8f2('0x2a')]=qs['offset'](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x2a')]);}_0xc3f34e[_0xf8f2('0x48')]=qs[_0xf8f2('0x49')](_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x49')]);_0xc3f34e['where']=qs[_0xf8f2('0x4a')](_[_0xf8f2('0x4b')](_0x3a0c54[_0xf8f2('0x40')],_0x2873d0['filters']),_0x635ecc);if(_0x3a0c54['query'][_0xf8f2('0x4c')]){_0xc3f34e[_0xf8f2('0x4d')]=_[_0xf8f2('0x4e')](_0xc3f34e['where'],{'$or':_[_0xf8f2('0x39')](_0x635ecc,function(_0x272c89){if(_0x272c89[_0xf8f2('0x3d')]!==_0xf8f2('0x4f')){var _0x4942ab={};_0x4942ab[_0x272c89[_0xf8f2('0x37')]]={'$like':'%'+_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x4c')]+'%'};return _0x4942ab;}})});}_0xc3f34e=_[_0xf8f2('0x4e')]({},_0xc3f34e,_0x3a0c54[_0xf8f2('0x50')]);var _0x186a75={'where':_0xc3f34e['where']};return db[_0xf8f2('0x3a')][_0xf8f2('0x2c')](_0x186a75)['then'](function(_0x1fcfa2){_0xbe44fa[_0xf8f2('0x2c')]=_0x1fcfa2;if(_0x3a0c54[_0xf8f2('0x40')][_0xf8f2('0x51')]){_0xc3f34e['include']=[{'all':!![]}];}return db[_0xf8f2('0x3a')][_0xf8f2('0x52')](_0xc3f34e);})[_0xf8f2('0x1c')](function(_0x5e4b9e){_0xbe44fa[_0xf8f2('0x53')]=_0x5e4b9e;return _0xbe44fa;})['then'](respondWithFilteredResult(_0x2bb185,_0xc3f34e))[_0xf8f2('0x27')](handleError(_0x2bb185,null));};exports[_0xf8f2('0x54')]=function(_0x5873e7,_0x57a234){var _0x1baa95={'raw':!![],'where':{'id':_0x5873e7[_0xf8f2('0x55')]['id']}},_0x16c12b={};_0x16c12b['model']=_[_0xf8f2('0x3f')](db['Network'][_0xf8f2('0x3b')]);_0x16c12b[_0xf8f2('0x40')]=_['keys'](_0x5873e7[_0xf8f2('0x40')]);_0x16c12b[_0xf8f2('0x4a')]=_['intersection'](_0x16c12b[_0xf8f2('0x42')],_0x16c12b[_0xf8f2('0x40')]);_0x1baa95[_0xf8f2('0x44')]=_['intersection'](_0x16c12b[_0xf8f2('0x42')],qs[_0xf8f2('0x43')](_0x5873e7[_0xf8f2('0x40')]['fields']));_0x1baa95[_0xf8f2('0x44')]=_0x1baa95[_0xf8f2('0x44')]['length']?_0x1baa95[_0xf8f2('0x44')]:_0x16c12b[_0xf8f2('0x42')];if(_0x5873e7['query']['includeAll']){_0x1baa95[_0xf8f2('0x56')]=[{'all':!![]}];}_0x1baa95=_[_0xf8f2('0x4e')]({},_0x1baa95,_0x5873e7[_0xf8f2('0x50')]);return db['Network'][_0xf8f2('0x57')](_0x1baa95)[_0xf8f2('0x1c')](handleEntityNotFound(_0x57a234,null))[_0xf8f2('0x1c')](respondWithResult(_0x57a234,null))[_0xf8f2('0x27')](handleError(_0x57a234,null));};exports['create']=function(_0x12acdb,_0x25359c,_0x4d47a8){var _0x1b8180;return db['sequelize'][_0xf8f2('0x58')](function(_0x5dc1f2){return db[_0xf8f2('0x3a')]['create'](_0x12acdb['body'],{'raw':!![]})[_0xf8f2('0x1c')](function(_0x587009){_0x1b8180=_0x587009;return db[_0xf8f2('0x3a')][_0xf8f2('0x52')]({'where':{'type':_0x12acdb[_0xf8f2('0x59')][_0xf8f2('0x3d')]},'raw':!![]});})[_0xf8f2('0x1c')](function(_0x12a6af){if(_0x1b8180['type'][_0xf8f2('0x5a')]()=='STUN'){var _0x1489e8=fs['readFileSync'](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x5d')),_0xf8f2('0x5e'));var _0x3fcd5d=ejs[_0xf8f2('0x5f')](_0x1489e8,{'networks':_0x12a6af||[]});fs[_0xf8f2('0x60')]('/etc/asterisk/stun_xcally.conf',_0x3fcd5d);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x62'),{'module':'res_stun_monitor.so'});}else if(_0x1b8180['type'][_0xf8f2('0x5a')]()=='TURN'){var _0x59f3fd=fs['readFileSync'](path[_0xf8f2('0x5b')](config['root'],_0xf8f2('0x63')),'utf8');var _0x24e1d8=ejs[_0xf8f2('0x5f')](_0x59f3fd,{'networks':_0x12a6af||[]});fs[_0xf8f2('0x60')](_0xf8f2('0x64'),_0x24e1d8);return respondWithRpcPromise('Reload',_0xf8f2('0x62'),{'module':_0xf8f2('0x65')});}else{var _0x539ad9=fs[_0xf8f2('0x66')](path['join'](config[_0xf8f2('0x5c')],_0xf8f2('0x67')),'utf8');var _0x38c6f7=ejs['render'](_0x539ad9,{'networks':_0x12a6af||[]});fs[_0xf8f2('0x60')](util[_0xf8f2('0x68')](_0xf8f2('0x69'),_0x12acdb[_0xf8f2('0x59')]['type'][_0xf8f2('0x6a')]()),_0x38c6f7);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x62'),{'module':_0xf8f2('0x6b')});}return null;})[_0xf8f2('0x1c')](function(){return _0x1b8180;});})[_0xf8f2('0x1c')](respondWithResult(_0x25359c,0xc9))['catch'](handleError(_0x25359c,null));};exports[_0xf8f2('0x34')]=function(_0x1f2f9c,_0x2eb601,_0x332b16){var _0x1bad99;return db[_0xf8f2('0x6c')][_0xf8f2('0x58')](function(_0x1b8e29){return db['Network'][_0xf8f2('0x57')]({'where':{'id':_0x1f2f9c[_0xf8f2('0x55')]['id']}})[_0xf8f2('0x1c')](handleEntityNotFound(_0x2eb601,null))['then'](saveUpdates(_0x1f2f9c[_0xf8f2('0x59')],null))[_0xf8f2('0x1c')](function(_0x4c4923){if(_0x4c4923){_0x1bad99=_0x4c4923;return db['Network'][_0xf8f2('0x52')]({'where':{'type':_0x1bad99[_0xf8f2('0x3d')]},'raw':!![]});}return null;})[_0xf8f2('0x1c')](function(_0x2b7a35){if(_0x1bad99[_0xf8f2('0x3d')]['toUpperCase']()==_0xf8f2('0x6d')){var _0x10a8d8=fs[_0xf8f2('0x66')](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x5d')),_0xf8f2('0x5e'));var _0x1fc0a7=ejs[_0xf8f2('0x5f')](_0x10a8d8,{'networks':_0x2b7a35||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x1fc0a7);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x34'),{'module':_0xf8f2('0x65')});}else if(_0x1bad99['type'][_0xf8f2('0x5a')]()==_0xf8f2('0x6e')){var _0x5456b2=fs[_0xf8f2('0x66')](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x63')),_0xf8f2('0x5e'));var _0x33e626=ejs[_0xf8f2('0x5f')](_0x5456b2,{'networks':_0x2b7a35||[]});fs[_0xf8f2('0x60')](_0xf8f2('0x64'),_0x33e626);return respondWithRpcPromise(_0xf8f2('0x61'),_0xf8f2('0x34'),{'module':_0xf8f2('0x65')});}else{var _0x3668b0=fs[_0xf8f2('0x66')](path['join'](config['root'],'server/files/templates/network.ejs'),_0xf8f2('0x5e'));var _0xa88bcd=ejs['render'](_0x3668b0,{'networks':_0x2b7a35||[]});fs[_0xf8f2('0x60')](util[_0xf8f2('0x68')](_0xf8f2('0x69'),_0x1f2f9c['body'][_0xf8f2('0x3d')][_0xf8f2('0x6a')]()),_0xa88bcd);return respondWithRpcPromise('Reload',_0xf8f2('0x34'),{'module':'chan_sip.so'});}return null;})['then'](function(_0xc8759e){if(_0xc8759e){return _0x1bad99;}return null;});})['then'](respondWithResult(_0x2eb601,null))['catch'](handleError(_0x2eb601,null));};exports[_0xf8f2('0x6f')]=function(_0x2ed125,_0x54c5ea,_0x45a580){var _0x1040c9;return db['Network'][_0xf8f2('0x57')]({'where':{'id':_0x2ed125['params']['id']}})['then'](function(_0x564c99){_0x1040c9=_0x564c99;return _0x564c99;})[_0xf8f2('0x1c')](handleEntityNotFound(_0x54c5ea,null))[_0xf8f2('0x1c')](removeEntity(_0x54c5ea,null))[_0xf8f2('0x1c')](function(){if(_0x1040c9){return db['Network'][_0xf8f2('0x52')]({'where':{'type':_0x1040c9['type']},'raw':!![]});}})[_0xf8f2('0x1c')](function(_0xc4050a){if(_0x1040c9['type']['toUpperCase']()==_0xf8f2('0x6d')){var _0x42154b=fs[_0xf8f2('0x66')](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x5d')),'utf8');var _0x16fd44=ejs[_0xf8f2('0x5f')](_0x42154b,{'networks':_0xc4050a||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x16fd44);return respondWithRpcPromise(_0xf8f2('0x61'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x1040c9[_0xf8f2('0x3d')]['toUpperCase']()=='TURN'){var _0x3de953=fs[_0xf8f2('0x66')](path['join'](config[_0xf8f2('0x5c')],'server/files/templates/turn_multiple.ejs'),_0xf8f2('0x5e'));var _0x4451f1=ejs[_0xf8f2('0x5f')](_0x3de953,{'networks':_0xc4050a||[]});fs[_0xf8f2('0x60')]('/etc/asterisk/turn_xcally.conf',_0x4451f1);return respondWithRpcPromise('Reload',_0xf8f2('0x6f'),{'module':'res_stun_monitor.so'});}else{var _0x1694e0=fs['readFileSync'](path[_0xf8f2('0x5b')](config[_0xf8f2('0x5c')],_0xf8f2('0x67')),_0xf8f2('0x5e'));var _0xba1264=ejs['render'](_0x1694e0,{'networks':_0xc4050a||[]});fs[_0xf8f2('0x60')](util[_0xf8f2('0x68')]('/etc/asterisk/sip_xcally_%s.conf',_0x2ed125[_0xf8f2('0x59')]['type'][_0xf8f2('0x6a')]()),_0xba1264);return respondWithRpcPromise(_0xf8f2('0x61'),'destroy',{'module':'chan_sip.so'});}return null;})[_0xf8f2('0x27')](handleError(_0x54c5ea,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index bbc1084..0601e0d 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 _0xa9e0=['../../config/environment','./network.attributes','exports','define','Network','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x17feee,_0x4c8f14){var _0x2b5b98=function(_0x48d65e){while(--_0x48d65e){_0x17feee['push'](_0x17feee['shift']());}};_0x2b5b98(++_0x4c8f14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f0d=['./network.attributes','define','Network','network','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x28b793,_0xee212c){_0x28b793=_0x28b793-0x0;var _0x41fb9e=_0x6f0d[_0x28b793];return _0x41fb9e;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 1e9789c..87ecab9 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x190fee,_0x53ced8){_0x190fee=_0x190fee-0x0;var _0x443811=_0x7a54[_0x190fee];return _0x443811;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xa6c3c,_0x410e4f){_0xa6c3c=_0xa6c3c-0x0;var _0x34c41b=_0x7a54[_0xa6c3c];return _0x34c41b;};'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 e2b378c..c245660 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 _0x60f9=['isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','util','path','express','Router','fs-extra','../../components/interaction/service','./openchannelAccount.controller','get'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x60f9,0xb1));var _0x960f=function(_0x45e839,_0x175de2){_0x45e839=_0x45e839-0x0;var _0x5009c0=_0x60f9[_0x45e839];return _0x5009c0;};'use strict';var multer=require('multer');var util=require(_0x960f('0x0'));var path=require(_0x960f('0x1'));var timeout=require('connect-timeout');var express=require(_0x960f('0x2'));var router=express[_0x960f('0x3')]();var fs_extra=require(_0x960f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x960f('0x5'));var config=require('../../config/environment');var controller=require(_0x960f('0x6'));router[_0x960f('0x7')]('/',auth[_0x960f('0x8')](),controller[_0x960f('0x9')]);router[_0x960f('0x7')]('/describe',auth[_0x960f('0x8')](),controller[_0x960f('0xa')]);router[_0x960f('0x7')](_0x960f('0xb'),auth[_0x960f('0x8')](),controller['show']);router[_0x960f('0x7')](_0x960f('0xc'),auth[_0x960f('0x8')](),controller['getDispositions']);router['get'](_0x960f('0xd'),auth[_0x960f('0x8')](),controller[_0x960f('0xe')]);router[_0x960f('0x7')](_0x960f('0xf'),auth[_0x960f('0x8')](),controller[_0x960f('0x10')]);router[_0x960f('0x7')](_0x960f('0x11'),auth['isAuthenticated'](),controller[_0x960f('0x12')]);router[_0x960f('0x7')](_0x960f('0x13'),auth[_0x960f('0x8')](),controller[_0x960f('0x14')]);router[_0x960f('0x15')]('/',auth[_0x960f('0x8')](),controller[_0x960f('0x16')]);router[_0x960f('0x15')](_0x960f('0xc'),auth[_0x960f('0x8')](),controller[_0x960f('0x17')]);router[_0x960f('0x15')](_0x960f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x960f('0x15')](_0x960f('0x18'),controller[_0x960f('0x19')]);router[_0x960f('0x15')](_0x960f('0xf'),auth[_0x960f('0x8')](),controller['addApplications']);router['post'](_0x960f('0x13'),auth[_0x960f('0x8')](),controller[_0x960f('0x1a')]);router['post'](_0x960f('0x1b'),auth['isAuthenticated'](),controller[_0x960f('0x1c')]);router[_0x960f('0x1d')](_0x960f('0xb'),auth['isAuthenticated'](),controller[_0x960f('0x1e')]);router[_0x960f('0x1f')](_0x960f('0xb'),auth[_0x960f('0x8')](),controller[_0x960f('0x20')]);router[_0x960f('0x1f')](_0x960f('0xc'),auth['isAuthenticated'](),controller[_0x960f('0x21')]);router[_0x960f('0x1f')](_0x960f('0xd'),auth[_0x960f('0x8')](),controller[_0x960f('0x22')]);router[_0x960f('0x1f')](_0x960f('0x13'),auth[_0x960f('0x8')](),controller[_0x960f('0x23')]);module[_0x960f('0x24')]=router; \ No newline at end of file +var _0x72f3=['isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getInteractions','/:id/users','getAgents','post','create','addDisposition','notify','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','util','path','connect-timeout','express','Router','../../config/environment','./openchannelAccount.controller','get','index','/describe'];(function(_0x16f53c,_0x3dfdb1){var _0x2ef7cd=function(_0x508433){while(--_0x508433){_0x16f53c['push'](_0x16f53c['shift']());}};_0x2ef7cd(++_0x3dfdb1);}(_0x72f3,0x1c4));var _0x372f=function(_0x3a259d,_0x313102){_0x3a259d=_0x3a259d-0x0;var _0x2e03e6=_0x72f3[_0x3a259d];return _0x2e03e6;};'use strict';var multer=require('multer');var util=require(_0x372f('0x0'));var path=require(_0x372f('0x1'));var timeout=require(_0x372f('0x2'));var express=require(_0x372f('0x3'));var router=express[_0x372f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x372f('0x5'));var controller=require(_0x372f('0x6'));router[_0x372f('0x7')]('/',auth['isAuthenticated'](),controller[_0x372f('0x8')]);router[_0x372f('0x7')](_0x372f('0x9'),auth[_0x372f('0xa')](),controller[_0x372f('0xb')]);router[_0x372f('0x7')](_0x372f('0xc'),auth[_0x372f('0xa')](),controller[_0x372f('0xd')]);router[_0x372f('0x7')](_0x372f('0xe'),auth[_0x372f('0xa')](),controller[_0x372f('0xf')]);router[_0x372f('0x7')](_0x372f('0x10'),auth['isAuthenticated'](),controller[_0x372f('0x11')]);router[_0x372f('0x7')](_0x372f('0x12'),auth[_0x372f('0xa')](),controller['getApplications']);router[_0x372f('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x372f('0x13')]);router[_0x372f('0x7')](_0x372f('0x14'),auth[_0x372f('0xa')](),controller[_0x372f('0x15')]);router[_0x372f('0x16')]('/',auth[_0x372f('0xa')](),controller[_0x372f('0x17')]);router[_0x372f('0x16')](_0x372f('0xe'),auth[_0x372f('0xa')](),controller[_0x372f('0x18')]);router[_0x372f('0x16')](_0x372f('0x10'),auth[_0x372f('0xa')](),controller['addAnswer']);router[_0x372f('0x16')]('/:id/notify',controller[_0x372f('0x19')]);router[_0x372f('0x16')](_0x372f('0x12'),auth[_0x372f('0xa')](),controller['addApplications']);router[_0x372f('0x16')]('/:id/users',auth[_0x372f('0xa')](),controller[_0x372f('0x1a')]);router[_0x372f('0x16')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x372f('0x1b')](_0x372f('0xc'),auth[_0x372f('0xa')](),controller[_0x372f('0x1c')]);router[_0x372f('0x1d')](_0x372f('0xc'),auth[_0x372f('0xa')](),controller[_0x372f('0x1e')]);router[_0x372f('0x1d')](_0x372f('0xe'),auth[_0x372f('0xa')](),controller[_0x372f('0x1f')]);router[_0x372f('0x1d')]('/:id/canned_answers',auth[_0x372f('0xa')](),controller[_0x372f('0x20')]);router[_0x372f('0x1d')](_0x372f('0x14'),auth[_0x372f('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 34c2452..4a95e86 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 _0x7544=['name','STRING','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x7544,0x15f));var _0x4754=function(_0x1d1def,_0x84a4d6){_0x1d1def=_0x1d1def-0x0;var _0x37dd50=_0x7544[_0x1d1def];return _0x37dd50;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x4754('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x4754('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0x4754('0x2')]},'token':{'type':Sequelize[_0x4754('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x4754('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4754('0x3');}},'notificationSound':{'type':Sequelize[_0x4754('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4754('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4754('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x4754('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4754('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4754('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4754('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x4754('0x6')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x4754('0x7'),'set':function(_0x51d0e7){if(!_0x51d0e7)this[_0x4754('0x8')](_0x4754('0x9'),null);this[_0x4754('0x8')](_0x4754('0xa'),_0x51d0e7);}}}; \ No newline at end of file +var _0x398d=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x43cf19,_0x56ebde){var _0x560994=function(_0x4bfde7){while(--_0x4bfde7){_0x43cf19['push'](_0x43cf19['shift']());}};_0x560994(++_0x56ebde);}(_0x398d,0x1c9));var _0xd398=function(_0x1e3ee0,_0xb8ee13){_0x1e3ee0=_0x1e3ee0-0x0;var _0x3a171f=_0x398d[_0x1e3ee0];return _0x3a171f;};'use strict';var Sequelize=require(_0xd398('0x0'));var rs=require('randomstring');module[_0xd398('0x1')]={'name':{'type':Sequelize[_0xd398('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd398('0x2')]},'token':{'type':Sequelize[_0xd398('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xd398('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd398('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd398('0x3');}},'notificationSound':{'type':Sequelize[_0xd398('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd398('0x4')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd398('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd398('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd398('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd398('0x4')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd398('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd398('0x6')},'mandatoryDisposition':{'type':Sequelize[_0xd398('0x4')],'defaultValue':![],'comment':_0xd398('0x7'),'set':function(_0x57a62b){if(!_0x57a62b)this[_0xd398('0x8')](_0xd398('0x9'),null);this[_0xd398('0x8')](_0xd398('0xa'),_0x57a62b);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index cd9ee51..a83a578 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 _0x136a=['removeDispositions','ids','addAnswer','CannedAnswer','findAll','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','OpenchannelApplication','Applications','List','account','applications','orderBy','priority','asc','Contacts','defaults','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','findAndCountAll','getApplications','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','omit','removeAgents','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','stack','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','show','params','fields','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','hasOwnProperty','rows'];(function(_0x59cbb0,_0x33462d){var _0x331c55=function(_0x2b18a1){while(--_0x2b18a1){_0x59cbb0['push'](_0x59cbb0['shift']());}};_0x331c55(++_0x33462d);}(_0x136a,0x109));var _0xa136=function(_0x1142fc,_0x3b4ead){_0x1142fc=_0x1142fc-0x0;var _0xbaab64=_0x136a[_0x1142fc];return _0xbaab64;};'use strict';var emlformat=require(_0xa136('0x0'));var rimraf=require(_0xa136('0x1'));var zipdir=require(_0xa136('0x2'));var jsonpatch=require(_0xa136('0x3'));var rp=require('request-promise');var moment=require(_0xa136('0x4'));var BPromise=require(_0xa136('0x5'));var Mustache=require(_0xa136('0x6'));var util=require(_0xa136('0x7'));var path=require(_0xa136('0x8'));var sox=require('sox');var csv=require(_0xa136('0x9'));var ejs=require(_0xa136('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa136('0xb'));var squel=require(_0xa136('0xc'));var crypto=require(_0xa136('0xd'));var jsforce=require(_0xa136('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa136('0xf'));var Redis=require(_0xa136('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa136('0x11'));var as=require(_0xa136('0x12'));var hardwareService=require(_0xa136('0x13'));var logger=require(_0xa136('0x14'))(_0xa136('0x15'));var utils=require(_0xa136('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa136('0x17'));var db=require(_0xa136('0x18'))['db'];config[_0xa136('0x19')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa136('0x1a'))(new Redis(config[_0xa136('0x19')]));require(_0xa136('0x1b'))[_0xa136('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa136('0x1d')][_0xa136('0x1e')]({'port':0x232c});var client9002=jayson[_0xa136('0x1d')][_0xa136('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x50d3eb,_0x5ba839,_0x3e1d3e,_0x416931){return new BPromise(function(_0xc6ac2c,_0x5794cc){var _0x450c1b=_0x416931||client;return _0x450c1b[_0xa136('0x1f')](_0x50d3eb,_0x3e1d3e)[_0xa136('0x20')](function(_0xfe1aa1){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5ba839,_0xa136('0x21'));logger[_0xa136('0x22')](_0xa136('0x23'),_0x5ba839,_0xa136('0x21'),JSON[_0xa136('0x24')](_0xfe1aa1));if(_0xfe1aa1[_0xa136('0x25')]){if(_0xfe1aa1['error'][_0xa136('0x26')]===0x1f4){logger[_0xa136('0x25')](_0xa136('0x27'),_0x5ba839,_0xfe1aa1[_0xa136('0x25')][_0xa136('0x28')]);return _0x5794cc(_0xfe1aa1['error'][_0xa136('0x28')]);}logger[_0xa136('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x5ba839,_0xfe1aa1[_0xa136('0x25')][_0xa136('0x28')]);return _0xc6ac2c(_0xfe1aa1[_0xa136('0x25')]['message']);}else{logger[_0xa136('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x5ba839,'request\x20sent');_0xc6ac2c(_0xfe1aa1[_0xa136('0x2a')][_0xa136('0x28')]);}})[_0xa136('0x2b')](function(_0x3408c3){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5ba839,_0x3408c3);_0x5794cc(_0x3408c3);});});}function respondWithStatusCode(_0x32e8bf,_0x366f4e){_0x366f4e=_0x366f4e||0xcc;return function(_0x5eac6e){if(_0x5eac6e){return _0x32e8bf[_0xa136('0x2c')](_0x366f4e);}return _0x32e8bf[_0xa136('0x2d')](_0x366f4e)['end']();};}function respondWithResult(_0x2a990b,_0x4673b3){_0x4673b3=_0x4673b3||0xc8;return function(_0x2a7493){if(_0x2a7493){return _0x2a990b[_0xa136('0x2d')](_0x4673b3)[_0xa136('0x2e')](_0x2a7493);}};}function respondWithFilteredResult(_0x538d3e,_0x3493b6){return function(_0xe1f85e){if(_0xe1f85e){var _0x172c19=typeof _0x3493b6[_0xa136('0x2f')]===_0xa136('0x30')&&typeof _0x3493b6[_0xa136('0x31')]==='undefined';var _0x2714c3=_0xe1f85e[_0xa136('0x32')];var _0x2deaaa=_0x172c19?0x0:_0x3493b6[_0xa136('0x2f')];var _0x54b7da=_0x172c19?_0xe1f85e[_0xa136('0x32')]:_0x3493b6['offset']+_0x3493b6[_0xa136('0x31')];var _0x17f57f;if(_0x54b7da>=_0x2714c3){_0x54b7da=_0x2714c3;_0x17f57f=0xc8;}else{_0x17f57f=0xce;}_0x538d3e[_0xa136('0x2d')](_0x17f57f);return _0x538d3e[_0xa136('0x33')](_0xa136('0x34'),_0x2deaaa+'-'+_0x54b7da+'/'+_0x2714c3)[_0xa136('0x2e')](_0xe1f85e);}return null;};}function patchUpdates(_0x3286d9){return function(_0x337992){try{jsonpatch[_0xa136('0x35')](_0x337992,_0x3286d9,!![]);}catch(_0x42ce64){return BPromise[_0xa136('0x36')](_0x42ce64);}return _0x337992[_0xa136('0x37')]();};}function saveUpdates(_0x2edc42,_0x3086f2){return function(_0x381cf2){if(_0x381cf2){return _0x381cf2[_0xa136('0x38')](_0x2edc42)[_0xa136('0x20')](function(_0xb20276){return _0xb20276;});}return null;};}function removeEntity(_0x4b1c38,_0x5d203b){return function(_0x5134df){if(_0x5134df){return _0x5134df[_0xa136('0x39')]()[_0xa136('0x20')](function(){var _0x3c1d9a=_0x5134df[_0xa136('0x3a')]({'plain':!![]});var _0x3964a9='OpenchannelAccounts';return db['UserProfileResource'][_0xa136('0x39')]({'where':{'type':_0x3964a9,'resourceId':_0x3c1d9a['id']}})[_0xa136('0x20')](function(){return _0x5134df;});})['then'](function(){_0x4b1c38[_0xa136('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f4c37,_0x12e575){return function(_0x53aa60){if(!_0x53aa60){_0x1f4c37[_0xa136('0x2c')](0x194);}return _0x53aa60;};}function handleError(_0x1e2234,_0xe6ce82){_0xe6ce82=_0xe6ce82||0x1f4;return function(_0x306018){logger[_0xa136('0x25')](_0x306018[_0xa136('0x3b')]);if(_0x306018['name']){delete _0x306018['name'];}_0x1e2234[_0xa136('0x2d')](_0xe6ce82)[_0xa136('0x3c')](_0x306018);};}exports[_0xa136('0x3d')]=function(_0x36853b,_0x5c4fdc){var _0x5e3d8f={'include':[{'model':db[_0xa136('0x3e')],'as':_0xa136('0x3f')}]},_0x287e54={},_0x2688cc={'count':0x0,'rows':[]};var _0x299056=_[_0xa136('0x40')](db[_0xa136('0x41')][_0xa136('0x42')],function(_0x43de88){return{'name':_0x43de88['fieldName'],'type':_0x43de88[_0xa136('0x43')][_0xa136('0x44')]};});_0x287e54[_0xa136('0x45')]=_['map'](_0x299056,_0xa136('0x46'));_0x287e54['query']=_[_0xa136('0x47')](_0x36853b[_0xa136('0x48')]);_0x287e54[_0xa136('0x49')]=_[_0xa136('0x4a')](_0x287e54[_0xa136('0x45')],_0x287e54[_0xa136('0x48')]);_0x5e3d8f['attributes']=_[_0xa136('0x4a')](_0x287e54[_0xa136('0x45')],qs['fields'](_0x36853b[_0xa136('0x48')]['fields']));_0x5e3d8f[_0xa136('0x4b')]=_0x5e3d8f[_0xa136('0x4b')]['length']?_0x5e3d8f[_0xa136('0x4b')]:_0x287e54['model'];if(!_0x36853b[_0xa136('0x48')]['hasOwnProperty'](_0xa136('0x4c'))){_0x5e3d8f[_0xa136('0x31')]=qs[_0xa136('0x31')](_0x36853b['query'][_0xa136('0x31')]);_0x5e3d8f[_0xa136('0x2f')]=qs[_0xa136('0x2f')](_0x36853b[_0xa136('0x48')]['offset']);}_0x5e3d8f[_0xa136('0x4d')]=qs['sort'](_0x36853b[_0xa136('0x48')][_0xa136('0x4e')]);_0x5e3d8f[_0xa136('0x4f')]=qs[_0xa136('0x49')](_[_0xa136('0x50')](_0x36853b[_0xa136('0x48')],_0x287e54[_0xa136('0x49')]),_0x299056);if(_0x36853b[_0xa136('0x48')]['filter']){_0x5e3d8f[_0xa136('0x4f')]=_[_0xa136('0x51')](_0x5e3d8f[_0xa136('0x4f')],{'$or':_[_0xa136('0x40')](_0x299056,function(_0x4f83ed){if(_0x4f83ed[_0xa136('0x43')]!==_0xa136('0x52')){var _0x274b65={};_0x274b65[_0x4f83ed['name']]={'$like':'%'+_0x36853b['query'][_0xa136('0x53')]+'%'};return _0x274b65;}})});}_0x5e3d8f=_['merge']({},_0x5e3d8f,_0x36853b[_0xa136('0x54')]);var _0x4c0631={'where':_0x5e3d8f[_0xa136('0x4f')]};return db[_0xa136('0x41')][_0xa136('0x32')](_0x4c0631)[_0xa136('0x20')](function(_0x4968e9){_0x2688cc[_0xa136('0x32')]=_0x4968e9;if(_0x36853b[_0xa136('0x48')][_0xa136('0x55')]){_0x5e3d8f[_0xa136('0x56')]=[{'all':!![]}];}return db[_0xa136('0x41')]['findAll'](_0x5e3d8f);})[_0xa136('0x20')](function(_0x21e35a){_0x2688cc['rows']=_0x21e35a;return _0x2688cc;})['then'](respondWithFilteredResult(_0x5c4fdc,_0x5e3d8f))[_0xa136('0x2b')](handleError(_0x5c4fdc,null));};exports[_0xa136('0x57')]=function(_0x16dd6f,_0x519d8b){var _0x4fe337={'raw':![],'where':{'id':_0x16dd6f[_0xa136('0x58')]['id']},'include':[{'model':db[_0xa136('0x3e')],'as':_0xa136('0x3f')}]},_0x45f228={};_0x45f228[_0xa136('0x45')]=_[_0xa136('0x47')](db[_0xa136('0x41')][_0xa136('0x42')]);_0x45f228[_0xa136('0x48')]=_[_0xa136('0x47')](_0x16dd6f[_0xa136('0x48')]);_0x45f228[_0xa136('0x49')]=_[_0xa136('0x4a')](_0x45f228[_0xa136('0x45')],_0x45f228[_0xa136('0x48')]);_0x4fe337[_0xa136('0x4b')]=_['intersection'](_0x45f228[_0xa136('0x45')],qs[_0xa136('0x59')](_0x16dd6f[_0xa136('0x48')][_0xa136('0x59')]));_0x4fe337[_0xa136('0x4b')]=_0x4fe337[_0xa136('0x4b')][_0xa136('0x5a')]?_0x4fe337[_0xa136('0x4b')]:_0x45f228[_0xa136('0x45')];if(_0x16dd6f[_0xa136('0x48')]['includeAll']){_0x4fe337[_0xa136('0x56')]=[{'all':!![]}];}_0x4fe337=_[_0xa136('0x51')]({},_0x4fe337,_0x16dd6f[_0xa136('0x54')]);return db[_0xa136('0x41')]['find'](_0x4fe337)[_0xa136('0x20')](handleEntityNotFound(_0x519d8b,null))[_0xa136('0x20')](respondWithResult(_0x519d8b,null))['catch'](handleError(_0x519d8b,null));};exports[_0xa136('0x5b')]=function(_0x192e4e,_0x3e22b1){return db[_0xa136('0x41')][_0xa136('0x5b')](_0x192e4e[_0xa136('0x5c')],{})['then'](function(_0x43b2e9){var _0x586b67=_0x192e4e['user'][_0xa136('0x3a')]({'plain':!![]});if(!_0x586b67)throw new Error(_0xa136('0x5d'));if(_0x586b67[_0xa136('0x5e')]===_0xa136('0x5f')){var _0x4ae648=_0x43b2e9[_0xa136('0x3a')]({'plain':!![]});var _0x146d50='OpenchannelAccounts';return db[_0xa136('0x60')]['find']({'where':{'name':_0x146d50,'userProfileId':_0x586b67[_0xa136('0x61')]},'raw':!![]})['then'](function(_0x51ffa5){if(_0x51ffa5&&_0x51ffa5[_0xa136('0x62')]===0x0){return db['UserProfileResource'][_0xa136('0x5b')]({'name':_0x4ae648['name'],'resourceId':_0x4ae648['id'],'type':_0x51ffa5[_0xa136('0x46')],'sectionId':_0x51ffa5['id']},{})['then'](function(){return _0x43b2e9;});}else{return _0x43b2e9;}})[_0xa136('0x2b')](function(_0x38b677){logger[_0xa136('0x25')](_0xa136('0x63'),_0x38b677);throw _0x38b677;});}return _0x43b2e9;})[_0xa136('0x20')](respondWithResult(_0x3e22b1,0xc9))['catch'](handleError(_0x3e22b1,null));};exports[_0xa136('0x38')]=function(_0x184e8c,_0x9fe8e3){if(_0x184e8c['body']['id']){delete _0x184e8c['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x184e8c[_0xa136('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x9fe8e3,null))[_0xa136('0x20')](saveUpdates(_0x184e8c[_0xa136('0x5c')],null))['then'](respondWithResult(_0x9fe8e3,null))['catch'](handleError(_0x9fe8e3,null));};exports[_0xa136('0x39')]=function(_0x1edfc4,_0x4afb51){return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x1edfc4[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x4afb51,null))[_0xa136('0x20')](removeEntity(_0x4afb51,null))[_0xa136('0x2b')](handleError(_0x4afb51,null));};exports[_0xa136('0x65')]=function(_0x1f2687,_0x46d521){return db[_0xa136('0x41')][_0xa136('0x65')]()[_0xa136('0x20')](respondWithResult(_0x46d521,null))['catch'](handleError(_0x46d521,null));};exports[_0xa136('0x66')]=function(_0x388031,_0x1de07d,_0x57d6f0){if(_0x388031[_0xa136('0x5c')]['id']){delete _0x388031[_0xa136('0x5c')]['id'];}return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x388031[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x1de07d,null))['then'](function(_0x3848d2){if(_0x3848d2){_0x388031[_0xa136('0x5c')][_0xa136('0x67')]=_0x3848d2['id'];return db['Disposition'][_0xa136('0x5b')](_0x388031['body']);}})[_0xa136('0x20')](respondWithResult(_0x1de07d,null))[_0xa136('0x2b')](handleError(_0x1de07d,null));};exports[_0xa136('0x68')]=function(_0x100a31,_0x26aee3,_0x20cfdf){var _0x3a3f0d={'raw':![],'where':{}};var _0x158d56={};var _0x25dad5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa136('0x69')]({'where':{'id':_0x100a31[_0xa136('0x58')]['id']}})['then'](handleEntityNotFound(_0x26aee3,null))[_0xa136('0x20')](function(_0x3100b7){if(_0x3100b7){_0x158d56[_0xa136('0x45')]=_[_0xa136('0x47')](db[_0xa136('0x6a')][_0xa136('0x42')]);_0x158d56[_0xa136('0x48')]=_[_0xa136('0x47')](_0x100a31[_0xa136('0x48')]);_0x158d56[_0xa136('0x49')]=_['intersection'](_0x158d56[_0xa136('0x45')],_0x158d56[_0xa136('0x48')]);_0x3a3f0d[_0xa136('0x4b')]=_[_0xa136('0x4a')](_0x158d56['model'],qs[_0xa136('0x59')](_0x100a31[_0xa136('0x48')][_0xa136('0x59')]));_0x3a3f0d[_0xa136('0x4b')]=_0x3a3f0d[_0xa136('0x4b')][_0xa136('0x5a')]?_0x3a3f0d[_0xa136('0x4b')]:_0x158d56[_0xa136('0x45')];if(!_0x100a31['query'][_0xa136('0x6b')](_0xa136('0x4c'))){_0x3a3f0d[_0xa136('0x31')]=qs['limit'](_0x100a31[_0xa136('0x48')][_0xa136('0x31')]);_0x3a3f0d[_0xa136('0x2f')]=qs['offset'](_0x100a31[_0xa136('0x48')]['offset']);}_0x3a3f0d[_0xa136('0x4d')]=qs[_0xa136('0x4e')](_0x100a31[_0xa136('0x48')][_0xa136('0x4e')]);_0x3a3f0d[_0xa136('0x4f')]=qs['filters'](_[_0xa136('0x50')](_0x100a31[_0xa136('0x48')],_0x158d56[_0xa136('0x49')]));_0x3a3f0d[_0xa136('0x4f')][_0xa136('0x67')]=_0x3100b7['id'];if(_0x100a31[_0xa136('0x48')][_0xa136('0x53')]){_0x3a3f0d[_0xa136('0x4f')]=_[_0xa136('0x51')](_0x3a3f0d[_0xa136('0x4f')],{'$or':_[_0xa136('0x40')](_0x3a3f0d['attributes'],function(_0xcb994b){var _0x35b50f={};_0x35b50f[_0xcb994b]={'$like':'%'+_0x100a31[_0xa136('0x48')][_0xa136('0x53')]+'%'};return _0x35b50f;})});}_0x3a3f0d=_[_0xa136('0x51')]({},_0x3a3f0d,_0x100a31[_0xa136('0x54')]);return db[_0xa136('0x6a')][_0xa136('0x32')]({'where':_0x3a3f0d[_0xa136('0x4f')]})[_0xa136('0x20')](function(_0x40d73c){_0x25dad5['count']=_0x40d73c;if(_0x100a31[_0xa136('0x48')][_0xa136('0x55')]){_0x3a3f0d['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3a3f0d);})['then'](function(_0x40d323){_0x25dad5[_0xa136('0x6c')]=_0x40d323;return _0x25dad5;});}})[_0xa136('0x20')](respondWithFilteredResult(_0x26aee3,_0x3a3f0d))['catch'](handleError(_0x26aee3,null));};exports[_0xa136('0x6d')]=function(_0x290b90,_0x358e3e,_0x302d69){return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x290b90['params']['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x358e3e,null))[_0xa136('0x20')](function(_0x2c5d77){if(_0x2c5d77){return _0x2c5d77[_0xa136('0x6d')](_0x290b90['query'][_0xa136('0x6e')]);}})['then'](respondWithStatusCode(_0x358e3e,null))[_0xa136('0x2b')](handleError(_0x358e3e,null));};exports[_0xa136('0x6f')]=function(_0x2e3298,_0x44c8f0,_0x43796c){if(_0x2e3298[_0xa136('0x5c')]['id']){delete _0x2e3298['body']['id'];}return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x2e3298[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x44c8f0,null))[_0xa136('0x20')](function(_0x5b066b){if(_0x5b066b){_0x2e3298['body'][_0xa136('0x67')]=_0x5b066b['id'];return db[_0xa136('0x70')][_0xa136('0x5b')](_0x2e3298[_0xa136('0x5c')]);}})[_0xa136('0x20')](respondWithResult(_0x44c8f0,null))[_0xa136('0x2b')](handleError(_0x44c8f0,null));};exports['getAnswers']=function(_0x51daf9,_0x10488d,_0x14343d){var _0x565355={'raw':![],'where':{}};var _0x35893f={};var _0x5b5211={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x51daf9[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x10488d,null))[_0xa136('0x20')](function(_0x5eb903){if(_0x5eb903){_0x35893f['model']=_[_0xa136('0x47')](db['CannedAnswer'][_0xa136('0x42')]);_0x35893f[_0xa136('0x48')]=_[_0xa136('0x47')](_0x51daf9[_0xa136('0x48')]);_0x35893f[_0xa136('0x49')]=_[_0xa136('0x4a')](_0x35893f['model'],_0x35893f[_0xa136('0x48')]);_0x565355[_0xa136('0x4b')]=_[_0xa136('0x4a')](_0x35893f[_0xa136('0x45')],qs[_0xa136('0x59')](_0x51daf9[_0xa136('0x48')][_0xa136('0x59')]));_0x565355[_0xa136('0x4b')]=_0x565355[_0xa136('0x4b')]['length']?_0x565355['attributes']:_0x35893f[_0xa136('0x45')];if(!_0x51daf9[_0xa136('0x48')][_0xa136('0x6b')](_0xa136('0x4c'))){_0x565355['limit']=qs[_0xa136('0x31')](_0x51daf9[_0xa136('0x48')]['limit']);_0x565355['offset']=qs[_0xa136('0x2f')](_0x51daf9[_0xa136('0x48')]['offset']);}_0x565355[_0xa136('0x4d')]=qs[_0xa136('0x4e')](_0x51daf9[_0xa136('0x48')][_0xa136('0x4e')]);_0x565355[_0xa136('0x4f')]=qs[_0xa136('0x49')](_[_0xa136('0x50')](_0x51daf9[_0xa136('0x48')],_0x35893f[_0xa136('0x49')]));_0x565355[_0xa136('0x4f')][_0xa136('0x67')]=_0x5eb903['id'];if(_0x51daf9['query'][_0xa136('0x53')]){_0x565355[_0xa136('0x4f')]=_[_0xa136('0x51')](_0x565355[_0xa136('0x4f')],{'$or':_[_0xa136('0x40')](_0x565355[_0xa136('0x4b')],function(_0x5e980c){var _0x107764={};_0x107764[_0x5e980c]={'$like':'%'+_0x51daf9[_0xa136('0x48')]['filter']+'%'};return _0x107764;})});}_0x565355=_['merge']({},_0x565355,_0x51daf9['options']);return db['CannedAnswer'][_0xa136('0x32')]({'where':_0x565355['where']})[_0xa136('0x20')](function(_0x11b72a){_0x5b5211[_0xa136('0x32')]=_0x11b72a;if(_0x51daf9[_0xa136('0x48')]['includeAll']){_0x565355[_0xa136('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xa136('0x71')](_0x565355);})[_0xa136('0x20')](function(_0x251ffe){_0x5b5211[_0xa136('0x6c')]=_0x251ffe;return _0x5b5211;});}})['then'](respondWithFilteredResult(_0x10488d,_0x565355))[_0xa136('0x2b')](handleError(_0x10488d,null));};exports[_0xa136('0x72')]=function(_0x4d871a,_0x562d04,_0x4ad29d){return db['OpenchannelAccount'][_0xa136('0x64')]({'where':{'id':_0x4d871a[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x562d04,null))['then'](function(_0x22d5e2){if(_0x22d5e2){return _0x22d5e2['removeAnswers'](_0x4d871a[_0xa136('0x48')][_0xa136('0x6e')]);}})[_0xa136('0x20')](respondWithStatusCode(_0x562d04,null))[_0xa136('0x2b')](handleError(_0x562d04,null));};exports[_0xa136('0x73')]=function(_0x355eda,_0x353044,_0x2f1ac5){var _0x3f92a7={'body':_0x355eda['body'],'channel':_0xa136('0x74')};var _0x5a2c77=[];var _0x10cf29=[];var _0x1ad7ea={};var _0x888f52=![];return db[_0xa136('0x75')]['describe']()[_0xa136('0x20')](function(_0x3e6a25){if(!_0x3e6a25){throw new db['Sequelize'][(_0xa136('0x76'))](_0xa136('0x77'));}_0x5a2c77=_[_0xa136('0x78')](_[_0xa136('0x47')](_0x3e6a25),[_0xa136('0x79'),_0xa136('0x7a')]);_0x10cf29=_['difference'](_[_0xa136('0x47')](_0x3e6a25),[_0xa136('0x79'),_0xa136('0x7a'),'CompanyId',_0xa136('0x7b')]);if(_0x355eda[_0xa136('0x5c')]['id']){delete _0x355eda[_0xa136('0x5c')]['id'];}if(_['isNil'](_0x355eda[_0xa136('0x5c')][_0xa136('0x7c')])){throw new db['Sequelize'][(_0xa136('0x76'))](_0xa136('0x7d'));}if(_[_0xa136('0x7e')](_0x355eda[_0xa136('0x5c')][_0xa136('0x5c')])||_0x355eda[_0xa136('0x5c')][_0xa136('0x5c')]===''){throw new db[(_0xa136('0x7f'))]['ValidationError'](_0xa136('0x80'));}if(_[_0xa136('0x7e')](_0x355eda[_0xa136('0x5c')][_0xa136('0x81')])){throw new db[(_0xa136('0x7f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x10cf29);}if(!_['includes'](_0x10cf29,_0x355eda[_0xa136('0x5c')]['mapKey'])){throw new db[(_0xa136('0x7f'))]['ValidationError'](_0xa136('0x82')+_0x10cf29);}_0x1ad7ea[_0x355eda[_0xa136('0x5c')][_0xa136('0x81')]]=_0x355eda[_0xa136('0x5c')][_0xa136('0x7c')];})[_0xa136('0x20')](function(){return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x355eda[_0xa136('0x58')]['id']},'include':[{'model':db[_0xa136('0x83')],'as':'List','include':[{'model':db[_0xa136('0x75')],'as':'Contacts','where':_0x1ad7ea,'limit':0x1,'order':[[_0xa136('0x7a'),_0xa136('0x84')]]}]},{'model':db[_0xa136('0x85')],'as':_0xa136('0x86')}]});})[_0xa136('0x20')](handleEntityNotFound(_0x353044,null))[_0xa136('0x20')](function(_0x47d2ee){if(_0x47d2ee&&_0x47d2ee[_0xa136('0x87')]){_0x3f92a7[_0xa136('0x88')]=_0x47d2ee;_0x3f92a7[_0xa136('0x89')]=_0x47d2ee['Applications'];_0x3f92a7['list']=_0x47d2ee[_0xa136('0x87')];_0x3f92a7[_0xa136('0x89')]=_[_0xa136('0x8a')](_0x3f92a7[_0xa136('0x89')],[_0xa136('0x8b')],[_0xa136('0x8c')]);if(_0x3f92a7[_0xa136('0x88')][_0xa136('0x86')]){delete _0x3f92a7['account'][_0xa136('0x86')];}if(_0x3f92a7[_0xa136('0x88')]['List']&&_0x3f92a7[_0xa136('0x88')][_0xa136('0x87')]['Contacts'][_0xa136('0x5a')]){return _0x3f92a7[_0xa136('0x88')][_0xa136('0x87')][_0xa136('0x8d')][0x0];}var _0x2bd20b=_[_0xa136('0x8e')](_0x355eda[_0xa136('0x5c')],{'firstName':_0x355eda[_0xa136('0x5c')][_0xa136('0x7c')],'ListId':_0x47d2ee['ListId']});_0x2bd20b[_0x355eda[_0xa136('0x5c')][_0xa136('0x81')]]=_0x355eda['body'][_0xa136('0x7c')];return db[_0xa136('0x75')]['create'](_0x2bd20b,{'fields':_0x5a2c77,'raw':!![]});}})['then'](handleEntityNotFound(_0x353044,null))[_0xa136('0x20')](function(_0x446a95){_0x3f92a7['contact']=_0x446a95;if(_0x446a95){var _0x5a0530={'ContactId':_0x446a95['id'],'OpenchannelAccountId':_0x355eda['params']['id'],'from':(_0x446a95[_0xa136('0x8f')]||'')+'\x20'+(_0x446a95[_0xa136('0x90')]||'')};var _0x1a6e11={'OpenchannelAccountId':_0x355eda[_0xa136('0x58')]['id'],'closed':![]};if(_0x355eda[_0xa136('0x5c')][_0xa136('0x91')]){_0x1a6e11['threadId']=_0x355eda[_0xa136('0x5c')]['threadId'];return db['OpenchannelInteraction'][_0xa136('0x64')]({'where':_0x1a6e11})[_0xa136('0x20')](function(_0x3afbc2){if(_0x3afbc2){return[_0x3afbc2,![]];}_0x5a0530[_0xa136('0x91')]=_0x355eda[_0xa136('0x5c')][_0xa136('0x91')];_0x5a0530['externalUrl']=_0x355eda[_0xa136('0x5c')][_0xa136('0x92')];return db[_0xa136('0x93')][_0xa136('0x5b')](_0x5a0530)[_0xa136('0x20')](function(_0x52f7c1){return[_0x52f7c1,!![]];});});}else{_0x1a6e11[_0xa136('0x91')]=null;}_0x1a6e11['ContactId']=_0x446a95['id'];return db[_0xa136('0x93')][_0xa136('0x64')]({'where':_0x1a6e11})[_0xa136('0x20')](function(_0x3a1694){if(_0x3a1694){return[_0x3a1694,![]];}return db[_0xa136('0x93')]['create'](_0x5a0530)[_0xa136('0x20')](function(_0x1bdb58){return[_0x1bdb58,!![]];});});}})[_0xa136('0x94')](function(_0x519c4e,_0x597ce1){if(_0x519c4e){_0x888f52=_0x597ce1;if(!_0x597ce1){var _0x1ed238={'from':(_0x3f92a7['contact'][_0xa136('0x8f')]||'')+'\x20'+(_0x3f92a7['contact'][_0xa136('0x90')]||'')};if(_0x355eda['body'][_0xa136('0x91')]&&_0x355eda[_0xa136('0x5c')][_0xa136('0x95')]&&_0x355eda[_0xa136('0x5c')][_0xa136('0x91')]!=_0x355eda[_0xa136('0x5c')]['messageId']){_0x1ed238[_0xa136('0x91')]=_0x355eda['body']['messageId'];}return _0x519c4e['update'](_0x1ed238);}else{return _0x519c4e;}}})[_0xa136('0x20')](function(_0x46e1a0){_0x3f92a7['interaction']=_0x46e1a0[_0xa136('0x3a')]({'plain':!![]});_0x3f92a7[_0xa136('0x96')]['created']=_0x888f52;if(_0x3f92a7['interaction'][_0xa136('0x97')]){if(_0x3f92a7['account'][_0xa136('0x98')]){_0x3f92a7[_0xa136('0x89')][_0xa136('0x99')]({'id':0x0,'priority':_0x3f92a7[_0xa136('0x89')]['length']+0x1,'app':_0xa136('0x9a'),'appdata':_0xa136('0x9b'),'interval':_0xa136('0x9c')});}}return db[_0xa136('0x9d')][_0xa136('0x5b')]({'body':_0x355eda['body'][_0xa136('0x5c')],'OpenchannelAccountId':_0x355eda[_0xa136('0x58')]['id'],'OpenchannelInteractionId':_0x46e1a0['id'],'direction':'in','ContactId':_0x3f92a7['contact']['id'],'AttachmentId':_0x355eda['body'][_0xa136('0x9e')]});})['then'](function(_0x37bdea){_0x3f92a7[_0xa136('0x28')]=_0x37bdea;if(_0x3f92a7[_0xa136('0x96')][_0xa136('0x9f')]){return db[_0xa136('0xa0')]['find']({'attributes':['id',_0xa136('0x46')],'where':{'id':_0x3f92a7[_0xa136('0x96')][_0xa136('0x9f')]}})[_0xa136('0x20')](function(_0x5304d7){if(_0x5304d7){_0x3f92a7[_0xa136('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0xa136('0xa1'),'appdata':_0x5304d7[_0xa136('0x46')]+','+(_0x3f92a7[_0xa136('0x88')][_0xa136('0xa2')]||0xa),'interval':'*,*,*,*'});_0x3f92a7[_0xa136('0xa3')]=![];}return respondWithRpcPromise(_0xa136('0xa4'),'startRouting',_0x3f92a7);});}return respondWithRpcPromise(_0xa136('0xa4'),_0xa136('0xa5'),_0x3f92a7);})[_0xa136('0x20')](function(_0x4465a9){respondWithRpcPromise(_0xa136('0xa6'),'EventManager',{'event':_0xa136('0x73'),'message':_0x4465a9},client9002);return _0x4465a9;})[_0xa136('0x20')](respondWithResult(_0x353044,null))[_0xa136('0x2b')](handleError(_0x353044,null));};exports[_0xa136('0xa7')]=function(_0x2b0a2d,_0x41f5df,_0x154d4e){return db[_0xa136('0x41')]['findOne']({'where':{'id':_0x2b0a2d[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x41f5df,null))['then'](function(_0x1d7e05){if(_0x1d7e05){return db[_0xa136('0xa8')]['transaction'](function(_0x2bccac){return db[_0xa136('0x85')][_0xa136('0x39')]({'where':{'OpenchannelAccountId':_0x2b0a2d[_0xa136('0x58')]['id']},'transaction':_0x2bccac})[_0xa136('0x20')](function(_0x1106b1){var _0x202ad2=_[_0xa136('0x40')](_0x2b0a2d[_0xa136('0x5c')],function(_0x416386){_0x416386[_0xa136('0x67')]=_0x2b0a2d['params']['id'];return _0x416386;});return db[_0xa136('0x85')]['bulkCreate'](_0x202ad2,{'transaction':_0x2bccac});});})[_0xa136('0x20')](function(){return db['OpenchannelApplication'][_0xa136('0xa9')]({'where':{'OpenchannelAccountId':_0x2b0a2d[_0xa136('0x58')]['id']},'order':_0xa136('0x8b')});});}})['then'](respondWithResult(_0x41f5df,null))[_0xa136('0x2b')](handleError(_0x41f5df,null));};exports[_0xa136('0xaa')]=function(_0x5ed36a,_0x153ce2,_0x11b559){var _0x56ed02={};var _0x53a92d={};var _0x3f8c73;var _0x358452;return db[_0xa136('0x41')][_0xa136('0x69')]({'where':{'id':_0x5ed36a['params']['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x153ce2,null))[_0xa136('0x20')](function(_0xd15c5f){if(_0xd15c5f){_0x3f8c73=_0xd15c5f;_0x53a92d['model']=_[_0xa136('0x47')](db[_0xa136('0x85')][_0xa136('0x42')]);_0x53a92d[_0xa136('0x48')]=_[_0xa136('0x47')](_0x5ed36a[_0xa136('0x48')]);_0x53a92d[_0xa136('0x49')]=_[_0xa136('0x4a')](_0x53a92d[_0xa136('0x45')],_0x53a92d['query']);_0x56ed02[_0xa136('0x4b')]=_[_0xa136('0x4a')](_0x53a92d[_0xa136('0x45')],qs['fields'](_0x5ed36a['query'][_0xa136('0x59')]));_0x56ed02[_0xa136('0x4b')]=_0x56ed02[_0xa136('0x4b')][_0xa136('0x5a')]?_0x56ed02[_0xa136('0x4b')]:_0x53a92d[_0xa136('0x45')];_0x56ed02[_0xa136('0x4d')]=qs[_0xa136('0x4e')](_0x5ed36a[_0xa136('0x48')][_0xa136('0x4e')]);_0x56ed02[_0xa136('0x4f')]=qs[_0xa136('0x49')](_[_0xa136('0x50')](_0x5ed36a[_0xa136('0x48')],_0x53a92d[_0xa136('0x49')]));if(_0x5ed36a[_0xa136('0x48')]['filter']){_0x56ed02[_0xa136('0x4f')]=_[_0xa136('0x51')](_0x56ed02['where'],{'$or':_[_0xa136('0x40')](_0x56ed02[_0xa136('0x4b')],function(_0x522abb){var _0x458ab3={};_0x458ab3[_0x522abb]={'$like':'%'+_0x5ed36a[_0xa136('0x48')][_0xa136('0x53')]+'%'};return _0x458ab3;})});}_0x56ed02=_['merge']({},_0x56ed02,_0x5ed36a[_0xa136('0x54')]);return _0x3f8c73['getApplications'](_0x56ed02);}})['then'](function(_0x4eb7e7){if(_0x4eb7e7){_0x358452=_0x4eb7e7[_0xa136('0x5a')];if(!_0x5ed36a[_0xa136('0x48')][_0xa136('0x6b')]('nolimit')){_0x56ed02[_0xa136('0x31')]=qs['limit'](_0x5ed36a[_0xa136('0x48')][_0xa136('0x31')]);_0x56ed02['offset']=qs[_0xa136('0x2f')](_0x5ed36a['query']['offset']);}return _0x3f8c73['getApplications'](_0x56ed02);}})[_0xa136('0x20')](function(_0x2d2f4c){if(_0x2d2f4c){return _0x2d2f4c?{'count':_0x358452,'rows':_0x2d2f4c}:null;}})[_0xa136('0x20')](respondWithResult(_0x153ce2,null))[_0xa136('0x2b')](handleError(_0x153ce2,null));};exports[_0xa136('0xab')]=function(_0xf9eab3,_0x4cf123,_0x22bbd6){var _0x1b5da9={'raw':![],'where':{}};var _0x48cea6={};var _0x34c4da={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa136('0x69')]({'where':{'id':_0xf9eab3[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x4cf123,null))[_0xa136('0x20')](function(_0x8df1f3){if(_0x8df1f3){_0x48cea6[_0xa136('0x45')]=_[_0xa136('0x47')](db[_0xa136('0x93')]['rawAttributes']);_0x48cea6[_0xa136('0x48')]=_[_0xa136('0x47')](_0xf9eab3['query']);_0x48cea6['filters']=_[_0xa136('0x4a')](_0x48cea6[_0xa136('0x45')],_0x48cea6[_0xa136('0x48')]);_0x1b5da9[_0xa136('0x4b')]=_[_0xa136('0x4a')](_0x48cea6[_0xa136('0x45')],qs['fields'](_0xf9eab3[_0xa136('0x48')][_0xa136('0x59')]));_0x1b5da9[_0xa136('0x4b')]=_0x1b5da9[_0xa136('0x4b')][_0xa136('0x5a')]?_0x1b5da9['attributes']:_0x48cea6['model'];if(!_0xf9eab3[_0xa136('0x48')][_0xa136('0x6b')](_0xa136('0x4c'))){_0x1b5da9[_0xa136('0x31')]=qs['limit'](_0xf9eab3[_0xa136('0x48')][_0xa136('0x31')]);_0x1b5da9[_0xa136('0x2f')]=qs[_0xa136('0x2f')](_0xf9eab3['query']['offset']);}_0x1b5da9['order']=qs[_0xa136('0x4e')](_0xf9eab3['query'][_0xa136('0x4e')]);_0x1b5da9[_0xa136('0x4f')]=qs[_0xa136('0x49')](_[_0xa136('0x50')](_0xf9eab3[_0xa136('0x48')],_0x48cea6[_0xa136('0x49')]));_0x1b5da9[_0xa136('0x4f')][_0xa136('0x67')]=_0x8df1f3['id'];if(_0xf9eab3['query']['filter']){_0x1b5da9[_0xa136('0x4f')]=_['merge'](_0x1b5da9['where'],{'$or':_['map'](_0x1b5da9[_0xa136('0x4b')],function(_0x43ccc4){var _0x1972ee={};_0x1972ee[_0x43ccc4]={'$like':'%'+_0xf9eab3[_0xa136('0x48')]['filter']+'%'};return _0x1972ee;})});}_0x1b5da9=_['merge']({},_0x1b5da9,_0xf9eab3[_0xa136('0x54')]);return db[_0xa136('0x93')]['count']({'where':_0x1b5da9[_0xa136('0x4f')]})[_0xa136('0x20')](function(_0x555c31){_0x34c4da[_0xa136('0x32')]=_0x555c31;if(_0xf9eab3['query'][_0xa136('0x55')]){_0x1b5da9[_0xa136('0x56')]=[{'model':db[_0xa136('0x75')],'as':'Contact','required':![]},{'model':db[_0xa136('0xa0')],'as':_0xa136('0xac'),'attributes':[_0xa136('0x46'),_0xa136('0xad'),_0xa136('0xae')],'required':![]},{'model':db[_0xa136('0xaf')],'as':_0xa136('0xb0'),'attributes':['id',_0xa136('0x46'),_0xa136('0xb1')],'where':_0xf9eab3[_0xa136('0x48')][_0xa136('0xb2')]?{'id':_0xf9eab3[_0xa136('0x48')][_0xa136('0xb2')]}:undefined,'required':_0xf9eab3[_0xa136('0x48')][_0xa136('0xb2')]?!![]:![]}];}return db[_0xa136('0x93')][_0xa136('0x71')](_0x1b5da9);})[_0xa136('0x20')](function(_0xda4c89){_0x34c4da[_0xa136('0x6c')]=_0xda4c89;return _0x34c4da;});}})[_0xa136('0x20')](respondWithFilteredResult(_0x4cf123,_0x1b5da9))[_0xa136('0x2b')](handleError(_0x4cf123,null));};exports['addAgents']=function(_0x205c55,_0x4736db,_0x505393){return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x205c55[_0xa136('0x58')]['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x4736db,null))[_0xa136('0x20')](function(_0x3b2943){if(_0x3b2943){return _0x3b2943['addAgents'](_0x205c55['body'][_0xa136('0x6e')],_[_0xa136('0xb3')](_0x205c55[_0xa136('0x5c')],[_0xa136('0x6e'),'id'])||{})[_0xa136('0x94')](function(_0x17c14b){for(var _0x569ac4=0x0;_0x569ac4<_0x205c55[_0xa136('0x5c')]['ids'][_0xa136('0x5a')];_0x569ac4+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x205c55['body'][_0xa136('0x6e')][_0x569ac4]),'OpenchannelAccountId':Number(_0x205c55[_0xa136('0x58')]['id'])});}return _0x17c14b;});}})['then'](respondWithResult(_0x4736db,null))[_0xa136('0x2b')](handleError(_0x4736db,null));};exports[_0xa136('0xb4')]=function(_0x341abf,_0x199849,_0xa3921f){return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x341abf['params']['id']}})[_0xa136('0x20')](handleEntityNotFound(_0x199849,null))['then'](function(_0x42e15f){if(_0x42e15f){return _0x42e15f[_0xa136('0xb4')](_0x341abf[_0xa136('0x48')][_0xa136('0x6e')])[_0xa136('0x20')](function(){if(_['isArray'](_0x341abf[_0xa136('0x48')][_0xa136('0x6e')])){for(var _0x5bb18e=0x0;_0x5bb18e<_0x341abf[_0xa136('0x48')]['ids'][_0xa136('0x5a')];_0x5bb18e+=0x1){socket[_0xa136('0xb5')](_0xa136('0xb6'),{'UserId':Number(_0x341abf[_0xa136('0x48')][_0xa136('0x6e')][_0x5bb18e]),'OpenchannelAccountId':Number(_0x341abf[_0xa136('0x58')]['id'])});}}else{socket[_0xa136('0xb5')](_0xa136('0xb6'),{'UserId':Number(_0x341abf['query'][_0xa136('0x6e')]),'OpenchannelAccountId':Number(_0x341abf[_0xa136('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x199849,null))[_0xa136('0x2b')](handleError(_0x199849,null));};exports['getAgents']=function(_0x28bb47,_0x5bfc31,_0x36df4e){var _0x57b14b={};var _0x4598d9={};var _0x5f5b11;var _0x50fc1b;return db[_0xa136('0x41')][_0xa136('0x69')]({'where':{'id':_0x28bb47[_0xa136('0x58')]['id']}})['then'](handleEntityNotFound(_0x5bfc31,null))[_0xa136('0x20')](function(_0x3005b7){if(_0x3005b7){_0x5f5b11=_0x3005b7;_0x4598d9['model']=_[_0xa136('0x47')](db[_0xa136('0xa0')][_0xa136('0x42')]);_0x4598d9['query']=_[_0xa136('0x47')](_0x28bb47[_0xa136('0x48')]);_0x4598d9[_0xa136('0x49')]=_[_0xa136('0x4a')](_0x4598d9[_0xa136('0x45')],_0x4598d9[_0xa136('0x48')]);_0x57b14b['attributes']=_[_0xa136('0x4a')](_0x4598d9[_0xa136('0x45')],qs[_0xa136('0x59')](_0x28bb47[_0xa136('0x48')][_0xa136('0x59')]));_0x57b14b[_0xa136('0x4b')]=_0x57b14b[_0xa136('0x4b')]['length']?_0x57b14b[_0xa136('0x4b')]:_0x4598d9[_0xa136('0x45')];_0x57b14b['order']=qs[_0xa136('0x4e')](_0x28bb47['query']['sort']);_0x57b14b[_0xa136('0x4f')]=qs[_0xa136('0x49')](_[_0xa136('0x50')](_0x28bb47['query'],_0x4598d9[_0xa136('0x49')]));if(_0x28bb47[_0xa136('0x48')]['filter']){_0x57b14b[_0xa136('0x4f')]=_['merge'](_0x57b14b['where'],{'$or':_['map'](_0x57b14b[_0xa136('0x4b')],function(_0x5983d1){var _0x36a382={};_0x36a382[_0x5983d1]={'$like':'%'+_0x28bb47[_0xa136('0x48')][_0xa136('0x53')]+'%'};return _0x36a382;})});}_0x57b14b=_[_0xa136('0x51')]({},_0x57b14b,_0x28bb47[_0xa136('0x54')]);return _0x5f5b11[_0xa136('0xb7')](_0x57b14b);}})['then'](function(_0x346db3){if(_0x346db3){_0x50fc1b=_0x346db3[_0xa136('0x5a')];if(!_0x28bb47[_0xa136('0x48')][_0xa136('0x6b')](_0xa136('0x4c'))){_0x57b14b['limit']=qs[_0xa136('0x31')](_0x28bb47[_0xa136('0x48')][_0xa136('0x31')]);_0x57b14b['offset']=qs[_0xa136('0x2f')](_0x28bb47[_0xa136('0x48')][_0xa136('0x2f')]);}return _0x5f5b11[_0xa136('0xb7')](_0x57b14b);}})[_0xa136('0x20')](function(_0x2fe68d){if(_0x2fe68d){return _0x2fe68d?{'count':_0x50fc1b,'rows':_0x2fe68d}:null;}})[_0xa136('0x20')](respondWithResult(_0x5bfc31,null))[_0xa136('0x2b')](handleError(_0x5bfc31,null));};exports[_0xa136('0x3c')]=function(_0x471892,_0x488961,_0x40e947){var _0x503e75,_0x53e675,_0x2831ed;if(_[_0xa136('0x7e')](_0x471892[_0xa136('0x5c')][_0xa136('0x5c')])||_0x471892[_0xa136('0x5c')]['body']===''){throw new db[(_0xa136('0x7f'))]['ValidationError'](_0xa136('0x80'));}if(_[_0xa136('0x7e')](_0x471892[_0xa136('0x5c')]['to'])){}_0x503e75=_0x471892[_0xa136('0x5c')]['to'];return db[_0xa136('0x41')]['findOne']({'where':{'id':_0x471892[_0xa136('0x58')]['id']}})['then'](handleEntityNotFound(_0x488961,null))[_0xa136('0x20')](function(_0x25178){if(_0x25178){return db[_0xa136('0x41')][_0xa136('0x64')]({'where':{'id':_0x25178['id']},'include':[{'model':db[_0xa136('0x83')],'as':_0xa136('0x87'),'include':[{'model':db[_0xa136('0x75')],'as':_0xa136('0x8d'),'where':{[_0x25178[_0xa136('0x81')]]:_0x503e75},'limit':0x1,'order':[[_0xa136('0x7a'),'DESC']]}]}]})[_0xa136('0x20')](handleEntityNotFound(_0x488961,null))[_0xa136('0x20')](function(_0x11652c){if(_0x11652c&&_0x11652c[_0xa136('0x87')]){_0x53e675=_0x11652c[_0xa136('0x3a')]({'plain':!![]});if(_0x53e675[_0xa136('0x87')]&&_0x53e675[_0xa136('0x87')][_0xa136('0x8d')]['length']){return _0x53e675[_0xa136('0x87')][_0xa136('0x8d')][0x0];}return db['CmContact']['create'](_[_0xa136('0x8e')](_0x471892[_0xa136('0x5c')],{'firstName':_0x503e75,[_0x11652c['mapKey']]:_0x503e75,'phone':_0x503e75,'ListId':_0x53e675[_0xa136('0x7b')]}));}})[_0xa136('0x20')](handleEntityNotFound(_0x488961,null))['then'](function(_0x2a9ef3){if(_0x2a9ef3){_0x2831ed=_0x2a9ef3;return db[_0xa136('0x93')][_0xa136('0x64')]({'where':{'ContactId':_0x2831ed['id'],'closed':![],'OpenchannelAccountId':_0x53e675['id']}})[_0xa136('0x20')](function(_0x5aa9f6){if(_0x5aa9f6){return[_0x5aa9f6,![]];}return db[_0xa136('0x93')][_0xa136('0x5b')]({'UserId':_0x471892[_0xa136('0x5f')]['id'],'ContactId':_0x2831ed['id'],'OpenchannelAccountId':_0x53e675['id'],'lastMsgDirection':_0xa136('0xb8'),'Messages':[_[_0xa136('0x51')](_0x471892[_0xa136('0x5c')],{'read':![],'body':_0x471892['body'][_0xa136('0x5c')],'OpenchannelAccountId':_0x53e675['id'],'UserId':_0x471892[_0xa136('0x5f')]['id'],'ContactId':_0x2831ed['id']})]},{'include':[{'model':db[_0xa136('0x9d')],'as':_0xa136('0xb9')}]})[_0xa136('0x20')](function(_0x53eab0){return[_0x53eab0,!![]];});});}})['spread'](function(_0x59ec0e,_0x211426){if(_0x211426){return _0x59ec0e;}return db[_0xa136('0x9d')][_0xa136('0x5b')](_[_0xa136('0x51')](_0x471892[_0xa136('0x5c')],{'read':![],'body':_0x471892['body'][_0xa136('0x5c')],'OpenchannelAccountId':_0x53e675['id'],'OpenchannelInteractionId':_0x59ec0e['id'],'UserId':_0x471892[_0xa136('0x5f')]['id'],'ContactId':_0x2831ed['id']}))[_0xa136('0x20')](function(_0x2ae8bd){_0x59ec0e[_0xa136('0xba')]['Messages']=[];_0x59ec0e['dataValues'][_0xa136('0xb9')][_0xa136('0x99')](_0x2ae8bd['dataValues']);return _0x59ec0e;});});}})['then'](respondWithResult(_0x488961,null))[_0xa136('0x2b')](handleError(_0x488961,null));}; \ No newline at end of file +var _0x4ad0=['VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','OpenchannelAccounts','find','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','nolimit','order','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','Sequelize','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','Contacts','OpenchannelApplication','Applications','applications','list','orderBy','priority','asc','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','rawAttributes','Contact','Owner','internal','Tags','tag','addAgents','omit','spread','emit','removeAgents','userOpenchannelAccount:remove','getAgents','send','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','jayson/promise','client','http','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','save','update','destroy','get','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge'];(function(_0x551229,_0x5c98c5){var _0x41a38c=function(_0xa593e4){while(--_0xa593e4){_0x551229['push'](_0x551229['shift']());}};_0x41a38c(++_0x5c98c5);}(_0x4ad0,0x6b));var _0x04ad=function(_0x238524,_0x3d48ff){_0x238524=_0x238524-0x0;var _0x359655=_0x4ad0[_0x238524];return _0x359655;};'use strict';var emlformat=require(_0x04ad('0x0'));var rimraf=require(_0x04ad('0x1'));var zipdir=require(_0x04ad('0x2'));var jsonpatch=require(_0x04ad('0x3'));var rp=require(_0x04ad('0x4'));var moment=require(_0x04ad('0x5'));var BPromise=require(_0x04ad('0x6'));var Mustache=require(_0x04ad('0x7'));var util=require(_0x04ad('0x8'));var path=require(_0x04ad('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x04ad('0xa'));var _=require(_0x04ad('0xb'));var squel=require(_0x04ad('0xc'));var crypto=require(_0x04ad('0xd'));var jsforce=require(_0x04ad('0xe'));var deskjs=require(_0x04ad('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x04ad('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x04ad('0x11'));var as=require(_0x04ad('0x12'));var hardwareService=require(_0x04ad('0x13'));var logger=require('../../config/logger')(_0x04ad('0x14'));var utils=require('../../config/utils');var config=require(_0x04ad('0x15'));var licenseUtil=require(_0x04ad('0x16'));var db=require(_0x04ad('0x17'))['db'];config[_0x04ad('0x18')]=_[_0x04ad('0x19')](config[_0x04ad('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04ad('0x18')]));require(_0x04ad('0x1a'))[_0x04ad('0x1b')](socket);var jayson=require(_0x04ad('0x1c'));var client=jayson[_0x04ad('0x1d')][_0x04ad('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x04ad('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x285dba,_0x2d415c,_0x1595b6,_0x20952e){return new BPromise(function(_0x2f4639,_0x2e247a){var _0x32177d=_0x20952e||client;return _0x32177d['request'](_0x285dba,_0x1595b6)[_0x04ad('0x1f')](function(_0x55a3f2){logger['info'](_0x04ad('0x20'),_0x2d415c,_0x04ad('0x21'));logger[_0x04ad('0x22')](_0x04ad('0x23'),_0x2d415c,_0x04ad('0x21'),JSON[_0x04ad('0x24')](_0x55a3f2));if(_0x55a3f2[_0x04ad('0x25')]){if(_0x55a3f2[_0x04ad('0x25')][_0x04ad('0x26')]===0x1f4){logger[_0x04ad('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x2d415c,_0x55a3f2[_0x04ad('0x25')]['message']);return _0x2e247a(_0x55a3f2[_0x04ad('0x25')]['message']);}logger['error'](_0x04ad('0x20'),_0x2d415c,_0x55a3f2[_0x04ad('0x25')]['message']);return _0x2f4639(_0x55a3f2[_0x04ad('0x25')][_0x04ad('0x27')]);}else{logger[_0x04ad('0x28')](_0x04ad('0x20'),_0x2d415c,'request\x20sent');_0x2f4639(_0x55a3f2[_0x04ad('0x29')][_0x04ad('0x27')]);}})[_0x04ad('0x2a')](function(_0x26ac62){logger[_0x04ad('0x25')](_0x04ad('0x20'),_0x2d415c,_0x26ac62);_0x2e247a(_0x26ac62);});});}function respondWithStatusCode(_0x10127a,_0x4e541e){_0x4e541e=_0x4e541e||0xcc;return function(_0x1e3158){if(_0x1e3158){return _0x10127a[_0x04ad('0x2b')](_0x4e541e);}return _0x10127a[_0x04ad('0x2c')](_0x4e541e)[_0x04ad('0x2d')]();};}function respondWithResult(_0x29cd59,_0x12c0ba){_0x12c0ba=_0x12c0ba||0xc8;return function(_0x57bf73){if(_0x57bf73){return _0x29cd59[_0x04ad('0x2c')](_0x12c0ba)['json'](_0x57bf73);}};}function respondWithFilteredResult(_0x16bcc7,_0x5567fc){return function(_0x3a3d3e){if(_0x3a3d3e){var _0x5ac89a=typeof _0x5567fc[_0x04ad('0x2e')]===_0x04ad('0x2f')&&typeof _0x5567fc['limit']===_0x04ad('0x2f');var _0x5b6c08=_0x3a3d3e['count'];var _0x581667=_0x5ac89a?0x0:_0x5567fc[_0x04ad('0x2e')];var _0x23c188=_0x5ac89a?_0x3a3d3e[_0x04ad('0x30')]:_0x5567fc['offset']+_0x5567fc[_0x04ad('0x31')];var _0x211880;if(_0x23c188>=_0x5b6c08){_0x23c188=_0x5b6c08;_0x211880=0xc8;}else{_0x211880=0xce;}_0x16bcc7['status'](_0x211880);return _0x16bcc7['set'](_0x04ad('0x32'),_0x581667+'-'+_0x23c188+'/'+_0x5b6c08)[_0x04ad('0x33')](_0x3a3d3e);}return null;};}function patchUpdates(_0x55ab69){return function(_0x3add1f){try{jsonpatch[_0x04ad('0x34')](_0x3add1f,_0x55ab69,!![]);}catch(_0x57b05b){return BPromise['reject'](_0x57b05b);}return _0x3add1f[_0x04ad('0x35')]();};}function saveUpdates(_0x39b1a2,_0x247e96){return function(_0x2b6a3c){if(_0x2b6a3c){return _0x2b6a3c[_0x04ad('0x36')](_0x39b1a2)[_0x04ad('0x1f')](function(_0x36dc3b){return _0x36dc3b;});}return null;};}function removeEntity(_0x473225,_0x332a7b){return function(_0x1076c5){if(_0x1076c5){return _0x1076c5[_0x04ad('0x37')]()[_0x04ad('0x1f')](function(){var _0x1a71ee=_0x1076c5[_0x04ad('0x38')]({'plain':!![]});var _0x4ca247='OpenchannelAccounts';return db[_0x04ad('0x39')][_0x04ad('0x37')]({'where':{'type':_0x4ca247,'resourceId':_0x1a71ee['id']}})[_0x04ad('0x1f')](function(){return _0x1076c5;});})[_0x04ad('0x1f')](function(){_0x473225[_0x04ad('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe7d1cf,_0x27a44e){return function(_0x3df0e7){if(!_0x3df0e7){_0xe7d1cf[_0x04ad('0x2b')](0x194);}return _0x3df0e7;};}function handleError(_0x283883,_0x29ae6d){_0x29ae6d=_0x29ae6d||0x1f4;return function(_0x150bd1){logger[_0x04ad('0x25')](_0x150bd1[_0x04ad('0x3a')]);if(_0x150bd1[_0x04ad('0x3b')]){delete _0x150bd1['name'];}_0x283883[_0x04ad('0x2c')](_0x29ae6d)['send'](_0x150bd1);};}exports[_0x04ad('0x3c')]=function(_0x4b07c5,_0x54ffcc){var _0x5e563c={'include':[{'model':db[_0x04ad('0x3d')],'as':_0x04ad('0x3e')}]},_0x54bfb3={},_0x5bfd01={'count':0x0,'rows':[]};var _0x269447=_['map'](db[_0x04ad('0x3f')]['rawAttributes'],function(_0x2ea3b6){return{'name':_0x2ea3b6[_0x04ad('0x40')],'type':_0x2ea3b6['type'][_0x04ad('0x41')]};});_0x54bfb3[_0x04ad('0x42')]=_[_0x04ad('0x43')](_0x269447,_0x04ad('0x3b'));_0x54bfb3[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x4b07c5[_0x04ad('0x44')]);_0x54bfb3[_0x04ad('0x46')]=_[_0x04ad('0x47')](_0x54bfb3[_0x04ad('0x42')],_0x54bfb3[_0x04ad('0x44')]);_0x5e563c[_0x04ad('0x48')]=_[_0x04ad('0x47')](_0x54bfb3[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x49')]));_0x5e563c['attributes']=_0x5e563c[_0x04ad('0x48')]['length']?_0x5e563c['attributes']:_0x54bfb3[_0x04ad('0x42')];if(!_0x4b07c5['query'][_0x04ad('0x4a')]('nolimit')){_0x5e563c[_0x04ad('0x31')]=qs['limit'](_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x31')]);_0x5e563c[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x4b07c5['query'][_0x04ad('0x2e')]);}_0x5e563c['order']=qs[_0x04ad('0x4b')](_0x4b07c5['query'][_0x04ad('0x4b')]);_0x5e563c[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x4b07c5[_0x04ad('0x44')],_0x54bfb3[_0x04ad('0x46')]),_0x269447);if(_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x5e563c[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x5e563c[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x269447,function(_0xe2b6aa){if(_0xe2b6aa['type']!==_0x04ad('0x50')){var _0x25a270={};_0x25a270[_0xe2b6aa[_0x04ad('0x3b')]]={'$like':'%'+_0x4b07c5['query'][_0x04ad('0x4e')]+'%'};return _0x25a270;}})});}_0x5e563c=_[_0x04ad('0x4f')]({},_0x5e563c,_0x4b07c5['options']);var _0x358e28={'where':_0x5e563c['where']};return db[_0x04ad('0x3f')][_0x04ad('0x30')](_0x358e28)[_0x04ad('0x1f')](function(_0x4ba66b){_0x5bfd01['count']=_0x4ba66b;if(_0x4b07c5[_0x04ad('0x44')][_0x04ad('0x51')]){_0x5e563c[_0x04ad('0x52')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x04ad('0x53')](_0x5e563c);})[_0x04ad('0x1f')](function(_0x362b64){_0x5bfd01[_0x04ad('0x54')]=_0x362b64;return _0x5bfd01;})[_0x04ad('0x1f')](respondWithFilteredResult(_0x54ffcc,_0x5e563c))[_0x04ad('0x2a')](handleError(_0x54ffcc,null));};exports[_0x04ad('0x55')]=function(_0x1d5385,_0x22ab12){var _0x5f11cd={'raw':![],'where':{'id':_0x1d5385[_0x04ad('0x56')]['id']},'include':[{'model':db[_0x04ad('0x3d')],'as':_0x04ad('0x3e')}]},_0x2ba7a2={};_0x2ba7a2[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x3f')]['rawAttributes']);_0x2ba7a2['query']=_[_0x04ad('0x45')](_0x1d5385[_0x04ad('0x44')]);_0x2ba7a2['filters']=_[_0x04ad('0x47')](_0x2ba7a2['model'],_0x2ba7a2[_0x04ad('0x44')]);_0x5f11cd['attributes']=_[_0x04ad('0x47')](_0x2ba7a2[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x1d5385[_0x04ad('0x44')]['fields']));_0x5f11cd[_0x04ad('0x48')]=_0x5f11cd['attributes'][_0x04ad('0x57')]?_0x5f11cd['attributes']:_0x2ba7a2[_0x04ad('0x42')];if(_0x1d5385[_0x04ad('0x44')]['includeAll']){_0x5f11cd[_0x04ad('0x52')]=[{'all':!![]}];}_0x5f11cd=_[_0x04ad('0x4f')]({},_0x5f11cd,_0x1d5385[_0x04ad('0x58')]);return db[_0x04ad('0x3f')]['find'](_0x5f11cd)[_0x04ad('0x1f')](handleEntityNotFound(_0x22ab12,null))['then'](respondWithResult(_0x22ab12,null))[_0x04ad('0x2a')](handleError(_0x22ab12,null));};exports[_0x04ad('0x59')]=function(_0x499229,_0x251978){return db['OpenchannelAccount'][_0x04ad('0x59')](_0x499229[_0x04ad('0x5a')],{})[_0x04ad('0x1f')](function(_0x502c0f){var _0x5c6889=_0x499229['user']['get']({'plain':!![]});if(!_0x5c6889)throw new Error(_0x04ad('0x5b'));if(_0x5c6889['role']===_0x04ad('0x5c')){var _0x19caa6=_0x502c0f[_0x04ad('0x38')]({'plain':!![]});var _0x78fcaf=_0x04ad('0x5d');return db['UserProfileSection']['find']({'where':{'name':_0x78fcaf,'userProfileId':_0x5c6889['userProfileId']},'raw':!![]})[_0x04ad('0x1f')](function(_0x341a2){if(_0x341a2&&_0x341a2['autoAssociation']===0x0){return db[_0x04ad('0x39')][_0x04ad('0x59')]({'name':_0x19caa6[_0x04ad('0x3b')],'resourceId':_0x19caa6['id'],'type':_0x341a2[_0x04ad('0x3b')],'sectionId':_0x341a2['id']},{})[_0x04ad('0x1f')](function(){return _0x502c0f;});}else{return _0x502c0f;}})[_0x04ad('0x2a')](function(_0x4515e2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4515e2);throw _0x4515e2;});}return _0x502c0f;})['then'](respondWithResult(_0x251978,0xc9))[_0x04ad('0x2a')](handleError(_0x251978,null));};exports[_0x04ad('0x36')]=function(_0x1b2638,_0x5cef4a){if(_0x1b2638[_0x04ad('0x5a')]['id']){delete _0x1b2638[_0x04ad('0x5a')]['id'];}return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x1b2638[_0x04ad('0x56')]['id']},'include':[{'model':db[_0x04ad('0x3d')],'as':_0x04ad('0x3e')}]})[_0x04ad('0x1f')](handleEntityNotFound(_0x5cef4a,null))[_0x04ad('0x1f')](saveUpdates(_0x1b2638[_0x04ad('0x5a')],null))[_0x04ad('0x1f')](respondWithResult(_0x5cef4a,null))[_0x04ad('0x2a')](handleError(_0x5cef4a,null));};exports[_0x04ad('0x37')]=function(_0x4e50a8,_0x4d4b47){return db['OpenchannelAccount']['find']({'where':{'id':_0x4e50a8[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x4d4b47,null))[_0x04ad('0x1f')](removeEntity(_0x4d4b47,null))[_0x04ad('0x2a')](handleError(_0x4d4b47,null));};exports[_0x04ad('0x5f')]=function(_0x417fb5,_0x420b35){return db['OpenchannelAccount']['describe']()[_0x04ad('0x1f')](respondWithResult(_0x420b35,null))[_0x04ad('0x2a')](handleError(_0x420b35,null));};exports[_0x04ad('0x60')]=function(_0x36c084,_0x35fd7f,_0x3197d8){if(_0x36c084[_0x04ad('0x5a')]['id']){delete _0x36c084[_0x04ad('0x5a')]['id'];}return db['OpenchannelAccount'][_0x04ad('0x5e')]({'where':{'id':_0x36c084[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x35fd7f,null))[_0x04ad('0x1f')](function(_0xd4c9d3){if(_0xd4c9d3){_0x36c084[_0x04ad('0x5a')][_0x04ad('0x61')]=_0xd4c9d3['id'];return db[_0x04ad('0x62')][_0x04ad('0x59')](_0x36c084[_0x04ad('0x5a')]);}})['then'](respondWithResult(_0x35fd7f,null))[_0x04ad('0x2a')](handleError(_0x35fd7f,null));};exports[_0x04ad('0x63')]=function(_0x564fd5,_0x118c4d,_0x4ec013){var _0x9f1c83={'raw':![],'where':{}};var _0x59ab93={};var _0x4f3cc3={'count':0x0,'rows':[]};return db[_0x04ad('0x3f')][_0x04ad('0x64')]({'where':{'id':_0x564fd5[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x118c4d,null))['then'](function(_0xd81526){if(_0xd81526){_0x59ab93['model']=_[_0x04ad('0x45')](db[_0x04ad('0x62')]['rawAttributes']);_0x59ab93['query']=_[_0x04ad('0x45')](_0x564fd5[_0x04ad('0x44')]);_0x59ab93[_0x04ad('0x46')]=_[_0x04ad('0x47')](_0x59ab93[_0x04ad('0x42')],_0x59ab93[_0x04ad('0x44')]);_0x9f1c83[_0x04ad('0x48')]=_[_0x04ad('0x47')](_0x59ab93[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x564fd5[_0x04ad('0x44')][_0x04ad('0x49')]));_0x9f1c83[_0x04ad('0x48')]=_0x9f1c83['attributes']['length']?_0x9f1c83[_0x04ad('0x48')]:_0x59ab93[_0x04ad('0x42')];if(!_0x564fd5[_0x04ad('0x44')]['hasOwnProperty'](_0x04ad('0x65'))){_0x9f1c83[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x564fd5['query'][_0x04ad('0x31')]);_0x9f1c83['offset']=qs[_0x04ad('0x2e')](_0x564fd5['query'][_0x04ad('0x2e')]);}_0x9f1c83[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x564fd5[_0x04ad('0x44')]['sort']);_0x9f1c83[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x564fd5[_0x04ad('0x44')],_0x59ab93['filters']));_0x9f1c83[_0x04ad('0x4c')]['OpenchannelAccountId']=_0xd81526['id'];if(_0x564fd5[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x9f1c83[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x9f1c83[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x9f1c83[_0x04ad('0x48')],function(_0x179bd6){var _0x8bf79b={};_0x8bf79b[_0x179bd6]={'$like':'%'+_0x564fd5['query'][_0x04ad('0x4e')]+'%'};return _0x8bf79b;})});}_0x9f1c83=_[_0x04ad('0x4f')]({},_0x9f1c83,_0x564fd5[_0x04ad('0x58')]);return db[_0x04ad('0x62')][_0x04ad('0x30')]({'where':_0x9f1c83[_0x04ad('0x4c')]})['then'](function(_0x2ddef9){_0x4f3cc3[_0x04ad('0x30')]=_0x2ddef9;if(_0x564fd5['query'][_0x04ad('0x51')]){_0x9f1c83['include']=[{'all':!![]}];}return db['Disposition'][_0x04ad('0x53')](_0x9f1c83);})[_0x04ad('0x1f')](function(_0x4fa101){_0x4f3cc3[_0x04ad('0x54')]=_0x4fa101;return _0x4f3cc3;});}})[_0x04ad('0x1f')](respondWithFilteredResult(_0x118c4d,_0x9f1c83))[_0x04ad('0x2a')](handleError(_0x118c4d,null));};exports['removeDispositions']=function(_0x3335b8,_0x38cdb2,_0x14777c){return db['OpenchannelAccount'][_0x04ad('0x5e')]({'where':{'id':_0x3335b8[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x38cdb2,null))['then'](function(_0x422dde){if(_0x422dde){return _0x422dde[_0x04ad('0x67')](_0x3335b8[_0x04ad('0x44')]['ids']);}})[_0x04ad('0x1f')](respondWithStatusCode(_0x38cdb2,null))['catch'](handleError(_0x38cdb2,null));};exports[_0x04ad('0x68')]=function(_0x2fab13,_0x2cd2a4,_0xfb8c20){if(_0x2fab13['body']['id']){delete _0x2fab13[_0x04ad('0x5a')]['id'];}return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x2fab13['params']['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x2cd2a4,null))['then'](function(_0x3ed4d5){if(_0x3ed4d5){_0x2fab13[_0x04ad('0x5a')][_0x04ad('0x61')]=_0x3ed4d5['id'];return db[_0x04ad('0x69')][_0x04ad('0x59')](_0x2fab13[_0x04ad('0x5a')]);}})[_0x04ad('0x1f')](respondWithResult(_0x2cd2a4,null))[_0x04ad('0x2a')](handleError(_0x2cd2a4,null));};exports[_0x04ad('0x6a')]=function(_0x5b1af4,_0x14ce94,_0x6a8c9d){var _0x1ef243={'raw':![],'where':{}};var _0x56f1e2={};var _0x195865={'count':0x0,'rows':[]};return db[_0x04ad('0x3f')][_0x04ad('0x64')]({'where':{'id':_0x5b1af4[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x14ce94,null))['then'](function(_0x32654f){if(_0x32654f){_0x56f1e2[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x69')]['rawAttributes']);_0x56f1e2[_0x04ad('0x44')]=_['keys'](_0x5b1af4[_0x04ad('0x44')]);_0x56f1e2['filters']=_['intersection'](_0x56f1e2[_0x04ad('0x42')],_0x56f1e2['query']);_0x1ef243[_0x04ad('0x48')]=_[_0x04ad('0x47')](_0x56f1e2['model'],qs[_0x04ad('0x49')](_0x5b1af4['query']['fields']));_0x1ef243['attributes']=_0x1ef243[_0x04ad('0x48')][_0x04ad('0x57')]?_0x1ef243[_0x04ad('0x48')]:_0x56f1e2['model'];if(!_0x5b1af4['query'][_0x04ad('0x4a')](_0x04ad('0x65'))){_0x1ef243[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x31')]);_0x1ef243[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x2e')]);}_0x1ef243['order']=qs[_0x04ad('0x4b')](_0x5b1af4['query'][_0x04ad('0x4b')]);_0x1ef243[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x5b1af4[_0x04ad('0x44')],_0x56f1e2[_0x04ad('0x46')]));_0x1ef243[_0x04ad('0x4c')]['OpenchannelAccountId']=_0x32654f['id'];if(_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x1ef243['where']=_[_0x04ad('0x4f')](_0x1ef243[_0x04ad('0x4c')],{'$or':_['map'](_0x1ef243[_0x04ad('0x48')],function(_0x1e6287){var _0x260d14={};_0x260d14[_0x1e6287]={'$like':'%'+_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x4e')]+'%'};return _0x260d14;})});}_0x1ef243=_[_0x04ad('0x4f')]({},_0x1ef243,_0x5b1af4[_0x04ad('0x58')]);return db[_0x04ad('0x69')]['count']({'where':_0x1ef243[_0x04ad('0x4c')]})['then'](function(_0x406a09){_0x195865['count']=_0x406a09;if(_0x5b1af4[_0x04ad('0x44')][_0x04ad('0x51')]){_0x1ef243[_0x04ad('0x52')]=[{'all':!![]}];}return db[_0x04ad('0x69')]['findAll'](_0x1ef243);})['then'](function(_0x162e33){_0x195865[_0x04ad('0x54')]=_0x162e33;return _0x195865;});}})[_0x04ad('0x1f')](respondWithFilteredResult(_0x14ce94,_0x1ef243))['catch'](handleError(_0x14ce94,null));};exports[_0x04ad('0x6b')]=function(_0x24f5d0,_0x558f4f,_0x47ecbb){return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x24f5d0[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x558f4f,null))[_0x04ad('0x1f')](function(_0x2c2fd2){if(_0x2c2fd2){return _0x2c2fd2[_0x04ad('0x6b')](_0x24f5d0['query'][_0x04ad('0x6c')]);}})[_0x04ad('0x1f')](respondWithStatusCode(_0x558f4f,null))[_0x04ad('0x2a')](handleError(_0x558f4f,null));};exports[_0x04ad('0x6d')]=function(_0x7317e7,_0x10e251,_0x182cbf){var _0x2e8584={'body':_0x7317e7[_0x04ad('0x5a')],'channel':_0x04ad('0x6e')};var _0x471c7b=[];var _0x34dc84=[];var _0x4f032f={};var _0x53730d=![];return db['CmContact'][_0x04ad('0x5f')]()[_0x04ad('0x1f')](function(_0x313a5e){if(!_0x313a5e){throw new db['Sequelize'][(_0x04ad('0x6f'))](_0x04ad('0x70'));}_0x471c7b=_['difference'](_[_0x04ad('0x45')](_0x313a5e),[_0x04ad('0x71'),_0x04ad('0x72')]);_0x34dc84=_[_0x04ad('0x73')](_[_0x04ad('0x45')](_0x313a5e),['createdAt','updatedAt',_0x04ad('0x74'),_0x04ad('0x75')]);if(_0x7317e7[_0x04ad('0x5a')]['id']){delete _0x7317e7[_0x04ad('0x5a')]['id'];}if(_[_0x04ad('0x76')](_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')])){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x79'));}if(_[_0x04ad('0x76')](_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x5a')])||_0x7317e7['body'][_0x04ad('0x5a')]===''){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x7a'));}if(_[_0x04ad('0x76')](_0x7317e7['body'][_0x04ad('0x7b')])){throw new db[(_0x04ad('0x78'))]['ValidationError'](_0x04ad('0x7c')+_0x34dc84);}if(!_['includes'](_0x34dc84,_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x7b')])){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x7d')+_0x34dc84);}_0x4f032f[_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x7b')]]=_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')];})[_0x04ad('0x1f')](function(){return db[_0x04ad('0x3f')]['find']({'where':{'id':_0x7317e7[_0x04ad('0x56')]['id']},'include':[{'model':db[_0x04ad('0x7e')],'as':_0x04ad('0x7f'),'include':[{'model':db[_0x04ad('0x80')],'as':_0x04ad('0x81'),'where':_0x4f032f,'limit':0x1,'order':[[_0x04ad('0x72'),'DESC']]}]},{'model':db[_0x04ad('0x82')],'as':_0x04ad('0x83')}]});})[_0x04ad('0x1f')](handleEntityNotFound(_0x10e251,null))[_0x04ad('0x1f')](function(_0x4efcb0){if(_0x4efcb0&&_0x4efcb0['List']){_0x2e8584['account']=_0x4efcb0;_0x2e8584[_0x04ad('0x84')]=_0x4efcb0['Applications'];_0x2e8584[_0x04ad('0x85')]=_0x4efcb0[_0x04ad('0x7f')];_0x2e8584[_0x04ad('0x84')]=_[_0x04ad('0x86')](_0x2e8584['applications'],[_0x04ad('0x87')],[_0x04ad('0x88')]);if(_0x2e8584[_0x04ad('0x89')]['Applications']){delete _0x2e8584[_0x04ad('0x89')][_0x04ad('0x83')];}if(_0x2e8584['account'][_0x04ad('0x7f')]&&_0x2e8584[_0x04ad('0x89')]['List'][_0x04ad('0x81')][_0x04ad('0x57')]){return _0x2e8584[_0x04ad('0x89')][_0x04ad('0x7f')][_0x04ad('0x81')][0x0];}var _0x1feaa4=_[_0x04ad('0x19')](_0x7317e7[_0x04ad('0x5a')],{'firstName':_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')],'ListId':_0x4efcb0[_0x04ad('0x75')]});_0x1feaa4[_0x7317e7['body'][_0x04ad('0x7b')]]=_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x77')];return db['CmContact'][_0x04ad('0x59')](_0x1feaa4,{'fields':_0x471c7b,'raw':!![]});}})[_0x04ad('0x1f')](handleEntityNotFound(_0x10e251,null))[_0x04ad('0x1f')](function(_0x585e92){_0x2e8584[_0x04ad('0x8a')]=_0x585e92;if(_0x585e92){var _0x1b2b36={'ContactId':_0x585e92['id'],'OpenchannelAccountId':_0x7317e7['params']['id'],'from':(_0x585e92[_0x04ad('0x8b')]||'')+'\x20'+(_0x585e92[_0x04ad('0x8c')]||'')};var _0xf52956={'OpenchannelAccountId':_0x7317e7[_0x04ad('0x56')]['id'],'closed':![]};if(_0x7317e7[_0x04ad('0x5a')]['threadId']){_0xf52956['threadId']=_0x7317e7['body'][_0x04ad('0x8d')];return db['OpenchannelInteraction'][_0x04ad('0x5e')]({'where':_0xf52956})[_0x04ad('0x1f')](function(_0x258e5b){if(_0x258e5b){return[_0x258e5b,![]];}_0x1b2b36[_0x04ad('0x8d')]=_0x7317e7['body']['threadId'];_0x1b2b36[_0x04ad('0x8e')]=_0x7317e7['body']['externalUrl'];return db[_0x04ad('0x8f')][_0x04ad('0x59')](_0x1b2b36)[_0x04ad('0x1f')](function(_0x36b93f){return[_0x36b93f,!![]];});});}else{_0xf52956[_0x04ad('0x8d')]=null;}_0xf52956['ContactId']=_0x585e92['id'];return db[_0x04ad('0x8f')][_0x04ad('0x5e')]({'where':_0xf52956})[_0x04ad('0x1f')](function(_0xdd0318){if(_0xdd0318){return[_0xdd0318,![]];}return db[_0x04ad('0x8f')][_0x04ad('0x59')](_0x1b2b36)[_0x04ad('0x1f')](function(_0x549610){return[_0x549610,!![]];});});}})['spread'](function(_0x5bb709,_0x4ffc27){if(_0x5bb709){_0x53730d=_0x4ffc27;if(!_0x4ffc27){var _0x2fb5ba={'from':(_0x2e8584['contact']['firstName']||'')+'\x20'+(_0x2e8584[_0x04ad('0x8a')][_0x04ad('0x8c')]||'')};if(_0x7317e7[_0x04ad('0x5a')]['threadId']&&_0x7317e7[_0x04ad('0x5a')]['messageId']&&_0x7317e7['body'][_0x04ad('0x8d')]!=_0x7317e7['body'][_0x04ad('0x90')]){_0x2fb5ba[_0x04ad('0x8d')]=_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x90')];}return _0x5bb709[_0x04ad('0x36')](_0x2fb5ba);}else{return _0x5bb709;}}})[_0x04ad('0x1f')](function(_0x7d5d40){_0x2e8584[_0x04ad('0x91')]=_0x7d5d40[_0x04ad('0x38')]({'plain':!![]});_0x2e8584[_0x04ad('0x91')][_0x04ad('0x92')]=_0x53730d;if(_0x2e8584['interaction'][_0x04ad('0x92')]){if(_0x2e8584[_0x04ad('0x89')][_0x04ad('0x93')]){_0x2e8584[_0x04ad('0x84')][_0x04ad('0x94')]({'id':0x0,'priority':_0x2e8584['applications'][_0x04ad('0x57')]+0x1,'app':_0x04ad('0x95'),'appdata':_0x04ad('0x96'),'interval':_0x04ad('0x97')});}}return db[_0x04ad('0x98')][_0x04ad('0x59')]({'body':_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x5a')],'OpenchannelAccountId':_0x7317e7[_0x04ad('0x56')]['id'],'OpenchannelInteractionId':_0x7d5d40['id'],'direction':'in','ContactId':_0x2e8584[_0x04ad('0x8a')]['id'],'AttachmentId':_0x7317e7[_0x04ad('0x5a')][_0x04ad('0x99')]});})['then'](function(_0x1fd4ff){_0x2e8584[_0x04ad('0x27')]=_0x1fd4ff;if(_0x2e8584[_0x04ad('0x91')]['UserId']){return db[_0x04ad('0x9a')][_0x04ad('0x5e')]({'attributes':['id',_0x04ad('0x3b')],'where':{'id':_0x2e8584[_0x04ad('0x91')][_0x04ad('0x9b')]}})['then'](function(_0x1aa1c6){if(_0x1aa1c6){_0x2e8584[_0x04ad('0x84')][_0x04ad('0x9c')]({'id':0x0,'priority':0x0,'app':_0x04ad('0x9d'),'appdata':_0x1aa1c6['name']+','+(_0x2e8584[_0x04ad('0x89')][_0x04ad('0x9e')]||0xa),'interval':_0x04ad('0x97')});_0x2e8584[_0x04ad('0x9f')]=![];}return respondWithRpcPromise(_0x04ad('0xa0'),_0x04ad('0xa1'),_0x2e8584);});}return respondWithRpcPromise(_0x04ad('0xa0'),'startRouting',_0x2e8584);})[_0x04ad('0x1f')](function(_0x1d24aa){respondWithRpcPromise(_0x04ad('0xa2'),_0x04ad('0xa2'),{'event':'notify','message':_0x1d24aa},client9002);return _0x1d24aa;})[_0x04ad('0x1f')](respondWithResult(_0x10e251,null))[_0x04ad('0x2a')](handleError(_0x10e251,null));};exports[_0x04ad('0xa3')]=function(_0x5cd8ea,_0x52a7f4,_0x4191d7){return db['OpenchannelAccount'][_0x04ad('0x64')]({'where':{'id':_0x5cd8ea[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x52a7f4,null))[_0x04ad('0x1f')](function(_0x41b234){if(_0x41b234){return db[_0x04ad('0xa4')][_0x04ad('0xa5')](function(_0x7e5142){return db[_0x04ad('0x82')][_0x04ad('0x37')]({'where':{'OpenchannelAccountId':_0x5cd8ea['params']['id']},'transaction':_0x7e5142})['then'](function(_0x99b72){var _0x35bd13=_['map'](_0x5cd8ea[_0x04ad('0x5a')],function(_0x10cbb7){_0x10cbb7['OpenchannelAccountId']=_0x5cd8ea['params']['id'];return _0x10cbb7;});return db[_0x04ad('0x82')][_0x04ad('0xa6')](_0x35bd13,{'transaction':_0x7e5142});});})[_0x04ad('0x1f')](function(){return db[_0x04ad('0x82')][_0x04ad('0xa7')]({'where':{'OpenchannelAccountId':_0x5cd8ea[_0x04ad('0x56')]['id']},'order':_0x04ad('0x87')});});}})[_0x04ad('0x1f')](respondWithResult(_0x52a7f4,null))[_0x04ad('0x2a')](handleError(_0x52a7f4,null));};exports['getApplications']=function(_0x41ae40,_0x3d4a14,_0x1d21f9){var _0x4f915f={};var _0x132e19={};var _0x40b484;var _0x3358c6;return db[_0x04ad('0x3f')]['findOne']({'where':{'id':_0x41ae40[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x3d4a14,null))[_0x04ad('0x1f')](function(_0x321c32){if(_0x321c32){_0x40b484=_0x321c32;_0x132e19[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x82')]['rawAttributes']);_0x132e19[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x41ae40['query']);_0x132e19['filters']=_[_0x04ad('0x47')](_0x132e19[_0x04ad('0x42')],_0x132e19['query']);_0x4f915f['attributes']=_[_0x04ad('0x47')](_0x132e19[_0x04ad('0x42')],qs['fields'](_0x41ae40[_0x04ad('0x44')]['fields']));_0x4f915f['attributes']=_0x4f915f['attributes'][_0x04ad('0x57')]?_0x4f915f[_0x04ad('0x48')]:_0x132e19[_0x04ad('0x42')];_0x4f915f[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x41ae40[_0x04ad('0x44')][_0x04ad('0x4b')]);_0x4f915f[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x41ae40[_0x04ad('0x44')],_0x132e19['filters']));if(_0x41ae40['query'][_0x04ad('0x4e')]){_0x4f915f[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x4f915f['where'],{'$or':_[_0x04ad('0x43')](_0x4f915f[_0x04ad('0x48')],function(_0x254067){var _0x16558e={};_0x16558e[_0x254067]={'$like':'%'+_0x41ae40[_0x04ad('0x44')][_0x04ad('0x4e')]+'%'};return _0x16558e;})});}_0x4f915f=_[_0x04ad('0x4f')]({},_0x4f915f,_0x41ae40[_0x04ad('0x58')]);return _0x40b484[_0x04ad('0xa8')](_0x4f915f);}})[_0x04ad('0x1f')](function(_0x30d067){if(_0x30d067){_0x3358c6=_0x30d067[_0x04ad('0x57')];if(!_0x41ae40[_0x04ad('0x44')]['hasOwnProperty']('nolimit')){_0x4f915f[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x41ae40[_0x04ad('0x44')][_0x04ad('0x31')]);_0x4f915f[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x41ae40[_0x04ad('0x44')][_0x04ad('0x2e')]);}return _0x40b484[_0x04ad('0xa8')](_0x4f915f);}})['then'](function(_0x291c48){if(_0x291c48){return _0x291c48?{'count':_0x3358c6,'rows':_0x291c48}:null;}})[_0x04ad('0x1f')](respondWithResult(_0x3d4a14,null))[_0x04ad('0x2a')](handleError(_0x3d4a14,null));};exports['getInteractions']=function(_0x3154be,_0x3e1d5a,_0x2df462){var _0x12d89e={'raw':![],'where':{}};var _0x30c28c={};var _0x56d825={'count':0x0,'rows':[]};return db[_0x04ad('0x3f')][_0x04ad('0x64')]({'where':{'id':_0x3154be[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x3e1d5a,null))[_0x04ad('0x1f')](function(_0x3b0e61){if(_0x3b0e61){_0x30c28c[_0x04ad('0x42')]=_[_0x04ad('0x45')](db[_0x04ad('0x8f')][_0x04ad('0xa9')]);_0x30c28c[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x3154be[_0x04ad('0x44')]);_0x30c28c['filters']=_[_0x04ad('0x47')](_0x30c28c[_0x04ad('0x42')],_0x30c28c[_0x04ad('0x44')]);_0x12d89e['attributes']=_[_0x04ad('0x47')](_0x30c28c[_0x04ad('0x42')],qs['fields'](_0x3154be['query'][_0x04ad('0x49')]));_0x12d89e[_0x04ad('0x48')]=_0x12d89e[_0x04ad('0x48')]['length']?_0x12d89e['attributes']:_0x30c28c[_0x04ad('0x42')];if(!_0x3154be['query']['hasOwnProperty'](_0x04ad('0x65'))){_0x12d89e[_0x04ad('0x31')]=qs[_0x04ad('0x31')](_0x3154be[_0x04ad('0x44')][_0x04ad('0x31')]);_0x12d89e[_0x04ad('0x2e')]=qs[_0x04ad('0x2e')](_0x3154be['query'][_0x04ad('0x2e')]);}_0x12d89e[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x3154be['query']['sort']);_0x12d89e[_0x04ad('0x4c')]=qs['filters'](_[_0x04ad('0x4d')](_0x3154be['query'],_0x30c28c[_0x04ad('0x46')]));_0x12d89e['where'][_0x04ad('0x61')]=_0x3b0e61['id'];if(_0x3154be[_0x04ad('0x44')][_0x04ad('0x4e')]){_0x12d89e[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x12d89e[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x12d89e[_0x04ad('0x48')],function(_0x3e0248){var _0x56bd63={};_0x56bd63[_0x3e0248]={'$like':'%'+_0x3154be[_0x04ad('0x44')][_0x04ad('0x4e')]+'%'};return _0x56bd63;})});}_0x12d89e=_[_0x04ad('0x4f')]({},_0x12d89e,_0x3154be[_0x04ad('0x58')]);return db[_0x04ad('0x8f')]['count']({'where':_0x12d89e[_0x04ad('0x4c')]})[_0x04ad('0x1f')](function(_0x4d9436){_0x56d825['count']=_0x4d9436;if(_0x3154be['query'][_0x04ad('0x51')]){_0x12d89e[_0x04ad('0x52')]=[{'model':db[_0x04ad('0x80')],'as':_0x04ad('0xaa'),'required':![]},{'model':db['User'],'as':_0x04ad('0xab'),'attributes':['name','fullname',_0x04ad('0xac')],'required':![]},{'model':db['Tag'],'as':_0x04ad('0xad'),'attributes':['id',_0x04ad('0x3b'),'color'],'where':_0x3154be[_0x04ad('0x44')][_0x04ad('0xae')]?{'id':_0x3154be['query'][_0x04ad('0xae')]}:undefined,'required':_0x3154be[_0x04ad('0x44')][_0x04ad('0xae')]?!![]:![]}];}return db[_0x04ad('0x8f')][_0x04ad('0x53')](_0x12d89e);})[_0x04ad('0x1f')](function(_0x2a35a4){_0x56d825['rows']=_0x2a35a4;return _0x56d825;});}})[_0x04ad('0x1f')](respondWithFilteredResult(_0x3e1d5a,_0x12d89e))[_0x04ad('0x2a')](handleError(_0x3e1d5a,null));};exports[_0x04ad('0xaf')]=function(_0x1b2aef,_0xa0ec83,_0x2dde43){return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x1b2aef['params']['id']}})['then'](handleEntityNotFound(_0xa0ec83,null))[_0x04ad('0x1f')](function(_0x444fdc){if(_0x444fdc){return _0x444fdc['addAgents'](_0x1b2aef[_0x04ad('0x5a')][_0x04ad('0x6c')],_[_0x04ad('0xb0')](_0x1b2aef[_0x04ad('0x5a')],['ids','id'])||{})[_0x04ad('0xb1')](function(_0x5e0d6f){for(var _0x31f676=0x0;_0x31f676<_0x1b2aef['body'][_0x04ad('0x6c')][_0x04ad('0x57')];_0x31f676+=0x1){socket[_0x04ad('0xb2')]('userOpenchannelAccount:save',{'UserId':Number(_0x1b2aef[_0x04ad('0x5a')][_0x04ad('0x6c')][_0x31f676]),'OpenchannelAccountId':Number(_0x1b2aef['params']['id'])});}return _0x5e0d6f;});}})['then'](respondWithResult(_0xa0ec83,null))[_0x04ad('0x2a')](handleError(_0xa0ec83,null));};exports[_0x04ad('0xb3')]=function(_0x2fa267,_0x4f69b7,_0x1eef05){return db[_0x04ad('0x3f')][_0x04ad('0x5e')]({'where':{'id':_0x2fa267[_0x04ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x4f69b7,null))[_0x04ad('0x1f')](function(_0x324d87){if(_0x324d87){return _0x324d87['removeAgents'](_0x2fa267['query']['ids'])[_0x04ad('0x1f')](function(){if(_['isArray'](_0x2fa267[_0x04ad('0x44')][_0x04ad('0x6c')])){for(var _0x48cd5e=0x0;_0x48cd5e<_0x2fa267[_0x04ad('0x44')]['ids']['length'];_0x48cd5e+=0x1){socket['emit'](_0x04ad('0xb4'),{'UserId':Number(_0x2fa267[_0x04ad('0x44')][_0x04ad('0x6c')][_0x48cd5e]),'OpenchannelAccountId':Number(_0x2fa267[_0x04ad('0x56')]['id'])});}}else{socket[_0x04ad('0xb2')](_0x04ad('0xb4'),{'UserId':Number(_0x2fa267[_0x04ad('0x44')][_0x04ad('0x6c')]),'OpenchannelAccountId':Number(_0x2fa267['params']['id'])});}});}})[_0x04ad('0x1f')](respondWithStatusCode(_0x4f69b7,null))[_0x04ad('0x2a')](handleError(_0x4f69b7,null));};exports[_0x04ad('0xb5')]=function(_0x3cd341,_0x51edf1,_0x22f24a){var _0x18a411={};var _0x2d7be5={};var _0x283e2c;var _0x32e53c;return db[_0x04ad('0x3f')]['findOne']({'where':{'id':_0x3cd341[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x51edf1,null))[_0x04ad('0x1f')](function(_0x3bdb92){if(_0x3bdb92){_0x283e2c=_0x3bdb92;_0x2d7be5[_0x04ad('0x42')]=_['keys'](db[_0x04ad('0x9a')][_0x04ad('0xa9')]);_0x2d7be5[_0x04ad('0x44')]=_[_0x04ad('0x45')](_0x3cd341[_0x04ad('0x44')]);_0x2d7be5[_0x04ad('0x46')]=_[_0x04ad('0x47')](_0x2d7be5[_0x04ad('0x42')],_0x2d7be5[_0x04ad('0x44')]);_0x18a411[_0x04ad('0x48')]=_['intersection'](_0x2d7be5[_0x04ad('0x42')],qs[_0x04ad('0x49')](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x49')]));_0x18a411[_0x04ad('0x48')]=_0x18a411[_0x04ad('0x48')][_0x04ad('0x57')]?_0x18a411[_0x04ad('0x48')]:_0x2d7be5[_0x04ad('0x42')];_0x18a411[_0x04ad('0x66')]=qs[_0x04ad('0x4b')](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x4b')]);_0x18a411[_0x04ad('0x4c')]=qs[_0x04ad('0x46')](_[_0x04ad('0x4d')](_0x3cd341[_0x04ad('0x44')],_0x2d7be5[_0x04ad('0x46')]));if(_0x3cd341[_0x04ad('0x44')]['filter']){_0x18a411[_0x04ad('0x4c')]=_[_0x04ad('0x4f')](_0x18a411[_0x04ad('0x4c')],{'$or':_[_0x04ad('0x43')](_0x18a411[_0x04ad('0x48')],function(_0x1a804f){var _0x56ad92={};_0x56ad92[_0x1a804f]={'$like':'%'+_0x3cd341['query'][_0x04ad('0x4e')]+'%'};return _0x56ad92;})});}_0x18a411=_[_0x04ad('0x4f')]({},_0x18a411,_0x3cd341[_0x04ad('0x58')]);return _0x283e2c[_0x04ad('0xb5')](_0x18a411);}})[_0x04ad('0x1f')](function(_0x3c0b3b){if(_0x3c0b3b){_0x32e53c=_0x3c0b3b[_0x04ad('0x57')];if(!_0x3cd341[_0x04ad('0x44')][_0x04ad('0x4a')](_0x04ad('0x65'))){_0x18a411[_0x04ad('0x31')]=qs['limit'](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x31')]);_0x18a411['offset']=qs['offset'](_0x3cd341[_0x04ad('0x44')][_0x04ad('0x2e')]);}return _0x283e2c[_0x04ad('0xb5')](_0x18a411);}})[_0x04ad('0x1f')](function(_0x5baebb){if(_0x5baebb){return _0x5baebb?{'count':_0x32e53c,'rows':_0x5baebb}:null;}})[_0x04ad('0x1f')](respondWithResult(_0x51edf1,null))['catch'](handleError(_0x51edf1,null));};exports[_0x04ad('0xb6')]=function(_0x1ec568,_0x191093,_0x538a83){var _0x50dfcb,_0x479c79,_0xce3c64;if(_[_0x04ad('0x76')](_0x1ec568['body']['body'])||_0x1ec568[_0x04ad('0x5a')][_0x04ad('0x5a')]===''){throw new db[(_0x04ad('0x78'))][(_0x04ad('0x6f'))](_0x04ad('0x7a'));}if(_[_0x04ad('0x76')](_0x1ec568[_0x04ad('0x5a')]['to'])){}_0x50dfcb=_0x1ec568[_0x04ad('0x5a')]['to'];return db['OpenchannelAccount'][_0x04ad('0x64')]({'where':{'id':_0x1ec568[_0x04ad('0x56')]['id']}})[_0x04ad('0x1f')](handleEntityNotFound(_0x191093,null))['then'](function(_0x235419){if(_0x235419){return db['OpenchannelAccount'][_0x04ad('0x5e')]({'where':{'id':_0x235419['id']},'include':[{'model':db[_0x04ad('0x7e')],'as':'List','include':[{'model':db[_0x04ad('0x80')],'as':'Contacts','where':{[_0x235419[_0x04ad('0x7b')]]:_0x50dfcb},'limit':0x1,'order':[[_0x04ad('0x72'),_0x04ad('0xb7')]]}]}]})['then'](handleEntityNotFound(_0x191093,null))[_0x04ad('0x1f')](function(_0xa03c4b){if(_0xa03c4b&&_0xa03c4b['List']){_0x479c79=_0xa03c4b[_0x04ad('0x38')]({'plain':!![]});if(_0x479c79['List']&&_0x479c79['List'][_0x04ad('0x81')][_0x04ad('0x57')]){return _0x479c79[_0x04ad('0x7f')][_0x04ad('0x81')][0x0];}return db[_0x04ad('0x80')][_0x04ad('0x59')](_['defaults'](_0x1ec568[_0x04ad('0x5a')],{'firstName':_0x50dfcb,[_0xa03c4b[_0x04ad('0x7b')]]:_0x50dfcb,'phone':_0x50dfcb,'ListId':_0x479c79[_0x04ad('0x75')]}));}})['then'](handleEntityNotFound(_0x191093,null))[_0x04ad('0x1f')](function(_0x21656d){if(_0x21656d){_0xce3c64=_0x21656d;return db[_0x04ad('0x8f')]['find']({'where':{'ContactId':_0xce3c64['id'],'closed':![],'OpenchannelAccountId':_0x479c79['id']}})[_0x04ad('0x1f')](function(_0x3550a6){if(_0x3550a6){return[_0x3550a6,![]];}return db['OpenchannelInteraction'][_0x04ad('0x59')]({'UserId':_0x1ec568[_0x04ad('0x5c')]['id'],'ContactId':_0xce3c64['id'],'OpenchannelAccountId':_0x479c79['id'],'lastMsgDirection':_0x04ad('0xb8'),'Messages':[_['merge'](_0x1ec568['body'],{'read':![],'body':_0x1ec568[_0x04ad('0x5a')][_0x04ad('0x5a')],'OpenchannelAccountId':_0x479c79['id'],'UserId':_0x1ec568[_0x04ad('0x5c')]['id'],'ContactId':_0xce3c64['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x04ad('0xb9')}]})[_0x04ad('0x1f')](function(_0x4871a3){return[_0x4871a3,!![]];});});}})[_0x04ad('0xb1')](function(_0x268f41,_0x475b78){if(_0x475b78){return _0x268f41;}return db[_0x04ad('0x98')][_0x04ad('0x59')](_[_0x04ad('0x4f')](_0x1ec568[_0x04ad('0x5a')],{'read':![],'body':_0x1ec568[_0x04ad('0x5a')][_0x04ad('0x5a')],'OpenchannelAccountId':_0x479c79['id'],'OpenchannelInteractionId':_0x268f41['id'],'UserId':_0x1ec568[_0x04ad('0x5c')]['id'],'ContactId':_0xce3c64['id']}))['then'](function(_0x49667f){_0x268f41['dataValues'][_0x04ad('0xb9')]=[];_0x268f41[_0x04ad('0xba')][_0x04ad('0xb9')]['push'](_0x49667f[_0x04ad('0xba')]);return _0x268f41;});});}})[_0x04ad('0x1f')](respondWithResult(_0x191093,null))[_0x04ad('0x2a')](handleError(_0x191093,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index a624319..6e9da1a 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 _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount','setMaxListeners'];(function(_0x4e9d0f,_0x1b1f32){var _0x1b4874=function(_0x398c51){while(--_0x398c51){_0x4e9d0f['push'](_0x4e9d0f['shift']());}};_0x1b4874(++_0x1b1f32);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xa1b5fb,_0x41a2bd){_0xa1b5fb=_0xa1b5fb-0x0;var _0x123597=_0xbdb7[_0xa1b5fb];return _0x123597;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var OpenchannelAccount=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){OpenchannelAccountEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);OpenchannelAccountEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];OpenchannelAccount[_0x7bdb('0x8')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xb58b=['exports','../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','emit','hook'];(function(_0x2c8d7e,_0x1bf766){var _0x2da1c1=function(_0x325785){while(--_0x325785){_0x2c8d7e['push'](_0x2c8d7e['shift']());}};_0x2da1c1(++_0x1bf766);}(_0xb58b,0x1f1));var _0xbb58=function(_0x5b2cf3,_0x4b81f8){_0x5b2cf3=_0x5b2cf3-0x0;var _0x80311=_0xb58b[_0x5b2cf3];return _0x80311;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xbb58('0x0'))['db'][_0xbb58('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xbb58('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb58('0x3'),'afterDestroy':_0xbb58('0x4')};function emitEvent(_0x5c9ec5){return function(_0x226363,_0x546510,_0x2edb10){OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5+':'+_0x226363['id'],_0x226363);OpenchannelAccountEvents[_0xbb58('0x5')](_0x5c9ec5,_0x226363);_0x2edb10(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xbb58('0x6')](e,emitEvent(event));}}module[_0xbb58('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 1ef8826..92be30b 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(_0x1b4bc5,_0x2c8704){var _0x4488b1=function(_0x381cff){while(--_0x381cff){_0x1b4bc5['push'](_0x1b4bc5['shift']());}};_0x4488b1(++_0x2c8704);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x468bec,_0x3caa0c){var _0x451d80=function(_0x366753){while(--_0x366753){_0x468bec['push'](_0x468bec['shift']());}};_0x451d80(++_0x3caa0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 64c9445..897c8f6 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 _0x7334=['then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x527964,_0x1f5973){var _0x470934=function(_0xd7eca8){while(--_0xd7eca8){_0x527964['push'](_0x527964['shift']());}};_0x470934(++_0x1f5973);}(_0x7334,0x184));var _0x4733=function(_0x2fd8a1,_0x4b61e7){_0x2fd8a1=_0x2fd8a1-0x0;var _0x259249=_0x7334[_0x2fd8a1];return _0x259249;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});config[_0x4733('0xb')]=_[_0x4733('0xc')](config[_0x4733('0xb')],{'host':_0x4733('0xd'),'port':0x18eb});var socket=require(_0x4733('0xe'))(new Redis(config[_0x4733('0xb')]));require(_0x4733('0xf'))[_0x4733('0x10')](socket);function respondWithRpcPromise(_0x1bc511,_0x2bafad,_0x49032d){return new BPromise(function(_0x42b97f,_0x1e6fcf){return client['request'](_0x1bc511,_0x49032d)[_0x4733('0x11')](function(_0x5240a4){logger[_0x4733('0x12')](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));logger[_0x4733('0x15')](_0x4733('0x16'),_0x2bafad,_0x4733('0x14'),JSON[_0x4733('0x17')](_0x5240a4));if(_0x5240a4['error']){if(_0x5240a4[_0x4733('0x18')]['code']===0x1f4){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);return _0x1e6fcf(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x5240a4[_0x4733('0x18')]['message']);return _0x42b97f(_0x5240a4[_0x4733('0x18')][_0x4733('0x19')]);}else{logger['info'](_0x4733('0x13'),_0x2bafad,_0x4733('0x14'));_0x42b97f(_0x5240a4[_0x4733('0x1a')][_0x4733('0x19')]);}})['catch'](function(_0x517fbc){logger[_0x4733('0x18')](_0x4733('0x13'),_0x2bafad,_0x517fbc);_0x1e6fcf(_0x517fbc);});});} \ No newline at end of file +var _0x0abf=['bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x137da3,_0xa6277a){var _0x1ac46c=function(_0x49e68b){while(--_0x49e68b){_0x137da3['push'](_0x137da3['shift']());}};_0x1ac46c(++_0xa6277a);}(_0x0abf,0xe8));var _0xf0ab=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0abf[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});config[_0xf0ab('0xa')]=_['defaults'](config[_0xf0ab('0xa')],{'host':_0xf0ab('0xb'),'port':0x18eb});var socket=require(_0xf0ab('0xc'))(new Redis(config[_0xf0ab('0xa')]));require('./openchannelAccount.socket')[_0xf0ab('0xd')](socket);function respondWithRpcPromise(_0x4688d8,_0x1e7887,_0x4ab8e7){return new BPromise(function(_0x5d25a0,_0x30042c){return client['request'](_0x4688d8,_0x4ab8e7)[_0xf0ab('0xe')](function(_0x10a5a2){logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));logger[_0xf0ab('0x12')](_0xf0ab('0x13'),_0x1e7887,'request\x20sent',JSON[_0xf0ab('0x14')](_0x10a5a2));if(_0x10a5a2[_0xf0ab('0x15')]){if(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x16')]===0x1f4){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x30042c(_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);}logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x10a5a2[_0xf0ab('0x15')][_0xf0ab('0x17')]);return _0x5d25a0(_0x10a5a2[_0xf0ab('0x15')]['message']);}else{logger[_0xf0ab('0xf')](_0xf0ab('0x10'),_0x1e7887,_0xf0ab('0x11'));_0x5d25a0(_0x10a5a2[_0xf0ab('0x18')][_0xf0ab('0x17')]);}})[_0xf0ab('0x19')](function(_0x3a0edf){logger[_0xf0ab('0x15')](_0xf0ab('0x10'),_0x1e7887,_0x3a0edf);_0x30042c(_0x3a0edf);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 2bc8163..ee08fde 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 _0x1ae3=['update','removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x1ae3,0x139));var _0x31ae=function(_0x11347e,_0x378d58){_0x11347e=_0x11347e-0x0;var _0x4f71d1=_0x1ae3[_0x11347e];return _0x4f71d1;};'use strict';var OpenchannelAccountEvents=require(_0x31ae('0x0'));var events=[_0x31ae('0x1'),'remove',_0x31ae('0x2')];function createListener(_0x3ba253,_0x21cada){return function(_0x293580){_0x21cada['emit'](_0x3ba253,_0x293580);};}function removeListener(_0x16eaa4,_0xf41e21){return function(){OpenchannelAccountEvents[_0x31ae('0x3')](_0x16eaa4,_0xf41e21);};}exports[_0x31ae('0x4')]=function(_0xe1202b){for(var _0x3f2e91=0x0,_0x3500b4=events[_0x31ae('0x5')];_0x3f2e91<_0x3500b4;_0x3f2e91++){var _0x43773f=events[_0x3f2e91];var _0x1d2071=createListener(_0x31ae('0x6')+_0x43773f,_0xe1202b);OpenchannelAccountEvents['on'](_0x43773f,_0x1d2071);}}; \ No newline at end of file +var _0xbdb7=['openchannelAccount:','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x26224c,_0x1a354c){_0x26224c=_0x26224c-0x0;var _0x4c2bc5=_0xbdb7[_0x26224c];return _0x4c2bc5;};'use strict';var OpenchannelAccountEvents=require(_0x7bdb('0x0'));var events=[_0x7bdb('0x1'),_0x7bdb('0x2'),_0x7bdb('0x3')];function createListener(_0x23c326,_0x433850){return function(_0x4496ac){_0x433850[_0x7bdb('0x4')](_0x23c326,_0x4496ac);};}function removeListener(_0x46c068,_0x47aec5){return function(){OpenchannelAccountEvents[_0x7bdb('0x5')](_0x46c068,_0x47aec5);};}exports['register']=function(_0x4b5fff){for(var _0xffdc86=0x0,_0x1e23a3=events['length'];_0xffdc86<_0x1e23a3;_0xffdc86++){var _0x513cba=events[_0xffdc86];var _0x468041=createListener(_0x7bdb('0x6')+_0x513cba,_0x4b5fff);OpenchannelAccountEvents['on'](_0x513cba,_0x468041);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 67d9a1d..b787372 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 _0xeb39=['../../components/auth/service','../../config/environment','./openchannelApplication.controller','index','/:id','isAuthenticated','show','post','create','put','update','delete','exports','multer','util','path','Router'];(function(_0x83eba6,_0x6aa67c){var _0x242887=function(_0x16dbf6){while(--_0x16dbf6){_0x83eba6['push'](_0x83eba6['shift']());}};_0x242887(++_0x6aa67c);}(_0xeb39,0x1e9));var _0x9eb3=function(_0x9a3e0f,_0x2f796d){_0x9a3e0f=_0x9a3e0f-0x0;var _0x3d2a9a=_0xeb39[_0x9a3e0f];return _0x3d2a9a;};'use strict';var multer=require(_0x9eb3('0x0'));var util=require(_0x9eb3('0x1'));var path=require(_0x9eb3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9eb3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9eb3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9eb3('0x5'));var controller=require(_0x9eb3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9eb3('0x7')]);router['get'](_0x9eb3('0x8'),auth[_0x9eb3('0x9')](),controller[_0x9eb3('0xa')]);router[_0x9eb3('0xb')]('/',auth['isAuthenticated'](),controller[_0x9eb3('0xc')]);router[_0x9eb3('0xd')](_0x9eb3('0x8'),auth[_0x9eb3('0x9')](),controller[_0x9eb3('0xe')]);router[_0x9eb3('0xf')](_0x9eb3('0x8'),auth[_0x9eb3('0x9')](),controller['destroy']);module[_0x9eb3('0x10')]=router; \ No newline at end of file +var _0x8a4c=['isAuthenticated','update','delete','exports','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id','post','create'];(function(_0x3d2e1b,_0x6649aa){var _0x3b85c2=function(_0x3ea5d6){while(--_0x3ea5d6){_0x3d2e1b['push'](_0x3d2e1b['shift']());}};_0x3b85c2(++_0x6649aa);}(_0x8a4c,0x74));var _0xc8a4=function(_0x3e7804,_0x121853){_0x3e7804=_0x3e7804-0x0;var _0x56efda=_0x8a4c[_0x3e7804];return _0x56efda;};'use strict';var multer=require('multer');var util=require(_0xc8a4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xc8a4('0x1'));var auth=require(_0xc8a4('0x2'));var interaction=require(_0xc8a4('0x3'));var config=require(_0xc8a4('0x4'));var controller=require(_0xc8a4('0x5'));router[_0xc8a4('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xc8a4('0x7'),auth['isAuthenticated'](),controller['show']);router[_0xc8a4('0x8')]('/',auth['isAuthenticated'](),controller[_0xc8a4('0x9')]);router['put'](_0xc8a4('0x7'),auth[_0xc8a4('0xa')](),controller[_0xc8a4('0xb')]);router[_0xc8a4('0xc')](_0xc8a4('0x7'),auth[_0xc8a4('0xa')](),controller['destroy']);module[_0xc8a4('0xd')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 84dfcb0..ebccf55 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 _0x8fae=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x41075d,_0x112862){var _0x11f102=function(_0x49f373){while(--_0x49f373){_0x41075d['push'](_0x41075d['shift']());}};_0x11f102(++_0x112862);}(_0x8fae,0x10d));var _0xe8fa=function(_0x27ede9,_0x5a77e0){_0x27ede9=_0x27ede9-0x0;var _0x6a1dbc=_0x8fae[_0x27ede9];return _0x6a1dbc;};'use strict';var Sequelize=require(_0xe8fa('0x0'));module[_0xe8fa('0x1')]={'priority':{'type':Sequelize[_0xe8fa('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe8fa('0x3')],'allowNull':![],'defaultValue':_0xe8fa('0x4')},'appdata':{'type':Sequelize[_0xe8fa('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe8fa('0x3')],'defaultValue':_0xe8fa('0x6')}}; \ No newline at end of file +var _0x43e1=['noop','sequelize','exports','STRING'];(function(_0x515d98,_0x118123){var _0x538457=function(_0x454b5d){while(--_0x454b5d){_0x515d98['push'](_0x515d98['shift']());}};_0x538457(++_0x118123);}(_0x43e1,0x79));var _0x143e=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x43e1[_0x46a38b];return _0x346e75;};'use strict';var Sequelize=require(_0x143e('0x0'));module[_0x143e('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x143e('0x2')],'allowNull':![],'defaultValue':_0x143e('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x143e('0x2')]},'interval':{'type':Sequelize[_0x143e('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 5864b7d..c8bab57 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 _0xbe01=['status','json','undefined','limit','count','offset','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end'];(function(_0x1f25cf,_0x33ac72){var _0xbb033f=function(_0xfedfdf){while(--_0xfedfdf){_0x1f25cf['push'](_0x1f25cf['shift']());}};_0xbb033f(++_0x33ac72);}(_0xbe01,0x15a));var _0x1be0=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xbe01[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1be0('0x0'));var zipdir=require(_0x1be0('0x1'));var jsonpatch=require(_0x1be0('0x2'));var rp=require(_0x1be0('0x3'));var moment=require('moment');var BPromise=require(_0x1be0('0x4'));var Mustache=require(_0x1be0('0x5'));var util=require(_0x1be0('0x6'));var path=require(_0x1be0('0x7'));var sox=require(_0x1be0('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1be0('0x9'));var _=require(_0x1be0('0xa'));var squel=require(_0x1be0('0xb'));var crypto=require(_0x1be0('0xc'));var jsforce=require(_0x1be0('0xd'));var deskjs=require(_0x1be0('0xe'));var toCsv=require(_0x1be0('0xf'));var querystring=require(_0x1be0('0x10'));var Papa=require(_0x1be0('0x11'));var Redis=require(_0x1be0('0x12'));var authService=require(_0x1be0('0x13'));var qs=require(_0x1be0('0x14'));var as=require(_0x1be0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1be0('0x16'))('api');var utils=require(_0x1be0('0x17'));var config=require(_0x1be0('0x18'));var licenseUtil=require(_0x1be0('0x19'));var db=require(_0x1be0('0x1a'))['db'];function respondWithStatusCode(_0x4dde9b,_0xe88e7a){_0xe88e7a=_0xe88e7a||0xcc;return function(_0x140709){if(_0x140709){return _0x4dde9b[_0x1be0('0x1b')](_0xe88e7a);}return _0x4dde9b['status'](_0xe88e7a)[_0x1be0('0x1c')]();};}function respondWithResult(_0x560687,_0x3d4d56){_0x3d4d56=_0x3d4d56||0xc8;return function(_0x1dc3f4){if(_0x1dc3f4){return _0x560687[_0x1be0('0x1d')](_0x3d4d56)[_0x1be0('0x1e')](_0x1dc3f4);}};}function respondWithFilteredResult(_0x581c36,_0x5a9ee7){return function(_0x1129a4){if(_0x1129a4){var _0x56e9a5=typeof _0x5a9ee7['offset']===_0x1be0('0x1f')&&typeof _0x5a9ee7[_0x1be0('0x20')]===_0x1be0('0x1f');var _0x43d2d9=_0x1129a4[_0x1be0('0x21')];var _0x1ce3b9=_0x56e9a5?0x0:_0x5a9ee7[_0x1be0('0x22')];var _0x33df54=_0x56e9a5?_0x1129a4[_0x1be0('0x21')]:_0x5a9ee7[_0x1be0('0x22')]+_0x5a9ee7[_0x1be0('0x20')];var _0x3d7136;if(_0x33df54>=_0x43d2d9){_0x33df54=_0x43d2d9;_0x3d7136=0xc8;}else{_0x3d7136=0xce;}_0x581c36['status'](_0x3d7136);return _0x581c36['set'](_0x1be0('0x23'),_0x1ce3b9+'-'+_0x33df54+'/'+_0x43d2d9)[_0x1be0('0x1e')](_0x1129a4);}return null;};}function patchUpdates(_0x4a125e){return function(_0x739dc4){try{jsonpatch['apply'](_0x739dc4,_0x4a125e,!![]);}catch(_0x23b220){return BPromise[_0x1be0('0x24')](_0x23b220);}return _0x739dc4['save']();};}function saveUpdates(_0x40b19e,_0xf3c1bf){return function(_0x4fa12a){if(_0x4fa12a){return _0x4fa12a[_0x1be0('0x25')](_0x40b19e)[_0x1be0('0x26')](function(_0xa35b53){return _0xa35b53;});}return null;};}function removeEntity(_0x58bb94,_0x16a4c8){return function(_0x54e9ba){if(_0x54e9ba){return _0x54e9ba[_0x1be0('0x27')]()['then'](function(){_0x58bb94[_0x1be0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aac72,_0x5a93a5){return function(_0x4137d4){if(!_0x4137d4){_0x1aac72['sendStatus'](0x194);}return _0x4137d4;};}function handleError(_0x4f4ba8,_0x5e8da7){_0x5e8da7=_0x5e8da7||0x1f4;return function(_0xfad0e7){logger[_0x1be0('0x28')](_0xfad0e7[_0x1be0('0x29')]);if(_0xfad0e7[_0x1be0('0x2a')]){delete _0xfad0e7[_0x1be0('0x2a')];}_0x4f4ba8['status'](_0x5e8da7)[_0x1be0('0x2b')](_0xfad0e7);};}exports[_0x1be0('0x2c')]=function(_0x472644,_0x36102c){var _0x909653={},_0x29e388={},_0x2cfc4b={'count':0x0,'rows':[]};var _0x41ad3c=_[_0x1be0('0x2d')](db[_0x1be0('0x2e')][_0x1be0('0x2f')],function(_0x3f6fd3){return{'name':_0x3f6fd3[_0x1be0('0x30')],'type':_0x3f6fd3[_0x1be0('0x31')][_0x1be0('0x32')]};});_0x29e388['model']=_[_0x1be0('0x2d')](_0x41ad3c,'name');_0x29e388[_0x1be0('0x33')]=_[_0x1be0('0x34')](_0x472644[_0x1be0('0x33')]);_0x29e388[_0x1be0('0x35')]=_[_0x1be0('0x36')](_0x29e388[_0x1be0('0x37')],_0x29e388['query']);_0x909653['attributes']=_[_0x1be0('0x36')](_0x29e388[_0x1be0('0x37')],qs[_0x1be0('0x38')](_0x472644['query'][_0x1be0('0x38')]));_0x909653[_0x1be0('0x39')]=_0x909653['attributes'][_0x1be0('0x3a')]?_0x909653['attributes']:_0x29e388[_0x1be0('0x37')];if(!_0x472644[_0x1be0('0x33')][_0x1be0('0x3b')](_0x1be0('0x3c'))){_0x909653[_0x1be0('0x20')]=qs[_0x1be0('0x20')](_0x472644[_0x1be0('0x33')][_0x1be0('0x20')]);_0x909653[_0x1be0('0x22')]=qs[_0x1be0('0x22')](_0x472644['query'][_0x1be0('0x22')]);}_0x909653[_0x1be0('0x3d')]=qs[_0x1be0('0x3e')](_0x472644[_0x1be0('0x33')][_0x1be0('0x3e')]);_0x909653[_0x1be0('0x3f')]=qs['filters'](_['pick'](_0x472644[_0x1be0('0x33')],_0x29e388['filters']),_0x41ad3c);if(_0x472644['query'][_0x1be0('0x40')]){_0x909653[_0x1be0('0x3f')]=_[_0x1be0('0x41')](_0x909653[_0x1be0('0x3f')],{'$or':_[_0x1be0('0x2d')](_0x41ad3c,function(_0x4918ba){if(_0x4918ba[_0x1be0('0x31')]!==_0x1be0('0x42')){var _0x311e29={};_0x311e29[_0x4918ba[_0x1be0('0x2a')]]={'$like':'%'+_0x472644[_0x1be0('0x33')][_0x1be0('0x40')]+'%'};return _0x311e29;}})});}_0x909653=_[_0x1be0('0x41')]({},_0x909653,_0x472644[_0x1be0('0x43')]);var _0x4b505c={'where':_0x909653[_0x1be0('0x3f')]};return db[_0x1be0('0x2e')][_0x1be0('0x21')](_0x4b505c)['then'](function(_0x580f20){_0x2cfc4b[_0x1be0('0x21')]=_0x580f20;if(_0x472644[_0x1be0('0x33')][_0x1be0('0x44')]){_0x909653[_0x1be0('0x45')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x1be0('0x46')](_0x909653);})[_0x1be0('0x26')](function(_0x4d5ef4){_0x2cfc4b['rows']=_0x4d5ef4;return _0x2cfc4b;})[_0x1be0('0x26')](respondWithFilteredResult(_0x36102c,_0x909653))[_0x1be0('0x47')](handleError(_0x36102c,null));};exports['show']=function(_0x3f089f,_0x255da9){var _0x5856cb={'raw':!![],'where':{'id':_0x3f089f['params']['id']}},_0x5a291f={};_0x5a291f[_0x1be0('0x37')]=_[_0x1be0('0x34')](db[_0x1be0('0x2e')][_0x1be0('0x2f')]);_0x5a291f['query']=_[_0x1be0('0x34')](_0x3f089f[_0x1be0('0x33')]);_0x5a291f[_0x1be0('0x35')]=_['intersection'](_0x5a291f['model'],_0x5a291f[_0x1be0('0x33')]);_0x5856cb[_0x1be0('0x39')]=_['intersection'](_0x5a291f[_0x1be0('0x37')],qs[_0x1be0('0x38')](_0x3f089f[_0x1be0('0x33')][_0x1be0('0x38')]));_0x5856cb['attributes']=_0x5856cb[_0x1be0('0x39')][_0x1be0('0x3a')]?_0x5856cb[_0x1be0('0x39')]:_0x5a291f[_0x1be0('0x37')];if(_0x3f089f[_0x1be0('0x33')][_0x1be0('0x44')]){_0x5856cb['include']=[{'all':!![]}];}_0x5856cb=_[_0x1be0('0x41')]({},_0x5856cb,_0x3f089f[_0x1be0('0x43')]);return db[_0x1be0('0x2e')][_0x1be0('0x48')](_0x5856cb)[_0x1be0('0x26')](handleEntityNotFound(_0x255da9,null))[_0x1be0('0x26')](respondWithResult(_0x255da9,null))['catch'](handleError(_0x255da9,null));};exports['create']=function(_0x26ee03,_0x24c257){return db[_0x1be0('0x2e')][_0x1be0('0x49')](_0x26ee03[_0x1be0('0x4a')],{})[_0x1be0('0x26')](respondWithResult(_0x24c257,0xc9))[_0x1be0('0x47')](handleError(_0x24c257,null));};exports[_0x1be0('0x25')]=function(_0x3a1660,_0x5abc28){if(_0x3a1660['body']['id']){delete _0x3a1660['body']['id'];}return db['OpenchannelApplication'][_0x1be0('0x48')]({'where':{'id':_0x3a1660['params']['id']}})[_0x1be0('0x26')](handleEntityNotFound(_0x5abc28,null))[_0x1be0('0x26')](saveUpdates(_0x3a1660[_0x1be0('0x4a')],null))['then'](respondWithResult(_0x5abc28,null))['catch'](handleError(_0x5abc28,null));};exports[_0x1be0('0x27')]=function(_0x2bfba6,_0x5c63e2){return db[_0x1be0('0x2e')][_0x1be0('0x48')]({'where':{'id':_0x2bfba6['params']['id']}})[_0x1be0('0x26')](handleEntityNotFound(_0x5c63e2,null))[_0x1be0('0x26')](removeEntity(_0x5c63e2,null))[_0x1be0('0x47')](handleError(_0x5c63e2,null));}; \ No newline at end of file +var _0xf27a=['limit','set','save','then','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelApplication','include','findAll','catch','show','params','includeAll','find','create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count'];(function(_0x3d8d62,_0x491f39){var _0x5caceb=function(_0xf886f1){while(--_0xf886f1){_0x3d8d62['push'](_0x3d8d62['shift']());}};_0x5caceb(++_0x491f39);}(_0xf27a,0xc3));var _0xaf27=function(_0x250f61,_0x31698a){_0x250f61=_0x250f61-0x0;var _0x4ab6ea=_0xf27a[_0x250f61];return _0x4ab6ea;};'use strict';var emlformat=require(_0xaf27('0x0'));var rimraf=require(_0xaf27('0x1'));var zipdir=require(_0xaf27('0x2'));var jsonpatch=require(_0xaf27('0x3'));var rp=require(_0xaf27('0x4'));var moment=require(_0xaf27('0x5'));var BPromise=require(_0xaf27('0x6'));var Mustache=require('mustache');var util=require(_0xaf27('0x7'));var path=require(_0xaf27('0x8'));var sox=require('sox');var csv=require(_0xaf27('0x9'));var ejs=require(_0xaf27('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaf27('0xb'));var squel=require(_0xaf27('0xc'));var crypto=require(_0xaf27('0xd'));var jsforce=require(_0xaf27('0xe'));var deskjs=require(_0xaf27('0xf'));var toCsv=require('to-csv');var querystring=require(_0xaf27('0x10'));var Papa=require(_0xaf27('0x11'));var Redis=require(_0xaf27('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaf27('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf27('0x14'))(_0xaf27('0x15'));var utils=require(_0xaf27('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaf27('0x17'));var db=require(_0xaf27('0x18'))['db'];function respondWithStatusCode(_0x2285e8,_0xc80438){_0xc80438=_0xc80438||0xcc;return function(_0x15a4cf){if(_0x15a4cf){return _0x2285e8['sendStatus'](_0xc80438);}return _0x2285e8[_0xaf27('0x19')](_0xc80438)['end']();};}function respondWithResult(_0x44f634,_0x591a03){_0x591a03=_0x591a03||0xc8;return function(_0x1bcd88){if(_0x1bcd88){return _0x44f634[_0xaf27('0x19')](_0x591a03)[_0xaf27('0x1a')](_0x1bcd88);}};}function respondWithFilteredResult(_0x410169,_0x39e567){return function(_0x57a8df){if(_0x57a8df){var _0x2f3b04=typeof _0x39e567[_0xaf27('0x1b')]===_0xaf27('0x1c')&&typeof _0x39e567['limit']===_0xaf27('0x1c');var _0x14fee8=_0x57a8df[_0xaf27('0x1d')];var _0x476ac0=_0x2f3b04?0x0:_0x39e567[_0xaf27('0x1b')];var _0x31628d=_0x2f3b04?_0x57a8df[_0xaf27('0x1d')]:_0x39e567['offset']+_0x39e567[_0xaf27('0x1e')];var _0x585f87;if(_0x31628d>=_0x14fee8){_0x31628d=_0x14fee8;_0x585f87=0xc8;}else{_0x585f87=0xce;}_0x410169['status'](_0x585f87);return _0x410169[_0xaf27('0x1f')]('Content-Range',_0x476ac0+'-'+_0x31628d+'/'+_0x14fee8)[_0xaf27('0x1a')](_0x57a8df);}return null;};}function patchUpdates(_0x1def05){return function(_0x5e08f3){try{jsonpatch['apply'](_0x5e08f3,_0x1def05,!![]);}catch(_0x1407ce){return BPromise['reject'](_0x1407ce);}return _0x5e08f3[_0xaf27('0x20')]();};}function saveUpdates(_0xef4e73,_0x216f84){return function(_0x2cacad){if(_0x2cacad){return _0x2cacad['update'](_0xef4e73)[_0xaf27('0x21')](function(_0x23d233){return _0x23d233;});}return null;};}function removeEntity(_0x113b2c,_0x30345b){return function(_0x465f6e){if(_0x465f6e){return _0x465f6e[_0xaf27('0x22')]()[_0xaf27('0x21')](function(){_0x113b2c['status'](0xcc)[_0xaf27('0x23')]();});}};}function handleEntityNotFound(_0x1f637d,_0x4b3697){return function(_0x341fbc){if(!_0x341fbc){_0x1f637d[_0xaf27('0x24')](0x194);}return _0x341fbc;};}function handleError(_0x221a15,_0x1be9de){_0x1be9de=_0x1be9de||0x1f4;return function(_0x67b877){logger['error'](_0x67b877[_0xaf27('0x25')]);if(_0x67b877['name']){delete _0x67b877[_0xaf27('0x26')];}_0x221a15[_0xaf27('0x19')](_0x1be9de)[_0xaf27('0x27')](_0x67b877);};}exports[_0xaf27('0x28')]=function(_0x4d804d,_0x3c8efc){var _0x1cc39e={},_0x58ae63={},_0x21a18e={'count':0x0,'rows':[]};var _0x51b12c=_[_0xaf27('0x29')](db['OpenchannelApplication'][_0xaf27('0x2a')],function(_0x511a2e){return{'name':_0x511a2e[_0xaf27('0x2b')],'type':_0x511a2e['type'][_0xaf27('0x2c')]};});_0x58ae63[_0xaf27('0x2d')]=_[_0xaf27('0x29')](_0x51b12c,_0xaf27('0x26'));_0x58ae63[_0xaf27('0x2e')]=_[_0xaf27('0x2f')](_0x4d804d[_0xaf27('0x2e')]);_0x58ae63[_0xaf27('0x30')]=_['intersection'](_0x58ae63[_0xaf27('0x2d')],_0x58ae63['query']);_0x1cc39e[_0xaf27('0x31')]=_[_0xaf27('0x32')](_0x58ae63['model'],qs[_0xaf27('0x33')](_0x4d804d[_0xaf27('0x2e')]['fields']));_0x1cc39e['attributes']=_0x1cc39e[_0xaf27('0x31')][_0xaf27('0x34')]?_0x1cc39e[_0xaf27('0x31')]:_0x58ae63[_0xaf27('0x2d')];if(!_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x35')](_0xaf27('0x36'))){_0x1cc39e['limit']=qs['limit'](_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x1e')]);_0x1cc39e['offset']=qs[_0xaf27('0x1b')](_0x4d804d[_0xaf27('0x2e')]['offset']);}_0x1cc39e[_0xaf27('0x37')]=qs[_0xaf27('0x38')](_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x38')]);_0x1cc39e[_0xaf27('0x39')]=qs[_0xaf27('0x30')](_[_0xaf27('0x3a')](_0x4d804d['query'],_0x58ae63[_0xaf27('0x30')]),_0x51b12c);if(_0x4d804d[_0xaf27('0x2e')][_0xaf27('0x3b')]){_0x1cc39e[_0xaf27('0x39')]=_[_0xaf27('0x3c')](_0x1cc39e[_0xaf27('0x39')],{'$or':_[_0xaf27('0x29')](_0x51b12c,function(_0x157b77){if(_0x157b77[_0xaf27('0x3d')]!==_0xaf27('0x3e')){var _0x55cbcd={};_0x55cbcd[_0x157b77[_0xaf27('0x26')]]={'$like':'%'+_0x4d804d['query'][_0xaf27('0x3b')]+'%'};return _0x55cbcd;}})});}_0x1cc39e=_[_0xaf27('0x3c')]({},_0x1cc39e,_0x4d804d[_0xaf27('0x3f')]);var _0x7813e7={'where':_0x1cc39e[_0xaf27('0x39')]};return db[_0xaf27('0x40')][_0xaf27('0x1d')](_0x7813e7)['then'](function(_0xed49e4){_0x21a18e[_0xaf27('0x1d')]=_0xed49e4;if(_0x4d804d['query']['includeAll']){_0x1cc39e[_0xaf27('0x41')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xaf27('0x42')](_0x1cc39e);})[_0xaf27('0x21')](function(_0xfa5fee){_0x21a18e['rows']=_0xfa5fee;return _0x21a18e;})[_0xaf27('0x21')](respondWithFilteredResult(_0x3c8efc,_0x1cc39e))[_0xaf27('0x43')](handleError(_0x3c8efc,null));};exports[_0xaf27('0x44')]=function(_0x42dd47,_0x28c494){var _0x14e457={'raw':!![],'where':{'id':_0x42dd47[_0xaf27('0x45')]['id']}},_0x4a5f25={};_0x4a5f25[_0xaf27('0x2d')]=_[_0xaf27('0x2f')](db[_0xaf27('0x40')][_0xaf27('0x2a')]);_0x4a5f25[_0xaf27('0x2e')]=_['keys'](_0x42dd47[_0xaf27('0x2e')]);_0x4a5f25[_0xaf27('0x30')]=_[_0xaf27('0x32')](_0x4a5f25[_0xaf27('0x2d')],_0x4a5f25[_0xaf27('0x2e')]);_0x14e457[_0xaf27('0x31')]=_['intersection'](_0x4a5f25['model'],qs[_0xaf27('0x33')](_0x42dd47[_0xaf27('0x2e')][_0xaf27('0x33')]));_0x14e457[_0xaf27('0x31')]=_0x14e457['attributes'][_0xaf27('0x34')]?_0x14e457[_0xaf27('0x31')]:_0x4a5f25[_0xaf27('0x2d')];if(_0x42dd47['query'][_0xaf27('0x46')]){_0x14e457[_0xaf27('0x41')]=[{'all':!![]}];}_0x14e457=_[_0xaf27('0x3c')]({},_0x14e457,_0x42dd47['options']);return db[_0xaf27('0x40')][_0xaf27('0x47')](_0x14e457)[_0xaf27('0x21')](handleEntityNotFound(_0x28c494,null))[_0xaf27('0x21')](respondWithResult(_0x28c494,null))[_0xaf27('0x43')](handleError(_0x28c494,null));};exports[_0xaf27('0x48')]=function(_0x6e5961,_0x5882b2){return db[_0xaf27('0x40')][_0xaf27('0x48')](_0x6e5961['body'],{})['then'](respondWithResult(_0x5882b2,0xc9))['catch'](handleError(_0x5882b2,null));};exports[_0xaf27('0x49')]=function(_0x462d9d,_0x5346eb){if(_0x462d9d['body']['id']){delete _0x462d9d[_0xaf27('0x4a')]['id'];}return db[_0xaf27('0x40')][_0xaf27('0x47')]({'where':{'id':_0x462d9d[_0xaf27('0x45')]['id']}})['then'](handleEntityNotFound(_0x5346eb,null))['then'](saveUpdates(_0x462d9d['body'],null))[_0xaf27('0x21')](respondWithResult(_0x5346eb,null))['catch'](handleError(_0x5346eb,null));};exports[_0xaf27('0x22')]=function(_0x27360b,_0x292637){return db['OpenchannelApplication']['find']({'where':{'id':_0x27360b[_0xaf27('0x45')]['id']}})[_0xaf27('0x21')](handleEntityNotFound(_0x292637,null))[_0xaf27('0x21')](removeEntity(_0x292637,null))[_0xaf27('0x43')](handleError(_0x292637,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 3e5a362..11b2838 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 _0x2f0f=['openchannel_applications','utf8mb4_unicode_ci','util','api','moment','path','rimraf','../../config/environment','./openchannelApplication.attributes','define','OpenchannelApplication'];(function(_0x4a659b,_0x5addd7){var _0x43cf16=function(_0xd9c620){while(--_0xd9c620){_0x4a659b['push'](_0x4a659b['shift']());}};_0x43cf16(++_0x5addd7);}(_0x2f0f,0x14c));var _0xf2f0=function(_0x405fe8,_0xa55e2f){_0x405fe8=_0x405fe8-0x0;var _0x50e490=_0x2f0f[_0x405fe8];return _0x50e490;};'use strict';var _=require('lodash');var util=require(_0xf2f0('0x0'));var logger=require('../../config/logger')(_0xf2f0('0x1'));var moment=require(_0xf2f0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2f0('0x3'));var rimraf=require(_0xf2f0('0x4'));var config=require(_0xf2f0('0x5'));var attributes=require(_0xf2f0('0x6'));module['exports']=function(_0x47abfd,_0x4a2657){return _0x47abfd[_0xf2f0('0x7')](_0xf2f0('0x8'),attributes,{'tableName':_0xf2f0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf2f0('0xa')});}; \ No newline at end of file +var _0xe2b3=['define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0xe2b3,0x198));var _0x3e2b=function(_0x72222d,_0x270476){_0x72222d=_0x72222d-0x0;var _0x36a7f8=_0xe2b3[_0x72222d];return _0x36a7f8;};'use strict';var _=require('lodash');var util=require(_0x3e2b('0x0'));var logger=require(_0x3e2b('0x1'))(_0x3e2b('0x2'));var moment=require('moment');var BPromise=require(_0x3e2b('0x3'));var rp=require(_0x3e2b('0x4'));var fs=require('fs');var path=require(_0x3e2b('0x5'));var rimraf=require(_0x3e2b('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x3e2b('0x7')]=function(_0x497978,_0x28a8ea){return _0x497978[_0x3e2b('0x8')](_0x3e2b('0x9'),attributes,{'tableName':_0x3e2b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e2b('0xb'),'collate':_0x3e2b('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 5132752..326d2b3 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 _0xe262=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','OpenchannelApplication,\x20%s,\x20%s','result','UpdateOpenchannelApplication','OpenchannelApplication','options','raw','attributes','limit','stringify'];(function(_0x31b3fb,_0x2198a1){var _0xa78a23=function(_0x1b5bbd){while(--_0x1b5bbd){_0x31b3fb['push'](_0x31b3fb['shift']());}};_0xa78a23(++_0x2198a1);}(_0xe262,0xfd));var _0x2e26=function(_0xbce18b,_0x4a4c53){_0xbce18b=_0xbce18b-0x0;var _0x196b87=_0xe262[_0xbce18b];return _0x196b87;};'use strict';var _=require(_0x2e26('0x0'));var util=require('util');var moment=require(_0x2e26('0x1'));var BPromise=require('bluebird');var rs=require(_0x2e26('0x2'));var fs=require('fs');var Redis=require(_0x2e26('0x3'));var db=require(_0x2e26('0x4'))['db'];var utils=require(_0x2e26('0x5'));var logger=require(_0x2e26('0x6'))(_0x2e26('0x7'));var config=require('../../config/environment');var jayson=require(_0x2e26('0x8'));var client=jayson['client'][_0x2e26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x419ddf,_0x3b3037,_0x1d3271){return new BPromise(function(_0x429174,_0x10f116){return client[_0x2e26('0xa')](_0x419ddf,_0x1d3271)[_0x2e26('0xb')](function(_0x458ff1){logger[_0x2e26('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x3b3037,'request\x20sent');logger[_0x2e26('0xd')](_0x2e26('0xe'),_0x3b3037,_0x2e26('0xf'),JSON['stringify'](_0x458ff1));if(_0x458ff1[_0x2e26('0x10')]){if(_0x458ff1['error']['code']===0x1f4){logger[_0x2e26('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x3b3037,_0x458ff1[_0x2e26('0x10')][_0x2e26('0x11')]);return _0x10f116(_0x458ff1['error'][_0x2e26('0x11')]);}logger[_0x2e26('0x10')](_0x2e26('0x12'),_0x3b3037,_0x458ff1[_0x2e26('0x10')][_0x2e26('0x11')]);return _0x429174(_0x458ff1['error']['message']);}else{logger[_0x2e26('0xc')](_0x2e26('0x12'),_0x3b3037,'request\x20sent');_0x429174(_0x458ff1[_0x2e26('0x13')]['message']);}})['catch'](function(_0x5c036d){logger[_0x2e26('0x10')](_0x2e26('0x12'),_0x3b3037,_0x5c036d);_0x10f116(_0x5c036d);});});}exports[_0x2e26('0x14')]=function(_0x5ce3f){var _0x5a1a68=this;return new Promise(function(_0xccbb76,_0x10ca34){return db[_0x2e26('0x15')]['update'](_0x5ce3f['body'],{'raw':_0x5ce3f[_0x2e26('0x16')]?_0x5ce3f[_0x2e26('0x16')][_0x2e26('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ce3f[_0x2e26('0x16')]?_0x5ce3f[_0x2e26('0x16')]['where']||null:null,'attributes':_0x5ce3f[_0x2e26('0x16')]?_0x5ce3f[_0x2e26('0x16')][_0x2e26('0x18')]||null:null,'limit':_0x5ce3f[_0x2e26('0x16')]?_0x5ce3f[_0x2e26('0x16')][_0x2e26('0x19')]||null:null})[_0x2e26('0xb')](function(_0x2a457c){logger[_0x2e26('0xc')](_0x2e26('0x14'),_0x5ce3f);logger['debug'](_0x2e26('0x14'),_0x5ce3f,JSON[_0x2e26('0x1a')](_0x2a457c));_0xccbb76(_0x2a457c);})[_0x2e26('0x1b')](function(_0x54af44){logger[_0x2e26('0x10')]('UpdateOpenchannelApplication',_0x54af44['message'],_0x5ce3f);_0x10ca34(_0x5a1a68[_0x2e26('0x10')](0x1f4,_0x54af44[_0x2e26('0x11')]));});});}; \ No newline at end of file +var _0x3a9a=['OpenchannelApplication,\x20%s,\x20%s','result','catch','UpdateOpenchannelApplication','update','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x49eb3f,_0x125b9c){var _0x206ece=function(_0x53572f){while(--_0x53572f){_0x49eb3f['push'](_0x49eb3f['shift']());}};_0x206ece(++_0x125b9c);}(_0x3a9a,0x122));var _0xa3a9=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x3a9a[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0xa3a9('0x0'));var util=require(_0xa3a9('0x1'));var moment=require(_0xa3a9('0x2'));var BPromise=require(_0xa3a9('0x3'));var rs=require(_0xa3a9('0x4'));var fs=require('fs');var Redis=require(_0xa3a9('0x5'));var db=require(_0xa3a9('0x6'))['db'];var utils=require(_0xa3a9('0x7'));var logger=require(_0xa3a9('0x8'))(_0xa3a9('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa3a9('0xa')][_0xa3a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f3b90,_0x378b7c,_0x4c8eed){return new BPromise(function(_0x5cbb3d,_0x178bee){return client['request'](_0x1f3b90,_0x4c8eed)['then'](function(_0x596e50){logger[_0xa3a9('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x378b7c,_0xa3a9('0xd'));logger[_0xa3a9('0xe')](_0xa3a9('0xf'),_0x378b7c,_0xa3a9('0xd'),JSON[_0xa3a9('0x10')](_0x596e50));if(_0x596e50[_0xa3a9('0x11')]){if(_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x12')]===0x1f4){logger[_0xa3a9('0x11')]('OpenchannelApplication,\x20%s,\x20%s',_0x378b7c,_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x13')]);return _0x178bee(_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x13')]);}logger[_0xa3a9('0x11')](_0xa3a9('0x14'),_0x378b7c,_0x596e50[_0xa3a9('0x11')][_0xa3a9('0x13')]);return _0x5cbb3d(_0x596e50[_0xa3a9('0x11')]['message']);}else{logger[_0xa3a9('0xc')](_0xa3a9('0x14'),_0x378b7c,_0xa3a9('0xd'));_0x5cbb3d(_0x596e50[_0xa3a9('0x15')][_0xa3a9('0x13')]);}})[_0xa3a9('0x16')](function(_0x1ae6e0){logger['error'](_0xa3a9('0x14'),_0x378b7c,_0x1ae6e0);_0x178bee(_0x1ae6e0);});});}exports[_0xa3a9('0x17')]=function(_0x5cd616){var _0x46dd04=this;return new Promise(function(_0x19b05e,_0x3afa08){return db['OpenchannelApplication'][_0xa3a9('0x18')](_0x5cd616[_0xa3a9('0x19')],{'raw':_0x5cd616[_0xa3a9('0x1a')]?_0x5cd616[_0xa3a9('0x1a')][_0xa3a9('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd616['options']?_0x5cd616[_0xa3a9('0x1a')][_0xa3a9('0x1c')]||null:null,'attributes':_0x5cd616['options']?_0x5cd616['options'][_0xa3a9('0x1d')]||null:null,'limit':_0x5cd616[_0xa3a9('0x1a')]?_0x5cd616[_0xa3a9('0x1a')][_0xa3a9('0x1e')]||null:null})['then'](function(_0x2458a8){logger[_0xa3a9('0xc')](_0xa3a9('0x17'),_0x5cd616);logger[_0xa3a9('0xe')](_0xa3a9('0x17'),_0x5cd616,JSON[_0xa3a9('0x10')](_0x2458a8));_0x19b05e(_0x2458a8);})[_0xa3a9('0x16')](function(_0x380ab4){logger['error']('UpdateOpenchannelApplication',_0x380ab4[_0xa3a9('0x13')],_0x5cd616);_0x3afa08(_0x46dd04['error'](0x1f4,_0x380ab4[_0xa3a9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 0b14030..92646e2 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 _0x4500=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','isAuthenticated','get','/describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/tags','tracked','openchannel','addTags','put','openchannelinteraction:update','delete','removeTags','exports'];(function(_0x24fe73,_0x12a36b){var _0x1b8d64=function(_0x5a8c39){while(--_0x5a8c39){_0x24fe73['push'](_0x24fe73['shift']());}};_0x1b8d64(++_0x12a36b);}(_0x4500,0xfc));var _0x0450=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0x4500[_0x1551af];return _0xd8eb82;};'use strict';var multer=require(_0x0450('0x0'));var util=require(_0x0450('0x1'));var path=require('path');var timeout=require(_0x0450('0x2'));var express=require(_0x0450('0x3'));var router=express[_0x0450('0x4')]();var fs_extra=require(_0x0450('0x5'));var auth=require(_0x0450('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0450('0x7'));var controller=require(_0x0450('0x8'));router['get']('/',auth[_0x0450('0x9')](),controller['index']);router[_0x0450('0xa')](_0x0450('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x0450('0xa')](_0x0450('0xc'),auth['isAuthenticated'](),controller[_0x0450('0xd')]);router[_0x0450('0xa')]('/:id/messages',auth[_0x0450('0x9')](),controller[_0x0450('0xe')]);router[_0x0450('0xa')](_0x0450('0xf'),auth['isAuthenticated'](),controller[_0x0450('0x10')]);router[_0x0450('0x11')]('/',auth[_0x0450('0x9')](),controller[_0x0450('0x12')]);router[_0x0450('0x11')]('/:id/messages',auth[_0x0450('0x9')](),controller['addMessage']);router['post'](_0x0450('0x13'),auth[_0x0450('0x9')](),interaction[_0x0450('0x14')](_0x0450('0x15'),'openchannelinteraction:addtags'),controller[_0x0450('0x16')]);router[_0x0450('0x17')](_0x0450('0xc'),auth[_0x0450('0x9')](),interaction['tracked']('openchannel',_0x0450('0x18')),controller['update']);router[_0x0450('0x19')](_0x0450('0xc'),auth[_0x0450('0x9')](),interaction['tracked'](_0x0450('0x15'),'openchannelinteraction:destroy'),controller['destroy']);router[_0x0450('0x19')](_0x0450('0x13'),auth[_0x0450('0x9')](),controller[_0x0450('0x1a')]);module[_0x0450('0x1b')]=router; \ No newline at end of file +var _0x5a4e=['destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','index','get','/describe','isAuthenticated','/:id','download','post','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','delete','openchannelinteraction:destroy'];(function(_0x3b0209,_0x29d212){var _0x581f6e=function(_0x231f33){while(--_0x231f33){_0x3b0209['push'](_0x3b0209['shift']());}};_0x581f6e(++_0x29d212);}(_0x5a4e,0xc7));var _0xe5a4=function(_0x4ba3c4,_0x24842d){_0x4ba3c4=_0x4ba3c4-0x0;var _0x2b6605=_0x5a4e[_0x4ba3c4];return _0x2b6605;};'use strict';var multer=require(_0xe5a4('0x0'));var util=require(_0xe5a4('0x1'));var path=require(_0xe5a4('0x2'));var timeout=require(_0xe5a4('0x3'));var express=require('express');var router=express[_0xe5a4('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe5a4('0x5'));var config=require(_0xe5a4('0x6'));var controller=require(_0xe5a4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe5a4('0x8')]);router[_0xe5a4('0x9')](_0xe5a4('0xa'),auth[_0xe5a4('0xb')](),controller['describe']);router[_0xe5a4('0x9')](_0xe5a4('0xc'),auth[_0xe5a4('0xb')](),controller['show']);router[_0xe5a4('0x9')]('/:id/messages',auth[_0xe5a4('0xb')](),controller['getMessages']);router[_0xe5a4('0x9')]('/:id/download',auth[_0xe5a4('0xb')](),controller[_0xe5a4('0xd')]);router[_0xe5a4('0xe')]('/',auth[_0xe5a4('0xb')](),controller['create']);router[_0xe5a4('0xe')](_0xe5a4('0xf'),auth['isAuthenticated'](),controller[_0xe5a4('0x10')]);router['post'](_0xe5a4('0x11'),auth[_0xe5a4('0xb')](),interaction[_0xe5a4('0x12')](_0xe5a4('0x13'),_0xe5a4('0x14')),controller[_0xe5a4('0x15')]);router['put'](_0xe5a4('0xc'),auth['isAuthenticated'](),interaction[_0xe5a4('0x12')](_0xe5a4('0x13'),_0xe5a4('0x16')),controller['update']);router[_0xe5a4('0x17')](_0xe5a4('0xc'),auth['isAuthenticated'](),interaction['tracked']('openchannel',_0xe5a4('0x18')),controller[_0xe5a4('0x19')]);router[_0xe5a4('0x17')](_0xe5a4('0x11'),auth['isAuthenticated'](),controller[_0xe5a4('0x1a')]);module[_0xe5a4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4cf84e4..0f1b398 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 _0x535f=['ENUM','out','BOOLEAN','DATE','STRING'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x535f,0x160));var _0xf535=function(_0x3d14c4,_0x38fe09){_0x3d14c4=_0x3d14c4-0x0;var _0x54bd61=_0x535f[_0x3d14c4];return _0x54bd61;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xf535('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf535('0x1')]},'disposition':{'type':Sequelize[_0xf535('0x2')]},'secondDisposition':{'type':Sequelize[_0xf535('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf535('0x2')]},'note':{'type':Sequelize[_0xf535('0x2')]},'read1stAt':{'type':Sequelize[_0xf535('0x1')]},'threadId':{'type':Sequelize[_0xf535('0x2')]},'externalUrl':{'type':Sequelize[_0xf535('0x2')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xf535('0x3')]('in',_0xf535('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf535('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0xf535('0x0')],'defaultValue':![]}}; \ No newline at end of file +var _0xb0b4=['out','BOOLEAN','sequelize','DATE','STRING','ENUM'];(function(_0x484e74,_0x4e62bd){var _0x2874fa=function(_0x6c79dd){while(--_0x6c79dd){_0x484e74['push'](_0x484e74['shift']());}};_0x2874fa(++_0x4e62bd);}(_0xb0b4,0xb6));var _0x4b0b=function(_0x5aad6b,_0x2cd875){_0x5aad6b=_0x5aad6b-0x0;var _0x11654b=_0xb0b4[_0x5aad6b];return _0x11654b;};'use strict';var Sequelize=require(_0x4b0b('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4b0b('0x1')]},'disposition':{'type':Sequelize[_0x4b0b('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4b0b('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4b0b('0x1')]},'threadId':{'type':Sequelize[_0x4b0b('0x2')]},'externalUrl':{'type':Sequelize[_0x4b0b('0x2')]},'lastMsgAt':{'type':Sequelize[_0x4b0b('0x1')]},'lastMsgDirection':{'type':Sequelize[_0x4b0b('0x3')]('in',_0x4b0b('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4b0b('0x2')]},'autoreplyExecuted':{'type':Sequelize[_0x4b0b('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index e46814e..5590d49 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 _0x74ee=['undefined','limit','set','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','cm_contacts','openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','compact','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','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','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','show','params','include','create','catch','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','emit','openchannelInteractionTags:save','removeTags','download','unix','root','tmp','server','files','attachments','transcript-%d-%s.zip','join','CmContact','Contact','firstName','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','closedAt','format','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','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','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','json','offset'];(function(_0x257f5e,_0x2437a5){var _0x1c24c1=function(_0x54868b){while(--_0x54868b){_0x257f5e['push'](_0x257f5e['shift']());}};_0x1c24c1(++_0x2437a5);}(_0x74ee,0x1c8));var _0xe74e=function(_0x3ddc23,_0x23c648){_0x3ddc23=_0x3ddc23-0x0;var _0x5d1848=_0x74ee[_0x3ddc23];return _0x5d1848;};'use strict';var emlformat=require(_0xe74e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe74e('0x1'));var jsonpatch=require(_0xe74e('0x2'));var rp=require(_0xe74e('0x3'));var moment=require(_0xe74e('0x4'));var BPromise=require(_0xe74e('0x5'));var Mustache=require(_0xe74e('0x6'));var util=require(_0xe74e('0x7'));var path=require(_0xe74e('0x8'));var sox=require('sox');var csv=require(_0xe74e('0x9'));var ejs=require(_0xe74e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe74e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe74e('0xc'));var deskjs=require(_0xe74e('0xd'));var toCsv=require(_0xe74e('0x9'));var querystring=require(_0xe74e('0xe'));var Papa=require(_0xe74e('0xf'));var Redis=require(_0xe74e('0x10'));var authService=require(_0xe74e('0x11'));var qs=require(_0xe74e('0x12'));var as=require(_0xe74e('0x13'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0xe74e('0x14'));var logger=require(_0xe74e('0x15'))('api');var utils=require(_0xe74e('0x16'));var config=require(_0xe74e('0x17'));var licenseUtil=require(_0xe74e('0x18'));var db=require(_0xe74e('0x19'))['db'];config[_0xe74e('0x1a')]=_['defaults'](config[_0xe74e('0x1a')],{'host':_0xe74e('0x1b'),'port':0x18eb});var socket=require(_0xe74e('0x1c'))(new Redis(config[_0xe74e('0x1a')]));require(_0xe74e('0x1d'))[_0xe74e('0x1e')](socket);function respondWithStatusCode(_0x513940,_0x382a46){_0x382a46=_0x382a46||0xcc;return function(_0x1e4d37){if(_0x1e4d37){return _0x513940['sendStatus'](_0x382a46);}return _0x513940[_0xe74e('0x1f')](_0x382a46)['end']();};}function respondWithResult(_0x184ac9,_0xf8e3f6){_0xf8e3f6=_0xf8e3f6||0xc8;return function(_0x30666e){if(_0x30666e){return _0x184ac9[_0xe74e('0x1f')](_0xf8e3f6)[_0xe74e('0x20')](_0x30666e);}};}function respondWithFilteredResult(_0x32c267,_0x242eb8){return function(_0x33d053){if(_0x33d053){var _0x213b99=typeof _0x242eb8[_0xe74e('0x21')]===_0xe74e('0x22')&&typeof _0x242eb8[_0xe74e('0x23')]==='undefined';var _0x4ceb6c=_0x33d053['count'];var _0x172c1e=_0x213b99?0x0:_0x242eb8[_0xe74e('0x21')];var _0x5f315c=_0x213b99?_0x33d053['count']:_0x242eb8[_0xe74e('0x21')]+_0x242eb8[_0xe74e('0x23')];var _0x52a2cf;if(_0x5f315c>=_0x4ceb6c){_0x5f315c=_0x4ceb6c;_0x52a2cf=0xc8;}else{_0x52a2cf=0xce;}_0x32c267['status'](_0x52a2cf);return _0x32c267[_0xe74e('0x24')]('Content-Range',_0x172c1e+'-'+_0x5f315c+'/'+_0x4ceb6c)[_0xe74e('0x20')](_0x33d053);}return null;};}function patchUpdates(_0x3b3b2c){return function(_0x1651f7){try{jsonpatch['apply'](_0x1651f7,_0x3b3b2c,!![]);}catch(_0x2478ce){return BPromise[_0xe74e('0x25')](_0x2478ce);}return _0x1651f7[_0xe74e('0x26')]();};}function saveUpdates(_0x557498,_0x523ccc){return function(_0x203aac){if(_0x203aac){return _0x203aac[_0xe74e('0x27')](_0x557498)['then'](function(_0x1fa009){return _0x1fa009;});}return null;};}function removeEntity(_0x1e8c40,_0x1dad40){return function(_0x39504b){if(_0x39504b){return _0x39504b[_0xe74e('0x28')]()[_0xe74e('0x29')](function(){_0x1e8c40[_0xe74e('0x1f')](0xcc)[_0xe74e('0x2a')]();});}};}function handleEntityNotFound(_0x14e5e4,_0x189cbb){return function(_0x1ff0f5){if(!_0x1ff0f5){_0x14e5e4[_0xe74e('0x2b')](0x194);}return _0x1ff0f5;};}function handleError(_0x8961f4,_0x21ffcf){_0x21ffcf=_0x21ffcf||0x1f4;return function(_0x4f0385){logger[_0xe74e('0x2c')](_0x4f0385[_0xe74e('0x2d')]);if(_0x4f0385['name']){delete _0x4f0385[_0xe74e('0x2e')];}_0x8961f4[_0xe74e('0x1f')](_0x21ffcf)[_0xe74e('0x2f')](_0x4f0385);};}function getInteractionUsers(_0x4a0ee8,_0x424ef4){return new BPromise(function(_0x80ba3b,_0x4cfe89){try{if(_0x424ef4[_0x4a0ee8['id']]){_0x4a0ee8[_0xe74e('0x30')]=_[_0xe74e('0x31')](_0x424ef4[_0x4a0ee8['id']],function(_0x3cfcfe){return{'id':_0x3cfcfe['id'],'fullname':_0x3cfcfe[_0xe74e('0x32')]};});}}catch(_0x5c1d6f){_0x4cfe89(_0x5c1d6f);}_0x80ba3b(_0x4a0ee8);});}function getInteractionTags(_0x428146,_0x126eba){return new BPromise(function(_0xe1f2f5,_0x1b4f69){try{if(_0x428146[_0xe74e('0x33')]){_0x428146[_0xe74e('0x34')]=[];_0x428146[_0xe74e('0x33')][_0xe74e('0x35')](',')[_0xe74e('0x36')](function(_0x36c8c2){_0x428146['Tags']['push'](_0x126eba[_0x36c8c2]);});}delete _0x428146[_0xe74e('0x33')];}catch(_0x2597b1){_0x1b4f69(_0x2597b1);}_0xe1f2f5(_0x428146);});}function updateOpenchannelInteraction(_0x499587,_0x53a676,_0x2974c7){return new BPromise(function(_0x29381f,_0x11bd54){return getInteractionUsers(_0x499587,_0x2974c7)[_0xe74e('0x29')](function(_0x4181ce){return getInteractionTags(_0x4181ce,_0x53a676);})['then'](function(_0x369da2){_0x29381f(_0x369da2);})['catch'](function(_0x5627c0){_0x11bd54(_0x5627c0);});});}exports[_0xe74e('0x37')]=function(_0x378cba,_0x52e2df){var _0x260ad3={},_0x3b8e86={},_0x537dc9={'count':0x0,'rows':[]};var _0x24c204=_['map'](db[_0xe74e('0x38')][_0xe74e('0x39')],function(_0x1ef4ec){return{'name':_0x1ef4ec[_0xe74e('0x3a')],'type':_0x1ef4ec[_0xe74e('0x3b')][_0xe74e('0x3c')]};});_0x3b8e86[_0xe74e('0x3d')]=_[_0xe74e('0x31')](_0x24c204,_0xe74e('0x2e'));_0x3b8e86[_0xe74e('0x3e')]=_['keys'](_0x378cba[_0xe74e('0x3e')]);_0x3b8e86[_0xe74e('0x3f')]=_[_0xe74e('0x40')](_0x3b8e86['model'],_0x3b8e86[_0xe74e('0x3e')]);_0x260ad3['attributes']=_[_0xe74e('0x40')](_0x3b8e86['model'],qs[_0xe74e('0x41')](_0x378cba['query'][_0xe74e('0x41')]));_0x260ad3[_0xe74e('0x42')]=_0x260ad3['attributes'][_0xe74e('0x43')]?_0x260ad3[_0xe74e('0x42')]:_0x3b8e86[_0xe74e('0x3d')];if(!_0x378cba[_0xe74e('0x3e')][_0xe74e('0x44')](_0xe74e('0x45'))){_0x260ad3[_0xe74e('0x23')]=qs['limit'](_0x378cba[_0xe74e('0x3e')][_0xe74e('0x23')]);_0x260ad3['offset']=qs[_0xe74e('0x21')](_0x378cba[_0xe74e('0x3e')][_0xe74e('0x21')]);}_0x260ad3['order']=qs[_0xe74e('0x46')](_0x378cba[_0xe74e('0x3e')]['sort']);_0x260ad3['where']=qs[_0xe74e('0x3f')](_[_0xe74e('0x47')](_0x378cba[_0xe74e('0x3e')],_0x3b8e86['filters']),_0x24c204);var _0x22cc62=[];var _0x166687=squel['select']()[_0xe74e('0x48')]('id')[_0xe74e('0x48')](_0xe74e('0x2e'))[_0xe74e('0x48')](_0xe74e('0x49'))[_0xe74e('0x4a')](_0xe74e('0x4b'));var _0x3c998c=squel['select']()['field']('u.id')[_0xe74e('0x48')](_0xe74e('0x4c'))[_0xe74e('0x48')](_0xe74e('0x4d'))['from'](_0xe74e('0x4e'),'ui')[_0xe74e('0x4f')](_0xe74e('0x50'),'u',_0xe74e('0x51'));var _0x5a8a49=squel[_0xe74e('0x52')]()['from'](_0xe74e('0x53'),'i')['left_join'](_0xe74e('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xe74e('0x4f')](_0xe74e('0x50'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xe74e('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xe74e('0x4f')](_0xe74e('0x56'),'me',_0xe74e('0x57'))['left_join'](_0xe74e('0x58'),'it',_0xe74e('0x59'))[_0xe74e('0x4f')](_0xe74e('0x4b'),'t',_0xe74e('0x5a'));var _0x4b42db=squel['expr']();var _0x4e27b9=[];var _0x4aea6c=squel[_0xe74e('0x5b')]();var _0x5a989d;if(_0x378cba[_0xe74e('0x3e')]['search']){_0x5a989d=as[_0xe74e('0x5c')](_0x378cba[_0xe74e('0x3e')][_0xe74e('0x5d')]);var _0x16f909=_0x5a989d[_0xe74e('0x5e')];for(var _0x255b57=0x0;_0x255b57<_0x5a989d[_0xe74e('0x5f')][_0xe74e('0x43')];_0x255b57++){var _0x10a1ab=_0x5a989d[_0xe74e('0x5f')][_0x255b57];var _0x56c868='i';var _0x41a3d3=_[_0xe74e('0x60')](_0x24c204,[_0xe74e('0x2e'),_0x10a1ab['field']]);if(!_0x41a3d3){switch(_0x10a1ab['field']){case _0xe74e('0x61'):if(_0x10a1ab[_0xe74e('0x62')]==0x1){_0x5a8a49[_0xe74e('0x63')]('`'+_0x10a1ab[_0xe74e('0x48')]+_0xe74e('0x64'));}else{_0x5a8a49[_0xe74e('0x63')]('`'+_0x10a1ab[_0xe74e('0x48')]+_0xe74e('0x65'));}break;case'Contact':if(_0x10a1ab[_0xe74e('0x66')]===_0xe74e('0x67')){if(_0x10a1ab[_0xe74e('0x62')][_0xe74e('0x35')]('\x20')[_0xe74e('0x43')]>0x1){_0x4b42db[_0x16f909](_0xe74e('0x68'),qs['getFullTextValue'](_0x10a1ab[_0xe74e('0x62')]),null);}else{var _0x455420='%'+_0x10a1ab[_0xe74e('0x62')]+'%';_0x4b42db[_0x16f909](_0xe74e('0x69'),_0x455420,_0x455420,_0x455420);}}else{_0x41a3d3=_[_0xe74e('0x60')](_0x24c204,[_0xe74e('0x2e'),_0xe74e('0x6a')]);_0x10a1ab[_0xe74e('0x48')]=_0xe74e('0x6a');_0x1de984=as[_0xe74e('0x6b')](_0x56c868,_0x41a3d3[_0xe74e('0x3b')],_0x10a1ab);_0x4b42db[_0x16f909](_0x1de984[_0xe74e('0x6c')],_0x1de984['value'][_0xe74e('0x6d')],_0x1de984[_0xe74e('0x62')]['end']);}break;case _0xe74e('0x6e'):var _0x4a4edd=_0x10a1ab[_0xe74e('0x62')][_0xe74e('0x35')](',')['map'](function(_0xd07857){return Number(_0xd07857);});_0x4a4edd['forEach'](function(_0x3ffa68){_0x4aea6c['or'](_0xe74e('0x6f'),'%,'+_0x3ffa68+',%');});_0x4e27b9=_[_0xe74e('0x70')](_0x4e27b9,_0x4a4edd);break;case _0xe74e('0x71'):if(_0x10a1ab[_0xe74e('0x66')]===_0xe74e('0x67')){_0x4b42db[_0x16f909](_0xe74e('0x72'),'%'+_0x10a1ab[_0xe74e('0x62')]+'%',null);}else{_0x41a3d3=_[_0xe74e('0x60')](_0x24c204,['name',_0xe74e('0x73')]);_0x10a1ab['field']='UserId';_0x1de984=as[_0xe74e('0x6b')](_0x56c868,_0x41a3d3[_0xe74e('0x3b')],_0x10a1ab);_0x4b42db[_0x16f909](_0x1de984[_0xe74e('0x6c')],_0x1de984[_0xe74e('0x62')]['start'],_0x1de984[_0xe74e('0x62')][_0xe74e('0x2a')]);}break;case _0xe74e('0x74'):_0x1de984=as['buildExpression']('me',null,_0x10a1ab);_0x4b42db[_0x16f909](_0x1de984[_0xe74e('0x6c')],_0x1de984[_0xe74e('0x62')][_0xe74e('0x6d')],_0x1de984[_0xe74e('0x62')][_0xe74e('0x2a')]);break;}}else{var _0x1de984=as['buildExpression'](_0x56c868,_0x41a3d3[_0xe74e('0x3b')],_0x10a1ab);_0x4b42db[_0x16f909](_0x1de984['text'],_0x1de984['value']['start'],_0x1de984[_0xe74e('0x62')][_0xe74e('0x2a')]);}}}else{var _0x5cf14e=_(_0x378cba[_0xe74e('0x3e')])[_0xe74e('0x75')]()[_0xe74e('0x31')](function(_0x54bb08){return _['some'](_0x24c204,[_0xe74e('0x2e'),_0x54bb08])?_0x54bb08:undefined;})[_0xe74e('0x76')]()[_0xe74e('0x62')]();if(!_['isEmpty'](_0x5cf14e)){_0x5cf14e[_0xe74e('0x36')](function(_0x2be3d4){if(_0x2be3d4===_0xe74e('0x77')){_0x5a8a49[_0xe74e('0x78')](_0xe74e('0x79'),[]['concat'](_0x378cba[_0xe74e('0x3e')][_0x2be3d4]));}else if(_0x2be3d4===_0xe74e('0x7a')){var _0x5f3e55=JSON[_0xe74e('0x7b')](_0x378cba[_0xe74e('0x3e')][_0x2be3d4])[_0xe74e('0x7c')];var _0x41c030=JSON[_0xe74e('0x7b')](_0x378cba[_0xe74e('0x3e')][_0x2be3d4])[_0xe74e('0x7d')];_0x5a8a49[_0xe74e('0x78')](_0xe74e('0x7e'),_0x5f3e55,_0x41c030);}else{if(_0x378cba[_0xe74e('0x3e')][_0x2be3d4]===_0xe74e('0x7f')){_0x5a8a49[_0xe74e('0x78')]('i.'+_0x2be3d4+_0xe74e('0x80'));}else{_0x5a8a49['where']('i.'+_0x2be3d4+_0xe74e('0x81'),_0x378cba[_0xe74e('0x3e')][_0x2be3d4]);}}});}if(_0x378cba[_0xe74e('0x3e')][_0xe74e('0x82')]){if(_0x378cba[_0xe74e('0x3e')]['read']==0x1){_0x5a8a49[_0xe74e('0x63')](_0xe74e('0x83'));}else{_0x5a8a49['having'](_0xe74e('0x84'));}}if(_0x378cba[_0xe74e('0x3e')][_0xe74e('0x85')]){_0x4e27b9=_[_0xe74e('0x86')](_0x378cba['query']['tag'])?_0x378cba[_0xe74e('0x3e')][_0xe74e('0x85')]:new Array(_0x378cba[_0xe74e('0x3e')][_0xe74e('0x85')]);_0x4e27b9[_0xe74e('0x36')](function(_0x24ba05){_0x4aea6c['or'](_0xe74e('0x6f'),'%,'+_0x24ba05+',%');});}if(_0x378cba[_0xe74e('0x3e')][_0xe74e('0x87')]){var _0x7d9313=_0x378cba[_0xe74e('0x3e')][_0xe74e('0x87')][_0xe74e('0x88')]('\x5c','\x5c\x5c')[_0xe74e('0x88')](/'/g,'\x27\x27');if(qs[_0xe74e('0x89')](_0x7d9313)){_0x4b42db['or'](_0xe74e('0x8a'),_0x7d9313+'%');}else{_0x4b42db['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe74e('0x8b')](_0x7d9313))['or'](_0xe74e('0x8c'),_0x7d9313+'%')['or'](_0xe74e('0x8d'),_0x7d9313+'%');}}}_0x5a8a49[_0xe74e('0x78')](_0x4b42db);_0x5a8a49[_0xe74e('0x8e')](_0xe74e('0x8f'));var _0x1e1db8={'type':db[_0xe74e('0x90')][_0xe74e('0x91')][_0xe74e('0x92')],'raw':!![]};var _0x397302=_0x5a8a49[_0xe74e('0x93')]();_0x397302['field'](_0xe74e('0x8f'));_0x397302['field'](_0xe74e('0x94'),'unreadMessages');if(_0x260ad3['order']){_0x260ad3[_0xe74e('0x95')][_0xe74e('0x36')](function(_0x4171e9){var _0x8930ea=_0x4171e9[0x0]===_0xe74e('0x96')?_0x4171e9[0x0]:'i.'+_0x4171e9[0x0];_0x5a8a49[_0xe74e('0x95')](_0x8930ea,_0x4171e9[0x1]===_0xe74e('0x97')?![]:!![]);});}if(!_[_0xe74e('0x98')](_0x4e27b9)){_0x5a8a49[_0xe74e('0x63')](_0x4aea6c);_0x397302['where']('t.id\x20IN\x20?',_0x4e27b9);}BPromise['resolve']()[_0xe74e('0x29')](function(){if(!_0x5a989d){if(_0x378cba[_0xe74e('0x3e')][_0xe74e('0x77')])return;_0x397302['where'](_0xe74e('0x99'));_0x5a8a49[_0xe74e('0x78')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x378cba[_0xe74e('0x9a')][_0xe74e('0x9b')]!==_0xe74e('0x9c'))return;return _0x378cba[_0xe74e('0x9a')][_0xe74e('0x9d')]({'attributes':['id'],'raw':!![]})[_0xe74e('0x29')](function(_0x5dd655){if(_['isEmpty'](_0x5dd655)){_0x397302[_0xe74e('0x78')](_0xe74e('0x9e'));_0x5a8a49['where'](_0xe74e('0x9e'));}else{_0x397302['where'](_0xe74e('0x79'),_[_0xe74e('0x31')](_0x5dd655,'id'));_0x5a8a49[_0xe74e('0x78')](_0xe74e('0x79'),_[_0xe74e('0x31')](_0x5dd655,'id'));}});})['then'](function(){if(_0x378cba['user'][_0xe74e('0x9b')]===_0xe74e('0x9c')&&!_0x5a989d&&!_0x378cba[_0xe74e('0x3e')][_0xe74e('0x77')])return[];return db[_0xe74e('0x9f')][_0xe74e('0x3e')](_0x397302[_0xe74e('0xa0')](),_0x1e1db8);})['then'](function(_0x25c0ba){_0x537dc9[_0xe74e('0xa1')]=_0x25c0ba[_0xe74e('0x43')];if(_0x537dc9[_0xe74e('0xa1')]===0x0)return[];return db[_0xe74e('0x9f')][_0xe74e('0x3e')](_0x166687[_0xe74e('0xa0')](),_0x1e1db8)[_0xe74e('0x29')](function(_0x2b9122){_0x22cc62=_[_0xe74e('0xa2')](_0x2b9122,'id');_0x1e1db8=_[_0xe74e('0xa3')](_0x1e1db8,{'model':db[_0xe74e('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x378cba[_0xe74e('0x3e')][_0xe74e('0x41')]){_0x260ad3[_0xe74e('0x42')]['forEach'](function(_0x18f51a){_0x5a8a49['field']('i.'+_0x18f51a);});}else{_0x5a8a49[_0xe74e('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x5a8a49[_0xe74e('0x48')]('a.key','Account.key');_0x5a8a49['field']('a.mandatoryDisposition',_0xe74e('0xa4'));_0x5a8a49[_0xe74e('0x48')](_0xe74e('0xa5'),'contactName');_0x5a8a49[_0xe74e('0x48')]('i.*');_0x5a8a49[_0xe74e('0x48')](_0xe74e('0xa6'),_0xe74e('0xa7'));_0x5a8a49['field'](_0xe74e('0xa8'),_0xe74e('0xa9'));_0x5a8a49[_0xe74e('0x48')]('c.email',_0xe74e('0xaa'));_0x5a8a49[_0xe74e('0x48')]('c.phone',_0xe74e('0xab'));_0x5a8a49['field'](_0xe74e('0xac'),'Contact.mobile');_0x5a8a49['field'](_0xe74e('0xad'),_0xe74e('0xae'));_0x5a8a49[_0xe74e('0x48')](_0xe74e('0xaf'),_0xe74e('0xb0'));_0x5a8a49['field']('o.internal',_0xe74e('0xb1'));_0x5a8a49[_0xe74e('0x48')](_0xe74e('0xb2'),_0xe74e('0x33'));}if(_0x260ad3['limit'])_0x5a8a49[_0xe74e('0x23')](_0x260ad3[_0xe74e('0x23')]);if(_0x260ad3[_0xe74e('0x21')])_0x5a8a49[_0xe74e('0x21')](_0x260ad3['offset']);return db['sequelize'][_0xe74e('0x3e')](_0x5a8a49[_0xe74e('0xa0')](),_0x1e1db8);})[_0xe74e('0x29')](function(_0x2a65e7){if(_0x2a65e7[_0xe74e('0x43')]>0x0)_0x3c998c['where'](_0xe74e('0xb3'),_[_0xe74e('0x31')](_0x2a65e7,'id'));return db[_0xe74e('0x9f')][_0xe74e('0x3e')](_0x3c998c[_0xe74e('0xa0')](),_0x1e1db8)[_0xe74e('0x29')](function(_0x4b8bda){var _0xb49a06=_[_0xe74e('0xb4')](_0x4b8bda,_0xe74e('0xb5'));var _0x845556=[];_0x2a65e7[_0xe74e('0x36')](function(_0x483897){_0x845556[_0xe74e('0xb6')](updateOpenchannelInteraction(_0x483897,_0x22cc62,_0xb49a06));});return BPromise[_0xe74e('0xb7')](_0x845556);});});})[_0xe74e('0x29')](function(_0x2025a2){_0x537dc9['rows']=_0x2025a2;return _0x537dc9;})['then'](respondWithFilteredResult(_0x52e2df,_0x260ad3))['catch'](handleError(_0x52e2df,null));};exports[_0xe74e('0xb8')]=function(_0x5268f4,_0x26d404){var _0x36c800={};if(_0x5268f4[_0xe74e('0x3e')][_0xe74e('0x3b')]&&_0x5268f4[_0xe74e('0x3e')][_0xe74e('0x3b')]==='from'){_0x36c800[_0xe74e('0x4a')]=_0x5268f4[_0xe74e('0xb9')]['id'];}else{_0x36c800['id']=_0x5268f4[_0xe74e('0xb9')]['id'];}var _0x38764e={'raw':![],'where':_0x36c800},_0x555316={};_0x555316['model']=_[_0xe74e('0x75')](db[_0xe74e('0x38')][_0xe74e('0x39')]);_0x555316[_0xe74e('0x3e')]=_['keys'](_0x5268f4[_0xe74e('0x3e')]);_0x555316['filters']=_[_0xe74e('0x40')](_0x555316['model'],_0x555316[_0xe74e('0x3e')]);_0x38764e[_0xe74e('0x42')]=_[_0xe74e('0x40')](_0x555316[_0xe74e('0x3d')],qs['fields'](_0x5268f4[_0xe74e('0x3e')]['fields']));_0x38764e['attributes']=_0x38764e[_0xe74e('0x42')][_0xe74e('0x43')]?_0x38764e[_0xe74e('0x42')]:_0x555316[_0xe74e('0x3d')];if(_0x5268f4['query']['includeAll']){_0x38764e[_0xe74e('0xba')]=[{'all':!![]}];}_0x38764e=_['merge']({},_0x38764e,_0x5268f4['options']);return db[_0xe74e('0x38')]['find'](_0x38764e)['then'](handleEntityNotFound(_0x26d404,null))[_0xe74e('0x29')](respondWithResult(_0x26d404,null))['catch'](handleError(_0x26d404,null));};exports['create']=function(_0x863139,_0x1c05da){return db[_0xe74e('0x38')][_0xe74e('0xbb')](_0x863139[_0xe74e('0x74')],{})[_0xe74e('0x29')](respondWithResult(_0x1c05da,0xc9))[_0xe74e('0xbc')](handleError(_0x1c05da,null));};exports[_0xe74e('0x27')]=function(_0xbadfdc,_0x4af1e2){if(_0xbadfdc[_0xe74e('0x74')]['id']){delete _0xbadfdc[_0xe74e('0x74')]['id'];}return db[_0xe74e('0x38')][_0xe74e('0x60')]({'where':{'id':_0xbadfdc[_0xe74e('0xb9')]['id']}})[_0xe74e('0x29')](handleEntityNotFound(_0x4af1e2,null))['then'](saveUpdates(_0xbadfdc[_0xe74e('0x74')],null))[_0xe74e('0x29')](respondWithResult(_0x4af1e2,null))['catch'](handleError(_0x4af1e2,null));};exports[_0xe74e('0x28')]=function(_0x265e3f,_0x225b02){return db[_0xe74e('0x38')]['find']({'where':{'id':_0x265e3f[_0xe74e('0xb9')]['id']}})[_0xe74e('0x29')](handleEntityNotFound(_0x225b02,null))['then'](removeEntity(_0x225b02,null))['catch'](handleError(_0x225b02,null));};exports[_0xe74e('0xbd')]=function(_0xa79170,_0x754e80){return db['OpenchannelInteraction'][_0xe74e('0xbd')]()[_0xe74e('0x29')](respondWithResult(_0x754e80,null))[_0xe74e('0xbc')](handleError(_0x754e80,null));};exports[_0xe74e('0xbe')]=function(_0xa43925,_0xc86918,_0x2732ad){return db['OpenchannelMessage'][_0xe74e('0x60')]({'where':{'id':_0xa43925['params']['id']}})[_0xe74e('0x29')](handleEntityNotFound(_0xc86918,null))[_0xe74e('0x29')](function(_0x4dadad){if(_0x4dadad){return _0x4dadad[_0xe74e('0xbe')](_0xa43925['body'][_0xe74e('0xbf')],_[_0xe74e('0xc0')](_0xa43925['body'],[_0xe74e('0xbf'),'id'])||{});}})[_0xe74e('0x29')](respondWithResult(_0xc86918,null))[_0xe74e('0xbc')](handleError(_0xc86918,null));};exports[_0xe74e('0xc1')]=function(_0x19cfe9,_0x16c1d5,_0x47d76e){var _0x4741fb={'raw':![],'where':{}};var _0x116de9={};var _0x5693b5={'count':0x0,'rows':[]};return db[_0xe74e('0x38')][_0xe74e('0xc2')]({'where':{'id':_0x19cfe9[_0xe74e('0xb9')]['id']}})[_0xe74e('0x29')](handleEntityNotFound(_0x16c1d5,null))['then'](function(_0x6437be){if(_0x6437be){_0x116de9[_0xe74e('0x3d')]=_[_0xe74e('0x75')](db[_0xe74e('0xc3')][_0xe74e('0x39')]);_0x116de9[_0xe74e('0x3e')]=_['keys'](_0x19cfe9[_0xe74e('0x3e')]);_0x116de9['filters']=_[_0xe74e('0x40')](_0x116de9[_0xe74e('0x3d')],_0x116de9[_0xe74e('0x3e')]);_0x4741fb[_0xe74e('0x42')]=_[_0xe74e('0x40')](_0x116de9[_0xe74e('0x3d')],qs[_0xe74e('0x41')](_0x19cfe9[_0xe74e('0x3e')][_0xe74e('0x41')]));_0x4741fb['attributes']=_0x4741fb[_0xe74e('0x42')][_0xe74e('0x43')]?_0x4741fb[_0xe74e('0x42')]:_0x116de9[_0xe74e('0x3d')];if(!_0x19cfe9[_0xe74e('0x3e')][_0xe74e('0x44')]('nolimit')){_0x4741fb[_0xe74e('0x23')]=qs[_0xe74e('0x23')](_0x19cfe9[_0xe74e('0x3e')][_0xe74e('0x23')]);_0x4741fb[_0xe74e('0x21')]=qs[_0xe74e('0x21')](_0x19cfe9[_0xe74e('0x3e')]['offset']);}_0x4741fb[_0xe74e('0x95')]=qs[_0xe74e('0x46')](_0x19cfe9[_0xe74e('0x3e')][_0xe74e('0x46')]);_0x4741fb['where']=qs[_0xe74e('0x3f')](_[_0xe74e('0x47')](_0x19cfe9['query'],_0x116de9[_0xe74e('0x3f')]));_0x4741fb[_0xe74e('0x78')][_0xe74e('0xb5')]=_0x6437be['id'];if(_0x19cfe9[_0xe74e('0x3e')][_0xe74e('0x87')]){_0x4741fb['where']=_[_0xe74e('0xa3')](_0x4741fb[_0xe74e('0x78')],{'$or':_[_0xe74e('0x31')](_0x4741fb[_0xe74e('0x42')],function(_0x1e7895){var _0x35fb15={};_0x35fb15[_0x1e7895]={'$like':'%'+_0x19cfe9['query'][_0xe74e('0x87')]+'%'};return _0x35fb15;})});}if(_0x19cfe9[_0xe74e('0x3e')][_0xe74e('0x7c')]){var _0x249a46=_0x19cfe9[_0xe74e('0x3e')][_0xe74e('0x7c')][_0xe74e('0x35')](',');var _0x43bbc4={};_0x43bbc4[_0x249a46[0x0]]={'$gte':moment(_0x249a46[0x1])['format'](_0xe74e('0xc4'))};_0x4741fb['where']=_[_0xe74e('0xa3')](_0x4741fb[_0xe74e('0x78')],_0x43bbc4);}_0x4741fb=_['merge']({},_0x4741fb,_0x19cfe9[_0xe74e('0xc5')]);return db[_0xe74e('0xc3')][_0xe74e('0xa1')]({'where':_0x4741fb[_0xe74e('0x78')]})[_0xe74e('0x29')](function(_0x21c2f6){_0x5693b5['count']=_0x21c2f6;if(_0x19cfe9['query'][_0xe74e('0xc6')]){_0x4741fb[_0xe74e('0xba')]=[{'all':!![]}];}return db[_0xe74e('0xc3')][_0xe74e('0xc7')](_0x4741fb);})[_0xe74e('0x29')](function(_0x2af5c1){_0x5693b5[_0xe74e('0xc8')]=_0x2af5c1;return _0x5693b5;});}})['then'](respondWithFilteredResult(_0x16c1d5,_0x4741fb))[_0xe74e('0xbc')](handleError(_0x16c1d5,null));};exports[_0xe74e('0xc9')]=function(_0xcc7364,_0x32ed24,_0x41e541){return db[_0xe74e('0x38')]['find']({'where':{'id':_0xcc7364[_0xe74e('0xb9')]['id']}})['then'](handleEntityNotFound(_0x32ed24,null))[_0xe74e('0x29')](function(_0x1fe77f){if(_0x1fe77f){return _0x1fe77f['setTags'](_0xcc7364['body']['ids'],_[_0xe74e('0xc0')](_0xcc7364[_0xe74e('0x74')],['ids','id'])||{})['spread'](function(){return db[_0xe74e('0x6e')][_0xe74e('0xc7')]({'attributes':['id',_0xe74e('0x2e'),_0xe74e('0x49')],'where':{'id':_0xcc7364[_0xe74e('0x74')]['ids']}});})[_0xe74e('0x29')](function(_0x5b255a){socket[_0xe74e('0xca')](_0xe74e('0xcb'),{'id':Number(_0xcc7364[_0xe74e('0xb9')]['id']),'tags':_0x5b255a||[]});return{'id':Number(_0xcc7364[_0xe74e('0xb9')]['id']),'tags':_0x5b255a||[]};});}})['then'](respondWithResult(_0x32ed24,null))[_0xe74e('0xbc')](handleError(_0x32ed24,null));};exports['removeTags']=function(_0x124782,_0x59fd90,_0x103b5a){return db[_0xe74e('0x38')][_0xe74e('0x60')]({'where':{'id':_0x124782[_0xe74e('0xb9')]['id']}})['then'](handleEntityNotFound(_0x59fd90,null))['then'](function(_0x2d202f){if(_0x2d202f){return _0x2d202f[_0xe74e('0xcc')](_0x124782[_0xe74e('0x3e')]['ids']);}})[_0xe74e('0x29')](respondWithStatusCode(_0x59fd90,null))['catch'](handleError(_0x59fd90,null));};exports[_0xe74e('0xcd')]=function(_0x3dee43,_0x4fa681){var _0x2ba126=moment()[_0xe74e('0xce')]()['toString']();var _0x358af4=path['join'](config[_0xe74e('0xcf')],'server','files',_0xe74e('0xd0'));var _0x435d4c=path['join'](config[_0xe74e('0xcf')],_0xe74e('0xd1'),_0xe74e('0xd2'),_0xe74e('0xd3'));var _0x495a69=path['join'](_0x358af4,_0x2ba126);var _0x41c47e=util['format'](_0xe74e('0xd4'),_0x3dee43[_0xe74e('0xb9')]['id'],_0x2ba126);var _0x5620fa=path[_0xe74e('0xd5')](_0x358af4,_0x41c47e);var _0x556892=[];_0x556892['push']({'model':db[_0xe74e('0x71')],'as':_0xe74e('0x71'),'attributes':['id','fullname'],'raw':!![]});_0x556892[_0xe74e('0xb6')]({'model':db[_0xe74e('0xd6')],'as':_0xe74e('0xd7'),'attributes':['id',_0xe74e('0xd8'),_0xe74e('0xd9')],'raw':!![]});if(_0x3dee43['query'][_0xe74e('0xd3')]){_0x556892[_0xe74e('0xb6')]({'model':db[_0xe74e('0xda')],'as':_0xe74e('0xda'),'raw':!![]});}var _0xd3e5d0=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0xe74e('0x74'),'createdAt',_0xe74e('0xdb'),_0xe74e('0xdc'),'read'],'include':_0x556892}];_0xd3e5d0['push']({'model':db[_0xe74e('0xdd')],'as':_0xe74e('0xde'),'attributes':['id',_0xe74e('0x2e')]});_0xd3e5d0[_0xe74e('0xb6')]({'model':db[_0xe74e('0x71')],'as':_0xe74e('0xdf'),'attributes':['id','fullname']});return db['OpenchannelInteraction'][_0xe74e('0x60')]({'where':{'id':_0x3dee43[_0xe74e('0xb9')]['id']},'include':_0xd3e5d0})[_0xe74e('0x29')](handleEntityNotFound(_0x4fa681,null))['then'](function(_0x31dd1a){if(_0x31dd1a){var _0x3a5bad=_0x31dd1a[_0xe74e('0xe0')]({'plain':!![]});fs['mkdirSync'](_0x495a69);var _0x497482={'channel':_0xe74e('0xe1'),'account':_0x3a5bad['Account'][_0xe74e('0x2e')],'agent':_0x3a5bad[_0xe74e('0xdf')]?_0x3a5bad['Owner'][_0xe74e('0x32')]:'N.A.','createdAt':moment(_0x3a5bad['createdAt'])['format'](_0xe74e('0xc4'))[_0xe74e('0xa0')](),'closedAt':_0x3a5bad['closed']?moment(_0x3a5bad[_0xe74e('0xe2')])[_0xe74e('0xe3')](_0xe74e('0xc4'))[_0xe74e('0xa0')]():'','disposition':_0x3a5bad['disposition'],'visibility':_0x3a5bad[_0xe74e('0xe4')]?_0xe74e('0xe5'):_0xe74e('0xe6'),'messages':_(_0x3a5bad['Messages'])['filter']({'secret':![]})[_0xe74e('0x31')](function(_0x521fb0){if(_0x521fb0['Attachment']){var _0x1e4a82=path[_0xe74e('0xd5')](_0x435d4c,_0x521fb0[_0xe74e('0xda')][_0xe74e('0xe7')]);if(fs[_0xe74e('0xe8')](_0x1e4a82)){fs[_0xe74e('0xe9')](_0x1e4a82)[_0xe74e('0xea')](fs[_0xe74e('0xeb')](path[_0xe74e('0xd5')](_0x495a69,_0x521fb0['Attachment'][_0xe74e('0xe7')])));}}return{'date':moment(_0x521fb0[_0xe74e('0x7a')])[_0xe74e('0xe3')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x521fb0[_0xe74e('0xdb')]===_0xe74e('0xec')?_0x521fb0['User']?_0x521fb0[_0xe74e('0x71')][_0xe74e('0x32')]:_0xe74e('0xed'):_0x521fb0[_0xe74e('0xd7')]['firstName']+(_0x521fb0[_0xe74e('0xd7')][_0xe74e('0xd9')]?'\x20'+_0x521fb0[_0xe74e('0xd7')][_0xe74e('0xd9')]:''),'body':_0x521fb0[_0xe74e('0xda')]?_0x521fb0[_0xe74e('0xda')][_0xe74e('0xe7')]:_0x521fb0[_0xe74e('0x74')],'direction':_0x521fb0[_0xe74e('0xdb')]===_0xe74e('0xec')?'A':'C','secret':_0x521fb0[_0xe74e('0xdc')],'read':_0x521fb0[_0xe74e('0x82')],'attachment':_0x521fb0['Attachment']};})[_0xe74e('0x62')]()};return ejs[_0xe74e('0xee')](path[_0xe74e('0xd5')](config[_0xe74e('0xcf')],_0xe74e('0xd1'),_0xe74e('0xef'),'downloadInteraction.ejs'),{'interaction':_0x497482})['then'](function(_0x1179e7){var _0x11e928=path[_0xe74e('0xd5')](_0x495a69,_0xe74e('0xf0')+_0x3a5bad['id']+'-'+_0x2ba126+_0xe74e('0xf1'));var _0x1b2ad1={'path':_0x11e928,'channel':'Openchannel','interactionId':_0x3a5bad['id']};return pdf[_0xe74e('0xf2')](_0x1179e7,_0x1b2ad1);})['then'](function(){return new BPromise(function(_0x15a0a0,_0xb7124e){zipdir(_0x495a69,{'saveTo':_0x5620fa},function(_0x41d084,_0x1d3323){if(_0x41d084)return _0xb7124e(_0x41d084);return _0x15a0a0(_0x1d3323);});})['then'](function(){return new BPromise(function(_0x2176d5,_0x36ab77){rimraf(_0x495a69,function(_0xf38972){if(_0xf38972)_0x36ab77(_0xf38972);return _0x2176d5();});});})['then'](function(){return _0x4fa681[_0xe74e('0xcd')](_0x5620fa,_0x41c47e,function(_0x17dfbe){if(_0x17dfbe){console[_0xe74e('0xf3')]('err',_0x17dfbe);}else{fs[_0xe74e('0xf4')](_0x5620fa);}});});});}else{return _0x4fa681[_0xe74e('0x2b')](0xc8);}})[_0xe74e('0xbc')](handleError(_0x4fa681,null));}; \ No newline at end of file +var _0x4574=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','select','field','name','from','tools_tags','u.id','u.fullname','user_has_openchannel_interactions','users','openchannel_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','unreadMessages','having','`\x20=\x200','`\x20>\x200','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','start','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','contactName','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','a.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','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','rows','show','params','includeAll','include','options','create','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','color','emit','download','unix','root','server','files','tmp','join','attachments','Contact','firstName','Attachment','Messages','OpenchannelAccount','Account','fullname','get','Openchannel','Owner','N.A.','closed','closedAt','threadId','existsSync','createReadStream','pipe','createWriteStream','basename','direction','out','System','lastName','secret','renderFile','views','downloadInteraction.ejs','.pdf','unlinkSync','eml-format','rimraf','request-promise','moment','bluebird','util','sox','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','error','stack','TagIds','forEach','push','catch','index','map','OpenchannelInteraction','rawAttributes'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x4574,0x199));var _0x4457=function(_0x45581a,_0x2225db){_0x45581a=_0x45581a-0x0;var _0x11c122=_0x4574[_0x45581a];return _0x11c122;};'use strict';var emlformat=require(_0x4457('0x0'));var rimraf=require(_0x4457('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4457('0x2'));var moment=require(_0x4457('0x3'));var BPromise=require(_0x4457('0x4'));var Mustache=require('mustache');var util=require(_0x4457('0x5'));var path=require('path');var sox=require(_0x4457('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4457('0x7'));var _=require(_0x4457('0x8'));var squel=require('squel');var crypto=require(_0x4457('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x4457('0xa'));var toCsv=require('to-csv');var querystring=require(_0x4457('0xb'));var Papa=require(_0x4457('0xc'));var Redis=require(_0x4457('0xd'));var authService=require(_0x4457('0xe'));var qs=require(_0x4457('0xf'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4457('0x10'));var utils=require(_0x4457('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4457('0x12')]=_[_0x4457('0x13')](config[_0x4457('0x12')],{'host':'localhost','port':0x18eb});var socket=require(_0x4457('0x14'))(new Redis(config[_0x4457('0x12')]));require(_0x4457('0x15'))[_0x4457('0x16')](socket);function respondWithStatusCode(_0x9975a7,_0x286b7e){_0x286b7e=_0x286b7e||0xcc;return function(_0x4d5d0f){if(_0x4d5d0f){return _0x9975a7[_0x4457('0x17')](_0x286b7e);}return _0x9975a7[_0x4457('0x18')](_0x286b7e)[_0x4457('0x19')]();};}function respondWithResult(_0x5467b0,_0x2f1b45){_0x2f1b45=_0x2f1b45||0xc8;return function(_0x4e5887){if(_0x4e5887){return _0x5467b0[_0x4457('0x18')](_0x2f1b45)[_0x4457('0x1a')](_0x4e5887);}};}function respondWithFilteredResult(_0x24c358,_0x11ac57){return function(_0x2f78aa){if(_0x2f78aa){var _0x5eaf38=typeof _0x11ac57['offset']===_0x4457('0x1b')&&typeof _0x11ac57[_0x4457('0x1c')]===_0x4457('0x1b');var _0x1cacac=_0x2f78aa[_0x4457('0x1d')];var _0x12589b=_0x5eaf38?0x0:_0x11ac57[_0x4457('0x1e')];var _0x4ec580=_0x5eaf38?_0x2f78aa[_0x4457('0x1d')]:_0x11ac57[_0x4457('0x1e')]+_0x11ac57['limit'];var _0x72e831;if(_0x4ec580>=_0x1cacac){_0x4ec580=_0x1cacac;_0x72e831=0xc8;}else{_0x72e831=0xce;}_0x24c358[_0x4457('0x18')](_0x72e831);return _0x24c358[_0x4457('0x1f')](_0x4457('0x20'),_0x12589b+'-'+_0x4ec580+'/'+_0x1cacac)['json'](_0x2f78aa);}return null;};}function patchUpdates(_0x5088af){return function(_0x372dd8){try{jsonpatch['apply'](_0x372dd8,_0x5088af,!![]);}catch(_0xc18135){return BPromise['reject'](_0xc18135);}return _0x372dd8[_0x4457('0x21')]();};}function saveUpdates(_0x59bded,_0x58c9a3){return function(_0x55b0c3){if(_0x55b0c3){return _0x55b0c3[_0x4457('0x22')](_0x59bded)[_0x4457('0x23')](function(_0x25d184){return _0x25d184;});}return null;};}function removeEntity(_0x3bff5f,_0x21963e){return function(_0xa61cfb){if(_0xa61cfb){return _0xa61cfb[_0x4457('0x24')]()[_0x4457('0x23')](function(){_0x3bff5f[_0x4457('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f252e,_0x5b4f8c){return function(_0x31a0bd){if(!_0x31a0bd){_0x5f252e[_0x4457('0x17')](0x194);}return _0x31a0bd;};}function handleError(_0x346d6a,_0x144c25){_0x144c25=_0x144c25||0x1f4;return function(_0x249e97){logger[_0x4457('0x25')](_0x249e97[_0x4457('0x26')]);if(_0x249e97['name']){delete _0x249e97['name'];}_0x346d6a['status'](_0x144c25)['send'](_0x249e97);};}function getInteractionUsers(_0xfe5c68,_0x495c5a){return new BPromise(function(_0x5e27e8,_0xc0735c){try{if(_0x495c5a[_0xfe5c68['id']]){_0xfe5c68['Users']=_['map'](_0x495c5a[_0xfe5c68['id']],function(_0xa7ec2d){return{'id':_0xa7ec2d['id'],'fullname':_0xa7ec2d['fullname']};});}}catch(_0x1861b5){_0xc0735c(_0x1861b5);}_0x5e27e8(_0xfe5c68);});}function getInteractionTags(_0x54225b,_0x5d46f5){return new BPromise(function(_0x452df4,_0x24eb69){try{if(_0x54225b[_0x4457('0x27')]){_0x54225b['Tags']=[];_0x54225b[_0x4457('0x27')]['split'](',')[_0x4457('0x28')](function(_0x4d4a9e){_0x54225b['Tags'][_0x4457('0x29')](_0x5d46f5[_0x4d4a9e]);});}delete _0x54225b['TagIds'];}catch(_0x26c37e){_0x24eb69(_0x26c37e);}_0x452df4(_0x54225b);});}function updateOpenchannelInteraction(_0x5e8c27,_0x40dadf,_0x26d1b9){return new BPromise(function(_0x597b6c,_0x434106){return getInteractionUsers(_0x5e8c27,_0x26d1b9)['then'](function(_0x48436a){return getInteractionTags(_0x48436a,_0x40dadf);})[_0x4457('0x23')](function(_0x52ad3e){_0x597b6c(_0x52ad3e);})[_0x4457('0x2a')](function(_0x458d50){_0x434106(_0x458d50);});});}exports[_0x4457('0x2b')]=function(_0x4e136f,_0x41c699){var _0x20e0e8={},_0x4a2606={},_0x29787b={'count':0x0,'rows':[]};var _0x34914b=_[_0x4457('0x2c')](db[_0x4457('0x2d')][_0x4457('0x2e')],function(_0x4b7d63){return{'name':_0x4b7d63[_0x4457('0x2f')],'type':_0x4b7d63[_0x4457('0x30')][_0x4457('0x31')]};});_0x4a2606[_0x4457('0x32')]=_[_0x4457('0x2c')](_0x34914b,'name');_0x4a2606[_0x4457('0x33')]=_[_0x4457('0x34')](_0x4e136f[_0x4457('0x33')]);_0x4a2606[_0x4457('0x35')]=_[_0x4457('0x36')](_0x4a2606[_0x4457('0x32')],_0x4a2606[_0x4457('0x33')]);_0x20e0e8[_0x4457('0x37')]=_[_0x4457('0x36')](_0x4a2606[_0x4457('0x32')],qs[_0x4457('0x38')](_0x4e136f[_0x4457('0x33')]['fields']));_0x20e0e8['attributes']=_0x20e0e8[_0x4457('0x37')]['length']?_0x20e0e8[_0x4457('0x37')]:_0x4a2606[_0x4457('0x32')];if(!_0x4e136f[_0x4457('0x33')]['hasOwnProperty'](_0x4457('0x39'))){_0x20e0e8['limit']=qs[_0x4457('0x1c')](_0x4e136f['query']['limit']);_0x20e0e8[_0x4457('0x1e')]=qs['offset'](_0x4e136f[_0x4457('0x33')][_0x4457('0x1e')]);}_0x20e0e8[_0x4457('0x3a')]=qs[_0x4457('0x3b')](_0x4e136f[_0x4457('0x33')]['sort']);_0x20e0e8[_0x4457('0x3c')]=qs[_0x4457('0x35')](_[_0x4457('0x3d')](_0x4e136f[_0x4457('0x33')],_0x4a2606[_0x4457('0x35')]),_0x34914b);var _0x53567a=[];var _0x44abf5=squel[_0x4457('0x3e')]()[_0x4457('0x3f')]('id')[_0x4457('0x3f')](_0x4457('0x40'))[_0x4457('0x3f')]('color')[_0x4457('0x41')](_0x4457('0x42'));var _0x447631=squel[_0x4457('0x3e')]()[_0x4457('0x3f')](_0x4457('0x43'))[_0x4457('0x3f')](_0x4457('0x44'))[_0x4457('0x3f')]('ui.OpenchannelInteractionId')['from'](_0x4457('0x45'),'ui')['left_join'](_0x4457('0x46'),'u','u.id\x20=\x20ui.UserId');var _0x5162ee=squel[_0x4457('0x3e')]()[_0x4457('0x41')](_0x4457('0x47'),'i')[_0x4457('0x48')](_0x4457('0x49'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0x4457('0x4a'))['left_join'](_0x4457('0x4b'),'a',_0x4457('0x4c'))[_0x4457('0x48')](_0x4457('0x4d'),'me',_0x4457('0x4e'))[_0x4457('0x48')](_0x4457('0x4f'),'it',_0x4457('0x50'))[_0x4457('0x48')](_0x4457('0x42'),'t',_0x4457('0x51'));var _0x279314=squel[_0x4457('0x52')]();var _0x5e710e=[];var _0x184f30=squel[_0x4457('0x52')]();var _0x3c0b16;if(_0x4e136f[_0x4457('0x33')][_0x4457('0x53')]){_0x3c0b16=as[_0x4457('0x54')](_0x4e136f['query'][_0x4457('0x53')]);var _0x2c025a=_0x3c0b16[_0x4457('0x55')];for(var _0xdcdfb8=0x0;_0xdcdfb8<_0x3c0b16['conditions'][_0x4457('0x56')];_0xdcdfb8++){var _0x92387a=_0x3c0b16[_0x4457('0x57')][_0xdcdfb8];var _0x54d872='i';var _0x47abc0=_['find'](_0x34914b,[_0x4457('0x40'),_0x92387a[_0x4457('0x3f')]]);if(!_0x47abc0){switch(_0x92387a[_0x4457('0x3f')]){case _0x4457('0x58'):if(_0x92387a['value']==0x1){_0x5162ee[_0x4457('0x59')]('`'+_0x92387a[_0x4457('0x3f')]+_0x4457('0x5a'));}else{_0x5162ee[_0x4457('0x59')]('`'+_0x92387a[_0x4457('0x3f')]+_0x4457('0x5b'));}break;case'Contact':if(_0x92387a['operator']===_0x4457('0x5c')){if(_0x92387a[_0x4457('0x5d')]['split']('\x20')[_0x4457('0x56')]>0x1){_0x279314[_0x2c025a](_0x4457('0x5e'),qs['getFullTextValue'](_0x92387a[_0x4457('0x5d')]),null);}else{var _0x5dc7bd='%'+_0x92387a[_0x4457('0x5d')]+'%';_0x279314[_0x2c025a](_0x4457('0x5f'),_0x5dc7bd,_0x5dc7bd,_0x5dc7bd);}}else{_0x47abc0=_[_0x4457('0x60')](_0x34914b,['name','ContactId']);_0x92387a['field']=_0x4457('0x61');_0xf08032=as['buildExpression'](_0x54d872,_0x47abc0[_0x4457('0x30')],_0x92387a);_0x279314[_0x2c025a](_0xf08032['text'],_0xf08032[_0x4457('0x5d')]['start'],_0xf08032[_0x4457('0x5d')][_0x4457('0x19')]);}break;case _0x4457('0x62'):var _0x2cc5b4=_0x92387a[_0x4457('0x5d')][_0x4457('0x63')](',')[_0x4457('0x2c')](function(_0x1b42f7){return Number(_0x1b42f7);});_0x2cc5b4['forEach'](function(_0x3eaa53){_0x184f30['or'](_0x4457('0x64'),'%,'+_0x3eaa53+',%');});_0x5e710e=_['union'](_0x5e710e,_0x2cc5b4);break;case _0x4457('0x65'):if(_0x92387a[_0x4457('0x66')]===_0x4457('0x5c')){_0x279314[_0x2c025a](_0x4457('0x67'),'%'+_0x92387a[_0x4457('0x5d')]+'%',null);}else{_0x47abc0=_[_0x4457('0x60')](_0x34914b,['name','UserId']);_0x92387a[_0x4457('0x3f')]=_0x4457('0x68');_0xf08032=as[_0x4457('0x69')](_0x54d872,_0x47abc0['type'],_0x92387a);_0x279314[_0x2c025a](_0xf08032[_0x4457('0x6a')],_0xf08032['value'][_0x4457('0x6b')],_0xf08032[_0x4457('0x5d')][_0x4457('0x19')]);}break;case _0x4457('0x6c'):_0xf08032=as[_0x4457('0x69')]('me',null,_0x92387a);_0x279314[_0x2c025a](_0xf08032[_0x4457('0x6a')],_0xf08032[_0x4457('0x5d')]['start'],_0xf08032[_0x4457('0x5d')][_0x4457('0x19')]);break;}}else{var _0xf08032=as[_0x4457('0x69')](_0x54d872,_0x47abc0[_0x4457('0x30')],_0x92387a);_0x279314[_0x2c025a](_0xf08032[_0x4457('0x6a')],_0xf08032[_0x4457('0x5d')]['start'],_0xf08032[_0x4457('0x5d')]['end']);}}}else{var _0x36d83b=_(_0x4e136f[_0x4457('0x33')])[_0x4457('0x34')]()['map'](function(_0x4e6b80){return _[_0x4457('0x6d')](_0x34914b,[_0x4457('0x40'),_0x4e6b80])?_0x4e6b80:undefined;})[_0x4457('0x6e')]()[_0x4457('0x5d')]();if(!_[_0x4457('0x6f')](_0x36d83b)){_0x36d83b[_0x4457('0x28')](function(_0xd33656){if(_0xd33656===_0x4457('0x70')){_0x5162ee['where'](_0x4457('0x71'),[][_0x4457('0x72')](_0x4e136f[_0x4457('0x33')][_0xd33656]));}else if(_0xd33656===_0x4457('0x73')){var _0x9599d0=JSON[_0x4457('0x74')](_0x4e136f['query'][_0xd33656])[_0x4457('0x75')];var _0x3ef215=JSON['parse'](_0x4e136f[_0x4457('0x33')][_0xd33656])[_0x4457('0x76')];_0x5162ee[_0x4457('0x3c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9599d0,_0x3ef215);}else{if(_0x4e136f[_0x4457('0x33')][_0xd33656]===_0x4457('0x77')){_0x5162ee['where']('i.'+_0xd33656+_0x4457('0x78'));}else{_0x5162ee[_0x4457('0x3c')]('i.'+_0xd33656+'\x20=\x20?',_0x4e136f['query'][_0xd33656]);}}});}if(_0x4e136f[_0x4457('0x33')]['read']){if(_0x4e136f[_0x4457('0x33')][_0x4457('0x79')]==0x1){_0x5162ee[_0x4457('0x59')](_0x4457('0x7a'));}else{_0x5162ee['having'](_0x4457('0x7b'));}}if(_0x4e136f[_0x4457('0x33')][_0x4457('0x7c')]){_0x5e710e=_[_0x4457('0x7d')](_0x4e136f['query'][_0x4457('0x7c')])?_0x4e136f[_0x4457('0x33')][_0x4457('0x7c')]:new Array(_0x4e136f[_0x4457('0x33')][_0x4457('0x7c')]);_0x5e710e[_0x4457('0x28')](function(_0x1de277){_0x184f30['or'](_0x4457('0x64'),'%,'+_0x1de277+',%');});}if(_0x4e136f['query'][_0x4457('0x7e')]){var _0x16d855=_0x4e136f['query']['filter']['replace']('\x5c','\x5c\x5c')[_0x4457('0x7f')](/'/g,'\x27\x27');if(qs[_0x4457('0x80')](_0x16d855)){_0x279314['or']('i.id\x20LIKE\x20?',_0x16d855+'%');}else{_0x279314['or'](_0x4457('0x81'),qs[_0x4457('0x82')](_0x16d855))['or'](_0x4457('0x83'),_0x16d855+'%')['or'](_0x4457('0x84'),_0x16d855+'%');}}}_0x5162ee[_0x4457('0x3c')](_0x279314);_0x5162ee[_0x4457('0x85')](_0x4457('0x86'));var _0x532a4b={'type':db[_0x4457('0x87')][_0x4457('0x88')]['SELECT'],'raw':!![]};var _0x8de31=_0x5162ee[_0x4457('0x89')]();_0x8de31[_0x4457('0x3f')]('i.id');_0x8de31[_0x4457('0x3f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x20e0e8[_0x4457('0x3a')]){_0x20e0e8[_0x4457('0x3a')][_0x4457('0x28')](function(_0x3e07b7){var _0x50873f=_0x3e07b7[0x0]===_0x4457('0x8a')?_0x3e07b7[0x0]:'i.'+_0x3e07b7[0x0];_0x5162ee['order'](_0x50873f,_0x3e07b7[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5e710e)){_0x5162ee[_0x4457('0x59')](_0x184f30);_0x8de31['where']('t.id\x20IN\x20?',_0x5e710e);}BPromise[_0x4457('0x8b')]()['then'](function(){if(!_0x3c0b16){if(_0x4e136f['query']['OpenchannelAccountId'])return;_0x8de31[_0x4457('0x3c')](_0x4457('0x8c'));_0x5162ee[_0x4457('0x3c')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x4e136f[_0x4457('0x8d')][_0x4457('0x8e')]!==_0x4457('0x8f'))return;return _0x4e136f['user'][_0x4457('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x33d5dc){if(_['isEmpty'](_0x33d5dc)){_0x8de31[_0x4457('0x3c')](_0x4457('0x91'));_0x5162ee[_0x4457('0x3c')](_0x4457('0x91'));}else{_0x8de31[_0x4457('0x3c')](_0x4457('0x71'),_[_0x4457('0x2c')](_0x33d5dc,'id'));_0x5162ee[_0x4457('0x3c')](_0x4457('0x71'),_['map'](_0x33d5dc,'id'));}});})[_0x4457('0x23')](function(){if(_0x4e136f['user'][_0x4457('0x8e')]===_0x4457('0x8f')&&!_0x3c0b16&&!_0x4e136f[_0x4457('0x33')][_0x4457('0x70')])return[];return db[_0x4457('0x92')][_0x4457('0x33')](_0x8de31[_0x4457('0x93')](),_0x532a4b);})[_0x4457('0x23')](function(_0x81dd70){_0x29787b['count']=_0x81dd70[_0x4457('0x56')];if(_0x29787b[_0x4457('0x1d')]===0x0)return[];return db[_0x4457('0x92')][_0x4457('0x33')](_0x44abf5[_0x4457('0x93')](),_0x532a4b)['then'](function(_0x4dd803){_0x53567a=_[_0x4457('0x94')](_0x4dd803,'id');_0x532a4b=_[_0x4457('0x95')](_0x532a4b,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4e136f[_0x4457('0x33')][_0x4457('0x38')]){_0x20e0e8[_0x4457('0x37')][_0x4457('0x28')](function(_0x822892){_0x5162ee[_0x4457('0x3f')]('i.'+_0x822892);});}else{_0x5162ee['field'](_0x4457('0x96'),_0x4457('0x58'));_0x5162ee['field'](_0x4457('0x97'),'Account.key');_0x5162ee['field'](_0x4457('0x98'),'Account.mandatoryDisposition');_0x5162ee[_0x4457('0x3f')](_0x4457('0x99'),_0x4457('0x8a'));_0x5162ee['field'](_0x4457('0x9a'));_0x5162ee[_0x4457('0x3f')](_0x4457('0x9b'),'Contact.firstName');_0x5162ee[_0x4457('0x3f')](_0x4457('0x9c'),_0x4457('0x9d'));_0x5162ee[_0x4457('0x3f')](_0x4457('0x9e'),'Contact.email');_0x5162ee['field'](_0x4457('0x9f'),'Contact.phone');_0x5162ee[_0x4457('0x3f')](_0x4457('0xa0'),'Contact.mobile');_0x5162ee[_0x4457('0x3f')](_0x4457('0xa1'),_0x4457('0xa2'));_0x5162ee[_0x4457('0x3f')](_0x4457('0xa3'),_0x4457('0xa4'));_0x5162ee['field'](_0x4457('0xa5'),_0x4457('0xa6'));_0x5162ee[_0x4457('0x3f')](_0x4457('0xa7'),_0x4457('0x27'));}if(_0x20e0e8[_0x4457('0x1c')])_0x5162ee['limit'](_0x20e0e8[_0x4457('0x1c')]);if(_0x20e0e8['offset'])_0x5162ee[_0x4457('0x1e')](_0x20e0e8[_0x4457('0x1e')]);return db[_0x4457('0x92')][_0x4457('0x33')](_0x5162ee[_0x4457('0x93')](),_0x532a4b);})[_0x4457('0x23')](function(_0x50bd56){if(_0x50bd56[_0x4457('0x56')]>0x0)_0x447631['where'](_0x4457('0xa8'),_['map'](_0x50bd56,'id'));return db[_0x4457('0x92')][_0x4457('0x33')](_0x447631[_0x4457('0x93')](),_0x532a4b)[_0x4457('0x23')](function(_0x6aeba8){var _0x42d700=_[_0x4457('0xa9')](_0x6aeba8,_0x4457('0xaa'));var _0x3fc837=[];_0x50bd56[_0x4457('0x28')](function(_0x2ad0ed){_0x3fc837['push'](updateOpenchannelInteraction(_0x2ad0ed,_0x53567a,_0x42d700));});return BPromise['all'](_0x3fc837);});});})['then'](function(_0x45d1db){_0x29787b[_0x4457('0xab')]=_0x45d1db;return _0x29787b;})[_0x4457('0x23')](respondWithFilteredResult(_0x41c699,_0x20e0e8))['catch'](handleError(_0x41c699,null));};exports[_0x4457('0xac')]=function(_0x436b8e,_0x4fad9a){var _0x499ece={};if(_0x436b8e[_0x4457('0x33')][_0x4457('0x30')]&&_0x436b8e[_0x4457('0x33')][_0x4457('0x30')]===_0x4457('0x41')){_0x499ece[_0x4457('0x41')]=_0x436b8e[_0x4457('0xad')]['id'];}else{_0x499ece['id']=_0x436b8e['params']['id'];}var _0xcac3ac={'raw':![],'where':_0x499ece},_0x39226a={};_0x39226a[_0x4457('0x32')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x39226a[_0x4457('0x33')]=_[_0x4457('0x34')](_0x436b8e[_0x4457('0x33')]);_0x39226a[_0x4457('0x35')]=_[_0x4457('0x36')](_0x39226a[_0x4457('0x32')],_0x39226a[_0x4457('0x33')]);_0xcac3ac['attributes']=_[_0x4457('0x36')](_0x39226a['model'],qs[_0x4457('0x38')](_0x436b8e['query'][_0x4457('0x38')]));_0xcac3ac['attributes']=_0xcac3ac[_0x4457('0x37')][_0x4457('0x56')]?_0xcac3ac['attributes']:_0x39226a[_0x4457('0x32')];if(_0x436b8e[_0x4457('0x33')][_0x4457('0xae')]){_0xcac3ac[_0x4457('0xaf')]=[{'all':!![]}];}_0xcac3ac=_[_0x4457('0x95')]({},_0xcac3ac,_0x436b8e[_0x4457('0xb0')]);return db[_0x4457('0x2d')][_0x4457('0x60')](_0xcac3ac)[_0x4457('0x23')](handleEntityNotFound(_0x4fad9a,null))[_0x4457('0x23')](respondWithResult(_0x4fad9a,null))[_0x4457('0x2a')](handleError(_0x4fad9a,null));};exports[_0x4457('0xb1')]=function(_0x57be93,_0x2f514e){return db[_0x4457('0x2d')][_0x4457('0xb1')](_0x57be93[_0x4457('0x6c')],{})['then'](respondWithResult(_0x2f514e,0xc9))[_0x4457('0x2a')](handleError(_0x2f514e,null));};exports[_0x4457('0x22')]=function(_0x2747ad,_0x4213f9){if(_0x2747ad[_0x4457('0x6c')]['id']){delete _0x2747ad['body']['id'];}return db[_0x4457('0x2d')][_0x4457('0x60')]({'where':{'id':_0x2747ad[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x4213f9,null))[_0x4457('0x23')](saveUpdates(_0x2747ad['body'],null))[_0x4457('0x23')](respondWithResult(_0x4213f9,null))[_0x4457('0x2a')](handleError(_0x4213f9,null));};exports[_0x4457('0x24')]=function(_0x430224,_0x1bcf9c){return db['OpenchannelInteraction'][_0x4457('0x60')]({'where':{'id':_0x430224[_0x4457('0xad')]['id']}})['then'](handleEntityNotFound(_0x1bcf9c,null))[_0x4457('0x23')](removeEntity(_0x1bcf9c,null))[_0x4457('0x2a')](handleError(_0x1bcf9c,null));};exports[_0x4457('0xb2')]=function(_0x226a35,_0x4f5819){return db['OpenchannelInteraction']['describe']()[_0x4457('0x23')](respondWithResult(_0x4f5819,null))[_0x4457('0x2a')](handleError(_0x4f5819,null));};exports[_0x4457('0xb3')]=function(_0x5e8427,_0x204c61,_0x47b876){return db['OpenchannelMessage'][_0x4457('0x60')]({'where':{'id':_0x5e8427[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x204c61,null))[_0x4457('0x23')](function(_0x3a9b6f){if(_0x3a9b6f){return _0x3a9b6f[_0x4457('0xb3')](_0x5e8427[_0x4457('0x6c')]['ids'],_['omit'](_0x5e8427[_0x4457('0x6c')],[_0x4457('0xb4'),'id'])||{});}})['then'](respondWithResult(_0x204c61,null))[_0x4457('0x2a')](handleError(_0x204c61,null));};exports[_0x4457('0xb5')]=function(_0x1a2343,_0x2e7544,_0x169d82){var _0x44463e={'raw':![],'where':{}};var _0x41e7ad={};var _0x54b368={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x4457('0xb6')]({'where':{'id':_0x1a2343[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x2e7544,null))[_0x4457('0x23')](function(_0x53b15c){if(_0x53b15c){_0x41e7ad['model']=_[_0x4457('0x34')](db[_0x4457('0xb7')][_0x4457('0x2e')]);_0x41e7ad[_0x4457('0x33')]=_['keys'](_0x1a2343[_0x4457('0x33')]);_0x41e7ad[_0x4457('0x35')]=_[_0x4457('0x36')](_0x41e7ad['model'],_0x41e7ad[_0x4457('0x33')]);_0x44463e[_0x4457('0x37')]=_[_0x4457('0x36')](_0x41e7ad[_0x4457('0x32')],qs[_0x4457('0x38')](_0x1a2343[_0x4457('0x33')][_0x4457('0x38')]));_0x44463e['attributes']=_0x44463e[_0x4457('0x37')][_0x4457('0x56')]?_0x44463e[_0x4457('0x37')]:_0x41e7ad[_0x4457('0x32')];if(!_0x1a2343[_0x4457('0x33')]['hasOwnProperty'](_0x4457('0x39'))){_0x44463e[_0x4457('0x1c')]=qs[_0x4457('0x1c')](_0x1a2343[_0x4457('0x33')][_0x4457('0x1c')]);_0x44463e['offset']=qs[_0x4457('0x1e')](_0x1a2343['query'][_0x4457('0x1e')]);}_0x44463e[_0x4457('0x3a')]=qs[_0x4457('0x3b')](_0x1a2343['query'][_0x4457('0x3b')]);_0x44463e[_0x4457('0x3c')]=qs[_0x4457('0x35')](_[_0x4457('0x3d')](_0x1a2343['query'],_0x41e7ad['filters']));_0x44463e[_0x4457('0x3c')][_0x4457('0xaa')]=_0x53b15c['id'];if(_0x1a2343[_0x4457('0x33')][_0x4457('0x7e')]){_0x44463e[_0x4457('0x3c')]=_[_0x4457('0x95')](_0x44463e['where'],{'$or':_[_0x4457('0x2c')](_0x44463e[_0x4457('0x37')],function(_0x3ef4a1){var _0x1fc17c={};_0x1fc17c[_0x3ef4a1]={'$like':'%'+_0x1a2343[_0x4457('0x33')][_0x4457('0x7e')]+'%'};return _0x1fc17c;})});}if(_0x1a2343[_0x4457('0x33')][_0x4457('0x75')]){var _0x47d583=_0x1a2343[_0x4457('0x33')][_0x4457('0x75')][_0x4457('0x63')](',');var _0x203028={};_0x203028[_0x47d583[0x0]]={'$gte':moment(_0x47d583[0x1])[_0x4457('0xb8')](_0x4457('0xb9'))};_0x44463e['where']=_[_0x4457('0x95')](_0x44463e['where'],_0x203028);}_0x44463e=_[_0x4457('0x95')]({},_0x44463e,_0x1a2343[_0x4457('0xb0')]);return db[_0x4457('0xb7')][_0x4457('0x1d')]({'where':_0x44463e[_0x4457('0x3c')]})[_0x4457('0x23')](function(_0x42d861){_0x54b368[_0x4457('0x1d')]=_0x42d861;if(_0x1a2343[_0x4457('0x33')][_0x4457('0xae')]){_0x44463e['include']=[{'all':!![]}];}return db[_0x4457('0xb7')][_0x4457('0xba')](_0x44463e);})['then'](function(_0x584a86){_0x54b368['rows']=_0x584a86;return _0x54b368;});}})[_0x4457('0x23')](respondWithFilteredResult(_0x2e7544,_0x44463e))[_0x4457('0x2a')](handleError(_0x2e7544,null));};exports[_0x4457('0xbb')]=function(_0x321689,_0x58284d,_0x3655cd){return db['OpenchannelInteraction'][_0x4457('0x60')]({'where':{'id':_0x321689['params']['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x58284d,null))[_0x4457('0x23')](function(_0x4aaeff){if(_0x4aaeff){return _0x4aaeff['setTags'](_0x321689[_0x4457('0x6c')][_0x4457('0xb4')],_['omit'](_0x321689[_0x4457('0x6c')],[_0x4457('0xb4'),'id'])||{})[_0x4457('0xbc')](function(){return db[_0x4457('0x62')][_0x4457('0xba')]({'attributes':['id',_0x4457('0x40'),_0x4457('0xbd')],'where':{'id':_0x321689['body'][_0x4457('0xb4')]}});})[_0x4457('0x23')](function(_0x6587d1){socket[_0x4457('0xbe')]('openchannelInteractionTags:save',{'id':Number(_0x321689[_0x4457('0xad')]['id']),'tags':_0x6587d1||[]});return{'id':Number(_0x321689[_0x4457('0xad')]['id']),'tags':_0x6587d1||[]};});}})[_0x4457('0x23')](respondWithResult(_0x58284d,null))[_0x4457('0x2a')](handleError(_0x58284d,null));};exports['removeTags']=function(_0x4e7e77,_0x4d0d84,_0x1a1dd5){return db[_0x4457('0x2d')][_0x4457('0x60')]({'where':{'id':_0x4e7e77[_0x4457('0xad')]['id']}})[_0x4457('0x23')](handleEntityNotFound(_0x4d0d84,null))[_0x4457('0x23')](function(_0x195723){if(_0x195723){return _0x195723['removeTags'](_0x4e7e77[_0x4457('0x33')][_0x4457('0xb4')]);}})[_0x4457('0x23')](respondWithStatusCode(_0x4d0d84,null))[_0x4457('0x2a')](handleError(_0x4d0d84,null));};exports[_0x4457('0xbf')]=function(_0x3b850d,_0x51378d){var _0x4464d3=moment()[_0x4457('0xc0')]()[_0x4457('0x93')]();var _0x16d301=path['join'](config[_0x4457('0xc1')],_0x4457('0xc2'),_0x4457('0xc3'),_0x4457('0xc4'));var _0x3a5c50=path[_0x4457('0xc5')](config[_0x4457('0xc1')],'server',_0x4457('0xc3'),_0x4457('0xc6'));var _0xfbaa02=path[_0x4457('0xc5')](_0x16d301,_0x4464d3);var _0x1f7dc2=util['format']('transcript-%d-%s.zip',_0x3b850d[_0x4457('0xad')]['id'],_0x4464d3);var _0x4c2619=path[_0x4457('0xc5')](_0x16d301,_0x1f7dc2);var _0x42a6c1=[];_0x42a6c1[_0x4457('0x29')]({'model':db[_0x4457('0x65')],'as':_0x4457('0x65'),'attributes':['id','fullname'],'raw':!![]});_0x42a6c1[_0x4457('0x29')]({'model':db['CmContact'],'as':_0x4457('0xc7'),'attributes':['id',_0x4457('0xc8'),'lastName'],'raw':!![]});if(_0x3b850d['query'][_0x4457('0xc6')]){_0x42a6c1['push']({'model':db[_0x4457('0xc9')],'as':_0x4457('0xc9'),'raw':!![]});}var _0x421130=[{'model':db[_0x4457('0xb7')],'as':_0x4457('0xca'),'attributes':['id',_0x4457('0x6c'),_0x4457('0x73'),'direction','secret',_0x4457('0x79')],'include':_0x42a6c1}];_0x421130['push']({'model':db[_0x4457('0xcb')],'as':_0x4457('0xcc'),'attributes':['id',_0x4457('0x40')]});_0x421130['push']({'model':db[_0x4457('0x65')],'as':'Owner','attributes':['id',_0x4457('0xcd')]});return db[_0x4457('0x2d')][_0x4457('0x60')]({'where':{'id':_0x3b850d[_0x4457('0xad')]['id']},'include':_0x421130})[_0x4457('0x23')](handleEntityNotFound(_0x51378d,null))[_0x4457('0x23')](function(_0xb18365){if(_0xb18365){var _0x3e9a13=_0xb18365[_0x4457('0xce')]({'plain':!![]});fs['mkdirSync'](_0xfbaa02);var _0x40b2b9={'channel':_0x4457('0xcf'),'account':_0x3e9a13[_0x4457('0xcc')][_0x4457('0x40')],'agent':_0x3e9a13[_0x4457('0xd0')]?_0x3e9a13[_0x4457('0xd0')][_0x4457('0xcd')]:_0x4457('0xd1'),'createdAt':moment(_0x3e9a13['createdAt'])['format'](_0x4457('0xb9'))[_0x4457('0x93')](),'closedAt':_0x3e9a13[_0x4457('0xd2')]?moment(_0x3e9a13[_0x4457('0xd3')])[_0x4457('0xb8')](_0x4457('0xb9'))[_0x4457('0x93')]():'','disposition':_0x3e9a13['disposition'],'visibility':_0x3e9a13[_0x4457('0xd4')]?'Public':'Private','messages':_(_0x3e9a13['Messages'])[_0x4457('0x7e')]({'secret':![]})[_0x4457('0x2c')](function(_0x447023){if(_0x447023[_0x4457('0xc9')]){var _0x1d9c29=path[_0x4457('0xc5')](_0x3a5c50,_0x447023['Attachment']['basename']);if(fs[_0x4457('0xd5')](_0x1d9c29)){fs[_0x4457('0xd6')](_0x1d9c29)[_0x4457('0xd7')](fs[_0x4457('0xd8')](path[_0x4457('0xc5')](_0xfbaa02,_0x447023['Attachment'][_0x4457('0xd9')])));}}return{'date':moment(_0x447023['createdAt'])['format'](_0x4457('0xb9'))[_0x4457('0x93')](),'sender':_0x447023[_0x4457('0xda')]===_0x4457('0xdb')?_0x447023[_0x4457('0x65')]?_0x447023[_0x4457('0x65')][_0x4457('0xcd')]:_0x4457('0xdc'):_0x447023[_0x4457('0xc7')]['firstName']+(_0x447023[_0x4457('0xc7')][_0x4457('0xdd')]?'\x20'+_0x447023[_0x4457('0xc7')][_0x4457('0xdd')]:''),'body':_0x447023[_0x4457('0xc9')]?_0x447023['Attachment'][_0x4457('0xd9')]:_0x447023[_0x4457('0x6c')],'direction':_0x447023['direction']===_0x4457('0xdb')?'A':'C','secret':_0x447023[_0x4457('0xde')],'read':_0x447023[_0x4457('0x79')],'attachment':_0x447023[_0x4457('0xc9')]};})[_0x4457('0x5d')]()};return ejs[_0x4457('0xdf')](path[_0x4457('0xc5')](config['root'],'server',_0x4457('0xe0'),_0x4457('0xe1')),{'interaction':_0x40b2b9})['then'](function(_0x382914){var _0x1e4c66=path[_0x4457('0xc5')](_0xfbaa02,'transcript-'+_0x3e9a13['id']+'-'+_0x4464d3+_0x4457('0xe2'));var _0x4dbc99={'path':_0x1e4c66,'channel':_0x4457('0xcf'),'interactionId':_0x3e9a13['id']};return pdf['createPdfFromHTML'](_0x382914,_0x4dbc99);})['then'](function(){return new BPromise(function(_0x46a9be,_0xe13d0b){zipdir(_0xfbaa02,{'saveTo':_0x4c2619},function(_0x54b8d9,_0x551131){if(_0x54b8d9)return _0xe13d0b(_0x54b8d9);return _0x46a9be(_0x551131);});})['then'](function(){return new BPromise(function(_0x114fcf,_0x334d6c){rimraf(_0xfbaa02,function(_0xa691ad){if(_0xa691ad)_0x334d6c(_0xa691ad);return _0x114fcf();});});})[_0x4457('0x23')](function(){return _0x51378d['download'](_0x4c2619,_0x1f7dc2,function(_0x52c285){if(_0x52c285){console['log']('err',_0x52c285);}else{fs[_0x4457('0xe3')](_0x4c2619);}});});});}else{return _0x51378d[_0x4457('0x17')](0xc8);}})[_0x4457('0x2a')](handleError(_0x51378d,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 34d4d5d..1c7eed2 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 _0x7040=['map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelMessage','save','update','remove','getUsers','then','setDataValue','Users'];(function(_0x5be6ef,_0x4f252c){var _0x350555=function(_0x2cbd13){while(--_0x2cbd13){_0x5be6ef['push'](_0x5be6ef['shift']());}};_0x350555(++_0x4f252c);}(_0x7040,0x1a6));var _0x0704=function(_0x4647c7,_0x5456c9){_0x4647c7=_0x4647c7-0x0;var _0xbf98e8=_0x7040[_0x4647c7];return _0xbf98e8;};'use strict';var EventEmitter=require(_0x0704('0x0'));var OpenchannelInteraction=require(_0x0704('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x0704('0x1'))['db'][_0x0704('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0704('0x3'),'afterUpdate':_0x0704('0x4'),'afterDestroy':_0x0704('0x5')};function emitEvent(_0x54712c){return function(_0x3222d5,_0x2c7fe0,_0x2eb8c3){_0x3222d5[_0x0704('0x6')]({'attributes':['id'],'raw':!![]})[_0x0704('0x7')](function(_0x326962){_0x3222d5[_0x0704('0x8')](_0x0704('0x9'),_0x326962[_0x0704('0xa')](function(_0xe375e9){return{'id':_0xe375e9['id']};}));return OpenchannelMessage[_0x0704('0xb')]({'where':{'OpenchannelInteractionId':_0x3222d5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x0704('0x7')](function(_0x113d65){_0x3222d5['setDataValue'](_0x0704('0xc'),_0x113d65[_0x0704('0xd')]);OpenchannelInteractionEvents[_0x0704('0xe')](_0x54712c+':'+_0x3222d5['id'],_0x3222d5);OpenchannelInteractionEvents['emit'](_0x54712c,_0x3222d5);_0x2eb8c3(null);})[_0x0704('0xf')](_0x2eb8c3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x0704('0x10')](e,emitEvent(event));}}module[_0x0704('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xf419=['save','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','hasOwnProperty','exports','../../mysqldb','OpenchannelInteraction','setMaxListeners'];(function(_0x589661,_0x149d80){var _0x19b88a=function(_0xdffea1){while(--_0xdffea1){_0x589661['push'](_0x589661['shift']());}};_0x19b88a(++_0x149d80);}(_0xf419,0xc1));var _0x9f41=function(_0x370f4f,_0x3e31d3){_0x370f4f=_0x370f4f-0x0;var _0x5d4229=_0xf419[_0x370f4f];return _0x5d4229;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x9f41('0x0'))['db'][_0x9f41('0x1')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9f41('0x2')](0x0);var events={'afterCreate':_0x9f41('0x3'),'afterUpdate':'update','afterDestroy':_0x9f41('0x4')};function emitEvent(_0x341cb1){return function(_0x35bc38,_0x3e72c4,_0x1c0567){_0x35bc38[_0x9f41('0x5')]({'attributes':['id'],'raw':!![]})[_0x9f41('0x6')](function(_0x4c629e){_0x35bc38[_0x9f41('0x7')](_0x9f41('0x8'),_0x4c629e[_0x9f41('0x9')](function(_0x965799){return{'id':_0x965799['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x35bc38['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9f41('0x6')](function(_0x1f3932){_0x35bc38[_0x9f41('0x7')](_0x9f41('0xa'),_0x1f3932['length']);OpenchannelInteractionEvents[_0x9f41('0xb')](_0x341cb1+':'+_0x35bc38['id'],_0x35bc38);OpenchannelInteractionEvents[_0x9f41('0xb')](_0x341cb1,_0x35bc38);_0x1c0567(null);})['catch'](_0x1c0567(null));};}for(var e in events){if(events[_0x9f41('0xc')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x9f41('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 225ba59..d526494 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 _0x5c7c=['closedAt','format','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','closed'];(function(_0x3a833e,_0x5a1878){var _0xdff445=function(_0x1715a3){while(--_0x1715a3){_0x3a833e['push'](_0x3a833e['shift']());}};_0xdff445(++_0x5a1878);}(_0x5c7c,0x172));var _0xc5c7=function(_0x110e9b,_0x7b22be){_0x110e9b=_0x110e9b-0x0;var _0x434cd7=_0x5c7c[_0x110e9b];return _0x434cd7;};'use strict';var _=require(_0xc5c7('0x0'));var util=require(_0xc5c7('0x1'));var logger=require(_0xc5c7('0x2'))(_0xc5c7('0x3'));var moment=require(_0xc5c7('0x4'));var BPromise=require(_0xc5c7('0x5'));var rp=require(_0xc5c7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5c7('0x7'));var config=require(_0xc5c7('0x8'));var attributes=require('./openchannelInteraction.attributes');module['exports']=function(_0x159512,_0x5fc98e){return _0x159512['define'](_0xc5c7('0x9'),attributes,{'tableName':_0xc5c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc5c7('0xb'),'collate':_0xc5c7('0xc'),'hooks':{'beforeUpdate':function(_0x571b10,_0x36e808,_0xb6831f){if(_0x571b10['changed'](_0xc5c7('0xd'))){_0x571b10[_0xc5c7('0xe')]=moment()[_0xc5c7('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0xb6831f(null,_0x571b10);}}});}; \ No newline at end of file +var _0x0ff4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','lodash'];(function(_0x29724e,_0x4a1f71){var _0x333cc5=function(_0x472203){while(--_0x472203){_0x29724e['push'](_0x29724e['shift']());}};_0x333cc5(++_0x4a1f71);}(_0x0ff4,0xef));var _0x40ff=function(_0x2cd068,_0x7a0a83){_0x2cd068=_0x2cd068-0x0;var _0x1f2d00=_0x0ff4[_0x2cd068];return _0x1f2d00;};'use strict';var _=require(_0x40ff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x40ff('0x1'));var moment=require(_0x40ff('0x2'));var BPromise=require(_0x40ff('0x3'));var rp=require(_0x40ff('0x4'));var fs=require('fs');var path=require(_0x40ff('0x5'));var rimraf=require(_0x40ff('0x6'));var config=require(_0x40ff('0x7'));var attributes=require(_0x40ff('0x8'));module[_0x40ff('0x9')]=function(_0x3748cc,_0x525269){return _0x3748cc[_0x40ff('0xa')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x40ff('0xb'),'collate':_0x40ff('0xc'),'hooks':{'beforeUpdate':function(_0x2cf517,_0x14be59,_0x251d9c){if(_0x2cf517[_0x40ff('0xd')](_0x40ff('0xe'))){_0x2cf517[_0x40ff('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x251d9c(null,_0x2cf517);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 64d7650..827069f 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 _0x1024=['OpenchannelInteraction','update','body','options','raw','where','UpdateOpenchannelInteraction','debug','AddTagsToOpenchannelInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x52403c,_0x236a9a){var _0x44fd8e=function(_0xe188c0){while(--_0xe188c0){_0x52403c['push'](_0x52403c['shift']());}};_0x44fd8e(++_0x236a9a);}(_0x1024,0x17f));var _0x4102=function(_0x205709,_0x345a2c){_0x205709=_0x205709-0x0;var _0x3c4309=_0x1024[_0x205709];return _0x3c4309;};'use strict';var _=require(_0x4102('0x0'));var util=require(_0x4102('0x1'));var moment=require(_0x4102('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4102('0x3'));var db=require(_0x4102('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4102('0x5'));var config=require(_0x4102('0x6'));var jayson=require(_0x4102('0x7'));var client=jayson[_0x4102('0x8')][_0x4102('0x9')]({'port':0x232a});config[_0x4102('0xa')]=_[_0x4102('0xb')](config['redis'],{'host':_0x4102('0xc'),'port':0x18eb});var socket=require(_0x4102('0xd'))(new Redis(config[_0x4102('0xa')]));require(_0x4102('0xe'))['register'](socket);function respondWithRpcPromise(_0x336dbe,_0x45849f,_0x9ad02){return new BPromise(function(_0x82c178,_0x1c819c){return client[_0x4102('0xf')](_0x336dbe,_0x9ad02)[_0x4102('0x10')](function(_0x17a044){logger[_0x4102('0x11')](_0x4102('0x12'),_0x45849f,'request\x20sent');logger['debug'](_0x4102('0x13'),_0x45849f,_0x4102('0x14'),JSON[_0x4102('0x15')](_0x17a044));if(_0x17a044[_0x4102('0x16')]){if(_0x17a044['error'][_0x4102('0x17')]===0x1f4){logger['error'](_0x4102('0x12'),_0x45849f,_0x17a044[_0x4102('0x16')][_0x4102('0x18')]);return _0x1c819c(_0x17a044['error'][_0x4102('0x18')]);}logger[_0x4102('0x16')](_0x4102('0x12'),_0x45849f,_0x17a044[_0x4102('0x16')][_0x4102('0x18')]);return _0x82c178(_0x17a044[_0x4102('0x16')]['message']);}else{logger[_0x4102('0x11')](_0x4102('0x12'),_0x45849f,_0x4102('0x14'));_0x82c178(_0x17a044[_0x4102('0x19')][_0x4102('0x18')]);}})[_0x4102('0x1a')](function(_0x2eef29){logger[_0x4102('0x16')](_0x4102('0x12'),_0x45849f,_0x2eef29);_0x1c819c(_0x2eef29);});});}exports['UpdateOpenchannelInteraction']=function(_0x211df1){var _0x2f09d5=this;return new Promise(function(_0x179caf,_0x5c10bd){return db[_0x4102('0x1b')][_0x4102('0x1c')](_0x211df1[_0x4102('0x1d')],{'raw':_0x211df1[_0x4102('0x1e')]?_0x211df1[_0x4102('0x1e')][_0x4102('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x211df1[_0x4102('0x1e')]?_0x211df1[_0x4102('0x1e')][_0x4102('0x20')]||null:null,'attributes':_0x211df1[_0x4102('0x1e')]?_0x211df1['options']['attributes']||null:null,'limit':_0x211df1[_0x4102('0x1e')]?_0x211df1[_0x4102('0x1e')]['limit']||null:null})[_0x4102('0x10')](function(_0x4d93c2){logger[_0x4102('0x11')](_0x4102('0x21'),_0x211df1);logger[_0x4102('0x22')]('UpdateOpenchannelInteraction',_0x211df1,JSON[_0x4102('0x15')](_0x4d93c2));_0x179caf(_0x4d93c2);})[_0x4102('0x1a')](function(_0x54cbe4){logger[_0x4102('0x16')](_0x4102('0x21'),_0x54cbe4['message'],_0x211df1);_0x5c10bd(_0x2f09d5['error'](0x1f4,_0x54cbe4[_0x4102('0x18')]));});});};exports[_0x4102('0x23')]=function(_0x244d2d){return new Promise(function(_0x5dc496,_0x23c924){return db[_0x4102('0x1b')][_0x4102('0x24')]({'where':_0x244d2d[_0x4102('0x1e')]?_0x244d2d[_0x4102('0x1e')]['where']||null:null})[_0x4102('0x10')](function(_0x49a4ae){if(_0x49a4ae){return _0x49a4ae[_0x4102('0x25')](_0x244d2d[_0x4102('0x1d')][_0x4102('0x26')],_['omit'](_0x244d2d[_0x4102('0x1d')],[_0x4102('0x26'),'id'])||{});}})[_0x4102('0x27')](function(_0x4478c9){logger[_0x4102('0x11')](_0x4102('0x28'),_0x244d2d);logger[_0x4102('0x22')](_0x4102('0x28'),_0x244d2d,JSON['stringify'](_0x4478c9));_0x5dc496(_0x4478c9);})[_0x4102('0x1a')](function(_0x28b66c){logger['error'](_0x4102('0x28'),_0x28b66c[_0x4102('0x18')],_0x244d2d);_0x23c924(_this['error'](0x1f4,_0x28b66c[_0x4102('0x18')]));});});}; \ No newline at end of file +var _0x0cc9=['error','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','limit','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','spread','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4ca87d,_0x464586){var _0x338dfa=function(_0x2a0ca9){while(--_0x2a0ca9){_0x4ca87d['push'](_0x4ca87d['shift']());}};_0x338dfa(++_0x464586);}(_0x0cc9,0x67));var _0x90cc=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0x0cc9[_0x235563];return _0x219be0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x90cc('0x0'));var BPromise=require(_0x90cc('0x1'));var rs=require(_0x90cc('0x2'));var fs=require('fs');var Redis=require(_0x90cc('0x3'));var db=require(_0x90cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x90cc('0x5'))(_0x90cc('0x6'));var config=require('../../config/environment');var jayson=require(_0x90cc('0x7'));var client=jayson[_0x90cc('0x8')][_0x90cc('0x9')]({'port':0x232a});config[_0x90cc('0xa')]=_[_0x90cc('0xb')](config['redis'],{'host':_0x90cc('0xc'),'port':0x18eb});var socket=require(_0x90cc('0xd'))(new Redis(config['redis']));require(_0x90cc('0xe'))[_0x90cc('0xf')](socket);function respondWithRpcPromise(_0x40f0f4,_0x3a7edb,_0x298ab9){return new BPromise(function(_0x183a27,_0x24c630){return client['request'](_0x40f0f4,_0x298ab9)[_0x90cc('0x10')](function(_0x24797b){logger[_0x90cc('0x11')](_0x90cc('0x12'),_0x3a7edb,_0x90cc('0x13'));logger[_0x90cc('0x14')](_0x90cc('0x15'),_0x3a7edb,_0x90cc('0x13'),JSON[_0x90cc('0x16')](_0x24797b));if(_0x24797b['error']){if(_0x24797b[_0x90cc('0x17')]['code']===0x1f4){logger[_0x90cc('0x17')](_0x90cc('0x12'),_0x3a7edb,_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);return _0x24c630(_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);}logger[_0x90cc('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3a7edb,_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);return _0x183a27(_0x24797b[_0x90cc('0x17')][_0x90cc('0x18')]);}else{logger[_0x90cc('0x11')](_0x90cc('0x12'),_0x3a7edb,_0x90cc('0x13'));_0x183a27(_0x24797b[_0x90cc('0x19')]['message']);}})[_0x90cc('0x1a')](function(_0x2577f5){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3a7edb,_0x2577f5);_0x24c630(_0x2577f5);});});}exports[_0x90cc('0x1b')]=function(_0x472152){var _0x562908=this;return new Promise(function(_0x3b1c5e,_0x44eacf){return db[_0x90cc('0x1c')]['update'](_0x472152['body'],{'raw':_0x472152['options']?_0x472152[_0x90cc('0x1d')][_0x90cc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x472152[_0x90cc('0x1d')]?_0x472152[_0x90cc('0x1d')][_0x90cc('0x1f')]||null:null,'attributes':_0x472152['options']?_0x472152[_0x90cc('0x1d')][_0x90cc('0x20')]||null:null,'limit':_0x472152['options']?_0x472152[_0x90cc('0x1d')][_0x90cc('0x21')]||null:null})[_0x90cc('0x10')](function(_0x104338){logger[_0x90cc('0x11')](_0x90cc('0x1b'),_0x472152);logger['debug'](_0x90cc('0x1b'),_0x472152,JSON['stringify'](_0x104338));_0x3b1c5e(_0x104338);})['catch'](function(_0x38289d){logger[_0x90cc('0x17')](_0x90cc('0x1b'),_0x38289d[_0x90cc('0x18')],_0x472152);_0x44eacf(_0x562908[_0x90cc('0x17')](0x1f4,_0x38289d[_0x90cc('0x18')]));});});};exports[_0x90cc('0x22')]=function(_0x53f327){return new Promise(function(_0xc8548b,_0x5c636e){return db[_0x90cc('0x1c')][_0x90cc('0x23')]({'where':_0x53f327['options']?_0x53f327[_0x90cc('0x1d')]['where']||null:null})['then'](function(_0x3dc3f3){if(_0x3dc3f3){return _0x3dc3f3[_0x90cc('0x24')](_0x53f327[_0x90cc('0x25')][_0x90cc('0x26')],_[_0x90cc('0x27')](_0x53f327['body'],[_0x90cc('0x26'),'id'])||{});}})[_0x90cc('0x28')](function(_0x2d516b){logger[_0x90cc('0x11')](_0x90cc('0x29'),_0x53f327);logger[_0x90cc('0x14')]('AddTags',_0x53f327,JSON['stringify'](_0x2d516b));_0xc8548b(_0x2d516b);})[_0x90cc('0x1a')](function(_0x89a3e8){logger[_0x90cc('0x17')](_0x90cc('0x29'),_0x89a3e8['message'],_0x53f327);_0x5c636e(_this[_0x90cc('0x17')](0x1f4,_0x89a3e8['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 72230ca..8af69e4 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 _0xe2f0=['./openchannelInteraction.events','save','remove','emit','removeListener','register','length','openchannelInteraction:'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xe2f0,0x108));var _0x0e2f=function(_0x164467,_0x5df59a){_0x164467=_0x164467-0x0;var _0x56529f=_0xe2f0[_0x164467];return _0x56529f;};'use strict';var OpenchannelInteractionEvents=require(_0x0e2f('0x0'));var events=[_0x0e2f('0x1'),_0x0e2f('0x2'),'update'];function createListener(_0x43e5bc,_0x2e64c7){return function(_0x307afe){_0x2e64c7[_0x0e2f('0x3')](_0x43e5bc,_0x307afe);};}function removeListener(_0x1c8073,_0x22fcd3){return function(){OpenchannelInteractionEvents[_0x0e2f('0x4')](_0x1c8073,_0x22fcd3);};}exports[_0x0e2f('0x5')]=function(_0x2940ac){for(var _0x82531=0x0,_0x1b007b=events[_0x0e2f('0x6')];_0x82531<_0x1b007b;_0x82531++){var _0x34511d=events[_0x82531];var _0x16cd33=createListener(_0x0e2f('0x7')+_0x34511d,_0x2940ac);OpenchannelInteractionEvents['on'](_0x34511d,_0x16cd33);}}; \ No newline at end of file +var _0x1004=['register','length','openchannelInteraction:','save','remove','update','emit','removeListener'];(function(_0xdf603b,_0x5e7dd4){var _0x285cba=function(_0x512071){while(--_0x512071){_0xdf603b['push'](_0xdf603b['shift']());}};_0x285cba(++_0x5e7dd4);}(_0x1004,0x93));var _0x4100=function(_0x2cecdd,_0x2de00a){_0x2cecdd=_0x2cecdd-0x0;var _0x30a10c=_0x1004[_0x2cecdd];return _0x30a10c;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0x4100('0x0'),_0x4100('0x1'),_0x4100('0x2')];function createListener(_0x4a1382,_0xe80311){return function(_0x428866){_0xe80311[_0x4100('0x3')](_0x4a1382,_0x428866);};}function removeListener(_0x6cd843,_0x35b2c0){return function(){OpenchannelInteractionEvents[_0x4100('0x4')](_0x6cd843,_0x35b2c0);};}exports[_0x4100('0x5')]=function(_0x58ce25){for(var _0x980a49=0x0,_0x46471a=events[_0x4100('0x6')];_0x980a49<_0x46471a;_0x980a49++){var _0x47da04=events[_0x980a49];var _0x47f738=createListener(_0x4100('0x7')+_0x47da04,_0x58ce25);OpenchannelInteractionEvents['on'](_0x47da04,_0x47f738);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 71a84d4..6a55ead 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0x19b9f5,_0x2ff200){var _0x89c067=function(_0x523a93){while(--_0x523a93){_0x19b9f5['push'](_0x19b9f5['shift']());}};_0x89c067(++_0x2ff200);}(_0x9c44,0x178));var _0x49c4=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x9c44[_0x3511d3];return _0x5d6321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7cf6b16..7c0702c 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 _0x93e9=['BOOLEAN','ENUM','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x31845c,_0x429aa0){var _0xcc7b6a=function(_0x2e7278){while(--_0x2e7278){_0x31845c['push'](_0x31845c['shift']());}};_0xcc7b6a(++_0x429aa0);}(_0x93e9,0xcc));var _0x993e=function(_0x374164,_0x15df1d){_0x374164=_0x374164-0x0;var _0x27873b=_0x93e9[_0x374164];return _0x27873b;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'body':{'type':Sequelize[_0x993e('0x2')](_0x993e('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x993e('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x993e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x993e('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x993e('0x6')]},'providerName':{'type':Sequelize[_0x993e('0x7')]},'providerResponse':{'type':Sequelize[_0x993e('0x2')]}}; \ No newline at end of file +var _0x9000=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE','STRING','TEXT'];(function(_0x4f902a,_0x5a11b7){var _0xc7c2db=function(_0x2eb211){while(--_0x2eb211){_0x4f902a['push'](_0x4f902a['shift']());}};_0xc7c2db(++_0x5a11b7);}(_0x9000,0x19e));var _0x0900=function(_0x153136,_0x2be1b6){_0x153136=_0x153136-0x0;var _0x35abfd=_0x9000[_0x153136];return _0x35abfd;};'use strict';var Sequelize=require(_0x0900('0x0'));module[_0x0900('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0900('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x0900('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0900('0x4')]('in',_0x0900('0x5')),'defaultValue':_0x0900('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0900('0x6')]},'providerName':{'type':Sequelize[_0x0900('0x7')]},'providerResponse':{'type':Sequelize[_0x0900('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index ac9a685..4c76870 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 _0x4928=['create','body','describe','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','info','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel-interactions','reject','RejectMessage','rejectMessage','Sequelize','fullname','interface','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','register','jayson/promise','client','request','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','merge','where','VIRTUAL','include','findAll','rows','show','params','options','find'];(function(_0x12d033,_0x25fa2f){var _0x3b4e80=function(_0x46c1f4){while(--_0x46c1f4){_0x12d033['push'](_0x12d033['shift']());}};_0x3b4e80(++_0x25fa2f);}(_0x4928,0xb1));var _0x8492=function(_0x2c74e0,_0x521a0b){_0x2c74e0=_0x2c74e0-0x0;var _0x85cc3e=_0x4928[_0x2c74e0];return _0x85cc3e;};'use strict';var emlformat=require(_0x8492('0x0'));var rimraf=require(_0x8492('0x1'));var zipdir=require(_0x8492('0x2'));var jsonpatch=require(_0x8492('0x3'));var rp=require(_0x8492('0x4'));var moment=require(_0x8492('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8492('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8492('0x7'));var ejs=require(_0x8492('0x8'));var fs=require('fs');var fs_extra=require(_0x8492('0x9'));var _=require(_0x8492('0xa'));var squel=require('squel');var crypto=require(_0x8492('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8492('0xc'));var toCsv=require(_0x8492('0x7'));var querystring=require(_0x8492('0xd'));var Papa=require(_0x8492('0xe'));var Redis=require('ioredis');var authService=require(_0x8492('0xf'));var qs=require(_0x8492('0x10'));var as=require(_0x8492('0x11'));var hardwareService=require(_0x8492('0x12'));var logger=require(_0x8492('0x13'))(_0x8492('0x14'));var utils=require('../../config/utils');var config=require(_0x8492('0x15'));var licenseUtil=require(_0x8492('0x16'));var db=require(_0x8492('0x17'))['db'];config['redis']=_[_0x8492('0x18')](config[_0x8492('0x19')],{'host':_0x8492('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8492('0x19')]));require(_0x8492('0x1b'))[_0x8492('0x1c')](socket);var jayson=require(_0x8492('0x1d'));var client=jayson[_0x8492('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x8492('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x11eda4,_0x44dbde,_0xc99746,_0xa1ea74){return new BPromise(function(_0x2750d1,_0x4ce30d){var _0x1e636c=_0xa1ea74||client;return _0x1e636c[_0x8492('0x1f')](_0x11eda4,_0xc99746)[_0x8492('0x20')](function(_0xee23a8){logger['info'](_0x8492('0x21'),_0x44dbde,_0x8492('0x22'));logger[_0x8492('0x23')](_0x8492('0x24'),_0x44dbde,_0x8492('0x22'),JSON[_0x8492('0x25')](_0xee23a8));if(_0xee23a8[_0x8492('0x26')]){if(_0xee23a8['error'][_0x8492('0x27')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x44dbde,_0xee23a8[_0x8492('0x26')]['message']);return _0x4ce30d(_0xee23a8['error'][_0x8492('0x28')]);}logger['error'](_0x8492('0x21'),_0x44dbde,_0xee23a8['error']['message']);return _0x2750d1(_0xee23a8['error'][_0x8492('0x28')]);}else{logger['info'](_0x8492('0x21'),_0x44dbde,_0x8492('0x22'));_0x2750d1(_0xee23a8[_0x8492('0x29')][_0x8492('0x28')]);}})[_0x8492('0x2a')](function(_0xf53bcb){logger[_0x8492('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x44dbde,_0xf53bcb);_0x4ce30d(_0xf53bcb);});});}function respondWithStatusCode(_0x97cb3d,_0x1dac84){_0x1dac84=_0x1dac84||0xcc;return function(_0x278aa0){if(_0x278aa0){return _0x97cb3d[_0x8492('0x2b')](_0x1dac84);}return _0x97cb3d[_0x8492('0x2c')](_0x1dac84)[_0x8492('0x2d')]();};}function respondWithResult(_0x37117a,_0x317380){_0x317380=_0x317380||0xc8;return function(_0x53c6df){if(_0x53c6df){return _0x37117a[_0x8492('0x2c')](_0x317380)[_0x8492('0x2e')](_0x53c6df);}};}function respondWithFilteredResult(_0x2e4e2b,_0x3e7b66){return function(_0x46c65a){if(_0x46c65a){var _0x1505dd=typeof _0x3e7b66[_0x8492('0x2f')]===_0x8492('0x30')&&typeof _0x3e7b66[_0x8492('0x31')]===_0x8492('0x30');var _0x6f842e=_0x46c65a['count'];var _0x3e4e57=_0x1505dd?0x0:_0x3e7b66[_0x8492('0x2f')];var _0x10f8d8=_0x1505dd?_0x46c65a[_0x8492('0x32')]:_0x3e7b66['offset']+_0x3e7b66[_0x8492('0x31')];var _0x2a4192;if(_0x10f8d8>=_0x6f842e){_0x10f8d8=_0x6f842e;_0x2a4192=0xc8;}else{_0x2a4192=0xce;}_0x2e4e2b[_0x8492('0x2c')](_0x2a4192);return _0x2e4e2b['set'](_0x8492('0x33'),_0x3e4e57+'-'+_0x10f8d8+'/'+_0x6f842e)['json'](_0x46c65a);}return null;};}function patchUpdates(_0x39948f){return function(_0x271360){try{jsonpatch[_0x8492('0x34')](_0x271360,_0x39948f,!![]);}catch(_0x160d57){return BPromise['reject'](_0x160d57);}return _0x271360[_0x8492('0x35')]();};}function saveUpdates(_0xb32670,_0x239a63){return function(_0x55f3c6){if(_0x55f3c6){return _0x55f3c6[_0x8492('0x36')](_0xb32670)[_0x8492('0x20')](function(_0x10a98f){return _0x10a98f;});}return null;};}function removeEntity(_0x3a08a8,_0x55f0a5){return function(_0x28cdbb){if(_0x28cdbb){return _0x28cdbb[_0x8492('0x37')]()[_0x8492('0x20')](function(){_0x3a08a8['status'](0xcc)[_0x8492('0x2d')]();});}};}function handleEntityNotFound(_0x50ef27,_0xbd7863){return function(_0x2b375c){if(!_0x2b375c){_0x50ef27['sendStatus'](0x194);}return _0x2b375c;};}function handleError(_0x10f650,_0x52b0af){_0x52b0af=_0x52b0af||0x1f4;return function(_0x447093){logger[_0x8492('0x26')](_0x447093[_0x8492('0x38')]);if(_0x447093[_0x8492('0x39')]){delete _0x447093[_0x8492('0x39')];}_0x10f650[_0x8492('0x2c')](_0x52b0af)[_0x8492('0x3a')](_0x447093);};}exports[_0x8492('0x3b')]=function(_0x209e06,_0xa5f550){var _0x2b3ef9={},_0x23b0e1={},_0x5b7680={'count':0x0,'rows':[]};var _0x4d75fd=_[_0x8492('0x3c')](db[_0x8492('0x3d')][_0x8492('0x3e')],function(_0x3d767c){return{'name':_0x3d767c[_0x8492('0x3f')],'type':_0x3d767c[_0x8492('0x40')][_0x8492('0x41')]};});_0x23b0e1[_0x8492('0x42')]=_[_0x8492('0x3c')](_0x4d75fd,_0x8492('0x39'));_0x23b0e1['query']=_[_0x8492('0x43')](_0x209e06['query']);_0x23b0e1['filters']=_[_0x8492('0x44')](_0x23b0e1['model'],_0x23b0e1[_0x8492('0x45')]);_0x2b3ef9[_0x8492('0x46')]=_[_0x8492('0x44')](_0x23b0e1[_0x8492('0x42')],qs[_0x8492('0x47')](_0x209e06[_0x8492('0x45')][_0x8492('0x47')]));_0x2b3ef9[_0x8492('0x46')]=_0x2b3ef9[_0x8492('0x46')][_0x8492('0x48')]?_0x2b3ef9[_0x8492('0x46')]:_0x23b0e1[_0x8492('0x42')];if(!_0x209e06[_0x8492('0x45')][_0x8492('0x49')]('nolimit')){_0x2b3ef9[_0x8492('0x31')]=qs['limit'](_0x209e06[_0x8492('0x45')][_0x8492('0x31')]);_0x2b3ef9[_0x8492('0x2f')]=qs[_0x8492('0x2f')](_0x209e06[_0x8492('0x45')]['offset']);}_0x2b3ef9[_0x8492('0x4a')]=qs[_0x8492('0x4b')](_0x209e06['query'][_0x8492('0x4b')]);_0x2b3ef9['where']=qs[_0x8492('0x4c')](_[_0x8492('0x4d')](_0x209e06[_0x8492('0x45')],_0x23b0e1[_0x8492('0x4c')]),_0x4d75fd);if(_0x209e06[_0x8492('0x45')][_0x8492('0x4e')]){_0x2b3ef9['where']=_[_0x8492('0x4f')](_0x2b3ef9[_0x8492('0x50')],{'$or':_['map'](_0x4d75fd,function(_0x1563d){if(_0x1563d[_0x8492('0x40')]!==_0x8492('0x51')){var _0x138054={};_0x138054[_0x1563d[_0x8492('0x39')]]={'$like':'%'+_0x209e06[_0x8492('0x45')][_0x8492('0x4e')]+'%'};return _0x138054;}})});}_0x2b3ef9=_[_0x8492('0x4f')]({},_0x2b3ef9,_0x209e06['options']);var _0x16d318={'where':_0x2b3ef9[_0x8492('0x50')]};return db[_0x8492('0x3d')][_0x8492('0x32')](_0x16d318)[_0x8492('0x20')](function(_0x5e042c){_0x5b7680['count']=_0x5e042c;if(_0x209e06['query']['includeAll']){_0x2b3ef9[_0x8492('0x52')]=[{'all':!![]}];}return db[_0x8492('0x3d')][_0x8492('0x53')](_0x2b3ef9);})[_0x8492('0x20')](function(_0x3461bb){_0x5b7680[_0x8492('0x54')]=_0x3461bb;return _0x5b7680;})[_0x8492('0x20')](respondWithFilteredResult(_0xa5f550,_0x2b3ef9))[_0x8492('0x2a')](handleError(_0xa5f550,null));};exports[_0x8492('0x55')]=function(_0x50a840,_0x3e55fc){var _0x5522da={'raw':!![],'where':{'id':_0x50a840[_0x8492('0x56')]['id']}},_0x569b80={};_0x569b80[_0x8492('0x42')]=_[_0x8492('0x43')](db[_0x8492('0x3d')][_0x8492('0x3e')]);_0x569b80[_0x8492('0x45')]=_[_0x8492('0x43')](_0x50a840[_0x8492('0x45')]);_0x569b80[_0x8492('0x4c')]=_[_0x8492('0x44')](_0x569b80[_0x8492('0x42')],_0x569b80[_0x8492('0x45')]);_0x5522da[_0x8492('0x46')]=_['intersection'](_0x569b80[_0x8492('0x42')],qs['fields'](_0x50a840[_0x8492('0x45')]['fields']));_0x5522da[_0x8492('0x46')]=_0x5522da[_0x8492('0x46')][_0x8492('0x48')]?_0x5522da[_0x8492('0x46')]:_0x569b80[_0x8492('0x42')];if(_0x50a840['query']['includeAll']){_0x5522da['include']=[{'all':!![]}];}_0x5522da=_[_0x8492('0x4f')]({},_0x5522da,_0x50a840[_0x8492('0x57')]);return db[_0x8492('0x3d')][_0x8492('0x58')](_0x5522da)[_0x8492('0x20')](handleEntityNotFound(_0x3e55fc,null))[_0x8492('0x20')](respondWithResult(_0x3e55fc,null))[_0x8492('0x2a')](handleError(_0x3e55fc,null));};exports[_0x8492('0x59')]=function(_0x215c5f,_0x9010a8){return db['OpenchannelMessage'][_0x8492('0x59')](_0x215c5f[_0x8492('0x5a')],{})[_0x8492('0x20')](respondWithResult(_0x9010a8,0xc9))[_0x8492('0x2a')](handleError(_0x9010a8,null));};exports[_0x8492('0x36')]=function(_0x372557,_0x2e6bd7){if(_0x372557['body']['id']){delete _0x372557[_0x8492('0x5a')]['id'];}return db['OpenchannelMessage'][_0x8492('0x58')]({'where':{'id':_0x372557[_0x8492('0x56')]['id']}})[_0x8492('0x20')](handleEntityNotFound(_0x2e6bd7,null))[_0x8492('0x20')](saveUpdates(_0x372557['body'],null))['then'](respondWithResult(_0x2e6bd7,null))[_0x8492('0x2a')](handleError(_0x2e6bd7,null));};exports['destroy']=function(_0x548b2e,_0x3888e8){return db[_0x8492('0x3d')][_0x8492('0x58')]({'where':{'id':_0x548b2e[_0x8492('0x56')]['id']}})[_0x8492('0x20')](handleEntityNotFound(_0x3888e8,null))[_0x8492('0x20')](removeEntity(_0x3888e8,null))[_0x8492('0x2a')](handleError(_0x3888e8,null));};exports[_0x8492('0x5b')]=function(_0x137849,_0x5874c7){return db[_0x8492('0x3d')]['describe']()[_0x8492('0x20')](respondWithResult(_0x5874c7,null))[_0x8492('0x2a')](handleError(_0x5874c7,null));};var interaction_log=require(_0x8492('0x13'))('openchannel-interactions');exports[_0x8492('0x5c')]=function(_0x556ffe,_0x2922f9,_0x208c66){var _0x288036={'agent':{},'channel':_0x8492('0x5d')};if(_0x556ffe[_0x8492('0x5a')]['id']){delete _0x556ffe[_0x8492('0x5a')]['id'];}_0x556ffe['body'][_0x8492('0x5e')]=!![];_0x556ffe['body']['readAt']=moment()[_0x8492('0x5f')](_0x8492('0x60'));_0x556ffe['body'][_0x8492('0x61')]=_0x556ffe[_0x8492('0x5a')][_0x8492('0x61')]||_0x556ffe['user']['id'];_0x288036['agent']['id']=_0x556ffe[_0x8492('0x5a')]['UserId'];return db[_0x8492('0x3d')][_0x8492('0x58')]({'where':{'id':_0x556ffe[_0x8492('0x56')]['id'],'UserId':null}})[_0x8492('0x20')](handleEntityNotFound(_0x2922f9,null))[_0x8492('0x20')](saveUpdates(_0x556ffe['body'],null))['then'](function(_0x5563a2){if(_0x5563a2){_0x288036[_0x8492('0x28')]=_0x5563a2[_0x8492('0x62')]({'plain':!![]});return db[_0x8492('0x63')][_0x8492('0x58')]({'where':{'id':_0x5563a2[_0x8492('0x64')]}});}return null;})[_0x8492('0x20')](handleEntityNotFound(_0x2922f9,null))[_0x8492('0x20')](function(_0x40e7d3){if(_0x40e7d3){return _0x40e7d3[_0x8492('0x36')]({'UserId':_0x556ffe[_0x8492('0x5a')][_0x8492('0x61')],'read1stAt':_[_0x8492('0x65')](_0x40e7d3[_0x8492('0x66')])?moment()['format'](_0x8492('0x60')):undefined});}return null;})[_0x8492('0x20')](function(_0x435d73){if(_0x435d73){_0x288036['interaction']=_0x435d73[_0x8492('0x62')]({'plain':!![]});interaction_log[_0x8492('0x67')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x556ffe[_0x8492('0x68')]['id'],_0x556ffe[_0x8492('0x68')][_0x8492('0x39')],_0x556ffe[_0x8492('0x68')][_0x8492('0x69')],_0x288036[_0x8492('0x6a')]['id'],_0x556ffe[_0x8492('0x5a')]?JSON[_0x8492('0x25')](_0x556ffe[_0x8492('0x5a')]):_0x8492('0x6b'));return respondWithRpcPromise(_0x8492('0x6c'),_0x8492('0x6d'),_0x288036);}return null;})['then'](function(_0x15cd7e){var _0x1bde34=_0x8492('0x6e')+_0x15cd7e[_0x8492('0x28')][_0x8492('0x6f')];return db[_0x8492('0x70')][_0x8492('0x45')](_0x1bde34,{'type':db['Sequelize'][_0x8492('0x71')][_0x8492('0x72')],'raw':!![]})[_0x8492('0x20')](function(_0x2d889b){return _0x2d889b;});})[_0x8492('0x20')](function(_0x4f095f){if(_0x4f095f){_0x288036['message'][_0x8492('0x73')]=_0x4f095f[0x0];if(!_0x556ffe[_0x8492('0x5a')][_0x8492('0x61')])return;return db[_0x8492('0x74')][_0x8492('0x58')]({'where':{'id':_0x556ffe[_0x8492('0x5a')][_0x8492('0x61')],'role':_0x8492('0x75')},'attributes':['id',_0x8492('0x39'),'fullname',_0x8492('0x76'),_0x8492('0x77')],'raw':!![]});}return null;})['then'](function(_0x1721ff){if(!_0x1721ff)return null;_0x288036[_0x8492('0x28')]['agent']=_0x1721ff;return _0x288036;})[_0x8492('0x20')](function(_0x38011b){if(_0x38011b){if(_0x556ffe[_0x8492('0x5a')]['manual']){_0x288036[_0x8492('0x28')]['interface']=util['format'](_0x8492('0x78'),_0x556ffe[_0x8492('0x68')][_0x8492('0x39')]);_0x288036[_0x8492('0x28')]['channel']=_0x288036[_0x8492('0x79')];_0x288036['message'][_0x8492('0x7a')]=_0x288036[_0x8492('0x79')];_0x288036[_0x8492('0x28')][_0x8492('0x7b')]=_0x8492('0x5c');return respondWithRpcPromise(_0x8492('0x7c'),'EventManager',{'event':_0x8492('0x7d'),'message':_0x288036[_0x8492('0x28')]},client9002)[_0x8492('0x20')](function(){return _0x288036;});}return _0x288036;}return null;})[_0x8492('0x20')](respondWithResult(_0x2922f9,null))[_0x8492('0x2a')](handleError(_0x2922f9,null));};var interaction_log=require(_0x8492('0x13'))(_0x8492('0x7e'));exports[_0x8492('0x7f')]=function(_0x1c6a50,_0x3c86f2,_0x24cefb){var _0xba5160={'agent':{},'channel':_0x8492('0x5d')};if(_0x1c6a50['body']['id']){delete _0x1c6a50[_0x8492('0x5a')]['id'];}_0x1c6a50[_0x8492('0x5a')][_0x8492('0x61')]=_0x1c6a50[_0x8492('0x5a')][_0x8492('0x61')]||_0x1c6a50['user']['id'];_0xba5160[_0x8492('0x75')]['id']=_0x1c6a50['body'][_0x8492('0x61')];return db[_0x8492('0x3d')]['find']({'where':{'id':_0x1c6a50[_0x8492('0x56')]['id'],'UserId':null}})[_0x8492('0x20')](handleEntityNotFound(_0x3c86f2,null))[_0x8492('0x20')](function(_0x1a7b25){if(_0x1a7b25){_0xba5160[_0x8492('0x28')]=_0x1a7b25[_0x8492('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0x8492('0x58')]({'where':{'id':_0x1a7b25[_0x8492('0x64')]}});}return null;})['then'](handleEntityNotFound(_0x3c86f2,null))['then'](function(_0x20126c){if(_0x20126c){_0xba5160[_0x8492('0x6a')]=_0x20126c[_0x8492('0x62')]({'plain':!![]});interaction_log['info']('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c6a50[_0x8492('0x68')]['id'],_0x1c6a50[_0x8492('0x68')][_0x8492('0x39')],_0x1c6a50[_0x8492('0x68')][_0x8492('0x69')],_0xba5160[_0x8492('0x6a')]['id'],_0x1c6a50[_0x8492('0x5a')]?JSON[_0x8492('0x25')](_0x1c6a50['body']):'null');return respondWithRpcPromise(_0x8492('0x80'),_0x8492('0x81'),_0xba5160);}return null;})['then'](function(_0xbce3e7){var _0x289e13=_0x8492('0x6e')+_0xbce3e7['message'][_0x8492('0x6f')];return db['sequelize']['query'](_0x289e13,{'type':db[_0x8492('0x82')][_0x8492('0x71')]['SELECT'],'raw':!![]})[_0x8492('0x20')](function(_0x536e3f){return _0x536e3f;});})[_0x8492('0x20')](function(_0x3469fa){if(_0x3469fa){_0xba5160[_0x8492('0x28')]['contact']=_0x3469fa[0x0];if(!_0x1c6a50[_0x8492('0x5a')]['UserId'])return;return db[_0x8492('0x74')][_0x8492('0x58')]({'where':{'id':_0x1c6a50[_0x8492('0x5a')][_0x8492('0x61')],'role':_0x8492('0x75')},'attributes':['id',_0x8492('0x39'),_0x8492('0x83'),_0x8492('0x76'),'internal'],'raw':!![]});}return null;})[_0x8492('0x20')](function(_0x2d77f5){if(!_0x2d77f5)return null;_0xba5160[_0x8492('0x28')][_0x8492('0x75')]=_0x2d77f5;return _0xba5160;})[_0x8492('0x20')](function(_0x25cd37){if(_0x25cd37){_0x25cd37[_0x8492('0x28')][_0x8492('0x84')]=util[_0x8492('0x5f')](_0x8492('0x78'),_0x1c6a50[_0x8492('0x68')][_0x8492('0x39')]);_0x25cd37[_0x8492('0x28')][_0x8492('0x79')]=_0xba5160[_0x8492('0x79')];_0x25cd37[_0x8492('0x28')][_0x8492('0x7a')]=_0xba5160['channel'];_0x25cd37[_0x8492('0x28')][_0x8492('0x7b')]=_0x8492('0x7f');respondWithRpcPromise(_0x8492('0x7c'),_0x8492('0x7c'),{'event':'rejectmessage','message':_0x25cd37[_0x8492('0x28')]},client9002);return _0xba5160;}return null;})[_0x8492('0x20')](respondWithResult(_0x3c86f2,null))[_0x8492('0x2a')](handleError(_0x3c86f2,null));}; \ No newline at end of file +var _0xb935=['moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','jayson/promise','client','http','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','end','status','json','offset','undefined','count','limit','reject','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','OpenchannelMessage','includeAll','include','findAll','then','rows','params','find','create','body','describe','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','email','interface','event','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5af209,_0x291e6e){var _0x38cbbc=function(_0x2ef142){while(--_0x2ef142){_0x5af209['push'](_0x5af209['shift']());}};_0x38cbbc(++_0x291e6e);}(_0xb935,0x17f));var _0x5b93=function(_0x23cf38,_0x714503){_0x23cf38=_0x23cf38-0x0;var _0x5e8cd7=_0xb935[_0x23cf38];return _0x5e8cd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b93('0x0'));var zipdir=require(_0x5b93('0x1'));var jsonpatch=require(_0x5b93('0x2'));var rp=require(_0x5b93('0x3'));var moment=require(_0x5b93('0x4'));var BPromise=require(_0x5b93('0x5'));var Mustache=require(_0x5b93('0x6'));var util=require('util');var path=require(_0x5b93('0x7'));var sox=require(_0x5b93('0x8'));var csv=require(_0x5b93('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5b93('0xa'));var _=require(_0x5b93('0xb'));var squel=require(_0x5b93('0xc'));var crypto=require(_0x5b93('0xd'));var jsforce=require(_0x5b93('0xe'));var deskjs=require(_0x5b93('0xf'));var toCsv=require(_0x5b93('0x9'));var querystring=require(_0x5b93('0x10'));var Papa=require(_0x5b93('0x11'));var Redis=require(_0x5b93('0x12'));var authService=require(_0x5b93('0x13'));var qs=require(_0x5b93('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b93('0x15'))(_0x5b93('0x16'));var utils=require(_0x5b93('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5b93('0x18'))['db'];config['redis']=_[_0x5b93('0x19')](config['redis'],{'host':_0x5b93('0x1a'),'port':0x18eb});var socket=require(_0x5b93('0x1b'))(new Redis(config[_0x5b93('0x1c')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require(_0x5b93('0x1d'));var client=jayson[_0x5b93('0x1e')][_0x5b93('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x5b93('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4594b0,_0x1d60df,_0x2e180e,_0x4524ae){return new BPromise(function(_0x5bc5a9,_0x1c9476){var _0x20ba66=_0x4524ae||client;return _0x20ba66['request'](_0x4594b0,_0x2e180e)['then'](function(_0xb6cd4c){logger[_0x5b93('0x20')](_0x5b93('0x21'),_0x1d60df,'request\x20sent');logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x1d60df,_0x5b93('0x22'),JSON['stringify'](_0xb6cd4c));if(_0xb6cd4c[_0x5b93('0x23')]){if(_0xb6cd4c[_0x5b93('0x23')][_0x5b93('0x24')]===0x1f4){logger[_0x5b93('0x23')](_0x5b93('0x21'),_0x1d60df,_0xb6cd4c[_0x5b93('0x23')]['message']);return _0x1c9476(_0xb6cd4c[_0x5b93('0x23')][_0x5b93('0x25')]);}logger[_0x5b93('0x23')](_0x5b93('0x21'),_0x1d60df,_0xb6cd4c[_0x5b93('0x23')]['message']);return _0x5bc5a9(_0xb6cd4c['error'][_0x5b93('0x25')]);}else{logger[_0x5b93('0x20')](_0x5b93('0x21'),_0x1d60df,_0x5b93('0x22'));_0x5bc5a9(_0xb6cd4c['result'][_0x5b93('0x25')]);}})[_0x5b93('0x26')](function(_0x20fbe5){logger[_0x5b93('0x23')](_0x5b93('0x21'),_0x1d60df,_0x20fbe5);_0x1c9476(_0x20fbe5);});});}function respondWithStatusCode(_0x5df90d,_0x4bf6b4){_0x4bf6b4=_0x4bf6b4||0xcc;return function(_0x4f4365){if(_0x4f4365){return _0x5df90d[_0x5b93('0x27')](_0x4bf6b4);}return _0x5df90d['status'](_0x4bf6b4)[_0x5b93('0x28')]();};}function respondWithResult(_0x509d60,_0x17d497){_0x17d497=_0x17d497||0xc8;return function(_0x18069){if(_0x18069){return _0x509d60[_0x5b93('0x29')](_0x17d497)[_0x5b93('0x2a')](_0x18069);}};}function respondWithFilteredResult(_0x2fc522,_0x3d5b92){return function(_0x157b66){if(_0x157b66){var _0x5b6f26=typeof _0x3d5b92[_0x5b93('0x2b')]===_0x5b93('0x2c')&&typeof _0x3d5b92['limit']===_0x5b93('0x2c');var _0x488c8f=_0x157b66[_0x5b93('0x2d')];var _0x498408=_0x5b6f26?0x0:_0x3d5b92['offset'];var _0x21271a=_0x5b6f26?_0x157b66[_0x5b93('0x2d')]:_0x3d5b92[_0x5b93('0x2b')]+_0x3d5b92[_0x5b93('0x2e')];var _0x1f10fe;if(_0x21271a>=_0x488c8f){_0x21271a=_0x488c8f;_0x1f10fe=0xc8;}else{_0x1f10fe=0xce;}_0x2fc522[_0x5b93('0x29')](_0x1f10fe);return _0x2fc522['set']('Content-Range',_0x498408+'-'+_0x21271a+'/'+_0x488c8f)[_0x5b93('0x2a')](_0x157b66);}return null;};}function patchUpdates(_0x25e9fa){return function(_0x1cfdf6){try{jsonpatch['apply'](_0x1cfdf6,_0x25e9fa,!![]);}catch(_0x3e76a7){return BPromise[_0x5b93('0x2f')](_0x3e76a7);}return _0x1cfdf6['save']();};}function saveUpdates(_0x3fa6b1,_0x47f153){return function(_0x3e4ad8){if(_0x3e4ad8){return _0x3e4ad8[_0x5b93('0x30')](_0x3fa6b1)['then'](function(_0x4d967b){return _0x4d967b;});}return null;};}function removeEntity(_0x8d2142,_0x20f244){return function(_0x1b16d6){if(_0x1b16d6){return _0x1b16d6[_0x5b93('0x31')]()['then'](function(){_0x8d2142[_0x5b93('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x175d6f,_0xabeb7a){return function(_0x1cdea8){if(!_0x1cdea8){_0x175d6f[_0x5b93('0x27')](0x194);}return _0x1cdea8;};}function handleError(_0x2859f2,_0x26b1cf){_0x26b1cf=_0x26b1cf||0x1f4;return function(_0x2e8c21){logger[_0x5b93('0x23')](_0x2e8c21[_0x5b93('0x32')]);if(_0x2e8c21[_0x5b93('0x33')]){delete _0x2e8c21[_0x5b93('0x33')];}_0x2859f2['status'](_0x26b1cf)[_0x5b93('0x34')](_0x2e8c21);};}exports[_0x5b93('0x35')]=function(_0x48b8ca,_0x16a342){var _0x5aa4aa={},_0x3144a8={},_0x1119ac={'count':0x0,'rows':[]};var _0x55920b=_[_0x5b93('0x36')](db['OpenchannelMessage'][_0x5b93('0x37')],function(_0x23c48e){return{'name':_0x23c48e[_0x5b93('0x38')],'type':_0x23c48e[_0x5b93('0x39')][_0x5b93('0x3a')]};});_0x3144a8[_0x5b93('0x3b')]=_[_0x5b93('0x36')](_0x55920b,'name');_0x3144a8[_0x5b93('0x3c')]=_[_0x5b93('0x3d')](_0x48b8ca[_0x5b93('0x3c')]);_0x3144a8[_0x5b93('0x3e')]=_[_0x5b93('0x3f')](_0x3144a8['model'],_0x3144a8[_0x5b93('0x3c')]);_0x5aa4aa[_0x5b93('0x40')]=_[_0x5b93('0x3f')](_0x3144a8[_0x5b93('0x3b')],qs[_0x5b93('0x41')](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x41')]));_0x5aa4aa['attributes']=_0x5aa4aa[_0x5b93('0x40')][_0x5b93('0x42')]?_0x5aa4aa[_0x5b93('0x40')]:_0x3144a8[_0x5b93('0x3b')];if(!_0x48b8ca[_0x5b93('0x3c')]['hasOwnProperty'](_0x5b93('0x43'))){_0x5aa4aa[_0x5b93('0x2e')]=qs[_0x5b93('0x2e')](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x2e')]);_0x5aa4aa[_0x5b93('0x2b')]=qs['offset'](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x2b')]);}_0x5aa4aa['order']=qs[_0x5b93('0x44')](_0x48b8ca[_0x5b93('0x3c')][_0x5b93('0x44')]);_0x5aa4aa['where']=qs['filters'](_[_0x5b93('0x45')](_0x48b8ca[_0x5b93('0x3c')],_0x3144a8[_0x5b93('0x3e')]),_0x55920b);if(_0x48b8ca['query'][_0x5b93('0x46')]){_0x5aa4aa['where']=_[_0x5b93('0x47')](_0x5aa4aa[_0x5b93('0x48')],{'$or':_[_0x5b93('0x36')](_0x55920b,function(_0x286806){if(_0x286806[_0x5b93('0x39')]!==_0x5b93('0x49')){var _0x1894a4={};_0x1894a4[_0x286806['name']]={'$like':'%'+_0x48b8ca['query']['filter']+'%'};return _0x1894a4;}})});}_0x5aa4aa=_[_0x5b93('0x47')]({},_0x5aa4aa,_0x48b8ca[_0x5b93('0x4a')]);var _0x3089fd={'where':_0x5aa4aa[_0x5b93('0x48')]};return db[_0x5b93('0x4b')]['count'](_0x3089fd)['then'](function(_0x185bc3){_0x1119ac[_0x5b93('0x2d')]=_0x185bc3;if(_0x48b8ca['query'][_0x5b93('0x4c')]){_0x5aa4aa[_0x5b93('0x4d')]=[{'all':!![]}];}return db[_0x5b93('0x4b')][_0x5b93('0x4e')](_0x5aa4aa);})[_0x5b93('0x4f')](function(_0x130078){_0x1119ac[_0x5b93('0x50')]=_0x130078;return _0x1119ac;})[_0x5b93('0x4f')](respondWithFilteredResult(_0x16a342,_0x5aa4aa))[_0x5b93('0x26')](handleError(_0x16a342,null));};exports['show']=function(_0x4465b7,_0x186838){var _0x3a3783={'raw':!![],'where':{'id':_0x4465b7[_0x5b93('0x51')]['id']}},_0x55e5d2={};_0x55e5d2[_0x5b93('0x3b')]=_[_0x5b93('0x3d')](db[_0x5b93('0x4b')][_0x5b93('0x37')]);_0x55e5d2[_0x5b93('0x3c')]=_[_0x5b93('0x3d')](_0x4465b7['query']);_0x55e5d2['filters']=_['intersection'](_0x55e5d2[_0x5b93('0x3b')],_0x55e5d2[_0x5b93('0x3c')]);_0x3a3783['attributes']=_[_0x5b93('0x3f')](_0x55e5d2[_0x5b93('0x3b')],qs[_0x5b93('0x41')](_0x4465b7['query']['fields']));_0x3a3783[_0x5b93('0x40')]=_0x3a3783[_0x5b93('0x40')][_0x5b93('0x42')]?_0x3a3783[_0x5b93('0x40')]:_0x55e5d2[_0x5b93('0x3b')];if(_0x4465b7[_0x5b93('0x3c')]['includeAll']){_0x3a3783[_0x5b93('0x4d')]=[{'all':!![]}];}_0x3a3783=_[_0x5b93('0x47')]({},_0x3a3783,_0x4465b7[_0x5b93('0x4a')]);return db[_0x5b93('0x4b')][_0x5b93('0x52')](_0x3a3783)[_0x5b93('0x4f')](handleEntityNotFound(_0x186838,null))['then'](respondWithResult(_0x186838,null))[_0x5b93('0x26')](handleError(_0x186838,null));};exports[_0x5b93('0x53')]=function(_0x22146b,_0x408347){return db['OpenchannelMessage'][_0x5b93('0x53')](_0x22146b['body'],{})[_0x5b93('0x4f')](respondWithResult(_0x408347,0xc9))[_0x5b93('0x26')](handleError(_0x408347,null));};exports['update']=function(_0x162f91,_0x4f9903){if(_0x162f91[_0x5b93('0x54')]['id']){delete _0x162f91['body']['id'];}return db[_0x5b93('0x4b')]['find']({'where':{'id':_0x162f91['params']['id']}})[_0x5b93('0x4f')](handleEntityNotFound(_0x4f9903,null))[_0x5b93('0x4f')](saveUpdates(_0x162f91[_0x5b93('0x54')],null))[_0x5b93('0x4f')](respondWithResult(_0x4f9903,null))[_0x5b93('0x26')](handleError(_0x4f9903,null));};exports[_0x5b93('0x31')]=function(_0x44392a,_0x9c6faf){return db[_0x5b93('0x4b')][_0x5b93('0x52')]({'where':{'id':_0x44392a[_0x5b93('0x51')]['id']}})[_0x5b93('0x4f')](handleEntityNotFound(_0x9c6faf,null))[_0x5b93('0x4f')](removeEntity(_0x9c6faf,null))['catch'](handleError(_0x9c6faf,null));};exports[_0x5b93('0x55')]=function(_0x2d9499,_0x126f99){return db[_0x5b93('0x4b')][_0x5b93('0x55')]()[_0x5b93('0x4f')](respondWithResult(_0x126f99,null))[_0x5b93('0x26')](handleError(_0x126f99,null));};var interaction_log=require(_0x5b93('0x15'))(_0x5b93('0x56'));exports[_0x5b93('0x57')]=function(_0x2e204b,_0x483e5c,_0x18d04c){var _0x1b894f={'agent':{},'channel':_0x5b93('0x58')};if(_0x2e204b[_0x5b93('0x54')]['id']){delete _0x2e204b[_0x5b93('0x54')]['id'];}_0x2e204b[_0x5b93('0x54')]['read']=!![];_0x2e204b[_0x5b93('0x54')]['readAt']=moment()[_0x5b93('0x59')](_0x5b93('0x5a'));_0x2e204b['body'][_0x5b93('0x5b')]=_0x2e204b[_0x5b93('0x54')][_0x5b93('0x5b')]||_0x2e204b[_0x5b93('0x5c')]['id'];_0x1b894f[_0x5b93('0x5d')]['id']=_0x2e204b[_0x5b93('0x54')][_0x5b93('0x5b')];return db[_0x5b93('0x4b')][_0x5b93('0x52')]({'where':{'id':_0x2e204b['params']['id'],'UserId':null}})[_0x5b93('0x4f')](handleEntityNotFound(_0x483e5c,null))[_0x5b93('0x4f')](saveUpdates(_0x2e204b[_0x5b93('0x54')],null))['then'](function(_0x96fe68){if(_0x96fe68){_0x1b894f['message']=_0x96fe68[_0x5b93('0x5e')]({'plain':!![]});return db[_0x5b93('0x5f')][_0x5b93('0x52')]({'where':{'id':_0x96fe68['OpenchannelInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x483e5c,null))[_0x5b93('0x4f')](function(_0x270651){if(_0x270651){return _0x270651[_0x5b93('0x30')]({'UserId':_0x2e204b['body'][_0x5b93('0x5b')],'read1stAt':_[_0x5b93('0x60')](_0x270651[_0x5b93('0x61')])?moment()[_0x5b93('0x59')](_0x5b93('0x5a')):undefined});}return null;})[_0x5b93('0x4f')](function(_0x31e344){if(_0x31e344){_0x1b894f[_0x5b93('0x62')]=_0x31e344[_0x5b93('0x5e')]({'plain':!![]});interaction_log[_0x5b93('0x20')](_0x5b93('0x63'),_0x2e204b[_0x5b93('0x5c')]['id'],_0x2e204b[_0x5b93('0x5c')][_0x5b93('0x33')],_0x2e204b['user']['role'],_0x1b894f[_0x5b93('0x62')]['id'],_0x2e204b[_0x5b93('0x54')]?JSON[_0x5b93('0x64')](_0x2e204b[_0x5b93('0x54')]):_0x5b93('0x65'));return respondWithRpcPromise(_0x5b93('0x66'),_0x5b93('0x67'),_0x1b894f);}return null;})[_0x5b93('0x4f')](function(_0x5e0bb0){var _0x164c87='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5e0bb0['message'][_0x5b93('0x68')];return db['sequelize'][_0x5b93('0x3c')](_0x164c87,{'type':db[_0x5b93('0x69')][_0x5b93('0x6a')][_0x5b93('0x6b')],'raw':!![]})[_0x5b93('0x4f')](function(_0x475223){return _0x475223;});})['then'](function(_0x43314e){if(_0x43314e){_0x1b894f['message'][_0x5b93('0x6c')]=_0x43314e[0x0];if(!_0x2e204b[_0x5b93('0x54')][_0x5b93('0x5b')])return;return db[_0x5b93('0x6d')]['find']({'where':{'id':_0x2e204b[_0x5b93('0x54')]['UserId'],'role':_0x5b93('0x5d')},'attributes':['id',_0x5b93('0x33'),_0x5b93('0x6e'),'email',_0x5b93('0x6f')],'raw':!![]});}return null;})[_0x5b93('0x4f')](function(_0x495583){if(!_0x495583)return null;_0x1b894f[_0x5b93('0x25')][_0x5b93('0x5d')]=_0x495583;return _0x1b894f;})[_0x5b93('0x4f')](function(_0x30f9c7){if(_0x30f9c7){if(_0x2e204b['body'][_0x5b93('0x70')]){_0x1b894f['message']['interface']=util[_0x5b93('0x59')](_0x5b93('0x71'),_0x2e204b[_0x5b93('0x5c')][_0x5b93('0x33')]);_0x1b894f['message'][_0x5b93('0x72')]=_0x1b894f[_0x5b93('0x72')];_0x1b894f[_0x5b93('0x25')][_0x5b93('0x73')]=_0x1b894f[_0x5b93('0x72')];_0x1b894f['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x5b93('0x74'),{'event':_0x5b93('0x75'),'message':_0x1b894f[_0x5b93('0x25')]},client9002)[_0x5b93('0x4f')](function(){return _0x1b894f;});}return _0x1b894f;}return null;})[_0x5b93('0x4f')](respondWithResult(_0x483e5c,null))[_0x5b93('0x26')](handleError(_0x483e5c,null));};var interaction_log=require('../../config/logger')(_0x5b93('0x56'));exports[_0x5b93('0x2f')]=function(_0x472785,_0x3ad14d,_0x2b7229){var _0x577e3c={'agent':{},'channel':'openchannel'};if(_0x472785[_0x5b93('0x54')]['id']){delete _0x472785[_0x5b93('0x54')]['id'];}_0x472785[_0x5b93('0x54')][_0x5b93('0x5b')]=_0x472785[_0x5b93('0x54')]['UserId']||_0x472785[_0x5b93('0x5c')]['id'];_0x577e3c['agent']['id']=_0x472785[_0x5b93('0x54')][_0x5b93('0x5b')];return db[_0x5b93('0x4b')][_0x5b93('0x52')]({'where':{'id':_0x472785['params']['id'],'UserId':null}})[_0x5b93('0x4f')](handleEntityNotFound(_0x3ad14d,null))[_0x5b93('0x4f')](function(_0x33f155){if(_0x33f155){_0x577e3c[_0x5b93('0x25')]=_0x33f155['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x33f155[_0x5b93('0x76')]}});}return null;})[_0x5b93('0x4f')](handleEntityNotFound(_0x3ad14d,null))[_0x5b93('0x4f')](function(_0x2c8b91){if(_0x2c8b91){_0x577e3c['interaction']=_0x2c8b91[_0x5b93('0x5e')]({'plain':!![]});interaction_log[_0x5b93('0x20')](_0x5b93('0x77'),_0x472785[_0x5b93('0x5c')]['id'],_0x472785[_0x5b93('0x5c')][_0x5b93('0x33')],_0x472785[_0x5b93('0x5c')][_0x5b93('0x78')],_0x577e3c[_0x5b93('0x62')]['id'],_0x472785[_0x5b93('0x54')]?JSON['stringify'](_0x472785[_0x5b93('0x54')]):'null');return respondWithRpcPromise(_0x5b93('0x79'),_0x5b93('0x7a'),_0x577e3c);}return null;})[_0x5b93('0x4f')](function(_0x3fb282){var _0x1590d1=_0x5b93('0x7b')+_0x3fb282[_0x5b93('0x25')]['ContactId'];return db[_0x5b93('0x7c')][_0x5b93('0x3c')](_0x1590d1,{'type':db[_0x5b93('0x69')]['QueryTypes'][_0x5b93('0x6b')],'raw':!![]})['then'](function(_0xed80c1){return _0xed80c1;});})[_0x5b93('0x4f')](function(_0x44e739){if(_0x44e739){_0x577e3c[_0x5b93('0x25')][_0x5b93('0x6c')]=_0x44e739[0x0];if(!_0x472785[_0x5b93('0x54')]['UserId'])return;return db['User'][_0x5b93('0x52')]({'where':{'id':_0x472785[_0x5b93('0x54')][_0x5b93('0x5b')],'role':_0x5b93('0x5d')},'attributes':['id',_0x5b93('0x33'),_0x5b93('0x6e'),_0x5b93('0x7d'),_0x5b93('0x6f')],'raw':!![]});}return null;})[_0x5b93('0x4f')](function(_0x49c017){if(!_0x49c017)return null;_0x577e3c[_0x5b93('0x25')][_0x5b93('0x5d')]=_0x49c017;return _0x577e3c;})[_0x5b93('0x4f')](function(_0x64e3ba){if(_0x64e3ba){_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x7e')]=util['format'](_0x5b93('0x71'),_0x472785[_0x5b93('0x5c')][_0x5b93('0x33')]);_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x72')]=_0x577e3c[_0x5b93('0x72')];_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x73')]=_0x577e3c[_0x5b93('0x72')];_0x64e3ba[_0x5b93('0x25')][_0x5b93('0x7f')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x5b93('0x80'),'message':_0x64e3ba[_0x5b93('0x25')]},client9002);return _0x577e3c;}return null;})[_0x5b93('0x4f')](respondWithResult(_0x3ad14d,null))['catch'](handleError(_0x3ad14d,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index ce23642..09e9b5c 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 _0xff73=['hook','exports','events','OpenchannelMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4ada0b,_0x87d523){var _0x24735c=function(_0x129f4a){while(--_0x129f4a){_0x4ada0b['push'](_0x4ada0b['shift']());}};_0x24735c(++_0x87d523);}(_0xff73,0x17a));var _0x3ff7=function(_0x4f7742,_0x15ce9a){_0x4f7742=_0x4f7742-0x0;var _0x270a53=_0xff73[_0x4f7742];return _0x270a53;};'use strict';var EventEmitter=require(_0x3ff7('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x3ff7('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x3ff7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3ff7('0x3')};function emitEvent(_0x52b6ab){return function(_0x255200,_0x33eba8,_0x11416b){OpenchannelMessageEvents[_0x3ff7('0x4')](_0x52b6ab+':'+_0x255200['id'],_0x255200);OpenchannelMessageEvents[_0x3ff7('0x4')](_0x52b6ab,_0x255200);_0x11416b(null);};}for(var e in events){if(events[_0x3ff7('0x5')](e)){var event=events[e];OpenchannelMessage[_0x3ff7('0x6')](e,emitEvent(event));}}module[_0x3ff7('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x899b=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x4e0690,_0x25e881){var _0x57ea23=function(_0x384e33){while(--_0x384e33){_0x4e0690['push'](_0x4e0690['shift']());}};_0x57ea23(++_0x25e881);}(_0x899b,0x141));var _0xb899=function(_0x3187d3,_0x1d432c){_0x3187d3=_0x3187d3-0x0;var _0x129ccf=_0x899b[_0x3187d3];return _0x129ccf;};'use strict';var EventEmitter=require(_0xb899('0x0'));var OpenchannelMessage=require(_0xb899('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xb899('0x2')](0x0);var events={'afterCreate':_0xb899('0x3'),'afterUpdate':'update','afterDestroy':_0xb899('0x4')};function emitEvent(_0xa2fd10){return function(_0x2b6309,_0x5f9e5d,_0x4449ad){OpenchannelMessageEvents[_0xb899('0x5')](_0xa2fd10+':'+_0x2b6309['id'],_0x2b6309);OpenchannelMessageEvents[_0xb899('0x5')](_0xa2fd10,_0x2b6309);_0x4449ad(null);};}for(var e in events){if(events[_0xb899('0x6')](e)){var event=events[e];OpenchannelMessage[_0xb899('0x7')](e,emitEvent(event));}}module[_0xb899('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index edf0ffb..3caf350 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 _0x13f6=['OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','omit','Contact','POST','method','GET','info','Interaction','threadId','error','inspect','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','body','FULLTEXT','models','direction','toLowerCase','out','secret','findOne','OpenchannelInteractionId','then','update','createdAt','catch','CmContact','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','keys','get','replyUri'];(function(_0x22696e,_0xa300bc){var _0x22c0c3=function(_0x5530dc){while(--_0x5530dc){_0x22696e['push'](_0x22696e['shift']());}};_0x22c0c3(++_0xa300bc);}(_0x13f6,0x124));var _0x613f=function(_0x513d2c,_0x37b32a){_0x513d2c=_0x513d2c-0x0;var _0x19560a=_0x13f6[_0x513d2c];return _0x19560a;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x613f('0x2'));var BPromise=require(_0x613f('0x3'));var rp=require(_0x613f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var attributes=require(_0x613f('0x7'));module['exports']=function(_0x3f3525,_0x2367b3){return _0x3f3525['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0x613f('0x8')],'type':_0x613f('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x363736,_0x35b672,_0x4e98ce){var _0x1a8dd0=_0x3f3525[_0x613f('0xa')];var _0xcd514c=_0x363736['get']({'plain':!![]});if(_0xcd514c[_0x613f('0xb')][_0x613f('0xc')]()==='in'||_0xcd514c[_0x613f('0xb')]['toLowerCase']()===_0x613f('0xd')&&!_0xcd514c[_0x613f('0xe')]&&!_['isNil'](_0xcd514c['UserId'])){_0x1a8dd0['OpenchannelInteraction'][_0x613f('0xf')]({'where':{'id':_0xcd514c[_0x613f('0x10')]}})[_0x613f('0x11')](function(_0x375db1){if(_0x375db1){_0x375db1[_0x613f('0x12')]({'lastMsgAt':_0xcd514c[_0x613f('0x13')],'lastMsgDirection':_0xcd514c[_0x613f('0xb')][_0x613f('0xc')]()});}})[_0x613f('0x14')](function(_0x1d68fd){console['error'](_0x1d68fd);});}if(_0xcd514c[_0x613f('0xb')]==='out'&&!_0xcd514c['secret']){var _0x1bc605;_0x1a8dd0[_0x613f('0x15')]['describe']()[_0x613f('0x11')](function(_0x4f9dae){return _0x1a8dd0[_0x613f('0x16')][_0x613f('0x17')]({'where':{'id':_0xcd514c[_0x613f('0x18')]},'include':[{'model':_0x1a8dd0[_0x613f('0x19')],'as':_0x613f('0x1a'),'where':{'id':_0xcd514c[_0x613f('0x10')]},'limit':0x1,'include':[{'model':_0x1a8dd0['CmContact'],'as':'Contact','attributes':_[_0x613f('0x1b')](_0x4f9dae)}]}]});})['then'](function(_0x48493c){_0x1bc605=_0x48493c[_0x613f('0x1c')]({'plain':!![]});if(_0x1bc605&&_0x1bc605[_0x613f('0x1d')]){logger['info'](_0x613f('0x1e'),_0x613f('0x1f'),util[_0x613f('0x20')]('Forwarding\x20message\x20%d\x20to\x20%s',_0xcd514c['id'],_0x1bc605['replyUri']));if(_0x1bc605[_0x613f('0x1a')]&&_0x1bc605[_0x613f('0x1a')][_0x613f('0x21')]){_0xcd514c['Interaction']=_[_0x613f('0x22')](_0x1bc605[_0x613f('0x1a')][0x0],_0x613f('0x23'));_0xcd514c[_0x613f('0x23')]=_0x1bc605[_0x613f('0x1a')][0x0]['Contact'];}var _0x35b672={'method':_0x613f('0x24'),'uri':encodeURI(_0x1bc605['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x35b672[_0x613f('0x25')]){case _0x613f('0x26'):_0x35b672['qs']=_0xcd514c;break;case _0x613f('0x24'):_0x35b672['body']=_0xcd514c;break;}return rp(_0x35b672)['then'](function(_0x5a4a8b){logger[_0x613f('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x613f('0x1f'),util[_0x613f('0x20')]('Message\x20%d\x20forwarded\x20to\x20%s',_0xcd514c['id'],_0x1bc605[_0x613f('0x1d')]));if(_0x5a4a8b[_0x613f('0x8')]['threadId']&&_0x5a4a8b['body']['threadId']!=_0xcd514c[_0x613f('0x28')][_0x613f('0x29')]){return _0x1a8dd0[_0x613f('0x19')]['update']({'threadId':_0x5a4a8b[_0x613f('0x8')][_0x613f('0x29')]},{'logging':!![],'where':{'id':_0xcd514c[_0x613f('0x28')]['id']}});}else{return;}})[_0x613f('0x11')](function(){return _0x363736['update']({'read':!![]});})[_0x613f('0x14')](function(_0x5b2a1f){logger[_0x613f('0x2a')](_0x613f('0x1e'),_0x613f('0x1f'),util[_0x613f('0x2b')](_0x5b2a1f,{'showHidden':![],'depth':null}));_0x4e98ce();});}else{_0x4e98ce();}})['finally'](function(){_0x4e98ce();});}else{_0x4e98ce();}}},'charset':_0x613f('0x2c'),'collate':_0x613f('0x2d')});}; \ No newline at end of file +var _0xb03e=['info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','threadId','inspect','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','Contact','get','replyUri'];(function(_0x222550,_0x3c0a0c){var _0x58ac61=function(_0x4f7201){while(--_0x4f7201){_0x222550['push'](_0x222550['shift']());}};_0x58ac61(++_0x3c0a0c);}(_0xb03e,0x1eb));var _0xeb03=function(_0x569c85,_0x57e22c){_0x569c85=_0x569c85-0x0;var _0x2de35e=_0xb03e[_0x569c85];return _0x2de35e;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var logger=require(_0xeb03('0x1'))(_0xeb03('0x2'));var moment=require(_0xeb03('0x3'));var BPromise=require(_0xeb03('0x4'));var rp=require(_0xeb03('0x5'));var fs=require('fs');var path=require(_0xeb03('0x6'));var rimraf=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var attributes=require(_0xeb03('0x9'));module[_0xeb03('0xa')]=function(_0xee2291,_0x4e1cea){return _0xee2291[_0xeb03('0xb')](_0xeb03('0xc'),attributes,{'tableName':_0xeb03('0xd'),'paranoid':![],'indexes':[{'name':_0xeb03('0xe'),'fields':[_0xeb03('0xf')],'type':_0xeb03('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a8491,_0x403b77,_0x99f4e2){var _0x14cfa0=_0xee2291['models'];var _0x31af2c=_0x5a8491['get']({'plain':!![]});if(_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()==='in'||_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()===_0xeb03('0x13')&&!_0x31af2c[_0xeb03('0x14')]&&!_[_0xeb03('0x15')](_0x31af2c[_0xeb03('0x16')])){_0x14cfa0[_0xeb03('0x17')][_0xeb03('0x18')]({'where':{'id':_0x31af2c[_0xeb03('0x19')]}})[_0xeb03('0x1a')](function(_0x4d9c8e){if(_0x4d9c8e){_0x4d9c8e[_0xeb03('0x1b')]({'lastMsgAt':_0x31af2c[_0xeb03('0x1c')],'lastMsgDirection':_0x31af2c[_0xeb03('0x11')][_0xeb03('0x12')]()});}})['catch'](function(_0x15f4fe){console[_0xeb03('0x1d')](_0x15f4fe);});}if(_0x31af2c[_0xeb03('0x11')]==='out'&&!_0x31af2c[_0xeb03('0x14')]){var _0x46dd1b;_0x14cfa0[_0xeb03('0x1e')][_0xeb03('0x1f')]()[_0xeb03('0x1a')](function(_0x1b4cbd){return _0x14cfa0[_0xeb03('0x20')][_0xeb03('0x21')]({'where':{'id':_0x31af2c[_0xeb03('0x22')]},'include':[{'model':_0x14cfa0[_0xeb03('0x17')],'as':_0xeb03('0x23'),'where':{'id':_0x31af2c[_0xeb03('0x19')]},'limit':0x1,'include':[{'model':_0x14cfa0[_0xeb03('0x1e')],'as':_0xeb03('0x24'),'attributes':_['keys'](_0x1b4cbd)}]}]});})[_0xeb03('0x1a')](function(_0x3855dd){_0x46dd1b=_0x3855dd[_0xeb03('0x25')]({'plain':!![]});if(_0x46dd1b&&_0x46dd1b[_0xeb03('0x26')]){logger[_0xeb03('0x27')](_0xeb03('0x28'),_0xeb03('0x29'),util[_0xeb03('0x2a')](_0xeb03('0x2b'),_0x31af2c['id'],_0x46dd1b['replyUri']));if(_0x46dd1b[_0xeb03('0x23')]&&_0x46dd1b[_0xeb03('0x23')][_0xeb03('0x2c')]){_0x31af2c[_0xeb03('0x2d')]=_[_0xeb03('0x2e')](_0x46dd1b['Interactions'][0x0],_0xeb03('0x24'));_0x31af2c[_0xeb03('0x24')]=_0x46dd1b[_0xeb03('0x23')][0x0][_0xeb03('0x24')];}var _0x403b77={'method':_0xeb03('0x2f'),'uri':encodeURI(_0x46dd1b[_0xeb03('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x403b77[_0xeb03('0x30')]){case _0xeb03('0x31'):_0x403b77['qs']=_0x31af2c;break;case'POST':_0x403b77[_0xeb03('0xf')]=_0x31af2c;break;}return rp(_0x403b77)[_0xeb03('0x1a')](function(_0x2683f9){logger[_0xeb03('0x27')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xeb03('0x2a')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x31af2c['id'],_0x46dd1b[_0xeb03('0x26')]));if(_0x2683f9[_0xeb03('0xf')][_0xeb03('0x32')]&&_0x2683f9['body'][_0xeb03('0x32')]!=_0x31af2c['Interaction']['threadId']){return _0x14cfa0['OpenchannelInteraction']['update']({'threadId':_0x2683f9[_0xeb03('0xf')][_0xeb03('0x32')]},{'logging':!![],'where':{'id':_0x31af2c['Interaction']['id']}});}else{return;}})['then'](function(){return _0x5a8491['update']({'read':!![]});})['catch'](function(_0x1e8009){logger[_0xeb03('0x1d')](_0xeb03('0x28'),_0xeb03('0x29'),util[_0xeb03('0x33')](_0x1e8009,{'showHidden':![],'depth':null}));_0x99f4e2();});}else{_0x99f4e2();}})['finally'](function(){_0x99f4e2();});}else{_0x99f4e2();}}},'charset':_0xeb03('0x34'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 58c14b8..8ca7c00 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0x21331a,_0x57fc48){var _0x325c55=function(_0x770dfa){while(--_0x770dfa){_0x21331a['push'](_0x21331a['shift']());}};_0x325c55(++_0x57fc48);}(_0xdb28,0x106));var _0x8db2=function(_0x51e6dc,_0x367e8a){_0x51e6dc=_0x51e6dc-0x0;var _0x202431=_0xdb28[_0x51e6dc];return _0x202431;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file +var _0x0b0e=['message','result','OpenchannelMessage','create','body','options','CreateOpenchannelMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s'];(function(_0xd2a244,_0x52b368){var _0x5c0cc9=function(_0x4ad0bb){while(--_0x4ad0bb){_0xd2a244['push'](_0xd2a244['shift']());}};_0x5c0cc9(++_0x52b368);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0x0b0e[_0x5ae8f7];return _0x54c636;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateOpenchannelMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateOpenchannelMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index c4127e5..842a04d 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 _0xa633=['openchannelMessage:','./openchannelMessage.events','update','removeListener','register','length'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0xa633,0x15d));var _0x3a63=function(_0x278f20,_0x5dd74a){_0x278f20=_0x278f20-0x0;var _0x2bde03=_0xa633[_0x278f20];return _0x2bde03;};'use strict';var OpenchannelMessageEvents=require(_0x3a63('0x0'));var events=['save','remove',_0x3a63('0x1')];function createListener(_0x47b39e,_0x529bef){return function(_0x121a91){_0x529bef['emit'](_0x47b39e,_0x121a91);};}function removeListener(_0x1d0884,_0x169e18){return function(){OpenchannelMessageEvents[_0x3a63('0x2')](_0x1d0884,_0x169e18);};}exports[_0x3a63('0x3')]=function(_0x1315cb){for(var _0xc9221d=0x0,_0x7ebc45=events[_0x3a63('0x4')];_0xc9221d<_0x7ebc45;_0xc9221d++){var _0x567ff5=events[_0xc9221d];var _0x574b7c=createListener(_0x3a63('0x5')+_0x567ff5,_0x1315cb);OpenchannelMessageEvents['on'](_0x567ff5,_0x574b7c);}}; \ No newline at end of file +var _0xda2d=['remove','removeListener','register','length','save'];(function(_0x1bb889,_0x49c4b5){var _0xd8b76d=function(_0x1df471){while(--_0x1df471){_0x1bb889['push'](_0x1bb889['shift']());}};_0xd8b76d(++_0x49c4b5);}(_0xda2d,0xb3));var _0xdda2=function(_0x4cfbe4,_0x3e34e5){_0x4cfbe4=_0x4cfbe4-0x0;var _0x274b21=_0xda2d[_0x4cfbe4];return _0x274b21;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xdda2('0x0'),_0xdda2('0x1'),'update'];function createListener(_0x8c57ab,_0x5d4e03){return function(_0x3a3d37){_0x5d4e03['emit'](_0x8c57ab,_0x3a3d37);};}function removeListener(_0x6f07af,_0x30f5e0){return function(){OpenchannelMessageEvents[_0xdda2('0x2')](_0x6f07af,_0x30f5e0);};}exports[_0xdda2('0x3')]=function(_0x3205a7){for(var _0x4e69a0=0x0,_0x225f04=events[_0xdda2('0x4')];_0x4e69a0<_0x225f04;_0x4e69a0++){var _0x39918f=events[_0x4e69a0];var _0x2cb089=createListener('openchannelMessage:'+_0x39918f,_0x3205a7);OpenchannelMessageEvents['on'](_0x39918f,_0x2cb089);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index bfc8be0..805be6c 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 _0x9801=['post','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/users','getAgents'];(function(_0x49176c,_0x43efe6){var _0x43add2=function(_0x2b8b15){while(--_0x2b8b15){_0x49176c['push'](_0x49176c['shift']());}};_0x43add2(++_0x43efe6);}(_0x9801,0x1ba));var _0x1980=function(_0x392b7e,_0x138c3f){_0x392b7e=_0x392b7e-0x0;var _0x1b61b7=_0x9801[_0x392b7e];return _0x1b61b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1980('0x0'));var timeout=require(_0x1980('0x1'));var express=require(_0x1980('0x2'));var router=express[_0x1980('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1980('0x4'));var interaction=require(_0x1980('0x5'));var config=require(_0x1980('0x6'));var controller=require('./openchannelQueue.controller');router[_0x1980('0x7')]('/',auth[_0x1980('0x8')](),controller[_0x1980('0x9')]);router['get'](_0x1980('0xa'),auth[_0x1980('0x8')](),controller[_0x1980('0xb')]);router['get'](_0x1980('0xc'),auth[_0x1980('0x8')](),controller['show']);router[_0x1980('0x7')](_0x1980('0xd'),auth['isAuthenticated'](),controller[_0x1980('0xe')]);router[_0x1980('0x7')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x1980('0xf'),auth[_0x1980('0x8')](),controller[_0x1980('0x10')]);router[_0x1980('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1980('0x12'),auth[_0x1980('0x8')](),controller[_0x1980('0x13')]);router[_0x1980('0x11')](_0x1980('0xf'),auth[_0x1980('0x8')](),controller[_0x1980('0x14')]);router[_0x1980('0x15')](_0x1980('0xc'),auth[_0x1980('0x8')](),controller[_0x1980('0x16')]);router[_0x1980('0x17')]('/:id',auth[_0x1980('0x8')](),controller[_0x1980('0x18')]);router[_0x1980('0x17')](_0x1980('0x12'),auth[_0x1980('0x8')](),controller[_0x1980('0x19')]);router[_0x1980('0x17')](_0x1980('0xf'),auth[_0x1980('0x8')](),controller[_0x1980('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x5d95=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id','show','getMembers','getTeams','getAgents','create','post','/:id/teams','addTeams','/:id/users','addAgents','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x5d95,0x1d1));var _0x55d9=function(_0xcaecd9,_0x5d8a1c){_0xcaecd9=_0xcaecd9-0x0;var _0x246753=_0x5d95[_0xcaecd9];return _0x246753;};'use strict';var multer=require(_0x55d9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x55d9('0x1'));var express=require(_0x55d9('0x2'));var router=express[_0x55d9('0x3')]();var fs_extra=require(_0x55d9('0x4'));var auth=require(_0x55d9('0x5'));var interaction=require(_0x55d9('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x55d9('0x7')]('/',auth[_0x55d9('0x8')](),controller[_0x55d9('0x9')]);router[_0x55d9('0x7')](_0x55d9('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x55d9('0x7')](_0x55d9('0xb'),auth[_0x55d9('0x8')](),controller[_0x55d9('0xc')]);router[_0x55d9('0x7')]('/:id/members',auth[_0x55d9('0x8')](),controller[_0x55d9('0xd')]);router[_0x55d9('0x7')]('/:id/teams',auth[_0x55d9('0x8')](),controller[_0x55d9('0xe')]);router[_0x55d9('0x7')]('/:id/users',auth[_0x55d9('0x8')](),controller[_0x55d9('0xf')]);router['post']('/',auth[_0x55d9('0x8')](),controller[_0x55d9('0x10')]);router[_0x55d9('0x11')](_0x55d9('0x12'),auth['isAuthenticated'](),controller[_0x55d9('0x13')]);router[_0x55d9('0x11')](_0x55d9('0x14'),auth[_0x55d9('0x8')](),controller[_0x55d9('0x15')]);router['put']('/:id',auth[_0x55d9('0x8')](),controller[_0x55d9('0x16')]);router[_0x55d9('0x17')](_0x55d9('0xb'),auth['isAuthenticated'](),controller[_0x55d9('0x18')]);router[_0x55d9('0x17')](_0x55d9('0x12'),auth[_0x55d9('0x8')](),controller['removeTeams']);router[_0x55d9('0x17')]('/:id/users',auth[_0x55d9('0x8')](),controller['removeAgents']);module[_0x55d9('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 b0b1524..b2a54a1 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 _0x9601=['INTEGER','beepall','exports','name','STRING'];(function(_0xaf025d,_0x586d7a){var _0x1c77cb=function(_0x560b3a){while(--_0x560b3a){_0xaf025d['push'](_0xaf025d['shift']());}};_0x1c77cb(++_0x586d7a);}(_0x9601,0x98));var _0x1960=function(_0x5de09c,_0x39c32f){_0x5de09c=_0x5de09c-0x0;var _0x1aa627=_0x9601[_0x5de09c];return _0x1aa627;};'use strict';var Sequelize=require('sequelize');module[_0x1960('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x1960('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1960('0x2')]},'timeout':{'type':Sequelize[_0x1960('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x1960('0x4'),'roundrobin')}}; \ No newline at end of file +var _0x8506=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8506,0x144));var _0x6850=function(_0x785fe1,_0x5b7dc9){_0x785fe1=_0x785fe1-0x0;var _0x190493=_0x8506[_0x785fe1];return _0x190493;};'use strict';var Sequelize=require('sequelize');module[_0x6850('0x0')]={'name':{'type':Sequelize[_0x6850('0x1')],'unique':_0x6850('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6850('0x1')]},'timeout':{'type':Sequelize[_0x6850('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6850('0x4')](_0x6850('0x5'),_0x6850('0x6'),_0x6850('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 9493952..a029768 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 _0x2637=['undefined','count','offset','Content-Range','apply','update','then','destroy','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','get','role','user','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','all','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','limit'];(function(_0x46c2e0,_0x53ea22){var _0x45a00a=function(_0x1efe71){while(--_0x1efe71){_0x46c2e0['push'](_0x46c2e0['shift']());}};_0x45a00a(++_0x53ea22);}(_0x2637,0xf9));var _0x7263=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x2637[_0x4d613c];return _0x301fe3;};'use strict';var emlformat=require(_0x7263('0x0'));var rimraf=require(_0x7263('0x1'));var zipdir=require(_0x7263('0x2'));var jsonpatch=require(_0x7263('0x3'));var rp=require(_0x7263('0x4'));var moment=require(_0x7263('0x5'));var BPromise=require(_0x7263('0x6'));var Mustache=require(_0x7263('0x7'));var util=require(_0x7263('0x8'));var path=require(_0x7263('0x9'));var sox=require(_0x7263('0xa'));var csv=require('to-csv');var ejs=require(_0x7263('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7263('0xc'));var squel=require(_0x7263('0xd'));var crypto=require(_0x7263('0xe'));var jsforce=require(_0x7263('0xf'));var deskjs=require(_0x7263('0x10'));var toCsv=require(_0x7263('0x11'));var querystring=require(_0x7263('0x12'));var Papa=require(_0x7263('0x13'));var Redis=require(_0x7263('0x14'));var authService=require(_0x7263('0x15'));var qs=require(_0x7263('0x16'));var as=require(_0x7263('0x17'));var hardwareService=require(_0x7263('0x18'));var logger=require(_0x7263('0x19'))(_0x7263('0x1a'));var utils=require(_0x7263('0x1b'));var config=require(_0x7263('0x1c'));var licenseUtil=require(_0x7263('0x1d'));var db=require(_0x7263('0x1e'))['db'];config[_0x7263('0x1f')]=_[_0x7263('0x20')](config['redis'],{'host':_0x7263('0x21'),'port':0x18eb});var socket=require(_0x7263('0x22'))(new Redis(config[_0x7263('0x1f')]));require(_0x7263('0x23'))[_0x7263('0x24')](socket);function respondWithStatusCode(_0x3c4d34,_0x415f60){_0x415f60=_0x415f60||0xcc;return function(_0x4bde6e){if(_0x4bde6e){return _0x3c4d34[_0x7263('0x25')](_0x415f60);}return _0x3c4d34['status'](_0x415f60)[_0x7263('0x26')]();};}function respondWithResult(_0x417223,_0x37c527){_0x37c527=_0x37c527||0xc8;return function(_0x2e942c){if(_0x2e942c){return _0x417223[_0x7263('0x27')](_0x37c527)['json'](_0x2e942c);}};}function respondWithFilteredResult(_0x308723,_0x46f8e5){return function(_0xb73f4){if(_0xb73f4){var _0x4bf48e=typeof _0x46f8e5['offset']==='undefined'&&typeof _0x46f8e5[_0x7263('0x28')]===_0x7263('0x29');var _0x15c942=_0xb73f4[_0x7263('0x2a')];var _0x1e8a42=_0x4bf48e?0x0:_0x46f8e5[_0x7263('0x2b')];var _0x8a3d02=_0x4bf48e?_0xb73f4[_0x7263('0x2a')]:_0x46f8e5[_0x7263('0x2b')]+_0x46f8e5['limit'];var _0xcc041e;if(_0x8a3d02>=_0x15c942){_0x8a3d02=_0x15c942;_0xcc041e=0xc8;}else{_0xcc041e=0xce;}_0x308723[_0x7263('0x27')](_0xcc041e);return _0x308723['set'](_0x7263('0x2c'),_0x1e8a42+'-'+_0x8a3d02+'/'+_0x15c942)['json'](_0xb73f4);}return null;};}function patchUpdates(_0x4480b5){return function(_0x52e7f2){try{jsonpatch[_0x7263('0x2d')](_0x52e7f2,_0x4480b5,!![]);}catch(_0x370baa){return BPromise['reject'](_0x370baa);}return _0x52e7f2['save']();};}function saveUpdates(_0x40e172,_0x80f3fe){return function(_0x593383){if(_0x593383){return _0x593383[_0x7263('0x2e')](_0x40e172)[_0x7263('0x2f')](function(_0x1b8a97){return _0x1b8a97;});}return null;};}function removeEntity(_0xdc19c8,_0x49c7a9){return function(_0x60a366){if(_0x60a366){return _0x60a366[_0x7263('0x30')]()['then'](function(){var _0x23354c=_0x60a366['get']({'plain':!![]});var _0x1c84ed='OpenchannelQueues';return db[_0x7263('0x31')][_0x7263('0x30')]({'where':{'type':_0x1c84ed,'resourceId':_0x23354c['id']}})[_0x7263('0x2f')](function(){return _0x60a366;});})[_0x7263('0x2f')](function(){_0xdc19c8[_0x7263('0x27')](0xcc)[_0x7263('0x26')]();});}};}function handleEntityNotFound(_0x248f94,_0xa04085){return function(_0x32dd74){if(!_0x32dd74){_0x248f94[_0x7263('0x25')](0x194);}return _0x32dd74;};}function handleError(_0x437934,_0x630788){_0x630788=_0x630788||0x1f4;return function(_0x275dc8){logger[_0x7263('0x32')](_0x275dc8['stack']);if(_0x275dc8[_0x7263('0x33')]){delete _0x275dc8[_0x7263('0x33')];}_0x437934[_0x7263('0x27')](_0x630788)[_0x7263('0x34')](_0x275dc8);};}exports[_0x7263('0x35')]=function(_0x445528,_0x11d134){var _0x375bc5={},_0x2a7329={},_0x16e42a={'count':0x0,'rows':[]};var _0x3a34c0=_[_0x7263('0x36')](db[_0x7263('0x37')][_0x7263('0x38')],function(_0x5b32f6){return{'name':_0x5b32f6['fieldName'],'type':_0x5b32f6[_0x7263('0x39')][_0x7263('0x3a')]};});_0x2a7329[_0x7263('0x3b')]=_[_0x7263('0x36')](_0x3a34c0,_0x7263('0x33'));_0x2a7329[_0x7263('0x3c')]=_[_0x7263('0x3d')](_0x445528[_0x7263('0x3c')]);_0x2a7329[_0x7263('0x3e')]=_[_0x7263('0x3f')](_0x2a7329[_0x7263('0x3b')],_0x2a7329[_0x7263('0x3c')]);_0x375bc5[_0x7263('0x40')]=_[_0x7263('0x3f')](_0x2a7329[_0x7263('0x3b')],qs[_0x7263('0x41')](_0x445528[_0x7263('0x3c')]['fields']));_0x375bc5[_0x7263('0x40')]=_0x375bc5[_0x7263('0x40')][_0x7263('0x42')]?_0x375bc5[_0x7263('0x40')]:_0x2a7329[_0x7263('0x3b')];if(!_0x445528[_0x7263('0x3c')][_0x7263('0x43')](_0x7263('0x44'))){_0x375bc5[_0x7263('0x28')]=qs[_0x7263('0x28')](_0x445528['query']['limit']);_0x375bc5[_0x7263('0x2b')]=qs[_0x7263('0x2b')](_0x445528[_0x7263('0x3c')][_0x7263('0x2b')]);}_0x375bc5[_0x7263('0x45')]=qs['sort'](_0x445528[_0x7263('0x3c')][_0x7263('0x46')]);_0x375bc5[_0x7263('0x47')]=qs[_0x7263('0x3e')](_[_0x7263('0x48')](_0x445528[_0x7263('0x3c')],_0x2a7329[_0x7263('0x3e')]),_0x3a34c0);if(_0x445528[_0x7263('0x3c')][_0x7263('0x49')]){_0x375bc5['where']=_[_0x7263('0x4a')](_0x375bc5['where'],{'$or':_[_0x7263('0x36')](_0x3a34c0,function(_0x39ef74){if(_0x39ef74[_0x7263('0x39')]!=='VIRTUAL'){var _0x27c067={};_0x27c067[_0x39ef74['name']]={'$like':'%'+_0x445528[_0x7263('0x3c')][_0x7263('0x49')]+'%'};return _0x27c067;}})});}_0x375bc5=_[_0x7263('0x4a')]({},_0x375bc5,_0x445528[_0x7263('0x4b')]);var _0x2ed474={'where':_0x375bc5[_0x7263('0x47')]};return db[_0x7263('0x37')][_0x7263('0x2a')](_0x2ed474)[_0x7263('0x2f')](function(_0x4097ce){_0x16e42a[_0x7263('0x2a')]=_0x4097ce;if(_0x445528['query'][_0x7263('0x4c')]){_0x375bc5[_0x7263('0x4d')]=[{'all':!![]}];}return db[_0x7263('0x37')][_0x7263('0x4e')](_0x375bc5);})[_0x7263('0x2f')](function(_0x3aad2e){_0x16e42a[_0x7263('0x4f')]=_0x3aad2e;return _0x16e42a;})[_0x7263('0x2f')](respondWithFilteredResult(_0x11d134,_0x375bc5))['catch'](handleError(_0x11d134,null));};exports[_0x7263('0x50')]=function(_0x1faee1,_0x25255e){var _0x28693a={'raw':!![],'where':{'id':_0x1faee1[_0x7263('0x51')]['id']}},_0x2e451a={};_0x2e451a[_0x7263('0x3b')]=_['keys'](db[_0x7263('0x37')][_0x7263('0x38')]);_0x2e451a[_0x7263('0x3c')]=_[_0x7263('0x3d')](_0x1faee1[_0x7263('0x3c')]);_0x2e451a[_0x7263('0x3e')]=_[_0x7263('0x3f')](_0x2e451a[_0x7263('0x3b')],_0x2e451a['query']);_0x28693a[_0x7263('0x40')]=_[_0x7263('0x3f')](_0x2e451a[_0x7263('0x3b')],qs[_0x7263('0x41')](_0x1faee1[_0x7263('0x3c')][_0x7263('0x41')]));_0x28693a[_0x7263('0x40')]=_0x28693a[_0x7263('0x40')][_0x7263('0x42')]?_0x28693a[_0x7263('0x40')]:_0x2e451a[_0x7263('0x3b')];if(_0x1faee1[_0x7263('0x3c')][_0x7263('0x4c')]){_0x28693a[_0x7263('0x4d')]=[{'all':!![]}];}_0x28693a=_['merge']({},_0x28693a,_0x1faee1[_0x7263('0x4b')]);return db['OpenchannelQueue'][_0x7263('0x52')](_0x28693a)[_0x7263('0x2f')](handleEntityNotFound(_0x25255e,null))[_0x7263('0x2f')](respondWithResult(_0x25255e,null))[_0x7263('0x53')](handleError(_0x25255e,null));};exports['create']=function(_0x15da85,_0x25b1e1){return db[_0x7263('0x37')][_0x7263('0x54')](_0x15da85[_0x7263('0x55')],{})[_0x7263('0x2f')](function(_0x5e8806){var _0x304b82=_0x15da85['user'][_0x7263('0x56')]({'plain':!![]});if(!_0x304b82)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x304b82[_0x7263('0x57')]===_0x7263('0x58')){var _0x31506d=_0x5e8806['get']({'plain':!![]});var _0x553207=_0x7263('0x59');return db[_0x7263('0x5a')][_0x7263('0x52')]({'where':{'name':_0x553207,'userProfileId':_0x304b82[_0x7263('0x5b')]},'raw':!![]})['then'](function(_0x4124d3){if(_0x4124d3&&_0x4124d3[_0x7263('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x31506d[_0x7263('0x33')],'resourceId':_0x31506d['id'],'type':_0x4124d3['name'],'sectionId':_0x4124d3['id']},{})[_0x7263('0x2f')](function(){return _0x5e8806;});}else{return _0x5e8806;}})[_0x7263('0x53')](function(_0x29e577){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x29e577);throw _0x29e577;});}return _0x5e8806;})[_0x7263('0x2f')](respondWithResult(_0x25b1e1,0xc9))[_0x7263('0x53')](handleError(_0x25b1e1,null));};exports[_0x7263('0x2e')]=function(_0x43b651,_0x53806b){if(_0x43b651[_0x7263('0x55')]['id']){delete _0x43b651['body']['id'];}return db[_0x7263('0x37')][_0x7263('0x52')]({'where':{'id':_0x43b651[_0x7263('0x51')]['id']}})[_0x7263('0x2f')](handleEntityNotFound(_0x53806b,null))['then'](saveUpdates(_0x43b651[_0x7263('0x55')],null))[_0x7263('0x2f')](respondWithResult(_0x53806b,null))['catch'](handleError(_0x53806b,null));};exports[_0x7263('0x30')]=function(_0x33c9c9,_0x3894cb){return db[_0x7263('0x37')][_0x7263('0x52')]({'where':{'id':_0x33c9c9[_0x7263('0x51')]['id']}})['then'](handleEntityNotFound(_0x3894cb,null))[_0x7263('0x2f')](removeEntity(_0x3894cb,null))[_0x7263('0x53')](handleError(_0x3894cb,null));};exports[_0x7263('0x5d')]=function(_0x585e75,_0x29766f){return db[_0x7263('0x37')][_0x7263('0x5d')]()[_0x7263('0x2f')](respondWithResult(_0x29766f,null))['catch'](handleError(_0x29766f,null));};exports[_0x7263('0x5e')]=function(_0x2f6312,_0x5a4184,_0x3dc0dd){var _0x4b468f={'raw':!![],'where':{}},_0x41a058={},_0x1b7f4e;return db[_0x7263('0x37')][_0x7263('0x5f')]({'where':{'id':_0x2f6312[_0x7263('0x51')]['id']}})['then'](handleEntityNotFound(_0x5a4184,null))[_0x7263('0x2f')](function(_0x19857f){if(_0x19857f){_0x1b7f4e=_0x19857f['get']({'plain':!![]});_0x41a058[_0x7263('0x3b')]=_[_0x7263('0x3d')](db[_0x7263('0x60')][_0x7263('0x38')]);_0x41a058[_0x7263('0x3c')]=_[_0x7263('0x3d')](_0x2f6312[_0x7263('0x3c')]);_0x41a058[_0x7263('0x3e')]=_[_0x7263('0x3f')](_0x41a058['model'],_0x41a058[_0x7263('0x3c')]);_0x4b468f[_0x7263('0x40')]=_['intersection'](_0x41a058[_0x7263('0x3b')],qs[_0x7263('0x41')](_0x2f6312[_0x7263('0x3c')][_0x7263('0x41')]));_0x4b468f[_0x7263('0x40')]=_0x4b468f[_0x7263('0x40')][_0x7263('0x42')]?_0x4b468f[_0x7263('0x40')]:_0x41a058['model'];if(!_0x2f6312['query'][_0x7263('0x43')](_0x7263('0x44'))){_0x4b468f[_0x7263('0x28')]=qs[_0x7263('0x28')](_0x2f6312[_0x7263('0x3c')]['limit']);_0x4b468f[_0x7263('0x2b')]=qs[_0x7263('0x2b')](_0x2f6312[_0x7263('0x3c')][_0x7263('0x2b')]);}_0x4b468f['order']=qs[_0x7263('0x46')](_0x2f6312[_0x7263('0x3c')][_0x7263('0x46')]);_0x4b468f[_0x7263('0x47')]=qs[_0x7263('0x3e')](_[_0x7263('0x48')](_0x2f6312[_0x7263('0x3c')],_0x41a058[_0x7263('0x3e')]));_0x4b468f['where'][_0x7263('0x61')]=_0x19857f['id'];if(_0x2f6312[_0x7263('0x3c')][_0x7263('0x49')]){_0x4b468f[_0x7263('0x47')]=_['merge'](_0x4b468f[_0x7263('0x47')],{'$or':_[_0x7263('0x36')](_0x4b468f[_0x7263('0x40')],function(_0x2394cc){var _0x9b3fd7={};_0x9b3fd7[_0x2394cc]={'$like':'%'+_0x2f6312[_0x7263('0x3c')][_0x7263('0x49')]+'%'};return _0x9b3fd7;})});}_0x4b468f=_[_0x7263('0x4a')]({},_0x4b468f,_0x2f6312[_0x7263('0x4b')]);return db[_0x7263('0x60')]['findAll'](_0x4b468f);}})[_0x7263('0x2f')](function(_0x5c304a){if(_0x5c304a){return db[_0x7263('0x62')]['findAndCountAll']({'where':{'id':_[_0x7263('0x36')](_0x5c304a,_0x7263('0x63')),'role':'agent'},'attributes':['id',_0x7263('0x33'),_0x7263('0x64'),_0x7263('0x65'),_0x7263('0x66')]});}})[_0x7263('0x2f')](function(_0x5cf46d){if(_0x5cf46d){return{'count':_0x5cf46d[_0x7263('0x2a')],'rows':_[_0x7263('0x36')](_0x5cf46d[_0x7263('0x4f')],function(_0x1d04ba){return{'membername':_0x1d04ba['name'],'UserId':_0x1d04ba['id'],'queue_name':_0x1b7f4e[_0x7263('0x33')],'OpenchannelQueueId':_0x1b7f4e['id'],'interface':util[_0x7263('0x67')](_0x7263('0x68'),_0x7263('0x69'),_0x1d04ba[_0x7263('0x33')]),'penalty':0x0,'paused':_0x1d04ba[_0x7263('0x64')],'createdAt':_0x1d04ba['createdAt'],'updatedAt':_0x1d04ba[_0x7263('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7263('0x2f')](respondWithFilteredResult(_0x5a4184,_0x4b468f))['catch'](handleError(_0x5a4184,null));};exports[_0x7263('0x6a')]=function(_0x5aff28,_0x52512a,_0x3dddb7){var _0x11dfc6={};var _0x13e2a7={};var _0xb807bf;var _0x5417e0;return db[_0x7263('0x37')][_0x7263('0x5f')]({'where':{'id':_0x5aff28['params']['id']}})[_0x7263('0x2f')](handleEntityNotFound(_0x52512a,null))[_0x7263('0x2f')](function(_0x42511a){if(_0x42511a){_0xb807bf=_0x42511a;_0x13e2a7['model']=_[_0x7263('0x3d')](db[_0x7263('0x6b')][_0x7263('0x38')]);_0x13e2a7['query']=_[_0x7263('0x3d')](_0x5aff28[_0x7263('0x3c')]);_0x13e2a7[_0x7263('0x3e')]=_[_0x7263('0x3f')](_0x13e2a7['model'],_0x13e2a7[_0x7263('0x3c')]);_0x11dfc6[_0x7263('0x40')]=_[_0x7263('0x3f')](_0x13e2a7['model'],qs['fields'](_0x5aff28[_0x7263('0x3c')][_0x7263('0x41')]));_0x11dfc6[_0x7263('0x40')]=_0x11dfc6[_0x7263('0x40')][_0x7263('0x42')]?_0x11dfc6[_0x7263('0x40')]:_0x13e2a7[_0x7263('0x3b')];_0x11dfc6[_0x7263('0x45')]=qs['sort'](_0x5aff28[_0x7263('0x3c')][_0x7263('0x46')]);_0x11dfc6[_0x7263('0x47')]=qs[_0x7263('0x3e')](_[_0x7263('0x48')](_0x5aff28[_0x7263('0x3c')],_0x13e2a7['filters']));if(_0x5aff28[_0x7263('0x3c')][_0x7263('0x49')]){_0x11dfc6[_0x7263('0x47')]=_['merge'](_0x11dfc6['where'],{'$or':_[_0x7263('0x36')](_0x11dfc6[_0x7263('0x40')],function(_0x16d3d7){var _0x5a99ea={};_0x5a99ea[_0x16d3d7]={'$like':'%'+_0x5aff28[_0x7263('0x3c')][_0x7263('0x49')]+'%'};return _0x5a99ea;})});}_0x11dfc6=_[_0x7263('0x4a')]({},_0x11dfc6,_0x5aff28[_0x7263('0x4b')]);return _0xb807bf[_0x7263('0x6a')](_0x11dfc6);}})[_0x7263('0x2f')](function(_0xc924df){if(_0xc924df){_0x5417e0=_0xc924df[_0x7263('0x42')];if(!_0x5aff28[_0x7263('0x3c')][_0x7263('0x43')]('nolimit')){_0x11dfc6['limit']=qs[_0x7263('0x28')](_0x5aff28['query'][_0x7263('0x28')]);_0x11dfc6[_0x7263('0x2b')]=qs[_0x7263('0x2b')](_0x5aff28[_0x7263('0x3c')]['offset']);}return _0xb807bf[_0x7263('0x6a')](_0x11dfc6);}})[_0x7263('0x2f')](function(_0xf6235f){if(_0xf6235f){return _0xf6235f?{'count':_0x5417e0,'rows':_0xf6235f}:null;}})[_0x7263('0x2f')](respondWithResult(_0x52512a,null))[_0x7263('0x53')](handleError(_0x52512a,null));};exports[_0x7263('0x6c')]=function(_0x48808d,_0x529ee0,_0x44960c){var _0x2aab44=_0x48808d['body'][_0x7263('0x6d')];return db[_0x7263('0x6b')][_0x7263('0x4e')]({'where':{'id':_0x2aab44},'attributes':['id'],'include':[{'model':db[_0x7263('0x62')],'as':_0x7263('0x6e'),'attributes':['id',_0x7263('0x33'),_0x7263('0x6f'),'voicePause',_0x7263('0x70')],'raw':!![]}]})[_0x7263('0x2f')](function(_0x11de9f){if(_0x11de9f){var _0x27aeb1=_[_0x7263('0x71')](_0x11de9f,function(_0x37404a){var _0x14e42c=_0x37404a[_0x7263('0x56')]({'plain':!![]});return _0x14e42c[_0x7263('0x6e')];});return db[_0x7263('0x37')][_0x7263('0x52')]({'where':{'id':_0x48808d['params']['id']}})[_0x7263('0x2f')](function(_0xe9b56d){return db[_0x7263('0x72')]['transaction'](function(_0x5af966){return _0xe9b56d[_0x7263('0x6c')](_0x2aab44,{'transaction':_0x5af966})[_0x7263('0x2f')](function(){return BPromise[_0x7263('0x73')](_0x27aeb1,function(_0x1415c1){return db[_0x7263('0x60')][_0x7263('0x74')]({'where':{'UserId':_0x1415c1['id'],'OpenchannelQueueId':_0x48808d[_0x7263('0x51')]['id']},'transaction':_0x5af966});});})[_0x7263('0x2f')](function(){_0x27aeb1[_0x7263('0x75')](function(_0x1aac1c){socket[_0x7263('0x76')](_0x7263('0x77'),{'UserId':_0x1aac1c['id'],'OpenchannelQueueId':_0xe9b56d['id']});});});});});}})[_0x7263('0x2f')](respondWithStatusCode(_0x529ee0,null))[_0x7263('0x53')](handleError(_0x529ee0,null));};exports[_0x7263('0x78')]=function(_0x41ec6e,_0x219066,_0x238c56){return db[_0x7263('0x6b')][_0x7263('0x4e')]({'where':{'id':_0x41ec6e[_0x7263('0x3c')][_0x7263('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x7263('0x62')],'as':_0x7263('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x7263('0x2f')](handleEntityNotFound(_0x219066,null))[_0x7263('0x2f')](function(_0xbbcdc4){var _0x4383b6=_[_0x7263('0x36')](_0xbbcdc4,'id');var _0x9a3369=[];var _0x852208=[];var _0x2b021c=squel['select']();_0x2b021c[_0x7263('0x79')](_0x7263('0x7a'))[_0x7263('0x7b')](_0x7263('0x7c'),'tq')[_0x7263('0x7d')](_0x7263('0x7e'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7263('0x47')](_0x7263('0x7f'),_0x41ec6e[_0x7263('0x51')]['id']);for(var _0x3116c5=0x0;_0x3116c5<_0xbbcdc4['length'];_0x3116c5+=0x1){let _0x3ea804=_0xbbcdc4[_0x3116c5];for(var _0x1929ca=0x0;_0x1929ca<_0x3ea804[_0x7263('0x6e')][_0x7263('0x42')];_0x1929ca+=0x1){let _0xc590bc=_0x3ea804['Agents'][_0x1929ca];var _0x5edb23=_0x2b021c[_0x7263('0x80')]();_0x5edb23[_0x7263('0x47')]('ut.UserId\x20=\x20?',_0xc590bc['id']);_0x852208[_0x7263('0x81')](db['sequelize']['query'](_0x5edb23[_0x7263('0x82')](),{'type':db['sequelize'][_0x7263('0x83')]['SELECT']})['then'](function(_0x5a1048){if(_0x5a1048[_0x7263('0x42')]===0x1){return _0xc590bc['id'];}else{var _0x282460=_[_0x7263('0x84')](_['map'](_0x5a1048,_0x7263('0x85')),function(_0x1b7fa4){return _['includes'](_0x4383b6,_0x1b7fa4);});if(_0x282460){return _0xc590bc['id'];}}}));}}return BPromise[_0x7263('0x86')](_0x852208)[_0x7263('0x2f')](function(_0x4f71b6){_0x9a3369=_(_0x9a3369)['union'](_0x4f71b6)[_0x7263('0x87')]()[_0x7263('0x88')]();return db[_0x7263('0x37')][_0x7263('0x52')]({'where':{'id':_0x41ec6e[_0x7263('0x51')]['id']}})[_0x7263('0x2f')](function(_0x340fbd){return db['sequelize']['transaction'](function(_0x4b59cf){return _0x340fbd['removeTeams'](_0x41ec6e[_0x7263('0x3c')][_0x7263('0x6d')],{'transaction':_0x4b59cf})[_0x7263('0x2f')](function(){if(!_[_0x7263('0x89')](_0x9a3369)){return _0x340fbd[_0x7263('0x8a')](_0x9a3369,{'transaction':_0x4b59cf});}})[_0x7263('0x2f')](function(){_0x9a3369[_0x7263('0x75')](function(_0x597b07){socket[_0x7263('0x76')](_0x7263('0x8b'),{'UserId':_0x597b07,'OpenchannelQueueId':_0x340fbd['id']});});});});});});})['then'](respondWithStatusCode(_0x219066,null))[_0x7263('0x53')](handleError(_0x219066,null));};exports[_0x7263('0x8c')]=function(_0x491272,_0x38c5dd,_0x2dfd3e){return db['OpenchannelQueue'][_0x7263('0x52')]({'where':{'id':_0x491272[_0x7263('0x51')]['id']}})[_0x7263('0x2f')](handleEntityNotFound(_0x38c5dd,null))[_0x7263('0x2f')](function(_0x3728dc){if(_0x3728dc){return _0x3728dc['addAgents'](_0x491272[_0x7263('0x55')][_0x7263('0x6d')],_[_0x7263('0x8d')](_0x491272['body'],[_0x7263('0x6d'),'id'])||{})[_0x7263('0x8e')](function(_0x2e22e2){for(var _0x369e6c=0x0;_0x369e6c<_0x491272[_0x7263('0x55')][_0x7263('0x6d')][_0x7263('0x42')];_0x369e6c+=0x1){socket[_0x7263('0x76')](_0x7263('0x77'),{'UserId':Number(_0x491272[_0x7263('0x55')]['ids'][_0x369e6c]),'OpenchannelQueueId':Number(_0x491272[_0x7263('0x51')]['id'])});}return _0x2e22e2;});}})[_0x7263('0x2f')](respondWithResult(_0x38c5dd,null))['catch'](handleError(_0x38c5dd,null));};exports[_0x7263('0x8a')]=function(_0x479e42,_0xef4e6f,_0xac61d5){return db['OpenchannelQueue']['find']({'where':{'id':_0x479e42[_0x7263('0x51')]['id']}})[_0x7263('0x2f')](handleEntityNotFound(_0xef4e6f,null))[_0x7263('0x2f')](function(_0x16e599){if(_0x16e599){return _0x16e599[_0x7263('0x8a')](_0x479e42[_0x7263('0x3c')][_0x7263('0x6d')])['then'](function(){if(_[_0x7263('0x8f')](_0x479e42['query'][_0x7263('0x6d')])){for(var _0x8d2463=0x0;_0x8d2463<_0x479e42['query'][_0x7263('0x6d')][_0x7263('0x42')];_0x8d2463+=0x1){socket[_0x7263('0x76')]('userOpenchannelQueue:remove',{'UserId':Number(_0x479e42[_0x7263('0x3c')][_0x7263('0x6d')][_0x8d2463]),'OpenchannelQueueId':Number(_0x479e42[_0x7263('0x51')]['id'])});}}else{socket[_0x7263('0x76')](_0x7263('0x8b'),{'UserId':Number(_0x479e42[_0x7263('0x3c')][_0x7263('0x6d')]),'OpenchannelQueueId':Number(_0x479e42[_0x7263('0x51')]['id'])});}});}})[_0x7263('0x2f')](respondWithStatusCode(_0xef4e6f,null))[_0x7263('0x53')](handleError(_0xef4e6f,null));};exports[_0x7263('0x90')]=function(_0x3f7a6a,_0x9be4c7,_0xdb32d9){var _0x313e7e={};var _0x4e78df={};var _0x3d0e4c;var _0x3e7cb7;return db['OpenchannelQueue'][_0x7263('0x5f')]({'where':{'id':_0x3f7a6a[_0x7263('0x51')]['id']}})[_0x7263('0x2f')](handleEntityNotFound(_0x9be4c7,null))[_0x7263('0x2f')](function(_0x38b1fb){if(_0x38b1fb){_0x3d0e4c=_0x38b1fb;_0x4e78df[_0x7263('0x3b')]=_[_0x7263('0x3d')](db[_0x7263('0x62')][_0x7263('0x38')]);_0x4e78df[_0x7263('0x3c')]=_[_0x7263('0x3d')](_0x3f7a6a['query']);_0x4e78df[_0x7263('0x3e')]=_['intersection'](_0x4e78df['model'],_0x4e78df[_0x7263('0x3c')]);_0x313e7e[_0x7263('0x40')]=_[_0x7263('0x3f')](_0x4e78df[_0x7263('0x3b')],qs[_0x7263('0x41')](_0x3f7a6a[_0x7263('0x3c')][_0x7263('0x41')]));_0x313e7e[_0x7263('0x40')]=_0x313e7e['attributes'][_0x7263('0x42')]?_0x313e7e[_0x7263('0x40')]:_0x4e78df[_0x7263('0x3b')];_0x313e7e[_0x7263('0x45')]=qs[_0x7263('0x46')](_0x3f7a6a[_0x7263('0x3c')][_0x7263('0x46')]);_0x313e7e[_0x7263('0x47')]=qs[_0x7263('0x3e')](_['pick'](_0x3f7a6a['query'],_0x4e78df[_0x7263('0x3e')]));if(_0x3f7a6a['query'][_0x7263('0x49')]){_0x313e7e[_0x7263('0x47')]=_[_0x7263('0x4a')](_0x313e7e[_0x7263('0x47')],{'$or':_['map'](_0x313e7e[_0x7263('0x40')],function(_0x312fa1){var _0x3710c4={};_0x3710c4[_0x312fa1]={'$like':'%'+_0x3f7a6a[_0x7263('0x3c')][_0x7263('0x49')]+'%'};return _0x3710c4;})});}_0x313e7e=_[_0x7263('0x4a')]({},_0x313e7e,_0x3f7a6a[_0x7263('0x4b')]);return _0x3d0e4c[_0x7263('0x90')](_0x313e7e);}})[_0x7263('0x2f')](function(_0x1f791e){if(_0x1f791e){_0x3e7cb7=_0x1f791e[_0x7263('0x42')];if(!_0x3f7a6a[_0x7263('0x3c')]['hasOwnProperty'](_0x7263('0x44'))){_0x313e7e[_0x7263('0x28')]=qs['limit'](_0x3f7a6a[_0x7263('0x3c')][_0x7263('0x28')]);_0x313e7e[_0x7263('0x2b')]=qs[_0x7263('0x2b')](_0x3f7a6a[_0x7263('0x3c')]['offset']);}return _0x3d0e4c[_0x7263('0x90')](_0x313e7e);}})[_0x7263('0x2f')](function(_0x5595c1){if(_0x5595c1){return _0x5595c1?{'count':_0x3e7cb7,'rows':_0x5595c1}:null;}})[_0x7263('0x2f')](respondWithResult(_0x9be4c7,null))[_0x7263('0x53')](handleError(_0x9be4c7,null));}; \ No newline at end of file +var _0x519e=['openchannelPause','updatedAt','%s/%s','SIP','createdAt','getTeams','Team','ids','Agents','online','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','error','stack','name','map','OpenchannelQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','body','destroy','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent'];(function(_0x12a346,_0x16f45b){var _0xea5f0a=function(_0x4e3b1d){while(--_0x4e3b1d){_0x12a346['push'](_0x12a346['shift']());}};_0xea5f0a(++_0x16f45b);}(_0x519e,0xac));var _0xe519=function(_0x5279f6,_0x4e84cb){_0x5279f6=_0x5279f6-0x0;var _0x13e44a=_0x519e[_0x5279f6];return _0x13e44a;};'use strict';var emlformat=require(_0xe519('0x0'));var rimraf=require(_0xe519('0x1'));var zipdir=require(_0xe519('0x2'));var jsonpatch=require(_0xe519('0x3'));var rp=require(_0xe519('0x4'));var moment=require(_0xe519('0x5'));var BPromise=require(_0xe519('0x6'));var Mustache=require(_0xe519('0x7'));var util=require(_0xe519('0x8'));var path=require(_0xe519('0x9'));var sox=require(_0xe519('0xa'));var csv=require(_0xe519('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe519('0xc'));var squel=require(_0xe519('0xd'));var crypto=require(_0xe519('0xe'));var jsforce=require(_0xe519('0xf'));var deskjs=require(_0xe519('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe519('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe519('0x12'));var hardwareService=require(_0xe519('0x13'));var logger=require('../../config/logger')(_0xe519('0x14'));var utils=require(_0xe519('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xe519('0x16'));var db=require(_0xe519('0x17'))['db'];config[_0xe519('0x18')]=_[_0xe519('0x19')](config[_0xe519('0x18')],{'host':_0xe519('0x1a'),'port':0x18eb});var socket=require(_0xe519('0x1b'))(new Redis(config[_0xe519('0x18')]));require(_0xe519('0x1c'))[_0xe519('0x1d')](socket);function respondWithStatusCode(_0x1d8f49,_0x21fe9a){_0x21fe9a=_0x21fe9a||0xcc;return function(_0x403afb){if(_0x403afb){return _0x1d8f49[_0xe519('0x1e')](_0x21fe9a);}return _0x1d8f49[_0xe519('0x1f')](_0x21fe9a)[_0xe519('0x20')]();};}function respondWithResult(_0x14d25a,_0x527d41){_0x527d41=_0x527d41||0xc8;return function(_0x1dccc6){if(_0x1dccc6){return _0x14d25a['status'](_0x527d41)[_0xe519('0x21')](_0x1dccc6);}};}function respondWithFilteredResult(_0x5e4c48,_0x2ff214){return function(_0x30ba6a){if(_0x30ba6a){var _0x5a7af7=typeof _0x2ff214[_0xe519('0x22')]===_0xe519('0x23')&&typeof _0x2ff214[_0xe519('0x24')]===_0xe519('0x23');var _0x6235a7=_0x30ba6a[_0xe519('0x25')];var _0x4447fa=_0x5a7af7?0x0:_0x2ff214[_0xe519('0x22')];var _0x27e56e=_0x5a7af7?_0x30ba6a[_0xe519('0x25')]:_0x2ff214['offset']+_0x2ff214[_0xe519('0x24')];var _0x49da15;if(_0x27e56e>=_0x6235a7){_0x27e56e=_0x6235a7;_0x49da15=0xc8;}else{_0x49da15=0xce;}_0x5e4c48['status'](_0x49da15);return _0x5e4c48[_0xe519('0x26')](_0xe519('0x27'),_0x4447fa+'-'+_0x27e56e+'/'+_0x6235a7)[_0xe519('0x21')](_0x30ba6a);}return null;};}function patchUpdates(_0x11a992){return function(_0x409d69){try{jsonpatch[_0xe519('0x28')](_0x409d69,_0x11a992,!![]);}catch(_0x4ef4f5){return BPromise[_0xe519('0x29')](_0x4ef4f5);}return _0x409d69['save']();};}function saveUpdates(_0x37988b,_0xe6aa26){return function(_0x94e6bf){if(_0x94e6bf){return _0x94e6bf[_0xe519('0x2a')](_0x37988b)['then'](function(_0x2cf91d){return _0x2cf91d;});}return null;};}function removeEntity(_0x29832b,_0x52e138){return function(_0x44f781){if(_0x44f781){return _0x44f781['destroy']()[_0xe519('0x2b')](function(){var _0x39fe77=_0x44f781[_0xe519('0x2c')]({'plain':!![]});var _0xbad205='OpenchannelQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xbad205,'resourceId':_0x39fe77['id']}})[_0xe519('0x2b')](function(){return _0x44f781;});})[_0xe519('0x2b')](function(){_0x29832b[_0xe519('0x1f')](0xcc)[_0xe519('0x20')]();});}};}function handleEntityNotFound(_0x25f4c9,_0xdaf49c){return function(_0x348ef3){if(!_0x348ef3){_0x25f4c9[_0xe519('0x1e')](0x194);}return _0x348ef3;};}function handleError(_0x10778a,_0x239341){_0x239341=_0x239341||0x1f4;return function(_0x48896f){logger[_0xe519('0x2d')](_0x48896f[_0xe519('0x2e')]);if(_0x48896f[_0xe519('0x2f')]){delete _0x48896f['name'];}_0x10778a[_0xe519('0x1f')](_0x239341)['send'](_0x48896f);};}exports['index']=function(_0x47f827,_0x32b0c3){var _0xe255ff={},_0x59dd27={},_0x3c37ed={'count':0x0,'rows':[]};var _0x2dd612=_[_0xe519('0x30')](db[_0xe519('0x31')][_0xe519('0x32')],function(_0x45a119){return{'name':_0x45a119['fieldName'],'type':_0x45a119[_0xe519('0x33')][_0xe519('0x34')]};});_0x59dd27[_0xe519('0x35')]=_[_0xe519('0x30')](_0x2dd612,_0xe519('0x2f'));_0x59dd27[_0xe519('0x36')]=_[_0xe519('0x37')](_0x47f827[_0xe519('0x36')]);_0x59dd27[_0xe519('0x38')]=_['intersection'](_0x59dd27[_0xe519('0x35')],_0x59dd27['query']);_0xe255ff[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x59dd27[_0xe519('0x35')],qs[_0xe519('0x3b')](_0x47f827[_0xe519('0x36')]['fields']));_0xe255ff[_0xe519('0x39')]=_0xe255ff[_0xe519('0x39')][_0xe519('0x3c')]?_0xe255ff[_0xe519('0x39')]:_0x59dd27[_0xe519('0x35')];if(!_0x47f827[_0xe519('0x36')][_0xe519('0x3d')](_0xe519('0x3e'))){_0xe255ff[_0xe519('0x24')]=qs[_0xe519('0x24')](_0x47f827['query'][_0xe519('0x24')]);_0xe255ff[_0xe519('0x22')]=qs[_0xe519('0x22')](_0x47f827[_0xe519('0x36')][_0xe519('0x22')]);}_0xe255ff[_0xe519('0x3f')]=qs[_0xe519('0x40')](_0x47f827[_0xe519('0x36')][_0xe519('0x40')]);_0xe255ff[_0xe519('0x41')]=qs[_0xe519('0x38')](_[_0xe519('0x42')](_0x47f827['query'],_0x59dd27['filters']),_0x2dd612);if(_0x47f827[_0xe519('0x36')][_0xe519('0x43')]){_0xe255ff[_0xe519('0x41')]=_[_0xe519('0x44')](_0xe255ff['where'],{'$or':_[_0xe519('0x30')](_0x2dd612,function(_0x85dc81){if(_0x85dc81[_0xe519('0x33')]!=='VIRTUAL'){var _0x41c803={};_0x41c803[_0x85dc81['name']]={'$like':'%'+_0x47f827[_0xe519('0x36')]['filter']+'%'};return _0x41c803;}})});}_0xe255ff=_[_0xe519('0x44')]({},_0xe255ff,_0x47f827[_0xe519('0x45')]);var _0x3221b1={'where':_0xe255ff[_0xe519('0x41')]};return db[_0xe519('0x31')][_0xe519('0x25')](_0x3221b1)[_0xe519('0x2b')](function(_0x134b80){_0x3c37ed[_0xe519('0x25')]=_0x134b80;if(_0x47f827[_0xe519('0x36')][_0xe519('0x46')]){_0xe255ff[_0xe519('0x47')]=[{'all':!![]}];}return db[_0xe519('0x31')][_0xe519('0x48')](_0xe255ff);})[_0xe519('0x2b')](function(_0x8455e0){_0x3c37ed[_0xe519('0x49')]=_0x8455e0;return _0x3c37ed;})[_0xe519('0x2b')](respondWithFilteredResult(_0x32b0c3,_0xe255ff))[_0xe519('0x4a')](handleError(_0x32b0c3,null));};exports[_0xe519('0x4b')]=function(_0x33fd63,_0x55b908){var _0x47222f={'raw':!![],'where':{'id':_0x33fd63[_0xe519('0x4c')]['id']}},_0xc9d6bd={};_0xc9d6bd[_0xe519('0x35')]=_[_0xe519('0x37')](db[_0xe519('0x31')][_0xe519('0x32')]);_0xc9d6bd[_0xe519('0x36')]=_[_0xe519('0x37')](_0x33fd63[_0xe519('0x36')]);_0xc9d6bd[_0xe519('0x38')]=_['intersection'](_0xc9d6bd[_0xe519('0x35')],_0xc9d6bd[_0xe519('0x36')]);_0x47222f[_0xe519('0x39')]=_[_0xe519('0x3a')](_0xc9d6bd['model'],qs['fields'](_0x33fd63[_0xe519('0x36')][_0xe519('0x3b')]));_0x47222f[_0xe519('0x39')]=_0x47222f['attributes'][_0xe519('0x3c')]?_0x47222f[_0xe519('0x39')]:_0xc9d6bd[_0xe519('0x35')];if(_0x33fd63[_0xe519('0x36')][_0xe519('0x46')]){_0x47222f['include']=[{'all':!![]}];}_0x47222f=_[_0xe519('0x44')]({},_0x47222f,_0x33fd63[_0xe519('0x45')]);return db[_0xe519('0x31')][_0xe519('0x4d')](_0x47222f)[_0xe519('0x2b')](handleEntityNotFound(_0x55b908,null))[_0xe519('0x2b')](respondWithResult(_0x55b908,null))['catch'](handleError(_0x55b908,null));};exports[_0xe519('0x4e')]=function(_0xda48db,_0x5d25fc){return db[_0xe519('0x31')][_0xe519('0x4e')](_0xda48db['body'],{})['then'](function(_0x2aae0f){var _0x214040=_0xda48db[_0xe519('0x4f')][_0xe519('0x2c')]({'plain':!![]});if(!_0x214040)throw new Error(_0xe519('0x50'));if(_0x214040[_0xe519('0x51')]===_0xe519('0x4f')){var _0xdb76ca=_0x2aae0f[_0xe519('0x2c')]({'plain':!![]});var _0x8fadc1='OpenchannelQueues';return db[_0xe519('0x52')][_0xe519('0x4d')]({'where':{'name':_0x8fadc1,'userProfileId':_0x214040[_0xe519('0x53')]},'raw':!![]})[_0xe519('0x2b')](function(_0x5bb297){if(_0x5bb297&&_0x5bb297['autoAssociation']===0x0){return db['UserProfileResource'][_0xe519('0x4e')]({'name':_0xdb76ca[_0xe519('0x2f')],'resourceId':_0xdb76ca['id'],'type':_0x5bb297[_0xe519('0x2f')],'sectionId':_0x5bb297['id']},{})[_0xe519('0x2b')](function(){return _0x2aae0f;});}else{return _0x2aae0f;}})[_0xe519('0x4a')](function(_0x5ca1aa){logger[_0xe519('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ca1aa);throw _0x5ca1aa;});}return _0x2aae0f;})[_0xe519('0x2b')](respondWithResult(_0x5d25fc,0xc9))['catch'](handleError(_0x5d25fc,null));};exports['update']=function(_0x5d9def,_0x4e042f){if(_0x5d9def[_0xe519('0x54')]['id']){delete _0x5d9def['body']['id'];}return db[_0xe519('0x31')]['find']({'where':{'id':_0x5d9def[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x4e042f,null))[_0xe519('0x2b')](saveUpdates(_0x5d9def[_0xe519('0x54')],null))[_0xe519('0x2b')](respondWithResult(_0x4e042f,null))[_0xe519('0x4a')](handleError(_0x4e042f,null));};exports[_0xe519('0x55')]=function(_0x354b1,_0x217460){return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x354b1[_0xe519('0x4c')]['id']}})['then'](handleEntityNotFound(_0x217460,null))[_0xe519('0x2b')](removeEntity(_0x217460,null))[_0xe519('0x4a')](handleError(_0x217460,null));};exports[_0xe519('0x56')]=function(_0x3bfedf,_0xfadb4e){return db[_0xe519('0x31')][_0xe519('0x56')]()[_0xe519('0x2b')](respondWithResult(_0xfadb4e,null))['catch'](handleError(_0xfadb4e,null));};exports[_0xe519('0x57')]=function(_0x4be537,_0x4fc909,_0x5cc152){var _0x108925={'raw':!![],'where':{}},_0x3abdeb={},_0x3a242c;return db[_0xe519('0x31')][_0xe519('0x58')]({'where':{'id':_0x4be537['params']['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x4fc909,null))[_0xe519('0x2b')](function(_0x2a3130){if(_0x2a3130){_0x3a242c=_0x2a3130[_0xe519('0x2c')]({'plain':!![]});_0x3abdeb[_0xe519('0x35')]=_[_0xe519('0x37')](db[_0xe519('0x59')][_0xe519('0x32')]);_0x3abdeb['query']=_['keys'](_0x4be537['query']);_0x3abdeb['filters']=_['intersection'](_0x3abdeb[_0xe519('0x35')],_0x3abdeb['query']);_0x108925[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x3abdeb[_0xe519('0x35')],qs[_0xe519('0x3b')](_0x4be537[_0xe519('0x36')][_0xe519('0x3b')]));_0x108925[_0xe519('0x39')]=_0x108925['attributes'][_0xe519('0x3c')]?_0x108925[_0xe519('0x39')]:_0x3abdeb[_0xe519('0x35')];if(!_0x4be537[_0xe519('0x36')][_0xe519('0x3d')](_0xe519('0x3e'))){_0x108925[_0xe519('0x24')]=qs[_0xe519('0x24')](_0x4be537[_0xe519('0x36')]['limit']);_0x108925[_0xe519('0x22')]=qs['offset'](_0x4be537[_0xe519('0x36')][_0xe519('0x22')]);}_0x108925[_0xe519('0x3f')]=qs[_0xe519('0x40')](_0x4be537[_0xe519('0x36')][_0xe519('0x40')]);_0x108925[_0xe519('0x41')]=qs[_0xe519('0x38')](_[_0xe519('0x42')](_0x4be537[_0xe519('0x36')],_0x3abdeb['filters']));_0x108925['where'][_0xe519('0x5a')]=_0x2a3130['id'];if(_0x4be537[_0xe519('0x36')][_0xe519('0x43')]){_0x108925[_0xe519('0x41')]=_[_0xe519('0x44')](_0x108925[_0xe519('0x41')],{'$or':_[_0xe519('0x30')](_0x108925[_0xe519('0x39')],function(_0x34f0e6){var _0x3ec24={};_0x3ec24[_0x34f0e6]={'$like':'%'+_0x4be537[_0xe519('0x36')][_0xe519('0x43')]+'%'};return _0x3ec24;})});}_0x108925=_['merge']({},_0x108925,_0x4be537[_0xe519('0x45')]);return db[_0xe519('0x59')][_0xe519('0x48')](_0x108925);}})[_0xe519('0x2b')](function(_0x2eb09d){if(_0x2eb09d){return db[_0xe519('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x2eb09d,_0xe519('0x5c')),'role':_0xe519('0x5d')},'attributes':['id',_0xe519('0x2f'),_0xe519('0x5e'),_0xe519('0x5f'),'createdAt']});}})[_0xe519('0x2b')](function(_0x17d3eb){if(_0x17d3eb){return{'count':_0x17d3eb['count'],'rows':_[_0xe519('0x30')](_0x17d3eb[_0xe519('0x49')],function(_0x5a219b){return{'membername':_0x5a219b[_0xe519('0x2f')],'UserId':_0x5a219b['id'],'queue_name':_0x3a242c[_0xe519('0x2f')],'OpenchannelQueueId':_0x3a242c['id'],'interface':util['format'](_0xe519('0x60'),_0xe519('0x61'),_0x5a219b[_0xe519('0x2f')]),'penalty':0x0,'paused':_0x5a219b[_0xe519('0x5e')],'createdAt':_0x5a219b[_0xe519('0x62')],'updatedAt':_0x5a219b[_0xe519('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4fc909,_0x108925))['catch'](handleError(_0x4fc909,null));};exports[_0xe519('0x63')]=function(_0x49e127,_0x2e628a,_0x5e5e47){var _0x56c22e={};var _0x37c6d4={};var _0x5a40d5;var _0x233e4f;return db[_0xe519('0x31')]['findOne']({'where':{'id':_0x49e127[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x2e628a,null))[_0xe519('0x2b')](function(_0xe397bb){if(_0xe397bb){_0x5a40d5=_0xe397bb;_0x37c6d4[_0xe519('0x35')]=_['keys'](db[_0xe519('0x64')][_0xe519('0x32')]);_0x37c6d4[_0xe519('0x36')]=_[_0xe519('0x37')](_0x49e127[_0xe519('0x36')]);_0x37c6d4['filters']=_[_0xe519('0x3a')](_0x37c6d4[_0xe519('0x35')],_0x37c6d4[_0xe519('0x36')]);_0x56c22e[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x37c6d4[_0xe519('0x35')],qs[_0xe519('0x3b')](_0x49e127[_0xe519('0x36')][_0xe519('0x3b')]));_0x56c22e[_0xe519('0x39')]=_0x56c22e['attributes']['length']?_0x56c22e[_0xe519('0x39')]:_0x37c6d4[_0xe519('0x35')];_0x56c22e['order']=qs['sort'](_0x49e127[_0xe519('0x36')][_0xe519('0x40')]);_0x56c22e[_0xe519('0x41')]=qs[_0xe519('0x38')](_[_0xe519('0x42')](_0x49e127['query'],_0x37c6d4[_0xe519('0x38')]));if(_0x49e127[_0xe519('0x36')][_0xe519('0x43')]){_0x56c22e['where']=_[_0xe519('0x44')](_0x56c22e[_0xe519('0x41')],{'$or':_[_0xe519('0x30')](_0x56c22e[_0xe519('0x39')],function(_0xb7dd10){var _0x2091ad={};_0x2091ad[_0xb7dd10]={'$like':'%'+_0x49e127[_0xe519('0x36')][_0xe519('0x43')]+'%'};return _0x2091ad;})});}_0x56c22e=_[_0xe519('0x44')]({},_0x56c22e,_0x49e127[_0xe519('0x45')]);return _0x5a40d5[_0xe519('0x63')](_0x56c22e);}})[_0xe519('0x2b')](function(_0x5a1083){if(_0x5a1083){_0x233e4f=_0x5a1083[_0xe519('0x3c')];if(!_0x49e127[_0xe519('0x36')][_0xe519('0x3d')](_0xe519('0x3e'))){_0x56c22e[_0xe519('0x24')]=qs[_0xe519('0x24')](_0x49e127['query'][_0xe519('0x24')]);_0x56c22e['offset']=qs[_0xe519('0x22')](_0x49e127['query'][_0xe519('0x22')]);}return _0x5a40d5[_0xe519('0x63')](_0x56c22e);}})[_0xe519('0x2b')](function(_0x465355){if(_0x465355){return _0x465355?{'count':_0x233e4f,'rows':_0x465355}:null;}})['then'](respondWithResult(_0x2e628a,null))['catch'](handleError(_0x2e628a,null));};exports['addTeams']=function(_0x29e5a2,_0x3b24c9,_0xaf7ce8){var _0x16bcf6=_0x29e5a2[_0xe519('0x54')][_0xe519('0x65')];return db[_0xe519('0x64')][_0xe519('0x48')]({'where':{'id':_0x16bcf6},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe519('0x66'),'attributes':['id',_0xe519('0x2f'),_0xe519('0x67'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x75678d){if(_0x75678d){var _0x51cea1=_[_0xe519('0x68')](_0x75678d,function(_0x133646){var _0x132fa7=_0x133646[_0xe519('0x2c')]({'plain':!![]});return _0x132fa7['Agents'];});return db['OpenchannelQueue'][_0xe519('0x4d')]({'where':{'id':_0x29e5a2[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](function(_0x3edccc){return db[_0xe519('0x69')][_0xe519('0x6a')](function(_0x4bd506){return _0x3edccc['addTeams'](_0x16bcf6,{'transaction':_0x4bd506})['then'](function(){return BPromise['each'](_0x51cea1,function(_0x501d92){return db[_0xe519('0x59')][_0xe519('0x6b')]({'where':{'UserId':_0x501d92['id'],'OpenchannelQueueId':_0x29e5a2[_0xe519('0x4c')]['id']},'transaction':_0x4bd506});});})['then'](function(){_0x51cea1[_0xe519('0x6c')](function(_0x227e8a){socket[_0xe519('0x6d')](_0xe519('0x6e'),{'UserId':_0x227e8a['id'],'OpenchannelQueueId':_0x3edccc['id']});});});});});}})[_0xe519('0x2b')](respondWithStatusCode(_0x3b24c9,null))['catch'](handleError(_0x3b24c9,null));};exports[_0xe519('0x6f')]=function(_0x124db5,_0x1b8144,_0x53821c){return db[_0xe519('0x64')]['findAll']({'where':{'id':_0x124db5[_0xe519('0x36')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe519('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe519('0x2b')](handleEntityNotFound(_0x1b8144,null))[_0xe519('0x2b')](function(_0x3b69fa){var _0x22a4cf=_[_0xe519('0x30')](_0x3b69fa,'id');var _0x4aa87c=[];var _0x570a65=[];var _0x9022f1=squel[_0xe519('0x70')]();_0x9022f1[_0xe519('0x71')](_0xe519('0x72'))['from']('team_has_openchannel_queues','tq')[_0xe519('0x73')]('user_has_teams','ut',_0xe519('0x74'))['where']('OpenchannelQueueId\x20=\x20?',_0x124db5[_0xe519('0x4c')]['id']);for(var _0x34b48a=0x0;_0x34b48a<_0x3b69fa[_0xe519('0x3c')];_0x34b48a+=0x1){let _0x2878a4=_0x3b69fa[_0x34b48a];for(var _0x514a50=0x0;_0x514a50<_0x2878a4[_0xe519('0x66')][_0xe519('0x3c')];_0x514a50+=0x1){let _0x48737b=_0x2878a4[_0xe519('0x66')][_0x514a50];var _0x92b5ed=_0x9022f1[_0xe519('0x75')]();_0x92b5ed[_0xe519('0x41')](_0xe519('0x76'),_0x48737b['id']);_0x570a65[_0xe519('0x77')](db['sequelize']['query'](_0x92b5ed['toString'](),{'type':db[_0xe519('0x69')][_0xe519('0x78')][_0xe519('0x79')]})[_0xe519('0x2b')](function(_0x100ee2){if(_0x100ee2[_0xe519('0x3c')]===0x1){return _0x48737b['id'];}else{var _0x1adbef=_['every'](_[_0xe519('0x30')](_0x100ee2,_0xe519('0x7a')),function(_0x244206){return _[_0xe519('0x7b')](_0x22a4cf,_0x244206);});if(_0x1adbef){return _0x48737b['id'];}}}));}}return BPromise[_0xe519('0x7c')](_0x570a65)['then'](function(_0x28ba02){_0x4aa87c=_(_0x4aa87c)['union'](_0x28ba02)['compact']()[_0xe519('0x7d')]();return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x124db5[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](function(_0x1e30a1){return db[_0xe519('0x69')][_0xe519('0x6a')](function(_0x591ab1){return _0x1e30a1['removeTeams'](_0x124db5[_0xe519('0x36')]['ids'],{'transaction':_0x591ab1})[_0xe519('0x2b')](function(){if(!_[_0xe519('0x7e')](_0x4aa87c)){return _0x1e30a1[_0xe519('0x7f')](_0x4aa87c,{'transaction':_0x591ab1});}})[_0xe519('0x2b')](function(){_0x4aa87c[_0xe519('0x6c')](function(_0x38d9da){socket['emit'](_0xe519('0x80'),{'UserId':_0x38d9da,'OpenchannelQueueId':_0x1e30a1['id']});});});});});});})[_0xe519('0x2b')](respondWithStatusCode(_0x1b8144,null))[_0xe519('0x4a')](handleError(_0x1b8144,null));};exports[_0xe519('0x81')]=function(_0x329915,_0x2c0655,_0x5e3bc4){return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x329915[_0xe519('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c0655,null))[_0xe519('0x2b')](function(_0xbf02b){if(_0xbf02b){return _0xbf02b[_0xe519('0x81')](_0x329915[_0xe519('0x54')][_0xe519('0x65')],_[_0xe519('0x82')](_0x329915[_0xe519('0x54')],[_0xe519('0x65'),'id'])||{})['spread'](function(_0x2bfe96){for(var _0x4f3761=0x0;_0x4f3761<_0x329915[_0xe519('0x54')]['ids'][_0xe519('0x3c')];_0x4f3761+=0x1){socket[_0xe519('0x6d')](_0xe519('0x6e'),{'UserId':Number(_0x329915[_0xe519('0x54')]['ids'][_0x4f3761]),'OpenchannelQueueId':Number(_0x329915[_0xe519('0x4c')]['id'])});}return _0x2bfe96;});}})[_0xe519('0x2b')](respondWithResult(_0x2c0655,null))['catch'](handleError(_0x2c0655,null));};exports[_0xe519('0x7f')]=function(_0x3abc27,_0x16ab62,_0x122bed){return db[_0xe519('0x31')][_0xe519('0x4d')]({'where':{'id':_0x3abc27[_0xe519('0x4c')]['id']}})[_0xe519('0x2b')](handleEntityNotFound(_0x16ab62,null))[_0xe519('0x2b')](function(_0x54000d){if(_0x54000d){return _0x54000d[_0xe519('0x7f')](_0x3abc27['query'][_0xe519('0x65')])[_0xe519('0x2b')](function(){if(_[_0xe519('0x83')](_0x3abc27['query'][_0xe519('0x65')])){for(var _0x8ed7df=0x0;_0x8ed7df<_0x3abc27[_0xe519('0x36')][_0xe519('0x65')][_0xe519('0x3c')];_0x8ed7df+=0x1){socket[_0xe519('0x6d')]('userOpenchannelQueue:remove',{'UserId':Number(_0x3abc27[_0xe519('0x36')][_0xe519('0x65')][_0x8ed7df]),'OpenchannelQueueId':Number(_0x3abc27['params']['id'])});}}else{socket[_0xe519('0x6d')](_0xe519('0x80'),{'UserId':Number(_0x3abc27[_0xe519('0x36')]['ids']),'OpenchannelQueueId':Number(_0x3abc27[_0xe519('0x4c')]['id'])});}});}})[_0xe519('0x2b')](respondWithStatusCode(_0x16ab62,null))[_0xe519('0x4a')](handleError(_0x16ab62,null));};exports[_0xe519('0x84')]=function(_0x2d6bbe,_0x26ab68,_0x2baf37){var _0x3699d3={};var _0x3fe250={};var _0x871a72;var _0x139002;return db[_0xe519('0x31')][_0xe519('0x58')]({'where':{'id':_0x2d6bbe[_0xe519('0x4c')]['id']}})['then'](handleEntityNotFound(_0x26ab68,null))[_0xe519('0x2b')](function(_0xe879b6){if(_0xe879b6){_0x871a72=_0xe879b6;_0x3fe250[_0xe519('0x35')]=_['keys'](db[_0xe519('0x5b')][_0xe519('0x32')]);_0x3fe250[_0xe519('0x36')]=_['keys'](_0x2d6bbe['query']);_0x3fe250[_0xe519('0x38')]=_['intersection'](_0x3fe250[_0xe519('0x35')],_0x3fe250['query']);_0x3699d3[_0xe519('0x39')]=_[_0xe519('0x3a')](_0x3fe250[_0xe519('0x35')],qs['fields'](_0x2d6bbe[_0xe519('0x36')]['fields']));_0x3699d3['attributes']=_0x3699d3['attributes']['length']?_0x3699d3['attributes']:_0x3fe250[_0xe519('0x35')];_0x3699d3[_0xe519('0x3f')]=qs[_0xe519('0x40')](_0x2d6bbe[_0xe519('0x36')][_0xe519('0x40')]);_0x3699d3['where']=qs['filters'](_[_0xe519('0x42')](_0x2d6bbe['query'],_0x3fe250['filters']));if(_0x2d6bbe[_0xe519('0x36')][_0xe519('0x43')]){_0x3699d3['where']=_[_0xe519('0x44')](_0x3699d3['where'],{'$or':_[_0xe519('0x30')](_0x3699d3[_0xe519('0x39')],function(_0x2ccab0){var _0x19bf90={};_0x19bf90[_0x2ccab0]={'$like':'%'+_0x2d6bbe[_0xe519('0x36')][_0xe519('0x43')]+'%'};return _0x19bf90;})});}_0x3699d3=_[_0xe519('0x44')]({},_0x3699d3,_0x2d6bbe[_0xe519('0x45')]);return _0x871a72[_0xe519('0x84')](_0x3699d3);}})[_0xe519('0x2b')](function(_0x367d4b){if(_0x367d4b){_0x139002=_0x367d4b['length'];if(!_0x2d6bbe[_0xe519('0x36')][_0xe519('0x3d')]('nolimit')){_0x3699d3[_0xe519('0x24')]=qs['limit'](_0x2d6bbe[_0xe519('0x36')][_0xe519('0x24')]);_0x3699d3[_0xe519('0x22')]=qs[_0xe519('0x22')](_0x2d6bbe[_0xe519('0x36')][_0xe519('0x22')]);}return _0x871a72[_0xe519('0x84')](_0x3699d3);}})[_0xe519('0x2b')](function(_0x70683d){if(_0x70683d){return _0x70683d?{'count':_0x139002,'rows':_0x70683d}:null;}})[_0xe519('0x2b')](respondWithResult(_0x26ab68,null))[_0xe519('0x4a')](handleError(_0x26ab68,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 43652b5..a2bbcd8 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 _0x8f59=['emit','hasOwnProperty','hook','exports','events','OpenchannelQueue','setMaxListeners','update','remove'];(function(_0x2ac4c9,_0x321b2b){var _0x4429c4=function(_0x5a1021){while(--_0x5a1021){_0x2ac4c9['push'](_0x2ac4c9['shift']());}};_0x4429c4(++_0x321b2b);}(_0x8f59,0x15a));var _0x98f5=function(_0x5da4ec,_0x5d7bf0){_0x5da4ec=_0x5da4ec-0x0;var _0x5076af=_0x8f59[_0x5da4ec];return _0x5076af;};'use strict';var EventEmitter=require(_0x98f5('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x98f5('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x98f5('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x98f5('0x3'),'afterDestroy':_0x98f5('0x4')};function emitEvent(_0x3bac9d){return function(_0x31e21c,_0x1fed8a,_0x1b1a49){OpenchannelQueueEvents[_0x98f5('0x5')](_0x3bac9d+':'+_0x31e21c['id'],_0x31e21c);OpenchannelQueueEvents['emit'](_0x3bac9d,_0x31e21c);_0x1b1a49(null);};}for(var e in events){if(events[_0x98f5('0x6')](e)){var event=events[e];OpenchannelQueue[_0x98f5('0x7')](e,emitEvent(event));}}module[_0x98f5('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x1d8d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5cd57d,_0x3e5b81){var _0x16d3fe=function(_0x19f50e){while(--_0x19f50e){_0x5cd57d['push'](_0x5cd57d['shift']());}};_0x16d3fe(++_0x3e5b81);}(_0x1d8d,0xf4));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xd1d8('0x0'));var OpenchannelQueue=require(_0xd1d8('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd1d8('0x2')](0x0);var events={'afterCreate':_0xd1d8('0x3'),'afterUpdate':_0xd1d8('0x4'),'afterDestroy':_0xd1d8('0x5')};function emitEvent(_0xd85071){return function(_0x12f2cb,_0x41e382,_0x532349){OpenchannelQueueEvents['emit'](_0xd85071+':'+_0x12f2cb['id'],_0x12f2cb);OpenchannelQueueEvents[_0xd1d8('0x6')](_0xd85071,_0x12f2cb);_0x532349(null);};}for(var e in events){if(events[_0xd1d8('0x7')](e)){var event=events[e];OpenchannelQueue[_0xd1d8('0x8')](e,emitEvent(event));}}module[_0xd1d8('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index ff5b4ce..f9a56b5 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 _0x62d0=['path','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56cdca,_0x5c28e3){var _0x1fb5d6=function(_0x98caf5){while(--_0x98caf5){_0x56cdca['push'](_0x56cdca['shift']());}};_0x1fb5d6(++_0x5c28e3);}(_0x62d0,0x67));var _0x062d=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x62d0[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x062d('0x0'))(_0x062d('0x1'));var moment=require(_0x062d('0x2'));var BPromise=require(_0x062d('0x3'));var rp=require(_0x062d('0x4'));var fs=require('fs');var path=require(_0x062d('0x5'));var rimraf=require('rimraf');var config=require(_0x062d('0x6'));var attributes=require(_0x062d('0x7'));module[_0x062d('0x8')]=function(_0x442860,_0x48dd1c){return _0x442860[_0x062d('0x9')](_0x062d('0xa'),attributes,{'tableName':_0x062d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xef17=['api','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash','util','../../config/logger'];(function(_0x1125a0,_0x1c8726){var _0x4df838=function(_0x1319a1){while(--_0x1319a1){_0x1125a0['push'](_0x1125a0['shift']());}};_0x4df838(++_0x1c8726);}(_0xef17,0x194));var _0x7ef1=function(_0x2fc479,_0x205d8d){_0x2fc479=_0x2fc479-0x0;var _0x48c844=_0xef17[_0x2fc479];return _0x48c844;};'use strict';var _=require(_0x7ef1('0x0'));var util=require(_0x7ef1('0x1'));var logger=require(_0x7ef1('0x2'))(_0x7ef1('0x3'));var moment=require(_0x7ef1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ef1('0x5'));var rimraf=require(_0x7ef1('0x6'));var config=require(_0x7ef1('0x7'));var attributes=require(_0x7ef1('0x8'));module['exports']=function(_0x203921,_0x559870){return _0x203921[_0x7ef1('0x9')]('OpenchannelQueue',attributes,{'tableName':_0x7ef1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 9b171c2..016332c 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 _0xb506=['GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','map','include','model','find','where','ShowOpenchannelQueue','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch'];(function(_0x1bf50f,_0x1611c0){var _0x1636a7=function(_0x5eb8f9){while(--_0x5eb8f9){_0x1bf50f['push'](_0x1bf50f['shift']());}};_0x1636a7(++_0x1611c0);}(_0xb506,0x187));var _0x6b50=function(_0x35bcfd,_0x5b446d){_0x35bcfd=_0x35bcfd-0x0;var _0x21a921=_0xb506[_0x35bcfd];return _0x21a921;};'use strict';var _=require(_0x6b50('0x0'));var util=require(_0x6b50('0x1'));var moment=require(_0x6b50('0x2'));var BPromise=require('bluebird');var rs=require(_0x6b50('0x3'));var fs=require('fs');var Redis=require(_0x6b50('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b50('0x5'));var logger=require(_0x6b50('0x6'))('rpc');var config=require(_0x6b50('0x7'));var jayson=require(_0x6b50('0x8'));var client=jayson[_0x6b50('0x9')][_0x6b50('0xa')]({'port':0x232a});config[_0x6b50('0xb')]=_[_0x6b50('0xc')](config['redis'],{'host':_0x6b50('0xd'),'port':0x18eb});var socket=require(_0x6b50('0xe'))(new Redis(config[_0x6b50('0xb')]));require(_0x6b50('0xf'))[_0x6b50('0x10')](socket);function respondWithRpcPromise(_0x8d9cfa,_0x35605f,_0x1c5a8b){return new BPromise(function(_0x3bef61,_0x343954){return client['request'](_0x8d9cfa,_0x1c5a8b)[_0x6b50('0x11')](function(_0x569c6d){logger[_0x6b50('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x35605f,_0x6b50('0x13'));logger[_0x6b50('0x14')](_0x6b50('0x15'),_0x35605f,'request\x20sent',JSON[_0x6b50('0x16')](_0x569c6d));if(_0x569c6d[_0x6b50('0x17')]){if(_0x569c6d[_0x6b50('0x17')][_0x6b50('0x18')]===0x1f4){logger['error'](_0x6b50('0x19'),_0x35605f,_0x569c6d[_0x6b50('0x17')]['message']);return _0x343954(_0x569c6d['error'][_0x6b50('0x1a')]);}logger[_0x6b50('0x17')](_0x6b50('0x19'),_0x35605f,_0x569c6d[_0x6b50('0x17')][_0x6b50('0x1a')]);return _0x3bef61(_0x569c6d['error'][_0x6b50('0x1a')]);}else{logger[_0x6b50('0x12')](_0x6b50('0x19'),_0x35605f,_0x6b50('0x13'));_0x3bef61(_0x569c6d[_0x6b50('0x1b')][_0x6b50('0x1a')]);}})[_0x6b50('0x1c')](function(_0x3bb4ef){logger[_0x6b50('0x17')](_0x6b50('0x19'),_0x35605f,_0x3bb4ef);_0x343954(_0x3bb4ef);});});}exports[_0x6b50('0x1d')]=function(_0x39694d){var _0x2cc7a0=this;return new Promise(function(_0x39f57a,_0x1a8124){return db[_0x6b50('0x1e')][_0x6b50('0x1f')]({'raw':_0x39694d[_0x6b50('0x20')]?_0x39694d[_0x6b50('0x20')][_0x6b50('0x21')]===undefined?!![]:![]:!![],'where':_0x39694d[_0x6b50('0x20')]?_0x39694d[_0x6b50('0x20')]['where']||null:null,'attributes':_0x39694d['options']?_0x39694d[_0x6b50('0x20')][_0x6b50('0x22')]||null:null,'limit':_0x39694d[_0x6b50('0x20')]?_0x39694d[_0x6b50('0x20')][_0x6b50('0x23')]||null:null,'include':_0x39694d[_0x6b50('0x20')]?_0x39694d['options']['include']?_[_0x6b50('0x24')](_0x39694d['options'][_0x6b50('0x25')],function(_0x1b1910){return{'model':db[_0x1b1910[_0x6b50('0x26')]],'as':_0x1b1910['as'],'attributes':_0x1b1910['attributes'],'include':_0x1b1910[_0x6b50('0x25')]?_[_0x6b50('0x24')](_0x1b1910[_0x6b50('0x25')],function(_0x1ff3fa){return{'model':db[_0x1ff3fa[_0x6b50('0x26')]],'as':_0x1ff3fa['as'],'attributes':_0x1ff3fa['attributes'],'include':_0x1ff3fa[_0x6b50('0x25')]?_[_0x6b50('0x24')](_0x1ff3fa[_0x6b50('0x25')],function(_0x4a68e4){return{'model':db[_0x4a68e4[_0x6b50('0x26')]],'as':_0x4a68e4['as'],'attributes':_0x4a68e4[_0x6b50('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b50('0x11')](function(_0x106b42){logger['info']('GetOpenchannelQueue',_0x39694d);logger[_0x6b50('0x14')](_0x6b50('0x1d'),_0x39694d,JSON[_0x6b50('0x16')](_0x106b42));_0x39f57a(_0x106b42);})[_0x6b50('0x1c')](function(_0x365e19){logger[_0x6b50('0x17')](_0x6b50('0x1d'),_0x365e19[_0x6b50('0x1a')],_0x39694d);_0x1a8124(_0x2cc7a0[_0x6b50('0x17')](0x1f4,_0x365e19[_0x6b50('0x1a')]));});});};exports['ShowOpenchannelQueue']=function(_0x498ed7){var _0x217cb5=this;return new Promise(function(_0x5a49a1,_0x52c133){return db[_0x6b50('0x1e')][_0x6b50('0x27')]({'raw':_0x498ed7[_0x6b50('0x20')]?_0x498ed7[_0x6b50('0x20')][_0x6b50('0x21')]===undefined?!![]:![]:!![],'where':_0x498ed7['options']?_0x498ed7[_0x6b50('0x20')][_0x6b50('0x28')]||null:null,'attributes':_0x498ed7[_0x6b50('0x20')]?_0x498ed7[_0x6b50('0x20')][_0x6b50('0x22')]||null:null,'include':_0x498ed7[_0x6b50('0x20')]?_0x498ed7['options'][_0x6b50('0x25')]?_[_0x6b50('0x24')](_0x498ed7[_0x6b50('0x20')][_0x6b50('0x25')],function(_0x5d3f97){return{'model':db[_0x5d3f97['model']],'as':_0x5d3f97['as'],'attributes':_0x5d3f97[_0x6b50('0x22')],'include':_0x5d3f97[_0x6b50('0x25')]?_[_0x6b50('0x24')](_0x5d3f97[_0x6b50('0x25')],function(_0x2dd352){return{'model':db[_0x2dd352[_0x6b50('0x26')]],'as':_0x2dd352['as'],'attributes':_0x2dd352[_0x6b50('0x22')],'include':_0x2dd352[_0x6b50('0x25')]?_[_0x6b50('0x24')](_0x2dd352[_0x6b50('0x25')],function(_0x2795eb){return{'model':db[_0x2795eb[_0x6b50('0x26')]],'as':_0x2795eb['as'],'attributes':_0x2795eb[_0x6b50('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b50('0x11')](function(_0x39738a){logger[_0x6b50('0x12')](_0x6b50('0x29'),_0x498ed7);logger[_0x6b50('0x14')](_0x6b50('0x29'),_0x498ed7,JSON[_0x6b50('0x16')](_0x39738a));_0x5a49a1(_0x39738a);})['catch'](function(_0x192b8e){logger[_0x6b50('0x17')]('ShowOpenchannelQueue',_0x192b8e['message'],_0x498ed7);_0x52c133(_0x217cb5['error'](0x1f4,_0x192b8e[_0x6b50('0x1a')]));});});}; \ No newline at end of file +var _0xffdd=['then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowOpenchannelQueue','stringify','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./openchannelQueue.socket','register','request'];(function(_0x1f0007,_0x5b1d96){var _0x3ce550=function(_0x2ca4b2){while(--_0x2ca4b2){_0x1f0007['push'](_0x1f0007['shift']());}};_0x3ce550(++_0x5b1d96);}(_0xffdd,0xfc));var _0xdffd=function(_0x43a36f,_0x339749){_0x43a36f=_0x43a36f-0x0;var _0x4702fb=_0xffdd[_0x43a36f];return _0x4702fb;};'use strict';var _=require('lodash');var util=require(_0xdffd('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdffd('0x1'));var fs=require('fs');var Redis=require(_0xdffd('0x2'));var db=require(_0xdffd('0x3'))['db'];var utils=require(_0xdffd('0x4'));var logger=require(_0xdffd('0x5'))(_0xdffd('0x6'));var config=require('../../config/environment');var jayson=require(_0xdffd('0x7'));var client=jayson[_0xdffd('0x8')]['http']({'port':0x232a});config[_0xdffd('0x9')]=_['defaults'](config[_0xdffd('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xdffd('0xa'))(new Redis(config[_0xdffd('0x9')]));require(_0xdffd('0xb'))[_0xdffd('0xc')](socket);function respondWithRpcPromise(_0x139e5d,_0x249eea,_0x20f225){return new BPromise(function(_0x3e896c,_0x185d64){return client[_0xdffd('0xd')](_0x139e5d,_0x20f225)[_0xdffd('0xe')](function(_0x38326b){logger[_0xdffd('0xf')](_0xdffd('0x10'),_0x249eea,_0xdffd('0x11'));logger[_0xdffd('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x249eea,_0xdffd('0x11'),JSON['stringify'](_0x38326b));if(_0x38326b[_0xdffd('0x13')]){if(_0x38326b[_0xdffd('0x13')][_0xdffd('0x14')]===0x1f4){logger[_0xdffd('0x13')](_0xdffd('0x10'),_0x249eea,_0x38326b[_0xdffd('0x13')][_0xdffd('0x15')]);return _0x185d64(_0x38326b['error'][_0xdffd('0x15')]);}logger['error'](_0xdffd('0x10'),_0x249eea,_0x38326b[_0xdffd('0x13')][_0xdffd('0x15')]);return _0x3e896c(_0x38326b['error']['message']);}else{logger[_0xdffd('0xf')](_0xdffd('0x10'),_0x249eea,'request\x20sent');_0x3e896c(_0x38326b[_0xdffd('0x16')][_0xdffd('0x15')]);}})[_0xdffd('0x17')](function(_0x11bda5){logger[_0xdffd('0x13')](_0xdffd('0x10'),_0x249eea,_0x11bda5);_0x185d64(_0x11bda5);});});}exports[_0xdffd('0x18')]=function(_0x4e1c93){var _0x4e6227=this;return new Promise(function(_0x31e225,_0x39ab44){return db[_0xdffd('0x19')][_0xdffd('0x1a')]({'raw':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93['options'][_0xdffd('0x1c')]===undefined?!![]:![]:!![],'where':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x1d')]||null:null,'attributes':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x1e')]||null:null,'limit':_0x4e1c93['options']?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x1f')]||null:null,'include':_0x4e1c93[_0xdffd('0x1b')]?_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x4e1c93[_0xdffd('0x1b')][_0xdffd('0x20')],function(_0x2a8375){return{'model':db[_0x2a8375[_0xdffd('0x22')]],'as':_0x2a8375['as'],'attributes':_0x2a8375[_0xdffd('0x1e')],'include':_0x2a8375['include']?_[_0xdffd('0x21')](_0x2a8375['include'],function(_0xc21758){return{'model':db[_0xc21758[_0xdffd('0x22')]],'as':_0xc21758['as'],'attributes':_0xc21758[_0xdffd('0x1e')],'include':_0xc21758[_0xdffd('0x20')]?_[_0xdffd('0x21')](_0xc21758[_0xdffd('0x20')],function(_0x24b510){return{'model':db[_0x24b510[_0xdffd('0x22')]],'as':_0x24b510['as'],'attributes':_0x24b510[_0xdffd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x429e58){logger[_0xdffd('0xf')]('GetOpenchannelQueue',_0x4e1c93);logger[_0xdffd('0x12')](_0xdffd('0x18'),_0x4e1c93,JSON['stringify'](_0x429e58));_0x31e225(_0x429e58);})[_0xdffd('0x17')](function(_0x71731a){logger[_0xdffd('0x13')]('GetOpenchannelQueue',_0x71731a[_0xdffd('0x15')],_0x4e1c93);_0x39ab44(_0x4e6227[_0xdffd('0x13')](0x1f4,_0x71731a[_0xdffd('0x15')]));});});};exports['ShowOpenchannelQueue']=function(_0x2b4166){var _0xd0ffa8=this;return new Promise(function(_0x412f94,_0x119be1){return db['OpenchannelQueue'][_0xdffd('0x23')]({'raw':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x1d')]||null:null,'attributes':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x1e')]||null:null,'include':_0x2b4166[_0xdffd('0x1b')]?_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x2b4166[_0xdffd('0x1b')][_0xdffd('0x20')],function(_0x571081){return{'model':db[_0x571081['model']],'as':_0x571081['as'],'attributes':_0x571081[_0xdffd('0x1e')],'include':_0x571081[_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x571081['include'],function(_0x551909){return{'model':db[_0x551909[_0xdffd('0x22')]],'as':_0x551909['as'],'attributes':_0x551909[_0xdffd('0x1e')],'include':_0x551909[_0xdffd('0x20')]?_[_0xdffd('0x21')](_0x551909[_0xdffd('0x20')],function(_0x381903){return{'model':db[_0x381903['model']],'as':_0x381903['as'],'attributes':_0x381903['attributes']};}):[]};}):[]};}):[]:[]})[_0xdffd('0xe')](function(_0x48f127){logger[_0xdffd('0xf')](_0xdffd('0x24'),_0x2b4166);logger[_0xdffd('0x12')]('ShowOpenchannelQueue',_0x2b4166,JSON[_0xdffd('0x25')](_0x48f127));_0x412f94(_0x48f127);})['catch'](function(_0x2e8ac8){logger[_0xdffd('0x13')]('ShowOpenchannelQueue',_0x2e8ac8[_0xdffd('0x15')],_0x2b4166);_0x119be1(_0xd0ffa8[_0xdffd('0x13')](0x1f4,_0x2e8ac8[_0xdffd('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 7f05e23..3d3bc2e 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 _0xead9=['register','length','openchannelQueue:','save','remove','update','emit','removeListener'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xead9,0x1ab));var _0x9ead=function(_0x574498,_0x265c7b){_0x574498=_0x574498-0x0;var _0x2283db=_0xead9[_0x574498];return _0x2283db;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x9ead('0x0'),_0x9ead('0x1'),_0x9ead('0x2')];function createListener(_0x3e670e,_0x5ae56b){return function(_0x1fc9a3){_0x5ae56b[_0x9ead('0x3')](_0x3e670e,_0x1fc9a3);};}function removeListener(_0x40d161,_0x1ccdaa){return function(){OpenchannelQueueEvents[_0x9ead('0x4')](_0x40d161,_0x1ccdaa);};}exports[_0x9ead('0x5')]=function(_0x36ed09){for(var _0xfa2d42=0x0,_0xd5a194=events[_0x9ead('0x6')];_0xfa2d42<_0xd5a194;_0xfa2d42++){var _0x582e93=events[_0xfa2d42];var _0x2686f5=createListener(_0x9ead('0x7')+_0x582e93,_0x36ed09);OpenchannelQueueEvents['on'](_0x582e93,_0x2686f5);}}; \ No newline at end of file +var _0xe5b5=['length','openchannelQueue:','./openchannelQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x5027b1,_0x1409a5){var _0x4a46cf=function(_0x121920){while(--_0x121920){_0x5027b1['push'](_0x5027b1['shift']());}};_0x4a46cf(++_0x1409a5);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0xe5b5[_0x4c0622];return _0x1799d8;};'use strict';var OpenchannelQueueEvents=require(_0x5e5b('0x0'));var events=[_0x5e5b('0x1'),_0x5e5b('0x2'),_0x5e5b('0x3')];function createListener(_0x208070,_0x4263e){return function(_0x33e813){_0x4263e[_0x5e5b('0x4')](_0x208070,_0x33e813);};}function removeListener(_0xf20c6a,_0x20a50c){return function(){OpenchannelQueueEvents[_0x5e5b('0x5')](_0xf20c6a,_0x20a50c);};}exports[_0x5e5b('0x6')]=function(_0xf1fbe2){for(var _0x11e0e0=0x0,_0x545eb3=events[_0x5e5b('0x7')];_0x11e0e0<_0x545eb3;_0x11e0e0++){var _0xe089b1=events[_0x11e0e0];var _0xcbd478=createListener(_0x5e5b('0x8')+_0xe089b1,_0xf1fbe2);OpenchannelQueueEvents['on'](_0xe089b1,_0xcbd478);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 375a69a..edf1d04 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 _0x7784=['../../components/interaction/service','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x1aed80,_0x3ca6f6){var _0x43961e=function(_0x43bf2b){while(--_0x43bf2b){_0x1aed80['push'](_0x1aed80['shift']());}};_0x43961e(++_0x3ca6f6);}(_0x7784,0x10a));var _0x4778=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7784[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require('multer');var util=require(_0x4778('0x0'));var path=require('path');var timeout=require(_0x4778('0x1'));var express=require('express');var router=express[_0x4778('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4778('0x3'));var interaction=require(_0x4778('0x4'));var config=require('../../config/environment');var controller=require(_0x4778('0x5'));router[_0x4778('0x6')]('/',auth['isAuthenticated'](),controller[_0x4778('0x7')]);router[_0x4778('0x6')](_0x4778('0x8'),auth[_0x4778('0x9')](),controller['describe']);router[_0x4778('0x6')](_0x4778('0xa'),auth[_0x4778('0x9')](),controller['show']);router[_0x4778('0xb')]('/',auth[_0x4778('0x9')](),controller[_0x4778('0xc')]);router[_0x4778('0xd')](_0x4778('0xa'),auth[_0x4778('0x9')](),controller[_0x4778('0xe')]);router[_0x4778('0xf')](_0x4778('0xa'),auth['isAuthenticated'](),controller[_0x4778('0x10')]);module[_0x4778('0x11')]=router; \ No newline at end of file +var _0x501b=['/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index'];(function(_0x201920,_0x23a42e){var _0x11ca83=function(_0x14cde0){while(--_0x14cde0){_0x201920['push'](_0x201920['shift']());}};_0x11ca83(++_0x23a42e);}(_0x501b,0x13e));var _0xb501=function(_0x22204c,_0x53dbde){_0x22204c=_0x22204c-0x0;var _0x3bb3c3=_0x501b[_0x22204c];return _0x3bb3c3;};'use strict';var multer=require(_0xb501('0x0'));var util=require(_0xb501('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb501('0x2'));var router=express[_0xb501('0x3')]();var fs_extra=require(_0xb501('0x4'));var auth=require(_0xb501('0x5'));var interaction=require(_0xb501('0x6'));var config=require(_0xb501('0x7'));var controller=require(_0xb501('0x8'));router[_0xb501('0x9')]('/',auth[_0xb501('0xa')](),controller[_0xb501('0xb')]);router[_0xb501('0x9')](_0xb501('0xc'),auth[_0xb501('0xa')](),controller[_0xb501('0xd')]);router[_0xb501('0x9')](_0xb501('0xe'),auth['isAuthenticated'](),controller[_0xb501('0xf')]);router[_0xb501('0x10')]('/',auth[_0xb501('0xa')](),controller['create']);router[_0xb501('0x11')](_0xb501('0xe'),auth['isAuthenticated'](),controller[_0xb501('0x12')]);router[_0xb501('0x13')](_0xb501('0xe'),auth[_0xb501('0xa')](),controller[_0xb501('0x14')]);module[_0xb501('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 227e32c..330f297 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 _0xf006=['STRING','DATE','exports'];(function(_0x8957d,_0x1a2301){var _0x33f12f=function(_0x56c100){while(--_0x56c100){_0x8957d['push'](_0x8957d['shift']());}};_0x33f12f(++_0x1a2301);}(_0xf006,0x146));var _0x6f00=function(_0x1b55ff,_0x5e48f7){_0x1b55ff=_0x1b55ff-0x0;var _0x5abddc=_0xf006[_0x1b55ff];return _0x5abddc;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6f00('0x0')]={'uniqueid':{'type':Sequelize[_0x6f00('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x6f00('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x6f00('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb070=['STRING','DATE','moment','sequelize','exports'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0xb070,0x174));var _0x0b07=function(_0x25d68d,_0x69adf9){_0x25d68d=_0x25d68d-0x0;var _0x3f5c89=_0xb070[_0x25d68d];return _0x3f5c89;};'use strict';var moment=require(_0x0b07('0x0'));var Sequelize=require(_0x0b07('0x1'));module[_0x0b07('0x2')]={'uniqueid':{'type':Sequelize[_0x0b07('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x0b07('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0b07('0x4')]},'acceptAt':{'type':Sequelize[_0x0b07('0x4')]},'exitAt':{'type':Sequelize[_0x0b07('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index cd79499..133034e 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 _0xf8d2=['zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','OpenchannelQueueReport','type','model','keys','query','filters','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','intersection','fields','length','find','create','body','describe','eml-format','rimraf'];(function(_0x4ffded,_0x450fb3){var _0xf1c2f1=function(_0x4c4820){while(--_0x4c4820){_0x4ffded['push'](_0x4ffded['shift']());}};_0xf1c2f1(++_0x450fb3);}(_0xf8d2,0x166));var _0x2f8d=function(_0x1855bb,_0x10a70b){_0x1855bb=_0x1855bb-0x0;var _0x30aa52=_0xf8d2[_0x1855bb];return _0x30aa52;};'use strict';var emlformat=require(_0x2f8d('0x0'));var rimraf=require(_0x2f8d('0x1'));var zipdir=require(_0x2f8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f8d('0x3'));var moment=require(_0x2f8d('0x4'));var BPromise=require(_0x2f8d('0x5'));var Mustache=require(_0x2f8d('0x6'));var util=require(_0x2f8d('0x7'));var path=require(_0x2f8d('0x8'));var sox=require('sox');var csv=require(_0x2f8d('0x9'));var ejs=require(_0x2f8d('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8d('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2f8d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2f8d('0xd'));var Papa=require(_0x2f8d('0xe'));var Redis=require(_0x2f8d('0xf'));var authService=require(_0x2f8d('0x10'));var qs=require(_0x2f8d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2f8d('0x12'));var logger=require('../../config/logger')(_0x2f8d('0x13'));var utils=require('../../config/utils');var config=require(_0x2f8d('0x14'));var licenseUtil=require(_0x2f8d('0x15'));var db=require(_0x2f8d('0x16'))['db'];function respondWithStatusCode(_0x519af4,_0x1afb62){_0x1afb62=_0x1afb62||0xcc;return function(_0x248082){if(_0x248082){return _0x519af4[_0x2f8d('0x17')](_0x1afb62);}return _0x519af4[_0x2f8d('0x18')](_0x1afb62)[_0x2f8d('0x19')]();};}function respondWithResult(_0x42eb34,_0x395c62){_0x395c62=_0x395c62||0xc8;return function(_0x2b4ee7){if(_0x2b4ee7){return _0x42eb34[_0x2f8d('0x18')](_0x395c62)[_0x2f8d('0x1a')](_0x2b4ee7);}};}function respondWithFilteredResult(_0x60ca30,_0x4c70d4){return function(_0x1b611f){if(_0x1b611f){var _0x5259f9=typeof _0x4c70d4[_0x2f8d('0x1b')]===_0x2f8d('0x1c')&&typeof _0x4c70d4['limit']===_0x2f8d('0x1c');var _0x1cafb3=_0x1b611f[_0x2f8d('0x1d')];var _0x337f72=_0x5259f9?0x0:_0x4c70d4[_0x2f8d('0x1b')];var _0x41229e=_0x5259f9?_0x1b611f[_0x2f8d('0x1d')]:_0x4c70d4['offset']+_0x4c70d4[_0x2f8d('0x1e')];var _0x3ddad4;if(_0x41229e>=_0x1cafb3){_0x41229e=_0x1cafb3;_0x3ddad4=0xc8;}else{_0x3ddad4=0xce;}_0x60ca30[_0x2f8d('0x18')](_0x3ddad4);return _0x60ca30[_0x2f8d('0x1f')](_0x2f8d('0x20'),_0x337f72+'-'+_0x41229e+'/'+_0x1cafb3)['json'](_0x1b611f);}return null;};}function patchUpdates(_0x2f9f4f){return function(_0x124fa8){try{jsonpatch[_0x2f8d('0x21')](_0x124fa8,_0x2f9f4f,!![]);}catch(_0xaf778a){return BPromise[_0x2f8d('0x22')](_0xaf778a);}return _0x124fa8[_0x2f8d('0x23')]();};}function saveUpdates(_0x22c5c1,_0x2776f4){return function(_0x263fa3){if(_0x263fa3){return _0x263fa3[_0x2f8d('0x24')](_0x22c5c1)[_0x2f8d('0x25')](function(_0x51abf3){return _0x51abf3;});}return null;};}function removeEntity(_0x4cf42a,_0x4d0641){return function(_0x5e28a8){if(_0x5e28a8){return _0x5e28a8[_0x2f8d('0x26')]()[_0x2f8d('0x25')](function(){_0x4cf42a[_0x2f8d('0x18')](0xcc)[_0x2f8d('0x19')]();});}};}function handleEntityNotFound(_0x46ddc2,_0x209f34){return function(_0x137080){if(!_0x137080){_0x46ddc2[_0x2f8d('0x17')](0x194);}return _0x137080;};}function handleError(_0x3b007b,_0x314be4){_0x314be4=_0x314be4||0x1f4;return function(_0x2fe18b){logger[_0x2f8d('0x27')](_0x2fe18b['stack']);if(_0x2fe18b[_0x2f8d('0x28')]){delete _0x2fe18b[_0x2f8d('0x28')];}_0x3b007b['status'](_0x314be4)['send'](_0x2fe18b);};}exports[_0x2f8d('0x29')]=function(_0x12db4b,_0x6f2715){var _0x1994ff={},_0x75b80c={},_0xb1274a={'count':0x0,'rows':[]};var _0xfa2d4f=_[_0x2f8d('0x2a')](db[_0x2f8d('0x2b')]['rawAttributes'],function(_0xea779e){return{'name':_0xea779e['fieldName'],'type':_0xea779e[_0x2f8d('0x2c')]['key']};});_0x75b80c[_0x2f8d('0x2d')]=_[_0x2f8d('0x2a')](_0xfa2d4f,_0x2f8d('0x28'));_0x75b80c['query']=_[_0x2f8d('0x2e')](_0x12db4b[_0x2f8d('0x2f')]);_0x75b80c[_0x2f8d('0x30')]=_['intersection'](_0x75b80c[_0x2f8d('0x2d')],_0x75b80c[_0x2f8d('0x2f')]);_0x1994ff[_0x2f8d('0x31')]=_['intersection'](_0x75b80c[_0x2f8d('0x2d')],qs['fields'](_0x12db4b['query']['fields']));_0x1994ff[_0x2f8d('0x31')]=_0x1994ff[_0x2f8d('0x31')]['length']?_0x1994ff[_0x2f8d('0x31')]:_0x75b80c['model'];if(!_0x12db4b[_0x2f8d('0x2f')][_0x2f8d('0x32')](_0x2f8d('0x33'))){_0x1994ff['limit']=qs['limit'](_0x12db4b[_0x2f8d('0x2f')][_0x2f8d('0x1e')]);_0x1994ff[_0x2f8d('0x1b')]=qs[_0x2f8d('0x1b')](_0x12db4b[_0x2f8d('0x2f')][_0x2f8d('0x1b')]);}_0x1994ff['order']=qs[_0x2f8d('0x34')](_0x12db4b[_0x2f8d('0x2f')][_0x2f8d('0x34')]);_0x1994ff[_0x2f8d('0x35')]=qs['filters'](_[_0x2f8d('0x36')](_0x12db4b[_0x2f8d('0x2f')],_0x75b80c[_0x2f8d('0x30')]),_0xfa2d4f);if(_0x12db4b[_0x2f8d('0x2f')][_0x2f8d('0x37')]){_0x1994ff[_0x2f8d('0x35')]=_['merge'](_0x1994ff[_0x2f8d('0x35')],{'$or':_[_0x2f8d('0x2a')](_0xfa2d4f,function(_0x48bc70){if(_0x48bc70[_0x2f8d('0x2c')]!==_0x2f8d('0x38')){var _0x1cb372={};_0x1cb372[_0x48bc70[_0x2f8d('0x28')]]={'$like':'%'+_0x12db4b[_0x2f8d('0x2f')][_0x2f8d('0x37')]+'%'};return _0x1cb372;}})});}_0x1994ff=_[_0x2f8d('0x39')]({},_0x1994ff,_0x12db4b[_0x2f8d('0x3a')]);var _0x1efd82={'where':_0x1994ff['where']};return db['OpenchannelQueueReport']['count'](_0x1efd82)['then'](function(_0x96b599){_0xb1274a['count']=_0x96b599;if(_0x12db4b[_0x2f8d('0x2f')][_0x2f8d('0x3b')]){_0x1994ff[_0x2f8d('0x3c')]=[{'all':!![]}];}return db[_0x2f8d('0x2b')]['findAll'](_0x1994ff);})[_0x2f8d('0x25')](function(_0x4c9c3e){_0xb1274a[_0x2f8d('0x3d')]=_0x4c9c3e;return _0xb1274a;})[_0x2f8d('0x25')](respondWithFilteredResult(_0x6f2715,_0x1994ff))[_0x2f8d('0x3e')](handleError(_0x6f2715,null));};exports[_0x2f8d('0x3f')]=function(_0x5db8e8,_0x6754ba){var _0x248552={'raw':!![],'where':{'id':_0x5db8e8[_0x2f8d('0x40')]['id']}},_0x286eea={};_0x286eea[_0x2f8d('0x2d')]=_[_0x2f8d('0x2e')](db[_0x2f8d('0x2b')]['rawAttributes']);_0x286eea[_0x2f8d('0x2f')]=_[_0x2f8d('0x2e')](_0x5db8e8[_0x2f8d('0x2f')]);_0x286eea[_0x2f8d('0x30')]=_[_0x2f8d('0x41')](_0x286eea['model'],_0x286eea[_0x2f8d('0x2f')]);_0x248552[_0x2f8d('0x31')]=_['intersection'](_0x286eea[_0x2f8d('0x2d')],qs[_0x2f8d('0x42')](_0x5db8e8[_0x2f8d('0x2f')][_0x2f8d('0x42')]));_0x248552[_0x2f8d('0x31')]=_0x248552[_0x2f8d('0x31')][_0x2f8d('0x43')]?_0x248552[_0x2f8d('0x31')]:_0x286eea[_0x2f8d('0x2d')];if(_0x5db8e8[_0x2f8d('0x2f')][_0x2f8d('0x3b')]){_0x248552[_0x2f8d('0x3c')]=[{'all':!![]}];}_0x248552=_[_0x2f8d('0x39')]({},_0x248552,_0x5db8e8[_0x2f8d('0x3a')]);return db[_0x2f8d('0x2b')][_0x2f8d('0x44')](_0x248552)[_0x2f8d('0x25')](handleEntityNotFound(_0x6754ba,null))[_0x2f8d('0x25')](respondWithResult(_0x6754ba,null))[_0x2f8d('0x3e')](handleError(_0x6754ba,null));};exports[_0x2f8d('0x45')]=function(_0xb5f457,_0x511ee2){return db[_0x2f8d('0x2b')]['create'](_0xb5f457[_0x2f8d('0x46')],{})['then'](respondWithResult(_0x511ee2,0xc9))['catch'](handleError(_0x511ee2,null));};exports[_0x2f8d('0x24')]=function(_0x4ced82,_0x405569){if(_0x4ced82[_0x2f8d('0x46')]['id']){delete _0x4ced82['body']['id'];}return db['OpenchannelQueueReport'][_0x2f8d('0x44')]({'where':{'id':_0x4ced82['params']['id']}})['then'](handleEntityNotFound(_0x405569,null))[_0x2f8d('0x25')](saveUpdates(_0x4ced82[_0x2f8d('0x46')],null))[_0x2f8d('0x25')](respondWithResult(_0x405569,null))['catch'](handleError(_0x405569,null));};exports[_0x2f8d('0x26')]=function(_0x22039b,_0x15fe8d){return db['OpenchannelQueueReport']['find']({'where':{'id':_0x22039b[_0x2f8d('0x40')]['id']}})['then'](handleEntityNotFound(_0x15fe8d,null))[_0x2f8d('0x25')](removeEntity(_0x15fe8d,null))[_0x2f8d('0x3e')](handleError(_0x15fe8d,null));};exports[_0x2f8d('0x47')]=function(_0x2f5a37,_0x2cd572){return db[_0x2f8d('0x2b')][_0x2f8d('0x47')]()['then'](respondWithResult(_0x2cd572,null))[_0x2f8d('0x3e')](handleError(_0x2cd572,null));}; \ No newline at end of file +var _0x289d=['lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','order','sort','filters','pick','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','fs-extra'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0x289d,0x1a2));var _0xd289=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x289d[_0x3ce3c];return _0x55a2c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd289('0x0'));var zipdir=require(_0xd289('0x1'));var jsonpatch=require(_0xd289('0x2'));var rp=require(_0xd289('0x3'));var moment=require(_0xd289('0x4'));var BPromise=require(_0xd289('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd289('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd289('0x7'));var _=require(_0xd289('0x8'));var squel=require(_0xd289('0x9'));var crypto=require('crypto');var jsforce=require(_0xd289('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd289('0xb'));var Papa=require('papaparse');var Redis=require(_0xd289('0xc'));var authService=require(_0xd289('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd289('0xe'));var hardwareService=require(_0xd289('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xd289('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xd289('0x11'));var db=require(_0xd289('0x12'))['db'];function respondWithStatusCode(_0x188791,_0x481f9b){_0x481f9b=_0x481f9b||0xcc;return function(_0x10a7be){if(_0x10a7be){return _0x188791['sendStatus'](_0x481f9b);}return _0x188791[_0xd289('0x13')](_0x481f9b)[_0xd289('0x14')]();};}function respondWithResult(_0x48ee4e,_0xa0f6fe){_0xa0f6fe=_0xa0f6fe||0xc8;return function(_0x113b4d){if(_0x113b4d){return _0x48ee4e[_0xd289('0x13')](_0xa0f6fe)[_0xd289('0x15')](_0x113b4d);}};}function respondWithFilteredResult(_0x5c8f94,_0x4cc167){return function(_0x37fb6d){if(_0x37fb6d){var _0xe87a2c=typeof _0x4cc167['offset']===_0xd289('0x16')&&typeof _0x4cc167[_0xd289('0x17')]===_0xd289('0x16');var _0x1c2029=_0x37fb6d[_0xd289('0x18')];var _0xe9aa10=_0xe87a2c?0x0:_0x4cc167['offset'];var _0x18dfd3=_0xe87a2c?_0x37fb6d['count']:_0x4cc167[_0xd289('0x19')]+_0x4cc167[_0xd289('0x17')];var _0x17849f;if(_0x18dfd3>=_0x1c2029){_0x18dfd3=_0x1c2029;_0x17849f=0xc8;}else{_0x17849f=0xce;}_0x5c8f94['status'](_0x17849f);return _0x5c8f94[_0xd289('0x1a')](_0xd289('0x1b'),_0xe9aa10+'-'+_0x18dfd3+'/'+_0x1c2029)[_0xd289('0x15')](_0x37fb6d);}return null;};}function patchUpdates(_0x5d5ff0){return function(_0x4d6f28){try{jsonpatch[_0xd289('0x1c')](_0x4d6f28,_0x5d5ff0,!![]);}catch(_0x5980e0){return BPromise[_0xd289('0x1d')](_0x5980e0);}return _0x4d6f28[_0xd289('0x1e')]();};}function saveUpdates(_0x338327,_0x1adfe2){return function(_0xe1f6a7){if(_0xe1f6a7){return _0xe1f6a7[_0xd289('0x1f')](_0x338327)[_0xd289('0x20')](function(_0x44dcd0){return _0x44dcd0;});}return null;};}function removeEntity(_0x34113b,_0x47ceed){return function(_0x5b5229){if(_0x5b5229){return _0x5b5229[_0xd289('0x21')]()[_0xd289('0x20')](function(){_0x34113b[_0xd289('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0xc78110,_0x26b29e){return function(_0x37bb9e){if(!_0x37bb9e){_0xc78110[_0xd289('0x22')](0x194);}return _0x37bb9e;};}function handleError(_0x1ebbeb,_0x2b60bf){_0x2b60bf=_0x2b60bf||0x1f4;return function(_0x23d4b5){logger[_0xd289('0x23')](_0x23d4b5[_0xd289('0x24')]);if(_0x23d4b5['name']){delete _0x23d4b5[_0xd289('0x25')];}_0x1ebbeb[_0xd289('0x13')](_0x2b60bf)['send'](_0x23d4b5);};}exports[_0xd289('0x26')]=function(_0xb13d76,_0x36492d){var _0x4f2a3a={},_0x670cbf={},_0x3a8bb0={'count':0x0,'rows':[]};var _0x1a0f2d=_[_0xd289('0x27')](db[_0xd289('0x28')][_0xd289('0x29')],function(_0x2a07fe){return{'name':_0x2a07fe[_0xd289('0x2a')],'type':_0x2a07fe[_0xd289('0x2b')]['key']};});_0x670cbf[_0xd289('0x2c')]=_[_0xd289('0x27')](_0x1a0f2d,'name');_0x670cbf[_0xd289('0x2d')]=_[_0xd289('0x2e')](_0xb13d76['query']);_0x670cbf['filters']=_[_0xd289('0x2f')](_0x670cbf[_0xd289('0x2c')],_0x670cbf[_0xd289('0x2d')]);_0x4f2a3a[_0xd289('0x30')]=_['intersection'](_0x670cbf[_0xd289('0x2c')],qs[_0xd289('0x31')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x31')]));_0x4f2a3a[_0xd289('0x30')]=_0x4f2a3a[_0xd289('0x30')][_0xd289('0x32')]?_0x4f2a3a[_0xd289('0x30')]:_0x670cbf['model'];if(!_0xb13d76['query']['hasOwnProperty']('nolimit')){_0x4f2a3a[_0xd289('0x17')]=qs[_0xd289('0x17')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x17')]);_0x4f2a3a[_0xd289('0x19')]=qs[_0xd289('0x19')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x19')]);}_0x4f2a3a[_0xd289('0x33')]=qs[_0xd289('0x34')](_0xb13d76[_0xd289('0x2d')][_0xd289('0x34')]);_0x4f2a3a['where']=qs[_0xd289('0x35')](_[_0xd289('0x36')](_0xb13d76[_0xd289('0x2d')],_0x670cbf[_0xd289('0x35')]),_0x1a0f2d);if(_0xb13d76[_0xd289('0x2d')]['filter']){_0x4f2a3a['where']=_[_0xd289('0x37')](_0x4f2a3a[_0xd289('0x38')],{'$or':_['map'](_0x1a0f2d,function(_0x3c286c){if(_0x3c286c[_0xd289('0x2b')]!==_0xd289('0x39')){var _0x4d623f={};_0x4d623f[_0x3c286c['name']]={'$like':'%'+_0xb13d76[_0xd289('0x2d')][_0xd289('0x3a')]+'%'};return _0x4d623f;}})});}_0x4f2a3a=_[_0xd289('0x37')]({},_0x4f2a3a,_0xb13d76[_0xd289('0x3b')]);var _0x43b50a={'where':_0x4f2a3a[_0xd289('0x38')]};return db[_0xd289('0x28')][_0xd289('0x18')](_0x43b50a)[_0xd289('0x20')](function(_0x44f698){_0x3a8bb0[_0xd289('0x18')]=_0x44f698;if(_0xb13d76[_0xd289('0x2d')][_0xd289('0x3c')]){_0x4f2a3a[_0xd289('0x3d')]=[{'all':!![]}];}return db[_0xd289('0x28')][_0xd289('0x3e')](_0x4f2a3a);})[_0xd289('0x20')](function(_0x473d3c){_0x3a8bb0[_0xd289('0x3f')]=_0x473d3c;return _0x3a8bb0;})[_0xd289('0x20')](respondWithFilteredResult(_0x36492d,_0x4f2a3a))['catch'](handleError(_0x36492d,null));};exports[_0xd289('0x40')]=function(_0x392023,_0x3c7fc7){var _0x1d606b={'raw':!![],'where':{'id':_0x392023[_0xd289('0x41')]['id']}},_0x20f209={};_0x20f209['model']=_[_0xd289('0x2e')](db[_0xd289('0x28')][_0xd289('0x29')]);_0x20f209[_0xd289('0x2d')]=_['keys'](_0x392023['query']);_0x20f209[_0xd289('0x35')]=_['intersection'](_0x20f209['model'],_0x20f209['query']);_0x1d606b['attributes']=_[_0xd289('0x2f')](_0x20f209['model'],qs[_0xd289('0x31')](_0x392023[_0xd289('0x2d')]['fields']));_0x1d606b[_0xd289('0x30')]=_0x1d606b[_0xd289('0x30')][_0xd289('0x32')]?_0x1d606b[_0xd289('0x30')]:_0x20f209[_0xd289('0x2c')];if(_0x392023[_0xd289('0x2d')][_0xd289('0x3c')]){_0x1d606b[_0xd289('0x3d')]=[{'all':!![]}];}_0x1d606b=_['merge']({},_0x1d606b,_0x392023[_0xd289('0x3b')]);return db[_0xd289('0x28')][_0xd289('0x42')](_0x1d606b)['then'](handleEntityNotFound(_0x3c7fc7,null))[_0xd289('0x20')](respondWithResult(_0x3c7fc7,null))[_0xd289('0x43')](handleError(_0x3c7fc7,null));};exports[_0xd289('0x44')]=function(_0x470737,_0x5c5373){return db['OpenchannelQueueReport'][_0xd289('0x44')](_0x470737[_0xd289('0x45')],{})[_0xd289('0x20')](respondWithResult(_0x5c5373,0xc9))[_0xd289('0x43')](handleError(_0x5c5373,null));};exports[_0xd289('0x1f')]=function(_0x38fe6b,_0x512dc2){if(_0x38fe6b['body']['id']){delete _0x38fe6b['body']['id'];}return db[_0xd289('0x28')][_0xd289('0x42')]({'where':{'id':_0x38fe6b['params']['id']}})[_0xd289('0x20')](handleEntityNotFound(_0x512dc2,null))[_0xd289('0x20')](saveUpdates(_0x38fe6b[_0xd289('0x45')],null))[_0xd289('0x20')](respondWithResult(_0x512dc2,null))[_0xd289('0x43')](handleError(_0x512dc2,null));};exports['destroy']=function(_0x2bcf51,_0x5dbc6c){return db[_0xd289('0x28')][_0xd289('0x42')]({'where':{'id':_0x2bcf51[_0xd289('0x41')]['id']}})[_0xd289('0x20')](handleEntityNotFound(_0x5dbc6c,null))['then'](removeEntity(_0x5dbc6c,null))[_0xd289('0x43')](handleError(_0x5dbc6c,null));};exports[_0xd289('0x46')]=function(_0x44a822,_0x55e929){return db[_0xd289('0x28')]['describe']()['then'](respondWithResult(_0x55e929,null))[_0xd289('0x43')](handleError(_0x55e929,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 107229d..4ebbf0f 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x5a63c9,_0x2233cd){var _0x5d6306=function(_0x385f8d){while(--_0x385f8d){_0x5a63c9['push'](_0x5a63c9['shift']());}};_0x5d6306(++_0x2233cd);}(_0x1261,0x144));var _0x1126=function(_0x8d8f23,_0x8c1961){_0x8d8f23=_0x8d8f23-0x0;var _0x22bf54=_0x1261[_0x8d8f23];return _0x22bf54;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport'];(function(_0x370200,_0x4b2bd4){var _0xb7961b=function(_0x3b34a8){while(--_0x3b34a8){_0x370200['push'](_0x370200['shift']());}};_0xb7961b(++_0x4b2bd4);}(_0x7a54,0x106));var _0x47a5=function(_0x20ecc4,_0x6cd866){_0x20ecc4=_0x20ecc4-0x0;var _0x1bcfea=_0x7a54[_0x20ecc4];return _0x1bcfea;};'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 dedd20d..15dafdf 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 _0xd4f4=['options','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','raw','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelQueueReport','create','body'];(function(_0x482178,_0x496b3f){var _0x3b91c5=function(_0xb15dab){while(--_0xb15dab){_0x482178['push'](_0x482178['shift']());}};_0x3b91c5(++_0x496b3f);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x512b8c,_0x129e73){_0x512b8c=_0x512b8c-0x0;var _0xcaf65a=_0xd4f4[_0x512b8c];return _0xcaf65a;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var moment=require(_0x4d4f('0x2'));var BPromise=require(_0x4d4f('0x3'));var rs=require(_0x4d4f('0x4'));var fs=require('fs');var Redis=require(_0x4d4f('0x5'));var db=require(_0x4d4f('0x6'))['db'];var utils=require(_0x4d4f('0x7'));var logger=require(_0x4d4f('0x8'))(_0x4d4f('0x9'));var config=require(_0x4d4f('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1d7aa8,_0xecc103,_0x150bd6){return new BPromise(function(_0xea29b,_0x40be66){return client[_0x4d4f('0xb')](_0x1d7aa8,_0x150bd6)[_0x4d4f('0xc')](function(_0x226837){logger[_0x4d4f('0xd')](_0x4d4f('0xe'),_0xecc103,_0x4d4f('0xf'));logger[_0x4d4f('0x10')](_0x4d4f('0x11'),_0xecc103,_0x4d4f('0xf'),JSON[_0x4d4f('0x12')](_0x226837));if(_0x226837[_0x4d4f('0x13')]){if(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x14')]===0x1f4){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xecc103,_0x226837['error'][_0x4d4f('0x15')]);return _0x40be66(_0x226837[_0x4d4f('0x13')]['message']);}logger[_0x4d4f('0x13')](_0x4d4f('0xe'),_0xecc103,_0x226837[_0x4d4f('0x13')]['message']);return _0xea29b(_0x226837[_0x4d4f('0x13')][_0x4d4f('0x15')]);}else{logger[_0x4d4f('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xecc103,_0x4d4f('0xf'));_0xea29b(_0x226837['result'][_0x4d4f('0x15')]);}})[_0x4d4f('0x16')](function(_0x4170ca){logger['error'](_0x4d4f('0xe'),_0xecc103,_0x4170ca);_0x40be66(_0x4170ca);});});}exports[_0x4d4f('0x17')]=function(_0x51dcf1){var _0x5dbbeb=this;return new Promise(function(_0x519501,_0x5a58af){return db['OpenchannelQueueReport'][_0x4d4f('0x18')](_0x51dcf1[_0x4d4f('0x19')],{'raw':_0x51dcf1[_0x4d4f('0x1a')]?_0x51dcf1[_0x4d4f('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e1ae2){logger['info'](_0x4d4f('0x17'),_0x51dcf1);logger[_0x4d4f('0x10')](_0x4d4f('0x17'),_0x51dcf1,JSON[_0x4d4f('0x12')](_0x1e1ae2));_0x519501(_0x1e1ae2);})[_0x4d4f('0x16')](function(_0x5beab4){logger['error'](_0x4d4f('0x17'),_0x5beab4['message'],_0x51dcf1);_0x5a58af(_0x5dbbeb[_0x4d4f('0x13')](0x1f4,_0x5beab4[_0x4d4f('0x15')]));});});};exports[_0x4d4f('0x1b')]=function(_0x3f4a55){var _0xf3f7a4=this;return new Promise(function(_0x497cec,_0x44bd2f){return db[_0x4d4f('0x1c')][_0x4d4f('0x1d')](_0x3f4a55[_0x4d4f('0x19')],{'raw':_0x3f4a55['options']?_0x3f4a55['options'][_0x4d4f('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x1f')]||null:null,'attributes':_0x3f4a55['options']?_0x3f4a55[_0x4d4f('0x1a')][_0x4d4f('0x20')]||null:null,'limit':_0x3f4a55[_0x4d4f('0x1a')]?_0x3f4a55[_0x4d4f('0x1a')]['limit']||null:null})[_0x4d4f('0xc')](function(_0x51cb3d){logger[_0x4d4f('0xd')](_0x4d4f('0x1b'),_0x3f4a55);logger['debug'](_0x4d4f('0x1b'),_0x3f4a55,JSON[_0x4d4f('0x12')](_0x51cb3d));_0x497cec(_0x51cb3d);})[_0x4d4f('0x16')](function(_0x3d7f14){logger[_0x4d4f('0x13')](_0x4d4f('0x1b'),_0x3d7f14['message'],_0x3f4a55);_0x44bd2f(_0xf3f7a4[_0x4d4f('0x13')](0x1f4,_0x3d7f14[_0x4d4f('0x15')]));});});}; \ No newline at end of file +var _0xf108=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body'];(function(_0x59759b,_0x45e575){var _0x486222=function(_0x2bdbf2){while(--_0x2bdbf2){_0x59759b['push'](_0x59759b['shift']());}};_0x486222(++_0x45e575);}(_0xf108,0x1d9));var _0x8f10=function(_0x4dc6b5,_0x491a0e){_0x4dc6b5=_0x4dc6b5-0x0;var _0x3cf24d=_0xf108[_0x4dc6b5];return _0x3cf24d;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var moment=require(_0x8f10('0x1'));var BPromise=require(_0x8f10('0x2'));var rs=require(_0x8f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f10('0x4'))(_0x8f10('0x5'));var config=require(_0x8f10('0x6'));var jayson=require(_0x8f10('0x7'));var client=jayson[_0x8f10('0x8')][_0x8f10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212efc,_0x38b45f,_0x9cf8af){return new BPromise(function(_0x22e5df,_0x3a5d06){return client['request'](_0x212efc,_0x9cf8af)[_0x8f10('0xa')](function(_0x1787d2){logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,_0x8f10('0xd'));logger[_0x8f10('0xe')](_0x8f10('0xf'),_0x38b45f,_0x8f10('0xd'),JSON[_0x8f10('0x10')](_0x1787d2));if(_0x1787d2[_0x8f10('0x11')]){if(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x12')]===0x1f4){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')]['message']);return _0x3a5d06(_0x1787d2['error'][_0x8f10('0x13')]);}logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);return _0x22e5df(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);}else{logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,'request\x20sent');_0x22e5df(_0x1787d2[_0x8f10('0x14')][_0x8f10('0x13')]);}})[_0x8f10('0x15')](function(_0x52aafc){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x52aafc);_0x3a5d06(_0x52aafc);});});}exports['CreateOpenchannelQueueReport']=function(_0xdfd335){var _0x468bf3=this;return new Promise(function(_0x255e75,_0x3003ea){return db['OpenchannelQueueReport']['create'](_0xdfd335[_0x8f10('0x16')],{'raw':_0xdfd335[_0x8f10('0x17')]?_0xdfd335[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![]})[_0x8f10('0xa')](function(_0xfdb66e){logger[_0x8f10('0xb')](_0x8f10('0x19'),_0xdfd335);logger[_0x8f10('0xe')](_0x8f10('0x19'),_0xdfd335,JSON[_0x8f10('0x10')](_0xfdb66e));_0x255e75(_0xfdb66e);})['catch'](function(_0x2550e1){logger['error']('CreateOpenchannelQueueReport',_0x2550e1['message'],_0xdfd335);_0x3003ea(_0x468bf3[_0x8f10('0x11')](0x1f4,_0x2550e1['message']));});});};exports[_0x8f10('0x1a')]=function(_0xdaa7dd){var _0x2cbbf4=this;return new Promise(function(_0x39178d,_0x419cd7){return db[_0x8f10('0x1b')][_0x8f10('0x1c')](_0xdaa7dd[_0x8f10('0x16')],{'raw':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1d')]||null:null,'attributes':_0xdaa7dd['options']?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1e')]||null:null,'limit':_0xdaa7dd['options']?_0xdaa7dd['options']['limit']||null:null})[_0x8f10('0xa')](function(_0x11db52){logger[_0x8f10('0xb')](_0x8f10('0x1a'),_0xdaa7dd);logger[_0x8f10('0xe')]('UpdateOpenchannelQueueReport',_0xdaa7dd,JSON[_0x8f10('0x10')](_0x11db52));_0x39178d(_0x11db52);})['catch'](function(_0x2f1ee1){logger[_0x8f10('0x11')](_0x8f10('0x1a'),_0x2f1ee1['message'],_0xdaa7dd);_0x419cd7(_0x2cbbf4[_0x8f10('0x11')](0x1f4,_0x2f1ee1['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0d88df4..fbb1a17 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 _0xeb18=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x37eb08,_0x51c34e){var _0x3603ca=function(_0x426452){while(--_0x426452){_0x37eb08['push'](_0x37eb08['shift']());}};_0x3603ca(++_0x51c34e);}(_0xeb18,0x128));var _0x8eb1=function(_0x56e693,_0x3e9c0b){_0x56e693=_0x56e693-0x0;var _0xff14d8=_0xeb18[_0x56e693];return _0xff14d8;};'use strict';var multer=require(_0x8eb1('0x0'));var util=require(_0x8eb1('0x1'));var path=require('path');var timeout=require(_0x8eb1('0x2'));var express=require(_0x8eb1('0x3'));var router=express[_0x8eb1('0x4')]();var fs_extra=require(_0x8eb1('0x5'));var auth=require(_0x8eb1('0x6'));var interaction=require(_0x8eb1('0x7'));var config=require(_0x8eb1('0x8'));var controller=require(_0x8eb1('0x9'));router[_0x8eb1('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8eb1('0xa')](_0x8eb1('0xb'),auth[_0x8eb1('0xc')](),controller[_0x8eb1('0xd')]);router[_0x8eb1('0xa')](_0x8eb1('0xe'),auth[_0x8eb1('0xc')](),controller[_0x8eb1('0xf')]);router[_0x8eb1('0x10')]('/',auth[_0x8eb1('0xc')](),controller[_0x8eb1('0x11')]);router[_0x8eb1('0x12')](_0x8eb1('0xe'),auth[_0x8eb1('0xc')](),controller[_0x8eb1('0x13')]);router[_0x8eb1('0x14')](_0x8eb1('0xe'),auth['isAuthenticated'](),controller[_0x8eb1('0x15')]);module[_0x8eb1('0x16')]=router; \ No newline at end of file +var _0x47bd=['get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x438578,_0xeccb24){var _0x55f90b=function(_0x2ef1fd){while(--_0x2ef1fd){_0x438578['push'](_0x438578['shift']());}};_0x55f90b(++_0xeccb24);}(_0x47bd,0x116));var _0xd47b=function(_0x23edf6,_0x20e67b){_0x23edf6=_0x23edf6-0x0;var _0x3ba292=_0x47bd[_0x23edf6];return _0x3ba292;};'use strict';var multer=require('multer');var util=require(_0xd47b('0x0'));var path=require('path');var timeout=require(_0xd47b('0x1'));var express=require('express');var router=express[_0xd47b('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd47b('0x3'));var interaction=require(_0xd47b('0x4'));var config=require(_0xd47b('0x5'));var controller=require(_0xd47b('0x6'));router[_0xd47b('0x7')]('/',auth['isAuthenticated'](),controller[_0xd47b('0x8')]);router[_0xd47b('0x7')](_0xd47b('0x9'),auth[_0xd47b('0xa')](),controller[_0xd47b('0xb')]);router['get'](_0xd47b('0xc'),auth['isAuthenticated'](),controller[_0xd47b('0xd')]);router['post']('/',auth[_0xd47b('0xa')](),controller['create']);router[_0xd47b('0xe')](_0xd47b('0xc'),auth[_0xd47b('0xa')](),controller[_0xd47b('0xf')]);router[_0xd47b('0x10')](_0xd47b('0xc'),auth[_0xd47b('0xa')](),controller[_0xd47b('0x11')]);module[_0xd47b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index e642301..61ebf8d 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x11bd02,_0x2d91d1){var _0x262863=function(_0x80104){while(--_0x80104){_0x11bd02['push'](_0x11bd02['shift']());}};_0x262863(++_0x2d91d1);}(_0x008c,0x188));var _0xc008=function(_0x222a4b,_0x1dc16c){_0x222a4b=_0x222a4b-0x0;var _0x59355f=_0x008c[_0x222a4b];return _0x59355f;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x1664c7,_0x3e4ec4){var _0x5b1f53=function(_0x16d8ba){while(--_0x16d8ba){_0x1664c7['push'](_0x1664c7['shift']());}};_0x5b1f53(++_0x3e4ec4);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x24e2a3,_0x534875){_0x24e2a3=_0x24e2a3-0x0;var _0x3e82f4=_0xf3cd[_0x24e2a3];return _0x3e82f4;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 24f1f8b..816ef70 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 _0x71fc=['rows','show','params','options','find','catch','body','describe','eml-format','rimraf','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','OpenchannelTransferReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x59989b,_0x2e6a6f){var _0x872535=function(_0x41359e){while(--_0x41359e){_0x59989b['push'](_0x59989b['shift']());}};_0x872535(++_0x2e6a6f);}(_0x71fc,0x166));var _0xc71f=function(_0x45ae06,_0x5aafdb){_0x45ae06=_0x45ae06-0x0;var _0x559494=_0x71fc[_0x45ae06];return _0x559494;};'use strict';var emlformat=require(_0xc71f('0x0'));var rimraf=require(_0xc71f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc71f('0x2'));var BPromise=require(_0xc71f('0x3'));var Mustache=require(_0xc71f('0x4'));var util=require(_0xc71f('0x5'));var path=require(_0xc71f('0x6'));var sox=require('sox');var csv=require(_0xc71f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc71f('0x8'));var _=require('lodash');var squel=require(_0xc71f('0x9'));var crypto=require(_0xc71f('0xa'));var jsforce=require(_0xc71f('0xb'));var deskjs=require(_0xc71f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc71f('0xd'));var Papa=require('papaparse');var Redis=require(_0xc71f('0xe'));var authService=require(_0xc71f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc71f('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xc71f('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xc71f('0x12'));var db=require(_0xc71f('0x13'))['db'];function respondWithStatusCode(_0xca1799,_0x171118){_0x171118=_0x171118||0xcc;return function(_0x214a7f){if(_0x214a7f){return _0xca1799[_0xc71f('0x14')](_0x171118);}return _0xca1799[_0xc71f('0x15')](_0x171118)[_0xc71f('0x16')]();};}function respondWithResult(_0x4c2391,_0x20d4ac){_0x20d4ac=_0x20d4ac||0xc8;return function(_0x1c96f3){if(_0x1c96f3){return _0x4c2391[_0xc71f('0x15')](_0x20d4ac)['json'](_0x1c96f3);}};}function respondWithFilteredResult(_0x1d64f4,_0x309b38){return function(_0x394954){if(_0x394954){var _0x2aa2bd=typeof _0x309b38['offset']===_0xc71f('0x17')&&typeof _0x309b38[_0xc71f('0x18')]===_0xc71f('0x17');var _0x23ad41=_0x394954[_0xc71f('0x19')];var _0x5adf32=_0x2aa2bd?0x0:_0x309b38[_0xc71f('0x1a')];var _0x330ea4=_0x2aa2bd?_0x394954[_0xc71f('0x19')]:_0x309b38[_0xc71f('0x1a')]+_0x309b38[_0xc71f('0x18')];var _0x145dd7;if(_0x330ea4>=_0x23ad41){_0x330ea4=_0x23ad41;_0x145dd7=0xc8;}else{_0x145dd7=0xce;}_0x1d64f4['status'](_0x145dd7);return _0x1d64f4[_0xc71f('0x1b')](_0xc71f('0x1c'),_0x5adf32+'-'+_0x330ea4+'/'+_0x23ad41)[_0xc71f('0x1d')](_0x394954);}return null;};}function patchUpdates(_0x5bca63){return function(_0x4cf5af){try{jsonpatch[_0xc71f('0x1e')](_0x4cf5af,_0x5bca63,!![]);}catch(_0xec3287){return BPromise[_0xc71f('0x1f')](_0xec3287);}return _0x4cf5af[_0xc71f('0x20')]();};}function saveUpdates(_0xeb6c96,_0x27db9d){return function(_0x339d6b){if(_0x339d6b){return _0x339d6b[_0xc71f('0x21')](_0xeb6c96)[_0xc71f('0x22')](function(_0x14bf63){return _0x14bf63;});}return null;};}function removeEntity(_0xbd69b1,_0x16ce8d){return function(_0x48e8dd){if(_0x48e8dd){return _0x48e8dd[_0xc71f('0x23')]()[_0xc71f('0x22')](function(){_0xbd69b1[_0xc71f('0x15')](0xcc)[_0xc71f('0x16')]();});}};}function handleEntityNotFound(_0x1ff386,_0x4df8be){return function(_0x409728){if(!_0x409728){_0x1ff386[_0xc71f('0x14')](0x194);}return _0x409728;};}function handleError(_0x50f964,_0x3faf92){_0x3faf92=_0x3faf92||0x1f4;return function(_0x4d5b1f){logger[_0xc71f('0x24')](_0x4d5b1f['stack']);if(_0x4d5b1f[_0xc71f('0x25')]){delete _0x4d5b1f['name'];}_0x50f964[_0xc71f('0x15')](_0x3faf92)['send'](_0x4d5b1f);};}exports['index']=function(_0x5aad01,_0x59b26d){var _0xc6bf39={},_0x1b1f0e={},_0x33d2d0={'count':0x0,'rows':[]};var _0x6dce24=_['map'](db[_0xc71f('0x26')][_0xc71f('0x27')],function(_0x21835f){return{'name':_0x21835f['fieldName'],'type':_0x21835f[_0xc71f('0x28')][_0xc71f('0x29')]};});_0x1b1f0e[_0xc71f('0x2a')]=_['map'](_0x6dce24,'name');_0x1b1f0e[_0xc71f('0x2b')]=_[_0xc71f('0x2c')](_0x5aad01['query']);_0x1b1f0e[_0xc71f('0x2d')]=_[_0xc71f('0x2e')](_0x1b1f0e[_0xc71f('0x2a')],_0x1b1f0e[_0xc71f('0x2b')]);_0xc6bf39['attributes']=_[_0xc71f('0x2e')](_0x1b1f0e[_0xc71f('0x2a')],qs['fields'](_0x5aad01[_0xc71f('0x2b')][_0xc71f('0x2f')]));_0xc6bf39['attributes']=_0xc6bf39[_0xc71f('0x30')][_0xc71f('0x31')]?_0xc6bf39[_0xc71f('0x30')]:_0x1b1f0e[_0xc71f('0x2a')];if(!_0x5aad01['query'][_0xc71f('0x32')](_0xc71f('0x33'))){_0xc6bf39[_0xc71f('0x18')]=qs[_0xc71f('0x18')](_0x5aad01[_0xc71f('0x2b')][_0xc71f('0x18')]);_0xc6bf39[_0xc71f('0x1a')]=qs[_0xc71f('0x1a')](_0x5aad01[_0xc71f('0x2b')]['offset']);}_0xc6bf39[_0xc71f('0x34')]=qs[_0xc71f('0x35')](_0x5aad01['query']['sort']);_0xc6bf39[_0xc71f('0x36')]=qs['filters'](_[_0xc71f('0x37')](_0x5aad01['query'],_0x1b1f0e['filters']),_0x6dce24);if(_0x5aad01['query'][_0xc71f('0x38')]){_0xc6bf39[_0xc71f('0x36')]=_[_0xc71f('0x39')](_0xc6bf39['where'],{'$or':_['map'](_0x6dce24,function(_0x342a58){if(_0x342a58[_0xc71f('0x28')]!==_0xc71f('0x3a')){var _0x505711={};_0x505711[_0x342a58[_0xc71f('0x25')]]={'$like':'%'+_0x5aad01[_0xc71f('0x2b')][_0xc71f('0x38')]+'%'};return _0x505711;}})});}_0xc6bf39=_['merge']({},_0xc6bf39,_0x5aad01['options']);var _0x2a68e6={'where':_0xc6bf39[_0xc71f('0x36')]};return db[_0xc71f('0x26')][_0xc71f('0x19')](_0x2a68e6)[_0xc71f('0x22')](function(_0x3b4395){_0x33d2d0[_0xc71f('0x19')]=_0x3b4395;if(_0x5aad01[_0xc71f('0x2b')][_0xc71f('0x3b')]){_0xc6bf39[_0xc71f('0x3c')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xc71f('0x3d')](_0xc6bf39);})[_0xc71f('0x22')](function(_0x4102cb){_0x33d2d0[_0xc71f('0x3e')]=_0x4102cb;return _0x33d2d0;})[_0xc71f('0x22')](respondWithFilteredResult(_0x59b26d,_0xc6bf39))['catch'](handleError(_0x59b26d,null));};exports[_0xc71f('0x3f')]=function(_0x4ef79e,_0x4567d5){var _0x3f1ff2={'raw':!![],'where':{'id':_0x4ef79e[_0xc71f('0x40')]['id']}},_0x540f13={};_0x540f13[_0xc71f('0x2a')]=_[_0xc71f('0x2c')](db[_0xc71f('0x26')]['rawAttributes']);_0x540f13['query']=_['keys'](_0x4ef79e[_0xc71f('0x2b')]);_0x540f13['filters']=_[_0xc71f('0x2e')](_0x540f13[_0xc71f('0x2a')],_0x540f13[_0xc71f('0x2b')]);_0x3f1ff2[_0xc71f('0x30')]=_[_0xc71f('0x2e')](_0x540f13[_0xc71f('0x2a')],qs[_0xc71f('0x2f')](_0x4ef79e['query'][_0xc71f('0x2f')]));_0x3f1ff2[_0xc71f('0x30')]=_0x3f1ff2[_0xc71f('0x30')][_0xc71f('0x31')]?_0x3f1ff2[_0xc71f('0x30')]:_0x540f13[_0xc71f('0x2a')];if(_0x4ef79e[_0xc71f('0x2b')][_0xc71f('0x3b')]){_0x3f1ff2[_0xc71f('0x3c')]=[{'all':!![]}];}_0x3f1ff2=_[_0xc71f('0x39')]({},_0x3f1ff2,_0x4ef79e[_0xc71f('0x41')]);return db['OpenchannelTransferReport'][_0xc71f('0x42')](_0x3f1ff2)['then'](handleEntityNotFound(_0x4567d5,null))[_0xc71f('0x22')](respondWithResult(_0x4567d5,null))[_0xc71f('0x43')](handleError(_0x4567d5,null));};exports['create']=function(_0x209cf1,_0x1bff6c){return db[_0xc71f('0x26')]['create'](_0x209cf1[_0xc71f('0x44')],{})[_0xc71f('0x22')](respondWithResult(_0x1bff6c,0xc9))[_0xc71f('0x43')](handleError(_0x1bff6c,null));};exports['update']=function(_0x4db27d,_0x41b736){if(_0x4db27d[_0xc71f('0x44')]['id']){delete _0x4db27d[_0xc71f('0x44')]['id'];}return db[_0xc71f('0x26')]['find']({'where':{'id':_0x4db27d[_0xc71f('0x40')]['id']}})[_0xc71f('0x22')](handleEntityNotFound(_0x41b736,null))['then'](saveUpdates(_0x4db27d[_0xc71f('0x44')],null))[_0xc71f('0x22')](respondWithResult(_0x41b736,null))['catch'](handleError(_0x41b736,null));};exports[_0xc71f('0x23')]=function(_0x3c80b8,_0x1ee0ea){return db['OpenchannelTransferReport'][_0xc71f('0x42')]({'where':{'id':_0x3c80b8['params']['id']}})[_0xc71f('0x22')](handleEntityNotFound(_0x1ee0ea,null))['then'](removeEntity(_0x1ee0ea,null))[_0xc71f('0x43')](handleError(_0x1ee0ea,null));};exports['describe']=function(_0x580a33,_0x2a7498){return db['OpenchannelTransferReport'][_0xc71f('0x45')]()[_0xc71f('0x22')](respondWithResult(_0x2a7498,null))[_0xc71f('0x43')](handleError(_0x2a7498,null));}; \ No newline at end of file +var _0x0d1c=['count','offset','limit','Content-Range','reject','update','then','end','sendStatus','stack','name','send','map','OpenchannelTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined'];(function(_0x5bccbf,_0x547e42){var _0x2158c6=function(_0x40f28a){while(--_0x40f28a){_0x5bccbf['push'](_0x5bccbf['shift']());}};_0x2158c6(++_0x547e42);}(_0x0d1c,0xc1));var _0xc0d1=function(_0x1c8d87,_0x3bdaad){_0x1c8d87=_0x1c8d87-0x0;var _0x2d2145=_0x0d1c[_0x1c8d87];return _0x2d2145;};'use strict';var emlformat=require(_0xc0d1('0x0'));var rimraf=require(_0xc0d1('0x1'));var zipdir=require(_0xc0d1('0x2'));var jsonpatch=require(_0xc0d1('0x3'));var rp=require(_0xc0d1('0x4'));var moment=require(_0xc0d1('0x5'));var BPromise=require(_0xc0d1('0x6'));var Mustache=require(_0xc0d1('0x7'));var util=require(_0xc0d1('0x8'));var path=require(_0xc0d1('0x9'));var sox=require(_0xc0d1('0xa'));var csv=require(_0xc0d1('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0d1('0xc'));var _=require('lodash');var squel=require(_0xc0d1('0xd'));var crypto=require(_0xc0d1('0xe'));var jsforce=require(_0xc0d1('0xf'));var deskjs=require(_0xc0d1('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc0d1('0x11'));var Papa=require(_0xc0d1('0x12'));var Redis=require('ioredis');var authService=require(_0xc0d1('0x13'));var qs=require(_0xc0d1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0d1('0x15'));var logger=require('../../config/logger')(_0xc0d1('0x16'));var utils=require(_0xc0d1('0x17'));var config=require(_0xc0d1('0x18'));var licenseUtil=require(_0xc0d1('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f1fb7,_0x28cba6){_0x28cba6=_0x28cba6||0xcc;return function(_0x1da0b3){if(_0x1da0b3){return _0x2f1fb7['sendStatus'](_0x28cba6);}return _0x2f1fb7[_0xc0d1('0x1a')](_0x28cba6)['end']();};}function respondWithResult(_0x50a31b,_0x29bdd9){_0x29bdd9=_0x29bdd9||0xc8;return function(_0x38f27b){if(_0x38f27b){return _0x50a31b['status'](_0x29bdd9)[_0xc0d1('0x1b')](_0x38f27b);}};}function respondWithFilteredResult(_0x4dd145,_0x5d98d7){return function(_0x29c7d8){if(_0x29c7d8){var _0x503413=typeof _0x5d98d7['offset']===_0xc0d1('0x1c')&&typeof _0x5d98d7['limit']===_0xc0d1('0x1c');var _0x503680=_0x29c7d8[_0xc0d1('0x1d')];var _0x1be9cd=_0x503413?0x0:_0x5d98d7[_0xc0d1('0x1e')];var _0xaa7ced=_0x503413?_0x29c7d8[_0xc0d1('0x1d')]:_0x5d98d7[_0xc0d1('0x1e')]+_0x5d98d7[_0xc0d1('0x1f')];var _0x377d2e;if(_0xaa7ced>=_0x503680){_0xaa7ced=_0x503680;_0x377d2e=0xc8;}else{_0x377d2e=0xce;}_0x4dd145[_0xc0d1('0x1a')](_0x377d2e);return _0x4dd145['set'](_0xc0d1('0x20'),_0x1be9cd+'-'+_0xaa7ced+'/'+_0x503680)[_0xc0d1('0x1b')](_0x29c7d8);}return null;};}function patchUpdates(_0x40c341){return function(_0x1b092e){try{jsonpatch['apply'](_0x1b092e,_0x40c341,!![]);}catch(_0x5baa12){return BPromise[_0xc0d1('0x21')](_0x5baa12);}return _0x1b092e['save']();};}function saveUpdates(_0x10436b,_0x3f6aab){return function(_0x590697){if(_0x590697){return _0x590697[_0xc0d1('0x22')](_0x10436b)['then'](function(_0x2878c0){return _0x2878c0;});}return null;};}function removeEntity(_0x2cf9b8,_0x3b62c0){return function(_0x17a93f){if(_0x17a93f){return _0x17a93f['destroy']()[_0xc0d1('0x23')](function(){_0x2cf9b8[_0xc0d1('0x1a')](0xcc)[_0xc0d1('0x24')]();});}};}function handleEntityNotFound(_0x3bc293,_0x4959a5){return function(_0x53b46c){if(!_0x53b46c){_0x3bc293[_0xc0d1('0x25')](0x194);}return _0x53b46c;};}function handleError(_0x43e09c,_0x2069e3){_0x2069e3=_0x2069e3||0x1f4;return function(_0x12bd17){logger['error'](_0x12bd17[_0xc0d1('0x26')]);if(_0x12bd17[_0xc0d1('0x27')]){delete _0x12bd17['name'];}_0x43e09c[_0xc0d1('0x1a')](_0x2069e3)[_0xc0d1('0x28')](_0x12bd17);};}exports['index']=function(_0x26767f,_0x4c4049){var _0x41252f={},_0x3a8322={},_0x2c750c={'count':0x0,'rows':[]};var _0x7f3514=_[_0xc0d1('0x29')](db[_0xc0d1('0x2a')][_0xc0d1('0x2b')],function(_0x132a94){return{'name':_0x132a94[_0xc0d1('0x2c')],'type':_0x132a94['type']['key']};});_0x3a8322[_0xc0d1('0x2d')]=_[_0xc0d1('0x29')](_0x7f3514,'name');_0x3a8322[_0xc0d1('0x2e')]=_[_0xc0d1('0x2f')](_0x26767f[_0xc0d1('0x2e')]);_0x3a8322[_0xc0d1('0x30')]=_[_0xc0d1('0x31')](_0x3a8322['model'],_0x3a8322[_0xc0d1('0x2e')]);_0x41252f[_0xc0d1('0x32')]=_[_0xc0d1('0x31')](_0x3a8322[_0xc0d1('0x2d')],qs[_0xc0d1('0x33')](_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x33')]));_0x41252f[_0xc0d1('0x32')]=_0x41252f[_0xc0d1('0x32')][_0xc0d1('0x34')]?_0x41252f['attributes']:_0x3a8322[_0xc0d1('0x2d')];if(!_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x35')](_0xc0d1('0x36'))){_0x41252f[_0xc0d1('0x1f')]=qs['limit'](_0x26767f['query'][_0xc0d1('0x1f')]);_0x41252f[_0xc0d1('0x1e')]=qs[_0xc0d1('0x1e')](_0x26767f[_0xc0d1('0x2e')]['offset']);}_0x41252f[_0xc0d1('0x37')]=qs['sort'](_0x26767f['query'][_0xc0d1('0x38')]);_0x41252f[_0xc0d1('0x39')]=qs['filters'](_[_0xc0d1('0x3a')](_0x26767f[_0xc0d1('0x2e')],_0x3a8322['filters']),_0x7f3514);if(_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x3b')]){_0x41252f[_0xc0d1('0x39')]=_[_0xc0d1('0x3c')](_0x41252f['where'],{'$or':_['map'](_0x7f3514,function(_0x463b48){if(_0x463b48['type']!==_0xc0d1('0x3d')){var _0xc956e1={};_0xc956e1[_0x463b48['name']]={'$like':'%'+_0x26767f[_0xc0d1('0x2e')][_0xc0d1('0x3b')]+'%'};return _0xc956e1;}})});}_0x41252f=_[_0xc0d1('0x3c')]({},_0x41252f,_0x26767f[_0xc0d1('0x3e')]);var _0x7cbfce={'where':_0x41252f[_0xc0d1('0x39')]};return db['OpenchannelTransferReport'][_0xc0d1('0x1d')](_0x7cbfce)['then'](function(_0x41ead4){_0x2c750c[_0xc0d1('0x1d')]=_0x41ead4;if(_0x26767f['query'][_0xc0d1('0x3f')]){_0x41252f[_0xc0d1('0x40')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xc0d1('0x41')](_0x41252f);})['then'](function(_0x12eee9){_0x2c750c[_0xc0d1('0x42')]=_0x12eee9;return _0x2c750c;})['then'](respondWithFilteredResult(_0x4c4049,_0x41252f))[_0xc0d1('0x43')](handleError(_0x4c4049,null));};exports[_0xc0d1('0x44')]=function(_0x595d52,_0x1d0790){var _0x637648={'raw':!![],'where':{'id':_0x595d52[_0xc0d1('0x45')]['id']}},_0x12c53d={};_0x12c53d[_0xc0d1('0x2d')]=_[_0xc0d1('0x2f')](db[_0xc0d1('0x2a')][_0xc0d1('0x2b')]);_0x12c53d[_0xc0d1('0x2e')]=_[_0xc0d1('0x2f')](_0x595d52[_0xc0d1('0x2e')]);_0x12c53d['filters']=_[_0xc0d1('0x31')](_0x12c53d[_0xc0d1('0x2d')],_0x12c53d[_0xc0d1('0x2e')]);_0x637648[_0xc0d1('0x32')]=_[_0xc0d1('0x31')](_0x12c53d[_0xc0d1('0x2d')],qs['fields'](_0x595d52[_0xc0d1('0x2e')][_0xc0d1('0x33')]));_0x637648['attributes']=_0x637648[_0xc0d1('0x32')]['length']?_0x637648[_0xc0d1('0x32')]:_0x12c53d[_0xc0d1('0x2d')];if(_0x595d52[_0xc0d1('0x2e')][_0xc0d1('0x3f')]){_0x637648[_0xc0d1('0x40')]=[{'all':!![]}];}_0x637648=_[_0xc0d1('0x3c')]({},_0x637648,_0x595d52[_0xc0d1('0x3e')]);return db[_0xc0d1('0x2a')][_0xc0d1('0x46')](_0x637648)[_0xc0d1('0x23')](handleEntityNotFound(_0x1d0790,null))[_0xc0d1('0x23')](respondWithResult(_0x1d0790,null))[_0xc0d1('0x43')](handleError(_0x1d0790,null));};exports[_0xc0d1('0x47')]=function(_0xc92ea3,_0x6152b5){return db[_0xc0d1('0x2a')][_0xc0d1('0x47')](_0xc92ea3[_0xc0d1('0x48')],{})[_0xc0d1('0x23')](respondWithResult(_0x6152b5,0xc9))['catch'](handleError(_0x6152b5,null));};exports[_0xc0d1('0x22')]=function(_0x31e14a,_0x51f543){if(_0x31e14a['body']['id']){delete _0x31e14a[_0xc0d1('0x48')]['id'];}return db[_0xc0d1('0x2a')][_0xc0d1('0x46')]({'where':{'id':_0x31e14a[_0xc0d1('0x45')]['id']}})[_0xc0d1('0x23')](handleEntityNotFound(_0x51f543,null))[_0xc0d1('0x23')](saveUpdates(_0x31e14a[_0xc0d1('0x48')],null))[_0xc0d1('0x23')](respondWithResult(_0x51f543,null))[_0xc0d1('0x43')](handleError(_0x51f543,null));};exports[_0xc0d1('0x49')]=function(_0x5c22c7,_0x2fff1e){return db[_0xc0d1('0x2a')]['find']({'where':{'id':_0x5c22c7[_0xc0d1('0x45')]['id']}})[_0xc0d1('0x23')](handleEntityNotFound(_0x2fff1e,null))[_0xc0d1('0x23')](removeEntity(_0x2fff1e,null))[_0xc0d1('0x43')](handleError(_0x2fff1e,null));};exports['describe']=function(_0x2f2e4d,_0x24976e){return db[_0xc0d1('0x2a')]['describe']()[_0xc0d1('0x23')](respondWithResult(_0x24976e,null))[_0xc0d1('0x43')](handleError(_0x24976e,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 3a2209b..513e30b 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 _0x35ef=['request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird'];(function(_0x38b554,_0x1dfa44){var _0x5a93e3=function(_0x2f8335){while(--_0x2f8335){_0x38b554['push'](_0x38b554['shift']());}};_0x5a93e3(++_0x1dfa44);}(_0x35ef,0x159));var _0xf35e=function(_0x2bb777,_0x4ee487){_0x2bb777=_0x2bb777-0x0;var _0x48686e=_0x35ef[_0x2bb777];return _0x48686e;};'use strict';var _=require(_0xf35e('0x0'));var util=require(_0xf35e('0x1'));var logger=require(_0xf35e('0x2'))('api');var moment=require(_0xf35e('0x3'));var BPromise=require(_0xf35e('0x4'));var rp=require(_0xf35e('0x5'));var fs=require('fs');var path=require(_0xf35e('0x6'));var rimraf=require(_0xf35e('0x7'));var config=require(_0xf35e('0x8'));var attributes=require(_0xf35e('0x9'));module['exports']=function(_0x59680b,_0x5d56ce){return _0x59680b[_0xf35e('0xa')](_0xf35e('0xb'),attributes,{'tableName':_0xf35e('0xc'),'paranoid':![],'indexes':[{'name':_0xf35e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x66e2=['../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x316b7b,_0x5ba87e){var _0xcedfe1=function(_0x1c184e){while(--_0x1c184e){_0x316b7b['push'](_0x316b7b['shift']());}};_0xcedfe1(++_0x5ba87e);}(_0x66e2,0x172));var _0x266e=function(_0x4df667,_0x2d80ea){_0x4df667=_0x4df667-0x0;var _0x24ff9d=_0x66e2[_0x4df667];return _0x24ff9d;};'use strict';var _=require(_0x266e('0x0'));var util=require('util');var logger=require(_0x266e('0x1'))(_0x266e('0x2'));var moment=require('moment');var BPromise=require(_0x266e('0x3'));var rp=require(_0x266e('0x4'));var fs=require('fs');var path=require(_0x266e('0x5'));var rimraf=require(_0x266e('0x6'));var config=require(_0x266e('0x7'));var attributes=require(_0x266e('0x8'));module['exports']=function(_0x2ce15a,_0x401d0f){return _0x2ce15a[_0x266e('0x9')](_0x266e('0xa'),attributes,{'tableName':_0x266e('0xb'),'paranoid':![],'indexes':[{'name':_0x266e('0xc'),'fields':[_0x266e('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 182d8cf..cb6e218 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 _0x05bc=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','bluebird'];(function(_0xff717e,_0x5f3963){var _0x3f6b7d=function(_0x46d8cf){while(--_0x46d8cf){_0xff717e['push'](_0xff717e['shift']());}};_0x3f6b7d(++_0x5f3963);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc05b('0x0'));var moment=require('moment');var BPromise=require(_0xc05b('0x1'));var rs=require(_0xc05b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc05b('0x3'))['db'];var utils=require(_0xc05b('0x4'));var logger=require(_0xc05b('0x5'))(_0xc05b('0x6'));var config=require(_0xc05b('0x7'));var jayson=require(_0xc05b('0x8'));var client=jayson[_0xc05b('0x9')][_0xc05b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9c6c57,_0x1b501a,_0x275f0f){return new BPromise(function(_0x143ba4,_0x45245b){return client[_0xc05b('0xb')](_0x9c6c57,_0x275f0f)['then'](function(_0x5d72b9){logger[_0xc05b('0xc')](_0xc05b('0xd'),_0x1b501a,_0xc05b('0xe'));logger[_0xc05b('0xf')](_0xc05b('0x10'),_0x1b501a,_0xc05b('0xe'),JSON[_0xc05b('0x11')](_0x5d72b9));if(_0x5d72b9[_0xc05b('0x12')]){if(_0x5d72b9[_0xc05b('0x12')]['code']===0x1f4){logger[_0xc05b('0x12')](_0xc05b('0xd'),_0x1b501a,_0x5d72b9[_0xc05b('0x12')][_0xc05b('0x13')]);return _0x45245b(_0x5d72b9[_0xc05b('0x12')][_0xc05b('0x13')]);}logger['error'](_0xc05b('0xd'),_0x1b501a,_0x5d72b9[_0xc05b('0x12')]['message']);return _0x143ba4(_0x5d72b9['error'][_0xc05b('0x13')]);}else{logger[_0xc05b('0xc')](_0xc05b('0xd'),_0x1b501a,_0xc05b('0xe'));_0x143ba4(_0x5d72b9[_0xc05b('0x14')][_0xc05b('0x13')]);}})[_0xc05b('0x15')](function(_0x5a33c1){logger[_0xc05b('0x12')](_0xc05b('0xd'),_0x1b501a,_0x5a33c1);_0x45245b(_0x5a33c1);});});} \ No newline at end of file +var _0xb7a8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xb7a8,0xec));var _0x8b7a=function(_0x19e1e0,_0x464f64){_0x19e1e0=_0x19e1e0-0x0;var _0x566cb1=_0xb7a8[_0x19e1e0];return _0x566cb1;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var moment=require(_0x8b7a('0x1'));var BPromise=require('bluebird');var rs=require(_0x8b7a('0x2'));var fs=require('fs');var Redis=require(_0x8b7a('0x3'));var db=require(_0x8b7a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b7a('0x5'))(_0x8b7a('0x6'));var config=require(_0x8b7a('0x7'));var jayson=require(_0x8b7a('0x8'));var client=jayson[_0x8b7a('0x9')][_0x8b7a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa539dd,_0x4045d9,_0x3e7238){return new BPromise(function(_0xec0881,_0x15b930){return client[_0x8b7a('0xb')](_0xa539dd,_0x3e7238)['then'](function(_0x138031){logger['info'](_0x8b7a('0xc'),_0x4045d9,_0x8b7a('0xd'));logger['debug'](_0x8b7a('0xe'),_0x4045d9,_0x8b7a('0xd'),JSON[_0x8b7a('0xf')](_0x138031));if(_0x138031['error']){if(_0x138031[_0x8b7a('0x10')]['code']===0x1f4){logger[_0x8b7a('0x10')](_0x8b7a('0xc'),_0x4045d9,_0x138031[_0x8b7a('0x10')][_0x8b7a('0x11')]);return _0x15b930(_0x138031['error'][_0x8b7a('0x11')]);}logger['error'](_0x8b7a('0xc'),_0x4045d9,_0x138031[_0x8b7a('0x10')][_0x8b7a('0x11')]);return _0xec0881(_0x138031['error']['message']);}else{logger['info'](_0x8b7a('0xc'),_0x4045d9,'request\x20sent');_0xec0881(_0x138031[_0x8b7a('0x12')][_0x8b7a('0x11')]);}})[_0x8b7a('0x13')](function(_0x21a0be){logger[_0x8b7a('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x4045d9,_0x21a0be);_0x15b930(_0x21a0be);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 624a5aa..f04659f 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 _0xd408=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','show','post'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd408,0x1e7));var _0x8d40=function(_0x7fff5e,_0x240271){_0x7fff5e=_0x7fff5e-0x0;var _0x57f9ce=_0xd408[_0x7fff5e];return _0x57f9ce;};'use strict';var multer=require(_0x8d40('0x0'));var util=require(_0x8d40('0x1'));var path=require(_0x8d40('0x2'));var timeout=require(_0x8d40('0x3'));var express=require(_0x8d40('0x4'));var router=express['Router']();var fs_extra=require(_0x8d40('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8d40('0x6'));var config=require(_0x8d40('0x7'));var controller=require(_0x8d40('0x8'));router[_0x8d40('0x9')]('/',auth[_0x8d40('0xa')](),controller['index']);router['get']('/:id',auth[_0x8d40('0xa')](),controller[_0x8d40('0xb')]);router[_0x8d40('0xc')]('/',auth[_0x8d40('0xa')](),controller[_0x8d40('0xd')]);router[_0x8d40('0xe')](_0x8d40('0xf'),auth['isAuthenticated'](),controller[_0x8d40('0x10')]);router[_0x8d40('0x11')](_0x8d40('0xf'),auth[_0x8d40('0xa')](),controller[_0x8d40('0x12')]);module[_0x8d40('0x13')]=router; \ No newline at end of file +var _0x6059=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','post','create','update','delete'];(function(_0x21f667,_0x308dcd){var _0x4905d6=function(_0x1da082){while(--_0x1da082){_0x21f667['push'](_0x21f667['shift']());}};_0x4905d6(++_0x308dcd);}(_0x6059,0x1aa));var _0x9605=function(_0x5b2c7e,_0x3d22f0){_0x5b2c7e=_0x5b2c7e-0x0;var _0x5ec399=_0x6059[_0x5b2c7e];return _0x5ec399;};'use strict';var multer=require(_0x9605('0x0'));var util=require(_0x9605('0x1'));var path=require(_0x9605('0x2'));var timeout=require(_0x9605('0x3'));var express=require('express');var router=express[_0x9605('0x4')]();var fs_extra=require(_0x9605('0x5'));var auth=require(_0x9605('0x6'));var interaction=require(_0x9605('0x7'));var config=require(_0x9605('0x8'));var controller=require(_0x9605('0x9'));router[_0x9605('0xa')]('/',auth[_0x9605('0xb')](),controller['index']);router[_0x9605('0xa')]('/:id',auth[_0x9605('0xb')](),controller['show']);router[_0x9605('0xc')]('/',auth[_0x9605('0xb')](),controller[_0x9605('0xd')]);router['put']('/:id',auth[_0x9605('0xb')](),controller[_0x9605('0xe')]);router[_0x9605('0xf')]('/:id',auth[_0x9605('0xb')](),controller['destroy']);module[_0x9605('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 6ea6b3a..1c61ed5 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 _0xe409=['name','sequelize','exports','STRING'];(function(_0x22eed2,_0x513099){var _0x155924=function(_0x258c23){while(--_0x258c23){_0x22eed2['push'](_0x22eed2['shift']());}};_0x155924(++_0x513099);}(_0xe409,0x1e5));var _0x9e40=function(_0x323d29,_0x34e68a){_0x323d29=_0x323d29-0x0;var _0xeede20=_0xe409[_0x323d29];return _0xeede20;};'use strict';var Sequelize=require(_0x9e40('0x0'));module[_0x9e40('0x1')]={'name':{'type':Sequelize[_0x9e40('0x2')],'unique':_0x9e40('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9e40('0x2')]}}; \ No newline at end of file +var _0x0b02=['sequelize','name'];(function(_0x5b4436,_0x59df67){var _0x4ed247=function(_0x4f9bd8){while(--_0x4f9bd8){_0x5b4436['push'](_0x5b4436['shift']());}};_0x4ed247(++_0x59df67);}(_0x0b02,0x1c2));var _0x20b0=function(_0x599d12,_0x5b1b0a){_0x599d12=_0x599d12-0x0;var _0x14a89b=_0x0b02[_0x599d12];return _0x14a89b;};'use strict';var Sequelize=require(_0x20b0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x20b0('0x1'),'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 a0f85c8..ce6c3f1 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 _0xb82f=['squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','Pause','rawAttributes','fieldName','type','key','name','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','bluebird','util','sox','ejs','lodash'];(function(_0x31aff9,_0x195b4a){var _0x330086=function(_0x476299){while(--_0x476299){_0x31aff9['push'](_0x31aff9['shift']());}};_0x330086(++_0x195b4a);}(_0xb82f,0xf1));var _0xfb82=function(_0x12fa57,_0xff1708){_0x12fa57=_0x12fa57-0x0;var _0x244fd2=_0xb82f[_0x12fa57];return _0x244fd2;};'use strict';var emlformat=require(_0xfb82('0x0'));var rimraf=require(_0xfb82('0x1'));var zipdir=require(_0xfb82('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfb82('0x3'));var Mustache=require('mustache');var util=require(_0xfb82('0x4'));var path=require('path');var sox=require(_0xfb82('0x5'));var csv=require('to-csv');var ejs=require(_0xfb82('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb82('0x7'));var squel=require(_0xfb82('0x8'));var crypto=require(_0xfb82('0x9'));var jsforce=require(_0xfb82('0xa'));var deskjs=require(_0xfb82('0xb'));var toCsv=require(_0xfb82('0xc'));var querystring=require(_0xfb82('0xd'));var Papa=require(_0xfb82('0xe'));var Redis=require('ioredis');var authService=require(_0xfb82('0xf'));var qs=require(_0xfb82('0x10'));var as=require(_0xfb82('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb82('0x12'))(_0xfb82('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfb82('0x14'));var db=require(_0xfb82('0x15'))['db'];function respondWithStatusCode(_0x389643,_0x3d3693){_0x3d3693=_0x3d3693||0xcc;return function(_0x5084c6){if(_0x5084c6){return _0x389643[_0xfb82('0x16')](_0x3d3693);}return _0x389643[_0xfb82('0x17')](_0x3d3693)[_0xfb82('0x18')]();};}function respondWithResult(_0x2fcabe,_0x540ba7){_0x540ba7=_0x540ba7||0xc8;return function(_0x2d469b){if(_0x2d469b){return _0x2fcabe[_0xfb82('0x17')](_0x540ba7)[_0xfb82('0x19')](_0x2d469b);}};}function respondWithFilteredResult(_0x139ec3,_0xf1691b){return function(_0x74d7b5){if(_0x74d7b5){var _0x4c0966=typeof _0xf1691b[_0xfb82('0x1a')]===_0xfb82('0x1b')&&typeof _0xf1691b[_0xfb82('0x1c')]===_0xfb82('0x1b');var _0x204d66=_0x74d7b5[_0xfb82('0x1d')];var _0x2e9d5b=_0x4c0966?0x0:_0xf1691b[_0xfb82('0x1a')];var _0x401e84=_0x4c0966?_0x74d7b5[_0xfb82('0x1d')]:_0xf1691b[_0xfb82('0x1a')]+_0xf1691b[_0xfb82('0x1c')];var _0x5ebe31;if(_0x401e84>=_0x204d66){_0x401e84=_0x204d66;_0x5ebe31=0xc8;}else{_0x5ebe31=0xce;}_0x139ec3[_0xfb82('0x17')](_0x5ebe31);return _0x139ec3[_0xfb82('0x1e')]('Content-Range',_0x2e9d5b+'-'+_0x401e84+'/'+_0x204d66)[_0xfb82('0x19')](_0x74d7b5);}return null;};}function patchUpdates(_0x4a43fa){return function(_0x4635cd){try{jsonpatch[_0xfb82('0x1f')](_0x4635cd,_0x4a43fa,!![]);}catch(_0x3871fc){return BPromise[_0xfb82('0x20')](_0x3871fc);}return _0x4635cd[_0xfb82('0x21')]();};}function saveUpdates(_0x2e0c06,_0x534290){return function(_0x50be94){if(_0x50be94){return _0x50be94[_0xfb82('0x22')](_0x2e0c06)[_0xfb82('0x23')](function(_0x2a978f){return _0x2a978f;});}return null;};}function removeEntity(_0x2cc8c7,_0x5d0176){return function(_0xdff790){if(_0xdff790){return _0xdff790[_0xfb82('0x24')]()[_0xfb82('0x23')](function(){var _0x413071=_0xdff790[_0xfb82('0x25')]({'plain':!![]});var _0x29ce9b='Pauses';return db[_0xfb82('0x26')]['destroy']({'where':{'type':_0x29ce9b,'resourceId':_0x413071['id']}})['then'](function(){return _0xdff790;});})[_0xfb82('0x23')](function(){_0x2cc8c7[_0xfb82('0x17')](0xcc)[_0xfb82('0x18')]();});}};}function handleEntityNotFound(_0x4bb5de,_0xe6cfae){return function(_0x10e410){if(!_0x10e410){_0x4bb5de[_0xfb82('0x16')](0x194);}return _0x10e410;};}function handleError(_0x3c9b55,_0x2ca1b6){_0x2ca1b6=_0x2ca1b6||0x1f4;return function(_0x3c8d52){logger[_0xfb82('0x27')](_0x3c8d52[_0xfb82('0x28')]);if(_0x3c8d52['name']){delete _0x3c8d52['name'];}_0x3c9b55[_0xfb82('0x17')](_0x2ca1b6)[_0xfb82('0x29')](_0x3c8d52);};}exports[_0xfb82('0x2a')]=function(_0x2a1cda,_0x14b1e7){var _0xafba34={},_0x10dc35={},_0x379c00={'count':0x0,'rows':[]};var _0x55a75b=_[_0xfb82('0x2b')](db[_0xfb82('0x2c')][_0xfb82('0x2d')],function(_0x295f62){return{'name':_0x295f62[_0xfb82('0x2e')],'type':_0x295f62[_0xfb82('0x2f')][_0xfb82('0x30')]};});_0x10dc35['model']=_[_0xfb82('0x2b')](_0x55a75b,_0xfb82('0x31'));_0x10dc35['query']=_[_0xfb82('0x32')](_0x2a1cda[_0xfb82('0x33')]);_0x10dc35[_0xfb82('0x34')]=_[_0xfb82('0x35')](_0x10dc35[_0xfb82('0x36')],_0x10dc35[_0xfb82('0x33')]);_0xafba34['attributes']=_[_0xfb82('0x35')](_0x10dc35[_0xfb82('0x36')],qs[_0xfb82('0x37')](_0x2a1cda[_0xfb82('0x33')][_0xfb82('0x37')]));_0xafba34[_0xfb82('0x38')]=_0xafba34[_0xfb82('0x38')]['length']?_0xafba34[_0xfb82('0x38')]:_0x10dc35[_0xfb82('0x36')];if(!_0x2a1cda[_0xfb82('0x33')]['hasOwnProperty'](_0xfb82('0x39'))){_0xafba34[_0xfb82('0x1c')]=qs[_0xfb82('0x1c')](_0x2a1cda['query']['limit']);_0xafba34[_0xfb82('0x1a')]=qs[_0xfb82('0x1a')](_0x2a1cda['query'][_0xfb82('0x1a')]);}_0xafba34[_0xfb82('0x3a')]=qs[_0xfb82('0x3b')](_0x2a1cda[_0xfb82('0x33')][_0xfb82('0x3b')]);_0xafba34['where']=qs[_0xfb82('0x34')](_[_0xfb82('0x3c')](_0x2a1cda[_0xfb82('0x33')],_0x10dc35['filters']),_0x55a75b);if(_0x2a1cda[_0xfb82('0x33')][_0xfb82('0x3d')]){_0xafba34[_0xfb82('0x3e')]=_['merge'](_0xafba34[_0xfb82('0x3e')],{'$or':_[_0xfb82('0x2b')](_0x55a75b,function(_0xbc2e71){if(_0xbc2e71['type']!=='VIRTUAL'){var _0xc015a8={};_0xc015a8[_0xbc2e71[_0xfb82('0x31')]]={'$like':'%'+_0x2a1cda[_0xfb82('0x33')][_0xfb82('0x3d')]+'%'};return _0xc015a8;}})});}_0xafba34=_[_0xfb82('0x3f')]({},_0xafba34,_0x2a1cda['options']);var _0x2436f7={'where':_0xafba34['where']};return db[_0xfb82('0x2c')]['count'](_0x2436f7)[_0xfb82('0x23')](function(_0x19d0aa){_0x379c00['count']=_0x19d0aa;if(_0x2a1cda['query'][_0xfb82('0x40')]){_0xafba34[_0xfb82('0x41')]=[{'all':!![]}];}return db[_0xfb82('0x2c')][_0xfb82('0x42')](_0xafba34);})[_0xfb82('0x23')](function(_0x306bd0){_0x379c00[_0xfb82('0x43')]=_0x306bd0;return _0x379c00;})[_0xfb82('0x23')](respondWithFilteredResult(_0x14b1e7,_0xafba34))[_0xfb82('0x44')](handleError(_0x14b1e7,null));};exports[_0xfb82('0x45')]=function(_0x5113c3,_0x8ece61){var _0x339635={'raw':!![],'where':{'id':_0x5113c3[_0xfb82('0x46')]['id']}},_0x5357cc={};_0x5357cc['model']=_[_0xfb82('0x32')](db[_0xfb82('0x2c')]['rawAttributes']);_0x5357cc[_0xfb82('0x33')]=_['keys'](_0x5113c3['query']);_0x5357cc[_0xfb82('0x34')]=_['intersection'](_0x5357cc[_0xfb82('0x36')],_0x5357cc[_0xfb82('0x33')]);_0x339635[_0xfb82('0x38')]=_[_0xfb82('0x35')](_0x5357cc['model'],qs[_0xfb82('0x37')](_0x5113c3[_0xfb82('0x33')]['fields']));_0x339635[_0xfb82('0x38')]=_0x339635[_0xfb82('0x38')][_0xfb82('0x47')]?_0x339635['attributes']:_0x5357cc[_0xfb82('0x36')];if(_0x5113c3[_0xfb82('0x33')][_0xfb82('0x40')]){_0x339635[_0xfb82('0x41')]=[{'all':!![]}];}_0x339635=_[_0xfb82('0x3f')]({},_0x339635,_0x5113c3[_0xfb82('0x48')]);return db[_0xfb82('0x2c')]['find'](_0x339635)['then'](handleEntityNotFound(_0x8ece61,null))[_0xfb82('0x23')](respondWithResult(_0x8ece61,null))['catch'](handleError(_0x8ece61,null));};exports[_0xfb82('0x49')]=function(_0x428054,_0x2e3a13){return db[_0xfb82('0x2c')][_0xfb82('0x49')](_0x428054[_0xfb82('0x4a')],{})[_0xfb82('0x23')](function(_0x21a4f3){var _0x1dc565=_0x428054[_0xfb82('0x4b')]['get']({'plain':!![]});if(!_0x1dc565)throw new Error(_0xfb82('0x4c'));if(_0x1dc565[_0xfb82('0x4d')]===_0xfb82('0x4b')){var _0x37fb61=_0x21a4f3[_0xfb82('0x25')]({'plain':!![]});var _0x1d2353=_0xfb82('0x4e');return db[_0xfb82('0x4f')][_0xfb82('0x50')]({'where':{'name':_0x1d2353,'userProfileId':_0x1dc565[_0xfb82('0x51')]},'raw':!![]})[_0xfb82('0x23')](function(_0x1ae6ae){if(_0x1ae6ae&&_0x1ae6ae['autoAssociation']===0x0){return db['UserProfileResource'][_0xfb82('0x49')]({'name':_0x37fb61[_0xfb82('0x31')],'resourceId':_0x37fb61['id'],'type':_0x1ae6ae['name'],'sectionId':_0x1ae6ae['id']},{})[_0xfb82('0x23')](function(){return _0x21a4f3;});}else{return _0x21a4f3;}})[_0xfb82('0x44')](function(_0x3ca6c3){logger[_0xfb82('0x27')](_0xfb82('0x52'),_0x3ca6c3);throw _0x3ca6c3;});}return _0x21a4f3;})[_0xfb82('0x23')](respondWithResult(_0x2e3a13,0xc9))[_0xfb82('0x44')](handleError(_0x2e3a13,null));};exports[_0xfb82('0x22')]=function(_0x3d36fd,_0x1e0780){if(_0x3d36fd[_0xfb82('0x4a')]['id']){delete _0x3d36fd[_0xfb82('0x4a')]['id'];}return db[_0xfb82('0x2c')][_0xfb82('0x50')]({'where':{'id':_0x3d36fd[_0xfb82('0x46')]['id']}})[_0xfb82('0x23')](handleEntityNotFound(_0x1e0780,null))['then'](saveUpdates(_0x3d36fd[_0xfb82('0x4a')],null))[_0xfb82('0x23')](respondWithResult(_0x1e0780,null))['catch'](handleError(_0x1e0780,null));};exports['destroy']=function(_0x3165e5,_0x5ec101){return db[_0xfb82('0x2c')]['find']({'where':{'id':_0x3165e5['params']['id']}})[_0xfb82('0x23')](handleEntityNotFound(_0x5ec101,null))[_0xfb82('0x23')](removeEntity(_0x5ec101,null))['catch'](handleError(_0x5ec101,null));}; \ No newline at end of file +var _0x1960=['catch','show','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','reject','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','merge','options','Pause','includeAll','findAll','rows'];(function(_0x10acd9,_0xb8ffb1){var _0x5b6f92=function(_0x528393){while(--_0x528393){_0x10acd9['push'](_0x10acd9['shift']());}};_0x5b6f92(++_0xb8ffb1);}(_0x1960,0x1ac));var _0x0196=function(_0x12fdda,_0x349e00){_0x12fdda=_0x12fdda-0x0;var _0x429023=_0x1960[_0x12fdda];return _0x429023;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0196('0x0'));var zipdir=require(_0x0196('0x1'));var jsonpatch=require(_0x0196('0x2'));var rp=require(_0x0196('0x3'));var moment=require('moment');var BPromise=require(_0x0196('0x4'));var Mustache=require(_0x0196('0x5'));var util=require(_0x0196('0x6'));var path=require(_0x0196('0x7'));var sox=require('sox');var csv=require(_0x0196('0x8'));var ejs=require(_0x0196('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0196('0xa'));var squel=require(_0x0196('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0196('0x8'));var querystring=require(_0x0196('0xc'));var Papa=require(_0x0196('0xd'));var Redis=require('ioredis');var authService=require(_0x0196('0xe'));var qs=require(_0x0196('0xf'));var as=require(_0x0196('0x10'));var hardwareService=require(_0x0196('0x11'));var logger=require(_0x0196('0x12'))(_0x0196('0x13'));var utils=require(_0x0196('0x14'));var config=require(_0x0196('0x15'));var licenseUtil=require(_0x0196('0x16'));var db=require(_0x0196('0x17'))['db'];function respondWithStatusCode(_0x5c2877,_0x1cbbe3){_0x1cbbe3=_0x1cbbe3||0xcc;return function(_0x2c2a56){if(_0x2c2a56){return _0x5c2877[_0x0196('0x18')](_0x1cbbe3);}return _0x5c2877[_0x0196('0x19')](_0x1cbbe3)[_0x0196('0x1a')]();};}function respondWithResult(_0x1b8f1b,_0xe4b78f){_0xe4b78f=_0xe4b78f||0xc8;return function(_0x2db071){if(_0x2db071){return _0x1b8f1b[_0x0196('0x19')](_0xe4b78f)[_0x0196('0x1b')](_0x2db071);}};}function respondWithFilteredResult(_0x49c37e,_0x59c1cc){return function(_0x15945a){if(_0x15945a){var _0xff5c9f=typeof _0x59c1cc['offset']==='undefined'&&typeof _0x59c1cc[_0x0196('0x1c')]===_0x0196('0x1d');var _0x1566eb=_0x15945a[_0x0196('0x1e')];var _0x7ba70=_0xff5c9f?0x0:_0x59c1cc['offset'];var _0x4ddd7c=_0xff5c9f?_0x15945a['count']:_0x59c1cc['offset']+_0x59c1cc[_0x0196('0x1c')];var _0xe9d326;if(_0x4ddd7c>=_0x1566eb){_0x4ddd7c=_0x1566eb;_0xe9d326=0xc8;}else{_0xe9d326=0xce;}_0x49c37e[_0x0196('0x19')](_0xe9d326);return _0x49c37e[_0x0196('0x1f')]('Content-Range',_0x7ba70+'-'+_0x4ddd7c+'/'+_0x1566eb)[_0x0196('0x1b')](_0x15945a);}return null;};}function patchUpdates(_0x21cfc2){return function(_0x40924f){try{jsonpatch['apply'](_0x40924f,_0x21cfc2,!![]);}catch(_0x2ca989){return BPromise[_0x0196('0x20')](_0x2ca989);}return _0x40924f[_0x0196('0x21')]();};}function saveUpdates(_0x72158b,_0x30e1a3){return function(_0x534688){if(_0x534688){return _0x534688[_0x0196('0x22')](_0x72158b)[_0x0196('0x23')](function(_0x521d4d){return _0x521d4d;});}return null;};}function removeEntity(_0x22d4b0,_0x79e0a0){return function(_0x3ae949){if(_0x3ae949){return _0x3ae949[_0x0196('0x24')]()['then'](function(){var _0x3335e7=_0x3ae949[_0x0196('0x25')]({'plain':!![]});var _0x1985a4=_0x0196('0x26');return db[_0x0196('0x27')]['destroy']({'where':{'type':_0x1985a4,'resourceId':_0x3335e7['id']}})['then'](function(){return _0x3ae949;});})[_0x0196('0x23')](function(){_0x22d4b0[_0x0196('0x19')](0xcc)[_0x0196('0x1a')]();});}};}function handleEntityNotFound(_0x516678,_0x138e23){return function(_0xf3fcc8){if(!_0xf3fcc8){_0x516678['sendStatus'](0x194);}return _0xf3fcc8;};}function handleError(_0x280d50,_0x142b45){_0x142b45=_0x142b45||0x1f4;return function(_0x1fdd64){logger[_0x0196('0x28')](_0x1fdd64[_0x0196('0x29')]);if(_0x1fdd64[_0x0196('0x2a')]){delete _0x1fdd64[_0x0196('0x2a')];}_0x280d50['status'](_0x142b45)[_0x0196('0x2b')](_0x1fdd64);};}exports[_0x0196('0x2c')]=function(_0x2dae68,_0x59fc2a){var _0x454b1d={},_0x2a4a17={},_0x5a53b0={'count':0x0,'rows':[]};var _0x31dbee=_[_0x0196('0x2d')](db['Pause'][_0x0196('0x2e')],function(_0x235e7f){return{'name':_0x235e7f[_0x0196('0x2f')],'type':_0x235e7f[_0x0196('0x30')][_0x0196('0x31')]};});_0x2a4a17[_0x0196('0x32')]=_[_0x0196('0x2d')](_0x31dbee,_0x0196('0x2a'));_0x2a4a17[_0x0196('0x33')]=_[_0x0196('0x34')](_0x2dae68[_0x0196('0x33')]);_0x2a4a17[_0x0196('0x35')]=_['intersection'](_0x2a4a17[_0x0196('0x32')],_0x2a4a17['query']);_0x454b1d[_0x0196('0x36')]=_[_0x0196('0x37')](_0x2a4a17[_0x0196('0x32')],qs[_0x0196('0x38')](_0x2dae68[_0x0196('0x33')][_0x0196('0x38')]));_0x454b1d[_0x0196('0x36')]=_0x454b1d[_0x0196('0x36')][_0x0196('0x39')]?_0x454b1d[_0x0196('0x36')]:_0x2a4a17['model'];if(!_0x2dae68[_0x0196('0x33')][_0x0196('0x3a')]('nolimit')){_0x454b1d[_0x0196('0x1c')]=qs[_0x0196('0x1c')](_0x2dae68[_0x0196('0x33')][_0x0196('0x1c')]);_0x454b1d['offset']=qs['offset'](_0x2dae68[_0x0196('0x33')]['offset']);}_0x454b1d['order']=qs[_0x0196('0x3b')](_0x2dae68[_0x0196('0x33')][_0x0196('0x3b')]);_0x454b1d['where']=qs['filters'](_[_0x0196('0x3c')](_0x2dae68[_0x0196('0x33')],_0x2a4a17['filters']),_0x31dbee);if(_0x2dae68['query'][_0x0196('0x3d')]){_0x454b1d[_0x0196('0x3e')]=_['merge'](_0x454b1d[_0x0196('0x3e')],{'$or':_[_0x0196('0x2d')](_0x31dbee,function(_0x4c73dd){if(_0x4c73dd['type']!==_0x0196('0x3f')){var _0x1cfc3c={};_0x1cfc3c[_0x4c73dd[_0x0196('0x2a')]]={'$like':'%'+_0x2dae68[_0x0196('0x33')]['filter']+'%'};return _0x1cfc3c;}})});}_0x454b1d=_[_0x0196('0x40')]({},_0x454b1d,_0x2dae68[_0x0196('0x41')]);var _0x25b4bb={'where':_0x454b1d['where']};return db[_0x0196('0x42')][_0x0196('0x1e')](_0x25b4bb)[_0x0196('0x23')](function(_0x2b500d){_0x5a53b0[_0x0196('0x1e')]=_0x2b500d;if(_0x2dae68[_0x0196('0x33')][_0x0196('0x43')]){_0x454b1d['include']=[{'all':!![]}];}return db['Pause'][_0x0196('0x44')](_0x454b1d);})['then'](function(_0x231d90){_0x5a53b0[_0x0196('0x45')]=_0x231d90;return _0x5a53b0;})[_0x0196('0x23')](respondWithFilteredResult(_0x59fc2a,_0x454b1d))[_0x0196('0x46')](handleError(_0x59fc2a,null));};exports[_0x0196('0x47')]=function(_0x12d51f,_0x50113a){var _0x42b9d1={'raw':!![],'where':{'id':_0x12d51f[_0x0196('0x48')]['id']}},_0x466808={};_0x466808[_0x0196('0x32')]=_[_0x0196('0x34')](db[_0x0196('0x42')][_0x0196('0x2e')]);_0x466808[_0x0196('0x33')]=_['keys'](_0x12d51f['query']);_0x466808['filters']=_['intersection'](_0x466808[_0x0196('0x32')],_0x466808[_0x0196('0x33')]);_0x42b9d1[_0x0196('0x36')]=_['intersection'](_0x466808[_0x0196('0x32')],qs['fields'](_0x12d51f[_0x0196('0x33')]['fields']));_0x42b9d1[_0x0196('0x36')]=_0x42b9d1['attributes'][_0x0196('0x39')]?_0x42b9d1[_0x0196('0x36')]:_0x466808['model'];if(_0x12d51f[_0x0196('0x33')]['includeAll']){_0x42b9d1[_0x0196('0x49')]=[{'all':!![]}];}_0x42b9d1=_[_0x0196('0x40')]({},_0x42b9d1,_0x12d51f[_0x0196('0x41')]);return db[_0x0196('0x42')][_0x0196('0x4a')](_0x42b9d1)[_0x0196('0x23')](handleEntityNotFound(_0x50113a,null))['then'](respondWithResult(_0x50113a,null))[_0x0196('0x46')](handleError(_0x50113a,null));};exports[_0x0196('0x4b')]=function(_0x3f8f17,_0x3d3e68){return db['Pause'][_0x0196('0x4b')](_0x3f8f17['body'],{})[_0x0196('0x23')](function(_0x137013){var _0x4031ef=_0x3f8f17[_0x0196('0x4c')]['get']({'plain':!![]});if(!_0x4031ef)throw new Error(_0x0196('0x4d'));if(_0x4031ef[_0x0196('0x4e')]===_0x0196('0x4c')){var _0x4d3ac6=_0x137013[_0x0196('0x25')]({'plain':!![]});var _0x139753=_0x0196('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x139753,'userProfileId':_0x4031ef[_0x0196('0x4f')]},'raw':!![]})[_0x0196('0x23')](function(_0x2ff21e){if(_0x2ff21e&&_0x2ff21e[_0x0196('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x4d3ac6[_0x0196('0x2a')],'resourceId':_0x4d3ac6['id'],'type':_0x2ff21e[_0x0196('0x2a')],'sectionId':_0x2ff21e['id']},{})['then'](function(){return _0x137013;});}else{return _0x137013;}})['catch'](function(_0x2eeadd){logger[_0x0196('0x28')](_0x0196('0x51'),_0x2eeadd);throw _0x2eeadd;});}return _0x137013;})[_0x0196('0x23')](respondWithResult(_0x3d3e68,0xc9))[_0x0196('0x46')](handleError(_0x3d3e68,null));};exports[_0x0196('0x22')]=function(_0x367487,_0x4568c1){if(_0x367487[_0x0196('0x52')]['id']){delete _0x367487[_0x0196('0x52')]['id'];}return db[_0x0196('0x42')][_0x0196('0x4a')]({'where':{'id':_0x367487[_0x0196('0x48')]['id']}})[_0x0196('0x23')](handleEntityNotFound(_0x4568c1,null))[_0x0196('0x23')](saveUpdates(_0x367487[_0x0196('0x52')],null))[_0x0196('0x23')](respondWithResult(_0x4568c1,null))[_0x0196('0x46')](handleError(_0x4568c1,null));};exports['destroy']=function(_0x9df453,_0x22abde){return db['Pause']['find']({'where':{'id':_0x9df453[_0x0196('0x48')]['id']}})[_0x0196('0x23')](handleEntityNotFound(_0x22abde,null))[_0x0196('0x23')](removeEntity(_0x22abde,null))['catch'](handleError(_0x22abde,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 66e42dd..941acb5 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 _0xe14b=['bluebird','path','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','moment'];(function(_0x107f1a,_0x2cabc3){var _0x3c95cd=function(_0x275325){while(--_0x275325){_0x107f1a['push'](_0x107f1a['shift']());}};_0x3c95cd(++_0x2cabc3);}(_0xe14b,0x93));var _0xbe14=function(_0xc3eee4,_0x346dca){_0xc3eee4=_0xc3eee4-0x0;var _0x4b66f3=_0xe14b[_0xc3eee4];return _0x4b66f3;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x5b2d55,_0x401971){var _0x20b9e2=function(_0xe4b0c6){while(--_0xe4b0c6){_0x5b2d55['push'](_0x5b2d55['shift']());}};_0x20b9e2(++_0x401971);}(_0xabce,0x103));var _0xeabc=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xabce[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 67704cf..46fad45 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(_0x4c5940,_0x14c52c){var _0x4fa686=function(_0x49057b){while(--_0x49057b){_0x4c5940['push'](_0x4c5940['shift']());}};_0x4fa686(++_0x14c52c);}(_0x7a54,0x106));var _0x47a5=function(_0xb8d805,_0x512722){_0xb8d805=_0xb8d805-0x0;var _0x200bcb=_0x7a54[_0xb8d805];return _0x200bcb;};'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(_0x4d5fb8,_0x2a9bc9){var _0x3fd4d9=function(_0x36d753){while(--_0x36d753){_0x4d5fb8['push'](_0x4d5fb8['shift']());}};_0x3fd4d9(++_0x2a9bc9);}(_0xb10b,0x12a));var _0xbb10=function(_0xe775be,_0x4822af){_0xe775be=_0xe775be-0x0;var _0x49e73c=_0xb10b[_0xe775be];return _0x49e73c;};'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 14fe23f..8cb5c7a 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 _0x1cc7=['path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/webhook','webhookGet','/:id','show','/:id/download','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util'];(function(_0x4f7a97,_0x14f986){var _0x2d97cb=function(_0x4323b6){while(--_0x4323b6){_0x4f7a97['push'](_0x4f7a97['shift']());}};_0x2d97cb(++_0x14f986);}(_0x1cc7,0x15a));var _0x71cc=function(_0x16c13d,_0x3a78de){_0x16c13d=_0x16c13d-0x0;var _0x45b42a=_0x1cc7[_0x16c13d];return _0x45b42a;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./plugin.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')](_0x71cc('0xa'),auth['isAuthenticated'](),controller[_0x71cc('0xb')]);router[_0x71cc('0x7')](_0x71cc('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4b7514,_0xeb4747,_0x2db190){_0x2db190(null,path[_0x71cc('0xd')](config['root'],_0x71cc('0xe')));},'filename':function(_0x550b3c,_0x1aad83,_0x4f9c5c){_0x1aad83[_0x71cc('0xf')]=_0x1aad83['originalname'][_0x71cc('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4f9c5c(null,util[_0x71cc('0x11')](_0x71cc('0x12'),path[_0x71cc('0x13')](_0x1aad83[_0x71cc('0xf')],path['extname'](_0x1aad83[_0x71cc('0xf')])),Date[_0x71cc('0x14')](),path[_0x71cc('0x15')](_0x1aad83[_0x71cc('0xf')])));}})});router[_0x71cc('0x16')]('/',upload[_0x71cc('0x17')](_0x71cc('0x18')),controller['upload']);router[_0x71cc('0x16')](_0x71cc('0x8'),controller[_0x71cc('0x19')]);router[_0x71cc('0x1a')](_0x71cc('0xa'),auth[_0x71cc('0x6')](),controller['update']);router[_0x71cc('0x1b')](_0x71cc('0xa'),auth['isAuthenticated'](),controller['delete']);module[_0x71cc('0x1c')]=router; \ No newline at end of file +var _0x4c4e=['webhookGet','/:id','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','basename','now','extname','post','single','file','upload','webhookPost','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','index','get','/webhook'];(function(_0x589fee,_0x358efb){var _0x2f8f27=function(_0x4ffa07){while(--_0x4ffa07){_0x589fee['push'](_0x589fee['shift']());}};_0x2f8f27(++_0x358efb);}(_0x4c4e,0x152));var _0xe4c4=function(_0x51e3b7,_0x27e92c){_0x51e3b7=_0x51e3b7-0x0;var _0x2076f7=_0x4c4e[_0x51e3b7];return _0x2076f7;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller['show']);router['get'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);var upload=multer({'storage':multer[_0xe4c4('0x10')]({'destination':function(_0x333c08,_0x2f4d5f,_0x50264f){_0x50264f(null,path[_0xe4c4('0x11')](config[_0xe4c4('0x12')],_0xe4c4('0x13')));},'filename':function(_0x2483d0,_0x50bfab,_0x262083){_0x50bfab[_0xe4c4('0x14')]=_0x50bfab['originalname'][_0xe4c4('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x262083(null,util[_0xe4c4('0x16')]('%s-%s%s',path[_0xe4c4('0x17')](_0x50bfab[_0xe4c4('0x14')],path['extname'](_0x50bfab[_0xe4c4('0x14')])),Date[_0xe4c4('0x18')](),path[_0xe4c4('0x19')](_0x50bfab[_0xe4c4('0x14')])));}})});router[_0xe4c4('0x1a')]('/',upload[_0xe4c4('0x1b')](_0xe4c4('0x1c')),controller[_0xe4c4('0x1d')]);router[_0xe4c4('0x1a')](_0xe4c4('0xb'),controller[_0xe4c4('0x1e')]);router[_0xe4c4('0x1f')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x20')]);router['delete'](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x21')]);module[_0xe4c4('0x22')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 1044005..0794a58 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 _0xdad2=['STRING','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','sequelize','exports'];(function(_0x38b353,_0xb6f8bb){var _0x484905=function(_0x595bd7){while(--_0x595bd7){_0x38b353['push'](_0x38b353['shift']());}};_0x484905(++_0xb6f8bb);}(_0xdad2,0x1d7));var _0x2dad=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xdad2[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x2dad('0x0'));module[_0x2dad('0x1')]={'name':{'type':Sequelize[_0x2dad('0x2')]},'type':{'type':Sequelize['ENUM'](_0x2dad('0x3'),'script')},'description':{'type':Sequelize[_0x2dad('0x4')]},'version':{'type':Sequelize[_0x2dad('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x2dad('0x5')},'active':{'type':Sequelize[_0x2dad('0x6')],'defaultValue':0x0,'comment':_0x2dad('0x7')},'sidebar':{'type':Sequelize['ENUM']('adminOnly',_0x2dad('0x8'),_0x2dad('0x9'),_0x2dad('0xa')),'defaultValue':_0x2dad('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x2dad('0x2')]},'adminUrl':{'type':Sequelize[_0x2dad('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x2dad('0x2')]},'scriptPath':{'type':Sequelize[_0x2dad('0x2')]}}; \ No newline at end of file +var _0x42b2=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly','always','never'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x42b2,0x9d));var _0x242b=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x42b2[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0x242b('0x0'));module[_0x242b('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x242b('0x2')](_0x242b('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x242b('0x4')]},'path':{'type':Sequelize[_0x242b('0x5')],'comment':_0x242b('0x6')},'active':{'type':Sequelize[_0x242b('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x242b('0x2')]('adminOnly',_0x242b('0x8'),_0x242b('0x9'),_0x242b('0xa')),'defaultValue':_0x242b('0x9'),'comment':_0x242b('0xb')},'icon':{'type':Sequelize[_0x242b('0x5')]},'adminUrl':{'type':Sequelize[_0x242b('0x5')]},'agentUrl':{'type':Sequelize[_0x242b('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x242b('0x5')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index cc4f9f5..5f21f30 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 _0x5b4f=['parameters','Invalid\x20manifest:\x20parameters\x20missing','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','method','%s%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','join','server/files/plugins','format','%s.zip','basename','zip','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','Plugin\x20not\x20found','download','unlinkSync','info','Download\x20completed','upload','file','filename','extname','root','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified'];(function(_0x6a8704,_0x1a6ea6){var _0xac8070=function(_0x4e66c6){while(--_0x4e66c6){_0x6a8704['push'](_0x6a8704['shift']());}};_0xac8070(++_0x1a6ea6);}(_0x5b4f,0x195));var _0xf5b4=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5b4f[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xf5b4('0x0'));var rimraf=require(_0xf5b4('0x1'));var zipdir=require(_0xf5b4('0x2'));var jsonpatch=require(_0xf5b4('0x3'));var rp=require('request-promise');var moment=require(_0xf5b4('0x4'));var BPromise=require(_0xf5b4('0x5'));var Mustache=require(_0xf5b4('0x6'));var util=require(_0xf5b4('0x7'));var path=require(_0xf5b4('0x8'));var sox=require('sox');var csv=require(_0xf5b4('0x9'));var ejs=require(_0xf5b4('0xa'));var fs=require('fs');var fs_extra=require(_0xf5b4('0xb'));var _=require(_0xf5b4('0xc'));var squel=require('squel');var crypto=require(_0xf5b4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf5b4('0xe'));var toCsv=require(_0xf5b4('0x9'));var querystring=require(_0xf5b4('0xf'));var Papa=require(_0xf5b4('0x10'));var extract=require(_0xf5b4('0x11'));var rimraf=require(_0xf5b4('0x1'));var archiver=require(_0xf5b4('0x12'));var Redis=require(_0xf5b4('0x13'));var authService=require(_0xf5b4('0x14'));var qs=require(_0xf5b4('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5b4('0x16'))(_0xf5b4('0x17'));var utils=require(_0xf5b4('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf5b4('0x19'));var db=require(_0xf5b4('0x1a'))['db'];config[_0xf5b4('0x1b')]=_[_0xf5b4('0x1c')](config[_0xf5b4('0x1b')],{'host':_0xf5b4('0x1d'),'port':0x18eb});var socket=require(_0xf5b4('0x1e'))(new Redis(config[_0xf5b4('0x1b')]));require(_0xf5b4('0x1f'))[_0xf5b4('0x20')](socket);function respondWithStatusCode(_0x130a19,_0x56e92d){_0x56e92d=_0x56e92d||0xcc;return function(_0x7e86ce){if(_0x7e86ce){return _0x130a19[_0xf5b4('0x21')](_0x56e92d);}return _0x130a19[_0xf5b4('0x22')](_0x56e92d)[_0xf5b4('0x23')]();};}function respondWithResult(_0xd05987,_0xd1b214){_0xd1b214=_0xd1b214||0xc8;return function(_0x484f5e){if(_0x484f5e){return _0xd05987[_0xf5b4('0x22')](_0xd1b214)[_0xf5b4('0x24')](_0x484f5e);}};}function respondWithFilteredResult(_0x52f852,_0x43b1e4){return function(_0x215c4e){if(_0x215c4e){var _0x1f6b20=typeof _0x43b1e4['offset']===_0xf5b4('0x25')&&typeof _0x43b1e4['limit']==='undefined';var _0x3f4df2=_0x215c4e[_0xf5b4('0x26')];var _0x1a39cd=_0x1f6b20?0x0:_0x43b1e4[_0xf5b4('0x27')];var _0x1b5560=_0x1f6b20?_0x215c4e['count']:_0x43b1e4['offset']+_0x43b1e4[_0xf5b4('0x28')];var _0x275ce5;if(_0x1b5560>=_0x3f4df2){_0x1b5560=_0x3f4df2;_0x275ce5=0xc8;}else{_0x275ce5=0xce;}_0x52f852['status'](_0x275ce5);return _0x52f852['set'](_0xf5b4('0x29'),_0x1a39cd+'-'+_0x1b5560+'/'+_0x3f4df2)[_0xf5b4('0x24')](_0x215c4e);}return null;};}function patchUpdates(_0x4d1454){return function(_0x50a4db){try{jsonpatch[_0xf5b4('0x2a')](_0x50a4db,_0x4d1454,!![]);}catch(_0x354113){return BPromise[_0xf5b4('0x2b')](_0x354113);}return _0x50a4db[_0xf5b4('0x2c')]();};}function saveUpdates(_0x3e179b,_0x5603aa){return function(_0x442e76){if(_0x442e76){return _0x442e76[_0xf5b4('0x2d')](_0x3e179b)['then'](function(_0x5e0355){return _0x5e0355;});}return null;};}function removeEntity(_0x4ad762,_0x1f33f0){return function(_0x3c79a0){if(_0x3c79a0){return _0x3c79a0[_0xf5b4('0x2e')]()[_0xf5b4('0x2f')](function(){var _0x591dc1=_0x3c79a0[_0xf5b4('0x30')]({'plain':!![]});var _0x21870d=_0xf5b4('0x31');return db[_0xf5b4('0x32')][_0xf5b4('0x2e')]({'where':{'type':_0x21870d,'resourceId':_0x591dc1['id']}})[_0xf5b4('0x2f')](function(){return _0x3c79a0;});})[_0xf5b4('0x2f')](function(){_0x4ad762[_0xf5b4('0x22')](0xcc)[_0xf5b4('0x23')]();});}};}function handleEntityNotFound(_0x596d75,_0x5c8ee7){return function(_0x157b5c){if(!_0x157b5c){_0x596d75[_0xf5b4('0x21')](0x194);}return _0x157b5c;};}function handleError(_0x13e254,_0x11b532){_0x11b532=_0x11b532||0x1f4;return function(_0xde5052){logger[_0xf5b4('0x33')](_0xde5052[_0xf5b4('0x34')]);if(_0xde5052[_0xf5b4('0x35')]){delete _0xde5052['name'];}_0x13e254[_0xf5b4('0x22')](_0x11b532)[_0xf5b4('0x36')](_0xde5052);};}exports[_0xf5b4('0x37')]=function(_0x880520,_0x339ed7){var _0x27ccdf={},_0x4a5095={},_0x2341f8={'count':0x0,'rows':[]};var _0x58a68f=_[_0xf5b4('0x38')](db[_0xf5b4('0x39')][_0xf5b4('0x3a')],function(_0xddcf59){return{'name':_0xddcf59[_0xf5b4('0x3b')],'type':_0xddcf59[_0xf5b4('0x3c')]['key']};});_0x4a5095[_0xf5b4('0x3d')]=_[_0xf5b4('0x38')](_0x58a68f,_0xf5b4('0x35'));_0x4a5095[_0xf5b4('0x3e')]=_[_0xf5b4('0x3f')](_0x880520['query']);_0x4a5095['filters']=_[_0xf5b4('0x40')](_0x4a5095[_0xf5b4('0x3d')],_0x4a5095[_0xf5b4('0x3e')]);_0x27ccdf['attributes']=_[_0xf5b4('0x40')](_0x4a5095[_0xf5b4('0x3d')],qs[_0xf5b4('0x41')](_0x880520['query'][_0xf5b4('0x41')]));_0x27ccdf['attributes']=_0x27ccdf[_0xf5b4('0x42')][_0xf5b4('0x43')]?_0x27ccdf[_0xf5b4('0x42')]:_0x4a5095[_0xf5b4('0x3d')];if(!_0x880520[_0xf5b4('0x3e')][_0xf5b4('0x44')](_0xf5b4('0x45'))){_0x27ccdf[_0xf5b4('0x28')]=qs[_0xf5b4('0x28')](_0x880520[_0xf5b4('0x3e')][_0xf5b4('0x28')]);_0x27ccdf[_0xf5b4('0x27')]=qs['offset'](_0x880520['query'][_0xf5b4('0x27')]);}_0x27ccdf[_0xf5b4('0x46')]=qs[_0xf5b4('0x47')](_0x880520[_0xf5b4('0x3e')]['sort']);_0x27ccdf[_0xf5b4('0x48')]=qs[_0xf5b4('0x49')](_['pick'](_0x880520['query'],_0x4a5095[_0xf5b4('0x49')]),_0x58a68f);if(_0x880520['query'][_0xf5b4('0x4a')]){_0x27ccdf['where']=_[_0xf5b4('0x4b')](_0x27ccdf[_0xf5b4('0x48')],{'$or':_[_0xf5b4('0x38')](_0x58a68f,function(_0x229e78){if(_0x229e78[_0xf5b4('0x3c')]!==_0xf5b4('0x4c')){var _0x1919e6={};_0x1919e6[_0x229e78[_0xf5b4('0x35')]]={'$like':'%'+_0x880520[_0xf5b4('0x3e')]['filter']+'%'};return _0x1919e6;}})});}_0x27ccdf=_['merge']({},_0x27ccdf,_0x880520['options']);var _0xa2f401={'where':_0x27ccdf[_0xf5b4('0x48')]};return db['Plugin'][_0xf5b4('0x26')](_0xa2f401)[_0xf5b4('0x2f')](function(_0x3eb333){_0x2341f8[_0xf5b4('0x26')]=_0x3eb333;if(_0x880520['query'][_0xf5b4('0x4d')]){_0x27ccdf[_0xf5b4('0x4e')]=[{'all':!![]}];}return db[_0xf5b4('0x39')][_0xf5b4('0x4f')](_0x27ccdf);})['then'](function(_0x9393f9){_0x2341f8[_0xf5b4('0x50')]=_0x9393f9;return _0x2341f8;})[_0xf5b4('0x2f')](respondWithFilteredResult(_0x339ed7,_0x27ccdf))['catch'](handleError(_0x339ed7,null));};exports[_0xf5b4('0x51')]=function(_0x16c4b8,_0x1deeb7){var _0x23e344={'raw':!![],'where':{'id':_0x16c4b8[_0xf5b4('0x52')]['id']}},_0x31dc92={};_0x31dc92[_0xf5b4('0x3d')]=_['keys'](db['Plugin'][_0xf5b4('0x3a')]);_0x31dc92[_0xf5b4('0x3e')]=_[_0xf5b4('0x3f')](_0x16c4b8[_0xf5b4('0x3e')]);_0x31dc92['filters']=_[_0xf5b4('0x40')](_0x31dc92[_0xf5b4('0x3d')],_0x31dc92['query']);_0x23e344['attributes']=_[_0xf5b4('0x40')](_0x31dc92[_0xf5b4('0x3d')],qs[_0xf5b4('0x41')](_0x16c4b8['query'][_0xf5b4('0x41')]));_0x23e344[_0xf5b4('0x42')]=_0x23e344['attributes']['length']?_0x23e344[_0xf5b4('0x42')]:_0x31dc92[_0xf5b4('0x3d')];if(_0x16c4b8[_0xf5b4('0x3e')][_0xf5b4('0x4d')]){_0x23e344['include']=[{'all':!![]}];}_0x23e344=_[_0xf5b4('0x4b')]({},_0x23e344,_0x16c4b8[_0xf5b4('0x53')]);return db[_0xf5b4('0x39')][_0xf5b4('0x54')](_0x23e344)[_0xf5b4('0x2f')](handleEntityNotFound(_0x1deeb7,null))[_0xf5b4('0x2f')](respondWithResult(_0x1deeb7,null))[_0xf5b4('0x55')](handleError(_0x1deeb7,null));};exports['download']=function(_0x25fd93,_0x1dd940,_0x40270e){return db[_0xf5b4('0x39')]['find']({'where':{'id':_0x25fd93[_0xf5b4('0x52')]['id']},'attributes':['name',_0xf5b4('0x8')],'raw':!![]})[_0xf5b4('0x2f')](handleEntityNotFound(_0x1dd940,null))[_0xf5b4('0x2f')](function(_0x39b07c){if(_0x39b07c){var _0x4aae30=path[_0xf5b4('0x56')](config['root'],_0xf5b4('0x57'),util[_0xf5b4('0x58')](_0xf5b4('0x59'),path[_0xf5b4('0x5a')](_0x39b07c[_0xf5b4('0x8')])));var _0x4a39b8=fs['createWriteStream'](_0x4aae30);var _0x38bc83=archiver(_0xf5b4('0x5b'),{'zlib':{'level':0x9}});_0x38bc83['on']('warning',function(_0x52fc34){if(_0x52fc34[_0xf5b4('0x5c')]===_0xf5b4('0x5d')){logger['error'](_0x52fc34);}else{throw new db[(_0xf5b4('0x5e'))][(_0xf5b4('0x5f'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x38bc83['on'](_0xf5b4('0x33'),function(_0x4f2d9c){throw new db['Sequelize'][(_0xf5b4('0x5f'))](_0xf5b4('0x60'));});_0x38bc83['pipe'](_0x4a39b8);_0x38bc83[_0xf5b4('0x61')](_0xf5b4('0x62'),{'cwd':path['join'](config['root'],_0xf5b4('0x57'),path[_0xf5b4('0x63')](_0x39b07c[_0xf5b4('0x8')])),'ignore':[path[_0xf5b4('0x56')](path['basename'](_0x39b07c[_0xf5b4('0x8')]),_0xf5b4('0x64')),path[_0xf5b4('0x56')](path[_0xf5b4('0x5a')](_0x39b07c[_0xf5b4('0x8')]),_0xf5b4('0x65'))],'nodir':!![]})[_0xf5b4('0x66')]();_0x4a39b8['on'](_0xf5b4('0x67'),function(){if(!fs['existsSync'](_0x4aae30)){throw new db['Sequelize'][(_0xf5b4('0x5f'))](_0xf5b4('0x68'));}return _0x1dd940[_0xf5b4('0x69')](_0x4aae30,util[_0xf5b4('0x58')]('%s.zip',path[_0xf5b4('0x5a')](_0x39b07c[_0xf5b4('0x8')])),function(_0x54db47){if(_0x54db47){throw new db['Sequelize'][(_0xf5b4('0x5f'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xf5b4('0x6a')](_0x4aae30);logger[_0xf5b4('0x6b')](_0xf5b4('0x6c'));logger['info']('Temporary\x20file\x20removed');});});}return null;})[_0xf5b4('0x55')](handleError(_0x1dd940,null));};exports[_0xf5b4('0x6d')]=function(_0x3a5787,_0x38034e,_0x4fdf65){var _0x140ea8=path[_0xf5b4('0x5a')](_0x3a5787[_0xf5b4('0x6e')][_0xf5b4('0x6f')],path[_0xf5b4('0x70')](_0x3a5787[_0xf5b4('0x6e')][_0xf5b4('0x6f')]));var _0x16220e=path[_0xf5b4('0x56')](config['root'],_0xf5b4('0x57'),_0x3a5787[_0xf5b4('0x6e')][_0xf5b4('0x6f')]);var _0x469d5b=path[_0xf5b4('0x56')](config[_0xf5b4('0x71')],_0xf5b4('0x57'),_0x140ea8);logger[_0xf5b4('0x6b')]('Plugin\x20upload\x20filepath:\x20%s',_0x16220e);logger[_0xf5b4('0x6b')](_0xf5b4('0x72'),_0x469d5b);try{fs['chmodSync'](_0x16220e,parseInt(_0xf5b4('0x73'),0x8));extract(_0x16220e,{'dir':_0x469d5b},function(_0x4a7862){if(_0x4a7862){logger[_0xf5b4('0x33')](_0x4a7862);handleError(_0x4a7862,!![]);};var _0x5bf47c=fs[_0xf5b4('0x74')](_0x469d5b);if(_0x5bf47c[_0xf5b4('0x43')]>0x1){removeReferences(_0x16220e,_0x469d5b);logger[_0xf5b4('0x33')]('Invalid\x20plugin\x20structure');return _0x4fdf65(new Error(_0xf5b4('0x75')));}var _0x48acb6=fs[_0xf5b4('0x76')](path['join'](_0x469d5b,_0x5bf47c[0x0]));if(_0x48acb6[_0xf5b4('0x77')]()){removeReferences(_0x16220e,_0x469d5b);logger['error'](_0xf5b4('0x75'));return _0x4fdf65(new Error(_0xf5b4('0x75')));}if(_0x48acb6[_0xf5b4('0x78')]()){var _0x555a6e=fs['readdirSync'](path[_0xf5b4('0x56')](_0x469d5b,_0x5bf47c[0x0]));if(_0x555a6e[_0xf5b4('0x43')]===0x0){removeReferences(_0x16220e,_0x469d5b);logger[_0xf5b4('0x33')](_0xf5b4('0x75'));return _0x4fdf65(new Error('Invalid\x20plugin\x20structure'));}var _0xba45d4=_0x555a6e[_0xf5b4('0x79')](function(_0x249f10){return _0x249f10==='manifest.json';});if(!_0xba45d4){return _0x4fdf65(new Error(_0xf5b4('0x7a')));}var _0x43d178=fs[_0xf5b4('0x7b')](path[_0xf5b4('0x56')](_0x469d5b,_0x5bf47c[0x0],'manifest.json'));var _0x4cf698=JSON[_0xf5b4('0x7c')](_0x43d178);if('undefined'==typeof _0x4cf698[_0xf5b4('0x35')]){return _0x4fdf65(new Error(_0xf5b4('0x7d')));}if(_0xf5b4('0x25')==typeof _0x4cf698['type']){return _0x4fdf65(new Error(_0xf5b4('0x7e')));}if(_0xf5b4('0x25')==typeof _0x4cf698[_0xf5b4('0x7f')]){return _0x4fdf65(new Error(_0xf5b4('0x80')));}if(_0xf5b4('0x25')==typeof _0x4cf698[_0xf5b4('0x81')]){return _0x4fdf65(new Error(_0xf5b4('0x82')));}if(_0x4cf698[_0xf5b4('0x3c')]===_0xf5b4('0x83')){if(_0xf5b4('0x25')==typeof _0x4cf698[_0xf5b4('0x81')]['views']){return _0x4fdf65(new Error(_0xf5b4('0x84')));}if(_0xf5b4('0x25')==typeof _0x4cf698['parameters'][_0xf5b4('0x85')][_0xf5b4('0x86')]&&_0xf5b4('0x25')==typeof _0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x85')][_0xf5b4('0x87')]){return _0x4fdf65(new Error(_0xf5b4('0x88')));}}else if(_0x4cf698['type']==='script'){if(_0xf5b4('0x25')==typeof _0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x89')]){return _0x4fdf65(new Error(_0xf5b4('0x8a')));}if(_0xf5b4('0x25')==typeof _0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x8b')]){return _0x4fdf65(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x4fdf65(new Error(_0xf5b4('0x8c')));}var _0x2d7135=_0x4cf698[_0xf5b4('0x35')];var _0x1fef34=_0x4cf698['description'];var _0x3ae74e=_0x4cf698[_0xf5b4('0x3c')];var _0x5b97b2=_0x4cf698['sidebar']?_0x4cf698[_0xf5b4('0x8d')]:_0xf5b4('0x8e');var _0xa5593a=_0x4cf698[_0xf5b4('0x8f')]?_0x4cf698[_0xf5b4('0x8f')]:_0xf5b4('0x90');var _0xde1441='';var _0x3faf93='';var _0x3cf038='';var _0x5a3779='';var _0x39283b=_0x4cf698[_0xf5b4('0x7f')];if(_0x3ae74e===_0xf5b4('0x83')){if(_0xf5b4('0x25')!=typeof _0x4cf698[_0xf5b4('0x81')]['views'][_0xf5b4('0x86')]){var _0x476ee6=_0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x85')][_0xf5b4('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xf5b4('0x91')](_0x476ee6)){_0xde1441=path[_0xf5b4('0x56')](_0xf5b4('0x92'),_0x140ea8,_0x5bf47c[0x0],_0x476ee6);}else{_0xde1441=_0x476ee6;}}else{logger[_0xf5b4('0x6b')](_0xf5b4('0x93'));}if(_0xf5b4('0x25')!=typeof _0x4cf698['parameters'][_0xf5b4('0x85')][_0xf5b4('0x87')]){var _0x16a493=_0x4cf698['parameters'][_0xf5b4('0x85')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf5b4('0x91')](_0x16a493)){_0x3faf93=path[_0xf5b4('0x56')](_0xf5b4('0x92'),_0x140ea8,_0x5bf47c[0x0],_0x16a493);}else{_0x3faf93=_0x16a493;}}else{logger[_0xf5b4('0x6b')](_0xf5b4('0x94'));}}else if(_0x3ae74e===_0xf5b4('0x95')){_0x3cf038=_0x4cf698['parameters'][_0xf5b4('0x89')];_0x5a3779=_0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x8b')];if(_0xf5b4('0x25')!=typeof _0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x85')]){if(_0xf5b4('0x25')!=typeof _0x4cf698['parameters'][_0xf5b4('0x85')]['admin']){var _0x476ee6=_0x4cf698[_0xf5b4('0x81')]['views'][_0xf5b4('0x86')];if(!/^(f|ht)tps?:\/\//i[_0xf5b4('0x91')](_0x476ee6)){_0xde1441=path[_0xf5b4('0x56')](_0xf5b4('0x92'),_0x140ea8,_0x5bf47c[0x0],_0x476ee6);}else{_0xde1441=_0x476ee6;}}if(_0xf5b4('0x25')!=typeof _0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x85')][_0xf5b4('0x87')]){var _0x16a493=_0x4cf698[_0xf5b4('0x81')][_0xf5b4('0x85')][_0xf5b4('0x87')];if(!/^(f|ht)tps?:\/\//i[_0xf5b4('0x91')](_0x16a493)){_0x3faf93=path['join'](_0xf5b4('0x92'),_0x140ea8,_0x5bf47c[0x0],_0x16a493);}else{_0x3faf93=_0x16a493;}}}}var _0x2ba310={'name':_0x2d7135,'description':_0x1fef34,'path':path[_0xf5b4('0x56')](_0x140ea8,_0x5bf47c[0x0]),'type':_0x3ae74e,'sidebar':_0x5b97b2,'icon':_0xa5593a,'adminUrl':_0xde1441,'agentUrl':_0x3faf93,'scriptName':_0x3cf038,'scriptPath':_0x5a3779,'version':_0x39283b};removeReferences(_0x16220e,null);return db[_0xf5b4('0x39')][_0xf5b4('0x96')](_0x2ba310)['then'](function(_0x29f524){var _0x176949={'role':_0x3a5787[_0xf5b4('0x97')][_0xf5b4('0x98')],'userProfileId':_0x3a5787[_0xf5b4('0x97')]['userProfileId']};if(!_0x176949)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x176949[_0xf5b4('0x98')]===_0xf5b4('0x99')){var _0x4c66ab=_0x29f524[_0xf5b4('0x30')]({'plain':!![]});return db[_0xf5b4('0x9a')][_0xf5b4('0x54')]({'where':{'name':_0xf5b4('0x31'),'userProfileId':_0x176949[_0xf5b4('0x9b')]},'raw':!![]})[_0xf5b4('0x2f')](function(_0x4669bc){if(_0x4669bc&&_0x4669bc[_0xf5b4('0x9c')]===0x0){return db[_0xf5b4('0x32')][_0xf5b4('0x96')]({'name':_0x4c66ab[_0xf5b4('0x35')],'resourceId':_0x4c66ab['id'],'type':_0x4669bc[_0xf5b4('0x35')],'sectionId':_0x4669bc['id']},{})[_0xf5b4('0x2f')](function(){return _0x29f524;});}else{return _0x29f524;}})[_0xf5b4('0x55')](function(_0x1de347){logger['error'](_0xf5b4('0x9d'),_0x1de347);throw _0x1de347;});}return _0x29f524;})['then'](respondWithResult(_0x38034e,null))[_0xf5b4('0x55')](handleError(_0x38034e,null));}});}catch(_0x7e7688){_0x38034e['status'](0x1f4)[_0xf5b4('0x36')](_0x7e7688);}};function removeReferences(_0xef5d34,_0x1349b1){try{if(_0xef5d34){fs[_0xf5b4('0x6a')](_0xef5d34);logger[_0xf5b4('0x6b')](_0xf5b4('0x9e'));}if(_0x1349b1){rimraf(_0x1349b1,function(){});logger['info'](_0xf5b4('0x9f'));}}catch(_0x33ace0){logger[_0xf5b4('0x33')](_0x33ace0);}}exports[_0xf5b4('0x2d')]=function(_0x21e999,_0x60092d,_0x195297){return db['Plugin'][_0xf5b4('0x54')]({'where':{'id':_0x21e999['params']['id']}})[_0xf5b4('0x2f')](handleEntityNotFound(_0x60092d,null))[_0xf5b4('0x2f')](saveUpdates(_0x21e999[_0xf5b4('0x97')],null))['then'](respondWithResult(_0x60092d,null))['catch'](handleError(_0x60092d,null));};exports[_0xf5b4('0xa0')]=function(_0x216c2c,_0x989fa9,_0x4a897b){return db[_0xf5b4('0x39')][_0xf5b4('0x54')]({'where':{'id':_0x216c2c[_0xf5b4('0x52')]['id']}})[_0xf5b4('0x2f')](function(_0x1bc923){if(_0x1bc923){return _0x1bc923[_0xf5b4('0x2e')]();}})[_0xf5b4('0x2f')](function(_0x598634){rimraf(path[_0xf5b4('0x56')](config['root'],'server/files/plugins',path[_0xf5b4('0x63')](_0x598634[_0xf5b4('0x8')])),function(){});return _0x598634;})[_0xf5b4('0x2f')](handleEntityNotFound(_0x989fa9,null))[_0xf5b4('0x2f')](respondWithStatusCode(_0x989fa9,null))[_0xf5b4('0x55')](handleError(_0x989fa9,null));};exports[_0xf5b4('0xa1')]=function(_0x5300fa,_0x569d2c,_0x35221d){return BPromise['resolve']()['then'](function(){if(!_0x5300fa[_0xf5b4('0x3e')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5300fa[_0xf5b4('0x3e')][_0xf5b4('0xa2')]){throw new Error(_0xf5b4('0xa3'));}var _0x1559c7=_0x5300fa[_0xf5b4('0x3e')][_0xf5b4('0xa4')]?_0x5300fa[_0xf5b4('0x3e')]['hostname']+':'+_0x5300fa['query'][_0xf5b4('0xa2')]:_0xf5b4('0xa5')+_0x5300fa[_0xf5b4('0x3e')]['port'];var _0xa8a545=_0x5300fa[_0xf5b4('0x3e')][_0xf5b4('0x24')]?_0x5300fa[_0xf5b4('0x3e')][_0xf5b4('0x24')]:!![];var _0x45cf2d=_0x5300fa['query'][_0xf5b4('0xa6')]?_0x5300fa[_0xf5b4('0x3e')][_0xf5b4('0xa6')]:null;var _0x36d591={'method':_0x5300fa['method'],'uri':util[_0xf5b4('0x58')]('%s%s',_0x1559c7,_0x5300fa[_0xf5b4('0x3e')][_0xf5b4('0x8')]),'json':_0xa8a545,'resolveWithFullResponse':!![],'encoding':_0x45cf2d,'qs':_0x5300fa['query']};if(_0x5300fa['headers']){_0x36d591[_0xf5b4('0xa7')]=_0x5300fa['headers'];if(_0x36d591[_0xf5b4('0xa7')][_0xf5b4('0xa8')]){delete _0x36d591[_0xf5b4('0xa7')][_0xf5b4('0xa8')];}}if(_0x36d591[_0xf5b4('0xa7')][_0xf5b4('0xa9')]){delete _0x36d591[_0xf5b4('0xa7')][_0xf5b4('0xa9')];}return rp(_0x36d591);})['then'](function(_0x2ca4ca){if(_0x2ca4ca){_0x569d2c[_0xf5b4('0xaa')](_0x2ca4ca[_0xf5b4('0xa7')]);logger[_0xf5b4('0x6b')](_0x2ca4ca[_0xf5b4('0x97')]);if(_[_0xf5b4('0xab')](_0x5300fa[_0xf5b4('0x3e')][_0xf5b4('0x8')],_0xf5b4('0x69'))&&_0x2ca4ca['statusCode']==0x1f4){return _0x569d2c[_0xf5b4('0x21')](_0x2ca4ca[_0xf5b4('0xac')]);}else{return _0x569d2c['status'](_0x2ca4ca[_0xf5b4('0xac')])[_0xf5b4('0x36')](_0x2ca4ca[_0xf5b4('0x97')]);}}else{return _0x569d2c[_0xf5b4('0x21')](0xc8);}})[_0xf5b4('0x55')](handleError(_0x569d2c,null));};exports[_0xf5b4('0xad')]=function(_0x26d9a1,_0x21dbb4,_0x1799a7){return BPromise[_0xf5b4('0xae')]()[_0xf5b4('0x2f')](function(){if(!_0x26d9a1[_0xf5b4('0x3e')]['path']){throw new Error(_0xf5b4('0xaf'));}if(!_0x26d9a1[_0xf5b4('0x3e')]['port']){throw new Error(_0xf5b4('0xa3'));}var _0x436d82=_0x26d9a1[_0xf5b4('0x3e')][_0xf5b4('0xa4')]?_0x26d9a1[_0xf5b4('0x3e')]['hostname']+':'+_0x26d9a1['query']['port']:_0xf5b4('0xa5')+_0x26d9a1[_0xf5b4('0x3e')]['port'];var _0x2757ba=_0x26d9a1['query']['json']?_0x26d9a1[_0xf5b4('0x3e')]['json']:!![];var _0x2c6d21=_0x26d9a1['query'][_0xf5b4('0xa6')]?_0x26d9a1['query'][_0xf5b4('0xa6')]:null;var _0x48b2d4={'method':_0x26d9a1[_0xf5b4('0xb0')],'uri':util[_0xf5b4('0x58')](_0xf5b4('0xb1'),_0x436d82,_0x26d9a1['query']['path']),'json':_0x2757ba,'resolveWithFullResponse':!![],'encoding':_0x2c6d21,'body':_0x26d9a1[_0xf5b4('0x97')]};if(_0x26d9a1[_0xf5b4('0xa7')]){_0x48b2d4[_0xf5b4('0xa7')]=_0x26d9a1[_0xf5b4('0xa7')];if(_0x48b2d4[_0xf5b4('0xa7')][_0xf5b4('0xa8')]){delete _0x48b2d4[_0xf5b4('0xa7')][_0xf5b4('0xa8')];}}if(_0x48b2d4[_0xf5b4('0xa7')][_0xf5b4('0xa9')]){delete _0x48b2d4[_0xf5b4('0xa7')]['content-type'];}return rp(_0x48b2d4);})[_0xf5b4('0x2f')](function(_0x28582c){if(_0x28582c){_0x21dbb4[_0xf5b4('0xaa')](_0x28582c['headers']);logger[_0xf5b4('0x6b')](_0x28582c[_0xf5b4('0x97')]);return _0x21dbb4[_0xf5b4('0x22')](_0x28582c[_0xf5b4('0xac')])[_0xf5b4('0x36')](_0x28582c[_0xf5b4('0x97')]);}else{return _0x21dbb4[_0xf5b4('0x21')](0xc8);}})[_0xf5b4('0x55')](handleError(_0x21dbb4,null));}; \ No newline at end of file +var _0xcc19=['sort','filters','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','fields','includeAll','find','download','path','root','format','%s.zip','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','join','server/files/plugins','dirname','basename','attachments/**/*','finalize','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','error','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','always','icon','icon-apps','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','delete','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./plugin.socket','sendStatus','status','json','offset','undefined','limit','count','set','save','then','destroy','get','Plugins','UserProfileResource','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','length','nolimit','order'];(function(_0x232b5e,_0x4c1c7f){var _0x2c8f33=function(_0x350d93){while(--_0x350d93){_0x232b5e['push'](_0x232b5e['shift']());}};_0x2c8f33(++_0x4c1c7f);}(_0xcc19,0x114));var _0x9cc1=function(_0x1b2cf0,_0x3e1559){_0x1b2cf0=_0x1b2cf0-0x0;var _0x566935=_0xcc19[_0x1b2cf0];return _0x566935;};'use strict';var emlformat=require(_0x9cc1('0x0'));var rimraf=require(_0x9cc1('0x1'));var zipdir=require(_0x9cc1('0x2'));var jsonpatch=require(_0x9cc1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9cc1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x9cc1('0x5'));var csv=require(_0x9cc1('0x6'));var ejs=require(_0x9cc1('0x7'));var fs=require('fs');var fs_extra=require(_0x9cc1('0x8'));var _=require(_0x9cc1('0x9'));var squel=require(_0x9cc1('0xa'));var crypto=require(_0x9cc1('0xb'));var jsforce=require(_0x9cc1('0xc'));var deskjs=require(_0x9cc1('0xd'));var toCsv=require(_0x9cc1('0x6'));var querystring=require(_0x9cc1('0xe'));var Papa=require(_0x9cc1('0xf'));var extract=require(_0x9cc1('0x10'));var rimraf=require(_0x9cc1('0x1'));var archiver=require(_0x9cc1('0x11'));var Redis=require('ioredis');var authService=require(_0x9cc1('0x12'));var qs=require(_0x9cc1('0x13'));var as=require(_0x9cc1('0x14'));var hardwareService=require(_0x9cc1('0x15'));var logger=require(_0x9cc1('0x16'))('api');var utils=require(_0x9cc1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9cc1('0x18'));var db=require(_0x9cc1('0x19'))['db'];config[_0x9cc1('0x1a')]=_[_0x9cc1('0x1b')](config[_0x9cc1('0x1a')],{'host':_0x9cc1('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9cc1('0x1a')]));require(_0x9cc1('0x1d'))['register'](socket);function respondWithStatusCode(_0x261978,_0x4d4f96){_0x4d4f96=_0x4d4f96||0xcc;return function(_0x45e0ef){if(_0x45e0ef){return _0x261978[_0x9cc1('0x1e')](_0x4d4f96);}return _0x261978[_0x9cc1('0x1f')](_0x4d4f96)['end']();};}function respondWithResult(_0x3113fc,_0x4fade2){_0x4fade2=_0x4fade2||0xc8;return function(_0x59a2c1){if(_0x59a2c1){return _0x3113fc['status'](_0x4fade2)[_0x9cc1('0x20')](_0x59a2c1);}};}function respondWithFilteredResult(_0x4b2eb0,_0x2a5f23){return function(_0x5e4186){if(_0x5e4186){var _0x15324c=typeof _0x2a5f23[_0x9cc1('0x21')]===_0x9cc1('0x22')&&typeof _0x2a5f23[_0x9cc1('0x23')]===_0x9cc1('0x22');var _0x3a227f=_0x5e4186[_0x9cc1('0x24')];var _0x59a98c=_0x15324c?0x0:_0x2a5f23['offset'];var _0x4ebf5f=_0x15324c?_0x5e4186['count']:_0x2a5f23[_0x9cc1('0x21')]+_0x2a5f23[_0x9cc1('0x23')];var _0x5acaad;if(_0x4ebf5f>=_0x3a227f){_0x4ebf5f=_0x3a227f;_0x5acaad=0xc8;}else{_0x5acaad=0xce;}_0x4b2eb0[_0x9cc1('0x1f')](_0x5acaad);return _0x4b2eb0[_0x9cc1('0x25')]('Content-Range',_0x59a98c+'-'+_0x4ebf5f+'/'+_0x3a227f)[_0x9cc1('0x20')](_0x5e4186);}return null;};}function patchUpdates(_0x16376b){return function(_0x5bdc3d){try{jsonpatch['apply'](_0x5bdc3d,_0x16376b,!![]);}catch(_0x269555){return BPromise['reject'](_0x269555);}return _0x5bdc3d[_0x9cc1('0x26')]();};}function saveUpdates(_0x1d5fe1,_0x3b42d4){return function(_0x3bc4bc){if(_0x3bc4bc){return _0x3bc4bc['update'](_0x1d5fe1)[_0x9cc1('0x27')](function(_0x531fe4){return _0x531fe4;});}return null;};}function removeEntity(_0x40cf0b,_0x3471ef){return function(_0x23319c){if(_0x23319c){return _0x23319c[_0x9cc1('0x28')]()['then'](function(){var _0x3f8eee=_0x23319c[_0x9cc1('0x29')]({'plain':!![]});var _0x49002f=_0x9cc1('0x2a');return db[_0x9cc1('0x2b')][_0x9cc1('0x28')]({'where':{'type':_0x49002f,'resourceId':_0x3f8eee['id']}})['then'](function(){return _0x23319c;});})['then'](function(){_0x40cf0b[_0x9cc1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x329dc3,_0x4424c8){return function(_0x539ce8){if(!_0x539ce8){_0x329dc3[_0x9cc1('0x1e')](0x194);}return _0x539ce8;};}function handleError(_0x3162a9,_0x1238e4){_0x1238e4=_0x1238e4||0x1f4;return function(_0x37bfb6){logger['error'](_0x37bfb6[_0x9cc1('0x2c')]);if(_0x37bfb6[_0x9cc1('0x2d')]){delete _0x37bfb6[_0x9cc1('0x2d')];}_0x3162a9[_0x9cc1('0x1f')](_0x1238e4)[_0x9cc1('0x2e')](_0x37bfb6);};}exports[_0x9cc1('0x2f')]=function(_0x5ef0e7,_0x1c9817){var _0x1f72b3={},_0x269fdf={},_0x29f75a={'count':0x0,'rows':[]};var _0x53214f=_[_0x9cc1('0x30')](db[_0x9cc1('0x31')][_0x9cc1('0x32')],function(_0x4c8294){return{'name':_0x4c8294[_0x9cc1('0x33')],'type':_0x4c8294[_0x9cc1('0x34')][_0x9cc1('0x35')]};});_0x269fdf['model']=_['map'](_0x53214f,_0x9cc1('0x2d'));_0x269fdf[_0x9cc1('0x36')]=_[_0x9cc1('0x37')](_0x5ef0e7['query']);_0x269fdf['filters']=_['intersection'](_0x269fdf[_0x9cc1('0x38')],_0x269fdf[_0x9cc1('0x36')]);_0x1f72b3[_0x9cc1('0x39')]=_[_0x9cc1('0x3a')](_0x269fdf['model'],qs['fields'](_0x5ef0e7[_0x9cc1('0x36')]['fields']));_0x1f72b3[_0x9cc1('0x39')]=_0x1f72b3[_0x9cc1('0x39')][_0x9cc1('0x3b')]?_0x1f72b3['attributes']:_0x269fdf['model'];if(!_0x5ef0e7[_0x9cc1('0x36')]['hasOwnProperty'](_0x9cc1('0x3c'))){_0x1f72b3['limit']=qs['limit'](_0x5ef0e7[_0x9cc1('0x36')][_0x9cc1('0x23')]);_0x1f72b3[_0x9cc1('0x21')]=qs[_0x9cc1('0x21')](_0x5ef0e7[_0x9cc1('0x36')][_0x9cc1('0x21')]);}_0x1f72b3[_0x9cc1('0x3d')]=qs[_0x9cc1('0x3e')](_0x5ef0e7[_0x9cc1('0x36')]['sort']);_0x1f72b3['where']=qs[_0x9cc1('0x3f')](_[_0x9cc1('0x40')](_0x5ef0e7[_0x9cc1('0x36')],_0x269fdf[_0x9cc1('0x3f')]),_0x53214f);if(_0x5ef0e7['query'][_0x9cc1('0x41')]){_0x1f72b3['where']=_['merge'](_0x1f72b3[_0x9cc1('0x42')],{'$or':_[_0x9cc1('0x30')](_0x53214f,function(_0xc9a780){if(_0xc9a780['type']!==_0x9cc1('0x43')){var _0x203e0f={};_0x203e0f[_0xc9a780[_0x9cc1('0x2d')]]={'$like':'%'+_0x5ef0e7['query'][_0x9cc1('0x41')]+'%'};return _0x203e0f;}})});}_0x1f72b3=_[_0x9cc1('0x44')]({},_0x1f72b3,_0x5ef0e7[_0x9cc1('0x45')]);var _0x1e92b7={'where':_0x1f72b3[_0x9cc1('0x42')]};return db['Plugin']['count'](_0x1e92b7)['then'](function(_0x5dc409){_0x29f75a[_0x9cc1('0x24')]=_0x5dc409;if(_0x5ef0e7[_0x9cc1('0x36')]['includeAll']){_0x1f72b3['include']=[{'all':!![]}];}return db[_0x9cc1('0x31')][_0x9cc1('0x46')](_0x1f72b3);})[_0x9cc1('0x27')](function(_0x477080){_0x29f75a[_0x9cc1('0x47')]=_0x477080;return _0x29f75a;})[_0x9cc1('0x27')](respondWithFilteredResult(_0x1c9817,_0x1f72b3))[_0x9cc1('0x48')](handleError(_0x1c9817,null));};exports[_0x9cc1('0x49')]=function(_0x17e226,_0x2365e5){var _0xf178d4={'raw':!![],'where':{'id':_0x17e226[_0x9cc1('0x4a')]['id']}},_0x1821a1={};_0x1821a1['model']=_['keys'](db[_0x9cc1('0x31')][_0x9cc1('0x32')]);_0x1821a1['query']=_[_0x9cc1('0x37')](_0x17e226[_0x9cc1('0x36')]);_0x1821a1[_0x9cc1('0x3f')]=_[_0x9cc1('0x3a')](_0x1821a1[_0x9cc1('0x38')],_0x1821a1['query']);_0xf178d4[_0x9cc1('0x39')]=_['intersection'](_0x1821a1[_0x9cc1('0x38')],qs['fields'](_0x17e226['query'][_0x9cc1('0x4b')]));_0xf178d4[_0x9cc1('0x39')]=_0xf178d4[_0x9cc1('0x39')][_0x9cc1('0x3b')]?_0xf178d4[_0x9cc1('0x39')]:_0x1821a1[_0x9cc1('0x38')];if(_0x17e226[_0x9cc1('0x36')][_0x9cc1('0x4c')]){_0xf178d4['include']=[{'all':!![]}];}_0xf178d4=_[_0x9cc1('0x44')]({},_0xf178d4,_0x17e226[_0x9cc1('0x45')]);return db['Plugin'][_0x9cc1('0x4d')](_0xf178d4)[_0x9cc1('0x27')](handleEntityNotFound(_0x2365e5,null))['then'](respondWithResult(_0x2365e5,null))[_0x9cc1('0x48')](handleError(_0x2365e5,null));};exports[_0x9cc1('0x4e')]=function(_0x545895,_0x10c73f,_0x1f7e83){return db[_0x9cc1('0x31')][_0x9cc1('0x4d')]({'where':{'id':_0x545895[_0x9cc1('0x4a')]['id']},'attributes':['name',_0x9cc1('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x10c73f,null))[_0x9cc1('0x27')](function(_0x258bd5){if(_0x258bd5){var _0x329a06=path['join'](config[_0x9cc1('0x50')],'server/files/plugins',util[_0x9cc1('0x51')](_0x9cc1('0x52'),path['basename'](_0x258bd5[_0x9cc1('0x4f')])));var _0x3c48ec=fs['createWriteStream'](_0x329a06);var _0x55f891=archiver('zip',{'zlib':{'level':0x9}});_0x55f891['on']('warning',function(_0x144eee){if(_0x144eee[_0x9cc1('0x53')]===_0x9cc1('0x54')){logger['error'](_0x144eee);}else{throw new db[(_0x9cc1('0x55'))]['Error'](_0x9cc1('0x56'));}});_0x55f891['on']('error',function(_0x5cf80c){throw new db[(_0x9cc1('0x55'))][(_0x9cc1('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x55f891['pipe'](_0x3c48ec);_0x55f891[_0x9cc1('0x58')]('**/*',{'cwd':path[_0x9cc1('0x59')](config['root'],_0x9cc1('0x5a'),path[_0x9cc1('0x5b')](_0x258bd5[_0x9cc1('0x4f')])),'ignore':[path[_0x9cc1('0x59')](path[_0x9cc1('0x5c')](_0x258bd5[_0x9cc1('0x4f')]),'node_modules/**/*'),path[_0x9cc1('0x59')](path[_0x9cc1('0x5c')](_0x258bd5[_0x9cc1('0x4f')]),_0x9cc1('0x5d'))],'nodir':!![]})[_0x9cc1('0x5e')]();_0x3c48ec['on'](_0x9cc1('0x5f'),function(){if(!fs[_0x9cc1('0x60')](_0x329a06)){throw new db[(_0x9cc1('0x55'))][(_0x9cc1('0x57'))]('Plugin\x20not\x20found');}return _0x10c73f[_0x9cc1('0x4e')](_0x329a06,util['format']('%s.zip',path['basename'](_0x258bd5[_0x9cc1('0x4f')])),function(_0x42968c){if(_0x42968c){throw new db[(_0x9cc1('0x55'))][(_0x9cc1('0x57'))](_0x9cc1('0x61'));}fs[_0x9cc1('0x62')](_0x329a06);logger[_0x9cc1('0x63')](_0x9cc1('0x64'));logger['info'](_0x9cc1('0x65'));});});}return null;})[_0x9cc1('0x48')](handleError(_0x10c73f,null));};exports[_0x9cc1('0x66')]=function(_0x57186d,_0x2b3744,_0x4b85a1){var _0x18ea26=path[_0x9cc1('0x5c')](_0x57186d[_0x9cc1('0x67')][_0x9cc1('0x68')],path[_0x9cc1('0x69')](_0x57186d[_0x9cc1('0x67')][_0x9cc1('0x68')]));var _0x564160=path[_0x9cc1('0x59')](config[_0x9cc1('0x50')],'server/files/plugins',_0x57186d['file'][_0x9cc1('0x68')]);var _0x1f76e7=path['join'](config[_0x9cc1('0x50')],'server/files/plugins',_0x18ea26);logger[_0x9cc1('0x63')](_0x9cc1('0x6a'),_0x564160);logger['info'](_0x9cc1('0x6b'),_0x1f76e7);try{fs[_0x9cc1('0x6c')](_0x564160,parseInt(_0x9cc1('0x6d'),0x8));extract(_0x564160,{'dir':_0x1f76e7},function(_0x480f58){if(_0x480f58){logger[_0x9cc1('0x6e')](_0x480f58);handleError(_0x480f58,!![]);};var _0x248a04=fs['readdirSync'](_0x1f76e7);if(_0x248a04[_0x9cc1('0x3b')]>0x1){removeReferences(_0x564160,_0x1f76e7);logger[_0x9cc1('0x6e')](_0x9cc1('0x6f'));return _0x4b85a1(new Error(_0x9cc1('0x6f')));}var _0x515001=fs[_0x9cc1('0x70')](path[_0x9cc1('0x59')](_0x1f76e7,_0x248a04[0x0]));if(_0x515001[_0x9cc1('0x71')]()){removeReferences(_0x564160,_0x1f76e7);logger['error'](_0x9cc1('0x6f'));return _0x4b85a1(new Error(_0x9cc1('0x6f')));}if(_0x515001[_0x9cc1('0x72')]()){var _0x4c26f1=fs['readdirSync'](path['join'](_0x1f76e7,_0x248a04[0x0]));if(_0x4c26f1[_0x9cc1('0x3b')]===0x0){removeReferences(_0x564160,_0x1f76e7);logger[_0x9cc1('0x6e')](_0x9cc1('0x6f'));return _0x4b85a1(new Error('Invalid\x20plugin\x20structure'));}var _0x23e902=_0x4c26f1[_0x9cc1('0x73')](function(_0x47d027){return _0x47d027===_0x9cc1('0x74');});if(!_0x23e902){return _0x4b85a1(new Error(_0x9cc1('0x75')));}var _0x1020ca=fs['readFileSync'](path[_0x9cc1('0x59')](_0x1f76e7,_0x248a04[0x0],_0x9cc1('0x74')));var _0xdc8360=JSON['parse'](_0x1020ca);if('undefined'==typeof _0xdc8360[_0x9cc1('0x2d')]){return _0x4b85a1(new Error(_0x9cc1('0x76')));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x34')]){return _0x4b85a1(new Error(_0x9cc1('0x77')));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x78')]){return _0x4b85a1(new Error(_0x9cc1('0x79')));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x7a')]){return _0x4b85a1(new Error(_0x9cc1('0x7b')));}if(_0xdc8360[_0x9cc1('0x34')]===_0x9cc1('0x7c')){if('undefined'==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')]){return _0x4b85a1(new Error(_0x9cc1('0x7e')));}if(_0x9cc1('0x22')==typeof _0xdc8360['parameters'][_0x9cc1('0x7d')][_0x9cc1('0x7f')]&&_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')]['agent']){return _0x4b85a1(new Error(_0x9cc1('0x80')));}}else if(_0xdc8360['type']===_0x9cc1('0x81')){if('undefined'==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x82')]){return _0x4b85a1(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x9cc1('0x22')==typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x83')]){return _0x4b85a1(new Error(_0x9cc1('0x84')));}}else{return _0x4b85a1(new Error(_0x9cc1('0x85')));}var _0xae13e4=_0xdc8360['name'];var _0x43b3cd=_0xdc8360[_0x9cc1('0x86')];var _0x3a93e5=_0xdc8360[_0x9cc1('0x34')];var _0xa08b63=_0xdc8360['sidebar']?_0xdc8360['sidebar']:_0x9cc1('0x87');var _0x7b5e70=_0xdc8360[_0x9cc1('0x88')]?_0xdc8360[_0x9cc1('0x88')]:_0x9cc1('0x89');var _0x4bec7d='';var _0x42d831='';var _0x35f3ec='';var _0x54664a='';var _0x16b562=_0xdc8360[_0x9cc1('0x78')];if(_0x3a93e5===_0x9cc1('0x7c')){if(_0x9cc1('0x22')!=typeof _0xdc8360[_0x9cc1('0x7a')]['views'][_0x9cc1('0x7f')]){var _0x3b6af8=_0xdc8360['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x3b6af8)){_0x4bec7d=path[_0x9cc1('0x59')](_0x9cc1('0x8a'),_0x18ea26,_0x248a04[0x0],_0x3b6af8);}else{_0x4bec7d=_0x3b6af8;}}else{logger[_0x9cc1('0x63')](_0x9cc1('0x8b'));}if('undefined'!=typeof _0xdc8360['parameters'][_0x9cc1('0x7d')][_0x9cc1('0x8c')]){var _0x3aa195=_0xdc8360[_0x9cc1('0x7a')]['views'][_0x9cc1('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x9cc1('0x8d')](_0x3aa195)){_0x42d831=path[_0x9cc1('0x59')](_0x9cc1('0x8a'),_0x18ea26,_0x248a04[0x0],_0x3aa195);}else{_0x42d831=_0x3aa195;}}else{logger[_0x9cc1('0x63')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x3a93e5===_0x9cc1('0x81')){_0x35f3ec=_0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x82')];_0x54664a=_0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x83')];if(_0x9cc1('0x22')!=typeof _0xdc8360[_0x9cc1('0x7a')]['views']){if('undefined'!=typeof _0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')]['admin']){var _0x3b6af8=_0xdc8360[_0x9cc1('0x7a')][_0x9cc1('0x7d')][_0x9cc1('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x9cc1('0x8d')](_0x3b6af8)){_0x4bec7d=path[_0x9cc1('0x59')](_0x9cc1('0x8a'),_0x18ea26,_0x248a04[0x0],_0x3b6af8);}else{_0x4bec7d=_0x3b6af8;}}if(_0x9cc1('0x22')!=typeof _0xdc8360['parameters'][_0x9cc1('0x7d')][_0x9cc1('0x8c')]){var _0x3aa195=_0xdc8360[_0x9cc1('0x7a')]['views'][_0x9cc1('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0x3aa195)){_0x42d831=path[_0x9cc1('0x59')]('plugins',_0x18ea26,_0x248a04[0x0],_0x3aa195);}else{_0x42d831=_0x3aa195;}}}}var _0x1d3011={'name':_0xae13e4,'description':_0x43b3cd,'path':path[_0x9cc1('0x59')](_0x18ea26,_0x248a04[0x0]),'type':_0x3a93e5,'sidebar':_0xa08b63,'icon':_0x7b5e70,'adminUrl':_0x4bec7d,'agentUrl':_0x42d831,'scriptName':_0x35f3ec,'scriptPath':_0x54664a,'version':_0x16b562};removeReferences(_0x564160,null);return db[_0x9cc1('0x31')][_0x9cc1('0x8e')](_0x1d3011)[_0x9cc1('0x27')](function(_0x44ef81){var _0x1f0dd4={'role':_0x57186d[_0x9cc1('0x8f')][_0x9cc1('0x90')],'userProfileId':_0x57186d[_0x9cc1('0x8f')][_0x9cc1('0x91')]};if(!_0x1f0dd4)throw new Error(_0x9cc1('0x92'));if(_0x1f0dd4['role']===_0x9cc1('0x93')){var _0x30f638=_0x44ef81[_0x9cc1('0x29')]({'plain':!![]});return db[_0x9cc1('0x94')][_0x9cc1('0x4d')]({'where':{'name':'Plugins','userProfileId':_0x1f0dd4['userProfileId']},'raw':!![]})[_0x9cc1('0x27')](function(_0x299430){if(_0x299430&&_0x299430['autoAssociation']===0x0){return db[_0x9cc1('0x2b')]['create']({'name':_0x30f638[_0x9cc1('0x2d')],'resourceId':_0x30f638['id'],'type':_0x299430[_0x9cc1('0x2d')],'sectionId':_0x299430['id']},{})[_0x9cc1('0x27')](function(){return _0x44ef81;});}else{return _0x44ef81;}})[_0x9cc1('0x48')](function(_0x57e765){logger[_0x9cc1('0x6e')](_0x9cc1('0x95'),_0x57e765);throw _0x57e765;});}return _0x44ef81;})['then'](respondWithResult(_0x2b3744,null))[_0x9cc1('0x48')](handleError(_0x2b3744,null));}});}catch(_0x28fe6e){_0x2b3744[_0x9cc1('0x1f')](0x1f4)[_0x9cc1('0x2e')](_0x28fe6e);}};function removeReferences(_0x364f13,_0x554aed){try{if(_0x364f13){fs[_0x9cc1('0x62')](_0x364f13);logger[_0x9cc1('0x63')](_0x9cc1('0x96'));}if(_0x554aed){rimraf(_0x554aed,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x4b028d){logger[_0x9cc1('0x6e')](_0x4b028d);}}exports[_0x9cc1('0x97')]=function(_0x368844,_0x1b5a74,_0x54339c){return db[_0x9cc1('0x31')][_0x9cc1('0x4d')]({'where':{'id':_0x368844['params']['id']}})[_0x9cc1('0x27')](handleEntityNotFound(_0x1b5a74,null))['then'](saveUpdates(_0x368844[_0x9cc1('0x8f')],null))[_0x9cc1('0x27')](respondWithResult(_0x1b5a74,null))[_0x9cc1('0x48')](handleError(_0x1b5a74,null));};exports[_0x9cc1('0x98')]=function(_0x4cf566,_0x560101,_0x39321c){return db[_0x9cc1('0x31')][_0x9cc1('0x4d')]({'where':{'id':_0x4cf566[_0x9cc1('0x4a')]['id']}})['then'](function(_0xdcd4a1){if(_0xdcd4a1){return _0xdcd4a1[_0x9cc1('0x28')]();}})[_0x9cc1('0x27')](function(_0x1a6443){rimraf(path[_0x9cc1('0x59')](config[_0x9cc1('0x50')],_0x9cc1('0x5a'),path[_0x9cc1('0x5b')](_0x1a6443[_0x9cc1('0x4f')])),function(){});return _0x1a6443;})['then'](handleEntityNotFound(_0x560101,null))['then'](respondWithStatusCode(_0x560101,null))[_0x9cc1('0x48')](handleError(_0x560101,null));};exports[_0x9cc1('0x99')]=function(_0x7392ab,_0x35e88d,_0x5083ef){return BPromise[_0x9cc1('0x9a')]()['then'](function(){if(!_0x7392ab['query'][_0x9cc1('0x4f')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9b')]){throw new Error(_0x9cc1('0x9c'));}var _0x13d137=_0x7392ab['query'][_0x9cc1('0x9d')]?_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9d')]+':'+_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9b')]:_0x9cc1('0x9e')+_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9b')];var _0x20a53a=_0x7392ab['query'][_0x9cc1('0x20')]?_0x7392ab['query'][_0x9cc1('0x20')]:!![];var _0x15c33d=_0x7392ab[_0x9cc1('0x36')]['encoding']?_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x9f')]:null;var _0x3a105a={'method':_0x7392ab[_0x9cc1('0xa0')],'uri':util[_0x9cc1('0x51')](_0x9cc1('0xa1'),_0x13d137,_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x4f')]),'json':_0x20a53a,'resolveWithFullResponse':!![],'encoding':_0x15c33d,'qs':_0x7392ab[_0x9cc1('0x36')]};if(_0x7392ab[_0x9cc1('0xa2')]){_0x3a105a[_0x9cc1('0xa2')]=_0x7392ab[_0x9cc1('0xa2')];if(_0x3a105a['headers'][_0x9cc1('0xa3')]){delete _0x3a105a[_0x9cc1('0xa2')][_0x9cc1('0xa3')];}}if(_0x3a105a[_0x9cc1('0xa2')][_0x9cc1('0xa4')]){delete _0x3a105a['headers']['content-type'];}return rp(_0x3a105a);})[_0x9cc1('0x27')](function(_0x51cf40){if(_0x51cf40){_0x35e88d[_0x9cc1('0x25')](_0x51cf40['headers']);logger[_0x9cc1('0x63')](_0x51cf40[_0x9cc1('0x8f')]);if(_[_0x9cc1('0xa5')](_0x7392ab[_0x9cc1('0x36')][_0x9cc1('0x4f')],'download')&&_0x51cf40[_0x9cc1('0xa6')]==0x1f4){return _0x35e88d[_0x9cc1('0x1e')](_0x51cf40[_0x9cc1('0xa6')]);}else{return _0x35e88d[_0x9cc1('0x1f')](_0x51cf40[_0x9cc1('0xa6')])['send'](_0x51cf40['body']);}}else{return _0x35e88d[_0x9cc1('0x1e')](0xc8);}})['catch'](handleError(_0x35e88d,null));};exports[_0x9cc1('0xa7')]=function(_0xcb4e4,_0x33bd3e,_0x347bfe){return BPromise[_0x9cc1('0x9a')]()['then'](function(){if(!_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x4f')]){throw new Error(_0x9cc1('0xa8'));}if(!_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x35002e=_0xcb4e4['query'][_0x9cc1('0x9d')]?_0xcb4e4[_0x9cc1('0x36')]['hostname']+':'+_0xcb4e4['query']['port']:_0x9cc1('0x9e')+_0xcb4e4[_0x9cc1('0x36')]['port'];var _0x15903c=_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x20')]?_0xcb4e4[_0x9cc1('0x36')]['json']:!![];var _0x39bbc3=_0xcb4e4['query']['encoding']?_0xcb4e4[_0x9cc1('0x36')][_0x9cc1('0x9f')]:null;var _0x3fa11b={'method':_0xcb4e4['method'],'uri':util[_0x9cc1('0x51')]('%s%s',_0x35002e,_0xcb4e4[_0x9cc1('0x36')]['path']),'json':_0x15903c,'resolveWithFullResponse':!![],'encoding':_0x39bbc3,'body':_0xcb4e4[_0x9cc1('0x8f')]};if(_0xcb4e4[_0x9cc1('0xa2')]){_0x3fa11b['headers']=_0xcb4e4[_0x9cc1('0xa2')];if(_0x3fa11b[_0x9cc1('0xa2')][_0x9cc1('0xa3')]){delete _0x3fa11b[_0x9cc1('0xa2')][_0x9cc1('0xa3')];}}if(_0x3fa11b['headers']['content-type']){delete _0x3fa11b[_0x9cc1('0xa2')][_0x9cc1('0xa4')];}return rp(_0x3fa11b);})[_0x9cc1('0x27')](function(_0x33b7cf){if(_0x33b7cf){_0x33bd3e[_0x9cc1('0x25')](_0x33b7cf[_0x9cc1('0xa2')]);logger['info'](_0x33b7cf[_0x9cc1('0x8f')]);return _0x33bd3e[_0x9cc1('0x1f')](_0x33b7cf[_0x9cc1('0xa6')])[_0x9cc1('0x2e')](_0x33b7cf[_0x9cc1('0x8f')]);}else{return _0x33bd3e[_0x9cc1('0x1e')](0xc8);}})[_0x9cc1('0x48')](handleError(_0x33bd3e,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index ca4664f..918a567 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 _0xbd10=['Plugin','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x1677ee,_0x5184a3){var _0x365c0d=function(_0x3c960b){while(--_0x3c960b){_0x1677ee['push'](_0x1677ee['shift']());}};_0x365c0d(++_0x5184a3);}(_0xbd10,0x85));var _0x0bd1=function(_0x5e4591,_0x4450e2){_0x5e4591=_0x5e4591-0x0;var _0x2a69d4=_0xbd10[_0x5e4591];return _0x2a69d4;};'use strict';var EventEmitter=require(_0x0bd1('0x0'));var Plugin=require(_0x0bd1('0x1'))['db'][_0x0bd1('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0bd1('0x3'),'afterUpdate':_0x0bd1('0x4'),'afterDestroy':_0x0bd1('0x5')};function emitEvent(_0x5f05d2){return function(_0xa7c705,_0xbcdd68,_0xb3823b){PluginEvents[_0x0bd1('0x6')](_0x5f05d2+':'+_0xa7c705['id'],_0xa7c705);PluginEvents[_0x0bd1('0x6')](_0x5f05d2,_0xa7c705);_0xb3823b(null);};}for(var e in events){if(events[_0x0bd1('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x0bd1('0x8')]=PluginEvents; \ No newline at end of file +var _0xc6ac=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','Plugin'];(function(_0x11413a,_0x2ad425){var _0x391c7c=function(_0x2d3988){while(--_0x2d3988){_0x11413a['push'](_0x11413a['shift']());}};_0x391c7c(++_0x2ad425);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x32385b,_0x63af4f){_0x32385b=_0x32385b-0x0;var _0x321218=_0xc6ac[_0x32385b];return _0x321218;};'use strict';var EventEmitter=require(_0xcc6a('0x0'));var Plugin=require(_0xcc6a('0x1'))['db'][_0xcc6a('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xcc6a('0x3')](0x0);var events={'afterCreate':_0xcc6a('0x4'),'afterUpdate':_0xcc6a('0x5'),'afterDestroy':_0xcc6a('0x6')};function emitEvent(_0x31bbcd){return function(_0x297643,_0x22ee99,_0x2f26ab){PluginEvents[_0xcc6a('0x7')](_0x31bbcd+':'+_0x297643['id'],_0x297643);PluginEvents[_0xcc6a('0x7')](_0x31bbcd,_0x297643);_0x2f26ab(null);};}for(var e in events){if(events[_0xcc6a('0x8')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xcc6a('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9185cdd..b0f7b9a 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 _0x89b2=['./plugin.attributes','exports','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x43e2e1,_0x408227){var _0x1531bd=function(_0x26bc7e){while(--_0x26bc7e){_0x43e2e1['push'](_0x43e2e1['shift']());}};_0x1531bd(++_0x408227);}(_0x89b2,0xc6));var _0x289b=function(_0x12d23a,_0x1cad42){_0x12d23a=_0x12d23a-0x0;var _0x239536=_0x89b2[_0x12d23a];return _0x239536;};'use strict';var _=require(_0x289b('0x0'));var util=require(_0x289b('0x1'));var logger=require(_0x289b('0x2'))(_0x289b('0x3'));var moment=require(_0x289b('0x4'));var BPromise=require(_0x289b('0x5'));var rp=require(_0x289b('0x6'));var fs=require('fs');var path=require(_0x289b('0x7'));var rimraf=require(_0x289b('0x8'));var config=require(_0x289b('0x9'));var attributes=require(_0x289b('0xa'));module[_0x289b('0xb')]=function(_0x5a6cc7,_0x1f7062){return _0x5a6cc7['define']('Plugin',attributes,{'tableName':_0x289b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfe1f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','define','Plugin','plugins'];(function(_0x3150ab,_0x2bc06e){var _0x244414=function(_0x41096a){while(--_0x41096a){_0x3150ab['push'](_0x3150ab['shift']());}};_0x244414(++_0x2bc06e);}(_0xfe1f,0x1c3));var _0xffe1=function(_0xd839e7,_0x4209e9){_0xd839e7=_0xd839e7-0x0;var _0xc3cf23=_0xfe1f[_0xd839e7];return _0xc3cf23;};'use strict';var _=require(_0xffe1('0x0'));var util=require(_0xffe1('0x1'));var logger=require(_0xffe1('0x2'))(_0xffe1('0x3'));var moment=require(_0xffe1('0x4'));var BPromise=require(_0xffe1('0x5'));var rp=require(_0xffe1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xffe1('0x7'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module['exports']=function(_0x545c37,_0x506ec6){return _0x545c37[_0xffe1('0x8')](_0xffe1('0x9'),attributes,{'tableName':_0xffe1('0xa'),'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 6349506..2675b9c 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 _0x3948=['http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','catch','CreatePlugin','Plugin','body','options','raw','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4881f8,_0xe94a0f){var _0x16e328=function(_0x616f9c){while(--_0x616f9c){_0x4881f8['push'](_0x4881f8['shift']());}};_0x16e328(++_0xe94a0f);}(_0x3948,0x196));var _0x8394=function(_0x350850,_0x34ab4d){_0x350850=_0x350850-0x0;var _0x18e291=_0x3948[_0x350850];return _0x18e291;};'use strict';var _=require(_0x8394('0x0'));var util=require('util');var moment=require(_0x8394('0x1'));var BPromise=require('bluebird');var rs=require(_0x8394('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8394('0x3'))['db'];var utils=require(_0x8394('0x4'));var logger=require(_0x8394('0x5'))(_0x8394('0x6'));var config=require(_0x8394('0x7'));var jayson=require(_0x8394('0x8'));var client=jayson[_0x8394('0x9')][_0x8394('0xa')]({'port':0x232a});config[_0x8394('0xb')]=_[_0x8394('0xc')](config[_0x8394('0xb')],{'host':_0x8394('0xd'),'port':0x18eb});var socket=require(_0x8394('0xe'))(new Redis(config[_0x8394('0xb')]));require(_0x8394('0xf'))[_0x8394('0x10')](socket);function respondWithRpcPromise(_0x1d30ed,_0x2ab94e,_0x3311b6){return new BPromise(function(_0x23b8d6,_0x19aa2e){return client['request'](_0x1d30ed,_0x3311b6)[_0x8394('0x11')](function(_0x50f8d6){logger[_0x8394('0x12')]('Plugin,\x20%s,\x20%s',_0x2ab94e,_0x8394('0x13'));logger['debug'](_0x8394('0x14'),_0x2ab94e,_0x8394('0x13'),JSON[_0x8394('0x15')](_0x50f8d6));if(_0x50f8d6[_0x8394('0x16')]){if(_0x50f8d6[_0x8394('0x16')][_0x8394('0x17')]===0x1f4){logger[_0x8394('0x16')](_0x8394('0x18'),_0x2ab94e,_0x50f8d6['error'][_0x8394('0x19')]);return _0x19aa2e(_0x50f8d6[_0x8394('0x16')]['message']);}logger['error'](_0x8394('0x18'),_0x2ab94e,_0x50f8d6[_0x8394('0x16')]['message']);return _0x23b8d6(_0x50f8d6[_0x8394('0x16')]['message']);}else{logger[_0x8394('0x12')]('Plugin,\x20%s,\x20%s',_0x2ab94e,_0x8394('0x13'));_0x23b8d6(_0x50f8d6['result']['message']);}})[_0x8394('0x1a')](function(_0x169d83){logger['error'](_0x8394('0x18'),_0x2ab94e,_0x169d83);_0x19aa2e(_0x169d83);});});}exports[_0x8394('0x1b')]=function(_0x29c6ac){var _0x4ceaf6=this;return new Promise(function(_0x5ea063,_0x136d90){return db[_0x8394('0x1c')]['create'](_0x29c6ac[_0x8394('0x1d')],{'raw':_0x29c6ac[_0x8394('0x1e')]?_0x29c6ac[_0x8394('0x1e')][_0x8394('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x556a05){logger[_0x8394('0x12')](_0x8394('0x1b'),_0x29c6ac);logger['debug'](_0x8394('0x1b'),_0x29c6ac,JSON[_0x8394('0x15')](_0x556a05));_0x5ea063(_0x556a05);})[_0x8394('0x1a')](function(_0x47a2e3){logger[_0x8394('0x16')]('CreatePlugin',_0x47a2e3[_0x8394('0x19')],_0x29c6ac);_0x136d90(_0x4ceaf6[_0x8394('0x16')](0x1f4,_0x47a2e3[_0x8394('0x19')]));});});}; \ No newline at end of file +var _0xa8ff=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','body','options','raw'];(function(_0x3a1105,_0x11146b){var _0x47bcf3=function(_0x265475){while(--_0x265475){_0x3a1105['push'](_0x3a1105['shift']());}};_0x47bcf3(++_0x11146b);}(_0xa8ff,0x110));var _0xfa8f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xa8ff[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xfa8f('0x0'));var util=require('util');var moment=require(_0xfa8f('0x1'));var BPromise=require('bluebird');var rs=require(_0xfa8f('0x2'));var fs=require('fs');var Redis=require(_0xfa8f('0x3'));var db=require(_0xfa8f('0x4'))['db'];var utils=require(_0xfa8f('0x5'));var logger=require(_0xfa8f('0x6'))(_0xfa8f('0x7'));var config=require(_0xfa8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfa8f('0x9')][_0xfa8f('0xa')]({'port':0x232a});config[_0xfa8f('0xb')]=_[_0xfa8f('0xc')](config[_0xfa8f('0xb')],{'host':_0xfa8f('0xd'),'port':0x18eb});var socket=require(_0xfa8f('0xe'))(new Redis(config['redis']));require(_0xfa8f('0xf'))[_0xfa8f('0x10')](socket);function respondWithRpcPromise(_0x3d0932,_0x37b1aa,_0x4ceae1){return new BPromise(function(_0x48fd8a,_0x5b932c){return client[_0xfa8f('0x11')](_0x3d0932,_0x4ceae1)[_0xfa8f('0x12')](function(_0x46ca5c){logger[_0xfa8f('0x13')](_0xfa8f('0x14'),_0x37b1aa,_0xfa8f('0x15'));logger[_0xfa8f('0x16')](_0xfa8f('0x17'),_0x37b1aa,_0xfa8f('0x15'),JSON[_0xfa8f('0x18')](_0x46ca5c));if(_0x46ca5c[_0xfa8f('0x19')]){if(_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1a')]===0x1f4){logger[_0xfa8f('0x19')](_0xfa8f('0x14'),_0x37b1aa,_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1b')]);return _0x5b932c(_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1b')]);}logger[_0xfa8f('0x19')](_0xfa8f('0x14'),_0x37b1aa,_0x46ca5c[_0xfa8f('0x19')][_0xfa8f('0x1b')]);return _0x48fd8a(_0x46ca5c[_0xfa8f('0x19')]['message']);}else{logger[_0xfa8f('0x13')]('Plugin,\x20%s,\x20%s',_0x37b1aa,_0xfa8f('0x15'));_0x48fd8a(_0x46ca5c[_0xfa8f('0x1c')][_0xfa8f('0x1b')]);}})[_0xfa8f('0x1d')](function(_0x3ad1ba){logger[_0xfa8f('0x19')](_0xfa8f('0x14'),_0x37b1aa,_0x3ad1ba);_0x5b932c(_0x3ad1ba);});});}exports[_0xfa8f('0x1e')]=function(_0x173a04){var _0xaf85d5=this;return new Promise(function(_0x101dab,_0x4d133d){return db['Plugin']['create'](_0x173a04[_0xfa8f('0x1f')],{'raw':_0x173a04[_0xfa8f('0x20')]?_0x173a04[_0xfa8f('0x20')][_0xfa8f('0x21')]===undefined?!![]:![]:!![]})[_0xfa8f('0x12')](function(_0x322faf){logger[_0xfa8f('0x13')](_0xfa8f('0x1e'),_0x173a04);logger['debug'](_0xfa8f('0x1e'),_0x173a04,JSON[_0xfa8f('0x18')](_0x322faf));_0x101dab(_0x322faf);})[_0xfa8f('0x1d')](function(_0x2c24e5){logger[_0xfa8f('0x19')](_0xfa8f('0x1e'),_0x2c24e5[_0xfa8f('0x1b')],_0x173a04);_0x4d133d(_0xaf85d5[_0xfa8f('0x19')](0x1f4,_0x2c24e5[_0xfa8f('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index f70de2c..0fe5a78 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 _0x3e7c=['register','plugin:','./plugin.events','emit','removeListener'];(function(_0x3a564b,_0x3d8703){var _0xeca27f=function(_0x4031d7){while(--_0x4031d7){_0x3a564b['push'](_0x3a564b['shift']());}};_0xeca27f(++_0x3d8703);}(_0x3e7c,0x18d));var _0xc3e7=function(_0x853108,_0x2826cd){_0x853108=_0x853108-0x0;var _0x4ecc67=_0x3e7c[_0x853108];return _0x4ecc67;};'use strict';var PluginEvents=require(_0xc3e7('0x0'));var events=['save','remove','update'];function createListener(_0x9383c6,_0x59c2cd){return function(_0x130d63){_0x59c2cd[_0xc3e7('0x1')](_0x9383c6,_0x130d63);};}function removeListener(_0xa9d318,_0x328595){return function(){PluginEvents[_0xc3e7('0x2')](_0xa9d318,_0x328595);};}exports[_0xc3e7('0x3')]=function(_0x31c502){for(var _0x1d12b8=0x0,_0x40a697=events['length'];_0x1d12b8<_0x40a697;_0x1d12b8++){var _0x3e487f=events[_0x1d12b8];var _0x1eaa82=createListener(_0xc3e7('0x4')+_0x3e487f,_0x31c502);PluginEvents['on'](_0x3e487f,_0x1eaa82);}}; \ No newline at end of file +var _0xf603=['./plugin.events','save','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x14dc95,_0x112dd6){var _0x5a4598=function(_0x14aa88){while(--_0x14aa88){_0x14dc95['push'](_0x14dc95['shift']());}};_0x5a4598(++_0x112dd6);}(_0xf603,0x1a7));var _0x3f60=function(_0x4df471,_0x30e584){_0x4df471=_0x4df471-0x0;var _0x33179e=_0xf603[_0x4df471];return _0x33179e;};'use strict';var PluginEvents=require(_0x3f60('0x0'));var events=[_0x3f60('0x1'),_0x3f60('0x2'),_0x3f60('0x3')];function createListener(_0xe3f2b9,_0x500406){return function(_0x33acb9){_0x500406[_0x3f60('0x4')](_0xe3f2b9,_0x33acb9);};}function removeListener(_0x368c3a,_0x3a67e7){return function(){PluginEvents[_0x3f60('0x5')](_0x368c3a,_0x3a67e7);};}exports[_0x3f60('0x6')]=function(_0x395eb8){for(var _0x27f535=0x0,_0xf696b5=events[_0x3f60('0x7')];_0x27f535<_0xf696b5;_0x27f535++){var _0x2677c5=events[_0x27f535];var _0x446192=createListener(_0x3f60('0x8')+_0x2677c5,_0x395eb8);PluginEvents['on'](_0x2677c5,_0x446192);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 69471ff..9d2d23a 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(_0x284928,_0x1a0987){var _0x5e2de1=function(_0x55c91e){while(--_0x55c91e){_0x284928['push'](_0x284928['shift']());}};_0x5e2de1(++_0x1a0987);}(_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(_0x145faf,_0x5ea4c2){var _0x4202da=function(_0x426201){while(--_0x426201){_0x145faf['push'](_0x145faf['shift']());}};_0x4202da(++_0x5ea4c2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 e72ae7d..a12fdab 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 _0xbb53=['send','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error','stack','name','npm\x20install','info','index','then','reject','motion2','length','catch','show','params','body','script','join','../../files/plugins','cwd','chdir','dirname','dump'];(function(_0x3205f4,_0x1db6b7){var _0x236b4f=function(_0x39c036){while(--_0x39c036){_0x3205f4['push'](_0x3205f4['shift']());}};_0x236b4f(++_0x1db6b7);}(_0xbb53,0x121));var _0x3bb5=function(_0xf59f02,_0x450992){_0xf59f02=_0xf59f02-0x0;var _0x152d7d=_0xbb53[_0xf59f02];return _0x152d7d;};'use strict';var _=require(_0x3bb5('0x0'));var pm2=require(_0x3bb5('0x1'));var logger=require(_0x3bb5('0x2'))(_0x3bb5('0x3'));var path=require(_0x3bb5('0x4'));var exec=require(_0x3bb5('0x5'))[_0x3bb5('0x6')];var BPromise=require(_0x3bb5('0x7'));function handleEntityNotFound(_0x83e44b,_0x450d9e){return function(_0x55fdaf){if(!_0x55fdaf){_0x83e44b['sendStatus'](0x194);;}return _0x55fdaf;};}function respondWithResult(_0x23f11e,_0x2460b0){_0x2460b0=_0x2460b0||0xc8;return function(_0x28aa7d){if(_0x28aa7d){return _0x23f11e[_0x3bb5('0x8')](_0x2460b0)[_0x3bb5('0x9')](_0x28aa7d);}return null;};}function handleError(_0x480f9c,_0x5a4ae3){_0x5a4ae3=_0x5a4ae3||0x1f4;return function(_0x4cfdd7){logger[_0x3bb5('0xa')](_0x4cfdd7[_0x3bb5('0xb')]);if(_0x4cfdd7[_0x3bb5('0xc')]){delete _0x4cfdd7['name'];}_0x480f9c[_0x3bb5('0x8')](_0x5a4ae3)['send'](_0x4cfdd7);};}function execChildProcess(){return new BPromise(function(_0x53af18,_0xd8d9bf){exec(_0x3bb5('0xd'),function(_0x5cfc6b,_0xe00ace,_0x511e41){logger[_0x3bb5('0xe')](_0xe00ace);logger['info'](_0x511e41);if(_0x5cfc6b){logger['error'](_0x5cfc6b);return _0xd8d9bf(_0x5cfc6b);}return _0x53af18(_0xe00ace);});});}exports[_0x3bb5('0xf')]=function(_0x35a99b,_0x1e46a5){return pm2['list']()[_0x3bb5('0x10')](function(_0x12e409){if(_0x12e409){var _0x519123=_[_0x3bb5('0x11')](_0x12e409,function(_0x15c369){return _0x15c369['name']==='express'||_0x15c369['name']===_0x3bb5('0x12');});return{'rows':_0x519123,'count':_0x519123[_0x3bb5('0x13')]};}return null;})['then'](respondWithResult(_0x1e46a5,null))[_0x3bb5('0x14')](handleError(_0x1e46a5,null));};exports[_0x3bb5('0x15')]=function(_0x4656c4,_0x262059){return pm2['describe'](_0x4656c4[_0x3bb5('0x16')]['id'])[_0x3bb5('0x10')](respondWithResult(_0x262059,null))[_0x3bb5('0x10')](handleEntityNotFound(_0x262059,null))['catch'](handleError(_0x262059,null));};exports['create']=function(_0x19b177,_0x478021){if(_0x19b177[_0x3bb5('0x17')]['name']&&_0x19b177[_0x3bb5('0x17')][_0x3bb5('0x18')]){var _0x3f94ad=path[_0x3bb5('0x19')](__dirname,_0x3bb5('0x1a'),_0x19b177[_0x3bb5('0x17')]['script']);var _0x37444e=process[_0x3bb5('0x1b')]();process[_0x3bb5('0x1c')](path[_0x3bb5('0x1d')](_0x3f94ad));return execChildProcess()[_0x3bb5('0x10')](function(_0xfb9e8){process[_0x3bb5('0x1c')](_0x37444e);return pm2['start']({'name':_0x19b177[_0x3bb5('0x17')][_0x3bb5('0xc')],'script':_0x3f94ad});})['then'](function(_0x4fc81b){pm2[_0x3bb5('0x1e')]();return _0x4fc81b[0x0];})[_0x3bb5('0x10')](respondWithResult(_0x478021,0xc9))['catch'](handleError(_0x478021,null));}else{return _0x478021['status'](0x1f4)[_0x3bb5('0x1f')]({'message':_0x3bb5('0x20')});}};exports[_0x3bb5('0x21')]=function(_0xc1c149,_0x57abf4){if(_0xc1c149['body']['id']){delete _0xc1c149[_0x3bb5('0x17')]['id'];}var _0x4e8c65={'online':_0x3bb5('0x22'),'stopped':_0x3bb5('0x23')};if(_0x4e8c65[_0x3bb5('0x24')](_0xc1c149['body']['status'])){return pm2[_0x4e8c65[_0xc1c149[_0x3bb5('0x17')][_0x3bb5('0x8')]]](_0xc1c149[_0x3bb5('0x16')]['id'])[_0x3bb5('0x10')](respondWithResult(_0x57abf4,0xc8))[_0x3bb5('0x14')](handleError(_0x57abf4,null));}else{return _0x57abf4[_0x3bb5('0x8')](0x1f4)[_0x3bb5('0x1f')]({'message':'Unknown\x20status'});}};exports[_0x3bb5('0x25')]=function(_0xa643c9,_0x5ebd0a){if(_0xa643c9[_0x3bb5('0x17')]['id']){delete _0xa643c9[_0x3bb5('0x17')]['id'];}if(_0xa643c9[_0x3bb5('0x16')]['id']){return pm2[_0x3bb5('0x26')](_0xa643c9['params']['id'])[_0x3bb5('0x10')](function(_0x25ba4c){pm2['dump']();return _0x25ba4c[0x0];})[_0x3bb5('0x10')](respondWithResult(_0x5ebd0a,null))[_0x3bb5('0x14')](handleError(_0x5ebd0a,null));}else{return _0x5ebd0a[_0x3bb5('0x8')](0x1f4)[_0x3bb5('0x1f')]({'message':_0x3bb5('0x27')});}}; \ No newline at end of file +var _0xeffd=['dump','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','npm\x20install','info','then','reject','express','motion2','length','params','catch','create','body','script','cwd','dirname','start','Missing\x20name\x20and/or\x20path','update','stop','hasOwnProperty'];(function(_0x9fe241,_0x45d6ea){var _0x20d722=function(_0x5d3395){while(--_0x5d3395){_0x9fe241['push'](_0x9fe241['shift']());}};_0x20d722(++_0x45d6ea);}(_0xeffd,0x6b));var _0xdeff=function(_0x2770e6,_0x174f56){_0x2770e6=_0x2770e6-0x0;var _0x59684a=_0xeffd[_0x2770e6];return _0x59684a;};'use strict';var _=require(_0xdeff('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xdeff('0x1'))(_0xdeff('0x2'));var path=require(_0xdeff('0x3'));var exec=require(_0xdeff('0x4'))[_0xdeff('0x5')];var BPromise=require(_0xdeff('0x6'));function handleEntityNotFound(_0x298274,_0x2881fd){return function(_0x8315d4){if(!_0x8315d4){_0x298274[_0xdeff('0x7')](0x194);;}return _0x8315d4;};}function respondWithResult(_0x1ed641,_0x132631){_0x132631=_0x132631||0xc8;return function(_0x281ad7){if(_0x281ad7){return _0x1ed641[_0xdeff('0x8')](_0x132631)[_0xdeff('0x9')](_0x281ad7);}return null;};}function handleError(_0x12e953,_0x24897a){_0x24897a=_0x24897a||0x1f4;return function(_0x540ae6){logger[_0xdeff('0xa')](_0x540ae6[_0xdeff('0xb')]);if(_0x540ae6[_0xdeff('0xc')]){delete _0x540ae6['name'];}_0x12e953[_0xdeff('0x8')](_0x24897a)[_0xdeff('0xd')](_0x540ae6);};}function execChildProcess(){return new BPromise(function(_0x3c1482,_0x192195){exec(_0xdeff('0xe'),function(_0x256b73,_0x2e9783,_0x402075){logger['info'](_0x2e9783);logger[_0xdeff('0xf')](_0x402075);if(_0x256b73){logger[_0xdeff('0xa')](_0x256b73);return _0x192195(_0x256b73);}return _0x3c1482(_0x2e9783);});});}exports['index']=function(_0x2e614c,_0x4e7526){return pm2['list']()[_0xdeff('0x10')](function(_0x47410f){if(_0x47410f){var _0x1585e8=_[_0xdeff('0x11')](_0x47410f,function(_0x48f0e8){return _0x48f0e8[_0xdeff('0xc')]===_0xdeff('0x12')||_0x48f0e8[_0xdeff('0xc')]===_0xdeff('0x13');});return{'rows':_0x1585e8,'count':_0x1585e8[_0xdeff('0x14')]};}return null;})[_0xdeff('0x10')](respondWithResult(_0x4e7526,null))['catch'](handleError(_0x4e7526,null));};exports['show']=function(_0x7440af,_0x4cf724){return pm2['describe'](_0x7440af[_0xdeff('0x15')]['id'])[_0xdeff('0x10')](respondWithResult(_0x4cf724,null))['then'](handleEntityNotFound(_0x4cf724,null))[_0xdeff('0x16')](handleError(_0x4cf724,null));};exports[_0xdeff('0x17')]=function(_0x1ab1fa,_0x3a677a){if(_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0xc')]&&_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0x19')]){var _0x488faa=path['join'](__dirname,'../../files/plugins',_0x1ab1fa[_0xdeff('0x18')]['script']);var _0x189627=process[_0xdeff('0x1a')]();process['chdir'](path[_0xdeff('0x1b')](_0x488faa));return execChildProcess()[_0xdeff('0x10')](function(_0x4eb2a8){process['chdir'](_0x189627);return pm2[_0xdeff('0x1c')]({'name':_0x1ab1fa[_0xdeff('0x18')][_0xdeff('0xc')],'script':_0x488faa});})[_0xdeff('0x10')](function(_0x32add9){pm2['dump']();return _0x32add9[0x0];})[_0xdeff('0x10')](respondWithResult(_0x3a677a,0xc9))[_0xdeff('0x16')](handleError(_0x3a677a,null));}else{return _0x3a677a[_0xdeff('0x8')](0x1f4)[_0xdeff('0xd')]({'message':_0xdeff('0x1d')});}};exports[_0xdeff('0x1e')]=function(_0x3d0111,_0x52ea5d){if(_0x3d0111[_0xdeff('0x18')]['id']){delete _0x3d0111[_0xdeff('0x18')]['id'];}var _0x53b168={'online':'restart','stopped':_0xdeff('0x1f')};if(_0x53b168[_0xdeff('0x20')](_0x3d0111[_0xdeff('0x18')][_0xdeff('0x8')])){return pm2[_0x53b168[_0x3d0111[_0xdeff('0x18')][_0xdeff('0x8')]]](_0x3d0111[_0xdeff('0x15')]['id'])['then'](respondWithResult(_0x52ea5d,0xc8))[_0xdeff('0x16')](handleError(_0x52ea5d,null));}else{return _0x52ea5d[_0xdeff('0x8')](0x1f4)[_0xdeff('0xd')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x346743,_0x505e3f){if(_0x346743[_0xdeff('0x18')]['id']){delete _0x346743[_0xdeff('0x18')]['id'];}if(_0x346743[_0xdeff('0x15')]['id']){return pm2['delete'](_0x346743[_0xdeff('0x15')]['id'])['then'](function(_0x4ba2b2){pm2[_0xdeff('0x21')]();return _0x4ba2b2[0x0];})[_0xdeff('0x10')](respondWithResult(_0x505e3f,null))[_0xdeff('0x16')](handleError(_0x505e3f,null));}else{return _0x505e3f[_0xdeff('0x8')](0x1f4)['send']({'message':_0xdeff('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 87c7367..3793ae1 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 _0x3cd0=['express','./realtime.controller','/queues','isAuthenticated','getQueues','exports'];(function(_0x51c9a4,_0x4a3447){var _0x17050c=function(_0x5b0b1e){while(--_0x5b0b1e){_0x51c9a4['push'](_0x51c9a4['shift']());}};_0x17050c(++_0x4a3447);}(_0x3cd0,0x8a));var _0x03cd=function(_0x2ff762,_0x342c0b){_0x2ff762=_0x2ff762-0x0;var _0x158b02=_0x3cd0[_0x2ff762];return _0x158b02;};'use strict';var express=require(_0x03cd('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x03cd('0x1'));router['get'](_0x03cd('0x2'),auth[_0x03cd('0x3')](),controller[_0x03cd('0x4')]);module[_0x03cd('0x5')]=router; \ No newline at end of file +var _0x19c9=['/queues','isAuthenticated','exports','express','../../components/auth/service','./realtime.controller'];(function(_0xae1a83,_0x1980d4){var _0xdb9da8=function(_0x36fc99){while(--_0x36fc99){_0xae1a83['push'](_0xae1a83['shift']());}};_0xdb9da8(++_0x1980d4);}(_0x19c9,0x1bf));var _0x919c=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x19c9[_0x710815];return _0x5b3b89;};'use strict';var express=require(_0x919c('0x0'));var router=express['Router']();var auth=require(_0x919c('0x1'));var controller=require(_0x919c('0x2'));router['get'](_0x919c('0x3'),auth[_0x919c('0x4')](),controller['getQueues']);module[_0x919c('0x5')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 8e2987e..1cceb81 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 _0xf072=['online','getMembers','length','UserId','loggedInDb','User','startCase','Pause','findAll','QueueId','agent','all','catch','util','lodash','jayson/promise','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','error','stack','name','send','getQueues','chat','openchannel','fax','whatsapp','voice','resolve','query','includes','channel','toLowerCase','Invalid\x20channel','Queue','map','fieldName','type','key','user','role','userProfileId','QueueCampaigns','Queues','filter','UserProfile','getResources','findAndCountAll','then','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','talking','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','paused','waiting','agents','find','merge','pick'];(function(_0x1e8d67,_0x4fb3de){var _0x2475d6=function(_0x395bcd){while(--_0x395bcd){_0x1e8d67['push'](_0x1e8d67['shift']());}};_0x2475d6(++_0x4fb3de);}(_0xf072,0x1cf));var _0x2f07=function(_0x313e42,_0x2cfb7e){_0x313e42=_0x313e42-0x0;var _0x2907f5=_0xf072[_0x313e42];return _0x2907f5;};'use strict';var util=require(_0x2f07('0x0'));var _=require(_0x2f07('0x1'));var jayson=require(_0x2f07('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x2f07('0x3'))('api');var db=require(_0x2f07('0x4'))['db'];var client=jayson[_0x2f07('0x5')][_0x2f07('0x6')]({'port':0x232a});var routingClient=jayson['client'][_0x2f07('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x14d6e6,_0x3643bb){return function(_0x2e6422){if(_0x2e6422){var _0x235418=typeof _0x3643bb[_0x2f07('0x7')]===_0x2f07('0x8')&&typeof _0x3643bb[_0x2f07('0x9')]===_0x2f07('0x8');var _0x2e167=_0x2e6422[_0x2f07('0xa')];var _0x2e372c=_0x235418?0x0:_0x3643bb[_0x2f07('0x7')];var _0x18fe13=_0x235418?_0x2e6422[_0x2f07('0xa')]:_0x3643bb['offset']+_0x3643bb[_0x2f07('0x9')];var _0x2f464b;if(_0x18fe13>=_0x2e167){_0x18fe13=_0x2e167;_0x2f464b=0xc8;}else{_0x2f464b=0xce;}_0x14d6e6[_0x2f07('0xb')](_0x2f464b);return _0x14d6e6[_0x2f07('0xc')]('Content-Range',_0x2e372c+'-'+_0x18fe13+'/'+_0x2e167)['json'](_0x2e6422);}return null;};}function handleError(_0x3dd0cf,_0x1e291d){_0x1e291d=_0x1e291d||0x1f4;return function(_0x58549c){logger[_0x2f07('0xd')](_0x58549c[_0x2f07('0xe')]);if(_0x58549c[_0x2f07('0xf')]){delete _0x58549c['name'];}_0x3dd0cf[_0x2f07('0xb')](_0x1e291d)[_0x2f07('0x10')](_0x58549c);};}exports[_0x2f07('0x11')]=function(_0xe2ffb7,_0x254dbb){var _0x309908=['mail',_0x2f07('0x12'),'sms',_0x2f07('0x13'),_0x2f07('0x14'),_0x2f07('0x15'),_0x2f07('0x16')];var _0x1ec70d={'count':0x0,'rows':[]},_0x46c9b4={},_0x1a6135;Promise[_0x2f07('0x17')]()['then'](function(){if(_0xe2ffb7[_0x2f07('0x18')]['channel']){if(!_[_0x2f07('0x19')](_0x309908,_0xe2ffb7[_0x2f07('0x18')][_0x2f07('0x1a')][_0x2f07('0x1b')]()))throw new Error(_0x2f07('0x1c'));_0x1a6135=_0xe2ffb7['query'][_0x2f07('0x1a')]['toLowerCase']();}var _0x5db56b=_['startCase'](_0x1a6135)+_0x2f07('0x1d');var _0x51c285=_[_0x2f07('0x1e')](db[_0x5db56b]['rawAttributes'],function(_0x354ee2){return{'name':_0x354ee2[_0x2f07('0x1f')],'type':_0x354ee2[_0x2f07('0x20')][_0x2f07('0x21')]};});_0x46c9b4=qs['getOptions'](_0x51c285,_0xe2ffb7);if(_0xe2ffb7[_0x2f07('0x22')][_0x2f07('0x23')]===_0x2f07('0x22')){var _0x5cfa32={'params':{'id':_0xe2ffb7[_0x2f07('0x22')][_0x2f07('0x24')]},'query':{'section':_0x1a6135==='voice'&&_0xe2ffb7[_0x2f07('0x18')][_0x2f07('0x20')]==='outbound'?_0x2f07('0x25'):_['startCase'](_0x1a6135)+_0x2f07('0x26'),'type':_0xe2ffb7[_0x2f07('0x18')][_0x2f07('0x20')],'nolimit':!![],'sort':_0x2f07('0xf'),'filter':_0xe2ffb7[_0x2f07('0x18')][_0x2f07('0x27')]}};return db[_0x2f07('0x28')][_0x2f07('0x29')](_0x5cfa32);}return db[_0x5db56b][_0x2f07('0x2a')](_0x46c9b4);})[_0x2f07('0x2b')](function(_0x3b4e2f){_0x1ec70d[_0x2f07('0xa')]=_0x3b4e2f['count'];var _0x1accef=_0x1a6135===_0x2f07('0x16')?client:routingClient;return _0x1accef[_0x2f07('0x2c')](_['startCase'](_0x1a6135)+_0x2f07('0x26'),_0xe2ffb7)[_0x2f07('0x2b')](function(_0x115c97){if(_0x115c97['error'])throw new Error(util[_0x2f07('0x2d')](_0x2f07('0x2e'),_0x1a6135));var _0xee6a27=_0x115c97[_0x2f07('0x2f')];var _0x3802b9=[_0x2f07('0x30'),_0x2f07('0x31'),'waiting',_0x2f07('0x32'),'paused'];if(_0x1a6135===_0x2f07('0x16')&&_0xe2ffb7[_0x2f07('0x18')][_0x2f07('0x20')]===_0x2f07('0x33')){_0x3802b9[_0x2f07('0x34')](_0x2f07('0x35'),_0x2f07('0x36'),_0x2f07('0x37'),_0x2f07('0x38'),_0x2f07('0x39'),_0x2f07('0x3a'),_0x2f07('0x3b'),_0x2f07('0x3c'),_0x2f07('0x3d'),_0x2f07('0x3e'),_0x2f07('0x3f'),'erlangBusyFactor','dialPredictiveInterval',_0x2f07('0x40'),_0x2f07('0x41'),_0x2f07('0x42'),'predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls',_0x2f07('0x43'),'predictiveIntervalDroppedCallsCallersExit',_0x2f07('0x44'),_0x2f07('0x45'));}var _0xb62610=_0x3b4e2f[_0x2f07('0x46')][_0x2f07('0x1e')](function(_0x52ead8){var _0x45fe2f=_0x52ead8['get']({'plain':!![]});_0x45fe2f[_0x2f07('0x47')]=0x0;_0x45fe2f['loggedInDb']=0x0;_0x45fe2f[_0x2f07('0x30')]=0x0;_0x45fe2f['available']=0x0;_0x45fe2f['paused']=0x0;_0x45fe2f[_0x2f07('0x48')]=0x0;if(_0x1a6135===_0x2f07('0x16')){_0x45fe2f['talking']=0x0;if(_0xe2ffb7[_0x2f07('0x18')][_0x2f07('0x20')]===_0x2f07('0x33')){_0x45fe2f['pTalking']=0x0;_0x45fe2f[_0x2f07('0x36')]=0x0;}}_0x45fe2f[_0x2f07('0x49')]=[];var _0x42e6da=_[_0x2f07('0x4a')](_0xee6a27[_0x2f07('0x46')],['id',_0x45fe2f['id']]);if(_0x42e6da)_[_0x2f07('0x4b')](_0x45fe2f,_[_0x2f07('0x4c')](_0x42e6da,_0x3802b9));if(_0x1a6135===_0x2f07('0x16')){return _0x52ead8['getAgents']({'attributes':['id',_0x2f07('0xf'),_0x2f07('0x4d')],'joinTableAttributes':[],'raw':!![]})[_0x2f07('0x2b')](function(_0x3f1b6b){return _0x52ead8[_0x2f07('0x4e')]({'raw':!![]})[_0x2f07('0x2b')](function(_0x5129c){for(var _0x5879ce=0x0;_0x5879ce<_0x3f1b6b[_0x2f07('0x4f')];_0x5879ce++){var _0xb43346=_[_0x2f07('0x4a')](_0x5129c,[_0x2f07('0x50'),_0x3f1b6b[_0x5879ce]['id']]);var _0x3db7ad={'id':_0x3f1b6b[_0x5879ce]['id'],'name':_0x3f1b6b[_0x5879ce][_0x2f07('0xf')],'online':Boolean(_0x3f1b6b[_0x5879ce]['online']),'paused':_0xb43346?Boolean(_0xb43346[_0x2f07('0x47')]):![]};if(_0x3db7ad[_0x2f07('0x4d')])_0x45fe2f[_0x2f07('0x51')]++;if(_0x3db7ad[_0x2f07('0x47')])_0x45fe2f['paused']++;_0x45fe2f['agents'][_0x2f07('0x34')](_0x3db7ad);}return _0x45fe2f;});});}else{var _0x437e94=_0x2f07('0x52')+_[_0x2f07('0x53')](_0x1a6135)+'Queue';var _0x312299=_0x1a6135+_0x2f07('0x54');return db[_0x437e94][_0x2f07('0x55')]({'where':{[_[_0x2f07('0x53')](_0x1a6135)+_0x2f07('0x56')]:_0x52ead8['id']},'raw':!![]})[_0x2f07('0x2b')](function(_0x9c7076){return db[_0x2f07('0x52')][_0x2f07('0x55')]({'attributes':['id',_0x2f07('0xf'),'online',_0x312299],'where':{'id':_['map'](_0x9c7076,'UserId'),'role':_0x2f07('0x57')},'raw':!![]});})[_0x2f07('0x2b')](function(_0x5a4963){for(var _0x97c166=0x0;_0x97c166<_0x5a4963['length'];_0x97c166++){var _0x3a7159={'id':_0x5a4963[_0x97c166]['id'],'name':_0x5a4963[_0x97c166][_0x2f07('0xf')],'online':Boolean(_0x5a4963[_0x97c166][_0x2f07('0x4d')]),'paused':Boolean(_0x5a4963[_0x97c166][_0x312299])};if(_0x3a7159['online'])_0x45fe2f[_0x2f07('0x51')]++;if(_0x3a7159[_0x2f07('0x47')])_0x45fe2f['paused']++;_0x45fe2f['agents'][_0x2f07('0x34')](_0x3a7159);}return _0x45fe2f;});}});return Promise[_0x2f07('0x58')](_0xb62610);});})[_0x2f07('0x2b')](function(_0x363245){_0x1ec70d[_0x2f07('0x46')]=_0x363245;return _0x1ec70d;})[_0x2f07('0x2b')](respondWithFilteredResult(_0x254dbb,_0x46c9b4))[_0x2f07('0x59')](handleError(_0x254dbb,null));}; \ No newline at end of file +var _0x2a07=['dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','paused','loggedInDb','find','merge','online','getMembers','length','UserId','User','Pause','findAll','agent','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','../../mysqldb','client','http','offset','undefined','limit','count','status','set','Content-Range','error','stack','name','getQueues','mail','chat','openchannel','fax','whatsapp','voice','resolve','then','channel','includes','query','Invalid\x20channel','toLowerCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','outbound','QueueCampaigns','startCase','Queues','filter','UserProfile','getResources','findAndCountAll','request','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','push','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval'];(function(_0x2f8c3d,_0x3eff73){var _0x185933=function(_0x14a8a0){while(--_0x14a8a0){_0x2f8c3d['push'](_0x2f8c3d['shift']());}};_0x185933(++_0x3eff73);}(_0x2a07,0x74));var _0x72a0=function(_0x215ea3,_0x24d78){_0x215ea3=_0x215ea3-0x0;var _0x542d1d=_0x2a07[_0x215ea3];return _0x542d1d;};'use strict';var util=require(_0x72a0('0x0'));var _=require(_0x72a0('0x1'));var jayson=require(_0x72a0('0x2'));var qs=require(_0x72a0('0x3'));var logger=require(_0x72a0('0x4'))('api');var db=require(_0x72a0('0x5'))['db'];var client=jayson[_0x72a0('0x6')][_0x72a0('0x7')]({'port':0x232a});var routingClient=jayson[_0x72a0('0x6')][_0x72a0('0x7')]({'port':0x232c});function respondWithFilteredResult(_0xce74c,_0x3ccf6d){return function(_0x20dab9){if(_0x20dab9){var _0x193e3b=typeof _0x3ccf6d[_0x72a0('0x8')]===_0x72a0('0x9')&&typeof _0x3ccf6d[_0x72a0('0xa')]===_0x72a0('0x9');var _0x1d32e9=_0x20dab9[_0x72a0('0xb')];var _0x2bc45b=_0x193e3b?0x0:_0x3ccf6d['offset'];var _0x169dc2=_0x193e3b?_0x20dab9[_0x72a0('0xb')]:_0x3ccf6d['offset']+_0x3ccf6d[_0x72a0('0xa')];var _0x194488;if(_0x169dc2>=_0x1d32e9){_0x169dc2=_0x1d32e9;_0x194488=0xc8;}else{_0x194488=0xce;}_0xce74c[_0x72a0('0xc')](_0x194488);return _0xce74c[_0x72a0('0xd')](_0x72a0('0xe'),_0x2bc45b+'-'+_0x169dc2+'/'+_0x1d32e9)['json'](_0x20dab9);}return null;};}function handleError(_0x130797,_0x335b9f){_0x335b9f=_0x335b9f||0x1f4;return function(_0x123ca4){logger[_0x72a0('0xf')](_0x123ca4[_0x72a0('0x10')]);if(_0x123ca4[_0x72a0('0x11')]){delete _0x123ca4[_0x72a0('0x11')];}_0x130797['status'](_0x335b9f)['send'](_0x123ca4);};}exports[_0x72a0('0x12')]=function(_0x3cd89f,_0x19eaf9){var _0x1d1133=[_0x72a0('0x13'),_0x72a0('0x14'),'sms',_0x72a0('0x15'),_0x72a0('0x16'),_0x72a0('0x17'),_0x72a0('0x18')];var _0x2d1e95={'count':0x0,'rows':[]},_0x54495e={},_0x100d8f;Promise[_0x72a0('0x19')]()[_0x72a0('0x1a')](function(){if(_0x3cd89f['query'][_0x72a0('0x1b')]){if(!_[_0x72a0('0x1c')](_0x1d1133,_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x1b')]['toLowerCase']()))throw new Error(_0x72a0('0x1e'));_0x100d8f=_0x3cd89f['query'][_0x72a0('0x1b')][_0x72a0('0x1f')]();}var _0xde058c=_['startCase'](_0x100d8f)+_0x72a0('0x20');var _0x1849d1=_[_0x72a0('0x21')](db[_0xde058c][_0x72a0('0x22')],function(_0x5d6145){return{'name':_0x5d6145[_0x72a0('0x23')],'type':_0x5d6145[_0x72a0('0x24')][_0x72a0('0x25')]};});_0x54495e=qs[_0x72a0('0x26')](_0x1849d1,_0x3cd89f);if(_0x3cd89f[_0x72a0('0x27')][_0x72a0('0x28')]==='user'){var _0x4dd1a6={'params':{'id':_0x3cd89f[_0x72a0('0x27')][_0x72a0('0x29')]},'query':{'section':_0x100d8f===_0x72a0('0x18')&&_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x24')]===_0x72a0('0x2a')?_0x72a0('0x2b'):_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x2d'),'type':_0x3cd89f[_0x72a0('0x1d')]['type'],'nolimit':!![],'sort':_0x72a0('0x11'),'filter':_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x2e')]}};return db[_0x72a0('0x2f')][_0x72a0('0x30')](_0x4dd1a6);}return db[_0xde058c][_0x72a0('0x31')](_0x54495e);})[_0x72a0('0x1a')](function(_0x12eda2){_0x2d1e95[_0x72a0('0xb')]=_0x12eda2[_0x72a0('0xb')];var _0x4ba037=_0x100d8f===_0x72a0('0x18')?client:routingClient;return _0x4ba037[_0x72a0('0x32')](_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x2d'),_0x3cd89f)[_0x72a0('0x1a')](function(_0x19e783){if(_0x19e783[_0x72a0('0xf')])throw new Error(util['format'](_0x72a0('0x33'),_0x100d8f));var _0x2c884f=_0x19e783[_0x72a0('0x34')];var _0x197591=[_0x72a0('0x35'),_0x72a0('0x36'),_0x72a0('0x37'),_0x72a0('0x38'),'paused'];if(_0x100d8f===_0x72a0('0x18')&&_0x3cd89f[_0x72a0('0x1d')][_0x72a0('0x24')]==='outbound'){_0x197591[_0x72a0('0x39')]('pTalking',_0x72a0('0x3a'),_0x72a0('0x3b'),_0x72a0('0x3c'),_0x72a0('0x3d'),_0x72a0('0x3e'),_0x72a0('0x3f'),_0x72a0('0x40'),_0x72a0('0x41'),_0x72a0('0x42'),_0x72a0('0x43'),_0x72a0('0x44'),_0x72a0('0x45'),'dialPredictiveIntervalMaxThreshold',_0x72a0('0x46'),'predictiveIntervalAvailable',_0x72a0('0x47'),_0x72a0('0x48'),_0x72a0('0x49'),_0x72a0('0x4a'),_0x72a0('0x4b'),_0x72a0('0x4c'));}var _0x90b437=_0x12eda2[_0x72a0('0x4d')][_0x72a0('0x21')](function(_0x4c1f43){var _0x4a973a=_0x4c1f43[_0x72a0('0x4e')]({'plain':!![]});_0x4a973a[_0x72a0('0x4f')]=0x0;_0x4a973a[_0x72a0('0x50')]=0x0;_0x4a973a[_0x72a0('0x35')]=0x0;_0x4a973a[_0x72a0('0x36')]=0x0;_0x4a973a['paused']=0x0;_0x4a973a[_0x72a0('0x37')]=0x0;if(_0x100d8f===_0x72a0('0x18')){_0x4a973a['talking']=0x0;if(_0x3cd89f[_0x72a0('0x1d')]['type']==='outbound'){_0x4a973a['pTalking']=0x0;_0x4a973a[_0x72a0('0x3a')]=0x0;}}_0x4a973a['agents']=[];var _0x44b47b=_[_0x72a0('0x51')](_0x2c884f[_0x72a0('0x4d')],['id',_0x4a973a['id']]);if(_0x44b47b)_[_0x72a0('0x52')](_0x4a973a,_['pick'](_0x44b47b,_0x197591));if(_0x100d8f==='voice'){return _0x4c1f43['getAgents']({'attributes':['id','name',_0x72a0('0x53')],'joinTableAttributes':[],'raw':!![]})[_0x72a0('0x1a')](function(_0x4a7032){return _0x4c1f43[_0x72a0('0x54')]({'raw':!![]})[_0x72a0('0x1a')](function(_0x49414d){for(var _0x2a8ddf=0x0;_0x2a8ddf<_0x4a7032[_0x72a0('0x55')];_0x2a8ddf++){var _0x45cfbd=_[_0x72a0('0x51')](_0x49414d,[_0x72a0('0x56'),_0x4a7032[_0x2a8ddf]['id']]);var _0x341451={'id':_0x4a7032[_0x2a8ddf]['id'],'name':_0x4a7032[_0x2a8ddf]['name'],'online':Boolean(_0x4a7032[_0x2a8ddf][_0x72a0('0x53')]),'paused':_0x45cfbd?Boolean(_0x45cfbd['paused']):![]};if(_0x341451[_0x72a0('0x53')])_0x4a973a['loggedInDb']++;if(_0x341451[_0x72a0('0x4f')])_0x4a973a[_0x72a0('0x4f')]++;_0x4a973a['agents'][_0x72a0('0x39')](_0x341451);}return _0x4a973a;});});}else{var _0x506d65=_0x72a0('0x57')+_[_0x72a0('0x2c')](_0x100d8f)+_0x72a0('0x20');var _0x4afdd1=_0x100d8f+_0x72a0('0x58');return db[_0x506d65][_0x72a0('0x59')]({'where':{[_[_0x72a0('0x2c')](_0x100d8f)+'QueueId']:_0x4c1f43['id']},'raw':!![]})['then'](function(_0x117fd3){return db['User'][_0x72a0('0x59')]({'attributes':['id',_0x72a0('0x11'),_0x72a0('0x53'),_0x4afdd1],'where':{'id':_[_0x72a0('0x21')](_0x117fd3,_0x72a0('0x56')),'role':_0x72a0('0x5a')},'raw':!![]});})[_0x72a0('0x1a')](function(_0x2f068c){for(var _0x2efa92=0x0;_0x2efa92<_0x2f068c['length'];_0x2efa92++){var _0x4fae3d={'id':_0x2f068c[_0x2efa92]['id'],'name':_0x2f068c[_0x2efa92][_0x72a0('0x11')],'online':Boolean(_0x2f068c[_0x2efa92][_0x72a0('0x53')]),'paused':Boolean(_0x2f068c[_0x2efa92][_0x4afdd1])};if(_0x4fae3d[_0x72a0('0x53')])_0x4a973a[_0x72a0('0x50')]++;if(_0x4fae3d[_0x72a0('0x4f')])_0x4a973a[_0x72a0('0x4f')]++;_0x4a973a['agents']['push'](_0x4fae3d);}return _0x4a973a;});}});return Promise[_0x72a0('0x5b')](_0x90b437);});})[_0x72a0('0x1a')](function(_0xe38fb3){_0x2d1e95[_0x72a0('0x4d')]=_0xe38fb3;return _0x2d1e95;})[_0x72a0('0x1a')](respondWithFilteredResult(_0x19eaf9,_0x54495e))[_0x72a0('0x5c')](handleError(_0x19eaf9,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index d133efe..3c674c2 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x365a40,_0x5c073e){var _0x1dd6d5=function(_0x2a1932){while(--_0x2a1932){_0x365a40['push'](_0x365a40['shift']());}};_0x1dd6d5(++_0x5c073e);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index badeccb..4139fd3 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 _0x3c94=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x4277f3,_0x598ea1){var _0x5c1832=function(_0x47e314){while(--_0x47e314){_0x4277f3['push'](_0x4277f3['shift']());}};_0x5c1832(++_0x598ea1);}(_0x3c94,0xcd));var _0x43c9=function(_0x471268,_0x5ce885){_0x471268=_0x471268-0x0;var _0x1298f3=_0x3c94[_0x471268];return _0x1298f3;};'use strict';var Sequelize=require(_0x43c9('0x0'));module[_0x43c9('0x1')]={'state':{'type':Sequelize[_0x43c9('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x43c9('0x3')]},'scheduledat':{'type':Sequelize[_0x43c9('0x4')]},'uniqueid':{'type':Sequelize[_0x43c9('0x3')]},'starttime':{'type':Sequelize[_0x43c9('0x4')]},'responsetime':{'type':Sequelize[_0x43c9('0x4')]},'ringtime':{'type':Sequelize[_0x43c9('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x43c9('0x3')]},'campaigntype':{'type':Sequelize[_0x43c9('0x3')]},'membername':{'type':Sequelize[_0x43c9('0x3')]}}; \ No newline at end of file +var _0xcde7=['STRING','DATE','INTEGER'];(function(_0x178728,_0x3257cd){var _0x17a2da=function(_0x2bbc66){while(--_0x2bbc66){_0x178728['push'](_0x178728['shift']());}};_0x17a2da(++_0x3257cd);}(_0xcde7,0x65));var _0x7cde=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xcde7[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x7cde('0x0')](0x2)},'statedesc':{'type':Sequelize[_0x7cde('0x1')]},'scheduledat':{'type':Sequelize[_0x7cde('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7cde('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x7cde('0x1')]},'campaigntype':{'type':Sequelize[_0x7cde('0x1')]},'membername':{'type':Sequelize[_0x7cde('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 6f053fa..dcb83a6 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 _0xaf75=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','bluebird','../../config/environment'];(function(_0x19754a,_0x3050aa){var _0x4f8f3f=function(_0x2c3434){while(--_0x2c3434){_0x19754a['push'](_0x19754a['shift']());}};_0x4f8f3f(++_0x3050aa);}(_0xaf75,0x16c));var _0x5af7=function(_0x4fa878,_0x2eb8bc){_0x4fa878=_0x4fa878-0x0;var _0x3eaa08=_0xaf75[_0x4fa878];return _0x3eaa08;};'use strict';var _=require(_0x5af7('0x0'));var util=require(_0x5af7('0x1'));var logger=require(_0x5af7('0x2'))(_0x5af7('0x3'));var moment=require('moment');var BPromise=require(_0x5af7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5af7('0x5'));var attributes=require(_0x5af7('0x6'));module[_0x5af7('0x7')]=function(_0x1e9bd0,_0x2f1408){return _0x1e9bd0[_0x5af7('0x8')](_0x5af7('0x9'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04f2=['./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5c5721,_0x23ed04){var _0x539568=function(_0x2cba73){while(--_0x2cba73){_0x5c5721['push'](_0x5c5721['shift']());}};_0x539568(++_0x23ed04);}(_0x04f2,0x108));var _0x204f=function(_0x483948,_0x1947db){_0x483948=_0x483948-0x0;var _0x1f6146=_0x04f2[_0x483948];return _0x1f6146;};'use strict';var _=require(_0x204f('0x0'));var util=require(_0x204f('0x1'));var logger=require(_0x204f('0x2'))(_0x204f('0x3'));var moment=require(_0x204f('0x4'));var BPromise=require('bluebird');var rp=require(_0x204f('0x5'));var fs=require('fs');var path=require(_0x204f('0x6'));var rimraf=require(_0x204f('0x7'));var config=require(_0x204f('0x8'));var attributes=require(_0x204f('0x9'));module[_0x204f('0xa')]=function(_0xe9ac8f,_0x16ac46){return _0xe9ac8f[_0x204f('0xb')](_0x204f('0xc'),attributes,{'tableName':'report_agent_preview','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 036c5f5..6413945 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 _0xca0e=['body','options','raw','CreateReportAgentPreview','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','create'];(function(_0x37496d,_0xf738a6){var _0x3fc0e9=function(_0x57c4ff){while(--_0x57c4ff){_0x37496d['push'](_0x37496d['shift']());}};_0x3fc0e9(++_0xf738a6);}(_0xca0e,0x1d5));var _0xeca0=function(_0x326cec,_0x35bf07){_0x326cec=_0x326cec-0x0;var _0x44667d=_0xca0e[_0x326cec];return _0x44667d;};'use strict';var _=require('lodash');var util=require(_0xeca0('0x0'));var moment=require(_0xeca0('0x1'));var BPromise=require(_0xeca0('0x2'));var rs=require(_0xeca0('0x3'));var fs=require('fs');var Redis=require(_0xeca0('0x4'));var db=require(_0xeca0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeca0('0x6'));var config=require(_0xeca0('0x7'));var jayson=require(_0xeca0('0x8'));var client=jayson[_0xeca0('0x9')][_0xeca0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37bff4,_0x5479d7,_0x53da56){return new BPromise(function(_0x7544f5,_0xb13abc){return client[_0xeca0('0xb')](_0x37bff4,_0x53da56)[_0xeca0('0xc')](function(_0x3c2021){logger[_0xeca0('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5479d7,_0xeca0('0xe'));logger[_0xeca0('0xf')](_0xeca0('0x10'),_0x5479d7,_0xeca0('0xe'),JSON['stringify'](_0x3c2021));if(_0x3c2021['error']){if(_0x3c2021[_0xeca0('0x11')][_0xeca0('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x5479d7,_0x3c2021['error'][_0xeca0('0x13')]);return _0xb13abc(_0x3c2021[_0xeca0('0x11')][_0xeca0('0x13')]);}logger[_0xeca0('0x11')](_0xeca0('0x14'),_0x5479d7,_0x3c2021[_0xeca0('0x11')][_0xeca0('0x13')]);return _0x7544f5(_0x3c2021[_0xeca0('0x11')]['message']);}else{logger[_0xeca0('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x5479d7,'request\x20sent');_0x7544f5(_0x3c2021[_0xeca0('0x15')][_0xeca0('0x13')]);}})[_0xeca0('0x16')](function(_0x21c4db){logger[_0xeca0('0x11')](_0xeca0('0x14'),_0x5479d7,_0x21c4db);_0xb13abc(_0x21c4db);});});}exports['CreateReportAgentPreview']=function(_0x5e0ccc){var _0x502ad1=this;return new Promise(function(_0x2ebde4,_0x7a08f6){return db['ReportAgentPreview'][_0xeca0('0x17')](_0x5e0ccc[_0xeca0('0x18')],{'raw':_0x5e0ccc[_0xeca0('0x19')]?_0x5e0ccc[_0xeca0('0x19')][_0xeca0('0x1a')]===undefined?!![]:![]:!![]})[_0xeca0('0xc')](function(_0x55817d){logger[_0xeca0('0xd')](_0xeca0('0x1b'),_0x5e0ccc);logger['debug']('CreateReportAgentPreview',_0x5e0ccc,JSON[_0xeca0('0x1c')](_0x55817d));_0x2ebde4(_0x55817d);})[_0xeca0('0x16')](function(_0x4298b7){logger[_0xeca0('0x11')]('CreateReportAgentPreview',_0x4298b7['message'],_0x5e0ccc);_0x7a08f6(_0x502ad1[_0xeca0('0x11')](0x1f4,_0x4298b7[_0xeca0('0x13')]));});});}; \ No newline at end of file +var _0x8091=['then','info','request\x20sent','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','CreateReportAgentPreview','create','options','raw','debug','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x365b2e,_0x4c01a0){var _0x4c2e94=function(_0x9cb498){while(--_0x9cb498){_0x365b2e['push'](_0x365b2e['shift']());}};_0x4c2e94(++_0x4c01a0);}(_0x8091,0x189));var _0x1809=function(_0x301796,_0xcc5d8e){_0x301796=_0x301796-0x0;var _0x1c801c=_0x8091[_0x301796];return _0x1c801c;};'use strict';var _=require(_0x1809('0x0'));var util=require(_0x1809('0x1'));var moment=require('moment');var BPromise=require(_0x1809('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1809('0x3'));var db=require(_0x1809('0x4'))['db'];var utils=require(_0x1809('0x5'));var logger=require('../../config/logger')(_0x1809('0x6'));var config=require(_0x1809('0x7'));var jayson=require(_0x1809('0x8'));var client=jayson[_0x1809('0x9')][_0x1809('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19f572,_0x3b462f,_0x3a3c30){return new BPromise(function(_0x264e54,_0x2c95ff){return client[_0x1809('0xb')](_0x19f572,_0x3a3c30)[_0x1809('0xc')](function(_0x567a93){logger[_0x1809('0xd')]('ReportAgentPreview,\x20%s,\x20%s',_0x3b462f,'request\x20sent');logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3b462f,_0x1809('0xe'),JSON['stringify'](_0x567a93));if(_0x567a93[_0x1809('0xf')]){if(_0x567a93['error'][_0x1809('0x10')]===0x1f4){logger[_0x1809('0xf')](_0x1809('0x11'),_0x3b462f,_0x567a93['error'][_0x1809('0x12')]);return _0x2c95ff(_0x567a93['error'][_0x1809('0x12')]);}logger['error'](_0x1809('0x11'),_0x3b462f,_0x567a93[_0x1809('0xf')][_0x1809('0x12')]);return _0x264e54(_0x567a93[_0x1809('0xf')][_0x1809('0x12')]);}else{logger[_0x1809('0xd')](_0x1809('0x11'),_0x3b462f,_0x1809('0xe'));_0x264e54(_0x567a93[_0x1809('0x13')][_0x1809('0x12')]);}})['catch'](function(_0x2702b6){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3b462f,_0x2702b6);_0x2c95ff(_0x2702b6);});});}exports[_0x1809('0x14')]=function(_0x2cd3df){var _0x372ea5=this;return new Promise(function(_0x22a212,_0x2f2735){return db['ReportAgentPreview'][_0x1809('0x15')](_0x2cd3df['body'],{'raw':_0x2cd3df[_0x1809('0x16')]?_0x2cd3df['options'][_0x1809('0x17')]===undefined?!![]:![]:!![]})[_0x1809('0xc')](function(_0x1edd74){logger['info'](_0x1809('0x14'),_0x2cd3df);logger[_0x1809('0x18')]('CreateReportAgentPreview',_0x2cd3df,JSON[_0x1809('0x19')](_0x1edd74));_0x22a212(_0x1edd74);})[_0x1809('0x1a')](function(_0x3c5543){logger[_0x1809('0xf')](_0x1809('0x14'),_0x3c5543[_0x1809('0x12')],_0x2cd3df);_0x2f2735(_0x372ea5[_0x1809('0xf')](0x1f4,_0x3c5543['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1327bb9..93bafaf 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 _0x228c=['/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','multer','path','Router','../../components/auth/service','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions'];(function(_0xd3694e,_0x5a3670){var _0x3ba0ed=function(_0x540a5d){while(--_0x540a5d){_0xd3694e['push'](_0xd3694e['shift']());}};_0x3ba0ed(++_0x5a3670);}(_0x228c,0x68));var _0xc228=function(_0x11735d,_0x21bdd0){_0x11735d=_0x11735d-0x0;var _0x47543a=_0x228c[_0x11735d];return _0x47543a;};'use strict';var multer=require(_0xc228('0x0'));var util=require('util');var path=require(_0xc228('0x1'));var express=require('express');var router=express[_0xc228('0x2')]();var auth=require(_0xc228('0x3'));var controller=require('./rpc.controller');router['get']('/voice/channels',auth[_0xc228('0x4')](),controller['voiceChannels']);router[_0xc228('0x5')](_0xc228('0x6'),auth[_0xc228('0x4')](),controller[_0xc228('0x7')]);router[_0xc228('0x5')](_0xc228('0x8'),auth[_0xc228('0x4')](),controller[_0xc228('0x9')]);router[_0xc228('0x5')](_0xc228('0xa'),auth[_0xc228('0x4')](),controller['voiceQueues']);router[_0xc228('0x5')](_0xc228('0xb'),auth['isAuthenticated'](),controller[_0xc228('0xc')]);router[_0xc228('0x5')](_0xc228('0xd'),auth['isAuthenticated'](),controller[_0xc228('0xe')]);router[_0xc228('0x5')](_0xc228('0xf'),auth[_0xc228('0x4')](),controller[_0xc228('0x10')]);router[_0xc228('0x5')](_0xc228('0x11'),auth[_0xc228('0x4')](),controller[_0xc228('0x12')]);router['get'](_0xc228('0x13'),auth[_0xc228('0x4')](),controller[_0xc228('0x14')]);router[_0xc228('0x5')](_0xc228('0x15'),auth[_0xc228('0x4')](),controller[_0xc228('0x16')]);router[_0xc228('0x5')]('/fax/queues',auth[_0xc228('0x4')](),controller['faxQueues']);router[_0xc228('0x5')](_0xc228('0x17'),auth[_0xc228('0x4')](),controller[_0xc228('0x18')]);router[_0xc228('0x5')](_0xc228('0x19'),auth[_0xc228('0x4')](),controller[_0xc228('0x1a')]);router[_0xc228('0x5')](_0xc228('0x1b'),auth[_0xc228('0x4')](),controller[_0xc228('0x1c')]);router['get'](_0xc228('0x1d'),auth[_0xc228('0x4')](),controller[_0xc228('0x1e')]);router[_0xc228('0x5')](_0xc228('0x1f'),auth[_0xc228('0x4')](),controller[_0xc228('0x20')]);router[_0xc228('0x5')](_0xc228('0x21'),auth[_0xc228('0x4')](),controller[_0xc228('0x22')]);router[_0xc228('0x23')](_0xc228('0x21'),auth[_0xc228('0x4')](),controller[_0xc228('0x24')]);router[_0xc228('0x5')](_0xc228('0x25'),auth[_0xc228('0x4')](),controller[_0xc228('0x26')]);router[_0xc228('0x5')]('/outbound/channels',auth[_0xc228('0x4')](),controller['outboundChannels']);router['get'](_0xc228('0x27'),auth[_0xc228('0x4')](),controller[_0xc228('0x28')]);router['put'](_0xc228('0x29'),auth[_0xc228('0x4')](),controller[_0xc228('0x2a')]);router['get'](_0xc228('0x2b'),auth[_0xc228('0x4')](),controller[_0xc228('0x2c')]);router[_0xc228('0x5')](_0xc228('0x2d'),auth[_0xc228('0x4')](),controller[_0xc228('0x2e')]);router[_0xc228('0x5')](_0xc228('0x2f'),auth[_0xc228('0x4')](),controller[_0xc228('0x30')]);router[_0xc228('0x5')](_0xc228('0x31'),auth[_0xc228('0x4')](),controller[_0xc228('0x32')]);router[_0xc228('0x5')]('/chat/queues/waitinginteractions',auth[_0xc228('0x4')](),controller[_0xc228('0x33')]);router[_0xc228('0x5')](_0xc228('0x34'),auth[_0xc228('0x4')](),controller[_0xc228('0x35')]);router[_0xc228('0x5')](_0xc228('0x36'),auth[_0xc228('0x4')](),controller[_0xc228('0x37')]);router[_0xc228('0x5')]('/openchannel/queues/:id/waitinginteractions',auth[_0xc228('0x4')](),controller['openchannelQueuesIdWaitingInteractions']);router['get']('/sms/queues/waitinginteractions',auth[_0xc228('0x4')](),controller['smsQueuesWaitingInteractions']);router['get']('/whatsapp/queues/waitinginteractions',auth[_0xc228('0x4')](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0xc228('0x38'),auth[_0xc228('0x4')](),controller[_0xc228('0x39')]);router[_0xc228('0x3a')](_0xc228('0x3b'),auth[_0xc228('0x4')](),controller[_0xc228('0x3c')](_0xc228('0x3d')));router[_0xc228('0x5')]('/mail/queues/:id',auth[_0xc228('0x4')](),controller['showMailQueues']);router[_0xc228('0x3a')](_0xc228('0x3e'),auth['isAuthenticated'](),controller[_0xc228('0x3c')](_0xc228('0x3f')));router[_0xc228('0x5')](_0xc228('0x40'),auth[_0xc228('0x4')](),controller[_0xc228('0x41')]);router[_0xc228('0x3a')](_0xc228('0x42'),auth[_0xc228('0x4')](),controller['queueNotify']('fax'));router['get'](_0xc228('0x43'),auth[_0xc228('0x4')](),controller[_0xc228('0x44')]);router[_0xc228('0x3a')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify']('openchannel'));router['get'](_0xc228('0x45'),auth[_0xc228('0x4')](),controller[_0xc228('0x46')]);router[_0xc228('0x3a')]('/sms/queues/:id/notify',auth[_0xc228('0x4')](),controller[_0xc228('0x3c')](_0xc228('0x47')));router[_0xc228('0x3a')](_0xc228('0x48'),auth[_0xc228('0x4')](),controller[_0xc228('0x3c')](_0xc228('0x49')));router[_0xc228('0x5')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0xc228('0x4a')]);router[_0xc228('0x5')](_0xc228('0x4b'),auth[_0xc228('0x4')](),controller[_0xc228('0x4c')]);router[_0xc228('0x3a')](_0xc228('0x4d'),auth['isAuthenticated'](),controller[_0xc228('0x4e')]);module[_0xc228('0x4f')]=router; \ No newline at end of file +var _0x09d7=['isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','showWhatsappQueues','agentNotify','exports','multer','path','express','Router','get','/voice/channels'];(function(_0x1f71d8,_0x278518){var _0x10b045=function(_0x57aea4){while(--_0x57aea4){_0x1f71d8['push'](_0x1f71d8['shift']());}};_0x10b045(++_0x278518);}(_0x09d7,0x18a));var _0x709d=function(_0x367145,_0x44568f){_0x367145=_0x367145-0x0;var _0x1b5566=_0x09d7[_0x367145];return _0x1b5566;};'use strict';var multer=require(_0x709d('0x0'));var util=require('util');var path=require(_0x709d('0x1'));var express=require(_0x709d('0x2'));var router=express[_0x709d('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x709d('0x4')](_0x709d('0x5'),auth[_0x709d('0x6')](),controller[_0x709d('0x7')]);router['get'](_0x709d('0x8'),auth[_0x709d('0x6')](),controller[_0x709d('0x9')]);router['get'](_0x709d('0xa'),auth[_0x709d('0x6')](),controller[_0x709d('0xb')]);router['get'](_0x709d('0xc'),auth[_0x709d('0x6')](),controller[_0x709d('0xd')]);router[_0x709d('0x4')](_0x709d('0xe'),auth[_0x709d('0x6')](),controller[_0x709d('0xf')]);router[_0x709d('0x4')]('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router[_0x709d('0x4')](_0x709d('0x10'),auth[_0x709d('0x6')](),controller[_0x709d('0x11')]);router[_0x709d('0x4')](_0x709d('0x12'),auth[_0x709d('0x6')](),controller[_0x709d('0x13')]);router[_0x709d('0x4')]('/sms/queues',auth[_0x709d('0x6')](),controller[_0x709d('0x14')]);router[_0x709d('0x4')](_0x709d('0x15'),auth[_0x709d('0x6')](),controller[_0x709d('0x16')]);router[_0x709d('0x4')](_0x709d('0x17'),auth[_0x709d('0x6')](),controller[_0x709d('0x18')]);router[_0x709d('0x4')](_0x709d('0x19'),auth[_0x709d('0x6')](),controller[_0x709d('0x1a')]);router[_0x709d('0x4')](_0x709d('0x1b'),auth[_0x709d('0x6')](),controller['voiceQueuesChannels']);router[_0x709d('0x4')]('/voice/queues/channels/:uniqueid',auth[_0x709d('0x6')](),controller[_0x709d('0x1c')]);router[_0x709d('0x4')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x709d('0x6')](),controller['voiceQueuesChannelHangup']);router[_0x709d('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x709d('0x6')](),controller[_0x709d('0x1d')]);router['get'](_0x709d('0x1e'),auth[_0x709d('0x6')](),controller[_0x709d('0x1f')]);router[_0x709d('0x20')](_0x709d('0x1e'),auth['isAuthenticated'](),controller[_0x709d('0x21')]);router['get']('/outbound',auth[_0x709d('0x6')](),controller[_0x709d('0x22')]);router['get'](_0x709d('0x23'),auth[_0x709d('0x6')](),controller['outboundChannels']);router['get'](_0x709d('0x24'),auth[_0x709d('0x6')](),controller[_0x709d('0x25')]);router['put'](_0x709d('0x26'),auth['isAuthenticated'](),controller[_0x709d('0x27')]);router['get'](_0x709d('0x28'),auth[_0x709d('0x6')](),controller[_0x709d('0x29')]);router[_0x709d('0x4')]('/trunks',auth[_0x709d('0x6')](),controller[_0x709d('0x2a')]);router[_0x709d('0x4')]('/campaigns',auth['isAuthenticated'](),controller[_0x709d('0x2b')]);router[_0x709d('0x4')](_0x709d('0x2c'),auth[_0x709d('0x6')](),controller[_0x709d('0x2d')]);router[_0x709d('0x4')](_0x709d('0x2e'),auth[_0x709d('0x6')](),controller[_0x709d('0x2f')]);router['get']('/mail/queues/waitinginteractions',auth[_0x709d('0x6')](),controller[_0x709d('0x30')]);router[_0x709d('0x4')](_0x709d('0x31'),auth['isAuthenticated'](),controller[_0x709d('0x32')]);router[_0x709d('0x4')]('/openchannel/queues/:id/waitinginteractions',auth[_0x709d('0x6')](),controller[_0x709d('0x33')]);router['get'](_0x709d('0x34'),auth[_0x709d('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0x709d('0x4')](_0x709d('0x35'),auth[_0x709d('0x6')](),controller[_0x709d('0x36')]);router[_0x709d('0x4')](_0x709d('0x37'),auth[_0x709d('0x6')](),controller[_0x709d('0x38')]);router[_0x709d('0x39')]('/mail/queues/:id/notify',auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x3b')));router[_0x709d('0x4')]('/mail/queues/:id',auth[_0x709d('0x6')](),controller[_0x709d('0x3c')]);router[_0x709d('0x39')](_0x709d('0x3d'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')]('chat'));router[_0x709d('0x4')](_0x709d('0x3e'),auth[_0x709d('0x6')](),controller[_0x709d('0x3f')]);router['post'](_0x709d('0x40'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x41')));router[_0x709d('0x4')](_0x709d('0x42'),auth[_0x709d('0x6')](),controller['showFaxQueues']);router['post'](_0x709d('0x43'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x44')));router[_0x709d('0x4')](_0x709d('0x45'),auth['isAuthenticated'](),controller[_0x709d('0x46')]);router[_0x709d('0x39')](_0x709d('0x47'),auth[_0x709d('0x6')](),controller[_0x709d('0x3a')](_0x709d('0x48')));router[_0x709d('0x39')](_0x709d('0x49'),auth[_0x709d('0x6')](),controller['queueNotify'](_0x709d('0x4a')));router['get'](_0x709d('0x4b'),auth[_0x709d('0x6')](),controller[_0x709d('0x4c')]);router[_0x709d('0x4')]('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x709d('0x4d')]);router['post']('/agents/:id/notify',auth[_0x709d('0x6')](),controller[_0x709d('0x4e')]);module[_0x709d('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index fd360e1..7100f51 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 _0xd8fb=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','map','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Message','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','find','rows','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xd8fb,0x99));var _0xbd8f=function(_0x5c1cab,_0x139ef3){_0x5c1cab=_0x5c1cab-0x0;var _0xf63c58=_0xd8fb[_0x5c1cab];return _0xf63c58;};'use strict';var BPromise=require(_0xbd8f('0x0'));var moment=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));var util=require(_0xbd8f('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xbd8f('0x4'));var amiClient=jayson[_0xbd8f('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xbd8f('0x5')][_0xbd8f('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0xbd8f('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){var _0x493298=_0x578499?_0x578499:amiClient;return _0x493298['request'](_0x4e97cf,_0xf503c4)[_0xbd8f('0x7')](function(_0x2393a9){if(_0x2393a9[_0xbd8f('0x8')]){if(_0x2393a9['error'][_0xbd8f('0x9')]===0x1f4){return _0x403edc(_0x2393a9[_0xbd8f('0x8')]['message']);}return _0x197827(_0x2393a9['error'][_0xbd8f('0xa')]);}else{_0x197827(_0x2393a9[_0xbd8f('0xb')]);}})[_0xbd8f('0xc')](function(_0x5d5705){_0x403edc(_0x5d5705);});});}function respondWithResult(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xc8;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0xd')](_0x159f09)[_0xbd8f('0xe')](_0x39be16);}return _0x230988[_0xbd8f('0xf')](0x194);};}function handleError(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0x1f4;return function(_0x14606c){logger['error'](_0x14606c[_0xbd8f('0x10')]);if(_0x14606c[_0xbd8f('0x11')]){delete _0x14606c[_0xbd8f('0x11')];}_0x37d4d5[_0xbd8f('0xd')](_0x29ffe8)['send'](_0x14606c);};}function findById(_0x174929){return function(_0x63db18){if(!_['isNil'](_0x174929)&&!_[_0xbd8f('0x12')](_0x63db18)&&!_[_0xbd8f('0x12')](_0x63db18['rows'])){return _[_0xbd8f('0x13')](_0x63db18[_0xbd8f('0x14')],function(_0x47d317){return _0x47d317['id']==_0x174929;});}return null;};}exports['voiceChannels']=function(_0x33f77c,_0x5d2fdb){return respondWithRpcPromise('VoiceChannels',_0x33f77c[_0xbd8f('0x15')])['then'](respondWithResult(_0x5d2fdb,null))[_0xbd8f('0xc')](handleError(_0x5d2fdb,null));};exports[_0xbd8f('0x16')]=function(_0xb47c8e,_0x897f25){return respondWithRpcPromise(_0xbd8f('0x17'),_[_0xbd8f('0x18')](_0xb47c8e[_0xbd8f('0x15')],_0xb47c8e[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x897f25,null))[_0xbd8f('0xc')](handleError(_0x897f25,null));};exports[_0xbd8f('0x1a')]=function(_0x1628f5,_0x2f7c45){return respondWithRpcPromise(_0xbd8f('0x1b'),_[_0xbd8f('0x18')](_0x1628f5[_0xbd8f('0x15')],_0x1628f5[_0xbd8f('0x19')]))['then'](respondWithResult(_0x2f7c45,null))[_0xbd8f('0xc')](handleError(_0x2f7c45,null));};exports[_0xbd8f('0x1c')]=function(_0x1f9fcc,_0x2f3df7){return respondWithRpcPromise(_0xbd8f('0x1d'),_0x1f9fcc[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2f3df7,null))[_0xbd8f('0xc')](handleError(_0x2f3df7,null));};exports['showVoiceQueues']=function(_0x40cb43,_0x421f3e){return respondWithRpcPromise('VoiceQueues',_0x40cb43[_0xbd8f('0x15')])['then'](findById(_0x40cb43[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x421f3e,null))[_0xbd8f('0xc')](handleError(_0x421f3e,null));};exports[_0xbd8f('0x1e')]=function(_0x2aefa2,_0x247b07){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xbd8f('0x18')](_0x2aefa2[_0xbd8f('0x1f')],_0x2aefa2[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x247b07,null))[_0xbd8f('0xc')](handleError(_0x247b07,null));};exports[_0xbd8f('0x20')]=function(_0x2a4b32,_0x479a0c){return respondWithRpcPromise(_0xbd8f('0x21'),_[_0xbd8f('0x18')](_0x2a4b32[_0xbd8f('0x15')],_0x2a4b32[_0xbd8f('0x19')]))['then'](respondWithResult(_0x479a0c,null))['catch'](handleError(_0x479a0c,null));};exports[_0xbd8f('0x22')]=function(_0x3cdec2,_0x2fd6f8){return respondWithRpcPromise(_0xbd8f('0x23'),_0x3cdec2['query'])[_0xbd8f('0x7')](respondWithResult(_0x2fd6f8,null))[_0xbd8f('0xc')](handleError(_0x2fd6f8,null));};exports[_0xbd8f('0x24')]=function(_0x2137ed,_0x25ad9a){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xbd8f('0x18')](_0x2137ed[_0xbd8f('0x15')],_0x2137ed[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x25ad9a,null))[_0xbd8f('0xc')](handleError(_0x25ad9a,null));};exports['voiceQueuesChannelHangup']=function(_0x24e5f4,_0x5f404e){return respondWithRpcPromise(_0xbd8f('0x25'),_[_0xbd8f('0x18')](_0x24e5f4[_0xbd8f('0x15')],_0x24e5f4[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x5f404e,null))[_0xbd8f('0xc')](handleError(_0x5f404e,null));};exports['voiceQueuesChannelRedirect']=function(_0x4bafcd,_0x4c9a8d){return respondWithRpcPromise(_0xbd8f('0x26'),_[_0xbd8f('0x18')](_0x4bafcd[_0xbd8f('0x15')],_0x4bafcd[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x4c9a8d,null))[_0xbd8f('0xc')](handleError(_0x4c9a8d,null));};exports[_0xbd8f('0x27')]=function(_0x30c1c2,_0x2d4882){return respondWithRpcPromise(_0xbd8f('0x28'),_0x30c1c2[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2d4882,null))[_0xbd8f('0xc')](handleError(_0x2d4882,null));};exports[_0xbd8f('0x29')]=function(_0x391d45,_0x50e081){return respondWithRpcPromise(_0xbd8f('0x2a'),_0x391d45[_0xbd8f('0x15')])['then'](respondWithResult(_0x50e081,null))[_0xbd8f('0xc')](handleError(_0x50e081,null));};exports[_0xbd8f('0x2b')]=function(_0x3d3902,_0x582bcf){var _0x21da54;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')])[_0xbd8f('0x7')](function(_0x298952){_0x21da54=_0x298952;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')],routingClient);})[_0xbd8f('0x7')](function(_0xdab323){return _['merge']({},_0xdab323,_0x21da54);})[_0xbd8f('0x7')](respondWithResult(_0x582bcf,null))[_0xbd8f('0xc')](handleError(_0x582bcf,null));};exports[_0xbd8f('0x2c')]=function(_0x351027,_0x280d95){if(_0x351027[_0xbd8f('0x1f')]&&_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]&&_0x351027[_0xbd8f('0x2e')]&&_0x351027['user']['name']){for(var _0x2907a3 in _0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]){if(_0x351027[_0xbd8f('0x1f')]['interaction'][_0xbd8f('0x2f')](_0x2907a3)){db[_0xbd8f('0x30')][_0xbd8f('0x31')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3]&&_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')]?{'$notIn':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3]}:{'$ne':null}}})[_0xbd8f('0x7')](function(_0x151f82){var _0x1ea49a=moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x36c43f=0x0,_0x2fbbbe=_0x151f82[_0xbd8f('0x32')];_0x36c43f<_0x2fbbbe;_0x36c43f+=0x1){_0x151f82[_0x36c43f][_0xbd8f('0x34')]({'exitAt':_0x1ea49a});}});for(var _0x229bc0=0x0;_0x229bc0<_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')];_0x229bc0+=0x1){db['MemberReport'][_0xbd8f('0x35')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':_0xbd8f('0x36'),'uniqueid':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0x229bc0],'exitAt':null},'defaults':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'interface':_[_0xbd8f('0x12')](_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')])?util[_0xbd8f('0x33')](_0xbd8f('0x38'),_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')]):_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')],'type':_0xbd8f('0x36'),'enterAt':moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xbd8f('0x39'),'internal':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x3a')],'uniqueid':_0x351027[_0xbd8f('0x1f')]['interaction'][_0x2907a3][_0x229bc0]}});}}}}return respondWithRpcPromise(_0xbd8f('0x3b'),{'id':_0x351027['params']['id'],'capacity':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x3c')]},routingClient)[_0xbd8f('0x7')](respondWithResult(_0x280d95,null))[_0xbd8f('0xc')](handleError(_0x280d95,null));};exports['telephones']=function(_0x3964f5,_0x35b814){return respondWithRpcPromise(_0xbd8f('0x3d'),_0x3964f5[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x35b814,null))[_0xbd8f('0xc')](handleError(_0x35b814,null));};exports['trunks']=function(_0x42a597,_0x4a2da8){return respondWithRpcPromise(_0xbd8f('0x3e'),_0x42a597[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x4a2da8,null))[_0xbd8f('0xc')](handleError(_0x4a2da8,null));};exports[_0xbd8f('0x3f')]=function(_0x358424,_0x2a331d){return respondWithRpcPromise(_0xbd8f('0x40'),_0x358424[_0xbd8f('0x15')])['then'](respondWithResult(_0x2a331d,null))[_0xbd8f('0xc')](handleError(_0x2a331d,null));};exports['chatQueues']=function(_0xd09e5,_0xb04dae){return respondWithRpcPromise('ChatQueues',_0xd09e5[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0xb04dae,null))['catch'](handleError(_0xb04dae,null));};exports['showChatQueues']=function(_0x55de68,_0x4042e0){return respondWithRpcPromise(_0xbd8f('0x41'),_0x55de68[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x55de68[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x4042e0,null))['catch'](handleError(_0x4042e0,null));};exports[_0xbd8f('0x42')]=function(_0x3848cb,_0x21d40b){return respondWithRpcPromise(_0xbd8f('0x43'),_0x3848cb[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x21d40b,null))[_0xbd8f('0xc')](handleError(_0x21d40b,null));};exports['showMailQueues']=function(_0x9cf2d5,_0x40c834){return respondWithRpcPromise(_0xbd8f('0x43'),_0x9cf2d5['query'],routingClient)[_0xbd8f('0x7')](findById(_0x9cf2d5[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x40c834,null))[_0xbd8f('0xc')](handleError(_0x40c834,null));};exports['mailAccounts']=function(_0x5327f2,_0x388af8){return respondWithRpcPromise('MailAccounts',_0x5327f2[_0xbd8f('0x15')],mailClient)[_0xbd8f('0x7')](respondWithResult(_0x388af8,null))[_0xbd8f('0xc')](handleError(_0x388af8,null));};exports[_0xbd8f('0x44')]=function(_0x4a86a9,_0x5ea275){return respondWithRpcPromise(_0xbd8f('0x45'),_0x4a86a9[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5ea275,null))[_0xbd8f('0xc')](handleError(_0x5ea275,null));};exports[_0xbd8f('0x46')]=function(_0x21cad7,_0x31adfb){return respondWithRpcPromise(_0xbd8f('0x45'),_0x21cad7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x21cad7[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x31adfb,null))[_0xbd8f('0xc')](handleError(_0x31adfb,null));};exports[_0xbd8f('0x47')]=function(_0x225ebd,_0x12ee82){return respondWithRpcPromise(_0xbd8f('0x48'),_0x225ebd[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x12ee82,null))[_0xbd8f('0xc')](handleError(_0x12ee82,null));};exports[_0xbd8f('0x49')]=function(_0x538fd7,_0x5e18fc){return respondWithRpcPromise(_0xbd8f('0x48'),_0x538fd7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x538fd7['params']['id']))['then'](respondWithResult(_0x5e18fc,null))[_0xbd8f('0xc')](handleError(_0x5e18fc,null));};exports['whatsappQueues']=function(_0x565e63,_0x5b5bd8){return respondWithRpcPromise('WhatsappQueues',_0x565e63['query'],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b5bd8,null))['catch'](handleError(_0x5b5bd8,null));};exports[_0xbd8f('0x4a')]=function(_0x400aac,_0x53f297){return respondWithRpcPromise(_0xbd8f('0x4b'),_0x400aac[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x400aac[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x53f297,null))['catch'](handleError(_0x53f297,null));};exports['faxQueues']=function(_0x378e72,_0x44469e){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x378e72[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x44469e,null))[_0xbd8f('0xc')](handleError(_0x44469e,null));};exports['showFaxQueues']=function(_0x4eddf2,_0x467b0f){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x4eddf2['query'],routingClient)[_0xbd8f('0x7')](findById(_0x4eddf2[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x467b0f,null))[_0xbd8f('0xc')](handleError(_0x467b0f,null));};exports[_0xbd8f('0x4d')]=function(_0x10268a,_0x5a8c8f){return respondWithRpcPromise('FaxAccounts',_0x10268a[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x5a8c8f,null))[_0xbd8f('0xc')](handleError(_0x5a8c8f,null));};exports[_0xbd8f('0x4e')]=function(_0x41be86,_0x5b900c){return respondWithRpcPromise(_0xbd8f('0x4f'),_0x41be86[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b900c,null))[_0xbd8f('0xc')](handleError(_0x5b900c,null));};exports[_0xbd8f('0x50')]=function(_0x3574a6,_0x2a7eaa){return respondWithRpcPromise(_0xbd8f('0x51'),_0x3574a6[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2a7eaa,null))[_0xbd8f('0xc')](handleError(_0x2a7eaa,null));};exports[_0xbd8f('0x52')]=function(_0x34eec5,_0x40fc53){return respondWithRpcPromise(_0xbd8f('0x53'),_0x34eec5[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x40fc53,null))[_0xbd8f('0xc')](handleError(_0x40fc53,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x38d98e,_0x2957fd){return respondWithRpcPromise(_0xbd8f('0x53'),_0x38d98e[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](function(_0x18ccf2){if(_0x38d98e['query']['type']!==undefined){var _0x2a3982=_(_0x18ccf2[_0xbd8f('0x14')])['filter']([_0x38d98e[_0xbd8f('0x15')]['type'],_0x38d98e[_0xbd8f('0x19')]['id']])[_0xbd8f('0x54')](_0xbd8f('0x55'))[_0xbd8f('0x56')]()['value']();return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x84e98d){return _0x2a3982['indexOf'](_0x84e98d[_0xbd8f('0x55')])>-0x1;});}else{return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x161ec8){return _0x161ec8['queue_id']===parseInt(_0x38d98e[_0xbd8f('0x19')]['id']);});}})[_0xbd8f('0x7')](respondWithResult(_0x2957fd,null))[_0xbd8f('0xc')](handleError(_0x2957fd,null));};exports[_0xbd8f('0x58')]=function(_0x18645e,_0x23e962){return respondWithRpcPromise(_0xbd8f('0x59'),_0x18645e[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x23e962,null))[_0xbd8f('0xc')](handleError(_0x23e962,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3da31b,_0x4e908d){return respondWithRpcPromise(_0xbd8f('0x5a'),_0x3da31b[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x4e908d,null))[_0xbd8f('0xc')](handleError(_0x4e908d,null));};exports[_0xbd8f('0x5b')]=function(_0x60cd2b,_0x2ab853){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x60cd2b[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2ab853,null))[_0xbd8f('0xc')](handleError(_0x2ab853,null));};exports[_0xbd8f('0x5c')]=function(_0x58651d){return function(_0x4e19ec,_0x2fb942){var _0x3641e9,_0x1f685d;var _0x2acd13=_[_0xbd8f('0x5d')](_0x58651d);var _0x53076d=_0x58651d===_0xbd8f('0x5e')?_0xbd8f('0x5f'):_0xbd8f('0x60');return db[_0x2acd13+_0xbd8f('0x61')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x4e19ec['params']['id']}})['then'](function(_0x542075){if(_[_0xbd8f('0x12')](_0x542075)){throw new Error(_0x2acd13+'\x20Queue\x20not\x20found');}_0x3641e9=_0x542075;return db[_0x2acd13+'Message']['findOne']({'where':{'id':_0x4e19ec[_0xbd8f('0x1f')][_0xbd8f('0x63')]},'include':[{'model':db[_0x2acd13+_0xbd8f('0x64')],'as':_0xbd8f('0x64')},{'model':db[_0x2acd13+_0x53076d],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0xefcfc1){if(_[_0xbd8f('0x12')](_0xefcfc1)){throw new Error(_0x2acd13+'\x20Message\x20not\x20found');}_0x1f685d=_0xefcfc1;return _0xefcfc1[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3caa98={'uniqueid':_0x58651d+'.'+_0x1f685d['id']+'.'+_0x1f685d['Interaction']['id'],'FromUserId':_0x4e19ec[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66')};_0x3caa98[_0x2acd13+_0xbd8f('0x67')]=_0x1f685d['id'];_0x3caa98[_0x2acd13+_0xbd8f('0x68')]=_0x1f685d[_0xbd8f('0x64')]['id'];_0x3caa98[_0xbd8f('0x69')+_0x2acd13+_0x53076d+'Id']=_0x1f685d[_0xbd8f('0x60')]['id'];_0x3caa98['To'+_0x2acd13+_0xbd8f('0x6a')]=_0x3641e9['id'];return db[_0x2acd13+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3caa98);})['then'](function(){return respondWithRpcPromise(_0xbd8f('0x6d'),{'channel':_0x58651d,'interaction':_0x1f685d[_0xbd8f('0x64')],'message':_0x1f685d,'account':_0x1f685d[_0xbd8f('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3641e9[_0xbd8f('0x11')]+','+(_0x1f685d['Account'][_0xbd8f('0x6e')]||0x12c),'interval':_0xbd8f('0x6f')}]},routingClient);})[_0xbd8f('0x7')](respondWithResult(_0x2fb942,null))[_0xbd8f('0xc')](handleError(_0x2fb942,null));};};exports[_0xbd8f('0x70')]=function(_0x57762c,_0xe58b64){var _0x198d4b,_0x60c94c;if(_[_0xbd8f('0x12')](_0x57762c[_0xbd8f('0x1f')][_0xbd8f('0x71')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x672cfb=_0x57762c[_0xbd8f('0x1f')]['channel'];var _0x49e15e=_[_0xbd8f('0x5d')](_0x672cfb);var _0x5b0716=_0x672cfb==='chat'?'Website':_0xbd8f('0x60');return db[_0xbd8f('0x72')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x57762c[_0xbd8f('0x19')]['id'],'role':'agent'}})[_0xbd8f('0x7')](function(_0x398cc9){if(_['isNil'](_0x398cc9)){throw new Error('Agent\x20not\x20found');}_0x198d4b=_0x398cc9;return db[_0x49e15e+_0xbd8f('0x73')]['findOne']({'where':{'id':_0x57762c[_0xbd8f('0x1f')]['messageId']},'include':[{'model':db[_0x49e15e+'Interaction'],'as':_0xbd8f('0x64')},{'model':db[_0x49e15e+_0x5b0716],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0x18e9f0){if(_[_0xbd8f('0x12')](_0x18e9f0)){throw new Error(_0x49e15e+'\x20Message\x20not\x20found');}_0x60c94c=_0x18e9f0;return _0x18e9f0[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3a6ec4={'uniqueid':_0x672cfb+'.'+_0x60c94c['id']+'.'+_0x60c94c['Interaction']['id'],'FromUserId':_0x57762c[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66'),'ToUserId':_0x198d4b['id']};_0x3a6ec4[_0x49e15e+_0xbd8f('0x67')]=_0x60c94c['id'];_0x3a6ec4[_0x49e15e+_0xbd8f('0x68')]=_0x60c94c[_0xbd8f('0x64')]['id'];_0x3a6ec4[_0xbd8f('0x69')+_0x49e15e+_0x5b0716+'Id']=_0x60c94c[_0xbd8f('0x60')]['id'];return db[_0x49e15e+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3a6ec4);})[_0xbd8f('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x672cfb,'interaction':_0x60c94c['Interaction'],'message':_0x60c94c,'account':_0x60c94c['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x198d4b[_0xbd8f('0x11')]+','+(_0x60c94c[_0xbd8f('0x60')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0xe58b64,null))['catch'](handleError(_0xe58b64,null));}; \ No newline at end of file +var _0x7da7=['value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','isNil','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found','update','MessageId','From','QueueId','TransferReport','create','Start','Account','queue','agentNotify','channel','User','Agent\x20not\x20found','InteractionId','bluebird','moment','lodash','../../config/logger','api','client','http','request','error','message','catch','status','json','name','send','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','then','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agentCapacity','interaction','user','hasOwnProperty','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','SIP/%s','INTERACTION','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','showWhatsappQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0x7da7,0x10d));var _0x77da=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x7da7[_0x5f46e7];return _0x567e95;};'use strict';var BPromise=require(_0x77da('0x0'));var moment=require(_0x77da('0x1'));var _=require(_0x77da('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x77da('0x3'))(_0x77da('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x77da('0x5')][_0x77da('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x77da('0x6')]({'port':0x232b});var routingClient=jayson[_0x77da('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x30afe0,_0x47cf1d,_0x1191de){return new BPromise(function(_0x13992e,_0x37c5ab){var _0x910e5b=_0x1191de?_0x1191de:amiClient;return _0x910e5b[_0x77da('0x7')](_0x30afe0,_0x47cf1d)['then'](function(_0x40c86e){if(_0x40c86e[_0x77da('0x8')]){if(_0x40c86e[_0x77da('0x8')]['code']===0x1f4){return _0x37c5ab(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}return _0x13992e(_0x40c86e[_0x77da('0x8')][_0x77da('0x9')]);}else{_0x13992e(_0x40c86e['result']);}})[_0x77da('0xa')](function(_0x3bcea0){_0x37c5ab(_0x3bcea0);});});}function respondWithResult(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xc8;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0xb')](_0x5d6e2f)[_0x77da('0xc')](_0x4a7748);}return _0x2acc65['sendStatus'](0x194);};}function handleError(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0x1f4;return function(_0x355719){logger[_0x77da('0x8')](_0x355719['stack']);if(_0x355719[_0x77da('0xd')]){delete _0x355719['name'];}_0x3b0ff2[_0x77da('0xb')](_0x369df0)[_0x77da('0xe')](_0x355719);};}function findById(_0x1b0e17){return function(_0x4500c4){if(!_['isNil'](_0x1b0e17)&&!_['isNil'](_0x4500c4)&&!_['isNil'](_0x4500c4['rows'])){return _[_0x77da('0xf')](_0x4500c4[_0x77da('0x10')],function(_0x289887){return _0x289887['id']==_0x1b0e17;});}return null;};}exports[_0x77da('0x11')]=function(_0x19a00c,_0x12d2b1){return respondWithRpcPromise(_0x77da('0x12'),_0x19a00c[_0x77da('0x13')])['then'](respondWithResult(_0x12d2b1,null))['catch'](handleError(_0x12d2b1,null));};exports[_0x77da('0x14')]=function(_0x4d1512,_0x507979){return respondWithRpcPromise(_0x77da('0x15'),_[_0x77da('0x16')](_0x4d1512[_0x77da('0x13')],_0x4d1512['params']))['then'](respondWithResult(_0x507979,null))[_0x77da('0xa')](handleError(_0x507979,null));};exports['voiceChannelStopMixMonitor']=function(_0x175ac4,_0x1c27aa){return respondWithRpcPromise(_0x77da('0x17'),_[_0x77da('0x16')](_0x175ac4[_0x77da('0x13')],_0x175ac4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x1c27aa,null))['catch'](handleError(_0x1c27aa,null));};exports['voiceQueues']=function(_0xfd160,_0x2d009f){return respondWithRpcPromise(_0x77da('0x1a'),_0xfd160[_0x77da('0x13')])['then'](respondWithResult(_0x2d009f,null))[_0x77da('0xa')](handleError(_0x2d009f,null));};exports[_0x77da('0x1b')]=function(_0x470c9f,_0x36115b){return respondWithRpcPromise(_0x77da('0x1a'),_0x470c9f['query'])[_0x77da('0x19')](findById(_0x470c9f[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x36115b,null))[_0x77da('0xa')](handleError(_0x36115b,null));};exports['updateVoiceQueue']=function(_0x5b4638,_0x4d395a){return respondWithRpcPromise(_0x77da('0x1c'),_[_0x77da('0x16')](_0x5b4638[_0x77da('0x1d')],_0x5b4638[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x4d395a,null))['catch'](handleError(_0x4d395a,null));};exports[_0x77da('0x1e')]=function(_0x26f5a0,_0x356bfb){return respondWithRpcPromise(_0x77da('0x1f'),_[_0x77da('0x16')](_0x26f5a0[_0x77da('0x13')],_0x26f5a0['params']))[_0x77da('0x19')](respondWithResult(_0x356bfb,null))[_0x77da('0xa')](handleError(_0x356bfb,null));};exports[_0x77da('0x20')]=function(_0x38643a,_0x3c3c64){return respondWithRpcPromise(_0x77da('0x21'),_0x38643a[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x3c3c64,null))['catch'](handleError(_0x3c3c64,null));};exports['voiceQueuesChannel']=function(_0x1366b4,_0x8e6181){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x77da('0x16')](_0x1366b4[_0x77da('0x13')],_0x1366b4[_0x77da('0x18')]))[_0x77da('0x19')](respondWithResult(_0x8e6181,null))[_0x77da('0xa')](handleError(_0x8e6181,null));};exports[_0x77da('0x22')]=function(_0x20d1cc,_0x5c4a03){return respondWithRpcPromise(_0x77da('0x23'),_['merge'](_0x20d1cc['query'],_0x20d1cc['params']))[_0x77da('0x19')](respondWithResult(_0x5c4a03,null))['catch'](handleError(_0x5c4a03,null));};exports[_0x77da('0x24')]=function(_0xdac1a4,_0xce9df2){return respondWithRpcPromise(_0x77da('0x25'),_[_0x77da('0x16')](_0xdac1a4[_0x77da('0x13')],_0xdac1a4[_0x77da('0x18')]))['then'](respondWithResult(_0xce9df2,null))[_0x77da('0xa')](handleError(_0xce9df2,null));};exports[_0x77da('0x26')]=function(_0x1ca53a,_0x32785f){return respondWithRpcPromise(_0x77da('0x27'),_0x1ca53a[_0x77da('0x13')])['then'](respondWithResult(_0x32785f,null))[_0x77da('0xa')](handleError(_0x32785f,null));};exports[_0x77da('0x28')]=function(_0x2cd190,_0x4d04cd){return respondWithRpcPromise(_0x77da('0x29'),_0x2cd190['query'])['then'](respondWithResult(_0x4d04cd,null))['catch'](handleError(_0x4d04cd,null));};exports['agents']=function(_0x19f9f7,_0x1adba5){var _0xebdea1;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')])['then'](function(_0xf79c20){_0xebdea1=_0xf79c20;return respondWithRpcPromise('Agents',_0x19f9f7[_0x77da('0x13')],routingClient);})[_0x77da('0x19')](function(_0x290667){return _[_0x77da('0x16')]({},_0x290667,_0xebdea1);})[_0x77da('0x19')](respondWithResult(_0x1adba5,null))['catch'](handleError(_0x1adba5,null));};exports[_0x77da('0x2a')]=function(_0x1f48bd,_0x44717a){if(_0x1f48bd[_0x77da('0x1d')]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]&&_0x1f48bd['user']&&_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]){for(var _0x21de41 in _0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')]){if(_0x1f48bd[_0x77da('0x1d')]['interaction'][_0x77da('0x2d')](_0x21de41)){db['MemberReport'][_0x77da('0x2e')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]&&_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')]?{'$notIn':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41]}:{'$ne':null}}})[_0x77da('0x19')](function(_0x1bb77c){var _0x5964da=moment()[_0x77da('0x30')](_0x77da('0x31'));for(var _0x46f289=0x0,_0x287cf0=_0x1bb77c[_0x77da('0x2f')];_0x46f289<_0x287cf0;_0x46f289+=0x1){_0x1bb77c[_0x46f289][_0x77da('0x32')]({'exitAt':_0x5964da});}});for(var _0x558023=0x0;_0x558023<_0x1f48bd['body'][_0x77da('0x2b')][_0x21de41][_0x77da('0x2f')];_0x558023+=0x1){db[_0x77da('0x33')][_0x77da('0x34')]({'where':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'type':'INTERACTION','uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023],'exitAt':null},'defaults':{'channel':_0x21de41,'membername':_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')],'interface':_['isNil'](_0x1f48bd[_0x77da('0x2c')]['interface'])?util['format'](_0x77da('0x35'),_0x1f48bd[_0x77da('0x2c')][_0x77da('0xd')]):_0x1f48bd[_0x77da('0x2c')]['interface'],'type':_0x77da('0x36'),'enterAt':moment()[_0x77da('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x77da('0x37'),'internal':_0x1f48bd[_0x77da('0x2c')]['internal'],'uniqueid':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x2b')][_0x21de41][_0x558023]}});}}}}return respondWithRpcPromise(_0x77da('0x38'),{'id':_0x1f48bd[_0x77da('0x18')]['id'],'capacity':_0x1f48bd[_0x77da('0x1d')][_0x77da('0x39')]},routingClient)[_0x77da('0x19')](respondWithResult(_0x44717a,null))[_0x77da('0xa')](handleError(_0x44717a,null));};exports[_0x77da('0x3a')]=function(_0x3a34a8,_0x52aa0a){return respondWithRpcPromise(_0x77da('0x3b'),_0x3a34a8['query'])[_0x77da('0x19')](respondWithResult(_0x52aa0a,null))[_0x77da('0xa')](handleError(_0x52aa0a,null));};exports[_0x77da('0x3c')]=function(_0x2eca67,_0x374179){return respondWithRpcPromise(_0x77da('0x3d'),_0x2eca67[_0x77da('0x13')])['then'](respondWithResult(_0x374179,null))[_0x77da('0xa')](handleError(_0x374179,null));};exports[_0x77da('0x3e')]=function(_0x1a7115,_0x353be9){return respondWithRpcPromise('Campaigns',_0x1a7115[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x353be9,null))[_0x77da('0xa')](handleError(_0x353be9,null));};exports['chatQueues']=function(_0x5a7ba7,_0x332763){return respondWithRpcPromise(_0x77da('0x3f'),_0x5a7ba7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x332763,null))[_0x77da('0xa')](handleError(_0x332763,null));};exports['showChatQueues']=function(_0x50437b,_0x365e91){return respondWithRpcPromise(_0x77da('0x3f'),_0x50437b['query'],routingClient)[_0x77da('0x19')](findById(_0x50437b[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x365e91,null))['catch'](handleError(_0x365e91,null));};exports[_0x77da('0x40')]=function(_0x111260,_0x5a5309){return respondWithRpcPromise(_0x77da('0x41'),_0x111260[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x5a5309,null))[_0x77da('0xa')](handleError(_0x5a5309,null));};exports[_0x77da('0x42')]=function(_0x99ac27,_0x1dc4ab){return respondWithRpcPromise(_0x77da('0x41'),_0x99ac27[_0x77da('0x13')],routingClient)['then'](findById(_0x99ac27[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1dc4ab,null))[_0x77da('0xa')](handleError(_0x1dc4ab,null));};exports[_0x77da('0x43')]=function(_0x329c6b,_0x3a0160){return respondWithRpcPromise('MailAccounts',_0x329c6b[_0x77da('0x13')],mailClient)[_0x77da('0x19')](respondWithResult(_0x3a0160,null))[_0x77da('0xa')](handleError(_0x3a0160,null));};exports['openchannelQueues']=function(_0x3e5dd9,_0x2f7cd8){return respondWithRpcPromise(_0x77da('0x44'),_0x3e5dd9[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2f7cd8,null))[_0x77da('0xa')](handleError(_0x2f7cd8,null));};exports[_0x77da('0x45')]=function(_0x53a9ee,_0x100094){return respondWithRpcPromise('OpenchannelQueues',_0x53a9ee[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x53a9ee[_0x77da('0x18')]['id']))['then'](respondWithResult(_0x100094,null))[_0x77da('0xa')](handleError(_0x100094,null));};exports[_0x77da('0x46')]=function(_0x282481,_0x30ea29){return respondWithRpcPromise('SmsQueues',_0x282481['query'],routingClient)['then'](respondWithResult(_0x30ea29,null))[_0x77da('0xa')](handleError(_0x30ea29,null));};exports[_0x77da('0x47')]=function(_0x2c4d7c,_0x2c7c8e){return respondWithRpcPromise(_0x77da('0x48'),_0x2c4d7c[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x2c4d7c[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x2c7c8e,null))[_0x77da('0xa')](handleError(_0x2c7c8e,null));};exports['whatsappQueues']=function(_0x3028ca,_0x6dd79f){return respondWithRpcPromise('WhatsappQueues',_0x3028ca['query'],routingClient)[_0x77da('0x19')](respondWithResult(_0x6dd79f,null))['catch'](handleError(_0x6dd79f,null));};exports[_0x77da('0x49')]=function(_0x1adab0,_0x1ff554){return respondWithRpcPromise('WhatsappQueues',_0x1adab0[_0x77da('0x13')],routingClient)[_0x77da('0x19')](findById(_0x1adab0[_0x77da('0x18')]['id']))[_0x77da('0x19')](respondWithResult(_0x1ff554,null))[_0x77da('0xa')](handleError(_0x1ff554,null));};exports['faxQueues']=function(_0x1f4c49,_0x20a636){return respondWithRpcPromise('FaxQueues',_0x1f4c49[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x20a636,null))[_0x77da('0xa')](handleError(_0x20a636,null));};exports[_0x77da('0x4a')]=function(_0x14496e,_0xdf9393){return respondWithRpcPromise(_0x77da('0x4b'),_0x14496e['query'],routingClient)[_0x77da('0x19')](findById(_0x14496e['params']['id']))[_0x77da('0x19')](respondWithResult(_0xdf9393,null))[_0x77da('0xa')](handleError(_0xdf9393,null));};exports[_0x77da('0x4c')]=function(_0x19b514,_0x470619){return respondWithRpcPromise(_0x77da('0x4d'),_0x19b514[_0x77da('0x13')])[_0x77da('0x19')](respondWithResult(_0x470619,null))[_0x77da('0xa')](handleError(_0x470619,null));};exports[_0x77da('0x4e')]=function(_0x3c9ca7,_0x19065e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x3c9ca7[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x19065e,null))[_0x77da('0xa')](handleError(_0x19065e,null));};exports[_0x77da('0x4f')]=function(_0x57b710,_0x293b5c){return respondWithRpcPromise(_0x77da('0x50'),_0x57b710[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x293b5c,null))[_0x77da('0xa')](handleError(_0x293b5c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x579314,_0x2a4f85){return respondWithRpcPromise(_0x77da('0x51'),_0x579314[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x2a4f85,null))[_0x77da('0xa')](handleError(_0x2a4f85,null));};exports[_0x77da('0x52')]=function(_0x14dec8,_0xf95d48){return respondWithRpcPromise(_0x77da('0x51'),_0x14dec8['query'],routingClient)[_0x77da('0x19')](function(_0xfcf09c){if(_0x14dec8[_0x77da('0x13')][_0x77da('0x53')]!==undefined){var _0x17175=_(_0xfcf09c['rows'])[_0x77da('0x54')]([_0x14dec8[_0x77da('0x13')][_0x77da('0x53')],_0x14dec8[_0x77da('0x18')]['id']])[_0x77da('0x55')](_0x77da('0x56'))[_0x77da('0x57')]()[_0x77da('0x58')]();return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x4df868){return _0x17175['indexOf'](_0x4df868['queue_id'])>-0x1;});}else{return _0xfcf09c[_0x77da('0x10')][_0x77da('0x54')](function(_0x41fb81){return _0x41fb81['queue_id']===parseInt(_0x14dec8['params']['id']);});}})[_0x77da('0x19')](respondWithResult(_0xf95d48,null))[_0x77da('0xa')](handleError(_0xf95d48,null));};exports[_0x77da('0x59')]=function(_0x3a42e5,_0x1a92fd){return respondWithRpcPromise(_0x77da('0x5a'),_0x3a42e5[_0x77da('0x13')],routingClient)[_0x77da('0x19')](respondWithResult(_0x1a92fd,null))[_0x77da('0xa')](handleError(_0x1a92fd,null));};exports[_0x77da('0x5b')]=function(_0x27a462,_0x4cbd40){return respondWithRpcPromise(_0x77da('0x5c'),_0x27a462['query'],routingClient)['then'](respondWithResult(_0x4cbd40,null))[_0x77da('0xa')](handleError(_0x4cbd40,null));};exports['faxQueuesWaitingInteractions']=function(_0x4f9121,_0x22de60){return respondWithRpcPromise(_0x77da('0x5d'),_0x4f9121[_0x77da('0x13')],routingClient)['then'](respondWithResult(_0x22de60,null))['catch'](handleError(_0x22de60,null));};exports[_0x77da('0x5e')]=function(_0x4f1ae0){return function(_0x278f20,_0x1b85aa){var _0x554c44,_0x31834a;var _0x505520=_[_0x77da('0x5f')](_0x4f1ae0);var _0x45b0a5=_0x4f1ae0===_0x77da('0x60')?_0x77da('0x61'):'Account';return db[_0x505520+_0x77da('0x62')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x278f20[_0x77da('0x18')]['id']}})[_0x77da('0x19')](function(_0x3fd7c8){if(_[_0x77da('0x64')](_0x3fd7c8)){throw new Error(_0x505520+_0x77da('0x65'));}_0x554c44=_0x3fd7c8;return db[_0x505520+'Message']['findOne']({'where':{'id':_0x278f20[_0x77da('0x1d')][_0x77da('0x66')]},'include':[{'model':db[_0x505520+_0x77da('0x67')],'as':'Interaction'},{'model':db[_0x505520+_0x45b0a5],'as':'Account'}]});})['then'](function(_0x5aaafb){if(_[_0x77da('0x64')](_0x5aaafb)){throw new Error(_0x505520+_0x77da('0x68'));}_0x31834a=_0x5aaafb;return _0x5aaafb[_0x77da('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x1636d6={'uniqueid':_0x4f1ae0+'.'+_0x31834a['id']+'.'+_0x31834a['Interaction']['id'],'FromUserId':_0x278f20[_0x77da('0x2c')]['id'],'type':'queue'};_0x1636d6[_0x505520+_0x77da('0x6a')]=_0x31834a['id'];_0x1636d6[_0x505520+'InteractionId']=_0x31834a[_0x77da('0x67')]['id'];_0x1636d6[_0x77da('0x6b')+_0x505520+_0x45b0a5+'Id']=_0x31834a['Account']['id'];_0x1636d6['To'+_0x505520+_0x77da('0x6c')]=_0x554c44['id'];return db[_0x505520+_0x77da('0x6d')][_0x77da('0x6e')](_0x1636d6);})[_0x77da('0x19')](function(){return respondWithRpcPromise(_0x77da('0x6f'),{'channel':_0x4f1ae0,'interaction':_0x31834a[_0x77da('0x67')],'message':_0x31834a,'account':_0x31834a[_0x77da('0x70')],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x71'),'appdata':_0x554c44[_0x77da('0xd')]+','+(_0x31834a['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x1b85aa,null))[_0x77da('0xa')](handleError(_0x1b85aa,null));};};exports[_0x77da('0x72')]=function(_0x56efcf,_0x186d22){var _0x52638b,_0x5e93b1;if(_[_0x77da('0x64')](_0x56efcf[_0x77da('0x1d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x3c0cde=_0x56efcf[_0x77da('0x1d')][_0x77da('0x73')];var _0x5d9750=_[_0x77da('0x5f')](_0x3c0cde);var _0x5384d2=_0x3c0cde===_0x77da('0x60')?_0x77da('0x61'):_0x77da('0x70');return db[_0x77da('0x74')][_0x77da('0x63')]({'raw':!![],'where':{'id':_0x56efcf[_0x77da('0x18')]['id'],'role':'agent'}})[_0x77da('0x19')](function(_0x2410ae){if(_[_0x77da('0x64')](_0x2410ae)){throw new Error(_0x77da('0x75'));}_0x52638b=_0x2410ae;return db[_0x5d9750+'Message'][_0x77da('0x63')]({'where':{'id':_0x56efcf['body'][_0x77da('0x66')]},'include':[{'model':db[_0x5d9750+_0x77da('0x67')],'as':_0x77da('0x67')},{'model':db[_0x5d9750+_0x5384d2],'as':_0x77da('0x70')}]});})[_0x77da('0x19')](function(_0x2c3bcc){if(_[_0x77da('0x64')](_0x2c3bcc)){throw new Error(_0x5d9750+_0x77da('0x68'));}_0x5e93b1=_0x2c3bcc;return _0x2c3bcc['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x77da('0x19')](function(){var _0x3132f0={'uniqueid':_0x3c0cde+'.'+_0x5e93b1['id']+'.'+_0x5e93b1[_0x77da('0x67')]['id'],'FromUserId':_0x56efcf[_0x77da('0x2c')]['id'],'type':_0x77da('0x71'),'ToUserId':_0x52638b['id']};_0x3132f0[_0x5d9750+_0x77da('0x6a')]=_0x5e93b1['id'];_0x3132f0[_0x5d9750+_0x77da('0x76')]=_0x5e93b1[_0x77da('0x67')]['id'];_0x3132f0['From'+_0x5d9750+_0x5384d2+'Id']=_0x5e93b1['Account']['id'];return db[_0x5d9750+_0x77da('0x6d')][_0x77da('0x6e')](_0x3132f0);})[_0x77da('0x19')](function(){return respondWithRpcPromise('Start',{'channel':_0x3c0cde,'interaction':_0x5e93b1[_0x77da('0x67')],'message':_0x5e93b1,'account':_0x5e93b1['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x77da('0x37'),'appdata':_0x52638b[_0x77da('0xd')]+','+(_0x5e93b1[_0x77da('0x70')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x77da('0x19')](respondWithResult(_0x186d22,null))['catch'](handleError(_0x186d22,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index c97a918..985130f 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 _0x8fb8=['isAuthenticated','/:id','show','/:id/run','run','post','create','put','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get'];(function(_0x53921b,_0x537a5a){var _0xf15b08=function(_0x5e2cde){while(--_0x5e2cde){_0x53921b['push'](_0x53921b['shift']());}};_0xf15b08(++_0x537a5a);}(_0x8fb8,0x186));var _0x88fb=function(_0x27332e,_0x247ad6){_0x27332e=_0x27332e-0x0;var _0x5882fc=_0x8fb8[_0x27332e];return _0x5882fc;};'use strict';var multer=require(_0x88fb('0x0'));var util=require('util');var path=require(_0x88fb('0x1'));var timeout=require('connect-timeout');var express=require(_0x88fb('0x2'));var router=express['Router']();var fs_extra=require(_0x88fb('0x3'));var auth=require(_0x88fb('0x4'));var interaction=require(_0x88fb('0x5'));var config=require(_0x88fb('0x6'));var controller=require(_0x88fb('0x7'));router[_0x88fb('0x8')]('/',auth[_0x88fb('0x9')](),controller['index']);router[_0x88fb('0x8')](_0x88fb('0xa'),auth[_0x88fb('0x9')](),controller[_0x88fb('0xb')]);router[_0x88fb('0x8')](_0x88fb('0xc'),auth[_0x88fb('0x9')](),controller[_0x88fb('0xd')]);router[_0x88fb('0xe')]('/',auth['isAuthenticated'](),controller[_0x88fb('0xf')]);router[_0x88fb('0x10')](_0x88fb('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x88fb('0x9')](),controller[_0x88fb('0x11')]);module[_0x88fb('0x12')]=router; \ No newline at end of file +var _0x4d97=['./schedule.controller','isAuthenticated','index','get','/:id','show','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x28888c,_0x426db0){var _0x176462=function(_0x593fb1){while(--_0x593fb1){_0x28888c['push'](_0x28888c['shift']());}};_0x176462(++_0x426db0);}(_0x4d97,0x184));var _0x74d9=function(_0x693b09,_0x3aa53e){_0x693b09=_0x693b09-0x0;var _0x160be5=_0x4d97[_0x693b09];return _0x160be5;};'use strict';var multer=require('multer');var util=require(_0x74d9('0x0'));var path=require(_0x74d9('0x1'));var timeout=require(_0x74d9('0x2'));var express=require(_0x74d9('0x3'));var router=express[_0x74d9('0x4')]();var fs_extra=require(_0x74d9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x74d9('0x6'));var config=require(_0x74d9('0x7'));var controller=require(_0x74d9('0x8'));router['get']('/',auth[_0x74d9('0x9')](),controller[_0x74d9('0xa')]);router[_0x74d9('0xb')](_0x74d9('0xc'),auth[_0x74d9('0x9')](),controller[_0x74d9('0xd')]);router[_0x74d9('0xb')]('/:id/run',auth[_0x74d9('0x9')](),controller['run']);router['post']('/',auth[_0x74d9('0x9')](),controller['create']);router[_0x74d9('0xe')](_0x74d9('0xc'),auth[_0x74d9('0x9')](),controller['update']);router[_0x74d9('0xf')](_0x74d9('0xc'),auth[_0x74d9('0x9')](),controller[_0x74d9('0x10')]);module[_0x74d9('0x11')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 8561c5c..2867cc9 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 _0xb1e6=['exports','STRING','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','BOOLEAN','TEXT','sequelize'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0xb1e6,0x153));var _0x6b1e=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0xb1e6[_0x36f243];return _0x426436;};'use strict';var Sequelize=require(_0x6b1e('0x0'));module[_0x6b1e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6b1e('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6b1e('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x6b1e('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x6b1e('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6b1e('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6b1e('0x5')](_0x6b1e('0x6'),_0x6b1e('0x7'),_0x6b1e('0x8'),_0x6b1e('0x9'),_0x6b1e('0xa'),_0x6b1e('0xb'),_0x6b1e('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize['ENUM'](_0x6b1e('0xd'),_0x6b1e('0xe'),_0x6b1e('0xf')),'allowNull':![],'defaultValue':_0x6b1e('0xd')},'type':{'type':Sequelize['ENUM'](_0x6b1e('0x10'),_0x6b1e('0x11')),'allowNull':![],'defaultValue':_0x6b1e('0x10')},'sendMail':{'type':Sequelize[_0x6b1e('0x12')],'defaultValue':![]},'email':{'type':Sequelize[_0x6b1e('0x2')]},'cc':{'type':Sequelize[_0x6b1e('0x13')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x6b1e('0x12')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc639=['custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months','weeks','days','hours','minutes','pdf','xlsx','csv'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xc639,0x8f));var _0x9c63=function(_0x25dcfe,_0x59d09a){_0x25dcfe=_0x25dcfe-0x0;var _0x9f9cc3=_0xc639[_0x25dcfe];return _0x9f9cc3;};'use strict';var Sequelize=require(_0x9c63('0x0'));module[_0x9c63('0x1')]={'name':{'type':Sequelize[_0x9c63('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9c63('0x2')]},'active':{'type':Sequelize[_0x9c63('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9c63('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x9c63('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9c63('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9c63('0x7')]('years',_0x9c63('0x8'),_0x9c63('0x9'),_0x9c63('0xa'),_0x9c63('0xb'),_0x9c63('0xc'),_0x9c63('0xd')),'allowNull':![],'defaultValue':_0x9c63('0xb')},'output':{'type':Sequelize['ENUM']('csv',_0x9c63('0xe'),_0x9c63('0xf')),'allowNull':![],'defaultValue':_0x9c63('0x10')},'type':{'type':Sequelize['ENUM'](_0x9c63('0x11'),_0x9c63('0x12')),'allowNull':![],'defaultValue':_0x9c63('0x11')},'sendMail':{'type':Sequelize[_0x9c63('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9c63('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x9c63('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x9c63('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 6b19b3f..fe933c0 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 _0x4ec2=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','set','json','apply','reject','save','then','destroy','Scheduler','UserProfileResource','status','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','rows','catch','params','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','update','run','../../config/schedule','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x4ec2,0x9c));var _0x24ec=function(_0x4becdd,_0x2d79c4){_0x4becdd=_0x4becdd-0x0;var _0x54e49b=_0x4ec2[_0x4becdd];return _0x54e49b;};'use strict';var emlformat=require(_0x24ec('0x0'));var rimraf=require(_0x24ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x24ec('0x2'));var rp=require(_0x24ec('0x3'));var moment=require(_0x24ec('0x4'));var BPromise=require(_0x24ec('0x5'));var Mustache=require(_0x24ec('0x6'));var util=require(_0x24ec('0x7'));var path=require(_0x24ec('0x8'));var sox=require(_0x24ec('0x9'));var csv=require(_0x24ec('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x24ec('0xb'));var _=require(_0x24ec('0xc'));var squel=require(_0x24ec('0xd'));var crypto=require(_0x24ec('0xe'));var jsforce=require(_0x24ec('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x24ec('0x10'));var Redis=require(_0x24ec('0x11'));var authService=require(_0x24ec('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x24ec('0x13'));var config=require(_0x24ec('0x14'));var licenseUtil=require(_0x24ec('0x15'));var db=require(_0x24ec('0x16'))['db'];function respondWithStatusCode(_0x3c079a,_0x243824){_0x243824=_0x243824||0xcc;return function(_0x3a265f){if(_0x3a265f){return _0x3c079a[_0x24ec('0x17')](_0x243824);}return _0x3c079a['status'](_0x243824)[_0x24ec('0x18')]();};}function respondWithResult(_0x5f1a19,_0x3b7a64){_0x3b7a64=_0x3b7a64||0xc8;return function(_0xe63808){if(_0xe63808){return _0x5f1a19['status'](_0x3b7a64)['json'](_0xe63808);}};}function respondWithFilteredResult(_0x421a37,_0x414b9b){return function(_0x2cadef){if(_0x2cadef){var _0x1bd9b0=typeof _0x414b9b[_0x24ec('0x19')]===_0x24ec('0x1a')&&typeof _0x414b9b[_0x24ec('0x1b')]===_0x24ec('0x1a');var _0x536545=_0x2cadef['count'];var _0x9584a=_0x1bd9b0?0x0:_0x414b9b[_0x24ec('0x19')];var _0x570804=_0x1bd9b0?_0x2cadef['count']:_0x414b9b[_0x24ec('0x19')]+_0x414b9b[_0x24ec('0x1b')];var _0x27b93e;if(_0x570804>=_0x536545){_0x570804=_0x536545;_0x27b93e=0xc8;}else{_0x27b93e=0xce;}_0x421a37['status'](_0x27b93e);return _0x421a37[_0x24ec('0x1c')]('Content-Range',_0x9584a+'-'+_0x570804+'/'+_0x536545)[_0x24ec('0x1d')](_0x2cadef);}return null;};}function patchUpdates(_0xa70a7c){return function(_0x5197bc){try{jsonpatch[_0x24ec('0x1e')](_0x5197bc,_0xa70a7c,!![]);}catch(_0x4886a9){return BPromise[_0x24ec('0x1f')](_0x4886a9);}return _0x5197bc[_0x24ec('0x20')]();};}function saveUpdates(_0x405dbd,_0x3a148c){return function(_0x3ff1ec){if(_0x3ff1ec){return _0x3ff1ec['update'](_0x405dbd)[_0x24ec('0x21')](function(_0x4210b7){return _0x4210b7;});}return null;};}function removeEntity(_0x309b76,_0x202abf){return function(_0x28080f){if(_0x28080f){return _0x28080f[_0x24ec('0x22')]()[_0x24ec('0x21')](function(){var _0x1794b5=_0x28080f['get']({'plain':!![]});var _0x30080f=_0x24ec('0x23');return db[_0x24ec('0x24')][_0x24ec('0x22')]({'where':{'type':_0x30080f,'resourceId':_0x1794b5['id']}})[_0x24ec('0x21')](function(){return _0x28080f;});})[_0x24ec('0x21')](function(){_0x309b76[_0x24ec('0x25')](0xcc)[_0x24ec('0x18')]();});}};}function handleEntityNotFound(_0x1a4fd9,_0x5457cf){return function(_0x42558b){if(!_0x42558b){_0x1a4fd9['sendStatus'](0x194);}return _0x42558b;};}function handleError(_0x2638c0,_0x4f7298){_0x4f7298=_0x4f7298||0x1f4;return function(_0x1e56fa){logger[_0x24ec('0x26')](_0x1e56fa[_0x24ec('0x27')]);if(_0x1e56fa[_0x24ec('0x28')]){delete _0x1e56fa['name'];}_0x2638c0[_0x24ec('0x25')](_0x4f7298)[_0x24ec('0x29')](_0x1e56fa);};}exports[_0x24ec('0x2a')]=function(_0x5adbe9,_0x5f45ee){var _0x188d1b={},_0x29d859={},_0x41a784={'count':0x0,'rows':[]};var _0x54797c=_[_0x24ec('0x2b')](db[_0x24ec('0x2c')][_0x24ec('0x2d')],function(_0x4ab9d5){return{'name':_0x4ab9d5[_0x24ec('0x2e')],'type':_0x4ab9d5[_0x24ec('0x2f')][_0x24ec('0x30')]};});_0x29d859[_0x24ec('0x31')]=_['map'](_0x54797c,_0x24ec('0x28'));_0x29d859['query']=_[_0x24ec('0x32')](_0x5adbe9[_0x24ec('0x33')]);_0x29d859[_0x24ec('0x34')]=_[_0x24ec('0x35')](_0x29d859[_0x24ec('0x31')],_0x29d859[_0x24ec('0x33')]);_0x188d1b['attributes']=_['intersection'](_0x29d859[_0x24ec('0x31')],qs['fields'](_0x5adbe9[_0x24ec('0x33')][_0x24ec('0x36')]));_0x188d1b['attributes']=_0x188d1b[_0x24ec('0x37')]['length']?_0x188d1b[_0x24ec('0x37')]:_0x29d859[_0x24ec('0x31')];if(!_0x5adbe9['query'][_0x24ec('0x38')]('nolimit')){_0x188d1b[_0x24ec('0x1b')]=qs[_0x24ec('0x1b')](_0x5adbe9[_0x24ec('0x33')][_0x24ec('0x1b')]);_0x188d1b['offset']=qs['offset'](_0x5adbe9[_0x24ec('0x33')][_0x24ec('0x19')]);}_0x188d1b[_0x24ec('0x39')]=qs[_0x24ec('0x3a')](_0x5adbe9[_0x24ec('0x33')][_0x24ec('0x3a')]);_0x188d1b[_0x24ec('0x3b')]=qs['filters'](_[_0x24ec('0x3c')](_0x5adbe9[_0x24ec('0x33')],_0x29d859[_0x24ec('0x34')]),_0x54797c);if(_0x5adbe9['query']['filter']){_0x188d1b[_0x24ec('0x3b')]=_[_0x24ec('0x3d')](_0x188d1b[_0x24ec('0x3b')],{'$or':_[_0x24ec('0x2b')](_0x54797c,function(_0x4a4505){if(_0x4a4505[_0x24ec('0x2f')]!==_0x24ec('0x3e')){var _0x3bb1e1={};_0x3bb1e1[_0x4a4505[_0x24ec('0x28')]]={'$like':'%'+_0x5adbe9[_0x24ec('0x33')][_0x24ec('0x3f')]+'%'};return _0x3bb1e1;}})});}_0x188d1b=_[_0x24ec('0x3d')]({},_0x188d1b,_0x5adbe9[_0x24ec('0x40')]);var _0x1cb2ba={'where':_0x188d1b['where']};return db[_0x24ec('0x2c')][_0x24ec('0x41')](_0x1cb2ba)['then'](function(_0x133e5e){_0x41a784['count']=_0x133e5e;if(_0x5adbe9[_0x24ec('0x33')][_0x24ec('0x42')]){_0x188d1b['include']=[{'all':!![]}];}return db['Schedule']['findAll'](_0x188d1b);})[_0x24ec('0x21')](function(_0xe24de3){_0x41a784[_0x24ec('0x43')]=_0xe24de3;return _0x41a784;})[_0x24ec('0x21')](respondWithFilteredResult(_0x5f45ee,_0x188d1b))[_0x24ec('0x44')](handleError(_0x5f45ee,null));};exports['show']=function(_0xf0d78a,_0x259abb){var _0x7c53e9={'raw':![],'where':{'id':_0xf0d78a[_0x24ec('0x45')]['id']}},_0xbebf9e={};_0xbebf9e[_0x24ec('0x31')]=_[_0x24ec('0x32')](db[_0x24ec('0x2c')][_0x24ec('0x2d')]);_0xbebf9e[_0x24ec('0x33')]=_[_0x24ec('0x32')](_0xf0d78a['query']);_0xbebf9e['filters']=_[_0x24ec('0x35')](_0xbebf9e[_0x24ec('0x31')],_0xbebf9e[_0x24ec('0x33')]);_0x7c53e9[_0x24ec('0x37')]=_[_0x24ec('0x35')](_0xbebf9e[_0x24ec('0x31')],qs[_0x24ec('0x36')](_0xf0d78a[_0x24ec('0x33')][_0x24ec('0x36')]));_0x7c53e9[_0x24ec('0x37')]=_0x7c53e9['attributes']['length']?_0x7c53e9[_0x24ec('0x37')]:_0xbebf9e[_0x24ec('0x31')];if(_0xf0d78a[_0x24ec('0x33')][_0x24ec('0x42')]){_0x7c53e9['include']=[{'all':!![]}];}_0x7c53e9=_[_0x24ec('0x3d')]({},_0x7c53e9,_0xf0d78a['options']);return db[_0x24ec('0x2c')][_0x24ec('0x46')](_0x7c53e9)[_0x24ec('0x21')](handleEntityNotFound(_0x259abb,null))['then'](respondWithResult(_0x259abb,null))[_0x24ec('0x44')](handleError(_0x259abb,null));};exports[_0x24ec('0x47')]=function(_0xfe951c,_0x2fe7e1){return db[_0x24ec('0x2c')][_0x24ec('0x47')](_0xfe951c[_0x24ec('0x48')],{})[_0x24ec('0x21')](function(_0x223843){var _0x464174=_0xfe951c[_0x24ec('0x49')][_0x24ec('0x4a')]({'plain':!![]});if(!_0x464174)throw new Error(_0x24ec('0x4b'));if(_0x464174[_0x24ec('0x4c')]==='user'){var _0x3c9424=_0x223843['get']({'plain':!![]});var _0x4f68a6='Scheduler';return db[_0x24ec('0x4d')][_0x24ec('0x46')]({'where':{'name':_0x4f68a6,'userProfileId':_0x464174[_0x24ec('0x4e')]},'raw':!![]})['then'](function(_0xc395b9){if(_0xc395b9&&_0xc395b9[_0x24ec('0x4f')]===0x0){return db['UserProfileResource'][_0x24ec('0x47')]({'name':_0x3c9424['name'],'resourceId':_0x3c9424['id'],'type':_0xc395b9[_0x24ec('0x28')],'sectionId':_0xc395b9['id']},{})[_0x24ec('0x21')](function(){return _0x223843;});}else{return _0x223843;}})[_0x24ec('0x44')](function(_0x3bbb1d){logger[_0x24ec('0x26')](_0x24ec('0x50'),_0x3bbb1d);throw _0x3bbb1d;});}return _0x223843;})['then'](respondWithResult(_0x2fe7e1,0xc9))[_0x24ec('0x44')](handleError(_0x2fe7e1,null));};exports[_0x24ec('0x51')]=function(_0x2476c0,_0xcb2983){if(_0x2476c0[_0x24ec('0x48')]['id']){delete _0x2476c0[_0x24ec('0x48')]['id'];}return db[_0x24ec('0x2c')]['find']({'where':{'id':_0x2476c0[_0x24ec('0x45')]['id']}})[_0x24ec('0x21')](handleEntityNotFound(_0xcb2983,null))[_0x24ec('0x21')](saveUpdates(_0x2476c0['body'],null))[_0x24ec('0x21')](respondWithResult(_0xcb2983,null))[_0x24ec('0x44')](handleError(_0xcb2983,null));};exports[_0x24ec('0x22')]=function(_0x5367a5,_0x578bfb){return db[_0x24ec('0x2c')]['find']({'where':{'id':_0x5367a5[_0x24ec('0x45')]['id']}})['then'](handleEntityNotFound(_0x578bfb,null))['then'](removeEntity(_0x578bfb,null))[_0x24ec('0x44')](handleError(_0x578bfb,null));};exports[_0x24ec('0x52')]=function(_0x227e75,_0x3b3fc9,_0x515bd8){var _0xf339ed=require(_0x24ec('0x53'));return db[_0x24ec('0x2c')][_0x24ec('0x46')]({'where':{'id':_0x227e75[_0x24ec('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3b3fc9,null))[_0x24ec('0x21')](function(){_0xf339ed[_0x24ec('0x52')](_0x227e75[_0x24ec('0x45')]['id']);})[_0x24ec('0x21')](respondWithStatusCode(_0x3b3fc9,null))['catch'](handleError(_0x3b3fc9,null));}; \ No newline at end of file +var _0x962b=['merge','filter','options','findAll','catch','params','include','find','create','body','user','Scheduler','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','get','UserProfileResource','destroy','stack','name','send','index','Schedule','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4afeb1,_0x19a2d4){var _0x2186e6=function(_0x4a1500){while(--_0x4a1500){_0x4afeb1['push'](_0x4afeb1['shift']());}};_0x2186e6(++_0x19a2d4);}(_0x962b,0x197));var _0xb962=function(_0x17e37b,_0x53018a){_0x17e37b=_0x17e37b-0x0;var _0x25553d=_0x962b[_0x17e37b];return _0x25553d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb962('0x0'));var jsonpatch=require(_0xb962('0x1'));var rp=require('request-promise');var moment=require(_0xb962('0x2'));var BPromise=require(_0xb962('0x3'));var Mustache=require('mustache');var util=require(_0xb962('0x4'));var path=require(_0xb962('0x5'));var sox=require('sox');var csv=require(_0xb962('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb962('0x7'));var _=require(_0xb962('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb962('0x9'));var deskjs=require(_0xb962('0xa'));var toCsv=require(_0xb962('0x6'));var querystring=require(_0xb962('0xb'));var Papa=require(_0xb962('0xc'));var Redis=require(_0xb962('0xd'));var authService=require(_0xb962('0xe'));var qs=require(_0xb962('0xf'));var as=require(_0xb962('0x10'));var hardwareService=require(_0xb962('0x11'));var logger=require('../../config/logger')(_0xb962('0x12'));var utils=require('../../config/utils');var config=require(_0xb962('0x13'));var licenseUtil=require(_0xb962('0x14'));var db=require(_0xb962('0x15'))['db'];function respondWithStatusCode(_0x47f49f,_0x3a3486){_0x3a3486=_0x3a3486||0xcc;return function(_0x2d700f){if(_0x2d700f){return _0x47f49f[_0xb962('0x16')](_0x3a3486);}return _0x47f49f[_0xb962('0x17')](_0x3a3486)[_0xb962('0x18')]();};}function respondWithResult(_0x594c2d,_0x46bc2e){_0x46bc2e=_0x46bc2e||0xc8;return function(_0x5ad93e){if(_0x5ad93e){return _0x594c2d[_0xb962('0x17')](_0x46bc2e)[_0xb962('0x19')](_0x5ad93e);}};}function respondWithFilteredResult(_0x368191,_0x470182){return function(_0x1c4370){if(_0x1c4370){var _0x41f3b2=typeof _0x470182[_0xb962('0x1a')]===_0xb962('0x1b')&&typeof _0x470182[_0xb962('0x1c')]==='undefined';var _0x5d16b4=_0x1c4370[_0xb962('0x1d')];var _0x6936cf=_0x41f3b2?0x0:_0x470182[_0xb962('0x1a')];var _0x198f97=_0x41f3b2?_0x1c4370[_0xb962('0x1d')]:_0x470182[_0xb962('0x1a')]+_0x470182[_0xb962('0x1c')];var _0x57e33e;if(_0x198f97>=_0x5d16b4){_0x198f97=_0x5d16b4;_0x57e33e=0xc8;}else{_0x57e33e=0xce;}_0x368191[_0xb962('0x17')](_0x57e33e);return _0x368191[_0xb962('0x1e')]('Content-Range',_0x6936cf+'-'+_0x198f97+'/'+_0x5d16b4)['json'](_0x1c4370);}return null;};}function patchUpdates(_0x25442b){return function(_0x73938a){try{jsonpatch[_0xb962('0x1f')](_0x73938a,_0x25442b,!![]);}catch(_0x1d565b){return BPromise[_0xb962('0x20')](_0x1d565b);}return _0x73938a['save']();};}function saveUpdates(_0x5cfabb,_0x581548){return function(_0x2d26af){if(_0x2d26af){return _0x2d26af[_0xb962('0x21')](_0x5cfabb)[_0xb962('0x22')](function(_0x2f0831){return _0x2f0831;});}return null;};}function removeEntity(_0xfc76a1,_0x5b6c92){return function(_0x364b7f){if(_0x364b7f){return _0x364b7f['destroy']()[_0xb962('0x22')](function(){var _0x49a763=_0x364b7f[_0xb962('0x23')]({'plain':!![]});var _0x1e40ab='Scheduler';return db[_0xb962('0x24')][_0xb962('0x25')]({'where':{'type':_0x1e40ab,'resourceId':_0x49a763['id']}})[_0xb962('0x22')](function(){return _0x364b7f;});})['then'](function(){_0xfc76a1['status'](0xcc)[_0xb962('0x18')]();});}};}function handleEntityNotFound(_0x46f09f,_0x4dc160){return function(_0x3e5402){if(!_0x3e5402){_0x46f09f[_0xb962('0x16')](0x194);}return _0x3e5402;};}function handleError(_0x68c94c,_0x8e5aa9){_0x8e5aa9=_0x8e5aa9||0x1f4;return function(_0x5b6de0){logger['error'](_0x5b6de0[_0xb962('0x26')]);if(_0x5b6de0['name']){delete _0x5b6de0[_0xb962('0x27')];}_0x68c94c[_0xb962('0x17')](_0x8e5aa9)[_0xb962('0x28')](_0x5b6de0);};}exports[_0xb962('0x29')]=function(_0x1bb4f3,_0x58c50d){var _0x15be83={},_0x521e18={},_0x1dc8a4={'count':0x0,'rows':[]};var _0x42eb86=_['map'](db[_0xb962('0x2a')][_0xb962('0x2b')],function(_0x2a41fc){return{'name':_0x2a41fc['fieldName'],'type':_0x2a41fc[_0xb962('0x2c')][_0xb962('0x2d')]};});_0x521e18[_0xb962('0x2e')]=_[_0xb962('0x2f')](_0x42eb86,_0xb962('0x27'));_0x521e18['query']=_[_0xb962('0x30')](_0x1bb4f3['query']);_0x521e18[_0xb962('0x31')]=_[_0xb962('0x32')](_0x521e18['model'],_0x521e18[_0xb962('0x33')]);_0x15be83[_0xb962('0x34')]=_[_0xb962('0x32')](_0x521e18[_0xb962('0x2e')],qs[_0xb962('0x35')](_0x1bb4f3['query']['fields']));_0x15be83[_0xb962('0x34')]=_0x15be83[_0xb962('0x34')][_0xb962('0x36')]?_0x15be83['attributes']:_0x521e18[_0xb962('0x2e')];if(!_0x1bb4f3['query'][_0xb962('0x37')](_0xb962('0x38'))){_0x15be83[_0xb962('0x1c')]=qs[_0xb962('0x1c')](_0x1bb4f3[_0xb962('0x33')][_0xb962('0x1c')]);_0x15be83['offset']=qs['offset'](_0x1bb4f3['query'][_0xb962('0x1a')]);}_0x15be83[_0xb962('0x39')]=qs[_0xb962('0x3a')](_0x1bb4f3[_0xb962('0x33')][_0xb962('0x3a')]);_0x15be83[_0xb962('0x3b')]=qs[_0xb962('0x31')](_[_0xb962('0x3c')](_0x1bb4f3[_0xb962('0x33')],_0x521e18[_0xb962('0x31')]),_0x42eb86);if(_0x1bb4f3[_0xb962('0x33')]['filter']){_0x15be83[_0xb962('0x3b')]=_[_0xb962('0x3d')](_0x15be83[_0xb962('0x3b')],{'$or':_[_0xb962('0x2f')](_0x42eb86,function(_0xc0db02){if(_0xc0db02[_0xb962('0x2c')]!=='VIRTUAL'){var _0x322520={};_0x322520[_0xc0db02['name']]={'$like':'%'+_0x1bb4f3['query'][_0xb962('0x3e')]+'%'};return _0x322520;}})});}_0x15be83=_[_0xb962('0x3d')]({},_0x15be83,_0x1bb4f3[_0xb962('0x3f')]);var _0x4028c4={'where':_0x15be83[_0xb962('0x3b')]};return db[_0xb962('0x2a')]['count'](_0x4028c4)['then'](function(_0x34f767){_0x1dc8a4[_0xb962('0x1d')]=_0x34f767;if(_0x1bb4f3['query']['includeAll']){_0x15be83['include']=[{'all':!![]}];}return db[_0xb962('0x2a')][_0xb962('0x40')](_0x15be83);})[_0xb962('0x22')](function(_0x3ff03f){_0x1dc8a4['rows']=_0x3ff03f;return _0x1dc8a4;})[_0xb962('0x22')](respondWithFilteredResult(_0x58c50d,_0x15be83))[_0xb962('0x41')](handleError(_0x58c50d,null));};exports['show']=function(_0x54556b,_0x128ff4){var _0x228861={'raw':![],'where':{'id':_0x54556b[_0xb962('0x42')]['id']}},_0x59a16a={};_0x59a16a[_0xb962('0x2e')]=_['keys'](db[_0xb962('0x2a')][_0xb962('0x2b')]);_0x59a16a['query']=_[_0xb962('0x30')](_0x54556b[_0xb962('0x33')]);_0x59a16a[_0xb962('0x31')]=_[_0xb962('0x32')](_0x59a16a[_0xb962('0x2e')],_0x59a16a['query']);_0x228861[_0xb962('0x34')]=_[_0xb962('0x32')](_0x59a16a[_0xb962('0x2e')],qs[_0xb962('0x35')](_0x54556b[_0xb962('0x33')][_0xb962('0x35')]));_0x228861[_0xb962('0x34')]=_0x228861['attributes']['length']?_0x228861[_0xb962('0x34')]:_0x59a16a[_0xb962('0x2e')];if(_0x54556b[_0xb962('0x33')]['includeAll']){_0x228861[_0xb962('0x43')]=[{'all':!![]}];}_0x228861=_[_0xb962('0x3d')]({},_0x228861,_0x54556b[_0xb962('0x3f')]);return db['Schedule'][_0xb962('0x44')](_0x228861)['then'](handleEntityNotFound(_0x128ff4,null))['then'](respondWithResult(_0x128ff4,null))[_0xb962('0x41')](handleError(_0x128ff4,null));};exports[_0xb962('0x45')]=function(_0x43e1a3,_0x587f96){return db['Schedule']['create'](_0x43e1a3[_0xb962('0x46')],{})['then'](function(_0x5f562f){var _0x49085d=_0x43e1a3[_0xb962('0x47')][_0xb962('0x23')]({'plain':!![]});if(!_0x49085d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49085d['role']===_0xb962('0x47')){var _0x53eefb=_0x5f562f[_0xb962('0x23')]({'plain':!![]});var _0x929399=_0xb962('0x48');return db[_0xb962('0x49')]['find']({'where':{'name':_0x929399,'userProfileId':_0x49085d['userProfileId']},'raw':!![]})['then'](function(_0x48234d){if(_0x48234d&&_0x48234d[_0xb962('0x4a')]===0x0){return db[_0xb962('0x24')]['create']({'name':_0x53eefb['name'],'resourceId':_0x53eefb['id'],'type':_0x48234d[_0xb962('0x27')],'sectionId':_0x48234d['id']},{})[_0xb962('0x22')](function(){return _0x5f562f;});}else{return _0x5f562f;}})['catch'](function(_0xb30a68){logger[_0xb962('0x4b')](_0xb962('0x4c'),_0xb30a68);throw _0xb30a68;});}return _0x5f562f;})['then'](respondWithResult(_0x587f96,0xc9))[_0xb962('0x41')](handleError(_0x587f96,null));};exports[_0xb962('0x21')]=function(_0x13d004,_0x39b192){if(_0x13d004[_0xb962('0x46')]['id']){delete _0x13d004[_0xb962('0x46')]['id'];}return db[_0xb962('0x2a')][_0xb962('0x44')]({'where':{'id':_0x13d004[_0xb962('0x42')]['id']}})[_0xb962('0x22')](handleEntityNotFound(_0x39b192,null))[_0xb962('0x22')](saveUpdates(_0x13d004[_0xb962('0x46')],null))[_0xb962('0x22')](respondWithResult(_0x39b192,null))[_0xb962('0x41')](handleError(_0x39b192,null));};exports[_0xb962('0x25')]=function(_0x2ea787,_0x574f21){return db['Schedule']['find']({'where':{'id':_0x2ea787[_0xb962('0x42')]['id']}})[_0xb962('0x22')](handleEntityNotFound(_0x574f21,null))[_0xb962('0x22')](removeEntity(_0x574f21,null))[_0xb962('0x41')](handleError(_0x574f21,null));};exports[_0xb962('0x4d')]=function(_0x5e5043,_0x7a0de5,_0x1291d5){var _0x52c48d=require('../../config/schedule');return db['Schedule']['find']({'where':{'id':_0x5e5043[_0xb962('0x42')]['id']},'raw':!![]})[_0xb962('0x22')](handleEntityNotFound(_0x7a0de5,null))[_0xb962('0x22')](function(){_0x52c48d[_0xb962('0x4d')](_0x5e5043[_0xb962('0x42')]['id']);})[_0xb962('0x22')](respondWithStatusCode(_0x7a0de5,null))[_0xb962('0x41')](handleError(_0x7a0de5,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 667e3fd..2408274 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 _0x2525=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','define','Schedule','lodash','../../config/logger','api','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2525,0x170));var _0x5252=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x2525[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x5252('0x0'));var util=require('util');var logger=require(_0x5252('0x1'))(_0x5252('0x2'));var moment=require(_0x5252('0x3'));var BPromise=require(_0x5252('0x4'));var rp=require(_0x5252('0x5'));var fs=require('fs');var path=require(_0x5252('0x6'));var rimraf=require(_0x5252('0x7'));var config=require(_0x5252('0x8'));var attributes=require(_0x5252('0x9'));module['exports']=function(_0x3a362e,_0x3badb5){return _0x3a362e[_0x5252('0xa')](_0x5252('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e97=['util','api','bluebird','path','rimraf','exports','Schedule','tools_schedules'];(function(_0x4f0cce,_0x3a2d29){var _0xa29057=function(_0xb736f6){while(--_0xb736f6){_0x4f0cce['push'](_0x4f0cce['shift']());}};_0xa29057(++_0x3a2d29);}(_0x4e97,0x108));var _0x74e9=function(_0xfc8976,_0x2897dc){_0xfc8976=_0xfc8976-0x0;var _0x3fbb89=_0x4e97[_0xfc8976];return _0x3fbb89;};'use strict';var _=require('lodash');var util=require(_0x74e9('0x0'));var logger=require('../../config/logger')(_0x74e9('0x1'));var moment=require('moment');var BPromise=require(_0x74e9('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x74e9('0x3'));var rimraf=require(_0x74e9('0x4'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x74e9('0x5')]=function(_0x599897,_0x2b735a){return _0x599897['define'](_0x74e9('0x6'),attributes,{'tableName':_0x74e9('0x7'),'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 198e845..2fc3f12 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 _0x0c70=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x27ca8c,_0x231aaa){var _0x4107b7=function(_0x3b81ed){while(--_0x3b81ed){_0x27ca8c['push'](_0x27ca8c['shift']());}};_0x4107b7(++_0x231aaa);}(_0x0c70,0x14d));var _0x00c7=function(_0x57171b,_0xfe67c6){_0x57171b=_0x57171b-0x0;var _0x33a2c8=_0x0c70[_0x57171b];return _0x33a2c8;};'use strict';var _=require(_0x00c7('0x0'));var util=require(_0x00c7('0x1'));var moment=require(_0x00c7('0x2'));var BPromise=require(_0x00c7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x00c7('0x5'));var logger=require(_0x00c7('0x6'))(_0x00c7('0x7'));var config=require(_0x00c7('0x8'));var jayson=require(_0x00c7('0x9'));var client=jayson['client'][_0x00c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1786fe,_0x12a13a,_0x22a196){return new BPromise(function(_0x3e8330,_0x38c617){return client[_0x00c7('0xb')](_0x1786fe,_0x22a196)[_0x00c7('0xc')](function(_0xa2b196){logger[_0x00c7('0xd')](_0x00c7('0xe'),_0x12a13a,_0x00c7('0xf'));logger[_0x00c7('0x10')](_0x00c7('0x11'),_0x12a13a,_0x00c7('0xf'),JSON[_0x00c7('0x12')](_0xa2b196));if(_0xa2b196[_0x00c7('0x13')]){if(_0xa2b196[_0x00c7('0x13')][_0x00c7('0x14')]===0x1f4){logger[_0x00c7('0x13')](_0x00c7('0xe'),_0x12a13a,_0xa2b196['error'][_0x00c7('0x15')]);return _0x38c617(_0xa2b196[_0x00c7('0x13')][_0x00c7('0x15')]);}logger[_0x00c7('0x13')]('Schedule,\x20%s,\x20%s',_0x12a13a,_0xa2b196[_0x00c7('0x13')][_0x00c7('0x15')]);return _0x3e8330(_0xa2b196[_0x00c7('0x13')][_0x00c7('0x15')]);}else{logger[_0x00c7('0xd')]('Schedule,\x20%s,\x20%s',_0x12a13a,_0x00c7('0xf'));_0x3e8330(_0xa2b196[_0x00c7('0x16')][_0x00c7('0x15')]);}})[_0x00c7('0x17')](function(_0x43785a){logger[_0x00c7('0x13')]('Schedule,\x20%s,\x20%s',_0x12a13a,_0x43785a);_0x38c617(_0x43785a);});});} \ No newline at end of file +var _0x5960=['Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x5960,0x18a));var _0x0596=function(_0x50db6f,_0x1d5204){_0x50db6f=_0x50db6f-0x0;var _0x2babc4=_0x5960[_0x50db6f];return _0x2babc4;};'use strict';var _=require(_0x0596('0x0'));var util=require(_0x0596('0x1'));var moment=require(_0x0596('0x2'));var BPromise=require(_0x0596('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0596('0x4'));var db=require(_0x0596('0x5'))['db'];var utils=require(_0x0596('0x6'));var logger=require('../../config/logger')(_0x0596('0x7'));var config=require(_0x0596('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0596('0x9')][_0x0596('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49e4b6,_0x41c485,_0x5cc322){return new BPromise(function(_0x2ad8fc,_0x371e37){return client[_0x0596('0xb')](_0x49e4b6,_0x5cc322)[_0x0596('0xc')](function(_0x1770c4){logger[_0x0596('0xd')](_0x0596('0xe'),_0x41c485,'request\x20sent');logger[_0x0596('0xf')](_0x0596('0x10'),_0x41c485,_0x0596('0x11'),JSON[_0x0596('0x12')](_0x1770c4));if(_0x1770c4[_0x0596('0x13')]){if(_0x1770c4[_0x0596('0x13')][_0x0596('0x14')]===0x1f4){logger[_0x0596('0x13')]('Schedule,\x20%s,\x20%s',_0x41c485,_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);return _0x371e37(_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);}logger[_0x0596('0x13')](_0x0596('0xe'),_0x41c485,_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);return _0x2ad8fc(_0x1770c4[_0x0596('0x13')][_0x0596('0x15')]);}else{logger[_0x0596('0xd')](_0x0596('0xe'),_0x41c485,_0x0596('0x11'));_0x2ad8fc(_0x1770c4[_0x0596('0x16')]['message']);}})[_0x0596('0x17')](function(_0x105b76){logger[_0x0596('0x13')](_0x0596('0xe'),_0x41c485,_0x105b76);_0x371e37(_0x105b76);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 9ee03ee..8d9d398 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 _0xe751=['../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','put','update','delete','util','path','connect-timeout','Router','fs-extra'];(function(_0x4186ae,_0x5548e5){var _0x31d4b0=function(_0xf394a9){while(--_0xf394a9){_0x4186ae['push'](_0x4186ae['shift']());}};_0x31d4b0(++_0x5548e5);}(_0xe751,0x13d));var _0x1e75=function(_0x8fe868,_0x336591){_0x8fe868=_0x8fe868-0x0;var _0x20b0c5=_0xe751[_0x8fe868];return _0x20b0c5;};'use strict';var multer=require('multer');var util=require(_0x1e75('0x0'));var path=require(_0x1e75('0x1'));var timeout=require(_0x1e75('0x2'));var express=require('express');var router=express[_0x1e75('0x3')]();var fs_extra=require(_0x1e75('0x4'));var auth=require(_0x1e75('0x5'));var interaction=require(_0x1e75('0x6'));var config=require(_0x1e75('0x7'));var controller=require(_0x1e75('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1e75('0x9')]);router[_0x1e75('0xa')](_0x1e75('0xb'),auth[_0x1e75('0xc')](),controller[_0x1e75('0xd')]);router['get'](_0x1e75('0xe'),auth[_0x1e75('0xc')](),controller[_0x1e75('0xf')]);router[_0x1e75('0xa')](_0x1e75('0x10'),auth['isAuthenticated'](),controller[_0x1e75('0x11')]);router[_0x1e75('0x12')]('/',auth[_0x1e75('0xc')](),controller[_0x1e75('0x13')]);router[_0x1e75('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x1e75('0x15')]);router[_0x1e75('0x16')](_0x1e75('0xe'),auth[_0x1e75('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf850=['../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','create','put','update','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xf97939,_0x5ec5d2){var _0x5dafbc=function(_0x5801b9){while(--_0x5801b9){_0xf97939['push'](_0xf97939['shift']());}};_0x5dafbc(++_0x5ec5d2);}(_0xf850,0x9a));var _0x0f85=function(_0x1131ec,_0xc5a9a0){_0x1131ec=_0x1131ec-0x0;var _0x36c12a=_0xf850[_0x1131ec];return _0x36c12a;};'use strict';var multer=require('multer');var util=require(_0x0f85('0x0'));var path=require(_0x0f85('0x1'));var timeout=require(_0x0f85('0x2'));var express=require(_0x0f85('0x3'));var router=express['Router']();var fs_extra=require(_0x0f85('0x4'));var auth=require(_0x0f85('0x5'));var interaction=require(_0x0f85('0x6'));var config=require('../../config/environment');var controller=require('./screenRecording.controller');router[_0x0f85('0x7')]('/',auth[_0x0f85('0x8')](),controller[_0x0f85('0x9')]);router[_0x0f85('0x7')](_0x0f85('0xa'),auth['isAuthenticated'](),controller[_0x0f85('0xb')]);router[_0x0f85('0x7')](_0x0f85('0xc'),auth[_0x0f85('0x8')](),controller['show']);router['get'](_0x0f85('0xd'),auth[_0x0f85('0x8')](),controller[_0x0f85('0xe')]);router[_0x0f85('0xf')]('/',auth[_0x0f85('0x8')](),controller[_0x0f85('0x10')]);router[_0x0f85('0x11')](_0x0f85('0xc'),auth['isAuthenticated'](),controller[_0x0f85('0x12')]);router['delete'](_0x0f85('0xc'),auth[_0x0f85('0x8')](),controller['destroy']);module[_0x0f85('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 90860f4..9e7e806 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 _0x723c=['format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','moment','path','exports','getDataValue','value','extname','STRING','setDataValue','INTEGER','subtract','closedAt','DATE','startedAt'];(function(_0x458270,_0x264f98){var _0x2e5e76=function(_0x4a6c91){while(--_0x4a6c91){_0x458270['push'](_0x458270['shift']());}};_0x2e5e76(++_0x264f98);}(_0x723c,0x1ad));var _0xc723=function(_0x4f3637,_0x5658c0){_0x4f3637=_0x4f3637-0x0;var _0x5bc96b=_0x723c[_0x4f3637];return _0x5bc96b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc723('0x0'));var path=require(_0xc723('0x1'));var config=require('../../config/environment');module[_0xc723('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc723('0x3')](_0xc723('0x4'))?path[_0xc723('0x5')](this[_0xc723('0x3')](_0xc723('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xc723('0x6')]},'channel':{'type':Sequelize[_0xc723('0x6')]},'value':{'type':Sequelize['STRING'],'set':function(_0x94e3de){var _0x3e887f=_0x94e3de['replace'](/\\/g,'/');this[_0xc723('0x7')](_0xc723('0x4'),_0x3e887f);}},'rating':{'type':Sequelize[_0xc723('0x8')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc723('0x8')],'set':function(_0x3d17ff){this['setDataValue']('startedAt',moment()[_0xc723('0x9')](_0x3d17ff,'ms'));this[_0xc723('0x7')](_0xc723('0xa'),moment());this[_0xc723('0x7')]('duration',_0x3d17ff);}},'startedAt':{'type':Sequelize[_0xc723('0xb')],'get':function(){return moment(this[_0xc723('0x3')](_0xc723('0xc')))[_0xc723('0xd')](_0xc723('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0xc723('0xb')],'get':function(){return moment(this[_0xc723('0x3')](_0xc723('0xa')))[_0xc723('0xd')](_0xc723('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0xc723('0xb')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xc723('0xd')](_0xc723('0xe'))[_0xc723('0xf')]();}},'updatedAt':{'type':Sequelize[_0xc723('0xb')],'get':function(){return moment(this[_0xc723('0x3')](_0xc723('0x10')))[_0xc723('0xd')](_0xc723('0xe'))['toString']();}}}; \ No newline at end of file +var _0x7334=['startedAt','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','sequelize','moment','path','VIRTUAL','value','extname','getDataValue','STRING','replace','setDataValue','INTEGER'];(function(_0x22646e,_0x25adf5){var _0xc7ab07=function(_0x1760ee){while(--_0x1760ee){_0x22646e['push'](_0x22646e['shift']());}};_0xc7ab07(++_0x25adf5);}(_0x7334,0x184));var _0x4733=function(_0x5cef3d,_0x2d5cba){_0x5cef3d=_0x5cef3d-0x0;var _0x2a8e65=_0x7334[_0x5cef3d];return _0x2a8e65;};'use strict';var Sequelize=require(_0x4733('0x0'));var moment=require(_0x4733('0x1'));var path=require(_0x4733('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize[_0x4733('0x3')],'get':function(){return this['getDataValue'](_0x4733('0x4'))?path[_0x4733('0x5')](this[_0x4733('0x6')](_0x4733('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x4733('0x7')]},'channel':{'type':Sequelize[_0x4733('0x7')]},'value':{'type':Sequelize[_0x4733('0x7')],'set':function(_0x283754){var _0x12cafa=_0x283754[_0x4733('0x8')](/\\/g,'/');this[_0x4733('0x9')](_0x4733('0x4'),_0x12cafa);}},'rating':{'type':Sequelize[_0x4733('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x4733('0xa')],'set':function(_0x2d5fde){this[_0x4733('0x9')](_0x4733('0xb'),moment()['subtract'](_0x2d5fde,'ms'));this[_0x4733('0x9')](_0x4733('0xc'),moment());this['setDataValue'](_0x4733('0xd'),_0x2d5fde);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4733('0x6')](_0x4733('0xb')))[_0x4733('0xe')](_0x4733('0xf'))[_0x4733('0x10')]();}},'closedAt':{'type':Sequelize[_0x4733('0x11')],'get':function(){return moment(this[_0x4733('0x6')]('closedAt'))[_0x4733('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x4733('0x10')]();}},'createdAt':{'type':Sequelize[_0x4733('0x11')],'get':function(){return moment(this[_0x4733('0x6')](_0x4733('0x12')))[_0x4733('0xe')](_0x4733('0xf'))[_0x4733('0x10')]();}},'updatedAt':{'type':Sequelize[_0x4733('0x11')],'get':function(){return moment(this[_0x4733('0x6')]('updatedAt'))[_0x4733('0xe')](_0x4733('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 5d5dd0d..e1ce800 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 _0x207c=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','duration','createdAt','value','describe','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb'];(function(_0x325c04,_0x522320){var _0x11d3d1=function(_0x41b180){while(--_0x41b180){_0x325c04['push'](_0x325c04['shift']());}};_0x11d3d1(++_0x522320);}(_0x207c,0x1e8));var _0xc207=function(_0x51a8b3,_0x35a867){_0x51a8b3=_0x51a8b3-0x0;var _0x370673=_0x207c[_0x51a8b3];return _0x370673;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc207('0x0'));var zipdir=require(_0xc207('0x1'));var jsonpatch=require(_0xc207('0x2'));var rp=require(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var BPromise=require(_0xc207('0x5'));var Mustache=require(_0xc207('0x6'));var util=require('util');var path=require(_0xc207('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc207('0x8'));var _=require(_0xc207('0x9'));var squel=require(_0xc207('0xa'));var crypto=require('crypto');var jsforce=require(_0xc207('0xb'));var deskjs=require(_0xc207('0xc'));var toCsv=require(_0xc207('0xd'));var querystring=require('querystring');var Papa=require(_0xc207('0xe'));var Redis=require(_0xc207('0xf'));var authService=require(_0xc207('0x10'));var qs=require(_0xc207('0x11'));var as=require(_0xc207('0x12'));var hardwareService=require(_0xc207('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc207('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc207('0x15'))['db'];function respondWithStatusCode(_0x2782ce,_0x59d401){_0x59d401=_0x59d401||0xcc;return function(_0x3e1108){if(_0x3e1108){return _0x2782ce[_0xc207('0x16')](_0x59d401);}return _0x2782ce[_0xc207('0x17')](_0x59d401)[_0xc207('0x18')]();};}function respondWithResult(_0xe993a0,_0x51e967){_0x51e967=_0x51e967||0xc8;return function(_0xc62672){if(_0xc62672){return _0xe993a0[_0xc207('0x17')](_0x51e967)[_0xc207('0x19')](_0xc62672);}};}function respondWithFilteredResult(_0x4031ad,_0x4ef6c4){return function(_0x564cef){if(_0x564cef){var _0x554e5c=typeof _0x4ef6c4[_0xc207('0x1a')]===_0xc207('0x1b')&&typeof _0x4ef6c4[_0xc207('0x1c')]===_0xc207('0x1b');var _0x4b8f44=_0x564cef[_0xc207('0x1d')];var _0x282595=_0x554e5c?0x0:_0x4ef6c4[_0xc207('0x1a')];var _0x5f288e=_0x554e5c?_0x564cef[_0xc207('0x1d')]:_0x4ef6c4['offset']+_0x4ef6c4[_0xc207('0x1c')];var _0x33ddb1;if(_0x5f288e>=_0x4b8f44){_0x5f288e=_0x4b8f44;_0x33ddb1=0xc8;}else{_0x33ddb1=0xce;}_0x4031ad[_0xc207('0x17')](_0x33ddb1);return _0x4031ad[_0xc207('0x1e')](_0xc207('0x1f'),_0x282595+'-'+_0x5f288e+'/'+_0x4b8f44)[_0xc207('0x19')](_0x564cef);}return null;};}function patchUpdates(_0x35c0b0){return function(_0x464dea){try{jsonpatch[_0xc207('0x20')](_0x464dea,_0x35c0b0,!![]);}catch(_0x2bd2eb){return BPromise[_0xc207('0x21')](_0x2bd2eb);}return _0x464dea[_0xc207('0x22')]();};}function saveUpdates(_0x40de25,_0x4b52a7){return function(_0x163b36){if(_0x163b36){return _0x163b36['update'](_0x40de25)[_0xc207('0x23')](function(_0x3ac142){return _0x3ac142;});}return null;};}function removeEntity(_0x1eabe8,_0x83253f){return function(_0x3539f4){if(_0x3539f4){return _0x3539f4[_0xc207('0x24')]()[_0xc207('0x23')](function(){_0x1eabe8[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();});}};}function handleEntityNotFound(_0x2385f7,_0x25c91e){return function(_0x27df03){if(!_0x27df03){_0x2385f7[_0xc207('0x16')](0x194);}return _0x27df03;};}function handleError(_0x138970,_0x1445d3){_0x1445d3=_0x1445d3||0x1f4;return function(_0x56a066){logger[_0xc207('0x25')](_0x56a066['stack']);if(_0x56a066['name']){delete _0x56a066[_0xc207('0x26')];}_0x138970[_0xc207('0x17')](_0x1445d3)[_0xc207('0x27')](_0x56a066);};}exports[_0xc207('0x28')]=function(_0x6a653d,_0x478af7){var _0xe5e848={},_0x463ac8={},_0x6223ef={'count':0x0,'rows':[]};var _0x1bec3f=_[_0xc207('0x29')](db[_0xc207('0x2a')][_0xc207('0x2b')],function(_0x27bc72){return{'name':_0x27bc72[_0xc207('0x2c')],'type':_0x27bc72[_0xc207('0x2d')][_0xc207('0x2e')]};});_0x463ac8[_0xc207('0x2f')]=_[_0xc207('0x30')](_['map'](_0x1bec3f,_0xc207('0x26')),[_0xc207('0x31')]);_0x463ac8[_0xc207('0x32')]=_[_0xc207('0x33')](_0x6a653d[_0xc207('0x32')]);_0x463ac8[_0xc207('0x34')]=_['intersection'](_0x463ac8[_0xc207('0x2f')],_0x463ac8[_0xc207('0x32')]);_0xe5e848[_0xc207('0x35')]=_[_0xc207('0x36')](_0x463ac8['model'],qs[_0xc207('0x37')](_0x6a653d[_0xc207('0x32')][_0xc207('0x37')]));_0xe5e848[_0xc207('0x35')]=_0xe5e848[_0xc207('0x35')][_0xc207('0x38')]?_0xe5e848[_0xc207('0x35')]:_0x463ac8[_0xc207('0x2f')];if(!_0x6a653d[_0xc207('0x32')]['hasOwnProperty']('nolimit')){_0xe5e848[_0xc207('0x1c')]=qs[_0xc207('0x1c')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1c')]);_0xe5e848['offset']=qs[_0xc207('0x1a')](_0x6a653d[_0xc207('0x32')][_0xc207('0x1a')]);}_0xe5e848[_0xc207('0x39')]=qs[_0xc207('0x3a')](_0x6a653d['query'][_0xc207('0x3a')]);_0xe5e848[_0xc207('0x3b')]=qs['filters'](_[_0xc207('0x3c')](_0x6a653d['query'],_0x463ac8[_0xc207('0x34')]),_0x1bec3f);if(_0x6a653d[_0xc207('0x32')]['filter']){_0xe5e848[_0xc207('0x3b')]=_[_0xc207('0x3d')](_0xe5e848[_0xc207('0x3b')],{'$or':_['map'](_0x1bec3f,function(_0x5b3041){if(_0x5b3041[_0xc207('0x2d')]!==_0xc207('0x3e')){var _0x41d66c={};_0x41d66c[_0x5b3041[_0xc207('0x26')]]={'$like':'%'+_0x6a653d['query'][_0xc207('0x3f')]+'%'};return _0x41d66c;}})});}_0xe5e848=_['merge']({},_0xe5e848,_0x6a653d['options']);var _0x4c10ed={'where':_0xe5e848['where']};return db[_0xc207('0x2a')][_0xc207('0x1d')](_0x4c10ed)[_0xc207('0x23')](function(_0x487f98){_0x6223ef[_0xc207('0x1d')]=_0x487f98;if(_0x6a653d[_0xc207('0x32')][_0xc207('0x40')]){_0xe5e848[_0xc207('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0xc207('0x42')](_0xe5e848);})[_0xc207('0x23')](function(_0x123a46){_0x6223ef[_0xc207('0x43')]=_0x123a46;return _0x6223ef;})[_0xc207('0x23')](respondWithFilteredResult(_0x478af7,_0xe5e848))['catch'](handleError(_0x478af7,null));};exports[_0xc207('0x44')]=function(_0x19a67d,_0x3a935a){var _0x471a85={'raw':![],'where':{'id':_0x19a67d[_0xc207('0x45')]['id']}},_0x153490={};_0x153490[_0xc207('0x2f')]=_[_0xc207('0x33')](db[_0xc207('0x2a')]['rawAttributes']);_0x153490[_0xc207('0x32')]=_[_0xc207('0x33')](_0x19a67d['query']);_0x153490[_0xc207('0x34')]=_[_0xc207('0x36')](_0x153490[_0xc207('0x2f')],_0x153490[_0xc207('0x32')]);_0x471a85[_0xc207('0x35')]=_['intersection'](_0x153490[_0xc207('0x2f')],qs[_0xc207('0x37')](_0x19a67d[_0xc207('0x32')]['fields']));_0x471a85[_0xc207('0x35')]=_0x471a85[_0xc207('0x35')][_0xc207('0x38')]?_0x471a85[_0xc207('0x35')]:_0x153490['model'];if(_0x19a67d['query'][_0xc207('0x40')]){_0x471a85[_0xc207('0x41')]=[{'all':!![]}];}_0x471a85=_[_0xc207('0x3d')]({},_0x471a85,_0x19a67d[_0xc207('0x46')]);return db[_0xc207('0x2a')][_0xc207('0x47')](_0x471a85)[_0xc207('0x23')](handleEntityNotFound(_0x3a935a,null))[_0xc207('0x23')](respondWithResult(_0x3a935a,null))[_0xc207('0x48')](handleError(_0x3a935a,null));};exports[_0xc207('0x49')]=function(_0x2afcd1,_0x2fda4f){return db['ScreenRecording']['create'](_0x2afcd1[_0xc207('0x4a')],{})[_0xc207('0x23')](respondWithResult(_0x2fda4f,0xc9))[_0xc207('0x48')](handleError(_0x2fda4f,null));};exports['update']=function(_0x2b89e0,_0x3f712d){if(_0x2b89e0[_0xc207('0x4a')]['id']){delete _0x2b89e0[_0xc207('0x4a')]['id'];}delete _0x2b89e0['body'][_0xc207('0x4b')];delete _0x2b89e0['body'][_0xc207('0x4c')];delete _0x2b89e0['body']['closedAt'];delete _0x2b89e0[_0xc207('0x4a')][_0xc207('0x4d')];return db['ScreenRecording']['find']({'where':{'id':_0x2b89e0['params']['id']}})[_0xc207('0x23')](handleEntityNotFound(_0x3f712d,null))[_0xc207('0x23')](saveUpdates(_0x2b89e0[_0xc207('0x4a')],null))[_0xc207('0x23')](respondWithResult(_0x3f712d,null))[_0xc207('0x48')](handleError(_0x3f712d,null));};exports[_0xc207('0x4e')]=function(_0x3dc457,_0x1dfdee){return db['ScreenRecording'][_0xc207('0x4e')]()[_0xc207('0x23')](respondWithResult(_0x1dfdee,null))['catch'](handleError(_0x1dfdee,null));};exports['download']=function(_0x362001,_0x47c630,_0x49a78b){var _0x2634d6=require(_0xc207('0x4f'));var _0x356c8c=![];var _0x3b2448={};if(_0x362001[_0xc207('0x32')][_0xc207('0x2d')]&&_0x362001[_0xc207('0x32')][_0xc207('0x2d')]===_0xc207('0x50')){_0x3b2448[_0xc207('0x50')]=_0x362001[_0xc207('0x45')]['id'];}else{_0x3b2448['id']=_0x362001['params']['id'];}return db['ScreenRecording'][_0xc207('0x47')]({'where':_0x3b2448,'attributes':['id',_0xc207('0x4d')],'raw':!![]})[_0xc207('0x23')](handleEntityNotFound(_0x47c630,null))[_0xc207('0x23')](function(_0xaff7a0){if(_0xaff7a0){var _0x21c12b=path[_0xc207('0x51')](config[_0xc207('0x52')],_0xc207('0x53'),_0xaff7a0['value']);var _0x1cc4e3=util[_0xc207('0x31')](_0xc207('0x54'),_0x21c12b);if(fs[_0xc207('0x55')](_0x1cc4e3)){_0x356c8c=!![];return _0x2634d6['decryptFile'](_0x1cc4e3,_0x21c12b,config[_0xc207('0x56')][_0xc207('0x57')])[_0xc207('0x23')](function(){return _0xaff7a0;});}return _0xaff7a0;}})[_0xc207('0x23')](function(_0x464263){if(_0x464263){var _0x45ad58=path[_0xc207('0x51')](config['root'],_0xc207('0x53'),_0x464263[_0xc207('0x4d')]);if(!fs[_0xc207('0x55')](_0x45ad58)){throw new db[(_0xc207('0x58'))]['ValidationError'](_0xc207('0x59'));}if(_0x464263['filename']){return _0x47c630['download'](_0x45ad58,_0x464263[_0xc207('0x5a')]+path[_0xc207('0x5b')](_0x45ad58),function(){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}else{return _0x47c630[_0xc207('0x5d')](_0x45ad58,function(_0x441d5f){if(_0x356c8c){fs[_0xc207('0x5c')](_0x45ad58);}});}}})[_0xc207('0x48')](function(_0x33c372){if(_0x33c372[_0xc207('0x5e')]===_0xc207('0x59')){_0x47c630[_0xc207('0x17')](0x194)[_0xc207('0x27')](_0xc207('0x5f'));}else{return handleError(_0x47c630,null);}});};exports[_0xc207('0x24')]=function(_0x282ae5,_0x501bca){return db[_0xc207('0x2a')]['find']({'where':{'id':_0x282ae5[_0xc207('0x45')]['id']}})[_0xc207('0x23')](function(_0x2ade23){if(_['isNil'](_0x2ade23)){throw new ReferenceError('Entity\x20not\x20found');}return _0x2ade23;})[_0xc207('0x23')](function(_0x3ac0dd){var _0x2f18a2=path['join'](config[_0xc207('0x52')],_0xc207('0x53'),_0x3ac0dd[_0xc207('0x4d')]);logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2f18a2);if(!_[_0xc207('0x60')](_0x3ac0dd['value'])&&fs[_0xc207('0x55')](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}_0x2f18a2=_0x2f18a2+_0xc207('0x65');if(!_[_0xc207('0x60')](_0x3ac0dd[_0xc207('0x4d')])&&fs['existsSync'](_0x2f18a2)){logger[_0xc207('0x61')](_0xc207('0x62')+_0x2f18a2+_0xc207('0x63'));fs[_0xc207('0x64')](_0x2f18a2);}return _0x3ac0dd;})[_0xc207('0x23')](function(_0x14050a){if(!_0x14050a)throw new InternalError();return _0x14050a[_0xc207('0x24')]();})[_0xc207('0x23')](function(){_0x501bca[_0xc207('0x17')](0xcc)[_0xc207('0x18')]();})[_0xc207('0x48')](handleError(_0x501bca,null));}; \ No newline at end of file +var _0x1cb9=['ValidationError','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','findAll','rows','catch','show','keys','length','include','options','find','create','body','duration','createdAt','value','params','describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize'];(function(_0x2ab276,_0x2fc401){var _0x46dfb1=function(_0x44f9fc){while(--_0x44f9fc){_0x2ab276['push'](_0x2ab276['shift']());}};_0x46dfb1(++_0x2fc401);}(_0x1cb9,0x14e));var _0x91cb=function(_0x44dc16,_0x287278){_0x44dc16=_0x44dc16-0x0;var _0x542e63=_0x1cb9[_0x44dc16];return _0x542e63;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x423c4f,_0x264e9b){return function(_0x4c8438){if(!_0x4c8438){_0x423c4f['sendStatus'](0x194);}return _0x4c8438;};}function handleError(_0x234eb1,_0x554350){_0x554350=_0x554350||0x1f4;return function(_0x1c67d2){logger[_0x91cb('0x27')](_0x1c67d2[_0x91cb('0x28')]);if(_0x1c67d2['name']){delete _0x1c67d2[_0x91cb('0x29')];}_0x234eb1['status'](_0x554350)[_0x91cb('0x2a')](_0x1c67d2);};}exports[_0x91cb('0x2b')]=function(_0x3b3ee6,_0x2fb473){var _0x468908={},_0x504275={},_0x2f04a3={'count':0x0,'rows':[]};var _0x52670a=_[_0x91cb('0x2c')](db[_0x91cb('0x2d')][_0x91cb('0x2e')],function(_0x4944bd){return{'name':_0x4944bd[_0x91cb('0x2f')],'type':_0x4944bd[_0x91cb('0x30')][_0x91cb('0x31')]};});_0x504275[_0x91cb('0x32')]=_[_0x91cb('0x33')](_[_0x91cb('0x2c')](_0x52670a,_0x91cb('0x29')),[_0x91cb('0x34')]);_0x504275[_0x91cb('0x35')]=_['keys'](_0x3b3ee6[_0x91cb('0x35')]);_0x504275[_0x91cb('0x36')]=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],_0x504275[_0x91cb('0x35')]);_0x468908['attributes']=_[_0x91cb('0x37')](_0x504275[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x38')]));_0x468908['attributes']=_0x468908[_0x91cb('0x39')]['length']?_0x468908['attributes']:_0x504275['model'];if(!_0x3b3ee6[_0x91cb('0x35')]['hasOwnProperty'](_0x91cb('0x3a'))){_0x468908['limit']=qs['limit'](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x1d')]);_0x468908[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x3b3ee6[_0x91cb('0x35')]['offset']);}_0x468908[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3c')]);_0x468908['where']=qs['filters'](_[_0x91cb('0x3d')](_0x3b3ee6[_0x91cb('0x35')],_0x504275['filters']),_0x52670a);if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]){_0x468908['where']=_[_0x91cb('0x3f')](_0x468908[_0x91cb('0x40')],{'$or':_['map'](_0x52670a,function(_0x43d4fe){if(_0x43d4fe['type']!==_0x91cb('0x41')){var _0xabe6a3={};_0xabe6a3[_0x43d4fe[_0x91cb('0x29')]]={'$like':'%'+_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x3e')]+'%'};return _0xabe6a3;}})});}_0x468908=_[_0x91cb('0x3f')]({},_0x468908,_0x3b3ee6['options']);var _0xa90111={'where':_0x468908[_0x91cb('0x40')]};return db['ScreenRecording'][_0x91cb('0x1e')](_0xa90111)['then'](function(_0x2c6102){_0x2f04a3[_0x91cb('0x1e')]=_0x2c6102;if(_0x3b3ee6[_0x91cb('0x35')][_0x91cb('0x42')]){_0x468908['include']=[{'all':!![]}];}return db[_0x91cb('0x2d')][_0x91cb('0x43')](_0x468908);})[_0x91cb('0x25')](function(_0x37e777){_0x2f04a3[_0x91cb('0x44')]=_0x37e777;return _0x2f04a3;})[_0x91cb('0x25')](respondWithFilteredResult(_0x2fb473,_0x468908))[_0x91cb('0x45')](handleError(_0x2fb473,null));};exports[_0x91cb('0x46')]=function(_0x325dca,_0x3cc4c1){var _0x49bc42={'raw':![],'where':{'id':_0x325dca['params']['id']}},_0x16993f={};_0x16993f[_0x91cb('0x32')]=_['keys'](db[_0x91cb('0x2d')]['rawAttributes']);_0x16993f[_0x91cb('0x35')]=_[_0x91cb('0x47')](_0x325dca[_0x91cb('0x35')]);_0x16993f[_0x91cb('0x36')]=_['intersection'](_0x16993f[_0x91cb('0x32')],_0x16993f[_0x91cb('0x35')]);_0x49bc42['attributes']=_[_0x91cb('0x37')](_0x16993f[_0x91cb('0x32')],qs[_0x91cb('0x38')](_0x325dca[_0x91cb('0x35')][_0x91cb('0x38')]));_0x49bc42[_0x91cb('0x39')]=_0x49bc42[_0x91cb('0x39')][_0x91cb('0x48')]?_0x49bc42[_0x91cb('0x39')]:_0x16993f['model'];if(_0x325dca[_0x91cb('0x35')][_0x91cb('0x42')]){_0x49bc42[_0x91cb('0x49')]=[{'all':!![]}];}_0x49bc42=_[_0x91cb('0x3f')]({},_0x49bc42,_0x325dca[_0x91cb('0x4a')]);return db[_0x91cb('0x2d')][_0x91cb('0x4b')](_0x49bc42)[_0x91cb('0x25')](handleEntityNotFound(_0x3cc4c1,null))['then'](respondWithResult(_0x3cc4c1,null))[_0x91cb('0x45')](handleError(_0x3cc4c1,null));};exports[_0x91cb('0x4c')]=function(_0x2b8b7f,_0x3b8cfd){return db['ScreenRecording'][_0x91cb('0x4c')](_0x2b8b7f[_0x91cb('0x4d')],{})['then'](respondWithResult(_0x3b8cfd,0xc9))[_0x91cb('0x45')](handleError(_0x3b8cfd,null));};exports['update']=function(_0x2c419b,_0x4c0acd){if(_0x2c419b['body']['id']){delete _0x2c419b['body']['id'];}delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4e')];delete _0x2c419b[_0x91cb('0x4d')][_0x91cb('0x4f')];delete _0x2c419b[_0x91cb('0x4d')]['closedAt'];delete _0x2c419b['body'][_0x91cb('0x50')];return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x2c419b[_0x91cb('0x51')]['id']}})['then'](handleEntityNotFound(_0x4c0acd,null))['then'](saveUpdates(_0x2c419b['body'],null))[_0x91cb('0x25')](respondWithResult(_0x4c0acd,null))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x52')]=function(_0x4aa670,_0x21463a){return db[_0x91cb('0x2d')][_0x91cb('0x52')]()[_0x91cb('0x25')](respondWithResult(_0x21463a,null))[_0x91cb('0x45')](handleError(_0x21463a,null));};exports[_0x91cb('0x53')]=function(_0x3ec250,_0x30fd4e,_0xff7c3f){var _0x20fc0a=require(_0x91cb('0x54'));var _0x5752ed=![];var _0x1e445a={};if(_0x3ec250[_0x91cb('0x35')]['type']&&_0x3ec250[_0x91cb('0x35')][_0x91cb('0x30')]==='uniqueid'){_0x1e445a[_0x91cb('0x55')]=_0x3ec250[_0x91cb('0x51')]['id'];}else{_0x1e445a['id']=_0x3ec250[_0x91cb('0x51')]['id'];}return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':_0x1e445a,'attributes':['id',_0x91cb('0x50')],'raw':!![]})[_0x91cb('0x25')](handleEntityNotFound(_0x30fd4e,null))[_0x91cb('0x25')](function(_0x3320bd){if(_0x3320bd){var _0x93ef52=path[_0x91cb('0x56')](config['root'],_0x91cb('0x57'),_0x3320bd['value']);var _0x37221e=util['format'](_0x91cb('0x58'),_0x93ef52);if(fs[_0x91cb('0x59')](_0x37221e)){_0x5752ed=!![];return _0x20fc0a[_0x91cb('0x5a')](_0x37221e,_0x93ef52,config['secrets'][_0x91cb('0x5b')])[_0x91cb('0x25')](function(){return _0x3320bd;});}return _0x3320bd;}})['then'](function(_0xef4754){if(_0xef4754){var _0x102025=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],'server/files/screen_recordings',_0xef4754[_0x91cb('0x50')]);if(!fs[_0x91cb('0x59')](_0x102025)){throw new db[(_0x91cb('0x5d'))][(_0x91cb('0x5e'))]('ScreenRecording\x20not\x20found');}if(_0xef4754[_0x91cb('0x5f')]){return _0x30fd4e[_0x91cb('0x53')](_0x102025,_0xef4754['filename']+path['extname'](_0x102025),function(){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}else{return _0x30fd4e['download'](_0x102025,function(_0x1180ac){if(_0x5752ed){fs[_0x91cb('0x60')](_0x102025);}});}}})['catch'](function(_0x4f19c8){if(_0x4f19c8[_0x91cb('0x61')]==='ScreenRecording\x20not\x20found'){_0x30fd4e[_0x91cb('0x1a')](0x194)[_0x91cb('0x2a')](_0x91cb('0x62'));}else{return handleError(_0x30fd4e,null);}});};exports['destroy']=function(_0x22fea8,_0x524400){return db[_0x91cb('0x2d')][_0x91cb('0x4b')]({'where':{'id':_0x22fea8[_0x91cb('0x51')]['id']}})[_0x91cb('0x25')](function(_0x483172){if(_[_0x91cb('0x63')](_0x483172)){throw new ReferenceError(_0x91cb('0x64'));}return _0x483172;})[_0x91cb('0x25')](function(_0x443c72){var _0xaf70c5=path[_0x91cb('0x56')](config[_0x91cb('0x5c')],_0x91cb('0x57'),_0x443c72[_0x91cb('0x50')]);logger[_0x91cb('0x65')](_0x91cb('0x66'),_0xaf70c5);if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger[_0x91cb('0x65')](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}_0xaf70c5=_0xaf70c5+_0x91cb('0x6a');if(!_[_0x91cb('0x63')](_0x443c72['value'])&&fs[_0x91cb('0x59')](_0xaf70c5)){logger['info'](_0x91cb('0x67')+_0xaf70c5+_0x91cb('0x68'));fs[_0x91cb('0x69')](_0xaf70c5);}return _0x443c72;})[_0x91cb('0x25')](function(_0x48fcfe){if(!_0x48fcfe)throw new InternalError();return _0x48fcfe[_0x91cb('0x26')]();})[_0x91cb('0x25')](function(){_0x524400[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();})[_0x91cb('0x45')](handleError(_0x524400,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 19db420..3823e54 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 _0xf0e6=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings'];(function(_0x243d1f,_0x563eb5){var _0x46b317=function(_0x503b39){while(--_0x503b39){_0x243d1f['push'](_0x243d1f['shift']());}};_0x46b317(++_0x563eb5);}(_0xf0e6,0x1a4));var _0x6f0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf0e6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6f0e('0x0'));var util=require(_0x6f0e('0x1'));var logger=require(_0x6f0e('0x2'))('api');var moment=require(_0x6f0e('0x3'));var BPromise=require(_0x6f0e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f0e('0x5'));var rimraf=require(_0x6f0e('0x6'));var config=require(_0x6f0e('0x7'));var attributes=require(_0x6f0e('0x8'));module[_0x6f0e('0x9')]=function(_0x382469,_0x237985){return _0x382469[_0x6f0e('0xa')]('ScreenRecording',attributes,{'tableName':_0x6f0e('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':['interactionid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ea1=['api','moment','bluebird','request-promise','path','./screenRecording.attributes','exports','ScreenRecording','interactionid','lodash','util'];(function(_0x58795d,_0x4826af){var _0x4c7f8d=function(_0x4666e){while(--_0x4666e){_0x58795d['push'](_0x58795d['shift']());}};_0x4c7f8d(++_0x4826af);}(_0x6ea1,0x1b6));var _0x16ea=function(_0x46f3a8,_0x3d10bf){_0x46f3a8=_0x46f3a8-0x0;var _0x45918f=_0x6ea1[_0x46f3a8];return _0x45918f;};'use strict';var _=require(_0x16ea('0x0'));var util=require(_0x16ea('0x1'));var logger=require('../../config/logger')(_0x16ea('0x2'));var moment=require(_0x16ea('0x3'));var BPromise=require(_0x16ea('0x4'));var rp=require(_0x16ea('0x5'));var fs=require('fs');var path=require(_0x16ea('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x16ea('0x7'));module[_0x16ea('0x8')]=function(_0x1b137c,_0x33ebb4){return _0x1b137c['define'](_0x16ea('0x9'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x16ea('0xa'),'fields':[_0x16ea('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 2144736..6ea97cd 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 _0xcf55=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x58fb5f,_0x45df92){var _0x17e1e3=function(_0x2226b1){while(--_0x2226b1){_0x58fb5f['push'](_0x58fb5f['shift']());}};_0x17e1e3(++_0x45df92);}(_0xcf55,0xf8));var _0x5cf5=function(_0x188bfe,_0x2517cc){_0x188bfe=_0x188bfe-0x0;var _0x1a9efa=_0xcf55[_0x188bfe];return _0x1a9efa;};'use strict';var _=require(_0x5cf5('0x0'));var util=require(_0x5cf5('0x1'));var moment=require(_0x5cf5('0x2'));var BPromise=require(_0x5cf5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5cf5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5cf5('0x5'));var logger=require(_0x5cf5('0x6'))(_0x5cf5('0x7'));var config=require(_0x5cf5('0x8'));var jayson=require(_0x5cf5('0x9'));var client=jayson['client'][_0x5cf5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9d4361,_0x1b0012,_0x5cda1d){return new BPromise(function(_0x3cb5f9,_0x375ae7){return client['request'](_0x9d4361,_0x5cda1d)[_0x5cf5('0xb')](function(_0x51cd33){logger[_0x5cf5('0xc')](_0x5cf5('0xd'),_0x1b0012,_0x5cf5('0xe'));logger[_0x5cf5('0xf')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x1b0012,_0x5cf5('0xe'),JSON[_0x5cf5('0x10')](_0x51cd33));if(_0x51cd33[_0x5cf5('0x11')]){if(_0x51cd33['error'][_0x5cf5('0x12')]===0x1f4){logger[_0x5cf5('0x11')](_0x5cf5('0xd'),_0x1b0012,_0x51cd33[_0x5cf5('0x11')][_0x5cf5('0x13')]);return _0x375ae7(_0x51cd33[_0x5cf5('0x11')][_0x5cf5('0x13')]);}logger[_0x5cf5('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x1b0012,_0x51cd33[_0x5cf5('0x11')][_0x5cf5('0x13')]);return _0x3cb5f9(_0x51cd33[_0x5cf5('0x11')][_0x5cf5('0x13')]);}else{logger['info'](_0x5cf5('0xd'),_0x1b0012,'request\x20sent');_0x3cb5f9(_0x51cd33['result'][_0x5cf5('0x13')]);}})[_0x5cf5('0x14')](function(_0x1af724){logger[_0x5cf5('0x11')](_0x5cf5('0xd'),_0x1b0012,_0x1af724);_0x375ae7(_0x1af724);});});} \ No newline at end of file +var _0xf6b4=['then','ScreenRecording,\x20%s,\x20%s','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3e083e,_0xb6ed4b){var _0x5ef262=function(_0x1a4d99){while(--_0x1a4d99){_0x3e083e['push'](_0x3e083e['shift']());}};_0x5ef262(++_0xb6ed4b);}(_0xf6b4,0x171));var _0x4f6b=function(_0x40c043,_0x1d064e){_0x40c043=_0x40c043-0x0;var _0x5c2c8d=_0xf6b4[_0x40c043];return _0x5c2c8d;};'use strict';var _=require(_0x4f6b('0x0'));var util=require(_0x4f6b('0x1'));var moment=require(_0x4f6b('0x2'));var BPromise=require(_0x4f6b('0x3'));var rs=require(_0x4f6b('0x4'));var fs=require('fs');var Redis=require(_0x4f6b('0x5'));var db=require(_0x4f6b('0x6'))['db'];var utils=require(_0x4f6b('0x7'));var logger=require(_0x4f6b('0x8'))(_0x4f6b('0x9'));var config=require(_0x4f6b('0xa'));var jayson=require(_0x4f6b('0xb'));var client=jayson[_0x4f6b('0xc')][_0x4f6b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x52d65c,_0x2356ab,_0xb9af97){return new BPromise(function(_0x338632,_0x890c23){return client[_0x4f6b('0xe')](_0x52d65c,_0xb9af97)[_0x4f6b('0xf')](function(_0x29fd54){logger['info'](_0x4f6b('0x10'),_0x2356ab,'request\x20sent');logger['debug'](_0x4f6b('0x11'),_0x2356ab,'request\x20sent',JSON[_0x4f6b('0x12')](_0x29fd54));if(_0x29fd54[_0x4f6b('0x13')]){if(_0x29fd54[_0x4f6b('0x13')][_0x4f6b('0x14')]===0x1f4){logger['error'](_0x4f6b('0x10'),_0x2356ab,_0x29fd54[_0x4f6b('0x13')][_0x4f6b('0x15')]);return _0x890c23(_0x29fd54['error'][_0x4f6b('0x15')]);}logger[_0x4f6b('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x2356ab,_0x29fd54[_0x4f6b('0x13')]['message']);return _0x338632(_0x29fd54[_0x4f6b('0x13')][_0x4f6b('0x15')]);}else{logger['info'](_0x4f6b('0x10'),_0x2356ab,_0x4f6b('0x16'));_0x338632(_0x29fd54['result']['message']);}})[_0x4f6b('0x17')](function(_0x312f3){logger[_0x4f6b('0x13')](_0x4f6b('0x10'),_0x2356ab,_0x312f3);_0x890c23(_0x312f3);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 572e7b5..49b528e 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 _0x3686=['../../components/auth/service','./setting.controller','get','isAuthenticated','getDate','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','extname','originalname','post','addLogo','format','single','file','root','preferred','addPreferred','favicon','addFavicon','put','update','multer','connect-timeout','express','fs-extra'];(function(_0xcb0eb2,_0x3906bf){var _0xbab9b8=function(_0x24fa8a){while(--_0x24fa8a){_0xcb0eb2['push'](_0xcb0eb2['shift']());}};_0xbab9b8(++_0x3906bf);}(_0x3686,0xb5));var _0x6368=function(_0x90139a,_0x3dd1f3){_0x90139a=_0x90139a-0x0;var _0x3bcb25=_0x3686[_0x90139a];return _0x3bcb25;};'use strict';var multer=require(_0x6368('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6368('0x1'));var express=require(_0x6368('0x2'));var router=express['Router']();var fs_extra=require(_0x6368('0x3'));var auth=require(_0x6368('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6368('0x5'));router[_0x6368('0x6')]('/',auth[_0x6368('0x7')](),controller['index']);router[_0x6368('0x6')]('/now',controller[_0x6368('0x8')]);router['get'](_0x6368('0x9'),controller['show']);router[_0x6368('0x6')](_0x6368('0xa'),controller[_0x6368('0xb')]);router['get'](_0x6368('0xc'),controller[_0x6368('0xd')]);router['get'](_0x6368('0xe'),controller[_0x6368('0xf')]);router[_0x6368('0x6')](_0x6368('0x10'),controller['getPreferred']);router['get'](_0x6368('0x11'),controller[_0x6368('0x12')]);var upload=multer({'storage':multer[_0x6368('0x13')]({'destination':function(_0x354337,_0xc83502,_0x19d2cc){_0x19d2cc(null,path[_0x6368('0x14')](config['root'],_0x6368('0x15')));},'filename':function(_0x572c9e,_0x3e724,_0x38d6fc){_0x38d6fc(null,util['format'](_0x6368('0x16'),'logo',path[_0x6368('0x17')](_0x3e724[_0x6368('0x18')])));}})});router[_0x6368('0x19')](_0x6368('0xa'),upload['single']('file'),controller[_0x6368('0x1a')]);var upload=multer({'storage':multer[_0x6368('0x13')]({'destination':function(_0x292218,_0x5239f8,_0x54c6dc){_0x54c6dc(null,path['join'](config['root'],_0x6368('0x15')));},'filename':function(_0x2b0758,_0x378e5e,_0x5bd293){_0x5bd293(null,util[_0x6368('0x1b')](_0x6368('0x16'),'logologin',path[_0x6368('0x17')](_0x378e5e[_0x6368('0x18')])));}})});router[_0x6368('0x19')]('/:id/logo_login',upload[_0x6368('0x1c')](_0x6368('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x6368('0x13')]({'destination':function(_0x1e6cec,_0x48d30f,_0x4e0c01){_0x4e0c01(null,path['join'](config[_0x6368('0x1e')],_0x6368('0x15')));},'filename':function(_0xe0e0f4,_0x35975a,_0x10f8d3){_0x10f8d3(null,util[_0x6368('0x1b')](_0x6368('0x16'),_0x6368('0x1f'),path[_0x6368('0x17')](_0x35975a[_0x6368('0x18')])));}})});router[_0x6368('0x19')](_0x6368('0x10'),upload[_0x6368('0x1c')](_0x6368('0x1d')),controller[_0x6368('0x20')]);var upload=multer({'storage':multer[_0x6368('0x13')]({'destination':function(_0x3fa9c4,_0x4e658e,_0x39bd20){_0x39bd20(null,path[_0x6368('0x14')](config[_0x6368('0x1e')],_0x6368('0x15')));},'filename':function(_0xad48ba,_0x3a6122,_0x50e1ac){_0x50e1ac(null,util[_0x6368('0x1b')](_0x6368('0x16'),_0x6368('0x21'),path[_0x6368('0x17')](_0x3a6122[_0x6368('0x18')])));}})});router[_0x6368('0x19')](_0x6368('0x11'),upload['single'](_0x6368('0x1d')),controller[_0x6368('0x22')]);router[_0x6368('0x23')](_0x6368('0x9'),auth[_0x6368('0x7')](),controller[_0x6368('0x24')]);module['exports']=router; \ No newline at end of file +var _0xa93d=['isAuthenticated','index','get','/now','/:id','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','getFavicon','diskStorage','join','%s%s','logo','originalname','post','single','file','root','server/files/images/logos/','logologin','extname','format','preferred','/:id/preferred','addPreferred','favicon','/:id/favicon','put','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller'];(function(_0x1521be,_0x34aa83){var _0x156a8e=function(_0x1b803c){while(--_0x1b803c){_0x1521be['push'](_0x1521be['shift']());}};_0x156a8e(++_0x34aa83);}(_0xa93d,0xe2));var _0xda93=function(_0x456717,_0x4e96eb){_0x456717=_0x456717-0x0;var _0x1bb0f4=_0xa93d[_0x456717];return _0x1bb0f4;};'use strict';var multer=require(_0xda93('0x0'));var util=require('util');var path=require(_0xda93('0x1'));var timeout=require(_0xda93('0x2'));var express=require('express');var router=express[_0xda93('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda93('0x4'));var interaction=require(_0xda93('0x5'));var config=require(_0xda93('0x6'));var controller=require(_0xda93('0x7'));router['get']('/',auth[_0xda93('0x8')](),controller[_0xda93('0x9')]);router[_0xda93('0xa')](_0xda93('0xb'),controller['getDate']);router[_0xda93('0xa')](_0xda93('0xc'),controller['show']);router['get'](_0xda93('0xd'),controller[_0xda93('0xe')]);router[_0xda93('0xa')](_0xda93('0xf'),controller[_0xda93('0x10')]);router[_0xda93('0xa')](_0xda93('0x11'),controller['gdpr']);router[_0xda93('0xa')]('/:id/preferred',controller[_0xda93('0x12')]);router['get']('/:id/favicon',controller[_0xda93('0x13')]);var upload=multer({'storage':multer[_0xda93('0x14')]({'destination':function(_0x100ec1,_0x103950,_0x4a842c){_0x4a842c(null,path[_0xda93('0x15')](config['root'],'server/files/images/logos/'));},'filename':function(_0x17fe4e,_0x3e87b2,_0x574388){_0x574388(null,util['format'](_0xda93('0x16'),_0xda93('0x17'),path['extname'](_0x3e87b2[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0xd'),upload[_0xda93('0x1a')](_0xda93('0x1b')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xba191f,_0x5cc258,_0x3b1634){_0x3b1634(null,path['join'](config[_0xda93('0x1c')],_0xda93('0x1d')));},'filename':function(_0x1be98c,_0x2937f2,_0xbf02c3){_0xbf02c3(null,util['format'](_0xda93('0x16'),_0xda93('0x1e'),path[_0xda93('0x1f')](_0x2937f2[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0xf'),upload['single'](_0xda93('0x1b')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xda93('0x14')]({'destination':function(_0x56d1b8,_0x455f89,_0x470202){_0x470202(null,path[_0xda93('0x15')](config['root'],_0xda93('0x1d')));},'filename':function(_0x26eb42,_0x154a6b,_0x58f502){_0x58f502(null,util[_0xda93('0x20')](_0xda93('0x16'),_0xda93('0x21'),path[_0xda93('0x1f')](_0x154a6b[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0x22'),upload[_0xda93('0x1a')]('file'),controller[_0xda93('0x23')]);var upload=multer({'storage':multer[_0xda93('0x14')]({'destination':function(_0x2125f6,_0x1949fc,_0x5912cf){_0x5912cf(null,path[_0xda93('0x15')](config[_0xda93('0x1c')],_0xda93('0x1d')));},'filename':function(_0x12912e,_0xd6c425,_0x3835d4){_0x3835d4(null,util[_0xda93('0x20')](_0xda93('0x16'),_0xda93('0x24'),path[_0xda93('0x1f')](_0xd6c425[_0xda93('0x18')])));}})});router[_0xda93('0x19')](_0xda93('0x25'),upload['single']('file'),controller['addFavicon']);router[_0xda93('0x26')](_0xda93('0xc'),auth[_0xda93('0x8')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 5611731..1687642 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 _0x0b0e=['INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate','UNSIGNED','sequelize'];(function(_0x5d4a2b,_0x225d79){var _0x54aba2=function(_0x3e84bd){while(--_0x3e84bd){_0x5d4a2b['push'](_0x5d4a2b['shift']());}};_0x54aba2(++_0x225d79);}(_0x0b0e,0x187));var _0xe0b0=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0x0b0e[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe0b0('0x1')](0xb),'unique':_0xe0b0('0x2'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe0b0('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x4')},'logo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe0b0('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xe0b0('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnaddr':{'type':Sequelize[_0xe0b0('0x3')]},'turnusername':{'type':Sequelize[_0xe0b0('0x3')]},'turnpassword':{'type':Sequelize[_0xe0b0('0x3')]},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe0b0('0x3')],'defaultValue':_0xe0b0('0x6')},'chatTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe0b0('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0xe0b0('0x3')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe0b0('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xe0b0('0x3')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0xe0b0('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe0b0('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xe0b0('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x6752d0,_0xbb1c54){var _0x1bd082=function(_0x3fe7d9){while(--_0x3fe7d9){_0x6752d0['push'](_0x6752d0['shift']());}};_0x1bd082(++_0xbb1c54);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5a6a6c,_0x712963){_0x5a6a6c=_0x5a6a6c-0x0;var _0x8299df=_0x5f2f[_0x5a6a6c];return _0x8299df;};'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 diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 70239ac..d81b93b 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 _0x5ad0=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','update','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default','upperFirst','custom','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','addPreferred','preferred','getPreferred','default_preferred.png','addFavicon','server/files/images/logos','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x427fb9,_0x23ec4c){var _0x124bf8=function(_0x385a8d){while(--_0x385a8d){_0x427fb9['push'](_0x427fb9['shift']());}};_0x124bf8(++_0x23ec4c);}(_0x5ad0,0x137));var _0x05ad=function(_0x29baa5,_0x26e470){_0x29baa5=_0x29baa5-0x0;var _0x3fc908=_0x5ad0[_0x29baa5];return _0x3fc908;};'use strict';var emlformat=require(_0x05ad('0x0'));var rimraf=require(_0x05ad('0x1'));var zipdir=require(_0x05ad('0x2'));var jsonpatch=require(_0x05ad('0x3'));var rp=require(_0x05ad('0x4'));var moment=require(_0x05ad('0x5'));var BPromise=require(_0x05ad('0x6'));var Mustache=require(_0x05ad('0x7'));var util=require(_0x05ad('0x8'));var path=require(_0x05ad('0x9'));var sox=require(_0x05ad('0xa'));var csv=require(_0x05ad('0xb'));var ejs=require(_0x05ad('0xc'));var fs=require('fs');var fs_extra=require(_0x05ad('0xd'));var _=require(_0x05ad('0xe'));var squel=require('squel');var crypto=require(_0x05ad('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x05ad('0xb'));var querystring=require(_0x05ad('0x10'));var Papa=require(_0x05ad('0x11'));var Redis=require(_0x05ad('0x12'));var authService=require(_0x05ad('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x05ad('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05ad('0x15'));var utils=require(_0x05ad('0x16'));var config=require(_0x05ad('0x17'));var licenseUtil=require(_0x05ad('0x18'));var db=require(_0x05ad('0x19'))['db'];var jayson=require(_0x05ad('0x1a'));var client=jayson[_0x05ad('0x1b')][_0x05ad('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xc2501b,_0x1c1e93,_0x40785b,_0x8e4c4a){return new BPromise(function(_0x3a6338,_0x5eea4f){var _0x510361=_0x8e4c4a||client;return _0x510361[_0x05ad('0x1d')](_0xc2501b,_0x40785b)[_0x05ad('0x1e')](function(_0x58f89e){logger[_0x05ad('0x1f')](_0x05ad('0x20'),_0x1c1e93,'request\x20sent');logger[_0x05ad('0x21')](_0x05ad('0x22'),_0x1c1e93,'request\x20sent',JSON[_0x05ad('0x23')](_0x58f89e));if(_0x58f89e[_0x05ad('0x24')]){if(_0x58f89e[_0x05ad('0x24')][_0x05ad('0x25')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x1c1e93,_0x58f89e[_0x05ad('0x24')]['message']);return _0x5eea4f(_0x58f89e[_0x05ad('0x24')][_0x05ad('0x26')]);}logger[_0x05ad('0x24')](_0x05ad('0x20'),_0x1c1e93,_0x58f89e['error'][_0x05ad('0x26')]);return _0x3a6338(_0x58f89e[_0x05ad('0x24')]['message']);}else{logger[_0x05ad('0x1f')](_0x05ad('0x20'),_0x1c1e93,_0x05ad('0x27'));_0x3a6338(_0x58f89e[_0x05ad('0x28')][_0x05ad('0x26')]);}})['catch'](function(_0x3ec02c){logger[_0x05ad('0x24')](_0x05ad('0x20'),_0x1c1e93,_0x3ec02c);_0x5eea4f(_0x3ec02c);});});}function respondWithStatusCode(_0x5e9c64,_0x281b73){_0x281b73=_0x281b73||0xcc;return function(_0x2af25b){if(_0x2af25b){return _0x5e9c64[_0x05ad('0x29')](_0x281b73);}return _0x5e9c64[_0x05ad('0x2a')](_0x281b73)[_0x05ad('0x2b')]();};}function respondWithResult(_0x37d649,_0x1a30ed){_0x1a30ed=_0x1a30ed||0xc8;return function(_0x7fbe89){if(_0x7fbe89){return _0x37d649[_0x05ad('0x2a')](_0x1a30ed)[_0x05ad('0x2c')](_0x7fbe89);}};}function respondWithFilteredResult(_0x5b9c89,_0x4616bd){return function(_0x71a83b){if(_0x71a83b){var _0x1d5d42=typeof _0x4616bd[_0x05ad('0x2d')]===_0x05ad('0x2e')&&typeof _0x4616bd[_0x05ad('0x2f')]===_0x05ad('0x2e');var _0x93af90=_0x71a83b[_0x05ad('0x30')];var _0x276808=_0x1d5d42?0x0:_0x4616bd['offset'];var _0x360c1b=_0x1d5d42?_0x71a83b[_0x05ad('0x30')]:_0x4616bd[_0x05ad('0x2d')]+_0x4616bd['limit'];var _0x490272;if(_0x360c1b>=_0x93af90){_0x360c1b=_0x93af90;_0x490272=0xc8;}else{_0x490272=0xce;}_0x5b9c89['status'](_0x490272);return _0x5b9c89[_0x05ad('0x31')](_0x05ad('0x32'),_0x276808+'-'+_0x360c1b+'/'+_0x93af90)['json'](_0x71a83b);}return null;};}function patchUpdates(_0x3af0ec){return function(_0x35d836){try{jsonpatch[_0x05ad('0x33')](_0x35d836,_0x3af0ec,!![]);}catch(_0x573f39){return BPromise[_0x05ad('0x34')](_0x573f39);}return _0x35d836[_0x05ad('0x35')]();};}function saveUpdates(_0x7d98e,_0x6e15b6){return function(_0x4abf96){if(_0x4abf96){return _0x4abf96['update'](_0x7d98e)[_0x05ad('0x1e')](function(_0x383266){return _0x383266;});}return null;};}function removeEntity(_0x4d4211,_0x412a41){return function(_0x105ab5){if(_0x105ab5){return _0x105ab5['destroy']()[_0x05ad('0x1e')](function(){_0x4d4211['status'](0xcc)[_0x05ad('0x2b')]();});}};}function handleEntityNotFound(_0x4df07a,_0x304799){return function(_0x38edee){if(!_0x38edee){_0x4df07a[_0x05ad('0x29')](0x194);}return _0x38edee;};}function handleError(_0x3955ea,_0x1cd7de){_0x1cd7de=_0x1cd7de||0x1f4;return function(_0x5d7a3f){logger['error'](_0x5d7a3f['stack']);if(_0x5d7a3f[_0x05ad('0x36')]){delete _0x5d7a3f[_0x05ad('0x36')];}_0x3955ea[_0x05ad('0x2a')](_0x1cd7de)[_0x05ad('0x37')](_0x5d7a3f);};}exports[_0x05ad('0x38')]=function(_0x4ccc52,_0x5d339e){var _0x51e5cf={},_0x112f91={},_0xf4093b={'count':0x0,'rows':[]};var _0x40cc5d=_[_0x05ad('0x39')](db[_0x05ad('0x3a')][_0x05ad('0x3b')],function(_0x555c95){return{'name':_0x555c95[_0x05ad('0x3c')],'type':_0x555c95[_0x05ad('0x3d')][_0x05ad('0x3e')]};});_0x112f91[_0x05ad('0x3f')]=_[_0x05ad('0x39')](_0x40cc5d,_0x05ad('0x36'));_0x112f91['query']=_[_0x05ad('0x40')](_0x4ccc52['query']);_0x112f91[_0x05ad('0x41')]=_[_0x05ad('0x42')](_0x112f91[_0x05ad('0x3f')],_0x112f91[_0x05ad('0x43')]);_0x51e5cf[_0x05ad('0x44')]=_[_0x05ad('0x42')](_0x112f91['model'],qs[_0x05ad('0x45')](_0x4ccc52[_0x05ad('0x43')][_0x05ad('0x45')]));_0x51e5cf['attributes']=_0x51e5cf[_0x05ad('0x44')][_0x05ad('0x46')]?_0x51e5cf[_0x05ad('0x44')]:_0x112f91[_0x05ad('0x3f')];if(!_0x4ccc52[_0x05ad('0x43')][_0x05ad('0x47')](_0x05ad('0x48'))){_0x51e5cf[_0x05ad('0x2f')]=qs[_0x05ad('0x2f')](_0x4ccc52[_0x05ad('0x43')][_0x05ad('0x2f')]);_0x51e5cf['offset']=qs[_0x05ad('0x2d')](_0x4ccc52[_0x05ad('0x43')]['offset']);}_0x51e5cf[_0x05ad('0x49')]=qs[_0x05ad('0x4a')](_0x4ccc52[_0x05ad('0x43')][_0x05ad('0x4a')]);_0x51e5cf['where']=qs[_0x05ad('0x41')](_[_0x05ad('0x4b')](_0x4ccc52['query'],_0x112f91[_0x05ad('0x41')]),_0x40cc5d);if(_0x4ccc52['query'][_0x05ad('0x4c')]){_0x51e5cf[_0x05ad('0x4d')]=_[_0x05ad('0x4e')](_0x51e5cf[_0x05ad('0x4d')],{'$or':_[_0x05ad('0x39')](_0x40cc5d,function(_0x2a1868){if(_0x2a1868['type']!==_0x05ad('0x4f')){var _0x30f6ea={};_0x30f6ea[_0x2a1868['name']]={'$like':'%'+_0x4ccc52[_0x05ad('0x43')][_0x05ad('0x4c')]+'%'};return _0x30f6ea;}})});}_0x51e5cf=_['merge']({},_0x51e5cf,_0x4ccc52[_0x05ad('0x50')]);var _0x3f6e06={'where':_0x51e5cf[_0x05ad('0x4d')]};return db[_0x05ad('0x3a')]['count'](_0x3f6e06)[_0x05ad('0x1e')](function(_0x17d53d){_0xf4093b[_0x05ad('0x30')]=_0x17d53d;if(_0x4ccc52[_0x05ad('0x43')][_0x05ad('0x51')]){_0x51e5cf[_0x05ad('0x52')]=[{'all':!![]}];}return db['Setting'][_0x05ad('0x53')](_0x51e5cf);})['then'](function(_0x327fac){_0xf4093b[_0x05ad('0x54')]=_0x327fac;return _0xf4093b;})[_0x05ad('0x1e')](respondWithFilteredResult(_0x5d339e,_0x51e5cf))[_0x05ad('0x55')](handleError(_0x5d339e,null));};exports['show']=function(_0x107e5c,_0xf07c04){var _0x1e4b7e={'raw':![],'where':{'id':_0x107e5c[_0x05ad('0x56')]['id']}},_0xead31={};_0xead31[_0x05ad('0x3f')]=_['keys'](db[_0x05ad('0x3a')][_0x05ad('0x3b')]);_0xead31['query']=_[_0x05ad('0x40')](_0x107e5c[_0x05ad('0x43')]);_0xead31['filters']=_[_0x05ad('0x42')](_0xead31['model'],_0xead31[_0x05ad('0x43')]);_0x1e4b7e[_0x05ad('0x44')]=_['intersection'](_0xead31['model'],qs[_0x05ad('0x45')](_0x107e5c['query'][_0x05ad('0x45')]));_0x1e4b7e['attributes']=_0x1e4b7e[_0x05ad('0x44')][_0x05ad('0x46')]?_0x1e4b7e[_0x05ad('0x44')]:_0xead31[_0x05ad('0x3f')];if(_0x107e5c[_0x05ad('0x43')][_0x05ad('0x51')]){_0x1e4b7e[_0x05ad('0x52')]=[{'all':!![]}];}_0x1e4b7e=_[_0x05ad('0x4e')]({},_0x1e4b7e,_0x107e5c[_0x05ad('0x50')]);return db[_0x05ad('0x3a')][_0x05ad('0x57')](_0x1e4b7e)[_0x05ad('0x1e')](handleEntityNotFound(_0xf07c04,null))[_0x05ad('0x1e')](respondWithResult(_0xf07c04,null))[_0x05ad('0x55')](handleError(_0xf07c04,null));};exports[_0x05ad('0x58')]=function(_0x3b69b8,_0x56e632){if(_0x3b69b8[_0x05ad('0x59')]['id']){delete _0x3b69b8[_0x05ad('0x59')]['id'];}return db[_0x05ad('0x3a')]['find']({'where':{'id':_0x3b69b8[_0x05ad('0x56')]['id']}})[_0x05ad('0x1e')](handleEntityNotFound(_0x56e632,null))['then'](saveUpdates(_0x3b69b8[_0x05ad('0x59')],null))[_0x05ad('0x1e')](respondWithResult(_0x56e632,null))[_0x05ad('0x55')](handleError(_0x56e632,null));};exports[_0x05ad('0x5a')]=function(_0x48e166,_0x4313f2,_0x44e59a){if(_0x48e166['file']&&_0x48e166[_0x05ad('0x5b')][_0x05ad('0x5c')]){_0x48e166['body'][_0x05ad('0x5d')]=_0x48e166[_0x05ad('0x5b')]['filename'];}return db[_0x05ad('0x3a')][_0x05ad('0x57')]({'where':{'id':_0x48e166[_0x05ad('0x56')]['id']}})[_0x05ad('0x1e')](handleEntityNotFound(_0x4313f2,null))[_0x05ad('0x1e')](saveUpdates(_0x48e166[_0x05ad('0x59')],null))['then'](respondWithResult(_0x4313f2,null))['catch'](handleError(_0x4313f2,null));};exports[_0x05ad('0x5e')]=function(_0x2b6aac,_0x3da821,_0x40211f){if(_0x2b6aac[_0x05ad('0x5b')]&&_0x2b6aac['file']['filename']){_0x2b6aac['body'][_0x05ad('0x5f')]=_0x2b6aac[_0x05ad('0x5b')][_0x05ad('0x5c')];}return db[_0x05ad('0x3a')][_0x05ad('0x57')]({'where':{'id':_0x2b6aac[_0x05ad('0x56')]['id']}})[_0x05ad('0x1e')](handleEntityNotFound(_0x3da821,null))[_0x05ad('0x1e')](saveUpdates(_0x2b6aac[_0x05ad('0x59')],null))[_0x05ad('0x1e')](respondWithResult(_0x3da821,null))[_0x05ad('0x55')](handleError(_0x3da821,null));};var utilLicense=require(_0x05ad('0x18'));exports[_0x05ad('0x60')]=function(_0x527c5d,_0x312ed,_0x2a48e4){var _0x4a639f='server/files/images/logos';var _0x1fde47={'custom':![]};return utilLicense[_0x05ad('0x61')]()[_0x05ad('0x1e')](function(_0x17373a){if(_0x17373a){_0x1fde47=_0x17373a;}return db['Setting']['find']({'where':{'id':_0x527c5d['params']['id']},'attributes':['logo','loginLogo','preferred',_0x05ad('0x62'),_0x05ad('0x63'),_0x05ad('0x64'),_0x05ad('0x65'),_0x05ad('0x66')],'raw':!![]});})[_0x05ad('0x1e')](handleEntityNotFound(_0x312ed,null))[_0x05ad('0x1e')](function(_0x2f001c){if(_0x2f001c){var _0x52ddf4=_0x2f001c[_0x05ad('0x5d')]&&fs[_0x05ad('0x67')](path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x4a639f,_[_0x05ad('0x6a')](_0x2f001c['logo'])))?path[_0x05ad('0x68')](config['root'],_0x4a639f,_[_0x05ad('0x6a')](_0x2f001c[_0x05ad('0x5d')])):path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x4a639f,_[_0x05ad('0x6a')]('default_logo.svg'));var _0xe693ae=_0x05ad('0x6b')+_[_0x05ad('0x6c')](_0x05ad('0x5d'));if(_0x2f001c[_0xe693ae]||!_0x1fde47[_0x05ad('0x6d')]){_0x52ddf4=path[_0x05ad('0x68')](config['root'],_0x4a639f,_[_0x05ad('0x6a')](_0x05ad('0x6e')));}if(!fs[_0x05ad('0x67')](_0x52ddf4)){throw new db[(_0x05ad('0x6f'))][(_0x05ad('0x70'))](_['upperFirst'](_0x05ad('0x5d'))+_0x05ad('0x71'));}return _0x312ed[_0x05ad('0x72')](_0x52ddf4);}})[_0x05ad('0x55')](handleError(_0x312ed,null));};var utilLicense=require(_0x05ad('0x18'));exports[_0x05ad('0x73')]=function(_0xa27ed7,_0x341b26,_0x53fbfc){var _0x30edf1='server/files/images/logos';var _0x252594={'custom':![]};return utilLicense[_0x05ad('0x61')]()[_0x05ad('0x1e')](function(_0x14e484){if(_0x14e484){_0x252594=_0x14e484;}return db[_0x05ad('0x3a')][_0x05ad('0x57')]({'where':{'id':_0xa27ed7['params']['id']},'attributes':[_0x05ad('0x5d'),_0x05ad('0x5f'),'preferred',_0x05ad('0x62'),'defaultLogo',_0x05ad('0x64'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x341b26,null))['then'](function(_0x260781){if(_0x260781){var _0x49bbd9=_0x260781['loginLogo']&&fs[_0x05ad('0x67')](path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x30edf1,_[_0x05ad('0x6a')](_0x260781['loginLogo'])))?path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x30edf1,_[_0x05ad('0x6a')](_0x260781[_0x05ad('0x5f')])):path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x30edf1,_[_0x05ad('0x6a')]('default_loginLogo.svg'));var _0x383aff=_0x05ad('0x6b')+_[_0x05ad('0x6c')](_0x05ad('0x5f'));if(_0x260781[_0x383aff]||!_0x252594[_0x05ad('0x6d')]){_0x49bbd9=path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x30edf1,_[_0x05ad('0x6a')](_0x05ad('0x74')));}if(!fs[_0x05ad('0x67')](_0x49bbd9)){throw new db[(_0x05ad('0x6f'))]['ValidationError'](_['upperFirst'](_0x05ad('0x5f'))+_0x05ad('0x71'));}return _0x341b26[_0x05ad('0x72')](_0x49bbd9);}})[_0x05ad('0x55')](handleError(_0x341b26,null));};exports[_0x05ad('0x75')]=function(_0x38adb1,_0x591ae7){return db[_0x05ad('0x3a')]['find']({'where':{'id':_0x38adb1[_0x05ad('0x56')]['id']},'attributes':[_0x05ad('0x76')]})['then'](respondWithResult(_0x591ae7,null))[_0x05ad('0x55')](handleError(_0x591ae7,null));};exports[_0x05ad('0x77')]=function(_0x37e956,_0x4949c1,_0x1fcb98){if(_0x37e956[_0x05ad('0x5b')]&&_0x37e956[_0x05ad('0x5b')][_0x05ad('0x5c')]){_0x37e956[_0x05ad('0x59')][_0x05ad('0x78')]=_0x37e956[_0x05ad('0x5b')][_0x05ad('0x5c')];}return db['Setting'][_0x05ad('0x57')]({'where':{'id':_0x37e956[_0x05ad('0x56')]['id']}})['then'](handleEntityNotFound(_0x4949c1,null))['then'](saveUpdates(_0x37e956[_0x05ad('0x59')],null))['then'](respondWithResult(_0x4949c1,null))[_0x05ad('0x55')](handleError(_0x4949c1,null));};var utilLicense=require(_0x05ad('0x18'));exports[_0x05ad('0x79')]=function(_0x4d8155,_0x17a261,_0x13be21){var _0x13c808='server/files/images/logos';var _0x4be816={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x172a40){if(_0x172a40){_0x4be816=_0x172a40;}return db[_0x05ad('0x3a')][_0x05ad('0x57')]({'where':{'id':_0x4d8155[_0x05ad('0x56')]['id']},'attributes':['logo','loginLogo','preferred',_0x05ad('0x62'),'defaultLogo',_0x05ad('0x64'),_0x05ad('0x65'),_0x05ad('0x66')],'raw':!![]});})[_0x05ad('0x1e')](handleEntityNotFound(_0x17a261,null))[_0x05ad('0x1e')](function(_0x444050){if(_0x444050){var _0x1fceaa=_0x444050['preferred']&&fs[_0x05ad('0x67')](path['join'](config['root'],_0x13c808,_[_0x05ad('0x6a')](_0x444050['preferred'])))?path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x13c808,_[_0x05ad('0x6a')](_0x444050['preferred'])):path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x13c808,_[_0x05ad('0x6a')](_0x05ad('0x7a')));var _0x58f2e4='default'+_[_0x05ad('0x6c')]('preferred');if(_0x444050[_0x58f2e4]||!_0x4be816['custom']||!_0x4be816[_0x05ad('0x78')]){_0x1fceaa=path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0x13c808,_[_0x05ad('0x6a')](_0x05ad('0x7a')));}if(!fs['existsSync'](_0x1fceaa)){throw new db[(_0x05ad('0x6f'))][(_0x05ad('0x70'))](_[_0x05ad('0x6c')](_0x05ad('0x78'))+_0x05ad('0x71'));}return _0x17a261[_0x05ad('0x72')](_0x1fceaa);}})['catch'](handleError(_0x17a261,null));};exports[_0x05ad('0x7b')]=function(_0x5e21c9,_0x2a63c7,_0xdd1f2f){if(_0x5e21c9[_0x05ad('0x5b')]&&_0x5e21c9['file'][_0x05ad('0x5c')]){_0x5e21c9[_0x05ad('0x59')][_0x05ad('0x62')]=_0x5e21c9[_0x05ad('0x5b')][_0x05ad('0x5c')];}return db['Setting'][_0x05ad('0x57')]({'where':{'id':_0x5e21c9[_0x05ad('0x56')]['id']}})[_0x05ad('0x1e')](handleEntityNotFound(_0x2a63c7,null))[_0x05ad('0x1e')](saveUpdates(_0x5e21c9[_0x05ad('0x59')],null))[_0x05ad('0x1e')](respondWithResult(_0x2a63c7,null))[_0x05ad('0x55')](handleError(_0x2a63c7,null));};var utilLicense=require(_0x05ad('0x18'));exports['getFavicon']=function(_0xad687e,_0x5e6aa0,_0x297458){var _0xe92c8d=_0x05ad('0x7c');var _0x4d1e1c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x481dad){if(_0x481dad){_0x4d1e1c=_0x481dad;}return db[_0x05ad('0x3a')][_0x05ad('0x57')]({'where':{'id':_0xad687e[_0x05ad('0x56')]['id']},'attributes':['logo',_0x05ad('0x5f'),'preferred',_0x05ad('0x62'),_0x05ad('0x63'),_0x05ad('0x64'),_0x05ad('0x65'),_0x05ad('0x66')],'raw':!![]});})[_0x05ad('0x1e')](handleEntityNotFound(_0x5e6aa0,null))[_0x05ad('0x1e')](function(_0x27c857){if(_0x27c857){var _0x58e284=_0x27c857[_0x05ad('0x62')]&&fs[_0x05ad('0x67')](path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0xe92c8d,_[_0x05ad('0x6a')](_0x27c857[_0x05ad('0x62')])))?path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0xe92c8d,_[_0x05ad('0x6a')](_0x27c857['favicon'])):path[_0x05ad('0x68')](config['root'],_0xe92c8d,_[_0x05ad('0x6a')](_0x05ad('0x7d')));var _0x5923b8=_0x05ad('0x6b')+_['upperFirst'](_0x05ad('0x62'));if(_0x27c857[_0x5923b8]||!_0x4d1e1c[_0x05ad('0x6d')]){_0x58e284=path[_0x05ad('0x68')](config[_0x05ad('0x69')],_0xe92c8d,_[_0x05ad('0x6a')](_0x05ad('0x7d')));}if(!fs[_0x05ad('0x67')](_0x58e284)){throw new db['Sequelize']['ValidationError'](_[_0x05ad('0x6c')](_0x05ad('0x62'))+_0x05ad('0x71'));}return _0x5e6aa0[_0x05ad('0x72')](_0x58e284);}})[_0x05ad('0x55')](handleError(_0x5e6aa0,null));};exports[_0x05ad('0x7e')]=function(_0x33e3ba,_0x1e7baf){var _0x54c58e={'offset':moment()[_0x05ad('0x7f')]()};_0x54c58e[_0x05ad('0x80')]=moment()['utcOffset'](_0x54c58e['offset'])['format'](_0x05ad('0x81'));return _0x1e7baf[_0x05ad('0x2a')](0xc8)[_0x05ad('0x37')](_0x54c58e);}; \ No newline at end of file +var _0xf8b2=['http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','body','addLogo','file','filename','logo','find','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','custom','gdpr','securePassword','getPreferred','default_preferred.png','Sequelize','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise'];(function(_0x307d80,_0x2b74e7){var _0x47b263=function(_0x3a0986){while(--_0x3a0986){_0x307d80['push'](_0x307d80['shift']());}};_0x47b263(++_0x2b74e7);}(_0xf8b2,0x15e));var _0x2f8b=function(_0xdd0f2c,_0x47d12a){_0xdd0f2c=_0xdd0f2c-0x0;var _0xeeba3=_0xf8b2[_0xdd0f2c];return _0xeeba3;};'use strict';var emlformat=require(_0x2f8b('0x0'));var rimraf=require(_0x2f8b('0x1'));var zipdir=require(_0x2f8b('0x2'));var jsonpatch=require(_0x2f8b('0x3'));var rp=require(_0x2f8b('0x4'));var moment=require(_0x2f8b('0x5'));var BPromise=require(_0x2f8b('0x6'));var Mustache=require(_0x2f8b('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2f8b('0x8'));var csv=require(_0x2f8b('0x9'));var ejs=require(_0x2f8b('0xa'));var fs=require('fs');var fs_extra=require(_0x2f8b('0xb'));var _=require(_0x2f8b('0xc'));var squel=require(_0x2f8b('0xd'));var crypto=require(_0x2f8b('0xe'));var jsforce=require(_0x2f8b('0xf'));var deskjs=require(_0x2f8b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2f8b('0x11'));var Papa=require(_0x2f8b('0x12'));var Redis=require(_0x2f8b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2f8b('0x14'));var as=require(_0x2f8b('0x15'));var hardwareService=require(_0x2f8b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x2f8b('0x17'));var config=require(_0x2f8b('0x18'));var licenseUtil=require(_0x2f8b('0x19'));var db=require(_0x2f8b('0x1a'))['db'];var jayson=require(_0x2f8b('0x1b'));var client=jayson['client'][_0x2f8b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x4d75d1,_0x40c097,_0x5e9eb1,_0x1b6a17){return new BPromise(function(_0x15634,_0xf9cbe0){var _0x19d5b3=_0x1b6a17||client;return _0x19d5b3[_0x2f8b('0x1d')](_0x4d75d1,_0x5e9eb1)[_0x2f8b('0x1e')](function(_0x532fe4){logger[_0x2f8b('0x1f')](_0x2f8b('0x20'),_0x40c097,_0x2f8b('0x21'));logger[_0x2f8b('0x22')](_0x2f8b('0x23'),_0x40c097,_0x2f8b('0x21'),JSON[_0x2f8b('0x24')](_0x532fe4));if(_0x532fe4[_0x2f8b('0x25')]){if(_0x532fe4[_0x2f8b('0x25')]['code']===0x1f4){logger[_0x2f8b('0x25')](_0x2f8b('0x20'),_0x40c097,_0x532fe4[_0x2f8b('0x25')]['message']);return _0xf9cbe0(_0x532fe4[_0x2f8b('0x25')]['message']);}logger[_0x2f8b('0x25')](_0x2f8b('0x20'),_0x40c097,_0x532fe4[_0x2f8b('0x25')][_0x2f8b('0x26')]);return _0x15634(_0x532fe4[_0x2f8b('0x25')]['message']);}else{logger[_0x2f8b('0x1f')](_0x2f8b('0x20'),_0x40c097,_0x2f8b('0x21'));_0x15634(_0x532fe4[_0x2f8b('0x27')][_0x2f8b('0x26')]);}})[_0x2f8b('0x28')](function(_0x68e81f){logger['error'](_0x2f8b('0x20'),_0x40c097,_0x68e81f);_0xf9cbe0(_0x68e81f);});});}function respondWithStatusCode(_0x23f73c,_0x3560c4){_0x3560c4=_0x3560c4||0xcc;return function(_0x41e12b){if(_0x41e12b){return _0x23f73c[_0x2f8b('0x29')](_0x3560c4);}return _0x23f73c['status'](_0x3560c4)[_0x2f8b('0x2a')]();};}function respondWithResult(_0xa30bd3,_0x152492){_0x152492=_0x152492||0xc8;return function(_0x46a95a){if(_0x46a95a){return _0xa30bd3[_0x2f8b('0x2b')](_0x152492)[_0x2f8b('0x2c')](_0x46a95a);}};}function respondWithFilteredResult(_0x45e313,_0x347f5a){return function(_0x4145b3){if(_0x4145b3){var _0x5642a2=typeof _0x347f5a[_0x2f8b('0x2d')]==='undefined'&&typeof _0x347f5a[_0x2f8b('0x2e')]===_0x2f8b('0x2f');var _0x16dab9=_0x4145b3[_0x2f8b('0x30')];var _0x72b23b=_0x5642a2?0x0:_0x347f5a['offset'];var _0x2cfbea=_0x5642a2?_0x4145b3['count']:_0x347f5a['offset']+_0x347f5a[_0x2f8b('0x2e')];var _0x294428;if(_0x2cfbea>=_0x16dab9){_0x2cfbea=_0x16dab9;_0x294428=0xc8;}else{_0x294428=0xce;}_0x45e313['status'](_0x294428);return _0x45e313[_0x2f8b('0x31')](_0x2f8b('0x32'),_0x72b23b+'-'+_0x2cfbea+'/'+_0x16dab9)[_0x2f8b('0x2c')](_0x4145b3);}return null;};}function patchUpdates(_0x9f39bc){return function(_0x1fe3d0){try{jsonpatch[_0x2f8b('0x33')](_0x1fe3d0,_0x9f39bc,!![]);}catch(_0x5b2879){return BPromise[_0x2f8b('0x34')](_0x5b2879);}return _0x1fe3d0[_0x2f8b('0x35')]();};}function saveUpdates(_0x296eac,_0x3279dc){return function(_0x1f886f){if(_0x1f886f){return _0x1f886f[_0x2f8b('0x36')](_0x296eac)[_0x2f8b('0x1e')](function(_0x58f30a){return _0x58f30a;});}return null;};}function removeEntity(_0x2e5510,_0x5593b0){return function(_0x24dec6){if(_0x24dec6){return _0x24dec6[_0x2f8b('0x37')]()[_0x2f8b('0x1e')](function(){_0x2e5510[_0x2f8b('0x2b')](0xcc)[_0x2f8b('0x2a')]();});}};}function handleEntityNotFound(_0x36c269,_0x407c2f){return function(_0x2e9786){if(!_0x2e9786){_0x36c269[_0x2f8b('0x29')](0x194);}return _0x2e9786;};}function handleError(_0x55970e,_0x5d3343){_0x5d3343=_0x5d3343||0x1f4;return function(_0x404f48){logger[_0x2f8b('0x25')](_0x404f48[_0x2f8b('0x38')]);if(_0x404f48[_0x2f8b('0x39')]){delete _0x404f48['name'];}_0x55970e[_0x2f8b('0x2b')](_0x5d3343)[_0x2f8b('0x3a')](_0x404f48);};}exports[_0x2f8b('0x3b')]=function(_0x270f1c,_0x23a53d){var _0x523419={},_0x56c05c={},_0x179952={'count':0x0,'rows':[]};var _0x25c805=_[_0x2f8b('0x3c')](db[_0x2f8b('0x3d')][_0x2f8b('0x3e')],function(_0x280745){return{'name':_0x280745[_0x2f8b('0x3f')],'type':_0x280745['type'][_0x2f8b('0x40')]};});_0x56c05c[_0x2f8b('0x41')]=_['map'](_0x25c805,_0x2f8b('0x39'));_0x56c05c[_0x2f8b('0x42')]=_[_0x2f8b('0x43')](_0x270f1c['query']);_0x56c05c[_0x2f8b('0x44')]=_[_0x2f8b('0x45')](_0x56c05c['model'],_0x56c05c[_0x2f8b('0x42')]);_0x523419[_0x2f8b('0x46')]=_['intersection'](_0x56c05c[_0x2f8b('0x41')],qs['fields'](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x47')]));_0x523419['attributes']=_0x523419[_0x2f8b('0x46')][_0x2f8b('0x48')]?_0x523419[_0x2f8b('0x46')]:_0x56c05c['model'];if(!_0x270f1c[_0x2f8b('0x42')]['hasOwnProperty'](_0x2f8b('0x49'))){_0x523419[_0x2f8b('0x2e')]=qs[_0x2f8b('0x2e')](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x2e')]);_0x523419[_0x2f8b('0x2d')]=qs[_0x2f8b('0x2d')](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x2d')]);}_0x523419[_0x2f8b('0x4a')]=qs[_0x2f8b('0x4b')](_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x4b')]);_0x523419[_0x2f8b('0x4c')]=qs[_0x2f8b('0x44')](_[_0x2f8b('0x4d')](_0x270f1c[_0x2f8b('0x42')],_0x56c05c[_0x2f8b('0x44')]),_0x25c805);if(_0x270f1c[_0x2f8b('0x42')][_0x2f8b('0x4e')]){_0x523419[_0x2f8b('0x4c')]=_[_0x2f8b('0x4f')](_0x523419[_0x2f8b('0x4c')],{'$or':_[_0x2f8b('0x3c')](_0x25c805,function(_0x470015){if(_0x470015['type']!=='VIRTUAL'){var _0x5089d0={};_0x5089d0[_0x470015[_0x2f8b('0x39')]]={'$like':'%'+_0x270f1c['query'][_0x2f8b('0x4e')]+'%'};return _0x5089d0;}})});}_0x523419=_[_0x2f8b('0x4f')]({},_0x523419,_0x270f1c[_0x2f8b('0x50')]);var _0x5f0a8d={'where':_0x523419[_0x2f8b('0x4c')]};return db['Setting'][_0x2f8b('0x30')](_0x5f0a8d)['then'](function(_0x376f60){_0x179952[_0x2f8b('0x30')]=_0x376f60;if(_0x270f1c['query'][_0x2f8b('0x51')]){_0x523419[_0x2f8b('0x52')]=[{'all':!![]}];}return db[_0x2f8b('0x3d')][_0x2f8b('0x53')](_0x523419);})[_0x2f8b('0x1e')](function(_0x465d59){_0x179952[_0x2f8b('0x54')]=_0x465d59;return _0x179952;})[_0x2f8b('0x1e')](respondWithFilteredResult(_0x23a53d,_0x523419))[_0x2f8b('0x28')](handleError(_0x23a53d,null));};exports['show']=function(_0x2fdc75,_0x1fe33d){var _0x2d79f9={'raw':![],'where':{'id':_0x2fdc75[_0x2f8b('0x55')]['id']}},_0x1bb257={};_0x1bb257['model']=_[_0x2f8b('0x43')](db[_0x2f8b('0x3d')][_0x2f8b('0x3e')]);_0x1bb257['query']=_[_0x2f8b('0x43')](_0x2fdc75['query']);_0x1bb257[_0x2f8b('0x44')]=_[_0x2f8b('0x45')](_0x1bb257[_0x2f8b('0x41')],_0x1bb257[_0x2f8b('0x42')]);_0x2d79f9[_0x2f8b('0x46')]=_['intersection'](_0x1bb257['model'],qs['fields'](_0x2fdc75[_0x2f8b('0x42')][_0x2f8b('0x47')]));_0x2d79f9[_0x2f8b('0x46')]=_0x2d79f9[_0x2f8b('0x46')]['length']?_0x2d79f9['attributes']:_0x1bb257[_0x2f8b('0x41')];if(_0x2fdc75[_0x2f8b('0x42')][_0x2f8b('0x51')]){_0x2d79f9[_0x2f8b('0x52')]=[{'all':!![]}];}_0x2d79f9=_['merge']({},_0x2d79f9,_0x2fdc75[_0x2f8b('0x50')]);return db[_0x2f8b('0x3d')]['find'](_0x2d79f9)[_0x2f8b('0x1e')](handleEntityNotFound(_0x1fe33d,null))['then'](respondWithResult(_0x1fe33d,null))[_0x2f8b('0x28')](handleError(_0x1fe33d,null));};exports['update']=function(_0x2d3f1e,_0x1684db){if(_0x2d3f1e[_0x2f8b('0x56')]['id']){delete _0x2d3f1e['body']['id'];}return db[_0x2f8b('0x3d')]['find']({'where':{'id':_0x2d3f1e[_0x2f8b('0x55')]['id']}})['then'](handleEntityNotFound(_0x1684db,null))[_0x2f8b('0x1e')](saveUpdates(_0x2d3f1e[_0x2f8b('0x56')],null))[_0x2f8b('0x1e')](respondWithResult(_0x1684db,null))[_0x2f8b('0x28')](handleError(_0x1684db,null));};exports[_0x2f8b('0x57')]=function(_0xd1acee,_0x40457b,_0x132e8b){if(_0xd1acee['file']&&_0xd1acee[_0x2f8b('0x58')][_0x2f8b('0x59')]){_0xd1acee[_0x2f8b('0x56')][_0x2f8b('0x5a')]=_0xd1acee[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0xd1acee[_0x2f8b('0x55')]['id']}})[_0x2f8b('0x1e')](handleEntityNotFound(_0x40457b,null))[_0x2f8b('0x1e')](saveUpdates(_0xd1acee[_0x2f8b('0x56')],null))['then'](respondWithResult(_0x40457b,null))[_0x2f8b('0x28')](handleError(_0x40457b,null));};exports['addLogoLogin']=function(_0x2873fc,_0x390793,_0x3673ea){if(_0x2873fc[_0x2f8b('0x58')]&&_0x2873fc[_0x2f8b('0x58')]['filename']){_0x2873fc[_0x2f8b('0x56')][_0x2f8b('0x5c')]=_0x2873fc[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db['Setting']['find']({'where':{'id':_0x2873fc[_0x2f8b('0x55')]['id']}})[_0x2f8b('0x1e')](handleEntityNotFound(_0x390793,null))[_0x2f8b('0x1e')](saveUpdates(_0x2873fc[_0x2f8b('0x56')],null))['then'](respondWithResult(_0x390793,null))[_0x2f8b('0x28')](handleError(_0x390793,null));};var utilLicense=require(_0x2f8b('0x19'));exports['getLogo']=function(_0x4c502d,_0x50246b,_0x3ff35d){var _0x5c4b6f=_0x2f8b('0x5d');var _0x61e2b1={'custom':![]};return utilLicense[_0x2f8b('0x5e')]()[_0x2f8b('0x1e')](function(_0x3dbd82){if(_0x3dbd82){_0x61e2b1=_0x3dbd82;}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x4c502d[_0x2f8b('0x55')]['id']},'attributes':['logo','loginLogo',_0x2f8b('0x5f'),_0x2f8b('0x60'),_0x2f8b('0x61'),_0x2f8b('0x62'),_0x2f8b('0x63'),_0x2f8b('0x64')],'raw':!![]});})[_0x2f8b('0x1e')](handleEntityNotFound(_0x50246b,null))[_0x2f8b('0x1e')](function(_0x4271a4){if(_0x4271a4){var _0x32cae9=_0x4271a4['logo']&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x5c4b6f,_[_0x2f8b('0x68')](_0x4271a4[_0x2f8b('0x5a')])))?path['join'](config[_0x2f8b('0x67')],_0x5c4b6f,_[_0x2f8b('0x68')](_0x4271a4['logo'])):path[_0x2f8b('0x66')](config['root'],_0x5c4b6f,_['toLower'](_0x2f8b('0x69')));var _0x37ffde=_0x2f8b('0x6a')+_['upperFirst'](_0x2f8b('0x5a'));if(_0x4271a4[_0x37ffde]||!_0x61e2b1['custom']){_0x32cae9=path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x5c4b6f,_[_0x2f8b('0x68')]('default_logo.svg'));}if(!fs[_0x2f8b('0x65')](_0x32cae9)){throw new db['Sequelize'][(_0x2f8b('0x6b'))](_[_0x2f8b('0x6c')]('logo')+_0x2f8b('0x6d'));}return _0x50246b[_0x2f8b('0x6e')](_0x32cae9);}})[_0x2f8b('0x28')](handleError(_0x50246b,null));};var utilLicense=require('../../config/license/util');exports[_0x2f8b('0x6f')]=function(_0x3c61d2,_0x174b21,_0x17c7e5){var _0x53f254=_0x2f8b('0x5d');var _0x385e90={'custom':![]};return utilLicense['getLicense']()[_0x2f8b('0x1e')](function(_0x4c006a){if(_0x4c006a){_0x385e90=_0x4c006a;}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x3c61d2['params']['id']},'attributes':['logo','loginLogo',_0x2f8b('0x5f'),_0x2f8b('0x60'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x174b21,null))['then'](function(_0x450163){if(_0x450163){var _0xd34319=_0x450163[_0x2f8b('0x5c')]&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config['root'],_0x53f254,_['toLower'](_0x450163[_0x2f8b('0x5c')])))?path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x53f254,_['toLower'](_0x450163['loginLogo'])):path['join'](config[_0x2f8b('0x67')],_0x53f254,_[_0x2f8b('0x68')](_0x2f8b('0x70')));var _0x4c4fbc=_0x2f8b('0x6a')+_[_0x2f8b('0x6c')](_0x2f8b('0x5c'));if(_0x450163[_0x4c4fbc]||!_0x385e90[_0x2f8b('0x71')]){_0xd34319=path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x53f254,_['toLower'](_0x2f8b('0x70')));}if(!fs[_0x2f8b('0x65')](_0xd34319)){throw new db['Sequelize'][(_0x2f8b('0x6b'))](_[_0x2f8b('0x6c')](_0x2f8b('0x5c'))+_0x2f8b('0x6d'));}return _0x174b21[_0x2f8b('0x6e')](_0xd34319);}})[_0x2f8b('0x28')](handleError(_0x174b21,null));};exports[_0x2f8b('0x72')]=function(_0x374067,_0x47d2ca){return db[_0x2f8b('0x3d')]['find']({'where':{'id':_0x374067[_0x2f8b('0x55')]['id']},'attributes':[_0x2f8b('0x73')]})['then'](respondWithResult(_0x47d2ca,null))[_0x2f8b('0x28')](handleError(_0x47d2ca,null));};exports['addPreferred']=function(_0x1097cc,_0x2432cd,_0x1ebbc8){if(_0x1097cc[_0x2f8b('0x58')]&&_0x1097cc['file'][_0x2f8b('0x59')]){_0x1097cc['body']['preferred']=_0x1097cc[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x1097cc[_0x2f8b('0x55')]['id']}})[_0x2f8b('0x1e')](handleEntityNotFound(_0x2432cd,null))[_0x2f8b('0x1e')](saveUpdates(_0x1097cc[_0x2f8b('0x56')],null))['then'](respondWithResult(_0x2432cd,null))[_0x2f8b('0x28')](handleError(_0x2432cd,null));};var utilLicense=require(_0x2f8b('0x19'));exports[_0x2f8b('0x74')]=function(_0x45b128,_0x406ece,_0x381019){var _0x14f293='server/files/images/logos';var _0x292198={'custom':![]};return utilLicense['getLicense']()[_0x2f8b('0x1e')](function(_0x2ab594){if(_0x2ab594){_0x292198=_0x2ab594;}return db['Setting'][_0x2f8b('0x5b')]({'where':{'id':_0x45b128[_0x2f8b('0x55')]['id']},'attributes':[_0x2f8b('0x5a'),_0x2f8b('0x5c'),_0x2f8b('0x5f'),_0x2f8b('0x60'),'defaultLogo',_0x2f8b('0x62'),'defaultPreferred',_0x2f8b('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x406ece,null))['then'](function(_0x260d55){if(_0x260d55){var _0x7e9f7=_0x260d55[_0x2f8b('0x5f')]&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')](_0x260d55[_0x2f8b('0x5f')])))?path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')](_0x260d55[_0x2f8b('0x5f')])):path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')]('default_preferred.png'));var _0xf0fae3='default'+_[_0x2f8b('0x6c')]('preferred');if(_0x260d55[_0xf0fae3]||!_0x292198[_0x2f8b('0x71')]||!_0x292198[_0x2f8b('0x5f')]){_0x7e9f7=path['join'](config[_0x2f8b('0x67')],_0x14f293,_[_0x2f8b('0x68')](_0x2f8b('0x75')));}if(!fs[_0x2f8b('0x65')](_0x7e9f7)){throw new db[(_0x2f8b('0x76'))][(_0x2f8b('0x6b'))](_[_0x2f8b('0x6c')](_0x2f8b('0x5f'))+_0x2f8b('0x6d'));}return _0x406ece[_0x2f8b('0x6e')](_0x7e9f7);}})[_0x2f8b('0x28')](handleError(_0x406ece,null));};exports['addFavicon']=function(_0x137985,_0x3fa544,_0x102aff){if(_0x137985['file']&&_0x137985[_0x2f8b('0x58')][_0x2f8b('0x59')]){_0x137985[_0x2f8b('0x56')][_0x2f8b('0x60')]=_0x137985[_0x2f8b('0x58')][_0x2f8b('0x59')];}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x137985['params']['id']}})['then'](handleEntityNotFound(_0x3fa544,null))['then'](saveUpdates(_0x137985[_0x2f8b('0x56')],null))[_0x2f8b('0x1e')](respondWithResult(_0x3fa544,null))[_0x2f8b('0x28')](handleError(_0x3fa544,null));};var utilLicense=require(_0x2f8b('0x19'));exports[_0x2f8b('0x77')]=function(_0x39afa6,_0x3d297e,_0x37fd6d){var _0x1fe14b=_0x2f8b('0x5d');var _0x366662={'custom':![]};return utilLicense[_0x2f8b('0x5e')]()[_0x2f8b('0x1e')](function(_0x9748bc){if(_0x9748bc){_0x366662=_0x9748bc;}return db[_0x2f8b('0x3d')][_0x2f8b('0x5b')]({'where':{'id':_0x39afa6['params']['id']},'attributes':[_0x2f8b('0x5a'),'loginLogo','preferred',_0x2f8b('0x60'),'defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3d297e,null))['then'](function(_0x498c7e){if(_0x498c7e){var _0x3bf4d1=_0x498c7e[_0x2f8b('0x60')]&&fs[_0x2f8b('0x65')](path[_0x2f8b('0x66')](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')](_0x498c7e['favicon'])))?path['join'](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')](_0x498c7e[_0x2f8b('0x60')])):path['join'](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')](_0x2f8b('0x78')));var _0x56854a='default'+_[_0x2f8b('0x6c')](_0x2f8b('0x60'));if(_0x498c7e[_0x56854a]||!_0x366662[_0x2f8b('0x71')]){_0x3bf4d1=path['join'](config[_0x2f8b('0x67')],_0x1fe14b,_[_0x2f8b('0x68')]('default_favicon.ico'));}if(!fs[_0x2f8b('0x65')](_0x3bf4d1)){throw new db['Sequelize']['ValidationError'](_[_0x2f8b('0x6c')](_0x2f8b('0x60'))+'\x20not\x20found');}return _0x3d297e['download'](_0x3bf4d1);}})[_0x2f8b('0x28')](handleError(_0x3d297e,null));};exports[_0x2f8b('0x79')]=function(_0x3278f9,_0x43f156){var _0x2b0e98={'offset':moment()[_0x2f8b('0x7a')]()};_0x2b0e98[_0x2f8b('0x7b')]=moment()['utcOffset'](_0x2b0e98[_0x2f8b('0x2d')])[_0x2f8b('0x7c')](_0x2f8b('0x7d'));return _0x43f156[_0x2f8b('0x2b')](0xc8)['send'](_0x2b0e98);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f12eeb4..9838d22 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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x9f48e6,_0x8f87aa){var _0x45fc5c=function(_0xab1f4e){while(--_0xab1f4e){_0x9f48e6['push'](_0x9f48e6['shift']());}};_0x45fc5c(++_0x8f87aa);}(_0x008c,0x188));var _0xc008=function(_0x43a37c,_0x25a567){_0x43a37c=_0x43a37c-0x0;var _0x5d1d40=_0x008c[_0x43a37c];return _0x5d1d40;};'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')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x55ca,0x126));var _0xa55c=function(_0x23fd09,_0x51c74c){_0x23fd09=_0x23fd09-0x0;var _0x5d8176=_0x55ca[_0x23fd09];return _0x5d8176;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xa55c('0x2'));var rp=require(_0xa55c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var attributes=require(_0xa55c('0x6'));module[_0xa55c('0x7')]=function(_0x3c97c8,_0x279caa){return _0x3c97c8[_0xa55c('0x8')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 0b655ac..442840c 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 _0xa528=['include','map','model','ShowSetting','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','info','result','Setting','options','raw','attributes'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xa528,0x105));var _0x8a52=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xa528[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x8a52('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8a52('0x1'));var rs=require(_0x8a52('0x2'));var fs=require('fs');var Redis=require(_0x8a52('0x3'));var db=require(_0x8a52('0x4'))['db'];var utils=require(_0x8a52('0x5'));var logger=require(_0x8a52('0x6'))(_0x8a52('0x7'));var config=require(_0x8a52('0x8'));var jayson=require(_0x8a52('0x9'));var client=jayson[_0x8a52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48d31e,_0x325e70,_0x5a69df){return new BPromise(function(_0x3211b6,_0x433756){return client[_0x8a52('0xb')](_0x48d31e,_0x5a69df)[_0x8a52('0xc')](function(_0xa9e97e){logger['info']('Setting,\x20%s,\x20%s',_0x325e70,'request\x20sent');logger[_0x8a52('0xd')](_0x8a52('0xe'),_0x325e70,_0x8a52('0xf'),JSON[_0x8a52('0x10')](_0xa9e97e));if(_0xa9e97e[_0x8a52('0x11')]){if(_0xa9e97e[_0x8a52('0x11')][_0x8a52('0x12')]===0x1f4){logger[_0x8a52('0x11')](_0x8a52('0x13'),_0x325e70,_0xa9e97e[_0x8a52('0x11')][_0x8a52('0x14')]);return _0x433756(_0xa9e97e[_0x8a52('0x11')][_0x8a52('0x14')]);}logger['error'](_0x8a52('0x13'),_0x325e70,_0xa9e97e['error']['message']);return _0x3211b6(_0xa9e97e[_0x8a52('0x11')][_0x8a52('0x14')]);}else{logger[_0x8a52('0x15')](_0x8a52('0x13'),_0x325e70,_0x8a52('0xf'));_0x3211b6(_0xa9e97e[_0x8a52('0x16')]['message']);}})['catch'](function(_0x3af811){logger[_0x8a52('0x11')](_0x8a52('0x13'),_0x325e70,_0x3af811);_0x433756(_0x3af811);});});}exports['ShowSetting']=function(_0x5170de){var _0x27617e=this;return new Promise(function(_0x4129b3,_0x172d14){return db[_0x8a52('0x17')]['find']({'raw':_0x5170de[_0x8a52('0x18')]?_0x5170de['options'][_0x8a52('0x19')]===undefined?!![]:![]:!![],'where':_0x5170de[_0x8a52('0x18')]?_0x5170de['options']['where']||null:null,'attributes':_0x5170de[_0x8a52('0x18')]?_0x5170de[_0x8a52('0x18')][_0x8a52('0x1a')]||null:null,'include':_0x5170de[_0x8a52('0x18')]?_0x5170de[_0x8a52('0x18')][_0x8a52('0x1b')]?_[_0x8a52('0x1c')](_0x5170de['options'][_0x8a52('0x1b')],function(_0x48be53){return{'model':db[_0x48be53['model']],'as':_0x48be53['as'],'attributes':_0x48be53[_0x8a52('0x1a')],'include':_0x48be53[_0x8a52('0x1b')]?_[_0x8a52('0x1c')](_0x48be53['include'],function(_0x151c77){return{'model':db[_0x151c77[_0x8a52('0x1d')]],'as':_0x151c77['as'],'attributes':_0x151c77[_0x8a52('0x1a')],'include':_0x151c77[_0x8a52('0x1b')]?_[_0x8a52('0x1c')](_0x151c77['include'],function(_0x2c80ec){return{'model':db[_0x2c80ec[_0x8a52('0x1d')]],'as':_0x2c80ec['as'],'attributes':_0x2c80ec[_0x8a52('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8a52('0xc')](function(_0x73454e){logger[_0x8a52('0x15')]('ShowSetting',_0x5170de);logger[_0x8a52('0xd')](_0x8a52('0x1e'),_0x5170de,JSON[_0x8a52('0x10')](_0x73454e));_0x4129b3(_0x73454e);})[_0x8a52('0x1f')](function(_0x110878){logger['error'](_0x8a52('0x1e'),_0x110878[_0x8a52('0x14')],_0x5170de);_0x172d14(_0x27617e[_0x8a52('0x11')](0x1f4,_0x110878[_0x8a52('0x14')]));});});}; \ No newline at end of file +var _0x350e=['util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','find','options','raw','where','attributes','include','model','map','lodash'];(function(_0x4bec2a,_0x47897d){var _0xca7411=function(_0x207770){while(--_0x207770){_0x4bec2a['push'](_0x4bec2a['shift']());}};_0xca7411(++_0x47897d);}(_0x350e,0x95));var _0xe350=function(_0x1dde0e,_0x2ef664){_0x1dde0e=_0x1dde0e-0x0;var _0x6871de=_0x350e[_0x1dde0e];return _0x6871de;};'use strict';var _=require(_0xe350('0x0'));var util=require(_0xe350('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe350('0x2'));var fs=require('fs');var Redis=require(_0xe350('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe350('0x4'))(_0xe350('0x5'));var config=require('../../config/environment');var jayson=require(_0xe350('0x6'));var client=jayson[_0xe350('0x7')][_0xe350('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3aff1c,_0x5ab816,_0x57cde2){return new BPromise(function(_0x1a30db,_0x2dfaaf){return client['request'](_0x3aff1c,_0x57cde2)[_0xe350('0x9')](function(_0x3b52c6){logger[_0xe350('0xa')](_0xe350('0xb'),_0x5ab816,_0xe350('0xc'));logger[_0xe350('0xd')](_0xe350('0xe'),_0x5ab816,_0xe350('0xc'),JSON[_0xe350('0xf')](_0x3b52c6));if(_0x3b52c6[_0xe350('0x10')]){if(_0x3b52c6['error'][_0xe350('0x11')]===0x1f4){logger['error'](_0xe350('0xb'),_0x5ab816,_0x3b52c6[_0xe350('0x10')][_0xe350('0x12')]);return _0x2dfaaf(_0x3b52c6['error']['message']);}logger[_0xe350('0x10')]('Setting,\x20%s,\x20%s',_0x5ab816,_0x3b52c6['error']['message']);return _0x1a30db(_0x3b52c6[_0xe350('0x10')][_0xe350('0x12')]);}else{logger['info'](_0xe350('0xb'),_0x5ab816,_0xe350('0xc'));_0x1a30db(_0x3b52c6[_0xe350('0x13')]['message']);}})[_0xe350('0x14')](function(_0x301ee1){logger['error'](_0xe350('0xb'),_0x5ab816,_0x301ee1);_0x2dfaaf(_0x301ee1);});});}exports[_0xe350('0x15')]=function(_0x5befe4){var _0x26563d=this;return new Promise(function(_0x4370dd,_0x502644){return db['Setting'][_0xe350('0x16')]({'raw':_0x5befe4[_0xe350('0x17')]?_0x5befe4[_0xe350('0x17')][_0xe350('0x18')]===undefined?!![]:![]:!![],'where':_0x5befe4['options']?_0x5befe4[_0xe350('0x17')][_0xe350('0x19')]||null:null,'attributes':_0x5befe4[_0xe350('0x17')]?_0x5befe4[_0xe350('0x17')][_0xe350('0x1a')]||null:null,'include':_0x5befe4['options']?_0x5befe4['options']['include']?_['map'](_0x5befe4[_0xe350('0x17')][_0xe350('0x1b')],function(_0x550182){return{'model':db[_0x550182[_0xe350('0x1c')]],'as':_0x550182['as'],'attributes':_0x550182['attributes'],'include':_0x550182['include']?_[_0xe350('0x1d')](_0x550182[_0xe350('0x1b')],function(_0x14d6a3){return{'model':db[_0x14d6a3['model']],'as':_0x14d6a3['as'],'attributes':_0x14d6a3['attributes'],'include':_0x14d6a3[_0xe350('0x1b')]?_[_0xe350('0x1d')](_0x14d6a3['include'],function(_0x3b1d29){return{'model':db[_0x3b1d29[_0xe350('0x1c')]],'as':_0x3b1d29['as'],'attributes':_0x3b1d29[_0xe350('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe350('0x9')](function(_0xfc1efd){logger['info']('ShowSetting',_0x5befe4);logger['debug'](_0xe350('0x15'),_0x5befe4,JSON[_0xe350('0xf')](_0xfc1efd));_0x4370dd(_0xfc1efd);})[_0xe350('0x14')](function(_0x1524d4){logger[_0xe350('0x10')](_0xe350('0x15'),_0x1524d4[_0xe350('0x12')],_0x5befe4);_0x502644(_0x26563d['error'](0x1f4,_0x1524d4['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 2aad426..1cab2d9 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 _0x5fc3=['/:id','show','getDispositions','/:id/canned_answers','/:id/applications','getInteractions','/:id/status','statusGet','post','create','/:id/dispositions','addAnswer','/:id/notify','/:id/send','send','status','/:id/users','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','describe'];(function(_0x4be005,_0x584dc6){var _0x13bea2=function(_0xf6fd8a){while(--_0xf6fd8a){_0x4be005['push'](_0x4be005['shift']());}};_0x13bea2(++_0x584dc6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0x5fc3[_0x4c9380];return _0x49a523;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/dispositions',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getAnswers']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getApplications']);router[_0x35fc('0x9')]('/:id/interactions',auth[_0x35fc('0xa')](),controller[_0x35fc('0x11')]);router[_0x35fc('0x9')](_0x35fc('0x12'),controller[_0x35fc('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x14')]('/',auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x14')](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller['addDisposition']);router[_0x35fc('0x14')](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x14')](_0x35fc('0x18'),controller['notify']);router[_0x35fc('0x14')](_0x35fc('0x10'),auth[_0x35fc('0xa')](),controller['addApplications']);router[_0x35fc('0x14')](_0x35fc('0x19'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1a')]);router[_0x35fc('0x14')](_0x35fc('0x12'),controller[_0x35fc('0x1b')]);router[_0x35fc('0x14')](_0x35fc('0x1c'),auth[_0x35fc('0xa')](),controller['addAgents']);router[_0x35fc('0x1d')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x1e')]);router[_0x35fc('0x1f')]('/:id',auth[_0x35fc('0xa')](),controller[_0x35fc('0x20')]);router['delete'](_0x35fc('0x16'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x21')]);router['delete'](_0x35fc('0xf'),auth['isAuthenticated'](),controller[_0x35fc('0x22')]);router[_0x35fc('0x1f')]('/:id/users',auth['isAuthenticated'](),controller[_0x35fc('0x23')]);module['exports']=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xc4aa[_0x4792c8];return _0x35edb1;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 90216a7..64381f2 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 _0xca1a=['exports','STRING','name','generate','ENUM','twilio','skebby','clicksend','plivo','clickatell','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','mandatoryDisposition','sequelize','randomstring'];(function(_0x4f267a,_0x4d3149){var _0x3eafdf=function(_0x36ed16){while(--_0x36ed16){_0x4f267a['push'](_0x4f267a['shift']());}};_0x3eafdf(++_0x4d3149);}(_0xca1a,0x1ae));var _0xaca1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xca1a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaca1('0x0'));var rs=require(_0xaca1('0x1'));module[_0xaca1('0x2')]={'name':{'type':Sequelize[_0xaca1('0x3')],'unique':_0xaca1('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xaca1('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xaca1('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xaca1('0x3')],'defaultValue':function(){return rs[_0xaca1('0x5')]();}},'phone':{'type':Sequelize[_0xaca1('0x3')]},'type':{'type':Sequelize[_0xaca1('0x6')](_0xaca1('0x7'),_0xaca1('0x8'),'connectel',_0xaca1('0x9'),_0xaca1('0xa'),_0xaca1('0xb'),'bandwidth',_0xaca1('0xc'),_0xaca1('0xd'),_0xaca1('0xe'))},'accountSid':{'type':Sequelize[_0xaca1('0x3')]},'authId':{'type':Sequelize[_0xaca1('0x3')]},'authToken':{'type':Sequelize[_0xaca1('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xaca1('0x3')]},'password':{'type':Sequelize[_0xaca1('0x3')]},'apiKey':{'type':Sequelize[_0xaca1('0x3')]},'applicationId':{'type':Sequelize[_0xaca1('0x3')]},'accountId':{'type':Sequelize[_0xaca1('0x3')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xaca1('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xaca1('0x3')]},'notificationTemplate':{'type':Sequelize[_0xaca1('0x10')],'defaultValue':function(){return _0xaca1('0x11');}},'notificationSound':{'type':Sequelize[_0xaca1('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xaca1('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaca1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xaca1('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaca1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaca1('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xaca1('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xaca1('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xaca1('0x12')],'comment':_0xaca1('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xaca1('0xf')],'defaultValue':![],'comment':_0xaca1('0x14'),'set':function(_0x1767bc){if(!_0x1767bc)this[_0xaca1('0x15')](_0xaca1('0x16'),null);this[_0xaca1('0x15')](_0xaca1('0x17'),_0x1767bc);}}}; \ No newline at end of file +var _0xc35f=['connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','ENUM','twilio','skebby'];(function(_0x3b9382,_0x32d102){var _0x303c10=function(_0xd10b4){while(--_0xd10b4){_0x3b9382['push'](_0x3b9382['shift']());}};_0x303c10(++_0x32d102);}(_0xc35f,0x1b9));var _0xfc35=function(_0x45ca99,_0x33c8cc){_0x45ca99=_0x45ca99-0x0;var _0x48fd0e=_0xc35f[_0x45ca99];return _0x48fd0e;};'use strict';var Sequelize=require(_0xfc35('0x0'));var rs=require(_0xfc35('0x1'));module[_0xfc35('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc35('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xfc35('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0xfc35('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xfc35('0x5')]();}},'phone':{'type':Sequelize[_0xfc35('0x4')]},'type':{'type':Sequelize[_0xfc35('0x6')](_0xfc35('0x7'),_0xfc35('0x8'),_0xfc35('0x9'),_0xfc35('0xa'),_0xfc35('0xb'),_0xfc35('0xc'),'bandwidth',_0xfc35('0xd'),_0xfc35('0xe'),_0xfc35('0xf'))},'accountSid':{'type':Sequelize[_0xfc35('0x4')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0xfc35('0x4')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0xfc35('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xfc35('0x4')]},'accountId':{'type':Sequelize[_0xfc35('0x4')]},'senderString':{'type':Sequelize[_0xfc35('0x4')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xfc35('0x4')]},'notificationTemplate':{'type':Sequelize[_0xfc35('0x10')],'defaultValue':function(){return _0xfc35('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfc35('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfc35('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc35('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfc35('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc35('0x13')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfc35('0x4')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfc35('0x13')],'comment':_0xfc35('0x14')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xfc35('0x15'),'set':function(_0x207654){if(!_0x207654)this[_0xfc35('0x16')](_0xfc35('0x17'),null);this[_0xfc35('0x16')](_0xfc35('0x18'),_0x207654);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 688aa1a..14479c8 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 _0x5375=['./smsAccount.socket','register','jayson/promise','client','http','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','stack','send','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','name','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','Pause','keys','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','SmsAccountId','Disposition','findOne','findAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','sender','text','connectel','clicksend','message_id','plivo','Text','messageId','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','unshift','agent','waitForTheAssignedAgent','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','DESC','List','Messages','user','dataValues','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','clickatell','redif','DELIVERED','message-delivered','DELIVRD','ACCEPTD','statusGet','state','message-id','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x48feee,_0x2d8cfa){var _0x12424b=function(_0x159bea){while(--_0x159bea){_0x48feee['push'](_0x48feee['shift']());}};_0x12424b(++_0x2d8cfa);}(_0x5375,0x1a9));var _0x5537=function(_0x73a8e3,_0x185997){_0x73a8e3=_0x73a8e3-0x0;var _0x68397f=_0x5375[_0x73a8e3];return _0x68397f;};'use strict';var emlformat=require(_0x5537('0x0'));var rimraf=require(_0x5537('0x1'));var zipdir=require(_0x5537('0x2'));var jsonpatch=require(_0x5537('0x3'));var rp=require(_0x5537('0x4'));var moment=require(_0x5537('0x5'));var BPromise=require(_0x5537('0x6'));var Mustache=require(_0x5537('0x7'));var util=require(_0x5537('0x8'));var path=require(_0x5537('0x9'));var sox=require('sox');var csv=require(_0x5537('0xa'));var ejs=require(_0x5537('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5537('0xc'));var crypto=require(_0x5537('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5537('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5537('0xf'));var Papa=require(_0x5537('0x10'));var Redis=require(_0x5537('0x11'));var authService=require(_0x5537('0x12'));var qs=require(_0x5537('0x13'));var as=require(_0x5537('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5537('0x15'))(_0x5537('0x16'));var utils=require(_0x5537('0x17'));var config=require(_0x5537('0x18'));var licenseUtil=require(_0x5537('0x19'));var db=require(_0x5537('0x1a'))['db'];config[_0x5537('0x1b')]=_[_0x5537('0x1c')](config[_0x5537('0x1b')],{'host':_0x5537('0x1d'),'port':0x18eb});var socket=require(_0x5537('0x1e'))(new Redis(config[_0x5537('0x1b')]));require(_0x5537('0x1f'))[_0x5537('0x20')](socket);var jayson=require(_0x5537('0x21'));var client=jayson[_0x5537('0x22')][_0x5537('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x2fa7cb,_0x4068f7,_0x23b305,_0x560f5f){return new BPromise(function(_0x239246,_0x2f85ed){var _0x42e36d=_0x560f5f||client;return _0x42e36d['request'](_0x2fa7cb,_0x23b305)[_0x5537('0x24')](function(_0x2d354f){logger[_0x5537('0x25')]('SmsAccount,\x20%s,\x20%s',_0x4068f7,_0x5537('0x26'));logger[_0x5537('0x27')](_0x5537('0x28'),_0x4068f7,_0x5537('0x26'),JSON['stringify'](_0x2d354f));if(_0x2d354f['error']){if(_0x2d354f[_0x5537('0x29')][_0x5537('0x2a')]===0x1f4){logger['error'](_0x5537('0x2b'),_0x4068f7,_0x2d354f[_0x5537('0x29')][_0x5537('0x2c')]);return _0x2f85ed(_0x2d354f[_0x5537('0x29')][_0x5537('0x2c')]);}logger[_0x5537('0x29')]('SmsAccount,\x20%s,\x20%s',_0x4068f7,_0x2d354f[_0x5537('0x29')][_0x5537('0x2c')]);return _0x239246(_0x2d354f[_0x5537('0x29')][_0x5537('0x2c')]);}else{logger[_0x5537('0x25')](_0x5537('0x2b'),_0x4068f7,_0x5537('0x26'));_0x239246(_0x2d354f['result'][_0x5537('0x2c')]);}})[_0x5537('0x2d')](function(_0x2a0256){logger[_0x5537('0x29')](_0x5537('0x2b'),_0x4068f7,_0x2a0256);_0x2f85ed(_0x2a0256);});});}function respondWithStatusCode(_0x133934,_0x270661){_0x270661=_0x270661||0xcc;return function(_0x102759){if(_0x102759){return _0x133934[_0x5537('0x2e')](_0x270661);}return _0x133934[_0x5537('0x2f')](_0x270661)[_0x5537('0x30')]();};}function respondWithResult(_0xd0645a,_0x48a650){_0x48a650=_0x48a650||0xc8;return function(_0x528d13){if(_0x528d13){return _0xd0645a[_0x5537('0x2f')](_0x48a650)[_0x5537('0x31')](_0x528d13);}};}function respondWithFilteredResult(_0x2e5283,_0x444a40){return function(_0x239ccd){if(_0x239ccd){var _0x2482dc=typeof _0x444a40[_0x5537('0x32')]===_0x5537('0x33')&&typeof _0x444a40[_0x5537('0x34')]===_0x5537('0x33');var _0xde67=_0x239ccd[_0x5537('0x35')];var _0x380f62=_0x2482dc?0x0:_0x444a40[_0x5537('0x32')];var _0xd3696=_0x2482dc?_0x239ccd['count']:_0x444a40[_0x5537('0x32')]+_0x444a40[_0x5537('0x34')];var _0x3bcfe7;if(_0xd3696>=_0xde67){_0xd3696=_0xde67;_0x3bcfe7=0xc8;}else{_0x3bcfe7=0xce;}_0x2e5283[_0x5537('0x2f')](_0x3bcfe7);return _0x2e5283[_0x5537('0x36')](_0x5537('0x37'),_0x380f62+'-'+_0xd3696+'/'+_0xde67)[_0x5537('0x31')](_0x239ccd);}return null;};}function patchUpdates(_0x3802ff){return function(_0x12c9ad){try{jsonpatch[_0x5537('0x38')](_0x12c9ad,_0x3802ff,!![]);}catch(_0x54cdf3){return BPromise[_0x5537('0x39')](_0x54cdf3);}return _0x12c9ad[_0x5537('0x3a')]();};}function saveUpdates(_0x285e90,_0x2ce97a){return function(_0x24e334){if(_0x24e334){return _0x24e334[_0x5537('0x3b')](_0x285e90)[_0x5537('0x24')](function(_0x39a00e){return _0x39a00e;});}return null;};}function removeEntity(_0x4f5311,_0x1dbb43){return function(_0x10dfb2){if(_0x10dfb2){return _0x10dfb2['destroy']()[_0x5537('0x24')](function(){var _0x29d6f0=_0x10dfb2[_0x5537('0x3c')]({'plain':!![]});var _0x51e0ee='SmsAccounts';return db[_0x5537('0x3d')][_0x5537('0x3e')]({'where':{'type':_0x51e0ee,'resourceId':_0x29d6f0['id']}})[_0x5537('0x24')](function(){return _0x10dfb2;});})[_0x5537('0x24')](function(){_0x4f5311[_0x5537('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33d4ee,_0x27dcd0){return function(_0xd4d471){if(!_0xd4d471){_0x33d4ee['sendStatus'](0x194);}return _0xd4d471;};}function handleError(_0x363e83,_0x2875db){_0x2875db=_0x2875db||0x1f4;return function(_0x596e7c){logger['error'](_0x596e7c[_0x5537('0x3f')]);if(_0x596e7c['name']){delete _0x596e7c['name'];}_0x363e83['status'](_0x2875db)[_0x5537('0x40')](_0x596e7c);};}exports[_0x5537('0x41')]=function(_0x2c393d,_0x4750e0){var _0xe2120c={'include':[{'model':db['Pause'],'as':_0x5537('0x42')}]},_0xa2241a={},_0x27202d={'count':0x0,'rows':[]};var _0x493626=_[_0x5537('0x43')](db[_0x5537('0x44')][_0x5537('0x45')],function(_0xea07b9){return{'name':_0xea07b9[_0x5537('0x46')],'type':_0xea07b9['type'][_0x5537('0x47')]};});_0xa2241a[_0x5537('0x48')]=_['map'](_0x493626,_0x5537('0x49'));_0xa2241a[_0x5537('0x4a')]=_['keys'](_0x2c393d[_0x5537('0x4a')]);_0xa2241a[_0x5537('0x4b')]=_[_0x5537('0x4c')](_0xa2241a[_0x5537('0x48')],_0xa2241a[_0x5537('0x4a')]);_0xe2120c['attributes']=_[_0x5537('0x4c')](_0xa2241a['model'],qs[_0x5537('0x4d')](_0x2c393d[_0x5537('0x4a')][_0x5537('0x4d')]));_0xe2120c[_0x5537('0x4e')]=_0xe2120c[_0x5537('0x4e')]['length']?_0xe2120c['attributes']:_0xa2241a['model'];if(!_0x2c393d['query'][_0x5537('0x4f')](_0x5537('0x50'))){_0xe2120c[_0x5537('0x34')]=qs[_0x5537('0x34')](_0x2c393d['query'][_0x5537('0x34')]);_0xe2120c['offset']=qs[_0x5537('0x32')](_0x2c393d[_0x5537('0x4a')][_0x5537('0x32')]);}_0xe2120c[_0x5537('0x51')]=qs['sort'](_0x2c393d[_0x5537('0x4a')][_0x5537('0x52')]);_0xe2120c[_0x5537('0x53')]=qs['filters'](_[_0x5537('0x54')](_0x2c393d['query'],_0xa2241a['filters']),_0x493626);if(_0x2c393d['query'][_0x5537('0x55')]){_0xe2120c[_0x5537('0x53')]=_[_0x5537('0x56')](_0xe2120c[_0x5537('0x53')],{'$or':_[_0x5537('0x43')](_0x493626,function(_0x1bc4d8){if(_0x1bc4d8[_0x5537('0x57')]!==_0x5537('0x58')){var _0x16d542={};_0x16d542[_0x1bc4d8[_0x5537('0x49')]]={'$like':'%'+_0x2c393d[_0x5537('0x4a')][_0x5537('0x55')]+'%'};return _0x16d542;}})});}_0xe2120c=_['merge']({},_0xe2120c,_0x2c393d[_0x5537('0x59')]);var _0x3a2ac5={'where':_0xe2120c['where']};return db['SmsAccount'][_0x5537('0x35')](_0x3a2ac5)[_0x5537('0x24')](function(_0x4bfc69){_0x27202d[_0x5537('0x35')]=_0x4bfc69;if(_0x2c393d[_0x5537('0x4a')][_0x5537('0x5a')]){_0xe2120c[_0x5537('0x5b')]=[{'all':!![]}];}return db[_0x5537('0x44')]['findAll'](_0xe2120c);})[_0x5537('0x24')](function(_0x3d6922){_0x27202d[_0x5537('0x5c')]=_0x3d6922;return _0x27202d;})[_0x5537('0x24')](respondWithFilteredResult(_0x4750e0,_0xe2120c))[_0x5537('0x2d')](handleError(_0x4750e0,null));};exports[_0x5537('0x5d')]=function(_0x52d87f,_0x616c48){var _0x4cc3b6={'raw':![],'where':{'id':_0x52d87f[_0x5537('0x5e')]['id']},'include':[{'model':db[_0x5537('0x5f')],'as':_0x5537('0x42')}]},_0x6300df={};_0x6300df[_0x5537('0x48')]=_['keys'](db[_0x5537('0x44')]['rawAttributes']);_0x6300df['query']=_[_0x5537('0x60')](_0x52d87f[_0x5537('0x4a')]);_0x6300df[_0x5537('0x4b')]=_[_0x5537('0x4c')](_0x6300df[_0x5537('0x48')],_0x6300df[_0x5537('0x4a')]);_0x4cc3b6[_0x5537('0x4e')]=_[_0x5537('0x4c')](_0x6300df[_0x5537('0x48')],qs[_0x5537('0x4d')](_0x52d87f[_0x5537('0x4a')]['fields']));_0x4cc3b6[_0x5537('0x4e')]=_0x4cc3b6[_0x5537('0x4e')][_0x5537('0x61')]?_0x4cc3b6['attributes']:_0x6300df['model'];if(_0x52d87f[_0x5537('0x4a')]['includeAll']){_0x4cc3b6[_0x5537('0x5b')]=[{'all':!![]}];}_0x4cc3b6=_[_0x5537('0x56')]({},_0x4cc3b6,_0x52d87f[_0x5537('0x59')]);return db[_0x5537('0x44')][_0x5537('0x62')](_0x4cc3b6)[_0x5537('0x24')](handleEntityNotFound(_0x616c48,null))[_0x5537('0x24')](respondWithResult(_0x616c48,null))['catch'](handleError(_0x616c48,null));};exports[_0x5537('0x63')]=function(_0x1324a6,_0x53e94e){return db[_0x5537('0x44')]['create'](_0x1324a6['body'],{})[_0x5537('0x24')](function(_0x4eb6a2){var _0x4f3ef8=_0x1324a6['user'][_0x5537('0x3c')]({'plain':!![]});if(!_0x4f3ef8)throw new Error(_0x5537('0x64'));if(_0x4f3ef8[_0x5537('0x65')]==='user'){var _0x219c85=_0x4eb6a2['get']({'plain':!![]});var _0xe5b755='SmsAccounts';return db['UserProfileSection'][_0x5537('0x62')]({'where':{'name':_0xe5b755,'userProfileId':_0x4f3ef8['userProfileId']},'raw':!![]})[_0x5537('0x24')](function(_0x17f89b){if(_0x17f89b&&_0x17f89b[_0x5537('0x66')]===0x0){return db[_0x5537('0x3d')]['create']({'name':_0x219c85[_0x5537('0x49')],'resourceId':_0x219c85['id'],'type':_0x17f89b[_0x5537('0x49')],'sectionId':_0x17f89b['id']},{})[_0x5537('0x24')](function(){return _0x4eb6a2;});}else{return _0x4eb6a2;}})['catch'](function(_0x5559b0){logger['error'](_0x5537('0x67'),_0x5559b0);throw _0x5559b0;});}return _0x4eb6a2;})[_0x5537('0x24')](respondWithResult(_0x53e94e,0xc9))[_0x5537('0x2d')](handleError(_0x53e94e,null));};exports[_0x5537('0x3b')]=function(_0x56abcd,_0x4a7edb){if(_0x56abcd['body']['id']){delete _0x56abcd[_0x5537('0x68')]['id'];}return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x56abcd['params']['id']},'include':[{'model':db[_0x5537('0x5f')],'as':_0x5537('0x42')}]})[_0x5537('0x24')](handleEntityNotFound(_0x4a7edb,null))[_0x5537('0x24')](saveUpdates(_0x56abcd[_0x5537('0x68')],null))[_0x5537('0x24')](respondWithResult(_0x4a7edb,null))['catch'](handleError(_0x4a7edb,null));};exports[_0x5537('0x3e')]=function(_0x2fc122,_0xeab679){return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x2fc122[_0x5537('0x5e')]['id']}})['then'](handleEntityNotFound(_0xeab679,null))['then'](removeEntity(_0xeab679,null))[_0x5537('0x2d')](handleError(_0xeab679,null));};exports[_0x5537('0x69')]=function(_0x2a0e90,_0x372a88){return db[_0x5537('0x44')]['describe']()[_0x5537('0x24')](respondWithResult(_0x372a88,null))[_0x5537('0x2d')](handleError(_0x372a88,null));};exports[_0x5537('0x6a')]=function(_0x523949,_0x1eae65,_0x397e29){if(_0x523949[_0x5537('0x68')]['id']){delete _0x523949[_0x5537('0x68')]['id'];}return db['SmsAccount'][_0x5537('0x62')]({'where':{'id':_0x523949['params']['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x1eae65,null))[_0x5537('0x24')](function(_0x39e3f8){if(_0x39e3f8){_0x523949['body'][_0x5537('0x6b')]=_0x39e3f8['id'];return db[_0x5537('0x6c')][_0x5537('0x63')](_0x523949[_0x5537('0x68')]);}})[_0x5537('0x24')](respondWithResult(_0x1eae65,null))['catch'](handleError(_0x1eae65,null));};exports['getDispositions']=function(_0x471374,_0x384b13,_0x221553){var _0x37ba36={'raw':![],'where':{}};var _0x3adff5={};var _0x746baa={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5537('0x6d')]({'where':{'id':_0x471374['params']['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x384b13,null))['then'](function(_0x958c5d){if(_0x958c5d){_0x3adff5['model']=_[_0x5537('0x60')](db[_0x5537('0x6c')][_0x5537('0x45')]);_0x3adff5['query']=_[_0x5537('0x60')](_0x471374[_0x5537('0x4a')]);_0x3adff5['filters']=_[_0x5537('0x4c')](_0x3adff5[_0x5537('0x48')],_0x3adff5[_0x5537('0x4a')]);_0x37ba36['attributes']=_['intersection'](_0x3adff5[_0x5537('0x48')],qs['fields'](_0x471374[_0x5537('0x4a')][_0x5537('0x4d')]));_0x37ba36[_0x5537('0x4e')]=_0x37ba36[_0x5537('0x4e')][_0x5537('0x61')]?_0x37ba36[_0x5537('0x4e')]:_0x3adff5[_0x5537('0x48')];if(!_0x471374[_0x5537('0x4a')][_0x5537('0x4f')](_0x5537('0x50'))){_0x37ba36[_0x5537('0x34')]=qs[_0x5537('0x34')](_0x471374['query'][_0x5537('0x34')]);_0x37ba36['offset']=qs['offset'](_0x471374[_0x5537('0x4a')][_0x5537('0x32')]);}_0x37ba36['order']=qs[_0x5537('0x52')](_0x471374['query'][_0x5537('0x52')]);_0x37ba36[_0x5537('0x53')]=qs[_0x5537('0x4b')](_['pick'](_0x471374['query'],_0x3adff5[_0x5537('0x4b')]));_0x37ba36['where'][_0x5537('0x6b')]=_0x958c5d['id'];if(_0x471374[_0x5537('0x4a')]['filter']){_0x37ba36[_0x5537('0x53')]=_[_0x5537('0x56')](_0x37ba36[_0x5537('0x53')],{'$or':_['map'](_0x37ba36[_0x5537('0x4e')],function(_0x1d4cac){var _0x58517b={};_0x58517b[_0x1d4cac]={'$like':'%'+_0x471374[_0x5537('0x4a')][_0x5537('0x55')]+'%'};return _0x58517b;})});}_0x37ba36=_[_0x5537('0x56')]({},_0x37ba36,_0x471374[_0x5537('0x59')]);return db[_0x5537('0x6c')]['count']({'where':_0x37ba36[_0x5537('0x53')]})[_0x5537('0x24')](function(_0xde39d3){_0x746baa[_0x5537('0x35')]=_0xde39d3;if(_0x471374[_0x5537('0x4a')][_0x5537('0x5a')]){_0x37ba36['include']=[{'all':!![]}];}return db[_0x5537('0x6c')][_0x5537('0x6e')](_0x37ba36);})[_0x5537('0x24')](function(_0x1926a5){_0x746baa[_0x5537('0x5c')]=_0x1926a5;return _0x746baa;});}})[_0x5537('0x24')](respondWithFilteredResult(_0x384b13,_0x37ba36))[_0x5537('0x2d')](handleError(_0x384b13,null));};exports[_0x5537('0x6f')]=function(_0x40d9de,_0x2f4099,_0x5c5cc6){return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x40d9de[_0x5537('0x5e')]['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x2f4099,null))[_0x5537('0x24')](function(_0xa5214b){if(_0xa5214b){return _0xa5214b['removeDispositions'](_0x40d9de[_0x5537('0x4a')][_0x5537('0x70')]);}})[_0x5537('0x24')](respondWithStatusCode(_0x2f4099,null))[_0x5537('0x2d')](handleError(_0x2f4099,null));};exports['addAnswer']=function(_0x5daa70,_0x5aefb5,_0x473c34){if(_0x5daa70[_0x5537('0x68')]['id']){delete _0x5daa70[_0x5537('0x68')]['id'];}return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x5daa70['params']['id']}})['then'](handleEntityNotFound(_0x5aefb5,null))['then'](function(_0x37371a){if(_0x37371a){_0x5daa70['body'][_0x5537('0x6b')]=_0x37371a['id'];return db['CannedAnswer'][_0x5537('0x63')](_0x5daa70['body']);}})[_0x5537('0x24')](respondWithResult(_0x5aefb5,null))[_0x5537('0x2d')](handleError(_0x5aefb5,null));};exports[_0x5537('0x71')]=function(_0x38a119,_0xf9bf03,_0x49e7e7){var _0x3754d4={'raw':![],'where':{}};var _0x32b015={};var _0xee06b5={'count':0x0,'rows':[]};return db[_0x5537('0x44')][_0x5537('0x6d')]({'where':{'id':_0x38a119[_0x5537('0x5e')]['id']}})[_0x5537('0x24')](handleEntityNotFound(_0xf9bf03,null))['then'](function(_0x4cbe96){if(_0x4cbe96){_0x32b015[_0x5537('0x48')]=_[_0x5537('0x60')](db[_0x5537('0x72')]['rawAttributes']);_0x32b015['query']=_['keys'](_0x38a119['query']);_0x32b015[_0x5537('0x4b')]=_[_0x5537('0x4c')](_0x32b015[_0x5537('0x48')],_0x32b015['query']);_0x3754d4['attributes']=_[_0x5537('0x4c')](_0x32b015[_0x5537('0x48')],qs[_0x5537('0x4d')](_0x38a119[_0x5537('0x4a')]['fields']));_0x3754d4['attributes']=_0x3754d4[_0x5537('0x4e')][_0x5537('0x61')]?_0x3754d4['attributes']:_0x32b015[_0x5537('0x48')];if(!_0x38a119[_0x5537('0x4a')][_0x5537('0x4f')](_0x5537('0x50'))){_0x3754d4['limit']=qs['limit'](_0x38a119[_0x5537('0x4a')]['limit']);_0x3754d4[_0x5537('0x32')]=qs['offset'](_0x38a119[_0x5537('0x4a')][_0x5537('0x32')]);}_0x3754d4[_0x5537('0x51')]=qs[_0x5537('0x52')](_0x38a119[_0x5537('0x4a')][_0x5537('0x52')]);_0x3754d4[_0x5537('0x53')]=qs['filters'](_['pick'](_0x38a119[_0x5537('0x4a')],_0x32b015[_0x5537('0x4b')]));_0x3754d4['where'][_0x5537('0x6b')]=_0x4cbe96['id'];if(_0x38a119[_0x5537('0x4a')][_0x5537('0x55')]){_0x3754d4['where']=_[_0x5537('0x56')](_0x3754d4[_0x5537('0x53')],{'$or':_[_0x5537('0x43')](_0x3754d4[_0x5537('0x4e')],function(_0x1f18c2){var _0x286954={};_0x286954[_0x1f18c2]={'$like':'%'+_0x38a119['query'][_0x5537('0x55')]+'%'};return _0x286954;})});}_0x3754d4=_[_0x5537('0x56')]({},_0x3754d4,_0x38a119[_0x5537('0x59')]);return db['CannedAnswer'][_0x5537('0x35')]({'where':_0x3754d4[_0x5537('0x53')]})[_0x5537('0x24')](function(_0xa03de1){_0xee06b5[_0x5537('0x35')]=_0xa03de1;if(_0x38a119['query'][_0x5537('0x5a')]){_0x3754d4[_0x5537('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5537('0x6e')](_0x3754d4);})[_0x5537('0x24')](function(_0x39d243){_0xee06b5[_0x5537('0x5c')]=_0x39d243;return _0xee06b5;});}})[_0x5537('0x24')](respondWithFilteredResult(_0xf9bf03,_0x3754d4))[_0x5537('0x2d')](handleError(_0xf9bf03,null));};exports[_0x5537('0x73')]=function(_0x1f2a8c,_0x24b6fe,_0x5dad45){return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x1f2a8c['params']['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x24b6fe,null))[_0x5537('0x24')](function(_0x5b6383){if(_0x5b6383){return _0x5b6383['removeAnswers'](_0x1f2a8c[_0x5537('0x4a')][_0x5537('0x70')]);}})[_0x5537('0x24')](respondWithStatusCode(_0x24b6fe,null))[_0x5537('0x2d')](handleError(_0x24b6fe,null));};exports[_0x5537('0x74')]=function(_0x41ef51,_0x16a1b4,_0x4be6bb){var _0x18fa34={'channel':'sms'};var _0xce918f=[];var _0x325eb2=[];var _0x1ae2c4={};return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x41ef51[_0x5537('0x5e')]['id']},'include':[{'model':db[_0x5537('0x75')],'as':_0x5537('0x76')}]})[_0x5537('0x24')](handleEntityNotFound(_0x16a1b4,null))[_0x5537('0x24')](function(_0x2e9a5e){_0x18fa34['account']=_0x2e9a5e;_0x18fa34[_0x5537('0x77')]=_[_0x5537('0x78')](_0x2e9a5e[_0x5537('0x76')],[_0x5537('0x79')],[_0x5537('0x7a')]);if(_0x18fa34[_0x5537('0x7b')][_0x5537('0x76')]){delete _0x18fa34[_0x5537('0x7b')][_0x5537('0x76')];}return db[_0x5537('0x7c')][_0x5537('0x69')]();})[_0x5537('0x24')](function(_0x23363b){if(!_0x23363b){throw new db[(_0x5537('0x7d'))][(_0x5537('0x7e'))](_0x5537('0x7f'));}_0xce918f=_[_0x5537('0x80')](_[_0x5537('0x60')](_0x23363b),[_0x5537('0x81'),_0x5537('0x82')]);_0x325eb2=_[_0x5537('0x80')](_[_0x5537('0x60')](_0x23363b),[_0x5537('0x81'),_0x5537('0x82'),_0x5537('0x83'),_0x5537('0x84')]);_0x18fa34[_0x5537('0x68')]={'mapKey':_0x5537('0x85')};if(_0x18fa34['account']['type']){switch(_0x18fa34[_0x5537('0x7b')][_0x5537('0x57')]){case _0x5537('0x86'):_0x18fa34['body'][_0x5537('0x87')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x88')];_0x18fa34[_0x5537('0x68')][_0x5537('0x68')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x89')];_0x18fa34[_0x5537('0x68')]['messageId']=_0x41ef51[_0x5537('0x68')]['MessageSid'];break;case'skebby':_0x18fa34['body'][_0x5537('0x87')]='+'+_0x41ef51[_0x5537('0x68')][_0x5537('0x8a')];_0x18fa34[_0x5537('0x68')][_0x5537('0x68')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x8b')];break;case _0x5537('0x8c'):_0x18fa34['body']['from']=_0x41ef51[_0x5537('0x68')][_0x5537('0x87')];_0x18fa34['body'][_0x5537('0x68')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x2c')];break;case _0x5537('0x8d'):_0x18fa34[_0x5537('0x68')][_0x5537('0x87')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x87')];_0x18fa34[_0x5537('0x68')][_0x5537('0x68')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x68')];_0x18fa34[_0x5537('0x68')]['messageId']=_0x41ef51[_0x5537('0x68')][_0x5537('0x8e')];break;case _0x5537('0x8f'):_0x18fa34[_0x5537('0x68')]['from']=_0x41ef51['body']['From'];_0x18fa34[_0x5537('0x68')][_0x5537('0x68')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x90')];_0x18fa34[_0x5537('0x68')][_0x5537('0x91')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x92')];break;case _0x5537('0x93'):_0x18fa34[_0x5537('0x68')][_0x5537('0x87')]='+'+_0x41ef51[_0x5537('0x68')][_0x5537('0x94')][0x0][_0x5537('0x87')];_0x18fa34[_0x5537('0x68')][_0x5537('0x68')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x94')][0x0][_0x5537('0x8b')];_0x18fa34[_0x5537('0x68')][_0x5537('0x91')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x94')][0x0][_0x5537('0x91')];break;case _0x5537('0x95'):_0x18fa34[_0x5537('0x68')]['from']=_0x41ef51[_0x5537('0x68')][_0x5537('0x96')];_0x18fa34[_0x5537('0x68')]['body']=_0x41ef51['body'][_0x5537('0x97')][_0x5537('0x2c')];break;case'clickatell':_0x18fa34[_0x5537('0x68')]['from']=_0x41ef51['body'][_0x5537('0x98')];_0x18fa34['body']['body']=_0x41ef51[_0x5537('0x68')]['text'];_0x18fa34[_0x5537('0x68')]['messageId']=_0x41ef51['body'][_0x5537('0x99')];break;case _0x5537('0x9a'):_0x18fa34['body'][_0x5537('0x91')]=_0x41ef51[_0x5537('0x68')][0x0][_0x5537('0x2c')]['id'];_0x18fa34[_0x5537('0x68')][_0x5537('0x87')]=_0x41ef51[_0x5537('0x68')][0x0]['message'][_0x5537('0x87')];_0x18fa34[_0x5537('0x68')][_0x5537('0x68')]=_0x41ef51[_0x5537('0x68')][0x0]['message'][_0x5537('0x8b')];break;case _0x5537('0x9b'):_0x18fa34[_0x5537('0x68')]['from']=_0x41ef51['body'][_0x5537('0x87')];_0x18fa34['body'][_0x5537('0x68')]=_0x41ef51['body']['message'];_0x18fa34[_0x5537('0x68')][_0x5537('0x91')]=_0x41ef51[_0x5537('0x68')][_0x5537('0x9c')];break;}}if(_0x18fa34[_0x5537('0x68')]['id']){delete _0x18fa34[_0x5537('0x68')]['id'];}if(_[_0x5537('0x9d')](_0x18fa34[_0x5537('0x68')]['from'])){throw new db[(_0x5537('0x7d'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x5537('0x9d')](_0x18fa34[_0x5537('0x68')][_0x5537('0x68')])||_0x18fa34['body']['body']===''){throw new db[(_0x5537('0x7d'))]['ValidationError'](_0x5537('0x9e'));}if(_[_0x5537('0x9d')](_0x18fa34[_0x5537('0x68')][_0x5537('0x9f')])){throw new db[(_0x5537('0x7d'))][(_0x5537('0x7e'))](_0x5537('0xa0')+_0x325eb2);}if(!_[_0x5537('0xa1')](_0x325eb2,_0x18fa34['body'][_0x5537('0x9f')])){throw new db[(_0x5537('0x7d'))][(_0x5537('0x7e'))](_0x5537('0xa2')+_0x325eb2);}_0x1ae2c4[_0x18fa34['body'][_0x5537('0x9f')]]=_0x18fa34[_0x5537('0x68')][_0x5537('0x87')];return db[_0x5537('0xa3')]['find']({'where':{'id':_0x18fa34[_0x5537('0x7b')][_0x5537('0x84')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1ae2c4,'limit':0x1,'order':[[_0x5537('0x82'),'DESC']]}]});})['then'](handleEntityNotFound(_0x16a1b4,null))['then'](function(_0x1af5a3){if(_0x1af5a3){_0x18fa34[_0x5537('0xa4')]=_[_0x5537('0xa5')](_0x1af5a3,['Contacts']);if(_0x1af5a3[_0x5537('0xa6')][_0x5537('0x61')]){return _0x1af5a3['Contacts'][0x0];}var _0x38ecc3=_[_0x5537('0x1c')](_0x18fa34['body'],{'firstName':_0x18fa34['body'][_0x5537('0x87')],'ListId':_0x1af5a3['id']});_0x38ecc3[_0x18fa34[_0x5537('0x68')]['mapKey']]=_0x18fa34['body'][_0x5537('0x87')];return db[_0x5537('0x7c')][_0x5537('0x63')](_0x38ecc3,{'fields':_0xce918f,'raw':!![]});}})[_0x5537('0x24')](handleEntityNotFound(_0x16a1b4,null))['then'](function(_0x19c9c9){if(_0x19c9c9){_0x18fa34[_0x5537('0xa7')]=_0x19c9c9;var _0x463c06={'ContactId':_0x19c9c9['id'],'phone':_0x18fa34[_0x5537('0x68')][_0x5537('0x87')],'SmsAccountId':_0x41ef51[_0x5537('0x5e')]['id']};var _0x1ff68a={'ContactId':_0x19c9c9['id'],'SmsAccountId':_0x41ef51[_0x5537('0x5e')]['id'],'closed':![]};return db[_0x5537('0xa8')]['find']({'where':_0x1ff68a})['then'](function(_0x1b69fb){if(_0x1b69fb){return[_0x1b69fb,![]];}return db[_0x5537('0xa8')][_0x5537('0x63')](_0x463c06)[_0x5537('0x24')](function(_0x1db82c){return[_0x1db82c,!![]];});});}})[_0x5537('0xa9')](function(_0x9565d6,_0xbf3ec5){_0x18fa34[_0x5537('0xaa')]=_0x9565d6[_0x5537('0x3c')]({'plain':!![]});_0x18fa34[_0x5537('0xaa')][_0x5537('0xab')]=![];if(_0xbf3ec5){if(_0x18fa34[_0x5537('0x7b')][_0x5537('0xac')]){_0x18fa34[_0x5537('0x77')][_0x5537('0xad')]({'id':0x0,'priority':_0x18fa34[_0x5537('0x77')][_0x5537('0x61')]+0x1,'app':_0x5537('0xae'),'appdata':'unmanaged','interval':_0x5537('0xaf')});}_0x18fa34[_0x5537('0xaa')][_0x5537('0xab')]=!![];}return db[_0x5537('0xb0')][_0x5537('0x63')]({'phone':_0x18fa34['body'][_0x5537('0x87')],'messageId':_0x18fa34['body'][_0x5537('0x91')],'body':_0x18fa34['body'][_0x5537('0x68')],'SmsAccountId':_0x41ef51[_0x5537('0x5e')]['id'],'SmsInteractionId':_0x9565d6['id'],'direction':'in','ContactId':_0x9565d6[_0x5537('0xb1')],'AttachmentId':_0x18fa34['body'][_0x5537('0xb2')]});})['then'](function(_0x5bd463){_0x18fa34[_0x5537('0x2c')]=_0x5bd463;if(_0x18fa34[_0x5537('0xaa')]['UserId']){return db['User'][_0x5537('0x62')]({'attributes':['id',_0x5537('0x49')],'where':{'id':_0x18fa34[_0x5537('0xaa')]['UserId']}})[_0x5537('0x24')](function(_0x28df55){if(_0x28df55){_0x18fa34['applications'][_0x5537('0xb3')]({'id':0x0,'priority':0x0,'app':_0x5537('0xb4'),'appdata':_0x28df55['name']+','+(_0x18fa34['account'][_0x5537('0xb5')]||0xa),'interval':_0x5537('0xaf')});}return respondWithRpcPromise('Start',_0x5537('0xb6'),_0x18fa34);});}return respondWithRpcPromise('Start',_0x5537('0xb6'),_0x18fa34);})[_0x5537('0x24')](function(_0x2f58cc){if(_0x2f58cc){var _0x13bf7e=0xc8;var _0x189a3a='receiveMessage';logger[_0x5537('0x25')](_0x5537('0x28'),_0x189a3a,_0x13bf7e,'entity\x20found');logger[_0x5537('0x27')](_0x5537('0xb7'),_0x189a3a,_0x13bf7e,_0x5537('0xb8'),JSON[_0x5537('0xb9')](_0x2f58cc));if(_0x18fa34['account']['type']===_0x5537('0x86')){return _0x16a1b4[_0x5537('0x2f')](_0x13bf7e)[_0x5537('0x36')]('Content-Type','text/xml')['send']('\x0a');}else{return _0x16a1b4[_0x5537('0x2f')](_0x13bf7e)['json'](_0x2f58cc);}}})['catch'](handleError(_0x16a1b4,null));};exports[_0x5537('0xba')]=function(_0x1b367e,_0x1e479b,_0x69ddcf){return db[_0x5537('0x44')][_0x5537('0x6d')]({'where':{'id':_0x1b367e['params']['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x1e479b,null))[_0x5537('0x24')](function(_0x5a3df2){if(_0x5a3df2){return db[_0x5537('0xbb')][_0x5537('0xbc')](function(_0x3d73a2){return db[_0x5537('0x75')][_0x5537('0x3e')]({'where':{'SmsAccountId':_0x1b367e[_0x5537('0x5e')]['id']},'transaction':_0x3d73a2})['then'](function(_0x1d0171){var _0x5b4658=_[_0x5537('0x43')](_0x1b367e[_0x5537('0x68')],function(_0x58275b){_0x58275b[_0x5537('0x6b')]=_0x1b367e[_0x5537('0x5e')]['id'];return _0x58275b;});return db['SmsApplication']['bulkCreate'](_0x5b4658,{'transaction':_0x3d73a2});});})[_0x5537('0x24')](function(){return db[_0x5537('0x75')][_0x5537('0xbd')]({'where':{'SmsAccountId':_0x1b367e[_0x5537('0x5e')]['id']},'order':'priority'});});}})[_0x5537('0x24')](respondWithResult(_0x1e479b,null))[_0x5537('0x2d')](handleError(_0x1e479b,null));};exports[_0x5537('0xbe')]=function(_0x2c7797,_0x5d649a,_0x26f34e){var _0x832d98={};var _0x3c65c6={};var _0x2ddac9;var _0x4d11ed;return db[_0x5537('0x44')][_0x5537('0x6d')]({'where':{'id':_0x2c7797['params']['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x5d649a,null))[_0x5537('0x24')](function(_0x5424db){if(_0x5424db){_0x2ddac9=_0x5424db;_0x3c65c6['model']=_[_0x5537('0x60')](db[_0x5537('0x75')][_0x5537('0x45')]);_0x3c65c6[_0x5537('0x4a')]=_[_0x5537('0x60')](_0x2c7797[_0x5537('0x4a')]);_0x3c65c6[_0x5537('0x4b')]=_['intersection'](_0x3c65c6[_0x5537('0x48')],_0x3c65c6[_0x5537('0x4a')]);_0x832d98[_0x5537('0x4e')]=_['intersection'](_0x3c65c6['model'],qs[_0x5537('0x4d')](_0x2c7797['query'][_0x5537('0x4d')]));_0x832d98[_0x5537('0x4e')]=_0x832d98[_0x5537('0x4e')][_0x5537('0x61')]?_0x832d98[_0x5537('0x4e')]:_0x3c65c6[_0x5537('0x48')];_0x832d98[_0x5537('0x51')]=qs[_0x5537('0x52')](_0x2c7797[_0x5537('0x4a')][_0x5537('0x52')]);_0x832d98['where']=qs[_0x5537('0x4b')](_['pick'](_0x2c7797[_0x5537('0x4a')],_0x3c65c6[_0x5537('0x4b')]));if(_0x2c7797[_0x5537('0x4a')][_0x5537('0x55')]){_0x832d98[_0x5537('0x53')]=_['merge'](_0x832d98[_0x5537('0x53')],{'$or':_['map'](_0x832d98[_0x5537('0x4e')],function(_0x47cd4e){var _0x4bd0af={};_0x4bd0af[_0x47cd4e]={'$like':'%'+_0x2c7797[_0x5537('0x4a')][_0x5537('0x55')]+'%'};return _0x4bd0af;})});}_0x832d98=_[_0x5537('0x56')]({},_0x832d98,_0x2c7797['options']);return _0x2ddac9[_0x5537('0xbe')](_0x832d98);}})['then'](function(_0x322c8f){if(_0x322c8f){_0x4d11ed=_0x322c8f[_0x5537('0x61')];if(!_0x2c7797['query'][_0x5537('0x4f')](_0x5537('0x50'))){_0x832d98['limit']=qs[_0x5537('0x34')](_0x2c7797[_0x5537('0x4a')][_0x5537('0x34')]);_0x832d98['offset']=qs[_0x5537('0x32')](_0x2c7797[_0x5537('0x4a')]['offset']);}return _0x2ddac9[_0x5537('0xbe')](_0x832d98);}})[_0x5537('0x24')](function(_0x1158be){if(_0x1158be){return _0x1158be?{'count':_0x4d11ed,'rows':_0x1158be}:null;}})[_0x5537('0x24')](respondWithResult(_0x5d649a,null))[_0x5537('0x2d')](handleError(_0x5d649a,null));};exports[_0x5537('0xbf')]=function(_0x370b00,_0x36c249,_0x4be925){var _0x1edf0f={'raw':![],'where':{}};var _0x39149e={};var _0xfe199f={'count':0x0,'rows':[]};return db[_0x5537('0x44')]['findOne']({'where':{'id':_0x370b00[_0x5537('0x5e')]['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x36c249,null))['then'](function(_0x127736){if(_0x127736){_0x39149e[_0x5537('0x48')]=_[_0x5537('0x60')](db[_0x5537('0xa8')][_0x5537('0x45')]);_0x39149e[_0x5537('0x4a')]=_[_0x5537('0x60')](_0x370b00[_0x5537('0x4a')]);_0x39149e[_0x5537('0x4b')]=_[_0x5537('0x4c')](_0x39149e[_0x5537('0x48')],_0x39149e[_0x5537('0x4a')]);_0x1edf0f['attributes']=_[_0x5537('0x4c')](_0x39149e[_0x5537('0x48')],qs[_0x5537('0x4d')](_0x370b00[_0x5537('0x4a')][_0x5537('0x4d')]));_0x1edf0f[_0x5537('0x4e')]=_0x1edf0f[_0x5537('0x4e')]['length']?_0x1edf0f[_0x5537('0x4e')]:_0x39149e[_0x5537('0x48')];if(!_0x370b00[_0x5537('0x4a')][_0x5537('0x4f')](_0x5537('0x50'))){_0x1edf0f[_0x5537('0x34')]=qs[_0x5537('0x34')](_0x370b00[_0x5537('0x4a')][_0x5537('0x34')]);_0x1edf0f[_0x5537('0x32')]=qs[_0x5537('0x32')](_0x370b00['query'][_0x5537('0x32')]);}_0x1edf0f[_0x5537('0x51')]=qs[_0x5537('0x52')](_0x370b00[_0x5537('0x4a')][_0x5537('0x52')]);_0x1edf0f[_0x5537('0x53')]=qs['filters'](_['pick'](_0x370b00[_0x5537('0x4a')],_0x39149e['filters']));_0x1edf0f[_0x5537('0x53')]['SmsAccountId']=_0x127736['id'];if(_0x370b00[_0x5537('0x4a')][_0x5537('0x55')]){_0x1edf0f['where']=_[_0x5537('0x56')](_0x1edf0f[_0x5537('0x53')],{'$or':_[_0x5537('0x43')](_0x1edf0f[_0x5537('0x4e')],function(_0x4c0bec){var _0x24e890={};_0x24e890[_0x4c0bec]={'$like':'%'+_0x370b00['query'][_0x5537('0x55')]+'%'};return _0x24e890;})});}_0x1edf0f=_['merge']({},_0x1edf0f,_0x370b00[_0x5537('0x59')]);return db[_0x5537('0xa8')][_0x5537('0x35')]({'where':_0x1edf0f['where']})['then'](function(_0x4e1231){_0xfe199f[_0x5537('0x35')]=_0x4e1231;if(_0x370b00[_0x5537('0x4a')][_0x5537('0x5a')]){_0x1edf0f[_0x5537('0x5b')]=[{'model':db[_0x5537('0x7c')],'as':_0x5537('0xc0'),'required':![]},{'model':db[_0x5537('0xc1')],'as':_0x5537('0xc2'),'attributes':['name',_0x5537('0xc3'),_0x5537('0xc4')],'required':![]},{'model':db[_0x5537('0xc5')],'as':'Tags','attributes':['id',_0x5537('0x49'),_0x5537('0xc6')],'where':_0x370b00[_0x5537('0x4a')][_0x5537('0xc7')]?{'id':_0x370b00[_0x5537('0x4a')][_0x5537('0xc7')]}:undefined,'required':_0x370b00['query'][_0x5537('0xc7')]?!![]:![]}];}return db[_0x5537('0xa8')][_0x5537('0x6e')](_0x1edf0f);})[_0x5537('0x24')](function(_0x4bb619){_0xfe199f[_0x5537('0x5c')]=_0x4bb619;return _0xfe199f;});}})['then'](respondWithFilteredResult(_0x36c249,_0x1edf0f))['catch'](handleError(_0x36c249,null));};exports[_0x5537('0x40')]=function(_0x2ba407,_0x234046,_0x42d2c0){var _0x1b2838,_0x4335de,_0x1c4aaf;if(_['isNil'](_0x2ba407[_0x5537('0x68')][_0x5537('0x68')])||_0x2ba407[_0x5537('0x68')][_0x5537('0x68')]===''){throw new db['Sequelize'][(_0x5537('0x7e'))](_0x5537('0x9e'));}if(_['isNil'](_0x2ba407[_0x5537('0x68')]['to'])){throw new db[(_0x5537('0x7d'))]['ValidationError']('to\x20is\x20mandatory');}_0x1b2838=_0x2ba407['body']['to'];return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x2ba407[_0x5537('0x5e')]['id']},'include':[{'model':db[_0x5537('0xa3')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x1b2838},'limit':0x1,'order':[[_0x5537('0x82'),_0x5537('0xc8')]]}]}]})[_0x5537('0x24')](handleEntityNotFound(_0x234046,null))[_0x5537('0x24')](function(_0x1931ef){if(_0x1931ef&&_0x1931ef[_0x5537('0xc9')]){_0x4335de=_0x1931ef['get']({'plain':!![]});if(_0x4335de[_0x5537('0xc9')]&&_0x4335de[_0x5537('0xc9')][_0x5537('0xa6')][_0x5537('0x61')]){return _0x4335de[_0x5537('0xc9')][_0x5537('0xa6')][0x0];}return db[_0x5537('0x7c')][_0x5537('0x63')](_['defaults'](_0x2ba407[_0x5537('0x68')],{'firstName':_0x1b2838,'mobile':_0x1b2838,'phone':_0x1b2838,'ListId':_0x4335de[_0x5537('0x84')]}));}})[_0x5537('0x24')](handleEntityNotFound(_0x234046,null))['then'](function(_0x2f854c){if(_0x2f854c){_0x1c4aaf=_0x2f854c;return db[_0x5537('0xa8')][_0x5537('0x62')]({'where':{'ContactId':_0x1c4aaf['id'],'closed':![],'SmsAccountId':_0x4335de['id']}})[_0x5537('0x24')](function(_0x5ace72){if(_0x5ace72){return[_0x5ace72,![]];}return db[_0x5537('0xa8')][_0x5537('0x63')]({'UserId':_0x2ba407['user']['id'],'ContactId':_0x1c4aaf['id'],'SmsAccountId':_0x4335de['id'],'phone':_0x1b2838,'firstMsgDirection':'out','Messages':[_[_0x5537('0x56')](_0x2ba407[_0x5537('0x68')],{'read':![],'body':_0x2ba407[_0x5537('0x68')][_0x5537('0x68')],'phone':_0x1b2838,'SmsAccountId':_0x4335de['id'],'UserId':_0x2ba407['user']['id'],'ContactId':_0x1c4aaf['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x5537('0xca')}]})[_0x5537('0x24')](function(_0x445210){return[_0x445210,!![]];});});}})[_0x5537('0xa9')](function(_0x55c69c,_0x18061e){if(_0x18061e){return _0x55c69c;}return db[_0x5537('0xb0')]['create'](_[_0x5537('0x56')](_0x2ba407[_0x5537('0x68')],{'read':![],'body':_0x2ba407[_0x5537('0x68')]['body'],'phone':_0x1b2838,'SmsAccountId':_0x4335de['id'],'SmsInteractionId':_0x55c69c['id'],'UserId':_0x2ba407[_0x5537('0xcb')]['id'],'ContactId':_0x1c4aaf['id']}))['then'](function(_0x5c2131){_0x55c69c[_0x5537('0xcc')][_0x5537('0xca')]=[];_0x55c69c[_0x5537('0xcc')][_0x5537('0xca')][_0x5537('0xad')](_0x5c2131[_0x5537('0xcc')]);return _0x55c69c;});})[_0x5537('0x24')](respondWithResult(_0x234046,null))[_0x5537('0x2d')](handleError(_0x234046,null));};exports['status']=function(_0x1579a4,_0x3ba9ab,_0x742aa3){if(_0x1579a4[_0x5537('0x68')]['id']){delete _0x1579a4[_0x5537('0x68')]['id'];}var _0x499337,_0x129b84,_0x32d193;return db[_0x5537('0x44')]['find']({'where':{'id':_0x1579a4[_0x5537('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3ba9ab,null))[_0x5537('0x24')](function(_0x27c262){if(_0x27c262){_0x32d193=_0x27c262;logger[_0x5537('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5537('0xcd'),_0x27c262[_0x5537('0x57')],util[_0x5537('0xce')](_0x1579a4[_0x5537('0x68')],{'showHidden':![],'depth':null}));switch(_0x27c262[_0x5537('0x57')]){case _0x5537('0xcf'):if(_0x1579a4['body']['skebby_dispatch_id']&&_0x1579a4['body']['status']){_0x129b84=_0x1579a4[_0x5537('0x68')][_0x5537('0x2f')];return db[_0x5537('0xb0')]['find']({'where':{'messageId':_0x1579a4[_0x5537('0x68')][_0x5537('0xd0')]}});}break;case'connectel':if(_0x1579a4[_0x5537('0x68')][_0x5537('0xd1')]&&_0x1579a4[_0x5537('0x68')][_0x5537('0xd2')]){_0x129b84=_0x1579a4[_0x5537('0x68')][_0x5537('0xd2')];return db[_0x5537('0xb0')][_0x5537('0x62')]({'where':{'messageId':_0x1579a4[_0x5537('0x68')][_0x5537('0xd1')]}});}break;case _0x5537('0x8d'):if(_0x1579a4['body'][_0x5537('0x8e')]&&_0x1579a4[_0x5537('0x68')][_0x5537('0xd3')]){_0x129b84=_0x1579a4[_0x5537('0x68')][_0x5537('0xd3')];return db['SmsMessage'][_0x5537('0x62')]({'where':{'messageId':_0x1579a4[_0x5537('0x68')][_0x5537('0x8e')]}});}break;case _0x5537('0x93'):var _0x520163=_0x1579a4['body'][_0x5537('0x94')][0x0];if(_0x520163[_0x5537('0x91')]&&_0x520163[_0x5537('0x2f')][_0x5537('0xd4')]==='DELIVERED'){_0x129b84=_0x520163[_0x5537('0x2f')][_0x5537('0xd4')];return db[_0x5537('0xb0')][_0x5537('0x62')]({'where':{'messageId':_0x520163[_0x5537('0x91')]}});}break;case _0x5537('0xd5'):if(_0x1579a4[_0x5537('0x68')][_0x5537('0x91')]&&_0x1579a4['body'][_0x5537('0x2f')]){_0x129b84=_0x1579a4[_0x5537('0x68')][_0x5537('0x2f')];return db['SmsMessage'][_0x5537('0x62')]({'where':{'messageId':_0x1579a4['body'][_0x5537('0x91')]}});}break;case _0x5537('0x9a'):if(_0x1579a4[_0x5537('0x68')][0x0][_0x5537('0x2c')]['id']){_0x129b84=_0x1579a4[_0x5537('0x68')][0x0][_0x5537('0x57')];return db['SmsMessage']['find']({'where':{'messageId':_0x1579a4[_0x5537('0x68')][0x0][_0x5537('0x2c')]['id']}});}break;case _0x5537('0x9b'):if(_0x1579a4[_0x5537('0x68')][_0x5537('0xd6')]&&_0x1579a4[_0x5537('0x68')][_0x5537('0x2f')]){_0x129b84=_0x1579a4[_0x5537('0x68')][_0x5537('0x2f')];return db[_0x5537('0xb0')][_0x5537('0x62')]({'where':{'messageId':_0x1579a4[_0x5537('0x68')]['redif']}});}break;}}})[_0x5537('0x24')](handleEntityNotFound(_0x3ba9ab,null))[_0x5537('0x24')](function(_0x1113c9){if(_0x1113c9){_0x499337=_0x1113c9;switch(_0x32d193[_0x5537('0x57')]){case'skebby':if(_0x129b84===_0x5537('0xd7')){return _0x499337['update']({'read':!![]});}else{logger[_0x5537('0x29')](_0x5537('0x28'),_0x5537('0x2f'),_0x5537('0xcf'),util['inspect'](_0x1579a4[_0x5537('0x68')],{'showHidden':![],'depth':null}));}break;case _0x5537('0x8c'):if(_0x129b84==='1'){return _0x499337['update']({'read':!![]});}else{logger['error'](_0x5537('0x28'),_0x5537('0x2f'),_0x5537('0xcf'),util[_0x5537('0xce')](_0x1579a4['body'],{'showHidden':![],'depth':null}));}break;case _0x5537('0x8d'):if(!_0x1579a4[_0x5537('0x68')]['error_code']&&_0x129b84>=0xc8&&_0x129b84<=0xce){return _0x499337[_0x5537('0x3b')]({'read':!![]});}else{logger[_0x5537('0x29')](_0x5537('0x28'),'status',_0x5537('0x8d'),util[_0x5537('0xce')](_0x1579a4[_0x5537('0x68')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4f3168=_0x1579a4[_0x5537('0x68')][_0x5537('0x94')][0x0];if(_0x4f3168[_0x5537('0x2f')][_0x5537('0xd4')]===_0x5537('0xd7')){return _0x499337['update']({'read':!![]});}else{logger[_0x5537('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5537('0x2f'),_0x5537('0x93'),util[_0x5537('0xce')](_0x1579a4[_0x5537('0x68')],{'showHidden':![],'depth':null}));}break;case _0x5537('0xd5'):if(_0x129b84=='DELIVERED_TO_GATEWAY'||_0x129b84=='RECEIVED_BY_RECIPIENT'){return _0x499337['update']({'read':!![]});}else{logger[_0x5537('0x29')](_0x5537('0x28'),_0x5537('0x2f'),_0x5537('0xd5'),util[_0x5537('0xce')](_0x1579a4[_0x5537('0x68')],{'showHidden':![],'depth':null}));}break;case _0x5537('0x9a'):if(_0x129b84==_0x5537('0xd8')){return _0x499337['update']({'read':!![]});}else{logger[_0x5537('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x5537('0x9a'),util[_0x5537('0xce')](_0x1579a4[_0x5537('0x68')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x129b84===_0x5537('0xd9')||_0x129b84===_0x5537('0xda')){return _0x499337[_0x5537('0x3b')]({'read':!![]});}else{logger[_0x5537('0x29')](_0x5537('0x28'),_0x5537('0x2f'),_0x5537('0x9b'),util[_0x5537('0xce')](_0x1579a4[_0x5537('0x68')],{'showHidden':![],'depth':null}));}break;}return _0x499337;}})[_0x5537('0x24')](respondWithResult(_0x3ba9ab,null))[_0x5537('0x2d')](handleError(_0x3ba9ab,null));};exports[_0x5537('0xdb')]=function(_0x20e90f,_0x3b0081,_0x5abec2){var _0x59f97e,_0x377fd0,_0x2723d9;return db['SmsAccount']['find']({'where':{'id':_0x20e90f[_0x5537('0x5e')]['id']}})['then'](handleEntityNotFound(_0x3b0081,null))[_0x5537('0x24')](function(_0x499953){if(_0x499953){_0x2723d9=_0x499953;logger[_0x5537('0x27')](_0x5537('0x28'),_0x5537('0x2f'),'received\x20delivery\x20report\x20from',_0x499953[_0x5537('0x57')],util[_0x5537('0xce')](_0x20e90f['query'],{'showHidden':![],'depth':null}));switch(_0x499953['type']){case'csc':if(_0x20e90f[_0x5537('0x4a')]['message-id']&&_0x20e90f['query'][_0x5537('0xdc')]){_0x377fd0=_0x20e90f[_0x5537('0x4a')][_0x5537('0xdc')];return db['SmsMessage'][_0x5537('0x62')]({'where':{'messageId':_0x20e90f[_0x5537('0x4a')][_0x5537('0xdd')]}});}break;}}})['then'](handleEntityNotFound(_0x3b0081,null))[_0x5537('0x24')](function(_0x46134b){if(_0x46134b){_0x59f97e=_0x46134b;switch(_0x2723d9[_0x5537('0x57')]){case _0x5537('0x95'):if(_0x377fd0==='2'||_0x377fd0==='6'){return _0x59f97e[_0x5537('0x3b')]({'read':!![]});}else{logger[_0x5537('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5537('0x2f'),'csc',util[_0x5537('0xce')](_0x20e90f['query'],{'showHidden':![],'depth':null}));};break;}return _0x59f97e;}})[_0x5537('0x24')](respondWithResult(_0x3b0081,null))['catch'](handleError(_0x3b0081,null));};exports['addAgents']=function(_0x2bd31d,_0x562b7c,_0x5cc440){return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x2bd31d[_0x5537('0x5e')]['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x562b7c,null))['then'](function(_0x70f4da){if(_0x70f4da){return _0x70f4da[_0x5537('0xde')](_0x2bd31d['body'][_0x5537('0x70')],_[_0x5537('0xa5')](_0x2bd31d[_0x5537('0x68')],[_0x5537('0x70'),'id'])||{})[_0x5537('0xa9')](function(_0x11af02){for(var _0x120c3c=0x0;_0x120c3c<_0x2bd31d['body'][_0x5537('0x70')][_0x5537('0x61')];_0x120c3c+=0x1){socket[_0x5537('0xdf')](_0x5537('0xe0'),{'UserId':Number(_0x2bd31d[_0x5537('0x68')][_0x5537('0x70')][_0x120c3c]),'SmsAccountId':Number(_0x2bd31d[_0x5537('0x5e')]['id'])});}return _0x11af02;});}})[_0x5537('0x24')](respondWithResult(_0x562b7c,null))[_0x5537('0x2d')](handleError(_0x562b7c,null));};exports[_0x5537('0xe1')]=function(_0x5f2e82,_0x4daabb,_0x526324){return db[_0x5537('0x44')][_0x5537('0x62')]({'where':{'id':_0x5f2e82[_0x5537('0x5e')]['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x4daabb,null))[_0x5537('0x24')](function(_0x18f01f){if(_0x18f01f){return _0x18f01f['removeAgents'](_0x5f2e82[_0x5537('0x4a')]['ids'])[_0x5537('0x24')](function(){if(_['isArray'](_0x5f2e82['query'][_0x5537('0x70')])){for(var _0x288070=0x0;_0x288070<_0x5f2e82[_0x5537('0x4a')]['ids'][_0x5537('0x61')];_0x288070+=0x1){socket[_0x5537('0xdf')](_0x5537('0xe2'),{'UserId':Number(_0x5f2e82['query'][_0x5537('0x70')][_0x288070]),'SmsAccountId':Number(_0x5f2e82['params']['id'])});}}else{socket[_0x5537('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x5f2e82['query']['ids']),'SmsAccountId':Number(_0x5f2e82[_0x5537('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x4daabb,null))[_0x5537('0x2d')](handleError(_0x4daabb,null));};exports['getAgents']=function(_0x5590d1,_0x5ddc9c,_0x5cbf0e){var _0x4c353e={};var _0x40709c={};var _0x3f9e33;var _0x556225;return db[_0x5537('0x44')][_0x5537('0x6d')]({'where':{'id':_0x5590d1[_0x5537('0x5e')]['id']}})[_0x5537('0x24')](handleEntityNotFound(_0x5ddc9c,null))[_0x5537('0x24')](function(_0x15b526){if(_0x15b526){_0x3f9e33=_0x15b526;_0x40709c['model']=_[_0x5537('0x60')](db[_0x5537('0xc1')][_0x5537('0x45')]);_0x40709c[_0x5537('0x4a')]=_[_0x5537('0x60')](_0x5590d1[_0x5537('0x4a')]);_0x40709c[_0x5537('0x4b')]=_['intersection'](_0x40709c[_0x5537('0x48')],_0x40709c[_0x5537('0x4a')]);_0x4c353e[_0x5537('0x4e')]=_[_0x5537('0x4c')](_0x40709c[_0x5537('0x48')],qs[_0x5537('0x4d')](_0x5590d1[_0x5537('0x4a')][_0x5537('0x4d')]));_0x4c353e[_0x5537('0x4e')]=_0x4c353e[_0x5537('0x4e')][_0x5537('0x61')]?_0x4c353e[_0x5537('0x4e')]:_0x40709c[_0x5537('0x48')];_0x4c353e[_0x5537('0x51')]=qs[_0x5537('0x52')](_0x5590d1[_0x5537('0x4a')][_0x5537('0x52')]);_0x4c353e['where']=qs[_0x5537('0x4b')](_['pick'](_0x5590d1['query'],_0x40709c[_0x5537('0x4b')]));if(_0x5590d1['query'][_0x5537('0x55')]){_0x4c353e[_0x5537('0x53')]=_['merge'](_0x4c353e[_0x5537('0x53')],{'$or':_[_0x5537('0x43')](_0x4c353e[_0x5537('0x4e')],function(_0x3ad284){var _0x12c673={};_0x12c673[_0x3ad284]={'$like':'%'+_0x5590d1[_0x5537('0x4a')]['filter']+'%'};return _0x12c673;})});}_0x4c353e=_[_0x5537('0x56')]({},_0x4c353e,_0x5590d1['options']);return _0x3f9e33[_0x5537('0xe3')](_0x4c353e);}})[_0x5537('0x24')](function(_0x470621){if(_0x470621){_0x556225=_0x470621[_0x5537('0x61')];if(!_0x5590d1[_0x5537('0x4a')][_0x5537('0x4f')](_0x5537('0x50'))){_0x4c353e[_0x5537('0x34')]=qs[_0x5537('0x34')](_0x5590d1[_0x5537('0x4a')]['limit']);_0x4c353e[_0x5537('0x32')]=qs['offset'](_0x5590d1[_0x5537('0x4a')][_0x5537('0x32')]);}return _0x3f9e33[_0x5537('0xe3')](_0x4c353e);}})[_0x5537('0x24')](function(_0xd335bb){if(_0xd335bb){return _0xd335bb?{'count':_0x556225,'rows':_0xd335bb}:null;}})[_0x5537('0x24')](respondWithResult(_0x5ddc9c,null))[_0x5537('0x2d')](handleError(_0x5ddc9c,null));}; \ No newline at end of file +var _0x024e=['body','describe','params','Disposition','removeDispositions','addAnswer','SmsAccountId','CannedAnswer','getAnswers','findOne','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','ListId','mobile','twilio','from','Body','text','connectel','clicksend','messageId','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','omit','SmsInteraction','interaction','created','push','close','unmanaged','*,*,*,*','SmsMessage','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','transaction','bulkCreate','getApplications','getInteractions','Contact','User','Owner','fullname','internal','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','message_id','status_code','groupName','DELIVERED','bandwidth','redif','skebby','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','ids','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsAccounts','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x467e9e,_0x4a6888){var _0x10376a=function(_0x5f3437){while(--_0x5f3437){_0x467e9e['push'](_0x467e9e['shift']());}};_0x10376a(++_0x4a6888);}(_0x024e,0x155));var _0xe024=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x024e[_0x500419];return _0x241c1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe024('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe024('0x1'));var rp=require(_0xe024('0x2'));var moment=require(_0xe024('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe024('0x4'));var util=require(_0xe024('0x5'));var path=require('path');var sox=require(_0xe024('0x6'));var csv=require(_0xe024('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe024('0x8'));var _=require(_0xe024('0x9'));var squel=require(_0xe024('0xa'));var crypto=require('crypto');var jsforce=require(_0xe024('0xb'));var deskjs=require(_0xe024('0xc'));var toCsv=require(_0xe024('0x7'));var querystring=require(_0xe024('0xd'));var Papa=require(_0xe024('0xe'));var Redis=require('ioredis');var authService=require(_0xe024('0xf'));var qs=require(_0xe024('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe024('0x11'));var logger=require(_0xe024('0x12'))(_0xe024('0x13'));var utils=require(_0xe024('0x14'));var config=require(_0xe024('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe024('0x16'))['db'];config[_0xe024('0x17')]=_[_0xe024('0x18')](config[_0xe024('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe024('0x19'))(new Redis(config[_0xe024('0x17')]));require(_0xe024('0x1a'))[_0xe024('0x1b')](socket);var jayson=require(_0xe024('0x1c'));var client=jayson[_0xe024('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd542,_0x11c720,_0x1d0c89,_0x5b44b4){return new BPromise(function(_0x408800,_0x468510){var _0x32db2c=_0x5b44b4||client;return _0x32db2c[_0xe024('0x1e')](_0x4cd542,_0x1d0c89)[_0xe024('0x1f')](function(_0x2556d5){logger[_0xe024('0x20')](_0xe024('0x21'),_0x11c720,'request\x20sent');logger[_0xe024('0x22')](_0xe024('0x23'),_0x11c720,_0xe024('0x24'),JSON[_0xe024('0x25')](_0x2556d5));if(_0x2556d5['error']){if(_0x2556d5[_0xe024('0x26')]['code']===0x1f4){logger[_0xe024('0x26')](_0xe024('0x21'),_0x11c720,_0x2556d5[_0xe024('0x26')][_0xe024('0x27')]);return _0x468510(_0x2556d5[_0xe024('0x26')]['message']);}logger[_0xe024('0x26')](_0xe024('0x21'),_0x11c720,_0x2556d5[_0xe024('0x26')]['message']);return _0x408800(_0x2556d5[_0xe024('0x26')][_0xe024('0x27')]);}else{logger[_0xe024('0x20')](_0xe024('0x21'),_0x11c720,_0xe024('0x24'));_0x408800(_0x2556d5[_0xe024('0x28')][_0xe024('0x27')]);}})[_0xe024('0x29')](function(_0x478a25){logger[_0xe024('0x26')](_0xe024('0x21'),_0x11c720,_0x478a25);_0x468510(_0x478a25);});});}function respondWithStatusCode(_0x321fc1,_0x1226d2){_0x1226d2=_0x1226d2||0xcc;return function(_0x8b4b82){if(_0x8b4b82){return _0x321fc1[_0xe024('0x2a')](_0x1226d2);}return _0x321fc1['status'](_0x1226d2)[_0xe024('0x2b')]();};}function respondWithResult(_0x478037,_0x180821){_0x180821=_0x180821||0xc8;return function(_0x4290cb){if(_0x4290cb){return _0x478037[_0xe024('0x2c')](_0x180821)[_0xe024('0x2d')](_0x4290cb);}};}function respondWithFilteredResult(_0x5796fb,_0x44a13d){return function(_0x5a8308){if(_0x5a8308){var _0x4ba1b2=typeof _0x44a13d['offset']===_0xe024('0x2e')&&typeof _0x44a13d[_0xe024('0x2f')]===_0xe024('0x2e');var _0x4cbedb=_0x5a8308['count'];var _0x54aca6=_0x4ba1b2?0x0:_0x44a13d[_0xe024('0x30')];var _0x2cb759=_0x4ba1b2?_0x5a8308[_0xe024('0x31')]:_0x44a13d[_0xe024('0x30')]+_0x44a13d['limit'];var _0xe4c96b;if(_0x2cb759>=_0x4cbedb){_0x2cb759=_0x4cbedb;_0xe4c96b=0xc8;}else{_0xe4c96b=0xce;}_0x5796fb[_0xe024('0x2c')](_0xe4c96b);return _0x5796fb['set'](_0xe024('0x32'),_0x54aca6+'-'+_0x2cb759+'/'+_0x4cbedb)[_0xe024('0x2d')](_0x5a8308);}return null;};}function patchUpdates(_0x118859){return function(_0x46ad9c){try{jsonpatch[_0xe024('0x33')](_0x46ad9c,_0x118859,!![]);}catch(_0x47366c){return BPromise['reject'](_0x47366c);}return _0x46ad9c['save']();};}function saveUpdates(_0x1e1132,_0x2bc0c9){return function(_0x3c1dd2){if(_0x3c1dd2){return _0x3c1dd2[_0xe024('0x34')](_0x1e1132)[_0xe024('0x1f')](function(_0x570bd4){return _0x570bd4;});}return null;};}function removeEntity(_0x2d33bf,_0x3c6be0){return function(_0x507258){if(_0x507258){return _0x507258[_0xe024('0x35')]()[_0xe024('0x1f')](function(){var _0x47af56=_0x507258[_0xe024('0x36')]({'plain':!![]});var _0x557fea='SmsAccounts';return db[_0xe024('0x37')][_0xe024('0x35')]({'where':{'type':_0x557fea,'resourceId':_0x47af56['id']}})[_0xe024('0x1f')](function(){return _0x507258;});})[_0xe024('0x1f')](function(){_0x2d33bf[_0xe024('0x2c')](0xcc)[_0xe024('0x2b')]();});}};}function handleEntityNotFound(_0x4874c5,_0x26a0fd){return function(_0x4a082a){if(!_0x4a082a){_0x4874c5[_0xe024('0x2a')](0x194);}return _0x4a082a;};}function handleError(_0xcd5ee2,_0x206da9){_0x206da9=_0x206da9||0x1f4;return function(_0x12b9f9){logger[_0xe024('0x26')](_0x12b9f9[_0xe024('0x38')]);if(_0x12b9f9[_0xe024('0x39')]){delete _0x12b9f9[_0xe024('0x39')];}_0xcd5ee2[_0xe024('0x2c')](_0x206da9)[_0xe024('0x3a')](_0x12b9f9);};}exports[_0xe024('0x3b')]=function(_0x19f235,_0x505363){var _0x2a6d12={'include':[{'model':db[_0xe024('0x3c')],'as':_0xe024('0x3d')}]},_0x1f6a33={},_0x438403={'count':0x0,'rows':[]};var _0x423d90=_[_0xe024('0x3e')](db[_0xe024('0x3f')]['rawAttributes'],function(_0x41414f){return{'name':_0x41414f[_0xe024('0x40')],'type':_0x41414f['type'][_0xe024('0x41')]};});_0x1f6a33[_0xe024('0x42')]=_['map'](_0x423d90,_0xe024('0x39'));_0x1f6a33[_0xe024('0x43')]=_[_0xe024('0x44')](_0x19f235[_0xe024('0x43')]);_0x1f6a33[_0xe024('0x45')]=_[_0xe024('0x46')](_0x1f6a33[_0xe024('0x42')],_0x1f6a33['query']);_0x2a6d12[_0xe024('0x47')]=_['intersection'](_0x1f6a33['model'],qs[_0xe024('0x48')](_0x19f235['query'][_0xe024('0x48')]));_0x2a6d12[_0xe024('0x47')]=_0x2a6d12[_0xe024('0x47')][_0xe024('0x49')]?_0x2a6d12[_0xe024('0x47')]:_0x1f6a33[_0xe024('0x42')];if(!_0x19f235[_0xe024('0x43')][_0xe024('0x4a')](_0xe024('0x4b'))){_0x2a6d12[_0xe024('0x2f')]=qs['limit'](_0x19f235['query'][_0xe024('0x2f')]);_0x2a6d12[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x19f235['query'][_0xe024('0x30')]);}_0x2a6d12[_0xe024('0x4c')]=qs[_0xe024('0x4d')](_0x19f235[_0xe024('0x43')][_0xe024('0x4d')]);_0x2a6d12['where']=qs[_0xe024('0x45')](_[_0xe024('0x4e')](_0x19f235[_0xe024('0x43')],_0x1f6a33[_0xe024('0x45')]),_0x423d90);if(_0x19f235[_0xe024('0x43')][_0xe024('0x4f')]){_0x2a6d12[_0xe024('0x50')]=_[_0xe024('0x51')](_0x2a6d12[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x423d90,function(_0x1e7ac1){if(_0x1e7ac1[_0xe024('0x52')]!==_0xe024('0x53')){var _0x55ac8f={};_0x55ac8f[_0x1e7ac1[_0xe024('0x39')]]={'$like':'%'+_0x19f235[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x55ac8f;}})});}_0x2a6d12=_[_0xe024('0x51')]({},_0x2a6d12,_0x19f235[_0xe024('0x54')]);var _0x397784={'where':_0x2a6d12[_0xe024('0x50')]};return db[_0xe024('0x3f')]['count'](_0x397784)[_0xe024('0x1f')](function(_0x1b246f){_0x438403[_0xe024('0x31')]=_0x1b246f;if(_0x19f235[_0xe024('0x43')][_0xe024('0x55')]){_0x2a6d12[_0xe024('0x56')]=[{'all':!![]}];}return db[_0xe024('0x3f')][_0xe024('0x57')](_0x2a6d12);})[_0xe024('0x1f')](function(_0x5519fd){_0x438403[_0xe024('0x58')]=_0x5519fd;return _0x438403;})[_0xe024('0x1f')](respondWithFilteredResult(_0x505363,_0x2a6d12))[_0xe024('0x29')](handleError(_0x505363,null));};exports[_0xe024('0x59')]=function(_0x25f0c2,_0x139f77){var _0x8e7b3b={'raw':![],'where':{'id':_0x25f0c2['params']['id']},'include':[{'model':db[_0xe024('0x3c')],'as':_0xe024('0x3d')}]},_0x4cb4b8={};_0x4cb4b8[_0xe024('0x42')]=_[_0xe024('0x44')](db['SmsAccount'][_0xe024('0x5a')]);_0x4cb4b8['query']=_['keys'](_0x25f0c2[_0xe024('0x43')]);_0x4cb4b8['filters']=_['intersection'](_0x4cb4b8[_0xe024('0x42')],_0x4cb4b8[_0xe024('0x43')]);_0x8e7b3b['attributes']=_['intersection'](_0x4cb4b8[_0xe024('0x42')],qs[_0xe024('0x48')](_0x25f0c2[_0xe024('0x43')][_0xe024('0x48')]));_0x8e7b3b[_0xe024('0x47')]=_0x8e7b3b[_0xe024('0x47')][_0xe024('0x49')]?_0x8e7b3b[_0xe024('0x47')]:_0x4cb4b8[_0xe024('0x42')];if(_0x25f0c2[_0xe024('0x43')][_0xe024('0x55')]){_0x8e7b3b['include']=[{'all':!![]}];}_0x8e7b3b=_[_0xe024('0x51')]({},_0x8e7b3b,_0x25f0c2[_0xe024('0x54')]);return db[_0xe024('0x3f')]['find'](_0x8e7b3b)['then'](handleEntityNotFound(_0x139f77,null))[_0xe024('0x1f')](respondWithResult(_0x139f77,null))[_0xe024('0x29')](handleError(_0x139f77,null));};exports[_0xe024('0x5b')]=function(_0x3d2b65,_0x178ef6){return db['SmsAccount'][_0xe024('0x5b')](_0x3d2b65['body'],{})[_0xe024('0x1f')](function(_0x41b536){var _0x5bd0af=_0x3d2b65['user'][_0xe024('0x36')]({'plain':!![]});if(!_0x5bd0af)throw new Error(_0xe024('0x5c'));if(_0x5bd0af[_0xe024('0x5d')]===_0xe024('0x5e')){var _0x388179=_0x41b536[_0xe024('0x36')]({'plain':!![]});var _0x4754ff=_0xe024('0x5f');return db[_0xe024('0x60')][_0xe024('0x61')]({'where':{'name':_0x4754ff,'userProfileId':_0x5bd0af[_0xe024('0x62')]},'raw':!![]})[_0xe024('0x1f')](function(_0x4a82d9){if(_0x4a82d9&&_0x4a82d9[_0xe024('0x63')]===0x0){return db['UserProfileResource']['create']({'name':_0x388179[_0xe024('0x39')],'resourceId':_0x388179['id'],'type':_0x4a82d9[_0xe024('0x39')],'sectionId':_0x4a82d9['id']},{})[_0xe024('0x1f')](function(){return _0x41b536;});}else{return _0x41b536;}})['catch'](function(_0x507606){logger['error'](_0xe024('0x64'),_0x507606);throw _0x507606;});}return _0x41b536;})['then'](respondWithResult(_0x178ef6,0xc9))[_0xe024('0x29')](handleError(_0x178ef6,null));};exports[_0xe024('0x34')]=function(_0x31de80,_0x506054){if(_0x31de80[_0xe024('0x65')]['id']){delete _0x31de80['body']['id'];}return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x31de80['params']['id']},'include':[{'model':db[_0xe024('0x3c')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x506054,null))[_0xe024('0x1f')](saveUpdates(_0x31de80[_0xe024('0x65')],null))[_0xe024('0x1f')](respondWithResult(_0x506054,null))[_0xe024('0x29')](handleError(_0x506054,null));};exports[_0xe024('0x35')]=function(_0x538d6a,_0xe0dae1){return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x538d6a['params']['id']}})['then'](handleEntityNotFound(_0xe0dae1,null))[_0xe024('0x1f')](removeEntity(_0xe0dae1,null))[_0xe024('0x29')](handleError(_0xe0dae1,null));};exports[_0xe024('0x66')]=function(_0x360aa5,_0xaa67fa){return db[_0xe024('0x3f')][_0xe024('0x66')]()[_0xe024('0x1f')](respondWithResult(_0xaa67fa,null))[_0xe024('0x29')](handleError(_0xaa67fa,null));};exports['addDisposition']=function(_0x5ddf2c,_0x1831f1,_0x471c40){if(_0x5ddf2c[_0xe024('0x65')]['id']){delete _0x5ddf2c[_0xe024('0x65')]['id'];}return db[_0xe024('0x3f')]['find']({'where':{'id':_0x5ddf2c[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x1831f1,null))[_0xe024('0x1f')](function(_0x496fd2){if(_0x496fd2){_0x5ddf2c[_0xe024('0x65')]['SmsAccountId']=_0x496fd2['id'];return db[_0xe024('0x68')][_0xe024('0x5b')](_0x5ddf2c['body']);}})[_0xe024('0x1f')](respondWithResult(_0x1831f1,null))[_0xe024('0x29')](handleError(_0x1831f1,null));};exports['getDispositions']=function(_0xa13971,_0x315ff,_0xefe21e){var _0x4ec884={'raw':![],'where':{}};var _0x42d050={};var _0x5b6afa={'count':0x0,'rows':[]};return db[_0xe024('0x3f')]['findOne']({'where':{'id':_0xa13971[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x315ff,null))[_0xe024('0x1f')](function(_0x3e8c46){if(_0x3e8c46){_0x42d050['model']=_[_0xe024('0x44')](db[_0xe024('0x68')][_0xe024('0x5a')]);_0x42d050[_0xe024('0x43')]=_[_0xe024('0x44')](_0xa13971['query']);_0x42d050[_0xe024('0x45')]=_[_0xe024('0x46')](_0x42d050[_0xe024('0x42')],_0x42d050['query']);_0x4ec884['attributes']=_['intersection'](_0x42d050[_0xe024('0x42')],qs[_0xe024('0x48')](_0xa13971[_0xe024('0x43')][_0xe024('0x48')]));_0x4ec884['attributes']=_0x4ec884[_0xe024('0x47')]['length']?_0x4ec884['attributes']:_0x42d050[_0xe024('0x42')];if(!_0xa13971[_0xe024('0x43')][_0xe024('0x4a')]('nolimit')){_0x4ec884[_0xe024('0x2f')]=qs[_0xe024('0x2f')](_0xa13971[_0xe024('0x43')][_0xe024('0x2f')]);_0x4ec884[_0xe024('0x30')]=qs[_0xe024('0x30')](_0xa13971[_0xe024('0x43')][_0xe024('0x30')]);}_0x4ec884[_0xe024('0x4c')]=qs['sort'](_0xa13971['query'][_0xe024('0x4d')]);_0x4ec884['where']=qs[_0xe024('0x45')](_['pick'](_0xa13971[_0xe024('0x43')],_0x42d050[_0xe024('0x45')]));_0x4ec884['where']['SmsAccountId']=_0x3e8c46['id'];if(_0xa13971[_0xe024('0x43')][_0xe024('0x4f')]){_0x4ec884[_0xe024('0x50')]=_[_0xe024('0x51')](_0x4ec884[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x4ec884[_0xe024('0x47')],function(_0x42f7f8){var _0x37651e={};_0x37651e[_0x42f7f8]={'$like':'%'+_0xa13971['query'][_0xe024('0x4f')]+'%'};return _0x37651e;})});}_0x4ec884=_[_0xe024('0x51')]({},_0x4ec884,_0xa13971[_0xe024('0x54')]);return db[_0xe024('0x68')][_0xe024('0x31')]({'where':_0x4ec884[_0xe024('0x50')]})[_0xe024('0x1f')](function(_0x156178){_0x5b6afa[_0xe024('0x31')]=_0x156178;if(_0xa13971[_0xe024('0x43')][_0xe024('0x55')]){_0x4ec884[_0xe024('0x56')]=[{'all':!![]}];}return db[_0xe024('0x68')][_0xe024('0x57')](_0x4ec884);})[_0xe024('0x1f')](function(_0x2309a7){_0x5b6afa[_0xe024('0x58')]=_0x2309a7;return _0x5b6afa;});}})[_0xe024('0x1f')](respondWithFilteredResult(_0x315ff,_0x4ec884))['catch'](handleError(_0x315ff,null));};exports['removeDispositions']=function(_0x3beb3a,_0x358579,_0x137808){return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x3beb3a[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x358579,null))['then'](function(_0x559421){if(_0x559421){return _0x559421[_0xe024('0x69')](_0x3beb3a[_0xe024('0x43')]['ids']);}})[_0xe024('0x1f')](respondWithStatusCode(_0x358579,null))['catch'](handleError(_0x358579,null));};exports[_0xe024('0x6a')]=function(_0x5f0682,_0x47f34f,_0x1b1def){if(_0x5f0682[_0xe024('0x65')]['id']){delete _0x5f0682['body']['id'];}return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x5f0682[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x47f34f,null))['then'](function(_0x507173){if(_0x507173){_0x5f0682[_0xe024('0x65')][_0xe024('0x6b')]=_0x507173['id'];return db[_0xe024('0x6c')][_0xe024('0x5b')](_0x5f0682[_0xe024('0x65')]);}})[_0xe024('0x1f')](respondWithResult(_0x47f34f,null))[_0xe024('0x29')](handleError(_0x47f34f,null));};exports[_0xe024('0x6d')]=function(_0x297f37,_0x13993e,_0x3d7580){var _0x4731d2={'raw':![],'where':{}};var _0x7a7931={};var _0x2b6627={'count':0x0,'rows':[]};return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x297f37[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x13993e,null))[_0xe024('0x1f')](function(_0x1742a7){if(_0x1742a7){_0x7a7931[_0xe024('0x42')]=_[_0xe024('0x44')](db['CannedAnswer'][_0xe024('0x5a')]);_0x7a7931[_0xe024('0x43')]=_[_0xe024('0x44')](_0x297f37[_0xe024('0x43')]);_0x7a7931[_0xe024('0x45')]=_[_0xe024('0x46')](_0x7a7931['model'],_0x7a7931[_0xe024('0x43')]);_0x4731d2['attributes']=_['intersection'](_0x7a7931[_0xe024('0x42')],qs['fields'](_0x297f37[_0xe024('0x43')][_0xe024('0x48')]));_0x4731d2['attributes']=_0x4731d2['attributes'][_0xe024('0x49')]?_0x4731d2[_0xe024('0x47')]:_0x7a7931['model'];if(!_0x297f37[_0xe024('0x43')][_0xe024('0x4a')]('nolimit')){_0x4731d2[_0xe024('0x2f')]=qs['limit'](_0x297f37[_0xe024('0x43')][_0xe024('0x2f')]);_0x4731d2[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x297f37[_0xe024('0x43')][_0xe024('0x30')]);}_0x4731d2[_0xe024('0x4c')]=qs[_0xe024('0x4d')](_0x297f37[_0xe024('0x43')][_0xe024('0x4d')]);_0x4731d2[_0xe024('0x50')]=qs['filters'](_[_0xe024('0x4e')](_0x297f37[_0xe024('0x43')],_0x7a7931[_0xe024('0x45')]));_0x4731d2['where'][_0xe024('0x6b')]=_0x1742a7['id'];if(_0x297f37[_0xe024('0x43')][_0xe024('0x4f')]){_0x4731d2['where']=_[_0xe024('0x51')](_0x4731d2[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x4731d2[_0xe024('0x47')],function(_0x153efe){var _0x132f67={};_0x132f67[_0x153efe]={'$like':'%'+_0x297f37[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x132f67;})});}_0x4731d2=_['merge']({},_0x4731d2,_0x297f37[_0xe024('0x54')]);return db[_0xe024('0x6c')][_0xe024('0x31')]({'where':_0x4731d2['where']})[_0xe024('0x1f')](function(_0xce30c6){_0x2b6627[_0xe024('0x31')]=_0xce30c6;if(_0x297f37[_0xe024('0x43')][_0xe024('0x55')]){_0x4731d2[_0xe024('0x56')]=[{'all':!![]}];}return db[_0xe024('0x6c')][_0xe024('0x57')](_0x4731d2);})[_0xe024('0x1f')](function(_0x505fbd){_0x2b6627[_0xe024('0x58')]=_0x505fbd;return _0x2b6627;});}})[_0xe024('0x1f')](respondWithFilteredResult(_0x13993e,_0x4731d2))[_0xe024('0x29')](handleError(_0x13993e,null));};exports[_0xe024('0x6f')]=function(_0xb72460,_0xdad160,_0x4b472b){return db['SmsAccount']['find']({'where':{'id':_0xb72460[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0xdad160,null))[_0xe024('0x1f')](function(_0x39a869){if(_0x39a869){return _0x39a869[_0xe024('0x6f')](_0xb72460[_0xe024('0x43')]['ids']);}})['then'](respondWithStatusCode(_0xdad160,null))[_0xe024('0x29')](handleError(_0xdad160,null));};exports[_0xe024('0x70')]=function(_0x172732,_0x1332e8,_0x55367a){var _0x5a4da9={'channel':_0xe024('0x71')};var _0x494f60=[];var _0x52ddfd=[];var _0x48bb4a={};return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x172732[_0xe024('0x67')]['id']},'include':[{'model':db[_0xe024('0x72')],'as':_0xe024('0x73')}]})[_0xe024('0x1f')](handleEntityNotFound(_0x1332e8,null))['then'](function(_0x4d53bb){_0x5a4da9[_0xe024('0x74')]=_0x4d53bb;_0x5a4da9[_0xe024('0x75')]=_[_0xe024('0x76')](_0x4d53bb[_0xe024('0x73')],[_0xe024('0x77')],[_0xe024('0x78')]);if(_0x5a4da9[_0xe024('0x74')][_0xe024('0x73')]){delete _0x5a4da9['account']['Applications'];}return db[_0xe024('0x79')]['describe']();})[_0xe024('0x1f')](function(_0xa614f5){if(!_0xa614f5){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))](_0xe024('0x7c'));}_0x494f60=_['difference'](_[_0xe024('0x44')](_0xa614f5),['createdAt',_0xe024('0x7d')]);_0x52ddfd=_[_0xe024('0x7e')](_[_0xe024('0x44')](_0xa614f5),[_0xe024('0x7f'),'updatedAt','CompanyId',_0xe024('0x80')]);_0x5a4da9['body']={'mapKey':_0xe024('0x81')};if(_0x5a4da9[_0xe024('0x74')][_0xe024('0x52')]){switch(_0x5a4da9[_0xe024('0x74')][_0xe024('0x52')]){case _0xe024('0x82'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732[_0xe024('0x65')]['From'];_0x5a4da9['body']['body']=_0x172732[_0xe024('0x65')][_0xe024('0x84')];_0x5a4da9[_0xe024('0x65')]['messageId']=_0x172732[_0xe024('0x65')]['MessageSid'];break;case'skebby':_0x5a4da9['body'][_0xe024('0x83')]='+'+_0x172732[_0xe024('0x65')]['sender'];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')][_0xe024('0x85')];break;case _0xe024('0x86'):_0x5a4da9[_0xe024('0x65')]['from']=_0x172732[_0xe024('0x65')][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')]['message'];break;case _0xe024('0x87'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732['body'][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x65')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')]=_0x172732['body']['message_id'];break;case _0xe024('0x89'):_0x5a4da9['body']['from']=_0x172732[_0xe024('0x65')][_0xe024('0x8a')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x8b')];_0x5a4da9[_0xe024('0x65')]['messageId']=_0x172732[_0xe024('0x65')][_0xe024('0x8c')];break;case _0xe024('0x8d'):_0x5a4da9['body'][_0xe024('0x83')]='+'+_0x172732[_0xe024('0x65')]['results'][0x0][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x8e')][0x0][_0xe024('0x85')];_0x5a4da9[_0xe024('0x65')]['messageId']=_0x172732[_0xe024('0x65')][_0xe024('0x8e')][0x0]['messageId'];break;case _0xe024('0x8f'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732[_0xe024('0x65')][_0xe024('0x90')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')][_0xe024('0x91')][_0xe024('0x27')];break;case _0xe024('0x92'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732['body']['fromNumber'];_0x5a4da9['body'][_0xe024('0x65')]=_0x172732['body'][_0xe024('0x85')];_0x5a4da9['body'][_0xe024('0x88')]=_0x172732[_0xe024('0x65')][_0xe024('0x93')];break;case'bandwidth':_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')]=_0x172732['body'][0x0][_0xe024('0x27')]['id'];_0x5a4da9['body'][_0xe024('0x83')]=_0x172732[_0xe024('0x65')][0x0][_0xe024('0x27')][_0xe024('0x83')];_0x5a4da9['body'][_0xe024('0x65')]=_0x172732[_0xe024('0x65')][0x0][_0xe024('0x27')][_0xe024('0x85')];break;case _0xe024('0x94'):_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')]=_0x172732['body'][_0xe024('0x83')];_0x5a4da9[_0xe024('0x65')][_0xe024('0x65')]=_0x172732[_0xe024('0x65')]['message'];_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')]=_0x172732['body'][_0xe024('0x95')];break;}}if(_0x5a4da9['body']['id']){delete _0x5a4da9[_0xe024('0x65')]['id'];}if(_[_0xe024('0x96')](_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')])){throw new db[(_0xe024('0x7a'))]['ValidationError'](_0xe024('0x97'));}if(_[_0xe024('0x96')](_0x5a4da9['body'][_0xe024('0x65')])||_0x5a4da9['body'][_0xe024('0x65')]===''){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe024('0x96')](_0x5a4da9[_0xe024('0x65')]['mapKey'])){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))](_0xe024('0x98')+_0x52ddfd);}if(!_[_0xe024('0x99')](_0x52ddfd,_0x5a4da9[_0xe024('0x65')][_0xe024('0x9a')])){throw new db['Sequelize']['ValidationError'](_0xe024('0x9b')+_0x52ddfd);}_0x48bb4a[_0x5a4da9[_0xe024('0x65')][_0xe024('0x9a')]]=_0x5a4da9['body']['from'];return db[_0xe024('0x9c')][_0xe024('0x61')]({'where':{'id':_0x5a4da9[_0xe024('0x74')][_0xe024('0x80')]},'include':[{'model':db[_0xe024('0x79')],'as':_0xe024('0x9d'),'where':_0x48bb4a,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0xe024('0x1f')](handleEntityNotFound(_0x1332e8,null))[_0xe024('0x1f')](function(_0x2b74e4){if(_0x2b74e4){_0x5a4da9['list']=_[_0xe024('0x9e')](_0x2b74e4,[_0xe024('0x9d')]);if(_0x2b74e4[_0xe024('0x9d')][_0xe024('0x49')]){return _0x2b74e4['Contacts'][0x0];}var _0x2d1afd=_[_0xe024('0x18')](_0x5a4da9[_0xe024('0x65')],{'firstName':_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')],'ListId':_0x2b74e4['id']});_0x2d1afd[_0x5a4da9[_0xe024('0x65')][_0xe024('0x9a')]]=_0x5a4da9[_0xe024('0x65')]['from'];return db[_0xe024('0x79')][_0xe024('0x5b')](_0x2d1afd,{'fields':_0x494f60,'raw':!![]});}})[_0xe024('0x1f')](handleEntityNotFound(_0x1332e8,null))['then'](function(_0x200dd2){if(_0x200dd2){_0x5a4da9['contact']=_0x200dd2;var _0x5d0883={'ContactId':_0x200dd2['id'],'phone':_0x5a4da9['body']['from'],'SmsAccountId':_0x172732[_0xe024('0x67')]['id']};var _0x191017={'ContactId':_0x200dd2['id'],'SmsAccountId':_0x172732[_0xe024('0x67')]['id'],'closed':![]};return db['SmsInteraction'][_0xe024('0x61')]({'where':_0x191017})[_0xe024('0x1f')](function(_0x1df2ec){if(_0x1df2ec){return[_0x1df2ec,![]];}return db[_0xe024('0x9f')][_0xe024('0x5b')](_0x5d0883)[_0xe024('0x1f')](function(_0xdb39c3){return[_0xdb39c3,!![]];});});}})['spread'](function(_0x2d1f80,_0x5022f0){_0x5a4da9[_0xe024('0xa0')]=_0x2d1f80['get']({'plain':!![]});_0x5a4da9[_0xe024('0xa0')][_0xe024('0xa1')]=![];if(_0x5022f0){if(_0x5a4da9[_0xe024('0x74')]['autoclose']){_0x5a4da9[_0xe024('0x75')][_0xe024('0xa2')]({'id':0x0,'priority':_0x5a4da9[_0xe024('0x75')][_0xe024('0x49')]+0x1,'app':_0xe024('0xa3'),'appdata':_0xe024('0xa4'),'interval':_0xe024('0xa5')});}_0x5a4da9['interaction'][_0xe024('0xa1')]=!![];}return db[_0xe024('0xa6')][_0xe024('0x5b')]({'phone':_0x5a4da9[_0xe024('0x65')][_0xe024('0x83')],'messageId':_0x5a4da9[_0xe024('0x65')][_0xe024('0x88')],'body':_0x5a4da9['body']['body'],'SmsAccountId':_0x172732[_0xe024('0x67')]['id'],'SmsInteractionId':_0x2d1f80['id'],'direction':'in','ContactId':_0x2d1f80['ContactId'],'AttachmentId':_0x5a4da9[_0xe024('0x65')]['AttachmentId']});})[_0xe024('0x1f')](function(_0x312ccf){_0x5a4da9['message']=_0x312ccf;if(_0x5a4da9[_0xe024('0xa0')]['UserId']){return db['User']['find']({'attributes':['id',_0xe024('0x39')],'where':{'id':_0x5a4da9[_0xe024('0xa0')]['UserId']}})[_0xe024('0x1f')](function(_0x52ff0a){if(_0x52ff0a){_0x5a4da9[_0xe024('0x75')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe024('0xa7'),'appdata':_0x52ff0a[_0xe024('0x39')]+','+(_0x5a4da9[_0xe024('0x74')][_0xe024('0xa8')]||0xa),'interval':_0xe024('0xa5')});}return respondWithRpcPromise(_0xe024('0xa9'),_0xe024('0xaa'),_0x5a4da9);});}return respondWithRpcPromise(_0xe024('0xa9'),'startRouting',_0x5a4da9);})[_0xe024('0x1f')](function(_0x3fecae){if(_0x3fecae){var _0x43eb37=0xc8;var _0x17ff8b=_0xe024('0xab');logger[_0xe024('0x20')](_0xe024('0x23'),_0x17ff8b,_0x43eb37,_0xe024('0xac'));logger[_0xe024('0x22')](_0xe024('0xad'),_0x17ff8b,_0x43eb37,_0xe024('0xac'),JSON[_0xe024('0x25')](_0x3fecae));if(_0x5a4da9[_0xe024('0x74')][_0xe024('0x52')]===_0xe024('0x82')){return _0x1332e8[_0xe024('0x2c')](_0x43eb37)['set'](_0xe024('0xae'),_0xe024('0xaf'))['send'](_0xe024('0xb0'));}else{return _0x1332e8['status'](_0x43eb37)['json'](_0x3fecae);}}})['catch'](handleError(_0x1332e8,null));};exports['addApplications']=function(_0x48c42b,_0x4bd8c4,_0x441ab5){return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x48c42b['params']['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x4bd8c4,null))[_0xe024('0x1f')](function(_0x2c54b8){if(_0x2c54b8){return db['sequelize'][_0xe024('0xb1')](function(_0x3a3f01){return db[_0xe024('0x72')][_0xe024('0x35')]({'where':{'SmsAccountId':_0x48c42b['params']['id']},'transaction':_0x3a3f01})['then'](function(_0x5a68ce){var _0x363520=_[_0xe024('0x3e')](_0x48c42b[_0xe024('0x65')],function(_0x472b93){_0x472b93['SmsAccountId']=_0x48c42b[_0xe024('0x67')]['id'];return _0x472b93;});return db[_0xe024('0x72')][_0xe024('0xb2')](_0x363520,{'transaction':_0x3a3f01});});})['then'](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x48c42b[_0xe024('0x67')]['id']},'order':_0xe024('0x77')});});}})[_0xe024('0x1f')](respondWithResult(_0x4bd8c4,null))[_0xe024('0x29')](handleError(_0x4bd8c4,null));};exports[_0xe024('0xb3')]=function(_0x11ec06,_0x3a1355,_0x232a7f){var _0x4a369c={};var _0x4a516e={};var _0x38ff98;var _0x537001;return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x11ec06[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x3a1355,null))['then'](function(_0x587c50){if(_0x587c50){_0x38ff98=_0x587c50;_0x4a516e[_0xe024('0x42')]=_[_0xe024('0x44')](db['SmsApplication'][_0xe024('0x5a')]);_0x4a516e[_0xe024('0x43')]=_[_0xe024('0x44')](_0x11ec06[_0xe024('0x43')]);_0x4a516e[_0xe024('0x45')]=_[_0xe024('0x46')](_0x4a516e[_0xe024('0x42')],_0x4a516e[_0xe024('0x43')]);_0x4a369c['attributes']=_[_0xe024('0x46')](_0x4a516e[_0xe024('0x42')],qs['fields'](_0x11ec06['query'][_0xe024('0x48')]));_0x4a369c[_0xe024('0x47')]=_0x4a369c[_0xe024('0x47')][_0xe024('0x49')]?_0x4a369c[_0xe024('0x47')]:_0x4a516e[_0xe024('0x42')];_0x4a369c['order']=qs[_0xe024('0x4d')](_0x11ec06[_0xe024('0x43')]['sort']);_0x4a369c[_0xe024('0x50')]=qs['filters'](_['pick'](_0x11ec06['query'],_0x4a516e['filters']));if(_0x11ec06[_0xe024('0x43')][_0xe024('0x4f')]){_0x4a369c[_0xe024('0x50')]=_[_0xe024('0x51')](_0x4a369c[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x4a369c[_0xe024('0x47')],function(_0x4d6b81){var _0x17a50a={};_0x17a50a[_0x4d6b81]={'$like':'%'+_0x11ec06[_0xe024('0x43')]['filter']+'%'};return _0x17a50a;})});}_0x4a369c=_['merge']({},_0x4a369c,_0x11ec06[_0xe024('0x54')]);return _0x38ff98[_0xe024('0xb3')](_0x4a369c);}})['then'](function(_0x200b32){if(_0x200b32){_0x537001=_0x200b32['length'];if(!_0x11ec06[_0xe024('0x43')][_0xe024('0x4a')](_0xe024('0x4b'))){_0x4a369c[_0xe024('0x2f')]=qs['limit'](_0x11ec06['query'][_0xe024('0x2f')]);_0x4a369c[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x11ec06[_0xe024('0x43')][_0xe024('0x30')]);}return _0x38ff98['getApplications'](_0x4a369c);}})[_0xe024('0x1f')](function(_0x5b7afc){if(_0x5b7afc){return _0x5b7afc?{'count':_0x537001,'rows':_0x5b7afc}:null;}})[_0xe024('0x1f')](respondWithResult(_0x3a1355,null))[_0xe024('0x29')](handleError(_0x3a1355,null));};exports[_0xe024('0xb4')]=function(_0x51e9d1,_0x45e3c5,_0x2ae907){var _0x257903={'raw':![],'where':{}};var _0x27a47e={};var _0x37b13a={'count':0x0,'rows':[]};return db[_0xe024('0x3f')][_0xe024('0x6e')]({'where':{'id':_0x51e9d1['params']['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x45e3c5,null))[_0xe024('0x1f')](function(_0x27d53b){if(_0x27d53b){_0x27a47e[_0xe024('0x42')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x27a47e['query']=_[_0xe024('0x44')](_0x51e9d1[_0xe024('0x43')]);_0x27a47e[_0xe024('0x45')]=_[_0xe024('0x46')](_0x27a47e['model'],_0x27a47e['query']);_0x257903[_0xe024('0x47')]=_['intersection'](_0x27a47e['model'],qs[_0xe024('0x48')](_0x51e9d1[_0xe024('0x43')]['fields']));_0x257903['attributes']=_0x257903[_0xe024('0x47')][_0xe024('0x49')]?_0x257903['attributes']:_0x27a47e[_0xe024('0x42')];if(!_0x51e9d1['query']['hasOwnProperty'](_0xe024('0x4b'))){_0x257903[_0xe024('0x2f')]=qs[_0xe024('0x2f')](_0x51e9d1[_0xe024('0x43')][_0xe024('0x2f')]);_0x257903[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x51e9d1[_0xe024('0x43')][_0xe024('0x30')]);}_0x257903['order']=qs[_0xe024('0x4d')](_0x51e9d1[_0xe024('0x43')]['sort']);_0x257903[_0xe024('0x50')]=qs['filters'](_[_0xe024('0x4e')](_0x51e9d1['query'],_0x27a47e[_0xe024('0x45')]));_0x257903[_0xe024('0x50')][_0xe024('0x6b')]=_0x27d53b['id'];if(_0x51e9d1[_0xe024('0x43')]['filter']){_0x257903['where']=_[_0xe024('0x51')](_0x257903[_0xe024('0x50')],{'$or':_[_0xe024('0x3e')](_0x257903[_0xe024('0x47')],function(_0x4d5520){var _0x804c35={};_0x804c35[_0x4d5520]={'$like':'%'+_0x51e9d1[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x804c35;})});}_0x257903=_['merge']({},_0x257903,_0x51e9d1[_0xe024('0x54')]);return db[_0xe024('0x9f')][_0xe024('0x31')]({'where':_0x257903[_0xe024('0x50')]})[_0xe024('0x1f')](function(_0x1c824c){_0x37b13a[_0xe024('0x31')]=_0x1c824c;if(_0x51e9d1[_0xe024('0x43')][_0xe024('0x55')]){_0x257903[_0xe024('0x56')]=[{'model':db[_0xe024('0x79')],'as':_0xe024('0xb5'),'required':![]},{'model':db[_0xe024('0xb6')],'as':_0xe024('0xb7'),'attributes':['name',_0xe024('0xb8'),_0xe024('0xb9')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xe024('0x39'),_0xe024('0xba')],'where':_0x51e9d1[_0xe024('0x43')][_0xe024('0xbb')]?{'id':_0x51e9d1[_0xe024('0x43')][_0xe024('0xbb')]}:undefined,'required':_0x51e9d1[_0xe024('0x43')]['tag']?!![]:![]}];}return db[_0xe024('0x9f')][_0xe024('0x57')](_0x257903);})['then'](function(_0x12eebd){_0x37b13a[_0xe024('0x58')]=_0x12eebd;return _0x37b13a;});}})['then'](respondWithFilteredResult(_0x45e3c5,_0x257903))[_0xe024('0x29')](handleError(_0x45e3c5,null));};exports[_0xe024('0x3a')]=function(_0x3dfad8,_0x2cbf03,_0x553c03){var _0x5a3ef6,_0x568d5b,_0x1d776f;if(_[_0xe024('0x96')](_0x3dfad8[_0xe024('0x65')][_0xe024('0x65')])||_0x3dfad8[_0xe024('0x65')][_0xe024('0x65')]===''){throw new db['Sequelize']['ValidationError'](_0xe024('0xbc'));}if(_['isNil'](_0x3dfad8[_0xe024('0x65')]['to'])){throw new db[(_0xe024('0x7a'))][(_0xe024('0x7b'))](_0xe024('0xbd'));}_0x5a3ef6=_0x3dfad8[_0xe024('0x65')]['to'];return db[_0xe024('0x3f')]['find']({'where':{'id':_0x3dfad8[_0xe024('0x67')]['id']},'include':[{'model':db[_0xe024('0x9c')],'as':_0xe024('0xbe'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x5a3ef6},'limit':0x1,'order':[[_0xe024('0x7d'),_0xe024('0xbf')]]}]}]})[_0xe024('0x1f')](handleEntityNotFound(_0x2cbf03,null))[_0xe024('0x1f')](function(_0x33040a){if(_0x33040a&&_0x33040a[_0xe024('0xbe')]){_0x568d5b=_0x33040a[_0xe024('0x36')]({'plain':!![]});if(_0x568d5b[_0xe024('0xbe')]&&_0x568d5b[_0xe024('0xbe')][_0xe024('0x9d')][_0xe024('0x49')]){return _0x568d5b[_0xe024('0xbe')][_0xe024('0x9d')][0x0];}return db['CmContact'][_0xe024('0x5b')](_[_0xe024('0x18')](_0x3dfad8['body'],{'firstName':_0x5a3ef6,'mobile':_0x5a3ef6,'phone':_0x5a3ef6,'ListId':_0x568d5b[_0xe024('0x80')]}));}})[_0xe024('0x1f')](handleEntityNotFound(_0x2cbf03,null))[_0xe024('0x1f')](function(_0x322c48){if(_0x322c48){_0x1d776f=_0x322c48;return db[_0xe024('0x9f')][_0xe024('0x61')]({'where':{'ContactId':_0x1d776f['id'],'closed':![],'SmsAccountId':_0x568d5b['id']}})[_0xe024('0x1f')](function(_0x57bd96){if(_0x57bd96){return[_0x57bd96,![]];}return db[_0xe024('0x9f')]['create']({'UserId':_0x3dfad8[_0xe024('0x5e')]['id'],'ContactId':_0x1d776f['id'],'SmsAccountId':_0x568d5b['id'],'phone':_0x5a3ef6,'firstMsgDirection':_0xe024('0xc0'),'Messages':[_[_0xe024('0x51')](_0x3dfad8[_0xe024('0x65')],{'read':![],'body':_0x3dfad8[_0xe024('0x65')]['body'],'phone':_0x5a3ef6,'SmsAccountId':_0x568d5b['id'],'UserId':_0x3dfad8[_0xe024('0x5e')]['id'],'ContactId':_0x1d776f['id']})]},{'include':[{'model':db[_0xe024('0xa6')],'as':_0xe024('0xc1')}]})[_0xe024('0x1f')](function(_0x154ad6){return[_0x154ad6,!![]];});});}})['spread'](function(_0x40813d,_0x4a3342){if(_0x4a3342){return _0x40813d;}return db['SmsMessage']['create'](_[_0xe024('0x51')](_0x3dfad8[_0xe024('0x65')],{'read':![],'body':_0x3dfad8[_0xe024('0x65')][_0xe024('0x65')],'phone':_0x5a3ef6,'SmsAccountId':_0x568d5b['id'],'SmsInteractionId':_0x40813d['id'],'UserId':_0x3dfad8[_0xe024('0x5e')]['id'],'ContactId':_0x1d776f['id']}))[_0xe024('0x1f')](function(_0x435012){_0x40813d[_0xe024('0xc2')][_0xe024('0xc1')]=[];_0x40813d[_0xe024('0xc2')][_0xe024('0xc1')]['push'](_0x435012['dataValues']);return _0x40813d;});})[_0xe024('0x1f')](respondWithResult(_0x2cbf03,null))[_0xe024('0x29')](handleError(_0x2cbf03,null));};exports[_0xe024('0x2c')]=function(_0x45b84b,_0x520da2,_0x2e461c){if(_0x45b84b[_0xe024('0x65')]['id']){delete _0x45b84b[_0xe024('0x65')]['id'];}var _0x23a6c3,_0x43a3a7,_0x5caef5;return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x45b84b[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x520da2,null))[_0xe024('0x1f')](function(_0x5760c7){if(_0x5760c7){_0x5caef5=_0x5760c7;logger[_0xe024('0x22')](_0xe024('0x23'),_0xe024('0x2c'),'received\x20delivery\x20report\x20from',_0x5760c7['type'],util[_0xe024('0xc3')](_0x45b84b['body'],{'showHidden':![],'depth':null}));switch(_0x5760c7[_0xe024('0x52')]){case'skebby':if(_0x45b84b[_0xe024('0x65')][_0xe024('0xc4')]&&_0x45b84b[_0xe024('0x65')][_0xe024('0x2c')]){_0x43a3a7=_0x45b84b[_0xe024('0x65')]['status'];return db['SmsMessage'][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')]['skebby_dispatch_id']}});}break;case _0xe024('0x86'):if(_0x45b84b[_0xe024('0x65')]['requestid']&&_0x45b84b[_0xe024('0x65')]['statusInt']){_0x43a3a7=_0x45b84b[_0xe024('0x65')][_0xe024('0xc5')];return db['SmsMessage'][_0xe024('0x61')]({'where':{'messageId':_0x45b84b['body']['requestid']}});}break;case _0xe024('0x87'):if(_0x45b84b[_0xe024('0x65')][_0xe024('0xc6')]&&_0x45b84b[_0xe024('0x65')]['status_code']){_0x43a3a7=_0x45b84b[_0xe024('0x65')][_0xe024('0xc7')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][_0xe024('0xc6')]}});}break;case'infobip':var _0x4889c=_0x45b84b[_0xe024('0x65')][_0xe024('0x8e')][0x0];if(_0x4889c[_0xe024('0x88')]&&_0x4889c[_0xe024('0x2c')][_0xe024('0xc8')]===_0xe024('0xc9')){_0x43a3a7=_0x4889c[_0xe024('0x2c')][_0xe024('0xc8')];return db['SmsMessage'][_0xe024('0x61')]({'where':{'messageId':_0x4889c[_0xe024('0x88')]}});}break;case _0xe024('0x92'):if(_0x45b84b[_0xe024('0x65')][_0xe024('0x88')]&&_0x45b84b[_0xe024('0x65')][_0xe024('0x2c')]){_0x43a3a7=_0x45b84b['body']['status'];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][_0xe024('0x88')]}});}break;case _0xe024('0xca'):if(_0x45b84b[_0xe024('0x65')][0x0]['message']['id']){_0x43a3a7=_0x45b84b['body'][0x0][_0xe024('0x52')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][0x0][_0xe024('0x27')]['id']}});}break;case _0xe024('0x94'):if(_0x45b84b[_0xe024('0x65')]['redif']&&_0x45b84b['body'][_0xe024('0x2c')]){_0x43a3a7=_0x45b84b['body'][_0xe024('0x2c')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x45b84b[_0xe024('0x65')][_0xe024('0xcb')]}});}break;}}})[_0xe024('0x1f')](handleEntityNotFound(_0x520da2,null))[_0xe024('0x1f')](function(_0x5233cb){if(_0x5233cb){_0x23a6c3=_0x5233cb;switch(_0x5caef5[_0xe024('0x52')]){case'skebby':if(_0x43a3a7==='DELIVERED'){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0xcc'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0x86'):if(_0x43a3a7==='1'){return _0x23a6c3['update']({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0xcc'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0x87'):if(!_0x45b84b[_0xe024('0x65')]['error_code']&&_0x43a3a7>=0xc8&&_0x43a3a7<=0xce){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger['error'](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0x87'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0x8d'):var _0xaca5cf=_0x45b84b[_0xe024('0x65')][_0xe024('0x8e')][0x0];if(_0xaca5cf[_0xe024('0x2c')]['groupName']==='DELIVERED'){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0x8d'),util[_0xe024('0xc3')](_0x45b84b['body'],{'showHidden':![],'depth':null}));}break;case _0xe024('0x92'):if(_0x43a3a7==_0xe024('0xcd')||_0x43a3a7==_0xe024('0xce')){return _0x23a6c3[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),'status',_0xe024('0x92'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case _0xe024('0xca'):if(_0x43a3a7==_0xe024('0xcf')){return _0x23a6c3['update']({'read':!![]});}else{logger['error'](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0xca'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x43a3a7===_0xe024('0xd0')||_0x43a3a7===_0xe024('0xd1')){return _0x23a6c3['update']({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),'status',_0xe024('0x94'),util[_0xe024('0xc3')](_0x45b84b[_0xe024('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x23a6c3;}})[_0xe024('0x1f')](respondWithResult(_0x520da2,null))[_0xe024('0x29')](handleError(_0x520da2,null));};exports[_0xe024('0xd2')]=function(_0x48114d,_0x22ebe2,_0x3010f8){var _0x1a1901,_0x40d5fb,_0xd80c6;return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x48114d[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x22ebe2,null))[_0xe024('0x1f')](function(_0x1a00ac){if(_0x1a00ac){_0xd80c6=_0x1a00ac;logger[_0xe024('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xe024('0x2c'),_0xe024('0xd3'),_0x1a00ac[_0xe024('0x52')],util[_0xe024('0xc3')](_0x48114d[_0xe024('0x43')],{'showHidden':![],'depth':null}));switch(_0x1a00ac['type']){case'csc':if(_0x48114d['query'][_0xe024('0xd4')]&&_0x48114d[_0xe024('0x43')][_0xe024('0xd5')]){_0x40d5fb=_0x48114d['query'][_0xe024('0xd5')];return db[_0xe024('0xa6')][_0xe024('0x61')]({'where':{'messageId':_0x48114d[_0xe024('0x43')][_0xe024('0xd4')]}});}break;}}})[_0xe024('0x1f')](handleEntityNotFound(_0x22ebe2,null))['then'](function(_0x213fb1){if(_0x213fb1){_0x1a1901=_0x213fb1;switch(_0xd80c6[_0xe024('0x52')]){case'csc':if(_0x40d5fb==='2'||_0x40d5fb==='6'){return _0x1a1901[_0xe024('0x34')]({'read':!![]});}else{logger[_0xe024('0x26')](_0xe024('0x23'),_0xe024('0x2c'),_0xe024('0x8f'),util[_0xe024('0xc3')](_0x48114d['query'],{'showHidden':![],'depth':null}));};break;}return _0x1a1901;}})[_0xe024('0x1f')](respondWithResult(_0x22ebe2,null))['catch'](handleError(_0x22ebe2,null));};exports[_0xe024('0xd6')]=function(_0x451da5,_0x1080c1,_0x5c6406){return db['SmsAccount'][_0xe024('0x61')]({'where':{'id':_0x451da5[_0xe024('0x67')]['id']}})[_0xe024('0x1f')](handleEntityNotFound(_0x1080c1,null))[_0xe024('0x1f')](function(_0x41a304){if(_0x41a304){return _0x41a304[_0xe024('0xd6')](_0x451da5[_0xe024('0x65')][_0xe024('0xd7')],_['omit'](_0x451da5['body'],['ids','id'])||{})['spread'](function(_0x2348c8){for(var _0x348c1e=0x0;_0x348c1e<_0x451da5['body'][_0xe024('0xd7')]['length'];_0x348c1e+=0x1){socket[_0xe024('0xd8')]('userSmsAccount:save',{'UserId':Number(_0x451da5['body'][_0xe024('0xd7')][_0x348c1e]),'SmsAccountId':Number(_0x451da5['params']['id'])});}return _0x2348c8;});}})[_0xe024('0x1f')](respondWithResult(_0x1080c1,null))[_0xe024('0x29')](handleError(_0x1080c1,null));};exports[_0xe024('0xd9')]=function(_0x492a13,_0x25860b,_0x15f37e){return db[_0xe024('0x3f')][_0xe024('0x61')]({'where':{'id':_0x492a13[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x25860b,null))[_0xe024('0x1f')](function(_0x2e207a){if(_0x2e207a){return _0x2e207a[_0xe024('0xd9')](_0x492a13[_0xe024('0x43')][_0xe024('0xd7')])[_0xe024('0x1f')](function(){if(_[_0xe024('0xda')](_0x492a13[_0xe024('0x43')][_0xe024('0xd7')])){for(var _0x3e1326=0x0;_0x3e1326<_0x492a13['query']['ids'][_0xe024('0x49')];_0x3e1326+=0x1){socket[_0xe024('0xd8')](_0xe024('0xdb'),{'UserId':Number(_0x492a13['query'][_0xe024('0xd7')][_0x3e1326]),'SmsAccountId':Number(_0x492a13['params']['id'])});}}else{socket[_0xe024('0xd8')](_0xe024('0xdb'),{'UserId':Number(_0x492a13[_0xe024('0x43')][_0xe024('0xd7')]),'SmsAccountId':Number(_0x492a13[_0xe024('0x67')]['id'])});}});}})['then'](respondWithStatusCode(_0x25860b,null))['catch'](handleError(_0x25860b,null));};exports['getAgents']=function(_0x343cd0,_0x15ab9e,_0x56caba){var _0x3cdd0a={};var _0x4dfd7e={};var _0x42adc3;var _0x21f418;return db['SmsAccount'][_0xe024('0x6e')]({'where':{'id':_0x343cd0[_0xe024('0x67')]['id']}})['then'](handleEntityNotFound(_0x15ab9e,null))['then'](function(_0x17a934){if(_0x17a934){_0x42adc3=_0x17a934;_0x4dfd7e[_0xe024('0x42')]=_[_0xe024('0x44')](db[_0xe024('0xb6')][_0xe024('0x5a')]);_0x4dfd7e[_0xe024('0x43')]=_[_0xe024('0x44')](_0x343cd0['query']);_0x4dfd7e[_0xe024('0x45')]=_[_0xe024('0x46')](_0x4dfd7e[_0xe024('0x42')],_0x4dfd7e[_0xe024('0x43')]);_0x3cdd0a[_0xe024('0x47')]=_[_0xe024('0x46')](_0x4dfd7e[_0xe024('0x42')],qs[_0xe024('0x48')](_0x343cd0['query']['fields']));_0x3cdd0a[_0xe024('0x47')]=_0x3cdd0a[_0xe024('0x47')][_0xe024('0x49')]?_0x3cdd0a[_0xe024('0x47')]:_0x4dfd7e['model'];_0x3cdd0a['order']=qs[_0xe024('0x4d')](_0x343cd0[_0xe024('0x43')][_0xe024('0x4d')]);_0x3cdd0a[_0xe024('0x50')]=qs['filters'](_[_0xe024('0x4e')](_0x343cd0[_0xe024('0x43')],_0x4dfd7e[_0xe024('0x45')]));if(_0x343cd0['query'][_0xe024('0x4f')]){_0x3cdd0a['where']=_[_0xe024('0x51')](_0x3cdd0a[_0xe024('0x50')],{'$or':_['map'](_0x3cdd0a['attributes'],function(_0x85acaa){var _0x2d92ed={};_0x2d92ed[_0x85acaa]={'$like':'%'+_0x343cd0[_0xe024('0x43')][_0xe024('0x4f')]+'%'};return _0x2d92ed;})});}_0x3cdd0a=_['merge']({},_0x3cdd0a,_0x343cd0[_0xe024('0x54')]);return _0x42adc3[_0xe024('0xdc')](_0x3cdd0a);}})['then'](function(_0x6f7111){if(_0x6f7111){_0x21f418=_0x6f7111['length'];if(!_0x343cd0[_0xe024('0x43')][_0xe024('0x4a')](_0xe024('0x4b'))){_0x3cdd0a[_0xe024('0x2f')]=qs['limit'](_0x343cd0[_0xe024('0x43')][_0xe024('0x2f')]);_0x3cdd0a[_0xe024('0x30')]=qs[_0xe024('0x30')](_0x343cd0[_0xe024('0x43')][_0xe024('0x30')]);}return _0x42adc3[_0xe024('0xdc')](_0x3cdd0a);}})['then'](function(_0x27b1a0){if(_0x27b1a0){return _0x27b1a0?{'count':_0x21f418,'rows':_0x27b1a0}:null;}})[_0xe024('0x1f')](respondWithResult(_0x15ab9e,null))['catch'](handleError(_0x15ab9e,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index ebc9c40..9990166 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 _0xfdfc=['emit','hasOwnProperty','hook','exports','SmsAccount','save'];(function(_0x542843,_0x2558af){var _0x458933=function(_0x57320a){while(--_0x57320a){_0x542843['push'](_0x542843['shift']());}};_0x458933(++_0x2558af);}(_0xfdfc,0x76));var _0xcfdf=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xfdfc[_0x49b207];return _0x2dc8fa;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xcfdf('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcfdf('0x1'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5f1401){return function(_0x4271ee,_0x198109,_0x5d4116){SmsAccountEvents[_0xcfdf('0x2')](_0x5f1401+':'+_0x4271ee['id'],_0x4271ee);SmsAccountEvents['emit'](_0x5f1401,_0x4271ee);_0x5d4116(null);};}for(var e in events){if(events[_0xcfdf('0x3')](e)){var event=events[e];SmsAccount[_0xcfdf('0x4')](e,emitEvent(event));}}module[_0xcfdf('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0x6b13=['SmsAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5d6424,_0x3ad9cf){var _0x59ec84=function(_0x3aa1c3){while(--_0x3aa1c3){_0x5d6424['push'](_0x5d6424['shift']());}};_0x59ec84(++_0x3ad9cf);}(_0x6b13,0x131));var _0x36b1=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x6b13[_0x38537f];return _0x141e23;};'use strict';var EventEmitter=require(_0x36b1('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x36b1('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x36b1('0x2')](0x0);var events={'afterCreate':_0x36b1('0x3'),'afterUpdate':_0x36b1('0x4'),'afterDestroy':_0x36b1('0x5')};function emitEvent(_0x1eb799){return function(_0x359298,_0x9d2c41,_0x56d7b4){SmsAccountEvents[_0x36b1('0x6')](_0x1eb799+':'+_0x359298['id'],_0x359298);SmsAccountEvents[_0x36b1('0x6')](_0x1eb799,_0x359298);_0x56d7b4(null);};}for(var e in events){if(events[_0x36b1('0x7')](e)){var event=events[e];SmsAccount[_0x36b1('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 9e420e6..f912f3d 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 _0x5063=['exports','define','sms_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3a887d,_0x439f75){var _0x280152=function(_0x3dd026){while(--_0x3dd026){_0x3a887d['push'](_0x3a887d['shift']());}};_0x280152(++_0x439f75);}(_0x5063,0xad));var _0x3506=function(_0x317546,_0x4dbaaf){_0x317546=_0x317546-0x0;var _0x212939=_0x5063[_0x317546];return _0x212939;};'use strict';var _=require(_0x3506('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3506('0x1'));var moment=require(_0x3506('0x2'));var BPromise=require(_0x3506('0x3'));var rp=require(_0x3506('0x4'));var fs=require('fs');var path=require(_0x3506('0x5'));var rimraf=require(_0x3506('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x3506('0x7')]=function(_0x10e28e,_0x3c7343){return _0x10e28e[_0x3506('0x8')]('SmsAccount',attributes,{'tableName':_0x3506('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x909d=['rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','util','api','moment','bluebird','request-promise'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x909d,0x192));var _0xd909=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x909d[_0x58dc25];return _0x21b0a7;};'use strict';var _=require('lodash');var util=require(_0xd909('0x0'));var logger=require('../../config/logger')(_0xd909('0x1'));var moment=require(_0xd909('0x2'));var BPromise=require(_0xd909('0x3'));var rp=require(_0xd909('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd909('0x5'));var config=require(_0xd909('0x6'));var attributes=require(_0xd909('0x7'));module[_0xd909('0x8')]=function(_0x1aefea,_0x43cddb){return _0x1aefea['define'](_0xd909('0x9'),attributes,{'tableName':_0xd909('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 6835769..9760cd1 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 _0x7ebf=['../../config/environment','http','redis','defaults','localhost','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x7ebf,0x1c1));var _0xf7eb=function(_0x24a534,_0x175117){_0x24a534=_0x24a534-0x0;var _0x21f00d=_0x7ebf[_0x24a534];return _0x21f00d;};'use strict';var _=require(_0xf7eb('0x0'));var util=require(_0xf7eb('0x1'));var moment=require(_0xf7eb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7eb('0x3'));var db=require(_0xf7eb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7eb('0x5'))('rpc');var config=require(_0xf7eb('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf7eb('0x7')]({'port':0x232a});config[_0xf7eb('0x8')]=_[_0xf7eb('0x9')](config['redis'],{'host':_0xf7eb('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf7eb('0x8')]));require(_0xf7eb('0xb'))[_0xf7eb('0xc')](socket);function respondWithRpcPromise(_0x2ee148,_0x31c097,_0x222fbb){return new BPromise(function(_0x16eb36,_0x403fda){return client['request'](_0x2ee148,_0x222fbb)[_0xf7eb('0xd')](function(_0x10a42e){logger[_0xf7eb('0xe')](_0xf7eb('0xf'),_0x31c097,'request\x20sent');logger['debug'](_0xf7eb('0x10'),_0x31c097,_0xf7eb('0x11'),JSON[_0xf7eb('0x12')](_0x10a42e));if(_0x10a42e[_0xf7eb('0x13')]){if(_0x10a42e[_0xf7eb('0x13')][_0xf7eb('0x14')]===0x1f4){logger[_0xf7eb('0x13')](_0xf7eb('0xf'),_0x31c097,_0x10a42e[_0xf7eb('0x13')][_0xf7eb('0x15')]);return _0x403fda(_0x10a42e[_0xf7eb('0x13')][_0xf7eb('0x15')]);}logger[_0xf7eb('0x13')]('SmsAccount,\x20%s,\x20%s',_0x31c097,_0x10a42e['error'][_0xf7eb('0x15')]);return _0x16eb36(_0x10a42e['error']['message']);}else{logger[_0xf7eb('0xe')]('SmsAccount,\x20%s,\x20%s',_0x31c097,_0xf7eb('0x11'));_0x16eb36(_0x10a42e[_0xf7eb('0x16')][_0xf7eb('0x15')]);}})['catch'](function(_0xdf3e4b){logger[_0xf7eb('0x13')](_0xf7eb('0xf'),_0x31c097,_0xdf3e4b);_0x403fda(_0xdf3e4b);});});}exports[_0xf7eb('0x17')]=function(_0x2058e2){var _0x5d747a=this;return new Promise(function(_0x580834,_0x363963){return db[_0xf7eb('0x18')][_0xf7eb('0x19')]({'raw':_0x2058e2['options']?_0x2058e2[_0xf7eb('0x1a')][_0xf7eb('0x1b')]===undefined?!![]:![]:!![],'where':_0x2058e2[_0xf7eb('0x1a')]?_0x2058e2[_0xf7eb('0x1a')][_0xf7eb('0x1c')]||null:null,'attributes':_0x2058e2['options']?_0x2058e2['options'][_0xf7eb('0x1d')]||null:null,'include':_0x2058e2[_0xf7eb('0x1a')]?_0x2058e2[_0xf7eb('0x1a')][_0xf7eb('0x1e')]?_[_0xf7eb('0x1f')](_0x2058e2[_0xf7eb('0x1a')]['include'],function(_0x2a483b){return{'model':db[_0x2a483b[_0xf7eb('0x20')]],'as':_0x2a483b['as'],'attributes':_0x2a483b['attributes'],'include':_0x2a483b[_0xf7eb('0x1e')]?_[_0xf7eb('0x1f')](_0x2a483b[_0xf7eb('0x1e')],function(_0x5e6027){return{'model':db[_0x5e6027[_0xf7eb('0x20')]],'as':_0x5e6027['as'],'attributes':_0x5e6027[_0xf7eb('0x1d')],'include':_0x5e6027[_0xf7eb('0x1e')]?_[_0xf7eb('0x1f')](_0x5e6027['include'],function(_0x19b77a){return{'model':db[_0x19b77a['model']],'as':_0x19b77a['as'],'attributes':_0x19b77a[_0xf7eb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf7eb('0xd')](function(_0x15724d){logger[_0xf7eb('0xe')](_0xf7eb('0x17'),_0x2058e2);logger[_0xf7eb('0x21')](_0xf7eb('0x17'),_0x2058e2,JSON[_0xf7eb('0x12')](_0x15724d));_0x580834(_0x15724d);})[_0xf7eb('0x22')](function(_0x554b05){logger[_0xf7eb('0x13')](_0xf7eb('0x17'),_0x554b05['message'],_0x2058e2);_0x363963(_0x5d747a[_0xf7eb('0x13')](0x1f4,_0x554b05['message']));});});}; \ No newline at end of file +var _0x5b00=['options','raw','attributes','include','map','model','debug','stringify','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','./smsAccount.socket','register','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','ShowSmsAccount','SmsAccount','find'];(function(_0x43c683,_0x362f74){var _0x3a714d=function(_0x242c65){while(--_0x242c65){_0x43c683['push'](_0x43c683['shift']());}};_0x3a714d(++_0x362f74);}(_0x5b00,0x195));var _0x05b0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5b00[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x05b0('0x0'));var moment=require(_0x05b0('0x1'));var BPromise=require(_0x05b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x05b0('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x05b0('0x4'))(_0x05b0('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x05b0('0x6')]({'port':0x232a});config['redis']=_[_0x05b0('0x7')](config[_0x05b0('0x8')],{'host':_0x05b0('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x05b0('0x8')]));require(_0x05b0('0xa'))[_0x05b0('0xb')](socket);function respondWithRpcPromise(_0x2bb611,_0x26e274,_0x224419){return new BPromise(function(_0x4cbef3,_0x1340a1){return client['request'](_0x2bb611,_0x224419)[_0x05b0('0xc')](function(_0x4edb70){logger['info'](_0x05b0('0xd'),_0x26e274,_0x05b0('0xe'));logger['debug'](_0x05b0('0xf'),_0x26e274,_0x05b0('0xe'),JSON['stringify'](_0x4edb70));if(_0x4edb70['error']){if(_0x4edb70[_0x05b0('0x10')][_0x05b0('0x11')]===0x1f4){logger[_0x05b0('0x10')]('SmsAccount,\x20%s,\x20%s',_0x26e274,_0x4edb70['error'][_0x05b0('0x12')]);return _0x1340a1(_0x4edb70[_0x05b0('0x10')][_0x05b0('0x12')]);}logger[_0x05b0('0x10')](_0x05b0('0xd'),_0x26e274,_0x4edb70[_0x05b0('0x10')][_0x05b0('0x12')]);return _0x4cbef3(_0x4edb70[_0x05b0('0x10')][_0x05b0('0x12')]);}else{logger[_0x05b0('0x13')](_0x05b0('0xd'),_0x26e274,_0x05b0('0xe'));_0x4cbef3(_0x4edb70[_0x05b0('0x14')]['message']);}})['catch'](function(_0x797564){logger['error'](_0x05b0('0xd'),_0x26e274,_0x797564);_0x1340a1(_0x797564);});});}exports[_0x05b0('0x15')]=function(_0x3c8162){var _0x591bbf=this;return new Promise(function(_0x569b82,_0x240363){return db[_0x05b0('0x16')][_0x05b0('0x17')]({'raw':_0x3c8162['options']?_0x3c8162[_0x05b0('0x18')][_0x05b0('0x19')]===undefined?!![]:![]:!![],'where':_0x3c8162['options']?_0x3c8162['options']['where']||null:null,'attributes':_0x3c8162[_0x05b0('0x18')]?_0x3c8162[_0x05b0('0x18')][_0x05b0('0x1a')]||null:null,'include':_0x3c8162[_0x05b0('0x18')]?_0x3c8162['options'][_0x05b0('0x1b')]?_[_0x05b0('0x1c')](_0x3c8162[_0x05b0('0x18')]['include'],function(_0xe4aabc){return{'model':db[_0xe4aabc[_0x05b0('0x1d')]],'as':_0xe4aabc['as'],'attributes':_0xe4aabc[_0x05b0('0x1a')],'include':_0xe4aabc['include']?_[_0x05b0('0x1c')](_0xe4aabc[_0x05b0('0x1b')],function(_0x2ccb26){return{'model':db[_0x2ccb26['model']],'as':_0x2ccb26['as'],'attributes':_0x2ccb26[_0x05b0('0x1a')],'include':_0x2ccb26[_0x05b0('0x1b')]?_['map'](_0x2ccb26[_0x05b0('0x1b')],function(_0x336fa4){return{'model':db[_0x336fa4['model']],'as':_0x336fa4['as'],'attributes':_0x336fa4['attributes']};}):[]};}):[]};}):[]:[]})[_0x05b0('0xc')](function(_0x1b3a5a){logger[_0x05b0('0x13')](_0x05b0('0x15'),_0x3c8162);logger[_0x05b0('0x1e')](_0x05b0('0x15'),_0x3c8162,JSON[_0x05b0('0x1f')](_0x1b3a5a));_0x569b82(_0x1b3a5a);})[_0x05b0('0x20')](function(_0x475f70){logger[_0x05b0('0x10')](_0x05b0('0x15'),_0x475f70[_0x05b0('0x12')],_0x3c8162);_0x240363(_0x591bbf['error'](0x1f4,_0x475f70['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 5bbd791..aa785e6 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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 f4be469..ef1f7a9 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 _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x442439,_0x4eba0d){var _0x1ba17e=function(_0x3a37cd){while(--_0x3a37cd){_0x442439['push'](_0x442439['shift']());}};_0x1ba17e(++_0x4eba0d);}(_0x008c,0x188));var _0xc008=function(_0x11a379,_0x572c80){_0x11a379=_0x11a379-0x0;var _0xc53c9f=_0x008c[_0x11a379];return _0xc53c9f;};'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('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f6167,_0x432253){var _0x2e2548=function(_0x1da10){while(--_0x1da10){_0x2f6167['push'](_0x2f6167['shift']());}};_0x2e2548(++_0x432253);}(_0x34e8,0x12c));var _0x834e=function(_0x48acac,_0x189179){_0x48acac=_0x48acac-0x0;var _0x3ddaf6=_0x34e8[_0x48acac];return _0x3ddaf6;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 57e3349..6a34d87 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 _0xe8b5=['noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x770c24,_0x3368e7){var _0x1a3b99=function(_0x3dc5b8){while(--_0x3dc5b8){_0x770c24['push'](_0x770c24['shift']());}};_0x1a3b99(++_0x3368e7);}(_0xe8b5,0x18e));var _0x5e8b=function(_0xc69fda,_0x367f93){_0xc69fda=_0xc69fda-0x0;var _0x721842=_0xe8b5[_0xc69fda];return _0x721842;};'use strict';var Sequelize=require(_0x5e8b('0x0'));module[_0x5e8b('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5e8b('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x5e8b('0x3')]},'interval':{'type':Sequelize[_0x5e8b('0x3')],'defaultValue':_0x5e8b('0x4')}}; \ No newline at end of file +var _0x4537=['exports','INTEGER','TEXT','STRING','*,*,*,*'];(function(_0x52d861,_0x21f9b9){var _0x1a2023=function(_0x43d056){while(--_0x43d056){_0x52d861['push'](_0x52d861['shift']());}};_0x1a2023(++_0x21f9b9);}(_0x4537,0x1bd));var _0x7453=function(_0x78ceb1,_0xe581ec){_0x78ceb1=_0x78ceb1-0x0;var _0x2f724e=_0x4537[_0x78ceb1];return _0x2f724e;};'use strict';var Sequelize=require('sequelize');module[_0x7453('0x0')]={'priority':{'type':Sequelize[_0x7453('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x7453('0x2')]()},'description':{'type':Sequelize[_0x7453('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x7453('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 64b4609..e6366a4 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 _0x9019=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','findAll','rows','show','params','keys','length','includeAll','include','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x4f282d,_0x1527c5){var _0x1082d7=function(_0x26d311){while(--_0x26d311){_0x4f282d['push'](_0x4f282d['shift']());}};_0x1082d7(++_0x1527c5);}(_0x9019,0x8c));var _0x9901=function(_0x9efe0,_0x1e7272){_0x9efe0=_0x9efe0-0x0;var _0x232a0f=_0x9019[_0x9efe0];return _0x232a0f;};'use strict';var emlformat=require(_0x9901('0x0'));var rimraf=require(_0x9901('0x1'));var zipdir=require(_0x9901('0x2'));var jsonpatch=require(_0x9901('0x3'));var rp=require(_0x9901('0x4'));var moment=require(_0x9901('0x5'));var BPromise=require(_0x9901('0x6'));var Mustache=require(_0x9901('0x7'));var util=require(_0x9901('0x8'));var path=require('path');var sox=require(_0x9901('0x9'));var csv=require(_0x9901('0xa'));var ejs=require(_0x9901('0xb'));var fs=require('fs');var fs_extra=require(_0x9901('0xc'));var _=require('lodash');var squel=require(_0x9901('0xd'));var crypto=require(_0x9901('0xe'));var jsforce=require(_0x9901('0xf'));var deskjs=require(_0x9901('0x10'));var toCsv=require(_0x9901('0xa'));var querystring=require(_0x9901('0x11'));var Papa=require(_0x9901('0x12'));var Redis=require(_0x9901('0x13'));var authService=require(_0x9901('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x9901('0x15'));var hardwareService=require(_0x9901('0x16'));var logger=require(_0x9901('0x17'))(_0x9901('0x18'));var utils=require(_0x9901('0x19'));var config=require(_0x9901('0x1a'));var licenseUtil=require(_0x9901('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b9eff,_0x225e85){_0x225e85=_0x225e85||0xcc;return function(_0x4378b5){if(_0x4378b5){return _0x1b9eff[_0x9901('0x1c')](_0x225e85);}return _0x1b9eff[_0x9901('0x1d')](_0x225e85)[_0x9901('0x1e')]();};}function respondWithResult(_0x39ee76,_0x1f0d60){_0x1f0d60=_0x1f0d60||0xc8;return function(_0x28e940){if(_0x28e940){return _0x39ee76[_0x9901('0x1d')](_0x1f0d60)['json'](_0x28e940);}};}function respondWithFilteredResult(_0x4f94bf,_0x1f29a3){return function(_0x1d8d89){if(_0x1d8d89){var _0x4d1ae5=typeof _0x1f29a3[_0x9901('0x1f')]===_0x9901('0x20')&&typeof _0x1f29a3[_0x9901('0x21')]===_0x9901('0x20');var _0x5a2856=_0x1d8d89[_0x9901('0x22')];var _0x3661a1=_0x4d1ae5?0x0:_0x1f29a3[_0x9901('0x1f')];var _0x411b3d=_0x4d1ae5?_0x1d8d89[_0x9901('0x22')]:_0x1f29a3['offset']+_0x1f29a3[_0x9901('0x21')];var _0x541cbf;if(_0x411b3d>=_0x5a2856){_0x411b3d=_0x5a2856;_0x541cbf=0xc8;}else{_0x541cbf=0xce;}_0x4f94bf['status'](_0x541cbf);return _0x4f94bf[_0x9901('0x23')](_0x9901('0x24'),_0x3661a1+'-'+_0x411b3d+'/'+_0x5a2856)[_0x9901('0x25')](_0x1d8d89);}return null;};}function patchUpdates(_0x46533c){return function(_0x580a54){try{jsonpatch[_0x9901('0x26')](_0x580a54,_0x46533c,!![]);}catch(_0x196d03){return BPromise[_0x9901('0x27')](_0x196d03);}return _0x580a54['save']();};}function saveUpdates(_0x395c37,_0x70ef6a){return function(_0x1e3bfe){if(_0x1e3bfe){return _0x1e3bfe[_0x9901('0x28')](_0x395c37)[_0x9901('0x29')](function(_0x4553f6){return _0x4553f6;});}return null;};}function removeEntity(_0x123c58,_0xda68e7){return function(_0x1e4ebb){if(_0x1e4ebb){return _0x1e4ebb[_0x9901('0x2a')]()[_0x9901('0x29')](function(){_0x123c58[_0x9901('0x1d')](0xcc)[_0x9901('0x1e')]();});}};}function handleEntityNotFound(_0x49f4cc,_0x38d9c0){return function(_0x5f040f){if(!_0x5f040f){_0x49f4cc[_0x9901('0x1c')](0x194);}return _0x5f040f;};}function handleError(_0x397199,_0x388079){_0x388079=_0x388079||0x1f4;return function(_0x218540){logger[_0x9901('0x2b')](_0x218540[_0x9901('0x2c')]);if(_0x218540[_0x9901('0x2d')]){delete _0x218540[_0x9901('0x2d')];}_0x397199[_0x9901('0x1d')](_0x388079)[_0x9901('0x2e')](_0x218540);};}exports[_0x9901('0x2f')]=function(_0x5a804b,_0x40c285){var _0x26cf95={},_0x315b21={},_0x2086b4={'count':0x0,'rows':[]};var _0x2f1e32=_[_0x9901('0x30')](db[_0x9901('0x31')][_0x9901('0x32')],function(_0xd90c39){return{'name':_0xd90c39[_0x9901('0x33')],'type':_0xd90c39[_0x9901('0x34')][_0x9901('0x35')]};});_0x315b21['model']=_[_0x9901('0x30')](_0x2f1e32,'name');_0x315b21['query']=_['keys'](_0x5a804b[_0x9901('0x36')]);_0x315b21[_0x9901('0x37')]=_[_0x9901('0x38')](_0x315b21[_0x9901('0x39')],_0x315b21[_0x9901('0x36')]);_0x26cf95[_0x9901('0x3a')]=_[_0x9901('0x38')](_0x315b21[_0x9901('0x39')],qs[_0x9901('0x3b')](_0x5a804b['query']['fields']));_0x26cf95[_0x9901('0x3a')]=_0x26cf95[_0x9901('0x3a')]['length']?_0x26cf95[_0x9901('0x3a')]:_0x315b21['model'];if(!_0x5a804b[_0x9901('0x36')][_0x9901('0x3c')]('nolimit')){_0x26cf95[_0x9901('0x21')]=qs[_0x9901('0x21')](_0x5a804b[_0x9901('0x36')]['limit']);_0x26cf95[_0x9901('0x1f')]=qs[_0x9901('0x1f')](_0x5a804b['query'][_0x9901('0x1f')]);}_0x26cf95[_0x9901('0x3d')]=qs[_0x9901('0x3e')](_0x5a804b[_0x9901('0x36')][_0x9901('0x3e')]);_0x26cf95[_0x9901('0x3f')]=qs[_0x9901('0x37')](_[_0x9901('0x40')](_0x5a804b[_0x9901('0x36')],_0x315b21['filters']),_0x2f1e32);if(_0x5a804b[_0x9901('0x36')][_0x9901('0x41')]){_0x26cf95[_0x9901('0x3f')]=_['merge'](_0x26cf95[_0x9901('0x3f')],{'$or':_[_0x9901('0x30')](_0x2f1e32,function(_0x4ffde7){if(_0x4ffde7[_0x9901('0x34')]!==_0x9901('0x42')){var _0x14ef5d={};_0x14ef5d[_0x4ffde7[_0x9901('0x2d')]]={'$like':'%'+_0x5a804b[_0x9901('0x36')][_0x9901('0x41')]+'%'};return _0x14ef5d;}})});}_0x26cf95=_['merge']({},_0x26cf95,_0x5a804b[_0x9901('0x43')]);var _0x598b75={'where':_0x26cf95[_0x9901('0x3f')]};return db[_0x9901('0x31')][_0x9901('0x22')](_0x598b75)[_0x9901('0x29')](function(_0x25831b){_0x2086b4['count']=_0x25831b;if(_0x5a804b[_0x9901('0x36')]['includeAll']){_0x26cf95['include']=[{'all':!![]}];}return db[_0x9901('0x31')][_0x9901('0x44')](_0x26cf95);})[_0x9901('0x29')](function(_0x273b21){_0x2086b4[_0x9901('0x45')]=_0x273b21;return _0x2086b4;})[_0x9901('0x29')](respondWithFilteredResult(_0x40c285,_0x26cf95))['catch'](handleError(_0x40c285,null));};exports[_0x9901('0x46')]=function(_0x47bde4,_0x54996f){var _0x1eb1bb={'raw':!![],'where':{'id':_0x47bde4[_0x9901('0x47')]['id']}},_0x343a98={};_0x343a98[_0x9901('0x39')]=_[_0x9901('0x48')](db[_0x9901('0x31')]['rawAttributes']);_0x343a98[_0x9901('0x36')]=_['keys'](_0x47bde4['query']);_0x343a98[_0x9901('0x37')]=_['intersection'](_0x343a98[_0x9901('0x39')],_0x343a98['query']);_0x1eb1bb[_0x9901('0x3a')]=_['intersection'](_0x343a98[_0x9901('0x39')],qs[_0x9901('0x3b')](_0x47bde4[_0x9901('0x36')]['fields']));_0x1eb1bb['attributes']=_0x1eb1bb[_0x9901('0x3a')][_0x9901('0x49')]?_0x1eb1bb[_0x9901('0x3a')]:_0x343a98[_0x9901('0x39')];if(_0x47bde4['query'][_0x9901('0x4a')]){_0x1eb1bb[_0x9901('0x4b')]=[{'all':!![]}];}_0x1eb1bb=_['merge']({},_0x1eb1bb,_0x47bde4[_0x9901('0x43')]);return db[_0x9901('0x31')]['find'](_0x1eb1bb)[_0x9901('0x29')](handleEntityNotFound(_0x54996f,null))['then'](respondWithResult(_0x54996f,null))[_0x9901('0x4c')](handleError(_0x54996f,null));};exports[_0x9901('0x4d')]=function(_0x20097c,_0x286dff){return db[_0x9901('0x31')][_0x9901('0x4d')](_0x20097c[_0x9901('0x4e')],{})[_0x9901('0x29')](respondWithResult(_0x286dff,0xc9))[_0x9901('0x4c')](handleError(_0x286dff,null));};exports[_0x9901('0x28')]=function(_0x35e9f5,_0x4c9e55){if(_0x35e9f5['body']['id']){delete _0x35e9f5[_0x9901('0x4e')]['id'];}return db[_0x9901('0x31')]['find']({'where':{'id':_0x35e9f5[_0x9901('0x47')]['id']}})[_0x9901('0x29')](handleEntityNotFound(_0x4c9e55,null))['then'](saveUpdates(_0x35e9f5[_0x9901('0x4e')],null))[_0x9901('0x29')](respondWithResult(_0x4c9e55,null))[_0x9901('0x4c')](handleError(_0x4c9e55,null));};exports['destroy']=function(_0x22222b,_0x1a3cbe){return db[_0x9901('0x31')][_0x9901('0x4f')]({'where':{'id':_0x22222b['params']['id']}})['then'](handleEntityNotFound(_0x1a3cbe,null))[_0x9901('0x29')](removeEntity(_0x1a3cbe,null))[_0x9901('0x4c')](handleError(_0x1a3cbe,null));}; \ No newline at end of file +var _0x4b2d=['options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','SmsApplication','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4b2d,0x12c));var _0xd4b2=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x4b2d[_0x1e2080];return _0x260111;};'use strict';var emlformat=require(_0xd4b2('0x0'));var rimraf=require(_0xd4b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd4b2('0x2'));var rp=require(_0xd4b2('0x3'));var moment=require('moment');var BPromise=require(_0xd4b2('0x4'));var Mustache=require(_0xd4b2('0x5'));var util=require(_0xd4b2('0x6'));var path=require(_0xd4b2('0x7'));var sox=require(_0xd4b2('0x8'));var csv=require(_0xd4b2('0x9'));var ejs=require(_0xd4b2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd4b2('0xb'));var squel=require(_0xd4b2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd4b2('0x9'));var querystring=require(_0xd4b2('0xd'));var Papa=require(_0xd4b2('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4b2('0xf'));var as=require(_0xd4b2('0x10'));var hardwareService=require(_0xd4b2('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xd4b2('0x12'));var config=require(_0xd4b2('0x13'));var licenseUtil=require(_0xd4b2('0x14'));var db=require(_0xd4b2('0x15'))['db'];function respondWithStatusCode(_0x1fad98,_0x319f28){_0x319f28=_0x319f28||0xcc;return function(_0x5c998b){if(_0x5c998b){return _0x1fad98[_0xd4b2('0x16')](_0x319f28);}return _0x1fad98[_0xd4b2('0x17')](_0x319f28)[_0xd4b2('0x18')]();};}function respondWithResult(_0x354840,_0x47ea0b){_0x47ea0b=_0x47ea0b||0xc8;return function(_0x295320){if(_0x295320){return _0x354840['status'](_0x47ea0b)[_0xd4b2('0x19')](_0x295320);}};}function respondWithFilteredResult(_0x9b92e0,_0x5da73f){return function(_0x419ace){if(_0x419ace){var _0xf8da17=typeof _0x5da73f[_0xd4b2('0x1a')]===_0xd4b2('0x1b')&&typeof _0x5da73f[_0xd4b2('0x1c')]==='undefined';var _0x3bc053=_0x419ace[_0xd4b2('0x1d')];var _0x34a543=_0xf8da17?0x0:_0x5da73f['offset'];var _0x9f89ac=_0xf8da17?_0x419ace[_0xd4b2('0x1d')]:_0x5da73f[_0xd4b2('0x1a')]+_0x5da73f[_0xd4b2('0x1c')];var _0x220258;if(_0x9f89ac>=_0x3bc053){_0x9f89ac=_0x3bc053;_0x220258=0xc8;}else{_0x220258=0xce;}_0x9b92e0[_0xd4b2('0x17')](_0x220258);return _0x9b92e0['set'](_0xd4b2('0x1e'),_0x34a543+'-'+_0x9f89ac+'/'+_0x3bc053)[_0xd4b2('0x19')](_0x419ace);}return null;};}function patchUpdates(_0x1229f7){return function(_0x244e49){try{jsonpatch[_0xd4b2('0x1f')](_0x244e49,_0x1229f7,!![]);}catch(_0x5558e4){return BPromise[_0xd4b2('0x20')](_0x5558e4);}return _0x244e49[_0xd4b2('0x21')]();};}function saveUpdates(_0x41b720,_0xafce2c){return function(_0x4cb038){if(_0x4cb038){return _0x4cb038[_0xd4b2('0x22')](_0x41b720)[_0xd4b2('0x23')](function(_0x3b0a7a){return _0x3b0a7a;});}return null;};}function removeEntity(_0x108b1f,_0x477a95){return function(_0xe96cd3){if(_0xe96cd3){return _0xe96cd3[_0xd4b2('0x24')]()['then'](function(){_0x108b1f[_0xd4b2('0x17')](0xcc)[_0xd4b2('0x18')]();});}};}function handleEntityNotFound(_0x47cfc2,_0x299b65){return function(_0x15dfd7){if(!_0x15dfd7){_0x47cfc2['sendStatus'](0x194);}return _0x15dfd7;};}function handleError(_0x4dfb25,_0x4a3db9){_0x4a3db9=_0x4a3db9||0x1f4;return function(_0x44b504){logger[_0xd4b2('0x25')](_0x44b504[_0xd4b2('0x26')]);if(_0x44b504['name']){delete _0x44b504[_0xd4b2('0x27')];}_0x4dfb25[_0xd4b2('0x17')](_0x4a3db9)[_0xd4b2('0x28')](_0x44b504);};}exports['index']=function(_0x210f4c,_0x17e5c8){var _0x2ce649={},_0x1e3876={},_0x314300={'count':0x0,'rows':[]};var _0x2bb528=_[_0xd4b2('0x29')](db[_0xd4b2('0x2a')][_0xd4b2('0x2b')],function(_0x3068c1){return{'name':_0x3068c1['fieldName'],'type':_0x3068c1[_0xd4b2('0x2c')][_0xd4b2('0x2d')]};});_0x1e3876[_0xd4b2('0x2e')]=_[_0xd4b2('0x29')](_0x2bb528,_0xd4b2('0x27'));_0x1e3876['query']=_[_0xd4b2('0x2f')](_0x210f4c[_0xd4b2('0x30')]);_0x1e3876['filters']=_[_0xd4b2('0x31')](_0x1e3876['model'],_0x1e3876['query']);_0x2ce649['attributes']=_[_0xd4b2('0x31')](_0x1e3876[_0xd4b2('0x2e')],qs[_0xd4b2('0x32')](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x32')]));_0x2ce649[_0xd4b2('0x33')]=_0x2ce649[_0xd4b2('0x33')][_0xd4b2('0x34')]?_0x2ce649[_0xd4b2('0x33')]:_0x1e3876[_0xd4b2('0x2e')];if(!_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x35')](_0xd4b2('0x36'))){_0x2ce649[_0xd4b2('0x1c')]=qs['limit'](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x1c')]);_0x2ce649['offset']=qs['offset'](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x1a')]);}_0x2ce649[_0xd4b2('0x37')]=qs[_0xd4b2('0x38')](_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x38')]);_0x2ce649[_0xd4b2('0x39')]=qs[_0xd4b2('0x3a')](_[_0xd4b2('0x3b')](_0x210f4c['query'],_0x1e3876[_0xd4b2('0x3a')]),_0x2bb528);if(_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x3c')]){_0x2ce649[_0xd4b2('0x39')]=_[_0xd4b2('0x3d')](_0x2ce649[_0xd4b2('0x39')],{'$or':_['map'](_0x2bb528,function(_0x520631){if(_0x520631[_0xd4b2('0x2c')]!==_0xd4b2('0x3e')){var _0x406501={};_0x406501[_0x520631[_0xd4b2('0x27')]]={'$like':'%'+_0x210f4c[_0xd4b2('0x30')]['filter']+'%'};return _0x406501;}})});}_0x2ce649=_[_0xd4b2('0x3d')]({},_0x2ce649,_0x210f4c['options']);var _0x1504e4={'where':_0x2ce649[_0xd4b2('0x39')]};return db[_0xd4b2('0x2a')]['count'](_0x1504e4)[_0xd4b2('0x23')](function(_0x2035ea){_0x314300[_0xd4b2('0x1d')]=_0x2035ea;if(_0x210f4c[_0xd4b2('0x30')][_0xd4b2('0x3f')]){_0x2ce649[_0xd4b2('0x40')]=[{'all':!![]}];}return db[_0xd4b2('0x2a')][_0xd4b2('0x41')](_0x2ce649);})[_0xd4b2('0x23')](function(_0x55e85b){_0x314300[_0xd4b2('0x42')]=_0x55e85b;return _0x314300;})[_0xd4b2('0x23')](respondWithFilteredResult(_0x17e5c8,_0x2ce649))[_0xd4b2('0x43')](handleError(_0x17e5c8,null));};exports[_0xd4b2('0x44')]=function(_0x165441,_0x467de){var _0x51589b={'raw':!![],'where':{'id':_0x165441[_0xd4b2('0x45')]['id']}},_0x18009c={};_0x18009c[_0xd4b2('0x2e')]=_[_0xd4b2('0x2f')](db[_0xd4b2('0x2a')][_0xd4b2('0x2b')]);_0x18009c[_0xd4b2('0x30')]=_['keys'](_0x165441[_0xd4b2('0x30')]);_0x18009c['filters']=_[_0xd4b2('0x31')](_0x18009c['model'],_0x18009c[_0xd4b2('0x30')]);_0x51589b[_0xd4b2('0x33')]=_[_0xd4b2('0x31')](_0x18009c[_0xd4b2('0x2e')],qs[_0xd4b2('0x32')](_0x165441[_0xd4b2('0x30')][_0xd4b2('0x32')]));_0x51589b[_0xd4b2('0x33')]=_0x51589b[_0xd4b2('0x33')]['length']?_0x51589b['attributes']:_0x18009c[_0xd4b2('0x2e')];if(_0x165441['query']['includeAll']){_0x51589b[_0xd4b2('0x40')]=[{'all':!![]}];}_0x51589b=_['merge']({},_0x51589b,_0x165441[_0xd4b2('0x46')]);return db[_0xd4b2('0x2a')][_0xd4b2('0x47')](_0x51589b)[_0xd4b2('0x23')](handleEntityNotFound(_0x467de,null))['then'](respondWithResult(_0x467de,null))[_0xd4b2('0x43')](handleError(_0x467de,null));};exports[_0xd4b2('0x48')]=function(_0x236df1,_0x330afc){return db['SmsApplication'][_0xd4b2('0x48')](_0x236df1[_0xd4b2('0x49')],{})[_0xd4b2('0x23')](respondWithResult(_0x330afc,0xc9))[_0xd4b2('0x43')](handleError(_0x330afc,null));};exports[_0xd4b2('0x22')]=function(_0x2d14d8,_0x1a9ec6){if(_0x2d14d8[_0xd4b2('0x49')]['id']){delete _0x2d14d8[_0xd4b2('0x49')]['id'];}return db[_0xd4b2('0x2a')][_0xd4b2('0x47')]({'where':{'id':_0x2d14d8[_0xd4b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x1a9ec6,null))[_0xd4b2('0x23')](saveUpdates(_0x2d14d8[_0xd4b2('0x49')],null))[_0xd4b2('0x23')](respondWithResult(_0x1a9ec6,null))[_0xd4b2('0x43')](handleError(_0x1a9ec6,null));};exports[_0xd4b2('0x24')]=function(_0x5e9403,_0x2f541c){return db[_0xd4b2('0x2a')]['find']({'where':{'id':_0x5e9403[_0xd4b2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2f541c,null))[_0xd4b2('0x23')](removeEntity(_0x2f541c,null))['catch'](handleError(_0x2f541c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 67ed229..187726c 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 _0xd54c=['moment','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','lodash','../../config/logger','api'];(function(_0x2009f1,_0x969896){var _0x2b2c8c=function(_0x466070){while(--_0x466070){_0x2009f1['push'](_0x2009f1['shift']());}};_0x2b2c8c(++_0x969896);}(_0xd54c,0x171));var _0xcd54=function(_0x33418e,_0x190136){_0x33418e=_0x33418e-0x0;var _0x16e3a8=_0xd54c[_0x33418e];return _0x16e3a8;};'use strict';var _=require(_0xcd54('0x0'));var util=require('util');var logger=require(_0xcd54('0x1'))(_0xcd54('0x2'));var moment=require(_0xcd54('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd54('0x4'));var fs=require('fs');var path=require(_0xcd54('0x5'));var rimraf=require('rimraf');var config=require(_0xcd54('0x6'));var attributes=require(_0xcd54('0x7'));module[_0xcd54('0x8')]=function(_0x5daf2c,_0x45618c){return _0x5daf2c[_0xcd54('0x9')](_0xcd54('0xa'),attributes,{'tableName':_0xcd54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x64a5=['rimraf','../../config/environment','./smsApplication.attributes','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','path'];(function(_0x56f72b,_0x431af8){var _0x19c6fe=function(_0x51a833){while(--_0x51a833){_0x56f72b['push'](_0x56f72b['shift']());}};_0x19c6fe(++_0x431af8);}(_0x64a5,0x80));var _0x564a=function(_0x5a1036,_0x16525d){_0x5a1036=_0x5a1036-0x0;var _0x5453e1=_0x64a5[_0x5a1036];return _0x5453e1;};'use strict';var _=require('lodash');var util=require(_0x564a('0x0'));var logger=require('../../config/logger')(_0x564a('0x1'));var moment=require(_0x564a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x564a('0x3'));var rimraf=require(_0x564a('0x4'));var config=require(_0x564a('0x5'));var attributes=require(_0x564a('0x6'));module['exports']=function(_0x4be9f5,_0x418292){return _0x4be9f5['define'](_0x564a('0x7'),attributes,{'tableName':_0x564a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x564a('0x9'),'collate':_0x564a('0xa')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index d2de840..e0c61c0 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 _0x88c3=['lodash','moment','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x88c3,0x1ee));var _0x388c=function(_0x5d8036,_0x4d193e){_0x5d8036=_0x5d8036-0x0;var _0x243d71=_0x88c3[_0x5d8036];return _0x243d71;};'use strict';var _=require(_0x388c('0x0'));var util=require('util');var moment=require(_0x388c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x388c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x388c('0x3'))(_0x388c('0x4'));var config=require(_0x388c('0x5'));var jayson=require(_0x388c('0x6'));var client=jayson[_0x388c('0x7')][_0x388c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a1c0d,_0x3e79d8,_0x374b99){return new BPromise(function(_0x26be80,_0xc157a){return client[_0x388c('0x9')](_0x5a1c0d,_0x374b99)[_0x388c('0xa')](function(_0x2debe9){logger[_0x388c('0xb')]('SmsApplication,\x20%s,\x20%s',_0x3e79d8,_0x388c('0xc'));logger['debug']('SmsApplication,\x20%s,\x20%s,\x20%s',_0x3e79d8,_0x388c('0xc'),JSON[_0x388c('0xd')](_0x2debe9));if(_0x2debe9[_0x388c('0xe')]){if(_0x2debe9[_0x388c('0xe')][_0x388c('0xf')]===0x1f4){logger[_0x388c('0xe')](_0x388c('0x10'),_0x3e79d8,_0x2debe9[_0x388c('0xe')][_0x388c('0x11')]);return _0xc157a(_0x2debe9['error']['message']);}logger['error'](_0x388c('0x10'),_0x3e79d8,_0x2debe9[_0x388c('0xe')]['message']);return _0x26be80(_0x2debe9[_0x388c('0xe')][_0x388c('0x11')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x3e79d8,_0x388c('0xc'));_0x26be80(_0x2debe9[_0x388c('0x12')][_0x388c('0x11')]);}})['catch'](function(_0x10a3b4){logger['error'](_0x388c('0x10'),_0x3e79d8,_0x10a3b4);_0xc157a(_0x10a3b4);});});} \ No newline at end of file +var _0x5204=['rpc','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5204,0xdf));var _0x4520=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x5204[_0x59f0dc];return _0x5b5445;};'use strict';var _=require(_0x4520('0x0'));var util=require(_0x4520('0x1'));var moment=require('moment');var BPromise=require(_0x4520('0x2'));var rs=require(_0x4520('0x3'));var fs=require('fs');var Redis=require(_0x4520('0x4'));var db=require(_0x4520('0x5'))['db'];var utils=require(_0x4520('0x6'));var logger=require('../../config/logger')(_0x4520('0x7'));var config=require('../../config/environment');var jayson=require(_0x4520('0x8'));var client=jayson[_0x4520('0x9')][_0x4520('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe741c2,_0x396d29,_0x446dc9){return new BPromise(function(_0x27890f,_0x55b44f){return client[_0x4520('0xb')](_0xe741c2,_0x446dc9)['then'](function(_0x168e62){logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));logger[_0x4520('0xf')](_0x4520('0x10'),_0x396d29,_0x4520('0xe'),JSON[_0x4520('0x11')](_0x168e62));if(_0x168e62[_0x4520('0x12')]){if(_0x168e62[_0x4520('0x12')][_0x4520('0x13')]===0x1f4){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x55b44f(_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);}logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x168e62[_0x4520('0x12')][_0x4520('0x14')]);return _0x27890f(_0x168e62['error'][_0x4520('0x14')]);}else{logger[_0x4520('0xc')](_0x4520('0xd'),_0x396d29,_0x4520('0xe'));_0x27890f(_0x168e62[_0x4520('0x15')]['message']);}})[_0x4520('0x16')](function(_0x33ac29){logger[_0x4520('0x12')](_0x4520('0xd'),_0x396d29,_0x33ac29);_0x55b44f(_0x33ac29);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 94aaea7..6d3591e 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 _0xb03e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags'];(function(_0x587439,_0x153c32){var _0x138c81=function(_0x36bb26){while(--_0x36bb26){_0x587439['push'](_0x587439['shift']());}};_0x138c81(++_0x153c32);}(_0xb03e,0x1eb));var _0xeb03=function(_0x1b38bb,_0xf523d6){_0x1b38bb=_0x1b38bb-0x0;var _0x5eb4a9=_0xb03e[_0x1b38bb];return _0x5eb4a9;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth['isAuthenticated'](),controller[_0xeb03('0xf')]);router[_0xeb03('0xa')](_0xeb03('0x10'),auth['isAuthenticated'](),controller[_0xeb03('0x11')]);router['get'](_0xeb03('0x12'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x13')]);router[_0xeb03('0x14')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x15')]);router[_0xeb03('0x14')](_0xeb03('0x10'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);router[_0xeb03('0x14')](_0xeb03('0x17'),auth['isAuthenticated'](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1a')),controller[_0xeb03('0x1b')]);router['put'](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')]('sms',_0xeb03('0x1c')),controller[_0xeb03('0x1d')]);router[_0xeb03('0x1e')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1f')),controller[_0xeb03('0x20')]);router[_0xeb03('0x1e')](_0xeb03('0x17'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x21')]);module[_0xeb03('0x22')]=router; \ No newline at end of file +var _0x6324=['isAuthenticated','index','describe','show','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','/:id','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x5bad90,_0x49df8d){var _0x5edb65=function(_0x1af1ba){while(--_0x1af1ba){_0x5bad90['push'](_0x5bad90['shift']());}};_0x5edb65(++_0x49df8d);}(_0x6324,0x142));var _0x4632=function(_0x3bd792,_0x171a3e){_0x3bd792=_0x3bd792-0x0;var _0x405c0f=_0x6324[_0x3bd792];return _0x405c0f;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./smsInteraction.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0x7')](_0x4632('0xd'),auth[_0x4632('0x8')](),controller[_0x4632('0xe')]);router[_0x4632('0xf')]('/',auth[_0x4632('0x8')](),controller['create']);router[_0x4632('0xf')]('/:id/messages',auth[_0x4632('0x8')](),controller[_0x4632('0x10')]);router[_0x4632('0xf')](_0x4632('0x11'),auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x14')),controller[_0x4632('0x15')]);router[_0x4632('0x16')]('/:id',auth['isAuthenticated'](),interaction[_0x4632('0x12')](_0x4632('0x13'),_0x4632('0x17')),controller[_0x4632('0x18')]);router['delete'](_0x4632('0x19'),auth[_0x4632('0x8')](),interaction[_0x4632('0x12')]('sms',_0x4632('0x1a')),controller[_0x4632('0x1b')]);router['delete']('/:id/tags',auth[_0x4632('0x8')](),controller[_0x4632('0x1c')]);module[_0x4632('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b69808f..fa1f8ba 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 _0x7e02=['out','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x4a7ed8,_0x1459c3){var _0x413d8c=function(_0x3a1a64){while(--_0x3a1a64){_0x4a7ed8['push'](_0x4a7ed8['shift']());}};_0x413d8c(++_0x1459c3);}(_0x7e02,0x71));var _0x27e0=function(_0x2ddbf6,_0x439dbe){_0x2ddbf6=_0x2ddbf6-0x0;var _0x187a79=_0x7e02[_0x2ddbf6];return _0x187a79;};'use strict';var Sequelize=require(_0x27e0('0x0'));var moment=require(_0x27e0('0x1'));module[_0x27e0('0x2')]={'closed':{'type':Sequelize[_0x27e0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x27e0('0x4')]},'disposition':{'type':Sequelize[_0x27e0('0x5')]},'secondDisposition':{'type':Sequelize[_0x27e0('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x27e0('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x27e0('0x6')]('in',_0x27e0('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x27e0('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x27e0('0x6')]('in',_0x27e0('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x27e0('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5292=['ENUM','out','sequelize','moment','BOOLEAN','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5292,0xf7));var _0x2529=function(_0x1a13b1,_0x4d1d25){_0x1a13b1=_0x1a13b1-0x0;var _0x395e05=_0x5292[_0x1a13b1];return _0x395e05;};'use strict';var Sequelize=require(_0x2529('0x0'));var moment=require(_0x2529('0x1'));module['exports']={'closed':{'type':Sequelize[_0x2529('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x2529('0x3')]},'secondDisposition':{'type':Sequelize[_0x2529('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2529('0x3')]},'note':{'type':Sequelize[_0x2529('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2529('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2529('0x5')]('in',_0x2529('0x6')),'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 5de71b4..1dc5c8c 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 _0x02b1=['Users','map','fullname','TagIds','split','Tags','catch','index','SmsInteraction','rawAttributes','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','color','from','u.id','ui.SmsInteractionId','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','forEach','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','compact','isEmpty','SmsAccountId','createdAt','$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?','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','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','fields','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','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','show','params','includeAll','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','Tag','smsInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','format','push','CmContact','firstName','lastName','Messages','direction','secret','User','Owner','Sms','Account','N.A.','closedAt','disposition','out','System','Contact','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send'];(function(_0x58baa4,_0x4e9d95){var _0x362f53=function(_0xec0d98){while(--_0xec0d98){_0x58baa4['push'](_0x58baa4['shift']());}};_0x362f53(++_0x4e9d95);}(_0x02b1,0x19b));var _0x102b=function(_0x4e96c3,_0x3e00d4){_0x4e96c3=_0x4e96c3-0x0;var _0x3f1b9d=_0x02b1[_0x4e96c3];return _0x3f1b9d;};'use strict';var emlformat=require(_0x102b('0x0'));var rimraf=require(_0x102b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x102b('0x2'));var rp=require(_0x102b('0x3'));var moment=require(_0x102b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x102b('0x5'));var util=require(_0x102b('0x6'));var path=require(_0x102b('0x7'));var sox=require(_0x102b('0x8'));var csv=require('to-csv');var ejs=require(_0x102b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x102b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x102b('0xb'));var deskjs=require(_0x102b('0xc'));var toCsv=require(_0x102b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x102b('0xe'));var authService=require(_0x102b('0xf'));var qs=require(_0x102b('0x10'));var as=require(_0x102b('0x11'));var pdf=require(_0x102b('0x12'));var hardwareService=require(_0x102b('0x13'));var logger=require(_0x102b('0x14'))(_0x102b('0x15'));var utils=require(_0x102b('0x16'));var config=require(_0x102b('0x17'));var licenseUtil=require(_0x102b('0x18'));var db=require(_0x102b('0x19'))['db'];config['redis']=_['defaults'](config[_0x102b('0x1a')],{'host':_0x102b('0x1b'),'port':0x18eb});var socket=require(_0x102b('0x1c'))(new Redis(config[_0x102b('0x1a')]));require(_0x102b('0x1d'))[_0x102b('0x1e')](socket);function respondWithStatusCode(_0x2451c2,_0x9aa56e){_0x9aa56e=_0x9aa56e||0xcc;return function(_0x5359bd){if(_0x5359bd){return _0x2451c2[_0x102b('0x1f')](_0x9aa56e);}return _0x2451c2[_0x102b('0x20')](_0x9aa56e)[_0x102b('0x21')]();};}function respondWithResult(_0xc87dbe,_0x363b8b){_0x363b8b=_0x363b8b||0xc8;return function(_0x270c23){if(_0x270c23){return _0xc87dbe['status'](_0x363b8b)[_0x102b('0x22')](_0x270c23);}};}function respondWithFilteredResult(_0x297d13,_0x469e2b){return function(_0x18731e){if(_0x18731e){var _0x4f49c3=typeof _0x469e2b[_0x102b('0x23')]===_0x102b('0x24')&&typeof _0x469e2b[_0x102b('0x25')]===_0x102b('0x24');var _0x589ede=_0x18731e['count'];var _0x54f37d=_0x4f49c3?0x0:_0x469e2b[_0x102b('0x23')];var _0x92bb3f=_0x4f49c3?_0x18731e[_0x102b('0x26')]:_0x469e2b['offset']+_0x469e2b[_0x102b('0x25')];var _0x1cb87e;if(_0x92bb3f>=_0x589ede){_0x92bb3f=_0x589ede;_0x1cb87e=0xc8;}else{_0x1cb87e=0xce;}_0x297d13[_0x102b('0x20')](_0x1cb87e);return _0x297d13['set'](_0x102b('0x27'),_0x54f37d+'-'+_0x92bb3f+'/'+_0x589ede)[_0x102b('0x22')](_0x18731e);}return null;};}function patchUpdates(_0x1fd23a){return function(_0x54dd04){try{jsonpatch[_0x102b('0x28')](_0x54dd04,_0x1fd23a,!![]);}catch(_0x599ecd){return BPromise[_0x102b('0x29')](_0x599ecd);}return _0x54dd04[_0x102b('0x2a')]();};}function saveUpdates(_0x101bbc,_0x50f3b5){return function(_0xc008f8){if(_0xc008f8){return _0xc008f8[_0x102b('0x2b')](_0x101bbc)[_0x102b('0x2c')](function(_0x39a37f){return _0x39a37f;});}return null;};}function removeEntity(_0xd806b6,_0x5468fe){return function(_0x48c115){if(_0x48c115){return _0x48c115[_0x102b('0x2d')]()['then'](function(){_0xd806b6[_0x102b('0x20')](0xcc)[_0x102b('0x21')]();});}};}function handleEntityNotFound(_0x2a34ef,_0x3d1466){return function(_0x3b1cf4){if(!_0x3b1cf4){_0x2a34ef[_0x102b('0x1f')](0x194);}return _0x3b1cf4;};}function handleError(_0x3dd6cd,_0x463f2a){_0x463f2a=_0x463f2a||0x1f4;return function(_0x59e664){logger[_0x102b('0x2e')](_0x59e664['stack']);if(_0x59e664[_0x102b('0x2f')]){delete _0x59e664[_0x102b('0x2f')];}_0x3dd6cd[_0x102b('0x20')](_0x463f2a)[_0x102b('0x30')](_0x59e664);};}function getInteractionUsers(_0x1982d0,_0x352b1c){return new BPromise(function(_0x21201a,_0x55bfa2){try{if(_0x352b1c[_0x1982d0['id']]){_0x1982d0[_0x102b('0x31')]=_[_0x102b('0x32')](_0x352b1c[_0x1982d0['id']],function(_0x544980){return{'id':_0x544980['id'],'fullname':_0x544980[_0x102b('0x33')]};});}}catch(_0x221842){_0x55bfa2(_0x221842);}_0x21201a(_0x1982d0);});}function getInteractionTags(_0x5dc586,_0x40c63d){return new BPromise(function(_0x198c17,_0x3af75b){try{if(_0x5dc586[_0x102b('0x34')]){_0x5dc586['Tags']=[];_0x5dc586['TagIds'][_0x102b('0x35')](',')['forEach'](function(_0xe9419e){_0x5dc586[_0x102b('0x36')]['push'](_0x40c63d[_0xe9419e]);});}delete _0x5dc586[_0x102b('0x34')];}catch(_0x42f485){_0x3af75b(_0x42f485);}_0x198c17(_0x5dc586);});}function updateSmsInteraction(_0x12eca3,_0x375782,_0x1812f5){return new BPromise(function(_0x47de83,_0xcb5a1c){return getInteractionUsers(_0x12eca3,_0x1812f5)[_0x102b('0x2c')](function(_0x4f30ca){return getInteractionTags(_0x4f30ca,_0x375782);})[_0x102b('0x2c')](function(_0x417fcc){_0x47de83(_0x417fcc);})[_0x102b('0x37')](function(_0xe7fcea){_0xcb5a1c(_0xe7fcea);});});}exports[_0x102b('0x38')]=function(_0x5780b7,_0x5ed7e2){var _0x24125f={},_0x3f59c={},_0x4337a9={'count':0x0,'rows':[]};var _0x485193=_['map'](db[_0x102b('0x39')][_0x102b('0x3a')],function(_0x4cd24c){return{'name':_0x4cd24c['fieldName'],'type':_0x4cd24c['type'][_0x102b('0x3b')]};});_0x3f59c['model']=_[_0x102b('0x32')](_0x485193,_0x102b('0x2f'));_0x3f59c[_0x102b('0x3c')]=_[_0x102b('0x3d')](_0x5780b7['query']);_0x3f59c['filters']=_[_0x102b('0x3e')](_0x3f59c[_0x102b('0x3f')],_0x3f59c[_0x102b('0x3c')]);_0x24125f[_0x102b('0x40')]=_[_0x102b('0x3e')](_0x3f59c[_0x102b('0x3f')],qs['fields'](_0x5780b7[_0x102b('0x3c')]['fields']));_0x24125f['attributes']=_0x24125f[_0x102b('0x40')][_0x102b('0x41')]?_0x24125f[_0x102b('0x40')]:_0x3f59c['model'];if(!_0x5780b7[_0x102b('0x3c')][_0x102b('0x42')](_0x102b('0x43'))){_0x24125f[_0x102b('0x25')]=qs[_0x102b('0x25')](_0x5780b7[_0x102b('0x3c')][_0x102b('0x25')]);_0x24125f[_0x102b('0x23')]=qs['offset'](_0x5780b7[_0x102b('0x3c')][_0x102b('0x23')]);}_0x24125f[_0x102b('0x44')]=qs['sort'](_0x5780b7[_0x102b('0x3c')][_0x102b('0x45')]);_0x24125f[_0x102b('0x46')]=qs[_0x102b('0x47')](_[_0x102b('0x48')](_0x5780b7[_0x102b('0x3c')],_0x3f59c[_0x102b('0x47')]),_0x485193);var _0x2b18ac=[];var _0x3dc229=squel[_0x102b('0x49')]()[_0x102b('0x4a')]('id')[_0x102b('0x4a')](_0x102b('0x2f'))[_0x102b('0x4a')](_0x102b('0x4b'))[_0x102b('0x4c')]('tools_tags');var _0x3f20d0=squel[_0x102b('0x49')]()[_0x102b('0x4a')](_0x102b('0x4d'))['field']('u.fullname')[_0x102b('0x4a')](_0x102b('0x4e'))['from'](_0x102b('0x4f'),'ui')['left_join'](_0x102b('0x50'),'u',_0x102b('0x51'));var _0x59ffdd=squel[_0x102b('0x49')]()[_0x102b('0x4c')](_0x102b('0x52'),'i')[_0x102b('0x53')](_0x102b('0x54'),'c',_0x102b('0x55'))[_0x102b('0x53')](_0x102b('0x50'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x102b('0x56'),'a',_0x102b('0x57'))[_0x102b('0x53')](_0x102b('0x58'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x102b('0x53')](_0x102b('0x59'),'it',_0x102b('0x5a'))[_0x102b('0x53')]('tools_tags','t',_0x102b('0x5b'));var _0x5f010f=squel[_0x102b('0x5c')]();var _0x35c1d7=[];var _0xaf6a54=squel['expr']();var _0x2c5d69;if(_0x5780b7[_0x102b('0x3c')]['search']){_0x2c5d69=as[_0x102b('0x5d')](_0x5780b7[_0x102b('0x3c')][_0x102b('0x5e')]);var _0x86f521=_0x2c5d69[_0x102b('0x5f')];for(var _0x551fff=0x0;_0x551fff<_0x2c5d69[_0x102b('0x60')][_0x102b('0x41')];_0x551fff++){var _0x8f2f2c=_0x2c5d69[_0x102b('0x60')][_0x551fff];var _0x26417c='i';var _0x3ce239=_[_0x102b('0x61')](_0x485193,[_0x102b('0x2f'),_0x8f2f2c['field']]);if(!_0x3ce239){switch(_0x8f2f2c[_0x102b('0x4a')]){case _0x102b('0x62'):if(_0x8f2f2c[_0x102b('0x63')]==0x1){_0x59ffdd[_0x102b('0x64')]('`'+_0x8f2f2c[_0x102b('0x4a')]+'`\x20=\x200');}else{_0x59ffdd['having']('`'+_0x8f2f2c['field']+'`\x20>\x200');}break;case'Contact':if(_0x8f2f2c['operator']===_0x102b('0x65')){if(_0x8f2f2c[_0x102b('0x63')][_0x102b('0x35')]('\x20')[_0x102b('0x41')]>0x1){_0x5f010f[_0x86f521]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x102b('0x66')](_0x8f2f2c['value']),null);}else{var _0x463df3='%'+_0x8f2f2c[_0x102b('0x63')]+'%';_0x5f010f[_0x86f521](_0x102b('0x67'),_0x463df3,_0x463df3,_0x463df3);}}else{_0x3ce239=_[_0x102b('0x61')](_0x485193,[_0x102b('0x2f'),_0x102b('0x68')]);_0x8f2f2c[_0x102b('0x4a')]='ContactId';_0x2782ac=as['buildExpression'](_0x26417c,_0x3ce239[_0x102b('0x69')],_0x8f2f2c);_0x5f010f[_0x86f521](_0x2782ac[_0x102b('0x6a')],_0x2782ac['value'][_0x102b('0x6b')],_0x2782ac[_0x102b('0x63')]['end']);}break;case'Tag':var _0x1b78a7=_0x8f2f2c[_0x102b('0x63')][_0x102b('0x35')](',')[_0x102b('0x32')](function(_0x4e9b14){return Number(_0x4e9b14);});_0x1b78a7[_0x102b('0x6c')](function(_0x5ba19){_0xaf6a54['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5ba19+',%');});_0x35c1d7=_[_0x102b('0x6d')](_0x35c1d7,_0x1b78a7);break;case'User':if(_0x8f2f2c[_0x102b('0x6e')]===_0x102b('0x65')){_0x5f010f[_0x86f521](_0x102b('0x6f'),'%'+_0x8f2f2c['value']+'%',null);}else{_0x3ce239=_[_0x102b('0x61')](_0x485193,[_0x102b('0x2f'),'UserId']);_0x8f2f2c[_0x102b('0x4a')]='UserId';_0x2782ac=as[_0x102b('0x70')](_0x26417c,_0x3ce239[_0x102b('0x69')],_0x8f2f2c);_0x5f010f[_0x86f521](_0x2782ac[_0x102b('0x6a')],_0x2782ac['value']['start'],_0x2782ac[_0x102b('0x63')]['end']);}break;case _0x102b('0x71'):_0x2782ac=as[_0x102b('0x70')]('me',null,_0x8f2f2c);_0x5f010f[_0x86f521](_0x2782ac['text'],_0x2782ac['value'][_0x102b('0x6b')],_0x2782ac[_0x102b('0x63')][_0x102b('0x21')]);break;}}else{var _0x2782ac=as[_0x102b('0x70')](_0x26417c,_0x3ce239[_0x102b('0x69')],_0x8f2f2c);_0x5f010f[_0x86f521](_0x2782ac[_0x102b('0x6a')],_0x2782ac[_0x102b('0x63')][_0x102b('0x6b')],_0x2782ac['value'][_0x102b('0x21')]);}}}else{var _0x5b1032=_(_0x5780b7[_0x102b('0x3c')])[_0x102b('0x3d')]()[_0x102b('0x32')](function(_0x12156e){return _['some'](_0x485193,[_0x102b('0x2f'),_0x12156e])?_0x12156e:undefined;})[_0x102b('0x72')]()['value']();if(!_[_0x102b('0x73')](_0x5b1032)){_0x5b1032[_0x102b('0x6c')](function(_0x175a20){if(_0x175a20===_0x102b('0x74')){_0x59ffdd[_0x102b('0x46')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x5780b7[_0x102b('0x3c')][_0x175a20]));}else if(_0x175a20===_0x102b('0x75')){var _0x13acee=JSON['parse'](_0x5780b7[_0x102b('0x3c')][_0x175a20])[_0x102b('0x76')];var _0x445c54=JSON['parse'](_0x5780b7[_0x102b('0x3c')][_0x175a20])['$lte'];_0x59ffdd[_0x102b('0x46')](_0x102b('0x77'),_0x13acee,_0x445c54);}else{if(_0x5780b7[_0x102b('0x3c')][_0x175a20]===_0x102b('0x78')){_0x59ffdd[_0x102b('0x46')]('i.'+_0x175a20+_0x102b('0x79'));}else{_0x59ffdd[_0x102b('0x46')]('i.'+_0x175a20+_0x102b('0x7a'),_0x5780b7[_0x102b('0x3c')][_0x175a20]);}}});}if(_0x5780b7['query'][_0x102b('0x7b')]){if(_0x5780b7['query'][_0x102b('0x7b')]==0x1){_0x59ffdd[_0x102b('0x64')](_0x102b('0x7c'));}else{_0x59ffdd[_0x102b('0x64')](_0x102b('0x7d'));}}if(_0x5780b7[_0x102b('0x3c')]['tag']){_0x35c1d7=_[_0x102b('0x7e')](_0x5780b7['query'][_0x102b('0x7f')])?_0x5780b7[_0x102b('0x3c')][_0x102b('0x7f')]:new Array(_0x5780b7['query'][_0x102b('0x7f')]);_0x35c1d7[_0x102b('0x6c')](function(_0x577354){_0xaf6a54['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x577354+',%');});}if(_0x5780b7['query'][_0x102b('0x80')]){var _0x5734da=_0x5780b7['query'][_0x102b('0x80')][_0x102b('0x81')]('\x5c','\x5c\x5c')[_0x102b('0x81')](/'/g,'\x27\x27');if(qs[_0x102b('0x82')](_0x5734da)){_0x5f010f['or'](_0x102b('0x83'),_0x5734da+'%')['or'](_0x102b('0x84'),_0x5734da+'%');}else{_0x5f010f['or'](_0x102b('0x85'),qs['getFullTextValue'](_0x5734da))['or'](_0x102b('0x86'),_0x5734da+'%');}}}_0x59ffdd[_0x102b('0x46')](_0x5f010f);_0x59ffdd[_0x102b('0x87')]('i.id');var _0x43d57b={'type':db[_0x102b('0x88')][_0x102b('0x89')][_0x102b('0x8a')],'raw':!![]};var _0x628ca=_0x59ffdd[_0x102b('0x8b')]();_0x628ca[_0x102b('0x4a')](_0x102b('0x8c'));_0x628ca[_0x102b('0x4a')](_0x102b('0x8d'),'unreadMessages');if(_0x24125f[_0x102b('0x44')]){_0x24125f['order']['forEach'](function(_0x584897){var _0x1066a2=_0x584897[0x0]===_0x102b('0x8e')?_0x584897[0x0]:'i.'+_0x584897[0x0];_0x59ffdd[_0x102b('0x44')](_0x1066a2,_0x584897[0x1]===_0x102b('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x35c1d7)){_0x59ffdd['having'](_0xaf6a54);_0x628ca['where']('t.id\x20IN\x20?',_0x35c1d7);}BPromise[_0x102b('0x90')]()[_0x102b('0x2c')](function(){if(!_0x2c5d69){if(_0x5780b7[_0x102b('0x3c')][_0x102b('0x74')])return;_0x628ca[_0x102b('0x46')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x59ffdd[_0x102b('0x46')](_0x102b('0x91'));return;}if(_0x5780b7[_0x102b('0x92')][_0x102b('0x93')]!==_0x102b('0x94'))return;return _0x5780b7[_0x102b('0x92')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x102b('0x2c')](function(_0x4136f1){if(_[_0x102b('0x73')](_0x4136f1)){_0x628ca['where'](_0x102b('0x95'));_0x59ffdd[_0x102b('0x46')](_0x102b('0x95'));}else{_0x628ca[_0x102b('0x46')]('i.SmsAccountId\x20IN\x20?',_[_0x102b('0x32')](_0x4136f1,'id'));_0x59ffdd['where']('i.SmsAccountId\x20IN\x20?',_[_0x102b('0x32')](_0x4136f1,'id'));}});})[_0x102b('0x2c')](function(){if(_0x5780b7[_0x102b('0x92')]['role']===_0x102b('0x94')&&!_0x2c5d69&&!_0x5780b7[_0x102b('0x3c')]['SmsAccountId'])return[];return db[_0x102b('0x96')][_0x102b('0x3c')](_0x628ca[_0x102b('0x97')](),_0x43d57b);})['then'](function(_0x580e53){_0x4337a9[_0x102b('0x26')]=_0x580e53[_0x102b('0x41')];if(_0x4337a9[_0x102b('0x26')]===0x0)return[];return db['sequelize'][_0x102b('0x3c')](_0x3dc229[_0x102b('0x97')](),_0x43d57b)[_0x102b('0x2c')](function(_0x313f3a){_0x2b18ac=_[_0x102b('0x98')](_0x313f3a,'id');_0x43d57b=_[_0x102b('0x99')](_0x43d57b,{'model':db[_0x102b('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5780b7[_0x102b('0x3c')][_0x102b('0x9a')]){_0x24125f['attributes']['forEach'](function(_0x50230b){_0x59ffdd[_0x102b('0x4a')]('i.'+_0x50230b);});}else{_0x59ffdd[_0x102b('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x102b('0x62'));_0x59ffdd[_0x102b('0x4a')]('a.key',_0x102b('0x9b'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0x9c'),'Account.mandatoryDisposition');_0x59ffdd[_0x102b('0x4a')](_0x102b('0x9d'),_0x102b('0x8e'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0x9e'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0x9f'),'Contact.firstName');_0x59ffdd['field'](_0x102b('0xa0'),_0x102b('0xa1'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0xa2'),_0x102b('0xa3'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0xa4'),_0x102b('0xa5'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0xa6'),_0x102b('0xa7'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0xa8'),_0x102b('0xa9'));_0x59ffdd[_0x102b('0x4a')](_0x102b('0xaa'),'Owner.fullname');_0x59ffdd[_0x102b('0x4a')](_0x102b('0xab'),_0x102b('0xac'));_0x59ffdd['field'](_0x102b('0xad'),_0x102b('0x34'));}if(_0x24125f['limit'])_0x59ffdd[_0x102b('0x25')](_0x24125f['limit']);if(_0x24125f[_0x102b('0x23')])_0x59ffdd[_0x102b('0x23')](_0x24125f[_0x102b('0x23')]);return db[_0x102b('0x96')][_0x102b('0x3c')](_0x59ffdd[_0x102b('0x97')](),_0x43d57b);})[_0x102b('0x2c')](function(_0x26cba3){if(_0x26cba3[_0x102b('0x41')]>0x0)_0x3f20d0['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x102b('0x32')](_0x26cba3,'id'));return db[_0x102b('0x96')]['query'](_0x3f20d0['toString'](),_0x43d57b)[_0x102b('0x2c')](function(_0x739ee3){var _0x44d477=_[_0x102b('0xae')](_0x739ee3,_0x102b('0xaf'));var _0x4545f5=[];_0x26cba3[_0x102b('0x6c')](function(_0x2ba74a){_0x4545f5['push'](updateSmsInteraction(_0x2ba74a,_0x2b18ac,_0x44d477));});return BPromise[_0x102b('0xb0')](_0x4545f5);});});})[_0x102b('0x2c')](function(_0x42c4ee){_0x4337a9[_0x102b('0xb1')]=_0x42c4ee;return _0x4337a9;})[_0x102b('0x2c')](respondWithFilteredResult(_0x5ed7e2,_0x24125f))[_0x102b('0x37')](handleError(_0x5ed7e2,null));};exports[_0x102b('0xb2')]=function(_0x3ec8fa,_0x362211){var _0x791174={'raw':![],'where':{'id':_0x3ec8fa[_0x102b('0xb3')]['id']}},_0x5afc21={};_0x5afc21[_0x102b('0x3f')]=_[_0x102b('0x3d')](db['SmsInteraction'][_0x102b('0x3a')]);_0x5afc21[_0x102b('0x3c')]=_[_0x102b('0x3d')](_0x3ec8fa[_0x102b('0x3c')]);_0x5afc21['filters']=_[_0x102b('0x3e')](_0x5afc21[_0x102b('0x3f')],_0x5afc21[_0x102b('0x3c')]);_0x791174[_0x102b('0x40')]=_['intersection'](_0x5afc21[_0x102b('0x3f')],qs[_0x102b('0x9a')](_0x3ec8fa['query'][_0x102b('0x9a')]));_0x791174[_0x102b('0x40')]=_0x791174[_0x102b('0x40')][_0x102b('0x41')]?_0x791174['attributes']:_0x5afc21[_0x102b('0x3f')];if(_0x3ec8fa['query'][_0x102b('0xb4')]){_0x791174['include']=[{'all':!![]}];}_0x791174=_[_0x102b('0x99')]({},_0x791174,_0x3ec8fa[_0x102b('0xb5')]);return db['SmsInteraction'][_0x102b('0x61')](_0x791174)[_0x102b('0x2c')](handleEntityNotFound(_0x362211,null))[_0x102b('0x2c')](respondWithResult(_0x362211,null))[_0x102b('0x37')](handleError(_0x362211,null));};exports[_0x102b('0xb6')]=function(_0x4b79c5,_0x4e1e17){return db[_0x102b('0x39')][_0x102b('0xb6')](_0x4b79c5[_0x102b('0x71')],{})[_0x102b('0x2c')](respondWithResult(_0x4e1e17,0xc9))[_0x102b('0x37')](handleError(_0x4e1e17,null));};exports[_0x102b('0x2b')]=function(_0x258db5,_0x2dcf44){if(_0x258db5[_0x102b('0x71')]['id']){delete _0x258db5['body']['id'];}return db[_0x102b('0x39')][_0x102b('0x61')]({'where':{'id':_0x258db5['params']['id']}})['then'](handleEntityNotFound(_0x2dcf44,null))[_0x102b('0x2c')](saveUpdates(_0x258db5['body'],null))[_0x102b('0x2c')](respondWithResult(_0x2dcf44,null))[_0x102b('0x37')](handleError(_0x2dcf44,null));};exports[_0x102b('0x2d')]=function(_0x3148b8,_0x300629){return db['SmsInteraction'][_0x102b('0x61')]({'where':{'id':_0x3148b8[_0x102b('0xb3')]['id']}})[_0x102b('0x2c')](handleEntityNotFound(_0x300629,null))[_0x102b('0x2c')](removeEntity(_0x300629,null))[_0x102b('0x37')](handleError(_0x300629,null));};exports['describe']=function(_0x5c4aef,_0x11dd65){return db['SmsInteraction'][_0x102b('0xb7')]()[_0x102b('0x2c')](respondWithResult(_0x11dd65,null))['catch'](handleError(_0x11dd65,null));};exports[_0x102b('0xb8')]=function(_0x1e76bf,_0x996063,_0x3e8a3c){return db[_0x102b('0xb9')][_0x102b('0x61')]({'where':{'id':_0x1e76bf[_0x102b('0xb3')]['id']}})[_0x102b('0x2c')](handleEntityNotFound(_0x996063,null))['then'](function(_0x54c514){if(_0x54c514){return _0x54c514[_0x102b('0xb8')](_0x1e76bf[_0x102b('0x71')][_0x102b('0xba')],_[_0x102b('0xbb')](_0x1e76bf[_0x102b('0x71')],[_0x102b('0xba'),'id'])||{});}})[_0x102b('0x2c')](respondWithResult(_0x996063,null))[_0x102b('0x37')](handleError(_0x996063,null));};exports[_0x102b('0xbc')]=function(_0x2939ff,_0x28a5b6,_0xb48db9){var _0x104290={'raw':![],'where':{}};var _0x2226d4={};var _0x14045d={'count':0x0,'rows':[]};return db[_0x102b('0x39')][_0x102b('0xbd')]({'where':{'id':_0x2939ff['params']['id']}})['then'](handleEntityNotFound(_0x28a5b6,null))['then'](function(_0x5500bc){if(_0x5500bc){_0x2226d4[_0x102b('0x3f')]=_['keys'](db[_0x102b('0xb9')][_0x102b('0x3a')]);_0x2226d4[_0x102b('0x3c')]=_[_0x102b('0x3d')](_0x2939ff[_0x102b('0x3c')]);_0x2226d4[_0x102b('0x47')]=_[_0x102b('0x3e')](_0x2226d4[_0x102b('0x3f')],_0x2226d4[_0x102b('0x3c')]);_0x104290[_0x102b('0x40')]=_[_0x102b('0x3e')](_0x2226d4[_0x102b('0x3f')],qs[_0x102b('0x9a')](_0x2939ff[_0x102b('0x3c')][_0x102b('0x9a')]));_0x104290['attributes']=_0x104290[_0x102b('0x40')]['length']?_0x104290[_0x102b('0x40')]:_0x2226d4[_0x102b('0x3f')];if(!_0x2939ff['query'][_0x102b('0x42')](_0x102b('0x43'))){_0x104290[_0x102b('0x25')]=qs[_0x102b('0x25')](_0x2939ff[_0x102b('0x3c')][_0x102b('0x25')]);_0x104290[_0x102b('0x23')]=qs[_0x102b('0x23')](_0x2939ff['query'][_0x102b('0x23')]);}_0x104290[_0x102b('0x44')]=qs[_0x102b('0x45')](_0x2939ff[_0x102b('0x3c')][_0x102b('0x45')]);_0x104290['where']=qs[_0x102b('0x47')](_[_0x102b('0x48')](_0x2939ff[_0x102b('0x3c')],_0x2226d4[_0x102b('0x47')]));_0x104290[_0x102b('0x46')]['SmsInteractionId']=_0x5500bc['id'];if(_0x2939ff[_0x102b('0x3c')][_0x102b('0x80')]){_0x104290['where']=_['merge'](_0x104290[_0x102b('0x46')],{'$or':_[_0x102b('0x32')](_0x104290[_0x102b('0x40')],function(_0x11a24a){var _0x2064ba={};_0x2064ba[_0x11a24a]={'$like':'%'+_0x2939ff[_0x102b('0x3c')]['filter']+'%'};return _0x2064ba;})});}if(_0x2939ff[_0x102b('0x3c')][_0x102b('0x76')]){var _0x12af5b=_0x2939ff[_0x102b('0x3c')]['$gte'][_0x102b('0x35')](',');var _0x5b0d82={};_0x5b0d82[_0x12af5b[0x0]]={'$gte':moment(_0x12af5b[0x1])['format'](_0x102b('0xbe'))};_0x104290[_0x102b('0x46')]=_[_0x102b('0x99')](_0x104290[_0x102b('0x46')],_0x5b0d82);}_0x104290=_['merge']({},_0x104290,_0x2939ff[_0x102b('0xb5')]);return db[_0x102b('0xb9')][_0x102b('0x26')]({'where':_0x104290['where']})['then'](function(_0x518c05){_0x14045d[_0x102b('0x26')]=_0x518c05;if(_0x2939ff[_0x102b('0x3c')][_0x102b('0xb4')]){_0x104290[_0x102b('0xbf')]=[{'all':!![]}];}return db[_0x102b('0xb9')][_0x102b('0xc0')](_0x104290);})['then'](function(_0x38ed4b){_0x14045d[_0x102b('0xb1')]=_0x38ed4b;return _0x14045d;});}})[_0x102b('0x2c')](respondWithFilteredResult(_0x28a5b6,_0x104290))[_0x102b('0x37')](handleError(_0x28a5b6,null));};exports[_0x102b('0xc1')]=function(_0x3247db,_0x310d04,_0x8078d0){return db[_0x102b('0x39')][_0x102b('0x61')]({'where':{'id':_0x3247db[_0x102b('0xb3')]['id']}})[_0x102b('0x2c')](handleEntityNotFound(_0x310d04,null))[_0x102b('0x2c')](function(_0x238629){if(_0x238629){return _0x238629[_0x102b('0xc2')](_0x3247db['body'][_0x102b('0xba')],_[_0x102b('0xbb')](_0x3247db[_0x102b('0x71')],[_0x102b('0xba'),'id'])||{})[_0x102b('0xc3')](function(){return db[_0x102b('0xc4')][_0x102b('0xc0')]({'attributes':['id',_0x102b('0x2f'),_0x102b('0x4b')],'where':{'id':_0x3247db[_0x102b('0x71')][_0x102b('0xba')]}});})[_0x102b('0x2c')](function(_0x41cf96){socket['emit'](_0x102b('0xc5'),{'id':Number(_0x3247db[_0x102b('0xb3')]['id']),'tags':_0x41cf96||[]});return{'id':Number(_0x3247db['params']['id']),'tags':_0x41cf96||[]};});}})[_0x102b('0x2c')](respondWithResult(_0x310d04,null))['catch'](handleError(_0x310d04,null));};exports[_0x102b('0xc6')]=function(_0x26ff39,_0x3fa4a5,_0x463c7c){return db['SmsInteraction'][_0x102b('0x61')]({'where':{'id':_0x26ff39[_0x102b('0xb3')]['id']}})[_0x102b('0x2c')](handleEntityNotFound(_0x3fa4a5,null))[_0x102b('0x2c')](function(_0x322534){if(_0x322534){return _0x322534[_0x102b('0xc6')](_0x26ff39['query']['ids']);}})[_0x102b('0x2c')](respondWithStatusCode(_0x3fa4a5,null))[_0x102b('0x37')](handleError(_0x3fa4a5,null));};exports['download']=function(_0x8015c,_0x47d5dc){var _0x5b2d82=moment()[_0x102b('0xc7')]()[_0x102b('0x97')]();var _0x1182a4=path[_0x102b('0xc8')](config[_0x102b('0xc9')],_0x102b('0xca'),_0x102b('0xcb'),_0x102b('0xcc'));var _0x5b46e2=path[_0x102b('0xc8')](config['root'],_0x102b('0xca'),_0x102b('0xcb'),_0x102b('0xcd'));var _0x39292b=path[_0x102b('0xc8')](_0x1182a4,_0x5b2d82);var _0xf1b984=util[_0x102b('0xce')]('transcript-%d-%s.zip',_0x8015c[_0x102b('0xb3')]['id'],_0x5b2d82);var _0x3544a8=path['join'](_0x1182a4,_0xf1b984);var _0x1328ae=[];_0x1328ae[_0x102b('0xcf')]({'model':db['User'],'as':'User','attributes':['id',_0x102b('0x33')],'raw':!![]});_0x1328ae[_0x102b('0xcf')]({'model':db[_0x102b('0xd0')],'as':'Contact','attributes':['id',_0x102b('0xd1'),_0x102b('0xd2')],'raw':!![]});var _0x12a4ff=[{'model':db['SmsMessage'],'as':_0x102b('0xd3'),'attributes':['id',_0x102b('0x71'),_0x102b('0x75'),_0x102b('0xd4'),_0x102b('0xd5'),'read'],'include':_0x1328ae}];_0x12a4ff[_0x102b('0xcf')]({'model':db['SmsAccount'],'as':'Account','attributes':['id',_0x102b('0x2f')]});_0x12a4ff['push']({'model':db[_0x102b('0xd6')],'as':_0x102b('0xd7'),'attributes':['id',_0x102b('0x33')]});return db[_0x102b('0x39')]['find']({'where':{'id':_0x8015c[_0x102b('0xb3')]['id']},'include':_0x12a4ff})[_0x102b('0x2c')](handleEntityNotFound(_0x47d5dc,null))[_0x102b('0x2c')](function(_0x2739e8){if(_0x2739e8){var _0x5947ed=_0x2739e8['get']({'plain':!![]});fs['mkdirSync'](_0x39292b);var _0x27fd06={'channel':_0x102b('0xd8'),'account':_0x5947ed[_0x102b('0xd9')][_0x102b('0x2f')],'agent':_0x5947ed[_0x102b('0xd7')]?_0x5947ed[_0x102b('0xd7')][_0x102b('0x33')]:_0x102b('0xda'),'createdAt':moment(_0x5947ed[_0x102b('0x75')])[_0x102b('0xce')]('YYYY-MM-DD\x20HH:mm:ss')[_0x102b('0x97')](),'closedAt':_0x5947ed['closed']?moment(_0x5947ed[_0x102b('0xdb')])[_0x102b('0xce')]('YYYY-MM-DD\x20HH:mm:ss')[_0x102b('0x97')]():'','disposition':_0x5947ed[_0x102b('0xdc')],'messages':_(_0x5947ed[_0x102b('0xd3')])['filter']({'secret':![]})[_0x102b('0x32')](function(_0x28080b){return{'date':moment(_0x28080b[_0x102b('0x75')])[_0x102b('0xce')](_0x102b('0xbe'))['toString'](),'sender':_0x28080b[_0x102b('0xd4')]===_0x102b('0xdd')?_0x28080b[_0x102b('0xd6')]?_0x28080b['User']['fullname']:_0x102b('0xde'):_0x28080b['Contact'][_0x102b('0xd1')]+(_0x28080b[_0x102b('0xdf')][_0x102b('0xd2')]?'\x20'+_0x28080b[_0x102b('0xdf')][_0x102b('0xd2')]:''),'body':_0x28080b[_0x102b('0x71')],'direction':_0x28080b[_0x102b('0xd4')]===_0x102b('0xdd')?'A':'C','secret':_0x28080b[_0x102b('0xd5')],'read':_0x28080b[_0x102b('0x7b')]};})[_0x102b('0x63')]()};return ejs['renderFile'](path[_0x102b('0xc8')](config[_0x102b('0xc9')],_0x102b('0xca'),_0x102b('0xe0'),_0x102b('0xe1')),{'interaction':_0x27fd06})[_0x102b('0x2c')](function(_0x56c872){var _0x32580d=path[_0x102b('0xc8')](_0x39292b,_0x102b('0xe2')+_0x5947ed['id']+'-'+_0x5b2d82+'.pdf');var _0x18cf17={'path':_0x32580d,'channel':_0x102b('0xd8'),'interactionId':_0x5947ed['id']};return pdf[_0x102b('0xe3')](_0x56c872,_0x18cf17);})['then'](function(){return new BPromise(function(_0x58b318,_0x3252b9){zipdir(_0x39292b,{'saveTo':_0x3544a8},function(_0x45b237,_0x3581c6){if(_0x45b237)return _0x3252b9(_0x45b237);return _0x58b318(_0x3581c6);});})[_0x102b('0x2c')](function(){return new BPromise(function(_0x50ccc6,_0x391730){rimraf(_0x39292b,function(_0x3f3e7e){if(_0x3f3e7e)_0x391730(_0x3f3e7e);return _0x50ccc6();});});})[_0x102b('0x2c')](function(){return _0x47d5dc[_0x102b('0xe4')](_0x3544a8,_0xf1b984,function(_0x1cd6d2){if(_0x1cd6d2){console['log']('err',_0x1cd6d2);}else{fs[_0x102b('0xe5')](_0x3544a8);}});});});}else{return _0x47d5dc[_0x102b('0x1f')](0xc8);}})[_0x102b('0x37')](handleError(_0x47d5dc,null));}; \ No newline at end of file +var _0xa4cc=['transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','fullname','Tags','TagIds','split','forEach','push','SmsInteraction','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20=\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','buildExpression','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','$gte','parse','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.SmsAccountId\x20IS\x20NOT\x20NULL','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','catch','show','merge','options','create','update','body','describe','addMessage','params','ids','omit','getMessages','findOne','SmsMessage','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','include','findAll','addTags','setTags','spread','color','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','firstName','Messages','createdAt','secret','SmsAccount','Account','Owner','Sms','N.A.','closed','disposition','direction','out','lastName','renderFile','downloadInteraction.ejs'];(function(_0x26f273,_0x3dfa89){var _0x27d38b=function(_0x509c97){while(--_0x509c97){_0x26f273['push'](_0x26f273['shift']());}};_0x27d38b(++_0x3dfa89);}(_0xa4cc,0xed));var _0xca4c=function(_0x5a225d,_0x50de4f){_0x5a225d=_0x5a225d-0x0;var _0x3b8bd2=_0xa4cc[_0x5a225d];return _0x3b8bd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca4c('0x0'));var zipdir=require(_0xca4c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca4c('0x2'));var moment=require(_0xca4c('0x3'));var BPromise=require(_0xca4c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xca4c('0x5'));var sox=require(_0xca4c('0x6'));var csv=require(_0xca4c('0x7'));var ejs=require(_0xca4c('0x8'));var fs=require('fs');var fs_extra=require(_0xca4c('0x9'));var _=require(_0xca4c('0xa'));var squel=require(_0xca4c('0xb'));var crypto=require('crypto');var jsforce=require(_0xca4c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xca4c('0x7'));var querystring=require(_0xca4c('0xd'));var Papa=require(_0xca4c('0xe'));var Redis=require(_0xca4c('0xf'));var authService=require(_0xca4c('0x10'));var qs=require(_0xca4c('0x11'));var as=require(_0xca4c('0x12'));var pdf=require(_0xca4c('0x13'));var hardwareService=require(_0xca4c('0x14'));var logger=require(_0xca4c('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xca4c('0x16'));var db=require(_0xca4c('0x17'))['db'];config[_0xca4c('0x18')]=_[_0xca4c('0x19')](config[_0xca4c('0x18')],{'host':_0xca4c('0x1a'),'port':0x18eb});var socket=require(_0xca4c('0x1b'))(new Redis(config[_0xca4c('0x18')]));require('./smsInteraction.socket')[_0xca4c('0x1c')](socket);function respondWithStatusCode(_0xdec45f,_0xd1a692){_0xd1a692=_0xd1a692||0xcc;return function(_0x1c6aee){if(_0x1c6aee){return _0xdec45f[_0xca4c('0x1d')](_0xd1a692);}return _0xdec45f[_0xca4c('0x1e')](_0xd1a692)[_0xca4c('0x1f')]();};}function respondWithResult(_0x5d04cf,_0x3ac47d){_0x3ac47d=_0x3ac47d||0xc8;return function(_0x1ba628){if(_0x1ba628){return _0x5d04cf[_0xca4c('0x1e')](_0x3ac47d)['json'](_0x1ba628);}};}function respondWithFilteredResult(_0x493be5,_0x261068){return function(_0x277dbf){if(_0x277dbf){var _0x19f814=typeof _0x261068[_0xca4c('0x20')]===_0xca4c('0x21')&&typeof _0x261068[_0xca4c('0x22')]===_0xca4c('0x21');var _0x39aa32=_0x277dbf[_0xca4c('0x23')];var _0x58a63d=_0x19f814?0x0:_0x261068['offset'];var _0x454be0=_0x19f814?_0x277dbf[_0xca4c('0x23')]:_0x261068[_0xca4c('0x20')]+_0x261068[_0xca4c('0x22')];var _0x3afdb2;if(_0x454be0>=_0x39aa32){_0x454be0=_0x39aa32;_0x3afdb2=0xc8;}else{_0x3afdb2=0xce;}_0x493be5[_0xca4c('0x1e')](_0x3afdb2);return _0x493be5[_0xca4c('0x24')](_0xca4c('0x25'),_0x58a63d+'-'+_0x454be0+'/'+_0x39aa32)[_0xca4c('0x26')](_0x277dbf);}return null;};}function patchUpdates(_0x43d339){return function(_0x4b1c6c){try{jsonpatch[_0xca4c('0x27')](_0x4b1c6c,_0x43d339,!![]);}catch(_0x7e41c8){return BPromise[_0xca4c('0x28')](_0x7e41c8);}return _0x4b1c6c[_0xca4c('0x29')]();};}function saveUpdates(_0x45cf72,_0x5285c8){return function(_0x463414){if(_0x463414){return _0x463414['update'](_0x45cf72)[_0xca4c('0x2a')](function(_0x506190){return _0x506190;});}return null;};}function removeEntity(_0x139207,_0x4a1f81){return function(_0x1947a0){if(_0x1947a0){return _0x1947a0[_0xca4c('0x2b')]()[_0xca4c('0x2a')](function(){_0x139207['status'](0xcc)[_0xca4c('0x1f')]();});}};}function handleEntityNotFound(_0x32a04d,_0x189815){return function(_0xfbd557){if(!_0xfbd557){_0x32a04d[_0xca4c('0x1d')](0x194);}return _0xfbd557;};}function handleError(_0xf4db43,_0x24a7e7){_0x24a7e7=_0x24a7e7||0x1f4;return function(_0x451db2){logger[_0xca4c('0x2c')](_0x451db2[_0xca4c('0x2d')]);if(_0x451db2[_0xca4c('0x2e')]){delete _0x451db2[_0xca4c('0x2e')];}_0xf4db43[_0xca4c('0x1e')](_0x24a7e7)[_0xca4c('0x2f')](_0x451db2);};}function getInteractionUsers(_0x315cee,_0x4cb8ac){return new BPromise(function(_0x29c188,_0x3e946b){try{if(_0x4cb8ac[_0x315cee['id']]){_0x315cee['Users']=_[_0xca4c('0x30')](_0x4cb8ac[_0x315cee['id']],function(_0x19efef){return{'id':_0x19efef['id'],'fullname':_0x19efef[_0xca4c('0x31')]};});}}catch(_0x3f4fd9){_0x3e946b(_0x3f4fd9);}_0x29c188(_0x315cee);});}function getInteractionTags(_0x23b4a1,_0x5f31b2){return new BPromise(function(_0x53070c,_0x4d1ba4){try{if(_0x23b4a1['TagIds']){_0x23b4a1[_0xca4c('0x32')]=[];_0x23b4a1[_0xca4c('0x33')][_0xca4c('0x34')](',')[_0xca4c('0x35')](function(_0x5dddc2){_0x23b4a1[_0xca4c('0x32')][_0xca4c('0x36')](_0x5f31b2[_0x5dddc2]);});}delete _0x23b4a1['TagIds'];}catch(_0x1c7244){_0x4d1ba4(_0x1c7244);}_0x53070c(_0x23b4a1);});}function updateSmsInteraction(_0xaed84a,_0x336df9,_0x1e1732){return new BPromise(function(_0x4232f9,_0x4040c1){return getInteractionUsers(_0xaed84a,_0x1e1732)[_0xca4c('0x2a')](function(_0x1b65f3){return getInteractionTags(_0x1b65f3,_0x336df9);})[_0xca4c('0x2a')](function(_0x25da69){_0x4232f9(_0x25da69);})['catch'](function(_0x129f88){_0x4040c1(_0x129f88);});});}exports['index']=function(_0x342c28,_0x340c64){var _0x467b78={},_0x284e7e={},_0x59dd2c={'count':0x0,'rows':[]};var _0xeb93ac=_[_0xca4c('0x30')](db[_0xca4c('0x37')][_0xca4c('0x38')],function(_0x515a84){return{'name':_0x515a84[_0xca4c('0x39')],'type':_0x515a84['type'][_0xca4c('0x3a')]};});_0x284e7e[_0xca4c('0x3b')]=_[_0xca4c('0x30')](_0xeb93ac,_0xca4c('0x2e'));_0x284e7e['query']=_[_0xca4c('0x3c')](_0x342c28[_0xca4c('0x3d')]);_0x284e7e[_0xca4c('0x3e')]=_[_0xca4c('0x3f')](_0x284e7e[_0xca4c('0x3b')],_0x284e7e[_0xca4c('0x3d')]);_0x467b78[_0xca4c('0x40')]=_[_0xca4c('0x3f')](_0x284e7e[_0xca4c('0x3b')],qs[_0xca4c('0x41')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x41')]));_0x467b78['attributes']=_0x467b78['attributes'][_0xca4c('0x42')]?_0x467b78[_0xca4c('0x40')]:_0x284e7e['model'];if(!_0x342c28[_0xca4c('0x3d')][_0xca4c('0x43')](_0xca4c('0x44'))){_0x467b78['limit']=qs['limit'](_0x342c28['query']['limit']);_0x467b78[_0xca4c('0x20')]=qs[_0xca4c('0x20')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x20')]);}_0x467b78[_0xca4c('0x45')]=qs['sort'](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x46')]);_0x467b78[_0xca4c('0x47')]=qs['filters'](_[_0xca4c('0x48')](_0x342c28[_0xca4c('0x3d')],_0x284e7e[_0xca4c('0x3e')]),_0xeb93ac);var _0x2016b7=[];var _0x5e4110=squel['select']()[_0xca4c('0x49')]('id')[_0xca4c('0x49')]('name')['field']('color')[_0xca4c('0x4a')](_0xca4c('0x4b'));var _0x28f77b=squel[_0xca4c('0x4c')]()[_0xca4c('0x49')](_0xca4c('0x4d'))[_0xca4c('0x49')](_0xca4c('0x4e'))[_0xca4c('0x49')](_0xca4c('0x4f'))['from'](_0xca4c('0x50'),'ui')[_0xca4c('0x51')]('users','u',_0xca4c('0x52'));var _0x4ac49f=squel[_0xca4c('0x4c')]()[_0xca4c('0x4a')]('sms_interactions','i')[_0xca4c('0x51')](_0xca4c('0x53'),'c',_0xca4c('0x54'))[_0xca4c('0x51')](_0xca4c('0x55'),'o',_0xca4c('0x56'))['left_join'](_0xca4c('0x57'),'a','a.id\x20=\x20i.SmsAccountId')['left_join'](_0xca4c('0x58'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xca4c('0x51')]('sms_interaction_has_tags','it',_0xca4c('0x59'))[_0xca4c('0x51')](_0xca4c('0x4b'),'t',_0xca4c('0x5a'));var _0x1c609a=squel[_0xca4c('0x5b')]();var _0x1723d1=[];var _0x5c72bb=squel[_0xca4c('0x5b')]();var _0x2e33ab;if(_0x342c28['query']['search']){_0x2e33ab=as[_0xca4c('0x5c')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x5d')]);var _0x5426c2=_0x2e33ab[_0xca4c('0x5e')];for(var _0xa32c56=0x0;_0xa32c56<_0x2e33ab['conditions'][_0xca4c('0x42')];_0xa32c56++){var _0x32dc15=_0x2e33ab[_0xca4c('0x5f')][_0xa32c56];var _0x4447db='i';var _0x2bd313=_[_0xca4c('0x60')](_0xeb93ac,[_0xca4c('0x2e'),_0x32dc15[_0xca4c('0x49')]]);if(!_0x2bd313){switch(_0x32dc15['field']){case'unreadMessages':if(_0x32dc15[_0xca4c('0x61')]==0x1){_0x4ac49f[_0xca4c('0x62')]('`'+_0x32dc15[_0xca4c('0x49')]+_0xca4c('0x63'));}else{_0x4ac49f[_0xca4c('0x62')]('`'+_0x32dc15[_0xca4c('0x49')]+'`\x20>\x200');}break;case _0xca4c('0x64'):if(_0x32dc15[_0xca4c('0x65')]==='$substring'){if(_0x32dc15[_0xca4c('0x61')]['split']('\x20')[_0xca4c('0x42')]>0x1){_0x1c609a[_0x5426c2](_0xca4c('0x66'),qs['getFullTextValue'](_0x32dc15[_0xca4c('0x61')]),null);}else{var _0x19c71d='%'+_0x32dc15[_0xca4c('0x61')]+'%';_0x1c609a[_0x5426c2]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x19c71d,_0x19c71d,_0x19c71d);}}else{_0x2bd313=_['find'](_0xeb93ac,[_0xca4c('0x2e'),_0xca4c('0x67')]);_0x32dc15[_0xca4c('0x49')]=_0xca4c('0x67');_0x1b819d=as['buildExpression'](_0x4447db,_0x2bd313['type'],_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d[_0xca4c('0x68')],_0x1b819d['value'][_0xca4c('0x69')],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x1f')]);}break;case _0xca4c('0x6a'):var _0x119854=_0x32dc15[_0xca4c('0x61')][_0xca4c('0x34')](',')['map'](function(_0x14a85d){return Number(_0x14a85d);});_0x119854[_0xca4c('0x35')](function(_0x223191){_0x5c72bb['or'](_0xca4c('0x6b'),'%,'+_0x223191+',%');});_0x1723d1=_[_0xca4c('0x6c')](_0x1723d1,_0x119854);break;case'User':if(_0x32dc15[_0xca4c('0x65')]===_0xca4c('0x6d')){_0x1c609a[_0x5426c2](_0xca4c('0x6e'),'%'+_0x32dc15[_0xca4c('0x61')]+'%',null);}else{_0x2bd313=_[_0xca4c('0x60')](_0xeb93ac,[_0xca4c('0x2e'),_0xca4c('0x6f')]);_0x32dc15['field']=_0xca4c('0x6f');_0x1b819d=as['buildExpression'](_0x4447db,_0x2bd313[_0xca4c('0x70')],_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d['text'],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x69')],_0x1b819d['value'][_0xca4c('0x1f')]);}break;case'body':_0x1b819d=as['buildExpression']('me',null,_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d[_0xca4c('0x68')],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x69')],_0x1b819d[_0xca4c('0x61')][_0xca4c('0x1f')]);break;}}else{var _0x1b819d=as[_0xca4c('0x71')](_0x4447db,_0x2bd313[_0xca4c('0x70')],_0x32dc15);_0x1c609a[_0x5426c2](_0x1b819d[_0xca4c('0x68')],_0x1b819d[_0xca4c('0x61')]['start'],_0x1b819d['value'][_0xca4c('0x1f')]);}}}else{var _0x3a0f39=_(_0x342c28[_0xca4c('0x3d')])[_0xca4c('0x3c')]()[_0xca4c('0x30')](function(_0x2be28e){return _[_0xca4c('0x72')](_0xeb93ac,[_0xca4c('0x2e'),_0x2be28e])?_0x2be28e:undefined;})[_0xca4c('0x73')]()[_0xca4c('0x61')]();if(!_[_0xca4c('0x74')](_0x3a0f39)){_0x3a0f39[_0xca4c('0x35')](function(_0x3b0d26){if(_0x3b0d26===_0xca4c('0x75')){_0x4ac49f['where'](_0xca4c('0x76'),[]['concat'](_0x342c28['query'][_0x3b0d26]));}else if(_0x3b0d26==='createdAt'){var _0x1311ff=JSON['parse'](_0x342c28[_0xca4c('0x3d')][_0x3b0d26])[_0xca4c('0x77')];var _0x51f67e=JSON[_0xca4c('0x78')](_0x342c28[_0xca4c('0x3d')][_0x3b0d26])['$lte'];_0x4ac49f[_0xca4c('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1311ff,_0x51f67e);}else{if(_0x342c28[_0xca4c('0x3d')][_0x3b0d26]===_0xca4c('0x79')){_0x4ac49f['where']('i.'+_0x3b0d26+_0xca4c('0x7a'));}else{_0x4ac49f[_0xca4c('0x47')]('i.'+_0x3b0d26+'\x20=\x20?',_0x342c28[_0xca4c('0x3d')][_0x3b0d26]);}}});}if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x7b')]){if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x7b')]==0x1){_0x4ac49f[_0xca4c('0x62')](_0xca4c('0x7c'));}else{_0x4ac49f[_0xca4c('0x62')](_0xca4c('0x7d'));}}if(_0x342c28['query'][_0xca4c('0x7e')]){_0x1723d1=_[_0xca4c('0x7f')](_0x342c28[_0xca4c('0x3d')][_0xca4c('0x7e')])?_0x342c28['query']['tag']:new Array(_0x342c28[_0xca4c('0x3d')]['tag']);_0x1723d1['forEach'](function(_0x169432){_0x5c72bb['or'](_0xca4c('0x6b'),'%,'+_0x169432+',%');});}if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x80')]){var _0x283f01=_0x342c28['query']['filter'][_0xca4c('0x81')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x283f01)){_0x1c609a['or']('i.id\x20LIKE\x20?',_0x283f01+'%')['or'](_0xca4c('0x82'),_0x283f01+'%');}else{_0x1c609a['or'](_0xca4c('0x83'),qs[_0xca4c('0x84')](_0x283f01))['or'](_0xca4c('0x85'),_0x283f01+'%');}}}_0x4ac49f[_0xca4c('0x47')](_0x1c609a);_0x4ac49f['group']('i.id');var _0x4d1e09={'type':db[_0xca4c('0x86')][_0xca4c('0x87')][_0xca4c('0x88')],'raw':!![]};var _0x4328f1=_0x4ac49f[_0xca4c('0x89')]();_0x4328f1[_0xca4c('0x49')](_0xca4c('0x8a'));_0x4328f1[_0xca4c('0x49')](_0xca4c('0x8b'),_0xca4c('0x8c'));if(_0x467b78[_0xca4c('0x45')]){_0x467b78['order'][_0xca4c('0x35')](function(_0x55f7bd){var _0x838133=_0x55f7bd[0x0]===_0xca4c('0x8d')?_0x55f7bd[0x0]:'i.'+_0x55f7bd[0x0];_0x4ac49f[_0xca4c('0x45')](_0x838133,_0x55f7bd[0x1]===_0xca4c('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x1723d1)){_0x4ac49f[_0xca4c('0x62')](_0x5c72bb);_0x4328f1[_0xca4c('0x47')]('t.id\x20IN\x20?',_0x1723d1);}BPromise['resolve']()[_0xca4c('0x2a')](function(){if(!_0x2e33ab){if(_0x342c28[_0xca4c('0x3d')]['SmsAccountId'])return;_0x4328f1[_0xca4c('0x47')](_0xca4c('0x8f'));_0x4ac49f[_0xca4c('0x47')](_0xca4c('0x8f'));return;}if(_0x342c28['user']['role']!==_0xca4c('0x90'))return;return _0x342c28[_0xca4c('0x91')][_0xca4c('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2aaa0c){if(_[_0xca4c('0x74')](_0x2aaa0c)){_0x4328f1[_0xca4c('0x47')](_0xca4c('0x93'));_0x4ac49f[_0xca4c('0x47')](_0xca4c('0x93'));}else{_0x4328f1[_0xca4c('0x47')](_0xca4c('0x76'),_[_0xca4c('0x30')](_0x2aaa0c,'id'));_0x4ac49f['where'](_0xca4c('0x76'),_[_0xca4c('0x30')](_0x2aaa0c,'id'));}});})['then'](function(){if(_0x342c28[_0xca4c('0x91')]['role']===_0xca4c('0x90')&&!_0x2e33ab&&!_0x342c28['query'][_0xca4c('0x75')])return[];return db[_0xca4c('0x94')][_0xca4c('0x3d')](_0x4328f1[_0xca4c('0x95')](),_0x4d1e09);})[_0xca4c('0x2a')](function(_0x9217ea){_0x59dd2c[_0xca4c('0x23')]=_0x9217ea[_0xca4c('0x42')];if(_0x59dd2c[_0xca4c('0x23')]===0x0)return[];return db[_0xca4c('0x94')]['query'](_0x5e4110[_0xca4c('0x95')](),_0x4d1e09)[_0xca4c('0x2a')](function(_0x45a488){_0x2016b7=_[_0xca4c('0x96')](_0x45a488,'id');_0x4d1e09=_['merge'](_0x4d1e09,{'model':db[_0xca4c('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x342c28[_0xca4c('0x3d')][_0xca4c('0x41')]){_0x467b78['attributes'][_0xca4c('0x35')](function(_0xea649b){_0x4ac49f[_0xca4c('0x49')]('i.'+_0xea649b);});}else{_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x8b'),'unreadMessages');_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x97'),_0xca4c('0x98'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x99'),_0xca4c('0x9a'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x9b'),'contactName');_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x9c'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0x9d'),_0xca4c('0x9e'));_0x4ac49f[_0xca4c('0x49')]('c.lastName',_0xca4c('0x9f'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa0'),_0xca4c('0xa1'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa2'),_0xca4c('0xa3'));_0x4ac49f['field']('c.mobile','Contact.mobile');_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa4'),_0xca4c('0xa5'));_0x4ac49f['field'](_0xca4c('0xa6'),_0xca4c('0xa7'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xa8'),_0xca4c('0xa9'));_0x4ac49f[_0xca4c('0x49')](_0xca4c('0xaa'),_0xca4c('0x33'));}if(_0x467b78[_0xca4c('0x22')])_0x4ac49f[_0xca4c('0x22')](_0x467b78['limit']);if(_0x467b78[_0xca4c('0x20')])_0x4ac49f[_0xca4c('0x20')](_0x467b78[_0xca4c('0x20')]);return db[_0xca4c('0x94')]['query'](_0x4ac49f[_0xca4c('0x95')](),_0x4d1e09);})[_0xca4c('0x2a')](function(_0x3ba66d){if(_0x3ba66d['length']>0x0)_0x28f77b[_0xca4c('0x47')](_0xca4c('0xab'),_[_0xca4c('0x30')](_0x3ba66d,'id'));return db['sequelize']['query'](_0x28f77b['toString'](),_0x4d1e09)[_0xca4c('0x2a')](function(_0x1ae1c2){var _0x5a5cfd=_['groupBy'](_0x1ae1c2,_0xca4c('0xac'));var _0x423447=[];_0x3ba66d['forEach'](function(_0x13f125){_0x423447['push'](updateSmsInteraction(_0x13f125,_0x2016b7,_0x5a5cfd));});return BPromise[_0xca4c('0xad')](_0x423447);});});})[_0xca4c('0x2a')](function(_0x4577fb){_0x59dd2c['rows']=_0x4577fb;return _0x59dd2c;})['then'](respondWithFilteredResult(_0x340c64,_0x467b78))[_0xca4c('0xae')](handleError(_0x340c64,null));};exports[_0xca4c('0xaf')]=function(_0x2fd802,_0x2d4e23){var _0x681d17={'raw':![],'where':{'id':_0x2fd802['params']['id']}},_0x520e8a={};_0x520e8a[_0xca4c('0x3b')]=_[_0xca4c('0x3c')](db['SmsInteraction'][_0xca4c('0x38')]);_0x520e8a['query']=_[_0xca4c('0x3c')](_0x2fd802[_0xca4c('0x3d')]);_0x520e8a[_0xca4c('0x3e')]=_[_0xca4c('0x3f')](_0x520e8a[_0xca4c('0x3b')],_0x520e8a[_0xca4c('0x3d')]);_0x681d17[_0xca4c('0x40')]=_['intersection'](_0x520e8a[_0xca4c('0x3b')],qs[_0xca4c('0x41')](_0x2fd802[_0xca4c('0x3d')]['fields']));_0x681d17[_0xca4c('0x40')]=_0x681d17[_0xca4c('0x40')][_0xca4c('0x42')]?_0x681d17[_0xca4c('0x40')]:_0x520e8a[_0xca4c('0x3b')];if(_0x2fd802['query']['includeAll']){_0x681d17['include']=[{'all':!![]}];}_0x681d17=_[_0xca4c('0xb0')]({},_0x681d17,_0x2fd802[_0xca4c('0xb1')]);return db[_0xca4c('0x37')][_0xca4c('0x60')](_0x681d17)[_0xca4c('0x2a')](handleEntityNotFound(_0x2d4e23,null))[_0xca4c('0x2a')](respondWithResult(_0x2d4e23,null))[_0xca4c('0xae')](handleError(_0x2d4e23,null));};exports[_0xca4c('0xb2')]=function(_0x1efb80,_0x2bb9e9){return db[_0xca4c('0x37')]['create'](_0x1efb80['body'],{})[_0xca4c('0x2a')](respondWithResult(_0x2bb9e9,0xc9))[_0xca4c('0xae')](handleError(_0x2bb9e9,null));};exports[_0xca4c('0xb3')]=function(_0x1fc26c,_0x1d996d){if(_0x1fc26c[_0xca4c('0xb4')]['id']){delete _0x1fc26c['body']['id'];}return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x1fc26c['params']['id']}})['then'](handleEntityNotFound(_0x1d996d,null))[_0xca4c('0x2a')](saveUpdates(_0x1fc26c[_0xca4c('0xb4')],null))[_0xca4c('0x2a')](respondWithResult(_0x1d996d,null))[_0xca4c('0xae')](handleError(_0x1d996d,null));};exports[_0xca4c('0x2b')]=function(_0x139272,_0x531b1b){return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x139272['params']['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0x531b1b,null))[_0xca4c('0x2a')](removeEntity(_0x531b1b,null))[_0xca4c('0xae')](handleError(_0x531b1b,null));};exports[_0xca4c('0xb5')]=function(_0x46b9f3,_0x3f16d1){return db['SmsInteraction']['describe']()['then'](respondWithResult(_0x3f16d1,null))[_0xca4c('0xae')](handleError(_0x3f16d1,null));};exports[_0xca4c('0xb6')]=function(_0x1b3b10,_0x3f17a3,_0xb6a7e1){return db['SmsMessage'][_0xca4c('0x60')]({'where':{'id':_0x1b3b10[_0xca4c('0xb7')]['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0x3f17a3,null))[_0xca4c('0x2a')](function(_0x1d656a){if(_0x1d656a){return _0x1d656a[_0xca4c('0xb6')](_0x1b3b10[_0xca4c('0xb4')][_0xca4c('0xb8')],_[_0xca4c('0xb9')](_0x1b3b10[_0xca4c('0xb4')],['ids','id'])||{});}})[_0xca4c('0x2a')](respondWithResult(_0x3f17a3,null))[_0xca4c('0xae')](handleError(_0x3f17a3,null));};exports[_0xca4c('0xba')]=function(_0x16673f,_0x20d702,_0x2175a9){var _0x1a751a={'raw':![],'where':{}};var _0x1658fe={};var _0x42d061={'count':0x0,'rows':[]};return db[_0xca4c('0x37')][_0xca4c('0xbb')]({'where':{'id':_0x16673f[_0xca4c('0xb7')]['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0x20d702,null))[_0xca4c('0x2a')](function(_0x2d58b4){if(_0x2d58b4){_0x1658fe['model']=_[_0xca4c('0x3c')](db[_0xca4c('0xbc')][_0xca4c('0x38')]);_0x1658fe[_0xca4c('0x3d')]=_[_0xca4c('0x3c')](_0x16673f[_0xca4c('0x3d')]);_0x1658fe[_0xca4c('0x3e')]=_[_0xca4c('0x3f')](_0x1658fe[_0xca4c('0x3b')],_0x1658fe[_0xca4c('0x3d')]);_0x1a751a[_0xca4c('0x40')]=_[_0xca4c('0x3f')](_0x1658fe[_0xca4c('0x3b')],qs[_0xca4c('0x41')](_0x16673f[_0xca4c('0x3d')][_0xca4c('0x41')]));_0x1a751a[_0xca4c('0x40')]=_0x1a751a['attributes']['length']?_0x1a751a[_0xca4c('0x40')]:_0x1658fe[_0xca4c('0x3b')];if(!_0x16673f[_0xca4c('0x3d')][_0xca4c('0x43')](_0xca4c('0x44'))){_0x1a751a['limit']=qs[_0xca4c('0x22')](_0x16673f[_0xca4c('0x3d')][_0xca4c('0x22')]);_0x1a751a[_0xca4c('0x20')]=qs[_0xca4c('0x20')](_0x16673f[_0xca4c('0x3d')]['offset']);}_0x1a751a[_0xca4c('0x45')]=qs['sort'](_0x16673f[_0xca4c('0x3d')][_0xca4c('0x46')]);_0x1a751a[_0xca4c('0x47')]=qs[_0xca4c('0x3e')](_[_0xca4c('0x48')](_0x16673f[_0xca4c('0x3d')],_0x1658fe[_0xca4c('0x3e')]));_0x1a751a[_0xca4c('0x47')][_0xca4c('0xac')]=_0x2d58b4['id'];if(_0x16673f['query']['filter']){_0x1a751a['where']=_['merge'](_0x1a751a[_0xca4c('0x47')],{'$or':_[_0xca4c('0x30')](_0x1a751a['attributes'],function(_0x16d131){var _0x32910e={};_0x32910e[_0x16d131]={'$like':'%'+_0x16673f[_0xca4c('0x3d')][_0xca4c('0x80')]+'%'};return _0x32910e;})});}if(_0x16673f[_0xca4c('0x3d')][_0xca4c('0x77')]){var _0x28fcf1=_0x16673f[_0xca4c('0x3d')]['$gte'][_0xca4c('0x34')](',');var _0x5b86cd={};_0x5b86cd[_0x28fcf1[0x0]]={'$gte':moment(_0x28fcf1[0x1])[_0xca4c('0xbd')](_0xca4c('0xbe'))};_0x1a751a[_0xca4c('0x47')]=_[_0xca4c('0xb0')](_0x1a751a['where'],_0x5b86cd);}_0x1a751a=_['merge']({},_0x1a751a,_0x16673f[_0xca4c('0xb1')]);return db[_0xca4c('0xbc')][_0xca4c('0x23')]({'where':_0x1a751a[_0xca4c('0x47')]})[_0xca4c('0x2a')](function(_0x3d5c26){_0x42d061['count']=_0x3d5c26;if(_0x16673f[_0xca4c('0x3d')][_0xca4c('0xbf')]){_0x1a751a[_0xca4c('0xc0')]=[{'all':!![]}];}return db[_0xca4c('0xbc')][_0xca4c('0xc1')](_0x1a751a);})[_0xca4c('0x2a')](function(_0x2fcaca){_0x42d061['rows']=_0x2fcaca;return _0x42d061;});}})[_0xca4c('0x2a')](respondWithFilteredResult(_0x20d702,_0x1a751a))[_0xca4c('0xae')](handleError(_0x20d702,null));};exports[_0xca4c('0xc2')]=function(_0x186129,_0x54bcc3,_0x7bdcc6){return db['SmsInteraction']['find']({'where':{'id':_0x186129[_0xca4c('0xb7')]['id']}})['then'](handleEntityNotFound(_0x54bcc3,null))[_0xca4c('0x2a')](function(_0x532a00){if(_0x532a00){return _0x532a00[_0xca4c('0xc3')](_0x186129[_0xca4c('0xb4')][_0xca4c('0xb8')],_[_0xca4c('0xb9')](_0x186129[_0xca4c('0xb4')],[_0xca4c('0xb8'),'id'])||{})[_0xca4c('0xc4')](function(){return db[_0xca4c('0x6a')][_0xca4c('0xc1')]({'attributes':['id',_0xca4c('0x2e'),_0xca4c('0xc5')],'where':{'id':_0x186129[_0xca4c('0xb4')][_0xca4c('0xb8')]}});})[_0xca4c('0x2a')](function(_0x3838db){socket['emit'](_0xca4c('0xc6'),{'id':Number(_0x186129[_0xca4c('0xb7')]['id']),'tags':_0x3838db||[]});return{'id':Number(_0x186129['params']['id']),'tags':_0x3838db||[]};});}})[_0xca4c('0x2a')](respondWithResult(_0x54bcc3,null))[_0xca4c('0xae')](handleError(_0x54bcc3,null));};exports[_0xca4c('0xc7')]=function(_0x2039e1,_0xbf46be,_0x1ffa8a){return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x2039e1[_0xca4c('0xb7')]['id']}})[_0xca4c('0x2a')](handleEntityNotFound(_0xbf46be,null))[_0xca4c('0x2a')](function(_0x34d303){if(_0x34d303){return _0x34d303[_0xca4c('0xc7')](_0x2039e1['query'][_0xca4c('0xb8')]);}})[_0xca4c('0x2a')](respondWithStatusCode(_0xbf46be,null))['catch'](handleError(_0xbf46be,null));};exports[_0xca4c('0xc8')]=function(_0x4c522e,_0x350b7f){var _0x2dcd57=moment()[_0xca4c('0xc9')]()[_0xca4c('0x95')]();var _0x4b250d=path[_0xca4c('0xca')](config[_0xca4c('0xcb')],_0xca4c('0xcc'),_0xca4c('0xcd'),_0xca4c('0xce'));var _0x2579a7=path[_0xca4c('0xca')](config[_0xca4c('0xcb')],'server',_0xca4c('0xcd'),_0xca4c('0xcf'));var _0x50c271=path[_0xca4c('0xca')](_0x4b250d,_0x2dcd57);var _0x444607=util[_0xca4c('0xbd')](_0xca4c('0xd0'),_0x4c522e[_0xca4c('0xb7')]['id'],_0x2dcd57);var _0x455f77=path[_0xca4c('0xca')](_0x4b250d,_0x444607);var _0x4b0724=[];_0x4b0724[_0xca4c('0x36')]({'model':db['User'],'as':_0xca4c('0xd1'),'attributes':['id',_0xca4c('0x31')],'raw':!![]});_0x4b0724[_0xca4c('0x36')]({'model':db[_0xca4c('0xd2')],'as':_0xca4c('0x64'),'attributes':['id',_0xca4c('0xd3'),'lastName'],'raw':!![]});var _0x4071aa=[{'model':db[_0xca4c('0xbc')],'as':_0xca4c('0xd4'),'attributes':['id',_0xca4c('0xb4'),_0xca4c('0xd5'),'direction',_0xca4c('0xd6'),_0xca4c('0x7b')],'include':_0x4b0724}];_0x4071aa['push']({'model':db[_0xca4c('0xd7')],'as':_0xca4c('0xd8'),'attributes':['id','name']});_0x4071aa[_0xca4c('0x36')]({'model':db[_0xca4c('0xd1')],'as':_0xca4c('0xd9'),'attributes':['id',_0xca4c('0x31')]});return db[_0xca4c('0x37')][_0xca4c('0x60')]({'where':{'id':_0x4c522e[_0xca4c('0xb7')]['id']},'include':_0x4071aa})[_0xca4c('0x2a')](handleEntityNotFound(_0x350b7f,null))[_0xca4c('0x2a')](function(_0x2402d1){if(_0x2402d1){var _0x2439df=_0x2402d1['get']({'plain':!![]});fs['mkdirSync'](_0x50c271);var _0x473654={'channel':_0xca4c('0xda'),'account':_0x2439df[_0xca4c('0xd8')][_0xca4c('0x2e')],'agent':_0x2439df[_0xca4c('0xd9')]?_0x2439df[_0xca4c('0xd9')]['fullname']:_0xca4c('0xdb'),'createdAt':moment(_0x2439df['createdAt'])[_0xca4c('0xbd')](_0xca4c('0xbe'))[_0xca4c('0x95')](),'closedAt':_0x2439df[_0xca4c('0xdc')]?moment(_0x2439df['closedAt'])[_0xca4c('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')[_0xca4c('0x95')]():'','disposition':_0x2439df[_0xca4c('0xdd')],'messages':_(_0x2439df[_0xca4c('0xd4')])['filter']({'secret':![]})[_0xca4c('0x30')](function(_0x463826){return{'date':moment(_0x463826[_0xca4c('0xd5')])[_0xca4c('0xbd')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x463826[_0xca4c('0xde')]===_0xca4c('0xdf')?_0x463826[_0xca4c('0xd1')]?_0x463826['User'][_0xca4c('0x31')]:'System':_0x463826['Contact'][_0xca4c('0xd3')]+(_0x463826[_0xca4c('0x64')][_0xca4c('0xe0')]?'\x20'+_0x463826['Contact'][_0xca4c('0xe0')]:''),'body':_0x463826['body'],'direction':_0x463826['direction']===_0xca4c('0xdf')?'A':'C','secret':_0x463826[_0xca4c('0xd6')],'read':_0x463826[_0xca4c('0x7b')]};})[_0xca4c('0x61')]()};return ejs[_0xca4c('0xe1')](path['join'](config[_0xca4c('0xcb')],_0xca4c('0xcc'),'views',_0xca4c('0xe2')),{'interaction':_0x473654})[_0xca4c('0x2a')](function(_0x14a0ca){var _0x3762de=path[_0xca4c('0xca')](_0x50c271,_0xca4c('0xe3')+_0x2439df['id']+'-'+_0x2dcd57+_0xca4c('0xe4'));var _0x2d2616={'path':_0x3762de,'channel':_0xca4c('0xda'),'interactionId':_0x2439df['id']};return pdf['createPdfFromHTML'](_0x14a0ca,_0x2d2616);})[_0xca4c('0x2a')](function(){return new BPromise(function(_0x44a698,_0xd969fb){zipdir(_0x50c271,{'saveTo':_0x455f77},function(_0x12a7da,_0xe28066){if(_0x12a7da)return _0xd969fb(_0x12a7da);return _0x44a698(_0xe28066);});})[_0xca4c('0x2a')](function(){return new BPromise(function(_0x5c5358,_0x5875a3){rimraf(_0x50c271,function(_0x24a4e7){if(_0x24a4e7)_0x5875a3(_0x24a4e7);return _0x5c5358();});});})[_0xca4c('0x2a')](function(){return _0x350b7f[_0xca4c('0xc8')](_0x455f77,_0x444607,function(_0x41f6d1){if(_0x41f6d1){console[_0xca4c('0xe5')](_0xca4c('0xe6'),_0x41f6d1);}else{fs[_0xca4c('0xe7')](_0x455f77);}});});});}else{return _0x350b7f['sendStatus'](0xc8);}})[_0xca4c('0xae')](handleError(_0x350b7f,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 5b20a62..5668170 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 _0x25e7=['hasOwnProperty','hook','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x1e03e4,_0x362f76){var _0x4a887e=function(_0x13f548){while(--_0x13f548){_0x1e03e4['push'](_0x1e03e4['shift']());}};_0x4a887e(++_0x362f76);}(_0x25e7,0x1d6));var _0x725e=function(_0x3865ea,_0x45f818){_0x3865ea=_0x3865ea-0x0;var _0x9845a6=_0x25e7[_0x3865ea];return _0x9845a6;};'use strict';var EventEmitter=require(_0x725e('0x0'));var SmsInteraction=require(_0x725e('0x1'))['db'][_0x725e('0x2')];var SmsMessage=require(_0x725e('0x1'))['db'][_0x725e('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x725e('0x4')](0x0);var events={'afterCreate':_0x725e('0x5'),'afterUpdate':_0x725e('0x6'),'afterDestroy':_0x725e('0x7')};function emitEvent(_0x3da706){return function(_0x493364,_0x5e17a9,_0x2497a5){_0x493364['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x111a50){_0x493364[_0x725e('0x8')](_0x725e('0x9'),_0x111a50[_0x725e('0xa')](function(_0x40d238){return{'id':_0x40d238['id']};}));return SmsMessage[_0x725e('0xb')]({'where':{'SmsInteractionId':_0x493364['id'],'direction':'in','read':![]},'raw':!![]});})[_0x725e('0xc')](function(_0x7c40ff){_0x493364[_0x725e('0x8')](_0x725e('0xd'),_0x7c40ff[_0x725e('0xe')]);SmsInteractionEvents[_0x725e('0xf')](_0x3da706+':'+_0x493364['id'],_0x493364);SmsInteractionEvents['emit'](_0x3da706,_0x493364);_0x2497a5(null);})['catch'](_0x2497a5(null));};}for(var e in events){if(events[_0x725e('0x10')](e)){var event=events[e];SmsInteraction[_0x725e('0x11')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x36ee=['getUsers','then','Users','findAll','setDataValue','length','emit','catch','hasOwnProperty','hook','exports','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x551b51,_0x2b0479){var _0x49a306=function(_0x52572c){while(--_0x52572c){_0x551b51['push'](_0x551b51['shift']());}};_0x49a306(++_0x2b0479);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0xe36e('0x0')];var SmsMessage=require('../../mysqldb')['db'][_0xe36e('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xe36e('0x2')](0x0);var events={'afterCreate':_0xe36e('0x3'),'afterUpdate':_0xe36e('0x4'),'afterDestroy':_0xe36e('0x5')};function emitEvent(_0x1118af){return function(_0x29e692,_0x3f29e1,_0x25a07d){_0x29e692[_0xe36e('0x6')]({'attributes':['id'],'raw':!![]})[_0xe36e('0x7')](function(_0x1aa596){_0x29e692['setDataValue'](_0xe36e('0x8'),_0x1aa596['map'](function(_0x2236e9){return{'id':_0x2236e9['id']};}));return SmsMessage[_0xe36e('0x9')]({'where':{'SmsInteractionId':_0x29e692['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe36e('0x7')](function(_0x47ce3a){_0x29e692[_0xe36e('0xa')]('unreadMessages',_0x47ce3a[_0xe36e('0xb')]);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af+':'+_0x29e692['id'],_0x29e692);SmsInteractionEvents[_0xe36e('0xc')](_0x1118af,_0x29e692);_0x25a07d(null);})[_0xe36e('0xd')](_0x25a07d(null));};}for(var e in events){if(events[_0xe36e('0xe')](e)){var event=events[e];SmsInteraction[_0xe36e('0xf')](e,emitEvent(event));}}module[_0xe36e('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 56130fc..b3a394b 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 _0xa600=['closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsInteraction','changed'];(function(_0x1c3217,_0x3c6540){var _0x232c81=function(_0x515916){while(--_0x515916){_0x1c3217['push'](_0x1c3217['shift']());}};_0x232c81(++_0x3c6540);}(_0xa600,0x83));var _0x0a60=function(_0x8560d3,_0x26a504){_0x8560d3=_0x8560d3-0x0;var _0x33b1b5=_0xa600[_0x8560d3];return _0x33b1b5;};'use strict';var _=require(_0x0a60('0x0'));var util=require(_0x0a60('0x1'));var logger=require(_0x0a60('0x2'))(_0x0a60('0x3'));var moment=require(_0x0a60('0x4'));var BPromise=require(_0x0a60('0x5'));var rp=require(_0x0a60('0x6'));var fs=require('fs');var path=require(_0x0a60('0x7'));var rimraf=require(_0x0a60('0x8'));var config=require(_0x0a60('0x9'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x3c8dc5,_0x2f7ae8){return _0x3c8dc5[_0x0a60('0xa')](_0x0a60('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x365d99,_0x788653,_0x308037){if(_0x365d99[_0x0a60('0xc')](_0x0a60('0xd'))){_0x365d99[_0x0a60('0xe')]=moment()['format'](_0x0a60('0xf'));}_0x308037(null,_0x365d99);}}});}; \ No newline at end of file +var _0xe328=['api','moment','bluebird','path','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x2fc422,_0x9a8b25){var _0x10453a=function(_0x5c5c81){while(--_0x5c5c81){_0x2fc422['push'](_0x2fc422['shift']());}};_0x10453a(++_0x9a8b25);}(_0xe328,0x19d));var _0x8e32=function(_0x172c5e,_0x2ab13a){_0x172c5e=_0x172c5e-0x0;var _0x396cec=_0xe328[_0x172c5e];return _0x396cec;};'use strict';var _=require(_0x8e32('0x0'));var util=require(_0x8e32('0x1'));var logger=require(_0x8e32('0x2'))(_0x8e32('0x3'));var moment=require(_0x8e32('0x4'));var BPromise=require(_0x8e32('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e32('0x6'));var rimraf=require('rimraf');var config=require(_0x8e32('0x7'));var attributes=require(_0x8e32('0x8'));module['exports']=function(_0x4cd5c2,_0x268b91){return _0x4cd5c2[_0x8e32('0x9')](_0x8e32('0xa'),attributes,{'tableName':_0x8e32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ebc0e,_0x596818,_0x48be00){if(_0x4ebc0e[_0x8e32('0xc')](_0x8e32('0xd'))){_0x4ebc0e[_0x8e32('0xe')]=moment()['format'](_0x8e32('0xf'));}_0x48be00(null,_0x4ebc0e);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d22f449..c9c4eef 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 _0x7b4b=['client','http','redis','localhost','./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','then','AddTagsToSmsInteraction','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x5be8cc,_0x4a6037){var _0x5f1b7e=function(_0xebd8db){while(--_0xebd8db){_0x5be8cc['push'](_0x5be8cc['shift']());}};_0x5f1b7e(++_0x4a6037);}(_0x7b4b,0x1a4));var _0xb7b4=function(_0x146484,_0x27a7f0){_0x146484=_0x146484-0x0;var _0x4c7aa3=_0x7b4b[_0x146484];return _0x4c7aa3;};'use strict';var _=require('lodash');var util=require(_0xb7b4('0x0'));var moment=require(_0xb7b4('0x1'));var BPromise=require(_0xb7b4('0x2'));var rs=require(_0xb7b4('0x3'));var fs=require('fs');var Redis=require(_0xb7b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7b4('0x5'));var logger=require('../../config/logger')(_0xb7b4('0x6'));var config=require(_0xb7b4('0x7'));var jayson=require(_0xb7b4('0x8'));var client=jayson[_0xb7b4('0x9')][_0xb7b4('0xa')]({'port':0x232a});config[_0xb7b4('0xb')]=_['defaults'](config[_0xb7b4('0xb')],{'host':_0xb7b4('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb7b4('0xd'))['register'](socket);function respondWithRpcPromise(_0x5a0700,_0x1a149a,_0x4ea673){return new BPromise(function(_0x130119,_0x3ce08a){return client[_0xb7b4('0xe')](_0x5a0700,_0x4ea673)['then'](function(_0x441c2d){logger[_0xb7b4('0xf')](_0xb7b4('0x10'),_0x1a149a,_0xb7b4('0x11'));logger[_0xb7b4('0x12')](_0xb7b4('0x13'),_0x1a149a,_0xb7b4('0x11'),JSON[_0xb7b4('0x14')](_0x441c2d));if(_0x441c2d[_0xb7b4('0x15')]){if(_0x441c2d[_0xb7b4('0x15')][_0xb7b4('0x16')]===0x1f4){logger['error'](_0xb7b4('0x10'),_0x1a149a,_0x441c2d[_0xb7b4('0x15')][_0xb7b4('0x17')]);return _0x3ce08a(_0x441c2d[_0xb7b4('0x15')][_0xb7b4('0x17')]);}logger['error'](_0xb7b4('0x10'),_0x1a149a,_0x441c2d[_0xb7b4('0x15')][_0xb7b4('0x17')]);return _0x130119(_0x441c2d['error'][_0xb7b4('0x17')]);}else{logger[_0xb7b4('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x1a149a,_0xb7b4('0x11'));_0x130119(_0x441c2d[_0xb7b4('0x18')][_0xb7b4('0x17')]);}})[_0xb7b4('0x19')](function(_0x196623){logger[_0xb7b4('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x1a149a,_0x196623);_0x3ce08a(_0x196623);});});}exports[_0xb7b4('0x1a')]=function(_0x35518a){var _0x1f2dcb=this;return new Promise(function(_0x50d781,_0x5a4d71){return db[_0xb7b4('0x1b')]['update'](_0x35518a[_0xb7b4('0x1c')],{'raw':_0x35518a['options']?_0x35518a[_0xb7b4('0x1d')][_0xb7b4('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35518a[_0xb7b4('0x1d')]?_0x35518a[_0xb7b4('0x1d')][_0xb7b4('0x1f')]||null:null,'attributes':_0x35518a['options']?_0x35518a[_0xb7b4('0x1d')][_0xb7b4('0x20')]||null:null,'limit':_0x35518a[_0xb7b4('0x1d')]?_0x35518a['options']['limit']||null:null})[_0xb7b4('0x21')](function(_0x38acfe){logger[_0xb7b4('0xf')](_0xb7b4('0x1a'),_0x35518a);logger[_0xb7b4('0x12')](_0xb7b4('0x1a'),_0x35518a,JSON[_0xb7b4('0x14')](_0x38acfe));_0x50d781(_0x38acfe);})['catch'](function(_0x5cd4a0){logger[_0xb7b4('0x15')](_0xb7b4('0x1a'),_0x5cd4a0['message'],_0x35518a);_0x5a4d71(_0x1f2dcb['error'](0x1f4,_0x5cd4a0[_0xb7b4('0x17')]));});});};exports[_0xb7b4('0x22')]=function(_0x151ff1){return new Promise(function(_0x4c3d9a,_0x13b059){return db['SmsInteraction']['find']({'where':_0x151ff1[_0xb7b4('0x1d')]?_0x151ff1[_0xb7b4('0x1d')][_0xb7b4('0x1f')]||null:null})[_0xb7b4('0x21')](function(_0x4dc195){if(_0x4dc195){return _0x4dc195[_0xb7b4('0x23')](_0x151ff1[_0xb7b4('0x1c')][_0xb7b4('0x24')],_[_0xb7b4('0x25')](_0x151ff1['body'],[_0xb7b4('0x24'),'id'])||{});}})['spread'](function(_0x3fb6c8){logger[_0xb7b4('0xf')](_0xb7b4('0x26'),_0x151ff1);logger[_0xb7b4('0x12')](_0xb7b4('0x26'),_0x151ff1,JSON[_0xb7b4('0x14')](_0x3fb6c8));_0x4c3d9a(_0x3fb6c8);})[_0xb7b4('0x19')](function(_0x32a4ab){logger[_0xb7b4('0x15')](_0xb7b4('0x26'),_0x32a4ab[_0xb7b4('0x17')],_0x151ff1);_0x13b059(_this[_0xb7b4('0x15')](0x1f4,_0x32a4ab[_0xb7b4('0x17')]));});});}; \ No newline at end of file +var _0x7da8=['find','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','where','limit','stringify','AddTagsToSmsInteraction'];(function(_0x190fdb,_0x358a8b){var _0xf3fdec=function(_0x42c38b){while(--_0x42c38b){_0x190fdb['push'](_0x190fdb['shift']());}};_0xf3fdec(++_0x358a8b);}(_0x7da8,0x196));var _0x87da=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7da8[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x87da('0x0'));var moment=require(_0x87da('0x1'));var BPromise=require(_0x87da('0x2'));var rs=require(_0x87da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x87da('0x4'))(_0x87da('0x5'));var config=require(_0x87da('0x6'));var jayson=require(_0x87da('0x7'));var client=jayson['client'][_0x87da('0x8')]({'port':0x232a});config[_0x87da('0x9')]=_[_0x87da('0xa')](config[_0x87da('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x87da('0xb'))(new Redis(config['redis']));require(_0x87da('0xc'))[_0x87da('0xd')](socket);function respondWithRpcPromise(_0x261c34,_0x5de456,_0x1f2666){return new BPromise(function(_0x259490,_0x3dc1df){return client[_0x87da('0xe')](_0x261c34,_0x1f2666)[_0x87da('0xf')](function(_0x3dbc25){logger[_0x87da('0x10')](_0x87da('0x11'),_0x5de456,_0x87da('0x12'));logger[_0x87da('0x13')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x5de456,'request\x20sent',JSON['stringify'](_0x3dbc25));if(_0x3dbc25['error']){if(_0x3dbc25[_0x87da('0x14')][_0x87da('0x15')]===0x1f4){logger['error'](_0x87da('0x11'),_0x5de456,_0x3dbc25[_0x87da('0x14')]['message']);return _0x3dc1df(_0x3dbc25[_0x87da('0x14')]['message']);}logger[_0x87da('0x14')](_0x87da('0x11'),_0x5de456,_0x3dbc25[_0x87da('0x14')][_0x87da('0x16')]);return _0x259490(_0x3dbc25['error']['message']);}else{logger['info']('SmsInteraction,\x20%s,\x20%s',_0x5de456,'request\x20sent');_0x259490(_0x3dbc25[_0x87da('0x17')]['message']);}})[_0x87da('0x18')](function(_0x155b36){logger[_0x87da('0x14')](_0x87da('0x11'),_0x5de456,_0x155b36);_0x3dc1df(_0x155b36);});});}exports[_0x87da('0x19')]=function(_0x55a1b5){var _0x48b859=this;return new Promise(function(_0x6a86b9,_0x8ea6d2){return db[_0x87da('0x1a')][_0x87da('0x1b')](_0x55a1b5[_0x87da('0x1c')],{'raw':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5[_0x87da('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5['options'][_0x87da('0x1e')]||null:null,'attributes':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5[_0x87da('0x1d')]['attributes']||null:null,'limit':_0x55a1b5[_0x87da('0x1d')]?_0x55a1b5[_0x87da('0x1d')][_0x87da('0x1f')]||null:null})[_0x87da('0xf')](function(_0x3136b2){logger[_0x87da('0x10')](_0x87da('0x19'),_0x55a1b5);logger['debug']('UpdateSmsInteraction',_0x55a1b5,JSON[_0x87da('0x20')](_0x3136b2));_0x6a86b9(_0x3136b2);})[_0x87da('0x18')](function(_0x5f02d1){logger[_0x87da('0x14')](_0x87da('0x19'),_0x5f02d1['message'],_0x55a1b5);_0x8ea6d2(_0x48b859['error'](0x1f4,_0x5f02d1[_0x87da('0x16')]));});});};exports[_0x87da('0x21')]=function(_0xecd012){return new Promise(function(_0x1ec25e,_0x57d807){return db[_0x87da('0x1a')][_0x87da('0x22')]({'where':_0xecd012[_0x87da('0x1d')]?_0xecd012[_0x87da('0x1d')][_0x87da('0x1e')]||null:null})[_0x87da('0xf')](function(_0x365b06){if(_0x365b06){return _0x365b06[_0x87da('0x23')](_0xecd012[_0x87da('0x1c')][_0x87da('0x24')],_[_0x87da('0x25')](_0xecd012[_0x87da('0x1c')],[_0x87da('0x24'),'id'])||{});}})[_0x87da('0x26')](function(_0x5f243b){logger[_0x87da('0x10')](_0x87da('0x27'),_0xecd012);logger[_0x87da('0x13')](_0x87da('0x27'),_0xecd012,JSON[_0x87da('0x20')](_0x5f243b));_0x1ec25e(_0x5f243b);})[_0x87da('0x18')](function(_0x6be823){logger[_0x87da('0x14')]('AddTags',_0x6be823[_0x87da('0x16')],_0xecd012);_0x57d807(_this['error'](0x1f4,_0x6be823[_0x87da('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 1fe385f..2d84636 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 _0xbc41=['./smsInteraction.events','save','update','emit','removeListener','register','length','smsInteraction:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbc41,0x100));var _0x1bc4=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbc41[_0x321bb2];return _0x9c12ed;};'use strict';var SmsInteractionEvents=require(_0x1bc4('0x0'));var events=[_0x1bc4('0x1'),'remove',_0x1bc4('0x2')];function createListener(_0x25d2b9,_0x1b666a){return function(_0xf352e2){_0x1b666a[_0x1bc4('0x3')](_0x25d2b9,_0xf352e2);};}function removeListener(_0x536fb7,_0x3a681e){return function(){SmsInteractionEvents[_0x1bc4('0x4')](_0x536fb7,_0x3a681e);};}exports[_0x1bc4('0x5')]=function(_0x4f2ae9){for(var _0x368b72=0x0,_0x5d5091=events[_0x1bc4('0x6')];_0x368b72<_0x5d5091;_0x368b72++){var _0x34740e=events[_0x368b72];var _0x5700e5=createListener(_0x1bc4('0x7')+_0x34740e,_0x4f2ae9);SmsInteractionEvents['on'](_0x34740e,_0x5700e5);}}; \ No newline at end of file +var _0x69ee=['remove','update','emit','length','smsInteraction:','./smsInteraction.events','save'];(function(_0xae8eb1,_0x2099ad){var _0x4400df=function(_0x1a8f69){while(--_0x1a8f69){_0xae8eb1['push'](_0xae8eb1['shift']());}};_0x4400df(++_0x2099ad);}(_0x69ee,0x9f));var _0xe69e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x69ee[_0x1035c1];return _0x308d67;};'use strict';var SmsInteractionEvents=require(_0xe69e('0x0'));var events=[_0xe69e('0x1'),_0xe69e('0x2'),_0xe69e('0x3')];function createListener(_0x3a6509,_0x5312b5){return function(_0x5e2ac4){_0x5312b5[_0xe69e('0x4')](_0x3a6509,_0x5e2ac4);};}function removeListener(_0x46b46c,_0x5185c4){return function(){SmsInteractionEvents['removeListener'](_0x46b46c,_0x5185c4);};}exports['register']=function(_0x1c8b08){for(var _0x46246c=0x0,_0x18e23a=events[_0xe69e('0x5')];_0x46246c<_0x18e23a;_0x46246c++){var _0x136a66=events[_0x46246c];var _0x312454=createListener(_0xe69e('0x6')+_0x136a66,_0x1c8b08);SmsInteractionEvents['on'](_0x136a66,_0x312454);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 69f248b..26462d5 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 _0xdf27=['multer','util','express','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','sms','smsmessage:create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports'];(function(_0x9bd5e1,_0x44b7f7){var _0xd76f00=function(_0x551562){while(--_0x551562){_0x9bd5e1['push'](_0x9bd5e1['shift']());}};_0xd76f00(++_0x44b7f7);}(_0xdf27,0x104));var _0x7df2=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xdf27[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7df2('0x0'));var util=require(_0x7df2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7df2('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7df2('0x3'));var config=require(_0x7df2('0x4'));var controller=require(_0x7df2('0x5'));router[_0x7df2('0x6')]('/',auth[_0x7df2('0x7')](),controller[_0x7df2('0x8')]);router[_0x7df2('0x6')](_0x7df2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x7df2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x7df2('0xa')]);router[_0x7df2('0xb')]('/',auth['isAuthenticated'](),interaction[_0x7df2('0xc')](_0x7df2('0xd'),_0x7df2('0xe')),controller['create']);router['post']('/:id/status',controller[_0x7df2('0xf')]);router[_0x7df2('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x7df2('0x11')]);router[_0x7df2('0x10')](_0x7df2('0x12'),auth['isAuthenticated'](),controller[_0x7df2('0x13')]);router[_0x7df2('0x10')](_0x7df2('0x14'),auth[_0x7df2('0x7')](),controller[_0x7df2('0x15')]);router[_0x7df2('0x16')](_0x7df2('0x17'),auth[_0x7df2('0x7')](),controller[_0x7df2('0x18')]);module[_0x7df2('0x19')]=router; \ No newline at end of file +var _0xa33a=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','destroy','exports','multer','util'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa33a,0xd0));var _0xaa33=function(_0x3b8a3a,_0x457048){_0x3b8a3a=_0x3b8a3a-0x0;var _0xae7efa=_0xa33a[_0x3b8a3a];return _0xae7efa;};'use strict';var multer=require(_0xaa33('0x0'));var util=require(_0xaa33('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaa33('0x2'));var router=express[_0xaa33('0x3')]();var fs_extra=require(_0xaa33('0x4'));var auth=require(_0xaa33('0x5'));var interaction=require(_0xaa33('0x6'));var config=require(_0xaa33('0x7'));var controller=require('./smsMessage.controller');router[_0xaa33('0x8')]('/',auth[_0xaa33('0x9')](),controller[_0xaa33('0xa')]);router['get'](_0xaa33('0xb'),auth['isAuthenticated'](),controller[_0xaa33('0xc')]);router[_0xaa33('0x8')](_0xaa33('0xd'),auth['isAuthenticated'](),controller[_0xaa33('0xe')]);router[_0xaa33('0xf')]('/',auth[_0xaa33('0x9')](),interaction[_0xaa33('0x10')](_0xaa33('0x11'),_0xaa33('0x12')),controller[_0xaa33('0x13')]);router[_0xaa33('0xf')](_0xaa33('0x14'),controller[_0xaa33('0x15')]);router[_0xaa33('0x16')]('/:id',auth[_0xaa33('0x9')](),controller[_0xaa33('0x17')]);router[_0xaa33('0x16')](_0xaa33('0x18'),auth[_0xaa33('0x9')](),controller[_0xaa33('0x19')]);router[_0xaa33('0x16')](_0xaa33('0x1a'),auth['isAuthenticated'](),controller[_0xaa33('0x1b')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xaa33('0x1c')]);module[_0xaa33('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index b43977e..02228b3 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 _0xf143=['ENUM','out','STRING','DATE','TEXT','BOOLEAN'];(function(_0x3ed3ef,_0x9e96e9){var _0x417ed6=function(_0x5b8541){while(--_0x5b8541){_0x3ed3ef['push'](_0x3ed3ef['shift']());}};_0x417ed6(++_0x9e96e9);}(_0xf143,0x12a));var _0x3f14=function(_0x32e59e,_0x252469){_0x32e59e=_0x32e59e-0x0;var _0x4a621d=_0xf143[_0x32e59e];return _0x4a621d;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x3f14('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3f14('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3f14('0x2')]('in',_0x3f14('0x3')),'defaultValue':_0x3f14('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x3f14('0x4')]},'readAt':{'type':Sequelize[_0x3f14('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3f14('0x4')]},'providerResponse':{'type':Sequelize[_0x3f14('0x0')]}}; \ No newline at end of file +var _0x0f42=['STRING','DATE','BOOLEAN','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x33374d,_0x2dd106){var _0x9a23bb=function(_0x10ef87){while(--_0x10ef87){_0x33374d['push'](_0x33374d['shift']());}};_0x9a23bb(++_0x2dd106);}(_0x0f42,0xc9));var _0x20f4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f42[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x20f4('0x0'));module[_0x20f4('0x1')]={'body':{'type':Sequelize[_0x20f4('0x2')](_0x20f4('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x20f4('0x4')]('in','out'),'defaultValue':_0x20f4('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x20f4('0x6')](0xbe)},'phone':{'type':Sequelize[_0x20f4('0x6')]},'readAt':{'type':Sequelize[_0x20f4('0x7')]},'secret':{'type':Sequelize[_0x20f4('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'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 d124689..d6077f8 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 _0x958a=['fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','register','client','http','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','includeAll','find','create','body','destroy','describe','sms-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','SmsInteraction','isNil','read1stAt','get','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','sms','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','plivio','results','eml-format','rimraf'];(function(_0x5a038c,_0x3685f3){var _0x150abd=function(_0x1e3740){while(--_0x1e3740){_0x5a038c['push'](_0x5a038c['shift']());}};_0x150abd(++_0x3685f3);}(_0x958a,0x128));var _0xa958=function(_0x228036,_0x42e956){_0x228036=_0x228036-0x0;var _0x2d65e2=_0x958a[_0x228036];return _0x2d65e2;};'use strict';var emlformat=require(_0xa958('0x0'));var rimraf=require(_0xa958('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa958('0x2'));var rp=require(_0xa958('0x3'));var moment=require(_0xa958('0x4'));var BPromise=require(_0xa958('0x5'));var Mustache=require(_0xa958('0x6'));var util=require('util');var path=require(_0xa958('0x7'));var sox=require('sox');var csv=require(_0xa958('0x8'));var ejs=require(_0xa958('0x9'));var fs=require('fs');var fs_extra=require(_0xa958('0xa'));var _=require(_0xa958('0xb'));var squel=require(_0xa958('0xc'));var crypto=require(_0xa958('0xd'));var jsforce=require(_0xa958('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa958('0xf'));var Papa=require(_0xa958('0x10'));var Redis=require(_0xa958('0x11'));var authService=require(_0xa958('0x12'));var qs=require(_0xa958('0x13'));var as=require(_0xa958('0x14'));var hardwareService=require(_0xa958('0x15'));var logger=require(_0xa958('0x16'))(_0xa958('0x17'));var utils=require(_0xa958('0x18'));var config=require(_0xa958('0x19'));var licenseUtil=require(_0xa958('0x1a'));var db=require(_0xa958('0x1b'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa958('0x1c'),'port':0x18eb});var socket=require(_0xa958('0x1d'))(new Redis(config[_0xa958('0x1e')]));require('./smsMessage.socket')[_0xa958('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xa958('0x20')][_0xa958('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xb90ac6,_0x6a81c7,_0x2c270c,_0x398931){return new BPromise(function(_0x23736f,_0x21e366){var _0x4d836f=_0x398931||client;return _0x4d836f[_0xa958('0x22')](_0xb90ac6,_0x2c270c)['then'](function(_0x3a053f){logger[_0xa958('0x23')]('SmsMessage,\x20%s,\x20%s',_0x6a81c7,_0xa958('0x24'));logger[_0xa958('0x25')](_0xa958('0x26'),_0x6a81c7,_0xa958('0x24'),JSON[_0xa958('0x27')](_0x3a053f));if(_0x3a053f[_0xa958('0x28')]){if(_0x3a053f['error']['code']===0x1f4){logger[_0xa958('0x28')](_0xa958('0x29'),_0x6a81c7,_0x3a053f[_0xa958('0x28')]['message']);return _0x21e366(_0x3a053f[_0xa958('0x28')][_0xa958('0x2a')]);}logger['error'](_0xa958('0x29'),_0x6a81c7,_0x3a053f[_0xa958('0x28')]['message']);return _0x23736f(_0x3a053f['error'][_0xa958('0x2a')]);}else{logger[_0xa958('0x23')]('SmsMessage,\x20%s,\x20%s',_0x6a81c7,_0xa958('0x24'));_0x23736f(_0x3a053f[_0xa958('0x2b')][_0xa958('0x2a')]);}})[_0xa958('0x2c')](function(_0x16b04a){logger[_0xa958('0x28')]('SmsMessage,\x20%s,\x20%s',_0x6a81c7,_0x16b04a);_0x21e366(_0x16b04a);});});}function respondWithStatusCode(_0x3e3d77,_0x48ef34){_0x48ef34=_0x48ef34||0xcc;return function(_0x43df63){if(_0x43df63){return _0x3e3d77[_0xa958('0x2d')](_0x48ef34);}return _0x3e3d77[_0xa958('0x2e')](_0x48ef34)[_0xa958('0x2f')]();};}function respondWithResult(_0x21541f,_0xddc7f6){_0xddc7f6=_0xddc7f6||0xc8;return function(_0x2c970b){if(_0x2c970b){return _0x21541f[_0xa958('0x2e')](_0xddc7f6)[_0xa958('0x30')](_0x2c970b);}};}function respondWithFilteredResult(_0x404d07,_0x4c4c37){return function(_0x47895c){if(_0x47895c){var _0xd2fcc9=typeof _0x4c4c37['offset']===_0xa958('0x31')&&typeof _0x4c4c37[_0xa958('0x32')]==='undefined';var _0x23bdbf=_0x47895c[_0xa958('0x33')];var _0x179bc2=_0xd2fcc9?0x0:_0x4c4c37[_0xa958('0x34')];var _0x283452=_0xd2fcc9?_0x47895c['count']:_0x4c4c37['offset']+_0x4c4c37[_0xa958('0x32')];var _0x5d9a3d;if(_0x283452>=_0x23bdbf){_0x283452=_0x23bdbf;_0x5d9a3d=0xc8;}else{_0x5d9a3d=0xce;}_0x404d07['status'](_0x5d9a3d);return _0x404d07[_0xa958('0x35')](_0xa958('0x36'),_0x179bc2+'-'+_0x283452+'/'+_0x23bdbf)[_0xa958('0x30')](_0x47895c);}return null;};}function patchUpdates(_0x43b912){return function(_0x1ac775){try{jsonpatch[_0xa958('0x37')](_0x1ac775,_0x43b912,!![]);}catch(_0x516a2f){return BPromise[_0xa958('0x38')](_0x516a2f);}return _0x1ac775['save']();};}function saveUpdates(_0x489502,_0x39b615){return function(_0x541a1){if(_0x541a1){return _0x541a1[_0xa958('0x39')](_0x489502)[_0xa958('0x3a')](function(_0x1e23d2){return _0x1e23d2;});}return null;};}function removeEntity(_0x2de6a0,_0x1fccf9){return function(_0x3dcf34){if(_0x3dcf34){return _0x3dcf34['destroy']()['then'](function(){_0x2de6a0[_0xa958('0x2e')](0xcc)[_0xa958('0x2f')]();});}};}function handleEntityNotFound(_0x322d0e,_0x3ceb1e){return function(_0x2c0342){if(!_0x2c0342){_0x322d0e['sendStatus'](0x194);}return _0x2c0342;};}function handleError(_0x1b851c,_0x3d7802){_0x3d7802=_0x3d7802||0x1f4;return function(_0x41752a){logger[_0xa958('0x28')](_0x41752a['stack']);if(_0x41752a[_0xa958('0x3b')]){delete _0x41752a[_0xa958('0x3b')];}_0x1b851c[_0xa958('0x2e')](_0x3d7802)[_0xa958('0x3c')](_0x41752a);};}exports[_0xa958('0x3d')]=function(_0x48189e,_0x4316f7){var _0x11d5b7={},_0x39af1e={},_0x5827ff={'count':0x0,'rows':[]};var _0x25a465=_[_0xa958('0x3e')](db[_0xa958('0x3f')][_0xa958('0x40')],function(_0x2378df){return{'name':_0x2378df[_0xa958('0x41')],'type':_0x2378df['type'][_0xa958('0x42')]};});_0x39af1e[_0xa958('0x43')]=_[_0xa958('0x3e')](_0x25a465,'name');_0x39af1e[_0xa958('0x44')]=_[_0xa958('0x45')](_0x48189e['query']);_0x39af1e['filters']=_[_0xa958('0x46')](_0x39af1e['model'],_0x39af1e[_0xa958('0x44')]);_0x11d5b7['attributes']=_[_0xa958('0x46')](_0x39af1e['model'],qs[_0xa958('0x47')](_0x48189e[_0xa958('0x44')][_0xa958('0x47')]));_0x11d5b7[_0xa958('0x48')]=_0x11d5b7[_0xa958('0x48')][_0xa958('0x49')]?_0x11d5b7[_0xa958('0x48')]:_0x39af1e[_0xa958('0x43')];if(!_0x48189e['query'][_0xa958('0x4a')](_0xa958('0x4b'))){_0x11d5b7[_0xa958('0x32')]=qs['limit'](_0x48189e['query']['limit']);_0x11d5b7[_0xa958('0x34')]=qs[_0xa958('0x34')](_0x48189e[_0xa958('0x44')][_0xa958('0x34')]);}_0x11d5b7[_0xa958('0x4c')]=qs['sort'](_0x48189e[_0xa958('0x44')][_0xa958('0x4d')]);_0x11d5b7[_0xa958('0x4e')]=qs[_0xa958('0x4f')](_[_0xa958('0x50')](_0x48189e[_0xa958('0x44')],_0x39af1e[_0xa958('0x4f')]),_0x25a465);if(_0x48189e[_0xa958('0x44')][_0xa958('0x51')]){_0x11d5b7[_0xa958('0x4e')]=_[_0xa958('0x52')](_0x11d5b7[_0xa958('0x4e')],{'$or':_[_0xa958('0x3e')](_0x25a465,function(_0x9d26d6){if(_0x9d26d6[_0xa958('0x53')]!==_0xa958('0x54')){var _0x16e3bd={};_0x16e3bd[_0x9d26d6['name']]={'$like':'%'+_0x48189e['query']['filter']+'%'};return _0x16e3bd;}})});}_0x11d5b7=_[_0xa958('0x52')]({},_0x11d5b7,_0x48189e[_0xa958('0x55')]);var _0x251946={'where':_0x11d5b7[_0xa958('0x4e')]};return db['SmsMessage'][_0xa958('0x33')](_0x251946)[_0xa958('0x3a')](function(_0xa07b67){_0x5827ff[_0xa958('0x33')]=_0xa07b67;if(_0x48189e[_0xa958('0x44')]['includeAll']){_0x11d5b7[_0xa958('0x56')]=[{'all':!![]}];}return db[_0xa958('0x3f')][_0xa958('0x57')](_0x11d5b7);})['then'](function(_0x25f495){_0x5827ff['rows']=_0x25f495;return _0x5827ff;})[_0xa958('0x3a')](respondWithFilteredResult(_0x4316f7,_0x11d5b7))[_0xa958('0x2c')](handleError(_0x4316f7,null));};exports[_0xa958('0x58')]=function(_0x4e0740,_0x35f6bf){var _0x5a0794={'raw':!![],'where':{'id':_0x4e0740[_0xa958('0x59')]['id']}},_0x179997={};_0x179997[_0xa958('0x43')]=_[_0xa958('0x45')](db[_0xa958('0x3f')]['rawAttributes']);_0x179997[_0xa958('0x44')]=_['keys'](_0x4e0740[_0xa958('0x44')]);_0x179997[_0xa958('0x4f')]=_['intersection'](_0x179997[_0xa958('0x43')],_0x179997['query']);_0x5a0794[_0xa958('0x48')]=_[_0xa958('0x46')](_0x179997[_0xa958('0x43')],qs[_0xa958('0x47')](_0x4e0740[_0xa958('0x44')][_0xa958('0x47')]));_0x5a0794[_0xa958('0x48')]=_0x5a0794[_0xa958('0x48')][_0xa958('0x49')]?_0x5a0794['attributes']:_0x179997[_0xa958('0x43')];if(_0x4e0740['query'][_0xa958('0x5a')]){_0x5a0794[_0xa958('0x56')]=[{'all':!![]}];}_0x5a0794=_[_0xa958('0x52')]({},_0x5a0794,_0x4e0740['options']);return db['SmsMessage'][_0xa958('0x5b')](_0x5a0794)[_0xa958('0x3a')](handleEntityNotFound(_0x35f6bf,null))[_0xa958('0x3a')](respondWithResult(_0x35f6bf,null))[_0xa958('0x2c')](handleError(_0x35f6bf,null));};exports['create']=function(_0x4324a9,_0x2012a0){return db['SmsMessage'][_0xa958('0x5c')](_0x4324a9[_0xa958('0x5d')],{})['then'](respondWithResult(_0x2012a0,0xc9))[_0xa958('0x2c')](handleError(_0x2012a0,null));};exports['update']=function(_0x5629c4,_0x58488a){if(_0x5629c4[_0xa958('0x5d')]['id']){delete _0x5629c4[_0xa958('0x5d')]['id'];}return db[_0xa958('0x3f')][_0xa958('0x5b')]({'where':{'id':_0x5629c4['params']['id']}})[_0xa958('0x3a')](handleEntityNotFound(_0x58488a,null))['then'](saveUpdates(_0x5629c4[_0xa958('0x5d')],null))[_0xa958('0x3a')](respondWithResult(_0x58488a,null))[_0xa958('0x2c')](handleError(_0x58488a,null));};exports[_0xa958('0x5e')]=function(_0x25865d,_0x11cc0b){return db['SmsMessage']['find']({'where':{'id':_0x25865d[_0xa958('0x59')]['id']}})[_0xa958('0x3a')](handleEntityNotFound(_0x11cc0b,null))[_0xa958('0x3a')](removeEntity(_0x11cc0b,null))[_0xa958('0x2c')](handleError(_0x11cc0b,null));};exports[_0xa958('0x5f')]=function(_0x5e0e4d,_0x143a35){return db[_0xa958('0x3f')][_0xa958('0x5f')]()['then'](respondWithResult(_0x143a35,null))[_0xa958('0x2c')](handleError(_0x143a35,null));};var interaction_log=require(_0xa958('0x16'))(_0xa958('0x60'));exports[_0xa958('0x61')]=function(_0x35177a,_0x2d40b1,_0x1dbc81){var _0x4b3c6c={'agent':{},'channel':'sms'};if(_0x35177a[_0xa958('0x5d')]['id']){delete _0x35177a['body']['id'];}_0x35177a[_0xa958('0x5d')][_0xa958('0x62')]=!![];_0x35177a[_0xa958('0x5d')][_0xa958('0x63')]=moment()[_0xa958('0x64')](_0xa958('0x65'));_0x35177a[_0xa958('0x5d')][_0xa958('0x66')]=_0x35177a[_0xa958('0x5d')]['UserId']||_0x35177a[_0xa958('0x67')]['id'];_0x4b3c6c[_0xa958('0x68')]['id']=_0x35177a['body'][_0xa958('0x66')];return db[_0xa958('0x3f')][_0xa958('0x5b')]({'where':{'id':_0x35177a[_0xa958('0x59')]['id'],'UserId':null}})[_0xa958('0x3a')](handleEntityNotFound(_0x2d40b1,null))[_0xa958('0x3a')](saveUpdates(_0x35177a['body'],null))[_0xa958('0x3a')](function(_0x4edab2){if(_0x4edab2){_0x4b3c6c[_0xa958('0x2a')]=_0x4edab2['get']({'plain':!![]});return db[_0xa958('0x69')][_0xa958('0x5b')]({'where':{'id':_0x4edab2['SmsInteractionId']}});}return null;})[_0xa958('0x3a')](handleEntityNotFound(_0x2d40b1,null))[_0xa958('0x3a')](function(_0x29b99c){if(_0x29b99c){return _0x29b99c[_0xa958('0x39')]({'UserId':_0x35177a[_0xa958('0x5d')][_0xa958('0x66')],'read1stAt':_[_0xa958('0x6a')](_0x29b99c[_0xa958('0x6b')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x376174){if(_0x376174){_0x4b3c6c['interaction']=_0x376174[_0xa958('0x6c')]({'plain':!![]});interaction_log[_0xa958('0x23')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35177a['user']['id'],_0x35177a[_0xa958('0x67')][_0xa958('0x3b')],_0x35177a[_0xa958('0x67')][_0xa958('0x6d')],_0x4b3c6c[_0xa958('0x6e')]['id'],_0x35177a['body']?JSON[_0xa958('0x27')](_0x35177a['body']):_0xa958('0x6f'));return respondWithRpcPromise(_0xa958('0x70'),_0xa958('0x71'),_0x4b3c6c);}return null;})['then'](function(_0x3ffa27){var _0x22cdc9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3ffa27[_0xa958('0x2a')][_0xa958('0x72')];return db[_0xa958('0x73')][_0xa958('0x44')](_0x22cdc9,{'type':db[_0xa958('0x74')]['QueryTypes'][_0xa958('0x75')],'raw':!![]})['then'](function(_0x28d5e5){return _0x28d5e5;});})['then'](function(_0x1b2d7e){if(_0x1b2d7e){_0x4b3c6c[_0xa958('0x2a')][_0xa958('0x76')]=_0x1b2d7e[0x0];if(!_0x35177a[_0xa958('0x5d')][_0xa958('0x66')])return;return db[_0xa958('0x77')][_0xa958('0x5b')]({'where':{'id':_0x35177a['body']['UserId'],'role':_0xa958('0x68')},'attributes':['id','name',_0xa958('0x78'),_0xa958('0x79'),_0xa958('0x7a')],'raw':!![]});}return null;})[_0xa958('0x3a')](function(_0x3b8dbf){if(!_0x3b8dbf)return null;_0x4b3c6c[_0xa958('0x2a')][_0xa958('0x68')]=_0x3b8dbf;return _0x4b3c6c;})[_0xa958('0x3a')](function(_0x540f58){if(_0x540f58){if(_0x35177a[_0xa958('0x5d')][_0xa958('0x7b')]){_0x4b3c6c[_0xa958('0x2a')][_0xa958('0x7c')]=util['format'](_0xa958('0x7d'),_0x35177a[_0xa958('0x67')][_0xa958('0x3b')]);_0x4b3c6c[_0xa958('0x2a')][_0xa958('0x7e')]=_0x4b3c6c[_0xa958('0x7e')];_0x4b3c6c['message'][_0xa958('0x7f')]=_0x4b3c6c[_0xa958('0x7e')];_0x4b3c6c[_0xa958('0x2a')][_0xa958('0x80')]=_0xa958('0x61');return respondWithRpcPromise(_0xa958('0x81'),'EventManager',{'event':'acceptmessage','message':_0x4b3c6c['message']},client9002)[_0xa958('0x3a')](function(){return _0x4b3c6c;});}return _0x4b3c6c;}return null;})['then'](respondWithResult(_0x2d40b1,null))['catch'](handleError(_0x2d40b1,null));};var interaction_log=require(_0xa958('0x16'))(_0xa958('0x60'));exports[_0xa958('0x38')]=function(_0x2a2fdb,_0x97d275,_0x59e4d0){var _0x55908f={'agent':{},'channel':_0xa958('0x82')};if(_0x2a2fdb[_0xa958('0x5d')]['id']){delete _0x2a2fdb[_0xa958('0x5d')]['id'];}_0x2a2fdb[_0xa958('0x5d')]['UserId']=_0x2a2fdb[_0xa958('0x5d')][_0xa958('0x66')]||_0x2a2fdb[_0xa958('0x67')]['id'];_0x55908f[_0xa958('0x68')]['id']=_0x2a2fdb[_0xa958('0x5d')]['UserId'];return db['SmsMessage'][_0xa958('0x5b')]({'where':{'id':_0x2a2fdb['params']['id'],'UserId':null}})[_0xa958('0x3a')](handleEntityNotFound(_0x97d275,null))[_0xa958('0x3a')](function(_0x378ced){if(_0x378ced){_0x55908f['message']=_0x378ced[_0xa958('0x6c')]({'plain':!![]});return db['SmsInteraction'][_0xa958('0x5b')]({'where':{'id':_0x378ced[_0xa958('0x83')]}});}return null;})['then'](handleEntityNotFound(_0x97d275,null))['then'](function(_0x5f2995){if(_0x5f2995){_0x55908f['interaction']=_0x5f2995[_0xa958('0x6c')]({'plain':!![]});interaction_log[_0xa958('0x23')](_0xa958('0x84'),_0x2a2fdb[_0xa958('0x67')]['id'],_0x2a2fdb[_0xa958('0x67')]['name'],_0x2a2fdb[_0xa958('0x67')]['role'],_0x55908f['interaction']['id'],_0x2a2fdb[_0xa958('0x5d')]?JSON[_0xa958('0x27')](_0x2a2fdb[_0xa958('0x5d')]):'null');return respondWithRpcPromise(_0xa958('0x85'),'rejectMessage',_0x55908f);}return null;})[_0xa958('0x3a')](function(_0x1808d6){var _0x5347e4='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1808d6[_0xa958('0x2a')][_0xa958('0x72')];return db[_0xa958('0x73')][_0xa958('0x44')](_0x5347e4,{'type':db['Sequelize'][_0xa958('0x86')][_0xa958('0x75')],'raw':!![]})['then'](function(_0x341d41){return _0x341d41;});})['then'](function(_0x19a6e2){if(_0x19a6e2){_0x55908f[_0xa958('0x2a')][_0xa958('0x76')]=_0x19a6e2[0x0];if(!_0x2a2fdb['body'][_0xa958('0x66')])return;return db[_0xa958('0x77')]['find']({'where':{'id':_0x2a2fdb[_0xa958('0x5d')][_0xa958('0x66')],'role':_0xa958('0x68')},'attributes':['id',_0xa958('0x3b'),_0xa958('0x78'),_0xa958('0x79'),_0xa958('0x7a')],'raw':!![]});}return null;})[_0xa958('0x3a')](function(_0x252300){if(!_0x252300)return null;_0x55908f['message'][_0xa958('0x68')]=_0x252300;return _0x55908f;})[_0xa958('0x3a')](function(_0x5e388f){if(_0x5e388f){_0x5e388f[_0xa958('0x2a')][_0xa958('0x7c')]=util[_0xa958('0x64')]('SIP/%s',_0x2a2fdb[_0xa958('0x67')]['name']);_0x5e388f['message'][_0xa958('0x7e')]=_0x55908f[_0xa958('0x7e')];_0x5e388f['message']['motionChannel']=_0x55908f[_0xa958('0x7e')];_0x5e388f[_0xa958('0x2a')][_0xa958('0x80')]='reject';respondWithRpcPromise(_0xa958('0x81'),'EventManager',{'event':'rejectmessage','message':_0x5e388f[_0xa958('0x2a')]},client9002);return _0x55908f;}return null;})[_0xa958('0x3a')](respondWithResult(_0x97d275,null))[_0xa958('0x2c')](handleError(_0x97d275,null));};exports['status']=function(_0x278505,_0x36d9d4,_0x213ee2){if(_0x278505['body']['id']){delete _0x278505[_0xa958('0x5d')]['id'];}var _0x9207c3;return db[_0xa958('0x3f')][_0xa958('0x5b')]({'where':{'id':_0x278505['params']['id']}})[_0xa958('0x3a')](handleEntityNotFound(_0x36d9d4,null))[_0xa958('0x3a')](function(_0x71d394){if(_0x71d394){_0x9207c3=_0x71d394;return db[_0xa958('0x87')]['find']({'where':{'id':_0x71d394['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x36d9d4,null))['then'](function(_0x1fcd93){if(_0x1fcd93){logger[_0xa958('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0xa958('0x88'),_0x1fcd93[_0xa958('0x53')],util[_0xa958('0x89')](_0x278505['body'],{'showHidden':![],'depth':null}));switch(_0x1fcd93[_0xa958('0x53')]){case _0xa958('0x8a'):if(_0x278505['body'][_0xa958('0x8b')]&&_0x278505[_0xa958('0x5d')][_0xa958('0x8b')]===_0x9207c3[_0xa958('0x8c')]){return _0x9207c3[_0xa958('0x39')]({'read':!![]});}else{logger[_0xa958('0x28')](_0xa958('0x8d'),_0xa958('0x2e'),_0xa958('0x8a'),util[_0xa958('0x89')](_0x278505[_0xa958('0x5d')],{'showHidden':![],'depth':null}));}break;case _0xa958('0x8e'):if(_0x278505['body']['MessageUUID']&&_0x278505[_0xa958('0x5d')][_0xa958('0x8f')]===_0x9207c3[_0xa958('0x8c')]&&_[_0xa958('0x90')]([_0xa958('0x91'),_0xa958('0x92')],_0x278505[_0xa958('0x5d')]['Status'])>=0x0){return _0x9207c3[_0xa958('0x39')]({'read':!![]});}else{logger[_0xa958('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa958('0x2e'),_0xa958('0x93'),util['inspect'](_0x278505[_0xa958('0x5d')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x57e780=_0x278505[_0xa958('0x5d')][_0xa958('0x94')][0x0];if(_0x57e780[_0xa958('0x2e')]['groupName']==='DELIVERED'){return _0x9207c3[_0xa958('0x39')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa958('0x2e'),'infobip',util[_0xa958('0x89')](_0x278505[_0xa958('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x9207c3;}})[_0xa958('0x3a')](respondWithResult(_0x36d9d4,null))[_0xa958('0x2c')](handleError(_0x36d9d4,null));}; \ No newline at end of file +var _0x2f68=['SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','contact','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','infobip','results','groupName','DELIVERED','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','redis','./smsMessage.socket','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','Content-Range','save','update','destroy','then','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','include','findAll','rows','show','params','includeAll','options','find','create','body','describe','accept','sms','format','UserId','get','SmsInteraction','SmsInteractionId','isNil','interaction','user','role','null','sequelize','Sequelize','QueryTypes','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','sms-interactions','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage'];(function(_0x4cba0c,_0x5cf192){var _0x4c66e3=function(_0x419abe){while(--_0x419abe){_0x4cba0c['push'](_0x4cba0c['shift']());}};_0x4c66e3(++_0x5cf192);}(_0x2f68,0x12b));var _0x82f6=function(_0x290f16,_0x2f1c75){_0x290f16=_0x290f16-0x0;var _0x16c352=_0x2f68[_0x290f16];return _0x16c352;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82f6('0x0'));var zipdir=require(_0x82f6('0x1'));var jsonpatch=require(_0x82f6('0x2'));var rp=require(_0x82f6('0x3'));var moment=require(_0x82f6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x82f6('0x5'));var util=require(_0x82f6('0x6'));var path=require(_0x82f6('0x7'));var sox=require(_0x82f6('0x8'));var csv=require(_0x82f6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82f6('0xa'));var squel=require('squel');var crypto=require(_0x82f6('0xb'));var jsforce=require(_0x82f6('0xc'));var deskjs=require(_0x82f6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x82f6('0xe'));var Papa=require(_0x82f6('0xf'));var Redis=require(_0x82f6('0x10'));var authService=require(_0x82f6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x82f6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x82f6('0x13'));var utils=require('../../config/utils');var config=require(_0x82f6('0x14'));var licenseUtil=require(_0x82f6('0x15'));var db=require('../../mysqldb')['db'];config[_0x82f6('0x16')]=_['defaults'](config[_0x82f6('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82f6('0x16')]));require(_0x82f6('0x17'))[_0x82f6('0x18')](socket);var jayson=require(_0x82f6('0x19'));var client=jayson[_0x82f6('0x1a')][_0x82f6('0x1b')]({'port':0x232c});var client9002=jayson[_0x82f6('0x1a')][_0x82f6('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x447987,_0x42ef53,_0x3ca73f,_0x446bf1){return new BPromise(function(_0x412d1f,_0x32e295){var _0x25df8c=_0x446bf1||client;return _0x25df8c[_0x82f6('0x1c')](_0x447987,_0x3ca73f)['then'](function(_0x2a16e2){logger[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x42ef53,_0x82f6('0x1f'));logger['debug'](_0x82f6('0x20'),_0x42ef53,_0x82f6('0x1f'),JSON[_0x82f6('0x21')](_0x2a16e2));if(_0x2a16e2[_0x82f6('0x22')]){if(_0x2a16e2['error'][_0x82f6('0x23')]===0x1f4){logger[_0x82f6('0x22')]('SmsMessage,\x20%s,\x20%s',_0x42ef53,_0x2a16e2[_0x82f6('0x22')][_0x82f6('0x24')]);return _0x32e295(_0x2a16e2[_0x82f6('0x22')]['message']);}logger[_0x82f6('0x22')]('SmsMessage,\x20%s,\x20%s',_0x42ef53,_0x2a16e2[_0x82f6('0x22')]['message']);return _0x412d1f(_0x2a16e2[_0x82f6('0x22')][_0x82f6('0x24')]);}else{logger[_0x82f6('0x1d')](_0x82f6('0x1e'),_0x42ef53,_0x82f6('0x1f'));_0x412d1f(_0x2a16e2['result'][_0x82f6('0x24')]);}})[_0x82f6('0x25')](function(_0x574713){logger[_0x82f6('0x22')]('SmsMessage,\x20%s,\x20%s',_0x42ef53,_0x574713);_0x32e295(_0x574713);});});}function respondWithStatusCode(_0x248c3b,_0x3954e5){_0x3954e5=_0x3954e5||0xcc;return function(_0x15069b){if(_0x15069b){return _0x248c3b['sendStatus'](_0x3954e5);}return _0x248c3b[_0x82f6('0x26')](_0x3954e5)[_0x82f6('0x27')]();};}function respondWithResult(_0x547ce7,_0x3350f2){_0x3350f2=_0x3350f2||0xc8;return function(_0x1856af){if(_0x1856af){return _0x547ce7[_0x82f6('0x26')](_0x3350f2)[_0x82f6('0x28')](_0x1856af);}};}function respondWithFilteredResult(_0x285040,_0x4fde1b){return function(_0x164266){if(_0x164266){var _0x230998=typeof _0x4fde1b[_0x82f6('0x29')]===_0x82f6('0x2a')&&typeof _0x4fde1b[_0x82f6('0x2b')]==='undefined';var _0x18b21a=_0x164266['count'];var _0x3cb2de=_0x230998?0x0:_0x4fde1b['offset'];var _0x1fbfe1=_0x230998?_0x164266['count']:_0x4fde1b[_0x82f6('0x29')]+_0x4fde1b[_0x82f6('0x2b')];var _0x2a86a1;if(_0x1fbfe1>=_0x18b21a){_0x1fbfe1=_0x18b21a;_0x2a86a1=0xc8;}else{_0x2a86a1=0xce;}_0x285040[_0x82f6('0x26')](_0x2a86a1);return _0x285040['set'](_0x82f6('0x2c'),_0x3cb2de+'-'+_0x1fbfe1+'/'+_0x18b21a)['json'](_0x164266);}return null;};}function patchUpdates(_0x17dd31){return function(_0x239506){try{jsonpatch['apply'](_0x239506,_0x17dd31,!![]);}catch(_0x35ca2b){return BPromise['reject'](_0x35ca2b);}return _0x239506[_0x82f6('0x2d')]();};}function saveUpdates(_0x3d79cd,_0xcad2ba){return function(_0x3dcfbe){if(_0x3dcfbe){return _0x3dcfbe[_0x82f6('0x2e')](_0x3d79cd)['then'](function(_0x4ba8d5){return _0x4ba8d5;});}return null;};}function removeEntity(_0x19e40e,_0x41a60b){return function(_0x38185a){if(_0x38185a){return _0x38185a[_0x82f6('0x2f')]()[_0x82f6('0x30')](function(){_0x19e40e[_0x82f6('0x26')](0xcc)[_0x82f6('0x27')]();});}};}function handleEntityNotFound(_0x321b3b,_0x47e8a5){return function(_0x35868d){if(!_0x35868d){_0x321b3b[_0x82f6('0x31')](0x194);}return _0x35868d;};}function handleError(_0x67889f,_0x4f2fa6){_0x4f2fa6=_0x4f2fa6||0x1f4;return function(_0x2887bc){logger[_0x82f6('0x22')](_0x2887bc[_0x82f6('0x32')]);if(_0x2887bc[_0x82f6('0x33')]){delete _0x2887bc[_0x82f6('0x33')];}_0x67889f[_0x82f6('0x26')](_0x4f2fa6)[_0x82f6('0x34')](_0x2887bc);};}exports[_0x82f6('0x35')]=function(_0xb35b74,_0x547959){var _0x209edd={},_0x56d23d={},_0x443990={'count':0x0,'rows':[]};var _0xb9c20c=_[_0x82f6('0x36')](db[_0x82f6('0x37')][_0x82f6('0x38')],function(_0x19cb37){return{'name':_0x19cb37['fieldName'],'type':_0x19cb37[_0x82f6('0x39')][_0x82f6('0x3a')]};});_0x56d23d[_0x82f6('0x3b')]=_[_0x82f6('0x36')](_0xb9c20c,_0x82f6('0x33'));_0x56d23d['query']=_[_0x82f6('0x3c')](_0xb35b74['query']);_0x56d23d[_0x82f6('0x3d')]=_['intersection'](_0x56d23d[_0x82f6('0x3b')],_0x56d23d[_0x82f6('0x3e')]);_0x209edd[_0x82f6('0x3f')]=_[_0x82f6('0x40')](_0x56d23d['model'],qs['fields'](_0xb35b74[_0x82f6('0x3e')][_0x82f6('0x41')]));_0x209edd[_0x82f6('0x3f')]=_0x209edd[_0x82f6('0x3f')][_0x82f6('0x42')]?_0x209edd[_0x82f6('0x3f')]:_0x56d23d[_0x82f6('0x3b')];if(!_0xb35b74['query'][_0x82f6('0x43')](_0x82f6('0x44'))){_0x209edd[_0x82f6('0x2b')]=qs[_0x82f6('0x2b')](_0xb35b74['query'][_0x82f6('0x2b')]);_0x209edd[_0x82f6('0x29')]=qs[_0x82f6('0x29')](_0xb35b74[_0x82f6('0x3e')][_0x82f6('0x29')]);}_0x209edd[_0x82f6('0x45')]=qs[_0x82f6('0x46')](_0xb35b74[_0x82f6('0x3e')][_0x82f6('0x46')]);_0x209edd[_0x82f6('0x47')]=qs[_0x82f6('0x3d')](_[_0x82f6('0x48')](_0xb35b74[_0x82f6('0x3e')],_0x56d23d[_0x82f6('0x3d')]),_0xb9c20c);if(_0xb35b74[_0x82f6('0x3e')]['filter']){_0x209edd['where']=_[_0x82f6('0x49')](_0x209edd['where'],{'$or':_[_0x82f6('0x36')](_0xb9c20c,function(_0x2689a9){if(_0x2689a9[_0x82f6('0x39')]!=='VIRTUAL'){var _0x129a32={};_0x129a32[_0x2689a9[_0x82f6('0x33')]]={'$like':'%'+_0xb35b74['query']['filter']+'%'};return _0x129a32;}})});}_0x209edd=_[_0x82f6('0x49')]({},_0x209edd,_0xb35b74['options']);var _0x52ea1a={'where':_0x209edd[_0x82f6('0x47')]};return db['SmsMessage']['count'](_0x52ea1a)[_0x82f6('0x30')](function(_0x56e889){_0x443990['count']=_0x56e889;if(_0xb35b74[_0x82f6('0x3e')]['includeAll']){_0x209edd[_0x82f6('0x4a')]=[{'all':!![]}];}return db[_0x82f6('0x37')][_0x82f6('0x4b')](_0x209edd);})[_0x82f6('0x30')](function(_0x3d7b74){_0x443990[_0x82f6('0x4c')]=_0x3d7b74;return _0x443990;})['then'](respondWithFilteredResult(_0x547959,_0x209edd))['catch'](handleError(_0x547959,null));};exports[_0x82f6('0x4d')]=function(_0x334853,_0x27a312){var _0x3caab1={'raw':!![],'where':{'id':_0x334853[_0x82f6('0x4e')]['id']}},_0x1c0223={};_0x1c0223['model']=_[_0x82f6('0x3c')](db[_0x82f6('0x37')][_0x82f6('0x38')]);_0x1c0223['query']=_['keys'](_0x334853['query']);_0x1c0223['filters']=_['intersection'](_0x1c0223[_0x82f6('0x3b')],_0x1c0223[_0x82f6('0x3e')]);_0x3caab1[_0x82f6('0x3f')]=_[_0x82f6('0x40')](_0x1c0223[_0x82f6('0x3b')],qs[_0x82f6('0x41')](_0x334853[_0x82f6('0x3e')][_0x82f6('0x41')]));_0x3caab1[_0x82f6('0x3f')]=_0x3caab1[_0x82f6('0x3f')][_0x82f6('0x42')]?_0x3caab1[_0x82f6('0x3f')]:_0x1c0223['model'];if(_0x334853[_0x82f6('0x3e')][_0x82f6('0x4f')]){_0x3caab1[_0x82f6('0x4a')]=[{'all':!![]}];}_0x3caab1=_[_0x82f6('0x49')]({},_0x3caab1,_0x334853[_0x82f6('0x50')]);return db[_0x82f6('0x37')][_0x82f6('0x51')](_0x3caab1)[_0x82f6('0x30')](handleEntityNotFound(_0x27a312,null))[_0x82f6('0x30')](respondWithResult(_0x27a312,null))[_0x82f6('0x25')](handleError(_0x27a312,null));};exports['create']=function(_0x407a29,_0x545be0){return db['SmsMessage'][_0x82f6('0x52')](_0x407a29[_0x82f6('0x53')],{})['then'](respondWithResult(_0x545be0,0xc9))[_0x82f6('0x25')](handleError(_0x545be0,null));};exports['update']=function(_0x1fcaaf,_0x3ae5fd){if(_0x1fcaaf[_0x82f6('0x53')]['id']){delete _0x1fcaaf[_0x82f6('0x53')]['id'];}return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x1fcaaf[_0x82f6('0x4e')]['id']}})[_0x82f6('0x30')](handleEntityNotFound(_0x3ae5fd,null))[_0x82f6('0x30')](saveUpdates(_0x1fcaaf[_0x82f6('0x53')],null))['then'](respondWithResult(_0x3ae5fd,null))[_0x82f6('0x25')](handleError(_0x3ae5fd,null));};exports['destroy']=function(_0x2b566b,_0x416d05){return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x2b566b[_0x82f6('0x4e')]['id']}})[_0x82f6('0x30')](handleEntityNotFound(_0x416d05,null))[_0x82f6('0x30')](removeEntity(_0x416d05,null))[_0x82f6('0x25')](handleError(_0x416d05,null));};exports[_0x82f6('0x54')]=function(_0x430088,_0x87a2ee){return db['SmsMessage'][_0x82f6('0x54')]()[_0x82f6('0x30')](respondWithResult(_0x87a2ee,null))[_0x82f6('0x25')](handleError(_0x87a2ee,null));};var interaction_log=require('../../config/logger')('sms-interactions');exports[_0x82f6('0x55')]=function(_0x1401bc,_0x3019b2,_0x129fea){var _0x3ce103={'agent':{},'channel':_0x82f6('0x56')};if(_0x1401bc[_0x82f6('0x53')]['id']){delete _0x1401bc[_0x82f6('0x53')]['id'];}_0x1401bc[_0x82f6('0x53')]['read']=!![];_0x1401bc[_0x82f6('0x53')]['readAt']=moment()[_0x82f6('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')]=_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')]||_0x1401bc['user']['id'];_0x3ce103['agent']['id']=_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')];return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x1401bc[_0x82f6('0x4e')]['id'],'UserId':null}})[_0x82f6('0x30')](handleEntityNotFound(_0x3019b2,null))['then'](saveUpdates(_0x1401bc[_0x82f6('0x53')],null))[_0x82f6('0x30')](function(_0x58702e){if(_0x58702e){_0x3ce103['message']=_0x58702e[_0x82f6('0x59')]({'plain':!![]});return db[_0x82f6('0x5a')][_0x82f6('0x51')]({'where':{'id':_0x58702e[_0x82f6('0x5b')]}});}return null;})['then'](handleEntityNotFound(_0x3019b2,null))[_0x82f6('0x30')](function(_0x1acea0){if(_0x1acea0){return _0x1acea0[_0x82f6('0x2e')]({'UserId':_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')],'read1stAt':_[_0x82f6('0x5c')](_0x1acea0['read1stAt'])?moment()[_0x82f6('0x57')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x82f6('0x30')](function(_0x5664f3){if(_0x5664f3){_0x3ce103[_0x82f6('0x5d')]=_0x5664f3[_0x82f6('0x59')]({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1401bc['user']['id'],_0x1401bc[_0x82f6('0x5e')][_0x82f6('0x33')],_0x1401bc[_0x82f6('0x5e')][_0x82f6('0x5f')],_0x3ce103[_0x82f6('0x5d')]['id'],_0x1401bc[_0x82f6('0x53')]?JSON[_0x82f6('0x21')](_0x1401bc[_0x82f6('0x53')]):_0x82f6('0x60'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x3ce103);}return null;})[_0x82f6('0x30')](function(_0x2ef543){var _0x5e631a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2ef543[_0x82f6('0x24')]['ContactId'];return db[_0x82f6('0x61')][_0x82f6('0x3e')](_0x5e631a,{'type':db[_0x82f6('0x62')][_0x82f6('0x63')]['SELECT'],'raw':!![]})[_0x82f6('0x30')](function(_0x2f0984){return _0x2f0984;});})[_0x82f6('0x30')](function(_0x21efb0){if(_0x21efb0){_0x3ce103[_0x82f6('0x24')]['contact']=_0x21efb0[0x0];if(!_0x1401bc[_0x82f6('0x53')]['UserId'])return;return db[_0x82f6('0x64')][_0x82f6('0x51')]({'where':{'id':_0x1401bc[_0x82f6('0x53')][_0x82f6('0x58')],'role':_0x82f6('0x65')},'attributes':['id','name',_0x82f6('0x66'),_0x82f6('0x67'),_0x82f6('0x68')],'raw':!![]});}return null;})[_0x82f6('0x30')](function(_0x1514aa){if(!_0x1514aa)return null;_0x3ce103[_0x82f6('0x24')][_0x82f6('0x65')]=_0x1514aa;return _0x3ce103;})[_0x82f6('0x30')](function(_0x391ad5){if(_0x391ad5){if(_0x1401bc[_0x82f6('0x53')][_0x82f6('0x69')]){_0x3ce103[_0x82f6('0x24')][_0x82f6('0x6a')]=util[_0x82f6('0x57')](_0x82f6('0x6b'),_0x1401bc[_0x82f6('0x5e')][_0x82f6('0x33')]);_0x3ce103[_0x82f6('0x24')][_0x82f6('0x6c')]=_0x3ce103['channel'];_0x3ce103[_0x82f6('0x24')][_0x82f6('0x6d')]=_0x3ce103[_0x82f6('0x6c')];_0x3ce103['message'][_0x82f6('0x6e')]=_0x82f6('0x55');return respondWithRpcPromise(_0x82f6('0x6f'),_0x82f6('0x6f'),{'event':'acceptmessage','message':_0x3ce103[_0x82f6('0x24')]},client9002)[_0x82f6('0x30')](function(){return _0x3ce103;});}return _0x3ce103;}return null;})['then'](respondWithResult(_0x3019b2,null))['catch'](handleError(_0x3019b2,null));};var interaction_log=require(_0x82f6('0x70'))(_0x82f6('0x71'));exports[_0x82f6('0x72')]=function(_0x3bc42a,_0x399b18,_0x5959e4){var _0x4f8463={'agent':{},'channel':_0x82f6('0x56')};if(_0x3bc42a['body']['id']){delete _0x3bc42a[_0x82f6('0x53')]['id'];}_0x3bc42a['body'][_0x82f6('0x58')]=_0x3bc42a[_0x82f6('0x53')]['UserId']||_0x3bc42a[_0x82f6('0x5e')]['id'];_0x4f8463[_0x82f6('0x65')]['id']=_0x3bc42a['body'][_0x82f6('0x58')];return db[_0x82f6('0x37')][_0x82f6('0x51')]({'where':{'id':_0x3bc42a[_0x82f6('0x4e')]['id'],'UserId':null}})[_0x82f6('0x30')](handleEntityNotFound(_0x399b18,null))[_0x82f6('0x30')](function(_0x5022d4){if(_0x5022d4){_0x4f8463['message']=_0x5022d4[_0x82f6('0x59')]({'plain':!![]});return db[_0x82f6('0x5a')]['find']({'where':{'id':_0x5022d4['SmsInteractionId']}});}return null;})[_0x82f6('0x30')](handleEntityNotFound(_0x399b18,null))[_0x82f6('0x30')](function(_0x1e8683){if(_0x1e8683){_0x4f8463['interaction']=_0x1e8683[_0x82f6('0x59')]({'plain':!![]});interaction_log[_0x82f6('0x1d')](_0x82f6('0x73'),_0x3bc42a['user']['id'],_0x3bc42a[_0x82f6('0x5e')][_0x82f6('0x33')],_0x3bc42a[_0x82f6('0x5e')][_0x82f6('0x5f')],_0x4f8463[_0x82f6('0x5d')]['id'],_0x3bc42a[_0x82f6('0x53')]?JSON[_0x82f6('0x21')](_0x3bc42a['body']):_0x82f6('0x60'));return respondWithRpcPromise(_0x82f6('0x74'),_0x82f6('0x75'),_0x4f8463);}return null;})[_0x82f6('0x30')](function(_0x34fd0c){var _0x5d715a=_0x82f6('0x76')+_0x34fd0c['message'][_0x82f6('0x77')];return db['sequelize']['query'](_0x5d715a,{'type':db[_0x82f6('0x62')]['QueryTypes']['SELECT'],'raw':!![]})[_0x82f6('0x30')](function(_0x1ffc0b){return _0x1ffc0b;});})[_0x82f6('0x30')](function(_0xf829cd){if(_0xf829cd){_0x4f8463[_0x82f6('0x24')][_0x82f6('0x78')]=_0xf829cd[0x0];if(!_0x3bc42a[_0x82f6('0x53')][_0x82f6('0x58')])return;return db[_0x82f6('0x64')][_0x82f6('0x51')]({'where':{'id':_0x3bc42a['body']['UserId'],'role':_0x82f6('0x65')},'attributes':['id','name','fullname',_0x82f6('0x67'),'internal'],'raw':!![]});}return null;})[_0x82f6('0x30')](function(_0x2c0fca){if(!_0x2c0fca)return null;_0x4f8463[_0x82f6('0x24')][_0x82f6('0x65')]=_0x2c0fca;return _0x4f8463;})[_0x82f6('0x30')](function(_0x2d8696){if(_0x2d8696){_0x2d8696[_0x82f6('0x24')]['interface']=util[_0x82f6('0x57')](_0x82f6('0x6b'),_0x3bc42a[_0x82f6('0x5e')][_0x82f6('0x33')]);_0x2d8696[_0x82f6('0x24')][_0x82f6('0x6c')]=_0x4f8463['channel'];_0x2d8696[_0x82f6('0x24')][_0x82f6('0x6d')]=_0x4f8463['channel'];_0x2d8696[_0x82f6('0x24')][_0x82f6('0x6e')]=_0x82f6('0x72');respondWithRpcPromise(_0x82f6('0x6f'),_0x82f6('0x6f'),{'event':'rejectmessage','message':_0x2d8696[_0x82f6('0x24')]},client9002);return _0x4f8463;}return null;})['then'](respondWithResult(_0x399b18,null))[_0x82f6('0x25')](handleError(_0x399b18,null));};exports[_0x82f6('0x26')]=function(_0x5c86b8,_0x3cf092,_0x242449){if(_0x5c86b8[_0x82f6('0x53')]['id']){delete _0x5c86b8['body']['id'];}var _0x146b53;return db[_0x82f6('0x37')]['find']({'where':{'id':_0x5c86b8[_0x82f6('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3cf092,null))[_0x82f6('0x30')](function(_0x49f926){if(_0x49f926){_0x146b53=_0x49f926;return db[_0x82f6('0x79')][_0x82f6('0x51')]({'where':{'id':_0x49f926[_0x82f6('0x7a')]}});}})[_0x82f6('0x30')](handleEntityNotFound(_0x3cf092,null))[_0x82f6('0x30')](function(_0x54ac7b){if(_0x54ac7b){logger[_0x82f6('0x7b')](_0x82f6('0x20'),'status',_0x82f6('0x7c'),_0x54ac7b[_0x82f6('0x39')],util[_0x82f6('0x7d')](_0x5c86b8['body'],{'showHidden':![],'depth':null}));switch(_0x54ac7b[_0x82f6('0x39')]){case _0x82f6('0x7e'):if(_0x5c86b8['body'][_0x82f6('0x7f')]&&_0x5c86b8[_0x82f6('0x53')][_0x82f6('0x7f')]===_0x146b53[_0x82f6('0x80')]){return _0x146b53['update']({'read':!![]});}else{logger[_0x82f6('0x22')](_0x82f6('0x81'),_0x82f6('0x26'),_0x82f6('0x7e'),util['inspect'](_0x5c86b8[_0x82f6('0x53')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x5c86b8[_0x82f6('0x53')]['MessageUUID']&&_0x5c86b8['body'][_0x82f6('0x82')]===_0x146b53['messageId']&&_[_0x82f6('0x83')]([_0x82f6('0x84'),_0x82f6('0x85')],_0x5c86b8['body'][_0x82f6('0x86')])>=0x0){return _0x146b53['update']({'read':!![]});}else{logger[_0x82f6('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x82f6('0x26'),'plivio',util['inspect'](_0x5c86b8['body'],{'showHidden':![],'depth':null}));}break;case _0x82f6('0x87'):var _0x5144fe=_0x5c86b8[_0x82f6('0x53')][_0x82f6('0x88')][0x0];if(_0x5144fe[_0x82f6('0x26')][_0x82f6('0x89')]===_0x82f6('0x8a')){return _0x146b53[_0x82f6('0x2e')]({'read':!![]});}else{logger[_0x82f6('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x82f6('0x26'),'infobip',util['inspect'](_0x5c86b8['body'],{'showHidden':![],'depth':null}));}break;}return _0x146b53;}})[_0x82f6('0x30')](respondWithResult(_0x3cf092,null))['catch'](handleError(_0x3cf092,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 3508265..bb97f9b 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 _0x3860=['emit','hasOwnProperty','hook','exports','events','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x5b4f01,_0x4f419e){var _0x1d4f3c=function(_0x2f9d37){while(--_0x2f9d37){_0x5b4f01['push'](_0x5b4f01['shift']());}};_0x1d4f3c(++_0x4f419e);}(_0x3860,0x130));var _0x0386=function(_0xda8519,_0x3afd8b){_0xda8519=_0xda8519-0x0;var _0x43cb0e=_0x3860[_0xda8519];return _0x43cb0e;};'use strict';var EventEmitter=require(_0x0386('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x0386('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x0386('0x2')](0x0);var events={'afterCreate':_0x0386('0x3'),'afterUpdate':_0x0386('0x4'),'afterDestroy':_0x0386('0x5')};function emitEvent(_0x47f8b8){return function(_0x732992,_0x1e9bc4,_0x586240){SmsMessageEvents[_0x0386('0x6')](_0x47f8b8+':'+_0x732992['id'],_0x732992);SmsMessageEvents[_0x0386('0x6')](_0x47f8b8,_0x732992);_0x586240(null);};}for(var e in events){if(events[_0x0386('0x7')](e)){var event=events[e];SmsMessage[_0x0386('0x8')](e,emitEvent(event));}}module[_0x0386('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xa9ae=['hook','exports','events','SmsMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3e4285,_0x83a4f0){var _0xce09e7=function(_0x2f13ee){while(--_0x2f13ee){_0x3e4285['push'](_0x3e4285['shift']());}};_0xce09e7(++_0x83a4f0);}(_0xa9ae,0x8a));var _0xea9a=function(_0x5b654f,_0x538724){_0x5b654f=_0x5b654f-0x0;var _0x553212=_0xa9ae[_0x5b654f];return _0x553212;};'use strict';var EventEmitter=require(_0xea9a('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xea9a('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xea9a('0x2')](0x0);var events={'afterCreate':_0xea9a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x55868a){return function(_0x27d614,_0x1266b4,_0x2e3686){SmsMessageEvents[_0xea9a('0x4')](_0x55868a+':'+_0x27d614['id'],_0x27d614);SmsMessageEvents[_0xea9a('0x4')](_0x55868a,_0x27d614);_0x2e3686(null);};}for(var e in events){if(events[_0xea9a('0x5')](e)){var event=events[e];SmsMessage[_0xea9a('0x6')](e,emitEvent(event));}}module[_0xea9a('0x7')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 0fa815f..bc0fc0f 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 _0x7e16=['intelepeer','Token\x20not\x20received','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','SmsMessage','fti_sms_messages','body','FULLTEXT','models','direction','secret','isNil','UserId','SmsInteraction','SmsInteractionId','then','createdAt','toLowerCase','catch','error','out','find','SmsAccountId','twilio','accountSid','phone','authToken','create','remote','/api/sms/messages/','/status?token=','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','senderString','format','%s:%s','https://rest.clicksend.com/v3/sms/send','http_code','queued_count','head','data','messages','clickSend','plivo','token','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messageId','csc','crypto','apiKey','login','text','timestamp','keys','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','toString','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status'];(function(_0x3f2b15,_0x2df038){var _0x342e3a=function(_0x2b27f1){while(--_0x2b27f1){_0x3f2b15['push'](_0x3f2b15['shift']());}};_0x342e3a(++_0x2df038);}(_0x7e16,0x16f));var _0x67e1=function(_0x20a6af,_0x5d22e8){_0x20a6af=_0x20a6af-0x0;var _0x3eaa32=_0x7e16[_0x20a6af];return _0x3eaa32;};'use strict';var _=require(_0x67e1('0x0'));var util=require(_0x67e1('0x1'));var logger=require(_0x67e1('0x2'))(_0x67e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67e1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67e1('0x5'));var config=require(_0x67e1('0x6'));var attributes=require('./smsMessage.attributes');module[_0x67e1('0x7')]=function(_0x3b5769,_0x2e0cb9){return _0x3b5769[_0x67e1('0x8')](_0x67e1('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':_0x67e1('0xa'),'fields':[_0x67e1('0xb')],'type':_0x67e1('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d7af4,_0x5878f8,_0x25df8c){var _0x3d4181=_0x3b5769[_0x67e1('0xd')];var _0x12eda1=_0x3d7af4['get']({'plain':!![]});if(_0x12eda1[_0x67e1('0xe')]['toLowerCase']()==='in'||_0x12eda1[_0x67e1('0xe')]['toLowerCase']()==='out'&&!_0x12eda1[_0x67e1('0xf')]&&!_[_0x67e1('0x10')](_0x12eda1[_0x67e1('0x11')])){_0x3d4181[_0x67e1('0x12')]['findOne']({'where':{'id':_0x12eda1[_0x67e1('0x13')]}})[_0x67e1('0x14')](function(_0x13564c){if(_0x13564c){_0x13564c['update']({'lastMsgAt':_0x12eda1[_0x67e1('0x15')],'lastMsgDirection':_0x12eda1[_0x67e1('0xe')][_0x67e1('0x16')]()});}})[_0x67e1('0x17')](function(_0x25d1ef){console[_0x67e1('0x18')](_0x25d1ef);});}if(_0x12eda1[_0x67e1('0xe')]===_0x67e1('0x19')&&!_0x12eda1[_0x67e1('0xf')]){var _0x12e7ff;_0x3d4181['SmsAccount'][_0x67e1('0x1a')]({'where':{'id':_0x12eda1[_0x67e1('0x1b')]},'raw':!![]})[_0x67e1('0x14')](function(_0x4ffd00){_0x12e7ff=_0x4ffd00;if(_0x12e7ff&&_0x12e7ff['type']){switch(_0x12e7ff['type']){case _0x67e1('0x1c'):var _0xaabf4f=require(_0x67e1('0x1c'));if(_0x12e7ff[_0x67e1('0x1d')]&&_0x12e7ff['authToken']&&_0x12e7ff[_0x67e1('0x1e')]){var _0x3278e7=new _0xaabf4f(_0x12e7ff[_0x67e1('0x1d')],_0x12e7ff[_0x67e1('0x1f')]);_0x3278e7['messages'][_0x67e1('0x20')]({'body':_0x12eda1[_0x67e1('0xb')],'to':_0x12eda1[_0x67e1('0x1e')],'from':_0x12e7ff[_0x67e1('0x1e')],'statusCallback':_0x12e7ff[_0x67e1('0x21')]+_0x67e1('0x22')+_0x12eda1['id']+_0x67e1('0x23')+_0x12e7ff['token']})[_0x67e1('0x14')](function(_0xeb0e69){if(_0xeb0e69[_0x67e1('0x24')]){return _0x3d7af4[_0x67e1('0x25')]({'messageId':_0xeb0e69[_0x67e1('0x24')]});}})[_0x67e1('0x17')](function(_0x16fcd0){logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),'twilio',util[_0x67e1('0x28')](_0x16fcd0,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),'afterCreate',_0x67e1('0x1c'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x67e1('0x29'):var _0x78a580=_0x67e1('0x2a');if(_0x12e7ff[_0x67e1('0x2b')]&&_0x12e7ff[_0x67e1('0x2c')]){var _0x5a670d={'recipient':[_0x12eda1[_0x67e1('0x1e')]],'message':_0x12eda1[_0x67e1('0xb')],'message_type':_0x12e7ff['smsMethod']};if(_0x12e7ff[_0x67e1('0x2d')]&&_0x12e7ff[_0x67e1('0x2d')]!=='SI'){_0x5a670d[_0x67e1('0x2e')]=_0x12e7ff[_0x67e1('0x1e')];}var _0x137ab8={'url':_0x78a580+_0x67e1('0x2f')+_0x12e7ff['username']+'&password='+_0x12e7ff['password'],'method':'GET'};rp(_0x137ab8)[_0x67e1('0x14')](function(_0x2f347b){var _0x4928b6=_0x2f347b[_0x67e1('0x30')](';');var _0x294a62={'user_key':_0x4928b6[0x0],'session_key':_0x4928b6[0x1]};_0x137ab8={'url':_0x78a580+_0x67e1('0x31'),'method':_0x67e1('0x32'),'headers':{'user_key':_0x294a62[_0x67e1('0x33')],'Session_key':_0x294a62[_0x67e1('0x34')]},'json':!![],'body':_0x5a670d};return rp(_0x137ab8);})[_0x67e1('0x14')](function(_0x32a86f){if(_0x32a86f['total_sent']>=0x1){var _0x1833e1={'messageId':_0x32a86f['internal_order_id']};if(_0x12e7ff[_0x67e1('0x2d')]!=='GP'||!_0x12e7ff['deliveryReport']){_0x1833e1[_0x67e1('0x35')]=!![];}return _0x3d7af4['update'](_0x1833e1);}else{return logger[_0x67e1('0x18')](_0x67e1('0x26'),'afterCreate','skebby',util['inspect'](_0x32a86f,{'showHidden':![],'depth':null}));}})[_0x67e1('0x17')](function(_0x5be892){return logger[_0x67e1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x67e1('0x27'),'skebby',util['inspect'](_0x5be892,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),'afterCreate',_0x67e1('0x29'),_0x67e1('0x36'));}break;case _0x67e1('0x37'):if(_0x12e7ff[_0x67e1('0x1f')]){var _0x52ef1d={'recipient':_0x12eda1[_0x67e1('0x1e')],'message':_0x12eda1[_0x67e1('0xb')],'sender':_0x12e7ff['senderString']||_0x12e7ff[_0x67e1('0x1e')],'authorization':_0x12e7ff[_0x67e1('0x1f')]};var _0x5878f8={'method':_0x67e1('0x32'),'uri':_0x67e1('0x38'),'body':_0x52ef1d,'json':!![]};rp(_0x5878f8)[_0x67e1('0x14')](function(_0x2a2963){var _0x1ee78e={'messageId':_0x2a2963[_0x67e1('0x39')]};if(!_0x12e7ff[_0x67e1('0x3a')]){_0x1ee78e[_0x67e1('0x35')]=!![];}return _0x3d7af4[_0x67e1('0x25')](_0x1ee78e);})[_0x67e1('0x17')](function(_0x3fff67){logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x37'),util[_0x67e1('0x28')](_0x3fff67,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x37'),_0x67e1('0x3b'));}break;case _0x67e1('0x3c'):if(_0x12e7ff[_0x67e1('0x2b')]&&_0x12e7ff['password']){var _0x52ef1d={'messages':[{'source':'xCALLY\x20Motion','to':_0x12eda1['phone'],'body':_0x12eda1[_0x67e1('0xb')],'from':_0x12e7ff[_0x67e1('0x3d')]||_0x12e7ff[_0x67e1('0x1e')]}]};var _0x6497a3=util[_0x67e1('0x3e')](_0x67e1('0x3f'),_0x12e7ff[_0x67e1('0x2b')],_0x12e7ff['password']);var _0x5878f8={'method':_0x67e1('0x32'),'uri':_0x67e1('0x40'),'body':_0x52ef1d,'headers':{'Authorization':util[_0x67e1('0x3e')]('Basic\x20%s',new Buffer(_0x6497a3)['toString']('base64'))},'json':!![]};rp(_0x5878f8)[_0x67e1('0x14')](function(_0x12d745){if(_0x12d745[_0x67e1('0x41')]>=0xc8&&_0x12d745[_0x67e1('0x41')]<=0xce){if(_0x12d745['data']&&_0x12d745['data'][_0x67e1('0x42')]>0x0){var _0x452ecd=_[_0x67e1('0x43')](_0x12d745[_0x67e1('0x44')][_0x67e1('0x45')]);var _0x48c8de={'messageId':_0x452ecd['message_id']};if(!_0x12e7ff[_0x67e1('0x3a')]){_0x48c8de[_0x67e1('0x35')]=!![];}return _0x3d7af4[_0x67e1('0x25')](_0x48c8de);}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),'clickSend',util[_0x67e1('0x28')](_0x12d745,{'showHidden':![],'depth':null}));}}else{logger[_0x67e1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x67e1('0x27'),_0x67e1('0x46'),util['inspect'](_0x12d745,{'showHidden':![],'depth':null}));}})['catch'](function(_0x2367dd){logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x46'),util[_0x67e1('0x28')](_0x2367dd,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x46'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x67e1('0x47'):if(_0x12e7ff['authId']&&_0x12e7ff[_0x67e1('0x1f')]){var _0x52ef1d={'dst':_0x12eda1[_0x67e1('0x1e')],'text':_0x12eda1['body'],'src':_0x12e7ff[_0x67e1('0x3d')]||_0x12e7ff['phone'],'url':_0x12e7ff[_0x67e1('0x21')]+'/api/sms/messages/'+_0x12eda1['id']+_0x67e1('0x23')+_0x12e7ff[_0x67e1('0x48')]};var _0x6497a3=util[_0x67e1('0x3e')](_0x67e1('0x3f'),_0x12e7ff[_0x67e1('0x49')],_0x12e7ff[_0x67e1('0x1f')]);var _0x5878f8={'method':'POST','uri':util[_0x67e1('0x3e')](_0x67e1('0x4a'),_0x12e7ff[_0x67e1('0x49')]),'body':_0x52ef1d,'headers':{'Authorization':util[_0x67e1('0x3e')](_0x67e1('0x4b'),new Buffer(_0x6497a3)['toString'](_0x67e1('0x4c')))},'json':!![]};rp(_0x5878f8)[_0x67e1('0x14')](function(_0x4996e6){var _0x21ed9b={'messageId':_0x4996e6[_0x67e1('0x4d')][0x0]};return _0x3d7af4[_0x67e1('0x25')](_0x21ed9b);})[_0x67e1('0x17')](function(_0x32e765){logger[_0x67e1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x67e1('0x27'),_0x67e1('0x47'),util[_0x67e1('0x28')](_0x32e765,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x47'),_0x67e1('0x4e'));}break;case _0x67e1('0x4f'):if(_0x12e7ff[_0x67e1('0x2b')]&&_0x12e7ff[_0x67e1('0x2c')]){if(_0x12e7ff[_0x67e1('0x50')]){var _0x4a34a6={'method':'POST','uri':_0x12e7ff[_0x67e1('0x50')]+_0x67e1('0x51'),'body':{'username':_0x12e7ff[_0x67e1('0x2b')],'password':_0x12e7ff[_0x67e1('0x2c')]},'json':!![]};return rp(_0x4a34a6)[_0x67e1('0x14')](function(_0x275b19){var _0x234764={'method':_0x67e1('0x32'),'uri':_0x12e7ff[_0x67e1('0x50')]+_0x67e1('0x52'),'body':{'messages':[{'from':_0x12e7ff[_0x67e1('0x1e')],'destinations':[{'to':_0x12eda1[_0x67e1('0x1e')]}],'text':_0x12eda1[_0x67e1('0xb')],'notifyUrl':_0x12e7ff['remote']+_0x67e1('0x22')+_0x12eda1['id']+_0x67e1('0x23')+_0x12e7ff[_0x67e1('0x48')],'notifyContentType':_0x67e1('0x53'),'callbackData':_0x12e7ff[_0x67e1('0x1e')]+';'+_0x12eda1[_0x67e1('0xb')]}]},'headers':{'Authorization':_0x67e1('0x54')+_0x275b19['token']},'json':!![]};return rp(_0x234764)[_0x67e1('0x14')](function(_0x4040d8){if(_0x4040d8[_0x67e1('0x45')]){var _0x13c727={'messageId':_0x4040d8[_0x67e1('0x45')][0x0][_0x67e1('0x55')]};if(!_0x12e7ff['deliveryReport']){_0x13c727[_0x67e1('0x35')]=!![];}return _0x3d7af4[_0x67e1('0x25')](_0x13c727);}else{return logger[_0x67e1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x67e1('0x27'),_0x67e1('0x4f'),util['inspect'](_0x4040d8,{'showHidden':![],'depth':null}));}});})[_0x67e1('0x17')](function(_0x5dcf74){return logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x4f'),util[_0x67e1('0x28')](_0x5dcf74,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x67e1('0x4f'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x4f'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x67e1('0x56'):var _0x41d1f4=require(_0x67e1('0x57'));if(_0x12e7ff[_0x67e1('0x58')]){var _0x3ebf4a={};_0x3ebf4a[_0x67e1('0x59')]=_0x12e7ff['username'];_0x3ebf4a[_0x67e1('0x1e')]=_0x12eda1[_0x67e1('0x1e')];_0x3ebf4a[_0x67e1('0x2e')]=_0x12e7ff[_0x67e1('0x1e')];_0x3ebf4a[_0x67e1('0x5a')]=_0x12eda1[_0x67e1('0xb')];_0x3ebf4a[_0x67e1('0x5b')]=+new Date();var _0x275a87='';var _0x325f50='';var _0x20017a=Object[_0x67e1('0x5c')](_0x3ebf4a);_0x20017a['sort']();for(var _0x2f4263=0x0;_0x2f4263<_0x20017a['length'];_0x2f4263++){if(_0x275a87!=''){_0x275a87+='&';}_0x275a87+=_0x20017a[_0x2f4263]+'='+encodeURIComponent(_0x3ebf4a[_0x20017a[_0x2f4263]]);_0x325f50+=_0x3ebf4a[_0x20017a[_0x2f4263]];}_0x325f50+=_0x12e7ff[_0x67e1('0x58')];_0x325f50=_0x41d1f4[_0x67e1('0x5d')](_0x67e1('0x5e'))[_0x67e1('0x25')](_0x325f50)[_0x67e1('0x5f')](_0x67e1('0x60'));if(_0x275a87!==''){_0x275a87+='&';}_0x275a87+=_0x67e1('0x61')+_0x325f50;var _0x137ab8={'method':_0x67e1('0x62'),'uri':_0x12e7ff['baseUrl']+_0x67e1('0x63')+_0x275a87,'json':!![]};return rp(_0x137ab8)['then'](function(_0x187059){var _0x1bbfa9=Object[_0x67e1('0x5c')](_0x187059);if(_0x187059[_0x1bbfa9[0x0]][_0x67e1('0x18')]&&parseInt(_0x187059[_0x1bbfa9[0x0]][_0x67e1('0x18')])===0x0){var _0x70ebd={'messageId':_0x187059[_0x1bbfa9[0x0]][_0x67e1('0x64')]};if(!_0x12e7ff[_0x67e1('0x3a')]){_0x70ebd[_0x67e1('0x35')]=!![];}return _0x3d7af4[_0x67e1('0x25')](_0x70ebd);}else{return logger['error'](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x56'),util['inspect'](_0x187059['error'],{'showHidden':![],'depth':null}));}})[_0x67e1('0x17')](function(_0x2e46a5){return logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x56'),util[_0x67e1('0x28')](_0x2e46a5,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x67e1('0x56'),_0x67e1('0x65'));}break;case'clickatell':if(_0x12e7ff[_0x67e1('0x58')]){var _0xbb18={'method':_0x67e1('0x32'),'uri':_0x67e1('0x66'),'headers':{'Authorization':_0x12e7ff[_0x67e1('0x58')]},'body':{'content':_0x12eda1['body'],'to':[_0x12eda1[_0x67e1('0x1e')]],'from':_0x12e7ff[_0x67e1('0x1e')],'binary':![],'clientMessageId':_0x67e1('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0xbb18)['then'](function(_0x541b5f){if(!_0x541b5f[_0x67e1('0x18')]){var _0x4405bd={'messageId':_0x541b5f[_0x67e1('0x45')][0x0][_0x67e1('0x68')]};if(!_0x12e7ff['deliveryReport']){_0x4405bd[_0x67e1('0x35')]=!![];}return _0x3d7af4[_0x67e1('0x25')](_0x4405bd);}else{return logger['error'](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x69'),util[_0x67e1('0x28')](_0x541b5f[_0x67e1('0x18')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x46dbb1){return logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x69'),util[_0x67e1('0x28')](_0x46dbb1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x69'),_0x67e1('0x65'));}break;case _0x67e1('0x6a'):if(_0x12e7ff[_0x67e1('0x2b')]&&_0x12e7ff[_0x67e1('0x2c')]){var _0x6497a3=util['format']('%s:%s',_0x12e7ff[_0x67e1('0x2b')],_0x12e7ff[_0x67e1('0x2c')]);var _0x5878f8={'method':_0x67e1('0x32'),'uri':_0x67e1('0x6b')+_0x12e7ff[_0x67e1('0x6c')]+_0x67e1('0x6d'),'body':{'to':[_0x12eda1[_0x67e1('0x1e')]],'text':_0x12eda1['body'],'from':_0x12e7ff[_0x67e1('0x1e')],'applicationId':_0x12e7ff[_0x67e1('0x6e')]},'headers':{'Authorization':util[_0x67e1('0x3e')](_0x67e1('0x4b'),new Buffer(_0x6497a3)[_0x67e1('0x6f')](_0x67e1('0x4c')))},'json':!![]};rp(_0x5878f8)[_0x67e1('0x14')](function(_0x1d938a){if(_0x1d938a['id']){var _0x2110b8={'messageId':_0x1d938a['id']};return _0x3d7af4[_0x67e1('0x25')](_0x2110b8);}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x6a'),util['inspect'](_0x1d938a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x19542f){logger['error'](_0x67e1('0x26'),'afterCreate','bandwidth',util[_0x67e1('0x28')](_0x19542f,{'showHidden':![],'depth':null}));});}else{logger[_0x67e1('0x18')](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x6a'),_0x67e1('0x36'));}break;case'intelepeer':if(_0x12e7ff['apiKey']){var _0x4a3a1a={};var _0x137ab8={'method':_0x67e1('0x32'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x67e1('0x70')+_0x12e7ff[_0x67e1('0x58')],'Content-Type':'application/json'},'body':{'from':_0x12e7ff[_0x67e1('0x1e')],'to':_0x12eda1['phone'],'text':_0x12eda1[_0x67e1('0xb')]},'json':!![]};return rp(_0x137ab8)[_0x67e1('0x14')](function(_0x41611b){if(_0x41611b[_0x67e1('0x71')]==0xca){_0x4a3a1a[_0x67e1('0x72')]=_0x41611b;var _0x243f7f={'method':_0x67e1('0x32'),'uri':_0x67e1('0x73'),'headers':{'Authorization':_0x67e1('0x70')+_0x12e7ff[_0x67e1('0x58')],'Content-Type':_0x67e1('0x53')},'body':{'refid':_0x4a3a1a['message']['refid']},'json':!![]};return rp(_0x243f7f)[_0x67e1('0x14')](function(_0x6df97a){_0x4a3a1a[_0x67e1('0x74')]=_0x6df97a;var _0x39f05f={'messageId':_0x4a3a1a[_0x67e1('0x72')]['refid'],'read':!![]};return _0x3d7af4[_0x67e1('0x25')](_0x39f05f);});}else{return logger['error'](_0x67e1('0x26'),_0x67e1('0x27'),_0x67e1('0x75'),util[_0x67e1('0x28')](_0x41611b,{'showHidden':![],'depth':null}));}})[_0x67e1('0x17')](function(_0x373111){return logger['error'](_0x67e1('0x26'),'afterCreate',_0x67e1('0x75'),util[_0x67e1('0x28')](_0x373111,{'showHidden':![],'depth':null}));});}else{return logger[_0x67e1('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x67e1('0x27'),_0x67e1('0x75'),_0x67e1('0x76'));}break;}}})[_0x67e1('0x77')](function(){_0x25df8c();});}else{_0x25df8c();}}},'charset':'utf8mb4','collate':_0x67e1('0x78')});}; \ No newline at end of file +var _0xfa7c=['secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','direction','catch','error','SmsAccount','SmsAccountId','then','type','twilio','accountSid','authToken','phone','remote','/api/sms/messages/','/status?token=','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','smsMethod','sender','login?username=','username','&password=','password','GET','sms','POST','user_key','total_sent','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','http_code','data','queued_count','head','messages','deliveryReport','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','hex','signature=','/external/get/send.php?','csc','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','application/json','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','toLowerCase','out'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x2aed4e,_0x5c0f33){_0x2aed4e=_0x2aed4e-0x0;var _0x57ea25=_0xfa7c[_0x2aed4e];return _0x57ea25;};'use strict';var _=require(_0xcfa7('0x0'));var util=require('util');var logger=require(_0xcfa7('0x1'))(_0xcfa7('0x2'));var moment=require(_0xcfa7('0x3'));var BPromise=require(_0xcfa7('0x4'));var rp=require(_0xcfa7('0x5'));var fs=require('fs');var path=require(_0xcfa7('0x6'));var rimraf=require(_0xcfa7('0x7'));var config=require(_0xcfa7('0x8'));var attributes=require('./smsMessage.attributes');module[_0xcfa7('0x9')]=function(_0x3bf816,_0x9d96a2){return _0x3bf816[_0xcfa7('0xa')]('SmsMessage',attributes,{'tableName':_0xcfa7('0xb'),'paranoid':![],'indexes':[{'name':_0xcfa7('0xc'),'fields':[_0xcfa7('0xc')]},{'name':_0xcfa7('0xd'),'fields':[_0xcfa7('0xe')],'type':_0xcfa7('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4ae349,_0x1c862b,_0x39ce6a){var _0x43700c=_0x3bf816[_0xcfa7('0x10')];var _0x240b3e=_0x4ae349['get']({'plain':!![]});if(_0x240b3e['direction'][_0xcfa7('0x11')]()==='in'||_0x240b3e['direction'][_0xcfa7('0x11')]()===_0xcfa7('0x12')&&!_0x240b3e[_0xcfa7('0x13')]&&!_[_0xcfa7('0x14')](_0x240b3e[_0xcfa7('0x15')])){_0x43700c[_0xcfa7('0x16')][_0xcfa7('0x17')]({'where':{'id':_0x240b3e[_0xcfa7('0x18')]}})['then'](function(_0x42500c){if(_0x42500c){_0x42500c['update']({'lastMsgAt':_0x240b3e['createdAt'],'lastMsgDirection':_0x240b3e[_0xcfa7('0x19')][_0xcfa7('0x11')]()});}})[_0xcfa7('0x1a')](function(_0x349679){console[_0xcfa7('0x1b')](_0x349679);});}if(_0x240b3e['direction']===_0xcfa7('0x12')&&!_0x240b3e[_0xcfa7('0x13')]){var _0x1236d5;_0x43700c[_0xcfa7('0x1c')]['find']({'where':{'id':_0x240b3e[_0xcfa7('0x1d')]},'raw':!![]})[_0xcfa7('0x1e')](function(_0x558a21){_0x1236d5=_0x558a21;if(_0x1236d5&&_0x1236d5['type']){switch(_0x1236d5[_0xcfa7('0x1f')]){case _0xcfa7('0x20'):var _0x1ce356=require(_0xcfa7('0x20'));if(_0x1236d5[_0xcfa7('0x21')]&&_0x1236d5[_0xcfa7('0x22')]&&_0x1236d5[_0xcfa7('0x23')]){var _0x602f15=new _0x1ce356(_0x1236d5['accountSid'],_0x1236d5[_0xcfa7('0x22')]);_0x602f15['messages']['create']({'body':_0x240b3e['body'],'to':_0x240b3e[_0xcfa7('0x23')],'from':_0x1236d5['phone'],'statusCallback':_0x1236d5[_0xcfa7('0x24')]+_0xcfa7('0x25')+_0x240b3e['id']+_0xcfa7('0x26')+_0x1236d5[_0xcfa7('0x27')]})[_0xcfa7('0x1e')](function(_0x2d00e1){if(_0x2d00e1[_0xcfa7('0x28')]){return _0x4ae349[_0xcfa7('0x29')]({'messageId':_0x2d00e1['sid']});}})[_0xcfa7('0x1a')](function(_0x222ce2){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x20'),util[_0xcfa7('0x2b')](_0x222ce2,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),'twilio',_0xcfa7('0x2d'));}break;case _0xcfa7('0x2e'):var _0x347d17=_0xcfa7('0x2f');if(_0x1236d5['username']&&_0x1236d5['password']){var _0x569f4e={'recipient':[_0x240b3e[_0xcfa7('0x23')]],'message':_0x240b3e[_0xcfa7('0xe')],'message_type':_0x1236d5[_0xcfa7('0x30')]};if(_0x1236d5['smsMethod']&&_0x1236d5['smsMethod']!=='SI'){_0x569f4e[_0xcfa7('0x31')]=_0x1236d5['phone'];}var _0x22799c={'url':_0x347d17+_0xcfa7('0x32')+_0x1236d5[_0xcfa7('0x33')]+_0xcfa7('0x34')+_0x1236d5[_0xcfa7('0x35')],'method':_0xcfa7('0x36')};rp(_0x22799c)[_0xcfa7('0x1e')](function(_0xdea3ba){var _0x34bb00=_0xdea3ba['split'](';');var _0x4b3f8a={'user_key':_0x34bb00[0x0],'session_key':_0x34bb00[0x1]};_0x22799c={'url':_0x347d17+_0xcfa7('0x37'),'method':_0xcfa7('0x38'),'headers':{'user_key':_0x4b3f8a[_0xcfa7('0x39')],'Session_key':_0x4b3f8a['session_key']},'json':!![],'body':_0x569f4e};return rp(_0x22799c);})['then'](function(_0x204c27){if(_0x204c27[_0xcfa7('0x3a')]>=0x1){var _0x3d12fe={'messageId':_0x204c27['internal_order_id']};if(_0x1236d5[_0xcfa7('0x30')]!=='GP'||!_0x1236d5['deliveryReport']){_0x3d12fe[_0xcfa7('0x3b')]=!![];}return _0x4ae349['update'](_0x3d12fe);}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x2e'),util[_0xcfa7('0x2b')](_0x204c27,{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x1156fb){return logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x2e'),util[_0xcfa7('0x2b')](_0x1156fb,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x2e'),_0xcfa7('0x3c'));}break;case _0xcfa7('0x3d'):if(_0x1236d5['authToken']){var _0x51678c={'recipient':_0x240b3e[_0xcfa7('0x23')],'message':_0x240b3e['body'],'sender':_0x1236d5[_0xcfa7('0x3e')]||_0x1236d5[_0xcfa7('0x23')],'authorization':_0x1236d5[_0xcfa7('0x22')]};var _0x1c862b={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x3f'),'body':_0x51678c,'json':!![]};rp(_0x1c862b)['then'](function(_0x118e38){var _0x41b014={'messageId':_0x118e38[_0xcfa7('0x40')]};if(!_0x1236d5['deliveryReport']){_0x41b014[_0xcfa7('0x3b')]=!![];}return _0x4ae349[_0xcfa7('0x29')](_0x41b014);})[_0xcfa7('0x1a')](function(_0x1c8fc6){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x3d'),util['inspect'](_0x1c8fc6,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x3d'),_0xcfa7('0x41'));}break;case'clicksend':if(_0x1236d5[_0xcfa7('0x33')]&&_0x1236d5['password']){var _0x51678c={'messages':[{'source':_0xcfa7('0x42'),'to':_0x240b3e['phone'],'body':_0x240b3e[_0xcfa7('0xe')],'from':_0x1236d5[_0xcfa7('0x3e')]||_0x1236d5[_0xcfa7('0x23')]}]};var _0x2333e9=util[_0xcfa7('0x43')](_0xcfa7('0x44'),_0x1236d5[_0xcfa7('0x33')],_0x1236d5[_0xcfa7('0x35')]);var _0x1c862b={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x45'),'body':_0x51678c,'headers':{'Authorization':util[_0xcfa7('0x43')](_0xcfa7('0x46'),new Buffer(_0x2333e9)[_0xcfa7('0x47')]('base64'))},'json':!![]};rp(_0x1c862b)[_0xcfa7('0x1e')](function(_0x4b9358){if(_0x4b9358[_0xcfa7('0x48')]>=0xc8&&_0x4b9358[_0xcfa7('0x48')]<=0xce){if(_0x4b9358[_0xcfa7('0x49')]&&_0x4b9358['data'][_0xcfa7('0x4a')]>0x0){var _0x3b1659=_[_0xcfa7('0x4b')](_0x4b9358[_0xcfa7('0x49')][_0xcfa7('0x4c')]);var _0x433fde={'messageId':_0x3b1659['message_id']};if(!_0x1236d5[_0xcfa7('0x4d')]){_0x433fde[_0xcfa7('0x3b')]=!![];}return _0x4ae349[_0xcfa7('0x29')](_0x433fde);}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x4e'),util[_0xcfa7('0x2b')](_0x4b9358,{'showHidden':![],'depth':null}));}}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x4e'),util[_0xcfa7('0x2b')](_0x4b9358,{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x63b433){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate','clickSend',util[_0xcfa7('0x2b')](_0x63b433,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xcfa7('0x4f'):if(_0x1236d5[_0xcfa7('0x50')]&&_0x1236d5[_0xcfa7('0x22')]){var _0x51678c={'dst':_0x240b3e[_0xcfa7('0x23')],'text':_0x240b3e[_0xcfa7('0xe')],'src':_0x1236d5['senderString']||_0x1236d5[_0xcfa7('0x23')],'url':_0x1236d5[_0xcfa7('0x24')]+_0xcfa7('0x25')+_0x240b3e['id']+_0xcfa7('0x26')+_0x1236d5['token']};var _0x2333e9=util[_0xcfa7('0x43')]('%s:%s',_0x1236d5[_0xcfa7('0x50')],_0x1236d5[_0xcfa7('0x22')]);var _0x1c862b={'method':_0xcfa7('0x38'),'uri':util[_0xcfa7('0x43')](_0xcfa7('0x51'),_0x1236d5['authId']),'body':_0x51678c,'headers':{'Authorization':util[_0xcfa7('0x43')](_0xcfa7('0x46'),new Buffer(_0x2333e9)[_0xcfa7('0x47')](_0xcfa7('0x52')))},'json':!![]};rp(_0x1c862b)['then'](function(_0x3766e7){var _0x56a3f1={'messageId':_0x3766e7[_0xcfa7('0x53')][0x0]};return _0x4ae349[_0xcfa7('0x29')](_0x56a3f1);})[_0xcfa7('0x1a')](function(_0x44f69d){logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x4f'),util[_0xcfa7('0x2b')](_0x44f69d,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','plivo',_0xcfa7('0x54'));}break;case _0xcfa7('0x55'):if(_0x1236d5[_0xcfa7('0x33')]&&_0x1236d5[_0xcfa7('0x35')]){if(_0x1236d5[_0xcfa7('0x56')]){var _0x378cd1={'method':_0xcfa7('0x38'),'uri':_0x1236d5['baseUrl']+_0xcfa7('0x57'),'body':{'username':_0x1236d5[_0xcfa7('0x33')],'password':_0x1236d5[_0xcfa7('0x35')]},'json':!![]};return rp(_0x378cd1)[_0xcfa7('0x1e')](function(_0x5ebe68){var _0x558514={'method':_0xcfa7('0x38'),'uri':_0x1236d5[_0xcfa7('0x56')]+_0xcfa7('0x58'),'body':{'messages':[{'from':_0x1236d5[_0xcfa7('0x23')],'destinations':[{'to':_0x240b3e['phone']}],'text':_0x240b3e[_0xcfa7('0xe')],'notifyUrl':_0x1236d5[_0xcfa7('0x24')]+_0xcfa7('0x25')+_0x240b3e['id']+_0xcfa7('0x26')+_0x1236d5[_0xcfa7('0x27')],'notifyContentType':'application/json','callbackData':_0x1236d5[_0xcfa7('0x23')]+';'+_0x240b3e[_0xcfa7('0xe')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x5ebe68[_0xcfa7('0x27')]},'json':!![]};return rp(_0x558514)[_0xcfa7('0x1e')](function(_0x25564a){if(_0x25564a['messages']){var _0x2f94f6={'messageId':_0x25564a['messages'][0x0]['messageId']};if(!_0x1236d5['deliveryReport']){_0x2f94f6[_0xcfa7('0x3b')]=!![];}return _0x4ae349['update'](_0x2f94f6);}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate','infobip',util[_0xcfa7('0x2b')](_0x25564a,{'showHidden':![],'depth':null}));}});})[_0xcfa7('0x1a')](function(_0x11ccfc){return logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x55'),util[_0xcfa7('0x2b')](_0x11ccfc,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate','infobip',_0xcfa7('0x3c'));}break;case'csc':var _0x259476=require(_0xcfa7('0x59'));if(_0x1236d5[_0xcfa7('0x5a')]){var _0x566733={};_0x566733[_0xcfa7('0x5b')]=_0x1236d5['username'];_0x566733[_0xcfa7('0x23')]=_0x240b3e['phone'];_0x566733[_0xcfa7('0x31')]=_0x1236d5[_0xcfa7('0x23')];_0x566733[_0xcfa7('0x5c')]=_0x240b3e[_0xcfa7('0xe')];_0x566733[_0xcfa7('0x5d')]=+new Date();var _0x52df0a='';var _0x65cf01='';var _0x1657c9=Object[_0xcfa7('0x5e')](_0x566733);_0x1657c9[_0xcfa7('0x5f')]();for(var _0x366483=0x0;_0x366483<_0x1657c9[_0xcfa7('0x60')];_0x366483++){if(_0x52df0a!=''){_0x52df0a+='&';}_0x52df0a+=_0x1657c9[_0x366483]+'='+encodeURIComponent(_0x566733[_0x1657c9[_0x366483]]);_0x65cf01+=_0x566733[_0x1657c9[_0x366483]];}_0x65cf01+=_0x1236d5[_0xcfa7('0x5a')];_0x65cf01=_0x259476[_0xcfa7('0x61')]('md5')[_0xcfa7('0x29')](_0x65cf01)['digest'](_0xcfa7('0x62'));if(_0x52df0a!==''){_0x52df0a+='&';}_0x52df0a+=_0xcfa7('0x63')+_0x65cf01;var _0x22799c={'method':_0xcfa7('0x36'),'uri':_0x1236d5[_0xcfa7('0x56')]+_0xcfa7('0x64')+_0x52df0a,'json':!![]};return rp(_0x22799c)[_0xcfa7('0x1e')](function(_0x47f1f8){var _0x40f218=Object[_0xcfa7('0x5e')](_0x47f1f8);if(_0x47f1f8[_0x40f218[0x0]][_0xcfa7('0x1b')]&&parseInt(_0x47f1f8[_0x40f218[0x0]][_0xcfa7('0x1b')])===0x0){var _0xccb69e={'messageId':_0x47f1f8[_0x40f218[0x0]]['id_sms']};if(!_0x1236d5[_0xcfa7('0x4d')]){_0xccb69e[_0xcfa7('0x3b')]=!![];}return _0x4ae349['update'](_0xccb69e);}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),'afterCreate',_0xcfa7('0x65'),util['inspect'](_0x47f1f8['error'],{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x3fb1f9){return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x65'),util[_0xcfa7('0x2b')](_0x3fb1f9,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xcfa7('0x65'),_0xcfa7('0x66'));}break;case _0xcfa7('0x67'):if(_0x1236d5[_0xcfa7('0x5a')]){var _0x47f8e0={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x68'),'headers':{'Authorization':_0x1236d5[_0xcfa7('0x5a')]},'body':{'content':_0x240b3e[_0xcfa7('0xe')],'to':[_0x240b3e[_0xcfa7('0x23')]],'from':_0x1236d5[_0xcfa7('0x23')],'binary':![],'clientMessageId':_0xcfa7('0x69'),'charset':'UTF-8'},'json':!![]};rp(_0x47f8e0)['then'](function(_0x5f368d){if(!_0x5f368d[_0xcfa7('0x1b')]){var _0x1f06f3={'messageId':_0x5f368d[_0xcfa7('0x4c')][0x0]['apiMessageId']};if(!_0x1236d5[_0xcfa7('0x4d')]){_0x1f06f3[_0xcfa7('0x3b')]=!![];}return _0x4ae349[_0xcfa7('0x29')](_0x1f06f3);}else{return logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),'clickatell',util[_0xcfa7('0x2b')](_0x5f368d[_0xcfa7('0x1b')],{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x121a1b){return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x67'),util[_0xcfa7('0x2b')](_0x121a1b,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x67'),_0xcfa7('0x66'));}break;case _0xcfa7('0x6a'):if(_0x1236d5['username']&&_0x1236d5[_0xcfa7('0x35')]){var _0x2333e9=util[_0xcfa7('0x43')](_0xcfa7('0x44'),_0x1236d5[_0xcfa7('0x33')],_0x1236d5[_0xcfa7('0x35')]);var _0x1c862b={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x6b')+_0x1236d5[_0xcfa7('0x6c')]+_0xcfa7('0x6d'),'body':{'to':[_0x240b3e[_0xcfa7('0x23')]],'text':_0x240b3e[_0xcfa7('0xe')],'from':_0x1236d5[_0xcfa7('0x23')],'applicationId':_0x1236d5[_0xcfa7('0x6e')]},'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x2333e9)['toString'](_0xcfa7('0x52')))},'json':!![]};rp(_0x1c862b)['then'](function(_0x5ae924){if(_0x5ae924['id']){var _0x4d01f9={'messageId':_0x5ae924['id']};return _0x4ae349[_0xcfa7('0x29')](_0x4d01f9);}else{logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x6a'),util[_0xcfa7('0x2b')](_0x5ae924,{'showHidden':![],'depth':null}));}})['catch'](function(_0x34dcd7){logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),'bandwidth',util[_0xcfa7('0x2b')](_0x34dcd7,{'showHidden':![],'depth':null}));});}else{logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x6a'),_0xcfa7('0x3c'));}break;case _0xcfa7('0x6f'):if(_0x1236d5['apiKey']){var _0x5ecbfa={};var _0x22799c={'method':_0xcfa7('0x38'),'uri':_0xcfa7('0x70'),'headers':{'Authorization':_0xcfa7('0x71')+_0x1236d5[_0xcfa7('0x5a')],'Content-Type':'application/json'},'body':{'from':_0x1236d5[_0xcfa7('0x23')],'to':_0x240b3e[_0xcfa7('0x23')],'text':_0x240b3e[_0xcfa7('0xe')]},'json':!![]};return rp(_0x22799c)[_0xcfa7('0x1e')](function(_0x269a6f){if(_0x269a6f['code']==0xca){_0x5ecbfa[_0xcfa7('0x72')]=_0x269a6f;var _0x25f3e9={'method':_0xcfa7('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0xcfa7('0x71')+_0x1236d5[_0xcfa7('0x5a')],'Content-Type':_0xcfa7('0x73')},'body':{'refid':_0x5ecbfa[_0xcfa7('0x72')][_0xcfa7('0x74')]},'json':!![]};return rp(_0x25f3e9)[_0xcfa7('0x1e')](function(_0x369df9){_0x5ecbfa[_0xcfa7('0x75')]=_0x369df9;var _0x548693={'messageId':_0x5ecbfa['message'][_0xcfa7('0x74')],'read':!![]};return _0x4ae349[_0xcfa7('0x29')](_0x548693);});}else{return logger['error'](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x6f'),util[_0xcfa7('0x2b')](_0x269a6f,{'showHidden':![],'depth':null}));}})[_0xcfa7('0x1a')](function(_0x5df130){return logger[_0xcfa7('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xcfa7('0x2c'),_0xcfa7('0x6f'),util['inspect'](_0x5df130,{'showHidden':![],'depth':null}));});}else{return logger[_0xcfa7('0x1b')](_0xcfa7('0x2a'),_0xcfa7('0x2c'),_0xcfa7('0x6f'),_0xcfa7('0x76'));}break;}}})[_0xcfa7('0x77')](function(){_0x39ce6a();});}else{_0x39ce6a();}}},'charset':_0xcfa7('0x78'),'collate':_0xcfa7('0x79')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index e69351d..6287275 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 _0xc64b=['client','http','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','CreateSmsMessage','SmsMessage','body','options','raw','catch','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0xd8cf2b,_0x24ef0e){var _0x28a529=function(_0xe2b66f){while(--_0xe2b66f){_0xd8cf2b['push'](_0xd8cf2b['shift']());}};_0x28a529(++_0x24ef0e);}(_0xc64b,0x110));var _0xbc64=function(_0x4f33ff,_0x4cc52d){_0x4f33ff=_0x4f33ff-0x0;var _0x40e19c=_0xc64b[_0x4f33ff];return _0x40e19c;};'use strict';var _=require('lodash');var util=require(_0xbc64('0x0'));var moment=require('moment');var BPromise=require(_0xbc64('0x1'));var rs=require(_0xbc64('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc64('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc64('0x4'))(_0xbc64('0x5'));var config=require(_0xbc64('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xbc64('0x7')][_0xbc64('0x8')]({'port':0x232a});config['redis']=_[_0xbc64('0x9')](config[_0xbc64('0xa')],{'host':_0xbc64('0xb'),'port':0x18eb});var socket=require(_0xbc64('0xc'))(new Redis(config[_0xbc64('0xa')]));require(_0xbc64('0xd'))[_0xbc64('0xe')](socket);function respondWithRpcPromise(_0x469e72,_0x191c91,_0x271276){return new BPromise(function(_0x2bdf05,_0x1c532d){return client[_0xbc64('0xf')](_0x469e72,_0x271276)['then'](function(_0x4815c1){logger['info'](_0xbc64('0x10'),_0x191c91,'request\x20sent');logger[_0xbc64('0x11')](_0xbc64('0x12'),_0x191c91,'request\x20sent',JSON[_0xbc64('0x13')](_0x4815c1));if(_0x4815c1[_0xbc64('0x14')]){if(_0x4815c1['error']['code']===0x1f4){logger[_0xbc64('0x14')](_0xbc64('0x10'),_0x191c91,_0x4815c1[_0xbc64('0x14')][_0xbc64('0x15')]);return _0x1c532d(_0x4815c1[_0xbc64('0x14')][_0xbc64('0x15')]);}logger[_0xbc64('0x14')](_0xbc64('0x10'),_0x191c91,_0x4815c1['error'][_0xbc64('0x15')]);return _0x2bdf05(_0x4815c1[_0xbc64('0x14')]['message']);}else{logger[_0xbc64('0x16')](_0xbc64('0x10'),_0x191c91,_0xbc64('0x17'));_0x2bdf05(_0x4815c1[_0xbc64('0x18')]['message']);}})['catch'](function(_0x22dbd4){logger[_0xbc64('0x14')](_0xbc64('0x10'),_0x191c91,_0x22dbd4);_0x1c532d(_0x22dbd4);});});}exports[_0xbc64('0x19')]=function(_0x5ea991){var _0x57b33d=this;return new Promise(function(_0x3cbbf5,_0x2a20d0){return db[_0xbc64('0x1a')]['create'](_0x5ea991[_0xbc64('0x1b')],{'raw':_0x5ea991[_0xbc64('0x1c')]?_0x5ea991[_0xbc64('0x1c')][_0xbc64('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x8c920c){logger['info']('CreateSmsMessage',_0x5ea991);logger[_0xbc64('0x11')](_0xbc64('0x19'),_0x5ea991,JSON[_0xbc64('0x13')](_0x8c920c));_0x3cbbf5(_0x8c920c);})[_0xbc64('0x1e')](function(_0x1384cf){logger['error'](_0xbc64('0x19'),_0x1384cf[_0xbc64('0x15')],_0x5ea991);_0x2a20d0(_0x57b33d[_0xbc64('0x14')](0x1f4,_0x1384cf[_0xbc64('0x15')]));});});}; \ No newline at end of file +var _0x76c6=['CreateSmsMessage','SmsMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x16efb2,_0x360c71){var _0x5976e8=function(_0x16798e){while(--_0x16798e){_0x16efb2['push'](_0x16efb2['shift']());}};_0x5976e8(++_0x360c71);}(_0x76c6,0xba));var _0x676c=function(_0x50819e,_0x505edd){_0x50819e=_0x50819e-0x0;var _0x4c95b2=_0x76c6[_0x50819e];return _0x4c95b2;};'use strict';var _=require(_0x676c('0x0'));var util=require(_0x676c('0x1'));var moment=require(_0x676c('0x2'));var BPromise=require(_0x676c('0x3'));var rs=require(_0x676c('0x4'));var fs=require('fs');var Redis=require(_0x676c('0x5'));var db=require(_0x676c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x676c('0x7'))(_0x676c('0x8'));var config=require(_0x676c('0x9'));var jayson=require(_0x676c('0xa'));var client=jayson[_0x676c('0xb')][_0x676c('0xc')]({'port':0x232a});config[_0x676c('0xd')]=_[_0x676c('0xe')](config[_0x676c('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x676c('0xf'))(new Redis(config[_0x676c('0xd')]));require(_0x676c('0x10'))[_0x676c('0x11')](socket);function respondWithRpcPromise(_0x17006c,_0xddf4c8,_0x4b566e){return new BPromise(function(_0x5a6887,_0x16905b){return client[_0x676c('0x12')](_0x17006c,_0x4b566e)[_0x676c('0x13')](function(_0x53d2c8){logger[_0x676c('0x14')](_0x676c('0x15'),_0xddf4c8,_0x676c('0x16'));logger[_0x676c('0x17')](_0x676c('0x18'),_0xddf4c8,_0x676c('0x16'),JSON[_0x676c('0x19')](_0x53d2c8));if(_0x53d2c8[_0x676c('0x1a')]){if(_0x53d2c8[_0x676c('0x1a')]['code']===0x1f4){logger[_0x676c('0x1a')]('SmsMessage,\x20%s,\x20%s',_0xddf4c8,_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);return _0x16905b(_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);}logger[_0x676c('0x1a')](_0x676c('0x15'),_0xddf4c8,_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);return _0x5a6887(_0x53d2c8[_0x676c('0x1a')][_0x676c('0x1b')]);}else{logger[_0x676c('0x14')](_0x676c('0x15'),_0xddf4c8,_0x676c('0x16'));_0x5a6887(_0x53d2c8[_0x676c('0x1c')][_0x676c('0x1b')]);}})[_0x676c('0x1d')](function(_0x35373f){logger[_0x676c('0x1a')]('SmsMessage,\x20%s,\x20%s',_0xddf4c8,_0x35373f);_0x16905b(_0x35373f);});});}exports[_0x676c('0x1e')]=function(_0x4347b6){var _0x550939=this;return new Promise(function(_0x264bfb,_0x5a36d4){return db[_0x676c('0x1f')][_0x676c('0x20')](_0x4347b6[_0x676c('0x21')],{'raw':_0x4347b6[_0x676c('0x22')]?_0x4347b6[_0x676c('0x22')][_0x676c('0x23')]===undefined?!![]:![]:!![]})[_0x676c('0x13')](function(_0x32fde6){logger[_0x676c('0x14')]('CreateSmsMessage',_0x4347b6);logger[_0x676c('0x17')](_0x676c('0x1e'),_0x4347b6,JSON[_0x676c('0x19')](_0x32fde6));_0x264bfb(_0x32fde6);})['catch'](function(_0xc6b4eb){logger['error'](_0x676c('0x1e'),_0xc6b4eb[_0x676c('0x1b')],_0x4347b6);_0x5a36d4(_0x550939[_0x676c('0x1a')](0x1f4,_0xc6b4eb[_0x676c('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index dd04328..ceb3641 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 _0xf166=['removeListener','length','./smsMessage.events','remove','update'];(function(_0x50a09f,_0x3f4986){var _0x25d936=function(_0x1865b9){while(--_0x1865b9){_0x50a09f['push'](_0x50a09f['shift']());}};_0x25d936(++_0x3f4986);}(_0xf166,0x133));var _0x6f16=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf166[_0x5b644e];return _0x49c6bf;};'use strict';var SmsMessageEvents=require(_0x6f16('0x0'));var events=['save',_0x6f16('0x1'),_0x6f16('0x2')];function createListener(_0x3d105e,_0x1f040c){return function(_0x14acd4){_0x1f040c['emit'](_0x3d105e,_0x14acd4);};}function removeListener(_0xe8e834,_0x1745e0){return function(){SmsMessageEvents[_0x6f16('0x3')](_0xe8e834,_0x1745e0);};}exports['register']=function(_0xf096f7){for(var _0x2ac7b2=0x0,_0x1c08ba=events[_0x6f16('0x4')];_0x2ac7b2<_0x1c08ba;_0x2ac7b2++){var _0x466f24=events[_0x2ac7b2];var _0x239bda=createListener('smsMessage:'+_0x466f24,_0xf096f7);SmsMessageEvents['on'](_0x466f24,_0x239bda);}}; \ No newline at end of file +var _0xe27e=['remove','update','emit','register','length'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0xe27e,0x1c2));var _0xee27=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xe27e[_0x45783c];return _0x1161da;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0xee27('0x0'),_0xee27('0x1')];function createListener(_0x4e1213,_0x2fa5f8){return function(_0x50faf6){_0x2fa5f8[_0xee27('0x2')](_0x4e1213,_0x50faf6);};}function removeListener(_0x4bfb1b,_0x120ba9){return function(){SmsMessageEvents['removeListener'](_0x4bfb1b,_0x120ba9);};}exports[_0xee27('0x3')]=function(_0x2aed64){for(var _0x442b7c=0x0,_0x537ec1=events[_0xee27('0x4')];_0x442b7c<_0x537ec1;_0x442b7c++){var _0x347fb3=events[_0x442b7c];var _0x384549=createListener('smsMessage:'+_0x347fb3,_0x2aed64);SmsMessageEvents['on'](_0x347fb3,_0x384549);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 37e5e2e..28e2883 100644 --- a/server/api/smsQueue/index.js +++ b/server/api/smsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x004c=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','removeTeams','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x004c,0x85));var _0xc004=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x004c[_0x3740fe];return _0x55492b;};'use strict';var multer=require(_0xc004('0x0'));var util=require(_0xc004('0x1'));var path=require(_0xc004('0x2'));var timeout=require(_0xc004('0x3'));var express=require('express');var router=express[_0xc004('0x4')]();var fs_extra=require(_0xc004('0x5'));var auth=require(_0xc004('0x6'));var interaction=require(_0xc004('0x7'));var config=require('../../config/environment');var controller=require(_0xc004('0x8'));router['get']('/',auth[_0xc004('0x9')](),controller[_0xc004('0xa')]);router[_0xc004('0xb')]('/describe',auth[_0xc004('0x9')](),controller[_0xc004('0xc')]);router[_0xc004('0xb')](_0xc004('0xd'),auth['isAuthenticated'](),controller[_0xc004('0xe')]);router[_0xc004('0xb')](_0xc004('0xf'),auth[_0xc004('0x9')](),controller[_0xc004('0x10')]);router[_0xc004('0xb')](_0xc004('0x11'),auth[_0xc004('0x9')](),controller[_0xc004('0x12')]);router[_0xc004('0xb')]('/:id/users',auth[_0xc004('0x9')](),controller[_0xc004('0x13')]);router[_0xc004('0x14')]('/',auth[_0xc004('0x9')](),controller[_0xc004('0x15')]);router[_0xc004('0x14')](_0xc004('0x11'),auth[_0xc004('0x9')](),controller[_0xc004('0x16')]);router[_0xc004('0x14')](_0xc004('0x17'),auth[_0xc004('0x9')](),controller[_0xc004('0x18')]);router[_0xc004('0x19')]('/:id',auth[_0xc004('0x9')](),controller[_0xc004('0x1a')]);router[_0xc004('0x1b')](_0xc004('0xd'),auth[_0xc004('0x9')](),controller['destroy']);router[_0xc004('0x1b')](_0xc004('0x11'),auth[_0xc004('0x9')](),controller[_0xc004('0x1c')]);router[_0xc004('0x1b')](_0xc004('0x17'),auth[_0xc004('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x13b0=['/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeAgents','util','path','express','../../components/interaction/service','./smsQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x13b0,0xe1));var _0x013b=function(_0x584a8f,_0x330d6c){_0x584a8f=_0x584a8f-0x0;var _0x3913a1=_0x13b0[_0x584a8f];return _0x3913a1;};'use strict';var multer=require('multer');var util=require(_0x013b('0x0'));var path=require(_0x013b('0x1'));var timeout=require('connect-timeout');var express=require(_0x013b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x013b('0x3'));var config=require('../../config/environment');var controller=require(_0x013b('0x4'));router['get']('/',auth[_0x013b('0x5')](),controller[_0x013b('0x6')]);router[_0x013b('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x013b('0x8')]);router[_0x013b('0x7')](_0x013b('0x9'),auth[_0x013b('0x5')](),controller[_0x013b('0xa')]);router['get'](_0x013b('0xb'),auth[_0x013b('0x5')](),controller[_0x013b('0xc')]);router['get'](_0x013b('0xd'),auth[_0x013b('0x5')](),controller[_0x013b('0xe')]);router['get'](_0x013b('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x013b('0x10')]('/',auth[_0x013b('0x5')](),controller[_0x013b('0x11')]);router[_0x013b('0x10')](_0x013b('0xd'),auth[_0x013b('0x5')](),controller[_0x013b('0x12')]);router['post'](_0x013b('0xf'),auth[_0x013b('0x5')](),controller[_0x013b('0x13')]);router['put'](_0x013b('0x9'),auth['isAuthenticated'](),controller[_0x013b('0x14')]);router[_0x013b('0x15')](_0x013b('0x9'),auth['isAuthenticated'](),controller[_0x013b('0x16')]);router['delete'](_0x013b('0xd'),auth[_0x013b('0x5')](),controller['removeTeams']);router[_0x013b('0x15')](_0x013b('0xf'),auth[_0x013b('0x5')](),controller[_0x013b('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index df463a7..d04bfe6 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 _0x5c7b=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5c7b,0x1a7));var _0xb5c7=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x5c7b[_0xc4001c];return _0x49f7bc;};'use strict';var Sequelize=require(_0xb5c7('0x0'));module[_0xb5c7('0x1')]={'name':{'type':Sequelize[_0xb5c7('0x2')],'unique':_0xb5c7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb5c7('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb5c7('0x4')](_0xb5c7('0x5'),_0xb5c7('0x6'),_0xb5c7('0x7'))}}; \ No newline at end of file +var _0x4681=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x3cf4d3,_0x48065e){var _0x4e547b=function(_0x28f85a){while(--_0x28f85a){_0x3cf4d3['push'](_0x3cf4d3['shift']());}};_0x4e547b(++_0x48065e);}(_0x4681,0x9b));var _0x1468=function(_0x3d864a,_0x378ce5){_0x3d864a=_0x3d864a-0x0;var _0x26e087=_0x4681[_0x3d864a];return _0x26e087;};'use strict';var Sequelize=require(_0x1468('0x0'));module[_0x1468('0x1')]={'name':{'type':Sequelize[_0x1468('0x2')],'unique':_0x1468('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1468('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x1468('0x5'),'beepall',_0x1468('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 3b22afe..6a01e94 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 _0xe81d=['describe','findOne','UserSmsQueue','nolimit','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','rows','format','%s/%s','createdAt','getTeams','Team','ids','Agents','online','flatMap','transaction','addTeams','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','omit','isArray','userSmsQueue:remove','getAgents','eml-format','rimraf','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','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','defaults','redis','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','error','stack','name','send','map','SmsQueue','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsQueues','userProfileId','autoAssociation'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0xe81d,0x142));var _0xde81=function(_0x4f1735,_0x1cbc25){_0x4f1735=_0x4f1735-0x0;var _0x5a3f8f=_0xe81d[_0x4f1735];return _0x5a3f8f;};'use strict';var emlformat=require(_0xde81('0x0'));var rimraf=require(_0xde81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xde81('0x2'));var BPromise=require(_0xde81('0x3'));var Mustache=require(_0xde81('0x4'));var util=require('util');var path=require(_0xde81('0x5'));var sox=require(_0xde81('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xde81('0x7'));var _=require(_0xde81('0x8'));var squel=require(_0xde81('0x9'));var crypto=require(_0xde81('0xa'));var jsforce=require(_0xde81('0xb'));var deskjs=require(_0xde81('0xc'));var toCsv=require('to-csv');var querystring=require(_0xde81('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xde81('0xe'));var qs=require(_0xde81('0xf'));var as=require(_0xde81('0x10'));var hardwareService=require(_0xde81('0x11'));var logger=require('../../config/logger')(_0xde81('0x12'));var utils=require(_0xde81('0x13'));var config=require(_0xde81('0x14'));var licenseUtil=require(_0xde81('0x15'));var db=require(_0xde81('0x16'))['db'];config['redis']=_[_0xde81('0x17')](config[_0xde81('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xde81('0x19'))[_0xde81('0x1a')](socket);function respondWithStatusCode(_0x4f329c,_0x4e8af6){_0x4e8af6=_0x4e8af6||0xcc;return function(_0x3d07c1){if(_0x3d07c1){return _0x4f329c[_0xde81('0x1b')](_0x4e8af6);}return _0x4f329c[_0xde81('0x1c')](_0x4e8af6)[_0xde81('0x1d')]();};}function respondWithResult(_0x2f3e0c,_0x5ca7fb){_0x5ca7fb=_0x5ca7fb||0xc8;return function(_0x106d70){if(_0x106d70){return _0x2f3e0c['status'](_0x5ca7fb)[_0xde81('0x1e')](_0x106d70);}};}function respondWithFilteredResult(_0x1014f0,_0x325c88){return function(_0x100cc1){if(_0x100cc1){var _0x4ab470=typeof _0x325c88[_0xde81('0x1f')]==='undefined'&&typeof _0x325c88['limit']===_0xde81('0x20');var _0x516d0d=_0x100cc1[_0xde81('0x21')];var _0x52eedd=_0x4ab470?0x0:_0x325c88[_0xde81('0x1f')];var _0x241e8e=_0x4ab470?_0x100cc1['count']:_0x325c88['offset']+_0x325c88[_0xde81('0x22')];var _0x4d353d;if(_0x241e8e>=_0x516d0d){_0x241e8e=_0x516d0d;_0x4d353d=0xc8;}else{_0x4d353d=0xce;}_0x1014f0[_0xde81('0x1c')](_0x4d353d);return _0x1014f0[_0xde81('0x23')](_0xde81('0x24'),_0x52eedd+'-'+_0x241e8e+'/'+_0x516d0d)['json'](_0x100cc1);}return null;};}function patchUpdates(_0x267dc4){return function(_0x8233af){try{jsonpatch[_0xde81('0x25')](_0x8233af,_0x267dc4,!![]);}catch(_0x489cf9){return BPromise[_0xde81('0x26')](_0x489cf9);}return _0x8233af[_0xde81('0x27')]();};}function saveUpdates(_0x429918,_0x200968){return function(_0x3d65cb){if(_0x3d65cb){return _0x3d65cb['update'](_0x429918)[_0xde81('0x28')](function(_0x2b7dae){return _0x2b7dae;});}return null;};}function removeEntity(_0x125466,_0x5aa545){return function(_0x537812){if(_0x537812){return _0x537812[_0xde81('0x29')]()[_0xde81('0x28')](function(){var _0x4412df=_0x537812[_0xde81('0x2a')]({'plain':!![]});var _0x9778e9='SmsQueues';return db[_0xde81('0x2b')][_0xde81('0x29')]({'where':{'type':_0x9778e9,'resourceId':_0x4412df['id']}})[_0xde81('0x28')](function(){return _0x537812;});})['then'](function(){_0x125466[_0xde81('0x1c')](0xcc)[_0xde81('0x1d')]();});}};}function handleEntityNotFound(_0x294894,_0x3f7094){return function(_0x47449b){if(!_0x47449b){_0x294894[_0xde81('0x1b')](0x194);}return _0x47449b;};}function handleError(_0x5cd8b1,_0x398082){_0x398082=_0x398082||0x1f4;return function(_0x5d69ad){logger[_0xde81('0x2c')](_0x5d69ad[_0xde81('0x2d')]);if(_0x5d69ad['name']){delete _0x5d69ad[_0xde81('0x2e')];}_0x5cd8b1['status'](_0x398082)[_0xde81('0x2f')](_0x5d69ad);};}exports['index']=function(_0x178e86,_0x537e9a){var _0x37c9a1={},_0x8c51e9={},_0x375432={'count':0x0,'rows':[]};var _0x507f75=_[_0xde81('0x30')](db[_0xde81('0x31')]['rawAttributes'],function(_0xc38c72){return{'name':_0xc38c72[_0xde81('0x32')],'type':_0xc38c72[_0xde81('0x33')]['key']};});_0x8c51e9[_0xde81('0x34')]=_[_0xde81('0x30')](_0x507f75,_0xde81('0x2e'));_0x8c51e9[_0xde81('0x35')]=_[_0xde81('0x36')](_0x178e86[_0xde81('0x35')]);_0x8c51e9['filters']=_[_0xde81('0x37')](_0x8c51e9['model'],_0x8c51e9[_0xde81('0x35')]);_0x37c9a1['attributes']=_[_0xde81('0x37')](_0x8c51e9['model'],qs[_0xde81('0x38')](_0x178e86[_0xde81('0x35')][_0xde81('0x38')]));_0x37c9a1[_0xde81('0x39')]=_0x37c9a1[_0xde81('0x39')][_0xde81('0x3a')]?_0x37c9a1[_0xde81('0x39')]:_0x8c51e9['model'];if(!_0x178e86[_0xde81('0x35')][_0xde81('0x3b')]('nolimit')){_0x37c9a1[_0xde81('0x22')]=qs['limit'](_0x178e86[_0xde81('0x35')][_0xde81('0x22')]);_0x37c9a1[_0xde81('0x1f')]=qs[_0xde81('0x1f')](_0x178e86[_0xde81('0x35')]['offset']);}_0x37c9a1[_0xde81('0x3c')]=qs['sort'](_0x178e86['query'][_0xde81('0x3d')]);_0x37c9a1[_0xde81('0x3e')]=qs['filters'](_[_0xde81('0x3f')](_0x178e86['query'],_0x8c51e9[_0xde81('0x40')]),_0x507f75);if(_0x178e86['query'][_0xde81('0x41')]){_0x37c9a1[_0xde81('0x3e')]=_[_0xde81('0x42')](_0x37c9a1[_0xde81('0x3e')],{'$or':_[_0xde81('0x30')](_0x507f75,function(_0x347ab2){if(_0x347ab2[_0xde81('0x33')]!==_0xde81('0x43')){var _0x580401={};_0x580401[_0x347ab2['name']]={'$like':'%'+_0x178e86['query'][_0xde81('0x41')]+'%'};return _0x580401;}})});}_0x37c9a1=_['merge']({},_0x37c9a1,_0x178e86[_0xde81('0x44')]);var _0x8b92ed={'where':_0x37c9a1[_0xde81('0x3e')]};return db['SmsQueue'][_0xde81('0x21')](_0x8b92ed)[_0xde81('0x28')](function(_0x809d0){_0x375432[_0xde81('0x21')]=_0x809d0;if(_0x178e86[_0xde81('0x35')][_0xde81('0x45')]){_0x37c9a1[_0xde81('0x46')]=[{'all':!![]}];}return db[_0xde81('0x31')][_0xde81('0x47')](_0x37c9a1);})[_0xde81('0x28')](function(_0x34549c){_0x375432['rows']=_0x34549c;return _0x375432;})['then'](respondWithFilteredResult(_0x537e9a,_0x37c9a1))[_0xde81('0x48')](handleError(_0x537e9a,null));};exports['show']=function(_0x1958fd,_0x570839){var _0x16836f={'raw':!![],'where':{'id':_0x1958fd[_0xde81('0x49')]['id']}},_0x554d45={};_0x554d45['model']=_['keys'](db[_0xde81('0x31')][_0xde81('0x4a')]);_0x554d45[_0xde81('0x35')]=_[_0xde81('0x36')](_0x1958fd['query']);_0x554d45[_0xde81('0x40')]=_[_0xde81('0x37')](_0x554d45[_0xde81('0x34')],_0x554d45[_0xde81('0x35')]);_0x16836f[_0xde81('0x39')]=_[_0xde81('0x37')](_0x554d45[_0xde81('0x34')],qs[_0xde81('0x38')](_0x1958fd['query']['fields']));_0x16836f[_0xde81('0x39')]=_0x16836f[_0xde81('0x39')][_0xde81('0x3a')]?_0x16836f['attributes']:_0x554d45[_0xde81('0x34')];if(_0x1958fd[_0xde81('0x35')][_0xde81('0x45')]){_0x16836f[_0xde81('0x46')]=[{'all':!![]}];}_0x16836f=_[_0xde81('0x42')]({},_0x16836f,_0x1958fd[_0xde81('0x44')]);return db[_0xde81('0x31')][_0xde81('0x4b')](_0x16836f)[_0xde81('0x28')](handleEntityNotFound(_0x570839,null))[_0xde81('0x28')](respondWithResult(_0x570839,null))[_0xde81('0x48')](handleError(_0x570839,null));};exports[_0xde81('0x4c')]=function(_0x1dd30a,_0x4e3bd4){return db['SmsQueue'][_0xde81('0x4c')](_0x1dd30a[_0xde81('0x4d')],{})['then'](function(_0x551588){var _0x599d26=_0x1dd30a[_0xde81('0x4e')][_0xde81('0x2a')]({'plain':!![]});if(!_0x599d26)throw new Error(_0xde81('0x4f'));if(_0x599d26['role']==='user'){var _0x569366=_0x551588[_0xde81('0x2a')]({'plain':!![]});var _0x42365d=_0xde81('0x50');return db['UserProfileSection'][_0xde81('0x4b')]({'where':{'name':_0x42365d,'userProfileId':_0x599d26[_0xde81('0x51')]},'raw':!![]})[_0xde81('0x28')](function(_0x4fe8ee){if(_0x4fe8ee&&_0x4fe8ee[_0xde81('0x52')]===0x0){return db[_0xde81('0x2b')]['create']({'name':_0x569366[_0xde81('0x2e')],'resourceId':_0x569366['id'],'type':_0x4fe8ee[_0xde81('0x2e')],'sectionId':_0x4fe8ee['id']},{})[_0xde81('0x28')](function(){return _0x551588;});}else{return _0x551588;}})[_0xde81('0x48')](function(_0x1eaa65){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1eaa65);throw _0x1eaa65;});}return _0x551588;})[_0xde81('0x28')](respondWithResult(_0x4e3bd4,0xc9))[_0xde81('0x48')](handleError(_0x4e3bd4,null));};exports['update']=function(_0x288f0d,_0x3e2904){if(_0x288f0d[_0xde81('0x4d')]['id']){delete _0x288f0d[_0xde81('0x4d')]['id'];}return db[_0xde81('0x31')][_0xde81('0x4b')]({'where':{'id':_0x288f0d['params']['id']}})['then'](handleEntityNotFound(_0x3e2904,null))[_0xde81('0x28')](saveUpdates(_0x288f0d[_0xde81('0x4d')],null))['then'](respondWithResult(_0x3e2904,null))[_0xde81('0x48')](handleError(_0x3e2904,null));};exports[_0xde81('0x29')]=function(_0x1aafea,_0x2fef82){return db['SmsQueue']['find']({'where':{'id':_0x1aafea['params']['id']}})['then'](handleEntityNotFound(_0x2fef82,null))['then'](removeEntity(_0x2fef82,null))[_0xde81('0x48')](handleError(_0x2fef82,null));};exports['describe']=function(_0x563096,_0x2e8433){return db[_0xde81('0x31')][_0xde81('0x53')]()[_0xde81('0x28')](respondWithResult(_0x2e8433,null))['catch'](handleError(_0x2e8433,null));};exports['getMembers']=function(_0x38f8e6,_0xec7373,_0x5011f8){var _0x18fc20={'raw':!![],'where':{}},_0x4b344b={},_0x397459;return db[_0xde81('0x31')][_0xde81('0x54')]({'where':{'id':_0x38f8e6[_0xde81('0x49')]['id']}})[_0xde81('0x28')](handleEntityNotFound(_0xec7373,null))[_0xde81('0x28')](function(_0x5c8396){if(_0x5c8396){_0x397459=_0x5c8396['get']({'plain':!![]});_0x4b344b[_0xde81('0x34')]=_['keys'](db[_0xde81('0x55')][_0xde81('0x4a')]);_0x4b344b[_0xde81('0x35')]=_[_0xde81('0x36')](_0x38f8e6[_0xde81('0x35')]);_0x4b344b[_0xde81('0x40')]=_[_0xde81('0x37')](_0x4b344b[_0xde81('0x34')],_0x4b344b[_0xde81('0x35')]);_0x18fc20[_0xde81('0x39')]=_[_0xde81('0x37')](_0x4b344b[_0xde81('0x34')],qs['fields'](_0x38f8e6['query'][_0xde81('0x38')]));_0x18fc20['attributes']=_0x18fc20[_0xde81('0x39')][_0xde81('0x3a')]?_0x18fc20[_0xde81('0x39')]:_0x4b344b[_0xde81('0x34')];if(!_0x38f8e6[_0xde81('0x35')][_0xde81('0x3b')](_0xde81('0x56'))){_0x18fc20[_0xde81('0x22')]=qs[_0xde81('0x22')](_0x38f8e6[_0xde81('0x35')][_0xde81('0x22')]);_0x18fc20[_0xde81('0x1f')]=qs[_0xde81('0x1f')](_0x38f8e6['query'][_0xde81('0x1f')]);}_0x18fc20['order']=qs[_0xde81('0x3d')](_0x38f8e6['query'][_0xde81('0x3d')]);_0x18fc20[_0xde81('0x3e')]=qs[_0xde81('0x40')](_[_0xde81('0x3f')](_0x38f8e6['query'],_0x4b344b[_0xde81('0x40')]));_0x18fc20['where'][_0xde81('0x57')]=_0x5c8396['id'];if(_0x38f8e6[_0xde81('0x35')]['filter']){_0x18fc20['where']=_[_0xde81('0x42')](_0x18fc20[_0xde81('0x3e')],{'$or':_['map'](_0x18fc20[_0xde81('0x39')],function(_0xac2640){var _0x40e845={};_0x40e845[_0xac2640]={'$like':'%'+_0x38f8e6['query'][_0xde81('0x41')]+'%'};return _0x40e845;})});}_0x18fc20=_[_0xde81('0x42')]({},_0x18fc20,_0x38f8e6[_0xde81('0x44')]);return db[_0xde81('0x55')][_0xde81('0x47')](_0x18fc20);}})[_0xde81('0x28')](function(_0x5b3479){if(_0x5b3479){return db[_0xde81('0x58')][_0xde81('0x59')]({'where':{'id':_[_0xde81('0x30')](_0x5b3479,'UserId'),'role':_0xde81('0x5a')},'attributes':['id',_0xde81('0x2e'),_0xde81('0x5b'),_0xde81('0x5c'),'createdAt']});}})[_0xde81('0x28')](function(_0x2037bd){if(_0x2037bd){return{'count':_0x2037bd['count'],'rows':_[_0xde81('0x30')](_0x2037bd[_0xde81('0x5d')],function(_0x2362d7){return{'membername':_0x2362d7['name'],'UserId':_0x2362d7['id'],'queue_name':_0x397459[_0xde81('0x2e')],'SmsQueueId':_0x397459['id'],'interface':util[_0xde81('0x5e')](_0xde81('0x5f'),'SIP',_0x2362d7[_0xde81('0x2e')]),'penalty':0x0,'paused':_0x2362d7[_0xde81('0x5b')],'createdAt':_0x2362d7[_0xde81('0x60')],'updatedAt':_0x2362d7[_0xde81('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xde81('0x28')](respondWithFilteredResult(_0xec7373,_0x18fc20))[_0xde81('0x48')](handleError(_0xec7373,null));};exports[_0xde81('0x61')]=function(_0x4bf364,_0x4c7a7b,_0x148702){var _0x37e7d3={};var _0x4ca585={};var _0x2f269a;var _0x5e6771;return db[_0xde81('0x31')]['findOne']({'where':{'id':_0x4bf364[_0xde81('0x49')]['id']}})['then'](handleEntityNotFound(_0x4c7a7b,null))[_0xde81('0x28')](function(_0x3914eb){if(_0x3914eb){_0x2f269a=_0x3914eb;_0x4ca585[_0xde81('0x34')]=_[_0xde81('0x36')](db[_0xde81('0x62')][_0xde81('0x4a')]);_0x4ca585['query']=_[_0xde81('0x36')](_0x4bf364[_0xde81('0x35')]);_0x4ca585[_0xde81('0x40')]=_[_0xde81('0x37')](_0x4ca585['model'],_0x4ca585[_0xde81('0x35')]);_0x37e7d3['attributes']=_[_0xde81('0x37')](_0x4ca585[_0xde81('0x34')],qs[_0xde81('0x38')](_0x4bf364[_0xde81('0x35')]['fields']));_0x37e7d3['attributes']=_0x37e7d3[_0xde81('0x39')][_0xde81('0x3a')]?_0x37e7d3[_0xde81('0x39')]:_0x4ca585['model'];_0x37e7d3[_0xde81('0x3c')]=qs['sort'](_0x4bf364[_0xde81('0x35')][_0xde81('0x3d')]);_0x37e7d3[_0xde81('0x3e')]=qs[_0xde81('0x40')](_['pick'](_0x4bf364[_0xde81('0x35')],_0x4ca585['filters']));if(_0x4bf364[_0xde81('0x35')][_0xde81('0x41')]){_0x37e7d3['where']=_['merge'](_0x37e7d3[_0xde81('0x3e')],{'$or':_['map'](_0x37e7d3['attributes'],function(_0x5ae861){var _0xf3590e={};_0xf3590e[_0x5ae861]={'$like':'%'+_0x4bf364[_0xde81('0x35')]['filter']+'%'};return _0xf3590e;})});}_0x37e7d3=_[_0xde81('0x42')]({},_0x37e7d3,_0x4bf364[_0xde81('0x44')]);return _0x2f269a[_0xde81('0x61')](_0x37e7d3);}})[_0xde81('0x28')](function(_0x4485c9){if(_0x4485c9){_0x5e6771=_0x4485c9[_0xde81('0x3a')];if(!_0x4bf364[_0xde81('0x35')][_0xde81('0x3b')](_0xde81('0x56'))){_0x37e7d3[_0xde81('0x22')]=qs[_0xde81('0x22')](_0x4bf364[_0xde81('0x35')][_0xde81('0x22')]);_0x37e7d3[_0xde81('0x1f')]=qs[_0xde81('0x1f')](_0x4bf364[_0xde81('0x35')][_0xde81('0x1f')]);}return _0x2f269a[_0xde81('0x61')](_0x37e7d3);}})[_0xde81('0x28')](function(_0x5586f9){if(_0x5586f9){return _0x5586f9?{'count':_0x5e6771,'rows':_0x5586f9}:null;}})[_0xde81('0x28')](respondWithResult(_0x4c7a7b,null))['catch'](handleError(_0x4c7a7b,null));};exports['addTeams']=function(_0x4ac3fc,_0x37d841,_0x448c53){var _0x94dbe0=_0x4ac3fc[_0xde81('0x4d')][_0xde81('0x63')];return db['Team'][_0xde81('0x47')]({'where':{'id':_0x94dbe0},'attributes':['id'],'include':[{'model':db[_0xde81('0x58')],'as':_0xde81('0x64'),'attributes':['id',_0xde81('0x2e'),_0xde81('0x65'),'voicePause','interface'],'raw':!![]}]})[_0xde81('0x28')](function(_0x50c7f4){if(_0x50c7f4){var _0x4a3d38=_[_0xde81('0x66')](_0x50c7f4,function(_0x24314c){var _0x44d9b3=_0x24314c[_0xde81('0x2a')]({'plain':!![]});return _0x44d9b3[_0xde81('0x64')];});return db[_0xde81('0x31')]['find']({'where':{'id':_0x4ac3fc['params']['id']}})[_0xde81('0x28')](function(_0x121684){return db['sequelize'][_0xde81('0x67')](function(_0x32eea3){return _0x121684[_0xde81('0x68')](_0x94dbe0,{'transaction':_0x32eea3})[_0xde81('0x28')](function(){return BPromise[_0xde81('0x69')](_0x4a3d38,function(_0x15e3c9){return db[_0xde81('0x55')][_0xde81('0x6a')]({'where':{'UserId':_0x15e3c9['id'],'SmsQueueId':_0x4ac3fc[_0xde81('0x49')]['id']},'transaction':_0x32eea3});});})[_0xde81('0x28')](function(){_0x4a3d38[_0xde81('0x6b')](function(_0x309391){socket[_0xde81('0x6c')]('userSmsQueue:save',{'UserId':_0x309391['id'],'SmsQueueId':_0x121684['id']});});});});});}})[_0xde81('0x28')](respondWithStatusCode(_0x37d841,null))[_0xde81('0x48')](handleError(_0x37d841,null));};exports[_0xde81('0x6d')]=function(_0x20914c,_0x3ddaee,_0x450a7e){return db[_0xde81('0x62')]['findAll']({'where':{'id':_0x20914c[_0xde81('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0xde81('0x58')],'as':_0xde81('0x64'),'attributes':['id'],'raw':!![]}]})[_0xde81('0x28')](handleEntityNotFound(_0x3ddaee,null))[_0xde81('0x28')](function(_0x5cf6c9){var _0x12ccd6=_[_0xde81('0x30')](_0x5cf6c9,'id');var _0x57a5c9=[];var _0x508c77=[];var _0x44faf0=squel[_0xde81('0x6e')]();_0x44faf0[_0xde81('0x6f')](_0xde81('0x70'))[_0xde81('0x71')]('team_has_sms_queues','tq')[_0xde81('0x72')]('user_has_teams','ut',_0xde81('0x73'))[_0xde81('0x3e')](_0xde81('0x74'),_0x20914c[_0xde81('0x49')]['id']);for(var _0x4ebc75=0x0;_0x4ebc75<_0x5cf6c9[_0xde81('0x3a')];_0x4ebc75+=0x1){let _0x5c42bb=_0x5cf6c9[_0x4ebc75];for(var _0x3e0edc=0x0;_0x3e0edc<_0x5c42bb[_0xde81('0x64')][_0xde81('0x3a')];_0x3e0edc+=0x1){let _0x287d09=_0x5c42bb[_0xde81('0x64')][_0x3e0edc];var _0x42457b=_0x44faf0[_0xde81('0x75')]();_0x42457b[_0xde81('0x3e')]('ut.UserId\x20=\x20?',_0x287d09['id']);_0x508c77[_0xde81('0x76')](db['sequelize']['query'](_0x42457b[_0xde81('0x77')](),{'type':db[_0xde81('0x78')]['QueryTypes'][_0xde81('0x79')]})[_0xde81('0x28')](function(_0x46f895){if(_0x46f895['length']===0x1){return _0x287d09['id'];}else{var _0x43d52b=_[_0xde81('0x7a')](_[_0xde81('0x30')](_0x46f895,_0xde81('0x7b')),function(_0x47994b){return _[_0xde81('0x7c')](_0x12ccd6,_0x47994b);});if(_0x43d52b){return _0x287d09['id'];}}}));}}return BPromise[_0xde81('0x7d')](_0x508c77)['then'](function(_0x5bffd5){_0x57a5c9=_(_0x57a5c9)[_0xde81('0x7e')](_0x5bffd5)[_0xde81('0x7f')]()[_0xde81('0x80')]();return db[_0xde81('0x31')][_0xde81('0x4b')]({'where':{'id':_0x20914c[_0xde81('0x49')]['id']}})[_0xde81('0x28')](function(_0x265afe){return db[_0xde81('0x78')][_0xde81('0x67')](function(_0x47e3a5){return _0x265afe[_0xde81('0x6d')](_0x20914c[_0xde81('0x35')][_0xde81('0x63')],{'transaction':_0x47e3a5})[_0xde81('0x28')](function(){if(!_['isEmpty'](_0x57a5c9)){return _0x265afe[_0xde81('0x81')](_0x57a5c9,{'transaction':_0x47e3a5});}})[_0xde81('0x28')](function(){_0x57a5c9[_0xde81('0x6b')](function(_0x63a5cf){socket[_0xde81('0x6c')]('userSmsQueue:remove',{'UserId':_0x63a5cf,'SmsQueueId':_0x265afe['id']});});});});});});})[_0xde81('0x28')](respondWithStatusCode(_0x3ddaee,null))[_0xde81('0x48')](handleError(_0x3ddaee,null));};exports['addAgents']=function(_0x59148a,_0x25ba44,_0x565fe3){return db['SmsQueue'][_0xde81('0x4b')]({'where':{'id':_0x59148a[_0xde81('0x49')]['id']}})['then'](handleEntityNotFound(_0x25ba44,null))[_0xde81('0x28')](function(_0x1b87f9){if(_0x1b87f9){return _0x1b87f9[_0xde81('0x82')](_0x59148a['body'][_0xde81('0x63')],_[_0xde81('0x83')](_0x59148a[_0xde81('0x4d')],['ids','id'])||{})['spread'](function(_0x554fa9){for(var _0x279af6=0x0;_0x279af6<_0x59148a[_0xde81('0x4d')][_0xde81('0x63')][_0xde81('0x3a')];_0x279af6+=0x1){socket[_0xde81('0x6c')]('userSmsQueue:save',{'UserId':Number(_0x59148a[_0xde81('0x4d')][_0xde81('0x63')][_0x279af6]),'SmsQueueId':Number(_0x59148a[_0xde81('0x49')]['id'])});}return _0x554fa9;});}})[_0xde81('0x28')](respondWithResult(_0x25ba44,null))[_0xde81('0x48')](handleError(_0x25ba44,null));};exports[_0xde81('0x81')]=function(_0x4a40c3,_0x4f9683,_0x3644a8){return db[_0xde81('0x31')][_0xde81('0x4b')]({'where':{'id':_0x4a40c3[_0xde81('0x49')]['id']}})[_0xde81('0x28')](handleEntityNotFound(_0x4f9683,null))[_0xde81('0x28')](function(_0x11b4f4){if(_0x11b4f4){return _0x11b4f4[_0xde81('0x81')](_0x4a40c3['query'][_0xde81('0x63')])[_0xde81('0x28')](function(){if(_[_0xde81('0x84')](_0x4a40c3[_0xde81('0x35')][_0xde81('0x63')])){for(var _0x1203c8=0x0;_0x1203c8<_0x4a40c3[_0xde81('0x35')]['ids'][_0xde81('0x3a')];_0x1203c8+=0x1){socket[_0xde81('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0x4a40c3['query']['ids'][_0x1203c8]),'SmsQueueId':Number(_0x4a40c3[_0xde81('0x49')]['id'])});}}else{socket[_0xde81('0x6c')](_0xde81('0x85'),{'UserId':Number(_0x4a40c3[_0xde81('0x35')][_0xde81('0x63')]),'SmsQueueId':Number(_0x4a40c3[_0xde81('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f9683,null))[_0xde81('0x48')](handleError(_0x4f9683,null));};exports[_0xde81('0x86')]=function(_0x34e549,_0x374d51,_0x1118b9){var _0x47aeca={};var _0x5d274e={};var _0x162c6b;var _0x1cdfd2;return db[_0xde81('0x31')]['findOne']({'where':{'id':_0x34e549['params']['id']}})[_0xde81('0x28')](handleEntityNotFound(_0x374d51,null))['then'](function(_0x83ffa1){if(_0x83ffa1){_0x162c6b=_0x83ffa1;_0x5d274e[_0xde81('0x34')]=_[_0xde81('0x36')](db['User']['rawAttributes']);_0x5d274e[_0xde81('0x35')]=_[_0xde81('0x36')](_0x34e549[_0xde81('0x35')]);_0x5d274e[_0xde81('0x40')]=_['intersection'](_0x5d274e['model'],_0x5d274e[_0xde81('0x35')]);_0x47aeca[_0xde81('0x39')]=_['intersection'](_0x5d274e[_0xde81('0x34')],qs[_0xde81('0x38')](_0x34e549[_0xde81('0x35')][_0xde81('0x38')]));_0x47aeca[_0xde81('0x39')]=_0x47aeca[_0xde81('0x39')][_0xde81('0x3a')]?_0x47aeca['attributes']:_0x5d274e['model'];_0x47aeca[_0xde81('0x3c')]=qs[_0xde81('0x3d')](_0x34e549['query'][_0xde81('0x3d')]);_0x47aeca[_0xde81('0x3e')]=qs[_0xde81('0x40')](_['pick'](_0x34e549[_0xde81('0x35')],_0x5d274e['filters']));if(_0x34e549[_0xde81('0x35')][_0xde81('0x41')]){_0x47aeca[_0xde81('0x3e')]=_[_0xde81('0x42')](_0x47aeca['where'],{'$or':_[_0xde81('0x30')](_0x47aeca[_0xde81('0x39')],function(_0x248cd8){var _0x3706b2={};_0x3706b2[_0x248cd8]={'$like':'%'+_0x34e549[_0xde81('0x35')][_0xde81('0x41')]+'%'};return _0x3706b2;})});}_0x47aeca=_[_0xde81('0x42')]({},_0x47aeca,_0x34e549[_0xde81('0x44')]);return _0x162c6b[_0xde81('0x86')](_0x47aeca);}})['then'](function(_0x2fbf53){if(_0x2fbf53){_0x1cdfd2=_0x2fbf53[_0xde81('0x3a')];if(!_0x34e549[_0xde81('0x35')][_0xde81('0x3b')](_0xde81('0x56'))){_0x47aeca[_0xde81('0x22')]=qs[_0xde81('0x22')](_0x34e549[_0xde81('0x35')][_0xde81('0x22')]);_0x47aeca[_0xde81('0x1f')]=qs[_0xde81('0x1f')](_0x34e549[_0xde81('0x35')][_0xde81('0x1f')]);}return _0x162c6b['getAgents'](_0x47aeca);}})[_0xde81('0x28')](function(_0x184ed3){if(_0x184ed3){return _0x184ed3?{'count':_0x1cdfd2,'rows':_0x184ed3}:null;}})[_0xde81('0x28')](respondWithResult(_0x374d51,null))[_0xde81('0x48')](handleError(_0x374d51,null));}; \ No newline at end of file +var _0xf0ba=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','SmsQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','User','UserId','updatedAt','createdAt','format','%s/%s','smsPause','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','UserSmsQueue','findOrCreate','forEach','emit','userSmsQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','all','union','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4da224,_0x2e68b7){var _0x1c4fee=function(_0x4be10b){while(--_0x4be10b){_0x4da224['push'](_0x4da224['shift']());}};_0x1c4fee(++_0x2e68b7);}(_0xf0ba,0x7a));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xaf0b('0x0'));var rimraf=require(_0xaf0b('0x1'));var zipdir=require(_0xaf0b('0x2'));var jsonpatch=require(_0xaf0b('0x3'));var rp=require(_0xaf0b('0x4'));var moment=require('moment');var BPromise=require(_0xaf0b('0x5'));var Mustache=require('mustache');var util=require(_0xaf0b('0x6'));var path=require(_0xaf0b('0x7'));var sox=require(_0xaf0b('0x8'));var csv=require(_0xaf0b('0x9'));var ejs=require(_0xaf0b('0xa'));var fs=require('fs');var fs_extra=require(_0xaf0b('0xb'));var _=require(_0xaf0b('0xc'));var squel=require(_0xaf0b('0xd'));var crypto=require(_0xaf0b('0xe'));var jsforce=require(_0xaf0b('0xf'));var deskjs=require(_0xaf0b('0x10'));var toCsv=require(_0xaf0b('0x9'));var querystring=require(_0xaf0b('0x11'));var Papa=require(_0xaf0b('0x12'));var Redis=require(_0xaf0b('0x13'));var authService=require(_0xaf0b('0x14'));var qs=require(_0xaf0b('0x15'));var as=require(_0xaf0b('0x16'));var hardwareService=require(_0xaf0b('0x17'));var logger=require('../../config/logger')(_0xaf0b('0x18'));var utils=require('../../config/utils');var config=require(_0xaf0b('0x19'));var licenseUtil=require(_0xaf0b('0x1a'));var db=require('../../mysqldb')['db'];config[_0xaf0b('0x1b')]=_[_0xaf0b('0x1c')](config[_0xaf0b('0x1b')],{'host':_0xaf0b('0x1d'),'port':0x18eb});var socket=require(_0xaf0b('0x1e'))(new Redis(config[_0xaf0b('0x1b')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x5a273c,_0x573b83){_0x573b83=_0x573b83||0xcc;return function(_0x3b09db){if(_0x3b09db){return _0x5a273c[_0xaf0b('0x1f')](_0x573b83);}return _0x5a273c[_0xaf0b('0x20')](_0x573b83)[_0xaf0b('0x21')]();};}function respondWithResult(_0x584236,_0x27df68){_0x27df68=_0x27df68||0xc8;return function(_0x57656c){if(_0x57656c){return _0x584236['status'](_0x27df68)[_0xaf0b('0x22')](_0x57656c);}};}function respondWithFilteredResult(_0x23cd7e,_0x28d23c){return function(_0x8e462e){if(_0x8e462e){var _0x9362e0=typeof _0x28d23c[_0xaf0b('0x23')]==='undefined'&&typeof _0x28d23c[_0xaf0b('0x24')]===_0xaf0b('0x25');var _0x34f98c=_0x8e462e[_0xaf0b('0x26')];var _0x5a4894=_0x9362e0?0x0:_0x28d23c[_0xaf0b('0x23')];var _0x5735c6=_0x9362e0?_0x8e462e['count']:_0x28d23c[_0xaf0b('0x23')]+_0x28d23c[_0xaf0b('0x24')];var _0x344fbb;if(_0x5735c6>=_0x34f98c){_0x5735c6=_0x34f98c;_0x344fbb=0xc8;}else{_0x344fbb=0xce;}_0x23cd7e[_0xaf0b('0x20')](_0x344fbb);return _0x23cd7e[_0xaf0b('0x27')](_0xaf0b('0x28'),_0x5a4894+'-'+_0x5735c6+'/'+_0x34f98c)['json'](_0x8e462e);}return null;};}function patchUpdates(_0x51c93d){return function(_0x1e068){try{jsonpatch[_0xaf0b('0x29')](_0x1e068,_0x51c93d,!![]);}catch(_0x91fde){return BPromise[_0xaf0b('0x2a')](_0x91fde);}return _0x1e068[_0xaf0b('0x2b')]();};}function saveUpdates(_0x43157c,_0x5814ba){return function(_0x484bf8){if(_0x484bf8){return _0x484bf8[_0xaf0b('0x2c')](_0x43157c)[_0xaf0b('0x2d')](function(_0x4ba937){return _0x4ba937;});}return null;};}function removeEntity(_0x1e40cb,_0xb94d7b){return function(_0x542ec4){if(_0x542ec4){return _0x542ec4[_0xaf0b('0x2e')]()[_0xaf0b('0x2d')](function(){var _0x3106a4=_0x542ec4[_0xaf0b('0x2f')]({'plain':!![]});var _0x4c82dd=_0xaf0b('0x30');return db[_0xaf0b('0x31')][_0xaf0b('0x2e')]({'where':{'type':_0x4c82dd,'resourceId':_0x3106a4['id']}})[_0xaf0b('0x2d')](function(){return _0x542ec4;});})[_0xaf0b('0x2d')](function(){_0x1e40cb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc8bc53,_0x1d03d8){return function(_0x74b60f){if(!_0x74b60f){_0xc8bc53[_0xaf0b('0x1f')](0x194);}return _0x74b60f;};}function handleError(_0x5a7621,_0x2cc44b){_0x2cc44b=_0x2cc44b||0x1f4;return function(_0x56aa64){logger[_0xaf0b('0x32')](_0x56aa64[_0xaf0b('0x33')]);if(_0x56aa64['name']){delete _0x56aa64[_0xaf0b('0x34')];}_0x5a7621[_0xaf0b('0x20')](_0x2cc44b)['send'](_0x56aa64);};}exports['index']=function(_0x1c1d67,_0x4092cd){var _0x2a1a9e={},_0x3d1300={},_0xa64943={'count':0x0,'rows':[]};var _0x163d97=_['map'](db[_0xaf0b('0x35')][_0xaf0b('0x36')],function(_0x11b466){return{'name':_0x11b466['fieldName'],'type':_0x11b466[_0xaf0b('0x37')][_0xaf0b('0x38')]};});_0x3d1300[_0xaf0b('0x39')]=_[_0xaf0b('0x3a')](_0x163d97,_0xaf0b('0x34'));_0x3d1300[_0xaf0b('0x3b')]=_[_0xaf0b('0x3c')](_0x1c1d67['query']);_0x3d1300[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x3d1300[_0xaf0b('0x39')],_0x3d1300[_0xaf0b('0x3b')]);_0x2a1a9e['attributes']=_[_0xaf0b('0x3e')](_0x3d1300[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x2a1a9e['attributes']=_0x2a1a9e['attributes']['length']?_0x2a1a9e[_0xaf0b('0x40')]:_0x3d1300[_0xaf0b('0x39')];if(!_0x1c1d67['query'][_0xaf0b('0x41')](_0xaf0b('0x42'))){_0x2a1a9e['limit']=qs[_0xaf0b('0x24')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x24')]);_0x2a1a9e[_0xaf0b('0x23')]=qs[_0xaf0b('0x23')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x23')]);}_0x2a1a9e[_0xaf0b('0x43')]=qs[_0xaf0b('0x44')](_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x2a1a9e[_0xaf0b('0x45')]=qs['filters'](_[_0xaf0b('0x46')](_0x1c1d67[_0xaf0b('0x3b')],_0x3d1300[_0xaf0b('0x3d')]),_0x163d97);if(_0x1c1d67[_0xaf0b('0x3b')]['filter']){_0x2a1a9e[_0xaf0b('0x45')]=_[_0xaf0b('0x47')](_0x2a1a9e[_0xaf0b('0x45')],{'$or':_[_0xaf0b('0x3a')](_0x163d97,function(_0x4a9eda){if(_0x4a9eda[_0xaf0b('0x37')]!==_0xaf0b('0x48')){var _0x382e25={};_0x382e25[_0x4a9eda[_0xaf0b('0x34')]]={'$like':'%'+_0x1c1d67[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x382e25;}})});}_0x2a1a9e=_[_0xaf0b('0x47')]({},_0x2a1a9e,_0x1c1d67[_0xaf0b('0x4a')]);var _0x4a5592={'where':_0x2a1a9e[_0xaf0b('0x45')]};return db[_0xaf0b('0x35')][_0xaf0b('0x26')](_0x4a5592)['then'](function(_0x4b3a4a){_0xa64943['count']=_0x4b3a4a;if(_0x1c1d67['query']['includeAll']){_0x2a1a9e[_0xaf0b('0x4b')]=[{'all':!![]}];}return db[_0xaf0b('0x35')][_0xaf0b('0x4c')](_0x2a1a9e);})[_0xaf0b('0x2d')](function(_0x40b0d6){_0xa64943[_0xaf0b('0x4d')]=_0x40b0d6;return _0xa64943;})[_0xaf0b('0x2d')](respondWithFilteredResult(_0x4092cd,_0x2a1a9e))[_0xaf0b('0x4e')](handleError(_0x4092cd,null));};exports['show']=function(_0x1e2155,_0x5d81ec){var _0x4c6e4e={'raw':!![],'where':{'id':_0x1e2155[_0xaf0b('0x4f')]['id']}},_0x271a18={};_0x271a18['model']=_[_0xaf0b('0x3c')](db['SmsQueue'][_0xaf0b('0x36')]);_0x271a18['query']=_[_0xaf0b('0x3c')](_0x1e2155[_0xaf0b('0x3b')]);_0x271a18[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x271a18['model'],_0x271a18[_0xaf0b('0x3b')]);_0x4c6e4e[_0xaf0b('0x40')]=_[_0xaf0b('0x3e')](_0x271a18[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x1e2155[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x4c6e4e[_0xaf0b('0x40')]=_0x4c6e4e[_0xaf0b('0x40')][_0xaf0b('0x50')]?_0x4c6e4e[_0xaf0b('0x40')]:_0x271a18['model'];if(_0x1e2155[_0xaf0b('0x3b')][_0xaf0b('0x51')]){_0x4c6e4e[_0xaf0b('0x4b')]=[{'all':!![]}];}_0x4c6e4e=_[_0xaf0b('0x47')]({},_0x4c6e4e,_0x1e2155[_0xaf0b('0x4a')]);return db[_0xaf0b('0x35')][_0xaf0b('0x52')](_0x4c6e4e)[_0xaf0b('0x2d')](handleEntityNotFound(_0x5d81ec,null))[_0xaf0b('0x2d')](respondWithResult(_0x5d81ec,null))[_0xaf0b('0x4e')](handleError(_0x5d81ec,null));};exports[_0xaf0b('0x53')]=function(_0xb7410,_0x1749c1){return db[_0xaf0b('0x35')][_0xaf0b('0x53')](_0xb7410['body'],{})[_0xaf0b('0x2d')](function(_0x4ddc9c){var _0x4e4174=_0xb7410[_0xaf0b('0x54')]['get']({'plain':!![]});if(!_0x4e4174)throw new Error(_0xaf0b('0x55'));if(_0x4e4174[_0xaf0b('0x56')]===_0xaf0b('0x54')){var _0x1b7731=_0x4ddc9c[_0xaf0b('0x2f')]({'plain':!![]});var _0x581444='SmsQueues';return db['UserProfileSection'][_0xaf0b('0x52')]({'where':{'name':_0x581444,'userProfileId':_0x4e4174['userProfileId']},'raw':!![]})['then'](function(_0x41b331){if(_0x41b331&&_0x41b331[_0xaf0b('0x57')]===0x0){return db[_0xaf0b('0x31')][_0xaf0b('0x53')]({'name':_0x1b7731[_0xaf0b('0x34')],'resourceId':_0x1b7731['id'],'type':_0x41b331[_0xaf0b('0x34')],'sectionId':_0x41b331['id']},{})[_0xaf0b('0x2d')](function(){return _0x4ddc9c;});}else{return _0x4ddc9c;}})[_0xaf0b('0x4e')](function(_0x1e25ab){logger[_0xaf0b('0x32')](_0xaf0b('0x58'),_0x1e25ab);throw _0x1e25ab;});}return _0x4ddc9c;})[_0xaf0b('0x2d')](respondWithResult(_0x1749c1,0xc9))['catch'](handleError(_0x1749c1,null));};exports[_0xaf0b('0x2c')]=function(_0x44654c,_0xa82500){if(_0x44654c['body']['id']){delete _0x44654c[_0xaf0b('0x59')]['id'];}return db[_0xaf0b('0x35')]['find']({'where':{'id':_0x44654c[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0xa82500,null))[_0xaf0b('0x2d')](saveUpdates(_0x44654c[_0xaf0b('0x59')],null))['then'](respondWithResult(_0xa82500,null))[_0xaf0b('0x4e')](handleError(_0xa82500,null));};exports[_0xaf0b('0x2e')]=function(_0x55fe8d,_0x3d9df2){return db['SmsQueue'][_0xaf0b('0x52')]({'where':{'id':_0x55fe8d[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x3d9df2,null))[_0xaf0b('0x2d')](removeEntity(_0x3d9df2,null))[_0xaf0b('0x4e')](handleError(_0x3d9df2,null));};exports[_0xaf0b('0x5a')]=function(_0x1d95d6,_0x2732a6){return db[_0xaf0b('0x35')][_0xaf0b('0x5a')]()[_0xaf0b('0x2d')](respondWithResult(_0x2732a6,null))['catch'](handleError(_0x2732a6,null));};exports[_0xaf0b('0x5b')]=function(_0x64c2ee,_0x34e774,_0x39f899){var _0x19f2b2={'raw':!![],'where':{}},_0x4b791c={},_0x2c915b;return db[_0xaf0b('0x35')][_0xaf0b('0x5c')]({'where':{'id':_0x64c2ee[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x34e774,null))['then'](function(_0xec1cf7){if(_0xec1cf7){_0x2c915b=_0xec1cf7[_0xaf0b('0x2f')]({'plain':!![]});_0x4b791c[_0xaf0b('0x39')]=_[_0xaf0b('0x3c')](db['UserSmsQueue'][_0xaf0b('0x36')]);_0x4b791c['query']=_[_0xaf0b('0x3c')](_0x64c2ee['query']);_0x4b791c['filters']=_['intersection'](_0x4b791c[_0xaf0b('0x39')],_0x4b791c[_0xaf0b('0x3b')]);_0x19f2b2['attributes']=_['intersection'](_0x4b791c[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x19f2b2[_0xaf0b('0x40')]=_0x19f2b2[_0xaf0b('0x40')]['length']?_0x19f2b2['attributes']:_0x4b791c['model'];if(!_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x41')]('nolimit')){_0x19f2b2[_0xaf0b('0x24')]=qs['limit'](_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x24')]);_0x19f2b2['offset']=qs[_0xaf0b('0x23')](_0x64c2ee['query'][_0xaf0b('0x23')]);}_0x19f2b2['order']=qs[_0xaf0b('0x44')](_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x19f2b2[_0xaf0b('0x45')]=qs[_0xaf0b('0x3d')](_['pick'](_0x64c2ee['query'],_0x4b791c[_0xaf0b('0x3d')]));_0x19f2b2[_0xaf0b('0x45')]['SmsQueueId']=_0xec1cf7['id'];if(_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x49')]){_0x19f2b2[_0xaf0b('0x45')]=_['merge'](_0x19f2b2[_0xaf0b('0x45')],{'$or':_[_0xaf0b('0x3a')](_0x19f2b2['attributes'],function(_0x36d6c6){var _0x4a8880={};_0x4a8880[_0x36d6c6]={'$like':'%'+_0x64c2ee[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x4a8880;})});}_0x19f2b2=_[_0xaf0b('0x47')]({},_0x19f2b2,_0x64c2ee[_0xaf0b('0x4a')]);return db['UserSmsQueue'][_0xaf0b('0x4c')](_0x19f2b2);}})['then'](function(_0x1f1f5d){if(_0x1f1f5d){return db[_0xaf0b('0x5d')]['findAndCountAll']({'where':{'id':_[_0xaf0b('0x3a')](_0x1f1f5d,_0xaf0b('0x5e')),'role':'agent'},'attributes':['id',_0xaf0b('0x34'),'smsPause',_0xaf0b('0x5f'),_0xaf0b('0x60')]});}})['then'](function(_0x28ef69){if(_0x28ef69){return{'count':_0x28ef69[_0xaf0b('0x26')],'rows':_['map'](_0x28ef69[_0xaf0b('0x4d')],function(_0x1bc269){return{'membername':_0x1bc269['name'],'UserId':_0x1bc269['id'],'queue_name':_0x2c915b[_0xaf0b('0x34')],'SmsQueueId':_0x2c915b['id'],'interface':util[_0xaf0b('0x61')](_0xaf0b('0x62'),'SIP',_0x1bc269[_0xaf0b('0x34')]),'penalty':0x0,'paused':_0x1bc269[_0xaf0b('0x63')],'createdAt':_0x1bc269[_0xaf0b('0x60')],'updatedAt':_0x1bc269[_0xaf0b('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaf0b('0x2d')](respondWithFilteredResult(_0x34e774,_0x19f2b2))[_0xaf0b('0x4e')](handleError(_0x34e774,null));};exports[_0xaf0b('0x64')]=function(_0x486152,_0x269fb3,_0x1e205f){var _0x5410be={};var _0x1bdbe2={};var _0x46ab03;var _0x4dc3f3;return db[_0xaf0b('0x35')][_0xaf0b('0x5c')]({'where':{'id':_0x486152[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x269fb3,null))['then'](function(_0x560746){if(_0x560746){_0x46ab03=_0x560746;_0x1bdbe2[_0xaf0b('0x39')]=_[_0xaf0b('0x3c')](db[_0xaf0b('0x65')]['rawAttributes']);_0x1bdbe2['query']=_['keys'](_0x486152[_0xaf0b('0x3b')]);_0x1bdbe2[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x1bdbe2[_0xaf0b('0x39')],_0x1bdbe2['query']);_0x5410be[_0xaf0b('0x40')]=_[_0xaf0b('0x3e')](_0x1bdbe2[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x486152[_0xaf0b('0x3b')]['fields']));_0x5410be[_0xaf0b('0x40')]=_0x5410be[_0xaf0b('0x40')]['length']?_0x5410be['attributes']:_0x1bdbe2[_0xaf0b('0x39')];_0x5410be['order']=qs[_0xaf0b('0x44')](_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x5410be[_0xaf0b('0x45')]=qs[_0xaf0b('0x3d')](_[_0xaf0b('0x46')](_0x486152['query'],_0x1bdbe2[_0xaf0b('0x3d')]));if(_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x49')]){_0x5410be[_0xaf0b('0x45')]=_[_0xaf0b('0x47')](_0x5410be['where'],{'$or':_[_0xaf0b('0x3a')](_0x5410be[_0xaf0b('0x40')],function(_0x54ba50){var _0x422f95={};_0x422f95[_0x54ba50]={'$like':'%'+_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x422f95;})});}_0x5410be=_[_0xaf0b('0x47')]({},_0x5410be,_0x486152['options']);return _0x46ab03[_0xaf0b('0x64')](_0x5410be);}})[_0xaf0b('0x2d')](function(_0x365a4f){if(_0x365a4f){_0x4dc3f3=_0x365a4f[_0xaf0b('0x50')];if(!_0x486152[_0xaf0b('0x3b')][_0xaf0b('0x41')]('nolimit')){_0x5410be[_0xaf0b('0x24')]=qs['limit'](_0x486152['query'][_0xaf0b('0x24')]);_0x5410be[_0xaf0b('0x23')]=qs[_0xaf0b('0x23')](_0x486152['query'][_0xaf0b('0x23')]);}return _0x46ab03[_0xaf0b('0x64')](_0x5410be);}})[_0xaf0b('0x2d')](function(_0x2b0d2a){if(_0x2b0d2a){return _0x2b0d2a?{'count':_0x4dc3f3,'rows':_0x2b0d2a}:null;}})[_0xaf0b('0x2d')](respondWithResult(_0x269fb3,null))['catch'](handleError(_0x269fb3,null));};exports[_0xaf0b('0x66')]=function(_0x257de8,_0x5dc534,_0x367764){var _0x303231=_0x257de8['body'][_0xaf0b('0x67')];return db[_0xaf0b('0x65')][_0xaf0b('0x4c')]({'where':{'id':_0x303231},'attributes':['id'],'include':[{'model':db[_0xaf0b('0x5d')],'as':_0xaf0b('0x68'),'attributes':['id',_0xaf0b('0x34'),_0xaf0b('0x69'),'voicePause',_0xaf0b('0x6a')],'raw':!![]}]})[_0xaf0b('0x2d')](function(_0x54581e){if(_0x54581e){var _0xb1937b=_[_0xaf0b('0x6b')](_0x54581e,function(_0x47194d){var _0x637865=_0x47194d['get']({'plain':!![]});return _0x637865[_0xaf0b('0x68')];});return db[_0xaf0b('0x35')][_0xaf0b('0x52')]({'where':{'id':_0x257de8['params']['id']}})[_0xaf0b('0x2d')](function(_0x1541ff){return db[_0xaf0b('0x6c')][_0xaf0b('0x6d')](function(_0x933ee){return _0x1541ff[_0xaf0b('0x66')](_0x303231,{'transaction':_0x933ee})[_0xaf0b('0x2d')](function(){return BPromise['each'](_0xb1937b,function(_0xaaf67b){return db[_0xaf0b('0x6e')][_0xaf0b('0x6f')]({'where':{'UserId':_0xaaf67b['id'],'SmsQueueId':_0x257de8[_0xaf0b('0x4f')]['id']},'transaction':_0x933ee});});})['then'](function(){_0xb1937b[_0xaf0b('0x70')](function(_0x322282){socket[_0xaf0b('0x71')](_0xaf0b('0x72'),{'UserId':_0x322282['id'],'SmsQueueId':_0x1541ff['id']});});});});});}})[_0xaf0b('0x2d')](respondWithStatusCode(_0x5dc534,null))['catch'](handleError(_0x5dc534,null));};exports['removeTeams']=function(_0x296b57,_0xdd19a4,_0x10dc6c){return db[_0xaf0b('0x65')][_0xaf0b('0x4c')]({'where':{'id':_0x296b57[_0xaf0b('0x3b')][_0xaf0b('0x67')]},'attributes':['id'],'include':[{'model':db[_0xaf0b('0x5d')],'as':_0xaf0b('0x68'),'attributes':['id'],'raw':!![]}]})[_0xaf0b('0x2d')](handleEntityNotFound(_0xdd19a4,null))[_0xaf0b('0x2d')](function(_0x5bd25c){var _0x5795dd=_['map'](_0x5bd25c,'id');var _0x63b1f7=[];var _0xd1470c=[];var _0xb96eba=squel[_0xaf0b('0x73')]();_0xb96eba[_0xaf0b('0x74')](_0xaf0b('0x75'))['from']('team_has_sms_queues','tq')[_0xaf0b('0x76')](_0xaf0b('0x77'),'ut',_0xaf0b('0x78'))['where']('SmsQueueId\x20=\x20?',_0x296b57['params']['id']);for(var _0xe8329a=0x0;_0xe8329a<_0x5bd25c[_0xaf0b('0x50')];_0xe8329a+=0x1){let _0x1d498c=_0x5bd25c[_0xe8329a];for(var _0x836252=0x0;_0x836252<_0x1d498c[_0xaf0b('0x68')][_0xaf0b('0x50')];_0x836252+=0x1){let _0x301151=_0x1d498c[_0xaf0b('0x68')][_0x836252];var _0x40d130=_0xb96eba[_0xaf0b('0x79')]();_0x40d130['where'](_0xaf0b('0x7a'),_0x301151['id']);_0xd1470c[_0xaf0b('0x7b')](db['sequelize'][_0xaf0b('0x3b')](_0x40d130['toString'](),{'type':db['sequelize'][_0xaf0b('0x7c')]['SELECT']})[_0xaf0b('0x2d')](function(_0x5a9253){if(_0x5a9253['length']===0x1){return _0x301151['id'];}else{var _0x980ac7=_[_0xaf0b('0x7d')](_['map'](_0x5a9253,_0xaf0b('0x7e')),function(_0x3f9f56){return _['includes'](_0x5795dd,_0x3f9f56);});if(_0x980ac7){return _0x301151['id'];}}}));}}return BPromise[_0xaf0b('0x7f')](_0xd1470c)['then'](function(_0x19478c){_0x63b1f7=_(_0x63b1f7)[_0xaf0b('0x80')](_0x19478c)['compact']()[_0xaf0b('0x81')]();return db[_0xaf0b('0x35')][_0xaf0b('0x52')]({'where':{'id':_0x296b57[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](function(_0x3bb05e){return db[_0xaf0b('0x6c')][_0xaf0b('0x6d')](function(_0xc26d20){return _0x3bb05e[_0xaf0b('0x82')](_0x296b57[_0xaf0b('0x3b')][_0xaf0b('0x67')],{'transaction':_0xc26d20})[_0xaf0b('0x2d')](function(){if(!_[_0xaf0b('0x83')](_0x63b1f7)){return _0x3bb05e['removeAgents'](_0x63b1f7,{'transaction':_0xc26d20});}})[_0xaf0b('0x2d')](function(){_0x63b1f7[_0xaf0b('0x70')](function(_0x43ebf9){socket[_0xaf0b('0x71')](_0xaf0b('0x84'),{'UserId':_0x43ebf9,'SmsQueueId':_0x3bb05e['id']});});});});});});})[_0xaf0b('0x2d')](respondWithStatusCode(_0xdd19a4,null))[_0xaf0b('0x4e')](handleError(_0xdd19a4,null));};exports['addAgents']=function(_0xecc2af,_0x3c5317,_0x2be32f){return db[_0xaf0b('0x35')]['find']({'where':{'id':_0xecc2af[_0xaf0b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3c5317,null))['then'](function(_0x73959a){if(_0x73959a){return _0x73959a[_0xaf0b('0x85')](_0xecc2af[_0xaf0b('0x59')][_0xaf0b('0x67')],_[_0xaf0b('0x86')](_0xecc2af['body'],[_0xaf0b('0x67'),'id'])||{})['spread'](function(_0x13e285){for(var _0x141c20=0x0;_0x141c20<_0xecc2af[_0xaf0b('0x59')]['ids']['length'];_0x141c20+=0x1){socket['emit'](_0xaf0b('0x72'),{'UserId':Number(_0xecc2af[_0xaf0b('0x59')]['ids'][_0x141c20]),'SmsQueueId':Number(_0xecc2af['params']['id'])});}return _0x13e285;});}})[_0xaf0b('0x2d')](respondWithResult(_0x3c5317,null))['catch'](handleError(_0x3c5317,null));};exports[_0xaf0b('0x87')]=function(_0xc507b,_0x591c80,_0x2e78ef){return db['SmsQueue'][_0xaf0b('0x52')]({'where':{'id':_0xc507b[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x591c80,null))['then'](function(_0x375c8c){if(_0x375c8c){return _0x375c8c['removeAgents'](_0xc507b[_0xaf0b('0x3b')]['ids'])['then'](function(){if(_[_0xaf0b('0x88')](_0xc507b[_0xaf0b('0x3b')]['ids'])){for(var _0x5ce443=0x0;_0x5ce443<_0xc507b[_0xaf0b('0x3b')][_0xaf0b('0x67')]['length'];_0x5ce443+=0x1){socket[_0xaf0b('0x71')]('userSmsQueue:remove',{'UserId':Number(_0xc507b[_0xaf0b('0x3b')][_0xaf0b('0x67')][_0x5ce443]),'SmsQueueId':Number(_0xc507b[_0xaf0b('0x4f')]['id'])});}}else{socket['emit'](_0xaf0b('0x84'),{'UserId':Number(_0xc507b['query'][_0xaf0b('0x67')]),'SmsQueueId':Number(_0xc507b[_0xaf0b('0x4f')]['id'])});}});}})[_0xaf0b('0x2d')](respondWithStatusCode(_0x591c80,null))[_0xaf0b('0x4e')](handleError(_0x591c80,null));};exports['getAgents']=function(_0x59c250,_0x521132,_0x370cc0){var _0x16b33f={};var _0x41acaa={};var _0x432a84;var _0x8e325b;return db['SmsQueue'][_0xaf0b('0x5c')]({'where':{'id':_0x59c250[_0xaf0b('0x4f')]['id']}})[_0xaf0b('0x2d')](handleEntityNotFound(_0x521132,null))[_0xaf0b('0x2d')](function(_0x9a511d){if(_0x9a511d){_0x432a84=_0x9a511d;_0x41acaa[_0xaf0b('0x39')]=_[_0xaf0b('0x3c')](db[_0xaf0b('0x5d')][_0xaf0b('0x36')]);_0x41acaa[_0xaf0b('0x3b')]=_[_0xaf0b('0x3c')](_0x59c250[_0xaf0b('0x3b')]);_0x41acaa[_0xaf0b('0x3d')]=_[_0xaf0b('0x3e')](_0x41acaa[_0xaf0b('0x39')],_0x41acaa[_0xaf0b('0x3b')]);_0x16b33f['attributes']=_['intersection'](_0x41acaa[_0xaf0b('0x39')],qs[_0xaf0b('0x3f')](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x3f')]));_0x16b33f[_0xaf0b('0x40')]=_0x16b33f[_0xaf0b('0x40')][_0xaf0b('0x50')]?_0x16b33f['attributes']:_0x41acaa[_0xaf0b('0x39')];_0x16b33f[_0xaf0b('0x43')]=qs[_0xaf0b('0x44')](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x44')]);_0x16b33f[_0xaf0b('0x45')]=qs[_0xaf0b('0x3d')](_[_0xaf0b('0x46')](_0x59c250[_0xaf0b('0x3b')],_0x41acaa[_0xaf0b('0x3d')]));if(_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x49')]){_0x16b33f[_0xaf0b('0x45')]=_[_0xaf0b('0x47')](_0x16b33f['where'],{'$or':_[_0xaf0b('0x3a')](_0x16b33f[_0xaf0b('0x40')],function(_0x5771d7){var _0x35ab1e={};_0x35ab1e[_0x5771d7]={'$like':'%'+_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x49')]+'%'};return _0x35ab1e;})});}_0x16b33f=_[_0xaf0b('0x47')]({},_0x16b33f,_0x59c250[_0xaf0b('0x4a')]);return _0x432a84[_0xaf0b('0x89')](_0x16b33f);}})[_0xaf0b('0x2d')](function(_0xd53a41){if(_0xd53a41){_0x8e325b=_0xd53a41[_0xaf0b('0x50')];if(!_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x41')]('nolimit')){_0x16b33f[_0xaf0b('0x24')]=qs['limit'](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x24')]);_0x16b33f[_0xaf0b('0x23')]=qs[_0xaf0b('0x23')](_0x59c250[_0xaf0b('0x3b')][_0xaf0b('0x23')]);}return _0x432a84[_0xaf0b('0x89')](_0x16b33f);}})['then'](function(_0x16588a){if(_0x16588a){return _0x16588a?{'count':_0x8e325b,'rows':_0x16588a}:null;}})[_0xaf0b('0x2d')](respondWithResult(_0x521132,null))['catch'](handleError(_0x521132,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 7fe3ce0..a80ff53 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 _0xcdcb=['save','update','emit','hook','exports','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x43ab62,_0x21153c){var _0x5bd208=function(_0x2ecd13){while(--_0x2ecd13){_0x43ab62['push'](_0x43ab62['shift']());}};_0x5bd208(++_0x21153c);}(_0xcdcb,0x75));var _0xbcdc=function(_0x2ba8ef,_0x1c6431){_0x2ba8ef=_0x2ba8ef-0x0;var _0x1dd6d9=_0xcdcb[_0x2ba8ef];return _0x1dd6d9;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xbcdc('0x0'))['db'][_0xbcdc('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbcdc('0x2')](0x0);var events={'afterCreate':_0xbcdc('0x3'),'afterUpdate':_0xbcdc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7f7abb){return function(_0x3d40ac,_0x59f356,_0x59f704){SmsQueueEvents[_0xbcdc('0x5')](_0x7f7abb+':'+_0x3d40ac['id'],_0x3d40ac);SmsQueueEvents['emit'](_0x7f7abb,_0x3d40ac);_0x59f704(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xbcdc('0x6')](e,emitEvent(event));}}module[_0xbcdc('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x438d=['exports','events','SmsQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x112b40,_0x4f163c){var _0x6e5477=function(_0xcf83f4){while(--_0xcf83f4){_0x112b40['push'](_0x112b40['shift']());}};_0x6e5477(++_0x4f163c);}(_0x438d,0x1b9));var _0xd438=function(_0x14977c,_0x2c6d7e){_0x14977c=_0x14977c-0x0;var _0xafe01a=_0x438d[_0x14977c];return _0xafe01a;};'use strict';var EventEmitter=require(_0xd438('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xd438('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd438('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd438('0x3'),'afterDestroy':_0xd438('0x4')};function emitEvent(_0xdd9a72){return function(_0x2ef4d9,_0x5049cc,_0x14e345){SmsQueueEvents[_0xd438('0x5')](_0xdd9a72+':'+_0x2ef4d9['id'],_0x2ef4d9);SmsQueueEvents['emit'](_0xdd9a72,_0x2ef4d9);_0x14e345(null);};}for(var e in events){if(events[_0xd438('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xd438('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 378b449..3df7e8e 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 _0xda5a=['request-promise','rimraf','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xda5a,0x66));var _0xada5=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0xda5a[_0x5d225a];return _0x1e7761;};'use strict';var _=require(_0xada5('0x0'));var util=require(_0xada5('0x1'));var logger=require(_0xada5('0x2'))(_0xada5('0x3'));var moment=require(_0xada5('0x4'));var BPromise=require(_0xada5('0x5'));var rp=require(_0xada5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xada5('0x7'));var config=require('../../config/environment');var attributes=require(_0xada5('0x8'));module[_0xada5('0x9')]=function(_0x2ad013,_0x2e9d2e){return _0x2ad013['define'](_0xada5('0xa'),attributes,{'tableName':_0xada5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaecc=['./smsQueue.attributes','define','SmsQueue','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xaecc,0x184));var _0xcaec=function(_0x37e342,_0x160c8f){_0x37e342=_0x37e342-0x0;var _0x1768f9=_0xaecc[_0x37e342];return _0x1768f9;};'use strict';var _=require('lodash');var util=require(_0xcaec('0x0'));var logger=require(_0xcaec('0x1'))(_0xcaec('0x2'));var moment=require(_0xcaec('0x3'));var BPromise=require(_0xcaec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcaec('0x5'));var rimraf=require(_0xcaec('0x6'));var config=require(_0xcaec('0x7'));var attributes=require(_0xcaec('0x8'));module['exports']=function(_0x2fce27,_0x27b94c){return _0x2fce27[_0xcaec('0x9')](_0xcaec('0xa'),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 08adbe0..2575b75 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 _0xf0d0=['raw','limit','include','map','attributes','model','ShowSmsQueue','find','where','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSmsQueue','SmsQueue','options'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0xf0d0,0x75));var _0x0f0d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0d0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x0f0d('0x0'));var moment=require(_0x0f0d('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f0d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f0d('0x3'))['db'];var utils=require(_0x0f0d('0x4'));var logger=require(_0x0f0d('0x5'))('rpc');var config=require(_0x0f0d('0x6'));var jayson=require(_0x0f0d('0x7'));var client=jayson['client'][_0x0f0d('0x8')]({'port':0x232a});config[_0x0f0d('0x9')]=_[_0x0f0d('0xa')](config[_0x0f0d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x0f0d('0xb'))(new Redis(config[_0x0f0d('0x9')]));require(_0x0f0d('0xc'))['register'](socket);function respondWithRpcPromise(_0x5866f3,_0x42cac8,_0xe44017){return new BPromise(function(_0x5d89a9,_0x266318){return client[_0x0f0d('0xd')](_0x5866f3,_0xe44017)[_0x0f0d('0xe')](function(_0x479ce6){logger[_0x0f0d('0xf')](_0x0f0d('0x10'),_0x42cac8,_0x0f0d('0x11'));logger[_0x0f0d('0x12')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x42cac8,_0x0f0d('0x11'),JSON[_0x0f0d('0x13')](_0x479ce6));if(_0x479ce6[_0x0f0d('0x14')]){if(_0x479ce6['error'][_0x0f0d('0x15')]===0x1f4){logger[_0x0f0d('0x14')](_0x0f0d('0x10'),_0x42cac8,_0x479ce6['error'][_0x0f0d('0x16')]);return _0x266318(_0x479ce6['error'][_0x0f0d('0x16')]);}logger[_0x0f0d('0x14')](_0x0f0d('0x10'),_0x42cac8,_0x479ce6[_0x0f0d('0x14')]['message']);return _0x5d89a9(_0x479ce6['error'][_0x0f0d('0x16')]);}else{logger[_0x0f0d('0xf')](_0x0f0d('0x10'),_0x42cac8,'request\x20sent');_0x5d89a9(_0x479ce6['result'][_0x0f0d('0x16')]);}})[_0x0f0d('0x17')](function(_0x133374){logger['error'](_0x0f0d('0x10'),_0x42cac8,_0x133374);_0x266318(_0x133374);});});}exports[_0x0f0d('0x18')]=function(_0x2714e9){var _0x43921e=this;return new Promise(function(_0x5c0ba5,_0x319271){return db[_0x0f0d('0x19')]['findAll']({'raw':_0x2714e9[_0x0f0d('0x1a')]?_0x2714e9[_0x0f0d('0x1a')][_0x0f0d('0x1b')]===undefined?!![]:![]:!![],'where':_0x2714e9[_0x0f0d('0x1a')]?_0x2714e9[_0x0f0d('0x1a')]['where']||null:null,'attributes':_0x2714e9[_0x0f0d('0x1a')]?_0x2714e9['options']['attributes']||null:null,'limit':_0x2714e9['options']?_0x2714e9[_0x0f0d('0x1a')][_0x0f0d('0x1c')]||null:null,'include':_0x2714e9[_0x0f0d('0x1a')]?_0x2714e9['options'][_0x0f0d('0x1d')]?_[_0x0f0d('0x1e')](_0x2714e9[_0x0f0d('0x1a')][_0x0f0d('0x1d')],function(_0x1aa6f1){return{'model':db[_0x1aa6f1['model']],'as':_0x1aa6f1['as'],'attributes':_0x1aa6f1[_0x0f0d('0x1f')],'include':_0x1aa6f1['include']?_[_0x0f0d('0x1e')](_0x1aa6f1[_0x0f0d('0x1d')],function(_0x1c4f8b){return{'model':db[_0x1c4f8b[_0x0f0d('0x20')]],'as':_0x1c4f8b['as'],'attributes':_0x1c4f8b[_0x0f0d('0x1f')],'include':_0x1c4f8b[_0x0f0d('0x1d')]?_[_0x0f0d('0x1e')](_0x1c4f8b[_0x0f0d('0x1d')],function(_0x45a052){return{'model':db[_0x45a052[_0x0f0d('0x20')]],'as':_0x45a052['as'],'attributes':_0x45a052['attributes']};}):[]};}):[]};}):[]:[]})[_0x0f0d('0xe')](function(_0x2799cb){logger['info'](_0x0f0d('0x18'),_0x2714e9);logger[_0x0f0d('0x12')](_0x0f0d('0x18'),_0x2714e9,JSON['stringify'](_0x2799cb));_0x5c0ba5(_0x2799cb);})[_0x0f0d('0x17')](function(_0x11fd6d){logger['error']('GetSmsQueue',_0x11fd6d[_0x0f0d('0x16')],_0x2714e9);_0x319271(_0x43921e[_0x0f0d('0x14')](0x1f4,_0x11fd6d['message']));});});};exports[_0x0f0d('0x21')]=function(_0x96710){var _0x28ebe8=this;return new Promise(function(_0x30ca19,_0x221faa){return db[_0x0f0d('0x19')][_0x0f0d('0x22')]({'raw':_0x96710[_0x0f0d('0x1a')]?_0x96710[_0x0f0d('0x1a')][_0x0f0d('0x1b')]===undefined?!![]:![]:!![],'where':_0x96710[_0x0f0d('0x1a')]?_0x96710[_0x0f0d('0x1a')][_0x0f0d('0x23')]||null:null,'attributes':_0x96710[_0x0f0d('0x1a')]?_0x96710[_0x0f0d('0x1a')][_0x0f0d('0x1f')]||null:null,'include':_0x96710['options']?_0x96710['options'][_0x0f0d('0x1d')]?_[_0x0f0d('0x1e')](_0x96710['options'][_0x0f0d('0x1d')],function(_0x4319c7){return{'model':db[_0x4319c7[_0x0f0d('0x20')]],'as':_0x4319c7['as'],'attributes':_0x4319c7[_0x0f0d('0x1f')],'include':_0x4319c7[_0x0f0d('0x1d')]?_[_0x0f0d('0x1e')](_0x4319c7['include'],function(_0x1f5632){return{'model':db[_0x1f5632[_0x0f0d('0x20')]],'as':_0x1f5632['as'],'attributes':_0x1f5632[_0x0f0d('0x1f')],'include':_0x1f5632[_0x0f0d('0x1d')]?_[_0x0f0d('0x1e')](_0x1f5632[_0x0f0d('0x1d')],function(_0xdd672b){return{'model':db[_0xdd672b[_0x0f0d('0x20')]],'as':_0xdd672b['as'],'attributes':_0xdd672b[_0x0f0d('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0f0d('0xe')](function(_0x11f10c){logger[_0x0f0d('0xf')]('ShowSmsQueue',_0x96710);logger[_0x0f0d('0x12')](_0x0f0d('0x21'),_0x96710,JSON[_0x0f0d('0x13')](_0x11f10c));_0x30ca19(_0x11f10c);})[_0x0f0d('0x17')](function(_0x1f2443){logger[_0x0f0d('0x14')]('ShowSmsQueue',_0x1f2443[_0x0f0d('0x16')],_0x96710);_0x221faa(_0x28ebe8[_0x0f0d('0x14')](0x1f4,_0x1f2443['message']));});});}; \ No newline at end of file +var _0xb235=['attributes','ShowSmsQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','redis','defaults','localhost','socket.io-emitter','register','then','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','info','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','include','map','model'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0xb235,0x179));var _0x5b23=function(_0x4bf029,_0x3e24f6){_0x4bf029=_0x4bf029-0x0;var _0x359cf3=_0xb235[_0x4bf029];return _0x359cf3;};'use strict';var _=require(_0x5b23('0x0'));var util=require('util');var moment=require(_0x5b23('0x1'));var BPromise=require(_0x5b23('0x2'));var rs=require(_0x5b23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b23('0x4'))['db'];var utils=require(_0x5b23('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x5b23('0x6')]=_[_0x5b23('0x7')](config[_0x5b23('0x6')],{'host':_0x5b23('0x8'),'port':0x18eb});var socket=require(_0x5b23('0x9'))(new Redis(config[_0x5b23('0x6')]));require('./smsQueue.socket')[_0x5b23('0xa')](socket);function respondWithRpcPromise(_0x49deb7,_0x41c762,_0x1c209f){return new BPromise(function(_0x2cae82,_0x13284b){return client['request'](_0x49deb7,_0x1c209f)[_0x5b23('0xb')](function(_0x4c29d0){logger['info']('SmsQueue,\x20%s,\x20%s',_0x41c762,_0x5b23('0xc'));logger[_0x5b23('0xd')](_0x5b23('0xe'),_0x41c762,_0x5b23('0xc'),JSON[_0x5b23('0xf')](_0x4c29d0));if(_0x4c29d0[_0x5b23('0x10')]){if(_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x11')]===0x1f4){logger['error'](_0x5b23('0x12'),_0x41c762,_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x13')]);return _0x13284b(_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x13')]);}logger[_0x5b23('0x10')](_0x5b23('0x12'),_0x41c762,_0x4c29d0['error'][_0x5b23('0x13')]);return _0x2cae82(_0x4c29d0[_0x5b23('0x10')][_0x5b23('0x13')]);}else{logger[_0x5b23('0x14')](_0x5b23('0x12'),_0x41c762,_0x5b23('0xc'));_0x2cae82(_0x4c29d0['result'][_0x5b23('0x13')]);}})[_0x5b23('0x15')](function(_0x444601){logger[_0x5b23('0x10')](_0x5b23('0x12'),_0x41c762,_0x444601);_0x13284b(_0x444601);});});}exports[_0x5b23('0x16')]=function(_0x1e7812){var _0x31b5ce=this;return new Promise(function(_0x1e7d9b,_0x1eaf0c){return db[_0x5b23('0x17')][_0x5b23('0x18')]({'raw':_0x1e7812[_0x5b23('0x19')]?_0x1e7812[_0x5b23('0x19')][_0x5b23('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e7812['options']?_0x1e7812['options'][_0x5b23('0x1b')]||null:null,'attributes':_0x1e7812['options']?_0x1e7812['options']['attributes']||null:null,'limit':_0x1e7812[_0x5b23('0x19')]?_0x1e7812['options']['limit']||null:null,'include':_0x1e7812[_0x5b23('0x19')]?_0x1e7812[_0x5b23('0x19')][_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x1e7812[_0x5b23('0x19')][_0x5b23('0x1c')],function(_0x595715){return{'model':db[_0x595715[_0x5b23('0x1e')]],'as':_0x595715['as'],'attributes':_0x595715[_0x5b23('0x1f')],'include':_0x595715[_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x595715[_0x5b23('0x1c')],function(_0x35d312){return{'model':db[_0x35d312[_0x5b23('0x1e')]],'as':_0x35d312['as'],'attributes':_0x35d312[_0x5b23('0x1f')],'include':_0x35d312[_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x35d312['include'],function(_0x3e5111){return{'model':db[_0x3e5111[_0x5b23('0x1e')]],'as':_0x3e5111['as'],'attributes':_0x3e5111[_0x5b23('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0xb')](function(_0x3d20b1){logger[_0x5b23('0x14')](_0x5b23('0x16'),_0x1e7812);logger[_0x5b23('0xd')]('GetSmsQueue',_0x1e7812,JSON[_0x5b23('0xf')](_0x3d20b1));_0x1e7d9b(_0x3d20b1);})[_0x5b23('0x15')](function(_0x14afea){logger[_0x5b23('0x10')]('GetSmsQueue',_0x14afea[_0x5b23('0x13')],_0x1e7812);_0x1eaf0c(_0x31b5ce[_0x5b23('0x10')](0x1f4,_0x14afea[_0x5b23('0x13')]));});});};exports[_0x5b23('0x20')]=function(_0x4c061b){var _0xa01597=this;return new Promise(function(_0x4534cd,_0x52a0a5){return db[_0x5b23('0x17')][_0x5b23('0x21')]({'raw':_0x4c061b['options']?_0x4c061b['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c061b[_0x5b23('0x19')]?_0x4c061b[_0x5b23('0x19')]['where']||null:null,'attributes':_0x4c061b[_0x5b23('0x19')]?_0x4c061b[_0x5b23('0x19')][_0x5b23('0x1f')]||null:null,'include':_0x4c061b[_0x5b23('0x19')]?_0x4c061b['options'][_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x4c061b[_0x5b23('0x19')][_0x5b23('0x1c')],function(_0x5e68f9){return{'model':db[_0x5e68f9[_0x5b23('0x1e')]],'as':_0x5e68f9['as'],'attributes':_0x5e68f9[_0x5b23('0x1f')],'include':_0x5e68f9[_0x5b23('0x1c')]?_[_0x5b23('0x1d')](_0x5e68f9[_0x5b23('0x1c')],function(_0x680cad){return{'model':db[_0x680cad[_0x5b23('0x1e')]],'as':_0x680cad['as'],'attributes':_0x680cad[_0x5b23('0x1f')],'include':_0x680cad['include']?_[_0x5b23('0x1d')](_0x680cad['include'],function(_0x5361bd){return{'model':db[_0x5361bd[_0x5b23('0x1e')]],'as':_0x5361bd['as'],'attributes':_0x5361bd[_0x5b23('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5b23('0xb')](function(_0x258ae9){logger[_0x5b23('0x14')](_0x5b23('0x20'),_0x4c061b);logger[_0x5b23('0xd')]('ShowSmsQueue',_0x4c061b,JSON[_0x5b23('0xf')](_0x258ae9));_0x4534cd(_0x258ae9);})[_0x5b23('0x15')](function(_0x3850f1){logger[_0x5b23('0x10')](_0x5b23('0x20'),_0x3850f1[_0x5b23('0x13')],_0x4c061b);_0x52a0a5(_0xa01597[_0x5b23('0x10')](0x1f4,_0x3850f1['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 223506f..3d8f956 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 _0x8aa8=['removeListener','register','length','smsQueue:','./smsQueue.events','save','update'];(function(_0x1f1305,_0x2435f5){var _0x571a9d=function(_0x411dfc){while(--_0x411dfc){_0x1f1305['push'](_0x1f1305['shift']());}};_0x571a9d(++_0x2435f5);}(_0x8aa8,0xe4));var _0x88aa=function(_0xc7d3ab,_0x20f03e){_0xc7d3ab=_0xc7d3ab-0x0;var _0x23b99a=_0x8aa8[_0xc7d3ab];return _0x23b99a;};'use strict';var SmsQueueEvents=require(_0x88aa('0x0'));var events=[_0x88aa('0x1'),'remove',_0x88aa('0x2')];function createListener(_0x2853f4,_0xd8fd1d){return function(_0x102603){_0xd8fd1d['emit'](_0x2853f4,_0x102603);};}function removeListener(_0x7d357,_0x8a85ae){return function(){SmsQueueEvents[_0x88aa('0x3')](_0x7d357,_0x8a85ae);};}exports[_0x88aa('0x4')]=function(_0x3f318c){for(var _0x18badb=0x0,_0x1a6593=events[_0x88aa('0x5')];_0x18badb<_0x1a6593;_0x18badb++){var _0x2af5d2=events[_0x18badb];var _0x407463=createListener(_0x88aa('0x6')+_0x2af5d2,_0x3f318c);SmsQueueEvents['on'](_0x2af5d2,_0x407463);}}; \ No newline at end of file +var _0x22fe=['length','smsQueue:','./smsQueue.events','save'];(function(_0x16acdd,_0x1dc796){var _0x466e45=function(_0x21e0fe){while(--_0x21e0fe){_0x16acdd['push'](_0x16acdd['shift']());}};_0x466e45(++_0x1dc796);}(_0x22fe,0x15a));var _0xe22f=function(_0x4494a4,_0x5d2edf){_0x4494a4=_0x4494a4-0x0;var _0x479cd5=_0x22fe[_0x4494a4];return _0x479cd5;};'use strict';var SmsQueueEvents=require(_0xe22f('0x0'));var events=[_0xe22f('0x1'),'remove','update'];function createListener(_0x507766,_0x40477f){return function(_0x436cb7){_0x40477f['emit'](_0x507766,_0x436cb7);};}function removeListener(_0x19dae5,_0x54f42f){return function(){SmsQueueEvents['removeListener'](_0x19dae5,_0x54f42f);};}exports['register']=function(_0x4bb7e4){for(var _0x1f89c4=0x0,_0x4f766b=events[_0xe22f('0x2')];_0x1f89c4<_0x4f766b;_0x1f89c4++){var _0xc4c27=events[_0x1f89c4];var _0x387dd4=createListener(_0xe22f('0x3')+_0xc4c27,_0x4bb7e4);SmsQueueEvents['on'](_0xc4c27,_0x387dd4);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 55ea35d..7bab7e2 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 _0xf163=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x2abefd,_0xbac4b6){var _0x20adba=function(_0x1c1098){while(--_0x1c1098){_0x2abefd['push'](_0x2abefd['shift']());}};_0x20adba(++_0xbac4b6);}(_0xf163,0x129));var _0x3f16=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0xf163[_0x36bfe3];return _0x9b0436;};'use strict';var multer=require(_0x3f16('0x0'));var util=require('util');var path=require(_0x3f16('0x1'));var timeout=require(_0x3f16('0x2'));var express=require(_0x3f16('0x3'));var router=express[_0x3f16('0x4')]();var fs_extra=require(_0x3f16('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3f16('0x6'));var config=require(_0x3f16('0x7'));var controller=require('./smsQueueReport.controller');router[_0x3f16('0x8')]('/',auth[_0x3f16('0x9')](),controller[_0x3f16('0xa')]);router[_0x3f16('0x8')](_0x3f16('0xb'),auth[_0x3f16('0x9')](),controller[_0x3f16('0xc')]);router[_0x3f16('0x8')](_0x3f16('0xd'),auth[_0x3f16('0x9')](),controller['show']);router[_0x3f16('0xe')]('/',auth[_0x3f16('0x9')](),controller[_0x3f16('0xf')]);router[_0x3f16('0x10')](_0x3f16('0xd'),auth[_0x3f16('0x9')](),controller['update']);router[_0x3f16('0x11')]('/:id',auth[_0x3f16('0x9')](),controller[_0x3f16('0x12')]);module[_0x3f16('0x13')]=router; \ No newline at end of file +var _0x6b9b=['../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post','create','update','delete','destroy','exports','util','express','../../components/auth/service','../../components/interaction/service'];(function(_0x538b4a,_0x4ef8b8){var _0x287276=function(_0x5d91ed){while(--_0x5d91ed){_0x538b4a['push'](_0x538b4a['shift']());}};_0x287276(++_0x4ef8b8);}(_0x6b9b,0x19a));var _0xb6b9=function(_0xcd46b1,_0xbb5494){_0xcd46b1=_0xcd46b1-0x0;var _0x531906=_0x6b9b[_0xcd46b1];return _0x531906;};'use strict';var multer=require('multer');var util=require(_0xb6b9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6b9('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb6b9('0x2'));var interaction=require(_0xb6b9('0x3'));var config=require(_0xb6b9('0x4'));var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0xb6b9('0x5')](),controller[_0xb6b9('0x6')]);router['get'](_0xb6b9('0x7'),auth[_0xb6b9('0x5')](),controller[_0xb6b9('0x8')]);router[_0xb6b9('0x9')](_0xb6b9('0xa'),auth[_0xb6b9('0x5')](),controller[_0xb6b9('0xb')]);router[_0xb6b9('0xc')]('/',auth['isAuthenticated'](),controller[_0xb6b9('0xd')]);router['put'](_0xb6b9('0xa'),auth[_0xb6b9('0x5')](),controller[_0xb6b9('0xe')]);router[_0xb6b9('0xf')](_0xb6b9('0xa'),auth['isAuthenticated'](),controller[_0xb6b9('0x10')]);module[_0xb6b9('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index e55e120..766a2cd 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 _0x5272=['STRING','DATE','sequelize','exports'];(function(_0x30247b,_0x2f44c1){var _0x4fb5f3=function(_0x57ad00){while(--_0x57ad00){_0x30247b['push'](_0x30247b['shift']());}};_0x4fb5f3(++_0x2f44c1);}(_0x5272,0xde));var _0x2527=function(_0x4b7fce,_0x15749a){_0x4b7fce=_0x4b7fce-0x0;var _0x381056=_0x5272[_0x4b7fce];return _0x381056;};'use strict';var moment=require('moment');var Sequelize=require(_0x2527('0x0'));module[_0x2527('0x1')]={'uniqueid':{'type':Sequelize[_0x2527('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x2527('0x2')]},'joinAt':{'type':Sequelize[_0x2527('0x3')]},'leaveAt':{'type':Sequelize[_0x2527('0x3')]},'acceptAt':{'type':Sequelize[_0x2527('0x3')]},'exitAt':{'type':Sequelize[_0x2527('0x3')]},'reason':{'type':Sequelize[_0x2527('0x2')]}}; \ No newline at end of file +var _0xc2d6=['DATE','sequelize','exports','STRING'];(function(_0x241b15,_0x1eb9b7){var _0x19eeb9=function(_0x997091){while(--_0x997091){_0x241b15['push'](_0x241b15['shift']());}};_0x19eeb9(++_0x1eb9b7);}(_0xc2d6,0x171));var _0x6c2d=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc2d6[_0x5c351c];return _0x26f3b3;};'use strict';var moment=require('moment');var Sequelize=require(_0x6c2d('0x0'));module[_0x6c2d('0x1')]={'uniqueid':{'type':Sequelize[_0x6c2d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x6c2d('0x2')]},'joinAt':{'type':Sequelize[_0x6c2d('0x3')]},'leaveAt':{'type':Sequelize[_0x6c2d('0x3')]},'acceptAt':{'type':Sequelize[_0x6c2d('0x3')]},'exitAt':{'type':Sequelize[_0x6c2d('0x3')]},'reason':{'type':Sequelize[_0x6c2d('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 2d0f167..83d79ba 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 _0x95d3=['nolimit','order','sort','pick','where','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','eml-format','rimraf','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','SmsQueueReport','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x95d3,0x138));var _0x395d=function(_0x3eb556,_0x11e2fc){_0x3eb556=_0x3eb556-0x0;var _0x2ec0e4=_0x95d3[_0x3eb556];return _0x2ec0e4;};'use strict';var emlformat=require(_0x395d('0x0'));var rimraf=require(_0x395d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x395d('0x2'));var BPromise=require(_0x395d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x395d('0x4'));var sox=require('sox');var csv=require(_0x395d('0x5'));var ejs=require(_0x395d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x395d('0x7'));var crypto=require(_0x395d('0x8'));var jsforce=require(_0x395d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x395d('0x5'));var querystring=require(_0x395d('0xa'));var Papa=require(_0x395d('0xb'));var Redis=require(_0x395d('0xc'));var authService=require(_0x395d('0xd'));var qs=require(_0x395d('0xe'));var as=require(_0x395d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x395d('0x10'));var utils=require(_0x395d('0x11'));var config=require(_0x395d('0x12'));var licenseUtil=require(_0x395d('0x13'));var db=require(_0x395d('0x14'))['db'];function respondWithStatusCode(_0x2bbeb7,_0x1e3e7c){_0x1e3e7c=_0x1e3e7c||0xcc;return function(_0x2324ea){if(_0x2324ea){return _0x2bbeb7[_0x395d('0x15')](_0x1e3e7c);}return _0x2bbeb7[_0x395d('0x16')](_0x1e3e7c)[_0x395d('0x17')]();};}function respondWithResult(_0x3eece8,_0x1bfd3c){_0x1bfd3c=_0x1bfd3c||0xc8;return function(_0x495d61){if(_0x495d61){return _0x3eece8['status'](_0x1bfd3c)[_0x395d('0x18')](_0x495d61);}};}function respondWithFilteredResult(_0xb21cd9,_0xdae8a8){return function(_0x3424d7){if(_0x3424d7){var _0x123304=typeof _0xdae8a8[_0x395d('0x19')]==='undefined'&&typeof _0xdae8a8[_0x395d('0x1a')]===_0x395d('0x1b');var _0x50bc7c=_0x3424d7[_0x395d('0x1c')];var _0x291d0e=_0x123304?0x0:_0xdae8a8[_0x395d('0x19')];var _0x9466f5=_0x123304?_0x3424d7[_0x395d('0x1c')]:_0xdae8a8[_0x395d('0x19')]+_0xdae8a8[_0x395d('0x1a')];var _0x5a5e35;if(_0x9466f5>=_0x50bc7c){_0x9466f5=_0x50bc7c;_0x5a5e35=0xc8;}else{_0x5a5e35=0xce;}_0xb21cd9['status'](_0x5a5e35);return _0xb21cd9[_0x395d('0x1d')](_0x395d('0x1e'),_0x291d0e+'-'+_0x9466f5+'/'+_0x50bc7c)[_0x395d('0x18')](_0x3424d7);}return null;};}function patchUpdates(_0x1786cc){return function(_0x225fd9){try{jsonpatch['apply'](_0x225fd9,_0x1786cc,!![]);}catch(_0x195845){return BPromise[_0x395d('0x1f')](_0x195845);}return _0x225fd9[_0x395d('0x20')]();};}function saveUpdates(_0x25a399,_0x41168d){return function(_0x5c2fdf){if(_0x5c2fdf){return _0x5c2fdf[_0x395d('0x21')](_0x25a399)[_0x395d('0x22')](function(_0x5f13d2){return _0x5f13d2;});}return null;};}function removeEntity(_0x26fb95,_0x23003a){return function(_0x1864ba){if(_0x1864ba){return _0x1864ba[_0x395d('0x23')]()[_0x395d('0x22')](function(){_0x26fb95[_0x395d('0x16')](0xcc)[_0x395d('0x17')]();});}};}function handleEntityNotFound(_0x58e68a,_0x10e7e1){return function(_0x5eea70){if(!_0x5eea70){_0x58e68a[_0x395d('0x15')](0x194);}return _0x5eea70;};}function handleError(_0x312ae6,_0x41d127){_0x41d127=_0x41d127||0x1f4;return function(_0x559ad3){logger[_0x395d('0x24')](_0x559ad3[_0x395d('0x25')]);if(_0x559ad3['name']){delete _0x559ad3[_0x395d('0x26')];}_0x312ae6['status'](_0x41d127)[_0x395d('0x27')](_0x559ad3);};}exports[_0x395d('0x28')]=function(_0x45dd9b,_0x349a72){var _0x5c0811={},_0x58cc51={},_0x224ff2={'count':0x0,'rows':[]};var _0x3b58ec=_['map'](db[_0x395d('0x29')]['rawAttributes'],function(_0x4dd808){return{'name':_0x4dd808[_0x395d('0x2a')],'type':_0x4dd808['type'][_0x395d('0x2b')]};});_0x58cc51[_0x395d('0x2c')]=_[_0x395d('0x2d')](_0x3b58ec,'name');_0x58cc51['query']=_[_0x395d('0x2e')](_0x45dd9b[_0x395d('0x2f')]);_0x58cc51[_0x395d('0x30')]=_[_0x395d('0x31')](_0x58cc51[_0x395d('0x2c')],_0x58cc51['query']);_0x5c0811[_0x395d('0x32')]=_[_0x395d('0x31')](_0x58cc51[_0x395d('0x2c')],qs['fields'](_0x45dd9b[_0x395d('0x2f')][_0x395d('0x33')]));_0x5c0811[_0x395d('0x32')]=_0x5c0811[_0x395d('0x32')][_0x395d('0x34')]?_0x5c0811[_0x395d('0x32')]:_0x58cc51[_0x395d('0x2c')];if(!_0x45dd9b[_0x395d('0x2f')]['hasOwnProperty'](_0x395d('0x35'))){_0x5c0811['limit']=qs[_0x395d('0x1a')](_0x45dd9b['query']['limit']);_0x5c0811[_0x395d('0x19')]=qs['offset'](_0x45dd9b[_0x395d('0x2f')]['offset']);}_0x5c0811[_0x395d('0x36')]=qs[_0x395d('0x37')](_0x45dd9b[_0x395d('0x2f')][_0x395d('0x37')]);_0x5c0811['where']=qs[_0x395d('0x30')](_[_0x395d('0x38')](_0x45dd9b[_0x395d('0x2f')],_0x58cc51[_0x395d('0x30')]),_0x3b58ec);if(_0x45dd9b[_0x395d('0x2f')]['filter']){_0x5c0811[_0x395d('0x39')]=_['merge'](_0x5c0811[_0x395d('0x39')],{'$or':_['map'](_0x3b58ec,function(_0x5831df){if(_0x5831df[_0x395d('0x3a')]!==_0x395d('0x3b')){var _0x13f092={};_0x13f092[_0x5831df['name']]={'$like':'%'+_0x45dd9b[_0x395d('0x2f')][_0x395d('0x3c')]+'%'};return _0x13f092;}})});}_0x5c0811=_['merge']({},_0x5c0811,_0x45dd9b['options']);var _0x4851c6={'where':_0x5c0811[_0x395d('0x39')]};return db[_0x395d('0x29')][_0x395d('0x1c')](_0x4851c6)['then'](function(_0x986646){_0x224ff2['count']=_0x986646;if(_0x45dd9b['query'][_0x395d('0x3d')]){_0x5c0811[_0x395d('0x3e')]=[{'all':!![]}];}return db[_0x395d('0x29')][_0x395d('0x3f')](_0x5c0811);})['then'](function(_0x34377a){_0x224ff2[_0x395d('0x40')]=_0x34377a;return _0x224ff2;})[_0x395d('0x22')](respondWithFilteredResult(_0x349a72,_0x5c0811))[_0x395d('0x41')](handleError(_0x349a72,null));};exports[_0x395d('0x42')]=function(_0x1e7aab,_0x52172b){var _0xf67f0e={'raw':!![],'where':{'id':_0x1e7aab['params']['id']}},_0x1dccdf={};_0x1dccdf[_0x395d('0x2c')]=_[_0x395d('0x2e')](db[_0x395d('0x29')][_0x395d('0x43')]);_0x1dccdf[_0x395d('0x2f')]=_['keys'](_0x1e7aab['query']);_0x1dccdf[_0x395d('0x30')]=_[_0x395d('0x31')](_0x1dccdf[_0x395d('0x2c')],_0x1dccdf[_0x395d('0x2f')]);_0xf67f0e['attributes']=_['intersection'](_0x1dccdf[_0x395d('0x2c')],qs['fields'](_0x1e7aab['query'][_0x395d('0x33')]));_0xf67f0e[_0x395d('0x32')]=_0xf67f0e[_0x395d('0x32')][_0x395d('0x34')]?_0xf67f0e[_0x395d('0x32')]:_0x1dccdf[_0x395d('0x2c')];if(_0x1e7aab[_0x395d('0x2f')][_0x395d('0x3d')]){_0xf67f0e[_0x395d('0x3e')]=[{'all':!![]}];}_0xf67f0e=_['merge']({},_0xf67f0e,_0x1e7aab['options']);return db[_0x395d('0x29')][_0x395d('0x44')](_0xf67f0e)['then'](handleEntityNotFound(_0x52172b,null))['then'](respondWithResult(_0x52172b,null))[_0x395d('0x41')](handleError(_0x52172b,null));};exports[_0x395d('0x45')]=function(_0x4b6ac2,_0x77cab4){return db[_0x395d('0x29')][_0x395d('0x45')](_0x4b6ac2[_0x395d('0x46')],{})[_0x395d('0x22')](respondWithResult(_0x77cab4,0xc9))[_0x395d('0x41')](handleError(_0x77cab4,null));};exports['update']=function(_0x292201,_0x111570){if(_0x292201[_0x395d('0x46')]['id']){delete _0x292201['body']['id'];}return db[_0x395d('0x29')]['find']({'where':{'id':_0x292201[_0x395d('0x47')]['id']}})[_0x395d('0x22')](handleEntityNotFound(_0x111570,null))[_0x395d('0x22')](saveUpdates(_0x292201['body'],null))[_0x395d('0x22')](respondWithResult(_0x111570,null))[_0x395d('0x41')](handleError(_0x111570,null));};exports[_0x395d('0x23')]=function(_0x303a67,_0x89c9bf){return db[_0x395d('0x29')][_0x395d('0x44')]({'where':{'id':_0x303a67[_0x395d('0x47')]['id']}})[_0x395d('0x22')](handleEntityNotFound(_0x89c9bf,null))[_0x395d('0x22')](removeEntity(_0x89c9bf,null))['catch'](handleError(_0x89c9bf,null));};exports[_0x395d('0x48')]=function(_0x38e04c,_0x2f5d27){return db['SmsQueueReport']['describe']()[_0x395d('0x22')](respondWithResult(_0x2f5d27,null))['catch'](handleError(_0x2f5d27,null));}; \ No newline at end of file +var _0xb29b=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','update','then','destroy','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','create','body','catch','describe','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x5c5e95,_0x740a18){var _0x55c9aa=function(_0x52c94e){while(--_0x52c94e){_0x5c5e95['push'](_0x5c5e95['shift']());}};_0x55c9aa(++_0x740a18);}(_0xb29b,0x1b2));var _0xbb29=function(_0x1be5a3,_0x1f80f2){_0x1be5a3=_0x1be5a3-0x0;var _0x53b728=_0xb29b[_0x1be5a3];return _0x53b728;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb29('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb29('0x1'));var moment=require(_0xbb29('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbb29('0x3'));var util=require(_0xbb29('0x4'));var path=require(_0xbb29('0x5'));var sox=require(_0xbb29('0x6'));var csv=require(_0xbb29('0x7'));var ejs=require(_0xbb29('0x8'));var fs=require('fs');var fs_extra=require(_0xbb29('0x9'));var _=require(_0xbb29('0xa'));var squel=require(_0xbb29('0xb'));var crypto=require('crypto');var jsforce=require(_0xbb29('0xc'));var deskjs=require(_0xbb29('0xd'));var toCsv=require(_0xbb29('0x7'));var querystring=require(_0xbb29('0xe'));var Papa=require(_0xbb29('0xf'));var Redis=require(_0xbb29('0x10'));var authService=require(_0xbb29('0x11'));var qs=require(_0xbb29('0x12'));var as=require(_0xbb29('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb29('0x14'))(_0xbb29('0x15'));var utils=require(_0xbb29('0x16'));var config=require(_0xbb29('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb29('0x18'))['db'];function respondWithStatusCode(_0x3790df,_0x3d6ba9){_0x3d6ba9=_0x3d6ba9||0xcc;return function(_0x4241fa){if(_0x4241fa){return _0x3790df[_0xbb29('0x19')](_0x3d6ba9);}return _0x3790df['status'](_0x3d6ba9)[_0xbb29('0x1a')]();};}function respondWithResult(_0xd4cee4,_0x37afcb){_0x37afcb=_0x37afcb||0xc8;return function(_0x4bbdbf){if(_0x4bbdbf){return _0xd4cee4[_0xbb29('0x1b')](_0x37afcb)[_0xbb29('0x1c')](_0x4bbdbf);}};}function respondWithFilteredResult(_0x542587,_0x3250bb){return function(_0x42baa6){if(_0x42baa6){var _0x2027b8=typeof _0x3250bb[_0xbb29('0x1d')]==='undefined'&&typeof _0x3250bb[_0xbb29('0x1e')]===_0xbb29('0x1f');var _0x5aa82e=_0x42baa6[_0xbb29('0x20')];var _0x251a9e=_0x2027b8?0x0:_0x3250bb[_0xbb29('0x1d')];var _0x58f7ed=_0x2027b8?_0x42baa6[_0xbb29('0x20')]:_0x3250bb[_0xbb29('0x1d')]+_0x3250bb[_0xbb29('0x1e')];var _0x11af44;if(_0x58f7ed>=_0x5aa82e){_0x58f7ed=_0x5aa82e;_0x11af44=0xc8;}else{_0x11af44=0xce;}_0x542587[_0xbb29('0x1b')](_0x11af44);return _0x542587[_0xbb29('0x21')]('Content-Range',_0x251a9e+'-'+_0x58f7ed+'/'+_0x5aa82e)[_0xbb29('0x1c')](_0x42baa6);}return null;};}function patchUpdates(_0x470147){return function(_0x287844){try{jsonpatch[_0xbb29('0x22')](_0x287844,_0x470147,!![]);}catch(_0xadaec8){return BPromise[_0xbb29('0x23')](_0xadaec8);}return _0x287844['save']();};}function saveUpdates(_0x1be353,_0x41debd){return function(_0x5f3cc6){if(_0x5f3cc6){return _0x5f3cc6[_0xbb29('0x24')](_0x1be353)[_0xbb29('0x25')](function(_0x45958c){return _0x45958c;});}return null;};}function removeEntity(_0x149612,_0x115a28){return function(_0x3957a6){if(_0x3957a6){return _0x3957a6[_0xbb29('0x26')]()[_0xbb29('0x25')](function(){_0x149612['status'](0xcc)[_0xbb29('0x1a')]();});}};}function handleEntityNotFound(_0x3887ff,_0x18d39d){return function(_0x7fea17){if(!_0x7fea17){_0x3887ff[_0xbb29('0x19')](0x194);}return _0x7fea17;};}function handleError(_0x306f47,_0x33f28d){_0x33f28d=_0x33f28d||0x1f4;return function(_0x369839){logger[_0xbb29('0x27')](_0x369839[_0xbb29('0x28')]);if(_0x369839['name']){delete _0x369839[_0xbb29('0x29')];}_0x306f47['status'](_0x33f28d)[_0xbb29('0x2a')](_0x369839);};}exports[_0xbb29('0x2b')]=function(_0x412407,_0x55b21c){var _0x334dbf={},_0x21e9d2={},_0x18a3cd={'count':0x0,'rows':[]};var _0x3561a6=_['map'](db[_0xbb29('0x2c')][_0xbb29('0x2d')],function(_0x35459d){return{'name':_0x35459d[_0xbb29('0x2e')],'type':_0x35459d['type']['key']};});_0x21e9d2[_0xbb29('0x2f')]=_[_0xbb29('0x30')](_0x3561a6,_0xbb29('0x29'));_0x21e9d2[_0xbb29('0x31')]=_[_0xbb29('0x32')](_0x412407[_0xbb29('0x31')]);_0x21e9d2['filters']=_[_0xbb29('0x33')](_0x21e9d2[_0xbb29('0x2f')],_0x21e9d2[_0xbb29('0x31')]);_0x334dbf[_0xbb29('0x34')]=_[_0xbb29('0x33')](_0x21e9d2[_0xbb29('0x2f')],qs[_0xbb29('0x35')](_0x412407[_0xbb29('0x31')]['fields']));_0x334dbf[_0xbb29('0x34')]=_0x334dbf['attributes'][_0xbb29('0x36')]?_0x334dbf[_0xbb29('0x34')]:_0x21e9d2[_0xbb29('0x2f')];if(!_0x412407[_0xbb29('0x31')]['hasOwnProperty'](_0xbb29('0x37'))){_0x334dbf['limit']=qs[_0xbb29('0x1e')](_0x412407[_0xbb29('0x31')]['limit']);_0x334dbf[_0xbb29('0x1d')]=qs[_0xbb29('0x1d')](_0x412407[_0xbb29('0x31')]['offset']);}_0x334dbf[_0xbb29('0x38')]=qs[_0xbb29('0x39')](_0x412407['query'][_0xbb29('0x39')]);_0x334dbf[_0xbb29('0x3a')]=qs[_0xbb29('0x3b')](_[_0xbb29('0x3c')](_0x412407[_0xbb29('0x31')],_0x21e9d2[_0xbb29('0x3b')]),_0x3561a6);if(_0x412407[_0xbb29('0x31')][_0xbb29('0x3d')]){_0x334dbf[_0xbb29('0x3a')]=_[_0xbb29('0x3e')](_0x334dbf[_0xbb29('0x3a')],{'$or':_[_0xbb29('0x30')](_0x3561a6,function(_0x43059d){if(_0x43059d['type']!==_0xbb29('0x3f')){var _0x1156b4={};_0x1156b4[_0x43059d[_0xbb29('0x29')]]={'$like':'%'+_0x412407[_0xbb29('0x31')][_0xbb29('0x3d')]+'%'};return _0x1156b4;}})});}_0x334dbf=_['merge']({},_0x334dbf,_0x412407['options']);var _0x2a8421={'where':_0x334dbf['where']};return db[_0xbb29('0x2c')][_0xbb29('0x20')](_0x2a8421)[_0xbb29('0x25')](function(_0x122096){_0x18a3cd[_0xbb29('0x20')]=_0x122096;if(_0x412407[_0xbb29('0x31')][_0xbb29('0x40')]){_0x334dbf[_0xbb29('0x41')]=[{'all':!![]}];}return db[_0xbb29('0x2c')][_0xbb29('0x42')](_0x334dbf);})[_0xbb29('0x25')](function(_0x23ebca){_0x18a3cd[_0xbb29('0x43')]=_0x23ebca;return _0x18a3cd;})[_0xbb29('0x25')](respondWithFilteredResult(_0x55b21c,_0x334dbf))['catch'](handleError(_0x55b21c,null));};exports[_0xbb29('0x44')]=function(_0x5e9cd7,_0xe8094e){var _0x446b66={'raw':!![],'where':{'id':_0x5e9cd7[_0xbb29('0x45')]['id']}},_0x36d9ab={};_0x36d9ab[_0xbb29('0x2f')]=_[_0xbb29('0x32')](db[_0xbb29('0x2c')]['rawAttributes']);_0x36d9ab[_0xbb29('0x31')]=_[_0xbb29('0x32')](_0x5e9cd7[_0xbb29('0x31')]);_0x36d9ab['filters']=_[_0xbb29('0x33')](_0x36d9ab['model'],_0x36d9ab[_0xbb29('0x31')]);_0x446b66[_0xbb29('0x34')]=_[_0xbb29('0x33')](_0x36d9ab[_0xbb29('0x2f')],qs['fields'](_0x5e9cd7[_0xbb29('0x31')][_0xbb29('0x35')]));_0x446b66[_0xbb29('0x34')]=_0x446b66['attributes'][_0xbb29('0x36')]?_0x446b66[_0xbb29('0x34')]:_0x36d9ab[_0xbb29('0x2f')];if(_0x5e9cd7[_0xbb29('0x31')][_0xbb29('0x40')]){_0x446b66['include']=[{'all':!![]}];}_0x446b66=_['merge']({},_0x446b66,_0x5e9cd7[_0xbb29('0x46')]);return db[_0xbb29('0x2c')][_0xbb29('0x47')](_0x446b66)[_0xbb29('0x25')](handleEntityNotFound(_0xe8094e,null))[_0xbb29('0x25')](respondWithResult(_0xe8094e,null))['catch'](handleError(_0xe8094e,null));};exports[_0xbb29('0x48')]=function(_0x56eee1,_0xa10d1c){return db[_0xbb29('0x2c')][_0xbb29('0x48')](_0x56eee1[_0xbb29('0x49')],{})['then'](respondWithResult(_0xa10d1c,0xc9))[_0xbb29('0x4a')](handleError(_0xa10d1c,null));};exports[_0xbb29('0x24')]=function(_0xd4396c,_0x5d5df4){if(_0xd4396c[_0xbb29('0x49')]['id']){delete _0xd4396c['body']['id'];}return db['SmsQueueReport']['find']({'where':{'id':_0xd4396c[_0xbb29('0x45')]['id']}})[_0xbb29('0x25')](handleEntityNotFound(_0x5d5df4,null))[_0xbb29('0x25')](saveUpdates(_0xd4396c['body'],null))[_0xbb29('0x25')](respondWithResult(_0x5d5df4,null))['catch'](handleError(_0x5d5df4,null));};exports[_0xbb29('0x26')]=function(_0xeb3a28,_0x45fb93){return db[_0xbb29('0x2c')][_0xbb29('0x47')]({'where':{'id':_0xeb3a28[_0xbb29('0x45')]['id']}})[_0xbb29('0x25')](handleEntityNotFound(_0x45fb93,null))[_0xbb29('0x25')](removeEntity(_0x45fb93,null))[_0xbb29('0x4a')](handleError(_0x45fb93,null));};exports[_0xbb29('0x4b')]=function(_0x3a33d5,_0x1cb677){return db[_0xbb29('0x2c')][_0xbb29('0x4b')]()['then'](respondWithResult(_0x1cb677,null))['catch'](handleError(_0x1cb677,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index a1ae206..bb3715c 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(_0x5c0674,_0x4f78a8){var _0x292ca5=function(_0x5dec04){while(--_0x5dec04){_0x5c0674['push'](_0x5c0674['shift']());}};_0x292ca5(++_0x4f78a8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb7e7[_0x186376];return _0x2dbdd9;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x4944a3,_0x40ab38){var _0x147c59=function(_0x44e1e2){while(--_0x44e1e2){_0x4944a3['push'](_0x4944a3['shift']());}};_0x147c59(++_0x40ab38);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xcb91[_0x5e6ea3];return _0x4048b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 1af24d5..5472a2b 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 _0x76ac=['limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','then','UpdateSmsQueueReport','update','attributes'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0x76ac,0x1e1));var _0xc76a=function(_0x1cb737,_0x255ecb){_0x1cb737=_0x1cb737-0x0;var _0x25a7c4=_0x76ac[_0x1cb737];return _0x25a7c4;};'use strict';var _=require('lodash');var util=require(_0xc76a('0x0'));var moment=require('moment');var BPromise=require(_0xc76a('0x1'));var rs=require(_0xc76a('0x2'));var fs=require('fs');var Redis=require(_0xc76a('0x3'));var db=require(_0xc76a('0x4'))['db'];var utils=require(_0xc76a('0x5'));var logger=require(_0xc76a('0x6'))(_0xc76a('0x7'));var config=require('../../config/environment');var jayson=require(_0xc76a('0x8'));var client=jayson[_0xc76a('0x9')][_0xc76a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5030ea,_0x5ac3e5,_0x454a4f){return new BPromise(function(_0x476c92,_0x5b9c92){return client[_0xc76a('0xb')](_0x5030ea,_0x454a4f)['then'](function(_0x3f0db0){logger[_0xc76a('0xc')](_0xc76a('0xd'),_0x5ac3e5,_0xc76a('0xe'));logger[_0xc76a('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x5ac3e5,_0xc76a('0xe'),JSON[_0xc76a('0x10')](_0x3f0db0));if(_0x3f0db0[_0xc76a('0x11')]){if(_0x3f0db0['error'][_0xc76a('0x12')]===0x1f4){logger['error'](_0xc76a('0xd'),_0x5ac3e5,_0x3f0db0[_0xc76a('0x11')][_0xc76a('0x13')]);return _0x5b9c92(_0x3f0db0['error'][_0xc76a('0x13')]);}logger['error'](_0xc76a('0xd'),_0x5ac3e5,_0x3f0db0[_0xc76a('0x11')][_0xc76a('0x13')]);return _0x476c92(_0x3f0db0[_0xc76a('0x11')]['message']);}else{logger[_0xc76a('0xc')](_0xc76a('0xd'),_0x5ac3e5,'request\x20sent');_0x476c92(_0x3f0db0[_0xc76a('0x14')]['message']);}})[_0xc76a('0x15')](function(_0x1bc02d){logger['error'](_0xc76a('0xd'),_0x5ac3e5,_0x1bc02d);_0x5b9c92(_0x1bc02d);});});}exports[_0xc76a('0x16')]=function(_0x13a0b2){var _0x4a2eda=this;return new Promise(function(_0x3f3a1f,_0x4d7cd3){return db[_0xc76a('0x17')][_0xc76a('0x18')](_0x13a0b2[_0xc76a('0x19')],{'raw':_0x13a0b2[_0xc76a('0x1a')]?_0x13a0b2[_0xc76a('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0xc76a('0x1b')](function(_0x1ee0e4){logger[_0xc76a('0xc')]('CreateSmsQueueReport',_0x13a0b2);logger[_0xc76a('0xf')](_0xc76a('0x16'),_0x13a0b2,JSON[_0xc76a('0x10')](_0x1ee0e4));_0x3f3a1f(_0x1ee0e4);})[_0xc76a('0x15')](function(_0x30b71){logger[_0xc76a('0x11')](_0xc76a('0x16'),_0x30b71[_0xc76a('0x13')],_0x13a0b2);_0x4d7cd3(_0x4a2eda['error'](0x1f4,_0x30b71[_0xc76a('0x13')]));});});};exports[_0xc76a('0x1c')]=function(_0x1918f3){var _0x6e88eb=this;return new Promise(function(_0x396669,_0x228d17){return db[_0xc76a('0x17')][_0xc76a('0x1d')](_0x1918f3[_0xc76a('0x19')],{'raw':_0x1918f3[_0xc76a('0x1a')]?_0x1918f3[_0xc76a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1918f3[_0xc76a('0x1a')]?_0x1918f3[_0xc76a('0x1a')]['where']||null:null,'attributes':_0x1918f3[_0xc76a('0x1a')]?_0x1918f3[_0xc76a('0x1a')][_0xc76a('0x1e')]||null:null,'limit':_0x1918f3['options']?_0x1918f3[_0xc76a('0x1a')][_0xc76a('0x1f')]||null:null})[_0xc76a('0x1b')](function(_0x336e0b){logger[_0xc76a('0xc')](_0xc76a('0x1c'),_0x1918f3);logger[_0xc76a('0xf')](_0xc76a('0x1c'),_0x1918f3,JSON[_0xc76a('0x10')](_0x336e0b));_0x396669(_0x336e0b);})[_0xc76a('0x15')](function(_0x4cde2c){logger[_0xc76a('0x11')](_0xc76a('0x1c'),_0x4cde2c[_0xc76a('0x13')],_0x1918f3);_0x228d17(_0x6e88eb[_0xc76a('0x11')](0x1f4,_0x4cde2c[_0xc76a('0x13')]));});});}; \ No newline at end of file +var _0x2b24=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','debug','UpdateSmsQueueReport'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x2b24,0x1d4));var _0x42b2=function(_0x542e70,_0x220f9c){_0x542e70=_0x542e70-0x0;var _0x24115c=_0x2b24[_0x542e70];return _0x24115c;};'use strict';var _=require(_0x42b2('0x0'));var util=require(_0x42b2('0x1'));var moment=require(_0x42b2('0x2'));var BPromise=require(_0x42b2('0x3'));var rs=require(_0x42b2('0x4'));var fs=require('fs');var Redis=require(_0x42b2('0x5'));var db=require(_0x42b2('0x6'))['db'];var utils=require(_0x42b2('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x42b2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b71b4,_0x3098dd,_0x807b1a){return new BPromise(function(_0x49458c,_0x262573){return client[_0x42b2('0x9')](_0x1b71b4,_0x807b1a)[_0x42b2('0xa')](function(_0x2d07fb){logger[_0x42b2('0xb')](_0x42b2('0xc'),_0x3098dd,_0x42b2('0xd'));logger['debug'](_0x42b2('0xe'),_0x3098dd,_0x42b2('0xd'),JSON[_0x42b2('0xf')](_0x2d07fb));if(_0x2d07fb[_0x42b2('0x10')]){if(_0x2d07fb[_0x42b2('0x10')]['code']===0x1f4){logger[_0x42b2('0x10')](_0x42b2('0xc'),_0x3098dd,_0x2d07fb['error']['message']);return _0x262573(_0x2d07fb[_0x42b2('0x10')][_0x42b2('0x11')]);}logger[_0x42b2('0x10')](_0x42b2('0xc'),_0x3098dd,_0x2d07fb['error'][_0x42b2('0x11')]);return _0x49458c(_0x2d07fb[_0x42b2('0x10')][_0x42b2('0x11')]);}else{logger[_0x42b2('0xb')](_0x42b2('0xc'),_0x3098dd,_0x42b2('0xd'));_0x49458c(_0x2d07fb[_0x42b2('0x12')][_0x42b2('0x11')]);}})[_0x42b2('0x13')](function(_0x2f4b96){logger[_0x42b2('0x10')]('SmsQueueReport,\x20%s,\x20%s',_0x3098dd,_0x2f4b96);_0x262573(_0x2f4b96);});});}exports['CreateSmsQueueReport']=function(_0x5277e5){var _0x1194d7=this;return new Promise(function(_0x54e530,_0x48b00d){return db[_0x42b2('0x14')][_0x42b2('0x15')](_0x5277e5[_0x42b2('0x16')],{'raw':_0x5277e5[_0x42b2('0x17')]?_0x5277e5[_0x42b2('0x17')][_0x42b2('0x18')]===undefined?!![]:![]:!![]})[_0x42b2('0xa')](function(_0x36f422){logger[_0x42b2('0xb')](_0x42b2('0x19'),_0x5277e5);logger[_0x42b2('0x1a')]('CreateSmsQueueReport',_0x5277e5,JSON[_0x42b2('0xf')](_0x36f422));_0x54e530(_0x36f422);})['catch'](function(_0x481482){logger['error'](_0x42b2('0x19'),_0x481482['message'],_0x5277e5);_0x48b00d(_0x1194d7[_0x42b2('0x10')](0x1f4,_0x481482[_0x42b2('0x11')]));});});};exports[_0x42b2('0x1b')]=function(_0x193afc){var _0x43a95f=this;return new Promise(function(_0x5cf621,_0x4d758d){return db[_0x42b2('0x14')]['update'](_0x193afc[_0x42b2('0x16')],{'raw':_0x193afc['options']?_0x193afc[_0x42b2('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x193afc['options']?_0x193afc[_0x42b2('0x17')][_0x42b2('0x1c')]||null:null,'attributes':_0x193afc['options']?_0x193afc['options'][_0x42b2('0x1d')]||null:null,'limit':_0x193afc[_0x42b2('0x17')]?_0x193afc[_0x42b2('0x17')][_0x42b2('0x1e')]||null:null})['then'](function(_0x25c74b){logger[_0x42b2('0xb')](_0x42b2('0x1b'),_0x193afc);logger[_0x42b2('0x1a')](_0x42b2('0x1b'),_0x193afc,JSON[_0x42b2('0xf')](_0x25c74b));_0x5cf621(_0x25c74b);})['catch'](function(_0x236d13){logger[_0x42b2('0x10')](_0x42b2('0x1b'),_0x236d13['message'],_0x193afc);_0x4d758d(_0x43a95f[_0x42b2('0x10')](0x1f4,_0x236d13[_0x42b2('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 64a88a1..f82df3c 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 _0x5636=['isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x14e6d2,_0x17baf7){var _0x5d98ab=function(_0x5b50d7){while(--_0x5b50d7){_0x14e6d2['push'](_0x14e6d2['shift']());}};_0x5d98ab(++_0x17baf7);}(_0x5636,0x102));var _0x6563=function(_0x46ed4d,_0x1cad1c){_0x46ed4d=_0x46ed4d-0x0;var _0x1314d6=_0x5636[_0x46ed4d];return _0x1314d6;};'use strict';var multer=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6563('0x2')]();var fs_extra=require(_0x6563('0x3'));var auth=require(_0x6563('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6563('0x5'));var controller=require(_0x6563('0x6'));router[_0x6563('0x7')]('/',auth[_0x6563('0x8')](),controller[_0x6563('0x9')]);router[_0x6563('0x7')](_0x6563('0xa'),auth[_0x6563('0x8')](),controller[_0x6563('0xb')]);router[_0x6563('0x7')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6563('0xe')]);router[_0x6563('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6563('0x10')](_0x6563('0xc'),auth[_0x6563('0x8')](),controller[_0x6563('0x11')]);module[_0x6563('0x12')]=router; \ No newline at end of file +var _0x55ca=['create','put','update','delete','destroy','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x52e3c6,_0x1aede0){var _0x259d4e=function(_0x8bda47){while(--_0x8bda47){_0x52e3c6['push'](_0x52e3c6['shift']());}};_0x259d4e(++_0x1aede0);}(_0x55ca,0x126));var _0xa55c=function(_0x401b3e,_0xed8de5){_0x401b3e=_0x401b3e-0x0;var _0x4f290f=_0x55ca[_0x401b3e];return _0x4f290f;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/describe',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['show']);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xe')]);router[_0xa55c('0xf')](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 359a9d8..c14b81c 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0xce51e,_0x5d388f){var _0x442be7=function(_0x5aa87f){while(--_0x5aa87f){_0xce51e['push'](_0xce51e['shift']());}};_0x442be7(++_0x5d388f);}(_0x008c,0x188));var _0xc008=function(_0x5149c7,_0xfd2f67){_0x5149c7=_0x5149c7-0x0;var _0x5010b0=_0x008c[_0x5149c7];return _0x5010b0;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x13399d,_0x529b20){var _0x6f183=function(_0x280b79){while(--_0x280b79){_0x13399d['push'](_0x13399d['shift']());}};_0x6f183(++_0x529b20);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4f0b9d,_0x11ffae){_0x4f0b9d=_0x4f0b9d-0x0;var _0x4327d1=_0xf4eb[_0x4f0b9d];return _0x4327d1;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index e0bb5fc..191ad53 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 _0xc9ba=['find','create','body','catch','describe','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','send','SmsTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','include','findAll','show','params','keys','includeAll'];(function(_0x1b7a5d,_0x1a068d){var _0x165d76=function(_0x3180c5){while(--_0x3180c5){_0x1b7a5d['push'](_0x1b7a5d['shift']());}};_0x165d76(++_0x1a068d);}(_0xc9ba,0xe6));var _0xac9b=function(_0x1aa59b,_0x26612c){_0x1aa59b=_0x1aa59b-0x0;var _0x33011c=_0xc9ba[_0x1aa59b];return _0x33011c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac9b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac9b('0x1'));var rp=require(_0xac9b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac9b('0x3'));var util=require(_0xac9b('0x4'));var path=require(_0xac9b('0x5'));var sox=require(_0xac9b('0x6'));var csv=require(_0xac9b('0x7'));var ejs=require(_0xac9b('0x8'));var fs=require('fs');var fs_extra=require(_0xac9b('0x9'));var _=require('lodash');var squel=require(_0xac9b('0xa'));var crypto=require(_0xac9b('0xb'));var jsforce=require(_0xac9b('0xc'));var deskjs=require(_0xac9b('0xd'));var toCsv=require(_0xac9b('0x7'));var querystring=require(_0xac9b('0xe'));var Papa=require(_0xac9b('0xf'));var Redis=require(_0xac9b('0x10'));var authService=require(_0xac9b('0x11'));var qs=require(_0xac9b('0x12'));var as=require(_0xac9b('0x13'));var hardwareService=require(_0xac9b('0x14'));var logger=require(_0xac9b('0x15'))(_0xac9b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xac9b('0x17'));var db=require(_0xac9b('0x18'))['db'];function respondWithStatusCode(_0x3dd14a,_0x5dbfc2){_0x5dbfc2=_0x5dbfc2||0xcc;return function(_0x3b62b8){if(_0x3b62b8){return _0x3dd14a[_0xac9b('0x19')](_0x5dbfc2);}return _0x3dd14a['status'](_0x5dbfc2)['end']();};}function respondWithResult(_0x2f5a06,_0x23d99c){_0x23d99c=_0x23d99c||0xc8;return function(_0x4c47ec){if(_0x4c47ec){return _0x2f5a06[_0xac9b('0x1a')](_0x23d99c)['json'](_0x4c47ec);}};}function respondWithFilteredResult(_0x1ab2d3,_0x4e9c3e){return function(_0x4a0b92){if(_0x4a0b92){var _0x1e2474=typeof _0x4e9c3e[_0xac9b('0x1b')]===_0xac9b('0x1c')&&typeof _0x4e9c3e['limit']===_0xac9b('0x1c');var _0x4e65b0=_0x4a0b92[_0xac9b('0x1d')];var _0x4cd2f9=_0x1e2474?0x0:_0x4e9c3e[_0xac9b('0x1b')];var _0x11778a=_0x1e2474?_0x4a0b92[_0xac9b('0x1d')]:_0x4e9c3e['offset']+_0x4e9c3e[_0xac9b('0x1e')];var _0x33e7fa;if(_0x11778a>=_0x4e65b0){_0x11778a=_0x4e65b0;_0x33e7fa=0xc8;}else{_0x33e7fa=0xce;}_0x1ab2d3[_0xac9b('0x1a')](_0x33e7fa);return _0x1ab2d3[_0xac9b('0x1f')]('Content-Range',_0x4cd2f9+'-'+_0x11778a+'/'+_0x4e65b0)['json'](_0x4a0b92);}return null;};}function patchUpdates(_0x5df04b){return function(_0x4224b6){try{jsonpatch[_0xac9b('0x20')](_0x4224b6,_0x5df04b,!![]);}catch(_0x450f48){return BPromise[_0xac9b('0x21')](_0x450f48);}return _0x4224b6[_0xac9b('0x22')]();};}function saveUpdates(_0x4d527,_0x924ceb){return function(_0x17a01e){if(_0x17a01e){return _0x17a01e[_0xac9b('0x23')](_0x4d527)[_0xac9b('0x24')](function(_0x2b1095){return _0x2b1095;});}return null;};}function removeEntity(_0x567aef,_0x514234){return function(_0x3f4444){if(_0x3f4444){return _0x3f4444[_0xac9b('0x25')]()[_0xac9b('0x24')](function(){_0x567aef[_0xac9b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16bd3d,_0x222291){return function(_0x95d3d0){if(!_0x95d3d0){_0x16bd3d['sendStatus'](0x194);}return _0x95d3d0;};}function handleError(_0x54c907,_0xd122a2){_0xd122a2=_0xd122a2||0x1f4;return function(_0x43901a){logger['error'](_0x43901a[_0xac9b('0x26')]);if(_0x43901a[_0xac9b('0x27')]){delete _0x43901a[_0xac9b('0x27')];}_0x54c907[_0xac9b('0x1a')](_0xd122a2)[_0xac9b('0x28')](_0x43901a);};}exports['index']=function(_0x54d95e,_0x4877f5){var _0xf73b3c={},_0x1f9c07={},_0x5edb0d={'count':0x0,'rows':[]};var _0x5788d5=_['map'](db[_0xac9b('0x29')][_0xac9b('0x2a')],function(_0x2e35f5){return{'name':_0x2e35f5[_0xac9b('0x2b')],'type':_0x2e35f5['type'][_0xac9b('0x2c')]};});_0x1f9c07[_0xac9b('0x2d')]=_['map'](_0x5788d5,_0xac9b('0x27'));_0x1f9c07['query']=_['keys'](_0x54d95e[_0xac9b('0x2e')]);_0x1f9c07[_0xac9b('0x2f')]=_[_0xac9b('0x30')](_0x1f9c07['model'],_0x1f9c07[_0xac9b('0x2e')]);_0xf73b3c['attributes']=_['intersection'](_0x1f9c07[_0xac9b('0x2d')],qs[_0xac9b('0x31')](_0x54d95e['query'][_0xac9b('0x31')]));_0xf73b3c['attributes']=_0xf73b3c['attributes'][_0xac9b('0x32')]?_0xf73b3c[_0xac9b('0x33')]:_0x1f9c07[_0xac9b('0x2d')];if(!_0x54d95e['query'][_0xac9b('0x34')](_0xac9b('0x35'))){_0xf73b3c[_0xac9b('0x1e')]=qs[_0xac9b('0x1e')](_0x54d95e[_0xac9b('0x2e')][_0xac9b('0x1e')]);_0xf73b3c[_0xac9b('0x1b')]=qs[_0xac9b('0x1b')](_0x54d95e[_0xac9b('0x2e')][_0xac9b('0x1b')]);}_0xf73b3c[_0xac9b('0x36')]=qs[_0xac9b('0x37')](_0x54d95e['query'][_0xac9b('0x37')]);_0xf73b3c[_0xac9b('0x38')]=qs[_0xac9b('0x2f')](_[_0xac9b('0x39')](_0x54d95e[_0xac9b('0x2e')],_0x1f9c07[_0xac9b('0x2f')]),_0x5788d5);if(_0x54d95e[_0xac9b('0x2e')][_0xac9b('0x3a')]){_0xf73b3c[_0xac9b('0x38')]=_['merge'](_0xf73b3c['where'],{'$or':_[_0xac9b('0x3b')](_0x5788d5,function(_0x3923df){if(_0x3923df[_0xac9b('0x3c')]!==_0xac9b('0x3d')){var _0xa69f0c={};_0xa69f0c[_0x3923df['name']]={'$like':'%'+_0x54d95e[_0xac9b('0x2e')][_0xac9b('0x3a')]+'%'};return _0xa69f0c;}})});}_0xf73b3c=_[_0xac9b('0x3e')]({},_0xf73b3c,_0x54d95e[_0xac9b('0x3f')]);var _0x4852b4={'where':_0xf73b3c['where']};return db[_0xac9b('0x29')][_0xac9b('0x1d')](_0x4852b4)['then'](function(_0x7d0ef8){_0x5edb0d['count']=_0x7d0ef8;if(_0x54d95e[_0xac9b('0x2e')]['includeAll']){_0xf73b3c[_0xac9b('0x40')]=[{'all':!![]}];}return db['SmsTransferReport'][_0xac9b('0x41')](_0xf73b3c);})['then'](function(_0x2b5fde){_0x5edb0d['rows']=_0x2b5fde;return _0x5edb0d;})['then'](respondWithFilteredResult(_0x4877f5,_0xf73b3c))['catch'](handleError(_0x4877f5,null));};exports[_0xac9b('0x42')]=function(_0x2e1c7c,_0x45f65a){var _0x3e66a4={'raw':!![],'where':{'id':_0x2e1c7c[_0xac9b('0x43')]['id']}},_0x4ec2b2={};_0x4ec2b2[_0xac9b('0x2d')]=_[_0xac9b('0x44')](db[_0xac9b('0x29')]['rawAttributes']);_0x4ec2b2[_0xac9b('0x2e')]=_[_0xac9b('0x44')](_0x2e1c7c[_0xac9b('0x2e')]);_0x4ec2b2[_0xac9b('0x2f')]=_[_0xac9b('0x30')](_0x4ec2b2[_0xac9b('0x2d')],_0x4ec2b2[_0xac9b('0x2e')]);_0x3e66a4[_0xac9b('0x33')]=_[_0xac9b('0x30')](_0x4ec2b2[_0xac9b('0x2d')],qs[_0xac9b('0x31')](_0x2e1c7c[_0xac9b('0x2e')][_0xac9b('0x31')]));_0x3e66a4['attributes']=_0x3e66a4[_0xac9b('0x33')][_0xac9b('0x32')]?_0x3e66a4[_0xac9b('0x33')]:_0x4ec2b2[_0xac9b('0x2d')];if(_0x2e1c7c['query'][_0xac9b('0x45')]){_0x3e66a4[_0xac9b('0x40')]=[{'all':!![]}];}_0x3e66a4=_[_0xac9b('0x3e')]({},_0x3e66a4,_0x2e1c7c[_0xac9b('0x3f')]);return db[_0xac9b('0x29')][_0xac9b('0x46')](_0x3e66a4)['then'](handleEntityNotFound(_0x45f65a,null))[_0xac9b('0x24')](respondWithResult(_0x45f65a,null))['catch'](handleError(_0x45f65a,null));};exports['create']=function(_0x10ce8d,_0x2c1333){return db[_0xac9b('0x29')][_0xac9b('0x47')](_0x10ce8d[_0xac9b('0x48')],{})[_0xac9b('0x24')](respondWithResult(_0x2c1333,0xc9))[_0xac9b('0x49')](handleError(_0x2c1333,null));};exports['update']=function(_0x51ab6b,_0x40f502){if(_0x51ab6b[_0xac9b('0x48')]['id']){delete _0x51ab6b[_0xac9b('0x48')]['id'];}return db['SmsTransferReport'][_0xac9b('0x46')]({'where':{'id':_0x51ab6b[_0xac9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x40f502,null))[_0xac9b('0x24')](saveUpdates(_0x51ab6b[_0xac9b('0x48')],null))[_0xac9b('0x24')](respondWithResult(_0x40f502,null))['catch'](handleError(_0x40f502,null));};exports['destroy']=function(_0x1649bb,_0x3a9cce){return db[_0xac9b('0x29')]['find']({'where':{'id':_0x1649bb['params']['id']}})[_0xac9b('0x24')](handleEntityNotFound(_0x3a9cce,null))[_0xac9b('0x24')](removeEntity(_0x3a9cce,null))['catch'](handleError(_0x3a9cce,null));};exports[_0xac9b('0x4a')]=function(_0x5d6a24,_0x5af41a){return db[_0xac9b('0x29')][_0xac9b('0x4a')]()[_0xac9b('0x24')](respondWithResult(_0x5af41a,null))[_0xac9b('0x49')](handleError(_0x5af41a,null));}; \ No newline at end of file +var _0x7cb8=['../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsTransferReport','includeAll','include','rows','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x7cb8,0x1a3));var _0x87cb=function(_0x32e5e5,_0x37c7ff){_0x32e5e5=_0x32e5e5-0x0;var _0x5cb8d3=_0x7cb8[_0x32e5e5];return _0x5cb8d3;};'use strict';var emlformat=require(_0x87cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87cb('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87cb('0x2'));var moment=require('moment');var BPromise=require(_0x87cb('0x3'));var Mustache=require(_0x87cb('0x4'));var util=require(_0x87cb('0x5'));var path=require('path');var sox=require(_0x87cb('0x6'));var csv=require(_0x87cb('0x7'));var ejs=require(_0x87cb('0x8'));var fs=require('fs');var fs_extra=require(_0x87cb('0x9'));var _=require(_0x87cb('0xa'));var squel=require('squel');var crypto=require(_0x87cb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x87cb('0x7'));var querystring=require('querystring');var Papa=require(_0x87cb('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x87cb('0xd'));var as=require(_0x87cb('0xe'));var hardwareService=require(_0x87cb('0xf'));var logger=require(_0x87cb('0x10'))(_0x87cb('0x11'));var utils=require(_0x87cb('0x12'));var config=require(_0x87cb('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x87cb('0x14'))['db'];function respondWithStatusCode(_0x3751df,_0x237aa8){_0x237aa8=_0x237aa8||0xcc;return function(_0x33616c){if(_0x33616c){return _0x3751df['sendStatus'](_0x237aa8);}return _0x3751df['status'](_0x237aa8)[_0x87cb('0x15')]();};}function respondWithResult(_0x5bf995,_0x54d336){_0x54d336=_0x54d336||0xc8;return function(_0x5ac39d){if(_0x5ac39d){return _0x5bf995[_0x87cb('0x16')](_0x54d336)[_0x87cb('0x17')](_0x5ac39d);}};}function respondWithFilteredResult(_0xc0d7c2,_0x530415){return function(_0x5171c7){if(_0x5171c7){var _0x26991c=typeof _0x530415[_0x87cb('0x18')]===_0x87cb('0x19')&&typeof _0x530415[_0x87cb('0x1a')]===_0x87cb('0x19');var _0x208471=_0x5171c7[_0x87cb('0x1b')];var _0x1ac496=_0x26991c?0x0:_0x530415[_0x87cb('0x18')];var _0x3990a8=_0x26991c?_0x5171c7[_0x87cb('0x1b')]:_0x530415['offset']+_0x530415[_0x87cb('0x1a')];var _0x37a55d;if(_0x3990a8>=_0x208471){_0x3990a8=_0x208471;_0x37a55d=0xc8;}else{_0x37a55d=0xce;}_0xc0d7c2[_0x87cb('0x16')](_0x37a55d);return _0xc0d7c2[_0x87cb('0x1c')]('Content-Range',_0x1ac496+'-'+_0x3990a8+'/'+_0x208471)[_0x87cb('0x17')](_0x5171c7);}return null;};}function patchUpdates(_0x13e9e0){return function(_0x58721d){try{jsonpatch[_0x87cb('0x1d')](_0x58721d,_0x13e9e0,!![]);}catch(_0x5a9097){return BPromise[_0x87cb('0x1e')](_0x5a9097);}return _0x58721d[_0x87cb('0x1f')]();};}function saveUpdates(_0x2b6ffe,_0x4bb146){return function(_0x400720){if(_0x400720){return _0x400720[_0x87cb('0x20')](_0x2b6ffe)[_0x87cb('0x21')](function(_0x2eb347){return _0x2eb347;});}return null;};}function removeEntity(_0xe949c5,_0x5db335){return function(_0x4f5701){if(_0x4f5701){return _0x4f5701['destroy']()[_0x87cb('0x21')](function(){_0xe949c5[_0x87cb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c83fb,_0x2249ad){return function(_0x666d53){if(!_0x666d53){_0x1c83fb[_0x87cb('0x22')](0x194);}return _0x666d53;};}function handleError(_0x597954,_0x1eb230){_0x1eb230=_0x1eb230||0x1f4;return function(_0x356b26){logger[_0x87cb('0x23')](_0x356b26[_0x87cb('0x24')]);if(_0x356b26[_0x87cb('0x25')]){delete _0x356b26[_0x87cb('0x25')];}_0x597954['status'](_0x1eb230)['send'](_0x356b26);};}exports[_0x87cb('0x26')]=function(_0x4aa417,_0x4b2e7e){var _0x142a81={},_0xc9d924={},_0x27424c={'count':0x0,'rows':[]};var _0x1b8ff4=_['map'](db['SmsTransferReport'][_0x87cb('0x27')],function(_0x10fdaa){return{'name':_0x10fdaa[_0x87cb('0x28')],'type':_0x10fdaa[_0x87cb('0x29')][_0x87cb('0x2a')]};});_0xc9d924[_0x87cb('0x2b')]=_[_0x87cb('0x2c')](_0x1b8ff4,_0x87cb('0x25'));_0xc9d924[_0x87cb('0x2d')]=_[_0x87cb('0x2e')](_0x4aa417[_0x87cb('0x2d')]);_0xc9d924['filters']=_[_0x87cb('0x2f')](_0xc9d924[_0x87cb('0x2b')],_0xc9d924['query']);_0x142a81['attributes']=_[_0x87cb('0x2f')](_0xc9d924[_0x87cb('0x2b')],qs[_0x87cb('0x30')](_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x30')]));_0x142a81[_0x87cb('0x31')]=_0x142a81[_0x87cb('0x31')][_0x87cb('0x32')]?_0x142a81[_0x87cb('0x31')]:_0xc9d924[_0x87cb('0x2b')];if(!_0x4aa417['query']['hasOwnProperty'](_0x87cb('0x33'))){_0x142a81[_0x87cb('0x1a')]=qs['limit'](_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x1a')]);_0x142a81[_0x87cb('0x18')]=qs['offset'](_0x4aa417['query'][_0x87cb('0x18')]);}_0x142a81[_0x87cb('0x34')]=qs[_0x87cb('0x35')](_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x35')]);_0x142a81[_0x87cb('0x36')]=qs[_0x87cb('0x37')](_[_0x87cb('0x38')](_0x4aa417[_0x87cb('0x2d')],_0xc9d924[_0x87cb('0x37')]),_0x1b8ff4);if(_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x39')]){_0x142a81[_0x87cb('0x36')]=_[_0x87cb('0x3a')](_0x142a81[_0x87cb('0x36')],{'$or':_['map'](_0x1b8ff4,function(_0x24a598){if(_0x24a598[_0x87cb('0x29')]!==_0x87cb('0x3b')){var _0x2ccf05={};_0x2ccf05[_0x24a598[_0x87cb('0x25')]]={'$like':'%'+_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x39')]+'%'};return _0x2ccf05;}})});}_0x142a81=_[_0x87cb('0x3a')]({},_0x142a81,_0x4aa417[_0x87cb('0x3c')]);var _0x3fc0fd={'where':_0x142a81[_0x87cb('0x36')]};return db[_0x87cb('0x3d')]['count'](_0x3fc0fd)[_0x87cb('0x21')](function(_0x148d4e){_0x27424c['count']=_0x148d4e;if(_0x4aa417[_0x87cb('0x2d')][_0x87cb('0x3e')]){_0x142a81[_0x87cb('0x3f')]=[{'all':!![]}];}return db[_0x87cb('0x3d')]['findAll'](_0x142a81);})['then'](function(_0x85178f){_0x27424c[_0x87cb('0x40')]=_0x85178f;return _0x27424c;})[_0x87cb('0x21')](respondWithFilteredResult(_0x4b2e7e,_0x142a81))[_0x87cb('0x41')](handleError(_0x4b2e7e,null));};exports[_0x87cb('0x42')]=function(_0x2dcab2,_0x1959c8){var _0x4cafea={'raw':!![],'where':{'id':_0x2dcab2[_0x87cb('0x43')]['id']}},_0x5100b7={};_0x5100b7[_0x87cb('0x2b')]=_[_0x87cb('0x2e')](db['SmsTransferReport'][_0x87cb('0x27')]);_0x5100b7[_0x87cb('0x2d')]=_[_0x87cb('0x2e')](_0x2dcab2[_0x87cb('0x2d')]);_0x5100b7[_0x87cb('0x37')]=_[_0x87cb('0x2f')](_0x5100b7[_0x87cb('0x2b')],_0x5100b7[_0x87cb('0x2d')]);_0x4cafea[_0x87cb('0x31')]=_[_0x87cb('0x2f')](_0x5100b7[_0x87cb('0x2b')],qs[_0x87cb('0x30')](_0x2dcab2['query'][_0x87cb('0x30')]));_0x4cafea[_0x87cb('0x31')]=_0x4cafea[_0x87cb('0x31')][_0x87cb('0x32')]?_0x4cafea[_0x87cb('0x31')]:_0x5100b7[_0x87cb('0x2b')];if(_0x2dcab2[_0x87cb('0x2d')][_0x87cb('0x3e')]){_0x4cafea[_0x87cb('0x3f')]=[{'all':!![]}];}_0x4cafea=_[_0x87cb('0x3a')]({},_0x4cafea,_0x2dcab2[_0x87cb('0x3c')]);return db[_0x87cb('0x3d')][_0x87cb('0x44')](_0x4cafea)[_0x87cb('0x21')](handleEntityNotFound(_0x1959c8,null))[_0x87cb('0x21')](respondWithResult(_0x1959c8,null))['catch'](handleError(_0x1959c8,null));};exports[_0x87cb('0x45')]=function(_0x507174,_0x27da40){return db[_0x87cb('0x3d')][_0x87cb('0x45')](_0x507174[_0x87cb('0x46')],{})['then'](respondWithResult(_0x27da40,0xc9))[_0x87cb('0x41')](handleError(_0x27da40,null));};exports['update']=function(_0x482857,_0x4c2e3e){if(_0x482857[_0x87cb('0x46')]['id']){delete _0x482857[_0x87cb('0x46')]['id'];}return db[_0x87cb('0x3d')]['find']({'where':{'id':_0x482857['params']['id']}})[_0x87cb('0x21')](handleEntityNotFound(_0x4c2e3e,null))[_0x87cb('0x21')](saveUpdates(_0x482857['body'],null))[_0x87cb('0x21')](respondWithResult(_0x4c2e3e,null))[_0x87cb('0x41')](handleError(_0x4c2e3e,null));};exports[_0x87cb('0x47')]=function(_0xdb2b50,_0x1ca058){return db['SmsTransferReport'][_0x87cb('0x44')]({'where':{'id':_0xdb2b50[_0x87cb('0x43')]['id']}})[_0x87cb('0x21')](handleEntityNotFound(_0x1ca058,null))[_0x87cb('0x21')](removeEntity(_0x1ca058,null))[_0x87cb('0x41')](handleError(_0x1ca058,null));};exports[_0x87cb('0x48')]=function(_0x1bf159,_0x20ba32){return db['SmsTransferReport']['describe']()[_0x87cb('0x21')](respondWithResult(_0x20ba32,null))[_0x87cb('0x41')](handleError(_0x20ba32,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5e6529c..020c1ff 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 _0x3c94=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x15bbec,_0x308888){var _0x159dce=function(_0x11dd7e){while(--_0x11dd7e){_0x15bbec['push'](_0x15bbec['shift']());}};_0x159dce(++_0x308888);}(_0x3c94,0xcd));var _0x43c9=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x3c94[_0x258b93];return _0x35484b;};'use strict';var _=require(_0x43c9('0x0'));var util=require(_0x43c9('0x1'));var logger=require(_0x43c9('0x2'))(_0x43c9('0x3'));var moment=require(_0x43c9('0x4'));var BPromise=require(_0x43c9('0x5'));var rp=require(_0x43c9('0x6'));var fs=require('fs');var path=require(_0x43c9('0x7'));var rimraf=require(_0x43c9('0x8'));var config=require(_0x43c9('0x9'));var attributes=require(_0x43c9('0xa'));module[_0x43c9('0xb')]=function(_0x4fdfc2,_0x39c220){return _0x4fdfc2[_0x43c9('0xc')](_0x43c9('0xd'),attributes,{'tableName':_0x43c9('0xe'),'paranoid':![],'indexes':[{'name':_0x43c9('0xf'),'fields':[_0x43c9('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x64e1=['lodash','util','../../config/logger','api','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0x64e1,0x9a));var _0x164e=function(_0x4c21c3,_0x169be1){_0x4c21c3=_0x4c21c3-0x0;var _0x486acd=_0x64e1[_0x4c21c3];return _0x486acd;};'use strict';var _=require(_0x164e('0x0'));var util=require(_0x164e('0x1'));var logger=require(_0x164e('0x2'))(_0x164e('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(_0x164e('0x4'));var config=require('../../config/environment');var attributes=require(_0x164e('0x5'));module[_0x164e('0x6')]=function(_0x2a6d51,_0x3505b2){return _0x2a6d51[_0x164e('0x7')](_0x164e('0x8'),attributes,{'tableName':_0x164e('0x9'),'paranoid':![],'indexes':[{'name':_0x164e('0xa'),'fields':[_0x164e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index dfa9077..d56d525 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 _0x5ad3=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x3385d9,_0x4832af){var _0x57c704=function(_0x2c97d4){while(--_0x2c97d4){_0x3385d9['push'](_0x3385d9['shift']());}};_0x57c704(++_0x4832af);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x5ad3[_0x2ac5f8];return _0x3b8229;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var moment=require(_0x35ad('0x2'));var BPromise=require(_0x35ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ad('0x4'));var db=require(_0x35ad('0x5'))['db'];var utils=require(_0x35ad('0x6'));var logger=require(_0x35ad('0x7'))(_0x35ad('0x8'));var config=require(_0x35ad('0x9'));var jayson=require(_0x35ad('0xa'));var client=jayson[_0x35ad('0xb')][_0x35ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31cc6a,_0x4edc59,_0x292521){return new BPromise(function(_0x3cec3e,_0x3f1f55){return client['request'](_0x31cc6a,_0x292521)[_0x35ad('0xd')](function(_0x487107){logger['info'](_0x35ad('0xe'),_0x4edc59,_0x35ad('0xf'));logger['debug'](_0x35ad('0x10'),_0x4edc59,_0x35ad('0xf'),JSON['stringify'](_0x487107));if(_0x487107['error']){if(_0x487107[_0x35ad('0x11')][_0x35ad('0x12')]===0x1f4){logger['error'](_0x35ad('0xe'),_0x4edc59,_0x487107[_0x35ad('0x11')]['message']);return _0x3f1f55(_0x487107['error'][_0x35ad('0x13')]);}logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x487107['error'][_0x35ad('0x13')]);return _0x3cec3e(_0x487107[_0x35ad('0x11')]['message']);}else{logger[_0x35ad('0x14')]('SmsTransferReport,\x20%s,\x20%s',_0x4edc59,'request\x20sent');_0x3cec3e(_0x487107[_0x35ad('0x15')][_0x35ad('0x13')]);}})[_0x35ad('0x16')](function(_0x56cb8e){logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x56cb8e);_0x3f1f55(_0x56cb8e);});});} \ No newline at end of file +var _0x50d0=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x22a6a8,_0x2d2703){var _0x5286ae=function(_0x4aaeac){while(--_0x4aaeac){_0x22a6a8['push'](_0x22a6a8['shift']());}};_0x5286ae(++_0x2d2703);}(_0x50d0,0x101));var _0x050d=function(_0x174826,_0x2c53f2){_0x174826=_0x174826-0x0;var _0x522b3c=_0x50d0[_0x174826];return _0x522b3c;};'use strict';var _=require(_0x050d('0x0'));var util=require('util');var moment=require(_0x050d('0x1'));var BPromise=require(_0x050d('0x2'));var rs=require(_0x050d('0x3'));var fs=require('fs');var Redis=require(_0x050d('0x4'));var db=require(_0x050d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x050d('0x6'))(_0x050d('0x7'));var config=require(_0x050d('0x8'));var jayson=require(_0x050d('0x9'));var client=jayson[_0x050d('0xa')][_0x050d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348909,_0x5535d6,_0x2b2faa){return new BPromise(function(_0x516f5d,_0x1d3dd6){return client[_0x050d('0xc')](_0x348909,_0x2b2faa)[_0x050d('0xd')](function(_0x4f2e84){logger[_0x050d('0xe')](_0x050d('0xf'),_0x5535d6,_0x050d('0x10'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5535d6,_0x050d('0x10'),JSON[_0x050d('0x11')](_0x4f2e84));if(_0x4f2e84[_0x050d('0x12')]){if(_0x4f2e84[_0x050d('0x12')][_0x050d('0x13')]===0x1f4){logger[_0x050d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error'][_0x050d('0x14')]);return _0x1d3dd6(_0x4f2e84[_0x050d('0x12')][_0x050d('0x14')]);}logger[_0x050d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,_0x4f2e84['error']['message']);return _0x516f5d(_0x4f2e84['error']['message']);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x5535d6,'request\x20sent');_0x516f5d(_0x4f2e84[_0x050d('0x15')][_0x050d('0x14')]);}})[_0x050d('0x16')](function(_0x2001c6){logger[_0x050d('0x12')](_0x050d('0xf'),_0x5535d6,_0x2001c6);_0x1d3dd6(_0x2001c6);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3eddad5..fbd8153 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 _0xb260=['get','/:id','isAuthenticated','join','root','server/files/sounds/original/','originalname','replace','format','basename','extname','now','post','create','update','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x176767,_0x27ffb4){var _0x151e71=function(_0x3c80ce){while(--_0x3c80ce){_0x176767['push'](_0x176767['shift']());}};_0x151e71(++_0x27ffb4);}(_0xb260,0x13c));var _0x0b26=function(_0x13f524,_0x3e0427){_0x13f524=_0x13f524-0x0;var _0x5a0aa2=_0xb260[_0x13f524];return _0x5a0aa2;};'use strict';var multer=require('multer');var util=require(_0x0b26('0x0'));var path=require(_0x0b26('0x1'));var timeout=require(_0x0b26('0x2'));var express=require(_0x0b26('0x3'));var router=express[_0x0b26('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0b26('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x0b26('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0b26('0x7'),auth[_0x0b26('0x8')](),controller['show']);router[_0x0b26('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x27b822,_0xaff036,_0x29f0aa){_0x29f0aa(null,path[_0x0b26('0x9')](config[_0x0b26('0xa')],_0x0b26('0xb')));},'filename':function(_0x554b91,_0x334291,_0x3ffe22){_0x334291[_0x0b26('0xc')]=_0x334291[_0x0b26('0xc')][_0x0b26('0xd')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3ffe22(null,util[_0x0b26('0xe')]('%s-%s%s',path[_0x0b26('0xf')](_0x334291[_0x0b26('0xc')],path[_0x0b26('0x10')](_0x334291['originalname'])),Date[_0x0b26('0x11')](),path[_0x0b26('0x10')](_0x334291['originalname'])));}})});router[_0x0b26('0x12')]('/',upload['single']('file'),controller[_0x0b26('0x13')]);router['put'](_0x0b26('0x7'),auth[_0x0b26('0x8')](),controller[_0x0b26('0x14')]);router[_0x0b26('0x15')](_0x0b26('0x7'),auth[_0x0b26('0x8')](),controller[_0x0b26('0x15')]);module[_0x0b26('0x16')]=router; \ No newline at end of file +var _0x481f=['extname','now','post','single','file','put','/:id','update','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','%s-%s%s','basename'];(function(_0x5d1d2d,_0x12dc3d){var _0x5e4cd1=function(_0x163219){while(--_0x163219){_0x5d1d2d['push'](_0x5d1d2d['shift']());}};_0x5e4cd1(++_0x12dc3d);}(_0x481f,0x9a));var _0xf481=function(_0x360ce6,_0x26ac83){_0x360ce6=_0x360ce6-0x0;var _0x4ad3fa=_0x481f[_0x360ce6];return _0x4ad3fa;};'use strict';var multer=require(_0xf481('0x0'));var util=require(_0xf481('0x1'));var path=require(_0xf481('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf481('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf481('0x4'));var interaction=require(_0xf481('0x5'));var config=require('../../config/environment');var controller=require(_0xf481('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf481('0x7')]('/:id',auth[_0xf481('0x8')](),controller[_0xf481('0x9')]);router[_0xf481('0x7')](_0xf481('0xa'),auth[_0xf481('0x8')](),controller[_0xf481('0xb')]);var upload=multer({'storage':multer[_0xf481('0xc')]({'destination':function(_0x31f303,_0x2e461d,_0x283b48){_0x283b48(null,path[_0xf481('0xd')](config[_0xf481('0xe')],'server/files/sounds/original/'));},'filename':function(_0xcd7b56,_0x4df29a,_0x2079f8){_0x4df29a[_0xf481('0xf')]=_0x4df29a[_0xf481('0xf')][_0xf481('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2079f8(null,util[_0xf481('0x11')](_0xf481('0x12'),path[_0xf481('0x13')](_0x4df29a[_0xf481('0xf')],path[_0xf481('0x14')](_0x4df29a[_0xf481('0xf')])),Date[_0xf481('0x15')](),path[_0xf481('0x14')](_0x4df29a[_0xf481('0xf')])));}})});router[_0xf481('0x16')]('/',upload[_0xf481('0x17')](_0xf481('0x18')),controller['create']);router[_0xf481('0x19')](_0xf481('0x1a'),auth['isAuthenticated'](),controller[_0xf481('0x1b')]);router['delete'](_0xf481('0x1a'),auth['isAuthenticated'](),controller['delete']);module[_0xf481('0x1c')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 50ff8d3..8c82a1a 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 _0xef52=['BIGINT','INTEGER','sequelize','name','STRING','FLOAT'];(function(_0x1a851d,_0x518449){var _0x438d9f=function(_0x246eb7){while(--_0x246eb7){_0x1a851d['push'](_0x1a851d['shift']());}};_0x438d9f(++_0x518449);}(_0xef52,0xbc));var _0x2ef5=function(_0x161ac3,_0x142e49){_0x161ac3=_0x161ac3-0x0;var _0x3bb837=_0xef52[_0x161ac3];return _0x3bb837;};'use strict';var Sequelize=require(_0x2ef5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2ef5('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x2ef5('0x2')]},'display_name':{'type':Sequelize[_0x2ef5('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x2ef5('0x2')]},'original_format':{'type':Sequelize[_0x2ef5('0x2')]},'original_duration':{'type':Sequelize[_0x2ef5('0x3')]},'original_sampleCount':{'type':Sequelize[_0x2ef5('0x4')]},'original_channelCount':{'type':Sequelize[_0x2ef5('0x5')]},'original_bitRate':{'type':Sequelize[_0x2ef5('0x4')]},'original_sampleRate':{'type':Sequelize[_0x2ef5('0x5')]},'converted_format':{'type':Sequelize[_0x2ef5('0x2')]},'converted_duration':{'type':Sequelize[_0x2ef5('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x2ef5('0x5')]},'converted_bitRate':{'type':Sequelize[_0x2ef5('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x2ef5('0x5')]}}; \ No newline at end of file +var _0x8648=['STRING','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x2c3d86,_0x4371ed){var _0x39894b=function(_0x5d933b){while(--_0x5d933b){_0x2c3d86['push'](_0x2c3d86['shift']());}};_0x39894b(++_0x4371ed);}(_0x8648,0xae));var _0x8864=function(_0x1794f7,_0x20884b){_0x1794f7=_0x1794f7-0x0;var _0x14c54b=_0x8648[_0x1794f7];return _0x14c54b;};'use strict';var Sequelize=require(_0x8864('0x0'));module['exports']={'name':{'type':Sequelize[_0x8864('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0x8864('0x1')]},'display_name':{'type':Sequelize[_0x8864('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x8864('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x8864('0x3')]},'original_bitRate':{'type':Sequelize[_0x8864('0x4')]},'original_sampleRate':{'type':Sequelize[_0x8864('0x3')]},'converted_format':{'type':Sequelize[_0x8864('0x1')]},'converted_duration':{'type':Sequelize[_0x8864('0x2')]},'converted_sampleCount':{'type':Sequelize[_0x8864('0x4')]},'converted_channelCount':{'type':Sequelize[_0x8864('0x3')]},'converted_bitRate':{'type':Sequelize[_0x8864('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 1127bf2..3091f20 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 _0xe57e=['file','filename','substring','wav','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','0777','body','role','userProfileId','user','UserProfileSection','Sounds','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','destroy','then','get','error','name','send','index','map','Sound','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','VIRTUAL','count','include','findAll','rows','catch','show','params','includeAll','merge','options','find','download','save_name','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','originalname','extname'];(function(_0x5dab92,_0x276f5c){var _0x33c7e3=function(_0x347dc1){while(--_0x347dc1){_0x5dab92['push'](_0x5dab92['shift']());}};_0x33c7e3(++_0x276f5c);}(_0xe57e,0xa1));var _0xee57=function(_0x3dec01,_0x3a11d0){_0x3dec01=_0x3dec01-0x0;var _0x39498d=_0xe57e[_0x3dec01];return _0x39498d;};'use strict';var emlformat=require(_0xee57('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee57('0x1'));var jsonpatch=require(_0xee57('0x2'));var rp=require(_0xee57('0x3'));var moment=require(_0xee57('0x4'));var BPromise=require(_0xee57('0x5'));var Mustache=require(_0xee57('0x6'));var util=require(_0xee57('0x7'));var path=require(_0xee57('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee57('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee57('0xa'));var squel=require(_0xee57('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xee57('0xc'));var toCsv=require(_0xee57('0xd'));var querystring=require(_0xee57('0xe'));var Papa=require(_0xee57('0xf'));var Redis=require(_0xee57('0x10'));var authService=require(_0xee57('0x11'));var qs=require(_0xee57('0x12'));var as=require(_0xee57('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xee57('0x14'))(_0xee57('0x15'));var utils=require(_0xee57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b2f43,_0x37e30f){_0x37e30f=_0x37e30f||0xcc;return function(_0x3fcfad){if(_0x3fcfad){return _0x2b2f43[_0xee57('0x17')](_0x37e30f);}return _0x2b2f43[_0xee57('0x18')](_0x37e30f)[_0xee57('0x19')]();};}function respondWithResult(_0x23ca64,_0x5aa6e2){_0x5aa6e2=_0x5aa6e2||0xc8;return function(_0xa6ac76){if(_0xa6ac76){return _0x23ca64['status'](_0x5aa6e2)[_0xee57('0x1a')](_0xa6ac76);}};}function respondWithFilteredResult(_0x46e855,_0x1d90ac){return function(_0x42e7e2){if(_0x42e7e2){var _0x54f966=typeof _0x1d90ac[_0xee57('0x1b')]==='undefined'&&typeof _0x1d90ac[_0xee57('0x1c')]===_0xee57('0x1d');var _0x48eb7f=_0x42e7e2['count'];var _0xad9862=_0x54f966?0x0:_0x1d90ac[_0xee57('0x1b')];var _0x5ba278=_0x54f966?_0x42e7e2['count']:_0x1d90ac[_0xee57('0x1b')]+_0x1d90ac['limit'];var _0xdc077d;if(_0x5ba278>=_0x48eb7f){_0x5ba278=_0x48eb7f;_0xdc077d=0xc8;}else{_0xdc077d=0xce;}_0x46e855[_0xee57('0x18')](_0xdc077d);return _0x46e855[_0xee57('0x1e')](_0xee57('0x1f'),_0xad9862+'-'+_0x5ba278+'/'+_0x48eb7f)['json'](_0x42e7e2);}return null;};}function patchUpdates(_0x52644e){return function(_0x4aff11){try{jsonpatch[_0xee57('0x20')](_0x4aff11,_0x52644e,!![]);}catch(_0x2b45d7){return BPromise[_0xee57('0x21')](_0x2b45d7);}return _0x4aff11[_0xee57('0x22')]();};}function saveUpdates(_0x628cb,_0x2b5784){return function(_0x53cf94){if(_0x53cf94){return _0x53cf94[_0xee57('0x23')](_0x628cb)['then'](function(_0x3e116a){return _0x3e116a;});}return null;};}function removeEntity(_0x3cb9cd,_0x91e323){return function(_0x31a82d){if(_0x31a82d){return _0x31a82d[_0xee57('0x24')]()[_0xee57('0x25')](function(){var _0x144058=_0x31a82d[_0xee57('0x26')]({'plain':!![]});var _0x1f6e58='Sounds';return db['UserProfileResource'][_0xee57('0x24')]({'where':{'type':_0x1f6e58,'resourceId':_0x144058['id']}})[_0xee57('0x25')](function(){return _0x31a82d;});})[_0xee57('0x25')](function(){_0x3cb9cd['status'](0xcc)[_0xee57('0x19')]();});}};}function handleEntityNotFound(_0x2032f3,_0x342106){return function(_0x283d8e){if(!_0x283d8e){_0x2032f3['sendStatus'](0x194);}return _0x283d8e;};}function handleError(_0x241b2d,_0x50aa1c){_0x50aa1c=_0x50aa1c||0x1f4;return function(_0x50a4a9){logger[_0xee57('0x27')](_0x50a4a9['stack']);if(_0x50a4a9[_0xee57('0x28')]){delete _0x50a4a9[_0xee57('0x28')];}_0x241b2d[_0xee57('0x18')](_0x50aa1c)[_0xee57('0x29')](_0x50a4a9);};}exports[_0xee57('0x2a')]=function(_0xb26315,_0x4058b0){var _0x3793b7={},_0x3aecc3={},_0x1ad70b={'count':0x0,'rows':[]};var _0x2d7411=_[_0xee57('0x2b')](db[_0xee57('0x2c')][_0xee57('0x2d')],function(_0x50698a){return{'name':_0x50698a[_0xee57('0x2e')],'type':_0x50698a[_0xee57('0x2f')]['key']};});_0x3aecc3['model']=_[_0xee57('0x2b')](_0x2d7411,'name');_0x3aecc3[_0xee57('0x30')]=_[_0xee57('0x31')](_0xb26315[_0xee57('0x30')]);_0x3aecc3['filters']=_[_0xee57('0x32')](_0x3aecc3[_0xee57('0x33')],_0x3aecc3[_0xee57('0x30')]);_0x3793b7[_0xee57('0x34')]=_['intersection'](_0x3aecc3[_0xee57('0x33')],qs[_0xee57('0x35')](_0xb26315['query'][_0xee57('0x35')]));_0x3793b7[_0xee57('0x34')]=_0x3793b7[_0xee57('0x34')][_0xee57('0x36')]?_0x3793b7[_0xee57('0x34')]:_0x3aecc3[_0xee57('0x33')];if(!_0xb26315[_0xee57('0x30')][_0xee57('0x37')](_0xee57('0x38'))){_0x3793b7[_0xee57('0x1c')]=qs[_0xee57('0x1c')](_0xb26315[_0xee57('0x30')][_0xee57('0x1c')]);_0x3793b7[_0xee57('0x1b')]=qs[_0xee57('0x1b')](_0xb26315[_0xee57('0x30')][_0xee57('0x1b')]);}_0x3793b7[_0xee57('0x39')]=qs[_0xee57('0x3a')](_0xb26315[_0xee57('0x30')][_0xee57('0x3a')]);_0x3793b7['where']=qs[_0xee57('0x3b')](_['pick'](_0xb26315[_0xee57('0x30')],_0x3aecc3['filters']),_0x2d7411);if(_0xb26315[_0xee57('0x30')][_0xee57('0x3c')]){_0x3793b7[_0xee57('0x3d')]=_['merge'](_0x3793b7['where'],{'$or':_[_0xee57('0x2b')](_0x2d7411,function(_0x2e8f74){if(_0x2e8f74[_0xee57('0x2f')]!==_0xee57('0x3e')){var _0x1d3151={};_0x1d3151[_0x2e8f74[_0xee57('0x28')]]={'$like':'%'+_0xb26315[_0xee57('0x30')][_0xee57('0x3c')]+'%'};return _0x1d3151;}})});}_0x3793b7=_['merge']({},_0x3793b7,_0xb26315['options']);var _0x2e9cf7={'where':_0x3793b7['where']};return db[_0xee57('0x2c')][_0xee57('0x3f')](_0x2e9cf7)[_0xee57('0x25')](function(_0x30699f){_0x1ad70b[_0xee57('0x3f')]=_0x30699f;if(_0xb26315['query']['includeAll']){_0x3793b7[_0xee57('0x40')]=[{'all':!![]}];}return db['Sound'][_0xee57('0x41')](_0x3793b7);})[_0xee57('0x25')](function(_0x327a66){_0x1ad70b[_0xee57('0x42')]=_0x327a66;return _0x1ad70b;})[_0xee57('0x25')](respondWithFilteredResult(_0x4058b0,_0x3793b7))[_0xee57('0x43')](handleError(_0x4058b0,null));};exports[_0xee57('0x44')]=function(_0x36d053,_0x5c2393){var _0x41ae82={'raw':!![],'where':{'id':_0x36d053[_0xee57('0x45')]['id']}},_0x54959e={};_0x54959e[_0xee57('0x33')]=_[_0xee57('0x31')](db[_0xee57('0x2c')][_0xee57('0x2d')]);_0x54959e[_0xee57('0x30')]=_[_0xee57('0x31')](_0x36d053['query']);_0x54959e['filters']=_['intersection'](_0x54959e[_0xee57('0x33')],_0x54959e[_0xee57('0x30')]);_0x41ae82['attributes']=_[_0xee57('0x32')](_0x54959e[_0xee57('0x33')],qs[_0xee57('0x35')](_0x36d053[_0xee57('0x30')][_0xee57('0x35')]));_0x41ae82[_0xee57('0x34')]=_0x41ae82[_0xee57('0x34')]['length']?_0x41ae82[_0xee57('0x34')]:_0x54959e[_0xee57('0x33')];if(_0x36d053[_0xee57('0x30')][_0xee57('0x46')]){_0x41ae82['include']=[{'all':!![]}];}_0x41ae82=_[_0xee57('0x47')]({},_0x41ae82,_0x36d053[_0xee57('0x48')]);return db['Sound'][_0xee57('0x49')](_0x41ae82)['then'](handleEntityNotFound(_0x5c2393,null))[_0xee57('0x25')](respondWithResult(_0x5c2393,null))[_0xee57('0x43')](handleError(_0x5c2393,null));};exports[_0xee57('0x4a')]=function(_0x4d55c5,_0x18c3e8,_0x32ed13){return db[_0xee57('0x2c')][_0xee57('0x49')]({'where':{'id':_0x4d55c5[_0xee57('0x45')]['id']},'attributes':[_0xee57('0x28'),_0xee57('0x4b'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x18c3e8,null))['then'](function(_0x1f0422){if(_0x1f0422){if(!fs['existsSync'](path[_0xee57('0x4c')](config[_0xee57('0x4d')],_0xee57('0x4e'),_0x1f0422[_0xee57('0x4b')]+'.'+_0x1f0422[_0xee57('0x4f')]))){throw new db[(_0xee57('0x50'))][(_0xee57('0x51'))](_0xee57('0x52'));}return _0x18c3e8[_0xee57('0x4a')](path[_0xee57('0x4c')](config[_0xee57('0x4d')],'server/files/sounds/converted',util[_0xee57('0x53')](_0xee57('0x54'),_0x1f0422[_0xee57('0x4b')],_0x1f0422[_0xee57('0x4f')])),util['format'](_0xee57('0x54'),_0x1f0422['name'],_0x1f0422[_0xee57('0x4f')]));}return null;})[_0xee57('0x43')](handleError(_0x18c3e8,null));};exports[_0xee57('0x55')]=function(_0x3883e0,_0x3a9e1c,_0x44bf31){var _0x2e8b7b={'name':path[_0xee57('0x56')](_0x3883e0['file'][_0xee57('0x57')],path[_0xee57('0x58')](_0x3883e0[_0xee57('0x59')]['originalname'])),'save_name':path['basename'](_0x3883e0[_0xee57('0x59')][_0xee57('0x5a')],path[_0xee57('0x58')](_0x3883e0[_0xee57('0x59')][_0xee57('0x5a')])),'original_format':path[_0xee57('0x58')](_0x3883e0['file'][_0xee57('0x57')])[_0xee57('0x5b')](0x1),'converted_format':_0xee57('0x5c')};var _0x153e6f=path[_0xee57('0x4c')](config[_0xee57('0x4d')],'server/files/sounds/original',_0x3883e0['file']['filename']);var _0x15a56c=path[_0xee57('0x4c')](config['root'],_0xee57('0x4e'),util['format'](_0xee57('0x54'),path[_0xee57('0x56')](_0x3883e0[_0xee57('0x59')][_0xee57('0x5a')],path[_0xee57('0x58')](_0x3883e0[_0xee57('0x59')][_0xee57('0x5a')])),_0x2e8b7b[_0xee57('0x4f')]));logger['info'](_0xee57('0x5d'),_0x153e6f);logger['info'](_0xee57('0x5e'),_0x15a56c);try{fs[_0xee57('0x5f')](_0x153e6f,parseInt('0777',0x8));var _0x54fc63=sox[_0xee57('0x60')](_0x153e6f,_0x15a56c,{'sampleRate':0x1f40,'format':_0xee57('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x54fc63['on'](_0xee57('0x27'),function(_0x3b1a0f){fs[_0xee57('0x61')](_0x153e6f);_0x3a9e1c['status'](0x1f4)['send'](_0x3b1a0f);});_0x54fc63['on'](_0xee57('0x62'),function(_0x43945a){_0x2e8b7b['original_duration']=isNaN(_0x43945a[_0xee57('0x63')])?null:_0x43945a[_0xee57('0x63')]*0x3e8;_0x2e8b7b[_0xee57('0x64')]=isNaN(_0x43945a['sampleCount'])?null:_0x43945a[_0xee57('0x65')];_0x2e8b7b[_0xee57('0x66')]=isNaN(_0x43945a[_0xee57('0x67')])?null:_0x43945a[_0xee57('0x67')];_0x2e8b7b[_0xee57('0x68')]=isNaN(_0x43945a['bitRate'])?null:_0x43945a[_0xee57('0x69')];_0x2e8b7b[_0xee57('0x6a')]=isNaN(_0x43945a[_0xee57('0x6b')])?null:_0x43945a[_0xee57('0x6b')];});_0x54fc63['on']('dest',function(_0x44474c){_0x2e8b7b[_0xee57('0x6c')]=isNaN(_0x44474c[_0xee57('0x63')])?null:_0x44474c[_0xee57('0x63')]*0x3e8;_0x2e8b7b[_0xee57('0x6d')]=isNaN(_0x44474c[_0xee57('0x65')])?null:_0x44474c[_0xee57('0x65')];_0x2e8b7b[_0xee57('0x6e')]=isNaN(_0x44474c[_0xee57('0x67')])?null:_0x44474c[_0xee57('0x67')];_0x2e8b7b[_0xee57('0x6f')]=isNaN(_0x44474c[_0xee57('0x69')])?null:_0x44474c['bitRate'];_0x2e8b7b['converted_sampleRate']=isNaN(_0x44474c['sampleRate'])?null:_0x44474c[_0xee57('0x6b')];});_0x54fc63['on'](_0xee57('0x19'),function(){fs[_0xee57('0x5f')](_0x15a56c,parseInt(_0xee57('0x70'),0x8));return db[_0xee57('0x2c')][_0xee57('0x55')](_0x2e8b7b)['then'](function(_0x17e80b){var _0x25efbc={'role':_0x3883e0[_0xee57('0x71')][_0xee57('0x72')],'userProfileId':_0x3883e0[_0xee57('0x71')][_0xee57('0x73')]};if(!_0x25efbc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25efbc[_0xee57('0x72')]===_0xee57('0x74')){var _0x3a0f3f=_0x17e80b['get']({'plain':!![]});return db[_0xee57('0x75')][_0xee57('0x49')]({'where':{'name':_0xee57('0x76'),'userProfileId':_0x25efbc[_0xee57('0x73')]},'raw':!![]})[_0xee57('0x25')](function(_0x197cb7){if(_0x197cb7&&_0x197cb7['autoAssociation']===0x0){return db[_0xee57('0x77')][_0xee57('0x55')]({'name':_0x3a0f3f[_0xee57('0x28')],'resourceId':_0x3a0f3f['id'],'type':_0x197cb7[_0xee57('0x28')],'sectionId':_0x197cb7['id']},{})[_0xee57('0x25')](function(){return _0x17e80b;});}else{return _0x17e80b;}})[_0xee57('0x43')](function(_0x54d88e){logger[_0xee57('0x27')](_0xee57('0x78'),_0x54d88e);throw _0x54d88e;});}return _0x17e80b;})[_0xee57('0x25')](respondWithResult(_0x3a9e1c,null))[_0xee57('0x43')](handleError(_0x3a9e1c,null));});_0x54fc63['start']();}catch(_0x3f0a02){_0x3a9e1c[_0xee57('0x18')](0x1f4)[_0xee57('0x29')](_0x3f0a02);}};exports[_0xee57('0x23')]=function(_0x455cc4,_0x1979c3,_0x4a3637){return db[_0xee57('0x2c')][_0xee57('0x49')]({'where':{'id':_0x455cc4[_0xee57('0x45')]['id']}})[_0xee57('0x25')](handleEntityNotFound(_0x1979c3,null))[_0xee57('0x25')](saveUpdates(_['pick'](_0x455cc4['body'],['name',_0xee57('0x79')]),null))[_0xee57('0x25')](respondWithResult(_0x1979c3,null))[_0xee57('0x43')](handleError(_0x1979c3,null));};exports[_0xee57('0x7a')]=function(_0x224ed2,_0x36e15b,_0x237bc1){return db[_0xee57('0x2c')][_0xee57('0x49')]({'where':{'id':_0x224ed2[_0xee57('0x45')]['id']}})[_0xee57('0x25')](function(_0x3b6b1a){if(_0x3b6b1a){return _0x3b6b1a[_0xee57('0x24')]();}})[_0xee57('0x25')](function(_0xbb873e){var _0x4af31a=path[_0xee57('0x4c')](config[_0xee57('0x4d')],_0xee57('0x7b'),util[_0xee57('0x53')](_0xee57('0x54'),_0xbb873e['save_name'],_0xbb873e[_0xee57('0x7c')]));var _0x432be6=path['join'](config[_0xee57('0x4d')],_0xee57('0x4e'),util[_0xee57('0x53')](_0xee57('0x54'),_0xbb873e[_0xee57('0x4b')],_0xbb873e[_0xee57('0x4f')]));fs[_0xee57('0x61')](_0x4af31a);fs[_0xee57('0x61')](_0x432be6);return _0xbb873e;})[_0xee57('0x25')](function(_0x2441d4){if(_0x2441d4){return _0x36e15b[_0xee57('0x18')](0xcc)[_0xee57('0x19')]();}})[_0xee57('0x25')](handleEntityNotFound(_0x36e15b,null))[_0xee57('0x43')](handleError(_0x36e15b,null));}; \ No newline at end of file +var _0x2301=['original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','update','pick','description','delete','original_format','eml-format','zip-dir','fast-json-patch','moment','mustache','util','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','save','destroy','then','get','Sounds','status','error','send','index','Sound','type','key','name','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','show','params','rawAttributes','options','find','catch','download','save_name','join','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','root','%s.%s','converted_format','format','file','extname','originalname','basename','filename','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','channelCount'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x2301,0x95));var _0x1230=function(_0x4496c1,_0x103294){_0x4496c1=_0x4496c1-0x0;var _0xa2da11=_0x2301[_0x4496c1];return _0xa2da11;};'use strict';var emlformat=require(_0x1230('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1230('0x1'));var jsonpatch=require(_0x1230('0x2'));var rp=require('request-promise');var moment=require(_0x1230('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1230('0x4'));var util=require(_0x1230('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1230('0x6'));var fs=require('fs');var fs_extra=require(_0x1230('0x7'));var _=require('lodash');var squel=require(_0x1230('0x8'));var crypto=require(_0x1230('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1230('0xa'));var Redis=require(_0x1230('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x1230('0xc'));var as=require(_0x1230('0xd'));var hardwareService=require(_0x1230('0xe'));var logger=require(_0x1230('0xf'))(_0x1230('0x10'));var utils=require(_0x1230('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1230('0x12'))['db'];function respondWithStatusCode(_0x17c1b0,_0x1e0c45){_0x1e0c45=_0x1e0c45||0xcc;return function(_0x43ea78){if(_0x43ea78){return _0x17c1b0[_0x1230('0x13')](_0x1e0c45);}return _0x17c1b0['status'](_0x1e0c45)[_0x1230('0x14')]();};}function respondWithResult(_0x25decc,_0x4f21ba){_0x4f21ba=_0x4f21ba||0xc8;return function(_0x5961ab){if(_0x5961ab){return _0x25decc['status'](_0x4f21ba)[_0x1230('0x15')](_0x5961ab);}};}function respondWithFilteredResult(_0x30fe4e,_0x353cc1){return function(_0x4d0aa4){if(_0x4d0aa4){var _0x3d8dbf=typeof _0x353cc1[_0x1230('0x16')]==='undefined'&&typeof _0x353cc1[_0x1230('0x17')]===_0x1230('0x18');var _0x38b60e=_0x4d0aa4[_0x1230('0x19')];var _0x2f6815=_0x3d8dbf?0x0:_0x353cc1[_0x1230('0x16')];var _0x355ae1=_0x3d8dbf?_0x4d0aa4[_0x1230('0x19')]:_0x353cc1[_0x1230('0x16')]+_0x353cc1[_0x1230('0x17')];var _0x433db8;if(_0x355ae1>=_0x38b60e){_0x355ae1=_0x38b60e;_0x433db8=0xc8;}else{_0x433db8=0xce;}_0x30fe4e['status'](_0x433db8);return _0x30fe4e[_0x1230('0x1a')](_0x1230('0x1b'),_0x2f6815+'-'+_0x355ae1+'/'+_0x38b60e)[_0x1230('0x15')](_0x4d0aa4);}return null;};}function patchUpdates(_0x853398){return function(_0x53d84d){try{jsonpatch['apply'](_0x53d84d,_0x853398,!![]);}catch(_0x2a6cf0){return BPromise['reject'](_0x2a6cf0);}return _0x53d84d[_0x1230('0x1c')]();};}function saveUpdates(_0x29083a,_0x16364f){return function(_0x696147){if(_0x696147){return _0x696147['update'](_0x29083a)['then'](function(_0x7a7f7){return _0x7a7f7;});}return null;};}function removeEntity(_0x3149fb,_0x3e2978){return function(_0x5c11e7){if(_0x5c11e7){return _0x5c11e7[_0x1230('0x1d')]()[_0x1230('0x1e')](function(){var _0x49385f=_0x5c11e7[_0x1230('0x1f')]({'plain':!![]});var _0x258cfc=_0x1230('0x20');return db['UserProfileResource'][_0x1230('0x1d')]({'where':{'type':_0x258cfc,'resourceId':_0x49385f['id']}})[_0x1230('0x1e')](function(){return _0x5c11e7;});})[_0x1230('0x1e')](function(){_0x3149fb[_0x1230('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x572082,_0x3e81c5){return function(_0x26bb67){if(!_0x26bb67){_0x572082[_0x1230('0x13')](0x194);}return _0x26bb67;};}function handleError(_0x40c279,_0x4dea84){_0x4dea84=_0x4dea84||0x1f4;return function(_0x31f1ad){logger[_0x1230('0x22')](_0x31f1ad['stack']);if(_0x31f1ad['name']){delete _0x31f1ad['name'];}_0x40c279[_0x1230('0x21')](_0x4dea84)[_0x1230('0x23')](_0x31f1ad);};}exports[_0x1230('0x24')]=function(_0x5032f9,_0x347bbf){var _0x4f7a18={},_0xf560c2={},_0x5c9d1c={'count':0x0,'rows':[]};var _0x3aff35=_['map'](db[_0x1230('0x25')]['rawAttributes'],function(_0x3c0516){return{'name':_0x3c0516['fieldName'],'type':_0x3c0516[_0x1230('0x26')][_0x1230('0x27')]};});_0xf560c2['model']=_['map'](_0x3aff35,_0x1230('0x28'));_0xf560c2[_0x1230('0x29')]=_[_0x1230('0x2a')](_0x5032f9[_0x1230('0x29')]);_0xf560c2[_0x1230('0x2b')]=_[_0x1230('0x2c')](_0xf560c2['model'],_0xf560c2[_0x1230('0x29')]);_0x4f7a18[_0x1230('0x2d')]=_[_0x1230('0x2c')](_0xf560c2[_0x1230('0x2e')],qs[_0x1230('0x2f')](_0x5032f9[_0x1230('0x29')][_0x1230('0x2f')]));_0x4f7a18[_0x1230('0x2d')]=_0x4f7a18['attributes'][_0x1230('0x30')]?_0x4f7a18[_0x1230('0x2d')]:_0xf560c2[_0x1230('0x2e')];if(!_0x5032f9[_0x1230('0x29')][_0x1230('0x31')](_0x1230('0x32'))){_0x4f7a18[_0x1230('0x17')]=qs['limit'](_0x5032f9[_0x1230('0x29')][_0x1230('0x17')]);_0x4f7a18['offset']=qs[_0x1230('0x16')](_0x5032f9['query'][_0x1230('0x16')]);}_0x4f7a18[_0x1230('0x33')]=qs[_0x1230('0x34')](_0x5032f9[_0x1230('0x29')][_0x1230('0x34')]);_0x4f7a18[_0x1230('0x35')]=qs[_0x1230('0x2b')](_['pick'](_0x5032f9[_0x1230('0x29')],_0xf560c2[_0x1230('0x2b')]),_0x3aff35);if(_0x5032f9[_0x1230('0x29')][_0x1230('0x36')]){_0x4f7a18[_0x1230('0x35')]=_[_0x1230('0x37')](_0x4f7a18[_0x1230('0x35')],{'$or':_[_0x1230('0x38')](_0x3aff35,function(_0x5131ee){if(_0x5131ee[_0x1230('0x26')]!==_0x1230('0x39')){var _0x45a5bb={};_0x45a5bb[_0x5131ee['name']]={'$like':'%'+_0x5032f9[_0x1230('0x29')][_0x1230('0x36')]+'%'};return _0x45a5bb;}})});}_0x4f7a18=_['merge']({},_0x4f7a18,_0x5032f9['options']);var _0x2ad713={'where':_0x4f7a18[_0x1230('0x35')]};return db['Sound'][_0x1230('0x19')](_0x2ad713)[_0x1230('0x1e')](function(_0x44ef7d){_0x5c9d1c['count']=_0x44ef7d;if(_0x5032f9['query'][_0x1230('0x3a')]){_0x4f7a18[_0x1230('0x3b')]=[{'all':!![]}];}return db[_0x1230('0x25')][_0x1230('0x3c')](_0x4f7a18);})[_0x1230('0x1e')](function(_0x33849e){_0x5c9d1c[_0x1230('0x3d')]=_0x33849e;return _0x5c9d1c;})[_0x1230('0x1e')](respondWithFilteredResult(_0x347bbf,_0x4f7a18))['catch'](handleError(_0x347bbf,null));};exports[_0x1230('0x3e')]=function(_0x2148c8,_0x3c05d6){var _0x4fd35f={'raw':!![],'where':{'id':_0x2148c8[_0x1230('0x3f')]['id']}},_0x5ce894={};_0x5ce894[_0x1230('0x2e')]=_[_0x1230('0x2a')](db[_0x1230('0x25')][_0x1230('0x40')]);_0x5ce894[_0x1230('0x29')]=_[_0x1230('0x2a')](_0x2148c8['query']);_0x5ce894[_0x1230('0x2b')]=_[_0x1230('0x2c')](_0x5ce894[_0x1230('0x2e')],_0x5ce894['query']);_0x4fd35f[_0x1230('0x2d')]=_[_0x1230('0x2c')](_0x5ce894[_0x1230('0x2e')],qs[_0x1230('0x2f')](_0x2148c8['query'][_0x1230('0x2f')]));_0x4fd35f[_0x1230('0x2d')]=_0x4fd35f[_0x1230('0x2d')]['length']?_0x4fd35f[_0x1230('0x2d')]:_0x5ce894[_0x1230('0x2e')];if(_0x2148c8[_0x1230('0x29')]['includeAll']){_0x4fd35f[_0x1230('0x3b')]=[{'all':!![]}];}_0x4fd35f=_[_0x1230('0x37')]({},_0x4fd35f,_0x2148c8[_0x1230('0x41')]);return db[_0x1230('0x25')][_0x1230('0x42')](_0x4fd35f)[_0x1230('0x1e')](handleEntityNotFound(_0x3c05d6,null))[_0x1230('0x1e')](respondWithResult(_0x3c05d6,null))[_0x1230('0x43')](handleError(_0x3c05d6,null));};exports[_0x1230('0x44')]=function(_0x43cf76,_0x5f0566,_0x24196c){return db['Sound'][_0x1230('0x42')]({'where':{'id':_0x43cf76[_0x1230('0x3f')]['id']},'attributes':[_0x1230('0x28'),_0x1230('0x45'),'converted_format'],'raw':!![]})[_0x1230('0x1e')](handleEntityNotFound(_0x5f0566,null))[_0x1230('0x1e')](function(_0x430179){if(_0x430179){if(!fs['existsSync'](path[_0x1230('0x46')](config['root'],_0x1230('0x47'),_0x430179[_0x1230('0x45')]+'.'+_0x430179['converted_format']))){throw new db[(_0x1230('0x48'))][(_0x1230('0x49'))](_0x1230('0x4a'));}return _0x5f0566[_0x1230('0x44')](path[_0x1230('0x46')](config[_0x1230('0x4b')],_0x1230('0x47'),util['format'](_0x1230('0x4c'),_0x430179[_0x1230('0x45')],_0x430179[_0x1230('0x4d')])),util[_0x1230('0x4e')]('%s.%s',_0x430179[_0x1230('0x28')],_0x430179[_0x1230('0x4d')]));}return null;})[_0x1230('0x43')](handleError(_0x5f0566,null));};exports['create']=function(_0x4de29c,_0x485c75,_0x8d9510){var _0x23e751={'name':path['basename'](_0x4de29c[_0x1230('0x4f')]['originalname'],path[_0x1230('0x50')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x51')])),'save_name':path[_0x1230('0x52')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')],path[_0x1230('0x50')](_0x4de29c['file'][_0x1230('0x53')])),'original_format':path['extname'](_0x4de29c['file'][_0x1230('0x51')])['substring'](0x1),'converted_format':'wav'};var _0x17cbed=path['join'](config[_0x1230('0x4b')],_0x1230('0x54'),_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')]);var _0x393df7=path[_0x1230('0x46')](config['root'],'server/files/sounds/converted',util[_0x1230('0x4e')]('%s.%s',path[_0x1230('0x52')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')],path[_0x1230('0x50')](_0x4de29c[_0x1230('0x4f')][_0x1230('0x53')])),_0x23e751[_0x1230('0x4d')]));logger[_0x1230('0x55')](_0x1230('0x56'),_0x17cbed);logger['info'](_0x1230('0x57'),_0x393df7);try{fs[_0x1230('0x58')](_0x17cbed,parseInt(_0x1230('0x59'),0x8));var _0x163ce5=sox[_0x1230('0x5a')](_0x17cbed,_0x393df7,{'sampleRate':0x1f40,'format':_0x1230('0x5b'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x163ce5['on'](_0x1230('0x22'),function(_0x1b4570){fs[_0x1230('0x5c')](_0x17cbed);_0x485c75[_0x1230('0x21')](0x1f4)[_0x1230('0x23')](_0x1b4570);});_0x163ce5['on'](_0x1230('0x5d'),function(_0x4c5584){_0x23e751[_0x1230('0x5e')]=isNaN(_0x4c5584[_0x1230('0x5f')])?null:_0x4c5584[_0x1230('0x5f')]*0x3e8;_0x23e751[_0x1230('0x60')]=isNaN(_0x4c5584['sampleCount'])?null:_0x4c5584[_0x1230('0x61')];_0x23e751['original_channelCount']=isNaN(_0x4c5584[_0x1230('0x62')])?null:_0x4c5584[_0x1230('0x62')];_0x23e751[_0x1230('0x63')]=isNaN(_0x4c5584['bitRate'])?null:_0x4c5584[_0x1230('0x64')];_0x23e751['original_sampleRate']=isNaN(_0x4c5584[_0x1230('0x65')])?null:_0x4c5584[_0x1230('0x65')];});_0x163ce5['on'](_0x1230('0x66'),function(_0x1fb3df){_0x23e751[_0x1230('0x67')]=isNaN(_0x1fb3df[_0x1230('0x5f')])?null:_0x1fb3df['duration']*0x3e8;_0x23e751[_0x1230('0x68')]=isNaN(_0x1fb3df[_0x1230('0x61')])?null:_0x1fb3df['sampleCount'];_0x23e751[_0x1230('0x69')]=isNaN(_0x1fb3df[_0x1230('0x62')])?null:_0x1fb3df[_0x1230('0x62')];_0x23e751[_0x1230('0x6a')]=isNaN(_0x1fb3df[_0x1230('0x64')])?null:_0x1fb3df[_0x1230('0x64')];_0x23e751[_0x1230('0x6b')]=isNaN(_0x1fb3df[_0x1230('0x65')])?null:_0x1fb3df[_0x1230('0x65')];});_0x163ce5['on'](_0x1230('0x14'),function(){fs[_0x1230('0x58')](_0x393df7,parseInt(_0x1230('0x59'),0x8));return db['Sound'][_0x1230('0x6c')](_0x23e751)[_0x1230('0x1e')](function(_0x5298a1){var _0x5bca13={'role':_0x4de29c[_0x1230('0x6d')]['role'],'userProfileId':_0x4de29c[_0x1230('0x6d')][_0x1230('0x6e')]};if(!_0x5bca13)throw new Error(_0x1230('0x6f'));if(_0x5bca13[_0x1230('0x70')]===_0x1230('0x71')){var _0x474aa1=_0x5298a1[_0x1230('0x1f')]({'plain':!![]});return db[_0x1230('0x72')][_0x1230('0x42')]({'where':{'name':_0x1230('0x20'),'userProfileId':_0x5bca13[_0x1230('0x6e')]},'raw':!![]})[_0x1230('0x1e')](function(_0xde1069){if(_0xde1069&&_0xde1069[_0x1230('0x73')]===0x0){return db[_0x1230('0x74')][_0x1230('0x6c')]({'name':_0x474aa1['name'],'resourceId':_0x474aa1['id'],'type':_0xde1069[_0x1230('0x28')],'sectionId':_0xde1069['id']},{})[_0x1230('0x1e')](function(){return _0x5298a1;});}else{return _0x5298a1;}})['catch'](function(_0x243a8f){logger['error'](_0x1230('0x75'),_0x243a8f);throw _0x243a8f;});}return _0x5298a1;})[_0x1230('0x1e')](respondWithResult(_0x485c75,null))[_0x1230('0x43')](handleError(_0x485c75,null));});_0x163ce5[_0x1230('0x76')]();}catch(_0xe50ee9){_0x485c75[_0x1230('0x21')](0x1f4)['send'](_0xe50ee9);}};exports[_0x1230('0x77')]=function(_0x2843f0,_0x49ed84,_0x123cbe){return db[_0x1230('0x25')][_0x1230('0x42')]({'where':{'id':_0x2843f0[_0x1230('0x3f')]['id']}})['then'](handleEntityNotFound(_0x49ed84,null))['then'](saveUpdates(_[_0x1230('0x78')](_0x2843f0['body'],[_0x1230('0x28'),_0x1230('0x79')]),null))['then'](respondWithResult(_0x49ed84,null))[_0x1230('0x43')](handleError(_0x49ed84,null));};exports[_0x1230('0x7a')]=function(_0x1b264e,_0x3d297e,_0x49ceee){return db[_0x1230('0x25')]['find']({'where':{'id':_0x1b264e[_0x1230('0x3f')]['id']}})[_0x1230('0x1e')](function(_0x368ab1){if(_0x368ab1){return _0x368ab1[_0x1230('0x1d')]();}})[_0x1230('0x1e')](function(_0x2a9e03){var _0x1010cf=path[_0x1230('0x46')](config[_0x1230('0x4b')],_0x1230('0x54'),util[_0x1230('0x4e')](_0x1230('0x4c'),_0x2a9e03[_0x1230('0x45')],_0x2a9e03[_0x1230('0x7b')]));var _0x2b71c9=path[_0x1230('0x46')](config[_0x1230('0x4b')],'server/files/sounds/converted',util[_0x1230('0x4e')](_0x1230('0x4c'),_0x2a9e03['save_name'],_0x2a9e03[_0x1230('0x4d')]));fs['unlinkSync'](_0x1010cf);fs[_0x1230('0x5c')](_0x2b71c9);return _0x2a9e03;})[_0x1230('0x1e')](function(_0x44ef54){if(_0x44ef54){return _0x3d297e[_0x1230('0x21')](0xcc)[_0x1230('0x14')]();}})[_0x1230('0x1e')](handleEntityNotFound(_0x3d297e,null))[_0x1230('0x43')](handleError(_0x3d297e,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index a4399f4..99938b4 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 _0x47fa=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','Sound','tools_sounds','lodash','util'];(function(_0x508ea2,_0x103d2d){var _0x96fea1=function(_0x58d8b3){while(--_0x58d8b3){_0x508ea2['push'](_0x508ea2['shift']());}};_0x96fea1(++_0x103d2d);}(_0x47fa,0x6a));var _0xa47f=function(_0x303064,_0x12f0c2){_0x303064=_0x303064-0x0;var _0x5a1d3d=_0x47fa[_0x303064];return _0x5a1d3d;};'use strict';var _=require(_0xa47f('0x0'));var util=require(_0xa47f('0x1'));var logger=require(_0xa47f('0x2'))(_0xa47f('0x3'));var moment=require('moment');var BPromise=require(_0xa47f('0x4'));var rp=require(_0xa47f('0x5'));var fs=require('fs');var path=require(_0xa47f('0x6'));var rimraf=require(_0xa47f('0x7'));var config=require(_0xa47f('0x8'));var attributes=require('./sound.attributes');module['exports']=function(_0x2b31be,_0x2f76fc){return _0x2b31be[_0xa47f('0x9')](_0xa47f('0xa'),attributes,{'tableName':_0xa47f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37fc=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./sound.attributes','exports','Sound','lodash','util'];(function(_0x27638d,_0x4094db){var _0x35da35=function(_0x538095){while(--_0x538095){_0x27638d['push'](_0x27638d['shift']());}};_0x35da35(++_0x4094db);}(_0x37fc,0xa3));var _0xc37f=function(_0xe3f0fc,_0x6146a9){_0xe3f0fc=_0xe3f0fc-0x0;var _0x25fa6f=_0x37fc[_0xe3f0fc];return _0x25fa6f;};'use strict';var _=require(_0xc37f('0x0'));var util=require(_0xc37f('0x1'));var logger=require(_0xc37f('0x2'))(_0xc37f('0x3'));var moment=require(_0xc37f('0x4'));var BPromise=require('bluebird');var rp=require(_0xc37f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc37f('0x6'));var config=require(_0xc37f('0x7'));var attributes=require(_0xc37f('0x8'));module[_0xc37f('0x9')]=function(_0x30896b,_0x1d5d0f){return _0x30896b['define'](_0xc37f('0xa'),attributes,{'tableName':'tools_sounds','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 5624413..b714e99 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 _0x5cc5=['raw','where','attributes','map','include','model','then','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','options'];(function(_0x1c9fb8,_0x5d54f3){var _0x411597=function(_0x325e29){while(--_0x325e29){_0x1c9fb8['push'](_0x1c9fb8['shift']());}};_0x411597(++_0x5d54f3);}(_0x5cc5,0x66));var _0x55cc=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x5cc5[_0x2a67fe];return _0x57e726;};'use strict';var _=require(_0x55cc('0x0'));var util=require(_0x55cc('0x1'));var moment=require('moment');var BPromise=require(_0x55cc('0x2'));var rs=require(_0x55cc('0x3'));var fs=require('fs');var Redis=require(_0x55cc('0x4'));var db=require(_0x55cc('0x5'))['db'];var utils=require(_0x55cc('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x55cc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x55cc('0x8')][_0x55cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x99f340,_0x35b412,_0x5b93e1){return new BPromise(function(_0x573ff1,_0x362076){return client['request'](_0x99f340,_0x5b93e1)['then'](function(_0x3efbf9){logger[_0x55cc('0xa')]('Sound,\x20%s,\x20%s',_0x35b412,_0x55cc('0xb'));logger[_0x55cc('0xc')](_0x55cc('0xd'),_0x35b412,_0x55cc('0xb'),JSON['stringify'](_0x3efbf9));if(_0x3efbf9[_0x55cc('0xe')]){if(_0x3efbf9['error'][_0x55cc('0xf')]===0x1f4){logger['error'](_0x55cc('0x10'),_0x35b412,_0x3efbf9['error'][_0x55cc('0x11')]);return _0x362076(_0x3efbf9[_0x55cc('0xe')][_0x55cc('0x11')]);}logger[_0x55cc('0xe')](_0x55cc('0x10'),_0x35b412,_0x3efbf9[_0x55cc('0xe')][_0x55cc('0x11')]);return _0x573ff1(_0x3efbf9[_0x55cc('0xe')][_0x55cc('0x11')]);}else{logger[_0x55cc('0xa')](_0x55cc('0x10'),_0x35b412,_0x55cc('0xb'));_0x573ff1(_0x3efbf9[_0x55cc('0x12')][_0x55cc('0x11')]);}})['catch'](function(_0x4f10bf){logger[_0x55cc('0xe')](_0x55cc('0x10'),_0x35b412,_0x4f10bf);_0x362076(_0x4f10bf);});});}exports[_0x55cc('0x13')]=function(_0x40d0a5){var _0x388680=this;return new Promise(function(_0x5b8b90,_0x52cf2d){return db[_0x55cc('0x14')]['find']({'raw':_0x40d0a5[_0x55cc('0x15')]?_0x40d0a5[_0x55cc('0x15')][_0x55cc('0x16')]===undefined?!![]:![]:!![],'where':_0x40d0a5[_0x55cc('0x15')]?_0x40d0a5[_0x55cc('0x15')][_0x55cc('0x17')]||null:null,'attributes':_0x40d0a5[_0x55cc('0x15')]?_0x40d0a5[_0x55cc('0x15')][_0x55cc('0x18')]||null:null,'include':_0x40d0a5[_0x55cc('0x15')]?_0x40d0a5[_0x55cc('0x15')]['include']?_[_0x55cc('0x19')](_0x40d0a5[_0x55cc('0x15')][_0x55cc('0x1a')],function(_0x3e6e6b){return{'model':db[_0x3e6e6b[_0x55cc('0x1b')]],'as':_0x3e6e6b['as'],'attributes':_0x3e6e6b[_0x55cc('0x18')],'include':_0x3e6e6b['include']?_['map'](_0x3e6e6b[_0x55cc('0x1a')],function(_0x6c514a){return{'model':db[_0x6c514a[_0x55cc('0x1b')]],'as':_0x6c514a['as'],'attributes':_0x6c514a[_0x55cc('0x18')],'include':_0x6c514a['include']?_[_0x55cc('0x19')](_0x6c514a['include'],function(_0x179386){return{'model':db[_0x179386[_0x55cc('0x1b')]],'as':_0x179386['as'],'attributes':_0x179386['attributes']};}):[]};}):[]};}):[]:[]})[_0x55cc('0x1c')](function(_0x5e1762){logger[_0x55cc('0xa')]('ShowSound',_0x40d0a5);logger[_0x55cc('0xc')]('ShowSound',_0x40d0a5,JSON[_0x55cc('0x1d')](_0x5e1762));_0x5b8b90(_0x5e1762);})[_0x55cc('0x1e')](function(_0x18c9f2){logger['error']('ShowSound',_0x18c9f2['message'],_0x40d0a5);_0x52cf2d(_0x388680[_0x55cc('0xe')](0x1f4,_0x18c9f2[_0x55cc('0x11')]));});});}; \ No newline at end of file +var _0xeb08=['request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','Sound','find','options','raw','where','attributes','include','map','model','ShowSound','stringify','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x44e7b9,_0xf7f5cc){var _0x1de7ac=function(_0x307551){while(--_0x307551){_0x44e7b9['push'](_0x44e7b9['shift']());}};_0x1de7ac(++_0xf7f5cc);}(_0xeb08,0xfe));var _0x8eb0=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0xeb08[_0x1e5cc3];return _0x15c596;};'use strict';var _=require(_0x8eb0('0x0'));var util=require(_0x8eb0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8eb0('0x2'));var fs=require('fs');var Redis=require(_0x8eb0('0x3'));var db=require(_0x8eb0('0x4'))['db'];var utils=require(_0x8eb0('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8eb0('0x6'));var jayson=require(_0x8eb0('0x7'));var client=jayson[_0x8eb0('0x8')][_0x8eb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ac78f,_0x1a2e61,_0x5625bc){return new BPromise(function(_0x4e2cec,_0x4a51e3){return client[_0x8eb0('0xa')](_0x3ac78f,_0x5625bc)[_0x8eb0('0xb')](function(_0x2f7578){logger[_0x8eb0('0xc')](_0x8eb0('0xd'),_0x1a2e61,_0x8eb0('0xe'));logger[_0x8eb0('0xf')](_0x8eb0('0x10'),_0x1a2e61,'request\x20sent',JSON['stringify'](_0x2f7578));if(_0x2f7578[_0x8eb0('0x11')]){if(_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x12')]===0x1f4){logger['error'](_0x8eb0('0xd'),_0x1a2e61,_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);return _0x4a51e3(_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);}logger[_0x8eb0('0x11')](_0x8eb0('0xd'),_0x1a2e61,_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);return _0x4e2cec(_0x2f7578[_0x8eb0('0x11')][_0x8eb0('0x13')]);}else{logger[_0x8eb0('0xc')](_0x8eb0('0xd'),_0x1a2e61,_0x8eb0('0xe'));_0x4e2cec(_0x2f7578[_0x8eb0('0x14')]['message']);}})[_0x8eb0('0x15')](function(_0x179f52){logger[_0x8eb0('0x11')](_0x8eb0('0xd'),_0x1a2e61,_0x179f52);_0x4a51e3(_0x179f52);});});}exports['ShowSound']=function(_0x489172){var _0xc4f1aa=this;return new Promise(function(_0x2f4a5f,_0x49e287){return db[_0x8eb0('0x16')][_0x8eb0('0x17')]({'raw':_0x489172[_0x8eb0('0x18')]?_0x489172[_0x8eb0('0x18')][_0x8eb0('0x19')]===undefined?!![]:![]:!![],'where':_0x489172[_0x8eb0('0x18')]?_0x489172['options'][_0x8eb0('0x1a')]||null:null,'attributes':_0x489172[_0x8eb0('0x18')]?_0x489172[_0x8eb0('0x18')][_0x8eb0('0x1b')]||null:null,'include':_0x489172[_0x8eb0('0x18')]?_0x489172[_0x8eb0('0x18')][_0x8eb0('0x1c')]?_[_0x8eb0('0x1d')](_0x489172[_0x8eb0('0x18')][_0x8eb0('0x1c')],function(_0x579119){return{'model':db[_0x579119['model']],'as':_0x579119['as'],'attributes':_0x579119[_0x8eb0('0x1b')],'include':_0x579119[_0x8eb0('0x1c')]?_['map'](_0x579119[_0x8eb0('0x1c')],function(_0x4b7358){return{'model':db[_0x4b7358[_0x8eb0('0x1e')]],'as':_0x4b7358['as'],'attributes':_0x4b7358[_0x8eb0('0x1b')],'include':_0x4b7358[_0x8eb0('0x1c')]?_[_0x8eb0('0x1d')](_0x4b7358[_0x8eb0('0x1c')],function(_0x5d8e34){return{'model':db[_0x5d8e34[_0x8eb0('0x1e')]],'as':_0x5d8e34['as'],'attributes':_0x5d8e34[_0x8eb0('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x8eb0('0xb')](function(_0x466757){logger[_0x8eb0('0xc')](_0x8eb0('0x1f'),_0x489172);logger[_0x8eb0('0xf')](_0x8eb0('0x1f'),_0x489172,JSON[_0x8eb0('0x20')](_0x466757));_0x2f4a5f(_0x466757);})[_0x8eb0('0x15')](function(_0x5c51c9){logger[_0x8eb0('0x11')]('ShowSound',_0x5c51c9[_0x8eb0('0x13')],_0x489172);_0x49e287(_0xc4f1aa[_0x8eb0('0x11')](0x1f4,_0x5c51c9[_0x8eb0('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 15e0292..a54a5f5 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x17f1c5,_0x3f7f91){var _0x1bcf1f=function(_0x1c3fc8){while(--_0x1c3fc8){_0x17f1c5['push'](_0x17f1c5['shift']());}};_0x1bcf1f(++_0x3f7f91);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var fs_extra=require(_0x7b7e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var controller=require(_0x7b7e('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7b7e('0x7')]);router[_0x7b7e('0x8')](_0x7b7e('0x9'),auth['isAuthenticated'](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=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(_0x5e2e20,_0x10c1d4){var _0x2df52c=function(_0x42662f){while(--_0x42662f){_0x5e2e20['push'](_0x5e2e20['shift']());}};_0x2df52c(++_0x10c1d4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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 03b6c2f..dc89de0 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 _0xa535=['out','STRING','exports','medium'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa535,0x18e));var _0x5a53=function(_0x430813,_0xc312c9){_0x430813=_0x430813-0x0;var _0x4f27e0=_0xa535[_0x430813];return _0x4f27e0;};'use strict';var Sequelize=require('sequelize');module[_0x5a53('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x5a53('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5a53('0x2')),'defaultValue':_0x5a53('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0x5a53('0x3')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x900f=['ENUM','out','STRING','sequelize','TEXT','medium'];(function(_0x52d60e,_0x4bf337){var _0x5c47f2=function(_0x16a0d5){while(--_0x16a0d5){_0x52d60e['push'](_0x52d60e['shift']());}};_0x5c47f2(++_0x4bf337);}(_0x900f,0xb7));var _0xf900=function(_0x49e454,_0x22328f){_0x49e454=_0x49e454-0x0;var _0x21d045=_0x900f[_0x49e454];return _0x21d045;};'use strict';var Sequelize=require(_0xf900('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xf900('0x1')](_0xf900('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0xf900('0x3')]('in','out'),'defaultValue':_0xf900('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xf900('0x5')]},'providerResponse':{'type':Sequelize[_0xf900('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 4b42edd..0ce6064 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 _0x71a1=['util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','update','then','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','where','pick','filters','filter','merge','include','findAll','catch','show','params','keys','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache'];(function(_0x5b89a0,_0x315a2a){var _0x44d81a=function(_0x2529f4){while(--_0x2529f4){_0x5b89a0['push'](_0x5b89a0['shift']());}};_0x44d81a(++_0x315a2a);}(_0x71a1,0x1eb));var _0x171a=function(_0x28ccc1,_0xa399ff){_0x28ccc1=_0x28ccc1-0x0;var _0x2277a9=_0x71a1[_0x28ccc1];return _0x2277a9;};'use strict';var emlformat=require(_0x171a('0x0'));var rimraf=require(_0x171a('0x1'));var zipdir=require(_0x171a('0x2'));var jsonpatch=require(_0x171a('0x3'));var rp=require(_0x171a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x171a('0x5'));var util=require(_0x171a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x171a('0x7'));var ejs=require(_0x171a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x171a('0x9'));var squel=require(_0x171a('0xa'));var crypto=require(_0x171a('0xb'));var jsforce=require(_0x171a('0xc'));var deskjs=require(_0x171a('0xd'));var toCsv=require(_0x171a('0x7'));var querystring=require(_0x171a('0xe'));var Papa=require(_0x171a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x171a('0x10'));var as=require(_0x171a('0x11'));var hardwareService=require(_0x171a('0x12'));var logger=require(_0x171a('0x13'))(_0x171a('0x14'));var utils=require(_0x171a('0x15'));var config=require(_0x171a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x171a('0x17'))['db'];function respondWithStatusCode(_0x5b0154,_0x26f64b){_0x26f64b=_0x26f64b||0xcc;return function(_0x8a90d3){if(_0x8a90d3){return _0x5b0154['sendStatus'](_0x26f64b);}return _0x5b0154['status'](_0x26f64b)[_0x171a('0x18')]();};}function respondWithResult(_0x16a5b5,_0x2730da){_0x2730da=_0x2730da||0xc8;return function(_0x353d02){if(_0x353d02){return _0x16a5b5[_0x171a('0x19')](_0x2730da)[_0x171a('0x1a')](_0x353d02);}};}function respondWithFilteredResult(_0x3c737f,_0x209c7f){return function(_0x370f6e){if(_0x370f6e){var _0xf32321=typeof _0x209c7f[_0x171a('0x1b')]===_0x171a('0x1c')&&typeof _0x209c7f[_0x171a('0x1d')]===_0x171a('0x1c');var _0x34db6e=_0x370f6e[_0x171a('0x1e')];var _0x34ec66=_0xf32321?0x0:_0x209c7f[_0x171a('0x1b')];var _0x1f1bf7=_0xf32321?_0x370f6e[_0x171a('0x1e')]:_0x209c7f[_0x171a('0x1b')]+_0x209c7f['limit'];var _0x44d970;if(_0x1f1bf7>=_0x34db6e){_0x1f1bf7=_0x34db6e;_0x44d970=0xc8;}else{_0x44d970=0xce;}_0x3c737f[_0x171a('0x19')](_0x44d970);return _0x3c737f[_0x171a('0x1f')]('Content-Range',_0x34ec66+'-'+_0x1f1bf7+'/'+_0x34db6e)[_0x171a('0x1a')](_0x370f6e);}return null;};}function patchUpdates(_0xb2c217){return function(_0x966760){try{jsonpatch[_0x171a('0x20')](_0x966760,_0xb2c217,!![]);}catch(_0x2771bf){return BPromise['reject'](_0x2771bf);}return _0x966760['save']();};}function saveUpdates(_0x591ca9,_0x9714bf){return function(_0x1a1627){if(_0x1a1627){return _0x1a1627[_0x171a('0x21')](_0x591ca9)[_0x171a('0x22')](function(_0x4fe162){return _0x4fe162;});}return null;};}function removeEntity(_0x18d24c,_0x23d4d3){return function(_0xcbc8e2){if(_0xcbc8e2){return _0xcbc8e2['destroy']()['then'](function(){_0x18d24c[_0x171a('0x19')](0xcc)[_0x171a('0x18')]();});}};}function handleEntityNotFound(_0x59580a,_0x1932b7){return function(_0x49bf1a){if(!_0x49bf1a){_0x59580a[_0x171a('0x23')](0x194);}return _0x49bf1a;};}function handleError(_0x3c7246,_0x4a8df3){_0x4a8df3=_0x4a8df3||0x1f4;return function(_0x15b6ce){logger[_0x171a('0x24')](_0x15b6ce[_0x171a('0x25')]);if(_0x15b6ce[_0x171a('0x26')]){delete _0x15b6ce['name'];}_0x3c7246['status'](_0x4a8df3)[_0x171a('0x27')](_0x15b6ce);};}exports[_0x171a('0x28')]=function(_0x49f3ec,_0x3dce2){var _0x3e6389={},_0x284f20={},_0x11d2e4={'count':0x0,'rows':[]};var _0x5f202c=_[_0x171a('0x29')](db[_0x171a('0x2a')][_0x171a('0x2b')],function(_0x1d3340){return{'name':_0x1d3340[_0x171a('0x2c')],'type':_0x1d3340[_0x171a('0x2d')][_0x171a('0x2e')]};});_0x284f20[_0x171a('0x2f')]=_['map'](_0x5f202c,'name');_0x284f20['query']=_['keys'](_0x49f3ec[_0x171a('0x30')]);_0x284f20['filters']=_['intersection'](_0x284f20[_0x171a('0x2f')],_0x284f20[_0x171a('0x30')]);_0x3e6389[_0x171a('0x31')]=_[_0x171a('0x32')](_0x284f20[_0x171a('0x2f')],qs[_0x171a('0x33')](_0x49f3ec[_0x171a('0x30')][_0x171a('0x33')]));_0x3e6389[_0x171a('0x31')]=_0x3e6389[_0x171a('0x31')][_0x171a('0x34')]?_0x3e6389[_0x171a('0x31')]:_0x284f20[_0x171a('0x2f')];if(!_0x49f3ec[_0x171a('0x30')]['hasOwnProperty'](_0x171a('0x35'))){_0x3e6389[_0x171a('0x1d')]=qs[_0x171a('0x1d')](_0x49f3ec['query']['limit']);_0x3e6389[_0x171a('0x1b')]=qs['offset'](_0x49f3ec[_0x171a('0x30')][_0x171a('0x1b')]);}_0x3e6389[_0x171a('0x36')]=qs['sort'](_0x49f3ec[_0x171a('0x30')]['sort']);_0x3e6389[_0x171a('0x37')]=qs['filters'](_[_0x171a('0x38')](_0x49f3ec[_0x171a('0x30')],_0x284f20[_0x171a('0x39')]),_0x5f202c);if(_0x49f3ec['query'][_0x171a('0x3a')]){_0x3e6389[_0x171a('0x37')]=_[_0x171a('0x3b')](_0x3e6389['where'],{'$or':_[_0x171a('0x29')](_0x5f202c,function(_0x265c81){if(_0x265c81[_0x171a('0x2d')]!=='VIRTUAL'){var _0x424457={};_0x424457[_0x265c81[_0x171a('0x26')]]={'$like':'%'+_0x49f3ec[_0x171a('0x30')][_0x171a('0x3a')]+'%'};return _0x424457;}})});}_0x3e6389=_[_0x171a('0x3b')]({},_0x3e6389,_0x49f3ec['options']);var _0x2aeed0={'where':_0x3e6389['where']};return db[_0x171a('0x2a')][_0x171a('0x1e')](_0x2aeed0)[_0x171a('0x22')](function(_0x478a03){_0x11d2e4['count']=_0x478a03;if(_0x49f3ec['query']['includeAll']){_0x3e6389[_0x171a('0x3c')]=[{'all':!![]}];}return db[_0x171a('0x2a')][_0x171a('0x3d')](_0x3e6389);})[_0x171a('0x22')](function(_0x33a000){_0x11d2e4['rows']=_0x33a000;return _0x11d2e4;})[_0x171a('0x22')](respondWithFilteredResult(_0x3dce2,_0x3e6389))[_0x171a('0x3e')](handleError(_0x3dce2,null));};exports[_0x171a('0x3f')]=function(_0x4bc849,_0x343bd3){var _0x45eeb6={'raw':!![],'where':{'id':_0x4bc849[_0x171a('0x40')]['id']}},_0x3c67a2={};_0x3c67a2['model']=_[_0x171a('0x41')](db['SquareMessage'][_0x171a('0x2b')]);_0x3c67a2[_0x171a('0x30')]=_[_0x171a('0x41')](_0x4bc849[_0x171a('0x30')]);_0x3c67a2[_0x171a('0x39')]=_[_0x171a('0x32')](_0x3c67a2[_0x171a('0x2f')],_0x3c67a2[_0x171a('0x30')]);_0x45eeb6[_0x171a('0x31')]=_[_0x171a('0x32')](_0x3c67a2['model'],qs[_0x171a('0x33')](_0x4bc849[_0x171a('0x30')]['fields']));_0x45eeb6[_0x171a('0x31')]=_0x45eeb6[_0x171a('0x31')][_0x171a('0x34')]?_0x45eeb6[_0x171a('0x31')]:_0x3c67a2['model'];if(_0x4bc849['query'][_0x171a('0x42')]){_0x45eeb6['include']=[{'all':!![]}];}_0x45eeb6=_[_0x171a('0x3b')]({},_0x45eeb6,_0x4bc849['options']);return db[_0x171a('0x2a')][_0x171a('0x43')](_0x45eeb6)[_0x171a('0x22')](handleEntityNotFound(_0x343bd3,null))[_0x171a('0x22')](respondWithResult(_0x343bd3,null))[_0x171a('0x3e')](handleError(_0x343bd3,null));};exports[_0x171a('0x44')]=function(_0x3baec0,_0x15a197){return db[_0x171a('0x2a')][_0x171a('0x44')](_0x3baec0['body'],{})[_0x171a('0x22')](respondWithResult(_0x15a197,0xc9))['catch'](handleError(_0x15a197,null));};exports[_0x171a('0x21')]=function(_0x506b0c,_0xb9647){if(_0x506b0c[_0x171a('0x45')]['id']){delete _0x506b0c[_0x171a('0x45')]['id'];}return db[_0x171a('0x2a')][_0x171a('0x43')]({'where':{'id':_0x506b0c[_0x171a('0x40')]['id']}})[_0x171a('0x22')](handleEntityNotFound(_0xb9647,null))[_0x171a('0x22')](saveUpdates(_0x506b0c[_0x171a('0x45')],null))[_0x171a('0x22')](respondWithResult(_0xb9647,null))[_0x171a('0x3e')](handleError(_0xb9647,null));};exports[_0x171a('0x46')]=function(_0x132973,_0x144a31){return db[_0x171a('0x2a')][_0x171a('0x43')]({'where':{'id':_0x132973[_0x171a('0x40')]['id']}})[_0x171a('0x22')](handleEntityNotFound(_0x144a31,null))['then'](removeEntity(_0x144a31,null))[_0x171a('0x3e')](handleError(_0x144a31,null));}; \ No newline at end of file +var _0xb7a5=['name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','destroy','then'];(function(_0x2427f8,_0x50d4fa){var _0x10f634=function(_0x35db7a){while(--_0x35db7a){_0x2427f8['push'](_0x2427f8['shift']());}};_0x10f634(++_0x50d4fa);}(_0xb7a5,0x67));var _0x5b7a=function(_0xc5944f,_0x5df40c){_0xc5944f=_0xc5944f-0x0;var _0x16fa66=_0xb7a5[_0xc5944f];return _0x16fa66;};'use strict';var emlformat=require(_0x5b7a('0x0'));var rimraf=require(_0x5b7a('0x1'));var zipdir=require(_0x5b7a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b7a('0x3'));var moment=require('moment');var BPromise=require(_0x5b7a('0x4'));var Mustache=require(_0x5b7a('0x5'));var util=require(_0x5b7a('0x6'));var path=require('path');var sox=require(_0x5b7a('0x7'));var csv=require(_0x5b7a('0x8'));var ejs=require(_0x5b7a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5b7a('0xa'));var crypto=require('crypto');var jsforce=require(_0x5b7a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b7a('0x8'));var querystring=require(_0x5b7a('0xc'));var Papa=require('papaparse');var Redis=require(_0x5b7a('0xd'));var authService=require(_0x5b7a('0xe'));var qs=require(_0x5b7a('0xf'));var as=require(_0x5b7a('0x10'));var hardwareService=require(_0x5b7a('0x11'));var logger=require('../../config/logger')(_0x5b7a('0x12'));var utils=require(_0x5b7a('0x13'));var config=require(_0x5b7a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b7a('0x15'))['db'];function respondWithStatusCode(_0x15be0e,_0x1e2342){_0x1e2342=_0x1e2342||0xcc;return function(_0x5ecf1f){if(_0x5ecf1f){return _0x15be0e[_0x5b7a('0x16')](_0x1e2342);}return _0x15be0e[_0x5b7a('0x17')](_0x1e2342)['end']();};}function respondWithResult(_0x233366,_0x9d502a){_0x9d502a=_0x9d502a||0xc8;return function(_0x56a804){if(_0x56a804){return _0x233366['status'](_0x9d502a)[_0x5b7a('0x18')](_0x56a804);}};}function respondWithFilteredResult(_0x5d5696,_0x442af3){return function(_0x87fbd6){if(_0x87fbd6){var _0x5209bf=typeof _0x442af3[_0x5b7a('0x19')]==='undefined'&&typeof _0x442af3[_0x5b7a('0x1a')]===_0x5b7a('0x1b');var _0x1dae34=_0x87fbd6[_0x5b7a('0x1c')];var _0x15fd1d=_0x5209bf?0x0:_0x442af3[_0x5b7a('0x19')];var _0x27c067=_0x5209bf?_0x87fbd6[_0x5b7a('0x1c')]:_0x442af3[_0x5b7a('0x19')]+_0x442af3[_0x5b7a('0x1a')];var _0x1a3a12;if(_0x27c067>=_0x1dae34){_0x27c067=_0x1dae34;_0x1a3a12=0xc8;}else{_0x1a3a12=0xce;}_0x5d5696['status'](_0x1a3a12);return _0x5d5696[_0x5b7a('0x1d')]('Content-Range',_0x15fd1d+'-'+_0x27c067+'/'+_0x1dae34)[_0x5b7a('0x18')](_0x87fbd6);}return null;};}function patchUpdates(_0x1e6d66){return function(_0xc678a5){try{jsonpatch[_0x5b7a('0x1e')](_0xc678a5,_0x1e6d66,!![]);}catch(_0x236684){return BPromise['reject'](_0x236684);}return _0xc678a5[_0x5b7a('0x1f')]();};}function saveUpdates(_0x511d87,_0x35b9ef){return function(_0x5374ce){if(_0x5374ce){return _0x5374ce[_0x5b7a('0x20')](_0x511d87)['then'](function(_0x1c1d4c){return _0x1c1d4c;});}return null;};}function removeEntity(_0x1762c3,_0x30f5a6){return function(_0x472ae8){if(_0x472ae8){return _0x472ae8[_0x5b7a('0x21')]()[_0x5b7a('0x22')](function(){_0x1762c3[_0x5b7a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d42b3,_0x5b24ac){return function(_0x182d22){if(!_0x182d22){_0x3d42b3['sendStatus'](0x194);}return _0x182d22;};}function handleError(_0x1b5e49,_0x584251){_0x584251=_0x584251||0x1f4;return function(_0x42d62b){logger['error'](_0x42d62b['stack']);if(_0x42d62b[_0x5b7a('0x23')]){delete _0x42d62b[_0x5b7a('0x23')];}_0x1b5e49[_0x5b7a('0x17')](_0x584251)[_0x5b7a('0x24')](_0x42d62b);};}exports['index']=function(_0x56a3e4,_0x26bd82){var _0x16ca39={},_0x3d79a0={},_0x435b94={'count':0x0,'rows':[]};var _0x4326fc=_[_0x5b7a('0x25')](db[_0x5b7a('0x26')][_0x5b7a('0x27')],function(_0x18f68e){return{'name':_0x18f68e[_0x5b7a('0x28')],'type':_0x18f68e[_0x5b7a('0x29')][_0x5b7a('0x2a')]};});_0x3d79a0[_0x5b7a('0x2b')]=_[_0x5b7a('0x25')](_0x4326fc,_0x5b7a('0x23'));_0x3d79a0[_0x5b7a('0x2c')]=_['keys'](_0x56a3e4[_0x5b7a('0x2c')]);_0x3d79a0[_0x5b7a('0x2d')]=_[_0x5b7a('0x2e')](_0x3d79a0[_0x5b7a('0x2b')],_0x3d79a0['query']);_0x16ca39[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x3d79a0['model'],qs[_0x5b7a('0x30')](_0x56a3e4['query'][_0x5b7a('0x30')]));_0x16ca39['attributes']=_0x16ca39[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x16ca39[_0x5b7a('0x2f')]:_0x3d79a0['model'];if(!_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x32')](_0x5b7a('0x33'))){_0x16ca39[_0x5b7a('0x1a')]=qs[_0x5b7a('0x1a')](_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x1a')]);_0x16ca39[_0x5b7a('0x19')]=qs[_0x5b7a('0x19')](_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x19')]);}_0x16ca39['order']=qs['sort'](_0x56a3e4['query'][_0x5b7a('0x34')]);_0x16ca39[_0x5b7a('0x35')]=qs[_0x5b7a('0x2d')](_[_0x5b7a('0x36')](_0x56a3e4[_0x5b7a('0x2c')],_0x3d79a0[_0x5b7a('0x2d')]),_0x4326fc);if(_0x56a3e4[_0x5b7a('0x2c')][_0x5b7a('0x37')]){_0x16ca39[_0x5b7a('0x35')]=_[_0x5b7a('0x38')](_0x16ca39[_0x5b7a('0x35')],{'$or':_[_0x5b7a('0x25')](_0x4326fc,function(_0x53eb47){if(_0x53eb47[_0x5b7a('0x29')]!==_0x5b7a('0x39')){var _0x5a1504={};_0x5a1504[_0x53eb47[_0x5b7a('0x23')]]={'$like':'%'+_0x56a3e4[_0x5b7a('0x2c')]['filter']+'%'};return _0x5a1504;}})});}_0x16ca39=_['merge']({},_0x16ca39,_0x56a3e4[_0x5b7a('0x3a')]);var _0x4d2d45={'where':_0x16ca39[_0x5b7a('0x35')]};return db['SquareMessage'][_0x5b7a('0x1c')](_0x4d2d45)[_0x5b7a('0x22')](function(_0x4c1542){_0x435b94[_0x5b7a('0x1c')]=_0x4c1542;if(_0x56a3e4['query'][_0x5b7a('0x3b')]){_0x16ca39[_0x5b7a('0x3c')]=[{'all':!![]}];}return db['SquareMessage'][_0x5b7a('0x3d')](_0x16ca39);})[_0x5b7a('0x22')](function(_0x2acbf0){_0x435b94[_0x5b7a('0x3e')]=_0x2acbf0;return _0x435b94;})[_0x5b7a('0x22')](respondWithFilteredResult(_0x26bd82,_0x16ca39))[_0x5b7a('0x3f')](handleError(_0x26bd82,null));};exports['show']=function(_0x4f5318,_0x1b5841){var _0x5cc671={'raw':!![],'where':{'id':_0x4f5318[_0x5b7a('0x40')]['id']}},_0x1f7987={};_0x1f7987['model']=_[_0x5b7a('0x41')](db[_0x5b7a('0x26')]['rawAttributes']);_0x1f7987[_0x5b7a('0x2c')]=_[_0x5b7a('0x41')](_0x4f5318[_0x5b7a('0x2c')]);_0x1f7987[_0x5b7a('0x2d')]=_['intersection'](_0x1f7987[_0x5b7a('0x2b')],_0x1f7987['query']);_0x5cc671[_0x5b7a('0x2f')]=_[_0x5b7a('0x2e')](_0x1f7987[_0x5b7a('0x2b')],qs[_0x5b7a('0x30')](_0x4f5318[_0x5b7a('0x2c')][_0x5b7a('0x30')]));_0x5cc671['attributes']=_0x5cc671[_0x5b7a('0x2f')][_0x5b7a('0x31')]?_0x5cc671[_0x5b7a('0x2f')]:_0x1f7987[_0x5b7a('0x2b')];if(_0x4f5318[_0x5b7a('0x2c')][_0x5b7a('0x3b')]){_0x5cc671[_0x5b7a('0x3c')]=[{'all':!![]}];}_0x5cc671=_[_0x5b7a('0x38')]({},_0x5cc671,_0x4f5318[_0x5b7a('0x3a')]);return db[_0x5b7a('0x26')]['find'](_0x5cc671)[_0x5b7a('0x22')](handleEntityNotFound(_0x1b5841,null))[_0x5b7a('0x22')](respondWithResult(_0x1b5841,null))[_0x5b7a('0x3f')](handleError(_0x1b5841,null));};exports[_0x5b7a('0x42')]=function(_0x50e98d,_0x570531){return db[_0x5b7a('0x26')][_0x5b7a('0x42')](_0x50e98d[_0x5b7a('0x43')],{})['then'](respondWithResult(_0x570531,0xc9))['catch'](handleError(_0x570531,null));};exports[_0x5b7a('0x20')]=function(_0x27cf07,_0x2408a5){if(_0x27cf07['body']['id']){delete _0x27cf07['body']['id'];}return db['SquareMessage'][_0x5b7a('0x44')]({'where':{'id':_0x27cf07['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x2408a5,null))[_0x5b7a('0x22')](saveUpdates(_0x27cf07[_0x5b7a('0x43')],null))[_0x5b7a('0x22')](respondWithResult(_0x2408a5,null))[_0x5b7a('0x3f')](handleError(_0x2408a5,null));};exports[_0x5b7a('0x21')]=function(_0x36942e,_0x167852){return db[_0x5b7a('0x26')]['find']({'where':{'id':_0x36942e['params']['id']}})[_0x5b7a('0x22')](handleEntityNotFound(_0x167852,null))[_0x5b7a('0x22')](removeEntity(_0x167852,null))['catch'](handleError(_0x167852,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index eb1cdbc..db31838 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 _0x2d9f=['exports','define','SquareMessage','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareMessage.attributes'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x2d9f,0x158));var _0xf2d9=function(_0x12a11e,_0x4c68d3){_0x12a11e=_0x12a11e-0x0;var _0x5bbd4f=_0x2d9f[_0x12a11e];return _0x5bbd4f;};'use strict';var _=require('lodash');var util=require(_0xf2d9('0x0'));var logger=require(_0xf2d9('0x1'))(_0xf2d9('0x2'));var moment=require('moment');var BPromise=require(_0xf2d9('0x3'));var rp=require(_0xf2d9('0x4'));var fs=require('fs');var path=require(_0xf2d9('0x5'));var rimraf=require(_0xf2d9('0x6'));var config=require('../../config/environment');var attributes=require(_0xf2d9('0x7'));module[_0xf2d9('0x8')]=function(_0x334d5d,_0x2533eb){return _0x334d5d[_0xf2d9('0x9')](_0xf2d9('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50df=['path','rimraf','./squareMessage.attributes','exports','define','square_messages','util','../../config/logger','api','moment','bluebird'];(function(_0x1acd0b,_0x51e8db){var _0x3e1ce0=function(_0x92785d){while(--_0x92785d){_0x1acd0b['push'](_0x1acd0b['shift']());}};_0x3e1ce0(++_0x51e8db);}(_0x50df,0x1ea));var _0xf50d=function(_0x224390,_0x1dd948){_0x224390=_0x224390-0x0;var _0x34a8db=_0x50df[_0x224390];return _0x34a8db;};'use strict';var _=require('lodash');var util=require(_0xf50d('0x0'));var logger=require(_0xf50d('0x1'))(_0xf50d('0x2'));var moment=require(_0xf50d('0x3'));var BPromise=require(_0xf50d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf50d('0x5'));var rimraf=require(_0xf50d('0x6'));var config=require('../../config/environment');var attributes=require(_0xf50d('0x7'));module[_0xf50d('0x8')]=function(_0x34b95d,_0x5472e8){return _0x34b95d[_0xf50d('0x9')]('SquareMessage',attributes,{'tableName':_0xf50d('0xa'),'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 2cd270a..78aaf96 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 _0x8369=['request\x20sent','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','info','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','jayson/promise','client','request','then','debug','SquareMessage,\x20%s,\x20%s,\x20%s'];(function(_0x189b2b,_0x4328b4){var _0x58e7c6=function(_0x1696f1){while(--_0x1696f1){_0x189b2b['push'](_0x189b2b['shift']());}};_0x58e7c6(++_0x4328b4);}(_0x8369,0x7b));var _0x9836=function(_0x5be4e6,_0x144ae6){_0x5be4e6=_0x5be4e6-0x0;var _0x5eb485=_0x8369[_0x5be4e6];return _0x5eb485;};'use strict';var _=require(_0x9836('0x0'));var util=require(_0x9836('0x1'));var moment=require(_0x9836('0x2'));var BPromise=require('bluebird');var rs=require(_0x9836('0x3'));var fs=require('fs');var Redis=require(_0x9836('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9836('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9836('0x6'));var client=jayson[_0x9836('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5320cf,_0x557e57,_0x2d5e03){return new BPromise(function(_0x421c81,_0x44ccc4){return client[_0x9836('0x8')](_0x5320cf,_0x2d5e03)[_0x9836('0x9')](function(_0x4e9770){logger['info']('SquareMessage,\x20%s,\x20%s',_0x557e57,'request\x20sent');logger[_0x9836('0xa')](_0x9836('0xb'),_0x557e57,_0x9836('0xc'),JSON[_0x9836('0xd')](_0x4e9770));if(_0x4e9770[_0x9836('0xe')]){if(_0x4e9770[_0x9836('0xe')][_0x9836('0xf')]===0x1f4){logger['error'](_0x9836('0x10'),_0x557e57,_0x4e9770[_0x9836('0xe')]['message']);return _0x44ccc4(_0x4e9770[_0x9836('0xe')][_0x9836('0x11')]);}logger[_0x9836('0xe')](_0x9836('0x10'),_0x557e57,_0x4e9770[_0x9836('0xe')][_0x9836('0x11')]);return _0x421c81(_0x4e9770[_0x9836('0xe')][_0x9836('0x11')]);}else{logger[_0x9836('0x12')](_0x9836('0x10'),_0x557e57,'request\x20sent');_0x421c81(_0x4e9770[_0x9836('0x13')][_0x9836('0x11')]);}})[_0x9836('0x14')](function(_0x328c50){logger[_0x9836('0xe')]('SquareMessage,\x20%s,\x20%s',_0x557e57,_0x328c50);_0x44ccc4(_0x328c50);});});}exports[_0x9836('0x15')]=function(_0x145d81){var _0x40402c=this;return new Promise(function(_0x29f6c2,_0x3f3e3d){return db[_0x9836('0x16')][_0x9836('0x17')](_0x145d81[_0x9836('0x18')],{'raw':_0x145d81[_0x9836('0x19')]?_0x145d81[_0x9836('0x19')][_0x9836('0x1a')]===undefined?!![]:![]:!![]})[_0x9836('0x9')](function(_0x4c062a){logger[_0x9836('0x12')](_0x9836('0x15'),_0x145d81);logger['debug'](_0x9836('0x15'),_0x145d81,JSON[_0x9836('0xd')](_0x4c062a));_0x29f6c2(_0x4c062a);})[_0x9836('0x14')](function(_0x47cab3){logger[_0x9836('0xe')](_0x9836('0x15'),_0x47cab3[_0x9836('0x11')],_0x145d81);_0x3f3e3d(_0x40402c[_0x9836('0xe')](0x1f4,_0x47cab3['message']));});});}; \ No newline at end of file +var _0x5e74=['options','raw','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareMessage','SquareMessage','create'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5e74,0x1bc));var _0x45e7=function(_0x27fb2f,_0x511fd6){_0x27fb2f=_0x27fb2f-0x0;var _0x3165b8=_0x5e74[_0x27fb2f];return _0x3165b8;};'use strict';var _=require(_0x45e7('0x0'));var util=require(_0x45e7('0x1'));var moment=require(_0x45e7('0x2'));var BPromise=require('bluebird');var rs=require(_0x45e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45e7('0x4'))['db'];var utils=require(_0x45e7('0x5'));var logger=require('../../config/logger')(_0x45e7('0x6'));var config=require(_0x45e7('0x7'));var jayson=require(_0x45e7('0x8'));var client=jayson[_0x45e7('0x9')][_0x45e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31858b,_0x119d37,_0x539088){return new BPromise(function(_0x20c455,_0x5f07ca){return client['request'](_0x31858b,_0x539088)['then'](function(_0x5831f3){logger[_0x45e7('0xb')](_0x45e7('0xc'),_0x119d37,_0x45e7('0xd'));logger[_0x45e7('0xe')](_0x45e7('0xf'),_0x119d37,_0x45e7('0xd'),JSON[_0x45e7('0x10')](_0x5831f3));if(_0x5831f3[_0x45e7('0x11')]){if(_0x5831f3['error'][_0x45e7('0x12')]===0x1f4){logger[_0x45e7('0x11')](_0x45e7('0xc'),_0x119d37,_0x5831f3['error'][_0x45e7('0x13')]);return _0x5f07ca(_0x5831f3[_0x45e7('0x11')][_0x45e7('0x13')]);}logger[_0x45e7('0x11')](_0x45e7('0xc'),_0x119d37,_0x5831f3[_0x45e7('0x11')]['message']);return _0x20c455(_0x5831f3[_0x45e7('0x11')][_0x45e7('0x13')]);}else{logger[_0x45e7('0xb')](_0x45e7('0xc'),_0x119d37,_0x45e7('0xd'));_0x20c455(_0x5831f3['result'][_0x45e7('0x13')]);}})[_0x45e7('0x14')](function(_0x10b3fa){logger[_0x45e7('0x11')](_0x45e7('0xc'),_0x119d37,_0x10b3fa);_0x5f07ca(_0x10b3fa);});});}exports[_0x45e7('0x15')]=function(_0x3ba587){var _0x55c949=this;return new Promise(function(_0x49f2fb,_0x187691){return db[_0x45e7('0x16')][_0x45e7('0x17')](_0x3ba587['body'],{'raw':_0x3ba587['options']?_0x3ba587[_0x45e7('0x18')][_0x45e7('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3b39ba){logger[_0x45e7('0xb')](_0x45e7('0x15'),_0x3ba587);logger[_0x45e7('0xe')](_0x45e7('0x15'),_0x3ba587,JSON['stringify'](_0x3b39ba));_0x49f2fb(_0x3b39ba);})[_0x45e7('0x14')](function(_0x344a70){logger[_0x45e7('0x11')]('CreateSquareMessage',_0x344a70['message'],_0x3ba587);_0x187691(_0x55c949[_0x45e7('0x11')](0x1f4,_0x344a70[_0x45e7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a4b859d..babf1f0 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 _0x9754=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x422a9d,_0x3312ae){var _0xd9add3=function(_0x529000){while(--_0x529000){_0x422a9d['push'](_0x422a9d['shift']());}};_0xd9add3(++_0x3312ae);}(_0x9754,0x1dc));var _0x4975=function(_0x18419e,_0x120121){_0x18419e=_0x18419e-0x0;var _0x620110=_0x9754[_0x18419e];return _0x620110;};'use strict';var multer=require(_0x4975('0x0'));var util=require(_0x4975('0x1'));var path=require(_0x4975('0x2'));var timeout=require(_0x4975('0x3'));var express=require(_0x4975('0x4'));var router=express[_0x4975('0x5')]();var fs_extra=require(_0x4975('0x6'));var auth=require(_0x4975('0x7'));var interaction=require(_0x4975('0x8'));var config=require(_0x4975('0x9'));var controller=require(_0x4975('0xa'));router[_0x4975('0xb')]('/',auth[_0x4975('0xc')](),controller[_0x4975('0xd')]);router[_0x4975('0xb')](_0x4975('0xe'),auth['isAuthenticated'](),controller[_0x4975('0xf')]);router['get'](_0x4975('0x10'),auth['isAuthenticated'](),timeout(_0x4975('0x11')),controller[_0x4975('0x12')]);router[_0x4975('0x13')]('/',auth[_0x4975('0xc')](),controller[_0x4975('0x14')]);router['put'](_0x4975('0xe'),auth[_0x4975('0xc')](),controller[_0x4975('0x15')]);router[_0x4975('0x16')](_0x4975('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4975('0x17')]=router; \ No newline at end of file +var _0x289d=['15s','test','post','create','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x4260c1,_0x1b60e1){var _0x2fb592=function(_0x4a6c84){while(--_0x4a6c84){_0x4260c1['push'](_0x4260c1['shift']());}};_0x2fb592(++_0x1b60e1);}(_0x289d,0x16e));var _0xd289=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x289d[_0x37c22c];return _0x119d79;};'use strict';var multer=require(_0xd289('0x0'));var util=require(_0xd289('0x1'));var path=require(_0xd289('0x2'));var timeout=require(_0xd289('0x3'));var express=require(_0xd289('0x4'));var router=express[_0xd289('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd289('0x6'));var interaction=require(_0xd289('0x7'));var config=require(_0xd289('0x8'));var controller=require('./squareOdbc.controller');router[_0xd289('0x9')]('/',auth[_0xd289('0xa')](),controller[_0xd289('0xb')]);router[_0xd289('0x9')](_0xd289('0xc'),auth[_0xd289('0xa')](),controller[_0xd289('0xd')]);router[_0xd289('0x9')]('/:id/test',auth['isAuthenticated'](),timeout(_0xd289('0xe')),controller[_0xd289('0xf')]);router[_0xd289('0x10')]('/',auth[_0xd289('0xa')](),controller[_0xd289('0x11')]);router['put'](_0xd289('0xc'),auth['isAuthenticated'](),controller[_0xd289('0x12')]);router['delete'](_0xd289('0xc'),auth[_0xd289('0xa')](),controller['destroy']);module[_0xd289('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 651be02..18356ae 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 _0xbbd3=['exports','name','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbbd3,0x17c));var _0x3bbd=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xbbd3[_0x5f09c5];return _0x426ad9;};'use strict';var Sequelize=require(_0x3bbd('0x0'));module[_0x3bbd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3bbd('0x2'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe321=['sequelize','exports','STRING','name'];(function(_0x381864,_0x3c770e){var _0x5372f4=function(_0x552193){while(--_0x552193){_0x381864['push'](_0x381864['shift']());}};_0x5372f4(++_0x3c770e);}(_0xe321,0x1d8));var _0x1e32=function(_0x522c30,_0x55d91c){_0x522c30=_0x522c30-0x0;var _0x10f547=_0xe321[_0x522c30];return _0x10f547;};'use strict';var Sequelize=require(_0x1e32('0x0'));module[_0x1e32('0x1')]={'name':{'type':Sequelize[_0x1e32('0x2')],'unique':_0x1e32('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x1e32('0x2')]},'description':{'type':Sequelize[_0x1e32('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 608229b..7e2997b 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 _0xd3fe=['autoAssociation','error','test','dsn','openSync','closeSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','update','then','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','SquareOdbc','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xd3fe,0x172));var _0xed3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd3fe[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed3f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed3f('0x1'));var rp=require(_0xed3f('0x2'));var moment=require(_0xed3f('0x3'));var BPromise=require(_0xed3f('0x4'));var Mustache=require(_0xed3f('0x5'));var util=require('util');var path=require(_0xed3f('0x6'));var sox=require(_0xed3f('0x7'));var csv=require(_0xed3f('0x8'));var ejs=require(_0xed3f('0x9'));var fs=require('fs');var fs_extra=require(_0xed3f('0xa'));var _=require(_0xed3f('0xb'));var squel=require(_0xed3f('0xc'));var crypto=require('crypto');var jsforce=require(_0xed3f('0xd'));var deskjs=require(_0xed3f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xed3f('0xf'));var Papa=require(_0xed3f('0x10'));var Redis=require(_0xed3f('0x11'));var authService=require(_0xed3f('0x12'));var qs=require(_0xed3f('0x13'));var as=require(_0xed3f('0x14'));var hardwareService=require(_0xed3f('0x15'));var logger=require(_0xed3f('0x16'))('api');var utils=require(_0xed3f('0x17'));var config=require(_0xed3f('0x18'));var licenseUtil=require(_0xed3f('0x19'));var db=require(_0xed3f('0x1a'))['db'];function respondWithStatusCode(_0x4af020,_0x4dcda5){_0x4dcda5=_0x4dcda5||0xcc;return function(_0x51b5d8){if(_0x51b5d8){return _0x4af020[_0xed3f('0x1b')](_0x4dcda5);}return _0x4af020[_0xed3f('0x1c')](_0x4dcda5)[_0xed3f('0x1d')]();};}function respondWithResult(_0x3410ec,_0x57484e){_0x57484e=_0x57484e||0xc8;return function(_0x116f46){if(_0x116f46){return _0x3410ec[_0xed3f('0x1c')](_0x57484e)['json'](_0x116f46);}};}function respondWithFilteredResult(_0x409622,_0x412314){return function(_0x3cfc0a){if(_0x3cfc0a){var _0x43c4a8=typeof _0x412314[_0xed3f('0x1e')]===_0xed3f('0x1f')&&typeof _0x412314['limit']===_0xed3f('0x1f');var _0x2833e8=_0x3cfc0a[_0xed3f('0x20')];var _0x4b0c41=_0x43c4a8?0x0:_0x412314[_0xed3f('0x1e')];var _0x3349ab=_0x43c4a8?_0x3cfc0a[_0xed3f('0x20')]:_0x412314[_0xed3f('0x1e')]+_0x412314[_0xed3f('0x21')];var _0x62fb5c;if(_0x3349ab>=_0x2833e8){_0x3349ab=_0x2833e8;_0x62fb5c=0xc8;}else{_0x62fb5c=0xce;}_0x409622['status'](_0x62fb5c);return _0x409622[_0xed3f('0x22')]('Content-Range',_0x4b0c41+'-'+_0x3349ab+'/'+_0x2833e8)['json'](_0x3cfc0a);}return null;};}function patchUpdates(_0x48aab5){return function(_0x26815b){try{jsonpatch[_0xed3f('0x23')](_0x26815b,_0x48aab5,!![]);}catch(_0x237a8a){return BPromise[_0xed3f('0x24')](_0x237a8a);}return _0x26815b[_0xed3f('0x25')]();};}function saveUpdates(_0x19811f,_0x5df114){return function(_0x493a5e){if(_0x493a5e){return _0x493a5e[_0xed3f('0x26')](_0x19811f)[_0xed3f('0x27')](function(_0x46fc09){return _0x46fc09;});}return null;};}function removeEntity(_0x38ba62,_0x3b92f5){return function(_0x5d5937){if(_0x5d5937){return _0x5d5937['destroy']()[_0xed3f('0x27')](function(){var _0x1041e2=_0x5d5937['get']({'plain':!![]});var _0x4fefec='ODBC';return db[_0xed3f('0x28')][_0xed3f('0x29')]({'where':{'type':_0x4fefec,'resourceId':_0x1041e2['id']}})[_0xed3f('0x27')](function(){return _0x5d5937;});})[_0xed3f('0x27')](function(){_0x38ba62[_0xed3f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216dec,_0x143677){return function(_0x158802){if(!_0x158802){_0x216dec[_0xed3f('0x1b')](0x194);}return _0x158802;};}function handleError(_0x29d2ac,_0x59af58){_0x59af58=_0x59af58||0x1f4;return function(_0xbc3200){logger['error'](_0xbc3200[_0xed3f('0x2a')]);if(_0xbc3200[_0xed3f('0x2b')]){delete _0xbc3200[_0xed3f('0x2b')];}_0x29d2ac[_0xed3f('0x1c')](_0x59af58)[_0xed3f('0x2c')](_0xbc3200);};}exports[_0xed3f('0x2d')]=function(_0xa6d95d,_0x476cbf){var _0x205055={},_0x34021b={},_0x4ef659={'count':0x0,'rows':[]};var _0x403fb5=_['map'](db['SquareOdbc'][_0xed3f('0x2e')],function(_0x28a5fc){return{'name':_0x28a5fc[_0xed3f('0x2f')],'type':_0x28a5fc[_0xed3f('0x30')][_0xed3f('0x31')]};});_0x34021b[_0xed3f('0x32')]=_[_0xed3f('0x33')](_0x403fb5,_0xed3f('0x2b'));_0x34021b[_0xed3f('0x34')]=_['keys'](_0xa6d95d[_0xed3f('0x34')]);_0x34021b[_0xed3f('0x35')]=_[_0xed3f('0x36')](_0x34021b['model'],_0x34021b[_0xed3f('0x34')]);_0x205055[_0xed3f('0x37')]=_[_0xed3f('0x36')](_0x34021b['model'],qs[_0xed3f('0x38')](_0xa6d95d['query'][_0xed3f('0x38')]));_0x205055[_0xed3f('0x37')]=_0x205055[_0xed3f('0x37')][_0xed3f('0x39')]?_0x205055[_0xed3f('0x37')]:_0x34021b[_0xed3f('0x32')];if(!_0xa6d95d['query'][_0xed3f('0x3a')]('nolimit')){_0x205055[_0xed3f('0x21')]=qs['limit'](_0xa6d95d[_0xed3f('0x34')]['limit']);_0x205055[_0xed3f('0x1e')]=qs[_0xed3f('0x1e')](_0xa6d95d[_0xed3f('0x34')][_0xed3f('0x1e')]);}_0x205055[_0xed3f('0x3b')]=qs[_0xed3f('0x3c')](_0xa6d95d[_0xed3f('0x34')][_0xed3f('0x3c')]);_0x205055[_0xed3f('0x3d')]=qs[_0xed3f('0x35')](_[_0xed3f('0x3e')](_0xa6d95d[_0xed3f('0x34')],_0x34021b[_0xed3f('0x35')]),_0x403fb5);if(_0xa6d95d[_0xed3f('0x34')][_0xed3f('0x3f')]){_0x205055[_0xed3f('0x3d')]=_['merge'](_0x205055[_0xed3f('0x3d')],{'$or':_[_0xed3f('0x33')](_0x403fb5,function(_0x2ec917){if(_0x2ec917['type']!==_0xed3f('0x40')){var _0x359701={};_0x359701[_0x2ec917['name']]={'$like':'%'+_0xa6d95d[_0xed3f('0x34')][_0xed3f('0x3f')]+'%'};return _0x359701;}})});}_0x205055=_[_0xed3f('0x41')]({},_0x205055,_0xa6d95d['options']);var _0x37c0cc={'where':_0x205055[_0xed3f('0x3d')]};return db[_0xed3f('0x42')][_0xed3f('0x20')](_0x37c0cc)[_0xed3f('0x27')](function(_0x140e54){_0x4ef659[_0xed3f('0x20')]=_0x140e54;if(_0xa6d95d[_0xed3f('0x34')]['includeAll']){_0x205055[_0xed3f('0x43')]=[{'all':!![]}];}return db[_0xed3f('0x42')][_0xed3f('0x44')](_0x205055);})[_0xed3f('0x27')](function(_0x69a872){_0x4ef659[_0xed3f('0x45')]=_0x69a872;return _0x4ef659;})['then'](respondWithFilteredResult(_0x476cbf,_0x205055))[_0xed3f('0x46')](handleError(_0x476cbf,null));};exports[_0xed3f('0x47')]=function(_0x50dea3,_0x299960){var _0x1a4d54={'raw':!![],'where':{'id':_0x50dea3[_0xed3f('0x48')]['id']}},_0x25dd04={};_0x25dd04[_0xed3f('0x32')]=_[_0xed3f('0x49')](db[_0xed3f('0x42')][_0xed3f('0x2e')]);_0x25dd04[_0xed3f('0x34')]=_[_0xed3f('0x49')](_0x50dea3[_0xed3f('0x34')]);_0x25dd04[_0xed3f('0x35')]=_[_0xed3f('0x36')](_0x25dd04['model'],_0x25dd04[_0xed3f('0x34')]);_0x1a4d54[_0xed3f('0x37')]=_['intersection'](_0x25dd04[_0xed3f('0x32')],qs[_0xed3f('0x38')](_0x50dea3[_0xed3f('0x34')][_0xed3f('0x38')]));_0x1a4d54['attributes']=_0x1a4d54[_0xed3f('0x37')][_0xed3f('0x39')]?_0x1a4d54[_0xed3f('0x37')]:_0x25dd04[_0xed3f('0x32')];if(_0x50dea3[_0xed3f('0x34')][_0xed3f('0x4a')]){_0x1a4d54[_0xed3f('0x43')]=[{'all':!![]}];}_0x1a4d54=_['merge']({},_0x1a4d54,_0x50dea3['options']);return db[_0xed3f('0x42')][_0xed3f('0x4b')](_0x1a4d54)[_0xed3f('0x27')](handleEntityNotFound(_0x299960,null))[_0xed3f('0x27')](respondWithResult(_0x299960,null))[_0xed3f('0x46')](handleError(_0x299960,null));};exports[_0xed3f('0x4c')]=function(_0xfad5f4,_0xde9d0){return db[_0xed3f('0x42')][_0xed3f('0x4c')](_0xfad5f4[_0xed3f('0x4d')],{})[_0xed3f('0x27')](function(_0x8769aa){var _0x5b91c3=_0xfad5f4[_0xed3f('0x4e')][_0xed3f('0x4f')]({'plain':!![]});if(!_0x5b91c3)throw new Error(_0xed3f('0x50'));if(_0x5b91c3[_0xed3f('0x51')]===_0xed3f('0x4e')){var _0x2f9a7d=_0x8769aa[_0xed3f('0x4f')]({'plain':!![]});var _0x1d3951=_0xed3f('0x52');return db[_0xed3f('0x53')]['find']({'where':{'name':_0x1d3951,'userProfileId':_0x5b91c3[_0xed3f('0x54')]},'raw':!![]})['then'](function(_0x510308){if(_0x510308&&_0x510308[_0xed3f('0x55')]===0x0){return db[_0xed3f('0x28')]['create']({'name':_0x2f9a7d[_0xed3f('0x2b')],'resourceId':_0x2f9a7d['id'],'type':_0x510308[_0xed3f('0x2b')],'sectionId':_0x510308['id']},{})[_0xed3f('0x27')](function(){return _0x8769aa;});}else{return _0x8769aa;}})['catch'](function(_0x496798){logger[_0xed3f('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x496798);throw _0x496798;});}return _0x8769aa;})[_0xed3f('0x27')](respondWithResult(_0xde9d0,0xc9))[_0xed3f('0x46')](handleError(_0xde9d0,null));};exports[_0xed3f('0x26')]=function(_0x1e4674,_0x465b85){if(_0x1e4674[_0xed3f('0x4d')]['id']){delete _0x1e4674[_0xed3f('0x4d')]['id'];}return db['SquareOdbc']['find']({'where':{'id':_0x1e4674['params']['id']}})[_0xed3f('0x27')](handleEntityNotFound(_0x465b85,null))[_0xed3f('0x27')](saveUpdates(_0x1e4674[_0xed3f('0x4d')],null))[_0xed3f('0x27')](respondWithResult(_0x465b85,null))[_0xed3f('0x46')](handleError(_0x465b85,null));};exports[_0xed3f('0x29')]=function(_0x24810b,_0x3041f8){return db[_0xed3f('0x42')][_0xed3f('0x4b')]({'where':{'id':_0x24810b[_0xed3f('0x48')]['id']}})['then'](handleEntityNotFound(_0x3041f8,null))[_0xed3f('0x27')](removeEntity(_0x3041f8,null))[_0xed3f('0x46')](handleError(_0x3041f8,null));};exports[_0xed3f('0x57')]=function(_0x5c4603,_0x23308f,_0x2f4c58){var _0x1abdc0;return db['SquareOdbc'][_0xed3f('0x4b')]({'where':{'id':_0x5c4603[_0xed3f('0x48')]['id']},'attributes':['id',_0xed3f('0x58')]})[_0xed3f('0x27')](handleEntityNotFound(_0x23308f,null))[_0xed3f('0x27')](function(_0x2b1c3c){if(_0x2b1c3c){var _0x1c2e93=require('odbc')();_0x1c2e93[_0xed3f('0x59')](_0x2b1c3c[_0xed3f('0x58')]);_0x1c2e93[_0xed3f('0x5a')]();return _0x2b1c3c;}})['then'](respondWithResult(_0x23308f,null))[_0xed3f('0x46')](handleError(_0x23308f,null));}; \ No newline at end of file +var _0xca62=['SquareOdbc','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map'];(function(_0x470cdd,_0x4708cd){var _0x57fda7=function(_0x171462){while(--_0x171462){_0x470cdd['push'](_0x470cdd['shift']());}};_0x57fda7(++_0x4708cd);}(_0xca62,0x1d8));var _0x2ca6=function(_0x2e4f3c,_0x51485f){_0x2e4f3c=_0x2e4f3c-0x0;var _0x4e4f2a=_0xca62[_0x2e4f3c];return _0x4e4f2a;};'use strict';var emlformat=require(_0x2ca6('0x0'));var rimraf=require(_0x2ca6('0x1'));var zipdir=require(_0x2ca6('0x2'));var jsonpatch=require(_0x2ca6('0x3'));var rp=require(_0x2ca6('0x4'));var moment=require(_0x2ca6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2ca6('0x6'));var path=require(_0x2ca6('0x7'));var sox=require('sox');var csv=require(_0x2ca6('0x8'));var ejs=require(_0x2ca6('0x9'));var fs=require('fs');var fs_extra=require(_0x2ca6('0xa'));var _=require(_0x2ca6('0xb'));var squel=require(_0x2ca6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2ca6('0x8'));var querystring=require('querystring');var Papa=require(_0x2ca6('0xd'));var Redis=require('ioredis');var authService=require(_0x2ca6('0xe'));var qs=require(_0x2ca6('0xf'));var as=require(_0x2ca6('0x10'));var hardwareService=require(_0x2ca6('0x11'));var logger=require('../../config/logger')(_0x2ca6('0x12'));var utils=require(_0x2ca6('0x13'));var config=require(_0x2ca6('0x14'));var licenseUtil=require(_0x2ca6('0x15'));var db=require(_0x2ca6('0x16'))['db'];function respondWithStatusCode(_0x28983f,_0x20df86){_0x20df86=_0x20df86||0xcc;return function(_0x3e26f4){if(_0x3e26f4){return _0x28983f['sendStatus'](_0x20df86);}return _0x28983f['status'](_0x20df86)['end']();};}function respondWithResult(_0x4bdcbd,_0x370724){_0x370724=_0x370724||0xc8;return function(_0x1f203a){if(_0x1f203a){return _0x4bdcbd[_0x2ca6('0x17')](_0x370724)['json'](_0x1f203a);}};}function respondWithFilteredResult(_0x35f837,_0x5c5922){return function(_0xec07be){if(_0xec07be){var _0x1637e0=typeof _0x5c5922['offset']===_0x2ca6('0x18')&&typeof _0x5c5922[_0x2ca6('0x19')]===_0x2ca6('0x18');var _0x24e22f=_0xec07be[_0x2ca6('0x1a')];var _0x4be586=_0x1637e0?0x0:_0x5c5922[_0x2ca6('0x1b')];var _0x1645bd=_0x1637e0?_0xec07be[_0x2ca6('0x1a')]:_0x5c5922[_0x2ca6('0x1b')]+_0x5c5922[_0x2ca6('0x19')];var _0x8ddc7c;if(_0x1645bd>=_0x24e22f){_0x1645bd=_0x24e22f;_0x8ddc7c=0xc8;}else{_0x8ddc7c=0xce;}_0x35f837[_0x2ca6('0x17')](_0x8ddc7c);return _0x35f837[_0x2ca6('0x1c')](_0x2ca6('0x1d'),_0x4be586+'-'+_0x1645bd+'/'+_0x24e22f)[_0x2ca6('0x1e')](_0xec07be);}return null;};}function patchUpdates(_0x327405){return function(_0x5f262f){try{jsonpatch[_0x2ca6('0x1f')](_0x5f262f,_0x327405,!![]);}catch(_0xc208de){return BPromise[_0x2ca6('0x20')](_0xc208de);}return _0x5f262f['save']();};}function saveUpdates(_0x2ee841,_0x3b30f0){return function(_0x116535){if(_0x116535){return _0x116535['update'](_0x2ee841)[_0x2ca6('0x21')](function(_0x56217c){return _0x56217c;});}return null;};}function removeEntity(_0x2dac7b,_0x5311fc){return function(_0x3a9a51){if(_0x3a9a51){return _0x3a9a51[_0x2ca6('0x22')]()[_0x2ca6('0x21')](function(){var _0x45f7dd=_0x3a9a51[_0x2ca6('0x23')]({'plain':!![]});var _0x480f8b='ODBC';return db[_0x2ca6('0x24')][_0x2ca6('0x22')]({'where':{'type':_0x480f8b,'resourceId':_0x45f7dd['id']}})['then'](function(){return _0x3a9a51;});})[_0x2ca6('0x21')](function(){_0x2dac7b[_0x2ca6('0x17')](0xcc)[_0x2ca6('0x25')]();});}};}function handleEntityNotFound(_0xb6d5a1,_0x523be6){return function(_0x5b6a8b){if(!_0x5b6a8b){_0xb6d5a1['sendStatus'](0x194);}return _0x5b6a8b;};}function handleError(_0x4eefe0,_0x247b60){_0x247b60=_0x247b60||0x1f4;return function(_0x399eaf){logger[_0x2ca6('0x26')](_0x399eaf[_0x2ca6('0x27')]);if(_0x399eaf['name']){delete _0x399eaf[_0x2ca6('0x28')];}_0x4eefe0['status'](_0x247b60)[_0x2ca6('0x29')](_0x399eaf);};}exports[_0x2ca6('0x2a')]=function(_0x153d50,_0x52f9d4){var _0x5c4a76={},_0x3279a0={},_0x941011={'count':0x0,'rows':[]};var _0x3252c0=_[_0x2ca6('0x2b')](db[_0x2ca6('0x2c')][_0x2ca6('0x2d')],function(_0x5f5890){return{'name':_0x5f5890[_0x2ca6('0x2e')],'type':_0x5f5890[_0x2ca6('0x2f')][_0x2ca6('0x30')]};});_0x3279a0[_0x2ca6('0x31')]=_[_0x2ca6('0x2b')](_0x3252c0,_0x2ca6('0x28'));_0x3279a0[_0x2ca6('0x32')]=_[_0x2ca6('0x33')](_0x153d50[_0x2ca6('0x32')]);_0x3279a0[_0x2ca6('0x34')]=_[_0x2ca6('0x35')](_0x3279a0['model'],_0x3279a0['query']);_0x5c4a76[_0x2ca6('0x36')]=_[_0x2ca6('0x35')](_0x3279a0[_0x2ca6('0x31')],qs['fields'](_0x153d50['query'][_0x2ca6('0x37')]));_0x5c4a76['attributes']=_0x5c4a76['attributes'][_0x2ca6('0x38')]?_0x5c4a76[_0x2ca6('0x36')]:_0x3279a0['model'];if(!_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x39')](_0x2ca6('0x3a'))){_0x5c4a76[_0x2ca6('0x19')]=qs[_0x2ca6('0x19')](_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x19')]);_0x5c4a76[_0x2ca6('0x1b')]=qs[_0x2ca6('0x1b')](_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x1b')]);}_0x5c4a76[_0x2ca6('0x3b')]=qs[_0x2ca6('0x3c')](_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x3c')]);_0x5c4a76[_0x2ca6('0x3d')]=qs[_0x2ca6('0x34')](_[_0x2ca6('0x3e')](_0x153d50[_0x2ca6('0x32')],_0x3279a0[_0x2ca6('0x34')]),_0x3252c0);if(_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x3f')]){_0x5c4a76[_0x2ca6('0x3d')]=_[_0x2ca6('0x40')](_0x5c4a76[_0x2ca6('0x3d')],{'$or':_[_0x2ca6('0x2b')](_0x3252c0,function(_0x1a25c3){if(_0x1a25c3[_0x2ca6('0x2f')]!==_0x2ca6('0x41')){var _0x13bbdf={};_0x13bbdf[_0x1a25c3[_0x2ca6('0x28')]]={'$like':'%'+_0x153d50[_0x2ca6('0x32')][_0x2ca6('0x3f')]+'%'};return _0x13bbdf;}})});}_0x5c4a76=_[_0x2ca6('0x40')]({},_0x5c4a76,_0x153d50['options']);var _0x6531c0={'where':_0x5c4a76[_0x2ca6('0x3d')]};return db[_0x2ca6('0x2c')][_0x2ca6('0x1a')](_0x6531c0)[_0x2ca6('0x21')](function(_0x3627f9){_0x941011[_0x2ca6('0x1a')]=_0x3627f9;if(_0x153d50[_0x2ca6('0x32')]['includeAll']){_0x5c4a76[_0x2ca6('0x42')]=[{'all':!![]}];}return db[_0x2ca6('0x2c')][_0x2ca6('0x43')](_0x5c4a76);})['then'](function(_0x58942b){_0x941011['rows']=_0x58942b;return _0x941011;})[_0x2ca6('0x21')](respondWithFilteredResult(_0x52f9d4,_0x5c4a76))[_0x2ca6('0x44')](handleError(_0x52f9d4,null));};exports[_0x2ca6('0x45')]=function(_0x558e4c,_0x31a896){var _0x104d46={'raw':!![],'where':{'id':_0x558e4c[_0x2ca6('0x46')]['id']}},_0x1108e0={};_0x1108e0[_0x2ca6('0x31')]=_[_0x2ca6('0x33')](db[_0x2ca6('0x2c')][_0x2ca6('0x2d')]);_0x1108e0[_0x2ca6('0x32')]=_['keys'](_0x558e4c[_0x2ca6('0x32')]);_0x1108e0['filters']=_[_0x2ca6('0x35')](_0x1108e0[_0x2ca6('0x31')],_0x1108e0['query']);_0x104d46[_0x2ca6('0x36')]=_[_0x2ca6('0x35')](_0x1108e0[_0x2ca6('0x31')],qs[_0x2ca6('0x37')](_0x558e4c['query'][_0x2ca6('0x37')]));_0x104d46['attributes']=_0x104d46[_0x2ca6('0x36')]['length']?_0x104d46['attributes']:_0x1108e0[_0x2ca6('0x31')];if(_0x558e4c['query']['includeAll']){_0x104d46['include']=[{'all':!![]}];}_0x104d46=_[_0x2ca6('0x40')]({},_0x104d46,_0x558e4c['options']);return db['SquareOdbc'][_0x2ca6('0x47')](_0x104d46)[_0x2ca6('0x21')](handleEntityNotFound(_0x31a896,null))[_0x2ca6('0x21')](respondWithResult(_0x31a896,null))[_0x2ca6('0x44')](handleError(_0x31a896,null));};exports[_0x2ca6('0x48')]=function(_0x564cf2,_0x7620ee){return db['SquareOdbc'][_0x2ca6('0x48')](_0x564cf2[_0x2ca6('0x49')],{})[_0x2ca6('0x21')](function(_0x431bdf){var _0x41ef53=_0x564cf2[_0x2ca6('0x4a')][_0x2ca6('0x23')]({'plain':!![]});if(!_0x41ef53)throw new Error(_0x2ca6('0x4b'));if(_0x41ef53[_0x2ca6('0x4c')]===_0x2ca6('0x4a')){var _0xe72305=_0x431bdf['get']({'plain':!![]});var _0x475c0e=_0x2ca6('0x4d');return db[_0x2ca6('0x4e')][_0x2ca6('0x47')]({'where':{'name':_0x475c0e,'userProfileId':_0x41ef53[_0x2ca6('0x4f')]},'raw':!![]})[_0x2ca6('0x21')](function(_0x3b7a9f){if(_0x3b7a9f&&_0x3b7a9f['autoAssociation']===0x0){return db[_0x2ca6('0x24')][_0x2ca6('0x48')]({'name':_0xe72305['name'],'resourceId':_0xe72305['id'],'type':_0x3b7a9f['name'],'sectionId':_0x3b7a9f['id']},{})[_0x2ca6('0x21')](function(){return _0x431bdf;});}else{return _0x431bdf;}})[_0x2ca6('0x44')](function(_0x44f532){logger[_0x2ca6('0x26')](_0x2ca6('0x50'),_0x44f532);throw _0x44f532;});}return _0x431bdf;})['then'](respondWithResult(_0x7620ee,0xc9))['catch'](handleError(_0x7620ee,null));};exports['update']=function(_0x33b326,_0x43a7e7){if(_0x33b326[_0x2ca6('0x49')]['id']){delete _0x33b326[_0x2ca6('0x49')]['id'];}return db[_0x2ca6('0x2c')]['find']({'where':{'id':_0x33b326[_0x2ca6('0x46')]['id']}})[_0x2ca6('0x21')](handleEntityNotFound(_0x43a7e7,null))[_0x2ca6('0x21')](saveUpdates(_0x33b326['body'],null))[_0x2ca6('0x21')](respondWithResult(_0x43a7e7,null))[_0x2ca6('0x44')](handleError(_0x43a7e7,null));};exports['destroy']=function(_0x1fbf86,_0x5ab427){return db[_0x2ca6('0x2c')][_0x2ca6('0x47')]({'where':{'id':_0x1fbf86[_0x2ca6('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ab427,null))[_0x2ca6('0x21')](removeEntity(_0x5ab427,null))[_0x2ca6('0x44')](handleError(_0x5ab427,null));};exports[_0x2ca6('0x51')]=function(_0xe628b1,_0x4b8231,_0x1b0dd9){var _0x4a0ace;return db['SquareOdbc'][_0x2ca6('0x47')]({'where':{'id':_0xe628b1[_0x2ca6('0x46')]['id']},'attributes':['id',_0x2ca6('0x52')]})[_0x2ca6('0x21')](handleEntityNotFound(_0x4b8231,null))[_0x2ca6('0x21')](function(_0x49cf75){if(_0x49cf75){var _0x2c9b52=require(_0x2ca6('0x53'))();_0x2c9b52[_0x2ca6('0x54')](_0x49cf75['dsn']);_0x2c9b52[_0x2ca6('0x55')]();return _0x49cf75;}})[_0x2ca6('0x21')](respondWithResult(_0x4b8231,null))[_0x2ca6('0x44')](handleError(_0x4b8231,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8cd7082..82fc1dd 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 _0x5793=['SquareOdbc','square_odbc','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0x18c6e6,_0x50b801){var _0x253a9d=function(_0x287413){while(--_0x287413){_0x18c6e6['push'](_0x18c6e6['shift']());}};_0x253a9d(++_0x50b801);}(_0x5793,0xf9));var _0x3579=function(_0xe45043,_0xbbae5d){_0xe45043=_0xe45043-0x0;var _0x4c69e9=_0x5793[_0xe45043];return _0x4c69e9;};'use strict';var _=require(_0x3579('0x0'));var util=require(_0x3579('0x1'));var logger=require(_0x3579('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3579('0x3'));var rp=require(_0x3579('0x4'));var fs=require('fs');var path=require(_0x3579('0x5'));var rimraf=require(_0x3579('0x6'));var config=require(_0x3579('0x7'));var attributes=require(_0x3579('0x8'));module[_0x3579('0x9')]=function(_0x163aaa,_0x214e24){return _0x163aaa[_0x3579('0xa')](_0x3579('0xb'),attributes,{'tableName':_0x3579('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0266=['util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc'];(function(_0xe2ebaa,_0x138483){var _0x563838=function(_0x542a4c){while(--_0x542a4c){_0xe2ebaa['push'](_0xe2ebaa['shift']());}};_0x563838(++_0x138483);}(_0x0266,0x1ea));var _0x6026=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0266[_0x1b2ff7];return _0x31656a;};'use strict';var _=require('lodash');var util=require(_0x6026('0x0'));var logger=require(_0x6026('0x1'))(_0x6026('0x2'));var moment=require('moment');var BPromise=require(_0x6026('0x3'));var rp=require(_0x6026('0x4'));var fs=require('fs');var path=require(_0x6026('0x5'));var rimraf=require('rimraf');var config=require(_0x6026('0x6'));var attributes=require(_0x6026('0x7'));module[_0x6026('0x8')]=function(_0x5a54de,_0x21151f){return _0x5a54de['define'](_0x6026('0x9'),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 0cd45b4..ea89494 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 _0x1186=['../../config/environment','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x1186,0x1bb));var _0x6118=function(_0x589e8c,_0x1842d9){_0x589e8c=_0x589e8c-0x0;var _0x449357=_0x1186[_0x589e8c];return _0x449357;};'use strict';var _=require(_0x6118('0x0'));var util=require(_0x6118('0x1'));var moment=require(_0x6118('0x2'));var BPromise=require(_0x6118('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6118('0x4'));var db=require(_0x6118('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6118('0x6'));var config=require(_0x6118('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6118('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4421e5,_0x122a9e,_0x127d49){return new BPromise(function(_0x376c29,_0x54b6c1){return client[_0x6118('0x9')](_0x4421e5,_0x127d49)[_0x6118('0xa')](function(_0x4c6b51){logger[_0x6118('0xb')](_0x6118('0xc'),_0x122a9e,_0x6118('0xd'));logger[_0x6118('0xe')](_0x6118('0xf'),_0x122a9e,_0x6118('0xd'),JSON[_0x6118('0x10')](_0x4c6b51));if(_0x4c6b51[_0x6118('0x11')]){if(_0x4c6b51[_0x6118('0x11')][_0x6118('0x12')]===0x1f4){logger['error'](_0x6118('0xc'),_0x122a9e,_0x4c6b51[_0x6118('0x11')]['message']);return _0x54b6c1(_0x4c6b51[_0x6118('0x11')][_0x6118('0x13')]);}logger[_0x6118('0x11')](_0x6118('0xc'),_0x122a9e,_0x4c6b51['error'][_0x6118('0x13')]);return _0x376c29(_0x4c6b51[_0x6118('0x11')][_0x6118('0x13')]);}else{logger[_0x6118('0xb')](_0x6118('0xc'),_0x122a9e,'request\x20sent');_0x376c29(_0x4c6b51[_0x6118('0x14')][_0x6118('0x13')]);}})['catch'](function(_0x577803){logger[_0x6118('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x122a9e,_0x577803);_0x54b6c1(_0x577803);});});}exports[_0x6118('0x15')]=function(_0xab28bf){var _0x4c873e=this;return new Promise(function(_0x4f7e75,_0x1ad52c){return db[_0x6118('0x16')][_0x6118('0x17')]({'raw':_0xab28bf[_0x6118('0x18')]?_0xab28bf[_0x6118('0x18')][_0x6118('0x19')]===undefined?!![]:![]:!![],'where':_0xab28bf[_0x6118('0x18')]?_0xab28bf[_0x6118('0x18')]['where']||null:null,'attributes':_0xab28bf[_0x6118('0x18')]?_0xab28bf[_0x6118('0x18')][_0x6118('0x1a')]||null:null,'include':_0xab28bf[_0x6118('0x18')]?_0xab28bf[_0x6118('0x18')][_0x6118('0x1b')]?_[_0x6118('0x1c')](_0xab28bf[_0x6118('0x18')][_0x6118('0x1b')],function(_0x3db0f7){return{'model':db[_0x3db0f7[_0x6118('0x1d')]],'as':_0x3db0f7['as'],'attributes':_0x3db0f7['attributes'],'include':_0x3db0f7[_0x6118('0x1b')]?_[_0x6118('0x1c')](_0x3db0f7[_0x6118('0x1b')],function(_0x474846){return{'model':db[_0x474846['model']],'as':_0x474846['as'],'attributes':_0x474846[_0x6118('0x1a')],'include':_0x474846[_0x6118('0x1b')]?_['map'](_0x474846[_0x6118('0x1b')],function(_0x53dd58){return{'model':db[_0x53dd58[_0x6118('0x1d')]],'as':_0x53dd58['as'],'attributes':_0x53dd58['attributes']};}):[]};}):[]};}):[]:[]})[_0x6118('0xa')](function(_0x4539fe){logger[_0x6118('0xb')](_0x6118('0x15'),_0xab28bf);logger[_0x6118('0xe')](_0x6118('0x15'),_0xab28bf,JSON[_0x6118('0x10')](_0x4539fe));_0x4f7e75(_0x4539fe);})['catch'](function(_0x4b5902){logger[_0x6118('0x11')](_0x6118('0x15'),_0x4b5902['message'],_0xab28bf);_0x1ad52c(_0x4c873e['error'](0x1f4,_0x4b5902[_0x6118('0x13')]));});});}; \ No newline at end of file +var _0x6861=['attributes','include','map','model','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','request\x20sent','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','info','result','ShowSquareOdbc','SquareOdbc','find','options','where'];(function(_0x5c53ac,_0x2c7657){var _0x5a4e57=function(_0x5d27b4){while(--_0x5d27b4){_0x5c53ac['push'](_0x5c53ac['shift']());}};_0x5a4e57(++_0x2c7657);}(_0x6861,0x127));var _0x1686=function(_0x221dd6,_0xea61e8){_0x221dd6=_0x221dd6-0x0;var _0x37aba1=_0x6861[_0x221dd6];return _0x37aba1;};'use strict';var _=require(_0x1686('0x0'));var util=require('util');var moment=require(_0x1686('0x1'));var BPromise=require('bluebird');var rs=require(_0x1686('0x2'));var fs=require('fs');var Redis=require(_0x1686('0x3'));var db=require(_0x1686('0x4'))['db'];var utils=require(_0x1686('0x5'));var logger=require(_0x1686('0x6'))(_0x1686('0x7'));var config=require('../../config/environment');var jayson=require(_0x1686('0x8'));var client=jayson[_0x1686('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54f6aa,_0x4dbf4b,_0xcdd067){return new BPromise(function(_0x577b5d,_0x585753){return client[_0x1686('0xa')](_0x54f6aa,_0xcdd067)['then'](function(_0x47ae21){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x4dbf4b,_0x1686('0xb'));logger['debug']('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x4dbf4b,'request\x20sent',JSON[_0x1686('0xc')](_0x47ae21));if(_0x47ae21[_0x1686('0xd')]){if(_0x47ae21[_0x1686('0xd')][_0x1686('0xe')]===0x1f4){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4dbf4b,_0x47ae21[_0x1686('0xd')]['message']);return _0x585753(_0x47ae21['error'][_0x1686('0xf')]);}logger[_0x1686('0xd')](_0x1686('0x10'),_0x4dbf4b,_0x47ae21[_0x1686('0xd')][_0x1686('0xf')]);return _0x577b5d(_0x47ae21[_0x1686('0xd')][_0x1686('0xf')]);}else{logger[_0x1686('0x11')](_0x1686('0x10'),_0x4dbf4b,'request\x20sent');_0x577b5d(_0x47ae21[_0x1686('0x12')][_0x1686('0xf')]);}})['catch'](function(_0x40f716){logger[_0x1686('0xd')](_0x1686('0x10'),_0x4dbf4b,_0x40f716);_0x585753(_0x40f716);});});}exports[_0x1686('0x13')]=function(_0x25af5c){var _0x3d55d1=this;return new Promise(function(_0x2f7b02,_0x3dc903){return db[_0x1686('0x14')][_0x1686('0x15')]({'raw':_0x25af5c[_0x1686('0x16')]?_0x25af5c[_0x1686('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x25af5c['options']?_0x25af5c[_0x1686('0x16')][_0x1686('0x17')]||null:null,'attributes':_0x25af5c[_0x1686('0x16')]?_0x25af5c['options'][_0x1686('0x18')]||null:null,'include':_0x25af5c[_0x1686('0x16')]?_0x25af5c['options'][_0x1686('0x19')]?_[_0x1686('0x1a')](_0x25af5c['options'][_0x1686('0x19')],function(_0x53d935){return{'model':db[_0x53d935[_0x1686('0x1b')]],'as':_0x53d935['as'],'attributes':_0x53d935['attributes'],'include':_0x53d935[_0x1686('0x19')]?_['map'](_0x53d935[_0x1686('0x19')],function(_0x12b473){return{'model':db[_0x12b473[_0x1686('0x1b')]],'as':_0x12b473['as'],'attributes':_0x12b473[_0x1686('0x18')],'include':_0x12b473[_0x1686('0x19')]?_[_0x1686('0x1a')](_0x12b473[_0x1686('0x19')],function(_0x57b685){return{'model':db[_0x57b685[_0x1686('0x1b')]],'as':_0x57b685['as'],'attributes':_0x57b685[_0x1686('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x252547){logger[_0x1686('0x11')](_0x1686('0x13'),_0x25af5c);logger['debug'](_0x1686('0x13'),_0x25af5c,JSON[_0x1686('0xc')](_0x252547));_0x2f7b02(_0x252547);})[_0x1686('0x1c')](function(_0x19c3e6){logger[_0x1686('0xd')]('ShowSquareOdbc',_0x19c3e6[_0x1686('0xf')],_0x25af5c);_0x3dc903(_0x3d55d1['error'](0x1f4,_0x19c3e6['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 0a3c1d1..69fd7fb 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 _0x8ff4=['show','/:id/users','getUsers','post','create','addUsers','update','delete','destroy','removeUsers','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id'];(function(_0x4dc36b,_0x12e1c3){var _0x21101c=function(_0x29b088){while(--_0x29b088){_0x4dc36b['push'](_0x4dc36b['shift']());}};_0x21101c(++_0x12e1c3);}(_0x8ff4,0x11f));var _0x48ff=function(_0x19bf5f,_0x1ca6b9){_0x19bf5f=_0x19bf5f-0x0;var _0x237efa=_0x8ff4[_0x19bf5f];return _0x237efa;};'use strict';var multer=require(_0x48ff('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x48ff('0x1'));var express=require(_0x48ff('0x2'));var router=express['Router']();var fs_extra=require(_0x48ff('0x3'));var auth=require(_0x48ff('0x4'));var interaction=require(_0x48ff('0x5'));var config=require(_0x48ff('0x6'));var controller=require(_0x48ff('0x7'));router[_0x48ff('0x8')]('/',auth[_0x48ff('0x9')](),controller[_0x48ff('0xa')]);router[_0x48ff('0x8')](_0x48ff('0xb'),auth[_0x48ff('0x9')](),controller[_0x48ff('0xc')]);router[_0x48ff('0x8')](_0x48ff('0xd'),auth['isAuthenticated'](),controller[_0x48ff('0xe')]);router[_0x48ff('0xf')]('/',auth['isAuthenticated'](),controller[_0x48ff('0x10')]);router[_0x48ff('0xf')]('/:id/users',auth[_0x48ff('0x9')](),controller[_0x48ff('0x11')]);router['put'](_0x48ff('0xb'),auth[_0x48ff('0x9')](),controller[_0x48ff('0x12')]);router[_0x48ff('0x13')](_0x48ff('0xb'),auth[_0x48ff('0x9')](),controller[_0x48ff('0x14')]);router[_0x48ff('0x13')](_0x48ff('0xd'),auth[_0x48ff('0x9')](),controller[_0x48ff('0x15')]);module[_0x48ff('0x16')]=router; \ No newline at end of file +var _0xc6d7=['/:id','show','/:id/users','getUsers','create','post','addUsers','put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index'];(function(_0x148d86,_0x4b2c19){var _0x2ab9e5=function(_0xa0e631){while(--_0xa0e631){_0x148d86['push'](_0x148d86['shift']());}};_0x2ab9e5(++_0x4b2c19);}(_0xc6d7,0x71));var _0x7c6d=function(_0x494390,_0x388e12){_0x494390=_0x494390-0x0;var _0x902cf9=_0xc6d7[_0x494390];return _0x902cf9;};'use strict';var multer=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var path=require(_0x7c6d('0x2'));var timeout=require(_0x7c6d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x7c6d('0x4'));var auth=require(_0x7c6d('0x5'));var interaction=require(_0x7c6d('0x6'));var config=require(_0x7c6d('0x7'));var controller=require(_0x7c6d('0x8'));router[_0x7c6d('0x9')]('/',auth[_0x7c6d('0xa')](),controller[_0x7c6d('0xb')]);router[_0x7c6d('0x9')](_0x7c6d('0xc'),auth[_0x7c6d('0xa')](),controller[_0x7c6d('0xd')]);router[_0x7c6d('0x9')](_0x7c6d('0xe'),auth['isAuthenticated'](),controller[_0x7c6d('0xf')]);router['post']('/',auth[_0x7c6d('0xa')](),controller[_0x7c6d('0x10')]);router[_0x7c6d('0x11')](_0x7c6d('0xe'),auth['isAuthenticated'](),controller[_0x7c6d('0x12')]);router[_0x7c6d('0x13')](_0x7c6d('0xc'),auth[_0x7c6d('0xa')](),controller[_0x7c6d('0x14')]);router[_0x7c6d('0x15')](_0x7c6d('0xc'),auth['isAuthenticated'](),controller[_0x7c6d('0x16')]);router[_0x7c6d('0x15')](_0x7c6d('0xe'),auth[_0x7c6d('0xa')](),controller[_0x7c6d('0x17')]);module[_0x7c6d('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 06ebace..f9e6692 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 _0xda2d=['toString','utf8','BLOB','long','production','DATE','exports','STRING','name','TEXT','preproduction','getDataValue'];(function(_0x240362,_0x156794){var _0x26de18=function(_0x4a4431){while(--_0x4a4431){_0x240362['push'](_0x240362['shift']());}};_0x26de18(++_0x156794);}(_0xda2d,0x102));var _0xdda2=function(_0x4cafc2,_0x484132){_0x4cafc2=_0x4cafc2-0x0;var _0x7c42bd=_0xda2d[_0x4cafc2];return _0x7c42bd;};'use strict';var Sequelize=require('sequelize');module[_0xdda2('0x0')]={'name':{'type':Sequelize[_0xdda2('0x1')],'unique':_0xdda2('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xdda2('0x1')]},'notes':{'type':Sequelize[_0xdda2('0x3')]},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this['getDataValue'](_0xdda2('0x4'))){return this[_0xdda2('0x5')](_0xdda2('0x4'))[_0xdda2('0x6')](_0xdda2('0x7'));}}},'production':{'type':Sequelize[_0xdda2('0x8')](_0xdda2('0x9')),'get':function(){if(this[_0xdda2('0x5')](_0xdda2('0xa'))){return this[_0xdda2('0x5')]('production')[_0xdda2('0x6')](_0xdda2('0x7'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0xdda2('0xb')]}}; \ No newline at end of file +var _0xec2b=['long','getDataValue','preproduction','toString','utf8','production','STRING','name','TEXT','BLOB'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0xec2b,0x1e6));var _0xbec2=function(_0x3e3f82,_0x535ba1){_0x3e3f82=_0x3e3f82-0x0;var _0x1b02dc=_0xec2b[_0x3e3f82];return _0x1b02dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbec2('0x0')],'unique':_0xbec2('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xbec2('0x0')]},'notes':{'type':Sequelize[_0xbec2('0x2')]},'preproduction':{'type':Sequelize[_0xbec2('0x3')](_0xbec2('0x4')),'get':function(){if(this[_0xbec2('0x5')](_0xbec2('0x6'))){return this[_0xbec2('0x5')](_0xbec2('0x6'))[_0xbec2('0x7')](_0xbec2('0x8'));}}},'production':{'type':Sequelize[_0xbec2('0x3')](_0xbec2('0x4')),'get':function(){if(this[_0xbec2('0x5')](_0xbec2('0x9'))){return this[_0xbec2('0x5')](_0xbec2('0x9'))[_0xbec2('0x7')](_0xbec2('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'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 f82a076..92577b2 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 _0xe9f2=['userSquareProject:remove','getUsers','findOne','pick','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','SquareProjects','UserProfileResource','stack','name','send','index','SquareProject','fieldName','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','catch','show','params','rawAttributes','intersection','length','includeAll','create','body','role','user','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','removeUsers','ids','emit'];(function(_0x255e9d,_0x314dba){var _0x431e3d=function(_0x409c37){while(--_0x409c37){_0x255e9d['push'](_0x255e9d['shift']());}};_0x431e3d(++_0x314dba);}(_0xe9f2,0xba));var _0x2e9f=function(_0x1019f4,_0x4fc0ba){_0x1019f4=_0x1019f4-0x0;var _0x3eb9a8=_0xe9f2[_0x1019f4];return _0x3eb9a8;};'use strict';var emlformat=require(_0x2e9f('0x0'));var rimraf=require(_0x2e9f('0x1'));var zipdir=require(_0x2e9f('0x2'));var jsonpatch=require(_0x2e9f('0x3'));var rp=require('request-promise');var moment=require(_0x2e9f('0x4'));var BPromise=require(_0x2e9f('0x5'));var Mustache=require(_0x2e9f('0x6'));var util=require(_0x2e9f('0x7'));var path=require('path');var sox=require(_0x2e9f('0x8'));var csv=require(_0x2e9f('0x9'));var ejs=require(_0x2e9f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2e9f('0xb'));var squel=require(_0x2e9f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2e9f('0xd'));var toCsv=require(_0x2e9f('0x9'));var querystring=require(_0x2e9f('0xe'));var Papa=require('papaparse');var Redis=require(_0x2e9f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2e9f('0x10'));var as=require(_0x2e9f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e9f('0x12'))('api');var utils=require(_0x2e9f('0x13'));var config=require(_0x2e9f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2e9f('0x15'))['db'];config[_0x2e9f('0x16')]=_[_0x2e9f('0x17')](config[_0x2e9f('0x16')],{'host':_0x2e9f('0x18'),'port':0x18eb});var socket=require(_0x2e9f('0x19'))(new Redis(config[_0x2e9f('0x16')]));require(_0x2e9f('0x1a'))['register'](socket);function respondWithStatusCode(_0x47c379,_0x3335ca){_0x3335ca=_0x3335ca||0xcc;return function(_0x3ab7db){if(_0x3ab7db){return _0x47c379[_0x2e9f('0x1b')](_0x3335ca);}return _0x47c379[_0x2e9f('0x1c')](_0x3335ca)[_0x2e9f('0x1d')]();};}function respondWithResult(_0x3d007c,_0x2b1d1a){_0x2b1d1a=_0x2b1d1a||0xc8;return function(_0x52993d){if(_0x52993d){return _0x3d007c['status'](_0x2b1d1a)[_0x2e9f('0x1e')](_0x52993d);}};}function respondWithFilteredResult(_0xbb250c,_0x22a4ba){return function(_0x4bf69c){if(_0x4bf69c){var _0x2e912c=typeof _0x22a4ba[_0x2e9f('0x1f')]==='undefined'&&typeof _0x22a4ba[_0x2e9f('0x20')]===_0x2e9f('0x21');var _0x2d1642=_0x4bf69c[_0x2e9f('0x22')];var _0x18008d=_0x2e912c?0x0:_0x22a4ba[_0x2e9f('0x1f')];var _0x5cf1e9=_0x2e912c?_0x4bf69c[_0x2e9f('0x22')]:_0x22a4ba[_0x2e9f('0x1f')]+_0x22a4ba['limit'];var _0x47fc01;if(_0x5cf1e9>=_0x2d1642){_0x5cf1e9=_0x2d1642;_0x47fc01=0xc8;}else{_0x47fc01=0xce;}_0xbb250c[_0x2e9f('0x1c')](_0x47fc01);return _0xbb250c[_0x2e9f('0x23')](_0x2e9f('0x24'),_0x18008d+'-'+_0x5cf1e9+'/'+_0x2d1642)[_0x2e9f('0x1e')](_0x4bf69c);}return null;};}function patchUpdates(_0x49a992){return function(_0x45c8dc){try{jsonpatch[_0x2e9f('0x25')](_0x45c8dc,_0x49a992,!![]);}catch(_0x189e75){return BPromise['reject'](_0x189e75);}return _0x45c8dc[_0x2e9f('0x26')]();};}function saveUpdates(_0x4ed23a,_0x1a2d9d){return function(_0x40cf16){if(_0x40cf16){return _0x40cf16[_0x2e9f('0x27')](_0x4ed23a)[_0x2e9f('0x28')](function(_0x39ab1b){return _0x39ab1b;});}return null;};}function removeEntity(_0x543712,_0x34b531){return function(_0x3f91ca){if(_0x3f91ca){return _0x3f91ca[_0x2e9f('0x29')]()[_0x2e9f('0x28')](function(){var _0x57d0d5=_0x3f91ca[_0x2e9f('0x2a')]({'plain':!![]});var _0x146216=_0x2e9f('0x2b');return db[_0x2e9f('0x2c')]['destroy']({'where':{'type':_0x146216,'resourceId':_0x57d0d5['id']}})[_0x2e9f('0x28')](function(){return _0x3f91ca;});})[_0x2e9f('0x28')](function(){_0x543712[_0x2e9f('0x1c')](0xcc)[_0x2e9f('0x1d')]();});}};}function handleEntityNotFound(_0x41242d,_0xec85d8){return function(_0x289446){if(!_0x289446){_0x41242d[_0x2e9f('0x1b')](0x194);}return _0x289446;};}function handleError(_0x1eb749,_0x1a811c){_0x1a811c=_0x1a811c||0x1f4;return function(_0xa70b81){logger['error'](_0xa70b81[_0x2e9f('0x2d')]);if(_0xa70b81[_0x2e9f('0x2e')]){delete _0xa70b81[_0x2e9f('0x2e')];}_0x1eb749[_0x2e9f('0x1c')](_0x1a811c)[_0x2e9f('0x2f')](_0xa70b81);};}exports[_0x2e9f('0x30')]=function(_0xcfb13f,_0x5b9ad7){var _0x821df4={},_0x4db437={},_0x35ce8a={'count':0x0,'rows':[]};var _0x135513=_['map'](db[_0x2e9f('0x31')]['rawAttributes'],function(_0x2ad3b8){return{'name':_0x2ad3b8[_0x2e9f('0x32')],'type':_0x2ad3b8['type']['key']};});_0x4db437[_0x2e9f('0x33')]=_[_0x2e9f('0x34')](_0x135513,'name');_0x4db437[_0x2e9f('0x35')]=_[_0x2e9f('0x36')](_0xcfb13f['query']);_0x4db437[_0x2e9f('0x37')]=_['intersection'](_0x4db437[_0x2e9f('0x33')],_0x4db437[_0x2e9f('0x35')]);_0x821df4[_0x2e9f('0x38')]=_['intersection'](_0x4db437['model'],qs[_0x2e9f('0x39')](_0xcfb13f[_0x2e9f('0x35')][_0x2e9f('0x39')]));_0x821df4[_0x2e9f('0x38')]=_0x821df4['attributes']['length']?_0x821df4['attributes']:_0x4db437[_0x2e9f('0x33')];if(!_0xcfb13f[_0x2e9f('0x35')][_0x2e9f('0x3a')](_0x2e9f('0x3b'))){_0x821df4['limit']=qs['limit'](_0xcfb13f['query'][_0x2e9f('0x20')]);_0x821df4['offset']=qs['offset'](_0xcfb13f[_0x2e9f('0x35')][_0x2e9f('0x1f')]);}_0x821df4[_0x2e9f('0x3c')]=qs[_0x2e9f('0x3d')](_0xcfb13f['query'][_0x2e9f('0x3d')]);_0x821df4[_0x2e9f('0x3e')]=qs[_0x2e9f('0x37')](_['pick'](_0xcfb13f[_0x2e9f('0x35')],_0x4db437['filters']),_0x135513);if(_0xcfb13f[_0x2e9f('0x35')][_0x2e9f('0x3f')]){_0x821df4[_0x2e9f('0x3e')]=_[_0x2e9f('0x40')](_0x821df4[_0x2e9f('0x3e')],{'$or':_[_0x2e9f('0x34')](_0x135513,function(_0x17726b){if(_0x17726b['type']!=='VIRTUAL'){var _0x294584={};_0x294584[_0x17726b[_0x2e9f('0x2e')]]={'$like':'%'+_0xcfb13f['query'][_0x2e9f('0x3f')]+'%'};return _0x294584;}})});}_0x821df4=_[_0x2e9f('0x40')]({},_0x821df4,_0xcfb13f[_0x2e9f('0x41')]);var _0x44f74f={'where':_0x821df4[_0x2e9f('0x3e')]};return db[_0x2e9f('0x31')][_0x2e9f('0x22')](_0x44f74f)['then'](function(_0x2e2c1a){_0x35ce8a[_0x2e9f('0x22')]=_0x2e2c1a;if(_0xcfb13f['query']['includeAll']){_0x821df4[_0x2e9f('0x42')]=[{'all':!![]}];}return db[_0x2e9f('0x31')][_0x2e9f('0x43')](_0x821df4);})[_0x2e9f('0x28')](function(_0x89e4e3){_0x35ce8a['rows']=_0x89e4e3;return _0x35ce8a;})['then'](respondWithFilteredResult(_0x5b9ad7,_0x821df4))[_0x2e9f('0x44')](handleError(_0x5b9ad7,null));};exports[_0x2e9f('0x45')]=function(_0x29ae03,_0x2298b3){var _0x2ddf11={'raw':![],'where':{'id':_0x29ae03[_0x2e9f('0x46')]['id']}},_0x1af214={};_0x1af214['model']=_[_0x2e9f('0x36')](db[_0x2e9f('0x31')][_0x2e9f('0x47')]);_0x1af214[_0x2e9f('0x35')]=_[_0x2e9f('0x36')](_0x29ae03['query']);_0x1af214['filters']=_[_0x2e9f('0x48')](_0x1af214[_0x2e9f('0x33')],_0x1af214['query']);_0x2ddf11[_0x2e9f('0x38')]=_[_0x2e9f('0x48')](_0x1af214[_0x2e9f('0x33')],qs[_0x2e9f('0x39')](_0x29ae03[_0x2e9f('0x35')][_0x2e9f('0x39')]));_0x2ddf11[_0x2e9f('0x38')]=_0x2ddf11['attributes'][_0x2e9f('0x49')]?_0x2ddf11[_0x2e9f('0x38')]:_0x1af214['model'];if(_0x29ae03['query'][_0x2e9f('0x4a')]){_0x2ddf11[_0x2e9f('0x42')]=[{'all':!![]}];}_0x2ddf11=_[_0x2e9f('0x40')]({},_0x2ddf11,_0x29ae03[_0x2e9f('0x41')]);return db[_0x2e9f('0x31')]['find'](_0x2ddf11)[_0x2e9f('0x28')](handleEntityNotFound(_0x2298b3,null))['then'](respondWithResult(_0x2298b3,null))[_0x2e9f('0x44')](handleError(_0x2298b3,null));};exports[_0x2e9f('0x4b')]=function(_0xe3bff7,_0x516902){return db[_0x2e9f('0x31')][_0x2e9f('0x4b')](_0xe3bff7[_0x2e9f('0x4c')],{})[_0x2e9f('0x28')](function(_0x401447){var _0x3fb6f7=_0xe3bff7['user'][_0x2e9f('0x2a')]({'plain':!![]});if(!_0x3fb6f7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fb6f7[_0x2e9f('0x4d')]===_0x2e9f('0x4e')){var _0x31f8f9=_0x401447['get']({'plain':!![]});var _0x3d8b21=_0x2e9f('0x2b');return db['UserProfileSection'][_0x2e9f('0x4f')]({'where':{'name':_0x3d8b21,'userProfileId':_0x3fb6f7[_0x2e9f('0x50')]},'raw':!![]})[_0x2e9f('0x28')](function(_0x3690d8){if(_0x3690d8&&_0x3690d8[_0x2e9f('0x51')]===0x0){return db[_0x2e9f('0x2c')][_0x2e9f('0x4b')]({'name':_0x31f8f9[_0x2e9f('0x2e')],'resourceId':_0x31f8f9['id'],'type':_0x3690d8['name'],'sectionId':_0x3690d8['id']},{})['then'](function(){return _0x401447;});}else{return _0x401447;}})[_0x2e9f('0x44')](function(_0x4eeadf){logger[_0x2e9f('0x52')](_0x2e9f('0x53'),_0x4eeadf);throw _0x4eeadf;});}return _0x401447;})[_0x2e9f('0x28')](respondWithResult(_0x516902,0xc9))[_0x2e9f('0x44')](handleError(_0x516902,null));};exports[_0x2e9f('0x27')]=function(_0x3a97b3,_0x2b5b68){if(_0x3a97b3[_0x2e9f('0x4c')]['id']){delete _0x3a97b3['body']['id'];}return db['SquareProject'][_0x2e9f('0x4f')]({'where':{'id':_0x3a97b3[_0x2e9f('0x46')]['id']}})[_0x2e9f('0x28')](handleEntityNotFound(_0x2b5b68,null))['then'](saveUpdates(_0x3a97b3[_0x2e9f('0x4c')],null))[_0x2e9f('0x28')](respondWithResult(_0x2b5b68,null))[_0x2e9f('0x44')](handleError(_0x2b5b68,null));};exports[_0x2e9f('0x29')]=function(_0x1a309d,_0x50f3b7){return db[_0x2e9f('0x31')][_0x2e9f('0x4f')]({'where':{'id':_0x1a309d[_0x2e9f('0x46')]['id']}})[_0x2e9f('0x28')](handleEntityNotFound(_0x50f3b7,null))[_0x2e9f('0x28')](removeEntity(_0x50f3b7,null))[_0x2e9f('0x44')](handleError(_0x50f3b7,null));};exports['addUsers']=function(_0x3fd4e2,_0x466b0a,_0x472ae6){return db[_0x2e9f('0x31')][_0x2e9f('0x4f')]({'where':{'id':_0x3fd4e2['params']['id']}})[_0x2e9f('0x28')](handleEntityNotFound(_0x466b0a,null))['then'](function(_0x4736e8){if(_0x4736e8){return _0x4736e8['addUsers'](_0x3fd4e2['body']['ids'],_['omit'](_0x3fd4e2[_0x2e9f('0x4c')],['ids','id'])||{});}})[_0x2e9f('0x28')](respondWithResult(_0x466b0a,null))[_0x2e9f('0x44')](handleError(_0x466b0a,null));};exports[_0x2e9f('0x54')]=function(_0x68b81b,_0x3023fa,_0x2d43b4){return db[_0x2e9f('0x31')][_0x2e9f('0x4f')]({'where':{'id':_0x68b81b[_0x2e9f('0x46')]['id']}})[_0x2e9f('0x28')](handleEntityNotFound(_0x3023fa,null))['then'](function(_0x52cab6){if(_0x52cab6){return _0x52cab6[_0x2e9f('0x54')](_0x68b81b[_0x2e9f('0x35')]['ids'])[_0x2e9f('0x28')](function(){if(_['isArray'](_0x68b81b['query']['ids'])){for(var _0x3d31e1=0x0;_0x3d31e1<_0x68b81b[_0x2e9f('0x35')][_0x2e9f('0x55')][_0x2e9f('0x49')];_0x3d31e1+=0x1){socket[_0x2e9f('0x56')]('userSquareProject:remove',{'UserId':Number(_0x68b81b[_0x2e9f('0x35')][_0x2e9f('0x55')][_0x3d31e1]),'SquareProjectId':Number(_0x68b81b[_0x2e9f('0x46')]['id'])});}}else{socket[_0x2e9f('0x56')](_0x2e9f('0x57'),{'UserId':Number(_0x68b81b[_0x2e9f('0x35')][_0x2e9f('0x55')]),'SquareProjectId':Number(_0x68b81b[_0x2e9f('0x46')]['id'])});}});}})['then'](respondWithStatusCode(_0x3023fa,null))[_0x2e9f('0x44')](handleError(_0x3023fa,null));};exports[_0x2e9f('0x58')]=function(_0xa236b4,_0x2b4730,_0x338534){var _0x3371c8={};var _0x483b87={};var _0x4320ed;var _0xb4f440;return db[_0x2e9f('0x31')][_0x2e9f('0x59')]({'where':{'id':_0xa236b4[_0x2e9f('0x46')]['id']}})[_0x2e9f('0x28')](handleEntityNotFound(_0x2b4730,null))['then'](function(_0x1454a7){if(_0x1454a7){_0x4320ed=_0x1454a7;_0x483b87[_0x2e9f('0x33')]=_[_0x2e9f('0x36')](db['User'][_0x2e9f('0x47')]);_0x483b87[_0x2e9f('0x35')]=_[_0x2e9f('0x36')](_0xa236b4[_0x2e9f('0x35')]);_0x483b87[_0x2e9f('0x37')]=_[_0x2e9f('0x48')](_0x483b87[_0x2e9f('0x33')],_0x483b87[_0x2e9f('0x35')]);_0x3371c8[_0x2e9f('0x38')]=_[_0x2e9f('0x48')](_0x483b87[_0x2e9f('0x33')],qs[_0x2e9f('0x39')](_0xa236b4[_0x2e9f('0x35')]['fields']));_0x3371c8[_0x2e9f('0x38')]=_0x3371c8[_0x2e9f('0x38')][_0x2e9f('0x49')]?_0x3371c8[_0x2e9f('0x38')]:_0x483b87[_0x2e9f('0x33')];_0x3371c8[_0x2e9f('0x3c')]=qs[_0x2e9f('0x3d')](_0xa236b4['query'][_0x2e9f('0x3d')]);_0x3371c8[_0x2e9f('0x3e')]=qs[_0x2e9f('0x37')](_[_0x2e9f('0x5a')](_0xa236b4[_0x2e9f('0x35')],_0x483b87[_0x2e9f('0x37')]));if(_0xa236b4[_0x2e9f('0x35')]['filter']){_0x3371c8[_0x2e9f('0x3e')]=_['merge'](_0x3371c8[_0x2e9f('0x3e')],{'$or':_[_0x2e9f('0x34')](_0x3371c8[_0x2e9f('0x38')],function(_0x1c86af){var _0x349787={};_0x349787[_0x1c86af]={'$like':'%'+_0xa236b4['query'][_0x2e9f('0x3f')]+'%'};return _0x349787;})});}_0x3371c8=_['merge']({},_0x3371c8,_0xa236b4[_0x2e9f('0x41')]);return _0x4320ed[_0x2e9f('0x58')](_0x3371c8);}})[_0x2e9f('0x28')](function(_0x14d69b){if(_0x14d69b){_0xb4f440=_0x14d69b[_0x2e9f('0x49')];if(!_0xa236b4[_0x2e9f('0x35')][_0x2e9f('0x3a')]('nolimit')){_0x3371c8[_0x2e9f('0x20')]=qs[_0x2e9f('0x20')](_0xa236b4['query'][_0x2e9f('0x20')]);_0x3371c8[_0x2e9f('0x1f')]=qs[_0x2e9f('0x1f')](_0xa236b4[_0x2e9f('0x35')][_0x2e9f('0x1f')]);}return _0x4320ed[_0x2e9f('0x58')](_0x3371c8);}})['then'](function(_0x2f20b3){if(_0x2f20b3){return _0x2f20b3?{'count':_0xb4f440,'rows':_0x2f20b3}:null;}})[_0x2e9f('0x28')](respondWithResult(_0x2b4730,null))[_0x2e9f('0x44')](handleError(_0x2b4730,null));}; \ No newline at end of file +var _0x666f=['emit','userSquareProject:remove','getUsers','User','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','type','key','keys','filters','intersection','model','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','fields','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','update','body','addUsers','ids','omit','removeUsers'];(function(_0x460956,_0x1d613d){var _0x3b99e6=function(_0x2d4419){while(--_0x2d4419){_0x460956['push'](_0x460956['shift']());}};_0x3b99e6(++_0x1d613d);}(_0x666f,0x64));var _0xf666=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x666f[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf666('0x0'));var zipdir=require(_0xf666('0x1'));var jsonpatch=require(_0xf666('0x2'));var rp=require('request-promise');var moment=require(_0xf666('0x3'));var BPromise=require(_0xf666('0x4'));var Mustache=require(_0xf666('0x5'));var util=require(_0xf666('0x6'));var path=require('path');var sox=require(_0xf666('0x7'));var csv=require(_0xf666('0x8'));var ejs=require(_0xf666('0x9'));var fs=require('fs');var fs_extra=require(_0xf666('0xa'));var _=require(_0xf666('0xb'));var squel=require(_0xf666('0xc'));var crypto=require(_0xf666('0xd'));var jsforce=require(_0xf666('0xe'));var deskjs=require(_0xf666('0xf'));var toCsv=require(_0xf666('0x8'));var querystring=require(_0xf666('0x10'));var Papa=require(_0xf666('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf666('0x12'));var as=require(_0xf666('0x13'));var hardwareService=require(_0xf666('0x14'));var logger=require(_0xf666('0x15'))(_0xf666('0x16'));var utils=require(_0xf666('0x17'));var config=require(_0xf666('0x18'));var licenseUtil=require(_0xf666('0x19'));var db=require(_0xf666('0x1a'))['db'];config[_0xf666('0x1b')]=_['defaults'](config[_0xf666('0x1b')],{'host':_0xf666('0x1c'),'port':0x18eb});var socket=require(_0xf666('0x1d'))(new Redis(config[_0xf666('0x1b')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x1e65a7,_0x2d0892){_0x2d0892=_0x2d0892||0xcc;return function(_0x120278){if(_0x120278){return _0x1e65a7['sendStatus'](_0x2d0892);}return _0x1e65a7[_0xf666('0x1e')](_0x2d0892)[_0xf666('0x1f')]();};}function respondWithResult(_0xd281ca,_0x4fd94c){_0x4fd94c=_0x4fd94c||0xc8;return function(_0x15f6de){if(_0x15f6de){return _0xd281ca[_0xf666('0x1e')](_0x4fd94c)['json'](_0x15f6de);}};}function respondWithFilteredResult(_0x57a7df,_0x46dfe4){return function(_0x4e2096){if(_0x4e2096){var _0x1f27ae=typeof _0x46dfe4[_0xf666('0x20')]===_0xf666('0x21')&&typeof _0x46dfe4['limit']===_0xf666('0x21');var _0x41223f=_0x4e2096[_0xf666('0x22')];var _0x535107=_0x1f27ae?0x0:_0x46dfe4[_0xf666('0x20')];var _0x310356=_0x1f27ae?_0x4e2096[_0xf666('0x22')]:_0x46dfe4[_0xf666('0x20')]+_0x46dfe4[_0xf666('0x23')];var _0x8e909d;if(_0x310356>=_0x41223f){_0x310356=_0x41223f;_0x8e909d=0xc8;}else{_0x8e909d=0xce;}_0x57a7df[_0xf666('0x1e')](_0x8e909d);return _0x57a7df[_0xf666('0x24')](_0xf666('0x25'),_0x535107+'-'+_0x310356+'/'+_0x41223f)['json'](_0x4e2096);}return null;};}function patchUpdates(_0x4cf02b){return function(_0xe471ce){try{jsonpatch[_0xf666('0x26')](_0xe471ce,_0x4cf02b,!![]);}catch(_0x5d8dde){return BPromise[_0xf666('0x27')](_0x5d8dde);}return _0xe471ce[_0xf666('0x28')]();};}function saveUpdates(_0x1417ac,_0xf93710){return function(_0x4f1823){if(_0x4f1823){return _0x4f1823['update'](_0x1417ac)[_0xf666('0x29')](function(_0x258cb3){return _0x258cb3;});}return null;};}function removeEntity(_0x1d6084,_0x4e0825){return function(_0x4e24ad){if(_0x4e24ad){return _0x4e24ad[_0xf666('0x2a')]()[_0xf666('0x29')](function(){var _0xdbde5a=_0x4e24ad[_0xf666('0x2b')]({'plain':!![]});var _0x154175=_0xf666('0x2c');return db[_0xf666('0x2d')]['destroy']({'where':{'type':_0x154175,'resourceId':_0xdbde5a['id']}})[_0xf666('0x29')](function(){return _0x4e24ad;});})[_0xf666('0x29')](function(){_0x1d6084[_0xf666('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e6cce,_0x1751da){return function(_0x23a443){if(!_0x23a443){_0x1e6cce[_0xf666('0x2e')](0x194);}return _0x23a443;};}function handleError(_0x1eca78,_0x1e0432){_0x1e0432=_0x1e0432||0x1f4;return function(_0x79b2e4){logger[_0xf666('0x2f')](_0x79b2e4[_0xf666('0x30')]);if(_0x79b2e4[_0xf666('0x31')]){delete _0x79b2e4[_0xf666('0x31')];}_0x1eca78[_0xf666('0x1e')](_0x1e0432)[_0xf666('0x32')](_0x79b2e4);};}exports['index']=function(_0x17e71c,_0x44cee5){var _0x5003a9={},_0x59b363={},_0xd361aa={'count':0x0,'rows':[]};var _0x4fa7db=_[_0xf666('0x33')](db[_0xf666('0x34')][_0xf666('0x35')],function(_0x5a8d4b){return{'name':_0x5a8d4b['fieldName'],'type':_0x5a8d4b[_0xf666('0x36')][_0xf666('0x37')]};});_0x59b363['model']=_['map'](_0x4fa7db,_0xf666('0x31'));_0x59b363['query']=_[_0xf666('0x38')](_0x17e71c['query']);_0x59b363[_0xf666('0x39')]=_[_0xf666('0x3a')](_0x59b363[_0xf666('0x3b')],_0x59b363[_0xf666('0x3c')]);_0x5003a9[_0xf666('0x3d')]=_[_0xf666('0x3a')](_0x59b363[_0xf666('0x3b')],qs['fields'](_0x17e71c[_0xf666('0x3c')]['fields']));_0x5003a9['attributes']=_0x5003a9[_0xf666('0x3d')][_0xf666('0x3e')]?_0x5003a9['attributes']:_0x59b363[_0xf666('0x3b')];if(!_0x17e71c[_0xf666('0x3c')][_0xf666('0x3f')](_0xf666('0x40'))){_0x5003a9['limit']=qs['limit'](_0x17e71c[_0xf666('0x3c')][_0xf666('0x23')]);_0x5003a9[_0xf666('0x20')]=qs[_0xf666('0x20')](_0x17e71c[_0xf666('0x3c')][_0xf666('0x20')]);}_0x5003a9['order']=qs[_0xf666('0x41')](_0x17e71c[_0xf666('0x3c')]['sort']);_0x5003a9[_0xf666('0x42')]=qs[_0xf666('0x39')](_[_0xf666('0x43')](_0x17e71c[_0xf666('0x3c')],_0x59b363['filters']),_0x4fa7db);if(_0x17e71c['query'][_0xf666('0x44')]){_0x5003a9[_0xf666('0x42')]=_[_0xf666('0x45')](_0x5003a9[_0xf666('0x42')],{'$or':_[_0xf666('0x33')](_0x4fa7db,function(_0x3cf628){if(_0x3cf628['type']!=='VIRTUAL'){var _0x42cd6e={};_0x42cd6e[_0x3cf628[_0xf666('0x31')]]={'$like':'%'+_0x17e71c['query'][_0xf666('0x44')]+'%'};return _0x42cd6e;}})});}_0x5003a9=_[_0xf666('0x45')]({},_0x5003a9,_0x17e71c[_0xf666('0x46')]);var _0x41c70b={'where':_0x5003a9['where']};return db['SquareProject'][_0xf666('0x22')](_0x41c70b)[_0xf666('0x29')](function(_0x10cf92){_0xd361aa[_0xf666('0x22')]=_0x10cf92;if(_0x17e71c['query'][_0xf666('0x47')]){_0x5003a9['include']=[{'all':!![]}];}return db[_0xf666('0x34')][_0xf666('0x48')](_0x5003a9);})[_0xf666('0x29')](function(_0x31aa8e){_0xd361aa[_0xf666('0x49')]=_0x31aa8e;return _0xd361aa;})[_0xf666('0x29')](respondWithFilteredResult(_0x44cee5,_0x5003a9))[_0xf666('0x4a')](handleError(_0x44cee5,null));};exports[_0xf666('0x4b')]=function(_0x7e53a1,_0x30d0d6){var _0x3702e2={'raw':![],'where':{'id':_0x7e53a1[_0xf666('0x4c')]['id']}},_0x351cdf={};_0x351cdf[_0xf666('0x3b')]=_[_0xf666('0x38')](db['SquareProject'][_0xf666('0x35')]);_0x351cdf['query']=_[_0xf666('0x38')](_0x7e53a1['query']);_0x351cdf['filters']=_[_0xf666('0x3a')](_0x351cdf[_0xf666('0x3b')],_0x351cdf[_0xf666('0x3c')]);_0x3702e2[_0xf666('0x3d')]=_[_0xf666('0x3a')](_0x351cdf[_0xf666('0x3b')],qs[_0xf666('0x4d')](_0x7e53a1[_0xf666('0x3c')]['fields']));_0x3702e2[_0xf666('0x3d')]=_0x3702e2[_0xf666('0x3d')]['length']?_0x3702e2[_0xf666('0x3d')]:_0x351cdf[_0xf666('0x3b')];if(_0x7e53a1[_0xf666('0x3c')]['includeAll']){_0x3702e2[_0xf666('0x4e')]=[{'all':!![]}];}_0x3702e2=_[_0xf666('0x45')]({},_0x3702e2,_0x7e53a1[_0xf666('0x46')]);return db[_0xf666('0x34')][_0xf666('0x4f')](_0x3702e2)['then'](handleEntityNotFound(_0x30d0d6,null))[_0xf666('0x29')](respondWithResult(_0x30d0d6,null))[_0xf666('0x4a')](handleError(_0x30d0d6,null));};exports['create']=function(_0x423c75,_0xcf6f01){return db[_0xf666('0x34')][_0xf666('0x50')](_0x423c75['body'],{})['then'](function(_0x45df2d){var _0x12444c=_0x423c75['user'][_0xf666('0x2b')]({'plain':!![]});if(!_0x12444c)throw new Error(_0xf666('0x51'));if(_0x12444c['role']===_0xf666('0x52')){var _0x233a5e=_0x45df2d['get']({'plain':!![]});var _0x511d8a=_0xf666('0x2c');return db[_0xf666('0x53')]['find']({'where':{'name':_0x511d8a,'userProfileId':_0x12444c[_0xf666('0x54')]},'raw':!![]})[_0xf666('0x29')](function(_0x33af70){if(_0x33af70&&_0x33af70[_0xf666('0x55')]===0x0){return db['UserProfileResource'][_0xf666('0x50')]({'name':_0x233a5e[_0xf666('0x31')],'resourceId':_0x233a5e['id'],'type':_0x33af70[_0xf666('0x31')],'sectionId':_0x33af70['id']},{})[_0xf666('0x29')](function(){return _0x45df2d;});}else{return _0x45df2d;}})[_0xf666('0x4a')](function(_0x28e064){logger[_0xf666('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28e064);throw _0x28e064;});}return _0x45df2d;})[_0xf666('0x29')](respondWithResult(_0xcf6f01,0xc9))[_0xf666('0x4a')](handleError(_0xcf6f01,null));};exports[_0xf666('0x56')]=function(_0x2f89b1,_0x545dda){if(_0x2f89b1[_0xf666('0x57')]['id']){delete _0x2f89b1[_0xf666('0x57')]['id'];}return db[_0xf666('0x34')]['find']({'where':{'id':_0x2f89b1[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x545dda,null))[_0xf666('0x29')](saveUpdates(_0x2f89b1[_0xf666('0x57')],null))[_0xf666('0x29')](respondWithResult(_0x545dda,null))[_0xf666('0x4a')](handleError(_0x545dda,null));};exports[_0xf666('0x2a')]=function(_0x2c0e5d,_0x3e11a6){return db[_0xf666('0x34')][_0xf666('0x4f')]({'where':{'id':_0x2c0e5d[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x3e11a6,null))['then'](removeEntity(_0x3e11a6,null))[_0xf666('0x4a')](handleError(_0x3e11a6,null));};exports[_0xf666('0x58')]=function(_0x27dc47,_0x1d3fb5,_0x3330ee){return db['SquareProject'][_0xf666('0x4f')]({'where':{'id':_0x27dc47[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x1d3fb5,null))[_0xf666('0x29')](function(_0x4ee3ed){if(_0x4ee3ed){return _0x4ee3ed[_0xf666('0x58')](_0x27dc47[_0xf666('0x57')][_0xf666('0x59')],_[_0xf666('0x5a')](_0x27dc47['body'],[_0xf666('0x59'),'id'])||{});}})[_0xf666('0x29')](respondWithResult(_0x1d3fb5,null))[_0xf666('0x4a')](handleError(_0x1d3fb5,null));};exports[_0xf666('0x5b')]=function(_0x1fec58,_0x2553f2,_0x4feefe){return db[_0xf666('0x34')][_0xf666('0x4f')]({'where':{'id':_0x1fec58[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x2553f2,null))[_0xf666('0x29')](function(_0x32d46b){if(_0x32d46b){return _0x32d46b[_0xf666('0x5b')](_0x1fec58[_0xf666('0x3c')][_0xf666('0x59')])[_0xf666('0x29')](function(){if(_['isArray'](_0x1fec58[_0xf666('0x3c')][_0xf666('0x59')])){for(var _0x35c9e4=0x0;_0x35c9e4<_0x1fec58['query'][_0xf666('0x59')][_0xf666('0x3e')];_0x35c9e4+=0x1){socket[_0xf666('0x5c')](_0xf666('0x5d'),{'UserId':Number(_0x1fec58['query'][_0xf666('0x59')][_0x35c9e4]),'SquareProjectId':Number(_0x1fec58['params']['id'])});}}else{socket[_0xf666('0x5c')]('userSquareProject:remove',{'UserId':Number(_0x1fec58[_0xf666('0x3c')][_0xf666('0x59')]),'SquareProjectId':Number(_0x1fec58[_0xf666('0x4c')]['id'])});}});}})[_0xf666('0x29')](respondWithStatusCode(_0x2553f2,null))[_0xf666('0x4a')](handleError(_0x2553f2,null));};exports[_0xf666('0x5e')]=function(_0x1acaab,_0x4decf6,_0xd57256){var _0x68c0a5={};var _0x2eb705={};var _0x2ebdbb;var _0x8c5318;return db[_0xf666('0x34')]['findOne']({'where':{'id':_0x1acaab[_0xf666('0x4c')]['id']}})[_0xf666('0x29')](handleEntityNotFound(_0x4decf6,null))[_0xf666('0x29')](function(_0x78fa36){if(_0x78fa36){_0x2ebdbb=_0x78fa36;_0x2eb705[_0xf666('0x3b')]=_[_0xf666('0x38')](db[_0xf666('0x5f')][_0xf666('0x35')]);_0x2eb705[_0xf666('0x3c')]=_[_0xf666('0x38')](_0x1acaab['query']);_0x2eb705[_0xf666('0x39')]=_['intersection'](_0x2eb705[_0xf666('0x3b')],_0x2eb705[_0xf666('0x3c')]);_0x68c0a5[_0xf666('0x3d')]=_[_0xf666('0x3a')](_0x2eb705[_0xf666('0x3b')],qs[_0xf666('0x4d')](_0x1acaab['query'][_0xf666('0x4d')]));_0x68c0a5[_0xf666('0x3d')]=_0x68c0a5[_0xf666('0x3d')]['length']?_0x68c0a5['attributes']:_0x2eb705[_0xf666('0x3b')];_0x68c0a5['order']=qs['sort'](_0x1acaab[_0xf666('0x3c')][_0xf666('0x41')]);_0x68c0a5[_0xf666('0x42')]=qs[_0xf666('0x39')](_[_0xf666('0x43')](_0x1acaab[_0xf666('0x3c')],_0x2eb705[_0xf666('0x39')]));if(_0x1acaab['query']['filter']){_0x68c0a5[_0xf666('0x42')]=_[_0xf666('0x45')](_0x68c0a5[_0xf666('0x42')],{'$or':_[_0xf666('0x33')](_0x68c0a5['attributes'],function(_0xb0af3a){var _0x3b9a00={};_0x3b9a00[_0xb0af3a]={'$like':'%'+_0x1acaab['query'][_0xf666('0x44')]+'%'};return _0x3b9a00;})});}_0x68c0a5=_['merge']({},_0x68c0a5,_0x1acaab[_0xf666('0x46')]);return _0x2ebdbb[_0xf666('0x5e')](_0x68c0a5);}})[_0xf666('0x29')](function(_0x1e3ba7){if(_0x1e3ba7){_0x8c5318=_0x1e3ba7[_0xf666('0x3e')];if(!_0x1acaab['query']['hasOwnProperty'](_0xf666('0x40'))){_0x68c0a5['limit']=qs[_0xf666('0x23')](_0x1acaab[_0xf666('0x3c')]['limit']);_0x68c0a5[_0xf666('0x20')]=qs[_0xf666('0x20')](_0x1acaab[_0xf666('0x3c')][_0xf666('0x20')]);}return _0x2ebdbb['getUsers'](_0x68c0a5);}})[_0xf666('0x29')](function(_0x5d2c09){if(_0x5d2c09){return _0x5d2c09?{'count':_0x8c5318,'rows':_0x5d2c09}:null;}})[_0xf666('0x29')](respondWithResult(_0x4decf6,null))['catch'](handleError(_0x4decf6,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d750338..34c50bb 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 _0xe7a1=['SquareProject','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2fff34,_0x55d6f0){var _0x74b33=function(_0x432a8f){while(--_0x432a8f){_0x2fff34['push'](_0x2fff34['shift']());}};_0x74b33(++_0x55d6f0);}(_0xe7a1,0xa8));var _0x1e7a=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xe7a1[_0x548627];return _0x844a84;};'use strict';var EventEmitter=require(_0x1e7a('0x0'));var SquareProject=require(_0x1e7a('0x1'))['db'][_0x1e7a('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1e7a('0x3')](0x0);var events={'afterCreate':_0x1e7a('0x4'),'afterUpdate':'update','afterDestroy':_0x1e7a('0x5')};function emitEvent(_0x4a8c9d){return function(_0x312457,_0x5ab512,_0x120c21){SquareProjectEvents[_0x1e7a('0x6')](_0x4a8c9d+':'+_0x312457['id'],_0x312457);SquareProjectEvents[_0x1e7a('0x6')](_0x4a8c9d,_0x312457);_0x120c21(null);};}for(var e in events){if(events[_0x1e7a('0x7')](e)){var event=events[e];SquareProject[_0x1e7a('0x8')](e,emitEvent(event));}}module[_0x1e7a('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xb773=['save','remove','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xb773,0x71));var _0x3b77=function(_0x4baf98,_0xa7ebd9){_0x4baf98=_0x4baf98-0x0;var _0x5da718=_0xb773[_0x4baf98];return _0x5da718;};'use strict';var EventEmitter=require(_0x3b77('0x0'));var SquareProject=require(_0x3b77('0x1'))['db'][_0x3b77('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x3b77('0x3')](0x0);var events={'afterCreate':_0x3b77('0x4'),'afterUpdate':'update','afterDestroy':_0x3b77('0x5')};function emitEvent(_0xa182ea){return function(_0x56dc68,_0x2e5472,_0x3c50cd){SquareProjectEvents['emit'](_0xa182ea+':'+_0x56dc68['id'],_0x56dc68);SquareProjectEvents['emit'](_0xa182ea,_0x56dc68);_0x3c50cd(null);};}for(var e in events){if(events[_0x3b77('0x6')](e)){var event=events[e];SquareProject[_0x3b77('0x7')](e,emitEvent(event));}}module[_0x3b77('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 6ab7a35..ca818e6 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 _0xe34b=['preproduction','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','format','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed'];(function(_0x4b4dd0,_0x4b7586){var _0x42da25=function(_0x48ed2c){while(--_0x48ed2c){_0x4b4dd0['push'](_0x4b4dd0['shift']());}};_0x42da25(++_0x4b7586);}(_0xe34b,0x16d));var _0xbe34=function(_0x53f897,_0x539857){_0x53f897=_0x53f897-0x0;var _0x6879f8=_0xe34b[_0x53f897];return _0x6879f8;};'use strict';var _=require('lodash');var util=require(_0xbe34('0x0'));var logger=require(_0xbe34('0x1'))(_0xbe34('0x2'));var moment=require(_0xbe34('0x3'));var BPromise=require(_0xbe34('0x4'));var rp=require(_0xbe34('0x5'));var fs=require('fs');var path=require(_0xbe34('0x6'));var rimraf=require(_0xbe34('0x7'));var config=require(_0xbe34('0x8'));var attributes=require(_0xbe34('0x9'));module[_0xbe34('0xa')]=function(_0x2dc9b5,_0x1dc5cb){return _0x2dc9b5[_0xbe34('0xb')](_0xbe34('0xc'),attributes,{'tableName':_0xbe34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd4abf4,_0xc06b6c,_0x396dec){if(_0xd4abf4[_0xbe34('0xe')](_0xbe34('0xf'))){_0xd4abf4['savedAt']=moment()['format'](_0xbe34('0x10'));}if(_0xd4abf4[_0xbe34('0xe')](_0xbe34('0x11'))){_0xd4abf4[_0xbe34('0x12')]=moment()[_0xbe34('0x13')]('YYYY-MM-DD\x20HH:mm:ss');}_0x396dec(null,_0xd4abf4);}}});}; \ No newline at end of file +var _0x589a=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird'];(function(_0x5cafc2,_0x534e3a){var _0x840ac4=function(_0x4c5989){while(--_0x4c5989){_0x5cafc2['push'](_0x5cafc2['shift']());}};_0x840ac4(++_0x534e3a);}(_0x589a,0x1e9));var _0xa589=function(_0xf2a4d1,_0x325e57){_0xf2a4d1=_0xf2a4d1-0x0;var _0x201cfd=_0x589a[_0xf2a4d1];return _0x201cfd;};'use strict';var _=require(_0xa589('0x0'));var util=require('util');var logger=require(_0xa589('0x1'))('api');var moment=require(_0xa589('0x2'));var BPromise=require(_0xa589('0x3'));var rp=require(_0xa589('0x4'));var fs=require('fs');var path=require(_0xa589('0x5'));var rimraf=require(_0xa589('0x6'));var config=require(_0xa589('0x7'));var attributes=require(_0xa589('0x8'));module[_0xa589('0x9')]=function(_0x1b889a,_0x421ce8){return _0x1b889a[_0xa589('0xa')]('SquareProject',attributes,{'tableName':_0xa589('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5bea03,_0x40552c,_0x51708b){if(_0x5bea03[_0xa589('0xc')](_0xa589('0xd'))){_0x5bea03[_0xa589('0xe')]=moment()[_0xa589('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x5bea03[_0xa589('0xc')]('production')){_0x5bea03['publishedAt']=moment()[_0xa589('0xf')](_0xa589('0x10'));}_0x51708b(null,_0x5bea03);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index fa7c06e..1bd08ed 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 _0x6c28=['attributes','include','map','model','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareProject','options','raw'];(function(_0x4a0b4a,_0x58e292){var _0x4f3ebe=function(_0x23d595){while(--_0x23d595){_0x4a0b4a['push'](_0x4a0b4a['shift']());}};_0x4f3ebe(++_0x58e292);}(_0x6c28,0x65));var _0x86c2=function(_0x2caf51,_0x220492){_0x2caf51=_0x2caf51-0x0;var _0x545aba=_0x6c28[_0x2caf51];return _0x545aba;};'use strict';var _=require(_0x86c2('0x0'));var util=require('util');var moment=require(_0x86c2('0x1'));var BPromise=require(_0x86c2('0x2'));var rs=require(_0x86c2('0x3'));var fs=require('fs');var Redis=require(_0x86c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x86c2('0x5'));var logger=require('../../config/logger')(_0x86c2('0x6'));var config=require(_0x86c2('0x7'));var jayson=require(_0x86c2('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x86c2('0x9')],{'host':_0x86c2('0xa'),'port':0x18eb});var socket=require(_0x86c2('0xb'))(new Redis(config[_0x86c2('0x9')]));require('./squareProject.socket')[_0x86c2('0xc')](socket);function respondWithRpcPromise(_0xe71dde,_0xb88ca1,_0x5f3aa0){return new BPromise(function(_0x5e250f,_0x31a47a){return client['request'](_0xe71dde,_0x5f3aa0)[_0x86c2('0xd')](function(_0x3a12c2){logger[_0x86c2('0xe')](_0x86c2('0xf'),_0xb88ca1,_0x86c2('0x10'));logger[_0x86c2('0x11')](_0x86c2('0x12'),_0xb88ca1,'request\x20sent',JSON[_0x86c2('0x13')](_0x3a12c2));if(_0x3a12c2[_0x86c2('0x14')]){if(_0x3a12c2['error'][_0x86c2('0x15')]===0x1f4){logger['error'](_0x86c2('0xf'),_0xb88ca1,_0x3a12c2[_0x86c2('0x14')][_0x86c2('0x16')]);return _0x31a47a(_0x3a12c2[_0x86c2('0x14')]['message']);}logger[_0x86c2('0x14')]('SquareProject,\x20%s,\x20%s',_0xb88ca1,_0x3a12c2[_0x86c2('0x14')][_0x86c2('0x16')]);return _0x5e250f(_0x3a12c2['error']['message']);}else{logger['info'](_0x86c2('0xf'),_0xb88ca1,'request\x20sent');_0x5e250f(_0x3a12c2[_0x86c2('0x17')][_0x86c2('0x16')]);}})['catch'](function(_0x7cec87){logger[_0x86c2('0x14')](_0x86c2('0xf'),_0xb88ca1,_0x7cec87);_0x31a47a(_0x7cec87);});});}exports[_0x86c2('0x18')]=function(_0x451f5f){var _0x584122=this;return new Promise(function(_0x2c69d3,_0xde8ee1){return db['SquareProject']['find']({'raw':_0x451f5f[_0x86c2('0x19')]?_0x451f5f[_0x86c2('0x19')][_0x86c2('0x1a')]===undefined?!![]:![]:!![],'where':_0x451f5f[_0x86c2('0x19')]?_0x451f5f[_0x86c2('0x19')]['where']||null:null,'attributes':_0x451f5f[_0x86c2('0x19')]?_0x451f5f[_0x86c2('0x19')][_0x86c2('0x1b')]||null:null,'include':_0x451f5f[_0x86c2('0x19')]?_0x451f5f[_0x86c2('0x19')][_0x86c2('0x1c')]?_[_0x86c2('0x1d')](_0x451f5f['options'][_0x86c2('0x1c')],function(_0x1ef60f){return{'model':db[_0x1ef60f[_0x86c2('0x1e')]],'as':_0x1ef60f['as'],'attributes':_0x1ef60f[_0x86c2('0x1b')],'include':_0x1ef60f[_0x86c2('0x1c')]?_[_0x86c2('0x1d')](_0x1ef60f[_0x86c2('0x1c')],function(_0x3491e2){return{'model':db[_0x3491e2[_0x86c2('0x1e')]],'as':_0x3491e2['as'],'attributes':_0x3491e2['attributes'],'include':_0x3491e2[_0x86c2('0x1c')]?_[_0x86c2('0x1d')](_0x3491e2[_0x86c2('0x1c')],function(_0xd5025a){return{'model':db[_0xd5025a[_0x86c2('0x1e')]],'as':_0xd5025a['as'],'attributes':_0xd5025a['attributes']};}):[]};}):[]};}):[]:[]})[_0x86c2('0xd')](function(_0x479bfe){logger[_0x86c2('0xe')]('ShowSquareProject',_0x451f5f);logger[_0x86c2('0x11')]('ShowSquareProject',_0x451f5f,JSON['stringify'](_0x479bfe));_0x2c69d3(_0x479bfe);})[_0x86c2('0x1f')](function(_0x1fb727){logger[_0x86c2('0x14')](_0x86c2('0x18'),_0x1fb727['message'],_0x451f5f);_0xde8ee1(_0x584122['error'](0x1f4,_0x1fb727[_0x86c2('0x16')]));});});}; \ No newline at end of file +var _0xa4c2=['client','http','defaults','socket.io-emitter','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','debug','SquareProject,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','lodash','moment','../../config/logger','rpc','jayson/promise'];(function(_0x1ecbd5,_0xf05f7c){var _0x1be527=function(_0x6ca991){while(--_0x6ca991){_0x1ecbd5['push'](_0x1ecbd5['shift']());}};_0x1be527(++_0xf05f7c);}(_0xa4c2,0x9b));var _0x2a4c=function(_0x4be01f,_0x2cd166){_0x4be01f=_0x4be01f-0x0;var _0x15b16b=_0xa4c2[_0x4be01f];return _0x15b16b;};'use strict';var _=require(_0x2a4c('0x0'));var util=require('util');var moment=require(_0x2a4c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2a4c('0x2'))(_0x2a4c('0x3'));var config=require('../../config/environment');var jayson=require(_0x2a4c('0x4'));var client=jayson[_0x2a4c('0x5')][_0x2a4c('0x6')]({'port':0x232a});config['redis']=_[_0x2a4c('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2a4c('0x8'))(new Redis(config['redis']));require(_0x2a4c('0x9'))['register'](socket);function respondWithRpcPromise(_0x406ab8,_0x4948cd,_0x11e347){return new BPromise(function(_0x539cfa,_0x213183){return client[_0x2a4c('0xa')](_0x406ab8,_0x11e347)['then'](function(_0x7d69fc){logger[_0x2a4c('0xb')](_0x2a4c('0xc'),_0x4948cd,'request\x20sent');logger[_0x2a4c('0xd')](_0x2a4c('0xe'),_0x4948cd,_0x2a4c('0xf'),JSON['stringify'](_0x7d69fc));if(_0x7d69fc['error']){if(_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x11')]===0x1f4){logger['error'](_0x2a4c('0xc'),_0x4948cd,_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);return _0x213183(_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);}logger[_0x2a4c('0x10')]('SquareProject,\x20%s,\x20%s',_0x4948cd,_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);return _0x539cfa(_0x7d69fc[_0x2a4c('0x10')][_0x2a4c('0x12')]);}else{logger[_0x2a4c('0xb')](_0x2a4c('0xc'),_0x4948cd,_0x2a4c('0xf'));_0x539cfa(_0x7d69fc[_0x2a4c('0x13')]['message']);}})[_0x2a4c('0x14')](function(_0x456f09){logger['error'](_0x2a4c('0xc'),_0x4948cd,_0x456f09);_0x213183(_0x456f09);});});}exports[_0x2a4c('0x15')]=function(_0x4b5c8f){var _0x5f11d5=this;return new Promise(function(_0x4a10f6,_0x53ea2d){return db[_0x2a4c('0x16')][_0x2a4c('0x17')]({'raw':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x19')]===undefined?!![]:![]:!![],'where':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x1a')]||null:null,'attributes':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x1b')]||null:null,'include':_0x4b5c8f[_0x2a4c('0x18')]?_0x4b5c8f[_0x2a4c('0x18')][_0x2a4c('0x1c')]?_[_0x2a4c('0x1d')](_0x4b5c8f[_0x2a4c('0x18')]['include'],function(_0x24c6cd){return{'model':db[_0x24c6cd[_0x2a4c('0x1e')]],'as':_0x24c6cd['as'],'attributes':_0x24c6cd[_0x2a4c('0x1b')],'include':_0x24c6cd[_0x2a4c('0x1c')]?_[_0x2a4c('0x1d')](_0x24c6cd[_0x2a4c('0x1c')],function(_0x4391c0){return{'model':db[_0x4391c0[_0x2a4c('0x1e')]],'as':_0x4391c0['as'],'attributes':_0x4391c0['attributes'],'include':_0x4391c0[_0x2a4c('0x1c')]?_['map'](_0x4391c0['include'],function(_0x2301f9){return{'model':db[_0x2301f9[_0x2a4c('0x1e')]],'as':_0x2301f9['as'],'attributes':_0x2301f9[_0x2a4c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2a4c('0x1f')](function(_0x46e0de){logger[_0x2a4c('0xb')](_0x2a4c('0x15'),_0x4b5c8f);logger[_0x2a4c('0xd')](_0x2a4c('0x15'),_0x4b5c8f,JSON['stringify'](_0x46e0de));_0x4a10f6(_0x46e0de);})[_0x2a4c('0x14')](function(_0x4544b9){logger[_0x2a4c('0x10')](_0x2a4c('0x15'),_0x4544b9[_0x2a4c('0x12')],_0x4b5c8f);_0x53ea2d(_0x5f11d5[_0x2a4c('0x10')](0x1f4,_0x4544b9[_0x2a4c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 3646d46..e1f8374 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 _0xbc38=['update','emit','removeListener','register','length','./squareProject.events','save','remove'];(function(_0x46e7d7,_0x360477){var _0x336b00=function(_0x41eacf){while(--_0x41eacf){_0x46e7d7['push'](_0x46e7d7['shift']());}};_0x336b00(++_0x360477);}(_0xbc38,0xcd));var _0x8bc3=function(_0x402dbb,_0x22a80f){_0x402dbb=_0x402dbb-0x0;var _0x69b4b=_0xbc38[_0x402dbb];return _0x69b4b;};'use strict';var SquareProjectEvents=require(_0x8bc3('0x0'));var events=[_0x8bc3('0x1'),_0x8bc3('0x2'),_0x8bc3('0x3')];function createListener(_0x244817,_0x1e30dc){return function(_0x39332e){_0x1e30dc[_0x8bc3('0x4')](_0x244817,_0x39332e);};}function removeListener(_0x2e0e1c,_0x1da743){return function(){SquareProjectEvents[_0x8bc3('0x5')](_0x2e0e1c,_0x1da743);};}exports[_0x8bc3('0x6')]=function(_0x5e7475){for(var _0x3d2dc4=0x0,_0x6654d2=events[_0x8bc3('0x7')];_0x3d2dc4<_0x6654d2;_0x3d2dc4++){var _0xe07434=events[_0x3d2dc4];var _0x4bdc9f=createListener('squareProject:'+_0xe07434,_0x5e7475);SquareProjectEvents['on'](_0xe07434,_0x4bdc9f);}}; \ No newline at end of file +var _0x9ee1=['length','./squareProject.events','save','update','removeListener','register'];(function(_0x31e72b,_0x569bd7){var _0x164fbf=function(_0x1e73e3){while(--_0x1e73e3){_0x31e72b['push'](_0x31e72b['shift']());}};_0x164fbf(++_0x569bd7);}(_0x9ee1,0xd3));var _0x19ee=function(_0x33e668,_0x31c483){_0x33e668=_0x33e668-0x0;var _0xb1cf46=_0x9ee1[_0x33e668];return _0xb1cf46;};'use strict';var SquareProjectEvents=require(_0x19ee('0x0'));var events=[_0x19ee('0x1'),'remove',_0x19ee('0x2')];function createListener(_0x5f46f5,_0x3513e1){return function(_0x3a1e5e){_0x3513e1['emit'](_0x5f46f5,_0x3a1e5e);};}function removeListener(_0x4d703f,_0x1ddffd){return function(){SquareProjectEvents[_0x19ee('0x3')](_0x4d703f,_0x1ddffd);};}exports[_0x19ee('0x4')]=function(_0x430637){for(var _0x1cb505=0x0,_0x49a3cb=events[_0x19ee('0x5')];_0x1cb505<_0x49a3cb;_0x1cb505++){var _0x1a942b=events[_0x1cb505];var _0x5f1c14=createListener('squareProject:'+_0x1a942b,_0x430637);SquareProjectEvents['on'](_0x1a942b,_0x5f1c14);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 619208a..75da134 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 _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x1aec51,_0x3810ad){var _0x178a93=function(_0x43459c){while(--_0x43459c){_0x1aec51['push'](_0x1aec51['shift']());}};_0x178a93(++_0x3810ad);}(_0x53ec,0x192));var _0xc53e=function(_0x82a071,_0x252266){_0x82a071=_0x82a071-0x0;var _0x15dda9=_0x53ec[_0x82a071];return _0x15dda9;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file +var _0x7a54=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x1fc7c3,_0x3d1920){var _0x4aa618=function(_0xedd285){while(--_0xedd285){_0x1fc7c3['push'](_0x1fc7c3['shift']());}};_0x4aa618(++_0x3d1920);}(_0x7a54,0x106));var _0x47a5=function(_0x12e8cd,_0x170da6){_0x12e8cd=_0x12e8cd-0x0;var _0x2cab46=_0x7a54[_0x12e8cd];return _0x2cab46;};'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/download',auth['isAuthenticated'](),controller['download']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);module[_0x47a5('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index ad48bbb..0eaff69 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 _0x33c5=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf','exports'];(function(_0x1f78f1,_0x999b5){var _0x37f1da=function(_0xcaeb2b){while(--_0xcaeb2b){_0x1f78f1['push'](_0x1f78f1['shift']());}};_0x37f1da(++_0x999b5);}(_0x33c5,0xe6));var _0x533c=function(_0x239dba,_0x309e95){_0x239dba=_0x239dba-0x0;var _0x1ceb11=_0x33c5[_0x239dba];return _0x1ceb11;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'uniqueid':{'type':Sequelize[_0x533c('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x533c('0x1')]},'context':{'type':Sequelize[_0x533c('0x1')]},'extension':{'type':Sequelize[_0x533c('0x1')]},'priority':{'type':Sequelize[_0x533c('0x1')]},'accountcode':{'type':Sequelize[_0x533c('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x533c('0x1')]},'saveName':{'type':Sequelize[_0x533c('0x1')]},'filename':{'type':Sequelize[_0x533c('0x1')]},'savePath':{'type':Sequelize[_0x533c('0x1')]},'format':{'type':Sequelize[_0x533c('0x2')],'get':function(){var _0x1699d5='';var _0x3a009b=this[_0x533c('0x3')](_0x533c('0x4'));if(_0x3a009b){_0x1699d5=_0x3a009b[_0x533c('0x5')](_0x3a009b[_0x533c('0x6')]('.'));}return _0x1699d5;}}}; \ No newline at end of file +var _0x46ed=['sequelize','exports','STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x46ed,0x168));var _0xd46e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x46ed[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xd46e('0x0'));module[_0xd46e('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd46e('0x2')]},'calleridname':{'type':Sequelize[_0xd46e('0x2')]},'context':{'type':Sequelize[_0xd46e('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd46e('0x2')]},'accountcode':{'type':Sequelize[_0xd46e('0x2')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd46e('0x2')]},'saveName':{'type':Sequelize[_0xd46e('0x2')]},'filename':{'type':Sequelize[_0xd46e('0x2')]},'savePath':{'type':Sequelize[_0xd46e('0x2')]},'format':{'type':Sequelize[_0xd46e('0x3')],'get':function(){var _0x855f24='';var _0x437ea0=this[_0xd46e('0x4')](_0xd46e('0x5'));if(_0x437ea0){_0x855f24=_0x437ea0[_0xd46e('0x6')](_0x437ea0[_0xd46e('0x7')]('.'));}return _0x855f24;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 5d05a82..9c11ef4 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 _0xc6aa=['SquareRecording\x20not\x20found','filename','extname','unlink','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareRecording','findAll','rows','catch','show','params','include','find','create','body','download','uniqueid','savePath','format','%s.cypher','existsSync','secrets','recording','Sequelize'];(function(_0x5bed56,_0x35cfcc){var _0x224914=function(_0x883f1c){while(--_0x883f1c){_0x5bed56['push'](_0x5bed56['shift']());}};_0x224914(++_0x35cfcc);}(_0xc6aa,0x6e));var _0xac6a=function(_0x21b04f,_0x23c9a0){_0x21b04f=_0x21b04f-0x0;var _0x408568=_0xc6aa[_0x21b04f];return _0x408568;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac6a('0x0'));var zipdir=require(_0xac6a('0x1'));var jsonpatch=require(_0xac6a('0x2'));var rp=require(_0xac6a('0x3'));var moment=require(_0xac6a('0x4'));var BPromise=require(_0xac6a('0x5'));var Mustache=require('mustache');var util=require(_0xac6a('0x6'));var path=require(_0xac6a('0x7'));var sox=require('sox');var csv=require(_0xac6a('0x8'));var ejs=require(_0xac6a('0x9'));var fs=require('fs');var fs_extra=require(_0xac6a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xac6a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xac6a('0xc'));var toCsv=require(_0xac6a('0x8'));var querystring=require(_0xac6a('0xd'));var Papa=require(_0xac6a('0xe'));var Redis=require('ioredis');var authService=require(_0xac6a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xac6a('0x10'));var hardwareService=require(_0xac6a('0x11'));var logger=require(_0xac6a('0x12'))(_0xac6a('0x13'));var utils=require(_0xac6a('0x14'));var config=require(_0xac6a('0x15'));var licenseUtil=require(_0xac6a('0x16'));var db=require(_0xac6a('0x17'))['db'];function respondWithStatusCode(_0x1f306d,_0x5a1c4d){_0x5a1c4d=_0x5a1c4d||0xcc;return function(_0x485ee7){if(_0x485ee7){return _0x1f306d[_0xac6a('0x18')](_0x5a1c4d);}return _0x1f306d[_0xac6a('0x19')](_0x5a1c4d)[_0xac6a('0x1a')]();};}function respondWithResult(_0xc74489,_0x36cf51){_0x36cf51=_0x36cf51||0xc8;return function(_0x429810){if(_0x429810){return _0xc74489['status'](_0x36cf51)[_0xac6a('0x1b')](_0x429810);}};}function respondWithFilteredResult(_0x4346d6,_0x44b7e6){return function(_0xa9a851){if(_0xa9a851){var _0x3f593a=typeof _0x44b7e6[_0xac6a('0x1c')]==='undefined'&&typeof _0x44b7e6['limit']===_0xac6a('0x1d');var _0x43fa8f=_0xa9a851['count'];var _0x5ac96b=_0x3f593a?0x0:_0x44b7e6[_0xac6a('0x1c')];var _0x3700bb=_0x3f593a?_0xa9a851[_0xac6a('0x1e')]:_0x44b7e6[_0xac6a('0x1c')]+_0x44b7e6[_0xac6a('0x1f')];var _0x546368;if(_0x3700bb>=_0x43fa8f){_0x3700bb=_0x43fa8f;_0x546368=0xc8;}else{_0x546368=0xce;}_0x4346d6[_0xac6a('0x19')](_0x546368);return _0x4346d6[_0xac6a('0x20')](_0xac6a('0x21'),_0x5ac96b+'-'+_0x3700bb+'/'+_0x43fa8f)[_0xac6a('0x1b')](_0xa9a851);}return null;};}function patchUpdates(_0x466897){return function(_0x554634){try{jsonpatch['apply'](_0x554634,_0x466897,!![]);}catch(_0x19673a){return BPromise[_0xac6a('0x22')](_0x19673a);}return _0x554634[_0xac6a('0x23')]();};}function saveUpdates(_0x59b4f5,_0x282439){return function(_0x1ec2ec){if(_0x1ec2ec){return _0x1ec2ec[_0xac6a('0x24')](_0x59b4f5)['then'](function(_0x4c87d7){return _0x4c87d7;});}return null;};}function removeEntity(_0x30fd66,_0x432e12){return function(_0x23911a){if(_0x23911a){return _0x23911a[_0xac6a('0x25')]()[_0xac6a('0x26')](function(){_0x30fd66[_0xac6a('0x19')](0xcc)[_0xac6a('0x1a')]();});}};}function handleEntityNotFound(_0x5232ac,_0x2c626c){return function(_0x112670){if(!_0x112670){_0x5232ac[_0xac6a('0x18')](0x194);}return _0x112670;};}function handleError(_0x59a0d2,_0xdea3ff){_0xdea3ff=_0xdea3ff||0x1f4;return function(_0x33e7bf){logger[_0xac6a('0x27')](_0x33e7bf[_0xac6a('0x28')]);if(_0x33e7bf['name']){delete _0x33e7bf[_0xac6a('0x29')];}_0x59a0d2['status'](_0xdea3ff)[_0xac6a('0x2a')](_0x33e7bf);};}exports[_0xac6a('0x2b')]=function(_0x43e717,_0x35ccaf){var _0x136204={},_0x132642={},_0xbcca61={'count':0x0,'rows':[]};var _0x202364=_[_0xac6a('0x2c')](db['SquareRecording'][_0xac6a('0x2d')],function(_0x326584){return{'name':_0x326584[_0xac6a('0x2e')],'type':_0x326584[_0xac6a('0x2f')][_0xac6a('0x30')]};});_0x132642['model']=_[_0xac6a('0x2c')](_0x202364,'name');_0x132642[_0xac6a('0x31')]=_[_0xac6a('0x32')](_0x43e717[_0xac6a('0x31')]);_0x132642[_0xac6a('0x33')]=_[_0xac6a('0x34')](_0x132642[_0xac6a('0x35')],_0x132642[_0xac6a('0x31')]);_0x136204['attributes']=_['intersection'](_0x132642[_0xac6a('0x35')],qs[_0xac6a('0x36')](_0x43e717[_0xac6a('0x31')][_0xac6a('0x36')]));_0x136204[_0xac6a('0x37')]=_0x136204[_0xac6a('0x37')][_0xac6a('0x38')]?_0x136204[_0xac6a('0x37')]:_0x132642[_0xac6a('0x35')];if(!_0x43e717[_0xac6a('0x31')][_0xac6a('0x39')](_0xac6a('0x3a'))){_0x136204['limit']=qs[_0xac6a('0x1f')](_0x43e717[_0xac6a('0x31')][_0xac6a('0x1f')]);_0x136204[_0xac6a('0x1c')]=qs[_0xac6a('0x1c')](_0x43e717['query'][_0xac6a('0x1c')]);}_0x136204[_0xac6a('0x3b')]=qs[_0xac6a('0x3c')](_0x43e717[_0xac6a('0x31')]['sort']);_0x136204[_0xac6a('0x3d')]=qs['filters'](_[_0xac6a('0x3e')](_0x43e717[_0xac6a('0x31')],_0x132642['filters']),_0x202364);if(_0x43e717['query']['filter']){_0x136204['where']=_[_0xac6a('0x3f')](_0x136204[_0xac6a('0x3d')],{'$or':_[_0xac6a('0x2c')](_0x202364,function(_0x303e17){if(_0x303e17['type']!==_0xac6a('0x40')){var _0x3958cf={};_0x3958cf[_0x303e17[_0xac6a('0x29')]]={'$like':'%'+_0x43e717[_0xac6a('0x31')][_0xac6a('0x41')]+'%'};return _0x3958cf;}})});}_0x136204=_[_0xac6a('0x3f')]({},_0x136204,_0x43e717[_0xac6a('0x42')]);var _0x40d0c0={'where':_0x136204['where']};return db[_0xac6a('0x43')]['count'](_0x40d0c0)['then'](function(_0x51bcdc){_0xbcca61[_0xac6a('0x1e')]=_0x51bcdc;if(_0x43e717[_0xac6a('0x31')]['includeAll']){_0x136204['include']=[{'all':!![]}];}return db[_0xac6a('0x43')][_0xac6a('0x44')](_0x136204);})[_0xac6a('0x26')](function(_0x241b75){_0xbcca61[_0xac6a('0x45')]=_0x241b75;return _0xbcca61;})[_0xac6a('0x26')](respondWithFilteredResult(_0x35ccaf,_0x136204))[_0xac6a('0x46')](handleError(_0x35ccaf,null));};exports[_0xac6a('0x47')]=function(_0x479d44,_0x48bd81){var _0x223d5a={'raw':!![],'where':{'id':_0x479d44[_0xac6a('0x48')]['id']}},_0x84c5ab={};_0x84c5ab[_0xac6a('0x35')]=_[_0xac6a('0x32')](db[_0xac6a('0x43')][_0xac6a('0x2d')]);_0x84c5ab['query']=_[_0xac6a('0x32')](_0x479d44[_0xac6a('0x31')]);_0x84c5ab[_0xac6a('0x33')]=_[_0xac6a('0x34')](_0x84c5ab[_0xac6a('0x35')],_0x84c5ab[_0xac6a('0x31')]);_0x223d5a['attributes']=_['intersection'](_0x84c5ab[_0xac6a('0x35')],qs[_0xac6a('0x36')](_0x479d44[_0xac6a('0x31')]['fields']));_0x223d5a[_0xac6a('0x37')]=_0x223d5a['attributes']['length']?_0x223d5a[_0xac6a('0x37')]:_0x84c5ab[_0xac6a('0x35')];if(_0x479d44[_0xac6a('0x31')]['includeAll']){_0x223d5a[_0xac6a('0x49')]=[{'all':!![]}];}_0x223d5a=_[_0xac6a('0x3f')]({},_0x223d5a,_0x479d44[_0xac6a('0x42')]);return db[_0xac6a('0x43')][_0xac6a('0x4a')](_0x223d5a)[_0xac6a('0x26')](handleEntityNotFound(_0x48bd81,null))[_0xac6a('0x26')](respondWithResult(_0x48bd81,null))[_0xac6a('0x46')](handleError(_0x48bd81,null));};exports['create']=function(_0x2036fe,_0x493e59){return db[_0xac6a('0x43')][_0xac6a('0x4b')](_0x2036fe[_0xac6a('0x4c')],{})[_0xac6a('0x26')](respondWithResult(_0x493e59,0xc9))[_0xac6a('0x46')](handleError(_0x493e59,null));};exports[_0xac6a('0x24')]=function(_0x4dd4b9,_0x18afa1){if(_0x4dd4b9[_0xac6a('0x4c')]['id']){delete _0x4dd4b9[_0xac6a('0x4c')]['id'];}return db['SquareRecording'][_0xac6a('0x4a')]({'where':{'id':_0x4dd4b9[_0xac6a('0x48')]['id']}})[_0xac6a('0x26')](handleEntityNotFound(_0x18afa1,null))[_0xac6a('0x26')](saveUpdates(_0x4dd4b9[_0xac6a('0x4c')],null))[_0xac6a('0x26')](respondWithResult(_0x18afa1,null))[_0xac6a('0x46')](handleError(_0x18afa1,null));};exports[_0xac6a('0x4d')]=function(_0x147ffb,_0x51c9e8,_0x2d8251){var _0x130858=require('../../components/encryptor');var _0x33d5ae=![];var _0x2ab6c2={};if(_0x147ffb[_0xac6a('0x31')][_0xac6a('0x2f')]&&_0x147ffb['query'][_0xac6a('0x2f')]===_0xac6a('0x4e')){_0x2ab6c2[_0xac6a('0x4e')]=_0x147ffb[_0xac6a('0x48')]['id'];}else{_0x2ab6c2['id']=_0x147ffb[_0xac6a('0x48')]['id'];}return db[_0xac6a('0x43')][_0xac6a('0x4a')]({'where':_0x2ab6c2,'attributes':['id',_0xac6a('0x4f'),'filename'],'raw':!![]})[_0xac6a('0x26')](handleEntityNotFound(_0x51c9e8,null))[_0xac6a('0x26')](function(_0xdaced0){if(_0xdaced0){var _0x36b8a2=_0xdaced0[_0xac6a('0x4f')];var _0x504ff2=util[_0xac6a('0x50')](_0xac6a('0x51'),_0x36b8a2);if(fs[_0xac6a('0x52')](_0x504ff2)){_0x33d5ae=!![];return _0x130858['decryptFile'](_0x504ff2,_0x36b8a2,config[_0xac6a('0x53')][_0xac6a('0x54')])[_0xac6a('0x26')](function(){return _0xdaced0;});}return _0xdaced0;}})[_0xac6a('0x26')](function(_0x545a4c){if(_0x545a4c){var _0x45eb87=_0x545a4c[_0xac6a('0x4f')];if(!fs[_0xac6a('0x52')](_0x45eb87)){throw new db[(_0xac6a('0x55'))]['ValidationError'](_0xac6a('0x56'));}if(_0x545a4c[_0xac6a('0x57')]){return _0x51c9e8[_0xac6a('0x4d')](_0x45eb87,_0x545a4c[_0xac6a('0x57')]+path[_0xac6a('0x58')](_0x45eb87),function(){if(_0x33d5ae){fs[_0xac6a('0x59')](_0x45eb87);}});}else{return _0x51c9e8['download'](_0x45eb87,function(_0x41fc0b){if(_0x33d5ae){fs['unlink'](_0x45eb87);}});}}})[_0xac6a('0x46')](function(_0x47c7ce){if(_0x47c7ce['message']===_0xac6a('0x56')){_0x51c9e8['status'](0x194)['send'](_0xac6a('0x5a'));}else{return handleError(_0x51c9e8,null);}});};exports[_0xac6a('0x25')]=function(_0xb23526,_0xc5120b){return db['SquareRecording']['find']({'where':{'id':_0xb23526[_0xac6a('0x48')]['id']}})[_0xac6a('0x26')](function(_0x7245e4){if(_['isNil'](_0x7245e4)){throw new ReferenceError(_0xac6a('0x5b'));}return _0x7245e4;})[_0xac6a('0x26')](function(_0xfe64c6){var _0x22cd32=_0xfe64c6[_0xac6a('0x4f')];logger[_0xac6a('0x5c')](_0xac6a('0x5d'),_0x22cd32);if(!_['isNil'](_0xfe64c6['savePath'])&&fs[_0xac6a('0x52')](_0x22cd32)){logger[_0xac6a('0x5c')](_0xac6a('0x5e')+_0x22cd32+_0xac6a('0x5f'));fs[_0xac6a('0x60')](_0x22cd32);}_0x22cd32=_0x22cd32+_0xac6a('0x61');if(!_['isNil'](_0xfe64c6[_0xac6a('0x4f')])&&fs[_0xac6a('0x52')](_0x22cd32)){logger['info'](_0xac6a('0x5e')+_0x22cd32+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xac6a('0x60')](_0x22cd32);}return _0xfe64c6;})[_0xac6a('0x26')](function(_0x32c24e){if(!_0x32c24e)throw new InternalError();return _0x32c24e['destroy']();})[_0xac6a('0x26')](function(){_0xc5120b[_0xac6a('0x19')](0xcc)['end']();})[_0xac6a('0x46')](handleError(_0xc5120b,null));}; \ No newline at end of file +var _0x1de2=['save','update','then','destroy','stack','name','send','index','map','SquareRecording','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','params','rawAttributes','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','secrets','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject'];(function(_0x3b372a,_0x3f367c){var _0x58319a=function(_0x5ee3d4){while(--_0x5ee3d4){_0x3b372a['push'](_0x3b372a['shift']());}};_0x58319a(++_0x3f367c);}(_0x1de2,0x163));var _0x21de=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x1de2[_0x52666e];return _0x515330;};'use strict';var emlformat=require(_0x21de('0x0'));var rimraf=require(_0x21de('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x21de('0x2'));var rp=require(_0x21de('0x3'));var moment=require('moment');var BPromise=require(_0x21de('0x4'));var Mustache=require(_0x21de('0x5'));var util=require(_0x21de('0x6'));var path=require('path');var sox=require(_0x21de('0x7'));var csv=require('to-csv');var ejs=require(_0x21de('0x8'));var fs=require('fs');var fs_extra=require(_0x21de('0x9'));var _=require(_0x21de('0xa'));var squel=require(_0x21de('0xb'));var crypto=require(_0x21de('0xc'));var jsforce=require(_0x21de('0xd'));var deskjs=require(_0x21de('0xe'));var toCsv=require(_0x21de('0xf'));var querystring=require('querystring');var Papa=require(_0x21de('0x10'));var Redis=require(_0x21de('0x11'));var authService=require(_0x21de('0x12'));var qs=require(_0x21de('0x13'));var as=require(_0x21de('0x14'));var hardwareService=require(_0x21de('0x15'));var logger=require('../../config/logger')(_0x21de('0x16'));var utils=require(_0x21de('0x17'));var config=require(_0x21de('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x21de('0x19'))['db'];function respondWithStatusCode(_0x3711b1,_0x276f4c){_0x276f4c=_0x276f4c||0xcc;return function(_0x1f4dcc){if(_0x1f4dcc){return _0x3711b1[_0x21de('0x1a')](_0x276f4c);}return _0x3711b1['status'](_0x276f4c)[_0x21de('0x1b')]();};}function respondWithResult(_0x4530b2,_0x4f19f2){_0x4f19f2=_0x4f19f2||0xc8;return function(_0x4e487a){if(_0x4e487a){return _0x4530b2[_0x21de('0x1c')](_0x4f19f2)[_0x21de('0x1d')](_0x4e487a);}};}function respondWithFilteredResult(_0x2e077c,_0x5506d1){return function(_0x97c43){if(_0x97c43){var _0x4a51ff=typeof _0x5506d1[_0x21de('0x1e')]===_0x21de('0x1f')&&typeof _0x5506d1['limit']==='undefined';var _0x54a6e6=_0x97c43['count'];var _0x497c1a=_0x4a51ff?0x0:_0x5506d1['offset'];var _0x4a7b61=_0x4a51ff?_0x97c43['count']:_0x5506d1['offset']+_0x5506d1[_0x21de('0x20')];var _0x8082c2;if(_0x4a7b61>=_0x54a6e6){_0x4a7b61=_0x54a6e6;_0x8082c2=0xc8;}else{_0x8082c2=0xce;}_0x2e077c[_0x21de('0x1c')](_0x8082c2);return _0x2e077c[_0x21de('0x21')](_0x21de('0x22'),_0x497c1a+'-'+_0x4a7b61+'/'+_0x54a6e6)[_0x21de('0x1d')](_0x97c43);}return null;};}function patchUpdates(_0x396fbf){return function(_0x4a12c1){try{jsonpatch[_0x21de('0x23')](_0x4a12c1,_0x396fbf,!![]);}catch(_0x529276){return BPromise[_0x21de('0x24')](_0x529276);}return _0x4a12c1[_0x21de('0x25')]();};}function saveUpdates(_0x1ea844,_0xaee86b){return function(_0x501169){if(_0x501169){return _0x501169[_0x21de('0x26')](_0x1ea844)[_0x21de('0x27')](function(_0x549a50){return _0x549a50;});}return null;};}function removeEntity(_0x5ed346,_0x588851){return function(_0x5e0bbe){if(_0x5e0bbe){return _0x5e0bbe[_0x21de('0x28')]()[_0x21de('0x27')](function(){_0x5ed346[_0x21de('0x1c')](0xcc)[_0x21de('0x1b')]();});}};}function handleEntityNotFound(_0x1676d0,_0x3a4f55){return function(_0x1327e8){if(!_0x1327e8){_0x1676d0['sendStatus'](0x194);}return _0x1327e8;};}function handleError(_0x17cdbc,_0x12a825){_0x12a825=_0x12a825||0x1f4;return function(_0x1c2e94){logger['error'](_0x1c2e94[_0x21de('0x29')]);if(_0x1c2e94[_0x21de('0x2a')]){delete _0x1c2e94[_0x21de('0x2a')];}_0x17cdbc[_0x21de('0x1c')](_0x12a825)[_0x21de('0x2b')](_0x1c2e94);};}exports[_0x21de('0x2c')]=function(_0x31274d,_0x2a67b9){var _0x193825={},_0x1055b9={},_0x5c1c5f={'count':0x0,'rows':[]};var _0x4a7630=_[_0x21de('0x2d')](db[_0x21de('0x2e')]['rawAttributes'],function(_0x2cbaef){return{'name':_0x2cbaef['fieldName'],'type':_0x2cbaef[_0x21de('0x2f')]['key']};});_0x1055b9['model']=_[_0x21de('0x2d')](_0x4a7630,_0x21de('0x2a'));_0x1055b9['query']=_[_0x21de('0x30')](_0x31274d[_0x21de('0x31')]);_0x1055b9[_0x21de('0x32')]=_[_0x21de('0x33')](_0x1055b9[_0x21de('0x34')],_0x1055b9[_0x21de('0x31')]);_0x193825[_0x21de('0x35')]=_['intersection'](_0x1055b9[_0x21de('0x34')],qs[_0x21de('0x36')](_0x31274d[_0x21de('0x31')]['fields']));_0x193825[_0x21de('0x35')]=_0x193825[_0x21de('0x35')][_0x21de('0x37')]?_0x193825[_0x21de('0x35')]:_0x1055b9[_0x21de('0x34')];if(!_0x31274d[_0x21de('0x31')][_0x21de('0x38')]('nolimit')){_0x193825[_0x21de('0x20')]=qs[_0x21de('0x20')](_0x31274d['query']['limit']);_0x193825[_0x21de('0x1e')]=qs['offset'](_0x31274d[_0x21de('0x31')][_0x21de('0x1e')]);}_0x193825[_0x21de('0x39')]=qs['sort'](_0x31274d[_0x21de('0x31')][_0x21de('0x3a')]);_0x193825[_0x21de('0x3b')]=qs[_0x21de('0x32')](_[_0x21de('0x3c')](_0x31274d[_0x21de('0x31')],_0x1055b9[_0x21de('0x32')]),_0x4a7630);if(_0x31274d[_0x21de('0x31')][_0x21de('0x3d')]){_0x193825[_0x21de('0x3b')]=_[_0x21de('0x3e')](_0x193825[_0x21de('0x3b')],{'$or':_[_0x21de('0x2d')](_0x4a7630,function(_0x8ee18f){if(_0x8ee18f[_0x21de('0x2f')]!==_0x21de('0x3f')){var _0x3d3451={};_0x3d3451[_0x8ee18f[_0x21de('0x2a')]]={'$like':'%'+_0x31274d[_0x21de('0x31')][_0x21de('0x3d')]+'%'};return _0x3d3451;}})});}_0x193825=_[_0x21de('0x3e')]({},_0x193825,_0x31274d[_0x21de('0x40')]);var _0x10c043={'where':_0x193825['where']};return db[_0x21de('0x2e')][_0x21de('0x41')](_0x10c043)[_0x21de('0x27')](function(_0x544006){_0x5c1c5f[_0x21de('0x41')]=_0x544006;if(_0x31274d[_0x21de('0x31')][_0x21de('0x42')]){_0x193825[_0x21de('0x43')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x193825);})[_0x21de('0x27')](function(_0xaaa91a){_0x5c1c5f[_0x21de('0x44')]=_0xaaa91a;return _0x5c1c5f;})[_0x21de('0x27')](respondWithFilteredResult(_0x2a67b9,_0x193825))[_0x21de('0x45')](handleError(_0x2a67b9,null));};exports['show']=function(_0x3ccd71,_0x233534){var _0x3f2e7e={'raw':!![],'where':{'id':_0x3ccd71[_0x21de('0x46')]['id']}},_0x3bc7de={};_0x3bc7de[_0x21de('0x34')]=_[_0x21de('0x30')](db[_0x21de('0x2e')][_0x21de('0x47')]);_0x3bc7de[_0x21de('0x31')]=_['keys'](_0x3ccd71[_0x21de('0x31')]);_0x3bc7de['filters']=_['intersection'](_0x3bc7de[_0x21de('0x34')],_0x3bc7de[_0x21de('0x31')]);_0x3f2e7e[_0x21de('0x35')]=_[_0x21de('0x33')](_0x3bc7de[_0x21de('0x34')],qs[_0x21de('0x36')](_0x3ccd71[_0x21de('0x31')][_0x21de('0x36')]));_0x3f2e7e[_0x21de('0x35')]=_0x3f2e7e[_0x21de('0x35')]['length']?_0x3f2e7e[_0x21de('0x35')]:_0x3bc7de['model'];if(_0x3ccd71[_0x21de('0x31')][_0x21de('0x42')]){_0x3f2e7e[_0x21de('0x43')]=[{'all':!![]}];}_0x3f2e7e=_['merge']({},_0x3f2e7e,_0x3ccd71[_0x21de('0x40')]);return db[_0x21de('0x2e')][_0x21de('0x48')](_0x3f2e7e)[_0x21de('0x27')](handleEntityNotFound(_0x233534,null))[_0x21de('0x27')](respondWithResult(_0x233534,null))[_0x21de('0x45')](handleError(_0x233534,null));};exports[_0x21de('0x49')]=function(_0x2f9c61,_0x488a69){return db['SquareRecording'][_0x21de('0x49')](_0x2f9c61[_0x21de('0x4a')],{})[_0x21de('0x27')](respondWithResult(_0x488a69,0xc9))[_0x21de('0x45')](handleError(_0x488a69,null));};exports[_0x21de('0x26')]=function(_0x573f08,_0x4b24e7){if(_0x573f08[_0x21de('0x4a')]['id']){delete _0x573f08[_0x21de('0x4a')]['id'];}return db[_0x21de('0x2e')][_0x21de('0x48')]({'where':{'id':_0x573f08[_0x21de('0x46')]['id']}})[_0x21de('0x27')](handleEntityNotFound(_0x4b24e7,null))['then'](saveUpdates(_0x573f08[_0x21de('0x4a')],null))['then'](respondWithResult(_0x4b24e7,null))[_0x21de('0x45')](handleError(_0x4b24e7,null));};exports[_0x21de('0x4b')]=function(_0x50b81a,_0x200d77,_0x2d412a){var _0x58fce4=require(_0x21de('0x4c'));var _0x17a365=![];var _0x1b3a15={};if(_0x50b81a[_0x21de('0x31')][_0x21de('0x2f')]&&_0x50b81a[_0x21de('0x31')][_0x21de('0x2f')]===_0x21de('0x4d')){_0x1b3a15[_0x21de('0x4d')]=_0x50b81a[_0x21de('0x46')]['id'];}else{_0x1b3a15['id']=_0x50b81a['params']['id'];}return db[_0x21de('0x2e')][_0x21de('0x48')]({'where':_0x1b3a15,'attributes':['id',_0x21de('0x4e'),_0x21de('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x200d77,null))['then'](function(_0x287aad){if(_0x287aad){var _0xb704a5=_0x287aad[_0x21de('0x4e')];var _0xa8bdb8=util[_0x21de('0x50')]('%s.cypher',_0xb704a5);if(fs[_0x21de('0x51')](_0xa8bdb8)){_0x17a365=!![];return _0x58fce4[_0x21de('0x52')](_0xa8bdb8,_0xb704a5,config[_0x21de('0x53')][_0x21de('0x54')])[_0x21de('0x27')](function(){return _0x287aad;});}return _0x287aad;}})[_0x21de('0x27')](function(_0x4e8e0d){if(_0x4e8e0d){var _0x19f6f7=_0x4e8e0d['savePath'];if(!fs[_0x21de('0x51')](_0x19f6f7)){throw new db['Sequelize'][(_0x21de('0x55'))](_0x21de('0x56'));}if(_0x4e8e0d[_0x21de('0x4f')]){return _0x200d77['download'](_0x19f6f7,_0x4e8e0d['filename']+path[_0x21de('0x57')](_0x19f6f7),function(){if(_0x17a365){fs[_0x21de('0x58')](_0x19f6f7);}});}else{return _0x200d77[_0x21de('0x4b')](_0x19f6f7,function(_0xd06021){if(_0x17a365){fs['unlink'](_0x19f6f7);}});}}})[_0x21de('0x45')](function(_0x3a499a){if(_0x3a499a['message']===_0x21de('0x56')){_0x200d77['status'](0x194)[_0x21de('0x2b')](_0x21de('0x59'));}else{return handleError(_0x200d77,null);}});};exports['destroy']=function(_0x35ee16,_0x39dc80){return db[_0x21de('0x2e')][_0x21de('0x48')]({'where':{'id':_0x35ee16['params']['id']}})[_0x21de('0x27')](function(_0x100a33){if(_[_0x21de('0x5a')](_0x100a33)){throw new ReferenceError(_0x21de('0x5b'));}return _0x100a33;})[_0x21de('0x27')](function(_0x227969){var _0x603fc8=_0x227969[_0x21de('0x4e')];logger[_0x21de('0x5c')](_0x21de('0x5d'),_0x603fc8);if(!_[_0x21de('0x5a')](_0x227969[_0x21de('0x4e')])&&fs[_0x21de('0x51')](_0x603fc8)){logger[_0x21de('0x5c')](_0x21de('0x5e')+_0x603fc8+_0x21de('0x5f'));fs[_0x21de('0x60')](_0x603fc8);}_0x603fc8=_0x603fc8+_0x21de('0x61');if(!_['isNil'](_0x227969[_0x21de('0x4e')])&&fs[_0x21de('0x51')](_0x603fc8)){logger[_0x21de('0x5c')](_0x21de('0x5e')+_0x603fc8+_0x21de('0x5f'));fs['unlinkSync'](_0x603fc8);}return _0x227969;})[_0x21de('0x27')](function(_0x5b8070){if(!_0x5b8070)throw new InternalError();return _0x5b8070[_0x21de('0x28')]();})['then'](function(){_0x39dc80[_0x21de('0x1c')](0xcc)[_0x21de('0x1b')]();})[_0x21de('0x45')](handleError(_0x39dc80,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index c1712ae..8a70789 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 _0xd5f9=['rimraf','../../config/environment','./squareRecording.attributes','define','SquareRecording','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x446d8f,_0x2ac4f4){var _0x1b2442=function(_0x46c9c1){while(--_0x46c9c1){_0x446d8f['push'](_0x446d8f['shift']());}};_0x1b2442(++_0x2ac4f4);}(_0xd5f9,0x1f1));var _0x9d5f=function(_0x52a505,_0x5dec98){_0x52a505=_0x52a505-0x0;var _0x1fc95e=_0xd5f9[_0x52a505];return _0x1fc95e;};'use strict';var _=require(_0x9d5f('0x0'));var util=require(_0x9d5f('0x1'));var logger=require(_0x9d5f('0x2'))(_0x9d5f('0x3'));var moment=require('moment');var BPromise=require(_0x9d5f('0x4'));var rp=require(_0x9d5f('0x5'));var fs=require('fs');var path=require(_0x9d5f('0x6'));var rimraf=require(_0x9d5f('0x7'));var config=require(_0x9d5f('0x8'));var attributes=require(_0x9d5f('0x9'));module['exports']=function(_0x546c04,_0x58edae){return _0x546c04[_0x9d5f('0xa')](_0x9d5f('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0755=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x86653c,_0x360658){var _0x539d1f=function(_0x5a7b7e){while(--_0x5a7b7e){_0x86653c['push'](_0x86653c['shift']());}};_0x539d1f(++_0x360658);}(_0x0755,0x7c));var _0x5075=function(_0x3d8286,_0x47304d){_0x3d8286=_0x3d8286-0x0;var _0x137c9b=_0x0755[_0x3d8286];return _0x137c9b;};'use strict';var _=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var logger=require(_0x5075('0x2'))(_0x5075('0x3'));var moment=require(_0x5075('0x4'));var BPromise=require(_0x5075('0x5'));var rp=require(_0x5075('0x6'));var fs=require('fs');var path=require(_0x5075('0x7'));var rimraf=require(_0x5075('0x8'));var config=require(_0x5075('0x9'));var attributes=require('./squareRecording.attributes');module[_0x5075('0xa')]=function(_0x2a7be,_0x3f4fea){return _0x2a7be[_0x5075('0xb')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 250e06c..28d1f61 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 _0x2e4a=['error','message','result','catch','create','body','options','raw','CreateSquareRecording','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x2e4a,0x189));var _0xa2e4=function(_0xdf3ead,_0xcf5013){_0xdf3ead=_0xdf3ead-0x0;var _0xd2aaae=_0x2e4a[_0xdf3ead];return _0xd2aaae;};'use strict';var _=require('lodash');var util=require(_0xa2e4('0x0'));var moment=require(_0xa2e4('0x1'));var BPromise=require(_0xa2e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2e4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa2e4('0x4'));var logger=require(_0xa2e4('0x5'))('rpc');var config=require(_0xa2e4('0x6'));var jayson=require(_0xa2e4('0x7'));var client=jayson['client'][_0xa2e4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bd701,_0x4733df,_0x2fea8f){return new BPromise(function(_0x30b6ea,_0x3549b5){return client['request'](_0x2bd701,_0x2fea8f)[_0xa2e4('0x9')](function(_0xb50631){logger[_0xa2e4('0xa')](_0xa2e4('0xb'),_0x4733df,_0xa2e4('0xc'));logger[_0xa2e4('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x4733df,_0xa2e4('0xc'),JSON[_0xa2e4('0xe')](_0xb50631));if(_0xb50631[_0xa2e4('0xf')]){if(_0xb50631[_0xa2e4('0xf')]['code']===0x1f4){logger['error'](_0xa2e4('0xb'),_0x4733df,_0xb50631[_0xa2e4('0xf')]['message']);return _0x3549b5(_0xb50631[_0xa2e4('0xf')][_0xa2e4('0x10')]);}logger[_0xa2e4('0xf')]('SquareRecording,\x20%s,\x20%s',_0x4733df,_0xb50631[_0xa2e4('0xf')][_0xa2e4('0x10')]);return _0x30b6ea(_0xb50631['error'][_0xa2e4('0x10')]);}else{logger[_0xa2e4('0xa')](_0xa2e4('0xb'),_0x4733df,_0xa2e4('0xc'));_0x30b6ea(_0xb50631[_0xa2e4('0x11')]['message']);}})[_0xa2e4('0x12')](function(_0x55dc80){logger[_0xa2e4('0xf')]('SquareRecording,\x20%s,\x20%s',_0x4733df,_0x55dc80);_0x3549b5(_0x55dc80);});});}exports['CreateSquareRecording']=function(_0x4a9219){var _0x56c1e7=this;return new Promise(function(_0x5be27e,_0x4a0104){return db['SquareRecording'][_0xa2e4('0x13')](_0x4a9219[_0xa2e4('0x14')],{'raw':_0x4a9219[_0xa2e4('0x15')]?_0x4a9219['options'][_0xa2e4('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5af763){logger[_0xa2e4('0xa')](_0xa2e4('0x17'),_0x4a9219);logger['debug'](_0xa2e4('0x17'),_0x4a9219,JSON[_0xa2e4('0xe')](_0x5af763));_0x5be27e(_0x5af763);})[_0xa2e4('0x12')](function(_0x2ae0d8){logger[_0xa2e4('0xf')](_0xa2e4('0x17'),_0x2ae0d8[_0xa2e4('0x10')],_0x4a9219);_0x4a0104(_0x56c1e7[_0xa2e4('0xf')](0x1f4,_0x2ae0d8['message']));});});}; \ No newline at end of file +var _0xdb4c=['options','lodash','moment','bluebird','randomstring','../../config/logger','rpc','client','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','create','body'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0xdb4c,0xf1));var _0xcdb4=function(_0x4ecefa,_0x56e320){_0x4ecefa=_0x4ecefa-0x0;var _0x78f983=_0xdb4c[_0x4ecefa];return _0x78f983;};'use strict';var _=require(_0xcdb4('0x0'));var util=require('util');var moment=require(_0xcdb4('0x1'));var BPromise=require(_0xcdb4('0x2'));var rs=require(_0xcdb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcdb4('0x4'))(_0xcdb4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcdb4('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3af510,_0x2fba7c,_0x5d982e){return new BPromise(function(_0x8bc06c,_0xe13aed){return client[_0xcdb4('0x7')](_0x3af510,_0x5d982e)[_0xcdb4('0x8')](function(_0x367cba){logger[_0xcdb4('0x9')](_0xcdb4('0xa'),_0x2fba7c,_0xcdb4('0xb'));logger[_0xcdb4('0xc')](_0xcdb4('0xd'),_0x2fba7c,_0xcdb4('0xb'),JSON[_0xcdb4('0xe')](_0x367cba));if(_0x367cba[_0xcdb4('0xf')]){if(_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x10')]===0x1f4){logger[_0xcdb4('0xf')]('SquareRecording,\x20%s,\x20%s',_0x2fba7c,_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);return _0xe13aed(_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);}logger[_0xcdb4('0xf')](_0xcdb4('0xa'),_0x2fba7c,_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);return _0x8bc06c(_0x367cba[_0xcdb4('0xf')][_0xcdb4('0x11')]);}else{logger[_0xcdb4('0x9')](_0xcdb4('0xa'),_0x2fba7c,_0xcdb4('0xb'));_0x8bc06c(_0x367cba[_0xcdb4('0x12')][_0xcdb4('0x11')]);}})[_0xcdb4('0x13')](function(_0x7e5a38){logger[_0xcdb4('0xf')](_0xcdb4('0xa'),_0x2fba7c,_0x7e5a38);_0xe13aed(_0x7e5a38);});});}exports[_0xcdb4('0x14')]=function(_0x561253){var _0x159d3c=this;return new Promise(function(_0x3a296d,_0x5a5260){return db['SquareRecording'][_0xcdb4('0x15')](_0x561253[_0xcdb4('0x16')],{'raw':_0x561253['options']?_0x561253[_0xcdb4('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x289a8){logger[_0xcdb4('0x9')](_0xcdb4('0x14'),_0x561253);logger[_0xcdb4('0xc')]('CreateSquareRecording',_0x561253,JSON[_0xcdb4('0xe')](_0x289a8));_0x3a296d(_0x289a8);})[_0xcdb4('0x13')](function(_0xf8fc2f){logger['error'](_0xcdb4('0x14'),_0xf8fc2f[_0xcdb4('0x11')],_0x561253);_0x5a5260(_0x159d3c[_0xcdb4('0xf')](0x1f4,_0xf8fc2f['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 94cfe16..e5608ae 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 _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(_0x3e8c4d,_0x18d01a){var _0x205fb5=function(_0x26ff7d){while(--_0x26ff7d){_0x3e8c4d['push'](_0x3e8c4d['shift']());}};_0x205fb5(++_0x18d01a);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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(_0x33f64c,_0x37c749){var _0x3f55e1=function(_0x5f1a85){while(--_0x5f1a85){_0x33f64c['push'](_0x33f64c['shift']());}};_0x3f55e1(++_0x37c749);}(_0xe706,0xa3));var _0x6e70=function(_0x19dd8a,_0x449861){_0x19dd8a=_0x19dd8a-0x0;var _0x212ccc=_0xe706[_0x19dd8a];return _0x212ccc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 90c4219..26dad29 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 _0x5ed8=['DATE','BOOLEAN','sequelize','exports','STRING'];(function(_0x1d56dc,_0x2855c7){var _0x207366=function(_0x539db2){while(--_0x539db2){_0x1d56dc['push'](_0x1d56dc['shift']());}};_0x207366(++_0x2855c7);}(_0x5ed8,0xcf));var _0x85ed=function(_0x5e07a7,_0x1438b3){_0x5e07a7=_0x5e07a7-0x0;var _0x22ced5=_0x5ed8[_0x5e07a7];return _0x22ced5;};'use strict';var Sequelize=require(_0x85ed('0x0'));module[_0x85ed('0x1')]={'network':{'type':Sequelize[_0x85ed('0x2')]},'network_script':{'type':Sequelize[_0x85ed('0x2')]},'request':{'type':Sequelize[_0x85ed('0x2')]},'channel':{'type':Sequelize[_0x85ed('0x2')]},'language':{'type':Sequelize[_0x85ed('0x2')]},'type':{'type':Sequelize[_0x85ed('0x2')]},'uniqueid':{'type':Sequelize[_0x85ed('0x2')]},'version':{'type':Sequelize[_0x85ed('0x2')]},'callerid':{'type':Sequelize[_0x85ed('0x2')]},'calleridname':{'type':Sequelize[_0x85ed('0x2')]},'callingpres':{'type':Sequelize[_0x85ed('0x2')]},'callingani2':{'type':Sequelize[_0x85ed('0x2')]},'callington':{'type':Sequelize[_0x85ed('0x2')]},'callingtns':{'type':Sequelize[_0x85ed('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x85ed('0x2')]},'extension':{'type':Sequelize[_0x85ed('0x2')]},'priority':{'type':Sequelize[_0x85ed('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x85ed('0x2')]},'threadid':{'type':Sequelize[_0x85ed('0x2')]},'project_name':{'type':Sequelize[_0x85ed('0x2')]},'joinAt':{'type':Sequelize[_0x85ed('0x3')]},'leaveAt':{'type':Sequelize[_0x85ed('0x3')]},'bot':{'type':Sequelize[_0x85ed('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x61ea=['DATE','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61ea,0x13d));var _0xa61e=function(_0x2a8a42,_0x4cc83a){_0x2a8a42=_0x2a8a42-0x0;var _0x5d35f2=_0x61ea[_0x2a8a42];return _0x5d35f2;};'use strict';var Sequelize=require(_0xa61e('0x0'));module[_0xa61e('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xa61e('0x2')]},'request':{'type':Sequelize[_0xa61e('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa61e('0x2')]},'type':{'type':Sequelize[_0xa61e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa61e('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0xa61e('0x2')]},'callington':{'type':Sequelize[_0xa61e('0x2')]},'callingtns':{'type':Sequelize[_0xa61e('0x2')]},'dnid':{'type':Sequelize[_0xa61e('0x2')]},'rdnis':{'type':Sequelize[_0xa61e('0x2')]},'context':{'type':Sequelize[_0xa61e('0x2')]},'extension':{'type':Sequelize[_0xa61e('0x2')]},'priority':{'type':Sequelize[_0xa61e('0x2')]},'enhanced':{'type':Sequelize[_0xa61e('0x2')]},'accountcode':{'type':Sequelize[_0xa61e('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa61e('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 2cd8cda..c0c548e 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 _0xf25f=['model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','filter','merge','where','map','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','destroy','end','stack','name','index','SquareReport','rawAttributes','fieldName','type','key'];(function(_0x36438d,_0x4f9f8c){var _0x4f8798=function(_0x7d4c8f){while(--_0x7d4c8f){_0x36438d['push'](_0x36438d['shift']());}};_0x4f8798(++_0x4f9f8c);}(_0xf25f,0xf8));var _0xff25=function(_0x5d5dde,_0x3131bc){_0x5d5dde=_0x5d5dde-0x0;var _0x2f0f35=_0xf25f[_0x5d5dde];return _0x2f0f35;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xff25('0x0'));var zipdir=require(_0xff25('0x1'));var jsonpatch=require(_0xff25('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xff25('0x3'));var util=require(_0xff25('0x4'));var path=require(_0xff25('0x5'));var sox=require(_0xff25('0x6'));var csv=require(_0xff25('0x7'));var ejs=require(_0xff25('0x8'));var fs=require('fs');var fs_extra=require(_0xff25('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff25('0xa'));var jsforce=require(_0xff25('0xb'));var deskjs=require(_0xff25('0xc'));var toCsv=require(_0xff25('0x7'));var querystring=require(_0xff25('0xd'));var Papa=require('papaparse');var Redis=require(_0xff25('0xe'));var authService=require(_0xff25('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff25('0x10'));var logger=require(_0xff25('0x11'))(_0xff25('0x12'));var utils=require(_0xff25('0x13'));var config=require(_0xff25('0x14'));var licenseUtil=require(_0xff25('0x15'));var db=require(_0xff25('0x16'))['db'];function respondWithStatusCode(_0x4f245b,_0x554dc7){_0x554dc7=_0x554dc7||0xcc;return function(_0x143570){if(_0x143570){return _0x4f245b[_0xff25('0x17')](_0x554dc7);}return _0x4f245b[_0xff25('0x18')](_0x554dc7)['end']();};}function respondWithResult(_0x1c3cf5,_0xb334ae){_0xb334ae=_0xb334ae||0xc8;return function(_0x2c2e0d){if(_0x2c2e0d){return _0x1c3cf5['status'](_0xb334ae)[_0xff25('0x19')](_0x2c2e0d);}};}function respondWithFilteredResult(_0x9fb3c3,_0x59d934){return function(_0xdf065f){if(_0xdf065f){var _0x47e396=typeof _0x59d934[_0xff25('0x1a')]==='undefined'&&typeof _0x59d934[_0xff25('0x1b')]==='undefined';var _0x2e12f1=_0xdf065f[_0xff25('0x1c')];var _0x491846=_0x47e396?0x0:_0x59d934[_0xff25('0x1a')];var _0x30f420=_0x47e396?_0xdf065f[_0xff25('0x1c')]:_0x59d934[_0xff25('0x1a')]+_0x59d934[_0xff25('0x1b')];var _0x21f549;if(_0x30f420>=_0x2e12f1){_0x30f420=_0x2e12f1;_0x21f549=0xc8;}else{_0x21f549=0xce;}_0x9fb3c3[_0xff25('0x18')](_0x21f549);return _0x9fb3c3[_0xff25('0x1d')]('Content-Range',_0x491846+'-'+_0x30f420+'/'+_0x2e12f1)[_0xff25('0x19')](_0xdf065f);}return null;};}function patchUpdates(_0x5341af){return function(_0x10883d){try{jsonpatch[_0xff25('0x1e')](_0x10883d,_0x5341af,!![]);}catch(_0x23e109){return BPromise[_0xff25('0x1f')](_0x23e109);}return _0x10883d[_0xff25('0x20')]();};}function saveUpdates(_0x4e0371,_0x18a4d5){return function(_0x17a967){if(_0x17a967){return _0x17a967[_0xff25('0x21')](_0x4e0371)['then'](function(_0x5a805f){return _0x5a805f;});}return null;};}function removeEntity(_0x814d3f,_0x4c8c6b){return function(_0x70709){if(_0x70709){return _0x70709[_0xff25('0x22')]()['then'](function(){_0x814d3f[_0xff25('0x18')](0xcc)[_0xff25('0x23')]();});}};}function handleEntityNotFound(_0x41cdaa,_0x4ca0ed){return function(_0x575cde){if(!_0x575cde){_0x41cdaa[_0xff25('0x17')](0x194);}return _0x575cde;};}function handleError(_0x2c1367,_0x4fb167){_0x4fb167=_0x4fb167||0x1f4;return function(_0x23b0a7){logger['error'](_0x23b0a7[_0xff25('0x24')]);if(_0x23b0a7[_0xff25('0x25')]){delete _0x23b0a7['name'];}_0x2c1367[_0xff25('0x18')](_0x4fb167)['send'](_0x23b0a7);};}exports[_0xff25('0x26')]=function(_0x15a4fd,_0x4703d8){var _0x37f05f={},_0x160dcc={},_0x4ec470={'count':0x0,'rows':[]};var _0x35bc27=_['map'](db[_0xff25('0x27')][_0xff25('0x28')],function(_0x1d630a){return{'name':_0x1d630a[_0xff25('0x29')],'type':_0x1d630a[_0xff25('0x2a')][_0xff25('0x2b')]};});_0x160dcc[_0xff25('0x2c')]=_['map'](_0x35bc27,_0xff25('0x25'));_0x160dcc['query']=_[_0xff25('0x2d')](_0x15a4fd[_0xff25('0x2e')]);_0x160dcc[_0xff25('0x2f')]=_['intersection'](_0x160dcc['model'],_0x160dcc[_0xff25('0x2e')]);_0x37f05f[_0xff25('0x30')]=_[_0xff25('0x31')](_0x160dcc[_0xff25('0x2c')],qs[_0xff25('0x32')](_0x15a4fd[_0xff25('0x2e')][_0xff25('0x32')]));_0x37f05f[_0xff25('0x30')]=_0x37f05f['attributes']['length']?_0x37f05f['attributes']:_0x160dcc['model'];if(!_0x15a4fd[_0xff25('0x2e')][_0xff25('0x33')]('nolimit')){_0x37f05f[_0xff25('0x1b')]=qs['limit'](_0x15a4fd[_0xff25('0x2e')][_0xff25('0x1b')]);_0x37f05f[_0xff25('0x1a')]=qs[_0xff25('0x1a')](_0x15a4fd[_0xff25('0x2e')][_0xff25('0x1a')]);}_0x37f05f['order']=qs[_0xff25('0x34')](_0x15a4fd[_0xff25('0x2e')][_0xff25('0x34')]);_0x37f05f['where']=qs[_0xff25('0x2f')](_[_0xff25('0x35')](_0x15a4fd[_0xff25('0x2e')],_0x160dcc['filters']),_0x35bc27);if(_0x15a4fd['query'][_0xff25('0x36')]){_0x37f05f['where']=_[_0xff25('0x37')](_0x37f05f[_0xff25('0x38')],{'$or':_[_0xff25('0x39')](_0x35bc27,function(_0x5e8196){if(_0x5e8196[_0xff25('0x2a')]!==_0xff25('0x3a')){var _0x2d2841={};_0x2d2841[_0x5e8196[_0xff25('0x25')]]={'$like':'%'+_0x15a4fd[_0xff25('0x2e')][_0xff25('0x36')]+'%'};return _0x2d2841;}})});}_0x37f05f=_['merge']({},_0x37f05f,_0x15a4fd['options']);var _0xbfd9ab={'where':_0x37f05f[_0xff25('0x38')]};return db[_0xff25('0x27')][_0xff25('0x1c')](_0xbfd9ab)[_0xff25('0x3b')](function(_0x397296){_0x4ec470[_0xff25('0x1c')]=_0x397296;if(_0x15a4fd[_0xff25('0x2e')][_0xff25('0x3c')]){_0x37f05f[_0xff25('0x3d')]=[{'all':!![]}];}return db[_0xff25('0x27')][_0xff25('0x3e')](_0x37f05f);})[_0xff25('0x3b')](function(_0x17edf3){_0x4ec470[_0xff25('0x3f')]=_0x17edf3;return _0x4ec470;})['then'](respondWithFilteredResult(_0x4703d8,_0x37f05f))[_0xff25('0x40')](handleError(_0x4703d8,null));};exports[_0xff25('0x41')]=function(_0x1e3f07,_0x45d344){var _0x453d72={'raw':!![],'where':{'id':_0x1e3f07[_0xff25('0x42')]['id']}},_0x5549e4={};_0x5549e4[_0xff25('0x2c')]=_['keys'](db[_0xff25('0x27')]['rawAttributes']);_0x5549e4[_0xff25('0x2e')]=_['keys'](_0x1e3f07[_0xff25('0x2e')]);_0x5549e4[_0xff25('0x2f')]=_[_0xff25('0x31')](_0x5549e4[_0xff25('0x2c')],_0x5549e4[_0xff25('0x2e')]);_0x453d72[_0xff25('0x30')]=_[_0xff25('0x31')](_0x5549e4[_0xff25('0x2c')],qs['fields'](_0x1e3f07['query'][_0xff25('0x32')]));_0x453d72[_0xff25('0x30')]=_0x453d72[_0xff25('0x30')][_0xff25('0x43')]?_0x453d72[_0xff25('0x30')]:_0x5549e4[_0xff25('0x2c')];if(_0x1e3f07[_0xff25('0x2e')][_0xff25('0x3c')]){_0x453d72[_0xff25('0x3d')]=[{'all':!![]}];}_0x453d72=_[_0xff25('0x37')]({},_0x453d72,_0x1e3f07[_0xff25('0x44')]);return db[_0xff25('0x27')]['find'](_0x453d72)[_0xff25('0x3b')](handleEntityNotFound(_0x45d344,null))[_0xff25('0x3b')](respondWithResult(_0x45d344,null))[_0xff25('0x40')](handleError(_0x45d344,null));};exports[_0xff25('0x45')]=function(_0x4e8c6d,_0x2fe21b){return db[_0xff25('0x27')][_0xff25('0x45')](_0x4e8c6d['body'],{})[_0xff25('0x3b')](respondWithResult(_0x2fe21b,0xc9))[_0xff25('0x40')](handleError(_0x2fe21b,null));};exports[_0xff25('0x21')]=function(_0x6349f0,_0x27e848){if(_0x6349f0[_0xff25('0x46')]['id']){delete _0x6349f0['body']['id'];}return db[_0xff25('0x27')][_0xff25('0x47')]({'where':{'id':_0x6349f0[_0xff25('0x42')]['id']}})[_0xff25('0x3b')](handleEntityNotFound(_0x27e848,null))['then'](saveUpdates(_0x6349f0['body'],null))[_0xff25('0x3b')](respondWithResult(_0x27e848,null))[_0xff25('0x40')](handleError(_0x27e848,null));};exports[_0xff25('0x22')]=function(_0xe4791e,_0x182b49){return db[_0xff25('0x27')][_0xff25('0x47')]({'where':{'id':_0xe4791e[_0xff25('0x42')]['id']}})['then'](handleEntityNotFound(_0x182b49,null))['then'](removeEntity(_0x182b49,null))['catch'](handleError(_0x182b49,null));};exports[_0xff25('0x48')]=function(_0x408ebe,_0x242742){return db[_0xff25('0x27')]['describe']()[_0xff25('0x3b')](respondWithResult(_0x242742,null))[_0xff25('0x40')](handleError(_0x242742,null));}; \ No newline at end of file +var _0x5edb=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','sendStatus','name','send','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SquareReport','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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'];(function(_0x5457a4,_0x258eda){var _0x3ae8eb=function(_0xcc183){while(--_0xcc183){_0x5457a4['push'](_0x5457a4['shift']());}};_0x3ae8eb(++_0x258eda);}(_0x5edb,0xd0));var _0xb5ed=function(_0x338fad,_0x1d7cdd){_0x338fad=_0x338fad-0x0;var _0xaf44b1=_0x5edb[_0x338fad];return _0xaf44b1;};'use strict';var emlformat=require(_0xb5ed('0x0'));var rimraf=require(_0xb5ed('0x1'));var zipdir=require(_0xb5ed('0x2'));var jsonpatch=require(_0xb5ed('0x3'));var rp=require(_0xb5ed('0x4'));var moment=require(_0xb5ed('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb5ed('0x6'));var sox=require(_0xb5ed('0x7'));var csv=require(_0xb5ed('0x8'));var ejs=require(_0xb5ed('0x9'));var fs=require('fs');var fs_extra=require(_0xb5ed('0xa'));var _=require(_0xb5ed('0xb'));var squel=require(_0xb5ed('0xc'));var crypto=require(_0xb5ed('0xd'));var jsforce=require(_0xb5ed('0xe'));var deskjs=require(_0xb5ed('0xf'));var toCsv=require(_0xb5ed('0x8'));var querystring=require(_0xb5ed('0x10'));var Papa=require(_0xb5ed('0x11'));var Redis=require(_0xb5ed('0x12'));var authService=require(_0xb5ed('0x13'));var qs=require(_0xb5ed('0x14'));var as=require(_0xb5ed('0x15'));var hardwareService=require(_0xb5ed('0x16'));var logger=require('../../config/logger')(_0xb5ed('0x17'));var utils=require(_0xb5ed('0x18'));var config=require(_0xb5ed('0x19'));var licenseUtil=require(_0xb5ed('0x1a'));var db=require(_0xb5ed('0x1b'))['db'];function respondWithStatusCode(_0x1509f0,_0x1e34b7){_0x1e34b7=_0x1e34b7||0xcc;return function(_0x2d8572){if(_0x2d8572){return _0x1509f0['sendStatus'](_0x1e34b7);}return _0x1509f0['status'](_0x1e34b7)[_0xb5ed('0x1c')]();};}function respondWithResult(_0x28ee7c,_0x2ff7aa){_0x2ff7aa=_0x2ff7aa||0xc8;return function(_0x539a32){if(_0x539a32){return _0x28ee7c[_0xb5ed('0x1d')](_0x2ff7aa)[_0xb5ed('0x1e')](_0x539a32);}};}function respondWithFilteredResult(_0x145c1b,_0xb826){return function(_0x5b5aec){if(_0x5b5aec){var _0x5d2124=typeof _0xb826[_0xb5ed('0x1f')]===_0xb5ed('0x20')&&typeof _0xb826[_0xb5ed('0x21')]===_0xb5ed('0x20');var _0x3ca313=_0x5b5aec[_0xb5ed('0x22')];var _0x3fe4d2=_0x5d2124?0x0:_0xb826[_0xb5ed('0x1f')];var _0x3939c3=_0x5d2124?_0x5b5aec[_0xb5ed('0x22')]:_0xb826['offset']+_0xb826[_0xb5ed('0x21')];var _0x1334e3;if(_0x3939c3>=_0x3ca313){_0x3939c3=_0x3ca313;_0x1334e3=0xc8;}else{_0x1334e3=0xce;}_0x145c1b[_0xb5ed('0x1d')](_0x1334e3);return _0x145c1b['set'](_0xb5ed('0x23'),_0x3fe4d2+'-'+_0x3939c3+'/'+_0x3ca313)[_0xb5ed('0x1e')](_0x5b5aec);}return null;};}function patchUpdates(_0x326243){return function(_0x129c54){try{jsonpatch['apply'](_0x129c54,_0x326243,!![]);}catch(_0x3bd9ab){return BPromise['reject'](_0x3bd9ab);}return _0x129c54[_0xb5ed('0x24')]();};}function saveUpdates(_0x57765f,_0xdeb926){return function(_0x3aac13){if(_0x3aac13){return _0x3aac13[_0xb5ed('0x25')](_0x57765f)['then'](function(_0x38b872){return _0x38b872;});}return null;};}function removeEntity(_0x83963b,_0x31b47c){return function(_0x419a4d){if(_0x419a4d){return _0x419a4d[_0xb5ed('0x26')]()[_0xb5ed('0x27')](function(){_0x83963b[_0xb5ed('0x1d')](0xcc)[_0xb5ed('0x1c')]();});}};}function handleEntityNotFound(_0x3fd5d8,_0x4aa6b4){return function(_0x12eb8d){if(!_0x12eb8d){_0x3fd5d8[_0xb5ed('0x28')](0x194);}return _0x12eb8d;};}function handleError(_0x57c2ac,_0x80b2e9){_0x80b2e9=_0x80b2e9||0x1f4;return function(_0x356113){logger['error'](_0x356113['stack']);if(_0x356113[_0xb5ed('0x29')]){delete _0x356113[_0xb5ed('0x29')];}_0x57c2ac['status'](_0x80b2e9)[_0xb5ed('0x2a')](_0x356113);};}exports['index']=function(_0x289f2a,_0x289b91){var _0x17b8ff={},_0x118313={},_0x5e83b0={'count':0x0,'rows':[]};var _0x4b45cb=_[_0xb5ed('0x2b')](db['SquareReport']['rawAttributes'],function(_0x4a118c){return{'name':_0x4a118c[_0xb5ed('0x2c')],'type':_0x4a118c[_0xb5ed('0x2d')][_0xb5ed('0x2e')]};});_0x118313[_0xb5ed('0x2f')]=_[_0xb5ed('0x2b')](_0x4b45cb,_0xb5ed('0x29'));_0x118313[_0xb5ed('0x30')]=_['keys'](_0x289f2a['query']);_0x118313[_0xb5ed('0x31')]=_[_0xb5ed('0x32')](_0x118313['model'],_0x118313[_0xb5ed('0x30')]);_0x17b8ff['attributes']=_[_0xb5ed('0x32')](_0x118313[_0xb5ed('0x2f')],qs[_0xb5ed('0x33')](_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x33')]));_0x17b8ff[_0xb5ed('0x34')]=_0x17b8ff[_0xb5ed('0x34')][_0xb5ed('0x35')]?_0x17b8ff['attributes']:_0x118313[_0xb5ed('0x2f')];if(!_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x36')](_0xb5ed('0x37'))){_0x17b8ff[_0xb5ed('0x21')]=qs[_0xb5ed('0x21')](_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x21')]);_0x17b8ff[_0xb5ed('0x1f')]=qs[_0xb5ed('0x1f')](_0x289f2a['query'][_0xb5ed('0x1f')]);}_0x17b8ff[_0xb5ed('0x38')]=qs[_0xb5ed('0x39')](_0x289f2a['query'][_0xb5ed('0x39')]);_0x17b8ff[_0xb5ed('0x3a')]=qs['filters'](_[_0xb5ed('0x3b')](_0x289f2a[_0xb5ed('0x30')],_0x118313[_0xb5ed('0x31')]),_0x4b45cb);if(_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x3c')]){_0x17b8ff[_0xb5ed('0x3a')]=_[_0xb5ed('0x3d')](_0x17b8ff['where'],{'$or':_[_0xb5ed('0x2b')](_0x4b45cb,function(_0x291d64){if(_0x291d64[_0xb5ed('0x2d')]!=='VIRTUAL'){var _0x5c91f4={};_0x5c91f4[_0x291d64[_0xb5ed('0x29')]]={'$like':'%'+_0x289f2a[_0xb5ed('0x30')][_0xb5ed('0x3c')]+'%'};return _0x5c91f4;}})});}_0x17b8ff=_['merge']({},_0x17b8ff,_0x289f2a[_0xb5ed('0x3e')]);var _0x460168={'where':_0x17b8ff[_0xb5ed('0x3a')]};return db[_0xb5ed('0x3f')]['count'](_0x460168)['then'](function(_0x5473a0){_0x5e83b0[_0xb5ed('0x22')]=_0x5473a0;if(_0x289f2a['query'][_0xb5ed('0x40')]){_0x17b8ff[_0xb5ed('0x41')]=[{'all':!![]}];}return db[_0xb5ed('0x3f')][_0xb5ed('0x42')](_0x17b8ff);})['then'](function(_0x1b6159){_0x5e83b0[_0xb5ed('0x43')]=_0x1b6159;return _0x5e83b0;})[_0xb5ed('0x27')](respondWithFilteredResult(_0x289b91,_0x17b8ff))[_0xb5ed('0x44')](handleError(_0x289b91,null));};exports[_0xb5ed('0x45')]=function(_0x46bc18,_0x3f41a2){var _0x3532b2={'raw':!![],'where':{'id':_0x46bc18[_0xb5ed('0x46')]['id']}},_0x2dfe04={};_0x2dfe04[_0xb5ed('0x2f')]=_[_0xb5ed('0x47')](db[_0xb5ed('0x3f')][_0xb5ed('0x48')]);_0x2dfe04[_0xb5ed('0x30')]=_[_0xb5ed('0x47')](_0x46bc18[_0xb5ed('0x30')]);_0x2dfe04[_0xb5ed('0x31')]=_[_0xb5ed('0x32')](_0x2dfe04[_0xb5ed('0x2f')],_0x2dfe04[_0xb5ed('0x30')]);_0x3532b2['attributes']=_[_0xb5ed('0x32')](_0x2dfe04['model'],qs[_0xb5ed('0x33')](_0x46bc18['query'][_0xb5ed('0x33')]));_0x3532b2[_0xb5ed('0x34')]=_0x3532b2[_0xb5ed('0x34')][_0xb5ed('0x35')]?_0x3532b2[_0xb5ed('0x34')]:_0x2dfe04[_0xb5ed('0x2f')];if(_0x46bc18[_0xb5ed('0x30')][_0xb5ed('0x40')]){_0x3532b2[_0xb5ed('0x41')]=[{'all':!![]}];}_0x3532b2=_[_0xb5ed('0x3d')]({},_0x3532b2,_0x46bc18[_0xb5ed('0x3e')]);return db[_0xb5ed('0x3f')][_0xb5ed('0x49')](_0x3532b2)[_0xb5ed('0x27')](handleEntityNotFound(_0x3f41a2,null))['then'](respondWithResult(_0x3f41a2,null))[_0xb5ed('0x44')](handleError(_0x3f41a2,null));};exports[_0xb5ed('0x4a')]=function(_0x55c090,_0x48d5a5){return db[_0xb5ed('0x3f')][_0xb5ed('0x4a')](_0x55c090[_0xb5ed('0x4b')],{})[_0xb5ed('0x27')](respondWithResult(_0x48d5a5,0xc9))['catch'](handleError(_0x48d5a5,null));};exports[_0xb5ed('0x25')]=function(_0x31faf4,_0x51f0ca){if(_0x31faf4[_0xb5ed('0x4b')]['id']){delete _0x31faf4['body']['id'];}return db[_0xb5ed('0x3f')]['find']({'where':{'id':_0x31faf4['params']['id']}})['then'](handleEntityNotFound(_0x51f0ca,null))[_0xb5ed('0x27')](saveUpdates(_0x31faf4[_0xb5ed('0x4b')],null))[_0xb5ed('0x27')](respondWithResult(_0x51f0ca,null))[_0xb5ed('0x44')](handleError(_0x51f0ca,null));};exports[_0xb5ed('0x26')]=function(_0x4e35cb,_0x20acd1){return db[_0xb5ed('0x3f')]['find']({'where':{'id':_0x4e35cb['params']['id']}})[_0xb5ed('0x27')](handleEntityNotFound(_0x20acd1,null))[_0xb5ed('0x27')](removeEntity(_0x20acd1,null))[_0xb5ed('0x44')](handleError(_0x20acd1,null));};exports[_0xb5ed('0x4c')]=function(_0x5e8571,_0xa61e31){return db[_0xb5ed('0x3f')][_0xb5ed('0x4c')]()['then'](respondWithResult(_0xa61e31,null))[_0xb5ed('0x44')](handleError(_0xa61e31,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index b3914ee..0be05b0 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 _0x48d1=['../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','project_name','leaveAt','lodash'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0x48d1,0x154));var _0x148d=function(_0xf6843,_0x4097c8){_0xf6843=_0xf6843-0x0;var _0x2a2aca=_0x48d1[_0xf6843];return _0x2a2aca;};'use strict';var _=require(_0x148d('0x0'));var util=require('util');var logger=require(_0x148d('0x1'))(_0x148d('0x2'));var moment=require(_0x148d('0x3'));var BPromise=require('bluebird');var rp=require(_0x148d('0x4'));var fs=require('fs');var path=require(_0x148d('0x5'));var rimraf=require('rimraf');var config=require(_0x148d('0x6'));var attributes=require('./squareReport.attributes');module[_0x148d('0x7')]=function(_0x3779ed,_0x2549a8){return _0x3779ed[_0x148d('0x8')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x148d('0x9')]},{'name':_0x148d('0xa'),'fields':[_0x148d('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x279b=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x279b,0xfd));var _0xb279=function(_0xb238bd,_0x41d522){_0xb238bd=_0xb238bd-0x0;var _0x5eb235=_0x279b[_0xb238bd];return _0x5eb235;};'use strict';var _=require(_0xb279('0x0'));var util=require(_0xb279('0x1'));var logger=require(_0xb279('0x2'))(_0xb279('0x3'));var moment=require(_0xb279('0x4'));var BPromise=require(_0xb279('0x5'));var rp=require(_0xb279('0x6'));var fs=require('fs');var path=require(_0xb279('0x7'));var rimraf=require(_0xb279('0x8'));var config=require(_0xb279('0x9'));var attributes=require('./squareReport.attributes');module[_0xb279('0xa')]=function(_0x2cdf7d,_0x3c01c7){return _0x2cdf7d['define'](_0xb279('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xb279('0xc'),'fields':[_0xb279('0xd'),_0xb279('0xe')]},{'name':_0xb279('0xf'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d204027..fa17b3a 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 _0x32e8=['where','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update'];(function(_0x53c424,_0x23fc75){var _0x547710=function(_0xe8d772){while(--_0xe8d772){_0x53c424['push'](_0x53c424['shift']());}};_0x547710(++_0x23fc75);}(_0x32e8,0x122));var _0x832e=function(_0x3520ab,_0x4910f5){_0x3520ab=_0x3520ab-0x0;var _0x19fd8f=_0x32e8[_0x3520ab];return _0x19fd8f;};'use strict';var _=require(_0x832e('0x0'));var util=require(_0x832e('0x1'));var moment=require('moment');var BPromise=require(_0x832e('0x2'));var rs=require(_0x832e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x832e('0x4'))['db'];var utils=require(_0x832e('0x5'));var logger=require(_0x832e('0x6'))(_0x832e('0x7'));var config=require('../../config/environment');var jayson=require(_0x832e('0x8'));var client=jayson[_0x832e('0x9')][_0x832e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e46db,_0x13e43a,_0x2a7d82){return new BPromise(function(_0x3232c2,_0x23f39a){return client['request'](_0x4e46db,_0x2a7d82)[_0x832e('0xb')](function(_0x2a2d37){logger[_0x832e('0xc')](_0x832e('0xd'),_0x13e43a,_0x832e('0xe'));logger[_0x832e('0xf')](_0x832e('0x10'),_0x13e43a,_0x832e('0xe'),JSON[_0x832e('0x11')](_0x2a2d37));if(_0x2a2d37[_0x832e('0x12')]){if(_0x2a2d37[_0x832e('0x12')]['code']===0x1f4){logger[_0x832e('0x12')]('SquareReport,\x20%s,\x20%s',_0x13e43a,_0x2a2d37[_0x832e('0x12')][_0x832e('0x13')]);return _0x23f39a(_0x2a2d37['error'][_0x832e('0x13')]);}logger['error'](_0x832e('0xd'),_0x13e43a,_0x2a2d37[_0x832e('0x12')][_0x832e('0x13')]);return _0x3232c2(_0x2a2d37[_0x832e('0x12')]['message']);}else{logger[_0x832e('0xc')]('SquareReport,\x20%s,\x20%s',_0x13e43a,_0x832e('0xe'));_0x3232c2(_0x2a2d37[_0x832e('0x14')]['message']);}})[_0x832e('0x15')](function(_0x57d44b){logger[_0x832e('0x12')](_0x832e('0xd'),_0x13e43a,_0x57d44b);_0x23f39a(_0x57d44b);});});}exports[_0x832e('0x16')]=function(_0x234b61){var _0x11e981=this;return new Promise(function(_0x57c5d6,_0x4bb06c){return db[_0x832e('0x17')][_0x832e('0x18')](_0x234b61[_0x832e('0x19')],{'raw':_0x234b61[_0x832e('0x1a')]?_0x234b61[_0x832e('0x1a')][_0x832e('0x1b')]===undefined?!![]:![]:!![]})[_0x832e('0xb')](function(_0x314754){logger[_0x832e('0xc')](_0x832e('0x16'),_0x234b61);logger[_0x832e('0xf')](_0x832e('0x16'),_0x234b61,JSON['stringify'](_0x314754));_0x57c5d6(_0x314754);})[_0x832e('0x15')](function(_0x456201){logger[_0x832e('0x12')](_0x832e('0x16'),_0x456201[_0x832e('0x13')],_0x234b61);_0x4bb06c(_0x11e981['error'](0x1f4,_0x456201[_0x832e('0x13')]));});});};exports[_0x832e('0x1c')]=function(_0x338c23){var _0x1dd7de=this;return new Promise(function(_0x2d321b,_0x359af5){return db[_0x832e('0x17')][_0x832e('0x1d')](_0x338c23[_0x832e('0x19')],{'raw':_0x338c23[_0x832e('0x1a')]?_0x338c23[_0x832e('0x1a')][_0x832e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x338c23[_0x832e('0x1a')]?_0x338c23[_0x832e('0x1a')][_0x832e('0x1e')]||null:null,'attributes':_0x338c23['options']?_0x338c23[_0x832e('0x1a')]['attributes']||null:null,'limit':_0x338c23[_0x832e('0x1a')]?_0x338c23['options'][_0x832e('0x1f')]||null:null})[_0x832e('0xb')](function(_0x2c2338){logger[_0x832e('0xc')](_0x832e('0x1c'),_0x338c23);logger[_0x832e('0xf')](_0x832e('0x1c'),_0x338c23,JSON[_0x832e('0x11')](_0x2c2338));_0x2d321b(_0x2c2338);})[_0x832e('0x15')](function(_0x46f886){logger[_0x832e('0x12')](_0x832e('0x1c'),_0x46f886[_0x832e('0x13')],_0x338c23);_0x359af5(_0x1dd7de[_0x832e('0x12')](0x1f4,_0x46f886[_0x832e('0x13')]));});});}; \ No newline at end of file +var _0xffe8=['where','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareReport,\x20%s,\x20%s','catch','CreateSquareReport','SquareReport','create','options','then','info','UpdateSquareReport','update','body','raw'];(function(_0x43945d,_0x43d61c){var _0xfda9cb=function(_0x3898ed){while(--_0x3898ed){_0x43945d['push'](_0x43945d['shift']());}};_0xfda9cb(++_0x43d61c);}(_0xffe8,0x102));var _0x8ffe=function(_0x1509da,_0x1c9210){_0x1509da=_0x1509da-0x0;var _0x215383=_0xffe8[_0x1509da];return _0x215383;};'use strict';var _=require(_0x8ffe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8ffe('0x1'));var rs=require(_0x8ffe('0x2'));var fs=require('fs');var Redis=require(_0x8ffe('0x3'));var db=require(_0x8ffe('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8ffe('0x5'))(_0x8ffe('0x6'));var config=require(_0x8ffe('0x7'));var jayson=require(_0x8ffe('0x8'));var client=jayson['client'][_0x8ffe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35aa02,_0x43741d,_0x1d0f0e){return new BPromise(function(_0x1ed671,_0x59d2f4){return client[_0x8ffe('0xa')](_0x35aa02,_0x1d0f0e)['then'](function(_0x3da7e6){logger['info']('SquareReport,\x20%s,\x20%s',_0x43741d,_0x8ffe('0xb'));logger[_0x8ffe('0xc')](_0x8ffe('0xd'),_0x43741d,_0x8ffe('0xb'),JSON[_0x8ffe('0xe')](_0x3da7e6));if(_0x3da7e6[_0x8ffe('0xf')]){if(_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x10')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x43741d,_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x11')]);return _0x59d2f4(_0x3da7e6[_0x8ffe('0xf')]['message']);}logger[_0x8ffe('0xf')](_0x8ffe('0x12'),_0x43741d,_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x11')]);return _0x1ed671(_0x3da7e6[_0x8ffe('0xf')][_0x8ffe('0x11')]);}else{logger['info'](_0x8ffe('0x12'),_0x43741d,'request\x20sent');_0x1ed671(_0x3da7e6['result'][_0x8ffe('0x11')]);}})[_0x8ffe('0x13')](function(_0x37fc6f){logger[_0x8ffe('0xf')]('SquareReport,\x20%s,\x20%s',_0x43741d,_0x37fc6f);_0x59d2f4(_0x37fc6f);});});}exports[_0x8ffe('0x14')]=function(_0x1816df){var _0x3f688e=this;return new Promise(function(_0x2f6886,_0x1c4525){return db[_0x8ffe('0x15')][_0x8ffe('0x16')](_0x1816df['body'],{'raw':_0x1816df[_0x8ffe('0x17')]?_0x1816df[_0x8ffe('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8ffe('0x18')](function(_0x24487f){logger[_0x8ffe('0x19')](_0x8ffe('0x14'),_0x1816df);logger[_0x8ffe('0xc')](_0x8ffe('0x14'),_0x1816df,JSON[_0x8ffe('0xe')](_0x24487f));_0x2f6886(_0x24487f);})[_0x8ffe('0x13')](function(_0x4f0b0f){logger['error'](_0x8ffe('0x14'),_0x4f0b0f[_0x8ffe('0x11')],_0x1816df);_0x1c4525(_0x3f688e[_0x8ffe('0xf')](0x1f4,_0x4f0b0f[_0x8ffe('0x11')]));});});};exports[_0x8ffe('0x1a')]=function(_0x424ffb){var _0xb08627=this;return new Promise(function(_0x19786e,_0x1546fb){return db[_0x8ffe('0x15')][_0x8ffe('0x1b')](_0x424ffb[_0x8ffe('0x1c')],{'raw':_0x424ffb[_0x8ffe('0x17')]?_0x424ffb[_0x8ffe('0x17')][_0x8ffe('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x424ffb[_0x8ffe('0x17')]?_0x424ffb[_0x8ffe('0x17')][_0x8ffe('0x1e')]||null:null,'attributes':_0x424ffb['options']?_0x424ffb[_0x8ffe('0x17')]['attributes']||null:null,'limit':_0x424ffb[_0x8ffe('0x17')]?_0x424ffb[_0x8ffe('0x17')][_0x8ffe('0x1f')]||null:null})[_0x8ffe('0x18')](function(_0x54b8cd){logger[_0x8ffe('0x19')](_0x8ffe('0x1a'),_0x424ffb);logger[_0x8ffe('0xc')](_0x8ffe('0x1a'),_0x424ffb,JSON['stringify'](_0x54b8cd));_0x19786e(_0x54b8cd);})[_0x8ffe('0x13')](function(_0x22ae86){logger[_0x8ffe('0xf')](_0x8ffe('0x1a'),_0x22ae86[_0x8ffe('0x11')],_0x424ffb);_0x1546fb(_0xb08627[_0x8ffe('0xf')](0x1f4,_0x22ae86[_0x8ffe('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4d38071..d801c8c 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 _0x30d6=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','post','put','/:id','update'];(function(_0x1256d5,_0x5862b8){var _0x246866=function(_0x3da346){while(--_0x3da346){_0x1256d5['push'](_0x1256d5['shift']());}};_0x246866(++_0x5862b8);}(_0x30d6,0x1e5));var _0x630d=function(_0x5555c6,_0x3b388f){_0x5555c6=_0x5555c6-0x0;var _0x5e8dc5=_0x30d6[_0x5555c6];return _0x5e8dc5;};'use strict';var multer=require(_0x630d('0x0'));var util=require(_0x630d('0x1'));var path=require(_0x630d('0x2'));var timeout=require(_0x630d('0x3'));var express=require('express');var router=express[_0x630d('0x4')]();var fs_extra=require(_0x630d('0x5'));var auth=require(_0x630d('0x6'));var interaction=require(_0x630d('0x7'));var config=require(_0x630d('0x8'));var controller=require(_0x630d('0x9'));router[_0x630d('0xa')]('/',auth[_0x630d('0xb')](),controller[_0x630d('0xc')]);router[_0x630d('0xa')](_0x630d('0xd'),auth['isAuthenticated'](),controller[_0x630d('0xe')]);router['get']('/:id',auth[_0x630d('0xb')](),controller['show']);router[_0x630d('0xf')]('/',auth[_0x630d('0xb')](),controller['create']);router[_0x630d('0x10')](_0x630d('0x11'),auth['isAuthenticated'](),controller[_0x630d('0x12')]);router[_0x630d('0x13')](_0x630d('0x11'),auth[_0x630d('0xb')](),controller['destroy']);module[_0x630d('0x14')]=router; \ No newline at end of file +var _0xda84=['exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','/:id','show','delete'];(function(_0x7642c6,_0x424eca){var _0x13330f=function(_0x46e36c){while(--_0x46e36c){_0x7642c6['push'](_0x7642c6['shift']());}};_0x13330f(++_0x424eca);}(_0xda84,0x16d));var _0x4da8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda84[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4da8('0x0'));var router=express[_0x4da8('0x1')]();var fs_extra=require(_0x4da8('0x2'));var auth=require(_0x4da8('0x3'));var interaction=require(_0x4da8('0x4'));var config=require(_0x4da8('0x5'));var controller=require(_0x4da8('0x6'));router[_0x4da8('0x7')]('/',auth[_0x4da8('0x8')](),controller['index']);router['get'](_0x4da8('0x9'),auth[_0x4da8('0x8')](),controller['describe']);router[_0x4da8('0x7')](_0x4da8('0xa'),auth['isAuthenticated'](),controller[_0x4da8('0xb')]);router['post']('/',auth[_0x4da8('0x8')](),controller['create']);router['put'](_0x4da8('0xa'),auth[_0x4da8('0x8')](),controller['update']);router[_0x4da8('0xc')](_0x4da8('0xa'),auth[_0x4da8('0x8')](),controller['destroy']);module[_0x4da8('0xd')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 95a6fdf..de33af9 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 _0xc291=['TEXT','sequelize','exports','STRING'];(function(_0x218d52,_0x68735d){var _0x574c92=function(_0x443823){while(--_0x443823){_0x218d52['push'](_0x218d52['shift']());}};_0x574c92(++_0x68735d);}(_0xc291,0x1d5));var _0x1c29=function(_0x3f096b,_0x1a864f){_0x3f096b=_0x3f096b-0x0;var _0x204ba4=_0xc291[_0x3f096b];return _0x204ba4;};'use strict';var Sequelize=require(_0x1c29('0x0'));module[_0x1c29('0x1')]={'uniqueid':{'type':Sequelize[_0x1c29('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x1c29('0x2')]},'data':{'type':Sequelize[_0x1c29('0x3')]},'project_name':{'type':Sequelize[_0x1c29('0x2')]},'callerid':{'type':Sequelize[_0x1c29('0x2')]}}; \ No newline at end of file +var _0x121c=['TEXT','STRING'];(function(_0x4996d5,_0x123daf){var _0x4793f9=function(_0x30c7ec){while(--_0x30c7ec){_0x4996d5['push'](_0x4996d5['shift']());}};_0x4793f9(++_0x123daf);}(_0x121c,0x95));var _0xc121=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x121c[_0x1e3c16];return _0x47a0c9;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xc121('0x0')]},'node':{'type':Sequelize[_0xc121('0x0')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xc121('0x1')]},'project_name':{'type':Sequelize[_0xc121('0x0')]},'callerid':{'type':Sequelize[_0xc121('0x0')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 464ac06..41ebee9 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 _0x8d37=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','stack','name','send','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','SquareDetailsReport','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce'];(function(_0x1feaba,_0x2a1c12){var _0x3f1c7b=function(_0x39e8e4){while(--_0x39e8e4){_0x1feaba['push'](_0x1feaba['shift']());}};_0x3f1c7b(++_0x2a1c12);}(_0x8d37,0x1a2));var _0x78d3=function(_0x37eb00,_0x339a01){_0x37eb00=_0x37eb00-0x0;var _0x3c61c0=_0x8d37[_0x37eb00];return _0x3c61c0;};'use strict';var emlformat=require(_0x78d3('0x0'));var rimraf=require(_0x78d3('0x1'));var zipdir=require(_0x78d3('0x2'));var jsonpatch=require(_0x78d3('0x3'));var rp=require(_0x78d3('0x4'));var moment=require(_0x78d3('0x5'));var BPromise=require(_0x78d3('0x6'));var Mustache=require(_0x78d3('0x7'));var util=require('util');var path=require(_0x78d3('0x8'));var sox=require(_0x78d3('0x9'));var csv=require(_0x78d3('0xa'));var ejs=require(_0x78d3('0xb'));var fs=require('fs');var fs_extra=require(_0x78d3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x78d3('0xd'));var deskjs=require(_0x78d3('0xe'));var toCsv=require(_0x78d3('0xa'));var querystring=require(_0x78d3('0xf'));var Papa=require('papaparse');var Redis=require(_0x78d3('0x10'));var authService=require(_0x78d3('0x11'));var qs=require(_0x78d3('0x12'));var as=require(_0x78d3('0x13'));var hardwareService=require(_0x78d3('0x14'));var logger=require('../../config/logger')(_0x78d3('0x15'));var utils=require(_0x78d3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x78d3('0x17'));var db=require(_0x78d3('0x18'))['db'];function respondWithStatusCode(_0xeb3575,_0x436d0d){_0x436d0d=_0x436d0d||0xcc;return function(_0x5e2de){if(_0x5e2de){return _0xeb3575[_0x78d3('0x19')](_0x436d0d);}return _0xeb3575[_0x78d3('0x1a')](_0x436d0d)[_0x78d3('0x1b')]();};}function respondWithResult(_0x1dbcca,_0x57707b){_0x57707b=_0x57707b||0xc8;return function(_0x437724){if(_0x437724){return _0x1dbcca[_0x78d3('0x1a')](_0x57707b)[_0x78d3('0x1c')](_0x437724);}};}function respondWithFilteredResult(_0x3730b9,_0x4661c2){return function(_0x4e6bc7){if(_0x4e6bc7){var _0x27844c=typeof _0x4661c2[_0x78d3('0x1d')]==='undefined'&&typeof _0x4661c2['limit']===_0x78d3('0x1e');var _0x5dbc87=_0x4e6bc7[_0x78d3('0x1f')];var _0x5df756=_0x27844c?0x0:_0x4661c2[_0x78d3('0x1d')];var _0xef2d17=_0x27844c?_0x4e6bc7[_0x78d3('0x1f')]:_0x4661c2['offset']+_0x4661c2[_0x78d3('0x20')];var _0x39573a;if(_0xef2d17>=_0x5dbc87){_0xef2d17=_0x5dbc87;_0x39573a=0xc8;}else{_0x39573a=0xce;}_0x3730b9[_0x78d3('0x1a')](_0x39573a);return _0x3730b9[_0x78d3('0x21')]('Content-Range',_0x5df756+'-'+_0xef2d17+'/'+_0x5dbc87)[_0x78d3('0x1c')](_0x4e6bc7);}return null;};}function patchUpdates(_0x13a118){return function(_0x56be1c){try{jsonpatch['apply'](_0x56be1c,_0x13a118,!![]);}catch(_0x2f64aa){return BPromise[_0x78d3('0x22')](_0x2f64aa);}return _0x56be1c[_0x78d3('0x23')]();};}function saveUpdates(_0x56cc8b,_0x39a80d){return function(_0x2e5a32){if(_0x2e5a32){return _0x2e5a32[_0x78d3('0x24')](_0x56cc8b)[_0x78d3('0x25')](function(_0x4c28ce){return _0x4c28ce;});}return null;};}function removeEntity(_0x168dac,_0x471238){return function(_0xf41196){if(_0xf41196){return _0xf41196['destroy']()[_0x78d3('0x25')](function(){_0x168dac[_0x78d3('0x1a')](0xcc)[_0x78d3('0x1b')]();});}};}function handleEntityNotFound(_0x159e22,_0x5d3473){return function(_0x3b2efb){if(!_0x3b2efb){_0x159e22[_0x78d3('0x19')](0x194);}return _0x3b2efb;};}function handleError(_0x601186,_0x546e6a){_0x546e6a=_0x546e6a||0x1f4;return function(_0x27c32d){logger['error'](_0x27c32d[_0x78d3('0x26')]);if(_0x27c32d[_0x78d3('0x27')]){delete _0x27c32d[_0x78d3('0x27')];}_0x601186[_0x78d3('0x1a')](_0x546e6a)[_0x78d3('0x28')](_0x27c32d);};}exports['index']=function(_0x3e08e6,_0x4465df){var _0x4a4d87={},_0x1458ac={},_0x5c1eeb={'count':0x0,'rows':[]};var _0x5b02da=_['map'](db['SquareDetailsReport'][_0x78d3('0x29')],function(_0x379985){return{'name':_0x379985['fieldName'],'type':_0x379985['type']['key']};});_0x1458ac[_0x78d3('0x2a')]=_['map'](_0x5b02da,_0x78d3('0x27'));_0x1458ac[_0x78d3('0x2b')]=_[_0x78d3('0x2c')](_0x3e08e6[_0x78d3('0x2b')]);_0x1458ac[_0x78d3('0x2d')]=_[_0x78d3('0x2e')](_0x1458ac[_0x78d3('0x2a')],_0x1458ac['query']);_0x4a4d87[_0x78d3('0x2f')]=_[_0x78d3('0x2e')](_0x1458ac[_0x78d3('0x2a')],qs[_0x78d3('0x30')](_0x3e08e6['query'][_0x78d3('0x30')]));_0x4a4d87[_0x78d3('0x2f')]=_0x4a4d87['attributes'][_0x78d3('0x31')]?_0x4a4d87[_0x78d3('0x2f')]:_0x1458ac['model'];if(!_0x3e08e6[_0x78d3('0x2b')]['hasOwnProperty'](_0x78d3('0x32'))){_0x4a4d87['limit']=qs[_0x78d3('0x20')](_0x3e08e6[_0x78d3('0x2b')][_0x78d3('0x20')]);_0x4a4d87[_0x78d3('0x1d')]=qs['offset'](_0x3e08e6['query']['offset']);}_0x4a4d87[_0x78d3('0x33')]=qs[_0x78d3('0x34')](_0x3e08e6[_0x78d3('0x2b')][_0x78d3('0x34')]);_0x4a4d87[_0x78d3('0x35')]=qs[_0x78d3('0x2d')](_[_0x78d3('0x36')](_0x3e08e6[_0x78d3('0x2b')],_0x1458ac[_0x78d3('0x2d')]),_0x5b02da);if(_0x3e08e6[_0x78d3('0x2b')][_0x78d3('0x37')]){_0x4a4d87[_0x78d3('0x35')]=_[_0x78d3('0x38')](_0x4a4d87[_0x78d3('0x35')],{'$or':_['map'](_0x5b02da,function(_0x58cb9c){if(_0x58cb9c[_0x78d3('0x39')]!=='VIRTUAL'){var _0x4e8b6f={};_0x4e8b6f[_0x58cb9c[_0x78d3('0x27')]]={'$like':'%'+_0x3e08e6['query'][_0x78d3('0x37')]+'%'};return _0x4e8b6f;}})});}_0x4a4d87=_[_0x78d3('0x38')]({},_0x4a4d87,_0x3e08e6[_0x78d3('0x3a')]);var _0x345503={'where':_0x4a4d87[_0x78d3('0x35')]};return db['SquareDetailsReport']['count'](_0x345503)[_0x78d3('0x25')](function(_0x4e2e35){_0x5c1eeb[_0x78d3('0x1f')]=_0x4e2e35;if(_0x3e08e6[_0x78d3('0x2b')][_0x78d3('0x3b')]){_0x4a4d87[_0x78d3('0x3c')]=[{'all':!![]}];}return db[_0x78d3('0x3d')][_0x78d3('0x3e')](_0x4a4d87);})['then'](function(_0x5a0f3e){_0x5c1eeb[_0x78d3('0x3f')]=_0x5a0f3e;return _0x5c1eeb;})[_0x78d3('0x25')](respondWithFilteredResult(_0x4465df,_0x4a4d87))[_0x78d3('0x40')](handleError(_0x4465df,null));};exports[_0x78d3('0x41')]=function(_0x4955ab,_0x39f68d){var _0x38c83b={'raw':!![],'where':{'id':_0x4955ab[_0x78d3('0x42')]['id']}},_0x549dbe={};_0x549dbe[_0x78d3('0x2a')]=_[_0x78d3('0x2c')](db['SquareDetailsReport'][_0x78d3('0x29')]);_0x549dbe[_0x78d3('0x2b')]=_[_0x78d3('0x2c')](_0x4955ab[_0x78d3('0x2b')]);_0x549dbe['filters']=_[_0x78d3('0x2e')](_0x549dbe[_0x78d3('0x2a')],_0x549dbe[_0x78d3('0x2b')]);_0x38c83b[_0x78d3('0x2f')]=_[_0x78d3('0x2e')](_0x549dbe[_0x78d3('0x2a')],qs['fields'](_0x4955ab['query'][_0x78d3('0x30')]));_0x38c83b[_0x78d3('0x2f')]=_0x38c83b[_0x78d3('0x2f')][_0x78d3('0x31')]?_0x38c83b['attributes']:_0x549dbe[_0x78d3('0x2a')];if(_0x4955ab[_0x78d3('0x2b')]['includeAll']){_0x38c83b[_0x78d3('0x3c')]=[{'all':!![]}];}_0x38c83b=_[_0x78d3('0x38')]({},_0x38c83b,_0x4955ab[_0x78d3('0x3a')]);return db[_0x78d3('0x3d')][_0x78d3('0x43')](_0x38c83b)['then'](handleEntityNotFound(_0x39f68d,null))[_0x78d3('0x25')](respondWithResult(_0x39f68d,null))[_0x78d3('0x40')](handleError(_0x39f68d,null));};exports[_0x78d3('0x44')]=function(_0x1c7c40,_0x56cef3){return db[_0x78d3('0x3d')][_0x78d3('0x44')](_0x1c7c40[_0x78d3('0x45')],{})[_0x78d3('0x25')](respondWithResult(_0x56cef3,0xc9))['catch'](handleError(_0x56cef3,null));};exports[_0x78d3('0x24')]=function(_0x2e30a3,_0x1e0c15){if(_0x2e30a3[_0x78d3('0x45')]['id']){delete _0x2e30a3[_0x78d3('0x45')]['id'];}return db[_0x78d3('0x3d')][_0x78d3('0x43')]({'where':{'id':_0x2e30a3[_0x78d3('0x42')]['id']}})[_0x78d3('0x25')](handleEntityNotFound(_0x1e0c15,null))[_0x78d3('0x25')](saveUpdates(_0x2e30a3['body'],null))[_0x78d3('0x25')](respondWithResult(_0x1e0c15,null))[_0x78d3('0x40')](handleError(_0x1e0c15,null));};exports[_0x78d3('0x46')]=function(_0x208591,_0x42d60b){return db[_0x78d3('0x3d')]['find']({'where':{'id':_0x208591[_0x78d3('0x42')]['id']}})[_0x78d3('0x25')](handleEntityNotFound(_0x42d60b,null))[_0x78d3('0x25')](removeEntity(_0x42d60b,null))['catch'](handleError(_0x42d60b,null));};exports[_0x78d3('0x47')]=function(_0x441655,_0x557578){return db[_0x78d3('0x3d')][_0x78d3('0x47')]()[_0x78d3('0x25')](respondWithResult(_0x557578,null))[_0x78d3('0x40')](handleError(_0x557578,null));}; \ No newline at end of file +var _0xa131=['name','map','SquareDetailsReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x36dd2d,_0x58a38a){var _0x5cb99a=function(_0x19a76b){while(--_0x19a76b){_0x36dd2d['push'](_0x36dd2d['shift']());}};_0x5cb99a(++_0x58a38a);}(_0xa131,0x6b));var _0x1a13=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xa131[_0x4bb66f];return _0xf2772f;};'use strict';var emlformat=require(_0x1a13('0x0'));var rimraf=require(_0x1a13('0x1'));var zipdir=require(_0x1a13('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a13('0x3'));var moment=require(_0x1a13('0x4'));var BPromise=require(_0x1a13('0x5'));var Mustache=require(_0x1a13('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1a13('0x7'));var ejs=require(_0x1a13('0x8'));var fs=require('fs');var fs_extra=require(_0x1a13('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1a13('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1a13('0xb'));var toCsv=require(_0x1a13('0x7'));var querystring=require(_0x1a13('0xc'));var Papa=require(_0x1a13('0xd'));var Redis=require(_0x1a13('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a13('0xf'));var hardwareService=require(_0x1a13('0x10'));var logger=require(_0x1a13('0x11'))(_0x1a13('0x12'));var utils=require(_0x1a13('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a13('0x14'))['db'];function respondWithStatusCode(_0x51e0b7,_0x41b2fd){_0x41b2fd=_0x41b2fd||0xcc;return function(_0x2bb6d8){if(_0x2bb6d8){return _0x51e0b7[_0x1a13('0x15')](_0x41b2fd);}return _0x51e0b7[_0x1a13('0x16')](_0x41b2fd)[_0x1a13('0x17')]();};}function respondWithResult(_0x23eccf,_0x109450){_0x109450=_0x109450||0xc8;return function(_0x4f707c){if(_0x4f707c){return _0x23eccf[_0x1a13('0x16')](_0x109450)[_0x1a13('0x18')](_0x4f707c);}};}function respondWithFilteredResult(_0x4266e3,_0x3b83ec){return function(_0x33ed40){if(_0x33ed40){var _0x42eb57=typeof _0x3b83ec[_0x1a13('0x19')]===_0x1a13('0x1a')&&typeof _0x3b83ec[_0x1a13('0x1b')]==='undefined';var _0x4fe35c=_0x33ed40[_0x1a13('0x1c')];var _0x184212=_0x42eb57?0x0:_0x3b83ec[_0x1a13('0x19')];var _0x299a1c=_0x42eb57?_0x33ed40[_0x1a13('0x1c')]:_0x3b83ec['offset']+_0x3b83ec[_0x1a13('0x1b')];var _0x4c582c;if(_0x299a1c>=_0x4fe35c){_0x299a1c=_0x4fe35c;_0x4c582c=0xc8;}else{_0x4c582c=0xce;}_0x4266e3[_0x1a13('0x16')](_0x4c582c);return _0x4266e3[_0x1a13('0x1d')](_0x1a13('0x1e'),_0x184212+'-'+_0x299a1c+'/'+_0x4fe35c)[_0x1a13('0x18')](_0x33ed40);}return null;};}function patchUpdates(_0x5b1ab8){return function(_0x323983){try{jsonpatch[_0x1a13('0x1f')](_0x323983,_0x5b1ab8,!![]);}catch(_0x384db8){return BPromise[_0x1a13('0x20')](_0x384db8);}return _0x323983[_0x1a13('0x21')]();};}function saveUpdates(_0x3d25e6,_0x395bb2){return function(_0x3fd73e){if(_0x3fd73e){return _0x3fd73e[_0x1a13('0x22')](_0x3d25e6)[_0x1a13('0x23')](function(_0x4f4444){return _0x4f4444;});}return null;};}function removeEntity(_0x1f11da,_0x278a6f){return function(_0x11a4dc){if(_0x11a4dc){return _0x11a4dc[_0x1a13('0x24')]()['then'](function(){_0x1f11da['status'](0xcc)[_0x1a13('0x17')]();});}};}function handleEntityNotFound(_0x22d9d9,_0x5a42d4){return function(_0x5ad4c9){if(!_0x5ad4c9){_0x22d9d9['sendStatus'](0x194);}return _0x5ad4c9;};}function handleError(_0x33719f,_0x7b6390){_0x7b6390=_0x7b6390||0x1f4;return function(_0x1cbe08){logger[_0x1a13('0x25')](_0x1cbe08[_0x1a13('0x26')]);if(_0x1cbe08[_0x1a13('0x27')]){delete _0x1cbe08['name'];}_0x33719f[_0x1a13('0x16')](_0x7b6390)['send'](_0x1cbe08);};}exports['index']=function(_0x175f02,_0x449057){var _0x1645f6={},_0x2a65fb={},_0x13b499={'count':0x0,'rows':[]};var _0x163397=_[_0x1a13('0x28')](db[_0x1a13('0x29')][_0x1a13('0x2a')],function(_0x34b11c){return{'name':_0x34b11c[_0x1a13('0x2b')],'type':_0x34b11c[_0x1a13('0x2c')][_0x1a13('0x2d')]};});_0x2a65fb['model']=_[_0x1a13('0x28')](_0x163397,_0x1a13('0x27'));_0x2a65fb[_0x1a13('0x2e')]=_[_0x1a13('0x2f')](_0x175f02[_0x1a13('0x2e')]);_0x2a65fb[_0x1a13('0x30')]=_['intersection'](_0x2a65fb['model'],_0x2a65fb[_0x1a13('0x2e')]);_0x1645f6['attributes']=_[_0x1a13('0x31')](_0x2a65fb[_0x1a13('0x32')],qs[_0x1a13('0x33')](_0x175f02['query']['fields']));_0x1645f6[_0x1a13('0x34')]=_0x1645f6[_0x1a13('0x34')][_0x1a13('0x35')]?_0x1645f6[_0x1a13('0x34')]:_0x2a65fb[_0x1a13('0x32')];if(!_0x175f02[_0x1a13('0x2e')][_0x1a13('0x36')]('nolimit')){_0x1645f6[_0x1a13('0x1b')]=qs['limit'](_0x175f02[_0x1a13('0x2e')][_0x1a13('0x1b')]);_0x1645f6[_0x1a13('0x19')]=qs[_0x1a13('0x19')](_0x175f02[_0x1a13('0x2e')]['offset']);}_0x1645f6[_0x1a13('0x37')]=qs[_0x1a13('0x38')](_0x175f02[_0x1a13('0x2e')][_0x1a13('0x38')]);_0x1645f6[_0x1a13('0x39')]=qs[_0x1a13('0x30')](_[_0x1a13('0x3a')](_0x175f02[_0x1a13('0x2e')],_0x2a65fb[_0x1a13('0x30')]),_0x163397);if(_0x175f02[_0x1a13('0x2e')]['filter']){_0x1645f6['where']=_[_0x1a13('0x3b')](_0x1645f6[_0x1a13('0x39')],{'$or':_['map'](_0x163397,function(_0xbe66a2){if(_0xbe66a2[_0x1a13('0x2c')]!==_0x1a13('0x3c')){var _0x367d01={};_0x367d01[_0xbe66a2[_0x1a13('0x27')]]={'$like':'%'+_0x175f02['query'][_0x1a13('0x3d')]+'%'};return _0x367d01;}})});}_0x1645f6=_[_0x1a13('0x3b')]({},_0x1645f6,_0x175f02[_0x1a13('0x3e')]);var _0x1ebb81={'where':_0x1645f6[_0x1a13('0x39')]};return db[_0x1a13('0x29')]['count'](_0x1ebb81)[_0x1a13('0x23')](function(_0x51c487){_0x13b499[_0x1a13('0x1c')]=_0x51c487;if(_0x175f02['query'][_0x1a13('0x3f')]){_0x1645f6[_0x1a13('0x40')]=[{'all':!![]}];}return db['SquareDetailsReport']['findAll'](_0x1645f6);})[_0x1a13('0x23')](function(_0x109be0){_0x13b499[_0x1a13('0x41')]=_0x109be0;return _0x13b499;})['then'](respondWithFilteredResult(_0x449057,_0x1645f6))['catch'](handleError(_0x449057,null));};exports[_0x1a13('0x42')]=function(_0x47f8a6,_0x49b3ef){var _0x3c02e0={'raw':!![],'where':{'id':_0x47f8a6[_0x1a13('0x43')]['id']}},_0x1b9dd4={};_0x1b9dd4['model']=_[_0x1a13('0x2f')](db[_0x1a13('0x29')][_0x1a13('0x2a')]);_0x1b9dd4[_0x1a13('0x2e')]=_['keys'](_0x47f8a6['query']);_0x1b9dd4[_0x1a13('0x30')]=_[_0x1a13('0x31')](_0x1b9dd4[_0x1a13('0x32')],_0x1b9dd4['query']);_0x3c02e0[_0x1a13('0x34')]=_['intersection'](_0x1b9dd4[_0x1a13('0x32')],qs[_0x1a13('0x33')](_0x47f8a6[_0x1a13('0x2e')][_0x1a13('0x33')]));_0x3c02e0['attributes']=_0x3c02e0[_0x1a13('0x34')][_0x1a13('0x35')]?_0x3c02e0['attributes']:_0x1b9dd4['model'];if(_0x47f8a6[_0x1a13('0x2e')]['includeAll']){_0x3c02e0[_0x1a13('0x40')]=[{'all':!![]}];}_0x3c02e0=_['merge']({},_0x3c02e0,_0x47f8a6[_0x1a13('0x3e')]);return db[_0x1a13('0x29')][_0x1a13('0x44')](_0x3c02e0)[_0x1a13('0x23')](handleEntityNotFound(_0x49b3ef,null))[_0x1a13('0x23')](respondWithResult(_0x49b3ef,null))[_0x1a13('0x45')](handleError(_0x49b3ef,null));};exports['create']=function(_0x7289a2,_0x4f2790){return db[_0x1a13('0x29')][_0x1a13('0x46')](_0x7289a2['body'],{})[_0x1a13('0x23')](respondWithResult(_0x4f2790,0xc9))[_0x1a13('0x45')](handleError(_0x4f2790,null));};exports[_0x1a13('0x22')]=function(_0x554580,_0x53fb0a){if(_0x554580[_0x1a13('0x47')]['id']){delete _0x554580['body']['id'];}return db[_0x1a13('0x29')][_0x1a13('0x44')]({'where':{'id':_0x554580[_0x1a13('0x43')]['id']}})[_0x1a13('0x23')](handleEntityNotFound(_0x53fb0a,null))['then'](saveUpdates(_0x554580[_0x1a13('0x47')],null))[_0x1a13('0x23')](respondWithResult(_0x53fb0a,null))[_0x1a13('0x45')](handleError(_0x53fb0a,null));};exports[_0x1a13('0x24')]=function(_0x4ef122,_0x5a4931){return db['SquareDetailsReport']['find']({'where':{'id':_0x4ef122[_0x1a13('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a4931,null))[_0x1a13('0x23')](removeEntity(_0x5a4931,null))[_0x1a13('0x45')](handleError(_0x5a4931,null));};exports[_0x1a13('0x48')]=function(_0x444824,_0x108824){return db[_0x1a13('0x29')]['describe']()[_0x1a13('0x23')](respondWithResult(_0x108824,null))['catch'](handleError(_0x108824,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index b3359b9..57ea6d4 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 _0x682d=['path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','api','moment','bluebird'];(function(_0x30917d,_0x362452){var _0x589c75=function(_0x336355){while(--_0x336355){_0x30917d['push'](_0x30917d['shift']());}};_0x589c75(++_0x362452);}(_0x682d,0xc7));var _0xd682=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x682d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd682('0x0'));var util=require(_0xd682('0x1'));var logger=require('../../config/logger')(_0xd682('0x2'));var moment=require(_0xd682('0x3'));var BPromise=require(_0xd682('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd682('0x5'));var rimraf=require('rimraf');var config=require(_0xd682('0x6'));var attributes=require(_0xd682('0x7'));module[_0xd682('0x8')]=function(_0x263dde,_0x1d9ac5){return _0x263dde[_0xd682('0x9')](_0xd682('0xa'),attributes,{'tableName':_0xd682('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x607d=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','exports','define','SquareDetailsReport','report_square_details'];(function(_0x30af6d,_0x1c2ae6){var _0x25d333=function(_0x1f93dc){while(--_0x1f93dc){_0x30af6d['push'](_0x30af6d['shift']());}};_0x25d333(++_0x1c2ae6);}(_0x607d,0xb4));var _0xd607=function(_0x302562,_0x3df446){_0x302562=_0x302562-0x0;var _0x1b7031=_0x607d[_0x302562];return _0x1b7031;};'use strict';var _=require('lodash');var util=require(_0xd607('0x0'));var logger=require(_0xd607('0x1'))(_0xd607('0x2'));var moment=require('moment');var BPromise=require(_0xd607('0x3'));var rp=require(_0xd607('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd607('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0xd607('0x6')]=function(_0x4a5385,_0xdeb1e7){return _0x4a5385[_0xd607('0x7')](_0xd607('0x8'),attributes,{'tableName':_0xd607('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index b957564..25a0697 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 _0x5eb8=['CreateSquareDetailsReport','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','catch','SquareDetailsReport','create','body','options','raw','then'];(function(_0x1a8fef,_0x1a5828){var _0x141faa=function(_0x42a338){while(--_0x42a338){_0x1a8fef['push'](_0x1a8fef['shift']());}};_0x141faa(++_0x1a5828);}(_0x5eb8,0xb0));var _0x85eb=function(_0x47fb54,_0x28698c){_0x47fb54=_0x47fb54-0x0;var _0x1139a7=_0x5eb8[_0x47fb54];return _0x1139a7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateSquareDetailsReport']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateSquareDetailsReport',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});}; \ No newline at end of file +var _0x4e81=['stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s'];(function(_0x358c36,_0x28fc15){var _0x46d384=function(_0x5ca9d9){while(--_0x5ca9d9){_0x358c36['push'](_0x358c36['shift']());}};_0x46d384(++_0x28fc15);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x4e81[_0x2c0be1];return _0x3d4bd2;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});}exports[_0x14e8('0x15')]=function(_0x10dc8b){var _0x462259=this;return new Promise(function(_0x5a38c1,_0x328c5a){return db[_0x14e8('0x16')][_0x14e8('0x17')](_0x10dc8b[_0x14e8('0x18')],{'raw':_0x10dc8b[_0x14e8('0x19')]?_0x10dc8b['options'][_0x14e8('0x1a')]===undefined?!![]:![]:!![]})[_0x14e8('0xa')](function(_0x2abfec){logger['info'](_0x14e8('0x15'),_0x10dc8b);logger['debug'](_0x14e8('0x15'),_0x10dc8b,JSON[_0x14e8('0xf')](_0x2abfec));_0x5a38c1(_0x2abfec);})[_0x14e8('0x14')](function(_0x117b00){logger[_0x14e8('0x10')]('CreateSquareDetailsReport',_0x117b00[_0x14e8('0x13')],_0x10dc8b);_0x328c5a(_0x462259['error'](0x1f4,_0x117b00[_0x14e8('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 3378c1c..445fd4e 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 _0x1d7a=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router'];(function(_0x4a710d,_0x5ad9f2){var _0x5b4a31=function(_0x2c3139){while(--_0x2c3139){_0x4a710d['push'](_0x4a710d['shift']());}};_0x5b4a31(++_0x5ad9f2);}(_0x1d7a,0xcd));var _0xa1d7=function(_0xcb48ca,_0x540ecb){_0xcb48ca=_0xcb48ca-0x0;var _0x37be10=_0x1d7a[_0xcb48ca];return _0x37be10;};'use strict';var express=require(_0xa1d7('0x0'));var router=express[_0xa1d7('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa1d7('0x2'));router[_0xa1d7('0x3')]('/',auth[_0xa1d7('0x4')](),controller[_0xa1d7('0x5')]);router['get'](_0xa1d7('0x6'),auth[_0xa1d7('0x4')](),controller[_0xa1d7('0x7')]);module[_0xa1d7('0x8')]=router; \ No newline at end of file +var _0xfee0=['express','Router','./system.controller','get','index','/process/:pid/kill','isAuthenticated','killProcess','exports'];(function(_0x89a20e,_0x34e634){var _0x505b80=function(_0x6244c2){while(--_0x6244c2){_0x89a20e['push'](_0x89a20e['shift']());}};_0x505b80(++_0x34e634);}(_0xfee0,0xcf));var _0x0fee=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0xfee0[_0x55ff3e];return _0x2709eb;};'use strict';var express=require(_0x0fee('0x0'));var router=express[_0x0fee('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x0fee('0x2'));router[_0x0fee('0x3')]('/',auth['isAuthenticated'](),controller[_0x0fee('0x4')]);router['get'](_0x0fee('0x5'),auth[_0x0fee('0x6')](),controller[_0x0fee('0x7')]);module[_0x0fee('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 5c4bb13..26b4c9f 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 _0x8084=['status','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','format','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','getAllData','then'];(function(_0x45db40,_0x1225bb){var _0x1de079=function(_0x327a74){while(--_0x327a74){_0x45db40['push'](_0x45db40['shift']());}};_0x1de079(++_0x1225bb);}(_0x8084,0x13b));var _0x4808=function(_0x45dc70,_0x18e65e){_0x45dc70=_0x45dc70-0x0;var _0x564fab=_0x8084[_0x45dc70];return _0x564fab;};'use strict';var info=require(_0x4808('0x0'));var exec=require(_0x4808('0x1'))[_0x4808('0x2')];var logger=require(_0x4808('0x3'))(_0x4808('0x4'));var util=require(_0x4808('0x5'));var BPromise=require(_0x4808('0x6'));var _=require(_0x4808('0x7'));function handleError(_0x4a702e,_0x3e467e,_0x175b52){_0x3e467e=_0x3e467e||0x1f4;return function(_0x1a891c){logger[_0x4808('0x8')](_0x4808('0x9'),_0x175b52,_0x3e467e,util[_0x4808('0xa')](_0x1a891c,{'showHidden':![],'depth':null}));delete _0x1a891c[_0x4808('0xb')];_0x4a702e['status'](_0x3e467e)[_0x4808('0xc')](_0x1a891c);};}exports['index']=function(_0x318b96,_0x533aab){return info[_0x4808('0xd')]()[_0x4808('0xe')](function(_0x4428d4){return _0x533aab[_0x4808('0xf')](0xc8)['json'](_0x4428d4);})[_0x4808('0x10')](function(_0x196edc){return _0x533aab[_0x4808('0xf')](0x1f4)[_0x4808('0x11')](_0x196edc);});};exports[_0x4808('0x12')]=function(_0x439702,_0x41454a){var _0x29a0b0=[_0x4808('0x13')];return new BPromise(function(_0x253af5,_0x2f2058){return exec(util['format'](_0x4808('0x14'),_0x439702[_0x4808('0x15')]['pid']),function(_0xf669e8,_0x5d0615,_0x5d1cb1){if(_0xf669e8){return _0x2f2058(_0xf669e8);}return _0x253af5(_0x5d0615);});})[_0x4808('0xe')](function(_0x33546f){var _0x2ed81a=![];var _0x5eae59=_0x33546f[_0x4808('0x16')](/\n/);for(var _0x4221b1=0x0,_0x3b499d=_0x29a0b0[_0x4808('0x17')];_0x4221b1<_0x3b499d,_0x2ed81a===![];_0x4221b1+=0x1){if(_0x33546f[_0x4808('0x18')](_0x29a0b0[_0x4221b1])>=0x0){_0x2ed81a=!![];}}if(!_0x2ed81a){throw new Error(util['format'](_0x4808('0x19'),_0x439702['params'][_0x4808('0x1a')]));}process[_0x4808('0x1b')](_0x439702[_0x4808('0x15')][_0x4808('0x1a')],_0x4808('0x1c'));return _0x41454a['status'](0xc8)[_0x4808('0x11')]({'message':util[_0x4808('0x1d')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x439702[_0x4808('0x15')][_0x4808('0x1a')])});})[_0x4808('0x10')](handleError(_0x41454a,null,_0x4808('0x12')));}; \ No newline at end of file +var _0x3c3b=['components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','format','killProcess','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','then','json','catch'];(function(_0x31dde9,_0x12e816){var _0x1fbf2d=function(_0x1d1bf6){while(--_0x1d1bf6){_0x31dde9['push'](_0x31dde9['shift']());}};_0x1fbf2d(++_0x12e816);}(_0x3c3b,0x6e));var _0xb3c3=function(_0x3f51f2,_0xf795b9){_0x3f51f2=_0x3f51f2-0x0;var _0x23f2d9=_0x3c3b[_0x3f51f2];return _0x23f2d9;};'use strict';var info=require('systeminformation');var exec=require('child_process')['exec'];var logger=require(_0xb3c3('0x0'))(_0xb3c3('0x1'));var util=require(_0xb3c3('0x2'));var BPromise=require(_0xb3c3('0x3'));var _=require(_0xb3c3('0x4'));function handleError(_0x2fe8e,_0x14ba8e,_0x34c0b7){_0x14ba8e=_0x14ba8e||0x1f4;return function(_0x4d0a97){logger[_0xb3c3('0x5')](_0xb3c3('0x6'),_0x34c0b7,_0x14ba8e,util[_0xb3c3('0x7')](_0x4d0a97,{'showHidden':![],'depth':null}));delete _0x4d0a97[_0xb3c3('0x8')];_0x2fe8e[_0xb3c3('0x9')](_0x14ba8e)[_0xb3c3('0xa')](_0x4d0a97);};}exports[_0xb3c3('0xb')]=function(_0x531986,_0x52d2b9){return info['getAllData']()[_0xb3c3('0xc')](function(_0x368026){return _0x52d2b9[_0xb3c3('0x9')](0xc8)[_0xb3c3('0xd')](_0x368026);})[_0xb3c3('0xe')](function(_0x179cf7){return _0x52d2b9['status'](0x1f4)[_0xb3c3('0xd')](_0x179cf7);});};exports['killProcess']=function(_0x538190,_0x2e3400){var _0x106bfe=[_0xb3c3('0xf')];return new BPromise(function(_0x5c61b6,_0x56d931){return exec(util['format'](_0xb3c3('0x10'),_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')]),function(_0x3d20da,_0x520bfb,_0x4c3067){if(_0x3d20da){return _0x56d931(_0x3d20da);}return _0x5c61b6(_0x520bfb);});})[_0xb3c3('0xc')](function(_0x2fbeae){var _0x5be72c=![];var _0x3434aa=_0x2fbeae[_0xb3c3('0x13')](/\n/);for(var _0x140818=0x0,_0x492f68=_0x106bfe['length'];_0x140818<_0x492f68,_0x5be72c===![];_0x140818+=0x1){if(_0x2fbeae[_0xb3c3('0x14')](_0x106bfe[_0x140818])>=0x0){_0x5be72c=!![];}}if(!_0x5be72c){throw new Error(util['format'](_0xb3c3('0x15'),_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')]));}process['kill'](_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')],_0xb3c3('0x16'));return _0x2e3400[_0xb3c3('0x9')](0xc8)[_0xb3c3('0xd')]({'message':util[_0xb3c3('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x538190[_0xb3c3('0x11')][_0xb3c3('0x12')])});})['catch'](handleError(_0x2e3400,null,_0xb3c3('0x18')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 2be557d..8bbe0ee 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 _0x7d7f=['destroy','multer','util','path','express','fs-extra','../../components/interaction/service','./tag.controller','get','/:id','isAuthenticated','show','post','update','delete'];(function(_0x4b7150,_0x5c23df){var _0x298641=function(_0x27e5b0){while(--_0x27e5b0){_0x4b7150['push'](_0x4b7150['shift']());}};_0x298641(++_0x5c23df);}(_0x7d7f,0x1c3));var _0xf7d7=function(_0x42f4f9,_0x199e87){_0x42f4f9=_0x42f4f9-0x0;var _0x4a0fa0=_0x7d7f[_0x42f4f9];return _0x4a0fa0;};'use strict';var multer=require(_0xf7d7('0x0'));var util=require(_0xf7d7('0x1'));var path=require(_0xf7d7('0x2'));var timeout=require('connect-timeout');var express=require(_0xf7d7('0x3'));var router=express['Router']();var fs_extra=require(_0xf7d7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf7d7('0x5'));var config=require('../../config/environment');var controller=require(_0xf7d7('0x6'));router[_0xf7d7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf7d7('0x7')](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller[_0xf7d7('0xa')]);router[_0xf7d7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf7d7('0x8'),auth[_0xf7d7('0x9')](),controller[_0xf7d7('0xc')]);router[_0xf7d7('0xd')]('/:id',auth[_0xf7d7('0x9')](),controller[_0xf7d7('0xe')]);module['exports']=router; \ No newline at end of file +var _0x6e83=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x770a81,_0x1737bc){var _0x5223ad=function(_0x16c892){while(--_0x16c892){_0x770a81['push'](_0x770a81['shift']());}};_0x5223ad(++_0x1737bc);}(_0x6e83,0x16d));var _0x36e8=function(_0x2881e2,_0x341293){_0x2881e2=_0x2881e2-0x0;var _0x5c1e1f=_0x6e83[_0x2881e2];return _0x5c1e1f;};'use strict';var multer=require(_0x36e8('0x0'));var util=require(_0x36e8('0x1'));var path=require(_0x36e8('0x2'));var timeout=require('connect-timeout');var express=require(_0x36e8('0x3'));var router=express[_0x36e8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x36e8('0x5'));var config=require(_0x36e8('0x6'));var controller=require(_0x36e8('0x7'));router[_0x36e8('0x8')]('/',auth[_0x36e8('0x9')](),controller[_0x36e8('0xa')]);router['get'](_0x36e8('0xb'),auth[_0x36e8('0x9')](),controller[_0x36e8('0xc')]);router[_0x36e8('0xd')]('/',auth[_0x36e8('0x9')](),controller[_0x36e8('0xe')]);router[_0x36e8('0xf')](_0x36e8('0xb'),auth[_0x36e8('0x9')](),controller[_0x36e8('0x10')]);router[_0x36e8('0x11')](_0x36e8('0xb'),auth[_0x36e8('0x9')](),controller[_0x36e8('0x12')]);module[_0x36e8('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 ee0ec56..aabe6af 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 _0x0936=['name','#0091EA','sequelize','exports','STRING'];(function(_0x27c1f2,_0x5c3f9a){var _0x3dbf71=function(_0x3fd969){while(--_0x3fd969){_0x27c1f2['push'](_0x27c1f2['shift']());}};_0x3dbf71(++_0x5c3f9a);}(_0x0936,0xde));var _0x6093=function(_0x447f21,_0x13a2f4){_0x447f21=_0x447f21-0x0;var _0x5a1851=_0x0936[_0x447f21];return _0x5a1851;};'use strict';var Sequelize=require(_0x6093('0x0'));module[_0x6093('0x1')]={'name':{'type':Sequelize[_0x6093('0x2')],'unique':_0x6093('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x6093('0x2')],'defaultValue':_0x6093('0x4')},'description':{'type':Sequelize[_0x6093('0x2')]}}; \ No newline at end of file +var _0x1752=['#0091EA','exports','STRING','name'];(function(_0x295fe9,_0x345828){var _0x3b80df=function(_0x85b4dc){while(--_0x85b4dc){_0x295fe9['push'](_0x295fe9['shift']());}};_0x3b80df(++_0x345828);}(_0x1752,0xa5));var _0x2175=function(_0x28e7b0,_0x2b2029){_0x28e7b0=_0x28e7b0-0x0;var _0x2397ef=_0x1752[_0x28e7b0];return _0x2397ef;};'use strict';var Sequelize=require('sequelize');module[_0x2175('0x0')]={'name':{'type':Sequelize[_0x2175('0x1')],'unique':_0x2175('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x2175('0x1')],'defaultValue':_0x2175('0x3')},'description':{'type':Sequelize[_0x2175('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index b15b7d6..ae71758 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 _0xb717=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Tags','end','sendStatus','stack','name','send','map','Tag','rawAttributes','fieldName','type','model'];(function(_0x12e509,_0x5cc458){var _0x299cf3=function(_0x3a6228){while(--_0x3a6228){_0x12e509['push'](_0x12e509['shift']());}};_0x299cf3(++_0x5cc458);}(_0xb717,0x1b4));var _0x7b71=function(_0x4e281a,_0x365198){_0x4e281a=_0x4e281a-0x0;var _0x535aad=_0xb717[_0x4e281a];return _0x535aad;};'use strict';var emlformat=require(_0x7b71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7b71('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7b71('0x2'));var moment=require(_0x7b71('0x3'));var BPromise=require(_0x7b71('0x4'));var Mustache=require('mustache');var util=require(_0x7b71('0x5'));var path=require(_0x7b71('0x6'));var sox=require(_0x7b71('0x7'));var csv=require(_0x7b71('0x8'));var ejs=require(_0x7b71('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b71('0xa'));var squel=require(_0x7b71('0xb'));var crypto=require(_0x7b71('0xc'));var jsforce=require(_0x7b71('0xd'));var deskjs=require(_0x7b71('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7b71('0xf'));var Papa=require(_0x7b71('0x10'));var Redis=require('ioredis');var authService=require(_0x7b71('0x11'));var qs=require(_0x7b71('0x12'));var as=require(_0x7b71('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7b71('0x14'))('api');var utils=require(_0x7b71('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7b71('0x16'));var db=require(_0x7b71('0x17'))['db'];function respondWithStatusCode(_0x291ba5,_0x101181){_0x101181=_0x101181||0xcc;return function(_0x45c890){if(_0x45c890){return _0x291ba5['sendStatus'](_0x101181);}return _0x291ba5[_0x7b71('0x18')](_0x101181)['end']();};}function respondWithResult(_0x121e8f,_0x22114a){_0x22114a=_0x22114a||0xc8;return function(_0x4f1f41){if(_0x4f1f41){return _0x121e8f[_0x7b71('0x18')](_0x22114a)[_0x7b71('0x19')](_0x4f1f41);}};}function respondWithFilteredResult(_0x4266e5,_0x5888f9){return function(_0x5e7c3a){if(_0x5e7c3a){var _0xadd51e=typeof _0x5888f9[_0x7b71('0x1a')]===_0x7b71('0x1b')&&typeof _0x5888f9[_0x7b71('0x1c')]==='undefined';var _0x268090=_0x5e7c3a['count'];var _0x4adce8=_0xadd51e?0x0:_0x5888f9[_0x7b71('0x1a')];var _0xbde25=_0xadd51e?_0x5e7c3a[_0x7b71('0x1d')]:_0x5888f9[_0x7b71('0x1a')]+_0x5888f9[_0x7b71('0x1c')];var _0x51d647;if(_0xbde25>=_0x268090){_0xbde25=_0x268090;_0x51d647=0xc8;}else{_0x51d647=0xce;}_0x4266e5[_0x7b71('0x18')](_0x51d647);return _0x4266e5[_0x7b71('0x1e')](_0x7b71('0x1f'),_0x4adce8+'-'+_0xbde25+'/'+_0x268090)[_0x7b71('0x19')](_0x5e7c3a);}return null;};}function patchUpdates(_0x206000){return function(_0x297918){try{jsonpatch['apply'](_0x297918,_0x206000,!![]);}catch(_0x459c8b){return BPromise[_0x7b71('0x20')](_0x459c8b);}return _0x297918[_0x7b71('0x21')]();};}function saveUpdates(_0x375f85,_0x47d933){return function(_0x55ed9c){if(_0x55ed9c){return _0x55ed9c[_0x7b71('0x22')](_0x375f85)[_0x7b71('0x23')](function(_0x467f1a){return _0x467f1a;});}return null;};}function removeEntity(_0x33ad80,_0x3aca34){return function(_0x478dd8){if(_0x478dd8){return _0x478dd8[_0x7b71('0x24')]()['then'](function(){var _0x16c1f3=_0x478dd8[_0x7b71('0x25')]({'plain':!![]});var _0x19a6f5=_0x7b71('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x19a6f5,'resourceId':_0x16c1f3['id']}})[_0x7b71('0x23')](function(){return _0x478dd8;});})[_0x7b71('0x23')](function(){_0x33ad80['status'](0xcc)[_0x7b71('0x27')]();});}};}function handleEntityNotFound(_0x214555,_0x7c978b){return function(_0x2f9ca9){if(!_0x2f9ca9){_0x214555[_0x7b71('0x28')](0x194);}return _0x2f9ca9;};}function handleError(_0x5209b6,_0x55ae81){_0x55ae81=_0x55ae81||0x1f4;return function(_0x2b323b){logger['error'](_0x2b323b[_0x7b71('0x29')]);if(_0x2b323b['name']){delete _0x2b323b[_0x7b71('0x2a')];}_0x5209b6[_0x7b71('0x18')](_0x55ae81)[_0x7b71('0x2b')](_0x2b323b);};}exports['index']=function(_0x1e4e89,_0xc29e2b){var _0x21ef65={},_0x5b5a4b={},_0x5e11e1={'count':0x0,'rows':[]};var _0xd100d4=_[_0x7b71('0x2c')](db[_0x7b71('0x2d')][_0x7b71('0x2e')],function(_0x43925c){return{'name':_0x43925c[_0x7b71('0x2f')],'type':_0x43925c[_0x7b71('0x30')]['key']};});_0x5b5a4b[_0x7b71('0x31')]=_[_0x7b71('0x2c')](_0xd100d4,_0x7b71('0x2a'));_0x5b5a4b['query']=_[_0x7b71('0x32')](_0x1e4e89[_0x7b71('0x33')]);_0x5b5a4b[_0x7b71('0x34')]=_[_0x7b71('0x35')](_0x5b5a4b[_0x7b71('0x31')],_0x5b5a4b[_0x7b71('0x33')]);_0x21ef65['attributes']=_[_0x7b71('0x35')](_0x5b5a4b[_0x7b71('0x31')],qs[_0x7b71('0x36')](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x36')]));_0x21ef65['attributes']=_0x21ef65[_0x7b71('0x37')][_0x7b71('0x38')]?_0x21ef65[_0x7b71('0x37')]:_0x5b5a4b[_0x7b71('0x31')];if(!_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x39')](_0x7b71('0x3a'))){_0x21ef65[_0x7b71('0x1c')]=qs['limit'](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x1c')]);_0x21ef65[_0x7b71('0x1a')]=qs[_0x7b71('0x1a')](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x1a')]);}_0x21ef65[_0x7b71('0x3b')]=qs['sort'](_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x3c')]);_0x21ef65[_0x7b71('0x3d')]=qs[_0x7b71('0x34')](_['pick'](_0x1e4e89[_0x7b71('0x33')],_0x5b5a4b[_0x7b71('0x34')]),_0xd100d4);if(_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x3e')]){_0x21ef65[_0x7b71('0x3d')]=_[_0x7b71('0x3f')](_0x21ef65[_0x7b71('0x3d')],{'$or':_[_0x7b71('0x2c')](_0xd100d4,function(_0x30e9d1){if(_0x30e9d1[_0x7b71('0x30')]!==_0x7b71('0x40')){var _0x154dd5={};_0x154dd5[_0x30e9d1['name']]={'$like':'%'+_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x3e')]+'%'};return _0x154dd5;}})});}_0x21ef65=_['merge']({},_0x21ef65,_0x1e4e89[_0x7b71('0x41')]);var _0x411c57={'where':_0x21ef65[_0x7b71('0x3d')]};return db[_0x7b71('0x2d')][_0x7b71('0x1d')](_0x411c57)['then'](function(_0x37cf27){_0x5e11e1[_0x7b71('0x1d')]=_0x37cf27;if(_0x1e4e89[_0x7b71('0x33')][_0x7b71('0x42')]){_0x21ef65[_0x7b71('0x43')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x21ef65);})[_0x7b71('0x23')](function(_0x541730){_0x5e11e1[_0x7b71('0x44')]=_0x541730;return _0x5e11e1;})[_0x7b71('0x23')](respondWithFilteredResult(_0xc29e2b,_0x21ef65))[_0x7b71('0x45')](handleError(_0xc29e2b,null));};exports[_0x7b71('0x46')]=function(_0x3c3ffb,_0x324b28){var _0x23a762={'raw':!![],'where':{'id':_0x3c3ffb[_0x7b71('0x47')]['id']}},_0x5b73a6={};_0x5b73a6[_0x7b71('0x31')]=_['keys'](db[_0x7b71('0x2d')][_0x7b71('0x2e')]);_0x5b73a6[_0x7b71('0x33')]=_[_0x7b71('0x32')](_0x3c3ffb[_0x7b71('0x33')]);_0x5b73a6[_0x7b71('0x34')]=_[_0x7b71('0x35')](_0x5b73a6[_0x7b71('0x31')],_0x5b73a6[_0x7b71('0x33')]);_0x23a762[_0x7b71('0x37')]=_[_0x7b71('0x35')](_0x5b73a6[_0x7b71('0x31')],qs[_0x7b71('0x36')](_0x3c3ffb['query'][_0x7b71('0x36')]));_0x23a762[_0x7b71('0x37')]=_0x23a762['attributes']['length']?_0x23a762['attributes']:_0x5b73a6[_0x7b71('0x31')];if(_0x3c3ffb[_0x7b71('0x33')][_0x7b71('0x42')]){_0x23a762['include']=[{'all':!![]}];}_0x23a762=_[_0x7b71('0x3f')]({},_0x23a762,_0x3c3ffb[_0x7b71('0x41')]);return db['Tag'][_0x7b71('0x48')](_0x23a762)[_0x7b71('0x23')](handleEntityNotFound(_0x324b28,null))[_0x7b71('0x23')](respondWithResult(_0x324b28,null))['catch'](handleError(_0x324b28,null));};exports[_0x7b71('0x49')]=function(_0x18cb19,_0x945c68){return db[_0x7b71('0x2d')][_0x7b71('0x49')](_0x18cb19[_0x7b71('0x4a')],{})[_0x7b71('0x23')](function(_0x30e8d8){var _0xdb438=_0x18cb19[_0x7b71('0x4b')][_0x7b71('0x25')]({'plain':!![]});if(!_0xdb438)throw new Error(_0x7b71('0x4c'));if(_0xdb438['role']===_0x7b71('0x4b')){var _0x504cdf=_0x30e8d8[_0x7b71('0x25')]({'plain':!![]});var _0x154f72=_0x7b71('0x26');return db[_0x7b71('0x4d')][_0x7b71('0x48')]({'where':{'name':_0x154f72,'userProfileId':_0xdb438[_0x7b71('0x4e')]},'raw':!![]})['then'](function(_0x318605){if(_0x318605&&_0x318605['autoAssociation']===0x0){return db['UserProfileResource'][_0x7b71('0x49')]({'name':_0x504cdf['name'],'resourceId':_0x504cdf['id'],'type':_0x318605[_0x7b71('0x2a')],'sectionId':_0x318605['id']},{})[_0x7b71('0x23')](function(){return _0x30e8d8;});}else{return _0x30e8d8;}})[_0x7b71('0x45')](function(_0x38cf0e){logger[_0x7b71('0x4f')](_0x7b71('0x50'),_0x38cf0e);throw _0x38cf0e;});}return _0x30e8d8;})[_0x7b71('0x23')](respondWithResult(_0x945c68,0xc9))[_0x7b71('0x45')](handleError(_0x945c68,null));};exports[_0x7b71('0x22')]=function(_0x38395a,_0xbb46b3){if(_0x38395a['body']['id']){delete _0x38395a['body']['id'];}return db[_0x7b71('0x2d')]['find']({'where':{'id':_0x38395a[_0x7b71('0x47')]['id']}})[_0x7b71('0x23')](handleEntityNotFound(_0xbb46b3,null))[_0x7b71('0x23')](saveUpdates(_0x38395a['body'],null))['then'](respondWithResult(_0xbb46b3,null))['catch'](handleError(_0xbb46b3,null));};exports[_0x7b71('0x24')]=function(_0x48b486,_0x1d3acf){return db[_0x7b71('0x2d')]['find']({'where':{'id':_0x48b486[_0x7b71('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d3acf,null))[_0x7b71('0x23')](removeEntity(_0x1d3acf,null))['catch'](handleError(_0x1d3acf,null));}; \ No newline at end of file +var _0x524a=['rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','count','status','set','Content-Range','apply','reject','save','update','then','Tags','UserProfileResource','destroy','stack','name','index','map','Tag','fieldName','model','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','keys','rawAttributes','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format'];(function(_0x5a4257,_0x3ae34d){var _0x3746a7=function(_0x31fff0){while(--_0x31fff0){_0x5a4257['push'](_0x5a4257['shift']());}};_0x3746a7(++_0x3ae34d);}(_0x524a,0xf5));var _0xa524=function(_0x6c5e4,_0x4fff35){_0x6c5e4=_0x6c5e4-0x0;var _0x4f83f5=_0x524a[_0x6c5e4];return _0x4f83f5;};'use strict';var emlformat=require(_0xa524('0x0'));var rimraf=require(_0xa524('0x1'));var zipdir=require(_0xa524('0x2'));var jsonpatch=require(_0xa524('0x3'));var rp=require('request-promise');var moment=require(_0xa524('0x4'));var BPromise=require(_0xa524('0x5'));var Mustache=require(_0xa524('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa524('0x7'));var csv=require(_0xa524('0x8'));var ejs=require(_0xa524('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa524('0xa'));var squel=require('squel');var crypto=require(_0xa524('0xb'));var jsforce=require(_0xa524('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa524('0x8'));var querystring=require(_0xa524('0xd'));var Papa=require(_0xa524('0xe'));var Redis=require(_0xa524('0xf'));var authService=require(_0xa524('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa524('0x11'));var hardwareService=require(_0xa524('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xa524('0x13'));var config=require(_0xa524('0x14'));var licenseUtil=require(_0xa524('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55117f,_0x14a0d6){_0x14a0d6=_0x14a0d6||0xcc;return function(_0x4aa46d){if(_0x4aa46d){return _0x55117f[_0xa524('0x16')](_0x14a0d6);}return _0x55117f['status'](_0x14a0d6)[_0xa524('0x17')]();};}function respondWithResult(_0x5c7e6a,_0x75bfe8){_0x75bfe8=_0x75bfe8||0xc8;return function(_0x281137){if(_0x281137){return _0x5c7e6a['status'](_0x75bfe8)[_0xa524('0x18')](_0x281137);}};}function respondWithFilteredResult(_0x15b14c,_0xe85361){return function(_0x1de01e){if(_0x1de01e){var _0x45347f=typeof _0xe85361[_0xa524('0x19')]===_0xa524('0x1a')&&typeof _0xe85361['limit']===_0xa524('0x1a');var _0x3d8494=_0x1de01e[_0xa524('0x1b')];var _0x3d6a0d=_0x45347f?0x0:_0xe85361[_0xa524('0x19')];var _0x805b93=_0x45347f?_0x1de01e[_0xa524('0x1b')]:_0xe85361[_0xa524('0x19')]+_0xe85361['limit'];var _0x304dea;if(_0x805b93>=_0x3d8494){_0x805b93=_0x3d8494;_0x304dea=0xc8;}else{_0x304dea=0xce;}_0x15b14c[_0xa524('0x1c')](_0x304dea);return _0x15b14c[_0xa524('0x1d')](_0xa524('0x1e'),_0x3d6a0d+'-'+_0x805b93+'/'+_0x3d8494)['json'](_0x1de01e);}return null;};}function patchUpdates(_0x5510fa){return function(_0x40f4bd){try{jsonpatch[_0xa524('0x1f')](_0x40f4bd,_0x5510fa,!![]);}catch(_0x21e114){return BPromise[_0xa524('0x20')](_0x21e114);}return _0x40f4bd[_0xa524('0x21')]();};}function saveUpdates(_0x3866e2,_0x4abffe){return function(_0x262eac){if(_0x262eac){return _0x262eac[_0xa524('0x22')](_0x3866e2)[_0xa524('0x23')](function(_0x40fb4b){return _0x40fb4b;});}return null;};}function removeEntity(_0x226784,_0x45cdcc){return function(_0x26e931){if(_0x26e931){return _0x26e931['destroy']()[_0xa524('0x23')](function(){var _0x221bf=_0x26e931['get']({'plain':!![]});var _0x47efb3=_0xa524('0x24');return db[_0xa524('0x25')][_0xa524('0x26')]({'where':{'type':_0x47efb3,'resourceId':_0x221bf['id']}})[_0xa524('0x23')](function(){return _0x26e931;});})[_0xa524('0x23')](function(){_0x226784['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1aeabc,_0x869b22){return function(_0x1582fa){if(!_0x1582fa){_0x1aeabc[_0xa524('0x16')](0x194);}return _0x1582fa;};}function handleError(_0x505c42,_0x1c84c6){_0x1c84c6=_0x1c84c6||0x1f4;return function(_0x32ba03){logger['error'](_0x32ba03[_0xa524('0x27')]);if(_0x32ba03[_0xa524('0x28')]){delete _0x32ba03['name'];}_0x505c42[_0xa524('0x1c')](_0x1c84c6)['send'](_0x32ba03);};}exports[_0xa524('0x29')]=function(_0x38e051,_0x45b846){var _0x238133={},_0x136e83={},_0x1c706b={'count':0x0,'rows':[]};var _0x4f6133=_[_0xa524('0x2a')](db[_0xa524('0x2b')]['rawAttributes'],function(_0x535e41){return{'name':_0x535e41[_0xa524('0x2c')],'type':_0x535e41['type']['key']};});_0x136e83[_0xa524('0x2d')]=_[_0xa524('0x2a')](_0x4f6133,_0xa524('0x28'));_0x136e83[_0xa524('0x2e')]=_['keys'](_0x38e051['query']);_0x136e83[_0xa524('0x2f')]=_['intersection'](_0x136e83['model'],_0x136e83[_0xa524('0x2e')]);_0x238133[_0xa524('0x30')]=_[_0xa524('0x31')](_0x136e83[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x38e051[_0xa524('0x2e')][_0xa524('0x32')]));_0x238133[_0xa524('0x30')]=_0x238133[_0xa524('0x30')][_0xa524('0x33')]?_0x238133[_0xa524('0x30')]:_0x136e83[_0xa524('0x2d')];if(!_0x38e051['query']['hasOwnProperty']('nolimit')){_0x238133[_0xa524('0x34')]=qs[_0xa524('0x34')](_0x38e051['query'][_0xa524('0x34')]);_0x238133['offset']=qs[_0xa524('0x19')](_0x38e051[_0xa524('0x2e')]['offset']);}_0x238133[_0xa524('0x35')]=qs[_0xa524('0x36')](_0x38e051[_0xa524('0x2e')]['sort']);_0x238133[_0xa524('0x37')]=qs[_0xa524('0x2f')](_['pick'](_0x38e051[_0xa524('0x2e')],_0x136e83[_0xa524('0x2f')]),_0x4f6133);if(_0x38e051['query'][_0xa524('0x38')]){_0x238133[_0xa524('0x37')]=_['merge'](_0x238133[_0xa524('0x37')],{'$or':_[_0xa524('0x2a')](_0x4f6133,function(_0x186395){if(_0x186395[_0xa524('0x39')]!==_0xa524('0x3a')){var _0x38f87a={};_0x38f87a[_0x186395[_0xa524('0x28')]]={'$like':'%'+_0x38e051[_0xa524('0x2e')][_0xa524('0x38')]+'%'};return _0x38f87a;}})});}_0x238133=_[_0xa524('0x3b')]({},_0x238133,_0x38e051[_0xa524('0x3c')]);var _0x51cd09={'where':_0x238133[_0xa524('0x37')]};return db['Tag'][_0xa524('0x1b')](_0x51cd09)[_0xa524('0x23')](function(_0x35d92d){_0x1c706b[_0xa524('0x1b')]=_0x35d92d;if(_0x38e051[_0xa524('0x2e')][_0xa524('0x3d')]){_0x238133[_0xa524('0x3e')]=[{'all':!![]}];}return db[_0xa524('0x2b')][_0xa524('0x3f')](_0x238133);})[_0xa524('0x23')](function(_0x4a87d4){_0x1c706b[_0xa524('0x40')]=_0x4a87d4;return _0x1c706b;})[_0xa524('0x23')](respondWithFilteredResult(_0x45b846,_0x238133))['catch'](handleError(_0x45b846,null));};exports[_0xa524('0x41')]=function(_0x3f5564,_0x4885a4){var _0x492851={'raw':!![],'where':{'id':_0x3f5564['params']['id']}},_0x4dff4b={};_0x4dff4b['model']=_[_0xa524('0x42')](db[_0xa524('0x2b')][_0xa524('0x43')]);_0x4dff4b[_0xa524('0x2e')]=_['keys'](_0x3f5564[_0xa524('0x2e')]);_0x4dff4b[_0xa524('0x2f')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],_0x4dff4b['query']);_0x492851[_0xa524('0x30')]=_[_0xa524('0x31')](_0x4dff4b[_0xa524('0x2d')],qs[_0xa524('0x32')](_0x3f5564[_0xa524('0x2e')]['fields']));_0x492851[_0xa524('0x30')]=_0x492851[_0xa524('0x30')][_0xa524('0x33')]?_0x492851[_0xa524('0x30')]:_0x4dff4b[_0xa524('0x2d')];if(_0x3f5564[_0xa524('0x2e')][_0xa524('0x3d')]){_0x492851[_0xa524('0x3e')]=[{'all':!![]}];}_0x492851=_[_0xa524('0x3b')]({},_0x492851,_0x3f5564['options']);return db['Tag'][_0xa524('0x44')](_0x492851)[_0xa524('0x23')](handleEntityNotFound(_0x4885a4,null))[_0xa524('0x23')](respondWithResult(_0x4885a4,null))[_0xa524('0x45')](handleError(_0x4885a4,null));};exports[_0xa524('0x46')]=function(_0xddc80,_0x56e570){return db[_0xa524('0x2b')][_0xa524('0x46')](_0xddc80[_0xa524('0x47')],{})[_0xa524('0x23')](function(_0x24c7ef){var _0x451bbe=_0xddc80['user'][_0xa524('0x48')]({'plain':!![]});if(!_0x451bbe)throw new Error(_0xa524('0x49'));if(_0x451bbe[_0xa524('0x4a')]===_0xa524('0x4b')){var _0x25ffbd=_0x24c7ef[_0xa524('0x48')]({'plain':!![]});var _0xef18b7=_0xa524('0x24');return db[_0xa524('0x4c')][_0xa524('0x44')]({'where':{'name':_0xef18b7,'userProfileId':_0x451bbe[_0xa524('0x4d')]},'raw':!![]})[_0xa524('0x23')](function(_0x3a374f){if(_0x3a374f&&_0x3a374f[_0xa524('0x4e')]===0x0){return db[_0xa524('0x25')]['create']({'name':_0x25ffbd[_0xa524('0x28')],'resourceId':_0x25ffbd['id'],'type':_0x3a374f[_0xa524('0x28')],'sectionId':_0x3a374f['id']},{})['then'](function(){return _0x24c7ef;});}else{return _0x24c7ef;}})['catch'](function(_0x32844c){logger[_0xa524('0x4f')](_0xa524('0x50'),_0x32844c);throw _0x32844c;});}return _0x24c7ef;})[_0xa524('0x23')](respondWithResult(_0x56e570,0xc9))[_0xa524('0x45')](handleError(_0x56e570,null));};exports[_0xa524('0x22')]=function(_0x121fc5,_0x4e3709){if(_0x121fc5[_0xa524('0x47')]['id']){delete _0x121fc5[_0xa524('0x47')]['id'];}return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x121fc5[_0xa524('0x51')]['id']}})['then'](handleEntityNotFound(_0x4e3709,null))[_0xa524('0x23')](saveUpdates(_0x121fc5['body'],null))[_0xa524('0x23')](respondWithResult(_0x4e3709,null))[_0xa524('0x45')](handleError(_0x4e3709,null));};exports[_0xa524('0x26')]=function(_0x3f5694,_0x161393){return db[_0xa524('0x2b')][_0xa524('0x44')]({'where':{'id':_0x3f5694['params']['id']}})['then'](handleEntityNotFound(_0x161393,null))[_0xa524('0x23')](removeEntity(_0x161393,null))[_0xa524('0x45')](handleError(_0x161393,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 04515d1..ee6324c 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 _0x1157=['bluebird','./tag.attributes','exports','tools_tags','lodash','../../config/logger','api'];(function(_0x17e59f,_0x35fc97){var _0x1d2b26=function(_0x54a619){while(--_0x54a619){_0x17e59f['push'](_0x17e59f['shift']());}};_0x1d2b26(++_0x35fc97);}(_0x1157,0x1a8));var _0x7115=function(_0x215fe1,_0x483702){_0x215fe1=_0x215fe1-0x0;var _0x2667ca=_0x1157[_0x215fe1];return _0x2667ca;};'use strict';var _=require(_0x7115('0x0'));var util=require('util');var logger=require(_0x7115('0x1'))(_0x7115('0x2'));var moment=require('moment');var BPromise=require(_0x7115('0x3'));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(_0x7115('0x4'));module[_0x7115('0x5')]=function(_0x386617,_0x4b33a5){return _0x386617['define']('Tag',attributes,{'tableName':_0x7115('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb169=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','util'];(function(_0x562f75,_0x12ece1){var _0x574c95=function(_0x39e01c){while(--_0x39e01c){_0x562f75['push'](_0x562f75['shift']());}};_0x574c95(++_0x12ece1);}(_0xb169,0x117));var _0x9b16=function(_0x537501,_0x1509e4){_0x537501=_0x537501-0x0;var _0x54bfc2=_0xb169[_0x537501];return _0x54bfc2;};'use strict';var _=require('lodash');var util=require(_0x9b16('0x0'));var logger=require(_0x9b16('0x1'))(_0x9b16('0x2'));var moment=require(_0x9b16('0x3'));var BPromise=require(_0x9b16('0x4'));var rp=require(_0x9b16('0x5'));var fs=require('fs');var path=require(_0x9b16('0x6'));var rimraf=require(_0x9b16('0x7'));var config=require(_0x9b16('0x8'));var attributes=require(_0x9b16('0x9'));module[_0x9b16('0xa')]=function(_0x1547e6,_0x621902){return _0x1547e6[_0x9b16('0xb')](_0x9b16('0xc'),attributes,{'tableName':_0x9b16('0xd'),'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 b5b9aba..03a1ee1 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 _0x61a5=['info','request\x20sent','debug','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0xfa1475,_0x12a836){var _0x1321e3=function(_0x5d26b8){while(--_0x5d26b8){_0xfa1475['push'](_0xfa1475['shift']());}};_0x1321e3(++_0x12a836);}(_0x61a5,0xf0));var _0x561a=function(_0x4b418f,_0x3b6a96){_0x4b418f=_0x4b418f-0x0;var _0x2ed208=_0x61a5[_0x4b418f];return _0x2ed208;};'use strict';var _=require(_0x561a('0x0'));var util=require('util');var moment=require(_0x561a('0x1'));var BPromise=require(_0x561a('0x2'));var rs=require(_0x561a('0x3'));var fs=require('fs');var Redis=require(_0x561a('0x4'));var db=require(_0x561a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x561a('0x6'))(_0x561a('0x7'));var config=require('../../config/environment');var jayson=require(_0x561a('0x8'));var client=jayson[_0x561a('0x9')][_0x561a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2646bd,_0x3d55f8,_0xfe091){return new BPromise(function(_0x1d5814,_0x4db87f){return client[_0x561a('0xb')](_0x2646bd,_0xfe091)['then'](function(_0x3534bb){logger[_0x561a('0xc')]('Tag,\x20%s,\x20%s',_0x3d55f8,_0x561a('0xd'));logger[_0x561a('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x3d55f8,_0x561a('0xd'),JSON['stringify'](_0x3534bb));if(_0x3534bb[_0x561a('0xf')]){if(_0x3534bb[_0x561a('0xf')][_0x561a('0x10')]===0x1f4){logger[_0x561a('0xf')](_0x561a('0x11'),_0x3d55f8,_0x3534bb[_0x561a('0xf')][_0x561a('0x12')]);return _0x4db87f(_0x3534bb[_0x561a('0xf')][_0x561a('0x12')]);}logger[_0x561a('0xf')](_0x561a('0x11'),_0x3d55f8,_0x3534bb[_0x561a('0xf')]['message']);return _0x1d5814(_0x3534bb[_0x561a('0xf')][_0x561a('0x12')]);}else{logger[_0x561a('0xc')](_0x561a('0x11'),_0x3d55f8,_0x561a('0xd'));_0x1d5814(_0x3534bb[_0x561a('0x13')][_0x561a('0x12')]);}})[_0x561a('0x14')](function(_0x2690d9){logger[_0x561a('0xf')](_0x561a('0x11'),_0x3d55f8,_0x2690d9);_0x4db87f(_0x2690d9);});});} \ No newline at end of file +var _0x4f17=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then','info','request\x20sent','debug','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x3f2485,_0x1d8d18){var _0x4beea5=function(_0x563281){while(--_0x563281){_0x3f2485['push'](_0x3f2485['shift']());}};_0x4beea5(++_0x1d8d18);}(_0x4f17,0x9e));var _0x74f1=function(_0x4fabbe,_0xc514f3){_0x4fabbe=_0x4fabbe-0x0;var _0x5510dd=_0x4f17[_0x4fabbe];return _0x5510dd;};'use strict';var _=require(_0x74f1('0x0'));var util=require('util');var moment=require(_0x74f1('0x1'));var BPromise=require(_0x74f1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x74f1('0x3'));var db=require(_0x74f1('0x4'))['db'];var utils=require(_0x74f1('0x5'));var logger=require(_0x74f1('0x6'))(_0x74f1('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x74f1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe54c30,_0x51effb,_0x34ec03){return new BPromise(function(_0x339d55,_0x3b4914){return client['request'](_0xe54c30,_0x34ec03)[_0x74f1('0x9')](function(_0x4c4e41){logger[_0x74f1('0xa')]('Tag,\x20%s,\x20%s',_0x51effb,_0x74f1('0xb'));logger[_0x74f1('0xc')]('Tag,\x20%s,\x20%s,\x20%s',_0x51effb,'request\x20sent',JSON[_0x74f1('0xd')](_0x4c4e41));if(_0x4c4e41[_0x74f1('0xe')]){if(_0x4c4e41[_0x74f1('0xe')][_0x74f1('0xf')]===0x1f4){logger[_0x74f1('0xe')](_0x74f1('0x10'),_0x51effb,_0x4c4e41[_0x74f1('0xe')][_0x74f1('0x11')]);return _0x3b4914(_0x4c4e41[_0x74f1('0xe')][_0x74f1('0x11')]);}logger['error'](_0x74f1('0x10'),_0x51effb,_0x4c4e41['error'][_0x74f1('0x11')]);return _0x339d55(_0x4c4e41['error'][_0x74f1('0x11')]);}else{logger[_0x74f1('0xa')](_0x74f1('0x10'),_0x51effb,_0x74f1('0xb'));_0x339d55(_0x4c4e41[_0x74f1('0x12')]['message']);}})[_0x74f1('0x13')](function(_0x10a0b1){logger['error'](_0x74f1('0x10'),_0x51effb,_0x10a0b1);_0x3b4914(_0x10a0b1);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 018770e..d769087 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'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 841fe1e..bf313b6 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 _0xbaf0=['name','exports','STRING'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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 +var _0x0713=['STRING','name'];(function(_0x329d8d,_0x57a2b5){var _0x211dba=function(_0x299da2){while(--_0x299da2){_0x329d8d['push'](_0x329d8d['shift']());}};_0x211dba(++_0x57a2b5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 9aae7a9..1c4c2f1 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 _0x7dc1=['UserVoiceQueueRt','upsert','format','TeamVoiceQueue','all','spread','removeAgents','Mail','Sms','Fax','Whatsapp','Queue:remove','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','update','error','stack','name','send','map','Team','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','destroy','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','end','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Openchannel','through','penalty','QueueId','User','findOrCreate','emit','Queue:save','findAll','online','voicePause','interface'];(function(_0x340303,_0x4ded29){var _0x5ecc2d=function(_0x3fc153){while(--_0x3fc153){_0x340303['push'](_0x340303['shift']());}};_0x5ecc2d(++_0x4ded29);}(_0x7dc1,0xac));var _0x17dc=function(_0x333cab,_0x204862){_0x333cab=_0x333cab-0x0;var _0x1dd02e=_0x7dc1[_0x333cab];return _0x1dd02e;};'use strict';var emlformat=require(_0x17dc('0x0'));var rimraf=require(_0x17dc('0x1'));var zipdir=require(_0x17dc('0x2'));var jsonpatch=require(_0x17dc('0x3'));var rp=require(_0x17dc('0x4'));var moment=require(_0x17dc('0x5'));var BPromise=require(_0x17dc('0x6'));var Mustache=require('mustache');var util=require(_0x17dc('0x7'));var path=require(_0x17dc('0x8'));var sox=require(_0x17dc('0x9'));var csv=require('to-csv');var ejs=require(_0x17dc('0xa'));var fs=require('fs');var fs_extra=require(_0x17dc('0xb'));var _=require(_0x17dc('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x17dc('0xd'));var toCsv=require(_0x17dc('0xe'));var querystring=require(_0x17dc('0xf'));var Papa=require(_0x17dc('0x10'));var Redis=require(_0x17dc('0x11'));var authService=require(_0x17dc('0x12'));var qs=require(_0x17dc('0x13'));var as=require(_0x17dc('0x14'));var hardwareService=require(_0x17dc('0x15'));var logger=require(_0x17dc('0x16'))(_0x17dc('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x17dc('0x18'));var db=require(_0x17dc('0x19'))['db'];config[_0x17dc('0x1a')]=_[_0x17dc('0x1b')](config[_0x17dc('0x1a')],{'host':_0x17dc('0x1c'),'port':0x18eb});var socket=require(_0x17dc('0x1d'))(new Redis(config[_0x17dc('0x1a')]));require('./team.socket')[_0x17dc('0x1e')](socket);function respondWithStatusCode(_0x116bed,_0x5f1975){_0x5f1975=_0x5f1975||0xcc;return function(_0x3f2d06){if(_0x3f2d06){return _0x116bed[_0x17dc('0x1f')](_0x5f1975);}return _0x116bed[_0x17dc('0x20')](_0x5f1975)['end']();};}function respondWithResult(_0x210ad8,_0xbc0819){_0xbc0819=_0xbc0819||0xc8;return function(_0x4289a3){if(_0x4289a3){return _0x210ad8['status'](_0xbc0819)['json'](_0x4289a3);}};}function respondWithFilteredResult(_0x5b6d65,_0x2b79ed){return function(_0x394b9b){if(_0x394b9b){var _0x50087f=typeof _0x2b79ed[_0x17dc('0x21')]==='undefined'&&typeof _0x2b79ed[_0x17dc('0x22')]===_0x17dc('0x23');var _0x155b33=_0x394b9b['count'];var _0x1e707b=_0x50087f?0x0:_0x2b79ed[_0x17dc('0x21')];var _0x1a4ea3=_0x50087f?_0x394b9b[_0x17dc('0x24')]:_0x2b79ed[_0x17dc('0x21')]+_0x2b79ed[_0x17dc('0x22')];var _0x26604b;if(_0x1a4ea3>=_0x155b33){_0x1a4ea3=_0x155b33;_0x26604b=0xc8;}else{_0x26604b=0xce;}_0x5b6d65[_0x17dc('0x20')](_0x26604b);return _0x5b6d65[_0x17dc('0x25')](_0x17dc('0x26'),_0x1e707b+'-'+_0x1a4ea3+'/'+_0x155b33)[_0x17dc('0x27')](_0x394b9b);}return null;};}function patchUpdates(_0x203b56){return function(_0x2fe0ab){try{jsonpatch[_0x17dc('0x28')](_0x2fe0ab,_0x203b56,!![]);}catch(_0x21aafe){return BPromise['reject'](_0x21aafe);}return _0x2fe0ab['save']();};}function saveUpdates(_0x3f6189,_0x2311b7){return function(_0x1ea7fc){if(_0x1ea7fc){return _0x1ea7fc[_0x17dc('0x29')](_0x3f6189)['then'](function(_0x5bde0b){return _0x5bde0b;});}return null;};}function handleEntityNotFound(_0x4891b0,_0x3cc4a3){return function(_0x476f4b){if(!_0x476f4b){_0x4891b0[_0x17dc('0x1f')](0x194);}return _0x476f4b;};}function handleError(_0x50f3bc,_0x5f1fc2){_0x5f1fc2=_0x5f1fc2||0x1f4;return function(_0x54326a){logger[_0x17dc('0x2a')](_0x54326a[_0x17dc('0x2b')]);if(_0x54326a['name']){delete _0x54326a[_0x17dc('0x2c')];}_0x50f3bc[_0x17dc('0x20')](_0x5f1fc2)[_0x17dc('0x2d')](_0x54326a);};}exports['index']=function(_0x24284c,_0x4e18a2){var _0x39c55a={},_0x2d9ec3={},_0x6d471a={'count':0x0,'rows':[]};var _0x4c7f22=_[_0x17dc('0x2e')](db[_0x17dc('0x2f')][_0x17dc('0x30')],function(_0x15ea02){return{'name':_0x15ea02['fieldName'],'type':_0x15ea02[_0x17dc('0x31')][_0x17dc('0x32')]};});_0x2d9ec3[_0x17dc('0x33')]=_['map'](_0x4c7f22,_0x17dc('0x2c'));_0x2d9ec3['query']=_[_0x17dc('0x34')](_0x24284c[_0x17dc('0x35')]);_0x2d9ec3[_0x17dc('0x36')]=_[_0x17dc('0x37')](_0x2d9ec3[_0x17dc('0x33')],_0x2d9ec3[_0x17dc('0x35')]);_0x39c55a[_0x17dc('0x38')]=_[_0x17dc('0x37')](_0x2d9ec3[_0x17dc('0x33')],qs[_0x17dc('0x39')](_0x24284c['query'][_0x17dc('0x39')]));_0x39c55a[_0x17dc('0x38')]=_0x39c55a['attributes'][_0x17dc('0x3a')]?_0x39c55a[_0x17dc('0x38')]:_0x2d9ec3[_0x17dc('0x33')];if(!_0x24284c['query']['hasOwnProperty'](_0x17dc('0x3b'))){_0x39c55a[_0x17dc('0x22')]=qs[_0x17dc('0x22')](_0x24284c['query']['limit']);_0x39c55a[_0x17dc('0x21')]=qs[_0x17dc('0x21')](_0x24284c[_0x17dc('0x35')][_0x17dc('0x21')]);}_0x39c55a[_0x17dc('0x3c')]=qs[_0x17dc('0x3d')](_0x24284c['query'][_0x17dc('0x3d')]);_0x39c55a[_0x17dc('0x3e')]=qs[_0x17dc('0x36')](_[_0x17dc('0x3f')](_0x24284c[_0x17dc('0x35')],_0x2d9ec3[_0x17dc('0x36')]),_0x4c7f22);if(_0x24284c[_0x17dc('0x35')][_0x17dc('0x40')]){_0x39c55a['where']=_[_0x17dc('0x41')](_0x39c55a[_0x17dc('0x3e')],{'$or':_[_0x17dc('0x2e')](_0x4c7f22,function(_0x3280e1){if(_0x3280e1['type']!==_0x17dc('0x42')){var _0x179fff={};_0x179fff[_0x3280e1[_0x17dc('0x2c')]]={'$like':'%'+_0x24284c['query'][_0x17dc('0x40')]+'%'};return _0x179fff;}})});}_0x39c55a=_[_0x17dc('0x41')]({},_0x39c55a,_0x24284c[_0x17dc('0x43')]);var _0x103a26={'where':_0x39c55a[_0x17dc('0x3e')]};return db[_0x17dc('0x2f')][_0x17dc('0x24')](_0x103a26)[_0x17dc('0x44')](function(_0x64e3be){_0x6d471a[_0x17dc('0x24')]=_0x64e3be;if(_0x24284c[_0x17dc('0x35')][_0x17dc('0x45')]){_0x39c55a[_0x17dc('0x46')]=[{'all':!![]}];}return db['Team']['findAll'](_0x39c55a);})[_0x17dc('0x44')](function(_0x10bc68){_0x6d471a[_0x17dc('0x47')]=_0x10bc68;return _0x6d471a;})['then'](respondWithFilteredResult(_0x4e18a2,_0x39c55a))[_0x17dc('0x48')](handleError(_0x4e18a2,null));};exports[_0x17dc('0x49')]=function(_0x5212cc,_0x2cde44){var _0x536f6d={'raw':![],'where':{'id':_0x5212cc['params']['id']}},_0x47f58a={};_0x47f58a[_0x17dc('0x33')]=_[_0x17dc('0x34')](db[_0x17dc('0x2f')][_0x17dc('0x30')]);_0x47f58a[_0x17dc('0x35')]=_[_0x17dc('0x34')](_0x5212cc[_0x17dc('0x35')]);_0x47f58a[_0x17dc('0x36')]=_[_0x17dc('0x37')](_0x47f58a[_0x17dc('0x33')],_0x47f58a[_0x17dc('0x35')]);_0x536f6d['attributes']=_[_0x17dc('0x37')](_0x47f58a[_0x17dc('0x33')],qs[_0x17dc('0x39')](_0x5212cc[_0x17dc('0x35')]['fields']));_0x536f6d[_0x17dc('0x38')]=_0x536f6d[_0x17dc('0x38')][_0x17dc('0x3a')]?_0x536f6d[_0x17dc('0x38')]:_0x47f58a[_0x17dc('0x33')];if(_0x5212cc[_0x17dc('0x35')][_0x17dc('0x45')]){_0x536f6d[_0x17dc('0x46')]=[{'all':!![]}];}_0x536f6d=_[_0x17dc('0x41')]({},_0x536f6d,_0x5212cc[_0x17dc('0x43')]);return db[_0x17dc('0x2f')][_0x17dc('0x4a')](_0x536f6d)['then'](handleEntityNotFound(_0x2cde44,null))[_0x17dc('0x44')](respondWithResult(_0x2cde44,null))[_0x17dc('0x48')](handleError(_0x2cde44,null));};exports[_0x17dc('0x4b')]=function(_0x496922,_0x139c89){return db[_0x17dc('0x2f')]['create'](_0x496922[_0x17dc('0x4c')],{})[_0x17dc('0x44')](function(_0x55ba4){var _0x560545=_0x496922['user']['get']({'plain':!![]});if(!_0x560545)throw new Error(_0x17dc('0x4d'));if(_0x560545['role']===_0x17dc('0x4e')){var _0x2c3c72=_0x55ba4[_0x17dc('0x4f')]({'plain':!![]});var _0x237f1e=_0x17dc('0x50');return db[_0x17dc('0x51')]['find']({'where':{'name':_0x237f1e,'userProfileId':_0x560545[_0x17dc('0x52')]},'raw':!![]})[_0x17dc('0x44')](function(_0x289d81){if(_0x289d81&&_0x289d81[_0x17dc('0x53')]===0x0){return db[_0x17dc('0x54')][_0x17dc('0x4b')]({'name':_0x2c3c72['name'],'resourceId':_0x2c3c72['id'],'type':_0x289d81[_0x17dc('0x2c')],'sectionId':_0x289d81['id']},{})[_0x17dc('0x44')](function(){return _0x55ba4;});}else{return _0x55ba4;}})['catch'](function(_0x227486){logger['error'](_0x17dc('0x55'),_0x227486);throw _0x227486;});}return _0x55ba4;})[_0x17dc('0x44')](respondWithResult(_0x139c89,0xc9))[_0x17dc('0x48')](handleError(_0x139c89,null));};exports[_0x17dc('0x29')]=function(_0x2f7599,_0x4b084e){if(_0x2f7599['body']['id']){delete _0x2f7599[_0x17dc('0x4c')]['id'];}return db[_0x17dc('0x2f')]['find']({'where':{'id':_0x2f7599[_0x17dc('0x56')]['id']}})[_0x17dc('0x44')](handleEntityNotFound(_0x4b084e,null))[_0x17dc('0x44')](saveUpdates(_0x2f7599[_0x17dc('0x4c')],null))[_0x17dc('0x44')](respondWithResult(_0x4b084e,null))['catch'](handleError(_0x4b084e,null));};exports[_0x17dc('0x57')]=function(_0x24edd8,_0x27ca75){var _0x38a49d=_0x24edd8[_0x17dc('0x56')]['id'];var _0x31889a=[];return db['sequelize'][_0x17dc('0x58')](function(_0x4f4be6){var _0x561bdb=_0x17dc('0x59')+_0x38a49d;return db[_0x17dc('0x5a')][_0x17dc('0x35')](_0x561bdb,{'type':db[_0x17dc('0x5b')][_0x17dc('0x5c')][_0x17dc('0x5d')],'raw':!![],'transaction':_0x4f4be6})[_0x17dc('0x44')](function(_0x5f5954){_0x31889a=_[_0x17dc('0x2e')](_0x5f5954,function(_0x49c5a6){return Number(_0x49c5a6[_0x17dc('0x5e')]);});})[_0x17dc('0x44')](function(){var _0x39b988=_0x17dc('0x5f')+_0x38a49d;return db[_0x17dc('0x5a')][_0x17dc('0x35')](_0x39b988,{'type':db[_0x17dc('0x5b')][_0x17dc('0x5c')][_0x17dc('0x5d')],'raw':!![],'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(_0x437db1){var _0xf904c5=_[_0x17dc('0x2e')](_0x437db1,function(_0xf03140){return Number(_0xf03140[_0x17dc('0x60')]);});return db[_0x17dc('0x61')][_0x17dc('0x57')]({'where':{'UserId':{'$in':_0x31889a},'VoiceQueueId':{'$in':_0xf904c5}},'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(){var _0x49e07a='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x38a49d;return db[_0x17dc('0x5a')][_0x17dc('0x35')](_0x49e07a,{'type':db[_0x17dc('0x5b')][_0x17dc('0x5c')][_0x17dc('0x5d')],'raw':!![],'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(_0x5572f0){var _0x315e61=_['map'](_0x5572f0,function(_0x38bbfe){return Number(_0x38bbfe[_0x17dc('0x62')]);});return db[_0x17dc('0x63')][_0x17dc('0x57')]({'where':{'UserId':{'$in':_0x31889a},'MailQueueId':{'$in':_0x315e61}},'transaction':_0x4f4be6});})['then'](function(){var _0x2604a3=_0x17dc('0x64')+_0x38a49d;return db[_0x17dc('0x5a')][_0x17dc('0x35')](_0x2604a3,{'type':db[_0x17dc('0x5b')][_0x17dc('0x5c')][_0x17dc('0x5d')],'raw':!![],'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(_0x33b0d2){var _0x418846=_[_0x17dc('0x2e')](_0x33b0d2,function(_0x5e27a2){return Number(_0x5e27a2['SmsQueueId']);});return db[_0x17dc('0x65')]['destroy']({'where':{'UserId':{'$in':_0x31889a},'SmsQueueId':{'$in':_0x418846}},'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(){var _0x791a66='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x38a49d;return db[_0x17dc('0x5a')]['query'](_0x791a66,{'type':db[_0x17dc('0x5b')][_0x17dc('0x5c')]['SELECT'],'raw':!![],'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(_0x431b37){var _0x5b4505=_[_0x17dc('0x2e')](_0x431b37,function(_0x444e05){return Number(_0x444e05[_0x17dc('0x66')]);});return db[_0x17dc('0x67')][_0x17dc('0x57')]({'where':{'UserId':{'$in':_0x31889a},'ChatQueueId':{'$in':_0x5b4505}},'transaction':_0x4f4be6});})['then'](function(){var _0x50bf8c=_0x17dc('0x68')+_0x38a49d;return db[_0x17dc('0x5a')]['query'](_0x50bf8c,{'type':db['Sequelize'][_0x17dc('0x5c')][_0x17dc('0x5d')],'raw':!![],'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(_0x1fd16e){var _0x1a6b06=_['map'](_0x1fd16e,function(_0x5e9651){return Number(_0x5e9651[_0x17dc('0x69')]);});return db[_0x17dc('0x6a')][_0x17dc('0x57')]({'where':{'UserId':{'$in':_0x31889a},'FaxQueueId':{'$in':_0x1a6b06}},'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(){var _0xa58ed1='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x38a49d;return db[_0x17dc('0x5a')][_0x17dc('0x35')](_0xa58ed1,{'type':db[_0x17dc('0x5b')][_0x17dc('0x5c')][_0x17dc('0x5d')],'raw':!![],'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(_0x302fef){var _0x52bb98=_[_0x17dc('0x2e')](_0x302fef,function(_0x200725){return Number(_0x200725[_0x17dc('0x6b')]);});return db[_0x17dc('0x6c')][_0x17dc('0x57')]({'where':{'UserId':{'$in':_0x31889a},'OpenchannelQueueId':{'$in':_0x52bb98}},'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(){var _0xaf983c=_0x17dc('0x6d')+_0x38a49d;return db[_0x17dc('0x5a')][_0x17dc('0x35')](_0xaf983c,{'type':db['Sequelize'][_0x17dc('0x5c')]['SELECT'],'raw':!![],'transaction':_0x4f4be6});})['then'](function(_0x130961){var _0x403a8a=_[_0x17dc('0x2e')](_0x130961,function(_0xf7ec70){return Number(_0xf7ec70[_0x17dc('0x6e')]);});return db['UserWhatsappQueue'][_0x17dc('0x57')]({'where':{'UserId':{'$in':_0x31889a},'WhatsappQueueId':{'$in':_0x403a8a}},'transaction':_0x4f4be6});})['then'](function(){return db[_0x17dc('0x6f')]['find']({'where':{'TeamId':_0x38a49d}});})['then'](function(_0x56ee93){if(_0x56ee93===null){return;}return db[_0x17dc('0x70')][_0x17dc('0x57')]({'where':{'UserId':{'$in':_0x31889a},'VoicePrefixId':_0x56ee93[_0x17dc('0x71')]},'transaction':_0x4f4be6});})['then'](function(){return db[_0x17dc('0x2f')][_0x17dc('0x57')]({'where':{'id':_0x38a49d},'cascade':!![],'transaction':_0x4f4be6});})[_0x17dc('0x44')](function(_0x37d266){if(_0x37d266===0x0){_0x27ca75[_0x17dc('0x1f')](0x194);}else{return db['UserProfileResource'][_0x17dc('0x57')]({'where':{'type':_0x17dc('0x50'),'resourceId':_0x38a49d},'cascade':!![],'transaction':_0x4f4be6})[_0x17dc('0x44')](function(){_0x27ca75[_0x17dc('0x20')](0xcc)[_0x17dc('0x72')]();});}})[_0x17dc('0x48')](function(_0x2d29b4){_0x27ca75[_0x17dc('0x20')](0x1f4)[_0x17dc('0x2d')](_0x2d29b4);});});};exports[_0x17dc('0x73')]=function(_0x4f9cbf,_0x5a0b66,_0x5d9ca1){return db[_0x17dc('0x2f')][_0x17dc('0x74')]({'where':{'id':_0x4f9cbf[_0x17dc('0x56')]['id']}})[_0x17dc('0x44')](handleEntityNotFound(_0x5a0b66,null))[_0x17dc('0x44')](function(_0x41bad6){if(!_0x4f9cbf['query'][_0x17dc('0x75')]||!utils[_0x17dc('0x76')](_0x4f9cbf[_0x17dc('0x35')]['channel'])){throw new db[(_0x17dc('0x5b'))][(_0x17dc('0x77'))](_0x17dc('0x78'));}var _0x263827={};var _0x1b634d={};_0x1b634d['model']=_[_0x17dc('0x34')](db[_[_0x17dc('0x79')](_0x4f9cbf[_0x17dc('0x35')]['channel'][_0x17dc('0x7a')]())+_0x17dc('0x7b')][_0x17dc('0x30')]);_0x1b634d[_0x17dc('0x35')]=_['keys'](_0x4f9cbf[_0x17dc('0x35')]);_0x1b634d[_0x17dc('0x36')]=_[_0x17dc('0x37')](_0x1b634d[_0x17dc('0x33')],_0x1b634d['query']);_0x263827[_0x17dc('0x38')]=_['intersection'](_0x1b634d[_0x17dc('0x33')],qs[_0x17dc('0x39')](_0x4f9cbf[_0x17dc('0x35')][_0x17dc('0x39')]));_0x263827['attributes']=_0x263827[_0x17dc('0x38')]['length']?_0x263827[_0x17dc('0x38')]:_0x1b634d[_0x17dc('0x33')];_0x263827['limit']=qs['limit'](_0x4f9cbf['query'][_0x17dc('0x22')]);_0x263827['offset']=qs[_0x17dc('0x21')](_0x4f9cbf[_0x17dc('0x35')][_0x17dc('0x21')]);_0x263827[_0x17dc('0x3c')]=qs[_0x17dc('0x3d')](_0x4f9cbf[_0x17dc('0x35')][_0x17dc('0x3d')]);_0x263827['where']=qs[_0x17dc('0x36')](_[_0x17dc('0x3f')](_0x4f9cbf[_0x17dc('0x35')],_0x1b634d[_0x17dc('0x36')]));_0x263827=_[_0x17dc('0x41')]({},_0x263827,_0x4f9cbf[_0x17dc('0x43')]);return _0x41bad6[_0x17dc('0x4f')+_[_0x17dc('0x79')](_0x4f9cbf[_0x17dc('0x35')][_0x17dc('0x75')][_0x17dc('0x7a')]())+_0x17dc('0x7c')](_0x263827);})['then'](respondWithResult(_0x5a0b66,null))['catch'](handleError(_0x5a0b66,null));};exports['addQueues']=function(_0x172620,_0x181f64,_0x2f8739){return db[_0x17dc('0x2f')]['findOne']({'where':{'id':_0x172620[_0x17dc('0x56')]['id']}})[_0x17dc('0x44')](function(_0x18df6f){if(_0x18df6f){if(!_0x172620['body'][_0x17dc('0x75')]||!utils[_0x17dc('0x76')](_0x172620[_0x17dc('0x4c')][_0x17dc('0x75')])){throw new db[(_0x17dc('0x5b'))]['ValidationError'](_0x17dc('0x78'));}return _0x18df6f['add'+_['capitalize'](_0x172620[_0x17dc('0x4c')]['channel'][_0x17dc('0x7a')]())+_0x17dc('0x7c')](_0x172620[_0x17dc('0x4c')][_0x17dc('0x7d')]);}return null;})[_0x17dc('0x44')](handleEntityNotFound(_0x181f64,null))[_0x17dc('0x44')](respondWithStatusCode(_0x181f64,null))['catch'](handleError(_0x181f64,null));};exports[_0x17dc('0x7e')]=function(_0x5b72a2,_0x25de2c,_0x5d3b99){return db['Team'][_0x17dc('0x74')]({'where':{'id':_0x5b72a2['params']['id']}})[_0x17dc('0x44')](function(_0x15d569){if(_0x15d569){if(!_0x5b72a2[_0x17dc('0x35')][_0x17dc('0x75')]||!utils['isValidChannel'](_0x5b72a2[_0x17dc('0x35')]['channel'])){throw new db[(_0x17dc('0x5b'))][(_0x17dc('0x77'))]('Unknown\x20channel');}return _0x15d569[_0x17dc('0x7f')+_[_0x17dc('0x79')](_0x5b72a2[_0x17dc('0x35')]['channel'][_0x17dc('0x7a')]())+_0x17dc('0x7c')](_0x5b72a2[_0x17dc('0x35')][_0x17dc('0x7d')]);}return null;})[_0x17dc('0x44')](handleEntityNotFound(_0x25de2c,null))[_0x17dc('0x44')](respondWithStatusCode(_0x25de2c,null))[_0x17dc('0x48')](handleError(_0x25de2c,null));};exports[_0x17dc('0x80')]=function(_0x33ed78,_0x432862){var _0x1e9b05=_[_0x17dc('0x81')](_0x33ed78['body'][_0x17dc('0x7d')])?_0x33ed78['body'][_0x17dc('0x7d')]:[_0x33ed78[_0x17dc('0x4c')][_0x17dc('0x7d')]];var _0x3710ed=_0x33ed78['params']['id'];return db[_0x17dc('0x2f')][_0x17dc('0x4a')]({'where':{'id':_0x3710ed}})[_0x17dc('0x44')](handleEntityNotFound(_0x432862,null))[_0x17dc('0x44')](function(_0xbb898a){if(_0xbb898a){var _0x29271f=[_0x17dc('0x82'),_0x17dc('0x83'),'Mail','Sms','Fax',_0x17dc('0x84'),'Whatsapp'];return db[_0x17dc('0x5a')][_0x17dc('0x58')](function(_0xcffa0f){var _0xeaef15=_[_0x17dc('0x2e')](_0x29271f,function(_0x20f0ba){var _0x1ff7b9={'attributes':['id','name']};if(_0x20f0ba===_0x17dc('0x82')){_0x1ff7b9[_0x17dc('0x85')]={'attributes':[_0x17dc('0x86')]};}return _0xbb898a['get'+_0x20f0ba+_0x17dc('0x7c')](_0x1ff7b9)[_0x17dc('0x44')](function(_0x5b2532){var _0x117bb7=_[_0x17dc('0x2e')](_0x5b2532,function(_0x5efd5c){var _0x192a84=_[_0x17dc('0x2e')](_0x1e9b05,function(_0xe1bfad){var _0x7d4f93={'where':{'UserId':_0xe1bfad,[_0x20f0ba+_0x17dc('0x87')]:_0x5efd5c['id']},'transaction':_0xcffa0f};if(_0x20f0ba===_0x17dc('0x82')){_0x7d4f93[_0x17dc('0x1b')]={'penalty':_0x5efd5c['TeamVoiceQueue'][_0x17dc('0x86')]};}return db[_0x17dc('0x88')+_0x20f0ba+_0x17dc('0x7b')][_0x17dc('0x89')](_0x7d4f93)['then'](function(){socket[_0x17dc('0x8a')](_0x17dc('0x4e')+_0x20f0ba+_0x17dc('0x8b'),{'UserId':_0xe1bfad,[_0x20f0ba+_0x17dc('0x87')]:_0x5efd5c['id']});if(_0x20f0ba!==_0x17dc('0x82')){return;}return db[_0x17dc('0x88')][_0x17dc('0x8c')]({'where':{'id':_0x1e9b05,'online':0x1},'attributes':['id','name',_0x17dc('0x8d'),_0x17dc('0x8e'),_0x17dc('0x8f')],'raw':!![]})['then'](function(_0x5638ec){var _0x50c812=_['map'](_0x5638ec,function(_0x3992d6){return db[_0x17dc('0x90')][_0x17dc('0x91')]({'membername':_0x3992d6[_0x17dc('0x2c')],'UserId':_0x3992d6['id'],'queue_name':_0x5efd5c[_0x17dc('0x2c')],'VoiceQueueId':_0x5efd5c['id'],'interface':_['isNil'](_0x3992d6[_0x17dc('0x8f')])?util[_0x17dc('0x92')]('SIP/%s',_0x3992d6[_0x17dc('0x2c')]):_0x3992d6[_0x17dc('0x8f')],'paused':_0x3992d6['voicePause']||![],'penalty':_0x5efd5c[_0x17dc('0x93')]['penalty']},{'transaction':_0xcffa0f});});return Promise[_0x17dc('0x94')](_0x50c812);});});});return Promise['all'](_0x192a84);});return Promise[_0x17dc('0x94')](_0x117bb7);})[_0x17dc('0x44')](function(){return db[_0x17dc('0x6f')][_0x17dc('0x74')]({'where':{'teamId':_0x3710ed}})[_0x17dc('0x44')](function(_0x20dbdd){if(_0x20dbdd){var _0x19f88b=_[_0x17dc('0x2e')](_0x1e9b05,function(_0x95e3e1){db[_0x17dc('0x70')][_0x17dc('0x91')]({'UserId':_0x95e3e1,'VoicePrefixId':_0x20dbdd[_0x17dc('0x71')]});});return Promise[_0x17dc('0x94')](_0x19f88b);}});});});return Promise[_0x17dc('0x94')](_0xeaef15)[_0x17dc('0x44')](function(){return _0xbb898a[_0x17dc('0x80')](_0x1e9b05,{'transaction':_0xcffa0f})[_0x17dc('0x95')](function(_0x4d0a92){return _0x4d0a92;});});});}})[_0x17dc('0x44')](respondWithResult(_0x432862,null))['catch'](handleError(_0x432862,null));};exports[_0x17dc('0x96')]=function(_0x592380,_0x4cefb4){var _0x49be6f=_[_0x17dc('0x81')](_0x592380[_0x17dc('0x35')][_0x17dc('0x7d')])?_0x592380[_0x17dc('0x35')][_0x17dc('0x7d')]:[_0x592380['query']['ids']];var _0x41a0a7=_0x592380['params']['id'];return db['Team'][_0x17dc('0x4a')]({'where':{'id':_0x41a0a7}})['then'](handleEntityNotFound(_0x4cefb4,null))[_0x17dc('0x44')](function(_0x52ac56){if(_0x52ac56){var _0x5e1c00=[_0x17dc('0x82'),'Chat',_0x17dc('0x97'),_0x17dc('0x98'),_0x17dc('0x99'),_0x17dc('0x84'),_0x17dc('0x9a')];return db[_0x17dc('0x5a')][_0x17dc('0x58')](function(_0x2daa60){var _0x5930f0=_['map'](_0x5e1c00,function(_0x551bbe){var _0x3714dc={'attributes':['id',_0x17dc('0x2c')]};return _0x52ac56[_0x17dc('0x4f')+_0x551bbe+_0x17dc('0x7c')](_0x3714dc)[_0x17dc('0x44')](function(_0x4e490b){var _0x21cf0e=_[_0x17dc('0x2e')](_0x4e490b,function(_0x5a583b){return _0x5a583b['removeAgents'](_0x49be6f,{'transaction':_0x2daa60})['then'](function(){var _0x3e43a8=_[_0x17dc('0x2e')](_0x49be6f,function(_0x9804){socket['emit'](_0x17dc('0x4e')+_0x551bbe+_0x17dc('0x9b'),{'UserId':Number(_0x9804),[_0x551bbe+'QueueId']:_0x5a583b['id']});if(_0x551bbe!==_0x17dc('0x82')){return;}return db['UserVoiceQueueRt'][_0x17dc('0x57')]({'where':{'VoiceQueueId':_0x5a583b['id'],'UserId':_0x9804},'transaction':_0x2daa60});});return Promise[_0x17dc('0x94')](_0x3e43a8);});});return Promise[_0x17dc('0x94')](_0x21cf0e);});});return Promise['all'](_0x5930f0)[_0x17dc('0x44')](function(){return _0x52ac56['removeAgents'](_0x49be6f,{'transaction':_0x2daa60});})[_0x17dc('0x44')](function(){return db['TeamVoicePrefix'][_0x17dc('0x74')]({'where':{'teamId':_0x41a0a7}})[_0x17dc('0x44')](function(_0xc30f8c){if(_0xc30f8c){var _0xcccd88=_[_0x17dc('0x2e')](_0x49be6f,function(_0x2037af){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x2037af,'VoicePrefixId':_0xc30f8c[_0x17dc('0x71')]}});});return Promise[_0x17dc('0x94')](_0xcccd88);}});});});}})['then'](respondWithStatusCode(_0x4cefb4,null))[_0x17dc('0x48')](handleError(_0x4cefb4,null));};exports['getAgents']=function(_0x272367,_0x2d03eb,_0x2f9d4a){var _0x1d7521={};var _0x8f21a1={};var _0xeb649b;var _0x338b88;return db[_0x17dc('0x2f')][_0x17dc('0x74')]({'where':{'id':_0x272367[_0x17dc('0x56')]['id']}})[_0x17dc('0x44')](handleEntityNotFound(_0x2d03eb,null))[_0x17dc('0x44')](function(_0x568bed){if(_0x568bed){_0xeb649b=_0x568bed;_0x8f21a1[_0x17dc('0x33')]=_[_0x17dc('0x34')](db['User']['rawAttributes']);_0x8f21a1[_0x17dc('0x35')]=_['keys'](_0x272367[_0x17dc('0x35')]);_0x8f21a1['filters']=_[_0x17dc('0x37')](_0x8f21a1[_0x17dc('0x33')],_0x8f21a1[_0x17dc('0x35')]);_0x1d7521[_0x17dc('0x38')]=_[_0x17dc('0x37')](_0x8f21a1[_0x17dc('0x33')],qs[_0x17dc('0x39')](_0x272367[_0x17dc('0x35')][_0x17dc('0x39')]));_0x1d7521[_0x17dc('0x38')]=_0x1d7521['attributes'][_0x17dc('0x3a')]?_0x1d7521[_0x17dc('0x38')]:_0x8f21a1[_0x17dc('0x33')];_0x1d7521[_0x17dc('0x3c')]=qs['sort'](_0x272367[_0x17dc('0x35')][_0x17dc('0x3d')]);_0x1d7521[_0x17dc('0x3e')]=qs[_0x17dc('0x36')](_['pick'](_0x272367[_0x17dc('0x35')],_0x8f21a1[_0x17dc('0x36')]));if(_0x272367[_0x17dc('0x35')][_0x17dc('0x40')]){_0x1d7521['where']=_[_0x17dc('0x41')](_0x1d7521['where'],{'$or':_[_0x17dc('0x2e')](_0x1d7521['attributes'],function(_0x453af4){var _0x49cb0a={};_0x49cb0a[_0x453af4]={'$like':'%'+_0x272367[_0x17dc('0x35')]['filter']+'%'};return _0x49cb0a;})});}_0x1d7521=_[_0x17dc('0x41')]({},_0x1d7521,_0x272367[_0x17dc('0x43')]);return _0xeb649b[_0x17dc('0x9c')](_0x1d7521);}})[_0x17dc('0x44')](function(_0x2f4926){if(_0x2f4926){_0x338b88=_0x2f4926[_0x17dc('0x3a')];if(!_0x272367[_0x17dc('0x35')][_0x17dc('0x9d')](_0x17dc('0x3b'))){_0x1d7521[_0x17dc('0x22')]=qs[_0x17dc('0x22')](_0x272367[_0x17dc('0x35')]['limit']);_0x1d7521[_0x17dc('0x21')]=qs[_0x17dc('0x21')](_0x272367[_0x17dc('0x35')]['offset']);}return _0xeb649b[_0x17dc('0x9c')](_0x1d7521);}})['then'](function(_0x565d24){if(_0x565d24){return _0x565d24?{'count':_0x338b88,'rows':_0x565d24}:null;}})[_0x17dc('0x44')](respondWithResult(_0x2d03eb,null))[_0x17dc('0x48')](handleError(_0x2d03eb,null));}; \ No newline at end of file +var _0x3ee3=['nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./team.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','map','Team','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','includeAll','include','rows','catch','show','options','create','user','get','Teams','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','destroy','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','ChatQueueId','UserChatQueue','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','Queue','pick','toLowerCase','Queues','addQueues','add','removeQueues','remove','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','findAll','online','interface','UserVoiceQueueRt','upsert','isNil','format','voicePause','all','removeAgents','Queue:remove','getAgents','findOne'];(function(_0x4df8c5,_0x5e0f78){var _0x5e3903=function(_0x55ce83){while(--_0x55ce83){_0x4df8c5['push'](_0x4df8c5['shift']());}};_0x5e3903(++_0x5e0f78);}(_0x3ee3,0x97));var _0x33ee=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x3ee3[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require(_0x33ee('0x0'));var rimraf=require(_0x33ee('0x1'));var zipdir=require(_0x33ee('0x2'));var jsonpatch=require(_0x33ee('0x3'));var rp=require(_0x33ee('0x4'));var moment=require('moment');var BPromise=require(_0x33ee('0x5'));var Mustache=require('mustache');var util=require(_0x33ee('0x6'));var path=require(_0x33ee('0x7'));var sox=require(_0x33ee('0x8'));var csv=require(_0x33ee('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x33ee('0xa'));var _=require('lodash');var squel=require(_0x33ee('0xb'));var crypto=require(_0x33ee('0xc'));var jsforce=require(_0x33ee('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x33ee('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x33ee('0xf'));var as=require(_0x33ee('0x10'));var hardwareService=require(_0x33ee('0x11'));var logger=require('../../config/logger')(_0x33ee('0x12'));var utils=require('../../config/utils');var config=require(_0x33ee('0x13'));var licenseUtil=require(_0x33ee('0x14'));var db=require(_0x33ee('0x15'))['db'];config['redis']=_[_0x33ee('0x16')](config[_0x33ee('0x17')],{'host':_0x33ee('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x33ee('0x19'))[_0x33ee('0x1a')](socket);function respondWithStatusCode(_0x27a2d8,_0x545376){_0x545376=_0x545376||0xcc;return function(_0x35a72a){if(_0x35a72a){return _0x27a2d8[_0x33ee('0x1b')](_0x545376);}return _0x27a2d8[_0x33ee('0x1c')](_0x545376)[_0x33ee('0x1d')]();};}function respondWithResult(_0x269106,_0x4ba9f3){_0x4ba9f3=_0x4ba9f3||0xc8;return function(_0x170ae9){if(_0x170ae9){return _0x269106[_0x33ee('0x1c')](_0x4ba9f3)[_0x33ee('0x1e')](_0x170ae9);}};}function respondWithFilteredResult(_0x436d72,_0x12fd8b){return function(_0x299490){if(_0x299490){var _0x253f9e=typeof _0x12fd8b[_0x33ee('0x1f')]===_0x33ee('0x20')&&typeof _0x12fd8b['limit']==='undefined';var _0x27ff4c=_0x299490[_0x33ee('0x21')];var _0x8ed750=_0x253f9e?0x0:_0x12fd8b[_0x33ee('0x1f')];var _0x23d827=_0x253f9e?_0x299490[_0x33ee('0x21')]:_0x12fd8b[_0x33ee('0x1f')]+_0x12fd8b[_0x33ee('0x22')];var _0x53e630;if(_0x23d827>=_0x27ff4c){_0x23d827=_0x27ff4c;_0x53e630=0xc8;}else{_0x53e630=0xce;}_0x436d72['status'](_0x53e630);return _0x436d72[_0x33ee('0x23')](_0x33ee('0x24'),_0x8ed750+'-'+_0x23d827+'/'+_0x27ff4c)[_0x33ee('0x1e')](_0x299490);}return null;};}function patchUpdates(_0x3d9223){return function(_0x14c0e1){try{jsonpatch['apply'](_0x14c0e1,_0x3d9223,!![]);}catch(_0x261f68){return BPromise[_0x33ee('0x25')](_0x261f68);}return _0x14c0e1[_0x33ee('0x26')]();};}function saveUpdates(_0x137790,_0x359991){return function(_0x4ee7ba){if(_0x4ee7ba){return _0x4ee7ba[_0x33ee('0x27')](_0x137790)[_0x33ee('0x28')](function(_0x2b8d83){return _0x2b8d83;});}return null;};}function handleEntityNotFound(_0x35590,_0x344d90){return function(_0x242619){if(!_0x242619){_0x35590[_0x33ee('0x1b')](0x194);}return _0x242619;};}function handleError(_0x4d0f41,_0x4a43eb){_0x4a43eb=_0x4a43eb||0x1f4;return function(_0x346882){logger[_0x33ee('0x29')](_0x346882[_0x33ee('0x2a')]);if(_0x346882[_0x33ee('0x2b')]){delete _0x346882[_0x33ee('0x2b')];}_0x4d0f41[_0x33ee('0x1c')](_0x4a43eb)[_0x33ee('0x2c')](_0x346882);};}exports['index']=function(_0x2d8369,_0x21ebb8){var _0x297ca9={},_0x2eed58={},_0x4bba92={'count':0x0,'rows':[]};var _0x4d2300=_[_0x33ee('0x2d')](db[_0x33ee('0x2e')][_0x33ee('0x2f')],function(_0x35015c){return{'name':_0x35015c['fieldName'],'type':_0x35015c[_0x33ee('0x30')][_0x33ee('0x31')]};});_0x2eed58[_0x33ee('0x32')]=_['map'](_0x4d2300,'name');_0x2eed58['query']=_[_0x33ee('0x33')](_0x2d8369[_0x33ee('0x34')]);_0x2eed58['filters']=_[_0x33ee('0x35')](_0x2eed58[_0x33ee('0x32')],_0x2eed58[_0x33ee('0x34')]);_0x297ca9[_0x33ee('0x36')]=_[_0x33ee('0x35')](_0x2eed58[_0x33ee('0x32')],qs['fields'](_0x2d8369[_0x33ee('0x34')][_0x33ee('0x37')]));_0x297ca9['attributes']=_0x297ca9[_0x33ee('0x36')][_0x33ee('0x38')]?_0x297ca9[_0x33ee('0x36')]:_0x2eed58[_0x33ee('0x32')];if(!_0x2d8369['query'][_0x33ee('0x39')]('nolimit')){_0x297ca9[_0x33ee('0x22')]=qs[_0x33ee('0x22')](_0x2d8369[_0x33ee('0x34')][_0x33ee('0x22')]);_0x297ca9[_0x33ee('0x1f')]=qs['offset'](_0x2d8369['query'][_0x33ee('0x1f')]);}_0x297ca9[_0x33ee('0x3a')]=qs[_0x33ee('0x3b')](_0x2d8369['query'][_0x33ee('0x3b')]);_0x297ca9['where']=qs[_0x33ee('0x3c')](_['pick'](_0x2d8369[_0x33ee('0x34')],_0x2eed58['filters']),_0x4d2300);if(_0x2d8369[_0x33ee('0x34')][_0x33ee('0x3d')]){_0x297ca9[_0x33ee('0x3e')]=_[_0x33ee('0x3f')](_0x297ca9['where'],{'$or':_['map'](_0x4d2300,function(_0x4983d){if(_0x4983d[_0x33ee('0x30')]!=='VIRTUAL'){var _0x389d82={};_0x389d82[_0x4983d[_0x33ee('0x2b')]]={'$like':'%'+_0x2d8369[_0x33ee('0x34')][_0x33ee('0x3d')]+'%'};return _0x389d82;}})});}_0x297ca9=_['merge']({},_0x297ca9,_0x2d8369['options']);var _0x1a3e9f={'where':_0x297ca9['where']};return db[_0x33ee('0x2e')][_0x33ee('0x21')](_0x1a3e9f)[_0x33ee('0x28')](function(_0x153732){_0x4bba92[_0x33ee('0x21')]=_0x153732;if(_0x2d8369[_0x33ee('0x34')][_0x33ee('0x40')]){_0x297ca9[_0x33ee('0x41')]=[{'all':!![]}];}return db[_0x33ee('0x2e')]['findAll'](_0x297ca9);})[_0x33ee('0x28')](function(_0x290a2e){_0x4bba92[_0x33ee('0x42')]=_0x290a2e;return _0x4bba92;})[_0x33ee('0x28')](respondWithFilteredResult(_0x21ebb8,_0x297ca9))[_0x33ee('0x43')](handleError(_0x21ebb8,null));};exports[_0x33ee('0x44')]=function(_0x2d8c89,_0xc98ebd){var _0x11c638={'raw':![],'where':{'id':_0x2d8c89['params']['id']}},_0xa72717={};_0xa72717[_0x33ee('0x32')]=_['keys'](db[_0x33ee('0x2e')][_0x33ee('0x2f')]);_0xa72717['query']=_[_0x33ee('0x33')](_0x2d8c89['query']);_0xa72717[_0x33ee('0x3c')]=_['intersection'](_0xa72717[_0x33ee('0x32')],_0xa72717[_0x33ee('0x34')]);_0x11c638['attributes']=_[_0x33ee('0x35')](_0xa72717['model'],qs[_0x33ee('0x37')](_0x2d8c89['query'][_0x33ee('0x37')]));_0x11c638[_0x33ee('0x36')]=_0x11c638['attributes']['length']?_0x11c638[_0x33ee('0x36')]:_0xa72717[_0x33ee('0x32')];if(_0x2d8c89[_0x33ee('0x34')][_0x33ee('0x40')]){_0x11c638[_0x33ee('0x41')]=[{'all':!![]}];}_0x11c638=_['merge']({},_0x11c638,_0x2d8c89[_0x33ee('0x45')]);return db['Team']['find'](_0x11c638)['then'](handleEntityNotFound(_0xc98ebd,null))[_0x33ee('0x28')](respondWithResult(_0xc98ebd,null))[_0x33ee('0x43')](handleError(_0xc98ebd,null));};exports['create']=function(_0x475871,_0x22fe4e){return db[_0x33ee('0x2e')][_0x33ee('0x46')](_0x475871['body'],{})[_0x33ee('0x28')](function(_0x364772){var _0x2e35b7=_0x475871[_0x33ee('0x47')][_0x33ee('0x48')]({'plain':!![]});if(!_0x2e35b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e35b7['role']===_0x33ee('0x47')){var _0x58f0ea=_0x364772[_0x33ee('0x48')]({'plain':!![]});var _0x4b3aec=_0x33ee('0x49');return db[_0x33ee('0x4a')][_0x33ee('0x4b')]({'where':{'name':_0x4b3aec,'userProfileId':_0x2e35b7['userProfileId']},'raw':!![]})[_0x33ee('0x28')](function(_0x3be26e){if(_0x3be26e&&_0x3be26e[_0x33ee('0x4c')]===0x0){return db[_0x33ee('0x4d')][_0x33ee('0x46')]({'name':_0x58f0ea[_0x33ee('0x2b')],'resourceId':_0x58f0ea['id'],'type':_0x3be26e[_0x33ee('0x2b')],'sectionId':_0x3be26e['id']},{})[_0x33ee('0x28')](function(){return _0x364772;});}else{return _0x364772;}})['catch'](function(_0x141c50){logger[_0x33ee('0x29')](_0x33ee('0x4e'),_0x141c50);throw _0x141c50;});}return _0x364772;})[_0x33ee('0x28')](respondWithResult(_0x22fe4e,0xc9))[_0x33ee('0x43')](handleError(_0x22fe4e,null));};exports[_0x33ee('0x27')]=function(_0x282487,_0x4ba7b0){if(_0x282487[_0x33ee('0x4f')]['id']){delete _0x282487[_0x33ee('0x4f')]['id'];}return db[_0x33ee('0x2e')][_0x33ee('0x4b')]({'where':{'id':_0x282487[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](handleEntityNotFound(_0x4ba7b0,null))['then'](saveUpdates(_0x282487['body'],null))[_0x33ee('0x28')](respondWithResult(_0x4ba7b0,null))['catch'](handleError(_0x4ba7b0,null));};exports[_0x33ee('0x51')]=function(_0x417772,_0x2362fa){var _0x152f6e=_0x417772[_0x33ee('0x50')]['id'];var _0x474fee=[];return db[_0x33ee('0x52')]['transaction'](function(_0x40e480){var _0x2fb54c='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x2fb54c,{'type':db[_0x33ee('0x53')][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480})[_0x33ee('0x28')](function(_0x46666c){_0x474fee=_['map'](_0x46666c,function(_0x219bdd){return Number(_0x219bdd[_0x33ee('0x56')]);});})['then'](function(){var _0x3299cc=_0x33ee('0x57')+_0x152f6e;return db[_0x33ee('0x52')]['query'](_0x3299cc,{'type':db[_0x33ee('0x53')]['QueryTypes'][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x49def0){var _0x359109=_[_0x33ee('0x2d')](_0x49def0,function(_0x375791){return Number(_0x375791[_0x33ee('0x58')]);});return db[_0x33ee('0x59')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'VoiceQueueId':{'$in':_0x359109}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x379133=_0x33ee('0x5a')+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x379133,{'type':db['Sequelize'][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0xb5474f){var _0x4d9bfc=_['map'](_0xb5474f,function(_0x1b9cd1){return Number(_0x1b9cd1[_0x33ee('0x5b')]);});return db['UserMailQueue'][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'MailQueueId':{'$in':_0x4d9bfc}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0xf77263='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0xf77263,{'type':db[_0x33ee('0x53')][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x26efd8){var _0x49cbb2=_['map'](_0x26efd8,function(_0xe6fdf0){return Number(_0xe6fdf0[_0x33ee('0x5c')]);});return db['UserSmsQueue'][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'SmsQueueId':{'$in':_0x49cbb2}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x2aa6c9='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')]['query'](_0x2aa6c9,{'type':db[_0x33ee('0x53')]['QueryTypes'][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x3c8643){var _0xb5e210=_[_0x33ee('0x2d')](_0x3c8643,function(_0x2c0ef1){return Number(_0x2c0ef1[_0x33ee('0x5d')]);});return db[_0x33ee('0x5e')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'ChatQueueId':{'$in':_0xb5e210}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x38f4df='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x38f4df,{'type':db[_0x33ee('0x53')][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x3e4658){var _0x4e80d0=_[_0x33ee('0x2d')](_0x3e4658,function(_0x59a2bd){return Number(_0x59a2bd[_0x33ee('0x5f')]);});return db[_0x33ee('0x60')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'FaxQueueId':{'$in':_0x4e80d0}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x246580=_0x33ee('0x61')+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x246580,{'type':db['Sequelize'][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x4cd6c6){var _0x5382b8=_[_0x33ee('0x2d')](_0x4cd6c6,function(_0x31976d){return Number(_0x31976d[_0x33ee('0x62')]);});return db[_0x33ee('0x63')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'OpenchannelQueueId':{'$in':_0x5382b8}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){var _0x237bc1=_0x33ee('0x64')+_0x152f6e;return db[_0x33ee('0x52')][_0x33ee('0x34')](_0x237bc1,{'type':db['Sequelize'][_0x33ee('0x54')][_0x33ee('0x55')],'raw':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x4181fc){var _0x362d09=_['map'](_0x4181fc,function(_0x57dbf9){return Number(_0x57dbf9['WhatsappQueueId']);});return db[_0x33ee('0x65')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'WhatsappQueueId':{'$in':_0x362d09}},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){return db[_0x33ee('0x66')]['find']({'where':{'TeamId':_0x152f6e}});})[_0x33ee('0x28')](function(_0x246b36){if(_0x246b36===null){return;}return db[_0x33ee('0x67')][_0x33ee('0x51')]({'where':{'UserId':{'$in':_0x474fee},'VoicePrefixId':_0x246b36[_0x33ee('0x68')]},'transaction':_0x40e480});})[_0x33ee('0x28')](function(){return db[_0x33ee('0x2e')][_0x33ee('0x51')]({'where':{'id':_0x152f6e},'cascade':!![],'transaction':_0x40e480});})[_0x33ee('0x28')](function(_0x28d024){if(_0x28d024===0x0){_0x2362fa['sendStatus'](0x194);}else{return db[_0x33ee('0x4d')]['destroy']({'where':{'type':'Teams','resourceId':_0x152f6e},'cascade':!![],'transaction':_0x40e480})[_0x33ee('0x28')](function(){_0x2362fa[_0x33ee('0x1c')](0xcc)['end']();});}})[_0x33ee('0x43')](function(_0x326158){_0x2362fa[_0x33ee('0x1c')](0x1f4)[_0x33ee('0x2c')](_0x326158);});});};exports['getQueues']=function(_0x4bd590,_0x5f5973,_0x114134){return db['Team']['findOne']({'where':{'id':_0x4bd590['params']['id']}})[_0x33ee('0x28')](handleEntityNotFound(_0x5f5973,null))['then'](function(_0x4580ba){if(!_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')]||!utils[_0x33ee('0x6a')](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')])){throw new db[(_0x33ee('0x53'))][(_0x33ee('0x6b'))](_0x33ee('0x6c'));}var _0x2de3ca={};var _0x47cc40={};_0x47cc40['model']=_['keys'](db[_[_0x33ee('0x6d')](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')]['toLowerCase']())+_0x33ee('0x6e')]['rawAttributes']);_0x47cc40[_0x33ee('0x34')]=_[_0x33ee('0x33')](_0x4bd590['query']);_0x47cc40[_0x33ee('0x3c')]=_[_0x33ee('0x35')](_0x47cc40[_0x33ee('0x32')],_0x47cc40['query']);_0x2de3ca[_0x33ee('0x36')]=_[_0x33ee('0x35')](_0x47cc40['model'],qs[_0x33ee('0x37')](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x37')]));_0x2de3ca[_0x33ee('0x36')]=_0x2de3ca[_0x33ee('0x36')][_0x33ee('0x38')]?_0x2de3ca[_0x33ee('0x36')]:_0x47cc40[_0x33ee('0x32')];_0x2de3ca['limit']=qs[_0x33ee('0x22')](_0x4bd590['query'][_0x33ee('0x22')]);_0x2de3ca['offset']=qs[_0x33ee('0x1f')](_0x4bd590[_0x33ee('0x34')]['offset']);_0x2de3ca[_0x33ee('0x3a')]=qs[_0x33ee('0x3b')](_0x4bd590['query'][_0x33ee('0x3b')]);_0x2de3ca[_0x33ee('0x3e')]=qs[_0x33ee('0x3c')](_[_0x33ee('0x6f')](_0x4bd590['query'],_0x47cc40[_0x33ee('0x3c')]));_0x2de3ca=_['merge']({},_0x2de3ca,_0x4bd590[_0x33ee('0x45')]);return _0x4580ba[_0x33ee('0x48')+_['capitalize'](_0x4bd590[_0x33ee('0x34')][_0x33ee('0x69')][_0x33ee('0x70')]())+_0x33ee('0x71')](_0x2de3ca);})[_0x33ee('0x28')](respondWithResult(_0x5f5973,null))[_0x33ee('0x43')](handleError(_0x5f5973,null));};exports[_0x33ee('0x72')]=function(_0x1db5fc,_0x2a296c,_0x41fcca){return db['Team']['findOne']({'where':{'id':_0x1db5fc[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](function(_0x503ce4){if(_0x503ce4){if(!_0x1db5fc[_0x33ee('0x4f')][_0x33ee('0x69')]||!utils[_0x33ee('0x6a')](_0x1db5fc[_0x33ee('0x4f')][_0x33ee('0x69')])){throw new db['Sequelize']['ValidationError']('Unknown\x20channel');}return _0x503ce4[_0x33ee('0x73')+_[_0x33ee('0x6d')](_0x1db5fc['body']['channel'][_0x33ee('0x70')]())+_0x33ee('0x71')](_0x1db5fc[_0x33ee('0x4f')]['ids']);}return null;})[_0x33ee('0x28')](handleEntityNotFound(_0x2a296c,null))[_0x33ee('0x28')](respondWithStatusCode(_0x2a296c,null))[_0x33ee('0x43')](handleError(_0x2a296c,null));};exports[_0x33ee('0x74')]=function(_0x2aade7,_0x39141c,_0x12e8a1){return db[_0x33ee('0x2e')]['findOne']({'where':{'id':_0x2aade7[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](function(_0xf86c00){if(_0xf86c00){if(!_0x2aade7['query'][_0x33ee('0x69')]||!utils[_0x33ee('0x6a')](_0x2aade7[_0x33ee('0x34')][_0x33ee('0x69')])){throw new db[(_0x33ee('0x53'))][(_0x33ee('0x6b'))](_0x33ee('0x6c'));}return _0xf86c00[_0x33ee('0x75')+_[_0x33ee('0x6d')](_0x2aade7[_0x33ee('0x34')][_0x33ee('0x69')][_0x33ee('0x70')]())+_0x33ee('0x71')](_0x2aade7['query'][_0x33ee('0x76')]);}return null;})[_0x33ee('0x28')](handleEntityNotFound(_0x39141c,null))[_0x33ee('0x28')](respondWithStatusCode(_0x39141c,null))[_0x33ee('0x43')](handleError(_0x39141c,null));};exports[_0x33ee('0x77')]=function(_0x3fa543,_0x249692){var _0x21b8d2=_[_0x33ee('0x78')](_0x3fa543[_0x33ee('0x4f')][_0x33ee('0x76')])?_0x3fa543[_0x33ee('0x4f')]['ids']:[_0x3fa543[_0x33ee('0x4f')][_0x33ee('0x76')]];var _0x5bd31b=_0x3fa543[_0x33ee('0x50')]['id'];return db[_0x33ee('0x2e')][_0x33ee('0x4b')]({'where':{'id':_0x5bd31b}})[_0x33ee('0x28')](handleEntityNotFound(_0x249692,null))['then'](function(_0x323b51){if(_0x323b51){var _0x226ebd=[_0x33ee('0x79'),_0x33ee('0x7a'),_0x33ee('0x7b'),_0x33ee('0x7c'),'Fax',_0x33ee('0x7d'),_0x33ee('0x7e')];return db[_0x33ee('0x52')][_0x33ee('0x7f')](function(_0x40766b){var _0x1aa3d9=_[_0x33ee('0x2d')](_0x226ebd,function(_0x514898){var _0x246ef0={'attributes':['id',_0x33ee('0x2b')]};if(_0x514898===_0x33ee('0x79')){_0x246ef0[_0x33ee('0x80')]={'attributes':[_0x33ee('0x81')]};}return _0x323b51['get'+_0x514898+_0x33ee('0x71')](_0x246ef0)[_0x33ee('0x28')](function(_0x1aa4e5){var _0x32a848=_[_0x33ee('0x2d')](_0x1aa4e5,function(_0x1b5e19){var _0x104270=_[_0x33ee('0x2d')](_0x21b8d2,function(_0x431c6e){var _0x1cddf3={'where':{'UserId':_0x431c6e,[_0x514898+_0x33ee('0x82')]:_0x1b5e19['id']},'transaction':_0x40766b};if(_0x514898==='Voice'){_0x1cddf3['defaults']={'penalty':_0x1b5e19[_0x33ee('0x83')]['penalty']};}return db[_0x33ee('0x84')+_0x514898+_0x33ee('0x6e')][_0x33ee('0x85')](_0x1cddf3)[_0x33ee('0x28')](function(){socket[_0x33ee('0x86')](_0x33ee('0x47')+_0x514898+_0x33ee('0x87'),{'UserId':_0x431c6e,[_0x514898+_0x33ee('0x82')]:_0x1b5e19['id']});if(_0x514898!==_0x33ee('0x79')){return;}return db[_0x33ee('0x84')][_0x33ee('0x88')]({'where':{'id':_0x21b8d2,'online':0x1},'attributes':['id',_0x33ee('0x2b'),_0x33ee('0x89'),'voicePause',_0x33ee('0x8a')],'raw':!![]})[_0x33ee('0x28')](function(_0x311344){var _0x429d6b=_[_0x33ee('0x2d')](_0x311344,function(_0x13ad84){return db[_0x33ee('0x8b')][_0x33ee('0x8c')]({'membername':_0x13ad84[_0x33ee('0x2b')],'UserId':_0x13ad84['id'],'queue_name':_0x1b5e19[_0x33ee('0x2b')],'VoiceQueueId':_0x1b5e19['id'],'interface':_[_0x33ee('0x8d')](_0x13ad84[_0x33ee('0x8a')])?util[_0x33ee('0x8e')]('SIP/%s',_0x13ad84['name']):_0x13ad84['interface'],'paused':_0x13ad84[_0x33ee('0x8f')]||![],'penalty':_0x1b5e19[_0x33ee('0x83')][_0x33ee('0x81')]},{'transaction':_0x40766b});});return Promise[_0x33ee('0x90')](_0x429d6b);});});});return Promise[_0x33ee('0x90')](_0x104270);});return Promise['all'](_0x32a848);})['then'](function(){return db[_0x33ee('0x66')]['findOne']({'where':{'teamId':_0x5bd31b}})[_0x33ee('0x28')](function(_0x1f6c3c){if(_0x1f6c3c){var _0x1519e1=_[_0x33ee('0x2d')](_0x21b8d2,function(_0x44685b){db[_0x33ee('0x67')][_0x33ee('0x8c')]({'UserId':_0x44685b,'VoicePrefixId':_0x1f6c3c['VoicePrefixId']});});return Promise[_0x33ee('0x90')](_0x1519e1);}});});});return Promise[_0x33ee('0x90')](_0x1aa3d9)[_0x33ee('0x28')](function(){return _0x323b51[_0x33ee('0x77')](_0x21b8d2,{'transaction':_0x40766b})['spread'](function(_0x499206){return _0x499206;});});});}})[_0x33ee('0x28')](respondWithResult(_0x249692,null))[_0x33ee('0x43')](handleError(_0x249692,null));};exports['removeAgents']=function(_0x5f568b,_0x172411){var _0x2bf299=_[_0x33ee('0x78')](_0x5f568b[_0x33ee('0x34')][_0x33ee('0x76')])?_0x5f568b[_0x33ee('0x34')][_0x33ee('0x76')]:[_0x5f568b[_0x33ee('0x34')][_0x33ee('0x76')]];var _0x5c646f=_0x5f568b[_0x33ee('0x50')]['id'];return db[_0x33ee('0x2e')][_0x33ee('0x4b')]({'where':{'id':_0x5c646f}})[_0x33ee('0x28')](handleEntityNotFound(_0x172411,null))[_0x33ee('0x28')](function(_0x311f02){if(_0x311f02){var _0x5b758c=[_0x33ee('0x79'),_0x33ee('0x7a'),_0x33ee('0x7b'),_0x33ee('0x7c'),'Fax',_0x33ee('0x7d'),_0x33ee('0x7e')];return db['sequelize'][_0x33ee('0x7f')](function(_0x3b28fb){var _0x38d237=_[_0x33ee('0x2d')](_0x5b758c,function(_0x48671f){var _0x4545e3={'attributes':['id',_0x33ee('0x2b')]};return _0x311f02[_0x33ee('0x48')+_0x48671f+_0x33ee('0x71')](_0x4545e3)[_0x33ee('0x28')](function(_0x5a4313){var _0x56bd57=_['map'](_0x5a4313,function(_0x535fbb){return _0x535fbb[_0x33ee('0x91')](_0x2bf299,{'transaction':_0x3b28fb})['then'](function(){var _0x547929=_['map'](_0x2bf299,function(_0x21acbb){socket[_0x33ee('0x86')](_0x33ee('0x47')+_0x48671f+_0x33ee('0x92'),{'UserId':Number(_0x21acbb),[_0x48671f+'QueueId']:_0x535fbb['id']});if(_0x48671f!==_0x33ee('0x79')){return;}return db[_0x33ee('0x8b')][_0x33ee('0x51')]({'where':{'VoiceQueueId':_0x535fbb['id'],'UserId':_0x21acbb},'transaction':_0x3b28fb});});return Promise['all'](_0x547929);});});return Promise[_0x33ee('0x90')](_0x56bd57);});});return Promise[_0x33ee('0x90')](_0x38d237)[_0x33ee('0x28')](function(){return _0x311f02[_0x33ee('0x91')](_0x2bf299,{'transaction':_0x3b28fb});})['then'](function(){return db[_0x33ee('0x66')]['findOne']({'where':{'teamId':_0x5c646f}})['then'](function(_0x1bbf85){if(_0x1bbf85){var _0x351482=_['map'](_0x2bf299,function(_0x13bb84){db['UserVoicePrefix'][_0x33ee('0x51')]({'where':{'UserId':_0x13bb84,'VoicePrefixId':_0x1bbf85['VoicePrefixId']}});});return Promise[_0x33ee('0x90')](_0x351482);}});});});}})[_0x33ee('0x28')](respondWithStatusCode(_0x172411,null))[_0x33ee('0x43')](handleError(_0x172411,null));};exports[_0x33ee('0x93')]=function(_0x9d094f,_0x57be37,_0x25354b){var _0x53b58e={};var _0x1bece7={};var _0x36a1e7;var _0xdbdff7;return db[_0x33ee('0x2e')][_0x33ee('0x94')]({'where':{'id':_0x9d094f[_0x33ee('0x50')]['id']}})[_0x33ee('0x28')](handleEntityNotFound(_0x57be37,null))['then'](function(_0x38abe7){if(_0x38abe7){_0x36a1e7=_0x38abe7;_0x1bece7['model']=_['keys'](db[_0x33ee('0x84')][_0x33ee('0x2f')]);_0x1bece7[_0x33ee('0x34')]=_[_0x33ee('0x33')](_0x9d094f[_0x33ee('0x34')]);_0x1bece7['filters']=_['intersection'](_0x1bece7[_0x33ee('0x32')],_0x1bece7[_0x33ee('0x34')]);_0x53b58e[_0x33ee('0x36')]=_['intersection'](_0x1bece7['model'],qs[_0x33ee('0x37')](_0x9d094f[_0x33ee('0x34')][_0x33ee('0x37')]));_0x53b58e[_0x33ee('0x36')]=_0x53b58e['attributes']['length']?_0x53b58e[_0x33ee('0x36')]:_0x1bece7[_0x33ee('0x32')];_0x53b58e[_0x33ee('0x3a')]=qs['sort'](_0x9d094f[_0x33ee('0x34')][_0x33ee('0x3b')]);_0x53b58e['where']=qs[_0x33ee('0x3c')](_[_0x33ee('0x6f')](_0x9d094f[_0x33ee('0x34')],_0x1bece7[_0x33ee('0x3c')]));if(_0x9d094f[_0x33ee('0x34')]['filter']){_0x53b58e[_0x33ee('0x3e')]=_[_0x33ee('0x3f')](_0x53b58e[_0x33ee('0x3e')],{'$or':_[_0x33ee('0x2d')](_0x53b58e[_0x33ee('0x36')],function(_0x1eb60b){var _0x1e99c0={};_0x1e99c0[_0x1eb60b]={'$like':'%'+_0x9d094f[_0x33ee('0x34')][_0x33ee('0x3d')]+'%'};return _0x1e99c0;})});}_0x53b58e=_['merge']({},_0x53b58e,_0x9d094f['options']);return _0x36a1e7[_0x33ee('0x93')](_0x53b58e);}})[_0x33ee('0x28')](function(_0x4ac052){if(_0x4ac052){_0xdbdff7=_0x4ac052['length'];if(!_0x9d094f[_0x33ee('0x34')][_0x33ee('0x39')](_0x33ee('0x95'))){_0x53b58e['limit']=qs[_0x33ee('0x22')](_0x9d094f['query']['limit']);_0x53b58e['offset']=qs['offset'](_0x9d094f[_0x33ee('0x34')]['offset']);}return _0x36a1e7[_0x33ee('0x93')](_0x53b58e);}})['then'](function(_0x2f1356){if(_0x2f1356){return _0x2f1356?{'count':_0xdbdff7,'rows':_0x2f1356}:null;}})[_0x33ee('0x28')](respondWithResult(_0x57be37,null))[_0x33ee('0x43')](handleError(_0x57be37,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 4ffbfb7..db9bb1d 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 _0x7edf=['emit','exports','Team','setMaxListeners','update'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7edf,0xf7));var _0xf7ed=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x7edf[_0x9cd4c3];return _0x4c9025;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xf7ed('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0xf7ed('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7ed('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3f266f){return function(_0x3a65f1,_0x2e3ff3,_0x3ca453){TeamEvents[_0xf7ed('0x3')](_0x3f266f+':'+_0x3a65f1['id'],_0x3a65f1);TeamEvents[_0xf7ed('0x3')](_0x3f266f,_0x3a65f1);_0x3ca453(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xf7ed('0x4')]=TeamEvents; \ No newline at end of file +var _0x4f61=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','Team'];(function(_0x50d290,_0x5862c2){var _0x5093f3=function(_0xef653){while(--_0xef653){_0x50d290['push'](_0x50d290['shift']());}};_0x5093f3(++_0x5862c2);}(_0x4f61,0x1a5));var _0x14f6=function(_0x538547,_0x2fe78d){_0x538547=_0x538547-0x0;var _0x4d23d9=_0x4f61[_0x538547];return _0x4d23d9;};'use strict';var EventEmitter=require(_0x14f6('0x0'));var Team=require('../../mysqldb')['db'][_0x14f6('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x14f6('0x2')](0x0);var events={'afterCreate':_0x14f6('0x3'),'afterUpdate':_0x14f6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x190f11){return function(_0x5ef40c,_0x30dcea,_0x2bd37f){TeamEvents[_0x14f6('0x5')](_0x190f11+':'+_0x5ef40c['id'],_0x5ef40c);TeamEvents[_0x14f6('0x5')](_0x190f11,_0x5ef40c);_0x2bd37f(null);};}for(var e in events){if(events[_0x14f6('0x6')](e)){var event=events[e];Team[_0x14f6('0x7')](e,emitEvent(event));}}module[_0x14f6('0x8')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b927134..13d69f6 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 _0x2196=['exports','define','Team','teams','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x49ce3b,_0x220a09){var _0x1b36c0=function(_0x1ad603){while(--_0x1ad603){_0x49ce3b['push'](_0x49ce3b['shift']());}};_0x1b36c0(++_0x220a09);}(_0x2196,0xee));var _0x6219=function(_0xd9f348,_0x1af746){_0xd9f348=_0xd9f348-0x0;var _0x5466e4=_0x2196[_0xd9f348];return _0x5466e4;};'use strict';var _=require(_0x6219('0x0'));var util=require(_0x6219('0x1'));var logger=require('../../config/logger')(_0x6219('0x2'));var moment=require(_0x6219('0x3'));var BPromise=require(_0x6219('0x4'));var rp=require(_0x6219('0x5'));var fs=require('fs');var path=require(_0x6219('0x6'));var rimraf=require(_0x6219('0x7'));var config=require(_0x6219('0x8'));var attributes=require('./team.attributes');module[_0x6219('0x9')]=function(_0x3be67f,_0x1ffb9f){return _0x3be67f[_0x6219('0xa')](_0x6219('0xb'),attributes,{'tableName':_0x6219('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7ce=['../../config/environment','exports','define','Team','teams','util','moment','bluebird','path','rimraf'];(function(_0x17fd57,_0x2fce34){var _0x561372=function(_0x3acdb7){while(--_0x3acdb7){_0x17fd57['push'](_0x17fd57['shift']());}};_0x561372(++_0x2fce34);}(_0xe7ce,0x1a9));var _0xee7c=function(_0x1f77ac,_0x3bf5aa){_0x1f77ac=_0x1f77ac-0x0;var _0x355c1b=_0xe7ce[_0x1f77ac];return _0x355c1b;};'use strict';var _=require('lodash');var util=require(_0xee7c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xee7c('0x1'));var BPromise=require(_0xee7c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee7c('0x3'));var rimraf=require(_0xee7c('0x4'));var config=require(_0xee7c('0x5'));var attributes=require('./team.attributes');module[_0xee7c('0x6')]=function(_0x4bdf01,_0x41f3a4){return _0x4bdf01[_0xee7c('0x7')](_0xee7c('0x8'),attributes,{'tableName':_0xee7c('0x9'),'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 049e2d1..6ba04e2 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 _0x6e0f=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','moment'];(function(_0x1bac88,_0x3c022b){var _0xd8985b=function(_0x572506){while(--_0x572506){_0x1bac88['push'](_0x1bac88['shift']());}};_0xd8985b(++_0x3c022b);}(_0x6e0f,0x8b));var _0xf6e0=function(_0x225737,_0x28110b){_0x225737=_0x225737-0x0;var _0x4c5156=_0x6e0f[_0x225737];return _0x4c5156;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf6e0('0x0'));var BPromise=require(_0xf6e0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf6e0('0x2'));var db=require(_0xf6e0('0x3'))['db'];var utils=require(_0xf6e0('0x4'));var logger=require(_0xf6e0('0x5'))(_0xf6e0('0x6'));var config=require('../../config/environment');var jayson=require(_0xf6e0('0x7'));var client=jayson[_0xf6e0('0x8')][_0xf6e0('0x9')]({'port':0x232a});config[_0xf6e0('0xa')]=_[_0xf6e0('0xb')](config[_0xf6e0('0xa')],{'host':_0xf6e0('0xc'),'port':0x18eb});var socket=require(_0xf6e0('0xd'))(new Redis(config[_0xf6e0('0xa')]));require(_0xf6e0('0xe'))['register'](socket);function respondWithRpcPromise(_0x2515a3,_0x5b7159,_0x9e5bf9){return new BPromise(function(_0x36169d,_0x491e44){return client[_0xf6e0('0xf')](_0x2515a3,_0x9e5bf9)[_0xf6e0('0x10')](function(_0x56e411){logger[_0xf6e0('0x11')](_0xf6e0('0x12'),_0x5b7159,_0xf6e0('0x13'));logger[_0xf6e0('0x14')](_0xf6e0('0x15'),_0x5b7159,_0xf6e0('0x13'),JSON[_0xf6e0('0x16')](_0x56e411));if(_0x56e411['error']){if(_0x56e411['error'][_0xf6e0('0x17')]===0x1f4){logger[_0xf6e0('0x18')](_0xf6e0('0x12'),_0x5b7159,_0x56e411[_0xf6e0('0x18')][_0xf6e0('0x19')]);return _0x491e44(_0x56e411['error']['message']);}logger[_0xf6e0('0x18')]('Team,\x20%s,\x20%s',_0x5b7159,_0x56e411['error'][_0xf6e0('0x19')]);return _0x36169d(_0x56e411[_0xf6e0('0x18')]['message']);}else{logger[_0xf6e0('0x11')](_0xf6e0('0x12'),_0x5b7159,_0xf6e0('0x13'));_0x36169d(_0x56e411[_0xf6e0('0x1a')]['message']);}})[_0xf6e0('0x1b')](function(_0x42d127){logger['error']('Team,\x20%s,\x20%s',_0x5b7159,_0x42d127);_0x491e44(_0x42d127);});});} \ No newline at end of file +var _0x0fdd=['then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x187394,_0x4c1132){var _0x724fe5=function(_0x2d9df5){while(--_0x2d9df5){_0x187394['push'](_0x187394['shift']());}};_0x724fe5(++_0x4c1132);}(_0x0fdd,0x9f));var _0xd0fd=function(_0x18f3d6,_0x2ac92e){_0x18f3d6=_0x18f3d6-0x0;var _0x3c8a51=_0x0fdd[_0x18f3d6];return _0x3c8a51;};'use strict';var _=require(_0xd0fd('0x0'));var util=require(_0xd0fd('0x1'));var moment=require(_0xd0fd('0x2'));var BPromise=require('bluebird');var rs=require(_0xd0fd('0x3'));var fs=require('fs');var Redis=require(_0xd0fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0fd('0x5'));var logger=require(_0xd0fd('0x6'))('rpc');var config=require(_0xd0fd('0x7'));var jayson=require(_0xd0fd('0x8'));var client=jayson[_0xd0fd('0x9')]['http']({'port':0x232a});config[_0xd0fd('0xa')]=_[_0xd0fd('0xb')](config['redis'],{'host':_0xd0fd('0xc'),'port':0x18eb});var socket=require(_0xd0fd('0xd'))(new Redis(config[_0xd0fd('0xa')]));require('./team.socket')[_0xd0fd('0xe')](socket);function respondWithRpcPromise(_0x3158bd,_0x36b98c,_0x1d4308){return new BPromise(function(_0x36d1f1,_0x2127de){return client[_0xd0fd('0xf')](_0x3158bd,_0x1d4308)[_0xd0fd('0x10')](function(_0xbe4b49){logger['info'](_0xd0fd('0x11'),_0x36b98c,_0xd0fd('0x12'));logger['debug'](_0xd0fd('0x13'),_0x36b98c,_0xd0fd('0x12'),JSON[_0xd0fd('0x14')](_0xbe4b49));if(_0xbe4b49[_0xd0fd('0x15')]){if(_0xbe4b49[_0xd0fd('0x15')]['code']===0x1f4){logger[_0xd0fd('0x15')]('Team,\x20%s,\x20%s',_0x36b98c,_0xbe4b49['error'][_0xd0fd('0x16')]);return _0x2127de(_0xbe4b49[_0xd0fd('0x15')][_0xd0fd('0x16')]);}logger['error'](_0xd0fd('0x11'),_0x36b98c,_0xbe4b49['error']['message']);return _0x36d1f1(_0xbe4b49[_0xd0fd('0x15')][_0xd0fd('0x16')]);}else{logger[_0xd0fd('0x17')](_0xd0fd('0x11'),_0x36b98c,'request\x20sent');_0x36d1f1(_0xbe4b49['result']['message']);}})[_0xd0fd('0x18')](function(_0x4310f3){logger[_0xd0fd('0x15')](_0xd0fd('0x11'),_0x36b98c,_0x4310f3);_0x2127de(_0x4310f3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 0d959fa..0bb9755 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 _0xb6f9=['register','team:','./team.events','save','remove','update'];(function(_0x1488f0,_0x2fa05d){var _0x29c3f7=function(_0x4ff44c){while(--_0x4ff44c){_0x1488f0['push'](_0x1488f0['shift']());}};_0x29c3f7(++_0x2fa05d);}(_0xb6f9,0x146));var _0x9b6f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6f9[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require(_0x9b6f('0x0'));var events=[_0x9b6f('0x1'),_0x9b6f('0x2'),_0x9b6f('0x3')];function createListener(_0x49a6af,_0x6b2302){return function(_0x118104){_0x6b2302['emit'](_0x49a6af,_0x118104);};}function removeListener(_0x49dc7c,_0x1a6937){return function(){TeamEvents['removeListener'](_0x49dc7c,_0x1a6937);};}exports[_0x9b6f('0x4')]=function(_0x4f5c81){for(var _0x1740ca=0x0,_0x390557=events['length'];_0x1740ca<_0x390557;_0x1740ca++){var _0x1cbc43=events[_0x1740ca];var _0x1ed6dc=createListener(_0x9b6f('0x5')+_0x1cbc43,_0x4f5c81);TeamEvents['on'](_0x1cbc43,_0x1ed6dc);}}; \ No newline at end of file +var _0x268c=['removeListener','register','length','team:','./team.events','remove','emit'];(function(_0x54f989,_0x593097){var _0x295079=function(_0x186080){while(--_0x186080){_0x54f989['push'](_0x54f989['shift']());}};_0x295079(++_0x593097);}(_0x268c,0xb3));var _0xc268=function(_0x4c80d7,_0x2bef29){_0x4c80d7=_0x4c80d7-0x0;var _0x3c5095=_0x268c[_0x4c80d7];return _0x3c5095;};'use strict';var TeamEvents=require(_0xc268('0x0'));var events=['save',_0xc268('0x1'),'update'];function createListener(_0x12d634,_0x498234){return function(_0x4f78a7){_0x498234[_0xc268('0x2')](_0x12d634,_0x4f78a7);};}function removeListener(_0x55edc9,_0x19f84f){return function(){TeamEvents[_0xc268('0x3')](_0x55edc9,_0x19f84f);};}exports[_0xc268('0x4')]=function(_0x3d0ecf){for(var _0x4e2a03=0x0,_0x4b843c=events[_0xc268('0x5')];_0x4e2a03<_0x4b843c;_0x4e2a03++){var _0x2f7f1b=events[_0x4e2a03];var _0x596f88=createListener(_0xc268('0x6')+_0x2f7f1b,_0x3d0ecf);TeamEvents['on'](_0x2f7f1b,_0x596f88);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 96be2e8..e7d16f5 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x51f4=['sequelize','exports','INTEGER'];(function(_0x3d9841,_0x36bc51){var _0x2af2ae=function(_0x54581e){while(--_0x54581e){_0x3d9841['push'](_0x3d9841['shift']());}};_0x2af2ae(++_0x36bc51);}(_0x51f4,0x1c2));var _0x451f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x51f4[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x451f('0x0'));module[_0x451f('0x1')]={'TeamId':{'type':Sequelize[_0x451f('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2bdb=['INTEGER','sequelize'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x2bdb,0x105));var _0xb2bd=function(_0x5062aa,_0x306f56){_0x5062aa=_0x5062aa-0x0;var _0x14b88f=_0x2bdb[_0x5062aa];return _0x14b88f;};'use strict';var Sequelize=require(_0xb2bd('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0xb2bd('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index ecaf6b4..c66eb13 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f3a=['api','moment','bluebird','request-promise','path','rimraf','./teamVoicePrefix.attributes','team_has_voice_prefixes','lodash'];(function(_0x361ddd,_0x503739){var _0x3a92da=function(_0x439b0e){while(--_0x439b0e){_0x361ddd['push'](_0x361ddd['shift']());}};_0x3a92da(++_0x503739);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x4ba4a7,_0x4a450f){_0x4ba4a7=_0x4ba4a7-0x0;var _0x507aae=_0x2f3a[_0x4ba4a7];return _0x507aae;};'use strict';var _=require(_0xa2f3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa2f3('0x1'));var moment=require(_0xa2f3('0x2'));var BPromise=require(_0xa2f3('0x3'));var rp=require(_0xa2f3('0x4'));var fs=require('fs');var path=require(_0xa2f3('0x5'));var rimraf=require(_0xa2f3('0x6'));var config=require('../../config/environment');var attributes=require(_0xa2f3('0x7'));module['exports']=function(_0xfe0b09,_0x1ddec0){return _0xfe0b09['define']('TeamVoicePrefix',attributes,{'tableName':_0xa2f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x258919,_0x1754e6){var _0xfbd68b=function(_0x3bc3e9){while(--_0x3bc3e9){_0x258919['push'](_0x258919['shift']());}};_0xfbd68b(++_0x1754e6);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x3102b8,_0x2ea126){_0x3102b8=_0x3102b8-0x0;var _0x1896b6=_0xd4f4[_0x3102b8];return _0x1896b6;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 3d035c5..6a4fde4 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(_0x1bd0a6,_0x5d55d9){var _0x182729=function(_0x2f5be0){while(--_0x2f5be0){_0x1bd0a6['push'](_0x1bd0a6['shift']());}};_0x182729(++_0x5d55d9);}(_0xe706,0xa3));var _0x6e70=function(_0x19bdf5,_0x3a6395){_0x19bdf5=_0x19bdf5-0x0;var _0x140930=_0xe706[_0x19bdf5];return _0x140930;};'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(_0x5f4a99,_0xf04496){var _0x1d018d=function(_0x82c1e8){while(--_0x82c1e8){_0x5f4a99['push'](_0x5f4a99['shift']());}};_0x1d018d(++_0xf04496);}(_0x70e0,0x17b));var _0x070e=function(_0xe33a61,_0x32b5ac){_0xe33a61=_0xe33a61-0x0;var _0x144e50=_0x70e0[_0xe33a61];return _0x144e50;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c5adec0..eed6837 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 _0x302c=['sequelize','exports','INTEGER'];(function(_0x236dfc,_0x159411){var _0x53e3c6=function(_0x18349e){while(--_0x18349e){_0x236dfc['push'](_0x236dfc['shift']());}};_0x53e3c6(++_0x159411);}(_0x302c,0x15c));var _0xc302=function(_0x418d29,_0x1ce828){_0x418d29=_0x418d29-0x0;var _0x5b030a=_0x302c[_0x418d29];return _0x5b030a;};'use strict';var Sequelize=require(_0xc302('0x0'));module[_0xc302('0x1')]={'penalty':{'type':Sequelize[_0xc302('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2bce=['sequelize','exports'];(function(_0x4806f6,_0x4dfd93){var _0x578b9f=function(_0x14f84c){while(--_0x14f84c){_0x4806f6['push'](_0x4806f6['shift']());}};_0x578b9f(++_0x4dfd93);}(_0x2bce,0xd6));var _0xe2bc=function(_0xf8f6ca,_0x1a4675){_0xf8f6ca=_0xf8f6ca-0x0;var _0xe63532=_0x2bce[_0xf8f6ca];return _0xe63532;};'use strict';var Sequelize=require(_0xe2bc('0x0'));module[_0xe2bc('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 06f3ca2..6e46a93 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 _0x257e=['define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3774a4,_0x2bb93b){var _0x537a7e=function(_0x23f321){while(--_0x23f321){_0x3774a4['push'](_0x3774a4['shift']());}};_0x537a7e(++_0x2bb93b);}(_0x257e,0x1dc));var _0xe257=function(_0x29ae80,_0x3579f1){_0x29ae80=_0x29ae80-0x0;var _0x5d6d71=_0x257e[_0x29ae80];return _0x5d6d71;};'use strict';var _=require('lodash');var util=require(_0xe257('0x0'));var logger=require(_0xe257('0x1'))('api');var moment=require(_0xe257('0x2'));var BPromise=require('bluebird');var rp=require(_0xe257('0x3'));var fs=require('fs');var path=require(_0xe257('0x4'));var rimraf=require(_0xe257('0x5'));var config=require(_0xe257('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0xe257('0x7')]=function(_0x2a01fe,_0x5dcd04){return _0x2a01fe[_0xe257('0x8')](_0xe257('0x9'),attributes,{'tableName':_0xe257('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96a2=['bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger','api','moment'];(function(_0x68f7c1,_0x5415cf){var _0x55b284=function(_0x35d425){while(--_0x35d425){_0x68f7c1['push'](_0x68f7c1['shift']());}};_0x55b284(++_0x5415cf);}(_0x96a2,0x96));var _0x296a=function(_0x30046c,_0x391ab5){_0x30046c=_0x30046c-0x0;var _0x4de114=_0x96a2[_0x30046c];return _0x4de114;};'use strict';var _=require(_0x296a('0x0'));var util=require('util');var logger=require(_0x296a('0x1'))(_0x296a('0x2'));var moment=require(_0x296a('0x3'));var BPromise=require(_0x296a('0x4'));var rp=require(_0x296a('0x5'));var fs=require('fs');var path=require(_0x296a('0x6'));var rimraf=require(_0x296a('0x7'));var config=require(_0x296a('0x8'));var attributes=require(_0x296a('0x9'));module[_0x296a('0xa')]=function(_0x285be8,_0x31bb42){return _0x285be8[_0x296a('0xb')](_0x296a('0xc'),attributes,{'tableName':_0x296a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index efec08f..6618508 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 _0x8c2c=['request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','TeamVoiceQueue,\x20%s,\x20%s','debug'];(function(_0x198746,_0x45bef4){var _0x1bf55f=function(_0x69c85f){while(--_0x69c85f){_0x198746['push'](_0x198746['shift']());}};_0x1bf55f(++_0x45bef4);}(_0x8c2c,0x92));var _0xc8c2=function(_0xabbb53,_0x5e2e4b){_0xabbb53=_0xabbb53-0x0;var _0x368b4a=_0x8c2c[_0xabbb53];return _0x368b4a;};'use strict';var _=require('lodash');var util=require(_0xc8c2('0x0'));var moment=require(_0xc8c2('0x1'));var BPromise=require(_0xc8c2('0x2'));var rs=require(_0xc8c2('0x3'));var fs=require('fs');var Redis=require(_0xc8c2('0x4'));var db=require(_0xc8c2('0x5'))['db'];var utils=require(_0xc8c2('0x6'));var logger=require(_0xc8c2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc8c2('0x8'));var client=jayson[_0xc8c2('0x9')][_0xc8c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2579ad,_0x271de3,_0x5acf62){return new BPromise(function(_0x54b165,_0x12ca42){return client['request'](_0x2579ad,_0x5acf62)[_0xc8c2('0xb')](function(_0x339c02){logger['info'](_0xc8c2('0xc'),_0x271de3,'request\x20sent');logger[_0xc8c2('0xd')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x271de3,_0xc8c2('0xe'),JSON[_0xc8c2('0xf')](_0x339c02));if(_0x339c02[_0xc8c2('0x10')]){if(_0x339c02[_0xc8c2('0x10')][_0xc8c2('0x11')]===0x1f4){logger[_0xc8c2('0x10')](_0xc8c2('0xc'),_0x271de3,_0x339c02[_0xc8c2('0x10')][_0xc8c2('0x12')]);return _0x12ca42(_0x339c02['error'][_0xc8c2('0x12')]);}logger[_0xc8c2('0x10')](_0xc8c2('0xc'),_0x271de3,_0x339c02['error']['message']);return _0x54b165(_0x339c02[_0xc8c2('0x10')][_0xc8c2('0x12')]);}else{logger['info'](_0xc8c2('0xc'),_0x271de3,'request\x20sent');_0x54b165(_0x339c02[_0xc8c2('0x13')]['message']);}})['catch'](function(_0x529c57){logger[_0xc8c2('0x10')](_0xc8c2('0xc'),_0x271de3,_0x529c57);_0x12ca42(_0x529c57);});});} \ No newline at end of file +var _0xada2=['../../config/environment','jayson/promise','client','http','request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c54c0,_0x3e3d6d){var _0x5a633b=function(_0x8413c5){while(--_0x8413c5){_0x5c54c0['push'](_0x5c54c0['shift']());}};_0x5a633b(++_0x3e3d6d);}(_0xada2,0xfd));var _0x2ada=function(_0x20d9a2,_0x5bb34d){_0x20d9a2=_0x20d9a2-0x0;var _0x5dad59=_0xada2[_0x20d9a2];return _0x5dad59;};'use strict';var _=require(_0x2ada('0x0'));var util=require(_0x2ada('0x1'));var moment=require(_0x2ada('0x2'));var BPromise=require(_0x2ada('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ada('0x4'));var db=require(_0x2ada('0x5'))['db'];var utils=require(_0x2ada('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2ada('0x7'));var jayson=require(_0x2ada('0x8'));var client=jayson[_0x2ada('0x9')][_0x2ada('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa4b8b1,_0x3f3726,_0x4166d8){return new BPromise(function(_0x1deb4a,_0x1d204f){return client[_0x2ada('0xb')](_0xa4b8b1,_0x4166d8)['then'](function(_0x508398){logger[_0x2ada('0xc')](_0x2ada('0xd'),_0x3f3726,_0x2ada('0xe'));logger[_0x2ada('0xf')](_0x2ada('0x10'),_0x3f3726,_0x2ada('0xe'),JSON['stringify'](_0x508398));if(_0x508398[_0x2ada('0x11')]){if(_0x508398[_0x2ada('0x11')][_0x2ada('0x12')]===0x1f4){logger[_0x2ada('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3f3726,_0x508398[_0x2ada('0x11')]['message']);return _0x1d204f(_0x508398[_0x2ada('0x11')][_0x2ada('0x13')]);}logger[_0x2ada('0x11')](_0x2ada('0xd'),_0x3f3726,_0x508398[_0x2ada('0x11')][_0x2ada('0x13')]);return _0x1deb4a(_0x508398[_0x2ada('0x11')][_0x2ada('0x13')]);}else{logger[_0x2ada('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x3f3726,_0x2ada('0xe'));_0x1deb4a(_0x508398['result'][_0x2ada('0x13')]);}})['catch'](function(_0x1f6622){logger[_0x2ada('0x11')](_0x2ada('0xd'),_0x3f3726,_0x1f6622);_0x1d204f(_0x1f6622);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index b5c2cdc..0f24d35 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 _0xd509=['post','create','/:id','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','show'];(function(_0x56220c,_0x1086cf){var _0x547f39=function(_0x5f54ea){while(--_0x5f54ea){_0x56220c['push'](_0x56220c['shift']());}};_0x547f39(++_0x1086cf);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9d50('0x0'));var timeout=require(_0x9d50('0x1'));var express=require(_0x9d50('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9d50('0x3'));var interaction=require(_0x9d50('0x4'));var config=require('../../config/environment');var controller=require(_0x9d50('0x5'));router[_0x9d50('0x6')]('/',auth[_0x9d50('0x7')](),controller['index']);router[_0x9d50('0x6')]('/:id',auth[_0x9d50('0x7')](),controller[_0x9d50('0x8')]);router[_0x9d50('0x9')]('/',auth[_0x9d50('0x7')](),controller[_0x9d50('0xa')]);router['put'](_0x9d50('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9d50('0xc')]('/:id',auth[_0x9d50('0x7')](),controller[_0x9d50('0xd')]);module[_0x9d50('0xe')]=router; \ No newline at end of file +var _0x3d04=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./template.controller','get','isAuthenticated','show','post','create','put','update','destroy','exports'];(function(_0x4a39f2,_0x4ef331){var _0x1d8bc9=function(_0x44aa39){while(--_0x44aa39){_0x4a39f2['push'](_0x4a39f2['shift']());}};_0x1d8bc9(++_0x4ef331);}(_0x3d04,0xbe));var _0x43d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3d04[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x43d0('0x0'));var util=require(_0x43d0('0x1'));var path=require(_0x43d0('0x2'));var timeout=require(_0x43d0('0x3'));var express=require(_0x43d0('0x4'));var router=express[_0x43d0('0x5')]();var fs_extra=require(_0x43d0('0x6'));var auth=require(_0x43d0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x43d0('0x8'));var controller=require(_0x43d0('0x9'));router[_0x43d0('0xa')]('/',auth[_0x43d0('0xb')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x43d0('0xc')]);router[_0x43d0('0xd')]('/',auth[_0x43d0('0xb')](),controller[_0x43d0('0xe')]);router[_0x43d0('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x43d0('0x10')]);router['delete']('/:id',auth[_0x43d0('0xb')](),controller[_0x43d0('0x11')]);module[_0x43d0('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index b88a7a9..a5f7931 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 _0x95f3=['exports','STRING','sequelize'];(function(_0x173c26,_0x1a85a7){var _0xe0625d=function(_0x1beb5f){while(--_0x1beb5f){_0x173c26['push'](_0x173c26['shift']());}};_0xe0625d(++_0x1a85a7);}(_0x95f3,0x179));var _0x395f=function(_0x5ccea9,_0x4ae2b9){_0x5ccea9=_0x5ccea9-0x0;var _0x39bf51=_0x95f3[_0x5ccea9];return _0x39bf51;};'use strict';var Sequelize=require(_0x395f('0x0'));module[_0x395f('0x1')]={'name':{'type':Sequelize[_0x395f('0x2')]},'description':{'type':Sequelize[_0x395f('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x0236=['exports','STRING','TEXT','sequelize'];(function(_0x39cfa6,_0x17dec0){var _0x4c8e4d=function(_0x5327ef){while(--_0x5327ef){_0x39cfa6['push'](_0x39cfa6['shift']());}};_0x4c8e4d(++_0x17dec0);}(_0x0236,0x93));var _0x6023=function(_0x3ed2ef,_0x296c36){_0x3ed2ef=_0x3ed2ef-0x0;var _0x3f231f=_0x0236[_0x3ed2ef];return _0x3f231f;};'use strict';var Sequelize=require(_0x6023('0x0'));module[_0x6023('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6023('0x2')]},'html':{'type':Sequelize[_0x6023('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index fe85edb..ef4d51a 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 _0xff75=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','get','Templates','UserProfileResource','destroy','error','stack','name','send','index','map','Template','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','filters','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js'];(function(_0x1dfd19,_0x6477e7){var _0x445d76=function(_0x1f55c7){while(--_0x1f55c7){_0x1dfd19['push'](_0x1dfd19['shift']());}};_0x445d76(++_0x6477e7);}(_0xff75,0x93));var _0x5ff7=function(_0x4a28f7,_0x33d792){_0x4a28f7=_0x4a28f7-0x0;var _0x3924cb=_0xff75[_0x4a28f7];return _0x3924cb;};'use strict';var emlformat=require(_0x5ff7('0x0'));var rimraf=require(_0x5ff7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5ff7('0x2'));var rp=require(_0x5ff7('0x3'));var moment=require(_0x5ff7('0x4'));var BPromise=require(_0x5ff7('0x5'));var Mustache=require(_0x5ff7('0x6'));var util=require(_0x5ff7('0x7'));var path=require(_0x5ff7('0x8'));var sox=require(_0x5ff7('0x9'));var csv=require(_0x5ff7('0xa'));var ejs=require(_0x5ff7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5ff7('0xc'));var jsforce=require(_0x5ff7('0xd'));var deskjs=require(_0x5ff7('0xe'));var toCsv=require(_0x5ff7('0xa'));var querystring=require(_0x5ff7('0xf'));var Papa=require(_0x5ff7('0x10'));var Redis=require(_0x5ff7('0x11'));var authService=require(_0x5ff7('0x12'));var qs=require(_0x5ff7('0x13'));var as=require(_0x5ff7('0x14'));var hardwareService=require(_0x5ff7('0x15'));var logger=require('../../config/logger')(_0x5ff7('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x561e0d,_0x2caf85){_0x2caf85=_0x2caf85||0xcc;return function(_0x213725){if(_0x213725){return _0x561e0d[_0x5ff7('0x17')](_0x2caf85);}return _0x561e0d[_0x5ff7('0x18')](_0x2caf85)[_0x5ff7('0x19')]();};}function respondWithResult(_0x287576,_0x25051b){_0x25051b=_0x25051b||0xc8;return function(_0x4d83c7){if(_0x4d83c7){return _0x287576[_0x5ff7('0x18')](_0x25051b)[_0x5ff7('0x1a')](_0x4d83c7);}};}function respondWithFilteredResult(_0xfb5a97,_0x2433af){return function(_0x58c347){if(_0x58c347){var _0x35d114=typeof _0x2433af[_0x5ff7('0x1b')]===_0x5ff7('0x1c')&&typeof _0x2433af['limit']==='undefined';var _0x449a8b=_0x58c347[_0x5ff7('0x1d')];var _0x5b7c27=_0x35d114?0x0:_0x2433af[_0x5ff7('0x1b')];var _0x8609be=_0x35d114?_0x58c347[_0x5ff7('0x1d')]:_0x2433af[_0x5ff7('0x1b')]+_0x2433af[_0x5ff7('0x1e')];var _0x26a509;if(_0x8609be>=_0x449a8b){_0x8609be=_0x449a8b;_0x26a509=0xc8;}else{_0x26a509=0xce;}_0xfb5a97[_0x5ff7('0x18')](_0x26a509);return _0xfb5a97[_0x5ff7('0x1f')]('Content-Range',_0x5b7c27+'-'+_0x8609be+'/'+_0x449a8b)[_0x5ff7('0x1a')](_0x58c347);}return null;};}function patchUpdates(_0x59163a){return function(_0x447aca){try{jsonpatch[_0x5ff7('0x20')](_0x447aca,_0x59163a,!![]);}catch(_0x10e8c6){return BPromise[_0x5ff7('0x21')](_0x10e8c6);}return _0x447aca['save']();};}function saveUpdates(_0x513dc6,_0x4418c6){return function(_0x86e946){if(_0x86e946){return _0x86e946[_0x5ff7('0x22')](_0x513dc6)['then'](function(_0xf21123){return _0xf21123;});}return null;};}function removeEntity(_0x18670a,_0x27b423){return function(_0x5947fc){if(_0x5947fc){return _0x5947fc['destroy']()[_0x5ff7('0x23')](function(){var _0x4fc1ca=_0x5947fc[_0x5ff7('0x24')]({'plain':!![]});var _0x1c3297=_0x5ff7('0x25');return db[_0x5ff7('0x26')][_0x5ff7('0x27')]({'where':{'type':_0x1c3297,'resourceId':_0x4fc1ca['id']}})[_0x5ff7('0x23')](function(){return _0x5947fc;});})[_0x5ff7('0x23')](function(){_0x18670a[_0x5ff7('0x18')](0xcc)[_0x5ff7('0x19')]();});}};}function handleEntityNotFound(_0x3065b3,_0x52cce6){return function(_0xb572d8){if(!_0xb572d8){_0x3065b3[_0x5ff7('0x17')](0x194);}return _0xb572d8;};}function handleError(_0x933a05,_0x2739f6){_0x2739f6=_0x2739f6||0x1f4;return function(_0x1f1b12){logger[_0x5ff7('0x28')](_0x1f1b12[_0x5ff7('0x29')]);if(_0x1f1b12['name']){delete _0x1f1b12[_0x5ff7('0x2a')];}_0x933a05['status'](_0x2739f6)[_0x5ff7('0x2b')](_0x1f1b12);};}exports[_0x5ff7('0x2c')]=function(_0x7e5945,_0x4598d8){var _0x35aa9a={},_0x164bdb={},_0x265de0={'count':0x0,'rows':[]};var _0x59c129=_[_0x5ff7('0x2d')](db[_0x5ff7('0x2e')]['rawAttributes'],function(_0x50641f){return{'name':_0x50641f['fieldName'],'type':_0x50641f[_0x5ff7('0x2f')]['key']};});_0x164bdb[_0x5ff7('0x30')]=_[_0x5ff7('0x2d')](_0x59c129,'name');_0x164bdb[_0x5ff7('0x31')]=_[_0x5ff7('0x32')](_0x7e5945['query']);_0x164bdb['filters']=_[_0x5ff7('0x33')](_0x164bdb['model'],_0x164bdb['query']);_0x35aa9a[_0x5ff7('0x34')]=_[_0x5ff7('0x33')](_0x164bdb[_0x5ff7('0x30')],qs[_0x5ff7('0x35')](_0x7e5945[_0x5ff7('0x31')][_0x5ff7('0x35')]));_0x35aa9a[_0x5ff7('0x34')]=_0x35aa9a['attributes'][_0x5ff7('0x36')]?_0x35aa9a[_0x5ff7('0x34')]:_0x164bdb[_0x5ff7('0x30')];if(!_0x7e5945[_0x5ff7('0x31')][_0x5ff7('0x37')](_0x5ff7('0x38'))){_0x35aa9a[_0x5ff7('0x1e')]=qs[_0x5ff7('0x1e')](_0x7e5945[_0x5ff7('0x31')][_0x5ff7('0x1e')]);_0x35aa9a[_0x5ff7('0x1b')]=qs[_0x5ff7('0x1b')](_0x7e5945[_0x5ff7('0x31')][_0x5ff7('0x1b')]);}_0x35aa9a[_0x5ff7('0x39')]=qs[_0x5ff7('0x3a')](_0x7e5945[_0x5ff7('0x31')]['sort']);_0x35aa9a[_0x5ff7('0x3b')]=qs['filters'](_[_0x5ff7('0x3c')](_0x7e5945[_0x5ff7('0x31')],_0x164bdb['filters']),_0x59c129);if(_0x7e5945['query'][_0x5ff7('0x3d')]){_0x35aa9a[_0x5ff7('0x3b')]=_[_0x5ff7('0x3e')](_0x35aa9a['where'],{'$or':_[_0x5ff7('0x2d')](_0x59c129,function(_0x3a69c7){if(_0x3a69c7[_0x5ff7('0x2f')]!==_0x5ff7('0x3f')){var _0x38a61d={};_0x38a61d[_0x3a69c7[_0x5ff7('0x2a')]]={'$like':'%'+_0x7e5945['query'][_0x5ff7('0x3d')]+'%'};return _0x38a61d;}})});}_0x35aa9a=_[_0x5ff7('0x3e')]({},_0x35aa9a,_0x7e5945['options']);var _0x14c67d={'where':_0x35aa9a[_0x5ff7('0x3b')]};return db[_0x5ff7('0x2e')][_0x5ff7('0x1d')](_0x14c67d)['then'](function(_0x491177){_0x265de0[_0x5ff7('0x1d')]=_0x491177;if(_0x7e5945[_0x5ff7('0x31')][_0x5ff7('0x40')]){_0x35aa9a[_0x5ff7('0x41')]=[{'all':!![]}];}return db['Template']['findAll'](_0x35aa9a);})['then'](function(_0x76ec32){_0x265de0['rows']=_0x76ec32;return _0x265de0;})[_0x5ff7('0x23')](respondWithFilteredResult(_0x4598d8,_0x35aa9a))[_0x5ff7('0x42')](handleError(_0x4598d8,null));};exports[_0x5ff7('0x43')]=function(_0x4ebfc9,_0x116836){var _0x347bef={'raw':!![],'where':{'id':_0x4ebfc9[_0x5ff7('0x44')]['id']}},_0x45494b={};_0x45494b['model']=_[_0x5ff7('0x32')](db[_0x5ff7('0x2e')][_0x5ff7('0x45')]);_0x45494b[_0x5ff7('0x31')]=_[_0x5ff7('0x32')](_0x4ebfc9[_0x5ff7('0x31')]);_0x45494b[_0x5ff7('0x46')]=_[_0x5ff7('0x33')](_0x45494b[_0x5ff7('0x30')],_0x45494b[_0x5ff7('0x31')]);_0x347bef['attributes']=_[_0x5ff7('0x33')](_0x45494b[_0x5ff7('0x30')],qs[_0x5ff7('0x35')](_0x4ebfc9[_0x5ff7('0x31')][_0x5ff7('0x35')]));_0x347bef['attributes']=_0x347bef['attributes'][_0x5ff7('0x36')]?_0x347bef[_0x5ff7('0x34')]:_0x45494b['model'];if(_0x4ebfc9[_0x5ff7('0x31')][_0x5ff7('0x40')]){_0x347bef[_0x5ff7('0x41')]=[{'all':!![]}];}_0x347bef=_[_0x5ff7('0x3e')]({},_0x347bef,_0x4ebfc9[_0x5ff7('0x47')]);return db[_0x5ff7('0x2e')]['find'](_0x347bef)[_0x5ff7('0x23')](handleEntityNotFound(_0x116836,null))[_0x5ff7('0x23')](respondWithResult(_0x116836,null))['catch'](handleError(_0x116836,null));};exports[_0x5ff7('0x48')]=function(_0x5c9425,_0x1a9e01){return db[_0x5ff7('0x2e')][_0x5ff7('0x48')](_0x5c9425[_0x5ff7('0x49')],{})[_0x5ff7('0x23')](function(_0xc05ea5){var _0x2acc97=_0x5c9425[_0x5ff7('0x4a')]['get']({'plain':!![]});if(!_0x2acc97)throw new Error(_0x5ff7('0x4b'));if(_0x2acc97[_0x5ff7('0x4c')]===_0x5ff7('0x4a')){var _0x39e23e=_0xc05ea5['get']({'plain':!![]});var _0x4edec1=_0x5ff7('0x25');return db[_0x5ff7('0x4d')][_0x5ff7('0x4e')]({'where':{'name':_0x4edec1,'userProfileId':_0x2acc97[_0x5ff7('0x4f')]},'raw':!![]})[_0x5ff7('0x23')](function(_0xc533a0){if(_0xc533a0&&_0xc533a0[_0x5ff7('0x50')]===0x0){return db[_0x5ff7('0x26')]['create']({'name':_0x39e23e[_0x5ff7('0x2a')],'resourceId':_0x39e23e['id'],'type':_0xc533a0[_0x5ff7('0x2a')],'sectionId':_0xc533a0['id']},{})[_0x5ff7('0x23')](function(){return _0xc05ea5;});}else{return _0xc05ea5;}})['catch'](function(_0x1c0fe4){logger[_0x5ff7('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c0fe4);throw _0x1c0fe4;});}return _0xc05ea5;})[_0x5ff7('0x23')](respondWithResult(_0x1a9e01,0xc9))[_0x5ff7('0x42')](handleError(_0x1a9e01,null));};exports[_0x5ff7('0x22')]=function(_0x4415fc,_0x18c851){if(_0x4415fc[_0x5ff7('0x49')]['id']){delete _0x4415fc[_0x5ff7('0x49')]['id'];}return db[_0x5ff7('0x2e')][_0x5ff7('0x4e')]({'where':{'id':_0x4415fc[_0x5ff7('0x44')]['id']}})[_0x5ff7('0x23')](handleEntityNotFound(_0x18c851,null))[_0x5ff7('0x23')](saveUpdates(_0x4415fc[_0x5ff7('0x49')],null))['then'](respondWithResult(_0x18c851,null))[_0x5ff7('0x42')](handleError(_0x18c851,null));};exports[_0x5ff7('0x27')]=function(_0x339bf6,_0x1e5af4){return db[_0x5ff7('0x2e')][_0x5ff7('0x4e')]({'where':{'id':_0x339bf6[_0x5ff7('0x44')]['id']}})[_0x5ff7('0x23')](handleEntityNotFound(_0x1e5af4,null))[_0x5ff7('0x23')](removeEntity(_0x1e5af4,null))[_0x5ff7('0x42')](handleError(_0x1e5af4,null));}; \ No newline at end of file +var _0x679c=['includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','destroy','get','Templates','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','Template'];(function(_0x3ad9b3,_0x5c76e9){var _0x4ef8d1=function(_0x239036){while(--_0x239036){_0x3ad9b3['push'](_0x3ad9b3['shift']());}};_0x4ef8d1(++_0x5c76e9);}(_0x679c,0x106));var _0xc679=function(_0x255442,_0x4bba27){_0x255442=_0x255442-0x0;var _0x3089a6=_0x679c[_0x255442];return _0x3089a6;};'use strict';var emlformat=require(_0xc679('0x0'));var rimraf=require(_0xc679('0x1'));var zipdir=require(_0xc679('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc679('0x3'));var moment=require('moment');var BPromise=require(_0xc679('0x4'));var Mustache=require(_0xc679('0x5'));var util=require(_0xc679('0x6'));var path=require(_0xc679('0x7'));var sox=require(_0xc679('0x8'));var csv=require(_0xc679('0x9'));var ejs=require(_0xc679('0xa'));var fs=require('fs');var fs_extra=require(_0xc679('0xb'));var _=require('lodash');var squel=require(_0xc679('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc679('0xd'));var Papa=require(_0xc679('0xe'));var Redis=require('ioredis');var authService=require(_0xc679('0xf'));var qs=require(_0xc679('0x10'));var as=require(_0xc679('0x11'));var hardwareService=require(_0xc679('0x12'));var logger=require('../../config/logger')(_0xc679('0x13'));var utils=require(_0xc679('0x14'));var config=require(_0xc679('0x15'));var licenseUtil=require(_0xc679('0x16'));var db=require(_0xc679('0x17'))['db'];function respondWithStatusCode(_0x314da0,_0x213834){_0x213834=_0x213834||0xcc;return function(_0x18b234){if(_0x18b234){return _0x314da0[_0xc679('0x18')](_0x213834);}return _0x314da0[_0xc679('0x19')](_0x213834)[_0xc679('0x1a')]();};}function respondWithResult(_0x507849,_0x2a4d84){_0x2a4d84=_0x2a4d84||0xc8;return function(_0x59549c){if(_0x59549c){return _0x507849[_0xc679('0x19')](_0x2a4d84)[_0xc679('0x1b')](_0x59549c);}};}function respondWithFilteredResult(_0x122a00,_0x517388){return function(_0x588467){if(_0x588467){var _0x925ed5=typeof _0x517388[_0xc679('0x1c')]===_0xc679('0x1d')&&typeof _0x517388[_0xc679('0x1e')]===_0xc679('0x1d');var _0x2103ce=_0x588467[_0xc679('0x1f')];var _0x13f9e0=_0x925ed5?0x0:_0x517388[_0xc679('0x1c')];var _0x294c66=_0x925ed5?_0x588467[_0xc679('0x1f')]:_0x517388['offset']+_0x517388[_0xc679('0x1e')];var _0x51d914;if(_0x294c66>=_0x2103ce){_0x294c66=_0x2103ce;_0x51d914=0xc8;}else{_0x51d914=0xce;}_0x122a00['status'](_0x51d914);return _0x122a00[_0xc679('0x20')]('Content-Range',_0x13f9e0+'-'+_0x294c66+'/'+_0x2103ce)[_0xc679('0x1b')](_0x588467);}return null;};}function patchUpdates(_0x1ff2ec){return function(_0x41eef6){try{jsonpatch[_0xc679('0x21')](_0x41eef6,_0x1ff2ec,!![]);}catch(_0x51951f){return BPromise['reject'](_0x51951f);}return _0x41eef6['save']();};}function saveUpdates(_0x36403b,_0x3536ee){return function(_0x55bb35){if(_0x55bb35){return _0x55bb35[_0xc679('0x22')](_0x36403b)[_0xc679('0x23')](function(_0x38bcc2){return _0x38bcc2;});}return null;};}function removeEntity(_0x4e32bd,_0x10f551){return function(_0x506378){if(_0x506378){return _0x506378[_0xc679('0x24')]()['then'](function(){var _0x4a546d=_0x506378[_0xc679('0x25')]({'plain':!![]});var _0x20204b=_0xc679('0x26');return db['UserProfileResource'][_0xc679('0x24')]({'where':{'type':_0x20204b,'resourceId':_0x4a546d['id']}})[_0xc679('0x23')](function(){return _0x506378;});})[_0xc679('0x23')](function(){_0x4e32bd[_0xc679('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fee5c,_0x1f5466){return function(_0x3e703a){if(!_0x3e703a){_0x3fee5c[_0xc679('0x18')](0x194);}return _0x3e703a;};}function handleError(_0x4d34bf,_0x2d4b71){_0x2d4b71=_0x2d4b71||0x1f4;return function(_0x37818f){logger[_0xc679('0x27')](_0x37818f[_0xc679('0x28')]);if(_0x37818f['name']){delete _0x37818f[_0xc679('0x29')];}_0x4d34bf[_0xc679('0x19')](_0x2d4b71)[_0xc679('0x2a')](_0x37818f);};}exports[_0xc679('0x2b')]=function(_0x38a337,_0x1d5aba){var _0x30c647={},_0x1d89fa={},_0x2ee92d={'count':0x0,'rows':[]};var _0x3c1a53=_[_0xc679('0x2c')](db['Template'][_0xc679('0x2d')],function(_0x27fb9e){return{'name':_0x27fb9e[_0xc679('0x2e')],'type':_0x27fb9e['type'][_0xc679('0x2f')]};});_0x1d89fa['model']=_[_0xc679('0x2c')](_0x3c1a53,_0xc679('0x29'));_0x1d89fa[_0xc679('0x30')]=_[_0xc679('0x31')](_0x38a337[_0xc679('0x30')]);_0x1d89fa['filters']=_[_0xc679('0x32')](_0x1d89fa[_0xc679('0x33')],_0x1d89fa[_0xc679('0x30')]);_0x30c647['attributes']=_[_0xc679('0x32')](_0x1d89fa[_0xc679('0x33')],qs[_0xc679('0x34')](_0x38a337[_0xc679('0x30')][_0xc679('0x34')]));_0x30c647[_0xc679('0x35')]=_0x30c647[_0xc679('0x35')][_0xc679('0x36')]?_0x30c647[_0xc679('0x35')]:_0x1d89fa['model'];if(!_0x38a337['query'][_0xc679('0x37')](_0xc679('0x38'))){_0x30c647[_0xc679('0x1e')]=qs[_0xc679('0x1e')](_0x38a337['query'][_0xc679('0x1e')]);_0x30c647['offset']=qs['offset'](_0x38a337[_0xc679('0x30')][_0xc679('0x1c')]);}_0x30c647[_0xc679('0x39')]=qs[_0xc679('0x3a')](_0x38a337[_0xc679('0x30')]['sort']);_0x30c647[_0xc679('0x3b')]=qs[_0xc679('0x3c')](_['pick'](_0x38a337[_0xc679('0x30')],_0x1d89fa[_0xc679('0x3c')]),_0x3c1a53);if(_0x38a337['query'][_0xc679('0x3d')]){_0x30c647['where']=_[_0xc679('0x3e')](_0x30c647[_0xc679('0x3b')],{'$or':_[_0xc679('0x2c')](_0x3c1a53,function(_0x16964b){if(_0x16964b['type']!==_0xc679('0x3f')){var _0x46669c={};_0x46669c[_0x16964b[_0xc679('0x29')]]={'$like':'%'+_0x38a337[_0xc679('0x30')][_0xc679('0x3d')]+'%'};return _0x46669c;}})});}_0x30c647=_['merge']({},_0x30c647,_0x38a337[_0xc679('0x40')]);var _0xad2828={'where':_0x30c647['where']};return db[_0xc679('0x41')][_0xc679('0x1f')](_0xad2828)[_0xc679('0x23')](function(_0x167ddb){_0x2ee92d[_0xc679('0x1f')]=_0x167ddb;if(_0x38a337[_0xc679('0x30')][_0xc679('0x42')]){_0x30c647[_0xc679('0x43')]=[{'all':!![]}];}return db['Template'][_0xc679('0x44')](_0x30c647);})[_0xc679('0x23')](function(_0x3910c3){_0x2ee92d[_0xc679('0x45')]=_0x3910c3;return _0x2ee92d;})[_0xc679('0x23')](respondWithFilteredResult(_0x1d5aba,_0x30c647))[_0xc679('0x46')](handleError(_0x1d5aba,null));};exports[_0xc679('0x47')]=function(_0x3dddc6,_0x1153cf){var _0x522a9d={'raw':!![],'where':{'id':_0x3dddc6[_0xc679('0x48')]['id']}},_0xa613d6={};_0xa613d6[_0xc679('0x33')]=_[_0xc679('0x31')](db[_0xc679('0x41')][_0xc679('0x2d')]);_0xa613d6[_0xc679('0x30')]=_[_0xc679('0x31')](_0x3dddc6['query']);_0xa613d6[_0xc679('0x3c')]=_[_0xc679('0x32')](_0xa613d6[_0xc679('0x33')],_0xa613d6[_0xc679('0x30')]);_0x522a9d[_0xc679('0x35')]=_[_0xc679('0x32')](_0xa613d6[_0xc679('0x33')],qs[_0xc679('0x34')](_0x3dddc6[_0xc679('0x30')][_0xc679('0x34')]));_0x522a9d[_0xc679('0x35')]=_0x522a9d[_0xc679('0x35')][_0xc679('0x36')]?_0x522a9d['attributes']:_0xa613d6[_0xc679('0x33')];if(_0x3dddc6[_0xc679('0x30')][_0xc679('0x42')]){_0x522a9d[_0xc679('0x43')]=[{'all':!![]}];}_0x522a9d=_[_0xc679('0x3e')]({},_0x522a9d,_0x3dddc6[_0xc679('0x40')]);return db[_0xc679('0x41')]['find'](_0x522a9d)[_0xc679('0x23')](handleEntityNotFound(_0x1153cf,null))[_0xc679('0x23')](respondWithResult(_0x1153cf,null))['catch'](handleError(_0x1153cf,null));};exports[_0xc679('0x49')]=function(_0x16ad56,_0x2478f6){return db[_0xc679('0x41')]['create'](_0x16ad56[_0xc679('0x4a')],{})[_0xc679('0x23')](function(_0x3c2201){var _0x2f4f72=_0x16ad56[_0xc679('0x4b')]['get']({'plain':!![]});if(!_0x2f4f72)throw new Error(_0xc679('0x4c'));if(_0x2f4f72[_0xc679('0x4d')]==='user'){var _0x222287=_0x3c2201['get']({'plain':!![]});var _0x4d98f9=_0xc679('0x26');return db['UserProfileSection'][_0xc679('0x4e')]({'where':{'name':_0x4d98f9,'userProfileId':_0x2f4f72[_0xc679('0x4f')]},'raw':!![]})[_0xc679('0x23')](function(_0x4bc7af){if(_0x4bc7af&&_0x4bc7af[_0xc679('0x50')]===0x0){return db['UserProfileResource'][_0xc679('0x49')]({'name':_0x222287['name'],'resourceId':_0x222287['id'],'type':_0x4bc7af[_0xc679('0x29')],'sectionId':_0x4bc7af['id']},{})['then'](function(){return _0x3c2201;});}else{return _0x3c2201;}})[_0xc679('0x46')](function(_0x424dff){logger[_0xc679('0x27')](_0xc679('0x51'),_0x424dff);throw _0x424dff;});}return _0x3c2201;})[_0xc679('0x23')](respondWithResult(_0x2478f6,0xc9))[_0xc679('0x46')](handleError(_0x2478f6,null));};exports[_0xc679('0x22')]=function(_0x668cd7,_0x315645){if(_0x668cd7['body']['id']){delete _0x668cd7[_0xc679('0x4a')]['id'];}return db['Template'][_0xc679('0x4e')]({'where':{'id':_0x668cd7[_0xc679('0x48')]['id']}})[_0xc679('0x23')](handleEntityNotFound(_0x315645,null))[_0xc679('0x23')](saveUpdates(_0x668cd7['body'],null))[_0xc679('0x23')](respondWithResult(_0x315645,null))[_0xc679('0x46')](handleError(_0x315645,null));};exports[_0xc679('0x24')]=function(_0x5121cc,_0x30e68c){return db[_0xc679('0x41')][_0xc679('0x4e')]({'where':{'id':_0x5121cc[_0xc679('0x48')]['id']}})['then'](handleEntityNotFound(_0x30e68c,null))[_0xc679('0x23')](removeEntity(_0x30e68c,null))[_0xc679('0x46')](handleError(_0x30e68c,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 85b466f..147809d 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 _0x5e07=['request-promise','path','rimraf','../../config/environment','./template.attributes','tools_templates','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x333755,_0x47aadf){var _0x1335ce=function(_0x370044){while(--_0x370044){_0x333755['push'](_0x333755['shift']());}};_0x1335ce(++_0x47aadf);}(_0x5e07,0x10e));var _0x75e0=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5e07[_0x122096];return _0x3d1966;};'use strict';var _=require(_0x75e0('0x0'));var util=require(_0x75e0('0x1'));var logger=require(_0x75e0('0x2'))(_0x75e0('0x3'));var moment=require(_0x75e0('0x4'));var BPromise=require(_0x75e0('0x5'));var rp=require(_0x75e0('0x6'));var fs=require('fs');var path=require(_0x75e0('0x7'));var rimraf=require(_0x75e0('0x8'));var config=require(_0x75e0('0x9'));var attributes=require(_0x75e0('0xa'));module['exports']=function(_0x2802af,_0x3e138b){return _0x2802af['define']('Template',attributes,{'tableName':_0x75e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x658e=['request-promise','path','rimraf','./template.attributes','define','Template','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3c0444,_0x5dad2d){var _0x456e6f=function(_0x496b30){while(--_0x496b30){_0x3c0444['push'](_0x3c0444['shift']());}};_0x456e6f(++_0x5dad2d);}(_0x658e,0xae));var _0xe658=function(_0x33d9a2,_0x5bf33c){_0x33d9a2=_0x33d9a2-0x0;var _0x4ac4ea=_0x658e[_0x33d9a2];return _0x4ac4ea;};'use strict';var _=require(_0xe658('0x0'));var util=require(_0xe658('0x1'));var logger=require(_0xe658('0x2'))(_0xe658('0x3'));var moment=require(_0xe658('0x4'));var BPromise=require(_0xe658('0x5'));var rp=require(_0xe658('0x6'));var fs=require('fs');var path=require(_0xe658('0x7'));var rimraf=require(_0xe658('0x8'));var config=require('../../config/environment');var attributes=require(_0xe658('0x9'));module['exports']=function(_0x369646,_0x29bab7){return _0x369646[_0xe658('0xa')](_0xe658('0xb'),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 f30233f..002ce5f 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 _0x347f=['rpc','jayson/promise','http','request','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','code','Template,\x20%s,\x20%s','error','message','result','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','then','util','moment','bluebird','randomstring'];(function(_0x24f5df,_0x500c82){var _0x1a8396=function(_0x2c63db){while(--_0x2c63db){_0x24f5df['push'](_0x24f5df['shift']());}};_0x1a8396(++_0x500c82);}(_0x347f,0x1cc));var _0xf347=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x347f[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0xf347('0x0'));var moment=require(_0xf347('0x1'));var BPromise=require(_0xf347('0x2'));var rs=require(_0xf347('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf347('0x4'));var config=require('../../config/environment');var jayson=require(_0xf347('0x5'));var client=jayson['client'][_0xf347('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xfbe434,_0x509547,_0x22709c){return new BPromise(function(_0xc358cc,_0x1c31d6){return client[_0xf347('0x7')](_0xfbe434,_0x22709c)['then'](function(_0xac7693){logger['info']('Template,\x20%s,\x20%s',_0x509547,_0xf347('0x8'));logger[_0xf347('0x9')](_0xf347('0xa'),_0x509547,_0xf347('0x8'),JSON[_0xf347('0xb')](_0xac7693));if(_0xac7693['error']){if(_0xac7693['error'][_0xf347('0xc')]===0x1f4){logger['error'](_0xf347('0xd'),_0x509547,_0xac7693[_0xf347('0xe')][_0xf347('0xf')]);return _0x1c31d6(_0xac7693[_0xf347('0xe')][_0xf347('0xf')]);}logger[_0xf347('0xe')]('Template,\x20%s,\x20%s',_0x509547,_0xac7693[_0xf347('0xe')][_0xf347('0xf')]);return _0xc358cc(_0xac7693[_0xf347('0xe')]['message']);}else{logger['info'](_0xf347('0xd'),_0x509547,_0xf347('0x8'));_0xc358cc(_0xac7693[_0xf347('0x10')][_0xf347('0xf')]);}})['catch'](function(_0x5d71d2){logger[_0xf347('0xe')](_0xf347('0xd'),_0x509547,_0x5d71d2);_0x1c31d6(_0x5d71d2);});});}exports[_0xf347('0x11')]=function(_0x5a03be){var _0x442834=this;return new Promise(function(_0x3428b8,_0x347efe){return db[_0xf347('0x12')][_0xf347('0x13')]({'raw':_0x5a03be[_0xf347('0x14')]?_0x5a03be[_0xf347('0x14')][_0xf347('0x15')]===undefined?!![]:![]:!![],'where':_0x5a03be['options']?_0x5a03be[_0xf347('0x14')][_0xf347('0x16')]||null:null,'attributes':_0x5a03be[_0xf347('0x14')]?_0x5a03be[_0xf347('0x14')][_0xf347('0x17')]||null:null,'limit':_0x5a03be[_0xf347('0x14')]?_0x5a03be[_0xf347('0x14')][_0xf347('0x18')]||null:null,'include':_0x5a03be['options']?_0x5a03be[_0xf347('0x14')][_0xf347('0x19')]?_[_0xf347('0x1a')](_0x5a03be[_0xf347('0x14')]['include'],function(_0x3e0e53){return{'model':db[_0x3e0e53[_0xf347('0x1b')]],'as':_0x3e0e53['as'],'attributes':_0x3e0e53[_0xf347('0x17')],'include':_0x3e0e53[_0xf347('0x19')]?_[_0xf347('0x1a')](_0x3e0e53[_0xf347('0x19')],function(_0x57ba64){return{'model':db[_0x57ba64['model']],'as':_0x57ba64['as'],'attributes':_0x57ba64[_0xf347('0x17')],'include':_0x57ba64[_0xf347('0x19')]?_[_0xf347('0x1a')](_0x57ba64[_0xf347('0x19')],function(_0x230796){return{'model':db[_0x230796[_0xf347('0x1b')]],'as':_0x230796['as'],'attributes':_0x230796[_0xf347('0x17')]};}):[]};}):[]};}):[]:[]})[_0xf347('0x1c')](function(_0x54e492){logger['info'](_0xf347('0x11'),_0x5a03be);logger[_0xf347('0x9')](_0xf347('0x11'),_0x5a03be,JSON[_0xf347('0xb')](_0x54e492));_0x3428b8(_0x54e492);})['catch'](function(_0x2c505a){logger['error'](_0xf347('0x11'),_0x2c505a[_0xf347('0xf')],_0x5a03be);_0x347efe(_0x442834[_0xf347('0xe')](0x1f4,_0x2c505a[_0xf347('0xf')]));});});}; \ No newline at end of file +var _0xb870=['options','raw','where','limit','include','map','model','attributes','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','Template,\x20%s,\x20%s','catch','GetTemplate','Template'];(function(_0x4dde61,_0x20e46b){var _0x23bf85=function(_0x227a2c){while(--_0x227a2c){_0x4dde61['push'](_0x4dde61['shift']());}};_0x23bf85(++_0x20e46b);}(_0xb870,0x13c));var _0x0b87=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0xb870[_0x29db36];return _0x234e87;};'use strict';var _=require(_0x0b87('0x0'));var util=require('util');var moment=require(_0x0b87('0x1'));var BPromise=require(_0x0b87('0x2'));var rs=require(_0x0b87('0x3'));var fs=require('fs');var Redis=require(_0x0b87('0x4'));var db=require(_0x0b87('0x5'))['db'];var utils=require(_0x0b87('0x6'));var logger=require(_0x0b87('0x7'))(_0x0b87('0x8'));var config=require(_0x0b87('0x9'));var jayson=require(_0x0b87('0xa'));var client=jayson[_0x0b87('0xb')][_0x0b87('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cbe7b,_0xabe5ba,_0x12482f){return new BPromise(function(_0x4caf43,_0x3790f2){return client['request'](_0x3cbe7b,_0x12482f)[_0x0b87('0xd')](function(_0x5e42b2){logger[_0x0b87('0xe')]('Template,\x20%s,\x20%s',_0xabe5ba,'request\x20sent');logger['debug'](_0x0b87('0xf'),_0xabe5ba,_0x0b87('0x10'),JSON['stringify'](_0x5e42b2));if(_0x5e42b2[_0x0b87('0x11')]){if(_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x12')]===0x1f4){logger[_0x0b87('0x11')]('Template,\x20%s,\x20%s',_0xabe5ba,_0x5e42b2['error'][_0x0b87('0x13')]);return _0x3790f2(_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x13')]);}logger[_0x0b87('0x11')]('Template,\x20%s,\x20%s',_0xabe5ba,_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x13')]);return _0x4caf43(_0x5e42b2[_0x0b87('0x11')][_0x0b87('0x13')]);}else{logger[_0x0b87('0xe')](_0x0b87('0x14'),_0xabe5ba,'request\x20sent');_0x4caf43(_0x5e42b2['result']['message']);}})[_0x0b87('0x15')](function(_0x4abf21){logger[_0x0b87('0x11')](_0x0b87('0x14'),_0xabe5ba,_0x4abf21);_0x3790f2(_0x4abf21);});});}exports[_0x0b87('0x16')]=function(_0x4542f4){var _0x32d27a=this;return new Promise(function(_0x2e602,_0x771911){return db[_0x0b87('0x17')]['findAll']({'raw':_0x4542f4[_0x0b87('0x18')]?_0x4542f4['options'][_0x0b87('0x19')]===undefined?!![]:![]:!![],'where':_0x4542f4[_0x0b87('0x18')]?_0x4542f4[_0x0b87('0x18')][_0x0b87('0x1a')]||null:null,'attributes':_0x4542f4[_0x0b87('0x18')]?_0x4542f4['options']['attributes']||null:null,'limit':_0x4542f4[_0x0b87('0x18')]?_0x4542f4['options'][_0x0b87('0x1b')]||null:null,'include':_0x4542f4[_0x0b87('0x18')]?_0x4542f4[_0x0b87('0x18')][_0x0b87('0x1c')]?_[_0x0b87('0x1d')](_0x4542f4[_0x0b87('0x18')]['include'],function(_0x218a2d){return{'model':db[_0x218a2d[_0x0b87('0x1e')]],'as':_0x218a2d['as'],'attributes':_0x218a2d[_0x0b87('0x1f')],'include':_0x218a2d[_0x0b87('0x1c')]?_[_0x0b87('0x1d')](_0x218a2d[_0x0b87('0x1c')],function(_0x28f1e3){return{'model':db[_0x28f1e3[_0x0b87('0x1e')]],'as':_0x28f1e3['as'],'attributes':_0x28f1e3[_0x0b87('0x1f')],'include':_0x28f1e3['include']?_[_0x0b87('0x1d')](_0x28f1e3[_0x0b87('0x1c')],function(_0x13c26e){return{'model':db[_0x13c26e[_0x0b87('0x1e')]],'as':_0x13c26e['as'],'attributes':_0x13c26e[_0x0b87('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x853a01){logger[_0x0b87('0xe')](_0x0b87('0x16'),_0x4542f4);logger[_0x0b87('0x20')](_0x0b87('0x16'),_0x4542f4,JSON[_0x0b87('0x21')](_0x853a01));_0x2e602(_0x853a01);})[_0x0b87('0x15')](function(_0x55477a){logger['error'](_0x0b87('0x16'),_0x55477a[_0x0b87('0x13')],_0x4542f4);_0x771911(_0x32d27a[_0x0b87('0x11')](0x1f4,_0x55477a[_0x0b87('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7d83707..0934da1 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 _0xb2a9=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','post','create','addAnyCondition','/:id/actions','addAction','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb2a9,0x84));var _0x9b2a=function(_0xc798b7,_0x4e6b12){_0xc798b7=_0xc798b7-0x0;var _0x165a5b=_0xb2a9[_0xc798b7];return _0x165a5b;};'use strict';var multer=require(_0x9b2a('0x0'));var util=require(_0x9b2a('0x1'));var path=require(_0x9b2a('0x2'));var timeout=require(_0x9b2a('0x3'));var express=require(_0x9b2a('0x4'));var router=express[_0x9b2a('0x5')]();var fs_extra=require(_0x9b2a('0x6'));var auth=require(_0x9b2a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9b2a('0x8'));var controller=require('./trigger.controller');router[_0x9b2a('0x9')]('/',auth[_0x9b2a('0xa')](),controller[_0x9b2a('0xb')]);router[_0x9b2a('0x9')](_0x9b2a('0xc'),auth[_0x9b2a('0xa')](),controller[_0x9b2a('0xd')]);router['get'](_0x9b2a('0xe'),auth['isAuthenticated'](),controller[_0x9b2a('0xf')]);router['get'](_0x9b2a('0x10'),auth[_0x9b2a('0xa')](),controller[_0x9b2a('0x11')]);router['get']('/:id/actions',auth[_0x9b2a('0xa')](),controller['getActions']);router[_0x9b2a('0x12')]('/',auth[_0x9b2a('0xa')](),controller[_0x9b2a('0x13')]);router[_0x9b2a('0x12')](_0x9b2a('0xe'),auth[_0x9b2a('0xa')](),controller['addAllCondition']);router[_0x9b2a('0x12')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x9b2a('0x14')]);router[_0x9b2a('0x12')](_0x9b2a('0x15'),auth['isAuthenticated'](),controller[_0x9b2a('0x16')]);router[_0x9b2a('0x17')](_0x9b2a('0xc'),auth[_0x9b2a('0xa')](),controller[_0x9b2a('0x18')]);router[_0x9b2a('0x19')]('/:id',auth[_0x9b2a('0xa')](),controller[_0x9b2a('0x1a')]);module[_0x9b2a('0x1b')]=router; \ No newline at end of file +var _0x011a=['addAction','put','update','delete','exports','multer','util','express','fs-extra','../../components/interaction/service','./trigger.controller','get','isAuthenticated','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAnyCondition'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x011a,0x16d));var _0xa011=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0x011a[_0xa76664];return _0x3f7743;};'use strict';var multer=require(_0xa011('0x0'));var util=require(_0xa011('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa011('0x2'));var router=express['Router']();var fs_extra=require(_0xa011('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa011('0x4'));var config=require('../../config/environment');var controller=require(_0xa011('0x5'));router[_0xa011('0x6')]('/',auth[_0xa011('0x7')](),controller['index']);router['get'](_0xa011('0x8'),auth[_0xa011('0x7')](),controller[_0xa011('0x9')]);router[_0xa011('0x6')](_0xa011('0xa'),auth[_0xa011('0x7')](),controller[_0xa011('0xb')]);router[_0xa011('0x6')](_0xa011('0xc'),auth['isAuthenticated'](),controller[_0xa011('0xd')]);router['get'](_0xa011('0xe'),auth[_0xa011('0x7')](),controller[_0xa011('0xf')]);router[_0xa011('0x10')]('/',auth['isAuthenticated'](),controller[_0xa011('0x11')]);router[_0xa011('0x10')]('/:id/all_conditions',auth[_0xa011('0x7')](),controller['addAllCondition']);router[_0xa011('0x10')](_0xa011('0xc'),auth[_0xa011('0x7')](),controller[_0xa011('0x12')]);router[_0xa011('0x10')]('/:id/actions',auth[_0xa011('0x7')](),controller[_0xa011('0x13')]);router[_0xa011('0x14')]('/:id',auth[_0xa011('0x7')](),controller[_0xa011('0x15')]);router[_0xa011('0x16')](_0xa011('0x8'),auth[_0xa011('0x7')](),controller['destroy']);module[_0xa011('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 055ef10..081c603 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 _0x9de8=['BOOLEAN','sequelize','STRING'];(function(_0x25b17f,_0xd8880d){var _0x994541=function(_0x21fdff){while(--_0x21fdff){_0x25b17f['push'](_0x25b17f['shift']());}};_0x994541(++_0xd8880d);}(_0x9de8,0x88));var _0x89de=function(_0x154c1b,_0x616889){_0x154c1b=_0x154c1b-0x0;var _0x2cbe44=_0x9de8[_0x154c1b];return _0x2cbe44;};'use strict';var Sequelize=require(_0x89de('0x0'));module['exports']={'name':{'type':Sequelize[_0x89de('0x1')]},'channel':{'type':Sequelize[_0x89de('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x89de('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x9005=['BOOLEAN','sequelize','STRING'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x9005,0x1c9));var _0x5900=function(_0x4ea597,_0x2eee6c){_0x4ea597=_0x4ea597-0x0;var _0x96df74=_0x9005[_0x4ea597];return _0x96df74;};'use strict';var Sequelize=require(_0x5900('0x0'));module['exports']={'name':{'type':Sequelize[_0x5900('0x1')]},'channel':{'type':Sequelize[_0x5900('0x1')]},'description':{'type':Sequelize[_0x5900('0x1')]},'status':{'type':Sequelize[_0x5900('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 1e44cf5..845312e 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 _0xa392=['Content-Range','apply','reject','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','nolimit','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','sendStatus','status','end','json','undefined','limit','offset','set'];(function(_0x4e78db,_0x479d7c){var _0x3f9a03=function(_0x458747){while(--_0x458747){_0x4e78db['push'](_0x4e78db['shift']());}};_0x3f9a03(++_0x479d7c);}(_0xa392,0x150));var _0x2a39=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xa392[_0x17b6e3];return _0x3906f3;};'use strict';var emlformat=require(_0x2a39('0x0'));var rimraf=require(_0x2a39('0x1'));var zipdir=require(_0x2a39('0x2'));var jsonpatch=require(_0x2a39('0x3'));var rp=require(_0x2a39('0x4'));var moment=require('moment');var BPromise=require(_0x2a39('0x5'));var Mustache=require(_0x2a39('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2a39('0x7'));var csv=require(_0x2a39('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a39('0x9'));var _=require(_0x2a39('0xa'));var squel=require(_0x2a39('0xb'));var crypto=require(_0x2a39('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2a39('0x8'));var querystring=require(_0x2a39('0xd'));var Papa=require(_0x2a39('0xe'));var Redis=require(_0x2a39('0xf'));var authService=require(_0x2a39('0x10'));var qs=require(_0x2a39('0x11'));var as=require(_0x2a39('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2a39('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x210bce,_0x5ce977){_0x5ce977=_0x5ce977||0xcc;return function(_0x3f9db3){if(_0x3f9db3){return _0x210bce[_0x2a39('0x14')](_0x5ce977);}return _0x210bce[_0x2a39('0x15')](_0x5ce977)[_0x2a39('0x16')]();};}function respondWithResult(_0x718b28,_0x311e09){_0x311e09=_0x311e09||0xc8;return function(_0x2e5b20){if(_0x2e5b20){return _0x718b28[_0x2a39('0x15')](_0x311e09)[_0x2a39('0x17')](_0x2e5b20);}};}function respondWithFilteredResult(_0x3f75d8,_0x102115){return function(_0x285efd){if(_0x285efd){var _0x243d32=typeof _0x102115['offset']===_0x2a39('0x18')&&typeof _0x102115[_0x2a39('0x19')]==='undefined';var _0xfe19b=_0x285efd['count'];var _0x4329f9=_0x243d32?0x0:_0x102115[_0x2a39('0x1a')];var _0x3a6a46=_0x243d32?_0x285efd['count']:_0x102115[_0x2a39('0x1a')]+_0x102115[_0x2a39('0x19')];var _0x1ae645;if(_0x3a6a46>=_0xfe19b){_0x3a6a46=_0xfe19b;_0x1ae645=0xc8;}else{_0x1ae645=0xce;}_0x3f75d8[_0x2a39('0x15')](_0x1ae645);return _0x3f75d8[_0x2a39('0x1b')](_0x2a39('0x1c'),_0x4329f9+'-'+_0x3a6a46+'/'+_0xfe19b)[_0x2a39('0x17')](_0x285efd);}return null;};}function patchUpdates(_0x24d81f){return function(_0x19d8a1){try{jsonpatch[_0x2a39('0x1d')](_0x19d8a1,_0x24d81f,!![]);}catch(_0x24a112){return BPromise[_0x2a39('0x1e')](_0x24a112);}return _0x19d8a1['save']();};}function saveUpdates(_0xb7d90e,_0x4f812e){return function(_0x10e4d4){if(_0x10e4d4){return _0x10e4d4[_0x2a39('0x1f')](_0xb7d90e)[_0x2a39('0x20')](function(_0x3355fd){return _0x3355fd;});}return null;};}function removeEntity(_0x19ebf2,_0x43e0da){return function(_0x3246e1){if(_0x3246e1){return _0x3246e1[_0x2a39('0x21')]()[_0x2a39('0x20')](function(){var _0x10434c=_0x3246e1[_0x2a39('0x22')]({'plain':!![]});var _0x25467b=_0x2a39('0x23');return db[_0x2a39('0x24')]['destroy']({'where':{'type':_0x25467b,'resourceId':_0x10434c['id']}})[_0x2a39('0x20')](function(){return _0x3246e1;});})[_0x2a39('0x20')](function(){_0x19ebf2[_0x2a39('0x15')](0xcc)[_0x2a39('0x16')]();});}};}function handleEntityNotFound(_0x36c97c,_0x2b7994){return function(_0x125852){if(!_0x125852){_0x36c97c[_0x2a39('0x14')](0x194);}return _0x125852;};}function handleError(_0x2876a9,_0x18ce9d){_0x18ce9d=_0x18ce9d||0x1f4;return function(_0x1b31a7){logger[_0x2a39('0x25')](_0x1b31a7[_0x2a39('0x26')]);if(_0x1b31a7[_0x2a39('0x27')]){delete _0x1b31a7[_0x2a39('0x27')];}_0x2876a9['status'](_0x18ce9d)[_0x2a39('0x28')](_0x1b31a7);};}exports[_0x2a39('0x29')]=function(_0x3e77ad,_0x21255b){var _0x2873da={},_0xb28da1={},_0x2f3695={'count':0x0,'rows':[]};var _0x4d2d19=_[_0x2a39('0x2a')](db[_0x2a39('0x2b')][_0x2a39('0x2c')],function(_0x12ea20){return{'name':_0x12ea20[_0x2a39('0x2d')],'type':_0x12ea20[_0x2a39('0x2e')][_0x2a39('0x2f')]};});_0xb28da1[_0x2a39('0x30')]=_[_0x2a39('0x2a')](_0x4d2d19,_0x2a39('0x27'));_0xb28da1[_0x2a39('0x31')]=_[_0x2a39('0x32')](_0x3e77ad[_0x2a39('0x31')]);_0xb28da1[_0x2a39('0x33')]=_['intersection'](_0xb28da1['model'],_0xb28da1[_0x2a39('0x31')]);_0x2873da[_0x2a39('0x34')]=_[_0x2a39('0x35')](_0xb28da1[_0x2a39('0x30')],qs['fields'](_0x3e77ad[_0x2a39('0x31')][_0x2a39('0x36')]));_0x2873da['attributes']=_0x2873da[_0x2a39('0x34')][_0x2a39('0x37')]?_0x2873da[_0x2a39('0x34')]:_0xb28da1['model'];if(!_0x3e77ad[_0x2a39('0x31')][_0x2a39('0x38')]('nolimit')){_0x2873da['limit']=qs[_0x2a39('0x19')](_0x3e77ad[_0x2a39('0x31')][_0x2a39('0x19')]);_0x2873da[_0x2a39('0x1a')]=qs[_0x2a39('0x1a')](_0x3e77ad[_0x2a39('0x31')]['offset']);}_0x2873da[_0x2a39('0x39')]=qs['sort'](_0x3e77ad[_0x2a39('0x31')][_0x2a39('0x3a')]);_0x2873da[_0x2a39('0x3b')]=qs[_0x2a39('0x33')](_[_0x2a39('0x3c')](_0x3e77ad['query'],_0xb28da1[_0x2a39('0x33')]),_0x4d2d19);if(_0x3e77ad[_0x2a39('0x31')][_0x2a39('0x3d')]){_0x2873da[_0x2a39('0x3b')]=_[_0x2a39('0x3e')](_0x2873da[_0x2a39('0x3b')],{'$or':_[_0x2a39('0x2a')](_0x4d2d19,function(_0x57b324){if(_0x57b324['type']!==_0x2a39('0x3f')){var _0x40df99={};_0x40df99[_0x57b324[_0x2a39('0x27')]]={'$like':'%'+_0x3e77ad['query']['filter']+'%'};return _0x40df99;}})});}_0x2873da=_[_0x2a39('0x3e')]({},_0x2873da,_0x3e77ad[_0x2a39('0x40')]);var _0x24fa5e={'where':_0x2873da[_0x2a39('0x3b')]};return db[_0x2a39('0x2b')]['count'](_0x24fa5e)[_0x2a39('0x20')](function(_0x1a2568){_0x2f3695['count']=_0x1a2568;if(_0x3e77ad[_0x2a39('0x31')][_0x2a39('0x41')]){_0x2873da['include']=[{'all':!![]}];}return db['Trigger']['findAll'](_0x2873da);})[_0x2a39('0x20')](function(_0x5d394c){_0x2f3695[_0x2a39('0x42')]=_0x5d394c;return _0x2f3695;})['then'](respondWithFilteredResult(_0x21255b,_0x2873da))[_0x2a39('0x43')](handleError(_0x21255b,null));};exports[_0x2a39('0x44')]=function(_0x3c1d79,_0x8f26d4){var _0x50bb22={'raw':![],'where':{'id':_0x3c1d79[_0x2a39('0x45')]['id']}},_0xc82188={};_0xc82188[_0x2a39('0x30')]=_[_0x2a39('0x32')](db['Trigger']['rawAttributes']);_0xc82188[_0x2a39('0x31')]=_['keys'](_0x3c1d79[_0x2a39('0x31')]);_0xc82188[_0x2a39('0x33')]=_[_0x2a39('0x35')](_0xc82188[_0x2a39('0x30')],_0xc82188[_0x2a39('0x31')]);_0x50bb22[_0x2a39('0x34')]=_[_0x2a39('0x35')](_0xc82188[_0x2a39('0x30')],qs['fields'](_0x3c1d79['query'][_0x2a39('0x36')]));_0x50bb22[_0x2a39('0x34')]=_0x50bb22['attributes']['length']?_0x50bb22[_0x2a39('0x34')]:_0xc82188[_0x2a39('0x30')];if(_0x3c1d79[_0x2a39('0x31')][_0x2a39('0x41')]){_0x50bb22[_0x2a39('0x46')]=[{'all':!![]}];}_0x50bb22=_[_0x2a39('0x3e')]({},_0x50bb22,_0x3c1d79['options']);return db['Trigger'][_0x2a39('0x47')](_0x50bb22)[_0x2a39('0x20')](handleEntityNotFound(_0x8f26d4,null))[_0x2a39('0x20')](respondWithResult(_0x8f26d4,null))['catch'](handleError(_0x8f26d4,null));};exports[_0x2a39('0x48')]=function(_0xca210f,_0x1258af){return db[_0x2a39('0x2b')]['create'](_0xca210f[_0x2a39('0x49')],{})['then'](function(_0x1c0b74){var _0x3179b2=_0xca210f[_0x2a39('0x4a')]['get']({'plain':!![]});if(!_0x3179b2)throw new Error(_0x2a39('0x4b'));if(_0x3179b2[_0x2a39('0x4c')]===_0x2a39('0x4a')){var _0x35dcc1=_0x1c0b74[_0x2a39('0x22')]({'plain':!![]});var _0x3440ee=_0x2a39('0x23');return db[_0x2a39('0x4d')]['find']({'where':{'name':_0x3440ee,'userProfileId':_0x3179b2['userProfileId']},'raw':!![]})['then'](function(_0x25ca5d){if(_0x25ca5d&&_0x25ca5d[_0x2a39('0x4e')]===0x0){return db[_0x2a39('0x24')][_0x2a39('0x48')]({'name':_0x35dcc1[_0x2a39('0x27')],'resourceId':_0x35dcc1['id'],'type':_0x25ca5d[_0x2a39('0x27')],'sectionId':_0x25ca5d['id']},{})[_0x2a39('0x20')](function(){return _0x1c0b74;});}else{return _0x1c0b74;}})[_0x2a39('0x43')](function(_0x2f86e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f86e5);throw _0x2f86e5;});}return _0x1c0b74;})[_0x2a39('0x20')](respondWithResult(_0x1258af,0xc9))[_0x2a39('0x43')](handleError(_0x1258af,null));};exports[_0x2a39('0x1f')]=function(_0x49d490,_0x3abd18){if(_0x49d490[_0x2a39('0x49')]['id']){delete _0x49d490[_0x2a39('0x49')]['id'];}return db[_0x2a39('0x2b')]['find']({'where':{'id':_0x49d490[_0x2a39('0x45')]['id']}})[_0x2a39('0x20')](handleEntityNotFound(_0x3abd18,null))[_0x2a39('0x20')](saveUpdates(_0x49d490[_0x2a39('0x49')],null))[_0x2a39('0x20')](respondWithResult(_0x3abd18,null))[_0x2a39('0x43')](handleError(_0x3abd18,null));};exports[_0x2a39('0x21')]=function(_0x2f4060,_0x1c951b){return db[_0x2a39('0x2b')][_0x2a39('0x47')]({'where':{'id':_0x2f4060[_0x2a39('0x45')]['id']}})[_0x2a39('0x20')](handleEntityNotFound(_0x1c951b,null))['then'](removeEntity(_0x1c951b,null))[_0x2a39('0x43')](handleError(_0x1c951b,null));};exports['addAllCondition']=function(_0x441155,_0x788483,_0x448db7){if(_0x441155['body']['id']){delete _0x441155[_0x2a39('0x49')]['id'];}return db['Trigger']['find']({'where':{'id':_0x441155[_0x2a39('0x45')]['id']}})[_0x2a39('0x20')](handleEntityNotFound(_0x788483,null))[_0x2a39('0x20')](function(_0x56f102){if(_0x56f102){_0x441155[_0x2a39('0x49')][_0x2a39('0x4f')]=_0x56f102['id'];return db[_0x2a39('0x50')][_0x2a39('0x48')](_0x441155['body']);}})[_0x2a39('0x20')](respondWithResult(_0x788483,null))[_0x2a39('0x43')](handleError(_0x788483,null));};exports[_0x2a39('0x51')]=function(_0x115161,_0x3ffdbf,_0x319642){if(_0x115161[_0x2a39('0x49')]['id']){delete _0x115161['body']['id'];}return db[_0x2a39('0x2b')][_0x2a39('0x47')]({'where':{'id':_0x115161[_0x2a39('0x45')]['id']}})['then'](handleEntityNotFound(_0x3ffdbf,null))['then'](function(_0x52a6a0){if(_0x52a6a0){_0x115161[_0x2a39('0x49')][_0x2a39('0x52')]=_0x52a6a0['id'];return db[_0x2a39('0x50')][_0x2a39('0x48')](_0x115161['body']);}})[_0x2a39('0x20')](respondWithResult(_0x3ffdbf,null))[_0x2a39('0x43')](handleError(_0x3ffdbf,null));};exports[_0x2a39('0x53')]=function(_0x37cb58,_0x5dfa78,_0x2946f9){var _0x3b98f7={};var _0x11f399={};var _0x3745b4;var _0x386145;return db[_0x2a39('0x2b')]['findOne']({'where':{'id':_0x37cb58[_0x2a39('0x45')]['id']}})['then'](handleEntityNotFound(_0x5dfa78,null))[_0x2a39('0x20')](function(_0x44a335){if(_0x44a335){_0x3745b4=_0x44a335;_0x11f399['model']=_[_0x2a39('0x32')](db[_0x2a39('0x50')]['rawAttributes']);_0x11f399['query']=_['keys'](_0x37cb58['query']);_0x11f399[_0x2a39('0x33')]=_[_0x2a39('0x35')](_0x11f399[_0x2a39('0x30')],_0x11f399['query']);_0x3b98f7['attributes']=_[_0x2a39('0x35')](_0x11f399[_0x2a39('0x30')],qs[_0x2a39('0x36')](_0x37cb58[_0x2a39('0x31')][_0x2a39('0x36')]));_0x3b98f7[_0x2a39('0x34')]=_0x3b98f7['attributes'][_0x2a39('0x37')]?_0x3b98f7[_0x2a39('0x34')]:_0x11f399['model'];_0x3b98f7[_0x2a39('0x39')]=qs[_0x2a39('0x3a')](_0x37cb58[_0x2a39('0x31')][_0x2a39('0x3a')]);_0x3b98f7[_0x2a39('0x3b')]=qs[_0x2a39('0x33')](_['pick'](_0x37cb58[_0x2a39('0x31')],_0x11f399['filters']));if(_0x37cb58[_0x2a39('0x31')][_0x2a39('0x3d')]){_0x3b98f7[_0x2a39('0x3b')]=_['merge'](_0x3b98f7[_0x2a39('0x3b')],{'$or':_['map'](_0x3b98f7[_0x2a39('0x34')],function(_0x1dd318){var _0x192c6a={};_0x192c6a[_0x1dd318]={'$like':'%'+_0x37cb58['query'][_0x2a39('0x3d')]+'%'};return _0x192c6a;})});}_0x3b98f7=_[_0x2a39('0x3e')]({},_0x3b98f7,_0x37cb58[_0x2a39('0x40')]);return _0x3745b4[_0x2a39('0x53')](_0x3b98f7);}})[_0x2a39('0x20')](function(_0x2dabe7){if(_0x2dabe7){_0x386145=_0x2dabe7['length'];if(!_0x37cb58[_0x2a39('0x31')][_0x2a39('0x38')](_0x2a39('0x54'))){_0x3b98f7[_0x2a39('0x19')]=qs['limit'](_0x37cb58['query'][_0x2a39('0x19')]);_0x3b98f7[_0x2a39('0x1a')]=qs[_0x2a39('0x1a')](_0x37cb58[_0x2a39('0x31')][_0x2a39('0x1a')]);}return _0x3745b4[_0x2a39('0x53')](_0x3b98f7);}})[_0x2a39('0x20')](function(_0x3893cd){if(_0x3893cd){return _0x3893cd?{'count':_0x386145,'rows':_0x3893cd}:null;}})['then'](respondWithResult(_0x5dfa78,null))[_0x2a39('0x43')](handleError(_0x5dfa78,null));};exports[_0x2a39('0x55')]=function(_0x10be40,_0x3a3a94,_0x381d7b){var _0x5565bc={};var _0x297dba={};var _0x400667;var _0x572488;return db[_0x2a39('0x2b')][_0x2a39('0x56')]({'where':{'id':_0x10be40[_0x2a39('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a3a94,null))[_0x2a39('0x20')](function(_0x459200){if(_0x459200){_0x400667=_0x459200;_0x297dba[_0x2a39('0x30')]=_[_0x2a39('0x32')](db[_0x2a39('0x50')][_0x2a39('0x2c')]);_0x297dba['query']=_[_0x2a39('0x32')](_0x10be40['query']);_0x297dba[_0x2a39('0x33')]=_[_0x2a39('0x35')](_0x297dba[_0x2a39('0x30')],_0x297dba[_0x2a39('0x31')]);_0x5565bc['attributes']=_['intersection'](_0x297dba['model'],qs[_0x2a39('0x36')](_0x10be40[_0x2a39('0x31')][_0x2a39('0x36')]));_0x5565bc[_0x2a39('0x34')]=_0x5565bc[_0x2a39('0x34')][_0x2a39('0x37')]?_0x5565bc[_0x2a39('0x34')]:_0x297dba[_0x2a39('0x30')];_0x5565bc['order']=qs[_0x2a39('0x3a')](_0x10be40[_0x2a39('0x31')]['sort']);_0x5565bc[_0x2a39('0x3b')]=qs['filters'](_[_0x2a39('0x3c')](_0x10be40[_0x2a39('0x31')],_0x297dba['filters']));if(_0x10be40[_0x2a39('0x31')]['filter']){_0x5565bc['where']=_['merge'](_0x5565bc['where'],{'$or':_[_0x2a39('0x2a')](_0x5565bc['attributes'],function(_0x1858db){var _0x299602={};_0x299602[_0x1858db]={'$like':'%'+_0x10be40[_0x2a39('0x31')][_0x2a39('0x3d')]+'%'};return _0x299602;})});}_0x5565bc=_[_0x2a39('0x3e')]({},_0x5565bc,_0x10be40[_0x2a39('0x40')]);return _0x400667[_0x2a39('0x55')](_0x5565bc);}})[_0x2a39('0x20')](function(_0x535788){if(_0x535788){_0x572488=_0x535788[_0x2a39('0x37')];if(!_0x10be40[_0x2a39('0x31')][_0x2a39('0x38')](_0x2a39('0x54'))){_0x5565bc[_0x2a39('0x19')]=qs['limit'](_0x10be40[_0x2a39('0x31')]['limit']);_0x5565bc[_0x2a39('0x1a')]=qs[_0x2a39('0x1a')](_0x10be40[_0x2a39('0x31')][_0x2a39('0x1a')]);}return _0x400667[_0x2a39('0x55')](_0x5565bc);}})[_0x2a39('0x20')](function(_0x2f89d5){if(_0x2f89d5){return _0x2f89d5?{'count':_0x572488,'rows':_0x2f89d5}:null;}})[_0x2a39('0x20')](respondWithResult(_0x3a3a94,null))['catch'](handleError(_0x3a3a94,null));};exports[_0x2a39('0x57')]=function(_0x29fdec,_0x15785e,_0x1415e1){if(_0x29fdec[_0x2a39('0x49')]['id']){delete _0x29fdec['body']['id'];}return db['Trigger'][_0x2a39('0x47')]({'where':{'id':_0x29fdec[_0x2a39('0x45')]['id']}})[_0x2a39('0x20')](handleEntityNotFound(_0x15785e,null))[_0x2a39('0x20')](function(_0x2eca35){if(_0x2eca35){_0x29fdec[_0x2a39('0x49')][_0x2a39('0x58')]=_0x2eca35['id'];return db[_0x2a39('0x59')]['create'](_0x29fdec['body']);}})['then'](respondWithResult(_0x15785e,null))[_0x2a39('0x43')](handleError(_0x15785e,null));};exports['getActions']=function(_0x5060c6,_0x2d0dc7,_0x3bfbf5){var _0x465ae6={};var _0x50a60c={};var _0x3646c1;var _0x397b8f;return db['Trigger'][_0x2a39('0x56')]({'where':{'id':_0x5060c6[_0x2a39('0x45')]['id']}})[_0x2a39('0x20')](handleEntityNotFound(_0x2d0dc7,null))[_0x2a39('0x20')](function(_0x31d434){if(_0x31d434){_0x3646c1=_0x31d434;_0x50a60c[_0x2a39('0x30')]=_['keys'](db[_0x2a39('0x59')][_0x2a39('0x2c')]);_0x50a60c[_0x2a39('0x31')]=_['keys'](_0x5060c6[_0x2a39('0x31')]);_0x50a60c['filters']=_['intersection'](_0x50a60c[_0x2a39('0x30')],_0x50a60c[_0x2a39('0x31')]);_0x465ae6['attributes']=_[_0x2a39('0x35')](_0x50a60c[_0x2a39('0x30')],qs[_0x2a39('0x36')](_0x5060c6[_0x2a39('0x31')][_0x2a39('0x36')]));_0x465ae6['attributes']=_0x465ae6[_0x2a39('0x34')][_0x2a39('0x37')]?_0x465ae6[_0x2a39('0x34')]:_0x50a60c['model'];_0x465ae6[_0x2a39('0x39')]=qs[_0x2a39('0x3a')](_0x5060c6[_0x2a39('0x31')][_0x2a39('0x3a')]);_0x465ae6[_0x2a39('0x3b')]=qs['filters'](_['pick'](_0x5060c6[_0x2a39('0x31')],_0x50a60c[_0x2a39('0x33')]));if(_0x5060c6[_0x2a39('0x31')][_0x2a39('0x3d')]){_0x465ae6[_0x2a39('0x3b')]=_[_0x2a39('0x3e')](_0x465ae6[_0x2a39('0x3b')],{'$or':_[_0x2a39('0x2a')](_0x465ae6['attributes'],function(_0x23cb17){var _0x347423={};_0x347423[_0x23cb17]={'$like':'%'+_0x5060c6[_0x2a39('0x31')][_0x2a39('0x3d')]+'%'};return _0x347423;})});}_0x465ae6=_[_0x2a39('0x3e')]({},_0x465ae6,_0x5060c6[_0x2a39('0x40')]);return _0x3646c1[_0x2a39('0x5a')](_0x465ae6);}})[_0x2a39('0x20')](function(_0x52c680){if(_0x52c680){_0x397b8f=_0x52c680[_0x2a39('0x37')];if(!_0x5060c6[_0x2a39('0x31')][_0x2a39('0x38')](_0x2a39('0x54'))){_0x465ae6[_0x2a39('0x19')]=qs[_0x2a39('0x19')](_0x5060c6[_0x2a39('0x31')][_0x2a39('0x19')]);_0x465ae6[_0x2a39('0x1a')]=qs['offset'](_0x5060c6['query'][_0x2a39('0x1a')]);}return _0x3646c1[_0x2a39('0x5a')](_0x465ae6);}})[_0x2a39('0x20')](function(_0x3a7164){if(_0x3a7164){return _0x3a7164?{'count':_0x397b8f,'rows':_0x3a7164}:null;}})[_0x2a39('0x20')](respondWithResult(_0x2d0dc7,null))['catch'](handleError(_0x2d0dc7,null));}; \ No newline at end of file +var _0xc3e5=['intersection','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','length','find','create','body','user','UserProfileSection','userProfileId','params','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','hasOwnProperty','Action','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','get','Triggers','UserProfileResource','error','name','send','map','Trigger','fieldName','type','key','model','query','filters','attributes'];(function(_0x18e52b,_0x1fae35){var _0x3d3062=function(_0x133b14){while(--_0x133b14){_0x18e52b['push'](_0x18e52b['shift']());}};_0x3d3062(++_0x1fae35);}(_0xc3e5,0x125));var _0x5c3e=function(_0x1da723,_0x1ca46a){_0x1da723=_0x1da723-0x0;var _0x550358=_0xc3e5[_0x1da723];return _0x550358;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c3e('0x0'));var jsonpatch=require(_0x5c3e('0x1'));var rp=require(_0x5c3e('0x2'));var moment=require(_0x5c3e('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c3e('0x4'));var path=require(_0x5c3e('0x5'));var sox=require(_0x5c3e('0x6'));var csv=require(_0x5c3e('0x7'));var ejs=require(_0x5c3e('0x8'));var fs=require('fs');var fs_extra=require(_0x5c3e('0x9'));var _=require(_0x5c3e('0xa'));var squel=require(_0x5c3e('0xb'));var crypto=require(_0x5c3e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5c3e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5c3e('0xe'));var Papa=require(_0x5c3e('0xf'));var Redis=require(_0x5c3e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c3e('0x11'));var as=require(_0x5c3e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c3e('0x13'))(_0x5c3e('0x14'));var utils=require('../../config/utils');var config=require(_0x5c3e('0x15'));var licenseUtil=require(_0x5c3e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a6dec,_0x44a366){_0x44a366=_0x44a366||0xcc;return function(_0x4c3901){if(_0x4c3901){return _0x5a6dec['sendStatus'](_0x44a366);}return _0x5a6dec[_0x5c3e('0x17')](_0x44a366)[_0x5c3e('0x18')]();};}function respondWithResult(_0x52532d,_0x13d4f8){_0x13d4f8=_0x13d4f8||0xc8;return function(_0x33e026){if(_0x33e026){return _0x52532d[_0x5c3e('0x17')](_0x13d4f8)[_0x5c3e('0x19')](_0x33e026);}};}function respondWithFilteredResult(_0x225bcf,_0xc018bf){return function(_0x34e377){if(_0x34e377){var _0x5eb7ee=typeof _0xc018bf['offset']===_0x5c3e('0x1a')&&typeof _0xc018bf['limit']==='undefined';var _0x65cc99=_0x34e377[_0x5c3e('0x1b')];var _0x5d6d7e=_0x5eb7ee?0x0:_0xc018bf[_0x5c3e('0x1c')];var _0xc3f357=_0x5eb7ee?_0x34e377[_0x5c3e('0x1b')]:_0xc018bf[_0x5c3e('0x1c')]+_0xc018bf['limit'];var _0x54014a;if(_0xc3f357>=_0x65cc99){_0xc3f357=_0x65cc99;_0x54014a=0xc8;}else{_0x54014a=0xce;}_0x225bcf[_0x5c3e('0x17')](_0x54014a);return _0x225bcf[_0x5c3e('0x1d')](_0x5c3e('0x1e'),_0x5d6d7e+'-'+_0xc3f357+'/'+_0x65cc99)[_0x5c3e('0x19')](_0x34e377);}return null;};}function patchUpdates(_0x55b1d8){return function(_0x436f0f){try{jsonpatch[_0x5c3e('0x1f')](_0x436f0f,_0x55b1d8,!![]);}catch(_0x37d5b1){return BPromise['reject'](_0x37d5b1);}return _0x436f0f[_0x5c3e('0x20')]();};}function saveUpdates(_0x6e54d2,_0x45e615){return function(_0x124d8a){if(_0x124d8a){return _0x124d8a[_0x5c3e('0x21')](_0x6e54d2)[_0x5c3e('0x22')](function(_0x29a529){return _0x29a529;});}return null;};}function removeEntity(_0x3581d7,_0x25742f){return function(_0x1b89d5){if(_0x1b89d5){return _0x1b89d5[_0x5c3e('0x23')]()['then'](function(){var _0x53dc9a=_0x1b89d5[_0x5c3e('0x24')]({'plain':!![]});var _0xd577de=_0x5c3e('0x25');return db[_0x5c3e('0x26')][_0x5c3e('0x23')]({'where':{'type':_0xd577de,'resourceId':_0x53dc9a['id']}})[_0x5c3e('0x22')](function(){return _0x1b89d5;});})[_0x5c3e('0x22')](function(){_0x3581d7['status'](0xcc)[_0x5c3e('0x18')]();});}};}function handleEntityNotFound(_0x4ae1e3,_0x41eb5b){return function(_0xd84251){if(!_0xd84251){_0x4ae1e3['sendStatus'](0x194);}return _0xd84251;};}function handleError(_0x32fa2c,_0xa79cbc){_0xa79cbc=_0xa79cbc||0x1f4;return function(_0x42fee2){logger[_0x5c3e('0x27')](_0x42fee2['stack']);if(_0x42fee2[_0x5c3e('0x28')]){delete _0x42fee2['name'];}_0x32fa2c[_0x5c3e('0x17')](_0xa79cbc)[_0x5c3e('0x29')](_0x42fee2);};}exports['index']=function(_0x4e0eaf,_0x42b704){var _0x38e9a4={},_0x123af4={},_0x4fe6c1={'count':0x0,'rows':[]};var _0x5d9525=_[_0x5c3e('0x2a')](db[_0x5c3e('0x2b')]['rawAttributes'],function(_0x5f9970){return{'name':_0x5f9970[_0x5c3e('0x2c')],'type':_0x5f9970[_0x5c3e('0x2d')][_0x5c3e('0x2e')]};});_0x123af4[_0x5c3e('0x2f')]=_[_0x5c3e('0x2a')](_0x5d9525,_0x5c3e('0x28'));_0x123af4[_0x5c3e('0x30')]=_['keys'](_0x4e0eaf['query']);_0x123af4[_0x5c3e('0x31')]=_['intersection'](_0x123af4[_0x5c3e('0x2f')],_0x123af4[_0x5c3e('0x30')]);_0x38e9a4[_0x5c3e('0x32')]=_[_0x5c3e('0x33')](_0x123af4['model'],qs['fields'](_0x4e0eaf['query'][_0x5c3e('0x34')]));_0x38e9a4[_0x5c3e('0x32')]=_0x38e9a4[_0x5c3e('0x32')]['length']?_0x38e9a4[_0x5c3e('0x32')]:_0x123af4[_0x5c3e('0x2f')];if(!_0x4e0eaf[_0x5c3e('0x30')]['hasOwnProperty'](_0x5c3e('0x35'))){_0x38e9a4[_0x5c3e('0x36')]=qs['limit'](_0x4e0eaf[_0x5c3e('0x30')]['limit']);_0x38e9a4[_0x5c3e('0x1c')]=qs[_0x5c3e('0x1c')](_0x4e0eaf[_0x5c3e('0x30')]['offset']);}_0x38e9a4[_0x5c3e('0x37')]=qs['sort'](_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x38')]);_0x38e9a4[_0x5c3e('0x39')]=qs['filters'](_[_0x5c3e('0x3a')](_0x4e0eaf[_0x5c3e('0x30')],_0x123af4[_0x5c3e('0x31')]),_0x5d9525);if(_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x3b')]){_0x38e9a4[_0x5c3e('0x39')]=_[_0x5c3e('0x3c')](_0x38e9a4['where'],{'$or':_[_0x5c3e('0x2a')](_0x5d9525,function(_0x4bbf2d){if(_0x4bbf2d['type']!==_0x5c3e('0x3d')){var _0x131660={};_0x131660[_0x4bbf2d['name']]={'$like':'%'+_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x3b')]+'%'};return _0x131660;}})});}_0x38e9a4=_[_0x5c3e('0x3c')]({},_0x38e9a4,_0x4e0eaf[_0x5c3e('0x3e')]);var _0x3ad5cd={'where':_0x38e9a4['where']};return db[_0x5c3e('0x2b')][_0x5c3e('0x1b')](_0x3ad5cd)[_0x5c3e('0x22')](function(_0x492317){_0x4fe6c1[_0x5c3e('0x1b')]=_0x492317;if(_0x4e0eaf[_0x5c3e('0x30')][_0x5c3e('0x3f')]){_0x38e9a4[_0x5c3e('0x40')]=[{'all':!![]}];}return db[_0x5c3e('0x2b')][_0x5c3e('0x41')](_0x38e9a4);})[_0x5c3e('0x22')](function(_0x304355){_0x4fe6c1[_0x5c3e('0x42')]=_0x304355;return _0x4fe6c1;})[_0x5c3e('0x22')](respondWithFilteredResult(_0x42b704,_0x38e9a4))[_0x5c3e('0x43')](handleError(_0x42b704,null));};exports[_0x5c3e('0x44')]=function(_0x132c4b,_0x22fa29){var _0xba33e2={'raw':![],'where':{'id':_0x132c4b['params']['id']}},_0x262d66={};_0x262d66['model']=_['keys'](db[_0x5c3e('0x2b')][_0x5c3e('0x45')]);_0x262d66[_0x5c3e('0x30')]=_[_0x5c3e('0x46')](_0x132c4b[_0x5c3e('0x30')]);_0x262d66[_0x5c3e('0x31')]=_[_0x5c3e('0x33')](_0x262d66[_0x5c3e('0x2f')],_0x262d66[_0x5c3e('0x30')]);_0xba33e2['attributes']=_[_0x5c3e('0x33')](_0x262d66[_0x5c3e('0x2f')],qs[_0x5c3e('0x34')](_0x132c4b['query'][_0x5c3e('0x34')]));_0xba33e2[_0x5c3e('0x32')]=_0xba33e2['attributes'][_0x5c3e('0x47')]?_0xba33e2[_0x5c3e('0x32')]:_0x262d66[_0x5c3e('0x2f')];if(_0x132c4b[_0x5c3e('0x30')]['includeAll']){_0xba33e2[_0x5c3e('0x40')]=[{'all':!![]}];}_0xba33e2=_[_0x5c3e('0x3c')]({},_0xba33e2,_0x132c4b[_0x5c3e('0x3e')]);return db[_0x5c3e('0x2b')][_0x5c3e('0x48')](_0xba33e2)[_0x5c3e('0x22')](handleEntityNotFound(_0x22fa29,null))[_0x5c3e('0x22')](respondWithResult(_0x22fa29,null))[_0x5c3e('0x43')](handleError(_0x22fa29,null));};exports['create']=function(_0x51c9a3,_0x19a6d0){return db[_0x5c3e('0x2b')][_0x5c3e('0x49')](_0x51c9a3[_0x5c3e('0x4a')],{})['then'](function(_0x4e0b0e){var _0x312c8b=_0x51c9a3['user'][_0x5c3e('0x24')]({'plain':!![]});if(!_0x312c8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x312c8b['role']===_0x5c3e('0x4b')){var _0x1a5990=_0x4e0b0e[_0x5c3e('0x24')]({'plain':!![]});var _0x483b3c=_0x5c3e('0x25');return db[_0x5c3e('0x4c')][_0x5c3e('0x48')]({'where':{'name':_0x483b3c,'userProfileId':_0x312c8b[_0x5c3e('0x4d')]},'raw':!![]})['then'](function(_0x2b4658){if(_0x2b4658&&_0x2b4658['autoAssociation']===0x0){return db[_0x5c3e('0x26')]['create']({'name':_0x1a5990[_0x5c3e('0x28')],'resourceId':_0x1a5990['id'],'type':_0x2b4658[_0x5c3e('0x28')],'sectionId':_0x2b4658['id']},{})['then'](function(){return _0x4e0b0e;});}else{return _0x4e0b0e;}})[_0x5c3e('0x43')](function(_0x59821b){logger[_0x5c3e('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59821b);throw _0x59821b;});}return _0x4e0b0e;})[_0x5c3e('0x22')](respondWithResult(_0x19a6d0,0xc9))[_0x5c3e('0x43')](handleError(_0x19a6d0,null));};exports['update']=function(_0xba4964,_0x1339a4){if(_0xba4964[_0x5c3e('0x4a')]['id']){delete _0xba4964[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')][_0x5c3e('0x48')]({'where':{'id':_0xba4964[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1339a4,null))[_0x5c3e('0x22')](saveUpdates(_0xba4964['body'],null))['then'](respondWithResult(_0x1339a4,null))[_0x5c3e('0x43')](handleError(_0x1339a4,null));};exports[_0x5c3e('0x23')]=function(_0x5b69bb,_0xd01e6f){return db['Trigger'][_0x5c3e('0x48')]({'where':{'id':_0x5b69bb[_0x5c3e('0x4e')]['id']}})[_0x5c3e('0x22')](handleEntityNotFound(_0xd01e6f,null))[_0x5c3e('0x22')](removeEntity(_0xd01e6f,null))['catch'](handleError(_0xd01e6f,null));};exports['addAllCondition']=function(_0x443657,_0x1eb28e,_0x4cabed){if(_0x443657[_0x5c3e('0x4a')]['id']){delete _0x443657[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')]['find']({'where':{'id':_0x443657[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1eb28e,null))['then'](function(_0x2a4212){if(_0x2a4212){_0x443657['body']['TriggerAllId']=_0x2a4212['id'];return db[_0x5c3e('0x4f')][_0x5c3e('0x49')](_0x443657['body']);}})[_0x5c3e('0x22')](respondWithResult(_0x1eb28e,null))['catch'](handleError(_0x1eb28e,null));};exports[_0x5c3e('0x50')]=function(_0x45a7de,_0x1c65df,_0x44f105){if(_0x45a7de[_0x5c3e('0x4a')]['id']){delete _0x45a7de[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')][_0x5c3e('0x48')]({'where':{'id':_0x45a7de[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1c65df,null))[_0x5c3e('0x22')](function(_0x42bcac){if(_0x42bcac){_0x45a7de[_0x5c3e('0x4a')]['TriggerAnyId']=_0x42bcac['id'];return db[_0x5c3e('0x4f')]['create'](_0x45a7de[_0x5c3e('0x4a')]);}})[_0x5c3e('0x22')](respondWithResult(_0x1c65df,null))[_0x5c3e('0x43')](handleError(_0x1c65df,null));};exports[_0x5c3e('0x51')]=function(_0x5df55c,_0x56c429,_0x3e5ad8){var _0x4db4aa={};var _0x5a6c93={};var _0x4a09d3;var _0x43c40e;return db[_0x5c3e('0x2b')][_0x5c3e('0x52')]({'where':{'id':_0x5df55c[_0x5c3e('0x4e')]['id']}})[_0x5c3e('0x22')](handleEntityNotFound(_0x56c429,null))[_0x5c3e('0x22')](function(_0x40f5d2){if(_0x40f5d2){_0x4a09d3=_0x40f5d2;_0x5a6c93[_0x5c3e('0x2f')]=_[_0x5c3e('0x46')](db[_0x5c3e('0x4f')][_0x5c3e('0x45')]);_0x5a6c93[_0x5c3e('0x30')]=_['keys'](_0x5df55c['query']);_0x5a6c93['filters']=_[_0x5c3e('0x33')](_0x5a6c93[_0x5c3e('0x2f')],_0x5a6c93[_0x5c3e('0x30')]);_0x4db4aa['attributes']=_['intersection'](_0x5a6c93[_0x5c3e('0x2f')],qs[_0x5c3e('0x34')](_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x34')]));_0x4db4aa[_0x5c3e('0x32')]=_0x4db4aa[_0x5c3e('0x32')]['length']?_0x4db4aa['attributes']:_0x5a6c93['model'];_0x4db4aa[_0x5c3e('0x37')]=qs[_0x5c3e('0x38')](_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x38')]);_0x4db4aa[_0x5c3e('0x39')]=qs[_0x5c3e('0x31')](_[_0x5c3e('0x3a')](_0x5df55c[_0x5c3e('0x30')],_0x5a6c93['filters']));if(_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x3b')]){_0x4db4aa[_0x5c3e('0x39')]=_[_0x5c3e('0x3c')](_0x4db4aa[_0x5c3e('0x39')],{'$or':_[_0x5c3e('0x2a')](_0x4db4aa[_0x5c3e('0x32')],function(_0x1f2f50){var _0x203e00={};_0x203e00[_0x1f2f50]={'$like':'%'+_0x5df55c['query']['filter']+'%'};return _0x203e00;})});}_0x4db4aa=_['merge']({},_0x4db4aa,_0x5df55c[_0x5c3e('0x3e')]);return _0x4a09d3[_0x5c3e('0x51')](_0x4db4aa);}})[_0x5c3e('0x22')](function(_0x5268f3){if(_0x5268f3){_0x43c40e=_0x5268f3[_0x5c3e('0x47')];if(!_0x5df55c[_0x5c3e('0x30')]['hasOwnProperty'](_0x5c3e('0x35'))){_0x4db4aa[_0x5c3e('0x36')]=qs[_0x5c3e('0x36')](_0x5df55c[_0x5c3e('0x30')][_0x5c3e('0x36')]);_0x4db4aa[_0x5c3e('0x1c')]=qs['offset'](_0x5df55c[_0x5c3e('0x30')]['offset']);}return _0x4a09d3[_0x5c3e('0x51')](_0x4db4aa);}})['then'](function(_0x41318a){if(_0x41318a){return _0x41318a?{'count':_0x43c40e,'rows':_0x41318a}:null;}})['then'](respondWithResult(_0x56c429,null))[_0x5c3e('0x43')](handleError(_0x56c429,null));};exports[_0x5c3e('0x53')]=function(_0x218332,_0x538504,_0x455ad0){var _0xa126e={};var _0x5c2ae6={};var _0xc051a9;var _0x5c5401;return db[_0x5c3e('0x2b')]['findOne']({'where':{'id':_0x218332[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x538504,null))[_0x5c3e('0x22')](function(_0x1bbd28){if(_0x1bbd28){_0xc051a9=_0x1bbd28;_0x5c2ae6[_0x5c3e('0x2f')]=_[_0x5c3e('0x46')](db[_0x5c3e('0x4f')][_0x5c3e('0x45')]);_0x5c2ae6[_0x5c3e('0x30')]=_[_0x5c3e('0x46')](_0x218332['query']);_0x5c2ae6[_0x5c3e('0x31')]=_[_0x5c3e('0x33')](_0x5c2ae6[_0x5c3e('0x2f')],_0x5c2ae6['query']);_0xa126e[_0x5c3e('0x32')]=_[_0x5c3e('0x33')](_0x5c2ae6[_0x5c3e('0x2f')],qs[_0x5c3e('0x34')](_0x218332[_0x5c3e('0x30')]['fields']));_0xa126e[_0x5c3e('0x32')]=_0xa126e[_0x5c3e('0x32')][_0x5c3e('0x47')]?_0xa126e[_0x5c3e('0x32')]:_0x5c2ae6[_0x5c3e('0x2f')];_0xa126e[_0x5c3e('0x37')]=qs['sort'](_0x218332['query'][_0x5c3e('0x38')]);_0xa126e[_0x5c3e('0x39')]=qs['filters'](_[_0x5c3e('0x3a')](_0x218332[_0x5c3e('0x30')],_0x5c2ae6[_0x5c3e('0x31')]));if(_0x218332[_0x5c3e('0x30')]['filter']){_0xa126e['where']=_[_0x5c3e('0x3c')](_0xa126e[_0x5c3e('0x39')],{'$or':_[_0x5c3e('0x2a')](_0xa126e['attributes'],function(_0x437db0){var _0x2f71ae={};_0x2f71ae[_0x437db0]={'$like':'%'+_0x218332[_0x5c3e('0x30')][_0x5c3e('0x3b')]+'%'};return _0x2f71ae;})});}_0xa126e=_[_0x5c3e('0x3c')]({},_0xa126e,_0x218332[_0x5c3e('0x3e')]);return _0xc051a9[_0x5c3e('0x53')](_0xa126e);}})[_0x5c3e('0x22')](function(_0x58e9a1){if(_0x58e9a1){_0x5c5401=_0x58e9a1[_0x5c3e('0x47')];if(!_0x218332[_0x5c3e('0x30')][_0x5c3e('0x54')](_0x5c3e('0x35'))){_0xa126e[_0x5c3e('0x36')]=qs[_0x5c3e('0x36')](_0x218332[_0x5c3e('0x30')][_0x5c3e('0x36')]);_0xa126e[_0x5c3e('0x1c')]=qs[_0x5c3e('0x1c')](_0x218332[_0x5c3e('0x30')][_0x5c3e('0x1c')]);}return _0xc051a9[_0x5c3e('0x53')](_0xa126e);}})[_0x5c3e('0x22')](function(_0x3491fb){if(_0x3491fb){return _0x3491fb?{'count':_0x5c5401,'rows':_0x3491fb}:null;}})[_0x5c3e('0x22')](respondWithResult(_0x538504,null))[_0x5c3e('0x43')](handleError(_0x538504,null));};exports['addAction']=function(_0x145dc6,_0x2ba459,_0x3e08e5){if(_0x145dc6[_0x5c3e('0x4a')]['id']){delete _0x145dc6[_0x5c3e('0x4a')]['id'];}return db[_0x5c3e('0x2b')]['find']({'where':{'id':_0x145dc6[_0x5c3e('0x4e')]['id']}})[_0x5c3e('0x22')](handleEntityNotFound(_0x2ba459,null))[_0x5c3e('0x22')](function(_0x3e3d25){if(_0x3e3d25){_0x145dc6[_0x5c3e('0x4a')]['TriggerId']=_0x3e3d25['id'];return db[_0x5c3e('0x55')][_0x5c3e('0x49')](_0x145dc6[_0x5c3e('0x4a')]);}})[_0x5c3e('0x22')](respondWithResult(_0x2ba459,null))['catch'](handleError(_0x2ba459,null));};exports['getActions']=function(_0x3579e1,_0x41caed,_0x1bd2d4){var _0xcf07aa={};var _0x2ce144={};var _0x82a4d9;var _0x426e1e;return db[_0x5c3e('0x2b')]['findOne']({'where':{'id':_0x3579e1[_0x5c3e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x41caed,null))[_0x5c3e('0x22')](function(_0x34b264){if(_0x34b264){_0x82a4d9=_0x34b264;_0x2ce144[_0x5c3e('0x2f')]=_[_0x5c3e('0x46')](db[_0x5c3e('0x55')][_0x5c3e('0x45')]);_0x2ce144['query']=_[_0x5c3e('0x46')](_0x3579e1[_0x5c3e('0x30')]);_0x2ce144[_0x5c3e('0x31')]=_[_0x5c3e('0x33')](_0x2ce144[_0x5c3e('0x2f')],_0x2ce144[_0x5c3e('0x30')]);_0xcf07aa[_0x5c3e('0x32')]=_['intersection'](_0x2ce144['model'],qs[_0x5c3e('0x34')](_0x3579e1[_0x5c3e('0x30')]['fields']));_0xcf07aa[_0x5c3e('0x32')]=_0xcf07aa[_0x5c3e('0x32')][_0x5c3e('0x47')]?_0xcf07aa['attributes']:_0x2ce144[_0x5c3e('0x2f')];_0xcf07aa[_0x5c3e('0x37')]=qs[_0x5c3e('0x38')](_0x3579e1[_0x5c3e('0x30')]['sort']);_0xcf07aa[_0x5c3e('0x39')]=qs[_0x5c3e('0x31')](_['pick'](_0x3579e1[_0x5c3e('0x30')],_0x2ce144[_0x5c3e('0x31')]));if(_0x3579e1[_0x5c3e('0x30')]['filter']){_0xcf07aa[_0x5c3e('0x39')]=_[_0x5c3e('0x3c')](_0xcf07aa[_0x5c3e('0x39')],{'$or':_[_0x5c3e('0x2a')](_0xcf07aa[_0x5c3e('0x32')],function(_0x571b06){var _0x58703a={};_0x58703a[_0x571b06]={'$like':'%'+_0x3579e1[_0x5c3e('0x30')]['filter']+'%'};return _0x58703a;})});}_0xcf07aa=_[_0x5c3e('0x3c')]({},_0xcf07aa,_0x3579e1[_0x5c3e('0x3e')]);return _0x82a4d9['getActions'](_0xcf07aa);}})[_0x5c3e('0x22')](function(_0x34156f){if(_0x34156f){_0x426e1e=_0x34156f[_0x5c3e('0x47')];if(!_0x3579e1['query']['hasOwnProperty'](_0x5c3e('0x35'))){_0xcf07aa[_0x5c3e('0x36')]=qs[_0x5c3e('0x36')](_0x3579e1[_0x5c3e('0x30')]['limit']);_0xcf07aa[_0x5c3e('0x1c')]=qs[_0x5c3e('0x1c')](_0x3579e1['query']['offset']);}return _0x82a4d9['getActions'](_0xcf07aa);}})[_0x5c3e('0x22')](function(_0x3cd035){if(_0x3cd035){return _0x3cd035?{'count':_0x426e1e,'rows':_0x3cd035}:null;}})[_0x5c3e('0x22')](respondWithResult(_0x41caed,null))[_0x5c3e('0x43')](handleError(_0x41caed,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index b75c745..09dfbf1 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 _0x9aee=['path','rimraf','Trigger','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x333ff3,_0x22a702){var _0x43560c=function(_0x449c72){while(--_0x449c72){_0x333ff3['push'](_0x333ff3['shift']());}};_0x43560c(++_0x22a702);}(_0x9aee,0x71));var _0xe9ae=function(_0x53b4dc,_0x51f549){_0x53b4dc=_0x53b4dc-0x0;var _0x3b2b68=_0x9aee[_0x53b4dc];return _0x3b2b68;};'use strict';var _=require(_0xe9ae('0x0'));var util=require(_0xe9ae('0x1'));var logger=require(_0xe9ae('0x2'))(_0xe9ae('0x3'));var moment=require(_0xe9ae('0x4'));var BPromise=require(_0xe9ae('0x5'));var rp=require(_0xe9ae('0x6'));var fs=require('fs');var path=require(_0xe9ae('0x7'));var rimraf=require(_0xe9ae('0x8'));var config=require('../../config/environment');var attributes=require('./trigger.attributes');module['exports']=function(_0xf3aa52,_0x4e889d){return _0xf3aa52['define'](_0xe9ae('0x9'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18d6=['request-promise','rimraf','../../config/environment','exports','define','tools_triggers','lodash','util','api','moment','bluebird'];(function(_0x224ccd,_0x2a30f2){var _0x267265=function(_0x13c5c5){while(--_0x13c5c5){_0x224ccd['push'](_0x224ccd['shift']());}};_0x267265(++_0x2a30f2);}(_0x18d6,0x166));var _0x618d=function(_0x26458c,_0x27bcda){_0x26458c=_0x26458c-0x0;var _0x3bc991=_0x18d6[_0x26458c];return _0x3bc991;};'use strict';var _=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var logger=require('../../config/logger')(_0x618d('0x2'));var moment=require(_0x618d('0x3'));var BPromise=require(_0x618d('0x4'));var rp=require(_0x618d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x618d('0x6'));var config=require(_0x618d('0x7'));var attributes=require('./trigger.attributes');module[_0x618d('0x8')]=function(_0x55caad,_0xa89cff){return _0x55caad[_0x618d('0x9')]('Trigger',attributes,{'tableName':_0x618d('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 5467872..05abeb8 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 _0xffc3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xffc3,0x17a));var _0x3ffc=function(_0x2ac0e6,_0x517b87){_0x2ac0e6=_0x2ac0e6-0x0;var _0x2c044b=_0xffc3[_0x2ac0e6];return _0x2c044b;};'use strict';var _=require(_0x3ffc('0x0'));var util=require('util');var moment=require(_0x3ffc('0x1'));var BPromise=require(_0x3ffc('0x2'));var rs=require(_0x3ffc('0x3'));var fs=require('fs');var Redis=require(_0x3ffc('0x4'));var db=require(_0x3ffc('0x5'))['db'];var utils=require(_0x3ffc('0x6'));var logger=require(_0x3ffc('0x7'))(_0x3ffc('0x8'));var config=require(_0x3ffc('0x9'));var jayson=require(_0x3ffc('0xa'));var client=jayson[_0x3ffc('0xb')][_0x3ffc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1327e3,_0x64b95e,_0x394f05){return new BPromise(function(_0xf3f76f,_0x2c6403){return client[_0x3ffc('0xd')](_0x1327e3,_0x394f05)['then'](function(_0x2390da){logger[_0x3ffc('0xe')](_0x3ffc('0xf'),_0x64b95e,_0x3ffc('0x10'));logger[_0x3ffc('0x11')]('Trigger,\x20%s,\x20%s,\x20%s',_0x64b95e,'request\x20sent',JSON[_0x3ffc('0x12')](_0x2390da));if(_0x2390da[_0x3ffc('0x13')]){if(_0x2390da[_0x3ffc('0x13')]['code']===0x1f4){logger[_0x3ffc('0x13')](_0x3ffc('0xf'),_0x64b95e,_0x2390da['error']['message']);return _0x2c6403(_0x2390da[_0x3ffc('0x13')]['message']);}logger[_0x3ffc('0x13')](_0x3ffc('0xf'),_0x64b95e,_0x2390da['error'][_0x3ffc('0x14')]);return _0xf3f76f(_0x2390da[_0x3ffc('0x13')][_0x3ffc('0x14')]);}else{logger['info'](_0x3ffc('0xf'),_0x64b95e,_0x3ffc('0x10'));_0xf3f76f(_0x2390da['result'][_0x3ffc('0x14')]);}})[_0x3ffc('0x15')](function(_0x1565e6){logger[_0x3ffc('0x13')](_0x3ffc('0xf'),_0x64b95e,_0x1565e6);_0x2c6403(_0x1565e6);});});}exports['GetTrigger']=function(_0x2f1c61){var _0x43902f=this;return new Promise(function(_0x27f39e,_0x148ae1){return db[_0x3ffc('0x16')][_0x3ffc('0x17')]({'raw':_0x2f1c61[_0x3ffc('0x18')]?_0x2f1c61[_0x3ffc('0x18')][_0x3ffc('0x19')]===undefined?!![]:![]:!![],'where':_0x2f1c61[_0x3ffc('0x18')]?_0x2f1c61[_0x3ffc('0x18')][_0x3ffc('0x1a')]||null:null,'attributes':_0x2f1c61[_0x3ffc('0x18')]?_0x2f1c61[_0x3ffc('0x18')][_0x3ffc('0x1b')]||null:null,'limit':_0x2f1c61[_0x3ffc('0x18')]?_0x2f1c61['options'][_0x3ffc('0x1c')]||null:null,'include':_0x2f1c61[_0x3ffc('0x18')]?_0x2f1c61[_0x3ffc('0x18')][_0x3ffc('0x1d')]?_[_0x3ffc('0x1e')](_0x2f1c61[_0x3ffc('0x18')][_0x3ffc('0x1d')],function(_0x1eccb8){return{'model':db[_0x1eccb8[_0x3ffc('0x1f')]],'as':_0x1eccb8['as'],'attributes':_0x1eccb8[_0x3ffc('0x1b')],'include':_0x1eccb8[_0x3ffc('0x1d')]?_['map'](_0x1eccb8[_0x3ffc('0x1d')],function(_0x241309){return{'model':db[_0x241309[_0x3ffc('0x1f')]],'as':_0x241309['as'],'attributes':_0x241309['attributes'],'include':_0x241309[_0x3ffc('0x1d')]?_[_0x3ffc('0x1e')](_0x241309['include'],function(_0x1c92da){return{'model':db[_0x1c92da[_0x3ffc('0x1f')]],'as':_0x1c92da['as'],'attributes':_0x1c92da[_0x3ffc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d5910){logger[_0x3ffc('0xe')]('GetTrigger',_0x2f1c61);logger['debug'](_0x3ffc('0x20'),_0x2f1c61,JSON[_0x3ffc('0x12')](_0x1d5910));_0x27f39e(_0x1d5910);})[_0x3ffc('0x15')](function(_0x42dd86){logger['error'](_0x3ffc('0x20'),_0x42dd86[_0x3ffc('0x14')],_0x2f1c61);_0x148ae1(_0x43902f[_0x3ffc('0x13')](0x1f4,_0x42dd86[_0x3ffc('0x14')]));});});};exports[_0x3ffc('0x21')]=function(_0x5fc253){var _0x1cf262=this;return new Promise(function(_0x433c40,_0x4f22ae){return db[_0x3ffc('0x16')][_0x3ffc('0x22')]({'raw':_0x5fc253[_0x3ffc('0x18')]?_0x5fc253['options'][_0x3ffc('0x19')]===undefined?!![]:![]:!![],'where':_0x5fc253[_0x3ffc('0x18')]?_0x5fc253[_0x3ffc('0x18')][_0x3ffc('0x1a')]||null:null,'attributes':_0x5fc253[_0x3ffc('0x18')]?_0x5fc253[_0x3ffc('0x18')][_0x3ffc('0x1b')]||null:null,'include':_0x5fc253[_0x3ffc('0x18')]?_0x5fc253['options'][_0x3ffc('0x1d')]?_[_0x3ffc('0x1e')](_0x5fc253['options']['include'],function(_0x158711){return{'model':db[_0x158711[_0x3ffc('0x1f')]],'as':_0x158711['as'],'attributes':_0x158711[_0x3ffc('0x1b')],'include':_0x158711[_0x3ffc('0x1d')]?_['map'](_0x158711['include'],function(_0x578eed){return{'model':db[_0x578eed[_0x3ffc('0x1f')]],'as':_0x578eed['as'],'attributes':_0x578eed[_0x3ffc('0x1b')],'include':_0x578eed['include']?_['map'](_0x578eed[_0x3ffc('0x1d')],function(_0x5c6765){return{'model':db[_0x5c6765[_0x3ffc('0x1f')]],'as':_0x5c6765['as'],'attributes':_0x5c6765[_0x3ffc('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52478f){logger[_0x3ffc('0xe')](_0x3ffc('0x21'),_0x5fc253);logger[_0x3ffc('0x11')](_0x3ffc('0x21'),_0x5fc253,JSON[_0x3ffc('0x12')](_0x52478f));_0x433c40(_0x52478f);})[_0x3ffc('0x15')](function(_0x3cb238){logger[_0x3ffc('0x13')](_0x3ffc('0x21'),_0x3cb238['message'],_0x5fc253);_0x4f22ae(_0x1cf262[_0x3ffc('0x13')](0x1f4,_0x3cb238[_0x3ffc('0x14')]));});});}; \ No newline at end of file +var _0x850d=['request\x20sent','result','catch','Trigger','options','raw','where','attributes','include','map','model','GetTrigger','debug','ShowTrigger','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x55c34e,_0x50b7e3){var _0x4a9b56=function(_0x8ed81d){while(--_0x8ed81d){_0x55c34e['push'](_0x55c34e['shift']());}};_0x4a9b56(++_0x50b7e3);}(_0x850d,0xda));var _0xd850=function(_0x45397c,_0x24c4f5){_0x45397c=_0x45397c-0x0;var _0x41c704=_0x850d[_0x45397c];return _0x41c704;};'use strict';var _=require('lodash');var util=require(_0xd850('0x0'));var moment=require(_0xd850('0x1'));var BPromise=require('bluebird');var rs=require(_0xd850('0x2'));var fs=require('fs');var Redis=require(_0xd850('0x3'));var db=require(_0xd850('0x4'))['db'];var utils=require(_0xd850('0x5'));var logger=require(_0xd850('0x6'))('rpc');var config=require(_0xd850('0x7'));var jayson=require(_0xd850('0x8'));var client=jayson[_0xd850('0x9')][_0xd850('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7c4aea,_0x26ab23,_0x5c06b3){return new BPromise(function(_0xefb31b,_0x18e768){return client[_0xd850('0xb')](_0x7c4aea,_0x5c06b3)[_0xd850('0xc')](function(_0x4693d1){logger[_0xd850('0xd')](_0xd850('0xe'),_0x26ab23,'request\x20sent');logger['debug'](_0xd850('0xf'),_0x26ab23,'request\x20sent',JSON[_0xd850('0x10')](_0x4693d1));if(_0x4693d1[_0xd850('0x11')]){if(_0x4693d1[_0xd850('0x11')][_0xd850('0x12')]===0x1f4){logger[_0xd850('0x11')]('Trigger,\x20%s,\x20%s',_0x26ab23,_0x4693d1[_0xd850('0x11')][_0xd850('0x13')]);return _0x18e768(_0x4693d1[_0xd850('0x11')][_0xd850('0x13')]);}logger[_0xd850('0x11')]('Trigger,\x20%s,\x20%s',_0x26ab23,_0x4693d1[_0xd850('0x11')][_0xd850('0x13')]);return _0xefb31b(_0x4693d1['error'][_0xd850('0x13')]);}else{logger['info'](_0xd850('0xe'),_0x26ab23,_0xd850('0x14'));_0xefb31b(_0x4693d1[_0xd850('0x15')][_0xd850('0x13')]);}})[_0xd850('0x16')](function(_0x5bee92){logger[_0xd850('0x11')]('Trigger,\x20%s,\x20%s',_0x26ab23,_0x5bee92);_0x18e768(_0x5bee92);});});}exports['GetTrigger']=function(_0x3652ed){var _0x470ed6=this;return new Promise(function(_0x2fee88,_0x5420b7){return db[_0xd850('0x17')]['findAll']({'raw':_0x3652ed['options']?_0x3652ed[_0xd850('0x18')][_0xd850('0x19')]===undefined?!![]:![]:!![],'where':_0x3652ed[_0xd850('0x18')]?_0x3652ed['options'][_0xd850('0x1a')]||null:null,'attributes':_0x3652ed[_0xd850('0x18')]?_0x3652ed[_0xd850('0x18')][_0xd850('0x1b')]||null:null,'limit':_0x3652ed[_0xd850('0x18')]?_0x3652ed[_0xd850('0x18')]['limit']||null:null,'include':_0x3652ed[_0xd850('0x18')]?_0x3652ed[_0xd850('0x18')][_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x3652ed['options'][_0xd850('0x1c')],function(_0x1b069c){return{'model':db[_0x1b069c[_0xd850('0x1e')]],'as':_0x1b069c['as'],'attributes':_0x1b069c['attributes'],'include':_0x1b069c[_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x1b069c['include'],function(_0x40c51a){return{'model':db[_0x40c51a[_0xd850('0x1e')]],'as':_0x40c51a['as'],'attributes':_0x40c51a[_0xd850('0x1b')],'include':_0x40c51a['include']?_['map'](_0x40c51a[_0xd850('0x1c')],function(_0x18d6d7){return{'model':db[_0x18d6d7['model']],'as':_0x18d6d7['as'],'attributes':_0x18d6d7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c56ca){logger[_0xd850('0xd')](_0xd850('0x1f'),_0x3652ed);logger[_0xd850('0x20')](_0xd850('0x1f'),_0x3652ed,JSON[_0xd850('0x10')](_0x5c56ca));_0x2fee88(_0x5c56ca);})[_0xd850('0x16')](function(_0x61f792){logger[_0xd850('0x11')](_0xd850('0x1f'),_0x61f792[_0xd850('0x13')],_0x3652ed);_0x5420b7(_0x470ed6[_0xd850('0x11')](0x1f4,_0x61f792[_0xd850('0x13')]));});});};exports[_0xd850('0x21')]=function(_0x186c2f){var _0x586ac1=this;return new Promise(function(_0x4e1bd4,_0x229fd2){return db[_0xd850('0x17')]['find']({'raw':_0x186c2f[_0xd850('0x18')]?_0x186c2f['options'][_0xd850('0x19')]===undefined?!![]:![]:!![],'where':_0x186c2f[_0xd850('0x18')]?_0x186c2f[_0xd850('0x18')][_0xd850('0x1a')]||null:null,'attributes':_0x186c2f['options']?_0x186c2f[_0xd850('0x18')][_0xd850('0x1b')]||null:null,'include':_0x186c2f[_0xd850('0x18')]?_0x186c2f[_0xd850('0x18')][_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x186c2f['options'][_0xd850('0x1c')],function(_0x9ed981){return{'model':db[_0x9ed981[_0xd850('0x1e')]],'as':_0x9ed981['as'],'attributes':_0x9ed981[_0xd850('0x1b')],'include':_0x9ed981[_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x9ed981[_0xd850('0x1c')],function(_0x50095c){return{'model':db[_0x50095c[_0xd850('0x1e')]],'as':_0x50095c['as'],'attributes':_0x50095c[_0xd850('0x1b')],'include':_0x50095c[_0xd850('0x1c')]?_[_0xd850('0x1d')](_0x50095c[_0xd850('0x1c')],function(_0x129f87){return{'model':db[_0x129f87[_0xd850('0x1e')]],'as':_0x129f87['as'],'attributes':_0x129f87[_0xd850('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd850('0xc')](function(_0x386fd7){logger[_0xd850('0xd')](_0xd850('0x21'),_0x186c2f);logger[_0xd850('0x20')]('ShowTrigger',_0x186c2f,JSON['stringify'](_0x386fd7));_0x4e1bd4(_0x386fd7);})[_0xd850('0x16')](function(_0x48d84a){logger[_0xd850('0x11')](_0xd850('0x21'),_0x48d84a[_0xd850('0x13')],_0x186c2f);_0x229fd2(_0x586ac1[_0xd850('0x11')](0x1f4,_0x48d84a[_0xd850('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ac5b563..d5c5454 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 _0x67e1=['post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','index','get','/:id','show','/:id/clone','clone'];(function(_0x1f6a84,_0x44a188){var _0x14da8a=function(_0x4033b9){while(--_0x4033b9){_0x1f6a84['push'](_0x1f6a84['shift']());}};_0x14da8a(++_0x44a188);}(_0x67e1,0xb5));var _0x167e=function(_0x117221,_0x26aaca){_0x117221=_0x117221-0x0;var _0x3a93bc=_0x67e1[_0x117221];return _0x3a93bc;};'use strict';var multer=require(_0x167e('0x0'));var util=require(_0x167e('0x1'));var path=require(_0x167e('0x2'));var timeout=require(_0x167e('0x3'));var express=require(_0x167e('0x4'));var router=express[_0x167e('0x5')]();var fs_extra=require(_0x167e('0x6'));var auth=require(_0x167e('0x7'));var interaction=require(_0x167e('0x8'));var config=require('../../config/environment');var controller=require(_0x167e('0x9'));router['get']('/',auth[_0x167e('0xa')](),controller[_0x167e('0xb')]);router[_0x167e('0xc')](_0x167e('0xd'),auth['isAuthenticated'](),controller[_0x167e('0xe')]);router['post'](_0x167e('0xf'),auth[_0x167e('0xa')](),controller[_0x167e('0x10')]);router[_0x167e('0x11')]('/',auth[_0x167e('0xa')](),controller[_0x167e('0x12')]);router[_0x167e('0x13')](_0x167e('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x167e('0xd'),auth['isAuthenticated'](),controller[_0x167e('0x14')]);module[_0x167e('0x15')]=router; \ No newline at end of file +var _0x32fc=['/:id','update','delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./trunk.controller','isAuthenticated','show','clone','post','put'];(function(_0x50ce61,_0x4a0267){var _0x5a8e3e=function(_0x3981ba){while(--_0x3981ba){_0x50ce61['push'](_0x50ce61['shift']());}};_0x5a8e3e(++_0x4a0267);}(_0x32fc,0x103));var _0xc32f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x32fc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc32f('0x0'));var timeout=require(_0xc32f('0x1'));var express=require(_0xc32f('0x2'));var router=express[_0xc32f('0x3')]();var fs_extra=require(_0xc32f('0x4'));var auth=require(_0xc32f('0x5'));var interaction=require(_0xc32f('0x6'));var config=require('../../config/environment');var controller=require(_0xc32f('0x7'));router['get']('/',auth[_0xc32f('0x8')](),controller['index']);router['get']('/:id',auth[_0xc32f('0x8')](),controller[_0xc32f('0x9')]);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0xc32f('0xa')]);router[_0xc32f('0xb')]('/',auth[_0xc32f('0x8')](),controller['create']);router[_0xc32f('0xc')](_0xc32f('0xd'),auth[_0xc32f('0x8')](),controller[_0xc32f('0xe')]);router[_0xc32f('0xf')](_0xc32f('0xd'),auth[_0xc32f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index c785c42..0255cbe 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 _0xc844=['join','getDataValue','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\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','originate','fingerprint','certificate','active','passive','actpass','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc844,0x197));var _0x4c84=function(_0x54665f,_0x15a1b5){_0x54665f=_0x54665f-0x0;var _0x1f1d23=_0xc844[_0x54665f];return _0x1f1d23;};'use strict';var Sequelize=require(_0x4c84('0x0'));module[_0x4c84('0x1')]={'name':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![],'unique':_0x4c84('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x5'),_0x4c84('0x6'),_0x4c84('0x7')),'allowNull':![],'defaultValue':_0x4c84('0x5')},'context':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![],'defaultValue':_0x4c84('0x8')},'callingpres':{'type':Sequelize[_0x4c84('0x4')]('ALLOWED_NOT_SCREENED',_0x4c84('0x9'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x4c84('0xa'),_0x4c84('0xb'),'PROHIB_FAILED_SCREEN',_0x4c84('0xc'))},'deny':{'type':Sequelize[_0x4c84('0x2')]},'permit':{'type':Sequelize[_0x4c84('0x2')]},'secret':{'type':Sequelize[_0x4c84('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x4c84('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x4c84('0xd'),'set':function(_0x640ad2){this[_0x4c84('0xe')](_0x4c84('0xf'),_0x640ad2?_0x640ad2['join'](','):null);},'get':function(){return this['getDataValue'](_0x4c84('0xf'))?this['getDataValue'](_0x4c84('0xf'))['split'](','):null;},'comment':_0x4c84('0x10')},'dtmfmode':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x11'),'info',_0x4c84('0x12'),_0x4c84('0x13'),_0x4c84('0x14')),'defaultValue':_0x4c84('0x11')},'directmedia':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no',_0x4c84('0x16'),_0x4c84('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4c84('0x2')]},'directmediadeny':{'type':Sequelize[_0x4c84('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x4c84('0x18'),'set':function(_0x3d31f6){this[_0x4c84('0xe')]('nat',_0x3d31f6?_0x3d31f6[_0x4c84('0x19')](','):null);},'get':function(){return this[_0x4c84('0x1a')](_0x4c84('0x1b'))?this[_0x4c84('0x1a')]('nat')[_0x4c84('0x1c')](','):null;},'comment':_0x4c84('0x1d')},'callgroup':{'type':Sequelize[_0x4c84('0x2')]},'namedcallgroup':{'type':Sequelize[_0x4c84('0x2')]},'pickupgroup':{'type':Sequelize[_0x4c84('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4c84('0x2')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4c84('0x2')],'defaultValue':_0x4c84('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4c84('0x1f'),'set':function(_0xe97fe9){this[_0x4c84('0xe')](_0x4c84('0x20'),_0xe97fe9?_0xe97fe9[_0x4c84('0x19')](';'):_0x4c84('0x1f'));},'get':function(){return this[_0x4c84('0x1a')](_0x4c84('0x20'))?this[_0x4c84('0x1a')]('allow')[_0x4c84('0x1c')](';'):null;},'comment':_0x4c84('0x21')},'autoframing':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no')},'insecure':{'type':Sequelize[_0x4c84('0x2')],'defaultValue':_0x4c84('0x22'),'set':function(_0x269481){this[_0x4c84('0xe')](_0x4c84('0x23'),_0x269481?_0x269481[_0x4c84('0x19')](','):null);},'get':function(){return this['getDataValue'](_0x4c84('0x23'))?this[_0x4c84('0x1a')](_0x4c84('0x23'))[_0x4c84('0x1c')](','):null;},'comment':_0x4c84('0x24')},'trustrpid':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no',_0x4c84('0x25'))},'promiscredir':{'type':Sequelize[_0x4c84('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0x4c84('0x4')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x4c84('0x2')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x4c84('0x4')]('yes','no'),'defaultValue':_0x4c84('0x15')},'busylevel':{'type':Sequelize[_0x4c84('0x26')](0xb)},'allowoverlap':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no')},'allowsubscribe':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4c84('0x4')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x4c84('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no',_0x4c84('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x4c84('0x15'),'no')},'mailbox':{'type':Sequelize[_0x4c84('0x2')]},'session_timers':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x28'),_0x4c84('0x29'),_0x4c84('0x2a'))},'session_expires':{'type':Sequelize[_0x4c84('0x26')](0xb)},'session_minse':{'type':Sequelize[_0x4c84('0x26')](0xb)},'session_refresher':{'type':Sequelize[_0x4c84('0x4')]('uac','uas'),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x4c84('0x2')]},'regexten':{'type':Sequelize[_0x4c84('0x2')]},'fromdomain':{'type':Sequelize[_0x4c84('0x2')]},'fromuser':{'type':Sequelize[_0x4c84('0x2')]},'port':{'type':Sequelize[_0x4c84('0x26')](0x5)},'qualify':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x4c84('0x2')]},'defaultuser':{'type':Sequelize[_0x4c84('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4c84('0x26')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4c84('0x26')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4c84('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x4c84('0x26')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x4c84('0x2')]},'contactacl':{'type':Sequelize[_0x4c84('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4c84('0x2')]},'use_q850_reason':{'type':Sequelize[_0x4c84('0x2')]},'maxforwards':{'type':Sequelize[_0x4c84('0x26')](0xb)},'encryption':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4c84('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x4c84('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no')},'dtlsenable':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no')},'dtlsverify':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no',_0x4c84('0x2b'),_0x4c84('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x4c84('0x26')](0xb)},'dtlscertfile':{'type':Sequelize[_0x4c84('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4c84('0x2')]},'dtlscipher':{'type':Sequelize[_0x4c84('0x2')]},'dtlscafile':{'type':Sequelize[_0x4c84('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x2d'),_0x4c84('0x2e'),_0x4c84('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4c84('0x2')]},'usereqphone':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4c84('0x2')]},'recordofffeature':{'type':Sequelize[_0x4c84('0x2')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4c84('0x4')]('yes','no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x4c84('0x15'),'no')},'vmexten':{'type':Sequelize[_0x4c84('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x4c84('0x2')]},'parkinglot':{'type':Sequelize[_0x4c84('0x2')]},'description':{'type':Sequelize[_0x4c84('0x2')]},'host':{'type':Sequelize[_0x4c84('0x2')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x4c84('0x4')](_0x4c84('0x15'),'no','nonat',_0x4c84('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4c84('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x4c84('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x4cb4=['ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','rfc2833','info','shortinfo','auto','yes','nonat','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER','accept','refuse','originate','uas','pai','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','exports','STRING','name'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4cb4,0xf2));var _0x44cb=function(_0x47c902,_0x220fd2){_0x47c902=_0x47c902-0x0;var _0x1ad6a0=_0x4cb4[_0x47c902];return _0x1ad6a0;};'use strict';var Sequelize=require('sequelize');module[_0x44cb('0x0')]={'name':{'type':Sequelize[_0x44cb('0x1')],'allowNull':![],'unique':_0x44cb('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x4'),_0x44cb('0x5'),_0x44cb('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x44cb('0x7')},'callingpres':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x8'),_0x44cb('0x9'),_0x44cb('0xa'),_0x44cb('0xb'),_0x44cb('0xc'),_0x44cb('0xd'),'PROHIB_FAILED_SCREEN',_0x44cb('0xe'))},'deny':{'type':Sequelize[_0x44cb('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x44cb('0x1')]},'md5secret':{'type':Sequelize[_0x44cb('0x1')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x29f6d9){this[_0x44cb('0xf')]('transport',_0x29f6d9?_0x29f6d9[_0x44cb('0x10')](','):null);},'get':function(){return this[_0x44cb('0x11')](_0x44cb('0x12'))?this['getDataValue'](_0x44cb('0x12'))[_0x44cb('0x13')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x44cb('0x14'),_0x44cb('0x15'),_0x44cb('0x16'),'inband',_0x44cb('0x17')),'defaultValue':_0x44cb('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no',_0x44cb('0x19'),'update','outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x44cb('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x37cb72){this['setDataValue'](_0x44cb('0x1a'),_0x37cb72?_0x37cb72[_0x44cb('0x10')](','):null);},'get':function(){return this[_0x44cb('0x11')](_0x44cb('0x1a'))?this[_0x44cb('0x11')](_0x44cb('0x1a'))[_0x44cb('0x13')](','):null;},'comment':_0x44cb('0x1b')},'callgroup':{'type':Sequelize[_0x44cb('0x1')]},'namedcallgroup':{'type':Sequelize[_0x44cb('0x1')]},'pickupgroup':{'type':Sequelize[_0x44cb('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x44cb('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x44cb('0x1c')},'allow':{'type':Sequelize[_0x44cb('0x1')],'allowNull':![],'defaultValue':_0x44cb('0x1d'),'set':function(_0x5ad073){this[_0x44cb('0xf')](_0x44cb('0x1e'),_0x5ad073?_0x5ad073[_0x44cb('0x10')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x44cb('0x11')]('allow')?this[_0x44cb('0x11')](_0x44cb('0x1e'))[_0x44cb('0x13')](';'):null;},'comment':_0x44cb('0x1f')},'autoframing':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x44cb('0x20'),'set':function(_0x17246d){this[_0x44cb('0xf')]('insecure',_0x17246d?_0x17246d[_0x44cb('0x10')](','):null);},'get':function(){return this[_0x44cb('0x11')](_0x44cb('0x21'))?this[_0x44cb('0x11')]('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0x44cb('0x3')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x44cb('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x44cb('0x1')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x44cb('0x18')},'busylevel':{'type':Sequelize[_0x44cb('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x44cb('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x44cb('0x1')]},'template':{'type':Sequelize[_0x44cb('0x1')]},'videosupport':{'type':Sequelize[_0x44cb('0x3')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x44cb('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'mailbox':{'type':Sequelize[_0x44cb('0x1')]},'session_timers':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x23'),_0x44cb('0x24'),_0x44cb('0x25'))},'session_expires':{'type':Sequelize[_0x44cb('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x44cb('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x44cb('0x3')]('uac',_0x44cb('0x26')),'defaultValue':_0x44cb('0x26')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x44cb('0x1')]},'fromdomain':{'type':Sequelize[_0x44cb('0x1')]},'fromuser':{'type':Sequelize[_0x44cb('0x1')]},'port':{'type':Sequelize[_0x44cb('0x22')](0x5)},'qualify':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':_0x44cb('0x18')},'keepalive':{'type':Sequelize[_0x44cb('0x22')](0xb)},'defaultip':{'type':Sequelize[_0x44cb('0x1')]},'defaultuser':{'type':Sequelize[_0x44cb('0x1')]},'rtptimeout':{'type':Sequelize[_0x44cb('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x44cb('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x44cb('0x22')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no',_0x44cb('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x44cb('0x1')]},'timert1':{'type':Sequelize[_0x44cb('0x22')](0xb)},'timerb':{'type':Sequelize[_0x44cb('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x44cb('0x22')](0xb)},'contactpermit':{'type':Sequelize[_0x44cb('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x44cb('0x1')]},'maxforwards':{'type':Sequelize[_0x44cb('0x22')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'force_avp':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'icesupport':{'type':Sequelize[_0x44cb('0x3')]('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x44cb('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0x44cb('0x3')]('yes','no',_0x44cb('0x28'),_0x44cb('0x29'))},'dtlsrekey':{'type':Sequelize[_0x44cb('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x44cb('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x44cb('0x1')]},'dtlscipher':{'type':Sequelize[_0x44cb('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x2a'),_0x44cb('0x2b'),_0x44cb('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x44cb('0x1')]},'usereqphone':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x44cb('0x1')]},'recordofffeature':{'type':Sequelize[_0x44cb('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x44cb('0x1')]},'mohsuggest':{'type':Sequelize[_0x44cb('0x1')]},'parkinglot':{'type':Sequelize[_0x44cb('0x1')]},'description':{'type':Sequelize[_0x44cb('0x1')]},'host':{'type':Sequelize[_0x44cb('0x1')],'defaultValue':_0x44cb('0x2d')},'canreinvite':{'type':Sequelize[_0x44cb('0x3')](_0x44cb('0x18'),'no',_0x44cb('0x19'),_0x44cb('0x2e'),_0x44cb('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x44cb('0x1')]},'otherFields':{'type':Sequelize[_0x44cb('0x1')]},'active':{'type':Sequelize[_0x44cb('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x44cb('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 8d40e01..a95eee6 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 _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','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','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x5bac10,_0x436643){var _0x362c49=function(_0x28b940){while(--_0x28b940){_0x5bac10['push'](_0x5bac10['shift']());}};_0x362c49(++_0x436643);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1fc6f3,_0x553e11){_0x1fc6f3=_0x1fc6f3-0x0;var _0x3a616b=_0x8d0e[_0x1fc6f3];return _0x3a616b;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file +var _0xf3cd=['length','limit','sort','where','filter','merge','options','Trunk','includeAll','include','findAll','show','find','clone','createdAt','updatedAt','omit','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','utf8','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','userProfileId','autoAssociation','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','json','reject','save','update','get','UserProfileResource','destroy','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields'];(function(_0x8ddc9a,_0x574925){var _0x27d767=function(_0x3c9e33){while(--_0x3c9e33){_0x8ddc9a['push'](_0x8ddc9a['shift']());}};_0x27d767(++_0x574925);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3a60b8,_0x47caab){_0x3a60b8=_0x3a60b8-0x0;var _0x4eb583=_0xf3cd[_0x3a60b8];return _0x4eb583;};'use strict';var emlformat=require(_0xdf3c('0x0'));var rimraf=require(_0xdf3c('0x1'));var zipdir=require(_0xdf3c('0x2'));var jsonpatch=require(_0xdf3c('0x3'));var rp=require(_0xdf3c('0x4'));var moment=require(_0xdf3c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdf3c('0x6'));var util=require(_0xdf3c('0x7'));var path=require(_0xdf3c('0x8'));var sox=require('sox');var csv=require(_0xdf3c('0x9'));var ejs=require(_0xdf3c('0xa'));var fs=require('fs');var fs_extra=require(_0xdf3c('0xb'));var _=require(_0xdf3c('0xc'));var squel=require(_0xdf3c('0xd'));var crypto=require(_0xdf3c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdf3c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdf3c('0x10'));var Redis=require(_0xdf3c('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf3c('0x12'));var as=require(_0xdf3c('0x13'));var hardwareService=require(_0xdf3c('0x14'));var logger=require(_0xdf3c('0x15'))(_0xdf3c('0x16'));var utils=require(_0xdf3c('0x17'));var config=require(_0xdf3c('0x18'));var licenseUtil=require(_0xdf3c('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdf3c('0x1a'));var client=jayson[_0xdf3c('0x1b')][_0xdf3c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x17319c,_0x59e431,_0x2ae4ad,_0x461079){return new BPromise(function(_0x13ea5f,_0x5e0047){var _0x18aafa=_0x461079||client;return _0x18aafa[_0xdf3c('0x1d')](_0x17319c,_0x2ae4ad)[_0xdf3c('0x1e')](function(_0x4274fd){logger[_0xdf3c('0x1f')](_0xdf3c('0x20'),_0x59e431,_0xdf3c('0x21'));logger[_0xdf3c('0x22')](_0xdf3c('0x23'),_0x59e431,_0xdf3c('0x21'),JSON['stringify'](_0x4274fd));if(_0x4274fd[_0xdf3c('0x24')]){if(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x25')]===0x1f4){logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x5e0047(_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);}logger[_0xdf3c('0x24')](_0xdf3c('0x20'),_0x59e431,_0x4274fd[_0xdf3c('0x24')][_0xdf3c('0x26')]);return _0x13ea5f(_0x4274fd['error']['message']);}else{logger[_0xdf3c('0x1f')]('Trunk,\x20%s,\x20%s',_0x59e431,_0xdf3c('0x21'));_0x13ea5f(_0x4274fd[_0xdf3c('0x27')][_0xdf3c('0x26')]);}})[_0xdf3c('0x28')](function(_0x33652f){logger[_0xdf3c('0x24')]('Trunk,\x20%s,\x20%s',_0x59e431,_0x33652f);_0x5e0047(_0x33652f);});});}function respondWithStatusCode(_0x22a164,_0x213d75){_0x213d75=_0x213d75||0xcc;return function(_0x13e3ca){if(_0x13e3ca){return _0x22a164[_0xdf3c('0x29')](_0x213d75);}return _0x22a164[_0xdf3c('0x2a')](_0x213d75)[_0xdf3c('0x2b')]();};}function respondWithResult(_0xef54cb,_0x155f54){_0x155f54=_0x155f54||0xc8;return function(_0x18cb46){if(_0x18cb46){return _0xef54cb[_0xdf3c('0x2a')](_0x155f54)['json'](_0x18cb46);}};}function respondWithFilteredResult(_0xd284d7,_0x153daa){return function(_0x4b57a4){if(_0x4b57a4){var _0xdc8962=typeof _0x153daa['offset']==='undefined'&&typeof _0x153daa['limit']===_0xdf3c('0x2c');var _0x186bba=_0x4b57a4['count'];var _0x5c3b5a=_0xdc8962?0x0:_0x153daa[_0xdf3c('0x2d')];var _0x1f2ce4=_0xdc8962?_0x4b57a4[_0xdf3c('0x2e')]:_0x153daa[_0xdf3c('0x2d')]+_0x153daa['limit'];var _0x43ce06;if(_0x1f2ce4>=_0x186bba){_0x1f2ce4=_0x186bba;_0x43ce06=0xc8;}else{_0x43ce06=0xce;}_0xd284d7[_0xdf3c('0x2a')](_0x43ce06);return _0xd284d7['set']('Content-Range',_0x5c3b5a+'-'+_0x1f2ce4+'/'+_0x186bba)[_0xdf3c('0x2f')](_0x4b57a4);}return null;};}function patchUpdates(_0x46f0e3){return function(_0x36937e){try{jsonpatch['apply'](_0x36937e,_0x46f0e3,!![]);}catch(_0x2355f6){return BPromise[_0xdf3c('0x30')](_0x2355f6);}return _0x36937e[_0xdf3c('0x31')]();};}function saveUpdates(_0x10099e,_0x575ae1){return function(_0xda0de0){if(_0xda0de0){return _0xda0de0[_0xdf3c('0x32')](_0x10099e)['then'](function(_0x40ae3d){return _0x40ae3d;});}return null;};}function removeEntity(_0x3daeda,_0x217a65){return function(_0x2287f){if(_0x2287f){return _0x2287f['destroy']()[_0xdf3c('0x1e')](function(){var _0x360d5c=_0x2287f[_0xdf3c('0x33')]({'plain':!![]});var _0x3b9ce8='Trunks';return db[_0xdf3c('0x34')][_0xdf3c('0x35')]({'where':{'type':_0x3b9ce8,'resourceId':_0x360d5c['id']}})['then'](function(){return _0x2287f;});})['then'](function(){_0x3daeda[_0xdf3c('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x216115,_0x5e8130){return function(_0x57faba){if(!_0x57faba){_0x216115['sendStatus'](0x194);}return _0x57faba;};}function handleError(_0x44a478,_0x2ee9ad){_0x2ee9ad=_0x2ee9ad||0x1f4;return function(_0x1d0b8a){logger[_0xdf3c('0x24')](_0x1d0b8a['stack']);if(_0x1d0b8a['name']){delete _0x1d0b8a[_0xdf3c('0x36')];}_0x44a478['status'](_0x2ee9ad)[_0xdf3c('0x37')](_0x1d0b8a);};}exports[_0xdf3c('0x38')]=function(_0x3628ae,_0xcdd731){var _0x1004e9={},_0x1e0cf2={},_0x1c7335={'count':0x0,'rows':[]};var _0x809f3d=_[_0xdf3c('0x39')](db['Trunk'][_0xdf3c('0x3a')],function(_0x54e689){return{'name':_0x54e689['fieldName'],'type':_0x54e689[_0xdf3c('0x3b')]['key']};});_0x1e0cf2[_0xdf3c('0x3c')]=_['map'](_0x809f3d,_0xdf3c('0x36'));_0x1e0cf2[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x3628ae[_0xdf3c('0x3d')]);_0x1e0cf2[_0xdf3c('0x3f')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],_0x1e0cf2[_0xdf3c('0x3d')]);_0x1004e9[_0xdf3c('0x41')]=_[_0xdf3c('0x40')](_0x1e0cf2[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x3628ae['query']['fields']));_0x1004e9[_0xdf3c('0x41')]=_0x1004e9['attributes'][_0xdf3c('0x43')]?_0x1004e9[_0xdf3c('0x41')]:_0x1e0cf2[_0xdf3c('0x3c')];if(!_0x3628ae[_0xdf3c('0x3d')]['hasOwnProperty']('nolimit')){_0x1004e9[_0xdf3c('0x44')]=qs[_0xdf3c('0x44')](_0x3628ae[_0xdf3c('0x3d')]['limit']);_0x1004e9[_0xdf3c('0x2d')]=qs[_0xdf3c('0x2d')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x2d')]);}_0x1004e9['order']=qs[_0xdf3c('0x45')](_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x45')]);_0x1004e9[_0xdf3c('0x46')]=qs[_0xdf3c('0x3f')](_['pick'](_0x3628ae[_0xdf3c('0x3d')],_0x1e0cf2[_0xdf3c('0x3f')]),_0x809f3d);if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]){_0x1004e9[_0xdf3c('0x46')]=_[_0xdf3c('0x48')](_0x1004e9['where'],{'$or':_['map'](_0x809f3d,function(_0x2c6c6d){if(_0x2c6c6d[_0xdf3c('0x3b')]!=='VIRTUAL'){var _0x5c9885={};_0x5c9885[_0x2c6c6d[_0xdf3c('0x36')]]={'$like':'%'+_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x47')]+'%'};return _0x5c9885;}})});}_0x1004e9=_[_0xdf3c('0x48')]({},_0x1004e9,_0x3628ae[_0xdf3c('0x49')]);var _0x2dbf54={'where':_0x1004e9[_0xdf3c('0x46')]};return db[_0xdf3c('0x4a')][_0xdf3c('0x2e')](_0x2dbf54)['then'](function(_0x129c2a){_0x1c7335[_0xdf3c('0x2e')]=_0x129c2a;if(_0x3628ae[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x1004e9[_0xdf3c('0x4c')]=[{'all':!![]}];}return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')](_0x1004e9);})['then'](function(_0x1751a8){_0x1c7335['rows']=_0x1751a8;return _0x1c7335;})[_0xdf3c('0x1e')](respondWithFilteredResult(_0xcdd731,_0x1004e9))['catch'](handleError(_0xcdd731,null));};exports[_0xdf3c('0x4e')]=function(_0x28144f,_0x2ec575){var _0x94c5b9={'raw':![],'where':{'id':_0x28144f['params']['id']}},_0x5eef94={};_0x5eef94['model']=_[_0xdf3c('0x3e')](db['Trunk'][_0xdf3c('0x3a')]);_0x5eef94[_0xdf3c('0x3d')]=_[_0xdf3c('0x3e')](_0x28144f[_0xdf3c('0x3d')]);_0x5eef94[_0xdf3c('0x3f')]=_['intersection'](_0x5eef94['model'],_0x5eef94[_0xdf3c('0x3d')]);_0x94c5b9[_0xdf3c('0x41')]=_['intersection'](_0x5eef94[_0xdf3c('0x3c')],qs[_0xdf3c('0x42')](_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x94c5b9[_0xdf3c('0x41')]=_0x94c5b9[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x94c5b9['attributes']:_0x5eef94['model'];if(_0x28144f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x94c5b9[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x94c5b9=_[_0xdf3c('0x48')]({},_0x94c5b9,_0x28144f[_0xdf3c('0x49')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x94c5b9)[_0xdf3c('0x1e')](handleEntityNotFound(_0x2ec575,null))[_0xdf3c('0x1e')](respondWithResult(_0x2ec575,null))[_0xdf3c('0x28')](handleError(_0x2ec575,null));};exports[_0xdf3c('0x50')]=function(_0x4cb28f,_0x1eebcf){var _0x47cb74={'where':{'id':_0x4cb28f['params']['id']}},_0x5e7247={};_0x5e7247['model']=_['keys'](db[_0xdf3c('0x4a')][_0xdf3c('0x3a')]);_0x47cb74['attributes']=_[_0xdf3c('0x40')](_0x5e7247[_0xdf3c('0x3c')],qs['fields'](_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x42')]));_0x47cb74[_0xdf3c('0x41')]=_0x47cb74[_0xdf3c('0x41')][_0xdf3c('0x43')]?_0x47cb74[_0xdf3c('0x41')]:_0x5e7247[_0xdf3c('0x3c')];if(_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]){_0x47cb74[_0xdf3c('0x4c')]=[{'all':!![]}];}_0x47cb74=_[_0xdf3c('0x48')]({},_0x47cb74,_0x4cb28f['options']);return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')](_0x47cb74)[_0xdf3c('0x1e')](handleEntityNotFound(_0x1eebcf,null))['then'](function(_0x245c68){if(_0x245c68){var _0x3e327e=_0x245c68[_0xdf3c('0x33')]({'plain':!![]});_0x3e327e=qs['omit'](_0x3e327e,['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);_0x4cb28f['body']=_[_0xdf3c('0x53')](_0x4cb28f['body'],['id',_0xdf3c('0x51'),_0xdf3c('0x52')]);return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_[_0xdf3c('0x48')](_0x3e327e,_0x4cb28f[_0xdf3c('0x55')]),{'include':_0x4cb28f[_0xdf3c('0x3d')][_0xdf3c('0x4b')]?[{'all':!![]}]:undefined})[_0xdf3c('0x1e')](function(_0x330730){var _0x283be2=_0x4cb28f[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x283be2)throw new Error(_0xdf3c('0x57'));if(_0x283be2[_0xdf3c('0x58')]===_0xdf3c('0x56')){var _0xd7fb2d=_0x330730['get']({'plain':!![]});var _0x4dade5=_0xdf3c('0x59');return db[_0xdf3c('0x5a')][_0xdf3c('0x4f')]({'where':{'name':_0x4dade5,'userProfileId':_0x283be2['userProfileId']},'raw':!![]})[_0xdf3c('0x1e')](function(_0x5f2765){if(_0x5f2765&&_0x5f2765['autoAssociation']===0x0){return db[_0xdf3c('0x34')][_0xdf3c('0x54')]({'name':_0xd7fb2d[_0xdf3c('0x36')],'resourceId':_0xd7fb2d['id'],'type':_0x5f2765[_0xdf3c('0x36')],'sectionId':_0x5f2765['id']},{})[_0xdf3c('0x1e')](function(){return _0x330730;});}else{return _0x330730;}})[_0xdf3c('0x28')](function(_0x1a31d7){logger[_0xdf3c('0x24')](_0xdf3c('0x5b'),_0x1a31d7);throw _0x1a31d7;});}return _0x330730;});}})[_0xdf3c('0x1e')](respondWithResult(_0x1eebcf,0xc9))[_0xdf3c('0x28')](handleError(_0x1eebcf,null));};exports[_0xdf3c('0x54')]=function(_0x34000c,_0x4be79a,_0x3febac){var _0x2cb0f5;return db[_0xdf3c('0x4a')][_0xdf3c('0x54')](_0x34000c[_0xdf3c('0x55')],{'raw':!![]})['then'](function(_0x18bf4f){_0x2cb0f5=_0x18bf4f;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x1efa9c){var _0x50805c=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x5f')),'utf8');var _0xb867a1=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x19c851=ejs['render'](_0x50805c,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x19c851);if(_0x2cb0f5['registry']){var _0x52a2e1=ejs[_0xdf3c('0x64')](_0xb867a1,{'trunks':_0x1efa9c||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x52a2e1);}})[_0xdf3c('0x1e')](function(){return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x54'),{'module':_0xdf3c('0x67')});})[_0xdf3c('0x1e')](function(){var _0x5e6606=_0x34000c[_0xdf3c('0x56')][_0xdf3c('0x33')]({'plain':!![]});if(!_0x5e6606)throw new Error(_0xdf3c('0x57'));if(_0x5e6606['role']===_0xdf3c('0x56')){var _0x354ff4=_0x2cb0f5[_0xdf3c('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xdf3c('0x4f')]({'where':{'name':_0xdf3c('0x59'),'userProfileId':_0x5e6606[_0xdf3c('0x68')]},'raw':!![]})[_0xdf3c('0x1e')](function(_0xe01538){if(_0xe01538&&_0xe01538[_0xdf3c('0x69')]===0x0){return db['UserProfileResource']['create']({'name':_0x354ff4['name'],'resourceId':_0x354ff4['id'],'type':_0xe01538['name'],'sectionId':_0xe01538['id']},{})['then'](function(){return _0x2cb0f5;});}else{return _0x2cb0f5;}})[_0xdf3c('0x28')](function(_0x3f43a0){logger[_0xdf3c('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3f43a0);throw _0x3f43a0;});}return _0x2cb0f5;})[_0xdf3c('0x1e')](respondWithResult(_0x4be79a,0xc9))[_0xdf3c('0x28')](handleError(_0x4be79a,null));};exports[_0xdf3c('0x32')]=function(_0x51e8c6,_0x591936,_0x233718){var _0x4e3517;return db[_0xdf3c('0x4a')]['find']({'where':{'id':_0x51e8c6[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x591936,null))[_0xdf3c('0x1e')](saveUpdates(_0x51e8c6[_0xdf3c('0x55')],null))['then'](function(_0x5148f6){if(_0x5148f6){_0x4e3517=_0x5148f6;return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});}})[_0xdf3c('0x1e')](function(_0x12a7b0){if(_0x12a7b0){var _0x39d9f0=fs[_0xdf3c('0x5c')](path['join'](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x9c761a=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/registry.ejs'),_0xdf3c('0x61'));var _0x5c27cc=ejs[_0xdf3c('0x64')](_0x39d9f0,{'trunks':_0x12a7b0||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x5c27cc);var _0x53b0c3=ejs['render'](_0x9c761a,{'trunks':_0x12a7b0||[]});fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x53b0c3);return respondWithRpcPromise(_0xdf3c('0x66'),_0xdf3c('0x32'),{'module':_0xdf3c('0x67')});}return null;})[_0xdf3c('0x1e')](function(_0x5c8e5e){if(_0x5c8e5e){return _0x4e3517;}})[_0xdf3c('0x1e')](respondWithResult(_0x591936,null))['catch'](handleError(_0x591936,null));};exports[_0xdf3c('0x35')]=function(_0x389708,_0x2e5f82,_0x15a057){var _0x320452;return db[_0xdf3c('0x4a')][_0xdf3c('0x4f')]({'where':{'id':_0x389708[_0xdf3c('0x6a')]['id']}})[_0xdf3c('0x1e')](handleEntityNotFound(_0x2e5f82,null))[_0xdf3c('0x1e')](removeEntity(_0x2e5f82,null))[_0xdf3c('0x1e')](function(){return db[_0xdf3c('0x4a')][_0xdf3c('0x4d')]({'raw':!![]});})[_0xdf3c('0x1e')](function(_0x55fd73){var _0x118ab5=fs[_0xdf3c('0x5c')](path[_0xdf3c('0x5d')](config[_0xdf3c('0x5e')],'server/files/templates/trunk.ejs'),_0xdf3c('0x61'));var _0x1c8fe4=fs['readFileSync'](path['join'](config[_0xdf3c('0x5e')],_0xdf3c('0x60')),_0xdf3c('0x61'));var _0x1aaf8b=ejs[_0xdf3c('0x64')](_0x118ab5,{'trunks':_0x55fd73});var _0x56fc77=ejs[_0xdf3c('0x64')](_0x1c8fe4,{'trunks':_0x55fd73});fs[_0xdf3c('0x62')](_0xdf3c('0x63'),_0x1aaf8b);fs[_0xdf3c('0x62')](_0xdf3c('0x65'),_0x56fc77);return respondWithRpcPromise(_0xdf3c('0x66'),'destroy',{'module':_0xdf3c('0x67')});})[_0xdf3c('0x28')](handleError(_0x2e5f82,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 40d9ad0..cb845b7 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 _0xab8d=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash'];(function(_0x145108,_0x2ed815){var _0x4b40e5=function(_0x48fb74){while(--_0x48fb74){_0x145108['push'](_0x145108['shift']());}};_0x4b40e5(++_0x2ed815);}(_0xab8d,0xbf));var _0xdab8=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xab8d[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xdab8('0x0'));var util=require(_0xdab8('0x1'));var logger=require(_0xdab8('0x2'))('api');var moment=require(_0xdab8('0x3'));var BPromise=require(_0xdab8('0x4'));var rp=require(_0xdab8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdab8('0x6'));var config=require(_0xdab8('0x7'));var attributes=require(_0xdab8('0x8'));module[_0xdab8('0x9')]=function(_0x10a2fb,_0xc17091){return _0x10a2fb[_0xdab8('0xa')]('Trunk',attributes,{'tableName':_0xdab8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd5a=['api','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util'];(function(_0x5c5b2f,_0x560121){var _0x553cf5=function(_0x1b50ec){while(--_0x1b50ec){_0x5c5b2f['push'](_0x5c5b2f['shift']());}};_0x553cf5(++_0x560121);}(_0xbd5a,0x15c));var _0xabd5=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xbd5a[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xabd5('0x0'));var util=require(_0xabd5('0x1'));var logger=require('../../config/logger')(_0xabd5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xabd5('0x3'));var rimraf=require(_0xabd5('0x4'));var config=require(_0xabd5('0x5'));var attributes=require(_0xabd5('0x6'));module[_0xabd5('0x7')]=function(_0x13d977,_0x2fa5dc){return _0x13d977['define'](_0xabd5('0x8'),attributes,{'tableName':_0xabd5('0x9'),'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 e2e1eda..5033400 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 _0xff15=['include','map','model','then','stringify','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','code','Trunk,\x20%s,\x20%s','message','info','result','catch','GetTrunk','options','raw','attributes','limit'];(function(_0x3f4f3b,_0x2d7be2){var _0xfc6f02=function(_0x226ae2){while(--_0x226ae2){_0x3f4f3b['push'](_0x3f4f3b['shift']());}};_0xfc6f02(++_0x2d7be2);}(_0xff15,0x188));var _0x5ff1=function(_0x2a5b3b,_0x4ebe31){_0x2a5b3b=_0x2a5b3b-0x0;var _0xae665a=_0xff15[_0x2a5b3b];return _0xae665a;};'use strict';var _=require(_0x5ff1('0x0'));var util=require(_0x5ff1('0x1'));var moment=require(_0x5ff1('0x2'));var BPromise=require(_0x5ff1('0x3'));var rs=require(_0x5ff1('0x4'));var fs=require('fs');var Redis=require(_0x5ff1('0x5'));var db=require(_0x5ff1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ff1('0x7'))(_0x5ff1('0x8'));var config=require(_0x5ff1('0x9'));var jayson=require(_0x5ff1('0xa'));var client=jayson[_0x5ff1('0xb')][_0x5ff1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x217552,_0x3f4208,_0x265915){return new BPromise(function(_0x7829e,_0x47d8b7){return client[_0x5ff1('0xd')](_0x217552,_0x265915)['then'](function(_0x4da19f){logger['info']('Trunk,\x20%s,\x20%s',_0x3f4208,_0x5ff1('0xe'));logger[_0x5ff1('0xf')]('Trunk,\x20%s,\x20%s,\x20%s',_0x3f4208,'request\x20sent',JSON['stringify'](_0x4da19f));if(_0x4da19f['error']){if(_0x4da19f[_0x5ff1('0x10')][_0x5ff1('0x11')]===0x1f4){logger[_0x5ff1('0x10')](_0x5ff1('0x12'),_0x3f4208,_0x4da19f[_0x5ff1('0x10')]['message']);return _0x47d8b7(_0x4da19f[_0x5ff1('0x10')][_0x5ff1('0x13')]);}logger[_0x5ff1('0x10')](_0x5ff1('0x12'),_0x3f4208,_0x4da19f['error']['message']);return _0x7829e(_0x4da19f[_0x5ff1('0x10')][_0x5ff1('0x13')]);}else{logger[_0x5ff1('0x14')](_0x5ff1('0x12'),_0x3f4208,_0x5ff1('0xe'));_0x7829e(_0x4da19f[_0x5ff1('0x15')]['message']);}})[_0x5ff1('0x16')](function(_0x2b233f){logger[_0x5ff1('0x10')](_0x5ff1('0x12'),_0x3f4208,_0x2b233f);_0x47d8b7(_0x2b233f);});});}exports[_0x5ff1('0x17')]=function(_0x28be4b){var _0x228e99=this;return new Promise(function(_0xdd8280,_0x74af23){return db['Trunk']['findAll']({'raw':_0x28be4b['options']?_0x28be4b[_0x5ff1('0x18')][_0x5ff1('0x19')]===undefined?!![]:![]:!![],'where':_0x28be4b['options']?_0x28be4b[_0x5ff1('0x18')]['where']||null:null,'attributes':_0x28be4b['options']?_0x28be4b[_0x5ff1('0x18')][_0x5ff1('0x1a')]||null:null,'limit':_0x28be4b[_0x5ff1('0x18')]?_0x28be4b[_0x5ff1('0x18')][_0x5ff1('0x1b')]||null:null,'include':_0x28be4b[_0x5ff1('0x18')]?_0x28be4b[_0x5ff1('0x18')][_0x5ff1('0x1c')]?_[_0x5ff1('0x1d')](_0x28be4b[_0x5ff1('0x18')]['include'],function(_0x3684ea){return{'model':db[_0x3684ea[_0x5ff1('0x1e')]],'as':_0x3684ea['as'],'attributes':_0x3684ea[_0x5ff1('0x1a')],'include':_0x3684ea[_0x5ff1('0x1c')]?_[_0x5ff1('0x1d')](_0x3684ea['include'],function(_0x34c871){return{'model':db[_0x34c871['model']],'as':_0x34c871['as'],'attributes':_0x34c871[_0x5ff1('0x1a')],'include':_0x34c871[_0x5ff1('0x1c')]?_[_0x5ff1('0x1d')](_0x34c871[_0x5ff1('0x1c')],function(_0x20118e){return{'model':db[_0x20118e['model']],'as':_0x20118e['as'],'attributes':_0x20118e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ff1('0x1f')](function(_0x5818ed){logger['info']('GetTrunk',_0x28be4b);logger[_0x5ff1('0xf')](_0x5ff1('0x17'),_0x28be4b,JSON[_0x5ff1('0x20')](_0x5818ed));_0xdd8280(_0x5818ed);})['catch'](function(_0x2afd9e){logger['error'](_0x5ff1('0x17'),_0x2afd9e[_0x5ff1('0x13')],_0x28be4b);_0x74af23(_0x228e99[_0x5ff1('0x10')](0x1f4,_0x2afd9e[_0x5ff1('0x13')]));});});};exports[_0x5ff1('0x21')]=function(_0x184e42){var _0x532daa=this;return new Promise(function(_0x1bfba4,_0x1e29c4){return db['Trunk']['find']({'raw':_0x184e42[_0x5ff1('0x18')]?_0x184e42[_0x5ff1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x184e42['options']?_0x184e42[_0x5ff1('0x18')][_0x5ff1('0x22')]||null:null,'attributes':_0x184e42[_0x5ff1('0x18')]?_0x184e42['options'][_0x5ff1('0x1a')]||null:null,'include':_0x184e42[_0x5ff1('0x18')]?_0x184e42[_0x5ff1('0x18')][_0x5ff1('0x1c')]?_[_0x5ff1('0x1d')](_0x184e42[_0x5ff1('0x18')][_0x5ff1('0x1c')],function(_0x51d1d2){return{'model':db[_0x51d1d2[_0x5ff1('0x1e')]],'as':_0x51d1d2['as'],'attributes':_0x51d1d2['attributes'],'include':_0x51d1d2['include']?_[_0x5ff1('0x1d')](_0x51d1d2[_0x5ff1('0x1c')],function(_0x5c4cf1){return{'model':db[_0x5c4cf1[_0x5ff1('0x1e')]],'as':_0x5c4cf1['as'],'attributes':_0x5c4cf1[_0x5ff1('0x1a')],'include':_0x5c4cf1['include']?_[_0x5ff1('0x1d')](_0x5c4cf1[_0x5ff1('0x1c')],function(_0x42650c){return{'model':db[_0x42650c[_0x5ff1('0x1e')]],'as':_0x42650c['as'],'attributes':_0x42650c['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ff1('0x1f')](function(_0x201f5f){logger['info'](_0x5ff1('0x21'),_0x184e42);logger['debug'](_0x5ff1('0x21'),_0x184e42,JSON[_0x5ff1('0x20')](_0x201f5f));_0x1bfba4(_0x201f5f);})[_0x5ff1('0x16')](function(_0x8ec501){logger[_0x5ff1('0x10')](_0x5ff1('0x21'),_0x8ec501[_0x5ff1('0x13')],_0x184e42);_0x1e29c4(_0x532daa[_0x5ff1('0x10')](0x1f4,_0x8ec501[_0x5ff1('0x13')]));});});}; \ No newline at end of file +var _0x8e3c=['attributes','limit','include','map','model','GetTrunk','catch','ShowTrunk','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','Trunk','findAll','options','raw'];(function(_0x1d3062,_0x3dcbe2){var _0x581c72=function(_0x204c60){while(--_0x204c60){_0x1d3062['push'](_0x1d3062['shift']());}};_0x581c72(++_0x3dcbe2);}(_0x8e3c,0x14e));var _0xc8e3=function(_0x33a6b0,_0x1a54fe){_0x33a6b0=_0x33a6b0-0x0;var _0xee3433=_0x8e3c[_0x33a6b0];return _0xee3433;};'use strict';var _=require(_0xc8e3('0x0'));var util=require(_0xc8e3('0x1'));var moment=require(_0xc8e3('0x2'));var BPromise=require(_0xc8e3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8e3('0x4'));var db=require(_0xc8e3('0x5'))['db'];var utils=require(_0xc8e3('0x6'));var logger=require(_0xc8e3('0x7'))(_0xc8e3('0x8'));var config=require(_0xc8e3('0x9'));var jayson=require(_0xc8e3('0xa'));var client=jayson[_0xc8e3('0xb')][_0xc8e3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1aee6c,_0x1e29df,_0x4cee22){return new BPromise(function(_0x8681bb,_0x4db1ef){return client[_0xc8e3('0xd')](_0x1aee6c,_0x4cee22)[_0xc8e3('0xe')](function(_0x59d2a7){logger[_0xc8e3('0xf')](_0xc8e3('0x10'),_0x1e29df,_0xc8e3('0x11'));logger[_0xc8e3('0x12')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1e29df,'request\x20sent',JSON[_0xc8e3('0x13')](_0x59d2a7));if(_0x59d2a7[_0xc8e3('0x14')]){if(_0x59d2a7[_0xc8e3('0x14')]['code']===0x1f4){logger[_0xc8e3('0x14')](_0xc8e3('0x10'),_0x1e29df,_0x59d2a7['error']['message']);return _0x4db1ef(_0x59d2a7['error'][_0xc8e3('0x15')]);}logger[_0xc8e3('0x14')](_0xc8e3('0x10'),_0x1e29df,_0x59d2a7[_0xc8e3('0x14')][_0xc8e3('0x15')]);return _0x8681bb(_0x59d2a7[_0xc8e3('0x14')][_0xc8e3('0x15')]);}else{logger['info'](_0xc8e3('0x10'),_0x1e29df,'request\x20sent');_0x8681bb(_0x59d2a7['result'][_0xc8e3('0x15')]);}})['catch'](function(_0x1a363c){logger[_0xc8e3('0x14')](_0xc8e3('0x10'),_0x1e29df,_0x1a363c);_0x4db1ef(_0x1a363c);});});}exports['GetTrunk']=function(_0x3545f7){var _0x30ebf0=this;return new Promise(function(_0x5d3a8c,_0x40660b){return db[_0xc8e3('0x16')][_0xc8e3('0x17')]({'raw':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7['options']['where']||null:null,'attributes':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x1a')]||null:null,'limit':_0x3545f7['options']?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x1b')]||null:null,'include':_0x3545f7[_0xc8e3('0x18')]?_0x3545f7[_0xc8e3('0x18')][_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x3545f7['options'][_0xc8e3('0x1c')],function(_0x53a00c){return{'model':db[_0x53a00c[_0xc8e3('0x1e')]],'as':_0x53a00c['as'],'attributes':_0x53a00c[_0xc8e3('0x1a')],'include':_0x53a00c[_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x53a00c['include'],function(_0x9f5ba){return{'model':db[_0x9f5ba[_0xc8e3('0x1e')]],'as':_0x9f5ba['as'],'attributes':_0x9f5ba[_0xc8e3('0x1a')],'include':_0x9f5ba[_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x9f5ba['include'],function(_0x5a4068){return{'model':db[_0x5a4068[_0xc8e3('0x1e')]],'as':_0x5a4068['as'],'attributes':_0x5a4068[_0xc8e3('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d3300){logger[_0xc8e3('0xf')](_0xc8e3('0x1f'),_0x3545f7);logger[_0xc8e3('0x12')](_0xc8e3('0x1f'),_0x3545f7,JSON[_0xc8e3('0x13')](_0x2d3300));_0x5d3a8c(_0x2d3300);})[_0xc8e3('0x20')](function(_0x8bdd7e){logger[_0xc8e3('0x14')](_0xc8e3('0x1f'),_0x8bdd7e['message'],_0x3545f7);_0x40660b(_0x30ebf0[_0xc8e3('0x14')](0x1f4,_0x8bdd7e[_0xc8e3('0x15')]));});});};exports[_0xc8e3('0x21')]=function(_0x3a2c61){var _0x537208=this;return new Promise(function(_0x376aba,_0x457553){return db[_0xc8e3('0x16')][_0xc8e3('0x22')]({'raw':_0x3a2c61[_0xc8e3('0x18')]?_0x3a2c61[_0xc8e3('0x18')][_0xc8e3('0x19')]===undefined?!![]:![]:!![],'where':_0x3a2c61[_0xc8e3('0x18')]?_0x3a2c61[_0xc8e3('0x18')][_0xc8e3('0x23')]||null:null,'attributes':_0x3a2c61[_0xc8e3('0x18')]?_0x3a2c61['options'][_0xc8e3('0x1a')]||null:null,'include':_0x3a2c61['options']?_0x3a2c61['options'][_0xc8e3('0x1c')]?_['map'](_0x3a2c61[_0xc8e3('0x18')][_0xc8e3('0x1c')],function(_0x2af839){return{'model':db[_0x2af839[_0xc8e3('0x1e')]],'as':_0x2af839['as'],'attributes':_0x2af839[_0xc8e3('0x1a')],'include':_0x2af839['include']?_[_0xc8e3('0x1d')](_0x2af839[_0xc8e3('0x1c')],function(_0x23d48a){return{'model':db[_0x23d48a[_0xc8e3('0x1e')]],'as':_0x23d48a['as'],'attributes':_0x23d48a[_0xc8e3('0x1a')],'include':_0x23d48a[_0xc8e3('0x1c')]?_[_0xc8e3('0x1d')](_0x23d48a[_0xc8e3('0x1c')],function(_0x36026c){return{'model':db[_0x36026c[_0xc8e3('0x1e')]],'as':_0x36026c['as'],'attributes':_0x36026c[_0xc8e3('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc8e3('0xe')](function(_0x12f07e){logger['info'](_0xc8e3('0x21'),_0x3a2c61);logger[_0xc8e3('0x12')]('ShowTrunk',_0x3a2c61,JSON['stringify'](_0x12f07e));_0x376aba(_0x12f07e);})['catch'](function(_0x95e504){logger[_0xc8e3('0x14')](_0xc8e3('0x21'),_0x95e504['message'],_0x3a2c61);_0x457553(_0x537208[_0xc8e3('0x14')](0x1f4,_0x95e504['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 032765b..8091fc5 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 _0x87d1=['getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','create','bulkCreate','addQueues','root','server/files/images/','format','%s-%s','originalname','single','file','login','/:id/logout','logout','/:id/pause','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','/:id/api_key','put','/:id','/:id/password','changePassword','delete','removeQueues','destroy','removeMailInteractions','removeFaxInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./user.controller','get','/describe','/whoami','isAuthenticated','whoami','/presence','/:id/avatar','getOpenTabs','/:id/contacts','/:id/queues'];(function(_0x5df847,_0xc5f6c2){var _0x5a71e0=function(_0xa19898){while(--_0xa19898){_0x5df847['push'](_0x5df847['shift']());}};_0x5a71e0(++_0xc5f6c2);}(_0x87d1,0x1f2));var _0x187d=function(_0x1d0d5b,_0x3a2340){_0x1d0d5b=_0x1d0d5b-0x0;var _0xbea5c7=_0x87d1[_0x1d0d5b];return _0xbea5c7;};'use strict';var multer=require(_0x187d('0x0'));var util=require(_0x187d('0x1'));var path=require(_0x187d('0x2'));var timeout=require(_0x187d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x187d('0x4'));var interaction=require(_0x187d('0x5'));var config=require('../../config/environment');var controller=require(_0x187d('0x6'));router[_0x187d('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x187d('0x7')](_0x187d('0x8'),auth['isAuthenticated'](),controller['describe']);router[_0x187d('0x7')](_0x187d('0x9'),auth[_0x187d('0xa')](),controller[_0x187d('0xb')]);router[_0x187d('0x7')](_0x187d('0xc'),auth[_0x187d('0xa')](),controller['getPresence']);router[_0x187d('0x7')]('/:id',auth[_0x187d('0xa')](),controller['show']);router[_0x187d('0x7')](_0x187d('0xd'),controller['getAvatar']);router[_0x187d('0x7')]('/:id/open_tabs',auth[_0x187d('0xa')](),controller[_0x187d('0xe')]);router[_0x187d('0x7')](_0x187d('0xf'),auth[_0x187d('0xa')](),controller['getContacts']);router[_0x187d('0x7')](_0x187d('0x10'),auth[_0x187d('0xa')](),controller[_0x187d('0x11')]);router['get'](_0x187d('0x12'),auth[_0x187d('0xa')](),controller[_0x187d('0x13')]);router[_0x187d('0x7')]('/:id/groups',auth['isAuthenticated'](),controller[_0x187d('0x14')]);router['get'](_0x187d('0x15'),auth['isAuthenticated'](),controller['getRecordings']);router[_0x187d('0x7')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0x187d('0x16')]);router[_0x187d('0x7')](_0x187d('0x17'),auth[_0x187d('0xa')](),controller[_0x187d('0x18')]);router[_0x187d('0x7')](_0x187d('0x19'),auth[_0x187d('0xa')](),controller[_0x187d('0x1a')]);router[_0x187d('0x7')](_0x187d('0x1b'),auth[_0x187d('0xa')](),controller[_0x187d('0x1c')]);router[_0x187d('0x7')](_0x187d('0x1d'),auth['isAuthenticated'](),controller['getSmsInteractions']);router[_0x187d('0x7')](_0x187d('0x1e'),auth['isAuthenticated'](),controller[_0x187d('0x1f')]);router[_0x187d('0x7')](_0x187d('0x20'),auth['isAuthenticated'](),controller[_0x187d('0x21')]);router[_0x187d('0x7')](_0x187d('0x22'),auth[_0x187d('0xa')](),controller[_0x187d('0x23')]);router['get'](_0x187d('0x24'),auth[_0x187d('0xa')](),controller[_0x187d('0x25')]);router[_0x187d('0x7')](_0x187d('0x26'),auth[_0x187d('0xa')](),controller[_0x187d('0x27')]);router[_0x187d('0x7')](_0x187d('0x28'),auth[_0x187d('0xa')](),controller[_0x187d('0x29')]);router[_0x187d('0x7')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x187d('0x2a')]);router['get'](_0x187d('0x2b'),auth[_0x187d('0xa')](),controller[_0x187d('0x2c')]);router[_0x187d('0x7')]('/:id/openchannel_accounts',auth[_0x187d('0xa')](),controller[_0x187d('0x2d')]);router[_0x187d('0x7')](_0x187d('0x2e'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x187d('0x7')](_0x187d('0x2f'),auth[_0x187d('0xa')](),controller[_0x187d('0x30')]);router[_0x187d('0x7')](_0x187d('0x31'),auth[_0x187d('0xa')](),controller[_0x187d('0x32')]);router[_0x187d('0x7')](_0x187d('0x33'),auth[_0x187d('0xa')](),controller['getSquareProjects']);router[_0x187d('0x7')](_0x187d('0x34'),auth[_0x187d('0xa')](),controller[_0x187d('0x35')]);router['get']('/:id/api_key',auth[_0x187d('0xa')](),controller[_0x187d('0x36')]);router['post'](_0x187d('0xf'),auth[_0x187d('0xa')](),controller['addContacts']);router[_0x187d('0x37')]('/',auth['isAuthenticated'](),controller[_0x187d('0x38')]);router[_0x187d('0x37')]('/create_many',auth[_0x187d('0xa')](),controller[_0x187d('0x39')]);router[_0x187d('0x37')](_0x187d('0x10'),auth['isAuthenticated'](),controller[_0x187d('0x3a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x35f569,_0x241951,_0x1bf422){_0x1bf422(null,path['join'](config[_0x187d('0x3b')],_0x187d('0x3c')));},'filename':function(_0x52a06d,_0x521b15,_0x6b55c4){_0x6b55c4(null,util[_0x187d('0x3d')](_0x187d('0x3e'),Date['now'](),_0x521b15[_0x187d('0x3f')]));}})});router[_0x187d('0x37')]('/:id/avatar',upload[_0x187d('0x40')](_0x187d('0x41')),controller['addAvatar']);router['post']('/:id/login',auth[_0x187d('0xa')](),controller[_0x187d('0x42')]);router['post'](_0x187d('0x43'),auth[_0x187d('0xa')](),controller[_0x187d('0x44')]);router[_0x187d('0x37')](_0x187d('0x45'),auth[_0x187d('0xa')](),controller['pause']);router['post']('/:id/unpause',auth[_0x187d('0xa')](),controller['unpause']);router['post'](_0x187d('0x22'),auth[_0x187d('0xa')](),controller['addTeams']);router[_0x187d('0x37')](_0x187d('0x46'),auth['isAuthenticated'](),controller['addChatInteractions']);router[_0x187d('0x37')](_0x187d('0x47'),auth[_0x187d('0xa')](),controller[_0x187d('0x48')]);router[_0x187d('0x37')](_0x187d('0x49'),auth['isAuthenticated'](),controller[_0x187d('0x4a')]);router['post'](_0x187d('0x4b'),auth[_0x187d('0xa')](),controller[_0x187d('0x4c')]);router[_0x187d('0x37')](_0x187d('0x4d'),auth['isAuthenticated'](),controller[_0x187d('0x4e')]);router[_0x187d('0x37')](_0x187d('0x4f'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router['post'](_0x187d('0x50'),auth[_0x187d('0xa')](),controller[_0x187d('0x51')]);router[_0x187d('0x37')](_0x187d('0x2b'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0x187d('0x52'),auth[_0x187d('0xa')](),controller[_0x187d('0x53')]);router[_0x187d('0x37')](_0x187d('0x2e'),auth[_0x187d('0xa')](),controller[_0x187d('0x54')]);router[_0x187d('0x37')](_0x187d('0x2f'),auth[_0x187d('0xa')](),controller[_0x187d('0x55')]);router['post'](_0x187d('0x31'),auth[_0x187d('0xa')](),controller[_0x187d('0x56')]);router[_0x187d('0x37')](_0x187d('0x33'),auth[_0x187d('0xa')](),controller[_0x187d('0x57')]);router[_0x187d('0x37')](_0x187d('0x58'),auth[_0x187d('0xa')](),controller['createApiKey']);router[_0x187d('0x59')](_0x187d('0x5a'),auth['isAuthenticated'](),controller['update']);router[_0x187d('0x59')](_0x187d('0x5b'),auth[_0x187d('0xa')](),controller[_0x187d('0x5c')]);router[_0x187d('0x5d')](_0x187d('0x10'),auth['isAuthenticated'](),controller[_0x187d('0x5e')]);router['delete'](_0x187d('0x22'),auth[_0x187d('0xa')](),controller['removeTeams']);router[_0x187d('0x5d')](_0x187d('0x5a'),auth['isAuthenticated'](),controller[_0x187d('0x5f')]);router[_0x187d('0x5d')](_0x187d('0x46'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x187d('0x5d')]('/:id/mail_interactions',auth[_0x187d('0xa')](),controller[_0x187d('0x60')]);router[_0x187d('0x5d')](_0x187d('0x49'),auth[_0x187d('0xa')](),controller[_0x187d('0x61')]);router[_0x187d('0x5d')](_0x187d('0x4b'),auth[_0x187d('0xa')](),controller['removeSmsInteractions']);router['delete']('/:id/openchannel_interactions',auth[_0x187d('0xa')](),controller['removeOpenchannelInteractions']);router[_0x187d('0x5d')](_0x187d('0x4f'),auth[_0x187d('0xa')](),controller['removeWhatsappInteractions']);router[_0x187d('0x5d')](_0x187d('0x50'),auth['isAuthenticated'](),controller[_0x187d('0x62')]);router[_0x187d('0x5d')](_0x187d('0x2b'),auth[_0x187d('0xa')](),controller['removeMailAccounts']);router[_0x187d('0x5d')]('/:id/openchannel_accounts',auth[_0x187d('0xa')](),controller[_0x187d('0x63')]);router['delete'](_0x187d('0x2e'),auth[_0x187d('0xa')](),controller['removeSmsAccounts']);router['delete'](_0x187d('0x2f'),auth['isAuthenticated'](),controller[_0x187d('0x64')]);router[_0x187d('0x5d')](_0x187d('0x31'),auth[_0x187d('0xa')](),controller[_0x187d('0x65')]);router[_0x187d('0x5d')](_0x187d('0x33'),auth[_0x187d('0xa')](),controller[_0x187d('0x66')]);router[_0x187d('0x5d')](_0x187d('0x58'),auth[_0x187d('0xa')](),controller['removeApiKey']);module['exports']=router; \ No newline at end of file +var _0xff20=['getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','single','file','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeChatInteractions','/:id/mail_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeWhatsappAccounts','exports','multer','path','connect-timeout','Router','./user.controller','get','isAuthenticated','index','describe','/whoami','whoami','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','/:id/queues_rt','/:id/groups','/:id/recordings','getRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions'];(function(_0x331872,_0x3ccaa5){var _0x396f4f=function(_0x4486c4){while(--_0x4486c4){_0x331872['push'](_0x331872['shift']());}};_0x396f4f(++_0x3ccaa5);}(_0xff20,0x19f));var _0x0ff2=function(_0x112498,_0x1440c8){_0x112498=_0x112498-0x0;var _0x520e4f=_0xff20[_0x112498];return _0x520e4f;};'use strict';var multer=require(_0x0ff2('0x0'));var util=require('util');var path=require(_0x0ff2('0x1'));var timeout=require(_0x0ff2('0x2'));var express=require('express');var router=express[_0x0ff2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0ff2('0x4'));router[_0x0ff2('0x5')]('/',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x7')]);router[_0x0ff2('0x5')]('/describe',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x8')]);router[_0x0ff2('0x5')](_0x0ff2('0x9'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0xa')]);router[_0x0ff2('0x5')]('/presence',auth[_0x0ff2('0x6')](),controller['getPresence']);router[_0x0ff2('0x5')]('/:id',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0xb')]);router[_0x0ff2('0x5')](_0x0ff2('0xc'),controller[_0x0ff2('0xd')]);router[_0x0ff2('0x5')](_0x0ff2('0xe'),auth[_0x0ff2('0x6')](),controller['getOpenTabs']);router['get'](_0x0ff2('0xf'),auth[_0x0ff2('0x6')](),controller['getContacts']);router[_0x0ff2('0x5')](_0x0ff2('0x10'),auth[_0x0ff2('0x6')](),controller['getQueues']);router[_0x0ff2('0x5')](_0x0ff2('0x11'),auth['isAuthenticated'](),controller['getVoiceQueuesRt']);router[_0x0ff2('0x5')](_0x0ff2('0x12'),auth[_0x0ff2('0x6')](),controller['getGroups']);router[_0x0ff2('0x5')](_0x0ff2('0x13'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x14')]);router[_0x0ff2('0x5')]('/:id/screen_recordings',auth[_0x0ff2('0x6')](),controller['getScreenRecordings']);router[_0x0ff2('0x5')](_0x0ff2('0x15'),auth['isAuthenticated'](),controller[_0x0ff2('0x16')]);router[_0x0ff2('0x5')](_0x0ff2('0x17'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x18')]);router[_0x0ff2('0x5')]('/:id/mail/interactions',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x19')]);router[_0x0ff2('0x5')](_0x0ff2('0x1a'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x1b')]);router[_0x0ff2('0x5')](_0x0ff2('0x1c'),auth['isAuthenticated'](),controller[_0x0ff2('0x1d')]);router['get'](_0x0ff2('0x1e'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x1f')]);router['get'](_0x0ff2('0x20'),auth['isAuthenticated'](),controller[_0x0ff2('0x21')]);router[_0x0ff2('0x5')](_0x0ff2('0x22'),auth['isAuthenticated'](),controller[_0x0ff2('0x23')]);router[_0x0ff2('0x5')](_0x0ff2('0x24'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x25')]);router['get'](_0x0ff2('0x26'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x27')]);router[_0x0ff2('0x5')](_0x0ff2('0x28'),auth[_0x0ff2('0x6')](),controller['getFaxAccounts']);router['get'](_0x0ff2('0x29'),auth[_0x0ff2('0x6')](),controller['getMailAccounts']);router[_0x0ff2('0x5')](_0x0ff2('0x2a'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x0ff2('0x2b'),auth['isAuthenticated'](),controller['getSmsAccounts']);router[_0x0ff2('0x5')](_0x0ff2('0x2c'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x2d')]);router[_0x0ff2('0x5')]('/:id/whatsapp_accounts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x2e')]);router[_0x0ff2('0x5')](_0x0ff2('0x2f'),auth[_0x0ff2('0x6')](),controller['getSquareProjects']);router['get'](_0x0ff2('0x30'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x31')]);router[_0x0ff2('0x5')](_0x0ff2('0x32'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x33')]);router[_0x0ff2('0x34')]('/:id/contacts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x35')]);router['post']('/',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x36')]);router['post'](_0x0ff2('0x37'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x38')]);router[_0x0ff2('0x34')]('/:id/queues',auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer[_0x0ff2('0x39')]({'destination':function(_0x4d687a,_0x26e763,_0x428b79){_0x428b79(null,path[_0x0ff2('0x3a')](config['root'],_0x0ff2('0x3b')));},'filename':function(_0x325c53,_0x407104,_0xe1e20a){_0xe1e20a(null,util[_0x0ff2('0x3c')](_0x0ff2('0x3d'),Date[_0x0ff2('0x3e')](),_0x407104[_0x0ff2('0x3f')]));}})});router[_0x0ff2('0x34')](_0x0ff2('0xc'),upload[_0x0ff2('0x40')](_0x0ff2('0x41')),controller['addAvatar']);router['post']('/:id/login',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x42')]);router[_0x0ff2('0x34')](_0x0ff2('0x43'),auth['isAuthenticated'](),controller[_0x0ff2('0x44')]);router[_0x0ff2('0x34')](_0x0ff2('0x45'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x46')]);router['post'](_0x0ff2('0x47'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x48')]);router[_0x0ff2('0x34')](_0x0ff2('0x20'),auth['isAuthenticated'](),controller[_0x0ff2('0x49')]);router[_0x0ff2('0x34')](_0x0ff2('0x4a'),auth['isAuthenticated'](),controller[_0x0ff2('0x4b')]);router[_0x0ff2('0x34')]('/:id/mail_interactions',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x4c')]);router[_0x0ff2('0x34')](_0x0ff2('0x4d'),auth['isAuthenticated'](),controller[_0x0ff2('0x4e')]);router[_0x0ff2('0x34')](_0x0ff2('0x4f'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x50')]);router['post'](_0x0ff2('0x51'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x52')]);router[_0x0ff2('0x34')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x0ff2('0x53')]);router[_0x0ff2('0x34')]('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x0ff2('0x54')]);router[_0x0ff2('0x34')](_0x0ff2('0x29'),auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x0ff2('0x34')](_0x0ff2('0x2a'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x55')]);router[_0x0ff2('0x34')]('/:id/sms_accounts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x56')]);router[_0x0ff2('0x34')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x0ff2('0x57')]);router[_0x0ff2('0x34')](_0x0ff2('0x58'),auth[_0x0ff2('0x6')](),controller['addWhatsappAccounts']);router['post']('/:id/square_projects',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x59')]);router[_0x0ff2('0x34')](_0x0ff2('0x32'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x5a')]);router[_0x0ff2('0x5b')]('/:id',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x5c')]);router['put']('/:id/password',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x5d')]);router[_0x0ff2('0x5e')](_0x0ff2('0x10'),auth['isAuthenticated'](),controller[_0x0ff2('0x5f')]);router[_0x0ff2('0x5e')](_0x0ff2('0x20'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x60')]);router[_0x0ff2('0x5e')](_0x0ff2('0x61'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x62')]);router[_0x0ff2('0x5e')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x0ff2('0x63')]);router[_0x0ff2('0x5e')](_0x0ff2('0x64'),auth[_0x0ff2('0x6')](),controller['removeMailInteractions']);router[_0x0ff2('0x5e')](_0x0ff2('0x4d'),auth[_0x0ff2('0x6')](),controller['removeFaxInteractions']);router[_0x0ff2('0x5e')](_0x0ff2('0x4f'),auth['isAuthenticated'](),controller[_0x0ff2('0x65')]);router[_0x0ff2('0x5e')](_0x0ff2('0x51'),auth['isAuthenticated'](),controller[_0x0ff2('0x66')]);router[_0x0ff2('0x5e')](_0x0ff2('0x67'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x68')]);router['delete']('/:id/fax_accounts',auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x69')]);router[_0x0ff2('0x5e')](_0x0ff2('0x29'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x0ff2('0x5e')](_0x0ff2('0x2a'),auth['isAuthenticated'](),controller[_0x0ff2('0x6a')]);router[_0x0ff2('0x5e')](_0x0ff2('0x2b'),auth['isAuthenticated'](),controller[_0x0ff2('0x6b')]);router[_0x0ff2('0x5e')]('/:id/chat_websites',auth['isAuthenticated'](),controller['removeChatWebsites']);router['delete'](_0x0ff2('0x58'),auth[_0x0ff2('0x6')](),controller[_0x0ff2('0x6c')]);router[_0x0ff2('0x5e')](_0x0ff2('0x2f'),auth['isAuthenticated'](),controller['removeSquareProjects']);router[_0x0ff2('0x5e')](_0x0ff2('0x32'),auth[_0x0ff2('0x6')](),controller['removeApiKey']);module[_0x0ff2('0x6d')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 840e4bd..d29de5a 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 _0x741c=['toLowerCase','ENUM','telephone','local','INTEGER','accountcode','DATE','BOOLEAN','dynamic','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','update','outgoing','force_rport,comedia','nat','all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','encryption','avpf','force_avp','dtlsenable','dtlssetup','dtlscertfile','dtlsprivatekey','icesupport','dtlsverify','/etc/pki/tls/private/motion.key','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','loginAttempts','sequelize','moment','util','lodash','exports','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','email'];(function(_0x547352,_0x259a3d){var _0x374df8=function(_0x414fc2){while(--_0x414fc2){_0x547352['push'](_0x547352['shift']());}};_0x374df8(++_0x259a3d);}(_0x741c,0x196));var _0xc741=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x741c[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xc741('0x0'));var moment=require(_0xc741('0x1'));var util=require(_0xc741('0x2'));var _=require(_0xc741('0x3'));module[_0xc741('0x4')]={'name':{'type':Sequelize[_0xc741('0x5')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5cee2e){this[_0xc741('0x6')]('name',_0x5cee2e);this[_0xc741('0x6')](_0xc741('0x7'),_0x5cee2e);},'comment':_0xc741('0x8')},'fullname':{'type':Sequelize[_0xc741('0x5')],'allowNull':![],'set':function(_0x3f3d82){this[_0xc741('0x6')](_0xc741('0x9'),_0x3f3d82);this['setDataValue'](_0xc741('0xa'),util[_0xc741('0xb')]('\x22%s\x22\x20<%s>',_0x3f3d82,this[_0xc741('0xc')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xc741('0x5')],'allowNull':![],'unique':_0xc741('0xd'),'validate':{'isEmail':!![]},'set':function(_0x40639b){if(_0x40639b){this[_0xc741('0x6')](_0xc741('0xd'),_0x40639b[_0xc741('0xe')]());}}},'role':{'type':Sequelize[_0xc741('0xf')]('admin','user','agent',_0xc741('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xc741('0x5')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xc741('0x5')],'defaultValue':_0xc741('0x11')},'internal':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0xde1da){this[_0xc741('0x6')]('internal',_0xde1da);this[_0xc741('0x6')](_0xc741('0x13'),_0xde1da);this[_0xc741('0x6')](_0xc741('0xa'),util[_0xc741('0xb')]('\x22%s\x22\x20<%s>',this['getDataValue'](_0xc741('0x9')),_0xde1da));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc741('0x5')]},'mobile':{'type':Sequelize[_0xc741('0x5')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc741('0x5')]},'city':{'type':Sequelize[_0xc741('0x5')]},'country':{'type':Sequelize[_0xc741('0x5')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xc741('0x14')]},'voicePause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xc741('0x5')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xc741('0x14')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xc741('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc741('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'host':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![],'defaultValue':_0xc741('0x16')},'ipaddr':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'port':{'type':Sequelize[_0xc741('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x17'),_0xc741('0x18'),'peer'),'allowNull':!![],'defaultValue':_0xc741('0x17')},'context':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x19'),_0xc741('0x1a'),_0xc741('0x1b'),_0xc741('0x1c'),_0xc741('0x1d'),_0xc741('0x1e'),_0xc741('0x1f'),_0xc741('0x20')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xc741('0x21'),'set':function(_0x1d0367){this[_0xc741('0x6')]('transport',_0x1d0367?_0x1d0367[_0xc741('0x22')](','):null);},'get':function(){return this[_0xc741('0xc')](_0xc741('0x23'))?this['getDataValue'](_0xc741('0x23'))[_0xc741('0x24')](','):null;},'comment':_0xc741('0x25')},'dtmfmode':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x26'),_0xc741('0x27'),_0xc741('0x28'),'inband','auto'),'allowNull':!![],'defaultValue':_0xc741('0x26')},'directmedia':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no',_0xc741('0x2a'),_0xc741('0x2b'),_0xc741('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xc741('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![],'defaultValue':_0xc741('0x2d'),'set':function(_0x7321b9){this['setDataValue'](_0xc741('0x2e'),_0x7321b9?_0x7321b9[_0xc741('0x22')](','):null);},'get':function(){return this[_0xc741('0xc')](_0xc741('0x2e'))?this[_0xc741('0xc')](_0xc741('0x2e'))[_0xc741('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xc741('0x5')]},'namedcallgroup':{'type':Sequelize[_0xc741('0x5')]},'pickupgroup':{'type':Sequelize[_0xc741('0x5')]},'namedpickupgroup':{'type':Sequelize[_0xc741('0x5')]},'language':{'type':Sequelize[_0xc741('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc741('0x5')]},'disallow':{'type':Sequelize[_0xc741('0x5')],'allowNull':![],'defaultValue':_0xc741('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc741('0x30'),'set':function(_0x17ba5a){this[_0xc741('0x6')](_0xc741('0x31'),_0x17ba5a?_0x17ba5a['join'](';'):_0xc741('0x30'));},'get':function(){return this['getDataValue'](_0xc741('0x31'))?this[_0xc741('0xc')](_0xc741('0x31'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![],'set':function(_0x3f12ea){this[_0xc741('0x6')](_0xc741('0x32'),_0x3f12ea?_0x3f12ea[_0xc741('0x22')](','):null);},'get':function(){return this[_0xc741('0xc')](_0xc741('0x32'))?this[_0xc741('0xc')](_0xc741('0x32'))[_0xc741('0x24')](','):null;},'comment':_0xc741('0x33')},'trustrpid':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xc741('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xc741('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![],'defaultValue':_0xc741('0x29')},'busylevel':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0xc741('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xc741('0xf')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'template':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no',_0xc741('0x34')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xc741('0x35'),_0xc741('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xc741('0x37'),'uas'),'allowNull':!![],'defaultValue':_0xc741('0x38')},'t38pt_usertpsource':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![],'defaultValue':_0xc741('0x29')},'keepalive':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xc741('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0xc741('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xc741('0x29'),'no',_0xc741('0x39'),_0xc741('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x3b'),_0xc741('0x3c'),_0xc741('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc741('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xc741('0x29'),'no','nonat',_0xc741('0x2b'),_0xc741('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc741('0x5')]},'resetPasswordExpires':{'type':Sequelize[_0xc741('0x14')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x0,'set':function(_0x8cee54){this['setDataValue'](_0xc741('0x3f'),_0x8cee54);var _0x27d8e2=this[_0xc741('0x40')]({'plain':!![]});switch(_0x8cee54){case 0x0:case 0x1:var _0x278944=_0x27d8e2[_0xc741('0x23')]?_['isArray'](_0x27d8e2['transport'])?_0x27d8e2[_0xc741('0x23')]['join']():_0x27d8e2[_0xc741('0x23')]:_0xc741('0x21');if(_0x278944==='wss'){_0x278944=_0xc741('0x21');}this[_0xc741('0x6')](_0xc741('0x23'),_0x278944);this[_0xc741('0x6')](_0xc741('0x41'),'no');this[_0xc741('0x6')](_0xc741('0x42'),null);this['setDataValue'](_0xc741('0x43'),null);this[_0xc741('0x6')]('icesupport',null);this[_0xc741('0x6')](_0xc741('0x44'),null);this[_0xc741('0x6')]('dtlsverify',null);this[_0xc741('0x6')](_0xc741('0x45'),null);this['setDataValue'](_0xc741('0x46'),null);this[_0xc741('0x6')](_0xc741('0x47'),null);this[_0xc741('0x6')]('rtcp_mux','no');break;case 0x2:this['setDataValue'](_0xc741('0x23'),'wss');this[_0xc741('0x6')](_0xc741('0x41'),_0xc741('0x29'));this[_0xc741('0x6')](_0xc741('0x42'),_0xc741('0x29'));this['setDataValue'](_0xc741('0x43'),'yes');this[_0xc741('0x6')](_0xc741('0x48'),_0xc741('0x29'));this[_0xc741('0x6')]('dtlsenable',_0xc741('0x29'));this[_0xc741('0x6')](_0xc741('0x49'),'no');this[_0xc741('0x6')](_0xc741('0x45'),_0xc741('0x3d'));this[_0xc741('0x6')](_0xc741('0x46'),_0x27d8e2[_0xc741('0x46')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0xc741('0x47'),_0x27d8e2[_0xc741('0x47')]||_0xc741('0x4a'));this[_0xc741('0x6')]('rtcp_mux',_0xc741('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xc741('0x4b')],'set':function(_0x22982b){this[_0xc741('0x6')](_0xc741('0x4c'),_0x22982b?_0x22982b[_0xc741('0x22')](','):[]);},'get':function(){return this[_0xc741('0xc')](_0xc741('0x4c'))?_['map'](this[_0xc741('0xc')]('permissions')['split'](','),function(_0x2daa59){return parseInt(_0x2daa59,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc741('0x5')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xc741('0x5')]},'phoneBarUnconditional':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc741('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc741('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc741('0x5')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xc741('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc741('0xf')](_0xc741('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xc741('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xc741('0x5')]},'phoneBarEnableJaws':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc741('0x4d')],'get':function(){return this[_0xc741('0xc')](_0xc741('0x4e'))?this[_0xc741('0xc')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc741('0x5')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc741('0x5')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x51760a){if(typeof _0x51760a==='string'){var _0x1ff1c3=_0x51760a==='1'?!![]:_0x51760a==='0'?![]:_0x51760a===_0xc741('0x4f')?!![]:_0x51760a===_0xc741('0x50')?![]:![];this[_0xc741('0x6')]('screenrecording',_0x1ff1c3);}else{this[_0xc741('0x6')](_0xc741('0x51'),_0x51760a);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f9256){this[_0xc741('0x6')](_0xc741('0x52'),_0x4f9256);if(_0x4f9256===!![]){this[_0xc741('0x6')]('blockedAt',moment());this[_0xc741('0x6')](_0xc741('0x53'),0x0);}else{this[_0xc741('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc741('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc741('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc741('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc741('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xf494=['avpf','force_avp','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','icesupport','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','false','screenrecording','loginAttempts','blockedAt','sequelize','moment','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','user','agent','local','INTEGER','accountcode','fullname','BOOLEAN','DATE','friend','peer','from-sip','ENUM','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uac','uas','certificate','active','passive','TEXT','showWebBar','wss','encryption'];(function(_0x24eb67,_0x4857db){var _0x188041=function(_0x2e2519){while(--_0x2e2519){_0x24eb67['push'](_0x24eb67['shift']());}};_0x188041(++_0x4857db);}(_0xf494,0x1c6));var _0x4f49=function(_0x182e6f,_0x404471){_0x182e6f=_0x182e6f-0x0;var _0x118edc=_0xf494[_0x182e6f];return _0x118edc;};'use strict';var Sequelize=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));var util=require(_0x4f49('0x2'));var _=require('lodash');module[_0x4f49('0x3')]={'name':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'unique':_0x4f49('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x25677c){this[_0x4f49('0x6')](_0x4f49('0x5'),_0x25677c);this[_0x4f49('0x6')](_0x4f49('0x7'),_0x25677c);},'comment':_0x4f49('0x8')},'fullname':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'set':function(_0x42b0e8){this['setDataValue']('fullname',_0x42b0e8);this[_0x4f49('0x6')](_0x4f49('0x9'),util[_0x4f49('0xa')](_0x4f49('0xb'),_0x42b0e8,this[_0x4f49('0xc')](_0x4f49('0xd'))));}},'alias':{'type':Sequelize[_0x4f49('0x4')]},'email':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3e464f){if(_0x3e464f){this[_0x4f49('0x6')]('email',_0x3e464f[_0x4f49('0xe')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0x4f49('0xf'),_0x4f49('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x4f49('0x4')],'defaultValue':_0x4f49('0x11')},'internal':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':![],'unique':_0x4f49('0xd'),'set':function(_0x2f0131){this[_0x4f49('0x6')]('internal',_0x2f0131);this[_0x4f49('0x6')](_0x4f49('0x13'),_0x2f0131);this[_0x4f49('0x6')]('callerid',util['format'](_0x4f49('0xb'),this[_0x4f49('0xc')](_0x4f49('0x14')),_0x2f0131));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4f49('0x4')]},'mobile':{'type':Sequelize[_0x4f49('0x4')]},'address':{'type':Sequelize[_0x4f49('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x4f49('0x16')]},'voicePause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4f49('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x4f49('0x16')]},'chatCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x4f49('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x4f49('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x4f49('0x17'),_0x4f49('0xf'),_0x4f49('0x18')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':_0x4f49('0x19')},'callingpres':{'type':Sequelize[_0x4f49('0x1a')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x4f49('0x1b'),_0x4f49('0x1c'),_0x4f49('0x1d'),'PROHIB_PASSED_SCREEN',_0x4f49('0x1e'),_0x4f49('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':_0x4f49('0x20'),'set':function(_0x310ee2){this[_0x4f49('0x6')](_0x4f49('0x21'),_0x310ee2?_0x310ee2[_0x4f49('0x22')](','):null);},'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x21'))?this[_0x4f49('0xc')](_0x4f49('0x21'))[_0x4f49('0x23')](','):null;},'comment':_0x4f49('0x24')},'dtmfmode':{'type':Sequelize['ENUM'](_0x4f49('0x25'),_0x4f49('0x26'),_0x4f49('0x27'),_0x4f49('0x28'),_0x4f49('0x29')),'allowNull':!![],'defaultValue':_0x4f49('0x25')},'directmedia':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no',_0x4f49('0x2b'),_0x4f49('0x2c'),_0x4f49('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':_0x4f49('0x2e'),'set':function(_0x26014f){this[_0x4f49('0x6')](_0x4f49('0x2f'),_0x26014f?_0x26014f[_0x4f49('0x22')](','):null);},'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x2f'))?this[_0x4f49('0xc')](_0x4f49('0x2f'))[_0x4f49('0x23')](','):null;},'comment':_0x4f49('0x30')},'callgroup':{'type':Sequelize[_0x4f49('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x4f49('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x4f49('0x4')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4f49('0x4')]},'disallow':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x4f49('0x4')],'allowNull':![],'defaultValue':_0x4f49('0x31'),'set':function(_0x2548ad){this[_0x4f49('0x6')](_0x4f49('0x32'),_0x2548ad?_0x2548ad[_0x4f49('0x22')](';'):_0x4f49('0x31'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue'](_0x4f49('0x32'))[_0x4f49('0x23')](';'):null;},'comment':_0x4f49('0x33')},'autoframing':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'set':function(_0x38aff8){this[_0x4f49('0x6')](_0x4f49('0x34'),_0x38aff8?_0x38aff8['join'](','):null);},'get':function(){return this['getDataValue'](_0x4f49('0x34'))?this[_0x4f49('0xc')](_0x4f49('0x34'))['split'](','):null;},'comment':_0x4f49('0x35')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4f49('0x1a')]('yes','no',_0x4f49('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x4f49('0x2a')},'busylevel':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no',_0x4f49('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x38'),_0x4f49('0x39'),_0x4f49('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x3b'),_0x4f49('0x3c')),'allowNull':!![],'defaultValue':_0x4f49('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no','fingerprint',_0x4f49('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x3e'),_0x4f49('0x3f'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x4f49('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x4f49('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x4f49('0x1a')](_0x4f49('0x2a'),'no',_0x4f49('0x2b'),_0x4f49('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x4f49('0x16')]},'passwordResetAt':{'type':Sequelize[_0x4f49('0x16')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x4f49('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x1dade6){this[_0x4f49('0x6')](_0x4f49('0x41'),_0x1dade6);var _0x196552=this['get']({'plain':!![]});switch(_0x1dade6){case 0x0:case 0x1:var _0x22df72=_0x196552[_0x4f49('0x21')]?_['isArray'](_0x196552[_0x4f49('0x21')])?_0x196552[_0x4f49('0x21')][_0x4f49('0x22')]():_0x196552[_0x4f49('0x21')]:_0x4f49('0x20');if(_0x22df72===_0x4f49('0x42')){_0x22df72=_0x4f49('0x20');}this[_0x4f49('0x6')]('transport',_0x22df72);this[_0x4f49('0x6')](_0x4f49('0x43'),'no');this[_0x4f49('0x6')](_0x4f49('0x44'),null);this[_0x4f49('0x6')](_0x4f49('0x45'),null);this[_0x4f49('0x6')]('icesupport',null);this[_0x4f49('0x6')]('dtlsenable',null);this[_0x4f49('0x6')](_0x4f49('0x46'),null);this[_0x4f49('0x6')](_0x4f49('0x47'),null);this[_0x4f49('0x6')](_0x4f49('0x48'),null);this[_0x4f49('0x6')](_0x4f49('0x49'),null);this[_0x4f49('0x6')](_0x4f49('0x4a'),'no');break;case 0x2:this['setDataValue'](_0x4f49('0x21'),_0x4f49('0x42'));this[_0x4f49('0x6')](_0x4f49('0x43'),'yes');this['setDataValue'](_0x4f49('0x44'),'yes');this[_0x4f49('0x6')](_0x4f49('0x45'),_0x4f49('0x2a'));this[_0x4f49('0x6')](_0x4f49('0x4b'),_0x4f49('0x2a'));this[_0x4f49('0x6')](_0x4f49('0x4c'),_0x4f49('0x2a'));this[_0x4f49('0x6')](_0x4f49('0x46'),'no');this[_0x4f49('0x6')](_0x4f49('0x47'),_0x4f49('0x4d'));this[_0x4f49('0x6')](_0x4f49('0x48'),_0x196552[_0x4f49('0x48')]||_0x4f49('0x4e'));this[_0x4f49('0x6')](_0x4f49('0x49'),_0x196552[_0x4f49('0x49')]||_0x4f49('0x4f'));this[_0x4f49('0x6')](_0x4f49('0x4a'),_0x4f49('0x2a'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3e9460){this['setDataValue'](_0x4f49('0x50'),_0x3e9460?_0x3e9460[_0x4f49('0x22')](','):[]);},'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x50'))?_[_0x4f49('0x51')](this[_0x4f49('0xc')](_0x4f49('0x50'))[_0x4f49('0x23')](','),function(_0x3ee01a){return parseInt(_0x3ee01a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x4f49('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4f49('0x1a')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x4f49('0x4')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x4f49('0xc')](_0x4f49('0x52'))?this['getDataValue'](_0x4f49('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x4f49('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x4f49('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x3ecc94){if(typeof _0x3ecc94==='string'){var _0x50c06e=_0x3ecc94==='1'?!![]:_0x3ecc94==='0'?![]:_0x3ecc94==='true'?!![]:_0x3ecc94===_0x4f49('0x53')?![]:![];this[_0x4f49('0x6')](_0x4f49('0x54'),_0x50c06e);}else{this[_0x4f49('0x6')]('screenrecording',_0x3ecc94);}}},'blocked':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![],'set':function(_0x4e1c67){this[_0x4f49('0x6')]('blocked',_0x4e1c67);if(_0x4e1c67===!![]){this[_0x4f49('0x6')]('blockedAt',moment());this['setDataValue'](_0x4f49('0x55'),0x0);}else{this[_0x4f49('0x6')](_0x4f49('0x56'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x4f49('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4f49('0x15')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 9cc6059..dd0419d 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 _0x0295=['addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','firstName','lastName','phone','Contact','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','flatten','lower','col','toString','desc','orderBy','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','select','field','ui.','InteractionId','ui.UserId\x20=\x20?','moment','path','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','./user.socket','redis','client','http','request','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','User,\x20%s,\x20%s','message','info','sendStatus','end','status','json','limit','undefined','offset','set','Content-Range','update','destroy','then','get','role','admin','Users','user','Agents','agent','Telephones','ignore','value','includes','find','name','UserProfileResource','stack','send','User','rawAttributes','map','fieldName','type','key','filter','getOptions','where','count','includeAll','include','attributes','push','findAll','rows','query','openTabs','true','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','params','model','differenceBy','keys','password','salt','filters','intersection','fields','options','body','describe','addContacts','omit','ids','Setting','findById','securePassword','max','isNil','min_internal','internal','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','sequelize','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','permissions','101','102','103','113','110','106','107','108','109','100','111','114','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','autoAssociation','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','each','telephone','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','online','loginInPause','voicePause','interface','Unknown\x20channel','add','toLowerCase','Queues','spread','QueueId','emit','capitalize','Queue:save','voice','format','UserVoiceQueueRt','upsert','removeQueues','channel','isValidChannel','isArray','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SMS','WhatsappOpenTabs','getContacts','CmContact','sort','pick','merge','hasOwnProperty','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','order','getGroups','ChatGroup','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:forcelogout','connection','socket','remoteAddress','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','concat','resolve','logout','MemberReport','pause','QueuePause','DEFAULT\x20PAUSE','chatPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','unpause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','getMailQueues','Sms','getWhatsappQueues','Whatsapp','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','getDataValue','UserVoicePrefix','VoicePrefixId','removeTeams','Chat','getSmsQueues','getFaxQueues','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','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'];(function(_0x45c057,_0x210105){var _0x4f2aa7=function(_0x557e97){while(--_0x557e97){_0x45c057['push'](_0x45c057['shift']());}};_0x4f2aa7(++_0x210105);}(_0x0295,0x1f0));var _0x5029=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x0295[_0x5c2a2b];return _0x19921f;};'use strict';var moment=require(_0x5029('0x0'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x5029('0x1'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var jayson=require(_0x5029('0x2'));var Redis=require(_0x5029('0x3'));var authService=require(_0x5029('0x4'));var qs=require(_0x5029('0x5'));var logger=require(_0x5029('0x6'))(_0x5029('0x7'));var utils=require(_0x5029('0x8'));var config=require(_0x5029('0x9'));var licenseUtil=require(_0x5029('0xa'));var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5029('0xb'))['register'](socket);config[_0x5029('0xc')]=_['defaults'](config[_0x5029('0xc')],{'host':'localhost','port':0x18eb});var client=jayson[_0x5029('0xd')][_0x5029('0xe')]({'port':0x232a});var values;function respondWithRpcPromise(_0x12834c,_0x52fa95,_0x3f4c48,_0xbf61f){return new BPromise(function(_0x3fe6d1,_0x4f295e){var _0x3bc005=_0xbf61f||client;return _0x3bc005[_0x5029('0xf')](_0x12834c,_0x3f4c48)['then'](function(_0x4fa22d){logger['info']('User,\x20%s,\x20%s',_0x52fa95,_0x5029('0x10'));logger[_0x5029('0x11')](_0x5029('0x12'),_0x52fa95,_0x5029('0x10'),JSON[_0x5029('0x13')](_0x4fa22d));if(_0x4fa22d[_0x5029('0x14')]){if(_0x4fa22d[_0x5029('0x14')][_0x5029('0x15')]===0x1f4){logger[_0x5029('0x14')](_0x5029('0x16'),_0x52fa95,_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);return _0x4f295e(_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);}logger[_0x5029('0x14')]('User,\x20%s,\x20%s',_0x52fa95,_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);return _0x3fe6d1(_0x4fa22d[_0x5029('0x14')][_0x5029('0x17')]);}else{logger[_0x5029('0x18')](_0x5029('0x16'),_0x52fa95,_0x5029('0x10'));_0x3fe6d1(_0x4fa22d['result'][_0x5029('0x17')]);}})['catch'](function(_0x16485c){logger[_0x5029('0x14')](_0x5029('0x16'),_0x52fa95,_0x16485c);_0x4f295e(_0x16485c);});});}function respondWithStatusCode(_0x3cf0fb,_0x4b5854){_0x4b5854=_0x4b5854||0xcc;return function(_0x47ecca){if(_0x47ecca){return _0x3cf0fb[_0x5029('0x19')](_0x4b5854);}return _0x3cf0fb['status'](_0x4b5854)[_0x5029('0x1a')]();};}function respondWithResult(_0x853a34,_0x1eb228){_0x1eb228=_0x1eb228||0xc8;return function(_0x2bbbcb){if(_0x2bbbcb){return _0x853a34[_0x5029('0x1b')](_0x1eb228)[_0x5029('0x1c')](_0x2bbbcb);}};}function respondWithFilteredResult(_0x125c26,_0x356dac){return function(_0x3e857d){if(_0x3e857d){var _0x4ceaae=typeof _0x356dac['offset']==='undefined'&&typeof _0x356dac[_0x5029('0x1d')]===_0x5029('0x1e');var _0x51093c=_0x3e857d['count'];var _0x181da0=_0x4ceaae?0x0:_0x356dac[_0x5029('0x1f')];var _0x36d810=_0x4ceaae?_0x3e857d['count']:_0x356dac[_0x5029('0x1f')]+_0x356dac[_0x5029('0x1d')];var _0x5e45c4;if(_0x36d810>=_0x51093c){_0x36d810=_0x51093c;_0x5e45c4=0xc8;}else{_0x5e45c4=0xce;}_0x125c26[_0x5029('0x1b')](_0x5e45c4);return _0x125c26[_0x5029('0x20')](_0x5029('0x21'),_0x181da0+'-'+_0x36d810+'/'+_0x51093c)['json'](_0x3e857d);}return null;};}function saveUpdates(_0x32da06){return function(_0x251f99){if(_0x251f99){return _0x251f99[_0x5029('0x22')](_0x32da06)['then'](function(_0x2cedf6){return _0x2cedf6;});}return null;};}function removeEntity(_0x2bb398){return function(_0x4cc16a){if(_0x4cc16a){return _0x4cc16a[_0x5029('0x23')]()[_0x5029('0x24')](function(){var _0x4434ff=_0x4cc16a[_0x5029('0x25')]({'plain':!![]});if(_0x4434ff[_0x5029('0x26')]===_0x5029('0x27'))return;var _0x44255a=[{'name':_0x5029('0x28'),'value':_0x5029('0x29'),'ignore':!![]},{'name':_0x5029('0x2a'),'value':_0x5029('0x2b'),'ignore':![]},{'name':_0x5029('0x2c'),'value':'telephone','ignore':![]}];var _0x11ae38=_(_0x44255a)['filter'](_0x5029('0x2d'))['map']('value')[_0x5029('0x2e')]();if(_[_0x5029('0x2f')](_0x11ae38,_0x4434ff[_0x5029('0x26')])){return;}var _0x4b7330=_[_0x5029('0x30')](_0x44255a,[_0x5029('0x2e'),_0x4434ff[_0x5029('0x26')]])[_0x5029('0x31')];return db[_0x5029('0x32')][_0x5029('0x23')]({'where':{'type':_0x4b7330,'resourceId':_0x4434ff['id']}})[_0x5029('0x24')](function(){return _0x4cc16a;});})[_0x5029('0x24')](function(){_0x2bb398[_0x5029('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db45c){return function(_0xa4a432){if(!_0xa4a432){_0x1db45c[_0x5029('0x19')](0x194);}return _0xa4a432;};}function handleError(_0x1b3817,_0x5ecd00){_0x5ecd00=_0x5ecd00||0x1f4;return function(_0x184b8d){logger[_0x5029('0x14')](_0x184b8d[_0x5029('0x33')]);if(_0x184b8d['name']){delete _0x184b8d['name'];}_0x1b3817[_0x5029('0x1b')](_0x5ecd00)[_0x5029('0x34')](_0x184b8d);};}exports['index']=function(_0x57784c,_0x9656f2){var _0x157969={},_0x270d66={'count':0x0,'rows':[]};var _0x3210cb=_(db[_0x5029('0x35')][_0x5029('0x36')])[_0x5029('0x37')](function(_0x2f13b1){return{'name':_0x2f13b1[_0x5029('0x38')],'type':_0x2f13b1[_0x5029('0x39')][_0x5029('0x3a')]};})[_0x5029('0x3b')](function(_0x46314a){return!_[_0x5029('0x2f')](['password','salt'],_0x46314a[_0x5029('0x31')]);})[_0x5029('0x2e')]();_0x157969=qs[_0x5029('0x3c')](_0x3210cb,_0x57784c);var _0x48c9eb={'where':_0x157969[_0x5029('0x3d')]};return db[_0x5029('0x35')]['count'](_0x48c9eb)[_0x5029('0x24')](function(_0x4c3e11){_0x270d66[_0x5029('0x3e')]=_0x4c3e11;if(_0x57784c['query'][_0x5029('0x3f')]){_0x157969[_0x5029('0x40')]=[{'all':!![]}];}if(!_[_0x5029('0x2f')](_0x157969[_0x5029('0x41')],'id')){_0x157969[_0x5029('0x41')][_0x5029('0x42')]('id');}return db[_0x5029('0x35')][_0x5029('0x43')](_0x157969);})[_0x5029('0x24')](function(_0x5a3e4d){_0x270d66[_0x5029('0x44')]=_0x5a3e4d;if(_0x57784c[_0x5029('0x45')][_0x5029('0x46')]===_0x5029('0x47')){var _0x3525bc=[];for(var _0x11ac2e=0x0;_0x11ac2e<_0x270d66['rows'][_0x5029('0x48')];_0x11ac2e++){_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x49'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc['push'](get_open_tabs(_0x5029('0x4b'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4c'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x270d66['rows'][_0x11ac2e][_0x5029('0x4a')]));_0x3525bc[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x270d66[_0x5029('0x44')][_0x11ac2e]['dataValues']));_0x3525bc['push'](get_open_tabs(_0x5029('0x4f'),_0x270d66[_0x5029('0x44')][_0x11ac2e][_0x5029('0x4a')]));}return BPromise[_0x5029('0x50')](_0x3525bc)[_0x5029('0x24')](function(_0x3dfc08){return _0x270d66;});}else{return _0x270d66;}})[_0x5029('0x24')](respondWithFilteredResult(_0x9656f2,_0x157969))[_0x5029('0x51')](handleError(_0x9656f2,null));};exports[_0x5029('0x52')]=function(_0x2790e4,_0x2c2e0e){var _0x39370b={'raw':![],'where':{'id':_0x2790e4[_0x5029('0x53')]['id']}},_0x449ef5={};_0x449ef5[_0x5029('0x54')]=_[_0x5029('0x55')](_[_0x5029('0x56')](db[_0x5029('0x35')][_0x5029('0x36')]),[_0x5029('0x57'),_0x5029('0x58')]);_0x449ef5['query']=_[_0x5029('0x56')](_0x2790e4['query']);_0x449ef5[_0x5029('0x59')]=_[_0x5029('0x5a')](_0x449ef5['model'],_0x449ef5['query']);_0x39370b[_0x5029('0x41')]=_['intersection'](_0x449ef5['model'],qs[_0x5029('0x5b')](_0x2790e4[_0x5029('0x45')][_0x5029('0x5b')]));_0x39370b['attributes']=_0x39370b['attributes'][_0x5029('0x48')]?_0x39370b[_0x5029('0x41')]:_0x449ef5['model'];if(_0x2790e4[_0x5029('0x45')]['includeAll']){_0x39370b[_0x5029('0x40')]=[{'all':!![]}];}_0x39370b=_['merge']({},_0x39370b,_0x2790e4[_0x5029('0x5c')]);if(!_[_0x5029('0x2f')](_0x39370b[_0x5029('0x41')],'id')){_0x39370b[_0x5029('0x41')][_0x5029('0x42')]('id');}return db[_0x5029('0x35')][_0x5029('0x30')](_0x39370b)[_0x5029('0x24')](handleEntityNotFound(_0x2c2e0e,null))['then'](function(_0x1df044){var _0x5dd466=[];values=_0x1df044;if(_0x2790e4[_0x5029('0x45')][_0x5029('0x46')]==='true'){_0x5dd466[_0x5029('0x42')](get_open_tabs('chat',_0x1df044['dataValues']));_0x5dd466['push'](get_open_tabs(_0x5029('0x4b'),_0x1df044['dataValues']));_0x5dd466[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x1df044[_0x5029('0x4a')]));_0x5dd466['push'](get_open_tabs(_0x5029('0x4f'),_0x1df044['dataValues']));_0x5dd466['push'](get_open_tabs(_0x5029('0x4c'),_0x1df044[_0x5029('0x4a')]));_0x5dd466[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x1df044[_0x5029('0x4a')]));return BPromise['all'](_0x5dd466);}else{return values;}})[_0x5029('0x24')](function(_0x124634){return values;})[_0x5029('0x24')](respondWithResult(_0x2c2e0e,null))[_0x5029('0x51')](handleError(_0x2c2e0e,null));};exports['update']=function(_0x33812b,_0xfffc0d){if(_0x33812b['body']['id']){delete _0x33812b['body']['id'];}delete _0x33812b[_0x5029('0x5d')][_0x5029('0x26')];return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x33812b['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0xfffc0d,null))[_0x5029('0x24')](saveUpdates(_0x33812b[_0x5029('0x5d')],null))[_0x5029('0x24')](respondWithResult(_0xfffc0d,null))[_0x5029('0x51')](handleError(_0xfffc0d,null));};exports[_0x5029('0x5e')]=function(_0x59a718,_0x560324){return db[_0x5029('0x35')][_0x5029('0x5e')]()[_0x5029('0x24')](respondWithResult(_0x560324,null))['catch'](handleError(_0x560324,null));};exports[_0x5029('0x5f')]=function(_0x2d439a,_0x105638){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x2d439a['params']['id']}})[_0x5029('0x24')](handleEntityNotFound(_0x105638,null))[_0x5029('0x24')](function(_0x11637e){if(_0x11637e){return _0x11637e['addContacts'](_0x2d439a[_0x5029('0x5d')]['ids'],_[_0x5029('0x60')](_0x2d439a['body'],[_0x5029('0x61'),'id'])||{});}})[_0x5029('0x24')](respondWithResult(_0x105638,null))[_0x5029('0x51')](handleError(_0x105638,null));};function validateUser(_0x2f5301){return new BPromise(function(_0x1d2a67,_0x2ab5cf){if(_0x2f5301['internal'])return _0x1d2a67(_0x2f5301);return db[_0x5029('0x62')][_0x5029('0x63')](0x1)[_0x5029('0x24')](function(_0x151562){if(_0x151562[_0x5029('0x64')])authService['validatePasswordPattern'](_0x2f5301[_0x5029('0x57')]);db['User'][_0x5029('0x65')]('internal')[_0x5029('0x24')](function(_0x512392){if(_[_0x5029('0x66')](_0x512392)){_0x2f5301['internal']=_0x151562['min_internal']||0x1;return;}if(_[_0x5029('0x66')](_0x151562['min_internal'])||_0x151562[_0x5029('0x67')]===_0x512392){_0x2f5301[_0x5029('0x68')]=_0x512392+0x1;return;}if(_0x151562[_0x5029('0x67')]>_0x512392){_0x2f5301['internal']=_0x151562[_0x5029('0x67')];return;}return db['sequelize'][_0x5029('0x45')](_0x5029('0x69'),{'type':db[_0x5029('0x6a')][_0x5029('0x6b')][_0x5029('0x6c')]})['then'](function(_0x409034){if(_0x409034&&_0x409034[_0x5029('0x48')]){for(var _0x5890ac=0x0,_0x6500bb=_0x409034[_0x5029('0x48')];_0x5890ac<_0x6500bb&&_[_0x5029('0x66')](_0x2f5301[_0x5029('0x68')]);_0x5890ac++){if(_0x151562[_0x5029('0x67')]<=_0x409034[_0x5890ac][_0x5029('0x6d')]){_0x2f5301['internal']=_0x409034[_0x5890ac]['from'];}else if(_0x151562[_0x5029('0x67')]>_0x409034[_0x5890ac]['from']&&_0x151562[_0x5029('0x67')]<=_0x409034[_0x5890ac]['to']){_0x2f5301[_0x5029('0x68')]=_0x151562['min_internal'];}}}if(_[_0x5029('0x66')](_0x2f5301['internal'])){_0x2f5301['internal']=_0x512392+0x1;}return _0x1d2a67(_0x2f5301);});});})[_0x5029('0x51')](function(_0x340db9){_0x2ab5cf(_0x340db9);});});}function updateUser(_0x3aa169){return new BPromise(function(_0x3efc4b,_0x57874c){try{if(_0x3aa169[_0x5029('0x6e')]){_0x3aa169[_0x5029('0x6f')]=_0x3aa169['internal'];_0x3aa169[_0x5029('0x70')]={'mailbox':_0x3aa169[_0x5029('0x68')],'password':_0x3aa169['password'],'fullname':_0x3aa169['fullname'],'email':_0x3aa169['email']};}if(_0x3aa169[_0x5029('0x26')]===_0x5029('0x2b')){if(!_0x3aa169[_0x5029('0x71')])_0x3aa169[_0x5029('0x71')]=[_0x5029('0x72'),_0x5029('0x73'),_0x5029('0x74'),_0x5029('0x75'),_0x5029('0x76'),'104','105',_0x5029('0x77'),_0x5029('0x78'),_0x5029('0x79'),_0x5029('0x7a'),_0x5029('0x7b'),_0x5029('0x7c'),_0x5029('0x7d'),'115'];}_0x3efc4b(_0x3aa169);}catch(_0x31a1fd){_0x57874c(_0x31a1fd);}});}exports[_0x5029('0x7e')]=function(_0xc1be70,_0x4b61a6){if(_0xc1be70[_0x5029('0x29')][_0x5029('0x26')]===_0x5029('0x2b'))throw new Error('Unauthorized');if(_0xc1be70[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x29')&&_0xc1be70['user'][_0x5029('0x26')]!==_0x5029('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xc1be70[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x27')&&_0xc1be70[_0x5029('0x29')][_0x5029('0x26')]!=='admin'){throw new Error(_0x5029('0x7f'));}return licenseUtil[_0x5029('0x80')]([_0xc1be70[_0x5029('0x5d')]])[_0x5029('0x24')](function(){return validateUser(_0xc1be70[_0x5029('0x5d')]);})['then'](function(_0x455464){return updateUser(_0x455464)[_0x5029('0x24')](function(_0x344203){if(_0x344203['role']===_0x5029('0x27')){_0x344203[_0x5029('0x81')]=_0xc1be70[_0x5029('0x29')][_0x5029('0x81')];delete _0x344203[_0x5029('0x82')];}return _0x344203;});})[_0x5029('0x24')](function(_0x1e075c){return db['User'][_0x5029('0x7e')](_0x1e075c,{'include':[{'model':db[_0x5029('0x70')],'as':_0x5029('0x70')}]});})[_0x5029('0x24')](function(_0x2dcfee){if(_0xc1be70['body'][_0x5029('0x26')]===_0x5029('0x29'))return _0x2dcfee;if(_0xc1be70[_0x5029('0x29')]['role']!==_0x5029('0x29'))return _0x2dcfee;return db[_0x5029('0x83')]['find']({'where':{'name':_0x2dcfee['role']==='agent'?_0x5029('0x2a'):_0x5029('0x2c'),'userProfileId':_0xc1be70[_0x5029('0x29')][_0x5029('0x82')]},'raw':!![]})[_0x5029('0x24')](function(_0x4c742f){if(!_0x4c742f||_0x4c742f[_0x5029('0x84')]!=0x0)return _0x2dcfee;return db[_0x5029('0x32')][_0x5029('0x7e')]({'name':_0x2dcfee['name'],'resourceId':_0x2dcfee['id'],'type':_0x4c742f['name'],'sectionId':_0x4c742f['id']},{})[_0x5029('0x24')](function(){return _0x2dcfee;});})[_0x5029('0x51')](function(_0x1eb1ff){logger[_0x5029('0x14')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1eb1ff);throw _0x1eb1ff;});})[_0x5029('0x24')](respondWithResult(_0x4b61a6,0xc9))[_0x5029('0x51')](handleError(_0x4b61a6,null));};exports[_0x5029('0x85')]=function(_0x3295ba,_0x49f6b8){var _0xcc5fcf=_0x3295ba[_0x5029('0x5d')];var _0xe4b730=[];if(_0x3295ba['user'][_0x5029('0x26')]==='agent')throw new Error('Unauthorized');if(_[_0x5029('0x86')](_0xcc5fcf,['role',_0x5029('0x29')])&&_0x3295ba[_0x5029('0x29')][_0x5029('0x26')]!==_0x5029('0x27')){throw new Error(_0x5029('0x87'));}if(_[_0x5029('0x86')](_0xcc5fcf,[_0x5029('0x26'),_0x5029('0x27')])&&_0x3295ba['user']['role']!==_0x5029('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0xcc5fcf)[_0x5029('0x24')](function(){return validateUser(_0xcc5fcf[0x0]);})['then'](function(){for(var _0x4b25ed=0x1;_0x4b25ed<_0xcc5fcf[_0x5029('0x48')];_0x4b25ed++){var _0xb8da0b=_0xcc5fcf[_0x4b25ed-0x1][_0x5029('0x68')];if(!_0xcc5fcf[_0x4b25ed][_0x5029('0x68')])_0xcc5fcf[_0x4b25ed][_0x5029('0x68')]=_0xb8da0b+0x1;_0xe4b730['push'](validateUser(_0xcc5fcf[_0x4b25ed]));}return BPromise[_0x5029('0x50')](_0xe4b730);})[_0x5029('0x24')](function(){_0xe4b730=[];for(var _0x7c87a2=0x0;_0x7c87a2<_0xcc5fcf['length'];_0x7c87a2++){_0xe4b730[_0x5029('0x42')](updateUser(_0xcc5fcf[_0x7c87a2]));}return BPromise[_0x5029('0x50')](_0xe4b730);})[_0x5029('0x24')](function(){return BPromise[_0x5029('0x88')](_0xcc5fcf,function(_0x3867a1){return db['User']['create'](_0x3867a1,{'include':[{'model':db[_0x5029('0x70')],'as':_0x5029('0x70')}]})['then'](function(_0x43fa13){_0x3867a1['id']=_0x43fa13['id'];return _0x3867a1;});});})[_0x5029('0x24')](function(_0x3d0d7a){if(_0x3295ba[_0x5029('0x5d')][_0x5029('0x26')]===_0x5029('0x29'))return _0x3d0d7a;if(_0x3295ba[_0x5029('0x29')][_0x5029('0x26')]!=='user')return _0x3d0d7a;var _0x523bee=_[_0x5029('0x86')](_0x3d0d7a,function(_0x57b4e7){return _0x57b4e7[_0x5029('0x26')]==='agent'||_0x57b4e7[_0x5029('0x26')]===_0x5029('0x89');});if(!_0x523bee)return _0x3d0d7a;return db[_0x5029('0x83')]['findAll']({'where':{'name':{'$or':[_0x5029('0x2a'),_0x5029('0x2c')]},'userProfileId':_0x3295ba[_0x5029('0x29')]['userProfileId']},'raw':!![]})[_0x5029('0x24')](function(_0x362a08){if(_[_0x5029('0x8a')](_0x362a08)||!_[_0x5029('0x86')](_0x362a08,[_0x5029('0x84'),0x0]))return _0x3d0d7a;_0xe4b730=[];var _0x2899e6=_(_0x362a08)[_0x5029('0x37')](function(_0x32779f){if(_0x32779f[_0x5029('0x84')]===0x1)return;return _0x32779f[_0x5029('0x31')]===_0x5029('0x2a')?_0x5029('0x2b'):_0x5029('0x89');})[_0x5029('0x8b')]()[_0x5029('0x2e')]();for(var _0x15435d=0x0;_0x15435d<_0x3d0d7a[_0x5029('0x48')];_0x15435d++){if(!_[_0x5029('0x2f')](_0x2899e6,_0x3d0d7a[_0x15435d]['role']))return;var _0x7007a0=_0x3d0d7a[_0x15435d][_0x5029('0x26')]===_0x5029('0x2b')?_0x5029('0x2a'):_0x5029('0x2c');_0xe4b730['push'](db[_0x5029('0x32')][_0x5029('0x7e')]({'name':_0x3d0d7a[_0x15435d][_0x5029('0x31')],'resourceId':_0x3d0d7a[_0x15435d]['id'],'type':_0x7007a0,'sectionId':_[_0x5029('0x30')](_0x362a08,[_0x5029('0x31'),_0x7007a0])['id']},{}));}return BPromise['all'](_0xe4b730);});})[_0x5029('0x24')](respondWithResult(_0x49f6b8,0xc9))[_0x5029('0x51')](handleError(_0x49f6b8,null));};exports[_0x5029('0x8c')]=function(_0x139971,_0x3c601c){if(_0x139971['body']['id']){delete _0x139971[_0x5029('0x5d')]['id'];}return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x139971[_0x5029('0x53')]['id']}})[_0x5029('0x24')](function(_0x12cfe5){if(!_0x12cfe5)return null;if(_0x12cfe5['id']===_0x139971[_0x5029('0x29')]['id']){if(!_0x139971[_0x5029('0x5d')]['oldPassword']||!_0x139971['body'][_0x5029('0x8d')]){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0x90'));}if(!_0x12cfe5[_0x5029('0x91')](_0x139971['body'][_0x5029('0x92')])){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x93'));}if(_0x139971[_0x5029('0x5d')][_0x5029('0x92')]===_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x94'));}}else if(_0x139971['user'][_0x5029('0x26')]===_0x5029('0x27')){if(!_0x139971['body'][_0x5029('0x8d')]){throw new db['Sequelize']['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x139971['user'][_0x5029('0x26')]==='user'){if(!_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]){throw new db['Sequelize'][(_0x5029('0x8f'))](_0x5029('0x95'));}if(_0x12cfe5['role']!==_0x5029('0x2b')){throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0x96'));}}else{throw new db[(_0x5029('0x8e'))]['ValidationError'](_0x5029('0x96'));}return _0x12cfe5;})[_0x5029('0x24')](handleEntityNotFound(_0x3c601c,null))[_0x5029('0x24')](function(_0x24c55f){return db[_0x5029('0x62')][_0x5029('0x97')]({'attributes':['id','securePassword',_0x5029('0x98'),'passwordHistoryLimit']})[_0x5029('0x24')](function(_0x271d63){if(_0x271d63[_0x5029('0x64')])authService[_0x5029('0x99')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')]);if(!_0x271d63[_0x5029('0x98')]||!_0x24c55f[_0x5029('0x9a')])return _0x24c55f;authService[_0x5029('0x9b')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],_0x24c55f[_0x5029('0x9a')],_0x271d63[_0x5029('0x9c')]);return _0x24c55f;})[_0x5029('0x24')](saveUpdates({'password':_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],'passwordResetAt':_0x139971['user']['id']==_0x139971[_0x5029('0x53')]['id']?moment():null,'previousPasswords':authService[_0x5029('0x9d')](_0x139971[_0x5029('0x5d')][_0x5029('0x8d')],_0x24c55f[_0x5029('0x9a')])},null));})[_0x5029('0x24')](respondWithResult(_0x3c601c,null))['catch'](handleError(_0x3c601c,null));};exports[_0x5029('0x9e')]=function(_0x41108f,_0x137559){var _0x36dabf=_0x41108f[_0x5029('0x5d')]['channel'];return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x41108f[_0x5029('0x53')]['id']},'attributes':['id',_0x5029('0x31'),_0x5029('0x26'),_0x5029('0x9f'),_0x5029('0xa0'),_0x5029('0xa1'),_0x5029('0xa2')]})[_0x5029('0x24')](handleEntityNotFound(_0x137559,null))['then'](function(_0xb26cc0){if(_0xb26cc0){if(!utils['isValidChannel'](_0x36dabf)){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0xa3'));}return _0xb26cc0[_0x5029('0xa4')+_['capitalize'](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xa6')](_0x41108f['body'][_0x5029('0x61')],{'penalty':_0x41108f[_0x5029('0x5d')]['penalty']||0x0})[_0x5029('0xa7')](function(_0x14d53c){for(var _0x5b290f=0x0;_0x5b290f<_0x41108f['body'][_0x5029('0x61')]['length'];_0x5b290f+=0x1){var _0x512082={'UserId':Number(_0x41108f[_0x5029('0x53')]['id'])};_0x512082[_['capitalize'](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xa8')]=Number(_0x41108f['body'][_0x5029('0x61')][_0x5b290f]);socket[_0x5029('0xa9')]('user'+_[_0x5029('0xaa')](_0x36dabf[_0x5029('0xa5')]())+_0x5029('0xab'),_0x512082);}return _0x14d53c;})['then'](function(){if(_0x36dabf===_0x5029('0xac')){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x41108f[_0x5029('0x5d')][_0x5029('0x61')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x5029('0x24')](function(_0x44e198){var _0x5aa480=_0xb26cc0[_0x5029('0x25')]({'plain':!![]});var _0x294ddc=[];if(_0x36dabf==='voice'&&_0x5aa480['role']===_0x5029('0x2b')&&_0x5aa480[_0x5029('0x9f')]){for(var _0x587f24=0x0;_0x587f24<_0x44e198['length'];_0x587f24+=0x1){_0x294ddc['push']({'membername':_0x5aa480[_0x5029('0x31')],'UserId':_0x5aa480['id'],'queue_name':_0x44e198[_0x587f24][_0x5029('0x31')],'VoiceQueueId':_0x44e198[_0x587f24]['id'],'interface':_[_0x5029('0x66')](_0x5aa480['interface'])?util[_0x5029('0xad')]('SIP/%s',_0x5aa480[_0x5029('0x31')]):_0x5aa480['interface'],'paused':_0x5aa480['voicePause']||![],'penalty':_0x41108f['body']['penalty']||0x0});}return BPromise[_0x5029('0x88')](_0x294ddc,function(_0x1f8811){return db[_0x5029('0xae')][_0x5029('0xaf')](_0x1f8811);});}return _0xb26cc0;});}})[_0x5029('0x24')](respondWithStatusCode(_0x137559,null))['catch'](handleError(_0x137559,null));};exports[_0x5029('0xb0')]=function(_0x7258ac,_0x31e03c){var _0x42b5eb;return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x7258ac['params']['id']},'attributes':['id',_0x5029('0x31'),_0x5029('0x26')]})[_0x5029('0x24')](handleEntityNotFound(_0x31e03c,null))['then'](function(_0x5a4988){if(_0x5a4988){_0x42b5eb=_0x5a4988;if(!_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]||!utils[_0x5029('0xb2')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')])){throw new db[(_0x5029('0x8e'))][(_0x5029('0x8f'))](_0x5029('0xa3'));}return _0x5a4988['remove'+_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]['toLowerCase']())+_0x5029('0xa6')](_0x7258ac['query'][_0x5029('0x61')]);}})[_0x5029('0x24')](function(_0x100ae3){if(_[_0x5029('0xb3')](_0x7258ac[_0x5029('0x45')][_0x5029('0x61')])){for(var _0xcf928a=0x0;_0xcf928a<_0x7258ac[_0x5029('0x45')]['ids']['length'];_0xcf928a+=0x1){var _0x1cf583={'UserId':Number(_0x7258ac[_0x5029('0x53')]['id'])};_0x1cf583[_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')][_0x5029('0xa5')]())+'QueueId']=Number(_0x7258ac[_0x5029('0x45')][_0x5029('0x61')][_0xcf928a]);socket[_0x5029('0xa9')](_0x5029('0x29')+_[_0x5029('0xaa')](_0x7258ac['query'][_0x5029('0xb1')][_0x5029('0xa5')]())+_0x5029('0xb4'),_0x1cf583);}}else{var _0x1cf583={'UserId':Number(_0x7258ac[_0x5029('0x53')]['id'])};_0x1cf583[_[_0x5029('0xaa')](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')][_0x5029('0xa5')]())+_0x5029('0xa8')]=Number(_0x7258ac[_0x5029('0x45')][_0x5029('0x61')]);socket[_0x5029('0xa9')]('user'+_['capitalize'](_0x7258ac[_0x5029('0x45')][_0x5029('0xb1')]['toLowerCase']())+_0x5029('0xb4'),_0x1cf583);}return _0x100ae3;})[_0x5029('0x24')](function(){if(_0x7258ac['query'][_0x5029('0xb1')]===_0x5029('0xac')){return db[_0x5029('0xae')]['destroy']({'where':{'UserId':_0x7258ac[_0x5029('0x53')]['id'],'VoiceQueueId':_0x7258ac[_0x5029('0x45')]['ids']},'individualHooks':!![]})[_0x5029('0x24')](function(){return _0x42b5eb;});}return _0x42b5eb;})['then'](respondWithStatusCode(_0x31e03c,null))['catch'](handleError(_0x31e03c,null));};exports[_0x5029('0xb5')]=function(_0x548735,_0x3c22c5){_0x548735[_0x5029('0x5d')][_0x5029('0xb6')]=_0x548735['file'][_0x5029('0xb7')];return db['User']['find']({'where':{'id':_0x548735[_0x5029('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c22c5,null))[_0x5029('0x24')](saveUpdates(_0x548735[_0x5029('0x5d')],null))[_0x5029('0x24')](respondWithResult(_0x3c22c5,null))['catch'](handleError(_0x3c22c5,null));};exports[_0x5029('0xb8')]=function(_0x1caa56,_0xfea081){var _0x1415df=path[_0x5029('0xb9')](config[_0x5029('0xba')],'server/files/images/logos/default_profile.png');return db['User'][_0x5029('0x30')]({'where':{'id':_0x1caa56[_0x5029('0x53')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x5029('0x24')](handleEntityNotFound(_0xfea081,null))['then'](function(_0x4d4ae3){if(_0x4d4ae3){if(_[_0x5029('0x66')](_0x4d4ae3[_0x5029('0xb6')])){return _0xfea081[_0x5029('0xbb')](_0x1415df);}else{if(!fs[_0x5029('0xbc')](path[_0x5029('0xb9')](config[_0x5029('0xba')],_0x5029('0xbd'),_0x4d4ae3[_0x5029('0xb6')]))){return _0xfea081[_0x5029('0xbb')](_0x1415df);}return _0xfea081[_0x5029('0xbb')](path[_0x5029('0xb9')](config[_0x5029('0xba')],_0x5029('0xbd'),_0x4d4ae3[_0x5029('0xb6')]));}}})[_0x5029('0x51')](handleError(_0xfea081,null));};exports[_0x5029('0xbe')]=function(_0x14c4fe,_0x77cbcf){return db[_0x5029('0x35')][_0x5029('0x30')]({'where':{'id':_0x14c4fe[_0x5029('0x53')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x77cbcf,null))[_0x5029('0x24')](function(_0x4390cf){var _0x32270e=[];values=_0x4390cf['dataValues'];_0x32270e[_0x5029('0x42')](get_open_tabs('chat',_0x4390cf['dataValues']));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4b'),_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4e'),_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs('whatsapp',_0x4390cf[_0x5029('0x4a')]));_0x32270e['push'](get_open_tabs('fax',_0x4390cf[_0x5029('0x4a')]));_0x32270e[_0x5029('0x42')](get_open_tabs(_0x5029('0x4d'),_0x4390cf[_0x5029('0x4a')]));return BPromise[_0x5029('0x50')](_0x32270e);})['then'](function(_0x58564f){var _0x53a135=[];if(_0x58564f){for(var _0x4595b5=0x0;_0x4595b5=_0x2bb837){_0x35f5b3=_0x2bb837;_0x2d6112=0xc8;}else{_0x2d6112=0xce;}_0x1aa676['status'](_0x2d6112);return _0x1aa676['set']('Content-Range',_0x4e8273+'-'+_0x35f5b3+'/'+_0x2bb837)[_0x4afc('0x22')](_0x1e454e);}return null;};}function saveUpdates(_0x5db47e){return function(_0x5e4747){if(_0x5e4747){return _0x5e4747[_0x4afc('0x23')](_0x5db47e)[_0x4afc('0x12')](function(_0x494fe7){return _0x494fe7;});}return null;};}function removeEntity(_0x514278){return function(_0x52e3dd){if(_0x52e3dd){return _0x52e3dd[_0x4afc('0x24')]()[_0x4afc('0x12')](function(){var _0x17a43d=_0x52e3dd[_0x4afc('0x25')]({'plain':!![]});if(_0x17a43d[_0x4afc('0x26')]===_0x4afc('0x27'))return;var _0x566389=[{'name':_0x4afc('0x28'),'value':_0x4afc('0x29'),'ignore':!![]},{'name':_0x4afc('0x2a'),'value':_0x4afc('0x2b'),'ignore':![]},{'name':_0x4afc('0x2c'),'value':_0x4afc('0x2d'),'ignore':![]}];var _0xbabe1e=_(_0x566389)[_0x4afc('0x2e')]('ignore')[_0x4afc('0x2f')]('value')['value']();if(_[_0x4afc('0x30')](_0xbabe1e,_0x17a43d[_0x4afc('0x26')])){return;}var _0x266f7f=_[_0x4afc('0x31')](_0x566389,[_0x4afc('0x32'),_0x17a43d[_0x4afc('0x26')]])['name'];return db[_0x4afc('0x33')][_0x4afc('0x24')]({'where':{'type':_0x266f7f,'resourceId':_0x17a43d['id']}})[_0x4afc('0x12')](function(){return _0x52e3dd;});})[_0x4afc('0x12')](function(){_0x514278[_0x4afc('0x1d')](0xcc)[_0x4afc('0x34')]();});}};}function handleEntityNotFound(_0x48f0c6){return function(_0x22eea2){if(!_0x22eea2){_0x48f0c6[_0x4afc('0x1c')](0x194);}return _0x22eea2;};}function handleError(_0x91565d,_0x283bc2){_0x283bc2=_0x283bc2||0x1f4;return function(_0x499464){logger['error'](_0x499464[_0x4afc('0x35')]);if(_0x499464[_0x4afc('0x36')]){delete _0x499464[_0x4afc('0x36')];}_0x91565d['status'](_0x283bc2)['send'](_0x499464);};}exports[_0x4afc('0x37')]=function(_0x4a06cf,_0x5947bb){var _0x295b53={},_0x1dc853={'count':0x0,'rows':[]};var _0x2be40e=_(db[_0x4afc('0x38')][_0x4afc('0x39')])[_0x4afc('0x2f')](function(_0x453e12){return{'name':_0x453e12[_0x4afc('0x3a')],'type':_0x453e12[_0x4afc('0x3b')][_0x4afc('0x3c')]};})[_0x4afc('0x2e')](function(_0x3ef2aa){return!_[_0x4afc('0x30')]([_0x4afc('0x3d'),_0x4afc('0x3e')],_0x3ef2aa['name']);})[_0x4afc('0x32')]();_0x295b53=qs[_0x4afc('0x3f')](_0x2be40e,_0x4a06cf);var _0x4357a6={'where':_0x295b53[_0x4afc('0x40')]};return db[_0x4afc('0x38')][_0x4afc('0x21')](_0x4357a6)[_0x4afc('0x12')](function(_0x50d53f){_0x1dc853['count']=_0x50d53f;if(_0x4a06cf['query'][_0x4afc('0x41')]){_0x295b53[_0x4afc('0x42')]=[{'all':!![]}];}if(!_['includes'](_0x295b53[_0x4afc('0x43')],'id')){_0x295b53[_0x4afc('0x43')][_0x4afc('0x44')]('id');}return db[_0x4afc('0x38')]['findAll'](_0x295b53);})[_0x4afc('0x12')](function(_0x45c9c3){_0x1dc853[_0x4afc('0x45')]=_0x45c9c3;if(_0x4a06cf[_0x4afc('0x46')][_0x4afc('0x47')]===_0x4afc('0x48')){var _0x51dca0=[];for(var _0x1e6f95=0x0;_0x1e6f95<_0x1dc853['rows'][_0x4afc('0x49')];_0x1e6f95++){_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4a'),_0x1dc853['rows'][_0x1e6f95]['dataValues']));_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4b'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4d'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0['push'](get_open_tabs(_0x4afc('0x4e'),_0x1dc853[_0x4afc('0x45')][_0x1e6f95]['dataValues']));_0x51dca0[_0x4afc('0x44')](get_open_tabs('openchannel',_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));_0x51dca0[_0x4afc('0x44')](get_open_tabs('whatsapp',_0x1dc853[_0x4afc('0x45')][_0x1e6f95][_0x4afc('0x4c')]));}return BPromise[_0x4afc('0x4f')](_0x51dca0)[_0x4afc('0x12')](function(_0x4772db){return _0x1dc853;});}else{return _0x1dc853;}})[_0x4afc('0x12')](respondWithFilteredResult(_0x5947bb,_0x295b53))['catch'](handleError(_0x5947bb,null));};exports['show']=function(_0x4f4e46,_0x32f3b9){var _0x1c5661={'raw':![],'where':{'id':_0x4f4e46[_0x4afc('0x50')]['id']}},_0x42e274={};_0x42e274[_0x4afc('0x51')]=_[_0x4afc('0x52')](_[_0x4afc('0x53')](db[_0x4afc('0x38')][_0x4afc('0x39')]),[_0x4afc('0x3d'),'salt']);_0x42e274[_0x4afc('0x46')]=_['keys'](_0x4f4e46['query']);_0x42e274[_0x4afc('0x54')]=_['intersection'](_0x42e274[_0x4afc('0x51')],_0x42e274[_0x4afc('0x46')]);_0x1c5661[_0x4afc('0x43')]=_[_0x4afc('0x55')](_0x42e274['model'],qs[_0x4afc('0x56')](_0x4f4e46['query'][_0x4afc('0x56')]));_0x1c5661[_0x4afc('0x43')]=_0x1c5661[_0x4afc('0x43')][_0x4afc('0x49')]?_0x1c5661[_0x4afc('0x43')]:_0x42e274[_0x4afc('0x51')];if(_0x4f4e46[_0x4afc('0x46')][_0x4afc('0x41')]){_0x1c5661[_0x4afc('0x42')]=[{'all':!![]}];}_0x1c5661=_[_0x4afc('0x57')]({},_0x1c5661,_0x4f4e46[_0x4afc('0x58')]);if(!_[_0x4afc('0x30')](_0x1c5661['attributes'],'id')){_0x1c5661[_0x4afc('0x43')][_0x4afc('0x44')]('id');}return db[_0x4afc('0x38')][_0x4afc('0x31')](_0x1c5661)[_0x4afc('0x12')](handleEntityNotFound(_0x32f3b9,null))[_0x4afc('0x12')](function(_0x2fd538){var _0x10c254=[];values=_0x2fd538;if(_0x4f4e46[_0x4afc('0x46')][_0x4afc('0x47')]===_0x4afc('0x48')){_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4a'),_0x2fd538['dataValues']));_0x10c254[_0x4afc('0x44')](get_open_tabs('sms',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x59'),_0x2fd538[_0x4afc('0x4c')]));_0x10c254['push'](get_open_tabs('whatsapp',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs('fax',_0x2fd538[_0x4afc('0x4c')]));_0x10c254[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4e'),_0x2fd538[_0x4afc('0x4c')]));return BPromise[_0x4afc('0x4f')](_0x10c254);}else{return values;}})[_0x4afc('0x12')](function(_0x154797){return values;})[_0x4afc('0x12')](respondWithResult(_0x32f3b9,null))[_0x4afc('0x1b')](handleError(_0x32f3b9,null));};exports[_0x4afc('0x23')]=function(_0x4295a5,_0x1a4d15){if(_0x4295a5[_0x4afc('0x5a')]['id']){delete _0x4295a5[_0x4afc('0x5a')]['id'];}delete _0x4295a5['body'][_0x4afc('0x26')];return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x4295a5[_0x4afc('0x50')]['id']}})[_0x4afc('0x12')](handleEntityNotFound(_0x1a4d15,null))[_0x4afc('0x12')](saveUpdates(_0x4295a5[_0x4afc('0x5a')],null))['then'](respondWithResult(_0x1a4d15,null))[_0x4afc('0x1b')](handleError(_0x1a4d15,null));};exports[_0x4afc('0x5b')]=function(_0x543dce,_0x4b3439){return db[_0x4afc('0x38')][_0x4afc('0x5b')]()[_0x4afc('0x12')](respondWithResult(_0x4b3439,null))[_0x4afc('0x1b')](handleError(_0x4b3439,null));};exports[_0x4afc('0x5c')]=function(_0x193850,_0x37cfa6){return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x193850[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x37cfa6,null))['then'](function(_0x458533){if(_0x458533){return _0x458533[_0x4afc('0x5c')](_0x193850['body'][_0x4afc('0x5d')],_[_0x4afc('0x5e')](_0x193850['body'],['ids','id'])||{});}})[_0x4afc('0x12')](respondWithResult(_0x37cfa6,null))[_0x4afc('0x1b')](handleError(_0x37cfa6,null));};function validateUser(_0x576ea0){return new BPromise(function(_0x53792a,_0x3875f8){if(_0x576ea0['internal'])return _0x53792a(_0x576ea0);return db['Setting'][_0x4afc('0x5f')](0x1)[_0x4afc('0x12')](function(_0x53f9ca){if(_0x53f9ca[_0x4afc('0x60')])authService[_0x4afc('0x61')](_0x576ea0[_0x4afc('0x3d')]);db[_0x4afc('0x38')][_0x4afc('0x62')](_0x4afc('0x63'))['then'](function(_0x25969c){if(_[_0x4afc('0x64')](_0x25969c)){_0x576ea0[_0x4afc('0x63')]=_0x53f9ca['min_internal']||0x1;return;}if(_['isNil'](_0x53f9ca['min_internal'])||_0x53f9ca[_0x4afc('0x65')]===_0x25969c){_0x576ea0[_0x4afc('0x63')]=_0x25969c+0x1;return;}if(_0x53f9ca[_0x4afc('0x65')]>_0x25969c){_0x576ea0['internal']=_0x53f9ca[_0x4afc('0x65')];return;}return db['sequelize']['query']('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x4afc('0x66')][_0x4afc('0x67')][_0x4afc('0x68')]})['then'](function(_0x1e56b7){if(_0x1e56b7&&_0x1e56b7[_0x4afc('0x49')]){for(var _0x18ab12=0x0,_0x5e3e9b=_0x1e56b7[_0x4afc('0x49')];_0x18ab12<_0x5e3e9b&&_[_0x4afc('0x64')](_0x576ea0[_0x4afc('0x63')]);_0x18ab12++){if(_0x53f9ca[_0x4afc('0x65')]<=_0x1e56b7[_0x18ab12][_0x4afc('0x69')]){_0x576ea0['internal']=_0x1e56b7[_0x18ab12]['from'];}else if(_0x53f9ca[_0x4afc('0x65')]>_0x1e56b7[_0x18ab12][_0x4afc('0x69')]&&_0x53f9ca[_0x4afc('0x65')]<=_0x1e56b7[_0x18ab12]['to']){_0x576ea0['internal']=_0x53f9ca[_0x4afc('0x65')];}}}if(_[_0x4afc('0x64')](_0x576ea0[_0x4afc('0x63')])){_0x576ea0[_0x4afc('0x63')]=_0x25969c+0x1;}return _0x53792a(_0x576ea0);});});})[_0x4afc('0x1b')](function(_0x4bc6e5){_0x3875f8(_0x4bc6e5);});});}function updateUser(_0x1ef397){return new BPromise(function(_0x8ba1da,_0x517efb){try{if(_0x1ef397[_0x4afc('0x6a')]){_0x1ef397[_0x4afc('0x6b')]=_0x1ef397[_0x4afc('0x63')];_0x1ef397['VoiceMail']={'mailbox':_0x1ef397[_0x4afc('0x63')],'password':_0x1ef397[_0x4afc('0x3d')],'fullname':_0x1ef397[_0x4afc('0x6c')],'email':_0x1ef397[_0x4afc('0x6d')]};}if(_0x1ef397[_0x4afc('0x26')]===_0x4afc('0x2b')){if(!_0x1ef397[_0x4afc('0x6e')])_0x1ef397[_0x4afc('0x6e')]=['101',_0x4afc('0x6f'),'103','113',_0x4afc('0x70'),_0x4afc('0x71'),_0x4afc('0x72'),'106','107',_0x4afc('0x73'),_0x4afc('0x74'),_0x4afc('0x75'),_0x4afc('0x76'),_0x4afc('0x77'),_0x4afc('0x78')];}_0x8ba1da(_0x1ef397);}catch(_0x4701ca){_0x517efb(_0x4701ca);}});}exports[_0x4afc('0x79')]=function(_0x5fd3e1,_0x396cb5){if(_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]===_0x4afc('0x2b'))throw new Error(_0x4afc('0x7a'));if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]==='user'&&_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]!==_0x4afc('0x27')){throw new Error(_0x4afc('0x7b'));}if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]===_0x4afc('0x27')&&_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x26')]!=='admin'){throw new Error(_0x4afc('0x7c'));}return licenseUtil[_0x4afc('0x7d')]([_0x5fd3e1[_0x4afc('0x5a')]])[_0x4afc('0x12')](function(){return validateUser(_0x5fd3e1['body']);})[_0x4afc('0x12')](function(_0x56b862){return updateUser(_0x56b862)[_0x4afc('0x12')](function(_0x4956b2){if(_0x4956b2[_0x4afc('0x26')]===_0x4afc('0x27')){_0x4956b2[_0x4afc('0x7e')]=_0x5fd3e1[_0x4afc('0x29')][_0x4afc('0x7e')];delete _0x4956b2[_0x4afc('0x7f')];}return _0x4956b2;});})['then'](function(_0xbbcbf4){return db[_0x4afc('0x38')]['create'](_0xbbcbf4,{'include':[{'model':db[_0x4afc('0x80')],'as':_0x4afc('0x80')}]});})[_0x4afc('0x12')](function(_0x4affde){if(_0x5fd3e1[_0x4afc('0x5a')][_0x4afc('0x26')]===_0x4afc('0x29'))return _0x4affde;if(_0x5fd3e1[_0x4afc('0x29')]['role']!==_0x4afc('0x29'))return _0x4affde;return db[_0x4afc('0x81')]['find']({'where':{'name':_0x4affde[_0x4afc('0x26')]===_0x4afc('0x2b')?_0x4afc('0x2a'):'Telephones','userProfileId':_0x5fd3e1['user'][_0x4afc('0x7f')]},'raw':!![]})[_0x4afc('0x12')](function(_0x1c0483){if(!_0x1c0483||_0x1c0483[_0x4afc('0x82')]!=0x0)return _0x4affde;return db[_0x4afc('0x33')][_0x4afc('0x79')]({'name':_0x4affde[_0x4afc('0x36')],'resourceId':_0x4affde['id'],'type':_0x1c0483[_0x4afc('0x36')],'sectionId':_0x1c0483['id']},{})[_0x4afc('0x12')](function(){return _0x4affde;});})[_0x4afc('0x1b')](function(_0x32a7a3){logger[_0x4afc('0x18')](_0x4afc('0x83'),_0x32a7a3);throw _0x32a7a3;});})[_0x4afc('0x12')](respondWithResult(_0x396cb5,0xc9))[_0x4afc('0x1b')](handleError(_0x396cb5,null));};exports[_0x4afc('0x84')]=function(_0x5d0ae9,_0x165a35){var _0x105ab7=_0x5d0ae9['body'];var _0xd8f88a=[];if(_0x5d0ae9['user']['role']===_0x4afc('0x2b'))throw new Error('Unauthorized');if(_['some'](_0x105ab7,[_0x4afc('0x26'),'user'])&&_0x5d0ae9[_0x4afc('0x29')]['role']!==_0x4afc('0x27')){throw new Error(_0x4afc('0x7b'));}if(_[_0x4afc('0x85')](_0x105ab7,[_0x4afc('0x26'),_0x4afc('0x27')])&&_0x5d0ae9['user'][_0x4afc('0x26')]!==_0x4afc('0x27')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil['checkUserLimits'](_0x105ab7)[_0x4afc('0x12')](function(){return validateUser(_0x105ab7[0x0]);})[_0x4afc('0x12')](function(){for(var _0x373e9c=0x1;_0x373e9c<_0x105ab7[_0x4afc('0x49')];_0x373e9c++){var _0x4596ed=_0x105ab7[_0x373e9c-0x1]['internal'];if(!_0x105ab7[_0x373e9c][_0x4afc('0x63')])_0x105ab7[_0x373e9c][_0x4afc('0x63')]=_0x4596ed+0x1;_0xd8f88a[_0x4afc('0x44')](validateUser(_0x105ab7[_0x373e9c]));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);})['then'](function(){_0xd8f88a=[];for(var _0x114e0f=0x0;_0x114e0f<_0x105ab7['length'];_0x114e0f++){_0xd8f88a[_0x4afc('0x44')](updateUser(_0x105ab7[_0x114e0f]));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);})[_0x4afc('0x12')](function(){return BPromise[_0x4afc('0x86')](_0x105ab7,function(_0xa580ad){return db[_0x4afc('0x38')][_0x4afc('0x79')](_0xa580ad,{'include':[{'model':db[_0x4afc('0x80')],'as':_0x4afc('0x80')}]})[_0x4afc('0x12')](function(_0x27dd60){_0xa580ad['id']=_0x27dd60['id'];return _0xa580ad;});});})['then'](function(_0x26a924){if(_0x5d0ae9['body'][_0x4afc('0x26')]==='user')return _0x26a924;if(_0x5d0ae9['user'][_0x4afc('0x26')]!=='user')return _0x26a924;var _0x512f92=_[_0x4afc('0x85')](_0x26a924,function(_0x489c9d){return _0x489c9d[_0x4afc('0x26')]===_0x4afc('0x2b')||_0x489c9d['role']===_0x4afc('0x2d');});if(!_0x512f92)return _0x26a924;return db[_0x4afc('0x81')]['findAll']({'where':{'name':{'$or':[_0x4afc('0x2a'),_0x4afc('0x2c')]},'userProfileId':_0x5d0ae9[_0x4afc('0x29')]['userProfileId']},'raw':!![]})[_0x4afc('0x12')](function(_0x298c87){if(_[_0x4afc('0x87')](_0x298c87)||!_[_0x4afc('0x85')](_0x298c87,[_0x4afc('0x82'),0x0]))return _0x26a924;_0xd8f88a=[];var _0xbdeb7d=_(_0x298c87)['map'](function(_0x4daf24){if(_0x4daf24[_0x4afc('0x82')]===0x1)return;return _0x4daf24[_0x4afc('0x36')]==='Agents'?_0x4afc('0x2b'):_0x4afc('0x2d');})['compact']()[_0x4afc('0x32')]();for(var _0x102fd8=0x0;_0x102fd8<_0x26a924[_0x4afc('0x49')];_0x102fd8++){if(!_[_0x4afc('0x30')](_0xbdeb7d,_0x26a924[_0x102fd8][_0x4afc('0x26')]))return;var _0x4b1bbc=_0x26a924[_0x102fd8][_0x4afc('0x26')]===_0x4afc('0x2b')?_0x4afc('0x2a'):_0x4afc('0x2c');_0xd8f88a[_0x4afc('0x44')](db['UserProfileResource'][_0x4afc('0x79')]({'name':_0x26a924[_0x102fd8][_0x4afc('0x36')],'resourceId':_0x26a924[_0x102fd8]['id'],'type':_0x4b1bbc,'sectionId':_[_0x4afc('0x31')](_0x298c87,['name',_0x4b1bbc])['id']},{}));}return BPromise[_0x4afc('0x4f')](_0xd8f88a);});})[_0x4afc('0x12')](respondWithResult(_0x165a35,0xc9))['catch'](handleError(_0x165a35,null));};exports['changePassword']=function(_0x4c27a2,_0x1119a9){if(_0x4c27a2[_0x4afc('0x5a')]['id']){delete _0x4c27a2['body']['id'];}return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x4c27a2['params']['id']}})[_0x4afc('0x12')](function(_0x37a056){if(!_0x37a056)return null;if(_0x37a056['id']===_0x4c27a2[_0x4afc('0x29')]['id']){if(!_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x88')]||!_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')]){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x37a056[_0x4afc('0x8c')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x88')])){throw new db[(_0x4afc('0x8a'))]['ValidationError'](_0x4afc('0x8d'));}if(_0x4c27a2[_0x4afc('0x5a')]['oldPassword']===_0x4c27a2['body']['newPassword']){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x8e'));}}else if(_0x4c27a2['user'][_0x4afc('0x26')]===_0x4afc('0x27')){if(!_0x4c27a2[_0x4afc('0x5a')]['newPassword']){throw new db[(_0x4afc('0x8a'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x4c27a2[_0x4afc('0x29')][_0x4afc('0x26')]===_0x4afc('0x29')){if(!_0x4c27a2['body'][_0x4afc('0x89')]){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x8f'));}if(_0x37a056[_0x4afc('0x26')]!==_0x4afc('0x2b')){throw new db[(_0x4afc('0x8a'))][(_0x4afc('0x8b'))](_0x4afc('0x7a'));}}else{throw new db['Sequelize']['ValidationError'](_0x4afc('0x7a'));}return _0x37a056;})[_0x4afc('0x12')](handleEntityNotFound(_0x1119a9,null))[_0x4afc('0x12')](function(_0x2b3bbb){return db['Setting'][_0x4afc('0x90')]({'attributes':['id','securePassword','enforcePasswordHistory','passwordHistoryLimit']})[_0x4afc('0x12')](function(_0x449529){if(_0x449529[_0x4afc('0x60')])authService[_0x4afc('0x61')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')]);if(!_0x449529[_0x4afc('0x91')]||!_0x2b3bbb[_0x4afc('0x92')])return _0x2b3bbb;authService[_0x4afc('0x93')](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],_0x2b3bbb[_0x4afc('0x92')],_0x449529[_0x4afc('0x94')]);return _0x2b3bbb;})['then'](saveUpdates({'password':_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],'passwordResetAt':_0x4c27a2[_0x4afc('0x29')]['id']==_0x4c27a2[_0x4afc('0x50')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x4c27a2[_0x4afc('0x5a')][_0x4afc('0x89')],_0x2b3bbb['previousPasswords'])},null));})[_0x4afc('0x12')](respondWithResult(_0x1119a9,null))[_0x4afc('0x1b')](handleError(_0x1119a9,null));};exports[_0x4afc('0x95')]=function(_0x46f5c1,_0x504eae){var _0x42f066=_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x96')];return db['User'][_0x4afc('0x31')]({'where':{'id':_0x46f5c1[_0x4afc('0x50')]['id']},'attributes':['id','name',_0x4afc('0x26'),'online',_0x4afc('0x97'),_0x4afc('0x98'),_0x4afc('0x99')]})[_0x4afc('0x12')](handleEntityNotFound(_0x504eae,null))[_0x4afc('0x12')](function(_0x2f5d0b){if(_0x2f5d0b){if(!utils[_0x4afc('0x9a')](_0x42f066)){throw new db[(_0x4afc('0x8a'))]['ValidationError']('Unknown\x20channel');}return _0x2f5d0b[_0x4afc('0x9b')+_[_0x4afc('0x9c')](_0x42f066[_0x4afc('0x9d')]())+'Queues'](_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')],{'penalty':_0x46f5c1['body'][_0x4afc('0x9e')]||0x0})[_0x4afc('0x9f')](function(_0x173149){for(var _0x5ca9fe=0x0;_0x5ca9fe<_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x5ca9fe+=0x1){var _0x53d197={'UserId':Number(_0x46f5c1[_0x4afc('0x50')]['id'])};_0x53d197[_[_0x4afc('0x9c')](_0x42f066[_0x4afc('0x9d')]())+_0x4afc('0xa0')]=Number(_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')][_0x5ca9fe]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x42f066['toLowerCase']())+_0x4afc('0xa2'),_0x53d197);}return _0x173149;})[_0x4afc('0x12')](function(){if(_0x42f066===_0x4afc('0xa3')){return db['VoiceQueue']['findAll']({'where':{'id':_0x46f5c1[_0x4afc('0x5a')][_0x4afc('0x5d')]||[]},'raw':!![],'attributes':['id',_0x4afc('0x36')]});}})[_0x4afc('0x12')](function(_0xc8fba2){var _0x4118f3=_0x2f5d0b[_0x4afc('0x25')]({'plain':!![]});var _0x1cb863=[];if(_0x42f066===_0x4afc('0xa3')&&_0x4118f3['role']===_0x4afc('0x2b')&&_0x4118f3[_0x4afc('0xa4')]){for(var _0x456618=0x0;_0x456618<_0xc8fba2['length'];_0x456618+=0x1){_0x1cb863[_0x4afc('0x44')]({'membername':_0x4118f3[_0x4afc('0x36')],'UserId':_0x4118f3['id'],'queue_name':_0xc8fba2[_0x456618][_0x4afc('0x36')],'VoiceQueueId':_0xc8fba2[_0x456618]['id'],'interface':_['isNil'](_0x4118f3[_0x4afc('0x99')])?util[_0x4afc('0xa5')](_0x4afc('0xa6'),_0x4118f3[_0x4afc('0x36')]):_0x4118f3[_0x4afc('0x99')],'paused':_0x4118f3[_0x4afc('0x98')]||![],'penalty':_0x46f5c1['body'][_0x4afc('0x9e')]||0x0});}return BPromise['each'](_0x1cb863,function(_0x5b721b){return db[_0x4afc('0xa7')]['upsert'](_0x5b721b);});}return _0x2f5d0b;});}})[_0x4afc('0x12')](respondWithStatusCode(_0x504eae,null))[_0x4afc('0x1b')](handleError(_0x504eae,null));};exports[_0x4afc('0xa8')]=function(_0x1191ac,_0x5bbeab){var _0x455a57;return db['User'][_0x4afc('0x31')]({'where':{'id':_0x1191ac[_0x4afc('0x50')]['id']},'attributes':['id','name',_0x4afc('0x26')]})[_0x4afc('0x12')](handleEntityNotFound(_0x5bbeab,null))[_0x4afc('0x12')](function(_0x205e1b){if(_0x205e1b){_0x455a57=_0x205e1b;if(!_0x1191ac['query'][_0x4afc('0x96')]||!utils['isValidChannel'](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')])){throw new db['Sequelize'][(_0x4afc('0x8b'))](_0x4afc('0xa9'));}return _0x205e1b[_0x4afc('0xaa')+_[_0x4afc('0x9c')](_0x1191ac['query'][_0x4afc('0x96')]['toLowerCase']())+_0x4afc('0xab')](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')]);}})[_0x4afc('0x12')](function(_0x1fc5d8){if(_[_0x4afc('0xac')](_0x1191ac['query']['ids'])){for(var _0x1f0e12=0x0;_0x1f0e12<_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')][_0x4afc('0x49')];_0x1f0e12+=0x1){var _0x43fcf3={'UserId':Number(_0x1191ac[_0x4afc('0x50')]['id'])};_0x43fcf3[_['capitalize'](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')][_0x4afc('0x9d')]())+_0x4afc('0xa0')]=Number(_0x1191ac[_0x4afc('0x46')]['ids'][_0x1f0e12]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x1191ac['query'][_0x4afc('0x96')][_0x4afc('0x9d')]())+_0x4afc('0xad'),_0x43fcf3);}}else{var _0x43fcf3={'UserId':Number(_0x1191ac[_0x4afc('0x50')]['id'])};_0x43fcf3[_[_0x4afc('0x9c')](_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')]['toLowerCase']())+_0x4afc('0xa0')]=Number(_0x1191ac[_0x4afc('0x46')][_0x4afc('0x5d')]);socket[_0x4afc('0xa1')](_0x4afc('0x29')+_[_0x4afc('0x9c')](_0x1191ac[_0x4afc('0x46')]['channel'][_0x4afc('0x9d')]())+_0x4afc('0xad'),_0x43fcf3);}return _0x1fc5d8;})[_0x4afc('0x12')](function(){if(_0x1191ac[_0x4afc('0x46')][_0x4afc('0x96')]===_0x4afc('0xa3')){return db[_0x4afc('0xa7')]['destroy']({'where':{'UserId':_0x1191ac['params']['id'],'VoiceQueueId':_0x1191ac[_0x4afc('0x46')]['ids']},'individualHooks':!![]})[_0x4afc('0x12')](function(){return _0x455a57;});}return _0x455a57;})[_0x4afc('0x12')](respondWithStatusCode(_0x5bbeab,null))[_0x4afc('0x1b')](handleError(_0x5bbeab,null));};exports['addAvatar']=function(_0x75a628,_0x1ea1cb){_0x75a628[_0x4afc('0x5a')][_0x4afc('0xae')]=_0x75a628['file']['filename'];return db[_0x4afc('0x38')][_0x4afc('0x31')]({'where':{'id':_0x75a628[_0x4afc('0x50')]['id']}})['then'](handleEntityNotFound(_0x1ea1cb,null))[_0x4afc('0x12')](saveUpdates(_0x75a628['body'],null))[_0x4afc('0x12')](respondWithResult(_0x1ea1cb,null))['catch'](handleError(_0x1ea1cb,null));};exports[_0x4afc('0xaf')]=function(_0x54ea16,_0x1d79cd){var _0x4ba3a9=path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb2'));return db['User'][_0x4afc('0x31')]({'where':{'id':_0x54ea16['params']['id']},'attributes':['id',_0x4afc('0xae')],'raw':!![]})['then'](handleEntityNotFound(_0x1d79cd,null))[_0x4afc('0x12')](function(_0x2257f3){if(_0x2257f3){if(_['isNil'](_0x2257f3[_0x4afc('0xae')])){return _0x1d79cd['download'](_0x4ba3a9);}else{if(!fs['existsSync'](path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb3'),_0x2257f3[_0x4afc('0xae')]))){return _0x1d79cd[_0x4afc('0xb4')](_0x4ba3a9);}return _0x1d79cd[_0x4afc('0xb4')](path[_0x4afc('0xb0')](config[_0x4afc('0xb1')],_0x4afc('0xb3'),_0x2257f3['userpic']));}}})[_0x4afc('0x1b')](handleError(_0x1d79cd,null));};exports[_0x4afc('0xb5')]=function(_0x280319,_0x1e6529){return db[_0x4afc('0x38')]['find']({'where':{'id':_0x280319[_0x4afc('0x50')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x1e6529,null))[_0x4afc('0x12')](function(_0x14c79c){var _0x4df52a=[];values=_0x14c79c[_0x4afc('0x4c')];_0x4df52a[_0x4afc('0x44')](get_open_tabs('chat',_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4b'),_0x14c79c['dataValues']));_0x4df52a['push'](get_open_tabs(_0x4afc('0x59'),_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0xb6'),_0x14c79c[_0x4afc('0x4c')]));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4d'),_0x14c79c['dataValues']));_0x4df52a[_0x4afc('0x44')](get_open_tabs(_0x4afc('0x4e'),_0x14c79c[_0x4afc('0x4c')]));return BPromise[_0x4afc('0x4f')](_0x4df52a);})[_0x4afc('0x12')](function(_0x31f863){var _0x46f93b=[];if(_0x31f863){for(var _0x444586=0x0;_0x444586=_0x1809c3[_0xe132('0x57')]){throw new Error(_0xe132('0x58'));}})[_0xe132('0x27')](function(){if(_0x29664f){return db[_0xe132('0x2e')]['destroy']({'where':{'membername':_0x29664f['name']},'individualHooks':!![]});}})[_0xe132('0x27')](function(){if(_0x29664f){return _0x29664f['getVoiceQueues']({'raw':!![]});}})[_0xe132('0x27')](function(_0x4008ae){if(_0x29664f){if(_0x4008ae){var _0x2a576e=[];_0x4b46a1=_0x4008ae;if(_0x4b46a1[_0xe132('0x33')]){for(var _0x551c1a=0x0;_0x551c1a<_0x4b46a1['length'];_0x551c1a++){_0x2a576e[_0xe132('0x4b')](db[_0xe132('0x2e')][_0xe132('0x59')]({'membername':_0x29664f['name'],'UserId':_0x29664f['id'],'queue_name':_0x4b46a1[_0x551c1a]['name'],'VoiceQueueId':_0x4b46a1[_0x551c1a]['id'],'interface':_0x5022e9,'paused':_0x29664f[_0xe132('0x52')]||![],'penalty':_0x4b46a1[_0x551c1a][_0xe132('0x5a')]||0x0}));}return BPromise[_0xe132('0x4e')](_0x2a576e);}}}})[_0xe132('0x27')](function(){if(_0x29664f){return db[_0xe132('0x30')]['findAll']({'where':{'membername':_0x29664f[_0xe132('0x31')],'exitAt':null}});}})['then'](function(_0x3476ff){if(_0x29664f){if(_0x3476ff&&_0x3476ff[_0xe132('0x33')]){var _0x57c42b=[];_0x3476ff[_0xe132('0x37')](function(_0xd7ef2b){_0x57c42b[_0xe132('0x4b')](_0xd7ef2b['update']({'exitAt':moment()['format'](_0xe132('0x34'))}));});return BPromise['all'](_0x57c42b);}}})[_0xe132('0x27')](function(_0x39c38c){if(_0x29664f){var _0x27064b=[];var _0x3cd047=[];var _0x504364=utils['getChannels']();var _0x1d2390={'membername':_0x29664f[_0xe132('0x31')],'interface':_0x5022e9,'enterAt':moment()['format'](_0xe132('0x34')),'role':_0x29664f[_0xe132('0x2b')],'internal':_0x29664f[_0xe132('0x2c')]};_0x504364[_0xe132('0x37')](function(_0x37cfd7){_0x27064b['push'](_[_0xe132('0x5b')]({'channel':_0x37cfd7,'type':'LOGIN','data1':_0xe132('0x5c'),'data2':_0x5022e9},_0x1d2390));if(_0x29664f[_0xe132('0x52')]){_0x3cd047['push'](_[_0xe132('0x5b')]({'channel':_0x37cfd7,'type':_0xe132('0x32'),'data1':_0xe132('0x5d')},_0x1d2390));}});return db[_0xe132('0x30')][_0xe132('0x3e')](_0x27064b[_0xe132('0x5e')](_0x3cd047),{'individualHooks':!![]});}})[_0xe132('0x27')](function(){if(_0x29664f){return _0x29664f[_0xe132('0x2f')]({'online':!![],'lastLoginAt':moment()[_0xe132('0x3a')](_0xe132('0x34')),'voicePause':_0x29664f[_0xe132('0x52')]||![],'mailPause':_0x29664f['loginInPause']||![],'chatPause':_0x29664f['loginInPause']||![],'faxPause':_0x29664f[_0xe132('0x52')]||![],'smsPause':_0x29664f['loginInPause']||![],'openchannelPause':_0x29664f['loginInPause']||![],'pauseType':_0x29664f[_0xe132('0x52')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0xe132('0x3a')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5022e9});}})[_0xe132('0x27')](function(_0x61511a){_0x3ccdc3(_0x61511a);})['catch'](function(_0x417949){_0x178379(_0x4a7305[_0xe132('0x17')](0x1f4,_0x417949[_0xe132('0x19')]));});});}; \ No newline at end of file +var _0xb764=['forEach','push','SIP/%s','PAUSE','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','MemberReport','update','catch','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','mail','chat','fax','openchannel','system','%s%s','Pause','all','LogoutUser','destroy','LoginUser','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','getVoiceQueues','upsert','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','localhost','register','request','then','info','request\x20sent','debug','stringify','error','code','User,\x20%s,\x20%s','message','GetUser','User','findAll','options','where','attributes','limit','include','map','model','find','raw','ShowUser','name','role','internal','interface','UserVoiceQueueRt','length','format','getChannels'];(function(_0x19a0e1,_0x113519){var _0x4499ef=function(_0x51ea1c){while(--_0x51ea1c){_0x19a0e1['push'](_0x19a0e1['shift']());}};_0x4499ef(++_0x113519);}(_0xb764,0x7f));var _0x4b76=function(_0x7aa314,_0x10ea28){_0x7aa314=_0x7aa314-0x0;var _0x3ff9bd=_0xb764[_0x7aa314];return _0x3ff9bd;};'use strict';var _=require(_0x4b76('0x0'));var util=require(_0x4b76('0x1'));var moment=require(_0x4b76('0x2'));var BPromise=require(_0x4b76('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b76('0x4'));var db=require(_0x4b76('0x5'))['db'];var utils=require(_0x4b76('0x6'));var logger=require('../../config/logger')(_0x4b76('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4b76('0x8')]({'port':0x232a});config[_0x4b76('0x9')]=_['defaults'](config['redis'],{'host':_0x4b76('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4b76('0x9')]));require('./user.socket')[_0x4b76('0xb')](socket);function respondWithRpcPromise(_0x2ad4e2,_0x38c8af,_0x3d92b9){return new BPromise(function(_0xcde8e7,_0x346a7a){return client[_0x4b76('0xc')](_0x2ad4e2,_0x3d92b9)[_0x4b76('0xd')](function(_0x3b0cf9){logger[_0x4b76('0xe')]('User,\x20%s,\x20%s',_0x38c8af,_0x4b76('0xf'));logger[_0x4b76('0x10')]('User,\x20%s,\x20%s,\x20%s',_0x38c8af,_0x4b76('0xf'),JSON[_0x4b76('0x11')](_0x3b0cf9));if(_0x3b0cf9[_0x4b76('0x12')]){if(_0x3b0cf9[_0x4b76('0x12')][_0x4b76('0x13')]===0x1f4){logger[_0x4b76('0x12')](_0x4b76('0x14'),_0x38c8af,_0x3b0cf9[_0x4b76('0x12')]['message']);return _0x346a7a(_0x3b0cf9[_0x4b76('0x12')][_0x4b76('0x15')]);}logger[_0x4b76('0x12')](_0x4b76('0x14'),_0x38c8af,_0x3b0cf9[_0x4b76('0x12')][_0x4b76('0x15')]);return _0xcde8e7(_0x3b0cf9['error']['message']);}else{logger['info'](_0x4b76('0x14'),_0x38c8af,_0x4b76('0xf'));_0xcde8e7(_0x3b0cf9['result'][_0x4b76('0x15')]);}})['catch'](function(_0x419dd0){logger[_0x4b76('0x12')](_0x4b76('0x14'),_0x38c8af,_0x419dd0);_0x346a7a(_0x419dd0);});});}exports[_0x4b76('0x16')]=function(_0x4b61ad){var _0xca2aa7=this;return new Promise(function(_0x3ecf1f,_0x14451f){return db[_0x4b76('0x17')][_0x4b76('0x18')]({'raw':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')][_0x4b76('0x1a')]||null:null,'attributes':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')][_0x4b76('0x1b')]||null:null,'limit':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad['options'][_0x4b76('0x1c')]||null:null,'include':_0x4b61ad[_0x4b76('0x19')]?_0x4b61ad[_0x4b76('0x19')][_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x4b61ad['options'][_0x4b76('0x1d')],function(_0x2aa743){return{'model':db[_0x2aa743[_0x4b76('0x1f')]],'as':_0x2aa743['as'],'attributes':_0x2aa743[_0x4b76('0x1b')],'include':_0x2aa743[_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x2aa743[_0x4b76('0x1d')],function(_0x194cc5){return{'model':db[_0x194cc5[_0x4b76('0x1f')]],'as':_0x194cc5['as'],'attributes':_0x194cc5['attributes'],'include':_0x194cc5[_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x194cc5[_0x4b76('0x1d')],function(_0x2a8f5d){return{'model':db[_0x2a8f5d[_0x4b76('0x1f')]],'as':_0x2a8f5d['as'],'attributes':_0x2a8f5d[_0x4b76('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd6a772){logger['info'](_0x4b76('0x16'),_0x4b61ad);logger[_0x4b76('0x10')](_0x4b76('0x16'),_0x4b61ad,JSON[_0x4b76('0x11')](_0xd6a772));_0x3ecf1f(_0xd6a772);})['catch'](function(_0x16ea09){logger[_0x4b76('0x12')](_0x4b76('0x16'),_0x16ea09[_0x4b76('0x15')],_0x4b61ad);_0x14451f(_0xca2aa7[_0x4b76('0x12')](0x1f4,_0x16ea09[_0x4b76('0x15')]));});});};exports['ShowUser']=function(_0x502e39){var _0xfa0283=this;return new Promise(function(_0xf6b6db,_0x551998){return db[_0x4b76('0x17')][_0x4b76('0x20')]({'raw':_0x502e39['options']?_0x502e39[_0x4b76('0x19')][_0x4b76('0x21')]===undefined?!![]:![]:!![],'where':_0x502e39[_0x4b76('0x19')]?_0x502e39[_0x4b76('0x19')]['where']||null:null,'attributes':_0x502e39[_0x4b76('0x19')]?_0x502e39['options'][_0x4b76('0x1b')]||null:null,'include':_0x502e39['options']?_0x502e39[_0x4b76('0x19')]['include']?_[_0x4b76('0x1e')](_0x502e39[_0x4b76('0x19')][_0x4b76('0x1d')],function(_0x2577dd){return{'model':db[_0x2577dd['model']],'as':_0x2577dd['as'],'attributes':_0x2577dd[_0x4b76('0x1b')],'include':_0x2577dd[_0x4b76('0x1d')]?_[_0x4b76('0x1e')](_0x2577dd['include'],function(_0x538f36){return{'model':db[_0x538f36[_0x4b76('0x1f')]],'as':_0x538f36['as'],'attributes':_0x538f36[_0x4b76('0x1b')],'include':_0x538f36['include']?_[_0x4b76('0x1e')](_0x538f36[_0x4b76('0x1d')],function(_0x577098){return{'model':db[_0x577098[_0x4b76('0x1f')]],'as':_0x577098['as'],'attributes':_0x577098['attributes']};}):[]};}):[]};}):[]:[]})[_0x4b76('0xd')](function(_0x5c15ad){logger['info'](_0x4b76('0x22'),_0x502e39);logger[_0x4b76('0x10')](_0x4b76('0x22'),_0x502e39,JSON[_0x4b76('0x11')](_0x5c15ad));_0xf6b6db(_0x5c15ad);})['catch'](function(_0x3d9e0c){logger[_0x4b76('0x12')]('ShowUser',_0x3d9e0c[_0x4b76('0x15')],_0x502e39);_0x551998(_0xfa0283[_0x4b76('0x12')](0x1f4,_0x3d9e0c['message']));});});};exports['PauseUser']=function(_0x594788){var _0x4fa866=this;return new Promise(function(_0x3bd005,_0x2afc0b){var _0x4bacaf;return db[_0x4b76('0x17')][_0x4b76('0x20')]({'where':_0x594788[_0x4b76('0x19')][_0x4b76('0x1a')]||{},'attributes':['id',_0x4b76('0x23'),_0x4b76('0x24'),_0x4b76('0x25'),_0x4b76('0x26')]})['then'](function(_0x794375){if(_0x794375){_0x4bacaf=_0x794375;return db[_0x4b76('0x27')]['update']({'paused':0x1},{'where':{'UserId':_0x4bacaf['id']},'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x4bacaf){return db['MemberReport'][_0x4b76('0x18')]({'where':{'membername':_0x4bacaf[_0x4b76('0x23')],'type':'PAUSE','exitAt':null}});}})[_0x4b76('0xd')](function(_0x1d9f03){if(_0x4bacaf){if(_0x1d9f03&&_0x1d9f03[_0x4b76('0x28')]){var _0x3dafc6=moment()[_0x4b76('0x29')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4a8288=0x0,_0x21c7b3=_0x1d9f03[_0x4b76('0x28')];_0x4a8288<_0x21c7b3;_0x4a8288++){_0x1d9f03[_0x4a8288]['updateAttributes']({'exitAt':_0x3dafc6});}}}})[_0x4b76('0xd')](function(){if(_0x4bacaf){var _0x320c17=[];var _0x28e975=utils[_0x4b76('0x2a')]();_0x28e975[_0x4b76('0x2b')](function(_0x1d81df){_0x320c17[_0x4b76('0x2c')]({'channel':_0x1d81df,'membername':_0x4bacaf[_0x4b76('0x23')],'interface':_['isNil'](_0x4bacaf['interface'])?util[_0x4b76('0x29')](_0x4b76('0x2d'),_0x4bacaf[_0x4b76('0x23')]):_0x4bacaf[_0x4b76('0x26')],'type':_0x4b76('0x2e'),'enterAt':moment()['format'](_0x4b76('0x2f')),'data1':_0x594788[_0x4b76('0x30')][_0x4b76('0x31')]||_0x4b76('0x32'),'role':_0x4bacaf[_0x4b76('0x24')],'internal':_0x4bacaf['internal'],'uniqueid':_0x594788[_0x4b76('0x30')]['uniqueid']||null});});return db[_0x4b76('0x33')]['bulkCreate'](_0x320c17,{'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x4bacaf){return _0x4bacaf[_0x4b76('0x34')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x594788[_0x4b76('0x30')]['type']||_0x4b76('0x32'),'lastPauseAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f'))});}})[_0x4b76('0xd')](function(_0x2fab08){_0x3bd005(_0x2fab08);})[_0x4b76('0x35')](function(_0x5c54b9){_0x2afc0b(_0x4fa866[_0x4b76('0x12')](0x1f4,_0x5c54b9[_0x4b76('0x15')]));});});};exports[_0x4b76('0x36')]=function(_0x6bd606){var _0x42769b=this;return new Promise(function(_0x2c3a7f,_0x37f956){var _0x51c9da;return db[_0x4b76('0x17')][_0x4b76('0x37')]({'where':_0x6bd606[_0x4b76('0x19')]['where']||{},'attributes':['id',_0x4b76('0x23')]})['then'](function(_0x2df2a7){if(_0x2df2a7){_0x51c9da=_0x2df2a7;if(_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')]&&!utils[_0x4b76('0x39')](_0x6bd606[_0x4b76('0x30')]['channel'])){throw new Error(_0x4b76('0x3a'));}switch(_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')]){case _0x4b76('0x3b'):return db[_0x4b76('0x27')][_0x4b76('0x34')]({'paused':0x0},{'where':{'UserId':_0x51c9da['id']}})['then'](function(){return db[_0x4b76('0x33')]['find']({'where':{'channel':_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')],'membername':_0x51c9da[_0x4b76('0x23')],'type':_0x4b76('0x2e'),'exitAt':null}});})[_0x4b76('0xd')](function(_0x539d2a){if(_0x539d2a){return _0x539d2a[_0x4b76('0x34')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x4b76('0xd')](function(){return _0x51c9da[_0x4b76('0x34')]({'voicePause':![]});});case _0x4b76('0x3c'):case _0x4b76('0x3d'):case _0x4b76('0x3e'):case'sms':case _0x4b76('0x3f'):case'whatsapp':return db['MemberReport'][_0x4b76('0x20')]({'where':{'channel':_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')],'membername':_0x51c9da[_0x4b76('0x23')],'type':_0x4b76('0x2e'),'exitAt':null}})[_0x4b76('0xd')](function(_0xbd7878){return _0xbd7878['update']({'exitAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'data2':_0x4b76('0x40')},{'individualHooks':!![]});})[_0x4b76('0xd')](function(){var _0x125ee3={};_['set'](_0x125ee3,util['format'](_0x4b76('0x41'),_0x6bd606[_0x4b76('0x30')][_0x4b76('0x38')],_0x4b76('0x42')),![]);return _0x51c9da[_0x4b76('0x34')](_0x125ee3);});default:return db[_0x4b76('0x27')][_0x4b76('0x34')]({'paused':0x0},{'where':{'UserId':_0x51c9da['id']}})[_0x4b76('0xd')](function(){return db['MemberReport'][_0x4b76('0x18')]({'where':{'membername':_0x51c9da['name'],'type':_0x4b76('0x2e'),'exitAt':null}});})[_0x4b76('0xd')](function(_0x2df662){var _0x415070=[];_0x2df662[_0x4b76('0x2b')](function(_0x2cd1e5){_0x415070['push'](_0x2cd1e5[_0x4b76('0x34')]({'exitAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'data2':_0x4b76('0x40')}));});return BPromise[_0x4b76('0x43')](_0x415070);})[_0x4b76('0xd')](function(){return _0x51c9da[_0x4b76('0x34')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x4b76('0xd')](function(_0x57dd76){_0x2c3a7f(_0x57dd76);})[_0x4b76('0x35')](function(_0x18d015){_0x37f956(_0x42769b[_0x4b76('0x12')](0x1f4,_0x18d015[_0x4b76('0x15')]));});});};exports[_0x4b76('0x44')]=function(_0x5d113b){var _0x33d1ce=this;return new Promise(function(_0x32300d,_0x1ee389){var _0x2b8597;return db[_0x4b76('0x17')][_0x4b76('0x37')]({'where':_0x5d113b[_0x4b76('0x19')]['where']||{},'attributes':['id',_0x4b76('0x23')]})[_0x4b76('0xd')](function(_0x24f90a){if(_0x24f90a){_0x2b8597=_0x24f90a;return db['UserVoiceQueueRt'][_0x4b76('0x45')]({'where':{'membername':_0x2b8597[_0x4b76('0x23')]},'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x2b8597){return db[_0x4b76('0x33')][_0x4b76('0x18')]({'where':{'membername':_0x2b8597[_0x4b76('0x23')],'exitAt':null}});}})[_0x4b76('0xd')](function(_0x3be91d){if(_0x2b8597){if(_0x3be91d&&_0x3be91d[_0x4b76('0x28')]){var _0x240430=[];_0x3be91d[_0x4b76('0x2b')](function(_0x56ed9a){_0x240430['push'](_0x56ed9a['update']({'exitAt':moment()['format'](_0x4b76('0x2f'))}));});return BPromise['all'](_0x240430);}}})[_0x4b76('0xd')](function(){if(_0x2b8597){return _0x2b8597[_0x4b76('0x34')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x409c54){_0x32300d(_0x409c54);})[_0x4b76('0x35')](function(_0x2e5cf1){_0x1ee389(_0x33d1ce[_0x4b76('0x12')](0x1f4,_0x2e5cf1['message']));});});};exports[_0x4b76('0x46')]=function(_0xad33d1){var _0x46bbe7=this;return new Promise(function(_0x289261,_0x250c0f){var _0x456d0f;var _0x201e76;var _0x450f22;var _0x45df9f;return db['User'][_0x4b76('0x37')]({'where':_0xad33d1[_0x4b76('0x19')][_0x4b76('0x1a')]||{},'attributes':['id','name',_0x4b76('0x24'),'mobile',_0x4b76('0x47'),_0x4b76('0x25'),_0x4b76('0x48'),_0x4b76('0x26')]})[_0x4b76('0xd')](function(_0x2e86d2){if(_0x2e86d2){_0x456d0f=_0x2e86d2;_0x45df9f=_0xad33d1[_0x4b76('0x30')][_0x4b76('0x26')]?_0xad33d1[_0x4b76('0x30')][_0x4b76('0x26')]:util[_0x4b76('0x29')](_0x4b76('0x2d'),_0x456d0f[_0x4b76('0x23')]);return db[_0x4b76('0x17')][_0x4b76('0x49')]({'where':{'role':_0x4b76('0x4a'),'online':!![],'id':{'$ne':_0x456d0f['id']}}});}})['then'](function(_0x45b26a){if(_0x45b26a){_0x450f22=_0x45b26a;return require(_0x4b76('0x4b'))[_0x4b76('0x4c')]();}})['then'](function(_0x3d0f80){if(_0x3d0f80&&_0x3d0f80[_0x4b76('0x4d')]&&_0x450f22>=_0x3d0f80[_0x4b76('0x4d')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x4b76('0xd')](function(){if(_0x456d0f){return db['UserVoiceQueueRt'][_0x4b76('0x45')]({'where':{'membername':_0x456d0f[_0x4b76('0x23')]},'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x456d0f){return _0x456d0f[_0x4b76('0x4e')]({'raw':!![]});}})['then'](function(_0x491d71){if(_0x456d0f){if(_0x491d71){var _0x3640f1=[];_0x201e76=_0x491d71;if(_0x201e76[_0x4b76('0x28')]){for(var _0x4875dd=0x0;_0x4875dd<_0x201e76[_0x4b76('0x28')];_0x4875dd++){_0x3640f1['push'](db[_0x4b76('0x27')][_0x4b76('0x4f')]({'membername':_0x456d0f['name'],'UserId':_0x456d0f['id'],'queue_name':_0x201e76[_0x4875dd][_0x4b76('0x23')],'VoiceQueueId':_0x201e76[_0x4875dd]['id'],'interface':_0x45df9f,'paused':_0x456d0f['loginInPause']||![],'penalty':_0x201e76[_0x4875dd]['UserVoiceQueue.penalty']||0x0}));}return BPromise['all'](_0x3640f1);}}}})[_0x4b76('0xd')](function(){if(_0x456d0f){return db[_0x4b76('0x33')][_0x4b76('0x18')]({'where':{'membername':_0x456d0f[_0x4b76('0x23')],'exitAt':null}});}})[_0x4b76('0xd')](function(_0x20767e){if(_0x456d0f){if(_0x20767e&&_0x20767e['length']){var _0x4d50c4=[];_0x20767e[_0x4b76('0x2b')](function(_0x5d8d58){_0x4d50c4['push'](_0x5d8d58[_0x4b76('0x34')]({'exitAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f'))}));});return BPromise['all'](_0x4d50c4);}}})['then'](function(_0x4d16db){if(_0x456d0f){var _0x3132d8=[];var _0x5a8935=[];var _0x297d61=utils[_0x4b76('0x2a')]();var _0x283363={'membername':_0x456d0f[_0x4b76('0x23')],'interface':_0x45df9f,'enterAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'role':_0x456d0f[_0x4b76('0x24')],'internal':_0x456d0f['internal']};_0x297d61[_0x4b76('0x2b')](function(_0x34ab83){_0x3132d8[_0x4b76('0x2c')](_[_0x4b76('0x50')]({'channel':_0x34ab83,'type':_0x4b76('0x51'),'data1':_0x4b76('0x52'),'data2':_0x45df9f},_0x283363));if(_0x456d0f[_0x4b76('0x48')]){_0x5a8935[_0x4b76('0x2c')](_['merge']({'channel':_0x34ab83,'type':'PAUSE','data1':_0x4b76('0x53')},_0x283363));}});return db[_0x4b76('0x33')]['bulkCreate'](_0x3132d8[_0x4b76('0x54')](_0x5a8935),{'individualHooks':!![]});}})[_0x4b76('0xd')](function(){if(_0x456d0f){return _0x456d0f['update']({'online':!![],'lastLoginAt':moment()[_0x4b76('0x29')](_0x4b76('0x2f')),'voicePause':_0x456d0f[_0x4b76('0x48')]||![],'mailPause':_0x456d0f['loginInPause']||![],'chatPause':_0x456d0f[_0x4b76('0x48')]||![],'faxPause':_0x456d0f[_0x4b76('0x48')]||![],'smsPause':_0x456d0f[_0x4b76('0x48')]||![],'openchannelPause':_0x456d0f['loginInPause']||![],'pauseType':_0x456d0f[_0x4b76('0x48')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x4b76('0x29')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x45df9f});}})['then'](function(_0x184701){_0x289261(_0x184701);})[_0x4b76('0x35')](function(_0x55020e){_0x250c0f(_0x46bbe7['error'](0x1f4,_0x55020e[_0x4b76('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 2df1c32..2201f05 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 _0x2cff=['removeListener','length','user:','./user.events','save','remove','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2cff,0x1ed));var _0xf2cf=function(_0x15ace1,_0x4a4c50){_0x15ace1=_0x15ace1-0x0;var _0x74c31f=_0x2cff[_0x15ace1];return _0x74c31f;};'use strict';var UserEvents=require(_0xf2cf('0x0'));var events=[_0xf2cf('0x1'),_0xf2cf('0x2'),_0xf2cf('0x3')];function createListener(_0x32e0f1,_0x202658){return function(_0x162103){_0x202658['emit'](_0x32e0f1,_0x162103);};}function removeListener(_0x4c0772,_0x31d036){return function(){UserEvents[_0xf2cf('0x4')](_0x4c0772,_0x31d036);};}exports['register']=function(_0x25cf9d){for(var _0x5b4f38=0x0,_0x49bcc1=events[_0xf2cf('0x5')];_0x5b4f38<_0x49bcc1;_0x5b4f38++){var _0x257626=events[_0x5b4f38];var _0x170cfd=createListener(_0xf2cf('0x6')+_0x257626,_0x25cf9d);UserEvents['on'](_0x257626,_0x170cfd);}}; \ No newline at end of file +var _0x60ef=['emit','removeListener','register','length','user:','./user.events','save','update'];(function(_0x4ea2dc,_0x48f726){var _0x6fe04=function(_0x2f423f){while(--_0x2f423f){_0x4ea2dc['push'](_0x4ea2dc['shift']());}};_0x6fe04(++_0x48f726);}(_0x60ef,0x7d));var _0xf60e=function(_0x1cd8ed,_0x16aed0){_0x1cd8ed=_0x1cd8ed-0x0;var _0x259a1d=_0x60ef[_0x1cd8ed];return _0x259a1d;};'use strict';var UserEvents=require(_0xf60e('0x0'));var events=[_0xf60e('0x1'),'remove',_0xf60e('0x2')];function createListener(_0x5ec678,_0x17f75b){return function(_0x428a7a){_0x17f75b[_0xf60e('0x3')](_0x5ec678,_0x428a7a);};}function removeListener(_0x64c54c,_0x5ee522){return function(){UserEvents[_0xf60e('0x4')](_0x64c54c,_0x5ee522);};}exports[_0xf60e('0x5')]=function(_0x70e16f){for(var _0x534cbe=0x0,_0x14554f=events[_0xf60e('0x6')];_0x534cbe<_0x14554f;_0x534cbe++){var _0x4d1b93=events[_0x534cbe];var _0x1601c9=createListener(_0xf60e('0x7')+_0x4d1b93,_0x70e16f);UserEvents['on'](_0x4d1b93,_0x1601c9);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 084008b..8f3e103 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1121c6,_0x4b400d){var _0x207280=function(_0x8347ba){while(--_0x8347ba){_0x1121c6['push'](_0x1121c6['shift']());}};_0x207280(++_0x4b400d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x15ab15,_0x1ab4c0){var _0x2952d2=function(_0x368b2a){while(--_0x368b2a){_0x15ab15['push'](_0x15ab15['shift']());}};_0x2952d2(++_0x1ab4c0);}(_0xe706,0xa3));var _0x6e70=function(_0x5cc9ae,_0x116739){_0x5cc9ae=_0x5cc9ae-0x0;var _0xef9aa1=_0xe706[_0x5cc9ae];return _0xef9aa1;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 6c8799d..081eeea 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 _0xf611=['INTEGER'];(function(_0x4ac522,_0x2eedf0){var _0x516d58=function(_0x1c1c84){while(--_0x1c1c84){_0x4ac522['push'](_0x4ac522['shift']());}};_0x516d58(++_0x2eedf0);}(_0xf611,0x183));var _0x1f61=function(_0x40d80a,_0x5e5089){_0x40d80a=_0x40d80a-0x0;var _0x335bfb=_0xf611[_0x40d80a];return _0x335bfb;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x1f61('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5a8b=['INTEGER','exports'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0x5a8b,0x16d));var _0xb5a8=function(_0x132d91,_0x4c98a8){_0x132d91=_0x132d91-0x0;var _0x233c3d=_0x5a8b[_0x132d91];return _0x233c3d;};'use strict';var Sequelize=require('sequelize');module[_0xb5a8('0x0')]={'penalty':{'type':Sequelize[_0xb5a8('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index dcd64a1..302ffcc 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 _0x4d8f=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','../../config/logger'];(function(_0x32520c,_0x3b6a89){var _0x427373=function(_0x357838){while(--_0x357838){_0x32520c['push'](_0x32520c['shift']());}};_0x427373(++_0x3b6a89);}(_0x4d8f,0x1ee));var _0xf4d8=function(_0x3e45d0,_0x559038){_0x3e45d0=_0x3e45d0-0x0;var _0x5c4941=_0x4d8f[_0x3e45d0];return _0x5c4941;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf4d8('0x0'))(_0xf4d8('0x1'));var moment=require(_0xf4d8('0x2'));var BPromise=require(_0xf4d8('0x3'));var rp=require(_0xf4d8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4d8('0x5'));var config=require(_0xf4d8('0x6'));var attributes=require(_0xf4d8('0x7'));module[_0xf4d8('0x8')]=function(_0xacbfc1,_0x5c10e5){return _0xacbfc1['define'](_0xf4d8('0x9'),attributes,{'tableName':_0xf4d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1fce=['api','moment','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','user_has_chat_queues','lodash','util','../../config/logger'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x1fce,0x10e));var _0xe1fc=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1fce[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xe1fc('0x0'));var util=require(_0xe1fc('0x1'));var logger=require(_0xe1fc('0x2'))(_0xe1fc('0x3'));var moment=require(_0xe1fc('0x4'));var BPromise=require(_0xe1fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1fc('0x6'));var rimraf=require(_0xe1fc('0x7'));var config=require(_0xe1fc('0x8'));var attributes=require(_0xe1fc('0x9'));module[_0xe1fc('0xa')]=function(_0x345253,_0x2ec785){return _0x345253[_0xe1fc('0xb')]('UserChatQueue',attributes,{'tableName':_0xe1fc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index a16d9a7..a467c00 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 _0xd7cf=['http','request','then','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5e06d0,_0x2b5796){var _0x4b9fe9=function(_0x58aa27){while(--_0x58aa27){_0x5e06d0['push'](_0x5e06d0['shift']());}};_0x4b9fe9(++_0x2b5796);}(_0xd7cf,0xfd));var _0xfd7c=function(_0x237f8b,_0xc5eddb){_0x237f8b=_0x237f8b-0x0;var _0x423f94=_0xd7cf[_0x237f8b];return _0x423f94;};'use strict';var _=require(_0xfd7c('0x0'));var util=require(_0xfd7c('0x1'));var moment=require(_0xfd7c('0x2'));var BPromise=require(_0xfd7c('0x3'));var rs=require(_0xfd7c('0x4'));var fs=require('fs');var Redis=require(_0xfd7c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd7c('0x6'));var logger=require(_0xfd7c('0x7'))('rpc');var config=require(_0xfd7c('0x8'));var jayson=require(_0xfd7c('0x9'));var client=jayson[_0xfd7c('0xa')][_0xfd7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34fd96,_0x4da8e9,_0x3ac205){return new BPromise(function(_0x4f21ae,_0x2e3e7c){return client[_0xfd7c('0xc')](_0x34fd96,_0x3ac205)[_0xfd7c('0xd')](function(_0x5a015b){logger['info'](_0xfd7c('0xe'),_0x4da8e9,'request\x20sent');logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x4da8e9,_0xfd7c('0x11'),JSON[_0xfd7c('0x12')](_0x5a015b));if(_0x5a015b[_0xfd7c('0x13')]){if(_0x5a015b['error']['code']===0x1f4){logger['error'](_0xfd7c('0xe'),_0x4da8e9,_0x5a015b['error'][_0xfd7c('0x14')]);return _0x2e3e7c(_0x5a015b[_0xfd7c('0x13')][_0xfd7c('0x14')]);}logger[_0xfd7c('0x13')](_0xfd7c('0xe'),_0x4da8e9,_0x5a015b[_0xfd7c('0x13')][_0xfd7c('0x14')]);return _0x4f21ae(_0x5a015b[_0xfd7c('0x13')][_0xfd7c('0x14')]);}else{logger[_0xfd7c('0x15')](_0xfd7c('0xe'),_0x4da8e9,_0xfd7c('0x11'));_0x4f21ae(_0x5a015b[_0xfd7c('0x16')][_0xfd7c('0x14')]);}})[_0xfd7c('0x17')](function(_0x121d3a){logger[_0xfd7c('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x4da8e9,_0x121d3a);_0x2e3e7c(_0x121d3a);});});} \ No newline at end of file +var _0x01cd=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c518c,_0x383352){var _0x2650cb=function(_0x45fe77){while(--_0x45fe77){_0x1c518c['push'](_0x1c518c['shift']());}};_0x2650cb(++_0x383352);}(_0x01cd,0x169));var _0xd01c=function(_0x363560,_0x156d88){_0x363560=_0x363560-0x0;var _0x18a1a2=_0x01cd[_0x363560];return _0x18a1a2;};'use strict';var _=require(_0xd01c('0x0'));var util=require(_0xd01c('0x1'));var moment=require(_0xd01c('0x2'));var BPromise=require(_0xd01c('0x3'));var rs=require(_0xd01c('0x4'));var fs=require('fs');var Redis=require(_0xd01c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd01c('0x6'));var logger=require(_0xd01c('0x7'))(_0xd01c('0x8'));var config=require(_0xd01c('0x9'));var jayson=require(_0xd01c('0xa'));var client=jayson['client'][_0xd01c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x305b63,_0x1732ad,_0x1cafc2){return new BPromise(function(_0x128233,_0x5c4ce6){return client[_0xd01c('0xc')](_0x305b63,_0x1cafc2)[_0xd01c('0xd')](function(_0x4e8976){logger[_0xd01c('0xe')](_0xd01c('0xf'),_0x1732ad,_0xd01c('0x10'));logger[_0xd01c('0x11')](_0xd01c('0x12'),_0x1732ad,_0xd01c('0x10'),JSON[_0xd01c('0x13')](_0x4e8976));if(_0x4e8976[_0xd01c('0x14')]){if(_0x4e8976[_0xd01c('0x14')][_0xd01c('0x15')]===0x1f4){logger['error'](_0xd01c('0xf'),_0x1732ad,_0x4e8976['error'][_0xd01c('0x16')]);return _0x5c4ce6(_0x4e8976['error'][_0xd01c('0x16')]);}logger[_0xd01c('0x14')](_0xd01c('0xf'),_0x1732ad,_0x4e8976[_0xd01c('0x14')][_0xd01c('0x16')]);return _0x128233(_0x4e8976[_0xd01c('0x14')][_0xd01c('0x16')]);}else{logger[_0xd01c('0xe')](_0xd01c('0xf'),_0x1732ad,'request\x20sent');_0x128233(_0x4e8976[_0xd01c('0x17')][_0xd01c('0x16')]);}})['catch'](function(_0x172904){logger[_0xd01c('0x14')](_0xd01c('0xf'),_0x1732ad,_0x172904);_0x5c4ce6(_0x172904);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 5ab2a84..83c7fad 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1a900c,_0x1acf07){var _0x12dc40=function(_0x448645){while(--_0x448645){_0x1a900c['push'](_0x1a900c['shift']());}};_0x12dc40(++_0x1acf07);}(_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(_0x5d8654,_0x4175a9){var _0x39572b=function(_0x4ad6e7){while(--_0x4ad6e7){_0x5d8654['push'](_0x5d8654['shift']());}};_0x39572b(++_0x4175a9);}(_0xe706,0xa3));var _0x6e70=function(_0x314085,_0x4235c6){_0x314085=_0x314085-0x0;var _0x26190a=_0xe706[_0x314085];return _0x26190a;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 31e2edd..9631aee 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 _0x61ab=['sequelize','exports','INTEGER','STRING'];(function(_0x4ff87f,_0x3c3897){var _0x41d93d=function(_0x386b0c){while(--_0x386b0c){_0x4ff87f['push'](_0x4ff87f['shift']());}};_0x41d93d(++_0x3c3897);}(_0x61ab,0x64));var _0xb61a=function(_0x509607,_0x396d04){_0x509607=_0x509607-0x0;var _0xe619b5=_0x61ab[_0x509607];return _0xe619b5;};'use strict';var Sequelize=require(_0xb61a('0x0'));module[_0xb61a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb61a('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xb61a('0x3')]}}; \ No newline at end of file +var _0xb630=['STRING','exports','INTEGER'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xb630,0xe8));var _0x0b63=function(_0x1d2adf,_0x8b056f){_0x1d2adf=_0x1d2adf-0x0;var _0x431bd7=_0xb630[_0x1d2adf];return _0x431bd7;};'use strict';var Sequelize=require('sequelize');module[_0x0b63('0x0')]={'penalty':{'type':Sequelize[_0x0b63('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0b63('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x0b63('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index d7192b4..330d320 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 _0xc2a7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','api'];(function(_0x4972ff,_0x42eb41){var _0x55fa7e=function(_0x13842a){while(--_0x13842a){_0x4972ff['push'](_0x4972ff['shift']());}};_0x55fa7e(++_0x42eb41);}(_0xc2a7,0x123));var _0x7c2a=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xc2a7[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7c2a('0x0'));var util=require(_0x7c2a('0x1'));var logger=require('../../config/logger')(_0x7c2a('0x2'));var moment=require(_0x7c2a('0x3'));var BPromise=require(_0x7c2a('0x4'));var rp=require(_0x7c2a('0x5'));var fs=require('fs');var path=require(_0x7c2a('0x6'));var rimraf=require(_0x7c2a('0x7'));var config=require(_0x7c2a('0x8'));var attributes=require(_0x7c2a('0x9'));module[_0x7c2a('0xa')]=function(_0x1df384,_0x3183c9){return _0x1df384[_0x7c2a('0xb')](_0x7c2a('0xc'),attributes,{'tableName':_0x7c2a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb739=['define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x6b888e,_0x420fed){var _0x17d0f6=function(_0x42675a){while(--_0x42675a){_0x6b888e['push'](_0x6b888e['shift']());}};_0x17d0f6(++_0x420fed);}(_0xb739,0x12f));var _0x9b73=function(_0x579ded,_0x30e765){_0x579ded=_0x579ded-0x0;var _0x2d88d9=_0xb739[_0x579ded];return _0x2d88d9;};'use strict';var _=require(_0x9b73('0x0'));var util=require(_0x9b73('0x1'));var logger=require(_0x9b73('0x2'))(_0x9b73('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b73('0x4'));var rimraf=require(_0x9b73('0x5'));var config=require(_0x9b73('0x6'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x551ea1,_0x15c7e3){return _0x551ea1[_0x9b73('0x7')](_0x9b73('0x8'),attributes,{'tableName':_0x9b73('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 35d0f89..7c5ffb6 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 _0x1d13=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','info','request\x20sent','debug'];(function(_0x26a856,_0x2f8493){var _0x4244f0=function(_0x1a1dd6){while(--_0x1a1dd6){_0x26a856['push'](_0x26a856['shift']());}};_0x4244f0(++_0x2f8493);}(_0x1d13,0x85));var _0x31d1=function(_0x547574,_0x28e021){_0x547574=_0x547574-0x0;var _0x27aedc=_0x1d13[_0x547574];return _0x27aedc;};'use strict';var _=require(_0x31d1('0x0'));var util=require(_0x31d1('0x1'));var moment=require(_0x31d1('0x2'));var BPromise=require(_0x31d1('0x3'));var rs=require(_0x31d1('0x4'));var fs=require('fs');var Redis=require(_0x31d1('0x5'));var db=require(_0x31d1('0x6'))['db'];var utils=require(_0x31d1('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x31d1('0x8'));var jayson=require(_0x31d1('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bae6c,_0x23a29f,_0x4c7942){return new BPromise(function(_0x478474,_0x1193bc){return client[_0x31d1('0xa')](_0x2bae6c,_0x4c7942)['then'](function(_0x37514f){logger[_0x31d1('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x23a29f,_0x31d1('0xc'));logger[_0x31d1('0xd')](_0x31d1('0xe'),_0x23a29f,'request\x20sent',JSON[_0x31d1('0xf')](_0x37514f));if(_0x37514f['error']){if(_0x37514f[_0x31d1('0x10')][_0x31d1('0x11')]===0x1f4){logger[_0x31d1('0x10')](_0x31d1('0x12'),_0x23a29f,_0x37514f[_0x31d1('0x10')][_0x31d1('0x13')]);return _0x1193bc(_0x37514f[_0x31d1('0x10')][_0x31d1('0x13')]);}logger[_0x31d1('0x10')](_0x31d1('0x12'),_0x23a29f,_0x37514f['error'][_0x31d1('0x13')]);return _0x478474(_0x37514f[_0x31d1('0x10')][_0x31d1('0x13')]);}else{logger[_0x31d1('0xb')](_0x31d1('0x12'),_0x23a29f,_0x31d1('0xc'));_0x478474(_0x37514f['result'][_0x31d1('0x13')]);}})[_0x31d1('0x14')](function(_0x33e2f8){logger[_0x31d1('0x10')](_0x31d1('0x12'),_0x23a29f,_0x33e2f8);_0x1193bc(_0x33e2f8);});});} \ No newline at end of file +var _0x5945=['UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1128cd,_0x3391de){var _0x3b46d8=function(_0x378fd5){while(--_0x378fd5){_0x1128cd['push'](_0x1128cd['shift']());}};_0x3b46d8(++_0x3391de);}(_0x5945,0x86));var _0x5594=function(_0x272e18,_0x75e43c){_0x272e18=_0x272e18-0x0;var _0x572ca9=_0x5945[_0x272e18];return _0x572ca9;};'use strict';var _=require(_0x5594('0x0'));var util=require('util');var moment=require(_0x5594('0x1'));var BPromise=require(_0x5594('0x2'));var rs=require(_0x5594('0x3'));var fs=require('fs');var Redis=require(_0x5594('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5594('0x5'));var logger=require(_0x5594('0x6'))(_0x5594('0x7'));var config=require(_0x5594('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5594('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d6798,_0x19e0ba,_0x374d85){return new BPromise(function(_0x247439,_0x482345){return client[_0x5594('0xa')](_0x4d6798,_0x374d85)[_0x5594('0xb')](function(_0x4a3aa8){logger[_0x5594('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x19e0ba,'request\x20sent');logger['debug'](_0x5594('0xd'),_0x19e0ba,_0x5594('0xe'),JSON[_0x5594('0xf')](_0x4a3aa8));if(_0x4a3aa8[_0x5594('0x10')]){if(_0x4a3aa8[_0x5594('0x10')]['code']===0x1f4){logger[_0x5594('0x10')](_0x5594('0x11'),_0x19e0ba,_0x4a3aa8[_0x5594('0x10')][_0x5594('0x12')]);return _0x482345(_0x4a3aa8['error']['message']);}logger['error'](_0x5594('0x11'),_0x19e0ba,_0x4a3aa8[_0x5594('0x10')][_0x5594('0x12')]);return _0x247439(_0x4a3aa8[_0x5594('0x10')][_0x5594('0x12')]);}else{logger['info'](_0x5594('0x11'),_0x19e0ba,_0x5594('0xe'));_0x247439(_0x4a3aa8[_0x5594('0x13')][_0x5594('0x12')]);}})[_0x5594('0x14')](function(_0x2a9e45){logger[_0x5594('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x19e0ba,_0x2a9e45);_0x482345(_0x2a9e45);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 256b598..b30da48 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5ab2fe,_0x44178d){var _0x450797=function(_0x356eb8){while(--_0x356eb8){_0x5ab2fe['push'](_0x5ab2fe['shift']());}};_0x450797(++_0x44178d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x65c0bb,_0x82e7b8){_0x65c0bb=_0x65c0bb-0x0;var _0x320bd5=_0xcb91[_0x65c0bb];return _0x320bd5;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x5ce7fb,_0x69333e){var _0x146f07=function(_0x335e71){while(--_0x335e71){_0x5ce7fb['push'](_0x5ce7fb['shift']());}};_0x146f07(++_0x69333e);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 10c18b6..7a7ddc5 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 _0x38e7=['exports'];(function(_0x4880eb,_0x53353a){var _0x512164=function(_0x4ee4c7){while(--_0x4ee4c7){_0x4880eb['push'](_0x4880eb['shift']());}};_0x512164(++_0x53353a);}(_0x38e7,0x124));var _0x738e=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0x38e7[_0x171fdc];return _0x3782ea;};'use strict';var Sequelize=require('sequelize');module[_0x738e('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x33af=['INTEGER','sequelize','exports'];(function(_0x49d27a,_0x166543){var _0x3f0b62=function(_0x4eb485){while(--_0x4eb485){_0x49d27a['push'](_0x49d27a['shift']());}};_0x3f0b62(++_0x166543);}(_0x33af,0xa3));var _0xf33a=function(_0x65d12e,_0x4b0a30){_0x65d12e=_0x65d12e-0x0;var _0x4274e0=_0x33af[_0x65d12e];return _0x4274e0;};'use strict';var Sequelize=require(_0xf33a('0x0'));module[_0xf33a('0x1')]={'penalty':{'type':Sequelize[_0xf33a('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 47e2d06..4ce0bae 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 _0x6e54=['request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','UserMailQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0xbc059b,_0x4e8e8d){var _0x1052b7=function(_0x50e133){while(--_0x50e133){_0xbc059b['push'](_0xbc059b['shift']());}};_0x1052b7(++_0x4e8e8d);}(_0x6e54,0xb6));var _0x46e5=function(_0x2bcddb,_0x3eaf37){_0x2bcddb=_0x2bcddb-0x0;var _0x12a9e8=_0x6e54[_0x2bcddb];return _0x12a9e8;};'use strict';var _=require(_0x46e5('0x0'));var util=require('util');var logger=require(_0x46e5('0x1'))(_0x46e5('0x2'));var moment=require(_0x46e5('0x3'));var BPromise=require(_0x46e5('0x4'));var rp=require(_0x46e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x46e5('0x6'));var config=require(_0x46e5('0x7'));var attributes=require(_0x46e5('0x8'));module[_0x46e5('0x9')]=function(_0x1d1720,_0x51b9e0){return _0x1d1720['define'](_0x46e5('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f5=['request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','UserMailQueue','util','../../config/logger','bluebird'];(function(_0x1b1c65,_0x23ca6d){var _0x1b86d9=function(_0x1e8559){while(--_0x1e8559){_0x1b1c65['push'](_0x1b1c65['shift']());}};_0x1b86d9(++_0x23ca6d);}(_0xf0f5,0x1bf));var _0x5f0f=function(_0x3d2c06,_0x3cc8f3){_0x3d2c06=_0x3d2c06-0x0;var _0x36c85f=_0xf0f5[_0x3d2c06];return _0x36c85f;};'use strict';var _=require('lodash');var util=require(_0x5f0f('0x0'));var logger=require(_0x5f0f('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5f0f('0x2'));var rp=require(_0x5f0f('0x3'));var fs=require('fs');var path=require(_0x5f0f('0x4'));var rimraf=require(_0x5f0f('0x5'));var config=require(_0x5f0f('0x6'));var attributes=require(_0x5f0f('0x7'));module['exports']=function(_0x3f167a,_0x4fc3f5){return _0x3f167a['define'](_0x5f0f('0x8'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 415b726..ecbea77 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 _0x7217=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x7217,0x19e));var _0x7721=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x7217[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});} \ No newline at end of file +var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x7f7bf9,_0x3b6057){var _0x51fee6=function(_0x3aefe5){while(--_0x3aefe5){_0x7f7bf9['push'](_0x7f7bf9['shift']());}};_0x51fee6(++_0x3b6057);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x00bb[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 6e19b32..5618a75 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 _0xb1dc=['Router','../../config/environment','./userNotification.controller','post','isAuthenticated','multer','util','path','connect-timeout','express'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0xb1dc,0x18b));var _0xcb1d=function(_0x401609,_0x5eb61d){_0x401609=_0x401609-0x0;var _0x35fd57=_0xb1dc[_0x401609];return _0x35fd57;};'use strict';var multer=require(_0xcb1d('0x0'));var util=require(_0xcb1d('0x1'));var path=require(_0xcb1d('0x2'));var timeout=require(_0xcb1d('0x3'));var express=require(_0xcb1d('0x4'));var router=express[_0xcb1d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcb1d('0x6'));var controller=require(_0xcb1d('0x7'));router[_0xcb1d('0x8')]('/',auth[_0xcb1d('0x9')](),controller['sendUserNotification']);module['exports']=router; \ No newline at end of file +var _0x764a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout','express'];(function(_0x12dfac,_0x4e2e81){var _0x50b300=function(_0x258624){while(--_0x258624){_0x12dfac['push'](_0x12dfac['shift']());}};_0x50b300(++_0x4e2e81);}(_0x764a,0x192));var _0xa764=function(_0x466038,_0x1e1e6f){_0x466038=_0x466038-0x0;var _0x2f9df2=_0x764a[_0x466038];return _0x2f9df2;};'use strict';var multer=require('multer');var util=require(_0xa764('0x0'));var path=require(_0xa764('0x1'));var timeout=require(_0xa764('0x2'));var express=require(_0xa764('0x3'));var router=express[_0xa764('0x4')]();var fs_extra=require(_0xa764('0x5'));var auth=require(_0xa764('0x6'));var interaction=require(_0xa764('0x7'));var config=require(_0xa764('0x8'));var controller=require(_0xa764('0x9'));router[_0xa764('0xa')]('/',auth[_0xa764('0xb')](),controller[_0xa764('0xc')]);module[_0xa764('0xd')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 2ca0666..b29207d 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 _0x2614=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x151258,_0x4bd87a){var _0x2ea983=function(_0x1ed162){while(--_0x1ed162){_0x151258['push'](_0x151258['shift']());}};_0x2ea983(++_0x4bd87a);}(_0x2614,0x161));var _0x4261=function(_0x5f1664,_0x432798){_0x5f1664=_0x5f1664-0x0;var _0x1626dc=_0x2614[_0x5f1664];return _0x1626dc;};'use strict';var Sequelize=require(_0x4261('0x0'));module['exports']={'body':{'type':Sequelize[_0x4261('0x1')]},'senderName':{'type':Sequelize[_0x4261('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x4261('0x2')]},'beep':{'type':Sequelize[_0x4261('0x3')]}}; \ No newline at end of file +var _0x1b76=['exports','TEXT','STRING','BOOLEAN'];(function(_0x3f2427,_0x4229cf){var _0x39c52a=function(_0x31454b){while(--_0x31454b){_0x3f2427['push'](_0x3f2427['shift']());}};_0x39c52a(++_0x4229cf);}(_0x1b76,0x150));var _0x61b7=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x1b76[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require('sequelize');module[_0x61b7('0x0')]={'body':{'type':Sequelize[_0x61b7('0x1')]},'senderName':{'type':Sequelize[_0x61b7('0x2')]},'recipientsId':{'type':Sequelize[_0x61b7('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x61b7('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index d8d0b7a..4726df1 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 _0x6d9c=['faxqueue','mailqueue','openchannelqueue','whatsappqueue','team','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','UserNotification','forEach','emit','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','model','union','ids','replace','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','name','send','body','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Sequelize','Missing\x20\x27recipients\x27\x20parameter','Invalid\x20\x27recipients\x27\x20object','chatqueue'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x6d9c,0x1c9));var _0xc6d9=function(_0xe8134a,_0x45a8fa){_0xe8134a=_0xe8134a-0x0;var _0x52be6c=_0x6d9c[_0xe8134a];return _0x52be6c;};'use strict';var emlformat=require(_0xc6d9('0x0'));var rimraf=require(_0xc6d9('0x1'));var zipdir=require(_0xc6d9('0x2'));var jsonpatch=require(_0xc6d9('0x3'));var rp=require(_0xc6d9('0x4'));var moment=require(_0xc6d9('0x5'));var BPromise=require(_0xc6d9('0x6'));var Mustache=require(_0xc6d9('0x7'));var util=require(_0xc6d9('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xc6d9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6d9('0xa'));var _=require(_0xc6d9('0xb'));var squel=require(_0xc6d9('0xc'));var crypto=require(_0xc6d9('0xd'));var jsforce=require(_0xc6d9('0xe'));var deskjs=require(_0xc6d9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc6d9('0x10'));var Papa=require(_0xc6d9('0x11'));var Redis=require(_0xc6d9('0x12'));var authService=require(_0xc6d9('0x13'));var qs=require(_0xc6d9('0x14'));var as=require(_0xc6d9('0x15'));var hardwareService=require(_0xc6d9('0x16'));var logger=require('../../config/logger')(_0xc6d9('0x17'));var utils=require(_0xc6d9('0x18'));var config=require(_0xc6d9('0x19'));var licenseUtil=require(_0xc6d9('0x1a'));var db=require(_0xc6d9('0x1b'))['db'];config[_0xc6d9('0x1c')]=_[_0xc6d9('0x1d')](config['redis'],{'host':_0xc6d9('0x1e'),'port':0x18eb});var socket=require(_0xc6d9('0x1f'))(new Redis(config[_0xc6d9('0x1c')]));require(_0xc6d9('0x20'))[_0xc6d9('0x21')](socket);function respondWithStatusCode(_0xc2f60f,_0x4678c5){_0x4678c5=_0x4678c5||0xcc;return function(_0xf1ad5){if(_0xf1ad5){return _0xc2f60f[_0xc6d9('0x22')](_0x4678c5);}return _0xc2f60f[_0xc6d9('0x23')](_0x4678c5)[_0xc6d9('0x24')]();};}function respondWithResult(_0x35fe3c,_0x50f65d){_0x50f65d=_0x50f65d||0xc8;return function(_0x291557){if(_0x291557){return _0x35fe3c[_0xc6d9('0x23')](_0x50f65d)['json'](_0x291557);}};}function respondWithFilteredResult(_0x2c129c,_0x3e90e7){return function(_0x531833){if(_0x531833){var _0x19fe9c=typeof _0x3e90e7[_0xc6d9('0x25')]==='undefined'&&typeof _0x3e90e7[_0xc6d9('0x26')]===_0xc6d9('0x27');var _0x3aa266=_0x531833[_0xc6d9('0x28')];var _0x54da60=_0x19fe9c?0x0:_0x3e90e7[_0xc6d9('0x25')];var _0x3e926c=_0x19fe9c?_0x531833[_0xc6d9('0x28')]:_0x3e90e7[_0xc6d9('0x25')]+_0x3e90e7[_0xc6d9('0x26')];var _0x4aa737;if(_0x3e926c>=_0x3aa266){_0x3e926c=_0x3aa266;_0x4aa737=0xc8;}else{_0x4aa737=0xce;}_0x2c129c['status'](_0x4aa737);return _0x2c129c[_0xc6d9('0x29')](_0xc6d9('0x2a'),_0x54da60+'-'+_0x3e926c+'/'+_0x3aa266)[_0xc6d9('0x2b')](_0x531833);}return null;};}function patchUpdates(_0x493c62){return function(_0x24a528){try{jsonpatch[_0xc6d9('0x2c')](_0x24a528,_0x493c62,!![]);}catch(_0x3d0668){return BPromise['reject'](_0x3d0668);}return _0x24a528[_0xc6d9('0x2d')]();};}function saveUpdates(_0x1d3805,_0x4e6478){return function(_0x2b5705){if(_0x2b5705){return _0x2b5705[_0xc6d9('0x2e')](_0x1d3805)['then'](function(_0x2af793){return _0x2af793;});}return null;};}function removeEntity(_0x4c519a,_0x4867f0){return function(_0x254c31){if(_0x254c31){return _0x254c31['destroy']()[_0xc6d9('0x2f')](function(){_0x4c519a[_0xc6d9('0x23')](0xcc)[_0xc6d9('0x24')]();});}};}function handleEntityNotFound(_0x3ebccc,_0x34bd53){return function(_0x519524){if(!_0x519524){_0x3ebccc[_0xc6d9('0x22')](0x194);}return _0x519524;};}function handleError(_0x1f8ffc,_0x489125){_0x489125=_0x489125||0x1f4;return function(_0x2a6f5e){logger[_0xc6d9('0x30')](_0x2a6f5e['stack']);if(_0x2a6f5e[_0xc6d9('0x31')]){delete _0x2a6f5e[_0xc6d9('0x31')];}_0x1f8ffc[_0xc6d9('0x23')](_0x489125)[_0xc6d9('0x32')](_0x2a6f5e);};}exports['sendUserNotification']=function(_0x261ee3,_0x56a101,_0x3f6527){if(!_0x261ee3[_0xc6d9('0x33')]['hasOwnProperty']('text')&&!_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x34')](_0xc6d9('0x35'))){throw new db['Sequelize'][(_0xc6d9('0x36'))](_0xc6d9('0x37'));}else{if(_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x34')](_0xc6d9('0x35'))&&!_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x34')](_0xc6d9('0x38'))){throw new db['Sequelize'][(_0xc6d9('0x36'))](_0xc6d9('0x39'));}if(!_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x34')](_0xc6d9('0x3a'))){throw new db[(_0xc6d9('0x3b'))]['ValidationError'](_0xc6d9('0x3c'));}else{try{var _0x49b6a3=JSON['parse'](_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x3a')]);}catch(_0x58456e){logger[_0xc6d9('0x30')](_0x58456e);throw new db[(_0xc6d9('0x3b'))]['ValidationError'](_0xc6d9('0x3d'));}var _0xe12a6c=[_0xc6d9('0x3e'),_0xc6d9('0x3f'),_0xc6d9('0x40'),_0xc6d9('0x41'),'smsqueue','voicequeue',_0xc6d9('0x42'),_0xc6d9('0x43'),_0xc6d9('0x44')];if(_[_0xc6d9('0x45')](_0x49b6a3,function(_0x185b5a){return!_[_0xc6d9('0x46')](_0xe12a6c,_0x185b5a['model'][_0xc6d9('0x47')]());})){throw new db[(_0xc6d9('0x3b'))][(_0xc6d9('0x36'))](_0xc6d9('0x48'));}}}var _0x506151={};_0x506151[_0xc6d9('0x49')]=_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x34')](_0xc6d9('0x49'))?_0x261ee3['body'][_0xc6d9('0x49')]:_0x261ee3[_0xc6d9('0x44')][_0xc6d9('0x4a')];_0x506151[_0xc6d9('0x4b')]=_[_0xc6d9('0x4c')](_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x4b')])?null:_0x261ee3[_0xc6d9('0x33')]['recipientsDescription'];_0x506151[_0xc6d9('0x4d')]=_0x261ee3[_0xc6d9('0x33')][_0xc6d9('0x4d')]||![];_0x506151[_0xc6d9('0x4e')]=_0x261ee3[_0xc6d9('0x44')]['id'];return getContent(_0x261ee3[_0xc6d9('0x33')])['then'](function(_0x391ebb){_0x506151[_0xc6d9('0x33')]=_0x391ebb;return getRecipients(_0x49b6a3);})['then'](function(_0x4093a1){_0x506151[_0xc6d9('0x4f')]=_['sortBy'](_0x4093a1)[_0xc6d9('0x50')](',');return db[_0xc6d9('0x51')][_0xc6d9('0x52')](function(_0x3fe6e4){return db[_0xc6d9('0x53')]['create'](_0x506151,{'raw':!![],'transaction':_0x3fe6e4})['then'](function(_0x3a5a76){var _0x294b67={'sender':_0x506151['senderName'],'description':_0x506151[_0xc6d9('0x4b')],'content':_0x506151[_0xc6d9('0x33')],'beep':_0x506151[_0xc6d9('0x4d')]};_0x4093a1[_0xc6d9('0x54')](function(_0x3d0420){_0x294b67['recipient']=_0x3d0420;socket[_0xc6d9('0x55')]('userNotification:send',_0x294b67);});return _0x3a5a76;});});})[_0xc6d9('0x2f')](respondWithResult(_0x56a101,0xc9))['catch'](handleError(_0x56a101,null));};function getContent(_0x251688){return new BPromise(function(_0x51125b,_0x338e86){if(_0x251688['text']){_0x51125b(_0x251688[_0xc6d9('0x56')]);return;}return db[_0xc6d9('0x57')][_0xc6d9('0x58')]({'attributes':[_0xc6d9('0x59')],'where':{'id':_0x251688[_0xc6d9('0x35')]},'raw':!![]})['then'](function(_0x5bb53d){if(!_0x5bb53d)throw new db[(_0xc6d9('0x3b'))][(_0xc6d9('0x36'))](_0xc6d9('0x5a'));var _0x17e24f=Mustache[_0xc6d9('0x5b')](_0x5bb53d[_0xc6d9('0x59')],_0x251688[_0xc6d9('0x38')]);_0x51125b(_0x17e24f);})[_0xc6d9('0x5c')](function(_0x27760b){_0x338e86(_0x27760b);});});}function getRecipients(_0x1d1577){return new BPromise(function(_0x5adc55,_0x56f6aa){var _0x28edf1=[];var _0x117ab9=[];_0x1d1577[_0xc6d9('0x54')](function(_0x26e716){var _0x2c380d=_['startCase'](_0x26e716[_0xc6d9('0x5d')]['toLowerCase']());if(_0x2c380d==='User'){_0x28edf1=_[_0xc6d9('0x5e')](_0x28edf1,_0x26e716[_0xc6d9('0x5f')]);}else{if(_[_0xc6d9('0x46')](_0x2c380d,'queue'))_0x2c380d=_0x2c380d[_0xc6d9('0x60')](_0xc6d9('0x61'),_0xc6d9('0x62'));_0x26e716[_0xc6d9('0x5f')][_0xc6d9('0x54')](function(_0x1b544b){_0x117ab9[_0xc6d9('0x63')](getAgents(_0x2c380d,_0x1b544b));});}});return BPromise[_0xc6d9('0x64')](_0x117ab9)[_0xc6d9('0x2f')](function(_0x4e7462){_0x28edf1=_[_0xc6d9('0x5e')](_0x28edf1,_[_0xc6d9('0x65')](_0x4e7462));_0x5adc55(_0x28edf1);})[_0xc6d9('0x5c')](function(_0x4e7e2c){_0x56f6aa(_0x4e7e2c);});});}function getAgents(_0x48671d,_0x5a29b1){return new BPromise(function(_0x48f97a,_0x2fe9fa){return db[_0x48671d][_0xc6d9('0x58')]({'where':{'id':_0x5a29b1}})['then'](function(_0x2bbcb0){return _0x2bbcb0[_0xc6d9('0x66')]({'attributes':['id'],'raw':!![]})[_0xc6d9('0x2f')](function(_0x17549f){var _0x56a843=_[_0xc6d9('0x67')](_0x17549f,'id');_0x48f97a(_0x56a843);});})[_0xc6d9('0x5c')](function(_0x59d42a){_0x2fe9fa(_0x59d42a);});});} \ No newline at end of file +var _0xcaad=['toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','findOne','startCase','User','union','ids','queue','replace','Queue','push','all','flatten','catch','getAgents','map','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','register','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','error','Invalid\x20\x27recipients\x27\x20object','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','includes'];(function(_0x13c554,_0xb5f3ec){var _0x4da0fd=function(_0x4d232a){while(--_0x4d232a){_0x13c554['push'](_0x13c554['shift']());}};_0x4da0fd(++_0xb5f3ec);}(_0xcaad,0x84));var _0xdcaa=function(_0x217a3e,_0x55aa51){_0x217a3e=_0x217a3e-0x0;var _0x33a803=_0xcaad[_0x217a3e];return _0x33a803;};'use strict';var emlformat=require(_0xdcaa('0x0'));var rimraf=require(_0xdcaa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdcaa('0x2'));var moment=require('moment');var BPromise=require(_0xdcaa('0x3'));var Mustache=require(_0xdcaa('0x4'));var util=require(_0xdcaa('0x5'));var path=require(_0xdcaa('0x6'));var sox=require(_0xdcaa('0x7'));var csv=require(_0xdcaa('0x8'));var ejs=require(_0xdcaa('0x9'));var fs=require('fs');var fs_extra=require(_0xdcaa('0xa'));var _=require(_0xdcaa('0xb'));var squel=require(_0xdcaa('0xc'));var crypto=require('crypto');var jsforce=require(_0xdcaa('0xd'));var deskjs=require(_0xdcaa('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdcaa('0xf'));var Papa=require(_0xdcaa('0x10'));var Redis=require(_0xdcaa('0x11'));var authService=require(_0xdcaa('0x12'));var qs=require(_0xdcaa('0x13'));var as=require(_0xdcaa('0x14'));var hardwareService=require(_0xdcaa('0x15'));var logger=require(_0xdcaa('0x16'))('api');var utils=require(_0xdcaa('0x17'));var config=require(_0xdcaa('0x18'));var licenseUtil=require(_0xdcaa('0x19'));var db=require(_0xdcaa('0x1a'))['db'];config['redis']=_[_0xdcaa('0x1b')](config['redis'],{'host':_0xdcaa('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0xdcaa('0x1d')](socket);function respondWithStatusCode(_0x6d6f1c,_0x3c5401){_0x3c5401=_0x3c5401||0xcc;return function(_0x423fff){if(_0x423fff){return _0x6d6f1c['sendStatus'](_0x3c5401);}return _0x6d6f1c[_0xdcaa('0x1e')](_0x3c5401)['end']();};}function respondWithResult(_0x554f98,_0x19798d){_0x19798d=_0x19798d||0xc8;return function(_0x51acd4){if(_0x51acd4){return _0x554f98[_0xdcaa('0x1e')](_0x19798d)[_0xdcaa('0x1f')](_0x51acd4);}};}function respondWithFilteredResult(_0x8f0e40,_0x4c469b){return function(_0x43508c){if(_0x43508c){var _0x3d6d72=typeof _0x4c469b[_0xdcaa('0x20')]===_0xdcaa('0x21')&&typeof _0x4c469b['limit']===_0xdcaa('0x21');var _0x4e5b44=_0x43508c[_0xdcaa('0x22')];var _0x387af1=_0x3d6d72?0x0:_0x4c469b[_0xdcaa('0x20')];var _0x2de71f=_0x3d6d72?_0x43508c[_0xdcaa('0x22')]:_0x4c469b[_0xdcaa('0x20')]+_0x4c469b[_0xdcaa('0x23')];var _0x3fbd20;if(_0x2de71f>=_0x4e5b44){_0x2de71f=_0x4e5b44;_0x3fbd20=0xc8;}else{_0x3fbd20=0xce;}_0x8f0e40[_0xdcaa('0x1e')](_0x3fbd20);return _0x8f0e40[_0xdcaa('0x24')]('Content-Range',_0x387af1+'-'+_0x2de71f+'/'+_0x4e5b44)[_0xdcaa('0x1f')](_0x43508c);}return null;};}function patchUpdates(_0x106aca){return function(_0x796735){try{jsonpatch[_0xdcaa('0x25')](_0x796735,_0x106aca,!![]);}catch(_0x2f8441){return BPromise[_0xdcaa('0x26')](_0x2f8441);}return _0x796735[_0xdcaa('0x27')]();};}function saveUpdates(_0x445804,_0x3c8696){return function(_0xb03a7d){if(_0xb03a7d){return _0xb03a7d[_0xdcaa('0x28')](_0x445804)[_0xdcaa('0x29')](function(_0x468a4f){return _0x468a4f;});}return null;};}function removeEntity(_0x1ee8c4,_0x193b16){return function(_0x52da75){if(_0x52da75){return _0x52da75[_0xdcaa('0x2a')]()[_0xdcaa('0x29')](function(){_0x1ee8c4['status'](0xcc)[_0xdcaa('0x2b')]();});}};}function handleEntityNotFound(_0x4a24c5,_0x342717){return function(_0xc61f3){if(!_0xc61f3){_0x4a24c5[_0xdcaa('0x2c')](0x194);}return _0xc61f3;};}function handleError(_0x2e72db,_0x14b6a9){_0x14b6a9=_0x14b6a9||0x1f4;return function(_0x44b796){logger['error'](_0x44b796[_0xdcaa('0x2d')]);if(_0x44b796[_0xdcaa('0x2e')]){delete _0x44b796[_0xdcaa('0x2e')];}_0x2e72db[_0xdcaa('0x1e')](_0x14b6a9)[_0xdcaa('0x2f')](_0x44b796);};}exports[_0xdcaa('0x30')]=function(_0x2bb937,_0x2d3754,_0x4318ce){if(!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x33'))&&!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x34'))){throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))](_0xdcaa('0x37'));}else{if(_0x2bb937['body'][_0xdcaa('0x32')](_0xdcaa('0x34'))&&!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x38'))){throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))](_0xdcaa('0x39'));}if(!_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')]('recipients')){throw new db[(_0xdcaa('0x35'))]['ValidationError'](_0xdcaa('0x3a'));}else{try{var _0x48de06=JSON[_0xdcaa('0x3b')](_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x3c')]);}catch(_0x182b48){logger[_0xdcaa('0x3d')](_0x182b48);throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))](_0xdcaa('0x3e'));}var _0x58957a=['chatqueue','faxqueue',_0xdcaa('0x3f'),_0xdcaa('0x40'),_0xdcaa('0x41'),_0xdcaa('0x42'),_0xdcaa('0x43'),_0xdcaa('0x44'),'user'];if(_['some'](_0x48de06,function(_0x528b79){return!_[_0xdcaa('0x45')](_0x58957a,_0x528b79['model'][_0xdcaa('0x46')]());})){throw new db[(_0xdcaa('0x35'))]['ValidationError'](_0xdcaa('0x47'));}}}var _0x54cbb8={};_0x54cbb8['senderName']=_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x32')](_0xdcaa('0x48'))?_0x2bb937[_0xdcaa('0x31')]['senderName']:_0x2bb937[_0xdcaa('0x49')][_0xdcaa('0x4a')];_0x54cbb8[_0xdcaa('0x4b')]=_['isEmpty'](_0x2bb937['body'][_0xdcaa('0x4b')])?null:_0x2bb937['body'][_0xdcaa('0x4b')];_0x54cbb8[_0xdcaa('0x4c')]=_0x2bb937[_0xdcaa('0x31')][_0xdcaa('0x4c')]||![];_0x54cbb8[_0xdcaa('0x4d')]=_0x2bb937[_0xdcaa('0x49')]['id'];return getContent(_0x2bb937['body'])[_0xdcaa('0x29')](function(_0x3b2cf3){_0x54cbb8['body']=_0x3b2cf3;return getRecipients(_0x48de06);})[_0xdcaa('0x29')](function(_0x15ffc5){_0x54cbb8[_0xdcaa('0x4e')]=_[_0xdcaa('0x4f')](_0x15ffc5)['join'](',');return db['sequelize'][_0xdcaa('0x50')](function(_0x4fc4ab){return db[_0xdcaa('0x51')][_0xdcaa('0x52')](_0x54cbb8,{'raw':!![],'transaction':_0x4fc4ab})[_0xdcaa('0x29')](function(_0x4d6361){var _0x517671={'sender':_0x54cbb8[_0xdcaa('0x48')],'description':_0x54cbb8['recipientsDescription'],'content':_0x54cbb8[_0xdcaa('0x31')],'beep':_0x54cbb8[_0xdcaa('0x4c')]};_0x15ffc5[_0xdcaa('0x53')](function(_0x5f2e70){_0x517671[_0xdcaa('0x54')]=_0x5f2e70;socket[_0xdcaa('0x55')](_0xdcaa('0x56'),_0x517671);});return _0x4d6361;});});})[_0xdcaa('0x29')](respondWithResult(_0x2d3754,0xc9))['catch'](handleError(_0x2d3754,null));};function getContent(_0x4dbe6a){return new BPromise(function(_0x33f101,_0x2984cf){if(_0x4dbe6a['text']){_0x33f101(_0x4dbe6a[_0xdcaa('0x33')]);return;}return db['Template'][_0xdcaa('0x57')]({'attributes':['html'],'where':{'id':_0x4dbe6a[_0xdcaa('0x34')]},'raw':!![]})[_0xdcaa('0x29')](function(_0xe7407b){if(!_0xe7407b)throw new db[(_0xdcaa('0x35'))][(_0xdcaa('0x36'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x20a7e0=Mustache['render'](_0xe7407b['html'],_0x4dbe6a[_0xdcaa('0x38')]);_0x33f101(_0x20a7e0);})['catch'](function(_0x26fd67){_0x2984cf(_0x26fd67);});});}function getRecipients(_0x44a9b){return new BPromise(function(_0x301452,_0x187b46){var _0xbf1926=[];var _0x39826f=[];_0x44a9b[_0xdcaa('0x53')](function(_0x46696d){var _0x13a887=_[_0xdcaa('0x58')](_0x46696d['model']['toLowerCase']());if(_0x13a887===_0xdcaa('0x59')){_0xbf1926=_[_0xdcaa('0x5a')](_0xbf1926,_0x46696d[_0xdcaa('0x5b')]);}else{if(_[_0xdcaa('0x45')](_0x13a887,_0xdcaa('0x5c')))_0x13a887=_0x13a887[_0xdcaa('0x5d')](_0xdcaa('0x5c'),_0xdcaa('0x5e'));_0x46696d[_0xdcaa('0x5b')][_0xdcaa('0x53')](function(_0x3bd3dc){_0x39826f[_0xdcaa('0x5f')](getAgents(_0x13a887,_0x3bd3dc));});}});return BPromise[_0xdcaa('0x60')](_0x39826f)[_0xdcaa('0x29')](function(_0x4ab3db){_0xbf1926=_[_0xdcaa('0x5a')](_0xbf1926,_[_0xdcaa('0x61')](_0x4ab3db));_0x301452(_0xbf1926);})[_0xdcaa('0x62')](function(_0x58bd18){_0x187b46(_0x58bd18);});});}function getAgents(_0x4c782c,_0x494d09){return new BPromise(function(_0x241eea,_0x40dfb0){return db[_0x4c782c][_0xdcaa('0x57')]({'where':{'id':_0x494d09}})['then'](function(_0x15fe53){return _0x15fe53[_0xdcaa('0x63')]({'attributes':['id'],'raw':!![]})[_0xdcaa('0x29')](function(_0x1ba204){var _0x51e428=_[_0xdcaa('0x64')](_0x1ba204,'id');_0x241eea(_0x51e428);});})['catch'](function(_0x44217b){_0x40dfb0(_0x44217b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 5af077b..f2bf8aa 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 _0x6b37=['hook','exports','events','UserNotification','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x31bdff,_0x21a396){var _0x1600bd=function(_0x3184f1){while(--_0x3184f1){_0x31bdff['push'](_0x31bdff['shift']());}};_0x1600bd(++_0x21a396);}(_0x6b37,0x192));var _0x76b3=function(_0x469dac,_0x856fcd){_0x469dac=_0x469dac-0x0;var _0x269819=_0x6b37[_0x469dac];return _0x269819;};'use strict';var EventEmitter=require(_0x76b3('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x76b3('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x76b3('0x2')](0x0);var events={'afterCreate':_0x76b3('0x3'),'afterUpdate':_0x76b3('0x4'),'afterDestroy':_0x76b3('0x5')};function emitEvent(_0x110421){return function(_0xca96a,_0x33e215,_0x119975){UserNotificationEvents[_0x76b3('0x6')](_0x110421+':'+_0xca96a['id'],_0xca96a);UserNotificationEvents['emit'](_0x110421,_0xca96a);_0x119975(null);};}for(var e in events){if(events[_0x76b3('0x7')](e)){var event=events[e];UserNotification[_0x76b3('0x8')](e,emitEvent(event));}}module[_0x76b3('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0x1bab=['events','../../mysqldb','UserNotification','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1bab,0x15f));var _0xb1ba=function(_0x7e790d,_0x392135){_0x7e790d=_0x7e790d-0x0;var _0x1c289d=_0x1bab[_0x7e790d];return _0x1c289d;};'use strict';var EventEmitter=require(_0xb1ba('0x0'));var UserNotification=require(_0xb1ba('0x1'))['db'][_0xb1ba('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xb1ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb1ba('0x4')};function emitEvent(_0x1cd02a){return function(_0x55d6be,_0x4be7ba,_0x3dbbfd){UserNotificationEvents['emit'](_0x1cd02a+':'+_0x55d6be['id'],_0x55d6be);UserNotificationEvents[_0xb1ba('0x5')](_0x1cd02a,_0x55d6be);_0x3dbbfd(null);};}for(var e in events){if(events[_0xb1ba('0x6')](e)){var event=events[e];UserNotification[_0xb1ba('0x7')](e,emitEvent(event));}}module[_0xb1ba('0x8')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 07c9995..e6ce8cc 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 _0x8af9=['userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports','define','UserNotification'];(function(_0x5a83ba,_0x22224b){var _0x5ea143=function(_0x51d01c){while(--_0x51d01c){_0x5a83ba['push'](_0x5a83ba['shift']());}};_0x5ea143(++_0x22224b);}(_0x8af9,0x1b6));var _0x98af=function(_0x459e37,_0x2f59ff){_0x459e37=_0x459e37-0x0;var _0x5d96ba=_0x8af9[_0x459e37];return _0x5d96ba;};'use strict';var _=require(_0x98af('0x0'));var util=require(_0x98af('0x1'));var logger=require(_0x98af('0x2'))(_0x98af('0x3'));var moment=require('moment');var BPromise=require(_0x98af('0x4'));var rp=require(_0x98af('0x5'));var fs=require('fs');var path=require(_0x98af('0x6'));var rimraf=require(_0x98af('0x7'));var config=require('../../config/environment');var attributes=require(_0x98af('0x8'));module[_0x98af('0x9')]=function(_0x415141,_0x1e1c03){return _0x415141[_0x98af('0xa')](_0x98af('0xb'),attributes,{'tableName':_0x98af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x98af('0xd'),'collate':_0x98af('0xe')});}; \ No newline at end of file +var _0x3c94=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x3c94,0x111));var _0x43c9=function(_0x246115,_0x398123){_0x246115=_0x246115-0x0;var _0x385878=_0x3c94[_0x246115];return _0x385878;};'use strict';var _=require('lodash');var util=require(_0x43c9('0x0'));var logger=require('../../config/logger')(_0x43c9('0x1'));var moment=require('moment');var BPromise=require(_0x43c9('0x2'));var rp=require(_0x43c9('0x3'));var fs=require('fs');var path=require(_0x43c9('0x4'));var rimraf=require(_0x43c9('0x5'));var config=require(_0x43c9('0x6'));var attributes=require('./userNotification.attributes');module[_0x43c9('0x7')]=function(_0xfd7d8c,_0x5de54c){return _0xfd7d8c[_0x43c9('0x8')](_0x43c9('0x9'),attributes,{'tableName':_0x43c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x43c9('0xb'),'collate':_0x43c9('0xc')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index d42c201..74c47e2 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 _0x9860=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x187924,_0x17e8e1){var _0x434cff=function(_0xf187eb){while(--_0xf187eb){_0x187924['push'](_0x187924['shift']());}};_0x434cff(++_0x17e8e1);}(_0x9860,0x151));var _0x0986=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9860[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0986('0x0'));var util=require(_0x0986('0x1'));var moment=require('moment');var BPromise=require(_0x0986('0x2'));var rs=require(_0x0986('0x3'));var fs=require('fs');var Redis=require(_0x0986('0x4'));var db=require(_0x0986('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0986('0x6'))(_0x0986('0x7'));var config=require(_0x0986('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0986('0x9')][_0x0986('0xa')]({'port':0x232a});config['redis']=_[_0x0986('0xb')](config[_0x0986('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0986('0xd'))(new Redis(config[_0x0986('0xc')]));require(_0x0986('0xe'))[_0x0986('0xf')](socket);function respondWithRpcPromise(_0x46adcc,_0x244102,_0x18f30b){return new BPromise(function(_0x416068,_0xbbc8aa){return client[_0x0986('0x10')](_0x46adcc,_0x18f30b)[_0x0986('0x11')](function(_0x4febe3){logger['info'](_0x0986('0x12'),_0x244102,_0x0986('0x13'));logger['debug'](_0x0986('0x14'),_0x244102,'request\x20sent',JSON[_0x0986('0x15')](_0x4febe3));if(_0x4febe3['error']){if(_0x4febe3[_0x0986('0x16')][_0x0986('0x17')]===0x1f4){logger[_0x0986('0x16')](_0x0986('0x12'),_0x244102,_0x4febe3[_0x0986('0x16')]['message']);return _0xbbc8aa(_0x4febe3[_0x0986('0x16')]['message']);}logger[_0x0986('0x16')](_0x0986('0x12'),_0x244102,_0x4febe3['error']['message']);return _0x416068(_0x4febe3[_0x0986('0x16')][_0x0986('0x18')]);}else{logger[_0x0986('0x19')](_0x0986('0x12'),_0x244102,_0x0986('0x13'));_0x416068(_0x4febe3[_0x0986('0x1a')][_0x0986('0x18')]);}})[_0x0986('0x1b')](function(_0x676054){logger[_0x0986('0x16')]('UserNotification,\x20%s,\x20%s',_0x244102,_0x676054);_0xbbc8aa(_0x676054);});});} \ No newline at end of file +var _0x7481=['message','UserNotification,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','redis','defaults','localhost','./userNotification.socket','register','request','then','info','request\x20sent','debug','stringify','code','error'];(function(_0x14bd4b,_0x2b01c4){var _0x344c11=function(_0x54c3f6){while(--_0x54c3f6){_0x14bd4b['push'](_0x14bd4b['shift']());}};_0x344c11(++_0x2b01c4);}(_0x7481,0x117));var _0x1748=function(_0x40701a,_0x154124){_0x40701a=_0x40701a-0x0;var _0x56ca72=_0x7481[_0x40701a];return _0x56ca72;};'use strict';var _=require('lodash');var util=require(_0x1748('0x0'));var moment=require(_0x1748('0x1'));var BPromise=require(_0x1748('0x2'));var rs=require(_0x1748('0x3'));var fs=require('fs');var Redis=require(_0x1748('0x4'));var db=require(_0x1748('0x5'))['db'];var utils=require(_0x1748('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1748('0x7')]['http']({'port':0x232a});config[_0x1748('0x8')]=_[_0x1748('0x9')](config[_0x1748('0x8')],{'host':_0x1748('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1748('0x8')]));require(_0x1748('0xb'))[_0x1748('0xc')](socket);function respondWithRpcPromise(_0x400e88,_0x492c2c,_0x347dc8){return new BPromise(function(_0x4888b5,_0x15191e){return client[_0x1748('0xd')](_0x400e88,_0x347dc8)[_0x1748('0xe')](function(_0x453ea1){logger[_0x1748('0xf')]('UserNotification,\x20%s,\x20%s',_0x492c2c,_0x1748('0x10'));logger[_0x1748('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x492c2c,'request\x20sent',JSON[_0x1748('0x12')](_0x453ea1));if(_0x453ea1['error']){if(_0x453ea1['error'][_0x1748('0x13')]===0x1f4){logger[_0x1748('0x14')]('UserNotification,\x20%s,\x20%s',_0x492c2c,_0x453ea1[_0x1748('0x14')]['message']);return _0x15191e(_0x453ea1['error'][_0x1748('0x15')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x492c2c,_0x453ea1[_0x1748('0x14')]['message']);return _0x4888b5(_0x453ea1[_0x1748('0x14')][_0x1748('0x15')]);}else{logger[_0x1748('0xf')](_0x1748('0x16'),_0x492c2c,_0x1748('0x10'));_0x4888b5(_0x453ea1[_0x1748('0x17')]['message']);}})[_0x1748('0x18')](function(_0x3f03f4){logger[_0x1748('0x14')](_0x1748('0x16'),_0x492c2c,_0x3f03f4);_0x15191e(_0x3f03f4);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index abfbf4d..68032ad 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 _0x6fb7=['./userNotification.events','save','remove','update','emit','removeListener','register','length'];(function(_0x100901,_0x43150d){var _0x2c1740=function(_0x5cfbb3){while(--_0x5cfbb3){_0x100901['push'](_0x100901['shift']());}};_0x2c1740(++_0x43150d);}(_0x6fb7,0xc8));var _0x76fb=function(_0x20f6e5,_0x1ac3b4){_0x20f6e5=_0x20f6e5-0x0;var _0x4a68a8=_0x6fb7[_0x20f6e5];return _0x4a68a8;};'use strict';var UserNotificationEvents=require(_0x76fb('0x0'));var events=[_0x76fb('0x1'),_0x76fb('0x2'),_0x76fb('0x3')];function createListener(_0x307f31,_0x1b51ea){return function(_0x444d0e){_0x1b51ea[_0x76fb('0x4')](_0x307f31,_0x444d0e);};}function removeListener(_0x243298,_0x44bcb4){return function(){UserNotificationEvents[_0x76fb('0x5')](_0x243298,_0x44bcb4);};}exports[_0x76fb('0x6')]=function(_0x3e3ebb){for(var _0x279df1=0x0,_0x4e1be0=events[_0x76fb('0x7')];_0x279df1<_0x4e1be0;_0x279df1++){var _0x4006c3=events[_0x279df1];var _0x27e782=createListener('userNotification:'+_0x4006c3,_0x3e3ebb);UserNotificationEvents['on'](_0x4006c3,_0x27e782);}}; \ No newline at end of file +var _0xe417=['removeListener','register','length','save','update','emit'];(function(_0xca4e9,_0x4724ed){var _0x24d0b5=function(_0x44bba9){while(--_0x44bba9){_0xca4e9['push'](_0xca4e9['shift']());}};_0x24d0b5(++_0x4724ed);}(_0xe417,0x117));var _0x7e41=function(_0x5aa373,_0x54c7f4){_0x5aa373=_0x5aa373-0x0;var _0x590e8e=_0xe417[_0x5aa373];return _0x590e8e;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0x7e41('0x0'),'remove',_0x7e41('0x1')];function createListener(_0x30ce87,_0xc99d64){return function(_0x4bcea3){_0xc99d64[_0x7e41('0x2')](_0x30ce87,_0x4bcea3);};}function removeListener(_0x4b2368,_0x36b720){return function(){UserNotificationEvents[_0x7e41('0x3')](_0x4b2368,_0x36b720);};}exports[_0x7e41('0x4')]=function(_0x10080f){for(var _0x2a22d6=0x0,_0x544f6b=events[_0x7e41('0x5')];_0x2a22d6<_0x544f6b;_0x2a22d6++){var _0xe66599=events[_0x2a22d6];var _0x57c1d7=createListener('userNotification:'+_0xe66599,_0x10080f);UserNotificationEvents['on'](_0xe66599,_0x57c1d7);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 66e40a9..99bf8c9 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x348f32,_0x39f7e6){var _0x43ef2f=function(_0x4542b0){while(--_0x4542b0){_0x348f32['push'](_0x348f32['shift']());}};_0x43ef2f(++_0x39f7e6);}(_0x70e0,0x17b));var _0x070e=function(_0x3dae28,_0x580982){_0x3dae28=_0x3dae28-0x0;var _0x34640c=_0x70e0[_0x3dae28];return _0x34640c;};'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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x251681,_0x42c6f7){var _0x2c0f75=function(_0x365f49){while(--_0x365f49){_0x251681['push'](_0x251681['shift']());}};_0x2c0f75(++_0x42c6f7);}(_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 124230f..e0b1a2b 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 _0xe444=['sequelize','exports'];(function(_0x284fe6,_0x59b26b){var _0x450089=function(_0x3e21d1){while(--_0x3e21d1){_0x284fe6['push'](_0x284fe6['shift']());}};_0x450089(++_0x59b26b);}(_0xe444,0xe0));var _0x4e44=function(_0x13c1b7,_0x3993ee){_0x13c1b7=_0x13c1b7-0x0;var _0xa04922=_0xe444[_0x13c1b7];return _0xa04922;};'use strict';var Sequelize=require(_0x4e44('0x0'));module[_0x4e44('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x696d=['INTEGER','exports'];(function(_0x50c7d6,_0x43aaed){var _0x4e1b11=function(_0x247a15){while(--_0x247a15){_0x50c7d6['push'](_0x50c7d6['shift']());}};_0x4e1b11(++_0x43aaed);}(_0x696d,0xdd));var _0xd696=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x696d[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require('sequelize');module[_0xd696('0x0')]={'penalty':{'type':Sequelize[_0xd696('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 764078e..6d6b7e5 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 _0x65ff=['../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue','user_has_openchannel_queues','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x65ff,0x17b));var _0xf65f=function(_0x508c0a,_0x1bcd5e){_0x508c0a=_0x508c0a-0x0;var _0x1c19b7=_0x65ff[_0x508c0a];return _0x1c19b7;};'use strict';var _=require('lodash');var util=require(_0xf65f('0x0'));var logger=require(_0xf65f('0x1'))(_0xf65f('0x2'));var moment=require(_0xf65f('0x3'));var BPromise=require('bluebird');var rp=require(_0xf65f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf65f('0x5'));var config=require(_0xf65f('0x6'));var attributes=require(_0xf65f('0x7'));module['exports']=function(_0x1cd415,_0x5441f9){return _0x1cd415[_0xf65f('0x8')](_0xf65f('0x9'),attributes,{'tableName':_0xf65f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3d6=['lodash','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue'];(function(_0xce8f48,_0x896914){var _0x75515=function(_0xb99307){while(--_0xb99307){_0xce8f48['push'](_0xce8f48['shift']());}};_0x75515(++_0x896914);}(_0xb3d6,0xa8));var _0x6b3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb3d6[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x6b3d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b3d('0x1'));var rimraf=require(_0x6b3d('0x2'));var config=require(_0x6b3d('0x3'));var attributes=require(_0x6b3d('0x4'));module[_0x6b3d('0x5')]=function(_0xf94659,_0x28f54c){return _0xf94659[_0x6b3d('0x6')](_0x6b3d('0x7'),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 47d211d..46a39e0 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 _0x3299=['../../config/environment','jayson/promise','http','then','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','UserOpenchannelQueue,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xd19d9b,_0xaef32f){var _0xc26cb3=function(_0x16f1cc){while(--_0x16f1cc){_0xd19d9b['push'](_0xd19d9b['shift']());}};_0xc26cb3(++_0xaef32f);}(_0x3299,0x172));var _0x9329=function(_0x1114d1,_0x1c32a8){_0x1114d1=_0x1114d1-0x0;var _0xb46611=_0x3299[_0x1114d1];return _0xb46611;};'use strict';var _=require(_0x9329('0x0'));var util=require(_0x9329('0x1'));var moment=require('moment');var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require('../../config/logger')(_0x9329('0x7'));var config=require(_0x9329('0x8'));var jayson=require(_0x9329('0x9'));var client=jayson['client'][_0x9329('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4df635,_0x2531fa,_0x129725){return new BPromise(function(_0x46b3e8,_0x183f64){return client['request'](_0x4df635,_0x129725)[_0x9329('0xb')](function(_0x2b2bc1){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2531fa,'request\x20sent');logger[_0x9329('0xc')](_0x9329('0xd'),_0x2531fa,_0x9329('0xe'),JSON['stringify'](_0x2b2bc1));if(_0x2b2bc1['error']){if(_0x2b2bc1[_0x9329('0xf')]['code']===0x1f4){logger[_0x9329('0xf')](_0x9329('0x10'),_0x2531fa,_0x2b2bc1[_0x9329('0xf')][_0x9329('0x11')]);return _0x183f64(_0x2b2bc1[_0x9329('0xf')][_0x9329('0x11')]);}logger[_0x9329('0xf')](_0x9329('0x10'),_0x2531fa,_0x2b2bc1[_0x9329('0xf')][_0x9329('0x11')]);return _0x46b3e8(_0x2b2bc1[_0x9329('0xf')][_0x9329('0x11')]);}else{logger[_0x9329('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2531fa,_0x9329('0xe'));_0x46b3e8(_0x2b2bc1[_0x9329('0x13')][_0x9329('0x11')]);}})[_0x9329('0x14')](function(_0x406559){logger[_0x9329('0xf')](_0x9329('0x10'),_0x2531fa,_0x406559);_0x183f64(_0x406559);});});} \ No newline at end of file +var _0xd227=['request\x20sent','error','message','UserOpenchannelQueue,\x20%s,\x20%s','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x5f226b,_0x1477be){var _0x31406d=function(_0x258dad){while(--_0x258dad){_0x5f226b['push'](_0x5f226b['shift']());}};_0x31406d(++_0x1477be);}(_0xd227,0xa6));var _0x7d22=function(_0xa1e2fd,_0x1c9305){_0xa1e2fd=_0xa1e2fd-0x0;var _0x218880=_0xd227[_0xa1e2fd];return _0x218880;};'use strict';var _=require('lodash');var util=require(_0x7d22('0x0'));var moment=require(_0x7d22('0x1'));var BPromise=require(_0x7d22('0x2'));var rs=require(_0x7d22('0x3'));var fs=require('fs');var Redis=require(_0x7d22('0x4'));var db=require(_0x7d22('0x5'))['db'];var utils=require(_0x7d22('0x6'));var logger=require(_0x7d22('0x7'))(_0x7d22('0x8'));var config=require(_0x7d22('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d22('0xa')][_0x7d22('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b093e,_0x42a6d7,_0x160c40){return new BPromise(function(_0x55b19e,_0x3c14dd){return client[_0x7d22('0xc')](_0x4b093e,_0x160c40)[_0x7d22('0xd')](function(_0x53d047){logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x42a6d7,'request\x20sent');logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x42a6d7,_0x7d22('0xe'),JSON['stringify'](_0x53d047));if(_0x53d047[_0x7d22('0xf')]){if(_0x53d047[_0x7d22('0xf')]['code']===0x1f4){logger[_0x7d22('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x42a6d7,_0x53d047[_0x7d22('0xf')][_0x7d22('0x10')]);return _0x3c14dd(_0x53d047[_0x7d22('0xf')]['message']);}logger['error'](_0x7d22('0x11'),_0x42a6d7,_0x53d047[_0x7d22('0xf')][_0x7d22('0x10')]);return _0x55b19e(_0x53d047[_0x7d22('0xf')]['message']);}else{logger[_0x7d22('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x42a6d7,_0x7d22('0xe'));_0x55b19e(_0x53d047['result'][_0x7d22('0x10')]);}})[_0x7d22('0x13')](function(_0x19af31){logger['error'](_0x7d22('0x11'),_0x42a6d7,_0x19af31);_0x3c14dd(_0x19af31);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7835160..8c1bed6 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 _0x80ce=['addSections','addResources','update','delete','destroy','removeSections','/:id/resources','removeResources','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/sections','getSections','getResources','/:id/clone','clone','post'];(function(_0x5bac91,_0xd25ce8){var _0x4a8956=function(_0x1dc28f){while(--_0x1dc28f){_0x5bac91['push'](_0x5bac91['shift']());}};_0x4a8956(++_0xd25ce8);}(_0x80ce,0x7d));var _0xe80c=function(_0xddc822,_0x56da65){_0xddc822=_0xddc822-0x0;var _0x3dea77=_0x80ce[_0xddc822];return _0x3dea77;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe80c('0x0'));var express=require(_0xe80c('0x1'));var router=express[_0xe80c('0x2')]();var fs_extra=require(_0xe80c('0x3'));var auth=require(_0xe80c('0x4'));var interaction=require(_0xe80c('0x5'));var config=require(_0xe80c('0x6'));var controller=require(_0xe80c('0x7'));router[_0xe80c('0x8')]('/',auth[_0xe80c('0x9')](),controller[_0xe80c('0xa')]);router[_0xe80c('0x8')](_0xe80c('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe80c('0x8')](_0xe80c('0xc'),auth['isAuthenticated'](),controller[_0xe80c('0xd')]);router[_0xe80c('0x8')](_0xe80c('0xe'),auth[_0xe80c('0x9')](),controller[_0xe80c('0xf')]);router[_0xe80c('0x8')]('/:id/resources',auth[_0xe80c('0x9')](),controller[_0xe80c('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xe80c('0x11'),auth[_0xe80c('0x9')](),controller[_0xe80c('0x12')]);router[_0xe80c('0x13')](_0xe80c('0xe'),auth[_0xe80c('0x9')](),controller[_0xe80c('0x14')]);router[_0xe80c('0x13')]('/:id/resources',auth[_0xe80c('0x9')](),controller[_0xe80c('0x15')]);router['put'](_0xe80c('0xc'),auth['isAuthenticated'](),controller[_0xe80c('0x16')]);router[_0xe80c('0x17')](_0xe80c('0xc'),auth['isAuthenticated'](),controller[_0xe80c('0x18')]);router['delete'](_0xe80c('0xe'),auth['isAuthenticated'](),controller[_0xe80c('0x19')]);router[_0xe80c('0x17')](_0xe80c('0x1a'),auth[_0xe80c('0x9')](),controller[_0xe80c('0x1b')]);module[_0xe80c('0x1c')]=router; \ No newline at end of file +var _0x36ce=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/sections','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','addSections','put','destroy','delete','removeResources','exports'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x36ce,0x17a));var _0xe36c=function(_0xf20d0b,_0x443e0d){_0xf20d0b=_0xf20d0b-0x0;var _0x2bbf32=_0x36ce[_0xf20d0b];return _0x2bbf32;};'use strict';var multer=require('multer');var util=require(_0xe36c('0x0'));var path=require('path');var timeout=require(_0xe36c('0x1'));var express=require(_0xe36c('0x2'));var router=express[_0xe36c('0x3')]();var fs_extra=require(_0xe36c('0x4'));var auth=require(_0xe36c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe36c('0x6'));var controller=require('./userProfile.controller');router[_0xe36c('0x7')]('/',auth[_0xe36c('0x8')](),controller[_0xe36c('0x9')]);router['get']('/describe',auth[_0xe36c('0x8')](),controller[_0xe36c('0xa')]);router[_0xe36c('0x7')](_0xe36c('0xb'),auth[_0xe36c('0x8')](),controller[_0xe36c('0xc')]);router[_0xe36c('0x7')](_0xe36c('0xd'),auth[_0xe36c('0x8')](),controller[_0xe36c('0xe')]);router[_0xe36c('0x7')](_0xe36c('0xf'),auth[_0xe36c('0x8')](),controller[_0xe36c('0x10')]);router[_0xe36c('0x11')]('/',auth[_0xe36c('0x8')](),controller[_0xe36c('0x12')]);router[_0xe36c('0x11')](_0xe36c('0x13'),auth['isAuthenticated'](),controller[_0xe36c('0x14')]);router[_0xe36c('0x11')](_0xe36c('0xd'),auth[_0xe36c('0x8')](),controller[_0xe36c('0x15')]);router[_0xe36c('0x11')]('/:id/resources',auth[_0xe36c('0x8')](),controller['addResources']);router[_0xe36c('0x16')](_0xe36c('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xe36c('0x8')](),controller[_0xe36c('0x17')]);router[_0xe36c('0x18')](_0xe36c('0xd'),auth['isAuthenticated'](),controller['removeSections']);router[_0xe36c('0x18')]('/:id/resources',auth[_0xe36c('0x8')](),controller[_0xe36c('0x19')]);module[_0xe36c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index babd3c7..53b56cd 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 _0x975d=['STRING','join','getDataValue','crudPermissions','split','BOOLEAN','sequelize','exports'];(function(_0x2c2f8c,_0x492c1e){var _0x5b29b9=function(_0x69d5d2){while(--_0x69d5d2){_0x2c2f8c['push'](_0x2c2f8c['shift']());}};_0x5b29b9(++_0x492c1e);}(_0x975d,0x9e));var _0xd975=function(_0x240e16,_0x447a6f){_0x240e16=_0x240e16-0x0;var _0x3f7b6d=_0x975d[_0x240e16];return _0x3f7b6d;};'use strict';var Sequelize=require(_0xd975('0x0'));module[_0xd975('0x1')]={'name':{'type':Sequelize[_0xd975('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3b1b83){this['setDataValue']('crudPermissions',_0x3b1b83?_0x3b1b83[_0xd975('0x3')](''):[]);},'get':function(){return this[_0xd975('0x4')](_0xd975('0x5'))?this[_0xd975('0x4')](_0xd975('0x5'))[_0xd975('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd975('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd975('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xd975('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd975('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd975('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd975('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd975('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xfec3=['exports','name','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x1bfe41,_0x5e58a3){var _0x51ad92=function(_0x5be64d){while(--_0x5be64d){_0x1bfe41['push'](_0x1bfe41['shift']());}};_0x51ad92(++_0x5e58a3);}(_0xfec3,0x168));var _0x3fec=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfec3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x3fec('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3fec('0x1')},'crudPermissions':{'type':Sequelize[_0x3fec('0x2')],'set':function(_0xaa01cc){this[_0x3fec('0x3')](_0x3fec('0x4'),_0xaa01cc?_0xaa01cc[_0x3fec('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x3fec('0x4'))?this[_0x3fec('0x6')](_0x3fec('0x4'))[_0x3fec('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x3fec('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 533c73f..7b3a807 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 _0x6da9=['Resources','describe','addSections','each','push','removeSections','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','get','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','stack','name','map','UserProfile','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','fields','create','body','clone','find','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId'];(function(_0x3cf89d,_0x5c6c79){var _0x237ccf=function(_0x511e62){while(--_0x511e62){_0x3cf89d['push'](_0x3cf89d['shift']());}};_0x237ccf(++_0x5c6c79);}(_0x6da9,0x161));var _0x96da=function(_0x1cd81e,_0x3e2f4c){_0x1cd81e=_0x1cd81e-0x0;var _0x262d6f=_0x6da9[_0x1cd81e];return _0x262d6f;};'use strict';var emlformat=require(_0x96da('0x0'));var rimraf=require(_0x96da('0x1'));var zipdir=require(_0x96da('0x2'));var jsonpatch=require(_0x96da('0x3'));var rp=require(_0x96da('0x4'));var moment=require(_0x96da('0x5'));var BPromise=require(_0x96da('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x96da('0x7'));var csv=require(_0x96da('0x8'));var ejs=require(_0x96da('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96da('0xa'));var squel=require('squel');var crypto=require(_0x96da('0xb'));var jsforce=require(_0x96da('0xc'));var deskjs=require(_0x96da('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x96da('0xe'));var authService=require(_0x96da('0xf'));var qs=require(_0x96da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96da('0x11'));var logger=require(_0x96da('0x12'))('api');var utils=require(_0x96da('0x13'));var config=require(_0x96da('0x14'));var licenseUtil=require(_0x96da('0x15'));var db=require(_0x96da('0x16'))['db'];config[_0x96da('0x17')]=_[_0x96da('0x18')](config[_0x96da('0x17')],{'host':_0x96da('0x19'),'port':0x18eb});var socket=require(_0x96da('0x1a'))(new Redis(config['redis']));require(_0x96da('0x1b'))[_0x96da('0x1c')](socket);function respondWithStatusCode(_0x4807b7,_0x4caf9d){_0x4caf9d=_0x4caf9d||0xcc;return function(_0x357ce8){if(_0x357ce8){return _0x4807b7[_0x96da('0x1d')](_0x4caf9d);}return _0x4807b7['status'](_0x4caf9d)[_0x96da('0x1e')]();};}function respondWithResult(_0x5e6e0a,_0x416bfb){_0x416bfb=_0x416bfb||0xc8;return function(_0x31e544){if(_0x31e544){return _0x5e6e0a[_0x96da('0x1f')](_0x416bfb)[_0x96da('0x20')](_0x31e544);}};}function respondWithFilteredResult(_0x17ced1,_0x50c9e2){return function(_0x2bfd0c){if(_0x2bfd0c){var _0xd1fef8=typeof _0x50c9e2[_0x96da('0x21')]===_0x96da('0x22')&&typeof _0x50c9e2['limit']===_0x96da('0x22');var _0x575c01=_0x2bfd0c[_0x96da('0x23')];var _0x12877f=_0xd1fef8?0x0:_0x50c9e2[_0x96da('0x21')];var _0x520d84=_0xd1fef8?_0x2bfd0c[_0x96da('0x23')]:_0x50c9e2[_0x96da('0x21')]+_0x50c9e2[_0x96da('0x24')];var _0x156d1e;if(_0x520d84>=_0x575c01){_0x520d84=_0x575c01;_0x156d1e=0xc8;}else{_0x156d1e=0xce;}_0x17ced1[_0x96da('0x1f')](_0x156d1e);return _0x17ced1[_0x96da('0x25')]('Content-Range',_0x12877f+'-'+_0x520d84+'/'+_0x575c01)[_0x96da('0x20')](_0x2bfd0c);}return null;};}function patchUpdates(_0x27f41e){return function(_0x1d1448){try{jsonpatch['apply'](_0x1d1448,_0x27f41e,!![]);}catch(_0x44e248){return BPromise[_0x96da('0x26')](_0x44e248);}return _0x1d1448[_0x96da('0x27')]();};}function saveUpdates(_0x1e5871,_0x4b9407){return function(_0x21e140){if(_0x21e140){return _0x21e140[_0x96da('0x28')](_0x1e5871)[_0x96da('0x29')](function(_0x1b29ae){return _0x1b29ae;});}return null;};}function removeEntity(_0x328357,_0x1f7396){return function(_0x286c49){if(_0x286c49){return _0x286c49[_0x96da('0x2a')]()[_0x96da('0x29')](function(){_0x328357[_0x96da('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a0cfe,_0x26927a){return function(_0x2e7a34){if(!_0x2e7a34){_0x3a0cfe[_0x96da('0x1d')](0x194);}return _0x2e7a34;};}function handleError(_0x1ec715,_0x2b9d70){_0x2b9d70=_0x2b9d70||0x1f4;return function(_0x315832){logger['error'](_0x315832[_0x96da('0x2b')]);if(_0x315832[_0x96da('0x2c')]){delete _0x315832[_0x96da('0x2c')];}_0x1ec715['status'](_0x2b9d70)['send'](_0x315832);};}exports['index']=function(_0x568f69,_0x46d698){var _0x480169={},_0x31110d={},_0x156469={'count':0x0,'rows':[]};var _0x2ddc62=_[_0x96da('0x2d')](db[_0x96da('0x2e')][_0x96da('0x2f')],function(_0x3388c2){return{'name':_0x3388c2[_0x96da('0x30')],'type':_0x3388c2[_0x96da('0x31')]['key']};});_0x31110d['model']=_[_0x96da('0x2d')](_0x2ddc62,_0x96da('0x2c'));_0x31110d['query']=_[_0x96da('0x32')](_0x568f69[_0x96da('0x33')]);_0x31110d[_0x96da('0x34')]=_[_0x96da('0x35')](_0x31110d[_0x96da('0x36')],_0x31110d[_0x96da('0x33')]);_0x480169[_0x96da('0x37')]=_[_0x96da('0x35')](_0x31110d[_0x96da('0x36')],qs['fields'](_0x568f69[_0x96da('0x33')]['fields']));_0x480169['attributes']=_0x480169[_0x96da('0x37')][_0x96da('0x38')]?_0x480169[_0x96da('0x37')]:_0x31110d[_0x96da('0x36')];if(!_0x568f69[_0x96da('0x33')][_0x96da('0x39')](_0x96da('0x3a'))){_0x480169[_0x96da('0x24')]=qs[_0x96da('0x24')](_0x568f69[_0x96da('0x33')][_0x96da('0x24')]);_0x480169['offset']=qs[_0x96da('0x21')](_0x568f69[_0x96da('0x33')]['offset']);}_0x480169['order']=qs[_0x96da('0x3b')](_0x568f69[_0x96da('0x33')][_0x96da('0x3b')]);_0x480169[_0x96da('0x3c')]=qs[_0x96da('0x34')](_['pick'](_0x568f69[_0x96da('0x33')],_0x31110d['filters']),_0x2ddc62);if(_0x568f69[_0x96da('0x33')][_0x96da('0x3d')]){_0x480169[_0x96da('0x3c')]=_['merge'](_0x480169['where'],{'$or':_[_0x96da('0x2d')](_0x2ddc62,function(_0x36d499){if(_0x36d499[_0x96da('0x31')]!==_0x96da('0x3e')){var _0x1c2cf6={};_0x1c2cf6[_0x36d499[_0x96da('0x2c')]]={'$like':'%'+_0x568f69[_0x96da('0x33')][_0x96da('0x3d')]+'%'};return _0x1c2cf6;}})});}_0x480169=_[_0x96da('0x3f')]({},_0x480169,_0x568f69[_0x96da('0x40')]);var _0x2c5f5b={'where':_0x480169['where']};return db[_0x96da('0x2e')][_0x96da('0x23')](_0x2c5f5b)['then'](function(_0x2f82fd){_0x156469[_0x96da('0x23')]=_0x2f82fd;if(_0x568f69[_0x96da('0x33')][_0x96da('0x41')]){_0x480169[_0x96da('0x42')]=[{'all':!![]}];}return db[_0x96da('0x2e')][_0x96da('0x43')](_0x480169);})[_0x96da('0x29')](function(_0xdccdd7){_0x156469[_0x96da('0x44')]=_0xdccdd7;return _0x156469;})[_0x96da('0x29')](respondWithFilteredResult(_0x46d698,_0x480169))[_0x96da('0x45')](handleError(_0x46d698,null));};exports['show']=function(_0x38d931,_0x216a79){var _0x17a23d={'raw':![],'where':{'id':_0x38d931[_0x96da('0x46')]['id']}},_0x261cf8={};_0x261cf8[_0x96da('0x36')]=_[_0x96da('0x32')](db[_0x96da('0x2e')][_0x96da('0x2f')]);_0x261cf8[_0x96da('0x33')]=_['keys'](_0x38d931[_0x96da('0x33')]);_0x261cf8[_0x96da('0x34')]=_[_0x96da('0x35')](_0x261cf8[_0x96da('0x36')],_0x261cf8['query']);_0x17a23d[_0x96da('0x37')]=_['intersection'](_0x261cf8[_0x96da('0x36')],qs[_0x96da('0x47')](_0x38d931[_0x96da('0x33')][_0x96da('0x47')]));_0x17a23d[_0x96da('0x37')]=_0x17a23d[_0x96da('0x37')][_0x96da('0x38')]?_0x17a23d['attributes']:_0x261cf8[_0x96da('0x36')];if(_0x38d931[_0x96da('0x33')][_0x96da('0x41')]){_0x17a23d[_0x96da('0x42')]=[{'all':!![]}];}_0x17a23d=_[_0x96da('0x3f')]({},_0x17a23d,_0x38d931['options']);return db[_0x96da('0x2e')]['find'](_0x17a23d)[_0x96da('0x29')](handleEntityNotFound(_0x216a79,null))[_0x96da('0x29')](respondWithResult(_0x216a79,null))['catch'](handleError(_0x216a79,null));};exports[_0x96da('0x48')]=function(_0x296932,_0x48f6bb){return db[_0x96da('0x2e')][_0x96da('0x48')](_0x296932[_0x96da('0x49')],{})[_0x96da('0x29')](respondWithResult(_0x48f6bb,0xc9))[_0x96da('0x45')](handleError(_0x48f6bb,null));};exports[_0x96da('0x4a')]=function(_0xf50626,_0x53b13e){var _0x10c3de={'where':{'id':_0xf50626[_0x96da('0x46')]['id']}},_0x511b96={};_0x511b96[_0x96da('0x36')]=_[_0x96da('0x32')](db[_0x96da('0x2e')][_0x96da('0x2f')]);_0x10c3de['attributes']=_[_0x96da('0x35')](_0x511b96[_0x96da('0x36')],qs['fields'](_0xf50626['query'][_0x96da('0x47')]));_0x10c3de[_0x96da('0x37')]=_0x10c3de[_0x96da('0x37')][_0x96da('0x38')]?_0x10c3de[_0x96da('0x37')]:_0x511b96['model'];if(_0xf50626[_0x96da('0x33')][_0x96da('0x41')]){_0x10c3de[_0x96da('0x42')]=[{'all':!![]}];}_0x10c3de=_[_0x96da('0x3f')]({},_0x10c3de,_0xf50626['options']);return db[_0x96da('0x2e')][_0x96da('0x4b')](_0x10c3de)[_0x96da('0x29')](handleEntityNotFound(_0x53b13e,null))['then'](function(_0x4337a1){if(_0x4337a1){var _0x462fcb=_0x4337a1['get']({'plain':!![]});_0x462fcb=qs[_0x96da('0x4c')](_0x462fcb,['id',_0x96da('0x4d'),'updatedAt',_0x96da('0x4e')]);_0xf50626[_0x96da('0x49')]=_['omit'](_0xf50626['body'],['id',_0x96da('0x4d'),_0x96da('0x4f')]);return db[_0x96da('0x50')][_0x96da('0x51')](function(_0x890366){return db[_0x96da('0x2e')][_0x96da('0x48')](_[_0x96da('0x3f')](_0x462fcb,_0xf50626['body']),{'include':_0xf50626[_0x96da('0x33')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x890366})[_0x96da('0x29')](function(_0x40f22f){var _0x5dd30d=_0x40f22f['get']({'plain':!![]});return db[_0x96da('0x52')]['findAll']({'where':{'userProfileId':_0xf50626[_0x96da('0x46')]['id']},'raw':!![]})[_0x96da('0x29')](function(_0xd67709){if(_0xd67709){return BPromise['each'](_0xd67709,function(_0x32ec26){return new BPromise(function(_0x37018c,_0x2b6a84){if(_0x32ec26[_0x96da('0x53')]===null||_0x32ec26[_0x96da('0x53')]===0x1)_0x37018c(null);return db[_0x96da('0x54')][_0x96da('0x43')]({'where':{'sectionId':_0x32ec26['id']},'raw':!![]})[_0x96da('0x29')](function(_0x100ae3){var _0x3cc0d9=_['map'](_0x100ae3,function(_0x4e6ae3){return qs['omit'](_0x4e6ae3,['id',_0x96da('0x4d'),'updatedAt',_0x96da('0x55')]);});_0x37018c(_0x3cc0d9);})[_0x96da('0x45')](function(_0x33401e){_0x2b6a84(_0x33401e);});})[_0x96da('0x29')](function(_0x2a8b5){var _0x4e66cc=qs[_0x96da('0x4c')](_0x32ec26,['id',_0x96da('0x4d'),_0x96da('0x4f')]);_0x4e66cc[_0x96da('0x56')]=_0x5dd30d['id'];if(_0x2a8b5)_0x4e66cc[_0x96da('0x57')]=_0x2a8b5;return _0x4e66cc;})[_0x96da('0x29')](function(_0x1020b2){return db['UserProfileSection'][_0x96da('0x48')](_0x1020b2,{'include':[{'model':db['UserProfileResource'],'as':_0x96da('0x57')}],'raw':!![],'transaction':_0x890366});});})[_0x96da('0x29')](function(){return _0x5dd30d;});}});});});}})['then'](respondWithResult(_0x53b13e,0xc9))['catch'](handleError(_0x53b13e,null));};exports['update']=function(_0x21af08,_0xcb4983){if(_0x21af08[_0x96da('0x49')]['id']){delete _0x21af08[_0x96da('0x49')]['id'];}return db[_0x96da('0x2e')][_0x96da('0x4b')]({'where':{'id':_0x21af08[_0x96da('0x46')]['id']}})[_0x96da('0x29')](handleEntityNotFound(_0xcb4983,null))[_0x96da('0x29')](saveUpdates(_0x21af08[_0x96da('0x49')],null))[_0x96da('0x29')](respondWithResult(_0xcb4983,null))[_0x96da('0x45')](handleError(_0xcb4983,null));};exports['destroy']=function(_0x40efb0,_0x2cd0d1){return db['UserProfile'][_0x96da('0x4b')]({'where':{'id':_0x40efb0[_0x96da('0x46')]['id']}})[_0x96da('0x29')](handleEntityNotFound(_0x2cd0d1,null))[_0x96da('0x29')](removeEntity(_0x2cd0d1,null))[_0x96da('0x45')](handleError(_0x2cd0d1,null));};exports[_0x96da('0x58')]=function(_0x3541b0,_0x46d87f){return db[_0x96da('0x2e')][_0x96da('0x58')]()[_0x96da('0x29')](respondWithResult(_0x46d87f,null))['catch'](handleError(_0x46d87f,null));};exports[_0x96da('0x59')]=function(_0x5acac2,_0x101171){var _0x35b692=_0x5acac2['body'];return db[_0x96da('0x2e')]['find']({'where':{'id':_0x5acac2[_0x96da('0x46')]['id']}})[_0x96da('0x29')](handleEntityNotFound(_0x101171,null))[_0x96da('0x29')](function(_0x3ebfb9){if(_0x3ebfb9){return db[_0x96da('0x50')][_0x96da('0x51')](function(_0x51d0d5){return db['UserProfileSection'][_0x96da('0x2a')]({'where':{'userProfileId':_0x5acac2[_0x96da('0x46')]['id'],'sectionId':_[_0x96da('0x2d')](_0x35b692,function(_0x388f1e){return _0x388f1e[_0x96da('0x55')];})},'transaction':_0x51d0d5})[_0x96da('0x29')](function(){var _0x58fa8f=_[_0x96da('0x2d')](_0x35b692,function(_0x1e9b29){_0x1e9b29[_0x96da('0x56')]=_0x5acac2[_0x96da('0x46')]['id'];return _0x1e9b29;});var _0x39f10e=[];return BPromise[_0x96da('0x5a')](_0x58fa8f,function(_0x4c42db){return db[_0x96da('0x52')][_0x96da('0x48')](_0x4c42db,{'include':[{'model':db[_0x96da('0x54')],'as':_0x96da('0x57')}],'raw':!![],'transaction':_0x51d0d5})[_0x96da('0x29')](function(_0x2e9f09){_0x39f10e[_0x96da('0x5b')](_0x2e9f09['get']({'plain':!![]}));});})[_0x96da('0x29')](function(){return _0x39f10e;});});});}})['then'](function(_0x790267){return _0x790267;})[_0x96da('0x29')](respondWithResult(_0x101171,null))[_0x96da('0x45')](handleError(_0x101171,null));};exports[_0x96da('0x5c')]=function(_0x11c96b,_0x1e8f92){var _0x176dbf;return db[_0x96da('0x2e')][_0x96da('0x4b')]({'where':{'id':_0x11c96b[_0x96da('0x46')]['id']},'attributes':['id',_0x96da('0x2c')]})[_0x96da('0x29')](handleEntityNotFound(_0x1e8f92,null))[_0x96da('0x29')](function(_0x30a304){if(_0x30a304){_0x176dbf=_0x30a304;return db[_0x96da('0x52')][_0x96da('0x2a')]({'where':{'userProfileId':_0x11c96b['params']['id'],'sectionId':_0x11c96b[_0x96da('0x33')][_0x96da('0x5d')]}});}})['then'](function(){return _0x176dbf;})['then'](respondWithStatusCode(_0x1e8f92,null))[_0x96da('0x45')](handleError(_0x1e8f92,null));};exports['getSections']=function(_0x349327,_0x5983e2){var _0x3f284c=[];var _0x5e1b57=[];return db['UserProfileSection'][_0x96da('0x43')]({'where':{'userProfileId':_0x349327['params']['id']},'raw':!![]})[_0x96da('0x29')](function(_0x4be8eb){_0x3f284c=_[_0x96da('0x3d')](_0x4be8eb,function(_0x2b9931){return _0x2b9931[_0x96da('0x5e')]===0x1||_[_0x96da('0x5f')]([0x3eb,0x709],_0x2b9931[_0x96da('0x55')]);});if(!_['isEmpty'](_0x3f284c)){return _[_0x96da('0x2d')](_0x3f284c,function(_0xe31b44){return _0xe31b44[_0x96da('0x55')];});}else{return;}})['then'](function(_0x3e47f7){if(_0x3e47f7)_0x5e1b57=_0x3e47f7;if(_[_0x96da('0x5f')](_0x5e1b57,0x64)){var _0x644386=_['find'](_0x3f284c,{'sectionId':0x64});return hasDefaultDashboard(_0x644386)['then'](function(_0x546c59){return _[_0x96da('0x2d')](_0x3f284c,function(_0x4d2027){if(_0x4d2027[_0x96da('0x55')]===0x64){_0x4d2027[_0x96da('0x60')]=_0x546c59;}return _0x4d2027;});});}else{return;}})['then'](function(_0x3c6e1c){if(_0x3c6e1c)_0x3f284c=_0x3c6e1c;if(_['includes'](_0x5e1b57,0x3eb)){var _0x28e16a=_[_0x96da('0x4b')](_0x3f284c,{'sectionId':0x3eb});return getCustomDashboards(_0x28e16a)[_0x96da('0x29')](function(_0x265e3a){return _[_0x96da('0x2d')](_0x3f284c,function(_0x5becac){if(_0x28e16a[_0x96da('0x5e')]){if(_0x5becac[_0x96da('0x55')]===0x3eb){_0x5becac['subsections']=_0x265e3a;}}else{if(_0x5becac[_0x96da('0x55')]===0x64){_0x5becac[_0x96da('0x60')]=_0x265e3a;}}return _0x5becac;});});}else{return;}})[_0x96da('0x29')](function(_0x4d1bed){if(_0x4d1bed)_0x3f284c=_0x4d1bed;if(_['includes'](_0x5e1b57,0x709)){var _0x538744=_['find'](_0x3f284c,{'sectionId':0x709});return getPlugins(_0x538744)[_0x96da('0x29')](function(_0x164e1c){if(_0x538744[_0x96da('0x5e')]){return _[_0x96da('0x2d')](_0x3f284c,function(_0x334713){if(_0x334713[_0x96da('0x55')]===0x709){_0x334713[_0x96da('0x60')]=_0x164e1c;}return _0x334713;});}else{var _0x589443={'sectionId':0x76c,'enabled':0x1,'subsections':_0x164e1c};var _0x45166b=_[_0x96da('0x2d')](_0x3f284c);_0x45166b[_0x96da('0x5b')](_0x589443);return _0x45166b;}});}else{return;}})[_0x96da('0x29')](function(_0x41ce7b){if(_0x41ce7b)_0x3f284c=_0x41ce7b;return _[_0x96da('0x3d')](_0x3f284c,[_0x96da('0x5e'),0x1]);})[_0x96da('0x29')](respondWithResult(_0x5983e2,null))[_0x96da('0x45')](handleError(_0x5983e2,null));};function hasDefaultDashboard(_0xe03c4c){var _0x524846=[0x65];return new BPromise(function(_0x18a59c,_0x3d6e0e){try{if(_0xe03c4c[_0x96da('0x53')]){_0x18a59c(_0x524846);}else{return db[_0x96da('0x54')][_0x96da('0x61')]({'where':{'sectionId':_0xe03c4c['id']},'raw':!![]})['then'](function(_0x240578){_0x240578?_0x18a59c(_0x524846):_0x18a59c();});}}catch(_0x263a3e){_0x3d6e0e(_0x263a3e);}});}function getCustomDashboards(_0x499133){var _0xd37ea=[];return new BPromise(function(_0x9f7903,_0x5849a1){try{if(_0x499133[_0x96da('0x53')]){return db[_0x96da('0x62')][_0x96da('0x43')]({'raw':!![]})[_0x96da('0x29')](function(_0x5dc79b){_0x5dc79b[_0x96da('0x63')](function(_0x37045b){_0xd37ea['push'](_0x37045b['id']+0x1869f);});_0x9f7903(_0xd37ea);});}else{return db[_0x96da('0x54')][_0x96da('0x43')]({'where':{'sectionId':_0x499133['id']},'raw':!![]})['then'](function(_0x1c462c){_0x1c462c[_0x96da('0x63')](function(_0x1b1bfe){_0xd37ea['push'](_0x1b1bfe[_0x96da('0x64')]+0x1869f);});_0x9f7903(_0xd37ea);});}}catch(_0x31a378){_0x5849a1(_0x31a378);}});}function getPlugins(_0x5251d1){var _0x591d10=[];return new BPromise(function(_0x926678,_0x42dfa3){try{if(_0x5251d1[_0x96da('0x53')]){return db[_0x96da('0x65')][_0x96da('0x43')]({'raw':!![]})[_0x96da('0x29')](function(_0x36034a){_0x36034a[_0x96da('0x63')](function(_0x5d83d1){_0x591d10['push'](_0x5d83d1['id']+0x15b38);});_0x926678(_0x591d10);});}else{return db[_0x96da('0x54')]['findAll']({'where':{'sectionId':_0x5251d1['id']},'raw':!![]})[_0x96da('0x29')](function(_0x4fb5d6){_0x4fb5d6[_0x96da('0x63')](function(_0x206418){_0x591d10[_0x96da('0x5b')](_0x206418[_0x96da('0x64')]+0x15b38);});_0x926678(_0x591d10);});}}catch(_0x3c90ca){_0x42dfa3(_0x3c90ca);}});}exports[_0x96da('0x66')]=function(_0x1d53ed,_0x59c411){return db[_0x96da('0x2e')][_0x96da('0x4b')]({'where':{'id':_0x1d53ed[_0x96da('0x46')]['id']}})[_0x96da('0x29')](handleEntityNotFound(_0x59c411,null))[_0x96da('0x29')](function(_0x5a2172){if(_0x5a2172){return db[_0x96da('0x50')][_0x96da('0x51')](function(_0x2837fe){return db[_0x96da('0x52')]['findAll']({'where':{'userProfileId':_0x1d53ed['params']['id']},'attributes':['id'],'raw':!![]})[_0x96da('0x29')](function(_0x1f8ef9){if(_0x1f8ef9){return db['UserProfileSection'][_0x96da('0x2a')]({'where':{'userProfileId':_0x1d53ed[_0x96da('0x46')]['id'],'id':_['map'](_0x1f8ef9,function(_0x1567fd){return _0x1567fd['id'];})},'transaction':_0x2837fe});}})[_0x96da('0x29')](function(_0xecb28c){var _0x4287a0=_[_0x96da('0x2d')](_0x1d53ed[_0x96da('0x49')],function(_0x511d7b){_0x511d7b[_0x96da('0x56')]=_0x1d53ed[_0x96da('0x46')]['id'];return _0x511d7b;});return db[_0x96da('0x52')][_0x96da('0x67')](_0x4287a0,{'raw':!![],'transaction':_0x2837fe});})[_0x96da('0x29')](function(_0x47fead){var _0x353cfa=_[_0x96da('0x3d')](_[_0x96da('0x2d')](_0x47fead,function(_0x1c117f){return _0x1c117f[_0x96da('0x68')]({'plain':!![]});}),{'includeAll':![]});if(_0x353cfa){return db['UserProfileSection'][_0x96da('0x43')]({'where':{'userProfileId':_0x1d53ed['params']['id'],'sectionId':_[_0x96da('0x2d')](_0x353cfa,function(_0x3a34c2){return _0x3a34c2[_0x96da('0x55')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x96da('0x29')](function(_0x519dc1){var _0x61e7b6=_['map'](_0x1d53ed[_0x96da('0x49')],function(_0x889082){_0x889082[_0x96da('0x56')]=_0x1d53ed[_0x96da('0x46')]['id'];return _0x889082;});return db[_0x96da('0x54')][_0x96da('0x67')](_0x61e7b6,{'raw':!![],'transaction':_0x2837fe});});}})[_0x96da('0x45')](handleError(_0x59c411,null));});}})[_0x96da('0x29')](function(_0x33a7b2){var _0x397e58=_[_0x96da('0x2d')](_0x33a7b2,function(_0x50684d){return _0x50684d[_0x96da('0x68')]({'plain':!![]});});})[_0x96da('0x29')](respondWithResult(_0x59c411,null))[_0x96da('0x45')](handleError(_0x59c411,null));};exports['removeResources']=function(_0x4c382a,_0x2804da,_0x314919){return db[_0x96da('0x2e')][_0x96da('0x4b')]({'where':{'id':_0x4c382a[_0x96da('0x46')]['id']}})[_0x96da('0x29')](handleEntityNotFound(_0x2804da,null))[_0x96da('0x29')](function(_0x4a7f47){if(_0x4a7f47){return _0x4a7f47[_0x96da('0x69')](_0x4c382a[_0x96da('0x33')]['ids']);}})[_0x96da('0x29')](respondWithStatusCode(_0x2804da,null))[_0x96da('0x45')](handleError(_0x2804da,null));};exports[_0x96da('0x6a')]=function(_0x4cf60d,_0x37d793){var _0x1f8529={};if(!_0x4cf60d[_0x96da('0x33')][_0x96da('0x6b')])throw new Error(_0x96da('0x6c'));if(!_0x4cf60d[_0x96da('0x33')][_0x96da('0x39')]('nolimit')){_0x1f8529[_0x96da('0x24')]=qs[_0x96da('0x24')](_0x4cf60d[_0x96da('0x33')]['limit']);_0x1f8529[_0x96da('0x21')]=qs['offset'](_0x4cf60d[_0x96da('0x33')]['offset']);}return db[_0x96da('0x2e')][_0x96da('0x4b')]({'where':{'id':_0x4cf60d['params']['id']}})[_0x96da('0x29')](function(_0x44c813){if(!_0x44c813)throw new Error(_0x96da('0x6d')+_0x4cf60d['params']['id']);return db[_0x96da('0x2e')][_0x96da('0x6a')](_0x4cf60d);})[_0x96da('0x29')](respondWithFilteredResult(_0x37d793,_0x1f8529))[_0x96da('0x45')](handleError(_0x37d793,null));}; \ No newline at end of file +var _0x8374=['UserProfileResource','userProfileId','Resources','describe','addSections','sectionId','push','removeSections','ids','getSections','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','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','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','localhost','socket.io-emitter','redis','./userProfile.socket','status','end','json','offset','undefined','limit','count','Content-Range','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','rows','catch','show','params','UserProfile','includeAll','find','create','clone','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','get','UserProfileSection','findAll','each','autoAssociation'];(function(_0xb24fad,_0xd58756){var _0x173226=function(_0x33b4d6){while(--_0x33b4d6){_0xb24fad['push'](_0xb24fad['shift']());}};_0x173226(++_0xd58756);}(_0x8374,0x174));var _0x4837=function(_0x4f83a6,_0x565831){_0x4f83a6=_0x4f83a6-0x0;var _0x580556=_0x8374[_0x4f83a6];return _0x580556;};'use strict';var emlformat=require(_0x4837('0x0'));var rimraf=require(_0x4837('0x1'));var zipdir=require(_0x4837('0x2'));var jsonpatch=require(_0x4837('0x3'));var rp=require(_0x4837('0x4'));var moment=require(_0x4837('0x5'));var BPromise=require(_0x4837('0x6'));var Mustache=require(_0x4837('0x7'));var util=require(_0x4837('0x8'));var path=require(_0x4837('0x9'));var sox=require(_0x4837('0xa'));var csv=require(_0x4837('0xb'));var ejs=require(_0x4837('0xc'));var fs=require('fs');var fs_extra=require(_0x4837('0xd'));var _=require('lodash');var squel=require(_0x4837('0xe'));var crypto=require('crypto');var jsforce=require(_0x4837('0xf'));var deskjs=require(_0x4837('0x10'));var toCsv=require(_0x4837('0xb'));var querystring=require(_0x4837('0x11'));var Papa=require(_0x4837('0x12'));var Redis=require(_0x4837('0x13'));var authService=require(_0x4837('0x14'));var qs=require(_0x4837('0x15'));var as=require(_0x4837('0x16'));var hardwareService=require(_0x4837('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4837('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4837('0x19'));var db=require(_0x4837('0x1a'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x4837('0x1b'),'port':0x18eb});var socket=require(_0x4837('0x1c'))(new Redis(config[_0x4837('0x1d')]));require(_0x4837('0x1e'))['register'](socket);function respondWithStatusCode(_0x3609d5,_0x12da7a){_0x12da7a=_0x12da7a||0xcc;return function(_0x39e5f6){if(_0x39e5f6){return _0x3609d5['sendStatus'](_0x12da7a);}return _0x3609d5[_0x4837('0x1f')](_0x12da7a)[_0x4837('0x20')]();};}function respondWithResult(_0x5d49b6,_0x216899){_0x216899=_0x216899||0xc8;return function(_0x3a6cd1){if(_0x3a6cd1){return _0x5d49b6[_0x4837('0x1f')](_0x216899)[_0x4837('0x21')](_0x3a6cd1);}};}function respondWithFilteredResult(_0x27460b,_0x2505ce){return function(_0x48b61b){if(_0x48b61b){var _0xf21681=typeof _0x2505ce[_0x4837('0x22')]===_0x4837('0x23')&&typeof _0x2505ce[_0x4837('0x24')]===_0x4837('0x23');var _0x2c1ddf=_0x48b61b[_0x4837('0x25')];var _0x4b482d=_0xf21681?0x0:_0x2505ce['offset'];var _0xdb5a0d=_0xf21681?_0x48b61b[_0x4837('0x25')]:_0x2505ce[_0x4837('0x22')]+_0x2505ce[_0x4837('0x24')];var _0x5e8f16;if(_0xdb5a0d>=_0x2c1ddf){_0xdb5a0d=_0x2c1ddf;_0x5e8f16=0xc8;}else{_0x5e8f16=0xce;}_0x27460b[_0x4837('0x1f')](_0x5e8f16);return _0x27460b['set'](_0x4837('0x26'),_0x4b482d+'-'+_0xdb5a0d+'/'+_0x2c1ddf)['json'](_0x48b61b);}return null;};}function patchUpdates(_0x55d6fa){return function(_0x2b5f1f){try{jsonpatch['apply'](_0x2b5f1f,_0x55d6fa,!![]);}catch(_0x4988f5){return BPromise['reject'](_0x4988f5);}return _0x2b5f1f[_0x4837('0x27')]();};}function saveUpdates(_0x2d820a,_0x4bbfbd){return function(_0x36b841){if(_0x36b841){return _0x36b841[_0x4837('0x28')](_0x2d820a)['then'](function(_0x3fa5ad){return _0x3fa5ad;});}return null;};}function removeEntity(_0x127ab9,_0x4d4278){return function(_0x2f1f0a){if(_0x2f1f0a){return _0x2f1f0a[_0x4837('0x29')]()[_0x4837('0x2a')](function(){_0x127ab9[_0x4837('0x1f')](0xcc)[_0x4837('0x20')]();});}};}function handleEntityNotFound(_0x5c07db,_0x2a7dfd){return function(_0x153bc7){if(!_0x153bc7){_0x5c07db[_0x4837('0x2b')](0x194);}return _0x153bc7;};}function handleError(_0x314bee,_0x569d19){_0x569d19=_0x569d19||0x1f4;return function(_0x17266c){logger[_0x4837('0x2c')](_0x17266c[_0x4837('0x2d')]);if(_0x17266c['name']){delete _0x17266c[_0x4837('0x2e')];}_0x314bee[_0x4837('0x1f')](_0x569d19)[_0x4837('0x2f')](_0x17266c);};}exports[_0x4837('0x30')]=function(_0x594039,_0x18c7a7){var _0xf3e0d7={},_0x139e3c={},_0xccb861={'count':0x0,'rows':[]};var _0x569ae1=_[_0x4837('0x31')](db['UserProfile'][_0x4837('0x32')],function(_0x57a511){return{'name':_0x57a511[_0x4837('0x33')],'type':_0x57a511[_0x4837('0x34')][_0x4837('0x35')]};});_0x139e3c['model']=_['map'](_0x569ae1,_0x4837('0x2e'));_0x139e3c[_0x4837('0x36')]=_[_0x4837('0x37')](_0x594039[_0x4837('0x36')]);_0x139e3c[_0x4837('0x38')]=_['intersection'](_0x139e3c[_0x4837('0x39')],_0x139e3c[_0x4837('0x36')]);_0xf3e0d7['attributes']=_[_0x4837('0x3a')](_0x139e3c['model'],qs[_0x4837('0x3b')](_0x594039['query']['fields']));_0xf3e0d7[_0x4837('0x3c')]=_0xf3e0d7[_0x4837('0x3c')][_0x4837('0x3d')]?_0xf3e0d7['attributes']:_0x139e3c[_0x4837('0x39')];if(!_0x594039[_0x4837('0x36')]['hasOwnProperty'](_0x4837('0x3e'))){_0xf3e0d7['limit']=qs[_0x4837('0x24')](_0x594039[_0x4837('0x36')][_0x4837('0x24')]);_0xf3e0d7[_0x4837('0x22')]=qs['offset'](_0x594039[_0x4837('0x36')][_0x4837('0x22')]);}_0xf3e0d7[_0x4837('0x3f')]=qs[_0x4837('0x40')](_0x594039[_0x4837('0x36')][_0x4837('0x40')]);_0xf3e0d7['where']=qs[_0x4837('0x38')](_['pick'](_0x594039[_0x4837('0x36')],_0x139e3c[_0x4837('0x38')]),_0x569ae1);if(_0x594039['query']['filter']){_0xf3e0d7[_0x4837('0x41')]=_[_0x4837('0x42')](_0xf3e0d7[_0x4837('0x41')],{'$or':_[_0x4837('0x31')](_0x569ae1,function(_0x45cda5){if(_0x45cda5[_0x4837('0x34')]!==_0x4837('0x43')){var _0xb44dd={};_0xb44dd[_0x45cda5[_0x4837('0x2e')]]={'$like':'%'+_0x594039[_0x4837('0x36')][_0x4837('0x44')]+'%'};return _0xb44dd;}})});}_0xf3e0d7=_[_0x4837('0x42')]({},_0xf3e0d7,_0x594039[_0x4837('0x45')]);var _0x416ecc={'where':_0xf3e0d7['where']};return db['UserProfile'][_0x4837('0x25')](_0x416ecc)[_0x4837('0x2a')](function(_0x4d2b7e){_0xccb861[_0x4837('0x25')]=_0x4d2b7e;if(_0x594039['query']['includeAll']){_0xf3e0d7[_0x4837('0x46')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0xf3e0d7);})[_0x4837('0x2a')](function(_0x230f85){_0xccb861[_0x4837('0x47')]=_0x230f85;return _0xccb861;})['then'](respondWithFilteredResult(_0x18c7a7,_0xf3e0d7))[_0x4837('0x48')](handleError(_0x18c7a7,null));};exports[_0x4837('0x49')]=function(_0x545818,_0x16fc81){var _0x41e653={'raw':![],'where':{'id':_0x545818[_0x4837('0x4a')]['id']}},_0x264e60={};_0x264e60[_0x4837('0x39')]=_[_0x4837('0x37')](db[_0x4837('0x4b')][_0x4837('0x32')]);_0x264e60[_0x4837('0x36')]=_[_0x4837('0x37')](_0x545818[_0x4837('0x36')]);_0x264e60[_0x4837('0x38')]=_[_0x4837('0x3a')](_0x264e60[_0x4837('0x39')],_0x264e60[_0x4837('0x36')]);_0x41e653['attributes']=_[_0x4837('0x3a')](_0x264e60[_0x4837('0x39')],qs[_0x4837('0x3b')](_0x545818[_0x4837('0x36')]['fields']));_0x41e653[_0x4837('0x3c')]=_0x41e653[_0x4837('0x3c')]['length']?_0x41e653['attributes']:_0x264e60[_0x4837('0x39')];if(_0x545818[_0x4837('0x36')][_0x4837('0x4c')]){_0x41e653['include']=[{'all':!![]}];}_0x41e653=_[_0x4837('0x42')]({},_0x41e653,_0x545818[_0x4837('0x45')]);return db[_0x4837('0x4b')][_0x4837('0x4d')](_0x41e653)[_0x4837('0x2a')](handleEntityNotFound(_0x16fc81,null))[_0x4837('0x2a')](respondWithResult(_0x16fc81,null))[_0x4837('0x48')](handleError(_0x16fc81,null));};exports[_0x4837('0x4e')]=function(_0x38d55e,_0x5aa7cf){return db['UserProfile'][_0x4837('0x4e')](_0x38d55e['body'],{})[_0x4837('0x2a')](respondWithResult(_0x5aa7cf,0xc9))[_0x4837('0x48')](handleError(_0x5aa7cf,null));};exports[_0x4837('0x4f')]=function(_0x2ff7de,_0x32384d){var _0x20f8c7={'where':{'id':_0x2ff7de[_0x4837('0x4a')]['id']}},_0x5c68e5={};_0x5c68e5[_0x4837('0x39')]=_[_0x4837('0x37')](db[_0x4837('0x4b')]['rawAttributes']);_0x20f8c7[_0x4837('0x3c')]=_[_0x4837('0x3a')](_0x5c68e5[_0x4837('0x39')],qs[_0x4837('0x3b')](_0x2ff7de[_0x4837('0x36')][_0x4837('0x3b')]));_0x20f8c7['attributes']=_0x20f8c7[_0x4837('0x3c')][_0x4837('0x3d')]?_0x20f8c7['attributes']:_0x5c68e5[_0x4837('0x39')];if(_0x2ff7de[_0x4837('0x36')][_0x4837('0x4c')]){_0x20f8c7[_0x4837('0x46')]=[{'all':!![]}];}_0x20f8c7=_['merge']({},_0x20f8c7,_0x2ff7de[_0x4837('0x45')]);return db[_0x4837('0x4b')][_0x4837('0x4d')](_0x20f8c7)[_0x4837('0x2a')](handleEntityNotFound(_0x32384d,null))[_0x4837('0x2a')](function(_0x1466ff){if(_0x1466ff){var _0x3e1e4e=_0x1466ff['get']({'plain':!![]});_0x3e1e4e=qs[_0x4837('0x50')](_0x3e1e4e,['id',_0x4837('0x51'),_0x4837('0x52'),_0x4837('0x53')]);_0x2ff7de[_0x4837('0x54')]=_[_0x4837('0x50')](_0x2ff7de[_0x4837('0x54')],['id','createdAt',_0x4837('0x52')]);return db[_0x4837('0x55')][_0x4837('0x56')](function(_0x1ad4c3){return db[_0x4837('0x4b')][_0x4837('0x4e')](_[_0x4837('0x42')](_0x3e1e4e,_0x2ff7de[_0x4837('0x54')]),{'include':_0x2ff7de[_0x4837('0x36')][_0x4837('0x4c')]?[{'all':!![]}]:undefined,'transaction':_0x1ad4c3})[_0x4837('0x2a')](function(_0x27ab33){var _0x41784e=_0x27ab33[_0x4837('0x57')]({'plain':!![]});return db[_0x4837('0x58')][_0x4837('0x59')]({'where':{'userProfileId':_0x2ff7de['params']['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x431b6c){if(_0x431b6c){return BPromise[_0x4837('0x5a')](_0x431b6c,function(_0x569f45){return new BPromise(function(_0x1482b1,_0x39d564){if(_0x569f45['autoAssociation']===null||_0x569f45[_0x4837('0x5b')]===0x1)_0x1482b1(null);return db[_0x4837('0x5c')]['findAll']({'where':{'sectionId':_0x569f45['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x27809e){var _0x5db106=_[_0x4837('0x31')](_0x27809e,function(_0x1d0c61){return qs[_0x4837('0x50')](_0x1d0c61,['id',_0x4837('0x51'),_0x4837('0x52'),'sectionId']);});_0x1482b1(_0x5db106);})[_0x4837('0x48')](function(_0x8d1722){_0x39d564(_0x8d1722);});})[_0x4837('0x2a')](function(_0x28b8e2){var _0x1bbea9=qs[_0x4837('0x50')](_0x569f45,['id',_0x4837('0x51'),_0x4837('0x52')]);_0x1bbea9[_0x4837('0x5d')]=_0x41784e['id'];if(_0x28b8e2)_0x1bbea9[_0x4837('0x5e')]=_0x28b8e2;return _0x1bbea9;})[_0x4837('0x2a')](function(_0x19d8de){return db[_0x4837('0x58')][_0x4837('0x4e')](_0x19d8de,{'include':[{'model':db['UserProfileResource'],'as':_0x4837('0x5e')}],'raw':!![],'transaction':_0x1ad4c3});});})[_0x4837('0x2a')](function(){return _0x41784e;});}});});});}})[_0x4837('0x2a')](respondWithResult(_0x32384d,0xc9))[_0x4837('0x48')](handleError(_0x32384d,null));};exports[_0x4837('0x28')]=function(_0x5736b2,_0x33e44e){if(_0x5736b2[_0x4837('0x54')]['id']){delete _0x5736b2[_0x4837('0x54')]['id'];}return db[_0x4837('0x4b')]['find']({'where':{'id':_0x5736b2[_0x4837('0x4a')]['id']}})['then'](handleEntityNotFound(_0x33e44e,null))[_0x4837('0x2a')](saveUpdates(_0x5736b2[_0x4837('0x54')],null))[_0x4837('0x2a')](respondWithResult(_0x33e44e,null))[_0x4837('0x48')](handleError(_0x33e44e,null));};exports[_0x4837('0x29')]=function(_0x3d028e,_0x3df022){return db[_0x4837('0x4b')][_0x4837('0x4d')]({'where':{'id':_0x3d028e[_0x4837('0x4a')]['id']}})[_0x4837('0x2a')](handleEntityNotFound(_0x3df022,null))[_0x4837('0x2a')](removeEntity(_0x3df022,null))[_0x4837('0x48')](handleError(_0x3df022,null));};exports[_0x4837('0x5f')]=function(_0x243d4d,_0x2184e4){return db[_0x4837('0x4b')][_0x4837('0x5f')]()[_0x4837('0x2a')](respondWithResult(_0x2184e4,null))['catch'](handleError(_0x2184e4,null));};exports[_0x4837('0x60')]=function(_0xc1b9fd,_0x2e45ea){var _0x2f8dd4=_0xc1b9fd[_0x4837('0x54')];return db['UserProfile'][_0x4837('0x4d')]({'where':{'id':_0xc1b9fd[_0x4837('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2e45ea,null))['then'](function(_0x579167){if(_0x579167){return db[_0x4837('0x55')][_0x4837('0x56')](function(_0x58af6c){return db[_0x4837('0x58')][_0x4837('0x29')]({'where':{'userProfileId':_0xc1b9fd[_0x4837('0x4a')]['id'],'sectionId':_[_0x4837('0x31')](_0x2f8dd4,function(_0x5aa1bc){return _0x5aa1bc[_0x4837('0x61')];})},'transaction':_0x58af6c})[_0x4837('0x2a')](function(){var _0x5aa178=_['map'](_0x2f8dd4,function(_0x262175){_0x262175[_0x4837('0x5d')]=_0xc1b9fd['params']['id'];return _0x262175;});var _0xa7a1e7=[];return BPromise[_0x4837('0x5a')](_0x5aa178,function(_0xcd6099){return db[_0x4837('0x58')]['create'](_0xcd6099,{'include':[{'model':db[_0x4837('0x5c')],'as':_0x4837('0x5e')}],'raw':!![],'transaction':_0x58af6c})[_0x4837('0x2a')](function(_0x2f4ff1){_0xa7a1e7[_0x4837('0x62')](_0x2f4ff1[_0x4837('0x57')]({'plain':!![]}));});})[_0x4837('0x2a')](function(){return _0xa7a1e7;});});});}})[_0x4837('0x2a')](function(_0x2b089a){return _0x2b089a;})[_0x4837('0x2a')](respondWithResult(_0x2e45ea,null))[_0x4837('0x48')](handleError(_0x2e45ea,null));};exports[_0x4837('0x63')]=function(_0x588157,_0x27400d){var _0x2bb6a8;return db[_0x4837('0x4b')][_0x4837('0x4d')]({'where':{'id':_0x588157[_0x4837('0x4a')]['id']},'attributes':['id',_0x4837('0x2e')]})[_0x4837('0x2a')](handleEntityNotFound(_0x27400d,null))[_0x4837('0x2a')](function(_0x3d3701){if(_0x3d3701){_0x2bb6a8=_0x3d3701;return db[_0x4837('0x58')]['destroy']({'where':{'userProfileId':_0x588157[_0x4837('0x4a')]['id'],'sectionId':_0x588157[_0x4837('0x36')][_0x4837('0x64')]}});}})['then'](function(){return _0x2bb6a8;})[_0x4837('0x2a')](respondWithStatusCode(_0x27400d,null))[_0x4837('0x48')](handleError(_0x27400d,null));};exports[_0x4837('0x65')]=function(_0x115851,_0x2f0e6f){var _0x5d4778=[];var _0x11b6e8=[];return db[_0x4837('0x58')]['findAll']({'where':{'userProfileId':_0x115851['params']['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x244889){_0x5d4778=_[_0x4837('0x44')](_0x244889,function(_0x4fd436){return _0x4fd436[_0x4837('0x66')]===0x1||_[_0x4837('0x67')]([0x3eb,0x709],_0x4fd436[_0x4837('0x61')]);});if(!_['isEmpty'](_0x5d4778)){return _['map'](_0x5d4778,function(_0x501538){return _0x501538[_0x4837('0x61')];});}else{return;}})[_0x4837('0x2a')](function(_0x2e546f){if(_0x2e546f)_0x11b6e8=_0x2e546f;if(_['includes'](_0x11b6e8,0x64)){var _0x3c7fa9=_[_0x4837('0x4d')](_0x5d4778,{'sectionId':0x64});return hasDefaultDashboard(_0x3c7fa9)[_0x4837('0x2a')](function(_0x15362b){return _['map'](_0x5d4778,function(_0x105408){if(_0x105408[_0x4837('0x61')]===0x64){_0x105408[_0x4837('0x68')]=_0x15362b;}return _0x105408;});});}else{return;}})[_0x4837('0x2a')](function(_0x2c179a){if(_0x2c179a)_0x5d4778=_0x2c179a;if(_[_0x4837('0x67')](_0x11b6e8,0x3eb)){var _0x94fbd0=_[_0x4837('0x4d')](_0x5d4778,{'sectionId':0x3eb});return getCustomDashboards(_0x94fbd0)['then'](function(_0x66543b){return _[_0x4837('0x31')](_0x5d4778,function(_0x4281d5){if(_0x94fbd0[_0x4837('0x66')]){if(_0x4281d5['sectionId']===0x3eb){_0x4281d5[_0x4837('0x68')]=_0x66543b;}}else{if(_0x4281d5['sectionId']===0x64){_0x4281d5[_0x4837('0x68')]=_0x66543b;}}return _0x4281d5;});});}else{return;}})[_0x4837('0x2a')](function(_0x1f5a1c){if(_0x1f5a1c)_0x5d4778=_0x1f5a1c;if(_[_0x4837('0x67')](_0x11b6e8,0x709)){var _0x5399d5=_[_0x4837('0x4d')](_0x5d4778,{'sectionId':0x709});return getPlugins(_0x5399d5)[_0x4837('0x2a')](function(_0x26e12b){if(_0x5399d5[_0x4837('0x66')]){return _[_0x4837('0x31')](_0x5d4778,function(_0x3e5a22){if(_0x3e5a22[_0x4837('0x61')]===0x709){_0x3e5a22[_0x4837('0x68')]=_0x26e12b;}return _0x3e5a22;});}else{var _0x339001={'sectionId':0x76c,'enabled':0x1,'subsections':_0x26e12b};var _0x365d5d=_['map'](_0x5d4778);_0x365d5d['push'](_0x339001);return _0x365d5d;}});}else{return;}})['then'](function(_0x6a9f78){if(_0x6a9f78)_0x5d4778=_0x6a9f78;return _[_0x4837('0x44')](_0x5d4778,[_0x4837('0x66'),0x1]);})[_0x4837('0x2a')](respondWithResult(_0x2f0e6f,null))['catch'](handleError(_0x2f0e6f,null));};function hasDefaultDashboard(_0x59c44d){var _0xd9c2b8=[0x65];return new BPromise(function(_0x1b526e,_0x1afbc6){try{if(_0x59c44d[_0x4837('0x5b')]){_0x1b526e(_0xd9c2b8);}else{return db['UserProfileResource'][_0x4837('0x69')]({'where':{'sectionId':_0x59c44d['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x19d959){_0x19d959?_0x1b526e(_0xd9c2b8):_0x1b526e();});}}catch(_0x4b215e){_0x1afbc6(_0x4b215e);}});}function getCustomDashboards(_0x79eccb){var _0x1e1bde=[];return new BPromise(function(_0x4b1e9a,_0x33b2b7){try{if(_0x79eccb[_0x4837('0x5b')]){return db[_0x4837('0x6a')][_0x4837('0x59')]({'raw':!![]})[_0x4837('0x2a')](function(_0x2bc115){_0x2bc115['forEach'](function(_0x37b7f6){_0x1e1bde[_0x4837('0x62')](_0x37b7f6['id']+0x1869f);});_0x4b1e9a(_0x1e1bde);});}else{return db[_0x4837('0x5c')]['findAll']({'where':{'sectionId':_0x79eccb['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x43cd65){_0x43cd65[_0x4837('0x6b')](function(_0x358cba){_0x1e1bde[_0x4837('0x62')](_0x358cba[_0x4837('0x6c')]+0x1869f);});_0x4b1e9a(_0x1e1bde);});}}catch(_0x65380f){_0x33b2b7(_0x65380f);}});}function getPlugins(_0x269d31){var _0x4441d6=[];return new BPromise(function(_0x45e1d1,_0x3b1803){try{if(_0x269d31[_0x4837('0x5b')]){return db[_0x4837('0x6d')][_0x4837('0x59')]({'raw':!![]})['then'](function(_0x2b5163){_0x2b5163[_0x4837('0x6b')](function(_0xc27390){_0x4441d6[_0x4837('0x62')](_0xc27390['id']+0x15b38);});_0x45e1d1(_0x4441d6);});}else{return db[_0x4837('0x5c')][_0x4837('0x59')]({'where':{'sectionId':_0x269d31['id']},'raw':!![]})[_0x4837('0x2a')](function(_0x162341){_0x162341[_0x4837('0x6b')](function(_0x347ae0){_0x4441d6[_0x4837('0x62')](_0x347ae0[_0x4837('0x6c')]+0x15b38);});_0x45e1d1(_0x4441d6);});}}catch(_0xd56713){_0x3b1803(_0xd56713);}});}exports['addResources']=function(_0x2c25e1,_0x2725c7){return db[_0x4837('0x4b')][_0x4837('0x4d')]({'where':{'id':_0x2c25e1['params']['id']}})['then'](handleEntityNotFound(_0x2725c7,null))[_0x4837('0x2a')](function(_0x3ad43c){if(_0x3ad43c){return db[_0x4837('0x55')][_0x4837('0x56')](function(_0xc4416f){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2c25e1[_0x4837('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0xb3c48e){if(_0xb3c48e){return db[_0x4837('0x58')][_0x4837('0x29')]({'where':{'userProfileId':_0x2c25e1[_0x4837('0x4a')]['id'],'id':_[_0x4837('0x31')](_0xb3c48e,function(_0x3d0ac1){return _0x3d0ac1['id'];})},'transaction':_0xc4416f});}})[_0x4837('0x2a')](function(_0x3b5246){var _0x3c1272=_['map'](_0x2c25e1[_0x4837('0x54')],function(_0x12faaf){_0x12faaf['userProfileId']=_0x2c25e1[_0x4837('0x4a')]['id'];return _0x12faaf;});return db[_0x4837('0x58')][_0x4837('0x6e')](_0x3c1272,{'raw':!![],'transaction':_0xc4416f});})[_0x4837('0x2a')](function(_0x200ce1){var _0x17d5d5=_['filter'](_['map'](_0x200ce1,function(_0x47c60e){return _0x47c60e[_0x4837('0x57')]({'plain':!![]});}),{'includeAll':![]});if(_0x17d5d5){return db[_0x4837('0x58')][_0x4837('0x59')]({'where':{'userProfileId':_0x2c25e1['params']['id'],'sectionId':_[_0x4837('0x31')](_0x17d5d5,function(_0x2b06ed){return _0x2b06ed[_0x4837('0x61')];})},'attributes':['id',_0x4837('0x61')],'raw':!![]})[_0x4837('0x2a')](function(_0x1bc0b4){var _0x4a378b=_[_0x4837('0x31')](_0x2c25e1[_0x4837('0x54')],function(_0x49a5d0){_0x49a5d0[_0x4837('0x5d')]=_0x2c25e1['params']['id'];return _0x49a5d0;});return db['UserProfileResource']['bulkCreate'](_0x4a378b,{'raw':!![],'transaction':_0xc4416f});});}})[_0x4837('0x48')](handleError(_0x2725c7,null));});}})[_0x4837('0x2a')](function(_0x1dd2b3){var _0x24b41a=_[_0x4837('0x31')](_0x1dd2b3,function(_0x3faa98){return _0x3faa98['get']({'plain':!![]});});})[_0x4837('0x2a')](respondWithResult(_0x2725c7,null))[_0x4837('0x48')](handleError(_0x2725c7,null));};exports[_0x4837('0x6f')]=function(_0x101ca6,_0x372020,_0x4052d8){return db['UserProfile']['find']({'where':{'id':_0x101ca6[_0x4837('0x4a')]['id']}})[_0x4837('0x2a')](handleEntityNotFound(_0x372020,null))[_0x4837('0x2a')](function(_0x58ec7d){if(_0x58ec7d){return _0x58ec7d[_0x4837('0x6f')](_0x101ca6[_0x4837('0x36')][_0x4837('0x64')]);}})[_0x4837('0x2a')](respondWithStatusCode(_0x372020,null))[_0x4837('0x48')](handleError(_0x372020,null));};exports[_0x4837('0x70')]=function(_0x44df41,_0x217565){var _0x411663={};if(!_0x44df41[_0x4837('0x36')][_0x4837('0x71')])throw new Error(_0x4837('0x72'));if(!_0x44df41[_0x4837('0x36')]['hasOwnProperty'](_0x4837('0x3e'))){_0x411663[_0x4837('0x24')]=qs['limit'](_0x44df41[_0x4837('0x36')]['limit']);_0x411663[_0x4837('0x22')]=qs[_0x4837('0x22')](_0x44df41[_0x4837('0x36')][_0x4837('0x22')]);}return db[_0x4837('0x4b')]['find']({'where':{'id':_0x44df41[_0x4837('0x4a')]['id']}})[_0x4837('0x2a')](function(_0x4b5f0b){if(!_0x4b5f0b)throw new Error(_0x4837('0x73')+_0x44df41['params']['id']);return db[_0x4837('0x4b')][_0x4837('0x70')](_0x44df41);})[_0x4837('0x2a')](respondWithFilteredResult(_0x217565,_0x411663))[_0x4837('0x48')](handleError(_0x217565,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 03e7200..dc70df6 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 _0xf417=['UserProfile','setMaxListeners','update','hasOwnProperty','exports','../../mysqldb'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xf417,0x8f));var _0x7f41=function(_0x29d4ed,_0x264f8e){_0x29d4ed=_0x29d4ed-0x0;var _0x21a4a6=_0xf417[_0x29d4ed];return _0x21a4a6;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0x7f41('0x0'))['db'][_0x7f41('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7f41('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7f41('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4c7081){return function(_0x2b7d4c,_0x5170ec,_0x51b0cb){UserProfileEvents['emit'](_0x4c7081+':'+_0x2b7d4c['id'],_0x2b7d4c);UserProfileEvents['emit'](_0x4c7081,_0x2b7d4c);_0x51b0cb(null);};}for(var e in events){if(events[_0x7f41('0x4')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x7f41('0x5')]=UserProfileEvents; \ No newline at end of file +var _0x073d=['hook','exports','../../mysqldb','UserProfile','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x18b940,_0x9644de){var _0x538f1c=function(_0x4c888f){while(--_0x4c888f){_0x18b940['push'](_0x18b940['shift']());}};_0x538f1c(++_0x9644de);}(_0x073d,0xd2));var _0xd073=function(_0x2a880e,_0x44beb7){_0x2a880e=_0x2a880e-0x0;var _0x45e0ce=_0x073d[_0x2a880e];return _0x45e0ce;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xd073('0x0'))['db'][_0xd073('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd073('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd073('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ad2eb){return function(_0x423dc8,_0x494f81,_0x11bd94){UserProfileEvents[_0xd073('0x4')](_0x3ad2eb+':'+_0x423dc8['id'],_0x423dc8);UserProfileEvents[_0xd073('0x4')](_0x3ad2eb,_0x423dc8);_0x11bd94(null);};}for(var e in events){if(events[_0xd073('0x5')](e)){var event=events[e];UserProfile[_0xd073('0x6')](e,emitEvent(event));}}module[_0xd073('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 d6946ec..ec81f96 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 _0x4137=['metrics','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','define','user_profiles','query','section','mergeResources','isEmpty','length','push','UserProfileSection','params','ignore','find','all','rawAttributes','model','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','reportId','CustomReports','count','Tags','color','tag','Agents','openTabs','true','chat','rows','dataValues','sms','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','catch','then','map','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','name','role','Telephones','membername','User','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','MailQueue','mailaccounts','MailAccount','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','user','zendeskaccounts','salesforceaccounts','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','Disposition','customdashboards','Dashboard','Interval','Sound','tags','Tag','Template','triggers','Trigger','Trunk','variables','Variable','plugins','extractedreports','Reports'];(function(_0x32b312,_0x4e3f0f){var _0x313368=function(_0x29143f){while(--_0x29143f){_0x32b312['push'](_0x32b312['shift']());}};_0x313368(++_0x4e3f0f);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7413('0x0'));var attributes=require(_0x7413('0x1'));var qs=require(_0x7413('0x2'));var squel=require(_0x7413('0x3'));module[_0x7413('0x4')]=function(_0x410971){var _0x2e6df7=_0x410971[_0x7413('0x5')];function _0x258255(_0x3dc48a,_0x451a96){return new Promise(function(_0x3bb181,_0x4fbade){if(!_0x451a96)return _0x3bb181(null);var _0xc808cd=_0x451a96[_0x7413('0x6')]?{[_0x451a96[_0x7413('0x6')][_0x7413('0x7')]]:_0x451a96['filter'][_0x7413('0x8')]}:undefined;return _0x2e6df7[_0x3dc48a][_0x7413('0x9')]({'where':_0xc808cd,'raw':!![]})['then'](function(_0x422bf5){_0x451a96[_0x7413('0xa')]=_['map'](_0x422bf5,'id');_0x3bb181(_0x451a96);})[_0x7413('0xb')](function(_0x427b3b){_0x4fbade(_0x427b3b);});});}function _0x737ab4(_0x3e026b,_0x14212d){return new Promise(function(_0x5a1e62,_0xa25d72){var _0x32034c=_0x3e026b['filter']?{[_0x3e026b[_0x7413('0x6')][_0x7413('0x7')]]:_0x3e026b[_0x7413('0x6')]['value']}:undefined;return _0x2e6df7[_0x3e026b['model']]['findAll']({'where':_0x32034c,'raw':!![]})[_0x7413('0xc')](function(_0x336c4c){_0x14212d['associatedResources']=_[_0x7413('0xd')](_0x336c4c,function(_0x45bef0){return _0x45bef0['name'];});_0x5a1e62(_0x14212d);})[_0x7413('0xb')](function(_0x50f301){_0xa25d72(_0x50f301);});});}function _0x4b9a5b(_0x26501b,_0x568d1f,_0x195c72){if(!_0x568d1f)return Promise['resolve'](null);return new Promise(function(_0x2036b6,_0x3230d8){return _0x2e6df7[_0x7413('0xe')][_0x7413('0x9')]({'where':{'sectionId':_0x568d1f['id']},'raw':!![]})[_0x7413('0xc')](function(_0x26dafe){if(_0x26501b['field']&&_0x26501b[_0x7413('0x7')]!=='id'){_0x568d1f[_0x7413('0xa')]=_[_0x7413('0xd')](_0x26dafe,function(_0xfe5b8c){return _0xfe5b8c[_0x26501b['field']];});}else{if(_0x195c72===_0x7413('0xf')){_0x568d1f[_0x7413('0xa')]=_[_0x7413('0xd')](_0x26dafe,function(_0x20d3d2){return{'id':_0x20d3d2[_0x7413('0x10')],'type':_0x20d3d2[_0x7413('0x11')]};});}else{_0x568d1f[_0x7413('0xa')]=_[_0x7413('0xd')](_0x26dafe,function(_0x56a06a){return _0x56a06a['resourceId'];});}}_0x2036b6(_0x568d1f);})[_0x7413('0xb')](function(_0x599654){_0x3230d8(_0x599654);});});}function _0x1585ba(_0x372944,_0x3b0c81){var _0x2fc0f4={'parentSections':[]};switch(_0x372944[_0x7413('0x12')]()){case _0x7413('0x13'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x15');break;case _0x7413('0x16'):_0x2fc0f4['childModel']='SquareOdbc';break;case _0x7413('0x17'):_0x2fc0f4['childModel']=_0x7413('0x18');_0x2fc0f4[_0x7413('0x19')]=[{'name':_0x7413('0x1a'),'field':'name','foreignKey':_0x7413('0x1b')}];break;case _0x7413('0x1c'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x1d');break;case _0x7413('0x1e'):_0x2fc0f4[_0x7413('0x14')]='CmContact';_0x2fc0f4[_0x7413('0x19')]=[{'name':'Lists','field':'id','foreignKey':_0x7413('0x1f')}];break;case _0x7413('0x20'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x21');break;case _0x7413('0x22'):_0x2fc0f4[_0x7413('0x14')]='CmCompany';break;case _0x7413('0x23'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x24');break;case _0x7413('0x25'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x26');break;case _0x7413('0x27'):_0x2fc0f4['childModel']=_0x7413('0x28');break;case _0x7413('0x29'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x2a');break;case _0x7413('0x2b'):_0x2fc0f4['childModel']=_0x7413('0x2c');break;case'inboundroutes':case _0x7413('0x2d'):case _0x7413('0x2e'):_0x2fc0f4[_0x7413('0x14')]='VoiceExtension';break;case _0x7413('0x2f'):_0x2fc0f4['childModel']=_0x7413('0x30');break;case _0x7413('0x31'):_0x2fc0f4['childModel']='VoiceMail';break;case _0x7413('0x32'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x33');_0x2fc0f4['parentSections']=[{'name':'Agents','field':_0x7413('0x34'),'foreignKey':'membername','model':'User','filter':{'field':_0x7413('0x35'),'value':['agent']}},{'name':_0x7413('0x36'),'field':_0x7413('0x34'),'foreignKey':_0x7413('0x37'),'model':_0x7413('0x38'),'filter':{'field':_0x7413('0x35'),'value':['telephone']}},{'name':_0x7413('0x39'),'field':_0x7413('0x34'),'foreignKey':_0x7413('0x3a'),'model':_0x7413('0x3b'),'filter':{'field':_0x7413('0x11'),'value':[_0x7413('0x3c')]}},{'name':_0x7413('0x3d'),'field':_0x7413('0x34'),'foreignKey':_0x7413('0x3a'),'model':_0x7413('0x3b'),'filter':{'field':_0x7413('0x11'),'value':[_0x7413('0x3e')]}}];break;case'musiconholds':_0x2fc0f4[_0x7413('0x14')]='VoiceMusicOnHold';break;case'chanspies':_0x2fc0f4['childModel']='VoiceChanSpy';break;case'voiceprefixes':_0x2fc0f4[_0x7413('0x14')]='VoicePrefix';break;case'ivrcampaigns':_0x2fc0f4[_0x7413('0x14')]='Campaign';break;case'mailqueues':_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x3f');break;case _0x7413('0x40'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x41');break;case'mailsubstatuses':_0x2fc0f4[_0x7413('0x14')]='MailSubstatus';break;case _0x7413('0x42'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x43');break;case _0x7413('0x44'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x45');break;case _0x7413('0x46'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x47');break;case _0x7413('0x48'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x49');break;case _0x7413('0x4a'):_0x2fc0f4['childModel']=_0x7413('0x4b');break;case _0x7413('0x4c'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x4d');break;case _0x7413('0x4e'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x4f');break;case _0x7413('0x50'):case _0x7413('0x51'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x3b');if(_0x3b0c81){_0x2fc0f4['parentSections']=[{'name':_0x7413('0x39')},{'name':'QueueCampaigns'}];}break;case _0x7413('0x52'):case _0x7413('0x53'):case _0x7413('0x54'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x38');if(_0x3b0c81){_0x2fc0f4[_0x7413('0x19')]=[{'name':_0x7413('0x55'),'filter':{'field':_0x7413('0x35'),'value':[_0x7413('0x56'),_0x7413('0x57')]},'ignore':!![]},{'name':'Agents'},{'name':'Telephones'}];}break;case _0x7413('0x58'):_0x2fc0f4['childModel']='ZendeskAccount';break;case _0x7413('0x59'):_0x2fc0f4[_0x7413('0x14')]='SalesforceAccount';break;case _0x7413('0x5a'):_0x2fc0f4['childModel']='FreshdeskAccount';break;case _0x7413('0x5b'):_0x2fc0f4['childModel']=_0x7413('0x5c');break;case _0x7413('0x5d'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x5e');break;case _0x7413('0x5f'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x60');break;case _0x7413('0x61'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x38');break;case'cannedanswers':_0x2fc0f4[_0x7413('0x14')]='CannedAnswer';break;case'dispositions':_0x2fc0f4['childModel']=_0x7413('0x62');break;case _0x7413('0x63'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x64');break;case'intervals':_0x2fc0f4['childModel']=_0x7413('0x65');break;case'pauses':_0x2fc0f4[_0x7413('0x14')]='Pause';break;case'scheduler':_0x2fc0f4['childModel']='Schedule';break;case'sounds':_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x66');break;case _0x7413('0x67'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x68');break;case'templates':_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x69');break;case _0x7413('0x6a'):_0x2fc0f4['childModel']=_0x7413('0x6b');break;case'trunks':_0x2fc0f4['childModel']=_0x7413('0x6c');break;case _0x7413('0x6d'):_0x2fc0f4[_0x7413('0x14')]=_0x7413('0x6e');break;case _0x7413('0x6f'):_0x2fc0f4[_0x7413('0x14')]='Plugin';break;case _0x7413('0x70'):_0x2fc0f4['childModel']=_0x7413('0xf');_0x2fc0f4['parentSections']=[{'name':_0x7413('0x71'),'field':'id','foreignKey':'reportId'}];break;case _0x7413('0x72'):_0x2fc0f4[_0x7413('0x14')]='AnalyticMetric';break;}return _0x2fc0f4;}function _0x269976(_0x549623,_0xf01452){var _0x2a5db6=_0x549623['charAt'](0x0)[_0x7413('0x73')]()+_0x549623[_0x7413('0x74')](0x1);var _0x59d639={'type':_0x2e6df7[_0x7413('0x75')][_0x7413('0x76')]['SELECT'],'raw':!![]};return new Promise(function(_0xf4641,_0x28eaf4){var _0x34211b=squel[_0x7413('0x77')]()[_0x7413('0x7')](_0x7413('0x78')+_0x2a5db6+_0x7413('0x79'),'id')[_0x7413('0x7')]('ui.createdAt')[_0x7413('0x7a')]('user_has_'+_0x549623+_0x7413('0x7b'),'ui')[_0x7413('0x7c')](_0x7413('0x7d'),_0xf01452['id']);return _0x2e6df7[_0x7413('0x7e')]['query'](_0x34211b['toString'](),_0x59d639)['then'](function(_0x56b090){_0xf01452[_0x2a5db6+'OpenTabs']=_0x56b090;_0xf4641(_0x56b090);})[_0x7413('0xb')](function(_0x1c00e6){_0x28eaf4(_0x1c00e6);});});}return _0x410971[_0x7413('0x7f')]('UserProfile',attributes,{'tableName':_0x7413('0x80'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xb7dd83){var _0x12544d={'raw':![],'where':{}};var _0x36a3ff={};var _0xecf96b={'count':0x0,'rows':[]};var _0x3db284=_0xb7dd83[_0x7413('0x81')][_0x7413('0x82')];var _0x1ec131=_0xb7dd83[_0x7413('0x81')][_0x7413('0x83')]||![];var _0x1264f3=_0x1585ba(_0x3db284,_0x1ec131);if(!_0x1264f3[_0x7413('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x3db284+'\x27');var _0x25eafd=[{'name':_0x3db284}];if(!_[_0x7413('0x84')](_0x1264f3['parentSections']))_0x25eafd=_0x1264f3[_0x7413('0x19')];var _0x1e76f1=[];for(var _0x521682=0x0;_0x521682<_0x25eafd[_0x7413('0x85')];_0x521682++){_0x1e76f1[_0x7413('0x86')](_0x2e6df7[_0x7413('0x87')]['find']({'where':{'userProfileId':_0xb7dd83[_0x7413('0x88')]['id'],'name':_0x25eafd[_0x521682][_0x7413('0x34')]},'raw':!![]}));}return Promise['all'](_0x1e76f1)[_0x7413('0xc')](function(_0x4ffcbc){var _0x537458=_[_0x7413('0x6')](_0x4ffcbc,function(_0xbd74d9){return _0xbd74d9?_0xbd74d9:undefined;});var _0x167c6b=_[_0x7413('0x6')](_0x25eafd,[_0x7413('0x89'),!![]]);var _0x10333e=_[_0x7413('0x84')](_0x537458)&&_[_0x7413('0x84')](_0x167c6b)?null:_['union'](_0x167c6b,_0x537458);if(!_0x10333e)return null;var _0x437b5d=[];for(var _0x595da6=0x0;_0x595da6<_0x10333e[_0x7413('0x85')];_0x595da6++){var _0x3deb37=_[_0x7413('0x8a')](_0x25eafd,function(_0x3054f5){return _0x10333e[_0x595da6]?_0x3054f5[_0x7413('0x34')]===_0x10333e[_0x595da6][_0x7413('0x34')]:null;});if(_0x3deb37){if(_0x10333e[_0x595da6][_0x7413('0x89')]){_0x437b5d[_0x7413('0x86')](_0x258255(_0x1264f3[_0x7413('0x14')],_0x10333e[_0x595da6]));}else{if(!_0x10333e[_0x595da6]['autoAssociation']){_0x437b5d[_0x7413('0x86')](_0x4b9a5b(_0x3deb37,_0x10333e[_0x595da6],_0x1264f3[_0x7413('0x14')]));}else{if(_0x3deb37['model']){_0x437b5d[_0x7413('0x86')](_0x737ab4(_0x3deb37,_0x10333e[_0x595da6]));}}}}}return Promise[_0x7413('0x8b')](_0x437b5d);})['then'](function(_0x2be9b1){var _0x4b676a=_0x2be9b1;var _0xcbc6e=null;if(_0x4b676a){_0xcbc6e=_0x4b676a[_0x7413('0x85')]===0x1?_0x4b676a[0x0]:null;}if(!_0xcbc6e&&!_0x4b676a)return _0xecf96b;var _0x54f03d=_0x2e6df7[_0x1264f3['childModel']][_0x7413('0x8c')];_0x36a3ff[_0x7413('0x8d')]=_[_0x7413('0x8e')](_0x54f03d);_0x36a3ff['query']=_[_0x7413('0x8e')](_0xb7dd83[_0x7413('0x81')]);_0x36a3ff[_0x7413('0x8f')]=_[_0x7413('0x90')](_0x36a3ff[_0x7413('0x8d')],_0x36a3ff[_0x7413('0x81')]);_0x12544d['attributes']=_[_0x7413('0x90')](_0x36a3ff[_0x7413('0x8d')],qs[_0x7413('0x91')](_0xb7dd83['query'][_0x7413('0x91')]));_0x12544d[_0x7413('0x92')]=_0x12544d[_0x7413('0x92')][_0x7413('0x85')]?_0x12544d[_0x7413('0x92')]:_0x36a3ff[_0x7413('0x8d')];if(!_0xb7dd83[_0x7413('0x81')][_0x7413('0x93')](_0x7413('0x94'))){_0x12544d['limit']=qs[_0x7413('0x95')](_0xb7dd83[_0x7413('0x81')][_0x7413('0x95')]);_0x12544d[_0x7413('0x96')]=qs[_0x7413('0x96')](_0xb7dd83[_0x7413('0x81')]['offset']);}_0x12544d[_0x7413('0x97')]=qs['sort'](_0xb7dd83['query'][_0x7413('0x98')]);_0x12544d[_0x7413('0x7c')]=qs['filters'](_[_0x7413('0x99')](_0xb7dd83[_0x7413('0x81')],_0x36a3ff[_0x7413('0x8f')]));if(_0xb7dd83[_0x7413('0x81')][_0x7413('0x6')]){_0x12544d[_0x7413('0x7c')]=_[_0x7413('0x9a')](_0x12544d[_0x7413('0x7c')],{'$or':_['map'](_0x54f03d,function(_0xe4b4a4){if(_0xe4b4a4['type'][_0x7413('0x9b')]!==_0x7413('0x9c')){var _0x516030={};_0x516030[_0xe4b4a4[_0x7413('0x7')]]={'$like':'%'+_0xb7dd83[_0x7413('0x81')][_0x7413('0x6')]+'%'};return _0x516030;}})});}var _0x300a17=[];var _0xdf132c=null;var _0x3920b5={};if(_0xcbc6e){_0xdf132c=_[_0x7413('0x8a')](_0x25eafd,[_0x7413('0x34'),_0xcbc6e[_0x7413('0x34')]]);if(_0xdf132c[_0x7413('0x7')]){_0x3920b5={};if(_0x1264f3['childModel']===_0x7413('0xf')){_0x3920b5[_0xdf132c[_0x7413('0x9d')]]=_['map'](_0xcbc6e['associatedResources'],'id');}else{_0x3920b5[_0xdf132c['foreignKey']]=_0xcbc6e[_0x7413('0xa')];}_0x300a17['push'](_0x3920b5);}else{_0x12544d[_0x7413('0x7c')]['id']=_0xcbc6e[_0x7413('0xa')];}}else{for(var _0x121b1a=0x0;_0x121b1a<_0x4b676a[_0x7413('0x85')];_0x121b1a++){_0xdf132c=_[_0x7413('0x8a')](_0x25eafd,[_0x7413('0x34'),_0x4b676a[_0x121b1a][_0x7413('0x34')]]);if(_0xdf132c[_0x7413('0x7')]){_0x3920b5={};_0x3920b5[_0xdf132c[_0x7413('0x9d')]]=_0x4b676a[_0x121b1a]['associatedResources'];_0x300a17[_0x7413('0x86')](_0x3920b5);}else{if(!_0x12544d[_0x7413('0x7c')]['id'])_0x12544d[_0x7413('0x7c')]['id']=[];_0x4b676a[_0x121b1a]['associatedResources'][_0x7413('0x9e')](function(_0x3c3676){_0x12544d[_0x7413('0x7c')]['id'][_0x7413('0x86')](_0x3c3676);});}}}if(!_[_0x7413('0x84')](_0x300a17)){_0x12544d[_0x7413('0x7c')]=_[_0x7413('0x9a')](_0x12544d[_0x7413('0x7c')],{'$and':{'$or':_0x300a17}});}_0x12544d=_[_0x7413('0x9a')]({},_0x12544d,_0xb7dd83[_0x7413('0x9f')]);if(_0xcbc6e&&!_0xcbc6e['autoAssociation']&&_0x1264f3[_0x7413('0x14')]===_0x7413('0xf')){if(_0xb7dd83['query'][_0x7413('0xa0')]){_0x12544d[_0x7413('0xa1')]=[{'all':!![]}];}return _0x2e6df7[_0x1264f3['childModel']][_0x7413('0x9')](_0x12544d)[_0x7413('0xc')](function(_0x230191){var _0x47fbf0=[];_0x230191[_0x7413('0x9e')](function(_0x5a44bd){var _0x466ec8;switch(_0x5a44bd[_0x7413('0xa2')]){case _0x7413('0xa3'):_0x466ec8=_[_0x7413('0x8a')](_0xcbc6e[_0x7413('0xa')],function(_0x371464){return _0x371464['id']===_0x5a44bd['reportId']&&_0x371464[_0x7413('0x11')]===_0x7413('0xa4');});break;case _0x7413('0xa5'):_0x466ec8=_[_0x7413('0x8a')](_0xcbc6e[_0x7413('0xa')],function(_0x55059e){return _0x55059e['id']===_0x5a44bd[_0x7413('0xa6')]&&_0x55059e[_0x7413('0x11')]===_0x7413('0xa7');});break;}if(_0x466ec8)_0x47fbf0[_0x7413('0x86')](_0x5a44bd);});_0xecf96b[_0x7413('0xa8')]=_0x47fbf0['length'];_0xecf96b['rows']=_0x47fbf0;return _0xecf96b;});}else{return _0x2e6df7[_0x1264f3[_0x7413('0x14')]][_0x7413('0xa8')]({'where':_0x12544d[_0x7413('0x7c')]})[_0x7413('0xc')](function(_0x4ec202){_0xecf96b['count']=_0x4ec202;if(_0xb7dd83[_0x7413('0x81')][_0x7413('0xa0')]){if(_0x1264f3[_0x7413('0x14')]==='CmContact'){_0x12544d['include']=[{'model':_0x2e6df7[_0x7413('0x68')],'as':_0x7413('0xa9'),'attributes':['id',_0x7413('0x34'),_0x7413('0xaa')],'required':_0xb7dd83[_0x7413('0x81')][_0x7413('0xab')]?!![]:![]},{'model':_0x2e6df7[_0x7413('0x68')],'as':'ThroughTags','attributes':['id','name',_0x7413('0xaa')],'through':_0xb7dd83[_0x7413('0x81')]['tag']?{'attributes':[],'where':{'TagId':_0xb7dd83[_0x7413('0x81')][_0x7413('0xab')]||undefined}}:{},'required':_0xb7dd83[_0x7413('0x81')][_0x7413('0xab')]?!![]:![]}];}else{_0x12544d[_0x7413('0xa1')]=[{'all':!![]}];}}return _0x2e6df7[_0x1264f3[_0x7413('0x14')]][_0x7413('0x9')](_0x12544d);})[_0x7413('0xc')](function(_0x3cffbb){_0xecf96b['rows']=_0x3cffbb;if(_0x3db284===_0x7413('0xac')&&_0xb7dd83[_0x7413('0x81')][_0x7413('0xad')]===_0x7413('0xae')){var _0xccd480=[];for(var _0x20ffaf=0x0;_0x20ffaf<_0xecf96b['rows']['length'];_0x20ffaf++){_0xccd480['push'](_0x269976(_0x7413('0xaf'),_0xecf96b[_0x7413('0xb0')][_0x20ffaf][_0x7413('0xb1')]));_0xccd480[_0x7413('0x86')](_0x269976(_0x7413('0xb2'),_0xecf96b[_0x7413('0xb0')][_0x20ffaf][_0x7413('0xb1')]));_0xccd480[_0x7413('0x86')](_0x269976('fax',_0xecf96b[_0x7413('0xb0')][_0x20ffaf]['dataValues']));_0xccd480[_0x7413('0x86')](_0x269976(_0x7413('0xb3'),_0xecf96b[_0x7413('0xb0')][_0x20ffaf][_0x7413('0xb1')]));_0xccd480[_0x7413('0x86')](_0x269976('openchannel',_0xecf96b[_0x7413('0xb0')][_0x20ffaf][_0x7413('0xb1')]));_0xccd480[_0x7413('0x86')](_0x269976(_0x7413('0xb4'),_0xecf96b[_0x7413('0xb0')][_0x20ffaf][_0x7413('0xb1')]));}return Promise[_0x7413('0x8b')](_0xccd480)[_0x7413('0xc')](function(){return _0xecf96b;});}return _0xecf96b;});}});}}});}; \ No newline at end of file +var _0xdf55=['VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','teams','Team','voicequeues','users','telephones','admin','user','ZendeskAccount','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','dispositions','Disposition','customdashboards','intervals','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','isEmpty','length','push','find','params','all','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','key','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','default','DefaultReports','CustomReports','count','rows','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','findAll','then','catch','value','model','associatedResources','name','UserProfileResource','map','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings'];(function(_0x1106bf,_0x30713c){var _0x4fb6f5=function(_0x1e990e){while(--_0x1e990e){_0x1106bf['push'](_0x1106bf['shift']());}};_0x4fb6f5(++_0x30713c);}(_0xdf55,0x83));var _0x5df5=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xdf55[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x5df5('0x0'));var attributes=require(_0x5df5('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x5df5('0x2'));module[_0x5df5('0x3')]=function(_0x538c78){var _0x3f503b=_0x538c78[_0x5df5('0x4')];function _0x381a4c(_0x521007,_0x289af4){return new Promise(function(_0x417341,_0x27ec86){if(!_0x289af4)return _0x417341(null);var _0x476e21=_0x289af4[_0x5df5('0x5')]?{[_0x289af4[_0x5df5('0x5')][_0x5df5('0x6')]]:_0x289af4[_0x5df5('0x5')]['value']}:undefined;return _0x3f503b[_0x521007][_0x5df5('0x7')]({'where':_0x476e21,'raw':!![]})[_0x5df5('0x8')](function(_0x41941e){_0x289af4['associatedResources']=_['map'](_0x41941e,'id');_0x417341(_0x289af4);})[_0x5df5('0x9')](function(_0x4e80bd){_0x27ec86(_0x4e80bd);});});}function _0x45ad13(_0x3cd0c0,_0x491350){return new Promise(function(_0x59d273,_0x40322d){var _0xba664a=_0x3cd0c0[_0x5df5('0x5')]?{[_0x3cd0c0[_0x5df5('0x5')][_0x5df5('0x6')]]:_0x3cd0c0[_0x5df5('0x5')][_0x5df5('0xa')]}:undefined;return _0x3f503b[_0x3cd0c0[_0x5df5('0xb')]][_0x5df5('0x7')]({'where':_0xba664a,'raw':!![]})[_0x5df5('0x8')](function(_0x555d3f){_0x491350[_0x5df5('0xc')]=_['map'](_0x555d3f,function(_0x13eb03){return _0x13eb03[_0x5df5('0xd')];});_0x59d273(_0x491350);})[_0x5df5('0x9')](function(_0x3657c8){_0x40322d(_0x3657c8);});});}function _0x282d53(_0x4e74c4,_0x27b3fb,_0x457205){if(!_0x27b3fb)return Promise['resolve'](null);return new Promise(function(_0x9a52c9,_0x45813f){return _0x3f503b[_0x5df5('0xe')][_0x5df5('0x7')]({'where':{'sectionId':_0x27b3fb['id']},'raw':!![]})[_0x5df5('0x8')](function(_0x4b499d){if(_0x4e74c4['field']&&_0x4e74c4[_0x5df5('0x6')]!=='id'){_0x27b3fb['associatedResources']=_[_0x5df5('0xf')](_0x4b499d,function(_0x40a8f5){return _0x40a8f5[_0x4e74c4[_0x5df5('0x6')]];});}else{if(_0x457205===_0x5df5('0x10')){_0x27b3fb[_0x5df5('0xc')]=_['map'](_0x4b499d,function(_0x1d6474){return{'id':_0x1d6474[_0x5df5('0x11')],'type':_0x1d6474[_0x5df5('0x12')]};});}else{_0x27b3fb[_0x5df5('0xc')]=_[_0x5df5('0xf')](_0x4b499d,function(_0x382999){return _0x382999['resourceId'];});}}_0x9a52c9(_0x27b3fb);})[_0x5df5('0x9')](function(_0x2e862d){_0x45813f(_0x2e862d);});});}function _0x8742a7(_0x446bba,_0x5ca542){var _0x4358ba={'parentSections':[]};switch(_0x446bba[_0x5df5('0x13')]()){case _0x5df5('0x14'):_0x4358ba['childModel']='SquareProject';break;case'odbc':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x16');break;case _0x5df5('0x17'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x18');_0x4358ba[_0x5df5('0x19')]=[{'name':_0x5df5('0x1a'),'field':_0x5df5('0xd'),'foreignKey':'projectName'}];break;case _0x5df5('0x1b'):_0x4358ba['childModel']=_0x5df5('0x1c');break;case _0x5df5('0x1d'):_0x4358ba['childModel']=_0x5df5('0x1e');_0x4358ba['parentSections']=[{'name':_0x5df5('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0x5df5('0x20'):_0x4358ba['childModel']=_0x5df5('0x21');break;case'companies':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x22');break;case _0x5df5('0x23'):_0x4358ba['childModel']=_0x5df5('0x24');break;case _0x5df5('0x25'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x26');break;case _0x5df5('0x27'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x28');break;case'faxqueues':_0x4358ba['childModel']=_0x5df5('0x29');break;case _0x5df5('0x2a'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x2b');break;case _0x5df5('0x2c'):case _0x5df5('0x2d'):case'outboundroutes':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x2e');break;case _0x5df5('0x2f'):_0x4358ba[_0x5df5('0x15')]='VoiceContext';break;case _0x5df5('0x30'):_0x4358ba['childModel']=_0x5df5('0x31');break;case _0x5df5('0x32'):_0x4358ba['childModel']=_0x5df5('0x33');_0x4358ba['parentSections']=[{'name':_0x5df5('0x34'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x35'),'model':_0x5df5('0x36'),'filter':{'field':'role','value':[_0x5df5('0x37')]}},{'name':_0x5df5('0x38'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x35'),'model':'User','filter':{'field':_0x5df5('0x39'),'value':[_0x5df5('0x3a')]}},{'name':_0x5df5('0x3b'),'field':_0x5df5('0xd'),'foreignKey':_0x5df5('0x3c'),'model':_0x5df5('0x3d'),'filter':{'field':_0x5df5('0x12'),'value':['inbound']}},{'name':_0x5df5('0x3e'),'field':_0x5df5('0xd'),'foreignKey':'queue','model':_0x5df5('0x3d'),'filter':{'field':_0x5df5('0x12'),'value':['outbound']}}];break;case _0x5df5('0x3f'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x40');break;case _0x5df5('0x41'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x42');break;case _0x5df5('0x43'):_0x4358ba[_0x5df5('0x15')]='VoicePrefix';break;case'ivrcampaigns':_0x4358ba[_0x5df5('0x15')]='Campaign';break;case _0x5df5('0x44'):_0x4358ba[_0x5df5('0x15')]='MailQueue';break;case _0x5df5('0x45'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x46');break;case _0x5df5('0x47'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x48');break;case _0x5df5('0x49'):_0x4358ba[_0x5df5('0x15')]='OpenchannelQueue';break;case _0x5df5('0x4a'):_0x4358ba['childModel']=_0x5df5('0x4b');break;case _0x5df5('0x4c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x4d');break;case _0x5df5('0x4e'):_0x4358ba['childModel']=_0x5df5('0x4f');break;case _0x5df5('0x50'):_0x4358ba[_0x5df5('0x15')]='WhatsappQueue';break;case _0x5df5('0x51'):_0x4358ba[_0x5df5('0x15')]='WhatsappAccount';break;case _0x5df5('0x52'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x53');break;case _0x5df5('0x54'):case'queuecampaigns':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x3d');if(_0x5ca542){_0x4358ba['parentSections']=[{'name':_0x5df5('0x3b')},{'name':_0x5df5('0x3e')}];}break;case _0x5df5('0x55'):case'agents':case _0x5df5('0x56'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x36');if(_0x5ca542){_0x4358ba[_0x5df5('0x19')]=[{'name':'Users','filter':{'field':_0x5df5('0x39'),'value':[_0x5df5('0x57'),_0x5df5('0x58')]},'ignore':!![]},{'name':_0x5df5('0x34')},{'name':_0x5df5('0x38')}];}break;case'zendeskaccounts':_0x4358ba['childModel']=_0x5df5('0x59');break;case'salesforceaccounts':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5a');break;case _0x5df5('0x5b'):_0x4358ba[_0x5df5('0x15')]='FreshdeskAccount';break;case _0x5df5('0x5c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5d');break;case _0x5df5('0x5e'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x5f');break;case'zohoaccounts':_0x4358ba[_0x5df5('0x15')]='ZohoAccount';break;case _0x5df5('0x60'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x36');break;case'cannedanswers':_0x4358ba[_0x5df5('0x15')]='CannedAnswer';break;case _0x5df5('0x61'):_0x4358ba['childModel']=_0x5df5('0x62');break;case _0x5df5('0x63'):_0x4358ba[_0x5df5('0x15')]='Dashboard';break;case _0x5df5('0x64'):_0x4358ba[_0x5df5('0x15')]='Interval';break;case _0x5df5('0x65'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x66');break;case _0x5df5('0x67'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x68');break;case _0x5df5('0x69'):_0x4358ba['childModel']=_0x5df5('0x6a');break;case'tags':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6b');break;case _0x5df5('0x6c'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6d');break;case _0x5df5('0x6e'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x6f');break;case'trunks':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x70');break;case _0x5df5('0x71'):_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x72');break;case'plugins':_0x4358ba[_0x5df5('0x15')]='Plugin';break;case'extractedreports':_0x4358ba[_0x5df5('0x15')]=_0x5df5('0x10');_0x4358ba[_0x5df5('0x19')]=[{'name':_0x5df5('0x73'),'field':'id','foreignKey':_0x5df5('0x74')}];break;case _0x5df5('0x75'):_0x4358ba['childModel']=_0x5df5('0x76');break;}return _0x4358ba;}function _0xac9e68(_0x533996,_0x5b3375){var _0x7fdce7=_0x533996[_0x5df5('0x77')](0x0)[_0x5df5('0x78')]()+_0x533996[_0x5df5('0x79')](0x1);var _0x8cc729={'type':_0x3f503b[_0x5df5('0x7a')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x5b9dd8,_0x2236bd){var _0x43fccb=squel['select']()[_0x5df5('0x6')](_0x5df5('0x7b')+_0x7fdce7+_0x5df5('0x7c'),'id')[_0x5df5('0x6')](_0x5df5('0x7d'))[_0x5df5('0x7e')](_0x5df5('0x7f')+_0x533996+_0x5df5('0x80'),'ui')[_0x5df5('0x81')]('ui.UserId\x20=\x20?',_0x5b3375['id']);return _0x3f503b[_0x5df5('0x82')][_0x5df5('0x83')](_0x43fccb[_0x5df5('0x84')](),_0x8cc729)[_0x5df5('0x8')](function(_0x2fc9b4){_0x5b3375[_0x7fdce7+_0x5df5('0x85')]=_0x2fc9b4;_0x5b9dd8(_0x2fc9b4);})[_0x5df5('0x9')](function(_0x457fb4){_0x2236bd(_0x457fb4);});});}return _0x538c78[_0x5df5('0x86')](_0x5df5('0x87'),attributes,{'tableName':_0x5df5('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b0289){var _0x4e782b={'raw':![],'where':{}};var _0x209780={};var _0x260980={'count':0x0,'rows':[]};var _0x5b6a79=_0x3b0289[_0x5df5('0x83')][_0x5df5('0x89')];var _0xbcea82=_0x3b0289[_0x5df5('0x83')]['mergeResources']||![];var _0x1ea684=_0x8742a7(_0x5b6a79,_0xbcea82);if(!_0x1ea684[_0x5df5('0x15')])throw new Error('Invalid\x20section\x20\x27'+_0x5b6a79+'\x27');var _0x54e677=[{'name':_0x5b6a79}];if(!_[_0x5df5('0x8a')](_0x1ea684[_0x5df5('0x19')]))_0x54e677=_0x1ea684[_0x5df5('0x19')];var _0x542ed5=[];for(var _0x4edb86=0x0;_0x4edb86<_0x54e677[_0x5df5('0x8b')];_0x4edb86++){_0x542ed5[_0x5df5('0x8c')](_0x3f503b['UserProfileSection'][_0x5df5('0x8d')]({'where':{'userProfileId':_0x3b0289[_0x5df5('0x8e')]['id'],'name':_0x54e677[_0x4edb86][_0x5df5('0xd')]},'raw':!![]}));}return Promise[_0x5df5('0x8f')](_0x542ed5)[_0x5df5('0x8')](function(_0x52b7ec){var _0x9674a7=_[_0x5df5('0x5')](_0x52b7ec,function(_0x1daf21){return _0x1daf21?_0x1daf21:undefined;});var _0x2398b3=_['filter'](_0x54e677,[_0x5df5('0x90'),!![]]);var _0x577955=_[_0x5df5('0x8a')](_0x9674a7)&&_[_0x5df5('0x8a')](_0x2398b3)?null:_['union'](_0x2398b3,_0x9674a7);if(!_0x577955)return null;var _0x1dc6b1=[];for(var _0x5ed4a6=0x0;_0x5ed4a6<_0x577955[_0x5df5('0x8b')];_0x5ed4a6++){var _0x4fff11=_[_0x5df5('0x8d')](_0x54e677,function(_0x3b8aaf){return _0x577955[_0x5ed4a6]?_0x3b8aaf[_0x5df5('0xd')]===_0x577955[_0x5ed4a6][_0x5df5('0xd')]:null;});if(_0x4fff11){if(_0x577955[_0x5ed4a6][_0x5df5('0x90')]){_0x1dc6b1[_0x5df5('0x8c')](_0x381a4c(_0x1ea684['childModel'],_0x577955[_0x5ed4a6]));}else{if(!_0x577955[_0x5ed4a6][_0x5df5('0x91')]){_0x1dc6b1[_0x5df5('0x8c')](_0x282d53(_0x4fff11,_0x577955[_0x5ed4a6],_0x1ea684[_0x5df5('0x15')]));}else{if(_0x4fff11['model']){_0x1dc6b1[_0x5df5('0x8c')](_0x45ad13(_0x4fff11,_0x577955[_0x5ed4a6]));}}}}}return Promise[_0x5df5('0x8f')](_0x1dc6b1);})[_0x5df5('0x8')](function(_0x1e2a3b){var _0x382f60=_0x1e2a3b;var _0x6e375f=null;if(_0x382f60){_0x6e375f=_0x382f60['length']===0x1?_0x382f60[0x0]:null;}if(!_0x6e375f&&!_0x382f60)return _0x260980;var _0x482ac5=_0x3f503b[_0x1ea684[_0x5df5('0x15')]][_0x5df5('0x92')];_0x209780[_0x5df5('0xb')]=_[_0x5df5('0x93')](_0x482ac5);_0x209780[_0x5df5('0x83')]=_['keys'](_0x3b0289[_0x5df5('0x83')]);_0x209780[_0x5df5('0x94')]=_[_0x5df5('0x95')](_0x209780['model'],_0x209780[_0x5df5('0x83')]);_0x4e782b[_0x5df5('0x96')]=_[_0x5df5('0x95')](_0x209780[_0x5df5('0xb')],qs[_0x5df5('0x97')](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x97')]));_0x4e782b[_0x5df5('0x96')]=_0x4e782b[_0x5df5('0x96')]['length']?_0x4e782b[_0x5df5('0x96')]:_0x209780[_0x5df5('0xb')];if(!_0x3b0289[_0x5df5('0x83')]['hasOwnProperty'](_0x5df5('0x98'))){_0x4e782b[_0x5df5('0x99')]=qs['limit'](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x99')]);_0x4e782b[_0x5df5('0x9a')]=qs['offset'](_0x3b0289[_0x5df5('0x83')]['offset']);}_0x4e782b[_0x5df5('0x9b')]=qs[_0x5df5('0x9c')](_0x3b0289[_0x5df5('0x83')][_0x5df5('0x9c')]);_0x4e782b[_0x5df5('0x81')]=qs[_0x5df5('0x94')](_['pick'](_0x3b0289[_0x5df5('0x83')],_0x209780[_0x5df5('0x94')]));if(_0x3b0289['query'][_0x5df5('0x5')]){_0x4e782b['where']=_['merge'](_0x4e782b[_0x5df5('0x81')],{'$or':_['map'](_0x482ac5,function(_0x22dfa8){if(_0x22dfa8[_0x5df5('0x12')][_0x5df5('0x9d')]!==_0x5df5('0x9e')){var _0x453238={};_0x453238[_0x22dfa8[_0x5df5('0x6')]]={'$like':'%'+_0x3b0289['query'][_0x5df5('0x5')]+'%'};return _0x453238;}})});}var _0x36d635=[];var _0x68cbcc=null;var _0x58afa3={};if(_0x6e375f){_0x68cbcc=_[_0x5df5('0x8d')](_0x54e677,[_0x5df5('0xd'),_0x6e375f['name']]);if(_0x68cbcc[_0x5df5('0x6')]){_0x58afa3={};if(_0x1ea684[_0x5df5('0x15')]===_0x5df5('0x10')){_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_[_0x5df5('0xf')](_0x6e375f['associatedResources'],'id');}else{_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_0x6e375f['associatedResources'];}_0x36d635[_0x5df5('0x8c')](_0x58afa3);}else{_0x4e782b['where']['id']=_0x6e375f[_0x5df5('0xc')];}}else{for(var _0x168289=0x0;_0x168289<_0x382f60[_0x5df5('0x8b')];_0x168289++){_0x68cbcc=_[_0x5df5('0x8d')](_0x54e677,[_0x5df5('0xd'),_0x382f60[_0x168289]['name']]);if(_0x68cbcc['field']){_0x58afa3={};_0x58afa3[_0x68cbcc[_0x5df5('0x9f')]]=_0x382f60[_0x168289][_0x5df5('0xc')];_0x36d635[_0x5df5('0x8c')](_0x58afa3);}else{if(!_0x4e782b[_0x5df5('0x81')]['id'])_0x4e782b[_0x5df5('0x81')]['id']=[];_0x382f60[_0x168289]['associatedResources'][_0x5df5('0xa0')](function(_0xdceef4){_0x4e782b[_0x5df5('0x81')]['id'][_0x5df5('0x8c')](_0xdceef4);});}}}if(!_[_0x5df5('0x8a')](_0x36d635)){_0x4e782b[_0x5df5('0x81')]=_[_0x5df5('0xa1')](_0x4e782b[_0x5df5('0x81')],{'$and':{'$or':_0x36d635}});}_0x4e782b=_[_0x5df5('0xa1')]({},_0x4e782b,_0x3b0289[_0x5df5('0xa2')]);if(_0x6e375f&&!_0x6e375f[_0x5df5('0x91')]&&_0x1ea684['childModel']==='AnalyticExtractedReport'){if(_0x3b0289['query'][_0x5df5('0xa3')]){_0x4e782b[_0x5df5('0xa4')]=[{'all':!![]}];}return _0x3f503b[_0x1ea684['childModel']][_0x5df5('0x7')](_0x4e782b)[_0x5df5('0x8')](function(_0x1e1d34){var _0xc91201=[];_0x1e1d34[_0x5df5('0xa0')](function(_0x26bbe0){var _0x36d8ee;switch(_0x26bbe0['reportType']){case _0x5df5('0xa5'):_0x36d8ee=_[_0x5df5('0x8d')](_0x6e375f[_0x5df5('0xc')],function(_0x1fc3c4){return _0x1fc3c4['id']===_0x26bbe0[_0x5df5('0x74')]&&_0x1fc3c4[_0x5df5('0x12')]===_0x5df5('0xa6');});break;case'custom':_0x36d8ee=_[_0x5df5('0x8d')](_0x6e375f[_0x5df5('0xc')],function(_0x2ed5b9){return _0x2ed5b9['id']===_0x26bbe0[_0x5df5('0x74')]&&_0x2ed5b9[_0x5df5('0x12')]===_0x5df5('0xa7');});break;}if(_0x36d8ee)_0xc91201[_0x5df5('0x8c')](_0x26bbe0);});_0x260980[_0x5df5('0xa8')]=_0xc91201['length'];_0x260980[_0x5df5('0xa9')]=_0xc91201;return _0x260980;});}else{return _0x3f503b[_0x1ea684[_0x5df5('0x15')]]['count']({'where':_0x4e782b[_0x5df5('0x81')]})[_0x5df5('0x8')](function(_0x25a2e9){_0x260980[_0x5df5('0xa8')]=_0x25a2e9;if(_0x3b0289[_0x5df5('0x83')]['includeAll']){if(_0x1ea684[_0x5df5('0x15')]===_0x5df5('0x1e')){_0x4e782b[_0x5df5('0xa4')]=[{'model':_0x3f503b['Tag'],'as':'Tags','attributes':['id',_0x5df5('0xd'),_0x5df5('0xaa')],'required':_0x3b0289[_0x5df5('0x83')][_0x5df5('0xab')]?!![]:![]},{'model':_0x3f503b[_0x5df5('0x6b')],'as':_0x5df5('0xac'),'attributes':['id','name','color'],'through':_0x3b0289['query'][_0x5df5('0xab')]?{'attributes':[],'where':{'TagId':_0x3b0289[_0x5df5('0x83')][_0x5df5('0xab')]||undefined}}:{},'required':_0x3b0289['query'][_0x5df5('0xab')]?!![]:![]}];}else{_0x4e782b['include']=[{'all':!![]}];}}return _0x3f503b[_0x1ea684[_0x5df5('0x15')]][_0x5df5('0x7')](_0x4e782b);})['then'](function(_0x18281b){_0x260980[_0x5df5('0xa9')]=_0x18281b;if(_0x5b6a79==='Agents'&&_0x3b0289[_0x5df5('0x83')][_0x5df5('0xad')]===_0x5df5('0xae')){var _0x9fffdb=[];for(var _0x5372c8=0x0;_0x5372c8<_0x260980['rows'][_0x5df5('0x8b')];_0x5372c8++){_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xaf'),_0x260980['rows'][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb1'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb['push'](_0xac9e68(_0x5df5('0xb2'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb3'),_0x260980[_0x5df5('0xa9')][_0x5372c8][_0x5df5('0xb0')]));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb4'),_0x260980[_0x5df5('0xa9')][_0x5372c8]['dataValues']));_0x9fffdb[_0x5df5('0x8c')](_0xac9e68(_0x5df5('0xb5'),_0x260980['rows'][_0x5372c8][_0x5df5('0xb0')]));}return Promise[_0x5df5('0x8f')](_0x9fffdb)['then'](function(){return _0x260980;});}return _0x260980;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index cb41272..29df077 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 _0x6c65=['debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','UserProfile,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info'];(function(_0x314e22,_0x891517){var _0x4ac0f5=function(_0x43aa65){while(--_0x43aa65){_0x314e22['push'](_0x314e22['shift']());}};_0x4ac0f5(++_0x891517);}(_0x6c65,0x78));var _0x56c6=function(_0x487238,_0x34ce1b){_0x487238=_0x487238-0x0;var _0x5f51b5=_0x6c65[_0x487238];return _0x5f51b5;};'use strict';var _=require(_0x56c6('0x0'));var util=require(_0x56c6('0x1'));var moment=require(_0x56c6('0x2'));var BPromise=require(_0x56c6('0x3'));var rs=require(_0x56c6('0x4'));var fs=require('fs');var Redis=require(_0x56c6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x56c6('0x6'));var logger=require(_0x56c6('0x7'))(_0x56c6('0x8'));var config=require(_0x56c6('0x9'));var jayson=require(_0x56c6('0xa'));var client=jayson['client'][_0x56c6('0xb')]({'port':0x232a});config[_0x56c6('0xc')]=_[_0x56c6('0xd')](config[_0x56c6('0xc')],{'host':_0x56c6('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x56c6('0xc')]));require(_0x56c6('0xf'))[_0x56c6('0x10')](socket);function respondWithRpcPromise(_0x48354f,_0x3786de,_0x30a2f2){return new BPromise(function(_0x34a0e9,_0x229ca9){return client[_0x56c6('0x11')](_0x48354f,_0x30a2f2)[_0x56c6('0x12')](function(_0x5dce6b){logger[_0x56c6('0x13')]('UserProfile,\x20%s,\x20%s',_0x3786de,'request\x20sent');logger[_0x56c6('0x14')](_0x56c6('0x15'),_0x3786de,_0x56c6('0x16'),JSON[_0x56c6('0x17')](_0x5dce6b));if(_0x5dce6b['error']){if(_0x5dce6b[_0x56c6('0x18')]['code']===0x1f4){logger[_0x56c6('0x18')]('UserProfile,\x20%s,\x20%s',_0x3786de,_0x5dce6b[_0x56c6('0x18')]['message']);return _0x229ca9(_0x5dce6b['error'][_0x56c6('0x19')]);}logger['error'](_0x56c6('0x1a'),_0x3786de,_0x5dce6b['error'][_0x56c6('0x19')]);return _0x34a0e9(_0x5dce6b['error'][_0x56c6('0x19')]);}else{logger['info'](_0x56c6('0x1a'),_0x3786de,'request\x20sent');_0x34a0e9(_0x5dce6b[_0x56c6('0x1b')][_0x56c6('0x19')]);}})['catch'](function(_0x219dca){logger[_0x56c6('0x18')](_0x56c6('0x1a'),_0x3786de,_0x219dca);_0x229ca9(_0x219dca);});});} \ No newline at end of file +var _0x7374=['../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x532ff1,_0x49ae13){var _0x5579a3=function(_0x2319b1){while(--_0x2319b1){_0x532ff1['push'](_0x532ff1['shift']());}};_0x5579a3(++_0x49ae13);}(_0x7374,0x1b9));var _0x4737=function(_0x5e517d,_0x23201a){_0x5e517d=_0x5e517d-0x0;var _0x55f5da=_0x7374[_0x5e517d];return _0x55f5da;};'use strict';var _=require(_0x4737('0x0'));var util=require(_0x4737('0x1'));var moment=require(_0x4737('0x2'));var BPromise=require(_0x4737('0x3'));var rs=require(_0x4737('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4737('0x5'))['db'];var utils=require(_0x4737('0x6'));var logger=require(_0x4737('0x7'))(_0x4737('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4737('0x9')][_0x4737('0xa')]({'port':0x232a});config[_0x4737('0xb')]=_[_0x4737('0xc')](config['redis'],{'host':_0x4737('0xd'),'port':0x18eb});var socket=require(_0x4737('0xe'))(new Redis(config[_0x4737('0xb')]));require(_0x4737('0xf'))[_0x4737('0x10')](socket);function respondWithRpcPromise(_0x548637,_0x10dabc,_0x3a51a8){return new BPromise(function(_0x2367aa,_0x4f54ca){return client['request'](_0x548637,_0x3a51a8)[_0x4737('0x11')](function(_0x1a7840){logger[_0x4737('0x12')](_0x4737('0x13'),_0x10dabc,_0x4737('0x14'));logger[_0x4737('0x15')](_0x4737('0x16'),_0x10dabc,_0x4737('0x14'),JSON[_0x4737('0x17')](_0x1a7840));if(_0x1a7840['error']){if(_0x1a7840[_0x4737('0x18')][_0x4737('0x19')]===0x1f4){logger[_0x4737('0x18')](_0x4737('0x13'),_0x10dabc,_0x1a7840[_0x4737('0x18')]['message']);return _0x4f54ca(_0x1a7840['error'][_0x4737('0x1a')]);}logger['error'](_0x4737('0x13'),_0x10dabc,_0x1a7840[_0x4737('0x18')]['message']);return _0x2367aa(_0x1a7840[_0x4737('0x18')][_0x4737('0x1a')]);}else{logger[_0x4737('0x12')]('UserProfile,\x20%s,\x20%s',_0x10dabc,_0x4737('0x14'));_0x2367aa(_0x1a7840['result'][_0x4737('0x1a')]);}})[_0x4737('0x1b')](function(_0x2d247e){logger[_0x4737('0x18')](_0x4737('0x13'),_0x10dabc,_0x2d247e);_0x4f54ca(_0x2d247e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 745df5c..9584354 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 _0xaf4a=['register','length','./userProfile.events','save','remove','update','emit'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xaf4a,0x1d7));var _0xaaf4=function(_0x239089,_0x511f9b){_0x239089=_0x239089-0x0;var _0x3ac7f1=_0xaf4a[_0x239089];return _0x3ac7f1;};'use strict';var UserProfileEvents=require(_0xaaf4('0x0'));var events=[_0xaaf4('0x1'),_0xaaf4('0x2'),_0xaaf4('0x3')];function createListener(_0x73ce86,_0x81e60c){return function(_0x2879bc){_0x81e60c[_0xaaf4('0x4')](_0x73ce86,_0x2879bc);};}function removeListener(_0x355609,_0x13fb02){return function(){UserProfileEvents['removeListener'](_0x355609,_0x13fb02);};}exports[_0xaaf4('0x5')]=function(_0x4213d3){for(var _0x32db3e=0x0,_0x1f83fb=events[_0xaaf4('0x6')];_0x32db3e<_0x1f83fb;_0x32db3e++){var _0x2b3e74=events[_0x32db3e];var _0x23b631=createListener('userProfile:'+_0x2b3e74,_0x4213d3);UserProfileEvents['on'](_0x2b3e74,_0x23b631);}}; \ No newline at end of file +var _0xa410=['length','./userProfile.events','save','update','emit','removeListener'];(function(_0x5a5864,_0x19f580){var _0x20801f=function(_0x1b1fa7){while(--_0x1b1fa7){_0x5a5864['push'](_0x5a5864['shift']());}};_0x20801f(++_0x19f580);}(_0xa410,0x121));var _0x0a41=function(_0x402529,_0x398245){_0x402529=_0x402529-0x0;var _0x3bd450=_0xa410[_0x402529];return _0x3bd450;};'use strict';var UserProfileEvents=require(_0x0a41('0x0'));var events=[_0x0a41('0x1'),'remove',_0x0a41('0x2')];function createListener(_0x1557d8,_0x1513e5){return function(_0x1d508b){_0x1513e5[_0x0a41('0x3')](_0x1557d8,_0x1d508b);};}function removeListener(_0x24c3e5,_0x15b31e){return function(){UserProfileEvents[_0x0a41('0x4')](_0x24c3e5,_0x15b31e);};}exports['register']=function(_0x50a002){for(var _0x46f103=0x0,_0x2ec284=events[_0x0a41('0x5')];_0x46f103<_0x2ec284;_0x46f103++){var _0x335a53=events[_0x46f103];var _0x19354c=createListener('userProfile:'+_0x335a53,_0x50a002);UserProfileEvents['on'](_0x335a53,_0x19354c);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 6736cd2..e5941a1 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 _0x4341=['express','../../components/auth/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','util','path','connect-timeout'];(function(_0x4e9310,_0x5296e4){var _0x346b79=function(_0x2b0d41){while(--_0x2b0d41){_0x4e9310['push'](_0x4e9310['shift']());}};_0x346b79(++_0x5296e4);}(_0x4341,0x95));var _0x1434=function(_0x575a31,_0x56336f){_0x575a31=_0x575a31-0x0;var _0x5d7dad=_0x4341[_0x575a31];return _0x5d7dad;};'use strict';var multer=require('multer');var util=require(_0x1434('0x0'));var path=require(_0x1434('0x1'));var timeout=require(_0x1434('0x2'));var express=require(_0x1434('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1434('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1434('0x5'));router[_0x1434('0x6')]('/',auth[_0x1434('0x7')](),controller[_0x1434('0x8')]);router['get'](_0x1434('0x9'),auth[_0x1434('0x7')](),controller[_0x1434('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1434('0xb')]);router[_0x1434('0xc')]('/',auth['isAuthenticated'](),controller[_0x1434('0xd')]);router[_0x1434('0xe')](_0x1434('0xf'),auth['isAuthenticated'](),controller[_0x1434('0x10')]);router[_0x1434('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x1434('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe9b5=['/:id','show','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xe9b5,0x104));var _0x5e9b=function(_0x3facc9,_0x4d0cc){_0x3facc9=_0x3facc9-0x0;var _0x3e0708=_0xe9b5[_0x3facc9];return _0x3e0708;};'use strict';var multer=require(_0x5e9b('0x0'));var util=require('util');var path=require(_0x5e9b('0x1'));var timeout=require('connect-timeout');var express=require(_0x5e9b('0x2'));var router=express[_0x5e9b('0x3')]();var fs_extra=require(_0x5e9b('0x4'));var auth=require(_0x5e9b('0x5'));var interaction=require(_0x5e9b('0x6'));var config=require('../../config/environment');var controller=require(_0x5e9b('0x7'));router['get']('/',auth[_0x5e9b('0x8')](),controller[_0x5e9b('0x9')]);router[_0x5e9b('0xa')](_0x5e9b('0xb'),auth[_0x5e9b('0x8')](),controller[_0x5e9b('0xc')]);router[_0x5e9b('0xa')](_0x5e9b('0xd'),auth[_0x5e9b('0x8')](),controller[_0x5e9b('0xe')]);router[_0x5e9b('0xf')]('/',auth[_0x5e9b('0x8')](),controller[_0x5e9b('0x10')]);router[_0x5e9b('0x11')]('/:id',auth[_0x5e9b('0x8')](),controller[_0x5e9b('0x12')]);router[_0x5e9b('0x13')](_0x5e9b('0xd'),auth['isAuthenticated'](),controller[_0x5e9b('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 230e6dc..3f70c1c 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 _0x7f21=['STRING','exports','INTEGER'];(function(_0x5edafc,_0x22002c){var _0x1fa600=function(_0x5dc143){while(--_0x5dc143){_0x5edafc['push'](_0x5edafc['shift']());}};_0x1fa600(++_0x22002c);}(_0x7f21,0x106));var _0x17f2=function(_0x443b34,_0x2a2bc6){_0x443b34=_0x443b34-0x0;var _0x5a20ca=_0x7f21[_0x443b34];return _0x5a20ca;};'use strict';var Sequelize=require('sequelize');module[_0x17f2('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x17f2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x17f2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc6b0=['STRING','INTEGER','sequelize','exports'];(function(_0x4be52a,_0x5548d4){var _0x5e24e7=function(_0x2cf03e){while(--_0x2cf03e){_0x4be52a['push'](_0x4be52a['shift']());}};_0x5e24e7(++_0x5548d4);}(_0xc6b0,0x1de));var _0x0c6b=function(_0x1d64fe,_0x21e967){_0x1d64fe=_0x1d64fe-0x0;var _0x27bd64=_0xc6b0[_0x1d64fe];return _0x27bd64;};'use strict';var Sequelize=require(_0x0c6b('0x0'));module[_0x0c6b('0x1')]={'name':{'type':Sequelize[_0x0c6b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0c6b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0c6b('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d732056..5c0efe0 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 _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x4dd479,_0x26d87a){var _0x1b6807=function(_0x2bec19){while(--_0x2bec19){_0x4dd479['push'](_0x4dd479['shift']());}};_0x1b6807(++_0x26d87a);}(_0xacf4,0xe7));var _0x4acf=function(_0x1439b0,_0x4a96e3){_0x1439b0=_0x1439b0-0x0;var _0x2d0c5b=_0xacf4[_0x1439b0];return _0x2d0c5b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['UserProfileResource'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['UserProfileResource']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));}; \ No newline at end of file +var _0xafc4=['update','destroy','then','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','UserProfileResource','includeAll','catch','show','params','create','body','find','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5c2e5e,_0x2bc00e){var _0x46a5da=function(_0xf0fa38){while(--_0xf0fa38){_0x5c2e5e['push'](_0x5c2e5e['shift']());}};_0x46a5da(++_0x2bc00e);}(_0xafc4,0x69));var _0x4afc=function(_0x1dcf63,_0x154061){_0x1dcf63=_0x1dcf63-0x0;var _0x509682=_0xafc4[_0x1dcf63];return _0x509682;};'use strict';var emlformat=require(_0x4afc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4afc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4afc('0x2'));var moment=require(_0x4afc('0x3'));var BPromise=require(_0x4afc('0x4'));var Mustache=require(_0x4afc('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x4afc('0x6'));var ejs=require(_0x4afc('0x7'));var fs=require('fs');var fs_extra=require(_0x4afc('0x8'));var _=require(_0x4afc('0x9'));var squel=require(_0x4afc('0xa'));var crypto=require(_0x4afc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4afc('0xc'));var toCsv=require(_0x4afc('0x6'));var querystring=require(_0x4afc('0xd'));var Papa=require(_0x4afc('0xe'));var Redis=require(_0x4afc('0xf'));var authService=require(_0x4afc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4afc('0x11'));var logger=require('../../config/logger')(_0x4afc('0x12'));var utils=require(_0x4afc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4afc('0x14'));var db=require(_0x4afc('0x15'))['db'];function respondWithStatusCode(_0x2b191c,_0x2768bf){_0x2768bf=_0x2768bf||0xcc;return function(_0x1d8f98){if(_0x1d8f98){return _0x2b191c[_0x4afc('0x16')](_0x2768bf);}return _0x2b191c[_0x4afc('0x17')](_0x2768bf)[_0x4afc('0x18')]();};}function respondWithResult(_0x5effb4,_0x26f3f1){_0x26f3f1=_0x26f3f1||0xc8;return function(_0x429fd8){if(_0x429fd8){return _0x5effb4[_0x4afc('0x17')](_0x26f3f1)[_0x4afc('0x19')](_0x429fd8);}};}function respondWithFilteredResult(_0x5f2dc9,_0x4e32e8){return function(_0x2452ae){if(_0x2452ae){var _0x4f3127=typeof _0x4e32e8[_0x4afc('0x1a')]===_0x4afc('0x1b')&&typeof _0x4e32e8[_0x4afc('0x1c')]===_0x4afc('0x1b');var _0x3a306f=_0x2452ae[_0x4afc('0x1d')];var _0x22f809=_0x4f3127?0x0:_0x4e32e8[_0x4afc('0x1a')];var _0x16365f=_0x4f3127?_0x2452ae[_0x4afc('0x1d')]:_0x4e32e8[_0x4afc('0x1a')]+_0x4e32e8['limit'];var _0x1a8f49;if(_0x16365f>=_0x3a306f){_0x16365f=_0x3a306f;_0x1a8f49=0xc8;}else{_0x1a8f49=0xce;}_0x5f2dc9[_0x4afc('0x17')](_0x1a8f49);return _0x5f2dc9[_0x4afc('0x1e')](_0x4afc('0x1f'),_0x22f809+'-'+_0x16365f+'/'+_0x3a306f)['json'](_0x2452ae);}return null;};}function patchUpdates(_0x3bddc0){return function(_0x30eda3){try{jsonpatch[_0x4afc('0x20')](_0x30eda3,_0x3bddc0,!![]);}catch(_0x280587){return BPromise[_0x4afc('0x21')](_0x280587);}return _0x30eda3[_0x4afc('0x22')]();};}function saveUpdates(_0x3ad7a5,_0x573a75){return function(_0x5403e4){if(_0x5403e4){return _0x5403e4[_0x4afc('0x23')](_0x3ad7a5)['then'](function(_0x37debf){return _0x37debf;});}return null;};}function removeEntity(_0x4e9a48,_0x1aa676){return function(_0x2a0314){if(_0x2a0314){return _0x2a0314[_0x4afc('0x24')]()[_0x4afc('0x25')](function(){_0x4e9a48[_0x4afc('0x17')](0xcc)[_0x4afc('0x18')]();});}};}function handleEntityNotFound(_0x40a0db,_0x383a71){return function(_0x2bb837){if(!_0x2bb837){_0x40a0db[_0x4afc('0x16')](0x194);}return _0x2bb837;};}function handleError(_0x4e8273,_0x359c07){_0x359c07=_0x359c07||0x1f4;return function(_0x35f5b3){logger['error'](_0x35f5b3[_0x4afc('0x26')]);if(_0x35f5b3[_0x4afc('0x27')]){delete _0x35f5b3[_0x4afc('0x27')];}_0x4e8273['status'](_0x359c07)['send'](_0x35f5b3);};}exports['index']=function(_0x426e9d,_0x5db47e){var _0x5e4747={},_0xd26d2f={},_0x628e42={'count':0x0,'rows':[]};var _0x494fe7=_['map'](db['UserProfileResource'][_0x4afc('0x28')],function(_0x34434a){return{'name':_0x34434a[_0x4afc('0x29')],'type':_0x34434a[_0x4afc('0x2a')][_0x4afc('0x2b')]};});_0xd26d2f[_0x4afc('0x2c')]=_['map'](_0x494fe7,_0x4afc('0x27'));_0xd26d2f[_0x4afc('0x2d')]=_[_0x4afc('0x2e')](_0x426e9d[_0x4afc('0x2d')]);_0xd26d2f[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0xd26d2f[_0x4afc('0x2c')],_0xd26d2f[_0x4afc('0x2d')]);_0x5e4747['attributes']=_[_0x4afc('0x30')](_0xd26d2f['model'],qs['fields'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x5e4747[_0x4afc('0x32')]=_0x5e4747[_0x4afc('0x32')][_0x4afc('0x33')]?_0x5e4747[_0x4afc('0x32')]:_0xd26d2f['model'];if(!_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x34')](_0x4afc('0x35'))){_0x5e4747[_0x4afc('0x1c')]=qs[_0x4afc('0x1c')](_0x426e9d[_0x4afc('0x2d')]['limit']);_0x5e4747[_0x4afc('0x1a')]=qs[_0x4afc('0x1a')](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x1a')]);}_0x5e4747['order']=qs['sort'](_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x36')]);_0x5e4747[_0x4afc('0x37')]=qs['filters'](_['pick'](_0x426e9d[_0x4afc('0x2d')],_0xd26d2f['filters']),_0x494fe7);if(_0x426e9d['query'][_0x4afc('0x38')]){_0x5e4747[_0x4afc('0x37')]=_[_0x4afc('0x39')](_0x5e4747[_0x4afc('0x37')],{'$or':_[_0x4afc('0x3a')](_0x494fe7,function(_0x4420fb){if(_0x4420fb[_0x4afc('0x2a')]!==_0x4afc('0x3b')){var _0x3ccc5a={};_0x3ccc5a[_0x4420fb[_0x4afc('0x27')]]={'$like':'%'+_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x38')]+'%'};return _0x3ccc5a;}})});}_0x5e4747=_[_0x4afc('0x39')]({},_0x5e4747,_0x426e9d[_0x4afc('0x3c')]);var _0x46dd2a={'where':_0x5e4747['where']};return db[_0x4afc('0x3d')][_0x4afc('0x1d')](_0x46dd2a)[_0x4afc('0x25')](function(_0xe6db12){_0x628e42[_0x4afc('0x1d')]=_0xe6db12;if(_0x426e9d[_0x4afc('0x2d')][_0x4afc('0x3e')]){_0x5e4747['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5e4747);})[_0x4afc('0x25')](function(_0x105c03){_0x628e42['rows']=_0x105c03;return _0x628e42;})[_0x4afc('0x25')](respondWithFilteredResult(_0x5db47e,_0x5e4747))[_0x4afc('0x3f')](handleError(_0x5db47e,null));};exports[_0x4afc('0x40')]=function(_0x397996,_0x545109){var _0x12b5db={'raw':![],'where':{'id':_0x397996[_0x4afc('0x41')]['id']}},_0x45c9c3={};_0x45c9c3[_0x4afc('0x2c')]=_[_0x4afc('0x2e')](db[_0x4afc('0x3d')]['rawAttributes']);_0x45c9c3[_0x4afc('0x2d')]=_['keys'](_0x397996[_0x4afc('0x2d')]);_0x45c9c3[_0x4afc('0x2f')]=_[_0x4afc('0x30')](_0x45c9c3['model'],_0x45c9c3['query']);_0x12b5db[_0x4afc('0x32')]=_[_0x4afc('0x30')](_0x45c9c3[_0x4afc('0x2c')],qs[_0x4afc('0x31')](_0x397996[_0x4afc('0x2d')][_0x4afc('0x31')]));_0x12b5db[_0x4afc('0x32')]=_0x12b5db[_0x4afc('0x32')]['length']?_0x12b5db[_0x4afc('0x32')]:_0x45c9c3[_0x4afc('0x2c')];if(_0x397996['query'][_0x4afc('0x3e')]){_0x12b5db['include']=[{'all':!![]}];}_0x12b5db=_[_0x4afc('0x39')]({},_0x12b5db,_0x397996[_0x4afc('0x3c')]);return db[_0x4afc('0x3d')]['find'](_0x12b5db)[_0x4afc('0x25')](handleEntityNotFound(_0x545109,null))[_0x4afc('0x25')](respondWithResult(_0x545109,null))[_0x4afc('0x3f')](handleError(_0x545109,null));};exports[_0x4afc('0x42')]=function(_0x4772db,_0x19a0ac){return db['UserProfileResource']['create'](_0x4772db['body'],{})[_0x4afc('0x25')](respondWithResult(_0x19a0ac,0xc9))[_0x4afc('0x3f')](handleError(_0x19a0ac,null));};exports[_0x4afc('0x23')]=function(_0x269c24,_0xb5cca9){if(_0x269c24[_0x4afc('0x43')]['id']){delete _0x269c24[_0x4afc('0x43')]['id'];}return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x269c24[_0x4afc('0x41')]['id']}})['then'](handleEntityNotFound(_0xb5cca9,null))[_0x4afc('0x25')](saveUpdates(_0x269c24['body'],null))['then'](respondWithResult(_0xb5cca9,null))[_0x4afc('0x3f')](handleError(_0xb5cca9,null));};exports['destroy']=function(_0x428d78,_0x355198){return db[_0x4afc('0x3d')][_0x4afc('0x44')]({'where':{'id':_0x428d78['params']['id']}})[_0x4afc('0x25')](handleEntityNotFound(_0x355198,null))['then'](removeEntity(_0x355198,null))[_0x4afc('0x3f')](handleError(_0x355198,null));};exports[_0x4afc('0x45')]=function(_0x3625c9,_0x387834){return db[_0x4afc('0x3d')][_0x4afc('0x45')]()[_0x4afc('0x25')](respondWithResult(_0x387834,null))[_0x4afc('0x3f')](handleError(_0x387834,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 96af838..9674174 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 _0xeafa=['define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xeafa,0x1ef));var _0xaeaf=function(_0x1976db,_0x4cbc8c){_0x1976db=_0x1976db-0x0;var _0x3602fb=_0xeafa[_0x1976db];return _0x3602fb;};'use strict';var _=require(_0xaeaf('0x0'));var util=require(_0xaeaf('0x1'));var logger=require(_0xaeaf('0x2'))('api');var moment=require(_0xaeaf('0x3'));var BPromise=require('bluebird');var rp=require(_0xaeaf('0x4'));var fs=require('fs');var path=require(_0xaeaf('0x5'));var rimraf=require(_0xaeaf('0x6'));var config=require(_0xaeaf('0x7'));var attributes=require('./userProfileResource.attributes');module[_0xaeaf('0x8')]=function(_0x1dd4d6,_0xaf3449){return _0x1dd4d6[_0xaeaf('0x9')](_0xaeaf('0xa'),attributes,{'tableName':_0xaeaf('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xaeaf('0xc'),_0xaeaf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f9c=['./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3520a3,_0x585b4e){var _0x266257=function(_0x4d763a){while(--_0x4d763a){_0x3520a3['push'](_0x3520a3['shift']());}};_0x266257(++_0x585b4e);}(_0x0f9c,0x11e));var _0xc0f9=function(_0x392d59,_0x28ad04){_0x392d59=_0x392d59-0x0;var _0xe38011=_0x0f9c[_0x392d59];return _0xe38011;};'use strict';var _=require(_0xc0f9('0x0'));var util=require(_0xc0f9('0x1'));var logger=require(_0xc0f9('0x2'))('api');var moment=require(_0xc0f9('0x3'));var BPromise=require('bluebird');var rp=require(_0xc0f9('0x4'));var fs=require('fs');var path=require(_0xc0f9('0x5'));var rimraf=require(_0xc0f9('0x6'));var config=require(_0xc0f9('0x7'));var attributes=require(_0xc0f9('0x8'));module['exports']=function(_0x278c5b,_0x345ef7){return _0x278c5b[_0xc0f9('0x9')](_0xc0f9('0xa'),attributes,{'tableName':_0xc0f9('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xc0f9('0xc'),_0xc0f9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 77f6a60..f0f3da6 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 _0x5577=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x21ab3f,_0x12b8fb){var _0x296373=function(_0x710aad){while(--_0x710aad){_0x21ab3f['push'](_0x21ab3f['shift']());}};_0x296373(++_0x12b8fb);}(_0x5577,0xe3));var _0x7557=function(_0x2e6006,_0x314c29){_0x2e6006=_0x2e6006-0x0;var _0x701665=_0x5577[_0x2e6006];return _0x701665;};'use strict';var _=require(_0x7557('0x0'));var util=require(_0x7557('0x1'));var moment=require(_0x7557('0x2'));var BPromise=require(_0x7557('0x3'));var rs=require(_0x7557('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7557('0x5'))['db'];var utils=require(_0x7557('0x6'));var logger=require(_0x7557('0x7'))(_0x7557('0x8'));var config=require('../../config/environment');var jayson=require(_0x7557('0x9'));var client=jayson[_0x7557('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e3d11,_0x2f31b8,_0x4f7fbf){return new BPromise(function(_0x5c1308,_0x74fe8b){return client['request'](_0x1e3d11,_0x4f7fbf)[_0x7557('0xb')](function(_0x525bf7){logger[_0x7557('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x2f31b8,_0x7557('0xd'));logger[_0x7557('0xe')](_0x7557('0xf'),_0x2f31b8,_0x7557('0xd'),JSON[_0x7557('0x10')](_0x525bf7));if(_0x525bf7[_0x7557('0x11')]){if(_0x525bf7[_0x7557('0x11')][_0x7557('0x12')]===0x1f4){logger[_0x7557('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x2f31b8,_0x525bf7[_0x7557('0x11')][_0x7557('0x13')]);return _0x74fe8b(_0x525bf7[_0x7557('0x11')][_0x7557('0x13')]);}logger[_0x7557('0x11')](_0x7557('0x14'),_0x2f31b8,_0x525bf7[_0x7557('0x11')]['message']);return _0x5c1308(_0x525bf7[_0x7557('0x11')]['message']);}else{logger['info'](_0x7557('0x14'),_0x2f31b8,_0x7557('0xd'));_0x5c1308(_0x525bf7[_0x7557('0x15')][_0x7557('0x13')]);}})[_0x7557('0x16')](function(_0x2acdad){logger[_0x7557('0x11')](_0x7557('0x14'),_0x2f31b8,_0x2acdad);_0x74fe8b(_0x2acdad);});});} \ No newline at end of file +var _0xf51f=['../../config/logger','rpc','../../config/environment','client','request','then','info','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserProfileResource,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf51f,0x191));var _0xff51=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0xf51f[_0x266618];return _0x54dbf5;};'use strict';var _=require('lodash');var util=require(_0xff51('0x0'));var moment=require(_0xff51('0x1'));var BPromise=require(_0xff51('0x2'));var rs=require(_0xff51('0x3'));var fs=require('fs');var Redis=require(_0xff51('0x4'));var db=require(_0xff51('0x5'))['db'];var utils=require(_0xff51('0x6'));var logger=require(_0xff51('0x7'))(_0xff51('0x8'));var config=require(_0xff51('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xff51('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2993eb,_0x3f0a14,_0x3bacd7){return new BPromise(function(_0x1842cd,_0x51621a){return client[_0xff51('0xb')](_0x2993eb,_0x3bacd7)[_0xff51('0xc')](function(_0x222cb7){logger[_0xff51('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x3f0a14,'request\x20sent');logger[_0xff51('0xe')](_0xff51('0xf'),_0x3f0a14,_0xff51('0x10'),JSON[_0xff51('0x11')](_0x222cb7));if(_0x222cb7['error']){if(_0x222cb7[_0xff51('0x12')][_0xff51('0x13')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x3f0a14,_0x222cb7['error'][_0xff51('0x14')]);return _0x51621a(_0x222cb7[_0xff51('0x12')]['message']);}logger[_0xff51('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x3f0a14,_0x222cb7['error'][_0xff51('0x14')]);return _0x1842cd(_0x222cb7[_0xff51('0x12')][_0xff51('0x14')]);}else{logger[_0xff51('0xd')](_0xff51('0x15'),_0x3f0a14,_0xff51('0x10'));_0x1842cd(_0x222cb7[_0xff51('0x16')][_0xff51('0x14')]);}})[_0xff51('0x17')](function(_0x1cc92f){logger[_0xff51('0x12')](_0xff51('0x15'),_0x3f0a14,_0x1cc92f);_0x51621a(_0x1cc92f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 58dfc81..9f6c291 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 _0x7f3f=['path','connect-timeout','express','Router','../../components/interaction/service','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer'];(function(_0x48c2ac,_0x444cb0){var _0x2f3648=function(_0x44c071){while(--_0x44c071){_0x48c2ac['push'](_0x48c2ac['shift']());}};_0x2f3648(++_0x444cb0);}(_0x7f3f,0x117));var _0xf7f3=function(_0x435592,_0x363aed){_0x435592=_0x435592-0x0;var _0x2d544d=_0x7f3f[_0x435592];return _0x2d544d;};'use strict';var multer=require(_0xf7f3('0x0'));var util=require('util');var path=require(_0xf7f3('0x1'));var timeout=require(_0xf7f3('0x2'));var express=require(_0xf7f3('0x3'));var router=express[_0xf7f3('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf7f3('0x5'));var config=require('../../config/environment');var controller=require(_0xf7f3('0x6'));router['get']('/',auth[_0xf7f3('0x7')](),controller[_0xf7f3('0x8')]);router[_0xf7f3('0x9')](_0xf7f3('0xa'),auth[_0xf7f3('0x7')](),controller[_0xf7f3('0xb')]);router[_0xf7f3('0x9')](_0xf7f3('0xc'),auth['isAuthenticated'](),controller[_0xf7f3('0xd')]);router[_0xf7f3('0xe')]('/',auth['isAuthenticated'](),controller[_0xf7f3('0xf')]);router[_0xf7f3('0x10')](_0xf7f3('0xc'),auth[_0xf7f3('0x7')](),controller[_0xf7f3('0x11')]);router[_0xf7f3('0x12')]('/:id',auth[_0xf7f3('0x7')](),controller[_0xf7f3('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3ce6=['get','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index'];(function(_0x47a338,_0x107230){var _0x1283e7=function(_0x5a4a89){while(--_0x5a4a89){_0x47a338['push'](_0x47a338['shift']());}};_0x1283e7(++_0x107230);}(_0x3ce6,0x184));var _0x63ce=function(_0x4d5fa8,_0x324f94){_0x4d5fa8=_0x4d5fa8-0x0;var _0x43a6db=_0x3ce6[_0x4d5fa8];return _0x43a6db;};'use strict';var multer=require(_0x63ce('0x0'));var util=require(_0x63ce('0x1'));var path=require(_0x63ce('0x2'));var timeout=require(_0x63ce('0x3'));var express=require(_0x63ce('0x4'));var router=express['Router']();var fs_extra=require(_0x63ce('0x5'));var auth=require(_0x63ce('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x63ce('0x7'));var controller=require(_0x63ce('0x8'));router['get']('/',auth[_0x63ce('0x9')](),controller[_0x63ce('0xa')]);router[_0x63ce('0xb')](_0x63ce('0xc'),auth[_0x63ce('0x9')](),controller[_0x63ce('0xd')]);router['get'](_0x63ce('0xe'),auth[_0x63ce('0x9')](),controller[_0x63ce('0xf')]);router[_0x63ce('0x10')]('/',auth[_0x63ce('0x9')](),controller['create']);router[_0x63ce('0x11')](_0x63ce('0xe'),auth[_0x63ce('0x9')](),controller[_0x63ce('0x12')]);router['delete'](_0x63ce('0xe'),auth[_0x63ce('0x9')](),controller[_0x63ce('0x13')]);module[_0x63ce('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6737f16..8abbfc7 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 _0x28f2=['join','getDataValue','split','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0x1a50eb,_0x1b78c3){var _0x51b26c=function(_0x1e4a57){while(--_0x1e4a57){_0x1a50eb['push'](_0x1a50eb['shift']());}};_0x51b26c(++_0x1b78c3);}(_0x28f2,0x193));var _0x228f=function(_0x2c60c8,_0x42929b){_0x2c60c8=_0x2c60c8-0x0;var _0x4926ad=_0x28f2[_0x2c60c8];return _0x4926ad;};'use strict';var Sequelize=require(_0x228f('0x0'));module[_0x228f('0x1')]={'name':{'type':Sequelize[_0x228f('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x228f('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x228f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x228f('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x228f('0x2')],'set':function(_0x79ed5f){this[_0x228f('0x5')](_0x228f('0x6'),_0x79ed5f?_0x79ed5f[_0x228f('0x7')](''):[]);},'get':function(){return this[_0x228f('0x8')]('crudPermissions')?this[_0x228f('0x8')]('crudPermissions')[_0x228f('0x9')](''):[];}}}; \ No newline at end of file +var _0xbaf0=['split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x2e0510,_0xa03d49){var _0x1fadff=function(_0x1b7c70){while(--_0x1b7c70){_0x2e0510['push'](_0x2e0510['shift']());}};_0x1fadff(++_0xa03d49);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0baf('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0baf('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x232cc7){this[_0x0baf('0x4')](_0x0baf('0x5'),_0x232cc7?_0x232cc7[_0x0baf('0x6')](''):[]);},'get':function(){return this[_0x0baf('0x7')](_0x0baf('0x5'))?this[_0x0baf('0x7')](_0x0baf('0x5'))[_0x0baf('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 96a24b1..ab60784 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 _0xc505=['type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','map','UserProfileSection','fieldName'];(function(_0xb875ee,_0x583042){var _0x4c7f3a=function(_0x1f6661){while(--_0x1f6661){_0xb875ee['push'](_0xb875ee['shift']());}};_0x4c7f3a(++_0x583042);}(_0xc505,0x154));var _0x5c50=function(_0x3f9928,_0x1c24e9){_0x3f9928=_0x3f9928-0x0;var _0x30fae4=_0xc505[_0x3f9928];return _0x30fae4;};'use strict';var emlformat=require(_0x5c50('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5c50('0x1'));var rp=require(_0x5c50('0x2'));var moment=require('moment');var BPromise=require(_0x5c50('0x3'));var Mustache=require(_0x5c50('0x4'));var util=require('util');var path=require(_0x5c50('0x5'));var sox=require(_0x5c50('0x6'));var csv=require(_0x5c50('0x7'));var ejs=require(_0x5c50('0x8'));var fs=require('fs');var fs_extra=require(_0x5c50('0x9'));var _=require(_0x5c50('0xa'));var squel=require('squel');var crypto=require(_0x5c50('0xb'));var jsforce=require(_0x5c50('0xc'));var deskjs=require(_0x5c50('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5c50('0xe'));var Papa=require(_0x5c50('0xf'));var Redis=require(_0x5c50('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5c50('0x11'));var hardwareService=require(_0x5c50('0x12'));var logger=require(_0x5c50('0x13'))(_0x5c50('0x14'));var utils=require(_0x5c50('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5c50('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x504776,_0x358610){_0x358610=_0x358610||0xcc;return function(_0x556326){if(_0x556326){return _0x504776[_0x5c50('0x17')](_0x358610);}return _0x504776[_0x5c50('0x18')](_0x358610)['end']();};}function respondWithResult(_0x1a9db6,_0x3992d0){_0x3992d0=_0x3992d0||0xc8;return function(_0x51884f){if(_0x51884f){return _0x1a9db6[_0x5c50('0x18')](_0x3992d0)[_0x5c50('0x19')](_0x51884f);}};}function respondWithFilteredResult(_0x25c08d,_0x26f772){return function(_0x290fa7){if(_0x290fa7){var _0x3af622=typeof _0x26f772[_0x5c50('0x1a')]===_0x5c50('0x1b')&&typeof _0x26f772[_0x5c50('0x1c')]===_0x5c50('0x1b');var _0x488691=_0x290fa7[_0x5c50('0x1d')];var _0x2b535e=_0x3af622?0x0:_0x26f772[_0x5c50('0x1a')];var _0x51f31c=_0x3af622?_0x290fa7[_0x5c50('0x1d')]:_0x26f772[_0x5c50('0x1a')]+_0x26f772[_0x5c50('0x1c')];var _0x4aaa6a;if(_0x51f31c>=_0x488691){_0x51f31c=_0x488691;_0x4aaa6a=0xc8;}else{_0x4aaa6a=0xce;}_0x25c08d['status'](_0x4aaa6a);return _0x25c08d[_0x5c50('0x1e')](_0x5c50('0x1f'),_0x2b535e+'-'+_0x51f31c+'/'+_0x488691)[_0x5c50('0x19')](_0x290fa7);}return null;};}function patchUpdates(_0x151d40){return function(_0x3522fc){try{jsonpatch[_0x5c50('0x20')](_0x3522fc,_0x151d40,!![]);}catch(_0x415ee8){return BPromise['reject'](_0x415ee8);}return _0x3522fc[_0x5c50('0x21')]();};}function saveUpdates(_0x2ef6ac,_0x3da118){return function(_0x8b46d9){if(_0x8b46d9){return _0x8b46d9[_0x5c50('0x22')](_0x2ef6ac)[_0x5c50('0x23')](function(_0xc30302){return _0xc30302;});}return null;};}function removeEntity(_0x16a10c,_0x1dbcd1){return function(_0x370019){if(_0x370019){return _0x370019[_0x5c50('0x24')]()[_0x5c50('0x23')](function(){_0x16a10c['status'](0xcc)[_0x5c50('0x25')]();});}};}function handleEntityNotFound(_0xa7ccf7,_0x22d879){return function(_0x4c5353){if(!_0x4c5353){_0xa7ccf7[_0x5c50('0x17')](0x194);}return _0x4c5353;};}function handleError(_0x1e1a08,_0x5762e0){_0x5762e0=_0x5762e0||0x1f4;return function(_0x30f66a){logger[_0x5c50('0x26')](_0x30f66a['stack']);if(_0x30f66a[_0x5c50('0x27')]){delete _0x30f66a[_0x5c50('0x27')];}_0x1e1a08['status'](_0x5762e0)[_0x5c50('0x28')](_0x30f66a);};}exports[_0x5c50('0x29')]=function(_0x537c0a,_0x50f30c){var _0x383a32={},_0x3c19b4={},_0x4e970e={'count':0x0,'rows':[]};var _0x34d885=_[_0x5c50('0x2a')](db[_0x5c50('0x2b')]['rawAttributes'],function(_0x8e6c46){return{'name':_0x8e6c46[_0x5c50('0x2c')],'type':_0x8e6c46[_0x5c50('0x2d')][_0x5c50('0x2e')]};});_0x3c19b4['model']=_[_0x5c50('0x2a')](_0x34d885,_0x5c50('0x27'));_0x3c19b4[_0x5c50('0x2f')]=_[_0x5c50('0x30')](_0x537c0a[_0x5c50('0x2f')]);_0x3c19b4['filters']=_[_0x5c50('0x31')](_0x3c19b4[_0x5c50('0x32')],_0x3c19b4[_0x5c50('0x2f')]);_0x383a32[_0x5c50('0x33')]=_[_0x5c50('0x31')](_0x3c19b4[_0x5c50('0x32')],qs[_0x5c50('0x34')](_0x537c0a[_0x5c50('0x2f')]['fields']));_0x383a32['attributes']=_0x383a32[_0x5c50('0x33')]['length']?_0x383a32[_0x5c50('0x33')]:_0x3c19b4[_0x5c50('0x32')];if(!_0x537c0a[_0x5c50('0x2f')][_0x5c50('0x35')](_0x5c50('0x36'))){_0x383a32[_0x5c50('0x1c')]=qs[_0x5c50('0x1c')](_0x537c0a['query'][_0x5c50('0x1c')]);_0x383a32[_0x5c50('0x1a')]=qs[_0x5c50('0x1a')](_0x537c0a[_0x5c50('0x2f')][_0x5c50('0x1a')]);}_0x383a32[_0x5c50('0x37')]=qs[_0x5c50('0x38')](_0x537c0a['query'][_0x5c50('0x38')]);_0x383a32[_0x5c50('0x39')]=qs[_0x5c50('0x3a')](_[_0x5c50('0x3b')](_0x537c0a[_0x5c50('0x2f')],_0x3c19b4[_0x5c50('0x3a')]),_0x34d885);if(_0x537c0a[_0x5c50('0x2f')][_0x5c50('0x3c')]){_0x383a32['where']=_[_0x5c50('0x3d')](_0x383a32['where'],{'$or':_[_0x5c50('0x2a')](_0x34d885,function(_0x44589f){if(_0x44589f['type']!==_0x5c50('0x3e')){var _0x1d45bc={};_0x1d45bc[_0x44589f[_0x5c50('0x27')]]={'$like':'%'+_0x537c0a[_0x5c50('0x2f')]['filter']+'%'};return _0x1d45bc;}})});}_0x383a32=_[_0x5c50('0x3d')]({},_0x383a32,_0x537c0a[_0x5c50('0x3f')]);var _0x3559eb={'where':_0x383a32[_0x5c50('0x39')]};return db['UserProfileSection'][_0x5c50('0x1d')](_0x3559eb)[_0x5c50('0x23')](function(_0x9888c7){_0x4e970e[_0x5c50('0x1d')]=_0x9888c7;if(_0x537c0a['query'][_0x5c50('0x40')]){_0x383a32[_0x5c50('0x41')]=[{'all':!![]}];}return db[_0x5c50('0x2b')][_0x5c50('0x42')](_0x383a32);})[_0x5c50('0x23')](function(_0x5d76ef){_0x4e970e[_0x5c50('0x43')]=_0x5d76ef;return _0x4e970e;})[_0x5c50('0x23')](respondWithFilteredResult(_0x50f30c,_0x383a32))[_0x5c50('0x44')](handleError(_0x50f30c,null));};exports[_0x5c50('0x45')]=function(_0xa52d09,_0x4180ef){var _0x2b4077={'raw':![],'where':{'id':_0xa52d09[_0x5c50('0x46')]['id']}},_0x4f3506={};_0x4f3506['model']=_[_0x5c50('0x30')](db['UserProfileSection'][_0x5c50('0x47')]);_0x4f3506[_0x5c50('0x2f')]=_[_0x5c50('0x30')](_0xa52d09[_0x5c50('0x2f')]);_0x4f3506[_0x5c50('0x3a')]=_[_0x5c50('0x31')](_0x4f3506[_0x5c50('0x32')],_0x4f3506[_0x5c50('0x2f')]);_0x2b4077['attributes']=_[_0x5c50('0x31')](_0x4f3506['model'],qs[_0x5c50('0x34')](_0xa52d09[_0x5c50('0x2f')][_0x5c50('0x34')]));_0x2b4077[_0x5c50('0x33')]=_0x2b4077[_0x5c50('0x33')][_0x5c50('0x48')]?_0x2b4077[_0x5c50('0x33')]:_0x4f3506[_0x5c50('0x32')];if(_0xa52d09[_0x5c50('0x2f')][_0x5c50('0x40')]){_0x2b4077[_0x5c50('0x41')]=[{'all':!![]}];}_0x2b4077=_['merge']({},_0x2b4077,_0xa52d09[_0x5c50('0x3f')]);return db['UserProfileSection'][_0x5c50('0x49')](_0x2b4077)[_0x5c50('0x23')](handleEntityNotFound(_0x4180ef,null))[_0x5c50('0x23')](respondWithResult(_0x4180ef,null))[_0x5c50('0x44')](handleError(_0x4180ef,null));};exports[_0x5c50('0x4a')]=function(_0x261c00,_0x363e00){return db['UserProfileSection'][_0x5c50('0x4a')](_0x261c00[_0x5c50('0x4b')],{})[_0x5c50('0x23')](respondWithResult(_0x363e00,0xc9))[_0x5c50('0x44')](handleError(_0x363e00,null));};exports['update']=function(_0x1dd071,_0x16c995){if(_0x1dd071[_0x5c50('0x4b')]['id']){delete _0x1dd071['body']['id'];}return db[_0x5c50('0x2b')][_0x5c50('0x49')]({'where':{'id':_0x1dd071[_0x5c50('0x46')]['id']}})[_0x5c50('0x23')](handleEntityNotFound(_0x16c995,null))[_0x5c50('0x23')](saveUpdates(_0x1dd071[_0x5c50('0x4b')],null))[_0x5c50('0x23')](respondWithResult(_0x16c995,null))[_0x5c50('0x44')](handleError(_0x16c995,null));};exports['destroy']=function(_0x2c232c,_0x4c0780){return db[_0x5c50('0x2b')][_0x5c50('0x49')]({'where':{'id':_0x2c232c['params']['id']}})[_0x5c50('0x23')](handleEntityNotFound(_0x4c0780,null))[_0x5c50('0x23')](removeEntity(_0x4c0780,null))[_0x5c50('0x44')](handleError(_0x4c0780,null));};exports[_0x5c50('0x4c')]=function(_0x3228a7,_0x4ee6fd){return db[_0x5c50('0x2b')][_0x5c50('0x4c')]()['then'](respondWithResult(_0x4ee6fd,null))[_0x5c50('0x44')](handleError(_0x4ee6fd,null));}; \ No newline at end of file +var _0xa82b=['fieldName','type','key','map','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','save','destroy','then','error','stack','name','send','index','UserProfileSection'];(function(_0x144d58,_0x413faf){var _0x405260=function(_0x1320b4){while(--_0x1320b4){_0x144d58['push'](_0x144d58['shift']());}};_0x405260(++_0x413faf);}(_0xa82b,0xff));var _0xba82=function(_0x2ccb91,_0xa2c1b4){_0x2ccb91=_0x2ccb91-0x0;var _0x4136ca=_0xa82b[_0x2ccb91];return _0x4136ca;};'use strict';var emlformat=require(_0xba82('0x0'));var rimraf=require(_0xba82('0x1'));var zipdir=require(_0xba82('0x2'));var jsonpatch=require(_0xba82('0x3'));var rp=require(_0xba82('0x4'));var moment=require(_0xba82('0x5'));var BPromise=require(_0xba82('0x6'));var Mustache=require(_0xba82('0x7'));var util=require('util');var path=require(_0xba82('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xba82('0x9'));var fs=require('fs');var fs_extra=require(_0xba82('0xa'));var _=require('lodash');var squel=require(_0xba82('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xba82('0xc'));var toCsv=require('to-csv');var querystring=require(_0xba82('0xd'));var Papa=require(_0xba82('0xe'));var Redis=require(_0xba82('0xf'));var authService=require(_0xba82('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xba82('0x11'));var hardwareService=require(_0xba82('0x12'));var logger=require(_0xba82('0x13'))(_0xba82('0x14'));var utils=require(_0xba82('0x15'));var config=require(_0xba82('0x16'));var licenseUtil=require(_0xba82('0x17'));var db=require(_0xba82('0x18'))['db'];function respondWithStatusCode(_0x4f6df9,_0x3e7b18){_0x3e7b18=_0x3e7b18||0xcc;return function(_0x3830bd){if(_0x3830bd){return _0x4f6df9[_0xba82('0x19')](_0x3e7b18);}return _0x4f6df9[_0xba82('0x1a')](_0x3e7b18)['end']();};}function respondWithResult(_0xce9c59,_0x234906){_0x234906=_0x234906||0xc8;return function(_0x3d95de){if(_0x3d95de){return _0xce9c59[_0xba82('0x1a')](_0x234906)['json'](_0x3d95de);}};}function respondWithFilteredResult(_0x3473a6,_0x8c32df){return function(_0x273d67){if(_0x273d67){var _0x159fba=typeof _0x8c32df[_0xba82('0x1b')]==='undefined'&&typeof _0x8c32df['limit']===_0xba82('0x1c');var _0x503839=_0x273d67[_0xba82('0x1d')];var _0x5642dd=_0x159fba?0x0:_0x8c32df[_0xba82('0x1b')];var _0x2e2f78=_0x159fba?_0x273d67['count']:_0x8c32df[_0xba82('0x1b')]+_0x8c32df[_0xba82('0x1e')];var _0x3307b7;if(_0x2e2f78>=_0x503839){_0x2e2f78=_0x503839;_0x3307b7=0xc8;}else{_0x3307b7=0xce;}_0x3473a6[_0xba82('0x1a')](_0x3307b7);return _0x3473a6[_0xba82('0x1f')]('Content-Range',_0x5642dd+'-'+_0x2e2f78+'/'+_0x503839)['json'](_0x273d67);}return null;};}function patchUpdates(_0xfc40e9){return function(_0x57cd36){try{jsonpatch['apply'](_0x57cd36,_0xfc40e9,!![]);}catch(_0x4c59e2){return BPromise['reject'](_0x4c59e2);}return _0x57cd36[_0xba82('0x20')]();};}function saveUpdates(_0x5edcec,_0x4e5dd3){return function(_0x1382dc){if(_0x1382dc){return _0x1382dc['update'](_0x5edcec)['then'](function(_0x2d4f0e){return _0x2d4f0e;});}return null;};}function removeEntity(_0x21fde4,_0x1ca96f){return function(_0x4c3699){if(_0x4c3699){return _0x4c3699[_0xba82('0x21')]()[_0xba82('0x22')](function(){_0x21fde4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x556c3c,_0x24dea8){return function(_0x382abe){if(!_0x382abe){_0x556c3c[_0xba82('0x19')](0x194);}return _0x382abe;};}function handleError(_0x35a90d,_0x44ebfc){_0x44ebfc=_0x44ebfc||0x1f4;return function(_0x57d731){logger[_0xba82('0x23')](_0x57d731[_0xba82('0x24')]);if(_0x57d731[_0xba82('0x25')]){delete _0x57d731[_0xba82('0x25')];}_0x35a90d[_0xba82('0x1a')](_0x44ebfc)[_0xba82('0x26')](_0x57d731);};}exports[_0xba82('0x27')]=function(_0x4ca84e,_0x2514f4){var _0x2f5709={},_0x2a3ec4={},_0x581f08={'count':0x0,'rows':[]};var _0x4124e8=_['map'](db[_0xba82('0x28')]['rawAttributes'],function(_0x3a873d){return{'name':_0x3a873d[_0xba82('0x29')],'type':_0x3a873d[_0xba82('0x2a')][_0xba82('0x2b')]};});_0x2a3ec4['model']=_[_0xba82('0x2c')](_0x4124e8,_0xba82('0x25'));_0x2a3ec4['query']=_[_0xba82('0x2d')](_0x4ca84e[_0xba82('0x2e')]);_0x2a3ec4[_0xba82('0x2f')]=_[_0xba82('0x30')](_0x2a3ec4['model'],_0x2a3ec4['query']);_0x2f5709[_0xba82('0x31')]=_['intersection'](_0x2a3ec4[_0xba82('0x32')],qs[_0xba82('0x33')](_0x4ca84e[_0xba82('0x2e')][_0xba82('0x33')]));_0x2f5709[_0xba82('0x31')]=_0x2f5709[_0xba82('0x31')][_0xba82('0x34')]?_0x2f5709['attributes']:_0x2a3ec4[_0xba82('0x32')];if(!_0x4ca84e[_0xba82('0x2e')][_0xba82('0x35')](_0xba82('0x36'))){_0x2f5709[_0xba82('0x1e')]=qs[_0xba82('0x1e')](_0x4ca84e[_0xba82('0x2e')]['limit']);_0x2f5709['offset']=qs[_0xba82('0x1b')](_0x4ca84e['query']['offset']);}_0x2f5709['order']=qs[_0xba82('0x37')](_0x4ca84e['query'][_0xba82('0x37')]);_0x2f5709[_0xba82('0x38')]=qs[_0xba82('0x2f')](_[_0xba82('0x39')](_0x4ca84e[_0xba82('0x2e')],_0x2a3ec4[_0xba82('0x2f')]),_0x4124e8);if(_0x4ca84e[_0xba82('0x2e')]['filter']){_0x2f5709['where']=_[_0xba82('0x3a')](_0x2f5709[_0xba82('0x38')],{'$or':_[_0xba82('0x2c')](_0x4124e8,function(_0x53970c){if(_0x53970c['type']!==_0xba82('0x3b')){var _0x464761={};_0x464761[_0x53970c[_0xba82('0x25')]]={'$like':'%'+_0x4ca84e['query'][_0xba82('0x3c')]+'%'};return _0x464761;}})});}_0x2f5709=_['merge']({},_0x2f5709,_0x4ca84e[_0xba82('0x3d')]);var _0x2125f3={'where':_0x2f5709['where']};return db[_0xba82('0x28')][_0xba82('0x1d')](_0x2125f3)[_0xba82('0x22')](function(_0x54de56){_0x581f08[_0xba82('0x1d')]=_0x54de56;if(_0x4ca84e[_0xba82('0x2e')][_0xba82('0x3e')]){_0x2f5709[_0xba82('0x3f')]=[{'all':!![]}];}return db[_0xba82('0x28')][_0xba82('0x40')](_0x2f5709);})['then'](function(_0x558ec3){_0x581f08[_0xba82('0x41')]=_0x558ec3;return _0x581f08;})['then'](respondWithFilteredResult(_0x2514f4,_0x2f5709))['catch'](handleError(_0x2514f4,null));};exports[_0xba82('0x42')]=function(_0x5cff16,_0x25f2dd){var _0x27f6a1={'raw':![],'where':{'id':_0x5cff16[_0xba82('0x43')]['id']}},_0x240a65={};_0x240a65['model']=_[_0xba82('0x2d')](db[_0xba82('0x28')][_0xba82('0x44')]);_0x240a65[_0xba82('0x2e')]=_[_0xba82('0x2d')](_0x5cff16['query']);_0x240a65[_0xba82('0x2f')]=_['intersection'](_0x240a65['model'],_0x240a65[_0xba82('0x2e')]);_0x27f6a1[_0xba82('0x31')]=_['intersection'](_0x240a65['model'],qs[_0xba82('0x33')](_0x5cff16[_0xba82('0x2e')][_0xba82('0x33')]));_0x27f6a1[_0xba82('0x31')]=_0x27f6a1['attributes'][_0xba82('0x34')]?_0x27f6a1[_0xba82('0x31')]:_0x240a65['model'];if(_0x5cff16[_0xba82('0x2e')][_0xba82('0x3e')]){_0x27f6a1[_0xba82('0x3f')]=[{'all':!![]}];}_0x27f6a1=_[_0xba82('0x3a')]({},_0x27f6a1,_0x5cff16[_0xba82('0x3d')]);return db[_0xba82('0x28')][_0xba82('0x45')](_0x27f6a1)[_0xba82('0x22')](handleEntityNotFound(_0x25f2dd,null))[_0xba82('0x22')](respondWithResult(_0x25f2dd,null))[_0xba82('0x46')](handleError(_0x25f2dd,null));};exports['create']=function(_0x2b6afd,_0x2cd532){return db[_0xba82('0x28')][_0xba82('0x47')](_0x2b6afd[_0xba82('0x48')],{})['then'](respondWithResult(_0x2cd532,0xc9))[_0xba82('0x46')](handleError(_0x2cd532,null));};exports['update']=function(_0xc9eb57,_0x2ef564){if(_0xc9eb57[_0xba82('0x48')]['id']){delete _0xc9eb57[_0xba82('0x48')]['id'];}return db[_0xba82('0x28')]['find']({'where':{'id':_0xc9eb57[_0xba82('0x43')]['id']}})[_0xba82('0x22')](handleEntityNotFound(_0x2ef564,null))[_0xba82('0x22')](saveUpdates(_0xc9eb57['body'],null))[_0xba82('0x22')](respondWithResult(_0x2ef564,null))[_0xba82('0x46')](handleError(_0x2ef564,null));};exports[_0xba82('0x21')]=function(_0x12ce6f,_0x2fda89){return db['UserProfileSection'][_0xba82('0x45')]({'where':{'id':_0x12ce6f[_0xba82('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fda89,null))['then'](removeEntity(_0x2fda89,null))[_0xba82('0x46')](handleError(_0x2fda89,null));};exports[_0xba82('0x49')]=function(_0x4b5883,_0x2ad5d9){return db[_0xba82('0x28')][_0xba82('0x49')]()[_0xba82('0x22')](respondWithResult(_0x2ad5d9,null))['catch'](handleError(_0x2ad5d9,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 12d67cb..1c80805 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 _0x4874=['api','moment','bluebird','request-promise','path','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','../../config/logger'];(function(_0x39dc87,_0x951afd){var _0x31210e=function(_0x2dbf22){while(--_0x2dbf22){_0x39dc87['push'](_0x39dc87['shift']());}};_0x31210e(++_0x951afd);}(_0x4874,0x12a));var _0x4487=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x4874[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4487('0x0'))(_0x4487('0x1'));var moment=require(_0x4487('0x2'));var BPromise=require(_0x4487('0x3'));var rp=require(_0x4487('0x4'));var fs=require('fs');var path=require(_0x4487('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4487('0x6'));module[_0x4487('0x7')]=function(_0x38d348,_0x3a141a){return _0x38d348['define'](_0x4487('0x8'),attributes,{'tableName':_0x4487('0x9'),'paranoid':![],'indexes':[{'name':_0x4487('0xa'),'fields':[_0x4487('0xb'),_0x4487('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5dcd=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./userProfileSection.attributes'];(function(_0x158a82,_0x1f0dd7){var _0xa0b2d3=function(_0x4e8d58){while(--_0x4e8d58){_0x158a82['push'](_0x158a82['shift']());}};_0xa0b2d3(++_0x1f0dd7);}(_0x5dcd,0xbb));var _0xd5dc=function(_0x504e77,_0x2fbb13){_0x504e77=_0x504e77-0x0;var _0x1fe761=_0x5dcd[_0x504e77];return _0x1fe761;};'use strict';var _=require(_0xd5dc('0x0'));var util=require(_0xd5dc('0x1'));var logger=require(_0xd5dc('0x2'))(_0xd5dc('0x3'));var moment=require(_0xd5dc('0x4'));var BPromise=require(_0xd5dc('0x5'));var rp=require(_0xd5dc('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd5dc('0x7'));module[_0xd5dc('0x8')]=function(_0x405d74,_0x5d71f8){return _0x405d74[_0xd5dc('0x9')](_0xd5dc('0xa'),attributes,{'tableName':_0xd5dc('0xb'),'paranoid':![],'indexes':[{'name':_0xd5dc('0xc'),'fields':[_0xd5dc('0xd'),_0xd5dc('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 24e2e26..81163b5 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 _0x5c09=['http','request','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1af420,_0x4ad7c5){var _0x572d5f=function(_0x21f872){while(--_0x21f872){_0x1af420['push'](_0x1af420['shift']());}};_0x572d5f(++_0x4ad7c5);}(_0x5c09,0x1f0));var _0x95c0=function(_0x474226,_0x395b8a){_0x474226=_0x474226-0x0;var _0x484811=_0x5c09[_0x474226];return _0x484811;};'use strict';var _=require('lodash');var util=require(_0x95c0('0x0'));var moment=require(_0x95c0('0x1'));var BPromise=require(_0x95c0('0x2'));var rs=require(_0x95c0('0x3'));var fs=require('fs');var Redis=require(_0x95c0('0x4'));var db=require(_0x95c0('0x5'))['db'];var utils=require(_0x95c0('0x6'));var logger=require(_0x95c0('0x7'))(_0x95c0('0x8'));var config=require(_0x95c0('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x95c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19c8b4,_0x592f4e,_0x5a8f65){return new BPromise(function(_0x10c665,_0x1a0e58){return client[_0x95c0('0xb')](_0x19c8b4,_0x5a8f65)['then'](function(_0xff0f92){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x592f4e,_0x95c0('0xc'));logger[_0x95c0('0xd')](_0x95c0('0xe'),_0x592f4e,_0x95c0('0xc'),JSON[_0x95c0('0xf')](_0xff0f92));if(_0xff0f92[_0x95c0('0x10')]){if(_0xff0f92['error'][_0x95c0('0x11')]===0x1f4){logger['error'](_0x95c0('0x12'),_0x592f4e,_0xff0f92[_0x95c0('0x10')]['message']);return _0x1a0e58(_0xff0f92[_0x95c0('0x10')][_0x95c0('0x13')]);}logger[_0x95c0('0x10')](_0x95c0('0x12'),_0x592f4e,_0xff0f92['error'][_0x95c0('0x13')]);return _0x10c665(_0xff0f92[_0x95c0('0x10')][_0x95c0('0x13')]);}else{logger[_0x95c0('0x14')](_0x95c0('0x12'),_0x592f4e,_0x95c0('0xc'));_0x10c665(_0xff0f92[_0x95c0('0x15')][_0x95c0('0x13')]);}})[_0x95c0('0x16')](function(_0x27263a){logger['error'](_0x95c0('0x12'),_0x592f4e,_0x27263a);_0x1a0e58(_0x27263a);});});} \ No newline at end of file +var _0x325e=['code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x54c913,_0x3b9057){var _0x4fd1aa=function(_0x40f435){while(--_0x40f435){_0x54c913['push'](_0x54c913['shift']());}};_0x4fd1aa(++_0x3b9057);}(_0x325e,0xc1));var _0xe325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x325e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe325('0x0'));var util=require(_0xe325('0x1'));var moment=require('moment');var BPromise=require(_0xe325('0x2'));var rs=require(_0xe325('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe325('0x4'))['db'];var utils=require(_0xe325('0x5'));var logger=require(_0xe325('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe325('0x7')][_0xe325('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ec995,_0x16ca23,_0x57b62c){return new BPromise(function(_0x3da76a,_0x2987be){return client[_0xe325('0x9')](_0x2ec995,_0x57b62c)['then'](function(_0x21efd9){logger[_0xe325('0xa')](_0xe325('0xb'),_0x16ca23,_0xe325('0xc'));logger['debug'](_0xe325('0xd'),_0x16ca23,_0xe325('0xc'),JSON[_0xe325('0xe')](_0x21efd9));if(_0x21efd9[_0xe325('0xf')]){if(_0x21efd9[_0xe325('0xf')][_0xe325('0x10')]===0x1f4){logger[_0xe325('0xf')](_0xe325('0xb'),_0x16ca23,_0x21efd9[_0xe325('0xf')][_0xe325('0x11')]);return _0x2987be(_0x21efd9[_0xe325('0xf')][_0xe325('0x11')]);}logger[_0xe325('0xf')](_0xe325('0xb'),_0x16ca23,_0x21efd9[_0xe325('0xf')][_0xe325('0x11')]);return _0x3da76a(_0x21efd9['error'][_0xe325('0x11')]);}else{logger['info'](_0xe325('0xb'),_0x16ca23,_0xe325('0xc'));_0x3da76a(_0x21efd9['result'][_0xe325('0x11')]);}})[_0xe325('0x12')](function(_0x58a1d2){logger['error'](_0xe325('0xb'),_0x16ca23,_0x58a1d2);_0x2987be(_0x58a1d2);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index c2b552d..6953c92 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x314817,_0x24d8fa){var _0x18053a=function(_0x2646da){while(--_0x2646da){_0x314817['push'](_0x314817['shift']());}};_0x18053a(++_0x24d8fa);}(_0x70e0,0x17b));var _0x070e=function(_0x2fc72d,_0x157ffa){_0x2fc72d=_0x2fc72d-0x0;var _0x526f6b=_0x70e0[_0x2fc72d];return _0x526f6b;};'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(_0x1f0eb6,_0x3c763c){var _0xef43e3=function(_0x1139f7){while(--_0x1139f7){_0x1f0eb6['push'](_0x1f0eb6['shift']());}};_0xef43e3(++_0x3c763c);}(_0x70e0,0x17b));var _0x070e=function(_0x29314d,_0x440e36){_0x29314d=_0x29314d-0x0;var _0x4db8e4=_0x70e0[_0x29314d];return _0x4db8e4;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 53a273e..0570195 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 _0xc73e=['INTEGER','sequelize','exports'];(function(_0x50af62,_0x53aa44){var _0x2535e3=function(_0x7d0b96){while(--_0x7d0b96){_0x50af62['push'](_0x50af62['shift']());}};_0x2535e3(++_0x53aa44);}(_0xc73e,0x1c3));var _0xec73=function(_0x5b8b0d,_0x58f554){_0x5b8b0d=_0x5b8b0d-0x0;var _0x18c961=_0xc73e[_0x5b8b0d];return _0x18c961;};'use strict';var Sequelize=require(_0xec73('0x0'));module[_0xec73('0x1')]={'penalty':{'type':Sequelize[_0xec73('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7b1f=['sequelize','exports','INTEGER'];(function(_0x2b5748,_0x54a916){var _0x83300a=function(_0x2733d2){while(--_0x2733d2){_0x2b5748['push'](_0x2b5748['shift']());}};_0x83300a(++_0x54a916);}(_0x7b1f,0xab));var _0xf7b1=function(_0x282712,_0x489bbe){_0x282712=_0x282712-0x0;var _0xc1c850=_0x7b1f[_0x282712];return _0xc1c850;};'use strict';var Sequelize=require(_0xf7b1('0x0'));module[_0xf7b1('0x1')]={'penalty':{'type':Sequelize[_0xf7b1('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index f7a52cc..737fd23 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 _0x07e8=['request-promise','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','moment'];(function(_0x239f0d,_0x27c600){var _0x23d1f2=function(_0x13624c){while(--_0x13624c){_0x239f0d['push'](_0x239f0d['shift']());}};_0x23d1f2(++_0x27c600);}(_0x07e8,0x10f));var _0x807e=function(_0x1afa63,_0x4be557){_0x1afa63=_0x1afa63-0x0;var _0x9d290e=_0x07e8[_0x1afa63];return _0x9d290e;};'use strict';var _=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var logger=require(_0x807e('0x2'))('api');var moment=require(_0x807e('0x3'));var BPromise=require('bluebird');var rp=require(_0x807e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x807e('0x5'));var attributes=require(_0x807e('0x6'));module[_0x807e('0x7')]=function(_0x59981c,_0x5a768b){return _0x59981c[_0x807e('0x8')](_0x807e('0x9'),attributes,{'tableName':_0x807e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x187d=['define','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes'];(function(_0x216ef2,_0x3abfbe){var _0x317198=function(_0x3ea85d){while(--_0x3ea85d){_0x216ef2['push'](_0x216ef2['shift']());}};_0x317198(++_0x3abfbe);}(_0x187d,0x93));var _0xd187=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x187d[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 450724d..b127f74 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 _0x91c7=['client','then','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1ba64a,_0x5981c0){var _0x24de90=function(_0x22b116){while(--_0x22b116){_0x1ba64a['push'](_0x1ba64a['shift']());}};_0x24de90(++_0x5981c0);}(_0x91c7,0x90));var _0x791c=function(_0x9ffdd8,_0x414bbd){_0x9ffdd8=_0x9ffdd8-0x0;var _0x222710=_0x91c7[_0x9ffdd8];return _0x222710;};'use strict';var _=require('lodash');var util=require(_0x791c('0x0'));var moment=require(_0x791c('0x1'));var BPromise=require(_0x791c('0x2'));var rs=require(_0x791c('0x3'));var fs=require('fs');var Redis=require(_0x791c('0x4'));var db=require(_0x791c('0x5'))['db'];var utils=require(_0x791c('0x6'));var logger=require(_0x791c('0x7'))('rpc');var config=require(_0x791c('0x8'));var jayson=require(_0x791c('0x9'));var client=jayson[_0x791c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x554434,_0x485cd6,_0x4e78cf){return new BPromise(function(_0x4a126d,_0x2765f){return client['request'](_0x554434,_0x4e78cf)[_0x791c('0xb')](function(_0xb33e6e){logger['info'](_0x791c('0xc'),_0x485cd6,'request\x20sent');logger[_0x791c('0xd')](_0x791c('0xe'),_0x485cd6,_0x791c('0xf'),JSON[_0x791c('0x10')](_0xb33e6e));if(_0xb33e6e[_0x791c('0x11')]){if(_0xb33e6e[_0x791c('0x11')]['code']===0x1f4){logger[_0x791c('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x485cd6,_0xb33e6e[_0x791c('0x11')][_0x791c('0x12')]);return _0x2765f(_0xb33e6e[_0x791c('0x11')][_0x791c('0x12')]);}logger[_0x791c('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x485cd6,_0xb33e6e[_0x791c('0x11')][_0x791c('0x12')]);return _0x4a126d(_0xb33e6e['error'][_0x791c('0x12')]);}else{logger[_0x791c('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x485cd6,_0x791c('0xf'));_0x4a126d(_0xb33e6e[_0x791c('0x14')][_0x791c('0x12')]);}})[_0x791c('0x15')](function(_0xaa98f6){logger[_0x791c('0x11')](_0x791c('0xc'),_0x485cd6,_0xaa98f6);_0x2765f(_0xaa98f6);});});} \ No newline at end of file +var _0xd082=['message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s'];(function(_0x1cb009,_0x2a8616){var _0x4f4085=function(_0x5e2aaa){while(--_0x5e2aaa){_0x1cb009['push'](_0x1cb009['shift']());}};_0x4f4085(++_0x2a8616);}(_0xd082,0x17d));var _0x2d08=function(_0x2d6678,_0x5ba756){_0x2d6678=_0x2d6678-0x0;var _0x2daa5a=_0xd082[_0x2d6678];return _0x2daa5a;};'use strict';var _=require('lodash');var util=require(_0x2d08('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2d08('0x1'));var fs=require('fs');var Redis=require(_0x2d08('0x2'));var db=require(_0x2d08('0x3'))['db'];var utils=require(_0x2d08('0x4'));var logger=require('../../config/logger')(_0x2d08('0x5'));var config=require(_0x2d08('0x6'));var jayson=require(_0x2d08('0x7'));var client=jayson[_0x2d08('0x8')][_0x2d08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d3854,_0x17071b,_0x668051){return new BPromise(function(_0x19856f,_0x50ccb3){return client['request'](_0x4d3854,_0x668051)['then'](function(_0x408485){logger[_0x2d08('0xa')]('UserSmsQueue,\x20%s,\x20%s',_0x17071b,_0x2d08('0xb'));logger[_0x2d08('0xc')](_0x2d08('0xd'),_0x17071b,'request\x20sent',JSON[_0x2d08('0xe')](_0x408485));if(_0x408485['error']){if(_0x408485[_0x2d08('0xf')][_0x2d08('0x10')]===0x1f4){logger[_0x2d08('0xf')](_0x2d08('0x11'),_0x17071b,_0x408485['error'][_0x2d08('0x12')]);return _0x50ccb3(_0x408485['error'][_0x2d08('0x12')]);}logger[_0x2d08('0xf')](_0x2d08('0x11'),_0x17071b,_0x408485[_0x2d08('0xf')][_0x2d08('0x12')]);return _0x19856f(_0x408485[_0x2d08('0xf')]['message']);}else{logger[_0x2d08('0xa')](_0x2d08('0x11'),_0x17071b,_0x2d08('0xb'));_0x19856f(_0x408485[_0x2d08('0x13')][_0x2d08('0x12')]);}})[_0x2d08('0x14')](function(_0x3fde5d){logger['error'](_0x2d08('0x11'),_0x17071b,_0x3fde5d);_0x50ccb3(_0x3fde5d);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index d0d4b28..4070f75 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa38b=['INTEGER'];(function(_0x42ca15,_0x193ccb){var _0x1c6ded=function(_0x40989a){while(--_0x40989a){_0x42ca15['push'](_0x42ca15['shift']());}};_0x1c6ded(++_0x193ccb);}(_0xa38b,0xe4));var _0xba38=function(_0x519228,_0x2bcbc2){_0x519228=_0x519228-0x0;var _0xc3c605=_0xa38b[_0x519228];return _0xc3c605;};'use strict';var Sequelize=require('sequelize');module['exports']={'UserId':{'type':Sequelize[_0xba38('0x0')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9896=['exports','INTEGER','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9896,0x98));var _0x6989=function(_0x109da6,_0xefd780){_0x109da6=_0x109da6-0x0;var _0x318a22=_0x9896[_0x109da6];return _0x318a22;};'use strict';var Sequelize=require(_0x6989('0x0'));module[_0x6989('0x1')]={'UserId':{'type':Sequelize[_0x6989('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6989('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 15a5740..049c8a3 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x2c4f8f,_0x46658c){var _0x51e6a2=function(_0x54eab5){while(--_0x54eab5){_0x2c4f8f['push'](_0x2c4f8f['shift']());}};_0x51e6a2(++_0x46658c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x9b21e0,_0x25130a){var _0x2e4ddf=function(_0x2ef4dd){while(--_0x2ef4dd){_0x9b21e0['push'](_0x9b21e0['shift']());}};_0x2e4ddf(++_0x25130a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 804176e..294a6e8 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3171e8,_0x4a22e4){var _0x253145=function(_0x4c34ad){while(--_0x4c34ad){_0x3171e8['push'](_0x3171e8['shift']());}};_0x253145(++_0x4a22e4);}(_0xe706,0xa3));var _0x6e70=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0xe706[_0xadde88];return _0x3b8eb6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x742767,_0xfee16a){var _0xa89319=function(_0x2647dd){while(--_0x2647dd){_0x742767['push'](_0x742767['shift']());}};_0xa89319(++_0xfee16a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index d2cf2e8..efad0e7 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 _0x73a0=['exports','INTEGER','sequelize'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x73a0,0x1bb));var _0x073a=function(_0x239917,_0xd0e0c8){_0x239917=_0x239917-0x0;var _0x114c6d=_0x73a0[_0x239917];return _0x114c6d;};'use strict';var Sequelize=require(_0x073a('0x0'));module[_0x073a('0x1')]={'penalty':{'type':Sequelize[_0x073a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2c7b=['exports','sequelize'];(function(_0x1477cf,_0xa2f31d){var _0xe3e3ac=function(_0x22b11b){while(--_0x22b11b){_0x1477cf['push'](_0x1477cf['shift']());}};_0xe3e3ac(++_0xa2f31d);}(_0x2c7b,0x1af));var _0xb2c7=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x2c7b[_0xa1e3e3];return _0xc980e9;};'use strict';var Sequelize=require(_0xb2c7('0x0'));module[_0xb2c7('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index fbf177c..9f0c644 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 _0x7a16=['user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','UserVoiceQueue'];(function(_0x65d12e,_0x4b0a30){var _0x4274e0=function(_0x121624){while(--_0x121624){_0x65d12e['push'](_0x65d12e['shift']());}};_0x4274e0(++_0x4b0a30);}(_0x7a16,0x151));var _0x67a1=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7a16[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x67a1('0x0'));var util=require(_0x67a1('0x1'));var logger=require(_0x67a1('0x2'))(_0x67a1('0x3'));var moment=require(_0x67a1('0x4'));var BPromise=require(_0x67a1('0x5'));var rp=require(_0x67a1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x67a1('0x7'));var attributes=require('./userVoiceQueue.attributes');module[_0x67a1('0x8')]=function(_0xcedad8,_0x4eab65){return _0xcedad8[_0x67a1('0x9')](_0x67a1('0xa'),attributes,{'tableName':_0x67a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa96=['user_has_voice_queues','lodash','util','path','rimraf','../../config/environment','./userVoiceQueue.attributes'];(function(_0x214890,_0x2562c0){var _0x760050=function(_0x29742c){while(--_0x29742c){_0x214890['push'](_0x214890['shift']());}};_0x760050(++_0x2562c0);}(_0xfa96,0xa9));var _0x6fa9=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xfa96[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x6fa9('0x0'));var util=require(_0x6fa9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fa9('0x2'));var rimraf=require(_0x6fa9('0x3'));var config=require(_0x6fa9('0x4'));var attributes=require(_0x6fa9('0x5'));module['exports']=function(_0x1059b3,_0x48f92c){return _0x1059b3['define']('UserVoiceQueue',attributes,{'tableName':_0x6fa9('0x6'),'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 65e5b50..1020da2 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 _0x3407=['code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','UserVoiceQueue,\x20%s,\x20%s','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x344539,_0xc7861a){var _0x43f484=function(_0x27d1ac){while(--_0x27d1ac){_0x344539['push'](_0x344539['shift']());}};_0x43f484(++_0xc7861a);}(_0x3407,0x179));var _0x7340=function(_0x91ebe,_0x1718d6){_0x91ebe=_0x91ebe-0x0;var _0x2fdc7f=_0x3407[_0x91ebe];return _0x2fdc7f;};'use strict';var _=require(_0x7340('0x0'));var util=require(_0x7340('0x1'));var moment=require(_0x7340('0x2'));var BPromise=require(_0x7340('0x3'));var rs=require(_0x7340('0x4'));var fs=require('fs');var Redis=require(_0x7340('0x5'));var db=require(_0x7340('0x6'))['db'];var utils=require(_0x7340('0x7'));var logger=require(_0x7340('0x8'))(_0x7340('0x9'));var config=require(_0x7340('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7340('0xb')][_0x7340('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1976fe,_0x4a2aa6,_0x11a52b){return new BPromise(function(_0x86a0a6,_0x526348){return client['request'](_0x1976fe,_0x11a52b)[_0x7340('0xd')](function(_0x57fd36){logger['info'](_0x7340('0xe'),_0x4a2aa6,'request\x20sent');logger['debug'](_0x7340('0xf'),_0x4a2aa6,_0x7340('0x10'),JSON[_0x7340('0x11')](_0x57fd36));if(_0x57fd36['error']){if(_0x57fd36[_0x7340('0x12')][_0x7340('0x13')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4a2aa6,_0x57fd36['error']['message']);return _0x526348(_0x57fd36[_0x7340('0x12')][_0x7340('0x14')]);}logger[_0x7340('0x12')](_0x7340('0xe'),_0x4a2aa6,_0x57fd36['error']['message']);return _0x86a0a6(_0x57fd36[_0x7340('0x12')][_0x7340('0x14')]);}else{logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x4a2aa6,_0x7340('0x10'));_0x86a0a6(_0x57fd36['result'][_0x7340('0x14')]);}})[_0x7340('0x15')](function(_0xa41764){logger[_0x7340('0x12')](_0x7340('0xe'),_0x4a2aa6,_0xa41764);_0x526348(_0xa41764);});});} \ No newline at end of file +var _0xf524=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d0948,_0x29a5ad){var _0x405614=function(_0x1ac2af){while(--_0x1ac2af){_0x1d0948['push'](_0x1d0948['shift']());}};_0x405614(++_0x29a5ad);}(_0xf524,0xef));var _0x4f52=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xf524[_0x1a87b3];return _0x37e84d;};'use strict';var _=require(_0x4f52('0x0'));var util=require(_0x4f52('0x1'));var moment=require(_0x4f52('0x2'));var BPromise=require(_0x4f52('0x3'));var rs=require(_0x4f52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f52('0x5'))['db'];var utils=require(_0x4f52('0x6'));var logger=require(_0x4f52('0x7'))(_0x4f52('0x8'));var config=require(_0x4f52('0x9'));var jayson=require(_0x4f52('0xa'));var client=jayson['client'][_0x4f52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x489e50,_0x3b3f3d,_0x46f68e){return new BPromise(function(_0x22e89a,_0x357819){return client[_0x4f52('0xc')](_0x489e50,_0x46f68e)[_0x4f52('0xd')](function(_0x355901){logger[_0x4f52('0xe')](_0x4f52('0xf'),_0x3b3f3d,_0x4f52('0x10'));logger[_0x4f52('0x11')](_0x4f52('0x12'),_0x3b3f3d,_0x4f52('0x10'),JSON[_0x4f52('0x13')](_0x355901));if(_0x355901[_0x4f52('0x14')]){if(_0x355901[_0x4f52('0x14')][_0x4f52('0x15')]===0x1f4){logger[_0x4f52('0x14')]('UserVoiceQueue,\x20%s,\x20%s',_0x3b3f3d,_0x355901[_0x4f52('0x14')][_0x4f52('0x16')]);return _0x357819(_0x355901['error'][_0x4f52('0x16')]);}logger[_0x4f52('0x14')](_0x4f52('0xf'),_0x3b3f3d,_0x355901['error']['message']);return _0x22e89a(_0x355901['error'][_0x4f52('0x16')]);}else{logger[_0x4f52('0xe')](_0x4f52('0xf'),_0x3b3f3d,'request\x20sent');_0x22e89a(_0x355901[_0x4f52('0x17')][_0x4f52('0x16')]);}})[_0x4f52('0x18')](function(_0x249ad1){logger[_0x4f52('0x14')](_0x4f52('0xf'),_0x3b3f3d,_0x249ad1);_0x357819(_0x249ad1);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 91bd52e..3a1c83c 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x59adc9,_0x55995c){var _0x3fdfca=function(_0x58e7d5){while(--_0x58e7d5){_0x59adc9['push'](_0x59adc9['shift']());}};_0x3fdfca(++_0x55995c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4c9cf2,_0x42dad9){var _0x2c25c8=function(_0x2582b0){while(--_0x2582b0){_0x4c9cf2['push'](_0x4c9cf2['shift']());}};_0x2c25c8(++_0x42dad9);}(_0x70e0,0x17b));var _0x070e=function(_0x16202f,_0x21794f){_0x16202f=_0x16202f-0x0;var _0x37056d=_0x70e0[_0x16202f];return _0x37056d;};'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/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index a7c37a6..303281a 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 _0x1ba8=['queue_interface','sequelize','Required\x20by\x20Asterisk','INTEGER'];(function(_0x12916b,_0x3ba82d){var _0x58d533=function(_0xd83c7c){while(--_0xd83c7c){_0x12916b['push'](_0x12916b['shift']());}};_0x58d533(++_0x3ba82d);}(_0x1ba8,0x10d));var _0x81ba=function(_0x7ee80f,_0x4b2d58){_0x7ee80f=_0x7ee80f-0x0;var _0x11fc8e=_0x1ba8[_0x7ee80f];return _0x11fc8e;};'use strict';var Sequelize=require(_0x81ba('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x81ba('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x81ba('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x81ba('0x1')},'VoiceQueueId':{'type':Sequelize[_0x81ba('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x81ba('0x3'),'comment':_0x81ba('0x1')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x81ba('0x2')](0xb),'defaultValue':0x0,'comment':_0x81ba('0x1')}}; \ No newline at end of file +var _0xcd90=['queue_interface','Required\x20by\x20Asterisk','sequelize','exports','INTEGER','STRING'];(function(_0x6aeb0a,_0x343141){var _0x541946=function(_0x59e95c){while(--_0x59e95c){_0x6aeb0a['push'](_0x6aeb0a['shift']());}};_0x541946(++_0x343141);}(_0xcd90,0x8c));var _0x0cd9=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xcd90[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require(_0x0cd9('0x0'));module[_0x0cd9('0x1')]={'uniqueid':{'type':Sequelize[_0x0cd9('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x0cd9('0x3')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x0cd9('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0cd9('0x4'),'comment':_0x0cd9('0x5')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x0cd9('0x3')],'allowNull':![],'unique':_0x0cd9('0x4'),'comment':_0x0cd9('0x5')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x0cd9('0x5')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index c12d639..51b0207 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 _0x5cfb=['UserVoiceQueueRt','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x39ff8b,_0x39e7ff){var _0x173aae=function(_0x2844f7){while(--_0x2844f7){_0x39ff8b['push'](_0x39ff8b['shift']());}};_0x173aae(++_0x39e7ff);}(_0x5cfb,0x18e));var _0xb5cf=function(_0x221c9b,_0x5c19c2){_0x221c9b=_0x221c9b-0x0;var _0x25aee4=_0x5cfb[_0x221c9b];return _0x25aee4;};'use strict';var EventEmitter=require(_0xb5cf('0x0'));var UserVoiceQueueRt=require(_0xb5cf('0x1'))['db'][_0xb5cf('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb5cf('0x3')](0x0);var events={'afterCreate':_0xb5cf('0x4'),'afterUpdate':'update','afterDestroy':_0xb5cf('0x5')};function emitEvent(_0x32ecf1){return function(_0x50a080,_0x427379,_0x5c5943){UserVoiceQueueRtEvents[_0xb5cf('0x6')](_0x32ecf1+':'+_0x50a080['id'],_0x50a080);UserVoiceQueueRtEvents['emit'](_0x32ecf1,_0x50a080);_0x5c5943(null);};}for(var e in events){if(events[_0xb5cf('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xb5cf('0x8')](e,emitEvent(event));}}module[_0xb5cf('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x14c0=['hasOwnProperty','events','UserVoiceQueueRt','setMaxListeners','save','update','emit'];(function(_0x10dbf6,_0x3ff964){var _0x452147=function(_0x7476e0){while(--_0x7476e0){_0x10dbf6['push'](_0x10dbf6['shift']());}};_0x452147(++_0x3ff964);}(_0x14c0,0x1b3));var _0x014c=function(_0x5f037f,_0x3af88e){_0x5f037f=_0x5f037f-0x0;var _0x52c046=_0x14c0[_0x5f037f];return _0x52c046;};'use strict';var EventEmitter=require(_0x014c('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x014c('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x014c('0x2')](0x0);var events={'afterCreate':_0x014c('0x3'),'afterUpdate':_0x014c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2cc21c){return function(_0x4c920c,_0x126453,_0x583470){UserVoiceQueueRtEvents['emit'](_0x2cc21c+':'+_0x4c920c['id'],_0x4c920c);UserVoiceQueueRtEvents[_0x014c('0x5')](_0x2cc21c,_0x4c920c);_0x583470(null);};}for(var e in events){if(events[_0x014c('0x6')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index c72900d..c90f61e 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 _0x8439=['moment','bluebird','path','../../config/environment','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api'];(function(_0x1da4cb,_0x3ad0b6){var _0x43465f=function(_0x2653e0){while(--_0x2653e0){_0x1da4cb['push'](_0x1da4cb['shift']());}};_0x43465f(++_0x3ad0b6);}(_0x8439,0x80));var _0x9843=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x8439[_0x344a3f];return _0x264712;};'use strict';var _=require(_0x9843('0x0'));var util=require(_0x9843('0x1'));var logger=require(_0x9843('0x2'))(_0x9843('0x3'));var moment=require(_0x9843('0x4'));var BPromise=require(_0x9843('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9843('0x6'));var rimraf=require('rimraf');var config=require(_0x9843('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x43e219,_0x3cf93a){return _0x43e219[_0x9843('0x8')](_0x9843('0x9'),attributes,{'tableName':_0x9843('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e37=['./userVoiceQueueRt.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x8e37,0x1ba));var _0x78e3=function(_0x364fca,_0x416884){_0x364fca=_0x364fca-0x0;var _0x238b50=_0x8e37[_0x364fca];return _0x238b50;};'use strict';var _=require(_0x78e3('0x0'));var util=require(_0x78e3('0x1'));var logger=require(_0x78e3('0x2'))(_0x78e3('0x3'));var moment=require(_0x78e3('0x4'));var BPromise=require(_0x78e3('0x5'));var rp=require(_0x78e3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x78e3('0x7'));var config=require('../../config/environment');var attributes=require(_0x78e3('0x8'));module['exports']=function(_0x267605,_0x3a12a8){return _0x267605[_0x78e3('0x9')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 6e3df43..30feae8 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 _0xdb81=['client','defaults','redis','localhost','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3af5a0,_0x23c697){var _0x4e8586=function(_0x7cb7c){while(--_0x7cb7c){_0x3af5a0['push'](_0x3af5a0['shift']());}};_0x4e8586(++_0x23c697);}(_0xdb81,0x111));var _0x1db8=function(_0x2ce9c9,_0x187210){_0x2ce9c9=_0x2ce9c9-0x0;var _0x153aaa=_0xdb81[_0x2ce9c9];return _0x153aaa;};'use strict';var _=require('lodash');var util=require(_0x1db8('0x0'));var moment=require(_0x1db8('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1db8('0x2'))['db'];var utils=require(_0x1db8('0x3'));var logger=require(_0x1db8('0x4'))('rpc');var config=require(_0x1db8('0x5'));var jayson=require(_0x1db8('0x6'));var client=jayson[_0x1db8('0x7')]['http']({'port':0x232a});config['redis']=_[_0x1db8('0x8')](config[_0x1db8('0x9')],{'host':_0x1db8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x1db8('0xb')](socket);function respondWithRpcPromise(_0x2a516d,_0x2e4428,_0x6e7bae){return new BPromise(function(_0x4d3d02,_0xf9253){return client[_0x1db8('0xc')](_0x2a516d,_0x6e7bae)[_0x1db8('0xd')](function(_0x2235b4){logger[_0x1db8('0xe')](_0x1db8('0xf'),_0x2e4428,_0x1db8('0x10'));logger[_0x1db8('0x11')](_0x1db8('0x12'),_0x2e4428,'request\x20sent',JSON['stringify'](_0x2235b4));if(_0x2235b4[_0x1db8('0x13')]){if(_0x2235b4[_0x1db8('0x13')][_0x1db8('0x14')]===0x1f4){logger[_0x1db8('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2e4428,_0x2235b4['error']['message']);return _0xf9253(_0x2235b4[_0x1db8('0x13')][_0x1db8('0x15')]);}logger[_0x1db8('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x2e4428,_0x2235b4[_0x1db8('0x13')][_0x1db8('0x15')]);return _0x4d3d02(_0x2235b4[_0x1db8('0x13')][_0x1db8('0x15')]);}else{logger[_0x1db8('0xe')](_0x1db8('0xf'),_0x2e4428,_0x1db8('0x10'));_0x4d3d02(_0x2235b4[_0x1db8('0x16')][_0x1db8('0x15')]);}})[_0x1db8('0x17')](function(_0x2ffd97){logger[_0x1db8('0x13')](_0x1db8('0xf'),_0x2e4428,_0x2ffd97);_0xf9253(_0x2ffd97);});});}exports[_0x1db8('0x18')]=function(_0x2948c0){var _0xe398cc=this;return new Promise(function(_0x59a5fe,_0x237376){return db['UserVoiceQueueRt'][_0x1db8('0x19')]({'raw':_0x2948c0[_0x1db8('0x1a')]?_0x2948c0[_0x1db8('0x1a')][_0x1db8('0x1b')]===undefined?!![]:![]:!![],'where':_0x2948c0[_0x1db8('0x1a')]?_0x2948c0[_0x1db8('0x1a')][_0x1db8('0x1c')]||null:null,'attributes':[[db[_0x1db8('0x1d')]['fn'](_0x1db8('0x1e'),db[_0x1db8('0x1d')]['fn']('IF',db[_0x1db8('0x1d')][_0x1db8('0x1f')](_0x1db8('0x20')))),_0x1db8('0x21')]]})[_0x1db8('0xd')](function(_0x25d765){logger[_0x1db8('0xe')]('GetVoiceQueueRtPauses',_0x2948c0);logger[_0x1db8('0x11')]('GetVoiceQueueRtPauses',_0x2948c0,JSON[_0x1db8('0x22')](_0x25d765));_0x59a5fe(_0x25d765);})[_0x1db8('0x17')](function(_0x5eb096){logger[_0x1db8('0x13')](_0x1db8('0x18'),_0x5eb096[_0x1db8('0x15')],_0x2948c0);_0x237376(_0xe398cc[_0x1db8('0x13')](0x1f4,_0x5eb096[_0x1db8('0x15')]));});});}; \ No newline at end of file +var _0xaba2=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','util','bluebird','randomstring','ioredis'];(function(_0x42ab4d,_0x30c9d5){var _0x234f1a=function(_0x1790ba){while(--_0x1790ba){_0x42ab4d['push'](_0x42ab4d['shift']());}};_0x234f1a(++_0x30c9d5);}(_0xaba2,0x1d0));var _0x2aba=function(_0x1b4ed0,_0x576ea8){_0x1b4ed0=_0x1b4ed0-0x0;var _0x52bcd4=_0xaba2[_0x1b4ed0];return _0x52bcd4;};'use strict';var _=require('lodash');var util=require(_0x2aba('0x0'));var moment=require('moment');var BPromise=require(_0x2aba('0x1'));var rs=require(_0x2aba('0x2'));var fs=require('fs');var Redis=require(_0x2aba('0x3'));var db=require(_0x2aba('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2aba('0x5'))(_0x2aba('0x6'));var config=require(_0x2aba('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2aba('0x8')][_0x2aba('0x9')]({'port':0x232a});config[_0x2aba('0xa')]=_[_0x2aba('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2aba('0xa')]));require(_0x2aba('0xc'))['register'](socket);function respondWithRpcPromise(_0x2c7d92,_0x3e223f,_0x1e8529){return new BPromise(function(_0x46bbcf,_0x291807){return client[_0x2aba('0xd')](_0x2c7d92,_0x1e8529)[_0x2aba('0xe')](function(_0x5649cb){logger[_0x2aba('0xf')](_0x2aba('0x10'),_0x3e223f,_0x2aba('0x11'));logger[_0x2aba('0x12')](_0x2aba('0x13'),_0x3e223f,_0x2aba('0x11'),JSON['stringify'](_0x5649cb));if(_0x5649cb[_0x2aba('0x14')]){if(_0x5649cb[_0x2aba('0x14')]['code']===0x1f4){logger[_0x2aba('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3e223f,_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);return _0x291807(_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3e223f,_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);return _0x46bbcf(_0x5649cb[_0x2aba('0x14')][_0x2aba('0x15')]);}else{logger[_0x2aba('0xf')](_0x2aba('0x10'),_0x3e223f,_0x2aba('0x11'));_0x46bbcf(_0x5649cb[_0x2aba('0x16')]['message']);}})[_0x2aba('0x17')](function(_0x437de2){logger[_0x2aba('0x14')](_0x2aba('0x10'),_0x3e223f,_0x437de2);_0x291807(_0x437de2);});});}exports[_0x2aba('0x18')]=function(_0x1b4276){var _0x50b0b9=this;return new Promise(function(_0x5d0f29,_0x194622){return db[_0x2aba('0x19')][_0x2aba('0x1a')]({'raw':_0x1b4276[_0x2aba('0x1b')]?_0x1b4276[_0x2aba('0x1b')][_0x2aba('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b4276['options']?_0x1b4276['options'][_0x2aba('0x1d')]||null:null,'attributes':[[db[_0x2aba('0x1e')]['fn'](_0x2aba('0x1f'),db['sequelize']['fn']('IF',db[_0x2aba('0x1e')][_0x2aba('0x20')](_0x2aba('0x21')))),_0x2aba('0x22')]]})[_0x2aba('0xe')](function(_0x39376a){logger[_0x2aba('0xf')](_0x2aba('0x18'),_0x1b4276);logger[_0x2aba('0x12')](_0x2aba('0x18'),_0x1b4276,JSON[_0x2aba('0x23')](_0x39376a));_0x5d0f29(_0x39376a);})['catch'](function(_0x15fd8d){logger[_0x2aba('0x14')](_0x2aba('0x18'),_0x15fd8d[_0x2aba('0x15')],_0x1b4276);_0x194622(_0x50b0b9[_0x2aba('0x14')](0x1f4,_0x15fd8d[_0x2aba('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 8aa6501..2d69f51 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 _0x4cff=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','removeListener','register','length'];(function(_0x12cbd8,_0x8ef0ce){var _0x2fb1ab=function(_0x57242c){while(--_0x57242c){_0x12cbd8['push'](_0x12cbd8['shift']());}};_0x2fb1ab(++_0x8ef0ce);}(_0x4cff,0x14a));var _0xf4cf=function(_0x480a13,_0x23d413){_0x480a13=_0x480a13-0x0;var _0x3b497f=_0x4cff[_0x480a13];return _0x3b497f;};'use strict';var UserVoiceQueueRtEvents=require(_0xf4cf('0x0'));var events=[_0xf4cf('0x1'),'remove',_0xf4cf('0x2')];function createListener(_0x59de87,_0x45a2cb){return function(_0x403891){_0x45a2cb['emit'](_0x59de87,_0x403891);};}function removeListener(_0x3d5ddc,_0x1c1936){return function(){UserVoiceQueueRtEvents[_0xf4cf('0x3')](_0x3d5ddc,_0x1c1936);};}exports[_0xf4cf('0x4')]=function(_0x4634f6){for(var _0x33c9d7=0x0,_0x53a3e6=events[_0xf4cf('0x5')];_0x33c9d7<_0x53a3e6;_0x33c9d7++){var _0x125a37=events[_0x33c9d7];var _0x1f06c6=createListener(_0xf4cf('0x6')+_0x125a37,_0x4634f6);UserVoiceQueueRtEvents['on'](_0x125a37,_0x1f06c6);}}; \ No newline at end of file +var _0x5d95=['save','update','emit','./userVoiceQueueRt.events'];(function(_0x19dd8a,_0x449861){var _0x212ccc=function(_0x4f52b6){while(--_0x4f52b6){_0x19dd8a['push'](_0x19dd8a['shift']());}};_0x212ccc(++_0x449861);}(_0x5d95,0x77));var _0x55d9=function(_0x2e038c,_0x336ca3){_0x2e038c=_0x2e038c-0x0;var _0x217730=_0x5d95[_0x2e038c];return _0x217730;};'use strict';var UserVoiceQueueRtEvents=require(_0x55d9('0x0'));var events=[_0x55d9('0x1'),'remove',_0x55d9('0x2')];function createListener(_0x2f84cc,_0x1c3868){return function(_0x2cc4fd){_0x1c3868[_0x55d9('0x3')](_0x2f84cc,_0x2cc4fd);};}function removeListener(_0x536e6d,_0xabfc0e){return function(){UserVoiceQueueRtEvents['removeListener'](_0x536e6d,_0xabfc0e);};}exports['register']=function(_0x25957e){for(var _0x4244b4=0x0,_0x5b4471=events['length'];_0x4244b4<_0x5b4471;_0x4244b4++){var _0x5d0b9d=events[_0x4244b4];var _0x5e52f8=createListener('userVoiceQueueRt:'+_0x5d0b9d,_0x25957e);UserVoiceQueueRtEvents['on'](_0x5d0b9d,_0x5e52f8);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index a07dbe9..5ae8aae 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x17e735,_0x328f40){var _0x1824d6=function(_0x4460fe){while(--_0x4460fe){_0x17e735['push'](_0x17e735['shift']());}};_0x1824d6(++_0x328f40);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2511c6,_0x5859ca){var _0x10a803=function(_0x3fb3a2){while(--_0x3fb3a2){_0x2511c6['push'](_0x2511c6['shift']());}};_0x10a803(++_0x5859ca);}(_0x9c44,0x178));var _0x49c4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x9c44[_0x1035c1];return _0x308d67;};'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 15f9ddf..b7d31cc 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 _0xc960=['sequelize','INTEGER'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xc960,0x10c));var _0x0c96=function(_0x5e47e2,_0xbdf012){_0x5e47e2=_0x5e47e2-0x0;var _0x148288=_0xc960[_0x5e47e2];return _0x148288;};'use strict';var Sequelize=require(_0x0c96('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x0c96('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfb0e=['INTEGER','sequelize','exports'];(function(_0x3a7b0d,_0x492b27){var _0x50843c=function(_0x93a01c){while(--_0x93a01c){_0x3a7b0d['push'](_0x3a7b0d['shift']());}};_0x50843c(++_0x492b27);}(_0xfb0e,0x13c));var _0xefb0=function(_0x10df18,_0x13338c){_0x10df18=_0x10df18-0x0;var _0x1f9a1d=_0xfb0e[_0x10df18];return _0x1f9a1d;};'use strict';var Sequelize=require(_0xefb0('0x0'));module[_0xefb0('0x1')]={'penalty':{'type':Sequelize[_0xefb0('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 8b13d3a..324a154 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 _0x10c6=['user_has_whatsapp_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue'];(function(_0x16e3d5,_0x1bf5db){var _0x57304e=function(_0x4f433d){while(--_0x4f433d){_0x16e3d5['push'](_0x16e3d5['shift']());}};_0x57304e(++_0x1bf5db);}(_0x10c6,0x11f));var _0x610c=function(_0x11ab02,_0x317cc8){_0x11ab02=_0x11ab02-0x0;var _0x57470b=_0x10c6[_0x11ab02];return _0x57470b;};'use strict';var _=require('lodash');var util=require(_0x610c('0x0'));var logger=require(_0x610c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x610c('0x2'));var rp=require(_0x610c('0x3'));var fs=require('fs');var path=require(_0x610c('0x4'));var rimraf=require(_0x610c('0x5'));var config=require('../../config/environment');var attributes=require(_0x610c('0x6'));module[_0x610c('0x7')]=function(_0xdd770d,_0x53bb18){return _0xdd770d[_0x610c('0x8')](_0x610c('0x9'),attributes,{'tableName':_0x610c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x40fe=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','util','../../config/logger','api','moment','request-promise'];(function(_0xf49632,_0x4b18ff){var _0x45ca81=function(_0x36556d){while(--_0x36556d){_0xf49632['push'](_0xf49632['shift']());}};_0x45ca81(++_0x4b18ff);}(_0x40fe,0x8a));var _0xe40f=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x40fe[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xe40f('0x0'));var logger=require(_0xe40f('0x1'))(_0xe40f('0x2'));var moment=require(_0xe40f('0x3'));var BPromise=require('bluebird');var rp=require(_0xe40f('0x4'));var fs=require('fs');var path=require(_0xe40f('0x5'));var rimraf=require(_0xe40f('0x6'));var config=require(_0xe40f('0x7'));var attributes=require(_0xe40f('0x8'));module[_0xe40f('0x9')]=function(_0x1c0a86,_0x4120f0){return _0x1c0a86['define'](_0xe40f('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index b2d0b8a..93f01d9 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 _0xe75e=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug'];(function(_0x2c5b4e,_0x3ad9f1){var _0x2deb11=function(_0x3137ed){while(--_0x3137ed){_0x2c5b4e['push'](_0x2c5b4e['shift']());}};_0x2deb11(++_0x3ad9f1);}(_0xe75e,0x12d));var _0xee75=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xe75e[_0x38c652];return _0x218a37;};'use strict';var _=require(_0xee75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xee75('0x1'));var rs=require(_0xee75('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee75('0x3'))['db'];var utils=require(_0xee75('0x4'));var logger=require(_0xee75('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee75('0x6'));var client=jayson[_0xee75('0x7')][_0xee75('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5aa18f,_0x5c4626,_0x56aaa7){return new BPromise(function(_0x25e5cb,_0x13fdd3){return client[_0xee75('0x9')](_0x5aa18f,_0x56aaa7)[_0xee75('0xa')](function(_0x18386b){logger[_0xee75('0xb')](_0xee75('0xc'),_0x5c4626,'request\x20sent');logger[_0xee75('0xd')](_0xee75('0xe'),_0x5c4626,_0xee75('0xf'),JSON['stringify'](_0x18386b));if(_0x18386b[_0xee75('0x10')]){if(_0x18386b[_0xee75('0x10')][_0xee75('0x11')]===0x1f4){logger[_0xee75('0x10')](_0xee75('0xc'),_0x5c4626,_0x18386b[_0xee75('0x10')][_0xee75('0x12')]);return _0x13fdd3(_0x18386b[_0xee75('0x10')][_0xee75('0x12')]);}logger[_0xee75('0x10')](_0xee75('0xc'),_0x5c4626,_0x18386b['error']['message']);return _0x25e5cb(_0x18386b[_0xee75('0x10')][_0xee75('0x12')]);}else{logger[_0xee75('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5c4626,_0xee75('0xf'));_0x25e5cb(_0x18386b[_0xee75('0x13')][_0xee75('0x12')]);}})[_0xee75('0x14')](function(_0x5cb800){logger[_0xee75('0x10')](_0xee75('0xc'),_0x5c4626,_0x5cb800);_0x13fdd3(_0x5cb800);});});} \ No newline at end of file +var _0xcf2c=['UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4fd411,_0x5ca504){var _0x1ebdcb=function(_0x1e7f58){while(--_0x1e7f58){_0x4fd411['push'](_0x4fd411['shift']());}};_0x1ebdcb(++_0x5ca504);}(_0xcf2c,0x156));var _0xccf2=function(_0x4f4e4b,_0x46ea73){_0x4f4e4b=_0x4f4e4b-0x0;var _0x23a628=_0xcf2c[_0x4f4e4b];return _0x23a628;};'use strict';var _=require('lodash');var util=require(_0xccf2('0x0'));var moment=require(_0xccf2('0x1'));var BPromise=require(_0xccf2('0x2'));var rs=require(_0xccf2('0x3'));var fs=require('fs');var Redis=require(_0xccf2('0x4'));var db=require(_0xccf2('0x5'))['db'];var utils=require(_0xccf2('0x6'));var logger=require(_0xccf2('0x7'))(_0xccf2('0x8'));var config=require(_0xccf2('0x9'));var jayson=require(_0xccf2('0xa'));var client=jayson[_0xccf2('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9f2420,_0x1118e3,_0x1ce29e){return new BPromise(function(_0x2ec384,_0x5a5ad8){return client[_0xccf2('0xc')](_0x9f2420,_0x1ce29e)[_0xccf2('0xd')](function(_0x43821e){logger[_0xccf2('0xe')](_0xccf2('0xf'),_0x1118e3,_0xccf2('0x10'));logger[_0xccf2('0x11')](_0xccf2('0x12'),_0x1118e3,_0xccf2('0x10'),JSON[_0xccf2('0x13')](_0x43821e));if(_0x43821e[_0xccf2('0x14')]){if(_0x43821e['error'][_0xccf2('0x15')]===0x1f4){logger['error'](_0xccf2('0xf'),_0x1118e3,_0x43821e[_0xccf2('0x14')][_0xccf2('0x16')]);return _0x5a5ad8(_0x43821e[_0xccf2('0x14')][_0xccf2('0x16')]);}logger[_0xccf2('0x14')](_0xccf2('0xf'),_0x1118e3,_0x43821e[_0xccf2('0x14')]['message']);return _0x2ec384(_0x43821e[_0xccf2('0x14')]['message']);}else{logger[_0xccf2('0xe')](_0xccf2('0xf'),_0x1118e3,_0xccf2('0x10'));_0x2ec384(_0x43821e[_0xccf2('0x17')][_0xccf2('0x16')]);}})['catch'](function(_0x598102){logger[_0xccf2('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1118e3,_0x598102);_0x5a5ad8(_0x598102);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index bc8e488..ea31cf1 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 _0x8664=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','isAuthenticated','index','get','/:id','show','create','put','delete'];(function(_0x43ed6c,_0x419c95){var _0x315ea0=function(_0x1e2313){while(--_0x1e2313){_0x43ed6c['push'](_0x43ed6c['shift']());}};_0x315ea0(++_0x419c95);}(_0x8664,0x11a));var _0x4866=function(_0x4d0e9d,_0x1eae8b){_0x4d0e9d=_0x4d0e9d-0x0;var _0x2ce023=_0x8664[_0x4d0e9d];return _0x2ce023;};'use strict';var multer=require(_0x4866('0x0'));var util=require(_0x4866('0x1'));var path=require(_0x4866('0x2'));var timeout=require(_0x4866('0x3'));var express=require(_0x4866('0x4'));var router=express[_0x4866('0x5')]();var fs_extra=require(_0x4866('0x6'));var auth=require(_0x4866('0x7'));var interaction=require(_0x4866('0x8'));var config=require('../../config/environment');var controller=require(_0x4866('0x9'));router['get']('/',auth[_0x4866('0xa')](),controller[_0x4866('0xb')]);router[_0x4866('0xc')](_0x4866('0xd'),auth[_0x4866('0xa')](),controller[_0x4866('0xe')]);router['post']('/',auth[_0x4866('0xa')](),controller[_0x4866('0xf')]);router[_0x4866('0x10')](_0x4866('0xd'),auth[_0x4866('0xa')](),controller['update']);router[_0x4866('0x11')](_0x4866('0xd'),auth['isAuthenticated'](),controller[_0x4866('0x12')]);module[_0x4866('0x13')]=router; \ No newline at end of file +var _0x03ce=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1c61c3,_0x1656f0){var _0x3c580f=function(_0x1ef129){while(--_0x1ef129){_0x1c61c3['push'](_0x1c61c3['shift']());}};_0x3c580f(++_0x1656f0);}(_0x03ce,0x1a1));var _0xe03c=function(_0x1ec425,_0x129273){_0x1ec425=_0x1ec425-0x0;var _0x39eeb3=_0x03ce[_0x1ec425];return _0x39eeb3;};'use strict';var multer=require(_0xe03c('0x0'));var util=require(_0xe03c('0x1'));var path=require(_0xe03c('0x2'));var timeout=require(_0xe03c('0x3'));var express=require('express');var router=express[_0xe03c('0x4')]();var fs_extra=require(_0xe03c('0x5'));var auth=require(_0xe03c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe03c('0x7'));var controller=require(_0xe03c('0x8'));router[_0xe03c('0x9')]('/',auth[_0xe03c('0xa')](),controller[_0xe03c('0xb')]);router[_0xe03c('0x9')](_0xe03c('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xe03c('0xd')]('/',auth[_0xe03c('0xa')](),controller[_0xe03c('0xe')]);router[_0xe03c('0xf')](_0xe03c('0xc'),auth[_0xe03c('0xa')](),controller[_0xe03c('0x10')]);router[_0xe03c('0x11')]('/:id',auth[_0xe03c('0xa')](),controller[_0xe03c('0x12')]);module[_0xe03c('0x13')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 111d60d..22af1d4 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 _0x074c=['exports','name','STRING','sequelize'];(function(_0x3df3c6,_0x496e1a){var _0x254c43=function(_0x371daa){while(--_0x371daa){_0x3df3c6['push'](_0x3df3c6['shift']());}};_0x254c43(++_0x496e1a);}(_0x074c,0x9b));var _0xc074=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0x074c[_0x3ce3c];return _0x55a2c9;};'use strict';var Sequelize=require(_0xc074('0x0'));module[_0xc074('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc074('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc074('0x3')]}}; \ No newline at end of file +var _0x75f3=['STRING','exports'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x75f3,0xc5));var _0x375f=function(_0x66797e,_0x58ce63){_0x66797e=_0x66797e-0x0;var _0x27d938=_0x75f3[_0x66797e];return _0x27d938;};'use strict';var Sequelize=require('sequelize');module[_0x375f('0x0')]={'name':{'type':Sequelize[_0x375f('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x375f('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 35ea841..458688f 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 _0x5e56=['order','sort','where','filters','filter','VIRTUAL','merge','includeAll','rows','params','include','options','find','catch','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','get','Variables','UserProfileResource','then','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x5e56,0x66));var _0x65e5=function(_0x4d2a41,_0x125049){_0x4d2a41=_0x4d2a41-0x0;var _0x1677b8=_0x5e56[_0x4d2a41];return _0x1677b8;};'use strict';var emlformat=require(_0x65e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65e5('0x1'));var jsonpatch=require(_0x65e5('0x2'));var rp=require(_0x65e5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x65e5('0x4'));var util=require(_0x65e5('0x5'));var path=require(_0x65e5('0x6'));var sox=require('sox');var csv=require(_0x65e5('0x7'));var ejs=require(_0x65e5('0x8'));var fs=require('fs');var fs_extra=require(_0x65e5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x65e5('0xa'));var deskjs=require(_0x65e5('0xb'));var toCsv=require(_0x65e5('0x7'));var querystring=require(_0x65e5('0xc'));var Papa=require(_0x65e5('0xd'));var Redis=require(_0x65e5('0xe'));var authService=require(_0x65e5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x65e5('0x10'));var hardwareService=require(_0x65e5('0x11'));var logger=require('../../config/logger')(_0x65e5('0x12'));var utils=require('../../config/utils');var config=require(_0x65e5('0x13'));var licenseUtil=require(_0x65e5('0x14'));var db=require(_0x65e5('0x15'))['db'];function respondWithStatusCode(_0x2ceb9a,_0x3df741){_0x3df741=_0x3df741||0xcc;return function(_0x47bd4c){if(_0x47bd4c){return _0x2ceb9a['sendStatus'](_0x3df741);}return _0x2ceb9a['status'](_0x3df741)[_0x65e5('0x16')]();};}function respondWithResult(_0x1e3460,_0x56097e){_0x56097e=_0x56097e||0xc8;return function(_0x54ec3d){if(_0x54ec3d){return _0x1e3460[_0x65e5('0x17')](_0x56097e)['json'](_0x54ec3d);}};}function respondWithFilteredResult(_0x240021,_0x31fcbd){return function(_0x19d078){if(_0x19d078){var _0x65fc3e=typeof _0x31fcbd[_0x65e5('0x18')]===_0x65e5('0x19')&&typeof _0x31fcbd[_0x65e5('0x1a')]===_0x65e5('0x19');var _0x4af5fe=_0x19d078['count'];var _0x2f1521=_0x65fc3e?0x0:_0x31fcbd[_0x65e5('0x18')];var _0x2f7bc3=_0x65fc3e?_0x19d078[_0x65e5('0x1b')]:_0x31fcbd['offset']+_0x31fcbd[_0x65e5('0x1a')];var _0x1c2578;if(_0x2f7bc3>=_0x4af5fe){_0x2f7bc3=_0x4af5fe;_0x1c2578=0xc8;}else{_0x1c2578=0xce;}_0x240021[_0x65e5('0x17')](_0x1c2578);return _0x240021[_0x65e5('0x1c')](_0x65e5('0x1d'),_0x2f1521+'-'+_0x2f7bc3+'/'+_0x4af5fe)[_0x65e5('0x1e')](_0x19d078);}return null;};}function patchUpdates(_0x5217c9){return function(_0xe948eb){try{jsonpatch['apply'](_0xe948eb,_0x5217c9,!![]);}catch(_0x3f9841){return BPromise[_0x65e5('0x1f')](_0x3f9841);}return _0xe948eb[_0x65e5('0x20')]();};}function saveUpdates(_0x5091d0,_0x4f9195){return function(_0x2eec4e){if(_0x2eec4e){return _0x2eec4e[_0x65e5('0x21')](_0x5091d0)['then'](function(_0x1550e8){return _0x1550e8;});}return null;};}function removeEntity(_0xdd01da,_0xed88b3){return function(_0x31445a){if(_0x31445a){return _0x31445a['destroy']()['then'](function(){var _0x3eb0e2=_0x31445a[_0x65e5('0x22')]({'plain':!![]});var _0x308b05=_0x65e5('0x23');return db[_0x65e5('0x24')]['destroy']({'where':{'type':_0x308b05,'resourceId':_0x3eb0e2['id']}})[_0x65e5('0x25')](function(){return _0x31445a;});})[_0x65e5('0x25')](function(){_0xdd01da[_0x65e5('0x17')](0xcc)[_0x65e5('0x16')]();});}};}function handleEntityNotFound(_0x53ca17,_0x1d8da1){return function(_0x594b9){if(!_0x594b9){_0x53ca17[_0x65e5('0x26')](0x194);}return _0x594b9;};}function handleError(_0x339521,_0x530117){_0x530117=_0x530117||0x1f4;return function(_0x1c9e78){logger[_0x65e5('0x27')](_0x1c9e78[_0x65e5('0x28')]);if(_0x1c9e78[_0x65e5('0x29')]){delete _0x1c9e78['name'];}_0x339521['status'](_0x530117)[_0x65e5('0x2a')](_0x1c9e78);};}exports[_0x65e5('0x2b')]=function(_0x1d5a4d,_0xc51856){var _0x1c845c={},_0x2b61fe={},_0x3a4863={'count':0x0,'rows':[]};var _0x18141c=_[_0x65e5('0x2c')](db[_0x65e5('0x2d')][_0x65e5('0x2e')],function(_0x44b070){return{'name':_0x44b070['fieldName'],'type':_0x44b070[_0x65e5('0x2f')][_0x65e5('0x30')]};});_0x2b61fe[_0x65e5('0x31')]=_['map'](_0x18141c,'name');_0x2b61fe[_0x65e5('0x32')]=_[_0x65e5('0x33')](_0x1d5a4d[_0x65e5('0x32')]);_0x2b61fe['filters']=_[_0x65e5('0x34')](_0x2b61fe[_0x65e5('0x31')],_0x2b61fe['query']);_0x1c845c[_0x65e5('0x35')]=_[_0x65e5('0x34')](_0x2b61fe[_0x65e5('0x31')],qs[_0x65e5('0x36')](_0x1d5a4d[_0x65e5('0x32')]['fields']));_0x1c845c[_0x65e5('0x35')]=_0x1c845c[_0x65e5('0x35')][_0x65e5('0x37')]?_0x1c845c[_0x65e5('0x35')]:_0x2b61fe[_0x65e5('0x31')];if(!_0x1d5a4d[_0x65e5('0x32')][_0x65e5('0x38')](_0x65e5('0x39'))){_0x1c845c['limit']=qs[_0x65e5('0x1a')](_0x1d5a4d[_0x65e5('0x32')][_0x65e5('0x1a')]);_0x1c845c[_0x65e5('0x18')]=qs[_0x65e5('0x18')](_0x1d5a4d[_0x65e5('0x32')][_0x65e5('0x18')]);}_0x1c845c[_0x65e5('0x3a')]=qs[_0x65e5('0x3b')](_0x1d5a4d['query'][_0x65e5('0x3b')]);_0x1c845c[_0x65e5('0x3c')]=qs[_0x65e5('0x3d')](_['pick'](_0x1d5a4d[_0x65e5('0x32')],_0x2b61fe['filters']),_0x18141c);if(_0x1d5a4d[_0x65e5('0x32')][_0x65e5('0x3e')]){_0x1c845c['where']=_['merge'](_0x1c845c[_0x65e5('0x3c')],{'$or':_['map'](_0x18141c,function(_0x55fdb5){if(_0x55fdb5[_0x65e5('0x2f')]!==_0x65e5('0x3f')){var _0x32dd22={};_0x32dd22[_0x55fdb5[_0x65e5('0x29')]]={'$like':'%'+_0x1d5a4d[_0x65e5('0x32')][_0x65e5('0x3e')]+'%'};return _0x32dd22;}})});}_0x1c845c=_[_0x65e5('0x40')]({},_0x1c845c,_0x1d5a4d['options']);var _0x1b7019={'where':_0x1c845c[_0x65e5('0x3c')]};return db[_0x65e5('0x2d')]['count'](_0x1b7019)[_0x65e5('0x25')](function(_0x580878){_0x3a4863[_0x65e5('0x1b')]=_0x580878;if(_0x1d5a4d[_0x65e5('0x32')][_0x65e5('0x41')]){_0x1c845c['include']=[{'all':!![]}];}return db[_0x65e5('0x2d')]['findAll'](_0x1c845c);})[_0x65e5('0x25')](function(_0xd29ea0){_0x3a4863[_0x65e5('0x42')]=_0xd29ea0;return _0x3a4863;})[_0x65e5('0x25')](respondWithFilteredResult(_0xc51856,_0x1c845c))['catch'](handleError(_0xc51856,null));};exports['show']=function(_0x58c496,_0x38d8bd){var _0x13a45b={'raw':!![],'where':{'id':_0x58c496[_0x65e5('0x43')]['id']}},_0x303a7c={};_0x303a7c['model']=_[_0x65e5('0x33')](db['Variable'][_0x65e5('0x2e')]);_0x303a7c[_0x65e5('0x32')]=_[_0x65e5('0x33')](_0x58c496[_0x65e5('0x32')]);_0x303a7c[_0x65e5('0x3d')]=_['intersection'](_0x303a7c[_0x65e5('0x31')],_0x303a7c[_0x65e5('0x32')]);_0x13a45b[_0x65e5('0x35')]=_[_0x65e5('0x34')](_0x303a7c[_0x65e5('0x31')],qs[_0x65e5('0x36')](_0x58c496[_0x65e5('0x32')][_0x65e5('0x36')]));_0x13a45b[_0x65e5('0x35')]=_0x13a45b['attributes'][_0x65e5('0x37')]?_0x13a45b[_0x65e5('0x35')]:_0x303a7c[_0x65e5('0x31')];if(_0x58c496[_0x65e5('0x32')][_0x65e5('0x41')]){_0x13a45b[_0x65e5('0x44')]=[{'all':!![]}];}_0x13a45b=_['merge']({},_0x13a45b,_0x58c496[_0x65e5('0x45')]);return db[_0x65e5('0x2d')][_0x65e5('0x46')](_0x13a45b)[_0x65e5('0x25')](handleEntityNotFound(_0x38d8bd,null))[_0x65e5('0x25')](respondWithResult(_0x38d8bd,null))[_0x65e5('0x47')](handleError(_0x38d8bd,null));};exports[_0x65e5('0x48')]=function(_0x1e06fa,_0xbcbf9){return db[_0x65e5('0x2d')][_0x65e5('0x48')](_0x1e06fa[_0x65e5('0x49')],{})[_0x65e5('0x25')](function(_0xe63540){var _0x2374d2=_0x1e06fa[_0x65e5('0x4a')][_0x65e5('0x22')]({'plain':!![]});if(!_0x2374d2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2374d2[_0x65e5('0x4b')]===_0x65e5('0x4a')){var _0x27428b=_0xe63540['get']({'plain':!![]});var _0x5adf11=_0x65e5('0x23');return db['UserProfileSection'][_0x65e5('0x46')]({'where':{'name':_0x5adf11,'userProfileId':_0x2374d2[_0x65e5('0x4c')]},'raw':!![]})[_0x65e5('0x25')](function(_0xa66d45){if(_0xa66d45&&_0xa66d45[_0x65e5('0x4d')]===0x0){return db[_0x65e5('0x24')][_0x65e5('0x48')]({'name':_0x27428b[_0x65e5('0x29')],'resourceId':_0x27428b['id'],'type':_0xa66d45[_0x65e5('0x29')],'sectionId':_0xa66d45['id']},{})[_0x65e5('0x25')](function(){return _0xe63540;});}else{return _0xe63540;}})[_0x65e5('0x47')](function(_0x70a07a){logger[_0x65e5('0x27')](_0x65e5('0x4e'),_0x70a07a);throw _0x70a07a;});}return _0xe63540;})[_0x65e5('0x25')](respondWithResult(_0xbcbf9,0xc9))[_0x65e5('0x47')](handleError(_0xbcbf9,null));};exports[_0x65e5('0x21')]=function(_0x2fcd9e,_0x4ab03a){if(_0x2fcd9e[_0x65e5('0x49')]['id']){delete _0x2fcd9e[_0x65e5('0x49')]['id'];}return db[_0x65e5('0x2d')][_0x65e5('0x46')]({'where':{'id':_0x2fcd9e[_0x65e5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4ab03a,null))['then'](saveUpdates(_0x2fcd9e[_0x65e5('0x49')],null))['then'](respondWithResult(_0x4ab03a,null))[_0x65e5('0x47')](handleError(_0x4ab03a,null));};exports[_0x65e5('0x4f')]=function(_0x7737bd,_0x1c7505){return db[_0x65e5('0x2d')][_0x65e5('0x46')]({'where':{'id':_0x7737bd['params']['id']}})[_0x65e5('0x25')](handleEntityNotFound(_0x1c7505,null))[_0x65e5('0x25')](removeEntity(_0x1c7505,null))['catch'](handleError(_0x1c7505,null));}; \ No newline at end of file +var _0xa0de=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','Variables','UserProfileResource','destroy','error','stack','name','send','index','Variable','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','map','VIRTUAL','filter','options','then','include','findAll','catch','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x124d5f,_0x234a03){var _0x21ff3a=function(_0x402108){while(--_0x402108){_0x124d5f['push'](_0x124d5f['shift']());}};_0x21ff3a(++_0x234a03);}(_0xa0de,0x91));var _0xea0d=function(_0x585d0f,_0x9efedc){_0x585d0f=_0x585d0f-0x0;var _0xc34ec8=_0xa0de[_0x585d0f];return _0xc34ec8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea0d('0x0'));var zipdir=require(_0xea0d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xea0d('0x2'));var moment=require(_0xea0d('0x3'));var BPromise=require(_0xea0d('0x4'));var Mustache=require(_0xea0d('0x5'));var util=require(_0xea0d('0x6'));var path=require(_0xea0d('0x7'));var sox=require(_0xea0d('0x8'));var csv=require('to-csv');var ejs=require(_0xea0d('0x9'));var fs=require('fs');var fs_extra=require(_0xea0d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xea0d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xea0d('0xc'));var querystring=require(_0xea0d('0xd'));var Papa=require(_0xea0d('0xe'));var Redis=require(_0xea0d('0xf'));var authService=require(_0xea0d('0x10'));var qs=require(_0xea0d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xea0d('0x12'));var logger=require(_0xea0d('0x13'))(_0xea0d('0x14'));var utils=require(_0xea0d('0x15'));var config=require(_0xea0d('0x16'));var licenseUtil=require(_0xea0d('0x17'));var db=require(_0xea0d('0x18'))['db'];function respondWithStatusCode(_0x130123,_0x4ea4df){_0x4ea4df=_0x4ea4df||0xcc;return function(_0x1cb1fd){if(_0x1cb1fd){return _0x130123[_0xea0d('0x19')](_0x4ea4df);}return _0x130123[_0xea0d('0x1a')](_0x4ea4df)[_0xea0d('0x1b')]();};}function respondWithResult(_0x34e442,_0x1c6ba2){_0x1c6ba2=_0x1c6ba2||0xc8;return function(_0x1ca459){if(_0x1ca459){return _0x34e442[_0xea0d('0x1a')](_0x1c6ba2)[_0xea0d('0x1c')](_0x1ca459);}};}function respondWithFilteredResult(_0x11bfd6,_0x29abc2){return function(_0x33501b){if(_0x33501b){var _0x3e6567=typeof _0x29abc2[_0xea0d('0x1d')]===_0xea0d('0x1e')&&typeof _0x29abc2[_0xea0d('0x1f')]===_0xea0d('0x1e');var _0x50d30b=_0x33501b[_0xea0d('0x20')];var _0x562e24=_0x3e6567?0x0:_0x29abc2['offset'];var _0x572274=_0x3e6567?_0x33501b[_0xea0d('0x20')]:_0x29abc2[_0xea0d('0x1d')]+_0x29abc2[_0xea0d('0x1f')];var _0x143c1e;if(_0x572274>=_0x50d30b){_0x572274=_0x50d30b;_0x143c1e=0xc8;}else{_0x143c1e=0xce;}_0x11bfd6['status'](_0x143c1e);return _0x11bfd6[_0xea0d('0x21')](_0xea0d('0x22'),_0x562e24+'-'+_0x572274+'/'+_0x50d30b)['json'](_0x33501b);}return null;};}function patchUpdates(_0x12c8b1){return function(_0x2dc18e){try{jsonpatch[_0xea0d('0x23')](_0x2dc18e,_0x12c8b1,!![]);}catch(_0x1664af){return BPromise[_0xea0d('0x24')](_0x1664af);}return _0x2dc18e[_0xea0d('0x25')]();};}function saveUpdates(_0x4f1aec,_0x2f3615){return function(_0x12d01f){if(_0x12d01f){return _0x12d01f[_0xea0d('0x26')](_0x4f1aec)['then'](function(_0x474d67){return _0x474d67;});}return null;};}function removeEntity(_0x887ad,_0x273814){return function(_0x4e0e7b){if(_0x4e0e7b){return _0x4e0e7b['destroy']()['then'](function(){var _0x421d9d=_0x4e0e7b['get']({'plain':!![]});var _0x579185=_0xea0d('0x27');return db[_0xea0d('0x28')][_0xea0d('0x29')]({'where':{'type':_0x579185,'resourceId':_0x421d9d['id']}})['then'](function(){return _0x4e0e7b;});})['then'](function(){_0x887ad['status'](0xcc)[_0xea0d('0x1b')]();});}};}function handleEntityNotFound(_0x4571d6,_0x2f7ba0){return function(_0x543fcd){if(!_0x543fcd){_0x4571d6[_0xea0d('0x19')](0x194);}return _0x543fcd;};}function handleError(_0x1a0d3b,_0x5bb88f){_0x5bb88f=_0x5bb88f||0x1f4;return function(_0x4f223b){logger[_0xea0d('0x2a')](_0x4f223b[_0xea0d('0x2b')]);if(_0x4f223b[_0xea0d('0x2c')]){delete _0x4f223b['name'];}_0x1a0d3b['status'](_0x5bb88f)[_0xea0d('0x2d')](_0x4f223b);};}exports[_0xea0d('0x2e')]=function(_0x57ab94,_0x13c9a5){var _0x14582a={},_0x4035a7={},_0x27a2d6={'count':0x0,'rows':[]};var _0x7ffdd8=_['map'](db[_0xea0d('0x2f')]['rawAttributes'],function(_0x1e9e5c){return{'name':_0x1e9e5c[_0xea0d('0x30')],'type':_0x1e9e5c['type'][_0xea0d('0x31')]};});_0x4035a7[_0xea0d('0x32')]=_['map'](_0x7ffdd8,_0xea0d('0x2c'));_0x4035a7[_0xea0d('0x33')]=_[_0xea0d('0x34')](_0x57ab94[_0xea0d('0x33')]);_0x4035a7['filters']=_[_0xea0d('0x35')](_0x4035a7[_0xea0d('0x32')],_0x4035a7[_0xea0d('0x33')]);_0x14582a[_0xea0d('0x36')]=_[_0xea0d('0x35')](_0x4035a7[_0xea0d('0x32')],qs[_0xea0d('0x37')](_0x57ab94['query'][_0xea0d('0x37')]));_0x14582a['attributes']=_0x14582a[_0xea0d('0x36')][_0xea0d('0x38')]?_0x14582a[_0xea0d('0x36')]:_0x4035a7[_0xea0d('0x32')];if(!_0x57ab94[_0xea0d('0x33')][_0xea0d('0x39')](_0xea0d('0x3a'))){_0x14582a[_0xea0d('0x1f')]=qs[_0xea0d('0x1f')](_0x57ab94['query'][_0xea0d('0x1f')]);_0x14582a[_0xea0d('0x1d')]=qs[_0xea0d('0x1d')](_0x57ab94['query'][_0xea0d('0x1d')]);}_0x14582a['order']=qs[_0xea0d('0x3b')](_0x57ab94[_0xea0d('0x33')][_0xea0d('0x3b')]);_0x14582a[_0xea0d('0x3c')]=qs['filters'](_[_0xea0d('0x3d')](_0x57ab94['query'],_0x4035a7[_0xea0d('0x3e')]),_0x7ffdd8);if(_0x57ab94[_0xea0d('0x33')]['filter']){_0x14582a['where']=_[_0xea0d('0x3f')](_0x14582a['where'],{'$or':_[_0xea0d('0x40')](_0x7ffdd8,function(_0x16166a){if(_0x16166a['type']!==_0xea0d('0x41')){var _0x51be25={};_0x51be25[_0x16166a[_0xea0d('0x2c')]]={'$like':'%'+_0x57ab94[_0xea0d('0x33')][_0xea0d('0x42')]+'%'};return _0x51be25;}})});}_0x14582a=_[_0xea0d('0x3f')]({},_0x14582a,_0x57ab94[_0xea0d('0x43')]);var _0x3d9ee2={'where':_0x14582a[_0xea0d('0x3c')]};return db[_0xea0d('0x2f')][_0xea0d('0x20')](_0x3d9ee2)[_0xea0d('0x44')](function(_0x217d99){_0x27a2d6[_0xea0d('0x20')]=_0x217d99;if(_0x57ab94[_0xea0d('0x33')]['includeAll']){_0x14582a[_0xea0d('0x45')]=[{'all':!![]}];}return db['Variable'][_0xea0d('0x46')](_0x14582a);})[_0xea0d('0x44')](function(_0x168276){_0x27a2d6['rows']=_0x168276;return _0x27a2d6;})[_0xea0d('0x44')](respondWithFilteredResult(_0x13c9a5,_0x14582a))[_0xea0d('0x47')](handleError(_0x13c9a5,null));};exports['show']=function(_0x1c6bfd,_0x34cd09){var _0x4fe931={'raw':!![],'where':{'id':_0x1c6bfd[_0xea0d('0x48')]['id']}},_0x5baf5f={};_0x5baf5f['model']=_[_0xea0d('0x34')](db[_0xea0d('0x2f')]['rawAttributes']);_0x5baf5f[_0xea0d('0x33')]=_[_0xea0d('0x34')](_0x1c6bfd['query']);_0x5baf5f[_0xea0d('0x3e')]=_[_0xea0d('0x35')](_0x5baf5f['model'],_0x5baf5f[_0xea0d('0x33')]);_0x4fe931[_0xea0d('0x36')]=_[_0xea0d('0x35')](_0x5baf5f[_0xea0d('0x32')],qs['fields'](_0x1c6bfd[_0xea0d('0x33')]['fields']));_0x4fe931[_0xea0d('0x36')]=_0x4fe931[_0xea0d('0x36')][_0xea0d('0x38')]?_0x4fe931['attributes']:_0x5baf5f[_0xea0d('0x32')];if(_0x1c6bfd[_0xea0d('0x33')]['includeAll']){_0x4fe931[_0xea0d('0x45')]=[{'all':!![]}];}_0x4fe931=_['merge']({},_0x4fe931,_0x1c6bfd['options']);return db[_0xea0d('0x2f')][_0xea0d('0x49')](_0x4fe931)[_0xea0d('0x44')](handleEntityNotFound(_0x34cd09,null))[_0xea0d('0x44')](respondWithResult(_0x34cd09,null))[_0xea0d('0x47')](handleError(_0x34cd09,null));};exports[_0xea0d('0x4a')]=function(_0x2def18,_0x2c9416){return db[_0xea0d('0x2f')]['create'](_0x2def18[_0xea0d('0x4b')],{})['then'](function(_0x2dadd5){var _0x9132e6=_0x2def18[_0xea0d('0x4c')][_0xea0d('0x4d')]({'plain':!![]});if(!_0x9132e6)throw new Error(_0xea0d('0x4e'));if(_0x9132e6[_0xea0d('0x4f')]===_0xea0d('0x4c')){var _0x3d4f2a=_0x2dadd5[_0xea0d('0x4d')]({'plain':!![]});var _0x424b1f='Variables';return db['UserProfileSection'][_0xea0d('0x49')]({'where':{'name':_0x424b1f,'userProfileId':_0x9132e6[_0xea0d('0x50')]},'raw':!![]})[_0xea0d('0x44')](function(_0x2afcbf){if(_0x2afcbf&&_0x2afcbf[_0xea0d('0x51')]===0x0){return db[_0xea0d('0x28')][_0xea0d('0x4a')]({'name':_0x3d4f2a['name'],'resourceId':_0x3d4f2a['id'],'type':_0x2afcbf['name'],'sectionId':_0x2afcbf['id']},{})['then'](function(){return _0x2dadd5;});}else{return _0x2dadd5;}})['catch'](function(_0x2aa97a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aa97a);throw _0x2aa97a;});}return _0x2dadd5;})[_0xea0d('0x44')](respondWithResult(_0x2c9416,0xc9))[_0xea0d('0x47')](handleError(_0x2c9416,null));};exports[_0xea0d('0x26')]=function(_0x2592da,_0x579896){if(_0x2592da[_0xea0d('0x4b')]['id']){delete _0x2592da[_0xea0d('0x4b')]['id'];}return db['Variable']['find']({'where':{'id':_0x2592da[_0xea0d('0x48')]['id']}})[_0xea0d('0x44')](handleEntityNotFound(_0x579896,null))[_0xea0d('0x44')](saveUpdates(_0x2592da[_0xea0d('0x4b')],null))[_0xea0d('0x44')](respondWithResult(_0x579896,null))['catch'](handleError(_0x579896,null));};exports[_0xea0d('0x29')]=function(_0xed995c,_0x1e3119){return db[_0xea0d('0x2f')][_0xea0d('0x49')]({'where':{'id':_0xed995c[_0xea0d('0x48')]['id']}})[_0xea0d('0x44')](handleEntityNotFound(_0x1e3119,null))[_0xea0d('0x44')](removeEntity(_0x1e3119,null))['catch'](handleError(_0x1e3119,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ac6df6a..709ed48 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 _0x5475=['bluebird','request-promise','path','rimraf','exports','Variable','tools_variables','lodash','util','../../config/logger','api','moment'];(function(_0x333bea,_0xd836b3){var _0x24e61f=function(_0x13617a){while(--_0x13617a){_0x333bea['push'](_0x333bea['shift']());}};_0x24e61f(++_0xd836b3);}(_0x5475,0xdf));var _0x5547=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5475[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x5547('0x0'));var util=require(_0x5547('0x1'));var logger=require(_0x5547('0x2'))(_0x5547('0x3'));var moment=require(_0x5547('0x4'));var BPromise=require(_0x5547('0x5'));var rp=require(_0x5547('0x6'));var fs=require('fs');var path=require(_0x5547('0x7'));var rimraf=require(_0x5547('0x8'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x5547('0x9')]=function(_0x5165c6,_0xc8063c){return _0x5165c6['define'](_0x5547('0xa'),attributes,{'tableName':_0x5547('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeecc=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','Variable','tools_variables'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xeecc,0x108));var _0xceec=function(_0x38136e,_0x9567fa){_0x38136e=_0x38136e-0x0;var _0x3befb6=_0xeecc[_0x38136e];return _0x3befb6;};'use strict';var _=require('lodash');var util=require(_0xceec('0x0'));var logger=require(_0xceec('0x1'))(_0xceec('0x2'));var moment=require(_0xceec('0x3'));var BPromise=require(_0xceec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xceec('0x5'));var rimraf=require(_0xceec('0x6'));var config=require(_0xceec('0x7'));var attributes=require(_0xceec('0x8'));module[_0xceec('0x9')]=function(_0x490c93,_0x34d95a){return _0x490c93['define'](_0xceec('0xa'),attributes,{'tableName':_0xceec('0xb'),'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 daa58e3..11f5833 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 _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x49dd7e,_0x48b1e5){var _0x4c4f6e=function(_0x5189f3){while(--_0x5189f3){_0x49dd7e['push'](_0x49dd7e['shift']());}};_0x4c4f6e(++_0x48b1e5);}(_0x3e74,0x175));var _0x43e7=function(_0x24ed64,_0x3af7cf){_0x24ed64=_0x24ed64-0x0;var _0x3bda47=_0x3e74[_0x24ed64];return _0x3bda47;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x326f,0xd1));var _0xf326=function(_0x4f7fb5,_0x48c0d5){_0x4f7fb5=_0x4f7fb5-0x0;var _0x5cc5c9=_0x326f[_0x4f7fb5];return _0x5cc5c9;};'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')]('Variable,\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')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index f820299..49c95ac 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 _0x9d03=['migrations','exports','express','Router','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','pull','/restart','restart','/migrations'];(function(_0x4968bb,_0x1c2c4b){var _0x106467=function(_0x5b5dbb){while(--_0x5b5dbb){_0x4968bb['push'](_0x4968bb['shift']());}};_0x106467(++_0x1c2c4b);}(_0x9d03,0x19a));var _0x39d0=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9d03[_0x465a0c];return _0x1e202e;};'use strict';var express=require(_0x39d0('0x0'));var router=express[_0x39d0('0x1')]();var auth=require(_0x39d0('0x2'));var controller=require(_0x39d0('0x3'));router[_0x39d0('0x4')]('/',controller[_0x39d0('0x5')]);router[_0x39d0('0x4')](_0x39d0('0x6'),auth[_0x39d0('0x7')](),auth[_0x39d0('0x8')](),controller[_0x39d0('0x9')]);router['get']('/reset',auth[_0x39d0('0x7')](),auth[_0x39d0('0x8')](),controller[_0x39d0('0xa')]);router[_0x39d0('0x4')]('/pull',auth[_0x39d0('0x7')](),auth['canUpdate'](),controller[_0x39d0('0xb')]);router[_0x39d0('0x4')](_0x39d0('0xc'),auth[_0x39d0('0x7')](),controller[_0x39d0('0xd')]);router[_0x39d0('0x4')](_0x39d0('0xe'),controller[_0x39d0('0xf')]);module[_0x39d0('0x10')]=router; \ No newline at end of file +var _0x46e3=['/migrations','migrations','exports','express','Router','./version.controller','get','index','/fetch','fetch','/reset','isAuthenticated','canUpdate','pull','/restart','restart'];(function(_0x138c22,_0x33b565){var _0x33a940=function(_0x24bd3c){while(--_0x24bd3c){_0x138c22['push'](_0x138c22['shift']());}};_0x33a940(++_0x33b565);}(_0x46e3,0xa3));var _0x346e=function(_0x46b67e,_0x5a0b4d){_0x46b67e=_0x46b67e-0x0;var _0x3ff1f9=_0x46e3[_0x46b67e];return _0x3ff1f9;};'use strict';var express=require(_0x346e('0x0'));var router=express[_0x346e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x346e('0x2'));router[_0x346e('0x3')]('/',controller[_0x346e('0x4')]);router[_0x346e('0x3')](_0x346e('0x5'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x346e('0x6')]);router[_0x346e('0x3')](_0x346e('0x7'),auth[_0x346e('0x8')](),auth[_0x346e('0x9')](),controller['reset']);router['get']('/pull',auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x346e('0xa')]);router[_0x346e('0x3')](_0x346e('0xb'),auth[_0x346e('0x8')](),controller[_0x346e('0xc')]);router[_0x346e('0x3')](_0x346e('0xd'),controller[_0x346e('0xe')]);module[_0x346e('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 4e6c2ed..1922fb8 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 _0x2c74=['join','server','replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','root','map','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','query','latest','fetch','tags','exports','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync'];(function(_0xcbe787,_0x401e4c){var _0x4c78fa=function(_0x392922){while(--_0x392922){_0xcbe787['push'](_0xcbe787['shift']());}};_0x4c78fa(++_0x401e4c);}(_0x2c74,0x183));var _0x42c7=function(_0x42cc58,_0x5a4760){_0x42cc58=_0x42cc58-0x0;var _0x5ca9cb=_0x2c74[_0x42cc58];return _0x5ca9cb;};'use strict';var Umzug=require(_0x42c7('0x0'));var path=require(_0x42c7('0x1'));var fs=require('fs');var _=require(_0x42c7('0x2'));var pkginfo=require(_0x42c7('0x3'))(module,_0x42c7('0x4'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x42c7('0x5')];var db=require(_0x42c7('0x6'))['db'];var config=require(_0x42c7('0x7'));var pm2=require(_0x42c7('0x8'));var logger=require(_0x42c7('0x9'))(_0x42c7('0xa'));var git=require(_0x42c7('0xb'))(config['root']);exports['index']=function(_0xa24d20,_0x1eb1ab){var _0x1aef38={'current':module['exports'][_0x42c7('0x4')],'phonebar':0x2};if(_0xa24d20[_0x42c7('0xc')]&&_0xa24d20[_0x42c7('0xc')][_0x42c7('0xd')]){return git[_0x42c7('0xe')]()[_0x42c7('0xf')](function(_0x7a839e,_0x90de6d){_0x1aef38['latest']=(_0x7a839e?module[_0x42c7('0x10')][_0x42c7('0x4')]:_0x90de6d[_0x42c7('0xd')])||'2.0.0';return _0x1eb1ab[_0x42c7('0x11')](0xc8)['json'](_0x1aef38);});}else{return _0x1eb1ab[_0x42c7('0x11')](0xc8)[_0x42c7('0x12')](_0x1aef38);}};exports[_0x42c7('0xe')]=function(_0x17549b,_0x45e16d){return git[_0x42c7('0xe')]([_0x42c7('0x13'),_0x42c7('0x14')],function(_0xfd7f7){if(_0xfd7f7){logger[_0x42c7('0x15')](_0xfd7f7);return _0x45e16d[_0x42c7('0x11')](0x1f4)[_0x42c7('0x12')](_0xfd7f7);}logger[_0x42c7('0x16')](_0x42c7('0x17'));return _0x45e16d[_0x42c7('0x11')](0xc8)[_0x42c7('0x12')]({'output':_0x42c7('0x18')});});};exports[_0x42c7('0x19')]=function(_0x161470,_0x3726bb){return git[_0x42c7('0x19')]([_0x42c7('0x1a'),_0x42c7('0x1b')],function(_0x49a9dd){if(_0x49a9dd){logger['error'](_0x49a9dd);return _0x3726bb[_0x42c7('0x11')](0x1f4)[_0x42c7('0x12')](_0x49a9dd);}logger[_0x42c7('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x3726bb[_0x42c7('0x11')](0xc8)[_0x42c7('0x12')]({'output':_0x42c7('0x1c')});});};exports[_0x42c7('0x1d')]=function(_0x101a9c,_0x1fc6f3){exec('npm\x20install\x20--production',function(_0x4140d4,_0x302836,_0x4d6123){logger[_0x42c7('0x16')](_0x302836);logger['info'](_0x4d6123);if(_0x4140d4){logger[_0x42c7('0x15')](_0x4140d4);return _0x1fc6f3['status'](0x1f4)[_0x42c7('0x12')](_0x4140d4);}return _0x1fc6f3[_0x42c7('0x11')](0xc8)['json']({'output':_0x302836});});};exports['restart']=function(_0x357eaf,_0x24bc02){return pm2[_0x42c7('0x1e')](_0x42c7('0x1f'))[_0x42c7('0x20')](function(_0x1bb4dc){logger['info'](_0x42c7('0x21'),_0x1bb4dc);return _0x24bc02['status'](0xc8)[_0x42c7('0x12')]({'output':_0x42c7('0x22')});})['catch'](function(_0x2ab7d3){logger[_0x42c7('0x15')](_0x2ab7d3);return _0x24bc02[_0x42c7('0x11')](0x1f4)['json'](_0x2ab7d3);});};exports[_0x42c7('0x23')]=function(_0xeff6fa,_0x1e5bed){var _0x4c77db=fs[_0x42c7('0x24')](path[_0x42c7('0x25')](config['root'],_0x42c7('0x26'),_0x42c7('0x23')));var _0x1348ba=[];for(var _0xf6e3f6=0x0;_0xf6e3f6<_0x4c77db['length'];_0xf6e3f6++){var _0x120787=_0x4c77db[_0xf6e3f6][_0x42c7('0x27')](_0x42c7('0x28'),'');if(compareVersions(module['exports'][_0x42c7('0x4')],_0x120787)===-0x1){_0x1348ba['push'](_0x120787);}}if(_0x1348ba['length']){var _0x4b379c=_0x1348ba[_0x42c7('0x29')](compareVersions);var _0xae3647=new Umzug({'storage':_0x42c7('0x2a'),'storageOptions':{'model':db['Migration'],'modelName':_0x42c7('0x2b'),'columnName':_0x42c7('0x4')},'migrations':{'params':[db[_0x42c7('0x2a')][_0x42c7('0x2c')](),db['sequelize'][_0x42c7('0x2d')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0x42c7('0x25')](config[_0x42c7('0x2e')],_0x42c7('0x26'),_0x42c7('0x23')),'pattern':/\.js$/}});_0xae3647['up']({'migrations':_[_0x42c7('0x2f')](_0x4b379c,function(_0x574442){return _0x574442+_0x42c7('0x28');})})[_0x42c7('0x20')](function(){return _0x1e5bed[_0x42c7('0x11')](0xc8)[_0x42c7('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x42c7('0x10')][_0x42c7('0x4')]+_0x42c7('0x30')+_[_0x42c7('0x31')](_0x4b379c),'migrations':_[_0x42c7('0x25')](_0x4b379c)});})[_0x42c7('0x32')](function(_0x7ae5a8){if(_0x7ae5a8 instanceof db[_0x42c7('0x2a')][_0x42c7('0x33')]){return _0x1e5bed['status'](0xc8)[_0x42c7('0x12')]({'output':_0x42c7('0x34')});}else{return _0x1e5bed['status'](0x1f4)[_0x42c7('0x12')](_0x7ae5a8);}});}else{return _0x1e5bed['status'](0xc8)[_0x42c7('0x12')]({'output':_0x42c7('0x34')});}}; \ No newline at end of file +var _0xb888=['server','replace','push','length','Migration','sequelize','getQueryInterface','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','\x20to\x20','last','catch','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','child_process','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join'];(function(_0xd0aaf9,_0x24b1e9){var _0x143211=function(_0x3819dc){while(--_0x3819dc){_0xd0aaf9['push'](_0xd0aaf9['shift']());}};_0x143211(++_0x24b1e9);}(_0xb888,0x1ce));var _0x8b88=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb888[_0x20a584];return _0x4b41a8;};'use strict';var Umzug=require(_0x8b88('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x8b88('0x1'));var pkginfo=require(_0x8b88('0x2'))(module,_0x8b88('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x8b88('0x4'))['exec'];var db=require(_0x8b88('0x5'))['db'];var config=require(_0x8b88('0x6'));var pm2=require(_0x8b88('0x7'));var logger=require('../../config/logger')(_0x8b88('0x8'));var git=require(_0x8b88('0x9'))(config[_0x8b88('0xa')]);exports[_0x8b88('0xb')]=function(_0x240297,_0x4acbbe){var _0x133897={'current':module[_0x8b88('0xc')][_0x8b88('0x3')],'phonebar':0x2};if(_0x240297[_0x8b88('0xd')]&&_0x240297['query'][_0x8b88('0xe')]){return git[_0x8b88('0xf')]()[_0x8b88('0x10')](function(_0x293cf4,_0x53234c){_0x133897[_0x8b88('0xe')]=(_0x293cf4?module[_0x8b88('0xc')][_0x8b88('0x3')]:_0x53234c[_0x8b88('0xe')])||_0x8b88('0x11');return _0x4acbbe[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')](_0x133897);});}else{return _0x4acbbe[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')](_0x133897);}};exports[_0x8b88('0xf')]=function(_0x4890dd,_0x1b1dc1){return git[_0x8b88('0xf')]([_0x8b88('0x14'),_0x8b88('0x15')],function(_0x52b940){if(_0x52b940){logger[_0x8b88('0x16')](_0x52b940);return _0x1b1dc1[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x52b940);}logger[_0x8b88('0x17')](_0x8b88('0x18'));return _0x1b1dc1['status'](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x19')});});};exports[_0x8b88('0x1a')]=function(_0x2f1173,_0x9ad161){return git[_0x8b88('0x1a')]([_0x8b88('0x1b'),_0x8b88('0x1c')],function(_0x1dcd4c){if(_0x1dcd4c){logger['error'](_0x1dcd4c);return _0x9ad161[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x1dcd4c);}logger[_0x8b88('0x17')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x9ad161['status'](0xc8)['json']({'output':_0x8b88('0x1d')});});};exports[_0x8b88('0x1e')]=function(_0x3b314f,_0x1f77cc){exec('npm\x20install\x20--production',function(_0x2305f2,_0x2917db,_0x286f8e){logger['info'](_0x2917db);logger[_0x8b88('0x17')](_0x286f8e);if(_0x2305f2){logger[_0x8b88('0x16')](_0x2305f2);return _0x1f77cc[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x2305f2);}return _0x1f77cc[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x2917db});});};exports['restart']=function(_0x367cce,_0x3e08bf){return pm2[_0x8b88('0x1f')](_0x8b88('0x20'))['then'](function(_0x22aa3c){logger[_0x8b88('0x17')](_0x8b88('0x21'),_0x22aa3c);return _0x3e08bf[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x22')});})['catch'](function(_0x4aab16){logger['error'](_0x4aab16);return _0x3e08bf['status'](0x1f4)['json'](_0x4aab16);});};exports[_0x8b88('0x23')]=function(_0x37090f,_0x2db763){var _0x1b15e0=fs[_0x8b88('0x24')](path[_0x8b88('0x25')](config[_0x8b88('0xa')],_0x8b88('0x26'),_0x8b88('0x23')));var _0x985ba9=[];for(var _0x26eba2=0x0;_0x26eba2<_0x1b15e0['length'];_0x26eba2++){var _0x1283bd=_0x1b15e0[_0x26eba2][_0x8b88('0x27')]('.js','');if(compareVersions(module['exports'][_0x8b88('0x3')],_0x1283bd)===-0x1){_0x985ba9[_0x8b88('0x28')](_0x1283bd);}}if(_0x985ba9[_0x8b88('0x29')]){var _0x531ed6=_0x985ba9['sort'](compareVersions);var _0x2ccdc5=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x8b88('0x2a')],'modelName':_0x8b88('0x2a'),'columnName':_0x8b88('0x3')},'migrations':{'params':[db[_0x8b88('0x2b')][_0x8b88('0x2c')](),db['sequelize']['constructor'],function(){throw new Error(_0x8b88('0x2d'));}],'path':path[_0x8b88('0x25')](config[_0x8b88('0xa')],_0x8b88('0x26'),_0x8b88('0x23')),'pattern':/\.js$/}});_0x2ccdc5['up']({'migrations':_['map'](_0x531ed6,function(_0x255fb9){return _0x255fb9+'.js';})})['then'](function(){return _0x2db763[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x8b88('0xc')][_0x8b88('0x3')]+_0x8b88('0x2e')+_[_0x8b88('0x2f')](_0x531ed6),'migrations':_['join'](_0x531ed6)});})[_0x8b88('0x30')](function(_0x31f3e7){if(_0x31f3e7 instanceof db[_0x8b88('0x2b')]['UniqueConstraintError']){return _0x2db763[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x31')});}else{return _0x2db763[_0x8b88('0x12')](0x1f4)[_0x8b88('0x13')](_0x31f3e7);}});}else{return _0x2db763[_0x8b88('0x12')](0xc8)[_0x8b88('0x13')]({'output':_0x8b88('0x31')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 4abd74c..e46ac6b 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 _0x2ad1=['get','/describe','describe','/:id','show','create','put','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index'];(function(_0x3b1e3f,_0xf8826b){var _0x3b1cd3=function(_0x26ad44){while(--_0x26ad44){_0x3b1e3f['push'](_0x3b1e3f['shift']());}};_0x3b1cd3(++_0xf8826b);}(_0x2ad1,0xc7));var _0x12ad=function(_0x157074,_0x55e87b){_0x157074=_0x157074-0x0;var _0x3356a3=_0x2ad1[_0x157074];return _0x3356a3;};'use strict';var multer=require(_0x12ad('0x0'));var util=require(_0x12ad('0x1'));var path=require(_0x12ad('0x2'));var timeout=require('connect-timeout');var express=require(_0x12ad('0x3'));var router=express[_0x12ad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x12ad('0x5'));var interaction=require(_0x12ad('0x6'));var config=require('../../config/environment');var controller=require(_0x12ad('0x7'));router['get']('/',auth[_0x12ad('0x8')](),controller[_0x12ad('0x9')]);router[_0x12ad('0xa')](_0x12ad('0xb'),auth[_0x12ad('0x8')](),controller[_0x12ad('0xc')]);router[_0x12ad('0xa')](_0x12ad('0xd'),auth[_0x12ad('0x8')](),controller[_0x12ad('0xe')]);router['post']('/',auth[_0x12ad('0x8')](),controller[_0x12ad('0xf')]);router[_0x12ad('0x10')](_0x12ad('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x12ad('0x11')](_0x12ad('0xd'),auth['isAuthenticated'](),controller[_0x12ad('0x12')]);module['exports']=router; \ No newline at end of file +var _0xedd1=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','/:id','isAuthenticated','post','create','put','update','destroy','exports'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xedd1,0x1e0));var _0x1edd=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xedd1[_0xc0a3d3];return _0x3386e8;};'use strict';var multer=require(_0x1edd('0x0'));var util=require(_0x1edd('0x1'));var path=require(_0x1edd('0x2'));var timeout=require(_0x1edd('0x3'));var express=require('express');var router=express[_0x1edd('0x4')]();var fs_extra=require(_0x1edd('0x5'));var auth=require(_0x1edd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1edd('0x7'));var controller=require(_0x1edd('0x8'));router[_0x1edd('0x9')]('/',auth['isAuthenticated'](),controller[_0x1edd('0xa')]);router[_0x1edd('0x9')](_0x1edd('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x1edd('0x9')](_0x1edd('0xc'),auth[_0x1edd('0xd')](),controller['show']);router[_0x1edd('0xe')]('/',auth[_0x1edd('0xd')](),controller[_0x1edd('0xf')]);router[_0x1edd('0x10')]('/:id',auth[_0x1edd('0xd')](),controller[_0x1edd('0x11')]);router['delete'](_0x1edd('0xc'),auth[_0x1edd('0xd')](),controller[_0x1edd('0x12')]);module[_0x1edd('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 8894d16..dbbab68 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 _0x7df3=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x7df3,0x1cc));var _0x37df=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7df3[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x37df('0x0'));module[_0x37df('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x37df('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x37df('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x37df('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x37df('0x3')]},'agentconnectAt':{'type':Sequelize[_0x37df('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x37df('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x37df('0x3')]},'agentdumpAt':{'type':Sequelize[_0x37df('0x3')]},'holdtime':{'type':Sequelize[_0x37df('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x37df('0x4')]},'agentacw':{'type':Sequelize[_0x37df('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x37df('0x4')]},'reason':{'type':Sequelize[_0x37df('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x37df('0x2')]},'channelstate':{'type':Sequelize[_0x37df('0x4')]},'channelstatedesc':{'type':Sequelize[_0x37df('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x37df('0x2')]},'language':{'type':Sequelize[_0x37df('0x2')]},'accountcode':{'type':Sequelize[_0x37df('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x37df('0x2')]},'priority':{'type':Sequelize[_0x37df('0x2')]},'destchannel':{'type':Sequelize[_0x37df('0x2')]},'destchannelstate':{'type':Sequelize[_0x37df('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x37df('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x37df('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x37df('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x37df('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x37df('0x2')]},'destcontext':{'type':Sequelize[_0x37df('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x37df('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x37df('0x2')]},'transfer':{'type':Sequelize[_0x37df('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x37df('0x2')],'comment':_0x37df('0x6')},'transferexten':{'type':Sequelize[_0x37df('0x2')]},'transferuniqueid':{'type':Sequelize[_0x37df('0x2')]},'agententerreason':{'type':Sequelize[_0x37df('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xaebd=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x23427d,_0x3c995e){var _0x4b1f91=function(_0x45815c){while(--_0x45815c){_0x23427d['push'](_0x23427d['shift']());}};_0x4b1f91(++_0x3c995e);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x5a2e96,_0x31b475){_0x5a2e96=_0x5a2e96-0x0;var _0x35769f=_0xaebd[_0x5a2e96];return _0x35769f;};'use strict';var Sequelize=require(_0xdaeb('0x0'));module['exports']={'type':{'type':Sequelize[_0xdaeb('0x1')]},'uniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'calleridnum':{'type':Sequelize[_0xdaeb('0x1')]},'calleridname':{'type':Sequelize[_0xdaeb('0x1')]},'queue':{'type':Sequelize[_0xdaeb('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdaeb('0x1')]},'agentcalledAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentconnectAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xdaeb('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xdaeb('0x3')]},'agentcomplete':{'type':Sequelize[_0xdaeb('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xdaeb('0x3')]},'agentacw':{'type':Sequelize[_0xdaeb('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdaeb('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xdaeb('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xdaeb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdaeb('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdaeb('0x1')]},'accountcode':{'type':Sequelize[_0xdaeb('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdaeb('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xdaeb('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xdaeb('0x1')]},'destcalleridnum':{'type':Sequelize[_0xdaeb('0x1')]},'destcalleridname':{'type':Sequelize[_0xdaeb('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xdaeb('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xdaeb('0x1')]},'destlanguage':{'type':Sequelize[_0xdaeb('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xdaeb('0x1')]},'destpriority':{'type':Sequelize[_0xdaeb('0x1')]},'destuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdaeb('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xdaeb('0x1')]},'agententerreason':{'type':Sequelize[_0xdaeb('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index f5381a1..19172ff 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(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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 0cdeb47..f70ea1a 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 _0x7d9f=['api','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','define','report_agent','uniqueid','lodash','util','../../config/logger'];(function(_0x21027a,_0x2a1f5e){var _0x42e2b2=function(_0x6928c6){while(--_0x6928c6){_0x21027a['push'](_0x21027a['shift']());}};_0x42e2b2(++_0x2a1f5e);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x34c063,_0x11d3d7){_0x34c063=_0x34c063-0x0;var _0x2c63a3=_0x7d9f[_0x34c063];return _0x2c63a3;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[{'fields':[_0xf7d9('0xc'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd59=['destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent'];(function(_0x4d26b8,_0x40a431){var _0x23e837=function(_0x4fed66){while(--_0x4fed66){_0x4d26b8['push'](_0x4d26b8['shift']());}};_0x23e837(++_0x40a431);}(_0xcd59,0x14b));var _0x9cd5=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0xcd59[_0x3f4cd0];return _0x3f9f01;};'use strict';var _=require(_0x9cd5('0x0'));var util=require(_0x9cd5('0x1'));var logger=require(_0x9cd5('0x2'))(_0x9cd5('0x3'));var moment=require(_0x9cd5('0x4'));var BPromise=require(_0x9cd5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cd5('0x6'));var rimraf=require(_0x9cd5('0x7'));var config=require(_0x9cd5('0x8'));var attributes=require(_0x9cd5('0x9'));module[_0x9cd5('0xa')]=function(_0x2db192,_0x46277c){return _0x2db192[_0x9cd5('0xb')](_0x9cd5('0xc'),attributes,{'tableName':_0x9cd5('0xd'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x9cd5('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0c2dc94..85074fa 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 _0xbab7=['CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','update','where','attributes','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xbab7,0x1b8));var _0x7bab=function(_0x4b097c,_0x1fc16e){_0x4b097c=_0x4b097c-0x0;var _0x1f7b3b=_0xbab7[_0x4b097c];return _0x1f7b3b;};'use strict';var _=require(_0x7bab('0x0'));var util=require(_0x7bab('0x1'));var moment=require(_0x7bab('0x2'));var BPromise=require(_0x7bab('0x3'));var rs=require(_0x7bab('0x4'));var fs=require('fs');var Redis=require(_0x7bab('0x5'));var db=require(_0x7bab('0x6'))['db'];var utils=require(_0x7bab('0x7'));var logger=require('../../config/logger')(_0x7bab('0x8'));var config=require('../../config/environment');var jayson=require(_0x7bab('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49fd80,_0x3db98b,_0x567b02){return new BPromise(function(_0x8a738f,_0xd43053){return client['request'](_0x49fd80,_0x567b02)[_0x7bab('0xa')](function(_0x3f8fb2){logger[_0x7bab('0xb')]('VoiceAgentReport,\x20%s,\x20%s',_0x3db98b,_0x7bab('0xc'));logger[_0x7bab('0xd')](_0x7bab('0xe'),_0x3db98b,_0x7bab('0xc'),JSON[_0x7bab('0xf')](_0x3f8fb2));if(_0x3f8fb2[_0x7bab('0x10')]){if(_0x3f8fb2[_0x7bab('0x10')][_0x7bab('0x11')]===0x1f4){logger['error'](_0x7bab('0x12'),_0x3db98b,_0x3f8fb2[_0x7bab('0x10')][_0x7bab('0x13')]);return _0xd43053(_0x3f8fb2[_0x7bab('0x10')]['message']);}logger[_0x7bab('0x10')](_0x7bab('0x12'),_0x3db98b,_0x3f8fb2['error'][_0x7bab('0x13')]);return _0x8a738f(_0x3f8fb2[_0x7bab('0x10')]['message']);}else{logger[_0x7bab('0xb')](_0x7bab('0x12'),_0x3db98b,_0x7bab('0xc'));_0x8a738f(_0x3f8fb2[_0x7bab('0x14')][_0x7bab('0x13')]);}})[_0x7bab('0x15')](function(_0x33077f){logger['error'](_0x7bab('0x12'),_0x3db98b,_0x33077f);_0xd43053(_0x33077f);});});}exports[_0x7bab('0x16')]=function(_0x26b813){var _0x30b4cf=this;return new Promise(function(_0x354a8a,_0x1b61b3){return db[_0x7bab('0x17')][_0x7bab('0x18')](_0x26b813[_0x7bab('0x19')],{'raw':_0x26b813['options']?_0x26b813[_0x7bab('0x1a')][_0x7bab('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5d3587){logger['info']('CreateVoiceAgentReport',_0x26b813);logger[_0x7bab('0xd')](_0x7bab('0x16'),_0x26b813,JSON[_0x7bab('0xf')](_0x5d3587));_0x354a8a(_0x5d3587);})['catch'](function(_0xe1923b){logger['error'](_0x7bab('0x16'),_0xe1923b['message'],_0x26b813);_0x1b61b3(_0x30b4cf['error'](0x1f4,_0xe1923b[_0x7bab('0x13')]));});});};exports['UpdateVoiceAgentReport']=function(_0xb0dc77){var _0x4806dd=this;return new Promise(function(_0x5478d6,_0x1b795f){return db[_0x7bab('0x17')][_0x7bab('0x1c')](_0xb0dc77[_0x7bab('0x19')],{'raw':_0xb0dc77['options']?_0xb0dc77[_0x7bab('0x1a')][_0x7bab('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb0dc77[_0x7bab('0x1a')]?_0xb0dc77[_0x7bab('0x1a')][_0x7bab('0x1d')]||null:null,'attributes':_0xb0dc77['options']?_0xb0dc77[_0x7bab('0x1a')][_0x7bab('0x1e')]||null:null,'limit':_0xb0dc77[_0x7bab('0x1a')]?_0xb0dc77['options'][_0x7bab('0x1f')]||null:null})['then'](function(_0xa2aa01){logger['info'](_0x7bab('0x20'),_0xb0dc77);logger['debug']('UpdateVoiceAgentReport',_0xb0dc77,JSON[_0x7bab('0xf')](_0xa2aa01));_0x5478d6(_0xa2aa01);})[_0x7bab('0x15')](function(_0x246b35){logger[_0x7bab('0x10')](_0x7bab('0x20'),_0x246b35[_0x7bab('0x13')],_0xb0dc77);_0x1b795f(_0x4806dd[_0x7bab('0x10')](0x1f4,_0x246b35['message']));});});}; \ No newline at end of file +var _0x41c0=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','VoiceAgentReport','body','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x116895,_0xf2457e){var _0x51b0d9=function(_0x5e38f6){while(--_0x5e38f6){_0x116895['push'](_0x116895['shift']());}};_0x51b0d9(++_0xf2457e);}(_0x41c0,0x11a));var _0x041c=function(_0x3496d3,_0x4467a2){_0x3496d3=_0x3496d3-0x0;var _0x509096=_0x41c0[_0x3496d3];return _0x509096;};'use strict';var _=require(_0x041c('0x0'));var util=require(_0x041c('0x1'));var moment=require(_0x041c('0x2'));var BPromise=require(_0x041c('0x3'));var rs=require(_0x041c('0x4'));var fs=require('fs');var Redis=require(_0x041c('0x5'));var db=require(_0x041c('0x6'))['db'];var utils=require(_0x041c('0x7'));var logger=require(_0x041c('0x8'))(_0x041c('0x9'));var config=require(_0x041c('0xa'));var jayson=require(_0x041c('0xb'));var client=jayson[_0x041c('0xc')][_0x041c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x13e61e,_0x483375,_0x544c7e){return new BPromise(function(_0x890dc3,_0xd44566){return client['request'](_0x13e61e,_0x544c7e)[_0x041c('0xe')](function(_0x5217ac){logger['info'](_0x041c('0xf'),_0x483375,_0x041c('0x10'));logger[_0x041c('0x11')](_0x041c('0x12'),_0x483375,'request\x20sent',JSON[_0x041c('0x13')](_0x5217ac));if(_0x5217ac['error']){if(_0x5217ac['error'][_0x041c('0x14')]===0x1f4){logger['error'](_0x041c('0xf'),_0x483375,_0x5217ac[_0x041c('0x15')][_0x041c('0x16')]);return _0xd44566(_0x5217ac[_0x041c('0x15')][_0x041c('0x16')]);}logger[_0x041c('0x15')](_0x041c('0xf'),_0x483375,_0x5217ac['error'][_0x041c('0x16')]);return _0x890dc3(_0x5217ac[_0x041c('0x15')][_0x041c('0x16')]);}else{logger[_0x041c('0x17')]('VoiceAgentReport,\x20%s,\x20%s',_0x483375,'request\x20sent');_0x890dc3(_0x5217ac[_0x041c('0x18')][_0x041c('0x16')]);}})[_0x041c('0x19')](function(_0x13cbfa){logger[_0x041c('0x15')]('VoiceAgentReport,\x20%s,\x20%s',_0x483375,_0x13cbfa);_0xd44566(_0x13cbfa);});});}exports['CreateVoiceAgentReport']=function(_0x3393fa){var _0xb368e9=this;return new Promise(function(_0x516a54,_0x30e364){return db[_0x041c('0x1a')]['create'](_0x3393fa[_0x041c('0x1b')],{'raw':_0x3393fa[_0x041c('0x1c')]?_0x3393fa[_0x041c('0x1c')][_0x041c('0x1d')]===undefined?!![]:![]:!![]})[_0x041c('0xe')](function(_0x2b70a4){logger[_0x041c('0x17')](_0x041c('0x1e'),_0x3393fa);logger['debug']('CreateVoiceAgentReport',_0x3393fa,JSON[_0x041c('0x13')](_0x2b70a4));_0x516a54(_0x2b70a4);})['catch'](function(_0x1856fc){logger[_0x041c('0x15')](_0x041c('0x1e'),_0x1856fc['message'],_0x3393fa);_0x30e364(_0xb368e9[_0x041c('0x15')](0x1f4,_0x1856fc[_0x041c('0x16')]));});});};exports[_0x041c('0x1f')]=function(_0x2781b6){var _0x2263a9=this;return new Promise(function(_0x4a3784,_0x3287bb){return db['VoiceAgentReport'][_0x041c('0x20')](_0x2781b6[_0x041c('0x1b')],{'raw':_0x2781b6[_0x041c('0x1c')]?_0x2781b6[_0x041c('0x1c')][_0x041c('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2781b6[_0x041c('0x1c')]?_0x2781b6[_0x041c('0x1c')][_0x041c('0x21')]||null:null,'attributes':_0x2781b6[_0x041c('0x1c')]?_0x2781b6[_0x041c('0x1c')][_0x041c('0x22')]||null:null,'limit':_0x2781b6[_0x041c('0x1c')]?_0x2781b6['options'][_0x041c('0x23')]||null:null})[_0x041c('0xe')](function(_0x28261a){logger[_0x041c('0x17')](_0x041c('0x1f'),_0x2781b6);logger['debug'](_0x041c('0x1f'),_0x2781b6,JSON[_0x041c('0x13')](_0x28261a));_0x4a3784(_0x28261a);})[_0x041c('0x19')](function(_0x4ec011){logger[_0x041c('0x15')](_0x041c('0x1f'),_0x4ec011[_0x041c('0x16')],_0x2781b6);_0x3287bb(_0x2263a9['error'](0x1f4,_0x4ec011[_0x041c('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 5defd67..29ad571 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 _0x3eea=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x134524,_0xbd8a88){var _0x1ff815=function(_0x23e8fc){while(--_0x23e8fc){_0x134524['push'](_0x134524['shift']());}};_0x1ff815(++_0xbd8a88);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x49fdf6,_0xd07072){_0x49fdf6=_0x49fdf6-0x0;var _0x4d11ac=_0x3eea[_0x49fdf6];return _0x4d11ac;};'use strict';var multer=require(_0xa3ee('0x0'));var util=require('util');var path=require(_0xa3ee('0x1'));var timeout=require(_0xa3ee('0x2'));var express=require(_0xa3ee('0x3'));var router=express[_0xa3ee('0x4')]();var fs_extra=require(_0xa3ee('0x5'));var auth=require(_0xa3ee('0x6'));var interaction=require(_0xa3ee('0x7'));var config=require(_0xa3ee('0x8'));var controller=require(_0xa3ee('0x9'));router[_0xa3ee('0xa')]('/',auth[_0xa3ee('0xb')](),controller['index']);router['get'](_0xa3ee('0xc'),auth['isAuthenticated'](),controller[_0xa3ee('0xd')]);router['get'](_0xa3ee('0xe'),auth['isAuthenticated'](),controller[_0xa3ee('0xf')]);router['post']('/',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x10')]);router[_0xa3ee('0x11')]('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x12')]);router['delete']('/:id',auth[_0xa3ee('0xb')](),controller[_0xa3ee('0x13')]);module[_0xa3ee('0x14')]=router; \ No newline at end of file +var _0x277c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','show','post','create','update','delete','destroy','multer','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x277c,0x153));var _0xc277=function(_0x47e48e,_0x38882d){_0x47e48e=_0x47e48e-0x0;var _0x468e15=_0x277c[_0x47e48e];return _0x468e15;};'use strict';var multer=require(_0xc277('0x0'));var util=require('util');var path=require(_0xc277('0x1'));var timeout=require(_0xc277('0x2'));var express=require(_0xc277('0x3'));var router=express[_0xc277('0x4')]();var fs_extra=require(_0xc277('0x5'));var auth=require(_0xc277('0x6'));var interaction=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var controller=require('./voiceCallReport.controller');router['get']('/',auth[_0xc277('0x9')](),controller['index']);router[_0xc277('0xa')]('/describe',auth[_0xc277('0x9')](),controller[_0xc277('0xb')]);router['get'](_0xc277('0xc'),auth[_0xc277('0x9')](),controller[_0xc277('0xd')]);router[_0xc277('0xe')]('/',auth[_0xc277('0x9')](),controller[_0xc277('0xf')]);router['put']('/:id',auth[_0xc277('0x9')](),controller[_0xc277('0x10')]);router[_0xc277('0x11')](_0xc277('0xc'),auth['isAuthenticated'](),controller[_0xc277('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index e691d1a..7cacc1b 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 _0x8292=['INTEGER','sequelize','STRING','ENUM','inbound','outbound','inbound-fax','outbound-fax','TEXT','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8292,0x19b));var _0x2829=function(_0x1a663e,_0x357c47){_0x1a663e=_0x1a663e-0x0;var _0x4055ab=_0x8292[_0x1a663e];return _0x4055ab;};'use strict';var Sequelize=require(_0x2829('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2829('0x1')]},'type':{'type':Sequelize[_0x2829('0x2')](_0x2829('0x3'),'internal',_0x2829('0x4'),_0x2829('0x5'),_0x2829('0x6'),'dialer')},'tag':{'type':Sequelize[_0x2829('0x1')]},'accountcode':{'type':Sequelize[_0x2829('0x1')]},'source':{'type':Sequelize[_0x2829('0x1')]},'destination':{'type':Sequelize[_0x2829('0x1')]},'destinationcontext':{'type':Sequelize[_0x2829('0x1')]},'callerid':{'type':Sequelize[_0x2829('0x1')]},'channel':{'type':Sequelize[_0x2829('0x1')]},'destinationchannel':{'type':Sequelize[_0x2829('0x1')]},'lastapplication':{'type':Sequelize[_0x2829('0x1')]},'lastdata':{'type':Sequelize[_0x2829('0x7')]},'starttime':{'type':Sequelize[_0x2829('0x8')]},'systemanswertime':{'type':Sequelize[_0x2829('0x8')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x2829('0x8')]},'duration':{'type':Sequelize[_0x2829('0x9')]},'billableseconds':{'type':Sequelize[_0x2829('0x9')]},'mohtime':{'type':Sequelize[_0x2829('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x2829('0x1')]},'amaflags':{'type':Sequelize[_0x2829('0x1')]},'userfield':{'type':Sequelize[_0x2829('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x2829('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x2829('0x1')]},'routeid':{'type':Sequelize[_0x2829('0x9')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa9d0=['INTEGER','sequelize','exports','STRING','ENUM','inbound','internal','outbound','TEXT','DATE'];(function(_0x4a6102,_0xedf422){var _0x416650=function(_0x4be9ec){while(--_0x4be9ec){_0x4a6102['push'](_0x4a6102['shift']());}};_0x416650(++_0xedf422);}(_0xa9d0,0x1eb));var _0x0a9d=function(_0x2a0c7e,_0x5b27d4){_0x2a0c7e=_0x2a0c7e-0x0;var _0x57e929=_0xa9d0[_0x2a0c7e];return _0x57e929;};'use strict';var Sequelize=require(_0x0a9d('0x0'));module[_0x0a9d('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9d('0x2')]},'type':{'type':Sequelize[_0x0a9d('0x3')](_0x0a9d('0x4'),_0x0a9d('0x5'),_0x0a9d('0x6'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0x0a9d('0x2')]},'accountcode':{'type':Sequelize[_0x0a9d('0x2')]},'source':{'type':Sequelize[_0x0a9d('0x2')]},'destination':{'type':Sequelize[_0x0a9d('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9d('0x2')]},'callerid':{'type':Sequelize[_0x0a9d('0x2')]},'channel':{'type':Sequelize[_0x0a9d('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9d('0x2')]},'lastdata':{'type':Sequelize[_0x0a9d('0x7')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9d('0x8')]},'answertime':{'type':Sequelize[_0x0a9d('0x8')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x0a9d('0x9')]},'mohtime':{'type':Sequelize[_0x0a9d('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0a9d('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x0a9d('0x2')]},'userDisposition':{'type':Sequelize[_0x0a9d('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x0a9d('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x0a9d('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x0a9d('0x2')]},'routeid':{'type':Sequelize[_0x0a9d('0x9')]},'sipcallid':{'type':Sequelize[_0x0a9d('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index b61eb7a..acdcd55 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 _0x2032=['../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filters','filter','merge','where','options','alias','User','rows','catch','show','params','keys','rawAttributes','includeAll','include','create','body','find','describe','uniqueid','user','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x5aa7b2,_0x52f0b2){_0x5aa7b2=_0x5aa7b2-0x0;var _0xd6b152=_0x2032[_0x5aa7b2];return _0xd6b152;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2203('0x0'));var zipdir=require(_0x2203('0x1'));var jsonpatch=require(_0x2203('0x2'));var rp=require('request-promise');var moment=require(_0x2203('0x3'));var BPromise=require(_0x2203('0x4'));var Mustache=require('mustache');var util=require(_0x2203('0x5'));var path=require(_0x2203('0x6'));var sox=require(_0x2203('0x7'));var csv=require(_0x2203('0x8'));var ejs=require(_0x2203('0x9'));var fs=require('fs');var fs_extra=require(_0x2203('0xa'));var _=require(_0x2203('0xb'));var squel=require(_0x2203('0xc'));var crypto=require(_0x2203('0xd'));var jsforce=require(_0x2203('0xe'));var deskjs=require(_0x2203('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2203('0x10'));var Redis=require('ioredis');var authService=require(_0x2203('0x11'));var qs=require(_0x2203('0x12'));var as=require(_0x2203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2203('0x14'))('api');var utils=require(_0x2203('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2203('0x16'));var db=require(_0x2203('0x17'))['db'];function respondWithStatusCode(_0x4b9376,_0x583bc7){_0x583bc7=_0x583bc7||0xcc;return function(_0x585c76){if(_0x585c76){return _0x4b9376['sendStatus'](_0x583bc7);}return _0x4b9376['status'](_0x583bc7)[_0x2203('0x18')]();};}function respondWithResult(_0x538b30,_0x592e47){_0x592e47=_0x592e47||0xc8;return function(_0x21a3af){if(_0x21a3af){return _0x538b30[_0x2203('0x19')](_0x592e47)[_0x2203('0x1a')](_0x21a3af);}};}function respondWithFilteredResult(_0x41af85,_0x226209){return function(_0x3fe0a8){if(_0x3fe0a8){var _0x2c36e6=typeof _0x226209[_0x2203('0x1b')]===_0x2203('0x1c')&&typeof _0x226209[_0x2203('0x1d')]==='undefined';var _0x280eda=_0x3fe0a8[_0x2203('0x1e')];var _0x4893ff=_0x2c36e6?0x0:_0x226209[_0x2203('0x1b')];var _0x8906e1=_0x2c36e6?_0x3fe0a8['count']:_0x226209[_0x2203('0x1b')]+_0x226209['limit'];var _0x2904ba;if(_0x8906e1>=_0x280eda){_0x8906e1=_0x280eda;_0x2904ba=0xc8;}else{_0x2904ba=0xce;}_0x41af85[_0x2203('0x19')](_0x2904ba);return _0x41af85[_0x2203('0x1f')](_0x2203('0x20'),_0x4893ff+'-'+_0x8906e1+'/'+_0x280eda)[_0x2203('0x1a')](_0x3fe0a8);}return null;};}function patchUpdates(_0x449039){return function(_0x538c23){try{jsonpatch[_0x2203('0x21')](_0x538c23,_0x449039,!![]);}catch(_0x50822b){return BPromise['reject'](_0x50822b);}return _0x538c23[_0x2203('0x22')]();};}function saveUpdates(_0x496d82,_0x3b8ef9){return function(_0x5bfe61){if(_0x5bfe61){return _0x5bfe61['update'](_0x496d82)[_0x2203('0x23')](function(_0x5e29cd){return _0x5e29cd;});}return null;};}function removeEntity(_0x5c8da9,_0x226374){return function(_0x2718f5){if(_0x2718f5){return _0x2718f5[_0x2203('0x24')]()[_0x2203('0x23')](function(){_0x5c8da9[_0x2203('0x19')](0xcc)[_0x2203('0x18')]();});}};}function handleEntityNotFound(_0x49c12,_0x250349){return function(_0x576378){if(!_0x576378){_0x49c12[_0x2203('0x25')](0x194);}return _0x576378;};}function handleError(_0x36b958,_0x39a11a){_0x39a11a=_0x39a11a||0x1f4;return function(_0x5f11bf){logger[_0x2203('0x26')](_0x5f11bf[_0x2203('0x27')]);if(_0x5f11bf['name']){delete _0x5f11bf[_0x2203('0x28')];}_0x36b958[_0x2203('0x19')](_0x39a11a)[_0x2203('0x29')](_0x5f11bf);};}exports[_0x2203('0x2a')]=function(_0x28ae02,_0x1df508){var _0x9c53f={},_0x5a95c1={},_0x34b8ba={'count':0x0,'rows':[]};var _0x616ed8=_[_0x2203('0x2b')](db[_0x2203('0x2c')]['rawAttributes'],function(_0x3a8e23){return{'name':_0x3a8e23[_0x2203('0x2d')],'type':_0x3a8e23[_0x2203('0x2e')][_0x2203('0x2f')]};});_0x5a95c1['model']=_[_0x2203('0x2b')](_0x616ed8,_0x2203('0x28'));_0x5a95c1['query']=_['keys'](_0x28ae02[_0x2203('0x30')]);_0x5a95c1['filters']=_['intersection'](_0x5a95c1[_0x2203('0x31')],_0x5a95c1[_0x2203('0x30')]);_0x9c53f[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5a95c1[_0x2203('0x31')],qs['fields'](_0x28ae02[_0x2203('0x30')][_0x2203('0x34')]));_0x9c53f['attributes']=_0x9c53f[_0x2203('0x32')][_0x2203('0x35')]?_0x9c53f[_0x2203('0x32')]:_0x5a95c1[_0x2203('0x31')];if(!_0x28ae02[_0x2203('0x30')][_0x2203('0x36')](_0x2203('0x37'))){_0x9c53f[_0x2203('0x1d')]=qs[_0x2203('0x1d')](_0x28ae02['query'][_0x2203('0x1d')]);_0x9c53f[_0x2203('0x1b')]=qs['offset'](_0x28ae02['query'][_0x2203('0x1b')]);}_0x9c53f['order']=qs[_0x2203('0x38')](_0x28ae02[_0x2203('0x30')][_0x2203('0x38')]);_0x9c53f['where']=qs['filters'](_[_0x2203('0x39')](_0x28ae02['query'],_0x5a95c1[_0x2203('0x3a')]),_0x616ed8);if(_0x28ae02['query'][_0x2203('0x3b')]){_0x9c53f['where']=_[_0x2203('0x3c')](_0x9c53f[_0x2203('0x3d')],{'$or':_[_0x2203('0x2b')](_0x616ed8,function(_0x40a793){if(_0x40a793[_0x2203('0x2e')]!=='VIRTUAL'){var _0x5f1561={};_0x5f1561[_0x40a793['name']]={'$like':'%'+_0x28ae02[_0x2203('0x30')][_0x2203('0x3b')]+'%'};return _0x5f1561;}})});}_0x9c53f=_[_0x2203('0x3c')]({},_0x9c53f,_0x28ae02[_0x2203('0x3e')]);var _0x3283fb={'where':_0x9c53f[_0x2203('0x3d')]};return db[_0x2203('0x2c')]['count'](_0x3283fb)[_0x2203('0x23')](function(_0x1b12c3){_0x34b8ba[_0x2203('0x1e')]=_0x1b12c3;if(_0x28ae02[_0x2203('0x30')]['includeAll']){_0x9c53f['include']=[{'attributes':['id',_0x2203('0x28'),'fullname',_0x2203('0x3f')],'model':db[_0x2203('0x40')],'as':_0x2203('0x40')}];}return db['VoiceCallReport']['findAll'](_0x9c53f);})[_0x2203('0x23')](function(_0x3739f6){_0x34b8ba[_0x2203('0x41')]=_0x3739f6;return _0x34b8ba;})[_0x2203('0x23')](respondWithFilteredResult(_0x1df508,_0x9c53f))[_0x2203('0x42')](handleError(_0x1df508,null));};exports[_0x2203('0x43')]=function(_0x5cd573,_0x15d3b6){var _0x165a3f={'raw':!![],'where':{'id':_0x5cd573[_0x2203('0x44')]['id']}},_0x3a866c={};_0x3a866c[_0x2203('0x31')]=_[_0x2203('0x45')](db[_0x2203('0x2c')][_0x2203('0x46')]);_0x3a866c[_0x2203('0x30')]=_[_0x2203('0x45')](_0x5cd573['query']);_0x3a866c[_0x2203('0x3a')]=_[_0x2203('0x33')](_0x3a866c[_0x2203('0x31')],_0x3a866c[_0x2203('0x30')]);_0x165a3f['attributes']=_['intersection'](_0x3a866c[_0x2203('0x31')],qs['fields'](_0x5cd573[_0x2203('0x30')][_0x2203('0x34')]));_0x165a3f[_0x2203('0x32')]=_0x165a3f[_0x2203('0x32')]['length']?_0x165a3f[_0x2203('0x32')]:_0x3a866c[_0x2203('0x31')];if(_0x5cd573['query'][_0x2203('0x47')]){_0x165a3f[_0x2203('0x48')]=[{'all':!![]}];}_0x165a3f=_[_0x2203('0x3c')]({},_0x165a3f,_0x5cd573[_0x2203('0x3e')]);return db['VoiceCallReport']['find'](_0x165a3f)[_0x2203('0x23')](handleEntityNotFound(_0x15d3b6,null))['then'](respondWithResult(_0x15d3b6,null))['catch'](handleError(_0x15d3b6,null));};exports[_0x2203('0x49')]=function(_0x33b7b5,_0x1a2665){return db['VoiceCallReport']['create'](_0x33b7b5[_0x2203('0x4a')],{})[_0x2203('0x23')](respondWithResult(_0x1a2665,0xc9))[_0x2203('0x42')](handleError(_0x1a2665,null));};exports[_0x2203('0x24')]=function(_0x225b0e,_0x21fd78){return db['VoiceCallReport'][_0x2203('0x4b')]({'where':{'id':_0x225b0e['params']['id']}})[_0x2203('0x23')](handleEntityNotFound(_0x21fd78,null))[_0x2203('0x23')](removeEntity(_0x21fd78,null))[_0x2203('0x42')](handleError(_0x21fd78,null));};exports[_0x2203('0x4c')]=function(_0x58b9bb,_0x506795){return db[_0x2203('0x2c')][_0x2203('0x4c')]()[_0x2203('0x23')](respondWithResult(_0x506795,null))[_0x2203('0x42')](handleError(_0x506795,null));};exports['update']=function(_0x4de47a,_0x49999a){if(_0x4de47a[_0x2203('0x4a')][_0x2203('0x4d')]){delete _0x4de47a['body'][_0x2203('0x4d')];}return db[_0x2203('0x2c')]['find']({'where':{'uniqueid':_0x4de47a[_0x2203('0x44')]['id'],'UserId':{'$or':[null,_0x4de47a[_0x2203('0x4e')]['id']]}}})[_0x2203('0x23')](handleEntityNotFound(_0x49999a,null))[_0x2203('0x23')](saveUpdates(_0x4de47a['body'],null))[_0x2203('0x23')](respondWithResult(_0x49999a,null))['catch'](handleError(_0x49999a,null));}; \ No newline at end of file +var _0x2ef3=['pick','filter','merge','options','VoiceCallReport','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','keys','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x2ef3,0xba));var _0x32ef=function(_0x4003e1,_0x4bc295){_0x4003e1=_0x4003e1-0x0;var _0x3d864b=_0x2ef3[_0x4003e1];return _0x3d864b;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['VoiceCallReport'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'attributes':['id',_0x32ef('0x27'),_0x32ef('0x41'),_0x32ef('0x42')],'model':db[_0x32ef('0x43')],'as':'User'}];}return db['VoiceCallReport'][_0x32ef('0x44')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x2a33dd){_0x3c569d[_0x32ef('0x45')]=_0x2a33dd;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x46')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x47')]=function(_0x5d2f06,_0x4744ba){var _0x4bc5bc={'raw':!![],'where':{'id':_0x5d2f06[_0x32ef('0x48')]['id']}},_0xcb3c08={};_0xcb3c08[_0x32ef('0x2e')]=_[_0x32ef('0x49')](db[_0x32ef('0x3d')][_0x32ef('0x2a')]);_0xcb3c08[_0x32ef('0x2f')]=_[_0x32ef('0x49')](_0x5d2f06[_0x32ef('0x2f')]);_0xcb3c08[_0x32ef('0x30')]=_['intersection'](_0xcb3c08[_0x32ef('0x2e')],_0xcb3c08['query']);_0x4bc5bc[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0xcb3c08[_0x32ef('0x2e')],qs['fields'](_0x5d2f06[_0x32ef('0x2f')][_0x32ef('0x33')]));_0x4bc5bc[_0x32ef('0x31')]=_0x4bc5bc[_0x32ef('0x31')][_0x32ef('0x34')]?_0x4bc5bc[_0x32ef('0x31')]:_0xcb3c08[_0x32ef('0x2e')];if(_0x5d2f06['query']['includeAll']){_0x4bc5bc[_0x32ef('0x40')]=[{'all':!![]}];}_0x4bc5bc=_[_0x32ef('0x3b')]({},_0x4bc5bc,_0x5d2f06[_0x32ef('0x3c')]);return db[_0x32ef('0x3d')][_0x32ef('0x4a')](_0x4bc5bc)[_0x32ef('0x3e')](handleEntityNotFound(_0x4744ba,null))[_0x32ef('0x3e')](respondWithResult(_0x4744ba,null))[_0x32ef('0x46')](handleError(_0x4744ba,null));};exports[_0x32ef('0x4b')]=function(_0x1ebedf,_0x35a294){return db[_0x32ef('0x3d')][_0x32ef('0x4b')](_0x1ebedf['body'],{})[_0x32ef('0x3e')](respondWithResult(_0x35a294,0xc9))[_0x32ef('0x46')](handleError(_0x35a294,null));};exports[_0x32ef('0x4c')]=function(_0xd42609,_0x1cc9f3){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'id':_0xd42609[_0x32ef('0x48')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x1cc9f3,null))[_0x32ef('0x3e')](removeEntity(_0x1cc9f3,null))[_0x32ef('0x46')](handleError(_0x1cc9f3,null));};exports[_0x32ef('0x4d')]=function(_0x272377,_0x326445){return db[_0x32ef('0x3d')][_0x32ef('0x4d')]()[_0x32ef('0x3e')](respondWithResult(_0x326445,null))[_0x32ef('0x46')](handleError(_0x326445,null));};exports['update']=function(_0x515ac9,_0x179c2f){if(_0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')]){delete _0x515ac9[_0x32ef('0x4e')][_0x32ef('0x4f')];}return db[_0x32ef('0x3d')][_0x32ef('0x4a')]({'where':{'uniqueid':_0x515ac9[_0x32ef('0x48')]['id'],'UserId':{'$or':[null,_0x515ac9[_0x32ef('0x50')]['id']]}}})[_0x32ef('0x3e')](handleEntityNotFound(_0x179c2f,null))[_0x32ef('0x3e')](saveUpdates(_0x515ac9['body'],null))[_0x32ef('0x3e')](respondWithResult(_0x179c2f,null))[_0x32ef('0x46')](handleError(_0x179c2f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 3461c5c..77623fc 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 _0xa4b6=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','define','VoiceCallReport','report_call','uniqueid','lodash','util'];(function(_0x4c71cb,_0x3ad5d2){var _0x2153d7=function(_0x5176c7){while(--_0x5176c7){_0x4c71cb['push'](_0x4c71cb['shift']());}};_0x2153d7(++_0x3ad5d2);}(_0xa4b6,0x150));var _0x6a4b=function(_0x411a1e,_0x1f23be){_0x411a1e=_0x411a1e-0x0;var _0x17b4b0=_0xa4b6[_0x411a1e];return _0x17b4b0;};'use strict';var _=require(_0x6a4b('0x0'));var util=require(_0x6a4b('0x1'));var logger=require(_0x6a4b('0x2'))(_0x6a4b('0x3'));var moment=require(_0x6a4b('0x4'));var BPromise=require('bluebird');var rp=require(_0x6a4b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a4b('0x6'));var config=require(_0x6a4b('0x7'));var attributes=require(_0x6a4b('0x8'));module['exports']=function(_0x430306,_0x47bd29){return _0x430306[_0x6a4b('0x9')](_0x6a4b('0xa'),attributes,{'tableName':_0x6a4b('0xb'),'paranoid':![],'indexes':[{'fields':[_0x6a4b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf911=['VoiceCallReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x2d7529,_0x344e62){var _0x511e66=function(_0x5e5ba2){while(--_0x5e5ba2){_0x2d7529['push'](_0x2d7529['shift']());}};_0x511e66(++_0x344e62);}(_0xf911,0xe2));var _0x1f91=function(_0x246b48,_0x35a292){_0x246b48=_0x246b48-0x0;var _0x3ba4d8=_0xf911[_0x246b48];return _0x3ba4d8;};'use strict';var _=require(_0x1f91('0x0'));var util=require(_0x1f91('0x1'));var logger=require(_0x1f91('0x2'))(_0x1f91('0x3'));var moment=require(_0x1f91('0x4'));var BPromise=require(_0x1f91('0x5'));var rp=require(_0x1f91('0x6'));var fs=require('fs');var path=require(_0x1f91('0x7'));var rimraf=require('rimraf');var config=require(_0x1f91('0x8'));var attributes=require(_0x1f91('0x9'));module[_0x1f91('0xa')]=function(_0x3a431c,_0x5deea8){return _0x3a431c[_0x1f91('0xb')](_0x1f91('0xc'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x1f91('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 5693a4d..fd10422 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 _0xad67=['include','map','model','catch','CreateVoiceCallReport','VoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetVoiceCallReport','findAll','options','raw','where','attributes','limit'];(function(_0x872f6f,_0x5efe7b){var _0x59a5f4=function(_0x147463){while(--_0x147463){_0x872f6f['push'](_0x872f6f['shift']());}};_0x59a5f4(++_0x5efe7b);}(_0xad67,0xd2));var _0x7ad6=function(_0x2d1fdb,_0x50d2de){_0x2d1fdb=_0x2d1fdb-0x0;var _0x19e74b=_0xad67[_0x2d1fdb];return _0x19e74b;};'use strict';var _=require(_0x7ad6('0x0'));var util=require(_0x7ad6('0x1'));var moment=require(_0x7ad6('0x2'));var BPromise=require(_0x7ad6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ad6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ad6('0x5'));var logger=require('../../config/logger')(_0x7ad6('0x6'));var config=require(_0x7ad6('0x7'));var jayson=require(_0x7ad6('0x8'));var client=jayson[_0x7ad6('0x9')][_0x7ad6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x105889,_0x1c4ebb,_0x307fbd){return new BPromise(function(_0x285bd2,_0x180d7a){return client[_0x7ad6('0xb')](_0x105889,_0x307fbd)[_0x7ad6('0xc')](function(_0x1e8aec){logger[_0x7ad6('0xd')](_0x7ad6('0xe'),_0x1c4ebb,'request\x20sent');logger[_0x7ad6('0xf')](_0x7ad6('0x10'),_0x1c4ebb,'request\x20sent',JSON[_0x7ad6('0x11')](_0x1e8aec));if(_0x1e8aec[_0x7ad6('0x12')]){if(_0x1e8aec['error'][_0x7ad6('0x13')]===0x1f4){logger[_0x7ad6('0x12')](_0x7ad6('0xe'),_0x1c4ebb,_0x1e8aec[_0x7ad6('0x12')][_0x7ad6('0x14')]);return _0x180d7a(_0x1e8aec['error'][_0x7ad6('0x14')]);}logger[_0x7ad6('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x1c4ebb,_0x1e8aec[_0x7ad6('0x12')][_0x7ad6('0x14')]);return _0x285bd2(_0x1e8aec[_0x7ad6('0x12')]['message']);}else{logger[_0x7ad6('0xd')](_0x7ad6('0xe'),_0x1c4ebb,_0x7ad6('0x15'));_0x285bd2(_0x1e8aec[_0x7ad6('0x16')]['message']);}})['catch'](function(_0x2c13ae){logger['error'](_0x7ad6('0xe'),_0x1c4ebb,_0x2c13ae);_0x180d7a(_0x2c13ae);});});}exports[_0x7ad6('0x17')]=function(_0x49e28a){var _0x5a375a=this;return new Promise(function(_0x9e5db1,_0x5dc4c8){return db['VoiceCallReport'][_0x7ad6('0x18')]({'raw':_0x49e28a[_0x7ad6('0x19')]?_0x49e28a[_0x7ad6('0x19')][_0x7ad6('0x1a')]===undefined?!![]:![]:!![],'where':_0x49e28a[_0x7ad6('0x19')]?_0x49e28a['options'][_0x7ad6('0x1b')]||null:null,'attributes':_0x49e28a[_0x7ad6('0x19')]?_0x49e28a[_0x7ad6('0x19')][_0x7ad6('0x1c')]||null:null,'limit':_0x49e28a[_0x7ad6('0x19')]?_0x49e28a[_0x7ad6('0x19')][_0x7ad6('0x1d')]||null:null,'include':_0x49e28a[_0x7ad6('0x19')]?_0x49e28a['options'][_0x7ad6('0x1e')]?_[_0x7ad6('0x1f')](_0x49e28a[_0x7ad6('0x19')][_0x7ad6('0x1e')],function(_0x446d2c){return{'model':db[_0x446d2c['model']],'as':_0x446d2c['as'],'attributes':_0x446d2c[_0x7ad6('0x1c')],'include':_0x446d2c[_0x7ad6('0x1e')]?_[_0x7ad6('0x1f')](_0x446d2c['include'],function(_0x2f0aa9){return{'model':db[_0x2f0aa9[_0x7ad6('0x20')]],'as':_0x2f0aa9['as'],'attributes':_0x2f0aa9[_0x7ad6('0x1c')],'include':_0x2f0aa9[_0x7ad6('0x1e')]?_[_0x7ad6('0x1f')](_0x2f0aa9[_0x7ad6('0x1e')],function(_0x3f3f8f){return{'model':db[_0x3f3f8f[_0x7ad6('0x20')]],'as':_0x3f3f8f['as'],'attributes':_0x3f3f8f[_0x7ad6('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xcb5610){logger[_0x7ad6('0xd')](_0x7ad6('0x17'),_0x49e28a);logger['debug']('GetVoiceCallReport',_0x49e28a,JSON[_0x7ad6('0x11')](_0xcb5610));_0x9e5db1(_0xcb5610);})[_0x7ad6('0x21')](function(_0x5b7308){logger[_0x7ad6('0x12')](_0x7ad6('0x17'),_0x5b7308[_0x7ad6('0x14')],_0x49e28a);_0x5dc4c8(_0x5a375a['error'](0x1f4,_0x5b7308['message']));});});};exports[_0x7ad6('0x22')]=function(_0x1ed18a){var _0x5ed2dd=this;return new Promise(function(_0x22798b,_0x3be7e1){return db[_0x7ad6('0x23')][_0x7ad6('0x24')](_0x1ed18a[_0x7ad6('0x25')],{'raw':_0x1ed18a[_0x7ad6('0x19')]?_0x1ed18a['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3fedc5){logger[_0x7ad6('0xd')](_0x7ad6('0x22'),_0x1ed18a);logger[_0x7ad6('0xf')](_0x7ad6('0x22'),_0x1ed18a,JSON[_0x7ad6('0x11')](_0x3fedc5));_0x22798b(_0x3fedc5);})['catch'](function(_0x460005){logger[_0x7ad6('0x12')]('CreateVoiceCallReport',_0x460005[_0x7ad6('0x14')],_0x1ed18a);_0x3be7e1(_0x5ed2dd['error'](0x1f4,_0x460005[_0x7ad6('0x14')]));});});};exports[_0x7ad6('0x26')]=function(_0x3dc78d){var _0x439590=this;return new Promise(function(_0x424d58,_0x369c4c){return db['VoiceCallReport'][_0x7ad6('0x27')](_0x3dc78d[_0x7ad6('0x25')],{'raw':_0x3dc78d[_0x7ad6('0x19')]?_0x3dc78d['options'][_0x7ad6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3dc78d[_0x7ad6('0x19')]?_0x3dc78d[_0x7ad6('0x19')][_0x7ad6('0x1b')]||null:null,'attributes':_0x3dc78d[_0x7ad6('0x19')]?_0x3dc78d[_0x7ad6('0x19')]['attributes']||null:null,'limit':_0x3dc78d[_0x7ad6('0x19')]?_0x3dc78d['options'][_0x7ad6('0x1d')]||null:null})[_0x7ad6('0xc')](function(_0x4852fd){logger[_0x7ad6('0xd')](_0x7ad6('0x26'),_0x3dc78d);logger[_0x7ad6('0xf')](_0x7ad6('0x26'),_0x3dc78d,JSON['stringify'](_0x4852fd));_0x424d58(_0x4852fd);})['catch'](function(_0x2fc054){logger[_0x7ad6('0x12')]('UpdateVoiceCallReport',_0x2fc054['message'],_0x3dc78d);_0x369c4c(_0x439590[_0x7ad6('0x12')](0x1f4,_0x2fc054['message']));});});}; \ No newline at end of file +var _0xe957=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceCallReport,\x20%s,\x20%s','message','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','include','map','model','then','create','body','CreateVoiceCallReport','stringify','UpdateVoiceCallReport','update','where','limit','catch','lodash','moment','bluebird','randomstring'];(function(_0x2261a1,_0x5a5ba9){var _0xe8987d=function(_0x389d1f){while(--_0x389d1f){_0x2261a1['push'](_0x2261a1['shift']());}};_0xe8987d(++_0x5a5ba9);}(_0xe957,0x114));var _0x7e95=function(_0x3b3dab,_0x4b9fb0){_0x3b3dab=_0x3b3dab-0x0;var _0x1fab57=_0xe957[_0x3b3dab];return _0x1fab57;};'use strict';var _=require(_0x7e95('0x0'));var util=require('util');var moment=require(_0x7e95('0x1'));var BPromise=require(_0x7e95('0x2'));var rs=require(_0x7e95('0x3'));var fs=require('fs');var Redis=require(_0x7e95('0x4'));var db=require(_0x7e95('0x5'))['db'];var utils=require(_0x7e95('0x6'));var logger=require(_0x7e95('0x7'))(_0x7e95('0x8'));var config=require(_0x7e95('0x9'));var jayson=require(_0x7e95('0xa'));var client=jayson['client'][_0x7e95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53e306,_0x49d28f,_0x5d7d49){return new BPromise(function(_0x21905d,_0x36ba85){return client[_0x7e95('0xc')](_0x53e306,_0x5d7d49)['then'](function(_0x210ba4){logger[_0x7e95('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x49d28f,'request\x20sent');logger[_0x7e95('0xe')](_0x7e95('0xf'),_0x49d28f,_0x7e95('0x10'),JSON['stringify'](_0x210ba4));if(_0x210ba4[_0x7e95('0x11')]){if(_0x210ba4[_0x7e95('0x11')][_0x7e95('0x12')]===0x1f4){logger[_0x7e95('0x11')](_0x7e95('0x13'),_0x49d28f,_0x210ba4[_0x7e95('0x11')]['message']);return _0x36ba85(_0x210ba4[_0x7e95('0x11')][_0x7e95('0x14')]);}logger[_0x7e95('0x11')](_0x7e95('0x13'),_0x49d28f,_0x210ba4[_0x7e95('0x11')][_0x7e95('0x14')]);return _0x21905d(_0x210ba4[_0x7e95('0x11')][_0x7e95('0x14')]);}else{logger[_0x7e95('0xd')](_0x7e95('0x13'),_0x49d28f,_0x7e95('0x10'));_0x21905d(_0x210ba4['result']['message']);}})['catch'](function(_0x21f885){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x49d28f,_0x21f885);_0x36ba85(_0x21f885);});});}exports[_0x7e95('0x15')]=function(_0x5d2581){var _0x3ad059=this;return new Promise(function(_0x286646,_0x554e86){return db[_0x7e95('0x16')][_0x7e95('0x17')]({'raw':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')][_0x7e95('0x19')]===undefined?!![]:![]:!![],'where':_0x5d2581[_0x7e95('0x18')]?_0x5d2581['options']['where']||null:null,'attributes':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')][_0x7e95('0x1a')]||null:null,'limit':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')]['limit']||null:null,'include':_0x5d2581[_0x7e95('0x18')]?_0x5d2581[_0x7e95('0x18')][_0x7e95('0x1b')]?_[_0x7e95('0x1c')](_0x5d2581[_0x7e95('0x18')]['include'],function(_0x89962c){return{'model':db[_0x89962c['model']],'as':_0x89962c['as'],'attributes':_0x89962c[_0x7e95('0x1a')],'include':_0x89962c[_0x7e95('0x1b')]?_[_0x7e95('0x1c')](_0x89962c[_0x7e95('0x1b')],function(_0x2a34cf){return{'model':db[_0x2a34cf[_0x7e95('0x1d')]],'as':_0x2a34cf['as'],'attributes':_0x2a34cf[_0x7e95('0x1a')],'include':_0x2a34cf[_0x7e95('0x1b')]?_[_0x7e95('0x1c')](_0x2a34cf[_0x7e95('0x1b')],function(_0x50caf6){return{'model':db[_0x50caf6[_0x7e95('0x1d')]],'as':_0x50caf6['as'],'attributes':_0x50caf6['attributes']};}):[]};}):[]};}):[]:[]})[_0x7e95('0x1e')](function(_0x33bed9){logger['info'](_0x7e95('0x15'),_0x5d2581);logger[_0x7e95('0xe')](_0x7e95('0x15'),_0x5d2581,JSON['stringify'](_0x33bed9));_0x286646(_0x33bed9);})['catch'](function(_0x454580){logger[_0x7e95('0x11')]('GetVoiceCallReport',_0x454580['message'],_0x5d2581);_0x554e86(_0x3ad059[_0x7e95('0x11')](0x1f4,_0x454580[_0x7e95('0x14')]));});});};exports['CreateVoiceCallReport']=function(_0x3a57a2){var _0x2d8721=this;return new Promise(function(_0x3a9552,_0x370e9a){return db[_0x7e95('0x16')][_0x7e95('0x1f')](_0x3a57a2[_0x7e95('0x20')],{'raw':_0x3a57a2[_0x7e95('0x18')]?_0x3a57a2[_0x7e95('0x18')][_0x7e95('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2e2e09){logger[_0x7e95('0xd')](_0x7e95('0x21'),_0x3a57a2);logger[_0x7e95('0xe')](_0x7e95('0x21'),_0x3a57a2,JSON[_0x7e95('0x22')](_0x2e2e09));_0x3a9552(_0x2e2e09);})['catch'](function(_0x203de9){logger[_0x7e95('0x11')](_0x7e95('0x21'),_0x203de9[_0x7e95('0x14')],_0x3a57a2);_0x370e9a(_0x2d8721[_0x7e95('0x11')](0x1f4,_0x203de9[_0x7e95('0x14')]));});});};exports[_0x7e95('0x23')]=function(_0x15bc0d){var _0xbbee1a=this;return new Promise(function(_0x8a47b3,_0x206656){return db[_0x7e95('0x16')][_0x7e95('0x24')](_0x15bc0d[_0x7e95('0x20')],{'raw':_0x15bc0d[_0x7e95('0x18')]?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15bc0d['options']?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x25')]||null:null,'attributes':_0x15bc0d[_0x7e95('0x18')]?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x1a')]||null:null,'limit':_0x15bc0d[_0x7e95('0x18')]?_0x15bc0d[_0x7e95('0x18')][_0x7e95('0x26')]||null:null})[_0x7e95('0x1e')](function(_0x2f3e85){logger[_0x7e95('0xd')]('UpdateVoiceCallReport',_0x15bc0d);logger[_0x7e95('0xe')](_0x7e95('0x23'),_0x15bc0d,JSON[_0x7e95('0x22')](_0x2f3e85));_0x8a47b3(_0x2f3e85);})[_0x7e95('0x27')](function(_0x148157){logger[_0x7e95('0x11')](_0x7e95('0x23'),_0x148157['message'],_0x15bc0d);_0x206656(_0xbbee1a[_0x7e95('0x11')](0x1f4,_0x148157[_0x7e95('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index fcf21c0..68faa6f 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 _0xd46a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0xc21e84,_0x567b17){var _0x7e1bb4=function(_0x37ac7b){while(--_0x37ac7b){_0xc21e84['push'](_0xc21e84['shift']());}};_0x7e1bb4(++_0x567b17);}(_0xd46a,0x152));var _0xad46=function(_0x5e2cfa,_0x520fcc){_0x5e2cfa=_0x5e2cfa-0x0;var _0x5c4701=_0xd46a[_0x5e2cfa];return _0x5c4701;};'use strict';var multer=require(_0xad46('0x0'));var util=require(_0xad46('0x1'));var path=require(_0xad46('0x2'));var timeout=require(_0xad46('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xad46('0x4'));var auth=require(_0xad46('0x5'));var interaction=require(_0xad46('0x6'));var config=require(_0xad46('0x7'));var controller=require(_0xad46('0x8'));router[_0xad46('0x9')]('/',auth[_0xad46('0xa')](),controller[_0xad46('0xb')]);router[_0xad46('0x9')](_0xad46('0xc'),auth[_0xad46('0xa')](),controller['show']);router[_0xad46('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xad46('0xe')]('/:id',auth[_0xad46('0xa')](),controller[_0xad46('0xf')]);router[_0xad46('0x10')](_0xad46('0xc'),auth[_0xad46('0xa')](),controller[_0xad46('0x11')]);module[_0xad46('0x12')]=router; \ No newline at end of file +var _0x31b9=['./voiceChanSpy.controller','get','isAuthenticated','index','show','post','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x59514c,_0x2a8f92){var _0xa94316=function(_0x1c0fdf){while(--_0x1c0fdf){_0x59514c['push'](_0x59514c['shift']());}};_0xa94316(++_0x2a8f92);}(_0x31b9,0x1d2));var _0x931b=function(_0x13e623,_0x2daa29){_0x13e623=_0x13e623-0x0;var _0x2a78e6=_0x31b9[_0x13e623];return _0x2a78e6;};'use strict';var multer=require(_0x931b('0x0'));var util=require(_0x931b('0x1'));var path=require(_0x931b('0x2'));var timeout=require(_0x931b('0x3'));var express=require(_0x931b('0x4'));var router=express['Router']();var fs_extra=require(_0x931b('0x5'));var auth=require(_0x931b('0x6'));var interaction=require(_0x931b('0x7'));var config=require(_0x931b('0x8'));var controller=require(_0x931b('0x9'));router[_0x931b('0xa')]('/',auth[_0x931b('0xb')](),controller[_0x931b('0xc')]);router[_0x931b('0xa')]('/:id',auth[_0x931b('0xb')](),controller[_0x931b('0xd')]);router[_0x931b('0xe')]('/',auth[_0x931b('0xb')](),controller['create']);router['put'](_0x931b('0xf'),auth[_0x931b('0xb')](),controller[_0x931b('0x10')]);router[_0x931b('0x11')](_0x931b('0xf'),auth[_0x931b('0xb')](),controller['destroy']);module[_0x931b('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 4970f9f..e14871d 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 _0xd90d=['BOOLEAN','sequelize','STRING','name','setDataValue','options','join','getDataValue','split'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0xd90d,0xac));var _0xdd90=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xd90d[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0xdd90('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd90('0x1')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xdd90('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xdd90('0x1')],'set':function(_0x1448d7){this[_0xdd90('0x3')](_0xdd90('0x4'),_0x1448d7?_0x1448d7[_0xdd90('0x5')](''):[]);},'get':function(){return this[_0xdd90('0x6')](_0xdd90('0x4'))?this[_0xdd90('0x6')](_0xdd90('0x4'))[_0xdd90('0x7')](''):[];}},'auth':{'type':Sequelize[_0xdd90('0x8')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xdd90('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xdd90('0x1')]},'description':{'type':Sequelize[_0xdd90('0x1')]}}; \ No newline at end of file +var _0xc81e=['split','BOOLEAN','exports','STRING','name','setDataValue','options','getDataValue'];(function(_0x4e7bd6,_0x4f8bdd){var _0x431fbb=function(_0x1cef7b){while(--_0x1cef7b){_0x4e7bd6['push'](_0x4e7bd6['shift']());}};_0x431fbb(++_0x4f8bdd);}(_0xc81e,0xea));var _0xec81=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0xc81e[_0x2c0dc0];return _0x4c0990;};'use strict';var Sequelize=require('sequelize');module[_0xec81('0x0')]={'name':{'type':Sequelize[_0xec81('0x1')]},'prefix':{'type':Sequelize[_0xec81('0x1')],'unique':_0xec81('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xec81('0x1')],'set':function(_0x8f4e44){this[_0xec81('0x3')](_0xec81('0x4'),_0x8f4e44?_0x8f4e44['join'](''):[]);},'get':function(){return this['getDataValue'](_0xec81('0x4'))?this[_0xec81('0x5')](_0xec81('0x4'))[_0xec81('0x6')](''):[];}},'auth':{'type':Sequelize[_0xec81('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xec81('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xec81('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7130892..8591d05 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 _0x8b7c=['stack','name','send','map','VoiceChanSpy','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','catch','show','params','rawAttributes','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','get','ChanSpies','UserProfileResource','sendStatus','error'];(function(_0x5ce27e,_0x4eb917){var _0x5b0ef2=function(_0x1fa34f){while(--_0x1fa34f){_0x5ce27e['push'](_0x5ce27e['shift']());}};_0x5b0ef2(++_0x4eb917);}(_0x8b7c,0x119));var _0xc8b7=function(_0x1d3fdc,_0x2b5c54){_0x1d3fdc=_0x1d3fdc-0x0;var _0x128bb0=_0x8b7c[_0x1d3fdc];return _0x128bb0;};'use strict';var emlformat=require(_0xc8b7('0x0'));var rimraf=require(_0xc8b7('0x1'));var zipdir=require(_0xc8b7('0x2'));var jsonpatch=require(_0xc8b7('0x3'));var rp=require(_0xc8b7('0x4'));var moment=require(_0xc8b7('0x5'));var BPromise=require(_0xc8b7('0x6'));var Mustache=require(_0xc8b7('0x7'));var util=require('util');var path=require(_0xc8b7('0x8'));var sox=require(_0xc8b7('0x9'));var csv=require(_0xc8b7('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8b7('0xb'));var _=require(_0xc8b7('0xc'));var squel=require(_0xc8b7('0xd'));var crypto=require(_0xc8b7('0xe'));var jsforce=require(_0xc8b7('0xf'));var deskjs=require(_0xc8b7('0x10'));var toCsv=require('to-csv');var querystring=require(_0xc8b7('0x11'));var Papa=require('papaparse');var Redis=require(_0xc8b7('0x12'));var authService=require(_0xc8b7('0x13'));var qs=require(_0xc8b7('0x14'));var as=require(_0xc8b7('0x15'));var hardwareService=require(_0xc8b7('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc8b7('0x17'));var licenseUtil=require(_0xc8b7('0x18'));var db=require(_0xc8b7('0x19'))['db'];function respondWithStatusCode(_0x21ec4f,_0x5063ad){_0x5063ad=_0x5063ad||0xcc;return function(_0x5495e9){if(_0x5495e9){return _0x21ec4f['sendStatus'](_0x5063ad);}return _0x21ec4f[_0xc8b7('0x1a')](_0x5063ad)[_0xc8b7('0x1b')]();};}function respondWithResult(_0x38da92,_0x5c6e5b){_0x5c6e5b=_0x5c6e5b||0xc8;return function(_0x19d3ea){if(_0x19d3ea){return _0x38da92[_0xc8b7('0x1a')](_0x5c6e5b)[_0xc8b7('0x1c')](_0x19d3ea);}};}function respondWithFilteredResult(_0x1b7dc0,_0x3d189e){return function(_0x5d412e){if(_0x5d412e){var _0xb53183=typeof _0x3d189e[_0xc8b7('0x1d')]===_0xc8b7('0x1e')&&typeof _0x3d189e[_0xc8b7('0x1f')]===_0xc8b7('0x1e');var _0x186dbd=_0x5d412e[_0xc8b7('0x20')];var _0x485415=_0xb53183?0x0:_0x3d189e['offset'];var _0x1cf47c=_0xb53183?_0x5d412e[_0xc8b7('0x20')]:_0x3d189e[_0xc8b7('0x1d')]+_0x3d189e['limit'];var _0x5df9f7;if(_0x1cf47c>=_0x186dbd){_0x1cf47c=_0x186dbd;_0x5df9f7=0xc8;}else{_0x5df9f7=0xce;}_0x1b7dc0[_0xc8b7('0x1a')](_0x5df9f7);return _0x1b7dc0['set'](_0xc8b7('0x21'),_0x485415+'-'+_0x1cf47c+'/'+_0x186dbd)['json'](_0x5d412e);}return null;};}function patchUpdates(_0x462cce){return function(_0x3b39a3){try{jsonpatch['apply'](_0x3b39a3,_0x462cce,!![]);}catch(_0x298e69){return BPromise['reject'](_0x298e69);}return _0x3b39a3[_0xc8b7('0x22')]();};}function saveUpdates(_0x431163,_0x456eea){return function(_0x5e11cd){if(_0x5e11cd){return _0x5e11cd[_0xc8b7('0x23')](_0x431163)[_0xc8b7('0x24')](function(_0x4065d9){return _0x4065d9;});}return null;};}function removeEntity(_0x5b28ad,_0x3b0e47){return function(_0x191c12){if(_0x191c12){return _0x191c12[_0xc8b7('0x25')]()[_0xc8b7('0x24')](function(){var _0x2335cc=_0x191c12[_0xc8b7('0x26')]({'plain':!![]});var _0x2acda2=_0xc8b7('0x27');return db[_0xc8b7('0x28')][_0xc8b7('0x25')]({'where':{'type':_0x2acda2,'resourceId':_0x2335cc['id']}})[_0xc8b7('0x24')](function(){return _0x191c12;});})['then'](function(){_0x5b28ad[_0xc8b7('0x1a')](0xcc)[_0xc8b7('0x1b')]();});}};}function handleEntityNotFound(_0x3a9ce2,_0x3f92bd){return function(_0x2046f5){if(!_0x2046f5){_0x3a9ce2[_0xc8b7('0x29')](0x194);}return _0x2046f5;};}function handleError(_0x5629ce,_0x48682b){_0x48682b=_0x48682b||0x1f4;return function(_0x16cc83){logger[_0xc8b7('0x2a')](_0x16cc83[_0xc8b7('0x2b')]);if(_0x16cc83[_0xc8b7('0x2c')]){delete _0x16cc83[_0xc8b7('0x2c')];}_0x5629ce[_0xc8b7('0x1a')](_0x48682b)[_0xc8b7('0x2d')](_0x16cc83);};}exports['index']=function(_0x3a9658,_0x3d6f00){var _0x13000d={},_0x118574={},_0x27f4b7={'count':0x0,'rows':[]};var _0x340af1=_[_0xc8b7('0x2e')](db[_0xc8b7('0x2f')]['rawAttributes'],function(_0x247388){return{'name':_0x247388[_0xc8b7('0x30')],'type':_0x247388[_0xc8b7('0x31')][_0xc8b7('0x32')]};});_0x118574[_0xc8b7('0x33')]=_[_0xc8b7('0x2e')](_0x340af1,_0xc8b7('0x2c'));_0x118574[_0xc8b7('0x34')]=_[_0xc8b7('0x35')](_0x3a9658[_0xc8b7('0x34')]);_0x118574[_0xc8b7('0x36')]=_[_0xc8b7('0x37')](_0x118574[_0xc8b7('0x33')],_0x118574['query']);_0x13000d['attributes']=_[_0xc8b7('0x37')](_0x118574['model'],qs[_0xc8b7('0x38')](_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x38')]));_0x13000d[_0xc8b7('0x39')]=_0x13000d[_0xc8b7('0x39')]['length']?_0x13000d[_0xc8b7('0x39')]:_0x118574['model'];if(!_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x3a')](_0xc8b7('0x3b'))){_0x13000d[_0xc8b7('0x1f')]=qs[_0xc8b7('0x1f')](_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x1f')]);_0x13000d[_0xc8b7('0x1d')]=qs[_0xc8b7('0x1d')](_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x1d')]);}_0x13000d[_0xc8b7('0x3c')]=qs[_0xc8b7('0x3d')](_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x3d')]);_0x13000d[_0xc8b7('0x3e')]=qs['filters'](_[_0xc8b7('0x3f')](_0x3a9658[_0xc8b7('0x34')],_0x118574[_0xc8b7('0x36')]),_0x340af1);if(_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x40')]){_0x13000d[_0xc8b7('0x3e')]=_['merge'](_0x13000d[_0xc8b7('0x3e')],{'$or':_[_0xc8b7('0x2e')](_0x340af1,function(_0x1d208b){if(_0x1d208b[_0xc8b7('0x31')]!=='VIRTUAL'){var _0x5ae9a2={};_0x5ae9a2[_0x1d208b[_0xc8b7('0x2c')]]={'$like':'%'+_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x40')]+'%'};return _0x5ae9a2;}})});}_0x13000d=_['merge']({},_0x13000d,_0x3a9658['options']);var _0xec344f={'where':_0x13000d[_0xc8b7('0x3e')]};return db[_0xc8b7('0x2f')][_0xc8b7('0x20')](_0xec344f)[_0xc8b7('0x24')](function(_0x3ab722){_0x27f4b7[_0xc8b7('0x20')]=_0x3ab722;if(_0x3a9658[_0xc8b7('0x34')][_0xc8b7('0x41')]){_0x13000d[_0xc8b7('0x42')]=[{'all':!![]}];}return db[_0xc8b7('0x2f')]['findAll'](_0x13000d);})[_0xc8b7('0x24')](function(_0x3d86af){_0x27f4b7['rows']=_0x3d86af;return _0x27f4b7;})['then'](respondWithFilteredResult(_0x3d6f00,_0x13000d))[_0xc8b7('0x43')](handleError(_0x3d6f00,null));};exports[_0xc8b7('0x44')]=function(_0x507326,_0x3aa261){var _0x10a4ff={'raw':![],'where':{'id':_0x507326[_0xc8b7('0x45')]['id']}},_0x768ade={};_0x768ade[_0xc8b7('0x33')]=_[_0xc8b7('0x35')](db[_0xc8b7('0x2f')][_0xc8b7('0x46')]);_0x768ade[_0xc8b7('0x34')]=_[_0xc8b7('0x35')](_0x507326[_0xc8b7('0x34')]);_0x768ade['filters']=_['intersection'](_0x768ade[_0xc8b7('0x33')],_0x768ade['query']);_0x10a4ff[_0xc8b7('0x39')]=_[_0xc8b7('0x37')](_0x768ade[_0xc8b7('0x33')],qs[_0xc8b7('0x38')](_0x507326[_0xc8b7('0x34')][_0xc8b7('0x38')]));_0x10a4ff[_0xc8b7('0x39')]=_0x10a4ff['attributes'][_0xc8b7('0x47')]?_0x10a4ff[_0xc8b7('0x39')]:_0x768ade[_0xc8b7('0x33')];if(_0x507326[_0xc8b7('0x34')][_0xc8b7('0x41')]){_0x10a4ff[_0xc8b7('0x42')]=[{'all':!![]}];}_0x10a4ff=_[_0xc8b7('0x48')]({},_0x10a4ff,_0x507326[_0xc8b7('0x49')]);return db[_0xc8b7('0x2f')][_0xc8b7('0x4a')](_0x10a4ff)[_0xc8b7('0x24')](handleEntityNotFound(_0x3aa261,null))[_0xc8b7('0x24')](respondWithResult(_0x3aa261,null))[_0xc8b7('0x43')](handleError(_0x3aa261,null));};exports[_0xc8b7('0x4b')]=function(_0x493681,_0x3bd1c8){return db[_0xc8b7('0x2f')][_0xc8b7('0x4b')](_0x493681[_0xc8b7('0x4c')],{})[_0xc8b7('0x24')](function(_0x4aa959){var _0xe38e6=_0x493681[_0xc8b7('0x4d')]['get']({'plain':!![]});if(!_0xe38e6)throw new Error(_0xc8b7('0x4e'));if(_0xe38e6[_0xc8b7('0x4f')]===_0xc8b7('0x4d')){var _0x7941a1=_0x4aa959[_0xc8b7('0x26')]({'plain':!![]});var _0x34ee57='ChanSpies';return db[_0xc8b7('0x50')][_0xc8b7('0x4a')]({'where':{'name':_0x34ee57,'userProfileId':_0xe38e6['userProfileId']},'raw':!![]})[_0xc8b7('0x24')](function(_0x34d9bd){if(_0x34d9bd&&_0x34d9bd['autoAssociation']===0x0){return db['UserProfileResource'][_0xc8b7('0x4b')]({'name':_0x7941a1['name'],'resourceId':_0x7941a1['id'],'type':_0x34d9bd['name'],'sectionId':_0x34d9bd['id']},{})[_0xc8b7('0x24')](function(){return _0x4aa959;});}else{return _0x4aa959;}})[_0xc8b7('0x43')](function(_0xbbf03b){logger[_0xc8b7('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xbbf03b);throw _0xbbf03b;});}return _0x4aa959;})[_0xc8b7('0x24')](respondWithResult(_0x3bd1c8,0xc9))[_0xc8b7('0x43')](handleError(_0x3bd1c8,null));};exports[_0xc8b7('0x23')]=function(_0x2ece25,_0x525b64){if(_0x2ece25[_0xc8b7('0x4c')]['id']){delete _0x2ece25[_0xc8b7('0x4c')]['id'];}return db[_0xc8b7('0x2f')]['find']({'where':{'id':_0x2ece25[_0xc8b7('0x45')]['id']}})[_0xc8b7('0x24')](handleEntityNotFound(_0x525b64,null))['then'](saveUpdates(_0x2ece25[_0xc8b7('0x4c')],null))[_0xc8b7('0x24')](respondWithResult(_0x525b64,null))['catch'](handleError(_0x525b64,null));};exports[_0xc8b7('0x25')]=function(_0x264aac,_0x33769d){return db[_0xc8b7('0x2f')]['find']({'where':{'id':_0x264aac['params']['id']}})[_0xc8b7('0x24')](handleEntityNotFound(_0x33769d,null))[_0xc8b7('0x24')](removeEntity(_0x33769d,null))[_0xc8b7('0x43')](handleError(_0x33769d,null));}; \ No newline at end of file +var _0x3f49=['stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceChanSpy','count','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','update','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','undefined','status','Content-Range','apply','destroy','get','ChanSpies','UserProfileResource','then','end','error'];(function(_0x2393fc,_0x3c390f){var _0x4424e3=function(_0x4b9f70){while(--_0x4b9f70){_0x2393fc['push'](_0x2393fc['shift']());}};_0x4424e3(++_0x3c390f);}(_0x3f49,0x11f));var _0x93f4=function(_0x388f4b,_0x1907f9){_0x388f4b=_0x388f4b-0x0;var _0x5548e2=_0x3f49[_0x388f4b];return _0x5548e2;};'use strict';var emlformat=require(_0x93f4('0x0'));var rimraf=require(_0x93f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f4('0x2'));var rp=require(_0x93f4('0x3'));var moment=require(_0x93f4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x93f4('0x5'));var util=require(_0x93f4('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x93f4('0x7'));var ejs=require(_0x93f4('0x8'));var fs=require('fs');var fs_extra=require(_0x93f4('0x9'));var _=require('lodash');var squel=require(_0x93f4('0xa'));var crypto=require('crypto');var jsforce=require(_0x93f4('0xb'));var deskjs=require(_0x93f4('0xc'));var toCsv=require(_0x93f4('0x7'));var querystring=require(_0x93f4('0xd'));var Papa=require(_0x93f4('0xe'));var Redis=require(_0x93f4('0xf'));var authService=require(_0x93f4('0x10'));var qs=require(_0x93f4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x93f4('0x12'))(_0x93f4('0x13'));var utils=require(_0x93f4('0x14'));var config=require(_0x93f4('0x15'));var licenseUtil=require(_0x93f4('0x16'));var db=require(_0x93f4('0x17'))['db'];function respondWithStatusCode(_0x3109b7,_0x1d2edb){_0x1d2edb=_0x1d2edb||0xcc;return function(_0x54e7c6){if(_0x54e7c6){return _0x3109b7[_0x93f4('0x18')](_0x1d2edb);}return _0x3109b7['status'](_0x1d2edb)['end']();};}function respondWithResult(_0x86a454,_0x1d63ef){_0x1d63ef=_0x1d63ef||0xc8;return function(_0x1f8832){if(_0x1f8832){return _0x86a454['status'](_0x1d63ef)['json'](_0x1f8832);}};}function respondWithFilteredResult(_0x356da0,_0x40f50a){return function(_0x3fdf23){if(_0x3fdf23){var _0x5e4e32=typeof _0x40f50a[_0x93f4('0x19')]===_0x93f4('0x1a')&&typeof _0x40f50a['limit']===_0x93f4('0x1a');var _0x4d5a48=_0x3fdf23['count'];var _0x1d4773=_0x5e4e32?0x0:_0x40f50a['offset'];var _0x38d8b6=_0x5e4e32?_0x3fdf23['count']:_0x40f50a['offset']+_0x40f50a['limit'];var _0x1daa01;if(_0x38d8b6>=_0x4d5a48){_0x38d8b6=_0x4d5a48;_0x1daa01=0xc8;}else{_0x1daa01=0xce;}_0x356da0[_0x93f4('0x1b')](_0x1daa01);return _0x356da0['set'](_0x93f4('0x1c'),_0x1d4773+'-'+_0x38d8b6+'/'+_0x4d5a48)['json'](_0x3fdf23);}return null;};}function patchUpdates(_0x3ead08){return function(_0x3182d6){try{jsonpatch[_0x93f4('0x1d')](_0x3182d6,_0x3ead08,!![]);}catch(_0xde41e6){return BPromise['reject'](_0xde41e6);}return _0x3182d6['save']();};}function saveUpdates(_0x16f885,_0x432f99){return function(_0x5b0de8){if(_0x5b0de8){return _0x5b0de8['update'](_0x16f885)['then'](function(_0x145e90){return _0x145e90;});}return null;};}function removeEntity(_0x3301b5,_0x475f0b){return function(_0x4c87e3){if(_0x4c87e3){return _0x4c87e3[_0x93f4('0x1e')]()['then'](function(){var _0x20e337=_0x4c87e3[_0x93f4('0x1f')]({'plain':!![]});var _0x5afabf=_0x93f4('0x20');return db[_0x93f4('0x21')][_0x93f4('0x1e')]({'where':{'type':_0x5afabf,'resourceId':_0x20e337['id']}})[_0x93f4('0x22')](function(){return _0x4c87e3;});})['then'](function(){_0x3301b5[_0x93f4('0x1b')](0xcc)[_0x93f4('0x23')]();});}};}function handleEntityNotFound(_0x2fa1b1,_0x353ab7){return function(_0x590d52){if(!_0x590d52){_0x2fa1b1[_0x93f4('0x18')](0x194);}return _0x590d52;};}function handleError(_0x9aba61,_0x30606b){_0x30606b=_0x30606b||0x1f4;return function(_0x7f57d6){logger[_0x93f4('0x24')](_0x7f57d6[_0x93f4('0x25')]);if(_0x7f57d6[_0x93f4('0x26')]){delete _0x7f57d6[_0x93f4('0x26')];}_0x9aba61['status'](_0x30606b)[_0x93f4('0x27')](_0x7f57d6);};}exports[_0x93f4('0x28')]=function(_0x5268ba,_0x52fe96){var _0xd27b64={},_0x551bf9={},_0x40ae22={'count':0x0,'rows':[]};var _0x5c1c6f=_[_0x93f4('0x29')](db['VoiceChanSpy']['rawAttributes'],function(_0x277267){return{'name':_0x277267[_0x93f4('0x2a')],'type':_0x277267[_0x93f4('0x2b')]['key']};});_0x551bf9[_0x93f4('0x2c')]=_[_0x93f4('0x29')](_0x5c1c6f,_0x93f4('0x26'));_0x551bf9[_0x93f4('0x2d')]=_[_0x93f4('0x2e')](_0x5268ba[_0x93f4('0x2d')]);_0x551bf9[_0x93f4('0x2f')]=_[_0x93f4('0x30')](_0x551bf9['model'],_0x551bf9[_0x93f4('0x2d')]);_0xd27b64[_0x93f4('0x31')]=_['intersection'](_0x551bf9[_0x93f4('0x2c')],qs[_0x93f4('0x32')](_0x5268ba['query']['fields']));_0xd27b64[_0x93f4('0x31')]=_0xd27b64[_0x93f4('0x31')][_0x93f4('0x33')]?_0xd27b64[_0x93f4('0x31')]:_0x551bf9[_0x93f4('0x2c')];if(!_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x34')](_0x93f4('0x35'))){_0xd27b64[_0x93f4('0x36')]=qs[_0x93f4('0x36')](_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x36')]);_0xd27b64[_0x93f4('0x19')]=qs[_0x93f4('0x19')](_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x19')]);}_0xd27b64[_0x93f4('0x37')]=qs[_0x93f4('0x38')](_0x5268ba['query'][_0x93f4('0x38')]);_0xd27b64['where']=qs[_0x93f4('0x2f')](_[_0x93f4('0x39')](_0x5268ba[_0x93f4('0x2d')],_0x551bf9[_0x93f4('0x2f')]),_0x5c1c6f);if(_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x3a')]){_0xd27b64[_0x93f4('0x3b')]=_[_0x93f4('0x3c')](_0xd27b64[_0x93f4('0x3b')],{'$or':_[_0x93f4('0x29')](_0x5c1c6f,function(_0x20b814){if(_0x20b814[_0x93f4('0x2b')]!==_0x93f4('0x3d')){var _0x36482e={};_0x36482e[_0x20b814[_0x93f4('0x26')]]={'$like':'%'+_0x5268ba['query']['filter']+'%'};return _0x36482e;}})});}_0xd27b64=_['merge']({},_0xd27b64,_0x5268ba[_0x93f4('0x3e')]);var _0x435ecf={'where':_0xd27b64[_0x93f4('0x3b')]};return db[_0x93f4('0x3f')]['count'](_0x435ecf)[_0x93f4('0x22')](function(_0x130227){_0x40ae22[_0x93f4('0x40')]=_0x130227;if(_0x5268ba[_0x93f4('0x2d')][_0x93f4('0x41')]){_0xd27b64[_0x93f4('0x42')]=[{'all':!![]}];}return db[_0x93f4('0x3f')][_0x93f4('0x43')](_0xd27b64);})[_0x93f4('0x22')](function(_0x26ef4b){_0x40ae22['rows']=_0x26ef4b;return _0x40ae22;})[_0x93f4('0x22')](respondWithFilteredResult(_0x52fe96,_0xd27b64))['catch'](handleError(_0x52fe96,null));};exports[_0x93f4('0x44')]=function(_0x1135ca,_0x4009f6){var _0x5555b4={'raw':![],'where':{'id':_0x1135ca[_0x93f4('0x45')]['id']}},_0x2c05ee={};_0x2c05ee[_0x93f4('0x2c')]=_[_0x93f4('0x2e')](db['VoiceChanSpy'][_0x93f4('0x46')]);_0x2c05ee[_0x93f4('0x2d')]=_[_0x93f4('0x2e')](_0x1135ca['query']);_0x2c05ee[_0x93f4('0x2f')]=_[_0x93f4('0x30')](_0x2c05ee[_0x93f4('0x2c')],_0x2c05ee[_0x93f4('0x2d')]);_0x5555b4[_0x93f4('0x31')]=_[_0x93f4('0x30')](_0x2c05ee[_0x93f4('0x2c')],qs[_0x93f4('0x32')](_0x1135ca[_0x93f4('0x2d')][_0x93f4('0x32')]));_0x5555b4[_0x93f4('0x31')]=_0x5555b4[_0x93f4('0x31')][_0x93f4('0x33')]?_0x5555b4[_0x93f4('0x31')]:_0x2c05ee[_0x93f4('0x2c')];if(_0x1135ca['query'][_0x93f4('0x41')]){_0x5555b4[_0x93f4('0x42')]=[{'all':!![]}];}_0x5555b4=_[_0x93f4('0x3c')]({},_0x5555b4,_0x1135ca[_0x93f4('0x3e')]);return db[_0x93f4('0x3f')][_0x93f4('0x47')](_0x5555b4)['then'](handleEntityNotFound(_0x4009f6,null))[_0x93f4('0x22')](respondWithResult(_0x4009f6,null))[_0x93f4('0x48')](handleError(_0x4009f6,null));};exports['create']=function(_0x171439,_0x2c8a13){return db[_0x93f4('0x3f')][_0x93f4('0x49')](_0x171439['body'],{})[_0x93f4('0x22')](function(_0x3f8c47){var _0x467e5b=_0x171439['user'][_0x93f4('0x1f')]({'plain':!![]});if(!_0x467e5b)throw new Error(_0x93f4('0x4a'));if(_0x467e5b[_0x93f4('0x4b')]===_0x93f4('0x4c')){var _0x501808=_0x3f8c47['get']({'plain':!![]});var _0x108487=_0x93f4('0x20');return db[_0x93f4('0x4d')][_0x93f4('0x47')]({'where':{'name':_0x108487,'userProfileId':_0x467e5b[_0x93f4('0x4e')]},'raw':!![]})[_0x93f4('0x22')](function(_0x340f19){if(_0x340f19&&_0x340f19['autoAssociation']===0x0){return db[_0x93f4('0x21')][_0x93f4('0x49')]({'name':_0x501808[_0x93f4('0x26')],'resourceId':_0x501808['id'],'type':_0x340f19[_0x93f4('0x26')],'sectionId':_0x340f19['id']},{})[_0x93f4('0x22')](function(){return _0x3f8c47;});}else{return _0x3f8c47;}})[_0x93f4('0x48')](function(_0x203607){logger[_0x93f4('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x203607);throw _0x203607;});}return _0x3f8c47;})['then'](respondWithResult(_0x2c8a13,0xc9))['catch'](handleError(_0x2c8a13,null));};exports[_0x93f4('0x4f')]=function(_0x1d8c1,_0x350771){if(_0x1d8c1[_0x93f4('0x50')]['id']){delete _0x1d8c1['body']['id'];}return db[_0x93f4('0x3f')][_0x93f4('0x47')]({'where':{'id':_0x1d8c1[_0x93f4('0x45')]['id']}})[_0x93f4('0x22')](handleEntityNotFound(_0x350771,null))[_0x93f4('0x22')](saveUpdates(_0x1d8c1['body'],null))[_0x93f4('0x22')](respondWithResult(_0x350771,null))[_0x93f4('0x48')](handleError(_0x350771,null));};exports[_0x93f4('0x1e')]=function(_0x502f9c,_0x58fe66){return db[_0x93f4('0x3f')]['find']({'where':{'id':_0x502f9c[_0x93f4('0x45')]['id']}})[_0x93f4('0x22')](handleEntityNotFound(_0x58fe66,null))[_0x93f4('0x22')](removeEntity(_0x58fe66,null))[_0x93f4('0x48')](handleError(_0x58fe66,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index f728574..03d57f9 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 _0x1d2e=['concat','internal','name','User','findAll','agent','then','catch','exports','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','length'];(function(_0x6f116f,_0x48c8bd){var _0x120342=function(_0xa8e20a){while(--_0xa8e20a){_0x6f116f['push'](_0x6f116f['shift']());}};_0x120342(++_0x48c8bd);}(_0x1d2e,0x1c9));var _0xe1d2=function(_0x413426,_0x4f7814){_0x413426=_0x413426-0x0;var _0x5576e2=_0x1d2e[_0x413426];return _0x5576e2;};'use strict';var _=require(_0xe1d2('0x0'));var util=require(_0xe1d2('0x1'));var BPromise=require(_0xe1d2('0x2'));var attributes=require(_0xe1d2('0x3'));var getUserApplications=function(_0x54f2ae,_0x41ac92,_0x29bb4d){var _0x431d27=0x1;var _0xcdee70=[];var _0x4a4cf5={'context':_0x41ac92[_0xe1d2('0x4')]||_0xe1d2('0x5'),'exten':util[_0xe1d2('0x6')](_0xe1d2('0x7'),_0x54f2ae[_0xe1d2('0x8')],_0x29bb4d),'type':_0xe1d2('0x9'),'isApp':![],'ChanSpyId':_0x54f2ae['id'],'UserId':_0x41ac92['id']};_0xcdee70[_0xe1d2('0xa')](_[_0xe1d2('0xb')]({'app':_0xe1d2('0xc'),'appdata':util[_0xe1d2('0x6')]('CDR(type)=%s',_0xe1d2('0xd')),'priority':_0x431d27++},_0x4a4cf5));if(_0x54f2ae[_0xe1d2('0xe')]){_0xcdee70[_0xe1d2('0xa')](_['merge']({'app':_0xe1d2('0xf'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x54f2ae[_0xe1d2('0x10')]),'priority':_0x431d27++},_0x4a4cf5));}if(_0x54f2ae[_0xe1d2('0x11')]){_0xcdee70[_0xe1d2('0xa')](_[_0xe1d2('0xb')]({'app':_0xe1d2('0x12'),'appdata':_0x54f2ae['password'],'priority':_0x431d27++},_0x4a4cf5));}_0xcdee70[_0xe1d2('0xa')](_[_0xe1d2('0xb')]({'app':_0xe1d2('0x13'),'appdata':util[_0xe1d2('0x6')](_0xe1d2('0x14'),_0x41ac92['name'],_0x54f2ae[_0xe1d2('0x15')]?_0x54f2ae[_0xe1d2('0x15')][_0xe1d2('0x16')](''):''),'priority':_0x431d27++},_0x4a4cf5));if(_0x54f2ae['record']){_0xcdee70[_0xe1d2('0xa')](_[_0xe1d2('0xb')]({'app':'StopMixMonitor','priority':_0x431d27++},_0x4a4cf5));}return _0xcdee70;};var getChanSpyApplications=function(_0x204247,_0x4461be){var _0x15222c=[];for(var _0x51a3a0=0x0,_0x45aa53=0x1;_0x51a3a0<_0x4461be[_0xe1d2('0x17')];_0x51a3a0++,_0x45aa53=0x1){_0x15222c=_0x15222c[_0xe1d2('0x18')](getUserApplications(_0x204247,_0x4461be[_0x51a3a0],_0x4461be[_0x51a3a0][_0xe1d2('0x19')]));if(_0x4461be[_0x51a3a0][_0xe1d2('0x19')]!=_0x4461be[_0x51a3a0][_0xe1d2('0x1a')]){_0x15222c=_0x15222c['concat'](getUserApplications(_0x204247,_0x4461be[_0x51a3a0],_0x4461be[_0x51a3a0]['name']));}}return _0x15222c;};var getChanSpyPromise=function(_0xdb216f,_0x54cee6){return new BPromise(function(_0x2af5c8,_0x471a75){return _0xdb216f[_0xe1d2('0x1b')][_0xe1d2('0x1c')]({'attributes':['id',_0xe1d2('0x1a'),_0xe1d2('0x19')],'where':{'role':_0xe1d2('0x1d'),'chanspy':!![]},'raw':!![]})[_0xe1d2('0x1e')](function(_0x5bfe2f){if(_0x5bfe2f){return _0x2af5c8(getChanSpyApplications(_0x54cee6,_0x5bfe2f));}return _0x2af5c8([]);})[_0xe1d2('0x1f')](function(_0x3eb1a4){_0x471a75(_0x3eb1a4);});});};module[_0xe1d2('0x20')]=function(_0xd2c470,_0x58a4ba){var _0x52c293=_0xd2c470['models'];return _0xd2c470['define']('VoiceChanSpy',attributes,{'tableName':_0xe1d2('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x394d62,_0x2cf9e3,_0x3c0b72){return getChanSpyPromise(_0x52c293,_0x394d62)[_0xe1d2('0x1e')](function(_0x59af5e){if(_0x59af5e&&_0x59af5e['length']){return _0x52c293[_0xe1d2('0x22')]['bulkCreate'](_0x59af5e);}})['then'](function(){_0x3c0b72();})[_0xe1d2('0x1f')](function(_0x11b0c3){_0x3c0b72(_0x11b0c3);});},'afterUpdate':function(_0x59a350,_0x3a55eb,_0x40ed6f){return _0x52c293['VoiceExtension'][_0xe1d2('0x23')]({'where':{'ChanSpyId':_0x59a350['id']}})[_0xe1d2('0x1e')](function(){return getChanSpyPromise(_0x52c293,_0x59a350);})['then'](function(_0x2387b7){if(_0x2387b7&&_0x2387b7[_0xe1d2('0x17')]){return _0x52c293[_0xe1d2('0x22')][_0xe1d2('0x24')](_0x2387b7);}})[_0xe1d2('0x1e')](function(){_0x40ed6f();})[_0xe1d2('0x1f')](function(_0x2e52b9){_0x40ed6f(_0x2e52b9);});},'afterDestroy':function(_0x2eec31,_0x34d3fa,_0x52b18f){return _0x52c293['VoiceExtension'][_0xe1d2('0x23')]({'where':{'ChanSpyId':_0x2eec31['id']}})[_0xe1d2('0x1e')](function(){_0x52b18f();})[_0xe1d2('0x1f')](function(_0x256e82){_0x52b18f(_0x256e82);});}}});}; \ No newline at end of file +var _0x8c2f=['length','concat','internal','findAll','agent','then','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','catch','lodash','util','bluebird','./voiceChanSpy.attributes','context','format','%s%s','system','push','Set','CDR(type)=%s','record','${UNIQUEID}.%s,a','recordingFormat','auth','merge','Authenticate','password','name','options','join','StopMixMonitor'];(function(_0x39d819,_0x2842c0){var _0x2f47a3=function(_0x527490){while(--_0x527490){_0x39d819['push'](_0x39d819['shift']());}};_0x2f47a3(++_0x2842c0);}(_0x8c2f,0x176));var _0xf8c2=function(_0x4baae3,_0x5f0235){_0x4baae3=_0x4baae3-0x0;var _0x454819=_0x8c2f[_0x4baae3];return _0x454819;};'use strict';var _=require(_0xf8c2('0x0'));var util=require(_0xf8c2('0x1'));var BPromise=require(_0xf8c2('0x2'));var attributes=require(_0xf8c2('0x3'));var getUserApplications=function(_0x3eaa5c,_0x393bbf,_0x5e4d9b){var _0x2e46d7=0x1;var _0x49487f=[];var _0x595364={'context':_0x393bbf[_0xf8c2('0x4')]||'from-sip','exten':util[_0xf8c2('0x5')](_0xf8c2('0x6'),_0x3eaa5c['prefix'],_0x5e4d9b),'type':_0xf8c2('0x7'),'isApp':![],'ChanSpyId':_0x3eaa5c['id'],'UserId':_0x393bbf['id']};_0x49487f[_0xf8c2('0x8')](_['merge']({'app':_0xf8c2('0x9'),'appdata':util[_0xf8c2('0x5')](_0xf8c2('0xa'),'chanspy'),'priority':_0x2e46d7++},_0x595364));if(_0x3eaa5c[_0xf8c2('0xb')]){_0x49487f['push'](_['merge']({'app':'MixMonitor','appdata':util[_0xf8c2('0x5')](_0xf8c2('0xc'),_0x3eaa5c[_0xf8c2('0xd')]),'priority':_0x2e46d7++},_0x595364));}if(_0x3eaa5c[_0xf8c2('0xe')]){_0x49487f[_0xf8c2('0x8')](_[_0xf8c2('0xf')]({'app':_0xf8c2('0x10'),'appdata':_0x3eaa5c[_0xf8c2('0x11')],'priority':_0x2e46d7++},_0x595364));}_0x49487f['push'](_[_0xf8c2('0xf')]({'app':'ChanSpy','appdata':util[_0xf8c2('0x5')]('SIP/%s,%s',_0x393bbf[_0xf8c2('0x12')],_0x3eaa5c[_0xf8c2('0x13')]?_0x3eaa5c[_0xf8c2('0x13')][_0xf8c2('0x14')](''):''),'priority':_0x2e46d7++},_0x595364));if(_0x3eaa5c['record']){_0x49487f[_0xf8c2('0x8')](_[_0xf8c2('0xf')]({'app':_0xf8c2('0x15'),'priority':_0x2e46d7++},_0x595364));}return _0x49487f;};var getChanSpyApplications=function(_0x237fc6,_0x5621fb){var _0x20a737=[];for(var _0x4282b7=0x0,_0x4c6bde=0x1;_0x4282b7<_0x5621fb[_0xf8c2('0x16')];_0x4282b7++,_0x4c6bde=0x1){_0x20a737=_0x20a737[_0xf8c2('0x17')](getUserApplications(_0x237fc6,_0x5621fb[_0x4282b7],_0x5621fb[_0x4282b7][_0xf8c2('0x18')]));if(_0x5621fb[_0x4282b7][_0xf8c2('0x18')]!=_0x5621fb[_0x4282b7][_0xf8c2('0x12')]){_0x20a737=_0x20a737[_0xf8c2('0x17')](getUserApplications(_0x237fc6,_0x5621fb[_0x4282b7],_0x5621fb[_0x4282b7][_0xf8c2('0x12')]));}}return _0x20a737;};var getChanSpyPromise=function(_0x1c97ae,_0x3616b5){return new BPromise(function(_0xbcd6ce,_0x4c1372){return _0x1c97ae['User'][_0xf8c2('0x19')]({'attributes':['id',_0xf8c2('0x12'),_0xf8c2('0x18')],'where':{'role':_0xf8c2('0x1a'),'chanspy':!![]},'raw':!![]})[_0xf8c2('0x1b')](function(_0x18ef5c){if(_0x18ef5c){return _0xbcd6ce(getChanSpyApplications(_0x3616b5,_0x18ef5c));}return _0xbcd6ce([]);})['catch'](function(_0x46d75a){_0x4c1372(_0x46d75a);});});};module['exports']=function(_0x2432e7,_0x37ed79){var _0x9b5b15=_0x2432e7[_0xf8c2('0x1c')];return _0x2432e7[_0xf8c2('0x1d')](_0xf8c2('0x1e'),attributes,{'tableName':_0xf8c2('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2561f0,_0x89cee7,_0xb54c48){return getChanSpyPromise(_0x9b5b15,_0x2561f0)[_0xf8c2('0x1b')](function(_0x66771){if(_0x66771&&_0x66771[_0xf8c2('0x16')]){return _0x9b5b15['VoiceExtension'][_0xf8c2('0x20')](_0x66771);}})[_0xf8c2('0x1b')](function(){_0xb54c48();})['catch'](function(_0x2e744d){_0xb54c48(_0x2e744d);});},'afterUpdate':function(_0x21fe60,_0x14257b,_0x3c82f2){return _0x9b5b15[_0xf8c2('0x21')][_0xf8c2('0x22')]({'where':{'ChanSpyId':_0x21fe60['id']}})[_0xf8c2('0x1b')](function(){return getChanSpyPromise(_0x9b5b15,_0x21fe60);})[_0xf8c2('0x1b')](function(_0x20372e){if(_0x20372e&&_0x20372e[_0xf8c2('0x16')]){return _0x9b5b15[_0xf8c2('0x21')][_0xf8c2('0x20')](_0x20372e);}})[_0xf8c2('0x1b')](function(){_0x3c82f2();})[_0xf8c2('0x23')](function(_0x78e47c){_0x3c82f2(_0x78e47c);});},'afterDestroy':function(_0x18fcab,_0x1955e2,_0x14a8b6){return _0x9b5b15[_0xf8c2('0x21')][_0xf8c2('0x22')]({'where':{'ChanSpyId':_0x18fcab['id']}})[_0xf8c2('0x1b')](function(){_0x14a8b6();})['catch'](function(_0x2a9a87){_0x14a8b6(_0x2a9a87);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 32a3b97..3f99ded 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 _0x0624=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5ed443,_0x4b8750){var _0x2f4ea4=function(_0x108506){while(--_0x108506){_0x5ed443['push'](_0x5ed443['shift']());}};_0x2f4ea4(++_0x4b8750);}(_0x0624,0x132));var _0x4062=function(_0x3df56f,_0x46fe72){_0x3df56f=_0x3df56f-0x0;var _0x6376a1=_0x0624[_0x3df56f];return _0x6376a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4062('0x0'));var fs=require('fs');var Redis=require(_0x4062('0x1'));var db=require(_0x4062('0x2'))['db'];var utils=require(_0x4062('0x3'));var logger=require(_0x4062('0x4'))(_0x4062('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4062('0x6')][_0x4062('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2f4928,_0xdff88c,_0x27794b){return new BPromise(function(_0x5d19e8,_0x75ce4e){return client['request'](_0x2f4928,_0x27794b)[_0x4062('0x8')](function(_0x35663b){logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,_0x4062('0xb'));logger[_0x4062('0xc')](_0x4062('0xd'),_0xdff88c,'request\x20sent',JSON[_0x4062('0xe')](_0x35663b));if(_0x35663b['error']){if(_0x35663b[_0x4062('0xf')][_0x4062('0x10')]===0x1f4){logger[_0x4062('0xf')](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')]['message']);return _0x75ce4e(_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);}logger['error'](_0x4062('0xa'),_0xdff88c,_0x35663b[_0x4062('0xf')][_0x4062('0x11')]);return _0x5d19e8(_0x35663b['error']['message']);}else{logger[_0x4062('0x9')](_0x4062('0xa'),_0xdff88c,'request\x20sent');_0x5d19e8(_0x35663b['result']['message']);}})['catch'](function(_0x437432){logger['error'](_0x4062('0xa'),_0xdff88c,_0x437432);_0x75ce4e(_0x437432);});});} \ No newline at end of file +var _0x39cb=['code','VoiceChanSpy,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x39cb,0x1bd));var _0xb39c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x39cb[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xb39c('0x0'));var moment=require(_0xb39c('0x1'));var BPromise=require('bluebird');var rs=require(_0xb39c('0x2'));var fs=require('fs');var Redis=require(_0xb39c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39c('0x4'));var logger=require(_0xb39c('0x5'))(_0xb39c('0x6'));var config=require(_0xb39c('0x7'));var jayson=require(_0xb39c('0x8'));var client=jayson['client'][_0xb39c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fc868,_0x40112f,_0x3f2fbe){return new BPromise(function(_0x47d6d7,_0x5ae14a){return client[_0xb39c('0xa')](_0x2fc868,_0x3f2fbe)[_0xb39c('0xb')](function(_0x3ffb94){logger[_0xb39c('0xc')]('VoiceChanSpy,\x20%s,\x20%s',_0x40112f,'request\x20sent');logger['debug'](_0xb39c('0xd'),_0x40112f,_0xb39c('0xe'),JSON[_0xb39c('0xf')](_0x3ffb94));if(_0x3ffb94[_0xb39c('0x10')]){if(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x11')]===0x1f4){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x3ffb94['error'][_0xb39c('0x13')]);return _0x5ae14a(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}logger['error'](_0xb39c('0x12'),_0x40112f,_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);return _0x47d6d7(_0x3ffb94[_0xb39c('0x10')][_0xb39c('0x13')]);}else{logger[_0xb39c('0xc')](_0xb39c('0x12'),_0x40112f,'request\x20sent');_0x47d6d7(_0x3ffb94[_0xb39c('0x14')][_0xb39c('0x13')]);}})[_0xb39c('0x15')](function(_0x1c2c5f){logger[_0xb39c('0x10')](_0xb39c('0x12'),_0x40112f,_0x1c2c5f);_0x5ae14a(_0x1c2c5f);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 9a04233..5b54b73 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 _0xde9f=['isAuthenticated','index','/:id','show','post','create','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get'];(function(_0x503230,_0x504850){var _0x2e2725=function(_0x51a459){while(--_0x51a459){_0x503230['push'](_0x503230['shift']());}};_0x2e2725(++_0x504850);}(_0xde9f,0x171));var _0xfde9=function(_0x55677b,_0x3e5655){_0x55677b=_0x55677b-0x0;var _0x104b88=_0xde9f[_0x55677b];return _0x104b88;};'use strict';var multer=require('multer');var util=require(_0xfde9('0x0'));var path=require(_0xfde9('0x1'));var timeout=require(_0xfde9('0x2'));var express=require(_0xfde9('0x3'));var router=express['Router']();var fs_extra=require(_0xfde9('0x4'));var auth=require(_0xfde9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfde9('0x6'));var controller=require(_0xfde9('0x7'));router[_0xfde9('0x8')]('/',auth[_0xfde9('0x9')](),controller[_0xfde9('0xa')]);router[_0xfde9('0x8')](_0xfde9('0xb'),auth['isAuthenticated'](),controller[_0xfde9('0xc')]);router[_0xfde9('0xd')]('/',auth[_0xfde9('0x9')](),controller[_0xfde9('0xe')]);router['put']('/:id',auth[_0xfde9('0x9')](),controller[_0xfde9('0xf')]);router['delete'](_0xfde9('0xb'),auth[_0xfde9('0x9')](),controller[_0xfde9('0x10')]);module[_0xfde9('0x11')]=router; \ No newline at end of file +var _0x0b28=['get','/:id','show','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index'];(function(_0x63d046,_0x47dd4f){var _0x4596ce=function(_0x19126d){while(--_0x19126d){_0x63d046['push'](_0x63d046['shift']());}};_0x4596ce(++_0x47dd4f);}(_0x0b28,0x73));var _0x80b2=function(_0x4ab3fb,_0x776775){_0x4ab3fb=_0x4ab3fb-0x0;var _0x34fe1e=_0x0b28[_0x4ab3fb];return _0x34fe1e;};'use strict';var multer=require(_0x80b2('0x0'));var util=require(_0x80b2('0x1'));var path=require('path');var timeout=require(_0x80b2('0x2'));var express=require(_0x80b2('0x3'));var router=express[_0x80b2('0x4')]();var fs_extra=require(_0x80b2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80b2('0x6'));var config=require(_0x80b2('0x7'));var controller=require(_0x80b2('0x8'));router['get']('/',auth[_0x80b2('0x9')](),controller[_0x80b2('0xa')]);router[_0x80b2('0xb')](_0x80b2('0xc'),auth['isAuthenticated'](),controller[_0x80b2('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x80b2('0xe')]);router[_0x80b2('0xf')](_0x80b2('0xc'),auth[_0x80b2('0x9')](),controller[_0x80b2('0x10')]);router['delete']('/:id',auth[_0x80b2('0x9')](),controller[_0x80b2('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index d51a594..21638e9 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 _0x4fb9=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fb9,0xd2));var _0x94fb=function(_0x872268,_0x260269){_0x872268=_0x872268-0x0;var _0x24a501=_0x4fb9[_0x872268];return _0x24a501;};'use strict';var Sequelize=require(_0x94fb('0x0'));module[_0x94fb('0x1')]={'name':{'type':Sequelize[_0x94fb('0x2')],'unique':_0x94fb('0x3')},'description':{'type':Sequelize[_0x94fb('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x94fb('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd81e=['sequelize','exports','name','STRING','BOOLEAN'];(function(_0x7384c7,_0x3aa650){var _0x56645d=function(_0x2f8bae){while(--_0x2f8bae){_0x7384c7['push'](_0x7384c7['shift']());}};_0x56645d(++_0x3aa650);}(_0xd81e,0xf0));var _0xed81=function(_0xacdfd8,_0x540dd6){_0xacdfd8=_0xacdfd8-0x0;var _0x29c8b7=_0xd81e[_0xacdfd8];return _0x29c8b7;};'use strict';var Sequelize=require(_0xed81('0x0'));module[_0xed81('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xed81('0x2')},'description':{'type':Sequelize[_0xed81('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xed81('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index e8426c2..74918c4 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 _0x2ece=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','Contexts','UserProfileResource','name','index','map','VoiceContext','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','options','includeAll','include','findAll','rows','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','writeFileSync','Reload','chan_sip.so','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','render','/etc/asterisk/extensions_xcally_contexts.conf','params','rimraf','zip-dir','bluebird','mustache','path','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x2ece,0x99));var _0xe2ec=function(_0x89c40f,_0xd92eb2){_0x89c40f=_0x89c40f-0x0;var _0x17acbb=_0x2ece[_0x89c40f];return _0x17acbb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe2ec('0x0'));var zipdir=require(_0xe2ec('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2ec('0x2'));var Mustache=require(_0xe2ec('0x3'));var util=require('util');var path=require(_0xe2ec('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe2ec('0x5'));var _=require(_0xe2ec('0x6'));var squel=require(_0xe2ec('0x7'));var crypto=require(_0xe2ec('0x8'));var jsforce=require(_0xe2ec('0x9'));var deskjs=require(_0xe2ec('0xa'));var toCsv=require(_0xe2ec('0xb'));var querystring=require(_0xe2ec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe2ec('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe2ec('0xe'))('api');var utils=require(_0xe2ec('0xf'));var config=require(_0xe2ec('0x10'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xe2ec('0x11'));var client=jayson[_0xe2ec('0x12')][_0xe2ec('0x13')]({'port':0x232a});function respondWithRpcPromise(_0x234d39,_0x460ce8,_0x4f8a49,_0xe60849){return new BPromise(function(_0x584251,_0x3e3e18){var _0x139e98=_0xe60849||client;return _0x139e98['request'](_0x234d39,_0x4f8a49)[_0xe2ec('0x14')](function(_0x1c0557){logger[_0xe2ec('0x15')](_0xe2ec('0x16'),_0x460ce8,_0xe2ec('0x17'));logger['debug'](_0xe2ec('0x18'),_0x460ce8,_0xe2ec('0x17'),JSON['stringify'](_0x1c0557));if(_0x1c0557[_0xe2ec('0x19')]){if(_0x1c0557[_0xe2ec('0x19')][_0xe2ec('0x1a')]===0x1f4){logger[_0xe2ec('0x19')](_0xe2ec('0x16'),_0x460ce8,_0x1c0557[_0xe2ec('0x19')][_0xe2ec('0x1b')]);return _0x3e3e18(_0x1c0557[_0xe2ec('0x19')][_0xe2ec('0x1b')]);}logger[_0xe2ec('0x19')](_0xe2ec('0x16'),_0x460ce8,_0x1c0557[_0xe2ec('0x19')][_0xe2ec('0x1b')]);return _0x584251(_0x1c0557[_0xe2ec('0x19')][_0xe2ec('0x1b')]);}else{logger['info'](_0xe2ec('0x16'),_0x460ce8,'request\x20sent');_0x584251(_0x1c0557['result'][_0xe2ec('0x1b')]);}})[_0xe2ec('0x1c')](function(_0x33a484){logger['error'](_0xe2ec('0x16'),_0x460ce8,_0x33a484);_0x3e3e18(_0x33a484);});});}function respondWithStatusCode(_0x2d2cd5,_0x1443e1){_0x1443e1=_0x1443e1||0xcc;return function(_0xcf7f04){if(_0xcf7f04){return _0x2d2cd5[_0xe2ec('0x1d')](_0x1443e1);}return _0x2d2cd5[_0xe2ec('0x1e')](_0x1443e1)[_0xe2ec('0x1f')]();};}function respondWithResult(_0x3d42bb,_0x33e2c4){_0x33e2c4=_0x33e2c4||0xc8;return function(_0x3e3f18){if(_0x3e3f18){return _0x3d42bb[_0xe2ec('0x1e')](_0x33e2c4)[_0xe2ec('0x20')](_0x3e3f18);}};}function respondWithFilteredResult(_0x1c9117,_0x496b08){return function(_0x3a0868){if(_0x3a0868){var _0x234bb6=typeof _0x496b08[_0xe2ec('0x21')]===_0xe2ec('0x22')&&typeof _0x496b08[_0xe2ec('0x23')]===_0xe2ec('0x22');var _0x38d521=_0x3a0868[_0xe2ec('0x24')];var _0x25ecfb=_0x234bb6?0x0:_0x496b08['offset'];var _0x204358=_0x234bb6?_0x3a0868['count']:_0x496b08[_0xe2ec('0x21')]+_0x496b08[_0xe2ec('0x23')];var _0x1e6185;if(_0x204358>=_0x38d521){_0x204358=_0x38d521;_0x1e6185=0xc8;}else{_0x1e6185=0xce;}_0x1c9117[_0xe2ec('0x1e')](_0x1e6185);return _0x1c9117[_0xe2ec('0x25')]('Content-Range',_0x25ecfb+'-'+_0x204358+'/'+_0x38d521)[_0xe2ec('0x20')](_0x3a0868);}return null;};}function patchUpdates(_0xae251f){return function(_0x469ef7){try{jsonpatch[_0xe2ec('0x26')](_0x469ef7,_0xae251f,!![]);}catch(_0x13c6b4){return BPromise['reject'](_0x13c6b4);}return _0x469ef7[_0xe2ec('0x27')]();};}function saveUpdates(_0x5f5d96,_0x3eab63){return function(_0x49f55c){if(_0x49f55c){return _0x49f55c[_0xe2ec('0x28')](_0x5f5d96)[_0xe2ec('0x14')](function(_0x200e68){return _0x200e68;});}return null;};}function removeEntity(_0x3dfa1c,_0xf67d4c){return function(_0x2901ed){if(_0x2901ed){return _0x2901ed[_0xe2ec('0x29')]()['then'](function(){var _0x95bf1a=_0x2901ed['get']({'plain':!![]});var _0x28e67f=_0xe2ec('0x2a');return db[_0xe2ec('0x2b')][_0xe2ec('0x29')]({'where':{'type':_0x28e67f,'resourceId':_0x95bf1a['id']}})[_0xe2ec('0x14')](function(){return _0x2901ed;});})[_0xe2ec('0x14')](function(){_0x3dfa1c[_0xe2ec('0x1e')](0xcc)[_0xe2ec('0x1f')]();});}};}function handleEntityNotFound(_0x39303c,_0x4b4ff8){return function(_0x26289c){if(!_0x26289c){_0x39303c[_0xe2ec('0x1d')](0x194);}return _0x26289c;};}function handleError(_0x1757a6,_0x170c53){_0x170c53=_0x170c53||0x1f4;return function(_0x315967){logger[_0xe2ec('0x19')](_0x315967['stack']);if(_0x315967[_0xe2ec('0x2c')]){delete _0x315967[_0xe2ec('0x2c')];}_0x1757a6[_0xe2ec('0x1e')](_0x170c53)['send'](_0x315967);};}exports[_0xe2ec('0x2d')]=function(_0x34f1bf,_0x38ad95){var _0xff726b={},_0x250705={},_0x5d6232={'count':0x0,'rows':[]};var _0xc62c1c=_[_0xe2ec('0x2e')](db[_0xe2ec('0x2f')][_0xe2ec('0x30')],function(_0xe03f1){return{'name':_0xe03f1[_0xe2ec('0x31')],'type':_0xe03f1['type'][_0xe2ec('0x32')]};});_0x250705[_0xe2ec('0x33')]=_[_0xe2ec('0x2e')](_0xc62c1c,_0xe2ec('0x2c'));_0x250705[_0xe2ec('0x34')]=_[_0xe2ec('0x35')](_0x34f1bf[_0xe2ec('0x34')]);_0x250705[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0x250705[_0xe2ec('0x33')],_0x250705['query']);_0xff726b[_0xe2ec('0x38')]=_[_0xe2ec('0x37')](_0x250705[_0xe2ec('0x33')],qs['fields'](_0x34f1bf[_0xe2ec('0x34')][_0xe2ec('0x39')]));_0xff726b['attributes']=_0xff726b[_0xe2ec('0x38')][_0xe2ec('0x3a')]?_0xff726b[_0xe2ec('0x38')]:_0x250705[_0xe2ec('0x33')];if(!_0x34f1bf[_0xe2ec('0x34')][_0xe2ec('0x3b')](_0xe2ec('0x3c'))){_0xff726b[_0xe2ec('0x23')]=qs[_0xe2ec('0x23')](_0x34f1bf['query']['limit']);_0xff726b[_0xe2ec('0x21')]=qs['offset'](_0x34f1bf['query'][_0xe2ec('0x21')]);}_0xff726b[_0xe2ec('0x3d')]=qs[_0xe2ec('0x3e')](_0x34f1bf[_0xe2ec('0x34')][_0xe2ec('0x3e')]);_0xff726b[_0xe2ec('0x3f')]=qs[_0xe2ec('0x36')](_[_0xe2ec('0x40')](_0x34f1bf[_0xe2ec('0x34')],_0x250705[_0xe2ec('0x36')]),_0xc62c1c);if(_0x34f1bf['query']['filter']){_0xff726b[_0xe2ec('0x3f')]=_[_0xe2ec('0x41')](_0xff726b[_0xe2ec('0x3f')],{'$or':_['map'](_0xc62c1c,function(_0x43ef08){if(_0x43ef08[_0xe2ec('0x42')]!=='VIRTUAL'){var _0x1a3d91={};_0x1a3d91[_0x43ef08[_0xe2ec('0x2c')]]={'$like':'%'+_0x34f1bf[_0xe2ec('0x34')]['filter']+'%'};return _0x1a3d91;}})});}_0xff726b=_[_0xe2ec('0x41')]({},_0xff726b,_0x34f1bf[_0xe2ec('0x43')]);var _0x170a2b={'where':_0xff726b[_0xe2ec('0x3f')]};return db['VoiceContext'][_0xe2ec('0x24')](_0x170a2b)[_0xe2ec('0x14')](function(_0x56cbab){_0x5d6232[_0xe2ec('0x24')]=_0x56cbab;if(_0x34f1bf[_0xe2ec('0x34')][_0xe2ec('0x44')]){_0xff726b[_0xe2ec('0x45')]=[{'all':!![]}];}return db['VoiceContext'][_0xe2ec('0x46')](_0xff726b);})[_0xe2ec('0x14')](function(_0x46ddef){_0x5d6232[_0xe2ec('0x47')]=_0x46ddef;return _0x5d6232;})[_0xe2ec('0x14')](respondWithFilteredResult(_0x38ad95,_0xff726b))[_0xe2ec('0x1c')](handleError(_0x38ad95,null));};exports['show']=function(_0x5f468f,_0x50ac9a){var _0x175d7b={'raw':![],'where':{'id':_0x5f468f['params']['id']}},_0x4f7962={};_0x4f7962[_0xe2ec('0x33')]=_[_0xe2ec('0x35')](db[_0xe2ec('0x2f')][_0xe2ec('0x30')]);_0x4f7962[_0xe2ec('0x34')]=_['keys'](_0x5f468f['query']);_0x4f7962[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0x4f7962['model'],_0x4f7962[_0xe2ec('0x34')]);_0x175d7b[_0xe2ec('0x38')]=_[_0xe2ec('0x37')](_0x4f7962[_0xe2ec('0x33')],qs[_0xe2ec('0x39')](_0x5f468f['query'][_0xe2ec('0x39')]));_0x175d7b['attributes']=_0x175d7b['attributes'][_0xe2ec('0x3a')]?_0x175d7b[_0xe2ec('0x38')]:_0x4f7962[_0xe2ec('0x33')];if(_0x5f468f[_0xe2ec('0x34')][_0xe2ec('0x44')]){_0x175d7b['include']=[{'all':!![]}];}_0x175d7b=_['merge']({},_0x175d7b,_0x5f468f['options']);return db[_0xe2ec('0x2f')]['find'](_0x175d7b)[_0xe2ec('0x14')](handleEntityNotFound(_0x50ac9a,null))[_0xe2ec('0x14')](respondWithResult(_0x50ac9a,null))[_0xe2ec('0x1c')](handleError(_0x50ac9a,null));};exports['create']=function(_0x10ce76,_0x411731,_0x4936a8){var _0xa953f3;return db[_0xe2ec('0x2f')][_0xe2ec('0x48')](_0x10ce76[_0xe2ec('0x49')],{'raw':!![]})['then'](function(_0x170d52){_0xa953f3=_0x170d52;return db['VoiceContext'][_0xe2ec('0x46')]({'raw':!![]});})[_0xe2ec('0x14')](function(_0x5281fc){var _0x517f62=fs[_0xe2ec('0x4a')](path[_0xe2ec('0x4b')](config[_0xe2ec('0x4c')],_0xe2ec('0x4d')),_0xe2ec('0x4e'));var _0x4de5f4=ejs['render'](_0x517f62,{'contexts':_0x5281fc||[]});fs[_0xe2ec('0x4f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4de5f4);})[_0xe2ec('0x14')](function(){return respondWithRpcPromise(_0xe2ec('0x50'),'create',{'module':_0xe2ec('0x51')});})['then'](function(){var _0x55c567=_0x10ce76['user'][_0xe2ec('0x52')]({'plain':!![]});if(!_0x55c567)throw new Error(_0xe2ec('0x53'));if(_0x55c567[_0xe2ec('0x54')]==='user'){var _0x2a2a67=_0xa953f3[_0xe2ec('0x52')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'Contexts','userProfileId':_0x55c567[_0xe2ec('0x55')]},'raw':!![]})[_0xe2ec('0x14')](function(_0x44fa67){if(_0x44fa67&&_0x44fa67['autoAssociation']===0x0){return db[_0xe2ec('0x2b')][_0xe2ec('0x48')]({'name':_0x2a2a67['name'],'resourceId':_0x2a2a67['id'],'type':_0x44fa67[_0xe2ec('0x2c')],'sectionId':_0x44fa67['id']},{})[_0xe2ec('0x14')](function(){return _0xa953f3;});}else{return _0xa953f3;}})['catch'](function(_0x4061a3){logger[_0xe2ec('0x19')](_0xe2ec('0x56'),_0x4061a3);throw _0x4061a3;});}return _0xa953f3;})[_0xe2ec('0x14')](respondWithResult(_0x411731,0xc9))[_0xe2ec('0x1c')](handleError(_0x411731,null));};exports[_0xe2ec('0x28')]=function(_0x4b4885,_0x13cf30,_0x29c1a5){var _0x31b967;return db[_0xe2ec('0x2f')][_0xe2ec('0x57')]({'where':{'id':_0x4b4885['params']['id']}})['then'](handleEntityNotFound(_0x13cf30,null))[_0xe2ec('0x14')](saveUpdates(_0x4b4885[_0xe2ec('0x49')],null))[_0xe2ec('0x14')](function(_0x329932){if(_0x329932){_0x31b967=_0x329932;return db[_0xe2ec('0x2f')][_0xe2ec('0x46')]({'raw':!![]});}})[_0xe2ec('0x14')](function(_0x2ed3c9){var _0x572d3f=fs[_0xe2ec('0x4a')](path['join'](config[_0xe2ec('0x4c')],'server/files/templates/context.ejs'),_0xe2ec('0x4e'));var _0x5034f5=ejs[_0xe2ec('0x58')](_0x572d3f,{'contexts':_0x2ed3c9||[]});fs[_0xe2ec('0x4f')](_0xe2ec('0x59'),_0x5034f5);})[_0xe2ec('0x14')](function(){return respondWithRpcPromise(_0xe2ec('0x50'),'update',{'module':_0xe2ec('0x51')});})[_0xe2ec('0x14')](function(){return _0x31b967;})[_0xe2ec('0x14')](respondWithResult(_0x13cf30,null))[_0xe2ec('0x1c')](handleError(_0x13cf30,null));};exports[_0xe2ec('0x29')]=function(_0x1e8b4c,_0x37135e,_0x55f224){var _0x25dfd2;return db[_0xe2ec('0x2f')][_0xe2ec('0x57')]({'where':{'id':_0x1e8b4c[_0xe2ec('0x5a')]['id']}})[_0xe2ec('0x14')](handleEntityNotFound(_0x37135e,null))[_0xe2ec('0x14')](removeEntity(_0x37135e,null))[_0xe2ec('0x14')](function(){return db[_0xe2ec('0x2f')][_0xe2ec('0x46')]({'raw':!![]});})[_0xe2ec('0x14')](function(_0x3543ea){var _0x376f4c=fs[_0xe2ec('0x4a')](path['join'](config[_0xe2ec('0x4c')],_0xe2ec('0x4d')),_0xe2ec('0x4e'));var _0x260e90=ejs[_0xe2ec('0x58')](_0x376f4c,{'contexts':_0x3543ea});fs['writeFileSync'](_0xe2ec('0x59'),_0x260e90);return respondWithRpcPromise('Reload',_0xe2ec('0x29'),{'module':_0xe2ec('0x51')});})[_0xe2ec('0x1c')](handleError(_0x37135e,null));}; \ No newline at end of file +var _0x989d=['result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Contexts','UserProfileResource','destroy','end','name','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','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','../../config/license/hardware','api','../../config/environment','../../mysqldb','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x4b4e9b,_0x2ecc4a){var _0x59ed16=function(_0x3ff94d){while(--_0x3ff94d){_0x4b4e9b['push'](_0x4b4e9b['shift']());}};_0x59ed16(++_0x2ecc4a);}(_0x989d,0x177));var _0xd989=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x989d[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0xd989('0x0'));var rimraf=require(_0xd989('0x1'));var zipdir=require(_0xd989('0x2'));var jsonpatch=require(_0xd989('0x3'));var rp=require(_0xd989('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd989('0x5'));var util=require(_0xd989('0x6'));var path=require(_0xd989('0x7'));var sox=require(_0xd989('0x8'));var csv=require(_0xd989('0x9'));var ejs=require(_0xd989('0xa'));var fs=require('fs');var fs_extra=require(_0xd989('0xb'));var _=require(_0xd989('0xc'));var squel=require(_0xd989('0xd'));var crypto=require(_0xd989('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xd989('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd989('0x10'));var Papa=require(_0xd989('0x11'));var Redis=require(_0xd989('0x12'));var authService=require(_0xd989('0x13'));var qs=require(_0xd989('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd989('0x15'));var logger=require('../../config/logger')(_0xd989('0x16'));var utils=require('../../config/utils');var config=require(_0xd989('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd989('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed429,_0x55d922,_0x183e7a,_0x55f0bc){return new BPromise(function(_0x14f00,_0x32c656){var _0x3ff4bc=_0x55f0bc||client;return _0x3ff4bc['request'](_0x4ed429,_0x183e7a)['then'](function(_0x96f4f3){logger[_0xd989('0x19')](_0xd989('0x1a'),_0x55d922,_0xd989('0x1b'));logger[_0xd989('0x1c')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x55d922,'request\x20sent',JSON[_0xd989('0x1d')](_0x96f4f3));if(_0x96f4f3['error']){if(_0x96f4f3[_0xd989('0x1e')][_0xd989('0x1f')]===0x1f4){logger[_0xd989('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x55d922,_0x96f4f3[_0xd989('0x1e')]['message']);return _0x32c656(_0x96f4f3[_0xd989('0x1e')][_0xd989('0x20')]);}logger[_0xd989('0x1e')](_0xd989('0x1a'),_0x55d922,_0x96f4f3['error'][_0xd989('0x20')]);return _0x14f00(_0x96f4f3[_0xd989('0x1e')]['message']);}else{logger[_0xd989('0x19')](_0xd989('0x1a'),_0x55d922,_0xd989('0x1b'));_0x14f00(_0x96f4f3[_0xd989('0x21')][_0xd989('0x20')]);}})['catch'](function(_0xe87fa6){logger['error'](_0xd989('0x1a'),_0x55d922,_0xe87fa6);_0x32c656(_0xe87fa6);});});}function respondWithStatusCode(_0x513d51,_0x1c4c7a){_0x1c4c7a=_0x1c4c7a||0xcc;return function(_0x456bfd){if(_0x456bfd){return _0x513d51[_0xd989('0x22')](_0x1c4c7a);}return _0x513d51[_0xd989('0x23')](_0x1c4c7a)['end']();};}function respondWithResult(_0x2e99ec,_0x10ec53){_0x10ec53=_0x10ec53||0xc8;return function(_0x8457de){if(_0x8457de){return _0x2e99ec[_0xd989('0x23')](_0x10ec53)[_0xd989('0x24')](_0x8457de);}};}function respondWithFilteredResult(_0x4816c9,_0x4696bf){return function(_0x3bb7fa){if(_0x3bb7fa){var _0x5e4756=typeof _0x4696bf[_0xd989('0x25')]===_0xd989('0x26')&&typeof _0x4696bf[_0xd989('0x27')]===_0xd989('0x26');var _0x295931=_0x3bb7fa[_0xd989('0x28')];var _0x32881=_0x5e4756?0x0:_0x4696bf[_0xd989('0x25')];var _0x55f0a3=_0x5e4756?_0x3bb7fa[_0xd989('0x28')]:_0x4696bf[_0xd989('0x25')]+_0x4696bf['limit'];var _0x10ac1f;if(_0x55f0a3>=_0x295931){_0x55f0a3=_0x295931;_0x10ac1f=0xc8;}else{_0x10ac1f=0xce;}_0x4816c9[_0xd989('0x23')](_0x10ac1f);return _0x4816c9[_0xd989('0x29')](_0xd989('0x2a'),_0x32881+'-'+_0x55f0a3+'/'+_0x295931)[_0xd989('0x24')](_0x3bb7fa);}return null;};}function patchUpdates(_0x2d6d3c){return function(_0x29b6b0){try{jsonpatch[_0xd989('0x2b')](_0x29b6b0,_0x2d6d3c,!![]);}catch(_0x1f9a2e){return BPromise[_0xd989('0x2c')](_0x1f9a2e);}return _0x29b6b0[_0xd989('0x2d')]();};}function saveUpdates(_0x4fa514,_0x278383){return function(_0x23eff8){if(_0x23eff8){return _0x23eff8[_0xd989('0x2e')](_0x4fa514)[_0xd989('0x2f')](function(_0x5f356d){return _0x5f356d;});}return null;};}function removeEntity(_0x430f46,_0x291378){return function(_0x7aee41){if(_0x7aee41){return _0x7aee41['destroy']()[_0xd989('0x2f')](function(){var _0x1c854e=_0x7aee41[_0xd989('0x30')]({'plain':!![]});var _0x52f064=_0xd989('0x31');return db[_0xd989('0x32')][_0xd989('0x33')]({'where':{'type':_0x52f064,'resourceId':_0x1c854e['id']}})[_0xd989('0x2f')](function(){return _0x7aee41;});})[_0xd989('0x2f')](function(){_0x430f46[_0xd989('0x23')](0xcc)[_0xd989('0x34')]();});}};}function handleEntityNotFound(_0x26bcee,_0xd76701){return function(_0x1495d7){if(!_0x1495d7){_0x26bcee[_0xd989('0x22')](0x194);}return _0x1495d7;};}function handleError(_0x2bf843,_0xedcda1){_0xedcda1=_0xedcda1||0x1f4;return function(_0x240e13){logger[_0xd989('0x1e')](_0x240e13['stack']);if(_0x240e13['name']){delete _0x240e13[_0xd989('0x35')];}_0x2bf843[_0xd989('0x23')](_0xedcda1)['send'](_0x240e13);};}exports[_0xd989('0x36')]=function(_0x34495d,_0x2565dd){var _0x3f87d8={},_0xdc57e={},_0x2ae6bb={'count':0x0,'rows':[]};var _0x2c3e75=_[_0xd989('0x37')](db[_0xd989('0x38')][_0xd989('0x39')],function(_0x6b8ac7){return{'name':_0x6b8ac7[_0xd989('0x3a')],'type':_0x6b8ac7[_0xd989('0x3b')][_0xd989('0x3c')]};});_0xdc57e[_0xd989('0x3d')]=_[_0xd989('0x37')](_0x2c3e75,_0xd989('0x35'));_0xdc57e[_0xd989('0x3e')]=_[_0xd989('0x3f')](_0x34495d[_0xd989('0x3e')]);_0xdc57e[_0xd989('0x40')]=_[_0xd989('0x41')](_0xdc57e[_0xd989('0x3d')],_0xdc57e[_0xd989('0x3e')]);_0x3f87d8[_0xd989('0x42')]=_[_0xd989('0x41')](_0xdc57e[_0xd989('0x3d')],qs[_0xd989('0x43')](_0x34495d['query'][_0xd989('0x43')]));_0x3f87d8[_0xd989('0x42')]=_0x3f87d8[_0xd989('0x42')][_0xd989('0x44')]?_0x3f87d8[_0xd989('0x42')]:_0xdc57e['model'];if(!_0x34495d['query']['hasOwnProperty'](_0xd989('0x45'))){_0x3f87d8[_0xd989('0x27')]=qs['limit'](_0x34495d[_0xd989('0x3e')]['limit']);_0x3f87d8[_0xd989('0x25')]=qs[_0xd989('0x25')](_0x34495d[_0xd989('0x3e')]['offset']);}_0x3f87d8['order']=qs[_0xd989('0x46')](_0x34495d[_0xd989('0x3e')][_0xd989('0x46')]);_0x3f87d8[_0xd989('0x47')]=qs[_0xd989('0x40')](_[_0xd989('0x48')](_0x34495d[_0xd989('0x3e')],_0xdc57e[_0xd989('0x40')]),_0x2c3e75);if(_0x34495d[_0xd989('0x3e')][_0xd989('0x49')]){_0x3f87d8[_0xd989('0x47')]=_[_0xd989('0x4a')](_0x3f87d8[_0xd989('0x47')],{'$or':_[_0xd989('0x37')](_0x2c3e75,function(_0x423674){if(_0x423674[_0xd989('0x3b')]!==_0xd989('0x4b')){var _0x3317c9={};_0x3317c9[_0x423674[_0xd989('0x35')]]={'$like':'%'+_0x34495d[_0xd989('0x3e')]['filter']+'%'};return _0x3317c9;}})});}_0x3f87d8=_[_0xd989('0x4a')]({},_0x3f87d8,_0x34495d[_0xd989('0x4c')]);var _0x4c47be={'where':_0x3f87d8[_0xd989('0x47')]};return db[_0xd989('0x38')][_0xd989('0x28')](_0x4c47be)['then'](function(_0x2d78a7){_0x2ae6bb['count']=_0x2d78a7;if(_0x34495d[_0xd989('0x3e')][_0xd989('0x4d')]){_0x3f87d8[_0xd989('0x4e')]=[{'all':!![]}];}return db[_0xd989('0x38')][_0xd989('0x4f')](_0x3f87d8);})['then'](function(_0x2e6a97){_0x2ae6bb[_0xd989('0x50')]=_0x2e6a97;return _0x2ae6bb;})['then'](respondWithFilteredResult(_0x2565dd,_0x3f87d8))['catch'](handleError(_0x2565dd,null));};exports[_0xd989('0x51')]=function(_0x3b4df0,_0x21bb34){var _0x166359={'raw':![],'where':{'id':_0x3b4df0[_0xd989('0x52')]['id']}},_0xb8428={};_0xb8428[_0xd989('0x3d')]=_[_0xd989('0x3f')](db[_0xd989('0x38')][_0xd989('0x39')]);_0xb8428[_0xd989('0x3e')]=_[_0xd989('0x3f')](_0x3b4df0[_0xd989('0x3e')]);_0xb8428[_0xd989('0x40')]=_[_0xd989('0x41')](_0xb8428[_0xd989('0x3d')],_0xb8428['query']);_0x166359['attributes']=_[_0xd989('0x41')](_0xb8428[_0xd989('0x3d')],qs[_0xd989('0x43')](_0x3b4df0[_0xd989('0x3e')]['fields']));_0x166359['attributes']=_0x166359[_0xd989('0x42')][_0xd989('0x44')]?_0x166359[_0xd989('0x42')]:_0xb8428[_0xd989('0x3d')];if(_0x3b4df0[_0xd989('0x3e')][_0xd989('0x4d')]){_0x166359[_0xd989('0x4e')]=[{'all':!![]}];}_0x166359=_['merge']({},_0x166359,_0x3b4df0[_0xd989('0x4c')]);return db['VoiceContext']['find'](_0x166359)['then'](handleEntityNotFound(_0x21bb34,null))['then'](respondWithResult(_0x21bb34,null))['catch'](handleError(_0x21bb34,null));};exports[_0xd989('0x53')]=function(_0x490dc8,_0x644bcb,_0x4f4a82){var _0x10294d;return db[_0xd989('0x38')][_0xd989('0x53')](_0x490dc8['body'],{'raw':!![]})['then'](function(_0x485d78){_0x10294d=_0x485d78;return db[_0xd989('0x38')][_0xd989('0x4f')]({'raw':!![]});})[_0xd989('0x2f')](function(_0x4d7dce){var _0x4abd8f=fs[_0xd989('0x54')](path[_0xd989('0x55')](config[_0xd989('0x56')],_0xd989('0x57')),_0xd989('0x58'));var _0x1416f3=ejs[_0xd989('0x59')](_0x4abd8f,{'contexts':_0x4d7dce||[]});fs[_0xd989('0x5a')](_0xd989('0x5b'),_0x1416f3);})[_0xd989('0x2f')](function(){return respondWithRpcPromise(_0xd989('0x5c'),_0xd989('0x53'),{'module':_0xd989('0x5d')});})[_0xd989('0x2f')](function(){var _0x194900=_0x490dc8[_0xd989('0x5e')][_0xd989('0x30')]({'plain':!![]});if(!_0x194900)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x194900[_0xd989('0x5f')]===_0xd989('0x5e')){var _0x441b43=_0x10294d[_0xd989('0x30')]({'plain':!![]});return db[_0xd989('0x60')][_0xd989('0x61')]({'where':{'name':_0xd989('0x31'),'userProfileId':_0x194900[_0xd989('0x62')]},'raw':!![]})[_0xd989('0x2f')](function(_0x39b997){if(_0x39b997&&_0x39b997[_0xd989('0x63')]===0x0){return db[_0xd989('0x32')][_0xd989('0x53')]({'name':_0x441b43[_0xd989('0x35')],'resourceId':_0x441b43['id'],'type':_0x39b997[_0xd989('0x35')],'sectionId':_0x39b997['id']},{})[_0xd989('0x2f')](function(){return _0x10294d;});}else{return _0x10294d;}})['catch'](function(_0x463f46){logger[_0xd989('0x1e')](_0xd989('0x64'),_0x463f46);throw _0x463f46;});}return _0x10294d;})[_0xd989('0x2f')](respondWithResult(_0x644bcb,0xc9))['catch'](handleError(_0x644bcb,null));};exports[_0xd989('0x2e')]=function(_0x42907f,_0x382a8c,_0x363d97){var _0x22387e;return db[_0xd989('0x38')]['find']({'where':{'id':_0x42907f[_0xd989('0x52')]['id']}})[_0xd989('0x2f')](handleEntityNotFound(_0x382a8c,null))['then'](saveUpdates(_0x42907f['body'],null))[_0xd989('0x2f')](function(_0x36e50f){if(_0x36e50f){_0x22387e=_0x36e50f;return db[_0xd989('0x38')][_0xd989('0x4f')]({'raw':!![]});}})[_0xd989('0x2f')](function(_0x148352){var _0x557d10=fs[_0xd989('0x54')](path[_0xd989('0x55')](config[_0xd989('0x56')],_0xd989('0x57')),_0xd989('0x58'));var _0x3de922=ejs[_0xd989('0x59')](_0x557d10,{'contexts':_0x148352||[]});fs[_0xd989('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3de922);})[_0xd989('0x2f')](function(){return respondWithRpcPromise(_0xd989('0x5c'),_0xd989('0x2e'),{'module':_0xd989('0x5d')});})[_0xd989('0x2f')](function(){return _0x22387e;})[_0xd989('0x2f')](respondWithResult(_0x382a8c,null))[_0xd989('0x65')](handleError(_0x382a8c,null));};exports[_0xd989('0x33')]=function(_0x11aa45,_0x2d5212,_0x5d6373){var _0x199633;return db[_0xd989('0x38')][_0xd989('0x61')]({'where':{'id':_0x11aa45[_0xd989('0x52')]['id']}})['then'](handleEntityNotFound(_0x2d5212,null))['then'](removeEntity(_0x2d5212,null))[_0xd989('0x2f')](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xd989('0x2f')](function(_0xc26c14){var _0x5968ef=fs['readFileSync'](path[_0xd989('0x55')](config['root'],_0xd989('0x57')),_0xd989('0x58'));var _0x4bc417=ejs[_0xd989('0x59')](_0x5968ef,{'contexts':_0xc26c14});fs[_0xd989('0x5a')](_0xd989('0x5b'),_0x4bc417);return respondWithRpcPromise(_0xd989('0x5c'),_0xd989('0x33'),{'module':_0xd989('0x5d')});})[_0xd989('0x65')](handleError(_0x2d5212,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 7038e1f..ff27ee4 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 _0x7292=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x7292,0x6d));var _0x2729=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x7292[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var logger=require(_0x2729('0x2'))(_0x2729('0x3'));var moment=require(_0x2729('0x4'));var BPromise=require(_0x2729('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2729('0x6'));var rimraf=require(_0x2729('0x7'));var config=require(_0x2729('0x8'));var attributes=require(_0x2729('0x9'));module[_0x2729('0xa')]=function(_0x4db88a,_0x119935){return _0x4db88a[_0x2729('0xb')](_0x2729('0xc'),attributes,{'tableName':_0x2729('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2580=['exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./voiceContext.attributes'];(function(_0x5a1522,_0x46e359){var _0x30326c=function(_0x413dbb){while(--_0x413dbb){_0x5a1522['push'](_0x5a1522['shift']());}};_0x30326c(++_0x46e359);}(_0x2580,0x156));var _0x0258=function(_0x4ae743,_0x56b609){_0x4ae743=_0x4ae743-0x0;var _0x186442=_0x2580[_0x4ae743];return _0x186442;};'use strict';var _=require(_0x0258('0x0'));var util=require(_0x0258('0x1'));var logger=require(_0x0258('0x2'))('api');var moment=require(_0x0258('0x3'));var BPromise=require(_0x0258('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0258('0x5'));var rimraf=require(_0x0258('0x6'));var config=require(_0x0258('0x7'));var attributes=require(_0x0258('0x8'));module[_0x0258('0x9')]=function(_0x62628f,_0x1f53a4){return _0x62628f[_0x0258('0xa')](_0x0258('0xb'),attributes,{'tableName':_0x0258('0xc'),'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 c75f6aa..8ade532 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 _0xe59f=['jayson/promise','client','http','request','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment'];(function(_0x5d61c5,_0x20d201){var _0x5032cc=function(_0x498d7e){while(--_0x498d7e){_0x5d61c5['push'](_0x5d61c5['shift']());}};_0x5032cc(++_0x20d201);}(_0xe59f,0x1c5));var _0xfe59=function(_0x592092,_0x46eab2){_0x592092=_0x592092-0x0;var _0x3431e1=_0xe59f[_0x592092];return _0x3431e1;};'use strict';var _=require(_0xfe59('0x0'));var util=require(_0xfe59('0x1'));var moment=require(_0xfe59('0x2'));var BPromise=require(_0xfe59('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe59('0x4'));var db=require(_0xfe59('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfe59('0x6'));var jayson=require(_0xfe59('0x7'));var client=jayson[_0xfe59('0x8')][_0xfe59('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xce79e8,_0x376d4d,_0x4273a3){return new BPromise(function(_0x358595,_0x6d2ac3){return client[_0xfe59('0xa')](_0xce79e8,_0x4273a3)['then'](function(_0x55fa6b){logger[_0xfe59('0xb')]('VoiceContext,\x20%s,\x20%s',_0x376d4d,_0xfe59('0xc'));logger['debug'](_0xfe59('0xd'),_0x376d4d,_0xfe59('0xc'),JSON['stringify'](_0x55fa6b));if(_0x55fa6b[_0xfe59('0xe')]){if(_0x55fa6b[_0xfe59('0xe')][_0xfe59('0xf')]===0x1f4){logger[_0xfe59('0xe')](_0xfe59('0x10'),_0x376d4d,_0x55fa6b['error']['message']);return _0x6d2ac3(_0x55fa6b[_0xfe59('0xe')]['message']);}logger[_0xfe59('0xe')](_0xfe59('0x10'),_0x376d4d,_0x55fa6b[_0xfe59('0xe')][_0xfe59('0x11')]);return _0x358595(_0x55fa6b['error'][_0xfe59('0x11')]);}else{logger[_0xfe59('0xb')](_0xfe59('0x10'),_0x376d4d,'request\x20sent');_0x358595(_0x55fa6b[_0xfe59('0x12')][_0xfe59('0x11')]);}})[_0xfe59('0x13')](function(_0x331dc5){logger[_0xfe59('0xe')](_0xfe59('0x10'),_0x376d4d,_0x331dc5);_0x6d2ac3(_0x331dc5);});});} \ No newline at end of file +var _0xb12d=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x23187e,_0x35ace6){var _0x54ffb4=function(_0x302a3a){while(--_0x302a3a){_0x23187e['push'](_0x23187e['shift']());}};_0x54ffb4(++_0x35ace6);}(_0xb12d,0x124));var _0xdb12=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0xb12d[_0x296809];return _0x18c0d3;};'use strict';var _=require(_0xdb12('0x0'));var util=require(_0xdb12('0x1'));var moment=require(_0xdb12('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb12('0x4'))['db'];var utils=require(_0xdb12('0x5'));var logger=require(_0xdb12('0x6'))(_0xdb12('0x7'));var config=require(_0xdb12('0x8'));var jayson=require(_0xdb12('0x9'));var client=jayson['client'][_0xdb12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e73f,_0x27eb31,_0x3872c3){return new BPromise(function(_0x11385d,_0x11d97c){return client[_0xdb12('0xb')](_0x19e73f,_0x3872c3)[_0xdb12('0xc')](function(_0x54eb5b){logger[_0xdb12('0xd')]('VoiceContext,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));logger[_0xdb12('0xf')](_0xdb12('0x10'),_0x27eb31,'request\x20sent',JSON[_0xdb12('0x11')](_0x54eb5b));if(_0x54eb5b[_0xdb12('0x12')]){if(_0x54eb5b[_0xdb12('0x12')]['code']===0x1f4){logger[_0xdb12('0x12')]('VoiceContext,\x20%s,\x20%s',_0x27eb31,_0x54eb5b[_0xdb12('0x12')][_0xdb12('0x13')]);return _0x11d97c(_0x54eb5b[_0xdb12('0x12')]['message']);}logger[_0xdb12('0x12')](_0xdb12('0x14'),_0x27eb31,_0x54eb5b['error'][_0xdb12('0x13')]);return _0x11385d(_0x54eb5b['error'][_0xdb12('0x13')]);}else{logger[_0xdb12('0xd')]('VoiceContext,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));_0x11385d(_0x54eb5b[_0xdb12('0x15')][_0xdb12('0x13')]);}})[_0xdb12('0x16')](function(_0x504cf5){logger['error'](_0xdb12('0x14'),_0x27eb31,_0x504cf5);_0x11d97c(_0x504cf5);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 1230d86..3e0a459 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 _0x4a5b=['./voiceDialReport.controller','get','isAuthenticated','/describe','describe','/:id','post','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4a5b,0xe8));var _0xb4a5=function(_0x6402fc,_0x492ed4){_0x6402fc=_0x6402fc-0x0;var _0x32a24e=_0x4a5b[_0x6402fc];return _0x32a24e;};'use strict';var multer=require('multer');var util=require(_0xb4a5('0x0'));var path=require(_0xb4a5('0x1'));var timeout=require(_0xb4a5('0x2'));var express=require(_0xb4a5('0x3'));var router=express['Router']();var fs_extra=require(_0xb4a5('0x4'));var auth=require(_0xb4a5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb4a5('0x6'));router[_0xb4a5('0x7')]('/',auth[_0xb4a5('0x8')](),controller['index']);router[_0xb4a5('0x7')](_0xb4a5('0x9'),auth['isAuthenticated'](),controller[_0xb4a5('0xa')]);router[_0xb4a5('0x7')](_0xb4a5('0xb'),auth[_0xb4a5('0x8')](),controller['show']);router[_0xb4a5('0xc')]('/',auth[_0xb4a5('0x8')](),controller['create']);router[_0xb4a5('0xd')](_0xb4a5('0xb'),auth[_0xb4a5('0x8')](),controller[_0xb4a5('0xe')]);router[_0xb4a5('0xf')]('/:id',auth[_0xb4a5('0x8')](),controller[_0xb4a5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x6364=['update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put'];(function(_0x1260f1,_0x37f79d){var _0x53c9f2=function(_0x291594){while(--_0x291594){_0x1260f1['push'](_0x1260f1['shift']());}};_0x53c9f2(++_0x37f79d);}(_0x6364,0x8f));var _0x4636=function(_0xfc757b,_0x300fe8){_0xfc757b=_0xfc757b-0x0;var _0x4b5a07=_0x6364[_0xfc757b];return _0x4b5a07;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4636('0x0'));var timeout=require(_0x4636('0x1'));var express=require(_0x4636('0x2'));var router=express[_0x4636('0x3')]();var fs_extra=require(_0x4636('0x4'));var auth=require(_0x4636('0x5'));var interaction=require(_0x4636('0x6'));var config=require(_0x4636('0x7'));var controller=require('./voiceDialReport.controller');router[_0x4636('0x8')]('/',auth[_0x4636('0x9')](),controller[_0x4636('0xa')]);router[_0x4636('0x8')](_0x4636('0xb'),auth['isAuthenticated'](),controller[_0x4636('0xc')]);router[_0x4636('0x8')](_0x4636('0xd'),auth[_0x4636('0x9')](),controller['show']);router[_0x4636('0xe')]('/',auth[_0x4636('0x9')](),controller[_0x4636('0xf')]);router[_0x4636('0x10')](_0x4636('0xd'),auth['isAuthenticated'](),controller[_0x4636('0x11')]);router[_0x4636('0x12')](_0x4636('0xd'),auth[_0x4636('0x9')](),controller['destroy']);module[_0x4636('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index f1ab226..c8c9322 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 _0x6aa7=['called,connect,complete','sequelize','STRING','INTEGER','DATE'];(function(_0x492692,_0x11fdcc){var _0x54fc29=function(_0x334b60){while(--_0x334b60){_0x492692['push'](_0x492692['shift']());}};_0x54fc29(++_0x11fdcc);}(_0x6aa7,0x178));var _0x76aa=function(_0x1ee0b4,_0x2a4763){_0x1ee0b4=_0x1ee0b4-0x0;var _0x4dbf59=_0x6aa7[_0x1ee0b4];return _0x4dbf59;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'privilege':{'type':Sequelize[_0x76aa('0x1')]},'channel':{'type':Sequelize[_0x76aa('0x1')]},'channelstate':{'type':Sequelize[_0x76aa('0x2')]},'channelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'connectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x76aa('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x2')]},'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'linkedid':{'type':Sequelize[_0x76aa('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x76aa('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridnum':{'type':Sequelize[_0x76aa('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x76aa('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x76aa('0x1')]},'destlanguage':{'type':Sequelize[_0x76aa('0x1')]},'destaccountcode':{'type':Sequelize[_0x76aa('0x1')]},'destcontext':{'type':Sequelize[_0x76aa('0x1')]},'destexten':{'type':Sequelize[_0x76aa('0x1')]},'destpriority':{'type':Sequelize[_0x76aa('0x2')]},'destuniqueid':{'type':Sequelize[_0x76aa('0x1')]},'destlinkedid':{'type':Sequelize[_0x76aa('0x1')]},'dialstring':{'type':Sequelize[_0x76aa('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x76aa('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x76aa('0x3')]},'lastevent':{'type':Sequelize[_0x76aa('0x1')],'comment':_0x76aa('0x4')},'routeId':{'type':Sequelize[_0x76aa('0x2')]},'duration':{'type':Sequelize[_0x76aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xbec5=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x28543c,_0x38ca36){var _0x16f9ba=function(_0x58b91f){while(--_0x58b91f){_0x28543c['push'](_0x28543c['shift']());}};_0x16f9ba(++_0x38ca36);}(_0xbec5,0xe5));var _0x5bec=function(_0x476b00,_0x250877){_0x476b00=_0x476b00-0x0;var _0x44ec8e=_0xbec5[_0x476b00];return _0x44ec8e;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5bec('0x2')]},'channelstate':{'type':Sequelize[_0x5bec('0x3')]},'channelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'calleridnum':{'type':Sequelize[_0x5bec('0x2')]},'calleridname':{'type':Sequelize[_0x5bec('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5bec('0x2')]},'language':{'type':Sequelize[_0x5bec('0x2')]},'accountcode':{'type':Sequelize[_0x5bec('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x5bec('0x2')]},'priority':{'type':Sequelize[_0x5bec('0x3')]},'uniqueid':{'type':Sequelize[_0x5bec('0x2')]},'linkedid':{'type':Sequelize[_0x5bec('0x2')]},'destchannel':{'type':Sequelize[_0x5bec('0x2')]},'destchannelstate':{'type':Sequelize[_0x5bec('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5bec('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x5bec('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5bec('0x2')]},'destaccountcode':{'type':Sequelize[_0x5bec('0x2')]},'destcontext':{'type':Sequelize[_0x5bec('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5bec('0x3')]},'destuniqueid':{'type':Sequelize[_0x5bec('0x2')]},'destlinkedid':{'type':Sequelize[_0x5bec('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x5bec('0x2')]},'starttime':{'type':Sequelize[_0x5bec('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5bec('0x4')]},'lastevent':{'type':Sequelize[_0x5bec('0x2')],'comment':_0x5bec('0x5')},'routeId':{'type':Sequelize[_0x5bec('0x3')]},'duration':{'type':Sequelize[_0x5bec('0x3')]},'holdtime':{'type':Sequelize[_0x5bec('0x3')]},'billableseconds':{'type':Sequelize[_0x5bec('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 5e35286..ea8073d 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 _0x31e7=['Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','includeAll','include','rows','catch','show','params','length','options','create','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','undefined','count','offset'];(function(_0xdfb23e,_0x2a8c56){var _0x2c7dff=function(_0x3a8b51){while(--_0x3a8b51){_0xdfb23e['push'](_0xdfb23e['shift']());}};_0x2c7dff(++_0x2a8c56);}(_0x31e7,0x19f));var _0x731e=function(_0x279150,_0x1bc284){_0x279150=_0x279150-0x0;var _0x10dd1f=_0x31e7[_0x279150];return _0x10dd1f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x731e('0x0'));var zipdir=require(_0x731e('0x1'));var jsonpatch=require(_0x731e('0x2'));var rp=require(_0x731e('0x3'));var moment=require(_0x731e('0x4'));var BPromise=require(_0x731e('0x5'));var Mustache=require(_0x731e('0x6'));var util=require(_0x731e('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x731e('0x8'));var ejs=require(_0x731e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x731e('0xa'));var squel=require('squel');var crypto=require(_0x731e('0xb'));var jsforce=require(_0x731e('0xc'));var deskjs=require(_0x731e('0xd'));var toCsv=require(_0x731e('0x8'));var querystring=require(_0x731e('0xe'));var Papa=require(_0x731e('0xf'));var Redis=require(_0x731e('0x10'));var authService=require(_0x731e('0x11'));var qs=require(_0x731e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x731e('0x13'));var logger=require(_0x731e('0x14'))(_0x731e('0x15'));var utils=require('../../config/utils');var config=require(_0x731e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x731e('0x17'))['db'];function respondWithStatusCode(_0x38b877,_0x38b3d0){_0x38b3d0=_0x38b3d0||0xcc;return function(_0x1478a8){if(_0x1478a8){return _0x38b877['sendStatus'](_0x38b3d0);}return _0x38b877[_0x731e('0x18')](_0x38b3d0)['end']();};}function respondWithResult(_0x2cc769,_0x502fb7){_0x502fb7=_0x502fb7||0xc8;return function(_0x31d65e){if(_0x31d65e){return _0x2cc769[_0x731e('0x18')](_0x502fb7)[_0x731e('0x19')](_0x31d65e);}};}function respondWithFilteredResult(_0x52f83b,_0x5f0e3d){return function(_0x1ffd40){if(_0x1ffd40){var _0x279627=typeof _0x5f0e3d['offset']==='undefined'&&typeof _0x5f0e3d['limit']===_0x731e('0x1a');var _0x4baa46=_0x1ffd40[_0x731e('0x1b')];var _0x3b3735=_0x279627?0x0:_0x5f0e3d[_0x731e('0x1c')];var _0x37dd6f=_0x279627?_0x1ffd40[_0x731e('0x1b')]:_0x5f0e3d[_0x731e('0x1c')]+_0x5f0e3d['limit'];var _0x540552;if(_0x37dd6f>=_0x4baa46){_0x37dd6f=_0x4baa46;_0x540552=0xc8;}else{_0x540552=0xce;}_0x52f83b[_0x731e('0x18')](_0x540552);return _0x52f83b['set'](_0x731e('0x1d'),_0x3b3735+'-'+_0x37dd6f+'/'+_0x4baa46)['json'](_0x1ffd40);}return null;};}function patchUpdates(_0x353612){return function(_0x129704){try{jsonpatch[_0x731e('0x1e')](_0x129704,_0x353612,!![]);}catch(_0x1700b4){return BPromise[_0x731e('0x1f')](_0x1700b4);}return _0x129704[_0x731e('0x20')]();};}function saveUpdates(_0x539fdf,_0x25ffee){return function(_0x237c24){if(_0x237c24){return _0x237c24[_0x731e('0x21')](_0x539fdf)[_0x731e('0x22')](function(_0x5aa1f0){return _0x5aa1f0;});}return null;};}function removeEntity(_0xa2a932,_0x312c88){return function(_0x325c84){if(_0x325c84){return _0x325c84[_0x731e('0x23')]()[_0x731e('0x22')](function(){_0xa2a932[_0x731e('0x18')](0xcc)[_0x731e('0x24')]();});}};}function handleEntityNotFound(_0x59d460,_0x2de8ec){return function(_0x56fd6b){if(!_0x56fd6b){_0x59d460[_0x731e('0x25')](0x194);}return _0x56fd6b;};}function handleError(_0x8a4b52,_0x350bcf){_0x350bcf=_0x350bcf||0x1f4;return function(_0x3b1439){logger[_0x731e('0x26')](_0x3b1439['stack']);if(_0x3b1439[_0x731e('0x27')]){delete _0x3b1439['name'];}_0x8a4b52[_0x731e('0x18')](_0x350bcf)[_0x731e('0x28')](_0x3b1439);};}exports[_0x731e('0x29')]=function(_0x4d86a2,_0x26786e){var _0x232031={},_0x5938aa={},_0x10749f={'count':0x0,'rows':[]};var _0x145f68=_[_0x731e('0x2a')](db[_0x731e('0x2b')][_0x731e('0x2c')],function(_0x5150f2){return{'name':_0x5150f2[_0x731e('0x2d')],'type':_0x5150f2[_0x731e('0x2e')][_0x731e('0x2f')]};});_0x5938aa[_0x731e('0x30')]=_[_0x731e('0x2a')](_0x145f68,_0x731e('0x27'));_0x5938aa[_0x731e('0x31')]=_[_0x731e('0x32')](_0x4d86a2[_0x731e('0x31')]);_0x5938aa[_0x731e('0x33')]=_[_0x731e('0x34')](_0x5938aa[_0x731e('0x30')],_0x5938aa[_0x731e('0x31')]);_0x232031[_0x731e('0x35')]=_[_0x731e('0x34')](_0x5938aa['model'],qs[_0x731e('0x36')](_0x4d86a2[_0x731e('0x31')][_0x731e('0x36')]));_0x232031['attributes']=_0x232031[_0x731e('0x35')]['length']?_0x232031[_0x731e('0x35')]:_0x5938aa[_0x731e('0x30')];if(!_0x4d86a2[_0x731e('0x31')][_0x731e('0x37')]('nolimit')){_0x232031['limit']=qs[_0x731e('0x38')](_0x4d86a2[_0x731e('0x31')][_0x731e('0x38')]);_0x232031['offset']=qs[_0x731e('0x1c')](_0x4d86a2[_0x731e('0x31')][_0x731e('0x1c')]);}_0x232031[_0x731e('0x39')]=qs[_0x731e('0x3a')](_0x4d86a2[_0x731e('0x31')]['sort']);_0x232031[_0x731e('0x3b')]=qs[_0x731e('0x33')](_['pick'](_0x4d86a2[_0x731e('0x31')],_0x5938aa['filters']),_0x145f68);if(_0x4d86a2[_0x731e('0x31')][_0x731e('0x3c')]){_0x232031[_0x731e('0x3b')]=_[_0x731e('0x3d')](_0x232031[_0x731e('0x3b')],{'$or':_['map'](_0x145f68,function(_0x238c17){if(_0x238c17[_0x731e('0x2e')]!=='VIRTUAL'){var _0x9c5bdb={};_0x9c5bdb[_0x238c17[_0x731e('0x27')]]={'$like':'%'+_0x4d86a2[_0x731e('0x31')][_0x731e('0x3c')]+'%'};return _0x9c5bdb;}})});}_0x232031=_[_0x731e('0x3d')]({},_0x232031,_0x4d86a2['options']);var _0x4a9b6a={'where':_0x232031[_0x731e('0x3b')]};return db[_0x731e('0x2b')]['count'](_0x4a9b6a)[_0x731e('0x22')](function(_0x23fab4){_0x10749f[_0x731e('0x1b')]=_0x23fab4;if(_0x4d86a2['query'][_0x731e('0x3e')]){_0x232031[_0x731e('0x3f')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x232031);})['then'](function(_0x1f2d6f){_0x10749f[_0x731e('0x40')]=_0x1f2d6f;return _0x10749f;})[_0x731e('0x22')](respondWithFilteredResult(_0x26786e,_0x232031))[_0x731e('0x41')](handleError(_0x26786e,null));};exports[_0x731e('0x42')]=function(_0x414656,_0x51daa9){var _0x1ad5f3={'raw':!![],'where':{'id':_0x414656[_0x731e('0x43')]['id']}},_0x5fe2c5={};_0x5fe2c5[_0x731e('0x30')]=_[_0x731e('0x32')](db[_0x731e('0x2b')]['rawAttributes']);_0x5fe2c5[_0x731e('0x31')]=_[_0x731e('0x32')](_0x414656[_0x731e('0x31')]);_0x5fe2c5[_0x731e('0x33')]=_[_0x731e('0x34')](_0x5fe2c5[_0x731e('0x30')],_0x5fe2c5[_0x731e('0x31')]);_0x1ad5f3[_0x731e('0x35')]=_['intersection'](_0x5fe2c5[_0x731e('0x30')],qs[_0x731e('0x36')](_0x414656[_0x731e('0x31')][_0x731e('0x36')]));_0x1ad5f3['attributes']=_0x1ad5f3[_0x731e('0x35')][_0x731e('0x44')]?_0x1ad5f3[_0x731e('0x35')]:_0x5fe2c5[_0x731e('0x30')];if(_0x414656[_0x731e('0x31')][_0x731e('0x3e')]){_0x1ad5f3['include']=[{'all':!![]}];}_0x1ad5f3=_[_0x731e('0x3d')]({},_0x1ad5f3,_0x414656[_0x731e('0x45')]);return db['VoiceDialReport']['find'](_0x1ad5f3)[_0x731e('0x22')](handleEntityNotFound(_0x51daa9,null))[_0x731e('0x22')](respondWithResult(_0x51daa9,null))[_0x731e('0x41')](handleError(_0x51daa9,null));};exports['create']=function(_0x4b70fd,_0x1258f6){return db[_0x731e('0x2b')][_0x731e('0x46')](_0x4b70fd[_0x731e('0x47')],{})[_0x731e('0x22')](respondWithResult(_0x1258f6,0xc9))[_0x731e('0x41')](handleError(_0x1258f6,null));};exports[_0x731e('0x21')]=function(_0x56991d,_0x5d57a8){if(_0x56991d[_0x731e('0x47')]['id']){delete _0x56991d[_0x731e('0x47')]['id'];}return db[_0x731e('0x2b')][_0x731e('0x48')]({'where':{'id':_0x56991d['params']['id']}})['then'](handleEntityNotFound(_0x5d57a8,null))[_0x731e('0x22')](saveUpdates(_0x56991d[_0x731e('0x47')],null))[_0x731e('0x22')](respondWithResult(_0x5d57a8,null))['catch'](handleError(_0x5d57a8,null));};exports['destroy']=function(_0x2024f1,_0xca2114){return db[_0x731e('0x2b')]['find']({'where':{'id':_0x2024f1[_0x731e('0x43')]['id']}})['then'](handleEntityNotFound(_0xca2114,null))[_0x731e('0x22')](removeEntity(_0xca2114,null))[_0x731e('0x41')](handleError(_0xca2114,null));};exports[_0x731e('0x49')]=function(_0x533195,_0x2dbb41){return db[_0x731e('0x2b')][_0x731e('0x49')]()[_0x731e('0x22')](respondWithResult(_0x2dbb41,null))[_0x731e('0x41')](handleError(_0x2dbb41,null));}; \ No newline at end of file +var _0xfc2d=['undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x27729e,_0xf2b4a1){var _0x1439f7=function(_0x382fee){while(--_0x382fee){_0x27729e['push'](_0x27729e['shift']());}};_0x1439f7(++_0xf2b4a1);}(_0xfc2d,0x10c));var _0xdfc2=function(_0x1bc0ae,_0x439dfe){_0x1bc0ae=_0x1bc0ae-0x0;var _0x501104=_0xfc2d[_0x1bc0ae];return _0x501104;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdfc2('0x0'));var zipdir=require(_0xdfc2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfc2('0x2'));var moment=require(_0xdfc2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xdfc2('0x4'));var util=require('util');var path=require(_0xdfc2('0x5'));var sox=require(_0xdfc2('0x6'));var csv=require(_0xdfc2('0x7'));var ejs=require(_0xdfc2('0x8'));var fs=require('fs');var fs_extra=require(_0xdfc2('0x9'));var _=require(_0xdfc2('0xa'));var squel=require(_0xdfc2('0xb'));var crypto=require('crypto');var jsforce=require(_0xdfc2('0xc'));var deskjs=require(_0xdfc2('0xd'));var toCsv=require(_0xdfc2('0x7'));var querystring=require(_0xdfc2('0xe'));var Papa=require(_0xdfc2('0xf'));var Redis=require(_0xdfc2('0x10'));var authService=require(_0xdfc2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdfc2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdfc2('0x13'));var utils=require(_0xdfc2('0x14'));var config=require(_0xdfc2('0x15'));var licenseUtil=require(_0xdfc2('0x16'));var db=require(_0xdfc2('0x17'))['db'];function respondWithStatusCode(_0x1851f1,_0x33cd69){_0x33cd69=_0x33cd69||0xcc;return function(_0x41d4d1){if(_0x41d4d1){return _0x1851f1['sendStatus'](_0x33cd69);}return _0x1851f1[_0xdfc2('0x18')](_0x33cd69)[_0xdfc2('0x19')]();};}function respondWithResult(_0x1ab0cf,_0x1350cd){_0x1350cd=_0x1350cd||0xc8;return function(_0xd08d8e){if(_0xd08d8e){return _0x1ab0cf[_0xdfc2('0x18')](_0x1350cd)[_0xdfc2('0x1a')](_0xd08d8e);}};}function respondWithFilteredResult(_0x46c6b0,_0x4210d5){return function(_0x52d9bc){if(_0x52d9bc){var _0x2a4698=typeof _0x4210d5[_0xdfc2('0x1b')]===_0xdfc2('0x1c')&&typeof _0x4210d5[_0xdfc2('0x1d')]===_0xdfc2('0x1c');var _0x2ba1de=_0x52d9bc[_0xdfc2('0x1e')];var _0x5ce68e=_0x2a4698?0x0:_0x4210d5[_0xdfc2('0x1b')];var _0xca6b97=_0x2a4698?_0x52d9bc[_0xdfc2('0x1e')]:_0x4210d5[_0xdfc2('0x1b')]+_0x4210d5[_0xdfc2('0x1d')];var _0x5b9045;if(_0xca6b97>=_0x2ba1de){_0xca6b97=_0x2ba1de;_0x5b9045=0xc8;}else{_0x5b9045=0xce;}_0x46c6b0[_0xdfc2('0x18')](_0x5b9045);return _0x46c6b0[_0xdfc2('0x1f')](_0xdfc2('0x20'),_0x5ce68e+'-'+_0xca6b97+'/'+_0x2ba1de)['json'](_0x52d9bc);}return null;};}function patchUpdates(_0x4dae97){return function(_0x13e6b8){try{jsonpatch['apply'](_0x13e6b8,_0x4dae97,!![]);}catch(_0x3899a8){return BPromise['reject'](_0x3899a8);}return _0x13e6b8[_0xdfc2('0x21')]();};}function saveUpdates(_0x10f116,_0x58a042){return function(_0x38ce1e){if(_0x38ce1e){return _0x38ce1e[_0xdfc2('0x22')](_0x10f116)[_0xdfc2('0x23')](function(_0x23fcb4){return _0x23fcb4;});}return null;};}function removeEntity(_0x256caf,_0x3773c8){return function(_0x54cfa2){if(_0x54cfa2){return _0x54cfa2[_0xdfc2('0x24')]()['then'](function(){_0x256caf[_0xdfc2('0x18')](0xcc)[_0xdfc2('0x19')]();});}};}function handleEntityNotFound(_0x2f390f,_0x1f96e9){return function(_0x2d4773){if(!_0x2d4773){_0x2f390f['sendStatus'](0x194);}return _0x2d4773;};}function handleError(_0x92eddb,_0x44d750){_0x44d750=_0x44d750||0x1f4;return function(_0x4d050a){logger[_0xdfc2('0x25')](_0x4d050a['stack']);if(_0x4d050a[_0xdfc2('0x26')]){delete _0x4d050a[_0xdfc2('0x26')];}_0x92eddb[_0xdfc2('0x18')](_0x44d750)[_0xdfc2('0x27')](_0x4d050a);};}exports[_0xdfc2('0x28')]=function(_0x25dce9,_0x570e8a){var _0x20f46f={},_0x51183b={},_0x1d989a={'count':0x0,'rows':[]};var _0x443b56=_[_0xdfc2('0x29')](db[_0xdfc2('0x2a')]['rawAttributes'],function(_0x53d778){return{'name':_0x53d778['fieldName'],'type':_0x53d778['type'][_0xdfc2('0x2b')]};});_0x51183b[_0xdfc2('0x2c')]=_[_0xdfc2('0x29')](_0x443b56,_0xdfc2('0x26'));_0x51183b[_0xdfc2('0x2d')]=_[_0xdfc2('0x2e')](_0x25dce9['query']);_0x51183b[_0xdfc2('0x2f')]=_[_0xdfc2('0x30')](_0x51183b[_0xdfc2('0x2c')],_0x51183b[_0xdfc2('0x2d')]);_0x20f46f[_0xdfc2('0x31')]=_[_0xdfc2('0x30')](_0x51183b[_0xdfc2('0x2c')],qs[_0xdfc2('0x32')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x32')]));_0x20f46f[_0xdfc2('0x31')]=_0x20f46f[_0xdfc2('0x31')][_0xdfc2('0x33')]?_0x20f46f[_0xdfc2('0x31')]:_0x51183b[_0xdfc2('0x2c')];if(!_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x34')](_0xdfc2('0x35'))){_0x20f46f[_0xdfc2('0x1d')]=qs[_0xdfc2('0x1d')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x1d')]);_0x20f46f[_0xdfc2('0x1b')]=qs[_0xdfc2('0x1b')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x1b')]);}_0x20f46f[_0xdfc2('0x36')]=qs[_0xdfc2('0x37')](_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x37')]);_0x20f46f[_0xdfc2('0x38')]=qs[_0xdfc2('0x2f')](_[_0xdfc2('0x39')](_0x25dce9['query'],_0x51183b['filters']),_0x443b56);if(_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x3a')]){_0x20f46f['where']=_[_0xdfc2('0x3b')](_0x20f46f[_0xdfc2('0x38')],{'$or':_[_0xdfc2('0x29')](_0x443b56,function(_0x37d7c9){if(_0x37d7c9['type']!==_0xdfc2('0x3c')){var _0x5e872c={};_0x5e872c[_0x37d7c9[_0xdfc2('0x26')]]={'$like':'%'+_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x3a')]+'%'};return _0x5e872c;}})});}_0x20f46f=_[_0xdfc2('0x3b')]({},_0x20f46f,_0x25dce9[_0xdfc2('0x3d')]);var _0x3c2122={'where':_0x20f46f[_0xdfc2('0x38')]};return db[_0xdfc2('0x2a')][_0xdfc2('0x1e')](_0x3c2122)['then'](function(_0xc7b207){_0x1d989a[_0xdfc2('0x1e')]=_0xc7b207;if(_0x25dce9[_0xdfc2('0x2d')][_0xdfc2('0x3e')]){_0x20f46f[_0xdfc2('0x3f')]=[{'all':!![]}];}return db[_0xdfc2('0x2a')][_0xdfc2('0x40')](_0x20f46f);})['then'](function(_0x3c624b){_0x1d989a[_0xdfc2('0x41')]=_0x3c624b;return _0x1d989a;})['then'](respondWithFilteredResult(_0x570e8a,_0x20f46f))[_0xdfc2('0x42')](handleError(_0x570e8a,null));};exports[_0xdfc2('0x43')]=function(_0x137310,_0x5e2aae){var _0x97bd07={'raw':!![],'where':{'id':_0x137310[_0xdfc2('0x44')]['id']}},_0x4c8598={};_0x4c8598[_0xdfc2('0x2c')]=_[_0xdfc2('0x2e')](db[_0xdfc2('0x2a')][_0xdfc2('0x45')]);_0x4c8598[_0xdfc2('0x2d')]=_[_0xdfc2('0x2e')](_0x137310[_0xdfc2('0x2d')]);_0x4c8598[_0xdfc2('0x2f')]=_['intersection'](_0x4c8598['model'],_0x4c8598[_0xdfc2('0x2d')]);_0x97bd07[_0xdfc2('0x31')]=_[_0xdfc2('0x30')](_0x4c8598[_0xdfc2('0x2c')],qs[_0xdfc2('0x32')](_0x137310[_0xdfc2('0x2d')][_0xdfc2('0x32')]));_0x97bd07['attributes']=_0x97bd07[_0xdfc2('0x31')][_0xdfc2('0x33')]?_0x97bd07['attributes']:_0x4c8598[_0xdfc2('0x2c')];if(_0x137310['query']['includeAll']){_0x97bd07[_0xdfc2('0x3f')]=[{'all':!![]}];}_0x97bd07=_[_0xdfc2('0x3b')]({},_0x97bd07,_0x137310[_0xdfc2('0x3d')]);return db[_0xdfc2('0x2a')]['find'](_0x97bd07)[_0xdfc2('0x23')](handleEntityNotFound(_0x5e2aae,null))[_0xdfc2('0x23')](respondWithResult(_0x5e2aae,null))[_0xdfc2('0x42')](handleError(_0x5e2aae,null));};exports[_0xdfc2('0x46')]=function(_0x380f03,_0x4e3ed){return db['VoiceDialReport'][_0xdfc2('0x46')](_0x380f03[_0xdfc2('0x47')],{})[_0xdfc2('0x23')](respondWithResult(_0x4e3ed,0xc9))['catch'](handleError(_0x4e3ed,null));};exports[_0xdfc2('0x22')]=function(_0x19c749,_0x95b903){if(_0x19c749['body']['id']){delete _0x19c749[_0xdfc2('0x47')]['id'];}return db[_0xdfc2('0x2a')]['find']({'where':{'id':_0x19c749[_0xdfc2('0x44')]['id']}})[_0xdfc2('0x23')](handleEntityNotFound(_0x95b903,null))[_0xdfc2('0x23')](saveUpdates(_0x19c749[_0xdfc2('0x47')],null))[_0xdfc2('0x23')](respondWithResult(_0x95b903,null))[_0xdfc2('0x42')](handleError(_0x95b903,null));};exports[_0xdfc2('0x24')]=function(_0x485379,_0x3f9722){return db['VoiceDialReport'][_0xdfc2('0x48')]({'where':{'id':_0x485379[_0xdfc2('0x44')]['id']}})[_0xdfc2('0x23')](handleEntityNotFound(_0x3f9722,null))[_0xdfc2('0x23')](removeEntity(_0x3f9722,null))[_0xdfc2('0x42')](handleError(_0x3f9722,null));};exports[_0xdfc2('0x49')]=function(_0x3d44ad,_0x15a6dd){return db[_0xdfc2('0x2a')][_0xdfc2('0x49')]()['then'](respondWithResult(_0x15a6dd,null))[_0xdfc2('0x42')](handleError(_0x15a6dd,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 274540e..3c04138 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 _0x8794=['api','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger'];(function(_0x42a59c,_0x124b66){var _0x39e34b=function(_0x232243){while(--_0x232243){_0x42a59c['push'](_0x42a59c['shift']());}};_0x39e34b(++_0x124b66);}(_0x8794,0x1cb));var _0x4879=function(_0x3c8bc3,_0x2bc26d){_0x3c8bc3=_0x3c8bc3-0x0;var _0xa31d6e=_0x8794[_0x3c8bc3];return _0xa31d6e;};'use strict';var _=require(_0x4879('0x0'));var util=require(_0x4879('0x1'));var logger=require(_0x4879('0x2'))(_0x4879('0x3'));var moment=require('moment');var BPromise=require(_0x4879('0x4'));var rp=require(_0x4879('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4879('0x6'));var config=require(_0x4879('0x7'));var attributes=require(_0x4879('0x8'));module[_0x4879('0x9')]=function(_0x31a1dd,_0x38bbaa){return _0x31a1dd[_0x4879('0xa')](_0x4879('0xb'),attributes,{'tableName':_0x4879('0xc'),'paranoid':![],'indexes':[{'fields':[_0x4879('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc5fd=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport','lodash','util'];(function(_0xff0a44,_0x374d9f){var _0x1fc359=function(_0x200ae6){while(--_0x200ae6){_0xff0a44['push'](_0xff0a44['shift']());}};_0x1fc359(++_0x374d9f);}(_0xc5fd,0xfa));var _0xdc5f=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0xc5fd[_0x16771d];return _0x386f11;};'use strict';var _=require(_0xdc5f('0x0'));var util=require(_0xdc5f('0x1'));var logger=require(_0xdc5f('0x2'))(_0xdc5f('0x3'));var moment=require(_0xdc5f('0x4'));var BPromise=require('bluebird');var rp=require(_0xdc5f('0x5'));var fs=require('fs');var path=require(_0xdc5f('0x6'));var rimraf=require(_0xdc5f('0x7'));var config=require(_0xdc5f('0x8'));var attributes=require(_0xdc5f('0x9'));module[_0xdc5f('0xa')]=function(_0x18730f,_0xaad25d){return _0x18730f['define'](_0xdc5f('0xb'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index eb71098..10ac076 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 _0xa868=['stringify','UpdateVoiceDialReport','update','raw','where','attributes','limit','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','CreateVoiceDialReport','VoiceDialReport','body','options'];(function(_0x1044ef,_0x1dd7b5){var _0x3b5038=function(_0x59410c){while(--_0x59410c){_0x1044ef['push'](_0x1044ef['shift']());}};_0x3b5038(++_0x1dd7b5);}(_0xa868,0x65));var _0x8a86=function(_0x3ea022,_0x2d5328){_0x3ea022=_0x3ea022-0x0;var _0x3b97a2=_0xa868[_0x3ea022];return _0x3b97a2;};'use strict';var _=require(_0x8a86('0x0'));var util=require(_0x8a86('0x1'));var moment=require('moment');var BPromise=require(_0x8a86('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8a86('0x3'))['db'];var utils=require(_0x8a86('0x4'));var logger=require('../../config/logger')(_0x8a86('0x5'));var config=require(_0x8a86('0x6'));var jayson=require(_0x8a86('0x7'));var client=jayson[_0x8a86('0x8')][_0x8a86('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fa19f,_0x389446,_0xcc3dca){return new BPromise(function(_0xf0ae8,_0x356935){return client['request'](_0x1fa19f,_0xcc3dca)[_0x8a86('0xa')](function(_0x326e2a){logger[_0x8a86('0xb')](_0x8a86('0xc'),_0x389446,'request\x20sent');logger[_0x8a86('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x389446,_0x8a86('0xe'),JSON['stringify'](_0x326e2a));if(_0x326e2a[_0x8a86('0xf')]){if(_0x326e2a['error'][_0x8a86('0x10')]===0x1f4){logger[_0x8a86('0xf')](_0x8a86('0xc'),_0x389446,_0x326e2a[_0x8a86('0xf')][_0x8a86('0x11')]);return _0x356935(_0x326e2a['error'][_0x8a86('0x11')]);}logger[_0x8a86('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x389446,_0x326e2a[_0x8a86('0xf')][_0x8a86('0x11')]);return _0xf0ae8(_0x326e2a[_0x8a86('0xf')][_0x8a86('0x11')]);}else{logger[_0x8a86('0xb')]('VoiceDialReport,\x20%s,\x20%s',_0x389446,_0x8a86('0xe'));_0xf0ae8(_0x326e2a[_0x8a86('0x12')][_0x8a86('0x11')]);}})['catch'](function(_0xef399e){logger[_0x8a86('0xf')](_0x8a86('0xc'),_0x389446,_0xef399e);_0x356935(_0xef399e);});});}exports[_0x8a86('0x13')]=function(_0x10e043){var _0x587cc3=this;return new Promise(function(_0x44d38b,_0x690147){return db[_0x8a86('0x14')]['create'](_0x10e043[_0x8a86('0x15')],{'raw':_0x10e043[_0x8a86('0x16')]?_0x10e043[_0x8a86('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1a9da4){logger[_0x8a86('0xb')](_0x8a86('0x13'),_0x10e043);logger[_0x8a86('0xd')](_0x8a86('0x13'),_0x10e043,JSON[_0x8a86('0x17')](_0x1a9da4));_0x44d38b(_0x1a9da4);})['catch'](function(_0x49b24e){logger[_0x8a86('0xf')](_0x8a86('0x13'),_0x49b24e['message'],_0x10e043);_0x690147(_0x587cc3[_0x8a86('0xf')](0x1f4,_0x49b24e[_0x8a86('0x11')]));});});};exports[_0x8a86('0x18')]=function(_0x6e5e72){var _0x5040fb=this;return new Promise(function(_0x184c6f,_0x415b27){return db[_0x8a86('0x14')][_0x8a86('0x19')](_0x6e5e72[_0x8a86('0x15')],{'raw':_0x6e5e72['options']?_0x6e5e72[_0x8a86('0x16')][_0x8a86('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6e5e72[_0x8a86('0x16')]?_0x6e5e72[_0x8a86('0x16')][_0x8a86('0x1b')]||null:null,'attributes':_0x6e5e72[_0x8a86('0x16')]?_0x6e5e72[_0x8a86('0x16')][_0x8a86('0x1c')]||null:null,'limit':_0x6e5e72[_0x8a86('0x16')]?_0x6e5e72[_0x8a86('0x16')][_0x8a86('0x1d')]||null:null})[_0x8a86('0xa')](function(_0x1905c7){logger[_0x8a86('0xb')](_0x8a86('0x18'),_0x6e5e72);logger[_0x8a86('0xd')](_0x8a86('0x18'),_0x6e5e72,JSON[_0x8a86('0x17')](_0x1905c7));_0x184c6f(_0x1905c7);})[_0x8a86('0x1e')](function(_0xb68791){logger[_0x8a86('0xf')](_0x8a86('0x18'),_0xb68791[_0x8a86('0x11')],_0x6e5e72);_0x415b27(_0x5040fb['error'](0x1f4,_0xb68791[_0x8a86('0x11')]));});});}; \ No newline at end of file +var _0x5347=['error','code','VoiceDialReport,\x20%s,\x20%s','result','message','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x161e25,_0x52a310){var _0x1875f7=function(_0x3c5866){while(--_0x3c5866){_0x161e25['push'](_0x161e25['shift']());}};_0x1875f7(++_0x52a310);}(_0x5347,0x10f));var _0x7534=function(_0x2ca0cf,_0x2f56c3){_0x2ca0cf=_0x2ca0cf-0x0;var _0x12e852=_0x5347[_0x2ca0cf];return _0x12e852;};'use strict';var _=require(_0x7534('0x0'));var util=require(_0x7534('0x1'));var moment=require('moment');var BPromise=require(_0x7534('0x2'));var rs=require(_0x7534('0x3'));var fs=require('fs');var Redis=require(_0x7534('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7534('0x5'));var logger=require(_0x7534('0x6'))(_0x7534('0x7'));var config=require(_0x7534('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7534('0x9')][_0x7534('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5cb413,_0x3a5b70,_0x503104){return new BPromise(function(_0xd4134b,_0x3fd666){return client['request'](_0x5cb413,_0x503104)[_0x7534('0xb')](function(_0x5ae66e){logger[_0x7534('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x3a5b70,'request\x20sent');logger[_0x7534('0xd')](_0x7534('0xe'),_0x3a5b70,_0x7534('0xf'),JSON[_0x7534('0x10')](_0x5ae66e));if(_0x5ae66e['error']){if(_0x5ae66e[_0x7534('0x11')][_0x7534('0x12')]===0x1f4){logger[_0x7534('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x3a5b70,_0x5ae66e['error']['message']);return _0x3fd666(_0x5ae66e[_0x7534('0x11')]['message']);}logger['error'](_0x7534('0x13'),_0x3a5b70,_0x5ae66e[_0x7534('0x11')]['message']);return _0xd4134b(_0x5ae66e['error']['message']);}else{logger['info'](_0x7534('0x13'),_0x3a5b70,'request\x20sent');_0xd4134b(_0x5ae66e[_0x7534('0x14')][_0x7534('0x15')]);}})[_0x7534('0x16')](function(_0x223e7c){logger[_0x7534('0x11')](_0x7534('0x13'),_0x3a5b70,_0x223e7c);_0x3fd666(_0x223e7c);});});}exports[_0x7534('0x17')]=function(_0x15acf6){var _0x4823c3=this;return new Promise(function(_0x451b9d,_0x4a1a07){return db[_0x7534('0x18')]['create'](_0x15acf6[_0x7534('0x19')],{'raw':_0x15acf6[_0x7534('0x1a')]?_0x15acf6[_0x7534('0x1a')][_0x7534('0x1b')]===undefined?!![]:![]:!![]})[_0x7534('0xb')](function(_0x5e7b03){logger[_0x7534('0xc')]('CreateVoiceDialReport',_0x15acf6);logger['debug'](_0x7534('0x17'),_0x15acf6,JSON[_0x7534('0x10')](_0x5e7b03));_0x451b9d(_0x5e7b03);})[_0x7534('0x16')](function(_0x288c3a){logger['error']('CreateVoiceDialReport',_0x288c3a[_0x7534('0x15')],_0x15acf6);_0x4a1a07(_0x4823c3[_0x7534('0x11')](0x1f4,_0x288c3a['message']));});});};exports[_0x7534('0x1c')]=function(_0x34c36d){var _0x479781=this;return new Promise(function(_0xf76b23,_0x788792){return db[_0x7534('0x18')][_0x7534('0x1d')](_0x34c36d['body'],{'raw':_0x34c36d[_0x7534('0x1a')]?_0x34c36d[_0x7534('0x1a')][_0x7534('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34c36d[_0x7534('0x1a')]?_0x34c36d[_0x7534('0x1a')][_0x7534('0x1e')]||null:null,'attributes':_0x34c36d['options']?_0x34c36d[_0x7534('0x1a')]['attributes']||null:null,'limit':_0x34c36d[_0x7534('0x1a')]?_0x34c36d[_0x7534('0x1a')][_0x7534('0x1f')]||null:null})[_0x7534('0xb')](function(_0x5932e5){logger[_0x7534('0xc')](_0x7534('0x1c'),_0x34c36d);logger['debug']('UpdateVoiceDialReport',_0x34c36d,JSON[_0x7534('0x10')](_0x5932e5));_0xf76b23(_0x5932e5);})[_0x7534('0x16')](function(_0x5a6583){logger[_0x7534('0x11')](_0x7534('0x1c'),_0x5a6583['message'],_0x34c36d);_0x788792(_0x479781[_0x7534('0x11')](0x1f4,_0x5a6583[_0x7534('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 8dc791f..ea54b3b 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 _0x4d45=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','post','create','/:id/applications','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x570a1e,_0x1ba7b5){var _0x469084=function(_0x1e635f){while(--_0x1e635f){_0x570a1e['push'](_0x570a1e['shift']());}};_0x469084(++_0x1ba7b5);}(_0x4d45,0x176));var _0x54d4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4d45[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require('multer');var util=require(_0x54d4('0x0'));var path=require(_0x54d4('0x1'));var timeout=require('connect-timeout');var express=require(_0x54d4('0x2'));var router=express[_0x54d4('0x3')]();var fs_extra=require(_0x54d4('0x4'));var auth=require(_0x54d4('0x5'));var interaction=require(_0x54d4('0x6'));var config=require(_0x54d4('0x7'));var controller=require(_0x54d4('0x8'));router[_0x54d4('0x9')]('/',auth[_0x54d4('0xa')](),controller[_0x54d4('0xb')]);router[_0x54d4('0x9')]('/:id',auth[_0x54d4('0xa')](),controller['show']);router[_0x54d4('0xc')]('/',auth[_0x54d4('0xa')](),controller[_0x54d4('0xd')]);router[_0x54d4('0xc')](_0x54d4('0xe'),auth[_0x54d4('0xa')](),controller['addApplications']);router[_0x54d4('0xf')]('/:id',auth[_0x54d4('0xa')](),controller['update']);router[_0x54d4('0x10')]('/:id',auth[_0x54d4('0xa')](),controller[_0x54d4('0x11')]);module[_0x54d4('0x12')]=router; \ No newline at end of file +var _0x875f=['get','isAuthenticated','show','post','create','/:id/applications','addApplications','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller'];(function(_0x464ea4,_0x239588){var _0x567d6e=function(_0x14b082){while(--_0x14b082){_0x464ea4['push'](_0x464ea4['shift']());}};_0x567d6e(++_0x239588);}(_0x875f,0x147));var _0xf875=function(_0x35364,_0x1d5261){_0x35364=_0x35364-0x0;var _0x289069=_0x875f[_0x35364];return _0x289069;};'use strict';var multer=require(_0xf875('0x0'));var util=require('util');var path=require(_0xf875('0x1'));var timeout=require(_0xf875('0x2'));var express=require(_0xf875('0x3'));var router=express['Router']();var fs_extra=require(_0xf875('0x4'));var auth=require(_0xf875('0x5'));var interaction=require(_0xf875('0x6'));var config=require(_0xf875('0x7'));var controller=require(_0xf875('0x8'));router[_0xf875('0x9')]('/',auth[_0xf875('0xa')](),controller['index']);router['get']('/:id',auth[_0xf875('0xa')](),controller[_0xf875('0xb')]);router[_0xf875('0xc')]('/',auth[_0xf875('0xa')](),controller[_0xf875('0xd')]);router[_0xf875('0xc')](_0xf875('0xe'),auth[_0xf875('0xa')](),controller[_0xf875('0xf')]);router[_0xf875('0x10')](_0xf875('0x11'),auth[_0xf875('0xa')](),controller[_0xf875('0x12')]);router['delete'](_0xf875('0x11'),auth['isAuthenticated'](),controller[_0xf875('0x13')]);module[_0xf875('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index de8b669..dd85f19 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 _0xcbdd=['internal','outbound-fax','system','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','ENUM','inbound'];(function(_0x5ef6fb,_0x1677cc){var _0x11ba1f=function(_0x568b14){while(--_0x568b14){_0x5ef6fb['push'](_0x5ef6fb['shift']());}};_0x11ba1f(++_0x1677cc);}(_0xcbdd,0xbc));var _0xdcbd=function(_0x4c6fbc,_0x59d1fb){_0x4c6fbc=_0x4c6fbc-0x0;var _0x268dc5=_0xcbdd[_0x4c6fbc];return _0x268dc5;};'use strict';var Sequelize=require(_0xdcbd('0x0'));module[_0xdcbd('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xdcbd('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xdcbd('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xdcbd('0x2')},'tag':{'type':Sequelize[_0xdcbd('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xdcbd('0x3')],'allowNull':![],'defaultValue':_0xdcbd('0x4')},'appdata':{'type':Sequelize[_0xdcbd('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xdcbd('0x5')](_0xdcbd('0x6'),'outbound',_0xdcbd('0x7'),'inbound-fax',_0xdcbd('0x8'),_0xdcbd('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xdcbd('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xdcbd('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xdcbd('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xdcbd('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xdcbd('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xdcbd('0x3')],'defaultValue':_0xdcbd('0xb')},'answer':{'type':Sequelize[_0xdcbd('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0xdcbd('0xc')],'get':function(_0x1a9c16){return this[_0xdcbd('0xd')](_0xdcbd('0xe'));}},'alias':{'type':Sequelize[_0xdcbd('0x3')],'allowNull':!![]}}; \ No newline at end of file +var _0x3abc=['compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exten','sequelize','exports','STRING'];(function(_0x5df8ca,_0x4c36be){var _0x19691b=function(_0x7e3408){while(--_0x7e3408){_0x5df8ca['push'](_0x5df8ca['shift']());}};_0x19691b(++_0x4c36be);}(_0x3abc,0xfc));var _0xc3ab=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0x3abc[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require(_0xc3ab('0x0'));module[_0xc3ab('0x1')]={'context':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'unique':_0xc3ab('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc3ab('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xc3ab('0x3')},'tag':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0xc3ab('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xc3ab('0x4')](_0xc3ab('0x5'),_0xc3ab('0x6'),_0xc3ab('0x7'),_0xc3ab('0x8'),'outbound-fax',_0xc3ab('0x9'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'defaultValue':_0xc3ab('0xa')},'IntervalId':{'type':Sequelize[_0xc3ab('0xb')]},'isApp':{'type':Sequelize[_0xc3ab('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xc3ab('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xc3ab('0x2')],'defaultValue':_0xc3ab('0xd')},'answer':{'type':Sequelize[_0xc3ab('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xc3ab('0xe')],'get':function(_0xe73633){return this[_0xc3ab('0xf')](_0xc3ab('0x10'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 3e61ec4..09454c8 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 _0x02f7=['where','pick','merge','VIRTUAL','options','includeAll','VoiceExtension','findAll','rows','catch','show','keys','length','params','create','body','exten','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','internal','UserProfileSection','autoAssociation','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','VoiceExtensionId','isApp','createRouting','LOG\x20~\x20.then\x20~\x20routing','bulkCreate','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','filter','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','then','error','send','index','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','nolimit','order','sort'];(function(_0x20c0d1,_0x33e69e){var _0x572408=function(_0x300def){while(--_0x300def){_0x20c0d1['push'](_0x20c0d1['shift']());}};_0x572408(++_0x33e69e);}(_0x02f7,0x1d3));var _0x702f=function(_0x452259,_0x580308){_0x452259=_0x452259-0x0;var _0x192c46=_0x02f7[_0x452259];return _0x192c46;};'use strict';var _=require(_0x702f('0x0'));var Redis=require(_0x702f('0x1'));var qs=require(_0x702f('0x2'));var logger=require('../../config/logger')(_0x702f('0x3'));var config=require(_0x702f('0x4'));var db=require(_0x702f('0x5'))['db'];config[_0x702f('0x6')]=_[_0x702f('0x7')](config[_0x702f('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x702f('0x6')]));require('./voiceExtension.socket')[_0x702f('0x8')](socket);function respondWithStatusCode(_0x2aed68,_0x405a6c){_0x405a6c=_0x405a6c||0xcc;return function(_0xfe27d7){if(_0xfe27d7){return _0x2aed68[_0x702f('0x9')](_0x405a6c);}return _0x2aed68['status'](_0x405a6c)[_0x702f('0xa')]();};}function respondWithResult(_0x389c21,_0x2408f5){_0x2408f5=_0x2408f5||0xc8;return function(_0x5c4f84){if(_0x5c4f84){return _0x389c21[_0x702f('0xb')](_0x2408f5)[_0x702f('0xc')](_0x5c4f84);}};}function respondWithFilteredResult(_0x351a30,_0x534152){return function(_0x5056eb){if(_0x5056eb){var _0x16deb1=typeof _0x534152[_0x702f('0xd')]===_0x702f('0xe')&&typeof _0x534152['limit']===_0x702f('0xe');var _0x3ac816=_0x5056eb['count'];var _0x39c277=_0x16deb1?0x0:_0x534152[_0x702f('0xd')];var _0x43b769=_0x16deb1?_0x5056eb[_0x702f('0xf')]:_0x534152[_0x702f('0xd')]+_0x534152[_0x702f('0x10')];var _0xa07719;if(_0x43b769>=_0x3ac816){_0x43b769=_0x3ac816;_0xa07719=0xc8;}else{_0xa07719=0xce;}_0x351a30['status'](_0xa07719);return _0x351a30[_0x702f('0x11')](_0x702f('0x12'),_0x39c277+'-'+_0x43b769+'/'+_0x3ac816)[_0x702f('0xc')](_0x5056eb);}return null;};}function removeEntity(_0x67a47e){return function(_0x1ab677){if(_0x1ab677){return _0x1ab677['destroy']()['then'](function(){var _0x58ec1e=_0x1ab677['get']({'plain':!![]});var _0x922c85=[{'name':_0x702f('0x13'),'value':_0x702f('0x14'),'ignore':![]},{'name':_0x702f('0x15'),'value':'outbound','ignore':![]},{'name':_0x702f('0x16'),'value':'internal','ignore':![]}];var _0x56d64a=_(_0x922c85)[_0x702f('0x17')](_0x702f('0x18'))[_0x702f('0x19')]('value')[_0x702f('0x1a')]();if(_[_0x702f('0x1b')](_0x56d64a,_0x58ec1e[_0x702f('0x1c')])){return;}var _0x5b6808=_[_0x702f('0x1d')](_0x922c85,[_0x702f('0x1a'),_0x58ec1e[_0x702f('0x1c')]])[_0x702f('0x1e')];return db[_0x702f('0x1f')][_0x702f('0x20')]({'where':{'type':_0x5b6808,'resourceId':_0x58ec1e['id']}})[_0x702f('0x21')](function(){return _0x1ab677;});})[_0x702f('0x21')](function(){_0x67a47e[_0x702f('0xb')](0xcc)[_0x702f('0xa')]();});}};}function handleEntityNotFound(_0x4699b4){return function(_0x28a0d8){if(!_0x28a0d8){_0x4699b4[_0x702f('0x9')](0x194);}return _0x28a0d8;};}function handleError(_0x362c3f,_0x3b9dfb){_0x3b9dfb=_0x3b9dfb||0x1f4;return function(_0x1e8f6f){logger[_0x702f('0x22')](_0x1e8f6f['stack']);if(_0x1e8f6f[_0x702f('0x1e')]){delete _0x1e8f6f[_0x702f('0x1e')];}_0x362c3f[_0x702f('0xb')](_0x3b9dfb)[_0x702f('0x23')](_0x1e8f6f);};}exports[_0x702f('0x24')]=function(_0x5b935d,_0x1e7258){var _0x4787e3={},_0x7c480e={},_0x62bc25={'count':0x0,'rows':[]};var _0x39d130=_['map'](db['VoiceExtension'][_0x702f('0x25')],function(_0x52fa34){return{'name':_0x52fa34[_0x702f('0x26')],'type':_0x52fa34[_0x702f('0x1c')][_0x702f('0x27')]};});_0x7c480e['model']=_[_0x702f('0x19')](_0x39d130,_0x702f('0x1e'));_0x7c480e[_0x702f('0x28')]=_['keys'](_0x5b935d['query']);_0x7c480e[_0x702f('0x29')]=_[_0x702f('0x2a')](_0x7c480e[_0x702f('0x2b')],_0x7c480e[_0x702f('0x28')]);_0x4787e3[_0x702f('0x2c')]=_[_0x702f('0x2a')](_0x7c480e['model'],qs[_0x702f('0x2d')](_0x5b935d[_0x702f('0x28')][_0x702f('0x2d')]));_0x4787e3[_0x702f('0x2c')]=_0x4787e3[_0x702f('0x2c')]['length']?_0x4787e3[_0x702f('0x2c')]:_0x7c480e[_0x702f('0x2b')];if(!_0x5b935d[_0x702f('0x28')]['hasOwnProperty'](_0x702f('0x2e'))){_0x4787e3[_0x702f('0x10')]=qs[_0x702f('0x10')](_0x5b935d[_0x702f('0x28')][_0x702f('0x10')]);_0x4787e3[_0x702f('0xd')]=qs[_0x702f('0xd')](_0x5b935d[_0x702f('0x28')][_0x702f('0xd')]);}_0x4787e3[_0x702f('0x2f')]=qs[_0x702f('0x30')](_0x5b935d['query']['sort']);_0x4787e3[_0x702f('0x31')]=qs[_0x702f('0x29')](_[_0x702f('0x32')](_0x5b935d[_0x702f('0x28')],_0x7c480e[_0x702f('0x29')]),_0x39d130);if(_0x5b935d[_0x702f('0x28')]['filter']){_0x4787e3[_0x702f('0x31')]=_[_0x702f('0x33')](_0x4787e3[_0x702f('0x31')],{'$or':_[_0x702f('0x19')](_0x39d130,function(_0x327cec){if(_0x327cec[_0x702f('0x1c')]!==_0x702f('0x34')){var _0x53959d={};_0x53959d[_0x327cec[_0x702f('0x1e')]]={'$like':'%'+_0x5b935d[_0x702f('0x28')][_0x702f('0x17')]+'%'};return _0x53959d;}})});}_0x4787e3=_[_0x702f('0x33')]({},_0x4787e3,_0x5b935d[_0x702f('0x35')]);var _0x2b2d4d={'where':_0x4787e3[_0x702f('0x31')]};return db['VoiceExtension']['count'](_0x2b2d4d)[_0x702f('0x21')](function(_0x2c071e){_0x62bc25['count']=_0x2c071e;if(_0x5b935d[_0x702f('0x28')][_0x702f('0x36')]){_0x4787e3['include']=[{'all':!![]}];}return db[_0x702f('0x37')][_0x702f('0x38')](_0x4787e3);})[_0x702f('0x21')](function(_0x4422ef){_0x62bc25[_0x702f('0x39')]=_0x4422ef;return _0x62bc25;})[_0x702f('0x21')](respondWithFilteredResult(_0x1e7258,_0x4787e3))[_0x702f('0x3a')](handleError(_0x1e7258,null));};exports[_0x702f('0x3b')]=function(_0x3c4a65,_0x31ef64){var _0xbfd3c9={'raw':![],'where':{'id':_0x3c4a65['params']['id']}},_0xbad7ce={};_0xbad7ce['model']=_[_0x702f('0x3c')](db[_0x702f('0x37')][_0x702f('0x25')]);_0xbad7ce[_0x702f('0x28')]=_[_0x702f('0x3c')](_0x3c4a65[_0x702f('0x28')]);_0xbad7ce[_0x702f('0x29')]=_[_0x702f('0x2a')](_0xbad7ce['model'],_0xbad7ce['query']);_0xbfd3c9[_0x702f('0x2c')]=_[_0x702f('0x2a')](_0xbad7ce[_0x702f('0x2b')],qs[_0x702f('0x2d')](_0x3c4a65['query'][_0x702f('0x2d')]));_0xbfd3c9['attributes']=_0xbfd3c9[_0x702f('0x2c')][_0x702f('0x3d')]?_0xbfd3c9['attributes']:_0xbad7ce['model'];if(_0x3c4a65[_0x702f('0x28')][_0x702f('0x36')]){_0xbfd3c9['include']=[{'all':!![]}];}_0xbfd3c9=_['merge']({},_0xbfd3c9,_0x3c4a65[_0x702f('0x35')]);return db[_0x702f('0x37')][_0x702f('0x1d')](_0xbfd3c9)[_0x702f('0x21')](handleEntityNotFound(_0x31ef64,null))[_0x702f('0x21')](respondWithResult(_0x31ef64,null))[_0x702f('0x3a')](handleError(_0x31ef64,null));};exports['destroy']=function(_0x5df06b,_0x2b24d0){return db[_0x702f('0x37')][_0x702f('0x1d')]({'where':{'id':_0x5df06b[_0x702f('0x3e')]['id']}})[_0x702f('0x21')](handleEntityNotFound(_0x2b24d0,null))[_0x702f('0x21')](removeEntity(_0x2b24d0,null))['catch'](handleError(_0x2b24d0,null));};exports[_0x702f('0x3f')]=function(_0x7dfbf1,_0x5bb781){if(_0x7dfbf1[_0x702f('0x40')]['type']==='outbound'&&!_['startsWith'](_0x7dfbf1[_0x702f('0x40')][_0x702f('0x41')],'_')){_0x7dfbf1['body'][_0x702f('0x41')]='_'['concat'](_0x7dfbf1[_0x702f('0x40')][_0x702f('0x41')]);}return db[_0x702f('0x37')][_0x702f('0x3f')](_0x7dfbf1[_0x702f('0x40')],{'raw':![]})[_0x702f('0x21')](function(_0x4236e2){var _0x261172=_0x7dfbf1[_0x702f('0x42')][_0x702f('0x43')]({'plain':!![]});if(!_0x261172)throw new Error(_0x702f('0x44'));if(_0x261172[_0x702f('0x45')]==='user'){var _0x468c63=_0x4236e2[_0x702f('0x43')]({'plain':!![]});var _0x11bdfa=[{'name':_0x702f('0x13'),'value':'inbound'},{'name':_0x702f('0x15'),'value':_0x702f('0x46')},{'name':_0x702f('0x16'),'value':_0x702f('0x47')}];var _0x3f1da0=_[_0x702f('0x1d')](_0x11bdfa,['value',_0x468c63[_0x702f('0x1c')]])[_0x702f('0x1e')];return db[_0x702f('0x48')][_0x702f('0x1d')]({'where':{'name':_0x3f1da0,'userProfileId':_0x261172['userProfileId']},'raw':!![]})[_0x702f('0x21')](function(_0x31483d){if(_0x31483d&&_0x31483d[_0x702f('0x49')]===0x0){return db['UserProfileResource'][_0x702f('0x3f')]({'name':_0x468c63[_0x702f('0x1e')],'resourceId':_0x468c63['id'],'type':_0x31483d[_0x702f('0x1e')],'sectionId':_0x31483d['id']},{})[_0x702f('0x21')](function(){return _0x4236e2;});}else{return _0x4236e2;}})[_0x702f('0x3a')](function(_0x5b7ccb){logger[_0x702f('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b7ccb);throw _0x5b7ccb;});}return _0x4236e2;})[_0x702f('0x21')](respondWithResult(_0x5bb781,0xc9))[_0x702f('0x3a')](handleError(_0x5bb781,null));};exports[_0x702f('0x4a')]=function(_0xee8e49,_0x42c2ac){if(_0xee8e49[_0x702f('0x40')]['id']){delete _0xee8e49[_0x702f('0x40')]['id'];}return db[_0x702f('0x37')][_0x702f('0x1d')]({'where':{'id':_0xee8e49[_0x702f('0x3e')]['id']}})['then'](handleEntityNotFound(_0x42c2ac,null))['then'](function(_0x1e7a50){if(_0x1e7a50){return db[_0x702f('0x37')][_0x702f('0x4a')](_[_0x702f('0x32')](_0xee8e49[_0x702f('0x40')],[_0x702f('0x41'),_0x702f('0x4b'),'description',_0x702f('0x4c'),_0x702f('0x4d'),_0x702f('0x4e'),_0x702f('0x4f')]),{'where':{'context':_0x1e7a50['context'],'exten':_0x1e7a50['exten']},'individualHooks':!![]})['then'](function(_0x23d1d3){return _0x23d1d3;});}return null;})[_0x702f('0x21')](respondWithStatusCode(_0x42c2ac,null))[_0x702f('0x3a')](handleError(_0x42c2ac,null));};exports['addApplications']=function(_0x4aa64c,_0x235787){return db[_0x702f('0x37')]['findOne']({'where':{'id':_0x4aa64c[_0x702f('0x3e')]['id']}})[_0x702f('0x21')](function(_0x38ce28){if(_0x38ce28){return db[_0x702f('0x50')]['transaction'](function(_0x8ee315){return db[_0x702f('0x37')][_0x702f('0x20')]({'where':{'VoiceExtensionId':_0x4aa64c[_0x702f('0x3e')]['id']},'transaction':_0x8ee315})['then'](function(){var _0x338804=_[_0x702f('0x19')](_0x4aa64c['body'],function(_0x3c57ed){_0x3c57ed[_0x702f('0x51')]=_0x4aa64c[_0x702f('0x3e')]['id'];_0x3c57ed[_0x702f('0x52')]=!![];return _0x3c57ed;});return _0x38ce28[_0x702f('0x53')](_0x338804);})[_0x702f('0x21')](function(_0x32e37b){console['log'](_0x702f('0x54'),_0x32e37b);return db['VoiceExtension'][_0x702f('0x55')](_0x32e37b,{'transaction':_0x8ee315});});})[_0x702f('0x21')](function(){return db[_0x702f('0x37')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x4aa64c[_0x702f('0x3e')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x702f('0x21')](respondWithResult(_0x235787,null))[_0x702f('0x3a')](handleError(_0x235787,null));}; \ No newline at end of file +var _0x05bf=['create','type','startsWith','body','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','internal','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','filter','ignore','map','value','includes','name','UserProfileResource','sendStatus','error','stack','send','index','VoiceExtension','rawAttributes','model','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','where','VIRTUAL','merge','include','show','keys','length','options','find','catch','params'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x05bf,0x77));var _0xf05b=function(_0x418a85,_0x5e0227){_0x418a85=_0x418a85-0x0;var _0x2a9190=_0x05bf[_0x418a85];return _0x2a9190;};'use strict';var _=require(_0xf05b('0x0'));var Redis=require(_0xf05b('0x1'));var qs=require(_0xf05b('0x2'));var logger=require(_0xf05b('0x3'))(_0xf05b('0x4'));var config=require(_0xf05b('0x5'));var db=require('../../mysqldb')['db'];config[_0xf05b('0x6')]=_[_0xf05b('0x7')](config[_0xf05b('0x6')],{'host':_0xf05b('0x8'),'port':0x18eb});var socket=require(_0xf05b('0x9'))(new Redis(config[_0xf05b('0x6')]));require(_0xf05b('0xa'))['register'](socket);function respondWithStatusCode(_0x3e4938,_0x50d2f8){_0x50d2f8=_0x50d2f8||0xcc;return function(_0x3be213){if(_0x3be213){return _0x3e4938['sendStatus'](_0x50d2f8);}return _0x3e4938[_0xf05b('0xb')](_0x50d2f8)[_0xf05b('0xc')]();};}function respondWithResult(_0x811024,_0x3b9fe6){_0x3b9fe6=_0x3b9fe6||0xc8;return function(_0x33681e){if(_0x33681e){return _0x811024[_0xf05b('0xb')](_0x3b9fe6)[_0xf05b('0xd')](_0x33681e);}};}function respondWithFilteredResult(_0xa91656,_0x19806a){return function(_0x3d9863){if(_0x3d9863){var _0x213786=typeof _0x19806a[_0xf05b('0xe')]===_0xf05b('0xf')&&typeof _0x19806a[_0xf05b('0x10')]===_0xf05b('0xf');var _0x3c60c4=_0x3d9863[_0xf05b('0x11')];var _0xbd5bee=_0x213786?0x0:_0x19806a[_0xf05b('0xe')];var _0xdc65c2=_0x213786?_0x3d9863[_0xf05b('0x11')]:_0x19806a['offset']+_0x19806a[_0xf05b('0x10')];var _0x36af2b;if(_0xdc65c2>=_0x3c60c4){_0xdc65c2=_0x3c60c4;_0x36af2b=0xc8;}else{_0x36af2b=0xce;}_0xa91656[_0xf05b('0xb')](_0x36af2b);return _0xa91656[_0xf05b('0x12')](_0xf05b('0x13'),_0xbd5bee+'-'+_0xdc65c2+'/'+_0x3c60c4)[_0xf05b('0xd')](_0x3d9863);}return null;};}function removeEntity(_0xbccaf8){return function(_0x18b9f8){if(_0x18b9f8){return _0x18b9f8[_0xf05b('0x14')]()[_0xf05b('0x15')](function(){var _0xd4aea6=_0x18b9f8['get']({'plain':!![]});var _0x26df38=[{'name':_0xf05b('0x16'),'value':_0xf05b('0x17'),'ignore':![]},{'name':_0xf05b('0x18'),'value':_0xf05b('0x19'),'ignore':![]},{'name':_0xf05b('0x1a'),'value':'internal','ignore':![]}];var _0x54a076=_(_0x26df38)[_0xf05b('0x1b')](_0xf05b('0x1c'))[_0xf05b('0x1d')](_0xf05b('0x1e'))[_0xf05b('0x1e')]();if(_[_0xf05b('0x1f')](_0x54a076,_0xd4aea6['type'])){return;}var _0x5dc23a=_['find'](_0x26df38,['value',_0xd4aea6['type']])[_0xf05b('0x20')];return db[_0xf05b('0x21')]['destroy']({'where':{'type':_0x5dc23a,'resourceId':_0xd4aea6['id']}})[_0xf05b('0x15')](function(){return _0x18b9f8;});})[_0xf05b('0x15')](function(){_0xbccaf8[_0xf05b('0xb')](0xcc)[_0xf05b('0xc')]();});}};}function handleEntityNotFound(_0x500c9a){return function(_0x391c53){if(!_0x391c53){_0x500c9a[_0xf05b('0x22')](0x194);}return _0x391c53;};}function handleError(_0x1d7764,_0x4c2670){_0x4c2670=_0x4c2670||0x1f4;return function(_0x4c3d6f){logger[_0xf05b('0x23')](_0x4c3d6f[_0xf05b('0x24')]);if(_0x4c3d6f[_0xf05b('0x20')]){delete _0x4c3d6f[_0xf05b('0x20')];}_0x1d7764[_0xf05b('0xb')](_0x4c2670)[_0xf05b('0x25')](_0x4c3d6f);};}exports[_0xf05b('0x26')]=function(_0xa1a7f3,_0x5789df){var _0xdf29a6={},_0x3f69ec={},_0x2e4634={'count':0x0,'rows':[]};var _0x2df261=_['map'](db[_0xf05b('0x27')][_0xf05b('0x28')],function(_0x5c152f){return{'name':_0x5c152f['fieldName'],'type':_0x5c152f['type']['key']};});_0x3f69ec[_0xf05b('0x29')]=_[_0xf05b('0x1d')](_0x2df261,_0xf05b('0x20'));_0x3f69ec[_0xf05b('0x2a')]=_['keys'](_0xa1a7f3[_0xf05b('0x2a')]);_0x3f69ec['filters']=_[_0xf05b('0x2b')](_0x3f69ec['model'],_0x3f69ec[_0xf05b('0x2a')]);_0xdf29a6[_0xf05b('0x2c')]=_[_0xf05b('0x2b')](_0x3f69ec[_0xf05b('0x29')],qs['fields'](_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0x2d')]));_0xdf29a6[_0xf05b('0x2c')]=_0xdf29a6[_0xf05b('0x2c')]['length']?_0xdf29a6[_0xf05b('0x2c')]:_0x3f69ec[_0xf05b('0x29')];if(!_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0x2e')]('nolimit')){_0xdf29a6[_0xf05b('0x10')]=qs[_0xf05b('0x10')](_0xa1a7f3['query'][_0xf05b('0x10')]);_0xdf29a6[_0xf05b('0xe')]=qs[_0xf05b('0xe')](_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0xe')]);}_0xdf29a6[_0xf05b('0x2f')]=qs[_0xf05b('0x30')](_0xa1a7f3[_0xf05b('0x2a')]['sort']);_0xdf29a6['where']=qs[_0xf05b('0x31')](_['pick'](_0xa1a7f3[_0xf05b('0x2a')],_0x3f69ec[_0xf05b('0x31')]),_0x2df261);if(_0xa1a7f3['query']['filter']){_0xdf29a6[_0xf05b('0x32')]=_['merge'](_0xdf29a6[_0xf05b('0x32')],{'$or':_[_0xf05b('0x1d')](_0x2df261,function(_0x2e8fee){if(_0x2e8fee['type']!==_0xf05b('0x33')){var _0x3ecf4c={};_0x3ecf4c[_0x2e8fee[_0xf05b('0x20')]]={'$like':'%'+_0xa1a7f3[_0xf05b('0x2a')][_0xf05b('0x1b')]+'%'};return _0x3ecf4c;}})});}_0xdf29a6=_[_0xf05b('0x34')]({},_0xdf29a6,_0xa1a7f3['options']);var _0x109ee3={'where':_0xdf29a6[_0xf05b('0x32')]};return db[_0xf05b('0x27')][_0xf05b('0x11')](_0x109ee3)[_0xf05b('0x15')](function(_0x37af26){_0x2e4634[_0xf05b('0x11')]=_0x37af26;if(_0xa1a7f3[_0xf05b('0x2a')]['includeAll']){_0xdf29a6[_0xf05b('0x35')]=[{'all':!![]}];}return db[_0xf05b('0x27')]['findAll'](_0xdf29a6);})['then'](function(_0x5eb7cc){_0x2e4634['rows']=_0x5eb7cc;return _0x2e4634;})['then'](respondWithFilteredResult(_0x5789df,_0xdf29a6))['catch'](handleError(_0x5789df,null));};exports[_0xf05b('0x36')]=function(_0x2cc263,_0x47e326){var _0x589def={'raw':![],'where':{'id':_0x2cc263['params']['id']}},_0x408d1d={};_0x408d1d['model']=_[_0xf05b('0x37')](db[_0xf05b('0x27')][_0xf05b('0x28')]);_0x408d1d[_0xf05b('0x2a')]=_[_0xf05b('0x37')](_0x2cc263[_0xf05b('0x2a')]);_0x408d1d[_0xf05b('0x31')]=_[_0xf05b('0x2b')](_0x408d1d['model'],_0x408d1d[_0xf05b('0x2a')]);_0x589def['attributes']=_['intersection'](_0x408d1d[_0xf05b('0x29')],qs[_0xf05b('0x2d')](_0x2cc263[_0xf05b('0x2a')][_0xf05b('0x2d')]));_0x589def['attributes']=_0x589def['attributes'][_0xf05b('0x38')]?_0x589def[_0xf05b('0x2c')]:_0x408d1d['model'];if(_0x2cc263[_0xf05b('0x2a')]['includeAll']){_0x589def[_0xf05b('0x35')]=[{'all':!![]}];}_0x589def=_[_0xf05b('0x34')]({},_0x589def,_0x2cc263[_0xf05b('0x39')]);return db[_0xf05b('0x27')][_0xf05b('0x3a')](_0x589def)[_0xf05b('0x15')](handleEntityNotFound(_0x47e326,null))[_0xf05b('0x15')](respondWithResult(_0x47e326,null))[_0xf05b('0x3b')](handleError(_0x47e326,null));};exports['destroy']=function(_0x41ba35,_0x3361a6){return db[_0xf05b('0x27')][_0xf05b('0x3a')]({'where':{'id':_0x41ba35[_0xf05b('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3361a6,null))[_0xf05b('0x15')](removeEntity(_0x3361a6,null))[_0xf05b('0x3b')](handleError(_0x3361a6,null));};exports[_0xf05b('0x3d')]=function(_0x1d09f5,_0x71f9f7){if(_0x1d09f5['body'][_0xf05b('0x3e')]===_0xf05b('0x19')&&!_[_0xf05b('0x3f')](_0x1d09f5[_0xf05b('0x40')][_0xf05b('0x41')],'_')){_0x1d09f5[_0xf05b('0x40')][_0xf05b('0x41')]='_'[_0xf05b('0x42')](_0x1d09f5[_0xf05b('0x40')][_0xf05b('0x41')]);}return db[_0xf05b('0x27')]['create'](_0x1d09f5[_0xf05b('0x40')],{'raw':![]})[_0xf05b('0x15')](function(_0x369e89){var _0x5a2cac=_0x1d09f5['user'][_0xf05b('0x43')]({'plain':!![]});if(!_0x5a2cac)throw new Error(_0xf05b('0x44'));if(_0x5a2cac[_0xf05b('0x45')]==='user'){var _0x406767=_0x369e89[_0xf05b('0x43')]({'plain':!![]});var _0x14ca0e=[{'name':_0xf05b('0x16'),'value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':_0xf05b('0x1a'),'value':_0xf05b('0x46')}];var _0x4f073e=_[_0xf05b('0x3a')](_0x14ca0e,[_0xf05b('0x1e'),_0x406767[_0xf05b('0x3e')]])['name'];return db[_0xf05b('0x47')]['find']({'where':{'name':_0x4f073e,'userProfileId':_0x5a2cac[_0xf05b('0x48')]},'raw':!![]})[_0xf05b('0x15')](function(_0x508e06){if(_0x508e06&&_0x508e06[_0xf05b('0x49')]===0x0){return db[_0xf05b('0x21')][_0xf05b('0x3d')]({'name':_0x406767[_0xf05b('0x20')],'resourceId':_0x406767['id'],'type':_0x508e06[_0xf05b('0x20')],'sectionId':_0x508e06['id']},{})['then'](function(){return _0x369e89;});}else{return _0x369e89;}})[_0xf05b('0x3b')](function(_0x496029){logger[_0xf05b('0x23')](_0xf05b('0x4a'),_0x496029);throw _0x496029;});}return _0x369e89;})['then'](respondWithResult(_0x71f9f7,0xc9))[_0xf05b('0x3b')](handleError(_0x71f9f7,null));};exports['update']=function(_0x32c929,_0x3ad2b4){if(_0x32c929[_0xf05b('0x40')]['id']){delete _0x32c929[_0xf05b('0x40')]['id'];}return db[_0xf05b('0x27')][_0xf05b('0x3a')]({'where':{'id':_0x32c929[_0xf05b('0x3c')]['id']}})[_0xf05b('0x15')](handleEntityNotFound(_0x3ad2b4,null))['then'](function(_0xf8ea8e){if(_0xf8ea8e){return db[_0xf05b('0x27')]['update'](_['pick'](_0x32c929[_0xf05b('0x40')],[_0xf05b('0x41'),'context',_0xf05b('0x4b'),_0xf05b('0x4c'),_0xf05b('0x4d'),_0xf05b('0x4e'),_0xf05b('0x4f')]),{'where':{'context':_0xf8ea8e[_0xf05b('0x50')],'exten':_0xf8ea8e[_0xf05b('0x41')]},'individualHooks':!![]})[_0xf05b('0x15')](function(_0x511d28){return _0x511d28;});}return null;})[_0xf05b('0x15')](respondWithStatusCode(_0x3ad2b4,null))['catch'](handleError(_0x3ad2b4,null));};exports[_0xf05b('0x51')]=function(_0x15023f,_0xb62737){return db[_0xf05b('0x27')][_0xf05b('0x52')]({'where':{'id':_0x15023f['params']['id']}})[_0xf05b('0x15')](function(_0x36827d){if(_0x36827d){return db[_0xf05b('0x53')][_0xf05b('0x54')](function(_0x54bbb1){return db[_0xf05b('0x27')][_0xf05b('0x14')]({'where':{'VoiceExtensionId':_0x15023f[_0xf05b('0x3c')]['id']},'transaction':_0x54bbb1})['then'](function(){var _0x19ea95=_['map'](_0x15023f[_0xf05b('0x40')],function(_0x43a0ed){_0x43a0ed[_0xf05b('0x55')]=_0x15023f['params']['id'];_0x43a0ed[_0xf05b('0x56')]=!![];return _0x43a0ed;});return _0x36827d[_0xf05b('0x57')](_0x19ea95);})[_0xf05b('0x15')](function(_0x2c0b44){console['log']('LOG\x20~\x20.then\x20~\x20routing',_0x2c0b44);return db[_0xf05b('0x27')]['bulkCreate'](_0x2c0b44,{'transaction':_0x54bbb1});});})[_0xf05b('0x15')](function(){return db['VoiceExtension'][_0xf05b('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x15023f[_0xf05b('0x3c')]['id']},'order':_0xf05b('0x59')});});}})[_0xf05b('0x15')](respondWithResult(_0xb62737,null))[_0xf05b('0x3b')](handleError(_0xb62737,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 90a43f5..57578e7 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 _0x0aaf=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0aaf,0x9d));var _0xf0aa=function(_0x1c4831,_0x3ff74a){_0x1c4831=_0x1c4831-0x0;var _0x1e6a6d=_0x0aaf[_0x1c4831];return _0x1e6a6d;};'use strict';var EventEmitter=require(_0xf0aa('0x0'));var VoiceExtension=require(_0xf0aa('0x1'))['db'][_0xf0aa('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xf0aa('0x3')](0x0);var events={'afterCreate':_0xf0aa('0x4'),'afterUpdate':_0xf0aa('0x5'),'afterDestroy':_0xf0aa('0x6')};function emitEvent(_0x9e03be){return function(_0x281996,_0x4bb3e4,_0x47fdd5){VoiceExtensionEvents[_0xf0aa('0x7')](_0x9e03be+':'+_0x281996['id'],_0x281996);VoiceExtensionEvents[_0xf0aa('0x7')](_0x9e03be,_0x281996);_0x47fdd5(null);};}for(var e in events){if(events[_0xf0aa('0x8')](e)){var event=events[e];VoiceExtension[_0xf0aa('0x9')](e,emitEvent(event));}}module[_0xf0aa('0xa')]=VoiceExtensionEvents; \ No newline at end of file +var _0x69e5=['hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x4ef2b1,_0x31fffa){var _0xec4cf8=function(_0x4b34c8){while(--_0x4b34c8){_0x4ef2b1['push'](_0x4ef2b1['shift']());}};_0xec4cf8(++_0x31fffa);}(_0x69e5,0x9b));var _0x569e=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x69e5[_0x231dda];return _0x3f88cb;};'use strict';var EventEmitter=require(_0x569e('0x0'));var VoiceExtension=require(_0x569e('0x1'))['db'][_0x569e('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x569e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x569e('0x4')};function emitEvent(_0x5e0416){return function(_0x49165a,_0x35815c,_0x3ef89b){VoiceExtensionEvents[_0x569e('0x5')](_0x5e0416+':'+_0x49165a['id'],_0x49165a);VoiceExtensionEvents[_0x569e('0x5')](_0x5e0416,_0x49165a);_0x3ef89b(null);};}for(var e in events){if(events[_0x569e('0x6')](e)){var event=events[e];VoiceExtension[_0x569e('0x7')](e,emitEvent(event));}}module[_0x569e('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 2cfa5ba..bce68ed 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 _0x7c1f=['exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','context','push','inbound','CDR(routeid)=','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','${EXTEN:','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','url','split','length','name','param','phone','prefix','${EXTEN}','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','custom','answer','ExecIf','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','concat','priority','catch','define','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports','type','Set','CDR(type)='];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x7c1f,0x194));var _0xf7c1=function(_0x40515a,_0x2a7e44){_0x40515a=_0x40515a-0x0;var _0x5ee232=_0x7c1f[_0x40515a];return _0x5ee232;};'use strict';var _=require(_0xf7c1('0x0'));var attributes=require(_0xf7c1('0x1'));module[_0xf7c1('0x2')]=function(_0x4c0c8e){var _0x3ca7b6=_0x4c0c8e['models'];function _0x1e3254(_0x13f6da){var _0x18f5a9=0x2;var _0x485d8d=[{'type':_0x13f6da[_0xf7c1('0x3')],'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x5')+_0x13f6da[_0xf7c1('0x3')],'context':_0x13f6da['context'],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']},{'type':_0x13f6da[_0xf7c1('0x3')],'app':_0x13f6da[_0xf7c1('0x7')]?_0xf7c1('0x4'):_0xf7c1('0x8'),'appdata':_0x13f6da[_0xf7c1('0x7')]?_0xf7c1('0x9')+_0x13f6da[_0xf7c1('0x7')]:_0xf7c1('0xa'),'context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']}];if(_0x13f6da[_0xf7c1('0x3')]==='inbound'){_0x485d8d[_0xf7c1('0xc')]({'type':_0xf7c1('0xd'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xe')+_0x13f6da['id'],'context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']});}_0x485d8d['push']({'type':_0x13f6da['type'],'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']},{'type':_0x13f6da['type'],'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x13f6da[_0xf7c1('0xb')],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']},{'type':_0x13f6da[_0xf7c1('0x3')],'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xf'),'context':_0x13f6da['context'],'exten':_0x13f6da[_0xf7c1('0x6')],'priority':_0x18f5a9++,'VoiceExtensionId':_0x13f6da['id']});return _0x485d8d;}function _0x5b5786(_0x298d23){var _0x4f0a0a=0x2;var _0x115010=[{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x11'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0x298d23[_0xf7c1('0x7')]?'Set':'NoOp','appdata':_0x298d23[_0xf7c1('0x7')]?_0xf7c1('0x9')+_0x298d23['alias']:_0xf7c1('0xa'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23['exten'],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':'Set','appdata':'CDR(destination)='+(_0x298d23['cutdigits']?_0xf7c1('0x12')+_0x298d23[_0xf7c1('0x13')]+'}':'${EXTEN}'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xe')+_0x298d23['id'],'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4f0a0a+0x2)+'):Goto('+(_0x4f0a0a+0x1)+')','context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0x298d23[_0xf7c1('0x13')]?_0xf7c1('0x14')+_0x298d23[_0xf7c1('0x13')]+'}':_0xf7c1('0x15'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23['exten'],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x16'),'context':_0x298d23['context'],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':'outbound','app':_0xf7c1('0x4'),'appdata':_0xf7c1('0xf'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23['exten'],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':'outboundrouteid='+_0x298d23['id'],'context':_0x298d23['context'],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']}];if(_0x298d23[_0xf7c1('0x17')](_0xf7c1('0x18'))&&_0x298d23[_0xf7c1('0x18')]!==_0xf7c1('0x19')){_0x115010['push']({'type':_0xf7c1('0x10'),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x1a'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']},{'type':'outbound','app':'Set','appdata':_0xf7c1('0x1b')+_0x298d23[_0xf7c1('0x18')]||_0xf7c1('0x1c'),'context':_0x298d23[_0xf7c1('0xb')],'exten':_0x298d23[_0xf7c1('0x6')],'priority':_0x4f0a0a++,'VoiceExtensionId':_0x298d23['id']});}return _0x115010;}function _0x4a3832(_0x4b0798,_0x17a667){var _0x122e85=[{'name':_0xf7c1('0x1d'),'param':0x0},{'name':_0xf7c1('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0xf7c1('0x1f'),'param':0x3}];var _0x5af7e1={};var _0x1ccb88=_0x17a667[_0xf7c1('0x20')](',');var _0x1f2141=[];for(var _0x1341ae=0x0;_0x1341ae<_0x122e85[_0xf7c1('0x21')];_0x1341ae++){switch(_0x122e85[_0x1341ae][_0xf7c1('0x22')]){case _0xf7c1('0x1d'):_0x5af7e1['trunk']=_0x1ccb88[_0x122e85[_0x1341ae]['param']][_0xf7c1('0x20')]('/')[0x1];_0x5af7e1['phone']=_0x1ccb88[_0x122e85[_0x1341ae][_0xf7c1('0x23')]][_0xf7c1('0x20')]('/')[0x2];_0x5af7e1['prefix']=_0x5af7e1[_0xf7c1('0x24')]?_0x5af7e1['phone']['split']('$')[0x0]:undefined;_0x5af7e1[_0xf7c1('0x24')]=_0x4b0798[_0xf7c1('0x13')]?(_0x5af7e1[_0xf7c1('0x25')]||'')+_0xf7c1('0x12')+_0x4b0798['cutdigits']+'}':(_0x5af7e1['prefix']||'')+_0xf7c1('0x26');_0x1f2141[_0x122e85[_0x1341ae][_0xf7c1('0x23')]]=[_0xf7c1('0x27'),_0x5af7e1[_0xf7c1('0x1d')],_0x5af7e1[_0xf7c1('0x24')]][_0xf7c1('0x28')]('/');break;case'options':_0x5af7e1[_0xf7c1('0x29')]=_0x1ccb88[_0x122e85[_0x1341ae][_0xf7c1('0x23')]];if(_0x4b0798['recordingFormat']!=='none'){if(_0x5af7e1[_0xf7c1('0x29')][_0xf7c1('0x2a')](_0xf7c1('0x2b'))<0x0){_0x5af7e1[_0xf7c1('0x29')]+=_0xf7c1('0x2b');}}else{_0x5af7e1['options']=_0x5af7e1['options']['replace'](_0xf7c1('0x2b'),'');}_0x1f2141[_0x122e85[_0x1341ae]['param']]=_0x5af7e1[_0xf7c1('0x29')];break;default:_0x1f2141[_0x122e85[_0x1341ae][_0xf7c1('0x23')]]=_0x1ccb88[_0x122e85[_0x1341ae][_0xf7c1('0x23')]];}}return _0x1f2141[_0xf7c1('0x28')](',');}function _0x8b5861(_0x521306,_0x1b748a,_0x525db2){return new Promise(function(_0x508678,_0x3fea80){var _0x55d495=[];if(_['isEmpty'](_0x1b748a))return _0x508678(_0x55d495);_0x3ca7b6[_0xf7c1('0x2c')][_0xf7c1('0x2d')]({'attributes':['id',_0xf7c1('0x2e'),_0xf7c1('0x2f')],'raw':!![]})[_0xf7c1('0x30')](function(_0x5299a8){for(var _0x2d928d=0x0,_0x95051a=0x0;_0x2d928d<_0x1b748a[_0xf7c1('0x21')];_0x2d928d++,_0x95051a=0x0){var _0x597813=_0x1b748a[_0x2d928d];var _0xcfa402=[];var _0x241f37=[];delete _0x597813['id'];if(_0x597813[_0xf7c1('0x2e')]!==_0xf7c1('0x31')){_0x597813[_0xf7c1('0x32')]=[_0x597813['interval']];}else{_0x597813[_0xf7c1('0x32')]=_0x597813[_0xf7c1('0x2f')]?_[_0xf7c1('0x33')](_[_0xf7c1('0x34')](_0x5299a8,{'IntervalId':_0x597813['IntervalId']}),_0xf7c1('0x2e')):[];}_0x597813[_0xf7c1('0xb')]=_0x521306[_0xf7c1('0xb')];_0x597813['exten']=_0x521306[_0xf7c1('0x6')];if(_0x597813[_0xf7c1('0x3')])_0x597813[_0xf7c1('0x3')]=_0x597813['type'][_0xf7c1('0x35')]();if(_0x521306[_0xf7c1('0x3')]===_0xf7c1('0x10')){if(_0x597813['hasOwnProperty'](_0xf7c1('0x36'))&&_0x597813['tag']&&_0x597813[_0xf7c1('0x36')]!=='--'){_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813['type']['toLowerCase'](),'app':_0xf7c1('0x4'),'appdata':'CDR(tag)='+_0x597813['tag'],'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306['exten'],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':'ExecIf','appdata':_0xf7c1('0x37')+(_0x597813['callerID']?_0xf7c1('0x38')+_0x597813['callerID']+')':_0xf7c1('0x39')),'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}else{if(_0x597813['hasOwnProperty']('answer')){if([_0xf7c1('0x3a'),_0xf7c1('0x3b')][_0xf7c1('0x3c')](_0x597813[_0xf7c1('0x3d')][_0xf7c1('0x35')]())&&_0x597813[_0xf7c1('0x3e')]!==_0xf7c1('0x3f')){if(_0x597813[_0xf7c1('0x40')]){_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':_0xf7c1('0x41'),'appdata':_0xf7c1('0x42'),'context':_0x521306['context'],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')]['toLowerCase'](),'app':_0xf7c1('0x4'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813['intervals'][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}else{_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':_0xf7c1('0x41'),'appdata':_0xf7c1('0x43'),'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});_0xcfa402[_0xf7c1('0xc')]({'type':_0x597813[_0xf7c1('0x3')][_0xf7c1('0x35')](),'app':_0xf7c1('0x4'),'appdata':_0xf7c1('0x44'),'context':_0x521306[_0xf7c1('0xb')],'exten':_0x521306[_0xf7c1('0x6')],'priority':_0x597813['intervals'][_0xf7c1('0x21')]+_0x525db2+_0x95051a++,'VoiceExtensionId':_0x521306['id']});}}}}for(var _0x15c974=0x0;_0x15c974<_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')];_0x15c974++){var _0x3aefa1=_0x525db2+_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')];var _0x5a68aa=_0x15c974===_0x597813[_0xf7c1('0x32')][_0xf7c1('0x21')]-0x1?_0x525db2+_0xcfa402['length']+_0x241f37[_0xf7c1('0x21')]+0x2:_0x525db2+_0x15c974+0x1;_0xcfa402[_0xf7c1('0x45')](_0x15c974,0x0,{'type':_0x521306[_0xf7c1('0x3')],'app':_0xf7c1('0x46'),'appdata':_0x597813[_0xf7c1('0x32')][_0x15c974]+'?'+_0x521306[_0xf7c1('0xb')]+_0xf7c1('0x47')+_0x3aefa1+':'+_0x521306[_0xf7c1('0xb')]+_0xf7c1('0x47')+_0x5a68aa,'exten':_0x521306[_0xf7c1('0x6')],'context':_0x521306[_0xf7c1('0xb')],'priority':_0x525db2+_0x15c974,'VoiceExtensionId':_0x521306['id']});}if(_0x597813['appType']===_0xf7c1('0x48'))_0x597813['appdata']=_0x4a3832(_0x521306,_0x597813[_0xf7c1('0x49')]);_0x597813['priority']=_0xcfa402[_0xf7c1('0x21')]?_[_0xf7c1('0x4a')](_0xcfa402)['priority']+0x1:_0x525db2;_0x55d495=_[_0xf7c1('0x4b')](_0x55d495,_0xcfa402,[_0x597813],_0x241f37);_0x525db2=_['last'](_0x55d495)[_0xf7c1('0x4c')]+0x1;}return _0x508678(_0x55d495);})[_0xf7c1('0x4d')](function(_0x206cc1){_0x3fea80(_0x206cc1);});});}return _0x4c0c8e[_0xf7c1('0x4e')]('VoiceExtension',attributes,{'tableName':_0xf7c1('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x291175){var _0x437778=this[_0xf7c1('0x50')]({'plain':!![]});var _0x5358d4=_0x437778[_0xf7c1('0x3')]===_0xf7c1('0x10')?_0x5b5786(_0x437778):_0x1e3254(_0x437778);return _0x8b5861(_0x437778,_0x291175,_[_0xf7c1('0x4a')](_0x5358d4)[_0xf7c1('0x4c')]+0x1)[_0xf7c1('0x30')](function(_0x8db781){var _0x35b0b6=_['concat'](_0x5358d4,_0x8db781);_0x35b0b6[_0xf7c1('0xc')]({'type':_0x437778[_0xf7c1('0x3')],'app':_0xf7c1('0x51'),'exten':_0x437778[_0xf7c1('0x6')],'context':_0x437778[_0xf7c1('0xb')],'priority':_[_0xf7c1('0x4a')](_0x35b0b6)['priority']+0x1,'VoiceExtensionId':_0x437778['id']});return _0x35b0b6;});}}});}; \ No newline at end of file +var _0x2e63=['replace','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','hasOwnProperty','answer','queue','playback','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','concat','last','define','get','Hangup','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','No\x20alias\x20set','push','inbound','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','options','split','length','name','param','phone','prefix','join','U(xcally-mixmonitor-context)'];(function(_0x2b76f4,_0x520109){var _0x31546a=function(_0x30fad8){while(--_0x30fad8){_0x2b76f4['push'](_0x2b76f4['shift']());}};_0x31546a(++_0x520109);}(_0x2e63,0x14d));var _0x32e6=function(_0x5ccdd5,_0x137596){_0x5ccdd5=_0x5ccdd5-0x0;var _0x2bb303=_0x2e63[_0x5ccdd5];return _0x2bb303;};'use strict';var _=require('lodash');var attributes=require(_0x32e6('0x0'));module[_0x32e6('0x1')]=function(_0x359d55){var _0x1722f1=_0x359d55[_0x32e6('0x2')];function _0x477974(_0x434065){var _0x48714b=0x2;var _0x1866ff=[{'type':_0x434065[_0x32e6('0x3')],'app':_0x32e6('0x4'),'appdata':_0x32e6('0x5')+_0x434065[_0x32e6('0x3')],'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']},{'type':_0x434065[_0x32e6('0x3')],'app':_0x434065[_0x32e6('0x8')]?_0x32e6('0x4'):_0x32e6('0x9'),'appdata':_0x434065[_0x32e6('0x8')]?'CDR(routeAlias)='+_0x434065[_0x32e6('0x8')]:_0x32e6('0xa'),'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']}];if(_0x434065[_0x32e6('0x3')]==='inbound'){_0x1866ff[_0x32e6('0xb')]({'type':_0x32e6('0xc'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0xd')+_0x434065['id'],'context':_0x434065['context'],'exten':_0x434065['exten'],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']});}_0x1866ff[_0x32e6('0xb')]({'type':_0x434065['type'],'app':_0x32e6('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']},{'type':_0x434065[_0x32e6('0x3')],'app':_0x32e6('0x4'),'appdata':_0x32e6('0xe'),'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']},{'type':_0x434065[_0x32e6('0x3')],'app':_0x32e6('0x4'),'appdata':_0x32e6('0xf'),'context':_0x434065[_0x32e6('0x6')],'exten':_0x434065[_0x32e6('0x7')],'priority':_0x48714b++,'VoiceExtensionId':_0x434065['id']});return _0x1866ff;}function _0x353be7(_0x55e47f){var _0x25264d=0x2;var _0x45a344=[{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x11'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x55e47f[_0x32e6('0x8')]?_0x32e6('0x4'):_0x32e6('0x9'),'appdata':_0x55e47f[_0x32e6('0x8')]?_0x32e6('0x12')+_0x55e47f[_0x32e6('0x8')]:_0x32e6('0xa'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':'Set','appdata':'CDR(destination)='+(_0x55e47f['cutdigits']?'${EXTEN:'+_0x55e47f[_0x32e6('0x13')]+'}':_0x32e6('0x14')),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0xd')+_0x55e47f['id'],'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x15'),'appdata':_0x32e6('0x16')+(_0x25264d+0x2)+_0x32e6('0x17')+(_0x25264d+0x1)+')','context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x55e47f[_0x32e6('0x13')]?_0x32e6('0x18')+_0x55e47f[_0x32e6('0x13')]+'}':_0x32e6('0x19'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x1a'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':'outbound','app':_0x32e6('0x4'),'appdata':_0x32e6('0xe'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':'outbound','app':_0x32e6('0x4'),'appdata':_0x32e6('0xf'),'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':'outbound','app':_0x32e6('0x4'),'appdata':_0x32e6('0x1b')+_0x55e47f['id'],'context':_0x55e47f[_0x32e6('0x6')],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']}];if(_0x55e47f['hasOwnProperty'](_0x32e6('0x1c'))&&_0x55e47f['recordingFormat']!==_0x32e6('0x1d')){_0x45a344['push']({'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x1e'),'context':_0x55e47f['context'],'exten':_0x55e47f[_0x32e6('0x7')],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']},{'type':_0x32e6('0x10'),'app':_0x32e6('0x4'),'appdata':_0x32e6('0x1f')+_0x55e47f[_0x32e6('0x1c')]||'wav','context':_0x55e47f['context'],'exten':_0x55e47f['exten'],'priority':_0x25264d++,'VoiceExtensionId':_0x55e47f['id']});}return _0x45a344;}function _0x5c483e(_0x28751c,_0x35d2e4){var _0x341e1f=[{'name':_0x32e6('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x32e6('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x43ac97={};var _0x184479=_0x35d2e4[_0x32e6('0x22')](',');var _0x50307e=[];for(var _0x42f928=0x0;_0x42f928<_0x341e1f[_0x32e6('0x23')];_0x42f928++){switch(_0x341e1f[_0x42f928][_0x32e6('0x24')]){case _0x32e6('0x20'):_0x43ac97[_0x32e6('0x20')]=_0x184479[_0x341e1f[_0x42f928][_0x32e6('0x25')]]['split']('/')[0x1];_0x43ac97[_0x32e6('0x26')]=_0x184479[_0x341e1f[_0x42f928][_0x32e6('0x25')]][_0x32e6('0x22')]('/')[0x2];_0x43ac97[_0x32e6('0x27')]=_0x43ac97['phone']?_0x43ac97['phone']['split']('$')[0x0]:undefined;_0x43ac97['phone']=_0x28751c['cutdigits']?(_0x43ac97[_0x32e6('0x27')]||'')+'${EXTEN:'+_0x28751c[_0x32e6('0x13')]+'}':(_0x43ac97[_0x32e6('0x27')]||'')+'${EXTEN}';_0x50307e[_0x341e1f[_0x42f928]['param']]=['SIP',_0x43ac97[_0x32e6('0x20')],_0x43ac97['phone']][_0x32e6('0x28')]('/');break;case'options':_0x43ac97[_0x32e6('0x21')]=_0x184479[_0x341e1f[_0x42f928]['param']];if(_0x28751c[_0x32e6('0x1c')]!==_0x32e6('0x1d')){if(_0x43ac97[_0x32e6('0x21')]['indexOf'](_0x32e6('0x29'))<0x0){_0x43ac97['options']+='U(xcally-mixmonitor-context)';}}else{_0x43ac97['options']=_0x43ac97[_0x32e6('0x21')][_0x32e6('0x2a')](_0x32e6('0x29'),'');}_0x50307e[_0x341e1f[_0x42f928][_0x32e6('0x25')]]=_0x43ac97[_0x32e6('0x21')];break;default:_0x50307e[_0x341e1f[_0x42f928][_0x32e6('0x25')]]=_0x184479[_0x341e1f[_0x42f928][_0x32e6('0x25')]];}}return _0x50307e['join'](',');}function _0x5e2ac3(_0x117acf,_0x93dbcb,_0x20d43a){return new Promise(function(_0x13b5d1,_0x2d47c4){var _0x43f391=[];if(_['isEmpty'](_0x93dbcb))return _0x13b5d1(_0x43f391);_0x1722f1[_0x32e6('0x2b')][_0x32e6('0x2c')]({'attributes':['id',_0x32e6('0x2d'),_0x32e6('0x2e')],'raw':!![]})[_0x32e6('0x2f')](function(_0x5d3927){for(var _0x445637=0x0,_0x37725e=0x0;_0x445637<_0x93dbcb[_0x32e6('0x23')];_0x445637++,_0x37725e=0x0){var _0x5eaf5e=_0x93dbcb[_0x445637];var _0x563db8=[];var _0x3d6a3a=[];delete _0x5eaf5e['id'];if(_0x5eaf5e[_0x32e6('0x2d')]!==_0x32e6('0x30')){_0x5eaf5e[_0x32e6('0x31')]=[_0x5eaf5e['interval']];}else{_0x5eaf5e[_0x32e6('0x31')]=_0x5eaf5e[_0x32e6('0x2e')]?_[_0x32e6('0x32')](_[_0x32e6('0x33')](_0x5d3927,{'IntervalId':_0x5eaf5e['IntervalId']}),_0x32e6('0x2d')):[];}_0x5eaf5e['context']=_0x117acf[_0x32e6('0x6')];_0x5eaf5e[_0x32e6('0x7')]=_0x117acf[_0x32e6('0x7')];if(_0x5eaf5e[_0x32e6('0x3')])_0x5eaf5e[_0x32e6('0x3')]=_0x5eaf5e['type'][_0x32e6('0x34')]();if(_0x117acf[_0x32e6('0x3')]===_0x32e6('0x10')){if(_0x5eaf5e['hasOwnProperty'](_0x32e6('0x35'))&&_0x5eaf5e[_0x32e6('0x35')]&&_0x5eaf5e[_0x32e6('0x35')]!=='--'){_0x563db8[_0x32e6('0xb')]({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':_0x32e6('0x4'),'appdata':'CDR(tag)='+_0x5eaf5e[_0x32e6('0x35')],'context':_0x117acf[_0x32e6('0x6')],'exten':_0x117acf['exten'],'priority':_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}_0x563db8['push']({'type':_0x5eaf5e['type'][_0x32e6('0x34')](),'app':_0x32e6('0x15'),'appdata':_0x32e6('0x36')+(_0x5eaf5e[_0x32e6('0x37')]?'Set(CALLERID(all)='+_0x5eaf5e[_0x32e6('0x37')]+')':_0x32e6('0x38')),'context':_0x117acf['context'],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}else{if(_0x5eaf5e[_0x32e6('0x39')](_0x32e6('0x3a'))){if([_0x32e6('0x3b'),_0x32e6('0x3c')]['includes'](_0x5eaf5e['app'][_0x32e6('0x34')]())&&_0x5eaf5e['appType']!==_0x32e6('0x3d')){if(_0x5eaf5e[_0x32e6('0x3a')]){_0x563db8['push']({'type':_0x5eaf5e[_0x32e6('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0x32e6('0x3e'),'context':_0x117acf['context'],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});_0x563db8[_0x32e6('0xb')]({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':'Set','appdata':_0x32e6('0x3f'),'context':_0x117acf[_0x32e6('0x6')],'exten':_0x117acf['exten'],'priority':_0x5eaf5e['intervals'][_0x32e6('0x23')]+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}else{_0x563db8['push']({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':_0x32e6('0x15'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x117acf['context'],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')]['length']+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});_0x563db8['push']({'type':_0x5eaf5e[_0x32e6('0x3')][_0x32e6('0x34')](),'app':_0x32e6('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x117acf[_0x32e6('0x6')],'exten':_0x117acf[_0x32e6('0x7')],'priority':_0x5eaf5e[_0x32e6('0x31')]['length']+_0x20d43a+_0x37725e++,'VoiceExtensionId':_0x117acf['id']});}}}}for(var _0x3a676f=0x0;_0x3a676f<_0x5eaf5e[_0x32e6('0x31')]['length'];_0x3a676f++){var _0x3e26db=_0x20d43a+_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')];var _0x2b7914=_0x3a676f===_0x5eaf5e[_0x32e6('0x31')][_0x32e6('0x23')]-0x1?_0x20d43a+_0x563db8[_0x32e6('0x23')]+_0x3d6a3a[_0x32e6('0x23')]+0x2:_0x20d43a+_0x3a676f+0x1;_0x563db8['splice'](_0x3a676f,0x0,{'type':_0x117acf[_0x32e6('0x3')],'app':_0x32e6('0x40'),'appdata':_0x5eaf5e['intervals'][_0x3a676f]+'?'+_0x117acf[_0x32e6('0x6')]+',${EXTEN},'+_0x3e26db+':'+_0x117acf[_0x32e6('0x6')]+_0x32e6('0x41')+_0x2b7914,'exten':_0x117acf[_0x32e6('0x7')],'context':_0x117acf[_0x32e6('0x6')],'priority':_0x20d43a+_0x3a676f,'VoiceExtensionId':_0x117acf['id']});}if(_0x5eaf5e[_0x32e6('0x42')]===_0x32e6('0x43'))_0x5eaf5e[_0x32e6('0x44')]=_0x5c483e(_0x117acf,_0x5eaf5e['appdata']);_0x5eaf5e[_0x32e6('0x45')]=_0x563db8[_0x32e6('0x23')]?_['last'](_0x563db8)['priority']+0x1:_0x20d43a;_0x43f391=_[_0x32e6('0x46')](_0x43f391,_0x563db8,[_0x5eaf5e],_0x3d6a3a);_0x20d43a=_[_0x32e6('0x47')](_0x43f391)[_0x32e6('0x45')]+0x1;}return _0x13b5d1(_0x43f391);})['catch'](function(_0xa2a1af){_0x2d47c4(_0xa2a1af);});});}return _0x359d55[_0x32e6('0x48')]('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x29bc7b){var _0x2d60c8=this[_0x32e6('0x49')]({'plain':!![]});var _0x386a85=_0x2d60c8[_0x32e6('0x3')]===_0x32e6('0x10')?_0x353be7(_0x2d60c8):_0x477974(_0x2d60c8);return _0x5e2ac3(_0x2d60c8,_0x29bc7b,_[_0x32e6('0x47')](_0x386a85)['priority']+0x1)[_0x32e6('0x2f')](function(_0x40b778){var _0x342bba=_[_0x32e6('0x46')](_0x386a85,_0x40b778);_0x342bba['push']({'type':_0x2d60c8[_0x32e6('0x3')],'app':_0x32e6('0x4a'),'exten':_0x2d60c8[_0x32e6('0x7')],'context':_0x2d60c8['context'],'priority':_['last'](_0x342bba)[_0x32e6('0x45')]+0x1,'VoiceExtensionId':_0x2d60c8['id']});return _0x342bba;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 9fbc05a..35af68b 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 _0x6808=['defaults','redis','./voiceExtension.socket','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','options','raw','attributes','limit','include','map','model','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x8d87c,_0x21f2e0){var _0x35bb77=function(_0x3c208d){while(--_0x3c208d){_0x8d87c['push'](_0x8d87c['shift']());}};_0x35bb77(++_0x21f2e0);}(_0x6808,0xd1));var _0x8680=function(_0x5a88a3,_0x2fad83){_0x5a88a3=_0x5a88a3-0x0;var _0x338482=_0x6808[_0x5a88a3];return _0x338482;};'use strict';var _=require(_0x8680('0x0'));var util=require(_0x8680('0x1'));var moment=require(_0x8680('0x2'));var BPromise=require(_0x8680('0x3'));var rs=require(_0x8680('0x4'));var fs=require('fs');var Redis=require(_0x8680('0x5'));var db=require(_0x8680('0x6'))['db'];var utils=require(_0x8680('0x7'));var logger=require('../../config/logger')(_0x8680('0x8'));var config=require(_0x8680('0x9'));var jayson=require(_0x8680('0xa'));var client=jayson[_0x8680('0xb')][_0x8680('0xc')]({'port':0x232a});config['redis']=_[_0x8680('0xd')](config[_0x8680('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8680('0xe')]));require(_0x8680('0xf'))['register'](socket);function respondWithRpcPromise(_0x1bf7b5,_0x4f6c78,_0x47d8b4){return new BPromise(function(_0x5e0be2,_0x3c1b07){return client[_0x8680('0x10')](_0x1bf7b5,_0x47d8b4)[_0x8680('0x11')](function(_0x4730a6){logger[_0x8680('0x12')](_0x8680('0x13'),_0x4f6c78,_0x8680('0x14'));logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4f6c78,_0x8680('0x14'),JSON[_0x8680('0x15')](_0x4730a6));if(_0x4730a6[_0x8680('0x16')]){if(_0x4730a6['error'][_0x8680('0x17')]===0x1f4){logger[_0x8680('0x16')](_0x8680('0x13'),_0x4f6c78,_0x4730a6[_0x8680('0x16')][_0x8680('0x18')]);return _0x3c1b07(_0x4730a6[_0x8680('0x16')][_0x8680('0x18')]);}logger['error'](_0x8680('0x13'),_0x4f6c78,_0x4730a6['error'][_0x8680('0x18')]);return _0x5e0be2(_0x4730a6['error'][_0x8680('0x18')]);}else{logger[_0x8680('0x12')]('VoiceExtension,\x20%s,\x20%s',_0x4f6c78,_0x8680('0x14'));_0x5e0be2(_0x4730a6[_0x8680('0x19')][_0x8680('0x18')]);}})['catch'](function(_0x59cbde){logger[_0x8680('0x16')](_0x8680('0x13'),_0x4f6c78,_0x59cbde);_0x3c1b07(_0x59cbde);});});}exports[_0x8680('0x1a')]=function(_0x1db50f){var _0xb5f325=this;return new Promise(function(_0x42938b,_0x200681){return db[_0x8680('0x1b')]['findAll']({'raw':_0x1db50f[_0x8680('0x1c')]?_0x1db50f['options'][_0x8680('0x1d')]===undefined?!![]:![]:!![],'where':_0x1db50f[_0x8680('0x1c')]?_0x1db50f[_0x8680('0x1c')]['where']||null:null,'attributes':_0x1db50f[_0x8680('0x1c')]?_0x1db50f[_0x8680('0x1c')][_0x8680('0x1e')]||null:null,'limit':_0x1db50f[_0x8680('0x1c')]?_0x1db50f[_0x8680('0x1c')][_0x8680('0x1f')]||null:null,'include':_0x1db50f[_0x8680('0x1c')]?_0x1db50f[_0x8680('0x1c')][_0x8680('0x20')]?_[_0x8680('0x21')](_0x1db50f[_0x8680('0x1c')][_0x8680('0x20')],function(_0x41e4a0){return{'model':db[_0x41e4a0[_0x8680('0x22')]],'as':_0x41e4a0['as'],'attributes':_0x41e4a0['attributes'],'include':_0x41e4a0[_0x8680('0x20')]?_[_0x8680('0x21')](_0x41e4a0[_0x8680('0x20')],function(_0x2796d3){return{'model':db[_0x2796d3[_0x8680('0x22')]],'as':_0x2796d3['as'],'attributes':_0x2796d3[_0x8680('0x1e')],'include':_0x2796d3[_0x8680('0x20')]?_['map'](_0x2796d3[_0x8680('0x20')],function(_0x5c2458){return{'model':db[_0x5c2458[_0x8680('0x22')]],'as':_0x5c2458['as'],'attributes':_0x5c2458['attributes']};}):[]};}):[]};}):[]:[]})[_0x8680('0x11')](function(_0x204d97){logger[_0x8680('0x12')](_0x8680('0x1a'),_0x1db50f);logger[_0x8680('0x23')](_0x8680('0x1a'),_0x1db50f,JSON[_0x8680('0x15')](_0x204d97));_0x42938b(_0x204d97);})[_0x8680('0x24')](function(_0x11cbb7){logger[_0x8680('0x16')](_0x8680('0x1a'),_0x11cbb7['message'],_0x1db50f);_0x200681(_0xb5f325[_0x8680('0x16')](0x1f4,_0x11cbb7[_0x8680('0x18')]));});});}; \ No newline at end of file +var _0xa280=['defaults','localhost','socket.io-emitter','./voiceExtension.socket','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','message','catch','GetVoiceExtension','VoiceExtension','options','raw','where','include','map','model','attributes','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x896ce,_0x288208){var _0x4fc85a=function(_0x457c72){while(--_0x457c72){_0x896ce['push'](_0x896ce['shift']());}};_0x4fc85a(++_0x288208);}(_0xa280,0xc4));var _0x0a28=function(_0x4666a9,_0x570375){_0x4666a9=_0x4666a9-0x0;var _0x155559=_0xa280[_0x4666a9];return _0x155559;};'use strict';var _=require(_0x0a28('0x0'));var util=require(_0x0a28('0x1'));var moment=require('moment');var BPromise=require(_0x0a28('0x2'));var rs=require(_0x0a28('0x3'));var fs=require('fs');var Redis=require(_0x0a28('0x4'));var db=require(_0x0a28('0x5'))['db'];var utils=require(_0x0a28('0x6'));var logger=require(_0x0a28('0x7'))(_0x0a28('0x8'));var config=require(_0x0a28('0x9'));var jayson=require(_0x0a28('0xa'));var client=jayson[_0x0a28('0xb')][_0x0a28('0xc')]({'port':0x232a});config[_0x0a28('0xd')]=_[_0x0a28('0xe')](config[_0x0a28('0xd')],{'host':_0x0a28('0xf'),'port':0x18eb});var socket=require(_0x0a28('0x10'))(new Redis(config[_0x0a28('0xd')]));require(_0x0a28('0x11'))['register'](socket);function respondWithRpcPromise(_0x11b36e,_0x28bca7,_0x48cbf1){return new BPromise(function(_0x30e340,_0x1ad1ef){return client['request'](_0x11b36e,_0x48cbf1)['then'](function(_0x1a8ad4){logger[_0x0a28('0x12')](_0x0a28('0x13'),_0x28bca7,_0x0a28('0x14'));logger[_0x0a28('0x15')](_0x0a28('0x16'),_0x28bca7,_0x0a28('0x14'),JSON['stringify'](_0x1a8ad4));if(_0x1a8ad4[_0x0a28('0x17')]){if(_0x1a8ad4[_0x0a28('0x17')]['code']===0x1f4){logger[_0x0a28('0x17')](_0x0a28('0x13'),_0x28bca7,_0x1a8ad4[_0x0a28('0x17')][_0x0a28('0x18')]);return _0x1ad1ef(_0x1a8ad4['error'][_0x0a28('0x18')]);}logger[_0x0a28('0x17')](_0x0a28('0x13'),_0x28bca7,_0x1a8ad4[_0x0a28('0x17')]['message']);return _0x30e340(_0x1a8ad4[_0x0a28('0x17')][_0x0a28('0x18')]);}else{logger[_0x0a28('0x12')](_0x0a28('0x13'),_0x28bca7,'request\x20sent');_0x30e340(_0x1a8ad4['result'][_0x0a28('0x18')]);}})[_0x0a28('0x19')](function(_0x169bb6){logger['error'](_0x0a28('0x13'),_0x28bca7,_0x169bb6);_0x1ad1ef(_0x169bb6);});});}exports[_0x0a28('0x1a')]=function(_0xb5d7f5){var _0x54661d=this;return new Promise(function(_0x6d727c,_0x709adc){return db[_0x0a28('0x1b')]['findAll']({'raw':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')][_0x0a28('0x1d')]===undefined?!![]:![]:!![],'where':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')][_0x0a28('0x1e')]||null:null,'attributes':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')]['attributes']||null:null,'limit':_0xb5d7f5[_0x0a28('0x1c')]?_0xb5d7f5[_0x0a28('0x1c')]['limit']||null:null,'include':_0xb5d7f5['options']?_0xb5d7f5['options'][_0x0a28('0x1f')]?_[_0x0a28('0x20')](_0xb5d7f5[_0x0a28('0x1c')][_0x0a28('0x1f')],function(_0x356864){return{'model':db[_0x356864[_0x0a28('0x21')]],'as':_0x356864['as'],'attributes':_0x356864['attributes'],'include':_0x356864['include']?_[_0x0a28('0x20')](_0x356864['include'],function(_0x509563){return{'model':db[_0x509563[_0x0a28('0x21')]],'as':_0x509563['as'],'attributes':_0x509563[_0x0a28('0x22')],'include':_0x509563[_0x0a28('0x1f')]?_[_0x0a28('0x20')](_0x509563[_0x0a28('0x1f')],function(_0x3745b2){return{'model':db[_0x3745b2[_0x0a28('0x21')]],'as':_0x3745b2['as'],'attributes':_0x3745b2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x14cd0d){logger[_0x0a28('0x12')](_0x0a28('0x1a'),_0xb5d7f5);logger['debug'](_0x0a28('0x1a'),_0xb5d7f5,JSON['stringify'](_0x14cd0d));_0x6d727c(_0x14cd0d);})[_0x0a28('0x19')](function(_0x33b9fe){logger[_0x0a28('0x17')](_0x0a28('0x1a'),_0x33b9fe['message'],_0xb5d7f5);_0x709adc(_0x54661d[_0x0a28('0x17')](0x1f4,_0x33b9fe['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 70e8fa7..e9fb7c1 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 _0xc4aa=['remove','update','removeListener','register','length','./voiceExtension.events','save'];(function(_0x365fb4,_0x143db2){var _0x12979e=function(_0x1dfa01){while(--_0x1dfa01){_0x365fb4['push'](_0x365fb4['shift']());}};_0x12979e(++_0x143db2);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var VoiceExtensionEvents=require(_0xac4a('0x0'));var events=[_0xac4a('0x1'),_0xac4a('0x2'),_0xac4a('0x3')];function createListener(_0x275161,_0x22469d){return function(_0x58634e){_0x22469d['emit'](_0x275161,_0x58634e);};}function removeListener(_0x47d4f6,_0x2f48ed){return function(){VoiceExtensionEvents[_0xac4a('0x4')](_0x47d4f6,_0x2f48ed);};}exports[_0xac4a('0x5')]=function(_0x215f39){for(var _0x96be2b=0x0,_0x15cd34=events[_0xac4a('0x6')];_0x96be2b<_0x15cd34;_0x96be2b++){var _0x10525b=events[_0x96be2b];var _0x5c6179=createListener('voiceExtension:'+_0x10525b,_0x215f39);VoiceExtensionEvents['on'](_0x10525b,_0x5c6179);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x11bb78,_0x197011){var _0x3194f0=function(_0x16f848){while(--_0x16f848){_0x11bb78['push'](_0x11bb78['shift']());}};_0x3194f0(++_0x197011);}(_0x4975,0x86));var _0x5497=function(_0x5c6eea,_0xe6a45f){_0x5c6eea=_0x5c6eea-0x0;var _0x51ba27=_0x4975[_0x5c6eea];return _0x51ba27;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 930b9c3..1b25ca9 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 _0x583c=['fs-extra','../../config/environment','./voiceMail.controller','isAuthenticated','index','get','/:id','show','getMessages','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x2040dd,_0x156a63){var _0x27688f=function(_0xb90c80){while(--_0xb90c80){_0x2040dd['push'](_0x2040dd['shift']());}};_0x27688f(++_0x156a63);}(_0x583c,0x12b));var _0xc583=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x583c[_0xe15270];return _0x1e813b;};'use strict';var multer=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var path=require(_0xc583('0x2'));var timeout=require(_0xc583('0x3'));var express=require('express');var router=express[_0xc583('0x4')]();var fs_extra=require(_0xc583('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xc583('0x6'));var controller=require(_0xc583('0x7'));router['get']('/',auth[_0xc583('0x8')](),controller[_0xc583('0x9')]);router[_0xc583('0xa')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0xc')]);router[_0xc583('0xa')]('/:id/messages',auth[_0xc583('0x8')](),controller[_0xc583('0xd')]);router[_0xc583('0xe')]('/',auth[_0xc583('0x8')](),controller[_0xc583('0xf')]);router['put'](_0xc583('0xb'),auth[_0xc583('0x8')](),controller['update']);router[_0xc583('0x10')](_0xc583('0xb'),auth['isAuthenticated'](),controller[_0xc583('0x11')]);module[_0xc583('0x12')]=router; \ No newline at end of file +var _0x2a07=['getMessages','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages'];(function(_0x267c52,_0x3c0df3){var _0x46c47b=function(_0x3c3740){while(--_0x3c3740){_0x267c52['push'](_0x267c52['shift']());}};_0x46c47b(++_0x3c0df3);}(_0x2a07,0x74));var _0x72a0=function(_0x4e6ef9,_0x22a04e){_0x4e6ef9=_0x4e6ef9-0x0;var _0x331c37=_0x2a07[_0x4e6ef9];return _0x331c37;};'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['post']('/',auth[_0x72a0('0xb')](),controller[_0x72a0('0x11')]);router['put'](_0x72a0('0xd'),auth[_0x72a0('0xb')](),controller[_0x72a0('0x12')]);router[_0x72a0('0x13')](_0x72a0('0xd'),auth['isAuthenticated'](),controller[_0x72a0('0x14')]);module[_0x72a0('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 08a45aa..d0efa37 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 _0xf927=['TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','central','ENUM','yes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf927,0x14b));var _0x7f92=function(_0x344353,_0x31862e){_0x344353=_0x344353-0x0;var _0x3d0723=_0xf927[_0x344353];return _0x3d0723;};'use strict';var Sequelize=require(_0x7f92('0x0'));module[_0x7f92('0x1')]={'customer_id':{'type':Sequelize[_0x7f92('0x2')]},'context':{'type':Sequelize[_0x7f92('0x2')],'defaultValue':_0x7f92('0x3'),'unique':_0x7f92('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x7f92('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x7f92('0x2')]},'email':{'type':Sequelize[_0x7f92('0x2')],'validate':{'isEmail':!![]},'set':function(_0x32c56e){this[_0x7f92('0x5')](_0x7f92('0x6'),typeof _0x32c56e===_0x7f92('0x7')&&_0x32c56e['trim']()?_0x32c56e['trim']():null);}},'pager':{'type':Sequelize[_0x7f92('0x2')]},'tz':{'type':Sequelize[_0x7f92('0x2')],'defaultValue':_0x7f92('0x8')},'attach':{'type':Sequelize[_0x7f92('0x9')]('yes','no'),'defaultValue':_0x7f92('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':_0x7f92('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7f92('0x2')]},'callback':{'type':Sequelize[_0x7f92('0x2')]},'review':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x7f92('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7f92('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':_0x7f92('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7f92('0x9')](_0x7f92('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7f92('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7f92('0x9')]('yes','no'),'defaultValue':_0x7f92('0xa'),'allowNull':![]},'stamp':{'type':_0x7f92('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x7f92('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7f92('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7f92('0xe')],'get':function(){return this[_0x7f92('0xf')](_0x7f92('0x10'))+_0x7f92('0x11')+this[_0x7f92('0xf')](_0x7f92('0x12'));}}}; \ No newline at end of file +var _0xc4e4=['getDataValue','fullname','exports','from-voicemail','contest_mailbox','STRING','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x352bbc,_0x4e1f26){var _0x1a1091=function(_0x52059e){while(--_0x52059e){_0x352bbc['push'](_0x352bbc['shift']());}};_0x1a1091(++_0x4e1f26);}(_0xc4e4,0x1de));var _0x4c4e=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xc4e4[_0x465a0c];return _0x1e202e;};'use strict';var Sequelize=require('sequelize');module[_0x4c4e('0x0')]={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0x4c4e('0x1'),'unique':_0x4c4e('0x2')},'mailbox':{'type':Sequelize[_0x4c4e('0x3')],'defaultValue':'','allowNull':![],'unique':_0x4c4e('0x2')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x4c4e('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x3f1c34){this[_0x4c4e('0x4')](_0x4c4e('0x5'),typeof _0x3f1c34===_0x4c4e('0x6')&&_0x3f1c34[_0x4c4e('0x7')]()?_0x3f1c34[_0x4c4e('0x7')]():null);}},'pager':{'type':Sequelize[_0x4c4e('0x3')]},'tz':{'type':Sequelize[_0x4c4e('0x3')],'defaultValue':_0x4c4e('0x8')},'attach':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':_0x4c4e('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4c4e('0x3')]},'callback':{'type':Sequelize[_0x4c4e('0x3')]},'review':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4c4e('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4c4e('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x4c4e('0xa'),'no'),'defaultValue':_0x4c4e('0xa'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x4c4e('0x9')](_0x4c4e('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x4c4e('0xc')},'emailsubject':{'type':Sequelize[_0x4c4e('0x3')]},'emailbody':{'type':Sequelize[_0x4c4e('0x3')]},'maxsecs':{'type':Sequelize[_0x4c4e('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x4c4e('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4c4e('0xe')],'get':function(){return this[_0x4c4e('0xf')](_0x4c4e('0x10'))+'\x20-\x20'+this['getDataValue']('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 20963ec..d498897 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(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0x80ed,0x11c));var _0xd80e=function(_0x30a92f,_0x1a0afc){_0x30a92f=_0x30a92f-0x0;var _0x291a20=_0x80ed[_0x30a92f];return _0x291a20;};'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 _0x3266=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','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','json','offset','count','set','Content-Range','save','update','then','destroy','get','error','stack','name','send','index','VoiceMail','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','find'];(function(_0x52eb08,_0x781b6b){var _0x375109=function(_0x3d518a){while(--_0x3d518a){_0x52eb08['push'](_0x52eb08['shift']());}};_0x375109(++_0x781b6b);}(_0x3266,0x6a));var _0x6326=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x3266[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];function respondWithStatusCode(_0x379358,_0x5c07e1){_0x5c07e1=_0x5c07e1||0xcc;return function(_0x5381d0){if(_0x5381d0){return _0x379358[_0x6326('0x1c')](_0x5c07e1);}return _0x379358[_0x6326('0x1d')](_0x5c07e1)['end']();};}function respondWithResult(_0x425878,_0x4caef3){_0x4caef3=_0x4caef3||0xc8;return function(_0x2d2d9b){if(_0x2d2d9b){return _0x425878[_0x6326('0x1d')](_0x4caef3)[_0x6326('0x1e')](_0x2d2d9b);}};}function respondWithFilteredResult(_0x41c352,_0x1ed3a3){return function(_0x2c1879){if(_0x2c1879){var _0x55923a=typeof _0x1ed3a3[_0x6326('0x1f')]==='undefined'&&typeof _0x1ed3a3['limit']==='undefined';var _0x51e7b9=_0x2c1879['count'];var _0x58e960=_0x55923a?0x0:_0x1ed3a3[_0x6326('0x1f')];var _0x1f4c11=_0x55923a?_0x2c1879[_0x6326('0x20')]:_0x1ed3a3['offset']+_0x1ed3a3['limit'];var _0x954ed5;if(_0x1f4c11>=_0x51e7b9){_0x1f4c11=_0x51e7b9;_0x954ed5=0xc8;}else{_0x954ed5=0xce;}_0x41c352[_0x6326('0x1d')](_0x954ed5);return _0x41c352[_0x6326('0x21')](_0x6326('0x22'),_0x58e960+'-'+_0x1f4c11+'/'+_0x51e7b9)[_0x6326('0x1e')](_0x2c1879);}return null;};}function patchUpdates(_0x25957a){return function(_0x21ee7d){try{jsonpatch['apply'](_0x21ee7d,_0x25957a,!![]);}catch(_0x22307f){return BPromise['reject'](_0x22307f);}return _0x21ee7d[_0x6326('0x23')]();};}function saveUpdates(_0x3c6cfa,_0x2482ef){return function(_0x24fb78){if(_0x24fb78){return _0x24fb78[_0x6326('0x24')](_0x3c6cfa)[_0x6326('0x25')](function(_0x225555){return _0x225555;});}return null;};}function removeEntity(_0x429bb0,_0x4781cc){return function(_0x2d0d00){if(_0x2d0d00){return _0x2d0d00[_0x6326('0x26')]()['then'](function(){var _0x72d020=_0x2d0d00[_0x6326('0x27')]({'plain':!![]});var _0x575701='Voicemails';return db['UserProfileResource'][_0x6326('0x26')]({'where':{'type':_0x575701,'resourceId':_0x72d020['id']}})['then'](function(){return _0x2d0d00;});})[_0x6326('0x25')](function(){_0x429bb0[_0x6326('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15e33d,_0x21ec69){return function(_0xb68fec){if(!_0xb68fec){_0x15e33d[_0x6326('0x1c')](0x194);}return _0xb68fec;};}function handleError(_0x2d2180,_0x45d037){_0x45d037=_0x45d037||0x1f4;return function(_0x40e036){logger[_0x6326('0x28')](_0x40e036[_0x6326('0x29')]);if(_0x40e036[_0x6326('0x2a')]){delete _0x40e036[_0x6326('0x2a')];}_0x2d2180[_0x6326('0x1d')](_0x45d037)[_0x6326('0x2b')](_0x40e036);};}exports[_0x6326('0x2c')]=function(_0x2e0445,_0x20c5ab){var _0x520e57={},_0x2bf5ef={},_0x47303c={'count':0x0,'rows':[]};var _0x1f8982=_['map'](db[_0x6326('0x2d')]['rawAttributes'],function(_0x4e703a){return{'name':_0x4e703a[_0x6326('0x2e')],'type':_0x4e703a[_0x6326('0x2f')][_0x6326('0x30')]};});_0x2bf5ef[_0x6326('0x31')]=_[_0x6326('0x32')](_0x1f8982,_0x6326('0x2a'));_0x2bf5ef[_0x6326('0x33')]=_[_0x6326('0x34')](_0x2e0445[_0x6326('0x33')]);_0x2bf5ef[_0x6326('0x35')]=_[_0x6326('0x36')](_0x2bf5ef[_0x6326('0x31')],_0x2bf5ef['query']);_0x520e57[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2bf5ef['model'],qs[_0x6326('0x38')](_0x2e0445[_0x6326('0x33')][_0x6326('0x38')]));_0x520e57['attributes']=_0x520e57[_0x6326('0x37')]['length']?_0x520e57['attributes']:_0x2bf5ef[_0x6326('0x31')];if(!_0x2e0445[_0x6326('0x33')][_0x6326('0x39')]('nolimit')){_0x520e57[_0x6326('0x3a')]=qs['limit'](_0x2e0445[_0x6326('0x33')]['limit']);_0x520e57[_0x6326('0x1f')]=qs[_0x6326('0x1f')](_0x2e0445[_0x6326('0x33')][_0x6326('0x1f')]);}_0x520e57[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x2e0445['query'][_0x6326('0x3c')]);_0x520e57[_0x6326('0x3d')]=qs['filters'](_[_0x6326('0x3e')](_0x2e0445['query'],_0x2bf5ef['filters']),_0x1f8982);if(_0x2e0445[_0x6326('0x33')][_0x6326('0x3f')]){_0x520e57[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x520e57[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x1f8982,function(_0x5de1c3){if(_0x5de1c3['type']!==_0x6326('0x41')){var _0x5b68af={};_0x5b68af[_0x5de1c3[_0x6326('0x2a')]]={'$like':'%'+_0x2e0445['query'][_0x6326('0x3f')]+'%'};return _0x5b68af;}})});}_0x520e57=_[_0x6326('0x40')]({},_0x520e57,_0x2e0445[_0x6326('0x42')]);var _0x1da798={'where':_0x520e57[_0x6326('0x3d')]};return db[_0x6326('0x2d')][_0x6326('0x20')](_0x1da798)[_0x6326('0x25')](function(_0x3b089b){_0x47303c[_0x6326('0x20')]=_0x3b089b;if(_0x2e0445[_0x6326('0x33')]['includeAll']){_0x520e57[_0x6326('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x6326('0x44')](_0x520e57);})[_0x6326('0x25')](function(_0x16fc33){_0x47303c[_0x6326('0x45')]=_0x16fc33;return _0x47303c;})['then'](respondWithFilteredResult(_0x20c5ab,_0x520e57))[_0x6326('0x46')](handleError(_0x20c5ab,null));};exports[_0x6326('0x47')]=function(_0x562d5f,_0x12703d){var _0xe6a992={'raw':!![],'where':{'id':_0x562d5f[_0x6326('0x48')]['id']}},_0x7a5057={};_0x7a5057['model']=_[_0x6326('0x34')](db[_0x6326('0x2d')][_0x6326('0x49')]);_0x7a5057[_0x6326('0x33')]=_[_0x6326('0x34')](_0x562d5f[_0x6326('0x33')]);_0x7a5057[_0x6326('0x35')]=_['intersection'](_0x7a5057[_0x6326('0x31')],_0x7a5057[_0x6326('0x33')]);_0xe6a992[_0x6326('0x37')]=_[_0x6326('0x36')](_0x7a5057['model'],qs[_0x6326('0x38')](_0x562d5f['query'][_0x6326('0x38')]));_0xe6a992[_0x6326('0x37')]=_0xe6a992[_0x6326('0x37')][_0x6326('0x4a')]?_0xe6a992[_0x6326('0x37')]:_0x7a5057['model'];if(_0x562d5f[_0x6326('0x33')]['includeAll']){_0xe6a992['include']=[{'all':!![]}];}_0xe6a992=_[_0x6326('0x40')]({},_0xe6a992,_0x562d5f[_0x6326('0x42')]);return db['VoiceMail'][_0x6326('0x4b')](_0xe6a992)[_0x6326('0x25')](handleEntityNotFound(_0x12703d,null))[_0x6326('0x25')](respondWithResult(_0x12703d,null))[_0x6326('0x46')](handleError(_0x12703d,null));};exports[_0x6326('0x4c')]=function(_0x4f8dc0,_0x4af0ee){return db[_0x6326('0x2d')][_0x6326('0x4c')](_0x4f8dc0[_0x6326('0x4d')],{})[_0x6326('0x25')](function(_0x210a1b){var _0x318d19=_0x4f8dc0[_0x6326('0x4e')]['get']({'plain':!![]});if(!_0x318d19)throw new Error(_0x6326('0x4f'));if(_0x318d19[_0x6326('0x50')]===_0x6326('0x4e')){var _0x3e7674=_0x210a1b[_0x6326('0x27')]({'plain':!![]});var _0x4ff8e6=_0x6326('0x51');return db['UserProfileSection'][_0x6326('0x4b')]({'where':{'name':_0x4ff8e6,'userProfileId':_0x318d19[_0x6326('0x52')]},'raw':!![]})['then'](function(_0x37b045){if(_0x37b045&&_0x37b045['autoAssociation']===0x0){return db[_0x6326('0x53')][_0x6326('0x4c')]({'name':_0x3e7674[_0x6326('0x2a')],'resourceId':_0x3e7674['id'],'type':_0x37b045[_0x6326('0x2a')],'sectionId':_0x37b045['id']},{})['then'](function(){return _0x210a1b;});}else{return _0x210a1b;}})[_0x6326('0x46')](function(_0xbe6b3e){logger['error'](_0x6326('0x54'),_0xbe6b3e);throw _0xbe6b3e;});}return _0x210a1b;})[_0x6326('0x25')](respondWithResult(_0x4af0ee,0xc9))[_0x6326('0x46')](handleError(_0x4af0ee,null));};exports['update']=function(_0x2bece1,_0x2ac64b){if(_0x2bece1['body']['id']){delete _0x2bece1[_0x6326('0x4d')]['id'];}return db['VoiceMail'][_0x6326('0x4b')]({'where':{'id':_0x2bece1[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x2ac64b,null))[_0x6326('0x25')](saveUpdates(_0x2bece1[_0x6326('0x4d')],null))[_0x6326('0x25')](respondWithResult(_0x2ac64b,null))[_0x6326('0x46')](handleError(_0x2ac64b,null));};exports['destroy']=function(_0x51adce,_0x4d4de7){return db[_0x6326('0x2d')]['find']({'where':{'id':_0x51adce[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x4d4de7,null))[_0x6326('0x25')](removeEntity(_0x4d4de7,null))[_0x6326('0x46')](handleError(_0x4d4de7,null));};exports[_0x6326('0x55')]=function(_0x4b5bc6,_0x23bf64,_0x2e4244){return db['VoiceMail'][_0x6326('0x56')]({'where':{'id':_0x4b5bc6[_0x6326('0x48')]['id']}})[_0x6326('0x25')](handleEntityNotFound(_0x23bf64,null))[_0x6326('0x25')](function(_0x45e3d5){var _0x36f2f5;var _0x320d43={},_0x2f624f={};_0x2f624f[_0x6326('0x31')]=_[_0x6326('0x34')](db['VoiceMailMessage'][_0x6326('0x49')]);_0x2f624f[_0x6326('0x33')]=_[_0x6326('0x34')](_0x4b5bc6[_0x6326('0x33')]);_0x2f624f['filters']=_['intersection'](_0x2f624f[_0x6326('0x31')],_0x2f624f[_0x6326('0x33')]);_0x320d43[_0x6326('0x37')]=_[_0x6326('0x36')](_0x2f624f[_0x6326('0x31')],qs['fields'](_0x4b5bc6['query'][_0x6326('0x38')]));_0x320d43[_0x6326('0x37')]=_0x320d43[_0x6326('0x37')][_0x6326('0x4a')]?_0x320d43['attributes']:_0x2f624f[_0x6326('0x31')];if(!_0x4b5bc6[_0x6326('0x33')][_0x6326('0x39')](_0x6326('0x57'))){_0x320d43[_0x6326('0x3a')]=qs[_0x6326('0x3a')](_0x4b5bc6['query'][_0x6326('0x3a')]);_0x320d43['offset']=qs[_0x6326('0x1f')](_0x4b5bc6[_0x6326('0x33')]['offset']);}_0x320d43[_0x6326('0x3b')]=qs[_0x6326('0x3c')](_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3c')]);_0x320d43[_0x6326('0x3d')]=qs[_0x6326('0x35')](_[_0x6326('0x3e')](_0x4b5bc6[_0x6326('0x33')],_0x2f624f[_0x6326('0x35')]));if(_0x4b5bc6[_0x6326('0x33')]['filter']){_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43[_0x6326('0x3d')],{'$or':_[_0x6326('0x32')](_0x320d43[_0x6326('0x37')],function(_0x5599da){var _0x299795={};_0x299795[_0x5599da]={'$like':'%'+_0x4b5bc6[_0x6326('0x33')][_0x6326('0x3f')]+'%'};return _0x299795;})});}_0x320d43[_0x6326('0x3d')]=_[_0x6326('0x40')](_0x320d43['where'],{'mailboxuser':_0x45e3d5[_0x6326('0x58')]});_0x320d43=_['merge']({},_0x320d43,_0x4b5bc6['options']);return db[_0x6326('0x59')][_0x6326('0x5a')](_0x320d43)[_0x6326('0x25')](respondWithFilteredResult(_0x23bf64,_0x320d43));})[_0x6326('0x46')](handleError(_0x23bf64,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 1ef01e2..6a1b03d 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 _0xac7c=['moment','bluebird','request-promise','path','rimraf','exports','define','VoiceMail','mailbox_context','mailbox','context','lodash','util','../../config/logger'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xac7c,0x6d));var _0xcac7=function(_0x3f3f06,_0x581e5b){_0x3f3f06=_0x3f3f06-0x0;var _0x140feb=_0xac7c[_0x3f3f06];return _0x140feb;};'use strict';var _=require(_0xcac7('0x0'));var util=require(_0xcac7('0x1'));var logger=require(_0xcac7('0x2'))('api');var moment=require(_0xcac7('0x3'));var BPromise=require(_0xcac7('0x4'));var rp=require(_0xcac7('0x5'));var fs=require('fs');var path=require(_0xcac7('0x6'));var rimraf=require(_0xcac7('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMail.attributes');module[_0xcac7('0x8')]=function(_0x2e7c0e,_0x3748f6){return _0x2e7c0e[_0xcac7('0x9')](_0xcac7('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xcac7('0xb'),'fields':[_0xcac7('0xc'),_0xcac7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa9c7=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0xa9c7,0x158));var _0x7a9c=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0xa9c7[_0x20845e];return _0x28cf2b;};'use strict';var _=require(_0x7a9c('0x0'));var util=require(_0x7a9c('0x1'));var logger=require(_0x7a9c('0x2'))(_0x7a9c('0x3'));var moment=require('moment');var BPromise=require(_0x7a9c('0x4'));var rp=require(_0x7a9c('0x5'));var fs=require('fs');var path=require(_0x7a9c('0x6'));var rimraf=require(_0x7a9c('0x7'));var config=require('../../config/environment');var attributes=require(_0x7a9c('0x8'));module[_0x7a9c('0x9')]=function(_0x105347,_0x38c98d){return _0x105347[_0x7a9c('0xa')](_0x7a9c('0xb'),attributes,{'tableName':_0x7a9c('0xc'),'paranoid':![],'indexes':[{'name':_0x7a9c('0xd'),'fields':[_0x7a9c('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 0e96d9c..8763fea 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 _0x564a=['VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x53fb33,_0x566fa2){var _0x2da18e=function(_0x22e4de){while(--_0x22e4de){_0x53fb33['push'](_0x53fb33['shift']());}};_0x2da18e(++_0x566fa2);}(_0x564a,0x195));var _0xa564=function(_0x53cf36,_0xd7ff1c){_0x53cf36=_0x53cf36-0x0;var _0x1fbb7c=_0x564a[_0x53cf36];return _0x1fbb7c;};'use strict';var _=require(_0xa564('0x0'));var util=require(_0xa564('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa564('0x2'));var fs=require('fs');var Redis=require(_0xa564('0x3'));var db=require(_0xa564('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa564('0x5'))(_0xa564('0x6'));var config=require(_0xa564('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa564('0x8')][_0xa564('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e5575,_0x22acaa,_0x43befa){return new BPromise(function(_0x115a99,_0x29702f){return client[_0xa564('0xa')](_0x3e5575,_0x43befa)[_0xa564('0xb')](function(_0x275631){logger[_0xa564('0xc')](_0xa564('0xd'),_0x22acaa,'request\x20sent');logger[_0xa564('0xe')](_0xa564('0xf'),_0x22acaa,_0xa564('0x10'),JSON[_0xa564('0x11')](_0x275631));if(_0x275631[_0xa564('0x12')]){if(_0x275631[_0xa564('0x12')]['code']===0x1f4){logger[_0xa564('0x12')](_0xa564('0xd'),_0x22acaa,_0x275631[_0xa564('0x12')][_0xa564('0x13')]);return _0x29702f(_0x275631[_0xa564('0x12')][_0xa564('0x13')]);}logger[_0xa564('0x12')](_0xa564('0xd'),_0x22acaa,_0x275631[_0xa564('0x12')]['message']);return _0x115a99(_0x275631[_0xa564('0x12')][_0xa564('0x13')]);}else{logger[_0xa564('0xc')](_0xa564('0xd'),_0x22acaa,_0xa564('0x10'));_0x115a99(_0x275631[_0xa564('0x14')][_0xa564('0x13')]);}})[_0xa564('0x15')](function(_0x5824f3){logger[_0xa564('0x12')](_0xa564('0xd'),_0x22acaa,_0x5824f3);_0x29702f(_0x5824f3);});});} \ No newline at end of file +var _0x7635=['VoiceMail,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error'];(function(_0x286b9e,_0x46a607){var _0x525987=function(_0x21005f){while(--_0x21005f){_0x286b9e['push'](_0x286b9e['shift']());}};_0x525987(++_0x46a607);}(_0x7635,0x1a6));var _0x5763=function(_0x1fa126,_0x2bb034){_0x1fa126=_0x1fa126-0x0;var _0x309ce6=_0x7635[_0x1fa126];return _0x309ce6;};'use strict';var _=require(_0x5763('0x0'));var util=require(_0x5763('0x1'));var moment=require(_0x5763('0x2'));var BPromise=require(_0x5763('0x3'));var rs=require(_0x5763('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5763('0x5'))['db'];var utils=require(_0x5763('0x6'));var logger=require('../../config/logger')(_0x5763('0x7'));var config=require(_0x5763('0x8'));var jayson=require(_0x5763('0x9'));var client=jayson[_0x5763('0xa')][_0x5763('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5121b7,_0x1764e0,_0x4fc956){return new BPromise(function(_0x2ed316,_0x3edf12){return client[_0x5763('0xc')](_0x5121b7,_0x4fc956)[_0x5763('0xd')](function(_0x46d0cc){logger['info']('VoiceMail,\x20%s,\x20%s',_0x1764e0,'request\x20sent');logger[_0x5763('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1764e0,_0x5763('0xf'),JSON[_0x5763('0x10')](_0x46d0cc));if(_0x46d0cc['error']){if(_0x46d0cc[_0x5763('0x11')]['code']===0x1f4){logger['error'](_0x5763('0x12'),_0x1764e0,_0x46d0cc['error'][_0x5763('0x13')]);return _0x3edf12(_0x46d0cc[_0x5763('0x11')][_0x5763('0x13')]);}logger[_0x5763('0x11')]('VoiceMail,\x20%s,\x20%s',_0x1764e0,_0x46d0cc[_0x5763('0x11')][_0x5763('0x13')]);return _0x2ed316(_0x46d0cc[_0x5763('0x11')][_0x5763('0x13')]);}else{logger[_0x5763('0x14')]('VoiceMail,\x20%s,\x20%s',_0x1764e0,_0x5763('0xf'));_0x2ed316(_0x46d0cc['result'][_0x5763('0x13')]);}})[_0x5763('0x15')](function(_0x215e05){logger[_0x5763('0x11')](_0x5763('0x12'),_0x1764e0,_0x215e05);_0x3edf12(_0x215e05);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 51b2e75..163e5af 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 _0x15c9=['index','/:id','show','/:id/download','download','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated'];(function(_0x5a3721,_0x1d245e){var _0x101240=function(_0x36f82e){while(--_0x36f82e){_0x5a3721['push'](_0x5a3721['shift']());}};_0x101240(++_0x1d245e);}(_0x15c9,0x160));var _0x915c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x15c9[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x915c('0x0'));var path=require(_0x915c('0x1'));var timeout=require(_0x915c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x915c('0x3'));var auth=require(_0x915c('0x4'));var interaction=require(_0x915c('0x5'));var config=require('../../config/environment');var controller=require(_0x915c('0x6'));router[_0x915c('0x7')]('/',auth[_0x915c('0x8')](),controller[_0x915c('0x9')]);router[_0x915c('0x7')](_0x915c('0xa'),auth[_0x915c('0x8')](),controller[_0x915c('0xb')]);router[_0x915c('0x7')](_0x915c('0xc'),auth['isAuthenticated'](),controller[_0x915c('0xd')]);router['post']('/',auth[_0x915c('0x8')](),controller['create']);router[_0x915c('0xe')](_0x915c('0xa'),auth[_0x915c('0x8')](),controller[_0x915c('0xf')]);router[_0x915c('0x10')]('/:id',auth[_0x915c('0x8')](),controller[_0x915c('0x11')]);module[_0x915c('0x12')]=router; \ No newline at end of file +var _0x3520=['../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','post','update','delete','destroy','multer','connect-timeout','express'];(function(_0x36f86d,_0x565083){var _0x59b305=function(_0x448eba){while(--_0x448eba){_0x36f86d['push'](_0x36f86d['shift']());}};_0x59b305(++_0x565083);}(_0x3520,0x1bd));var _0x0352=function(_0x50460d,_0x390b0f){_0x50460d=_0x50460d-0x0;var _0x3bb777=_0x3520[_0x50460d];return _0x3bb777;};'use strict';var multer=require(_0x0352('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0352('0x1'));var express=require(_0x0352('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0352('0x3'));var controller=require('./voiceMailMessage.controller');router[_0x0352('0x4')]('/',auth[_0x0352('0x5')](),controller['index']);router[_0x0352('0x4')](_0x0352('0x6'),auth['isAuthenticated'](),controller[_0x0352('0x7')]);router[_0x0352('0x4')](_0x0352('0x8'),auth['isAuthenticated'](),controller[_0x0352('0x9')]);router[_0x0352('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x0352('0x6'),auth[_0x0352('0x5')](),controller[_0x0352('0xb')]);router[_0x0352('0xc')](_0x0352('0x6'),auth[_0x0352('0x5')](),controller[_0x0352('0xd')]);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 e4762ed..8d9f034 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 _0xd709=['literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x593834,_0xb538b){var _0x5e5dd3=function(_0x45311d){while(--_0x45311d){_0x593834['push'](_0x593834['shift']());}};_0x5e5dd3(++_0xb538b);}(_0xd709,0x188));var _0x9d70=function(_0x5dea95,_0x9a7bed){_0x5dea95=_0x5dea95-0x0;var _0xf1c636=_0xd709[_0x5dea95];return _0xf1c636;};'use strict';var Sequelize=require('sequelize');module[_0x9d70('0x0')]={'name':{'type':Sequelize[_0x9d70('0x1')],'get':function(_0x2ba665){return this[_0x9d70('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x9d70('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x9d70('0x5')](_0x9d70('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x9d70('0x4')],'defaultValue':''},'stamp':{'type':_0x9d70('0x7'),'defaultValue':Sequelize[_0x9d70('0x8')](_0x9d70('0x9'))}}; \ No newline at end of file +var _0xc4ff=['VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports'];(function(_0x29b279,_0x4a305c){var _0x5ab324=function(_0x89c098){while(--_0x89c098){_0x29b279['push'](_0x29b279['shift']());}};_0x5ab324(++_0x4a305c);}(_0xc4ff,0x95));var _0xfc4f=function(_0x362abb,_0x12504a){_0x362abb=_0x362abb-0x0;var _0x398e13=_0xc4ff[_0x362abb];return _0x398e13;};'use strict';var Sequelize=require('sequelize');module[_0xfc4f('0x0')]={'name':{'type':Sequelize[_0xfc4f('0x1')],'get':function(_0x20f5dc){return this[_0xfc4f('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xfc4f('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xfc4f('0x5')](_0xfc4f('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xfc4f('0x4')],'defaultValue':''},'stamp':{'type':_0xfc4f('0x7'),'defaultValue':Sequelize[_0xfc4f('0x8')](_0xfc4f('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 3c04bf6..ed17459 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 _0x55bb=['rows','show','length','include','options','find','create','body','params','catch','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceMailMessage','includeAll'];(function(_0x15a265,_0x43efa3){var _0x598b96=function(_0x368b80){while(--_0x368b80){_0x15a265['push'](_0x15a265['shift']());}};_0x598b96(++_0x43efa3);}(_0x55bb,0x1b6));var _0xb55b=function(_0x26c557,_0x273eca){_0x26c557=_0x26c557-0x0;var _0x14b875=_0x55bb[_0x26c557];return _0x14b875;};'use strict';var emlformat=require(_0xb55b('0x0'));var rimraf=require(_0xb55b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb55b('0x2'));var rp=require('request-promise');var moment=require(_0xb55b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb55b('0x4'));var path=require(_0xb55b('0x5'));var sox=require(_0xb55b('0x6'));var csv=require(_0xb55b('0x7'));var ejs=require(_0xb55b('0x8'));var fs=require('fs');var fs_extra=require(_0xb55b('0x9'));var _=require(_0xb55b('0xa'));var squel=require(_0xb55b('0xb'));var crypto=require('crypto');var jsforce=require(_0xb55b('0xc'));var deskjs=require(_0xb55b('0xd'));var toCsv=require(_0xb55b('0x7'));var querystring=require(_0xb55b('0xe'));var Papa=require(_0xb55b('0xf'));var Redis=require('ioredis');var authService=require(_0xb55b('0x10'));var qs=require(_0xb55b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb55b('0x12'))(_0xb55b('0x13'));var utils=require(_0xb55b('0x14'));var config=require(_0xb55b('0x15'));var licenseUtil=require(_0xb55b('0x16'));var db=require(_0xb55b('0x17'))['db'];function respondWithStatusCode(_0x2dc5f8,_0x2752b6){_0x2752b6=_0x2752b6||0xcc;return function(_0x2e5692){if(_0x2e5692){return _0x2dc5f8[_0xb55b('0x18')](_0x2752b6);}return _0x2dc5f8[_0xb55b('0x19')](_0x2752b6)[_0xb55b('0x1a')]();};}function respondWithResult(_0x262b87,_0x140b2f){_0x140b2f=_0x140b2f||0xc8;return function(_0x1c4497){if(_0x1c4497){return _0x262b87[_0xb55b('0x19')](_0x140b2f)['json'](_0x1c4497);}};}function respondWithFilteredResult(_0x426c07,_0x2c1f80){return function(_0x30e048){if(_0x30e048){var _0x4cfce6=typeof _0x2c1f80['offset']==='undefined'&&typeof _0x2c1f80[_0xb55b('0x1b')]===_0xb55b('0x1c');var _0x3a0315=_0x30e048[_0xb55b('0x1d')];var _0x5dc276=_0x4cfce6?0x0:_0x2c1f80['offset'];var _0x427753=_0x4cfce6?_0x30e048[_0xb55b('0x1d')]:_0x2c1f80[_0xb55b('0x1e')]+_0x2c1f80['limit'];var _0x487b43;if(_0x427753>=_0x3a0315){_0x427753=_0x3a0315;_0x487b43=0xc8;}else{_0x487b43=0xce;}_0x426c07['status'](_0x487b43);return _0x426c07[_0xb55b('0x1f')](_0xb55b('0x20'),_0x5dc276+'-'+_0x427753+'/'+_0x3a0315)[_0xb55b('0x21')](_0x30e048);}return null;};}function patchUpdates(_0x4409b6){return function(_0x3c8ab0){try{jsonpatch['apply'](_0x3c8ab0,_0x4409b6,!![]);}catch(_0x5dcd97){return BPromise[_0xb55b('0x22')](_0x5dcd97);}return _0x3c8ab0[_0xb55b('0x23')]();};}function saveUpdates(_0x2d486a,_0x490539){return function(_0x52e729){if(_0x52e729){return _0x52e729[_0xb55b('0x24')](_0x2d486a)[_0xb55b('0x25')](function(_0x4d2ffe){return _0x4d2ffe;});}return null;};}function removeEntity(_0x476662,_0x4b5477){return function(_0xd325e){if(_0xd325e){return _0xd325e[_0xb55b('0x26')]()[_0xb55b('0x25')](function(){_0x476662[_0xb55b('0x19')](0xcc)[_0xb55b('0x1a')]();});}};}function handleEntityNotFound(_0x10d5f5,_0x171760){return function(_0x18e719){if(!_0x18e719){_0x10d5f5[_0xb55b('0x18')](0x194);}return _0x18e719;};}function handleError(_0x225f84,_0x2a8e80){_0x2a8e80=_0x2a8e80||0x1f4;return function(_0x119f57){logger[_0xb55b('0x27')](_0x119f57[_0xb55b('0x28')]);if(_0x119f57['name']){delete _0x119f57[_0xb55b('0x29')];}_0x225f84['status'](_0x2a8e80)[_0xb55b('0x2a')](_0x119f57);};}exports[_0xb55b('0x2b')]=function(_0x34fc30,_0x6ecb7c){var _0x4a5407={},_0x3c250e={},_0x159a4a={'count':0x0,'rows':[]};var _0x476e3e=_[_0xb55b('0x2c')](db['VoiceMailMessage']['rawAttributes'],function(_0x1d1a47){return{'name':_0x1d1a47[_0xb55b('0x2d')],'type':_0x1d1a47['type']['key']};});_0x3c250e[_0xb55b('0x2e')]=_[_0xb55b('0x2f')](_[_0xb55b('0x2c')](_0x476e3e,_0xb55b('0x29')),[_0xb55b('0x29')]);_0x3c250e[_0xb55b('0x30')]=_[_0xb55b('0x31')](_0x34fc30[_0xb55b('0x30')]);_0x3c250e[_0xb55b('0x32')]=_[_0xb55b('0x33')](_0x3c250e[_0xb55b('0x2e')],_0x3c250e[_0xb55b('0x30')]);_0x4a5407[_0xb55b('0x34')]=_[_0xb55b('0x33')](_0x3c250e['model'],qs[_0xb55b('0x35')](_0x34fc30['query'][_0xb55b('0x35')]));_0x4a5407[_0xb55b('0x34')]=_0x4a5407[_0xb55b('0x34')]['length']?_0x4a5407[_0xb55b('0x34')]:_0x3c250e[_0xb55b('0x2e')];if(!_0x34fc30['query'][_0xb55b('0x36')](_0xb55b('0x37'))){_0x4a5407['limit']=qs[_0xb55b('0x1b')](_0x34fc30[_0xb55b('0x30')]['limit']);_0x4a5407[_0xb55b('0x1e')]=qs[_0xb55b('0x1e')](_0x34fc30['query'][_0xb55b('0x1e')]);}_0x4a5407[_0xb55b('0x38')]=qs['sort'](_0x34fc30['query'][_0xb55b('0x39')]);_0x4a5407[_0xb55b('0x3a')]=qs[_0xb55b('0x32')](_[_0xb55b('0x3b')](_0x34fc30[_0xb55b('0x30')],_0x3c250e[_0xb55b('0x32')]),_0x476e3e);if(_0x34fc30['query'][_0xb55b('0x3c')]){_0x4a5407[_0xb55b('0x3a')]=_[_0xb55b('0x3d')](_0x4a5407['where'],{'$or':_[_0xb55b('0x2c')](_0x476e3e,function(_0x3f3ca4){if(_0x3f3ca4[_0xb55b('0x3e')]!==_0xb55b('0x3f')){var _0x26907b={};_0x26907b[_0x3f3ca4[_0xb55b('0x29')]]={'$like':'%'+_0x34fc30[_0xb55b('0x30')]['filter']+'%'};return _0x26907b;}})});}_0x4a5407=_[_0xb55b('0x3d')]({},_0x4a5407,_0x34fc30['options']);var _0x50815e={'where':_0x4a5407['where']};return db[_0xb55b('0x40')]['count'](_0x50815e)[_0xb55b('0x25')](function(_0xc06fc){_0x159a4a['count']=_0xc06fc;if(_0x34fc30['query'][_0xb55b('0x41')]){_0x4a5407['include']=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x4a5407);})[_0xb55b('0x25')](function(_0x3a4f9f){_0x159a4a[_0xb55b('0x42')]=_0x3a4f9f;return _0x159a4a;})[_0xb55b('0x25')](respondWithFilteredResult(_0x6ecb7c,_0x4a5407))['catch'](handleError(_0x6ecb7c,null));};exports[_0xb55b('0x43')]=function(_0x377f0e,_0x12606e){var _0x952f14={'raw':!![],'where':{'id':_0x377f0e['params']['id']}},_0x814378={};_0x814378['model']=_[_0xb55b('0x31')](db[_0xb55b('0x40')]['rawAttributes']);_0x814378[_0xb55b('0x30')]=_[_0xb55b('0x31')](_0x377f0e[_0xb55b('0x30')]);_0x814378[_0xb55b('0x32')]=_[_0xb55b('0x33')](_0x814378[_0xb55b('0x2e')],_0x814378[_0xb55b('0x30')]);_0x952f14[_0xb55b('0x34')]=_['intersection'](_0x814378['model'],qs['fields'](_0x377f0e[_0xb55b('0x30')][_0xb55b('0x35')]));_0x952f14[_0xb55b('0x34')]=_0x952f14['attributes'][_0xb55b('0x44')]?_0x952f14[_0xb55b('0x34')]:_0x814378[_0xb55b('0x2e')];if(_0x377f0e[_0xb55b('0x30')][_0xb55b('0x41')]){_0x952f14[_0xb55b('0x45')]=[{'all':!![]}];}_0x952f14=_[_0xb55b('0x3d')]({},_0x952f14,_0x377f0e[_0xb55b('0x46')]);return db[_0xb55b('0x40')][_0xb55b('0x47')](_0x952f14)[_0xb55b('0x25')](handleEntityNotFound(_0x12606e,null))[_0xb55b('0x25')](respondWithResult(_0x12606e,null))['catch'](handleError(_0x12606e,null));};exports['create']=function(_0x489804,_0x7a3f0d){return db[_0xb55b('0x40')][_0xb55b('0x48')](_0x489804[_0xb55b('0x49')],{})[_0xb55b('0x25')](respondWithResult(_0x7a3f0d,0xc9))['catch'](handleError(_0x7a3f0d,null));};exports[_0xb55b('0x24')]=function(_0x2d49e4,_0x1da8a7){if(_0x2d49e4[_0xb55b('0x49')]['id']){delete _0x2d49e4['body']['id'];}return db[_0xb55b('0x40')][_0xb55b('0x47')]({'where':{'id':_0x2d49e4[_0xb55b('0x4a')]['id']}})[_0xb55b('0x25')](handleEntityNotFound(_0x1da8a7,null))[_0xb55b('0x25')](saveUpdates(_0x2d49e4['body'],null))[_0xb55b('0x25')](respondWithResult(_0x1da8a7,null))[_0xb55b('0x4b')](handleError(_0x1da8a7,null));};exports['destroy']=function(_0x31e3b6,_0x294faa){return db['VoiceMailMessage'][_0xb55b('0x47')]({'where':{'id':_0x31e3b6[_0xb55b('0x4a')]['id']}})[_0xb55b('0x25')](handleEntityNotFound(_0x294faa,null))['then'](removeEntity(_0x294faa,null))[_0xb55b('0x4b')](handleError(_0x294faa,null));};exports[_0xb55b('0x4c')]=function(_0x230373,_0x1d2c34,_0x7c8748){return db[_0xb55b('0x40')][_0xb55b('0x47')]({'where':{'id':_0x230373['params']['id']},'attributes':['id',_0xb55b('0x4d'),_0xb55b('0x4e')]})[_0xb55b('0x25')](handleEntityNotFound(_0x1d2c34,null))['then'](function(_0x9bc16b){if(_0x9bc16b){if(!_0x9bc16b[_0xb55b('0x4d')]){throw new db[(_0xb55b('0x4f'))][(_0xb55b('0x50'))](_0xb55b('0x51'));}var _0x1efe0c={'Content-Type':_0xb55b('0x52'),'Content-Disposition':'attachment'};if(_0x9bc16b[_0xb55b('0x4e')]){_0x1efe0c[_0xb55b('0x53')]='attachment;\x20filename=\x22'+_0x9bc16b[_0xb55b('0x4e')]+'.wav\x22';}_0x1d2c34[_0xb55b('0x1f')](_0x1efe0c);return _0x1d2c34[_0xb55b('0x2a')](new Buffer(_0x9bc16b[_0xb55b('0x4d')]));}})[_0xb55b('0x4b')](handleError(_0x1d2c34,null));}; \ No newline at end of file +var _0xa671=['request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','then','destroy','sendStatus','name','send','index','map','VoiceMailMessage','fieldName','key','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','include','show','params','rawAttributes','intersection','find','create','catch','update','body','download','recording','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','msg_id','attachment;\x20filename=\x22','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0xd61bf7,_0x572afc){var _0x36fd5d=function(_0x6ccbdf){while(--_0x6ccbdf){_0xd61bf7['push'](_0xd61bf7['shift']());}};_0x36fd5d(++_0x572afc);}(_0xa671,0x9c));var _0x1a67=function(_0x1a8396,_0x280126){_0x1a8396=_0x1a8396-0x0;var _0x29ce3=_0xa671[_0x1a8396];return _0x29ce3;};'use strict';var emlformat=require(_0x1a67('0x0'));var rimraf=require(_0x1a67('0x1'));var zipdir=require(_0x1a67('0x2'));var jsonpatch=require(_0x1a67('0x3'));var rp=require(_0x1a67('0x4'));var moment=require('moment');var BPromise=require(_0x1a67('0x5'));var Mustache=require(_0x1a67('0x6'));var util=require(_0x1a67('0x7'));var path=require('path');var sox=require(_0x1a67('0x8'));var csv=require(_0x1a67('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1a67('0xa'));var _=require(_0x1a67('0xb'));var squel=require('squel');var crypto=require(_0x1a67('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a67('0xd'));var toCsv=require(_0x1a67('0x9'));var querystring=require(_0x1a67('0xe'));var Papa=require(_0x1a67('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1a67('0x10'));var as=require(_0x1a67('0x11'));var hardwareService=require(_0x1a67('0x12'));var logger=require(_0x1a67('0x13'))(_0x1a67('0x14'));var utils=require(_0x1a67('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1a67('0x16'));var db=require(_0x1a67('0x17'))['db'];function respondWithStatusCode(_0x57eb72,_0x4ad06a){_0x4ad06a=_0x4ad06a||0xcc;return function(_0xbfe168){if(_0xbfe168){return _0x57eb72['sendStatus'](_0x4ad06a);}return _0x57eb72['status'](_0x4ad06a)[_0x1a67('0x18')]();};}function respondWithResult(_0x42fcc5,_0x5a85b2){_0x5a85b2=_0x5a85b2||0xc8;return function(_0x2bd675){if(_0x2bd675){return _0x42fcc5[_0x1a67('0x19')](_0x5a85b2)[_0x1a67('0x1a')](_0x2bd675);}};}function respondWithFilteredResult(_0xd2d7,_0xe5035a){return function(_0x975271){if(_0x975271){var _0x8391f1=typeof _0xe5035a[_0x1a67('0x1b')]===_0x1a67('0x1c')&&typeof _0xe5035a[_0x1a67('0x1d')]===_0x1a67('0x1c');var _0x1179cc=_0x975271['count'];var _0xaf9f88=_0x8391f1?0x0:_0xe5035a[_0x1a67('0x1b')];var _0x286288=_0x8391f1?_0x975271['count']:_0xe5035a[_0x1a67('0x1b')]+_0xe5035a[_0x1a67('0x1d')];var _0x3dfeaa;if(_0x286288>=_0x1179cc){_0x286288=_0x1179cc;_0x3dfeaa=0xc8;}else{_0x3dfeaa=0xce;}_0xd2d7[_0x1a67('0x19')](_0x3dfeaa);return _0xd2d7['set'](_0x1a67('0x1e'),_0xaf9f88+'-'+_0x286288+'/'+_0x1179cc)[_0x1a67('0x1a')](_0x975271);}return null;};}function patchUpdates(_0x3ed77c){return function(_0x2570e0){try{jsonpatch[_0x1a67('0x1f')](_0x2570e0,_0x3ed77c,!![]);}catch(_0x10b701){return BPromise[_0x1a67('0x20')](_0x10b701);}return _0x2570e0[_0x1a67('0x21')]();};}function saveUpdates(_0x787275,_0x35bd88){return function(_0x5e449b){if(_0x5e449b){return _0x5e449b['update'](_0x787275)[_0x1a67('0x22')](function(_0x20a9d2){return _0x20a9d2;});}return null;};}function removeEntity(_0x3a3664,_0x5613eb){return function(_0x4375ac){if(_0x4375ac){return _0x4375ac[_0x1a67('0x23')]()[_0x1a67('0x22')](function(){_0x3a3664[_0x1a67('0x19')](0xcc)[_0x1a67('0x18')]();});}};}function handleEntityNotFound(_0xcef8f5,_0x1a5fda){return function(_0x1cfd12){if(!_0x1cfd12){_0xcef8f5[_0x1a67('0x24')](0x194);}return _0x1cfd12;};}function handleError(_0x53666d,_0x3d52a0){_0x3d52a0=_0x3d52a0||0x1f4;return function(_0x49f979){logger['error'](_0x49f979['stack']);if(_0x49f979[_0x1a67('0x25')]){delete _0x49f979[_0x1a67('0x25')];}_0x53666d[_0x1a67('0x19')](_0x3d52a0)[_0x1a67('0x26')](_0x49f979);};}exports[_0x1a67('0x27')]=function(_0x8e6695,_0x5938bf){var _0x497c01={},_0x241364={},_0x45cdfe={'count':0x0,'rows':[]};var _0x1efb0f=_[_0x1a67('0x28')](db[_0x1a67('0x29')]['rawAttributes'],function(_0x5ac843){return{'name':_0x5ac843[_0x1a67('0x2a')],'type':_0x5ac843['type'][_0x1a67('0x2b')]};});_0x241364[_0x1a67('0x2c')]=_[_0x1a67('0x2d')](_[_0x1a67('0x28')](_0x1efb0f,_0x1a67('0x25')),[_0x1a67('0x25')]);_0x241364[_0x1a67('0x2e')]=_[_0x1a67('0x2f')](_0x8e6695[_0x1a67('0x2e')]);_0x241364[_0x1a67('0x30')]=_['intersection'](_0x241364[_0x1a67('0x2c')],_0x241364['query']);_0x497c01[_0x1a67('0x31')]=_['intersection'](_0x241364[_0x1a67('0x2c')],qs[_0x1a67('0x32')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x32')]));_0x497c01[_0x1a67('0x31')]=_0x497c01['attributes'][_0x1a67('0x33')]?_0x497c01[_0x1a67('0x31')]:_0x241364[_0x1a67('0x2c')];if(!_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x34')](_0x1a67('0x35'))){_0x497c01[_0x1a67('0x1d')]=qs[_0x1a67('0x1d')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x1d')]);_0x497c01[_0x1a67('0x1b')]=qs[_0x1a67('0x1b')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x1b')]);}_0x497c01[_0x1a67('0x36')]=qs[_0x1a67('0x37')](_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x37')]);_0x497c01['where']=qs[_0x1a67('0x30')](_[_0x1a67('0x38')](_0x8e6695[_0x1a67('0x2e')],_0x241364[_0x1a67('0x30')]),_0x1efb0f);if(_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x39')]){_0x497c01[_0x1a67('0x3a')]=_[_0x1a67('0x3b')](_0x497c01['where'],{'$or':_[_0x1a67('0x28')](_0x1efb0f,function(_0x27309d){if(_0x27309d['type']!==_0x1a67('0x3c')){var _0x3545a3={};_0x3545a3[_0x27309d[_0x1a67('0x25')]]={'$like':'%'+_0x8e6695[_0x1a67('0x2e')][_0x1a67('0x39')]+'%'};return _0x3545a3;}})});}_0x497c01=_[_0x1a67('0x3b')]({},_0x497c01,_0x8e6695[_0x1a67('0x3d')]);var _0x3991ea={'where':_0x497c01[_0x1a67('0x3a')]};return db[_0x1a67('0x29')][_0x1a67('0x3e')](_0x3991ea)[_0x1a67('0x22')](function(_0x46fbf5){_0x45cdfe[_0x1a67('0x3e')]=_0x46fbf5;if(_0x8e6695[_0x1a67('0x2e')]['includeAll']){_0x497c01[_0x1a67('0x3f')]=[{'all':!![]}];}return db[_0x1a67('0x29')]['findAll'](_0x497c01);})[_0x1a67('0x22')](function(_0xe1d23a){_0x45cdfe['rows']=_0xe1d23a;return _0x45cdfe;})[_0x1a67('0x22')](respondWithFilteredResult(_0x5938bf,_0x497c01))['catch'](handleError(_0x5938bf,null));};exports[_0x1a67('0x40')]=function(_0x1f00d2,_0x474b3d){var _0x2fdeb3={'raw':!![],'where':{'id':_0x1f00d2[_0x1a67('0x41')]['id']}},_0x5de4a0={};_0x5de4a0[_0x1a67('0x2c')]=_['keys'](db[_0x1a67('0x29')][_0x1a67('0x42')]);_0x5de4a0[_0x1a67('0x2e')]=_[_0x1a67('0x2f')](_0x1f00d2[_0x1a67('0x2e')]);_0x5de4a0['filters']=_[_0x1a67('0x43')](_0x5de4a0[_0x1a67('0x2c')],_0x5de4a0['query']);_0x2fdeb3['attributes']=_[_0x1a67('0x43')](_0x5de4a0[_0x1a67('0x2c')],qs['fields'](_0x1f00d2[_0x1a67('0x2e')][_0x1a67('0x32')]));_0x2fdeb3[_0x1a67('0x31')]=_0x2fdeb3[_0x1a67('0x31')][_0x1a67('0x33')]?_0x2fdeb3['attributes']:_0x5de4a0[_0x1a67('0x2c')];if(_0x1f00d2[_0x1a67('0x2e')]['includeAll']){_0x2fdeb3[_0x1a67('0x3f')]=[{'all':!![]}];}_0x2fdeb3=_[_0x1a67('0x3b')]({},_0x2fdeb3,_0x1f00d2[_0x1a67('0x3d')]);return db[_0x1a67('0x29')][_0x1a67('0x44')](_0x2fdeb3)['then'](handleEntityNotFound(_0x474b3d,null))[_0x1a67('0x22')](respondWithResult(_0x474b3d,null))['catch'](handleError(_0x474b3d,null));};exports[_0x1a67('0x45')]=function(_0x127453,_0x312abe){return db['VoiceMailMessage']['create'](_0x127453['body'],{})[_0x1a67('0x22')](respondWithResult(_0x312abe,0xc9))[_0x1a67('0x46')](handleError(_0x312abe,null));};exports[_0x1a67('0x47')]=function(_0x50c8ba,_0x139f0c){if(_0x50c8ba[_0x1a67('0x48')]['id']){delete _0x50c8ba[_0x1a67('0x48')]['id'];}return db[_0x1a67('0x29')][_0x1a67('0x44')]({'where':{'id':_0x50c8ba[_0x1a67('0x41')]['id']}})[_0x1a67('0x22')](handleEntityNotFound(_0x139f0c,null))[_0x1a67('0x22')](saveUpdates(_0x50c8ba['body'],null))[_0x1a67('0x22')](respondWithResult(_0x139f0c,null))['catch'](handleError(_0x139f0c,null));};exports[_0x1a67('0x23')]=function(_0x4a8f57,_0x3b4010){return db[_0x1a67('0x29')]['find']({'where':{'id':_0x4a8f57[_0x1a67('0x41')]['id']}})['then'](handleEntityNotFound(_0x3b4010,null))[_0x1a67('0x22')](removeEntity(_0x3b4010,null))[_0x1a67('0x46')](handleError(_0x3b4010,null));};exports[_0x1a67('0x49')]=function(_0x2c14ac,_0x35530d,_0x4258e1){return db[_0x1a67('0x29')]['find']({'where':{'id':_0x2c14ac[_0x1a67('0x41')]['id']},'attributes':['id',_0x1a67('0x4a'),'msg_id']})[_0x1a67('0x22')](handleEntityNotFound(_0x35530d,null))[_0x1a67('0x22')](function(_0x26de40){if(_0x26de40){if(!_0x26de40[_0x1a67('0x4a')]){throw new db['Sequelize'][(_0x1a67('0x4b'))](_0x1a67('0x4c'));}var _0x1765fd={'Content-Type':_0x1a67('0x4d'),'Content-Disposition':'attachment'};if(_0x26de40[_0x1a67('0x4e')]){_0x1765fd['Content-Disposition']=_0x1a67('0x4f')+_0x26de40[_0x1a67('0x4e')]+'.wav\x22';}_0x35530d['set'](_0x1765fd);return _0x35530d[_0x1a67('0x26')](new Buffer(_0x26de40[_0x1a67('0x4a')]));}})[_0x1a67('0x46')](handleError(_0x35530d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 8381f97..a591888 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 _0xba0d=['bluebird','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','api','moment'];(function(_0x45bcb1,_0x46cad0){var _0x4bd6a3=function(_0x1f197f){while(--_0x1f197f){_0x45bcb1['push'](_0x45bcb1['shift']());}};_0x4bd6a3(++_0x46cad0);}(_0xba0d,0x9d));var _0xdba0=function(_0x3f4fee,_0xf7d9a9){_0x3f4fee=_0x3f4fee-0x0;var _0x5dd69f=_0xba0d[_0x3f4fee];return _0x5dd69f;};'use strict';var _=require(_0xdba0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdba0('0x1'));var moment=require(_0xdba0('0x2'));var BPromise=require(_0xdba0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdba0('0x4'));var attributes=require(_0xdba0('0x5'));module[_0xdba0('0x6')]=function(_0x306e39,_0x2594a7){return _0x306e39[_0xdba0('0x7')](_0xdba0('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xdba0('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x2570=['util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceMailMessage.attributes','exports','VoiceMailMessage','dir','lodash'];(function(_0x4a74d6,_0x226bed){var _0x308b76=function(_0x576180){while(--_0x576180){_0x4a74d6['push'](_0x4a74d6['shift']());}};_0x308b76(++_0x226bed);}(_0x2570,0x14f));var _0x0257=function(_0x19ac6d,_0x3fe806){_0x19ac6d=_0x19ac6d-0x0;var _0x11a628=_0x2570[_0x19ac6d];return _0x11a628;};'use strict';var _=require(_0x0257('0x0'));var util=require(_0x0257('0x1'));var logger=require(_0x0257('0x2'))(_0x0257('0x3'));var moment=require(_0x0257('0x4'));var BPromise=require(_0x0257('0x5'));var rp=require(_0x0257('0x6'));var fs=require('fs');var path=require(_0x0257('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0257('0x8'));module[_0x0257('0x9')]=function(_0x270b49,_0x33a034){return _0x270b49['define'](_0x0257('0xa'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x0257('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 921bd85..17f12ca 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 _0xf15e=['../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x210ef0,_0x5634a5){var _0xb8ee17=function(_0x312284){while(--_0x312284){_0x210ef0['push'](_0x210ef0['shift']());}};_0xb8ee17(++_0x5634a5);}(_0xf15e,0x172));var _0xef15=function(_0x64b557,_0x4d60d3){_0x64b557=_0x64b557-0x0;var _0x13bc1f=_0xf15e[_0x64b557];return _0x13bc1f;};'use strict';var _=require(_0xef15('0x0'));var util=require(_0xef15('0x1'));var moment=require(_0xef15('0x2'));var BPromise=require('bluebird');var rs=require(_0xef15('0x3'));var fs=require('fs');var Redis=require(_0xef15('0x4'));var db=require(_0xef15('0x5'))['db'];var utils=require(_0xef15('0x6'));var logger=require('../../config/logger')(_0xef15('0x7'));var config=require(_0xef15('0x8'));var jayson=require(_0xef15('0x9'));var client=jayson[_0xef15('0xa')][_0xef15('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x201f0c,_0x340d45,_0x3445bc){return new BPromise(function(_0x4bd305,_0x33bae1){return client['request'](_0x201f0c,_0x3445bc)[_0xef15('0xc')](function(_0x1bee41){logger[_0xef15('0xd')](_0xef15('0xe'),_0x340d45,_0xef15('0xf'));logger[_0xef15('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x340d45,'request\x20sent',JSON['stringify'](_0x1bee41));if(_0x1bee41[_0xef15('0x11')]){if(_0x1bee41[_0xef15('0x11')][_0xef15('0x12')]===0x1f4){logger['error'](_0xef15('0xe'),_0x340d45,_0x1bee41[_0xef15('0x11')]['message']);return _0x33bae1(_0x1bee41[_0xef15('0x11')]['message']);}logger[_0xef15('0x11')](_0xef15('0xe'),_0x340d45,_0x1bee41[_0xef15('0x11')]['message']);return _0x4bd305(_0x1bee41['error'][_0xef15('0x13')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x340d45,_0xef15('0xf'));_0x4bd305(_0x1bee41[_0xef15('0x14')][_0xef15('0x13')]);}})['catch'](function(_0x3e2dcd){logger[_0xef15('0x11')](_0xef15('0xe'),_0x340d45,_0x3e2dcd);_0x33bae1(_0x3e2dcd);});});} \ No newline at end of file +var _0xc30b=['request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc30b,0x120));var _0xbc30=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xc30b[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xbc30('0x0'));var util=require(_0xbc30('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc30('0x2'));var fs=require('fs');var Redis=require(_0xbc30('0x3'));var db=require(_0xbc30('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc30('0x5'))(_0xbc30('0x6'));var config=require(_0xbc30('0x7'));var jayson=require(_0xbc30('0x8'));var client=jayson[_0xbc30('0x9')][_0xbc30('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1bacca,_0x2dd0cb,_0x5409ab){return new BPromise(function(_0x343502,_0x18480d){return client[_0xbc30('0xb')](_0x1bacca,_0x5409ab)[_0xbc30('0xc')](function(_0x3e8ea4){logger[_0xbc30('0xd')](_0xbc30('0xe'),_0x2dd0cb,_0xbc30('0xf'));logger[_0xbc30('0x10')](_0xbc30('0x11'),_0x2dd0cb,_0xbc30('0xf'),JSON['stringify'](_0x3e8ea4));if(_0x3e8ea4[_0xbc30('0x12')]){if(_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x13')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x2dd0cb,_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x14')]);return _0x18480d(_0x3e8ea4[_0xbc30('0x12')]['message']);}logger[_0xbc30('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x2dd0cb,_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x14')]);return _0x343502(_0x3e8ea4[_0xbc30('0x12')][_0xbc30('0x14')]);}else{logger[_0xbc30('0xd')]('VoiceMailMessage,\x20%s,\x20%s',_0x2dd0cb,'request\x20sent');_0x343502(_0x3e8ea4[_0xbc30('0x15')][_0xbc30('0x14')]);}})[_0xbc30('0x16')](function(_0xdf7be1){logger[_0xbc30('0x12')](_0xbc30('0xe'),_0x2dd0cb,_0xdf7be1);_0x18480d(_0xdf7be1);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index dec28d0..3100db5 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 _0x90a3=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','post','/:id/sounds','addSound','put','update','destroy','delete','/:id/sounds/:id2','removeSound'];(function(_0x257358,_0x4e1c0f){var _0x5ebd26=function(_0xee0391){while(--_0xee0391){_0x257358['push'](_0x257358['shift']());}};_0x5ebd26(++_0x4e1c0f);}(_0x90a3,0x170));var _0x390a=function(_0x418e4a,_0x27ffaa){_0x418e4a=_0x418e4a-0x0;var _0x554982=_0x90a3[_0x418e4a];return _0x554982;};'use strict';var multer=require(_0x390a('0x0'));var util=require(_0x390a('0x1'));var path=require(_0x390a('0x2'));var timeout=require(_0x390a('0x3'));var express=require(_0x390a('0x4'));var router=express['Router']();var fs_extra=require(_0x390a('0x5'));var auth=require(_0x390a('0x6'));var interaction=require(_0x390a('0x7'));var config=require(_0x390a('0x8'));var controller=require(_0x390a('0x9'));router[_0x390a('0xa')]('/',auth[_0x390a('0xb')](),controller['index']);router[_0x390a('0xa')](_0x390a('0xc'),auth[_0x390a('0xb')](),controller[_0x390a('0xd')]);router[_0x390a('0xa')]('/:id/sounds',auth[_0x390a('0xb')](),controller['getSounds']);router[_0x390a('0xe')]('/',auth[_0x390a('0xb')](),controller['create']);router['post'](_0x390a('0xf'),auth[_0x390a('0xb')](),controller[_0x390a('0x10')]);router[_0x390a('0x11')](_0x390a('0xc'),auth['isAuthenticated'](),controller[_0x390a('0x12')]);router['delete'](_0x390a('0xc'),auth[_0x390a('0xb')](),controller[_0x390a('0x13')]);router[_0x390a('0x14')](_0x390a('0x15'),auth['isAuthenticated'](),controller[_0x390a('0x16')]);module['exports']=router; \ No newline at end of file +var _0x87eb=['create','post','addSound','/:id','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','show','get','/:id/sounds'];(function(_0x202aa2,_0x584b66){var _0x4e8000=function(_0x400b30){while(--_0x400b30){_0x202aa2['push'](_0x202aa2['shift']());}};_0x4e8000(++_0x584b66);}(_0x87eb,0x81));var _0xb87e=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x87eb[_0x2d7f0e];return _0x110b07;};'use strict';var multer=require(_0xb87e('0x0'));var util=require(_0xb87e('0x1'));var path=require(_0xb87e('0x2'));var timeout=require(_0xb87e('0x3'));var express=require(_0xb87e('0x4'));var router=express[_0xb87e('0x5')]();var fs_extra=require(_0xb87e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xb87e('0x7'));var config=require(_0xb87e('0x8'));var controller=require(_0xb87e('0x9'));router['get']('/',auth[_0xb87e('0xa')](),controller[_0xb87e('0xb')]);router['get']('/:id',auth[_0xb87e('0xa')](),controller[_0xb87e('0xc')]);router[_0xb87e('0xd')](_0xb87e('0xe'),auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0xb87e('0xa')](),controller[_0xb87e('0xf')]);router[_0xb87e('0x10')]('/:id/sounds',auth[_0xb87e('0xa')](),controller[_0xb87e('0x11')]);router['put'](_0xb87e('0x12'),auth[_0xb87e('0xa')](),controller[_0xb87e('0x13')]);router[_0xb87e('0x14')](_0xb87e('0x12'),auth[_0xb87e('0xa')](),controller[_0xb87e('0x15')]);router[_0xb87e('0x14')](_0xb87e('0x16'),auth[_0xb87e('0xa')](),controller[_0xb87e('0x17')]);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 aac248c..eedef7e 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 _0x18e7=['files','mp3nb','quietmp3nb','quietmp3','mp3','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x18e7,0x1c3));var _0x718e=function(_0x264608,_0x2bf281){_0x264608=_0x264608-0x0;var _0x5187be=_0x18e7[_0x264608];return _0x5187be;};'use strict';var Sequelize=require(_0x718e('0x0'));module[_0x718e('0x1')]={'name':{'type':Sequelize[_0x718e('0x2')],'allowNull':![],'unique':_0x718e('0x3')},'mode':{'type':Sequelize[_0x718e('0x4')]('custom',_0x718e('0x5'),_0x718e('0x6'),_0x718e('0x7'),_0x718e('0x8'),_0x718e('0x9')),'allowNull':!![],'defaultValue':_0x718e('0x5')},'directory':{'type':Sequelize[_0x718e('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x718e('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x718e('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x718e('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x718e('0x2')],'allowNull':!![]},'stamp':{'type':_0x718e('0xa')},'defaultEntry':{'type':Sequelize[_0x718e('0xb')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa0c7=['BOOLEAN','sequelize','exports','STRING','name','custom','files','mp3nb','quietmp3nb','alpha'];(function(_0x14d402,_0x5d4672){var _0x27e28d=function(_0x2db5f5){while(--_0x2db5f5){_0x14d402['push'](_0x14d402['shift']());}};_0x27e28d(++_0x5d4672);}(_0xa0c7,0x14b));var _0x7a0c=function(_0x251304,_0x4faf19){_0x251304=_0x251304-0x0;var _0x201b58=_0xa0c7[_0x251304];return _0x201b58;};'use strict';var Sequelize=require(_0x7a0c('0x0'));module[_0x7a0c('0x1')]={'name':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':![],'unique':_0x7a0c('0x3')},'mode':{'type':Sequelize['ENUM'](_0x7a0c('0x4'),_0x7a0c('0x5'),_0x7a0c('0x6'),_0x7a0c('0x7'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x7a0c('0x5')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![],'defaultValue':_0x7a0c('0x8')},'format':{'type':Sequelize[_0x7a0c('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0x7a0c('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 54a8ba4..3e20564 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 _0x80cc=['update','destroy','get','MusicOnHolds','then','error','name','send','index','VoiceMusicOnHold','rawAttributes','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','body','find','transaction','mode','join','server/files/moh','create','mkdirSync','directory','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','forEach','ValidationError','message','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','root','symlinkSync','Sequelize','removeSound','findOne','id2','getSounds','Sound','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','json','apply','reject','save'];(function(_0x280820,_0xce9bc7){var _0x474787=function(_0x3d224e){while(--_0x3d224e){_0x280820['push'](_0x280820['shift']());}};_0x474787(++_0xce9bc7);}(_0x80cc,0x12a));var _0xc80c=function(_0x5e76f4,_0x13a5c5){_0x5e76f4=_0x5e76f4-0x0;var _0x2c550b=_0x80cc[_0x5e76f4];return _0x2c550b;};'use strict';var emlformat=require(_0xc80c('0x0'));var rimraf=require(_0xc80c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc80c('0x2'));var rp=require(_0xc80c('0x3'));var moment=require(_0xc80c('0x4'));var BPromise=require(_0xc80c('0x5'));var Mustache=require('mustache');var util=require(_0xc80c('0x6'));var path=require('path');var sox=require(_0xc80c('0x7'));var csv=require('to-csv');var ejs=require(_0xc80c('0x8'));var fs=require('fs');var fs_extra=require(_0xc80c('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc80c('0xa'));var jsforce=require(_0xc80c('0xb'));var deskjs=require(_0xc80c('0xc'));var toCsv=require(_0xc80c('0xd'));var querystring=require(_0xc80c('0xe'));var Papa=require('papaparse');var Redis=require(_0xc80c('0xf'));var authService=require(_0xc80c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc80c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc80c('0x12'))(_0xc80c('0x13'));var utils=require('../../config/utils');var config=require(_0xc80c('0x14'));var licenseUtil=require(_0xc80c('0x15'));var db=require(_0xc80c('0x16'))['db'];function respondWithStatusCode(_0x34c426,_0x1fa28b){_0x1fa28b=_0x1fa28b||0xcc;return function(_0x3fe4df){if(_0x3fe4df){return _0x34c426[_0xc80c('0x17')](_0x1fa28b);}return _0x34c426['status'](_0x1fa28b)[_0xc80c('0x18')]();};}function respondWithResult(_0x48e7a8,_0x3696e7){_0x3696e7=_0x3696e7||0xc8;return function(_0x22db4e){if(_0x22db4e){return _0x48e7a8[_0xc80c('0x19')](_0x3696e7)['json'](_0x22db4e);}};}function respondWithFilteredResult(_0x1f2b6f,_0x5067d0){return function(_0x426543){if(_0x426543){var _0x2b2f75=typeof _0x5067d0[_0xc80c('0x1a')]==='undefined'&&typeof _0x5067d0[_0xc80c('0x1b')]===_0xc80c('0x1c');var _0x34b703=_0x426543[_0xc80c('0x1d')];var _0x2e99a6=_0x2b2f75?0x0:_0x5067d0[_0xc80c('0x1a')];var _0x4eb9fe=_0x2b2f75?_0x426543['count']:_0x5067d0['offset']+_0x5067d0[_0xc80c('0x1b')];var _0x2782ac;if(_0x4eb9fe>=_0x34b703){_0x4eb9fe=_0x34b703;_0x2782ac=0xc8;}else{_0x2782ac=0xce;}_0x1f2b6f[_0xc80c('0x19')](_0x2782ac);return _0x1f2b6f[_0xc80c('0x1e')]('Content-Range',_0x2e99a6+'-'+_0x4eb9fe+'/'+_0x34b703)[_0xc80c('0x1f')](_0x426543);}return null;};}function patchUpdates(_0x38df54){return function(_0x16c5ef){try{jsonpatch[_0xc80c('0x20')](_0x16c5ef,_0x38df54,!![]);}catch(_0x2c6fa9){return BPromise[_0xc80c('0x21')](_0x2c6fa9);}return _0x16c5ef[_0xc80c('0x22')]();};}function saveUpdates(_0x38b5e6,_0x399c7a){return function(_0xf6f6d){if(_0xf6f6d){return _0xf6f6d[_0xc80c('0x23')](_0x38b5e6)['then'](function(_0x392851){return _0x392851;});}return null;};}function removeEntity(_0x519a62,_0x4515de){return function(_0x9dc735){if(_0x9dc735){return _0x9dc735[_0xc80c('0x24')]()['then'](function(){var _0x48e38d=_0x9dc735[_0xc80c('0x25')]({'plain':!![]});var _0x2aaba2=_0xc80c('0x26');return db['UserProfileResource'][_0xc80c('0x24')]({'where':{'type':_0x2aaba2,'resourceId':_0x48e38d['id']}})[_0xc80c('0x27')](function(){return _0x9dc735;});})['then'](function(){_0x519a62[_0xc80c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267d5f,_0x3cbf76){return function(_0xf3d2f1){if(!_0xf3d2f1){_0x267d5f[_0xc80c('0x17')](0x194);}return _0xf3d2f1;};}function handleError(_0x4db56e,_0x14cc3e){_0x14cc3e=_0x14cc3e||0x1f4;return function(_0x5e4429){logger[_0xc80c('0x28')](_0x5e4429['stack']);if(_0x5e4429[_0xc80c('0x29')]){delete _0x5e4429[_0xc80c('0x29')];}_0x4db56e[_0xc80c('0x19')](_0x14cc3e)[_0xc80c('0x2a')](_0x5e4429);};}exports[_0xc80c('0x2b')]=function(_0x4ad5e7,_0x2553ba){var _0x40bc50={},_0x435ad5={},_0x46b6d3={'count':0x0,'rows':[]};var _0x1a1778=_['map'](db[_0xc80c('0x2c')][_0xc80c('0x2d')],function(_0x264ed4){return{'name':_0x264ed4['fieldName'],'type':_0x264ed4[_0xc80c('0x2e')]['key']};});_0x435ad5[_0xc80c('0x2f')]=_[_0xc80c('0x30')](_0x1a1778,_0xc80c('0x29'));_0x435ad5['query']=_[_0xc80c('0x31')](_0x4ad5e7[_0xc80c('0x32')]);_0x435ad5['filters']=_[_0xc80c('0x33')](_0x435ad5[_0xc80c('0x2f')],_0x435ad5[_0xc80c('0x32')]);_0x40bc50[_0xc80c('0x34')]=_[_0xc80c('0x33')](_0x435ad5[_0xc80c('0x2f')],qs['fields'](_0x4ad5e7[_0xc80c('0x32')][_0xc80c('0x35')]));_0x40bc50[_0xc80c('0x34')]=_0x40bc50[_0xc80c('0x34')][_0xc80c('0x36')]?_0x40bc50[_0xc80c('0x34')]:_0x435ad5[_0xc80c('0x2f')];if(!_0x4ad5e7[_0xc80c('0x32')][_0xc80c('0x37')](_0xc80c('0x38'))){_0x40bc50[_0xc80c('0x1b')]=qs['limit'](_0x4ad5e7['query'][_0xc80c('0x1b')]);_0x40bc50[_0xc80c('0x1a')]=qs[_0xc80c('0x1a')](_0x4ad5e7[_0xc80c('0x32')][_0xc80c('0x1a')]);}_0x40bc50[_0xc80c('0x39')]=qs[_0xc80c('0x3a')](_0x4ad5e7[_0xc80c('0x32')][_0xc80c('0x3a')]);delete _0x4ad5e7[_0xc80c('0x32')]['sort'];_0x40bc50[_0xc80c('0x3b')]=qs[_0xc80c('0x3c')](_[_0xc80c('0x3d')](_0x4ad5e7['query'],_0x435ad5[_0xc80c('0x3c')]),_0x1a1778);if(_0x4ad5e7[_0xc80c('0x32')][_0xc80c('0x3e')]){_0x40bc50['where']=_[_0xc80c('0x3f')](_0x40bc50[_0xc80c('0x3b')],{'$or':_['map'](_0x1a1778,function(_0x27d45c){if(_0x27d45c[_0xc80c('0x2e')]!==_0xc80c('0x40')){var _0x52992a={};_0x52992a[_0x27d45c['name']]={'$like':'%'+_0x4ad5e7[_0xc80c('0x32')]['filter']+'%'};return _0x52992a;}})});}_0x40bc50=_[_0xc80c('0x3f')]({},_0x40bc50,_0x4ad5e7[_0xc80c('0x41')]);var _0x29e358={'where':_0x40bc50[_0xc80c('0x3b')]};return db['VoiceMusicOnHold'][_0xc80c('0x1d')](_0x29e358)[_0xc80c('0x27')](function(_0x42da46){_0x46b6d3['count']=_0x42da46;if(_0x4ad5e7[_0xc80c('0x32')]['includeAll']){_0x40bc50[_0xc80c('0x42')]=[{'all':!![]}];}return db[_0xc80c('0x2c')]['findAll'](_0x40bc50);})[_0xc80c('0x27')](function(_0x38c41b){_0x46b6d3[_0xc80c('0x43')]=_0x38c41b;return _0x46b6d3;})[_0xc80c('0x27')](respondWithFilteredResult(_0x2553ba,_0x40bc50))[_0xc80c('0x44')](handleError(_0x2553ba,null));};exports[_0xc80c('0x45')]=function(_0x339813,_0x23d081){var _0x1571f2={'raw':![],'where':{'id':_0x339813[_0xc80c('0x46')]['id']}},_0xabc88e={};_0xabc88e[_0xc80c('0x2f')]=_[_0xc80c('0x31')](db['VoiceMusicOnHold'][_0xc80c('0x2d')]);_0xabc88e[_0xc80c('0x32')]=_[_0xc80c('0x31')](_0x339813[_0xc80c('0x32')]);_0xabc88e[_0xc80c('0x3c')]=_[_0xc80c('0x33')](_0xabc88e[_0xc80c('0x2f')],_0xabc88e[_0xc80c('0x32')]);_0x1571f2[_0xc80c('0x34')]=_['intersection'](_0xabc88e[_0xc80c('0x2f')],qs[_0xc80c('0x35')](_0x339813[_0xc80c('0x32')][_0xc80c('0x35')]));_0x1571f2[_0xc80c('0x34')]=_0x1571f2[_0xc80c('0x34')][_0xc80c('0x36')]?_0x1571f2[_0xc80c('0x34')]:_0xabc88e[_0xc80c('0x2f')];if(_0x339813['query'][_0xc80c('0x47')]){_0x1571f2[_0xc80c('0x42')]=[{'all':!![]}];}_0x1571f2=_[_0xc80c('0x3f')]({},_0x1571f2,_0x339813[_0xc80c('0x41')]);return db[_0xc80c('0x2c')]['find'](_0x1571f2)[_0xc80c('0x27')](handleEntityNotFound(_0x23d081,null))[_0xc80c('0x27')](respondWithResult(_0x23d081,null))[_0xc80c('0x44')](handleError(_0x23d081,null));};exports[_0xc80c('0x23')]=function(_0x5c34b4,_0xd31f80){if(_0x5c34b4[_0xc80c('0x48')]['id']){delete _0x5c34b4[_0xc80c('0x48')]['id'];}return db['VoiceMusicOnHold'][_0xc80c('0x49')]({'where':{'id':_0x5c34b4[_0xc80c('0x46')]['id']}})['then'](handleEntityNotFound(_0xd31f80,null))[_0xc80c('0x27')](saveUpdates(_0x5c34b4[_0xc80c('0x48')],null))[_0xc80c('0x27')](respondWithResult(_0xd31f80,null))['catch'](handleError(_0xd31f80,null));};exports['create']=function(_0x575677,_0x5547ba,_0x47b8e6){return db['sequelize'][_0xc80c('0x4a')](function(_0x2b4f9b){if(_0x575677[_0xc80c('0x48')][_0xc80c('0x4b')]==='files'){_0x575677[_0xc80c('0x48')]['directory']=path[_0xc80c('0x4c')](config['root'],_0xc80c('0x4d'),_0x575677[_0xc80c('0x48')][_0xc80c('0x29')]);}return db[_0xc80c('0x2c')][_0xc80c('0x4e')](_0x575677[_0xc80c('0x48')],{'transaction':_0x2b4f9b})[_0xc80c('0x27')](function(_0x26d69f){if(_0x575677[_0xc80c('0x48')][_0xc80c('0x4b')]==='files'){fs[_0xc80c('0x4f')](_0x26d69f[_0xc80c('0x50')],parseInt(_0xc80c('0x51'),0x8));}var _0x415cba=_0x575677[_0xc80c('0x52')]['get']({'plain':!![]});if(!_0x415cba)throw new Error(_0xc80c('0x53'));if(_0x415cba[_0xc80c('0x54')]===_0xc80c('0x52')){var _0x4e7367=_0x26d69f[_0xc80c('0x25')]({'plain':!![]});return db[_0xc80c('0x55')][_0xc80c('0x49')]({'where':{'name':_0xc80c('0x26'),'userProfileId':_0x415cba[_0xc80c('0x56')]},'raw':!![]})[_0xc80c('0x27')](function(_0x552c80){if(_0x552c80&&_0x552c80[_0xc80c('0x57')]===0x0){return db[_0xc80c('0x58')][_0xc80c('0x4e')]({'name':_0x4e7367[_0xc80c('0x29')],'resourceId':_0x4e7367['id'],'type':_0x552c80[_0xc80c('0x29')],'sectionId':_0x552c80['id']},{})[_0xc80c('0x27')](function(){return _0x26d69f;});}else{return _0x26d69f;}})['catch'](function(_0x2ac495){logger[_0xc80c('0x28')](_0xc80c('0x59'),_0x2ac495);});}return _0x26d69f;});})[_0xc80c('0x27')](respondWithResult(_0x5547ba,0xc9))[_0xc80c('0x44')](handleError(_0x5547ba,null));};exports[_0xc80c('0x24')]=function(_0x5aa6ba,_0x52096a,_0x862f63){var _0x39f66e;return db[_0xc80c('0x2c')]['find']({'where':{'id':_0x5aa6ba['params']['id']}})[_0xc80c('0x27')](function(_0xb0fd3c){if(_0xb0fd3c){return db[_0xc80c('0x5a')][_0xc80c('0x4a')](function(_0x2c5932){return _0xb0fd3c[_0xc80c('0x24')]({'transaction':_0x2c5932,'raw':!![]})[_0xc80c('0x27')](function(_0x438400){if(_0x438400[_0xc80c('0x50')]){fs['readdirSync'](_0x438400[_0xc80c('0x50')])[_0xc80c('0x5b')](function(_0x207b6e){fs['unlinkSync'](path[_0xc80c('0x4c')](_0x438400[_0xc80c('0x50')],_0x207b6e));});fs['rmdirSync'](_0x438400[_0xc80c('0x50')]);}return _0x438400;});})[_0xc80c('0x44')](function(_0x148f03){throw new db['Sequelize'][(_0xc80c('0x5c'))](_0x148f03[_0xc80c('0x5d')]);});}})[_0xc80c('0x27')](handleEntityNotFound(_0x52096a,null))['then'](removeEntity(_0x52096a,null))[_0xc80c('0x44')](handleError(_0x52096a,null));};exports[_0xc80c('0x5e')]=function(_0x246026,_0x2bf8c9,_0x324883){return db[_0xc80c('0x5a')][_0xc80c('0x4a')](function(_0x146ec4){var _0x59ae31;return db['VoiceMusicOnHold'][_0xc80c('0x49')]({'where':{'id':_0x246026['params']['id']}})[_0xc80c('0x27')](function(_0x1ee359){if(_0x1ee359){_0x59ae31=_0x1ee359;return _0x1ee359['addSound'](_0x246026[_0xc80c('0x48')]['id'],{'transaction':_0x146ec4});}})[_0xc80c('0x27')](function(_0x7fe592){if(_0x7fe592){return db['Sound']['findOne']({'where':{'id':_0x246026[_0xc80c('0x48')]['id']},'attributes':['id',_0xc80c('0x29'),_0xc80c('0x5f'),_0xc80c('0x60'),_0xc80c('0x61')],'raw':!![]});}})['then'](function(_0x64b145){if(_0x64b145){var _0x29493b=path[_0xc80c('0x4c')](config['root'],_0xc80c('0x62'),util[_0xc80c('0x63')](_0xc80c('0x64'),path[_0xc80c('0x65')](_0x64b145[_0xc80c('0x5f')],path[_0xc80c('0x66')](_0x64b145['save_name'])),_0x64b145[_0xc80c('0x60')]));var _0x21c7f8=path['join'](config[_0xc80c('0x67')],_0xc80c('0x4d'),_0x59ae31['name'],util[_0xc80c('0x63')]('%s.%s',_0x64b145['name'],_0x64b145[_0xc80c('0x60')]));fs[_0xc80c('0x68')](_0x29493b,_0x21c7f8);return _0x64b145;}})['catch'](function(_0x4de142){throw new db[(_0xc80c('0x69'))]['ValidationError'](_0x4de142['message']);});})[_0xc80c('0x27')](handleEntityNotFound(_0x2bf8c9,null))['then'](respondWithResult(_0x2bf8c9,0xc9))[_0xc80c('0x44')](handleError(_0x2bf8c9,null));};exports[_0xc80c('0x6a')]=function(_0x54c0b6,_0x43db70,_0x3e3d14){return db[_0xc80c('0x5a')]['transaction'](function(_0x46c29f){var _0x181b02;return db[_0xc80c('0x2c')][_0xc80c('0x6b')]({'where':{'id':_0x54c0b6[_0xc80c('0x46')]['id']}})[_0xc80c('0x27')](handleEntityNotFound(_0x43db70,null))[_0xc80c('0x27')](function(_0x82fc5){if(_0x82fc5){_0x181b02=_0x82fc5;return _0x82fc5[_0xc80c('0x6a')](_0x54c0b6['params'][_0xc80c('0x6c')]);}})['then'](function(_0x47673a){if(_0x47673a){return db['Sound']['findOne']({'where':{'id':_0x54c0b6['params'][_0xc80c('0x6c')]},'attributes':['id',_0xc80c('0x29'),_0xc80c('0x5f'),'converted_format','createdAt'],'raw':!![]});}})['then'](function(_0x24c77a){if(_0x24c77a){fs['unlinkSync'](path[_0xc80c('0x4c')](_0x181b02[_0xc80c('0x50')],util[_0xc80c('0x63')](_0xc80c('0x64'),_0x24c77a['name'],_0x24c77a['converted_format'])));return _0x24c77a;}})[_0xc80c('0x44')](function(_0x5b7c70){throw new db[(_0xc80c('0x69'))][(_0xc80c('0x5c'))](_0x5b7c70[_0xc80c('0x5d')]);});})[_0xc80c('0x27')](handleEntityNotFound(_0x43db70,null))[_0xc80c('0x27')](respondWithStatusCode(_0x43db70,0xcc))[_0xc80c('0x44')](handleError(_0x43db70,null));};exports[_0xc80c('0x6d')]=function(_0x3349d4,_0x432e51,_0x18b0ac){var _0x461efe={};var _0x4312cc={};var _0x483874;var _0x2c41f7;return db['VoiceMusicOnHold'][_0xc80c('0x6b')]({'where':{'id':_0x3349d4[_0xc80c('0x46')]['id']}})[_0xc80c('0x27')](handleEntityNotFound(_0x432e51,null))['then'](function(_0x2d7b53){if(_0x2d7b53){_0x483874=_0x2d7b53;_0x4312cc[_0xc80c('0x2f')]=_[_0xc80c('0x31')](db[_0xc80c('0x6e')][_0xc80c('0x2d')]);_0x4312cc[_0xc80c('0x32')]=_[_0xc80c('0x31')](_0x3349d4['query']);_0x4312cc[_0xc80c('0x3c')]=_['intersection'](_0x4312cc[_0xc80c('0x2f')],_0x4312cc[_0xc80c('0x32')]);_0x461efe['attributes']=_[_0xc80c('0x33')](_0x4312cc['model'],qs[_0xc80c('0x35')](_0x3349d4[_0xc80c('0x32')]['fields']));_0x461efe[_0xc80c('0x34')]=_0x461efe[_0xc80c('0x34')][_0xc80c('0x36')]?_0x461efe[_0xc80c('0x34')]:_0x4312cc[_0xc80c('0x2f')];_0x461efe[_0xc80c('0x39')]=qs['sort'](_0x3349d4[_0xc80c('0x32')]['sort']);_0x461efe[_0xc80c('0x3b')]=qs[_0xc80c('0x3c')](_[_0xc80c('0x3d')](_0x3349d4[_0xc80c('0x32')],_0x4312cc[_0xc80c('0x3c')]));if(_0x3349d4[_0xc80c('0x32')][_0xc80c('0x3e')]){_0x461efe[_0xc80c('0x3b')]=_[_0xc80c('0x3f')](_0x461efe[_0xc80c('0x3b')],{'$or':_[_0xc80c('0x30')](_0x461efe['attributes'],function(_0x37d1a4){var _0x4f15cc={};_0x4f15cc[_0x37d1a4]={'$like':'%'+_0x3349d4[_0xc80c('0x32')][_0xc80c('0x3e')]+'%'};return _0x4f15cc;})});}_0x461efe=_[_0xc80c('0x3f')]({},_0x461efe,_0x3349d4['options']);return _0x483874['getSounds'](_0x461efe);}})[_0xc80c('0x27')](function(_0x5d764d){if(_0x5d764d){_0x2c41f7=_0x5d764d[_0xc80c('0x36')];if(!_0x3349d4[_0xc80c('0x32')][_0xc80c('0x37')](_0xc80c('0x38'))){_0x461efe['limit']=qs[_0xc80c('0x1b')](_0x3349d4[_0xc80c('0x32')][_0xc80c('0x1b')]);_0x461efe[_0xc80c('0x1a')]=qs['offset'](_0x3349d4[_0xc80c('0x32')][_0xc80c('0x1a')]);}return _0x483874['getSounds'](_0x461efe);}})[_0xc80c('0x27')](function(_0x5db2c8){if(_0x5db2c8){return _0x5db2c8?{'count':_0x2c41f7,'rows':_0x5db2c8}:null;}})['then'](respondWithResult(_0x432e51,null))[_0xc80c('0x44')](handleError(_0x432e51,null));}; \ No newline at end of file +var _0xbad2=['bluebird','mustache','util','path','sox','ejs','fs-extra','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','MusicOnHolds','error','stack','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','find','body','create','transaction','files','directory','join','root','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','addSound','findOne','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','converted_format','symlinkSync','message','removeSound','id2','Sound','order','pick','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x18a091,_0x288fbc){var _0x2d94c1=function(_0x4fec8d){while(--_0x4fec8d){_0x18a091['push'](_0x18a091['shift']());}};_0x2d94c1(++_0x288fbc);}(_0xbad2,0xde));var _0x2bad=function(_0x5e7308,_0x384a22){_0x5e7308=_0x5e7308-0x0;var _0x330e7e=_0xbad2[_0x5e7308];return _0x330e7e;};'use strict';var emlformat=require(_0x2bad('0x0'));var rimraf=require(_0x2bad('0x1'));var zipdir=require(_0x2bad('0x2'));var jsonpatch=require(_0x2bad('0x3'));var rp=require(_0x2bad('0x4'));var moment=require(_0x2bad('0x5'));var BPromise=require(_0x2bad('0x6'));var Mustache=require(_0x2bad('0x7'));var util=require(_0x2bad('0x8'));var path=require(_0x2bad('0x9'));var sox=require(_0x2bad('0xa'));var csv=require('to-csv');var ejs=require(_0x2bad('0xb'));var fs=require('fs');var fs_extra=require(_0x2bad('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2bad('0xd'));var deskjs=require(_0x2bad('0xe'));var toCsv=require(_0x2bad('0xf'));var querystring=require(_0x2bad('0x10'));var Papa=require(_0x2bad('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2bad('0x12'));var as=require(_0x2bad('0x13'));var hardwareService=require(_0x2bad('0x14'));var logger=require(_0x2bad('0x15'))(_0x2bad('0x16'));var utils=require(_0x2bad('0x17'));var config=require(_0x2bad('0x18'));var licenseUtil=require(_0x2bad('0x19'));var db=require(_0x2bad('0x1a'))['db'];function respondWithStatusCode(_0x54fd81,_0x34a382){_0x34a382=_0x34a382||0xcc;return function(_0x517b77){if(_0x517b77){return _0x54fd81[_0x2bad('0x1b')](_0x34a382);}return _0x54fd81['status'](_0x34a382)[_0x2bad('0x1c')]();};}function respondWithResult(_0x5d7569,_0x2381ee){_0x2381ee=_0x2381ee||0xc8;return function(_0x5b2044){if(_0x5b2044){return _0x5d7569[_0x2bad('0x1d')](_0x2381ee)['json'](_0x5b2044);}};}function respondWithFilteredResult(_0x17f7d9,_0xe8ab02){return function(_0x2d3ac7){if(_0x2d3ac7){var _0x3b1ec9=typeof _0xe8ab02[_0x2bad('0x1e')]==='undefined'&&typeof _0xe8ab02[_0x2bad('0x1f')]==='undefined';var _0x212965=_0x2d3ac7[_0x2bad('0x20')];var _0x408b3a=_0x3b1ec9?0x0:_0xe8ab02[_0x2bad('0x1e')];var _0x5958c5=_0x3b1ec9?_0x2d3ac7[_0x2bad('0x20')]:_0xe8ab02['offset']+_0xe8ab02[_0x2bad('0x1f')];var _0x59b0ec;if(_0x5958c5>=_0x212965){_0x5958c5=_0x212965;_0x59b0ec=0xc8;}else{_0x59b0ec=0xce;}_0x17f7d9[_0x2bad('0x1d')](_0x59b0ec);return _0x17f7d9[_0x2bad('0x21')](_0x2bad('0x22'),_0x408b3a+'-'+_0x5958c5+'/'+_0x212965)[_0x2bad('0x23')](_0x2d3ac7);}return null;};}function patchUpdates(_0xbb5fdb){return function(_0x3d65dc){try{jsonpatch['apply'](_0x3d65dc,_0xbb5fdb,!![]);}catch(_0x31b6da){return BPromise[_0x2bad('0x24')](_0x31b6da);}return _0x3d65dc[_0x2bad('0x25')]();};}function saveUpdates(_0x485238,_0x5a9e80){return function(_0x2c3a30){if(_0x2c3a30){return _0x2c3a30[_0x2bad('0x26')](_0x485238)[_0x2bad('0x27')](function(_0x392457){return _0x392457;});}return null;};}function removeEntity(_0xe6d322,_0x52c235){return function(_0x5554c3){if(_0x5554c3){return _0x5554c3[_0x2bad('0x28')]()[_0x2bad('0x27')](function(){var _0x3ac4b6=_0x5554c3[_0x2bad('0x29')]({'plain':!![]});var _0x2d0269=_0x2bad('0x2a');return db['UserProfileResource'][_0x2bad('0x28')]({'where':{'type':_0x2d0269,'resourceId':_0x3ac4b6['id']}})[_0x2bad('0x27')](function(){return _0x5554c3;});})[_0x2bad('0x27')](function(){_0xe6d322[_0x2bad('0x1d')](0xcc)[_0x2bad('0x1c')]();});}};}function handleEntityNotFound(_0x12fd05,_0x4aa0f4){return function(_0x20572b){if(!_0x20572b){_0x12fd05[_0x2bad('0x1b')](0x194);}return _0x20572b;};}function handleError(_0x14e41f,_0x7ed74){_0x7ed74=_0x7ed74||0x1f4;return function(_0x31e112){logger[_0x2bad('0x2b')](_0x31e112[_0x2bad('0x2c')]);if(_0x31e112['name']){delete _0x31e112[_0x2bad('0x2d')];}_0x14e41f[_0x2bad('0x1d')](_0x7ed74)[_0x2bad('0x2e')](_0x31e112);};}exports['index']=function(_0x552de7,_0x1b7b7c){var _0x154d89={},_0x280c34={},_0x3bfaf0={'count':0x0,'rows':[]};var _0x485e1c=_[_0x2bad('0x2f')](db[_0x2bad('0x30')][_0x2bad('0x31')],function(_0x147da9){return{'name':_0x147da9[_0x2bad('0x32')],'type':_0x147da9[_0x2bad('0x33')]['key']};});_0x280c34[_0x2bad('0x34')]=_['map'](_0x485e1c,_0x2bad('0x2d'));_0x280c34['query']=_[_0x2bad('0x35')](_0x552de7[_0x2bad('0x36')]);_0x280c34['filters']=_[_0x2bad('0x37')](_0x280c34[_0x2bad('0x34')],_0x280c34[_0x2bad('0x36')]);_0x154d89[_0x2bad('0x38')]=_[_0x2bad('0x37')](_0x280c34[_0x2bad('0x34')],qs['fields'](_0x552de7[_0x2bad('0x36')][_0x2bad('0x39')]));_0x154d89[_0x2bad('0x38')]=_0x154d89[_0x2bad('0x38')][_0x2bad('0x3a')]?_0x154d89[_0x2bad('0x38')]:_0x280c34[_0x2bad('0x34')];if(!_0x552de7[_0x2bad('0x36')][_0x2bad('0x3b')]('nolimit')){_0x154d89[_0x2bad('0x1f')]=qs[_0x2bad('0x1f')](_0x552de7[_0x2bad('0x36')][_0x2bad('0x1f')]);_0x154d89[_0x2bad('0x1e')]=qs[_0x2bad('0x1e')](_0x552de7['query'][_0x2bad('0x1e')]);}_0x154d89['order']=qs['sort'](_0x552de7[_0x2bad('0x36')][_0x2bad('0x3c')]);delete _0x552de7['query'][_0x2bad('0x3c')];_0x154d89[_0x2bad('0x3d')]=qs[_0x2bad('0x3e')](_['pick'](_0x552de7[_0x2bad('0x36')],_0x280c34[_0x2bad('0x3e')]),_0x485e1c);if(_0x552de7[_0x2bad('0x36')]['filter']){_0x154d89[_0x2bad('0x3d')]=_[_0x2bad('0x3f')](_0x154d89[_0x2bad('0x3d')],{'$or':_[_0x2bad('0x2f')](_0x485e1c,function(_0x41b4a5){if(_0x41b4a5[_0x2bad('0x33')]!==_0x2bad('0x40')){var _0x5c682c={};_0x5c682c[_0x41b4a5[_0x2bad('0x2d')]]={'$like':'%'+_0x552de7[_0x2bad('0x36')][_0x2bad('0x41')]+'%'};return _0x5c682c;}})});}_0x154d89=_[_0x2bad('0x3f')]({},_0x154d89,_0x552de7[_0x2bad('0x42')]);var _0x11e581={'where':_0x154d89['where']};return db[_0x2bad('0x30')][_0x2bad('0x20')](_0x11e581)[_0x2bad('0x27')](function(_0x49a893){_0x3bfaf0[_0x2bad('0x20')]=_0x49a893;if(_0x552de7['query'][_0x2bad('0x43')]){_0x154d89[_0x2bad('0x44')]=[{'all':!![]}];}return db[_0x2bad('0x30')][_0x2bad('0x45')](_0x154d89);})[_0x2bad('0x27')](function(_0x289391){_0x3bfaf0['rows']=_0x289391;return _0x3bfaf0;})['then'](respondWithFilteredResult(_0x1b7b7c,_0x154d89))[_0x2bad('0x46')](handleError(_0x1b7b7c,null));};exports[_0x2bad('0x47')]=function(_0x110287,_0x2e7ff9){var _0x1188d9={'raw':![],'where':{'id':_0x110287[_0x2bad('0x48')]['id']}},_0x8b72f3={};_0x8b72f3[_0x2bad('0x34')]=_['keys'](db[_0x2bad('0x30')][_0x2bad('0x31')]);_0x8b72f3[_0x2bad('0x36')]=_[_0x2bad('0x35')](_0x110287[_0x2bad('0x36')]);_0x8b72f3[_0x2bad('0x3e')]=_['intersection'](_0x8b72f3[_0x2bad('0x34')],_0x8b72f3[_0x2bad('0x36')]);_0x1188d9['attributes']=_['intersection'](_0x8b72f3['model'],qs[_0x2bad('0x39')](_0x110287['query']['fields']));_0x1188d9[_0x2bad('0x38')]=_0x1188d9[_0x2bad('0x38')][_0x2bad('0x3a')]?_0x1188d9[_0x2bad('0x38')]:_0x8b72f3[_0x2bad('0x34')];if(_0x110287[_0x2bad('0x36')][_0x2bad('0x43')]){_0x1188d9['include']=[{'all':!![]}];}_0x1188d9=_[_0x2bad('0x3f')]({},_0x1188d9,_0x110287[_0x2bad('0x42')]);return db['VoiceMusicOnHold'][_0x2bad('0x49')](_0x1188d9)[_0x2bad('0x27')](handleEntityNotFound(_0x2e7ff9,null))[_0x2bad('0x27')](respondWithResult(_0x2e7ff9,null))[_0x2bad('0x46')](handleError(_0x2e7ff9,null));};exports['update']=function(_0x1ed830,_0x5764b8){if(_0x1ed830['body']['id']){delete _0x1ed830[_0x2bad('0x4a')]['id'];}return db[_0x2bad('0x30')]['find']({'where':{'id':_0x1ed830[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](handleEntityNotFound(_0x5764b8,null))[_0x2bad('0x27')](saveUpdates(_0x1ed830[_0x2bad('0x4a')],null))['then'](respondWithResult(_0x5764b8,null))['catch'](handleError(_0x5764b8,null));};exports[_0x2bad('0x4b')]=function(_0xbc9ae,_0x37222c,_0x548253){return db['sequelize'][_0x2bad('0x4c')](function(_0x3ec288){if(_0xbc9ae['body']['mode']===_0x2bad('0x4d')){_0xbc9ae[_0x2bad('0x4a')][_0x2bad('0x4e')]=path[_0x2bad('0x4f')](config[_0x2bad('0x50')],'server/files/moh',_0xbc9ae['body'][_0x2bad('0x2d')]);}return db[_0x2bad('0x30')][_0x2bad('0x4b')](_0xbc9ae[_0x2bad('0x4a')],{'transaction':_0x3ec288})[_0x2bad('0x27')](function(_0x2c5cb7){if(_0xbc9ae[_0x2bad('0x4a')]['mode']==='files'){fs[_0x2bad('0x51')](_0x2c5cb7[_0x2bad('0x4e')],parseInt(_0x2bad('0x52'),0x8));}var _0x41111a=_0xbc9ae[_0x2bad('0x53')][_0x2bad('0x29')]({'plain':!![]});if(!_0x41111a)throw new Error(_0x2bad('0x54'));if(_0x41111a[_0x2bad('0x55')]===_0x2bad('0x53')){var _0xfc9e3d=_0x2c5cb7[_0x2bad('0x29')]({'plain':!![]});return db[_0x2bad('0x56')][_0x2bad('0x49')]({'where':{'name':_0x2bad('0x2a'),'userProfileId':_0x41111a[_0x2bad('0x57')]},'raw':!![]})[_0x2bad('0x27')](function(_0x10d03e){if(_0x10d03e&&_0x10d03e['autoAssociation']===0x0){return db[_0x2bad('0x58')]['create']({'name':_0xfc9e3d[_0x2bad('0x2d')],'resourceId':_0xfc9e3d['id'],'type':_0x10d03e[_0x2bad('0x2d')],'sectionId':_0x10d03e['id']},{})['then'](function(){return _0x2c5cb7;});}else{return _0x2c5cb7;}})[_0x2bad('0x46')](function(_0x1f48ca){logger['error'](_0x2bad('0x59'),_0x1f48ca);});}return _0x2c5cb7;});})[_0x2bad('0x27')](respondWithResult(_0x37222c,0xc9))[_0x2bad('0x46')](handleError(_0x37222c,null));};exports[_0x2bad('0x28')]=function(_0x165755,_0x4bdce9,_0xd40c4b){var _0x2fcb3a;return db[_0x2bad('0x30')][_0x2bad('0x49')]({'where':{'id':_0x165755[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](function(_0x3a47c2){if(_0x3a47c2){return db[_0x2bad('0x5a')][_0x2bad('0x4c')](function(_0x8d5782){return _0x3a47c2[_0x2bad('0x28')]({'transaction':_0x8d5782,'raw':!![]})[_0x2bad('0x27')](function(_0x267832){if(_0x267832[_0x2bad('0x4e')]){fs[_0x2bad('0x5b')](_0x267832['directory'])[_0x2bad('0x5c')](function(_0x231455){fs['unlinkSync'](path[_0x2bad('0x4f')](_0x267832[_0x2bad('0x4e')],_0x231455));});fs[_0x2bad('0x5d')](_0x267832['directory']);}return _0x267832;});})[_0x2bad('0x46')](function(_0x42c9f2){throw new db[(_0x2bad('0x5e'))][(_0x2bad('0x5f'))](_0x42c9f2['message']);});}})[_0x2bad('0x27')](handleEntityNotFound(_0x4bdce9,null))[_0x2bad('0x27')](removeEntity(_0x4bdce9,null))[_0x2bad('0x46')](handleError(_0x4bdce9,null));};exports[_0x2bad('0x60')]=function(_0x1cb962,_0x56973f,_0x3dbb5a){return db[_0x2bad('0x5a')][_0x2bad('0x4c')](function(_0x1d4c5c){var _0x3ef05b;return db[_0x2bad('0x30')][_0x2bad('0x49')]({'where':{'id':_0x1cb962[_0x2bad('0x48')]['id']}})['then'](function(_0x139ecc){if(_0x139ecc){_0x3ef05b=_0x139ecc;return _0x139ecc[_0x2bad('0x60')](_0x1cb962['body']['id'],{'transaction':_0x1d4c5c});}})[_0x2bad('0x27')](function(_0x2936da){if(_0x2936da){return db['Sound'][_0x2bad('0x61')]({'where':{'id':_0x1cb962['body']['id']},'attributes':['id',_0x2bad('0x2d'),'save_name','converted_format',_0x2bad('0x62')],'raw':!![]});}})[_0x2bad('0x27')](function(_0x4d4a6d){if(_0x4d4a6d){var _0x4107fe=path[_0x2bad('0x4f')](config['root'],_0x2bad('0x63'),util[_0x2bad('0x64')](_0x2bad('0x65'),path[_0x2bad('0x66')](_0x4d4a6d[_0x2bad('0x67')],path['extname'](_0x4d4a6d['save_name'])),_0x4d4a6d['converted_format']));var _0xa6b242=path[_0x2bad('0x4f')](config[_0x2bad('0x50')],'server/files/moh',_0x3ef05b[_0x2bad('0x2d')],util[_0x2bad('0x64')](_0x2bad('0x65'),_0x4d4a6d[_0x2bad('0x2d')],_0x4d4a6d[_0x2bad('0x68')]));fs[_0x2bad('0x69')](_0x4107fe,_0xa6b242);return _0x4d4a6d;}})[_0x2bad('0x46')](function(_0x5b2658){throw new db[(_0x2bad('0x5e'))][(_0x2bad('0x5f'))](_0x5b2658[_0x2bad('0x6a')]);});})[_0x2bad('0x27')](handleEntityNotFound(_0x56973f,null))[_0x2bad('0x27')](respondWithResult(_0x56973f,0xc9))[_0x2bad('0x46')](handleError(_0x56973f,null));};exports[_0x2bad('0x6b')]=function(_0x25a50c,_0x451a2f,_0x4a17b1){return db[_0x2bad('0x5a')][_0x2bad('0x4c')](function(_0x94af35){var _0x32a552;return db[_0x2bad('0x30')][_0x2bad('0x61')]({'where':{'id':_0x25a50c[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](handleEntityNotFound(_0x451a2f,null))['then'](function(_0x51fc29){if(_0x51fc29){_0x32a552=_0x51fc29;return _0x51fc29[_0x2bad('0x6b')](_0x25a50c[_0x2bad('0x48')]['id2']);}})[_0x2bad('0x27')](function(_0x8e7c05){if(_0x8e7c05){return db['Sound'][_0x2bad('0x61')]({'where':{'id':_0x25a50c['params'][_0x2bad('0x6c')]},'attributes':['id',_0x2bad('0x2d'),_0x2bad('0x67'),_0x2bad('0x68'),_0x2bad('0x62')],'raw':!![]});}})[_0x2bad('0x27')](function(_0x3730b2){if(_0x3730b2){fs['unlinkSync'](path['join'](_0x32a552[_0x2bad('0x4e')],util[_0x2bad('0x64')](_0x2bad('0x65'),_0x3730b2[_0x2bad('0x2d')],_0x3730b2['converted_format'])));return _0x3730b2;}})[_0x2bad('0x46')](function(_0x5001c5){throw new db['Sequelize'][(_0x2bad('0x5f'))](_0x5001c5['message']);});})[_0x2bad('0x27')](handleEntityNotFound(_0x451a2f,null))[_0x2bad('0x27')](respondWithStatusCode(_0x451a2f,0xcc))[_0x2bad('0x46')](handleError(_0x451a2f,null));};exports['getSounds']=function(_0x3ed105,_0x5203fe,_0x31965b){var _0x1be3ae={};var _0x2d11e4={};var _0x17a134;var _0xab39d;return db[_0x2bad('0x30')][_0x2bad('0x61')]({'where':{'id':_0x3ed105[_0x2bad('0x48')]['id']}})[_0x2bad('0x27')](handleEntityNotFound(_0x5203fe,null))[_0x2bad('0x27')](function(_0x8e098e){if(_0x8e098e){_0x17a134=_0x8e098e;_0x2d11e4[_0x2bad('0x34')]=_[_0x2bad('0x35')](db[_0x2bad('0x6d')][_0x2bad('0x31')]);_0x2d11e4['query']=_['keys'](_0x3ed105[_0x2bad('0x36')]);_0x2d11e4[_0x2bad('0x3e')]=_[_0x2bad('0x37')](_0x2d11e4[_0x2bad('0x34')],_0x2d11e4[_0x2bad('0x36')]);_0x1be3ae[_0x2bad('0x38')]=_['intersection'](_0x2d11e4['model'],qs[_0x2bad('0x39')](_0x3ed105['query'][_0x2bad('0x39')]));_0x1be3ae[_0x2bad('0x38')]=_0x1be3ae[_0x2bad('0x38')]['length']?_0x1be3ae[_0x2bad('0x38')]:_0x2d11e4['model'];_0x1be3ae[_0x2bad('0x6e')]=qs['sort'](_0x3ed105[_0x2bad('0x36')][_0x2bad('0x3c')]);_0x1be3ae[_0x2bad('0x3d')]=qs[_0x2bad('0x3e')](_[_0x2bad('0x6f')](_0x3ed105[_0x2bad('0x36')],_0x2d11e4[_0x2bad('0x3e')]));if(_0x3ed105['query'][_0x2bad('0x41')]){_0x1be3ae[_0x2bad('0x3d')]=_['merge'](_0x1be3ae[_0x2bad('0x3d')],{'$or':_['map'](_0x1be3ae['attributes'],function(_0xc8050e){var _0x1c1b2a={};_0x1c1b2a[_0xc8050e]={'$like':'%'+_0x3ed105[_0x2bad('0x36')][_0x2bad('0x41')]+'%'};return _0x1c1b2a;})});}_0x1be3ae=_[_0x2bad('0x3f')]({},_0x1be3ae,_0x3ed105['options']);return _0x17a134[_0x2bad('0x70')](_0x1be3ae);}})[_0x2bad('0x27')](function(_0x4daf0a){if(_0x4daf0a){_0xab39d=_0x4daf0a[_0x2bad('0x3a')];if(!_0x3ed105[_0x2bad('0x36')]['hasOwnProperty'](_0x2bad('0x71'))){_0x1be3ae[_0x2bad('0x1f')]=qs[_0x2bad('0x1f')](_0x3ed105[_0x2bad('0x36')][_0x2bad('0x1f')]);_0x1be3ae['offset']=qs['offset'](_0x3ed105[_0x2bad('0x36')][_0x2bad('0x1e')]);}return _0x17a134['getSounds'](_0x1be3ae);}})[_0x2bad('0x27')](function(_0x10547a){if(_0x10547a){return _0x10547a?{'count':_0xab39d,'rows':_0x10547a}:null;}})[_0x2bad('0x27')](respondWithResult(_0x5203fe,null))[_0x2bad('0x46')](handleError(_0x5203fe,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 5bfe101..25a3d2e 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 _0x6eb6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','api'];(function(_0x4dea6b,_0x11e74d){var _0x12e934=function(_0x550f0a){while(--_0x550f0a){_0x4dea6b['push'](_0x4dea6b['shift']());}};_0x12e934(++_0x11e74d);}(_0x6eb6,0xbe));var _0x66eb=function(_0x5974d1,_0x2cf091){_0x5974d1=_0x5974d1-0x0;var _0xe710fe=_0x6eb6[_0x5974d1];return _0xe710fe;};'use strict';var _=require(_0x66eb('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x66eb('0x1'));var moment=require(_0x66eb('0x2'));var BPromise=require(_0x66eb('0x3'));var rp=require(_0x66eb('0x4'));var fs=require('fs');var path=require(_0x66eb('0x5'));var rimraf=require(_0x66eb('0x6'));var config=require(_0x66eb('0x7'));var attributes=require(_0x66eb('0x8'));module[_0x66eb('0x9')]=function(_0x4bae86,_0x69ff3){return _0x4bae86[_0x66eb('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0x66eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6cad=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x176df2,_0x480f3b){var _0x33af50=function(_0x274c08){while(--_0x274c08){_0x176df2['push'](_0x176df2['shift']());}};_0x33af50(++_0x480f3b);}(_0x6cad,0x195));var _0xd6ca=function(_0x1b9c6a,_0x2239f0){_0x1b9c6a=_0x1b9c6a-0x0;var _0x555950=_0x6cad[_0x1b9c6a];return _0x555950;};'use strict';var _=require(_0xd6ca('0x0'));var util=require(_0xd6ca('0x1'));var logger=require(_0xd6ca('0x2'))('api');var moment=require(_0xd6ca('0x3'));var BPromise=require(_0xd6ca('0x4'));var rp=require(_0xd6ca('0x5'));var fs=require('fs');var path=require(_0xd6ca('0x6'));var rimraf=require('rimraf');var config=require(_0xd6ca('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0xd6ca('0x8')]=function(_0x1f04a0,_0x31eb07){return _0x1f04a0['define']('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 620691a..9e56bbd 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 _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x35681b,_0x45e610){var _0x1b3a5b=function(_0x2212b3){while(--_0x2212b3){_0x35681b['push'](_0x35681b['shift']());}};_0x1b3a5b(++_0x45e610);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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 _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(_0x1643a4,_0x33927b){var _0x2d8d63=function(_0x26d1e1){while(--_0x26d1e1){_0x1643a4['push'](_0x1643a4['shift']());}};_0x2d8d63(++_0x33927b);}(_0x70e0,0x17b));var _0x070e=function(_0x5debd6,_0x4bae8e){_0x5debd6=_0x5debd6-0x0;var _0x50f2d8=_0x70e0[_0x5debd6];return _0x50f2d8;};'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 213cfea..f1c6d31 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 _0xe914=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','index','/describe','isAuthenticated','/:id','/:id/users','getAgents','/:id/teams','getTeams','create','post','addAgents','put','delete','destroy','removeAgents','removeTeams','multer','util','connect-timeout'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xe914,0x7f));var _0x4e91=function(_0x3d07f2,_0x19854d){_0x3d07f2=_0x3d07f2-0x0;var _0x26052a=_0xe914[_0x3d07f2];return _0x26052a;};'use strict';var multer=require(_0x4e91('0x0'));var util=require(_0x4e91('0x1'));var path=require('path');var timeout=require(_0x4e91('0x2'));var express=require(_0x4e91('0x3'));var router=express[_0x4e91('0x4')]();var fs_extra=require(_0x4e91('0x5'));var auth=require(_0x4e91('0x6'));var interaction=require(_0x4e91('0x7'));var config=require('../../config/environment');var controller=require(_0x4e91('0x8'));router[_0x4e91('0x9')]('/',auth['isAuthenticated'](),controller[_0x4e91('0xa')]);router[_0x4e91('0x9')](_0x4e91('0xb'),auth[_0x4e91('0xc')](),controller['describe']);router['get'](_0x4e91('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x4e91('0x9')](_0x4e91('0xe'),auth[_0x4e91('0xc')](),controller[_0x4e91('0xf')]);router['get'](_0x4e91('0x10'),auth[_0x4e91('0xc')](),controller[_0x4e91('0x11')]);router['post']('/',auth[_0x4e91('0xc')](),controller[_0x4e91('0x12')]);router[_0x4e91('0x13')](_0x4e91('0xe'),auth[_0x4e91('0xc')](),controller[_0x4e91('0x14')]);router[_0x4e91('0x13')](_0x4e91('0x10'),auth[_0x4e91('0xc')](),controller['addTeams']);router[_0x4e91('0x15')](_0x4e91('0xd'),auth[_0x4e91('0xc')](),controller['update']);router[_0x4e91('0x16')](_0x4e91('0xd'),auth[_0x4e91('0xc')](),controller[_0x4e91('0x17')]);router[_0x4e91('0x16')](_0x4e91('0xe'),auth[_0x4e91('0xc')](),controller[_0x4e91('0x18')]);router['delete'](_0x4e91('0x10'),auth[_0x4e91('0xc')](),controller[_0x4e91('0x19')]);module['exports']=router; \ No newline at end of file +var _0xd765=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','show','/:id/users','/:id/teams','post','addTeams','put','/:id','update','destroy','removeAgents','exports','multer','util'];(function(_0x50abc1,_0xda3f4f){var _0x1bce0a=function(_0x37564a){while(--_0x37564a){_0x50abc1['push'](_0x50abc1['shift']());}};_0x1bce0a(++_0xda3f4f);}(_0xd765,0xdf));var _0x5d76=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd765[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x5d76('0x0'));var util=require(_0x5d76('0x1'));var path=require(_0x5d76('0x2'));var timeout=require(_0x5d76('0x3'));var express=require(_0x5d76('0x4'));var router=express[_0x5d76('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5d76('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d76('0x7'));var controller=require(_0x5d76('0x8'));router['get']('/',auth[_0x5d76('0x9')](),controller[_0x5d76('0xa')]);router[_0x5d76('0xb')](_0x5d76('0xc'),auth[_0x5d76('0x9')](),controller[_0x5d76('0xd')]);router['get']('/:id',auth[_0x5d76('0x9')](),controller[_0x5d76('0xe')]);router[_0x5d76('0xb')](_0x5d76('0xf'),auth['isAuthenticated'](),controller['getAgents']);router[_0x5d76('0xb')](_0x5d76('0x10'),auth[_0x5d76('0x9')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5d76('0x11')](_0x5d76('0xf'),auth[_0x5d76('0x9')](),controller['addAgents']);router[_0x5d76('0x11')](_0x5d76('0x10'),auth['isAuthenticated'](),controller[_0x5d76('0x12')]);router[_0x5d76('0x13')](_0x5d76('0x14'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x15')]);router['delete'](_0x5d76('0x14'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x16')]);router['delete'](_0x5d76('0xf'),auth[_0x5d76('0x9')](),controller[_0x5d76('0x17')]);router['delete'](_0x5d76('0x10'),auth[_0x5d76('0x9')](),controller['removeTeams']);module[_0x5d76('0x18')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b65c120..3385de0 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 _0x406f=['VIRTUAL','getDataValue','name','sequelize','STRING'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x406f,0x148));var _0xf406=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x406f[_0x9fd887];return _0x1a54ab;};'use strict';var Sequelize=require(_0xf406('0x0'));module['exports']={'name':{'type':Sequelize[_0xf406('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xf406('0x2')],'get':function(_0x23d764){return'system-'+this[_0xf406('0x3')](_0xf406('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xf406('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xd0d3=['system-','getDataValue','INTEGER','exports','STRING','VIRTUAL'];(function(_0x9e708d,_0x31a917){var _0x399fb2=function(_0x1b5228){while(--_0x1b5228){_0x9e708d['push'](_0x9e708d['shift']());}};_0x399fb2(++_0x31a917);}(_0xd0d3,0x17d));var _0x3d0d=function(_0x229d6c,_0x236d39){_0x229d6c=_0x229d6c-0x0;var _0x44e913=_0xd0d3[_0x229d6c];return _0x44e913;};'use strict';var Sequelize=require('sequelize');module[_0x3d0d('0x0')]={'name':{'type':Sequelize[_0x3d0d('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x3d0d('0x2')],'get':function(_0x2a33de){return _0x3d0d('0x3')+this[_0x3d0d('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x3d0d('0x1')]},'callerIdAll':{'type':Sequelize[_0x3d0d('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x3d0d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 2ec93af..1473c95 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 _0x4b17=['status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','map','VoicePrefix','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','catch','params','rawAttributes','includeAll','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','context','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','voicePause','flatMap','each','upsert','findOrCreate','forEach','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','isEmpty','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4b17,0x10f));var _0x74b1=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x4b17[_0x515283];return _0x38f836;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];config['redis']=_['defaults'](config[_0x74b1('0x17')],{'host':_0x74b1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0x74b1('0x19')](socket);function respondWithStatusCode(_0x5c12eb,_0x4e289b){_0x4e289b=_0x4e289b||0xcc;return function(_0x2ccba6){if(_0x2ccba6){return _0x5c12eb[_0x74b1('0x1a')](_0x4e289b);}return _0x5c12eb[_0x74b1('0x1b')](_0x4e289b)[_0x74b1('0x1c')]();};}function respondWithResult(_0x16b147,_0x10138e){_0x10138e=_0x10138e||0xc8;return function(_0x528e8c){if(_0x528e8c){return _0x16b147[_0x74b1('0x1b')](_0x10138e)[_0x74b1('0x1d')](_0x528e8c);}};}function respondWithFilteredResult(_0x1a0851,_0x2cfcc3){return function(_0xde2736){if(_0xde2736){var _0x8c9510=typeof _0x2cfcc3[_0x74b1('0x1e')]==='undefined'&&typeof _0x2cfcc3[_0x74b1('0x1f')]===_0x74b1('0x20');var _0x524ece=_0xde2736[_0x74b1('0x21')];var _0x38d932=_0x8c9510?0x0:_0x2cfcc3[_0x74b1('0x1e')];var _0x25704e=_0x8c9510?_0xde2736[_0x74b1('0x21')]:_0x2cfcc3[_0x74b1('0x1e')]+_0x2cfcc3[_0x74b1('0x1f')];var _0xaac5f7;if(_0x25704e>=_0x524ece){_0x25704e=_0x524ece;_0xaac5f7=0xc8;}else{_0xaac5f7=0xce;}_0x1a0851['status'](_0xaac5f7);return _0x1a0851[_0x74b1('0x22')]('Content-Range',_0x38d932+'-'+_0x25704e+'/'+_0x524ece)['json'](_0xde2736);}return null;};}function patchUpdates(_0x481bf2){return function(_0x27fd1a){try{jsonpatch[_0x74b1('0x23')](_0x27fd1a,_0x481bf2,!![]);}catch(_0x405a22){return BPromise[_0x74b1('0x24')](_0x405a22);}return _0x27fd1a[_0x74b1('0x25')]();};}function saveUpdates(_0x4ee88b,_0x3c78e5){return function(_0x4eca36){if(_0x4eca36){return _0x4eca36[_0x74b1('0x26')](_0x4ee88b)[_0x74b1('0x27')](function(_0xb5af0){return _0xb5af0;});}return null;};}function removeEntity(_0x14a651,_0x3239d8){return function(_0x322de5){if(_0x322de5){return _0x322de5[_0x74b1('0x28')]()[_0x74b1('0x27')](function(){var _0x4c7f05=_0x322de5[_0x74b1('0x29')]({'plain':!![]});var _0x42b69d=_0x74b1('0x2a');return db['UserProfileResource'][_0x74b1('0x28')]({'where':{'type':_0x42b69d,'resourceId':_0x4c7f05['id']}})[_0x74b1('0x27')](function(){return _0x322de5;});})[_0x74b1('0x27')](function(){_0x14a651[_0x74b1('0x1b')](0xcc)[_0x74b1('0x1c')]();});}};}function handleEntityNotFound(_0x273ff1,_0x436eda){return function(_0x3ce043){if(!_0x3ce043){_0x273ff1['sendStatus'](0x194);}return _0x3ce043;};}function handleError(_0xe74c82,_0x40b32a){_0x40b32a=_0x40b32a||0x1f4;return function(_0x51ce6d){logger[_0x74b1('0x2b')](_0x51ce6d[_0x74b1('0x2c')]);if(_0x51ce6d[_0x74b1('0x2d')]){delete _0x51ce6d['name'];}_0xe74c82[_0x74b1('0x1b')](_0x40b32a)[_0x74b1('0x2e')](_0x51ce6d);};}exports['index']=function(_0x3dbf18,_0x33ec7c){var _0x2211b2={},_0x31c321={},_0x68a3bd={'count':0x0,'rows':[]};var _0x32a8d6=_[_0x74b1('0x2f')](db[_0x74b1('0x30')]['rawAttributes'],function(_0x3d5fc0){return{'name':_0x3d5fc0['fieldName'],'type':_0x3d5fc0['type'][_0x74b1('0x31')]};});_0x31c321['model']=_['map'](_0x32a8d6,_0x74b1('0x2d'));_0x31c321[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x3dbf18[_0x74b1('0x32')]);_0x31c321[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x31c321[_0x74b1('0x36')],_0x31c321[_0x74b1('0x32')]);_0x2211b2['attributes']=_['intersection'](_0x31c321['model'],qs[_0x74b1('0x37')](_0x3dbf18['query']['fields']));_0x2211b2[_0x74b1('0x38')]=_0x2211b2[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2211b2['attributes']:_0x31c321[_0x74b1('0x36')];if(!_0x3dbf18['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2211b2['limit']=qs['limit'](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2211b2['offset']=qs['offset'](_0x3dbf18[_0x74b1('0x32')]['offset']);}_0x2211b2[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x2211b2[_0x74b1('0x3e')]=qs['filters'](_[_0x74b1('0x3f')](_0x3dbf18['query'],_0x31c321[_0x74b1('0x34')]),_0x32a8d6);if(_0x3dbf18['query'][_0x74b1('0x40')]){_0x2211b2['where']=_['merge'](_0x2211b2[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x32a8d6,function(_0x2725fd){if(_0x2725fd['type']!==_0x74b1('0x41')){var _0x327334={};_0x327334[_0x2725fd[_0x74b1('0x2d')]]={'$like':'%'+_0x3dbf18['query'][_0x74b1('0x40')]+'%'};return _0x327334;}})});}_0x2211b2=_[_0x74b1('0x42')]({},_0x2211b2,_0x3dbf18['options']);var _0x48ac05={'where':_0x2211b2[_0x74b1('0x3e')]};return db[_0x74b1('0x30')][_0x74b1('0x21')](_0x48ac05)[_0x74b1('0x27')](function(_0x1d9f5b){_0x68a3bd[_0x74b1('0x21')]=_0x1d9f5b;if(_0x3dbf18[_0x74b1('0x32')]['includeAll']){_0x2211b2[_0x74b1('0x43')]=[{'all':!![]}];}return db[_0x74b1('0x30')][_0x74b1('0x44')](_0x2211b2);})[_0x74b1('0x27')](function(_0x17a44f){_0x68a3bd['rows']=_0x17a44f;return _0x68a3bd;})[_0x74b1('0x27')](respondWithFilteredResult(_0x33ec7c,_0x2211b2))[_0x74b1('0x45')](handleError(_0x33ec7c,null));};exports['show']=function(_0x50d9de,_0x1b7a58){var _0x3c3c3c={'raw':![],'where':{'id':_0x50d9de[_0x74b1('0x46')]['id']}},_0x54c94b={};_0x54c94b[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x30')][_0x74b1('0x47')]);_0x54c94b[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x50d9de['query']);_0x54c94b['filters']=_['intersection'](_0x54c94b[_0x74b1('0x36')],_0x54c94b[_0x74b1('0x32')]);_0x3c3c3c[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x54c94b[_0x74b1('0x36')],qs['fields'](_0x50d9de[_0x74b1('0x32')][_0x74b1('0x37')]));_0x3c3c3c[_0x74b1('0x38')]=_0x3c3c3c[_0x74b1('0x38')][_0x74b1('0x39')]?_0x3c3c3c[_0x74b1('0x38')]:_0x54c94b[_0x74b1('0x36')];if(_0x50d9de[_0x74b1('0x32')][_0x74b1('0x48')]){_0x3c3c3c[_0x74b1('0x43')]=[{'all':!![]}];}_0x3c3c3c=_[_0x74b1('0x42')]({},_0x3c3c3c,_0x50d9de[_0x74b1('0x49')]);return db['VoicePrefix'][_0x74b1('0x4a')](_0x3c3c3c)[_0x74b1('0x27')](handleEntityNotFound(_0x1b7a58,null))['then'](respondWithResult(_0x1b7a58,null))[_0x74b1('0x45')](handleError(_0x1b7a58,null));};exports['destroy']=function(_0x4b1add,_0x2073eb){return db['VoicePrefix'][_0x74b1('0x4a')]({'where':{'id':_0x4b1add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2073eb,null))['then'](removeEntity(_0x2073eb,null))[_0x74b1('0x45')](handleError(_0x2073eb,null));};exports[_0x74b1('0x4b')]=function(_0x1b2d51,_0x3d199b){return db[_0x74b1('0x30')]['describe']()[_0x74b1('0x27')](respondWithResult(_0x3d199b,null))['catch'](handleError(_0x3d199b,null));};exports[_0x74b1('0x4c')]=function(_0x4085b8,_0x5e458c){var _0x1be639;return db[_0x74b1('0x4d')][_0x74b1('0x4e')](function(_0x54a221){return db[_0x74b1('0x30')][_0x74b1('0x4c')](_0x4085b8['body'],{'transaction':_0x54a221})[_0x74b1('0x27')](function(_0x4fdd6b){_0x1be639=_0x4fdd6b['get']({'plain':!![]});return db[_0x74b1('0x4f')][_0x74b1('0x4a')]({'where':{'id':_0x1be639[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x41b45f){return createVoicePrefixExtensions(_0x1be639,_0x41b45f,_0x54a221);});});})['then'](function(){var _0x145ce3=_0x4085b8[_0x74b1('0x51')]['get']({'plain':!![]});if(!_0x145ce3)throw new Error(_0x74b1('0x52'));if(_0x145ce3[_0x74b1('0x53')]===_0x74b1('0x51')){var _0x5634d1=_0x1be639;return db[_0x74b1('0x54')][_0x74b1('0x4a')]({'where':{'name':_0x74b1('0x2a'),'userProfileId':_0x145ce3['userProfileId']},'raw':!![]})[_0x74b1('0x27')](function(_0x3b4338){if(_0x3b4338&&_0x3b4338[_0x74b1('0x55')]===0x0){return db[_0x74b1('0x56')][_0x74b1('0x4c')]({'name':_0x5634d1[_0x74b1('0x2d')],'resourceId':_0x5634d1['id'],'type':_0x3b4338['name'],'sectionId':_0x3b4338['id']},{})[_0x74b1('0x27')](function(){return _0x1be639;});}else{return _0x1be639;}})['catch'](function(_0x5343c4){logger[_0x74b1('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5343c4);throw _0x5343c4;});}return _0x1be639;})['then'](respondWithResult(_0x5e458c,null))[_0x74b1('0x45')](handleError(_0x5e458c,null));};function Extension(_0x29ab63,_0x16db5c,_0x515a8e,_0x204b7d){this[_0x74b1('0x57')]=_0x74b1('0x58');this[_0x74b1('0x59')]=_0x29ab63;this[_0x74b1('0x5a')]=_0x515a8e;this[_0x74b1('0x5b')]=_0x74b1('0x5c');this[_0x74b1('0x5d')]=_0x74b1('0x5e');this[_0x74b1('0x5f')]=_0x16db5c;this[_0x74b1('0x60')]=_0x204b7d;}function createVoicePrefixExtensions(_0x112721,_0x516e44,_0x598daa){return new BPromise(function(_0x2a46ca,_0x553615){var _0x15eb38=new Extension(formatPrefixName(_0x112721[_0x74b1('0x61')]),0x1,'NoOp','Voice\x20Prefix');_0x15eb38[_0x74b1('0x62')]=_0x112721['id'];return db[_0x74b1('0x4f')][_0x74b1('0x4c')](_0x15eb38,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x3dd0c3){var _0x1f879f=_0x3dd0c3[_0x74b1('0x29')]({'plain':!![]});var _0x1fb137=_[_0x74b1('0x2f')](addVoicePrefixExtensions(_0x112721,_0x516e44),function(_0x128a7e){_0x128a7e[_0x74b1('0x50')]=_0x1f879f['id'];_0x128a7e[_0x74b1('0x62')]=_0x112721['id'];return _0x128a7e;});return db['VoiceExtension'][_0x74b1('0x63')](_0x1fb137,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x378f63){if(!_0x378f63){return _0x553615(_0x74b1('0x64'));}else{return _0x2a46ca(_0x378f63);}})['catch'](function(_0x308b98){return _0x553615(_0x308b98);});});;});};function addVoicePrefixExtensions(_0x1709d9,_0x5ada76){var _0x425f9f=[];var _0x4d2fcb=formatPrefixName(_0x1709d9[_0x74b1('0x61')]);_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x2,'Set',_0x74b1('0x66')+_0x1709d9[_0x74b1('0x2d')]));if(_0x1709d9[_0x74b1('0x67')]){_0x425f9f['push'](new Extension(_0x4d2fcb,0x3,_0x74b1('0x68'),'PREFIX-CALLERIDALL='+_0x1709d9[_0x74b1('0x67')]));}else{_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x3,_0x74b1('0x69'),_0x74b1('0x6a')));}_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x4,_0x74b1('0x6b'),_0x5ada76[_0x74b1('0x57')]+','+_0x74b1('0x6c')+(0x8+_0x1709d9[_0x74b1('0x2d')][_0x74b1('0x39')])+'}'+','+0x1));return _0x425f9f;}function formatPrefixName(_0x8b4902){var _0x44563d='_';for(var _0x2a33c9=0x0;_0x2a33c9<_0x8b4902['length'];_0x2a33c9++){if(_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)=='-'){_0x44563d+=_0x8b4902[_0x74b1('0x6d')](_0x2a33c9);}else{_0x44563d+='['+_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)+']';}}_0x44563d+='.';return _0x44563d;}exports[_0x74b1('0x26')]=function(_0x30692c,_0x228f8f,_0x2e94d6){var _0x7e2bcc=_0x30692c[_0x74b1('0x6e')];_0x7e2bcc['prefix']=_0x74b1('0x6f')+_0x7e2bcc['name']+'-';return db[_0x74b1('0x4d')]['transaction'](function(_0x5886d1){return db[_0x74b1('0x30')][_0x74b1('0x26')](_0x7e2bcc,{'where':{'id':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x28')]({'where':{'VoicePrefixId':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x4a')]({'where':{'id':_0x7e2bcc[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x21e767){return createVoicePrefixExtensions(_0x7e2bcc,_0x21e767,_0x5886d1);});});});})[_0x74b1('0x27')](function(){return db[_0x74b1('0x30')][_0x74b1('0x70')](_0x7e2bcc['id']);})[_0x74b1('0x27')](respondWithResult(_0x228f8f,null))[_0x74b1('0x45')](handleError(_0x228f8f,null));};exports[_0x74b1('0x71')]=function(_0x542ee7,_0x2b1119,_0x3267ef){return db[_0x74b1('0x30')]['find']({'where':{'id':_0x542ee7[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2b1119,null))[_0x74b1('0x27')](function(_0x1a6a70){if(_0x1a6a70){return _0x1a6a70[_0x74b1('0x71')](_0x542ee7['body'][_0x74b1('0x72')],_[_0x74b1('0x73')](_0x542ee7[_0x74b1('0x6e')],[_0x74b1('0x72'),'id'])||{})[_0x74b1('0x74')](function(_0x36733f){for(var _0x359e05=0x0;_0x359e05<_0x542ee7[_0x74b1('0x6e')]['ids'][_0x74b1('0x39')];_0x359e05+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':Number(_0x542ee7['body']['ids'][_0x359e05]),'VoicePrefixId':Number(_0x542ee7[_0x74b1('0x46')]['id'])});}return _0x36733f;});}})[_0x74b1('0x27')](respondWithResult(_0x2b1119,null))[_0x74b1('0x45')](handleError(_0x2b1119,null));};exports[_0x74b1('0x77')]=function(_0x2de935,_0x5d8729,_0x42a630){return db['VoicePrefix']['find']({'where':{'id':_0x2de935[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5d8729,null))[_0x74b1('0x27')](function(_0x2da0f2){if(_0x2da0f2){return _0x2da0f2[_0x74b1('0x77')](_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')])[_0x74b1('0x27')](function(){if(_['isArray'](_0x2de935['query']['ids'])){for(var _0x7ec28f=0x0;_0x7ec28f<_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x74b1('0x39')];_0x7ec28f+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x7ec28f]),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}}else{socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')]['ids']),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}});}})[_0x74b1('0x27')](respondWithStatusCode(_0x5d8729,null))[_0x74b1('0x45')](handleError(_0x5d8729,null));};exports[_0x74b1('0x79')]=function(_0x25f929,_0x138f79,_0x5a07a6){var _0x2567d7={};var _0x32eb2d={};var _0x21c54f;var _0x4b025c;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x25f929[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x138f79,null))['then'](function(_0x7d3f08){if(_0x7d3f08){_0x21c54f=_0x7d3f08;_0x32eb2d[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x7b')][_0x74b1('0x47')]);_0x32eb2d['query']=_[_0x74b1('0x33')](_0x25f929[_0x74b1('0x32')]);_0x32eb2d['filters']=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],_0x32eb2d['query']);_0x2567d7[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],qs[_0x74b1('0x37')](_0x25f929['query']['fields']));_0x2567d7[_0x74b1('0x38')]=_0x2567d7[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2567d7['attributes']:_0x32eb2d[_0x74b1('0x36')];_0x2567d7[_0x74b1('0x3c')]=qs['sort'](_0x25f929['query'][_0x74b1('0x3d')]);_0x2567d7[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_['pick'](_0x25f929[_0x74b1('0x32')],_0x32eb2d[_0x74b1('0x34')]));if(_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]){_0x2567d7['where']=_['merge'](_0x2567d7[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x2567d7['attributes'],function(_0x1bf4a4){var _0x258b8f={};_0x258b8f[_0x1bf4a4]={'$like':'%'+_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]+'%'};return _0x258b8f;})});}_0x2567d7=_[_0x74b1('0x42')]({},_0x2567d7,_0x25f929[_0x74b1('0x49')]);return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x21453e){if(_0x21453e){_0x4b025c=_0x21453e[_0x74b1('0x39')];if(!_0x25f929['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2567d7[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x25f929[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2567d7['offset']=qs[_0x74b1('0x1e')](_0x25f929['query'][_0x74b1('0x1e')]);}return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x4fcd9a){if(_0x4fcd9a){return _0x4fcd9a?{'count':_0x4b025c,'rows':_0x4fcd9a}:null;}})[_0x74b1('0x27')](respondWithResult(_0x138f79,null))[_0x74b1('0x45')](handleError(_0x138f79,null));};exports['getTeams']=function(_0x4a9ec5,_0x5c02fc,_0x1cbfde){var _0x6ac5ae={};var _0x1a223d={};var _0x25624b;var _0xb24035;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x4a9ec5[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5c02fc,null))[_0x74b1('0x27')](function(_0x220cbf){if(_0x220cbf){_0x25624b=_0x220cbf;_0x1a223d[_0x74b1('0x36')]=_['keys'](db[_0x74b1('0x7c')][_0x74b1('0x47')]);_0x1a223d[_0x74b1('0x32')]=_['keys'](_0x4a9ec5[_0x74b1('0x32')]);_0x1a223d[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x1a223d['model'],_0x1a223d[_0x74b1('0x32')]);_0x6ac5ae[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x1a223d['model'],qs[_0x74b1('0x37')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x37')]));_0x6ac5ae[_0x74b1('0x38')]=_0x6ac5ae[_0x74b1('0x38')][_0x74b1('0x39')]?_0x6ac5ae[_0x74b1('0x38')]:_0x1a223d[_0x74b1('0x36')];_0x6ac5ae[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x6ac5ae[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_[_0x74b1('0x3f')](_0x4a9ec5[_0x74b1('0x32')],_0x1a223d[_0x74b1('0x34')]));if(_0x4a9ec5['query'][_0x74b1('0x40')]){_0x6ac5ae[_0x74b1('0x3e')]=_['merge'](_0x6ac5ae[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x6ac5ae[_0x74b1('0x38')],function(_0x3e3dfb){var _0x1a5c1e={};_0x1a5c1e[_0x3e3dfb]={'$like':'%'+_0x4a9ec5[_0x74b1('0x32')]['filter']+'%'};return _0x1a5c1e;})});}_0x6ac5ae=_['merge']({},_0x6ac5ae,_0x4a9ec5[_0x74b1('0x49')]);return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x401599){if(_0x401599){_0xb24035=_0x401599[_0x74b1('0x39')];if(!_0x4a9ec5[_0x74b1('0x32')]['hasOwnProperty'](_0x74b1('0x3b'))){_0x6ac5ae[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x4a9ec5[_0x74b1('0x32')]['limit']);_0x6ac5ae[_0x74b1('0x1e')]=qs[_0x74b1('0x1e')](_0x4a9ec5['query'][_0x74b1('0x1e')]);}return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x29de45){if(_0x29de45){return _0x29de45?{'count':_0xb24035,'rows':_0x29de45}:null;}})[_0x74b1('0x27')](respondWithResult(_0x5c02fc,null))[_0x74b1('0x45')](handleError(_0x5c02fc,null));};exports[_0x74b1('0x7e')]=function(_0x33b136,_0x4f9b6a,_0x8366b){var _0x2d356c=_0x33b136['body'][_0x74b1('0x72')];var _0x3719d7;return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x2d356c},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':_0x74b1('0x7f'),'attributes':['id',_0x74b1('0x2d'),'online',_0x74b1('0x80'),'interface'],'raw':!![]}]})[_0x74b1('0x27')](function(_0x3bd788){if(_0x3bd788){_0x3719d7=_0x3bd788;var _0x5b4ecf=_[_0x74b1('0x81')](_0x3bd788,function(_0x5dbc1f){var _0x4aa62a=_0x5dbc1f[_0x74b1('0x29')]({'plain':!![]});return _0x4aa62a['Agents'];});return db[_0x74b1('0x30')]['find']({'where':{'id':_0x33b136[_0x74b1('0x46')]['id']}})['then'](function(_0x5b8ba6){return db[_0x74b1('0x4d')]['transaction'](function(_0x2ea97c){return _0x5b8ba6[_0x74b1('0x7e')](_0x2d356c,{'transaction':_0x2ea97c})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x3719d7,function(_0x433293){return db['TeamVoicePrefix'][_0x74b1('0x83')]({'TeamId':_0x433293['id'],'VoicePrefixId':_0x33b136['params']['id']},{'transaction':_0x2ea97c});});})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x5b4ecf,function(_0x110bb6){return db['UserVoicePrefix'][_0x74b1('0x84')]({'where':{'UserId':_0x110bb6['id'],'VoicePrefixId':_0x33b136[_0x74b1('0x46')]['id']},'transaction':_0x2ea97c});});})['then'](function(){_0x5b4ecf[_0x74b1('0x85')](function(_0xbaf7f4){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':_0xbaf7f4['id'],'VoicePrefixId':_0x5b8ba6['id']});});});});});}})['then'](respondWithStatusCode(_0x4f9b6a,null))[_0x74b1('0x45')](handleError(_0x4f9b6a,null));};exports[_0x74b1('0x86')]=function(_0x1f2add,_0x1ab4ea,_0x5b3ae9){return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x1f2add['query'][_0x74b1('0x72')]},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x74b1('0x27')](handleEntityNotFound(_0x1ab4ea,null))[_0x74b1('0x27')](function(_0x39354d){var _0x484368=_['map'](_0x39354d,'id');var _0xfcd9b=[];var _0x1b3847=[];var _0x4880f6=squel['select']();_0x4880f6[_0x74b1('0x87')](_0x74b1('0x88'))['from'](_0x74b1('0x89'),'tq')[_0x74b1('0x8a')](_0x74b1('0x8b'),'ut',_0x74b1('0x8c'))[_0x74b1('0x3e')](_0x74b1('0x8d'),_0x1f2add[_0x74b1('0x46')]['id']);for(var _0x523ec1=0x0;_0x523ec1<_0x39354d[_0x74b1('0x39')];_0x523ec1+=0x1){let _0x304756=_0x39354d[_0x523ec1];for(var _0x3039d7=0x0;_0x3039d7<_0x304756[_0x74b1('0x7f')][_0x74b1('0x39')];_0x3039d7+=0x1){let _0x367373=_0x304756[_0x74b1('0x7f')][_0x3039d7];var _0x2ee3a7=_0x4880f6[_0x74b1('0x8e')]();_0x2ee3a7[_0x74b1('0x3e')]('ut.UserId\x20=\x20?',_0x367373['id']);_0x1b3847['push'](db['sequelize'][_0x74b1('0x32')](_0x2ee3a7[_0x74b1('0x8f')](),{'type':db['sequelize'][_0x74b1('0x90')][_0x74b1('0x91')]})[_0x74b1('0x27')](function(_0x399c7c){if(_0x399c7c['length']===0x1){return _0x367373['id'];}else{var _0xe421dc=_[_0x74b1('0x92')](_[_0x74b1('0x2f')](_0x399c7c,_0x74b1('0x93')),function(_0x58896f){return _['includes'](_0x484368,_0x58896f);});if(_0xe421dc){return _0x367373['id'];}}}));}}return BPromise['all'](_0x1b3847)[_0x74b1('0x27')](function(_0x20f41b){_0xfcd9b=_(_0xfcd9b)['union'](_0x20f41b)['compact']()['value']();return db[_0x74b1('0x30')]['find']({'where':{'id':_0x1f2add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](function(_0x1326b3){return db['sequelize'][_0x74b1('0x4e')](function(_0x155534){return _0x1326b3['removeTeams'](_0x1f2add[_0x74b1('0x32')][_0x74b1('0x72')],{'transaction':_0x155534})[_0x74b1('0x27')](function(){if(!_[_0x74b1('0x94')](_0xfcd9b)){return _0x1326b3['removeAgents'](_0xfcd9b,{'transaction':_0x155534});}})[_0x74b1('0x27')](function(){_0xfcd9b[_0x74b1('0x85')](function(_0x4a9046){socket[_0x74b1('0x75')]('userVoicePrefix:remove',{'UserId':_0x4a9046,'VoicePrefixId':_0x1326b3['id']});});});});});});})[_0x74b1('0x27')](respondWithStatusCode(_0x1ab4ea,null))[_0x74b1('0x45')](handleError(_0x1ab4ea,null));}; \ No newline at end of file +var _0x583c=['fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','map','VoicePrefix','fieldName','type','model','query','keys','filters','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','intersection','length','include','find','describe','create','sequelize','transaction','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','VoicePrefixes','userProfileId','autoAssociation','exten','app','system','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','system-','VoiceExtension','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','filter','Team','hasOwnProperty','getTeams','addTeams','Agents','online','voicePause','flatMap','each','UserVoicePrefix','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','all','union','compact','value','isEmpty','forEach','eml-format','rimraf','zip-dir'];(function(_0x747260,_0x554f9e){var _0x334ed9=function(_0x54bd41){while(--_0x54bd41){_0x747260['push'](_0x747260['shift']());}};_0x334ed9(++_0x554f9e);}(_0x583c,0x12b));var _0xc583=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0x583c[_0xf2628e];return _0x13863a;};'use strict';var emlformat=require(_0xc583('0x0'));var rimraf=require(_0xc583('0x1'));var zipdir=require(_0xc583('0x2'));var jsonpatch=require(_0xc583('0x3'));var rp=require('request-promise');var moment=require(_0xc583('0x4'));var BPromise=require(_0xc583('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc583('0x6'));var sox=require(_0xc583('0x7'));var csv=require('to-csv');var ejs=require(_0xc583('0x8'));var fs=require('fs');var fs_extra=require(_0xc583('0x9'));var _=require(_0xc583('0xa'));var squel=require(_0xc583('0xb'));var crypto=require('crypto');var jsforce=require(_0xc583('0xc'));var deskjs=require(_0xc583('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc583('0xe'));var Papa=require(_0xc583('0xf'));var Redis=require(_0xc583('0x10'));var authService=require(_0xc583('0x11'));var qs=require(_0xc583('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc583('0x13'));var logger=require(_0xc583('0x14'))('api');var utils=require(_0xc583('0x15'));var config=require(_0xc583('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc583('0x17'))['db'];config[_0xc583('0x18')]=_[_0xc583('0x19')](config[_0xc583('0x18')],{'host':_0xc583('0x1a'),'port':0x18eb});var socket=require(_0xc583('0x1b'))(new Redis(config[_0xc583('0x18')]));require(_0xc583('0x1c'))[_0xc583('0x1d')](socket);function respondWithStatusCode(_0x5403a3,_0x21cf25){_0x21cf25=_0x21cf25||0xcc;return function(_0x51ecd7){if(_0x51ecd7){return _0x5403a3[_0xc583('0x1e')](_0x21cf25);}return _0x5403a3[_0xc583('0x1f')](_0x21cf25)['end']();};}function respondWithResult(_0x263552,_0x311ad5){_0x311ad5=_0x311ad5||0xc8;return function(_0x5b1871){if(_0x5b1871){return _0x263552[_0xc583('0x1f')](_0x311ad5)[_0xc583('0x20')](_0x5b1871);}};}function respondWithFilteredResult(_0x5127fa,_0x21cf22){return function(_0x8a2d84){if(_0x8a2d84){var _0x12aac2=typeof _0x21cf22[_0xc583('0x21')]==='undefined'&&typeof _0x21cf22[_0xc583('0x22')]==='undefined';var _0x227ec2=_0x8a2d84[_0xc583('0x23')];var _0xfd9a60=_0x12aac2?0x0:_0x21cf22[_0xc583('0x21')];var _0x1052b5=_0x12aac2?_0x8a2d84[_0xc583('0x23')]:_0x21cf22[_0xc583('0x21')]+_0x21cf22[_0xc583('0x22')];var _0x37fcd4;if(_0x1052b5>=_0x227ec2){_0x1052b5=_0x227ec2;_0x37fcd4=0xc8;}else{_0x37fcd4=0xce;}_0x5127fa[_0xc583('0x1f')](_0x37fcd4);return _0x5127fa[_0xc583('0x24')](_0xc583('0x25'),_0xfd9a60+'-'+_0x1052b5+'/'+_0x227ec2)[_0xc583('0x20')](_0x8a2d84);}return null;};}function patchUpdates(_0x478ee1){return function(_0x542256){try{jsonpatch[_0xc583('0x26')](_0x542256,_0x478ee1,!![]);}catch(_0x3e075c){return BPromise[_0xc583('0x27')](_0x3e075c);}return _0x542256['save']();};}function saveUpdates(_0x1521e2,_0x959500){return function(_0x37f156){if(_0x37f156){return _0x37f156[_0xc583('0x28')](_0x1521e2)[_0xc583('0x29')](function(_0x48c95e){return _0x48c95e;});}return null;};}function removeEntity(_0x4cad36,_0x45871c){return function(_0x4f366b){if(_0x4f366b){return _0x4f366b[_0xc583('0x2a')]()[_0xc583('0x29')](function(){var _0xbabf24=_0x4f366b[_0xc583('0x2b')]({'plain':!![]});var _0x24aab5='VoicePrefixes';return db[_0xc583('0x2c')][_0xc583('0x2a')]({'where':{'type':_0x24aab5,'resourceId':_0xbabf24['id']}})['then'](function(){return _0x4f366b;});})[_0xc583('0x29')](function(){_0x4cad36['status'](0xcc)[_0xc583('0x2d')]();});}};}function handleEntityNotFound(_0x8d4ecb,_0x1c80b1){return function(_0x3ed083){if(!_0x3ed083){_0x8d4ecb[_0xc583('0x1e')](0x194);}return _0x3ed083;};}function handleError(_0x19079b,_0x113b39){_0x113b39=_0x113b39||0x1f4;return function(_0x4a87b5){logger[_0xc583('0x2e')](_0x4a87b5[_0xc583('0x2f')]);if(_0x4a87b5[_0xc583('0x30')]){delete _0x4a87b5[_0xc583('0x30')];}_0x19079b[_0xc583('0x1f')](_0x113b39)[_0xc583('0x31')](_0x4a87b5);};}exports['index']=function(_0x2246dd,_0x58d97f){var _0x510931={},_0x299551={},_0x2df18d={'count':0x0,'rows':[]};var _0x20bbce=_[_0xc583('0x32')](db[_0xc583('0x33')]['rawAttributes'],function(_0x3e41c0){return{'name':_0x3e41c0[_0xc583('0x34')],'type':_0x3e41c0[_0xc583('0x35')]['key']};});_0x299551[_0xc583('0x36')]=_['map'](_0x20bbce,_0xc583('0x30'));_0x299551[_0xc583('0x37')]=_[_0xc583('0x38')](_0x2246dd[_0xc583('0x37')]);_0x299551[_0xc583('0x39')]=_['intersection'](_0x299551[_0xc583('0x36')],_0x299551['query']);_0x510931[_0xc583('0x3a')]=_['intersection'](_0x299551[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x2246dd[_0xc583('0x37')][_0xc583('0x3b')]));_0x510931[_0xc583('0x3a')]=_0x510931[_0xc583('0x3a')]['length']?_0x510931['attributes']:_0x299551[_0xc583('0x36')];if(!_0x2246dd[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x510931[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x2246dd[_0xc583('0x37')][_0xc583('0x22')]);_0x510931[_0xc583('0x21')]=qs['offset'](_0x2246dd[_0xc583('0x37')]['offset']);}_0x510931[_0xc583('0x3d')]=qs[_0xc583('0x3e')](_0x2246dd[_0xc583('0x37')]['sort']);_0x510931['where']=qs['filters'](_[_0xc583('0x3f')](_0x2246dd[_0xc583('0x37')],_0x299551[_0xc583('0x39')]),_0x20bbce);if(_0x2246dd[_0xc583('0x37')]['filter']){_0x510931[_0xc583('0x40')]=_[_0xc583('0x41')](_0x510931['where'],{'$or':_['map'](_0x20bbce,function(_0x1ea5da){if(_0x1ea5da['type']!==_0xc583('0x42')){var _0x1ec6f9={};_0x1ec6f9[_0x1ea5da[_0xc583('0x30')]]={'$like':'%'+_0x2246dd[_0xc583('0x37')]['filter']+'%'};return _0x1ec6f9;}})});}_0x510931=_[_0xc583('0x41')]({},_0x510931,_0x2246dd[_0xc583('0x43')]);var _0x39c5ab={'where':_0x510931[_0xc583('0x40')]};return db[_0xc583('0x33')]['count'](_0x39c5ab)[_0xc583('0x29')](function(_0x5f5a97){_0x2df18d['count']=_0x5f5a97;if(_0x2246dd[_0xc583('0x37')][_0xc583('0x44')]){_0x510931['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xc583('0x45')](_0x510931);})[_0xc583('0x29')](function(_0x7d1b29){_0x2df18d[_0xc583('0x46')]=_0x7d1b29;return _0x2df18d;})['then'](respondWithFilteredResult(_0x58d97f,_0x510931))[_0xc583('0x47')](handleError(_0x58d97f,null));};exports['show']=function(_0x8c8209,_0x4edac2){var _0x28ab1a={'raw':![],'where':{'id':_0x8c8209[_0xc583('0x48')]['id']}},_0x14e9ad={};_0x14e9ad[_0xc583('0x36')]=_[_0xc583('0x38')](db['VoicePrefix'][_0xc583('0x49')]);_0x14e9ad[_0xc583('0x37')]=_[_0xc583('0x38')](_0x8c8209['query']);_0x14e9ad['filters']=_['intersection'](_0x14e9ad[_0xc583('0x36')],_0x14e9ad['query']);_0x28ab1a[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x14e9ad[_0xc583('0x36')],qs[_0xc583('0x3b')](_0x8c8209[_0xc583('0x37')][_0xc583('0x3b')]));_0x28ab1a[_0xc583('0x3a')]=_0x28ab1a[_0xc583('0x3a')][_0xc583('0x4b')]?_0x28ab1a[_0xc583('0x3a')]:_0x14e9ad[_0xc583('0x36')];if(_0x8c8209['query'][_0xc583('0x44')]){_0x28ab1a[_0xc583('0x4c')]=[{'all':!![]}];}_0x28ab1a=_[_0xc583('0x41')]({},_0x28ab1a,_0x8c8209[_0xc583('0x43')]);return db['VoicePrefix'][_0xc583('0x4d')](_0x28ab1a)[_0xc583('0x29')](handleEntityNotFound(_0x4edac2,null))[_0xc583('0x29')](respondWithResult(_0x4edac2,null))[_0xc583('0x47')](handleError(_0x4edac2,null));};exports[_0xc583('0x2a')]=function(_0x22da88,_0x3f60ae){return db[_0xc583('0x33')][_0xc583('0x4d')]({'where':{'id':_0x22da88['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3f60ae,null))[_0xc583('0x29')](removeEntity(_0x3f60ae,null))[_0xc583('0x47')](handleError(_0x3f60ae,null));};exports[_0xc583('0x4e')]=function(_0x3c442e,_0xc42b2a){return db[_0xc583('0x33')][_0xc583('0x4e')]()[_0xc583('0x29')](respondWithResult(_0xc42b2a,null))[_0xc583('0x47')](handleError(_0xc42b2a,null));};exports[_0xc583('0x4f')]=function(_0x7be0b3,_0x305239){var _0x4c486b;return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x44413e){return db[_0xc583('0x33')][_0xc583('0x4f')](_0x7be0b3[_0xc583('0x52')],{'transaction':_0x44413e})[_0xc583('0x29')](function(_0x1aff76){_0x4c486b=_0x1aff76[_0xc583('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0xc583('0x4d')]({'where':{'id':_0x4c486b[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x59ce34){return createVoicePrefixExtensions(_0x4c486b,_0x59ce34,_0x44413e);});});})['then'](function(){var _0x2bb764=_0x7be0b3['user'][_0xc583('0x2b')]({'plain':!![]});if(!_0x2bb764)throw new Error(_0xc583('0x54'));if(_0x2bb764['role']==='user'){var _0x282290=_0x4c486b;return db[_0xc583('0x55')][_0xc583('0x4d')]({'where':{'name':_0xc583('0x56'),'userProfileId':_0x2bb764[_0xc583('0x57')]},'raw':!![]})[_0xc583('0x29')](function(_0x3e2758){if(_0x3e2758&&_0x3e2758[_0xc583('0x58')]===0x0){return db['UserProfileResource'][_0xc583('0x4f')]({'name':_0x282290[_0xc583('0x30')],'resourceId':_0x282290['id'],'type':_0x3e2758[_0xc583('0x30')],'sectionId':_0x3e2758['id']},{})[_0xc583('0x29')](function(){return _0x4c486b;});}else{return _0x4c486b;}})['catch'](function(_0x43fda1){logger[_0xc583('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43fda1);throw _0x43fda1;});}return _0x4c486b;})['then'](respondWithResult(_0x305239,null))[_0xc583('0x47')](handleError(_0x305239,null));};function Extension(_0x5ccfe7,_0x30b1e0,_0x1ba5cc,_0x40e8a6){this['context']='from-sip';this[_0xc583('0x59')]=_0x5ccfe7;this[_0xc583('0x5a')]=_0x1ba5cc;this[_0xc583('0x35')]=_0xc583('0x5b');this['description']=_0xc583('0x5c');this[_0xc583('0x5d')]=_0x30b1e0;this['appdata']=_0x40e8a6;}function createVoicePrefixExtensions(_0x508f4b,_0x28013a,_0x579c62){return new BPromise(function(_0x5df37d,_0x507f18){var _0x415b0f=new Extension(formatPrefixName(_0x508f4b[_0xc583('0x5e')]),0x1,_0xc583('0x5f'),_0xc583('0x60'));_0x415b0f['VoicePrefixId']=_0x508f4b['id'];return db['VoiceExtension'][_0xc583('0x4f')](_0x415b0f,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x599663){var _0x52cd21=_0x599663[_0xc583('0x2b')]({'plain':!![]});var _0x48f217=_[_0xc583('0x32')](addVoicePrefixExtensions(_0x508f4b,_0x28013a),function(_0x43f208){_0x43f208['VoiceExtensionId']=_0x52cd21['id'];_0x43f208[_0xc583('0x61')]=_0x508f4b['id'];return _0x43f208;});return db['VoiceExtension'][_0xc583('0x62')](_0x48f217,{'transaction':_0x579c62})[_0xc583('0x29')](function(_0x4b3f49){if(!_0x4b3f49){return _0x507f18(_0xc583('0x63'));}else{return _0x5df37d(_0x4b3f49);}})[_0xc583('0x47')](function(_0x20783b){return _0x507f18(_0x20783b);});});;});};function addVoicePrefixExtensions(_0xf4bc67,_0x1b5003){var _0x330a8e=[];var _0x37613c=formatPrefixName(_0xf4bc67[_0xc583('0x5e')]);_0x330a8e['push'](new Extension(_0x37613c,0x2,'Set','CDR(prefix)='+_0xf4bc67[_0xc583('0x30')]));if(_0xf4bc67['callerIdAll']){_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x65'),_0xc583('0x66')+_0xf4bc67[_0xc583('0x67')]));}else{_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x3,_0xc583('0x5f'),_0xc583('0x68')));}_0x330a8e[_0xc583('0x64')](new Extension(_0x37613c,0x4,'goto',_0x1b5003[_0xc583('0x69')]+','+_0xc583('0x6a')+(0x8+_0xf4bc67[_0xc583('0x30')][_0xc583('0x4b')])+'}'+','+0x1));return _0x330a8e;}function formatPrefixName(_0x41a064){var _0xb243ac='_';for(var _0x548f1c=0x0;_0x548f1c<_0x41a064[_0xc583('0x4b')];_0x548f1c++){if(_0x41a064[_0xc583('0x6b')](_0x548f1c)=='-'){_0xb243ac+=_0x41a064[_0xc583('0x6b')](_0x548f1c);}else{_0xb243ac+='['+_0x41a064[_0xc583('0x6b')](_0x548f1c)+']';}}_0xb243ac+='.';return _0xb243ac;}exports[_0xc583('0x28')]=function(_0x2b719f,_0x547d2f,_0x3e4616){var _0x1b6948=_0x2b719f[_0xc583('0x52')];_0x1b6948['prefix']=_0xc583('0x6c')+_0x1b6948['name']+'-';return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x240174){return db[_0xc583('0x33')][_0xc583('0x28')](_0x1b6948,{'where':{'id':_0x1b6948['id']},'transaction':_0x240174})[_0xc583('0x29')](function(){return db[_0xc583('0x6d')]['destroy']({'where':{'VoicePrefixId':_0x1b6948['id']},'transaction':_0x240174})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x1b6948[_0xc583('0x53')]},'raw':!![]})[_0xc583('0x29')](function(_0x3a2a5c){return createVoicePrefixExtensions(_0x1b6948,_0x3a2a5c,_0x240174);});});});})[_0xc583('0x29')](function(){return db[_0xc583('0x33')][_0xc583('0x6e')](_0x1b6948['id']);})[_0xc583('0x29')](respondWithResult(_0x547d2f,null))[_0xc583('0x47')](handleError(_0x547d2f,null));};exports[_0xc583('0x6f')]=function(_0x1b8304,_0x4c9516,_0x22b75d){return db[_0xc583('0x33')]['find']({'where':{'id':_0x1b8304['params']['id']}})['then'](handleEntityNotFound(_0x4c9516,null))[_0xc583('0x29')](function(_0x10037e){if(_0x10037e){return _0x10037e[_0xc583('0x6f')](_0x1b8304[_0xc583('0x52')][_0xc583('0x70')],_[_0xc583('0x71')](_0x1b8304[_0xc583('0x52')],[_0xc583('0x70'),'id'])||{})[_0xc583('0x72')](function(_0x516fcb){for(var _0x442844=0x0;_0x442844<_0x1b8304[_0xc583('0x52')]['ids'][_0xc583('0x4b')];_0x442844+=0x1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':Number(_0x1b8304[_0xc583('0x52')][_0xc583('0x70')][_0x442844]),'VoicePrefixId':Number(_0x1b8304['params']['id'])});}return _0x516fcb;});}})[_0xc583('0x29')](respondWithResult(_0x4c9516,null))[_0xc583('0x47')](handleError(_0x4c9516,null));};exports[_0xc583('0x75')]=function(_0x2f0aa9,_0x50ef13,_0x4d6582){return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x2f0aa9['params']['id']}})['then'](handleEntityNotFound(_0x50ef13,null))['then'](function(_0x1c7323){if(_0x1c7323){return _0x1c7323[_0xc583('0x75')](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])[_0xc583('0x29')](function(){if(_['isArray'](_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')])){for(var _0x9a09b0=0x0;_0x9a09b0<_0x2f0aa9['query'][_0xc583('0x70')][_0xc583('0x4b')];_0x9a09b0+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')][_0x9a09b0]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}}else{socket[_0xc583('0x73')](_0xc583('0x76'),{'UserId':Number(_0x2f0aa9[_0xc583('0x37')][_0xc583('0x70')]),'VoicePrefixId':Number(_0x2f0aa9[_0xc583('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x50ef13,null))[_0xc583('0x47')](handleError(_0x50ef13,null));};exports[_0xc583('0x77')]=function(_0x3ea593,_0x3eabb9,_0x674d99){var _0x2b98b7={};var _0x20c4e6={};var _0x149051;var _0x1f0ab4;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x3ea593[_0xc583('0x48')]['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x3eabb9,null))[_0xc583('0x29')](function(_0x42ff52){if(_0x42ff52){_0x149051=_0x42ff52;_0x20c4e6[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x79')][_0xc583('0x49')]);_0x20c4e6[_0xc583('0x37')]=_[_0xc583('0x38')](_0x3ea593[_0xc583('0x37')]);_0x20c4e6[_0xc583('0x39')]=_[_0xc583('0x4a')](_0x20c4e6['model'],_0x20c4e6['query']);_0x2b98b7[_0xc583('0x3a')]=_[_0xc583('0x4a')](_0x20c4e6['model'],qs['fields'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3b')]));_0x2b98b7['attributes']=_0x2b98b7['attributes'][_0xc583('0x4b')]?_0x2b98b7[_0xc583('0x3a')]:_0x20c4e6[_0xc583('0x36')];_0x2b98b7['order']=qs['sort'](_0x3ea593[_0xc583('0x37')][_0xc583('0x3e')]);_0x2b98b7[_0xc583('0x40')]=qs['filters'](_[_0xc583('0x3f')](_0x3ea593[_0xc583('0x37')],_0x20c4e6['filters']));if(_0x3ea593[_0xc583('0x37')][_0xc583('0x7a')]){_0x2b98b7[_0xc583('0x40')]=_[_0xc583('0x41')](_0x2b98b7[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0x2b98b7[_0xc583('0x3a')],function(_0x47e7f8){var _0x4a2671={};_0x4a2671[_0x47e7f8]={'$like':'%'+_0x3ea593['query'][_0xc583('0x7a')]+'%'};return _0x4a2671;})});}_0x2b98b7=_[_0xc583('0x41')]({},_0x2b98b7,_0x3ea593[_0xc583('0x43')]);return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3ab1a1){if(_0x3ab1a1){_0x1f0ab4=_0x3ab1a1[_0xc583('0x4b')];if(!_0x3ea593[_0xc583('0x37')]['hasOwnProperty'](_0xc583('0x3c'))){_0x2b98b7[_0xc583('0x22')]=qs[_0xc583('0x22')](_0x3ea593[_0xc583('0x37')]['limit']);_0x2b98b7['offset']=qs['offset'](_0x3ea593[_0xc583('0x37')][_0xc583('0x21')]);}return _0x149051[_0xc583('0x77')](_0x2b98b7);}})[_0xc583('0x29')](function(_0x3a04a6){if(_0x3a04a6){return _0x3a04a6?{'count':_0x1f0ab4,'rows':_0x3a04a6}:null;}})[_0xc583('0x29')](respondWithResult(_0x3eabb9,null))['catch'](handleError(_0x3eabb9,null));};exports['getTeams']=function(_0x1907ff,_0x422848,_0x492e13){var _0xc11b2e={};var _0x1a2a0d={};var _0x2f6ea4;var _0x3e4c37;return db[_0xc583('0x33')][_0xc583('0x78')]({'where':{'id':_0x1907ff['params']['id']}})[_0xc583('0x29')](handleEntityNotFound(_0x422848,null))[_0xc583('0x29')](function(_0x3eb4a8){if(_0x3eb4a8){_0x2f6ea4=_0x3eb4a8;_0x1a2a0d[_0xc583('0x36')]=_[_0xc583('0x38')](db[_0xc583('0x7b')][_0xc583('0x49')]);_0x1a2a0d[_0xc583('0x37')]=_[_0xc583('0x38')](_0x1907ff[_0xc583('0x37')]);_0x1a2a0d['filters']=_[_0xc583('0x4a')](_0x1a2a0d[_0xc583('0x36')],_0x1a2a0d[_0xc583('0x37')]);_0xc11b2e['attributes']=_[_0xc583('0x4a')](_0x1a2a0d['model'],qs[_0xc583('0x3b')](_0x1907ff[_0xc583('0x37')][_0xc583('0x3b')]));_0xc11b2e[_0xc583('0x3a')]=_0xc11b2e[_0xc583('0x3a')][_0xc583('0x4b')]?_0xc11b2e[_0xc583('0x3a')]:_0x1a2a0d['model'];_0xc11b2e[_0xc583('0x3d')]=qs['sort'](_0x1907ff[_0xc583('0x37')]['sort']);_0xc11b2e[_0xc583('0x40')]=qs[_0xc583('0x39')](_[_0xc583('0x3f')](_0x1907ff[_0xc583('0x37')],_0x1a2a0d[_0xc583('0x39')]));if(_0x1907ff[_0xc583('0x37')][_0xc583('0x7a')]){_0xc11b2e[_0xc583('0x40')]=_['merge'](_0xc11b2e[_0xc583('0x40')],{'$or':_[_0xc583('0x32')](_0xc11b2e[_0xc583('0x3a')],function(_0x3ae684){var _0x424cd7={};_0x424cd7[_0x3ae684]={'$like':'%'+_0x1907ff['query'][_0xc583('0x7a')]+'%'};return _0x424cd7;})});}_0xc11b2e=_[_0xc583('0x41')]({},_0xc11b2e,_0x1907ff[_0xc583('0x43')]);return _0x2f6ea4['getTeams'](_0xc11b2e);}})['then'](function(_0xbbdcc4){if(_0xbbdcc4){_0x3e4c37=_0xbbdcc4[_0xc583('0x4b')];if(!_0x1907ff[_0xc583('0x37')][_0xc583('0x7c')](_0xc583('0x3c'))){_0xc11b2e[_0xc583('0x22')]=qs['limit'](_0x1907ff[_0xc583('0x37')][_0xc583('0x22')]);_0xc11b2e[_0xc583('0x21')]=qs[_0xc583('0x21')](_0x1907ff[_0xc583('0x37')]['offset']);}return _0x2f6ea4[_0xc583('0x7d')](_0xc11b2e);}})['then'](function(_0x1371a2){if(_0x1371a2){return _0x1371a2?{'count':_0x3e4c37,'rows':_0x1371a2}:null;}})['then'](respondWithResult(_0x422848,null))[_0xc583('0x47')](handleError(_0x422848,null));};exports[_0xc583('0x7e')]=function(_0x5b9b20,_0x5ebdb6,_0x1f1dfc){var _0x3f8a4e=_0x5b9b20[_0xc583('0x52')][_0xc583('0x70')];var _0x43e533;return db['Team'][_0xc583('0x45')]({'where':{'id':_0x3f8a4e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id',_0xc583('0x30'),_0xc583('0x80'),_0xc583('0x81'),'interface'],'raw':!![]}]})['then'](function(_0x54f43b){if(_0x54f43b){_0x43e533=_0x54f43b;var _0x1cbdea=_[_0xc583('0x82')](_0x54f43b,function(_0x2afb8c){var _0x5252a8=_0x2afb8c[_0xc583('0x2b')]({'plain':!![]});return _0x5252a8[_0xc583('0x7f')];});return db['VoicePrefix'][_0xc583('0x4d')]({'where':{'id':_0x5b9b20['params']['id']}})[_0xc583('0x29')](function(_0x3d1570){return db[_0xc583('0x50')][_0xc583('0x51')](function(_0x48e574){return _0x3d1570[_0xc583('0x7e')](_0x3f8a4e,{'transaction':_0x48e574})[_0xc583('0x29')](function(){return BPromise[_0xc583('0x83')](_0x43e533,function(_0x499821){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x499821['id'],'VoicePrefixId':_0x5b9b20[_0xc583('0x48')]['id']},{'transaction':_0x48e574});});})[_0xc583('0x29')](function(){return BPromise['each'](_0x1cbdea,function(_0x363a8e){return db[_0xc583('0x84')]['findOrCreate']({'where':{'UserId':_0x363a8e['id'],'VoicePrefixId':_0x5b9b20['params']['id']},'transaction':_0x48e574});});})[_0xc583('0x29')](function(){_0x1cbdea['forEach'](function(_0x790cd1){socket[_0xc583('0x73')](_0xc583('0x74'),{'UserId':_0x790cd1['id'],'VoicePrefixId':_0x3d1570['id']});});});});});}})[_0xc583('0x29')](respondWithStatusCode(_0x5ebdb6,null))[_0xc583('0x47')](handleError(_0x5ebdb6,null));};exports[_0xc583('0x85')]=function(_0x59781d,_0x3bcbce,_0x1628f4){return db[_0xc583('0x7b')][_0xc583('0x45')]({'where':{'id':_0x59781d[_0xc583('0x37')][_0xc583('0x70')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc583('0x7f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3bcbce,null))[_0xc583('0x29')](function(_0x146b9c){var _0x4a6c7c=_['map'](_0x146b9c,'id');var _0x42b5a5=[];var _0x583588=[];var _0x564e57=squel[_0xc583('0x86')]();_0x564e57['field'](_0xc583('0x87'))[_0xc583('0x88')](_0xc583('0x89'),'tq')[_0xc583('0x8a')]('user_has_teams','ut',_0xc583('0x8b'))[_0xc583('0x40')](_0xc583('0x8c'),_0x59781d[_0xc583('0x48')]['id']);for(var _0x162607=0x0;_0x162607<_0x146b9c[_0xc583('0x4b')];_0x162607+=0x1){let _0x39a000=_0x146b9c[_0x162607];for(var _0x63eee8=0x0;_0x63eee8<_0x39a000[_0xc583('0x7f')][_0xc583('0x4b')];_0x63eee8+=0x1){let _0x459caf=_0x39a000[_0xc583('0x7f')][_0x63eee8];var _0x4075bd=_0x564e57['clone']();_0x4075bd[_0xc583('0x40')](_0xc583('0x8d'),_0x459caf['id']);_0x583588[_0xc583('0x64')](db[_0xc583('0x50')][_0xc583('0x37')](_0x4075bd[_0xc583('0x8e')](),{'type':db[_0xc583('0x50')][_0xc583('0x8f')]['SELECT']})[_0xc583('0x29')](function(_0x7ac229){if(_0x7ac229['length']===0x1){return _0x459caf['id'];}else{var _0x56cc96=_[_0xc583('0x90')](_[_0xc583('0x32')](_0x7ac229,'TeamId'),function(_0x25dde6){return _['includes'](_0x4a6c7c,_0x25dde6);});if(_0x56cc96){return _0x459caf['id'];}}}));}}return BPromise[_0xc583('0x91')](_0x583588)[_0xc583('0x29')](function(_0x1de88f){_0x42b5a5=_(_0x42b5a5)[_0xc583('0x92')](_0x1de88f)[_0xc583('0x93')]()[_0xc583('0x94')]();return db[_0xc583('0x33')]['find']({'where':{'id':_0x59781d['params']['id']}})[_0xc583('0x29')](function(_0x592b63){return db[_0xc583('0x50')]['transaction'](function(_0x440079){return _0x592b63[_0xc583('0x85')](_0x59781d['query'][_0xc583('0x70')],{'transaction':_0x440079})[_0xc583('0x29')](function(){if(!_[_0xc583('0x95')](_0x42b5a5)){return _0x592b63[_0xc583('0x75')](_0x42b5a5,{'transaction':_0x440079});}})['then'](function(){_0x42b5a5[_0xc583('0x96')](function(_0x182c40){socket[_0xc583('0x73')]('userVoicePrefix:remove',{'UserId':_0x182c40,'VoicePrefixId':_0x592b63['id']});});});});});});})[_0xc583('0x29')](respondWithStatusCode(_0x3bcbce,null))[_0xc583('0x47')](handleError(_0x3bcbce,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 4f015c4..b5e736b 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 _0xe5df=['exports','events','../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe5df,0xf4));var _0xfe5d=function(_0x481094,_0x141c18){_0x481094=_0x481094-0x0;var _0x2700f4=_0xe5df[_0x481094];return _0x2700f4;};'use strict';var EventEmitter=require(_0xfe5d('0x0'));var VoicePrefix=require(_0xfe5d('0x1'))['db'][_0xfe5d('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xfe5d('0x3')](0x0);var events={'afterCreate':_0xfe5d('0x4'),'afterUpdate':_0xfe5d('0x5'),'afterDestroy':_0xfe5d('0x6')};function emitEvent(_0x21726b){return function(_0x1ce151,_0x3812f5,_0x572f58){VoicePrefixEvents[_0xfe5d('0x7')](_0x21726b+':'+_0x1ce151['id'],_0x1ce151);VoicePrefixEvents[_0xfe5d('0x7')](_0x21726b,_0x1ce151);_0x572f58(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xfe5d('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x2663=['VoicePrefix','setMaxListeners','update','remove','emit','exports','../../mysqldb'];(function(_0x161ab7,_0x5d1568){var _0x4c7294=function(_0x3e94b9){while(--_0x3e94b9){_0x161ab7['push'](_0x161ab7['shift']());}};_0x4c7294(++_0x5d1568);}(_0x2663,0x141));var _0x3266=function(_0x382bdd,_0x4e0534){_0x382bdd=_0x382bdd-0x0;var _0x1f29d8=_0x2663[_0x382bdd];return _0x1f29d8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x3266('0x0'))['db'][_0x3266('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x3266('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3266('0x3'),'afterDestroy':_0x3266('0x4')};function emitEvent(_0x177c02){return function(_0xe6d2d6,_0x112d7e,_0x282aed){VoicePrefixEvents[_0x3266('0x5')](_0x177c02+':'+_0xe6d2d6['id'],_0xe6d2d6);VoicePrefixEvents['emit'](_0x177c02,_0xe6d2d6);_0x282aed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x3266('0x6')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index e639033..03d0983 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 _0xaed4=['rimraf','../../config/environment','./voicePrefix.attributes','define','voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1958e3,_0x5d679f){var _0x35aa7f=function(_0x5723eb){while(--_0x5723eb){_0x1958e3['push'](_0x1958e3['shift']());}};_0x35aa7f(++_0x5d679f);}(_0xaed4,0x68));var _0x4aed=function(_0xf9f4c3,_0x3c240c){_0xf9f4c3=_0xf9f4c3-0x0;var _0x5ce2df=_0xaed4[_0xf9f4c3];return _0x5ce2df;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4aed('0x0'))(_0x4aed('0x1'));var moment=require(_0x4aed('0x2'));var BPromise=require(_0x4aed('0x3'));var rp=require(_0x4aed('0x4'));var fs=require('fs');var path=require(_0x4aed('0x5'));var rimraf=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var attributes=require(_0x4aed('0x8'));module['exports']=function(_0x95f2d8,_0x3a3dbb){return _0x95f2d8[_0x4aed('0x9')]('VoicePrefix',attributes,{'tableName':_0x4aed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x266a=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x266a,0x103));var _0xa266=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x266a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa266('0x0'));var util=require(_0xa266('0x1'));var logger=require('../../config/logger')(_0xa266('0x2'));var moment=require(_0xa266('0x3'));var BPromise=require(_0xa266('0x4'));var rp=require(_0xa266('0x5'));var fs=require('fs');var path=require(_0xa266('0x6'));var rimraf=require(_0xa266('0x7'));var config=require(_0xa266('0x8'));var attributes=require(_0xa266('0x9'));module['exports']=function(_0x41ae2f,_0x485154){return _0x41ae2f[_0xa266('0xa')](_0xa266('0xb'),attributes,{'tableName':_0xa266('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 6d85e0e..8ec5306 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 _0x01d9=['rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x41e05c,_0xab5693){var _0x124390=function(_0xe5f2b){while(--_0xe5f2b){_0x41e05c['push'](_0x41e05c['shift']());}};_0x124390(++_0xab5693);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});config[_0x901d('0xc')]=_[_0x901d('0xd')](config[_0x901d('0xc')],{'host':_0x901d('0xe'),'port':0x18eb});var socket=require(_0x901d('0xf'))(new Redis(config[_0x901d('0xc')]));require(_0x901d('0x10'))[_0x901d('0x11')](socket);function respondWithRpcPromise(_0xacff40,_0x440fb0,_0xd819f0){return new BPromise(function(_0x1d3137,_0x5d74e2){return client[_0x901d('0x12')](_0xacff40,_0xd819f0)['then'](function(_0x220153){logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));logger[_0x901d('0x16')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x440fb0,_0x901d('0x15'),JSON[_0x901d('0x17')](_0x220153));if(_0x220153[_0x901d('0x18')]){if(_0x220153[_0x901d('0x18')][_0x901d('0x19')]===0x1f4){logger[_0x901d('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x5d74e2(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}logger[_0x901d('0x18')](_0x901d('0x14'),_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x1d3137(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}else{logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));_0x1d3137(_0x220153[_0x901d('0x1b')][_0x901d('0x1a')]);}})[_0x901d('0x1c')](function(_0xf3c66a){logger[_0x901d('0x18')]('VoicePrefix,\x20%s,\x20%s',_0x440fb0,_0xf3c66a);_0x5d74e2(_0xf3c66a);});});} \ No newline at end of file +var _0xf0f4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./voicePrefix.socket','register','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','randomstring','ioredis','../../config/utils'];(function(_0x13f05f,_0x1c4b2f){var _0x585afd=function(_0x119d6d){while(--_0x119d6d){_0x13f05f['push'](_0x13f05f['shift']());}};_0x585afd(++_0x1c4b2f);}(_0xf0f4,0x182));var _0x4f0f=function(_0x410d40,_0x564f4b){_0x410d40=_0x410d40-0x0;var _0x4895d7=_0xf0f4[_0x410d40];return _0x4895d7;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4f0f('0x1'));var fs=require('fs');var Redis=require(_0x4f0f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f0f('0x3'));var logger=require(_0x4f0f('0x4'))(_0x4f0f('0x5'));var config=require(_0x4f0f('0x6'));var jayson=require(_0x4f0f('0x7'));var client=jayson[_0x4f0f('0x8')][_0x4f0f('0x9')]({'port':0x232a});config['redis']=_[_0x4f0f('0xa')](config[_0x4f0f('0xb')],{'host':_0x4f0f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f0f('0xb')]));require(_0x4f0f('0xd'))[_0x4f0f('0xe')](socket);function respondWithRpcPromise(_0x3754fc,_0x343c30,_0xb41508){return new BPromise(function(_0x9533a3,_0x2b2e49){return client['request'](_0x3754fc,_0xb41508)[_0x4f0f('0xf')](function(_0x315d01){logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x343c30,_0x4f0f('0x12'));logger[_0x4f0f('0x13')](_0x4f0f('0x14'),_0x343c30,_0x4f0f('0x12'),JSON[_0x4f0f('0x15')](_0x315d01));if(_0x315d01[_0x4f0f('0x16')]){if(_0x315d01[_0x4f0f('0x16')]['code']===0x1f4){logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x315d01[_0x4f0f('0x16')][_0x4f0f('0x17')]);return _0x2b2e49(_0x315d01['error'][_0x4f0f('0x17')]);}logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x315d01[_0x4f0f('0x16')][_0x4f0f('0x17')]);return _0x9533a3(_0x315d01['error'][_0x4f0f('0x17')]);}else{logger[_0x4f0f('0x10')](_0x4f0f('0x11'),_0x343c30,'request\x20sent');_0x9533a3(_0x315d01[_0x4f0f('0x18')][_0x4f0f('0x17')]);}})[_0x4f0f('0x19')](function(_0x5f5363){logger[_0x4f0f('0x16')](_0x4f0f('0x11'),_0x343c30,_0x5f5363);_0x2b2e49(_0x5f5363);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index eeb41a8..0752888 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 _0xe3ed=['update','emit','removeListener','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x18cebd,_0x5f138f){var _0x4c702f=function(_0x354a87){while(--_0x354a87){_0x18cebd['push'](_0x18cebd['shift']());}};_0x4c702f(++_0x5f138f);}(_0xe3ed,0x8d));var _0xde3e=function(_0xdcb78b,_0xdc4276){_0xdcb78b=_0xdcb78b-0x0;var _0xe7fc5a=_0xe3ed[_0xdcb78b];return _0xe7fc5a;};'use strict';var VoicePrefixEvents=require(_0xde3e('0x0'));var events=[_0xde3e('0x1'),_0xde3e('0x2'),_0xde3e('0x3')];function createListener(_0x2defe9,_0x1e19c3){return function(_0xe7a1f1){_0x1e19c3[_0xde3e('0x4')](_0x2defe9,_0xe7a1f1);};}function removeListener(_0x53b14b,_0xe768f5){return function(){VoicePrefixEvents[_0xde3e('0x5')](_0x53b14b,_0xe768f5);};}exports['register']=function(_0x3405cc){for(var _0x5e9013=0x0,_0x184b02=events[_0xde3e('0x6')];_0x5e9013<_0x184b02;_0x5e9013++){var _0x47e97f=events[_0x5e9013];var _0x3e0bb4=createListener(_0xde3e('0x7')+_0x47e97f,_0x3405cc);VoicePrefixEvents['on'](_0x47e97f,_0x3e0bb4);}}; \ No newline at end of file +var _0x0f73=['register','length','./voicePrefix.events','save','remove','emit'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0f73,0x146));var _0x30f7=function(_0x3fd6cb,_0x573459){_0x3fd6cb=_0x3fd6cb-0x0;var _0x4cc4e9=_0x0f73[_0x3fd6cb];return _0x4cc4e9;};'use strict';var VoicePrefixEvents=require(_0x30f7('0x0'));var events=[_0x30f7('0x1'),_0x30f7('0x2'),'update'];function createListener(_0x4c2a71,_0x3dd283){return function(_0x3f09ff){_0x3dd283[_0x30f7('0x3')](_0x4c2a71,_0x3f09ff);};}function removeListener(_0x2cb0f6,_0x2be91f){return function(){VoicePrefixEvents['removeListener'](_0x2cb0f6,_0x2be91f);};}exports[_0x30f7('0x4')]=function(_0x593fe7){for(var _0x49b5b8=0x0,_0x38ad1d=events[_0x30f7('0x5')];_0x49b5b8<_0x38ad1d;_0x49b5b8++){var _0x2de5e7=events[_0x49b5b8];var _0x7e377e=createListener('voicePrefix:'+_0x2de5e7,_0x593fe7);VoicePrefixEvents['on'](_0x2de5e7,_0x7e377e);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 2d32dcb..06b6cef 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 _0xf08d=['/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','show','/:id/hopper_histories','getHopperHistories'];(function(_0x1646cd,_0x1044f5){var _0x757a50=function(_0x88ec97){while(--_0x88ec97){_0x1646cd['push'](_0x1646cd['shift']());}};_0x757a50(++_0x1044f5);}(_0xf08d,0x99));var _0xdf08=function(_0x1bc934,_0x12b5e0){_0x1bc934=_0x1bc934-0x0;var _0x341e5a=_0xf08d[_0x1bc934];return _0x341e5a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xdf08('0x0'));var timeout=require(_0xdf08('0x1'));var express=require(_0xdf08('0x2'));var router=express[_0xdf08('0x3')]();var fs_extra=require(_0xdf08('0x4'));var auth=require(_0xdf08('0x5'));var interaction=require(_0xdf08('0x6'));var config=require(_0xdf08('0x7'));var controller=require(_0xdf08('0x8'));router['get']('/',auth[_0xdf08('0x9')](),controller[_0xdf08('0xa')]);router[_0xdf08('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdf08('0xc')]);router[_0xdf08('0xb')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router[_0xdf08('0xb')](_0xdf08('0xd'),auth[_0xdf08('0x9')](),controller[_0xdf08('0xe')]);router[_0xdf08('0xb')](_0xdf08('0xf'),auth[_0xdf08('0x9')](),controller['getHopperFinals']);router['get'](_0xdf08('0x10'),auth['isAuthenticated'](),controller[_0xdf08('0x11')]);router['get'](_0xdf08('0x12'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x13')]);router['get'](_0xdf08('0x14'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x15')]);router[_0xdf08('0xb')](_0xdf08('0x16'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x17')]);router[_0xdf08('0xb')](_0xdf08('0x18'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x19')]);router[_0xdf08('0xb')](_0xdf08('0x1a'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x1b')]);router[_0xdf08('0x1c')]('/',auth['isAuthenticated'](),controller[_0xdf08('0x1d')]);router[_0xdf08('0x1c')]('/:id/clone',auth['isAuthenticated'](),controller[_0xdf08('0x1e')]);router[_0xdf08('0x1c')](_0xdf08('0x12'),auth[_0xdf08('0x9')](),controller['addTeams']);router[_0xdf08('0x1c')](_0xdf08('0x14'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x1f')]);router[_0xdf08('0x1c')](_0xdf08('0x18'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x20')]);router[_0xdf08('0x1c')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xdf08('0x21')]);router[_0xdf08('0x22')](_0xdf08('0x23'),auth['isAuthenticated'](),controller[_0xdf08('0x24')]);router[_0xdf08('0x25')](_0xdf08('0x23'),auth[_0xdf08('0x9')](),controller['destroy']);router[_0xdf08('0x25')](_0xdf08('0x12'),auth['isAuthenticated'](),controller[_0xdf08('0x26')]);router['delete'](_0xdf08('0x14'),auth['isAuthenticated'](),controller['removeAgents']);router[_0xdf08('0x25')](_0xdf08('0x18'),auth[_0xdf08('0x9')](),controller[_0xdf08('0x27')]);router[_0xdf08('0x25')](_0xdf08('0x1a'),auth['isAuthenticated'](),controller[_0xdf08('0x28')]);module[_0xdf08('0x29')]=router; \ No newline at end of file +var _0x0c29=['/:id/users','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addAgents','addLists','addBlackLists','put','destroy','delete','removeBlackLists','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','show','/:id/hoppers','isAuthenticated','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams'];(function(_0x5dbdbc,_0x35fee0){var _0x258f29=function(_0x265af9){while(--_0x265af9){_0x5dbdbc['push'](_0x5dbdbc['shift']());}};_0x258f29(++_0x35fee0);}(_0x0c29,0xd3));var _0x90c2=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0x0c29[_0x196e1b];return _0x5e1f18;};'use strict';var multer=require(_0x90c2('0x0'));var util=require(_0x90c2('0x1'));var path=require(_0x90c2('0x2'));var timeout=require(_0x90c2('0x3'));var express=require(_0x90c2('0x4'));var router=express['Router']();var fs_extra=require(_0x90c2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x90c2('0x6'));var config=require(_0x90c2('0x7'));var controller=require(_0x90c2('0x8'));router[_0x90c2('0x9')]('/',auth['isAuthenticated'](),controller[_0x90c2('0xa')]);router[_0x90c2('0x9')](_0x90c2('0xb'),auth['isAuthenticated'](),controller[_0x90c2('0xc')]);router[_0x90c2('0x9')](_0x90c2('0xd'),auth[_0x90c2('0xe')](),controller[_0x90c2('0xf')]);router[_0x90c2('0x9')]('/:id/hopper_histories',auth[_0x90c2('0xe')](),controller[_0x90c2('0x10')]);router['get'](_0x90c2('0x11'),auth['isAuthenticated'](),controller[_0x90c2('0x12')]);router[_0x90c2('0x9')](_0x90c2('0x13'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x14')]);router[_0x90c2('0x9')](_0x90c2('0x15'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x16')]);router['get'](_0x90c2('0x17'),auth[_0x90c2('0xe')](),controller['getAgents']);router[_0x90c2('0x9')](_0x90c2('0x18'),auth['isAuthenticated'](),controller[_0x90c2('0x19')]);router[_0x90c2('0x9')](_0x90c2('0x1a'),auth[_0x90c2('0xe')](),controller['getLists']);router['get'](_0x90c2('0x1b'),auth['isAuthenticated'](),controller[_0x90c2('0x1c')]);router['post']('/',auth[_0x90c2('0xe')](),controller[_0x90c2('0x1d')]);router[_0x90c2('0x1e')](_0x90c2('0x1f'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x90c2('0x15'),auth[_0x90c2('0xe')](),controller['addTeams']);router[_0x90c2('0x1e')](_0x90c2('0x17'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x20')]);router[_0x90c2('0x1e')](_0x90c2('0x1a'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x21')]);router[_0x90c2('0x1e')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x90c2('0x22')]);router[_0x90c2('0x23')](_0x90c2('0xb'),auth[_0x90c2('0xe')](),controller['update']);router['delete'](_0x90c2('0xb'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x24')]);router[_0x90c2('0x25')](_0x90c2('0x15'),auth[_0x90c2('0xe')](),controller['removeTeams']);router[_0x90c2('0x25')](_0x90c2('0x17'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x90c2('0x25')]('/:id/lists',auth[_0x90c2('0xe')](),controller['removeLists']);router[_0x90c2('0x25')](_0x90c2('0x1b'),auth[_0x90c2('0xe')](),controller[_0x90c2('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index da3cfdb..ce131eb 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 _0xd28c=['Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','exports','STRING','name','ENUM','inbound','outbound','leastrecent','fewestcalls','rrmemory','linear','wrandom','ringall','setDataValue','getDataValue','dialMethod','strategy','booked','progressive','predictive','power','INTEGER','yes','once','periodic_announce','join','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','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)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'];(function(_0x3bf478,_0x59361a){var _0x3fd82d=function(_0x49e4e4){while(--_0x49e4e4){_0x3bf478['push'](_0x3bf478['shift']());}};_0x3fd82d(++_0x59361a);}(_0xd28c,0x72));var _0xcd28=function(_0x3078ca,_0x3a8c1f){_0x3078ca=_0x3078ca-0x0;var _0x59fd57=_0xd28c[_0x3078ca];return _0x59fd57;};'use strict';var Sequelize=require('sequelize');module[_0xcd28('0x0')]={'name':{'type':Sequelize[_0xcd28('0x1')],'allowNull':![],'unique':_0xcd28('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x4'),_0xcd28('0x5')),'allowNull':![],'defaultValue':_0xcd28('0x4')},'musiconhold':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':''},'strategy':{'type':Sequelize[_0xcd28('0x3')]('rr','ringall',_0xcd28('0x6'),_0xcd28('0x7'),'random',_0xcd28('0x8'),_0xcd28('0x9'),_0xcd28('0xa'),'rrordered'),'allowNull':![],'defaultValue':_0xcd28('0xb'),'set':function(_0x45251c){this[_0xcd28('0xc')]('strategy',_0x45251c?_0x45251c:_0xcd28('0x8'));},'get':function(){var _0x4f88aa=this[_0xcd28('0xd')]('type');var _0x222d9b=this[_0xcd28('0xd')](_0xcd28('0xe'));var _0x192898=this[_0xcd28('0xd')](_0xcd28('0xf'));if(_0x4f88aa===_0xcd28('0x4')){return _0x192898;}if(_0x222d9b==='booked'&&_0x192898===_0xcd28('0x8')||_0x222d9b===_0xcd28('0x10')&&_0x192898==='roundrobin'){return _0x192898;}if(_0x222d9b===_0xcd28('0x11')||_0x222d9b===_0xcd28('0x12')||_0x222d9b===_0xcd28('0x13')){return _0x192898;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xcd28('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xcd28('0x3')]('yes','no'),'defaultValue':_0xcd28('0x15')},'autopause':{'type':Sequelize['ENUM'](_0xcd28('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xcd28('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xcd28('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xcd28('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xcd28('0x3')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xcd28('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xcd28('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0xcd28('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x15'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x15'),'no',_0xcd28('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xcd28('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xcd28('0x1')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xcd28('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xcd28('0x1')]},'queue_quantity1':{'type':Sequelize[_0xcd28('0x1')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize[_0xcd28('0x1')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x34f8e8){this['setDataValue'](_0xcd28('0x17'),_0x34f8e8?_0x34f8e8[_0xcd28('0x18')](','):[]);},'get':function(){return this[_0xcd28('0xd')](_0xcd28('0x17'))?this[_0xcd28('0xd')](_0xcd28('0x17'))[_0xcd28('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':'yes','set':function(_0x59de2a){this[_0xcd28('0xc')](_0xcd28('0x1a'),_0x59de2a?_0x59de2a[_0xcd28('0x18')](','):undefined);},'get':function(){return this[_0xcd28('0xd')]('joinempty')?this[_0xcd28('0xd')](_0xcd28('0x1a'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':'no','set':function(_0x2e7069){this['setDataValue'](_0xcd28('0x1b'),_0x2e7069?_0x2e7069[_0xcd28('0x18')](','):undefined);},'get':function(){return this[_0xcd28('0xd')]('leavewhenempty')?this['getDataValue'](_0xcd28('0x1b'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xcd28('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xcd28('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xcd28('0x3')](_0xcd28('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xcd28('0x1')]},'description':{'type':Sequelize[_0xcd28('0x1')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3b12a6){this[_0xcd28('0xc')]('acw',_0x3b12a6);if(_0x3b12a6){if(this['getDataValue'](_0xcd28('0x1c'))<0x2){this[_0xcd28('0xc')](_0xcd28('0x1c'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xcd28('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xcd28('0x1d')],'defaultValue':0x0,'comment':_0xcd28('0x1e')},'dialMethod':{'type':Sequelize['ENUM'](_0xcd28('0x1f'),_0xcd28('0x11'),_0xcd28('0x13'),'predictive',_0xcd28('0x10')),'defaultValue':_0xcd28('0x11'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xcd28('0x20')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xcd28('0x21')},'dialLimitQueue':{'type':Sequelize[_0xcd28('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xcd28('0x22')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xcd28('0x20')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xcd28('0x23')},'dialPredictiveOptimization':{'type':Sequelize[_0xcd28('0x3')]('agentBusyFactor',_0xcd28('0x24')),'defaultValue':_0xcd28('0x24'),'comment':_0xcd28('0x25')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xcd28('0x26')](0x2)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xcd28('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xcd28('0x28')},'dialOriginateCallerIdName':{'type':Sequelize[_0xcd28('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xcd28('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xcd28('0x20')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x29')},'dialQueueOptions':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':_0xcd28('0x2a'),'comment':_0xcd28('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x2c')},'dialQueueProject':{'type':Sequelize[_0xcd28('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x2d')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xcd28('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd28('0x2e')},'dialBusyMaxRetry':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x2f')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcd28('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'comment':_0xcd28('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xcd28('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd28('0x31')},'dialGlobalMaxRetry':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xcd28('0x32')},'dialPrefix':{'type':Sequelize[_0xcd28('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xcd28('0x3')]('always',_0xcd28('0x33'),_0xcd28('0x34')),'defaultValue':_0xcd28('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xcd28('0x36')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xcd28('0x20')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xcd28('0x37')},'dialAMDGreeting':{'type':Sequelize[_0xcd28('0x14')](0x9)[_0xcd28('0x20')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xcd28('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xcd28('0x14')](0x9)[_0xcd28('0x20')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xcd28('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xcd28('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xcd28('0x14')](0x9)[_0xcd28('0x20')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xcd28('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xcd28('0x14')](0x9)[_0xcd28('0x20')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xcd28('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xcd28('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xcd28('0x20')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xcd28('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xcd28('0x14')](0x9)[_0xcd28('0x20')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xcd28('0x14')](0x5)[_0xcd28('0x20')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xcd28('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xcd28('0x1d')],'defaultValue':0x0,'comment':_0xcd28('0x40')},'dialOrderByScheduledAt':{'type':Sequelize[_0xcd28('0x3')]('DESC',_0xcd28('0x41')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xcd28('0x1')],'comment':_0xcd28('0x42')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xcd28('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcd28('0x43')},'dialCutDigit':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xcd28('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xcd28('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0xcd28('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x47')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xcd28('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x48')},'dialMachineRetryFrequency':{'type':Sequelize[_0xcd28('0x14')](0x5)[_0xcd28('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd28('0x49')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xcd28('0x4a')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xcd28('0x14')](0x5)[_0xcd28('0x20')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xcd28('0x4b')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xcd28('0x14')],'allowNull':!![],'comment':_0xcd28('0x4c')},'mandatoryDisposition':{'type':Sequelize[_0xcd28('0x1d')],'defaultValue':![],'comment':_0xcd28('0x4d'),'set':function(_0x574e37){if(!_0x574e37)this[_0xcd28('0xc')]('mandatoryDispositionPauseId',null);this[_0xcd28('0xc')](_0xcd28('0x4e'),_0x574e37);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xcd28('0x14')](0x3)[_0xcd28('0x20')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa992=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','ENUM','inbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','dialMethod','booked','predictive','power','INTEGER','STRING','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'];(function(_0x408f95,_0x2735d0){var _0x2a52be=function(_0x1894c0){while(--_0x1894c0){_0x408f95['push'](_0x408f95['shift']());}};_0x2a52be(++_0x2735d0);}(_0xa992,0xc4));var _0x2a99=function(_0xcbc780,_0x424cf7){_0xcbc780=_0xcbc780-0x0;var _0x521cde=_0xa992[_0xcbc780];return _0x521cde;};'use strict';var Sequelize=require(_0x2a99('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x2'),'outbound'),'allowNull':![],'defaultValue':_0x2a99('0x2')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x2a99('0x3')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x2a99('0x1')]('rr','ringall',_0x2a99('0x4'),_0x2a99('0x5'),_0x2a99('0x6'),_0x2a99('0x7'),_0x2a99('0x8'),_0x2a99('0x9'),_0x2a99('0xa')),'allowNull':![],'defaultValue':_0x2a99('0xb'),'set':function(_0x9b413c){this[_0x2a99('0xc')](_0x2a99('0xd'),_0x9b413c?_0x9b413c:_0x2a99('0x7'));},'get':function(){var _0x4f53b0=this[_0x2a99('0xe')](_0x2a99('0xf'));var _0x3b9994=this[_0x2a99('0xe')](_0x2a99('0x10'));var _0x10efab=this[_0x2a99('0xe')]('strategy');if(_0x4f53b0===_0x2a99('0x2')){return _0x10efab;}if(_0x3b9994===_0x2a99('0x11')&&_0x10efab===_0x2a99('0x7')||_0x3b9994===_0x2a99('0x11')&&_0x10efab==='roundrobin'){return _0x10efab;}if(_0x3b9994==='progressive'||_0x3b9994===_0x2a99('0x12')||_0x3b9994===_0x2a99('0x13')){return _0x10efab;}return null;}},'servicelevel':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2a99('0x15')]},'weight':{'type':Sequelize[_0x2a99('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':_0x2a99('0x16')},'autopause':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no',_0x2a99('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2a99('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2a99('0x1')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2a99('0x15')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2a99('0x15')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no',_0x2a99('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x2a99('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2a99('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2a99('0x15')]},'queue_youarenext':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2a99('0x15')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2a99('0x15')]},'queue_quantity1':{'type':Sequelize[_0x2a99('0x15')]},'queue_quantity2':{'type':Sequelize['STRING']},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x2a99('0x19')],'set':function(_0x307c53){this[_0x2a99('0xc')](_0x2a99('0x1a'),_0x307c53?_0x307c53[_0x2a99('0x1b')](','):[]);},'get':function(){return this[_0x2a99('0xe')](_0x2a99('0x1a'))?this[_0x2a99('0xe')](_0x2a99('0x1a'))[_0x2a99('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':_0x2a99('0x16'),'set':function(_0x2c4763){this[_0x2a99('0xc')](_0x2a99('0x1d'),_0x2c4763?_0x2c4763[_0x2a99('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x2a99('0x1d'))?this[_0x2a99('0xe')]('joinempty')[_0x2a99('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':'no','set':function(_0x4f5bcd){this[_0x2a99('0xc')](_0x2a99('0x1e'),_0x4f5bcd?_0x4f5bcd[_0x2a99('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('leavewhenempty')?this[_0x2a99('0xe')](_0x2a99('0x1e'))[_0x2a99('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2a99('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x2a99('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2a99('0x15')]},'description':{'type':Sequelize[_0x2a99('0x15')]},'acw':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':0x0,'set':function(_0x52d67c){this[_0x2a99('0xc')](_0x2a99('0x20'),_0x52d67c);if(_0x52d67c){if(this[_0x2a99('0xe')](_0x2a99('0x21'))<0x2){this['setDataValue'](_0x2a99('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':0x0,'comment':_0x2a99('0x22')},'dialMethod':{'type':Sequelize[_0x2a99('0x1')]('preview',_0x2a99('0x23'),_0x2a99('0x13'),_0x2a99('0x12'),_0x2a99('0x11')),'defaultValue':_0x2a99('0x23'),'comment':_0x2a99('0x24')},'dialLimitChannel':{'type':Sequelize[_0x2a99('0x14')](0x4)[_0x2a99('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2a99('0x26')},'dialLimitQueue':{'type':Sequelize[_0x2a99('0x14')](0x4)[_0x2a99('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2a99('0x27')},'dialPowerLevel':{'type':Sequelize[_0x2a99('0x28')](0x2)[_0x2a99('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor',_0x2a99('0x29')),'defaultValue':'dropRate','comment':_0x2a99('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2a99('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2a99('0x15')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2a99('0x15')]},'dialOriginateTimeout':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x2c')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x2a99('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x2a99('0x15')],'comment':_0x2a99('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x2f')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'comment':_0x2a99('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2a99('0x32')},'dialTimezone':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2a99('0x33')},'dialPrefix':{'type':Sequelize[_0x2a99('0x15')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x34'),_0x2a99('0x35'),_0x2a99('0x36')),'defaultValue':_0x2a99('0x34')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2a99('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2a99('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2a99('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2a99('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a99('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2a99('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2a99('0x14')](0x9)[_0x2a99('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2a99('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2a99('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2a99('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2a99('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2a99('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2a99('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a99('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2a99('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':0x0,'comment':_0x2a99('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2a99('0x1')](_0x2a99('0x43'),_0x2a99('0x44')),'defaultValue':_0x2a99('0x43')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x2a99('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2a99('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a99('0x45')},'dialCutDigit':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a99('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x2a99('0x14')](0x5)[_0x2a99('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2a99('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a99('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a99('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2a99('0x14')],'allowNull':!![],'comment':_0x2a99('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2a99('0x4f'),'set':function(_0x5a2cb4){if(!_0x5a2cb4)this[_0x2a99('0xc')]('mandatoryDispositionPauseId',null);this[_0x2a99('0xc')]('mandatoryDisposition',_0x5a2cb4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2a99('0x14')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2a99('0x14')](0x3)[_0x2a99('0x25')],'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 b4635af..c2f50f7 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 _0xeda4=['ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','into','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','lodash','squel','crypto','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','defaults','localhost','socket.io-emitter','redis','register','sendStatus','status','json','offset','undefined','limit','count','set','update','then','destroy','VoiceQueues','inbound','outbound','filter','value','includes','type','find','name','end','error','stack','send','map','VoiceQueue','fieldName','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','createdAt','updatedAt','omit','user','role','userProfileId','findOne','pick','VoiceQueueId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','userVoiceQueue:save','removeTeams','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','compact','ids','isEmpty','removeAgents','emit','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ContactId','NOW()','scheduledAt','field','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeda4,0xc4));var _0x4eda=function(_0x55677b,_0x3e5655){_0x55677b=_0x55677b-0x0;var _0x104b88=_0xeda4[_0x55677b];return _0x104b88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4eda('0x0'));var zipdir=require(_0x4eda('0x1'));var jsonpatch=require(_0x4eda('0x2'));var rp=require(_0x4eda('0x3'));var moment=require(_0x4eda('0x4'));var BPromise=require(_0x4eda('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4eda('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4eda('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4eda('0x8'));var squel=require(_0x4eda('0x9'));var crypto=require(_0x4eda('0xa'));var jsforce=require(_0x4eda('0xb'));var deskjs=require(_0x4eda('0xc'));var toCsv=require(_0x4eda('0xd'));var querystring=require(_0x4eda('0xe'));var Papa=require(_0x4eda('0xf'));var Redis=require(_0x4eda('0x10'));var authService=require(_0x4eda('0x11'));var qs=require(_0x4eda('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4eda('0x13'));var logger=require(_0x4eda('0x14'))(_0x4eda('0x15'));var utils=require(_0x4eda('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x4eda('0x17'));var db=require(_0x4eda('0x18'))['db'];config['redis']=_[_0x4eda('0x19')](config['redis'],{'host':_0x4eda('0x1a'),'port':0x18eb});var socket=require(_0x4eda('0x1b'))(new Redis(config[_0x4eda('0x1c')]));require('./voiceQueue.socket')[_0x4eda('0x1d')](socket);function respondWithStatusCode(_0x10796,_0x49a108){_0x49a108=_0x49a108||0xcc;return function(_0x16d7f1){if(_0x16d7f1){return _0x10796[_0x4eda('0x1e')](_0x49a108);}return _0x10796[_0x4eda('0x1f')](_0x49a108)['end']();};}function respondWithResult(_0x1d18c5,_0x2e4752){_0x2e4752=_0x2e4752||0xc8;return function(_0x51d0e3){if(_0x51d0e3){return _0x1d18c5[_0x4eda('0x1f')](_0x2e4752)[_0x4eda('0x20')](_0x51d0e3);}};}function respondWithFilteredResult(_0x128a53,_0x2016b8){return function(_0x4f0e9f){if(_0x4f0e9f){var _0x208e2f=typeof _0x2016b8[_0x4eda('0x21')]===_0x4eda('0x22')&&typeof _0x2016b8[_0x4eda('0x23')]==='undefined';var _0x544098=_0x4f0e9f[_0x4eda('0x24')];var _0x22a322=_0x208e2f?0x0:_0x2016b8['offset'];var _0x26591e=_0x208e2f?_0x4f0e9f['count']:_0x2016b8[_0x4eda('0x21')]+_0x2016b8[_0x4eda('0x23')];var _0x1b26b0;if(_0x26591e>=_0x544098){_0x26591e=_0x544098;_0x1b26b0=0xc8;}else{_0x1b26b0=0xce;}_0x128a53[_0x4eda('0x1f')](_0x1b26b0);return _0x128a53[_0x4eda('0x25')]('Content-Range',_0x22a322+'-'+_0x26591e+'/'+_0x544098)[_0x4eda('0x20')](_0x4f0e9f);}return null;};}function patchUpdates(_0x3a7b79){return function(_0x453b2e){try{jsonpatch['apply'](_0x453b2e,_0x3a7b79,!![]);}catch(_0x58b226){return BPromise['reject'](_0x58b226);}return _0x453b2e['save']();};}function saveUpdates(_0x29595f,_0x337fe4){return function(_0x2c3c65){if(_0x2c3c65){return _0x2c3c65[_0x4eda('0x26')](_0x29595f)[_0x4eda('0x27')](function(_0x253c72){return _0x253c72;});}return null;};}function removeEntity(_0x3dcc2a,_0x5592f8){return function(_0x2a1fc0){if(_0x2a1fc0){return _0x2a1fc0[_0x4eda('0x28')]()['then'](function(){var _0x28b0bc=_0x2a1fc0['get']({'plain':!![]});var _0xc0e449=[{'name':_0x4eda('0x29'),'value':_0x4eda('0x2a'),'ignore':![]},{'name':'QueueCampaigns','value':_0x4eda('0x2b'),'ignore':![]}];var _0x16650b=_(_0xc0e449)[_0x4eda('0x2c')]('ignore')['map']('value')[_0x4eda('0x2d')]();if(_[_0x4eda('0x2e')](_0x16650b,_0x28b0bc[_0x4eda('0x2f')])){return;}var _0x3d7e5c=_[_0x4eda('0x30')](_0xc0e449,['value',_0x28b0bc[_0x4eda('0x2f')]])[_0x4eda('0x31')];return db['UserProfileResource'][_0x4eda('0x28')]({'where':{'type':_0x3d7e5c,'resourceId':_0x28b0bc['id']}})[_0x4eda('0x27')](function(){return _0x2a1fc0;});})['then'](function(){_0x3dcc2a['status'](0xcc)[_0x4eda('0x32')]();});}};}function handleEntityNotFound(_0xab8e21,_0x1d8c03){return function(_0xb2d795){if(!_0xb2d795){_0xab8e21[_0x4eda('0x1e')](0x194);}return _0xb2d795;};}function handleError(_0x22b20f,_0x27f5da){_0x27f5da=_0x27f5da||0x1f4;return function(_0x2f3607){logger[_0x4eda('0x33')](_0x2f3607[_0x4eda('0x34')]);if(_0x2f3607[_0x4eda('0x31')]){delete _0x2f3607[_0x4eda('0x31')];}_0x22b20f[_0x4eda('0x1f')](_0x27f5da)[_0x4eda('0x35')](_0x2f3607);};}exports['index']=function(_0x413fa7,_0x3fe53c){var _0xa76c00={},_0x921443={},_0xf0e834={'count':0x0,'rows':[]};var _0x42267d=_[_0x4eda('0x36')](db[_0x4eda('0x37')]['rawAttributes'],function(_0x12a65d){return{'name':_0x12a65d[_0x4eda('0x38')],'type':_0x12a65d['type']['key']};});_0x921443[_0x4eda('0x39')]=_['map'](_0x42267d,_0x4eda('0x31'));_0x921443[_0x4eda('0x3a')]=_['keys'](_0x413fa7['query']);_0x921443['filters']=_[_0x4eda('0x3b')](_0x921443[_0x4eda('0x39')],_0x921443['query']);_0xa76c00[_0x4eda('0x3c')]=_['intersection'](_0x921443[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x413fa7['query']['fields']));_0xa76c00[_0x4eda('0x3c')]=_0xa76c00[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0xa76c00[_0x4eda('0x3c')]:_0x921443['model'];if(!_0x413fa7[_0x4eda('0x3a')][_0x4eda('0x3f')](_0x4eda('0x40'))){_0xa76c00[_0x4eda('0x23')]=qs[_0x4eda('0x23')](_0x413fa7[_0x4eda('0x3a')][_0x4eda('0x23')]);_0xa76c00[_0x4eda('0x21')]=qs[_0x4eda('0x21')](_0x413fa7[_0x4eda('0x3a')]['offset']);}_0xa76c00[_0x4eda('0x41')]=qs[_0x4eda('0x42')](_0x413fa7['query']['sort']);_0xa76c00['where']=qs[_0x4eda('0x43')](_['pick'](_0x413fa7[_0x4eda('0x3a')],_0x921443[_0x4eda('0x43')]),_0x42267d);if(_0x413fa7[_0x4eda('0x3a')][_0x4eda('0x2c')]){_0xa76c00[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0xa76c00[_0x4eda('0x44')],{'$or':_[_0x4eda('0x36')](_0x42267d,function(_0x2e9a1e){if(_0x2e9a1e[_0x4eda('0x2f')]!==_0x4eda('0x46')){var _0x4bdbef={};_0x4bdbef[_0x2e9a1e[_0x4eda('0x31')]]={'$like':'%'+_0x413fa7[_0x4eda('0x3a')][_0x4eda('0x2c')]+'%'};return _0x4bdbef;}})});}_0xa76c00=_[_0x4eda('0x45')]({},_0xa76c00,_0x413fa7[_0x4eda('0x47')]);var _0x577153={'where':_0xa76c00[_0x4eda('0x44')]};return db['VoiceQueue'][_0x4eda('0x24')](_0x577153)[_0x4eda('0x27')](function(_0x184599){_0xf0e834[_0x4eda('0x24')]=_0x184599;if(_0x413fa7[_0x4eda('0x3a')][_0x4eda('0x48')]){_0xa76c00[_0x4eda('0x49')]=[{'all':!![]}];}return db[_0x4eda('0x37')][_0x4eda('0x4a')](_0xa76c00);})[_0x4eda('0x27')](function(_0x144bed){_0xf0e834[_0x4eda('0x4b')]=_0x144bed;return _0xf0e834;})['then'](respondWithFilteredResult(_0x3fe53c,_0xa76c00))['catch'](handleError(_0x3fe53c,null));};exports[_0x4eda('0x4c')]=function(_0x4a7172,_0x334f94){var _0x43352b={'raw':![],'where':{'id':_0x4a7172[_0x4eda('0x4d')]['id']}},_0x107428={};_0x107428[_0x4eda('0x39')]=_[_0x4eda('0x4e')](db[_0x4eda('0x37')]['rawAttributes']);_0x107428['query']=_[_0x4eda('0x4e')](_0x4a7172[_0x4eda('0x3a')]);_0x107428['filters']=_[_0x4eda('0x3b')](_0x107428[_0x4eda('0x39')],_0x107428['query']);_0x43352b[_0x4eda('0x3c')]=_[_0x4eda('0x3b')](_0x107428[_0x4eda('0x39')],qs['fields'](_0x4a7172[_0x4eda('0x3a')][_0x4eda('0x3d')]));_0x43352b['attributes']=_0x43352b[_0x4eda('0x3c')]['length']?_0x43352b[_0x4eda('0x3c')]:_0x107428['model'];if(_0x4a7172['query'][_0x4eda('0x48')]){_0x43352b[_0x4eda('0x49')]=[{'all':!![]}];}_0x43352b=_[_0x4eda('0x45')]({},_0x43352b,_0x4a7172[_0x4eda('0x47')]);return db[_0x4eda('0x37')][_0x4eda('0x30')](_0x43352b)[_0x4eda('0x27')](handleEntityNotFound(_0x334f94,null))[_0x4eda('0x27')](respondWithResult(_0x334f94,null))[_0x4eda('0x4f')](handleError(_0x334f94,null));};exports[_0x4eda('0x50')]=function(_0x4b05a2,_0x1e9c70){return db[_0x4eda('0x37')][_0x4eda('0x50')](_0x4b05a2[_0x4eda('0x51')],{})['then'](function(_0x3c9151){var _0x1de978=_0x4b05a2['user'][_0x4eda('0x52')]({'plain':!![]});if(!_0x1de978)throw new Error(_0x4eda('0x53'));if(_0x1de978['role']==='user'){var _0x475ed5=_0x3c9151[_0x4eda('0x52')]({'plain':!![]});var _0x4229ee=[{'name':_0x4eda('0x29'),'value':_0x4eda('0x2a')},{'name':_0x4eda('0x54'),'value':_0x4eda('0x2b')}];var _0x24e805=_[_0x4eda('0x30')](_0x4229ee,[_0x4eda('0x2d'),_0x475ed5[_0x4eda('0x2f')]])[_0x4eda('0x31')];return db[_0x4eda('0x55')][_0x4eda('0x30')]({'where':{'name':_0x24e805,'userProfileId':_0x1de978['userProfileId']},'raw':!![]})['then'](function(_0x58091f){if(_0x58091f&&_0x58091f[_0x4eda('0x56')]===0x0){return db[_0x4eda('0x57')]['create']({'name':_0x475ed5[_0x4eda('0x31')],'resourceId':_0x475ed5['id'],'type':_0x58091f[_0x4eda('0x31')],'sectionId':_0x58091f['id']},{})[_0x4eda('0x27')](function(){return _0x3c9151;});}else{return _0x3c9151;}})['catch'](function(_0x4ca446){logger[_0x4eda('0x33')](_0x4eda('0x58'),_0x4ca446);throw _0x4ca446;});}return _0x3c9151;})[_0x4eda('0x27')](respondWithResult(_0x1e9c70,0xc9))[_0x4eda('0x4f')](handleError(_0x1e9c70,null));};exports['clone']=function(_0x40b6bb,_0x2d848d){var _0x14906a={'where':{'id':_0x40b6bb['params']['id']}},_0x2118c7={};_0x2118c7[_0x4eda('0x39')]=_[_0x4eda('0x4e')](db[_0x4eda('0x37')][_0x4eda('0x59')]);_0x14906a['attributes']=_[_0x4eda('0x3b')](_0x2118c7[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x40b6bb['query'][_0x4eda('0x3d')]));_0x14906a[_0x4eda('0x3c')]=_0x14906a[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x14906a[_0x4eda('0x3c')]:_0x2118c7[_0x4eda('0x39')];if(_0x40b6bb[_0x4eda('0x3a')][_0x4eda('0x48')]){_0x14906a[_0x4eda('0x49')]=[{'all':!![]}];}_0x14906a=_[_0x4eda('0x45')]({},_0x14906a,_0x40b6bb[_0x4eda('0x47')]);return db[_0x4eda('0x37')][_0x4eda('0x30')](_0x14906a)[_0x4eda('0x27')](handleEntityNotFound(_0x2d848d,null))['then'](function(_0x7f6d0){if(_0x7f6d0){var _0x30b333=_0x7f6d0[_0x4eda('0x52')]({'plain':!![]});_0x30b333=qs['omit'](_0x30b333,['id',_0x4eda('0x5a'),_0x4eda('0x5b')]);_0x40b6bb[_0x4eda('0x51')]=_[_0x4eda('0x5c')](_0x40b6bb[_0x4eda('0x51')],['id',_0x4eda('0x5a'),_0x4eda('0x5b')]);return db[_0x4eda('0x37')]['create'](_['merge'](_0x30b333,_0x40b6bb[_0x4eda('0x51')]),{'include':_0x40b6bb[_0x4eda('0x3a')][_0x4eda('0x48')]?[{'all':!![]}]:undefined})[_0x4eda('0x27')](function(_0x4d74ae){var _0x4c3cad=_0x40b6bb[_0x4eda('0x5d')]['get']({'plain':!![]});if(!_0x4c3cad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c3cad[_0x4eda('0x5e')]===_0x4eda('0x5d')){var _0x12abf4=_0x4d74ae['get']({'plain':!![]});var _0x47334e=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x4eda('0x54'),'value':_0x4eda('0x2b')}];var _0x41ec7f=_[_0x4eda('0x30')](_0x47334e,[_0x4eda('0x2d'),_0x12abf4['type']])[_0x4eda('0x31')];return db[_0x4eda('0x55')][_0x4eda('0x30')]({'where':{'name':_0x41ec7f,'userProfileId':_0x4c3cad[_0x4eda('0x5f')]},'raw':!![]})[_0x4eda('0x27')](function(_0x47f647){if(_0x47f647&&_0x47f647[_0x4eda('0x56')]===0x0){return db[_0x4eda('0x57')][_0x4eda('0x50')]({'name':_0x12abf4['name'],'resourceId':_0x12abf4['id'],'type':_0x47f647['name'],'sectionId':_0x47f647['id']},{})['then'](function(){return _0x4d74ae;});}else{return _0x4d74ae;}})['catch'](function(_0x3a3f80){logger[_0x4eda('0x33')](_0x4eda('0x58'),_0x3a3f80);throw _0x3a3f80;});}return _0x4d74ae;});}})[_0x4eda('0x27')](respondWithResult(_0x2d848d,0xc9))['catch'](handleError(_0x2d848d,null));};exports[_0x4eda('0x26')]=function(_0x5c0f75,_0x4c3234){if(_0x5c0f75[_0x4eda('0x51')]['id']){delete _0x5c0f75[_0x4eda('0x51')]['id'];}return db['VoiceQueue'][_0x4eda('0x30')]({'where':{'id':_0x5c0f75['params']['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x4c3234,null))[_0x4eda('0x27')](saveUpdates(_0x5c0f75['body'],null))[_0x4eda('0x27')](respondWithResult(_0x4c3234,null))[_0x4eda('0x4f')](handleError(_0x4c3234,null));};exports[_0x4eda('0x28')]=function(_0x31c4ba,_0x33b5ee){return db['VoiceQueue'][_0x4eda('0x30')]({'where':{'id':_0x31c4ba[_0x4eda('0x4d')]['id']}})['then'](handleEntityNotFound(_0x33b5ee,null))[_0x4eda('0x27')](removeEntity(_0x33b5ee,null))[_0x4eda('0x4f')](handleError(_0x33b5ee,null));};exports['getHoppers']=function(_0x1b38d1,_0x1373fe,_0xa6bae4){var _0x177c53={'raw':![],'where':{}};var _0x261ceb={};var _0x1410c0={'count':0x0,'rows':[]};return db[_0x4eda('0x37')][_0x4eda('0x60')]({'where':{'id':_0x1b38d1[_0x4eda('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1373fe,null))[_0x4eda('0x27')](function(_0x211d9c){if(_0x211d9c){_0x261ceb[_0x4eda('0x39')]=_[_0x4eda('0x4e')](db['CmHopper'][_0x4eda('0x59')]);_0x261ceb[_0x4eda('0x3a')]=_['keys'](_0x1b38d1[_0x4eda('0x3a')]);_0x261ceb[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0x261ceb[_0x4eda('0x39')],_0x261ceb[_0x4eda('0x3a')]);_0x177c53['attributes']=_[_0x4eda('0x3b')](_0x261ceb[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x1b38d1[_0x4eda('0x3a')][_0x4eda('0x3d')]));_0x177c53['attributes']=_0x177c53[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x177c53[_0x4eda('0x3c')]:_0x261ceb[_0x4eda('0x39')];if(!_0x1b38d1[_0x4eda('0x3a')][_0x4eda('0x3f')]('nolimit')){_0x177c53[_0x4eda('0x23')]=qs['limit'](_0x1b38d1[_0x4eda('0x3a')][_0x4eda('0x23')]);_0x177c53['offset']=qs['offset'](_0x1b38d1[_0x4eda('0x3a')][_0x4eda('0x21')]);}_0x177c53['order']=qs['sort'](_0x1b38d1[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x177c53['where']=qs[_0x4eda('0x43')](_[_0x4eda('0x61')](_0x1b38d1['query'],_0x261ceb['filters']));_0x177c53['where'][_0x4eda('0x62')]=_0x211d9c['id'];if(_0x1b38d1[_0x4eda('0x3a')][_0x4eda('0x2c')]){_0x177c53[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x177c53[_0x4eda('0x44')],{'$or':_['map'](_0x177c53[_0x4eda('0x3c')],function(_0x29e0da){var _0x4c95f7={};_0x4c95f7[_0x29e0da]={'$like':'%'+_0x1b38d1['query'][_0x4eda('0x2c')]+'%'};return _0x4c95f7;})});}_0x177c53=_['merge']({},_0x177c53,_0x1b38d1[_0x4eda('0x47')]);return db[_0x4eda('0x63')][_0x4eda('0x24')]({'where':_0x177c53['where']})[_0x4eda('0x27')](function(_0x352011){_0x1410c0[_0x4eda('0x24')]=_0x352011;if(_0x1b38d1[_0x4eda('0x3a')][_0x4eda('0x48')]){_0x177c53[_0x4eda('0x49')]=[{'all':!![]}];}return db[_0x4eda('0x63')]['findAll'](_0x177c53);})[_0x4eda('0x27')](function(_0x132da2){_0x1410c0[_0x4eda('0x4b')]=_0x132da2;return _0x1410c0;});}})[_0x4eda('0x27')](respondWithFilteredResult(_0x1373fe,_0x177c53))[_0x4eda('0x4f')](handleError(_0x1373fe,null));};exports['getHopperHistories']=function(_0x17064e,_0x278048,_0x447b6a){var _0x31c48a={'raw':!![],'where':{}};var _0x1c7721={};var _0x13eb38={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x17064e['params']['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x278048,null))['then'](function(_0x2fb434){if(_0x2fb434){_0x1c7721[_0x4eda('0x39')]=_[_0x4eda('0x4e')](db[_0x4eda('0x64')][_0x4eda('0x59')]);_0x1c7721['query']=_[_0x4eda('0x4e')](_0x17064e[_0x4eda('0x3a')]);_0x1c7721[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0x1c7721[_0x4eda('0x39')],_0x1c7721[_0x4eda('0x3a')]);_0x31c48a['attributes']=_[_0x4eda('0x3b')](_0x1c7721[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x17064e[_0x4eda('0x3a')][_0x4eda('0x3d')]));_0x31c48a[_0x4eda('0x3c')]=_0x31c48a[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x31c48a[_0x4eda('0x3c')]:_0x1c7721[_0x4eda('0x39')];if(!_0x17064e[_0x4eda('0x3a')][_0x4eda('0x3f')](_0x4eda('0x40'))){_0x31c48a[_0x4eda('0x23')]=qs['limit'](_0x17064e['query'][_0x4eda('0x23')]);_0x31c48a[_0x4eda('0x21')]=qs['offset'](_0x17064e[_0x4eda('0x3a')][_0x4eda('0x21')]);}_0x31c48a['order']=qs[_0x4eda('0x42')](_0x17064e[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x31c48a[_0x4eda('0x44')]=qs['filters'](_['pick'](_0x17064e[_0x4eda('0x3a')],_0x1c7721['filters']));_0x31c48a[_0x4eda('0x44')]['VoiceQueueId']=_0x2fb434['id'];if(_0x17064e[_0x4eda('0x3a')][_0x4eda('0x2c')]){_0x31c48a[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x31c48a[_0x4eda('0x44')],{'$or':_[_0x4eda('0x36')](_0x31c48a[_0x4eda('0x3c')],function(_0x15d88c){var _0x438e01={};_0x438e01[_0x15d88c]={'$like':'%'+_0x17064e[_0x4eda('0x3a')]['filter']+'%'};return _0x438e01;})});}_0x31c48a=_['merge']({},_0x31c48a,_0x17064e[_0x4eda('0x47')]);return db[_0x4eda('0x64')][_0x4eda('0x24')]({'where':_0x31c48a[_0x4eda('0x44')]})[_0x4eda('0x27')](function(_0x464768){_0x13eb38['count']=_0x464768;if(_0x17064e[_0x4eda('0x3a')]['includeAll']){_0x31c48a['include']=[{'all':!![]}];}return db[_0x4eda('0x64')][_0x4eda('0x4a')](_0x31c48a);})[_0x4eda('0x27')](function(_0x422339){_0x13eb38[_0x4eda('0x4b')]=_0x422339;return _0x13eb38;});}})[_0x4eda('0x27')](respondWithFilteredResult(_0x278048,_0x31c48a))[_0x4eda('0x4f')](handleError(_0x278048,null));};exports[_0x4eda('0x65')]=function(_0x31add8,_0x7e7f36,_0x45332b){var _0x276442={'raw':!![],'where':{}};var _0x42453e={};var _0x31346f={'count':0x0,'rows':[]};return db[_0x4eda('0x37')][_0x4eda('0x60')]({'where':{'id':_0x31add8[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x7e7f36,null))[_0x4eda('0x27')](function(_0xc8356e){if(_0xc8356e){_0x42453e['model']=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x42453e[_0x4eda('0x3a')]=_['keys'](_0x31add8[_0x4eda('0x3a')]);_0x42453e[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0x42453e[_0x4eda('0x39')],_0x42453e['query']);_0x276442['attributes']=_[_0x4eda('0x3b')](_0x42453e['model'],qs[_0x4eda('0x3d')](_0x31add8[_0x4eda('0x3a')][_0x4eda('0x3d')]));_0x276442[_0x4eda('0x3c')]=_0x276442[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x276442[_0x4eda('0x3c')]:_0x42453e['model'];if(!_0x31add8[_0x4eda('0x3a')][_0x4eda('0x3f')](_0x4eda('0x40'))){_0x276442[_0x4eda('0x23')]=qs[_0x4eda('0x23')](_0x31add8[_0x4eda('0x3a')][_0x4eda('0x23')]);_0x276442[_0x4eda('0x21')]=qs['offset'](_0x31add8[_0x4eda('0x3a')][_0x4eda('0x21')]);}_0x276442[_0x4eda('0x41')]=qs[_0x4eda('0x42')](_0x31add8[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x276442[_0x4eda('0x44')]=qs[_0x4eda('0x43')](_[_0x4eda('0x61')](_0x31add8[_0x4eda('0x3a')],_0x42453e['filters']));_0x276442[_0x4eda('0x44')]['VoiceQueueId']=_0xc8356e['id'];if(_0x31add8[_0x4eda('0x3a')][_0x4eda('0x2c')]){_0x276442[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x276442[_0x4eda('0x44')],{'$or':_[_0x4eda('0x36')](_0x276442[_0x4eda('0x3c')],function(_0x584291){var _0x199ac4={};_0x199ac4[_0x584291]={'$like':'%'+_0x31add8['query'][_0x4eda('0x2c')]+'%'};return _0x199ac4;})});}_0x276442=_[_0x4eda('0x45')]({},_0x276442,_0x31add8[_0x4eda('0x47')]);return db[_0x4eda('0x66')][_0x4eda('0x24')]({'where':_0x276442[_0x4eda('0x44')]})[_0x4eda('0x27')](function(_0x5da9bc){_0x31346f[_0x4eda('0x24')]=_0x5da9bc;if(_0x31add8[_0x4eda('0x3a')][_0x4eda('0x48')]){_0x276442[_0x4eda('0x49')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4eda('0x4a')](_0x276442);})[_0x4eda('0x27')](function(_0x124c43){_0x31346f[_0x4eda('0x4b')]=_0x124c43;return _0x31346f;});}})[_0x4eda('0x27')](respondWithFilteredResult(_0x7e7f36,_0x276442))[_0x4eda('0x4f')](handleError(_0x7e7f36,null));};exports[_0x4eda('0x67')]=function(_0x2149bc,_0x12ea7f,_0x1e503a){var _0x498d3f={'raw':!![],'where':{}};var _0x5bb4bb={};var _0x4b9b13={'count':0x0,'rows':[]};return db[_0x4eda('0x37')][_0x4eda('0x60')]({'where':{'id':_0x2149bc['params']['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x12ea7f,null))[_0x4eda('0x27')](function(_0x23d973){if(_0x23d973){_0x5bb4bb['model']=_[_0x4eda('0x4e')](db[_0x4eda('0x68')][_0x4eda('0x59')]);_0x5bb4bb['query']=_['keys'](_0x2149bc[_0x4eda('0x3a')]);_0x5bb4bb['filters']=_[_0x4eda('0x3b')](_0x5bb4bb[_0x4eda('0x39')],_0x5bb4bb[_0x4eda('0x3a')]);_0x498d3f[_0x4eda('0x3c')]=_['intersection'](_0x5bb4bb[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x2149bc[_0x4eda('0x3a')]['fields']));_0x498d3f['attributes']=_0x498d3f[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x498d3f[_0x4eda('0x3c')]:_0x5bb4bb[_0x4eda('0x39')];if(!_0x2149bc[_0x4eda('0x3a')][_0x4eda('0x3f')](_0x4eda('0x40'))){_0x498d3f['limit']=qs[_0x4eda('0x23')](_0x2149bc['query'][_0x4eda('0x23')]);_0x498d3f[_0x4eda('0x21')]=qs[_0x4eda('0x21')](_0x2149bc[_0x4eda('0x3a')][_0x4eda('0x21')]);}_0x498d3f[_0x4eda('0x41')]=qs[_0x4eda('0x42')](_0x2149bc[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x498d3f[_0x4eda('0x44')]=qs[_0x4eda('0x43')](_[_0x4eda('0x61')](_0x2149bc[_0x4eda('0x3a')],_0x5bb4bb[_0x4eda('0x43')]));_0x498d3f[_0x4eda('0x44')][_0x4eda('0x62')]=_0x23d973['id'];if(_0x2149bc[_0x4eda('0x3a')][_0x4eda('0x2c')]){_0x498d3f[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x498d3f[_0x4eda('0x44')],{'$or':_[_0x4eda('0x36')](_0x498d3f['attributes'],function(_0x2640d4){var _0x531818={};_0x531818[_0x2640d4]={'$like':'%'+_0x2149bc['query'][_0x4eda('0x2c')]+'%'};return _0x531818;})});}_0x498d3f=_[_0x4eda('0x45')]({},_0x498d3f,_0x2149bc[_0x4eda('0x47')]);return db[_0x4eda('0x68')][_0x4eda('0x24')]({'where':_0x498d3f[_0x4eda('0x44')]})['then'](function(_0xb43beb){_0x4b9b13['count']=_0xb43beb;if(_0x2149bc[_0x4eda('0x3a')]['includeAll']){_0x498d3f['include']=[{'all':!![]}];}return db[_0x4eda('0x68')][_0x4eda('0x4a')](_0x498d3f);})[_0x4eda('0x27')](function(_0x167c9b){_0x4b9b13[_0x4eda('0x4b')]=_0x167c9b;return _0x4b9b13;});}})[_0x4eda('0x27')](respondWithFilteredResult(_0x12ea7f,_0x498d3f))[_0x4eda('0x4f')](handleError(_0x12ea7f,null));};exports['getTeams']=function(_0x227682,_0x342395,_0x305149){var _0x45f118={};var _0xe56ee={};var _0x5ea1a0;var _0x16fd25;return db[_0x4eda('0x37')][_0x4eda('0x60')]({'where':{'id':_0x227682['params']['id']}})['then'](handleEntityNotFound(_0x342395,null))[_0x4eda('0x27')](function(_0x2f2008){if(_0x2f2008){_0x5ea1a0=_0x2f2008;_0xe56ee[_0x4eda('0x39')]=_['keys'](db[_0x4eda('0x69')]['rawAttributes']);_0xe56ee[_0x4eda('0x3a')]=_[_0x4eda('0x4e')](_0x227682[_0x4eda('0x3a')]);_0xe56ee[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0xe56ee['model'],_0xe56ee[_0x4eda('0x3a')]);_0x45f118[_0x4eda('0x3c')]=_[_0x4eda('0x3b')](_0xe56ee[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x227682[_0x4eda('0x3a')][_0x4eda('0x3d')]));_0x45f118[_0x4eda('0x3c')]=_0x45f118[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x45f118[_0x4eda('0x3c')]:_0xe56ee[_0x4eda('0x39')];_0x45f118[_0x4eda('0x41')]=qs[_0x4eda('0x42')](_0x227682[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x45f118[_0x4eda('0x44')]=qs[_0x4eda('0x43')](_[_0x4eda('0x61')](_0x227682[_0x4eda('0x3a')],_0xe56ee[_0x4eda('0x43')]));if(_0x227682[_0x4eda('0x3a')]['filter']){_0x45f118[_0x4eda('0x44')]=_['merge'](_0x45f118[_0x4eda('0x44')],{'$or':_['map'](_0x45f118[_0x4eda('0x3c')],function(_0x5657ce){var _0x1e63e5={};_0x1e63e5[_0x5657ce]={'$like':'%'+_0x227682['query']['filter']+'%'};return _0x1e63e5;})});}_0x45f118=_[_0x4eda('0x45')]({},_0x45f118,_0x227682['options']);return _0x5ea1a0[_0x4eda('0x6a')](_0x45f118);}})[_0x4eda('0x27')](function(_0xad5353){if(_0xad5353){_0x16fd25=_0xad5353[_0x4eda('0x3e')];if(!_0x227682[_0x4eda('0x3a')][_0x4eda('0x3f')](_0x4eda('0x40'))){_0x45f118[_0x4eda('0x23')]=qs[_0x4eda('0x23')](_0x227682[_0x4eda('0x3a')][_0x4eda('0x23')]);_0x45f118[_0x4eda('0x21')]=qs[_0x4eda('0x21')](_0x227682[_0x4eda('0x3a')][_0x4eda('0x21')]);}return _0x5ea1a0['getTeams'](_0x45f118);}})[_0x4eda('0x27')](function(_0x2ce412){if(_0x2ce412){return _0x2ce412?{'count':_0x16fd25,'rows':_0x2ce412}:null;}})[_0x4eda('0x27')](respondWithResult(_0x342395,null))['catch'](handleError(_0x342395,null));};exports[_0x4eda('0x6b')]=function(_0x1fff86,_0x395b91,_0x293698){var _0x208e16=_0x1fff86['body'][_0x4eda('0x6c')];var _0x1091ed=_['map'](_0x208e16,'id');return db[_0x4eda('0x69')]['findAll']({'where':{'id':_0x1091ed},'attributes':['id'],'include':[{'model':db[_0x4eda('0x6d')],'as':_0x4eda('0x6e'),'attributes':['id',_0x4eda('0x31'),_0x4eda('0x6f'),'voicePause',_0x4eda('0x70')],'raw':!![]}]})[_0x4eda('0x27')](function(_0xc02c2){if(_0xc02c2){var _0x52a771=_[_0x4eda('0x71')](_0xc02c2,function(_0x943f2a){var _0x4c2b78=_0x943f2a[_0x4eda('0x52')]({'plain':!![]});_0x4c2b78[_0x4eda('0x6e')][_0x4eda('0x72')](function(_0x594eaa){_0x594eaa['penalty']=_[_0x4eda('0x30')](_0x208e16,{'id':_0x4c2b78['id']})[_0x4eda('0x73')];});return _0x4c2b78['Agents'];});return db[_0x4eda('0x37')][_0x4eda('0x30')]({'where':{'id':_0x1fff86[_0x4eda('0x4d')]['id']}})['then'](function(_0x5782af){return db[_0x4eda('0x74')][_0x4eda('0x75')](function(_0x293416){return _0x5782af[_0x4eda('0x6b')](_0x1091ed,{'transaction':_0x293416})[_0x4eda('0x27')](function(){return BPromise[_0x4eda('0x76')](_0x208e16,function(_0x37ecce){return db[_0x4eda('0x77')][_0x4eda('0x78')]({'TeamId':_0x37ecce['id'],'VoiceQueueId':_0x1fff86[_0x4eda('0x4d')]['id'],'penalty':_0x37ecce[_0x4eda('0x73')]},{'transaction':_0x293416});});})['then'](function(){return BPromise[_0x4eda('0x76')](_0x52a771,function(_0x2dd7bc){return db[_0x4eda('0x79')]['findOrCreate']({'where':{'UserId':_0x2dd7bc['id'],'VoiceQueueId':_0x1fff86[_0x4eda('0x4d')]['id']},'defaults':{'penalty':_0x2dd7bc[_0x4eda('0x73')]},'transaction':_0x293416});});})[_0x4eda('0x27')](function(){return BPromise[_0x4eda('0x76')](_[_0x4eda('0x2c')](_0x52a771,{'online':!![]}),function(_0x452197){return db[_0x4eda('0x7a')][_0x4eda('0x78')]({'membername':_0x452197[_0x4eda('0x31')],'UserId':_0x452197['id'],'queue_name':_0x5782af[_0x4eda('0x31')],'VoiceQueueId':_0x5782af['id'],'interface':_[_0x4eda('0x7b')](_0x452197[_0x4eda('0x70')])?util[_0x4eda('0x7c')](_0x4eda('0x7d'),_0x452197['name']):_0x452197['interface'],'paused':_0x452197[_0x4eda('0x7e')]||![],'penalty':_0x452197[_0x4eda('0x73')]},{'transaction':_0x293416});});})['then'](function(){_0x52a771[_0x4eda('0x72')](function(_0x415037){socket['emit'](_0x4eda('0x7f'),{'UserId':_0x415037['id'],'VoiceQueueId':_0x5782af['id']});});});});});}})[_0x4eda('0x27')](respondWithStatusCode(_0x395b91,null))['catch'](handleError(_0x395b91,null));};exports[_0x4eda('0x80')]=function(_0x367df7,_0x4b84a7,_0x134855){return db[_0x4eda('0x69')][_0x4eda('0x4a')]({'where':{'id':_0x367df7['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4eda('0x6d')],'as':_0x4eda('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x4eda('0x27')](handleEntityNotFound(_0x4b84a7,null))[_0x4eda('0x27')](function(_0x1f270d){var _0x165138=_[_0x4eda('0x36')](_0x1f270d,'id');var _0x431941=[];var _0x3ec0b7=[];var _0x2bfb85=squel[_0x4eda('0x81')]();_0x2bfb85['field'](_0x4eda('0x82'))[_0x4eda('0x83')](_0x4eda('0x84'),'tq')[_0x4eda('0x85')](_0x4eda('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4eda('0x44')](_0x4eda('0x87'),_0x367df7['params']['id']);for(var _0x1499ef=0x0;_0x1499ef<_0x1f270d[_0x4eda('0x3e')];_0x1499ef+=0x1){let _0x1b2dbb=_0x1f270d[_0x1499ef];for(var _0x1a8a75=0x0;_0x1a8a75<_0x1b2dbb[_0x4eda('0x6e')][_0x4eda('0x3e')];_0x1a8a75+=0x1){let _0x378215=_0x1b2dbb['Agents'][_0x1a8a75];var _0x5eef84=_0x2bfb85[_0x4eda('0x88')]();_0x5eef84['where'](_0x4eda('0x89'),_0x378215['id']);_0x3ec0b7[_0x4eda('0x8a')](db[_0x4eda('0x74')]['query'](_0x5eef84[_0x4eda('0x8b')](),{'type':db[_0x4eda('0x74')][_0x4eda('0x8c')][_0x4eda('0x8d')]})[_0x4eda('0x27')](function(_0x24b1bf){if(_0x24b1bf[_0x4eda('0x3e')]===0x1){return _0x378215['id'];}else{var _0x6ccc67=_[_0x4eda('0x8e')](_[_0x4eda('0x36')](_0x24b1bf,'TeamId'),function(_0x3cccc6){return _['includes'](_0x165138,_0x3cccc6);});if(_0x6ccc67){return _0x378215['id'];}}}));}}return BPromise[_0x4eda('0x8f')](_0x3ec0b7)[_0x4eda('0x27')](function(_0x2ed180){_0x431941=_(_0x431941)[_0x4eda('0x90')](_0x2ed180)[_0x4eda('0x91')]()[_0x4eda('0x2d')]();return db[_0x4eda('0x37')][_0x4eda('0x30')]({'where':{'id':_0x367df7['params']['id']}})[_0x4eda('0x27')](function(_0x4c30bd){return db[_0x4eda('0x74')][_0x4eda('0x75')](function(_0x1c53e4){return _0x4c30bd[_0x4eda('0x80')](_0x367df7[_0x4eda('0x3a')][_0x4eda('0x92')],{'transaction':_0x1c53e4})[_0x4eda('0x27')](function(){if(!_[_0x4eda('0x93')](_0x431941)){return _0x4c30bd[_0x4eda('0x94')](_0x431941,{'transaction':_0x1c53e4})['then'](function(){return db[_0x4eda('0x7a')]['destroy']({'where':{'VoiceQueueId':_0x367df7['params']['id'],'UserId':_0x431941},'transaction':_0x1c53e4});});}})['then'](function(){_0x431941['forEach'](function(_0x44c98f){socket[_0x4eda('0x95')]('userVoiceQueue:remove',{'UserId':_0x44c98f,'VoiceQueueId':_0x4c30bd['id']});});});});});});})['then'](respondWithStatusCode(_0x4b84a7,null))['catch'](handleError(_0x4b84a7,null));};exports[_0x4eda('0x96')]=function(_0x38fb93,_0x23798f,_0x574ec3){var _0xe85a49,_0x59defa;return db['VoiceQueue']['find']({'where':{'id':_0x38fb93[_0x4eda('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23798f,null))[_0x4eda('0x27')](function(_0xf8995d){if(_0xf8995d){_0x59defa=_0xf8995d;return _0xf8995d[_0x4eda('0x96')](_0x38fb93[_0x4eda('0x51')][_0x4eda('0x92')],_[_0x4eda('0x5c')](_0x38fb93['body'],['ids','id'])||{})[_0x4eda('0x97')](function(_0x48e3f8){for(var _0x4b3f76=0x0;_0x4b3f76<_0x38fb93[_0x4eda('0x51')]['ids'][_0x4eda('0x3e')];_0x4b3f76+=0x1){socket[_0x4eda('0x95')]('userVoiceQueue:save',{'UserId':Number(_0x38fb93[_0x4eda('0x51')][_0x4eda('0x92')][_0x4b3f76]),'VoiceQueueId':Number(_0x38fb93[_0x4eda('0x4d')]['id'])});}return _0x48e3f8;});}})[_0x4eda('0x27')](function(_0x43cdd1){_0xe85a49=_0x43cdd1||[];if(_0x59defa){return db[_0x4eda('0x6d')][_0x4eda('0x4a')]({'where':{'id':_0x38fb93['body'][_0x4eda('0x92')]},'attributes':['id',_0x4eda('0x31'),_0x4eda('0x6f'),_0x4eda('0x7e'),_0x4eda('0x70')],'raw':!![]});}})[_0x4eda('0x27')](function(_0x328c34){if(!_[_0x4eda('0x93')](_0x328c34)){var _0x3ae4cb=[];for(var _0x7fea08=0x0;_0x7fea08<_0x328c34[_0x4eda('0x3e')];_0x7fea08++){if(_0x328c34[_0x7fea08]['online']){_0x3ae4cb[_0x4eda('0x8a')](db[_0x4eda('0x7a')][_0x4eda('0x78')]({'membername':_0x328c34[_0x7fea08][_0x4eda('0x31')],'UserId':_0x328c34[_0x7fea08]['id'],'queue_name':_0x59defa[_0x4eda('0x31')],'VoiceQueueId':_0x59defa['id'],'interface':_[_0x4eda('0x7b')](_0x328c34[_0x7fea08][_0x4eda('0x70')])?util[_0x4eda('0x7c')](_0x4eda('0x7d'),_0x328c34[_0x7fea08][_0x4eda('0x31')]):_0x328c34[_0x7fea08][_0x4eda('0x70')],'paused':_0x328c34[_0x7fea08][_0x4eda('0x7e')]||![],'penalty':_0x38fb93[_0x4eda('0x51')][_0x4eda('0x73')]||0x0}));}}return BPromise[_0x4eda('0x8f')](_0x3ae4cb);}})[_0x4eda('0x27')](function(){return _0xe85a49;})[_0x4eda('0x27')](respondWithResult(_0x23798f,null))['catch'](handleError(_0x23798f,null));};exports[_0x4eda('0x94')]=function(_0x41c0c7,_0x52001f,_0x18f008){return db[_0x4eda('0x37')]['find']({'where':{'id':_0x41c0c7['params']['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x52001f,null))['then'](function(_0x5cad34){if(_0x5cad34){return _0x5cad34[_0x4eda('0x94')](_0x41c0c7['query'][_0x4eda('0x92')])[_0x4eda('0x27')](function(){if(_[_0x4eda('0x98')](_0x41c0c7[_0x4eda('0x3a')][_0x4eda('0x92')])){for(var _0x5980eb=0x0;_0x5980eb<_0x41c0c7[_0x4eda('0x3a')][_0x4eda('0x92')][_0x4eda('0x3e')];_0x5980eb+=0x1){socket[_0x4eda('0x95')]('userVoiceQueue:remove',{'UserId':Number(_0x41c0c7[_0x4eda('0x3a')][_0x4eda('0x92')][_0x5980eb]),'VoiceQueueId':Number(_0x41c0c7[_0x4eda('0x4d')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x41c0c7[_0x4eda('0x3a')][_0x4eda('0x92')]),'VoiceQueueId':Number(_0x41c0c7[_0x4eda('0x4d')]['id'])});}});}})[_0x4eda('0x27')](function(_0x3d7858){return db[_0x4eda('0x7a')][_0x4eda('0x28')]({'where':{'VoiceQueueId':_0x41c0c7[_0x4eda('0x4d')]['id'],'UserId':_0x41c0c7[_0x4eda('0x3a')]['ids']}})[_0x4eda('0x27')](function(){return _0x3d7858;});})[_0x4eda('0x27')](respondWithStatusCode(_0x52001f,null))[_0x4eda('0x4f')](handleError(_0x52001f,null));};exports['getAgents']=function(_0x2e5a5e,_0x1c2916,_0x234a08){var _0x179890={};var _0x329f65={};var _0x101dd3;var _0x4fc57c;return db['VoiceQueue'][_0x4eda('0x60')]({'where':{'id':_0x2e5a5e[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x1c2916,null))[_0x4eda('0x27')](function(_0x42ff7e){if(_0x42ff7e){_0x101dd3=_0x42ff7e;_0x329f65['model']=_[_0x4eda('0x4e')](db[_0x4eda('0x6d')][_0x4eda('0x59')]);_0x329f65[_0x4eda('0x3a')]=_['keys'](_0x2e5a5e['query']);_0x329f65[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0x329f65[_0x4eda('0x39')],_0x329f65[_0x4eda('0x3a')]);_0x179890[_0x4eda('0x3c')]=_['intersection'](_0x329f65[_0x4eda('0x39')],qs['fields'](_0x2e5a5e[_0x4eda('0x3a')]['fields']));_0x179890[_0x4eda('0x3c')]=_0x179890[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x179890[_0x4eda('0x3c')]:_0x329f65['model'];_0x179890[_0x4eda('0x41')]=qs[_0x4eda('0x42')](_0x2e5a5e[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x179890[_0x4eda('0x44')]=qs['filters'](_[_0x4eda('0x61')](_0x2e5a5e['query'],_0x329f65[_0x4eda('0x43')]));if(_0x2e5a5e['query'][_0x4eda('0x2c')]){_0x179890[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x179890['where'],{'$or':_[_0x4eda('0x36')](_0x179890[_0x4eda('0x3c')],function(_0x300a7e){var _0x3049d8={};_0x3049d8[_0x300a7e]={'$like':'%'+_0x2e5a5e[_0x4eda('0x3a')][_0x4eda('0x2c')]+'%'};return _0x3049d8;})});}_0x179890=_[_0x4eda('0x45')]({},_0x179890,_0x2e5a5e['options']);return _0x101dd3[_0x4eda('0x99')](_0x179890);}})[_0x4eda('0x27')](function(_0x378061){if(_0x378061){_0x4fc57c=_0x378061['length'];if(!_0x2e5a5e[_0x4eda('0x3a')]['hasOwnProperty']('nolimit')){_0x179890[_0x4eda('0x23')]=qs[_0x4eda('0x23')](_0x2e5a5e['query']['limit']);_0x179890['offset']=qs['offset'](_0x2e5a5e[_0x4eda('0x3a')]['offset']);}return _0x101dd3[_0x4eda('0x99')](_0x179890);}})[_0x4eda('0x27')](function(_0xa4dcd8){if(_0xa4dcd8){return _0xa4dcd8?{'count':_0x4fc57c,'rows':_0xa4dcd8}:null;}})['then'](respondWithResult(_0x1c2916,null))['catch'](handleError(_0x1c2916,null));};exports[_0x4eda('0x9a')]=function(_0x104c65,_0x371853,_0x5cc65d){var _0x3c3914={};var _0x5dc465={};var _0x1314cb;var _0x27f82c;return db[_0x4eda('0x37')][_0x4eda('0x60')]({'where':{'id':_0x104c65[_0x4eda('0x4d')]['id']}})['then'](handleEntityNotFound(_0x371853,null))[_0x4eda('0x27')](function(_0x5e7fc0){if(_0x5e7fc0){_0x1314cb=_0x5e7fc0;_0x5dc465[_0x4eda('0x39')]=_[_0x4eda('0x4e')](db['UserVoiceQueueRt'][_0x4eda('0x59')]);_0x5dc465[_0x4eda('0x3a')]=_[_0x4eda('0x4e')](_0x104c65[_0x4eda('0x3a')]);_0x5dc465[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0x5dc465[_0x4eda('0x39')],_0x5dc465['query']);_0x3c3914[_0x4eda('0x3c')]=_[_0x4eda('0x3b')](_0x5dc465[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x104c65[_0x4eda('0x3a')][_0x4eda('0x3d')]));_0x3c3914[_0x4eda('0x3c')]=_0x3c3914[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x3c3914[_0x4eda('0x3c')]:_0x5dc465[_0x4eda('0x39')];_0x3c3914['order']=qs['sort'](_0x104c65[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x3c3914['where']=qs[_0x4eda('0x43')](_[_0x4eda('0x61')](_0x104c65[_0x4eda('0x3a')],_0x5dc465[_0x4eda('0x43')]));if(_0x104c65['query'][_0x4eda('0x2c')]){_0x3c3914[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x3c3914[_0x4eda('0x44')],{'$or':_[_0x4eda('0x36')](_0x3c3914[_0x4eda('0x3c')],function(_0x17bf09){var _0x3c515c={};_0x3c515c[_0x17bf09]={'$like':'%'+_0x104c65['query'][_0x4eda('0x2c')]+'%'};return _0x3c515c;})});}_0x3c3914=_[_0x4eda('0x45')]({},_0x3c3914,_0x104c65[_0x4eda('0x47')]);return _0x1314cb[_0x4eda('0x9a')](_0x3c3914);}})[_0x4eda('0x27')](function(_0x6af5){if(_0x6af5){_0x27f82c=_0x6af5[_0x4eda('0x3e')];if(!_0x104c65[_0x4eda('0x3a')][_0x4eda('0x3f')]('nolimit')){_0x3c3914[_0x4eda('0x23')]=qs[_0x4eda('0x23')](_0x104c65['query'][_0x4eda('0x23')]);_0x3c3914[_0x4eda('0x21')]=qs[_0x4eda('0x21')](_0x104c65[_0x4eda('0x3a')][_0x4eda('0x21')]);}return _0x1314cb[_0x4eda('0x9a')](_0x3c3914);}})[_0x4eda('0x27')](function(_0x298863){return _0x298863?{'count':_0x27f82c,'rows':_0x298863}:null;})[_0x4eda('0x27')](respondWithResult(_0x371853,null))['catch'](handleError(_0x371853,null));};exports[_0x4eda('0x9b')]=function(_0x2dc8ae,_0x45c7b4,_0x3a28f3){var _0x4880c4={};var _0x257a22={};var _0x35e121;var _0x2ee10c;return db[_0x4eda('0x37')][_0x4eda('0x60')]({'where':{'id':_0x2dc8ae[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x45c7b4,null))[_0x4eda('0x27')](function(_0x3dfa14){if(_0x3dfa14){_0x35e121=_0x3dfa14;_0x257a22[_0x4eda('0x39')]=_[_0x4eda('0x4e')](db[_0x4eda('0x9c')][_0x4eda('0x59')]);_0x257a22['query']=_[_0x4eda('0x4e')](_0x2dc8ae[_0x4eda('0x3a')]);_0x257a22[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0x257a22[_0x4eda('0x39')],_0x257a22['query']);_0x4880c4[_0x4eda('0x3c')]=_['intersection'](_0x257a22['model'],qs[_0x4eda('0x3d')](_0x2dc8ae['query'][_0x4eda('0x3d')]));_0x4880c4[_0x4eda('0x3c')]=_0x4880c4[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x4880c4['attributes']:_0x257a22[_0x4eda('0x39')];_0x4880c4[_0x4eda('0x41')]=qs[_0x4eda('0x42')](_0x2dc8ae[_0x4eda('0x3a')][_0x4eda('0x42')]);_0x4880c4[_0x4eda('0x44')]=qs['filters'](_[_0x4eda('0x61')](_0x2dc8ae['query'],_0x257a22[_0x4eda('0x43')]));if(_0x2dc8ae['query'][_0x4eda('0x2c')]){_0x4880c4[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x4880c4[_0x4eda('0x44')],{'$or':_[_0x4eda('0x36')](_0x4880c4[_0x4eda('0x3c')],function(_0x5205df){var _0x3ea664={};_0x3ea664[_0x5205df]={'$like':'%'+_0x2dc8ae[_0x4eda('0x3a')][_0x4eda('0x2c')]+'%'};return _0x3ea664;})});}_0x4880c4=_[_0x4eda('0x45')]({},_0x4880c4,_0x2dc8ae['options']);return _0x35e121[_0x4eda('0x9b')](_0x4880c4);}})[_0x4eda('0x27')](function(_0xd82020){if(_0xd82020){_0x2ee10c=_0xd82020[_0x4eda('0x3e')];if(!_0x2dc8ae[_0x4eda('0x3a')][_0x4eda('0x3f')]('nolimit')){_0x4880c4[_0x4eda('0x23')]=qs[_0x4eda('0x23')](_0x2dc8ae[_0x4eda('0x3a')][_0x4eda('0x23')]);_0x4880c4['offset']=qs[_0x4eda('0x21')](_0x2dc8ae[_0x4eda('0x3a')][_0x4eda('0x21')]);}return _0x35e121[_0x4eda('0x9b')](_0x4880c4);}})[_0x4eda('0x27')](function(_0x4b0f0d){if(_0x4b0f0d){return _0x4b0f0d?{'count':_0x2ee10c,'rows':_0x4b0f0d}:null;}})[_0x4eda('0x27')](respondWithResult(_0x45c7b4,null))[_0x4eda('0x4f')](handleError(_0x45c7b4,null));};exports[_0x4eda('0x9d')]=function(_0x56e5fc,_0x1a7b57,_0xe55fe5){var _0x495756,_0x4c47e2;return db[_0x4eda('0x37')][_0x4eda('0x30')]({'where':{'id':_0x56e5fc[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x1a7b57,null))[_0x4eda('0x27')](function(_0x5440d2){if(_0x5440d2){_0x4c47e2=_0x5440d2;return _0x5440d2[_0x4eda('0x9d')](_0x56e5fc[_0x4eda('0x51')][_0x4eda('0x92')],_[_0x4eda('0x5c')](_0x56e5fc[_0x4eda('0x51')],['ids','id'])||{});}return null;})[_0x4eda('0x97')](function(_0x44dcbf){var _0x318060;_0x495756=_0x44dcbf||[];var _0x38277e=[];if(_0x44dcbf){for(var _0x23297a=0x0;_0x23297a<_0x44dcbf[_0x4eda('0x3e')];_0x23297a+=0x1){var _0x4b5b32=_0x44dcbf[_0x23297a][_0x4eda('0x52')]({'plain':!![]});_0x4c47e2['dialCheckDuplicateType']=_0x56e5fc[_0x4eda('0x51')]['dialCheckDuplicateType']?_0x56e5fc[_0x4eda('0x51')][_0x4eda('0x9e')]:_0x4c47e2[_0x4eda('0x9e')];switch(_0x4c47e2[_0x4eda('0x9e')]){case _0x4eda('0x9f'):_0x318060=squel[_0x4eda('0xa0')]()['into'](_0x4eda('0xa1'))[_0x4eda('0xa2')]([_0x4eda('0xa3'),'scheduledAt',_0x4eda('0xa4'),'ListId',_0x4eda('0x62'),_0x4eda('0x5a'),'updatedAt'],squel[_0x4eda('0x81')]()['field'](_0x4eda('0xa3'),_0x4eda('0xa3'))['field'](_0x4eda('0xa5'),_0x4eda('0xa6'))[_0x4eda('0xa7')]('id',_0x4eda('0xa4'))[_0x4eda('0xa7')](_0x4b5b32[_0x4eda('0xa8')][_0x4eda('0x8b')](),_0x4eda('0xa9'))[_0x4eda('0xa7')](_0x56e5fc[_0x4eda('0x4d')]['id'][_0x4eda('0x8b')](),_0x4eda('0x62'))[_0x4eda('0xa7')](_0x4eda('0xa5'),'createdAt')['field'](_0x4eda('0xa5'),'updatedAt')[_0x4eda('0x83')](_0x4eda('0xaa'))[_0x4eda('0x44')](_0x4eda('0xab'))[_0x4eda('0x44')](_0x4eda('0xac'),_0x4b5b32[_0x4eda('0xa8')][_0x4eda('0x8b')]())['where'](_0x4eda('0xad'))[_0x4eda('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4eda('0x81')]()[_0x4eda('0xa7')]('COALESCE(calleridnum,\x27\x27)')['from'](_0x4eda('0xae'))['where'](_0x4eda('0x87'),_0x56e5fc[_0x4eda('0x4d')]['id'][_0x4eda('0x8b')]()))[_0x4eda('0x44')](_0x4eda('0xaf'),squel[_0x4eda('0x81')]()[_0x4eda('0xa7')](_0x4eda('0xb0'))['from']('cm_hopper')['where'](_0x4eda('0x87'),_0x56e5fc['params']['id'][_0x4eda('0x8b')]())))[_0x4eda('0x8b')]();break;case _0x4eda('0xb1'):_0x318060=squel[_0x4eda('0xa0')]()[_0x4eda('0xb2')]('cm_hopper')[_0x4eda('0xa2')]([_0x4eda('0xa3'),_0x4eda('0xa6'),_0x4eda('0xa4'),_0x4eda('0xa9'),_0x4eda('0x62'),_0x4eda('0x5a'),_0x4eda('0x5b')],squel['select']()['field'](_0x4eda('0xa3'),_0x4eda('0xa3'))[_0x4eda('0xa7')]('NOW()',_0x4eda('0xa6'))[_0x4eda('0xa7')]('id',_0x4eda('0xa4'))[_0x4eda('0xa7')](_0x4b5b32['CmListId']['toString'](),_0x4eda('0xa9'))[_0x4eda('0xa7')](_0x56e5fc[_0x4eda('0x4d')]['id'][_0x4eda('0x8b')](),'VoiceQueueId')[_0x4eda('0xa7')](_0x4eda('0xa5'),_0x4eda('0x5a'))[_0x4eda('0xa7')](_0x4eda('0xa5'),_0x4eda('0x5b'))[_0x4eda('0x83')]('cm_contacts')[_0x4eda('0x44')](_0x4eda('0xab'))[_0x4eda('0x44')](_0x4eda('0xac'),_0x4b5b32[_0x4eda('0xa8')][_0x4eda('0x8b')]())[_0x4eda('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x4eda('0x44')]('phone\x20NOT\x20IN\x20(?)',squel[_0x4eda('0x81')]()[_0x4eda('0xa7')]('COALESCE(phone,\x27\x27)')[_0x4eda('0x83')]('cm_hopper')[_0x4eda('0x44')](_0x4eda('0x87'),_0x56e5fc[_0x4eda('0x4d')]['id'][_0x4eda('0x8b')]())))['toString']();break;default:_0x318060=squel[_0x4eda('0xa0')]()[_0x4eda('0xb2')](_0x4eda('0xa1'))[_0x4eda('0xa2')]([_0x4eda('0xa3'),_0x4eda('0xa6'),_0x4eda('0xa4'),_0x4eda('0xa9'),_0x4eda('0x62'),_0x4eda('0x5a'),'updatedAt'],squel['select']()[_0x4eda('0xa7')](_0x4eda('0xa3'),_0x4eda('0xa3'))['field'](_0x4eda('0xa5'),_0x4eda('0xa6'))['field']('id',_0x4eda('0xa4'))['field'](_0x4b5b32['CmListId'][_0x4eda('0x8b')](),'ListId')[_0x4eda('0xa7')](_0x56e5fc['params']['id'][_0x4eda('0x8b')](),'VoiceQueueId')['field']('NOW()',_0x4eda('0x5a'))[_0x4eda('0xa7')](_0x4eda('0xa5'),'updatedAt')[_0x4eda('0x83')](_0x4eda('0xaa'))[_0x4eda('0x44')](_0x4eda('0xab'))[_0x4eda('0x44')](_0x4eda('0xac'),_0x4b5b32['CmListId'][_0x4eda('0x8b')]())[_0x4eda('0x44')](_0x4eda('0xad')))['toString']();}_0x38277e[_0x4eda('0x8a')](db[_0x4eda('0x74')][_0x4eda('0x3a')](_0x318060));}return BPromise[_0x4eda('0x8f')](_0x38277e);}})['then'](function(){return _0x495756;})[_0x4eda('0x27')](respondWithResult(_0x1a7b57,null))[_0x4eda('0x4f')](handleError(_0x1a7b57,null));};exports[_0x4eda('0xb3')]=function(_0x5430fc,_0x345668,_0x1035b5){return db[_0x4eda('0x37')][_0x4eda('0x30')]({'where':{'id':_0x5430fc[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x345668,null))[_0x4eda('0x27')](function(_0x3f70b9){if(_0x3f70b9){return _0x3f70b9[_0x4eda('0xb3')](_0x5430fc[_0x4eda('0x3a')][_0x4eda('0x92')]);}})[_0x4eda('0x27')](function(_0x8a8057){if(_0x8a8057){return db[_0x4eda('0x63')]['destroy']({'where':{'ListId':_0x5430fc[_0x4eda('0x3a')]['ids'],'VoiceQueueId':_0x5430fc[_0x4eda('0x4d')]['id']}})['then'](function(){return _0x8a8057;});}})['then'](respondWithStatusCode(_0x345668,null))['catch'](handleError(_0x345668,null));};exports[_0x4eda('0xb4')]=function(_0x2822b8,_0x3e360c,_0x5a2a3b){var _0x17c095={};var _0x527add={};var _0x2a4436;var _0x22bd27;return db[_0x4eda('0x37')][_0x4eda('0x60')]({'where':{'id':_0x2822b8[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x3e360c,null))['then'](function(_0x53d2d1){if(_0x53d2d1){_0x2a4436=_0x53d2d1;_0x527add['model']=_[_0x4eda('0x4e')](db['CmList'][_0x4eda('0x59')]);_0x527add[_0x4eda('0x3a')]=_[_0x4eda('0x4e')](_0x2822b8['query']);_0x527add[_0x4eda('0x43')]=_[_0x4eda('0x3b')](_0x527add[_0x4eda('0x39')],_0x527add['query']);_0x17c095[_0x4eda('0x3c')]=_['intersection'](_0x527add[_0x4eda('0x39')],qs[_0x4eda('0x3d')](_0x2822b8[_0x4eda('0x3a')][_0x4eda('0x3d')]));_0x17c095[_0x4eda('0x3c')]=_0x17c095[_0x4eda('0x3c')][_0x4eda('0x3e')]?_0x17c095[_0x4eda('0x3c')]:_0x527add['model'];_0x17c095['order']=qs['sort'](_0x2822b8['query'][_0x4eda('0x42')]);_0x17c095[_0x4eda('0x44')]=qs['filters'](_[_0x4eda('0x61')](_0x2822b8[_0x4eda('0x3a')],_0x527add['filters']));if(_0x2822b8[_0x4eda('0x3a')][_0x4eda('0x2c')]){_0x17c095[_0x4eda('0x44')]=_[_0x4eda('0x45')](_0x17c095[_0x4eda('0x44')],{'$or':_[_0x4eda('0x36')](_0x17c095[_0x4eda('0x3c')],function(_0x35486e){var _0x44377a={};_0x44377a[_0x35486e]={'$like':'%'+_0x2822b8[_0x4eda('0x3a')][_0x4eda('0x2c')]+'%'};return _0x44377a;})});}_0x17c095=_['merge']({},_0x17c095,_0x2822b8[_0x4eda('0x47')]);return _0x2a4436[_0x4eda('0xb4')](_0x17c095);}})['then'](function(_0x42eb7a){if(_0x42eb7a){_0x22bd27=_0x42eb7a['length'];if(!_0x2822b8[_0x4eda('0x3a')][_0x4eda('0x3f')](_0x4eda('0x40'))){_0x17c095[_0x4eda('0x23')]=qs[_0x4eda('0x23')](_0x2822b8[_0x4eda('0x3a')][_0x4eda('0x23')]);_0x17c095[_0x4eda('0x21')]=qs[_0x4eda('0x21')](_0x2822b8[_0x4eda('0x3a')][_0x4eda('0x21')]);}return _0x2a4436[_0x4eda('0xb4')](_0x17c095);}})[_0x4eda('0x27')](function(_0x3771f4){if(_0x3771f4){return _0x3771f4?{'count':_0x22bd27,'rows':_0x3771f4}:null;}})[_0x4eda('0x27')](respondWithResult(_0x3e360c,null))[_0x4eda('0x4f')](handleError(_0x3e360c,null));};exports[_0x4eda('0xb5')]=function(_0x21348b,_0x1de7c5,_0x5e9233){var _0x280bac,_0x59588f;return db[_0x4eda('0x37')][_0x4eda('0x30')]({'where':{'id':_0x21348b[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x1de7c5,null))[_0x4eda('0x27')](function(_0x13f270){if(_0x13f270){_0x59588f=_0x13f270;return _0x13f270[_0x4eda('0xb5')](_0x21348b[_0x4eda('0x51')][_0x4eda('0x92')],_[_0x4eda('0x5c')](_0x21348b['body'],['ids','id'])||{});}return null;})[_0x4eda('0x97')](function(_0x1a6ae8){var _0x35623f;_0x280bac=_0x1a6ae8||[];var _0x53707e=[];if(_0x1a6ae8){for(var _0x1e6c79=0x0;_0x1e6c79<_0x1a6ae8[_0x4eda('0x3e')];_0x1e6c79+=0x1){var _0xef60b8=_0x1a6ae8[_0x1e6c79][_0x4eda('0x52')]({'plain':!![]});_0x35623f=squel[_0x4eda('0xa0')]()[_0x4eda('0xb2')](_0x4eda('0xb6'))['fromQuery']([_0x4eda('0xa3'),_0x4eda('0xa4'),_0x4eda('0xa9'),_0x4eda('0x62'),_0x4eda('0x5a'),_0x4eda('0x5b')],squel[_0x4eda('0x81')]()[_0x4eda('0xa7')]('phone',_0x4eda('0xa3'))[_0x4eda('0xa7')]('id','ContactId')[_0x4eda('0xa7')](_0xef60b8[_0x4eda('0xa8')][_0x4eda('0x8b')](),_0x4eda('0xa9'))[_0x4eda('0xa7')](_0x21348b[_0x4eda('0x4d')]['id']['toString'](),'VoiceQueueId')['field'](_0x4eda('0xa5'),_0x4eda('0x5a'))[_0x4eda('0xa7')](_0x4eda('0xa5'),'updatedAt')[_0x4eda('0x83')](_0x4eda('0xaa'))['where'](_0x4eda('0xab'))[_0x4eda('0x44')](_0x4eda('0xac'),_0xef60b8[_0x4eda('0xa8')][_0x4eda('0x8b')]())[_0x4eda('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0x4eda('0x8b')]();_0x53707e[_0x4eda('0x8a')](db['sequelize'][_0x4eda('0x3a')](_0x35623f));}return BPromise[_0x4eda('0x8f')](_0x53707e);}})['then'](function(){return _0x280bac;})['then'](respondWithResult(_0x1de7c5,null))[_0x4eda('0x4f')](handleError(_0x1de7c5,null));};exports['removeBlackLists']=function(_0x216a9d,_0x20032d,_0x706f4d){return db[_0x4eda('0x37')]['find']({'where':{'id':_0x216a9d[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](handleEntityNotFound(_0x20032d,null))[_0x4eda('0x27')](function(_0x35aba8){if(_0x35aba8){return _0x35aba8[_0x4eda('0xb7')](_0x216a9d[_0x4eda('0x3a')][_0x4eda('0x92')]);}})[_0x4eda('0x27')](function(_0x258883){if(_0x258883){return db[_0x4eda('0x68')][_0x4eda('0x28')]({'where':{'ListId':_0x216a9d[_0x4eda('0x3a')][_0x4eda('0x92')],'VoiceQueueId':_0x216a9d[_0x4eda('0x4d')]['id']}})[_0x4eda('0x27')](function(){return _0x258883;});}})[_0x4eda('0x27')](respondWithStatusCode(_0x20032d,null))['catch'](handleError(_0x20032d,null));}; \ No newline at end of file +var _0x87dc=['index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','merge','map','VIRTUAL','include','VoiceQueue','catch','params','length','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','createdAt','userProfileId','error','update','getHoppers','findOne','CmHopper','nolimit','pick','VoiceQueueId','findAll','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','User','Agents','voicePause','flatMap','penalty','sequelize','transaction','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','interface','forEach','emit','userVoiceQueue:save','removeTeams','field','tq.TeamId','team_has_voice_queues','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','compact','ids','isEmpty','removeAgents','addAgents','online','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','CmListId','NOW()','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','cm_contacts','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','includes','UserProfileResource','end','stack','name'];(function(_0x3ad0cc,_0x4565ef){var _0x2af3d0=function(_0x1cbb93){while(--_0x1cbb93){_0x3ad0cc['push'](_0x3ad0cc['shift']());}};_0x2af3d0(++_0x4565ef);}(_0x87dc,0x81));var _0xc87d=function(_0x44d51f,_0x13c2e8){_0x44d51f=_0x44d51f-0x0;var _0x3c7b7d=_0x87dc[_0x44d51f];return _0x3c7b7d;};'use strict';var emlformat=require(_0xc87d('0x0'));var rimraf=require(_0xc87d('0x1'));var zipdir=require(_0xc87d('0x2'));var jsonpatch=require(_0xc87d('0x3'));var rp=require(_0xc87d('0x4'));var moment=require(_0xc87d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc87d('0x6'));var util=require(_0xc87d('0x7'));var path=require(_0xc87d('0x8'));var sox=require(_0xc87d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc87d('0xa'));var _=require(_0xc87d('0xb'));var squel=require(_0xc87d('0xc'));var crypto=require(_0xc87d('0xd'));var jsforce=require(_0xc87d('0xe'));var deskjs=require(_0xc87d('0xf'));var toCsv=require(_0xc87d('0x10'));var querystring=require('querystring');var Papa=require(_0xc87d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc87d('0x12'));var hardwareService=require(_0xc87d('0x13'));var logger=require('../../config/logger')(_0xc87d('0x14'));var utils=require(_0xc87d('0x15'));var config=require(_0xc87d('0x16'));var licenseUtil=require(_0xc87d('0x17'));var db=require(_0xc87d('0x18'))['db'];config['redis']=_[_0xc87d('0x19')](config[_0xc87d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc87d('0x1b'))(new Redis(config[_0xc87d('0x1a')]));require(_0xc87d('0x1c'))[_0xc87d('0x1d')](socket);function respondWithStatusCode(_0x39e27c,_0xcd7656){_0xcd7656=_0xcd7656||0xcc;return function(_0x3ecc44){if(_0x3ecc44){return _0x39e27c[_0xc87d('0x1e')](_0xcd7656);}return _0x39e27c[_0xc87d('0x1f')](_0xcd7656)['end']();};}function respondWithResult(_0xbaf7eb,_0xf38d2e){_0xf38d2e=_0xf38d2e||0xc8;return function(_0x27402b){if(_0x27402b){return _0xbaf7eb[_0xc87d('0x1f')](_0xf38d2e)[_0xc87d('0x20')](_0x27402b);}};}function respondWithFilteredResult(_0x4b0691,_0x238ff5){return function(_0x2cd19b){if(_0x2cd19b){var _0x5778b4=typeof _0x238ff5[_0xc87d('0x21')]===_0xc87d('0x22')&&typeof _0x238ff5[_0xc87d('0x23')]===_0xc87d('0x22');var _0x3015c3=_0x2cd19b[_0xc87d('0x24')];var _0x597e6d=_0x5778b4?0x0:_0x238ff5[_0xc87d('0x21')];var _0x4fe976=_0x5778b4?_0x2cd19b[_0xc87d('0x24')]:_0x238ff5['offset']+_0x238ff5[_0xc87d('0x23')];var _0x9e805c;if(_0x4fe976>=_0x3015c3){_0x4fe976=_0x3015c3;_0x9e805c=0xc8;}else{_0x9e805c=0xce;}_0x4b0691[_0xc87d('0x1f')](_0x9e805c);return _0x4b0691[_0xc87d('0x25')]('Content-Range',_0x597e6d+'-'+_0x4fe976+'/'+_0x3015c3)[_0xc87d('0x20')](_0x2cd19b);}return null;};}function patchUpdates(_0x369a7e){return function(_0xc30b65){try{jsonpatch[_0xc87d('0x26')](_0xc30b65,_0x369a7e,!![]);}catch(_0x5b1f56){return BPromise['reject'](_0x5b1f56);}return _0xc30b65[_0xc87d('0x27')]();};}function saveUpdates(_0x4ff0c2,_0x433cda){return function(_0x5d4f39){if(_0x5d4f39){return _0x5d4f39['update'](_0x4ff0c2)[_0xc87d('0x28')](function(_0x196876){return _0x196876;});}return null;};}function removeEntity(_0x240171,_0x23ac82){return function(_0xe3f491){if(_0xe3f491){return _0xe3f491[_0xc87d('0x29')]()['then'](function(){var _0xdc43c=_0xe3f491[_0xc87d('0x2a')]({'plain':!![]});var _0x37849e=[{'name':_0xc87d('0x2b'),'value':_0xc87d('0x2c'),'ignore':![]},{'name':_0xc87d('0x2d'),'value':_0xc87d('0x2e'),'ignore':![]}];var _0x113201=_(_0x37849e)[_0xc87d('0x2f')](_0xc87d('0x30'))['map'](_0xc87d('0x31'))[_0xc87d('0x31')]();if(_[_0xc87d('0x32')](_0x113201,_0xdc43c['type'])){return;}var _0x46ab62=_['find'](_0x37849e,[_0xc87d('0x31'),_0xdc43c['type']])['name'];return db[_0xc87d('0x33')][_0xc87d('0x29')]({'where':{'type':_0x46ab62,'resourceId':_0xdc43c['id']}})['then'](function(){return _0xe3f491;});})[_0xc87d('0x28')](function(){_0x240171[_0xc87d('0x1f')](0xcc)[_0xc87d('0x34')]();});}};}function handleEntityNotFound(_0x1c12bb,_0x4781ea){return function(_0x3ea46f){if(!_0x3ea46f){_0x1c12bb[_0xc87d('0x1e')](0x194);}return _0x3ea46f;};}function handleError(_0x351da0,_0x425b99){_0x425b99=_0x425b99||0x1f4;return function(_0x3776e9){logger['error'](_0x3776e9[_0xc87d('0x35')]);if(_0x3776e9['name']){delete _0x3776e9[_0xc87d('0x36')];}_0x351da0[_0xc87d('0x1f')](_0x425b99)['send'](_0x3776e9);};}exports[_0xc87d('0x37')]=function(_0x3cf083,_0xf330c5){var _0xe81e7f={},_0xf94654={},_0x4b9d49={'count':0x0,'rows':[]};var _0x111c21=_['map'](db['VoiceQueue'][_0xc87d('0x38')],function(_0x5c6b45){return{'name':_0x5c6b45[_0xc87d('0x39')],'type':_0x5c6b45[_0xc87d('0x3a')][_0xc87d('0x3b')]};});_0xf94654[_0xc87d('0x3c')]=_['map'](_0x111c21,_0xc87d('0x36'));_0xf94654[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x3cf083['query']);_0xf94654[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0xf94654[_0xc87d('0x3c')],_0xf94654[_0xc87d('0x3d')]);_0xe81e7f['attributes']=_[_0xc87d('0x40')](_0xf94654[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x41')]));_0xe81e7f['attributes']=_0xe81e7f[_0xc87d('0x42')]['length']?_0xe81e7f[_0xc87d('0x42')]:_0xf94654['model'];if(!_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x43')]('nolimit')){_0xe81e7f[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x3cf083[_0xc87d('0x3d')]['limit']);_0xe81e7f[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x21')]);}_0xe81e7f['order']=qs['sort'](_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x44')]);_0xe81e7f['where']=qs[_0xc87d('0x3f')](_['pick'](_0x3cf083['query'],_0xf94654['filters']),_0x111c21);if(_0x3cf083[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0xe81e7f[_0xc87d('0x45')]=_[_0xc87d('0x46')](_0xe81e7f[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x111c21,function(_0x4e32cc){if(_0x4e32cc['type']!==_0xc87d('0x48')){var _0x28f3d7={};_0x28f3d7[_0x4e32cc[_0xc87d('0x36')]]={'$like':'%'+_0x3cf083[_0xc87d('0x3d')]['filter']+'%'};return _0x28f3d7;}})});}_0xe81e7f=_['merge']({},_0xe81e7f,_0x3cf083['options']);var _0x2a0aef={'where':_0xe81e7f[_0xc87d('0x45')]};return db['VoiceQueue']['count'](_0x2a0aef)[_0xc87d('0x28')](function(_0x538830){_0x4b9d49[_0xc87d('0x24')]=_0x538830;if(_0x3cf083[_0xc87d('0x3d')]['includeAll']){_0xe81e7f[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x4a')]['findAll'](_0xe81e7f);})['then'](function(_0x221282){_0x4b9d49['rows']=_0x221282;return _0x4b9d49;})[_0xc87d('0x28')](respondWithFilteredResult(_0xf330c5,_0xe81e7f))[_0xc87d('0x4b')](handleError(_0xf330c5,null));};exports['show']=function(_0x4561d7,_0x165177){var _0x5f324c={'raw':![],'where':{'id':_0x4561d7[_0xc87d('0x4c')]['id']}},_0x685e0f={};_0x685e0f[_0xc87d('0x3c')]=_['keys'](db['VoiceQueue']['rawAttributes']);_0x685e0f['query']=_[_0xc87d('0x3e')](_0x4561d7['query']);_0x685e0f[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x685e0f[_0xc87d('0x3c')],_0x685e0f[_0xc87d('0x3d')]);_0x5f324c[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x685e0f[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x4561d7[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x5f324c['attributes']=_0x5f324c[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x5f324c[_0xc87d('0x42')]:_0x685e0f[_0xc87d('0x3c')];if(_0x4561d7[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x5f324c['include']=[{'all':!![]}];}_0x5f324c=_[_0xc87d('0x46')]({},_0x5f324c,_0x4561d7[_0xc87d('0x4f')]);return db[_0xc87d('0x4a')]['find'](_0x5f324c)[_0xc87d('0x28')](handleEntityNotFound(_0x165177,null))[_0xc87d('0x28')](respondWithResult(_0x165177,null))[_0xc87d('0x4b')](handleError(_0x165177,null));};exports['create']=function(_0x34ea6c,_0x4f597f){return db['VoiceQueue'][_0xc87d('0x50')](_0x34ea6c[_0xc87d('0x51')],{})['then'](function(_0x1bf008){var _0x4c1acc=_0x34ea6c['user'][_0xc87d('0x2a')]({'plain':!![]});if(!_0x4c1acc)throw new Error(_0xc87d('0x52'));if(_0x4c1acc[_0xc87d('0x53')]===_0xc87d('0x54')){var _0x5977cc=_0x1bf008[_0xc87d('0x2a')]({'plain':!![]});var _0x1c9286=[{'name':_0xc87d('0x2b'),'value':'inbound'},{'name':_0xc87d('0x2d'),'value':_0xc87d('0x2e')}];var _0x448c7c=_['find'](_0x1c9286,[_0xc87d('0x31'),_0x5977cc[_0xc87d('0x3a')]])[_0xc87d('0x36')];return db[_0xc87d('0x55')][_0xc87d('0x56')]({'where':{'name':_0x448c7c,'userProfileId':_0x4c1acc['userProfileId']},'raw':!![]})['then'](function(_0x19e285){if(_0x19e285&&_0x19e285[_0xc87d('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x5977cc[_0xc87d('0x36')],'resourceId':_0x5977cc['id'],'type':_0x19e285[_0xc87d('0x36')],'sectionId':_0x19e285['id']},{})[_0xc87d('0x28')](function(){return _0x1bf008;});}else{return _0x1bf008;}})[_0xc87d('0x4b')](function(_0x5cf90c){logger['error'](_0xc87d('0x58'),_0x5cf90c);throw _0x5cf90c;});}return _0x1bf008;})[_0xc87d('0x28')](respondWithResult(_0x4f597f,0xc9))['catch'](handleError(_0x4f597f,null));};exports[_0xc87d('0x59')]=function(_0x3f48c4,_0x271884){var _0x859e11={'where':{'id':_0x3f48c4['params']['id']}},_0x1796f9={};_0x1796f9[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db['VoiceQueue'][_0xc87d('0x38')]);_0x859e11[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x1796f9['model'],qs[_0xc87d('0x41')](_0x3f48c4['query'][_0xc87d('0x41')]));_0x859e11[_0xc87d('0x42')]=_0x859e11[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x859e11[_0xc87d('0x42')]:_0x1796f9['model'];if(_0x3f48c4[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x859e11[_0xc87d('0x49')]=[{'all':!![]}];}_0x859e11=_[_0xc87d('0x46')]({},_0x859e11,_0x3f48c4[_0xc87d('0x4f')]);return db[_0xc87d('0x4a')][_0xc87d('0x56')](_0x859e11)[_0xc87d('0x28')](handleEntityNotFound(_0x271884,null))[_0xc87d('0x28')](function(_0x4db09f){if(_0x4db09f){var _0x586de3=_0x4db09f[_0xc87d('0x2a')]({'plain':!![]});_0x586de3=qs['omit'](_0x586de3,['id','createdAt',_0xc87d('0x5a')]);_0x3f48c4[_0xc87d('0x51')]=_[_0xc87d('0x5b')](_0x3f48c4['body'],['id',_0xc87d('0x5c'),_0xc87d('0x5a')]);return db['VoiceQueue'][_0xc87d('0x50')](_[_0xc87d('0x46')](_0x586de3,_0x3f48c4['body']),{'include':_0x3f48c4[_0xc87d('0x3d')][_0xc87d('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x2e1cf6){var _0xee9aa6=_0x3f48c4['user'][_0xc87d('0x2a')]({'plain':!![]});if(!_0xee9aa6)throw new Error(_0xc87d('0x52'));if(_0xee9aa6[_0xc87d('0x53')]===_0xc87d('0x54')){var _0x12b384=_0x2e1cf6[_0xc87d('0x2a')]({'plain':!![]});var _0x436012=[{'name':_0xc87d('0x2b'),'value':'inbound'},{'name':_0xc87d('0x2d'),'value':'outbound'}];var _0x21e2a1=_['find'](_0x436012,[_0xc87d('0x31'),_0x12b384['type']])[_0xc87d('0x36')];return db[_0xc87d('0x55')][_0xc87d('0x56')]({'where':{'name':_0x21e2a1,'userProfileId':_0xee9aa6[_0xc87d('0x5d')]},'raw':!![]})[_0xc87d('0x28')](function(_0x5e85d1){if(_0x5e85d1&&_0x5e85d1['autoAssociation']===0x0){return db[_0xc87d('0x33')][_0xc87d('0x50')]({'name':_0x12b384[_0xc87d('0x36')],'resourceId':_0x12b384['id'],'type':_0x5e85d1['name'],'sectionId':_0x5e85d1['id']},{})[_0xc87d('0x28')](function(){return _0x2e1cf6;});}else{return _0x2e1cf6;}})[_0xc87d('0x4b')](function(_0x4c777c){logger[_0xc87d('0x5e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4c777c);throw _0x4c777c;});}return _0x2e1cf6;});}})[_0xc87d('0x28')](respondWithResult(_0x271884,0xc9))[_0xc87d('0x4b')](handleError(_0x271884,null));};exports[_0xc87d('0x5f')]=function(_0x588f18,_0x177d82){if(_0x588f18['body']['id']){delete _0x588f18[_0xc87d('0x51')]['id'];}return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x588f18[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x177d82,null))['then'](saveUpdates(_0x588f18[_0xc87d('0x51')],null))['then'](respondWithResult(_0x177d82,null))[_0xc87d('0x4b')](handleError(_0x177d82,null));};exports[_0xc87d('0x29')]=function(_0x3307fd,_0x3c178c){return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x3307fd[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x3c178c,null))['then'](removeEntity(_0x3c178c,null))[_0xc87d('0x4b')](handleError(_0x3c178c,null));};exports[_0xc87d('0x60')]=function(_0x3e564b,_0x29541b,_0x22f31c){var _0x18c3a2={'raw':![],'where':{}};var _0x3ac30d={};var _0x5b166b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc87d('0x61')]({'where':{'id':_0x3e564b[_0xc87d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x29541b,null))[_0xc87d('0x28')](function(_0x2c8607){if(_0x2c8607){_0x3ac30d[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x62')][_0xc87d('0x38')]);_0x3ac30d[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x3e564b['query']);_0x3ac30d[_0xc87d('0x3f')]=_['intersection'](_0x3ac30d[_0xc87d('0x3c')],_0x3ac30d[_0xc87d('0x3d')]);_0x18c3a2['attributes']=_[_0xc87d('0x40')](_0x3ac30d[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x18c3a2['attributes']=_0x18c3a2[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x18c3a2[_0xc87d('0x42')]:_0x3ac30d[_0xc87d('0x3c')];if(!_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x18c3a2[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x3e564b['query']['limit']);_0x18c3a2[_0xc87d('0x21')]=qs['offset'](_0x3e564b[_0xc87d('0x3d')]['offset']);}_0x18c3a2['order']=qs[_0xc87d('0x44')](_0x3e564b[_0xc87d('0x3d')]['sort']);_0x18c3a2[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x3e564b[_0xc87d('0x3d')],_0x3ac30d['filters']));_0x18c3a2[_0xc87d('0x45')][_0xc87d('0x65')]=_0x2c8607['id'];if(_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x18c3a2[_0xc87d('0x45')]=_[_0xc87d('0x46')](_0x18c3a2[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x18c3a2[_0xc87d('0x42')],function(_0x4121fb){var _0x46fa17={};_0x46fa17[_0x4121fb]={'$like':'%'+_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x46fa17;})});}_0x18c3a2=_[_0xc87d('0x46')]({},_0x18c3a2,_0x3e564b[_0xc87d('0x4f')]);return db[_0xc87d('0x62')]['count']({'where':_0x18c3a2[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x355161){_0x5b166b[_0xc87d('0x24')]=_0x355161;if(_0x3e564b[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x18c3a2[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x62')][_0xc87d('0x66')](_0x18c3a2);})[_0xc87d('0x28')](function(_0x3589d0){_0x5b166b[_0xc87d('0x67')]=_0x3589d0;return _0x5b166b;});}})[_0xc87d('0x28')](respondWithFilteredResult(_0x29541b,_0x18c3a2))[_0xc87d('0x4b')](handleError(_0x29541b,null));};exports[_0xc87d('0x68')]=function(_0x2d7cfb,_0x308a6d,_0x55bba1){var _0xe922c0={'raw':!![],'where':{}};var _0x30767a={};var _0xfc944={'count':0x0,'rows':[]};return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x2d7cfb['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x308a6d,null))[_0xc87d('0x28')](function(_0x524738){if(_0x524738){_0x30767a[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x69')]['rawAttributes']);_0x30767a[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x2d7cfb[_0xc87d('0x3d')]);_0x30767a[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x30767a[_0xc87d('0x3c')],_0x30767a[_0xc87d('0x3d')]);_0xe922c0[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x30767a[_0xc87d('0x3c')],qs['fields'](_0x2d7cfb[_0xc87d('0x3d')][_0xc87d('0x41')]));_0xe922c0[_0xc87d('0x42')]=_0xe922c0['attributes'][_0xc87d('0x4d')]?_0xe922c0[_0xc87d('0x42')]:_0x30767a[_0xc87d('0x3c')];if(!_0x2d7cfb['query']['hasOwnProperty']('nolimit')){_0xe922c0[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x2d7cfb[_0xc87d('0x3d')]['limit']);_0xe922c0['offset']=qs[_0xc87d('0x21')](_0x2d7cfb[_0xc87d('0x3d')][_0xc87d('0x21')]);}_0xe922c0['order']=qs[_0xc87d('0x44')](_0x2d7cfb['query'][_0xc87d('0x44')]);_0xe922c0[_0xc87d('0x45')]=qs['filters'](_['pick'](_0x2d7cfb[_0xc87d('0x3d')],_0x30767a[_0xc87d('0x3f')]));_0xe922c0[_0xc87d('0x45')][_0xc87d('0x65')]=_0x524738['id'];if(_0x2d7cfb['query'][_0xc87d('0x2f')]){_0xe922c0['where']=_['merge'](_0xe922c0[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0xe922c0[_0xc87d('0x42')],function(_0x5cb5ba){var _0x1fd8d9={};_0x1fd8d9[_0x5cb5ba]={'$like':'%'+_0x2d7cfb[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x1fd8d9;})});}_0xe922c0=_[_0xc87d('0x46')]({},_0xe922c0,_0x2d7cfb['options']);return db[_0xc87d('0x69')][_0xc87d('0x24')]({'where':_0xe922c0[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x4d1880){_0xfc944[_0xc87d('0x24')]=_0x4d1880;if(_0x2d7cfb['query']['includeAll']){_0xe922c0[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x69')][_0xc87d('0x66')](_0xe922c0);})[_0xc87d('0x28')](function(_0x1c6d99){_0xfc944['rows']=_0x1c6d99;return _0xfc944;});}})[_0xc87d('0x28')](respondWithFilteredResult(_0x308a6d,_0xe922c0))[_0xc87d('0x4b')](handleError(_0x308a6d,null));};exports[_0xc87d('0x6a')]=function(_0x1fa11f,_0x22f05f,_0x41a71b){var _0x47e7af={'raw':!![],'where':{}};var _0x11c81e={};var _0x44e9a5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc87d('0x61')]({'where':{'id':_0x1fa11f['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x22f05f,null))['then'](function(_0xfd6b3d){if(_0xfd6b3d){_0x11c81e[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x6b')]['rawAttributes']);_0x11c81e[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x1fa11f[_0xc87d('0x3d')]);_0x11c81e[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x11c81e[_0xc87d('0x3c')],_0x11c81e['query']);_0x47e7af['attributes']=_[_0xc87d('0x40')](_0x11c81e['model'],qs[_0xc87d('0x41')](_0x1fa11f['query']['fields']));_0x47e7af[_0xc87d('0x42')]=_0x47e7af[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x47e7af[_0xc87d('0x42')]:_0x11c81e[_0xc87d('0x3c')];if(!_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x43')]('nolimit')){_0x47e7af[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x47e7af['offset']=qs['offset'](_0x1fa11f['query'][_0xc87d('0x21')]);}_0x47e7af[_0xc87d('0x6c')]=qs['sort'](_0x1fa11f['query'][_0xc87d('0x44')]);_0x47e7af[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_['pick'](_0x1fa11f[_0xc87d('0x3d')],_0x11c81e[_0xc87d('0x3f')]));_0x47e7af['where'][_0xc87d('0x65')]=_0xfd6b3d['id'];if(_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x47e7af['where']=_[_0xc87d('0x46')](_0x47e7af['where'],{'$or':_[_0xc87d('0x47')](_0x47e7af[_0xc87d('0x42')],function(_0x4e314b){var _0x5d0dbe={};_0x5d0dbe[_0x4e314b]={'$like':'%'+_0x1fa11f[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x5d0dbe;})});}_0x47e7af=_['merge']({},_0x47e7af,_0x1fa11f[_0xc87d('0x4f')]);return db[_0xc87d('0x6b')][_0xc87d('0x24')]({'where':_0x47e7af[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x6d253f){_0x44e9a5[_0xc87d('0x24')]=_0x6d253f;if(_0x1fa11f['query']['includeAll']){_0x47e7af[_0xc87d('0x49')]=[{'all':!![]}];}return db[_0xc87d('0x6b')]['findAll'](_0x47e7af);})[_0xc87d('0x28')](function(_0x17d15b){_0x44e9a5[_0xc87d('0x67')]=_0x17d15b;return _0x44e9a5;});}})[_0xc87d('0x28')](respondWithFilteredResult(_0x22f05f,_0x47e7af))['catch'](handleError(_0x22f05f,null));};exports[_0xc87d('0x6d')]=function(_0x3d6f7e,_0x1e2b3d,_0x27674b){var _0x54fedc={'raw':!![],'where':{}};var _0x445723={};var _0x5adfc8={'count':0x0,'rows':[]};return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x3d6f7e['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x1e2b3d,null))['then'](function(_0x534da0){if(_0x534da0){_0x445723[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x6e')][_0xc87d('0x38')]);_0x445723[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x3d6f7e['query']);_0x445723['filters']=_['intersection'](_0x445723['model'],_0x445723[_0xc87d('0x3d')]);_0x54fedc[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x445723[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x3d6f7e[_0xc87d('0x3d')]['fields']));_0x54fedc[_0xc87d('0x42')]=_0x54fedc[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x54fedc[_0xc87d('0x42')]:_0x445723[_0xc87d('0x3c')];if(!_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x54fedc[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x3d6f7e[_0xc87d('0x3d')]['limit']);_0x54fedc[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x3d6f7e[_0xc87d('0x3d')]['offset']);}_0x54fedc['order']=qs[_0xc87d('0x44')](_0x3d6f7e['query'][_0xc87d('0x44')]);_0x54fedc[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x3d6f7e[_0xc87d('0x3d')],_0x445723[_0xc87d('0x3f')]));_0x54fedc[_0xc87d('0x45')]['VoiceQueueId']=_0x534da0['id'];if(_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x54fedc['where']=_[_0xc87d('0x46')](_0x54fedc[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x54fedc[_0xc87d('0x42')],function(_0x239027){var _0x581aae={};_0x581aae[_0x239027]={'$like':'%'+_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x581aae;})});}_0x54fedc=_[_0xc87d('0x46')]({},_0x54fedc,_0x3d6f7e[_0xc87d('0x4f')]);return db[_0xc87d('0x6e')][_0xc87d('0x24')]({'where':_0x54fedc[_0xc87d('0x45')]})[_0xc87d('0x28')](function(_0x290cc6){_0x5adfc8[_0xc87d('0x24')]=_0x290cc6;if(_0x3d6f7e[_0xc87d('0x3d')][_0xc87d('0x4e')]){_0x54fedc['include']=[{'all':!![]}];}return db[_0xc87d('0x6e')][_0xc87d('0x66')](_0x54fedc);})[_0xc87d('0x28')](function(_0x2beecc){_0x5adfc8[_0xc87d('0x67')]=_0x2beecc;return _0x5adfc8;});}})['then'](respondWithFilteredResult(_0x1e2b3d,_0x54fedc))['catch'](handleError(_0x1e2b3d,null));};exports[_0xc87d('0x6f')]=function(_0x24b293,_0x1e6b22,_0x2a3e35){var _0x77f7cb={};var _0x11a69e={};var _0x31e68f;var _0x1813ea;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x24b293[_0xc87d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1e6b22,null))[_0xc87d('0x28')](function(_0x370a9a){if(_0x370a9a){_0x31e68f=_0x370a9a;_0x11a69e[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db[_0xc87d('0x70')][_0xc87d('0x38')]);_0x11a69e['query']=_[_0xc87d('0x3e')](_0x24b293['query']);_0x11a69e['filters']=_[_0xc87d('0x40')](_0x11a69e['model'],_0x11a69e[_0xc87d('0x3d')]);_0x77f7cb[_0xc87d('0x42')]=_['intersection'](_0x11a69e[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x77f7cb[_0xc87d('0x42')]=_0x77f7cb[_0xc87d('0x42')]['length']?_0x77f7cb[_0xc87d('0x42')]:_0x11a69e[_0xc87d('0x3c')];_0x77f7cb[_0xc87d('0x6c')]=qs[_0xc87d('0x44')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x77f7cb[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x24b293[_0xc87d('0x3d')],_0x11a69e[_0xc87d('0x3f')]));if(_0x24b293[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x77f7cb['where']=_[_0xc87d('0x46')](_0x77f7cb[_0xc87d('0x45')],{'$or':_['map'](_0x77f7cb[_0xc87d('0x42')],function(_0x4e7850){var _0x218223={};_0x218223[_0x4e7850]={'$like':'%'+_0x24b293[_0xc87d('0x3d')]['filter']+'%'};return _0x218223;})});}_0x77f7cb=_[_0xc87d('0x46')]({},_0x77f7cb,_0x24b293[_0xc87d('0x4f')]);return _0x31e68f['getTeams'](_0x77f7cb);}})[_0xc87d('0x28')](function(_0x316e2e){if(_0x316e2e){_0x1813ea=_0x316e2e[_0xc87d('0x4d')];if(!_0x24b293[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x77f7cb['limit']=qs[_0xc87d('0x23')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x77f7cb[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x24b293[_0xc87d('0x3d')][_0xc87d('0x21')]);}return _0x31e68f['getTeams'](_0x77f7cb);}})[_0xc87d('0x28')](function(_0x22dfa6){if(_0x22dfa6){return _0x22dfa6?{'count':_0x1813ea,'rows':_0x22dfa6}:null;}})[_0xc87d('0x28')](respondWithResult(_0x1e6b22,null))[_0xc87d('0x4b')](handleError(_0x1e6b22,null));};exports['addTeams']=function(_0x4e8d3f,_0x3ac0b4,_0x3b847e){var _0x54c63c=_0x4e8d3f['body']['teams'];var _0xe8f1f4=_[_0xc87d('0x47')](_0x54c63c,'id');return db[_0xc87d('0x70')][_0xc87d('0x66')]({'where':{'id':_0xe8f1f4},'attributes':['id'],'include':[{'model':db[_0xc87d('0x71')],'as':_0xc87d('0x72'),'attributes':['id',_0xc87d('0x36'),'online',_0xc87d('0x73'),'interface'],'raw':!![]}]})[_0xc87d('0x28')](function(_0x50cb34){if(_0x50cb34){var _0xf1f72b=_[_0xc87d('0x74')](_0x50cb34,function(_0x1b2519){var _0x6f157d=_0x1b2519['get']({'plain':!![]});_0x6f157d[_0xc87d('0x72')]['forEach'](function(_0x2cff21){_0x2cff21[_0xc87d('0x75')]=_[_0xc87d('0x56')](_0x54c63c,{'id':_0x6f157d['id']})[_0xc87d('0x75')];});return _0x6f157d['Agents'];});return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x4e8d3f[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](function(_0x253cc3){return db[_0xc87d('0x76')][_0xc87d('0x77')](function(_0x131a92){return _0x253cc3[_0xc87d('0x78')](_0xe8f1f4,{'transaction':_0x131a92})[_0xc87d('0x28')](function(){return BPromise[_0xc87d('0x79')](_0x54c63c,function(_0x2ac05a){return db[_0xc87d('0x7a')][_0xc87d('0x7b')]({'TeamId':_0x2ac05a['id'],'VoiceQueueId':_0x4e8d3f[_0xc87d('0x4c')]['id'],'penalty':_0x2ac05a[_0xc87d('0x75')]},{'transaction':_0x131a92});});})[_0xc87d('0x28')](function(){return BPromise['each'](_0xf1f72b,function(_0x311af0){return db[_0xc87d('0x7c')]['findOrCreate']({'where':{'UserId':_0x311af0['id'],'VoiceQueueId':_0x4e8d3f[_0xc87d('0x4c')]['id']},'defaults':{'penalty':_0x311af0[_0xc87d('0x75')]},'transaction':_0x131a92});});})[_0xc87d('0x28')](function(){return BPromise['each'](_[_0xc87d('0x2f')](_0xf1f72b,{'online':!![]}),function(_0x5a0f92){return db[_0xc87d('0x7d')][_0xc87d('0x7b')]({'membername':_0x5a0f92['name'],'UserId':_0x5a0f92['id'],'queue_name':_0x253cc3['name'],'VoiceQueueId':_0x253cc3['id'],'interface':_[_0xc87d('0x7e')](_0x5a0f92['interface'])?util[_0xc87d('0x7f')](_0xc87d('0x80'),_0x5a0f92[_0xc87d('0x36')]):_0x5a0f92[_0xc87d('0x81')],'paused':_0x5a0f92[_0xc87d('0x73')]||![],'penalty':_0x5a0f92['penalty']},{'transaction':_0x131a92});});})['then'](function(){_0xf1f72b[_0xc87d('0x82')](function(_0x25e79a){socket[_0xc87d('0x83')](_0xc87d('0x84'),{'UserId':_0x25e79a['id'],'VoiceQueueId':_0x253cc3['id']});});});});});}})['then'](respondWithStatusCode(_0x3ac0b4,null))[_0xc87d('0x4b')](handleError(_0x3ac0b4,null));};exports[_0xc87d('0x85')]=function(_0x33625e,_0x14a16b,_0x32f5d5){return db['Team'][_0xc87d('0x66')]({'where':{'id':_0x33625e['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc87d('0x72'),'attributes':['id'],'raw':!![]}]})[_0xc87d('0x28')](handleEntityNotFound(_0x14a16b,null))[_0xc87d('0x28')](function(_0x1cb034){var _0x18f00a=_[_0xc87d('0x47')](_0x1cb034,'id');var _0x5e6304=[];var _0x1b1683=[];var _0x54c1ac=squel['select']();_0x54c1ac[_0xc87d('0x86')](_0xc87d('0x87'))['from'](_0xc87d('0x88'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc87d('0x45')]('VoiceQueueId\x20=\x20?',_0x33625e[_0xc87d('0x4c')]['id']);for(var _0x8e6585=0x0;_0x8e6585<_0x1cb034['length'];_0x8e6585+=0x1){let _0x1bb969=_0x1cb034[_0x8e6585];for(var _0x529c48=0x0;_0x529c48<_0x1bb969[_0xc87d('0x72')][_0xc87d('0x4d')];_0x529c48+=0x1){let _0x5aa4d3=_0x1bb969[_0xc87d('0x72')][_0x529c48];var _0x1670bc=_0x54c1ac[_0xc87d('0x59')]();_0x1670bc[_0xc87d('0x45')](_0xc87d('0x89'),_0x5aa4d3['id']);_0x1b1683[_0xc87d('0x8a')](db[_0xc87d('0x76')]['query'](_0x1670bc[_0xc87d('0x8b')](),{'type':db[_0xc87d('0x76')][_0xc87d('0x8c')]['SELECT']})[_0xc87d('0x28')](function(_0x55c350){if(_0x55c350[_0xc87d('0x4d')]===0x1){return _0x5aa4d3['id'];}else{var _0x8588f8=_[_0xc87d('0x8d')](_['map'](_0x55c350,'TeamId'),function(_0x5f4e85){return _[_0xc87d('0x32')](_0x18f00a,_0x5f4e85);});if(_0x8588f8){return _0x5aa4d3['id'];}}}));}}return BPromise[_0xc87d('0x8e')](_0x1b1683)[_0xc87d('0x28')](function(_0x570d71){_0x5e6304=_(_0x5e6304)['union'](_0x570d71)[_0xc87d('0x8f')]()[_0xc87d('0x31')]();return db['VoiceQueue']['find']({'where':{'id':_0x33625e[_0xc87d('0x4c')]['id']}})['then'](function(_0x5c246f){return db[_0xc87d('0x76')][_0xc87d('0x77')](function(_0x38a7d1){return _0x5c246f[_0xc87d('0x85')](_0x33625e[_0xc87d('0x3d')][_0xc87d('0x90')],{'transaction':_0x38a7d1})[_0xc87d('0x28')](function(){if(!_[_0xc87d('0x91')](_0x5e6304)){return _0x5c246f[_0xc87d('0x92')](_0x5e6304,{'transaction':_0x38a7d1})[_0xc87d('0x28')](function(){return db[_0xc87d('0x7d')][_0xc87d('0x29')]({'where':{'VoiceQueueId':_0x33625e[_0xc87d('0x4c')]['id'],'UserId':_0x5e6304},'transaction':_0x38a7d1});});}})[_0xc87d('0x28')](function(){_0x5e6304[_0xc87d('0x82')](function(_0x2af86f){socket['emit']('userVoiceQueue:remove',{'UserId':_0x2af86f,'VoiceQueueId':_0x5c246f['id']});});});});});});})['then'](respondWithStatusCode(_0x14a16b,null))[_0xc87d('0x4b')](handleError(_0x14a16b,null));};exports[_0xc87d('0x93')]=function(_0x167f0f,_0x37aa65,_0x5e854c){var _0xb2345,_0x127ff3;return db[_0xc87d('0x4a')]['find']({'where':{'id':_0x167f0f[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x37aa65,null))[_0xc87d('0x28')](function(_0x481fdb){if(_0x481fdb){_0x127ff3=_0x481fdb;return _0x481fdb[_0xc87d('0x93')](_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')],_[_0xc87d('0x5b')](_0x167f0f['body'],[_0xc87d('0x90'),'id'])||{})['spread'](function(_0x12761f){for(var _0x112ae0=0x0;_0x112ae0<_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')][_0xc87d('0x4d')];_0x112ae0+=0x1){socket[_0xc87d('0x83')]('userVoiceQueue:save',{'UserId':Number(_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')][_0x112ae0]),'VoiceQueueId':Number(_0x167f0f['params']['id'])});}return _0x12761f;});}})[_0xc87d('0x28')](function(_0x508279){_0xb2345=_0x508279||[];if(_0x127ff3){return db[_0xc87d('0x71')]['findAll']({'where':{'id':_0x167f0f[_0xc87d('0x51')][_0xc87d('0x90')]},'attributes':['id',_0xc87d('0x36'),_0xc87d('0x94'),_0xc87d('0x73'),'interface'],'raw':!![]});}})[_0xc87d('0x28')](function(_0x1c3b99){if(!_[_0xc87d('0x91')](_0x1c3b99)){var _0x4ac3bb=[];for(var _0x2d33ef=0x0;_0x2d33ef<_0x1c3b99[_0xc87d('0x4d')];_0x2d33ef++){if(_0x1c3b99[_0x2d33ef][_0xc87d('0x94')]){_0x4ac3bb[_0xc87d('0x8a')](db[_0xc87d('0x7d')][_0xc87d('0x7b')]({'membername':_0x1c3b99[_0x2d33ef][_0xc87d('0x36')],'UserId':_0x1c3b99[_0x2d33ef]['id'],'queue_name':_0x127ff3[_0xc87d('0x36')],'VoiceQueueId':_0x127ff3['id'],'interface':_['isNil'](_0x1c3b99[_0x2d33ef]['interface'])?util[_0xc87d('0x7f')](_0xc87d('0x80'),_0x1c3b99[_0x2d33ef]['name']):_0x1c3b99[_0x2d33ef][_0xc87d('0x81')],'paused':_0x1c3b99[_0x2d33ef][_0xc87d('0x73')]||![],'penalty':_0x167f0f[_0xc87d('0x51')][_0xc87d('0x75')]||0x0}));}}return BPromise[_0xc87d('0x8e')](_0x4ac3bb);}})[_0xc87d('0x28')](function(){return _0xb2345;})[_0xc87d('0x28')](respondWithResult(_0x37aa65,null))[_0xc87d('0x4b')](handleError(_0x37aa65,null));};exports[_0xc87d('0x92')]=function(_0x85e26b,_0x1fb4da,_0x2ac783){return db['VoiceQueue'][_0xc87d('0x56')]({'where':{'id':_0x85e26b['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x1fb4da,null))[_0xc87d('0x28')](function(_0x5a4d59){if(_0x5a4d59){return _0x5a4d59[_0xc87d('0x92')](_0x85e26b[_0xc87d('0x3d')][_0xc87d('0x90')])[_0xc87d('0x28')](function(){if(_[_0xc87d('0x95')](_0x85e26b['query'][_0xc87d('0x90')])){for(var _0x37eb13=0x0;_0x37eb13<_0x85e26b[_0xc87d('0x3d')]['ids'][_0xc87d('0x4d')];_0x37eb13+=0x1){socket[_0xc87d('0x83')]('userVoiceQueue:remove',{'UserId':Number(_0x85e26b['query'][_0xc87d('0x90')][_0x37eb13]),'VoiceQueueId':Number(_0x85e26b[_0xc87d('0x4c')]['id'])});}}else{socket['emit'](_0xc87d('0x96'),{'UserId':Number(_0x85e26b[_0xc87d('0x3d')][_0xc87d('0x90')]),'VoiceQueueId':Number(_0x85e26b[_0xc87d('0x4c')]['id'])});}});}})[_0xc87d('0x28')](function(_0x37458b){return db[_0xc87d('0x7d')][_0xc87d('0x29')]({'where':{'VoiceQueueId':_0x85e26b[_0xc87d('0x4c')]['id'],'UserId':_0x85e26b['query'][_0xc87d('0x90')]}})[_0xc87d('0x28')](function(){return _0x37458b;});})[_0xc87d('0x28')](respondWithStatusCode(_0x1fb4da,null))['catch'](handleError(_0x1fb4da,null));};exports[_0xc87d('0x97')]=function(_0x860afb,_0x178dc6,_0x3f019d){var _0x43a66b={};var _0x190735={};var _0x18195d;var _0xf10c6a;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x860afb['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x178dc6,null))['then'](function(_0x3f5300){if(_0x3f5300){_0x18195d=_0x3f5300;_0x190735[_0xc87d('0x3c')]=_[_0xc87d('0x3e')](db['User'][_0xc87d('0x38')]);_0x190735[_0xc87d('0x3d')]=_['keys'](_0x860afb[_0xc87d('0x3d')]);_0x190735[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x190735['model'],_0x190735[_0xc87d('0x3d')]);_0x43a66b[_0xc87d('0x42')]=_[_0xc87d('0x40')](_0x190735[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x860afb[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x43a66b['attributes']=_0x43a66b[_0xc87d('0x42')]['length']?_0x43a66b['attributes']:_0x190735[_0xc87d('0x3c')];_0x43a66b[_0xc87d('0x6c')]=qs[_0xc87d('0x44')](_0x860afb[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x43a66b[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x860afb[_0xc87d('0x3d')],_0x190735[_0xc87d('0x3f')]));if(_0x860afb[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x43a66b[_0xc87d('0x45')]=_['merge'](_0x43a66b[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x43a66b[_0xc87d('0x42')],function(_0x594b50){var _0x204c2f={};_0x204c2f[_0x594b50]={'$like':'%'+_0x860afb[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x204c2f;})});}_0x43a66b=_[_0xc87d('0x46')]({},_0x43a66b,_0x860afb[_0xc87d('0x4f')]);return _0x18195d[_0xc87d('0x97')](_0x43a66b);}})[_0xc87d('0x28')](function(_0xbe92ec){if(_0xbe92ec){_0xf10c6a=_0xbe92ec[_0xc87d('0x4d')];if(!_0x860afb['query']['hasOwnProperty'](_0xc87d('0x63'))){_0x43a66b[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x860afb['query'][_0xc87d('0x23')]);_0x43a66b[_0xc87d('0x21')]=qs['offset'](_0x860afb[_0xc87d('0x3d')][_0xc87d('0x21')]);}return _0x18195d['getAgents'](_0x43a66b);}})['then'](function(_0x1168fc){if(_0x1168fc){return _0x1168fc?{'count':_0xf10c6a,'rows':_0x1168fc}:null;}})['then'](respondWithResult(_0x178dc6,null))[_0xc87d('0x4b')](handleError(_0x178dc6,null));};exports[_0xc87d('0x98')]=function(_0x2d4430,_0x2ad3c2,_0xa3a796){var _0x32b190={};var _0x1103c6={};var _0x20c747;var _0x29c65d;return db['VoiceQueue'][_0xc87d('0x61')]({'where':{'id':_0x2d4430[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x2ad3c2,null))['then'](function(_0x3b608e){if(_0x3b608e){_0x20c747=_0x3b608e;_0x1103c6[_0xc87d('0x3c')]=_['keys'](db[_0xc87d('0x7d')][_0xc87d('0x38')]);_0x1103c6[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x2d4430[_0xc87d('0x3d')]);_0x1103c6[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x1103c6[_0xc87d('0x3c')],_0x1103c6['query']);_0x32b190['attributes']=_[_0xc87d('0x40')](_0x1103c6[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x2d4430[_0xc87d('0x3d')]['fields']));_0x32b190[_0xc87d('0x42')]=_0x32b190[_0xc87d('0x42')]['length']?_0x32b190[_0xc87d('0x42')]:_0x1103c6['model'];_0x32b190[_0xc87d('0x6c')]=qs['sort'](_0x2d4430['query'][_0xc87d('0x44')]);_0x32b190['where']=qs[_0xc87d('0x3f')](_['pick'](_0x2d4430[_0xc87d('0x3d')],_0x1103c6[_0xc87d('0x3f')]));if(_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x2f')]){_0x32b190[_0xc87d('0x45')]=_['merge'](_0x32b190[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x32b190['attributes'],function(_0x438d2c){var _0x1a8cdc={};_0x1a8cdc[_0x438d2c]={'$like':'%'+_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x1a8cdc;})});}_0x32b190=_[_0xc87d('0x46')]({},_0x32b190,_0x2d4430[_0xc87d('0x4f')]);return _0x20c747[_0xc87d('0x98')](_0x32b190);}})['then'](function(_0x22761b){if(_0x22761b){_0x29c65d=_0x22761b[_0xc87d('0x4d')];if(!_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x43')](_0xc87d('0x63'))){_0x32b190['limit']=qs['limit'](_0x2d4430[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x32b190['offset']=qs[_0xc87d('0x21')](_0x2d4430['query'][_0xc87d('0x21')]);}return _0x20c747[_0xc87d('0x98')](_0x32b190);}})['then'](function(_0x378689){return _0x378689?{'count':_0x29c65d,'rows':_0x378689}:null;})[_0xc87d('0x28')](respondWithResult(_0x2ad3c2,null))[_0xc87d('0x4b')](handleError(_0x2ad3c2,null));};exports[_0xc87d('0x99')]=function(_0x19550d,_0x5b242a,_0x160b2d){var _0x352b5a={};var _0x2023f6={};var _0x4d8e8c;var _0x16d8b0;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x19550d['params']['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x5b242a,null))[_0xc87d('0x28')](function(_0x28b4ab){if(_0x28b4ab){_0x4d8e8c=_0x28b4ab;_0x2023f6['model']=_[_0xc87d('0x3e')](db['CmList']['rawAttributes']);_0x2023f6[_0xc87d('0x3d')]=_[_0xc87d('0x3e')](_0x19550d[_0xc87d('0x3d')]);_0x2023f6[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x2023f6['model'],_0x2023f6[_0xc87d('0x3d')]);_0x352b5a[_0xc87d('0x42')]=_['intersection'](_0x2023f6[_0xc87d('0x3c')],qs[_0xc87d('0x41')](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x352b5a[_0xc87d('0x42')]=_0x352b5a[_0xc87d('0x42')][_0xc87d('0x4d')]?_0x352b5a[_0xc87d('0x42')]:_0x2023f6['model'];_0x352b5a[_0xc87d('0x6c')]=qs['sort'](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x352b5a[_0xc87d('0x45')]=qs['filters'](_[_0xc87d('0x64')](_0x19550d[_0xc87d('0x3d')],_0x2023f6['filters']));if(_0x19550d['query'][_0xc87d('0x2f')]){_0x352b5a[_0xc87d('0x45')]=_[_0xc87d('0x46')](_0x352b5a[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x352b5a[_0xc87d('0x42')],function(_0x89fa1c){var _0x20a443={};_0x20a443[_0x89fa1c]={'$like':'%'+_0x19550d[_0xc87d('0x3d')][_0xc87d('0x2f')]+'%'};return _0x20a443;})});}_0x352b5a=_[_0xc87d('0x46')]({},_0x352b5a,_0x19550d[_0xc87d('0x4f')]);return _0x4d8e8c['getLists'](_0x352b5a);}})[_0xc87d('0x28')](function(_0xb33b58){if(_0xb33b58){_0x16d8b0=_0xb33b58[_0xc87d('0x4d')];if(!_0x19550d[_0xc87d('0x3d')]['hasOwnProperty']('nolimit')){_0x352b5a[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x352b5a[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x19550d[_0xc87d('0x3d')][_0xc87d('0x21')]);}return _0x4d8e8c[_0xc87d('0x99')](_0x352b5a);}})[_0xc87d('0x28')](function(_0x4d3819){if(_0x4d3819){return _0x4d3819?{'count':_0x16d8b0,'rows':_0x4d3819}:null;}})['then'](respondWithResult(_0x5b242a,null))[_0xc87d('0x4b')](handleError(_0x5b242a,null));};exports[_0xc87d('0x9a')]=function(_0x4f11a8,_0x4cdbfa,_0x297b7e){var _0x1ef3b7,_0xae61da;return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x4f11a8[_0xc87d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4cdbfa,null))[_0xc87d('0x28')](function(_0x1f83da){if(_0x1f83da){_0xae61da=_0x1f83da;return _0x1f83da[_0xc87d('0x9a')](_0x4f11a8['body'][_0xc87d('0x90')],_[_0xc87d('0x5b')](_0x4f11a8[_0xc87d('0x51')],[_0xc87d('0x90'),'id'])||{});}return null;})['spread'](function(_0x344329){var _0x5d11d0;_0x1ef3b7=_0x344329||[];var _0x426436=[];if(_0x344329){for(var _0x49c452=0x0;_0x49c452<_0x344329[_0xc87d('0x4d')];_0x49c452+=0x1){var _0x3dc775=_0x344329[_0x49c452][_0xc87d('0x2a')]({'plain':!![]});_0xae61da[_0xc87d('0x9b')]=_0x4f11a8[_0xc87d('0x51')]['dialCheckDuplicateType']?_0x4f11a8[_0xc87d('0x51')][_0xc87d('0x9b')]:_0xae61da[_0xc87d('0x9b')];switch(_0xae61da[_0xc87d('0x9b')]){case _0xc87d('0x9c'):_0x5d11d0=squel[_0xc87d('0x9d')]()[_0xc87d('0x9e')]('cm_hopper')[_0xc87d('0x9f')]([_0xc87d('0xa0'),_0xc87d('0xa1'),_0xc87d('0xa2'),_0xc87d('0xa3'),'VoiceQueueId','createdAt',_0xc87d('0x5a')],squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xa0'),'phone')['field']('NOW()','scheduledAt')['field']('id','ContactId')['field'](_0x3dc775[_0xc87d('0xa5')][_0xc87d('0x8b')](),_0xc87d('0xa3'))['field'](_0x4f11a8[_0xc87d('0x4c')]['id']['toString'](),_0xc87d('0x65'))['field'](_0xc87d('0xa6'),_0xc87d('0x5c'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0x5a'))['from']('cm_contacts')[_0xc87d('0x45')](_0xc87d('0xa7'))[_0xc87d('0x45')](_0xc87d('0xa8'),_0x3dc775['CmListId'][_0xc87d('0x8b')]())[_0xc87d('0x45')](_0xc87d('0xa9'))[_0xc87d('0x45')](_0xc87d('0xaa'),squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xab'))[_0xc87d('0xac')](_0xc87d('0xad'))[_0xc87d('0x45')](_0xc87d('0xae'),_0x4f11a8[_0xc87d('0x4c')]['id'][_0xc87d('0x8b')]()))[_0xc87d('0x45')](_0xc87d('0xaa'),squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xaf'))[_0xc87d('0xac')](_0xc87d('0xb0'))[_0xc87d('0x45')](_0xc87d('0xae'),_0x4f11a8[_0xc87d('0x4c')]['id'][_0xc87d('0x8b')]())))[_0xc87d('0x8b')]();break;case _0xc87d('0xb1'):_0x5d11d0=squel['insert']()['into'](_0xc87d('0xb0'))[_0xc87d('0x9f')](['phone',_0xc87d('0xa1'),'ContactId',_0xc87d('0xa3'),_0xc87d('0x65'),'createdAt',_0xc87d('0x5a')],squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xa0'),_0xc87d('0xa0'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0xa1'))[_0xc87d('0x86')]('id',_0xc87d('0xa2'))[_0xc87d('0x86')](_0x3dc775['CmListId'][_0xc87d('0x8b')](),_0xc87d('0xa3'))[_0xc87d('0x86')](_0x4f11a8[_0xc87d('0x4c')]['id']['toString'](),_0xc87d('0x65'))[_0xc87d('0x86')]('NOW()',_0xc87d('0x5c'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0x5a'))[_0xc87d('0xac')]('cm_contacts')[_0xc87d('0x45')](_0xc87d('0xa7'))[_0xc87d('0x45')](_0xc87d('0xa8'),_0x3dc775[_0xc87d('0xa5')]['toString']())[_0xc87d('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0xc87d('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc87d('0xa4')]()[_0xc87d('0x86')](_0xc87d('0xaf'))['from'](_0xc87d('0xb0'))[_0xc87d('0x45')](_0xc87d('0xae'),_0x4f11a8['params']['id'][_0xc87d('0x8b')]())))[_0xc87d('0x8b')]();break;default:_0x5d11d0=squel['insert']()[_0xc87d('0x9e')](_0xc87d('0xb0'))[_0xc87d('0x9f')](['phone',_0xc87d('0xa1'),_0xc87d('0xa2'),_0xc87d('0xa3'),_0xc87d('0x65'),_0xc87d('0x5c'),_0xc87d('0x5a')],squel['select']()[_0xc87d('0x86')](_0xc87d('0xa0'),_0xc87d('0xa0'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0xa1'))[_0xc87d('0x86')]('id',_0xc87d('0xa2'))['field'](_0x3dc775[_0xc87d('0xa5')][_0xc87d('0x8b')](),_0xc87d('0xa3'))[_0xc87d('0x86')](_0x4f11a8[_0xc87d('0x4c')]['id']['toString'](),_0xc87d('0x65'))[_0xc87d('0x86')](_0xc87d('0xa6'),_0xc87d('0x5c'))['field'](_0xc87d('0xa6'),'updatedAt')[_0xc87d('0xac')](_0xc87d('0xb2'))[_0xc87d('0x45')](_0xc87d('0xa7'))['where'](_0xc87d('0xa8'),_0x3dc775['CmListId'][_0xc87d('0x8b')]())[_0xc87d('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0xc87d('0x8b')]();}_0x426436[_0xc87d('0x8a')](db[_0xc87d('0x76')]['query'](_0x5d11d0));}return BPromise[_0xc87d('0x8e')](_0x426436);}})['then'](function(){return _0x1ef3b7;})['then'](respondWithResult(_0x4cdbfa,null))[_0xc87d('0x4b')](handleError(_0x4cdbfa,null));};exports['removeLists']=function(_0xa34b2c,_0x2f942f,_0x2e88e1){return db['VoiceQueue']['find']({'where':{'id':_0xa34b2c[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x2f942f,null))[_0xc87d('0x28')](function(_0x15d14a){if(_0x15d14a){return _0x15d14a['removeLists'](_0xa34b2c[_0xc87d('0x3d')]['ids']);}})[_0xc87d('0x28')](function(_0x41d697){if(_0x41d697){return db[_0xc87d('0x62')]['destroy']({'where':{'ListId':_0xa34b2c[_0xc87d('0x3d')]['ids'],'VoiceQueueId':_0xa34b2c[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](function(){return _0x41d697;});}})['then'](respondWithStatusCode(_0x2f942f,null))[_0xc87d('0x4b')](handleError(_0x2f942f,null));};exports[_0xc87d('0xb3')]=function(_0x248d05,_0xe3ce4d,_0x1949e1){var _0x4c0d73={};var _0x553f08={};var _0x4aeead;var _0x4717d9;return db[_0xc87d('0x4a')][_0xc87d('0x61')]({'where':{'id':_0x248d05[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0xe3ce4d,null))[_0xc87d('0x28')](function(_0x560b0a){if(_0x560b0a){_0x4aeead=_0x560b0a;_0x553f08['model']=_[_0xc87d('0x3e')](db['CmList'][_0xc87d('0x38')]);_0x553f08[_0xc87d('0x3d')]=_['keys'](_0x248d05[_0xc87d('0x3d')]);_0x553f08[_0xc87d('0x3f')]=_[_0xc87d('0x40')](_0x553f08['model'],_0x553f08['query']);_0x4c0d73[_0xc87d('0x42')]=_['intersection'](_0x553f08[_0xc87d('0x3c')],qs['fields'](_0x248d05[_0xc87d('0x3d')][_0xc87d('0x41')]));_0x4c0d73[_0xc87d('0x42')]=_0x4c0d73['attributes'][_0xc87d('0x4d')]?_0x4c0d73['attributes']:_0x553f08[_0xc87d('0x3c')];_0x4c0d73[_0xc87d('0x6c')]=qs[_0xc87d('0x44')](_0x248d05[_0xc87d('0x3d')][_0xc87d('0x44')]);_0x4c0d73[_0xc87d('0x45')]=qs[_0xc87d('0x3f')](_[_0xc87d('0x64')](_0x248d05[_0xc87d('0x3d')],_0x553f08[_0xc87d('0x3f')]));if(_0x248d05[_0xc87d('0x3d')]['filter']){_0x4c0d73[_0xc87d('0x45')]=_['merge'](_0x4c0d73[_0xc87d('0x45')],{'$or':_[_0xc87d('0x47')](_0x4c0d73[_0xc87d('0x42')],function(_0x192586){var _0x498dc6={};_0x498dc6[_0x192586]={'$like':'%'+_0x248d05['query'][_0xc87d('0x2f')]+'%'};return _0x498dc6;})});}_0x4c0d73=_[_0xc87d('0x46')]({},_0x4c0d73,_0x248d05[_0xc87d('0x4f')]);return _0x4aeead[_0xc87d('0xb3')](_0x4c0d73);}})[_0xc87d('0x28')](function(_0xb6a338){if(_0xb6a338){_0x4717d9=_0xb6a338['length'];if(!_0x248d05[_0xc87d('0x3d')]['hasOwnProperty'](_0xc87d('0x63'))){_0x4c0d73[_0xc87d('0x23')]=qs[_0xc87d('0x23')](_0x248d05[_0xc87d('0x3d')][_0xc87d('0x23')]);_0x4c0d73[_0xc87d('0x21')]=qs[_0xc87d('0x21')](_0x248d05['query'][_0xc87d('0x21')]);}return _0x4aeead[_0xc87d('0xb3')](_0x4c0d73);}})[_0xc87d('0x28')](function(_0x3f0acd){if(_0x3f0acd){return _0x3f0acd?{'count':_0x4717d9,'rows':_0x3f0acd}:null;}})[_0xc87d('0x28')](respondWithResult(_0xe3ce4d,null))[_0xc87d('0x4b')](handleError(_0xe3ce4d,null));};exports['addBlackLists']=function(_0x4cdf4e,_0x319c42,_0x4fed68){var _0x5d00c3,_0x31e8a4;return db[_0xc87d('0x4a')][_0xc87d('0x56')]({'where':{'id':_0x4cdf4e[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x319c42,null))[_0xc87d('0x28')](function(_0x5f3c5e){if(_0x5f3c5e){_0x31e8a4=_0x5f3c5e;return _0x5f3c5e[_0xc87d('0xb4')](_0x4cdf4e['body']['ids'],_[_0xc87d('0x5b')](_0x4cdf4e[_0xc87d('0x51')],['ids','id'])||{});}return null;})[_0xc87d('0xb5')](function(_0x535cac){var _0xb863b9;_0x5d00c3=_0x535cac||[];var _0x32ca3e=[];if(_0x535cac){for(var _0x121567=0x0;_0x121567<_0x535cac['length'];_0x121567+=0x1){var _0x18125f=_0x535cac[_0x121567]['get']({'plain':!![]});_0xb863b9=squel[_0xc87d('0x9d')]()[_0xc87d('0x9e')](_0xc87d('0xb6'))[_0xc87d('0x9f')](['phone','ContactId','ListId',_0xc87d('0x65'),_0xc87d('0x5c'),_0xc87d('0x5a')],squel[_0xc87d('0xa4')]()[_0xc87d('0x86')]('phone',_0xc87d('0xa0'))[_0xc87d('0x86')]('id',_0xc87d('0xa2'))[_0xc87d('0x86')](_0x18125f['CmListId']['toString'](),_0xc87d('0xa3'))['field'](_0x4cdf4e[_0xc87d('0x4c')]['id'][_0xc87d('0x8b')](),'VoiceQueueId')[_0xc87d('0x86')]('NOW()',_0xc87d('0x5c'))[_0xc87d('0x86')]('NOW()','updatedAt')[_0xc87d('0xac')](_0xc87d('0xb2'))['where'](_0xc87d('0xa7'))[_0xc87d('0x45')](_0xc87d('0xa8'),_0x18125f['CmListId'][_0xc87d('0x8b')]())[_0xc87d('0x45')](_0xc87d('0xa9')))[_0xc87d('0x8b')]();_0x32ca3e['push'](db[_0xc87d('0x76')][_0xc87d('0x3d')](_0xb863b9));}return BPromise[_0xc87d('0x8e')](_0x32ca3e);}})['then'](function(){return _0x5d00c3;})[_0xc87d('0x28')](respondWithResult(_0x319c42,null))[_0xc87d('0x4b')](handleError(_0x319c42,null));};exports[_0xc87d('0xb7')]=function(_0x2bac8e,_0x111749,_0x4d6652){return db[_0xc87d('0x4a')]['find']({'where':{'id':_0x2bac8e[_0xc87d('0x4c')]['id']}})[_0xc87d('0x28')](handleEntityNotFound(_0x111749,null))[_0xc87d('0x28')](function(_0x5bd53b){if(_0x5bd53b){return _0x5bd53b[_0xc87d('0xb7')](_0x2bac8e['query'][_0xc87d('0x90')]);}})[_0xc87d('0x28')](function(_0xcc20bd){if(_0xcc20bd){return db[_0xc87d('0x6e')][_0xc87d('0x29')]({'where':{'ListId':_0x2bac8e[_0xc87d('0x3d')][_0xc87d('0x90')],'VoiceQueueId':_0x2bac8e[_0xc87d('0x4c')]['id']}})['then'](function(){return _0xcc20bd;});}})['then'](respondWithStatusCode(_0x111749,null))[_0xc87d('0x4b')](handleError(_0x111749,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index ee9c5c6..43b9423 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 _0xc256=['hook','exports','../../mysqldb','VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc256,0x1c4));var _0x6c25=function(_0x582628,_0x45dc5d){_0x582628=_0x582628-0x0;var _0x4dfea5=_0xc256[_0x582628];return _0x4dfea5;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x6c25('0x0'))['db'][_0x6c25('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x6c25('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6c25('0x3'),'afterDestroy':_0x6c25('0x4')};function emitEvent(_0xeb1af0){return function(_0x105812,_0x260a50,_0x4d89be){VoiceQueueEvents['emit'](_0xeb1af0+':'+_0x105812['id'],_0x105812);VoiceQueueEvents[_0x6c25('0x5')](_0xeb1af0,_0x105812);_0x4d89be(null);};}for(var e in events){if(events[_0x6c25('0x6')](e)){var event=events[e];VoiceQueue[_0x6c25('0x7')](e,emitEvent(event));}}module[_0x6c25('0x8')]=VoiceQueueEvents; \ No newline at end of file +var _0x54ea=['update','remove','hook','exports','events','VoiceQueue','setMaxListeners','save'];(function(_0x1ae1fb,_0x81c2ec){var _0x57166=function(_0x48c137){while(--_0x48c137){_0x1ae1fb['push'](_0x1ae1fb['shift']());}};_0x57166(++_0x81c2ec);}(_0x54ea,0x1f4));var _0xa54e=function(_0x181759,_0x539f81){_0x181759=_0x181759-0x0;var _0x4a7806=_0x54ea[_0x181759];return _0x4a7806;};'use strict';var EventEmitter=require(_0xa54e('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xa54e('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa54e('0x2')](0x0);var events={'afterCreate':_0xa54e('0x3'),'afterUpdate':_0xa54e('0x4'),'afterDestroy':_0xa54e('0x5')};function emitEvent(_0x3b18db){return function(_0x286898,_0x30c830,_0x26af4a){VoiceQueueEvents['emit'](_0x3b18db+':'+_0x286898['id'],_0x286898);VoiceQueueEvents['emit'](_0x3b18db,_0x286898);_0x26af4a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xa54e('0x6')](e,emitEvent(event));}}module[_0xa54e('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 5794701..102f973 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 _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x1a7a06,_0x29d789){var _0x1f4dfc=function(_0x4aae00){while(--_0x4aae00){_0x1a7a06['push'](_0x1a7a06['shift']());}};_0x1f4dfc(++_0x29d789);}(_0xedd9,0xfc));var _0x9edd=function(_0x3de873,_0x174b5f){_0x3de873=_0x3de873-0x0;var _0x380b8c=_0xedd9[_0x3de873];return _0x380b8c;};'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':'voice_queues','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(_0x20dd9b,_0x3c0fb8){var _0x2de3b0=function(_0x5673d2){while(--_0x5673d2){_0x20dd9b['push'](_0x20dd9b['shift']());}};_0x2de3b0(++_0x3c0fb8);}(_0x008c,0x188));var _0xc008=function(_0x1c3a1a,_0xfa88ee){_0x1c3a1a=_0x1c3a1a-0x0;var _0x37eb4e=_0x008c[_0x1c3a1a];return _0x37eb4e;};'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 fc9bf9a..6f844b3 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 _0x2588=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','limit','include','map','model','attributes','then','ShowVoiceQueue','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x88ffd4,_0x25f7e6){var _0x528f9c=function(_0x166382){while(--_0x166382){_0x88ffd4['push'](_0x88ffd4['shift']());}};_0x528f9c(++_0x25f7e6);}(_0x2588,0x97));var _0x8258=function(_0x4f8f57,_0x1bd71c){_0x4f8f57=_0x4f8f57-0x0;var _0x25e6f9=_0x2588[_0x4f8f57];return _0x25e6f9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8258('0x0'));var BPromise=require(_0x8258('0x1'));var rs=require(_0x8258('0x2'));var fs=require('fs');var Redis=require(_0x8258('0x3'));var db=require(_0x8258('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8258('0x5'))(_0x8258('0x6'));var config=require(_0x8258('0x7'));var jayson=require(_0x8258('0x8'));var client=jayson['client'][_0x8258('0x9')]({'port':0x232a});config[_0x8258('0xa')]=_['defaults'](config[_0x8258('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8258('0xb'))(new Redis(config[_0x8258('0xa')]));require('./voiceQueue.socket')[_0x8258('0xc')](socket);function respondWithRpcPromise(_0x1eea5f,_0x57b7ff,_0x5092fe){return new BPromise(function(_0x396fec,_0x4598d3){return client[_0x8258('0xd')](_0x1eea5f,_0x5092fe)['then'](function(_0x14af49){logger[_0x8258('0xe')](_0x8258('0xf'),_0x57b7ff,_0x8258('0x10'));logger[_0x8258('0x11')](_0x8258('0x12'),_0x57b7ff,_0x8258('0x10'),JSON[_0x8258('0x13')](_0x14af49));if(_0x14af49['error']){if(_0x14af49[_0x8258('0x14')][_0x8258('0x15')]===0x1f4){logger['error'](_0x8258('0xf'),_0x57b7ff,_0x14af49[_0x8258('0x14')][_0x8258('0x16')]);return _0x4598d3(_0x14af49[_0x8258('0x14')][_0x8258('0x16')]);}logger[_0x8258('0x14')](_0x8258('0xf'),_0x57b7ff,_0x14af49[_0x8258('0x14')][_0x8258('0x16')]);return _0x396fec(_0x14af49['error'][_0x8258('0x16')]);}else{logger[_0x8258('0xe')](_0x8258('0xf'),_0x57b7ff,'request\x20sent');_0x396fec(_0x14af49[_0x8258('0x17')][_0x8258('0x16')]);}})[_0x8258('0x18')](function(_0x138676){logger[_0x8258('0x14')](_0x8258('0xf'),_0x57b7ff,_0x138676);_0x4598d3(_0x138676);});});}exports[_0x8258('0x19')]=function(_0x7e3601){var _0x50f5f8=this;return new Promise(function(_0x15ddf5,_0x2e4ef0){return db[_0x8258('0x1a')][_0x8258('0x1b')]({'raw':_0x7e3601[_0x8258('0x1c')]?_0x7e3601[_0x8258('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x7e3601[_0x8258('0x1c')]?_0x7e3601[_0x8258('0x1c')][_0x8258('0x1d')]||null:null,'attributes':_0x7e3601[_0x8258('0x1c')]?_0x7e3601[_0x8258('0x1c')]['attributes']||null:null,'limit':_0x7e3601[_0x8258('0x1c')]?_0x7e3601['options'][_0x8258('0x1e')]||null:null,'include':_0x7e3601[_0x8258('0x1c')]?_0x7e3601[_0x8258('0x1c')][_0x8258('0x1f')]?_[_0x8258('0x20')](_0x7e3601[_0x8258('0x1c')][_0x8258('0x1f')],function(_0x28ba91){return{'model':db[_0x28ba91[_0x8258('0x21')]],'as':_0x28ba91['as'],'attributes':_0x28ba91[_0x8258('0x22')],'include':_0x28ba91[_0x8258('0x1f')]?_[_0x8258('0x20')](_0x28ba91[_0x8258('0x1f')],function(_0x46ce47){return{'model':db[_0x46ce47['model']],'as':_0x46ce47['as'],'attributes':_0x46ce47[_0x8258('0x22')],'include':_0x46ce47['include']?_[_0x8258('0x20')](_0x46ce47[_0x8258('0x1f')],function(_0x1493db){return{'model':db[_0x1493db['model']],'as':_0x1493db['as'],'attributes':_0x1493db['attributes']};}):[]};}):[]};}):[]:[]})[_0x8258('0x23')](function(_0x438f13){logger[_0x8258('0xe')](_0x8258('0x19'),_0x7e3601);logger[_0x8258('0x11')](_0x8258('0x19'),_0x7e3601,JSON['stringify'](_0x438f13));_0x15ddf5(_0x438f13);})[_0x8258('0x18')](function(_0xf8ad68){logger[_0x8258('0x14')]('GetVoiceQueue',_0xf8ad68[_0x8258('0x16')],_0x7e3601);_0x2e4ef0(_0x50f5f8[_0x8258('0x14')](0x1f4,_0xf8ad68[_0x8258('0x16')]));});});};exports[_0x8258('0x24')]=function(_0x1dc39b){var _0x5e2548=this;return new Promise(function(_0x3c3264,_0x40ae16){return db['VoiceQueue'][_0x8258('0x25')]({'raw':_0x1dc39b[_0x8258('0x1c')]?_0x1dc39b[_0x8258('0x1c')][_0x8258('0x26')]===undefined?!![]:![]:!![],'where':_0x1dc39b[_0x8258('0x1c')]?_0x1dc39b[_0x8258('0x1c')][_0x8258('0x1d')]||null:null,'attributes':_0x1dc39b[_0x8258('0x1c')]?_0x1dc39b[_0x8258('0x1c')]['attributes']||null:null,'include':_0x1dc39b['options']?_0x1dc39b[_0x8258('0x1c')][_0x8258('0x1f')]?_[_0x8258('0x20')](_0x1dc39b[_0x8258('0x1c')][_0x8258('0x1f')],function(_0x20a3bb){return{'model':db[_0x20a3bb['model']],'as':_0x20a3bb['as'],'attributes':_0x20a3bb[_0x8258('0x22')],'include':_0x20a3bb[_0x8258('0x1f')]?_['map'](_0x20a3bb['include'],function(_0x4b01b9){return{'model':db[_0x4b01b9[_0x8258('0x21')]],'as':_0x4b01b9['as'],'attributes':_0x4b01b9[_0x8258('0x22')],'include':_0x4b01b9[_0x8258('0x1f')]?_[_0x8258('0x20')](_0x4b01b9[_0x8258('0x1f')],function(_0x2b8787){return{'model':db[_0x2b8787[_0x8258('0x21')]],'as':_0x2b8787['as'],'attributes':_0x2b8787[_0x8258('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8258('0x23')](function(_0x4fdf4a){logger[_0x8258('0xe')]('ShowVoiceQueue',_0x1dc39b);logger[_0x8258('0x11')](_0x8258('0x24'),_0x1dc39b,JSON['stringify'](_0x4fdf4a));_0x3c3264(_0x4fdf4a);})[_0x8258('0x18')](function(_0x1a75cb){logger[_0x8258('0x14')](_0x8258('0x24'),_0x1a75cb[_0x8258('0x16')],_0x1dc39b);_0x40ae16(_0x5e2548[_0x8258('0x14')](0x1f4,_0x1a75cb[_0x8258('0x16')]));});});}; \ No newline at end of file +var _0x59f3=['defaults','socket.io-emitter','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','GetVoiceQueue','VoiceQueue','options','where','attributes','limit','map','include','model','ShowVoiceQueue','find','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0x59f3,0x133));var _0x359f=function(_0x2f31b1,_0x17daa8){_0x2f31b1=_0x2f31b1-0x0;var _0x448988=_0x59f3[_0x2f31b1];return _0x448988;};'use strict';var _=require(_0x359f('0x0'));var util=require(_0x359f('0x1'));var moment=require('moment');var BPromise=require(_0x359f('0x2'));var rs=require(_0x359f('0x3'));var fs=require('fs');var Redis=require(_0x359f('0x4'));var db=require(_0x359f('0x5'))['db'];var utils=require(_0x359f('0x6'));var logger=require(_0x359f('0x7'))('rpc');var config=require(_0x359f('0x8'));var jayson=require(_0x359f('0x9'));var client=jayson[_0x359f('0xa')][_0x359f('0xb')]({'port':0x232a});config[_0x359f('0xc')]=_[_0x359f('0xd')](config[_0x359f('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x359f('0xe'))(new Redis(config[_0x359f('0xc')]));require(_0x359f('0xf'))[_0x359f('0x10')](socket);function respondWithRpcPromise(_0x5715c0,_0x1cf5ed,_0x43f667){return new BPromise(function(_0xbfa764,_0x2b4f30){return client['request'](_0x5715c0,_0x43f667)[_0x359f('0x11')](function(_0x3672e5){logger[_0x359f('0x12')](_0x359f('0x13'),_0x1cf5ed,'request\x20sent');logger[_0x359f('0x14')](_0x359f('0x15'),_0x1cf5ed,'request\x20sent',JSON[_0x359f('0x16')](_0x3672e5));if(_0x3672e5[_0x359f('0x17')]){if(_0x3672e5['error'][_0x359f('0x18')]===0x1f4){logger[_0x359f('0x17')](_0x359f('0x13'),_0x1cf5ed,_0x3672e5[_0x359f('0x17')]['message']);return _0x2b4f30(_0x3672e5['error'][_0x359f('0x19')]);}logger[_0x359f('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x1cf5ed,_0x3672e5['error']['message']);return _0xbfa764(_0x3672e5[_0x359f('0x17')][_0x359f('0x19')]);}else{logger[_0x359f('0x12')](_0x359f('0x13'),_0x1cf5ed,_0x359f('0x1a'));_0xbfa764(_0x3672e5['result'][_0x359f('0x19')]);}})[_0x359f('0x1b')](function(_0x48552a){logger[_0x359f('0x17')](_0x359f('0x13'),_0x1cf5ed,_0x48552a);_0x2b4f30(_0x48552a);});});}exports[_0x359f('0x1c')]=function(_0x29ea63){var _0x986338=this;return new Promise(function(_0x2df8bc,_0x25981){return db[_0x359f('0x1d')]['findAll']({'raw':_0x29ea63[_0x359f('0x1e')]?_0x29ea63['options']['raw']===undefined?!![]:![]:!![],'where':_0x29ea63[_0x359f('0x1e')]?_0x29ea63['options'][_0x359f('0x1f')]||null:null,'attributes':_0x29ea63['options']?_0x29ea63[_0x359f('0x1e')][_0x359f('0x20')]||null:null,'limit':_0x29ea63[_0x359f('0x1e')]?_0x29ea63['options'][_0x359f('0x21')]||null:null,'include':_0x29ea63[_0x359f('0x1e')]?_0x29ea63[_0x359f('0x1e')]['include']?_[_0x359f('0x22')](_0x29ea63[_0x359f('0x1e')][_0x359f('0x23')],function(_0x3d3ee1){return{'model':db[_0x3d3ee1[_0x359f('0x24')]],'as':_0x3d3ee1['as'],'attributes':_0x3d3ee1[_0x359f('0x20')],'include':_0x3d3ee1[_0x359f('0x23')]?_[_0x359f('0x22')](_0x3d3ee1[_0x359f('0x23')],function(_0x2b2b0e){return{'model':db[_0x2b2b0e[_0x359f('0x24')]],'as':_0x2b2b0e['as'],'attributes':_0x2b2b0e[_0x359f('0x20')],'include':_0x2b2b0e[_0x359f('0x23')]?_[_0x359f('0x22')](_0x2b2b0e[_0x359f('0x23')],function(_0x4d122c){return{'model':db[_0x4d122c[_0x359f('0x24')]],'as':_0x4d122c['as'],'attributes':_0x4d122c[_0x359f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x359f('0x11')](function(_0x595184){logger[_0x359f('0x12')](_0x359f('0x1c'),_0x29ea63);logger[_0x359f('0x14')](_0x359f('0x1c'),_0x29ea63,JSON[_0x359f('0x16')](_0x595184));_0x2df8bc(_0x595184);})[_0x359f('0x1b')](function(_0x1d9f9a){logger[_0x359f('0x17')](_0x359f('0x1c'),_0x1d9f9a['message'],_0x29ea63);_0x25981(_0x986338['error'](0x1f4,_0x1d9f9a[_0x359f('0x19')]));});});};exports[_0x359f('0x25')]=function(_0x39f468){var _0x2535a8=this;return new Promise(function(_0x2e966e,_0x53b83e){return db[_0x359f('0x1d')][_0x359f('0x26')]({'raw':_0x39f468[_0x359f('0x1e')]?_0x39f468[_0x359f('0x1e')][_0x359f('0x27')]===undefined?!![]:![]:!![],'where':_0x39f468[_0x359f('0x1e')]?_0x39f468[_0x359f('0x1e')]['where']||null:null,'attributes':_0x39f468['options']?_0x39f468['options'][_0x359f('0x20')]||null:null,'include':_0x39f468[_0x359f('0x1e')]?_0x39f468[_0x359f('0x1e')][_0x359f('0x23')]?_[_0x359f('0x22')](_0x39f468[_0x359f('0x1e')][_0x359f('0x23')],function(_0x579fd9){return{'model':db[_0x579fd9[_0x359f('0x24')]],'as':_0x579fd9['as'],'attributes':_0x579fd9[_0x359f('0x20')],'include':_0x579fd9[_0x359f('0x23')]?_[_0x359f('0x22')](_0x579fd9[_0x359f('0x23')],function(_0x1f3eaa){return{'model':db[_0x1f3eaa['model']],'as':_0x1f3eaa['as'],'attributes':_0x1f3eaa['attributes'],'include':_0x1f3eaa[_0x359f('0x23')]?_['map'](_0x1f3eaa[_0x359f('0x23')],function(_0x3514dc){return{'model':db[_0x3514dc['model']],'as':_0x3514dc['as'],'attributes':_0x3514dc[_0x359f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x359f('0x11')](function(_0x558de3){logger[_0x359f('0x12')](_0x359f('0x25'),_0x39f468);logger[_0x359f('0x14')]('ShowVoiceQueue',_0x39f468,JSON[_0x359f('0x16')](_0x558de3));_0x2e966e(_0x558de3);})['catch'](function(_0x4f4266){logger[_0x359f('0x17')]('ShowVoiceQueue',_0x4f4266[_0x359f('0x19')],_0x39f468);_0x53b83e(_0x2535a8['error'](0x1f4,_0x4f4266[_0x359f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index e4c6b6f..c3ea6a5 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 _0x965e=['length','voiceQueue:','./voiceQueue.events','save','remove','update','removeListener','register'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x965e,0x1da));var _0xe965=function(_0x206453,_0x46c9ec){_0x206453=_0x206453-0x0;var _0xcde5a9=_0x965e[_0x206453];return _0xcde5a9;};'use strict';var VoiceQueueEvents=require(_0xe965('0x0'));var events=[_0xe965('0x1'),_0xe965('0x2'),_0xe965('0x3')];function createListener(_0x16cbf,_0x28727b){return function(_0x5230cf){_0x28727b['emit'](_0x16cbf,_0x5230cf);};}function removeListener(_0x3c5d06,_0x172b1f){return function(){VoiceQueueEvents[_0xe965('0x4')](_0x3c5d06,_0x172b1f);};}exports[_0xe965('0x5')]=function(_0x22f134){for(var _0xeef81b=0x0,_0x325037=events[_0xe965('0x6')];_0xeef81b<_0x325037;_0xeef81b++){var _0x1d4e6d=events[_0xeef81b];var _0x5b52a6=createListener(_0xe965('0x7')+_0x1d4e6d,_0x22f134);VoiceQueueEvents['on'](_0x1d4e6d,_0x5b52a6);}}; \ No newline at end of file +var _0xe46f=['remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x2c74af,_0x4ccc63){var _0x39eba1=function(_0x50b499){while(--_0x50b499){_0x2c74af['push'](_0x2c74af['shift']());}};_0x39eba1(++_0x4ccc63);}(_0xe46f,0xb2));var _0xfe46=function(_0x35db17,_0x8d64da){_0x35db17=_0x35db17-0x0;var _0x73f088=_0xe46f[_0x35db17];return _0x73f088;};'use strict';var VoiceQueueEvents=require(_0xfe46('0x0'));var events=[_0xfe46('0x1'),_0xfe46('0x2'),_0xfe46('0x3')];function createListener(_0x398f8d,_0x1aa764){return function(_0x40fa60){_0x1aa764[_0xfe46('0x4')](_0x398f8d,_0x40fa60);};}function removeListener(_0x64c171,_0x3c4568){return function(){VoiceQueueEvents[_0xfe46('0x5')](_0x64c171,_0x3c4568);};}exports[_0xfe46('0x6')]=function(_0x4fbe39){for(var _0xe789e4=0x0,_0x57a72b=events[_0xfe46('0x7')];_0xe789e4<_0x57a72b;_0xe789e4++){var _0x951023=events[_0xe789e4];var _0x484209=createListener(_0xfe46('0x8')+_0x951023,_0x4fbe39);VoiceQueueEvents['on'](_0x951023,_0x484209);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index e981464..0e7499d 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 _0xa96f=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','/:id','create','put','update'];(function(_0x5e7b6c,_0x4916d0){var _0x3afdbd=function(_0x648ee6){while(--_0x648ee6){_0x5e7b6c['push'](_0x5e7b6c['shift']());}};_0x3afdbd(++_0x4916d0);}(_0xa96f,0x9c));var _0xfa96=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0xa96f[_0xce93c];return _0x230720;};'use strict';var multer=require(_0xfa96('0x0'));var util=require(_0xfa96('0x1'));var path=require('path');var timeout=require(_0xfa96('0x2'));var express=require(_0xfa96('0x3'));var router=express[_0xfa96('0x4')]();var fs_extra=require(_0xfa96('0x5'));var auth=require(_0xfa96('0x6'));var interaction=require(_0xfa96('0x7'));var config=require(_0xfa96('0x8'));var controller=require(_0xfa96('0x9'));router[_0xfa96('0xa')]('/',auth[_0xfa96('0xb')](),controller[_0xfa96('0xc')]);router['get'](_0xfa96('0xd'),auth[_0xfa96('0xb')](),controller['describe']);router['get'](_0xfa96('0xe'),auth[_0xfa96('0xb')](),controller[_0xfa96('0xf')]);router[_0xfa96('0xa')](_0xfa96('0x10'),auth[_0xfa96('0xb')](),controller['show']);router['post']('/',auth[_0xfa96('0xb')](),controller[_0xfa96('0x11')]);router[_0xfa96('0x12')](_0xfa96('0x10'),auth[_0xfa96('0xb')](),controller[_0xfa96('0x13')]);router[_0xfa96('0x14')]('/:id',auth[_0xfa96('0xb')](),controller['destroy']);module[_0xfa96('0x15')]=router; \ No newline at end of file +var _0x0cc3=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','/:id','show','create','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x0cc3,0xc9));var _0x30cc=function(_0x565ccd,_0x26bd28){_0x565ccd=_0x565ccd-0x0;var _0x1ee82b=_0x0cc3[_0x565ccd];return _0x1ee82b;};'use strict';var multer=require(_0x30cc('0x0'));var util=require(_0x30cc('0x1'));var path=require(_0x30cc('0x2'));var timeout=require(_0x30cc('0x3'));var express=require('express');var router=express[_0x30cc('0x4')]();var fs_extra=require(_0x30cc('0x5'));var auth=require(_0x30cc('0x6'));var interaction=require(_0x30cc('0x7'));var config=require(_0x30cc('0x8'));var controller=require(_0x30cc('0x9'));router[_0x30cc('0xa')]('/',auth[_0x30cc('0xb')](),controller[_0x30cc('0xc')]);router[_0x30cc('0xa')](_0x30cc('0xd'),auth[_0x30cc('0xb')](),controller[_0x30cc('0xe')]);router[_0x30cc('0xa')](_0x30cc('0xf'),auth[_0x30cc('0xb')](),controller['getVoiceQueuesReport']);router[_0x30cc('0xa')](_0x30cc('0x10'),auth[_0x30cc('0xb')](),controller[_0x30cc('0x11')]);router['post']('/',auth[_0x30cc('0xb')](),controller[_0x30cc('0x12')]);router['put'](_0x30cc('0x10'),auth[_0x30cc('0xb')](),controller[_0x30cc('0x13')]);router[_0x30cc('0x14')]('/:id',auth[_0x30cc('0xb')](),controller['destroy']);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 f69807a..0528cb1 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 _0xa7f7=['moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize'];(function(_0x357a12,_0x144ae){var _0x2b38d0=function(_0xcb6e15){while(--_0xcb6e15){_0x357a12['push'](_0x357a12['shift']());}};_0x2b38d0(++_0x144ae);}(_0xa7f7,0x1a3));var _0x7a7f=function(_0x2c1114,_0x2a5c50){_0x2c1114=_0x2c1114-0x0;var _0x2b877c=_0xa7f7[_0x2c1114];return _0x2b877c;};'use strict';var Sequelize=require(_0x7a7f('0x0'));var moment=require(_0x7a7f('0x1'));module[_0x7a7f('0x2')]={'type':{'type':Sequelize[_0x7a7f('0x3')]},'uniqueid':{'type':Sequelize[_0x7a7f('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7a7f('0x3')]},'queue':{'type':Sequelize[_0x7a7f('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x7a7f('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x7a7f('0x4')],'set':function(_0x352207){var _0x35fed0=moment(_0x352207);var _0x2cfb46=moment(this[_0x7a7f('0x5')](_0x7a7f('0x6')))['format'](_0x7a7f('0x7'));var _0x2b77e1=_0x35fed0['diff'](_0x2cfb46,'seconds');this[_0x7a7f('0x8')]('queuecallerleaveAt',_0x352207);this[_0x7a7f('0x8')](_0x7a7f('0x9'),_0x2b77e1||null);}},'position':{'type':Sequelize[_0x7a7f('0xa')]},'count':{'type':Sequelize[_0x7a7f('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x7a7f('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7a7f('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x7a7f('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7a7f('0x4')]},'queuecallerexit':{'type':Sequelize[_0x7a7f('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x7a7f('0x3')],'comment':_0x7a7f('0xc')},'originalposition':{'type':Sequelize[_0x7a7f('0xa')]},'channel':{'type':Sequelize[_0x7a7f('0x3')]},'connectedlinenum':{'type':Sequelize[_0x7a7f('0x3')]},'connectedlinename':{'type':Sequelize[_0x7a7f('0x3')]},'accountcode':{'type':Sequelize[_0x7a7f('0x3')]},'context':{'type':Sequelize[_0x7a7f('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x7a7f('0xa')]},'mohtime':{'type':Sequelize[_0x7a7f('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x7a7f('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x7a7f('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7a7f('0x3')],'comment':_0x7a7f('0xd')},'transferexten':{'type':Sequelize[_0x7a7f('0x3')]},'transferuniqueid':{'type':Sequelize[_0x7a7f('0x3')]},'disposition':{'type':Sequelize[_0x7a7f('0x3')]},'secondDisposition':{'type':Sequelize[_0x7a7f('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x7a7f('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4f15=['BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime','INTEGER'];(function(_0x317089,_0x34da97){var _0x614b82=function(_0x1ac371){while(--_0x1ac371){_0x317089['push'](_0x317089['shift']());}};_0x614b82(++_0x34da97);}(_0x4f15,0x121));var _0x54f1=function(_0x4e88a9,_0x4c5bbb){_0x4e88a9=_0x4e88a9-0x0;var _0x17994c=_0x4f15[_0x4e88a9];return _0x17994c;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x54f1('0x0')]={'type':{'type':Sequelize[_0x54f1('0x1')]},'uniqueid':{'type':Sequelize[_0x54f1('0x1')]},'calleridnum':{'type':Sequelize[_0x54f1('0x1')]},'calleridname':{'type':Sequelize[_0x54f1('0x1')]},'queue':{'type':Sequelize[_0x54f1('0x1')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x544419){var _0x3f8a25=moment(_0x544419);var _0x3f7f4b=moment(this[_0x54f1('0x2')](_0x54f1('0x3')))[_0x54f1('0x4')](_0x54f1('0x5'));var _0x3f5e8e=_0x3f8a25[_0x54f1('0x6')](_0x3f7f4b,_0x54f1('0x7'));this['setDataValue']('queuecallerleaveAt',_0x544419);this[_0x54f1('0x8')](_0x54f1('0x9'),_0x3f5e8e||null);}},'position':{'type':Sequelize[_0x54f1('0xa')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x54f1('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x54f1('0xc')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x54f1('0xc')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x54f1('0xd')},'originalposition':{'type':Sequelize[_0x54f1('0xa')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x54f1('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x54f1('0x1')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x54f1('0xa')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x54f1('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x54f1('0x1')],'comment':_0x54f1('0xe')},'transferexten':{'type':Sequelize[_0x54f1('0x1')]},'transferuniqueid':{'type':Sequelize[_0x54f1('0x1')]},'disposition':{'type':Sequelize[_0x54f1('0x1')]},'secondDisposition':{'type':Sequelize[_0x54f1('0x1')]},'thirdDisposition':{'type':Sequelize[_0x54f1('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x54f1('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index dce937d..6108aa5 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 _0x8702=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','offset','undefined','limit','count','status','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','find','body','describe','getVoiceQueuesReport','pick','rows','eml-format','rimraf','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv'];(function(_0x34b346,_0x3cbea8){var _0x4f89f9=function(_0x11eb38){while(--_0x11eb38){_0x34b346['push'](_0x34b346['shift']());}};_0x4f89f9(++_0x3cbea8);}(_0x8702,0x188));var _0x2870=function(_0xfca880,_0x54f863){_0xfca880=_0xfca880-0x0;var _0x552983=_0x8702[_0xfca880];return _0x552983;};'use strict';var emlformat=require(_0x2870('0x0'));var rimraf=require(_0x2870('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2870('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2870('0x3'));var util=require(_0x2870('0x4'));var path=require(_0x2870('0x5'));var sox=require(_0x2870('0x6'));var csv=require('to-csv');var ejs=require(_0x2870('0x7'));var fs=require('fs');var fs_extra=require(_0x2870('0x8'));var _=require(_0x2870('0x9'));var squel=require('squel');var crypto=require(_0x2870('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2870('0xb'));var toCsv=require(_0x2870('0xc'));var querystring=require(_0x2870('0xd'));var Papa=require(_0x2870('0xe'));var Redis=require(_0x2870('0xf'));var authService=require(_0x2870('0x10'));var qs=require(_0x2870('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2870('0x12'));var logger=require(_0x2870('0x13'))(_0x2870('0x14'));var utils=require(_0x2870('0x15'));var config=require(_0x2870('0x16'));var licenseUtil=require(_0x2870('0x17'));var db=require(_0x2870('0x18'))['db'];config[_0x2870('0x19')]=_['defaults'](config[_0x2870('0x19')],{'host':_0x2870('0x1a'),'port':0x18eb});var socket=require(_0x2870('0x1b'))(new Redis(config[_0x2870('0x19')]));require(_0x2870('0x1c'))[_0x2870('0x1d')](socket);function respondWithStatusCode(_0x3ec697,_0x46ccd7){_0x46ccd7=_0x46ccd7||0xcc;return function(_0x3e6b81){if(_0x3e6b81){return _0x3ec697[_0x2870('0x1e')](_0x46ccd7);}return _0x3ec697['status'](_0x46ccd7)[_0x2870('0x1f')]();};}function respondWithResult(_0x5d5f5b,_0x565c51){_0x565c51=_0x565c51||0xc8;return function(_0x22a251){if(_0x22a251){return _0x5d5f5b['status'](_0x565c51)['json'](_0x22a251);}};}function respondWithFilteredResult(_0x3484b9,_0x4c0583){return function(_0x1c1ae3){if(_0x1c1ae3){var _0x482b8d=typeof _0x4c0583[_0x2870('0x20')]===_0x2870('0x21')&&typeof _0x4c0583[_0x2870('0x22')]==='undefined';var _0x5e58b1=_0x1c1ae3['count'];var _0x247213=_0x482b8d?0x0:_0x4c0583[_0x2870('0x20')];var _0xc5c601=_0x482b8d?_0x1c1ae3[_0x2870('0x23')]:_0x4c0583['offset']+_0x4c0583[_0x2870('0x22')];var _0x261112;if(_0xc5c601>=_0x5e58b1){_0xc5c601=_0x5e58b1;_0x261112=0xc8;}else{_0x261112=0xce;}_0x3484b9[_0x2870('0x24')](_0x261112);return _0x3484b9['set'](_0x2870('0x25'),_0x247213+'-'+_0xc5c601+'/'+_0x5e58b1)['json'](_0x1c1ae3);}return null;};}function patchUpdates(_0x5d7945){return function(_0x199327){try{jsonpatch['apply'](_0x199327,_0x5d7945,!![]);}catch(_0x2bc09e){return BPromise[_0x2870('0x26')](_0x2bc09e);}return _0x199327[_0x2870('0x27')]();};}function saveUpdates(_0x2d7cf3,_0x3c9e83){return function(_0x409cbd){if(_0x409cbd){return _0x409cbd[_0x2870('0x28')](_0x2d7cf3)[_0x2870('0x29')](function(_0x31b3de){return _0x31b3de;});}return null;};}function removeEntity(_0x46902d,_0x250a8c){return function(_0x41297d){if(_0x41297d){return _0x41297d[_0x2870('0x2a')]()['then'](function(){_0x46902d[_0x2870('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x430978,_0x5c99ff){return function(_0x1ac71f){if(!_0x1ac71f){_0x430978[_0x2870('0x1e')](0x194);}return _0x1ac71f;};}function handleError(_0x5795c0,_0x52aa73){_0x52aa73=_0x52aa73||0x1f4;return function(_0x323393){logger[_0x2870('0x2b')](_0x323393[_0x2870('0x2c')]);if(_0x323393[_0x2870('0x2d')]){delete _0x323393['name'];}_0x5795c0[_0x2870('0x24')](_0x52aa73)['send'](_0x323393);};}exports[_0x2870('0x2e')]=function(_0x2be2bf,_0x205727){var _0x179a4c={},_0x2101d1={},_0x5bd3dc={'count':0x0,'rows':[]};var _0x54a2c6=_[_0x2870('0x2f')](db[_0x2870('0x30')][_0x2870('0x31')],function(_0xb50979){return{'name':_0xb50979[_0x2870('0x32')],'type':_0xb50979['type'][_0x2870('0x33')]};});_0x2101d1[_0x2870('0x34')]=_[_0x2870('0x2f')](_0x54a2c6,_0x2870('0x2d'));_0x2101d1['query']=_['keys'](_0x2be2bf[_0x2870('0x35')]);_0x2101d1[_0x2870('0x36')]=_[_0x2870('0x37')](_0x2101d1[_0x2870('0x34')],_0x2101d1['query']);_0x179a4c['attributes']=_[_0x2870('0x37')](_0x2101d1[_0x2870('0x34')],qs[_0x2870('0x38')](_0x2be2bf[_0x2870('0x35')]['fields']));_0x179a4c[_0x2870('0x39')]=_0x179a4c[_0x2870('0x39')][_0x2870('0x3a')]?_0x179a4c[_0x2870('0x39')]:_0x2101d1[_0x2870('0x34')];if(!_0x2be2bf[_0x2870('0x35')][_0x2870('0x3b')](_0x2870('0x3c'))){_0x179a4c[_0x2870('0x22')]=qs[_0x2870('0x22')](_0x2be2bf[_0x2870('0x35')][_0x2870('0x22')]);_0x179a4c[_0x2870('0x20')]=qs[_0x2870('0x20')](_0x2be2bf[_0x2870('0x35')][_0x2870('0x20')]);}_0x179a4c['order']=qs[_0x2870('0x3d')](_0x2be2bf[_0x2870('0x35')][_0x2870('0x3d')]);_0x179a4c[_0x2870('0x3e')]=qs['filters'](_['pick'](_0x2be2bf[_0x2870('0x35')],_0x2101d1['filters']),_0x54a2c6);if(_0x2be2bf[_0x2870('0x35')][_0x2870('0x3f')]){_0x179a4c[_0x2870('0x3e')]=_[_0x2870('0x40')](_0x179a4c[_0x2870('0x3e')],{'$or':_[_0x2870('0x2f')](_0x54a2c6,function(_0x43da70){if(_0x43da70[_0x2870('0x41')]!==_0x2870('0x42')){var _0x54b027={};_0x54b027[_0x43da70[_0x2870('0x2d')]]={'$like':'%'+_0x2be2bf[_0x2870('0x35')]['filter']+'%'};return _0x54b027;}})});}_0x179a4c=_[_0x2870('0x40')]({},_0x179a4c,_0x2be2bf['options']);var _0x3e604e={'where':_0x179a4c[_0x2870('0x3e')]};return db[_0x2870('0x30')][_0x2870('0x23')](_0x3e604e)[_0x2870('0x29')](function(_0x41a1cb){_0x5bd3dc['count']=_0x41a1cb;if(_0x2be2bf[_0x2870('0x35')][_0x2870('0x43')]){_0x179a4c[_0x2870('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x2870('0x45')](_0x179a4c);})[_0x2870('0x29')](function(_0x1146a6){_0x5bd3dc['rows']=_0x1146a6;return _0x5bd3dc;})[_0x2870('0x29')](respondWithFilteredResult(_0x205727,_0x179a4c))[_0x2870('0x46')](handleError(_0x205727,null));};exports[_0x2870('0x47')]=function(_0x490aad,_0x180cae){var _0x4230b3={'raw':![],'where':{'id':_0x490aad[_0x2870('0x48')]['id']}},_0x61bb3d={};_0x61bb3d[_0x2870('0x34')]=_[_0x2870('0x49')](db[_0x2870('0x30')][_0x2870('0x31')]);_0x61bb3d[_0x2870('0x35')]=_[_0x2870('0x49')](_0x490aad['query']);_0x61bb3d[_0x2870('0x36')]=_[_0x2870('0x37')](_0x61bb3d['model'],_0x61bb3d['query']);_0x4230b3[_0x2870('0x39')]=_[_0x2870('0x37')](_0x61bb3d[_0x2870('0x34')],qs[_0x2870('0x38')](_0x490aad['query']['fields']));_0x4230b3[_0x2870('0x39')]=_0x4230b3[_0x2870('0x39')][_0x2870('0x3a')]?_0x4230b3[_0x2870('0x39')]:_0x61bb3d[_0x2870('0x34')];if(_0x490aad[_0x2870('0x35')][_0x2870('0x43')]){_0x4230b3[_0x2870('0x44')]=[{'all':!![]}];}_0x4230b3=_['merge']({},_0x4230b3,_0x490aad[_0x2870('0x4a')]);return db[_0x2870('0x30')][_0x2870('0x4b')](_0x4230b3)['then'](handleEntityNotFound(_0x180cae,null))['then'](respondWithResult(_0x180cae,null))['catch'](handleError(_0x180cae,null));};exports['create']=function(_0x2e023b,_0x59ffa5){return db['VoiceQueueReport']['create'](_0x2e023b['body'],{})[_0x2870('0x29')](respondWithResult(_0x59ffa5,0xc9))[_0x2870('0x46')](handleError(_0x59ffa5,null));};exports[_0x2870('0x28')]=function(_0x2bd69a,_0x2aa97a){if(_0x2bd69a['body']['id']){delete _0x2bd69a[_0x2870('0x4c')]['id'];}return db[_0x2870('0x30')][_0x2870('0x4b')]({'where':{'id':_0x2bd69a[_0x2870('0x48')]['id']}})[_0x2870('0x29')](handleEntityNotFound(_0x2aa97a,null))[_0x2870('0x29')](saveUpdates(_0x2bd69a[_0x2870('0x4c')],null))[_0x2870('0x29')](respondWithResult(_0x2aa97a,null))[_0x2870('0x46')](handleError(_0x2aa97a,null));};exports[_0x2870('0x2a')]=function(_0x4c5dcf,_0x387915){return db[_0x2870('0x30')][_0x2870('0x4b')]({'where':{'id':_0x4c5dcf[_0x2870('0x48')]['id']}})['then'](handleEntityNotFound(_0x387915,null))[_0x2870('0x29')](removeEntity(_0x387915,null))[_0x2870('0x46')](handleError(_0x387915,null));};exports[_0x2870('0x4d')]=function(_0x289d9d,_0x37a9be){return db[_0x2870('0x30')][_0x2870('0x4d')]()[_0x2870('0x29')](respondWithResult(_0x37a9be,null))[_0x2870('0x46')](handleError(_0x37a9be,null));};exports[_0x2870('0x4e')]=function(_0x14e2b8,_0x1404f6){var _0x274d6e={},_0x1e6781={},_0x7afd89={'count':0x0,'rows':[]};_0x1e6781[_0x2870('0x34')]=_['keys'](db[_0x2870('0x30')][_0x2870('0x31')]);_0x1e6781[_0x2870('0x35')]=_[_0x2870('0x49')](_0x14e2b8[_0x2870('0x35')]);_0x1e6781[_0x2870('0x36')]=_['intersection'](_0x1e6781['model'],_0x1e6781['query']);_0x274d6e[_0x2870('0x39')]=_[_0x2870('0x37')](_0x1e6781[_0x2870('0x34')],qs[_0x2870('0x38')](_0x14e2b8[_0x2870('0x35')][_0x2870('0x38')]));_0x274d6e[_0x2870('0x39')]=_0x274d6e['attributes']['length']?_0x274d6e['attributes']:_0x1e6781[_0x2870('0x34')];if(!_0x14e2b8['query'][_0x2870('0x3b')]('nolimit')){_0x274d6e[_0x2870('0x22')]=qs['limit'](_0x14e2b8['query'][_0x2870('0x22')]);_0x274d6e[_0x2870('0x20')]=qs[_0x2870('0x20')](_0x14e2b8[_0x2870('0x35')][_0x2870('0x20')]);}_0x274d6e['order']=qs[_0x2870('0x3d')](_0x14e2b8[_0x2870('0x35')][_0x2870('0x3d')]);_0x274d6e['where']=qs[_0x2870('0x36')](_[_0x2870('0x4f')](_0x14e2b8[_0x2870('0x35')],_0x1e6781[_0x2870('0x36')]));if(_0x14e2b8[_0x2870('0x35')][_0x2870('0x3f')]){_0x274d6e[_0x2870('0x3e')]=_[_0x2870('0x40')](_0x274d6e['where'],{'$or':_[_0x2870('0x2f')](_0x274d6e[_0x2870('0x39')],function(_0x2cedcd){var _0x8ba715={};_0x8ba715[_0x2cedcd]={'$like':'%'+_0x14e2b8[_0x2870('0x35')]['filter']+'%'};return _0x8ba715;})});}_0x274d6e=_[_0x2870('0x40')]({},_0x274d6e,_0x14e2b8['options']);var _0x268c3f={'where':_0x274d6e[_0x2870('0x3e')]};return db[_0x2870('0x30')]['count'](_0x268c3f)[_0x2870('0x29')](function(_0x4682ad){_0x7afd89[_0x2870('0x23')]=_0x4682ad;if(_0x14e2b8['query'][_0x2870('0x43')]){_0x274d6e[_0x2870('0x44')]=[{'all':!![]}];}return db[_0x2870('0x30')][_0x2870('0x45')](_0x274d6e);})[_0x2870('0x29')](function(_0x4a87ca){_0x7afd89[_0x2870('0x50')]=_0x4a87ca;return _0x7afd89;})['then'](respondWithFilteredResult(_0x1404f6,_0x274d6e,'getVoiceQueuesReport'))[_0x2870('0x46')](handleError(_0x1404f6,null,_0x2870('0x4e')));}; \ No newline at end of file +var _0xb73b=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','then','end','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','catch','create','body','find','params','describe','hasOwnProperty','nolimit','findAll','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis'];(function(_0x1b91c7,_0x539acd){var _0xbbe014=function(_0x57ff15){while(--_0x57ff15){_0x1b91c7['push'](_0x1b91c7['shift']());}};_0xbbe014(++_0x539acd);}(_0xb73b,0x1d0));var _0xbb73=function(_0x5e66a3,_0x473531){_0x5e66a3=_0x5e66a3-0x0;var _0x13d7e6=_0xb73b[_0x5e66a3];return _0x13d7e6;};'use strict';var emlformat=require(_0xbb73('0x0'));var rimraf=require(_0xbb73('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb73('0x2'));var rp=require(_0xbb73('0x3'));var moment=require(_0xbb73('0x4'));var BPromise=require(_0xbb73('0x5'));var Mustache=require(_0xbb73('0x6'));var util=require('util');var path=require(_0xbb73('0x7'));var sox=require('sox');var csv=require(_0xbb73('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb73('0x9'));var squel=require(_0xbb73('0xa'));var crypto=require(_0xbb73('0xb'));var jsforce=require(_0xbb73('0xc'));var deskjs=require(_0xbb73('0xd'));var toCsv=require(_0xbb73('0x8'));var querystring=require(_0xbb73('0xe'));var Papa=require('papaparse');var Redis=require(_0xbb73('0xf'));var authService=require(_0xbb73('0x10'));var qs=require(_0xbb73('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb73('0x12'));var logger=require(_0xbb73('0x13'))(_0xbb73('0x14'));var utils=require(_0xbb73('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xbb73('0x16')]=_[_0xbb73('0x17')](config[_0xbb73('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb73('0x18'))(new Redis(config[_0xbb73('0x16')]));require(_0xbb73('0x19'))[_0xbb73('0x1a')](socket);function respondWithStatusCode(_0x1ad771,_0x9cc989){_0x9cc989=_0x9cc989||0xcc;return function(_0x1d9f0f){if(_0x1d9f0f){return _0x1ad771[_0xbb73('0x1b')](_0x9cc989);}return _0x1ad771[_0xbb73('0x1c')](_0x9cc989)['end']();};}function respondWithResult(_0x18ff38,_0x244e96){_0x244e96=_0x244e96||0xc8;return function(_0x5e8c95){if(_0x5e8c95){return _0x18ff38['status'](_0x244e96)['json'](_0x5e8c95);}};}function respondWithFilteredResult(_0x52d8ec,_0x17fea6){return function(_0xa862e7){if(_0xa862e7){var _0x3b5745=typeof _0x17fea6[_0xbb73('0x1d')]===_0xbb73('0x1e')&&typeof _0x17fea6[_0xbb73('0x1f')]===_0xbb73('0x1e');var _0x41b308=_0xa862e7[_0xbb73('0x20')];var _0x441802=_0x3b5745?0x0:_0x17fea6[_0xbb73('0x1d')];var _0x183e5d=_0x3b5745?_0xa862e7['count']:_0x17fea6['offset']+_0x17fea6[_0xbb73('0x1f')];var _0x181684;if(_0x183e5d>=_0x41b308){_0x183e5d=_0x41b308;_0x181684=0xc8;}else{_0x181684=0xce;}_0x52d8ec[_0xbb73('0x1c')](_0x181684);return _0x52d8ec[_0xbb73('0x21')](_0xbb73('0x22'),_0x441802+'-'+_0x183e5d+'/'+_0x41b308)[_0xbb73('0x23')](_0xa862e7);}return null;};}function patchUpdates(_0x34ecfe){return function(_0x138e1d){try{jsonpatch['apply'](_0x138e1d,_0x34ecfe,!![]);}catch(_0x18249d){return BPromise['reject'](_0x18249d);}return _0x138e1d[_0xbb73('0x24')]();};}function saveUpdates(_0x3750d5,_0x2b2755){return function(_0xd13d98){if(_0xd13d98){return _0xd13d98[_0xbb73('0x25')](_0x3750d5)['then'](function(_0x5bcccf){return _0x5bcccf;});}return null;};}function removeEntity(_0x18678b,_0x7c79f1){return function(_0x31d96e){if(_0x31d96e){return _0x31d96e[_0xbb73('0x26')]()[_0xbb73('0x27')](function(){_0x18678b[_0xbb73('0x1c')](0xcc)[_0xbb73('0x28')]();});}};}function handleEntityNotFound(_0x5c3b26,_0x3fa7a4){return function(_0x4f8256){if(!_0x4f8256){_0x5c3b26[_0xbb73('0x1b')](0x194);}return _0x4f8256;};}function handleError(_0x1b944d,_0x5f1597){_0x5f1597=_0x5f1597||0x1f4;return function(_0x199b99){logger[_0xbb73('0x29')](_0x199b99[_0xbb73('0x2a')]);if(_0x199b99[_0xbb73('0x2b')]){delete _0x199b99[_0xbb73('0x2b')];}_0x1b944d[_0xbb73('0x1c')](_0x5f1597)[_0xbb73('0x2c')](_0x199b99);};}exports[_0xbb73('0x2d')]=function(_0x42a92e,_0x2fbddf){var _0x4b0856={},_0x1edac3={},_0x23ffc5={'count':0x0,'rows':[]};var _0x5672ff=_['map'](db[_0xbb73('0x2e')][_0xbb73('0x2f')],function(_0xc3db66){return{'name':_0xc3db66[_0xbb73('0x30')],'type':_0xc3db66[_0xbb73('0x31')][_0xbb73('0x32')]};});_0x1edac3[_0xbb73('0x33')]=_[_0xbb73('0x34')](_0x5672ff,_0xbb73('0x2b'));_0x1edac3['query']=_['keys'](_0x42a92e[_0xbb73('0x35')]);_0x1edac3[_0xbb73('0x36')]=_[_0xbb73('0x37')](_0x1edac3[_0xbb73('0x33')],_0x1edac3[_0xbb73('0x35')]);_0x4b0856[_0xbb73('0x38')]=_[_0xbb73('0x37')](_0x1edac3[_0xbb73('0x33')],qs['fields'](_0x42a92e[_0xbb73('0x35')][_0xbb73('0x39')]));_0x4b0856[_0xbb73('0x38')]=_0x4b0856[_0xbb73('0x38')][_0xbb73('0x3a')]?_0x4b0856['attributes']:_0x1edac3[_0xbb73('0x33')];if(!_0x42a92e[_0xbb73('0x35')]['hasOwnProperty']('nolimit')){_0x4b0856[_0xbb73('0x1f')]=qs[_0xbb73('0x1f')](_0x42a92e[_0xbb73('0x35')][_0xbb73('0x1f')]);_0x4b0856[_0xbb73('0x1d')]=qs[_0xbb73('0x1d')](_0x42a92e[_0xbb73('0x35')][_0xbb73('0x1d')]);}_0x4b0856['order']=qs[_0xbb73('0x3b')](_0x42a92e['query'][_0xbb73('0x3b')]);_0x4b0856[_0xbb73('0x3c')]=qs['filters'](_[_0xbb73('0x3d')](_0x42a92e[_0xbb73('0x35')],_0x1edac3[_0xbb73('0x36')]),_0x5672ff);if(_0x42a92e[_0xbb73('0x35')][_0xbb73('0x3e')]){_0x4b0856[_0xbb73('0x3c')]=_[_0xbb73('0x3f')](_0x4b0856[_0xbb73('0x3c')],{'$or':_[_0xbb73('0x34')](_0x5672ff,function(_0x56b886){if(_0x56b886[_0xbb73('0x31')]!==_0xbb73('0x40')){var _0x23a077={};_0x23a077[_0x56b886[_0xbb73('0x2b')]]={'$like':'%'+_0x42a92e[_0xbb73('0x35')]['filter']+'%'};return _0x23a077;}})});}_0x4b0856=_[_0xbb73('0x3f')]({},_0x4b0856,_0x42a92e[_0xbb73('0x41')]);var _0x5a8a8a={'where':_0x4b0856['where']};return db['VoiceQueueReport']['count'](_0x5a8a8a)[_0xbb73('0x27')](function(_0x4d87cc){_0x23ffc5[_0xbb73('0x20')]=_0x4d87cc;if(_0x42a92e['query'][_0xbb73('0x42')]){_0x4b0856[_0xbb73('0x43')]=[{'all':!![]}];}return db[_0xbb73('0x2e')]['findAll'](_0x4b0856);})['then'](function(_0x12eaca){_0x23ffc5[_0xbb73('0x44')]=_0x12eaca;return _0x23ffc5;})[_0xbb73('0x27')](respondWithFilteredResult(_0x2fbddf,_0x4b0856))['catch'](handleError(_0x2fbddf,null));};exports['show']=function(_0x524c3a,_0x5a3748){var _0x205797={'raw':![],'where':{'id':_0x524c3a['params']['id']}},_0x3cc98a={};_0x3cc98a['model']=_[_0xbb73('0x45')](db[_0xbb73('0x2e')][_0xbb73('0x2f')]);_0x3cc98a[_0xbb73('0x35')]=_[_0xbb73('0x45')](_0x524c3a[_0xbb73('0x35')]);_0x3cc98a[_0xbb73('0x36')]=_[_0xbb73('0x37')](_0x3cc98a[_0xbb73('0x33')],_0x3cc98a[_0xbb73('0x35')]);_0x205797[_0xbb73('0x38')]=_[_0xbb73('0x37')](_0x3cc98a[_0xbb73('0x33')],qs[_0xbb73('0x39')](_0x524c3a[_0xbb73('0x35')][_0xbb73('0x39')]));_0x205797['attributes']=_0x205797[_0xbb73('0x38')][_0xbb73('0x3a')]?_0x205797[_0xbb73('0x38')]:_0x3cc98a['model'];if(_0x524c3a['query'][_0xbb73('0x42')]){_0x205797['include']=[{'all':!![]}];}_0x205797=_[_0xbb73('0x3f')]({},_0x205797,_0x524c3a['options']);return db[_0xbb73('0x2e')]['find'](_0x205797)[_0xbb73('0x27')](handleEntityNotFound(_0x5a3748,null))['then'](respondWithResult(_0x5a3748,null))[_0xbb73('0x46')](handleError(_0x5a3748,null));};exports[_0xbb73('0x47')]=function(_0x252c8b,_0x27cd33){return db[_0xbb73('0x2e')]['create'](_0x252c8b[_0xbb73('0x48')],{})[_0xbb73('0x27')](respondWithResult(_0x27cd33,0xc9))[_0xbb73('0x46')](handleError(_0x27cd33,null));};exports[_0xbb73('0x25')]=function(_0x3ddfe5,_0x3c199f){if(_0x3ddfe5[_0xbb73('0x48')]['id']){delete _0x3ddfe5[_0xbb73('0x48')]['id'];}return db[_0xbb73('0x2e')][_0xbb73('0x49')]({'where':{'id':_0x3ddfe5['params']['id']}})[_0xbb73('0x27')](handleEntityNotFound(_0x3c199f,null))[_0xbb73('0x27')](saveUpdates(_0x3ddfe5['body'],null))[_0xbb73('0x27')](respondWithResult(_0x3c199f,null))['catch'](handleError(_0x3c199f,null));};exports[_0xbb73('0x26')]=function(_0x11067b,_0x37800e){return db[_0xbb73('0x2e')]['find']({'where':{'id':_0x11067b[_0xbb73('0x4a')]['id']}})['then'](handleEntityNotFound(_0x37800e,null))[_0xbb73('0x27')](removeEntity(_0x37800e,null))[_0xbb73('0x46')](handleError(_0x37800e,null));};exports[_0xbb73('0x4b')]=function(_0x53874d,_0x434270){return db[_0xbb73('0x2e')]['describe']()['then'](respondWithResult(_0x434270,null))['catch'](handleError(_0x434270,null));};exports['getVoiceQueuesReport']=function(_0x72648e,_0x598f19){var _0x2f6000={},_0x5ab6f1={},_0x3cfbe0={'count':0x0,'rows':[]};_0x5ab6f1[_0xbb73('0x33')]=_[_0xbb73('0x45')](db[_0xbb73('0x2e')]['rawAttributes']);_0x5ab6f1[_0xbb73('0x35')]=_['keys'](_0x72648e[_0xbb73('0x35')]);_0x5ab6f1[_0xbb73('0x36')]=_[_0xbb73('0x37')](_0x5ab6f1[_0xbb73('0x33')],_0x5ab6f1[_0xbb73('0x35')]);_0x2f6000[_0xbb73('0x38')]=_[_0xbb73('0x37')](_0x5ab6f1[_0xbb73('0x33')],qs[_0xbb73('0x39')](_0x72648e['query'][_0xbb73('0x39')]));_0x2f6000[_0xbb73('0x38')]=_0x2f6000[_0xbb73('0x38')]['length']?_0x2f6000[_0xbb73('0x38')]:_0x5ab6f1['model'];if(!_0x72648e['query'][_0xbb73('0x4c')](_0xbb73('0x4d'))){_0x2f6000[_0xbb73('0x1f')]=qs[_0xbb73('0x1f')](_0x72648e[_0xbb73('0x35')][_0xbb73('0x1f')]);_0x2f6000['offset']=qs['offset'](_0x72648e[_0xbb73('0x35')]['offset']);}_0x2f6000['order']=qs[_0xbb73('0x3b')](_0x72648e[_0xbb73('0x35')][_0xbb73('0x3b')]);_0x2f6000[_0xbb73('0x3c')]=qs['filters'](_[_0xbb73('0x3d')](_0x72648e['query'],_0x5ab6f1[_0xbb73('0x36')]));if(_0x72648e[_0xbb73('0x35')][_0xbb73('0x3e')]){_0x2f6000[_0xbb73('0x3c')]=_[_0xbb73('0x3f')](_0x2f6000[_0xbb73('0x3c')],{'$or':_[_0xbb73('0x34')](_0x2f6000[_0xbb73('0x38')],function(_0x1b24a0){var _0x16dedf={};_0x16dedf[_0x1b24a0]={'$like':'%'+_0x72648e[_0xbb73('0x35')][_0xbb73('0x3e')]+'%'};return _0x16dedf;})});}_0x2f6000=_['merge']({},_0x2f6000,_0x72648e[_0xbb73('0x41')]);var _0x23cda9={'where':_0x2f6000[_0xbb73('0x3c')]};return db[_0xbb73('0x2e')][_0xbb73('0x20')](_0x23cda9)[_0xbb73('0x27')](function(_0x70c299){_0x3cfbe0[_0xbb73('0x20')]=_0x70c299;if(_0x72648e[_0xbb73('0x35')][_0xbb73('0x42')]){_0x2f6000['include']=[{'all':!![]}];}return db[_0xbb73('0x2e')][_0xbb73('0x4e')](_0x2f6000);})[_0xbb73('0x27')](function(_0x206190){_0x3cfbe0[_0xbb73('0x44')]=_0x206190;return _0x3cfbe0;})[_0xbb73('0x27')](respondWithFilteredResult(_0x598f19,_0x2f6000,_0xbb73('0x4f')))['catch'](handleError(_0x598f19,null,_0xbb73('0x4f')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index aa7a70f..0505ff9 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 _0x5824=['emit','hasOwnProperty','events','../../mysqldb','VoiceQueueReport','save','remove'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5824,0xf7));var _0x4582=function(_0x105071,_0x168f0f){_0x105071=_0x105071-0x0;var _0x32be6d=_0x5824[_0x105071];return _0x32be6d;};'use strict';var EventEmitter=require(_0x4582('0x0'));var VoiceQueueReport=require(_0x4582('0x1'))['db'][_0x4582('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4582('0x3'),'afterUpdate':'update','afterDestroy':_0x4582('0x4')};function emitEvent(_0x12ca5e){return function(_0x58fde4,_0x53b9d0,_0x4e22fb){VoiceQueueReportEvents[_0x4582('0x5')](_0x12ca5e+':'+_0x58fde4['id'],_0x58fde4);VoiceQueueReportEvents[_0x4582('0x5')](_0x12ca5e,_0x58fde4);_0x4e22fb(null);};}for(var e in events){if(events[_0x4582('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x4b81=['remove','emit','hasOwnProperty','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x270b99,_0x3e327a){var _0xa3cef6=function(_0x1ac4dc){while(--_0x1ac4dc){_0x270b99['push'](_0x270b99['shift']());}};_0xa3cef6(++_0x3e327a);}(_0x4b81,0x161));var _0x14b8=function(_0x162c8f,_0x27b261){_0x162c8f=_0x162c8f-0x0;var _0x3f6112=_0x4b81[_0x162c8f];return _0x3f6112;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0x14b8('0x0'))['db'][_0x14b8('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x14b8('0x2')](0x0);var events={'afterCreate':_0x14b8('0x3'),'afterUpdate':'update','afterDestroy':_0x14b8('0x4')};function emitEvent(_0x46a719){return function(_0x9aaaf4,_0x255cd8,_0x1f7775){VoiceQueueReportEvents['emit'](_0x46a719+':'+_0x9aaaf4['id'],_0x9aaaf4);VoiceQueueReportEvents[_0x14b8('0x5')](_0x46a719,_0x9aaaf4);_0x1f7775(null);};}for(var e in events){if(events[_0x14b8('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 98116f7..1eb3e0c 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 _0x97fd=['../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x45c670,_0x40f7dd){var _0x506ccf=function(_0x40cc40){while(--_0x40cc40){_0x45c670['push'](_0x45c670['shift']());}};_0x506ccf(++_0x40f7dd);}(_0x97fd,0x87));var _0xd97f=function(_0x373c06,_0x44c660){_0x373c06=_0x373c06-0x0;var _0x1f0ce5=_0x97fd[_0x373c06];return _0x1f0ce5;};'use strict';var _=require(_0xd97f('0x0'));var util=require(_0xd97f('0x1'));var logger=require(_0xd97f('0x2'))(_0xd97f('0x3'));var moment=require(_0xd97f('0x4'));var BPromise=require(_0xd97f('0x5'));var rp=require(_0xd97f('0x6'));var fs=require('fs');var path=require(_0xd97f('0x7'));var rimraf=require(_0xd97f('0x8'));var config=require(_0xd97f('0x9'));var attributes=require(_0xd97f('0xa'));module[_0xd97f('0xb')]=function(_0x4041e6,_0x249c71){return _0x4041e6[_0xd97f('0xc')](_0xd97f('0xd'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xd97f('0xe')]},{'fields':[_0xd97f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x11df=['../../config/environment','exports','define','VoiceQueueReport','report_queue','calleridnum','util','api','moment','request-promise','path','rimraf'];(function(_0x2b17ef,_0x8a3257){var _0x449f17=function(_0x5ddeca){while(--_0x5ddeca){_0x2b17ef['push'](_0x2b17ef['shift']());}};_0x449f17(++_0x8a3257);}(_0x11df,0x126));var _0xf11d=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x11df[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require(_0xf11d('0x0'));var logger=require('../../config/logger')(_0xf11d('0x1'));var moment=require(_0xf11d('0x2'));var BPromise=require('bluebird');var rp=require(_0xf11d('0x3'));var fs=require('fs');var path=require(_0xf11d('0x4'));var rimraf=require(_0xf11d('0x5'));var config=require(_0xf11d('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0xf11d('0x7')]=function(_0x1559b1,_0x9b2ca8){return _0x1559b1[_0xf11d('0x8')](_0xf11d('0x9'),attributes,{'tableName':_0xf11d('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xf11d('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 78fb35a..604df66 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 _0xc449=['VoiceQueueReport','body','raw','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','findAll','options','where','include','map','model','attributes','GetVoiceQueueReport','stringify','catch','CreateVoiceQueueReport'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xc449,0x1d3));var _0x9c44=function(_0x25d8e9,_0x16e270){_0x25d8e9=_0x25d8e9-0x0;var _0x5b9b96=_0xc449[_0x25d8e9];return _0x5b9b96;};'use strict';var _=require(_0x9c44('0x0'));var util=require(_0x9c44('0x1'));var moment=require(_0x9c44('0x2'));var BPromise=require(_0x9c44('0x3'));var rs=require(_0x9c44('0x4'));var fs=require('fs');var Redis=require(_0x9c44('0x5'));var db=require(_0x9c44('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c44('0x7'))(_0x9c44('0x8'));var config=require(_0x9c44('0x9'));var jayson=require(_0x9c44('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x9c44('0xb')]=_[_0x9c44('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9c44('0xd'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x9c44('0xe')](socket);function respondWithRpcPromise(_0x812e9b,_0x27d773,_0x20ba52){return new BPromise(function(_0x1e6b3e,_0x4dcb2a){return client[_0x9c44('0xf')](_0x812e9b,_0x20ba52)[_0x9c44('0x10')](function(_0x3d81f5){logger[_0x9c44('0x11')](_0x9c44('0x12'),_0x27d773,_0x9c44('0x13'));logger[_0x9c44('0x14')](_0x9c44('0x15'),_0x27d773,_0x9c44('0x13'),JSON['stringify'](_0x3d81f5));if(_0x3d81f5['error']){if(_0x3d81f5[_0x9c44('0x16')][_0x9c44('0x17')]===0x1f4){logger[_0x9c44('0x16')](_0x9c44('0x12'),_0x27d773,_0x3d81f5[_0x9c44('0x16')][_0x9c44('0x18')]);return _0x4dcb2a(_0x3d81f5[_0x9c44('0x16')][_0x9c44('0x18')]);}logger[_0x9c44('0x16')](_0x9c44('0x12'),_0x27d773,_0x3d81f5[_0x9c44('0x16')]['message']);return _0x1e6b3e(_0x3d81f5[_0x9c44('0x16')][_0x9c44('0x18')]);}else{logger[_0x9c44('0x11')](_0x9c44('0x12'),_0x27d773,_0x9c44('0x13'));_0x1e6b3e(_0x3d81f5[_0x9c44('0x19')][_0x9c44('0x18')]);}})['catch'](function(_0x434f4f){logger[_0x9c44('0x16')](_0x9c44('0x12'),_0x27d773,_0x434f4f);_0x4dcb2a(_0x434f4f);});});}exports['GetVoiceQueueReport']=function(_0x3a9e2a){var _0x6ae6dc=this;return new Promise(function(_0x2129bb,_0x151aee){return db['VoiceQueueReport'][_0x9c44('0x1a')]({'raw':_0x3a9e2a[_0x9c44('0x1b')]?_0x3a9e2a[_0x9c44('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3a9e2a[_0x9c44('0x1b')]?_0x3a9e2a['options'][_0x9c44('0x1c')]||null:null,'attributes':_0x3a9e2a[_0x9c44('0x1b')]?_0x3a9e2a[_0x9c44('0x1b')]['attributes']||null:null,'limit':_0x3a9e2a[_0x9c44('0x1b')]?_0x3a9e2a[_0x9c44('0x1b')]['limit']||null:null,'include':_0x3a9e2a[_0x9c44('0x1b')]?_0x3a9e2a[_0x9c44('0x1b')][_0x9c44('0x1d')]?_[_0x9c44('0x1e')](_0x3a9e2a[_0x9c44('0x1b')][_0x9c44('0x1d')],function(_0x4af798){return{'model':db[_0x4af798[_0x9c44('0x1f')]],'as':_0x4af798['as'],'attributes':_0x4af798[_0x9c44('0x20')],'include':_0x4af798[_0x9c44('0x1d')]?_[_0x9c44('0x1e')](_0x4af798[_0x9c44('0x1d')],function(_0x25bc81){return{'model':db[_0x25bc81[_0x9c44('0x1f')]],'as':_0x25bc81['as'],'attributes':_0x25bc81[_0x9c44('0x20')],'include':_0x25bc81[_0x9c44('0x1d')]?_[_0x9c44('0x1e')](_0x25bc81[_0x9c44('0x1d')],function(_0xb58cf3){return{'model':db[_0xb58cf3[_0x9c44('0x1f')]],'as':_0xb58cf3['as'],'attributes':_0xb58cf3[_0x9c44('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9c44('0x10')](function(_0x2a631e){logger[_0x9c44('0x11')](_0x9c44('0x21'),_0x3a9e2a);logger['debug'](_0x9c44('0x21'),_0x3a9e2a,JSON[_0x9c44('0x22')](_0x2a631e));_0x2129bb(_0x2a631e);})[_0x9c44('0x23')](function(_0xf5aeb4){logger[_0x9c44('0x16')]('GetVoiceQueueReport',_0xf5aeb4[_0x9c44('0x18')],_0x3a9e2a);_0x151aee(_0x6ae6dc[_0x9c44('0x16')](0x1f4,_0xf5aeb4[_0x9c44('0x18')]));});});};exports[_0x9c44('0x24')]=function(_0x14c872){var _0x56aa25=this;return new Promise(function(_0x2f26d9,_0x23ab87){return db[_0x9c44('0x25')]['create'](_0x14c872[_0x9c44('0x26')],{'raw':_0x14c872[_0x9c44('0x1b')]?_0x14c872[_0x9c44('0x1b')][_0x9c44('0x27')]===undefined?!![]:![]:!![]})[_0x9c44('0x10')](function(_0x3dc680){logger[_0x9c44('0x11')](_0x9c44('0x24'),_0x14c872);logger['debug'](_0x9c44('0x24'),_0x14c872,JSON[_0x9c44('0x22')](_0x3dc680));_0x2f26d9(_0x3dc680);})['catch'](function(_0x2aaa7e){logger[_0x9c44('0x16')](_0x9c44('0x24'),_0x2aaa7e[_0x9c44('0x18')],_0x14c872);_0x23ab87(_0x56aa25[_0x9c44('0x16')](0x1f4,_0x2aaa7e['message']));});});};exports[_0x9c44('0x28')]=function(_0x3fa229){var _0x28661a=this;return new Promise(function(_0x3501fe,_0x33f586){return db[_0x9c44('0x25')][_0x9c44('0x29')](_0x3fa229[_0x9c44('0x26')],{'raw':_0x3fa229[_0x9c44('0x1b')]?_0x3fa229[_0x9c44('0x1b')][_0x9c44('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fa229[_0x9c44('0x1b')]?_0x3fa229[_0x9c44('0x1b')][_0x9c44('0x1c')]||null:null,'attributes':_0x3fa229[_0x9c44('0x1b')]?_0x3fa229[_0x9c44('0x1b')][_0x9c44('0x20')]||null:null,'limit':_0x3fa229[_0x9c44('0x1b')]?_0x3fa229['options']['limit']||null:null})[_0x9c44('0x10')](function(_0x40b60c){logger[_0x9c44('0x11')](_0x9c44('0x28'),_0x3fa229);logger[_0x9c44('0x14')](_0x9c44('0x28'),_0x3fa229,JSON[_0x9c44('0x22')](_0x40b60c));_0x3501fe(_0x40b60c);})[_0x9c44('0x23')](function(_0x4d6e59){logger['error'](_0x9c44('0x28'),_0x4d6e59[_0x9c44('0x18')],_0x3fa229);_0x33f586(_0x28661a['error'](0x1f4,_0x4d6e59[_0x9c44('0x18')]));});});}; \ No newline at end of file +var _0x2f43=['code','message','result','VoiceQueueReport','findAll','options','raw','where','attributes','include','model','map','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24eed2,_0x395d24){var _0x313507=function(_0x13278a){while(--_0x13278a){_0x24eed2['push'](_0x24eed2['shift']());}};_0x313507(++_0x395d24);}(_0x2f43,0xc7));var _0x32f4=function(_0x343816,_0x1eb1b8){_0x343816=_0x343816-0x0;var _0x47af8f=_0x2f43[_0x343816];return _0x47af8f;};'use strict';var _=require(_0x32f4('0x0'));var util=require(_0x32f4('0x1'));var moment=require('moment');var BPromise=require(_0x32f4('0x2'));var rs=require(_0x32f4('0x3'));var fs=require('fs');var Redis=require(_0x32f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x32f4('0x5'));var logger=require(_0x32f4('0x6'))(_0x32f4('0x7'));var config=require(_0x32f4('0x8'));var jayson=require(_0x32f4('0x9'));var client=jayson[_0x32f4('0xa')]['http']({'port':0x232a});config[_0x32f4('0xb')]=_[_0x32f4('0xc')](config[_0x32f4('0xb')],{'host':_0x32f4('0xd'),'port':0x18eb});var socket=require(_0x32f4('0xe'))(new Redis(config[_0x32f4('0xb')]));require(_0x32f4('0xf'))[_0x32f4('0x10')](socket);function respondWithRpcPromise(_0x177b0b,_0x1786e6,_0xd1672f){return new BPromise(function(_0x22c57f,_0x259aa7){return client[_0x32f4('0x11')](_0x177b0b,_0xd1672f)[_0x32f4('0x12')](function(_0x511075){logger[_0x32f4('0x13')](_0x32f4('0x14'),_0x1786e6,_0x32f4('0x15'));logger[_0x32f4('0x16')](_0x32f4('0x17'),_0x1786e6,_0x32f4('0x15'),JSON[_0x32f4('0x18')](_0x511075));if(_0x511075['error']){if(_0x511075[_0x32f4('0x19')][_0x32f4('0x1a')]===0x1f4){logger[_0x32f4('0x19')](_0x32f4('0x14'),_0x1786e6,_0x511075[_0x32f4('0x19')][_0x32f4('0x1b')]);return _0x259aa7(_0x511075[_0x32f4('0x19')][_0x32f4('0x1b')]);}logger[_0x32f4('0x19')](_0x32f4('0x14'),_0x1786e6,_0x511075['error']['message']);return _0x22c57f(_0x511075[_0x32f4('0x19')][_0x32f4('0x1b')]);}else{logger[_0x32f4('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x1786e6,_0x32f4('0x15'));_0x22c57f(_0x511075[_0x32f4('0x1c')]['message']);}})['catch'](function(_0x1190ef){logger[_0x32f4('0x19')](_0x32f4('0x14'),_0x1786e6,_0x1190ef);_0x259aa7(_0x1190ef);});});}exports['GetVoiceQueueReport']=function(_0xd745a3){var _0x4d35a3=this;return new Promise(function(_0x324e46,_0x31f222){return db[_0x32f4('0x1d')][_0x32f4('0x1e')]({'raw':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3[_0x32f4('0x1f')][_0x32f4('0x20')]===undefined?!![]:![]:!![],'where':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3['options'][_0x32f4('0x21')]||null:null,'attributes':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3[_0x32f4('0x1f')][_0x32f4('0x22')]||null:null,'limit':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3['options']['limit']||null:null,'include':_0xd745a3[_0x32f4('0x1f')]?_0xd745a3[_0x32f4('0x1f')]['include']?_['map'](_0xd745a3['options'][_0x32f4('0x23')],function(_0x201a67){return{'model':db[_0x201a67[_0x32f4('0x24')]],'as':_0x201a67['as'],'attributes':_0x201a67[_0x32f4('0x22')],'include':_0x201a67[_0x32f4('0x23')]?_[_0x32f4('0x25')](_0x201a67[_0x32f4('0x23')],function(_0x4a9098){return{'model':db[_0x4a9098[_0x32f4('0x24')]],'as':_0x4a9098['as'],'attributes':_0x4a9098['attributes'],'include':_0x4a9098[_0x32f4('0x23')]?_['map'](_0x4a9098[_0x32f4('0x23')],function(_0x2b51fa){return{'model':db[_0x2b51fa['model']],'as':_0x2b51fa['as'],'attributes':_0x2b51fa['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x20ac48){logger[_0x32f4('0x13')]('GetVoiceQueueReport',_0xd745a3);logger[_0x32f4('0x16')](_0x32f4('0x26'),_0xd745a3,JSON['stringify'](_0x20ac48));_0x324e46(_0x20ac48);})[_0x32f4('0x27')](function(_0x2e901d){logger[_0x32f4('0x19')]('GetVoiceQueueReport',_0x2e901d[_0x32f4('0x1b')],_0xd745a3);_0x31f222(_0x4d35a3[_0x32f4('0x19')](0x1f4,_0x2e901d[_0x32f4('0x1b')]));});});};exports[_0x32f4('0x28')]=function(_0x408ec0){var _0x391af0=this;return new Promise(function(_0x594dfe,_0xf2a000){return db[_0x32f4('0x1d')][_0x32f4('0x29')](_0x408ec0[_0x32f4('0x2a')],{'raw':_0x408ec0[_0x32f4('0x1f')]?_0x408ec0['options'][_0x32f4('0x20')]===undefined?!![]:![]:!![]})[_0x32f4('0x12')](function(_0x2a1da7){logger[_0x32f4('0x13')](_0x32f4('0x28'),_0x408ec0);logger['debug'](_0x32f4('0x28'),_0x408ec0,JSON[_0x32f4('0x18')](_0x2a1da7));_0x594dfe(_0x2a1da7);})['catch'](function(_0x54effa){logger['error'](_0x32f4('0x28'),_0x54effa[_0x32f4('0x1b')],_0x408ec0);_0xf2a000(_0x391af0['error'](0x1f4,_0x54effa[_0x32f4('0x1b')]));});});};exports[_0x32f4('0x2b')]=function(_0x1b5902){var _0x2a7a3e=this;return new Promise(function(_0x49501a,_0x4f6ec7){return db[_0x32f4('0x1d')][_0x32f4('0x2c')](_0x1b5902[_0x32f4('0x2a')],{'raw':_0x1b5902[_0x32f4('0x1f')]?_0x1b5902[_0x32f4('0x1f')][_0x32f4('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5902['options']?_0x1b5902[_0x32f4('0x1f')][_0x32f4('0x21')]||null:null,'attributes':_0x1b5902[_0x32f4('0x1f')]?_0x1b5902['options'][_0x32f4('0x22')]||null:null,'limit':_0x1b5902[_0x32f4('0x1f')]?_0x1b5902['options']['limit']||null:null})[_0x32f4('0x12')](function(_0x5dabcf){logger[_0x32f4('0x13')](_0x32f4('0x2b'),_0x1b5902);logger[_0x32f4('0x16')]('UpdateVoiceQueueReport',_0x1b5902,JSON[_0x32f4('0x18')](_0x5dabcf));_0x49501a(_0x5dabcf);})['catch'](function(_0x2cb1c2){logger[_0x32f4('0x19')](_0x32f4('0x2b'),_0x2cb1c2[_0x32f4('0x1b')],_0x1b5902);_0x4f6ec7(_0x2a7a3e[_0x32f4('0x19')](0x1f4,_0x2cb1c2[_0x32f4('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 38cfdbf..2674c81 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 _0xc92f=['update','emit','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x5c9540,_0x50602c){var _0x511dbc=function(_0x4d2acb){while(--_0x4d2acb){_0x5c9540['push'](_0x5c9540['shift']());}};_0x511dbc(++_0x50602c);}(_0xc92f,0xf3));var _0xfc92=function(_0x3a8479,_0x520e38){_0x3a8479=_0x3a8479-0x0;var _0x45e790=_0xc92f[_0x3a8479];return _0x45e790;};'use strict';var VoiceQueueReportEvents=require(_0xfc92('0x0'));var events=[_0xfc92('0x1'),'remove',_0xfc92('0x2')];function createListener(_0x19f2d4,_0x355614){return function(_0x4a76e2){_0x355614[_0xfc92('0x3')](_0x19f2d4,_0x4a76e2);};}function removeListener(_0x21f567,_0x35780b){return function(){VoiceQueueReportEvents['removeListener'](_0x21f567,_0x35780b);};}exports['register']=function(_0x930bab){for(var _0x47abee=0x0,_0x394026=events['length'];_0x47abee<_0x394026;_0x47abee++){var _0xd80968=events[_0x47abee];var _0x49db29=createListener(_0xfc92('0x4')+_0xd80968,_0x930bab);VoiceQueueReportEvents['on'](_0xd80968,_0x49db29);}}; \ No newline at end of file +var _0xe35c=['update','removeListener','register','length','./voiceQueueReport.events','save','remove'];(function(_0x287db9,_0x149fad){var _0x1c5a7c=function(_0x5528c5){while(--_0x5528c5){_0x287db9['push'](_0x287db9['shift']());}};_0x1c5a7c(++_0x149fad);}(_0xe35c,0x146));var _0xce35=function(_0x4372ff,_0x2287f7){_0x4372ff=_0x4372ff-0x0;var _0x58db97=_0xe35c[_0x4372ff];return _0x58db97;};'use strict';var VoiceQueueReportEvents=require(_0xce35('0x0'));var events=[_0xce35('0x1'),_0xce35('0x2'),_0xce35('0x3')];function createListener(_0x1ace65,_0x21eade){return function(_0x4f48a7){_0x21eade['emit'](_0x1ace65,_0x4f48a7);};}function removeListener(_0x17648a,_0x4a005b){return function(){VoiceQueueReportEvents[_0xce35('0x4')](_0x17648a,_0x4a005b);};}exports[_0xce35('0x5')]=function(_0x3a4bb){for(var _0x47e53c=0x0,_0x270b81=events[_0xce35('0x6')];_0x47e53c<_0x270b81;_0x47e53c++){var _0x2b4a82=events[_0x47e53c];var _0x74ae5e=createListener('voiceQueueReport:'+_0x2b4a82,_0x3a4bb);VoiceQueueReportEvents['on'](_0x2b4a82,_0x74ae5e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index d979625..734aefc 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 _0x5b26=['isAuthenticated','index','/:id','show','create','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceQueuesLog.controller'];(function(_0x12c759,_0x1452c1){var _0x39393d=function(_0x279c5d){while(--_0x279c5d){_0x12c759['push'](_0x12c759['shift']());}};_0x39393d(++_0x1452c1);}(_0x5b26,0x172));var _0x65b2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5b26[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x65b2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x65b2('0x1'));var express=require(_0x65b2('0x2'));var router=express[_0x65b2('0x3')]();var fs_extra=require(_0x65b2('0x4'));var auth=require(_0x65b2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x65b2('0x6'));router['get']('/',auth[_0x65b2('0x7')](),controller[_0x65b2('0x8')]);router['get'](_0x65b2('0x9'),auth[_0x65b2('0x7')](),controller[_0x65b2('0xa')]);router['post']('/',auth[_0x65b2('0x7')](),controller[_0x65b2('0xb')]);router['put']('/:id',auth[_0x65b2('0x7')](),controller['update']);router['delete'](_0x65b2('0x9'),auth[_0x65b2('0x7')](),controller['destroy']);module[_0x65b2('0xc')]=router; \ No newline at end of file +var _0x42c9=['get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x474fe0,_0x22cf6f){var _0x120a13=function(_0x4531bb){while(--_0x4531bb){_0x474fe0['push'](_0x474fe0['shift']());}};_0x120a13(++_0x22cf6f);}(_0x42c9,0x1ae));var _0x942c=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x42c9[_0x31172e];return _0x414ada;};'use strict';var multer=require(_0x942c('0x0'));var util=require('util');var path=require(_0x942c('0x1'));var timeout=require(_0x942c('0x2'));var express=require(_0x942c('0x3'));var router=express[_0x942c('0x4')]();var fs_extra=require(_0x942c('0x5'));var auth=require(_0x942c('0x6'));var interaction=require(_0x942c('0x7'));var config=require(_0x942c('0x8'));var controller=require(_0x942c('0x9'));router[_0x942c('0xa')]('/',auth[_0x942c('0xb')](),controller[_0x942c('0xc')]);router[_0x942c('0xa')](_0x942c('0xd'),auth[_0x942c('0xb')](),controller[_0x942c('0xe')]);router['post']('/',auth[_0x942c('0xb')](),controller[_0x942c('0xf')]);router[_0x942c('0x10')]('/:id',auth[_0x942c('0xb')](),controller[_0x942c('0x11')]);router[_0x942c('0x12')](_0x942c('0xd'),auth[_0x942c('0xb')](),controller['destroy']);module[_0x942c('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 5d025cf..cdb3f4b 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 _0x8d7d=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x1fc877,_0x1eccd8){var _0x34d91c=function(_0x478076){while(--_0x478076){_0x1fc877['push'](_0x1fc877['shift']());}};_0x34d91c(++_0x1eccd8);}(_0x8d7d,0xae));var _0xd8d7=function(_0x5eea43,_0x1d50c9){_0x5eea43=_0x5eea43-0x0;var _0x4bc4b9=_0x8d7d[_0x5eea43];return _0x4bc4b9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xd8d7('0x0'));module[_0xd8d7('0x1')]={'time':{'type':Sequelize[_0xd8d7('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd8d7('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xd8d7('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd8d7('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd8d7('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd8d7('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd8d7('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd8d7('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd8d7('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0xd8d7('0x4'))}}; \ No newline at end of file +var _0xa93e=['STRING','DATE','format','exports'];(function(_0x1810f4,_0x35765f){var _0x4c7266=function(_0x5e3034){while(--_0x5e3034){_0x1810f4['push'](_0x1810f4['shift']());}};_0x4c7266(++_0x35765f);}(_0xa93e,0x1df));var _0xea93=function(_0x4a4058,_0xea7bc1){_0x4a4058=_0x4a4058-0x0;var _0x23a4fa=_0xa93e[_0x4a4058];return _0x23a4fa;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xea93('0x0')]={'time':{'type':Sequelize[_0xea93('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xea93('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xea93('0x2')],'allowNull':![],'defaultValue':moment()[_0xea93('0x3')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index c4ff33c..4b56185 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 _0x4725=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','create','body','update','eml-format','zip-dir','moment','mustache','util','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x428774,_0x383962){var _0x53a01c=function(_0x2d62da){while(--_0x2d62da){_0x428774['push'](_0x428774['shift']());}};_0x53a01c(++_0x383962);}(_0x4725,0x10c));var _0x5472=function(_0x6dfb8a,_0xb868ac){_0x6dfb8a=_0x6dfb8a-0x0;var _0x38b1a7=_0x4725[_0x6dfb8a];return _0x38b1a7;};'use strict';var emlformat=require(_0x5472('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5472('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5472('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5472('0x3'));var util=require(_0x5472('0x4'));var path=require('path');var sox=require(_0x5472('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5472('0x6'));var _=require(_0x5472('0x7'));var squel=require(_0x5472('0x8'));var crypto=require(_0x5472('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5472('0xa'));var querystring=require(_0x5472('0xb'));var Papa=require(_0x5472('0xc'));var Redis=require(_0x5472('0xd'));var authService=require(_0x5472('0xe'));var qs=require(_0x5472('0xf'));var as=require(_0x5472('0x10'));var hardwareService=require(_0x5472('0x11'));var logger=require(_0x5472('0x12'))(_0x5472('0x13'));var utils=require(_0x5472('0x14'));var config=require(_0x5472('0x15'));var licenseUtil=require(_0x5472('0x16'));var db=require(_0x5472('0x17'))['db'];function respondWithStatusCode(_0x503d9c,_0xd24130){_0xd24130=_0xd24130||0xcc;return function(_0x19a2a1){if(_0x19a2a1){return _0x503d9c[_0x5472('0x18')](_0xd24130);}return _0x503d9c[_0x5472('0x19')](_0xd24130)[_0x5472('0x1a')]();};}function respondWithResult(_0x1ab5df,_0x5a9000){_0x5a9000=_0x5a9000||0xc8;return function(_0x2e2587){if(_0x2e2587){return _0x1ab5df[_0x5472('0x19')](_0x5a9000)[_0x5472('0x1b')](_0x2e2587);}};}function respondWithFilteredResult(_0x4b6ec9,_0x231e22){return function(_0x5f4098){if(_0x5f4098){var _0x50764f=typeof _0x231e22['offset']===_0x5472('0x1c')&&typeof _0x231e22[_0x5472('0x1d')]==='undefined';var _0x1dd47a=_0x5f4098[_0x5472('0x1e')];var _0x3b45c4=_0x50764f?0x0:_0x231e22['offset'];var _0x525eea=_0x50764f?_0x5f4098[_0x5472('0x1e')]:_0x231e22[_0x5472('0x1f')]+_0x231e22[_0x5472('0x1d')];var _0x251df6;if(_0x525eea>=_0x1dd47a){_0x525eea=_0x1dd47a;_0x251df6=0xc8;}else{_0x251df6=0xce;}_0x4b6ec9['status'](_0x251df6);return _0x4b6ec9[_0x5472('0x20')](_0x5472('0x21'),_0x3b45c4+'-'+_0x525eea+'/'+_0x1dd47a)['json'](_0x5f4098);}return null;};}function patchUpdates(_0x3a6608){return function(_0x286ad5){try{jsonpatch[_0x5472('0x22')](_0x286ad5,_0x3a6608,!![]);}catch(_0x83d2d8){return BPromise['reject'](_0x83d2d8);}return _0x286ad5[_0x5472('0x23')]();};}function saveUpdates(_0x115211,_0x1f356a){return function(_0x35d87f){if(_0x35d87f){return _0x35d87f['update'](_0x115211)[_0x5472('0x24')](function(_0x5e1003){return _0x5e1003;});}return null;};}function removeEntity(_0x415632,_0xfccdfa){return function(_0x31b7a6){if(_0x31b7a6){return _0x31b7a6[_0x5472('0x25')]()[_0x5472('0x24')](function(){_0x415632[_0x5472('0x19')](0xcc)[_0x5472('0x1a')]();});}};}function handleEntityNotFound(_0x470b20,_0x1c4c01){return function(_0xc5d5f7){if(!_0xc5d5f7){_0x470b20['sendStatus'](0x194);}return _0xc5d5f7;};}function handleError(_0x517939,_0x14bda6){_0x14bda6=_0x14bda6||0x1f4;return function(_0xf5f65){logger[_0x5472('0x26')](_0xf5f65[_0x5472('0x27')]);if(_0xf5f65[_0x5472('0x28')]){delete _0xf5f65[_0x5472('0x28')];}_0x517939[_0x5472('0x19')](_0x14bda6)[_0x5472('0x29')](_0xf5f65);};}exports[_0x5472('0x2a')]=function(_0x568fdf,_0x597fc7){var _0x17842b={},_0x5165b6={},_0x1fd0f3={'count':0x0,'rows':[]};var _0x347779=_[_0x5472('0x2b')](db[_0x5472('0x2c')][_0x5472('0x2d')],function(_0x12f669){return{'name':_0x12f669[_0x5472('0x2e')],'type':_0x12f669['type']['key']};});_0x5165b6['model']=_['map'](_0x347779,_0x5472('0x28'));_0x5165b6[_0x5472('0x2f')]=_[_0x5472('0x30')](_0x568fdf[_0x5472('0x2f')]);_0x5165b6[_0x5472('0x31')]=_['intersection'](_0x5165b6[_0x5472('0x32')],_0x5165b6[_0x5472('0x2f')]);_0x17842b[_0x5472('0x33')]=_[_0x5472('0x34')](_0x5165b6['model'],qs[_0x5472('0x35')](_0x568fdf[_0x5472('0x2f')]['fields']));_0x17842b[_0x5472('0x33')]=_0x17842b[_0x5472('0x33')][_0x5472('0x36')]?_0x17842b['attributes']:_0x5165b6[_0x5472('0x32')];if(!_0x568fdf[_0x5472('0x2f')][_0x5472('0x37')]('nolimit')){_0x17842b[_0x5472('0x1d')]=qs['limit'](_0x568fdf['query'][_0x5472('0x1d')]);_0x17842b['offset']=qs[_0x5472('0x1f')](_0x568fdf[_0x5472('0x2f')][_0x5472('0x1f')]);}_0x17842b['order']=qs[_0x5472('0x38')](_0x568fdf[_0x5472('0x2f')][_0x5472('0x38')]);_0x17842b[_0x5472('0x39')]=qs['filters'](_[_0x5472('0x3a')](_0x568fdf['query'],_0x5165b6[_0x5472('0x31')]),_0x347779);if(_0x568fdf[_0x5472('0x2f')]['filter']){_0x17842b[_0x5472('0x39')]=_[_0x5472('0x3b')](_0x17842b[_0x5472('0x39')],{'$or':_[_0x5472('0x2b')](_0x347779,function(_0x513074){if(_0x513074['type']!=='VIRTUAL'){var _0x2a2df8={};_0x2a2df8[_0x513074[_0x5472('0x28')]]={'$like':'%'+_0x568fdf[_0x5472('0x2f')][_0x5472('0x3c')]+'%'};return _0x2a2df8;}})});}_0x17842b=_[_0x5472('0x3b')]({},_0x17842b,_0x568fdf[_0x5472('0x3d')]);var _0x32f1c2={'where':_0x17842b[_0x5472('0x39')]};return db[_0x5472('0x2c')][_0x5472('0x1e')](_0x32f1c2)[_0x5472('0x24')](function(_0x146fc3){_0x1fd0f3[_0x5472('0x1e')]=_0x146fc3;if(_0x568fdf[_0x5472('0x2f')][_0x5472('0x3e')]){_0x17842b[_0x5472('0x3f')]=[{'all':!![]}];}return db[_0x5472('0x2c')]['findAll'](_0x17842b);})['then'](function(_0xd9bbf6){_0x1fd0f3[_0x5472('0x40')]=_0xd9bbf6;return _0x1fd0f3;})['then'](respondWithFilteredResult(_0x597fc7,_0x17842b))[_0x5472('0x41')](handleError(_0x597fc7,null));};exports[_0x5472('0x42')]=function(_0x37ae04,_0x5e0b71){var _0x2a90e4={'raw':!![],'where':{'id':_0x37ae04[_0x5472('0x43')]['id']}},_0x275c56={};_0x275c56[_0x5472('0x32')]=_[_0x5472('0x30')](db[_0x5472('0x2c')][_0x5472('0x2d')]);_0x275c56['query']=_[_0x5472('0x30')](_0x37ae04['query']);_0x275c56['filters']=_[_0x5472('0x34')](_0x275c56[_0x5472('0x32')],_0x275c56[_0x5472('0x2f')]);_0x2a90e4[_0x5472('0x33')]=_[_0x5472('0x34')](_0x275c56[_0x5472('0x32')],qs[_0x5472('0x35')](_0x37ae04[_0x5472('0x2f')][_0x5472('0x35')]));_0x2a90e4[_0x5472('0x33')]=_0x2a90e4[_0x5472('0x33')][_0x5472('0x36')]?_0x2a90e4[_0x5472('0x33')]:_0x275c56[_0x5472('0x32')];if(_0x37ae04['query'][_0x5472('0x3e')]){_0x2a90e4[_0x5472('0x3f')]=[{'all':!![]}];}_0x2a90e4=_['merge']({},_0x2a90e4,_0x37ae04[_0x5472('0x3d')]);return db[_0x5472('0x2c')]['find'](_0x2a90e4)[_0x5472('0x24')](handleEntityNotFound(_0x5e0b71,null))[_0x5472('0x24')](respondWithResult(_0x5e0b71,null))['catch'](handleError(_0x5e0b71,null));};exports[_0x5472('0x44')]=function(_0x5c60e2,_0x2c6004){return db[_0x5472('0x2c')][_0x5472('0x44')](_0x5c60e2[_0x5472('0x45')],{})['then'](respondWithResult(_0x2c6004,0xc9))[_0x5472('0x41')](handleError(_0x2c6004,null));};exports[_0x5472('0x46')]=function(_0x194613,_0x406cc3){if(_0x194613[_0x5472('0x45')]['id']){delete _0x194613[_0x5472('0x45')]['id'];}return db[_0x5472('0x2c')]['find']({'where':{'id':_0x194613[_0x5472('0x43')]['id']}})['then'](handleEntityNotFound(_0x406cc3,null))[_0x5472('0x24')](saveUpdates(_0x194613['body'],null))[_0x5472('0x24')](respondWithResult(_0x406cc3,null))[_0x5472('0x41')](handleError(_0x406cc3,null));};exports['destroy']=function(_0x4a33ea,_0x5c15cf){return db[_0x5472('0x2c')]['find']({'where':{'id':_0x4a33ea[_0x5472('0x43')]['id']}})[_0x5472('0x24')](handleEntityNotFound(_0x5c15cf,null))[_0x5472('0x24')](removeEntity(_0x5c15cf,null))['catch'](handleError(_0x5c15cf,null));}; \ No newline at end of file +var _0x8eae=['catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','stack','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','name','filter','options','VoiceQueuesLog','include','rows','show','params','includeAll','find'];(function(_0x13164d,_0x4ca3de){var _0xd8678d=function(_0x517601){while(--_0x517601){_0x13164d['push'](_0x13164d['shift']());}};_0xd8678d(++_0x4ca3de);}(_0x8eae,0x1ed));var _0xe8ea=function(_0x250bbc,_0x3297f3){_0x250bbc=_0x250bbc-0x0;var _0x489e34=_0x8eae[_0x250bbc];return _0x489e34;};'use strict';var emlformat=require(_0xe8ea('0x0'));var rimraf=require(_0xe8ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8ea('0x2'));var rp=require(_0xe8ea('0x3'));var moment=require(_0xe8ea('0x4'));var BPromise=require(_0xe8ea('0x5'));var Mustache=require(_0xe8ea('0x6'));var util=require('util');var path=require('path');var sox=require(_0xe8ea('0x7'));var csv=require(_0xe8ea('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8ea('0x9'));var _=require(_0xe8ea('0xa'));var squel=require('squel');var crypto=require(_0xe8ea('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe8ea('0x8'));var querystring=require('querystring');var Papa=require(_0xe8ea('0xc'));var Redis=require(_0xe8ea('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe8ea('0xe'));var as=require(_0xe8ea('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8ea('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xe8ea('0x11'));var licenseUtil=require(_0xe8ea('0x12'));var db=require(_0xe8ea('0x13'))['db'];function respondWithStatusCode(_0xccbe65,_0x22b36e){_0x22b36e=_0x22b36e||0xcc;return function(_0xd1aa62){if(_0xd1aa62){return _0xccbe65[_0xe8ea('0x14')](_0x22b36e);}return _0xccbe65[_0xe8ea('0x15')](_0x22b36e)[_0xe8ea('0x16')]();};}function respondWithResult(_0xe72554,_0x58ac02){_0x58ac02=_0x58ac02||0xc8;return function(_0xb36747){if(_0xb36747){return _0xe72554['status'](_0x58ac02)[_0xe8ea('0x17')](_0xb36747);}};}function respondWithFilteredResult(_0x474d68,_0x109186){return function(_0x49e173){if(_0x49e173){var _0x53b728=typeof _0x109186[_0xe8ea('0x18')]===_0xe8ea('0x19')&&typeof _0x109186[_0xe8ea('0x1a')]===_0xe8ea('0x19');var _0x36d2cc=_0x49e173[_0xe8ea('0x1b')];var _0x4a93fd=_0x53b728?0x0:_0x109186['offset'];var _0x3cb2d9=_0x53b728?_0x49e173[_0xe8ea('0x1b')]:_0x109186[_0xe8ea('0x18')]+_0x109186[_0xe8ea('0x1a')];var _0x536fe6;if(_0x3cb2d9>=_0x36d2cc){_0x3cb2d9=_0x36d2cc;_0x536fe6=0xc8;}else{_0x536fe6=0xce;}_0x474d68[_0xe8ea('0x15')](_0x536fe6);return _0x474d68[_0xe8ea('0x1c')]('Content-Range',_0x4a93fd+'-'+_0x3cb2d9+'/'+_0x36d2cc)[_0xe8ea('0x17')](_0x49e173);}return null;};}function patchUpdates(_0x500743){return function(_0x4a0ffd){try{jsonpatch[_0xe8ea('0x1d')](_0x4a0ffd,_0x500743,!![]);}catch(_0x4315fc){return BPromise[_0xe8ea('0x1e')](_0x4315fc);}return _0x4a0ffd[_0xe8ea('0x1f')]();};}function saveUpdates(_0x372229,_0x203f0c){return function(_0x234634){if(_0x234634){return _0x234634[_0xe8ea('0x20')](_0x372229)['then'](function(_0x3d7875){return _0x3d7875;});}return null;};}function removeEntity(_0x3e62df,_0x3099cc){return function(_0x2b220c){if(_0x2b220c){return _0x2b220c[_0xe8ea('0x21')]()[_0xe8ea('0x22')](function(){_0x3e62df[_0xe8ea('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4cde65,_0x348dbe){return function(_0x922f96){if(!_0x922f96){_0x4cde65[_0xe8ea('0x14')](0x194);}return _0x922f96;};}function handleError(_0x19dbff,_0x13228a){_0x13228a=_0x13228a||0x1f4;return function(_0xd6057d){logger['error'](_0xd6057d[_0xe8ea('0x23')]);if(_0xd6057d['name']){delete _0xd6057d['name'];}_0x19dbff[_0xe8ea('0x15')](_0x13228a)[_0xe8ea('0x24')](_0xd6057d);};}exports[_0xe8ea('0x25')]=function(_0x243c56,_0x40f05f){var _0x50144b={},_0x1f763d={},_0x191f75={'count':0x0,'rows':[]};var _0x3830a8=_[_0xe8ea('0x26')](db['VoiceQueuesLog'][_0xe8ea('0x27')],function(_0x3dbc56){return{'name':_0x3dbc56[_0xe8ea('0x28')],'type':_0x3dbc56['type'][_0xe8ea('0x29')]};});_0x1f763d[_0xe8ea('0x2a')]=_[_0xe8ea('0x26')](_0x3830a8,'name');_0x1f763d[_0xe8ea('0x2b')]=_[_0xe8ea('0x2c')](_0x243c56['query']);_0x1f763d[_0xe8ea('0x2d')]=_[_0xe8ea('0x2e')](_0x1f763d[_0xe8ea('0x2a')],_0x1f763d['query']);_0x50144b[_0xe8ea('0x2f')]=_['intersection'](_0x1f763d[_0xe8ea('0x2a')],qs[_0xe8ea('0x30')](_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x30')]));_0x50144b['attributes']=_0x50144b[_0xe8ea('0x2f')][_0xe8ea('0x31')]?_0x50144b['attributes']:_0x1f763d['model'];if(!_0x243c56['query'][_0xe8ea('0x32')](_0xe8ea('0x33'))){_0x50144b[_0xe8ea('0x1a')]=qs[_0xe8ea('0x1a')](_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x1a')]);_0x50144b[_0xe8ea('0x18')]=qs[_0xe8ea('0x18')](_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x18')]);}_0x50144b[_0xe8ea('0x34')]=qs['sort'](_0x243c56['query'][_0xe8ea('0x35')]);_0x50144b[_0xe8ea('0x36')]=qs[_0xe8ea('0x2d')](_[_0xe8ea('0x37')](_0x243c56[_0xe8ea('0x2b')],_0x1f763d['filters']),_0x3830a8);if(_0x243c56[_0xe8ea('0x2b')]['filter']){_0x50144b[_0xe8ea('0x36')]=_[_0xe8ea('0x38')](_0x50144b[_0xe8ea('0x36')],{'$or':_[_0xe8ea('0x26')](_0x3830a8,function(_0x234e71){if(_0x234e71['type']!=='VIRTUAL'){var _0x3ad516={};_0x3ad516[_0x234e71[_0xe8ea('0x39')]]={'$like':'%'+_0x243c56[_0xe8ea('0x2b')][_0xe8ea('0x3a')]+'%'};return _0x3ad516;}})});}_0x50144b=_[_0xe8ea('0x38')]({},_0x50144b,_0x243c56[_0xe8ea('0x3b')]);var _0x2a9618={'where':_0x50144b['where']};return db[_0xe8ea('0x3c')]['count'](_0x2a9618)[_0xe8ea('0x22')](function(_0x4fb79b){_0x191f75['count']=_0x4fb79b;if(_0x243c56['query']['includeAll']){_0x50144b[_0xe8ea('0x3d')]=[{'all':!![]}];}return db[_0xe8ea('0x3c')]['findAll'](_0x50144b);})[_0xe8ea('0x22')](function(_0x56467b){_0x191f75[_0xe8ea('0x3e')]=_0x56467b;return _0x191f75;})[_0xe8ea('0x22')](respondWithFilteredResult(_0x40f05f,_0x50144b))['catch'](handleError(_0x40f05f,null));};exports[_0xe8ea('0x3f')]=function(_0x5c8d6e,_0x598735){var _0x48f71d={'raw':!![],'where':{'id':_0x5c8d6e[_0xe8ea('0x40')]['id']}},_0x99b9b0={};_0x99b9b0[_0xe8ea('0x2a')]=_['keys'](db[_0xe8ea('0x3c')][_0xe8ea('0x27')]);_0x99b9b0[_0xe8ea('0x2b')]=_[_0xe8ea('0x2c')](_0x5c8d6e[_0xe8ea('0x2b')]);_0x99b9b0[_0xe8ea('0x2d')]=_[_0xe8ea('0x2e')](_0x99b9b0['model'],_0x99b9b0[_0xe8ea('0x2b')]);_0x48f71d['attributes']=_['intersection'](_0x99b9b0[_0xe8ea('0x2a')],qs[_0xe8ea('0x30')](_0x5c8d6e[_0xe8ea('0x2b')]['fields']));_0x48f71d[_0xe8ea('0x2f')]=_0x48f71d[_0xe8ea('0x2f')]['length']?_0x48f71d['attributes']:_0x99b9b0[_0xe8ea('0x2a')];if(_0x5c8d6e[_0xe8ea('0x2b')][_0xe8ea('0x41')]){_0x48f71d[_0xe8ea('0x3d')]=[{'all':!![]}];}_0x48f71d=_[_0xe8ea('0x38')]({},_0x48f71d,_0x5c8d6e['options']);return db[_0xe8ea('0x3c')][_0xe8ea('0x42')](_0x48f71d)[_0xe8ea('0x22')](handleEntityNotFound(_0x598735,null))[_0xe8ea('0x22')](respondWithResult(_0x598735,null))[_0xe8ea('0x43')](handleError(_0x598735,null));};exports[_0xe8ea('0x44')]=function(_0x3a7b86,_0x1072b4){return db[_0xe8ea('0x3c')][_0xe8ea('0x44')](_0x3a7b86[_0xe8ea('0x45')],{})[_0xe8ea('0x22')](respondWithResult(_0x1072b4,0xc9))['catch'](handleError(_0x1072b4,null));};exports[_0xe8ea('0x20')]=function(_0x39cb66,_0x4ad13b){if(_0x39cb66[_0xe8ea('0x45')]['id']){delete _0x39cb66[_0xe8ea('0x45')]['id'];}return db['VoiceQueuesLog'][_0xe8ea('0x42')]({'where':{'id':_0x39cb66[_0xe8ea('0x40')]['id']}})[_0xe8ea('0x22')](handleEntityNotFound(_0x4ad13b,null))[_0xe8ea('0x22')](saveUpdates(_0x39cb66[_0xe8ea('0x45')],null))['then'](respondWithResult(_0x4ad13b,null))['catch'](handleError(_0x4ad13b,null));};exports['destroy']=function(_0x4b8f20,_0x6a3ece){return db['VoiceQueuesLog'][_0xe8ea('0x42')]({'where':{'id':_0x4b8f20['params']['id']}})[_0xe8ea('0x22')](handleEntityNotFound(_0x6a3ece,null))[_0xe8ea('0x22')](removeEntity(_0x6a3ece,null))[_0xe8ea('0x43')](handleError(_0x6a3ece,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 49fb3bb..8c929d7 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 _0x97a6=['rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30730c,_0x5e00f2){var _0x554424=function(_0x36118e){while(--_0x36118e){_0x30730c['push'](_0x30730c['shift']());}};_0x554424(++_0x5e00f2);}(_0x97a6,0x1b3));var _0x697a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x97a6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x697a('0x0'));var logger=require(_0x697a('0x1'))(_0x697a('0x2'));var moment=require(_0x697a('0x3'));var BPromise=require(_0x697a('0x4'));var rp=require(_0x697a('0x5'));var fs=require('fs');var path=require(_0x697a('0x6'));var rimraf=require(_0x697a('0x7'));var config=require(_0x697a('0x8'));var attributes=require(_0x697a('0x9'));module[_0x697a('0xa')]=function(_0x382d40,_0x75a1a3){return _0x382d40[_0x697a('0xb')](_0x697a('0xc'),attributes,{'tableName':_0x697a('0xd'),'paranoid':![],'indexes':[{'name':_0x697a('0xe'),'fields':[_0x697a('0xf'),_0x697a('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0xb205=['define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','../../config/logger','moment','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x3b7e60,_0x1c7668){var _0x329efa=function(_0x36f69b){while(--_0x36f69b){_0x3b7e60['push'](_0x3b7e60['shift']());}};_0x329efa(++_0x1c7668);}(_0xb205,0x1bf));var _0x5b20=function(_0x104dba,_0x545685){_0x104dba=_0x104dba-0x0;var _0xefbe3=_0xb205[_0x104dba];return _0xefbe3;};'use strict';var _=require(_0x5b20('0x0'));var util=require('util');var logger=require(_0x5b20('0x1'))('api');var moment=require(_0x5b20('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b20('0x3'));var rimraf=require(_0x5b20('0x4'));var config=require(_0x5b20('0x5'));var attributes=require(_0x5b20('0x6'));module[_0x5b20('0x7')]=function(_0x240a92,_0x438b51){return _0x240a92[_0x5b20('0x8')](_0x5b20('0x9'),attributes,{'tableName':_0x5b20('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x5b20('0xb'),_0x5b20('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 1ff9af4..37b6a95 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 _0x3b43=['../../config/logger','../../config/environment','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x47c5d8,_0x39bd42){var _0x55acdb=function(_0x18b27f){while(--_0x18b27f){_0x47c5d8['push'](_0x47c5d8['shift']());}};_0x55acdb(++_0x39bd42);}(_0x3b43,0x71));var _0x33b4=function(_0x2e7243,_0xcf7a6e){_0x2e7243=_0x2e7243-0x0;var _0xc25b9c=_0x3b43[_0x2e7243];return _0xc25b9c;};'use strict';var _=require(_0x33b4('0x0'));var util=require(_0x33b4('0x1'));var moment=require(_0x33b4('0x2'));var BPromise=require(_0x33b4('0x3'));var rs=require(_0x33b4('0x4'));var fs=require('fs');var Redis=require(_0x33b4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x33b4('0x6'));var logger=require(_0x33b4('0x7'))('rpc');var config=require(_0x33b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x33b4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x359d98,_0x7fc5ae,_0x9b3f4d){return new BPromise(function(_0x2ca486,_0x15f06e){return client[_0x33b4('0xa')](_0x359d98,_0x9b3f4d)[_0x33b4('0xb')](function(_0x3b743e){logger['info'](_0x33b4('0xc'),_0x7fc5ae,_0x33b4('0xd'));logger[_0x33b4('0xe')](_0x33b4('0xf'),_0x7fc5ae,'request\x20sent',JSON['stringify'](_0x3b743e));if(_0x3b743e[_0x33b4('0x10')]){if(_0x3b743e['error']['code']===0x1f4){logger[_0x33b4('0x10')](_0x33b4('0xc'),_0x7fc5ae,_0x3b743e[_0x33b4('0x10')][_0x33b4('0x11')]);return _0x15f06e(_0x3b743e[_0x33b4('0x10')]['message']);}logger['error'](_0x33b4('0xc'),_0x7fc5ae,_0x3b743e[_0x33b4('0x10')]['message']);return _0x2ca486(_0x3b743e[_0x33b4('0x10')][_0x33b4('0x11')]);}else{logger[_0x33b4('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x7fc5ae,_0x33b4('0xd'));_0x2ca486(_0x3b743e['result']['message']);}})[_0x33b4('0x13')](function(_0x220b78){logger['error'](_0x33b4('0xc'),_0x7fc5ae,_0x220b78);_0x15f06e(_0x220b78);});});} \ No newline at end of file +var _0x8b88=['http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x170291,_0x13cec3){var _0x26faee=function(_0x305d0c){while(--_0x305d0c){_0x170291['push'](_0x170291['shift']());}};_0x26faee(++_0x13cec3);}(_0x8b88,0x14f));var _0x88b8=function(_0x16d58c,_0x46aeb7){_0x16d58c=_0x16d58c-0x0;var _0x53742e=_0x8b88[_0x16d58c];return _0x53742e;};'use strict';var _=require('lodash');var util=require(_0x88b8('0x0'));var moment=require('moment');var BPromise=require(_0x88b8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x88b8('0x2'));var db=require(_0x88b8('0x3'))['db'];var utils=require(_0x88b8('0x4'));var logger=require(_0x88b8('0x5'))(_0x88b8('0x6'));var config=require(_0x88b8('0x7'));var jayson=require(_0x88b8('0x8'));var client=jayson[_0x88b8('0x9')][_0x88b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ea30a,_0x2e4b69,_0x532c85){return new BPromise(function(_0x4d0928,_0xe142ee){return client[_0x88b8('0xb')](_0x3ea30a,_0x532c85)[_0x88b8('0xc')](function(_0x58a205){logger[_0x88b8('0xd')](_0x88b8('0xe'),_0x2e4b69,_0x88b8('0xf'));logger['debug'](_0x88b8('0x10'),_0x2e4b69,_0x88b8('0xf'),JSON[_0x88b8('0x11')](_0x58a205));if(_0x58a205['error']){if(_0x58a205['error'][_0x88b8('0x12')]===0x1f4){logger[_0x88b8('0x13')](_0x88b8('0xe'),_0x2e4b69,_0x58a205[_0x88b8('0x13')]['message']);return _0xe142ee(_0x58a205['error'][_0x88b8('0x14')]);}logger['error'](_0x88b8('0xe'),_0x2e4b69,_0x58a205[_0x88b8('0x13')]['message']);return _0x4d0928(_0x58a205[_0x88b8('0x13')][_0x88b8('0x14')]);}else{logger[_0x88b8('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2e4b69,'request\x20sent');_0x4d0928(_0x58a205[_0x88b8('0x15')]['message']);}})[_0x88b8('0x16')](function(_0x358a80){logger[_0x88b8('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2e4b69,_0x358a80);_0xe142ee(_0x358a80);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index f97fcea..08a915f 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 _0x48c1=['download','/:id/downloads','downloads','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download'];(function(_0x36756f,_0x4fb7cc){var _0x2259aa=function(_0x1952af){while(--_0x1952af){_0x36756f['push'](_0x36756f['shift']());}};_0x2259aa(++_0x4fb7cc);}(_0x48c1,0x16b));var _0x148c=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x48c1[_0x257b0e];return _0x27ac2a;};'use strict';var multer=require(_0x148c('0x0'));var util=require(_0x148c('0x1'));var path=require(_0x148c('0x2'));var timeout=require(_0x148c('0x3'));var express=require(_0x148c('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x148c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x148c('0x6'));router[_0x148c('0x7')]('/',auth[_0x148c('0x8')](),controller[_0x148c('0x9')]);router[_0x148c('0x7')](_0x148c('0xa'),auth[_0x148c('0x8')](),controller[_0x148c('0xb')]);router[_0x148c('0x7')](_0x148c('0xc'),auth['isAuthenticated'](),controller[_0x148c('0xd')]);router[_0x148c('0x7')](_0x148c('0xe'),auth[_0x148c('0x8')](),controller[_0x148c('0xf')]);router[_0x148c('0x7')](_0x148c('0x10'),controller[_0x148c('0x11')]);router[_0x148c('0x7')]('/:id/transcribe',auth[_0x148c('0x8')](),controller[_0x148c('0x12')]);router[_0x148c('0x13')]('/',auth['isAuthenticated'](),controller[_0x148c('0x14')]);router[_0x148c('0x13')]('/:id/transcribe',auth[_0x148c('0x8')](),controller[_0x148c('0x15')]);router[_0x148c('0x16')](_0x148c('0xc'),auth[_0x148c('0x8')](),controller[_0x148c('0x17')]);router[_0x148c('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x148c('0x19')]);module[_0x148c('0x1a')]=router; \ No newline at end of file +var _0xf70a=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','update','delete','destroy','exports','multer','util'];(function(_0x1e0c1d,_0x574e01){var _0x27735e=function(_0x48e3d0){while(--_0x48e3d0){_0x1e0c1d['push'](_0x1e0c1d['shift']());}};_0x27735e(++_0x574e01);}(_0xf70a,0xdf));var _0xaf70=function(_0x2c4d22,_0x4ca120){_0x2c4d22=_0x2c4d22-0x0;var _0x1f0537=_0xf70a[_0x2c4d22];return _0x1f0537;};'use strict';var multer=require(_0xaf70('0x0'));var util=require(_0xaf70('0x1'));var path=require(_0xaf70('0x2'));var timeout=require(_0xaf70('0x3'));var express=require('express');var router=express[_0xaf70('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaf70('0x5'));var config=require(_0xaf70('0x6'));var controller=require('./voiceRecording.controller');router[_0xaf70('0x7')]('/',auth[_0xaf70('0x8')](),controller[_0xaf70('0x9')]);router[_0xaf70('0x7')]('/describe',auth[_0xaf70('0x8')](),controller['describe']);router['get'](_0xaf70('0xa'),auth[_0xaf70('0x8')](),controller[_0xaf70('0xb')]);router[_0xaf70('0x7')](_0xaf70('0xc'),auth[_0xaf70('0x8')](),controller[_0xaf70('0xd')]);router[_0xaf70('0x7')](_0xaf70('0xe'),controller[_0xaf70('0xf')]);router['get']('/:id/transcribe',auth[_0xaf70('0x8')](),controller[_0xaf70('0x10')]);router[_0xaf70('0x11')]('/',auth[_0xaf70('0x8')](),controller[_0xaf70('0x12')]);router[_0xaf70('0x11')](_0xaf70('0x13'),auth['isAuthenticated'](),controller[_0xaf70('0x14')]);router['put'](_0xaf70('0xa'),auth[_0xaf70('0x8')](),controller[_0xaf70('0x15')]);router[_0xaf70('0x16')](_0xaf70('0xa'),auth[_0xaf70('0x8')](),controller[_0xaf70('0x17')]);module[_0xaf70('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 6e5e0e9..d11fe30 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(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 f7130d0..1cce8e9 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 _0x23b6=['status','set','Content-Range','apply','save','update','then','error','stack','name','send','map','VoiceRecording','fieldName','type','key','model','format','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','secrets','existsSync','Sequelize','VoiceRecording\x20not\x20found','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','recording','ValidationError','destroy','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','data2','Cloud\x20Provider\x20not\x20configured','data1','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','root','/server/files/transcribes/transcribe_','.txt','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x23b6,0x1af));var _0x623b=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x23b6[_0x4d07cc];return _0x42de3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x623b('0x0'));var zipdir=require(_0x623b('0x1'));var jsonpatch=require(_0x623b('0x2'));var rp=require(_0x623b('0x3'));var moment=require('moment');var BPromise=require(_0x623b('0x4'));var Mustache=require(_0x623b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x623b('0x6'));var csv=require(_0x623b('0x7'));var ejs=require(_0x623b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x623b('0x9'));var squel=require(_0x623b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x623b('0xb'));var toCsv=require(_0x623b('0x7'));var querystring=require(_0x623b('0xc'));var Papa=require(_0x623b('0xd'));var AWS=require(_0x623b('0xe'));var uuidv4=require('uuid/v4');var Redis=require(_0x623b('0xf'));var authService=require(_0x623b('0x10'));var qs=require(_0x623b('0x11'));var as=require(_0x623b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x623b('0x13'));var utils=require(_0x623b('0x14'));var config=require(_0x623b('0x15'));var licenseUtil=require(_0x623b('0x16'));var db=require(_0x623b('0x17'))['db'];function respondWithStatusCode(_0x38c246,_0x1d0e6a){_0x1d0e6a=_0x1d0e6a||0xcc;return function(_0x3187ad){if(_0x3187ad){return _0x38c246[_0x623b('0x18')](_0x1d0e6a);}return _0x38c246['status'](_0x1d0e6a)[_0x623b('0x19')]();};}function respondWithResult(_0x1cb567,_0xa1fdad){_0xa1fdad=_0xa1fdad||0xc8;return function(_0x286880){if(_0x286880){return _0x1cb567['status'](_0xa1fdad)[_0x623b('0x1a')](_0x286880);}};}function respondWithFilteredResult(_0x4c432f,_0x55f143){return function(_0x2d4661){if(_0x2d4661){var _0x56166f=typeof _0x55f143[_0x623b('0x1b')]==='undefined'&&typeof _0x55f143[_0x623b('0x1c')]===_0x623b('0x1d');var _0xa74229=_0x2d4661[_0x623b('0x1e')];var _0x339a46=_0x56166f?0x0:_0x55f143[_0x623b('0x1b')];var _0x4ee213=_0x56166f?_0x2d4661[_0x623b('0x1e')]:_0x55f143[_0x623b('0x1b')]+_0x55f143[_0x623b('0x1c')];var _0x30e047;if(_0x4ee213>=_0xa74229){_0x4ee213=_0xa74229;_0x30e047=0xc8;}else{_0x30e047=0xce;}_0x4c432f[_0x623b('0x1f')](_0x30e047);return _0x4c432f[_0x623b('0x20')](_0x623b('0x21'),_0x339a46+'-'+_0x4ee213+'/'+_0xa74229)[_0x623b('0x1a')](_0x2d4661);}return null;};}function patchUpdates(_0x4e879e){return function(_0x3f9630){try{jsonpatch[_0x623b('0x22')](_0x3f9630,_0x4e879e,!![]);}catch(_0x3b14b5){return BPromise['reject'](_0x3b14b5);}return _0x3f9630[_0x623b('0x23')]();};}function saveUpdates(_0x3b0b05,_0xcc3cfb){return function(_0x3dddf0){if(_0x3dddf0){return _0x3dddf0[_0x623b('0x24')](_0x3b0b05)[_0x623b('0x25')](function(_0x18aae6){return _0x18aae6;});}return null;};}function removeEntity(_0x40658c,_0x4a2fc6){return function(_0x58f9bf){if(_0x58f9bf){return _0x58f9bf['destroy']()[_0x623b('0x25')](function(){_0x40658c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x120bb2,_0x50355b){return function(_0x5edb23){if(!_0x5edb23){_0x120bb2[_0x623b('0x18')](0x194);}return _0x5edb23;};}function handleError(_0x373fac,_0x5b11a6){_0x5b11a6=_0x5b11a6||0x1f4;return function(_0x3b3364){logger[_0x623b('0x26')](_0x3b3364[_0x623b('0x27')]);if(_0x3b3364[_0x623b('0x28')]){delete _0x3b3364['name'];}_0x373fac[_0x623b('0x1f')](_0x5b11a6)[_0x623b('0x29')](_0x3b3364);};}exports['index']=function(_0x438b3a,_0xa32af7){var _0x3822b9={},_0x442eef={},_0x1288bf={'count':0x0,'rows':[]};var _0x17bd23=_[_0x623b('0x2a')](db[_0x623b('0x2b')]['rawAttributes'],function(_0x4e1753){return{'name':_0x4e1753[_0x623b('0x2c')],'type':_0x4e1753[_0x623b('0x2d')][_0x623b('0x2e')]};});_0x442eef[_0x623b('0x2f')]=_['differenceBy'](_[_0x623b('0x2a')](_0x17bd23,_0x623b('0x28')),[_0x623b('0x30')]);_0x442eef[_0x623b('0x31')]=_['keys'](_0x438b3a[_0x623b('0x31')]);_0x442eef[_0x623b('0x32')]=_[_0x623b('0x33')](_0x442eef['model'],_0x442eef[_0x623b('0x31')]);_0x3822b9[_0x623b('0x34')]=_['intersection'](_0x442eef[_0x623b('0x2f')],qs['fields'](_0x438b3a[_0x623b('0x31')][_0x623b('0x35')]));_0x3822b9['attributes']=_0x3822b9[_0x623b('0x34')][_0x623b('0x36')]?_0x3822b9['attributes']:_0x442eef[_0x623b('0x2f')];if(!_0x438b3a[_0x623b('0x31')]['hasOwnProperty'](_0x623b('0x37'))){_0x3822b9[_0x623b('0x1c')]=qs[_0x623b('0x1c')](_0x438b3a['query'][_0x623b('0x1c')]);_0x3822b9['offset']=qs[_0x623b('0x1b')](_0x438b3a['query']['offset']);}_0x3822b9[_0x623b('0x38')]=qs[_0x623b('0x39')](_0x438b3a[_0x623b('0x31')]['sort']);_0x3822b9[_0x623b('0x3a')]=qs['filters'](_[_0x623b('0x3b')](_0x438b3a['query'],_0x442eef['filters']),_0x17bd23);if(_0x438b3a[_0x623b('0x31')][_0x623b('0x3c')]){_0x3822b9[_0x623b('0x3a')]=_[_0x623b('0x3d')](_0x3822b9[_0x623b('0x3a')],{'$or':_[_0x623b('0x2a')](_0x17bd23,function(_0x5bd65e){if(_0x5bd65e[_0x623b('0x2d')]!==_0x623b('0x3e')){var _0x52f255={};_0x52f255[_0x5bd65e[_0x623b('0x28')]]={'$like':'%'+_0x438b3a['query'][_0x623b('0x3c')]+'%'};return _0x52f255;}})});}_0x3822b9=_[_0x623b('0x3d')]({},_0x3822b9,_0x438b3a[_0x623b('0x3f')]);var _0x463a97={'where':_0x3822b9[_0x623b('0x3a')]};return db[_0x623b('0x2b')][_0x623b('0x1e')](_0x463a97)[_0x623b('0x25')](function(_0x2cbfe5){_0x1288bf[_0x623b('0x1e')]=_0x2cbfe5;if(_0x438b3a[_0x623b('0x31')][_0x623b('0x40')]){_0x3822b9[_0x623b('0x41')]=[{'all':!![]}];}return db[_0x623b('0x2b')][_0x623b('0x42')](_0x3822b9);})[_0x623b('0x25')](function(_0x9aaf8){_0x1288bf['rows']=_0x9aaf8;return _0x1288bf;})[_0x623b('0x25')](respondWithFilteredResult(_0xa32af7,_0x3822b9))['catch'](handleError(_0xa32af7,null));};exports[_0x623b('0x43')]=function(_0x351400,_0x47db28){var _0x3d2163={'raw':![],'where':{'id':_0x351400[_0x623b('0x44')]['id']}},_0x27cc5a={};_0x27cc5a[_0x623b('0x2f')]=_[_0x623b('0x45')](db[_0x623b('0x2b')][_0x623b('0x46')]);_0x27cc5a[_0x623b('0x31')]=_[_0x623b('0x45')](_0x351400['query']);_0x27cc5a[_0x623b('0x32')]=_[_0x623b('0x33')](_0x27cc5a[_0x623b('0x2f')],_0x27cc5a[_0x623b('0x31')]);_0x3d2163[_0x623b('0x34')]=_[_0x623b('0x33')](_0x27cc5a[_0x623b('0x2f')],qs[_0x623b('0x35')](_0x351400['query']['fields']));_0x3d2163[_0x623b('0x34')]=_0x3d2163['attributes']['length']?_0x3d2163[_0x623b('0x34')]:_0x27cc5a[_0x623b('0x2f')];if(_0x351400[_0x623b('0x31')]['includeAll']){_0x3d2163[_0x623b('0x41')]=[{'all':!![]}];}_0x3d2163=_[_0x623b('0x3d')]({},_0x3d2163,_0x351400[_0x623b('0x3f')]);return db[_0x623b('0x2b')][_0x623b('0x47')](_0x3d2163)[_0x623b('0x25')](handleEntityNotFound(_0x47db28,null))[_0x623b('0x25')](respondWithResult(_0x47db28,null))[_0x623b('0x48')](handleError(_0x47db28,null));};exports['create']=function(_0x2a3221,_0xf8c14){return db[_0x623b('0x2b')][_0x623b('0x49')](_0x2a3221[_0x623b('0x4a')],{})[_0x623b('0x25')](respondWithResult(_0xf8c14,0xc9))['catch'](handleError(_0xf8c14,null));};exports['update']=function(_0x29d439,_0x1fc3dc){if(_0x29d439[_0x623b('0x4a')]['id']){delete _0x29d439[_0x623b('0x4a')]['id'];}return db[_0x623b('0x2b')]['find']({'where':{'id':_0x29d439[_0x623b('0x44')]['id']}})[_0x623b('0x25')](handleEntityNotFound(_0x1fc3dc,null))[_0x623b('0x25')](saveUpdates(_0x29d439['body'],null))[_0x623b('0x25')](respondWithResult(_0x1fc3dc,null))[_0x623b('0x48')](handleError(_0x1fc3dc,null));};exports[_0x623b('0x4b')]=function(_0x2e4488,_0x24f7db){return db[_0x623b('0x2b')][_0x623b('0x4b')]()['then'](respondWithResult(_0x24f7db,null))['catch'](handleError(_0x24f7db,null));};exports[_0x623b('0x4c')]=function(_0x3c79e1,_0x173ca6,_0x554a64){var _0x3f3b3b=require(_0x623b('0x4d'));var _0x1d5ce5=![];var _0x321e1d={};if(_0x3c79e1[_0x623b('0x31')][_0x623b('0x2d')]&&_0x3c79e1[_0x623b('0x31')][_0x623b('0x2d')]===_0x623b('0x4e')){_0x321e1d[_0x623b('0x4e')]=_0x3c79e1[_0x623b('0x44')]['id'];}else{_0x321e1d['id']=_0x3c79e1[_0x623b('0x44')]['id'];}return db[_0x623b('0x2b')][_0x623b('0x47')]({'where':_0x321e1d,'attributes':['id','value'],'raw':!![]})[_0x623b('0x25')](handleEntityNotFound(_0x173ca6,null))['then'](function(_0x4ffe6b){if(_0x4ffe6b){var _0x3e0f69=_0x4ffe6b[_0x623b('0x4f')];var _0x36593b=util[_0x623b('0x30')](_0x623b('0x50'),_0x3e0f69);if(fs['existsSync'](_0x36593b)){_0x1d5ce5=!![];return _0x3f3b3b[_0x623b('0x51')](_0x36593b,_0x3e0f69,config[_0x623b('0x52')]['recording'])[_0x623b('0x25')](function(){return _0x4ffe6b;});}return _0x4ffe6b;}})[_0x623b('0x25')](function(_0xc956fa){if(_0xc956fa){var _0x1f8272=_0xc956fa[_0x623b('0x4f')];if(!fs[_0x623b('0x53')](_0x1f8272)){throw new db[(_0x623b('0x54'))]['ValidationError'](_0x623b('0x55'));}if(_0xc956fa['filename']){return _0x173ca6[_0x623b('0x4c')](_0x1f8272,_0xc956fa[_0x623b('0x56')]+path['extname'](_0x1f8272),function(){if(_0x1d5ce5){fs[_0x623b('0x57')](_0x1f8272);}});}else{return _0x173ca6['download'](_0x1f8272,function(_0x37cf21){if(_0x1d5ce5){fs['unlink'](_0x1f8272);}});}}})[_0x623b('0x48')](function(_0x3bff18){if(_0x3bff18[_0x623b('0x58')]===_0x623b('0x55')){_0x173ca6[_0x623b('0x1f')](0x194)['send'](_0x623b('0x59'));}else{return handleError(_0x173ca6,null);}});};exports[_0x623b('0x5a')]=function(_0x3241d8,_0xb8a7a0,_0x2bda01){var _0x5519b1=require(_0x623b('0x4d'));var _0x284a24=![];var _0x3eae31={'$and':[db['sequelize']['where'](db[_0x623b('0x5b')]['fn'](_0x623b('0x5c'),db[_0x623b('0x5b')][_0x623b('0x5d')](_0x623b('0x4e'))),_0x3241d8[_0x623b('0x31')][_0x623b('0x5e')])]};if(_0x3241d8[_0x623b('0x31')]['type']&&_0x3241d8[_0x623b('0x31')][_0x623b('0x2d')]===_0x623b('0x4e')){_0x3eae31[_0x623b('0x5f')][_0x623b('0x60')]({'uniqueid':_0x3241d8[_0x623b('0x44')]['id']});}else{_0x3eae31[_0x623b('0x5f')]['push']({'id':_0x3241d8[_0x623b('0x44')]['id']});}return db[_0x623b('0x2b')][_0x623b('0x47')]({'where':_0x3eae31,'attributes':['id',_0x623b('0x4f')],'raw':!![]})[_0x623b('0x25')](handleEntityNotFound(_0xb8a7a0,null))['then'](function(_0x1a8c1b){if(_0x1a8c1b){var _0x4d0767=util[_0x623b('0x30')](_0x623b('0x50'),_0x1a8c1b[_0x623b('0x4f')]);if(fs[_0x623b('0x53')](_0x4d0767)){_0x284a24=!![];return _0x5519b1['decryptFile'](_0x4d0767,_0x1a8c1b[_0x623b('0x4f')],config[_0x623b('0x52')][_0x623b('0x61')])[_0x623b('0x25')](function(){return _0x1a8c1b;});}return _0x1a8c1b;}})[_0x623b('0x25')](function(_0x28fdae){if(_0x28fdae){if(!fs[_0x623b('0x53')](_0x28fdae[_0x623b('0x4f')])){throw new db[(_0x623b('0x54'))][(_0x623b('0x62'))](_0x623b('0x55'));}if(_0x28fdae['filename']){return _0xb8a7a0[_0x623b('0x4c')](_0x28fdae[_0x623b('0x4f')],_0x28fdae[_0x623b('0x56')]+path['extname'](_0x28fdae['value']),function(){if(_0x284a24){fs['unlink'](_0x28fdae[_0x623b('0x4f')]);}});}else{return _0xb8a7a0[_0x623b('0x4c')](_0x28fdae['value'],function(_0x4bf7fe){if(_0x284a24){fs[_0x623b('0x57')](_0x28fdae[_0x623b('0x4f')]);}});}}})['catch'](handleError(_0xb8a7a0,null));};exports[_0x623b('0x63')]=function(_0x5d4d50,_0x4871de){return db[_0x623b('0x2b')][_0x623b('0x47')]({'where':{'id':_0x5d4d50[_0x623b('0x44')]['id']}})[_0x623b('0x25')](function(_0x18fdb8){if(_[_0x623b('0x64')](_0x18fdb8)){throw new ReferenceError(_0x623b('0x65'));}return _0x18fdb8;})[_0x623b('0x25')](function(_0x478650){var _0x58f82c=_0x478650['value'];logger[_0x623b('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x58f82c);if(!_[_0x623b('0x64')](_0x478650['value'])&&fs[_0x623b('0x53')](_0x58f82c)){logger['info'](_0x623b('0x67')+_0x58f82c+_0x623b('0x68'));fs[_0x623b('0x69')](_0x58f82c);}_0x58f82c=_0x58f82c+_0x623b('0x6a');if(!_[_0x623b('0x64')](_0x478650[_0x623b('0x4f')])&&fs[_0x623b('0x53')](_0x58f82c)){logger['info']('File:\x20\x22'+_0x58f82c+_0x623b('0x68'));fs[_0x623b('0x69')](_0x58f82c);}return _0x478650;})[_0x623b('0x25')](function(_0x2683bf){if(!_0x2683bf)throw new InternalError();return _0x2683bf['destroy']();})['then'](function(){_0x4871de[_0x623b('0x1f')](0xcc)[_0x623b('0x19')]();})[_0x623b('0x48')](handleError(_0x4871de,null));};function getBucketslist(_0x39da7f,_0x79477f,_0x551e4f){return new Promise(function(_0x1805cf,_0x3b5878){var _0x7f8914=new AWS['S3']({'accessKeyId':_0x79477f,'secretAccessKey':_0x39da7f,'region':_0x551e4f});_0x7f8914[_0x623b('0x6b')]({},function(_0x355a54,_0x5b4261){if(_0x355a54){return _0x3b5878(_0x355a54);}else{return _0x1805cf(_0x5b4261);}});});}function createBucket(_0x329864,_0x59523d,_0x39eb60,_0x55d0ba){return new Promise(function(_0x2cb750,_0x26e039){var _0x4a3e40=new AWS['S3']({'accessKeyId':_0x59523d,'secretAccessKey':_0x329864,'region':_0x39eb60});_0x4a3e40[_0x623b('0x6c')]({'Bucket':_0x55d0ba},function(_0x1261c5,_0x19f31a){if(_0x1261c5){return _0x26e039(_0x1261c5);}else{return _0x2cb750(_0x19f31a);}});});}function uploadFile(_0x215a7d,_0x4472c9,_0x3b2ddd,_0x106932,_0x94a591,_0x3a424d){return new Promise(function(_0x13587f,_0x470d4c){var _0x11f498=new AWS['S3']({'accessKeyId':_0x4472c9,'secretAccessKey':_0x215a7d,'region':_0x3b2ddd});_0x11f498[_0x623b('0x6d')]({'Bucket':_0x106932,'Key':_0x94a591,'Body':_0x3a424d},function(_0x326a36,_0x386176){if(_0x326a36){return _0x470d4c(_0x326a36);}else{return _0x13587f(_0x386176);}});});}function startTranscribe(_0x56fc09,_0x1b508e,_0x262d7f,_0x2224d0,_0x4e2609,_0x2d64c2){return new Promise(function(_0x1c8f17,_0x30fd8b){var _0x9523c3=new AWS[(_0x623b('0x6e'))]({'accessKeyId':_0x1b508e,'secretAccessKey':_0x56fc09,'region':_0x262d7f});_0x9523c3[_0x623b('0x6f')]({'TranscriptionJobName':_0x2224d0,'LanguageCode':_0x4e2609,'Media':{'MediaFileUri':_0x2d64c2}},function(_0x39fbfb,_0x2112b7){if(_0x39fbfb){return _0x30fd8b(_0x39fbfb);}else{return _0x1c8f17(_0x2112b7);}});});}function transcribe(_0x4a26dd,_0xc96055,_0x5706e5,_0x41a7d5,_0x4d6974,_0x59f46c,_0x56ee62){return new Promise(function(_0x5aa4f1,_0x20aba9){var _0x4a5586={};logger[_0x623b('0x66')](util[_0x623b('0x30')](_0x623b('0x70'),_0x4a26dd,_0x4d6974));return uploadFile(_0xc96055,_0x5706e5,_0x41a7d5,_0x4d6974,path[_0x623b('0x71')](_0x59f46c),fs[_0x623b('0x72')](_0x59f46c))['then'](function(_0x5e81f8){logger[_0x623b('0x66')](util[_0x623b('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x4a26dd,_0x4d6974,_0x5e81f8[_0x623b('0x73')]));_0x4a5586[_0x623b('0x74')]=_0x5e81f8[_0x623b('0x75')];_0x4a5586['location']=_0x5e81f8['Location'];logger['info'](util[_0x623b('0x30')](_0x623b('0x76'),_0x4a26dd));return startTranscribe(_0xc96055,_0x5706e5,_0x41a7d5,uuidv4(),_0x56ee62,_0x5e81f8[_0x623b('0x73')]);})['then'](function(_0x29061f){logger[_0x623b('0x66')](util[_0x623b('0x30')](_0x623b('0x77'),_0x4a26dd,_0x29061f[_0x623b('0x78')][_0x623b('0x79')]));_0x4a5586[_0x623b('0x7a')]=_0x29061f[_0x623b('0x78')]['TranscriptionJobName'];_0x4a5586[_0x623b('0x7b')]=_0x29061f[_0x623b('0x78')][_0x623b('0x7c')];return _0x5aa4f1(_0x4a5586);})[_0x623b('0x48')](function(_0x382f8a){return _0x20aba9(_0x382f8a);});});}exports[_0x623b('0x7d')]=function(_0x4bfca5,_0x3056fb,_0x1bd9fa){var _0x526f7e;var _0x416b33;var _0x4b3fc9;var _0x25c4fe=require('../../components/encryptor');return db['VoiceRecording'][_0x623b('0x7e')]({'where':{'id':_0x4bfca5[_0x623b('0x44')]['id']}})[_0x623b('0x25')](function(_0x4a84b2){if(_0x4a84b2){var _0x17198a=util[_0x623b('0x30')](_0x623b('0x50'),_0x4a84b2[_0x623b('0x4f')]);if(fs[_0x623b('0x53')](_0x17198a)){cypher=!![];return _0x25c4fe[_0x623b('0x51')](_0x17198a,_0x4a84b2[_0x623b('0x4f')],config[_0x623b('0x52')]['recording'])[_0x623b('0x25')](function(){return _0x4a84b2;});}return _0x4a84b2;}})['then'](function(_0x5121c0){if(!_0x5121c0){throw new db[(_0x623b('0x54'))][(_0x623b('0x62'))](_0x623b('0x7f'));}_0x416b33=_0x5121c0;return db[_0x623b('0x80')][_0x623b('0x7e')]({'where':{'id':0x1}});})[_0x623b('0x25')](handleEntityNotFound(_0x3056fb,null))[_0x623b('0x25')](function(_0xfd7bba){if(_0xfd7bba){_0x526f7e=_0xfd7bba;if(!_0x526f7e[_0x623b('0x81')]||!_0x526f7e[_0x623b('0x82')]||!_0x526f7e['transcribeRegion']||!_0x526f7e[_0x623b('0x83')]||!_0x526f7e[_0x623b('0x74')]){throw new db[(_0x623b('0x54'))]['ValidationError'](_0x623b('0x84'));}if(_0x4bfca5[_0x623b('0x4a')][_0x623b('0x85')]&&(!_0x526f7e['sentiment']||!_0x526f7e[_0x623b('0x86')]||!_0x526f7e[_0x623b('0x87')]||!_0x526f7e[_0x623b('0x83')]||!_0x526f7e[_0x623b('0x74')])){throw new db[(_0x623b('0x54'))][(_0x623b('0x62'))](_0x623b('0x88'));}return db[_0x623b('0x89')][_0x623b('0x7e')]({'where':{'id':_0x526f7e[_0x623b('0x82')]}});}})[_0x623b('0x25')](function(_0x54910c){if(!_0x54910c){throw new db[(_0x623b('0x54'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x54910c['data1']||!_0x54910c[_0x623b('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x623b('0x8b'));}_0x4b3fc9=_0x54910c;return getBucketslist(_0x4b3fc9[_0x623b('0x8c')],_0x4b3fc9[_0x623b('0x8a')],_0x526f7e[_0x623b('0x8d')]);})[_0x623b('0x25')](function(_0x448fa0){if(_0x448fa0&&_0x448fa0[_0x623b('0x8e')]){var _0x280bd8=_[_0x623b('0x47')](_0x448fa0[_0x623b('0x8e')],function(_0x355ea9){return _0x355ea9[_0x623b('0x8f')]===_0x526f7e[_0x623b('0x74')];});if(!_0x280bd8){logger['info'](util[_0x623b('0x30')](_0x623b('0x90'),_0x4bfca5[_0x623b('0x44')]['id'],_0x526f7e[_0x623b('0x74')]));return createBucket(_0x4b3fc9['data1'],_0x4b3fc9[_0x623b('0x8a')],_0x526f7e[_0x623b('0x8d')],_0x526f7e[_0x623b('0x74')]);}logger[_0x623b('0x66')](util[_0x623b('0x30')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x4bfca5[_0x623b('0x44')]['id'],_0x526f7e['bucket']));return;}})['then'](function(_0x3483f6){if(_0x416b33[_0x623b('0x7b')]===_0x623b('0x91')){return transcribe(_0x4bfca5[_0x623b('0x44')]['id'],_0x4b3fc9['data1'],_0x4b3fc9[_0x623b('0x8a')],_0x526f7e['transcribeRegion'],_0x526f7e[_0x623b('0x74')],_0x416b33[_0x623b('0x4f')],_0x526f7e['language']);}else{logger[_0x623b('0x66')](util[_0x623b('0x30')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x4bfca5['params']['id']));return{'transcribeStatus':_0x623b('0x92')};}})[_0x623b('0x25')](function(_0x34af5c){if(_0x34af5c){_0x34af5c[_0x623b('0x93')]=_0x4bfca5[_0x623b('0x4a')][_0x623b('0x85')];return _0x416b33[_0x623b('0x94')](_0x34af5c);}})['then'](respondWithResult(_0x3056fb,null))['catch'](handleError(_0x3056fb,null));};function writeFile(_0x2c9e79,_0x3c4c5f){return new Promise(function(_0x42b0ab,_0x387787){fs[_0x623b('0x95')](_0x3c4c5f,_0x2c9e79,function(_0xc6361b,_0x52cd32){if(_0xc6361b){return _0x387787(_0xc6361b);}else{return _0x42b0ab(_0x52cd32);}});});}exports[_0x623b('0x96')]=function(_0xdbfb76,_0x179536,_0x53dfd2){return db['VoiceRecording'][_0x623b('0x7e')]({'where':{'id':_0xdbfb76[_0x623b('0x44')]['id']}})[_0x623b('0x25')](handleEntityNotFound(_0x179536))[_0x623b('0x25')](function(_0x5a3275){if(_0x5a3275&&_0x5a3275['fileText']){var _0x22c337=_0x5a3275['fileText'];var _0x5e2cde=config[_0x623b('0x97')]+_0x623b('0x98')+_0x5a3275['id']+_0x623b('0x99');if(fs[_0x623b('0x53')](_0x5e2cde)){return _0x5e2cde;}return writeFile(_0x22c337,_0x5e2cde)[_0x623b('0x25')](function(){return _0x5e2cde;});}else{throw new db[(_0x623b('0x54'))][(_0x623b('0x62'))]('Transcript\x20not\x20available');}})[_0x623b('0x25')](function(_0x2b0a58){return _0x179536['download'](_0x2b0a58);})[_0x623b('0x48')](handleError(_0x179536));}; \ No newline at end of file +var _0xa790=['VoiceRecording','rawAttributes','fieldName','type','differenceBy','map','format','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','value','existsSync','decryptFile','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','end','sendStatus','error','stack','name','send','index'];(function(_0x4a51c3,_0x115fb4){var _0x449971=function(_0x32ed9a){while(--_0x32ed9a){_0x4a51c3['push'](_0x4a51c3['shift']());}};_0x449971(++_0x115fb4);}(_0xa790,0x107));var _0x0a79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa790[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x0a79('0x0'));var rimraf=require(_0x0a79('0x1'));var zipdir=require(_0x0a79('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a79('0x3'));var moment=require('moment');var BPromise=require(_0x0a79('0x4'));var Mustache=require(_0x0a79('0x5'));var util=require(_0x0a79('0x6'));var path=require(_0x0a79('0x7'));var sox=require('sox');var csv=require(_0x0a79('0x8'));var ejs=require(_0x0a79('0x9'));var fs=require('fs');var fs_extra=require(_0x0a79('0xa'));var _=require('lodash');var squel=require(_0x0a79('0xb'));var crypto=require(_0x0a79('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x0a79('0xd'));var toCsv=require(_0x0a79('0x8'));var querystring=require(_0x0a79('0xe'));var Papa=require('papaparse');var AWS=require(_0x0a79('0xf'));var uuidv4=require(_0x0a79('0x10'));var Redis=require('ioredis');var authService=require(_0x0a79('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0a79('0x12'));var hardwareService=require(_0x0a79('0x13'));var logger=require(_0x0a79('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x0a79('0x15'));var licenseUtil=require(_0x0a79('0x16'));var db=require(_0x0a79('0x17'))['db'];function respondWithStatusCode(_0x389bb4,_0x6248b4){_0x6248b4=_0x6248b4||0xcc;return function(_0x42e1c8){if(_0x42e1c8){return _0x389bb4['sendStatus'](_0x6248b4);}return _0x389bb4[_0x0a79('0x18')](_0x6248b4)['end']();};}function respondWithResult(_0x2b9f96,_0x3316dd){_0x3316dd=_0x3316dd||0xc8;return function(_0x2b9a5d){if(_0x2b9a5d){return _0x2b9f96[_0x0a79('0x18')](_0x3316dd)[_0x0a79('0x19')](_0x2b9a5d);}};}function respondWithFilteredResult(_0x26bd3c,_0x1f8cd0){return function(_0x29439e){if(_0x29439e){var _0x54a287=typeof _0x1f8cd0[_0x0a79('0x1a')]===_0x0a79('0x1b')&&typeof _0x1f8cd0[_0x0a79('0x1c')]===_0x0a79('0x1b');var _0x2150b8=_0x29439e[_0x0a79('0x1d')];var _0x545cf5=_0x54a287?0x0:_0x1f8cd0[_0x0a79('0x1a')];var _0xf9fa0c=_0x54a287?_0x29439e[_0x0a79('0x1d')]:_0x1f8cd0[_0x0a79('0x1a')]+_0x1f8cd0[_0x0a79('0x1c')];var _0xb4d44c;if(_0xf9fa0c>=_0x2150b8){_0xf9fa0c=_0x2150b8;_0xb4d44c=0xc8;}else{_0xb4d44c=0xce;}_0x26bd3c[_0x0a79('0x18')](_0xb4d44c);return _0x26bd3c[_0x0a79('0x1e')]('Content-Range',_0x545cf5+'-'+_0xf9fa0c+'/'+_0x2150b8)[_0x0a79('0x19')](_0x29439e);}return null;};}function patchUpdates(_0xd4823b){return function(_0x5395b1){try{jsonpatch[_0x0a79('0x1f')](_0x5395b1,_0xd4823b,!![]);}catch(_0x4a383d){return BPromise['reject'](_0x4a383d);}return _0x5395b1[_0x0a79('0x20')]();};}function saveUpdates(_0x15f4aa,_0x4705a7){return function(_0xac5bc1){if(_0xac5bc1){return _0xac5bc1[_0x0a79('0x21')](_0x15f4aa)['then'](function(_0x519ce7){return _0x519ce7;});}return null;};}function removeEntity(_0x1ccc08,_0x2900cb){return function(_0x2d1688){if(_0x2d1688){return _0x2d1688[_0x0a79('0x22')]()[_0x0a79('0x23')](function(){_0x1ccc08['status'](0xcc)[_0x0a79('0x24')]();});}};}function handleEntityNotFound(_0x45d199,_0x5e79dd){return function(_0xbad425){if(!_0xbad425){_0x45d199[_0x0a79('0x25')](0x194);}return _0xbad425;};}function handleError(_0x11610c,_0xdbb697){_0xdbb697=_0xdbb697||0x1f4;return function(_0x196d06){logger[_0x0a79('0x26')](_0x196d06[_0x0a79('0x27')]);if(_0x196d06['name']){delete _0x196d06[_0x0a79('0x28')];}_0x11610c['status'](_0xdbb697)[_0x0a79('0x29')](_0x196d06);};}exports[_0x0a79('0x2a')]=function(_0x1c058d,_0x4020bf){var _0x2f1b2a={},_0x4a9ba1={},_0x182c98={'count':0x0,'rows':[]};var _0x91f14c=_['map'](db[_0x0a79('0x2b')][_0x0a79('0x2c')],function(_0x1bab61){return{'name':_0x1bab61[_0x0a79('0x2d')],'type':_0x1bab61[_0x0a79('0x2e')]['key']};});_0x4a9ba1['model']=_[_0x0a79('0x2f')](_[_0x0a79('0x30')](_0x91f14c,_0x0a79('0x28')),[_0x0a79('0x31')]);_0x4a9ba1[_0x0a79('0x32')]=_[_0x0a79('0x33')](_0x1c058d[_0x0a79('0x32')]);_0x4a9ba1['filters']=_[_0x0a79('0x34')](_0x4a9ba1[_0x0a79('0x35')],_0x4a9ba1[_0x0a79('0x32')]);_0x2f1b2a['attributes']=_['intersection'](_0x4a9ba1[_0x0a79('0x35')],qs[_0x0a79('0x36')](_0x1c058d[_0x0a79('0x32')][_0x0a79('0x36')]));_0x2f1b2a[_0x0a79('0x37')]=_0x2f1b2a['attributes'][_0x0a79('0x38')]?_0x2f1b2a[_0x0a79('0x37')]:_0x4a9ba1[_0x0a79('0x35')];if(!_0x1c058d[_0x0a79('0x32')]['hasOwnProperty'](_0x0a79('0x39'))){_0x2f1b2a[_0x0a79('0x1c')]=qs['limit'](_0x1c058d[_0x0a79('0x32')][_0x0a79('0x1c')]);_0x2f1b2a[_0x0a79('0x1a')]=qs[_0x0a79('0x1a')](_0x1c058d[_0x0a79('0x32')]['offset']);}_0x2f1b2a[_0x0a79('0x3a')]=qs[_0x0a79('0x3b')](_0x1c058d['query'][_0x0a79('0x3b')]);_0x2f1b2a[_0x0a79('0x3c')]=qs['filters'](_[_0x0a79('0x3d')](_0x1c058d[_0x0a79('0x32')],_0x4a9ba1[_0x0a79('0x3e')]),_0x91f14c);if(_0x1c058d[_0x0a79('0x32')]['filter']){_0x2f1b2a['where']=_[_0x0a79('0x3f')](_0x2f1b2a[_0x0a79('0x3c')],{'$or':_['map'](_0x91f14c,function(_0x1f66cd){if(_0x1f66cd[_0x0a79('0x2e')]!==_0x0a79('0x40')){var _0xf3fe59={};_0xf3fe59[_0x1f66cd[_0x0a79('0x28')]]={'$like':'%'+_0x1c058d[_0x0a79('0x32')][_0x0a79('0x41')]+'%'};return _0xf3fe59;}})});}_0x2f1b2a=_[_0x0a79('0x3f')]({},_0x2f1b2a,_0x1c058d[_0x0a79('0x42')]);var _0x267a65={'where':_0x2f1b2a['where']};return db[_0x0a79('0x2b')][_0x0a79('0x1d')](_0x267a65)[_0x0a79('0x23')](function(_0x52a954){_0x182c98['count']=_0x52a954;if(_0x1c058d[_0x0a79('0x32')][_0x0a79('0x43')]){_0x2f1b2a['include']=[{'all':!![]}];}return db[_0x0a79('0x2b')][_0x0a79('0x44')](_0x2f1b2a);})[_0x0a79('0x23')](function(_0x317514){_0x182c98[_0x0a79('0x45')]=_0x317514;return _0x182c98;})[_0x0a79('0x23')](respondWithFilteredResult(_0x4020bf,_0x2f1b2a))['catch'](handleError(_0x4020bf,null));};exports[_0x0a79('0x46')]=function(_0x32a72f,_0x229344){var _0x592b43={'raw':![],'where':{'id':_0x32a72f[_0x0a79('0x47')]['id']}},_0x22a5d3={};_0x22a5d3[_0x0a79('0x35')]=_[_0x0a79('0x33')](db['VoiceRecording'][_0x0a79('0x2c')]);_0x22a5d3[_0x0a79('0x32')]=_[_0x0a79('0x33')](_0x32a72f[_0x0a79('0x32')]);_0x22a5d3[_0x0a79('0x3e')]=_[_0x0a79('0x34')](_0x22a5d3['model'],_0x22a5d3[_0x0a79('0x32')]);_0x592b43[_0x0a79('0x37')]=_[_0x0a79('0x34')](_0x22a5d3['model'],qs[_0x0a79('0x36')](_0x32a72f['query'][_0x0a79('0x36')]));_0x592b43[_0x0a79('0x37')]=_0x592b43[_0x0a79('0x37')][_0x0a79('0x38')]?_0x592b43['attributes']:_0x22a5d3[_0x0a79('0x35')];if(_0x32a72f[_0x0a79('0x32')][_0x0a79('0x43')]){_0x592b43['include']=[{'all':!![]}];}_0x592b43=_['merge']({},_0x592b43,_0x32a72f[_0x0a79('0x42')]);return db[_0x0a79('0x2b')][_0x0a79('0x48')](_0x592b43)[_0x0a79('0x23')](handleEntityNotFound(_0x229344,null))['then'](respondWithResult(_0x229344,null))[_0x0a79('0x49')](handleError(_0x229344,null));};exports[_0x0a79('0x4a')]=function(_0x392fc4,_0x341a45){return db[_0x0a79('0x2b')][_0x0a79('0x4a')](_0x392fc4[_0x0a79('0x4b')],{})[_0x0a79('0x23')](respondWithResult(_0x341a45,0xc9))[_0x0a79('0x49')](handleError(_0x341a45,null));};exports[_0x0a79('0x21')]=function(_0x112c74,_0x293cdc){if(_0x112c74[_0x0a79('0x4b')]['id']){delete _0x112c74[_0x0a79('0x4b')]['id'];}return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':{'id':_0x112c74[_0x0a79('0x47')]['id']}})['then'](handleEntityNotFound(_0x293cdc,null))['then'](saveUpdates(_0x112c74[_0x0a79('0x4b')],null))[_0x0a79('0x23')](respondWithResult(_0x293cdc,null))[_0x0a79('0x49')](handleError(_0x293cdc,null));};exports[_0x0a79('0x4c')]=function(_0x4b68a8,_0x3c4df8){return db[_0x0a79('0x2b')]['describe']()[_0x0a79('0x23')](respondWithResult(_0x3c4df8,null))[_0x0a79('0x49')](handleError(_0x3c4df8,null));};exports[_0x0a79('0x4d')]=function(_0x1430fc,_0x102ad8,_0x188e6b){var _0x2082cc=require(_0x0a79('0x4e'));var _0x4778af=![];var _0x1c2c72={};if(_0x1430fc[_0x0a79('0x32')][_0x0a79('0x2e')]&&_0x1430fc[_0x0a79('0x32')][_0x0a79('0x2e')]===_0x0a79('0x4f')){_0x1c2c72[_0x0a79('0x4f')]=_0x1430fc[_0x0a79('0x47')]['id'];}else{_0x1c2c72['id']=_0x1430fc[_0x0a79('0x47')]['id'];}return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':_0x1c2c72,'attributes':['id','value'],'raw':!![]})[_0x0a79('0x23')](handleEntityNotFound(_0x102ad8,null))['then'](function(_0x2f0633){if(_0x2f0633){var _0x4375bf=_0x2f0633['value'];var _0x12fbeb=util['format'](_0x0a79('0x50'),_0x4375bf);if(fs['existsSync'](_0x12fbeb)){_0x4778af=!![];return _0x2082cc['decryptFile'](_0x12fbeb,_0x4375bf,config[_0x0a79('0x51')][_0x0a79('0x52')])['then'](function(){return _0x2f0633;});}return _0x2f0633;}})[_0x0a79('0x23')](function(_0x29daef){if(_0x29daef){var _0x243e89=_0x29daef['value'];if(!fs['existsSync'](_0x243e89)){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x55'));}if(_0x29daef['filename']){return _0x102ad8['download'](_0x243e89,_0x29daef[_0x0a79('0x56')]+path[_0x0a79('0x57')](_0x243e89),function(){if(_0x4778af){fs[_0x0a79('0x58')](_0x243e89);}});}else{return _0x102ad8[_0x0a79('0x4d')](_0x243e89,function(_0x14185a){if(_0x4778af){fs[_0x0a79('0x58')](_0x243e89);}});}}})[_0x0a79('0x49')](function(_0x3180ea){if(_0x3180ea[_0x0a79('0x59')]===_0x0a79('0x55')){_0x102ad8[_0x0a79('0x18')](0x194)['send'](_0x0a79('0x5a'));}else{return handleError(_0x102ad8,null);}});};exports[_0x0a79('0x5b')]=function(_0x3ae9,_0x49e98f,_0x148abc){var _0x300a65=require('../../components/encryptor');var _0x53e012=![];var _0x11e9c4={'$and':[db[_0x0a79('0x5c')][_0x0a79('0x3c')](db[_0x0a79('0x5c')]['fn'](_0x0a79('0x5d'),db[_0x0a79('0x5c')][_0x0a79('0x5e')](_0x0a79('0x4f'))),_0x3ae9[_0x0a79('0x32')][_0x0a79('0x5f')])]};if(_0x3ae9[_0x0a79('0x32')][_0x0a79('0x2e')]&&_0x3ae9[_0x0a79('0x32')][_0x0a79('0x2e')]===_0x0a79('0x4f')){_0x11e9c4[_0x0a79('0x60')][_0x0a79('0x61')]({'uniqueid':_0x3ae9[_0x0a79('0x47')]['id']});}else{_0x11e9c4['$and'][_0x0a79('0x61')]({'id':_0x3ae9[_0x0a79('0x47')]['id']});}return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':_0x11e9c4,'attributes':['id',_0x0a79('0x62')],'raw':!![]})[_0x0a79('0x23')](handleEntityNotFound(_0x49e98f,null))['then'](function(_0x229005){if(_0x229005){var _0x20afb5=util[_0x0a79('0x31')](_0x0a79('0x50'),_0x229005[_0x0a79('0x62')]);if(fs[_0x0a79('0x63')](_0x20afb5)){_0x53e012=!![];return _0x300a65[_0x0a79('0x64')](_0x20afb5,_0x229005[_0x0a79('0x62')],config['secrets'][_0x0a79('0x52')])['then'](function(){return _0x229005;});}return _0x229005;}})[_0x0a79('0x23')](function(_0x4297de){if(_0x4297de){if(!fs[_0x0a79('0x63')](_0x4297de[_0x0a79('0x62')])){throw new db['Sequelize'][(_0x0a79('0x54'))](_0x0a79('0x55'));}if(_0x4297de[_0x0a79('0x56')]){return _0x49e98f['download'](_0x4297de[_0x0a79('0x62')],_0x4297de['filename']+path[_0x0a79('0x57')](_0x4297de['value']),function(){if(_0x53e012){fs[_0x0a79('0x58')](_0x4297de[_0x0a79('0x62')]);}});}else{return _0x49e98f[_0x0a79('0x4d')](_0x4297de[_0x0a79('0x62')],function(_0x526350){if(_0x53e012){fs[_0x0a79('0x58')](_0x4297de[_0x0a79('0x62')]);}});}}})[_0x0a79('0x49')](handleError(_0x49e98f,null));};exports['destroy']=function(_0x461517,_0x438f9e){return db[_0x0a79('0x2b')][_0x0a79('0x48')]({'where':{'id':_0x461517[_0x0a79('0x47')]['id']}})[_0x0a79('0x23')](function(_0x187f5d){if(_[_0x0a79('0x65')](_0x187f5d)){throw new ReferenceError(_0x0a79('0x66'));}return _0x187f5d;})[_0x0a79('0x23')](function(_0x23cb4c){var _0x99620f=_0x23cb4c[_0x0a79('0x62')];logger['info'](_0x0a79('0x67'),_0x99620f);if(!_[_0x0a79('0x65')](_0x23cb4c[_0x0a79('0x62')])&&fs[_0x0a79('0x63')](_0x99620f)){logger['info'](_0x0a79('0x68')+_0x99620f+_0x0a79('0x69'));fs[_0x0a79('0x6a')](_0x99620f);}_0x99620f=_0x99620f+_0x0a79('0x6b');if(!_[_0x0a79('0x65')](_0x23cb4c[_0x0a79('0x62')])&&fs['existsSync'](_0x99620f)){logger[_0x0a79('0x6c')](_0x0a79('0x68')+_0x99620f+_0x0a79('0x69'));fs[_0x0a79('0x6a')](_0x99620f);}return _0x23cb4c;})[_0x0a79('0x23')](function(_0x55ab1f){if(!_0x55ab1f)throw new InternalError();return _0x55ab1f['destroy']();})[_0x0a79('0x23')](function(){_0x438f9e[_0x0a79('0x18')](0xcc)['end']();})[_0x0a79('0x49')](handleError(_0x438f9e,null));};function getBucketslist(_0x8e78a5,_0x2d6dac,_0x48a39e){return new Promise(function(_0x1ad830,_0x29ec3e){var _0x1b30c2=new AWS['S3']({'accessKeyId':_0x2d6dac,'secretAccessKey':_0x8e78a5,'region':_0x48a39e});_0x1b30c2[_0x0a79('0x6d')]({},function(_0x1ca5c4,_0x5a5faf){if(_0x1ca5c4){return _0x29ec3e(_0x1ca5c4);}else{return _0x1ad830(_0x5a5faf);}});});}function createBucket(_0xf8d265,_0x3ac191,_0x572825,_0x404af4){return new Promise(function(_0x23fbcc,_0x28a7fd){var _0x1f41b4=new AWS['S3']({'accessKeyId':_0x3ac191,'secretAccessKey':_0xf8d265,'region':_0x572825});_0x1f41b4[_0x0a79('0x6e')]({'Bucket':_0x404af4},function(_0x506016,_0x2b444a){if(_0x506016){return _0x28a7fd(_0x506016);}else{return _0x23fbcc(_0x2b444a);}});});}function uploadFile(_0x38c21e,_0x3d34df,_0x38d6a7,_0x28cc14,_0x2c1949,_0x1a75ee){return new Promise(function(_0x3c40c1,_0x5a5a37){var _0x127d16=new AWS['S3']({'accessKeyId':_0x3d34df,'secretAccessKey':_0x38c21e,'region':_0x38d6a7});_0x127d16[_0x0a79('0x6f')]({'Bucket':_0x28cc14,'Key':_0x2c1949,'Body':_0x1a75ee},function(_0x2ffeb6,_0x44691d){if(_0x2ffeb6){return _0x5a5a37(_0x2ffeb6);}else{return _0x3c40c1(_0x44691d);}});});}function startTranscribe(_0x538480,_0x2ebeda,_0x23e24a,_0x4b2300,_0x255a37,_0x36d3ef){return new Promise(function(_0x14a5b2,_0x3c198e){var _0x52f386=new AWS[(_0x0a79('0x70'))]({'accessKeyId':_0x2ebeda,'secretAccessKey':_0x538480,'region':_0x23e24a});_0x52f386[_0x0a79('0x71')]({'TranscriptionJobName':_0x4b2300,'LanguageCode':_0x255a37,'Media':{'MediaFileUri':_0x36d3ef}},function(_0x192bb1,_0x2eebea){if(_0x192bb1){return _0x3c198e(_0x192bb1);}else{return _0x14a5b2(_0x2eebea);}});});}function transcribe(_0x549d5c,_0x295bd3,_0x22a62d,_0x2fa3fe,_0x2ce259,_0x11ea6b,_0x246a11){return new Promise(function(_0x312704,_0x3d0c4e){var _0x26f2cf={};logger[_0x0a79('0x6c')](util['format'](_0x0a79('0x72'),_0x549d5c,_0x2ce259));return uploadFile(_0x295bd3,_0x22a62d,_0x2fa3fe,_0x2ce259,path['basename'](_0x11ea6b),fs['readFileSync'](_0x11ea6b))[_0x0a79('0x23')](function(_0x111a0){logger[_0x0a79('0x6c')](util[_0x0a79('0x31')](_0x0a79('0x73'),_0x549d5c,_0x2ce259,_0x111a0[_0x0a79('0x74')]));_0x26f2cf[_0x0a79('0x75')]=_0x111a0[_0x0a79('0x76')];_0x26f2cf[_0x0a79('0x77')]=_0x111a0['Location'];logger['info'](util[_0x0a79('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x549d5c));return startTranscribe(_0x295bd3,_0x22a62d,_0x2fa3fe,uuidv4(),_0x246a11,_0x111a0[_0x0a79('0x74')]);})[_0x0a79('0x23')](function(_0x45caa0){logger['info'](util['format'](_0x0a79('0x78'),_0x549d5c,_0x45caa0['TranscriptionJob'][_0x0a79('0x79')]));_0x26f2cf[_0x0a79('0x7a')]=_0x45caa0[_0x0a79('0x7b')]['TranscriptionJobName'];_0x26f2cf['transcribeStatus']=_0x45caa0[_0x0a79('0x7b')][_0x0a79('0x7c')];return _0x312704(_0x26f2cf);})['catch'](function(_0x2afc94){return _0x3d0c4e(_0x2afc94);});});}exports[_0x0a79('0x7d')]=function(_0x5256a8,_0x49a404,_0x5bdb32){var _0x265351;var _0x164095;var _0x14877d;var _0x529bf3=require(_0x0a79('0x4e'));return db[_0x0a79('0x2b')][_0x0a79('0x7e')]({'where':{'id':_0x5256a8['params']['id']}})[_0x0a79('0x23')](function(_0x45c3d2){if(_0x45c3d2){var _0x219e51=util[_0x0a79('0x31')](_0x0a79('0x50'),_0x45c3d2[_0x0a79('0x62')]);if(fs[_0x0a79('0x63')](_0x219e51)){cypher=!![];return _0x529bf3['decryptFile'](_0x219e51,_0x45c3d2['value'],config[_0x0a79('0x51')][_0x0a79('0x52')])[_0x0a79('0x23')](function(){return _0x45c3d2;});}return _0x45c3d2;}})[_0x0a79('0x23')](function(_0x3b2e57){if(!_0x3b2e57){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x7f'));}_0x164095=_0x3b2e57;return db[_0x0a79('0x80')][_0x0a79('0x7e')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x49a404,null))[_0x0a79('0x23')](function(_0x2dcedd){if(_0x2dcedd){_0x265351=_0x2dcedd;if(!_0x265351['transcribe']||!_0x265351[_0x0a79('0x81')]||!_0x265351[_0x0a79('0x82')]||!_0x265351[_0x0a79('0x83')]||!_0x265351[_0x0a79('0x75')]){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))]('Transcribe\x20not\x20configured');}if(_0x5256a8[_0x0a79('0x4b')][_0x0a79('0x84')]&&(!_0x265351[_0x0a79('0x85')]||!_0x265351[_0x0a79('0x86')]||!_0x265351[_0x0a79('0x87')]||!_0x265351[_0x0a79('0x83')]||!_0x265351['bucket'])){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x88'));}return db['CloudProvider'][_0x0a79('0x7e')]({'where':{'id':_0x265351[_0x0a79('0x81')]}});}})[_0x0a79('0x23')](function(_0x18a55f){if(!_0x18a55f){throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x89'));}if(!_0x18a55f[_0x0a79('0x8a')]||!_0x18a55f[_0x0a79('0x8b')]){throw new db[(_0x0a79('0x53'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x14877d=_0x18a55f;return getBucketslist(_0x14877d['data1'],_0x14877d[_0x0a79('0x8b')],_0x265351[_0x0a79('0x82')]);})[_0x0a79('0x23')](function(_0x4255fb){if(_0x4255fb&&_0x4255fb[_0x0a79('0x8c')]){var _0x28c40a=_[_0x0a79('0x48')](_0x4255fb[_0x0a79('0x8c')],function(_0x44880a){return _0x44880a['Name']===_0x265351[_0x0a79('0x75')];});if(!_0x28c40a){logger[_0x0a79('0x6c')](util[_0x0a79('0x31')](_0x0a79('0x8d'),_0x5256a8[_0x0a79('0x47')]['id'],_0x265351[_0x0a79('0x75')]));return createBucket(_0x14877d[_0x0a79('0x8a')],_0x14877d[_0x0a79('0x8b')],_0x265351[_0x0a79('0x82')],_0x265351['bucket']);}logger['info'](util[_0x0a79('0x31')](_0x0a79('0x8e'),_0x5256a8[_0x0a79('0x47')]['id'],_0x265351[_0x0a79('0x75')]));return;}})[_0x0a79('0x23')](function(_0x54c372){if(_0x164095[_0x0a79('0x8f')]===_0x0a79('0x90')){return transcribe(_0x5256a8[_0x0a79('0x47')]['id'],_0x14877d[_0x0a79('0x8a')],_0x14877d[_0x0a79('0x8b')],_0x265351[_0x0a79('0x82')],_0x265351[_0x0a79('0x75')],_0x164095[_0x0a79('0x62')],_0x265351['language']);}else{logger[_0x0a79('0x6c')](util['format'](_0x0a79('0x91'),_0x5256a8[_0x0a79('0x47')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x0a79('0x23')](function(_0x1fd22d){if(_0x1fd22d){_0x1fd22d[_0x0a79('0x92')]=_0x5256a8[_0x0a79('0x4b')][_0x0a79('0x84')];return _0x164095['updateAttributes'](_0x1fd22d);}})['then'](respondWithResult(_0x49a404,null))[_0x0a79('0x49')](handleError(_0x49a404,null));};function writeFile(_0x51b1b1,_0x537a29){return new Promise(function(_0x10c401,_0x3dcb39){fs[_0x0a79('0x93')](_0x537a29,_0x51b1b1,function(_0x22b77d,_0x303fb7){if(_0x22b77d){return _0x3dcb39(_0x22b77d);}else{return _0x10c401(_0x303fb7);}});});}exports[_0x0a79('0x94')]=function(_0x2bfb5a,_0x41f4a1,_0x288faf){return db['VoiceRecording']['findOne']({'where':{'id':_0x2bfb5a['params']['id']}})[_0x0a79('0x23')](handleEntityNotFound(_0x41f4a1))['then'](function(_0x411952){if(_0x411952&&_0x411952[_0x0a79('0x95')]){var _0x1b9ebe=_0x411952[_0x0a79('0x95')];var _0x2ff343=config[_0x0a79('0x96')]+_0x0a79('0x97')+_0x411952['id']+'.txt';if(fs[_0x0a79('0x63')](_0x2ff343)){return _0x2ff343;}return writeFile(_0x1b9ebe,_0x2ff343)[_0x0a79('0x23')](function(){return _0x2ff343;});}else{throw new db[(_0x0a79('0x53'))][(_0x0a79('0x54'))](_0x0a79('0x98'));}})[_0x0a79('0x23')](function(_0x474bb8){return _0x41f4a1[_0x0a79('0x4d')](_0x474bb8);})[_0x0a79('0x49')](handleError(_0x41f4a1));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index acdcf0d..2d89401 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 _0x7784=['voice_recordings','uniqueid','util','api','moment','bluebird','path','rimraf','define','VoiceRecording'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7784,0xd4));var _0x4778=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x7784[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x4778('0x0'));var logger=require('../../config/logger')(_0x4778('0x1'));var moment=require(_0x4778('0x2'));var BPromise=require(_0x4778('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4778('0x4'));var rimraf=require(_0x4778('0x5'));var config=require('../../config/environment');var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x560b15,_0x4acf1e){return _0x560b15[_0x4778('0x6')](_0x4778('0x7'),attributes,{'tableName':_0x4778('0x8'),'paranoid':![],'indexes':[{'name':_0x4778('0x9'),'fields':[_0x4778('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x80d4=['rimraf','../../config/environment','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x209eaa,_0x1747eb){var _0x31823b=function(_0x55f7d1){while(--_0x55f7d1){_0x209eaa['push'](_0x209eaa['shift']());}};_0x31823b(++_0x1747eb);}(_0x80d4,0x1da));var _0x480d=function(_0x235952,_0x4d469f){_0x235952=_0x235952-0x0;var _0x10583a=_0x80d4[_0x235952];return _0x10583a;};'use strict';var _=require(_0x480d('0x0'));var util=require(_0x480d('0x1'));var logger=require(_0x480d('0x2'))('api');var moment=require(_0x480d('0x3'));var BPromise=require('bluebird');var rp=require(_0x480d('0x4'));var fs=require('fs');var path=require(_0x480d('0x5'));var rimraf=require(_0x480d('0x6'));var config=require(_0x480d('0x7'));var attributes=require(_0x480d('0x8'));module['exports']=function(_0x495ba6,_0x13b4ce){return _0x495ba6[_0x480d('0x9')](_0x480d('0xa'),attributes,{'tableName':_0x480d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 7cadc70..cf10cd9 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 _0x4e2e=['error','message','result','VoiceRecording','update','body','options','raw','attributes','limit','UpdateVoiceRecording','debug','catch','../../components/encryptor','findOne','create','callRecordingEncryption','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x21cb65,_0xd1dd7d){var _0x486e4f=function(_0x5c6dc0){while(--_0x5c6dc0){_0x21cb65['push'](_0x21cb65['shift']());}};_0x486e4f(++_0xd1dd7d);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x3b2404,_0x316deb){_0x3b2404=_0x3b2404-0x0;var _0x539210=_0x4e2e[_0x3b2404];return _0x539210;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b1c6,_0x1c4e64,_0x125338){return new BPromise(function(_0x956c75,_0x27304b){return client[_0xe4e2('0xb')](_0x36b1c6,_0x125338)[_0xe4e2('0xc')](function(_0x4912da){logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));logger['debug'](_0xe4e2('0x10'),_0x1c4e64,_0xe4e2('0xf'),JSON[_0xe4e2('0x11')](_0x4912da));if(_0x4912da[_0xe4e2('0x12')]){if(_0x4912da[_0xe4e2('0x12')]['code']===0x1f4){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x27304b(_0x4912da['error'][_0xe4e2('0x13')]);}logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x4912da[_0xe4e2('0x12')][_0xe4e2('0x13')]);return _0x956c75(_0x4912da['error']['message']);}else{logger[_0xe4e2('0xd')](_0xe4e2('0xe'),_0x1c4e64,_0xe4e2('0xf'));_0x956c75(_0x4912da[_0xe4e2('0x14')][_0xe4e2('0x13')]);}})['catch'](function(_0x754778){logger[_0xe4e2('0x12')](_0xe4e2('0xe'),_0x1c4e64,_0x754778);_0x27304b(_0x754778);});});}exports['UpdateVoiceRecording']=function(_0x196f16){var _0x54c80b=this;return new Promise(function(_0x1d5e9d,_0x3f313b){return db[_0xe4e2('0x15')][_0xe4e2('0x16')](_0x196f16[_0xe4e2('0x17')],{'raw':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')]['where']||null:null,'attributes':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x1a')]||null:null,'limit':_0x196f16[_0xe4e2('0x18')]?_0x196f16[_0xe4e2('0x18')][_0xe4e2('0x1b')]||null:null})[_0xe4e2('0xc')](function(_0x51c67e){logger[_0xe4e2('0xd')](_0xe4e2('0x1c'),_0x196f16);logger[_0xe4e2('0x1d')]('UpdateVoiceRecording',_0x196f16,JSON[_0xe4e2('0x11')](_0x51c67e));_0x1d5e9d(_0x51c67e);})[_0xe4e2('0x1e')](function(_0x598fa3){logger[_0xe4e2('0x12')](_0xe4e2('0x1c'),_0x598fa3[_0xe4e2('0x13')],_0x196f16);_0x3f313b(_0x54c80b[_0xe4e2('0x12')](0x1f4,_0x598fa3[_0xe4e2('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x166610){var _0x357903=this;return new Promise(function(_0x1f6d1f,_0x5120fd){var _0x3a31b8=require(_0xe4e2('0x1f'));var _0x31f651;return db['Setting'][_0xe4e2('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xe4e2('0xc')](function(_0x1e21c0){_0x31f651=_0x1e21c0;return db['VoiceRecording'][_0xe4e2('0x21')](_0x166610[_0xe4e2('0x17')]);})[_0xe4e2('0xc')](function(_0x41500b){if(_0x31f651[_0xe4e2('0x22')]&&fs['existsSync'](_0x41500b['value'])){var _0x2cb235=util[_0xe4e2('0x23')](_0xe4e2('0x24'),_0x41500b[_0xe4e2('0x25')]);return _0x3a31b8[_0xe4e2('0x26')](_0x41500b[_0xe4e2('0x25')],_0x2cb235,config[_0xe4e2('0x27')][_0xe4e2('0x28')])[_0xe4e2('0xc')](function(){fs[_0xe4e2('0x29')](_0x41500b[_0xe4e2('0x25')]);logger[_0xe4e2('0xd')]('CreateVoiceRecording\x20file\x20encrypted');return _0x41500b;});}return _0x41500b;})[_0xe4e2('0xc')](function(_0x8ffc6){logger[_0xe4e2('0xd')](_0xe4e2('0x2a'),_0x166610);logger[_0xe4e2('0x1d')](_0xe4e2('0x2a'),_0x166610,JSON['stringify'](_0x8ffc6));_0x1f6d1f(_0x8ffc6);})[_0xe4e2('0x1e')](function(_0x286714){logger[_0xe4e2('0x12')](_0xe4e2('0x2a'),_0x286714[_0xe4e2('0x13')],_0x166610);_0x5120fd(_0x357903[_0xe4e2('0x12')](0x1f4,_0x286714[_0xe4e2('0x13')]));});});}; \ No newline at end of file +var _0xeb3b=['rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','raw','options','attributes','limit','stringify','../../components/encryptor','findOne','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x3eec42,_0x192ed2){var _0x110bf0=function(_0x4ef488){while(--_0x4ef488){_0x3eec42['push'](_0x3eec42['shift']());}};_0x110bf0(++_0x192ed2);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xeb3b[_0x1f1511];return _0x1d9ab8;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')]['where']||null:null,'attributes':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')][_0xbeb3('0x1b')]||null:null,'limit':_0x44a4bb[_0xbeb3('0x1a')]?_0x44a4bb['options'][_0xbeb3('0x1c')]||null:null})[_0xbeb3('0xb')](function(_0x5e047e){logger[_0xbeb3('0xc')](_0xbeb3('0x15'),_0x44a4bb);logger['debug'](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1d')](_0x5e047e));_0x10b15d(_0x5e047e);})[_0xbeb3('0x14')](function(_0x42c6c3){logger[_0xbeb3('0x10')](_0xbeb3('0x15'),_0x42c6c3[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x42c6c3[_0xbeb3('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4e695e){var _0x1f36b9=this;return new Promise(function(_0x520116,_0x3e7f7d){var _0xda808c=require(_0xbeb3('0x1e'));var _0x400f65;return db['Setting'][_0xbeb3('0x1f')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xbeb3('0xb')](function(_0xab301c){_0x400f65=_0xab301c;return db['VoiceRecording']['create'](_0x4e695e[_0xbeb3('0x18')]);})['then'](function(_0x51f7ef){if(_0x400f65['callRecordingEncryption']&&fs['existsSync'](_0x51f7ef[_0xbeb3('0x20')])){var _0x4e9a04=util[_0xbeb3('0x21')](_0xbeb3('0x22'),_0x51f7ef[_0xbeb3('0x20')]);return _0xda808c[_0xbeb3('0x23')](_0x51f7ef[_0xbeb3('0x20')],_0x4e9a04,config[_0xbeb3('0x24')][_0xbeb3('0x25')])[_0xbeb3('0xb')](function(){fs[_0xbeb3('0x26')](_0x51f7ef[_0xbeb3('0x20')]);logger['info'](_0xbeb3('0x27'));return _0x51f7ef;});}return _0x51f7ef;})[_0xbeb3('0xb')](function(_0x5821dd){logger[_0xbeb3('0xc')](_0xbeb3('0x28'),_0x4e695e);logger[_0xbeb3('0x29')](_0xbeb3('0x28'),_0x4e695e,JSON['stringify'](_0x5821dd));_0x520116(_0x5821dd);})[_0xbeb3('0x14')](function(_0x18f2be){logger[_0xbeb3('0x10')](_0xbeb3('0x28'),_0x18f2be[_0xbeb3('0x12')],_0x4e695e);_0x3e7f7d(_0x1f36b9[_0xbeb3('0x10')](0x1f4,_0x18f2be[_0xbeb3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 48f391c..ad18651 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 _0x6326=['update','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceTransferReport.controller','get','index','/describe','describe','create','put','/:id','isAuthenticated'];(function(_0x23c507,_0x496810){var _0x2e6331=function(_0x593653){while(--_0x593653){_0x23c507['push'](_0x23c507['shift']());}};_0x2e6331(++_0x496810);}(_0x6326,0x101));var _0x6632=function(_0x2c656a,_0x47e291){_0x2c656a=_0x2c656a-0x0;var _0x1e5fbb=_0x6326[_0x2c656a];return _0x1e5fbb;};'use strict';var multer=require(_0x6632('0x0'));var util=require('util');var path=require(_0x6632('0x1'));var timeout=require(_0x6632('0x2'));var express=require(_0x6632('0x3'));var router=express[_0x6632('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6632('0x5'));var config=require('../../config/environment');var controller=require(_0x6632('0x6'));router[_0x6632('0x7')]('/',auth['isAuthenticated'](),controller[_0x6632('0x8')]);router[_0x6632('0x7')](_0x6632('0x9'),auth['isAuthenticated'](),controller[_0x6632('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6632('0xb')]);router[_0x6632('0xc')](_0x6632('0xd'),auth[_0x6632('0xe')](),controller[_0x6632('0xf')]);router['delete']('/:id',auth[_0x6632('0xe')](),controller['destroy']);module[_0x6632('0x10')]=router; \ No newline at end of file +var _0xfea6=['put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','./voiceTransferReport.controller','get','isAuthenticated','/describe','/:id','show','post','create'];(function(_0x1e3207,_0x3ce24a){var _0x5b986e=function(_0xa8a77e){while(--_0xa8a77e){_0x1e3207['push'](_0x1e3207['shift']());}};_0x5b986e(++_0x3ce24a);}(_0xfea6,0xb8));var _0x6fea=function(_0x53f763,_0x27e520){_0x53f763=_0x53f763-0x0;var _0x290cb3=_0xfea6[_0x53f763];return _0x290cb3;};'use strict';var multer=require(_0x6fea('0x0'));var util=require('util');var path=require(_0x6fea('0x1'));var timeout=require(_0x6fea('0x2'));var express=require(_0x6fea('0x3'));var router=express['Router']();var fs_extra=require(_0x6fea('0x4'));var auth=require(_0x6fea('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6fea('0x6'));router[_0x6fea('0x7')]('/',auth[_0x6fea('0x8')](),controller['index']);router['get'](_0x6fea('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x6fea('0x7')](_0x6fea('0xa'),auth[_0x6fea('0x8')](),controller[_0x6fea('0xb')]);router[_0x6fea('0xc')]('/',auth[_0x6fea('0x8')](),controller[_0x6fea('0xd')]);router[_0x6fea('0xe')](_0x6fea('0xa'),auth[_0x6fea('0x8')](),controller[_0x6fea('0xf')]);router[_0x6fea('0x10')]('/:id',auth[_0x6fea('0x8')](),controller['destroy']);module[_0x6fea('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index aeaeb41..d724a91 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 _0xc585=['attended','STRING','Yes','sequelize','moment','ENUM','blind'];(function(_0x1148fe,_0xc53889){var _0x57ecf3=function(_0x3b9524){while(--_0x3b9524){_0x1148fe['push'](_0x1148fe['shift']());}};_0x57ecf3(++_0xc53889);}(_0xc585,0x10d));var _0x5c58=function(_0x2b2e52,_0x34baa8){_0x2b2e52=_0x2b2e52-0x0;var _0xc37dfd=_0xc585[_0x2b2e52];return _0xc37dfd;};'use strict';var Sequelize=require(_0x5c58('0x0'));var moment=require(_0x5c58('0x1'));module['exports']={'type':{'type':Sequelize[_0x5c58('0x2')](_0x5c58('0x3'),_0x5c58('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x5c58('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x5c58('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x5c58('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x5c58('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x5c58('0x5')]},'transferercontext':{'type':Sequelize[_0x5c58('0x5')]},'transfererexten':{'type':Sequelize[_0x5c58('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x5c58('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x5c58('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x5c58('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x5c58('0x5')]},'transfereecontext':{'type':Sequelize[_0x5c58('0x5')]},'transfereeexten':{'type':Sequelize[_0x5c58('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x5c58('0x2')](_0x5c58('0x6'),'No')},'context':{'type':Sequelize[_0x5c58('0x5')]},'extension':{'type':Sequelize[_0x5c58('0x5')]}}; \ No newline at end of file +var _0x97ab=['sequelize','moment','exports','blind','attended','STRING','ENUM','Yes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x97ab,0xf0));var _0xb97a=function(_0x45a943,_0x29ac6f){_0x45a943=_0x45a943-0x0;var _0x51def7=_0x97ab[_0x45a943];return _0x51def7;};'use strict';var Sequelize=require(_0xb97a('0x0'));var moment=require(_0xb97a('0x1'));module[_0xb97a('0x2')]={'type':{'type':Sequelize['ENUM'](_0xb97a('0x3'),_0xb97a('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xb97a('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xb97a('0x5')]},'transferercalleridname':{'type':Sequelize[_0xb97a('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb97a('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb97a('0x5')]},'transferercontext':{'type':Sequelize[_0xb97a('0x5')]},'transfererexten':{'type':Sequelize[_0xb97a('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xb97a('0x5')]},'transfereechannel':{'type':Sequelize[_0xb97a('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xb97a('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xb97a('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb97a('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0xb97a('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xb97a('0x5')]},'transfereecontext':{'type':Sequelize[_0xb97a('0x5')]},'transfereeexten':{'type':Sequelize[_0xb97a('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xb97a('0x5')]},'isexternal':{'type':Sequelize[_0xb97a('0x6')](_0xb97a('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xb97a('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 1c68221..2871be9 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 _0x5ec7=['find','catch','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','show','params','length','options'];(function(_0x24f9ae,_0x5e42d7){var _0x2e1a2f=function(_0xfcf43){while(--_0xfcf43){_0x24f9ae['push'](_0x24f9ae['shift']());}};_0x2e1a2f(++_0x5e42d7);}(_0x5ec7,0x1da));var _0x75ec=function(_0x595568,_0x4d5efb){_0x595568=_0x595568-0x0;var _0x416386=_0x5ec7[_0x595568];return _0x416386;};'use strict';var emlformat=require(_0x75ec('0x0'));var rimraf=require(_0x75ec('0x1'));var zipdir=require(_0x75ec('0x2'));var jsonpatch=require(_0x75ec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x75ec('0x4'));var Mustache=require(_0x75ec('0x5'));var util=require('util');var path=require('path');var sox=require(_0x75ec('0x6'));var csv=require(_0x75ec('0x7'));var ejs=require(_0x75ec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x75ec('0x9'));var crypto=require(_0x75ec('0xa'));var jsforce=require(_0x75ec('0xb'));var deskjs=require(_0x75ec('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x75ec('0xd'));var Redis=require(_0x75ec('0xe'));var authService=require(_0x75ec('0xf'));var qs=require(_0x75ec('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x75ec('0x11'));var logger=require(_0x75ec('0x12'))(_0x75ec('0x13'));var utils=require(_0x75ec('0x14'));var config=require(_0x75ec('0x15'));var licenseUtil=require(_0x75ec('0x16'));var db=require(_0x75ec('0x17'))['db'];function respondWithStatusCode(_0x59c398,_0x33b4d9){_0x33b4d9=_0x33b4d9||0xcc;return function(_0x3679ed){if(_0x3679ed){return _0x59c398['sendStatus'](_0x33b4d9);}return _0x59c398[_0x75ec('0x18')](_0x33b4d9)[_0x75ec('0x19')]();};}function respondWithResult(_0x12a3fe,_0xe54eda){_0xe54eda=_0xe54eda||0xc8;return function(_0x959d3){if(_0x959d3){return _0x12a3fe[_0x75ec('0x18')](_0xe54eda)['json'](_0x959d3);}};}function respondWithFilteredResult(_0x1f627f,_0x8f52a){return function(_0x2335f0){if(_0x2335f0){var _0x341289=typeof _0x8f52a[_0x75ec('0x1a')]==='undefined'&&typeof _0x8f52a[_0x75ec('0x1b')]===_0x75ec('0x1c');var _0x1a0a97=_0x2335f0[_0x75ec('0x1d')];var _0x36b986=_0x341289?0x0:_0x8f52a[_0x75ec('0x1a')];var _0x11f259=_0x341289?_0x2335f0[_0x75ec('0x1d')]:_0x8f52a[_0x75ec('0x1a')]+_0x8f52a[_0x75ec('0x1b')];var _0x4c5209;if(_0x11f259>=_0x1a0a97){_0x11f259=_0x1a0a97;_0x4c5209=0xc8;}else{_0x4c5209=0xce;}_0x1f627f[_0x75ec('0x18')](_0x4c5209);return _0x1f627f[_0x75ec('0x1e')](_0x75ec('0x1f'),_0x36b986+'-'+_0x11f259+'/'+_0x1a0a97)[_0x75ec('0x20')](_0x2335f0);}return null;};}function patchUpdates(_0x5511b3){return function(_0x4fd6a4){try{jsonpatch[_0x75ec('0x21')](_0x4fd6a4,_0x5511b3,!![]);}catch(_0x2b5e03){return BPromise[_0x75ec('0x22')](_0x2b5e03);}return _0x4fd6a4[_0x75ec('0x23')]();};}function saveUpdates(_0x55620c,_0xcfa9d5){return function(_0x5d60f5){if(_0x5d60f5){return _0x5d60f5['update'](_0x55620c)[_0x75ec('0x24')](function(_0x48c3e3){return _0x48c3e3;});}return null;};}function removeEntity(_0x5d8e8f,_0x4e36fd){return function(_0x46d327){if(_0x46d327){return _0x46d327[_0x75ec('0x25')]()[_0x75ec('0x24')](function(){_0x5d8e8f[_0x75ec('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18acd3,_0x5f20de){return function(_0x201683){if(!_0x201683){_0x18acd3[_0x75ec('0x26')](0x194);}return _0x201683;};}function handleError(_0x150390,_0x5561a4){_0x5561a4=_0x5561a4||0x1f4;return function(_0x2b9be9){logger[_0x75ec('0x27')](_0x2b9be9['stack']);if(_0x2b9be9[_0x75ec('0x28')]){delete _0x2b9be9[_0x75ec('0x28')];}_0x150390[_0x75ec('0x18')](_0x5561a4)[_0x75ec('0x29')](_0x2b9be9);};}exports[_0x75ec('0x2a')]=function(_0x80c7a2,_0x4e13e6){var _0x36379f={},_0x184c92={},_0x6e5302={'count':0x0,'rows':[]};var _0x408eea=_[_0x75ec('0x2b')](db[_0x75ec('0x2c')][_0x75ec('0x2d')],function(_0x1e1256){return{'name':_0x1e1256[_0x75ec('0x2e')],'type':_0x1e1256[_0x75ec('0x2f')][_0x75ec('0x30')]};});_0x184c92['model']=_[_0x75ec('0x2b')](_0x408eea,_0x75ec('0x28'));_0x184c92[_0x75ec('0x31')]=_[_0x75ec('0x32')](_0x80c7a2['query']);_0x184c92[_0x75ec('0x33')]=_[_0x75ec('0x34')](_0x184c92['model'],_0x184c92[_0x75ec('0x31')]);_0x36379f[_0x75ec('0x35')]=_['intersection'](_0x184c92[_0x75ec('0x36')],qs[_0x75ec('0x37')](_0x80c7a2[_0x75ec('0x31')]['fields']));_0x36379f[_0x75ec('0x35')]=_0x36379f[_0x75ec('0x35')]['length']?_0x36379f[_0x75ec('0x35')]:_0x184c92[_0x75ec('0x36')];if(!_0x80c7a2[_0x75ec('0x31')][_0x75ec('0x38')](_0x75ec('0x39'))){_0x36379f['limit']=qs[_0x75ec('0x1b')](_0x80c7a2[_0x75ec('0x31')][_0x75ec('0x1b')]);_0x36379f[_0x75ec('0x1a')]=qs[_0x75ec('0x1a')](_0x80c7a2[_0x75ec('0x31')]['offset']);}_0x36379f['order']=qs[_0x75ec('0x3a')](_0x80c7a2['query'][_0x75ec('0x3a')]);_0x36379f[_0x75ec('0x3b')]=qs[_0x75ec('0x33')](_[_0x75ec('0x3c')](_0x80c7a2[_0x75ec('0x31')],_0x184c92[_0x75ec('0x33')]),_0x408eea);if(_0x80c7a2[_0x75ec('0x31')][_0x75ec('0x3d')]){_0x36379f[_0x75ec('0x3b')]=_['merge'](_0x36379f[_0x75ec('0x3b')],{'$or':_[_0x75ec('0x2b')](_0x408eea,function(_0x157b67){if(_0x157b67[_0x75ec('0x2f')]!==_0x75ec('0x3e')){var _0x19f984={};_0x19f984[_0x157b67[_0x75ec('0x28')]]={'$like':'%'+_0x80c7a2['query']['filter']+'%'};return _0x19f984;}})});}_0x36379f=_[_0x75ec('0x3f')]({},_0x36379f,_0x80c7a2['options']);var _0x45d5f5={'where':_0x36379f[_0x75ec('0x3b')]};return db[_0x75ec('0x2c')]['count'](_0x45d5f5)[_0x75ec('0x24')](function(_0x561827){_0x6e5302[_0x75ec('0x1d')]=_0x561827;if(_0x80c7a2[_0x75ec('0x31')][_0x75ec('0x40')]){_0x36379f[_0x75ec('0x41')]=[{'all':!![]}];}return db[_0x75ec('0x2c')][_0x75ec('0x42')](_0x36379f);})[_0x75ec('0x24')](function(_0x449f28){_0x6e5302[_0x75ec('0x43')]=_0x449f28;return _0x6e5302;})['then'](respondWithFilteredResult(_0x4e13e6,_0x36379f))['catch'](handleError(_0x4e13e6,null));};exports[_0x75ec('0x44')]=function(_0x101e82,_0x13a187){var _0x1e025e={'raw':!![],'where':{'id':_0x101e82[_0x75ec('0x45')]['id']}},_0x18c15d={};_0x18c15d[_0x75ec('0x36')]=_[_0x75ec('0x32')](db[_0x75ec('0x2c')]['rawAttributes']);_0x18c15d[_0x75ec('0x31')]=_[_0x75ec('0x32')](_0x101e82['query']);_0x18c15d[_0x75ec('0x33')]=_['intersection'](_0x18c15d[_0x75ec('0x36')],_0x18c15d[_0x75ec('0x31')]);_0x1e025e[_0x75ec('0x35')]=_[_0x75ec('0x34')](_0x18c15d[_0x75ec('0x36')],qs[_0x75ec('0x37')](_0x101e82[_0x75ec('0x31')][_0x75ec('0x37')]));_0x1e025e[_0x75ec('0x35')]=_0x1e025e[_0x75ec('0x35')][_0x75ec('0x46')]?_0x1e025e['attributes']:_0x18c15d['model'];if(_0x101e82['query'][_0x75ec('0x40')]){_0x1e025e['include']=[{'all':!![]}];}_0x1e025e=_[_0x75ec('0x3f')]({},_0x1e025e,_0x101e82[_0x75ec('0x47')]);return db[_0x75ec('0x2c')][_0x75ec('0x48')](_0x1e025e)[_0x75ec('0x24')](handleEntityNotFound(_0x13a187,null))[_0x75ec('0x24')](respondWithResult(_0x13a187,null))[_0x75ec('0x49')](handleError(_0x13a187,null));};exports[_0x75ec('0x4a')]=function(_0x489a36,_0x10ad34){return db[_0x75ec('0x2c')][_0x75ec('0x4a')](_0x489a36['body'],{})[_0x75ec('0x24')](respondWithResult(_0x10ad34,0xc9))[_0x75ec('0x49')](handleError(_0x10ad34,null));};exports[_0x75ec('0x4b')]=function(_0x14715c,_0x2539d6){if(_0x14715c[_0x75ec('0x4c')]['id']){delete _0x14715c[_0x75ec('0x4c')]['id'];}return db['VoiceTransferReport'][_0x75ec('0x48')]({'where':{'id':_0x14715c[_0x75ec('0x45')]['id']}})[_0x75ec('0x24')](handleEntityNotFound(_0x2539d6,null))[_0x75ec('0x24')](saveUpdates(_0x14715c[_0x75ec('0x4c')],null))[_0x75ec('0x24')](respondWithResult(_0x2539d6,null))[_0x75ec('0x49')](handleError(_0x2539d6,null));};exports['destroy']=function(_0x2edfe9,_0x12b92b){return db[_0x75ec('0x2c')][_0x75ec('0x48')]({'where':{'id':_0x2edfe9[_0x75ec('0x45')]['id']}})[_0x75ec('0x24')](handleEntityNotFound(_0x12b92b,null))[_0x75ec('0x24')](removeEntity(_0x12b92b,null))[_0x75ec('0x49')](handleError(_0x12b92b,null));};exports[_0x75ec('0x4d')]=function(_0x462c1d,_0x5ae04b){return db[_0x75ec('0x2c')][_0x75ec('0x4d')]()['then'](respondWithResult(_0x5ae04b,null))[_0x75ec('0x49')](handleError(_0x5ae04b,null));}; \ No newline at end of file +var _0x7be6=['where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','update','catch','describe','rimraf','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7be6,0xec));var _0x67be=function(_0x2fa159,_0x44f4d7){_0x2fa159=_0x2fa159-0x0;var _0xd6b5f4=_0x7be6[_0x2fa159];return _0xd6b5f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x67be('0x0'));var zipdir=require(_0x67be('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67be('0x2'));var moment=require(_0x67be('0x3'));var BPromise=require(_0x67be('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x67be('0x5'));var csv=require(_0x67be('0x6'));var ejs=require(_0x67be('0x7'));var fs=require('fs');var fs_extra=require(_0x67be('0x8'));var _=require(_0x67be('0x9'));var squel=require(_0x67be('0xa'));var crypto=require(_0x67be('0xb'));var jsforce=require(_0x67be('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x67be('0x6'));var querystring=require(_0x67be('0xd'));var Papa=require('papaparse');var Redis=require(_0x67be('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67be('0xf'));var logger=require(_0x67be('0x10'))(_0x67be('0x11'));var utils=require(_0x67be('0x12'));var config=require(_0x67be('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x67be('0x14'))['db'];function respondWithStatusCode(_0x168753,_0x4e5fb1){_0x4e5fb1=_0x4e5fb1||0xcc;return function(_0xc83331){if(_0xc83331){return _0x168753[_0x67be('0x15')](_0x4e5fb1);}return _0x168753[_0x67be('0x16')](_0x4e5fb1)[_0x67be('0x17')]();};}function respondWithResult(_0x4a1f88,_0x240b24){_0x240b24=_0x240b24||0xc8;return function(_0xdeb5dd){if(_0xdeb5dd){return _0x4a1f88['status'](_0x240b24)['json'](_0xdeb5dd);}};}function respondWithFilteredResult(_0x42c381,_0x23263c){return function(_0x4ea652){if(_0x4ea652){var _0x17f6f1=typeof _0x23263c[_0x67be('0x18')]===_0x67be('0x19')&&typeof _0x23263c[_0x67be('0x1a')]===_0x67be('0x19');var _0x1e5294=_0x4ea652[_0x67be('0x1b')];var _0xab10b0=_0x17f6f1?0x0:_0x23263c[_0x67be('0x18')];var _0x39831a=_0x17f6f1?_0x4ea652['count']:_0x23263c['offset']+_0x23263c[_0x67be('0x1a')];var _0xc26ec5;if(_0x39831a>=_0x1e5294){_0x39831a=_0x1e5294;_0xc26ec5=0xc8;}else{_0xc26ec5=0xce;}_0x42c381[_0x67be('0x16')](_0xc26ec5);return _0x42c381['set']('Content-Range',_0xab10b0+'-'+_0x39831a+'/'+_0x1e5294)[_0x67be('0x1c')](_0x4ea652);}return null;};}function patchUpdates(_0x4dcd25){return function(_0x27b528){try{jsonpatch[_0x67be('0x1d')](_0x27b528,_0x4dcd25,!![]);}catch(_0x445020){return BPromise[_0x67be('0x1e')](_0x445020);}return _0x27b528[_0x67be('0x1f')]();};}function saveUpdates(_0x5107a7,_0x387ac8){return function(_0x3dcb3d){if(_0x3dcb3d){return _0x3dcb3d['update'](_0x5107a7)[_0x67be('0x20')](function(_0x4d3f08){return _0x4d3f08;});}return null;};}function removeEntity(_0x5acbb4,_0x24f0f1){return function(_0x2619ac){if(_0x2619ac){return _0x2619ac[_0x67be('0x21')]()[_0x67be('0x20')](function(){_0x5acbb4[_0x67be('0x16')](0xcc)[_0x67be('0x17')]();});}};}function handleEntityNotFound(_0x3e4634,_0x1c9a1c){return function(_0x791f98){if(!_0x791f98){_0x3e4634['sendStatus'](0x194);}return _0x791f98;};}function handleError(_0x324d6f,_0x3aff2a){_0x3aff2a=_0x3aff2a||0x1f4;return function(_0x4dff35){logger[_0x67be('0x22')](_0x4dff35[_0x67be('0x23')]);if(_0x4dff35[_0x67be('0x24')]){delete _0x4dff35[_0x67be('0x24')];}_0x324d6f[_0x67be('0x16')](_0x3aff2a)['send'](_0x4dff35);};}exports[_0x67be('0x25')]=function(_0x4321ab,_0xb1f30){var _0x280b74={},_0x2566bb={},_0x378cf4={'count':0x0,'rows':[]};var _0x2ec964=_[_0x67be('0x26')](db[_0x67be('0x27')][_0x67be('0x28')],function(_0x3c5c99){return{'name':_0x3c5c99[_0x67be('0x29')],'type':_0x3c5c99[_0x67be('0x2a')][_0x67be('0x2b')]};});_0x2566bb[_0x67be('0x2c')]=_[_0x67be('0x26')](_0x2ec964,_0x67be('0x24'));_0x2566bb[_0x67be('0x2d')]=_[_0x67be('0x2e')](_0x4321ab['query']);_0x2566bb[_0x67be('0x2f')]=_[_0x67be('0x30')](_0x2566bb[_0x67be('0x2c')],_0x2566bb[_0x67be('0x2d')]);_0x280b74['attributes']=_[_0x67be('0x30')](_0x2566bb[_0x67be('0x2c')],qs[_0x67be('0x31')](_0x4321ab[_0x67be('0x2d')]['fields']));_0x280b74[_0x67be('0x32')]=_0x280b74[_0x67be('0x32')][_0x67be('0x33')]?_0x280b74[_0x67be('0x32')]:_0x2566bb[_0x67be('0x2c')];if(!_0x4321ab[_0x67be('0x2d')][_0x67be('0x34')](_0x67be('0x35'))){_0x280b74[_0x67be('0x1a')]=qs[_0x67be('0x1a')](_0x4321ab[_0x67be('0x2d')][_0x67be('0x1a')]);_0x280b74[_0x67be('0x18')]=qs[_0x67be('0x18')](_0x4321ab[_0x67be('0x2d')][_0x67be('0x18')]);}_0x280b74[_0x67be('0x36')]=qs[_0x67be('0x37')](_0x4321ab[_0x67be('0x2d')][_0x67be('0x37')]);_0x280b74[_0x67be('0x38')]=qs[_0x67be('0x2f')](_[_0x67be('0x39')](_0x4321ab['query'],_0x2566bb[_0x67be('0x2f')]),_0x2ec964);if(_0x4321ab['query'][_0x67be('0x3a')]){_0x280b74[_0x67be('0x38')]=_['merge'](_0x280b74[_0x67be('0x38')],{'$or':_[_0x67be('0x26')](_0x2ec964,function(_0x330102){if(_0x330102['type']!=='VIRTUAL'){var _0x5e49db={};_0x5e49db[_0x330102[_0x67be('0x24')]]={'$like':'%'+_0x4321ab['query']['filter']+'%'};return _0x5e49db;}})});}_0x280b74=_[_0x67be('0x3b')]({},_0x280b74,_0x4321ab['options']);var _0x1f17c5={'where':_0x280b74[_0x67be('0x38')]};return db['VoiceTransferReport'][_0x67be('0x1b')](_0x1f17c5)[_0x67be('0x20')](function(_0x5180f4){_0x378cf4[_0x67be('0x1b')]=_0x5180f4;if(_0x4321ab[_0x67be('0x2d')][_0x67be('0x3c')]){_0x280b74[_0x67be('0x3d')]=[{'all':!![]}];}return db[_0x67be('0x27')][_0x67be('0x3e')](_0x280b74);})[_0x67be('0x20')](function(_0x2c0069){_0x378cf4[_0x67be('0x3f')]=_0x2c0069;return _0x378cf4;})[_0x67be('0x20')](respondWithFilteredResult(_0xb1f30,_0x280b74))['catch'](handleError(_0xb1f30,null));};exports[_0x67be('0x40')]=function(_0x4b6cea,_0x4d665f){var _0x16de48={'raw':!![],'where':{'id':_0x4b6cea[_0x67be('0x41')]['id']}},_0x16c6e1={};_0x16c6e1[_0x67be('0x2c')]=_[_0x67be('0x2e')](db[_0x67be('0x27')][_0x67be('0x28')]);_0x16c6e1[_0x67be('0x2d')]=_[_0x67be('0x2e')](_0x4b6cea[_0x67be('0x2d')]);_0x16c6e1[_0x67be('0x2f')]=_[_0x67be('0x30')](_0x16c6e1['model'],_0x16c6e1['query']);_0x16de48[_0x67be('0x32')]=_[_0x67be('0x30')](_0x16c6e1[_0x67be('0x2c')],qs['fields'](_0x4b6cea[_0x67be('0x2d')]['fields']));_0x16de48[_0x67be('0x32')]=_0x16de48[_0x67be('0x32')][_0x67be('0x33')]?_0x16de48[_0x67be('0x32')]:_0x16c6e1[_0x67be('0x2c')];if(_0x4b6cea[_0x67be('0x2d')][_0x67be('0x3c')]){_0x16de48['include']=[{'all':!![]}];}_0x16de48=_[_0x67be('0x3b')]({},_0x16de48,_0x4b6cea[_0x67be('0x42')]);return db[_0x67be('0x27')][_0x67be('0x43')](_0x16de48)[_0x67be('0x20')](handleEntityNotFound(_0x4d665f,null))[_0x67be('0x20')](respondWithResult(_0x4d665f,null))['catch'](handleError(_0x4d665f,null));};exports[_0x67be('0x44')]=function(_0x13e5f7,_0xed1317){return db['VoiceTransferReport']['create'](_0x13e5f7[_0x67be('0x45')],{})[_0x67be('0x20')](respondWithResult(_0xed1317,0xc9))['catch'](handleError(_0xed1317,null));};exports[_0x67be('0x46')]=function(_0x3fcc09,_0xb2a673){if(_0x3fcc09['body']['id']){delete _0x3fcc09['body']['id'];}return db[_0x67be('0x27')][_0x67be('0x43')]({'where':{'id':_0x3fcc09[_0x67be('0x41')]['id']}})[_0x67be('0x20')](handleEntityNotFound(_0xb2a673,null))['then'](saveUpdates(_0x3fcc09[_0x67be('0x45')],null))[_0x67be('0x20')](respondWithResult(_0xb2a673,null))[_0x67be('0x47')](handleError(_0xb2a673,null));};exports['destroy']=function(_0x2a2772,_0xb52dbc){return db[_0x67be('0x27')][_0x67be('0x43')]({'where':{'id':_0x2a2772[_0x67be('0x41')]['id']}})[_0x67be('0x20')](handleEntityNotFound(_0xb52dbc,null))[_0x67be('0x20')](removeEntity(_0xb52dbc,null))[_0x67be('0x47')](handleError(_0xb52dbc,null));};exports[_0x67be('0x48')]=function(_0x1c4398,_0x36b344){return db[_0x67be('0x27')][_0x67be('0x48')]()[_0x67be('0x20')](respondWithResult(_0x36b344,null))[_0x67be('0x47')](handleError(_0x36b344,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 04310ad..e0e0858 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 _0x8c31=['../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x47afed,_0x1003ef){var _0x5144cf=function(_0x129b98){while(--_0x129b98){_0x47afed['push'](_0x47afed['shift']());}};_0x5144cf(++_0x1003ef);}(_0x8c31,0xe2));var _0x18c3=function(_0x1db7ce,_0x3175e2){_0x1db7ce=_0x1db7ce-0x0;var _0x308c33=_0x8c31[_0x1db7ce];return _0x308c33;};'use strict';var _=require(_0x18c3('0x0'));var util=require(_0x18c3('0x1'));var logger=require(_0x18c3('0x2'))(_0x18c3('0x3'));var moment=require('moment');var BPromise=require(_0x18c3('0x4'));var rp=require(_0x18c3('0x5'));var fs=require('fs');var path=require(_0x18c3('0x6'));var rimraf=require(_0x18c3('0x7'));var config=require(_0x18c3('0x8'));var attributes=require(_0x18c3('0x9'));module[_0x18c3('0xa')]=function(_0x26a2e8,_0x224869){return _0x26a2e8[_0x18c3('0xb')](_0x18c3('0xc'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfdba=['define','VoiceTransferReport','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceTransferReport.attributes','exports'];(function(_0x1ce2e3,_0x3644a2){var _0x144c18=function(_0x1d0eee){while(--_0x1d0eee){_0x1ce2e3['push'](_0x1ce2e3['shift']());}};_0x144c18(++_0x3644a2);}(_0xfdba,0x115));var _0xafdb=function(_0x2f32a5,_0x667956){_0x2f32a5=_0x2f32a5-0x0;var _0x224e4d=_0xfdba[_0x2f32a5];return _0x224e4d;};'use strict';var _=require(_0xafdb('0x0'));var util=require('util');var logger=require(_0xafdb('0x1'))(_0xafdb('0x2'));var moment=require('moment');var BPromise=require(_0xafdb('0x3'));var rp=require(_0xafdb('0x4'));var fs=require('fs');var path=require(_0xafdb('0x5'));var rimraf=require(_0xafdb('0x6'));var config=require('../../config/environment');var attributes=require(_0xafdb('0x7'));module[_0xafdb('0x8')]=function(_0x5abb73,_0x9eea69){return _0x5abb73[_0xafdb('0x9')](_0xafdb('0xa'),attributes,{'tableName':'report_call_transfer','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 d5b0e06..c275140 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 _0x91ca=['result','catch','CreateVoiceTransferReport','create','body','options','raw','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x433263,_0x4726db){var _0x13311b=function(_0x26970e){while(--_0x26970e){_0x433263['push'](_0x433263['shift']());}};_0x13311b(++_0x4726db);}(_0x91ca,0x104));var _0xa91c=function(_0x353730,_0x504fdf){_0x353730=_0x353730-0x0;var _0x901b87=_0x91ca[_0x353730];return _0x901b87;};'use strict';var _=require('lodash');var util=require(_0xa91c('0x0'));var moment=require(_0xa91c('0x1'));var BPromise=require(_0xa91c('0x2'));var rs=require(_0xa91c('0x3'));var fs=require('fs');var Redis=require(_0xa91c('0x4'));var db=require(_0xa91c('0x5'))['db'];var utils=require(_0xa91c('0x6'));var logger=require(_0xa91c('0x7'))(_0xa91c('0x8'));var config=require(_0xa91c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa91c('0xa')][_0xa91c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45c28d,_0x2e4b5d,_0x55f7aa){return new BPromise(function(_0x589dca,_0x5912a0){return client['request'](_0x45c28d,_0x55f7aa)[_0xa91c('0xc')](function(_0x2ce1a1){logger['info'](_0xa91c('0xd'),_0x2e4b5d,_0xa91c('0xe'));logger[_0xa91c('0xf')](_0xa91c('0x10'),_0x2e4b5d,_0xa91c('0xe'),JSON['stringify'](_0x2ce1a1));if(_0x2ce1a1[_0xa91c('0x11')]){if(_0x2ce1a1[_0xa91c('0x11')]['code']===0x1f4){logger['error'](_0xa91c('0xd'),_0x2e4b5d,_0x2ce1a1[_0xa91c('0x11')][_0xa91c('0x12')]);return _0x5912a0(_0x2ce1a1[_0xa91c('0x11')][_0xa91c('0x12')]);}logger[_0xa91c('0x11')](_0xa91c('0xd'),_0x2e4b5d,_0x2ce1a1[_0xa91c('0x11')][_0xa91c('0x12')]);return _0x589dca(_0x2ce1a1['error'][_0xa91c('0x12')]);}else{logger[_0xa91c('0x13')](_0xa91c('0xd'),_0x2e4b5d,_0xa91c('0xe'));_0x589dca(_0x2ce1a1[_0xa91c('0x14')][_0xa91c('0x12')]);}})[_0xa91c('0x15')](function(_0x5dec46){logger[_0xa91c('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2e4b5d,_0x5dec46);_0x5912a0(_0x5dec46);});});}exports[_0xa91c('0x16')]=function(_0x2992d5){var _0x432752=this;return new Promise(function(_0x16b134,_0x49ed53){return db['VoiceTransferReport'][_0xa91c('0x17')](_0x2992d5[_0xa91c('0x18')],{'raw':_0x2992d5['options']?_0x2992d5[_0xa91c('0x19')][_0xa91c('0x1a')]===undefined?!![]:![]:!![]})[_0xa91c('0xc')](function(_0x4be18f){logger['info']('CreateVoiceTransferReport',_0x2992d5);logger['debug'](_0xa91c('0x16'),_0x2992d5,JSON[_0xa91c('0x1b')](_0x4be18f));_0x16b134(_0x4be18f);})[_0xa91c('0x15')](function(_0x1b0167){logger[_0xa91c('0x11')](_0xa91c('0x16'),_0x1b0167[_0xa91c('0x12')],_0x2992d5);_0x49ed53(_0x432752[_0xa91c('0x11')](0x1f4,_0x1b0167['message']));});});}; \ No newline at end of file +var _0x07b2=['raw','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','options'];(function(_0x59b2da,_0x4aa82a){var _0x549a92=function(_0x4bb62a){while(--_0x4bb62a){_0x59b2da['push'](_0x59b2da['shift']());}};_0x549a92(++_0x4aa82a);}(_0x07b2,0xa4));var _0x207b=function(_0x300549,_0x44ea69){_0x300549=_0x300549-0x0;var _0xc2a10e=_0x07b2[_0x300549];return _0xc2a10e;};'use strict';var _=require(_0x207b('0x0'));var util=require('util');var moment=require(_0x207b('0x1'));var BPromise=require(_0x207b('0x2'));var rs=require(_0x207b('0x3'));var fs=require('fs');var Redis=require(_0x207b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x207b('0x5'));var logger=require('../../config/logger')(_0x207b('0x6'));var config=require('../../config/environment');var jayson=require(_0x207b('0x7'));var client=jayson[_0x207b('0x8')][_0x207b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a714,_0xf1ed01,_0x313ad5){return new BPromise(function(_0x30e46f,_0x2ddd0a){return client[_0x207b('0xa')](_0x14a714,_0x313ad5)['then'](function(_0x23c9bb){logger[_0x207b('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0xf1ed01,_0x207b('0xc'));logger[_0x207b('0xd')](_0x207b('0xe'),_0xf1ed01,_0x207b('0xc'),JSON['stringify'](_0x23c9bb));if(_0x23c9bb[_0x207b('0xf')]){if(_0x23c9bb[_0x207b('0xf')][_0x207b('0x10')]===0x1f4){logger[_0x207b('0xf')](_0x207b('0x11'),_0xf1ed01,_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);return _0x2ddd0a(_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);}logger[_0x207b('0xf')](_0x207b('0x11'),_0xf1ed01,_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);return _0x30e46f(_0x23c9bb[_0x207b('0xf')][_0x207b('0x12')]);}else{logger[_0x207b('0xb')](_0x207b('0x11'),_0xf1ed01,'request\x20sent');_0x30e46f(_0x23c9bb[_0x207b('0x13')][_0x207b('0x12')]);}})[_0x207b('0x14')](function(_0x47de8e){logger[_0x207b('0xf')](_0x207b('0x11'),_0xf1ed01,_0x47de8e);_0x2ddd0a(_0x47de8e);});});}exports[_0x207b('0x15')]=function(_0x1d92e0){var _0xb0fb1c=this;return new Promise(function(_0x25c665,_0x2a8166){return db[_0x207b('0x16')][_0x207b('0x17')](_0x1d92e0['body'],{'raw':_0x1d92e0[_0x207b('0x18')]?_0x1d92e0[_0x207b('0x18')][_0x207b('0x19')]===undefined?!![]:![]:!![]})[_0x207b('0x1a')](function(_0x2bd169){logger[_0x207b('0xb')](_0x207b('0x15'),_0x1d92e0);logger[_0x207b('0xd')]('CreateVoiceTransferReport',_0x1d92e0,JSON['stringify'](_0x2bd169));_0x25c665(_0x2bd169);})[_0x207b('0x14')](function(_0x3fe947){logger[_0x207b('0xf')](_0x207b('0x15'),_0x3fe947['message'],_0x1d92e0);_0x2a8166(_0xb0fb1c[_0x207b('0xf')](0x1f4,_0x3fe947[_0x207b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 8231125..4f12a5f 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 _0xe929=['exports','express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','/hold','/unhold','calls','/transfer','transfer'];(function(_0x712370,_0x30c65f){var _0x55f38f=function(_0xeddc12){while(--_0xeddc12){_0x712370['push'](_0x712370['shift']());}};_0x55f38f(++_0x30c65f);}(_0xe929,0x67));var _0x9e92=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0xe929[_0xd2d54];return _0x78b113;};'use strict';var express=require(_0x9e92('0x0'));var router=express[_0x9e92('0x1')]();var auth=require(_0x9e92('0x2'));var controller=require('./webbar.controller');router[_0x9e92('0x3')](_0x9e92('0x4'),auth[_0x9e92('0x5')](),auth[_0x9e92('0x6')](),controller[_0x9e92('0x7')]);router[_0x9e92('0x3')](_0x9e92('0x8'),auth[_0x9e92('0x5')](),auth[_0x9e92('0x6')](),controller[_0x9e92('0x9')]);router[_0x9e92('0x3')](_0x9e92('0xa'),auth[_0x9e92('0x5')](),auth[_0x9e92('0x6')](),controller['answer']);router[_0x9e92('0x3')](_0x9e92('0xb'),auth[_0x9e92('0x5')](),auth[_0x9e92('0x6')](),controller['hold']);router['post'](_0x9e92('0xc'),auth['isAuthenticated'](),auth[_0x9e92('0x6')](),controller['unhold']);router['post']('/calls',auth[_0x9e92('0x5')](),auth[_0x9e92('0x6')](),controller[_0x9e92('0xd')]);router[_0x9e92('0x3')](_0x9e92('0xe'),auth[_0x9e92('0x5')](),auth['canUpdate'](),controller[_0x9e92('0xf')]);module[_0x9e92('0x10')]=router; \ No newline at end of file +var _0xc15c=['/transfer','transfer','express','Router','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/unhold','unhold','/calls','calls'];(function(_0x51cb98,_0xe9c7b6){var _0x4b4233=function(_0x27d978){while(--_0x27d978){_0x51cb98['push'](_0x51cb98['shift']());}};_0x4b4233(++_0xe9c7b6);}(_0xc15c,0x1a0));var _0xcc15=function(_0x4da8d4,_0x32b9cc){_0x4da8d4=_0x4da8d4-0x0;var _0x18c0ce=_0xc15c[_0x4da8d4];return _0x18c0ce;};'use strict';var express=require(_0xcc15('0x0'));var router=express[_0xcc15('0x1')]();var auth=require(_0xcc15('0x2'));var controller=require('./webbar.controller');router[_0xcc15('0x3')](_0xcc15('0x4'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0x7')]);router[_0xcc15('0x3')](_0xcc15('0x8'),auth[_0xcc15('0x5')](),auth['canUpdate'](),controller[_0xcc15('0x9')]);router[_0xcc15('0x3')](_0xcc15('0xa'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0xb')]);router[_0xcc15('0x3')]('/hold',auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller['hold']);router['post'](_0xcc15('0xc'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0xd')]);router[_0xcc15('0x3')](_0xcc15('0xe'),auth[_0xcc15('0x5')](),auth[_0xcc15('0x6')](),controller[_0xcc15('0xf')]);router['post'](_0xcc15('0x10'),auth[_0xcc15('0x5')](),auth['canUpdate'](),controller[_0xcc15('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 8e2e68d..635133a 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 _0x780f=['callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','format','webbar:hangup','hangup\x20executed!','catch','answer','answer\x20fired:','sessionId','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','client','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','string','callNumber\x20is\x20required','userId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound','request','then','message','User','findOne','agent','VoiceChannels','filter','rows','UserId','length','\x20not\x20found!','originate','originate\x20fired:','body','json','userId','callNumber'];(function(_0x10ca3f,_0x3bf29f){var _0x47f55b=function(_0x4fdfb1){while(--_0x4fdfb1){_0x10ca3f['push'](_0x10ca3f['shift']());}};_0x47f55b(++_0x3bf29f);}(_0x780f,0x6c));var _0xf780=function(_0x2f3ecd,_0x57976b){_0x2f3ecd=_0x2f3ecd-0x0;var _0xffdc44=_0x780f[_0x2f3ecd];return _0xffdc44;};'use strict';var path=require(_0xf780('0x0'));var fs=require('fs');var _=require(_0xf780('0x1'));var db=require(_0xf780('0x2'))['db'];var config=require(_0xf780('0x3'));var util=require(_0xf780('0x4'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var amiClient=jayson[_0xf780('0x5')][_0xf780('0x6')]({'port':0x232a});var logger=require(_0xf780('0x7'))(_0xf780('0x8'));var Redis=require('ioredis');config[_0xf780('0x9')]=_['defaults'](config[_0xf780('0x9')],{'host':_0xf780('0xa'),'port':0x18eb});var io=require(_0xf780('0xb'))(new Redis(config[_0xf780('0x9')]));var Schema=require(_0xf780('0xc'));var originateValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xf780('0xe'),'required':[!![],_0xf780('0xf')]},'callerId':{'type':_0xf780('0xe')},'callbackUrl':{'type':_0xf780('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]},'sessionId':{'type':_0xf780('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf780('0xe'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]},'sessionId':{'type':_0xf780('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xf780('0xe'),'required':[!![],_0xf780('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xf780('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]}});var conferenceValidation=new Schema({'userId':{'type':_0xf780('0xd'),'required':[!![],_0xf780('0x10')]}});function emit(_0x335ba6,_0x422ef4,_0x51b096){logger[_0xf780('0x12')](_0x335ba6,_0x422ef4,JSON[_0xf780('0x13')](_0x51b096));io['to'](_0x335ba6)[_0xf780('0x14')](_0x422ef4,_0x51b096);}function handleError(_0x113834){return function(_0x5d5a81){console[_0xf780('0x15')]('handleError:',_0x5d5a81,_0x5d5a81 instanceof RangeError);logger[_0xf780('0x16')](_0x5d5a81[_0xf780('0x17')]);if(_0x5d5a81 instanceof RangeError){if(_0x5d5a81['name']){delete _0x5d5a81[_0xf780('0x18')];}_0x113834[_0xf780('0x19')](0x194)['send'](_0x5d5a81);}else{if(_0x5d5a81[_0xf780('0x18')]){delete _0x5d5a81[_0xf780('0x18')];}_0x113834[_0xf780('0x19')](0x1f4)[_0xf780('0x1a')](_0x5d5a81);}};}function checkError(){return function(_0x352cf1){if(!_0x352cf1){throw new RangeError(_0xf780('0x1b'));}return _0x352cf1;};}function respondWithRpcPromise(_0x504f6f,_0xef462a){return new BPromise(function(_0x4de546,_0x5853ea){var _0x45d80e=amiClient;return _0x45d80e[_0xf780('0x1c')](_0x504f6f,_0xef462a)[_0xf780('0x1d')](function(_0x58bb66){if(_0x58bb66[_0xf780('0x16')]){if(_0x58bb66[_0xf780('0x16')]['code']===0x1f4){return _0x5853ea(_0x58bb66[_0xf780('0x16')]['message']);}return _0x4de546(_0x58bb66[_0xf780('0x16')][_0xf780('0x1e')]);}else{_0x4de546(_0x58bb66['result']);}})['catch'](function(_0x3710bb){_0x5853ea(_0x3710bb);});});}function getAgent(_0x1ef4f1){return db[_0xf780('0x1f')][_0xf780('0x20')]({'where':{'id':_0x1ef4f1,'role':_0xf780('0x21')}})[_0xf780('0x1d')](checkError());}function getAgentCheckSession(_0x34d7b3,_0x57e5e8){return new BPromise(function(_0x5a3547,_0x5bd4df){var _0x3f5498=respondWithRpcPromise(_0xf780('0x22'));var _0x26452f=getAgent(_0x34d7b3);Promise['all']([_0x3f5498,_0x26452f])['then'](function(_0x36bc63){var _0x149190=_0x36bc63[0x0];var _0x2b832d=_0x36bc63[0x1];var _0x5e6b25=_[_0xf780('0x23')](_0x149190[_0xf780('0x24')],function(_0x2368e3){return _0x2368e3[_0xf780('0x25')]==_0x2b832d['id']&&_0x2368e3['sessionId']==_0x57e5e8;});if(_0x5e6b25[_0xf780('0x26')]==0x1){_0x5a3547(_0x2b832d);}else{_0x5bd4df(new RangeError('sessionId\x20'+_0x57e5e8+_0xf780('0x27')));}});});}exports[_0xf780('0x28')]=function(_0x244f97,_0x23a019){logger[_0xf780('0x12')](_0xf780('0x29'),_0x244f97[_0xf780('0x2a')]);var _0xc0cc66=originateValidation['validate'](_0x244f97[_0xf780('0x2a')]);if(_0xc0cc66[_0xf780('0x26')]>0x0){return _0x23a019[_0xf780('0x19')](0x190)[_0xf780('0x2b')](_0xc0cc66);}var _0x58bc24=_0x244f97['body'][_0xf780('0x2c')];var _0x49632f=_0x244f97[_0xf780('0x2a')][_0xf780('0x2d')];var _0x3a2a24=_0x244f97['body'][_0xf780('0x2e')];var _0x46893b=_0x244f97[_0xf780('0x2a')][_0xf780('0x2f')];return getAgent(_0x58bc24)['then'](function(_0x46b36a){logger['info'](_0xf780('0x30'),_0x46b36a['name']);emit(util['format'](_0xf780('0x31'),_0x46b36a['name']),_0xf780('0x32'),{'callNumber':_0x49632f,'callerId':_0x3a2a24,'callbackUrl':_0x46893b});return _0x23a019[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x33')});})['catch'](handleError(_0x23a019));};exports[_0xf780('0x34')]=function(_0x1765ac,_0x3482f2){logger[_0xf780('0x12')]('hangup\x20fired:',_0x1765ac[_0xf780('0x2a')]);var _0x160cb4=hangupValidation[_0xf780('0xc')](_0x1765ac[_0xf780('0x2a')]);if(_0x160cb4[_0xf780('0x26')]>0x0){return _0x3482f2['status'](0x190)['json'](_0x160cb4);}var _0x3297c9=_0x1765ac[_0xf780('0x2a')][_0xf780('0x2c')];var _0x3fe908=_0x1765ac[_0xf780('0x2a')]['sessionId'];return getAgent(_0x3297c9)[_0xf780('0x1d')](function(_0x511883){logger[_0xf780('0x12')](_0xf780('0x30'),_0x511883[_0xf780('0x18')]);emit(util[_0xf780('0x35')]('user:%s',_0x511883[_0xf780('0x18')]),_0xf780('0x36'),{'sessionId':_0x3fe908});return _0x3482f2[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x37')});})[_0xf780('0x38')](handleError(_0x3482f2));};exports[_0xf780('0x39')]=function(_0x1af20f,_0x343635){logger[_0xf780('0x12')](_0xf780('0x3a'),_0x1af20f[_0xf780('0x2a')]);var _0x406a9e=answerValidation[_0xf780('0xc')](_0x1af20f['body']);if(_0x406a9e[_0xf780('0x26')]>0x0){return _0x343635['status'](0x190)[_0xf780('0x2b')](_0x406a9e);}var _0x3bf697=_0x1af20f['body']['userId'];var _0x564c9a=_0x1af20f['body'][_0xf780('0x3b')];return getAgent(_0x3bf697)['then'](function(_0x2c831e){logger[_0xf780('0x12')](_0xf780('0x30'),_0x2c831e[_0xf780('0x18')]);emit(util[_0xf780('0x35')]('user:%s',_0x2c831e['name']),'webbar:answer',{'sessionId':_0x564c9a});return _0x343635['status'](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x3c')});})[_0xf780('0x38')](handleError(_0x343635));};exports[_0xf780('0x3d')]=function(_0xcfee8e,_0x2608ed){logger['info'](_0xf780('0x3e'),_0xcfee8e[_0xf780('0x2a')]);var _0x2a5a7c=holdValidation[_0xf780('0xc')](_0xcfee8e[_0xf780('0x2a')]);if(_0x2a5a7c[_0xf780('0x26')]>0x0){return _0x2608ed['status'](0x190)[_0xf780('0x2b')](_0x2a5a7c);}var _0x5c4170=_0xcfee8e[_0xf780('0x2a')]['userId'];var _0x45fe02=_0xcfee8e['body']['sessionId'];return getAgent(_0x5c4170)[_0xf780('0x1d')](function(_0x72a225){logger[_0xf780('0x12')](_0xf780('0x30'),_0x72a225['name']);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x72a225[_0xf780('0x18')]),_0xf780('0x3f'),{'sessionId':_0x45fe02});return _0x2608ed[_0xf780('0x19')](0xc8)['json']({'error':![],'message':_0xf780('0x40')});})['catch'](handleError(_0x2608ed));};exports[_0xf780('0x41')]=function(_0x1b492a,_0x22c52d){logger[_0xf780('0x12')](_0xf780('0x42'),_0x1b492a['body']);var _0x48f696=unholdValidation[_0xf780('0xc')](_0x1b492a[_0xf780('0x2a')]);if(_0x48f696[_0xf780('0x26')]>0x0){return _0x22c52d[_0xf780('0x19')](0x190)['json'](_0x48f696);}var _0x4094d5=_0x1b492a[_0xf780('0x2a')][_0xf780('0x2c')];var _0x3f71d2=_0x1b492a[_0xf780('0x2a')][_0xf780('0x3b')];return getAgent(_0x4094d5)['then'](function(_0x2c9932){logger[_0xf780('0x12')]('entityFound:',_0x2c9932[_0xf780('0x18')]);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x2c9932[_0xf780('0x18')]),_0xf780('0x43'),{'sessionId':_0x3f71d2});return _0x22c52d[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x44')});})[_0xf780('0x38')](handleError(_0x22c52d));};exports[_0xf780('0x45')]=function(_0x390bf1,_0x324f74){logger['info'](_0xf780('0x46'),_0x324f74['body']);var _0x1815de=callsValidation[_0xf780('0xc')](_0x390bf1['body']);if(_0x1815de['length']>0x0){return _0x324f74['status'](0x190)[_0xf780('0x2b')](_0x1815de);}var _0x37df9e=_0x390bf1[_0xf780('0x2a')]['userId'];var _0x586ce6=respondWithRpcPromise('VoiceChannels');var _0x1d3cf1=getAgent(_0x37df9e);return Promise['all']([_0x586ce6,_0x1d3cf1])[_0xf780('0x1d')](function(_0xcffb55){var _0x141906=_0xcffb55[0x0];var _0x593c17=_0xcffb55[0x1];var _0x6da9ca=_['filter'](_0x141906[_0xf780('0x24')],function(_0x1aad3a){return _0x1aad3a['UserId']==_0x593c17['id'];});return _0x324f74[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'count':_0x6da9ca[_0xf780('0x26')],'rows':_0x6da9ca});})[_0xf780('0x38')](handleError(_0x324f74));};exports[_0xf780('0x47')]=function(_0x308181,_0xd80251){logger['info']('conference\x20fired:',_0x308181[_0xf780('0x2a')]);var _0x3aaba0=conferenceValidation['validate'](_0x308181[_0xf780('0x2a')]);if(_0x3aaba0[_0xf780('0x26')]>0x0){return _0xd80251[_0xf780('0x19')](0x190)[_0xf780('0x2b')](_0x3aaba0);}var _0x4162a6=_0x308181['body']['userId'];return getAgent(_0x4162a6)[_0xf780('0x1d')](function(_0x5f052e){logger[_0xf780('0x12')]('entityFound:',_0x5f052e[_0xf780('0x18')]);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x5f052e[_0xf780('0x18')]),_0xf780('0x48'));return _0xd80251['status'](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x49')});})[_0xf780('0x38')](handleError(_0xd80251));};exports['transfer']=function(_0x4a61fe,_0x356b63){logger[_0xf780('0x12')](_0xf780('0x4a'),_0x4a61fe['body']);var _0x49f751=transferValidation[_0xf780('0xc')](_0x4a61fe[_0xf780('0x2a')]);if(_0x49f751[_0xf780('0x26')]>0x0){return _0x356b63[_0xf780('0x19')](0x190)[_0xf780('0x2b')](_0x49f751);}var _0x31d999=_0x4a61fe['body'][_0xf780('0x2c')];var _0x33cdcc=_0x4a61fe[_0xf780('0x2a')]['sessionId'];var _0x58f573=_0x4a61fe[_0xf780('0x2a')]['transferNumber'];return getAgent(_0x31d999)[_0xf780('0x1d')](function(_0x18db9f){logger[_0xf780('0x12')](_0xf780('0x30'),_0x18db9f[_0xf780('0x18')]);emit(util[_0xf780('0x35')](_0xf780('0x31'),_0x18db9f[_0xf780('0x18')]),_0xf780('0x4b'),{'sessionId':_0x33cdcc,'transferNumber':_0x58f573});return _0x356b63[_0xf780('0x19')](0xc8)[_0xf780('0x2b')]({'error':![],'message':_0xf780('0x4c')});})[_0xf780('0x38')](handleError(_0x356b63));}; \ No newline at end of file +var _0x7980=['webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','calls\x20fired:','UserId','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','error','name','send','status','NotFound','request','then','code','message','result','User','agent','VoiceChannels','all','filter','sessionId','length','sessionId\x20','\x20not\x20found!','originate','info','originate\x20fired:','body','validate','callNumber','callerId','user:%s','webbar:originate','json','originate\x20executed!','catch','hangup','hangup\x20fired:','userId','entityFound:','webbar:hangup','hangup\x20executed!','answer\x20fired:','format','answer\x20executed!','hold\x20fired:'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x7980,0xab));var _0x0798=function(_0xaeff9a,_0x1f31e6){_0xaeff9a=_0xaeff9a-0x0;var _0x16208d=_0x7980[_0xaeff9a];return _0x16208d;};'use strict';var path=require(_0x0798('0x0'));var fs=require('fs');var _=require(_0x0798('0x1'));var db=require(_0x0798('0x2'))['db'];var config=require(_0x0798('0x3'));var util=require(_0x0798('0x4'));var BPromise=require('bluebird');var jayson=require(_0x0798('0x5'));var amiClient=jayson[_0x0798('0x6')][_0x0798('0x7')]({'port':0x232a});var logger=require(_0x0798('0x8'))(_0x0798('0x9'));var Redis=require('ioredis');config[_0x0798('0xa')]=_['defaults'](config[_0x0798('0xa')],{'host':_0x0798('0xb'),'port':0x18eb});var io=require(_0x0798('0xc'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]},'callNumber':{'type':_0x0798('0xf'),'required':[!![],_0x0798('0x10')]},'callerId':{'type':_0x0798('0xf')},'callbackUrl':{'type':_0x0798('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]},'sessionId':{'type':_0x0798('0xf'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x0798('0xf'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0x0798('0x11')]},'transferNumber':{'type':_0x0798('0xf'),'required':[!![],_0x0798('0x12')]}});var holdValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]},'sessionId':{'type':_0x0798('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0x0798('0xd'),'required':[!![],_0x0798('0xe')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});function emit(_0x21c30b,_0x45cae6,_0x258081){logger['info'](_0x21c30b,_0x45cae6,JSON['stringify'](_0x258081));io['to'](_0x21c30b)[_0x0798('0x13')](_0x45cae6,_0x258081);}function handleError(_0x502635){return function(_0x41e217){console[_0x0798('0x14')](_0x0798('0x15'),_0x41e217,_0x41e217 instanceof RangeError);logger[_0x0798('0x16')](_0x41e217['stack']);if(_0x41e217 instanceof RangeError){if(_0x41e217[_0x0798('0x17')]){delete _0x41e217[_0x0798('0x17')];}_0x502635['status'](0x194)[_0x0798('0x18')](_0x41e217);}else{if(_0x41e217[_0x0798('0x17')]){delete _0x41e217[_0x0798('0x17')];}_0x502635[_0x0798('0x19')](0x1f4)[_0x0798('0x18')](_0x41e217);}};}function checkError(){return function(_0x273ba8){if(!_0x273ba8){throw new RangeError(_0x0798('0x1a'));}return _0x273ba8;};}function respondWithRpcPromise(_0x212ad5,_0x23b37d){return new BPromise(function(_0x4a86d5,_0x2aaabf){var _0x35c141=amiClient;return _0x35c141[_0x0798('0x1b')](_0x212ad5,_0x23b37d)[_0x0798('0x1c')](function(_0x20654b){if(_0x20654b[_0x0798('0x16')]){if(_0x20654b['error'][_0x0798('0x1d')]===0x1f4){return _0x2aaabf(_0x20654b[_0x0798('0x16')][_0x0798('0x1e')]);}return _0x4a86d5(_0x20654b[_0x0798('0x16')][_0x0798('0x1e')]);}else{_0x4a86d5(_0x20654b[_0x0798('0x1f')]);}})['catch'](function(_0x43d99f){_0x2aaabf(_0x43d99f);});});}function getAgent(_0x14f828){return db[_0x0798('0x20')]['findOne']({'where':{'id':_0x14f828,'role':_0x0798('0x21')}})['then'](checkError());}function getAgentCheckSession(_0x53a3d7,_0x406030){return new BPromise(function(_0x2dfbff,_0x134d24){var _0xaa949b=respondWithRpcPromise(_0x0798('0x22'));var _0x161244=getAgent(_0x53a3d7);Promise[_0x0798('0x23')]([_0xaa949b,_0x161244])[_0x0798('0x1c')](function(_0x5bbe3d){var _0x167960=_0x5bbe3d[0x0];var _0x4f5d1d=_0x5bbe3d[0x1];var _0x5f1780=_[_0x0798('0x24')](_0x167960['rows'],function(_0x1dabd5){return _0x1dabd5['UserId']==_0x4f5d1d['id']&&_0x1dabd5[_0x0798('0x25')]==_0x406030;});if(_0x5f1780[_0x0798('0x26')]==0x1){_0x2dfbff(_0x4f5d1d);}else{_0x134d24(new RangeError(_0x0798('0x27')+_0x406030+_0x0798('0x28')));}});});}exports[_0x0798('0x29')]=function(_0x1ebd07,_0xa1376e){logger[_0x0798('0x2a')](_0x0798('0x2b'),_0x1ebd07[_0x0798('0x2c')]);var _0x54a955=originateValidation[_0x0798('0x2d')](_0x1ebd07['body']);if(_0x54a955[_0x0798('0x26')]>0x0){return _0xa1376e['status'](0x190)['json'](_0x54a955);}var _0x104d23=_0x1ebd07[_0x0798('0x2c')]['userId'];var _0x49d5b8=_0x1ebd07[_0x0798('0x2c')][_0x0798('0x2e')];var _0x322adf=_0x1ebd07[_0x0798('0x2c')][_0x0798('0x2f')];var _0x2ad922=_0x1ebd07['body']['callbackUrl'];return getAgent(_0x104d23)[_0x0798('0x1c')](function(_0x23a70b){logger[_0x0798('0x2a')]('entityFound:',_0x23a70b['name']);emit(util['format'](_0x0798('0x30'),_0x23a70b[_0x0798('0x17')]),_0x0798('0x31'),{'callNumber':_0x49d5b8,'callerId':_0x322adf,'callbackUrl':_0x2ad922});return _0xa1376e[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x33')});})[_0x0798('0x34')](handleError(_0xa1376e));};exports[_0x0798('0x35')]=function(_0x502556,_0x16dae6){logger['info'](_0x0798('0x36'),_0x502556[_0x0798('0x2c')]);var _0x2caa82=hangupValidation['validate'](_0x502556[_0x0798('0x2c')]);if(_0x2caa82['length']>0x0){return _0x16dae6[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x2caa82);}var _0x223751=_0x502556['body'][_0x0798('0x37')];var _0xb5937b=_0x502556['body'][_0x0798('0x25')];return getAgent(_0x223751)['then'](function(_0x4e9d94){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x4e9d94['name']);emit(util['format'](_0x0798('0x30'),_0x4e9d94[_0x0798('0x17')]),_0x0798('0x39'),{'sessionId':_0xb5937b});return _0x16dae6[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x3a')});})[_0x0798('0x34')](handleError(_0x16dae6));};exports['answer']=function(_0x3aa79c,_0x11c5bf){logger[_0x0798('0x2a')](_0x0798('0x3b'),_0x3aa79c[_0x0798('0x2c')]);var _0x26e9cb=answerValidation['validate'](_0x3aa79c[_0x0798('0x2c')]);if(_0x26e9cb[_0x0798('0x26')]>0x0){return _0x11c5bf[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x26e9cb);}var _0x387450=_0x3aa79c[_0x0798('0x2c')][_0x0798('0x37')];var _0x10a50a=_0x3aa79c[_0x0798('0x2c')][_0x0798('0x25')];return getAgent(_0x387450)[_0x0798('0x1c')](function(_0x31a3cb){logger['info'](_0x0798('0x38'),_0x31a3cb[_0x0798('0x17')]);emit(util[_0x0798('0x3c')](_0x0798('0x30'),_0x31a3cb['name']),'webbar:answer',{'sessionId':_0x10a50a});return _0x11c5bf[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x3d')});})[_0x0798('0x34')](handleError(_0x11c5bf));};exports['hold']=function(_0x21c28c,_0x4858e6){logger['info'](_0x0798('0x3e'),_0x21c28c[_0x0798('0x2c')]);var _0x42c5b8=holdValidation[_0x0798('0x2d')](_0x21c28c[_0x0798('0x2c')]);if(_0x42c5b8[_0x0798('0x26')]>0x0){return _0x4858e6[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x42c5b8);}var _0x182e3b=_0x21c28c['body'][_0x0798('0x37')];var _0x56d438=_0x21c28c[_0x0798('0x2c')][_0x0798('0x25')];return getAgent(_0x182e3b)[_0x0798('0x1c')](function(_0x54634d){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x54634d[_0x0798('0x17')]);emit(util[_0x0798('0x3c')]('user:%s',_0x54634d[_0x0798('0x17')]),_0x0798('0x3f'),{'sessionId':_0x56d438});return _0x4858e6[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x40')});})['catch'](handleError(_0x4858e6));};exports[_0x0798('0x41')]=function(_0x3e1c15,_0x2679b1){logger[_0x0798('0x2a')](_0x0798('0x42'),_0x3e1c15[_0x0798('0x2c')]);var _0x181757=unholdValidation[_0x0798('0x2d')](_0x3e1c15[_0x0798('0x2c')]);if(_0x181757['length']>0x0){return _0x2679b1['status'](0x190)[_0x0798('0x32')](_0x181757);}var _0x499073=_0x3e1c15[_0x0798('0x2c')][_0x0798('0x37')];var _0x40b3d6=_0x3e1c15[_0x0798('0x2c')][_0x0798('0x25')];return getAgent(_0x499073)['then'](function(_0x3cb0b4){logger['info'](_0x0798('0x38'),_0x3cb0b4[_0x0798('0x17')]);emit(util[_0x0798('0x3c')]('user:%s',_0x3cb0b4['name']),'webbar:unhold',{'sessionId':_0x40b3d6});return _0x2679b1[_0x0798('0x19')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x0798('0x34')](handleError(_0x2679b1));};exports[_0x0798('0x43')]=function(_0x455d19,_0x499580){logger[_0x0798('0x2a')](_0x0798('0x44'),_0x499580[_0x0798('0x2c')]);var _0x743d26=callsValidation['validate'](_0x455d19['body']);if(_0x743d26[_0x0798('0x26')]>0x0){return _0x499580[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x743d26);}var _0x59ad6c=_0x455d19['body'][_0x0798('0x37')];var _0x82599=respondWithRpcPromise(_0x0798('0x22'));var _0x190467=getAgent(_0x59ad6c);return Promise[_0x0798('0x23')]([_0x82599,_0x190467])[_0x0798('0x1c')](function(_0x18c0fa){var _0x1a55c0=_0x18c0fa[0x0];var _0x4f35c7=_0x18c0fa[0x1];var _0x349f86=_[_0x0798('0x24')](_0x1a55c0['rows'],function(_0x3ab2cc){return _0x3ab2cc[_0x0798('0x45')]==_0x4f35c7['id'];});return _0x499580['status'](0xc8)[_0x0798('0x32')]({'count':_0x349f86[_0x0798('0x26')],'rows':_0x349f86});})[_0x0798('0x34')](handleError(_0x499580));};exports[_0x0798('0x46')]=function(_0x458a4e,_0x541669){logger[_0x0798('0x2a')](_0x0798('0x47'),_0x458a4e[_0x0798('0x2c')]);var _0x47cfc0=conferenceValidation[_0x0798('0x2d')](_0x458a4e['body']);if(_0x47cfc0[_0x0798('0x26')]>0x0){return _0x541669[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x47cfc0);}var _0x26b393=_0x458a4e[_0x0798('0x2c')][_0x0798('0x37')];return getAgent(_0x26b393)['then'](function(_0x3cc8bd){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x3cc8bd[_0x0798('0x17')]);emit(util['format'](_0x0798('0x30'),_0x3cc8bd[_0x0798('0x17')]),_0x0798('0x48'));return _0x541669[_0x0798('0x19')](0xc8)[_0x0798('0x32')]({'error':![],'message':'conference\x20executed!'});})[_0x0798('0x34')](handleError(_0x541669));};exports[_0x0798('0x49')]=function(_0x5668b7,_0x48d1d1){logger[_0x0798('0x2a')](_0x0798('0x4a'),_0x5668b7['body']);var _0x2f336a=transferValidation[_0x0798('0x2d')](_0x5668b7[_0x0798('0x2c')]);if(_0x2f336a[_0x0798('0x26')]>0x0){return _0x48d1d1[_0x0798('0x19')](0x190)[_0x0798('0x32')](_0x2f336a);}var _0x21c156=_0x5668b7[_0x0798('0x2c')]['userId'];var _0x316762=_0x5668b7[_0x0798('0x2c')][_0x0798('0x25')];var _0xf5100e=_0x5668b7['body'][_0x0798('0x4b')];return getAgent(_0x21c156)[_0x0798('0x1c')](function(_0x11946d){logger[_0x0798('0x2a')](_0x0798('0x38'),_0x11946d[_0x0798('0x17')]);emit(util[_0x0798('0x3c')](_0x0798('0x30'),_0x11946d['name']),_0x0798('0x4c'),{'sessionId':_0x316762,'transferNumber':_0xf5100e});return _0x48d1d1['status'](0xc8)[_0x0798('0x32')]({'error':![],'message':_0x0798('0x4d')});})[_0x0798('0x34')](handleError(_0x48d1d1));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index f909f8d..7d14cc4 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 _0x0598=['put','update','delete','destroy','/:id/canned_answers','removeAgents','multer','util','connect-timeout','fs-extra','../../components/auth/service','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','addApplications','/:id/notify'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0598,0x92));var _0x8059=function(_0x5e8857,_0x1e44a8){_0x5e8857=_0x5e8857-0x0;var _0x3c9c84=_0x0598[_0x5e8857];return _0x3c9c84;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappAccount.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x5')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x9')]);router[_0x8059('0x5')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router['get']('/:id/canned_answers',auth[_0x8059('0x6')](),controller[_0x8059('0xc')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x8059('0xd')]);router[_0x8059('0x5')](_0x8059('0xe'),auth[_0x8059('0x6')](),controller[_0x8059('0xf')]);router['post']('/',auth[_0x8059('0x6')](),controller['create']);router[_0x8059('0x10')]('/:id/dispositions',auth[_0x8059('0x6')](),controller[_0x8059('0x11')]);router[_0x8059('0x10')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0x8059('0x10')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x13')]);router[_0x8059('0x10')]('/:id/applications',auth[_0x8059('0x6')](),controller[_0x8059('0x14')]);router[_0x8059('0x10')](_0x8059('0x15'),controller['notify']);router[_0x8059('0x10')]('/:id/send',auth[_0x8059('0x6')](),controller['send']);router[_0x8059('0x16')]('/:id',auth[_0x8059('0x6')](),controller[_0x8059('0x17')]);router[_0x8059('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0x19')]);router[_0x8059('0x18')](_0x8059('0xa'),auth[_0x8059('0x6')](),controller['removeDispositions']);router[_0x8059('0x18')](_0x8059('0x1a'),auth[_0x8059('0x6')](),controller['removeAnswers']);router[_0x8059('0x18')](_0x8059('0x12'),auth[_0x8059('0x6')](),controller[_0x8059('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x47c5=['/:id/notify','notify','send','update','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x47c5,0x165));var _0x547c=function(_0x13179f,_0x21f5dd){_0x13179f=_0x13179f-0x0;var _0x51b9e3=_0x47c5[_0x13179f];return _0x51b9e3;};'use strict';var multer=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var path=require(_0x547c('0x2'));var timeout=require(_0x547c('0x3'));var express=require(_0x547c('0x4'));var router=express[_0x547c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x547c('0x6'));var interaction=require(_0x547c('0x7'));var config=require('../../config/environment');var controller=require(_0x547c('0x8'));router[_0x547c('0x9')]('/',auth['isAuthenticated'](),controller[_0x547c('0xa')]);router[_0x547c('0x9')](_0x547c('0xb'),auth[_0x547c('0xc')](),controller[_0x547c('0xd')]);router[_0x547c('0x9')](_0x547c('0xe'),auth[_0x547c('0xc')](),controller[_0x547c('0xf')]);router[_0x547c('0x9')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x11')]);router[_0x547c('0x9')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x13')]);router['get'](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['getAgents']);router[_0x547c('0x9')](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x16')]);router[_0x547c('0x17')]('/',auth[_0x547c('0xc')](),controller[_0x547c('0x18')]);router[_0x547c('0x17')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller[_0x547c('0x19')]);router[_0x547c('0x17')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x1a')]);router[_0x547c('0x17')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller['addAgents']);router['post'](_0x547c('0x15'),auth[_0x547c('0xc')](),controller[_0x547c('0x1b')]);router['post'](_0x547c('0x1c'),controller[_0x547c('0x1d')]);router[_0x547c('0x17')]('/:id/send',auth[_0x547c('0xc')](),controller[_0x547c('0x1e')]);router['put']('/:id',auth[_0x547c('0xc')](),controller[_0x547c('0x1f')]);router['delete'](_0x547c('0xe'),auth[_0x547c('0xc')](),controller['destroy']);router[_0x547c('0x20')](_0x547c('0x10'),auth[_0x547c('0xc')](),controller['removeDispositions']);router[_0x547c('0x20')](_0x547c('0x12'),auth[_0x547c('0xc')](),controller[_0x547c('0x21')]);router[_0x547c('0x20')](_0x547c('0x14'),auth[_0x547c('0xc')](),controller[_0x547c('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index a877c40..533ad31 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 _0xa701=['mandatoryDisposition','randomstring','exports','name','STRING','generate','twilio','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x55cdc7,_0x1338eb){var _0x199323=function(_0x5752cf){while(--_0x5752cf){_0x55cdc7['push'](_0x55cdc7['shift']());}};_0x199323(++_0x1338eb);}(_0xa701,0x90));var _0x1a70=function(_0x1f2815,_0x80af22){_0x1f2815=_0x1f2815-0x0;var _0x5b13a6=_0xa701[_0x1f2815];return _0x5b13a6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x1a70('0x0'));module[_0x1a70('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1a70('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x1a70('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x1a70('0x3')],'defaultValue':function(){return rs[_0x1a70('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1a70('0x5'),'sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x1a70('0x3')]},'authToken':{'type':Sequelize[_0x1a70('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1a70('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1a70('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1a70('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1a70('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1a70('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1a70('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1a70('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1a70('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1a70('0x7')],'defaultValue':![],'comment':_0x1a70('0x9'),'set':function(_0x4a3db0){if(!_0x4a3db0){this[_0x1a70('0xa')](_0x1a70('0xb'),null);}this[_0x1a70('0xa')](_0x1a70('0xc'),_0x4a3db0);}},'description':{'type':Sequelize[_0x1a70('0x3')]}}; \ No newline at end of file +var _0xb625=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4e290f,_0x344070){var _0x116b7d=function(_0x42df8f){while(--_0x42df8f){_0x4e290f['push'](_0x4e290f['shift']());}};_0x116b7d(++_0x344070);}(_0xb625,0x9c));var _0x5b62=function(_0x21e6f1,_0x4d5eb5){_0x21e6f1=_0x21e6f1-0x0;var _0x44a394=_0xb625[_0x21e6f1];return _0x44a394;};'use strict';var Sequelize=require(_0x5b62('0x0'));var rs=require(_0x5b62('0x1'));module[_0x5b62('0x2')]={'name':{'type':Sequelize[_0x5b62('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x5b62('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x5b62('0x3')],'defaultValue':function(){return rs[_0x5b62('0x4')]();}},'phone':{'type':Sequelize[_0x5b62('0x3')]},'type':{'type':Sequelize[_0x5b62('0x5')](_0x5b62('0x6'),_0x5b62('0x7'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x5b62('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x5b62('0x8')],'defaultValue':function(){return _0x5b62('0x9');}},'notificationSound':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5b62('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5b62('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5b62('0xb')],'comment':_0x5b62('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x5b62('0xa')],'defaultValue':![],'comment':_0x5b62('0xd'),'set':function(_0x49c5a3){if(!_0x49c5a3){this[_0x5b62('0xe')](_0x5b62('0xf'),null);}this[_0x5b62('0xe')](_0x5b62('0x10'),_0x49c5a3);}},'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 0c43264..d4410de 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 _0x4c68=['created','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','List','out','WhatsappMessage','dataValues','Messages','push','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappAccount.socket','register','client','http','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','then','destroy','get','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','WhatsappAccount','includeAll','include','findAll','catch','show','params','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','hasOwnProperty','WhatsappAccountId','removeDispositions','addAnswer','CannedAnswer','getAnswers','rawAttributes','rows','removeAnswers','ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','priority','pick','getApplications','notify','AC\x20WhatsappAccount\x20notify','whatsapp','Applications','account','applications','asc','CmContact','ValidationError','no\x20available\x20attributes','AC\x20sinch\x20req.body:%s','difference','createdAt','updatedAt','CompanyId','ListId','AC\x20sinch\x20routing.account.type:%s','AC\x20sinch\x20contactFields:%s','AC\x20sinch\x20contactKeys:%s','twilio','from','From','replace','messageId','MessageSid','sinch','AC\x20sinch\x20req.body\x202:%s','notifications','message_id','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','Sequelize','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','contact','WhatsappInteraction','interaction','close','unmanaged','*,*,*,*'];(function(_0x43347e,_0x12f3ac){var _0xcb5363=function(_0xeae5b4){while(--_0xeae5b4){_0x43347e['push'](_0x43347e['shift']());}};_0xcb5363(++_0x12f3ac);}(_0x4c68,0x198));var _0x84c6=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0x4c68[_0x38987f];return _0x4cb697;};'use strict';var emlformat=require(_0x84c6('0x0'));var rimraf=require(_0x84c6('0x1'));var zipdir=require(_0x84c6('0x2'));var jsonpatch=require(_0x84c6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x84c6('0x4'));var Mustache=require('mustache');var util=require(_0x84c6('0x5'));var path=require(_0x84c6('0x6'));var sox=require(_0x84c6('0x7'));var csv=require('to-csv');var ejs=require(_0x84c6('0x8'));var fs=require('fs');var fs_extra=require(_0x84c6('0x9'));var _=require(_0x84c6('0xa'));var squel=require(_0x84c6('0xb'));var crypto=require(_0x84c6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x84c6('0xd'));var toCsv=require(_0x84c6('0xe'));var querystring=require('querystring');var Papa=require(_0x84c6('0xf'));var Redis=require(_0x84c6('0x10'));var authService=require(_0x84c6('0x11'));var qs=require(_0x84c6('0x12'));var as=require(_0x84c6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x84c6('0x14'))('api');var utils=require(_0x84c6('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x84c6('0x16'));var db=require(_0x84c6('0x17'))['db'];config[_0x84c6('0x18')]=_[_0x84c6('0x19')](config[_0x84c6('0x18')],{'host':_0x84c6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84c6('0x18')]));require(_0x84c6('0x1b'))[_0x84c6('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x84c6('0x1d')][_0x84c6('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x52af32,_0x1b980b,_0x995c7b,_0x3dd0a1){return new BPromise(function(_0xc51008,_0x18b2cf){var _0x28c3cb=_0x3dd0a1||client;return _0x28c3cb['request'](_0x52af32,_0x995c7b)['then'](function(_0x5f1ced){logger[_0x84c6('0x1f')](_0x84c6('0x20'),_0x1b980b,_0x84c6('0x21'));logger['debug'](_0x84c6('0x22'),_0x1b980b,_0x84c6('0x21'),JSON[_0x84c6('0x23')](_0x5f1ced));if(_0x5f1ced['error']){if(_0x5f1ced[_0x84c6('0x24')][_0x84c6('0x25')]===0x1f4){logger[_0x84c6('0x24')](_0x84c6('0x20'),_0x1b980b,_0x5f1ced[_0x84c6('0x24')][_0x84c6('0x26')]);return _0x18b2cf(_0x5f1ced[_0x84c6('0x24')][_0x84c6('0x26')]);}logger[_0x84c6('0x24')](_0x84c6('0x20'),_0x1b980b,_0x5f1ced[_0x84c6('0x24')][_0x84c6('0x26')]);return _0xc51008(_0x5f1ced[_0x84c6('0x24')][_0x84c6('0x26')]);}else{logger[_0x84c6('0x1f')](_0x84c6('0x20'),_0x1b980b,_0x84c6('0x21'));_0xc51008(_0x5f1ced[_0x84c6('0x27')][_0x84c6('0x26')]);}})['catch'](function(_0xc8c3e4){logger['error'](_0x84c6('0x20'),_0x1b980b,_0xc8c3e4);_0x18b2cf(_0xc8c3e4);});});}function respondWithStatusCode(_0x1bf39d,_0x5ca3a0){_0x5ca3a0=_0x5ca3a0||0xcc;return function(_0x16a10d){if(_0x16a10d){return _0x1bf39d[_0x84c6('0x28')](_0x5ca3a0);}return _0x1bf39d[_0x84c6('0x29')](_0x5ca3a0)[_0x84c6('0x2a')]();};}function respondWithResult(_0x187408,_0x4cd962){_0x4cd962=_0x4cd962||0xc8;return function(_0x43a838){if(_0x43a838){return _0x187408[_0x84c6('0x29')](_0x4cd962)[_0x84c6('0x2b')](_0x43a838);}};}function respondWithFilteredResult(_0x5ad8fe,_0x18e225){return function(_0x490023){if(_0x490023){var _0x48c90c=typeof _0x18e225[_0x84c6('0x2c')]===_0x84c6('0x2d')&&typeof _0x18e225[_0x84c6('0x2e')]===_0x84c6('0x2d');var _0x59ff77=_0x490023[_0x84c6('0x2f')];var _0x4a7a2f=_0x48c90c?0x0:_0x18e225[_0x84c6('0x2c')];var _0x5d28ce=_0x48c90c?_0x490023[_0x84c6('0x2f')]:_0x18e225[_0x84c6('0x2c')]+_0x18e225['limit'];var _0x48d835;if(_0x5d28ce>=_0x59ff77){_0x5d28ce=_0x59ff77;_0x48d835=0xc8;}else{_0x48d835=0xce;}_0x5ad8fe[_0x84c6('0x29')](_0x48d835);return _0x5ad8fe['set']('Content-Range',_0x4a7a2f+'-'+_0x5d28ce+'/'+_0x59ff77)[_0x84c6('0x2b')](_0x490023);}return null;};}function patchUpdates(_0x3a7ada){return function(_0x17666c){try{jsonpatch[_0x84c6('0x30')](_0x17666c,_0x3a7ada,!![]);}catch(_0xa31b05){return BPromise[_0x84c6('0x31')](_0xa31b05);}return _0x17666c['save']();};}function saveUpdates(_0x528600,_0x1b2c14){return function(_0x395195){if(_0x395195){return _0x395195['update'](_0x528600)[_0x84c6('0x32')](function(_0xf36231){return _0xf36231;});}return null;};}function removeEntity(_0x37f1f2,_0x2d848b){return function(_0x413dcb){if(_0x413dcb){return _0x413dcb[_0x84c6('0x33')]()[_0x84c6('0x32')](function(){var _0x5778a4=_0x413dcb[_0x84c6('0x34')]({'plain':!![]});var _0x366e86=_0x84c6('0x35');return db[_0x84c6('0x36')][_0x84c6('0x33')]({'where':{'type':_0x366e86,'resourceId':_0x5778a4['id']}})[_0x84c6('0x32')](function(){return _0x413dcb;});})[_0x84c6('0x32')](function(){_0x37f1f2[_0x84c6('0x29')](0xcc)[_0x84c6('0x2a')]();});}};}function handleEntityNotFound(_0x37fc72,_0x9a4c56){return function(_0x29134e){if(!_0x29134e){_0x37fc72['sendStatus'](0x194);}return _0x29134e;};}function handleError(_0x424b09,_0x1ab16b){_0x1ab16b=_0x1ab16b||0x1f4;return function(_0x2fed78){logger[_0x84c6('0x24')](_0x2fed78['stack']);if(_0x2fed78[_0x84c6('0x37')]){delete _0x2fed78['name'];}_0x424b09[_0x84c6('0x29')](_0x1ab16b)[_0x84c6('0x38')](_0x2fed78);};}exports[_0x84c6('0x39')]=function(_0x53b636,_0x1317bc){var _0x5bf7e1={'include':[{'model':db[_0x84c6('0x3a')],'as':_0x84c6('0x3b')}]},_0x258a03={},_0x14b0fc={'count':0x0,'rows':[]};var _0x22e93d=_['map'](db['WhatsappAccount']['rawAttributes'],function(_0x206870){return{'name':_0x206870[_0x84c6('0x3c')],'type':_0x206870[_0x84c6('0x3d')][_0x84c6('0x3e')]};});_0x258a03[_0x84c6('0x3f')]=_[_0x84c6('0x40')](_0x22e93d,_0x84c6('0x37'));_0x258a03[_0x84c6('0x41')]=_[_0x84c6('0x42')](_0x53b636['query']);_0x258a03[_0x84c6('0x43')]=_[_0x84c6('0x44')](_0x258a03[_0x84c6('0x3f')],_0x258a03[_0x84c6('0x41')]);_0x5bf7e1[_0x84c6('0x45')]=_[_0x84c6('0x44')](_0x258a03[_0x84c6('0x3f')],qs['fields'](_0x53b636[_0x84c6('0x41')][_0x84c6('0x46')]));_0x5bf7e1['attributes']=_0x5bf7e1['attributes'][_0x84c6('0x47')]?_0x5bf7e1[_0x84c6('0x45')]:_0x258a03[_0x84c6('0x3f')];if(!_0x53b636[_0x84c6('0x41')]['hasOwnProperty'](_0x84c6('0x48'))){_0x5bf7e1[_0x84c6('0x2e')]=qs[_0x84c6('0x2e')](_0x53b636[_0x84c6('0x41')][_0x84c6('0x2e')]);_0x5bf7e1[_0x84c6('0x2c')]=qs[_0x84c6('0x2c')](_0x53b636[_0x84c6('0x41')][_0x84c6('0x2c')]);}_0x5bf7e1[_0x84c6('0x49')]=qs[_0x84c6('0x4a')](_0x53b636['query'][_0x84c6('0x4a')]);_0x5bf7e1[_0x84c6('0x4b')]=qs[_0x84c6('0x43')](_['pick'](_0x53b636[_0x84c6('0x41')],_0x258a03['filters']),_0x22e93d);if(_0x53b636[_0x84c6('0x41')][_0x84c6('0x4c')]){_0x5bf7e1[_0x84c6('0x4b')]=_[_0x84c6('0x4d')](_0x5bf7e1[_0x84c6('0x4b')],{'$or':_['map'](_0x22e93d,function(_0x5482e5){if(_0x5482e5[_0x84c6('0x3d')]!=='VIRTUAL'){var _0x143a37={};_0x143a37[_0x5482e5[_0x84c6('0x37')]]={'$like':'%'+_0x53b636[_0x84c6('0x41')]['filter']+'%'};return _0x143a37;}})});}_0x5bf7e1=_[_0x84c6('0x4d')]({},_0x5bf7e1,_0x53b636[_0x84c6('0x4e')]);var _0x1da106={'where':_0x5bf7e1[_0x84c6('0x4b')]};return db[_0x84c6('0x4f')][_0x84c6('0x2f')](_0x1da106)[_0x84c6('0x32')](function(_0x4bb94e){_0x14b0fc['count']=_0x4bb94e;if(_0x53b636['query'][_0x84c6('0x50')]){_0x5bf7e1[_0x84c6('0x51')]=[{'all':!![]}];}return db[_0x84c6('0x4f')][_0x84c6('0x52')](_0x5bf7e1);})[_0x84c6('0x32')](function(_0x1c6909){_0x14b0fc['rows']=_0x1c6909;return _0x14b0fc;})[_0x84c6('0x32')](respondWithFilteredResult(_0x1317bc,_0x5bf7e1))[_0x84c6('0x53')](handleError(_0x1317bc,null));};exports[_0x84c6('0x54')]=function(_0x16c064,_0x5a8007){var _0x5cf658={'raw':![],'where':{'id':_0x16c064[_0x84c6('0x55')]['id']},'include':[{'model':db[_0x84c6('0x3a')],'as':_0x84c6('0x3b')}]},_0x323fc1={};_0x323fc1['model']=_[_0x84c6('0x42')](db[_0x84c6('0x4f')]['rawAttributes']);_0x323fc1[_0x84c6('0x41')]=_[_0x84c6('0x42')](_0x16c064[_0x84c6('0x41')]);_0x323fc1[_0x84c6('0x43')]=_[_0x84c6('0x44')](_0x323fc1[_0x84c6('0x3f')],_0x323fc1[_0x84c6('0x41')]);_0x5cf658[_0x84c6('0x45')]=_['intersection'](_0x323fc1[_0x84c6('0x3f')],qs[_0x84c6('0x46')](_0x16c064[_0x84c6('0x41')]['fields']));_0x5cf658[_0x84c6('0x45')]=_0x5cf658['attributes'][_0x84c6('0x47')]?_0x5cf658['attributes']:_0x323fc1[_0x84c6('0x3f')];if(_0x16c064[_0x84c6('0x41')][_0x84c6('0x50')]){_0x5cf658[_0x84c6('0x51')]=[{'all':!![]}];}_0x5cf658=_['merge']({},_0x5cf658,_0x16c064[_0x84c6('0x4e')]);return db[_0x84c6('0x4f')][_0x84c6('0x56')](_0x5cf658)[_0x84c6('0x32')](handleEntityNotFound(_0x5a8007,null))[_0x84c6('0x32')](respondWithResult(_0x5a8007,null))[_0x84c6('0x53')](handleError(_0x5a8007,null));};exports[_0x84c6('0x57')]=function(_0xc05ebc,_0x5a9fcd){return db[_0x84c6('0x4f')][_0x84c6('0x57')](_0xc05ebc[_0x84c6('0x58')],{})[_0x84c6('0x32')](function(_0x106159){var _0x2af11b=_0xc05ebc[_0x84c6('0x59')][_0x84c6('0x34')]({'plain':!![]});if(!_0x2af11b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2af11b[_0x84c6('0x5a')]===_0x84c6('0x59')){var _0x427c98=_0x106159[_0x84c6('0x34')]({'plain':!![]});var _0xc81e2b=_0x84c6('0x35');return db[_0x84c6('0x5b')]['find']({'where':{'name':_0xc81e2b,'userProfileId':_0x2af11b[_0x84c6('0x5c')]},'raw':!![]})[_0x84c6('0x32')](function(_0x25e281){if(_0x25e281&&_0x25e281['autoAssociation']===0x0){return db[_0x84c6('0x36')]['create']({'name':_0x427c98['name'],'resourceId':_0x427c98['id'],'type':_0x25e281[_0x84c6('0x37')],'sectionId':_0x25e281['id']},{})[_0x84c6('0x32')](function(){return _0x106159;});}else{return _0x106159;}})[_0x84c6('0x53')](function(_0xf6183d){logger[_0x84c6('0x24')](_0x84c6('0x5d'),_0xf6183d);throw _0xf6183d;});}return _0x106159;})[_0x84c6('0x32')](respondWithResult(_0x5a9fcd,0xc9))[_0x84c6('0x53')](handleError(_0x5a9fcd,null));};exports['update']=function(_0x2c2fdb,_0x3d5fac){if(_0x2c2fdb[_0x84c6('0x58')]['id']){delete _0x2c2fdb[_0x84c6('0x58')]['id'];}return db['WhatsappAccount'][_0x84c6('0x56')]({'where':{'id':_0x2c2fdb[_0x84c6('0x55')]['id']},'include':[{'model':db[_0x84c6('0x3a')],'as':_0x84c6('0x3b')}]})[_0x84c6('0x32')](handleEntityNotFound(_0x3d5fac,null))['then'](saveUpdates(_0x2c2fdb['body'],null))[_0x84c6('0x32')](respondWithResult(_0x3d5fac,null))[_0x84c6('0x53')](handleError(_0x3d5fac,null));};exports[_0x84c6('0x33')]=function(_0x4a4ef2,_0x46cc53){return db[_0x84c6('0x4f')]['find']({'where':{'id':_0x4a4ef2[_0x84c6('0x55')]['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x46cc53,null))['then'](removeEntity(_0x46cc53,null))['catch'](handleError(_0x46cc53,null));};exports[_0x84c6('0x5e')]=function(_0x3a390b,_0x3f9797){return db[_0x84c6('0x4f')][_0x84c6('0x5e')]()['then'](respondWithResult(_0x3f9797,null))[_0x84c6('0x53')](handleError(_0x3f9797,null));};exports[_0x84c6('0x5f')]=function(_0x2e6b0d,_0xee6eda,_0x3ab0c0){if(_0x2e6b0d[_0x84c6('0x58')]['id']){delete _0x2e6b0d[_0x84c6('0x58')]['id'];}return db[_0x84c6('0x4f')]['find']({'where':{'id':_0x2e6b0d[_0x84c6('0x55')]['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0xee6eda,null))[_0x84c6('0x32')](function(_0x802195){if(_0x802195){_0x2e6b0d[_0x84c6('0x58')]['WhatsappAccountId']=_0x802195['id'];return db[_0x84c6('0x60')]['create'](_0x2e6b0d[_0x84c6('0x58')]);}})['then'](respondWithResult(_0xee6eda,null))[_0x84c6('0x53')](handleError(_0xee6eda,null));};exports['getDispositions']=function(_0x1cb233,_0x35e5cb,_0x450c31){var _0x1c3805={'raw':![],'where':{}};var _0x2dce2e={};var _0x411c1c={'count':0x0,'rows':[]};return db[_0x84c6('0x4f')][_0x84c6('0x61')]({'where':{'id':_0x1cb233['params']['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x35e5cb,null))[_0x84c6('0x32')](function(_0x1af1be){if(_0x1af1be){_0x2dce2e[_0x84c6('0x3f')]=_[_0x84c6('0x42')](db[_0x84c6('0x60')]['rawAttributes']);_0x2dce2e[_0x84c6('0x41')]=_[_0x84c6('0x42')](_0x1cb233[_0x84c6('0x41')]);_0x2dce2e[_0x84c6('0x43')]=_[_0x84c6('0x44')](_0x2dce2e[_0x84c6('0x3f')],_0x2dce2e['query']);_0x1c3805[_0x84c6('0x45')]=_['intersection'](_0x2dce2e[_0x84c6('0x3f')],qs[_0x84c6('0x46')](_0x1cb233[_0x84c6('0x41')][_0x84c6('0x46')]));_0x1c3805[_0x84c6('0x45')]=_0x1c3805['attributes']['length']?_0x1c3805[_0x84c6('0x45')]:_0x2dce2e['model'];if(!_0x1cb233[_0x84c6('0x41')][_0x84c6('0x62')](_0x84c6('0x48'))){_0x1c3805[_0x84c6('0x2e')]=qs['limit'](_0x1cb233[_0x84c6('0x41')][_0x84c6('0x2e')]);_0x1c3805[_0x84c6('0x2c')]=qs[_0x84c6('0x2c')](_0x1cb233[_0x84c6('0x41')][_0x84c6('0x2c')]);}_0x1c3805[_0x84c6('0x49')]=qs[_0x84c6('0x4a')](_0x1cb233[_0x84c6('0x41')]['sort']);_0x1c3805['where']=qs[_0x84c6('0x43')](_['pick'](_0x1cb233[_0x84c6('0x41')],_0x2dce2e['filters']));_0x1c3805[_0x84c6('0x4b')][_0x84c6('0x63')]=_0x1af1be['id'];if(_0x1cb233['query'][_0x84c6('0x4c')]){_0x1c3805[_0x84c6('0x4b')]=_[_0x84c6('0x4d')](_0x1c3805['where'],{'$or':_[_0x84c6('0x40')](_0x1c3805[_0x84c6('0x45')],function(_0xb75e3c){var _0x5525ca={};_0x5525ca[_0xb75e3c]={'$like':'%'+_0x1cb233[_0x84c6('0x41')][_0x84c6('0x4c')]+'%'};return _0x5525ca;})});}_0x1c3805=_[_0x84c6('0x4d')]({},_0x1c3805,_0x1cb233[_0x84c6('0x4e')]);return db['Disposition']['count']({'where':_0x1c3805[_0x84c6('0x4b')]})[_0x84c6('0x32')](function(_0x2e88c1){_0x411c1c[_0x84c6('0x2f')]=_0x2e88c1;if(_0x1cb233[_0x84c6('0x41')][_0x84c6('0x50')]){_0x1c3805[_0x84c6('0x51')]=[{'all':!![]}];}return db[_0x84c6('0x60')][_0x84c6('0x52')](_0x1c3805);})['then'](function(_0x24c273){_0x411c1c['rows']=_0x24c273;return _0x411c1c;});}})['then'](respondWithFilteredResult(_0x35e5cb,_0x1c3805))[_0x84c6('0x53')](handleError(_0x35e5cb,null));};exports[_0x84c6('0x64')]=function(_0x2800e5,_0x73c3d,_0x21987f){return db[_0x84c6('0x4f')]['find']({'where':{'id':_0x2800e5['params']['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x73c3d,null))[_0x84c6('0x32')](function(_0x351e20){if(_0x351e20){return _0x351e20[_0x84c6('0x64')](_0x2800e5['query']['ids']);}})['then'](respondWithStatusCode(_0x73c3d,null))['catch'](handleError(_0x73c3d,null));};exports[_0x84c6('0x65')]=function(_0x2a9c6d,_0x188628,_0x4b518e){if(_0x2a9c6d[_0x84c6('0x58')]['id']){delete _0x2a9c6d[_0x84c6('0x58')]['id'];}return db[_0x84c6('0x4f')][_0x84c6('0x56')]({'where':{'id':_0x2a9c6d['params']['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x188628,null))['then'](function(_0x275cf5){if(_0x275cf5){_0x2a9c6d[_0x84c6('0x58')][_0x84c6('0x63')]=_0x275cf5['id'];return db[_0x84c6('0x66')][_0x84c6('0x57')](_0x2a9c6d[_0x84c6('0x58')]);}})['then'](respondWithResult(_0x188628,null))[_0x84c6('0x53')](handleError(_0x188628,null));};exports[_0x84c6('0x67')]=function(_0x1a7e03,_0x1ee921,_0x28d0ec){var _0x5274b1={'raw':![],'where':{}};var _0x564930={};var _0x3ebd2a={'count':0x0,'rows':[]};return db[_0x84c6('0x4f')]['findOne']({'where':{'id':_0x1a7e03[_0x84c6('0x55')]['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x1ee921,null))[_0x84c6('0x32')](function(_0x4e7014){if(_0x4e7014){_0x564930['model']=_[_0x84c6('0x42')](db[_0x84c6('0x66')][_0x84c6('0x68')]);_0x564930['query']=_[_0x84c6('0x42')](_0x1a7e03[_0x84c6('0x41')]);_0x564930[_0x84c6('0x43')]=_['intersection'](_0x564930[_0x84c6('0x3f')],_0x564930['query']);_0x5274b1[_0x84c6('0x45')]=_[_0x84c6('0x44')](_0x564930[_0x84c6('0x3f')],qs[_0x84c6('0x46')](_0x1a7e03['query'][_0x84c6('0x46')]));_0x5274b1[_0x84c6('0x45')]=_0x5274b1['attributes'][_0x84c6('0x47')]?_0x5274b1['attributes']:_0x564930[_0x84c6('0x3f')];if(!_0x1a7e03[_0x84c6('0x41')][_0x84c6('0x62')](_0x84c6('0x48'))){_0x5274b1[_0x84c6('0x2e')]=qs[_0x84c6('0x2e')](_0x1a7e03[_0x84c6('0x41')][_0x84c6('0x2e')]);_0x5274b1[_0x84c6('0x2c')]=qs['offset'](_0x1a7e03[_0x84c6('0x41')][_0x84c6('0x2c')]);}_0x5274b1[_0x84c6('0x49')]=qs[_0x84c6('0x4a')](_0x1a7e03['query']['sort']);_0x5274b1[_0x84c6('0x4b')]=qs[_0x84c6('0x43')](_['pick'](_0x1a7e03['query'],_0x564930[_0x84c6('0x43')]));_0x5274b1[_0x84c6('0x4b')][_0x84c6('0x63')]=_0x4e7014['id'];if(_0x1a7e03[_0x84c6('0x41')][_0x84c6('0x4c')]){_0x5274b1[_0x84c6('0x4b')]=_[_0x84c6('0x4d')](_0x5274b1['where'],{'$or':_[_0x84c6('0x40')](_0x5274b1[_0x84c6('0x45')],function(_0x36a2b0){var _0x3a91fb={};_0x3a91fb[_0x36a2b0]={'$like':'%'+_0x1a7e03['query'][_0x84c6('0x4c')]+'%'};return _0x3a91fb;})});}_0x5274b1=_[_0x84c6('0x4d')]({},_0x5274b1,_0x1a7e03[_0x84c6('0x4e')]);return db['CannedAnswer']['count']({'where':_0x5274b1[_0x84c6('0x4b')]})[_0x84c6('0x32')](function(_0x515ba0){_0x3ebd2a[_0x84c6('0x2f')]=_0x515ba0;if(_0x1a7e03[_0x84c6('0x41')][_0x84c6('0x50')]){_0x5274b1[_0x84c6('0x51')]=[{'all':!![]}];}return db['CannedAnswer'][_0x84c6('0x52')](_0x5274b1);})[_0x84c6('0x32')](function(_0x28fde6){_0x3ebd2a[_0x84c6('0x69')]=_0x28fde6;return _0x3ebd2a;});}})['then'](respondWithFilteredResult(_0x1ee921,_0x5274b1))['catch'](handleError(_0x1ee921,null));};exports[_0x84c6('0x6a')]=function(_0xadfede,_0x3c6aa1,_0x4e3f99){return db['WhatsappAccount'][_0x84c6('0x56')]({'where':{'id':_0xadfede[_0x84c6('0x55')]['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x3c6aa1,null))[_0x84c6('0x32')](function(_0x450233){if(_0x450233){return _0x450233[_0x84c6('0x6a')](_0xadfede[_0x84c6('0x41')][_0x84c6('0x6b')]);}})[_0x84c6('0x32')](respondWithStatusCode(_0x3c6aa1,null))[_0x84c6('0x53')](handleError(_0x3c6aa1,null));};exports['addAgents']=function(_0x5dd56f,_0x16278a,_0x398ebc){return db[_0x84c6('0x4f')][_0x84c6('0x56')]({'where':{'id':_0x5dd56f[_0x84c6('0x55')]['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x16278a,null))[_0x84c6('0x32')](function(_0x1ff262){if(_0x1ff262){return _0x1ff262[_0x84c6('0x6c')](_0x5dd56f['body'][_0x84c6('0x6b')],_[_0x84c6('0x6d')](_0x5dd56f['body'],[_0x84c6('0x6b'),'id'])||{})[_0x84c6('0x6e')](function(_0x4ef64b){for(var _0x202303=0x0;_0x202303<_0x5dd56f['body']['ids']['length'];_0x202303+=0x1){socket[_0x84c6('0x6f')](_0x84c6('0x70'),{'UserId':Number(_0x5dd56f['body'][_0x84c6('0x6b')][_0x202303]),'WhatsappAccountId':Number(_0x5dd56f['params']['id'])});}return _0x4ef64b;});}})['then'](respondWithResult(_0x16278a,null))['catch'](handleError(_0x16278a,null));};exports[_0x84c6('0x71')]=function(_0x50ef19,_0x1b37a4,_0x1478bc){return db[_0x84c6('0x4f')][_0x84c6('0x56')]({'where':{'id':_0x50ef19[_0x84c6('0x55')]['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x1b37a4,null))[_0x84c6('0x32')](function(_0x4a19bc){if(_0x4a19bc){return _0x4a19bc[_0x84c6('0x71')](_0x50ef19['query']['ids'])[_0x84c6('0x32')](function(){if(_[_0x84c6('0x72')](_0x50ef19[_0x84c6('0x41')][_0x84c6('0x6b')])){for(var _0x544c33=0x0;_0x544c33<_0x50ef19[_0x84c6('0x41')][_0x84c6('0x6b')][_0x84c6('0x47')];_0x544c33+=0x1){socket[_0x84c6('0x6f')](_0x84c6('0x73'),{'UserId':Number(_0x50ef19[_0x84c6('0x41')]['ids'][_0x544c33]),'WhatsappAccountId':Number(_0x50ef19['params']['id'])});}}else{socket['emit'](_0x84c6('0x73'),{'UserId':Number(_0x50ef19['query'][_0x84c6('0x6b')]),'WhatsappAccountId':Number(_0x50ef19[_0x84c6('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1b37a4,null))[_0x84c6('0x53')](handleError(_0x1b37a4,null));};exports[_0x84c6('0x74')]=function(_0x29e5c1,_0x56dd8d,_0x3c46b0){var _0x45a6eb={};var _0x5ed4aa={};var _0x5c6c2d;var _0x1c3e34;return db['WhatsappAccount'][_0x84c6('0x61')]({'where':{'id':_0x29e5c1[_0x84c6('0x55')]['id']}})[_0x84c6('0x32')](handleEntityNotFound(_0x56dd8d,null))[_0x84c6('0x32')](function(_0x5af379){if(_0x5af379){_0x5c6c2d=_0x5af379;_0x5ed4aa[_0x84c6('0x3f')]=_[_0x84c6('0x42')](db[_0x84c6('0x75')][_0x84c6('0x68')]);_0x5ed4aa[_0x84c6('0x41')]=_[_0x84c6('0x42')](_0x29e5c1[_0x84c6('0x41')]);_0x5ed4aa[_0x84c6('0x43')]=_[_0x84c6('0x44')](_0x5ed4aa[_0x84c6('0x3f')],_0x5ed4aa[_0x84c6('0x41')]);_0x45a6eb[_0x84c6('0x45')]=_[_0x84c6('0x44')](_0x5ed4aa[_0x84c6('0x3f')],qs[_0x84c6('0x46')](_0x29e5c1[_0x84c6('0x41')][_0x84c6('0x46')]));_0x45a6eb[_0x84c6('0x45')]=_0x45a6eb[_0x84c6('0x45')][_0x84c6('0x47')]?_0x45a6eb[_0x84c6('0x45')]:_0x5ed4aa[_0x84c6('0x3f')];_0x45a6eb['order']=qs['sort'](_0x29e5c1[_0x84c6('0x41')][_0x84c6('0x4a')]);_0x45a6eb[_0x84c6('0x4b')]=qs[_0x84c6('0x43')](_['pick'](_0x29e5c1[_0x84c6('0x41')],_0x5ed4aa[_0x84c6('0x43')]));if(_0x29e5c1[_0x84c6('0x41')][_0x84c6('0x4c')]){_0x45a6eb['where']=_[_0x84c6('0x4d')](_0x45a6eb['where'],{'$or':_[_0x84c6('0x40')](_0x45a6eb[_0x84c6('0x45')],function(_0x4a50c3){var _0x5874c5={};_0x5874c5[_0x4a50c3]={'$like':'%'+_0x29e5c1[_0x84c6('0x41')][_0x84c6('0x4c')]+'%'};return _0x5874c5;})});}_0x45a6eb=_['merge']({},_0x45a6eb,_0x29e5c1['options']);return _0x5c6c2d[_0x84c6('0x74')](_0x45a6eb);}})[_0x84c6('0x32')](function(_0x19ee5a){if(_0x19ee5a){_0x1c3e34=_0x19ee5a[_0x84c6('0x47')];if(!_0x29e5c1[_0x84c6('0x41')]['hasOwnProperty']('nolimit')){_0x45a6eb[_0x84c6('0x2e')]=qs[_0x84c6('0x2e')](_0x29e5c1['query'][_0x84c6('0x2e')]);_0x45a6eb[_0x84c6('0x2c')]=qs[_0x84c6('0x2c')](_0x29e5c1[_0x84c6('0x41')][_0x84c6('0x2c')]);}return _0x5c6c2d[_0x84c6('0x74')](_0x45a6eb);}})['then'](function(_0x5d4ebf){if(_0x5d4ebf){return _0x5d4ebf?{'count':_0x1c3e34,'rows':_0x5d4ebf}:null;}})['then'](respondWithResult(_0x56dd8d,null))[_0x84c6('0x53')](handleError(_0x56dd8d,null));};exports[_0x84c6('0x76')]=function(_0xe9b332,_0x6a30ae,_0x46e5af){return db['WhatsappAccount'][_0x84c6('0x61')]({'where':{'id':_0xe9b332[_0x84c6('0x55')]['id']}})['then'](handleEntityNotFound(_0x6a30ae,null))[_0x84c6('0x32')](function(_0x1c5623){if(_0x1c5623){return db[_0x84c6('0x77')]['transaction'](function(_0x171149){return db[_0x84c6('0x78')]['destroy']({'where':{'WhatsappAccountId':_0xe9b332[_0x84c6('0x55')]['id']},'transaction':_0x171149})[_0x84c6('0x32')](function(_0xbcb1b){var _0x5833d9=_['map'](_0xe9b332[_0x84c6('0x58')],function(_0x2aab23){_0x2aab23['WhatsappAccountId']=_0xe9b332['params']['id'];return _0x2aab23;});return db[_0x84c6('0x78')][_0x84c6('0x79')](_0x5833d9,{'transaction':_0x171149});});})['then'](function(){return db['WhatsappApplication'][_0x84c6('0x7a')]({'where':{'WhatsappAccountId':_0xe9b332[_0x84c6('0x55')]['id']},'order':_0x84c6('0x7b')});});}})[_0x84c6('0x32')](respondWithResult(_0x6a30ae,null))[_0x84c6('0x53')](handleError(_0x6a30ae,null));};exports['getApplications']=function(_0x375968,_0x485a61,_0x292257){var _0x4710bb={};var _0x45d0ce={};var _0x37a3b9;var _0x3cc79a;return db[_0x84c6('0x4f')][_0x84c6('0x61')]({'where':{'id':_0x375968[_0x84c6('0x55')]['id']}})['then'](handleEntityNotFound(_0x485a61,null))[_0x84c6('0x32')](function(_0x298d27){if(_0x298d27){_0x37a3b9=_0x298d27;_0x45d0ce[_0x84c6('0x3f')]=_['keys'](db['WhatsappApplication'][_0x84c6('0x68')]);_0x45d0ce[_0x84c6('0x41')]=_[_0x84c6('0x42')](_0x375968[_0x84c6('0x41')]);_0x45d0ce[_0x84c6('0x43')]=_['intersection'](_0x45d0ce[_0x84c6('0x3f')],_0x45d0ce['query']);_0x4710bb['attributes']=_[_0x84c6('0x44')](_0x45d0ce['model'],qs[_0x84c6('0x46')](_0x375968[_0x84c6('0x41')][_0x84c6('0x46')]));_0x4710bb[_0x84c6('0x45')]=_0x4710bb['attributes'][_0x84c6('0x47')]?_0x4710bb[_0x84c6('0x45')]:_0x45d0ce['model'];_0x4710bb[_0x84c6('0x49')]=qs[_0x84c6('0x4a')](_0x375968[_0x84c6('0x41')][_0x84c6('0x4a')]);_0x4710bb[_0x84c6('0x4b')]=qs['filters'](_[_0x84c6('0x7c')](_0x375968[_0x84c6('0x41')],_0x45d0ce[_0x84c6('0x43')]));if(_0x375968[_0x84c6('0x41')][_0x84c6('0x4c')]){_0x4710bb[_0x84c6('0x4b')]=_[_0x84c6('0x4d')](_0x4710bb['where'],{'$or':_[_0x84c6('0x40')](_0x4710bb[_0x84c6('0x45')],function(_0x351c8d){var _0x492387={};_0x492387[_0x351c8d]={'$like':'%'+_0x375968[_0x84c6('0x41')][_0x84c6('0x4c')]+'%'};return _0x492387;})});}_0x4710bb=_[_0x84c6('0x4d')]({},_0x4710bb,_0x375968['options']);return _0x37a3b9['getApplications'](_0x4710bb);}})[_0x84c6('0x32')](function(_0x113fa5){if(_0x113fa5){_0x3cc79a=_0x113fa5['length'];if(!_0x375968['query'][_0x84c6('0x62')]('nolimit')){_0x4710bb[_0x84c6('0x2e')]=qs['limit'](_0x375968['query']['limit']);_0x4710bb[_0x84c6('0x2c')]=qs[_0x84c6('0x2c')](_0x375968['query'][_0x84c6('0x2c')]);}return _0x37a3b9[_0x84c6('0x7d')](_0x4710bb);}})[_0x84c6('0x32')](function(_0xf4258){if(_0xf4258){return _0xf4258?{'count':_0x3cc79a,'rows':_0xf4258}:null;}})[_0x84c6('0x32')](respondWithResult(_0x485a61,null))[_0x84c6('0x53')](handleError(_0x485a61,null));};exports[_0x84c6('0x7e')]=function(_0x2c9e1a,_0x115c78,_0x27ec4b){logger[_0x84c6('0x1f')](_0x84c6('0x7f'));logger[_0x84c6('0x1f')]('AC\x20WhatsappAccount\x20req.body:%s',JSON[_0x84c6('0x23')](_0x2c9e1a[_0x84c6('0x58')]));var _0x4e58af={'channel':_0x84c6('0x80')};var _0xf09334=[];var _0x6bb9ba=[];var _0x6381f8={};return db[_0x84c6('0x4f')][_0x84c6('0x56')]({'where':{'id':_0x2c9e1a[_0x84c6('0x55')]['id']},'include':[{'model':db[_0x84c6('0x78')],'as':_0x84c6('0x81')}]})['then'](handleEntityNotFound(_0x115c78,null))['then'](function(_0x17826c){_0x4e58af[_0x84c6('0x82')]=_0x17826c;_0x4e58af[_0x84c6('0x83')]=_['orderBy'](_0x17826c[_0x84c6('0x81')],['priority'],[_0x84c6('0x84')]);if(_0x4e58af[_0x84c6('0x82')][_0x84c6('0x81')]){delete _0x4e58af[_0x84c6('0x82')][_0x84c6('0x81')];}return db[_0x84c6('0x85')]['describe']();})[_0x84c6('0x32')](function(_0x2cdf76){if(!_0x2cdf76){throw new db['Sequelize'][(_0x84c6('0x86'))](_0x84c6('0x87'));}logger['info']('AC\x20sinch\x20attributes:%s',JSON[_0x84c6('0x23')](_0x2cdf76));logger[_0x84c6('0x1f')](_0x84c6('0x88'),JSON[_0x84c6('0x23')](_0x2c9e1a[_0x84c6('0x58')]));_0xf09334=_[_0x84c6('0x89')](_[_0x84c6('0x42')](_0x2cdf76),[_0x84c6('0x8a'),_0x84c6('0x8b')]);_0x6bb9ba=_[_0x84c6('0x89')](_['keys'](_0x2cdf76),['createdAt',_0x84c6('0x8b'),_0x84c6('0x8c'),_0x84c6('0x8d')]);_0x4e58af[_0x84c6('0x58')]={'mapKey':'mobile'};logger[_0x84c6('0x1f')](_0x84c6('0x8e'),JSON[_0x84c6('0x23')](_0x4e58af[_0x84c6('0x82')][_0x84c6('0x3d')]));logger['info']('AC\x20sinch\x20routing.body:%s',JSON[_0x84c6('0x23')](_0x4e58af['body']));logger[_0x84c6('0x1f')](_0x84c6('0x8f'),_0xf09334);logger[_0x84c6('0x1f')](_0x84c6('0x90'),_0x6bb9ba);if(_0x4e58af[_0x84c6('0x82')][_0x84c6('0x3d')]&&_0x4e58af[_0x84c6('0x82')][_0x84c6('0x3d')]===_0x84c6('0x91')){_0x4e58af[_0x84c6('0x58')][_0x84c6('0x92')]=_0x2c9e1a['body'][_0x84c6('0x93')][_0x84c6('0x94')]('whatsapp:','');_0x4e58af[_0x84c6('0x58')]['body']=_0x2c9e1a[_0x84c6('0x58')]['Body'];_0x4e58af[_0x84c6('0x58')][_0x84c6('0x95')]=_0x2c9e1a['body'][_0x84c6('0x96')];}if(_0x4e58af[_0x84c6('0x82')][_0x84c6('0x3d')]&&_0x4e58af['account']['type']===_0x84c6('0x97')){logger[_0x84c6('0x1f')](_0x84c6('0x98'),JSON[_0x84c6('0x23')](_0x2c9e1a[_0x84c6('0x58')]));_0x4e58af[_0x84c6('0x58')]['from']=_0x2c9e1a['body'][_0x84c6('0x99')][0x0][_0x84c6('0x92')];_0x4e58af[_0x84c6('0x58')][_0x84c6('0x58')]=_0x2c9e1a[_0x84c6('0x58')]['notifications'][0x0][_0x84c6('0x26')][_0x84c6('0x58')];_0x4e58af[_0x84c6('0x58')][_0x84c6('0x95')]=_0x2c9e1a[_0x84c6('0x58')]['notifications'][0x0][_0x84c6('0x9a')];}if(_0x4e58af['body']['id']){delete _0x4e58af[_0x84c6('0x58')]['id'];}if(_['isNil'](_0x4e58af[_0x84c6('0x58')][_0x84c6('0x92')])){throw new db['Sequelize'][(_0x84c6('0x86'))]('from\x20is\x20mandatory');}if(_[_0x84c6('0x9b')](_0x4e58af[_0x84c6('0x58')][_0x84c6('0x58')])||_0x4e58af[_0x84c6('0x58')][_0x84c6('0x58')]===''){throw new db['Sequelize'][(_0x84c6('0x86'))](_0x84c6('0x9c'));}if(_[_0x84c6('0x9b')](_0x4e58af[_0x84c6('0x58')][_0x84c6('0x9d')])){throw new db['Sequelize'][(_0x84c6('0x86'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6bb9ba);}if(!_[_0x84c6('0x9e')](_0x6bb9ba,_0x4e58af[_0x84c6('0x58')][_0x84c6('0x9d')])){throw new db[(_0x84c6('0x9f'))]['ValidationError'](_0x84c6('0xa0')+_0x6bb9ba);}_0x6381f8[_0x4e58af[_0x84c6('0x58')][_0x84c6('0x9d')]]=_0x4e58af[_0x84c6('0x58')][_0x84c6('0x92')];return db[_0x84c6('0xa1')][_0x84c6('0x56')]({'where':{'id':_0x4e58af['account'][_0x84c6('0x8d')]},'include':[{'model':db[_0x84c6('0x85')],'as':_0x84c6('0xa2'),'where':_0x6381f8,'limit':0x1,'order':[[_0x84c6('0x8b'),_0x84c6('0xa3')]]}]});})[_0x84c6('0x32')](handleEntityNotFound(_0x115c78,null))['then'](function(_0x3a1480){if(_0x3a1480){_0x4e58af[_0x84c6('0xa4')]=_[_0x84c6('0x6d')](_0x3a1480,[_0x84c6('0xa2')]);if(_0x3a1480['Contacts'][_0x84c6('0x47')]){return _0x3a1480['Contacts'][0x0];}var _0x499624=_[_0x84c6('0x19')](_0x4e58af['body'],{'firstName':_0x4e58af[_0x84c6('0x58')]['from'],'ListId':_0x3a1480['id']});_0x499624[_0x4e58af[_0x84c6('0x58')]['mapKey']]=_0x4e58af[_0x84c6('0x58')]['from'];return db[_0x84c6('0x85')][_0x84c6('0x57')](_0x499624,{'fields':_0xf09334,'raw':!![]});}})[_0x84c6('0x32')](handleEntityNotFound(_0x115c78,null))[_0x84c6('0x32')](function(_0x538b47){if(_0x538b47){_0x4e58af[_0x84c6('0xa5')]=_0x538b47;var _0x363b20={'ContactId':_0x538b47['id'],'phone':_0x4e58af[_0x84c6('0x58')]['from'],'WhatsappAccountId':_0x2c9e1a[_0x84c6('0x55')]['id']};var _0x154f73={'ContactId':_0x538b47['id'],'WhatsappAccountId':_0x2c9e1a['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x154f73})[_0x84c6('0x32')](function(_0x36c4ad){if(_0x36c4ad){return[_0x36c4ad,![]];}return db[_0x84c6('0xa6')][_0x84c6('0x57')](_0x363b20)['then'](function(_0x3ad257){return[_0x3ad257,!![]];});});}})[_0x84c6('0x6e')](function(_0x34ea5f,_0x3e56bd){_0x4e58af['interaction']=_0x34ea5f[_0x84c6('0x34')]({'plain':!![]});_0x4e58af[_0x84c6('0xa7')]['created']=![];if(_0x3e56bd){if(_0x4e58af[_0x84c6('0x82')]['autoclose']){_0x4e58af[_0x84c6('0x83')]['push']({'id':0x0,'priority':_0x4e58af['applications'][_0x84c6('0x47')]+0x1,'app':_0x84c6('0xa8'),'appdata':_0x84c6('0xa9'),'interval':_0x84c6('0xaa')});}_0x4e58af[_0x84c6('0xa7')][_0x84c6('0xab')]=!![];}return db['WhatsappMessage'][_0x84c6('0x57')]({'phone':_0x4e58af[_0x84c6('0x58')][_0x84c6('0x92')],'messageId':_0x4e58af[_0x84c6('0x58')]['messageId'],'body':_0x4e58af[_0x84c6('0x58')][_0x84c6('0x58')],'WhatsappAccountId':_0x2c9e1a[_0x84c6('0x55')]['id'],'WhatsappInteractionId':_0x34ea5f['id'],'direction':'in','ContactId':_0x34ea5f[_0x84c6('0xac')],'AttachmentId':_0x4e58af[_0x84c6('0x58')][_0x84c6('0xad')]});})[_0x84c6('0x32')](function(_0x154a16){_0x4e58af[_0x84c6('0x26')]=_0x154a16;if(_0x4e58af[_0x84c6('0xa7')][_0x84c6('0xae')]){return db[_0x84c6('0x75')][_0x84c6('0x56')]({'attributes':['id',_0x84c6('0x37')],'where':{'id':_0x4e58af[_0x84c6('0xa7')][_0x84c6('0xae')]}})[_0x84c6('0x32')](function(_0x397149){if(_0x397149){_0x4e58af[_0x84c6('0x83')][_0x84c6('0xaf')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x397149[_0x84c6('0x37')]+','+(_0x4e58af['account'][_0x84c6('0xb0')]||0xa),'interval':_0x84c6('0xaa')});}return respondWithRpcPromise(_0x84c6('0xb1'),_0x84c6('0xb2'),_0x4e58af);});}return respondWithRpcPromise(_0x84c6('0xb1'),'startRouting',_0x4e58af);})[_0x84c6('0x32')](function(_0x379990){if(_0x379990){var _0x1bfd33=0xc8;var _0x937a6e=_0x84c6('0xb3');logger[_0x84c6('0x1f')](_0x84c6('0x22'),_0x937a6e,_0x1bfd33,_0x84c6('0xb4'));logger[_0x84c6('0xb5')](_0x84c6('0xb6'),_0x937a6e,_0x1bfd33,_0x84c6('0xb4'),JSON[_0x84c6('0x23')](_0x379990));if(_0x4e58af[_0x84c6('0x82')]['type']===_0x84c6('0x91')){return _0x115c78[_0x84c6('0x29')](_0x1bfd33)[_0x84c6('0xb7')](_0x84c6('0xb8'),_0x84c6('0xb9'))[_0x84c6('0x38')](_0x84c6('0xba'));}else{return _0x115c78[_0x84c6('0x29')](_0x1bfd33)[_0x84c6('0x2b')](_0x379990);}}})['catch'](handleError(_0x115c78,null));};exports[_0x84c6('0x38')]=function(_0x125f46,_0x372340,_0x318183){var _0x4afca8,_0x197599,_0x3569aa;if(_[_0x84c6('0x9b')](_0x125f46[_0x84c6('0x58')][_0x84c6('0x58')])||_0x125f46[_0x84c6('0x58')][_0x84c6('0x58')]===''){throw new db['Sequelize'][(_0x84c6('0x86'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x84c6('0x9b')](_0x125f46[_0x84c6('0x58')]['to'])){throw new db[(_0x84c6('0x9f'))][(_0x84c6('0x86'))]('to\x20is\x20mandatory');}_0x4afca8=_0x125f46[_0x84c6('0x58')]['to'];return db['WhatsappAccount'][_0x84c6('0x56')]({'where':{'id':_0x125f46[_0x84c6('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x84c6('0xbb'),'include':[{'model':db[_0x84c6('0x85')],'as':'Contacts','where':{'mobile':_0x4afca8},'limit':0x1,'order':[[_0x84c6('0x8b'),_0x84c6('0xa3')]]}]}]})[_0x84c6('0x32')](handleEntityNotFound(_0x372340,null))[_0x84c6('0x32')](function(_0x1de61d){if(_0x1de61d&&_0x1de61d['List']){_0x197599=_0x1de61d['get']({'plain':!![]});if(_0x197599[_0x84c6('0xbb')]&&_0x197599[_0x84c6('0xbb')]['Contacts'][_0x84c6('0x47')]){return _0x197599['List'][_0x84c6('0xa2')][0x0];}return db[_0x84c6('0x85')]['create'](_[_0x84c6('0x19')](_0x125f46['body'],{'firstName':_0x4afca8,'mobile':_0x4afca8,'phone':_0x4afca8,'ListId':_0x197599['ListId']}));}})['then'](handleEntityNotFound(_0x372340,null))[_0x84c6('0x32')](function(_0x51e5a8){if(_0x51e5a8){_0x3569aa=_0x51e5a8;return db[_0x84c6('0xa6')][_0x84c6('0x56')]({'where':{'ContactId':_0x3569aa['id'],'closed':![],'WhatsappAccountId':_0x197599['id']}})[_0x84c6('0x32')](function(_0x25a2c9){if(_0x25a2c9){return[_0x25a2c9,![]];}return db['WhatsappInteraction'][_0x84c6('0x57')]({'UserId':_0x125f46['user']['id'],'ContactId':_0x3569aa['id'],'WhatsappAccountId':_0x197599['id'],'phone':_0x4afca8,'firstMsgDirection':_0x84c6('0xbc'),'Messages':[_['merge'](_0x125f46[_0x84c6('0x58')],{'read':![],'body':_0x125f46[_0x84c6('0x58')]['body'],'phone':_0x4afca8,'WhatsappAccountId':_0x197599['id'],'UserId':_0x125f46[_0x84c6('0x59')]['id'],'ContactId':_0x3569aa['id']})]},{'include':[{'model':db[_0x84c6('0xbd')],'as':'Messages'}]})[_0x84c6('0x32')](function(_0x191067){return[_0x191067,!![]];});});}})[_0x84c6('0x6e')](function(_0x2bac7d,_0x488c0d){if(_0x488c0d){return _0x2bac7d;}return db[_0x84c6('0xbd')][_0x84c6('0x57')](_[_0x84c6('0x4d')](_0x125f46[_0x84c6('0x58')],{'read':![],'body':_0x125f46[_0x84c6('0x58')]['body'],'phone':_0x4afca8,'WhatsappAccountId':_0x197599['id'],'WhatsappInteractionId':_0x2bac7d['id'],'UserId':_0x125f46[_0x84c6('0x59')]['id'],'ContactId':_0x3569aa['id']}))['then'](function(_0x31cb5c){_0x2bac7d[_0x84c6('0xbe')]['Messages']=[];_0x2bac7d[_0x84c6('0xbe')][_0x84c6('0xbf')][_0x84c6('0xc0')](_0x31cb5c[_0x84c6('0xbe')]);return _0x2bac7d;});})['then'](respondWithResult(_0x372340,null))[_0x84c6('0x53')](handleError(_0x372340,null));}; \ No newline at end of file +var _0x46d9=['WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','UserProfileResource','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','WhatsappAccounts','UserProfileSection','userProfileId','describe','WhatsappAccountId','getDispositions','findOne','Disposition','order','removeDispositions','ids','addAnswer','CannedAnswer','hasOwnProperty','rows','addAgents','spread','userWhatsappAccount:save','removeAgents','isArray','emit','User','getAgents','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','AC\x20WhatsappAccount\x20notify','AC\x20WhatsappAccount\x20req.body:%s','stringify','whatsapp','Applications','applications','orderBy','account','Sequelize','ValidationError','no\x20available\x20attributes','AC\x20sinch\x20req.body:%s','difference','updatedAt','createdAt','CompanyId','ListId','mobile','AC\x20sinch\x20routing.account.type:%s','AC\x20sinch\x20routing.body:%s','AC\x20sinch\x20contactKeys:%s','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','sinch','notifications','message_id','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','Contacts','DESC','list','omit','defaults','CmContact','contact','WhatsappInteraction','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','ContactId','UserId','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','info','request\x20sent'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0x46d9,0x16a));var _0x946d=function(_0x6ee406,_0x5a2b8e){_0x6ee406=_0x6ee406-0x0;var _0x48155a=_0x46d9[_0x6ee406];return _0x48155a;};'use strict';var emlformat=require(_0x946d('0x0'));var rimraf=require(_0x946d('0x1'));var zipdir=require(_0x946d('0x2'));var jsonpatch=require(_0x946d('0x3'));var rp=require(_0x946d('0x4'));var moment=require(_0x946d('0x5'));var BPromise=require(_0x946d('0x6'));var Mustache=require('mustache');var util=require(_0x946d('0x7'));var path=require(_0x946d('0x8'));var sox=require(_0x946d('0x9'));var csv=require(_0x946d('0xa'));var ejs=require(_0x946d('0xb'));var fs=require('fs');var fs_extra=require(_0x946d('0xc'));var _=require(_0x946d('0xd'));var squel=require(_0x946d('0xe'));var crypto=require('crypto');var jsforce=require(_0x946d('0xf'));var deskjs=require(_0x946d('0x10'));var toCsv=require(_0x946d('0xa'));var querystring=require(_0x946d('0x11'));var Papa=require(_0x946d('0x12'));var Redis=require(_0x946d('0x13'));var authService=require(_0x946d('0x14'));var qs=require(_0x946d('0x15'));var as=require(_0x946d('0x16'));var hardwareService=require(_0x946d('0x17'));var logger=require(_0x946d('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x946d('0x19'));var licenseUtil=require(_0x946d('0x1a'));var db=require(_0x946d('0x1b'))['db'];config['redis']=_['defaults'](config[_0x946d('0x1c')],{'host':_0x946d('0x1d'),'port':0x18eb});var socket=require(_0x946d('0x1e'))(new Redis(config[_0x946d('0x1c')]));require(_0x946d('0x1f'))[_0x946d('0x20')](socket);var jayson=require(_0x946d('0x21'));var client=jayson[_0x946d('0x22')][_0x946d('0x23')]({'port':0x232c});function respondWithRpcPromise(_0x597bbb,_0x548f30,_0x29f942,_0x307eeb){return new BPromise(function(_0x30412c,_0x3d6c11){var _0x2a802d=_0x307eeb||client;return _0x2a802d['request'](_0x597bbb,_0x29f942)['then'](function(_0x221a7a){logger[_0x946d('0x24')]('WhatsappAccount,\x20%s,\x20%s',_0x548f30,_0x946d('0x25'));logger['debug'](_0x946d('0x26'),_0x548f30,'request\x20sent',JSON['stringify'](_0x221a7a));if(_0x221a7a[_0x946d('0x27')]){if(_0x221a7a[_0x946d('0x27')][_0x946d('0x28')]===0x1f4){logger['error'](_0x946d('0x29'),_0x548f30,_0x221a7a[_0x946d('0x27')]['message']);return _0x3d6c11(_0x221a7a[_0x946d('0x27')][_0x946d('0x2a')]);}logger['error'](_0x946d('0x29'),_0x548f30,_0x221a7a[_0x946d('0x27')][_0x946d('0x2a')]);return _0x30412c(_0x221a7a[_0x946d('0x27')][_0x946d('0x2a')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x548f30,_0x946d('0x25'));_0x30412c(_0x221a7a[_0x946d('0x2b')][_0x946d('0x2a')]);}})['catch'](function(_0x2a0a9e){logger['error'](_0x946d('0x29'),_0x548f30,_0x2a0a9e);_0x3d6c11(_0x2a0a9e);});});}function respondWithStatusCode(_0x49a128,_0x452331){_0x452331=_0x452331||0xcc;return function(_0x22e5f2){if(_0x22e5f2){return _0x49a128[_0x946d('0x2c')](_0x452331);}return _0x49a128['status'](_0x452331)[_0x946d('0x2d')]();};}function respondWithResult(_0x3e564c,_0x380e5f){_0x380e5f=_0x380e5f||0xc8;return function(_0x57c175){if(_0x57c175){return _0x3e564c[_0x946d('0x2e')](_0x380e5f)[_0x946d('0x2f')](_0x57c175);}};}function respondWithFilteredResult(_0x17f268,_0x1ac495){return function(_0x206513){if(_0x206513){var _0x7b41e5=typeof _0x1ac495[_0x946d('0x30')]===_0x946d('0x31')&&typeof _0x1ac495[_0x946d('0x32')]===_0x946d('0x31');var _0x40894d=_0x206513[_0x946d('0x33')];var _0x104e10=_0x7b41e5?0x0:_0x1ac495['offset'];var _0x131244=_0x7b41e5?_0x206513[_0x946d('0x33')]:_0x1ac495[_0x946d('0x30')]+_0x1ac495[_0x946d('0x32')];var _0x40311d;if(_0x131244>=_0x40894d){_0x131244=_0x40894d;_0x40311d=0xc8;}else{_0x40311d=0xce;}_0x17f268[_0x946d('0x2e')](_0x40311d);return _0x17f268[_0x946d('0x34')]('Content-Range',_0x104e10+'-'+_0x131244+'/'+_0x40894d)[_0x946d('0x2f')](_0x206513);}return null;};}function patchUpdates(_0x15fde9){return function(_0x2b8016){try{jsonpatch[_0x946d('0x35')](_0x2b8016,_0x15fde9,!![]);}catch(_0x4dbffc){return BPromise['reject'](_0x4dbffc);}return _0x2b8016[_0x946d('0x36')]();};}function saveUpdates(_0x4a8d3c,_0x260f78){return function(_0x51b72c){if(_0x51b72c){return _0x51b72c[_0x946d('0x37')](_0x4a8d3c)[_0x946d('0x38')](function(_0x396f23){return _0x396f23;});}return null;};}function removeEntity(_0x346fd8,_0x397686){return function(_0x1a5c04){if(_0x1a5c04){return _0x1a5c04['destroy']()['then'](function(){var _0x21429a=_0x1a5c04['get']({'plain':!![]});var _0xe6e7b9='WhatsappAccounts';return db[_0x946d('0x39')][_0x946d('0x3a')]({'where':{'type':_0xe6e7b9,'resourceId':_0x21429a['id']}})[_0x946d('0x38')](function(){return _0x1a5c04;});})[_0x946d('0x38')](function(){_0x346fd8[_0x946d('0x2e')](0xcc)[_0x946d('0x2d')]();});}};}function handleEntityNotFound(_0x1d9cb3,_0x389e1e){return function(_0x19a028){if(!_0x19a028){_0x1d9cb3[_0x946d('0x2c')](0x194);}return _0x19a028;};}function handleError(_0x5070e7,_0x1add83){_0x1add83=_0x1add83||0x1f4;return function(_0xea1fa5){logger[_0x946d('0x27')](_0xea1fa5[_0x946d('0x3b')]);if(_0xea1fa5[_0x946d('0x3c')]){delete _0xea1fa5[_0x946d('0x3c')];}_0x5070e7['status'](_0x1add83)['send'](_0xea1fa5);};}exports[_0x946d('0x3d')]=function(_0x43e3c1,_0x46e671){var _0x5f150e={'include':[{'model':db[_0x946d('0x3e')],'as':_0x946d('0x3f')}]},_0x12bcad={},_0x5756c4={'count':0x0,'rows':[]};var _0xec7302=_[_0x946d('0x40')](db[_0x946d('0x41')][_0x946d('0x42')],function(_0xe46bf7){return{'name':_0xe46bf7[_0x946d('0x43')],'type':_0xe46bf7[_0x946d('0x44')][_0x946d('0x45')]};});_0x12bcad[_0x946d('0x46')]=_[_0x946d('0x40')](_0xec7302,_0x946d('0x3c'));_0x12bcad['query']=_['keys'](_0x43e3c1[_0x946d('0x47')]);_0x12bcad[_0x946d('0x48')]=_[_0x946d('0x49')](_0x12bcad['model'],_0x12bcad[_0x946d('0x47')]);_0x5f150e[_0x946d('0x4a')]=_['intersection'](_0x12bcad[_0x946d('0x46')],qs['fields'](_0x43e3c1[_0x946d('0x47')][_0x946d('0x4b')]));_0x5f150e[_0x946d('0x4a')]=_0x5f150e[_0x946d('0x4a')][_0x946d('0x4c')]?_0x5f150e['attributes']:_0x12bcad['model'];if(!_0x43e3c1[_0x946d('0x47')]['hasOwnProperty'](_0x946d('0x4d'))){_0x5f150e[_0x946d('0x32')]=qs[_0x946d('0x32')](_0x43e3c1[_0x946d('0x47')][_0x946d('0x32')]);_0x5f150e[_0x946d('0x30')]=qs[_0x946d('0x30')](_0x43e3c1[_0x946d('0x47')][_0x946d('0x30')]);}_0x5f150e['order']=qs[_0x946d('0x4e')](_0x43e3c1[_0x946d('0x47')][_0x946d('0x4e')]);_0x5f150e[_0x946d('0x4f')]=qs[_0x946d('0x48')](_[_0x946d('0x50')](_0x43e3c1['query'],_0x12bcad[_0x946d('0x48')]),_0xec7302);if(_0x43e3c1[_0x946d('0x47')][_0x946d('0x51')]){_0x5f150e['where']=_[_0x946d('0x52')](_0x5f150e[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0xec7302,function(_0x5cc265){if(_0x5cc265['type']!==_0x946d('0x53')){var _0x4379db={};_0x4379db[_0x5cc265['name']]={'$like':'%'+_0x43e3c1[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x4379db;}})});}_0x5f150e=_['merge']({},_0x5f150e,_0x43e3c1[_0x946d('0x54')]);var _0xd1f3bb={'where':_0x5f150e[_0x946d('0x4f')]};return db[_0x946d('0x41')][_0x946d('0x33')](_0xd1f3bb)[_0x946d('0x38')](function(_0x419d1e){_0x5756c4[_0x946d('0x33')]=_0x419d1e;if(_0x43e3c1[_0x946d('0x47')]['includeAll']){_0x5f150e[_0x946d('0x55')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x946d('0x56')](_0x5f150e);})['then'](function(_0x258796){_0x5756c4['rows']=_0x258796;return _0x5756c4;})[_0x946d('0x38')](respondWithFilteredResult(_0x46e671,_0x5f150e))[_0x946d('0x57')](handleError(_0x46e671,null));};exports['show']=function(_0x3de139,_0x2beeff){var _0xaf88e5={'raw':![],'where':{'id':_0x3de139[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0x3e')],'as':'mandatoryDispositionPause'}]},_0xc4e735={};_0xc4e735[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x41')][_0x946d('0x42')]);_0xc4e735['query']=_[_0x946d('0x59')](_0x3de139['query']);_0xc4e735['filters']=_[_0x946d('0x49')](_0xc4e735[_0x946d('0x46')],_0xc4e735[_0x946d('0x47')]);_0xaf88e5['attributes']=_['intersection'](_0xc4e735[_0x946d('0x46')],qs['fields'](_0x3de139[_0x946d('0x47')][_0x946d('0x4b')]));_0xaf88e5[_0x946d('0x4a')]=_0xaf88e5['attributes']['length']?_0xaf88e5[_0x946d('0x4a')]:_0xc4e735[_0x946d('0x46')];if(_0x3de139[_0x946d('0x47')][_0x946d('0x5a')]){_0xaf88e5[_0x946d('0x55')]=[{'all':!![]}];}_0xaf88e5=_[_0x946d('0x52')]({},_0xaf88e5,_0x3de139['options']);return db[_0x946d('0x41')][_0x946d('0x5b')](_0xaf88e5)[_0x946d('0x38')](handleEntityNotFound(_0x2beeff,null))[_0x946d('0x38')](respondWithResult(_0x2beeff,null))[_0x946d('0x57')](handleError(_0x2beeff,null));};exports[_0x946d('0x5c')]=function(_0xff08d7,_0x389139){return db[_0x946d('0x41')][_0x946d('0x5c')](_0xff08d7[_0x946d('0x5d')],{})['then'](function(_0x4c24ca){var _0xcc61b2=_0xff08d7[_0x946d('0x5e')][_0x946d('0x5f')]({'plain':!![]});if(!_0xcc61b2)throw new Error(_0x946d('0x60'));if(_0xcc61b2[_0x946d('0x61')]===_0x946d('0x5e')){var _0x1e2629=_0x4c24ca[_0x946d('0x5f')]({'plain':!![]});var _0x10d2d8=_0x946d('0x62');return db[_0x946d('0x63')]['find']({'where':{'name':_0x10d2d8,'userProfileId':_0xcc61b2[_0x946d('0x64')]},'raw':!![]})[_0x946d('0x38')](function(_0x1a89b6){if(_0x1a89b6&&_0x1a89b6['autoAssociation']===0x0){return db[_0x946d('0x39')][_0x946d('0x5c')]({'name':_0x1e2629[_0x946d('0x3c')],'resourceId':_0x1e2629['id'],'type':_0x1a89b6[_0x946d('0x3c')],'sectionId':_0x1a89b6['id']},{})['then'](function(){return _0x4c24ca;});}else{return _0x4c24ca;}})['catch'](function(_0x165e7f){logger[_0x946d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x165e7f);throw _0x165e7f;});}return _0x4c24ca;})[_0x946d('0x38')](respondWithResult(_0x389139,0xc9))[_0x946d('0x57')](handleError(_0x389139,null));};exports['update']=function(_0x7a59b8,_0x3a109f){if(_0x7a59b8[_0x946d('0x5d')]['id']){delete _0x7a59b8[_0x946d('0x5d')]['id'];}return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x7a59b8[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0x3e')],'as':_0x946d('0x3f')}]})[_0x946d('0x38')](handleEntityNotFound(_0x3a109f,null))['then'](saveUpdates(_0x7a59b8['body'],null))['then'](respondWithResult(_0x3a109f,null))[_0x946d('0x57')](handleError(_0x3a109f,null));};exports[_0x946d('0x3a')]=function(_0x5638d3,_0x2a01b6){return db[_0x946d('0x41')]['find']({'where':{'id':_0x5638d3[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2a01b6,null))[_0x946d('0x38')](removeEntity(_0x2a01b6,null))[_0x946d('0x57')](handleError(_0x2a01b6,null));};exports[_0x946d('0x65')]=function(_0x410cb7,_0x2247b4){return db[_0x946d('0x41')][_0x946d('0x65')]()[_0x946d('0x38')](respondWithResult(_0x2247b4,null))[_0x946d('0x57')](handleError(_0x2247b4,null));};exports['addDisposition']=function(_0x334d39,_0x5e9de9,_0x413ab9){if(_0x334d39[_0x946d('0x5d')]['id']){delete _0x334d39[_0x946d('0x5d')]['id'];}return db[_0x946d('0x41')]['find']({'where':{'id':_0x334d39['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x5e9de9,null))[_0x946d('0x38')](function(_0x253975){if(_0x253975){_0x334d39[_0x946d('0x5d')][_0x946d('0x66')]=_0x253975['id'];return db['Disposition'][_0x946d('0x5c')](_0x334d39[_0x946d('0x5d')]);}})[_0x946d('0x38')](respondWithResult(_0x5e9de9,null))[_0x946d('0x57')](handleError(_0x5e9de9,null));};exports[_0x946d('0x67')]=function(_0x276ebf,_0x4f41bb,_0x909e08){var _0x337c32={'raw':![],'where':{}};var _0x240a20={};var _0x374630={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x946d('0x68')]({'where':{'id':_0x276ebf[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x4f41bb,null))['then'](function(_0x2a7696){if(_0x2a7696){_0x240a20[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x69')][_0x946d('0x42')]);_0x240a20[_0x946d('0x47')]=_[_0x946d('0x59')](_0x276ebf[_0x946d('0x47')]);_0x240a20[_0x946d('0x48')]=_[_0x946d('0x49')](_0x240a20[_0x946d('0x46')],_0x240a20['query']);_0x337c32['attributes']=_[_0x946d('0x49')](_0x240a20[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x276ebf[_0x946d('0x47')][_0x946d('0x4b')]));_0x337c32[_0x946d('0x4a')]=_0x337c32[_0x946d('0x4a')][_0x946d('0x4c')]?_0x337c32[_0x946d('0x4a')]:_0x240a20[_0x946d('0x46')];if(!_0x276ebf['query']['hasOwnProperty'](_0x946d('0x4d'))){_0x337c32[_0x946d('0x32')]=qs[_0x946d('0x32')](_0x276ebf[_0x946d('0x47')][_0x946d('0x32')]);_0x337c32['offset']=qs[_0x946d('0x30')](_0x276ebf[_0x946d('0x47')]['offset']);}_0x337c32[_0x946d('0x6a')]=qs['sort'](_0x276ebf[_0x946d('0x47')][_0x946d('0x4e')]);_0x337c32['where']=qs['filters'](_[_0x946d('0x50')](_0x276ebf[_0x946d('0x47')],_0x240a20[_0x946d('0x48')]));_0x337c32[_0x946d('0x4f')][_0x946d('0x66')]=_0x2a7696['id'];if(_0x276ebf[_0x946d('0x47')][_0x946d('0x51')]){_0x337c32[_0x946d('0x4f')]=_[_0x946d('0x52')](_0x337c32[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0x337c32[_0x946d('0x4a')],function(_0x423128){var _0x2ea64d={};_0x2ea64d[_0x423128]={'$like':'%'+_0x276ebf[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x2ea64d;})});}_0x337c32=_[_0x946d('0x52')]({},_0x337c32,_0x276ebf['options']);return db[_0x946d('0x69')][_0x946d('0x33')]({'where':_0x337c32['where']})[_0x946d('0x38')](function(_0x27831b){_0x374630['count']=_0x27831b;if(_0x276ebf[_0x946d('0x47')][_0x946d('0x5a')]){_0x337c32['include']=[{'all':!![]}];}return db[_0x946d('0x69')][_0x946d('0x56')](_0x337c32);})[_0x946d('0x38')](function(_0x540165){_0x374630['rows']=_0x540165;return _0x374630;});}})['then'](respondWithFilteredResult(_0x4f41bb,_0x337c32))[_0x946d('0x57')](handleError(_0x4f41bb,null));};exports[_0x946d('0x6b')]=function(_0x348b11,_0x16f992,_0x299be6){return db['WhatsappAccount']['find']({'where':{'id':_0x348b11[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x16f992,null))[_0x946d('0x38')](function(_0x568876){if(_0x568876){return _0x568876[_0x946d('0x6b')](_0x348b11[_0x946d('0x47')][_0x946d('0x6c')]);}})[_0x946d('0x38')](respondWithStatusCode(_0x16f992,null))[_0x946d('0x57')](handleError(_0x16f992,null));};exports[_0x946d('0x6d')]=function(_0x2a5e75,_0x222ea4,_0x580141){if(_0x2a5e75[_0x946d('0x5d')]['id']){delete _0x2a5e75['body']['id'];}return db[_0x946d('0x41')]['find']({'where':{'id':_0x2a5e75[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x222ea4,null))[_0x946d('0x38')](function(_0xad3a58){if(_0xad3a58){_0x2a5e75[_0x946d('0x5d')][_0x946d('0x66')]=_0xad3a58['id'];return db[_0x946d('0x6e')]['create'](_0x2a5e75[_0x946d('0x5d')]);}})[_0x946d('0x38')](respondWithResult(_0x222ea4,null))[_0x946d('0x57')](handleError(_0x222ea4,null));};exports['getAnswers']=function(_0x5ebcd5,_0x2b1be7,_0x5ee3a4){var _0x4e602e={'raw':![],'where':{}};var _0x779445={};var _0x157d7a={'count':0x0,'rows':[]};return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x5ebcd5[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2b1be7,null))[_0x946d('0x38')](function(_0x7c03e){if(_0x7c03e){_0x779445[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x6e')][_0x946d('0x42')]);_0x779445['query']=_[_0x946d('0x59')](_0x5ebcd5['query']);_0x779445[_0x946d('0x48')]=_[_0x946d('0x49')](_0x779445[_0x946d('0x46')],_0x779445[_0x946d('0x47')]);_0x4e602e['attributes']=_['intersection'](_0x779445[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x5ebcd5[_0x946d('0x47')][_0x946d('0x4b')]));_0x4e602e[_0x946d('0x4a')]=_0x4e602e['attributes'][_0x946d('0x4c')]?_0x4e602e[_0x946d('0x4a')]:_0x779445[_0x946d('0x46')];if(!_0x5ebcd5[_0x946d('0x47')][_0x946d('0x6f')](_0x946d('0x4d'))){_0x4e602e['limit']=qs['limit'](_0x5ebcd5['query'][_0x946d('0x32')]);_0x4e602e['offset']=qs[_0x946d('0x30')](_0x5ebcd5[_0x946d('0x47')][_0x946d('0x30')]);}_0x4e602e[_0x946d('0x6a')]=qs[_0x946d('0x4e')](_0x5ebcd5[_0x946d('0x47')][_0x946d('0x4e')]);_0x4e602e[_0x946d('0x4f')]=qs[_0x946d('0x48')](_[_0x946d('0x50')](_0x5ebcd5[_0x946d('0x47')],_0x779445['filters']));_0x4e602e[_0x946d('0x4f')][_0x946d('0x66')]=_0x7c03e['id'];if(_0x5ebcd5[_0x946d('0x47')]['filter']){_0x4e602e[_0x946d('0x4f')]=_['merge'](_0x4e602e[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0x4e602e[_0x946d('0x4a')],function(_0x3090e5){var _0x2f8ccc={};_0x2f8ccc[_0x3090e5]={'$like':'%'+_0x5ebcd5[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x2f8ccc;})});}_0x4e602e=_['merge']({},_0x4e602e,_0x5ebcd5[_0x946d('0x54')]);return db[_0x946d('0x6e')]['count']({'where':_0x4e602e[_0x946d('0x4f')]})[_0x946d('0x38')](function(_0x25442b){_0x157d7a['count']=_0x25442b;if(_0x5ebcd5[_0x946d('0x47')][_0x946d('0x5a')]){_0x4e602e[_0x946d('0x55')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x4e602e);})[_0x946d('0x38')](function(_0x5d060f){_0x157d7a[_0x946d('0x70')]=_0x5d060f;return _0x157d7a;});}})['then'](respondWithFilteredResult(_0x2b1be7,_0x4e602e))['catch'](handleError(_0x2b1be7,null));};exports['removeAnswers']=function(_0x3d3be0,_0x453c80,_0x54d272){return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x3d3be0['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x453c80,null))['then'](function(_0x3a4658){if(_0x3a4658){return _0x3a4658['removeAnswers'](_0x3d3be0[_0x946d('0x47')][_0x946d('0x6c')]);}})[_0x946d('0x38')](respondWithStatusCode(_0x453c80,null))['catch'](handleError(_0x453c80,null));};exports[_0x946d('0x71')]=function(_0x3c572e,_0x2b6011,_0x216b3d){return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x3c572e[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2b6011,null))[_0x946d('0x38')](function(_0x52b856){if(_0x52b856){return _0x52b856['addAgents'](_0x3c572e[_0x946d('0x5d')][_0x946d('0x6c')],_['omit'](_0x3c572e[_0x946d('0x5d')],['ids','id'])||{})[_0x946d('0x72')](function(_0x179911){for(var _0x560f03=0x0;_0x560f03<_0x3c572e['body'][_0x946d('0x6c')][_0x946d('0x4c')];_0x560f03+=0x1){socket['emit'](_0x946d('0x73'),{'UserId':Number(_0x3c572e[_0x946d('0x5d')][_0x946d('0x6c')][_0x560f03]),'WhatsappAccountId':Number(_0x3c572e[_0x946d('0x58')]['id'])});}return _0x179911;});}})[_0x946d('0x38')](respondWithResult(_0x2b6011,null))[_0x946d('0x57')](handleError(_0x2b6011,null));};exports['removeAgents']=function(_0x9fafcc,_0x1736ba,_0x5a29e0){return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x9fafcc['params']['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x1736ba,null))[_0x946d('0x38')](function(_0x28d396){if(_0x28d396){return _0x28d396[_0x946d('0x74')](_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')])[_0x946d('0x38')](function(){if(_[_0x946d('0x75')](_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')])){for(var _0x34b7ad=0x0;_0x34b7ad<_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')][_0x946d('0x4c')];_0x34b7ad+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')][_0x34b7ad]),'WhatsappAccountId':Number(_0x9fafcc['params']['id'])});}}else{socket[_0x946d('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x9fafcc[_0x946d('0x47')][_0x946d('0x6c')]),'WhatsappAccountId':Number(_0x9fafcc['params']['id'])});}});}})[_0x946d('0x38')](respondWithStatusCode(_0x1736ba,null))['catch'](handleError(_0x1736ba,null));};exports['getAgents']=function(_0x5b65fb,_0x3b75e8,_0xe32281){var _0x3842cf={};var _0x309d9d={};var _0x5c875b;var _0x80841c;return db[_0x946d('0x41')]['findOne']({'where':{'id':_0x5b65fb[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x3b75e8,null))[_0x946d('0x38')](function(_0x398b55){if(_0x398b55){_0x5c875b=_0x398b55;_0x309d9d[_0x946d('0x46')]=_[_0x946d('0x59')](db[_0x946d('0x77')][_0x946d('0x42')]);_0x309d9d[_0x946d('0x47')]=_['keys'](_0x5b65fb[_0x946d('0x47')]);_0x309d9d[_0x946d('0x48')]=_[_0x946d('0x49')](_0x309d9d[_0x946d('0x46')],_0x309d9d[_0x946d('0x47')]);_0x3842cf[_0x946d('0x4a')]=_[_0x946d('0x49')](_0x309d9d[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x5b65fb[_0x946d('0x47')][_0x946d('0x4b')]));_0x3842cf[_0x946d('0x4a')]=_0x3842cf[_0x946d('0x4a')]['length']?_0x3842cf[_0x946d('0x4a')]:_0x309d9d[_0x946d('0x46')];_0x3842cf['order']=qs[_0x946d('0x4e')](_0x5b65fb[_0x946d('0x47')]['sort']);_0x3842cf[_0x946d('0x4f')]=qs[_0x946d('0x48')](_[_0x946d('0x50')](_0x5b65fb[_0x946d('0x47')],_0x309d9d['filters']));if(_0x5b65fb[_0x946d('0x47')][_0x946d('0x51')]){_0x3842cf[_0x946d('0x4f')]=_[_0x946d('0x52')](_0x3842cf[_0x946d('0x4f')],{'$or':_['map'](_0x3842cf[_0x946d('0x4a')],function(_0x202998){var _0x2d4848={};_0x2d4848[_0x202998]={'$like':'%'+_0x5b65fb[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x2d4848;})});}_0x3842cf=_[_0x946d('0x52')]({},_0x3842cf,_0x5b65fb[_0x946d('0x54')]);return _0x5c875b[_0x946d('0x78')](_0x3842cf);}})[_0x946d('0x38')](function(_0x4f565b){if(_0x4f565b){_0x80841c=_0x4f565b[_0x946d('0x4c')];if(!_0x5b65fb[_0x946d('0x47')][_0x946d('0x6f')](_0x946d('0x4d'))){_0x3842cf['limit']=qs['limit'](_0x5b65fb[_0x946d('0x47')][_0x946d('0x32')]);_0x3842cf['offset']=qs['offset'](_0x5b65fb['query'][_0x946d('0x30')]);}return _0x5c875b['getAgents'](_0x3842cf);}})[_0x946d('0x38')](function(_0x51d573){if(_0x51d573){return _0x51d573?{'count':_0x80841c,'rows':_0x51d573}:null;}})[_0x946d('0x38')](respondWithResult(_0x3b75e8,null))['catch'](handleError(_0x3b75e8,null));};exports['addApplications']=function(_0x1ce53c,_0x23c01e,_0x278a81){return db[_0x946d('0x41')]['findOne']({'where':{'id':_0x1ce53c[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x23c01e,null))[_0x946d('0x38')](function(_0x33ef52){if(_0x33ef52){return db['sequelize'][_0x946d('0x79')](function(_0x21c915){return db[_0x946d('0x7a')]['destroy']({'where':{'WhatsappAccountId':_0x1ce53c[_0x946d('0x58')]['id']},'transaction':_0x21c915})[_0x946d('0x38')](function(_0xafdf22){var _0x10677a=_[_0x946d('0x40')](_0x1ce53c[_0x946d('0x5d')],function(_0x20579a){_0x20579a[_0x946d('0x66')]=_0x1ce53c['params']['id'];return _0x20579a;});return db[_0x946d('0x7a')][_0x946d('0x7b')](_0x10677a,{'transaction':_0x21c915});});})['then'](function(){return db['WhatsappApplication'][_0x946d('0x7c')]({'where':{'WhatsappAccountId':_0x1ce53c[_0x946d('0x58')]['id']},'order':_0x946d('0x7d')});});}})[_0x946d('0x38')](respondWithResult(_0x23c01e,null))[_0x946d('0x57')](handleError(_0x23c01e,null));};exports[_0x946d('0x7e')]=function(_0x2e9f61,_0x2ea00b,_0x152d8a){var _0x5cdd41={};var _0x258f3f={};var _0x3ecdd7;var _0x206a69;return db[_0x946d('0x41')][_0x946d('0x68')]({'where':{'id':_0x2e9f61[_0x946d('0x58')]['id']}})[_0x946d('0x38')](handleEntityNotFound(_0x2ea00b,null))[_0x946d('0x38')](function(_0x30a288){if(_0x30a288){_0x3ecdd7=_0x30a288;_0x258f3f['model']=_[_0x946d('0x59')](db[_0x946d('0x7a')][_0x946d('0x42')]);_0x258f3f[_0x946d('0x47')]=_[_0x946d('0x59')](_0x2e9f61[_0x946d('0x47')]);_0x258f3f['filters']=_[_0x946d('0x49')](_0x258f3f[_0x946d('0x46')],_0x258f3f[_0x946d('0x47')]);_0x5cdd41['attributes']=_[_0x946d('0x49')](_0x258f3f[_0x946d('0x46')],qs[_0x946d('0x4b')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x4b')]));_0x5cdd41[_0x946d('0x4a')]=_0x5cdd41[_0x946d('0x4a')][_0x946d('0x4c')]?_0x5cdd41[_0x946d('0x4a')]:_0x258f3f[_0x946d('0x46')];_0x5cdd41[_0x946d('0x6a')]=qs[_0x946d('0x4e')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x4e')]);_0x5cdd41[_0x946d('0x4f')]=qs['filters'](_[_0x946d('0x50')](_0x2e9f61['query'],_0x258f3f['filters']));if(_0x2e9f61[_0x946d('0x47')][_0x946d('0x51')]){_0x5cdd41[_0x946d('0x4f')]=_[_0x946d('0x52')](_0x5cdd41[_0x946d('0x4f')],{'$or':_[_0x946d('0x40')](_0x5cdd41[_0x946d('0x4a')],function(_0x1cd08b){var _0x201e4f={};_0x201e4f[_0x1cd08b]={'$like':'%'+_0x2e9f61[_0x946d('0x47')][_0x946d('0x51')]+'%'};return _0x201e4f;})});}_0x5cdd41=_['merge']({},_0x5cdd41,_0x2e9f61['options']);return _0x3ecdd7[_0x946d('0x7e')](_0x5cdd41);}})['then'](function(_0x5e3469){if(_0x5e3469){_0x206a69=_0x5e3469[_0x946d('0x4c')];if(!_0x2e9f61[_0x946d('0x47')]['hasOwnProperty'](_0x946d('0x4d'))){_0x5cdd41['limit']=qs[_0x946d('0x32')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x32')]);_0x5cdd41[_0x946d('0x30')]=qs[_0x946d('0x30')](_0x2e9f61[_0x946d('0x47')][_0x946d('0x30')]);}return _0x3ecdd7[_0x946d('0x7e')](_0x5cdd41);}})[_0x946d('0x38')](function(_0xd49cf9){if(_0xd49cf9){return _0xd49cf9?{'count':_0x206a69,'rows':_0xd49cf9}:null;}})['then'](respondWithResult(_0x2ea00b,null))[_0x946d('0x57')](handleError(_0x2ea00b,null));};exports[_0x946d('0x7f')]=function(_0x18a9a9,_0x705e3f,_0x1db09f){logger['info'](_0x946d('0x80'));logger[_0x946d('0x24')](_0x946d('0x81'),JSON[_0x946d('0x82')](_0x18a9a9[_0x946d('0x5d')]));var _0x4af2d6={'channel':_0x946d('0x83')};var _0x4266c6=[];var _0x2e9ef9=[];var _0x55a531={};return db[_0x946d('0x41')][_0x946d('0x5b')]({'where':{'id':_0x18a9a9[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0x7a')],'as':_0x946d('0x84')}]})[_0x946d('0x38')](handleEntityNotFound(_0x705e3f,null))[_0x946d('0x38')](function(_0x1fc7d2){_0x4af2d6['account']=_0x1fc7d2;_0x4af2d6[_0x946d('0x85')]=_[_0x946d('0x86')](_0x1fc7d2[_0x946d('0x84')],['priority'],['asc']);if(_0x4af2d6[_0x946d('0x87')][_0x946d('0x84')]){delete _0x4af2d6[_0x946d('0x87')][_0x946d('0x84')];}return db['CmContact'][_0x946d('0x65')]();})[_0x946d('0x38')](function(_0x1d26e2){if(!_0x1d26e2){throw new db[(_0x946d('0x88'))][(_0x946d('0x89'))](_0x946d('0x8a'));}logger[_0x946d('0x24')]('AC\x20sinch\x20attributes:%s',JSON[_0x946d('0x82')](_0x1d26e2));logger[_0x946d('0x24')](_0x946d('0x8b'),JSON['stringify'](_0x18a9a9[_0x946d('0x5d')]));_0x4266c6=_[_0x946d('0x8c')](_[_0x946d('0x59')](_0x1d26e2),['createdAt',_0x946d('0x8d')]);_0x2e9ef9=_[_0x946d('0x8c')](_[_0x946d('0x59')](_0x1d26e2),[_0x946d('0x8e'),_0x946d('0x8d'),_0x946d('0x8f'),_0x946d('0x90')]);_0x4af2d6[_0x946d('0x5d')]={'mapKey':_0x946d('0x91')};logger['info'](_0x946d('0x92'),JSON[_0x946d('0x82')](_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]));logger[_0x946d('0x24')](_0x946d('0x93'),JSON['stringify'](_0x4af2d6['body']));logger[_0x946d('0x24')]('AC\x20sinch\x20contactFields:%s',_0x4266c6);logger[_0x946d('0x24')](_0x946d('0x94'),_0x2e9ef9);if(_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]&&_0x4af2d6['account'][_0x946d('0x44')]===_0x946d('0x95')){_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')]=_0x18a9a9['body'][_0x946d('0x97')][_0x946d('0x98')](_0x946d('0x99'),'');_0x4af2d6[_0x946d('0x5d')][_0x946d('0x5d')]=_0x18a9a9[_0x946d('0x5d')][_0x946d('0x9a')];_0x4af2d6[_0x946d('0x5d')][_0x946d('0x9b')]=_0x18a9a9['body'][_0x946d('0x9c')];}if(_0x4af2d6['account'][_0x946d('0x44')]&&_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]===_0x946d('0x9d')){logger[_0x946d('0x24')]('AC\x20sinch\x20req.body\x202:%s',JSON[_0x946d('0x82')](_0x18a9a9[_0x946d('0x5d')]));_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')]=_0x18a9a9[_0x946d('0x5d')]['notifications'][0x0]['from'];_0x4af2d6[_0x946d('0x5d')]['body']=_0x18a9a9[_0x946d('0x5d')][_0x946d('0x9e')][0x0]['message'][_0x946d('0x5d')];_0x4af2d6['body'][_0x946d('0x9b')]=_0x18a9a9[_0x946d('0x5d')][_0x946d('0x9e')][0x0][_0x946d('0x9f')];}if(_0x4af2d6[_0x946d('0x5d')]['id']){delete _0x4af2d6[_0x946d('0x5d')]['id'];}if(_['isNil'](_0x4af2d6['body'][_0x946d('0x96')])){throw new db[(_0x946d('0x88'))][(_0x946d('0x89'))](_0x946d('0xa0'));}if(_[_0x946d('0xa1')](_0x4af2d6[_0x946d('0x5d')][_0x946d('0x5d')])||_0x4af2d6[_0x946d('0x5d')][_0x946d('0x5d')]===''){throw new db[(_0x946d('0x88'))]['ValidationError'](_0x946d('0xa2'));}if(_[_0x946d('0xa1')](_0x4af2d6[_0x946d('0x5d')]['mapKey'])){throw new db['Sequelize'][(_0x946d('0x89'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2e9ef9);}if(!_[_0x946d('0xa3')](_0x2e9ef9,_0x4af2d6[_0x946d('0x5d')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x946d('0xa4')+_0x2e9ef9);}_0x55a531[_0x4af2d6['body'][_0x946d('0xa5')]]=_0x4af2d6[_0x946d('0x5d')]['from'];return db['CmList']['find']({'where':{'id':_0x4af2d6[_0x946d('0x87')][_0x946d('0x90')]},'include':[{'model':db['CmContact'],'as':_0x946d('0xa6'),'where':_0x55a531,'limit':0x1,'order':[[_0x946d('0x8d'),_0x946d('0xa7')]]}]});})[_0x946d('0x38')](handleEntityNotFound(_0x705e3f,null))['then'](function(_0x5a48e5){if(_0x5a48e5){_0x4af2d6[_0x946d('0xa8')]=_[_0x946d('0xa9')](_0x5a48e5,['Contacts']);if(_0x5a48e5[_0x946d('0xa6')][_0x946d('0x4c')]){return _0x5a48e5[_0x946d('0xa6')][0x0];}var _0x377d78=_[_0x946d('0xaa')](_0x4af2d6[_0x946d('0x5d')],{'firstName':_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')],'ListId':_0x5a48e5['id']});_0x377d78[_0x4af2d6[_0x946d('0x5d')]['mapKey']]=_0x4af2d6[_0x946d('0x5d')]['from'];return db[_0x946d('0xab')][_0x946d('0x5c')](_0x377d78,{'fields':_0x4266c6,'raw':!![]});}})[_0x946d('0x38')](handleEntityNotFound(_0x705e3f,null))[_0x946d('0x38')](function(_0x31ca55){if(_0x31ca55){_0x4af2d6[_0x946d('0xac')]=_0x31ca55;var _0x561d38={'ContactId':_0x31ca55['id'],'phone':_0x4af2d6[_0x946d('0x5d')][_0x946d('0x96')],'WhatsappAccountId':_0x18a9a9[_0x946d('0x58')]['id']};var _0x5347e9={'ContactId':_0x31ca55['id'],'WhatsappAccountId':_0x18a9a9['params']['id'],'closed':![]};return db[_0x946d('0xad')][_0x946d('0x5b')]({'where':_0x5347e9})[_0x946d('0x38')](function(_0x570466){if(_0x570466){return[_0x570466,![]];}return db[_0x946d('0xad')][_0x946d('0x5c')](_0x561d38)[_0x946d('0x38')](function(_0x22ea33){return[_0x22ea33,!![]];});});}})[_0x946d('0x72')](function(_0x529fc1,_0x4e9aca){_0x4af2d6[_0x946d('0xae')]=_0x529fc1[_0x946d('0x5f')]({'plain':!![]});_0x4af2d6[_0x946d('0xae')]['created']=![];if(_0x4e9aca){if(_0x4af2d6[_0x946d('0x87')][_0x946d('0xaf')]){_0x4af2d6[_0x946d('0x85')][_0x946d('0xb0')]({'id':0x0,'priority':_0x4af2d6[_0x946d('0x85')][_0x946d('0x4c')]+0x1,'app':_0x946d('0xb1'),'appdata':_0x946d('0xb2'),'interval':_0x946d('0xb3')});}_0x4af2d6[_0x946d('0xae')][_0x946d('0xb4')]=!![];}return db[_0x946d('0xb5')]['create']({'phone':_0x4af2d6[_0x946d('0x5d')]['from'],'messageId':_0x4af2d6['body']['messageId'],'body':_0x4af2d6['body'][_0x946d('0x5d')],'WhatsappAccountId':_0x18a9a9[_0x946d('0x58')]['id'],'WhatsappInteractionId':_0x529fc1['id'],'direction':'in','ContactId':_0x529fc1[_0x946d('0xb6')],'AttachmentId':_0x4af2d6[_0x946d('0x5d')]['AttachmentId']});})['then'](function(_0x175017){_0x4af2d6[_0x946d('0x2a')]=_0x175017;if(_0x4af2d6['interaction'][_0x946d('0xb7')]){return db[_0x946d('0x77')][_0x946d('0x5b')]({'attributes':['id',_0x946d('0x3c')],'where':{'id':_0x4af2d6['interaction']['UserId']}})['then'](function(_0x2155a6){if(_0x2155a6){_0x4af2d6['applications'][_0x946d('0xb8')]({'id':0x0,'priority':0x0,'app':_0x946d('0xb9'),'appdata':_0x2155a6[_0x946d('0x3c')]+','+(_0x4af2d6[_0x946d('0x87')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x946d('0xba'),_0x946d('0xbb'),_0x4af2d6);});}return respondWithRpcPromise(_0x946d('0xba'),_0x946d('0xbb'),_0x4af2d6);})[_0x946d('0x38')](function(_0x5b23bd){if(_0x5b23bd){var _0x1cf26b=0xc8;var _0x1d7e27=_0x946d('0xbc');logger[_0x946d('0x24')](_0x946d('0x26'),_0x1d7e27,_0x1cf26b,_0x946d('0xbd'));logger[_0x946d('0xbe')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1d7e27,_0x1cf26b,_0x946d('0xbd'),JSON[_0x946d('0x82')](_0x5b23bd));if(_0x4af2d6[_0x946d('0x87')][_0x946d('0x44')]===_0x946d('0x95')){return _0x705e3f[_0x946d('0x2e')](_0x1cf26b)[_0x946d('0x34')](_0x946d('0xbf'),_0x946d('0xc0'))['send'](_0x946d('0xc1'));}else{return _0x705e3f[_0x946d('0x2e')](_0x1cf26b)[_0x946d('0x2f')](_0x5b23bd);}}})[_0x946d('0x57')](handleError(_0x705e3f,null));};exports['send']=function(_0x164192,_0x4759eb,_0x3881c0){var _0x3ec1de,_0x549de8,_0x444822;if(_[_0x946d('0xa1')](_0x164192[_0x946d('0x5d')][_0x946d('0x5d')])||_0x164192[_0x946d('0x5d')][_0x946d('0x5d')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x946d('0xa1')](_0x164192['body']['to'])){throw new db[(_0x946d('0x88'))][(_0x946d('0x89'))](_0x946d('0xc2'));}_0x3ec1de=_0x164192[_0x946d('0x5d')]['to'];return db[_0x946d('0x41')]['find']({'where':{'id':_0x164192[_0x946d('0x58')]['id']},'include':[{'model':db[_0x946d('0xc3')],'as':_0x946d('0xc4'),'include':[{'model':db[_0x946d('0xab')],'as':_0x946d('0xa6'),'where':{'mobile':_0x3ec1de},'limit':0x1,'order':[['updatedAt',_0x946d('0xa7')]]}]}]})['then'](handleEntityNotFound(_0x4759eb,null))[_0x946d('0x38')](function(_0x8ae664){if(_0x8ae664&&_0x8ae664[_0x946d('0xc4')]){_0x549de8=_0x8ae664[_0x946d('0x5f')]({'plain':!![]});if(_0x549de8[_0x946d('0xc4')]&&_0x549de8[_0x946d('0xc4')][_0x946d('0xa6')]['length']){return _0x549de8[_0x946d('0xc4')][_0x946d('0xa6')][0x0];}return db[_0x946d('0xab')]['create'](_[_0x946d('0xaa')](_0x164192[_0x946d('0x5d')],{'firstName':_0x3ec1de,'mobile':_0x3ec1de,'phone':_0x3ec1de,'ListId':_0x549de8[_0x946d('0x90')]}));}})[_0x946d('0x38')](handleEntityNotFound(_0x4759eb,null))[_0x946d('0x38')](function(_0x526a4c){if(_0x526a4c){_0x444822=_0x526a4c;return db['WhatsappInteraction'][_0x946d('0x5b')]({'where':{'ContactId':_0x444822['id'],'closed':![],'WhatsappAccountId':_0x549de8['id']}})[_0x946d('0x38')](function(_0xa9e69c){if(_0xa9e69c){return[_0xa9e69c,![]];}return db['WhatsappInteraction'][_0x946d('0x5c')]({'UserId':_0x164192[_0x946d('0x5e')]['id'],'ContactId':_0x444822['id'],'WhatsappAccountId':_0x549de8['id'],'phone':_0x3ec1de,'firstMsgDirection':_0x946d('0xc5'),'Messages':[_['merge'](_0x164192[_0x946d('0x5d')],{'read':![],'body':_0x164192[_0x946d('0x5d')][_0x946d('0x5d')],'phone':_0x3ec1de,'WhatsappAccountId':_0x549de8['id'],'UserId':_0x164192[_0x946d('0x5e')]['id'],'ContactId':_0x444822['id']})]},{'include':[{'model':db[_0x946d('0xb5')],'as':_0x946d('0xc6')}]})['then'](function(_0xb97008){return[_0xb97008,!![]];});});}})[_0x946d('0x72')](function(_0x17c273,_0x1425bb){if(_0x1425bb){return _0x17c273;}return db[_0x946d('0xb5')]['create'](_[_0x946d('0x52')](_0x164192[_0x946d('0x5d')],{'read':![],'body':_0x164192[_0x946d('0x5d')][_0x946d('0x5d')],'phone':_0x3ec1de,'WhatsappAccountId':_0x549de8['id'],'WhatsappInteractionId':_0x17c273['id'],'UserId':_0x164192[_0x946d('0x5e')]['id'],'ContactId':_0x444822['id']}))['then'](function(_0x280461){_0x17c273[_0x946d('0xc7')]['Messages']=[];_0x17c273[_0x946d('0xc7')][_0x946d('0xc6')][_0x946d('0xb0')](_0x280461['dataValues']);return _0x17c273;});})[_0x946d('0x38')](respondWithResult(_0x4759eb,null))['catch'](handleError(_0x4759eb,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 3a4c496..74ffea2 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 _0xe202=['hook','events','../../mysqldb','WhatsappAccount','save','update','remove'];(function(_0x24ab07,_0x55c21b){var _0x3c76fa=function(_0x21f05b){while(--_0x21f05b){_0x24ab07['push'](_0x24ab07['shift']());}};_0x3c76fa(++_0x55c21b);}(_0xe202,0x16d));var _0x2e20=function(_0x3f4361,_0x470709){_0x3f4361=_0x3f4361-0x0;var _0x547815=_0xe202[_0x3f4361];return _0x547815;};'use strict';var EventEmitter=require(_0x2e20('0x0'));var WhatsappAccount=require(_0x2e20('0x1'))['db'][_0x2e20('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x2e20('0x3'),'afterUpdate':_0x2e20('0x4'),'afterDestroy':_0x2e20('0x5')};function emitEvent(_0x1b3145){return function(_0x49fcd2,_0x4f69d5,_0x8234bf){WhatsappAccountEvents['emit'](_0x1b3145+':'+_0x49fcd2['id'],_0x49fcd2);WhatsappAccountEvents['emit'](_0x1b3145,_0x49fcd2);_0x8234bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x2e20('0x6')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0xb1a4=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x163c28,_0xcb1fc5){var _0x389bd8=function(_0x4e9c4f){while(--_0x4e9c4f){_0x163c28['push'](_0x163c28['shift']());}};_0x389bd8(++_0xcb1fc5);}(_0xb1a4,0x100));var _0x4b1a=function(_0x48d216,_0x243ddc){_0x48d216=_0x48d216-0x0;var _0x7c0220=_0xb1a4[_0x48d216];return _0x7c0220;};'use strict';var EventEmitter=require(_0x4b1a('0x0'));var WhatsappAccount=require(_0x4b1a('0x1'))['db'][_0x4b1a('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x4b1a('0x3')](0x0);var events={'afterCreate':_0x4b1a('0x4'),'afterUpdate':'update','afterDestroy':_0x4b1a('0x5')};function emitEvent(_0x4e13cb){return function(_0x40e116,_0x59e685,_0x21af20){WhatsappAccountEvents['emit'](_0x4e13cb+':'+_0x40e116['id'],_0x40e116);WhatsappAccountEvents['emit'](_0x4e13cb,_0x40e116);_0x21af20(null);};}for(var e in events){if(events[_0x4b1a('0x6')](e)){var event=events[e];WhatsappAccount[_0x4b1a('0x7')](e,emitEvent(event));}}module[_0x4b1a('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index adebd82..908864a 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 _0xd097=['define','lodash','util','api','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x5b03d7,_0x354ec0){var _0x5df075=function(_0x643de9){while(--_0x643de9){_0x5b03d7['push'](_0x5b03d7['shift']());}};_0x5df075(++_0x354ec0);}(_0xd097,0x1cc));var _0x7d09=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xd097[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x7d09('0x0'));var util=require(_0x7d09('0x1'));var logger=require('../../config/logger')(_0x7d09('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d09('0x3'));var rimraf=require(_0x7d09('0x4'));var config=require(_0x7d09('0x5'));var attributes=require(_0x7d09('0x6'));module[_0x7d09('0x7')]=function(_0x49ff31,_0x1760b1){return _0x49ff31[_0x7d09('0x8')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b7c=['path','rimraf','../../config/environment','./whatsappAccount.attributes','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x13ca0e,_0x4d5e47){var _0x5c139a=function(_0x3d0250){while(--_0x3d0250){_0x13ca0e['push'](_0x13ca0e['shift']());}};_0x5c139a(++_0x4d5e47);}(_0x4b7c,0xec));var _0xc4b7=function(_0x3334c7,_0x4eb5ea){_0x3334c7=_0x3334c7-0x0;var _0xaec36e=_0x4b7c[_0x3334c7];return _0xaec36e;};'use strict';var _=require(_0xc4b7('0x0'));var util=require(_0xc4b7('0x1'));var logger=require(_0xc4b7('0x2'))(_0xc4b7('0x3'));var moment=require('moment');var BPromise=require(_0xc4b7('0x4'));var rp=require(_0xc4b7('0x5'));var fs=require('fs');var path=require(_0xc4b7('0x6'));var rimraf=require(_0xc4b7('0x7'));var config=require(_0xc4b7('0x8'));var attributes=require(_0xc4b7('0x9'));module['exports']=function(_0x1c58da,_0x83fecf){return _0x1c58da[_0xc4b7('0xa')]('WhatsappAccount',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 bab179b..488bbb9 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 _0x6e14=['register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','ShowWhatsappAccount','WhatsappAccount','options','raw','where','attributes','map','include','model','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e14,0x81));var _0x46e1=function(_0x2cf0ed,_0x277b37){_0x2cf0ed=_0x2cf0ed-0x0;var _0x206fb0=_0x6e14[_0x2cf0ed];return _0x206fb0;};'use strict';var _=require(_0x46e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x46e1('0x1'));var rs=require(_0x46e1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46e1('0x3'))['db'];var utils=require(_0x46e1('0x4'));var logger=require(_0x46e1('0x5'))('rpc');var config=require(_0x46e1('0x6'));var jayson=require(_0x46e1('0x7'));var client=jayson[_0x46e1('0x8')][_0x46e1('0x9')]({'port':0x232a});config[_0x46e1('0xa')]=_[_0x46e1('0xb')](config['redis'],{'host':_0x46e1('0xc'),'port':0x18eb});var socket=require(_0x46e1('0xd'))(new Redis(config[_0x46e1('0xa')]));require(_0x46e1('0xe'))[_0x46e1('0xf')](socket);function respondWithRpcPromise(_0x216cd0,_0x238c8c,_0x299f6f){return new BPromise(function(_0x533673,_0x40c212){return client[_0x46e1('0x10')](_0x216cd0,_0x299f6f)[_0x46e1('0x11')](function(_0x2305c1){logger[_0x46e1('0x12')](_0x46e1('0x13'),_0x238c8c,_0x46e1('0x14'));logger[_0x46e1('0x15')](_0x46e1('0x16'),_0x238c8c,'request\x20sent',JSON[_0x46e1('0x17')](_0x2305c1));if(_0x2305c1[_0x46e1('0x18')]){if(_0x2305c1[_0x46e1('0x18')]['code']===0x1f4){logger[_0x46e1('0x18')](_0x46e1('0x13'),_0x238c8c,_0x2305c1[_0x46e1('0x18')][_0x46e1('0x19')]);return _0x40c212(_0x2305c1[_0x46e1('0x18')][_0x46e1('0x19')]);}logger[_0x46e1('0x18')](_0x46e1('0x13'),_0x238c8c,_0x2305c1[_0x46e1('0x18')]['message']);return _0x533673(_0x2305c1[_0x46e1('0x18')][_0x46e1('0x19')]);}else{logger[_0x46e1('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x238c8c,_0x46e1('0x14'));_0x533673(_0x2305c1['result'][_0x46e1('0x19')]);}})['catch'](function(_0x686f5e){logger[_0x46e1('0x18')](_0x46e1('0x13'),_0x238c8c,_0x686f5e);_0x40c212(_0x686f5e);});});}exports[_0x46e1('0x1a')]=function(_0x482406){var _0x2cc41f=this;return new Promise(function(_0x28edb2,_0xb0a44d){return db[_0x46e1('0x1b')]['find']({'raw':_0x482406[_0x46e1('0x1c')]?_0x482406[_0x46e1('0x1c')][_0x46e1('0x1d')]===undefined?!![]:![]:!![],'where':_0x482406['options']?_0x482406[_0x46e1('0x1c')][_0x46e1('0x1e')]||null:null,'attributes':_0x482406[_0x46e1('0x1c')]?_0x482406[_0x46e1('0x1c')][_0x46e1('0x1f')]||null:null,'include':_0x482406['options']?_0x482406[_0x46e1('0x1c')]['include']?_[_0x46e1('0x20')](_0x482406[_0x46e1('0x1c')][_0x46e1('0x21')],function(_0x107b86){return{'model':db[_0x107b86['model']],'as':_0x107b86['as'],'attributes':_0x107b86[_0x46e1('0x1f')],'include':_0x107b86[_0x46e1('0x21')]?_[_0x46e1('0x20')](_0x107b86['include'],function(_0x72dd10){return{'model':db[_0x72dd10[_0x46e1('0x22')]],'as':_0x72dd10['as'],'attributes':_0x72dd10[_0x46e1('0x1f')],'include':_0x72dd10[_0x46e1('0x21')]?_['map'](_0x72dd10[_0x46e1('0x21')],function(_0x14cbe8){return{'model':db[_0x14cbe8[_0x46e1('0x22')]],'as':_0x14cbe8['as'],'attributes':_0x14cbe8[_0x46e1('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x46e1('0x11')](function(_0x1e313f){logger['info'](_0x46e1('0x1a'),_0x482406);logger['debug'](_0x46e1('0x1a'),_0x482406,JSON[_0x46e1('0x17')](_0x1e313f));_0x28edb2(_0x1e313f);})[_0x46e1('0x23')](function(_0x423c80){logger[_0x46e1('0x18')](_0x46e1('0x1a'),_0x423c80[_0x46e1('0x19')],_0x482406);_0xb0a44d(_0x2cc41f['error'](0x1f4,_0x423c80['message']));});});}; \ No newline at end of file +var _0x38e2=['WhatsappAccount,\x20%s,\x20%s','message','result','catch','ShowWhatsappAccount','find','options','raw','where','include','model','map','attributes','then','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','redis','localhost','./whatsappAccount.socket','register','request','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xe78202,_0x200dd0){var _0xd44ff5=function(_0x33936b){while(--_0x33936b){_0xe78202['push'](_0xe78202['shift']());}};_0xd44ff5(++_0x200dd0);}(_0x38e2,0x1c8));var _0x238e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x38e2[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x238e('0x0'));var util=require('util');var moment=require(_0x238e('0x1'));var BPromise=require(_0x238e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x238e('0x3'))['db'];var utils=require(_0x238e('0x4'));var logger=require('../../config/logger')(_0x238e('0x5'));var config=require(_0x238e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x238e('0x7')]['http']({'port':0x232a});config['redis']=_[_0x238e('0x8')](config[_0x238e('0x9')],{'host':_0x238e('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x238e('0x9')]));require(_0x238e('0xb'))[_0x238e('0xc')](socket);function respondWithRpcPromise(_0x5392f2,_0x4992bd,_0x2509ff){return new BPromise(function(_0x4c1d26,_0x481089){return client[_0x238e('0xd')](_0x5392f2,_0x2509ff)['then'](function(_0x2bf49d){logger[_0x238e('0xe')]('WhatsappAccount,\x20%s,\x20%s',_0x4992bd,_0x238e('0xf'));logger['debug'](_0x238e('0x10'),_0x4992bd,_0x238e('0xf'),JSON[_0x238e('0x11')](_0x2bf49d));if(_0x2bf49d['error']){if(_0x2bf49d[_0x238e('0x12')][_0x238e('0x13')]===0x1f4){logger['error'](_0x238e('0x14'),_0x4992bd,_0x2bf49d[_0x238e('0x12')][_0x238e('0x15')]);return _0x481089(_0x2bf49d[_0x238e('0x12')][_0x238e('0x15')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4992bd,_0x2bf49d['error'][_0x238e('0x15')]);return _0x4c1d26(_0x2bf49d[_0x238e('0x12')][_0x238e('0x15')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x4992bd,_0x238e('0xf'));_0x4c1d26(_0x2bf49d[_0x238e('0x16')][_0x238e('0x15')]);}})[_0x238e('0x17')](function(_0x4f5cf3){logger['error'](_0x238e('0x14'),_0x4992bd,_0x4f5cf3);_0x481089(_0x4f5cf3);});});}exports[_0x238e('0x18')]=function(_0x40a682){var _0x4929ef=this;return new Promise(function(_0x23de0e,_0x1ebfac){return db['WhatsappAccount'][_0x238e('0x19')]({'raw':_0x40a682[_0x238e('0x1a')]?_0x40a682[_0x238e('0x1a')][_0x238e('0x1b')]===undefined?!![]:![]:!![],'where':_0x40a682[_0x238e('0x1a')]?_0x40a682['options'][_0x238e('0x1c')]||null:null,'attributes':_0x40a682['options']?_0x40a682[_0x238e('0x1a')]['attributes']||null:null,'include':_0x40a682[_0x238e('0x1a')]?_0x40a682['options']['include']?_['map'](_0x40a682[_0x238e('0x1a')][_0x238e('0x1d')],function(_0xa869ae){return{'model':db[_0xa869ae[_0x238e('0x1e')]],'as':_0xa869ae['as'],'attributes':_0xa869ae['attributes'],'include':_0xa869ae[_0x238e('0x1d')]?_[_0x238e('0x1f')](_0xa869ae[_0x238e('0x1d')],function(_0x1676ea){return{'model':db[_0x1676ea['model']],'as':_0x1676ea['as'],'attributes':_0x1676ea[_0x238e('0x20')],'include':_0x1676ea[_0x238e('0x1d')]?_[_0x238e('0x1f')](_0x1676ea['include'],function(_0x3bcc6e){return{'model':db[_0x3bcc6e[_0x238e('0x1e')]],'as':_0x3bcc6e['as'],'attributes':_0x3bcc6e[_0x238e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x238e('0x21')](function(_0x49e162){logger['info'](_0x238e('0x18'),_0x40a682);logger['debug'](_0x238e('0x18'),_0x40a682,JSON[_0x238e('0x11')](_0x49e162));_0x23de0e(_0x49e162);})[_0x238e('0x17')](function(_0x16c0c0){logger['error']('ShowWhatsappAccount',_0x16c0c0[_0x238e('0x15')],_0x40a682);_0x1ebfac(_0x4929ef[_0x238e('0x12')](0x1f4,_0x16c0c0['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 4b1cb7c..57a69d8 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 _0x6649=['whatsappAccount:','./whatsappAccount.events','save','update','register','length'];(function(_0x1ecdc1,_0x64092e){var _0x24f725=function(_0x4f7c76){while(--_0x4f7c76){_0x1ecdc1['push'](_0x1ecdc1['shift']());}};_0x24f725(++_0x64092e);}(_0x6649,0x109));var _0x9664=function(_0x4fbe74,_0x2aed19){_0x4fbe74=_0x4fbe74-0x0;var _0x5cc005=_0x6649[_0x4fbe74];return _0x5cc005;};'use strict';var WhatsappAccountEvents=require(_0x9664('0x0'));var events=[_0x9664('0x1'),'remove',_0x9664('0x2')];function createListener(_0x2d2c0c,_0x36af45){return function(_0x24b4e6){_0x36af45['emit'](_0x2d2c0c,_0x24b4e6);};}function removeListener(_0x26bfe9,_0x2360d4){return function(){WhatsappAccountEvents['removeListener'](_0x26bfe9,_0x2360d4);};}exports[_0x9664('0x3')]=function(_0x7bf559){for(var _0x10eb85=0x0,_0x217c76=events[_0x9664('0x4')];_0x10eb85<_0x217c76;_0x10eb85++){var _0x11a5be=events[_0x10eb85];var _0xe841cf=createListener(_0x9664('0x5')+_0x11a5be,_0x7bf559);WhatsappAccountEvents['on'](_0x11a5be,_0xe841cf);}}; \ No newline at end of file +var _0xc7d3=['./whatsappAccount.events','remove','update','emit','removeListener','length','whatsappAccount:'];(function(_0xe44f8d,_0x34b84d){var _0x1e84b5=function(_0x5b6ae3){while(--_0x5b6ae3){_0xe44f8d['push'](_0xe44f8d['shift']());}};_0x1e84b5(++_0x34b84d);}(_0xc7d3,0xe0));var _0x3c7d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7d3[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappAccountEvents=require(_0x3c7d('0x0'));var events=['save',_0x3c7d('0x1'),_0x3c7d('0x2')];function createListener(_0x4c2977,_0x223d53){return function(_0x46cf51){_0x223d53[_0x3c7d('0x3')](_0x4c2977,_0x46cf51);};}function removeListener(_0x24c22d,_0x42d357){return function(){WhatsappAccountEvents[_0x3c7d('0x4')](_0x24c22d,_0x42d357);};}exports['register']=function(_0x36f072){for(var _0x5dfacf=0x0,_0x54fb60=events[_0x3c7d('0x5')];_0x5dfacf<_0x54fb60;_0x5dfacf++){var _0x291ba6=events[_0x5dfacf];var _0x49ae39=createListener(_0x3c7d('0x6')+_0x291ba6,_0x36f072);WhatsappAccountEvents['on'](_0x291ba6,_0x49ae39);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 6f93fee..7d3d726 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 _0x098b=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x240eee,_0x249118){var _0x411632=function(_0x99d99f){while(--_0x99d99f){_0x240eee['push'](_0x240eee['shift']());}};_0x411632(++_0x249118);}(_0x098b,0x6a));var _0xb098=function(_0x42feda,_0x5d78f8){_0x42feda=_0x42feda-0x0;var _0x859961=_0x098b[_0x42feda];return _0x859961;};'use strict';var multer=require(_0xb098('0x0'));var util=require(_0xb098('0x1'));var path=require(_0xb098('0x2'));var timeout=require(_0xb098('0x3'));var express=require(_0xb098('0x4'));var router=express[_0xb098('0x5')]();var fs_extra=require(_0xb098('0x6'));var auth=require(_0xb098('0x7'));var interaction=require(_0xb098('0x8'));var config=require('../../config/environment');var controller=require(_0xb098('0x9'));router[_0xb098('0xa')]('/',auth[_0xb098('0xb')](),controller[_0xb098('0xc')]);router[_0xb098('0xa')](_0xb098('0xd'),auth[_0xb098('0xb')](),controller[_0xb098('0xe')]);router[_0xb098('0xf')]('/',auth[_0xb098('0xb')](),controller[_0xb098('0x10')]);router[_0xb098('0x11')](_0xb098('0xd'),auth[_0xb098('0xb')](),controller[_0xb098('0x12')]);router[_0xb098('0x13')]('/:id',auth[_0xb098('0xb')](),controller[_0xb098('0x14')]);module['exports']=router; \ No newline at end of file +var _0xe777=['Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','show','create','put','/:id','update','destroy','multer','util','path','connect-timeout'];(function(_0x1f6c34,_0x1315d4){var _0x4eb227=function(_0x17433f){while(--_0x17433f){_0x1f6c34['push'](_0x1f6c34['shift']());}};_0x4eb227(++_0x1315d4);}(_0xe777,0x11c));var _0x7e77=function(_0x3a20c4,_0x2b79c3){_0x3a20c4=_0x3a20c4-0x0;var _0x3ea33c=_0xe777[_0x3a20c4];return _0x3ea33c;};'use strict';var multer=require(_0x7e77('0x0'));var util=require(_0x7e77('0x1'));var path=require(_0x7e77('0x2'));var timeout=require(_0x7e77('0x3'));var express=require('express');var router=express[_0x7e77('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7e77('0x5'));var config=require(_0x7e77('0x6'));var controller=require(_0x7e77('0x7'));router[_0x7e77('0x8')]('/',auth[_0x7e77('0x9')](),controller['index']);router[_0x7e77('0x8')]('/:id',auth[_0x7e77('0x9')](),controller[_0x7e77('0xa')]);router['post']('/',auth[_0x7e77('0x9')](),controller[_0x7e77('0xb')]);router[_0x7e77('0xc')](_0x7e77('0xd'),auth[_0x7e77('0x9')](),controller[_0x7e77('0xe')]);router['delete'](_0x7e77('0xd'),auth['isAuthenticated'](),controller[_0x7e77('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 9c4c874..70f05dc 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 _0xa9bf=['TEXT','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x50423d,_0x3ba105){var _0x17757d=function(_0x4178e8){while(--_0x4178e8){_0x50423d['push'](_0x50423d['shift']());}};_0x17757d(++_0x3ba105);}(_0xa9bf,0xf8));var _0xfa9b=function(_0x3146da,_0x277a70){_0x3146da=_0x3146da-0x0;var _0x1070de=_0xa9bf[_0x3146da];return _0x1070de;};'use strict';var Sequelize=require(_0xfa9b('0x0'));module['exports']={'priority':{'type':Sequelize[_0xfa9b('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfa9b('0x2')]()},'description':{'type':Sequelize[_0xfa9b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xfa9b('0x4')}}; \ No newline at end of file +var _0x5909=['INTEGER','STRING','sequelize','exports'];(function(_0x36a046,_0x3e04af){var _0x4dacb4=function(_0x4b1f64){while(--_0x4b1f64){_0x36a046['push'](_0x36a046['shift']());}};_0x4dacb4(++_0x3e04af);}(_0x5909,0xfa));var _0x9590=function(_0x5774be,_0x2259d3){_0x5774be=_0x5774be-0x0;var _0x4914b4=_0x5909[_0x5774be];return _0x4914b4;};'use strict';var Sequelize=require(_0x9590('0x0'));module[_0x9590('0x1')]={'priority':{'type':Sequelize[_0x9590('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9590('0x3')]},'interval':{'type':Sequelize[_0x9590('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 03306c7..fe3a474 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 _0x47c5=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','WhatsappApplication'];(function(_0x3da704,_0x3d426c){var _0x1b8bdd=function(_0x271004){while(--_0x271004){_0x3da704['push'](_0x3da704['shift']());}};_0x1b8bdd(++_0x3d426c);}(_0x47c5,0x165));var _0x547c=function(_0x2107a6,_0xe8360d){_0x2107a6=_0x2107a6-0x0;var _0x2f09ef=_0x47c5[_0x2107a6];return _0x2f09ef;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['WhatsappApplication'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':!![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['WhatsappApplication']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['WhatsappApplication'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['WhatsappApplication'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));}; \ No newline at end of file +var _0x8cda=['set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','options','includeAll','rows','include','find','create','body','catch','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','undefined','limit','count'];(function(_0x6ed4a5,_0xeee9c0){var _0x44d54f=function(_0x477afe){while(--_0x477afe){_0x6ed4a5['push'](_0x6ed4a5['shift']());}};_0x44d54f(++_0xeee9c0);}(_0x8cda,0x1db));var _0xa8cd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8cda[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa8cd('0x0'));var zipdir=require(_0xa8cd('0x1'));var jsonpatch=require(_0xa8cd('0x2'));var rp=require(_0xa8cd('0x3'));var moment=require(_0xa8cd('0x4'));var BPromise=require(_0xa8cd('0x5'));var Mustache=require('mustache');var util=require(_0xa8cd('0x6'));var path=require(_0xa8cd('0x7'));var sox=require(_0xa8cd('0x8'));var csv=require('to-csv');var ejs=require(_0xa8cd('0x9'));var fs=require('fs');var fs_extra=require(_0xa8cd('0xa'));var _=require(_0xa8cd('0xb'));var squel=require(_0xa8cd('0xc'));var crypto=require(_0xa8cd('0xd'));var jsforce=require(_0xa8cd('0xe'));var deskjs=require(_0xa8cd('0xf'));var toCsv=require(_0xa8cd('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa8cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa8cd('0x12'));var hardwareService=require(_0xa8cd('0x13'));var logger=require('../../config/logger')(_0xa8cd('0x14'));var utils=require(_0xa8cd('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa8cd('0x16'))['db'];function respondWithStatusCode(_0xa2b804,_0x19ba69){_0x19ba69=_0x19ba69||0xcc;return function(_0xefdff9){if(_0xefdff9){return _0xa2b804[_0xa8cd('0x17')](_0x19ba69);}return _0xa2b804['status'](_0x19ba69)[_0xa8cd('0x18')]();};}function respondWithResult(_0x51d29e,_0x16f366){_0x16f366=_0x16f366||0xc8;return function(_0x5ccd85){if(_0x5ccd85){return _0x51d29e[_0xa8cd('0x19')](_0x16f366)['json'](_0x5ccd85);}};}function respondWithFilteredResult(_0x1970c1,_0x4f244b){return function(_0x9fe9b0){if(_0x9fe9b0){var _0x5bfc4c=typeof _0x4f244b['offset']===_0xa8cd('0x1a')&&typeof _0x4f244b[_0xa8cd('0x1b')]===_0xa8cd('0x1a');var _0x177ca2=_0x9fe9b0['count'];var _0x128a90=_0x5bfc4c?0x0:_0x4f244b['offset'];var _0x1cacd5=_0x5bfc4c?_0x9fe9b0[_0xa8cd('0x1c')]:_0x4f244b['offset']+_0x4f244b[_0xa8cd('0x1b')];var _0x1260e5;if(_0x1cacd5>=_0x177ca2){_0x1cacd5=_0x177ca2;_0x1260e5=0xc8;}else{_0x1260e5=0xce;}_0x1970c1['status'](_0x1260e5);return _0x1970c1[_0xa8cd('0x1d')](_0xa8cd('0x1e'),_0x128a90+'-'+_0x1cacd5+'/'+_0x177ca2)[_0xa8cd('0x1f')](_0x9fe9b0);}return null;};}function patchUpdates(_0x289cb6){return function(_0x420505){try{jsonpatch['apply'](_0x420505,_0x289cb6,!![]);}catch(_0xdd4de1){return BPromise[_0xa8cd('0x20')](_0xdd4de1);}return _0x420505[_0xa8cd('0x21')]();};}function saveUpdates(_0x447d7f,_0x4f4093){return function(_0x1f15c0){if(_0x1f15c0){return _0x1f15c0['update'](_0x447d7f)['then'](function(_0x28574f){return _0x28574f;});}return null;};}function removeEntity(_0x70b17a,_0x4ec3cc){return function(_0x1c7b31){if(_0x1c7b31){return _0x1c7b31[_0xa8cd('0x22')]()[_0xa8cd('0x23')](function(){_0x70b17a[_0xa8cd('0x19')](0xcc)[_0xa8cd('0x18')]();});}};}function handleEntityNotFound(_0x2d1ef5,_0x1f369d){return function(_0x4a5221){if(!_0x4a5221){_0x2d1ef5[_0xa8cd('0x17')](0x194);}return _0x4a5221;};}function handleError(_0x42ae30,_0x3c4c22){_0x3c4c22=_0x3c4c22||0x1f4;return function(_0x393e5a){logger[_0xa8cd('0x24')](_0x393e5a[_0xa8cd('0x25')]);if(_0x393e5a['name']){delete _0x393e5a[_0xa8cd('0x26')];}_0x42ae30[_0xa8cd('0x19')](_0x3c4c22)[_0xa8cd('0x27')](_0x393e5a);};}exports[_0xa8cd('0x28')]=function(_0xe973cb,_0x2241f8){var _0x3285d8={},_0x3e1770={},_0x2a99e6={'count':0x0,'rows':[]};var _0x22cf82=_[_0xa8cd('0x29')](db[_0xa8cd('0x2a')][_0xa8cd('0x2b')],function(_0x44ea2f){return{'name':_0x44ea2f[_0xa8cd('0x2c')],'type':_0x44ea2f[_0xa8cd('0x2d')]['key']};});_0x3e1770['model']=_['map'](_0x22cf82,_0xa8cd('0x26'));_0x3e1770[_0xa8cd('0x2e')]=_[_0xa8cd('0x2f')](_0xe973cb[_0xa8cd('0x2e')]);_0x3e1770[_0xa8cd('0x30')]=_[_0xa8cd('0x31')](_0x3e1770['model'],_0x3e1770['query']);_0x3285d8['attributes']=_[_0xa8cd('0x31')](_0x3e1770[_0xa8cd('0x32')],qs[_0xa8cd('0x33')](_0xe973cb[_0xa8cd('0x2e')][_0xa8cd('0x33')]));_0x3285d8[_0xa8cd('0x34')]=_0x3285d8[_0xa8cd('0x34')]['length']?_0x3285d8[_0xa8cd('0x34')]:_0x3e1770[_0xa8cd('0x32')];if(!_0xe973cb['query'][_0xa8cd('0x35')](_0xa8cd('0x36'))){_0x3285d8[_0xa8cd('0x1b')]=qs[_0xa8cd('0x1b')](_0xe973cb['query'][_0xa8cd('0x1b')]);_0x3285d8[_0xa8cd('0x37')]=qs['offset'](_0xe973cb[_0xa8cd('0x2e')][_0xa8cd('0x37')]);}_0x3285d8[_0xa8cd('0x38')]=qs[_0xa8cd('0x39')](_0xe973cb['query']['sort']);_0x3285d8[_0xa8cd('0x3a')]=qs['filters'](_[_0xa8cd('0x3b')](_0xe973cb['query'],_0x3e1770[_0xa8cd('0x30')]),_0x22cf82);if(_0xe973cb[_0xa8cd('0x2e')]['filter']){_0x3285d8[_0xa8cd('0x3a')]=_[_0xa8cd('0x3c')](_0x3285d8[_0xa8cd('0x3a')],{'$or':_[_0xa8cd('0x29')](_0x22cf82,function(_0x451ba8){if(_0x451ba8[_0xa8cd('0x2d')]!==_0xa8cd('0x3d')){var _0x5100d5={};_0x5100d5[_0x451ba8[_0xa8cd('0x26')]]={'$like':'%'+_0xe973cb[_0xa8cd('0x2e')]['filter']+'%'};return _0x5100d5;}})});}_0x3285d8=_['merge']({},_0x3285d8,_0xe973cb[_0xa8cd('0x3e')]);var _0x3da42e={'where':_0x3285d8[_0xa8cd('0x3a')]};return db[_0xa8cd('0x2a')][_0xa8cd('0x1c')](_0x3da42e)[_0xa8cd('0x23')](function(_0x40cd4e){_0x2a99e6[_0xa8cd('0x1c')]=_0x40cd4e;if(_0xe973cb['query'][_0xa8cd('0x3f')]){_0x3285d8['include']=[{'all':!![]}];}return db[_0xa8cd('0x2a')]['findAll'](_0x3285d8);})[_0xa8cd('0x23')](function(_0x27a64c){_0x2a99e6[_0xa8cd('0x40')]=_0x27a64c;return _0x2a99e6;})[_0xa8cd('0x23')](respondWithFilteredResult(_0x2241f8,_0x3285d8))['catch'](handleError(_0x2241f8,null));};exports['show']=function(_0x5067d3,_0x5e8a6c){var _0x1b9f17={'raw':!![],'where':{'id':_0x5067d3['params']['id']}},_0x40c80d={};_0x40c80d[_0xa8cd('0x32')]=_[_0xa8cd('0x2f')](db[_0xa8cd('0x2a')][_0xa8cd('0x2b')]);_0x40c80d[_0xa8cd('0x2e')]=_[_0xa8cd('0x2f')](_0x5067d3['query']);_0x40c80d['filters']=_[_0xa8cd('0x31')](_0x40c80d[_0xa8cd('0x32')],_0x40c80d[_0xa8cd('0x2e')]);_0x1b9f17[_0xa8cd('0x34')]=_['intersection'](_0x40c80d[_0xa8cd('0x32')],qs[_0xa8cd('0x33')](_0x5067d3[_0xa8cd('0x2e')][_0xa8cd('0x33')]));_0x1b9f17['attributes']=_0x1b9f17['attributes']['length']?_0x1b9f17[_0xa8cd('0x34')]:_0x40c80d[_0xa8cd('0x32')];if(_0x5067d3['query'][_0xa8cd('0x3f')]){_0x1b9f17[_0xa8cd('0x41')]=[{'all':!![]}];}_0x1b9f17=_[_0xa8cd('0x3c')]({},_0x1b9f17,_0x5067d3[_0xa8cd('0x3e')]);return db[_0xa8cd('0x2a')][_0xa8cd('0x42')](_0x1b9f17)['then'](handleEntityNotFound(_0x5e8a6c,null))['then'](respondWithResult(_0x5e8a6c,null))['catch'](handleError(_0x5e8a6c,null));};exports[_0xa8cd('0x43')]=function(_0x2f3d01,_0x97f52a){return db[_0xa8cd('0x2a')][_0xa8cd('0x43')](_0x2f3d01[_0xa8cd('0x44')],{})[_0xa8cd('0x23')](respondWithResult(_0x97f52a,0xc9))[_0xa8cd('0x45')](handleError(_0x97f52a,null));};exports[_0xa8cd('0x46')]=function(_0x534f5a,_0x5429e8){if(_0x534f5a[_0xa8cd('0x44')]['id']){delete _0x534f5a['body']['id'];}return db[_0xa8cd('0x2a')][_0xa8cd('0x42')]({'where':{'id':_0x534f5a[_0xa8cd('0x47')]['id']}})[_0xa8cd('0x23')](handleEntityNotFound(_0x5429e8,null))[_0xa8cd('0x23')](saveUpdates(_0x534f5a['body'],null))[_0xa8cd('0x23')](respondWithResult(_0x5429e8,null))['catch'](handleError(_0x5429e8,null));};exports[_0xa8cd('0x22')]=function(_0x9dd1a3,_0x2114f2){return db[_0xa8cd('0x2a')][_0xa8cd('0x42')]({'where':{'id':_0x9dd1a3[_0xa8cd('0x47')]['id']}})[_0xa8cd('0x23')](handleEntityNotFound(_0x2114f2,null))[_0xa8cd('0x23')](removeEntity(_0x2114f2,null))[_0xa8cd('0x45')](handleError(_0x2114f2,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index cb9f07c..4638393 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 _0x9b9b=['path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','util','moment','bluebird','request-promise'];(function(_0x33db24,_0x5b831c){var _0x167db0=function(_0x2ad49f){while(--_0x2ad49f){_0x33db24['push'](_0x33db24['shift']());}};_0x167db0(++_0x5b831c);}(_0x9b9b,0x114));var _0xb9b9=function(_0x377fb1,_0x5ee538){_0x377fb1=_0x377fb1-0x0;var _0x3248e9=_0x9b9b[_0x377fb1];return _0x3248e9;};'use strict';var _=require('lodash');var util=require(_0xb9b9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb9b9('0x1'));var BPromise=require(_0xb9b9('0x2'));var rp=require(_0xb9b9('0x3'));var fs=require('fs');var path=require(_0xb9b9('0x4'));var rimraf=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var attributes=require(_0xb9b9('0x7'));module[_0xb9b9('0x8')]=function(_0x79dd,_0x3d1a95){return _0x79dd[_0xb9b9('0x9')](_0xb9b9('0xa'),attributes,{'tableName':_0xb9b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb9b9('0xc'),'collate':_0xb9b9('0xd')});}; \ No newline at end of file +var _0x7f42=['bluebird','path','../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x120123,_0x4eff59){var _0x3bec4c=function(_0x182818){while(--_0x182818){_0x120123['push'](_0x120123['shift']());}};_0x3bec4c(++_0x4eff59);}(_0x7f42,0x1dd));var _0x27f4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7f42[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x27f4('0x0'));var util=require('util');var logger=require(_0x27f4('0x1'))(_0x27f4('0x2'));var moment=require('moment');var BPromise=require(_0x27f4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x27f4('0x4'));var rimraf=require('rimraf');var config=require(_0x27f4('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0x27f4('0x6')]=function(_0x5c9286,_0x256ac9){return _0x5c9286[_0x27f4('0x7')](_0x27f4('0x8'),attributes,{'tableName':_0x27f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x27f4('0xa'),'collate':_0x27f4('0xb')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f4f200c..f66df50 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 _0x9bde=['code','message','WhatsappApplication,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x810564,_0x4f6186){var _0x33ef0e=function(_0x1305e4){while(--_0x1305e4){_0x810564['push'](_0x810564['shift']());}};_0x33ef0e(++_0x4f6186);}(_0x9bde,0xe1));var _0xe9bd=function(_0x7f0c9f,_0x2faf42){_0x7f0c9f=_0x7f0c9f-0x0;var _0x182d10=_0x9bde[_0x7f0c9f];return _0x182d10;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file +var _0x22fb=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d14c5,_0x11e7d3){var _0x4ae7fc=function(_0x484ece){while(--_0x484ece){_0x1d14c5['push'](_0x1d14c5['shift']());}};_0x4ae7fc(++_0x11e7d3);}(_0x22fb,0x192));var _0xb22f=function(_0x2fa144,_0x1c06aa){_0x2fa144=_0x2fa144-0x0;var _0x264d3d=_0x22fb[_0x2fa144];return _0x264d3d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb22f('0x0'));var BPromise=require('bluebird');var rs=require(_0xb22f('0x1'));var fs=require('fs');var Redis=require(_0xb22f('0x2'));var db=require(_0xb22f('0x3'))['db'];var utils=require(_0xb22f('0x4'));var logger=require(_0xb22f('0x5'))('rpc');var config=require(_0xb22f('0x6'));var jayson=require(_0xb22f('0x7'));var client=jayson[_0xb22f('0x8')][_0xb22f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x412a95,_0x367d4b,_0x47f61a){return new BPromise(function(_0x34433b,_0x22c509){return client[_0xb22f('0xa')](_0x412a95,_0x47f61a)[_0xb22f('0xb')](function(_0x1a3aae){logger[_0xb22f('0xc')](_0xb22f('0xd'),_0x367d4b,_0xb22f('0xe'));logger[_0xb22f('0xf')](_0xb22f('0x10'),_0x367d4b,_0xb22f('0xe'),JSON['stringify'](_0x1a3aae));if(_0x1a3aae['error']){if(_0x1a3aae['error'][_0xb22f('0x11')]===0x1f4){logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x367d4b,_0x1a3aae['error'][_0xb22f('0x12')]);return _0x22c509(_0x1a3aae[_0xb22f('0x13')][_0xb22f('0x12')]);}logger[_0xb22f('0x13')](_0xb22f('0xd'),_0x367d4b,_0x1a3aae[_0xb22f('0x13')]['message']);return _0x34433b(_0x1a3aae[_0xb22f('0x13')]['message']);}else{logger[_0xb22f('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x367d4b,_0xb22f('0xe'));_0x34433b(_0x1a3aae[_0xb22f('0x14')][_0xb22f('0x12')]);}})[_0xb22f('0x15')](function(_0x447eaf){logger['error'](_0xb22f('0xd'),_0x367d4b,_0x447eaf);_0x22c509(_0x447eaf);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 9ab8284..0451d92 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 _0xda19=['/:id/tags','removeTags','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','whatsappinteraction:addtags','put','/:id','tracked','whatsapp','update','delete'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xda19,0xd5));var _0x9da1=function(_0x12b499,_0x5a96bb){_0x12b499=_0x12b499-0x0;var _0x54eb0d=_0xda19[_0x12b499];return _0x54eb0d;};'use strict';var multer=require('multer');var util=require(_0x9da1('0x0'));var path=require(_0x9da1('0x1'));var timeout=require('connect-timeout');var express=require(_0x9da1('0x2'));var router=express['Router']();var fs_extra=require(_0x9da1('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var controller=require(_0x9da1('0x6'));router[_0x9da1('0x7')]('/',auth[_0x9da1('0x8')](),controller[_0x9da1('0x9')]);router[_0x9da1('0x7')](_0x9da1('0xa'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x9da1('0xc')]);router['get'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0xe')]);router[_0x9da1('0x7')](_0x9da1('0xf'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9da1('0x11')]);router['post'](_0x9da1('0xd'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x12')]);router[_0x9da1('0x13')]('/:id/tags',auth[_0x9da1('0x8')](),interaction['tracked']('whatsapp',_0x9da1('0x14')),controller['addTags']);router[_0x9da1('0x15')](_0x9da1('0x16'),auth[_0x9da1('0x8')](),interaction[_0x9da1('0x17')](_0x9da1('0x18'),'whatsappinteraction:update'),controller[_0x9da1('0x19')]);router[_0x9da1('0x1a')](_0x9da1('0x16'),auth[_0x9da1('0x8')](),interaction[_0x9da1('0x17')](_0x9da1('0x18'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x9da1('0x1a')](_0x9da1('0x1b'),auth[_0x9da1('0x8')](),controller[_0x9da1('0x1c')]);module[_0x9da1('0x1d')]=router; \ No newline at end of file +var _0x7217=['/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5c81dd,_0x23ef75){var _0x1e8927=function(_0x5c99cd){while(--_0x5c99cd){_0x5c81dd['push'](_0x5c81dd['shift']());}};_0x1e8927(++_0x23ef75);}(_0x7217,0x19e));var _0x7721=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x7217[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x13')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0x14')]);router['post'](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addMessage']);router[_0x7721('0x13')](_0x7721('0x15'),auth[_0x7721('0x9')](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x17')),controller[_0x7721('0x18')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x7721('0x16')](_0x7721('0x19'),_0x7721('0x1a')),controller[_0x7721('0x1b')]);router['delete'](_0x7721('0xd'),auth['isAuthenticated'](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x1c')),controller[_0x7721('0x1d')]);router[_0x7721('0x1e')](_0x7721('0x15'),auth[_0x7721('0x9')](),controller[_0x7721('0x1f')]);module[_0x7721('0x20')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index e5777bd..10d2a39 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 _0x7163=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x7163,0x1ef));var _0x3716=function(_0x1e9424,_0x191cba){_0x1e9424=_0x1e9424-0x0;var _0x1bd96c=_0x7163[_0x1e9424];return _0x1bd96c;};'use strict';var Sequelize=require(_0x3716('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x3716('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3716('0x2')]},'disposition':{'type':Sequelize[_0x3716('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3716('0x3')]},'note':{'type':Sequelize[_0x3716('0x3')]},'phone':{'type':Sequelize[_0x3716('0x3')]},'read1stAt':{'type':Sequelize[_0x3716('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3716('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3716('0x4')]('in',_0x3716('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x3716('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0x8ff3=['out','ENUM','sequelize','moment','BOOLEAN','DATE','STRING'];(function(_0x1ab13e,_0x44507a){var _0xa28f8=function(_0x231213){while(--_0x231213){_0x1ab13e['push'](_0x1ab13e['shift']());}};_0xa28f8(++_0x44507a);}(_0x8ff3,0x72));var _0x38ff=function(_0x5b88f1,_0x9555f0){_0x5b88f1=_0x5b88f1-0x0;var _0x41f6c2=_0x8ff3[_0x5b88f1];return _0x41f6c2;};'use strict';var Sequelize=require(_0x38ff('0x0'));var moment=require(_0x38ff('0x1'));module['exports']={'closed':{'type':Sequelize[_0x38ff('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x38ff('0x3')]},'disposition':{'type':Sequelize[_0x38ff('0x4')]},'secondDisposition':{'type':Sequelize[_0x38ff('0x4')]},'thirdDisposition':{'type':Sequelize[_0x38ff('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x38ff('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x38ff('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x38ff('0x6')]('in',_0x38ff('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x38ff('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 4a9ede6..54714f3 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 _0x2783=['lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closedAt','disposition','basename','pipe','createWriteStream','out','System','renderFile','views','transcript-','.pdf','log','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','text','start','compact','isEmpty','WhatsappAccountId','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','role','sequelize','toString','WhatsappInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','all','rows','catch','show','params','include','merge','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','nolimit','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','setTags','omit','color','emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','User','CmContact','firstName'];(function(_0x7fb2a2,_0x8eb57c){var _0x5726da=function(_0x20c773){while(--_0x20c773){_0x7fb2a2['push'](_0x7fb2a2['shift']());}};_0x5726da(++_0x8eb57c);}(_0x2783,0x1f2));var _0x3278=function(_0x279d1a,_0x44f707){_0x279d1a=_0x279d1a-0x0;var _0xef4970=_0x2783[_0x279d1a];return _0xef4970;};'use strict';var emlformat=require(_0x3278('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3278('0x1'));var jsonpatch=require(_0x3278('0x2'));var rp=require(_0x3278('0x3'));var moment=require('moment');var BPromise=require(_0x3278('0x4'));var Mustache=require(_0x3278('0x5'));var util=require(_0x3278('0x6'));var path=require(_0x3278('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3278('0x8'));var fs=require('fs');var fs_extra=require(_0x3278('0x9'));var _=require(_0x3278('0xa'));var squel=require(_0x3278('0xb'));var crypto=require('crypto');var jsforce=require(_0x3278('0xc'));var deskjs=require(_0x3278('0xd'));var toCsv=require(_0x3278('0xe'));var querystring=require(_0x3278('0xf'));var Papa=require(_0x3278('0x10'));var Redis=require(_0x3278('0x11'));var authService=require(_0x3278('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3278('0x13'));var pdf=require(_0x3278('0x14'));var hardwareService=require(_0x3278('0x15'));var logger=require(_0x3278('0x16'))(_0x3278('0x17'));var utils=require(_0x3278('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3278('0x19'))['db'];config[_0x3278('0x1a')]=_[_0x3278('0x1b')](config[_0x3278('0x1a')],{'host':_0x3278('0x1c'),'port':0x18eb});var socket=require(_0x3278('0x1d'))(new Redis(config[_0x3278('0x1a')]));require('./whatsappInteraction.socket')[_0x3278('0x1e')](socket);function respondWithStatusCode(_0x49a9c2,_0x2d2848){_0x2d2848=_0x2d2848||0xcc;return function(_0x444764){if(_0x444764){return _0x49a9c2[_0x3278('0x1f')](_0x2d2848);}return _0x49a9c2[_0x3278('0x20')](_0x2d2848)[_0x3278('0x21')]();};}function respondWithResult(_0x4558be,_0x3af0b6){_0x3af0b6=_0x3af0b6||0xc8;return function(_0x28f164){if(_0x28f164){return _0x4558be[_0x3278('0x20')](_0x3af0b6)[_0x3278('0x22')](_0x28f164);}};}function respondWithFilteredResult(_0x1d86b7,_0x2801a8){return function(_0x3c0b57){if(_0x3c0b57){var _0x589530=typeof _0x2801a8['offset']==='undefined'&&typeof _0x2801a8[_0x3278('0x23')]==='undefined';var _0x42ae6d=_0x3c0b57[_0x3278('0x24')];var _0x50e63b=_0x589530?0x0:_0x2801a8[_0x3278('0x25')];var _0x1be74f=_0x589530?_0x3c0b57['count']:_0x2801a8['offset']+_0x2801a8[_0x3278('0x23')];var _0x3d8871;if(_0x1be74f>=_0x42ae6d){_0x1be74f=_0x42ae6d;_0x3d8871=0xc8;}else{_0x3d8871=0xce;}_0x1d86b7['status'](_0x3d8871);return _0x1d86b7[_0x3278('0x26')](_0x3278('0x27'),_0x50e63b+'-'+_0x1be74f+'/'+_0x42ae6d)[_0x3278('0x22')](_0x3c0b57);}return null;};}function patchUpdates(_0x31c831){return function(_0x5d7c10){try{jsonpatch['apply'](_0x5d7c10,_0x31c831,!![]);}catch(_0xb59317){return BPromise[_0x3278('0x28')](_0xb59317);}return _0x5d7c10[_0x3278('0x29')]();};}function saveUpdates(_0x124197,_0x5abf82){return function(_0x879149){if(_0x879149){return _0x879149[_0x3278('0x2a')](_0x124197)[_0x3278('0x2b')](function(_0x55b76a){return _0x55b76a;});}return null;};}function removeEntity(_0x3dc6b4,_0x5dff86){return function(_0x1f4cb3){if(_0x1f4cb3){return _0x1f4cb3[_0x3278('0x2c')]()[_0x3278('0x2b')](function(){_0x3dc6b4[_0x3278('0x20')](0xcc)[_0x3278('0x21')]();});}};}function handleEntityNotFound(_0x34c27b,_0x36a8b3){return function(_0x51099f){if(!_0x51099f){_0x34c27b[_0x3278('0x1f')](0x194);}return _0x51099f;};}function handleError(_0x4c604a,_0x512e55){_0x512e55=_0x512e55||0x1f4;return function(_0x36690a){logger['error'](_0x36690a[_0x3278('0x2d')]);if(_0x36690a[_0x3278('0x2e')]){delete _0x36690a['name'];}_0x4c604a['status'](_0x512e55)[_0x3278('0x2f')](_0x36690a);};}function getInteractionUsers(_0x4d8665,_0x395442){return new BPromise(function(_0x22f909,_0x33d9ac){try{if(_0x395442[_0x4d8665['id']]){_0x4d8665[_0x3278('0x30')]=_['map'](_0x395442[_0x4d8665['id']],function(_0x10eb51){return{'id':_0x10eb51['id'],'fullname':_0x10eb51[_0x3278('0x31')]};});}}catch(_0x90d703){_0x33d9ac(_0x90d703);}_0x22f909(_0x4d8665);});}function getInteractionTags(_0x296671,_0x4edc1e){return new BPromise(function(_0x2338b1,_0x16ccfb){try{if(_0x296671[_0x3278('0x32')]){_0x296671[_0x3278('0x33')]=[];_0x296671[_0x3278('0x32')][_0x3278('0x34')](',')[_0x3278('0x35')](function(_0x22a883){_0x296671[_0x3278('0x33')][_0x3278('0x36')](_0x4edc1e[_0x22a883]);});}delete _0x296671[_0x3278('0x32')];}catch(_0x507ecf){_0x16ccfb(_0x507ecf);}_0x2338b1(_0x296671);});}function updateWhatsappInteraction(_0x492613,_0x3e29b8,_0x19d30a){return new BPromise(function(_0x738c5,_0x4825e1){return getInteractionUsers(_0x492613,_0x19d30a)[_0x3278('0x2b')](function(_0x124e36){return getInteractionTags(_0x124e36,_0x3e29b8);})['then'](function(_0x18fad1){_0x738c5(_0x18fad1);})['catch'](function(_0x1f0ee0){_0x4825e1(_0x1f0ee0);});});}exports[_0x3278('0x37')]=function(_0x5e0906,_0x4d411e){var _0x31c84e={},_0x5d85a2={},_0x2761c0={'count':0x0,'rows':[]};var _0x2f2453=_[_0x3278('0x38')](db['WhatsappInteraction'][_0x3278('0x39')],function(_0x3ebef6){return{'name':_0x3ebef6[_0x3278('0x3a')],'type':_0x3ebef6[_0x3278('0x3b')][_0x3278('0x3c')]};});_0x5d85a2[_0x3278('0x3d')]=_['map'](_0x2f2453,_0x3278('0x2e'));_0x5d85a2[_0x3278('0x3e')]=_[_0x3278('0x3f')](_0x5e0906[_0x3278('0x3e')]);_0x5d85a2[_0x3278('0x40')]=_[_0x3278('0x41')](_0x5d85a2[_0x3278('0x3d')],_0x5d85a2[_0x3278('0x3e')]);_0x31c84e[_0x3278('0x42')]=_[_0x3278('0x41')](_0x5d85a2['model'],qs[_0x3278('0x43')](_0x5e0906[_0x3278('0x3e')]['fields']));_0x31c84e[_0x3278('0x42')]=_0x31c84e['attributes'][_0x3278('0x44')]?_0x31c84e[_0x3278('0x42')]:_0x5d85a2['model'];if(!_0x5e0906['query'][_0x3278('0x45')]('nolimit')){_0x31c84e[_0x3278('0x23')]=qs[_0x3278('0x23')](_0x5e0906[_0x3278('0x3e')][_0x3278('0x23')]);_0x31c84e[_0x3278('0x25')]=qs[_0x3278('0x25')](_0x5e0906['query'][_0x3278('0x25')]);}_0x31c84e['order']=qs[_0x3278('0x46')](_0x5e0906[_0x3278('0x3e')][_0x3278('0x46')]);_0x31c84e[_0x3278('0x47')]=qs['filters'](_[_0x3278('0x48')](_0x5e0906[_0x3278('0x3e')],_0x5d85a2[_0x3278('0x40')]),_0x2f2453);var _0x23e74d=[];var _0x4aa161=squel[_0x3278('0x49')]()['field']('id')['field'](_0x3278('0x2e'))[_0x3278('0x4a')]('color')[_0x3278('0x4b')](_0x3278('0x4c'));var _0x505d8e=squel['select']()[_0x3278('0x4a')](_0x3278('0x4d'))['field'](_0x3278('0x4e'))[_0x3278('0x4a')]('ui.WhatsappInteractionId')[_0x3278('0x4b')](_0x3278('0x4f'),'ui')[_0x3278('0x50')](_0x3278('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x24fa39=squel[_0x3278('0x49')]()[_0x3278('0x4b')](_0x3278('0x52'),'i')[_0x3278('0x50')](_0x3278('0x53'),'c',_0x3278('0x54'))[_0x3278('0x50')](_0x3278('0x51'),'o',_0x3278('0x55'))[_0x3278('0x50')]('whatsapp_accounts','a',_0x3278('0x56'))[_0x3278('0x50')](_0x3278('0x57'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0x3278('0x50')](_0x3278('0x58'),'it',_0x3278('0x59'))[_0x3278('0x50')](_0x3278('0x4c'),'t',_0x3278('0x5a'));var _0x4e8506=squel[_0x3278('0x5b')]();var _0x453932=[];var _0x218b0c=squel[_0x3278('0x5b')]();var _0x3272b7;if(_0x5e0906['query'][_0x3278('0x5c')]){_0x3272b7=as[_0x3278('0x5d')](_0x5e0906[_0x3278('0x3e')]['search']);var _0x703c28=_0x3272b7[_0x3278('0x5e')];for(var _0x52c7da=0x0;_0x52c7da<_0x3272b7['conditions'][_0x3278('0x44')];_0x52c7da++){var _0x2b3012=_0x3272b7[_0x3278('0x5f')][_0x52c7da];var _0x3c9cc8='i';var _0x12be46=_[_0x3278('0x60')](_0x2f2453,[_0x3278('0x2e'),_0x2b3012[_0x3278('0x4a')]]);if(!_0x12be46){switch(_0x2b3012[_0x3278('0x4a')]){case _0x3278('0x61'):if(_0x2b3012[_0x3278('0x62')]==0x1){_0x24fa39[_0x3278('0x63')]('`'+_0x2b3012[_0x3278('0x4a')]+'`\x20=\x200');}else{_0x24fa39['having']('`'+_0x2b3012[_0x3278('0x4a')]+'`\x20>\x200');}break;case _0x3278('0x64'):if(_0x2b3012[_0x3278('0x65')]==='$substring'){if(_0x2b3012[_0x3278('0x62')]['split']('\x20')[_0x3278('0x44')]>0x1){_0x4e8506[_0x703c28](_0x3278('0x66'),qs[_0x3278('0x67')](_0x2b3012[_0x3278('0x62')]),null);}else{var _0x8653e6='%'+_0x2b3012[_0x3278('0x62')]+'%';_0x4e8506[_0x703c28](_0x3278('0x68'),_0x8653e6,_0x8653e6,_0x8653e6);}}else{_0x12be46=_[_0x3278('0x60')](_0x2f2453,['name',_0x3278('0x69')]);_0x2b3012[_0x3278('0x4a')]=_0x3278('0x69');_0x472da6=as[_0x3278('0x6a')](_0x3c9cc8,_0x12be46['type'],_0x2b3012);_0x4e8506[_0x703c28](_0x472da6['text'],_0x472da6['value']['start'],_0x472da6['value'][_0x3278('0x21')]);}break;case _0x3278('0x6b'):var _0x55400f=_0x2b3012[_0x3278('0x62')]['split'](',')[_0x3278('0x38')](function(_0x51f8c1){return Number(_0x51f8c1);});_0x55400f[_0x3278('0x35')](function(_0x2a3da8){_0x218b0c['or'](_0x3278('0x6c'),'%,'+_0x2a3da8+',%');});_0x453932=_['union'](_0x453932,_0x55400f);break;case'User':if(_0x2b3012['operator']==='$substring'){_0x4e8506[_0x703c28](_0x3278('0x6d'),'%'+_0x2b3012[_0x3278('0x62')]+'%',null);}else{_0x12be46=_['find'](_0x2f2453,[_0x3278('0x2e'),_0x3278('0x6e')]);_0x2b3012[_0x3278('0x4a')]='UserId';_0x472da6=as['buildExpression'](_0x3c9cc8,_0x12be46[_0x3278('0x3b')],_0x2b3012);_0x4e8506[_0x703c28](_0x472da6['text'],_0x472da6[_0x3278('0x62')]['start'],_0x472da6[_0x3278('0x62')]['end']);}break;case _0x3278('0x6f'):_0x472da6=as['buildExpression']('me',null,_0x2b3012);_0x4e8506[_0x703c28](_0x472da6[_0x3278('0x70')],_0x472da6['value'][_0x3278('0x71')],_0x472da6[_0x3278('0x62')][_0x3278('0x21')]);break;}}else{var _0x472da6=as[_0x3278('0x6a')](_0x3c9cc8,_0x12be46[_0x3278('0x3b')],_0x2b3012);_0x4e8506[_0x703c28](_0x472da6[_0x3278('0x70')],_0x472da6[_0x3278('0x62')][_0x3278('0x71')],_0x472da6['value'][_0x3278('0x21')]);}}}else{var _0x53353a=_(_0x5e0906[_0x3278('0x3e')])[_0x3278('0x3f')]()[_0x3278('0x38')](function(_0x9c249b){return _['some'](_0x2f2453,[_0x3278('0x2e'),_0x9c249b])?_0x9c249b:undefined;})[_0x3278('0x72')]()[_0x3278('0x62')]();if(!_[_0x3278('0x73')](_0x53353a)){_0x53353a[_0x3278('0x35')](function(_0x5e3564){if(_0x5e3564===_0x3278('0x74')){_0x24fa39['where']('i.WhatsappAccountId\x20IN\x20?',[]['concat'](_0x5e0906[_0x3278('0x3e')][_0x5e3564]));}else if(_0x5e3564===_0x3278('0x75')){var _0x3d98d7=JSON['parse'](_0x5e0906[_0x3278('0x3e')][_0x5e3564])['$gte'];var _0x493e78=JSON[_0x3278('0x76')](_0x5e0906[_0x3278('0x3e')][_0x5e3564])[_0x3278('0x77')];_0x24fa39[_0x3278('0x47')](_0x3278('0x78'),_0x3d98d7,_0x493e78);}else{if(_0x5e0906[_0x3278('0x3e')][_0x5e3564]===_0x3278('0x79')){_0x24fa39[_0x3278('0x47')]('i.'+_0x5e3564+_0x3278('0x7a'));}else{_0x24fa39[_0x3278('0x47')]('i.'+_0x5e3564+_0x3278('0x7b'),_0x5e0906[_0x3278('0x3e')][_0x5e3564]);}}});}if(_0x5e0906[_0x3278('0x3e')][_0x3278('0x7c')]){if(_0x5e0906['query'][_0x3278('0x7c')]==0x1){_0x24fa39[_0x3278('0x63')](_0x3278('0x7d'));}else{_0x24fa39[_0x3278('0x63')](_0x3278('0x7e'));}}if(_0x5e0906['query']['tag']){_0x453932=_[_0x3278('0x7f')](_0x5e0906[_0x3278('0x3e')][_0x3278('0x80')])?_0x5e0906[_0x3278('0x3e')][_0x3278('0x80')]:new Array(_0x5e0906[_0x3278('0x3e')]['tag']);_0x453932[_0x3278('0x35')](function(_0x4023d2){_0x218b0c['or'](_0x3278('0x6c'),'%,'+_0x4023d2+',%');});}if(_0x5e0906[_0x3278('0x3e')][_0x3278('0x81')]){var _0x1e98d1=_0x5e0906[_0x3278('0x3e')][_0x3278('0x81')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1e98d1)){_0x4e8506['or'](_0x3278('0x82'),_0x1e98d1+'%')['or']('i.phone\x20LIKE\x20?',_0x1e98d1+'%');}else{_0x4e8506['or'](_0x3278('0x83'),qs['getFullTextValue'](_0x1e98d1))['or'](_0x3278('0x84'),_0x1e98d1+'%');}}}_0x24fa39[_0x3278('0x47')](_0x4e8506);_0x24fa39[_0x3278('0x85')](_0x3278('0x86'));var _0x5aafdb={'type':db[_0x3278('0x87')][_0x3278('0x88')][_0x3278('0x89')],'raw':!![]};var _0x3fcbce=_0x24fa39[_0x3278('0x8a')]();_0x3fcbce['field'](_0x3278('0x86'));_0x3fcbce[_0x3278('0x4a')](_0x3278('0x8b'),'unreadMessages');if(_0x31c84e['order']){_0x31c84e[_0x3278('0x8c')][_0x3278('0x35')](function(_0x49dc1f){var _0x386cf1=_0x49dc1f[0x0]===_0x3278('0x8d')?_0x49dc1f[0x0]:'i.'+_0x49dc1f[0x0];_0x24fa39[_0x3278('0x8c')](_0x386cf1,_0x49dc1f[0x1]===_0x3278('0x8e')?![]:!![]);});}if(!_[_0x3278('0x73')](_0x453932)){_0x24fa39[_0x3278('0x63')](_0x218b0c);_0x3fcbce['where'](_0x3278('0x8f'),_0x453932);}BPromise[_0x3278('0x90')]()['then'](function(){if(!_0x3272b7){if(_0x5e0906[_0x3278('0x3e')][_0x3278('0x74')])return;_0x3fcbce[_0x3278('0x47')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x24fa39['where'](_0x3278('0x91'));return;}if(_0x5e0906[_0x3278('0x92')]['role']!==_0x3278('0x93'))return;return _0x5e0906['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x3278('0x2b')](function(_0xfc486c){if(_[_0x3278('0x73')](_0xfc486c)){_0x3fcbce[_0x3278('0x47')]('i.WhatsappAccountId\x20IS\x20NULL');_0x24fa39[_0x3278('0x47')](_0x3278('0x94'));}else{_0x3fcbce[_0x3278('0x47')](_0x3278('0x95'),_['map'](_0xfc486c,'id'));_0x24fa39[_0x3278('0x47')](_0x3278('0x95'),_[_0x3278('0x38')](_0xfc486c,'id'));}});})[_0x3278('0x2b')](function(){if(_0x5e0906[_0x3278('0x92')][_0x3278('0x96')]===_0x3278('0x93')&&!_0x3272b7&&!_0x5e0906[_0x3278('0x3e')][_0x3278('0x74')])return[];return db[_0x3278('0x97')][_0x3278('0x3e')](_0x3fcbce[_0x3278('0x98')](),_0x5aafdb);})['then'](function(_0x5db21f){_0x2761c0[_0x3278('0x24')]=_0x5db21f[_0x3278('0x44')];if(_0x2761c0[_0x3278('0x24')]===0x0)return[];return db[_0x3278('0x97')][_0x3278('0x3e')](_0x4aa161[_0x3278('0x98')](),_0x5aafdb)[_0x3278('0x2b')](function(_0x44ac88){_0x23e74d=_['keyBy'](_0x44ac88,'id');_0x5aafdb=_['merge'](_0x5aafdb,{'model':db[_0x3278('0x99')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5e0906['query'][_0x3278('0x43')]){_0x31c84e['attributes'][_0x3278('0x35')](function(_0x497f19){_0x24fa39['field']('i.'+_0x497f19);});}else{_0x24fa39['field'](_0x3278('0x8b'),_0x3278('0x61'));_0x24fa39[_0x3278('0x4a')](_0x3278('0x9a'),_0x3278('0x9b'));_0x24fa39[_0x3278('0x4a')](_0x3278('0x9c'),_0x3278('0x9d'));_0x24fa39[_0x3278('0x4a')](_0x3278('0x9e'),_0x3278('0x8d'));_0x24fa39[_0x3278('0x4a')](_0x3278('0x9f'));_0x24fa39[_0x3278('0x4a')](_0x3278('0xa0'),_0x3278('0xa1'));_0x24fa39[_0x3278('0x4a')](_0x3278('0xa2'),'Contact.lastName');_0x24fa39['field']('c.email',_0x3278('0xa3'));_0x24fa39['field'](_0x3278('0xa4'),_0x3278('0xa5'));_0x24fa39[_0x3278('0x4a')](_0x3278('0xa6'),_0x3278('0xa7'));_0x24fa39[_0x3278('0x4a')](_0x3278('0xa8'),_0x3278('0xa9'));_0x24fa39[_0x3278('0x4a')](_0x3278('0xaa'),'Owner.fullname');_0x24fa39[_0x3278('0x4a')](_0x3278('0xab'),_0x3278('0xac'));_0x24fa39[_0x3278('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x31c84e[_0x3278('0x23')])_0x24fa39[_0x3278('0x23')](_0x31c84e[_0x3278('0x23')]);if(_0x31c84e[_0x3278('0x25')])_0x24fa39[_0x3278('0x25')](_0x31c84e[_0x3278('0x25')]);return db[_0x3278('0x97')][_0x3278('0x3e')](_0x24fa39[_0x3278('0x98')](),_0x5aafdb);})['then'](function(_0x4bd05e){if(_0x4bd05e[_0x3278('0x44')]>0x0)_0x505d8e['where'](_0x3278('0xad'),_[_0x3278('0x38')](_0x4bd05e,'id'));return db[_0x3278('0x97')][_0x3278('0x3e')](_0x505d8e['toString'](),_0x5aafdb)[_0x3278('0x2b')](function(_0x2603c8){var _0x5675d5=_['groupBy'](_0x2603c8,'WhatsappInteractionId');var _0x54cfa8=[];_0x4bd05e[_0x3278('0x35')](function(_0x5dc281){_0x54cfa8[_0x3278('0x36')](updateWhatsappInteraction(_0x5dc281,_0x23e74d,_0x5675d5));});return BPromise[_0x3278('0xae')](_0x54cfa8);});});})[_0x3278('0x2b')](function(_0x148a28){_0x2761c0[_0x3278('0xaf')]=_0x148a28;return _0x2761c0;})[_0x3278('0x2b')](respondWithFilteredResult(_0x4d411e,_0x31c84e))[_0x3278('0xb0')](handleError(_0x4d411e,null));};exports[_0x3278('0xb1')]=function(_0x22f0cf,_0xb38878){var _0x3657b7={'raw':![],'where':{'id':_0x22f0cf[_0x3278('0xb2')]['id']}},_0x5c33de={};_0x5c33de[_0x3278('0x3d')]=_[_0x3278('0x3f')](db['WhatsappInteraction']['rawAttributes']);_0x5c33de[_0x3278('0x3e')]=_['keys'](_0x22f0cf[_0x3278('0x3e')]);_0x5c33de[_0x3278('0x40')]=_[_0x3278('0x41')](_0x5c33de[_0x3278('0x3d')],_0x5c33de[_0x3278('0x3e')]);_0x3657b7[_0x3278('0x42')]=_[_0x3278('0x41')](_0x5c33de['model'],qs['fields'](_0x22f0cf['query'][_0x3278('0x43')]));_0x3657b7['attributes']=_0x3657b7[_0x3278('0x42')]['length']?_0x3657b7['attributes']:_0x5c33de[_0x3278('0x3d')];if(_0x22f0cf['query']['includeAll']){_0x3657b7[_0x3278('0xb3')]=[{'all':!![]}];}_0x3657b7=_[_0x3278('0xb4')]({},_0x3657b7,_0x22f0cf['options']);return db[_0x3278('0x99')]['find'](_0x3657b7)[_0x3278('0x2b')](handleEntityNotFound(_0xb38878,null))[_0x3278('0x2b')](respondWithResult(_0xb38878,null))[_0x3278('0xb0')](handleError(_0xb38878,null));};exports[_0x3278('0xb5')]=function(_0x3c0e18,_0x54a8ee){return db[_0x3278('0x99')][_0x3278('0xb5')](_0x3c0e18[_0x3278('0x6f')],{})[_0x3278('0x2b')](respondWithResult(_0x54a8ee,0xc9))[_0x3278('0xb0')](handleError(_0x54a8ee,null));};exports[_0x3278('0x2a')]=function(_0x2477e7,_0x19837b){if(_0x2477e7['body']['id']){delete _0x2477e7[_0x3278('0x6f')]['id'];}return db['WhatsappInteraction'][_0x3278('0x60')]({'where':{'id':_0x2477e7['params']['id']}})[_0x3278('0x2b')](handleEntityNotFound(_0x19837b,null))[_0x3278('0x2b')](saveUpdates(_0x2477e7[_0x3278('0x6f')],null))[_0x3278('0x2b')](respondWithResult(_0x19837b,null))[_0x3278('0xb0')](handleError(_0x19837b,null));};exports[_0x3278('0x2c')]=function(_0x32e446,_0x2fed2b){return db[_0x3278('0x99')][_0x3278('0x60')]({'where':{'id':_0x32e446['params']['id']}})[_0x3278('0x2b')](handleEntityNotFound(_0x2fed2b,null))[_0x3278('0x2b')](removeEntity(_0x2fed2b,null))['catch'](handleError(_0x2fed2b,null));};exports['describe']=function(_0x4fab99,_0x5f5891){return db['WhatsappInteraction'][_0x3278('0xb6')]()[_0x3278('0x2b')](respondWithResult(_0x5f5891,null))[_0x3278('0xb0')](handleError(_0x5f5891,null));};exports[_0x3278('0xb7')]=function(_0x225855,_0x3c5f38,_0xe1722f){return db[_0x3278('0xb8')][_0x3278('0x60')]({'where':{'id':_0x225855[_0x3278('0xb2')]['id']}})[_0x3278('0x2b')](handleEntityNotFound(_0x3c5f38,null))[_0x3278('0x2b')](function(_0x2d9a94){if(_0x2d9a94){return _0x2d9a94[_0x3278('0xb7')](_0x225855['body'][_0x3278('0xb9')],_['omit'](_0x225855['body'],[_0x3278('0xb9'),'id'])||{});}})[_0x3278('0x2b')](respondWithResult(_0x3c5f38,null))[_0x3278('0xb0')](handleError(_0x3c5f38,null));};exports[_0x3278('0xba')]=function(_0x30925c,_0x2f303f,_0xcc8876){var _0x508a24={'raw':![],'where':{}};var _0x3af02b={};var _0x314115={'count':0x0,'rows':[]};return db[_0x3278('0x99')][_0x3278('0xbb')]({'where':{'id':_0x30925c['params']['id']}})['then'](handleEntityNotFound(_0x2f303f,null))['then'](function(_0x482328){if(_0x482328){_0x3af02b[_0x3278('0x3d')]=_[_0x3278('0x3f')](db[_0x3278('0xb8')]['rawAttributes']);_0x3af02b[_0x3278('0x3e')]=_[_0x3278('0x3f')](_0x30925c[_0x3278('0x3e')]);_0x3af02b[_0x3278('0x40')]=_['intersection'](_0x3af02b[_0x3278('0x3d')],_0x3af02b[_0x3278('0x3e')]);_0x508a24[_0x3278('0x42')]=_[_0x3278('0x41')](_0x3af02b['model'],qs[_0x3278('0x43')](_0x30925c[_0x3278('0x3e')][_0x3278('0x43')]));_0x508a24[_0x3278('0x42')]=_0x508a24['attributes'][_0x3278('0x44')]?_0x508a24['attributes']:_0x3af02b['model'];if(!_0x30925c[_0x3278('0x3e')][_0x3278('0x45')](_0x3278('0xbc'))){_0x508a24['limit']=qs[_0x3278('0x23')](_0x30925c[_0x3278('0x3e')][_0x3278('0x23')]);_0x508a24['offset']=qs[_0x3278('0x25')](_0x30925c[_0x3278('0x3e')]['offset']);}_0x508a24['order']=qs[_0x3278('0x46')](_0x30925c[_0x3278('0x3e')][_0x3278('0x46')]);_0x508a24['where']=qs['filters'](_[_0x3278('0x48')](_0x30925c[_0x3278('0x3e')],_0x3af02b['filters']));_0x508a24[_0x3278('0x47')][_0x3278('0xbd')]=_0x482328['id'];if(_0x30925c[_0x3278('0x3e')]['filter']){_0x508a24['where']=_[_0x3278('0xb4')](_0x508a24['where'],{'$or':_[_0x3278('0x38')](_0x508a24[_0x3278('0x42')],function(_0x8155c7){var _0x36d6d1={};_0x36d6d1[_0x8155c7]={'$like':'%'+_0x30925c[_0x3278('0x3e')][_0x3278('0x81')]+'%'};return _0x36d6d1;})});}if(_0x30925c['query']['$gte']){var _0x334a10=_0x30925c[_0x3278('0x3e')][_0x3278('0xbe')][_0x3278('0x34')](',');var _0x2c91db={};_0x2c91db[_0x334a10[0x0]]={'$gte':moment(_0x334a10[0x1])[_0x3278('0xbf')](_0x3278('0xc0'))};_0x508a24[_0x3278('0x47')]=_['merge'](_0x508a24[_0x3278('0x47')],_0x2c91db);}_0x508a24=_[_0x3278('0xb4')]({},_0x508a24,_0x30925c[_0x3278('0xc1')]);return db['WhatsappMessage']['count']({'where':_0x508a24[_0x3278('0x47')]})[_0x3278('0x2b')](function(_0x45390c){_0x314115[_0x3278('0x24')]=_0x45390c;if(_0x30925c['query'][_0x3278('0xc2')]){_0x508a24[_0x3278('0xb3')]=[{'all':!![]}];}return db[_0x3278('0xb8')][_0x3278('0xc3')](_0x508a24);})[_0x3278('0x2b')](function(_0xb8d900){_0x314115[_0x3278('0xaf')]=_0xb8d900;return _0x314115;});}})[_0x3278('0x2b')](respondWithFilteredResult(_0x2f303f,_0x508a24))[_0x3278('0xb0')](handleError(_0x2f303f,null));};exports['addTags']=function(_0x3634ae,_0xaa5186,_0x265a80){return db['WhatsappInteraction'][_0x3278('0x60')]({'where':{'id':_0x3634ae[_0x3278('0xb2')]['id']}})[_0x3278('0x2b')](handleEntityNotFound(_0xaa5186,null))['then'](function(_0x268782){if(_0x268782){return _0x268782[_0x3278('0xc4')](_0x3634ae[_0x3278('0x6f')][_0x3278('0xb9')],_[_0x3278('0xc5')](_0x3634ae[_0x3278('0x6f')],['ids','id'])||{})['spread'](function(){return db[_0x3278('0x6b')][_0x3278('0xc3')]({'attributes':['id','name',_0x3278('0xc6')],'where':{'id':_0x3634ae[_0x3278('0x6f')][_0x3278('0xb9')]}});})[_0x3278('0x2b')](function(_0x4cbd6c){socket[_0x3278('0xc7')]('whatsappInteractionTags:save',{'id':Number(_0x3634ae[_0x3278('0xb2')]['id']),'tags':_0x4cbd6c||[]});return{'id':Number(_0x3634ae[_0x3278('0xb2')]['id']),'tags':_0x4cbd6c||[]};});}})[_0x3278('0x2b')](respondWithResult(_0xaa5186,null))[_0x3278('0xb0')](handleError(_0xaa5186,null));};exports[_0x3278('0xc8')]=function(_0x5df506,_0x148084,_0x409140){return db['WhatsappInteraction'][_0x3278('0x60')]({'where':{'id':_0x5df506[_0x3278('0xb2')]['id']}})[_0x3278('0x2b')](handleEntityNotFound(_0x148084,null))[_0x3278('0x2b')](function(_0x49d166){if(_0x49d166){return _0x49d166[_0x3278('0xc8')](_0x5df506['query'][_0x3278('0xb9')]);}})[_0x3278('0x2b')](respondWithStatusCode(_0x148084,null))[_0x3278('0xb0')](handleError(_0x148084,null));};exports[_0x3278('0xc9')]=function(_0x134d8b,_0x18825f){var _0x486f73=moment()[_0x3278('0xca')]()[_0x3278('0x98')]();var _0x2c6e27=path[_0x3278('0xcb')](config[_0x3278('0xcc')],_0x3278('0xcd'),_0x3278('0xce'),_0x3278('0xcf'));var _0x28cb80=path[_0x3278('0xcb')](config[_0x3278('0xcc')],'server',_0x3278('0xce'),_0x3278('0xd0'));var _0x2776e2=path[_0x3278('0xcb')](_0x2c6e27,_0x486f73);var _0x5b9c18=util[_0x3278('0xbf')](_0x3278('0xd1'),_0x134d8b['params']['id'],_0x486f73);var _0x3f5c8c=path['join'](_0x2c6e27,_0x5b9c18);var _0x19a993=[];_0x19a993[_0x3278('0x36')]({'model':db[_0x3278('0xd2')],'as':_0x3278('0xd2'),'attributes':['id',_0x3278('0x31')],'raw':!![]});_0x19a993['push']({'model':db[_0x3278('0xd3')],'as':_0x3278('0x64'),'attributes':['id',_0x3278('0xd4'),_0x3278('0xd5')],'raw':!![]});if(_0x134d8b[_0x3278('0x3e')][_0x3278('0xd0')]){_0x19a993[_0x3278('0x36')]({'model':db[_0x3278('0xd6')],'as':'Attachment','raw':!![]});}var _0x54b970=[{'model':db[_0x3278('0xb8')],'as':'Messages','attributes':['id',_0x3278('0x6f'),_0x3278('0x75'),_0x3278('0xd7'),_0x3278('0xd8'),_0x3278('0x7c')],'include':_0x19a993}];_0x54b970[_0x3278('0x36')]({'model':db[_0x3278('0xd9')],'as':_0x3278('0xda'),'attributes':['id',_0x3278('0x2e')]});_0x54b970[_0x3278('0x36')]({'model':db[_0x3278('0xd2')],'as':_0x3278('0xdb'),'attributes':['id','fullname']});return db[_0x3278('0x99')][_0x3278('0x60')]({'where':{'id':_0x134d8b['params']['id']},'include':_0x54b970})[_0x3278('0x2b')](handleEntityNotFound(_0x18825f,null))['then'](function(_0x10d8e5){if(_0x10d8e5){var _0x2c8291=_0x10d8e5[_0x3278('0xdc')]({'plain':!![]});fs[_0x3278('0xdd')](_0x2776e2);var _0x2c1eec={'channel':_0x3278('0xde'),'account':_0x2c8291[_0x3278('0xda')][_0x3278('0x2e')],'agent':_0x2c8291[_0x3278('0xdb')]?_0x2c8291[_0x3278('0xdb')][_0x3278('0x31')]:_0x3278('0xdf'),'createdAt':moment(_0x2c8291['createdAt'])[_0x3278('0xbf')](_0x3278('0xc0'))[_0x3278('0x98')](),'closedAt':_0x2c8291['closed']?moment(_0x2c8291[_0x3278('0xe0')])[_0x3278('0xbf')](_0x3278('0xc0'))['toString']():'','disposition':_0x2c8291[_0x3278('0xe1')],'messages':_(_0x2c8291['Messages'])[_0x3278('0x81')]({'secret':![]})[_0x3278('0x38')](function(_0x3132a2){if(_0x3132a2['Attachment']){var _0x209052=path[_0x3278('0xcb')](_0x28cb80,_0x3132a2[_0x3278('0xd6')][_0x3278('0xe2')]);if(fs['existsSync'](_0x209052)){fs['createReadStream'](_0x209052)[_0x3278('0xe3')](fs[_0x3278('0xe4')](path[_0x3278('0xcb')](_0x2776e2,_0x3132a2[_0x3278('0xd6')][_0x3278('0xe2')])));}}return{'date':moment(_0x3132a2[_0x3278('0x75')])[_0x3278('0xbf')](_0x3278('0xc0'))['toString'](),'sender':_0x3132a2[_0x3278('0xd7')]===_0x3278('0xe5')?_0x3132a2[_0x3278('0xd2')]?_0x3132a2[_0x3278('0xd2')][_0x3278('0x31')]:_0x3278('0xe6'):_0x3132a2[_0x3278('0x64')][_0x3278('0xd4')]+(_0x3132a2[_0x3278('0x64')][_0x3278('0xd5')]?'\x20'+_0x3132a2[_0x3278('0x64')][_0x3278('0xd5')]:''),'body':_0x3132a2['Attachment']?_0x3132a2[_0x3278('0xd6')][_0x3278('0xe2')]:_0x3132a2[_0x3278('0x6f')],'direction':_0x3132a2[_0x3278('0xd7')]===_0x3278('0xe5')?'A':'C','secret':_0x3132a2[_0x3278('0xd8')],'read':_0x3132a2[_0x3278('0x7c')],'attachment':_0x3132a2['Attachment']};})[_0x3278('0x62')]()};return ejs[_0x3278('0xe7')](path['join'](config['root'],_0x3278('0xcd'),_0x3278('0xe8'),'downloadInteraction.ejs'),{'interaction':_0x2c1eec})[_0x3278('0x2b')](function(_0x44243d){var _0x13f072=path[_0x3278('0xcb')](_0x2776e2,_0x3278('0xe9')+_0x2c8291['id']+'-'+_0x486f73+_0x3278('0xea'));var _0xe69223={'path':_0x13f072,'channel':_0x3278('0xde'),'interactionId':_0x2c8291['id']};return pdf['createPdfFromHTML'](_0x44243d,_0xe69223);})[_0x3278('0x2b')](function(){return new BPromise(function(_0x3df82a,_0x1d526e){zipdir(_0x2776e2,{'saveTo':_0x3f5c8c},function(_0x3678d1,_0x30e385){if(_0x3678d1)return _0x1d526e(_0x3678d1);return _0x3df82a(_0x30e385);});})[_0x3278('0x2b')](function(){return new BPromise(function(_0x54f7f7,_0x544a4f){rimraf(_0x2776e2,function(_0x474725){if(_0x474725)_0x544a4f(_0x474725);return _0x54f7f7();});});})[_0x3278('0x2b')](function(){return _0x18825f[_0x3278('0xc9')](_0x3f5c8c,_0x5b9c18,function(_0x33e0f1){if(_0x33e0f1){console[_0x3278('0xeb')](_0x3278('0xec'),_0x33e0f1);}else{fs['unlinkSync'](_0x3f5c8c);}});});});}else{return _0x18825f[_0x3278('0x1f')](0xc8);}})[_0x3278('0xb0')](handleError(_0x18825f,null));}; \ No newline at end of file +var _0x7868=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','save','update','then','end','name','send','Users','map','Tags','TagIds','push','index','WhatsappInteraction','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.WhatsappInteractionId','left_join','u.id\x20=\x20ui.UserId','whatsapp_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','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?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.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','i.*','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.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','catch','show','includeAll','include','options','create','params','describe','WhatsappMessage','addMessage','ids','omit','findOne','findAll','addTags','setTags','spread','removeTags','unix','server','tmp','join','files','attachments','format','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','out','System','renderFile','root','transcript-','createPdfFromHTML','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x1a4a74,_0x184ddc){var _0x239aba=function(_0x3f2da2){while(--_0x3f2da2){_0x1a4a74['push'](_0x1a4a74['shift']());}};_0x239aba(++_0x184ddc);}(_0x7868,0x1c0));var _0x8786=function(_0x47feff,_0x413f25){_0x47feff=_0x47feff-0x0;var _0x406ee4=_0x7868[_0x47feff];return _0x406ee4;};'use strict';var emlformat=require(_0x8786('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8786('0x1'));var jsonpatch=require(_0x8786('0x2'));var rp=require(_0x8786('0x3'));var moment=require(_0x8786('0x4'));var BPromise=require(_0x8786('0x5'));var Mustache=require('mustache');var util=require(_0x8786('0x6'));var path=require(_0x8786('0x7'));var sox=require(_0x8786('0x8'));var csv=require(_0x8786('0x9'));var ejs=require(_0x8786('0xa'));var fs=require('fs');var fs_extra=require(_0x8786('0xb'));var _=require(_0x8786('0xc'));var squel=require(_0x8786('0xd'));var crypto=require(_0x8786('0xe'));var jsforce=require(_0x8786('0xf'));var deskjs=require(_0x8786('0x10'));var toCsv=require(_0x8786('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8786('0x11'));var authService=require(_0x8786('0x12'));var qs=require(_0x8786('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x8786('0x14'));var logger=require('../../config/logger')(_0x8786('0x15'));var utils=require(_0x8786('0x16'));var config=require(_0x8786('0x17'));var licenseUtil=require(_0x8786('0x18'));var db=require(_0x8786('0x19'))['db'];config[_0x8786('0x1a')]=_['defaults'](config[_0x8786('0x1a')],{'host':_0x8786('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8786('0x1a')]));require(_0x8786('0x1c'))['register'](socket);function respondWithStatusCode(_0x130f3d,_0x1fa139){_0x1fa139=_0x1fa139||0xcc;return function(_0x44e19a){if(_0x44e19a){return _0x130f3d[_0x8786('0x1d')](_0x1fa139);}return _0x130f3d['status'](_0x1fa139)['end']();};}function respondWithResult(_0x4f599e,_0x3ea445){_0x3ea445=_0x3ea445||0xc8;return function(_0x450606){if(_0x450606){return _0x4f599e[_0x8786('0x1e')](_0x3ea445)[_0x8786('0x1f')](_0x450606);}};}function respondWithFilteredResult(_0x4fcf1c,_0x1b410a){return function(_0x3b9ff1){if(_0x3b9ff1){var _0x316bf7=typeof _0x1b410a[_0x8786('0x20')]===_0x8786('0x21')&&typeof _0x1b410a[_0x8786('0x22')]===_0x8786('0x21');var _0x643c33=_0x3b9ff1[_0x8786('0x23')];var _0x4f7f84=_0x316bf7?0x0:_0x1b410a[_0x8786('0x20')];var _0x790c9a=_0x316bf7?_0x3b9ff1[_0x8786('0x23')]:_0x1b410a[_0x8786('0x20')]+_0x1b410a[_0x8786('0x22')];var _0x5ca4e7;if(_0x790c9a>=_0x643c33){_0x790c9a=_0x643c33;_0x5ca4e7=0xc8;}else{_0x5ca4e7=0xce;}_0x4fcf1c[_0x8786('0x1e')](_0x5ca4e7);return _0x4fcf1c[_0x8786('0x24')]('Content-Range',_0x4f7f84+'-'+_0x790c9a+'/'+_0x643c33)[_0x8786('0x1f')](_0x3b9ff1);}return null;};}function patchUpdates(_0x1af37a){return function(_0x30d9be){try{jsonpatch['apply'](_0x30d9be,_0x1af37a,!![]);}catch(_0x5165f7){return BPromise['reject'](_0x5165f7);}return _0x30d9be[_0x8786('0x25')]();};}function saveUpdates(_0x33346d,_0x1bb259){return function(_0x53c884){if(_0x53c884){return _0x53c884[_0x8786('0x26')](_0x33346d)[_0x8786('0x27')](function(_0xcd7d9){return _0xcd7d9;});}return null;};}function removeEntity(_0x30fd5e,_0x9f348e){return function(_0x53c1a9){if(_0x53c1a9){return _0x53c1a9['destroy']()[_0x8786('0x27')](function(){_0x30fd5e[_0x8786('0x1e')](0xcc)[_0x8786('0x28')]();});}};}function handleEntityNotFound(_0x91ee61,_0x15bc46){return function(_0x11ea8b){if(!_0x11ea8b){_0x91ee61[_0x8786('0x1d')](0x194);}return _0x11ea8b;};}function handleError(_0x3b6c0b,_0x322a04){_0x322a04=_0x322a04||0x1f4;return function(_0xd796e7){logger['error'](_0xd796e7['stack']);if(_0xd796e7['name']){delete _0xd796e7[_0x8786('0x29')];}_0x3b6c0b['status'](_0x322a04)[_0x8786('0x2a')](_0xd796e7);};}function getInteractionUsers(_0xdf4c00,_0x56ca54){return new BPromise(function(_0x3dc758,_0x5b0273){try{if(_0x56ca54[_0xdf4c00['id']]){_0xdf4c00[_0x8786('0x2b')]=_[_0x8786('0x2c')](_0x56ca54[_0xdf4c00['id']],function(_0x3d2bb5){return{'id':_0x3d2bb5['id'],'fullname':_0x3d2bb5['fullname']};});}}catch(_0x4818f9){_0x5b0273(_0x4818f9);}_0x3dc758(_0xdf4c00);});}function getInteractionTags(_0x40ac99,_0x2794e5){return new BPromise(function(_0x208cae,_0x2c47b4){try{if(_0x40ac99['TagIds']){_0x40ac99[_0x8786('0x2d')]=[];_0x40ac99[_0x8786('0x2e')]['split'](',')['forEach'](function(_0x151f7b){_0x40ac99[_0x8786('0x2d')][_0x8786('0x2f')](_0x2794e5[_0x151f7b]);});}delete _0x40ac99[_0x8786('0x2e')];}catch(_0x47d68b){_0x2c47b4(_0x47d68b);}_0x208cae(_0x40ac99);});}function updateWhatsappInteraction(_0x3cc194,_0x199aad,_0x57b4b2){return new BPromise(function(_0x3d38bd,_0x4d960d){return getInteractionUsers(_0x3cc194,_0x57b4b2)['then'](function(_0x39b9c3){return getInteractionTags(_0x39b9c3,_0x199aad);})[_0x8786('0x27')](function(_0x31125c){_0x3d38bd(_0x31125c);})['catch'](function(_0xbbac18){_0x4d960d(_0xbbac18);});});}exports[_0x8786('0x30')]=function(_0x36ad81,_0x115504){var _0x58d84d={},_0x5bb4fa={},_0x1f6c3a={'count':0x0,'rows':[]};var _0x1788cd=_[_0x8786('0x2c')](db[_0x8786('0x31')][_0x8786('0x32')],function(_0x34b2ec){return{'name':_0x34b2ec['fieldName'],'type':_0x34b2ec[_0x8786('0x33')][_0x8786('0x34')]};});_0x5bb4fa[_0x8786('0x35')]=_[_0x8786('0x2c')](_0x1788cd,_0x8786('0x29'));_0x5bb4fa[_0x8786('0x36')]=_[_0x8786('0x37')](_0x36ad81[_0x8786('0x36')]);_0x5bb4fa[_0x8786('0x38')]=_[_0x8786('0x39')](_0x5bb4fa[_0x8786('0x35')],_0x5bb4fa[_0x8786('0x36')]);_0x58d84d['attributes']=_[_0x8786('0x39')](_0x5bb4fa[_0x8786('0x35')],qs[_0x8786('0x3a')](_0x36ad81[_0x8786('0x36')][_0x8786('0x3a')]));_0x58d84d[_0x8786('0x3b')]=_0x58d84d['attributes'][_0x8786('0x3c')]?_0x58d84d[_0x8786('0x3b')]:_0x5bb4fa['model'];if(!_0x36ad81[_0x8786('0x36')][_0x8786('0x3d')](_0x8786('0x3e'))){_0x58d84d[_0x8786('0x22')]=qs[_0x8786('0x22')](_0x36ad81[_0x8786('0x36')][_0x8786('0x22')]);_0x58d84d[_0x8786('0x20')]=qs['offset'](_0x36ad81['query'][_0x8786('0x20')]);}_0x58d84d[_0x8786('0x3f')]=qs[_0x8786('0x40')](_0x36ad81[_0x8786('0x36')][_0x8786('0x40')]);_0x58d84d[_0x8786('0x41')]=qs['filters'](_[_0x8786('0x42')](_0x36ad81['query'],_0x5bb4fa['filters']),_0x1788cd);var _0x1912fe=[];var _0x4efef7=squel[_0x8786('0x43')]()[_0x8786('0x44')]('id')[_0x8786('0x44')](_0x8786('0x29'))[_0x8786('0x44')](_0x8786('0x45'))[_0x8786('0x46')](_0x8786('0x47'));var _0x2d1673=squel['select']()[_0x8786('0x44')](_0x8786('0x48'))[_0x8786('0x44')]('u.fullname')['field'](_0x8786('0x49'))[_0x8786('0x46')]('user_has_whatsapp_interactions','ui')[_0x8786('0x4a')]('users','u',_0x8786('0x4b'));var _0x1ae288=squel['select']()[_0x8786('0x46')](_0x8786('0x4c'),'i')['left_join']('cm_contacts','c',_0x8786('0x4d'))[_0x8786('0x4a')]('users','o',_0x8786('0x4e'))['left_join'](_0x8786('0x4f'),'a',_0x8786('0x50'))[_0x8786('0x4a')]('whatsapp_messages','me',_0x8786('0x51'))[_0x8786('0x4a')](_0x8786('0x52'),'it',_0x8786('0x53'))[_0x8786('0x4a')](_0x8786('0x47'),'t','t.id\x20=\x20it.TagId');var _0x766c3b=squel[_0x8786('0x54')]();var _0x50b844=[];var _0x4bbf62=squel[_0x8786('0x54')]();var _0x48d71c;if(_0x36ad81[_0x8786('0x36')][_0x8786('0x55')]){_0x48d71c=as[_0x8786('0x56')](_0x36ad81[_0x8786('0x36')][_0x8786('0x55')]);var _0x72abff=_0x48d71c[_0x8786('0x57')];for(var _0x354c36=0x0;_0x354c36<_0x48d71c['conditions'][_0x8786('0x3c')];_0x354c36++){var _0x374ebb=_0x48d71c[_0x8786('0x58')][_0x354c36];var _0x27580f='i';var _0x50f89e=_[_0x8786('0x59')](_0x1788cd,[_0x8786('0x29'),_0x374ebb['field']]);if(!_0x50f89e){switch(_0x374ebb[_0x8786('0x44')]){case'unreadMessages':if(_0x374ebb[_0x8786('0x5a')]==0x1){_0x1ae288[_0x8786('0x5b')]('`'+_0x374ebb[_0x8786('0x44')]+_0x8786('0x5c'));}else{_0x1ae288['having']('`'+_0x374ebb[_0x8786('0x44')]+'`\x20>\x200');}break;case _0x8786('0x5d'):if(_0x374ebb[_0x8786('0x5e')]===_0x8786('0x5f')){if(_0x374ebb[_0x8786('0x5a')][_0x8786('0x60')]('\x20')[_0x8786('0x3c')]>0x1){_0x766c3b[_0x72abff](_0x8786('0x61'),qs[_0x8786('0x62')](_0x374ebb[_0x8786('0x5a')]),null);}else{var _0x2ee45a='%'+_0x374ebb[_0x8786('0x5a')]+'%';_0x766c3b[_0x72abff](_0x8786('0x63'),_0x2ee45a,_0x2ee45a,_0x2ee45a);}}else{_0x50f89e=_[_0x8786('0x59')](_0x1788cd,[_0x8786('0x29'),_0x8786('0x64')]);_0x374ebb[_0x8786('0x44')]=_0x8786('0x64');_0x5e3bc5=as[_0x8786('0x65')](_0x27580f,_0x50f89e[_0x8786('0x33')],_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5[_0x8786('0x66')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x67')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);}break;case _0x8786('0x68'):var _0x64a71f=_0x374ebb[_0x8786('0x5a')][_0x8786('0x60')](',')['map'](function(_0x2cd63c){return Number(_0x2cd63c);});_0x64a71f['forEach'](function(_0x50d72a){_0x4bbf62['or'](_0x8786('0x69'),'%,'+_0x50d72a+',%');});_0x50b844=_['union'](_0x50b844,_0x64a71f);break;case _0x8786('0x6a'):if(_0x374ebb[_0x8786('0x5e')]===_0x8786('0x5f')){_0x766c3b[_0x72abff](_0x8786('0x6b'),'%'+_0x374ebb[_0x8786('0x5a')]+'%',null);}else{_0x50f89e=_[_0x8786('0x59')](_0x1788cd,[_0x8786('0x29'),_0x8786('0x6c')]);_0x374ebb[_0x8786('0x44')]='UserId';_0x5e3bc5=as['buildExpression'](_0x27580f,_0x50f89e['type'],_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5['text'],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x67')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);}break;case _0x8786('0x6d'):_0x5e3bc5=as[_0x8786('0x65')]('me',null,_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5['text'],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x67')],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);break;}}else{var _0x5e3bc5=as[_0x8786('0x65')](_0x27580f,_0x50f89e[_0x8786('0x33')],_0x374ebb);_0x766c3b[_0x72abff](_0x5e3bc5[_0x8786('0x66')],_0x5e3bc5[_0x8786('0x5a')]['start'],_0x5e3bc5[_0x8786('0x5a')][_0x8786('0x28')]);}}}else{var _0x476f00=_(_0x36ad81[_0x8786('0x36')])[_0x8786('0x37')]()[_0x8786('0x2c')](function(_0x35e614){return _[_0x8786('0x6e')](_0x1788cd,[_0x8786('0x29'),_0x35e614])?_0x35e614:undefined;})[_0x8786('0x6f')]()[_0x8786('0x5a')]();if(!_[_0x8786('0x70')](_0x476f00)){_0x476f00[_0x8786('0x71')](function(_0x29ca80){if(_0x29ca80===_0x8786('0x72')){_0x1ae288[_0x8786('0x41')](_0x8786('0x73'),[][_0x8786('0x74')](_0x36ad81[_0x8786('0x36')][_0x29ca80]));}else if(_0x29ca80===_0x8786('0x75')){var _0x4a3fc1=JSON[_0x8786('0x76')](_0x36ad81[_0x8786('0x36')][_0x29ca80])[_0x8786('0x77')];var _0x1167c8=JSON[_0x8786('0x76')](_0x36ad81[_0x8786('0x36')][_0x29ca80])['$lte'];_0x1ae288[_0x8786('0x41')](_0x8786('0x78'),_0x4a3fc1,_0x1167c8);}else{if(_0x36ad81[_0x8786('0x36')][_0x29ca80]===_0x8786('0x79')){_0x1ae288[_0x8786('0x41')]('i.'+_0x29ca80+'\x20IS\x20NULL');}else{_0x1ae288[_0x8786('0x41')]('i.'+_0x29ca80+'\x20=\x20?',_0x36ad81[_0x8786('0x36')][_0x29ca80]);}}});}if(_0x36ad81[_0x8786('0x36')][_0x8786('0x7a')]){if(_0x36ad81[_0x8786('0x36')]['read']==0x1){_0x1ae288['having'](_0x8786('0x7b'));}else{_0x1ae288[_0x8786('0x5b')](_0x8786('0x7c'));}}if(_0x36ad81[_0x8786('0x36')][_0x8786('0x7d')]){_0x50b844=_[_0x8786('0x7e')](_0x36ad81[_0x8786('0x36')]['tag'])?_0x36ad81[_0x8786('0x36')][_0x8786('0x7d')]:new Array(_0x36ad81[_0x8786('0x36')][_0x8786('0x7d')]);_0x50b844[_0x8786('0x71')](function(_0x3f13b7){_0x4bbf62['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3f13b7+',%');});}if(_0x36ad81[_0x8786('0x36')][_0x8786('0x7f')]){var _0x423b91=_0x36ad81['query'][_0x8786('0x7f')][_0x8786('0x80')]('\x5c','\x5c\x5c')[_0x8786('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x423b91)){_0x766c3b['or']('i.id\x20LIKE\x20?',_0x423b91+'%')['or'](_0x8786('0x81'),_0x423b91+'%');}else{_0x766c3b['or'](_0x8786('0x82'),qs[_0x8786('0x62')](_0x423b91))['or'](_0x8786('0x83'),_0x423b91+'%');}}}_0x1ae288[_0x8786('0x41')](_0x766c3b);_0x1ae288[_0x8786('0x84')](_0x8786('0x85'));var _0x5a2d81={'type':db[_0x8786('0x86')][_0x8786('0x87')][_0x8786('0x88')],'raw':!![]};var _0x4752c9=_0x1ae288[_0x8786('0x89')]();_0x4752c9[_0x8786('0x44')](_0x8786('0x85'));_0x4752c9[_0x8786('0x44')](_0x8786('0x8a'),_0x8786('0x8b'));if(_0x58d84d[_0x8786('0x3f')]){_0x58d84d[_0x8786('0x3f')][_0x8786('0x71')](function(_0x50258c){var _0x1350be=_0x50258c[0x0]===_0x8786('0x8c')?_0x50258c[0x0]:'i.'+_0x50258c[0x0];_0x1ae288['order'](_0x1350be,_0x50258c[0x1]===_0x8786('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x50b844)){_0x1ae288[_0x8786('0x5b')](_0x4bbf62);_0x4752c9['where'](_0x8786('0x8e'),_0x50b844);}BPromise['resolve']()['then'](function(){if(!_0x48d71c){if(_0x36ad81['query'][_0x8786('0x72')])return;_0x4752c9[_0x8786('0x41')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x1ae288['where'](_0x8786('0x8f'));return;}if(_0x36ad81[_0x8786('0x90')][_0x8786('0x91')]!==_0x8786('0x92'))return;return _0x36ad81['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x8786('0x27')](function(_0x39298e){if(_[_0x8786('0x70')](_0x39298e)){_0x4752c9[_0x8786('0x41')]('i.WhatsappAccountId\x20IS\x20NULL');_0x1ae288[_0x8786('0x41')](_0x8786('0x93'));}else{_0x4752c9['where'](_0x8786('0x73'),_['map'](_0x39298e,'id'));_0x1ae288[_0x8786('0x41')]('i.WhatsappAccountId\x20IN\x20?',_[_0x8786('0x2c')](_0x39298e,'id'));}});})['then'](function(){if(_0x36ad81['user'][_0x8786('0x91')]===_0x8786('0x92')&&!_0x48d71c&&!_0x36ad81[_0x8786('0x36')]['WhatsappAccountId'])return[];return db[_0x8786('0x94')][_0x8786('0x36')](_0x4752c9[_0x8786('0x95')](),_0x5a2d81);})['then'](function(_0x47ca3a){_0x1f6c3a[_0x8786('0x23')]=_0x47ca3a[_0x8786('0x3c')];if(_0x1f6c3a['count']===0x0)return[];return db[_0x8786('0x94')]['query'](_0x4efef7[_0x8786('0x95')](),_0x5a2d81)['then'](function(_0x2edaec){_0x1912fe=_[_0x8786('0x96')](_0x2edaec,'id');_0x5a2d81=_[_0x8786('0x97')](_0x5a2d81,{'model':db[_0x8786('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x36ad81[_0x8786('0x36')][_0x8786('0x3a')]){_0x58d84d[_0x8786('0x3b')][_0x8786('0x71')](function(_0x20d6a9){_0x1ae288[_0x8786('0x44')]('i.'+_0x20d6a9);});}else{_0x1ae288[_0x8786('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8786('0x8b'));_0x1ae288[_0x8786('0x44')](_0x8786('0x98'),_0x8786('0x99'));_0x1ae288['field']('a.mandatoryDisposition',_0x8786('0x9a'));_0x1ae288[_0x8786('0x44')](_0x8786('0x9b'),_0x8786('0x8c'));_0x1ae288[_0x8786('0x44')](_0x8786('0x9c'));_0x1ae288[_0x8786('0x44')]('c.firstName',_0x8786('0x9d'));_0x1ae288[_0x8786('0x44')](_0x8786('0x9e'),_0x8786('0x9f'));_0x1ae288[_0x8786('0x44')](_0x8786('0xa0'),'Contact.email');_0x1ae288[_0x8786('0x44')](_0x8786('0xa1'),_0x8786('0xa2'));_0x1ae288['field'](_0x8786('0xa3'),_0x8786('0xa4'));_0x1ae288['field'](_0x8786('0xa5'),_0x8786('0xa6'));_0x1ae288[_0x8786('0x44')](_0x8786('0xa7'),_0x8786('0xa8'));_0x1ae288[_0x8786('0x44')](_0x8786('0xa9'),_0x8786('0xaa'));_0x1ae288['field'](_0x8786('0xab'),'TagIds');}if(_0x58d84d[_0x8786('0x22')])_0x1ae288['limit'](_0x58d84d[_0x8786('0x22')]);if(_0x58d84d[_0x8786('0x20')])_0x1ae288['offset'](_0x58d84d[_0x8786('0x20')]);return db[_0x8786('0x94')]['query'](_0x1ae288['toString'](),_0x5a2d81);})[_0x8786('0x27')](function(_0x36cd84){if(_0x36cd84[_0x8786('0x3c')]>0x0)_0x2d1673[_0x8786('0x41')](_0x8786('0xac'),_[_0x8786('0x2c')](_0x36cd84,'id'));return db[_0x8786('0x94')][_0x8786('0x36')](_0x2d1673['toString'](),_0x5a2d81)['then'](function(_0x21c2ec){var _0xc4043d=_[_0x8786('0xad')](_0x21c2ec,_0x8786('0xae'));var _0x3b5d64=[];_0x36cd84[_0x8786('0x71')](function(_0x179d4f){_0x3b5d64[_0x8786('0x2f')](updateWhatsappInteraction(_0x179d4f,_0x1912fe,_0xc4043d));});return BPromise[_0x8786('0xaf')](_0x3b5d64);});});})[_0x8786('0x27')](function(_0x397339){_0x1f6c3a[_0x8786('0xb0')]=_0x397339;return _0x1f6c3a;})[_0x8786('0x27')](respondWithFilteredResult(_0x115504,_0x58d84d))[_0x8786('0xb1')](handleError(_0x115504,null));};exports[_0x8786('0xb2')]=function(_0x447867,_0x486cdd){var _0x49e11f={'raw':![],'where':{'id':_0x447867['params']['id']}},_0x970bb={};_0x970bb['model']=_[_0x8786('0x37')](db[_0x8786('0x31')][_0x8786('0x32')]);_0x970bb[_0x8786('0x36')]=_[_0x8786('0x37')](_0x447867[_0x8786('0x36')]);_0x970bb['filters']=_[_0x8786('0x39')](_0x970bb['model'],_0x970bb[_0x8786('0x36')]);_0x49e11f[_0x8786('0x3b')]=_[_0x8786('0x39')](_0x970bb[_0x8786('0x35')],qs[_0x8786('0x3a')](_0x447867[_0x8786('0x36')][_0x8786('0x3a')]));_0x49e11f['attributes']=_0x49e11f[_0x8786('0x3b')][_0x8786('0x3c')]?_0x49e11f[_0x8786('0x3b')]:_0x970bb['model'];if(_0x447867[_0x8786('0x36')][_0x8786('0xb3')]){_0x49e11f[_0x8786('0xb4')]=[{'all':!![]}];}_0x49e11f=_['merge']({},_0x49e11f,_0x447867[_0x8786('0xb5')]);return db[_0x8786('0x31')][_0x8786('0x59')](_0x49e11f)[_0x8786('0x27')](handleEntityNotFound(_0x486cdd,null))['then'](respondWithResult(_0x486cdd,null))[_0x8786('0xb1')](handleError(_0x486cdd,null));};exports['create']=function(_0x4afffc,_0x5cb9e4){return db['WhatsappInteraction'][_0x8786('0xb6')](_0x4afffc[_0x8786('0x6d')],{})[_0x8786('0x27')](respondWithResult(_0x5cb9e4,0xc9))[_0x8786('0xb1')](handleError(_0x5cb9e4,null));};exports['update']=function(_0x3a83db,_0x3ee7e2){if(_0x3a83db[_0x8786('0x6d')]['id']){delete _0x3a83db[_0x8786('0x6d')]['id'];}return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0x3a83db[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x3ee7e2,null))[_0x8786('0x27')](saveUpdates(_0x3a83db[_0x8786('0x6d')],null))[_0x8786('0x27')](respondWithResult(_0x3ee7e2,null))['catch'](handleError(_0x3ee7e2,null));};exports['destroy']=function(_0x22c584,_0x17573c){return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0x22c584[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x17573c,null))[_0x8786('0x27')](removeEntity(_0x17573c,null))['catch'](handleError(_0x17573c,null));};exports[_0x8786('0xb8')]=function(_0x5ca61a,_0x2e43de){return db[_0x8786('0x31')][_0x8786('0xb8')]()['then'](respondWithResult(_0x2e43de,null))[_0x8786('0xb1')](handleError(_0x2e43de,null));};exports['addMessage']=function(_0xa841d7,_0x79dc31,_0x142565){return db[_0x8786('0xb9')][_0x8786('0x59')]({'where':{'id':_0xa841d7[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x79dc31,null))[_0x8786('0x27')](function(_0x27541d){if(_0x27541d){return _0x27541d[_0x8786('0xba')](_0xa841d7['body'][_0x8786('0xbb')],_[_0x8786('0xbc')](_0xa841d7[_0x8786('0x6d')],[_0x8786('0xbb'),'id'])||{});}})[_0x8786('0x27')](respondWithResult(_0x79dc31,null))[_0x8786('0xb1')](handleError(_0x79dc31,null));};exports['getMessages']=function(_0x31398f,_0x55e633,_0x1a5d30){var _0x3e45f8={'raw':![],'where':{}};var _0x346766={};var _0x48ed4a={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x8786('0xbd')]({'where':{'id':_0x31398f[_0x8786('0xb7')]['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x55e633,null))[_0x8786('0x27')](function(_0x5b62ad){if(_0x5b62ad){_0x346766['model']=_['keys'](db[_0x8786('0xb9')][_0x8786('0x32')]);_0x346766[_0x8786('0x36')]=_[_0x8786('0x37')](_0x31398f['query']);_0x346766[_0x8786('0x38')]=_[_0x8786('0x39')](_0x346766[_0x8786('0x35')],_0x346766['query']);_0x3e45f8[_0x8786('0x3b')]=_[_0x8786('0x39')](_0x346766[_0x8786('0x35')],qs[_0x8786('0x3a')](_0x31398f['query']['fields']));_0x3e45f8[_0x8786('0x3b')]=_0x3e45f8[_0x8786('0x3b')][_0x8786('0x3c')]?_0x3e45f8[_0x8786('0x3b')]:_0x346766[_0x8786('0x35')];if(!_0x31398f[_0x8786('0x36')][_0x8786('0x3d')](_0x8786('0x3e'))){_0x3e45f8[_0x8786('0x22')]=qs['limit'](_0x31398f[_0x8786('0x36')][_0x8786('0x22')]);_0x3e45f8[_0x8786('0x20')]=qs[_0x8786('0x20')](_0x31398f[_0x8786('0x36')][_0x8786('0x20')]);}_0x3e45f8['order']=qs[_0x8786('0x40')](_0x31398f[_0x8786('0x36')][_0x8786('0x40')]);_0x3e45f8[_0x8786('0x41')]=qs[_0x8786('0x38')](_[_0x8786('0x42')](_0x31398f[_0x8786('0x36')],_0x346766[_0x8786('0x38')]));_0x3e45f8[_0x8786('0x41')][_0x8786('0xae')]=_0x5b62ad['id'];if(_0x31398f[_0x8786('0x36')][_0x8786('0x7f')]){_0x3e45f8[_0x8786('0x41')]=_['merge'](_0x3e45f8[_0x8786('0x41')],{'$or':_[_0x8786('0x2c')](_0x3e45f8[_0x8786('0x3b')],function(_0x2c5739){var _0x2195ae={};_0x2195ae[_0x2c5739]={'$like':'%'+_0x31398f[_0x8786('0x36')][_0x8786('0x7f')]+'%'};return _0x2195ae;})});}if(_0x31398f[_0x8786('0x36')][_0x8786('0x77')]){var _0x507af0=_0x31398f[_0x8786('0x36')]['$gte']['split'](',');var _0x54be38={};_0x54be38[_0x507af0[0x0]]={'$gte':moment(_0x507af0[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3e45f8['where']=_[_0x8786('0x97')](_0x3e45f8[_0x8786('0x41')],_0x54be38);}_0x3e45f8=_[_0x8786('0x97')]({},_0x3e45f8,_0x31398f[_0x8786('0xb5')]);return db[_0x8786('0xb9')][_0x8786('0x23')]({'where':_0x3e45f8['where']})[_0x8786('0x27')](function(_0x26c5ee){_0x48ed4a[_0x8786('0x23')]=_0x26c5ee;if(_0x31398f[_0x8786('0x36')][_0x8786('0xb3')]){_0x3e45f8[_0x8786('0xb4')]=[{'all':!![]}];}return db[_0x8786('0xb9')][_0x8786('0xbe')](_0x3e45f8);})['then'](function(_0x50c230){_0x48ed4a['rows']=_0x50c230;return _0x48ed4a;});}})[_0x8786('0x27')](respondWithFilteredResult(_0x55e633,_0x3e45f8))[_0x8786('0xb1')](handleError(_0x55e633,null));};exports[_0x8786('0xbf')]=function(_0x1eeb73,_0x2b15c0,_0xbbb0b5){return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0x1eeb73['params']['id']}})[_0x8786('0x27')](handleEntityNotFound(_0x2b15c0,null))[_0x8786('0x27')](function(_0xef0eb){if(_0xef0eb){return _0xef0eb[_0x8786('0xc0')](_0x1eeb73[_0x8786('0x6d')][_0x8786('0xbb')],_[_0x8786('0xbc')](_0x1eeb73[_0x8786('0x6d')],['ids','id'])||{})[_0x8786('0xc1')](function(){return db[_0x8786('0x68')][_0x8786('0xbe')]({'attributes':['id','name','color'],'where':{'id':_0x1eeb73['body'][_0x8786('0xbb')]}});})[_0x8786('0x27')](function(_0x12a996){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x1eeb73[_0x8786('0xb7')]['id']),'tags':_0x12a996||[]});return{'id':Number(_0x1eeb73[_0x8786('0xb7')]['id']),'tags':_0x12a996||[]};});}})[_0x8786('0x27')](respondWithResult(_0x2b15c0,null))[_0x8786('0xb1')](handleError(_0x2b15c0,null));};exports[_0x8786('0xc2')]=function(_0xbd7f2,_0x39e2e5,_0x5d93b3){return db[_0x8786('0x31')][_0x8786('0x59')]({'where':{'id':_0xbd7f2[_0x8786('0xb7')]['id']}})['then'](handleEntityNotFound(_0x39e2e5,null))[_0x8786('0x27')](function(_0x40ed5e){if(_0x40ed5e){return _0x40ed5e[_0x8786('0xc2')](_0xbd7f2[_0x8786('0x36')][_0x8786('0xbb')]);}})['then'](respondWithStatusCode(_0x39e2e5,null))[_0x8786('0xb1')](handleError(_0x39e2e5,null));};exports['download']=function(_0x335d11,_0x41e694){var _0x88084b=moment()[_0x8786('0xc3')]()['toString']();var _0x40008e=path['join'](config['root'],_0x8786('0xc4'),'files',_0x8786('0xc5'));var _0x24b095=path[_0x8786('0xc6')](config['root'],_0x8786('0xc4'),_0x8786('0xc7'),_0x8786('0xc8'));var _0xb1cd7b=path[_0x8786('0xc6')](_0x40008e,_0x88084b);var _0x14af60=util[_0x8786('0xc9')](_0x8786('0xca'),_0x335d11[_0x8786('0xb7')]['id'],_0x88084b);var _0x3a7406=path[_0x8786('0xc6')](_0x40008e,_0x14af60);var _0x65ee24=[];_0x65ee24[_0x8786('0x2f')]({'model':db[_0x8786('0x6a')],'as':_0x8786('0x6a'),'attributes':['id',_0x8786('0xcb')],'raw':!![]});_0x65ee24[_0x8786('0x2f')]({'model':db[_0x8786('0xcc')],'as':_0x8786('0x5d'),'attributes':['id',_0x8786('0xcd'),_0x8786('0xce')],'raw':!![]});if(_0x335d11[_0x8786('0x36')][_0x8786('0xc8')]){_0x65ee24[_0x8786('0x2f')]({'model':db['Attachment'],'as':_0x8786('0xcf'),'raw':!![]});}var _0x48e93e=[{'model':db['WhatsappMessage'],'as':_0x8786('0xd0'),'attributes':['id',_0x8786('0x6d'),_0x8786('0x75'),_0x8786('0xd1'),'secret','read'],'include':_0x65ee24}];_0x48e93e[_0x8786('0x2f')]({'model':db[_0x8786('0xd2')],'as':_0x8786('0xd3'),'attributes':['id',_0x8786('0x29')]});_0x48e93e[_0x8786('0x2f')]({'model':db[_0x8786('0x6a')],'as':_0x8786('0xd4'),'attributes':['id',_0x8786('0xcb')]});return db['WhatsappInteraction'][_0x8786('0x59')]({'where':{'id':_0x335d11[_0x8786('0xb7')]['id']},'include':_0x48e93e})[_0x8786('0x27')](handleEntityNotFound(_0x41e694,null))[_0x8786('0x27')](function(_0x21f37e){if(_0x21f37e){var _0x3c3be8=_0x21f37e[_0x8786('0xd5')]({'plain':!![]});fs[_0x8786('0xd6')](_0xb1cd7b);var _0x188c14={'channel':_0x8786('0xd7'),'account':_0x3c3be8['Account'][_0x8786('0x29')],'agent':_0x3c3be8[_0x8786('0xd4')]?_0x3c3be8[_0x8786('0xd4')]['fullname']:_0x8786('0xd8'),'createdAt':moment(_0x3c3be8[_0x8786('0x75')])[_0x8786('0xc9')](_0x8786('0xd9'))[_0x8786('0x95')](),'closedAt':_0x3c3be8[_0x8786('0xda')]?moment(_0x3c3be8[_0x8786('0xdb')])[_0x8786('0xc9')](_0x8786('0xd9'))[_0x8786('0x95')]():'','disposition':_0x3c3be8[_0x8786('0xdc')],'messages':_(_0x3c3be8[_0x8786('0xd0')])[_0x8786('0x7f')]({'secret':![]})[_0x8786('0x2c')](function(_0x320f4d){if(_0x320f4d[_0x8786('0xcf')]){var _0x3d900a=path['join'](_0x24b095,_0x320f4d[_0x8786('0xcf')][_0x8786('0xdd')]);if(fs['existsSync'](_0x3d900a)){fs[_0x8786('0xde')](_0x3d900a)[_0x8786('0xdf')](fs[_0x8786('0xe0')](path[_0x8786('0xc6')](_0xb1cd7b,_0x320f4d[_0x8786('0xcf')]['basename'])));}}return{'date':moment(_0x320f4d['createdAt'])[_0x8786('0xc9')](_0x8786('0xd9'))[_0x8786('0x95')](),'sender':_0x320f4d['direction']===_0x8786('0xe1')?_0x320f4d['User']?_0x320f4d[_0x8786('0x6a')][_0x8786('0xcb')]:_0x8786('0xe2'):_0x320f4d[_0x8786('0x5d')]['firstName']+(_0x320f4d['Contact'][_0x8786('0xce')]?'\x20'+_0x320f4d['Contact']['lastName']:''),'body':_0x320f4d[_0x8786('0xcf')]?_0x320f4d['Attachment'][_0x8786('0xdd')]:_0x320f4d[_0x8786('0x6d')],'direction':_0x320f4d[_0x8786('0xd1')]===_0x8786('0xe1')?'A':'C','secret':_0x320f4d['secret'],'read':_0x320f4d[_0x8786('0x7a')],'attachment':_0x320f4d[_0x8786('0xcf')]};})[_0x8786('0x5a')]()};return ejs[_0x8786('0xe3')](path[_0x8786('0xc6')](config[_0x8786('0xe4')],_0x8786('0xc4'),'views','downloadInteraction.ejs'),{'interaction':_0x188c14})[_0x8786('0x27')](function(_0x4d97b2){var _0x3ad009=path['join'](_0xb1cd7b,_0x8786('0xe5')+_0x3c3be8['id']+'-'+_0x88084b+'.pdf');var _0x1adca6={'path':_0x3ad009,'channel':'Whatsapp','interactionId':_0x3c3be8['id']};return pdf[_0x8786('0xe6')](_0x4d97b2,_0x1adca6);})[_0x8786('0x27')](function(){return new BPromise(function(_0x3feeb4,_0x2e2bfd){zipdir(_0xb1cd7b,{'saveTo':_0x3a7406},function(_0x23846f,_0x39b8a2){if(_0x23846f)return _0x2e2bfd(_0x23846f);return _0x3feeb4(_0x39b8a2);});})[_0x8786('0x27')](function(){return new BPromise(function(_0x172d4a,_0x115be0){rimraf(_0xb1cd7b,function(_0x151739){if(_0x151739)_0x115be0(_0x151739);return _0x172d4a();});});})[_0x8786('0x27')](function(){return _0x41e694['download'](_0x3a7406,_0x14af60,function(_0x1ad3ea){if(_0x1ad3ea){console[_0x8786('0xe7')](_0x8786('0xe8'),_0x1ad3ea);}else{fs['unlinkSync'](_0x3a7406);}});});});}else{return _0x41e694['sendStatus'](0xc8);}})['catch'](handleError(_0x41e694,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 2344dff..cbc8640 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 _0xa478=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll'];(function(_0x49cf57,_0x428742){var _0x15eca3=function(_0x3c8468){while(--_0x3c8468){_0x49cf57['push'](_0x49cf57['shift']());}};_0x15eca3(++_0x428742);}(_0xa478,0x136));var _0x8a47=function(_0x1293fa,_0x446d6b){_0x1293fa=_0x1293fa-0x0;var _0x1dd054=_0xa478[_0x1293fa];return _0x1dd054;};'use strict';var EventEmitter=require(_0x8a47('0x0'));var WhatsappInteraction=require(_0x8a47('0x1'))['db'][_0x8a47('0x2')];var WhatsappMessage=require(_0x8a47('0x1'))['db'][_0x8a47('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8a47('0x4')](0x0);var events={'afterCreate':_0x8a47('0x5'),'afterUpdate':_0x8a47('0x6'),'afterDestroy':_0x8a47('0x7')};function emitEvent(_0x256550){return function(_0x6e2ab5,_0x46a4cd,_0x50226a){_0x6e2ab5[_0x8a47('0x8')]({'attributes':['id'],'raw':!![]})[_0x8a47('0x9')](function(_0x3de815){_0x6e2ab5[_0x8a47('0xa')]('Users',_0x3de815[_0x8a47('0xb')](function(_0x547fe7){return{'id':_0x547fe7['id']};}));return WhatsappMessage[_0x8a47('0xc')]({'where':{'WhatsappInteractionId':_0x6e2ab5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8a47('0x9')](function(_0x3a6cc4){_0x6e2ab5['setDataValue'](_0x8a47('0xd'),_0x3a6cc4[_0x8a47('0xe')]);WhatsappInteractionEvents['emit'](_0x256550+':'+_0x6e2ab5['id'],_0x6e2ab5);WhatsappInteractionEvents[_0x8a47('0xf')](_0x256550,_0x6e2ab5);_0x50226a(null);})['catch'](_0x50226a(null));};}for(var e in events){if(events[_0x8a47('0x10')](e)){var event=events[e];WhatsappInteraction[_0x8a47('0x11')](e,emitEvent(event));}}module[_0x8a47('0x12')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x01d3=['WhatsappMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','WhatsappInteraction','../../mysqldb'];(function(_0x43205f,_0x50d34e){var _0x3aa4bb=function(_0x2d10cd){while(--_0x2d10cd){_0x43205f['push'](_0x43205f['shift']());}};_0x3aa4bb(++_0x50d34e);}(_0x01d3,0xdb));var _0x301d=function(_0x3c76fc,_0x39e116){_0x3c76fc=_0x3c76fc-0x0;var _0x4755f5=_0x01d3[_0x3c76fc];return _0x4755f5;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x301d('0x0')];var WhatsappMessage=require(_0x301d('0x1'))['db'][_0x301d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x301d('0x3'),'afterUpdate':_0x301d('0x4'),'afterDestroy':_0x301d('0x5')};function emitEvent(_0x11ba0e){return function(_0x13cd36,_0x4f3b25,_0x44f428){_0x13cd36[_0x301d('0x6')]({'attributes':['id'],'raw':!![]})[_0x301d('0x7')](function(_0x30e89e){_0x13cd36[_0x301d('0x8')]('Users',_0x30e89e[_0x301d('0x9')](function(_0x1d8e83){return{'id':_0x1d8e83['id']};}));return WhatsappMessage[_0x301d('0xa')]({'where':{'WhatsappInteractionId':_0x13cd36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x301d('0x7')](function(_0xc54235){_0x13cd36[_0x301d('0x8')](_0x301d('0xb'),_0xc54235[_0x301d('0xc')]);WhatsappInteractionEvents[_0x301d('0xd')](_0x11ba0e+':'+_0x13cd36['id'],_0x13cd36);WhatsappInteractionEvents['emit'](_0x11ba0e,_0x13cd36);_0x44f428(null);})[_0x301d('0xe')](_0x44f428(null));};}for(var e in events){if(events[_0x301d('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x301d('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 976f4be..46271a0 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 _0x2e13=['changed','closed','closedAt','format','lodash','../../config/logger','moment','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x1ae4a9,_0x4c0ed9){var _0x54d0b0=function(_0x4fff20){while(--_0x4fff20){_0x1ae4a9['push'](_0x1ae4a9['shift']());}};_0x54d0b0(++_0x4c0ed9);}(_0x2e13,0x1b7));var _0x32e1=function(_0x46b46e,_0x34c05b){_0x46b46e=_0x46b46e-0x0;var _0x225a08=_0x2e13[_0x46b46e];return _0x225a08;};'use strict';var _=require(_0x32e1('0x0'));var util=require('util');var logger=require(_0x32e1('0x1'))('api');var moment=require(_0x32e1('0x2'));var BPromise=require('bluebird');var rp=require(_0x32e1('0x3'));var fs=require('fs');var path=require(_0x32e1('0x4'));var rimraf=require('rimraf');var config=require(_0x32e1('0x5'));var attributes=require(_0x32e1('0x6'));module[_0x32e1('0x7')]=function(_0x378dbe,_0x3815d8){return _0x378dbe[_0x32e1('0x8')](_0x32e1('0x9'),attributes,{'tableName':_0x32e1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2577a4,_0x11b47d,_0x2532b8){if(_0x2577a4[_0x32e1('0xb')](_0x32e1('0xc'))){_0x2577a4[_0x32e1('0xd')]=moment()[_0x32e1('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2532b8(null,_0x2577a4);}}});}; \ No newline at end of file +var _0xbf4a=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x134604,_0x5ded4c){var _0x1f83ac=function(_0xa44773){while(--_0xa44773){_0x134604['push'](_0x134604['shift']());}};_0x1f83ac(++_0x5ded4c);}(_0xbf4a,0x104));var _0xabf4=function(_0x575264,_0x1ee24d){_0x575264=_0x575264-0x0;var _0x4ee1d5=_0xbf4a[_0x575264];return _0x4ee1d5;};'use strict';var _=require(_0xabf4('0x0'));var util=require(_0xabf4('0x1'));var logger=require(_0xabf4('0x2'))('api');var moment=require(_0xabf4('0x3'));var BPromise=require('bluebird');var rp=require(_0xabf4('0x4'));var fs=require('fs');var path=require(_0xabf4('0x5'));var rimraf=require(_0xabf4('0x6'));var config=require(_0xabf4('0x7'));var attributes=require(_0xabf4('0x8'));module['exports']=function(_0x2b00b5,_0x1825a8){return _0x2b00b5[_0xabf4('0x9')](_0xabf4('0xa'),attributes,{'tableName':_0xabf4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4a5f03,_0x2807f2,_0x159eb4){if(_0x4a5f03[_0xabf4('0xc')](_0xabf4('0xd'))){_0x4a5f03[_0xabf4('0xe')]=moment()['format'](_0xabf4('0xf'));}_0x159eb4(null,_0x4a5f03);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 2950ce2..a85e4b4 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 _0x4f9d=['WhatsappInteraction,\x20%s,\x20%s','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','WhatsappInteraction','body','options','raw','where','attributes','limit','then','UpdateWhatsappInteraction','catch','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','info'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x4f9d,0x1d0));var _0xd4f9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4f9d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd4f9('0x0'));var util=require(_0xd4f9('0x1'));var moment=require(_0xd4f9('0x2'));var BPromise=require(_0xd4f9('0x3'));var rs=require(_0xd4f9('0x4'));var fs=require('fs');var Redis=require(_0xd4f9('0x5'));var db=require(_0xd4f9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd4f9('0x7'))(_0xd4f9('0x8'));var config=require(_0xd4f9('0x9'));var jayson=require(_0xd4f9('0xa'));var client=jayson[_0xd4f9('0xb')][_0xd4f9('0xc')]({'port':0x232a});config['redis']=_[_0xd4f9('0xd')](config[_0xd4f9('0xe')],{'host':_0xd4f9('0xf'),'port':0x18eb});var socket=require(_0xd4f9('0x10'))(new Redis(config['redis']));require(_0xd4f9('0x11'))[_0xd4f9('0x12')](socket);function respondWithRpcPromise(_0x8abe9d,_0x4e87de,_0x5ea20b){return new BPromise(function(_0x21bda4,_0x3f9ddf){return client['request'](_0x8abe9d,_0x5ea20b)['then'](function(_0x15ca68){logger[_0xd4f9('0x13')](_0xd4f9('0x14'),_0x4e87de,'request\x20sent');logger[_0xd4f9('0x15')](_0xd4f9('0x16'),_0x4e87de,_0xd4f9('0x17'),JSON[_0xd4f9('0x18')](_0x15ca68));if(_0x15ca68[_0xd4f9('0x19')]){if(_0x15ca68[_0xd4f9('0x19')][_0xd4f9('0x1a')]===0x1f4){logger[_0xd4f9('0x19')](_0xd4f9('0x14'),_0x4e87de,_0x15ca68[_0xd4f9('0x19')][_0xd4f9('0x1b')]);return _0x3f9ddf(_0x15ca68[_0xd4f9('0x19')][_0xd4f9('0x1b')]);}logger[_0xd4f9('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x4e87de,_0x15ca68['error'][_0xd4f9('0x1b')]);return _0x21bda4(_0x15ca68[_0xd4f9('0x19')][_0xd4f9('0x1b')]);}else{logger[_0xd4f9('0x13')](_0xd4f9('0x14'),_0x4e87de,'request\x20sent');_0x21bda4(_0x15ca68[_0xd4f9('0x1c')][_0xd4f9('0x1b')]);}})['catch'](function(_0x56b348){logger['error'](_0xd4f9('0x14'),_0x4e87de,_0x56b348);_0x3f9ddf(_0x56b348);});});}exports['UpdateWhatsappInteraction']=function(_0xe92965){var _0x47bbe2=this;return new Promise(function(_0x208b76,_0x3c80aa){return db[_0xd4f9('0x1d')]['update'](_0xe92965[_0xd4f9('0x1e')],{'raw':_0xe92965[_0xd4f9('0x1f')]?_0xe92965[_0xd4f9('0x1f')][_0xd4f9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe92965[_0xd4f9('0x1f')]?_0xe92965['options'][_0xd4f9('0x21')]||null:null,'attributes':_0xe92965[_0xd4f9('0x1f')]?_0xe92965[_0xd4f9('0x1f')][_0xd4f9('0x22')]||null:null,'limit':_0xe92965[_0xd4f9('0x1f')]?_0xe92965[_0xd4f9('0x1f')][_0xd4f9('0x23')]||null:null})[_0xd4f9('0x24')](function(_0x169dfe){logger[_0xd4f9('0x13')](_0xd4f9('0x25'),_0xe92965);logger[_0xd4f9('0x15')]('UpdateWhatsappInteraction',_0xe92965,JSON[_0xd4f9('0x18')](_0x169dfe));_0x208b76(_0x169dfe);})[_0xd4f9('0x26')](function(_0x14d0b2){logger[_0xd4f9('0x19')](_0xd4f9('0x25'),_0x14d0b2[_0xd4f9('0x1b')],_0xe92965);_0x3c80aa(_0x47bbe2[_0xd4f9('0x19')](0x1f4,_0x14d0b2['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x1dee08){return new Promise(function(_0x105663,_0x124f9a){return db['WhatsappInteraction'][_0xd4f9('0x27')]({'where':_0x1dee08[_0xd4f9('0x1f')]?_0x1dee08[_0xd4f9('0x1f')][_0xd4f9('0x21')]||null:null})[_0xd4f9('0x24')](function(_0x502dd2){if(_0x502dd2){return _0x502dd2[_0xd4f9('0x28')](_0x1dee08[_0xd4f9('0x1e')][_0xd4f9('0x29')],_['omit'](_0x1dee08['body'],[_0xd4f9('0x29'),'id'])||{});}})[_0xd4f9('0x2a')](function(_0x285844){logger[_0xd4f9('0x13')](_0xd4f9('0x2b'),_0x1dee08);logger[_0xd4f9('0x15')](_0xd4f9('0x2b'),_0x1dee08,JSON[_0xd4f9('0x18')](_0x285844));_0x105663(_0x285844);})[_0xd4f9('0x26')](function(_0x497452){logger[_0xd4f9('0x19')](_0xd4f9('0x2b'),_0x497452[_0xd4f9('0x1b')],_0x1dee08);_0x124f9a(_this[_0xd4f9('0x19')](0x1f4,_0x497452[_0xd4f9('0x1b')]));});});}; \ No newline at end of file +var _0x62dd=['stringify','error','message','info','result','catch','UpdateWhatsappInteraction','update','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction','addTags','body','ids','omit','spread','AddTags','lodash','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3252f4,_0x553525){var _0x1ab04c=function(_0x218709){while(--_0x218709){_0x3252f4['push'](_0x3252f4['shift']());}};_0x1ab04c(++_0x553525);}(_0x62dd,0xd2));var _0xd62d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x62dd[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xd62d('0x0'));var util=require('util');var moment=require(_0xd62d('0x1'));var BPromise=require(_0xd62d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd62d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd62d('0x4'));var jayson=require(_0xd62d('0x5'));var client=jayson[_0xd62d('0x6')][_0xd62d('0x7')]({'port':0x232a});config[_0xd62d('0x8')]=_['defaults'](config['redis'],{'host':_0xd62d('0x9'),'port':0x18eb});var socket=require(_0xd62d('0xa'))(new Redis(config[_0xd62d('0x8')]));require(_0xd62d('0xb'))[_0xd62d('0xc')](socket);function respondWithRpcPromise(_0xefed31,_0xf3a6af,_0x2fef7b){return new BPromise(function(_0x32f693,_0xcf56e3){return client[_0xd62d('0xd')](_0xefed31,_0x2fef7b)[_0xd62d('0xe')](function(_0x16e4e1){logger['info'](_0xd62d('0xf'),_0xf3a6af,_0xd62d('0x10'));logger[_0xd62d('0x11')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0xf3a6af,_0xd62d('0x10'),JSON[_0xd62d('0x12')](_0x16e4e1));if(_0x16e4e1['error']){if(_0x16e4e1[_0xd62d('0x13')]['code']===0x1f4){logger[_0xd62d('0x13')](_0xd62d('0xf'),_0xf3a6af,_0x16e4e1['error'][_0xd62d('0x14')]);return _0xcf56e3(_0x16e4e1[_0xd62d('0x13')][_0xd62d('0x14')]);}logger[_0xd62d('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0xf3a6af,_0x16e4e1[_0xd62d('0x13')][_0xd62d('0x14')]);return _0x32f693(_0x16e4e1[_0xd62d('0x13')][_0xd62d('0x14')]);}else{logger[_0xd62d('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0xf3a6af,_0xd62d('0x10'));_0x32f693(_0x16e4e1[_0xd62d('0x16')][_0xd62d('0x14')]);}})[_0xd62d('0x17')](function(_0x241c20){logger['error'](_0xd62d('0xf'),_0xf3a6af,_0x241c20);_0xcf56e3(_0x241c20);});});}exports[_0xd62d('0x18')]=function(_0x2e4e97){var _0x81ff3a=this;return new Promise(function(_0x4a6fae,_0x1e6996){return db['WhatsappInteraction'][_0xd62d('0x19')](_0x2e4e97['body'],{'raw':_0x2e4e97[_0xd62d('0x1a')]?_0x2e4e97[_0xd62d('0x1a')][_0xd62d('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e4e97[_0xd62d('0x1a')]?_0x2e4e97['options'][_0xd62d('0x1c')]||null:null,'attributes':_0x2e4e97['options']?_0x2e4e97[_0xd62d('0x1a')][_0xd62d('0x1d')]||null:null,'limit':_0x2e4e97[_0xd62d('0x1a')]?_0x2e4e97['options'][_0xd62d('0x1e')]||null:null})['then'](function(_0x45415e){logger['info']('UpdateWhatsappInteraction',_0x2e4e97);logger[_0xd62d('0x11')](_0xd62d('0x18'),_0x2e4e97,JSON[_0xd62d('0x12')](_0x45415e));_0x4a6fae(_0x45415e);})['catch'](function(_0x56da96){logger[_0xd62d('0x13')](_0xd62d('0x18'),_0x56da96['message'],_0x2e4e97);_0x1e6996(_0x81ff3a['error'](0x1f4,_0x56da96[_0xd62d('0x14')]));});});};exports[_0xd62d('0x1f')]=function(_0x2642be){return new Promise(function(_0x3c2e03,_0x4dc94b){return db['WhatsappInteraction']['find']({'where':_0x2642be[_0xd62d('0x1a')]?_0x2642be[_0xd62d('0x1a')][_0xd62d('0x1c')]||null:null})[_0xd62d('0xe')](function(_0x219034){if(_0x219034){return _0x219034[_0xd62d('0x20')](_0x2642be[_0xd62d('0x21')][_0xd62d('0x22')],_[_0xd62d('0x23')](_0x2642be[_0xd62d('0x21')],[_0xd62d('0x22'),'id'])||{});}})[_0xd62d('0x24')](function(_0x316c62){logger[_0xd62d('0x15')]('AddTags',_0x2642be);logger['debug'](_0xd62d('0x25'),_0x2642be,JSON[_0xd62d('0x12')](_0x316c62));_0x3c2e03(_0x316c62);})[_0xd62d('0x17')](function(_0x1e612d){logger[_0xd62d('0x13')](_0xd62d('0x25'),_0x1e612d[_0xd62d('0x14')],_0x2642be);_0x4dc94b(_this[_0xd62d('0x13')](0x1f4,_0x1e612d[_0xd62d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 97e8d37..153774f 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 _0xa188=['whatsappInteraction:','save','remove','update','emit','register','length'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0xa188,0x1e4));var _0x8a18=function(_0x3ab601,_0x1872f6){_0x3ab601=_0x3ab601-0x0;var _0x563fd0=_0xa188[_0x3ab601];return _0x563fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x8a18('0x0'),_0x8a18('0x1'),_0x8a18('0x2')];function createListener(_0x24e686,_0x53bcb9){return function(_0x7d19f2){_0x53bcb9[_0x8a18('0x3')](_0x24e686,_0x7d19f2);};}function removeListener(_0x26d70c,_0x11cc69){return function(){WhatsappInteractionEvents['removeListener'](_0x26d70c,_0x11cc69);};}exports[_0x8a18('0x4')]=function(_0x17235e){for(var _0x3c50a2=0x0,_0x5b838f=events[_0x8a18('0x5')];_0x3c50a2<_0x5b838f;_0x3c50a2++){var _0x1b2513=events[_0x3c50a2];var _0x546969=createListener(_0x8a18('0x6')+_0x1b2513,_0x17235e);WhatsappInteractionEvents['on'](_0x1b2513,_0x546969);}}; \ No newline at end of file +var _0xabfe=['save','update','emit','removeListener','register','length','whatsappInteraction:'];(function(_0x48219f,_0x54499b){var _0x511a71=function(_0x46dc5a){while(--_0x46dc5a){_0x48219f['push'](_0x48219f['shift']());}};_0x511a71(++_0x54499b);}(_0xabfe,0xcb));var _0xeabf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xabfe[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xeabf('0x0'),'remove',_0xeabf('0x1')];function createListener(_0x24692e,_0x378e43){return function(_0x5601ee){_0x378e43[_0xeabf('0x2')](_0x24692e,_0x5601ee);};}function removeListener(_0x112503,_0x5129d5){return function(){WhatsappInteractionEvents[_0xeabf('0x3')](_0x112503,_0x5129d5);};}exports[_0xeabf('0x4')]=function(_0x2298d2){for(var _0x5c9547=0x0,_0x5dc9f1=events[_0xeabf('0x5')];_0x5c9547<_0x5dc9f1;_0x5c9547++){var _0x252568=events[_0x5c9547];var _0x51d0aa=createListener(_0xeabf('0x6')+_0x252568,_0x2298d2);WhatsappInteractionEvents['on'](_0x252568,_0x51d0aa);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f7b09de..aaa7b0b 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 _0x926c=['whatsapp','whatsappmessage:create','post','/:id/status','status','put','/:id','update','/:id/accept','accept','/:id/reject','reject','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller','get','index','isAuthenticated','describe','show','tracked'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x926c,0x9a));var _0xc926=function(_0x174bd5,_0x1acf5f){_0x174bd5=_0x174bd5-0x0;var _0x451adc=_0x926c[_0x174bd5];return _0x451adc;};'use strict';var multer=require('multer');var util=require(_0xc926('0x0'));var path=require(_0xc926('0x1'));var timeout=require(_0xc926('0x2'));var express=require(_0xc926('0x3'));var router=express['Router']();var fs_extra=require(_0xc926('0x4'));var auth=require(_0xc926('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc926('0x6'));var controller=require(_0xc926('0x7'));router[_0xc926('0x8')]('/',auth['isAuthenticated'](),controller[_0xc926('0x9')]);router['get']('/describe',auth[_0xc926('0xa')](),controller[_0xc926('0xb')]);router[_0xc926('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xc926('0xc')]);router['post']('/',auth[_0xc926('0xa')](),interaction[_0xc926('0xd')](_0xc926('0xe'),_0xc926('0xf')),controller['create']);router[_0xc926('0x10')](_0xc926('0x11'),controller[_0xc926('0x12')]);router[_0xc926('0x13')](_0xc926('0x14'),auth[_0xc926('0xa')](),controller[_0xc926('0x15')]);router[_0xc926('0x13')](_0xc926('0x16'),auth[_0xc926('0xa')](),controller[_0xc926('0x17')]);router['put'](_0xc926('0x18'),auth['isAuthenticated'](),controller[_0xc926('0x19')]);router[_0xc926('0x1a')](_0xc926('0x14'),auth[_0xc926('0xa')](),controller['destroy']);module[_0xc926('0x1b')]=router; \ No newline at end of file +var _0x6976=['get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsappmessage:create','/:id/status','status','put','/:id/accept','accept','/:id/reject','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xed4881,_0x45771c){var _0x7fcbd5=function(_0x36b960){while(--_0x36b960){_0xed4881['push'](_0xed4881['shift']());}};_0x7fcbd5(++_0x45771c);}(_0x6976,0x170));var _0x6697=function(_0x27831e,_0x58d291){_0x27831e=_0x27831e-0x0;var _0x33f4b5=_0x6976[_0x27831e];return _0x33f4b5;};'use strict';var multer=require('multer');var util=require(_0x6697('0x0'));var path=require(_0x6697('0x1'));var timeout=require(_0x6697('0x2'));var express=require('express');var router=express[_0x6697('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6697('0x4'));var interaction=require(_0x6697('0x5'));var config=require(_0x6697('0x6'));var controller=require('./whatsappMessage.controller');router[_0x6697('0x7')]('/',auth[_0x6697('0x8')](),controller[_0x6697('0x9')]);router[_0x6697('0x7')](_0x6697('0xa'),auth[_0x6697('0x8')](),controller['describe']);router['get'](_0x6697('0xb'),auth['isAuthenticated'](),controller[_0x6697('0xc')]);router[_0x6697('0xd')]('/',auth[_0x6697('0x8')](),interaction[_0x6697('0xe')]('whatsapp',_0x6697('0xf')),controller['create']);router['post'](_0x6697('0x10'),controller[_0x6697('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6697('0x12')](_0x6697('0x13'),auth[_0x6697('0x8')](),controller[_0x6697('0x14')]);router['put'](_0x6697('0x15'),auth['isAuthenticated'](),controller['reject']);router[_0x6697('0x16')](_0x6697('0xb'),auth[_0x6697('0x8')](),controller[_0x6697('0x17')]);module[_0x6697('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index d0da0f2..ff569e3 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 _0x3d99=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x395812,_0x70f0ca){var _0x14516f=function(_0x28b75d){while(--_0x28b75d){_0x395812['push'](_0x395812['shift']());}};_0x14516f(++_0x70f0ca);}(_0x3d99,0xa1));var _0x93d9=function(_0x2b5469,_0xe9c6cb){_0x2b5469=_0x2b5469-0x0;var _0x4298a7=_0x3d99[_0x2b5469];return _0x4298a7;};'use strict';var Sequelize=require(_0x93d9('0x0'));module['exports']={'body':{'type':Sequelize[_0x93d9('0x1')](_0x93d9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x93d9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x93d9('0x4')]('in','out'),'defaultValue':_0x93d9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x93d9('0x6')](0xbe)},'phone':{'type':Sequelize[_0x93d9('0x6')]},'readAt':{'type':Sequelize[_0x93d9('0x7')]},'secret':{'type':Sequelize[_0x93d9('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x93d9('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb764=['medium','BOOLEAN','ENUM','out','STRING','sequelize','TEXT'];(function(_0x10490e,_0x4df0d9){var _0x35023c=function(_0x32b0c1){while(--_0x32b0c1){_0x10490e['push'](_0x10490e['shift']());}};_0x35023c(++_0x4df0d9);}(_0xb764,0x11d));var _0x4b76=function(_0x4c8ef8,_0x58a9cf){_0x4c8ef8=_0x4c8ef8-0x0;var _0x343b72=_0xb764[_0x4c8ef8];return _0x343b72;};'use strict';var Sequelize=require(_0x4b76('0x0'));module['exports']={'body':{'type':Sequelize[_0x4b76('0x1')](_0x4b76('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x4b76('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b76('0x4')]('in','out'),'defaultValue':_0x4b76('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4b76('0x6')](0xbe)},'phone':{'type':Sequelize[_0x4b76('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x4b76('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x4b76('0x6')]},'providerResponse':{'type':Sequelize[_0x4b76('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 076c802..3fd10d8 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 _0x6985=['sendStatus','status','end','undefined','count','offset','limit','set','json','reject','save','update','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','WhatsappMessage','fields','include','find','create','body','destroy','describe','../../config/logger','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','whatsapp-interactions','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','SELECT','contact','User','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappMessage.socket','register','jayson/promise','client','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x342138,_0x20d7b3){var _0x34643f=function(_0x3c697f){while(--_0x3c697f){_0x342138['push'](_0x342138['shift']());}};_0x34643f(++_0x20d7b3);}(_0x6985,0x67));var _0x5698=function(_0x5880a5,_0x177817){_0x5880a5=_0x5880a5-0x0;var _0xe09e8=_0x6985[_0x5880a5];return _0xe09e8;};'use strict';var emlformat=require(_0x5698('0x0'));var rimraf=require(_0x5698('0x1'));var zipdir=require(_0x5698('0x2'));var jsonpatch=require(_0x5698('0x3'));var rp=require(_0x5698('0x4'));var moment=require(_0x5698('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5698('0x6'));var util=require(_0x5698('0x7'));var path=require(_0x5698('0x8'));var sox=require(_0x5698('0x9'));var csv=require('to-csv');var ejs=require(_0x5698('0xa'));var fs=require('fs');var fs_extra=require(_0x5698('0xb'));var _=require(_0x5698('0xc'));var squel=require(_0x5698('0xd'));var crypto=require(_0x5698('0xe'));var jsforce=require(_0x5698('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5698('0x10'));var querystring=require(_0x5698('0x11'));var Papa=require(_0x5698('0x12'));var Redis=require(_0x5698('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x5698('0x14'));var as=require(_0x5698('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5698('0x16'));var licenseUtil=require(_0x5698('0x17'));var db=require(_0x5698('0x18'))['db'];config[_0x5698('0x19')]=_['defaults'](config[_0x5698('0x19')],{'host':_0x5698('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5698('0x19')]));require(_0x5698('0x1b'))[_0x5698('0x1c')](socket);var jayson=require(_0x5698('0x1d'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x5698('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aa8e0,_0x271a7f,_0x4448c5,_0x2c3b2f){return new BPromise(function(_0x3575b5,_0x48d00b){var _0x1555c0=_0x2c3b2f||client;return _0x1555c0[_0x5698('0x1f')](_0x3aa8e0,_0x4448c5)[_0x5698('0x20')](function(_0x4411a4){logger[_0x5698('0x21')](_0x5698('0x22'),_0x271a7f,_0x5698('0x23'));logger['debug'](_0x5698('0x24'),_0x271a7f,_0x5698('0x23'),JSON[_0x5698('0x25')](_0x4411a4));if(_0x4411a4['error']){if(_0x4411a4['error'][_0x5698('0x26')]===0x1f4){logger[_0x5698('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x271a7f,_0x4411a4['error'][_0x5698('0x28')]);return _0x48d00b(_0x4411a4[_0x5698('0x27')][_0x5698('0x28')]);}logger[_0x5698('0x27')](_0x5698('0x22'),_0x271a7f,_0x4411a4[_0x5698('0x27')][_0x5698('0x28')]);return _0x3575b5(_0x4411a4[_0x5698('0x27')][_0x5698('0x28')]);}else{logger[_0x5698('0x21')](_0x5698('0x22'),_0x271a7f,'request\x20sent');_0x3575b5(_0x4411a4['result'][_0x5698('0x28')]);}})['catch'](function(_0x4bb0c7){logger[_0x5698('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x271a7f,_0x4bb0c7);_0x48d00b(_0x4bb0c7);});});}function respondWithStatusCode(_0x5cd6b9,_0x54cf0b){_0x54cf0b=_0x54cf0b||0xcc;return function(_0x31b4ad){if(_0x31b4ad){return _0x5cd6b9[_0x5698('0x29')](_0x54cf0b);}return _0x5cd6b9[_0x5698('0x2a')](_0x54cf0b)[_0x5698('0x2b')]();};}function respondWithResult(_0x5f0c3d,_0x362bf1){_0x362bf1=_0x362bf1||0xc8;return function(_0x31a901){if(_0x31a901){return _0x5f0c3d[_0x5698('0x2a')](_0x362bf1)['json'](_0x31a901);}};}function respondWithFilteredResult(_0x58e9bb,_0x36177e){return function(_0x503262){if(_0x503262){var _0xfea92c=typeof _0x36177e['offset']===_0x5698('0x2c')&&typeof _0x36177e['limit']===_0x5698('0x2c');var _0x16ec96=_0x503262[_0x5698('0x2d')];var _0x1ecbc6=_0xfea92c?0x0:_0x36177e[_0x5698('0x2e')];var _0x30d2b5=_0xfea92c?_0x503262[_0x5698('0x2d')]:_0x36177e[_0x5698('0x2e')]+_0x36177e[_0x5698('0x2f')];var _0x180dd3;if(_0x30d2b5>=_0x16ec96){_0x30d2b5=_0x16ec96;_0x180dd3=0xc8;}else{_0x180dd3=0xce;}_0x58e9bb['status'](_0x180dd3);return _0x58e9bb[_0x5698('0x30')]('Content-Range',_0x1ecbc6+'-'+_0x30d2b5+'/'+_0x16ec96)[_0x5698('0x31')](_0x503262);}return null;};}function patchUpdates(_0x448481){return function(_0x557d63){try{jsonpatch['apply'](_0x557d63,_0x448481,!![]);}catch(_0x5a683d){return BPromise[_0x5698('0x32')](_0x5a683d);}return _0x557d63[_0x5698('0x33')]();};}function saveUpdates(_0x5f0fe5,_0x26f548){return function(_0x3f9363){if(_0x3f9363){return _0x3f9363[_0x5698('0x34')](_0x5f0fe5)['then'](function(_0x77c88f){return _0x77c88f;});}return null;};}function removeEntity(_0x1db9a0,_0x160aa8){return function(_0xbe7315){if(_0xbe7315){return _0xbe7315['destroy']()[_0x5698('0x20')](function(){_0x1db9a0[_0x5698('0x2a')](0xcc)[_0x5698('0x2b')]();});}};}function handleEntityNotFound(_0x14a89f,_0x2b7b85){return function(_0x219840){if(!_0x219840){_0x14a89f['sendStatus'](0x194);}return _0x219840;};}function handleError(_0x2896b7,_0x2adcd2){_0x2adcd2=_0x2adcd2||0x1f4;return function(_0x4b58e2){logger['error'](_0x4b58e2['stack']);if(_0x4b58e2[_0x5698('0x35')]){delete _0x4b58e2[_0x5698('0x35')];}_0x2896b7[_0x5698('0x2a')](_0x2adcd2)['send'](_0x4b58e2);};}exports[_0x5698('0x36')]=function(_0x22f382,_0x1ea3dc){var _0x40385e={},_0x499d84={},_0x567572={'count':0x0,'rows':[]};var _0x2e72ec=_[_0x5698('0x37')](db['WhatsappMessage'][_0x5698('0x38')],function(_0x1f9142){return{'name':_0x1f9142[_0x5698('0x39')],'type':_0x1f9142['type'][_0x5698('0x3a')]};});_0x499d84[_0x5698('0x3b')]=_['map'](_0x2e72ec,_0x5698('0x35'));_0x499d84[_0x5698('0x3c')]=_[_0x5698('0x3d')](_0x22f382['query']);_0x499d84[_0x5698('0x3e')]=_[_0x5698('0x3f')](_0x499d84['model'],_0x499d84['query']);_0x40385e['attributes']=_[_0x5698('0x3f')](_0x499d84[_0x5698('0x3b')],qs['fields'](_0x22f382[_0x5698('0x3c')]['fields']));_0x40385e['attributes']=_0x40385e[_0x5698('0x40')][_0x5698('0x41')]?_0x40385e['attributes']:_0x499d84['model'];if(!_0x22f382['query'][_0x5698('0x42')](_0x5698('0x43'))){_0x40385e[_0x5698('0x2f')]=qs[_0x5698('0x2f')](_0x22f382[_0x5698('0x3c')][_0x5698('0x2f')]);_0x40385e[_0x5698('0x2e')]=qs[_0x5698('0x2e')](_0x22f382['query'][_0x5698('0x2e')]);}_0x40385e[_0x5698('0x44')]=qs[_0x5698('0x45')](_0x22f382[_0x5698('0x3c')]['sort']);_0x40385e[_0x5698('0x46')]=qs[_0x5698('0x3e')](_[_0x5698('0x47')](_0x22f382[_0x5698('0x3c')],_0x499d84[_0x5698('0x3e')]),_0x2e72ec);if(_0x22f382[_0x5698('0x3c')][_0x5698('0x48')]){_0x40385e[_0x5698('0x46')]=_[_0x5698('0x49')](_0x40385e[_0x5698('0x46')],{'$or':_[_0x5698('0x37')](_0x2e72ec,function(_0x12ea46){if(_0x12ea46[_0x5698('0x4a')]!=='VIRTUAL'){var _0x325d94={};_0x325d94[_0x12ea46['name']]={'$like':'%'+_0x22f382[_0x5698('0x3c')][_0x5698('0x48')]+'%'};return _0x325d94;}})});}_0x40385e=_[_0x5698('0x49')]({},_0x40385e,_0x22f382[_0x5698('0x4b')]);var _0x4a90cd={'where':_0x40385e['where']};return db['WhatsappMessage'][_0x5698('0x2d')](_0x4a90cd)[_0x5698('0x20')](function(_0x1313e1){_0x567572['count']=_0x1313e1;if(_0x22f382[_0x5698('0x3c')][_0x5698('0x4c')]){_0x40385e['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x5698('0x4d')](_0x40385e);})[_0x5698('0x20')](function(_0x4d02b6){_0x567572[_0x5698('0x4e')]=_0x4d02b6;return _0x567572;})['then'](respondWithFilteredResult(_0x1ea3dc,_0x40385e))[_0x5698('0x4f')](handleError(_0x1ea3dc,null));};exports[_0x5698('0x50')]=function(_0x5a831e,_0x4091af){var _0x33080f={'raw':!![],'where':{'id':_0x5a831e[_0x5698('0x51')]['id']}},_0x2b3237={};_0x2b3237[_0x5698('0x3b')]=_[_0x5698('0x3d')](db[_0x5698('0x52')][_0x5698('0x38')]);_0x2b3237[_0x5698('0x3c')]=_[_0x5698('0x3d')](_0x5a831e[_0x5698('0x3c')]);_0x2b3237['filters']=_[_0x5698('0x3f')](_0x2b3237[_0x5698('0x3b')],_0x2b3237[_0x5698('0x3c')]);_0x33080f[_0x5698('0x40')]=_[_0x5698('0x3f')](_0x2b3237[_0x5698('0x3b')],qs[_0x5698('0x53')](_0x5a831e[_0x5698('0x3c')][_0x5698('0x53')]));_0x33080f[_0x5698('0x40')]=_0x33080f['attributes'][_0x5698('0x41')]?_0x33080f[_0x5698('0x40')]:_0x2b3237[_0x5698('0x3b')];if(_0x5a831e[_0x5698('0x3c')][_0x5698('0x4c')]){_0x33080f[_0x5698('0x54')]=[{'all':!![]}];}_0x33080f=_[_0x5698('0x49')]({},_0x33080f,_0x5a831e[_0x5698('0x4b')]);return db[_0x5698('0x52')][_0x5698('0x55')](_0x33080f)[_0x5698('0x20')](handleEntityNotFound(_0x4091af,null))['then'](respondWithResult(_0x4091af,null))[_0x5698('0x4f')](handleError(_0x4091af,null));};exports['create']=function(_0x1e2728,_0x70f9f6){return db['WhatsappMessage'][_0x5698('0x56')](_0x1e2728[_0x5698('0x57')],{})[_0x5698('0x20')](respondWithResult(_0x70f9f6,0xc9))[_0x5698('0x4f')](handleError(_0x70f9f6,null));};exports[_0x5698('0x34')]=function(_0x3869f9,_0x11a6af){if(_0x3869f9['body']['id']){delete _0x3869f9['body']['id'];}return db[_0x5698('0x52')][_0x5698('0x55')]({'where':{'id':_0x3869f9[_0x5698('0x51')]['id']}})[_0x5698('0x20')](handleEntityNotFound(_0x11a6af,null))[_0x5698('0x20')](saveUpdates(_0x3869f9[_0x5698('0x57')],null))[_0x5698('0x20')](respondWithResult(_0x11a6af,null))[_0x5698('0x4f')](handleError(_0x11a6af,null));};exports[_0x5698('0x58')]=function(_0x4c4019,_0x5bc7dc){return db[_0x5698('0x52')]['find']({'where':{'id':_0x4c4019['params']['id']}})[_0x5698('0x20')](handleEntityNotFound(_0x5bc7dc,null))['then'](removeEntity(_0x5bc7dc,null))[_0x5698('0x4f')](handleError(_0x5bc7dc,null));};exports[_0x5698('0x59')]=function(_0x18c7fe,_0x352611){return db[_0x5698('0x52')][_0x5698('0x59')]()[_0x5698('0x20')](respondWithResult(_0x352611,null))[_0x5698('0x4f')](handleError(_0x352611,null));};var interaction_log=require(_0x5698('0x5a'))('whatsapp-interactions');exports['accept']=function(_0x157bed,_0xb66221,_0xc60cdc){var _0x730e34={'agent':{},'channel':'whatsapp'};if(_0x157bed[_0x5698('0x57')]['id']){delete _0x157bed[_0x5698('0x57')]['id'];}_0x157bed[_0x5698('0x57')]['read']=!![];_0x157bed['body'][_0x5698('0x5b')]=moment()[_0x5698('0x5c')](_0x5698('0x5d'));_0x157bed[_0x5698('0x57')][_0x5698('0x5e')]=_0x157bed[_0x5698('0x57')][_0x5698('0x5e')]||_0x157bed[_0x5698('0x5f')]['id'];_0x730e34[_0x5698('0x60')]['id']=_0x157bed[_0x5698('0x57')][_0x5698('0x5e')];return db[_0x5698('0x52')][_0x5698('0x55')]({'where':{'id':_0x157bed[_0x5698('0x51')]['id'],'UserId':null}})[_0x5698('0x20')](handleEntityNotFound(_0xb66221,null))[_0x5698('0x20')](saveUpdates(_0x157bed[_0x5698('0x57')],null))[_0x5698('0x20')](function(_0x2f241f){if(_0x2f241f){_0x730e34[_0x5698('0x28')]=_0x2f241f[_0x5698('0x61')]({'plain':!![]});return db[_0x5698('0x62')][_0x5698('0x55')]({'where':{'id':_0x2f241f[_0x5698('0x63')]}});}return null;})['then'](handleEntityNotFound(_0xb66221,null))['then'](function(_0x23bbed){if(_0x23bbed){return _0x23bbed[_0x5698('0x34')]({'UserId':_0x157bed[_0x5698('0x57')][_0x5698('0x5e')],'read1stAt':_[_0x5698('0x64')](_0x23bbed[_0x5698('0x65')])?moment()['format'](_0x5698('0x5d')):undefined});}return null;})[_0x5698('0x20')](function(_0x384ae9){if(_0x384ae9){_0x730e34[_0x5698('0x66')]=_0x384ae9[_0x5698('0x61')]({'plain':!![]});interaction_log[_0x5698('0x21')](_0x5698('0x67'),_0x157bed[_0x5698('0x5f')]['id'],_0x157bed[_0x5698('0x5f')][_0x5698('0x35')],_0x157bed['user'][_0x5698('0x68')],_0x730e34['interaction']['id'],_0x157bed[_0x5698('0x57')]?JSON[_0x5698('0x25')](_0x157bed[_0x5698('0x57')]):_0x5698('0x69'));return respondWithRpcPromise(_0x5698('0x6a'),_0x5698('0x6b'),_0x730e34);}return null;})[_0x5698('0x20')](function(_0x5ee6a7){var _0x112e0b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5ee6a7[_0x5698('0x28')][_0x5698('0x6c')];return db[_0x5698('0x6d')][_0x5698('0x3c')](_0x112e0b,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x5698('0x20')](function(_0x75b427){return _0x75b427;});})[_0x5698('0x20')](function(_0x367096){if(_0x367096){_0x730e34['message']['contact']=_0x367096[0x0];if(!_0x157bed[_0x5698('0x57')][_0x5698('0x5e')])return;return db['User']['find']({'where':{'id':_0x157bed[_0x5698('0x57')][_0x5698('0x5e')],'role':_0x5698('0x60')},'attributes':['id',_0x5698('0x35'),_0x5698('0x6e'),_0x5698('0x6f'),_0x5698('0x70')],'raw':!![]});}return null;})[_0x5698('0x20')](function(_0x59c489){if(!_0x59c489)return null;_0x730e34['message'][_0x5698('0x60')]=_0x59c489;return _0x730e34;})[_0x5698('0x20')](function(_0x2b63da){if(_0x2b63da){if(_0x157bed[_0x5698('0x57')][_0x5698('0x71')]){_0x730e34[_0x5698('0x28')][_0x5698('0x72')]=util[_0x5698('0x5c')](_0x5698('0x73'),_0x157bed[_0x5698('0x5f')][_0x5698('0x35')]);_0x730e34['message']['channel']=_0x730e34[_0x5698('0x74')];_0x730e34['message'][_0x5698('0x75')]=_0x730e34[_0x5698('0x74')];_0x730e34[_0x5698('0x28')][_0x5698('0x76')]=_0x5698('0x77');return respondWithRpcPromise('EventManager',_0x5698('0x78'),{'event':'acceptmessage','message':_0x730e34['message']},client9002)['then'](function(){return _0x730e34;});}return _0x730e34;}return null;})[_0x5698('0x20')](respondWithResult(_0xb66221,null))['catch'](handleError(_0xb66221,null));};var interaction_log=require(_0x5698('0x5a'))(_0x5698('0x79'));exports[_0x5698('0x32')]=function(_0x4d3b66,_0x5c7ea1,_0x31fa80){var _0x1aa3f4={'agent':{},'channel':_0x5698('0x7a')};if(_0x4d3b66[_0x5698('0x57')]['id']){delete _0x4d3b66[_0x5698('0x57')]['id'];}_0x4d3b66['body'][_0x5698('0x5e')]=_0x4d3b66[_0x5698('0x57')][_0x5698('0x5e')]||_0x4d3b66['user']['id'];_0x1aa3f4[_0x5698('0x60')]['id']=_0x4d3b66[_0x5698('0x57')]['UserId'];return db['WhatsappMessage'][_0x5698('0x55')]({'where':{'id':_0x4d3b66['params']['id'],'UserId':null}})[_0x5698('0x20')](handleEntityNotFound(_0x5c7ea1,null))[_0x5698('0x20')](function(_0x29b657){if(_0x29b657){_0x1aa3f4[_0x5698('0x28')]=_0x29b657['get']({'plain':!![]});return db[_0x5698('0x62')][_0x5698('0x55')]({'where':{'id':_0x29b657[_0x5698('0x63')]}});}return null;})[_0x5698('0x20')](handleEntityNotFound(_0x5c7ea1,null))[_0x5698('0x20')](function(_0x777948){if(_0x777948){_0x1aa3f4[_0x5698('0x66')]=_0x777948[_0x5698('0x61')]({'plain':!![]});interaction_log[_0x5698('0x21')](_0x5698('0x7b'),_0x4d3b66[_0x5698('0x5f')]['id'],_0x4d3b66['user'][_0x5698('0x35')],_0x4d3b66['user'][_0x5698('0x68')],_0x1aa3f4[_0x5698('0x66')]['id'],_0x4d3b66['body']?JSON[_0x5698('0x25')](_0x4d3b66['body']):_0x5698('0x69'));return respondWithRpcPromise(_0x5698('0x7c'),_0x5698('0x7d'),_0x1aa3f4);}return null;})[_0x5698('0x20')](function(_0x120ed7){var _0x17c41e=_0x5698('0x7e')+_0x120ed7[_0x5698('0x28')][_0x5698('0x6c')];return db[_0x5698('0x6d')][_0x5698('0x3c')](_0x17c41e,{'type':db[_0x5698('0x7f')]['QueryTypes'][_0x5698('0x80')],'raw':!![]})[_0x5698('0x20')](function(_0x45ef41){return _0x45ef41;});})[_0x5698('0x20')](function(_0x18a0e6){if(_0x18a0e6){_0x1aa3f4[_0x5698('0x28')][_0x5698('0x81')]=_0x18a0e6[0x0];if(!_0x4d3b66[_0x5698('0x57')][_0x5698('0x5e')])return;return db[_0x5698('0x82')]['find']({'where':{'id':_0x4d3b66[_0x5698('0x57')][_0x5698('0x5e')],'role':_0x5698('0x60')},'attributes':['id',_0x5698('0x35'),_0x5698('0x6e'),_0x5698('0x6f'),_0x5698('0x70')],'raw':!![]});}return null;})[_0x5698('0x20')](function(_0xb19dce){if(!_0xb19dce)return null;_0x1aa3f4[_0x5698('0x28')][_0x5698('0x60')]=_0xb19dce;return _0x1aa3f4;})['then'](function(_0xb35f7f){if(_0xb35f7f){_0xb35f7f[_0x5698('0x28')][_0x5698('0x72')]=util['format'](_0x5698('0x73'),_0x4d3b66[_0x5698('0x5f')][_0x5698('0x35')]);_0xb35f7f[_0x5698('0x28')][_0x5698('0x74')]=_0x1aa3f4[_0x5698('0x74')];_0xb35f7f[_0x5698('0x28')][_0x5698('0x75')]=_0x1aa3f4[_0x5698('0x74')];_0xb35f7f['message'][_0x5698('0x76')]=_0x5698('0x32');respondWithRpcPromise(_0x5698('0x78'),_0x5698('0x78'),{'event':_0x5698('0x83'),'message':_0xb35f7f[_0x5698('0x28')]},client9002);return _0x1aa3f4;}return null;})[_0x5698('0x20')](respondWithResult(_0x5c7ea1,null))[_0x5698('0x4f')](handleError(_0x5c7ea1,null));};exports[_0x5698('0x2a')]=function(_0x3f4761,_0x6b2fc0,_0x1138b4){if(_0x3f4761[_0x5698('0x57')]['id']){delete _0x3f4761[_0x5698('0x57')]['id'];}var _0x1fe368;return db[_0x5698('0x52')][_0x5698('0x55')]({'where':{'id':_0x3f4761['params']['id']}})[_0x5698('0x20')](handleEntityNotFound(_0x6b2fc0,null))[_0x5698('0x20')](function(_0x5cc925){if(_0x5cc925){_0x1fe368=_0x5cc925;return db[_0x5698('0x84')][_0x5698('0x55')]({'where':{'id':_0x5cc925[_0x5698('0x85')]}});}})['then'](handleEntityNotFound(_0x6b2fc0,null))['then'](function(_0x5f4b97){if(_0x5f4b97){logger[_0x5698('0x86')](_0x5698('0x87'),_0x5698('0x2a'),_0x5698('0x88'),_0x5f4b97['type'],util['inspect'](_0x3f4761['body'],{'showHidden':![],'depth':null}));switch(_0x5f4b97[_0x5698('0x4a')]){case _0x5698('0x89'):if(_0x3f4761[_0x5698('0x57')][_0x5698('0x8a')]&&_0x3f4761['body'][_0x5698('0x8a')]===_0x1fe368[_0x5698('0x8b')]&&_0x3f4761[_0x5698('0x57')][_0x5698('0x8c')]&&_0x3f4761[_0x5698('0x57')][_0x5698('0x8c')]===_0x5698('0x8d')){return _0x1fe368[_0x5698('0x34')]({'read':!![]});}else{logger[_0x5698('0x27')](_0x5698('0x8e'),_0x5698('0x2a'),_0x5698('0x89'),util[_0x5698('0x8f')](_0x3f4761[_0x5698('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1fe368;}})['then'](respondWithResult(_0x6b2fc0,null))[_0x5698('0x4f')](handleError(_0x6b2fc0,null));}; \ No newline at end of file +var _0x0cee=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./whatsappMessage.socket','register','jayson/promise','client','http','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','stack','name','send','WhatsappMessage','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','find','body','destroy','describe','whatsapp-interactions','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteraction','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','email','internal','manual','interface','format','SIP/%s','motionChannel','channel','event','accept','EventManager','acceptmessage','get','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','QueryTypes','User','fullname','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','inspect','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel'];(function(_0x539dd2,_0x3fb9eb){var _0x2168ff=function(_0x5154a0){while(--_0x5154a0){_0x539dd2['push'](_0x539dd2['shift']());}};_0x2168ff(++_0x3fb9eb);}(_0x0cee,0x113));var _0xe0ce=function(_0x17a474,_0x157633){_0x17a474=_0x17a474-0x0;var _0x1557fc=_0x0cee[_0x17a474];return _0x1557fc;};'use strict';var emlformat=require(_0xe0ce('0x0'));var rimraf=require(_0xe0ce('0x1'));var zipdir=require(_0xe0ce('0x2'));var jsonpatch=require(_0xe0ce('0x3'));var rp=require(_0xe0ce('0x4'));var moment=require(_0xe0ce('0x5'));var BPromise=require(_0xe0ce('0x6'));var Mustache=require('mustache');var util=require(_0xe0ce('0x7'));var path=require(_0xe0ce('0x8'));var sox=require('sox');var csv=require(_0xe0ce('0x9'));var ejs=require(_0xe0ce('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0ce('0xb'));var squel=require(_0xe0ce('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0ce('0xd'));var deskjs=require(_0xe0ce('0xe'));var toCsv=require(_0xe0ce('0x9'));var querystring=require(_0xe0ce('0xf'));var Papa=require(_0xe0ce('0x10'));var Redis=require(_0xe0ce('0x11'));var authService=require(_0xe0ce('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe0ce('0x13'));var hardwareService=require(_0xe0ce('0x14'));var logger=require(_0xe0ce('0x15'))('api');var utils=require(_0xe0ce('0x16'));var config=require(_0xe0ce('0x17'));var licenseUtil=require(_0xe0ce('0x18'));var db=require(_0xe0ce('0x19'))['db'];config[_0xe0ce('0x1a')]=_[_0xe0ce('0x1b')](config[_0xe0ce('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe0ce('0x1a')]));require(_0xe0ce('0x1c'))[_0xe0ce('0x1d')](socket);var jayson=require(_0xe0ce('0x1e'));var client=jayson[_0xe0ce('0x1f')][_0xe0ce('0x20')]({'port':0x232c});var client9002=jayson[_0xe0ce('0x1f')][_0xe0ce('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x3e9c2b,_0xa1b6b,_0x2591fd,_0x163254){return new BPromise(function(_0x31decf,_0x164ee1){var _0x177c65=_0x163254||client;return _0x177c65['request'](_0x3e9c2b,_0x2591fd)[_0xe0ce('0x21')](function(_0x12ccdc){logger['info'](_0xe0ce('0x22'),_0xa1b6b,'request\x20sent');logger[_0xe0ce('0x23')](_0xe0ce('0x24'),_0xa1b6b,_0xe0ce('0x25'),JSON[_0xe0ce('0x26')](_0x12ccdc));if(_0x12ccdc[_0xe0ce('0x27')]){if(_0x12ccdc[_0xe0ce('0x27')][_0xe0ce('0x28')]===0x1f4){logger[_0xe0ce('0x27')](_0xe0ce('0x22'),_0xa1b6b,_0x12ccdc[_0xe0ce('0x27')][_0xe0ce('0x29')]);return _0x164ee1(_0x12ccdc[_0xe0ce('0x27')][_0xe0ce('0x29')]);}logger[_0xe0ce('0x27')](_0xe0ce('0x22'),_0xa1b6b,_0x12ccdc['error'][_0xe0ce('0x29')]);return _0x31decf(_0x12ccdc['error'][_0xe0ce('0x29')]);}else{logger[_0xe0ce('0x2a')]('WhatsappMessage,\x20%s,\x20%s',_0xa1b6b,_0xe0ce('0x25'));_0x31decf(_0x12ccdc[_0xe0ce('0x2b')][_0xe0ce('0x29')]);}})['catch'](function(_0x133184){logger['error'](_0xe0ce('0x22'),_0xa1b6b,_0x133184);_0x164ee1(_0x133184);});});}function respondWithStatusCode(_0x39a5c3,_0x5e321e){_0x5e321e=_0x5e321e||0xcc;return function(_0x2a606b){if(_0x2a606b){return _0x39a5c3[_0xe0ce('0x2c')](_0x5e321e);}return _0x39a5c3['status'](_0x5e321e)['end']();};}function respondWithResult(_0x44ee3a,_0x39acbc){_0x39acbc=_0x39acbc||0xc8;return function(_0x4bde12){if(_0x4bde12){return _0x44ee3a[_0xe0ce('0x2d')](_0x39acbc)[_0xe0ce('0x2e')](_0x4bde12);}};}function respondWithFilteredResult(_0x4b0f92,_0x386515){return function(_0xb48f57){if(_0xb48f57){var _0x38a97d=typeof _0x386515['offset']==='undefined'&&typeof _0x386515[_0xe0ce('0x2f')]===_0xe0ce('0x30');var _0x1105c2=_0xb48f57['count'];var _0x2e4345=_0x38a97d?0x0:_0x386515[_0xe0ce('0x31')];var _0xe1ab2=_0x38a97d?_0xb48f57[_0xe0ce('0x32')]:_0x386515[_0xe0ce('0x31')]+_0x386515['limit'];var _0x2c613d;if(_0xe1ab2>=_0x1105c2){_0xe1ab2=_0x1105c2;_0x2c613d=0xc8;}else{_0x2c613d=0xce;}_0x4b0f92['status'](_0x2c613d);return _0x4b0f92[_0xe0ce('0x33')](_0xe0ce('0x34'),_0x2e4345+'-'+_0xe1ab2+'/'+_0x1105c2)[_0xe0ce('0x2e')](_0xb48f57);}return null;};}function patchUpdates(_0x44d809){return function(_0x2632ed){try{jsonpatch[_0xe0ce('0x35')](_0x2632ed,_0x44d809,!![]);}catch(_0x58092f){return BPromise[_0xe0ce('0x36')](_0x58092f);}return _0x2632ed[_0xe0ce('0x37')]();};}function saveUpdates(_0x255001,_0x413770){return function(_0x5fc375){if(_0x5fc375){return _0x5fc375[_0xe0ce('0x38')](_0x255001)[_0xe0ce('0x21')](function(_0x3e23fc){return _0x3e23fc;});}return null;};}function removeEntity(_0x663130,_0x2bb436){return function(_0x1daa5f){if(_0x1daa5f){return _0x1daa5f['destroy']()[_0xe0ce('0x21')](function(){_0x663130[_0xe0ce('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x437546,_0x54d65d){return function(_0x2a198a){if(!_0x2a198a){_0x437546[_0xe0ce('0x2c')](0x194);}return _0x2a198a;};}function handleError(_0x4cd1a7,_0x466e36){_0x466e36=_0x466e36||0x1f4;return function(_0x3b0f50){logger[_0xe0ce('0x27')](_0x3b0f50[_0xe0ce('0x39')]);if(_0x3b0f50[_0xe0ce('0x3a')]){delete _0x3b0f50[_0xe0ce('0x3a')];}_0x4cd1a7['status'](_0x466e36)[_0xe0ce('0x3b')](_0x3b0f50);};}exports['index']=function(_0x28d49d,_0xb089ac){var _0x2259cf={},_0x24c942={},_0x49abd8={'count':0x0,'rows':[]};var _0x156963=_['map'](db[_0xe0ce('0x3c')]['rawAttributes'],function(_0x1162a3){return{'name':_0x1162a3[_0xe0ce('0x3d')],'type':_0x1162a3[_0xe0ce('0x3e')][_0xe0ce('0x3f')]};});_0x24c942[_0xe0ce('0x40')]=_[_0xe0ce('0x41')](_0x156963,_0xe0ce('0x3a'));_0x24c942[_0xe0ce('0x42')]=_[_0xe0ce('0x43')](_0x28d49d[_0xe0ce('0x42')]);_0x24c942[_0xe0ce('0x44')]=_[_0xe0ce('0x45')](_0x24c942['model'],_0x24c942[_0xe0ce('0x42')]);_0x2259cf[_0xe0ce('0x46')]=_['intersection'](_0x24c942[_0xe0ce('0x40')],qs[_0xe0ce('0x47')](_0x28d49d[_0xe0ce('0x42')][_0xe0ce('0x47')]));_0x2259cf[_0xe0ce('0x46')]=_0x2259cf[_0xe0ce('0x46')][_0xe0ce('0x48')]?_0x2259cf[_0xe0ce('0x46')]:_0x24c942[_0xe0ce('0x40')];if(!_0x28d49d[_0xe0ce('0x42')][_0xe0ce('0x49')](_0xe0ce('0x4a'))){_0x2259cf['limit']=qs[_0xe0ce('0x2f')](_0x28d49d['query'][_0xe0ce('0x2f')]);_0x2259cf[_0xe0ce('0x31')]=qs[_0xe0ce('0x31')](_0x28d49d['query'][_0xe0ce('0x31')]);}_0x2259cf[_0xe0ce('0x4b')]=qs[_0xe0ce('0x4c')](_0x28d49d['query'][_0xe0ce('0x4c')]);_0x2259cf[_0xe0ce('0x4d')]=qs[_0xe0ce('0x44')](_[_0xe0ce('0x4e')](_0x28d49d['query'],_0x24c942[_0xe0ce('0x44')]),_0x156963);if(_0x28d49d[_0xe0ce('0x42')][_0xe0ce('0x4f')]){_0x2259cf[_0xe0ce('0x4d')]=_[_0xe0ce('0x50')](_0x2259cf['where'],{'$or':_[_0xe0ce('0x41')](_0x156963,function(_0x479189){if(_0x479189[_0xe0ce('0x3e')]!==_0xe0ce('0x51')){var _0x4484f8={};_0x4484f8[_0x479189[_0xe0ce('0x3a')]]={'$like':'%'+_0x28d49d['query'][_0xe0ce('0x4f')]+'%'};return _0x4484f8;}})});}_0x2259cf=_[_0xe0ce('0x50')]({},_0x2259cf,_0x28d49d[_0xe0ce('0x52')]);var _0x31847b={'where':_0x2259cf[_0xe0ce('0x4d')]};return db['WhatsappMessage']['count'](_0x31847b)[_0xe0ce('0x21')](function(_0x52c618){_0x49abd8[_0xe0ce('0x32')]=_0x52c618;if(_0x28d49d['query'][_0xe0ce('0x53')]){_0x2259cf[_0xe0ce('0x54')]=[{'all':!![]}];}return db[_0xe0ce('0x3c')][_0xe0ce('0x55')](_0x2259cf);})['then'](function(_0x1ec9ad){_0x49abd8['rows']=_0x1ec9ad;return _0x49abd8;})[_0xe0ce('0x21')](respondWithFilteredResult(_0xb089ac,_0x2259cf))[_0xe0ce('0x56')](handleError(_0xb089ac,null));};exports[_0xe0ce('0x57')]=function(_0x22ea7c,_0x2c4ac1){var _0x181258={'raw':!![],'where':{'id':_0x22ea7c[_0xe0ce('0x58')]['id']}},_0x234af4={};_0x234af4[_0xe0ce('0x40')]=_[_0xe0ce('0x43')](db[_0xe0ce('0x3c')]['rawAttributes']);_0x234af4['query']=_[_0xe0ce('0x43')](_0x22ea7c['query']);_0x234af4[_0xe0ce('0x44')]=_[_0xe0ce('0x45')](_0x234af4['model'],_0x234af4['query']);_0x181258['attributes']=_[_0xe0ce('0x45')](_0x234af4['model'],qs[_0xe0ce('0x47')](_0x22ea7c['query'][_0xe0ce('0x47')]));_0x181258['attributes']=_0x181258['attributes'][_0xe0ce('0x48')]?_0x181258[_0xe0ce('0x46')]:_0x234af4[_0xe0ce('0x40')];if(_0x22ea7c[_0xe0ce('0x42')][_0xe0ce('0x53')]){_0x181258[_0xe0ce('0x54')]=[{'all':!![]}];}_0x181258=_[_0xe0ce('0x50')]({},_0x181258,_0x22ea7c[_0xe0ce('0x52')]);return db[_0xe0ce('0x3c')]['find'](_0x181258)['then'](handleEntityNotFound(_0x2c4ac1,null))[_0xe0ce('0x21')](respondWithResult(_0x2c4ac1,null))['catch'](handleError(_0x2c4ac1,null));};exports[_0xe0ce('0x59')]=function(_0x3a3c23,_0x50ea6a){return db[_0xe0ce('0x3c')][_0xe0ce('0x59')](_0x3a3c23['body'],{})[_0xe0ce('0x21')](respondWithResult(_0x50ea6a,0xc9))[_0xe0ce('0x56')](handleError(_0x50ea6a,null));};exports[_0xe0ce('0x38')]=function(_0x4f6af3,_0x41cd8e){if(_0x4f6af3['body']['id']){delete _0x4f6af3['body']['id'];}return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x4f6af3[_0xe0ce('0x58')]['id']}})[_0xe0ce('0x21')](handleEntityNotFound(_0x41cd8e,null))[_0xe0ce('0x21')](saveUpdates(_0x4f6af3[_0xe0ce('0x5b')],null))[_0xe0ce('0x21')](respondWithResult(_0x41cd8e,null))[_0xe0ce('0x56')](handleError(_0x41cd8e,null));};exports[_0xe0ce('0x5c')]=function(_0x28e366,_0x1a1bfe){return db[_0xe0ce('0x3c')]['find']({'where':{'id':_0x28e366['params']['id']}})[_0xe0ce('0x21')](handleEntityNotFound(_0x1a1bfe,null))[_0xe0ce('0x21')](removeEntity(_0x1a1bfe,null))[_0xe0ce('0x56')](handleError(_0x1a1bfe,null));};exports[_0xe0ce('0x5d')]=function(_0x37ee1c,_0x15f19e){return db[_0xe0ce('0x3c')][_0xe0ce('0x5d')]()['then'](respondWithResult(_0x15f19e,null))[_0xe0ce('0x56')](handleError(_0x15f19e,null));};var interaction_log=require(_0xe0ce('0x15'))(_0xe0ce('0x5e'));exports['accept']=function(_0x38076e,_0x3f7f50,_0x1bee19){var _0x49121f={'agent':{},'channel':_0xe0ce('0x5f')};if(_0x38076e[_0xe0ce('0x5b')]['id']){delete _0x38076e['body']['id'];}_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x60')]=!![];_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x61')]=moment()['format'](_0xe0ce('0x62'));_0x38076e[_0xe0ce('0x5b')]['UserId']=_0x38076e['body'][_0xe0ce('0x63')]||_0x38076e[_0xe0ce('0x64')]['id'];_0x49121f[_0xe0ce('0x65')]['id']=_0x38076e['body'][_0xe0ce('0x63')];return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x38076e[_0xe0ce('0x58')]['id'],'UserId':null}})[_0xe0ce('0x21')](handleEntityNotFound(_0x3f7f50,null))[_0xe0ce('0x21')](saveUpdates(_0x38076e['body'],null))['then'](function(_0x44ca48){if(_0x44ca48){_0x49121f[_0xe0ce('0x29')]=_0x44ca48['get']({'plain':!![]});return db[_0xe0ce('0x66')][_0xe0ce('0x5a')]({'where':{'id':_0x44ca48['WhatsappInteractionId']}});}return null;})[_0xe0ce('0x21')](handleEntityNotFound(_0x3f7f50,null))[_0xe0ce('0x21')](function(_0x5f0d43){if(_0x5f0d43){return _0x5f0d43[_0xe0ce('0x38')]({'UserId':_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x63')],'read1stAt':_[_0xe0ce('0x67')](_0x5f0d43[_0xe0ce('0x68')])?moment()['format'](_0xe0ce('0x62')):undefined});}return null;})['then'](function(_0x151e55){if(_0x151e55){_0x49121f['interaction']=_0x151e55['get']({'plain':!![]});interaction_log['info'](_0xe0ce('0x69'),_0x38076e[_0xe0ce('0x64')]['id'],_0x38076e[_0xe0ce('0x64')]['name'],_0x38076e[_0xe0ce('0x64')]['role'],_0x49121f[_0xe0ce('0x6a')]['id'],_0x38076e[_0xe0ce('0x5b')]?JSON[_0xe0ce('0x26')](_0x38076e[_0xe0ce('0x5b')]):'null');return respondWithRpcPromise(_0xe0ce('0x6b'),'acceptMessage',_0x49121f);}return null;})[_0xe0ce('0x21')](function(_0x598d92){var _0x553cf2=_0xe0ce('0x6c')+_0x598d92[_0xe0ce('0x29')][_0xe0ce('0x6d')];return db[_0xe0ce('0x6e')]['query'](_0x553cf2,{'type':db[_0xe0ce('0x6f')]['QueryTypes'][_0xe0ce('0x70')],'raw':!![]})[_0xe0ce('0x21')](function(_0x5ee5cb){return _0x5ee5cb;});})[_0xe0ce('0x21')](function(_0xca597f){if(_0xca597f){_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x71')]=_0xca597f[0x0];if(!_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x63')])return;return db['User'][_0xe0ce('0x5a')]({'where':{'id':_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x63')],'role':_0xe0ce('0x65')},'attributes':['id','name','fullname',_0xe0ce('0x72'),_0xe0ce('0x73')],'raw':!![]});}return null;})[_0xe0ce('0x21')](function(_0x4086a6){if(!_0x4086a6)return null;_0x49121f['message'][_0xe0ce('0x65')]=_0x4086a6;return _0x49121f;})[_0xe0ce('0x21')](function(_0x3c43f4){if(_0x3c43f4){if(_0x38076e[_0xe0ce('0x5b')][_0xe0ce('0x74')]){_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x75')]=util[_0xe0ce('0x76')](_0xe0ce('0x77'),_0x38076e['user'][_0xe0ce('0x3a')]);_0x49121f[_0xe0ce('0x29')]['channel']=_0x49121f['channel'];_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x78')]=_0x49121f[_0xe0ce('0x79')];_0x49121f[_0xe0ce('0x29')][_0xe0ce('0x7a')]=_0xe0ce('0x7b');return respondWithRpcPromise('EventManager',_0xe0ce('0x7c'),{'event':_0xe0ce('0x7d'),'message':_0x49121f[_0xe0ce('0x29')]},client9002)['then'](function(){return _0x49121f;});}return _0x49121f;}return null;})[_0xe0ce('0x21')](respondWithResult(_0x3f7f50,null))['catch'](handleError(_0x3f7f50,null));};var interaction_log=require(_0xe0ce('0x15'))('whatsapp-interactions');exports[_0xe0ce('0x36')]=function(_0x3b63ab,_0x452414,_0x3150d1){var _0x404900={'agent':{},'channel':_0xe0ce('0x5f')};if(_0x3b63ab['body']['id']){delete _0x3b63ab[_0xe0ce('0x5b')]['id'];}_0x3b63ab[_0xe0ce('0x5b')][_0xe0ce('0x63')]=_0x3b63ab[_0xe0ce('0x5b')][_0xe0ce('0x63')]||_0x3b63ab['user']['id'];_0x404900['agent']['id']=_0x3b63ab['body'][_0xe0ce('0x63')];return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x3b63ab[_0xe0ce('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x452414,null))[_0xe0ce('0x21')](function(_0xa7e8f){if(_0xa7e8f){_0x404900[_0xe0ce('0x29')]=_0xa7e8f[_0xe0ce('0x7e')]({'plain':!![]});return db[_0xe0ce('0x66')]['find']({'where':{'id':_0xa7e8f[_0xe0ce('0x7f')]}});}return null;})[_0xe0ce('0x21')](handleEntityNotFound(_0x452414,null))['then'](function(_0x411d81){if(_0x411d81){_0x404900['interaction']=_0x411d81['get']({'plain':!![]});interaction_log[_0xe0ce('0x2a')](_0xe0ce('0x80'),_0x3b63ab['user']['id'],_0x3b63ab[_0xe0ce('0x64')][_0xe0ce('0x3a')],_0x3b63ab[_0xe0ce('0x64')][_0xe0ce('0x81')],_0x404900[_0xe0ce('0x6a')]['id'],_0x3b63ab['body']?JSON[_0xe0ce('0x26')](_0x3b63ab[_0xe0ce('0x5b')]):_0xe0ce('0x82'));return respondWithRpcPromise(_0xe0ce('0x83'),'rejectMessage',_0x404900);}return null;})[_0xe0ce('0x21')](function(_0x233f95){var _0x5a6f17=_0xe0ce('0x6c')+_0x233f95[_0xe0ce('0x29')][_0xe0ce('0x6d')];return db[_0xe0ce('0x6e')][_0xe0ce('0x42')](_0x5a6f17,{'type':db[_0xe0ce('0x6f')][_0xe0ce('0x84')][_0xe0ce('0x70')],'raw':!![]})['then'](function(_0x330b3a){return _0x330b3a;});})[_0xe0ce('0x21')](function(_0x536173){if(_0x536173){_0x404900[_0xe0ce('0x29')][_0xe0ce('0x71')]=_0x536173[0x0];if(!_0x3b63ab['body'][_0xe0ce('0x63')])return;return db[_0xe0ce('0x85')][_0xe0ce('0x5a')]({'where':{'id':_0x3b63ab[_0xe0ce('0x5b')][_0xe0ce('0x63')],'role':_0xe0ce('0x65')},'attributes':['id',_0xe0ce('0x3a'),_0xe0ce('0x86'),'email',_0xe0ce('0x73')],'raw':!![]});}return null;})[_0xe0ce('0x21')](function(_0x12ba48){if(!_0x12ba48)return null;_0x404900[_0xe0ce('0x29')]['agent']=_0x12ba48;return _0x404900;})[_0xe0ce('0x21')](function(_0x431a8d){if(_0x431a8d){_0x431a8d[_0xe0ce('0x29')][_0xe0ce('0x75')]=util['format'](_0xe0ce('0x77'),_0x3b63ab['user'][_0xe0ce('0x3a')]);_0x431a8d[_0xe0ce('0x29')]['channel']=_0x404900[_0xe0ce('0x79')];_0x431a8d[_0xe0ce('0x29')][_0xe0ce('0x78')]=_0x404900['channel'];_0x431a8d[_0xe0ce('0x29')][_0xe0ce('0x7a')]='reject';respondWithRpcPromise(_0xe0ce('0x7c'),_0xe0ce('0x7c'),{'event':_0xe0ce('0x87'),'message':_0x431a8d[_0xe0ce('0x29')]},client9002);return _0x404900;}return null;})[_0xe0ce('0x21')](respondWithResult(_0x452414,null))[_0xe0ce('0x56')](handleError(_0x452414,null));};exports['status']=function(_0x5ebefe,_0x50c19b,_0x54e29e){if(_0x5ebefe[_0xe0ce('0x5b')]['id']){delete _0x5ebefe[_0xe0ce('0x5b')]['id'];}var _0x277ee6;return db[_0xe0ce('0x3c')][_0xe0ce('0x5a')]({'where':{'id':_0x5ebefe[_0xe0ce('0x58')]['id']}})[_0xe0ce('0x21')](handleEntityNotFound(_0x50c19b,null))[_0xe0ce('0x21')](function(_0x5e0ff2){if(_0x5e0ff2){_0x277ee6=_0x5e0ff2;return db[_0xe0ce('0x88')][_0xe0ce('0x5a')]({'where':{'id':_0x5e0ff2[_0xe0ce('0x89')]}});}})[_0xe0ce('0x21')](handleEntityNotFound(_0x50c19b,null))[_0xe0ce('0x21')](function(_0x3ad2ac){if(_0x3ad2ac){logger[_0xe0ce('0x23')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xe0ce('0x2d'),_0xe0ce('0x8a'),_0x3ad2ac[_0xe0ce('0x3e')],util['inspect'](_0x5ebefe[_0xe0ce('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3ad2ac['type']){case'twilio':if(_0x5ebefe['body']['MessageSid']&&_0x5ebefe['body'][_0xe0ce('0x8b')]===_0x277ee6['messageId']&&_0x5ebefe[_0xe0ce('0x5b')][_0xe0ce('0x8c')]&&_0x5ebefe[_0xe0ce('0x5b')]['MessageStatus']===_0xe0ce('0x60')){return _0x277ee6[_0xe0ce('0x38')]({'read':!![]});}else{logger[_0xe0ce('0x27')](_0xe0ce('0x8d'),_0xe0ce('0x2d'),_0xe0ce('0x8e'),util[_0xe0ce('0x8f')](_0x5ebefe[_0xe0ce('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x277ee6;}})[_0xe0ce('0x21')](respondWithResult(_0x50c19b,null))[_0xe0ce('0x56')](handleError(_0x50c19b,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 86b7725..66b9648 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 _0x9434=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x7caad2,_0x85a3e8){var _0x2d3327=function(_0x34f680){while(--_0x34f680){_0x7caad2['push'](_0x7caad2['shift']());}};_0x2d3327(++_0x85a3e8);}(_0x9434,0x168));var _0x4943=function(_0x23b6d0,_0x4f5320){_0x23b6d0=_0x23b6d0-0x0;var _0x32f979=_0x9434[_0x23b6d0];return _0x32f979;};'use strict';var EventEmitter=require(_0x4943('0x0'));var WhatsappMessage=require(_0x4943('0x1'))['db'][_0x4943('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4943('0x3')](0x0);var events={'afterCreate':_0x4943('0x4'),'afterUpdate':_0x4943('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1159f9){return function(_0xda4cba,_0x5117c7,_0x2ce3d9){WhatsappMessageEvents[_0x4943('0x6')](_0x1159f9+':'+_0xda4cba['id'],_0xda4cba);WhatsappMessageEvents['emit'](_0x1159f9,_0xda4cba);_0x2ce3d9(null);};}for(var e in events){if(events[_0x4943('0x7')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0xe5b5=['hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x388dcc,_0x228e1b){var _0x14337f=function(_0x26dc4b){while(--_0x26dc4b){_0x388dcc['push'](_0x388dcc['shift']());}};_0x14337f(++_0x228e1b);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0xe5b5[_0xf51c06];return _0x1d5420;};'use strict';var EventEmitter=require(_0x5e5b('0x0'));var WhatsappMessage=require(_0x5e5b('0x1'))['db'][_0x5e5b('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x5e5b('0x3')](0x0);var events={'afterCreate':_0x5e5b('0x4'),'afterUpdate':_0x5e5b('0x5'),'afterDestroy':_0x5e5b('0x6')};function emitEvent(_0x3dc763){return function(_0xf20c6a,_0x20a50c,_0xdc6616){WhatsappMessageEvents[_0x5e5b('0x7')](_0x3dc763+':'+_0xf20c6a['id'],_0xf20c6a);WhatsappMessageEvents[_0x5e5b('0x7')](_0x3dc763,_0xf20c6a);_0xdc6616(null);};}for(var e in events){if(events[_0x5e5b('0x8')](e)){var event=events[e];WhatsappMessage[_0x5e5b('0x9')](e,emitEvent(event));}}module[_0x5e5b('0xa')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index caff276..f1280f7 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 _0xd451=['../../config/environment','./whatsappMessage.attributes','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','get','direction','toLowerCase','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','error','WhatsappAccount','find','type','twilio','authToken','phone','accountSid','messages','create','whatsapp:','/api/whatsapp/messages/','token','sid','update','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','info','AC\x20send\x20phoneNbr:%s','baseUrl','/whatsapp/v1/','Bearer\x20','application/json','stringify','AC\x20send\x20data:%s','statuses','message_id','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf'];(function(_0x88df8c,_0x123d0e){var _0x5ca66c=function(_0x61dd0d){while(--_0x61dd0d){_0x88df8c['push'](_0x88df8c['shift']());}};_0x5ca66c(++_0x123d0e);}(_0xd451,0x117));var _0x1d45=function(_0x55cb8a,_0x3b1861){_0x55cb8a=_0x55cb8a-0x0;var _0x5f364b=_0xd451[_0x55cb8a];return _0x5f364b;};'use strict';var _=require(_0x1d45('0x0'));var util=require(_0x1d45('0x1'));var logger=require(_0x1d45('0x2'))('api');var moment=require(_0x1d45('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d45('0x4'));var rimraf=require(_0x1d45('0x5'));var config=require(_0x1d45('0x6'));var attributes=require(_0x1d45('0x7'));module['exports']=function(_0x5d8374,_0x3e911a){return _0x5d8374[_0x1d45('0x8')]('WhatsappMessage',attributes,{'tableName':_0x1d45('0x9'),'paranoid':![],'indexes':[{'name':_0x1d45('0xa'),'fields':['messageId']},{'name':_0x1d45('0xb'),'fields':[_0x1d45('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xed51d0,_0x124d9f,_0x3e61cb){var _0xa96a1b=_0x5d8374['models'];var _0x40f887=_0xed51d0[_0x1d45('0xd')]({'plain':!![]});if(_0x40f887[_0x1d45('0xe')][_0x1d45('0xf')]()==='in'||_0x40f887['direction'][_0x1d45('0xf')]()===_0x1d45('0x10')&&!_0x40f887[_0x1d45('0x11')]&&!_[_0x1d45('0x12')](_0x40f887['UserId'])){_0xa96a1b[_0x1d45('0x13')][_0x1d45('0x14')]({'where':{'id':_0x40f887[_0x1d45('0x15')]}})[_0x1d45('0x16')](function(_0x85a658){if(_0x85a658){_0x85a658['update']({'lastMsgAt':_0x40f887['createdAt'],'lastMsgDirection':_0x40f887[_0x1d45('0xe')]['toLowerCase']()});}})['catch'](function(_0x14dc04){console[_0x1d45('0x17')](_0x14dc04);});}if(_0x40f887['direction']===_0x1d45('0x10')&&!_0x40f887[_0x1d45('0x11')]){var _0x5755a3;_0xa96a1b[_0x1d45('0x18')][_0x1d45('0x19')]({'where':{'id':_0x40f887['WhatsappAccountId']},'raw':!![]})[_0x1d45('0x16')](function(_0x2da9aa){_0x5755a3=_0x2da9aa;if(_0x5755a3&&_0x5755a3[_0x1d45('0x1a')]){switch(_0x5755a3[_0x1d45('0x1a')]){case _0x1d45('0x1b'):var _0x497d67=require(_0x1d45('0x1b'));if(_0x5755a3['accountSid']&&_0x5755a3[_0x1d45('0x1c')]&&_0x5755a3[_0x1d45('0x1d')]){var _0x2de4d9=new _0x497d67(_0x5755a3[_0x1d45('0x1e')],_0x5755a3[_0x1d45('0x1c')]);_0x2de4d9[_0x1d45('0x1f')][_0x1d45('0x20')]({'body':_0x40f887[_0x1d45('0xc')],'to':_0x1d45('0x21')+_0x40f887[_0x1d45('0x1d')],'from':_0x1d45('0x21')+_0x5755a3[_0x1d45('0x1d')],'statusCallback':_0x5755a3['remote']+_0x1d45('0x22')+_0x40f887['id']+'/status?token='+_0x5755a3[_0x1d45('0x23')]})[_0x1d45('0x16')](function(_0x1c8a2a){if(_0x1c8a2a[_0x1d45('0x24')]){return _0xed51d0[_0x1d45('0x25')]({'messageId':_0x1c8a2a[_0x1d45('0x24')]});}})[_0x1d45('0x26')](function(_0x145ab9){logger[_0x1d45('0x17')](_0x1d45('0x27'),_0x1d45('0x28'),_0x1d45('0x1b'),util[_0x1d45('0x29')](_0x145ab9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1d45('0x27'),'afterCreate',_0x1d45('0x1b'),_0x1d45('0x2a'));}break;case _0x1d45('0x2b'):var _0x47e57d=_0x5755a3[_0x1d45('0x1e')];var _0x5bf145=_0x5755a3[_0x1d45('0x1d')];var _0x4b92cb=_0x5755a3[_0x1d45('0x1c')];logger[_0x1d45('0x2c')]('AC\x20send\x20botId:%s',_0x47e57d);logger[_0x1d45('0x2c')](_0x1d45('0x2d'),_0x5bf145);logger[_0x1d45('0x2c')]('AC\x20send\x20bearerToken:%s',_0x4b92cb);var _0x5b3b4b=_0x5755a3[_0x1d45('0x2e')]+_0x1d45('0x2f')+_0x47e57d+'/messages/';var _0x4c98ab={'to':_0x5bf145,'message':{'type':'text','text':_0x40f887[_0x1d45('0xc')]}};var _0x21b4f5={'method':'POST','uri':_0x5b3b4b,'headers':{'Authorization':_0x1d45('0x30')+_0x4b92cb,'Content-Type':_0x1d45('0x31')},'body':JSON[_0x1d45('0x32')](_0x4c98ab),'json':!![]};logger[_0x1d45('0x2c')](_0x1d45('0x33'),_0x4c98ab);logger['info']('AC\x20send\x20postReq:%s',_0x21b4f5);rp(_0x21b4f5)[_0x1d45('0x16')](function(_0x556724){if(_0x556724[_0x1d45('0x34')][0x0]['message_id']){return _0xed51d0[_0x1d45('0x25')]({'messageId':_0x556724['statuses'][0x0][_0x1d45('0x35')]});}})[_0x1d45('0x16')](function(_0x497639){console['log'](_0x497639);})[_0x1d45('0x26')](function(_0x2bc033){console['log'](_0x2bc033);});break;}}})[_0x1d45('0x36')](function(){_0x3e61cb();});}else{_0x3e61cb();}}},'charset':_0x1d45('0x37'),'collate':_0x1d45('0x38')});}; \ No newline at end of file +var _0x46e1=['path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','phone','messages','create','/api/whatsapp/messages/','token','sid','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','authToken','info','AC\x20send\x20botId:%s','AC\x20send\x20phoneNbr:%s','/whatsapp/v1/','text','body','POST','Bearer\x20','application/json','statuses','log','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x31536c,_0x46711d){var _0x20db19=function(_0x1618d9){while(--_0x1618d9){_0x31536c['push'](_0x31536c['shift']());}};_0x20db19(++_0x46711d);}(_0x46e1,0x155));var _0x146e=function(_0x3ca16f,_0x2d4091){_0x3ca16f=_0x3ca16f-0x0;var _0x14b70e=_0x46e1[_0x3ca16f];return _0x14b70e;};'use strict';var _=require(_0x146e('0x0'));var util=require(_0x146e('0x1'));var logger=require(_0x146e('0x2'))(_0x146e('0x3'));var moment=require(_0x146e('0x4'));var BPromise=require(_0x146e('0x5'));var rp=require(_0x146e('0x6'));var fs=require('fs');var path=require(_0x146e('0x7'));var rimraf=require(_0x146e('0x8'));var config=require(_0x146e('0x9'));var attributes=require('./whatsappMessage.attributes');module[_0x146e('0xa')]=function(_0x1f1f15,_0x3de564){return _0x1f1f15[_0x146e('0xb')](_0x146e('0xc'),attributes,{'tableName':_0x146e('0xd'),'paranoid':![],'indexes':[{'name':_0x146e('0xe'),'fields':['messageId']},{'name':_0x146e('0xf'),'fields':['body'],'type':_0x146e('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf7d20d,_0xcf7c1e,_0x453b5a){var _0x15cea1=_0x1f1f15[_0x146e('0x11')];var _0x5d6766=_0xf7d20d['get']({'plain':!![]});if(_0x5d6766[_0x146e('0x12')][_0x146e('0x13')]()==='in'||_0x5d6766[_0x146e('0x12')][_0x146e('0x13')]()===_0x146e('0x14')&&!_0x5d6766[_0x146e('0x15')]&&!_[_0x146e('0x16')](_0x5d6766[_0x146e('0x17')])){_0x15cea1['WhatsappInteraction']['findOne']({'where':{'id':_0x5d6766[_0x146e('0x18')]}})[_0x146e('0x19')](function(_0x18e9bc){if(_0x18e9bc){_0x18e9bc[_0x146e('0x1a')]({'lastMsgAt':_0x5d6766[_0x146e('0x1b')],'lastMsgDirection':_0x5d6766[_0x146e('0x12')][_0x146e('0x13')]()});}})[_0x146e('0x1c')](function(_0x44c82f){console[_0x146e('0x1d')](_0x44c82f);});}if(_0x5d6766[_0x146e('0x12')]==='out'&&!_0x5d6766[_0x146e('0x15')]){var _0x1a8a20;_0x15cea1[_0x146e('0x1e')][_0x146e('0x1f')]({'where':{'id':_0x5d6766[_0x146e('0x20')]},'raw':!![]})[_0x146e('0x19')](function(_0x256db5){_0x1a8a20=_0x256db5;if(_0x1a8a20&&_0x1a8a20['type']){switch(_0x1a8a20[_0x146e('0x21')]){case'twilio':var _0x109cfe=require(_0x146e('0x22'));if(_0x1a8a20[_0x146e('0x23')]&&_0x1a8a20['authToken']&&_0x1a8a20[_0x146e('0x24')]){var _0x559f54=new _0x109cfe(_0x1a8a20[_0x146e('0x23')],_0x1a8a20['authToken']);_0x559f54[_0x146e('0x25')][_0x146e('0x26')]({'body':_0x5d6766['body'],'to':'whatsapp:'+_0x5d6766['phone'],'from':'whatsapp:'+_0x1a8a20['phone'],'statusCallback':_0x1a8a20['remote']+_0x146e('0x27')+_0x5d6766['id']+'/status?token='+_0x1a8a20[_0x146e('0x28')]})[_0x146e('0x19')](function(_0xc39f4d){if(_0xc39f4d[_0x146e('0x29')]){return _0xf7d20d[_0x146e('0x1a')]({'messageId':_0xc39f4d[_0x146e('0x29')]});}})[_0x146e('0x1c')](function(_0x4cc850){logger[_0x146e('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x146e('0x2a'),'twilio',util['inspect'](_0x4cc850,{'showHidden':![],'depth':null}));});}else{logger[_0x146e('0x1d')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x146e('0x2a'),_0x146e('0x22'),_0x146e('0x2b'));}break;case _0x146e('0x2c'):var _0x3a0bf3=_0x1a8a20['accountSid'];var _0x1ce964=_0x1a8a20[_0x146e('0x24')];var _0x11b869=_0x1a8a20[_0x146e('0x2d')];logger[_0x146e('0x2e')](_0x146e('0x2f'),_0x3a0bf3);logger[_0x146e('0x2e')](_0x146e('0x30'),_0x1ce964);logger['info']('AC\x20send\x20bearerToken:%s',_0x11b869);var _0x37c5d8=_0x1a8a20['baseUrl']+_0x146e('0x31')+_0x3a0bf3+'/messages/';var _0x52b279={'to':[_0x1ce964],'message':{'type':_0x146e('0x32'),'text':_0x5d6766[_0x146e('0x33')]}};var _0x32b23c={'method':_0x146e('0x34'),'uri':_0x37c5d8,'headers':{'Authorization':_0x146e('0x35')+_0x11b869,'Content-Type':_0x146e('0x36')},'body':JSON['stringify'](_0x52b279),'json':!![]};logger[_0x146e('0x2e')]('AC\x20send\x20data:%s',_0x52b279);logger[_0x146e('0x2e')]('AC\x20send\x20postReq:%s',_0x32b23c);rp(_0x32b23c)[_0x146e('0x19')](function(_0x2b9dd2){if(_0x2b9dd2[_0x146e('0x37')][0x0]['message_id']){return _0xf7d20d[_0x146e('0x1a')]({'messageId':_0x2b9dd2[_0x146e('0x37')][0x0]['message_id']});}})[_0x146e('0x19')](function(_0x3271e1){console[_0x146e('0x38')](_0x3271e1);})[_0x146e('0x1c')](function(_0x449162){console[_0x146e('0x38')](_0x449162);});break;}}})[_0x146e('0x39')](function(){_0x453b5a();});}else{_0x453b5a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index bc264ec..8cd1e13 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 _0xf1e6=['code','message','result','catch','CreateWhatsappMessage','create','body','options','raw','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','socket.io-emitter','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xf1e6,0x17d));var _0x6f1e=function(_0x3c0569,_0x11da9f){_0x3c0569=_0x3c0569-0x0;var _0x142524=_0xf1e6[_0x3c0569];return _0x142524;};'use strict';var _=require(_0x6f1e('0x0'));var util=require(_0x6f1e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f1e('0x2'));var fs=require('fs');var Redis=require(_0x6f1e('0x3'));var db=require(_0x6f1e('0x4'))['db'];var utils=require(_0x6f1e('0x5'));var logger=require(_0x6f1e('0x6'))(_0x6f1e('0x7'));var config=require(_0x6f1e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6f1e('0x9')][_0x6f1e('0xa')]({'port':0x232a});config['redis']=_[_0x6f1e('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6f1e('0xc'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0x6f1e('0xd')](socket);function respondWithRpcPromise(_0x403dd6,_0x9b5e,_0xdb02ac){return new BPromise(function(_0x12a17a,_0x2e7dbd){return client[_0x6f1e('0xe')](_0x403dd6,_0xdb02ac)[_0x6f1e('0xf')](function(_0x34f565){logger[_0x6f1e('0x10')](_0x6f1e('0x11'),_0x9b5e,_0x6f1e('0x12'));logger[_0x6f1e('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x9b5e,_0x6f1e('0x12'),JSON[_0x6f1e('0x14')](_0x34f565));if(_0x34f565[_0x6f1e('0x15')]){if(_0x34f565[_0x6f1e('0x15')][_0x6f1e('0x16')]===0x1f4){logger[_0x6f1e('0x15')](_0x6f1e('0x11'),_0x9b5e,_0x34f565[_0x6f1e('0x15')][_0x6f1e('0x17')]);return _0x2e7dbd(_0x34f565[_0x6f1e('0x15')][_0x6f1e('0x17')]);}logger[_0x6f1e('0x15')](_0x6f1e('0x11'),_0x9b5e,_0x34f565[_0x6f1e('0x15')][_0x6f1e('0x17')]);return _0x12a17a(_0x34f565[_0x6f1e('0x15')][_0x6f1e('0x17')]);}else{logger['info'](_0x6f1e('0x11'),_0x9b5e,_0x6f1e('0x12'));_0x12a17a(_0x34f565[_0x6f1e('0x18')][_0x6f1e('0x17')]);}})[_0x6f1e('0x19')](function(_0x56558d){logger['error'](_0x6f1e('0x11'),_0x9b5e,_0x56558d);_0x2e7dbd(_0x56558d);});});}exports[_0x6f1e('0x1a')]=function(_0x5a26bd){var _0x5b86ee=this;return new Promise(function(_0x8fba7f,_0x2d5444){return db['WhatsappMessage'][_0x6f1e('0x1b')](_0x5a26bd[_0x6f1e('0x1c')],{'raw':_0x5a26bd[_0x6f1e('0x1d')]?_0x5a26bd[_0x6f1e('0x1d')][_0x6f1e('0x1e')]===undefined?!![]:![]:!![]})[_0x6f1e('0xf')](function(_0x34f7a9){logger[_0x6f1e('0x10')]('CreateWhatsappMessage',_0x5a26bd);logger['debug'](_0x6f1e('0x1a'),_0x5a26bd,JSON[_0x6f1e('0x14')](_0x34f7a9));_0x8fba7f(_0x34f7a9);})['catch'](function(_0x278182){logger[_0x6f1e('0x15')](_0x6f1e('0x1a'),_0x278182[_0x6f1e('0x17')],_0x5a26bd);_0x2d5444(_0x5b86ee['error'](0x1f4,_0x278182[_0x6f1e('0x17')]));});});}; \ No newline at end of file +var _0xbb9e=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappMessage.socket','register','request','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','WhatsappMessage,\x20%s,\x20%s','result','CreateWhatsappMessage','create','options','raw','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xbb9e,0x159));var _0xebb9=function(_0x38d8e6,_0x3a203){_0x38d8e6=_0x38d8e6-0x0;var _0x195efb=_0xbb9e[_0x38d8e6];return _0x195efb;};'use strict';var _=require(_0xebb9('0x0'));var util=require('util');var moment=require(_0xebb9('0x1'));var BPromise=require(_0xebb9('0x2'));var rs=require(_0xebb9('0x3'));var fs=require('fs');var Redis=require(_0xebb9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xebb9('0x5'));var logger=require(_0xebb9('0x6'))(_0xebb9('0x7'));var config=require(_0xebb9('0x8'));var jayson=require(_0xebb9('0x9'));var client=jayson[_0xebb9('0xa')][_0xebb9('0xb')]({'port':0x232a});config['redis']=_[_0xebb9('0xc')](config[_0xebb9('0xd')],{'host':_0xebb9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebb9('0xd')]));require(_0xebb9('0xf'))[_0xebb9('0x10')](socket);function respondWithRpcPromise(_0x44974a,_0x5b2c0e,_0x25e832){return new BPromise(function(_0x219f0d,_0x594f7e){return client[_0xebb9('0x11')](_0x44974a,_0x25e832)[_0xebb9('0x12')](function(_0x43e9e0){logger[_0xebb9('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x5b2c0e,_0xebb9('0x14'));logger['debug'](_0xebb9('0x15'),_0x5b2c0e,_0xebb9('0x14'),JSON['stringify'](_0x43e9e0));if(_0x43e9e0[_0xebb9('0x16')]){if(_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x17')]===0x1f4){logger[_0xebb9('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x5b2c0e,_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x18')]);return _0x594f7e(_0x43e9e0['error'][_0xebb9('0x18')]);}logger[_0xebb9('0x16')](_0xebb9('0x19'),_0x5b2c0e,_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x18')]);return _0x219f0d(_0x43e9e0[_0xebb9('0x16')][_0xebb9('0x18')]);}else{logger[_0xebb9('0x13')](_0xebb9('0x19'),_0x5b2c0e,_0xebb9('0x14'));_0x219f0d(_0x43e9e0[_0xebb9('0x1a')][_0xebb9('0x18')]);}})['catch'](function(_0x4a7e9f){logger[_0xebb9('0x16')](_0xebb9('0x19'),_0x5b2c0e,_0x4a7e9f);_0x594f7e(_0x4a7e9f);});});}exports[_0xebb9('0x1b')]=function(_0x56f826){var _0x1e3beb=this;return new Promise(function(_0x4c353b,_0x5d1a9a){return db['WhatsappMessage'][_0xebb9('0x1c')](_0x56f826['body'],{'raw':_0x56f826[_0xebb9('0x1d')]?_0x56f826['options'][_0xebb9('0x1e')]===undefined?!![]:![]:!![]})[_0xebb9('0x12')](function(_0x5f3310){logger[_0xebb9('0x13')](_0xebb9('0x1b'),_0x56f826);logger[_0xebb9('0x1f')](_0xebb9('0x1b'),_0x56f826,JSON['stringify'](_0x5f3310));_0x4c353b(_0x5f3310);})['catch'](function(_0x5b50e2){logger[_0xebb9('0x16')](_0xebb9('0x1b'),_0x5b50e2[_0xebb9('0x18')],_0x56f826);_0x5d1a9a(_0x1e3beb[_0xebb9('0x16')](0x1f4,_0x5b50e2[_0xebb9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 3ccb392..35f57ee 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 _0x55cb=['register','length','whatsappMessage:','./whatsappMessage.events','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x55cb,0xf8));var _0xb55c=function(_0x23b85e,_0x39b209){_0x23b85e=_0x23b85e-0x0;var _0x329756=_0x55cb[_0x23b85e];return _0x329756;};'use strict';var WhatsappMessageEvents=require(_0xb55c('0x0'));var events=['save',_0xb55c('0x1'),'update'];function createListener(_0x5b050e,_0x41ecec){return function(_0x27d491){_0x41ecec[_0xb55c('0x2')](_0x5b050e,_0x27d491);};}function removeListener(_0x46b9b4,_0x2e964b){return function(){WhatsappMessageEvents[_0xb55c('0x3')](_0x46b9b4,_0x2e964b);};}exports[_0xb55c('0x4')]=function(_0x381333){for(var _0x1c9bd4=0x0,_0x1e9b47=events[_0xb55c('0x5')];_0x1c9bd4<_0x1e9b47;_0x1c9bd4++){var _0x2adf61=events[_0x1c9bd4];var _0x1cef12=createListener(_0xb55c('0x6')+_0x2adf61,_0x381333);WhatsappMessageEvents['on'](_0x2adf61,_0x1cef12);}}; \ No newline at end of file +var _0x90f3=['length','whatsappMessage:','save','remove','update','emit','register'];(function(_0x4e811a,_0x2a51f4){var _0x587b24=function(_0x3e40cd){while(--_0x3e40cd){_0x4e811a['push'](_0x4e811a['shift']());}};_0x587b24(++_0x2a51f4);}(_0x90f3,0xb8));var _0x390f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x90f3[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x390f('0x0'),_0x390f('0x1'),_0x390f('0x2')];function createListener(_0x424eb9,_0x406781){return function(_0x199556){_0x406781[_0x390f('0x3')](_0x424eb9,_0x199556);};}function removeListener(_0x1f5285,_0xb44763){return function(){WhatsappMessageEvents['removeListener'](_0x1f5285,_0xb44763);};}exports[_0x390f('0x4')]=function(_0x388a34){for(var _0x15818e=0x0,_0x10d9fd=events[_0x390f('0x5')];_0x15818e<_0x10d9fd;_0x15818e++){var _0x25276c=events[_0x15818e];var _0x1fbf43=createListener(_0x390f('0x6')+_0x25276c,_0x388a34);WhatsappMessageEvents['on'](_0x25276c,_0x1fbf43);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index ca6132f..fd5fbee 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 _0xd9d5=['getAgents','create','post','addTeams','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','index','get','/describe','isAuthenticated','describe','/:id','show','/:id/teams','/:id/users'];(function(_0x5f485b,_0x87727a){var _0x38ccd2=function(_0x383dc5){while(--_0x383dc5){_0x5f485b['push'](_0x5f485b['shift']());}};_0x38ccd2(++_0x87727a);}(_0xd9d5,0x1e5));var _0x5d9d=function(_0x43b4d3,_0x367c49){_0x43b4d3=_0x43b4d3-0x0;var _0x3bc43d=_0xd9d5[_0x43b4d3];return _0x3bc43d;};'use strict';var multer=require(_0x5d9d('0x0'));var util=require(_0x5d9d('0x1'));var path=require(_0x5d9d('0x2'));var timeout=require(_0x5d9d('0x3'));var express=require('express');var router=express[_0x5d9d('0x4')]();var fs_extra=require(_0x5d9d('0x5'));var auth=require(_0x5d9d('0x6'));var interaction=require(_0x5d9d('0x7'));var config=require(_0x5d9d('0x8'));var controller=require(_0x5d9d('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x5d9d('0xa')]);router[_0x5d9d('0xb')](_0x5d9d('0xc'),auth[_0x5d9d('0xd')](),controller[_0x5d9d('0xe')]);router[_0x5d9d('0xb')](_0x5d9d('0xf'),auth[_0x5d9d('0xd')](),controller[_0x5d9d('0x10')]);router[_0x5d9d('0xb')]('/:id/members',auth[_0x5d9d('0xd')](),controller['getMembers']);router[_0x5d9d('0xb')](_0x5d9d('0x11'),auth[_0x5d9d('0xd')](),controller['getTeams']);router[_0x5d9d('0xb')](_0x5d9d('0x12'),auth[_0x5d9d('0xd')](),controller[_0x5d9d('0x13')]);router['post']('/',auth[_0x5d9d('0xd')](),controller[_0x5d9d('0x14')]);router[_0x5d9d('0x15')](_0x5d9d('0x11'),auth[_0x5d9d('0xd')](),controller[_0x5d9d('0x16')]);router[_0x5d9d('0x15')](_0x5d9d('0x12'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x5d9d('0xf'),auth['isAuthenticated'](),controller[_0x5d9d('0x17')]);router[_0x5d9d('0x18')]('/:id',auth[_0x5d9d('0xd')](),controller[_0x5d9d('0x19')]);router[_0x5d9d('0x18')](_0x5d9d('0x11'),auth[_0x5d9d('0xd')](),controller[_0x5d9d('0x1a')]);router[_0x5d9d('0x18')](_0x5d9d('0x12'),auth[_0x5d9d('0xd')](),controller['removeAgents']);module[_0x5d9d('0x1b')]=router; \ No newline at end of file +var _0xd6ba=['delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams'];(function(_0x62e9d3,_0x414f38){var _0x31bf2b=function(_0x2be406){while(--_0x2be406){_0x62e9d3['push'](_0x62e9d3['shift']());}};_0x31bf2b(++_0x414f38);}(_0xd6ba,0x1f2));var _0xad6b=function(_0x1c63db,_0x247756){_0x1c63db=_0x1c63db-0x0;var _0x1e4eed=_0xd6ba[_0x1c63db];return _0x1e4eed;};'use strict';var multer=require(_0xad6b('0x0'));var util=require('util');var path=require(_0xad6b('0x1'));var timeout=require(_0xad6b('0x2'));var express=require(_0xad6b('0x3'));var router=express[_0xad6b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xad6b('0x5'));var config=require('../../config/environment');var controller=require(_0xad6b('0x6'));router['get']('/',auth[_0xad6b('0x7')](),controller[_0xad6b('0x8')]);router[_0xad6b('0x9')](_0xad6b('0xa'),auth[_0xad6b('0x7')](),controller[_0xad6b('0xb')]);router[_0xad6b('0x9')](_0xad6b('0xc'),auth[_0xad6b('0x7')](),controller[_0xad6b('0xd')]);router[_0xad6b('0x9')]('/:id/members',auth[_0xad6b('0x7')](),controller[_0xad6b('0xe')]);router['get'](_0xad6b('0xf'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x10')]);router[_0xad6b('0x9')](_0xad6b('0x11'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x12')]);router[_0xad6b('0x13')]('/',auth['isAuthenticated'](),controller[_0xad6b('0x14')]);router[_0xad6b('0x13')](_0xad6b('0xf'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x15')]);router[_0xad6b('0x13')](_0xad6b('0x11'),auth[_0xad6b('0x7')](),controller['addAgents']);router['put'](_0xad6b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xad6b('0x16')]('/:id',auth[_0xad6b('0x7')](),controller[_0xad6b('0x17')]);router[_0xad6b('0x16')](_0xad6b('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0xad6b('0x16')](_0xad6b('0x11'),auth[_0xad6b('0x7')](),controller[_0xad6b('0x18')]);module[_0xad6b('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 9c6b138..6d1d14e 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 _0x0f69=['roundrobin','STRING','INTEGER','ENUM','beepall'];(function(_0x4ce590,_0x4f6f30){var _0x3419b1=function(_0x9601e8){while(--_0x9601e8){_0x4ce590['push'](_0x4ce590['shift']());}};_0x3419b1(++_0x4f6f30);}(_0x0f69,0x173));var _0x90f6=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x0f69[_0x1a9204];return _0x17ca68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x90f6('0x0')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x90f6('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x90f6('0x2')]('rrmemory',_0x90f6('0x3'),_0x90f6('0x4'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x180f=['beepall','roundrobin','STRING','sequelize','exports','name','INTEGER','rrmemory'];(function(_0x250615,_0x5f54a2){var _0x2fecb2=function(_0x125329){while(--_0x125329){_0x250615['push'](_0x250615['shift']());}};_0x2fecb2(++_0x5f54a2);}(_0x180f,0xf3));var _0xf180=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x180f[_0x43c8b8];return _0x413be3;};'use strict';var Sequelize=require(_0xf180('0x0'));module[_0xf180('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf180('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf180('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf180('0x4'),_0xf180('0x5'),_0xf180('0x6'))},'description':{'type':Sequelize[_0xf180('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index de4c594..9d0191a 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 _0xe805=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserWhatsappQueue','nolimit','WhatsappQueueId','User','findAndCountAll','UserId','agent','format','%s/%s','SIP','whatsappPause','createdAt','updatedAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','compact','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./whatsappQueue.socket','register','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','get','WhatsappQueues','sendStatus','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe805,0x17f));var _0x5e80=function(_0x1e578f,_0x3f5ebc){_0x1e578f=_0x1e578f-0x0;var _0x17f3c4=_0xe805[_0x1e578f];return _0x17f3c4;};'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(_0x5e80('0x0'));var BPromise=require(_0x5e80('0x1'));var Mustache=require(_0x5e80('0x2'));var util=require('util');var path=require(_0x5e80('0x3'));var sox=require(_0x5e80('0x4'));var csv=require(_0x5e80('0x5'));var ejs=require(_0x5e80('0x6'));var fs=require('fs');var fs_extra=require(_0x5e80('0x7'));var _=require(_0x5e80('0x8'));var squel=require('squel');var crypto=require(_0x5e80('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5e80('0xa'));var toCsv=require(_0x5e80('0x5'));var querystring=require('querystring');var Papa=require(_0x5e80('0xb'));var Redis=require(_0x5e80('0xc'));var authService=require(_0x5e80('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5e80('0xe'));var hardwareService=require(_0x5e80('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x5e80('0x10'));var config=require(_0x5e80('0x11'));var licenseUtil=require(_0x5e80('0x12'));var db=require(_0x5e80('0x13'))['db'];config[_0x5e80('0x14')]=_['defaults'](config['redis'],{'host':_0x5e80('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e80('0x14')]));require(_0x5e80('0x16'))[_0x5e80('0x17')](socket);function respondWithStatusCode(_0x158baf,_0x5e5314){_0x5e5314=_0x5e5314||0xcc;return function(_0x1d2560){if(_0x1d2560){return _0x158baf['sendStatus'](_0x5e5314);}return _0x158baf[_0x5e80('0x18')](_0x5e5314)[_0x5e80('0x19')]();};}function respondWithResult(_0x51be1f,_0x1a8a24){_0x1a8a24=_0x1a8a24||0xc8;return function(_0x34263b){if(_0x34263b){return _0x51be1f[_0x5e80('0x18')](_0x1a8a24)['json'](_0x34263b);}};}function respondWithFilteredResult(_0x53c63b,_0x290bc1){return function(_0x5f32c2){if(_0x5f32c2){var _0x140fb1=typeof _0x290bc1[_0x5e80('0x1a')]===_0x5e80('0x1b')&&typeof _0x290bc1[_0x5e80('0x1c')]==='undefined';var _0x885353=_0x5f32c2[_0x5e80('0x1d')];var _0x17c0a2=_0x140fb1?0x0:_0x290bc1[_0x5e80('0x1a')];var _0x27028a=_0x140fb1?_0x5f32c2[_0x5e80('0x1d')]:_0x290bc1[_0x5e80('0x1a')]+_0x290bc1['limit'];var _0x153045;if(_0x27028a>=_0x885353){_0x27028a=_0x885353;_0x153045=0xc8;}else{_0x153045=0xce;}_0x53c63b[_0x5e80('0x18')](_0x153045);return _0x53c63b['set'](_0x5e80('0x1e'),_0x17c0a2+'-'+_0x27028a+'/'+_0x885353)[_0x5e80('0x1f')](_0x5f32c2);}return null;};}function patchUpdates(_0x279bcf){return function(_0x23085c){try{jsonpatch[_0x5e80('0x20')](_0x23085c,_0x279bcf,!![]);}catch(_0x168b0a){return BPromise[_0x5e80('0x21')](_0x168b0a);}return _0x23085c[_0x5e80('0x22')]();};}function saveUpdates(_0x4dc15c,_0x4a6ad5){return function(_0x33a4c7){if(_0x33a4c7){return _0x33a4c7[_0x5e80('0x23')](_0x4dc15c)['then'](function(_0x11f645){return _0x11f645;});}return null;};}function removeEntity(_0x3c6049,_0x311c61){return function(_0x3aeef0){if(_0x3aeef0){return _0x3aeef0[_0x5e80('0x24')]()[_0x5e80('0x25')](function(){var _0x5c02b6=_0x3aeef0[_0x5e80('0x26')]({'plain':!![]});var _0x269ee5=_0x5e80('0x27');return db['UserProfileResource'][_0x5e80('0x24')]({'where':{'type':_0x269ee5,'resourceId':_0x5c02b6['id']}})[_0x5e80('0x25')](function(){return _0x3aeef0;});})['then'](function(){_0x3c6049[_0x5e80('0x18')](0xcc)[_0x5e80('0x19')]();});}};}function handleEntityNotFound(_0x116b35,_0x51a440){return function(_0x18161a){if(!_0x18161a){_0x116b35[_0x5e80('0x28')](0x194);}return _0x18161a;};}function handleError(_0x50172f,_0x499a25){_0x499a25=_0x499a25||0x1f4;return function(_0x2531f3){logger[_0x5e80('0x29')](_0x2531f3[_0x5e80('0x2a')]);if(_0x2531f3[_0x5e80('0x2b')]){delete _0x2531f3[_0x5e80('0x2b')];}_0x50172f[_0x5e80('0x18')](_0x499a25)[_0x5e80('0x2c')](_0x2531f3);};}exports[_0x5e80('0x2d')]=function(_0x5670ee,_0x53de1d){var _0x4fb38d={},_0x119af9={},_0x3ed196={'count':0x0,'rows':[]};var _0x4db568=_[_0x5e80('0x2e')](db[_0x5e80('0x2f')][_0x5e80('0x30')],function(_0x54b7c7){return{'name':_0x54b7c7[_0x5e80('0x31')],'type':_0x54b7c7[_0x5e80('0x32')][_0x5e80('0x33')]};});_0x119af9[_0x5e80('0x34')]=_[_0x5e80('0x2e')](_0x4db568,_0x5e80('0x2b'));_0x119af9[_0x5e80('0x35')]=_[_0x5e80('0x36')](_0x5670ee[_0x5e80('0x35')]);_0x119af9[_0x5e80('0x37')]=_['intersection'](_0x119af9[_0x5e80('0x34')],_0x119af9[_0x5e80('0x35')]);_0x4fb38d[_0x5e80('0x38')]=_[_0x5e80('0x39')](_0x119af9[_0x5e80('0x34')],qs[_0x5e80('0x3a')](_0x5670ee[_0x5e80('0x35')][_0x5e80('0x3a')]));_0x4fb38d[_0x5e80('0x38')]=_0x4fb38d[_0x5e80('0x38')][_0x5e80('0x3b')]?_0x4fb38d[_0x5e80('0x38')]:_0x119af9[_0x5e80('0x34')];if(!_0x5670ee[_0x5e80('0x35')][_0x5e80('0x3c')]('nolimit')){_0x4fb38d[_0x5e80('0x1c')]=qs[_0x5e80('0x1c')](_0x5670ee[_0x5e80('0x35')][_0x5e80('0x1c')]);_0x4fb38d[_0x5e80('0x1a')]=qs[_0x5e80('0x1a')](_0x5670ee[_0x5e80('0x35')][_0x5e80('0x1a')]);}_0x4fb38d[_0x5e80('0x3d')]=qs[_0x5e80('0x3e')](_0x5670ee['query'][_0x5e80('0x3e')]);_0x4fb38d[_0x5e80('0x3f')]=qs[_0x5e80('0x37')](_[_0x5e80('0x40')](_0x5670ee[_0x5e80('0x35')],_0x119af9[_0x5e80('0x37')]),_0x4db568);if(_0x5670ee[_0x5e80('0x35')]['filter']){_0x4fb38d[_0x5e80('0x3f')]=_[_0x5e80('0x41')](_0x4fb38d[_0x5e80('0x3f')],{'$or':_[_0x5e80('0x2e')](_0x4db568,function(_0x5e664e){if(_0x5e664e['type']!==_0x5e80('0x42')){var _0x5541f8={};_0x5541f8[_0x5e664e[_0x5e80('0x2b')]]={'$like':'%'+_0x5670ee['query'][_0x5e80('0x43')]+'%'};return _0x5541f8;}})});}_0x4fb38d=_[_0x5e80('0x41')]({},_0x4fb38d,_0x5670ee[_0x5e80('0x44')]);var _0x313b0b={'where':_0x4fb38d[_0x5e80('0x3f')]};return db[_0x5e80('0x2f')]['count'](_0x313b0b)[_0x5e80('0x25')](function(_0x447619){_0x3ed196[_0x5e80('0x1d')]=_0x447619;if(_0x5670ee[_0x5e80('0x35')][_0x5e80('0x45')]){_0x4fb38d[_0x5e80('0x46')]=[{'all':!![]}];}return db['WhatsappQueue'][_0x5e80('0x47')](_0x4fb38d);})[_0x5e80('0x25')](function(_0x174d9a){_0x3ed196[_0x5e80('0x48')]=_0x174d9a;return _0x3ed196;})[_0x5e80('0x25')](respondWithFilteredResult(_0x53de1d,_0x4fb38d))['catch'](handleError(_0x53de1d,null));};exports[_0x5e80('0x49')]=function(_0x134a88,_0x3e3a20){var _0x206ae7={'raw':!![],'where':{'id':_0x134a88[_0x5e80('0x4a')]['id']}},_0x1b4c63={};_0x1b4c63['model']=_['keys'](db[_0x5e80('0x2f')][_0x5e80('0x30')]);_0x1b4c63[_0x5e80('0x35')]=_[_0x5e80('0x36')](_0x134a88[_0x5e80('0x35')]);_0x1b4c63['filters']=_[_0x5e80('0x39')](_0x1b4c63[_0x5e80('0x34')],_0x1b4c63[_0x5e80('0x35')]);_0x206ae7['attributes']=_[_0x5e80('0x39')](_0x1b4c63[_0x5e80('0x34')],qs[_0x5e80('0x3a')](_0x134a88[_0x5e80('0x35')][_0x5e80('0x3a')]));_0x206ae7[_0x5e80('0x38')]=_0x206ae7[_0x5e80('0x38')][_0x5e80('0x3b')]?_0x206ae7['attributes']:_0x1b4c63[_0x5e80('0x34')];if(_0x134a88[_0x5e80('0x35')][_0x5e80('0x45')]){_0x206ae7[_0x5e80('0x46')]=[{'all':!![]}];}_0x206ae7=_[_0x5e80('0x41')]({},_0x206ae7,_0x134a88[_0x5e80('0x44')]);return db[_0x5e80('0x2f')][_0x5e80('0x4b')](_0x206ae7)['then'](handleEntityNotFound(_0x3e3a20,null))[_0x5e80('0x25')](respondWithResult(_0x3e3a20,null))[_0x5e80('0x4c')](handleError(_0x3e3a20,null));};exports[_0x5e80('0x4d')]=function(_0x495e1c,_0x41fda1){return db[_0x5e80('0x2f')]['create'](_0x495e1c[_0x5e80('0x4e')],{})['then'](function(_0x283de7){var _0x2a85bd=_0x495e1c[_0x5e80('0x4f')]['get']({'plain':!![]});if(!_0x2a85bd)throw new Error(_0x5e80('0x50'));if(_0x2a85bd['role']===_0x5e80('0x4f')){var _0x39bf71=_0x283de7[_0x5e80('0x26')]({'plain':!![]});var _0x578df5='WhatsappQueues';return db[_0x5e80('0x51')][_0x5e80('0x4b')]({'where':{'name':_0x578df5,'userProfileId':_0x2a85bd[_0x5e80('0x52')]},'raw':!![]})[_0x5e80('0x25')](function(_0x2499dd){if(_0x2499dd&&_0x2499dd[_0x5e80('0x53')]===0x0){return db[_0x5e80('0x54')][_0x5e80('0x4d')]({'name':_0x39bf71['name'],'resourceId':_0x39bf71['id'],'type':_0x2499dd['name'],'sectionId':_0x2499dd['id']},{})['then'](function(){return _0x283de7;});}else{return _0x283de7;}})['catch'](function(_0x57d56b){logger[_0x5e80('0x29')](_0x5e80('0x55'),_0x57d56b);throw _0x57d56b;});}return _0x283de7;})[_0x5e80('0x25')](respondWithResult(_0x41fda1,0xc9))[_0x5e80('0x4c')](handleError(_0x41fda1,null));};exports[_0x5e80('0x23')]=function(_0x247db2,_0x3d9803){if(_0x247db2[_0x5e80('0x4e')]['id']){delete _0x247db2[_0x5e80('0x4e')]['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x247db2[_0x5e80('0x4a')]['id']}})[_0x5e80('0x25')](handleEntityNotFound(_0x3d9803,null))['then'](saveUpdates(_0x247db2[_0x5e80('0x4e')],null))[_0x5e80('0x25')](respondWithResult(_0x3d9803,null))['catch'](handleError(_0x3d9803,null));};exports[_0x5e80('0x24')]=function(_0x19f756,_0x5113d0){return db['WhatsappQueue'][_0x5e80('0x4b')]({'where':{'id':_0x19f756[_0x5e80('0x4a')]['id']}})[_0x5e80('0x25')](handleEntityNotFound(_0x5113d0,null))[_0x5e80('0x25')](removeEntity(_0x5113d0,null))[_0x5e80('0x4c')](handleError(_0x5113d0,null));};exports['describe']=function(_0x208cf0,_0x597314){return db[_0x5e80('0x2f')][_0x5e80('0x56')]()['then'](respondWithResult(_0x597314,null))[_0x5e80('0x4c')](handleError(_0x597314,null));};exports['getMembers']=function(_0x48fee2,_0x580a85,_0x3e9d0a){var _0x34c8dd={'raw':!![],'where':{}},_0x36c974={},_0x15a4ca;return db[_0x5e80('0x2f')][_0x5e80('0x57')]({'where':{'id':_0x48fee2[_0x5e80('0x4a')]['id']}})['then'](handleEntityNotFound(_0x580a85,null))['then'](function(_0x2a5eb3){if(_0x2a5eb3){_0x15a4ca=_0x2a5eb3[_0x5e80('0x26')]({'plain':!![]});_0x36c974[_0x5e80('0x34')]=_[_0x5e80('0x36')](db[_0x5e80('0x58')][_0x5e80('0x30')]);_0x36c974['query']=_[_0x5e80('0x36')](_0x48fee2[_0x5e80('0x35')]);_0x36c974[_0x5e80('0x37')]=_[_0x5e80('0x39')](_0x36c974['model'],_0x36c974['query']);_0x34c8dd[_0x5e80('0x38')]=_[_0x5e80('0x39')](_0x36c974[_0x5e80('0x34')],qs[_0x5e80('0x3a')](_0x48fee2[_0x5e80('0x35')]['fields']));_0x34c8dd[_0x5e80('0x38')]=_0x34c8dd[_0x5e80('0x38')][_0x5e80('0x3b')]?_0x34c8dd[_0x5e80('0x38')]:_0x36c974[_0x5e80('0x34')];if(!_0x48fee2[_0x5e80('0x35')][_0x5e80('0x3c')](_0x5e80('0x59'))){_0x34c8dd[_0x5e80('0x1c')]=qs[_0x5e80('0x1c')](_0x48fee2[_0x5e80('0x35')][_0x5e80('0x1c')]);_0x34c8dd[_0x5e80('0x1a')]=qs[_0x5e80('0x1a')](_0x48fee2['query'][_0x5e80('0x1a')]);}_0x34c8dd['order']=qs[_0x5e80('0x3e')](_0x48fee2[_0x5e80('0x35')]['sort']);_0x34c8dd[_0x5e80('0x3f')]=qs[_0x5e80('0x37')](_[_0x5e80('0x40')](_0x48fee2['query'],_0x36c974[_0x5e80('0x37')]));_0x34c8dd['where'][_0x5e80('0x5a')]=_0x2a5eb3['id'];if(_0x48fee2[_0x5e80('0x35')]['filter']){_0x34c8dd[_0x5e80('0x3f')]=_['merge'](_0x34c8dd[_0x5e80('0x3f')],{'$or':_[_0x5e80('0x2e')](_0x34c8dd[_0x5e80('0x38')],function(_0x3a14d8){var _0x2f2ef2={};_0x2f2ef2[_0x3a14d8]={'$like':'%'+_0x48fee2[_0x5e80('0x35')][_0x5e80('0x43')]+'%'};return _0x2f2ef2;})});}_0x34c8dd=_['merge']({},_0x34c8dd,_0x48fee2[_0x5e80('0x44')]);return db[_0x5e80('0x58')]['findAll'](_0x34c8dd);}})[_0x5e80('0x25')](function(_0x4ec15d){if(_0x4ec15d){return db[_0x5e80('0x5b')][_0x5e80('0x5c')]({'where':{'id':_['map'](_0x4ec15d,_0x5e80('0x5d')),'role':_0x5e80('0x5e')},'attributes':['id','name','whatsappPause','updatedAt','createdAt']});}})[_0x5e80('0x25')](function(_0x6de0a3){if(_0x6de0a3){return{'count':_0x6de0a3[_0x5e80('0x1d')],'rows':_[_0x5e80('0x2e')](_0x6de0a3[_0x5e80('0x48')],function(_0x41381){return{'membername':_0x41381[_0x5e80('0x2b')],'UserId':_0x41381['id'],'queue_name':_0x15a4ca[_0x5e80('0x2b')],'WhatsappQueueId':_0x15a4ca['id'],'interface':util[_0x5e80('0x5f')](_0x5e80('0x60'),_0x5e80('0x61'),_0x41381[_0x5e80('0x2b')]),'penalty':0x0,'paused':_0x41381[_0x5e80('0x62')],'createdAt':_0x41381[_0x5e80('0x63')],'updatedAt':_0x41381[_0x5e80('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x580a85,_0x34c8dd))[_0x5e80('0x4c')](handleError(_0x580a85,null));};exports['getTeams']=function(_0x352291,_0x57ebe8,_0x525070){var _0x42dc86={};var _0x4dfc3a={};var _0x4f340d;var _0x20a9c7;return db['WhatsappQueue'][_0x5e80('0x57')]({'where':{'id':_0x352291['params']['id']}})[_0x5e80('0x25')](handleEntityNotFound(_0x57ebe8,null))[_0x5e80('0x25')](function(_0x1f1156){if(_0x1f1156){_0x4f340d=_0x1f1156;_0x4dfc3a['model']=_[_0x5e80('0x36')](db[_0x5e80('0x65')]['rawAttributes']);_0x4dfc3a[_0x5e80('0x35')]=_[_0x5e80('0x36')](_0x352291[_0x5e80('0x35')]);_0x4dfc3a['filters']=_[_0x5e80('0x39')](_0x4dfc3a[_0x5e80('0x34')],_0x4dfc3a[_0x5e80('0x35')]);_0x42dc86[_0x5e80('0x38')]=_[_0x5e80('0x39')](_0x4dfc3a[_0x5e80('0x34')],qs[_0x5e80('0x3a')](_0x352291[_0x5e80('0x35')][_0x5e80('0x3a')]));_0x42dc86['attributes']=_0x42dc86[_0x5e80('0x38')]['length']?_0x42dc86[_0x5e80('0x38')]:_0x4dfc3a[_0x5e80('0x34')];_0x42dc86[_0x5e80('0x3d')]=qs[_0x5e80('0x3e')](_0x352291[_0x5e80('0x35')]['sort']);_0x42dc86[_0x5e80('0x3f')]=qs[_0x5e80('0x37')](_[_0x5e80('0x40')](_0x352291[_0x5e80('0x35')],_0x4dfc3a[_0x5e80('0x37')]));if(_0x352291['query'][_0x5e80('0x43')]){_0x42dc86['where']=_[_0x5e80('0x41')](_0x42dc86[_0x5e80('0x3f')],{'$or':_['map'](_0x42dc86[_0x5e80('0x38')],function(_0x865513){var _0x4bcac0={};_0x4bcac0[_0x865513]={'$like':'%'+_0x352291['query'][_0x5e80('0x43')]+'%'};return _0x4bcac0;})});}_0x42dc86=_[_0x5e80('0x41')]({},_0x42dc86,_0x352291[_0x5e80('0x44')]);return _0x4f340d[_0x5e80('0x66')](_0x42dc86);}})[_0x5e80('0x25')](function(_0x5513f8){if(_0x5513f8){_0x20a9c7=_0x5513f8['length'];if(!_0x352291[_0x5e80('0x35')]['hasOwnProperty']('nolimit')){_0x42dc86[_0x5e80('0x1c')]=qs[_0x5e80('0x1c')](_0x352291[_0x5e80('0x35')][_0x5e80('0x1c')]);_0x42dc86['offset']=qs[_0x5e80('0x1a')](_0x352291['query']['offset']);}return _0x4f340d[_0x5e80('0x66')](_0x42dc86);}})[_0x5e80('0x25')](function(_0x546fc0){if(_0x546fc0){return _0x546fc0?{'count':_0x20a9c7,'rows':_0x546fc0}:null;}})[_0x5e80('0x25')](respondWithResult(_0x57ebe8,null))[_0x5e80('0x4c')](handleError(_0x57ebe8,null));};exports[_0x5e80('0x67')]=function(_0x252db9,_0x34d350,_0x4ac200){var _0x3d1248=_0x252db9['body'][_0x5e80('0x68')];return db['Team'][_0x5e80('0x47')]({'where':{'id':_0x3d1248},'attributes':['id'],'include':[{'model':db[_0x5e80('0x5b')],'as':_0x5e80('0x69'),'attributes':['id','name',_0x5e80('0x6a'),_0x5e80('0x6b'),_0x5e80('0x6c')],'raw':!![]}]})[_0x5e80('0x25')](function(_0x3c7b01){if(_0x3c7b01){var _0x47ee29=_[_0x5e80('0x6d')](_0x3c7b01,function(_0x317d2d){var _0x18797a=_0x317d2d['get']({'plain':!![]});return _0x18797a[_0x5e80('0x69')];});return db[_0x5e80('0x2f')][_0x5e80('0x4b')]({'where':{'id':_0x252db9[_0x5e80('0x4a')]['id']}})[_0x5e80('0x25')](function(_0x5f3914){return db['sequelize'][_0x5e80('0x6e')](function(_0x3ca721){return _0x5f3914['addTeams'](_0x3d1248,{'transaction':_0x3ca721})['then'](function(){return BPromise[_0x5e80('0x6f')](_0x47ee29,function(_0x293ab8){return db[_0x5e80('0x58')][_0x5e80('0x70')]({'where':{'UserId':_0x293ab8['id'],'WhatsappQueueId':_0x252db9[_0x5e80('0x4a')]['id']},'transaction':_0x3ca721});});})[_0x5e80('0x25')](function(){_0x47ee29[_0x5e80('0x71')](function(_0x4a5b34){socket[_0x5e80('0x72')]('userWhatsappQueue:save',{'UserId':_0x4a5b34['id'],'WhatsappQueueId':_0x5f3914['id']});});});});});}})[_0x5e80('0x25')](respondWithStatusCode(_0x34d350,null))[_0x5e80('0x4c')](handleError(_0x34d350,null));};exports[_0x5e80('0x73')]=function(_0x55ff29,_0x485ee5,_0x4e7c2d){return db[_0x5e80('0x65')][_0x5e80('0x47')]({'where':{'id':_0x55ff29['query'][_0x5e80('0x68')]},'attributes':['id'],'include':[{'model':db[_0x5e80('0x5b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x5e80('0x25')](handleEntityNotFound(_0x485ee5,null))[_0x5e80('0x25')](function(_0x527507){var _0x20d5b1=_[_0x5e80('0x2e')](_0x527507,'id');var _0x34ca41=[];var _0xb67ffc=[];var _0x3734ec=squel[_0x5e80('0x74')]();_0x3734ec[_0x5e80('0x75')](_0x5e80('0x76'))[_0x5e80('0x77')](_0x5e80('0x78'),'tq')[_0x5e80('0x79')](_0x5e80('0x7a'),'ut',_0x5e80('0x7b'))[_0x5e80('0x3f')](_0x5e80('0x7c'),_0x55ff29[_0x5e80('0x4a')]['id']);for(var _0x2ffde7=0x0;_0x2ffde7<_0x527507[_0x5e80('0x3b')];_0x2ffde7+=0x1){let _0x3fe14c=_0x527507[_0x2ffde7];for(var _0x4dc97e=0x0;_0x4dc97e<_0x3fe14c[_0x5e80('0x69')][_0x5e80('0x3b')];_0x4dc97e+=0x1){let _0x1c1cb9=_0x3fe14c['Agents'][_0x4dc97e];var _0x25e562=_0x3734ec[_0x5e80('0x7d')]();_0x25e562['where'](_0x5e80('0x7e'),_0x1c1cb9['id']);_0xb67ffc[_0x5e80('0x7f')](db[_0x5e80('0x80')][_0x5e80('0x35')](_0x25e562[_0x5e80('0x81')](),{'type':db[_0x5e80('0x80')][_0x5e80('0x82')][_0x5e80('0x83')]})[_0x5e80('0x25')](function(_0x2c7018){if(_0x2c7018[_0x5e80('0x3b')]===0x1){return _0x1c1cb9['id'];}else{var _0x2d1c6e=_[_0x5e80('0x84')](_[_0x5e80('0x2e')](_0x2c7018,_0x5e80('0x85')),function(_0x4be6c8){return _['includes'](_0x20d5b1,_0x4be6c8);});if(_0x2d1c6e){return _0x1c1cb9['id'];}}}));}}return BPromise[_0x5e80('0x86')](_0xb67ffc)['then'](function(_0x10dbcb){_0x34ca41=_(_0x34ca41)['union'](_0x10dbcb)[_0x5e80('0x87')]()[_0x5e80('0x88')]();return db[_0x5e80('0x2f')]['find']({'where':{'id':_0x55ff29[_0x5e80('0x4a')]['id']}})[_0x5e80('0x25')](function(_0x2c25bd){return db[_0x5e80('0x80')][_0x5e80('0x6e')](function(_0x585bb0){return _0x2c25bd[_0x5e80('0x73')](_0x55ff29[_0x5e80('0x35')][_0x5e80('0x68')],{'transaction':_0x585bb0})[_0x5e80('0x25')](function(){if(!_[_0x5e80('0x89')](_0x34ca41)){return _0x2c25bd[_0x5e80('0x8a')](_0x34ca41,{'transaction':_0x585bb0});}})['then'](function(){_0x34ca41[_0x5e80('0x71')](function(_0x5786f9){socket[_0x5e80('0x72')](_0x5e80('0x8b'),{'UserId':_0x5786f9,'WhatsappQueueId':_0x2c25bd['id']});});});});});});})[_0x5e80('0x25')](respondWithStatusCode(_0x485ee5,null))[_0x5e80('0x4c')](handleError(_0x485ee5,null));};exports[_0x5e80('0x8c')]=function(_0x40c442,_0x291a9c,_0x538a27){return db[_0x5e80('0x2f')]['find']({'where':{'id':_0x40c442['params']['id']}})['then'](handleEntityNotFound(_0x291a9c,null))['then'](function(_0x4ab215){if(_0x4ab215){return _0x4ab215[_0x5e80('0x8c')](_0x40c442[_0x5e80('0x4e')][_0x5e80('0x68')],_[_0x5e80('0x8d')](_0x40c442[_0x5e80('0x4e')],[_0x5e80('0x68'),'id'])||{})[_0x5e80('0x8e')](function(_0x38b972){for(var _0xdcd223=0x0;_0xdcd223<_0x40c442[_0x5e80('0x4e')][_0x5e80('0x68')][_0x5e80('0x3b')];_0xdcd223+=0x1){socket[_0x5e80('0x72')](_0x5e80('0x8f'),{'UserId':Number(_0x40c442[_0x5e80('0x4e')][_0x5e80('0x68')][_0xdcd223]),'WhatsappQueueId':Number(_0x40c442['params']['id'])});}return _0x38b972;});}})[_0x5e80('0x25')](respondWithResult(_0x291a9c,null))[_0x5e80('0x4c')](handleError(_0x291a9c,null));};exports['removeAgents']=function(_0x2082f6,_0xade73a,_0x879771){return db[_0x5e80('0x2f')][_0x5e80('0x4b')]({'where':{'id':_0x2082f6['params']['id']}})[_0x5e80('0x25')](handleEntityNotFound(_0xade73a,null))['then'](function(_0x48e912){if(_0x48e912){return _0x48e912[_0x5e80('0x8a')](_0x2082f6[_0x5e80('0x35')]['ids'])[_0x5e80('0x25')](function(){if(_[_0x5e80('0x90')](_0x2082f6[_0x5e80('0x35')]['ids'])){for(var _0x3ca6c9=0x0;_0x3ca6c9<_0x2082f6['query'][_0x5e80('0x68')][_0x5e80('0x3b')];_0x3ca6c9+=0x1){socket[_0x5e80('0x72')](_0x5e80('0x8b'),{'UserId':Number(_0x2082f6['query'][_0x5e80('0x68')][_0x3ca6c9]),'WhatsappQueueId':Number(_0x2082f6[_0x5e80('0x4a')]['id'])});}}else{socket[_0x5e80('0x72')](_0x5e80('0x8b'),{'UserId':Number(_0x2082f6[_0x5e80('0x35')][_0x5e80('0x68')]),'WhatsappQueueId':Number(_0x2082f6[_0x5e80('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0xade73a,null))[_0x5e80('0x4c')](handleError(_0xade73a,null));};exports[_0x5e80('0x91')]=function(_0x2b9a3c,_0x232ad4,_0x2860c6){var _0x1f8f73={};var _0x2bc060={};var _0x523519;var _0x3d9c4d;return db[_0x5e80('0x2f')][_0x5e80('0x57')]({'where':{'id':_0x2b9a3c[_0x5e80('0x4a')]['id']}})[_0x5e80('0x25')](handleEntityNotFound(_0x232ad4,null))[_0x5e80('0x25')](function(_0x380407){if(_0x380407){_0x523519=_0x380407;_0x2bc060[_0x5e80('0x34')]=_['keys'](db[_0x5e80('0x5b')]['rawAttributes']);_0x2bc060['query']=_[_0x5e80('0x36')](_0x2b9a3c[_0x5e80('0x35')]);_0x2bc060[_0x5e80('0x37')]=_[_0x5e80('0x39')](_0x2bc060[_0x5e80('0x34')],_0x2bc060[_0x5e80('0x35')]);_0x1f8f73[_0x5e80('0x38')]=_[_0x5e80('0x39')](_0x2bc060['model'],qs['fields'](_0x2b9a3c['query'][_0x5e80('0x3a')]));_0x1f8f73[_0x5e80('0x38')]=_0x1f8f73[_0x5e80('0x38')]['length']?_0x1f8f73[_0x5e80('0x38')]:_0x2bc060[_0x5e80('0x34')];_0x1f8f73['order']=qs[_0x5e80('0x3e')](_0x2b9a3c[_0x5e80('0x35')][_0x5e80('0x3e')]);_0x1f8f73[_0x5e80('0x3f')]=qs[_0x5e80('0x37')](_[_0x5e80('0x40')](_0x2b9a3c['query'],_0x2bc060[_0x5e80('0x37')]));if(_0x2b9a3c['query'][_0x5e80('0x43')]){_0x1f8f73['where']=_[_0x5e80('0x41')](_0x1f8f73[_0x5e80('0x3f')],{'$or':_[_0x5e80('0x2e')](_0x1f8f73[_0x5e80('0x38')],function(_0x257b89){var _0x5cc0c4={};_0x5cc0c4[_0x257b89]={'$like':'%'+_0x2b9a3c[_0x5e80('0x35')][_0x5e80('0x43')]+'%'};return _0x5cc0c4;})});}_0x1f8f73=_[_0x5e80('0x41')]({},_0x1f8f73,_0x2b9a3c[_0x5e80('0x44')]);return _0x523519[_0x5e80('0x91')](_0x1f8f73);}})['then'](function(_0xe35f27){if(_0xe35f27){_0x3d9c4d=_0xe35f27[_0x5e80('0x3b')];if(!_0x2b9a3c[_0x5e80('0x35')][_0x5e80('0x3c')](_0x5e80('0x59'))){_0x1f8f73[_0x5e80('0x1c')]=qs[_0x5e80('0x1c')](_0x2b9a3c['query'][_0x5e80('0x1c')]);_0x1f8f73['offset']=qs[_0x5e80('0x1a')](_0x2b9a3c[_0x5e80('0x35')]['offset']);}return _0x523519['getAgents'](_0x1f8f73);}})['then'](function(_0x5ab6d4){if(_0x5ab6d4){return _0x5ab6d4?{'count':_0x3d9c4d,'rows':_0x5ab6d4}:null;}})['then'](respondWithResult(_0x232ad4,null))['catch'](handleError(_0x232ad4,null));}; \ No newline at end of file +var _0xf06d=['each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','toString','QueryTypes','includes','all','union','compact','value','isEmpty','addAgents','omit','removeAgents','isArray','userWhatsappQueue:remove','getAgents','rawAttributes','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','reject','update','then','destroy','UserProfileResource','stack','name','send','index','map','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','WhatsappQueue','count','includeAll','include','findAll','rows','catch','show','params','length','find','create','user','get','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','flatMap','transaction'];(function(_0x5cafd6,_0x30ff88){var _0xf36246=function(_0x3a833c){while(--_0x3a833c){_0x5cafd6['push'](_0x5cafd6['shift']());}};_0xf36246(++_0x30ff88);}(_0xf06d,0xad));var _0xdf06=function(_0x366324,_0xb4dab7){_0x366324=_0x366324-0x0;var _0x4ca5b9=_0xf06d[_0x366324];return _0x4ca5b9;};'use strict';var emlformat=require(_0xdf06('0x0'));var rimraf=require(_0xdf06('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdf06('0x2'));var rp=require(_0xdf06('0x3'));var moment=require(_0xdf06('0x4'));var BPromise=require(_0xdf06('0x5'));var Mustache=require(_0xdf06('0x6'));var util=require(_0xdf06('0x7'));var path=require(_0xdf06('0x8'));var sox=require(_0xdf06('0x9'));var csv=require(_0xdf06('0xa'));var ejs=require(_0xdf06('0xb'));var fs=require('fs');var fs_extra=require(_0xdf06('0xc'));var _=require(_0xdf06('0xd'));var squel=require(_0xdf06('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdf06('0xf'));var toCsv=require(_0xdf06('0xa'));var querystring=require(_0xdf06('0x10'));var Papa=require(_0xdf06('0x11'));var Redis=require(_0xdf06('0x12'));var authService=require(_0xdf06('0x13'));var qs=require(_0xdf06('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf06('0x15'));var logger=require(_0xdf06('0x16'))(_0xdf06('0x17'));var utils=require(_0xdf06('0x18'));var config=require(_0xdf06('0x19'));var licenseUtil=require(_0xdf06('0x1a'));var db=require(_0xdf06('0x1b'))['db'];config[_0xdf06('0x1c')]=_[_0xdf06('0x1d')](config[_0xdf06('0x1c')],{'host':_0xdf06('0x1e'),'port':0x18eb});var socket=require(_0xdf06('0x1f'))(new Redis(config['redis']));require(_0xdf06('0x20'))[_0xdf06('0x21')](socket);function respondWithStatusCode(_0x3c6991,_0x2cf8fa){_0x2cf8fa=_0x2cf8fa||0xcc;return function(_0x18f2aa){if(_0x18f2aa){return _0x3c6991[_0xdf06('0x22')](_0x2cf8fa);}return _0x3c6991[_0xdf06('0x23')](_0x2cf8fa)[_0xdf06('0x24')]();};}function respondWithResult(_0x44f2ab,_0xebca42){_0xebca42=_0xebca42||0xc8;return function(_0x5db9e0){if(_0x5db9e0){return _0x44f2ab[_0xdf06('0x23')](_0xebca42)[_0xdf06('0x25')](_0x5db9e0);}};}function respondWithFilteredResult(_0x39673b,_0x2c9a91){return function(_0x19ed02){if(_0x19ed02){var _0x1ac2b1=typeof _0x2c9a91[_0xdf06('0x26')]===_0xdf06('0x27')&&typeof _0x2c9a91[_0xdf06('0x28')]===_0xdf06('0x27');var _0x8b7e48=_0x19ed02['count'];var _0xe54801=_0x1ac2b1?0x0:_0x2c9a91[_0xdf06('0x26')];var _0x19f8e0=_0x1ac2b1?_0x19ed02['count']:_0x2c9a91[_0xdf06('0x26')]+_0x2c9a91[_0xdf06('0x28')];var _0x2d575f;if(_0x19f8e0>=_0x8b7e48){_0x19f8e0=_0x8b7e48;_0x2d575f=0xc8;}else{_0x2d575f=0xce;}_0x39673b[_0xdf06('0x23')](_0x2d575f);return _0x39673b[_0xdf06('0x29')]('Content-Range',_0xe54801+'-'+_0x19f8e0+'/'+_0x8b7e48)[_0xdf06('0x25')](_0x19ed02);}return null;};}function patchUpdates(_0x10e4ef){return function(_0x1d3732){try{jsonpatch['apply'](_0x1d3732,_0x10e4ef,!![]);}catch(_0x2f3550){return BPromise[_0xdf06('0x2a')](_0x2f3550);}return _0x1d3732['save']();};}function saveUpdates(_0x1b2571,_0x4ad829){return function(_0x1df700){if(_0x1df700){return _0x1df700[_0xdf06('0x2b')](_0x1b2571)[_0xdf06('0x2c')](function(_0x72261a){return _0x72261a;});}return null;};}function removeEntity(_0x9257d4,_0x3b6ecb){return function(_0x543db8){if(_0x543db8){return _0x543db8[_0xdf06('0x2d')]()[_0xdf06('0x2c')](function(){var _0x5083ab=_0x543db8['get']({'plain':!![]});var _0x438226='WhatsappQueues';return db[_0xdf06('0x2e')]['destroy']({'where':{'type':_0x438226,'resourceId':_0x5083ab['id']}})[_0xdf06('0x2c')](function(){return _0x543db8;});})[_0xdf06('0x2c')](function(){_0x9257d4[_0xdf06('0x23')](0xcc)[_0xdf06('0x24')]();});}};}function handleEntityNotFound(_0x235152,_0xbb8cd4){return function(_0x208e57){if(!_0x208e57){_0x235152[_0xdf06('0x22')](0x194);}return _0x208e57;};}function handleError(_0x5572de,_0x4cb352){_0x4cb352=_0x4cb352||0x1f4;return function(_0x53ebbb){logger['error'](_0x53ebbb[_0xdf06('0x2f')]);if(_0x53ebbb[_0xdf06('0x30')]){delete _0x53ebbb[_0xdf06('0x30')];}_0x5572de['status'](_0x4cb352)[_0xdf06('0x31')](_0x53ebbb);};}exports[_0xdf06('0x32')]=function(_0x5bc190,_0x45a0f6){var _0x31a828={},_0x469d4d={},_0x179d1a={'count':0x0,'rows':[]};var _0xd30716=_[_0xdf06('0x33')](db['WhatsappQueue']['rawAttributes'],function(_0x2f6776){return{'name':_0x2f6776['fieldName'],'type':_0x2f6776[_0xdf06('0x34')][_0xdf06('0x35')]};});_0x469d4d['model']=_[_0xdf06('0x33')](_0xd30716,_0xdf06('0x30'));_0x469d4d['query']=_[_0xdf06('0x36')](_0x5bc190[_0xdf06('0x37')]);_0x469d4d[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x469d4d[_0xdf06('0x3a')],_0x469d4d[_0xdf06('0x37')]);_0x31a828['attributes']=_['intersection'](_0x469d4d[_0xdf06('0x3a')],qs[_0xdf06('0x3b')](_0x5bc190[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x31a828[_0xdf06('0x3c')]=_0x31a828[_0xdf06('0x3c')]['length']?_0x31a828[_0xdf06('0x3c')]:_0x469d4d['model'];if(!_0x5bc190[_0xdf06('0x37')][_0xdf06('0x3d')](_0xdf06('0x3e'))){_0x31a828[_0xdf06('0x28')]=qs[_0xdf06('0x28')](_0x5bc190[_0xdf06('0x37')]['limit']);_0x31a828[_0xdf06('0x26')]=qs[_0xdf06('0x26')](_0x5bc190['query']['offset']);}_0x31a828[_0xdf06('0x3f')]=qs[_0xdf06('0x40')](_0x5bc190[_0xdf06('0x37')][_0xdf06('0x40')]);_0x31a828['where']=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x5bc190[_0xdf06('0x37')],_0x469d4d[_0xdf06('0x38')]),_0xd30716);if(_0x5bc190[_0xdf06('0x37')][_0xdf06('0x42')]){_0x31a828[_0xdf06('0x43')]=_['merge'](_0x31a828[_0xdf06('0x43')],{'$or':_[_0xdf06('0x33')](_0xd30716,function(_0x4592a9){if(_0x4592a9[_0xdf06('0x34')]!==_0xdf06('0x44')){var _0x41f64d={};_0x41f64d[_0x4592a9['name']]={'$like':'%'+_0x5bc190['query'][_0xdf06('0x42')]+'%'};return _0x41f64d;}})});}_0x31a828=_[_0xdf06('0x45')]({},_0x31a828,_0x5bc190[_0xdf06('0x46')]);var _0x2b0b41={'where':_0x31a828[_0xdf06('0x43')]};return db[_0xdf06('0x47')][_0xdf06('0x48')](_0x2b0b41)['then'](function(_0x22d6cb){_0x179d1a[_0xdf06('0x48')]=_0x22d6cb;if(_0x5bc190[_0xdf06('0x37')][_0xdf06('0x49')]){_0x31a828[_0xdf06('0x4a')]=[{'all':!![]}];}return db[_0xdf06('0x47')][_0xdf06('0x4b')](_0x31a828);})[_0xdf06('0x2c')](function(_0x369894){_0x179d1a[_0xdf06('0x4c')]=_0x369894;return _0x179d1a;})[_0xdf06('0x2c')](respondWithFilteredResult(_0x45a0f6,_0x31a828))[_0xdf06('0x4d')](handleError(_0x45a0f6,null));};exports[_0xdf06('0x4e')]=function(_0x425bcf,_0xecec3c){var _0x49dfa3={'raw':!![],'where':{'id':_0x425bcf[_0xdf06('0x4f')]['id']}},_0x31abe6={};_0x31abe6[_0xdf06('0x3a')]=_[_0xdf06('0x36')](db[_0xdf06('0x47')]['rawAttributes']);_0x31abe6[_0xdf06('0x37')]=_[_0xdf06('0x36')](_0x425bcf[_0xdf06('0x37')]);_0x31abe6[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x31abe6[_0xdf06('0x3a')],_0x31abe6[_0xdf06('0x37')]);_0x49dfa3[_0xdf06('0x3c')]=_['intersection'](_0x31abe6['model'],qs['fields'](_0x425bcf[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x49dfa3[_0xdf06('0x3c')]=_0x49dfa3[_0xdf06('0x3c')][_0xdf06('0x50')]?_0x49dfa3[_0xdf06('0x3c')]:_0x31abe6[_0xdf06('0x3a')];if(_0x425bcf['query'][_0xdf06('0x49')]){_0x49dfa3['include']=[{'all':!![]}];}_0x49dfa3=_[_0xdf06('0x45')]({},_0x49dfa3,_0x425bcf[_0xdf06('0x46')]);return db[_0xdf06('0x47')][_0xdf06('0x51')](_0x49dfa3)[_0xdf06('0x2c')](handleEntityNotFound(_0xecec3c,null))['then'](respondWithResult(_0xecec3c,null))['catch'](handleError(_0xecec3c,null));};exports[_0xdf06('0x52')]=function(_0x6745df,_0x4a31c2){return db['WhatsappQueue'][_0xdf06('0x52')](_0x6745df['body'],{})[_0xdf06('0x2c')](function(_0x1f5e5f){var _0x1443b8=_0x6745df[_0xdf06('0x53')][_0xdf06('0x54')]({'plain':!![]});if(!_0x1443b8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1443b8[_0xdf06('0x55')]===_0xdf06('0x53')){var _0xf73a52=_0x1f5e5f[_0xdf06('0x54')]({'plain':!![]});var _0x363535='WhatsappQueues';return db[_0xdf06('0x56')]['find']({'where':{'name':_0x363535,'userProfileId':_0x1443b8[_0xdf06('0x57')]},'raw':!![]})[_0xdf06('0x2c')](function(_0x53d7aa){if(_0x53d7aa&&_0x53d7aa[_0xdf06('0x58')]===0x0){return db[_0xdf06('0x2e')]['create']({'name':_0xf73a52['name'],'resourceId':_0xf73a52['id'],'type':_0x53d7aa[_0xdf06('0x30')],'sectionId':_0x53d7aa['id']},{})[_0xdf06('0x2c')](function(){return _0x1f5e5f;});}else{return _0x1f5e5f;}})[_0xdf06('0x4d')](function(_0x3e73bd){logger[_0xdf06('0x59')](_0xdf06('0x5a'),_0x3e73bd);throw _0x3e73bd;});}return _0x1f5e5f;})[_0xdf06('0x2c')](respondWithResult(_0x4a31c2,0xc9))[_0xdf06('0x4d')](handleError(_0x4a31c2,null));};exports[_0xdf06('0x2b')]=function(_0x59570c,_0x3f5cbd){if(_0x59570c[_0xdf06('0x5b')]['id']){delete _0x59570c[_0xdf06('0x5b')]['id'];}return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x59570c[_0xdf06('0x4f')]['id']}})[_0xdf06('0x2c')](handleEntityNotFound(_0x3f5cbd,null))['then'](saveUpdates(_0x59570c['body'],null))[_0xdf06('0x2c')](respondWithResult(_0x3f5cbd,null))['catch'](handleError(_0x3f5cbd,null));};exports['destroy']=function(_0x2ca9f1,_0x2e8aa4){return db['WhatsappQueue'][_0xdf06('0x51')]({'where':{'id':_0x2ca9f1[_0xdf06('0x4f')]['id']}})[_0xdf06('0x2c')](handleEntityNotFound(_0x2e8aa4,null))[_0xdf06('0x2c')](removeEntity(_0x2e8aa4,null))[_0xdf06('0x4d')](handleError(_0x2e8aa4,null));};exports[_0xdf06('0x5c')]=function(_0x5016db,_0x45eb8d){return db[_0xdf06('0x47')][_0xdf06('0x5c')]()[_0xdf06('0x2c')](respondWithResult(_0x45eb8d,null))[_0xdf06('0x4d')](handleError(_0x45eb8d,null));};exports[_0xdf06('0x5d')]=function(_0x63599e,_0x1ff232,_0x34f85e){var _0x604c8d={'raw':!![],'where':{}},_0x2c8f71={},_0x279927;return db[_0xdf06('0x47')][_0xdf06('0x5e')]({'where':{'id':_0x63599e[_0xdf06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1ff232,null))[_0xdf06('0x2c')](function(_0x22aa0d){if(_0x22aa0d){_0x279927=_0x22aa0d[_0xdf06('0x54')]({'plain':!![]});_0x2c8f71['model']=_['keys'](db[_0xdf06('0x5f')]['rawAttributes']);_0x2c8f71[_0xdf06('0x37')]=_[_0xdf06('0x36')](_0x63599e[_0xdf06('0x37')]);_0x2c8f71[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x2c8f71[_0xdf06('0x3a')],_0x2c8f71[_0xdf06('0x37')]);_0x604c8d[_0xdf06('0x3c')]=_[_0xdf06('0x39')](_0x2c8f71[_0xdf06('0x3a')],qs['fields'](_0x63599e[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x604c8d[_0xdf06('0x3c')]=_0x604c8d[_0xdf06('0x3c')][_0xdf06('0x50')]?_0x604c8d[_0xdf06('0x3c')]:_0x2c8f71[_0xdf06('0x3a')];if(!_0x63599e['query'][_0xdf06('0x3d')](_0xdf06('0x3e'))){_0x604c8d[_0xdf06('0x28')]=qs[_0xdf06('0x28')](_0x63599e['query'][_0xdf06('0x28')]);_0x604c8d[_0xdf06('0x26')]=qs[_0xdf06('0x26')](_0x63599e[_0xdf06('0x37')]['offset']);}_0x604c8d[_0xdf06('0x3f')]=qs[_0xdf06('0x40')](_0x63599e[_0xdf06('0x37')][_0xdf06('0x40')]);_0x604c8d['where']=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x63599e[_0xdf06('0x37')],_0x2c8f71[_0xdf06('0x38')]));_0x604c8d[_0xdf06('0x43')][_0xdf06('0x60')]=_0x22aa0d['id'];if(_0x63599e['query']['filter']){_0x604c8d[_0xdf06('0x43')]=_['merge'](_0x604c8d[_0xdf06('0x43')],{'$or':_['map'](_0x604c8d[_0xdf06('0x3c')],function(_0x88c8f8){var _0xb37146={};_0xb37146[_0x88c8f8]={'$like':'%'+_0x63599e[_0xdf06('0x37')][_0xdf06('0x42')]+'%'};return _0xb37146;})});}_0x604c8d=_['merge']({},_0x604c8d,_0x63599e['options']);return db[_0xdf06('0x5f')][_0xdf06('0x4b')](_0x604c8d);}})['then'](function(_0x582e75){if(_0x582e75){return db[_0xdf06('0x61')][_0xdf06('0x62')]({'where':{'id':_[_0xdf06('0x33')](_0x582e75,_0xdf06('0x63')),'role':'agent'},'attributes':['id',_0xdf06('0x30'),_0xdf06('0x64'),_0xdf06('0x65'),_0xdf06('0x66')]});}})[_0xdf06('0x2c')](function(_0x9e1796){if(_0x9e1796){return{'count':_0x9e1796[_0xdf06('0x48')],'rows':_['map'](_0x9e1796[_0xdf06('0x4c')],function(_0x334dfd){return{'membername':_0x334dfd[_0xdf06('0x30')],'UserId':_0x334dfd['id'],'queue_name':_0x279927[_0xdf06('0x30')],'WhatsappQueueId':_0x279927['id'],'interface':util['format'](_0xdf06('0x67'),_0xdf06('0x68'),_0x334dfd[_0xdf06('0x30')]),'penalty':0x0,'paused':_0x334dfd[_0xdf06('0x64')],'createdAt':_0x334dfd[_0xdf06('0x66')],'updatedAt':_0x334dfd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xdf06('0x2c')](respondWithFilteredResult(_0x1ff232,_0x604c8d))[_0xdf06('0x4d')](handleError(_0x1ff232,null));};exports['getTeams']=function(_0x78deb5,_0x1f3b02,_0x44cae1){var _0x37d79f={};var _0x5b42cc={};var _0x237b10;var _0x1d2dd1;return db[_0xdf06('0x47')]['findOne']({'where':{'id':_0x78deb5[_0xdf06('0x4f')]['id']}})[_0xdf06('0x2c')](handleEntityNotFound(_0x1f3b02,null))['then'](function(_0x56e9d6){if(_0x56e9d6){_0x237b10=_0x56e9d6;_0x5b42cc[_0xdf06('0x3a')]=_[_0xdf06('0x36')](db[_0xdf06('0x69')]['rawAttributes']);_0x5b42cc[_0xdf06('0x37')]=_[_0xdf06('0x36')](_0x78deb5[_0xdf06('0x37')]);_0x5b42cc[_0xdf06('0x38')]=_['intersection'](_0x5b42cc[_0xdf06('0x3a')],_0x5b42cc['query']);_0x37d79f['attributes']=_['intersection'](_0x5b42cc[_0xdf06('0x3a')],qs[_0xdf06('0x3b')](_0x78deb5['query'][_0xdf06('0x3b')]));_0x37d79f[_0xdf06('0x3c')]=_0x37d79f[_0xdf06('0x3c')]['length']?_0x37d79f['attributes']:_0x5b42cc['model'];_0x37d79f['order']=qs['sort'](_0x78deb5[_0xdf06('0x37')][_0xdf06('0x40')]);_0x37d79f['where']=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x78deb5[_0xdf06('0x37')],_0x5b42cc[_0xdf06('0x38')]));if(_0x78deb5[_0xdf06('0x37')]['filter']){_0x37d79f['where']=_[_0xdf06('0x45')](_0x37d79f[_0xdf06('0x43')],{'$or':_[_0xdf06('0x33')](_0x37d79f[_0xdf06('0x3c')],function(_0x2cd8b2){var _0xa3eaef={};_0xa3eaef[_0x2cd8b2]={'$like':'%'+_0x78deb5[_0xdf06('0x37')][_0xdf06('0x42')]+'%'};return _0xa3eaef;})});}_0x37d79f=_['merge']({},_0x37d79f,_0x78deb5[_0xdf06('0x46')]);return _0x237b10['getTeams'](_0x37d79f);}})[_0xdf06('0x2c')](function(_0x4df969){if(_0x4df969){_0x1d2dd1=_0x4df969['length'];if(!_0x78deb5[_0xdf06('0x37')][_0xdf06('0x3d')](_0xdf06('0x3e'))){_0x37d79f[_0xdf06('0x28')]=qs['limit'](_0x78deb5[_0xdf06('0x37')][_0xdf06('0x28')]);_0x37d79f['offset']=qs['offset'](_0x78deb5[_0xdf06('0x37')][_0xdf06('0x26')]);}return _0x237b10[_0xdf06('0x6a')](_0x37d79f);}})[_0xdf06('0x2c')](function(_0x53b1a5){if(_0x53b1a5){return _0x53b1a5?{'count':_0x1d2dd1,'rows':_0x53b1a5}:null;}})[_0xdf06('0x2c')](respondWithResult(_0x1f3b02,null))['catch'](handleError(_0x1f3b02,null));};exports[_0xdf06('0x6b')]=function(_0x31877e,_0xe91cf,_0x1ef392){var _0x17047b=_0x31877e[_0xdf06('0x5b')][_0xdf06('0x6c')];return db['Team']['findAll']({'where':{'id':_0x17047b},'attributes':['id'],'include':[{'model':db[_0xdf06('0x61')],'as':_0xdf06('0x6d'),'attributes':['id','name',_0xdf06('0x6e'),'voicePause','interface'],'raw':!![]}]})[_0xdf06('0x2c')](function(_0x1a1a70){if(_0x1a1a70){var _0x223aa6=_[_0xdf06('0x6f')](_0x1a1a70,function(_0x55e199){var _0x4c3696=_0x55e199[_0xdf06('0x54')]({'plain':!![]});return _0x4c3696['Agents'];});return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x31877e[_0xdf06('0x4f')]['id']}})['then'](function(_0x49b480){return db['sequelize'][_0xdf06('0x70')](function(_0x4f60b2){return _0x49b480[_0xdf06('0x6b')](_0x17047b,{'transaction':_0x4f60b2})[_0xdf06('0x2c')](function(){return BPromise[_0xdf06('0x71')](_0x223aa6,function(_0xa9beb2){return db['UserWhatsappQueue'][_0xdf06('0x72')]({'where':{'UserId':_0xa9beb2['id'],'WhatsappQueueId':_0x31877e['params']['id']},'transaction':_0x4f60b2});});})[_0xdf06('0x2c')](function(){_0x223aa6[_0xdf06('0x73')](function(_0x3ebcd8){socket[_0xdf06('0x74')](_0xdf06('0x75'),{'UserId':_0x3ebcd8['id'],'WhatsappQueueId':_0x49b480['id']});});});});});}})['then'](respondWithStatusCode(_0xe91cf,null))[_0xdf06('0x4d')](handleError(_0xe91cf,null));};exports[_0xdf06('0x76')]=function(_0x5b0b9f,_0x5be493,_0x232c03){return db['Team'][_0xdf06('0x4b')]({'where':{'id':_0x5b0b9f['query'][_0xdf06('0x6c')]},'attributes':['id'],'include':[{'model':db[_0xdf06('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdf06('0x2c')](handleEntityNotFound(_0x5be493,null))[_0xdf06('0x2c')](function(_0x30613c){var _0xf40faa=_['map'](_0x30613c,'id');var _0x50e3a0=[];var _0x59554c=[];var _0x1a0c7a=squel['select']();_0x1a0c7a[_0xdf06('0x77')](_0xdf06('0x78'))[_0xdf06('0x79')](_0xdf06('0x7a'),'tq')[_0xdf06('0x7b')](_0xdf06('0x7c'),'ut',_0xdf06('0x7d'))[_0xdf06('0x43')]('WhatsappQueueId\x20=\x20?',_0x5b0b9f[_0xdf06('0x4f')]['id']);for(var _0x2be99b=0x0;_0x2be99b<_0x30613c[_0xdf06('0x50')];_0x2be99b+=0x1){let _0x3f225d=_0x30613c[_0x2be99b];for(var _0xcf3871=0x0;_0xcf3871<_0x3f225d['Agents'][_0xdf06('0x50')];_0xcf3871+=0x1){let _0x2a32e5=_0x3f225d[_0xdf06('0x6d')][_0xcf3871];var _0x9b05fa=_0x1a0c7a['clone']();_0x9b05fa[_0xdf06('0x43')]('ut.UserId\x20=\x20?',_0x2a32e5['id']);_0x59554c[_0xdf06('0x7e')](db[_0xdf06('0x7f')]['query'](_0x9b05fa[_0xdf06('0x80')](),{'type':db[_0xdf06('0x7f')][_0xdf06('0x81')]['SELECT']})[_0xdf06('0x2c')](function(_0x40c9b8){if(_0x40c9b8[_0xdf06('0x50')]===0x1){return _0x2a32e5['id'];}else{var _0x547eb3=_['every'](_['map'](_0x40c9b8,'TeamId'),function(_0x21e449){return _[_0xdf06('0x82')](_0xf40faa,_0x21e449);});if(_0x547eb3){return _0x2a32e5['id'];}}}));}}return BPromise[_0xdf06('0x83')](_0x59554c)[_0xdf06('0x2c')](function(_0x2386ee){_0x50e3a0=_(_0x50e3a0)[_0xdf06('0x84')](_0x2386ee)[_0xdf06('0x85')]()[_0xdf06('0x86')]();return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x5b0b9f['params']['id']}})['then'](function(_0x30de86){return db[_0xdf06('0x7f')][_0xdf06('0x70')](function(_0x659996){return _0x30de86[_0xdf06('0x76')](_0x5b0b9f['query'][_0xdf06('0x6c')],{'transaction':_0x659996})['then'](function(){if(!_[_0xdf06('0x87')](_0x50e3a0)){return _0x30de86['removeAgents'](_0x50e3a0,{'transaction':_0x659996});}})[_0xdf06('0x2c')](function(){_0x50e3a0[_0xdf06('0x73')](function(_0x492cb5){socket[_0xdf06('0x74')]('userWhatsappQueue:remove',{'UserId':_0x492cb5,'WhatsappQueueId':_0x30de86['id']});});});});});});})['then'](respondWithStatusCode(_0x5be493,null))['catch'](handleError(_0x5be493,null));};exports[_0xdf06('0x88')]=function(_0x25da7c,_0x19b6df,_0x4130d6){return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x25da7c[_0xdf06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19b6df,null))['then'](function(_0x5c3557){if(_0x5c3557){return _0x5c3557[_0xdf06('0x88')](_0x25da7c[_0xdf06('0x5b')]['ids'],_[_0xdf06('0x89')](_0x25da7c[_0xdf06('0x5b')],['ids','id'])||{})['spread'](function(_0x205fd0){for(var _0x42f4f5=0x0;_0x42f4f5<_0x25da7c[_0xdf06('0x5b')]['ids'][_0xdf06('0x50')];_0x42f4f5+=0x1){socket['emit'](_0xdf06('0x75'),{'UserId':Number(_0x25da7c['body'][_0xdf06('0x6c')][_0x42f4f5]),'WhatsappQueueId':Number(_0x25da7c['params']['id'])});}return _0x205fd0;});}})[_0xdf06('0x2c')](respondWithResult(_0x19b6df,null))[_0xdf06('0x4d')](handleError(_0x19b6df,null));};exports[_0xdf06('0x8a')]=function(_0x149ad7,_0x2874ad,_0x5de2a6){return db[_0xdf06('0x47')][_0xdf06('0x51')]({'where':{'id':_0x149ad7['params']['id']}})['then'](handleEntityNotFound(_0x2874ad,null))['then'](function(_0x1d1cc0){if(_0x1d1cc0){return _0x1d1cc0['removeAgents'](_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')])[_0xdf06('0x2c')](function(){if(_[_0xdf06('0x8b')](_0x149ad7['query'][_0xdf06('0x6c')])){for(var _0x11085f=0x0;_0x11085f<_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')][_0xdf06('0x50')];_0x11085f+=0x1){socket['emit'](_0xdf06('0x8c'),{'UserId':Number(_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')][_0x11085f]),'WhatsappQueueId':Number(_0x149ad7[_0xdf06('0x4f')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x149ad7[_0xdf06('0x37')][_0xdf06('0x6c')]),'WhatsappQueueId':Number(_0x149ad7[_0xdf06('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0x2874ad,null))['catch'](handleError(_0x2874ad,null));};exports[_0xdf06('0x8d')]=function(_0x3ce4bd,_0x31a33c,_0x44f27f){var _0x5343d7={};var _0x35b92c={};var _0xc9bdac;var _0x2aece7;return db[_0xdf06('0x47')][_0xdf06('0x5e')]({'where':{'id':_0x3ce4bd[_0xdf06('0x4f')]['id']}})['then'](handleEntityNotFound(_0x31a33c,null))[_0xdf06('0x2c')](function(_0x2654b9){if(_0x2654b9){_0xc9bdac=_0x2654b9;_0x35b92c[_0xdf06('0x3a')]=_['keys'](db[_0xdf06('0x61')][_0xdf06('0x8e')]);_0x35b92c[_0xdf06('0x37')]=_['keys'](_0x3ce4bd['query']);_0x35b92c[_0xdf06('0x38')]=_[_0xdf06('0x39')](_0x35b92c[_0xdf06('0x3a')],_0x35b92c[_0xdf06('0x37')]);_0x5343d7['attributes']=_['intersection'](_0x35b92c[_0xdf06('0x3a')],qs['fields'](_0x3ce4bd[_0xdf06('0x37')][_0xdf06('0x3b')]));_0x5343d7[_0xdf06('0x3c')]=_0x5343d7[_0xdf06('0x3c')][_0xdf06('0x50')]?_0x5343d7['attributes']:_0x35b92c[_0xdf06('0x3a')];_0x5343d7[_0xdf06('0x3f')]=qs[_0xdf06('0x40')](_0x3ce4bd[_0xdf06('0x37')][_0xdf06('0x40')]);_0x5343d7[_0xdf06('0x43')]=qs[_0xdf06('0x38')](_[_0xdf06('0x41')](_0x3ce4bd[_0xdf06('0x37')],_0x35b92c[_0xdf06('0x38')]));if(_0x3ce4bd[_0xdf06('0x37')][_0xdf06('0x42')]){_0x5343d7['where']=_[_0xdf06('0x45')](_0x5343d7[_0xdf06('0x43')],{'$or':_['map'](_0x5343d7[_0xdf06('0x3c')],function(_0x126d80){var _0x1f6f6b={};_0x1f6f6b[_0x126d80]={'$like':'%'+_0x3ce4bd['query'][_0xdf06('0x42')]+'%'};return _0x1f6f6b;})});}_0x5343d7=_[_0xdf06('0x45')]({},_0x5343d7,_0x3ce4bd[_0xdf06('0x46')]);return _0xc9bdac[_0xdf06('0x8d')](_0x5343d7);}})[_0xdf06('0x2c')](function(_0xc7dea6){if(_0xc7dea6){_0x2aece7=_0xc7dea6['length'];if(!_0x3ce4bd['query']['hasOwnProperty'](_0xdf06('0x3e'))){_0x5343d7['limit']=qs[_0xdf06('0x28')](_0x3ce4bd['query']['limit']);_0x5343d7['offset']=qs['offset'](_0x3ce4bd['query']['offset']);}return _0xc9bdac[_0xdf06('0x8d')](_0x5343d7);}})[_0xdf06('0x2c')](function(_0x51788d){if(_0x51788d){return _0x51788d?{'count':_0x2aece7,'rows':_0x51788d}:null;}})['then'](respondWithResult(_0x31a33c,null))['catch'](handleError(_0x31a33c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index a97f068..5a01ea0 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 _0x9bd1=['setMaxListeners','save','update','remove','emit','events','../../mysqldb','WhatsappQueue'];(function(_0x581598,_0x49cb87){var _0x587bce=function(_0x3ad484){while(--_0x3ad484){_0x581598['push'](_0x581598['shift']());}};_0x587bce(++_0x49cb87);}(_0x9bd1,0x9d));var _0x19bd=function(_0x2234ac,_0x1ebd84){_0x2234ac=_0x2234ac-0x0;var _0x287fc4=_0x9bd1[_0x2234ac];return _0x287fc4;};'use strict';var EventEmitter=require(_0x19bd('0x0'));var WhatsappQueue=require(_0x19bd('0x1'))['db'][_0x19bd('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x19bd('0x3')](0x0);var events={'afterCreate':_0x19bd('0x4'),'afterUpdate':_0x19bd('0x5'),'afterDestroy':_0x19bd('0x6')};function emitEvent(_0x910bf){return function(_0x39c097,_0x393348,_0x456673){WhatsappQueueEvents[_0x19bd('0x7')](_0x910bf+':'+_0x39c097['id'],_0x39c097);WhatsappQueueEvents['emit'](_0x910bf,_0x39c097);_0x456673(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0x883b=['../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0x883b,0x117));var _0xb883=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x883b[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xb883('0x0'))['db'][_0xb883('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xb883('0x2')](0x0);var events={'afterCreate':_0xb883('0x3'),'afterUpdate':_0xb883('0x4'),'afterDestroy':_0xb883('0x5')};function emitEvent(_0x2a90aa){return function(_0xdf580f,_0x50f192,_0x3deebb){WhatsappQueueEvents[_0xb883('0x6')](_0x2a90aa+':'+_0xdf580f['id'],_0xdf580f);WhatsappQueueEvents[_0xb883('0x6')](_0x2a90aa,_0xdf580f);_0x3deebb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xb883('0x7')](e,emitEvent(event));}}module[_0xb883('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index ccbd947..07aa4ae 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 _0x3c50=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','WhatsappQueue','whatsapp_queues'];(function(_0x13f445,_0x43c530){var _0x84d06c=function(_0x516677){while(--_0x516677){_0x13f445['push'](_0x13f445['shift']());}};_0x84d06c(++_0x43c530);}(_0x3c50,0x111));var _0x03c5=function(_0x34d3d8,_0xc70394){_0x34d3d8=_0x34d3d8-0x0;var _0x372ef2=_0x3c50[_0x34d3d8];return _0x372ef2;};'use strict';var _=require(_0x03c5('0x0'));var util=require(_0x03c5('0x1'));var logger=require(_0x03c5('0x2'))(_0x03c5('0x3'));var moment=require(_0x03c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x03c5('0x5'));var fs=require('fs');var path=require(_0x03c5('0x6'));var rimraf=require(_0x03c5('0x7'));var config=require(_0x03c5('0x8'));var attributes=require(_0x03c5('0x9'));module[_0x03c5('0xa')]=function(_0x2d7bb7,_0x1a6c29){return _0x2d7bb7['define'](_0x03c5('0xb'),attributes,{'tableName':_0x03c5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70be=['rimraf','../../config/environment','exports','define','lodash','../../config/logger','api','request-promise','path'];(function(_0x2bef27,_0x4cc724){var _0x278472=function(_0x3af420){while(--_0x3af420){_0x2bef27['push'](_0x2bef27['shift']());}};_0x278472(++_0x4cc724);}(_0x70be,0x175));var _0xe70b=function(_0x1689d5,_0x2b06cf){_0x1689d5=_0x1689d5-0x0;var _0xe4fb84=_0x70be[_0x1689d5];return _0xe4fb84;};'use strict';var _=require(_0xe70b('0x0'));var util=require('util');var logger=require(_0xe70b('0x1'))(_0xe70b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe70b('0x3'));var fs=require('fs');var path=require(_0xe70b('0x4'));var rimraf=require(_0xe70b('0x5'));var config=require(_0xe70b('0x6'));var attributes=require('./whatsappQueue.attributes');module[_0xe70b('0x7')]=function(_0x4a2ec4,_0x323288){return _0x4a2ec4[_0xe70b('0x8')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 900fc94..63ab111 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 _0x7455=['ShowWhatsappQueue','raw','where','then','debug','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','WhatsappQueue,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','attributes','limit','include','model','map','stringify'];(function(_0x52997d,_0x1af1f7){var _0x214f46=function(_0x1ef758){while(--_0x1ef758){_0x52997d['push'](_0x52997d['shift']());}};_0x214f46(++_0x1af1f7);}(_0x7455,0x163));var _0x5745=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7455[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5745('0x0'));var BPromise=require(_0x5745('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5745('0x2'))['db'];var utils=require(_0x5745('0x3'));var logger=require(_0x5745('0x4'))('rpc');var config=require(_0x5745('0x5'));var jayson=require(_0x5745('0x6'));var client=jayson[_0x5745('0x7')]['http']({'port':0x232a});config[_0x5745('0x8')]=_[_0x5745('0x9')](config[_0x5745('0x8')],{'host':_0x5745('0xa'),'port':0x18eb});var socket=require(_0x5745('0xb'))(new Redis(config[_0x5745('0x8')]));require('./whatsappQueue.socket')['register'](socket);function respondWithRpcPromise(_0x43d234,_0x2b4716,_0xf2b058){return new BPromise(function(_0x22261c,_0x39f496){return client['request'](_0x43d234,_0xf2b058)['then'](function(_0x1c641a){logger['info'](_0x5745('0xc'),_0x2b4716,'request\x20sent');logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x2b4716,_0x5745('0xd'),JSON['stringify'](_0x1c641a));if(_0x1c641a['error']){if(_0x1c641a[_0x5745('0xe')][_0x5745('0xf')]===0x1f4){logger[_0x5745('0xe')](_0x5745('0xc'),_0x2b4716,_0x1c641a[_0x5745('0xe')][_0x5745('0x10')]);return _0x39f496(_0x1c641a['error'][_0x5745('0x10')]);}logger[_0x5745('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x2b4716,_0x1c641a[_0x5745('0xe')]['message']);return _0x22261c(_0x1c641a['error'][_0x5745('0x10')]);}else{logger[_0x5745('0x11')](_0x5745('0xc'),_0x2b4716,_0x5745('0xd'));_0x22261c(_0x1c641a[_0x5745('0x12')][_0x5745('0x10')]);}})[_0x5745('0x13')](function(_0x445ddd){logger[_0x5745('0xe')](_0x5745('0xc'),_0x2b4716,_0x445ddd);_0x39f496(_0x445ddd);});});}exports[_0x5745('0x14')]=function(_0x5bc2ea){var _0x5cf313=this;return new Promise(function(_0x2a78c3,_0x1a0889){return db[_0x5745('0x15')][_0x5745('0x16')]({'raw':_0x5bc2ea['options']?_0x5bc2ea['options']['raw']===undefined?!![]:![]:!![],'where':_0x5bc2ea[_0x5745('0x17')]?_0x5bc2ea[_0x5745('0x17')]['where']||null:null,'attributes':_0x5bc2ea[_0x5745('0x17')]?_0x5bc2ea[_0x5745('0x17')][_0x5745('0x18')]||null:null,'limit':_0x5bc2ea[_0x5745('0x17')]?_0x5bc2ea[_0x5745('0x17')][_0x5745('0x19')]||null:null,'include':_0x5bc2ea[_0x5745('0x17')]?_0x5bc2ea['options']['include']?_['map'](_0x5bc2ea['options'][_0x5745('0x1a')],function(_0x396850){return{'model':db[_0x396850[_0x5745('0x1b')]],'as':_0x396850['as'],'attributes':_0x396850[_0x5745('0x18')],'include':_0x396850['include']?_[_0x5745('0x1c')](_0x396850[_0x5745('0x1a')],function(_0x3ff4e5){return{'model':db[_0x3ff4e5[_0x5745('0x1b')]],'as':_0x3ff4e5['as'],'attributes':_0x3ff4e5[_0x5745('0x18')],'include':_0x3ff4e5[_0x5745('0x1a')]?_[_0x5745('0x1c')](_0x3ff4e5[_0x5745('0x1a')],function(_0x1d0686){return{'model':db[_0x1d0686[_0x5745('0x1b')]],'as':_0x1d0686['as'],'attributes':_0x1d0686[_0x5745('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a21bf){logger['info']('GetWhatsappQueue',_0x5bc2ea);logger['debug'](_0x5745('0x14'),_0x5bc2ea,JSON[_0x5745('0x1d')](_0x4a21bf));_0x2a78c3(_0x4a21bf);})[_0x5745('0x13')](function(_0x8b0621){logger['error'](_0x5745('0x14'),_0x8b0621[_0x5745('0x10')],_0x5bc2ea);_0x1a0889(_0x5cf313[_0x5745('0xe')](0x1f4,_0x8b0621['message']));});});};exports[_0x5745('0x1e')]=function(_0x5d2d5f){var _0x2a96dd=this;return new Promise(function(_0x21c88b,_0x3055d7){return db[_0x5745('0x15')]['find']({'raw':_0x5d2d5f[_0x5745('0x17')]?_0x5d2d5f['options'][_0x5745('0x1f')]===undefined?!![]:![]:!![],'where':_0x5d2d5f[_0x5745('0x17')]?_0x5d2d5f[_0x5745('0x17')][_0x5745('0x20')]||null:null,'attributes':_0x5d2d5f[_0x5745('0x17')]?_0x5d2d5f[_0x5745('0x17')][_0x5745('0x18')]||null:null,'include':_0x5d2d5f['options']?_0x5d2d5f[_0x5745('0x17')][_0x5745('0x1a')]?_[_0x5745('0x1c')](_0x5d2d5f[_0x5745('0x17')]['include'],function(_0x2fc580){return{'model':db[_0x2fc580[_0x5745('0x1b')]],'as':_0x2fc580['as'],'attributes':_0x2fc580[_0x5745('0x18')],'include':_0x2fc580['include']?_[_0x5745('0x1c')](_0x2fc580[_0x5745('0x1a')],function(_0x371ee2){return{'model':db[_0x371ee2[_0x5745('0x1b')]],'as':_0x371ee2['as'],'attributes':_0x371ee2[_0x5745('0x18')],'include':_0x371ee2[_0x5745('0x1a')]?_[_0x5745('0x1c')](_0x371ee2[_0x5745('0x1a')],function(_0x1267c0){return{'model':db[_0x1267c0[_0x5745('0x1b')]],'as':_0x1267c0['as'],'attributes':_0x1267c0['attributes']};}):[]};}):[]};}):[]:[]})[_0x5745('0x21')](function(_0x2da5dc){logger[_0x5745('0x11')](_0x5745('0x1e'),_0x5d2d5f);logger[_0x5745('0x22')](_0x5745('0x1e'),_0x5d2d5f,JSON[_0x5745('0x1d')](_0x2da5dc));_0x21c88b(_0x2da5dc);})[_0x5745('0x13')](function(_0xd2b690){logger['error'](_0x5745('0x1e'),_0xd2b690[_0x5745('0x10')],_0x5d2d5f);_0x3055d7(_0x2a96dd[_0x5745('0xe')](0x1f4,_0xd2b690[_0x5745('0x10')]));});});}; \ No newline at end of file +var _0x0888=['info','request\x20sent','debug','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','catch','ShowWhatsappQueue','find','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./whatsappQueue.socket','register','then'];(function(_0x48e921,_0x20cf98){var _0x4986fe=function(_0x466eb2){while(--_0x466eb2){_0x48e921['push'](_0x48e921['shift']());}};_0x4986fe(++_0x20cf98);}(_0x0888,0x12e));var _0x8088=function(_0x356dc5,_0x16a8c0){_0x356dc5=_0x356dc5-0x0;var _0x106b31=_0x0888[_0x356dc5];return _0x106b31;};'use strict';var _=require('lodash');var util=require(_0x8088('0x0'));var moment=require(_0x8088('0x1'));var BPromise=require('bluebird');var rs=require(_0x8088('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8088('0x3'))(_0x8088('0x4'));var config=require(_0x8088('0x5'));var jayson=require(_0x8088('0x6'));var client=jayson['client'][_0x8088('0x7')]({'port':0x232a});config[_0x8088('0x8')]=_['defaults'](config[_0x8088('0x8')],{'host':_0x8088('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8088('0x8')]));require(_0x8088('0xa'))[_0x8088('0xb')](socket);function respondWithRpcPromise(_0x193162,_0x55dcb7,_0x472f9c){return new BPromise(function(_0x584e1c,_0x3eab67){return client['request'](_0x193162,_0x472f9c)[_0x8088('0xc')](function(_0x662d64){logger[_0x8088('0xd')]('WhatsappQueue,\x20%s,\x20%s',_0x55dcb7,_0x8088('0xe'));logger[_0x8088('0xf')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x55dcb7,_0x8088('0xe'),JSON[_0x8088('0x10')](_0x662d64));if(_0x662d64[_0x8088('0x11')]){if(_0x662d64[_0x8088('0x11')][_0x8088('0x12')]===0x1f4){logger[_0x8088('0x11')](_0x8088('0x13'),_0x55dcb7,_0x662d64[_0x8088('0x11')][_0x8088('0x14')]);return _0x3eab67(_0x662d64['error'][_0x8088('0x14')]);}logger[_0x8088('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x55dcb7,_0x662d64[_0x8088('0x11')][_0x8088('0x14')]);return _0x584e1c(_0x662d64[_0x8088('0x11')][_0x8088('0x14')]);}else{logger[_0x8088('0xd')](_0x8088('0x13'),_0x55dcb7,'request\x20sent');_0x584e1c(_0x662d64['result'][_0x8088('0x14')]);}})['catch'](function(_0x5b6f4a){logger['error'](_0x8088('0x13'),_0x55dcb7,_0x5b6f4a);_0x3eab67(_0x5b6f4a);});});}exports['GetWhatsappQueue']=function(_0x4061b8){var _0x445cd1=this;return new Promise(function(_0x2a78f1,_0xb287d4){return db[_0x8088('0x15')][_0x8088('0x16')]({'raw':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x18')]===undefined?!![]:![]:!![],'where':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x19')]||null:null,'attributes':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x1a')]||null:null,'limit':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x1b')]||null:null,'include':_0x4061b8[_0x8088('0x17')]?_0x4061b8[_0x8088('0x17')][_0x8088('0x1c')]?_['map'](_0x4061b8['options']['include'],function(_0x36f012){return{'model':db[_0x36f012[_0x8088('0x1d')]],'as':_0x36f012['as'],'attributes':_0x36f012['attributes'],'include':_0x36f012[_0x8088('0x1c')]?_[_0x8088('0x1e')](_0x36f012[_0x8088('0x1c')],function(_0x3b7174){return{'model':db[_0x3b7174[_0x8088('0x1d')]],'as':_0x3b7174['as'],'attributes':_0x3b7174[_0x8088('0x1a')],'include':_0x3b7174['include']?_['map'](_0x3b7174['include'],function(_0x53f3a6){return{'model':db[_0x53f3a6[_0x8088('0x1d')]],'as':_0x53f3a6['as'],'attributes':_0x53f3a6[_0x8088('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46b36b){logger[_0x8088('0xd')](_0x8088('0x1f'),_0x4061b8);logger[_0x8088('0xf')](_0x8088('0x1f'),_0x4061b8,JSON[_0x8088('0x10')](_0x46b36b));_0x2a78f1(_0x46b36b);})[_0x8088('0x20')](function(_0x4fbb61){logger[_0x8088('0x11')](_0x8088('0x1f'),_0x4fbb61[_0x8088('0x14')],_0x4061b8);_0xb287d4(_0x445cd1[_0x8088('0x11')](0x1f4,_0x4fbb61[_0x8088('0x14')]));});});};exports[_0x8088('0x21')]=function(_0x1992a3){var _0x230a3f=this;return new Promise(function(_0x1dcfc1,_0x1c39b2){return db['WhatsappQueue'][_0x8088('0x22')]({'raw':_0x1992a3[_0x8088('0x17')]?_0x1992a3['options'][_0x8088('0x18')]===undefined?!![]:![]:!![],'where':_0x1992a3[_0x8088('0x17')]?_0x1992a3[_0x8088('0x17')][_0x8088('0x19')]||null:null,'attributes':_0x1992a3[_0x8088('0x17')]?_0x1992a3['options']['attributes']||null:null,'include':_0x1992a3[_0x8088('0x17')]?_0x1992a3['options']['include']?_['map'](_0x1992a3['options']['include'],function(_0x147185){return{'model':db[_0x147185[_0x8088('0x1d')]],'as':_0x147185['as'],'attributes':_0x147185[_0x8088('0x1a')],'include':_0x147185['include']?_[_0x8088('0x1e')](_0x147185[_0x8088('0x1c')],function(_0x4af3d4){return{'model':db[_0x4af3d4[_0x8088('0x1d')]],'as':_0x4af3d4['as'],'attributes':_0x4af3d4[_0x8088('0x1a')],'include':_0x4af3d4['include']?_[_0x8088('0x1e')](_0x4af3d4['include'],function(_0x50f457){return{'model':db[_0x50f457[_0x8088('0x1d')]],'as':_0x50f457['as'],'attributes':_0x50f457['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x12cc73){logger[_0x8088('0xd')](_0x8088('0x21'),_0x1992a3);logger['debug']('ShowWhatsappQueue',_0x1992a3,JSON[_0x8088('0x10')](_0x12cc73));_0x1dcfc1(_0x12cc73);})[_0x8088('0x20')](function(_0x358c3c){logger[_0x8088('0x11')](_0x8088('0x21'),_0x358c3c[_0x8088('0x14')],_0x1992a3);_0x1c39b2(_0x230a3f[_0x8088('0x11')](0x1f4,_0x358c3c[_0x8088('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index bac7856..236b91e 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 _0xdbd1=['removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdbd1,0x16c));var _0x1dbd=function(_0x4bf70d,_0x1cc11c){_0x4bf70d=_0x4bf70d-0x0;var _0x2c2ecf=_0xdbd1[_0x4bf70d];return _0x2c2ecf;};'use strict';var WhatsappQueueEvents=require(_0x1dbd('0x0'));var events=[_0x1dbd('0x1'),_0x1dbd('0x2'),'update'];function createListener(_0x6a9662,_0xb17e1a){return function(_0x1914f7){_0xb17e1a[_0x1dbd('0x3')](_0x6a9662,_0x1914f7);};}function removeListener(_0x4109bd,_0x159c9b){return function(){WhatsappQueueEvents[_0x1dbd('0x4')](_0x4109bd,_0x159c9b);};}exports[_0x1dbd('0x5')]=function(_0x243ac9){for(var _0x4615e0=0x0,_0x4c9624=events[_0x1dbd('0x6')];_0x4615e0<_0x4c9624;_0x4615e0++){var _0x1b1746=events[_0x4615e0];var _0x128332=createListener(_0x1dbd('0x7')+_0x1b1746,_0x243ac9);WhatsappQueueEvents['on'](_0x1b1746,_0x128332);}}; \ No newline at end of file +var _0x9985=['emit','removeListener','register','length','./whatsappQueue.events','save','remove','update'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x9985,0x13c));var _0x5998=function(_0x19dac3,_0x179387){_0x19dac3=_0x19dac3-0x0;var _0x3be408=_0x9985[_0x19dac3];return _0x3be408;};'use strict';var WhatsappQueueEvents=require(_0x5998('0x0'));var events=[_0x5998('0x1'),_0x5998('0x2'),_0x5998('0x3')];function createListener(_0x489367,_0x360e4a){return function(_0x465be1){_0x360e4a[_0x5998('0x4')](_0x489367,_0x465be1);};}function removeListener(_0x456003,_0x13acff){return function(){WhatsappQueueEvents[_0x5998('0x5')](_0x456003,_0x13acff);};}exports[_0x5998('0x6')]=function(_0x463ba5){for(var _0x387ac2=0x0,_0x2994ed=events[_0x5998('0x7')];_0x387ac2<_0x2994ed;_0x387ac2++){var _0x5f0826=events[_0x387ac2];var _0x9d160f=createListener('whatsappQueue:'+_0x5f0826,_0x463ba5);WhatsappQueueEvents['on'](_0x5f0826,_0x9d160f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index aa5a862..5f9cd16 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 _0xae03=['create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xae03,0x140));var _0x3ae0=function(_0x3fbc3,_0x1d5c0c){_0x3fbc3=_0x3fbc3-0x0;var _0x4e7a58=_0xae03[_0x3fbc3];return _0x4e7a58;};'use strict';var multer=require(_0x3ae0('0x0'));var util=require(_0x3ae0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3ae0('0x2'));var router=express[_0x3ae0('0x3')]();var fs_extra=require(_0x3ae0('0x4'));var auth=require(_0x3ae0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3ae0('0x6'));var controller=require(_0x3ae0('0x7'));router[_0x3ae0('0x8')]('/',auth[_0x3ae0('0x9')](),controller[_0x3ae0('0xa')]);router[_0x3ae0('0x8')](_0x3ae0('0xb'),auth[_0x3ae0('0x9')](),controller[_0x3ae0('0xc')]);router['get'](_0x3ae0('0xd'),auth[_0x3ae0('0x9')](),controller[_0x3ae0('0xe')]);router[_0x3ae0('0xf')]('/',auth[_0x3ae0('0x9')](),controller[_0x3ae0('0x10')]);router[_0x3ae0('0x11')](_0x3ae0('0xd'),auth[_0x3ae0('0x9')](),controller[_0x3ae0('0x12')]);router[_0x3ae0('0x13')](_0x3ae0('0xd'),auth[_0x3ae0('0x9')](),controller['destroy']);module[_0x3ae0('0x14')]=router; \ No newline at end of file +var _0xcb19=['/:id','show','post','create','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x2ae076,_0x3edab3){var _0xa4da77=function(_0x23caf1){while(--_0x23caf1){_0x2ae076['push'](_0x2ae076['shift']());}};_0xa4da77(++_0x3edab3);}(_0xcb19,0x120));var _0x9cb1=function(_0x44f6e9,_0x3346be){_0x44f6e9=_0x44f6e9-0x0;var _0x2e989c=_0xcb19[_0x44f6e9];return _0x2e989c;};'use strict';var multer=require('multer');var util=require(_0x9cb1('0x0'));var path=require(_0x9cb1('0x1'));var timeout=require(_0x9cb1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9cb1('0x3'));var auth=require(_0x9cb1('0x4'));var interaction=require(_0x9cb1('0x5'));var config=require(_0x9cb1('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0x9cb1('0x7')]('/',auth[_0x9cb1('0x8')](),controller[_0x9cb1('0x9')]);router['get'](_0x9cb1('0xa'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0xb')]);router[_0x9cb1('0x7')](_0x9cb1('0xc'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0xd')]);router[_0x9cb1('0xe')]('/',auth[_0x9cb1('0x8')](),controller[_0x9cb1('0xf')]);router['put'](_0x9cb1('0xc'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0x10')]);router[_0x9cb1('0x11')](_0x9cb1('0xc'),auth[_0x9cb1('0x8')](),controller[_0x9cb1('0x12')]);module[_0x9cb1('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index bfd0acc..7ce65f8 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(_0x2a1249,_0x1e39fc){var _0xa3e6bb=function(_0x31e533){while(--_0x31e533){_0x2a1249['push'](_0x2a1249['shift']());}};_0xa3e6bb(++_0x1e39fc);}(_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 +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x196e28,_0x50e608){var _0x2d8845=function(_0x43f12b){while(--_0x43f12b){_0x196e28['push'](_0x196e28['shift']());}};_0x2d8845(++_0x50e608);}(_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 04a14d2..ac264c3 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 _0xbfcc=['destroy','error','stack','name','send','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','offset','count','set','Content-Range','json','reject','then'];(function(_0x1c5a78,_0x31601d){var _0x1c58ef=function(_0x531ffc){while(--_0x531ffc){_0x1c5a78['push'](_0x1c5a78['shift']());}};_0x1c58ef(++_0x31601d);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0xbfcc[_0x11dc39];return _0x457277;};'use strict';var emlformat=require(_0xcbfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbfc('0x1'));var rp=require(_0xcbfc('0x2'));var moment=require(_0xcbfc('0x3'));var BPromise=require(_0xcbfc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcbfc('0x5'));var ejs=require(_0xcbfc('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbfc('0x7'));var squel=require('squel');var crypto=require(_0xcbfc('0x8'));var jsforce=require(_0xcbfc('0x9'));var deskjs=require(_0xcbfc('0xa'));var toCsv=require(_0xcbfc('0x5'));var querystring=require('querystring');var Papa=require(_0xcbfc('0xb'));var Redis=require(_0xcbfc('0xc'));var authService=require(_0xcbfc('0xd'));var qs=require(_0xcbfc('0xe'));var as=require(_0xcbfc('0xf'));var hardwareService=require(_0xcbfc('0x10'));var logger=require('../../config/logger')(_0xcbfc('0x11'));var utils=require(_0xcbfc('0x12'));var config=require(_0xcbfc('0x13'));var licenseUtil=require(_0xcbfc('0x14'));var db=require(_0xcbfc('0x15'))['db'];function respondWithStatusCode(_0x4e8b34,_0x3bfd05){_0x3bfd05=_0x3bfd05||0xcc;return function(_0x86f67c){if(_0x86f67c){return _0x4e8b34[_0xcbfc('0x16')](_0x3bfd05);}return _0x4e8b34['status'](_0x3bfd05)[_0xcbfc('0x17')]();};}function respondWithResult(_0x3ec338,_0x2f2bdd){_0x2f2bdd=_0x2f2bdd||0xc8;return function(_0x45a5cc){if(_0x45a5cc){return _0x3ec338[_0xcbfc('0x18')](_0x2f2bdd)['json'](_0x45a5cc);}};}function respondWithFilteredResult(_0x3c69ed,_0x1963de){return function(_0x1ec8c4){if(_0x1ec8c4){var _0x4317e4=typeof _0x1963de['offset']==='undefined'&&typeof _0x1963de[_0xcbfc('0x19')]===_0xcbfc('0x1a');var _0xa65368=_0x1ec8c4['count'];var _0x5b078f=_0x4317e4?0x0:_0x1963de[_0xcbfc('0x1b')];var _0x99b59d=_0x4317e4?_0x1ec8c4[_0xcbfc('0x1c')]:_0x1963de['offset']+_0x1963de[_0xcbfc('0x19')];var _0x552777;if(_0x99b59d>=_0xa65368){_0x99b59d=_0xa65368;_0x552777=0xc8;}else{_0x552777=0xce;}_0x3c69ed[_0xcbfc('0x18')](_0x552777);return _0x3c69ed[_0xcbfc('0x1d')](_0xcbfc('0x1e'),_0x5b078f+'-'+_0x99b59d+'/'+_0xa65368)[_0xcbfc('0x1f')](_0x1ec8c4);}return null;};}function patchUpdates(_0x25c167){return function(_0x2653b1){try{jsonpatch['apply'](_0x2653b1,_0x25c167,!![]);}catch(_0x9c79da){return BPromise[_0xcbfc('0x20')](_0x9c79da);}return _0x2653b1['save']();};}function saveUpdates(_0x1da958,_0x5a449b){return function(_0x4cc8b3){if(_0x4cc8b3){return _0x4cc8b3['update'](_0x1da958)[_0xcbfc('0x21')](function(_0x4a0fcb){return _0x4a0fcb;});}return null;};}function removeEntity(_0x4a1915,_0x1b3e42){return function(_0x34cffa){if(_0x34cffa){return _0x34cffa[_0xcbfc('0x22')]()[_0xcbfc('0x21')](function(){_0x4a1915['status'](0xcc)[_0xcbfc('0x17')]();});}};}function handleEntityNotFound(_0x51284a,_0x280b78){return function(_0x75bca0){if(!_0x75bca0){_0x51284a['sendStatus'](0x194);}return _0x75bca0;};}function handleError(_0x28bdcf,_0x3b73a3){_0x3b73a3=_0x3b73a3||0x1f4;return function(_0x4ab48e){logger[_0xcbfc('0x23')](_0x4ab48e[_0xcbfc('0x24')]);if(_0x4ab48e[_0xcbfc('0x25')]){delete _0x4ab48e[_0xcbfc('0x25')];}_0x28bdcf['status'](_0x3b73a3)[_0xcbfc('0x26')](_0x4ab48e);};}exports[_0xcbfc('0x27')]=function(_0x4f632a,_0x1f6a14){var _0x26463f={},_0x7cbdfa={},_0x388d41={'count':0x0,'rows':[]};var _0x2b4286=_[_0xcbfc('0x28')](db[_0xcbfc('0x29')]['rawAttributes'],function(_0x41b68b){return{'name':_0x41b68b[_0xcbfc('0x2a')],'type':_0x41b68b[_0xcbfc('0x2b')][_0xcbfc('0x2c')]};});_0x7cbdfa['model']=_[_0xcbfc('0x28')](_0x2b4286,_0xcbfc('0x25'));_0x7cbdfa[_0xcbfc('0x2d')]=_[_0xcbfc('0x2e')](_0x4f632a[_0xcbfc('0x2d')]);_0x7cbdfa[_0xcbfc('0x2f')]=_[_0xcbfc('0x30')](_0x7cbdfa['model'],_0x7cbdfa[_0xcbfc('0x2d')]);_0x26463f[_0xcbfc('0x31')]=_['intersection'](_0x7cbdfa[_0xcbfc('0x32')],qs[_0xcbfc('0x33')](_0x4f632a[_0xcbfc('0x2d')]['fields']));_0x26463f['attributes']=_0x26463f['attributes'][_0xcbfc('0x34')]?_0x26463f[_0xcbfc('0x31')]:_0x7cbdfa[_0xcbfc('0x32')];if(!_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x35')](_0xcbfc('0x36'))){_0x26463f[_0xcbfc('0x19')]=qs[_0xcbfc('0x19')](_0x4f632a['query'][_0xcbfc('0x19')]);_0x26463f[_0xcbfc('0x1b')]=qs['offset'](_0x4f632a[_0xcbfc('0x2d')]['offset']);}_0x26463f[_0xcbfc('0x37')]=qs[_0xcbfc('0x38')](_0x4f632a[_0xcbfc('0x2d')]['sort']);_0x26463f[_0xcbfc('0x39')]=qs['filters'](_['pick'](_0x4f632a[_0xcbfc('0x2d')],_0x7cbdfa[_0xcbfc('0x2f')]),_0x2b4286);if(_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3a')]){_0x26463f[_0xcbfc('0x39')]=_[_0xcbfc('0x3b')](_0x26463f[_0xcbfc('0x39')],{'$or':_[_0xcbfc('0x28')](_0x2b4286,function(_0x5cf4fa){if(_0x5cf4fa[_0xcbfc('0x2b')]!=='VIRTUAL'){var _0x15a5c4={};_0x15a5c4[_0x5cf4fa[_0xcbfc('0x25')]]={'$like':'%'+_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3a')]+'%'};return _0x15a5c4;}})});}_0x26463f=_['merge']({},_0x26463f,_0x4f632a['options']);var _0x236b66={'where':_0x26463f[_0xcbfc('0x39')]};return db[_0xcbfc('0x29')][_0xcbfc('0x1c')](_0x236b66)[_0xcbfc('0x21')](function(_0x4aa189){_0x388d41[_0xcbfc('0x1c')]=_0x4aa189;if(_0x4f632a[_0xcbfc('0x2d')][_0xcbfc('0x3c')]){_0x26463f['include']=[{'all':!![]}];}return db[_0xcbfc('0x29')][_0xcbfc('0x3d')](_0x26463f);})[_0xcbfc('0x21')](function(_0x4ca55c){_0x388d41[_0xcbfc('0x3e')]=_0x4ca55c;return _0x388d41;})[_0xcbfc('0x21')](respondWithFilteredResult(_0x1f6a14,_0x26463f))[_0xcbfc('0x3f')](handleError(_0x1f6a14,null));};exports[_0xcbfc('0x40')]=function(_0x102f4f,_0x28447a){var _0x1e14bb={'raw':!![],'where':{'id':_0x102f4f[_0xcbfc('0x41')]['id']}},_0x561544={};_0x561544[_0xcbfc('0x32')]=_['keys'](db[_0xcbfc('0x29')][_0xcbfc('0x42')]);_0x561544[_0xcbfc('0x2d')]=_[_0xcbfc('0x2e')](_0x102f4f[_0xcbfc('0x2d')]);_0x561544[_0xcbfc('0x2f')]=_[_0xcbfc('0x30')](_0x561544[_0xcbfc('0x32')],_0x561544['query']);_0x1e14bb[_0xcbfc('0x31')]=_[_0xcbfc('0x30')](_0x561544[_0xcbfc('0x32')],qs[_0xcbfc('0x33')](_0x102f4f[_0xcbfc('0x2d')][_0xcbfc('0x33')]));_0x1e14bb[_0xcbfc('0x31')]=_0x1e14bb['attributes'][_0xcbfc('0x34')]?_0x1e14bb[_0xcbfc('0x31')]:_0x561544['model'];if(_0x102f4f[_0xcbfc('0x2d')][_0xcbfc('0x3c')]){_0x1e14bb[_0xcbfc('0x43')]=[{'all':!![]}];}_0x1e14bb=_['merge']({},_0x1e14bb,_0x102f4f[_0xcbfc('0x44')]);return db[_0xcbfc('0x29')][_0xcbfc('0x45')](_0x1e14bb)[_0xcbfc('0x21')](handleEntityNotFound(_0x28447a,null))[_0xcbfc('0x21')](respondWithResult(_0x28447a,null))[_0xcbfc('0x3f')](handleError(_0x28447a,null));};exports[_0xcbfc('0x46')]=function(_0x55fc0b,_0x5a87b6){return db[_0xcbfc('0x29')][_0xcbfc('0x46')](_0x55fc0b[_0xcbfc('0x47')],{})[_0xcbfc('0x21')](respondWithResult(_0x5a87b6,0xc9))['catch'](handleError(_0x5a87b6,null));};exports['update']=function(_0x2e89bf,_0xe5c5ef){if(_0x2e89bf[_0xcbfc('0x47')]['id']){delete _0x2e89bf['body']['id'];}return db[_0xcbfc('0x29')][_0xcbfc('0x45')]({'where':{'id':_0x2e89bf[_0xcbfc('0x41')]['id']}})['then'](handleEntityNotFound(_0xe5c5ef,null))[_0xcbfc('0x21')](saveUpdates(_0x2e89bf[_0xcbfc('0x47')],null))[_0xcbfc('0x21')](respondWithResult(_0xe5c5ef,null))[_0xcbfc('0x3f')](handleError(_0xe5c5ef,null));};exports[_0xcbfc('0x22')]=function(_0xd9976d,_0x222b58){return db[_0xcbfc('0x29')][_0xcbfc('0x45')]({'where':{'id':_0xd9976d[_0xcbfc('0x41')]['id']}})['then'](handleEntityNotFound(_0x222b58,null))[_0xcbfc('0x21')](removeEntity(_0x222b58,null))[_0xcbfc('0x3f')](handleError(_0x222b58,null));};exports[_0xcbfc('0x48')]=function(_0x5c2ad9,_0x28ae7f){return db[_0xcbfc('0x29')]['describe']()[_0xcbfc('0x21')](respondWithResult(_0x28ae7f,null))[_0xcbfc('0x3f')](handleError(_0x28ae7f,null));}; \ No newline at end of file +var _0x5ec6=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xee7f02,_0x1628f7){var _0x553b36=function(_0x282c65){while(--_0x282c65){_0xee7f02['push'](_0xee7f02['shift']());}};_0x553b36(++_0x1628f7);}(_0x5ec6,0x7f));var _0x65ec=function(_0x39cc19,_0x5f3c74){_0x39cc19=_0x39cc19-0x0;var _0x420d0d=_0x5ec6[_0x39cc19];return _0x420d0d;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x288e66,_0x156793){return function(_0x21426b){if(!_0x21426b){_0x288e66[_0x65ec('0x15')](0x194);}return _0x21426b;};}function handleError(_0x297e09,_0x4c846b){_0x4c846b=_0x4c846b||0x1f4;return function(_0x10baef){logger[_0x65ec('0x25')](_0x10baef[_0x65ec('0x26')]);if(_0x10baef[_0x65ec('0x27')]){delete _0x10baef['name'];}_0x297e09[_0x65ec('0x16')](_0x4c846b)['send'](_0x10baef);};}exports[_0x65ec('0x28')]=function(_0x1ada47,_0x1d0b5c){var _0x30366c={},_0x14431d={},_0x46d4c1={'count':0x0,'rows':[]};var _0x46bf66=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x3c97e2){return{'name':_0x3c97e2['fieldName'],'type':_0x3c97e2['type'][_0x65ec('0x2c')]};});_0x14431d['model']=_[_0x65ec('0x29')](_0x46bf66,_0x65ec('0x27'));_0x14431d['query']=_[_0x65ec('0x2d')](_0x1ada47[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x14431d['model'],_0x14431d[_0x65ec('0x2e')]);_0x30366c[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x14431d[_0x65ec('0x32')],qs[_0x65ec('0x33')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x30366c[_0x65ec('0x31')]=_0x30366c[_0x65ec('0x31')][_0x65ec('0x34')]?_0x30366c['attributes']:_0x14431d[_0x65ec('0x32')];if(!_0x1ada47[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x30366c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x1b')]);_0x30366c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x1ada47['query'][_0x65ec('0x19')]);}_0x30366c[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1ada47[_0x65ec('0x2e')]['sort']);_0x30366c[_0x65ec('0x38')]=qs[_0x65ec('0x2f')](_[_0x65ec('0x39')](_0x1ada47[_0x65ec('0x2e')],_0x14431d['filters']),_0x46bf66);if(_0x1ada47['query'][_0x65ec('0x3a')]){_0x30366c['where']=_[_0x65ec('0x3b')](_0x30366c[_0x65ec('0x38')],{'$or':_['map'](_0x46bf66,function(_0x16ef59){if(_0x16ef59[_0x65ec('0x3c')]!==_0x65ec('0x3d')){var _0x5357bf={};_0x5357bf[_0x16ef59[_0x65ec('0x27')]]={'$like':'%'+_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3a')]+'%'};return _0x5357bf;}})});}_0x30366c=_[_0x65ec('0x3b')]({},_0x30366c,_0x1ada47[_0x65ec('0x3e')]);var _0x2ce56f={'where':_0x30366c[_0x65ec('0x38')]};return db['WhatsappQueueReport'][_0x65ec('0x1c')](_0x2ce56f)['then'](function(_0x2654b2){_0x46d4c1[_0x65ec('0x1c')]=_0x2654b2;if(_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x30366c[_0x65ec('0x40')]=[{'all':!![]}];}return db[_0x65ec('0x2a')]['findAll'](_0x30366c);})[_0x65ec('0x23')](function(_0x4ba7df){_0x46d4c1['rows']=_0x4ba7df;return _0x46d4c1;})[_0x65ec('0x23')](respondWithFilteredResult(_0x1d0b5c,_0x30366c))[_0x65ec('0x41')](handleError(_0x1d0b5c,null));};exports[_0x65ec('0x42')]=function(_0x143a11,_0x1d475e){var _0x524235={'raw':!![],'where':{'id':_0x143a11[_0x65ec('0x43')]['id']}},_0x4843ca={};_0x4843ca[_0x65ec('0x32')]=_[_0x65ec('0x2d')](db[_0x65ec('0x2a')][_0x65ec('0x2b')]);_0x4843ca['query']=_['keys'](_0x143a11[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x4843ca[_0x65ec('0x32')],_0x4843ca[_0x65ec('0x2e')]);_0x524235[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x4843ca['model'],qs[_0x65ec('0x33')](_0x143a11[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x524235['attributes']=_0x524235[_0x65ec('0x31')][_0x65ec('0x34')]?_0x524235['attributes']:_0x4843ca[_0x65ec('0x32')];if(_0x143a11[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x524235[_0x65ec('0x40')]=[{'all':!![]}];}_0x524235=_[_0x65ec('0x3b')]({},_0x524235,_0x143a11['options']);return db[_0x65ec('0x2a')][_0x65ec('0x44')](_0x524235)[_0x65ec('0x23')](handleEntityNotFound(_0x1d475e,null))[_0x65ec('0x23')](respondWithResult(_0x1d475e,null))['catch'](handleError(_0x1d475e,null));};exports[_0x65ec('0x45')]=function(_0x509c28,_0x1ed0f9){return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x509c28['body'],{})['then'](respondWithResult(_0x1ed0f9,0xc9))[_0x65ec('0x41')](handleError(_0x1ed0f9,null));};exports[_0x65ec('0x22')]=function(_0xf5419,_0x2111af){if(_0xf5419[_0x65ec('0x46')]['id']){delete _0xf5419[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x44')]({'where':{'id':_0xf5419[_0x65ec('0x43')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x23')](saveUpdates(_0xf5419[_0x65ec('0x46')],null))[_0x65ec('0x23')](respondWithResult(_0x2111af,null))[_0x65ec('0x41')](handleError(_0x2111af,null));};exports[_0x65ec('0x24')]=function(_0x14eaef,_0x22c28c){return db['WhatsappQueueReport'][_0x65ec('0x44')]({'where':{'id':_0x14eaef[_0x65ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x22c28c,null))[_0x65ec('0x23')](removeEntity(_0x22c28c,null))[_0x65ec('0x41')](handleError(_0x22c28c,null));};exports[_0x65ec('0x47')]=function(_0x528cfa,_0x3eee1e){return db[_0x65ec('0x2a')][_0x65ec('0x47')]()['then'](respondWithResult(_0x3eee1e,null))[_0x65ec('0x41')](handleError(_0x3eee1e,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 34b9732..3f11625 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 _0x71e3=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0x2027f5,_0x5a68c1){var _0x346d21=function(_0x28735c){while(--_0x28735c){_0x2027f5['push'](_0x2027f5['shift']());}};_0x346d21(++_0x5a68c1);}(_0x71e3,0x17a));var _0x371e=function(_0x2c26f6,_0x221853){_0x2c26f6=_0x2c26f6-0x0;var _0xa9cf37=_0x71e3[_0x2c26f6];return _0xa9cf37;};'use strict';var _=require(_0x371e('0x0'));var util=require(_0x371e('0x1'));var logger=require(_0x371e('0x2'))(_0x371e('0x3'));var moment=require('moment');var BPromise=require(_0x371e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x371e('0x5'));var rimraf=require(_0x371e('0x6'));var config=require(_0x371e('0x7'));var attributes=require(_0x371e('0x8'));module[_0x371e('0x9')]=function(_0x17968d,_0x3518ff){return _0x17968d[_0x371e('0xa')](_0x371e('0xb'),attributes,{'tableName':_0x371e('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x371e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c69=['bluebird','request-promise','path','rimraf','./whatsappQueueReport.attributes','define','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x340034,_0x26ddbd){var _0x4ec3a6=function(_0x595dac){while(--_0x595dac){_0x340034['push'](_0x340034['shift']());}};_0x4ec3a6(++_0x26ddbd);}(_0x6c69,0xc2));var _0x96c6=function(_0x110f07,_0x523a8d){_0x110f07=_0x110f07-0x0;var _0x390dec=_0x6c69[_0x110f07];return _0x390dec;};'use strict';var _=require(_0x96c6('0x0'));var util=require('util');var logger=require(_0x96c6('0x1'))(_0x96c6('0x2'));var moment=require(_0x96c6('0x3'));var BPromise=require(_0x96c6('0x4'));var rp=require(_0x96c6('0x5'));var fs=require('fs');var path=require(_0x96c6('0x6'));var rimraf=require(_0x96c6('0x7'));var config=require('../../config/environment');var attributes=require(_0x96c6('0x8'));module['exports']=function(_0x3569cf,_0x19c8a8){return _0x3569cf[_0x96c6('0x9')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x96c6('0xa'),'fields':[_0x96c6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index f4f6694..21de23d 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 _0xc4c6=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x17e735,_0x328f40){var _0x1824d6=function(_0x4460fe){while(--_0x4460fe){_0x17e735['push'](_0x17e735['shift']());}};_0x1824d6(++_0x328f40);}(_0xc4c6,0x1f0));var _0x6c4c=function(_0x23c163,_0x54798f){_0x23c163=_0x23c163-0x0;var _0x23d854=_0xc4c6[_0x23c163];return _0x23d854;};'use strict';var _=require(_0x6c4c('0x0'));var util=require(_0x6c4c('0x1'));var moment=require(_0x6c4c('0x2'));var BPromise=require(_0x6c4c('0x3'));var rs=require(_0x6c4c('0x4'));var fs=require('fs');var Redis=require(_0x6c4c('0x5'));var db=require(_0x6c4c('0x6'))['db'];var utils=require(_0x6c4c('0x7'));var logger=require(_0x6c4c('0x8'))(_0x6c4c('0x9'));var config=require(_0x6c4c('0xa'));var jayson=require(_0x6c4c('0xb'));var client=jayson['client'][_0x6c4c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x866a15,_0x587621,_0x287815){return new BPromise(function(_0x42d7db,_0x1bdb4f){return client[_0x6c4c('0xd')](_0x866a15,_0x287815)[_0x6c4c('0xe')](function(_0x4cfdb8){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x587621,_0x6c4c('0xf'));logger[_0x6c4c('0x10')](_0x6c4c('0x11'),_0x587621,_0x6c4c('0xf'),JSON[_0x6c4c('0x12')](_0x4cfdb8));if(_0x4cfdb8[_0x6c4c('0x13')]){if(_0x4cfdb8[_0x6c4c('0x13')]['code']===0x1f4){logger[_0x6c4c('0x13')](_0x6c4c('0x14'),_0x587621,_0x4cfdb8['error'][_0x6c4c('0x15')]);return _0x1bdb4f(_0x4cfdb8[_0x6c4c('0x13')]['message']);}logger[_0x6c4c('0x13')](_0x6c4c('0x14'),_0x587621,_0x4cfdb8['error'][_0x6c4c('0x15')]);return _0x42d7db(_0x4cfdb8['error'][_0x6c4c('0x15')]);}else{logger[_0x6c4c('0x16')](_0x6c4c('0x14'),_0x587621,'request\x20sent');_0x42d7db(_0x4cfdb8[_0x6c4c('0x17')][_0x6c4c('0x15')]);}})[_0x6c4c('0x18')](function(_0x1506a3){logger[_0x6c4c('0x13')](_0x6c4c('0x14'),_0x587621,_0x1506a3);_0x1bdb4f(_0x1506a3);});});}exports[_0x6c4c('0x19')]=function(_0x5e6f55){var _0x13113c=this;return new Promise(function(_0x1fb80c,_0xc8ccfd){return db[_0x6c4c('0x1a')][_0x6c4c('0x1b')](_0x5e6f55[_0x6c4c('0x1c')],{'raw':_0x5e6f55[_0x6c4c('0x1d')]?_0x5e6f55[_0x6c4c('0x1d')][_0x6c4c('0x1e')]===undefined?!![]:![]:!![]})[_0x6c4c('0xe')](function(_0x55f69b){logger['info'](_0x6c4c('0x19'),_0x5e6f55);logger['debug'](_0x6c4c('0x19'),_0x5e6f55,JSON['stringify'](_0x55f69b));_0x1fb80c(_0x55f69b);})[_0x6c4c('0x18')](function(_0x1d0473){logger['error'](_0x6c4c('0x19'),_0x1d0473['message'],_0x5e6f55);_0xc8ccfd(_0x13113c[_0x6c4c('0x13')](0x1f4,_0x1d0473['message']));});});};exports[_0x6c4c('0x1f')]=function(_0x4cee77){var _0x2024f1=this;return new Promise(function(_0x23082d,_0x54d6dd){return db[_0x6c4c('0x1a')][_0x6c4c('0x20')](_0x4cee77[_0x6c4c('0x1c')],{'raw':_0x4cee77[_0x6c4c('0x1d')]?_0x4cee77[_0x6c4c('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cee77[_0x6c4c('0x1d')]?_0x4cee77[_0x6c4c('0x1d')][_0x6c4c('0x21')]||null:null,'attributes':_0x4cee77[_0x6c4c('0x1d')]?_0x4cee77[_0x6c4c('0x1d')][_0x6c4c('0x22')]||null:null,'limit':_0x4cee77[_0x6c4c('0x1d')]?_0x4cee77[_0x6c4c('0x1d')][_0x6c4c('0x23')]||null:null})[_0x6c4c('0xe')](function(_0x46a1a1){logger['info'](_0x6c4c('0x1f'),_0x4cee77);logger[_0x6c4c('0x10')](_0x6c4c('0x1f'),_0x4cee77,JSON[_0x6c4c('0x12')](_0x46a1a1));_0x23082d(_0x46a1a1);})[_0x6c4c('0x18')](function(_0x4f201c){logger[_0x6c4c('0x13')]('UpdateWhatsappQueueReport',_0x4f201c[_0x6c4c('0x15')],_0x4cee77);_0x54d6dd(_0x2024f1['error'](0x1f4,_0x4f201c[_0x6c4c('0x15')]));});});}; \ No newline at end of file +var _0x4a35=['rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','raw','stringify','catch','update','where','attributes','limit','then','UpdateWhatsappQueueReport','lodash','util','bluebird','randomstring'];(function(_0x543579,_0x5a7d62){var _0x545e2a=function(_0x39fa09){while(--_0x39fa09){_0x543579['push'](_0x543579['shift']());}};_0x545e2a(++_0x5a7d62);}(_0x4a35,0x1a0));var _0x54a3=function(_0x12a764,_0x1dca95){_0x12a764=_0x12a764-0x0;var _0x4c6beb=_0x4a35[_0x12a764];return _0x4c6beb;};'use strict';var _=require(_0x54a3('0x0'));var util=require(_0x54a3('0x1'));var moment=require('moment');var BPromise=require(_0x54a3('0x2'));var rs=require(_0x54a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x54a3('0x4'));var config=require(_0x54a3('0x5'));var jayson=require(_0x54a3('0x6'));var client=jayson['client'][_0x54a3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd909e,_0x42d522,_0x114e09){return new BPromise(function(_0x3cf9e1,_0x226d8b){return client[_0x54a3('0x8')](_0xd909e,_0x114e09)['then'](function(_0x1709d0){logger[_0x54a3('0x9')]('WhatsappQueueReport,\x20%s,\x20%s',_0x42d522,_0x54a3('0xa'));logger[_0x54a3('0xb')](_0x54a3('0xc'),_0x42d522,_0x54a3('0xa'),JSON['stringify'](_0x1709d0));if(_0x1709d0[_0x54a3('0xd')]){if(_0x1709d0['error'][_0x54a3('0xe')]===0x1f4){logger['error'](_0x54a3('0xf'),_0x42d522,_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);return _0x226d8b(_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);}logger[_0x54a3('0xd')](_0x54a3('0xf'),_0x42d522,_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);return _0x3cf9e1(_0x1709d0[_0x54a3('0xd')][_0x54a3('0x10')]);}else{logger[_0x54a3('0x9')](_0x54a3('0xf'),_0x42d522,_0x54a3('0xa'));_0x3cf9e1(_0x1709d0['result'][_0x54a3('0x10')]);}})['catch'](function(_0x3de005){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x42d522,_0x3de005);_0x226d8b(_0x3de005);});});}exports[_0x54a3('0x11')]=function(_0x33824f){var _0x3582a0=this;return new Promise(function(_0x48aa6a,_0x3c100c){return db[_0x54a3('0x12')][_0x54a3('0x13')](_0x33824f['body'],{'raw':_0x33824f[_0x54a3('0x14')]?_0x33824f[_0x54a3('0x14')][_0x54a3('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x45f1e6){logger[_0x54a3('0x9')](_0x54a3('0x11'),_0x33824f);logger[_0x54a3('0xb')](_0x54a3('0x11'),_0x33824f,JSON[_0x54a3('0x16')](_0x45f1e6));_0x48aa6a(_0x45f1e6);})[_0x54a3('0x17')](function(_0x3ae4b2){logger['error']('CreateWhatsappQueueReport',_0x3ae4b2[_0x54a3('0x10')],_0x33824f);_0x3c100c(_0x3582a0[_0x54a3('0xd')](0x1f4,_0x3ae4b2['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0xd2ecef){var _0xbfbb33=this;return new Promise(function(_0x25daff,_0x488a3a){return db[_0x54a3('0x12')][_0x54a3('0x18')](_0xd2ecef['body'],{'raw':_0xd2ecef[_0x54a3('0x14')]?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd2ecef[_0x54a3('0x14')]?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x19')]||null:null,'attributes':_0xd2ecef[_0x54a3('0x14')]?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x1a')]||null:null,'limit':_0xd2ecef['options']?_0xd2ecef[_0x54a3('0x14')][_0x54a3('0x1b')]||null:null})[_0x54a3('0x1c')](function(_0x2c5d38){logger[_0x54a3('0x9')]('UpdateWhatsappQueueReport',_0xd2ecef);logger[_0x54a3('0xb')](_0x54a3('0x1d'),_0xd2ecef,JSON['stringify'](_0x2c5d38));_0x25daff(_0x2c5d38);})[_0x54a3('0x17')](function(_0x490d45){logger[_0x54a3('0xd')](_0x54a3('0x1d'),_0x490d45[_0x54a3('0x10')],_0xd2ecef);_0x488a3a(_0xbfbb33[_0x54a3('0xd')](0x1f4,_0x490d45[_0x54a3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index d899c4e..abffda6 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 _0xab0c=['../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x248d28,_0x14b270){var _0x10a719=function(_0x40d2bc){while(--_0x40d2bc){_0x248d28['push'](_0x248d28['shift']());}};_0x10a719(++_0x14b270);}(_0xab0c,0x1ad));var _0xcab0=function(_0x27995c,_0x641a31){_0x27995c=_0x27995c-0x0;var _0x55a691=_0xab0c[_0x27995c];return _0x55a691;};'use strict';var multer=require(_0xcab0('0x0'));var util=require(_0xcab0('0x1'));var path=require(_0xcab0('0x2'));var timeout=require(_0xcab0('0x3'));var express=require('express');var router=express[_0xcab0('0x4')]();var fs_extra=require(_0xcab0('0x5'));var auth=require(_0xcab0('0x6'));var interaction=require(_0xcab0('0x7'));var config=require(_0xcab0('0x8'));var controller=require(_0xcab0('0x9'));router[_0xcab0('0xa')]('/',auth[_0xcab0('0xb')](),controller['index']);router[_0xcab0('0xa')]('/describe',auth[_0xcab0('0xb')](),controller[_0xcab0('0xc')]);router[_0xcab0('0xa')](_0xcab0('0xd'),auth['isAuthenticated'](),controller[_0xcab0('0xe')]);router[_0xcab0('0xf')]('/',auth[_0xcab0('0xb')](),controller['create']);router[_0xcab0('0x10')](_0xcab0('0xd'),auth[_0xcab0('0xb')](),controller[_0xcab0('0x11')]);router['delete'](_0xcab0('0xd'),auth[_0xcab0('0xb')](),controller['destroy']);module[_0xcab0('0x12')]=router; \ No newline at end of file +var _0x9809=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post'];(function(_0x46c219,_0x2ea01f){var _0x108ae1=function(_0x54b813){while(--_0x54b813){_0x46c219['push'](_0x46c219['shift']());}};_0x108ae1(++_0x2ea01f);}(_0x9809,0xf8));var _0x9980=function(_0x3e83e7,_0x188b71){_0x3e83e7=_0x3e83e7-0x0;var _0x121bde=_0x9809[_0x3e83e7];return _0x121bde;};'use strict';var multer=require(_0x9980('0x0'));var util=require('util');var path=require(_0x9980('0x1'));var timeout=require(_0x9980('0x2'));var express=require(_0x9980('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9980('0x4'));var interaction=require(_0x9980('0x5'));var config=require(_0x9980('0x6'));var controller=require(_0x9980('0x7'));router[_0x9980('0x8')]('/',auth['isAuthenticated'](),controller[_0x9980('0x9')]);router[_0x9980('0x8')](_0x9980('0xa'),auth[_0x9980('0xb')](),controller[_0x9980('0xc')]);router[_0x9980('0x8')](_0x9980('0xd'),auth[_0x9980('0xb')](),controller[_0x9980('0xe')]);router[_0x9980('0xf')]('/',auth['isAuthenticated'](),controller[_0x9980('0x10')]);router[_0x9980('0x11')](_0x9980('0xd'),auth[_0x9980('0xb')](),controller[_0x9980('0x12')]);router[_0x9980('0x13')](_0x9980('0xd'),auth['isAuthenticated'](),controller[_0x9980('0x14')]);module[_0x9980('0x15')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 008a90d..636d48a 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 _0x7292=['ENUM','account','agent','DATE','sequelize','exports','STRING'];(function(_0x7d56fa,_0x14de42){var _0x44b674=function(_0x4669d2){while(--_0x4669d2){_0x7d56fa['push'](_0x7d56fa['shift']());}};_0x44b674(++_0x14de42);}(_0x7292,0x6d));var _0x2729=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x7292[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0x2729('0x0'));module[_0x2729('0x1')]={'uniqueid':{'type':Sequelize[_0x2729('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2729('0x3')](_0x2729('0x4'),_0x2729('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2729('0x6')]}}; \ No newline at end of file +var _0x2868=['DATE','sequelize','STRING','ENUM','agent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2868,0x191));var _0x8286=function(_0x5cc565,_0x32290b){_0x5cc565=_0x5cc565-0x0;var _0x208b97=_0x2868[_0x5cc565];return _0x208b97;};'use strict';var Sequelize=require(_0x8286('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8286('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8286('0x2')]('account',_0x8286('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x8286('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 4ea038b..4dce198 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 _0xf4ce=['fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','WhatsappTransferReport','rawAttributes','includeAll','include','find','create','body','params','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','name','index'];(function(_0x554b62,_0x284c76){var _0x3a50dc=function(_0x46c40d){while(--_0x46c40d){_0x554b62['push'](_0x554b62['shift']());}};_0x3a50dc(++_0x284c76);}(_0xf4ce,0xf2));var _0xef4c=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf4ce[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0xef4c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xef4c('0x1'));var rp=require(_0xef4c('0x2'));var moment=require(_0xef4c('0x3'));var BPromise=require(_0xef4c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xef4c('0x5'));var fs=require('fs');var fs_extra=require(_0xef4c('0x6'));var _=require(_0xef4c('0x7'));var squel=require(_0xef4c('0x8'));var crypto=require(_0xef4c('0x9'));var jsforce=require(_0xef4c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xef4c('0xb'));var querystring=require(_0xef4c('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xef4c('0xd'));var as=require(_0xef4c('0xe'));var hardwareService=require(_0xef4c('0xf'));var logger=require(_0xef4c('0x10'))('api');var utils=require(_0xef4c('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xef4c('0x12'))['db'];function respondWithStatusCode(_0x3bda49,_0x2bfe28){_0x2bfe28=_0x2bfe28||0xcc;return function(_0x6a1290){if(_0x6a1290){return _0x3bda49['sendStatus'](_0x2bfe28);}return _0x3bda49[_0xef4c('0x13')](_0x2bfe28)[_0xef4c('0x14')]();};}function respondWithResult(_0x12d7a6,_0x417f67){_0x417f67=_0x417f67||0xc8;return function(_0x2a2631){if(_0x2a2631){return _0x12d7a6[_0xef4c('0x13')](_0x417f67)[_0xef4c('0x15')](_0x2a2631);}};}function respondWithFilteredResult(_0x1c7633,_0x5dc6a3){return function(_0x55a7aa){if(_0x55a7aa){var _0x3637ce=typeof _0x5dc6a3[_0xef4c('0x16')]===_0xef4c('0x17')&&typeof _0x5dc6a3[_0xef4c('0x18')]===_0xef4c('0x17');var _0x371f2a=_0x55a7aa[_0xef4c('0x19')];var _0x446847=_0x3637ce?0x0:_0x5dc6a3[_0xef4c('0x16')];var _0x2bcc97=_0x3637ce?_0x55a7aa[_0xef4c('0x19')]:_0x5dc6a3[_0xef4c('0x16')]+_0x5dc6a3[_0xef4c('0x18')];var _0x560486;if(_0x2bcc97>=_0x371f2a){_0x2bcc97=_0x371f2a;_0x560486=0xc8;}else{_0x560486=0xce;}_0x1c7633[_0xef4c('0x13')](_0x560486);return _0x1c7633['set'](_0xef4c('0x1a'),_0x446847+'-'+_0x2bcc97+'/'+_0x371f2a)[_0xef4c('0x15')](_0x55a7aa);}return null;};}function patchUpdates(_0x46f556){return function(_0xd4e0a){try{jsonpatch[_0xef4c('0x1b')](_0xd4e0a,_0x46f556,!![]);}catch(_0x3bf901){return BPromise['reject'](_0x3bf901);}return _0xd4e0a[_0xef4c('0x1c')]();};}function saveUpdates(_0x460860,_0x500bd3){return function(_0x251e29){if(_0x251e29){return _0x251e29[_0xef4c('0x1d')](_0x460860)[_0xef4c('0x1e')](function(_0x4f4a3a){return _0x4f4a3a;});}return null;};}function removeEntity(_0x1f98a1,_0x17c816){return function(_0x2aca1e){if(_0x2aca1e){return _0x2aca1e['destroy']()[_0xef4c('0x1e')](function(){_0x1f98a1[_0xef4c('0x13')](0xcc)[_0xef4c('0x14')]();});}};}function handleEntityNotFound(_0xfd0013,_0x3f4015){return function(_0x26f523){if(!_0x26f523){_0xfd0013['sendStatus'](0x194);}return _0x26f523;};}function handleError(_0x7e3dd8,_0x286ad3){_0x286ad3=_0x286ad3||0x1f4;return function(_0x35f404){logger[_0xef4c('0x1f')](_0x35f404['stack']);if(_0x35f404[_0xef4c('0x20')]){delete _0x35f404['name'];}_0x7e3dd8[_0xef4c('0x13')](_0x286ad3)['send'](_0x35f404);};}exports[_0xef4c('0x21')]=function(_0x15dfba,_0x39fb17){var _0x13eb57={},_0x8fe191={},_0xb10f30={'count':0x0,'rows':[]};var _0x539486=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0x1d587a){return{'name':_0x1d587a[_0xef4c('0x22')],'type':_0x1d587a[_0xef4c('0x23')][_0xef4c('0x24')]};});_0x8fe191[_0xef4c('0x25')]=_[_0xef4c('0x26')](_0x539486,_0xef4c('0x20'));_0x8fe191[_0xef4c('0x27')]=_[_0xef4c('0x28')](_0x15dfba[_0xef4c('0x27')]);_0x8fe191[_0xef4c('0x29')]=_[_0xef4c('0x2a')](_0x8fe191['model'],_0x8fe191['query']);_0x13eb57[_0xef4c('0x2b')]=_[_0xef4c('0x2a')](_0x8fe191['model'],qs[_0xef4c('0x2c')](_0x15dfba[_0xef4c('0x27')]['fields']));_0x13eb57[_0xef4c('0x2b')]=_0x13eb57[_0xef4c('0x2b')][_0xef4c('0x2d')]?_0x13eb57[_0xef4c('0x2b')]:_0x8fe191['model'];if(!_0x15dfba[_0xef4c('0x27')][_0xef4c('0x2e')](_0xef4c('0x2f'))){_0x13eb57[_0xef4c('0x18')]=qs[_0xef4c('0x18')](_0x15dfba[_0xef4c('0x27')][_0xef4c('0x18')]);_0x13eb57['offset']=qs[_0xef4c('0x16')](_0x15dfba[_0xef4c('0x27')][_0xef4c('0x16')]);}_0x13eb57[_0xef4c('0x30')]=qs[_0xef4c('0x31')](_0x15dfba['query']['sort']);_0x13eb57[_0xef4c('0x32')]=qs[_0xef4c('0x29')](_[_0xef4c('0x33')](_0x15dfba[_0xef4c('0x27')],_0x8fe191[_0xef4c('0x29')]),_0x539486);if(_0x15dfba[_0xef4c('0x27')][_0xef4c('0x34')]){_0x13eb57[_0xef4c('0x32')]=_[_0xef4c('0x35')](_0x13eb57['where'],{'$or':_['map'](_0x539486,function(_0x7f3c9b){if(_0x7f3c9b[_0xef4c('0x23')]!==_0xef4c('0x36')){var _0x14d621={};_0x14d621[_0x7f3c9b[_0xef4c('0x20')]]={'$like':'%'+_0x15dfba[_0xef4c('0x27')][_0xef4c('0x34')]+'%'};return _0x14d621;}})});}_0x13eb57=_[_0xef4c('0x35')]({},_0x13eb57,_0x15dfba[_0xef4c('0x37')]);var _0x19524a={'where':_0x13eb57['where']};return db['WhatsappTransferReport']['count'](_0x19524a)[_0xef4c('0x1e')](function(_0x519a17){_0xb10f30['count']=_0x519a17;if(_0x15dfba['query']['includeAll']){_0x13eb57['include']=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xef4c('0x38')](_0x13eb57);})[_0xef4c('0x1e')](function(_0x46edf0){_0xb10f30[_0xef4c('0x39')]=_0x46edf0;return _0xb10f30;})[_0xef4c('0x1e')](respondWithFilteredResult(_0x39fb17,_0x13eb57))[_0xef4c('0x3a')](handleError(_0x39fb17,null));};exports['show']=function(_0x2afdec,_0x35d30e){var _0x1ec099={'raw':!![],'where':{'id':_0x2afdec['params']['id']}},_0x1f7a13={};_0x1f7a13['model']=_[_0xef4c('0x28')](db[_0xef4c('0x3b')][_0xef4c('0x3c')]);_0x1f7a13[_0xef4c('0x27')]=_[_0xef4c('0x28')](_0x2afdec[_0xef4c('0x27')]);_0x1f7a13[_0xef4c('0x29')]=_[_0xef4c('0x2a')](_0x1f7a13['model'],_0x1f7a13['query']);_0x1ec099[_0xef4c('0x2b')]=_['intersection'](_0x1f7a13[_0xef4c('0x25')],qs[_0xef4c('0x2c')](_0x2afdec[_0xef4c('0x27')][_0xef4c('0x2c')]));_0x1ec099[_0xef4c('0x2b')]=_0x1ec099[_0xef4c('0x2b')][_0xef4c('0x2d')]?_0x1ec099[_0xef4c('0x2b')]:_0x1f7a13[_0xef4c('0x25')];if(_0x2afdec[_0xef4c('0x27')][_0xef4c('0x3d')]){_0x1ec099[_0xef4c('0x3e')]=[{'all':!![]}];}_0x1ec099=_['merge']({},_0x1ec099,_0x2afdec[_0xef4c('0x37')]);return db[_0xef4c('0x3b')][_0xef4c('0x3f')](_0x1ec099)[_0xef4c('0x1e')](handleEntityNotFound(_0x35d30e,null))[_0xef4c('0x1e')](respondWithResult(_0x35d30e,null))[_0xef4c('0x3a')](handleError(_0x35d30e,null));};exports['create']=function(_0x2710fc,_0x20a30b){return db[_0xef4c('0x3b')][_0xef4c('0x40')](_0x2710fc['body'],{})[_0xef4c('0x1e')](respondWithResult(_0x20a30b,0xc9))['catch'](handleError(_0x20a30b,null));};exports[_0xef4c('0x1d')]=function(_0x2eb3ad,_0x5e89de){if(_0x2eb3ad[_0xef4c('0x41')]['id']){delete _0x2eb3ad[_0xef4c('0x41')]['id'];}return db['WhatsappTransferReport'][_0xef4c('0x3f')]({'where':{'id':_0x2eb3ad[_0xef4c('0x42')]['id']}})[_0xef4c('0x1e')](handleEntityNotFound(_0x5e89de,null))['then'](saveUpdates(_0x2eb3ad[_0xef4c('0x41')],null))[_0xef4c('0x1e')](respondWithResult(_0x5e89de,null))[_0xef4c('0x3a')](handleError(_0x5e89de,null));};exports[_0xef4c('0x43')]=function(_0x2d5e1a,_0x27056c){return db[_0xef4c('0x3b')]['find']({'where':{'id':_0x2d5e1a[_0xef4c('0x42')]['id']}})[_0xef4c('0x1e')](handleEntityNotFound(_0x27056c,null))[_0xef4c('0x1e')](removeEntity(_0x27056c,null))[_0xef4c('0x3a')](handleError(_0x27056c,null));};exports[_0xef4c('0x44')]=function(_0x431475,_0x4ac496){return db[_0xef4c('0x3b')][_0xef4c('0x44')]()[_0xef4c('0x1e')](respondWithResult(_0x4ac496,null))['catch'](handleError(_0x4ac496,null));}; \ No newline at end of file +var _0x7a66=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x269c42,_0xeed101){var _0x4dad76=function(_0x167b87){while(--_0x167b87){_0x269c42['push'](_0x269c42['shift']());}};_0x4dad76(++_0xeed101);}(_0x7a66,0x1ae));var _0x67a6=function(_0x77305c,_0x30e10a){_0x77305c=_0x77305c-0x0;var _0x167388=_0x7a66[_0x77305c];return _0x167388;};'use strict';var emlformat=require(_0x67a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x67a6('0x1'));var jsonpatch=require(_0x67a6('0x2'));var rp=require('request-promise');var moment=require(_0x67a6('0x3'));var BPromise=require(_0x67a6('0x4'));var Mustache=require(_0x67a6('0x5'));var util=require('util');var path=require(_0x67a6('0x6'));var sox=require(_0x67a6('0x7'));var csv=require(_0x67a6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x67a6('0x9'));var _=require(_0x67a6('0xa'));var squel=require(_0x67a6('0xb'));var crypto=require(_0x67a6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x67a6('0xd'));var toCsv=require(_0x67a6('0x8'));var querystring=require(_0x67a6('0xe'));var Papa=require(_0x67a6('0xf'));var Redis=require('ioredis');var authService=require(_0x67a6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x67a6('0x11'));var hardwareService=require(_0x67a6('0x12'));var logger=require(_0x67a6('0x13'))('api');var utils=require(_0x67a6('0x14'));var config=require(_0x67a6('0x15'));var licenseUtil=require(_0x67a6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fd161,_0x45e85e){_0x45e85e=_0x45e85e||0xcc;return function(_0x2434cf){if(_0x2434cf){return _0x2fd161[_0x67a6('0x17')](_0x45e85e);}return _0x2fd161[_0x67a6('0x18')](_0x45e85e)['end']();};}function respondWithResult(_0x3cc1a3,_0x2a05ad){_0x2a05ad=_0x2a05ad||0xc8;return function(_0x4a2ad9){if(_0x4a2ad9){return _0x3cc1a3[_0x67a6('0x18')](_0x2a05ad)['json'](_0x4a2ad9);}};}function respondWithFilteredResult(_0xd15559,_0x29fc19){return function(_0x314a7f){if(_0x314a7f){var _0x3a568d=typeof _0x29fc19[_0x67a6('0x19')]===_0x67a6('0x1a')&&typeof _0x29fc19[_0x67a6('0x1b')]==='undefined';var _0x4531aa=_0x314a7f[_0x67a6('0x1c')];var _0x3b164f=_0x3a568d?0x0:_0x29fc19[_0x67a6('0x19')];var _0xc2d9e9=_0x3a568d?_0x314a7f[_0x67a6('0x1c')]:_0x29fc19[_0x67a6('0x19')]+_0x29fc19[_0x67a6('0x1b')];var _0x371e2f;if(_0xc2d9e9>=_0x4531aa){_0xc2d9e9=_0x4531aa;_0x371e2f=0xc8;}else{_0x371e2f=0xce;}_0xd15559['status'](_0x371e2f);return _0xd15559['set'](_0x67a6('0x1d'),_0x3b164f+'-'+_0xc2d9e9+'/'+_0x4531aa)[_0x67a6('0x1e')](_0x314a7f);}return null;};}function patchUpdates(_0x16f8ff){return function(_0x5154c6){try{jsonpatch[_0x67a6('0x1f')](_0x5154c6,_0x16f8ff,!![]);}catch(_0x4b794e){return BPromise[_0x67a6('0x20')](_0x4b794e);}return _0x5154c6[_0x67a6('0x21')]();};}function saveUpdates(_0x402e3,_0x4ab939){return function(_0x4d6ee3){if(_0x4d6ee3){return _0x4d6ee3[_0x67a6('0x22')](_0x402e3)[_0x67a6('0x23')](function(_0x5915a1){return _0x5915a1;});}return null;};}function removeEntity(_0x3fa6f8,_0x6b4884){return function(_0x3b3dbe){if(_0x3b3dbe){return _0x3b3dbe['destroy']()[_0x67a6('0x23')](function(){_0x3fa6f8[_0x67a6('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b87a3,_0x3a83ae){return function(_0x289a88){if(!_0x289a88){_0x5b87a3['sendStatus'](0x194);}return _0x289a88;};}function handleError(_0x1fa1ec,_0xca814e){_0xca814e=_0xca814e||0x1f4;return function(_0x2f9fc8){logger[_0x67a6('0x24')](_0x2f9fc8[_0x67a6('0x25')]);if(_0x2f9fc8[_0x67a6('0x26')]){delete _0x2f9fc8[_0x67a6('0x26')];}_0x1fa1ec['status'](_0xca814e)[_0x67a6('0x27')](_0x2f9fc8);};}exports[_0x67a6('0x28')]=function(_0x4a2ade,_0x23086f){var _0x4f3568={},_0x309b33={},_0x4ea696={'count':0x0,'rows':[]};var _0x5aedd6=_[_0x67a6('0x29')](db[_0x67a6('0x2a')][_0x67a6('0x2b')],function(_0x1f4912){return{'name':_0x1f4912[_0x67a6('0x2c')],'type':_0x1f4912[_0x67a6('0x2d')][_0x67a6('0x2e')]};});_0x309b33[_0x67a6('0x2f')]=_['map'](_0x5aedd6,_0x67a6('0x26'));_0x309b33[_0x67a6('0x30')]=_[_0x67a6('0x31')](_0x4a2ade[_0x67a6('0x30')]);_0x309b33['filters']=_['intersection'](_0x309b33['model'],_0x309b33[_0x67a6('0x30')]);_0x4f3568['attributes']=_[_0x67a6('0x32')](_0x309b33['model'],qs[_0x67a6('0x33')](_0x4a2ade[_0x67a6('0x30')]['fields']));_0x4f3568[_0x67a6('0x34')]=_0x4f3568[_0x67a6('0x34')][_0x67a6('0x35')]?_0x4f3568[_0x67a6('0x34')]:_0x309b33[_0x67a6('0x2f')];if(!_0x4a2ade[_0x67a6('0x30')][_0x67a6('0x36')](_0x67a6('0x37'))){_0x4f3568[_0x67a6('0x1b')]=qs[_0x67a6('0x1b')](_0x4a2ade[_0x67a6('0x30')]['limit']);_0x4f3568[_0x67a6('0x19')]=qs['offset'](_0x4a2ade['query'][_0x67a6('0x19')]);}_0x4f3568['order']=qs[_0x67a6('0x38')](_0x4a2ade[_0x67a6('0x30')]['sort']);_0x4f3568[_0x67a6('0x39')]=qs[_0x67a6('0x3a')](_[_0x67a6('0x3b')](_0x4a2ade[_0x67a6('0x30')],_0x309b33['filters']),_0x5aedd6);if(_0x4a2ade['query']['filter']){_0x4f3568[_0x67a6('0x39')]=_['merge'](_0x4f3568[_0x67a6('0x39')],{'$or':_[_0x67a6('0x29')](_0x5aedd6,function(_0x1ec9e9){if(_0x1ec9e9[_0x67a6('0x2d')]!==_0x67a6('0x3c')){var _0x2eaadd={};_0x2eaadd[_0x1ec9e9[_0x67a6('0x26')]]={'$like':'%'+_0x4a2ade[_0x67a6('0x30')][_0x67a6('0x3d')]+'%'};return _0x2eaadd;}})});}_0x4f3568=_[_0x67a6('0x3e')]({},_0x4f3568,_0x4a2ade[_0x67a6('0x3f')]);var _0x1e5da0={'where':_0x4f3568['where']};return db[_0x67a6('0x2a')]['count'](_0x1e5da0)['then'](function(_0x511d6f){_0x4ea696['count']=_0x511d6f;if(_0x4a2ade[_0x67a6('0x30')][_0x67a6('0x40')]){_0x4f3568[_0x67a6('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x67a6('0x42')](_0x4f3568);})['then'](function(_0x2b887e){_0x4ea696['rows']=_0x2b887e;return _0x4ea696;})['then'](respondWithFilteredResult(_0x23086f,_0x4f3568))[_0x67a6('0x43')](handleError(_0x23086f,null));};exports[_0x67a6('0x44')]=function(_0xc461b2,_0x2a0753){var _0x49073f={'raw':!![],'where':{'id':_0xc461b2[_0x67a6('0x45')]['id']}},_0x33e4f4={};_0x33e4f4[_0x67a6('0x2f')]=_[_0x67a6('0x31')](db[_0x67a6('0x2a')][_0x67a6('0x2b')]);_0x33e4f4['query']=_[_0x67a6('0x31')](_0xc461b2['query']);_0x33e4f4['filters']=_['intersection'](_0x33e4f4[_0x67a6('0x2f')],_0x33e4f4[_0x67a6('0x30')]);_0x49073f['attributes']=_['intersection'](_0x33e4f4[_0x67a6('0x2f')],qs[_0x67a6('0x33')](_0xc461b2[_0x67a6('0x30')][_0x67a6('0x33')]));_0x49073f['attributes']=_0x49073f[_0x67a6('0x34')]['length']?_0x49073f[_0x67a6('0x34')]:_0x33e4f4[_0x67a6('0x2f')];if(_0xc461b2[_0x67a6('0x30')][_0x67a6('0x40')]){_0x49073f['include']=[{'all':!![]}];}_0x49073f=_[_0x67a6('0x3e')]({},_0x49073f,_0xc461b2[_0x67a6('0x3f')]);return db[_0x67a6('0x2a')][_0x67a6('0x46')](_0x49073f)[_0x67a6('0x23')](handleEntityNotFound(_0x2a0753,null))[_0x67a6('0x23')](respondWithResult(_0x2a0753,null))[_0x67a6('0x43')](handleError(_0x2a0753,null));};exports[_0x67a6('0x47')]=function(_0x1eb08a,_0x2cc7c6){return db[_0x67a6('0x2a')]['create'](_0x1eb08a[_0x67a6('0x48')],{})[_0x67a6('0x23')](respondWithResult(_0x2cc7c6,0xc9))['catch'](handleError(_0x2cc7c6,null));};exports[_0x67a6('0x22')]=function(_0x374337,_0x56f71d){if(_0x374337[_0x67a6('0x48')]['id']){delete _0x374337[_0x67a6('0x48')]['id'];}return db['WhatsappTransferReport']['find']({'where':{'id':_0x374337[_0x67a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x56f71d,null))[_0x67a6('0x23')](saveUpdates(_0x374337[_0x67a6('0x48')],null))['then'](respondWithResult(_0x56f71d,null))['catch'](handleError(_0x56f71d,null));};exports[_0x67a6('0x49')]=function(_0x17d538,_0x4fa113){return db[_0x67a6('0x2a')][_0x67a6('0x46')]({'where':{'id':_0x17d538['params']['id']}})[_0x67a6('0x23')](handleEntityNotFound(_0x4fa113,null))[_0x67a6('0x23')](removeEntity(_0x4fa113,null))['catch'](handleError(_0x4fa113,null));};exports[_0x67a6('0x4a')]=function(_0x1bced8,_0x5b21cc){return db[_0x67a6('0x2a')][_0x67a6('0x4a')]()[_0x67a6('0x23')](respondWithResult(_0x5b21cc,null))[_0x67a6('0x43')](handleError(_0x5b21cc,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index a598a26..951b985 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 _0x1a05=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0xb844e6,_0x514249){var _0x42ed72=function(_0x88fca9){while(--_0x88fca9){_0xb844e6['push'](_0xb844e6['shift']());}};_0x42ed72(++_0x514249);}(_0x1a05,0x1cc));var _0x51a0=function(_0x1aaf10,_0x23e747){_0x1aaf10=_0x1aaf10-0x0;var _0x58912f=_0x1a05[_0x1aaf10];return _0x58912f;};'use strict';var _=require(_0x51a0('0x0'));var util=require(_0x51a0('0x1'));var logger=require(_0x51a0('0x2'))(_0x51a0('0x3'));var moment=require(_0x51a0('0x4'));var BPromise=require(_0x51a0('0x5'));var rp=require(_0x51a0('0x6'));var fs=require('fs');var path=require(_0x51a0('0x7'));var rimraf=require(_0x51a0('0x8'));var config=require(_0x51a0('0x9'));var attributes=require(_0x51a0('0xa'));module[_0x51a0('0xb')]=function(_0xaed549,_0x1e9734){return _0xaed549[_0x51a0('0xc')]('WhatsappTransferReport',attributes,{'tableName':_0x51a0('0xd'),'paranoid':![],'indexes':[{'name':_0x51a0('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4f2=['../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','moment','request-promise','path','rimraf'];(function(_0x10a203,_0x49720d){var _0x5915dd=function(_0x2f2f05){while(--_0x2f2f05){_0x10a203['push'](_0x10a203['shift']());}};_0x5915dd(++_0x49720d);}(_0xc4f2,0xf8));var _0x2c4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x2c4f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2c4f('0x1'));var BPromise=require('bluebird');var rp=require(_0x2c4f('0x2'));var fs=require('fs');var path=require(_0x2c4f('0x3'));var rimraf=require(_0x2c4f('0x4'));var config=require(_0x2c4f('0x5'));var attributes=require(_0x2c4f('0x6'));module['exports']=function(_0x58b5a8,_0x1b8a40){return _0x58b5a8[_0x2c4f('0x7')](_0x2c4f('0x8'),attributes,{'tableName':_0x2c4f('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2c4f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8057bdc..db0a22b 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 _0x34c7=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5c4960,_0x51ba77){var _0x2914b4=function(_0x2aad5b){while(--_0x2aad5b){_0x5c4960['push'](_0x5c4960['shift']());}};_0x2914b4(++_0x51ba77);}(_0x34c7,0x134));var _0x734c=function(_0xda14bc,_0x172c04){_0xda14bc=_0xda14bc-0x0;var _0x3fa41e=_0x34c7[_0xda14bc];return _0x3fa41e;};'use strict';var _=require(_0x734c('0x0'));var util=require(_0x734c('0x1'));var moment=require(_0x734c('0x2'));var BPromise=require('bluebird');var rs=require(_0x734c('0x3'));var fs=require('fs');var Redis=require(_0x734c('0x4'));var db=require(_0x734c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x734c('0x6'));var jayson=require(_0x734c('0x7'));var client=jayson[_0x734c('0x8')][_0x734c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a9f6e,_0x4aed66,_0x470a3e){return new BPromise(function(_0x55d3ef,_0x358a61){return client[_0x734c('0xa')](_0x4a9f6e,_0x470a3e)[_0x734c('0xb')](function(_0x11cf1c){logger['info'](_0x734c('0xc'),_0x4aed66,_0x734c('0xd'));logger[_0x734c('0xe')](_0x734c('0xf'),_0x4aed66,'request\x20sent',JSON[_0x734c('0x10')](_0x11cf1c));if(_0x11cf1c[_0x734c('0x11')]){if(_0x11cf1c[_0x734c('0x11')][_0x734c('0x12')]===0x1f4){logger[_0x734c('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x4aed66,_0x11cf1c[_0x734c('0x11')][_0x734c('0x13')]);return _0x358a61(_0x11cf1c[_0x734c('0x11')][_0x734c('0x13')]);}logger[_0x734c('0x11')](_0x734c('0xc'),_0x4aed66,_0x11cf1c[_0x734c('0x11')][_0x734c('0x13')]);return _0x55d3ef(_0x11cf1c['error'][_0x734c('0x13')]);}else{logger[_0x734c('0x14')](_0x734c('0xc'),_0x4aed66,_0x734c('0xd'));_0x55d3ef(_0x11cf1c[_0x734c('0x15')][_0x734c('0x13')]);}})[_0x734c('0x16')](function(_0x1f05b9){logger[_0x734c('0x11')](_0x734c('0xc'),_0x4aed66,_0x1f05b9);_0x358a61(_0x1f05b9);});});} \ No newline at end of file +var _0x9963=['request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x53035f,_0x44fe62){var _0x3d39ec=function(_0x535016){while(--_0x535016){_0x53035f['push'](_0x53035f['shift']());}};_0x3d39ec(++_0x44fe62);}(_0x9963,0x11b));var _0x3996=function(_0x58803c,_0x4a34df){_0x58803c=_0x58803c-0x0;var _0xf95b9b=_0x9963[_0x58803c];return _0xf95b9b;};'use strict';var _=require(_0x3996('0x0'));var util=require(_0x3996('0x1'));var moment=require('moment');var BPromise=require(_0x3996('0x2'));var rs=require(_0x3996('0x3'));var fs=require('fs');var Redis=require(_0x3996('0x4'));var db=require(_0x3996('0x5'))['db'];var utils=require(_0x3996('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x3996('0x7'));var jayson=require(_0x3996('0x8'));var client=jayson[_0x3996('0x9')][_0x3996('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x456709,_0x581842,_0x28a7b9){return new BPromise(function(_0x68c4f6,_0x382c45){return client[_0x3996('0xb')](_0x456709,_0x28a7b9)['then'](function(_0x459db4){logger[_0x3996('0xc')](_0x3996('0xd'),_0x581842,_0x3996('0xe'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x581842,_0x3996('0xe'),JSON[_0x3996('0xf')](_0x459db4));if(_0x459db4['error']){if(_0x459db4[_0x3996('0x10')][_0x3996('0x11')]===0x1f4){logger['error'](_0x3996('0xd'),_0x581842,_0x459db4[_0x3996('0x10')][_0x3996('0x12')]);return _0x382c45(_0x459db4[_0x3996('0x10')][_0x3996('0x12')]);}logger['error'](_0x3996('0xd'),_0x581842,_0x459db4['error'][_0x3996('0x12')]);return _0x68c4f6(_0x459db4[_0x3996('0x10')][_0x3996('0x12')]);}else{logger['info'](_0x3996('0xd'),_0x581842,_0x3996('0xe'));_0x68c4f6(_0x459db4[_0x3996('0x13')][_0x3996('0x12')]);}})[_0x3996('0x14')](function(_0x77b2bd){logger[_0x3996('0x10')](_0x3996('0xd'),_0x581842,_0x77b2bd);_0x382c45(_0x77b2bd);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 5d088d5..2394f02 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb2e=['status','None','seedDB','./config/seedDB','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','info','start','then','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:'];(function(_0x2d482f,_0x484527){var _0xa0422=function(_0x2da6ea){while(--_0x2da6ea){_0x2d482f['push'](_0x2d482f['shift']());}};_0xa0422(++_0x484527);}(_0xeb2e,0x17c));var _0xeeb2=function(_0x1ea390,_0x33cafd){_0x1ea390=_0x1ea390-0x0;var _0x1edfb3=_0xeb2e[_0x1ea390];return _0x1edfb3;};'use strict';var _=require(_0xeeb2('0x0'));var mysqldb=require(_0xeeb2('0x1'));var rpc=require(_0xeeb2('0x2'));var config=require(_0xeeb2('0x3'));var logger=require(_0xeeb2('0x4'))(_0xeeb2('0x5'));var pm2=require(_0xeeb2('0x6'));var pm2Config=require(_0xeeb2('0x7'));var schedule=require('./config/schedule');var chat=require(_0xeeb2('0x8'));var whatsapp=require(_0xeeb2('0x9'));var transcribe=require(_0xeeb2('0xa'));function main(){return mysqldb['db'][_0xeeb2('0xb')][_0xeeb2('0xc')]()['then'](function(){return rpc['listen']();})['then'](function(_0x1bf8a1){logger[_0xeeb2('0xd')](_0x1bf8a1);return chat[_0xeeb2('0xe')]();})['then'](function(){return whatsapp[_0xeeb2('0xe')]();})['then'](function(){return schedule[_0xeeb2('0xe')]();})[_0xeeb2('0xf')](function(){return transcribe[_0xeeb2('0xe')]();})[_0xeeb2('0xf')](function(_0x2d60e1){logger[_0xeeb2('0xd')](_0x2d60e1);return pm2[_0xeeb2('0xe')](pm2Config);})[_0xeeb2('0xf')](function(_0x42d3a2){logger[_0xeeb2('0xd')](_0xeeb2('0x10'),_[_0xeeb2('0x11')](_[_0xeeb2('0x12')](_0x42d3a2,{'status':_0xeeb2('0x13')}),_0xeeb2('0x14'))[_0xeeb2('0x15')]());logger['info'](_0xeeb2('0x16'),_['map'](_[_0xeeb2('0x12')](_0x42d3a2,function(_0x2f2fbe){return _0x2f2fbe[_0xeeb2('0x17')]!==_0xeeb2('0x13');}),_0xeeb2('0x14'))[_0xeeb2('0x15')]()||_0xeeb2('0x18'));config[_0xeeb2('0x19')]&&require(_0xeeb2('0x1a'))['default']();require('./config/license')[_0xeeb2('0x1b')]();})['catch'](function(_0x4269a3){logger[_0xeeb2('0x1c')](_0xeeb2('0x1d'),_0x4269a3);process[_0xeeb2('0x1e')](0x1);});}main(); \ No newline at end of file +var _0x4c9f=['map','filter','name','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/logger','./config/pm2/config','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','start','info'];(function(_0x18a529,_0x2bea53){var _0x216fb8=function(_0x537d25){while(--_0x537d25){_0x18a529['push'](_0x18a529['shift']());}};_0x216fb8(++_0x2bea53);}(_0x4c9f,0x122));var _0xf4c9=function(_0x18402b,_0x5cab9e){_0x18402b=_0x18402b-0x0;var _0x239913=_0x4c9f[_0x18402b];return _0x239913;};'use strict';var _=require(_0xf4c9('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xf4c9('0x1'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xf4c9('0x2'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require(_0xf4c9('0x3'));var transcribe=require(_0xf4c9('0x4'));function main(){return mysqldb['db'][_0xf4c9('0x5')][_0xf4c9('0x6')]()[_0xf4c9('0x7')](function(){return rpc['listen']();})['then'](function(_0x4a54fa){logger['info'](_0x4a54fa);return chat[_0xf4c9('0x8')]();})[_0xf4c9('0x7')](function(){return whatsapp[_0xf4c9('0x8')]();})[_0xf4c9('0x7')](function(){return schedule['start']();})[_0xf4c9('0x7')](function(){return transcribe[_0xf4c9('0x8')]();})[_0xf4c9('0x7')](function(_0x36fc06){logger[_0xf4c9('0x9')](_0x36fc06);return pm2[_0xf4c9('0x8')](pm2Config);})[_0xf4c9('0x7')](function(_0x2598d2){logger[_0xf4c9('0x9')]('Online\x20apps:',_[_0xf4c9('0xa')](_[_0xf4c9('0xb')](_0x2598d2,{'status':'online'}),_0xf4c9('0xc'))[_0xf4c9('0xd')]());logger[_0xf4c9('0x9')](_0xf4c9('0xe'),_['map'](_[_0xf4c9('0xb')](_0x2598d2,function(_0x2438dd){return _0x2438dd[_0xf4c9('0xf')]!==_0xf4c9('0x10');}),'name')[_0xf4c9('0xd')]()||_0xf4c9('0x11'));config[_0xf4c9('0x12')]&&require(_0xf4c9('0x13'))[_0xf4c9('0x14')]();require(_0xf4c9('0x15'))[_0xf4c9('0x14')]();})[_0xf4c9('0x16')](function(_0x4035a6){logger['error'](_0xf4c9('0x17'),_0x4035a6);process[_0xf4c9('0x18')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index fe46984..9a190ef 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 _0x0d15=['regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','length','join','promisify','secret','secrets','payload','verify','randomBytes','hex','floor','now','toString','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','bluebird','util','moment','session','role','fullname','internal','email','userpic','md5secret','smsPause','pauseType','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','downloadVoiceRecordings','downloadOmnichannelInteractions','isAuthenticated','use','user','ChatInteraction','params','closed','then','status','disposition','unmanaged','json','catch','headers','startsWith','authorization','Basic','find','name','authenticate','pass','Wrong\x20credentials.','query','apikey','getUuid','User','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20object\x20not\x20found.','update','Forbidden','isMiddleware','setTokenCookie','cookie','redirect','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey'];(function(_0x5dce7a,_0x2d170a){var _0x1cdf5e=function(_0x2152fc){while(--_0x2152fc){_0x5dce7a['push'](_0x5dce7a['shift']());}};_0x1cdf5e(++_0x2d170a);}(_0x0d15,0x8f));var _0x50d1=function(_0x29f9e7,_0x285ac8){_0x29f9e7=_0x29f9e7-0x0;var _0x4fb946=_0x0d15[_0x29f9e7];return _0x4fb946;};'use strict';var db=require(_0x50d1('0x0'))['db'];var config=require(_0x50d1('0x1'));var hardwareConf=require(_0x50d1('0x2'));var licenseUtil=require(_0x50d1('0x3'));var encryptor=require(_0x50d1('0x4'));var _=require(_0x50d1('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x50d1('0x6'));var compose=require(_0x50d1('0x7'));var basicAuth=require(_0x50d1('0x8'));var crypto=require('crypto');var BPromise=require(_0x50d1('0x9'));var util=require(_0x50d1('0xa'));var moment=require(_0x50d1('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x50d1('0xc')]});var userAttributes=['id',_0x50d1('0xd'),_0x50d1('0xe'),'name',_0x50d1('0xf'),_0x50d1('0x10'),_0x50d1('0x11'),'permissions',_0x50d1('0x12'),'voicePause','chatPause','mailPause','faxPause',_0x50d1('0x13'),'openchannelPause',_0x50d1('0x14'),'showWebBar',_0x50d1('0x15'),'lastPauseAt',_0x50d1('0x16'),_0x50d1('0x17'),_0x50d1('0x18'),_0x50d1('0x19'),_0x50d1('0x1a'),_0x50d1('0x1b'),_0x50d1('0x1c'),_0x50d1('0x1d'),'phoneBarEnableDtmfTone',_0x50d1('0x1e'),_0x50d1('0x1f'),_0x50d1('0x20'),'phoneBarRemoteControl',_0x50d1('0x21'),'hotdesk',_0x50d1('0x22'),_0x50d1('0x23'),'privacyEnabled','settingsEnabled','wssPort',_0x50d1('0x24'),_0x50d1('0x25'),'downloadAttachments'];exports['isChatInteractionAuthorized']=function(){return this[_0x50d1('0x26')](!![])[_0x50d1('0x27')](function(_0x246663,_0x3f5600,_0x4285d1){if(_0x246663[_0x50d1('0x28')]){_0x4285d1();}else{return db[_0x50d1('0x29')]['findOne']({'where':{'id':_0x246663[_0x50d1('0x2a')]['id']},'attributes':['id',_0x50d1('0x2b'),'disposition'],'raw':!![]})[_0x50d1('0x2c')](function(_0x372f25){if(_0x372f25&&_0x372f25[_0x50d1('0x2b')]){return _0x3f5600[_0x50d1('0x2d')](_0x372f25[_0x50d1('0x2e')]===_0x50d1('0x2f')?0x195:0x193)[_0x50d1('0x30')]({'message':_0x372f25[_0x50d1('0x2e')]===_0x50d1('0x2f')?'Unmanaged.':'Forbidden.'});}else{_0x4285d1();}})[_0x50d1('0x31')](function(_0x6c51fd){_0x4285d1(_0x6c51fd);});}});};exports['isAuthenticated']=function isAuthenticated(_0x53c83b){return compose()[_0x50d1('0x27')](function(_0xe326bd,_0x5015b8,_0xaef0ba){var _0x38853f;if(_0xe326bd[_0x50d1('0x32')]['authorization']){if(_[_0x50d1('0x33')](_0xe326bd[_0x50d1('0x32')][_0x50d1('0x34')],_0x50d1('0x35'))){var _0x530cc8=basicAuth(_0xe326bd);db['User'][_0x50d1('0x36')]({'where':{'name':_0x530cc8[_0x50d1('0x37')]}})[_0x50d1('0x2c')](function(_0x568d9d){if(!_0x568d9d||!_0x568d9d[_0x50d1('0x38')](_0x530cc8[_0x50d1('0x39')])){return _0x5015b8[_0x50d1('0x2d')](0x191)[_0x50d1('0x30')]({'message':_0x50d1('0x3a')});}_0xe326bd[_0x50d1('0x28')]={'id':_0x568d9d['id']};_0xaef0ba();})[_0x50d1('0x31')](function(_0x923617){_0xaef0ba(_0x923617);});}else if(_['startsWith'](_0xe326bd[_0x50d1('0x32')][_0x50d1('0x34')],'Bearer')){validateJwt(_0xe326bd,_0x5015b8,_0xaef0ba);}else{if(_0x53c83b){_0xaef0ba();}else{return _0x5015b8[_0x50d1('0x2d')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xe326bd[_0x50d1('0x3b')][_0x50d1('0x3c')]){try{var _0x2f212b={'audience':hardwareConf[_0x50d1('0x3d')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0xe326bd[_0x50d1('0x3b')]['apikey'],_0x2f212b)[_0x50d1('0x2c')](function(_0x2df1d8){return db[_0x50d1('0x3e')][_0x50d1('0x36')]({'where':{'id':_0x2df1d8[_0x50d1('0x3f')]}})[_0x50d1('0x2c')](function(_0x4fa48e){_0x38853f=_0x4fa48e;return db[_0x50d1('0x40')][_0x50d1('0x41')]({'where':{'id':0x1},'attributes':[_0x50d1('0x42'),_0x50d1('0x43')],'raw':!![]});})['then'](function(_0x117bb7){if(!_0x38853f||!_[_0x50d1('0x44')](_0x38853f[_0x50d1('0x45')],_0x2df1d8[_0x50d1('0x46')])){return _0x5015b8[_0x50d1('0x2d')](0x191)[_0x50d1('0x30')]({'message':_0x50d1('0x47')});}if(_0x38853f[_0x50d1('0x48')]){return _0x5015b8[_0x50d1('0x2d')](0x191)[_0x50d1('0x30')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x38853f[_0x50d1('0x49')]){if(_0x117bb7[_0x50d1('0x43')]>0x0){if(moment(_0x38853f[_0x50d1('0x4a')])[_0x50d1('0x4b')](_0x117bb7[_0x50d1('0x43')],_0x50d1('0x4c'))>moment()){return _0x5015b8[_0x50d1('0x2d')](0x191)['json']({'message':_0x50d1('0x4d')});}}else{return _0x5015b8[_0x50d1('0x2d')](0x191)[_0x50d1('0x30')]({'message':_0x50d1('0x4d')});}}_0xe326bd[_0x50d1('0x28')]={'id':_0x38853f['id']};_0xaef0ba();});})[_0x50d1('0x31')](function(){return _0x5015b8[_0x50d1('0x2d')](0x191)[_0x50d1('0x30')]({'message':_0x50d1('0x4d')});});}catch(_0x197152){_0xaef0ba(_0x197152);}}else if(_0x53c83b){_0xaef0ba();}else{return _0x5015b8[_0x50d1('0x2d')](0x193)[_0x50d1('0x30')]({'message':_0x50d1('0x4e')});}})[_0x50d1('0x27')](function(_0x9f456c,_0x68c809,_0x165690){if(_0x9f456c[_0x50d1('0x28')]){db['User']['find']({'where':{'id':_0x9f456c[_0x50d1('0x28')]['id']},'attributes':userAttributes})[_0x50d1('0x2c')](function(_0xb7afd9){if(!_0xb7afd9){return _0x68c809[_0x50d1('0x2d')](0x194)[_0x50d1('0x30')]({'message':'User\x20not\x20found.'});}_0x9f456c[_0x50d1('0x28')]=_0xb7afd9;_0x165690();})[_0x50d1('0x31')](function(_0x449679){_0x165690(_0x449679);});}else if(_0x53c83b){_0x165690();}else{return _0x68c809[_0x50d1('0x2d')](0x194)[_0x50d1('0x30')]({'message':_0x50d1('0x4f')});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x42015e,_0x4ba2b4,_0x3774a9){return licenseUtil['getLicense']()['then'](function(_0x4c9d8b){if(_0x4c9d8b[_0x50d1('0x50')]){_0x3774a9();}else{return _0x4ba2b4[_0x50d1('0x2d')](0x193)['json']({'message':_0x50d1('0x51')});}})[_0x50d1('0x31')](function(_0x1ba7fa){_0x3774a9(_0x1ba7fa);});});};exports[_0x50d1('0x52')]=function(_0x2e0d60,_0x18f59a,_0x3c1589){_0x2e0d60[_0x50d1('0x52')]=!![];return _0x3c1589();};exports['signToken']=function signToken(_0x223f71){return signJwt(_0x223f71);};exports[_0x50d1('0x53')]=function(_0x1c9f24,_0x828727){if(!_0x1c9f24['user']){return _0x828727['status'](0x194)[_0x50d1('0x30')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x32b699={'payload':{'id':_0x1c9f24[_0x50d1('0x28')]['id'],'role':_0x1c9f24[_0x50d1('0x28')][_0x50d1('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x32b699)['then'](function(_0x5753ff){_0x828727[_0x50d1('0x54')]('motion.token',_0x5753ff);_0x828727[_0x50d1('0x55')]('/dashboards/general');})['catch'](function(_0xab32ff){return _0x828727[_0x50d1('0x2d')](0x1f4)[_0x50d1('0x56')](_0xab32ff);});};exports[_0x50d1('0x57')]=function(_0x329685){if(_[_0x50d1('0x58')](_0x329685[_0x50d1('0x45')])||_[_0x50d1('0x58')](_0x329685[_0x50d1('0x59')])){return null;}else{return createJwt(_0x329685);}};exports[_0x50d1('0x5a')]=function(_0x152225){_0x152225[_0x50d1('0x45')]=generateNonce();_0x152225[_0x50d1('0x59')]=generateIssuedAt();return createJwt(_0x152225);};exports[_0x50d1('0x5b')]=function(_0x56a54f,_0x265f5f){var _0x394d2c=_0x56a54f[_0x50d1('0x3b')]['apikey'];if(_0x394d2c){var _0xdc29b8={'nonce':_0x265f5f[_0x50d1('0x45')],'iat':_0x265f5f['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x50d1('0x3d')]()};return verifyJwt(_0x394d2c,_0xdc29b8)['then'](function(){return generateApiKey(_0x265f5f);});}else{throw{'message':_0x50d1('0x5c')};}};exports[_0x50d1('0x5d')]=function(_0x446565){var _0x434a70=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x434a70['test'](_0x446565))throw new db[(_0x50d1('0x5e'))][(_0x50d1('0x5f'))](_0x50d1('0x60'));return;};exports[_0x50d1('0x61')]=function(_0x57fa07,_0x362126,_0x11cc9a){var _0x4ea9c2=encryptor[_0x50d1('0x62')](_0x362126)[_0x50d1('0x63')](',');for(var _0x21a744=0x0;_0x21a744<_0x11cc9a;_0x21a744++){if(!_0x4ea9c2[_0x21a744])break;if(_0x57fa07[_0x50d1('0x64')]()===_0x4ea9c2[_0x21a744]['toLowerCase']()){var _0x455436=util[_0x50d1('0x65')](_0x50d1('0x66'),_0x11cc9a);if(_0x11cc9a===0x1){_0x455436=_0x50d1('0x67');}throw new db[(_0x50d1('0x5e'))]['ValidationError'](_0x455436);}}return;};exports['updatePasswordsHistory']=function(_0x40fc7c,_0xb7a909){var _0x7e4942=_0xb7a909?encryptor['decryptString'](_0xb7a909)[_0x50d1('0x63')](','):[];if(_0x7e4942[_0x50d1('0x68')]===0x5){_0x7e4942['splice'](-0x1,0x1);}_0x7e4942['unshift'](_0x40fc7c);return encryptor['encryptString'](_0x7e4942[_0x50d1('0x69')](','));};function signJwt(_0x3ecbf7){var _0x464290=BPromise[_0x50d1('0x6a')](jwt['sign'],{'context':jwt});var _0x123651=_0x3ecbf7[_0x50d1('0x6b')]||config[_0x50d1('0x6c')][_0x50d1('0xc')];return new BPromise(function(_0x571537,_0x2bcc06){_0x464290(_0x3ecbf7[_0x50d1('0x6d')],_0x123651,_0x3ecbf7['options'])[_0x50d1('0x2c')](function(_0x13108d){_0x571537(_0x13108d);})[_0x50d1('0x31')](function(_0x557579){_0x2bcc06(_0x557579);});});}function verifyJwt(_0xcce6af,_0xa2ee8,_0x4f9c1f){var _0x3829a0=BPromise[_0x50d1('0x6a')](jwt[_0x50d1('0x6e')],{'context':jwt});var _0x57c146=_0x4f9c1f||config[_0x50d1('0x6c')]['session'];return new BPromise(function(_0x25d0f1,_0x565f72){_0x3829a0(_0xcce6af,_0x57c146,_0xa2ee8)[_0x50d1('0x2c')](function(_0x184c43){_0x25d0f1(_0x184c43);})['catch'](function(_0x2e4ae1){_0x565f72(_0x2e4ae1);});});}function generateNonce(){return crypto[_0x50d1('0x6f')](0x10)['toString'](_0x50d1('0x70'));}function generateIssuedAt(){return Math[_0x50d1('0x71')](Date[_0x50d1('0x72')]()/0x3e8)[_0x50d1('0x73')]();}function createJwt(_0x3a0951){var _0x1300a3={'payload':{'iat':_0x3a0951[_0x50d1('0x59')],'nonce':_0x3a0951[_0x50d1('0x45')]},'options':{'algorithm':_0x50d1('0x74'),'subject':_0x3a0951['id'][_0x50d1('0x73')](),'issuer':hardwareConf[_0x50d1('0x3d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1300a3)[_0x50d1('0x2c')](function(_0x17f3f5){return{'iat':_0x3a0951[_0x50d1('0x59')],'nonce':_0x3a0951[_0x50d1('0x45')],'token':_0x17f3f5};});} \ No newline at end of file +var _0xc289=['apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','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.','ValidationError','split','length','splice','unshift','encryptString','promisify','secret','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','express-jwt','basic-auth','crypto','bluebird','util','secrets','session','role','fullname','email','permissions','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','name','authenticate','pass','Wrong\x20credentials.','user','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','minutes','use','find','canUpdate','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey'];(function(_0x39bc67,_0x1b4f50){var _0x355386=function(_0x4289d4){while(--_0x4289d4){_0x39bc67['push'](_0x39bc67['shift']());}};_0x355386(++_0x1b4f50);}(_0xc289,0x118));var _0x9c28=function(_0x38b24e,_0x2ce4ac){_0x38b24e=_0x38b24e-0x0;var _0x443f50=_0xc289[_0x38b24e];return _0x443f50;};'use strict';var db=require(_0x9c28('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x9c28('0x1'));var licenseUtil=require(_0x9c28('0x2'));var encryptor=require(_0x9c28('0x3'));var _=require(_0x9c28('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x9c28('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x9c28('0x6'));var crypto=require(_0x9c28('0x7'));var BPromise=require(_0x9c28('0x8'));var util=require(_0x9c28('0x9'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0x9c28('0xa')][_0x9c28('0xb')]});var userAttributes=['id',_0x9c28('0xc'),_0x9c28('0xd'),'name','internal',_0x9c28('0xe'),'userpic',_0x9c28('0xf'),'md5secret','voicePause',_0x9c28('0x10'),'mailPause',_0x9c28('0x11'),'smsPause',_0x9c28('0x12'),_0x9c28('0x13'),_0x9c28('0x14'),_0x9c28('0x15'),_0x9c28('0x16'),_0x9c28('0x17'),_0x9c28('0x18'),_0x9c28('0x19'),_0x9c28('0x1a'),_0x9c28('0x1b'),_0x9c28('0x1c'),_0x9c28('0x1d'),_0x9c28('0x1e'),_0x9c28('0x1f'),_0x9c28('0x20'),_0x9c28('0x21'),'phoneBarPrefixRequired',_0x9c28('0x22'),'phoneBarRemoteControlPort',_0x9c28('0x23'),_0x9c28('0x24'),_0x9c28('0x25'),_0x9c28('0x26'),_0x9c28('0x27'),_0x9c28('0x28'),'downloadVoiceRecordings',_0x9c28('0x29'),_0x9c28('0x2a')];exports[_0x9c28('0x2b')]=function(){return this[_0x9c28('0x2c')](!![])['use'](function(_0x242260,_0x50f684,_0x58cc7a){if(_0x242260['user']){_0x58cc7a();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x242260['params']['id']},'attributes':['id',_0x9c28('0x2d'),_0x9c28('0x2e')],'raw':!![]})[_0x9c28('0x2f')](function(_0x664cbe){if(_0x664cbe&&_0x664cbe[_0x9c28('0x2d')]){return _0x50f684[_0x9c28('0x30')](_0x664cbe['disposition']==='unmanaged'?0x195:0x193)[_0x9c28('0x31')]({'message':_0x664cbe['disposition']===_0x9c28('0x32')?_0x9c28('0x33'):_0x9c28('0x34')});}else{_0x58cc7a();}})['catch'](function(_0x47c276){_0x58cc7a(_0x47c276);});}});};exports[_0x9c28('0x2c')]=function isAuthenticated(_0x3983d2){return compose()['use'](function(_0x10448b,_0x36b900,_0x51af57){var _0x8e3191;if(_0x10448b[_0x9c28('0x35')][_0x9c28('0x36')]){if(_[_0x9c28('0x37')](_0x10448b[_0x9c28('0x35')]['authorization'],_0x9c28('0x38'))){var _0x1dd62f=basicAuth(_0x10448b);db[_0x9c28('0x39')]['find']({'where':{'name':_0x1dd62f[_0x9c28('0x3a')]}})['then'](function(_0x31706f){if(!_0x31706f||!_0x31706f[_0x9c28('0x3b')](_0x1dd62f[_0x9c28('0x3c')])){return _0x36b900[_0x9c28('0x30')](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x3d')});}_0x10448b[_0x9c28('0x3e')]={'id':_0x31706f['id']};_0x51af57();})[_0x9c28('0x3f')](function(_0x3a6a23){_0x51af57(_0x3a6a23);});}else if(_[_0x9c28('0x37')](_0x10448b['headers'][_0x9c28('0x36')],_0x9c28('0x40'))){validateJwt(_0x10448b,_0x36b900,_0x51af57);}else{if(_0x3983d2){_0x51af57();}else{return _0x36b900['status'](0x193)[_0x9c28('0x31')]({'message':_0x9c28('0x41')});}}}else if(_0x10448b[_0x9c28('0x42')][_0x9c28('0x43')]){try{var _0x4eeb0b={'audience':hardwareConf[_0x9c28('0x44')](),'issuer':hardwareConf[_0x9c28('0x44')]()};verifyJwt(_0x10448b['query'][_0x9c28('0x43')],_0x4eeb0b)[_0x9c28('0x2f')](function(_0x4b23c2){return db[_0x9c28('0x39')]['find']({'where':{'id':_0x4b23c2[_0x9c28('0x45')]}})[_0x9c28('0x2f')](function(_0x3cba81){_0x8e3191=_0x3cba81;return db[_0x9c28('0x46')][_0x9c28('0x47')]({'where':{'id':0x1},'attributes':[_0x9c28('0x48'),_0x9c28('0x49')],'raw':!![]});})[_0x9c28('0x2f')](function(_0x4e3ffc){if(!_0x8e3191||!_['isEqual'](_0x8e3191[_0x9c28('0x4a')],_0x4b23c2[_0x9c28('0x4b')])){return _0x36b900[_0x9c28('0x30')](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4c')});}if(_0x8e3191[_0x9c28('0x4d')]){return _0x36b900[_0x9c28('0x30')](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});}if(_0x8e3191['blocked']){if(_0x4e3ffc[_0x9c28('0x49')]>0x0){if(moment(_0x8e3191[_0x9c28('0x4f')])[_0x9c28('0x50')](_0x4e3ffc[_0x9c28('0x49')],_0x9c28('0x51'))>moment()){return _0x36b900['status'](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});}}else{return _0x36b900['status'](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});}}_0x10448b['user']={'id':_0x8e3191['id']};_0x51af57();});})['catch'](function(){return _0x36b900['status'](0x191)[_0x9c28('0x31')]({'message':_0x9c28('0x4e')});});}catch(_0x370b20){_0x51af57(_0x370b20);}}else if(_0x3983d2){_0x51af57();}else{return _0x36b900[_0x9c28('0x30')](0x193)['json']({'message':_0x9c28('0x41')});}})[_0x9c28('0x52')](function(_0xc1915d,_0x35ca9b,_0xb1afae){if(_0xc1915d[_0x9c28('0x3e')]){db[_0x9c28('0x39')][_0x9c28('0x53')]({'where':{'id':_0xc1915d['user']['id']},'attributes':userAttributes})[_0x9c28('0x2f')](function(_0x48caa7){if(!_0x48caa7){return _0x35ca9b[_0x9c28('0x30')](0x194)[_0x9c28('0x31')]({'message':'User\x20not\x20found.'});}_0xc1915d[_0x9c28('0x3e')]=_0x48caa7;_0xb1afae();})[_0x9c28('0x3f')](function(_0x4e9b65){_0xb1afae(_0x4e9b65);});}else if(_0x3983d2){_0xb1afae();}else{return _0x35ca9b[_0x9c28('0x30')](0x194)[_0x9c28('0x31')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x9c28('0x54')]=function canUpdate(){return compose()['use'](function(_0x2c2f66,_0x478fb9,_0x1f7688){return licenseUtil['getLicense']()[_0x9c28('0x2f')](function(_0x4d6030){if(_0x4d6030['update']){_0x1f7688();}else{return _0x478fb9[_0x9c28('0x30')](0x193)[_0x9c28('0x31')]({'message':_0x9c28('0x55')});}})[_0x9c28('0x3f')](function(_0x4e4c79){_0x1f7688(_0x4e4c79);});});};exports[_0x9c28('0x56')]=function(_0xe598d4,_0x5326d3,_0x338eed){_0xe598d4['isMiddleware']=!![];return _0x338eed();};exports[_0x9c28('0x57')]=function signToken(_0x2fcfa7){return signJwt(_0x2fcfa7);};exports['setTokenCookie']=function(_0x1d469f,_0x4b9e71){if(!_0x1d469f[_0x9c28('0x3e')]){return _0x4b9e71['status'](0x194)['json']({'message':_0x9c28('0x58')});}var _0x28b474={'payload':{'id':_0x1d469f[_0x9c28('0x3e')]['id'],'role':_0x1d469f[_0x9c28('0x3e')][_0x9c28('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x28b474)['then'](function(_0xe29c7c){_0x4b9e71['cookie']('motion.token',_0xe29c7c);_0x4b9e71[_0x9c28('0x59')](_0x9c28('0x5a'));})[_0x9c28('0x3f')](function(_0x2bead9){return _0x4b9e71[_0x9c28('0x30')](0x1f4)[_0x9c28('0x5b')](_0x2bead9);});};exports[_0x9c28('0x5c')]=function(_0x2d88c4){if(_[_0x9c28('0x5d')](_0x2d88c4[_0x9c28('0x4a')])||_[_0x9c28('0x5d')](_0x2d88c4['apiKeyIat'])){return null;}else{return createJwt(_0x2d88c4);}};exports[_0x9c28('0x5e')]=function(_0x886e3f){_0x886e3f[_0x9c28('0x4a')]=generateNonce();_0x886e3f[_0x9c28('0x5f')]=generateIssuedAt();return createJwt(_0x886e3f);};exports[_0x9c28('0x60')]=function(_0x5c7608,_0x15383c){var _0x147999=_0x5c7608['query']['apikey'];if(_0x147999){var _0x24963c={'nonce':_0x15383c[_0x9c28('0x4a')],'iat':_0x15383c[_0x9c28('0x5f')],'audience':hardwareConf[_0x9c28('0x44')](),'issuer':hardwareConf[_0x9c28('0x44')]()};return verifyJwt(_0x147999,_0x24963c)[_0x9c28('0x2f')](function(){return generateApiKey(_0x15383c);});}else{throw{'message':_0x9c28('0x61')};}};exports[_0x9c28('0x62')]=function(_0x11b3f7){var _0x311d2e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x311d2e[_0x9c28('0x63')](_0x11b3f7))throw new db[(_0x9c28('0x64'))]['ValidationError'](_0x9c28('0x65'));return;};exports[_0x9c28('0x66')]=function(_0x4b4bce,_0x303f1f,_0x2a91ec){var _0x420f26=encryptor[_0x9c28('0x67')](_0x303f1f)['split'](',');for(var _0x40b450=0x0;_0x40b450<_0x2a91ec;_0x40b450++){if(!_0x420f26[_0x40b450])break;if(_0x4b4bce[_0x9c28('0x68')]()===_0x420f26[_0x40b450][_0x9c28('0x68')]()){var _0xdac6d4=util[_0x9c28('0x69')](_0x9c28('0x6a'),_0x2a91ec);if(_0x2a91ec===0x1){_0xdac6d4=_0x9c28('0x6b');}throw new db['Sequelize'][(_0x9c28('0x6c'))](_0xdac6d4);}}return;};exports['updatePasswordsHistory']=function(_0xcd7368,_0x5907d2){var _0x2eabf4=_0x5907d2?encryptor['decryptString'](_0x5907d2)[_0x9c28('0x6d')](','):[];if(_0x2eabf4[_0x9c28('0x6e')]===0x5){_0x2eabf4[_0x9c28('0x6f')](-0x1,0x1);}_0x2eabf4[_0x9c28('0x70')](_0xcd7368);return encryptor[_0x9c28('0x71')](_0x2eabf4['join'](','));};function signJwt(_0x4e773e){var _0x2f701a=BPromise[_0x9c28('0x72')](jwt['sign'],{'context':jwt});var _0x23ae69=_0x4e773e[_0x9c28('0x73')]||config[_0x9c28('0xa')][_0x9c28('0xb')];return new BPromise(function(_0x4ffab8,_0x5d93c2){_0x2f701a(_0x4e773e[_0x9c28('0x74')],_0x23ae69,_0x4e773e[_0x9c28('0x75')])[_0x9c28('0x2f')](function(_0x1aae1c){_0x4ffab8(_0x1aae1c);})[_0x9c28('0x3f')](function(_0x4f767e){_0x5d93c2(_0x4f767e);});});}function verifyJwt(_0x3ce7b7,_0x153475,_0x467eb1){var _0x4fffca=BPromise[_0x9c28('0x72')](jwt[_0x9c28('0x76')],{'context':jwt});var _0x102f52=_0x467eb1||config[_0x9c28('0xa')]['session'];return new BPromise(function(_0x1cd9fa,_0x399d3d){_0x4fffca(_0x3ce7b7,_0x102f52,_0x153475)[_0x9c28('0x2f')](function(_0x3fa271){_0x1cd9fa(_0x3fa271);})[_0x9c28('0x3f')](function(_0x5ba81f){_0x399d3d(_0x5ba81f);});});}function generateNonce(){return crypto[_0x9c28('0x77')](0x10)[_0x9c28('0x78')](_0x9c28('0x79'));}function generateIssuedAt(){return Math[_0x9c28('0x7a')](Date[_0x9c28('0x7b')]()/0x3e8)[_0x9c28('0x78')]();}function createJwt(_0x44f672){var _0x4abfa9={'payload':{'iat':_0x44f672[_0x9c28('0x5f')],'nonce':_0x44f672[_0x9c28('0x4a')]},'options':{'algorithm':_0x9c28('0x7c'),'subject':_0x44f672['id'][_0x9c28('0x78')](),'issuer':hardwareConf[_0x9c28('0x44')](),'audience':hardwareConf[_0x9c28('0x44')]()}};return signJwt(_0x4abfa9)[_0x9c28('0x2f')](function(_0x158871){return{'iat':_0x44f672[_0x9c28('0x5f')],'nonce':_0x44f672['apiKeyNonce'],'token':_0x158871};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 9ddbfb5..096b9f7 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 _0x2c36=['decryptFile','createReadStream','createWriteStream','encryptString','createCipher','base64','decryptString','crypto','bluebird','lodash','../../config/logger','app','secrets','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','data','update','end','final','binary','write','close','unlink'];(function(_0x2813d3,_0x116661){var _0x3bdd35=function(_0x353c70){while(--_0x353c70){_0x2813d3['push'](_0x2813d3['shift']());}};_0x3bdd35(++_0x116661);}(_0x2c36,0x1e7));var _0x62c3=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0x2c36[_0xe7281f];return _0x90dc99;};'use strict';var crypto=require(_0x62c3('0x0'));var fs=require('fs');var BPromise=require(_0x62c3('0x1'));var _=require(_0x62c3('0x2'));var config=require('../../config/environment');var logger=require(_0x62c3('0x3'))(_0x62c3('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x62c3('0x5')]['session'],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x62c3('0x6')};if(config[_0x62c3('0x7')]&&config[_0x62c3('0x7')][_0x62c3('0x8')]){var isSupported=isAlgorithmSupported(config[_0x62c3('0x7')]['algorithm']);if(isSupported){fileOptions[_0x62c3('0x8')]=config[_0x62c3('0x7')][_0x62c3('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x62c3('0x9')](',\x20');logger[_0x62c3('0xa')](config[_0x62c3('0x7')][_0x62c3('0x8')],_0x62c3('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x4fc2d6){return AES_SUPPORTED_RX[_0x62c3('0xc')](_0x4fc2d6);}function getSupportedCiphers(){return crypto[_0x62c3('0xd')]()[_0x62c3('0xe')](isASupportedCipher);}function isAlgorithmSupported(_0xeab403){return getSupportedCiphers()[_0x62c3('0xf')](_0xeab403)>-0x1;}function combineOptions(_0x33574d){var _0x281377={};for(var _0x3a665c in fileOptions){if(fileOptions[_0x62c3('0x10')](_0x3a665c)){_0x281377[_0x3a665c]=fileOptions[_0x3a665c];}}if(_0x33574d){for(var _0xc75826 in _0x33574d){if(_0x33574d['hasOwnProperty'](_0xc75826)){_0x281377[_0xc75826]=_0x33574d[_0xc75826];}}}return _0x281377;}exports['encryptFile']=function(_0x53361f,_0x5dc54a,_0x5c0908,_0x5765fc){return new BPromise(function(_0x113087,_0x40ad1d){_0x5765fc=combineOptions(_0x5765fc);var _0x834df1=new Buffer(_0x5c0908);var _0x457e51=fs['createReadStream'](_0x53361f);var _0x3c41c3=fs['createWriteStream'](_0x5dc54a);var _0x5d90c0=crypto['createCipher'](_0x5765fc['algorithm'],_0x834df1);_0x457e51['on'](_0x62c3('0x11'),function(_0x20e76d){var _0x28ef5a=new Buffer(_0x5d90c0[_0x62c3('0x12')](_0x20e76d),'binary');_0x3c41c3['write'](_0x28ef5a);});_0x457e51['on'](_0x62c3('0x13'),function(){try{var _0x28c515=new Buffer(_0x5d90c0[_0x62c3('0x14')](_0x62c3('0x15')),_0x62c3('0x15'));_0x3c41c3[_0x62c3('0x16')](_0x28c515);_0x3c41c3[_0x62c3('0x13')]();_0x3c41c3['on'](_0x62c3('0x17'),function(){return _0x113087(_0x5dc54a);});}catch(_0x2bc264){fs[_0x62c3('0x18')](_0x5dc54a);return _0x40ad1d(_0x2bc264);}});});};exports[_0x62c3('0x19')]=function(_0x196746,_0x378cee,_0xf6bcbb,_0x3da08f){return new BPromise(function(_0x1683ec,_0x56dcf7){_0x3da08f=combineOptions(_0x3da08f);var _0x54d5ed=new Buffer(_0xf6bcbb);var _0x40c1f9=fs[_0x62c3('0x1a')](_0x196746);var _0x142dca=fs[_0x62c3('0x1b')](_0x378cee);var _0x1a72ef=crypto['createDecipher'](_0x3da08f['algorithm'],_0x54d5ed);_0x40c1f9['on'](_0x62c3('0x11'),function(_0x2361ba){var _0x58d58a=new Buffer(_0x1a72ef[_0x62c3('0x12')](_0x2361ba),'binary');_0x142dca[_0x62c3('0x16')](_0x58d58a);});_0x40c1f9['on'](_0x62c3('0x13'),function(){try{var _0x4e77c2=new Buffer(_0x1a72ef['final'](_0x62c3('0x15')),'binary');_0x142dca['write'](_0x4e77c2);_0x142dca['end']();_0x142dca['on'](_0x62c3('0x17'),function(){return _0x1683ec(_0x378cee);});}catch(_0x23c37c){fs['unlink'](_0x378cee);return _0x56dcf7(_0x23c37c);}});});};exports[_0x62c3('0x1c')]=function(_0x4e50c6,_0x4b5f11,_0x2972ed){var _0x59995c=_0x2972ed||stringOptions['algorithm'];var _0x23f917=_0x4b5f11||stringOptions['secret'];var _0x15d8cf=crypto[_0x62c3('0x1d')](_0x59995c,_0x23f917);var _0x531d15=_0x15d8cf[_0x62c3('0x12')](_0x4e50c6,'utf8',_0x62c3('0x1e'));_0x531d15+=_0x15d8cf[_0x62c3('0x14')]('base64');return _0x531d15;};exports[_0x62c3('0x1f')]=function(_0x2d7d5e,_0x2643ff,_0x5d2430){var _0x49876c=_0x5d2430||stringOptions[_0x62c3('0x8')];var _0x214153=_0x2643ff||stringOptions['secret'];var _0x38ca30=crypto['createDecipher'](_0x49876c,_0x214153);var _0x2ab507=_0x38ca30[_0x62c3('0x12')](_0x2d7d5e,_0x62c3('0x1e'),'utf8');_0x2ab507+=_0x38ca30[_0x62c3('0x14')]('utf8');return _0x2ab507;}; \ No newline at end of file +var _0xe3f2=['final','close','createReadStream','update','unlink','encryptString','secret','base64','decryptString','createDecipher','utf8','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','encryptFile','createCipher','data','binary','write','end'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0xe3f2,0x1a3));var _0x2e3f=function(_0xa5f2ec,_0x3a3b90){_0xa5f2ec=_0xa5f2ec-0x0;var _0x4089d6=_0xe3f2[_0xa5f2ec];return _0x4089d6;};'use strict';var crypto=require(_0x2e3f('0x0'));var fs=require('fs');var BPromise=require(_0x2e3f('0x1'));var _=require(_0x2e3f('0x2'));var config=require(_0x2e3f('0x3'));var logger=require(_0x2e3f('0x4'))(_0x2e3f('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x2e3f('0x6')],'algorithm':_0x2e3f('0x7')};const fileOptions={'algorithm':_0x2e3f('0x8')};if(config['encrypt']&&config[_0x2e3f('0x9')][_0x2e3f('0xa')]){var isSupported=isAlgorithmSupported(config[_0x2e3f('0x9')][_0x2e3f('0xa')]);if(isSupported){fileOptions[_0x2e3f('0xa')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x2e3f('0xb')](',\x20');logger[_0x2e3f('0xc')](config[_0x2e3f('0x9')][_0x2e3f('0xa')],_0x2e3f('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0xe5c2c9){return AES_SUPPORTED_RX[_0x2e3f('0xe')](_0xe5c2c9);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x2e3f('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0xb677ce){return getSupportedCiphers()['indexOf'](_0xb677ce)>-0x1;}function combineOptions(_0x8d9999){var _0x28b07d={};for(var _0x523887 in fileOptions){if(fileOptions[_0x2e3f('0x10')](_0x523887)){_0x28b07d[_0x523887]=fileOptions[_0x523887];}}if(_0x8d9999){for(var _0x3b28b7 in _0x8d9999){if(_0x8d9999[_0x2e3f('0x10')](_0x3b28b7)){_0x28b07d[_0x3b28b7]=_0x8d9999[_0x3b28b7];}}}return _0x28b07d;}exports[_0x2e3f('0x11')]=function(_0x1b4233,_0x18b77d,_0x3b4904,_0x16c586){return new BPromise(function(_0x1cf84a,_0x5bcb22){_0x16c586=combineOptions(_0x16c586);var _0x682dc=new Buffer(_0x3b4904);var _0x2aace3=fs['createReadStream'](_0x1b4233);var _0x5996e9=fs['createWriteStream'](_0x18b77d);var _0x4655ac=crypto[_0x2e3f('0x12')](_0x16c586[_0x2e3f('0xa')],_0x682dc);_0x2aace3['on'](_0x2e3f('0x13'),function(_0x181018){var _0x364d24=new Buffer(_0x4655ac['update'](_0x181018),_0x2e3f('0x14'));_0x5996e9[_0x2e3f('0x15')](_0x364d24);});_0x2aace3['on'](_0x2e3f('0x16'),function(){try{var _0x319e66=new Buffer(_0x4655ac[_0x2e3f('0x17')](_0x2e3f('0x14')),'binary');_0x5996e9[_0x2e3f('0x15')](_0x319e66);_0x5996e9['end']();_0x5996e9['on'](_0x2e3f('0x18'),function(){return _0x1cf84a(_0x18b77d);});}catch(_0x1af0ad){fs['unlink'](_0x18b77d);return _0x5bcb22(_0x1af0ad);}});});};exports['decryptFile']=function(_0x415097,_0x39153a,_0x3a2265,_0x44befe){return new BPromise(function(_0x17b033,_0x4f1bee){_0x44befe=combineOptions(_0x44befe);var _0x301daa=new Buffer(_0x3a2265);var _0x311336=fs[_0x2e3f('0x19')](_0x415097);var _0x2265cb=fs['createWriteStream'](_0x39153a);var _0x4c6c44=crypto['createDecipher'](_0x44befe['algorithm'],_0x301daa);_0x311336['on']('data',function(_0x268daf){var _0x1e9745=new Buffer(_0x4c6c44[_0x2e3f('0x1a')](_0x268daf),'binary');_0x2265cb[_0x2e3f('0x15')](_0x1e9745);});_0x311336['on'](_0x2e3f('0x16'),function(){try{var _0x53eedd=new Buffer(_0x4c6c44['final'](_0x2e3f('0x14')),'binary');_0x2265cb[_0x2e3f('0x15')](_0x53eedd);_0x2265cb['end']();_0x2265cb['on'](_0x2e3f('0x18'),function(){return _0x17b033(_0x39153a);});}catch(_0x28c839){fs[_0x2e3f('0x1b')](_0x39153a);return _0x4f1bee(_0x28c839);}});});};exports[_0x2e3f('0x1c')]=function(_0x251f17,_0x5e6195,_0x497d6c){var _0x194627=_0x497d6c||stringOptions[_0x2e3f('0xa')];var _0x1e8dd9=_0x5e6195||stringOptions[_0x2e3f('0x1d')];var _0x270d48=crypto[_0x2e3f('0x12')](_0x194627,_0x1e8dd9);var _0x23c797=_0x270d48[_0x2e3f('0x1a')](_0x251f17,'utf8',_0x2e3f('0x1e'));_0x23c797+=_0x270d48[_0x2e3f('0x17')](_0x2e3f('0x1e'));return _0x23c797;};exports[_0x2e3f('0x1f')]=function(_0x551dbe,_0x1314ac,_0x1427e9){var _0x295e5e=_0x1427e9||stringOptions[_0x2e3f('0xa')];var _0x2814aa=_0x1314ac||stringOptions[_0x2e3f('0x1d')];var _0x49634d=crypto[_0x2e3f('0x20')](_0x295e5e,_0x2814aa);var _0x56a7d0=_0x49634d[_0x2e3f('0x1a')](_0x551dbe,_0x2e3f('0x1e'),_0x2e3f('0x21'));_0x56a7d0+=_0x49634d[_0x2e3f('0x17')](_0x2e3f('0x21'));return _0x56a7d0;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index cf568d2..4c6511b 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 _0x3989=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','Empty','length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.csv','split','existsSync','join','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','format'];(function(_0x58b5a4,_0x4e9b18){var _0xf0e052=function(_0x235ef9){while(--_0x235ef9){_0x58b5a4['push'](_0x58b5a4['shift']());}};_0xf0e052(++_0x4e9b18);}(_0x3989,0x183));var _0x9398=function(_0x4a6a3c,_0x5c4a95){_0x4a6a3c=_0x4a6a3c-0x0;var _0x24c178=_0x3989[_0x4a6a3c];return _0x24c178;};'use strict';var util=require(_0x9398('0x0'));var path=require('path');var _=require('lodash');var csv=require(_0x9398('0x1'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x9398('0x2'));var rimraf=require(_0x9398('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x9398('0x4'))[_0x9398('0x5')];var logger=require(_0x9398('0x6'))(_0x9398('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x9398('0x8')][0x2]);var QUERY=process[_0x9398('0x8')][0x3];var PATH=process[_0x9398('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x36cd34,_0x556993){var _0x533fc6={'status':_0x36cd34};var _0x244924={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x556993){_0x533fc6[_0x9398('0x9')]=_0x556993;}return db[_0x9398('0xa')][_0x9398('0xb')](_0x533fc6,_0x244924);}function main(){var _0x416347=0x1388;var _0x5ef16c;logger['info'](util[_0x9398('0xc')](_0x9398('0xd'),EXTRACTED_REPORT_ID,_0x9398('0xe')));return db[_0x9398('0xf')][_0x9398('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x9398('0x11')]})[_0x9398('0x12')](function(_0x4b3b86){if(_0x4b3b86){_0x5ef16c=_0x4b3b86;_0x416347=_0x5ef16c[_0x9398('0x11')]||0x1388;}})[_0x9398('0x12')](function(){return dbH['sequelize'][_0x9398('0x13')](util[_0x9398('0xc')](_0x9398('0x14'),QUERY),{'type':dbH[_0x9398('0x15')][_0x9398('0x16')][_0x9398('0x17')]});})[_0x9398('0x12')](function(_0x54b4c9){if(!_0x54b4c9[0x0]['num']){return analyticExtractedReport(_0x9398('0x18'));}var _0x1bf6ea=[];var _0x49e91d=0x0;if(_0x5ef16c['split']){if(_0x54b4c9&&_0x54b4c9[_0x9398('0x19')]){var _0x2aa2a=_[_0x9398('0x1a')](_0x54b4c9[0x0][_0x9398('0x1b')]/_0x416347);var _0x1206a7=Number[_0x9398('0x1c')](_0x54b4c9[0x0]['num']/_0x416347)?_0x54b4c9[0x0]['num']%_0x416347:0x0;_0x2aa2a[_0x9398('0x1d')](function(_0x4fd0b5){if(_0x4fd0b5>0x0){_0x49e91d+=_0x416347;}_0x1bf6ea[_0x9398('0x1e')](dbH[_0x9398('0x15')][_0x9398('0x13')](util[_0x9398('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x416347,_0x49e91d),{'type':dbH[_0x9398('0x15')]['QueryTypes'][_0x9398('0x17')]}));});if(_0x1206a7>0x0){_0x49e91d+=_0x416347;_0x1bf6ea[_0x9398('0x1e')](dbH[_0x9398('0x15')][_0x9398('0x13')](util[_0x9398('0xc')](_0x9398('0x1f'),QUERY,_0x1206a7,_0x49e91d),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x1bf6ea[_0x9398('0x1e')](dbH[_0x9398('0x15')]['query'](QUERY,{'type':dbH[_0x9398('0x15')][_0x9398('0x16')][_0x9398('0x17')]}));}var _0x42228b=path[_0x9398('0x20')](PATH);var _0x110b27=path['basename'](PATH,_0x9398('0x21'));var _0x3aaf9d=_0x5ef16c[_0x9398('0x22')]&&_0x1bf6ea['length']>0x1;var _0x3fd67c=[];if(!fs[_0x9398('0x23')](path['join'](_0x42228b,_0x110b27))&&_0x3aaf9d){fs['mkdirSync'](path[_0x9398('0x24')](_0x42228b,_0x110b27));}return BPromise['each'](_0x1bf6ea,function(_0x19e6a7){_0x3fd67c['push'](_0x19e6a7);})['then'](function(){for(var _0x873381=0x0;_0x873381<_0x3fd67c[_0x9398('0x19')];_0x873381+=0x1){var _0x359b58;var _0x265a9a=_0x3fd67c[_0x873381];if(_0x3aaf9d){_0x359b58=path[_0x9398('0x24')](_0x42228b,_0x110b27,util[_0x9398('0xc')](_0x9398('0x25'),_0x110b27,_0x873381,_0x9398('0x26')));}else{_0x359b58=path[_0x9398('0x24')](_0x42228b,util[_0x9398('0xc')]('%s.%s',_0x110b27,_0x9398('0x26')));}fs[_0x9398('0x27')](_0x359b58,csv(_0x265a9a));}})[_0x9398('0x12')](function(){if(_0x3aaf9d){return new Promise(function(_0x3da284){zipdir(path['join'](_0x42228b,_0x110b27),{'saveTo':path[_0x9398('0x24')](_0x42228b,util['format'](_0x9398('0x28'),_0x110b27,_0x9398('0x29')))},function(_0x46f9d5,_0x485da8){rimraf(path[_0x9398('0x24')](_0x42228b,_0x110b27),function(){});_0x3da284(_0x9398('0x2a'));});});}})[_0x9398('0x12')](function(){logger[_0x9398('0x2b')](util[_0x9398('0xc')](_0x9398('0x2c'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x9398('0x2d'),_0x3aaf9d?util['format'](_0x9398('0x28'),_0x110b27,_0x3aaf9d?_0x9398('0x29'):_0x9398('0x26')):null);});})['catch'](function(_0x21871f){logger[_0x9398('0x2b')](util['format'](_0x9398('0x2e'),EXTRACTED_REPORT_ID,_0x9398('0xe')),util[_0x9398('0x2f')](_0x21871f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9398('0x30'));})[_0x9398('0x31')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6e7d=['savename','AnalyticExtractedReport','update','info','format','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv','existsSync','each','join','%s%d.%s','csv','writeFileSync','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','rimraf','../../mysqldb','dbH','analytics','argv'];(function(_0x21ce77,_0x1d9229){var _0x49f171=function(_0x49f224){while(--_0x49f224){_0x21ce77['push'](_0x21ce77['shift']());}};_0x49f171(++_0x1d9229);}(_0x6e7d,0xed));var _0xd6e7=function(_0x218036,_0x810206){_0x218036=_0x218036-0x0;var _0x410dc5=_0x6e7d[_0x218036];return _0x410dc5;};'use strict';var util=require(_0xd6e7('0x0'));var path=require(_0xd6e7('0x1'));var _=require(_0xd6e7('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require(_0xd6e7('0x3'));var db=require(_0xd6e7('0x4'))['db'];var dbH=require(_0xd6e7('0x4'))[_0xd6e7('0x5')];var logger=require('../../config/logger')(_0xd6e7('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xd6e7('0x7')][0x2]);var QUERY=process[_0xd6e7('0x7')][0x3];var PATH=process[_0xd6e7('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x39faae,_0x91ec4e){var _0x5d93b2={'status':_0x39faae};var _0x244f34={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x91ec4e){_0x5d93b2[_0xd6e7('0x8')]=_0x91ec4e;}return db[_0xd6e7('0x9')][_0xd6e7('0xa')](_0x5d93b2,_0x244f34);}function main(){var _0x4dbfc4=0x1388;var _0x566e29;logger[_0xd6e7('0xb')](util[_0xd6e7('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xd6e7('0xd')][_0xd6e7('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd6e7('0xf'),_0xd6e7('0x10')]})['then'](function(_0x5b7a3e){if(_0x5b7a3e){_0x566e29=_0x5b7a3e;_0x4dbfc4=_0x566e29[_0xd6e7('0x10')]||0x1388;}})[_0xd6e7('0x11')](function(){return dbH[_0xd6e7('0x12')]['query'](util['format'](_0xd6e7('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xd6e7('0x14')]});})['then'](function(_0x2ca9e2){if(!_0x2ca9e2[0x0][_0xd6e7('0x15')]){return analyticExtractedReport(_0xd6e7('0x16'));}var _0x254776=[];var _0x416e2c=0x0;if(_0x566e29[_0xd6e7('0xf')]){if(_0x2ca9e2&&_0x2ca9e2[_0xd6e7('0x17')]){var _0x13e0bc=_[_0xd6e7('0x18')](_0x2ca9e2[0x0][_0xd6e7('0x15')]/_0x4dbfc4);var _0x369fbc=Number[_0xd6e7('0x19')](_0x2ca9e2[0x0][_0xd6e7('0x15')]/_0x4dbfc4)?_0x2ca9e2[0x0][_0xd6e7('0x15')]%_0x4dbfc4:0x0;_0x13e0bc[_0xd6e7('0x1a')](function(_0x113439){if(_0x113439>0x0){_0x416e2c+=_0x4dbfc4;}_0x254776[_0xd6e7('0x1b')](dbH[_0xd6e7('0x12')][_0xd6e7('0x1c')](util[_0xd6e7('0xc')](_0xd6e7('0x1d'),QUERY,_0x4dbfc4,_0x416e2c),{'type':dbH[_0xd6e7('0x12')][_0xd6e7('0x1e')]['SELECT']}));});if(_0x369fbc>0x0){_0x416e2c+=_0x4dbfc4;_0x254776[_0xd6e7('0x1b')](dbH[_0xd6e7('0x12')][_0xd6e7('0x1c')](util[_0xd6e7('0xc')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x369fbc,_0x416e2c),{'type':dbH['sequelize']['QueryTypes'][_0xd6e7('0x14')]}));}}}else{_0x254776[_0xd6e7('0x1b')](dbH[_0xd6e7('0x12')][_0xd6e7('0x1c')](QUERY,{'type':dbH['sequelize'][_0xd6e7('0x1e')][_0xd6e7('0x14')]}));}var _0x42ba82=path['dirname'](PATH);var _0x5b04ba=path[_0xd6e7('0x1f')](PATH,_0xd6e7('0x20'));var _0x19b983=_0x566e29[_0xd6e7('0xf')]&&_0x254776['length']>0x1;var _0x309f3b=[];if(!fs[_0xd6e7('0x21')](path['join'](_0x42ba82,_0x5b04ba))&&_0x19b983){fs['mkdirSync'](path['join'](_0x42ba82,_0x5b04ba));}return BPromise[_0xd6e7('0x22')](_0x254776,function(_0x150d88){_0x309f3b[_0xd6e7('0x1b')](_0x150d88);})['then'](function(){for(var _0x5062b0=0x0;_0x5062b0<_0x309f3b[_0xd6e7('0x17')];_0x5062b0+=0x1){var _0x2aa775;var _0x5c700c=_0x309f3b[_0x5062b0];if(_0x19b983){_0x2aa775=path[_0xd6e7('0x23')](_0x42ba82,_0x5b04ba,util['format'](_0xd6e7('0x24'),_0x5b04ba,_0x5062b0,'csv'));}else{_0x2aa775=path[_0xd6e7('0x23')](_0x42ba82,util['format']('%s.%s',_0x5b04ba,_0xd6e7('0x25')));}fs[_0xd6e7('0x26')](_0x2aa775,csv(_0x5c700c));}})[_0xd6e7('0x11')](function(){if(_0x19b983){return new Promise(function(_0x43ce5f){zipdir(path[_0xd6e7('0x23')](_0x42ba82,_0x5b04ba),{'saveTo':path[_0xd6e7('0x23')](_0x42ba82,util['format'](_0xd6e7('0x27'),_0x5b04ba,_0xd6e7('0x28')))},function(_0x529b12,_0x450466){rimraf(path[_0xd6e7('0x23')](_0x42ba82,_0x5b04ba),function(){});_0x43ce5f(_0xd6e7('0x29'));});});}})[_0xd6e7('0x11')](function(){logger[_0xd6e7('0xb')](util[_0xd6e7('0xc')](_0xd6e7('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x19b983?util[_0xd6e7('0xc')](_0xd6e7('0x27'),_0x5b04ba,_0x19b983?_0xd6e7('0x28'):'csv'):null);});})[_0xd6e7('0x2b')](function(_0x4b94fd){logger[_0xd6e7('0xb')](util['format'](_0xd6e7('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util[_0xd6e7('0x2d')](_0x4b94fd,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd6e7('0x2e'));})[_0xd6e7('0x2f')](function(){process[_0xd6e7('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 1b05c55..640712f 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 _0xa08e=['concat','chunk','keys','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','format','margin','landscape','footer','black','right','num','Empty','Setting','split','splitSizePdf','then','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','flatten','%s%d.%s','%s.%s','pdf','all','zip\x20finished','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','inspect','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','path','moment','pdfmake/src/printer','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','tableHeader','map','toString','value','fill','length','body','push'];(function(_0x2c117f,_0x263c41){var _0x1e0726=function(_0x231b37){while(--_0x231b37){_0x2c117f['push'](_0x2c117f['shift']());}};_0x1e0726(++_0x263c41);}(_0xa08e,0xf7));var _0xea08=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0xa08e[_0x366388];return _0x41c97e;};'use strict';var _=require(_0xea08('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xea08('0x1'));var moment=require(_0xea08('0x2'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xea08('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xea08('0x4'));var JSDOM=require(_0xea08('0x5'))[_0xea08('0x6')];var window=new JSDOM('')[_0xea08('0x7')];var BPromise=require(_0xea08('0x8'));var db=require(_0xea08('0x9'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xea08('0xa'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xea08('0xb')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xea08('0xb')][0x5];var FORMAT=_0xea08('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x581045,_0x5b6b70){var _0x5b968d={'status':_0x581045};var _0x52811d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5b6b70){_0x5b968d['savename']=_0x5b6b70;}return db[_0xea08('0xd')][_0xea08('0xe')](_0x5b968d,_0x52811d);}function getHeaders(_0x52adc1){return _['map'](_0x52adc1,function(_0x37ce41){return{'text':_0x37ce41,'style':_0xea08('0xf')};});}function getRows(_0x19b404,_0x2281b4){return _[_0xea08('0x10')](_0x2281b4,function(_0x3a1259){return _(_0x3a1259)['pick'](_0x19b404)['map'](function(_0x4c11d4){return _0x4c11d4?_[_0xea08('0x11')](_0x4c11d4):'';})[_0xea08('0x12')]();});}function createTable(_0x2eaa74,_0x317138){var _0x1e729e={'widths':_[_0xea08('0x13')](Array(_0x2eaa74[_0xea08('0x14')]),0x91),'heights':function(_0x3ee198){return _0x3ee198===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5ac63f=getHeaders(_0x2eaa74);_0x1e729e[_0xea08('0x15')][_0xea08('0x16')](_0x5ac63f);var _0x49754a=getRows(_0x2eaa74,_0x317138);_0x1e729e[_0xea08('0x15')]=_0x1e729e['body'][_0xea08('0x17')](_0x49754a);return _0x1e729e;}function createTables(_0x4f71d1){var _0x458107=[];var _0x163e1d=_[_0xea08('0x18')](Object[_0xea08('0x19')](_0x4f71d1[0x0]),0x5);_0x163e1d['forEach'](function(_0x1c54bb){_0x458107[_0xea08('0x16')](createTable(_0x1c54bb,_0x4f71d1));});return _0x458107;}function getPDFDocDefinition(_0xa969b6){var _0x2d1c1a=util['format'](_0xea08('0x1a'),NAME,EXTRACTED_REPORT[_0xea08('0x1b')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xea08('0x1c')])[_0xea08('0x1d')](FORMAT));var _0x16f510=[];for(var _0x34e32b=0x0;_0x34e32b<_0xa969b6[_0xea08('0x14')];_0x34e32b++){var _0x12525a=[];if(_0x34e32b===0x0){_0x12525a[_0xea08('0x16')]({'text':_0x2d1c1a,'style':'header'});}var _0x179c8e={'table':_0xa969b6[_0x34e32b]};if(_0x34e32b>0x0){_0x179c8e['pageBreak']='before';_0x179c8e[_0xea08('0x1e')]=[0x0,0x46,0x0,0x0];}_0x12525a[_0xea08('0x16')](_0x179c8e);_0x16f510[_0xea08('0x16')](_0x12525a);}return{'pageSize':'A4','pageOrientation':_0xea08('0x1f'),'content':_0x16f510,'footer':function(_0x373be9,_0x29c5ff){return{'text':_0x373be9[_0xea08('0x11')]()+'\x20/\x20'+_0x29c5ff,'style':_0xea08('0x20')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xea08('0x21')},'footer':{'alignment':_0xea08('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x229817){var _0xe09b38=0x1388;var _0x92d5c2;if(!_0x229817[0x0][_0xea08('0x23')]){return analyticExtractedReport(_0xea08('0x24'));}return db[_0xea08('0x25')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xea08('0x26'),_0xea08('0x27')]})[_0xea08('0x28')](function(_0x30caed){if(_0x30caed){_0x92d5c2=_0x30caed;_0xe09b38=_0x92d5c2['splitSizePdf']||0x3e8;}})['then'](function(){var _0x2723a4=[];var _0x383f30=0x0;if(_0x92d5c2[_0xea08('0x26')]){if(_0x229817&&_0x229817[_0xea08('0x14')]){var _0x4f1f22=_['range'](_0x229817[0x0][_0xea08('0x23')]/_0xe09b38);var _0x48e2e5=Number[_0xea08('0x29')](_0x229817[0x0][_0xea08('0x23')]/_0xe09b38)?_0x229817[0x0][_0xea08('0x23')]%_0xe09b38:0x0;_0x4f1f22[_0xea08('0x2a')](function(_0x13d664){if(_0x13d664>0x0){_0x383f30+=_0xe09b38;}_0x2723a4[_0xea08('0x16')](dbH[_0xea08('0x2b')][_0xea08('0x2c')](util[_0xea08('0x1d')](_0xea08('0x2d'),QUERY,_0xe09b38,_0x383f30),{'type':dbH[_0xea08('0x2b')][_0xea08('0x2e')]['SELECT']}));});if(_0x48e2e5>0x0){_0x383f30+=_0xe09b38;_0x2723a4[_0xea08('0x16')](dbH['sequelize']['query'](util[_0xea08('0x1d')](_0xea08('0x2d'),QUERY,_0x48e2e5,_0x383f30),{'type':dbH[_0xea08('0x2b')][_0xea08('0x2e')]['SELECT']}));}}}else{_0x2723a4[_0xea08('0x16')](dbH[_0xea08('0x2b')]['query'](QUERY,{'type':dbH['sequelize'][_0xea08('0x2e')][_0xea08('0x2f')]}));}var _0x4e5cbc=path[_0xea08('0x30')](PATH);var _0x1a7aab=path[_0xea08('0x31')](PATH,_0xea08('0x32'));var _0xe84a72=_0x92d5c2['split']&&_0x2723a4['length']>0x1;var _0x1b10da=[];if(!fs[_0xea08('0x33')](path[_0xea08('0x34')](_0x4e5cbc,_0x1a7aab))&&_0xe84a72){fs[_0xea08('0x35')](path[_0xea08('0x34')](_0x4e5cbc,_0x1a7aab));}return BPromise['each'](_0x2723a4,function(_0x127d80){_0x1b10da[_0xea08('0x16')](_0x127d80);})[_0xea08('0x28')](function(){var _0x195bc9=[];for(var _0x1ea6bb=0x0;_0x1ea6bb<_0x1b10da[_0xea08('0x14')];_0x1ea6bb+=0x1){var _0x49f98b=_0x1b10da[_0x1ea6bb];var _0x507d75=createTables(_[_0xea08('0x36')](_0x49f98b));var _0x4e8189;var _0x1fc97e=getPDFDocDefinition(_0x507d75);var _0x1475a9=getPDFPrinter();var _0x991539=_0x1475a9['createPdfKitDocument'](_0x1fc97e);if(_0xe84a72){_0x4e8189=path['join'](_0x4e5cbc,_0x1a7aab,util[_0xea08('0x1d')](_0xea08('0x37'),_0x1a7aab,_0x1ea6bb,'pdf'));}else{_0x4e8189=path[_0xea08('0x34')](_0x4e5cbc,util[_0xea08('0x1d')](_0xea08('0x38'),_0x1a7aab,_0xea08('0x39')));}_0x195bc9[_0xea08('0x16')](writePDFDocument(_0x991539,_0x4e8189));}return Promise[_0xea08('0x3a')](_0x195bc9);})['then'](function(){if(_0xe84a72){return new Promise(function(_0x1e504d){zipdir(path[_0xea08('0x34')](_0x4e5cbc,_0x1a7aab),{'saveTo':path[_0xea08('0x34')](_0x4e5cbc,util[_0xea08('0x1d')]('%s.%s',_0x1a7aab,'zip'))},function(){rimraf(path[_0xea08('0x34')](_0x4e5cbc,_0x1a7aab),function(){});_0x1e504d(_0xea08('0x3b'));});});}})[_0xea08('0x28')](function(){if(!_0xe84a72)return;rimraf(path[_0xea08('0x34')](_0x4e5cbc,_0x1a7aab),function(){});})[_0xea08('0x28')](function(){logger[_0xea08('0x3c')](util['format'](_0xea08('0x3d'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xea08('0x3e'),_0xe84a72?util[_0xea08('0x1d')](_0xea08('0x38'),_0x1a7aab,_0xe84a72?'zip':_0xea08('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xea08('0x3c')](util[_0xea08('0x1d')](_0xea08('0x3f'),EXTRACTED_REPORT_ID,_0xea08('0x40')));return db[_0xea08('0xd')][_0xea08('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x17ac9e){EXTRACTED_REPORT=_0x17ac9e;return dbH[_0xea08('0x2b')][_0xea08('0x2c')](util[_0xea08('0x1d')](_0xea08('0x42'),QUERY),{'type':dbH['sequelize'][_0xea08('0x2e')][_0xea08('0x2f')]});})[_0xea08('0x28')](extractReport)[_0xea08('0x43')](function(_0x34be00){logger[_0xea08('0x3c')](util['format'](_0xea08('0x44'),EXTRACTED_REPORT_ID,_0xea08('0x40')),util[_0xea08('0x45')](_0x34be00,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xea08('0x46')](function(){process[_0xea08('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x52ba0f=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xea08('0x48'),'italics':__dirname+_0xea08('0x49'),'bolditalics':__dirname+_0xea08('0x4a')}});return _0x52ba0f;}function getPDFDocDefinitionFromHTML(_0x3045b8,_0x25f65e){var _0x2e4ed8=util['format'](_0xea08('0x4b'),_0x25f65e[_0xea08('0x4c')],_0x25f65e[_0xea08('0x4d')]);var _0x320e3c=moment()[_0xea08('0x1d')](_0xea08('0x4e'))['toString']();var _0x598d0b=htmlToPdfmake(_0x3045b8,{'window':window,'tableAutoSize':!![]});return{'content':[_0x598d0b],'defaultStyle':{'font':_0xea08('0x4f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xea08('0x50'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xea08('0x50'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xea08('0x50')}},'header':function(){return[{'text':_0xea08('0x51'),'style':'header'}];},'footer':function(_0x4ca52d,_0x10d149){return[{'text':util['format'](_0xea08('0x52'),_0x2e4ed8,_0x4ca52d,_0x10d149,_0x320e3c),'style':_0xea08('0x20')}];}};}function writePDFDocument(_0xd5ed42,_0x3ed3ae){return new Promise(function(_0x3f762d,_0xc13647){var _0x28ef65=_0xd5ed42[_0xea08('0x53')](fs[_0xea08('0x54')](_0x3ed3ae));_0x28ef65['on']('finish',function(){_0x3f762d(_0xea08('0x55'));});_0x28ef65['on'](_0xea08('0x56'),function(_0x509a25){_0xc13647(_0x509a25);});_0xd5ed42[_0xea08('0x57')]();});}exports[_0xea08('0x58')]=function(_0x46e45d,_0x5d6fa5){var _0x30ad66=getPDFPrinter();var _0x43409d=getPDFDocDefinitionFromHTML(_0x46e45d,_0x5d6fa5);var _0x23a38a=_0x30ad66[_0xea08('0x59')](_0x43409d);return writePDFDocument(_0x23a38a,_0x5d6fa5['path'])['catch'](function(_0x32ada4){throw _0x32ada4;});}; \ No newline at end of file +var _0xf532=['basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','Arial','center','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','tableHeader','pick','toString','value','fill','length','body','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','before','margin','landscape','footer','black','num','Empty','Setting','split','splitSizePdf','then','sequelize','query','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes'];(function(_0x50702f,_0x4f509a){var _0x38cc6a=function(_0x36e905){while(--_0x36e905){_0x50702f['push'](_0x50702f['shift']());}};_0x38cc6a(++_0x4f509a);}(_0xf532,0x186));var _0x2f53=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0xf532[_0x202c61];return _0x540691;};'use strict';var _=require(_0x2f53('0x0'));var fs=require('fs');var util=require('util');var path=require(_0x2f53('0x1'));var moment=require('moment');var htmlToPdfmake=require(_0x2f53('0x2'));var PdfPrinter=require(_0x2f53('0x3'));var zipdir=require(_0x2f53('0x4'));var rimraf=require(_0x2f53('0x5'));var JSDOM=require(_0x2f53('0x6'))[_0x2f53('0x7')];var window=new JSDOM('')[_0x2f53('0x8')];var BPromise=require(_0x2f53('0x9'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2f53('0xa'))[_0x2f53('0xb')];var logger=require('../../config/logger')(_0x2f53('0xc'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2f53('0xd')][0x3];var PATH=process[_0x2f53('0xd')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x2f53('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x29b47a,_0x6533c5){var _0x49b241={'status':_0x29b47a};var _0x15923c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x6533c5){_0x49b241['savename']=_0x6533c5;}return db[_0x2f53('0xf')][_0x2f53('0x10')](_0x49b241,_0x15923c);}function getHeaders(_0x573806){return _[_0x2f53('0x11')](_0x573806,function(_0x147426){return{'text':_0x147426,'style':_0x2f53('0x12')};});}function getRows(_0x473673,_0x5cae38){return _['map'](_0x5cae38,function(_0x3e0034){return _(_0x3e0034)[_0x2f53('0x13')](_0x473673)[_0x2f53('0x11')](function(_0x159e58){return _0x159e58?_[_0x2f53('0x14')](_0x159e58):'';})[_0x2f53('0x15')]();});}function createTable(_0x5032f1,_0x407439){var _0x35bbc0={'widths':_[_0x2f53('0x16')](Array(_0x5032f1[_0x2f53('0x17')]),0x91),'heights':function(_0x5ea63b){return _0x5ea63b===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x412c1d=getHeaders(_0x5032f1);_0x35bbc0[_0x2f53('0x18')][_0x2f53('0x19')](_0x412c1d);var _0x3c4026=getRows(_0x5032f1,_0x407439);_0x35bbc0[_0x2f53('0x18')]=_0x35bbc0['body'][_0x2f53('0x1a')](_0x3c4026);return _0x35bbc0;}function createTables(_0x325926){var _0xa6666d=[];var _0x115934=_['chunk'](Object[_0x2f53('0x1b')](_0x325926[0x0]),0x5);_0x115934[_0x2f53('0x1c')](function(_0x37fe18){_0xa6666d[_0x2f53('0x19')](createTable(_0x37fe18,_0x325926));});return _0xa6666d;}function getPDFDocDefinition(_0x2b25e7){var _0x23e712=util[_0x2f53('0x1d')](_0x2f53('0x1e'),NAME,EXTRACTED_REPORT[_0x2f53('0x1f')],moment(EXTRACTED_REPORT['startDate'])[_0x2f53('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x2f53('0x20')])[_0x2f53('0x1d')](FORMAT));var _0x561b1d=[];for(var _0x1ba1a6=0x0;_0x1ba1a6<_0x2b25e7['length'];_0x1ba1a6++){var _0x581c03=[];if(_0x1ba1a6===0x0){_0x581c03[_0x2f53('0x19')]({'text':_0x23e712,'style':_0x2f53('0x21')});}var _0x48c7e7={'table':_0x2b25e7[_0x1ba1a6]};if(_0x1ba1a6>0x0){_0x48c7e7['pageBreak']=_0x2f53('0x22');_0x48c7e7[_0x2f53('0x23')]=[0x0,0x46,0x0,0x0];}_0x581c03['push'](_0x48c7e7);_0x561b1d[_0x2f53('0x19')](_0x581c03);}return{'pageSize':'A4','pageOrientation':_0x2f53('0x24'),'content':_0x561b1d,'footer':function(_0x3d6214,_0x2b9724){return{'text':_0x3d6214[_0x2f53('0x14')]()+'\x20/\x20'+_0x2b9724,'style':_0x2f53('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x2f53('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x28abd4){var _0xe38170=0x1388;var _0x4176f0;if(!_0x28abd4[0x0][_0x2f53('0x27')]){return analyticExtractedReport(_0x2f53('0x28'));}return db[_0x2f53('0x29')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2f53('0x2a'),_0x2f53('0x2b')]})[_0x2f53('0x2c')](function(_0x2a610c){if(_0x2a610c){_0x4176f0=_0x2a610c;_0xe38170=_0x4176f0[_0x2f53('0x2b')]||0x3e8;}})['then'](function(){var _0x5c8b19=[];var _0x47b960=0x0;if(_0x4176f0['split']){if(_0x28abd4&&_0x28abd4[_0x2f53('0x17')]){var _0x5096af=_['range'](_0x28abd4[0x0][_0x2f53('0x27')]/_0xe38170);var _0x28544a=Number['isInteger'](_0x28abd4[0x0][_0x2f53('0x27')]/_0xe38170)?_0x28abd4[0x0][_0x2f53('0x27')]%_0xe38170:0x0;_0x5096af[_0x2f53('0x1c')](function(_0x11f08d){if(_0x11f08d>0x0){_0x47b960+=_0xe38170;}_0x5c8b19[_0x2f53('0x19')](dbH[_0x2f53('0x2d')][_0x2f53('0x2e')](util[_0x2f53('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0xe38170,_0x47b960),{'type':dbH[_0x2f53('0x2d')]['QueryTypes'][_0x2f53('0x2f')]}));});if(_0x28544a>0x0){_0x47b960+=_0xe38170;_0x5c8b19[_0x2f53('0x19')](dbH[_0x2f53('0x2d')][_0x2f53('0x2e')](util[_0x2f53('0x1d')](_0x2f53('0x30'),QUERY,_0x28544a,_0x47b960),{'type':dbH['sequelize'][_0x2f53('0x31')][_0x2f53('0x2f')]}));}}}else{_0x5c8b19[_0x2f53('0x19')](dbH['sequelize'][_0x2f53('0x2e')](QUERY,{'type':dbH[_0x2f53('0x2d')][_0x2f53('0x31')][_0x2f53('0x2f')]}));}var _0x4dc2f6=path['dirname'](PATH);var _0x3c9f66=path[_0x2f53('0x32')](PATH,_0x2f53('0x33'));var _0x2995c8=_0x4176f0['split']&&_0x5c8b19['length']>0x1;var _0x4a93b5=[];if(!fs[_0x2f53('0x34')](path['join'](_0x4dc2f6,_0x3c9f66))&&_0x2995c8){fs[_0x2f53('0x35')](path[_0x2f53('0x36')](_0x4dc2f6,_0x3c9f66));}return BPromise[_0x2f53('0x37')](_0x5c8b19,function(_0x507257){_0x4a93b5[_0x2f53('0x19')](_0x507257);})['then'](function(){var _0x534a29=[];for(var _0x2d3f10=0x0;_0x2d3f10<_0x4a93b5['length'];_0x2d3f10+=0x1){var _0x195236=_0x4a93b5[_0x2d3f10];var _0x224750=createTables(_[_0x2f53('0x38')](_0x195236));var _0x453c3c;var _0x4c82c2=getPDFDocDefinition(_0x224750);var _0x1749ee=getPDFPrinter();var _0x3563cb=_0x1749ee[_0x2f53('0x39')](_0x4c82c2);if(_0x2995c8){_0x453c3c=path[_0x2f53('0x36')](_0x4dc2f6,_0x3c9f66,util[_0x2f53('0x1d')]('%s%d.%s',_0x3c9f66,_0x2d3f10,_0x2f53('0x3a')));}else{_0x453c3c=path[_0x2f53('0x36')](_0x4dc2f6,util[_0x2f53('0x1d')](_0x2f53('0x3b'),_0x3c9f66,_0x2f53('0x3a')));}_0x534a29['push'](writePDFDocument(_0x3563cb,_0x453c3c));}return Promise[_0x2f53('0x3c')](_0x534a29);})['then'](function(){if(_0x2995c8){return new Promise(function(_0x2bffed){zipdir(path['join'](_0x4dc2f6,_0x3c9f66),{'saveTo':path[_0x2f53('0x36')](_0x4dc2f6,util[_0x2f53('0x1d')]('%s.%s',_0x3c9f66,_0x2f53('0x3d')))},function(){rimraf(path['join'](_0x4dc2f6,_0x3c9f66),function(){});_0x2bffed(_0x2f53('0x3e'));});});}})['then'](function(){if(!_0x2995c8)return;rimraf(path[_0x2f53('0x36')](_0x4dc2f6,_0x3c9f66),function(){});})['then'](function(){logger[_0x2f53('0x3f')](util[_0x2f53('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x2f53('0x40')));return analyticExtractedReport(_0x2f53('0x41'),_0x2995c8?util[_0x2f53('0x1d')](_0x2f53('0x3b'),_0x3c9f66,_0x2995c8?_0x2f53('0x3d'):_0x2f53('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x2f53('0x3f')](util['format'](_0x2f53('0x42'),EXTRACTED_REPORT_ID,_0x2f53('0x40')));return db[_0x2f53('0xf')][_0x2f53('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x2f53('0x2c')](function(_0x181ba9){EXTRACTED_REPORT=_0x181ba9;return dbH['sequelize'][_0x2f53('0x2e')](util[_0x2f53('0x1d')](_0x2f53('0x44'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x2f53('0x2c')](extractReport)[_0x2f53('0x45')](function(_0x5d3980){logger[_0x2f53('0x3f')](util['format'](_0x2f53('0x46'),EXTRACTED_REPORT_ID,_0x2f53('0x40')),util[_0x2f53('0x47')](_0x5d3980,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2f53('0x48'));})[_0x2f53('0x49')](function(){process[_0x2f53('0x4a')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x413efc=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x2f53('0x4b'),'bolditalics':__dirname+_0x2f53('0x4c')}});return _0x413efc;}function getPDFDocDefinitionFromHTML(_0x5b0a85,_0x5806c4){var _0x27a120=util[_0x2f53('0x1d')](_0x2f53('0x4d'),_0x5806c4[_0x2f53('0x4e')],_0x5806c4[_0x2f53('0x4f')]);var _0x1c2835=moment()[_0x2f53('0x1d')]('YYYY-MM-DD')['toString']();var _0x3e6e52=htmlToPdfmake(_0x5b0a85,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3e6e52],'defaultStyle':{'font':_0x2f53('0x50')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x2f53('0x51'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':'header'}];},'footer':function(_0x24c225,_0x543c88){return[{'text':util['format']('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x27a120,_0x24c225,_0x543c88,_0x1c2835),'style':'footer'}];}};}function writePDFDocument(_0x3a02ae,_0x47b985){return new Promise(function(_0x4a9a70,_0x42ca6d){var _0x3fd6a0=_0x3a02ae[_0x2f53('0x52')](fs[_0x2f53('0x53')](_0x47b985));_0x3fd6a0['on'](_0x2f53('0x54'),function(){_0x4a9a70('finish');});_0x3fd6a0['on'](_0x2f53('0x55'),function(_0x2053cb){_0x42ca6d(_0x2053cb);});_0x3a02ae[_0x2f53('0x56')]();});}exports[_0x2f53('0x57')]=function(_0x5a225f,_0x3acda9){var _0x11bd4a=getPDFPrinter();var _0x4132ce=getPDFDocDefinitionFromHTML(_0x5a225f,_0x3acda9);var _0x48bac5=_0x11bd4a[_0x2f53('0x39')](_0x4132ce);return writePDFDocument(_0x48bac5,_0x3acda9['path'])['catch'](function(_0x307545){throw _0x307545;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 9a80e50..8c0ce76 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 _0x7916=['XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT','num','length','range','isInteger','forEach','push','QueryTypes','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','existsSync','join','%s%d.%s','xlsx','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','lodash','json2xls','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','update','info','format'];(function(_0x2d78b7,_0x5523f3){var _0x757b57=function(_0x3065b2){while(--_0x3065b2){_0x2d78b7['push'](_0x2d78b7['shift']());}};_0x757b57(++_0x5523f3);}(_0x7916,0x128));var _0x6791=function(_0x2a314d,_0xb3d629){_0x2a314d=_0x2a314d-0x0;var _0x3d3e20=_0x7916[_0x2a314d];return _0x3d3e20;};'use strict';var util=require(_0x6791('0x0'));var path=require('path');var _=require(_0x6791('0x1'));var fs=require('fs');var json2xls=require(_0x6791('0x2'));var BPromise=require('bluebird');var zipdir=require(_0x6791('0x3'));var rimraf=require(_0x6791('0x4'));var db=require(_0x6791('0x5'))['db'];var dbH=require(_0x6791('0x5'))['dbH'];var logger=require(_0x6791('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6791('0x7')][0x2]);var QUERY=process[_0x6791('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x8b85ff,_0x5d2118){var _0x2b240c={'status':_0x8b85ff};var _0x50c563={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5d2118){_0x2b240c['savename']=_0x5d2118;}return db[_0x6791('0x8')][_0x6791('0x9')](_0x2b240c,_0x50c563);}function main(){var _0x579950=0x1388;var _0xbc3bc6;logger[_0x6791('0xa')](util[_0x6791('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6791('0xc')));return db[_0x6791('0xd')][_0x6791('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6791('0xf'),_0x6791('0x10')]})[_0x6791('0x11')](function(_0x61ac73){if(_0x61ac73){_0xbc3bc6=_0x61ac73;_0x579950=_0xbc3bc6[_0x6791('0x10')]||0x1388;}})[_0x6791('0x11')](function(){return dbH[_0x6791('0x12')][_0x6791('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6791('0x12')]['QueryTypes'][_0x6791('0x14')]});})['then'](function(_0x3be9f0){if(!_0x3be9f0[0x0][_0x6791('0x15')]){return analyticExtractedReport('Empty');}var _0x3e4792=[];var _0x4b80ed=0x0;if(_0xbc3bc6[_0x6791('0xf')]){if(_0x3be9f0&&_0x3be9f0[_0x6791('0x16')]){var _0x596a06=_[_0x6791('0x17')](_0x3be9f0[0x0][_0x6791('0x15')]/_0x579950);var _0x5bec14=Number[_0x6791('0x18')](_0x3be9f0[0x0]['num']/_0x579950)?_0x3be9f0[0x0][_0x6791('0x15')]%_0x579950:0x0;_0x596a06[_0x6791('0x19')](function(_0x669270){if(_0x669270>0x0){_0x4b80ed+=_0x579950;}_0x3e4792[_0x6791('0x1a')](dbH[_0x6791('0x12')][_0x6791('0x13')](util[_0x6791('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x579950,_0x4b80ed),{'type':dbH[_0x6791('0x12')][_0x6791('0x1b')]['SELECT']}));});if(_0x5bec14>0x0){_0x4b80ed+=_0x579950;_0x3e4792[_0x6791('0x1a')](dbH[_0x6791('0x12')]['query'](util[_0x6791('0xb')](_0x6791('0x1c'),QUERY,_0x5bec14,_0x4b80ed),{'type':dbH[_0x6791('0x12')][_0x6791('0x1b')]['SELECT']}));}}}else{_0x3e4792[_0x6791('0x1a')](dbH[_0x6791('0x12')]['query'](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x6791('0x14')]}));}var _0x502043=path[_0x6791('0x1d')](PATH);var _0x5409f1=path['basename'](PATH,'.xlsx');var _0x5cadc=_0xbc3bc6[_0x6791('0xf')]&&_0x3e4792[_0x6791('0x16')]>0x1;var _0x56a74e=[];if(!fs[_0x6791('0x1e')](path[_0x6791('0x1f')](_0x502043,_0x5409f1))&&_0x5cadc){fs['mkdirSync'](path[_0x6791('0x1f')](_0x502043,_0x5409f1));}return BPromise['each'](_0x3e4792,function(_0x424b0e){_0x56a74e['push'](_0x424b0e);})['then'](function(){for(var _0x270a1d=0x0;_0x270a1d<_0x56a74e['length'];_0x270a1d+=0x1){var _0x2f56a2;var _0x34b006=_0x56a74e[_0x270a1d];if(_0x5cadc){_0x2f56a2=path['join'](_0x502043,_0x5409f1,util[_0x6791('0xb')](_0x6791('0x20'),_0x5409f1,_0x270a1d,_0x6791('0x21')));}else{_0x2f56a2=path[_0x6791('0x1f')](_0x502043,util['format']('%s.%s',_0x5409f1,_0x6791('0x21')));}fs['writeFileSync'](_0x2f56a2,json2xls(_0x34b006),_0x6791('0x22'));}})[_0x6791('0x11')](function(){if(_0x5cadc){return new Promise(function(_0x30397e){zipdir(path[_0x6791('0x1f')](_0x502043,_0x5409f1),{'saveTo':path[_0x6791('0x1f')](_0x502043,util[_0x6791('0xb')](_0x6791('0x23'),_0x5409f1,_0x6791('0x24')))},function(_0x152751,_0x100210){rimraf(path['join'](_0x502043,_0x5409f1),function(){});_0x30397e(_0x6791('0x25'));});});}})[_0x6791('0x11')](function(){logger[_0x6791('0xa')](util[_0x6791('0xb')](_0x6791('0x26'),EXTRACTED_REPORT_ID,_0x6791('0xc')));return analyticExtractedReport('Completed',_0x5cadc?util['format']('%s.%s',_0x5409f1,_0x5cadc?_0x6791('0x24'):_0x6791('0x21')):null);});})[_0x6791('0x27')](function(_0x549636){logger['info'](util[_0x6791('0xb')](_0x6791('0x28'),EXTRACTED_REPORT_ID,_0x6791('0xc')),util[_0x6791('0x29')](_0x549636,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x6791('0x2a')](function(){process[_0x6791('0x2b')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xd9b6=['json2xls','bluebird','rimraf','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Setting','find','split','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','inspect','Failed','finally','exit','util','path','lodash'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd9b6,0x135));var _0x6d9b=function(_0x37dc1d,_0xbf91ef){_0x37dc1d=_0x37dc1d-0x0;var _0x4ac931=_0xd9b6[_0x37dc1d];return _0x4ac931;};'use strict';var util=require(_0x6d9b('0x0'));var path=require(_0x6d9b('0x1'));var _=require(_0x6d9b('0x2'));var fs=require('fs');var json2xls=require(_0x6d9b('0x3'));var BPromise=require(_0x6d9b('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x6d9b('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0x6d9b('0x6'))(_0x6d9b('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x6d9b('0x8')][0x2]);var QUERY=process[_0x6d9b('0x8')][0x3];var PATH=process[_0x6d9b('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x313b85,_0x21ab10){var _0x52b2c0={'status':_0x313b85};var _0x53b0b7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21ab10){_0x52b2c0['savename']=_0x21ab10;}return db[_0x6d9b('0x9')][_0x6d9b('0xa')](_0x52b2c0,_0x53b0b7);}function main(){var _0x2bd11f=0x1388;var _0x597cb0;logger[_0x6d9b('0xb')](util[_0x6d9b('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x6d9b('0xd')][_0x6d9b('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6d9b('0xf'),'splitSizeXlsx']})[_0x6d9b('0x10')](function(_0x486fe9){if(_0x486fe9){_0x597cb0=_0x486fe9;_0x2bd11f=_0x597cb0['splitSizeXlsx']||0x1388;}})[_0x6d9b('0x10')](function(){return dbH['sequelize'][_0x6d9b('0x11')](util[_0x6d9b('0xc')](_0x6d9b('0x12'),QUERY),{'type':dbH[_0x6d9b('0x13')]['QueryTypes'][_0x6d9b('0x14')]});})[_0x6d9b('0x10')](function(_0x2e5b38){if(!_0x2e5b38[0x0][_0x6d9b('0x15')]){return analyticExtractedReport(_0x6d9b('0x16'));}var _0x28106c=[];var _0x56556c=0x0;if(_0x597cb0[_0x6d9b('0xf')]){if(_0x2e5b38&&_0x2e5b38[_0x6d9b('0x17')]){var _0x55c482=_[_0x6d9b('0x18')](_0x2e5b38[0x0][_0x6d9b('0x15')]/_0x2bd11f);var _0x335e11=Number[_0x6d9b('0x19')](_0x2e5b38[0x0]['num']/_0x2bd11f)?_0x2e5b38[0x0][_0x6d9b('0x15')]%_0x2bd11f:0x0;_0x55c482[_0x6d9b('0x1a')](function(_0x5a56c6){if(_0x5a56c6>0x0){_0x56556c+=_0x2bd11f;}_0x28106c[_0x6d9b('0x1b')](dbH[_0x6d9b('0x13')][_0x6d9b('0x11')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2bd11f,_0x56556c),{'type':dbH[_0x6d9b('0x13')]['QueryTypes'][_0x6d9b('0x14')]}));});if(_0x335e11>0x0){_0x56556c+=_0x2bd11f;_0x28106c[_0x6d9b('0x1b')](dbH['sequelize'][_0x6d9b('0x11')](util[_0x6d9b('0xc')](_0x6d9b('0x1c'),QUERY,_0x335e11,_0x56556c),{'type':dbH[_0x6d9b('0x13')]['QueryTypes'][_0x6d9b('0x14')]}));}}}else{_0x28106c[_0x6d9b('0x1b')](dbH[_0x6d9b('0x13')][_0x6d9b('0x11')](QUERY,{'type':dbH['sequelize'][_0x6d9b('0x1d')][_0x6d9b('0x14')]}));}var _0x4e5aa0=path[_0x6d9b('0x1e')](PATH);var _0x62dd88=path[_0x6d9b('0x1f')](PATH,_0x6d9b('0x20'));var _0x739b14=_0x597cb0[_0x6d9b('0xf')]&&_0x28106c[_0x6d9b('0x17')]>0x1;var _0x32f031=[];if(!fs[_0x6d9b('0x21')](path[_0x6d9b('0x22')](_0x4e5aa0,_0x62dd88))&&_0x739b14){fs[_0x6d9b('0x23')](path['join'](_0x4e5aa0,_0x62dd88));}return BPromise[_0x6d9b('0x24')](_0x28106c,function(_0x8e1e84){_0x32f031[_0x6d9b('0x1b')](_0x8e1e84);})[_0x6d9b('0x10')](function(){for(var _0x4fc46d=0x0;_0x4fc46d<_0x32f031[_0x6d9b('0x17')];_0x4fc46d+=0x1){var _0x1f22d3;var _0x3c497c=_0x32f031[_0x4fc46d];if(_0x739b14){_0x1f22d3=path[_0x6d9b('0x22')](_0x4e5aa0,_0x62dd88,util[_0x6d9b('0xc')](_0x6d9b('0x25'),_0x62dd88,_0x4fc46d,_0x6d9b('0x26')));}else{_0x1f22d3=path['join'](_0x4e5aa0,util[_0x6d9b('0xc')](_0x6d9b('0x27'),_0x62dd88,_0x6d9b('0x26')));}fs[_0x6d9b('0x28')](_0x1f22d3,json2xls(_0x3c497c),'binary');}})[_0x6d9b('0x10')](function(){if(_0x739b14){return new Promise(function(_0xaa9bf){zipdir(path['join'](_0x4e5aa0,_0x62dd88),{'saveTo':path[_0x6d9b('0x22')](_0x4e5aa0,util[_0x6d9b('0xc')](_0x6d9b('0x27'),_0x62dd88,'zip'))},function(_0x5ff404,_0x2f4c07){rimraf(path[_0x6d9b('0x22')](_0x4e5aa0,_0x62dd88),function(){});_0xaa9bf(_0x6d9b('0x29'));});});}})['then'](function(){logger[_0x6d9b('0xb')](util[_0x6d9b('0xc')](_0x6d9b('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x6d9b('0x2b'),_0x739b14?util[_0x6d9b('0xc')](_0x6d9b('0x27'),_0x62dd88,_0x739b14?_0x6d9b('0x2c'):'xlsx'):null);});})[_0x6d9b('0x2d')](function(_0x564b7f){logger[_0x6d9b('0xb')](util['format'](_0x6d9b('0x2e'),EXTRACTED_REPORT_ID,_0x6d9b('0x2f')),util[_0x6d9b('0x30')](_0x564b7f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6d9b('0x31'));})[_0x6d9b('0x32')](function(){process[_0x6d9b('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 3216cb5..1262b7a 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 _0x786b=['extension','find','push','Set','format','context','priority','VoiceExtensionId','type','CDR(routeid)=','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','tag','outbound','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','Hangup','concat','transaction','destroy','sortBy','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','filter','groupBy','queue','hasOwnProperty','extensions'];(function(_0x10f6d4,_0xd5e298){var _0x31b088=function(_0x4946a9){while(--_0x4946a9){_0x10f6d4['push'](_0x10f6d4['shift']());}};_0x31b088(++_0xd5e298);}(_0x786b,0x1d2));var _0xb786=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x786b[_0x1969a7];return _0x3d665f;};'use strict';var _=require(_0xb786('0x0'));var util=require(_0xb786('0x1'));function rewrite(_0x32957d,_0x3d230d){var _0x327dc6=this;return _0x32957d[_0xb786('0x2')][_0xb786('0x3')][_0xb786('0x4')]({'raw':!![]})[_0xb786('0x5')](function(_0xd91c6c){_0x327dc6[_0xb786('0x6')]=_0xd91c6c;return _0x32957d['models'][_0xb786('0x7')][_0xb786('0x4')]({'where':{'IntervalId':_0x3d230d[_0xb786('0x8')]},'raw':!![]});})[_0xb786('0x5')](function(_0x73f296){return _0x32957d[_0xb786('0x2')][_0xb786('0x7')]['findAll']({'where':{'exten':{'$in':_[_0xb786('0x9')](_[_0xb786('0xa')](_0x73f296,_0xb786('0xb')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xb786('0x5')](function(_0x2abd93){var _0x323214=_[_0xb786('0xc')](_0x2abd93,{'priority':'1'});var _0x11b41f=_[_0xb786('0xc')](_0x2abd93,{'isApp':0x1});var _0x508704=_[_0xb786('0xd')](_0x11b41f,_0xb786('0xb'));var _0x26b5bf=[_0xb786('0xe'),'playback'];var _0x338bb5=[];var _0x293695=[];for(var _0x5322d7 in _0x508704){if(_0x508704[_0xb786('0xf')](_0x5322d7)){_0x327dc6['priority']=0x2;_0x327dc6[_0xb786('0x10')]=[];_0x327dc6[_0xb786('0x11')]=_[_0xb786('0x12')](_0x323214,{'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')]});_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0]['type'],'app':_0xb786('0x14'),'appdata':util[_0xb786('0x15')]('CDR(type)=%s',_0x508704[_0x5322d7][0x0]['type']),'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});if(_0x508704[_0x5322d7][0x0]['type']==='inbound'){_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':'Set','appdata':_0xb786('0x1a')+_0x508704[_0x5322d7][0x0][_0xb786('0x18')],'context':_0x508704[_0x5322d7][0x0]['context'],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});}else if(_0x508704[_0x5322d7][0x0]['type']==='outbound'){if(_0x327dc6[_0xb786('0x11')]){_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':_0xb786('0x1b')+(_0x327dc6[_0xb786('0x11')][_0xb786('0x1c')]?_0xb786('0x1d')+_0x327dc6['extension'][_0xb786('0x1c')]+'}':_0xb786('0x1e')),'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});}_0x327dc6[_0xb786('0x10')]['push']({'type':_0x508704[_0x5322d7][0x0]['type'],'app':_0xb786('0x14'),'appdata':_0xb786('0x1a')+_0x508704[_0x5322d7][0x0][_0xb786('0x18')],'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0]['VoiceExtensionId']});var _0x5bc41c=_0x327dc6['priority']++;_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x1f'),'appdata':_0xb786('0x20')+(_0x5bc41c+0x2)+'):Goto('+(_0x5bc41c+0x1)+')','context':_0x508704[_0x5322d7][0x0]['context'],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x5bc41c,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});if(_0x327dc6[_0xb786('0x11')]){_0x327dc6['extensions'][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0]['type'],'app':_0xb786('0x14'),'appdata':_0x327dc6[_0xb786('0x11')][_0xb786('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x327dc6[_0xb786('0x11')][_0xb786('0x1c')]+'}':_0xb786('0x21'),'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0]['exten'],'priority':_0x327dc6['priority']++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});}_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':_0xb786('0x22')+_0x508704[_0x5322d7][0x0]['VoiceExtensionId'],'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0]['exten'],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});if(_0x327dc6[_0xb786('0x11')]&&_0x327dc6[_0xb786('0x11')][_0xb786('0xf')](_0xb786('0x23'))&&_0x327dc6[_0xb786('0x11')][_0xb786('0x23')]!==_0xb786('0x24')){_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0]['exten'],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0]['type'],'app':_0xb786('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x327dc6[_0xb786('0x11')][_0xb786('0x23')]||_0xb786('0x25'),'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x327dc6['priority']++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});}}_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':_0xb786('0x26'),'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});_0x327dc6[_0xb786('0x10')]['push']({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':_0xb786('0x27'),'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0]['exten'],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});_0x327dc6[_0xb786('0x10')][_0xb786('0x13')]({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':_0xb786('0x28'),'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'priority':_0x327dc6[_0xb786('0x17')]++,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});for(var _0x29bd6c=0x0,_0x5bf789=0x0;_0x29bd6c<_0x508704[_0x5322d7][_0xb786('0x29')];_0x29bd6c+=0x1,_0x5bf789=0x0){var _0x138b7d=_0x508704[_0x5322d7][_0x29bd6c];if(_0x138b7d[_0xb786('0x19')]){_0x138b7d[_0xb786('0x19')]=_0x138b7d[_0xb786('0x19')][_0xb786('0x2a')]();}var _0x53ddd4=[];var _0x23b2ff=[];delete _0x138b7d['id'];delete _0x138b7d[_0xb786('0x2b')];delete _0x138b7d[_0xb786('0x2c')];var _0x1181e4=_0x138b7d['interval']!==_0xb786('0x2d')?[_0x138b7d[_0xb786('0x2e')]]:_0x138b7d[_0xb786('0x8')]?_[_0xb786('0xa')](_['filter'](_0x327dc6[_0xb786('0x6')],{'IntervalId':_0x138b7d[_0xb786('0x8')]}),'interval'):[];if(_0x138b7d['hasOwnProperty'](_0xb786('0x2f'))){if(_0x138b7d[_0xb786('0x2f')]&&_0x138b7d[_0xb786('0x2f')]!=='--'){_0x53ddd4['push']({'type':_0x138b7d[_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':'CDR(tag)='+_0x138b7d[_0xb786('0x2f')],'context':_0x138b7d[_0xb786('0x16')],'exten':_0x138b7d['exten'],'priority':_0x1181e4[_0xb786('0x29')]+_0x327dc6[_0xb786('0x17')]+_0x5bf789++,'VoiceExtensionId':_0x138b7d[_0xb786('0x18')]});}}if(_0x138b7d[_0xb786('0x19')]===_0xb786('0x30')&&_0x138b7d[_0xb786('0xf')]('callerID')){if(_0x138b7d['callerID']){_0x53ddd4[_0xb786('0x13')]({'type':_0x138b7d[_0xb786('0x19')],'app':_0xb786('0x1f'),'appdata':_0xb786('0x31')+_0x138b7d[_0xb786('0x32')]+')','context':_0x138b7d[_0xb786('0x16')],'exten':_0x138b7d[_0xb786('0xb')],'priority':_0x1181e4[_0xb786('0x29')]+_0x327dc6['priority']+_0x5bf789++,'VoiceExtensionId':_0x138b7d[_0xb786('0x18')]});}else{_0x53ddd4['push']({'type':_0x138b7d['type'],'app':_0xb786('0x1f'),'appdata':_0xb786('0x33'),'context':_0x138b7d[_0xb786('0x16')],'exten':_0x138b7d[_0xb786('0xb')],'priority':_0x1181e4[_0xb786('0x29')]+_0x327dc6[_0xb786('0x17')]+_0x5bf789++,'VoiceExtensionId':_0x138b7d[_0xb786('0x18')]});}}if(_0x138b7d[_0xb786('0xf')]('answer')){if(_0x26b5bf[_0xb786('0x34')](_0x138b7d['app']['toLowerCase']())>=0x0&&_0x138b7d[_0xb786('0x35')]!==_0xb786('0x36')){if(_0x138b7d[_0xb786('0x37')]){_0x53ddd4['push']({'type':_0x138b7d[_0xb786('0x19')],'app':_0xb786('0x1f'),'appdata':_0xb786('0x38'),'context':_0x138b7d['context'],'exten':_0x138b7d[_0xb786('0xb')],'priority':_0x1181e4[_0xb786('0x29')]+_0x327dc6[_0xb786('0x17')]+_0x5bf789++,'VoiceExtensionId':_0x138b7d[_0xb786('0x18')]});_0x53ddd4['push']({'type':_0x138b7d[_0xb786('0x19')],'app':_0xb786('0x14'),'appdata':_0xb786('0x39'),'context':_0x138b7d[_0xb786('0x16')],'exten':_0x138b7d[_0xb786('0xb')],'priority':_0x1181e4['length']+_0x327dc6['priority']+_0x5bf789++,'VoiceExtensionId':_0x138b7d[_0xb786('0x18')]});}else{_0x53ddd4[_0xb786('0x13')]({'type':_0x138b7d[_0xb786('0x19')],'app':_0xb786('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x138b7d[_0xb786('0x16')],'exten':_0x138b7d[_0xb786('0xb')],'priority':_0x1181e4[_0xb786('0x29')]+_0x327dc6['priority']+_0x5bf789++,'VoiceExtensionId':_0x138b7d[_0xb786('0x18')]});_0x53ddd4[_0xb786('0x13')]({'type':_0x138b7d['type'],'app':_0xb786('0x14'),'appdata':_0xb786('0x3a'),'context':_0x138b7d[_0xb786('0x16')],'exten':_0x138b7d[_0xb786('0xb')],'priority':_0x1181e4['length']+_0x327dc6[_0xb786('0x17')]+_0x5bf789++,'VoiceExtensionId':_0x138b7d[_0xb786('0x18')]});}}}for(var _0xbded0b=0x0;_0xbded0b<_0x1181e4['length'];_0xbded0b+=0x1){var _0xd2f351=_0x327dc6[_0xb786('0x17')]+_0x1181e4[_0xb786('0x29')];var _0x3b5a1e=_0xbded0b===_0x1181e4['length']-0x1?_0x327dc6[_0xb786('0x17')]+_0x53ddd4['length']+_0x23b2ff[_0xb786('0x29')]+0x2:_0x327dc6[_0xb786('0x17')]+_0xbded0b+0x1;_0x53ddd4[_0xb786('0x3b')](_0xbded0b,0x0,{'type':_0x138b7d[_0xb786('0x19')],'app':_0xb786('0x3c'),'appdata':_0x1181e4[_0xbded0b]+'?'+_0x138b7d['context']+_0xb786('0x3d')+_0xd2f351+':'+_0x138b7d['context']+_0xb786('0x3d')+_0x3b5a1e,'exten':_0x138b7d[_0xb786('0xb')],'context':_0x138b7d[_0xb786('0x16')],'priority':_0x327dc6[_0xb786('0x17')]+_0xbded0b,'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});}_0x138b7d[_0xb786('0x17')]=_0x53ddd4['length']?_['last'](_0x53ddd4)[_0xb786('0x17')]+0x1:_0x327dc6[_0xb786('0x17')];_0x327dc6[_0xb786('0x17')]=(_0x23b2ff['length']?_[_0xb786('0x3e')](_0x23b2ff)['priority']:_0x138b7d[_0xb786('0x17')])+0x1;_0x327dc6['extensions']=_['concat'](_0x327dc6['extensions'],_0x53ddd4,[_0x138b7d],_0x23b2ff);}_0x327dc6[_0xb786('0x10')]['push']({'type':_0x508704[_0x5322d7][0x0][_0xb786('0x19')],'app':_0xb786('0x3f'),'exten':_0x508704[_0x5322d7][0x0][_0xb786('0xb')],'context':_0x508704[_0x5322d7][0x0][_0xb786('0x16')],'priority':_0x327dc6[_0xb786('0x17')],'VoiceExtensionId':_0x508704[_0x5322d7][0x0][_0xb786('0x18')]});_0x338bb5[_0xb786('0x13')](_0x508704[_0x5322d7][0x0][_0xb786('0x18')]);_0x293695=_[_0xb786('0x40')](_0x293695,_0x327dc6[_0xb786('0x10')]);}}return _0x32957d[_0xb786('0x41')](function(_0x34007c){return _0x32957d['models'][_0xb786('0x7')][_0xb786('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x338bb5}},'transaction':_0x34007c})[_0xb786('0x5')](function(_0x106865){return _0x32957d[_0xb786('0x2')][_0xb786('0x7')]['bulkCreate'](_[_0xb786('0x43')](_0x293695,_0xb786('0x17')),{'transaction':_0x34007c});});});})['catch'](function(_0x6f10cd){console['error'](_0x6f10cd);});}exports[_0xb786('0x44')]=rewrite; \ No newline at end of file +var _0xff74=['map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','extension','${EXTEN:','${EXTEN}','ExecIf','cutdigits','CDR(prefix)=${EXTEN:0:','outboundrouteid=','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','recordingFormat','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','GotoIfTime','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xff74,0xc1));var _0x4ff7=function(_0x6b4f52,_0x4a17d1){_0x6b4f52=_0x6b4f52-0x0;var _0xa387e5=_0xff74[_0x6b4f52];return _0xa387e5;};'use strict';var _=require(_0x4ff7('0x0'));var util=require('util');function rewrite(_0x198819,_0x719eca){var _0xb8a4a7=this;return _0x198819[_0x4ff7('0x1')][_0x4ff7('0x2')][_0x4ff7('0x3')]({'raw':!![]})[_0x4ff7('0x4')](function(_0x29c684){_0xb8a4a7[_0x4ff7('0x5')]=_0x29c684;return _0x198819[_0x4ff7('0x1')][_0x4ff7('0x6')][_0x4ff7('0x3')]({'where':{'IntervalId':_0x719eca[_0x4ff7('0x7')]},'raw':!![]});})[_0x4ff7('0x4')](function(_0x369fcf){return _0x198819['models'][_0x4ff7('0x6')][_0x4ff7('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x4ff7('0x8')](_0x369fcf,_0x4ff7('0x9')))}},'order':[{'raw':_0x4ff7('0xa')}],'raw':!![]});})[_0x4ff7('0x4')](function(_0x348655){var _0x2994a1=_[_0x4ff7('0xb')](_0x348655,{'priority':'1'});var _0x1eb1ab=_['filter'](_0x348655,{'isApp':0x1});var _0xa29282=_[_0x4ff7('0xc')](_0x1eb1ab,_0x4ff7('0x9'));var _0x4d7824=[_0x4ff7('0xd'),_0x4ff7('0xe')];var _0x2d2bd5=[];var _0x4f6c91=[];for(var _0x589a1a in _0xa29282){if(_0xa29282[_0x4ff7('0xf')](_0x589a1a)){_0xb8a4a7[_0x4ff7('0x10')]=0x2;_0xb8a4a7[_0x4ff7('0x11')]=[];_0xb8a4a7['extension']=_['find'](_0x2994a1,{'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')]});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':util[_0x4ff7('0x14')](_0x4ff7('0x15'),_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')]),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0]['exten'],'priority':_0xb8a4a7['priority']++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});if(_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')]===_0x4ff7('0x19')){_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x1a')+_0xa29282[_0x589a1a][0x0]['VoiceExtensionId'],'context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}else if(_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')]===_0x4ff7('0x1b')){if(_0xb8a4a7[_0x4ff7('0x1c')]){_0xb8a4a7['extensions'][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':'Set','appdata':'CDR(destination)='+(_0xb8a4a7[_0x4ff7('0x1c')]['cutdigits']?_0x4ff7('0x1d')+_0xb8a4a7[_0x4ff7('0x1c')]['cutdigits']+'}':_0x4ff7('0x1e')),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':'CDR(routeid)='+_0xa29282[_0x589a1a][0x0]['VoiceExtensionId'],'context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});var _0x4c5147=_0xb8a4a7[_0x4ff7('0x10')]++;_0xb8a4a7[_0x4ff7('0x11')]['push']({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4c5147+0x2)+'):Goto('+(_0x4c5147+0x1)+')','context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0x4c5147,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});if(_0xb8a4a7['extension']){_0xb8a4a7[_0x4ff7('0x11')]['push']({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0x20')]?_0x4ff7('0x21')+_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0x20')]+'}':'CDR(prefix)=noprefix','context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x22')+_0xa29282[_0x589a1a][0x0]['VoiceExtensionId'],'context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0]['VoiceExtensionId']});if(_0xb8a4a7['extension']&&_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0xf')]('recordingFormat')&&_0xb8a4a7[_0x4ff7('0x1c')]['recordingFormat']!==_0x4ff7('0x23')){_0xb8a4a7['extensions'][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':'Set','appdata':_0x4ff7('0x24'),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0xb8a4a7[_0x4ff7('0x1c')][_0x4ff7('0x25')]||'wav','context':_0xa29282[_0x589a1a][0x0]['context'],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}}_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0]['VoiceExtensionId']});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':'Set','appdata':_0x4ff7('0x26'),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7[_0x4ff7('0x10')]++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});_0xb8a4a7[_0x4ff7('0x11')][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0]['type'],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x27'),'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'exten':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x9')],'priority':_0xb8a4a7['priority']++,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});for(var _0x47c7d2=0x0,_0x4f064b=0x0;_0x47c7d2<_0xa29282[_0x589a1a][_0x4ff7('0x28')];_0x47c7d2+=0x1,_0x4f064b=0x0){var _0xfbad60=_0xa29282[_0x589a1a][_0x47c7d2];if(_0xfbad60[_0x4ff7('0x16')]){_0xfbad60[_0x4ff7('0x16')]=_0xfbad60['type'][_0x4ff7('0x29')]();}var _0x971777=[];var _0x49bd5e=[];delete _0xfbad60['id'];delete _0xfbad60[_0x4ff7('0x2a')];delete _0xfbad60[_0x4ff7('0x2b')];var _0x23ab76=_0xfbad60[_0x4ff7('0x2c')]!==_0x4ff7('0x2d')?[_0xfbad60['interval']]:_0xfbad60['IntervalId']?_[_0x4ff7('0x8')](_[_0x4ff7('0xb')](_0xb8a4a7['intervals'],{'IntervalId':_0xfbad60[_0x4ff7('0x7')]}),_0x4ff7('0x2c')):[];if(_0xfbad60['hasOwnProperty'](_0x4ff7('0x2e'))){if(_0xfbad60['tag']&&_0xfbad60[_0x4ff7('0x2e')]!=='--'){_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x2f')+_0xfbad60[_0x4ff7('0x2e')],'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7['priority']+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}}if(_0xfbad60[_0x4ff7('0x16')]===_0x4ff7('0x1b')&&_0xfbad60['hasOwnProperty']('callerID')){if(_0xfbad60[_0x4ff7('0x30')]){_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':'ExecIf','appdata':_0x4ff7('0x31')+_0xfbad60[_0x4ff7('0x30')]+')','context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76['length']+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}else{_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':'ExecIf','appdata':_0x4ff7('0x32'),'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}}if(_0xfbad60[_0x4ff7('0xf')](_0x4ff7('0x33'))){if(_0x4d7824[_0x4ff7('0x34')](_0xfbad60[_0x4ff7('0x35')]['toLowerCase']())>=0x0&&_0xfbad60[_0x4ff7('0x36')]!=='custom'){if(_0xfbad60[_0x4ff7('0x33')]){_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':'ExecIf','appdata':_0x4ff7('0x37'),'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60['exten'],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7['priority']+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});_0x971777['push']({'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x38'),'context':_0xfbad60['context'],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60['VoiceExtensionId']});}else{_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60['type'],'app':_0x4ff7('0x1f'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60['exten'],'priority':_0x23ab76[_0x4ff7('0x28')]+_0xb8a4a7[_0x4ff7('0x10')]+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});_0x971777[_0x4ff7('0x12')]({'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x13'),'appdata':_0x4ff7('0x39'),'context':_0xfbad60[_0x4ff7('0x17')],'exten':_0xfbad60[_0x4ff7('0x9')],'priority':_0x23ab76['length']+_0xb8a4a7['priority']+_0x4f064b++,'VoiceExtensionId':_0xfbad60[_0x4ff7('0x18')]});}}}for(var _0x41001f=0x0;_0x41001f<_0x23ab76[_0x4ff7('0x28')];_0x41001f+=0x1){var _0x3ca158=_0xb8a4a7[_0x4ff7('0x10')]+_0x23ab76['length'];var _0x1b5ca5=_0x41001f===_0x23ab76[_0x4ff7('0x28')]-0x1?_0xb8a4a7[_0x4ff7('0x10')]+_0x971777['length']+_0x49bd5e[_0x4ff7('0x28')]+0x2:_0xb8a4a7[_0x4ff7('0x10')]+_0x41001f+0x1;_0x971777['splice'](_0x41001f,0x0,{'type':_0xfbad60[_0x4ff7('0x16')],'app':_0x4ff7('0x3a'),'appdata':_0x23ab76[_0x41001f]+'?'+_0xfbad60[_0x4ff7('0x17')]+',${EXTEN},'+_0x3ca158+':'+_0xfbad60[_0x4ff7('0x17')]+',${EXTEN},'+_0x1b5ca5,'exten':_0xfbad60[_0x4ff7('0x9')],'context':_0xfbad60['context'],'priority':_0xb8a4a7[_0x4ff7('0x10')]+_0x41001f,'VoiceExtensionId':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]});}_0xfbad60[_0x4ff7('0x10')]=_0x971777[_0x4ff7('0x28')]?_[_0x4ff7('0x3b')](_0x971777)['priority']+0x1:_0xb8a4a7[_0x4ff7('0x10')];_0xb8a4a7[_0x4ff7('0x10')]=(_0x49bd5e[_0x4ff7('0x28')]?_[_0x4ff7('0x3b')](_0x49bd5e)[_0x4ff7('0x10')]:_0xfbad60[_0x4ff7('0x10')])+0x1;_0xb8a4a7[_0x4ff7('0x11')]=_[_0x4ff7('0x3c')](_0xb8a4a7['extensions'],_0x971777,[_0xfbad60],_0x49bd5e);}_0xb8a4a7['extensions'][_0x4ff7('0x12')]({'type':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x16')],'app':_0x4ff7('0x3d'),'exten':_0xa29282[_0x589a1a][0x0]['exten'],'context':_0xa29282[_0x589a1a][0x0][_0x4ff7('0x17')],'priority':_0xb8a4a7[_0x4ff7('0x10')],'VoiceExtensionId':_0xa29282[_0x589a1a][0x0]['VoiceExtensionId']});_0x2d2bd5[_0x4ff7('0x12')](_0xa29282[_0x589a1a][0x0][_0x4ff7('0x18')]);_0x4f6c91=_['concat'](_0x4f6c91,_0xb8a4a7[_0x4ff7('0x11')]);}}return _0x198819[_0x4ff7('0x3e')](function(_0x3e7222){return _0x198819[_0x4ff7('0x1')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2d2bd5}},'transaction':_0x3e7222})[_0x4ff7('0x4')](function(_0x274b33){return _0x198819[_0x4ff7('0x1')][_0x4ff7('0x6')][_0x4ff7('0x3f')](_[_0x4ff7('0x40')](_0x4f6c91,_0x4ff7('0x10')),{'transaction':_0x3e7222});});});})[_0x4ff7('0x41')](function(_0x357056){console[_0x4ff7('0x42')](_0x357056);});}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 feb5ade..74fb446 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 _0x0649=['into','fromQuery','phone','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','cm_hopper','ListId\x20=\x20?','str','calleridnum','cm_hopper_final','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','pause','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','../../../mysqldb','../../../config/logger','redis','defaults','register','argv','null','Missing\x20filepath\x20parameter!','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','isNil','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','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0649,0x184));var _0x9064=function(_0x754941,_0x156bc3){_0x754941=_0x754941-0x0;var _0x8b6503=_0x0649[_0x754941];return _0x8b6503;};'use strict';var BPromise=require(_0x9064('0x0'));var util=require('util');var _=require(_0x9064('0x1'));var fs=require('fs');var squel=require(_0x9064('0x2'));var Papa=require(_0x9064('0x3'));var Redis=require('ioredis');var db=require(_0x9064('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x9064('0x5'))('api');config[_0x9064('0x6')]=_[_0x9064('0x7')](config[_0x9064('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x9064('0x8')](socket);try{if(!process[_0x9064('0x9')][0x2]||process[_0x9064('0x9')][0x2]==='undefined'||process[_0x9064('0x9')][0x2]===_0x9064('0xa')){throw new Error(_0x9064('0xb'));}var FILEPATH=process['argv'][0x2];if(!process[_0x9064('0x9')][0x3]||process[_0x9064('0x9')][0x3]===_0x9064('0xc')||process[_0x9064('0x9')][0x3]==='null'||!process['argv'][0x4]||process[_0x9064('0x9')][0x4]==='undefined'||process['argv'][0x4]==='null'){throw new Error(_0x9064('0xd'));}var FIELDS=_[_0x9064('0xe')](process[_0x9064('0x9')][0x3][_0x9064('0xf')](','),process['argv'][0x4][_0x9064('0xf')](','));if(!process[_0x9064('0x9')][0x5]||process[_0x9064('0x9')][0x5]===_0x9064('0xc')||process['argv'][0x5]===_0x9064('0xa')){throw new Error(_0x9064('0x10'));}var LISTID=process[_0x9064('0x9')][0x5];var COMPANYID=process[_0x9064('0x9')][0x6]&&process['argv'][0x6]!==_0x9064('0xc')&&process[_0x9064('0x9')][0x6]!==_0x9064('0xa')?process[_0x9064('0x9')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x9064('0xc')&&process['argv'][0x7]!==_0x9064('0xa')?process[_0x9064('0x9')][0x7]:null;if(!process['argv'][0x8]||process[_0x9064('0x9')][0x8]===_0x9064('0xc')||process[_0x9064('0x9')][0x8]==='null'){throw new Error(_0x9064('0x11'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x22e791){logger[_0x9064('0x12')](_0x22e791);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(_0x230a80,_0x98b8,_0x254054,_0x47974c){var _0x3bc026={'message':_0x98b8};_0x3bc026[_0x230a80]=!![];if(_0x254054){_0x3bc026['contact']=_0x254054;}if(_0x47974c){_0x3bc026[_0x9064('0x13')]=_0x47974c;}return _0x3bc026;}function isEmail(_0x171dc2){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x171dc2);}function checkRow(_0x357846,_0xac1a1c,_0x4c5766){return new BPromise(function(_0x584221,_0x114b06){if(_[_0x9064('0x14')](_0x357846)){return _0x114b06(handleCheckRowError('error',_0x9064('0x15'),null,_0x4c5766));}if(_0x357846[_0x9064('0x16')]&&_0x357846[_0x9064('0x16')][_0x9064('0x17')]){var _0x455d11=_[_0x9064('0x18')](_0x357846[_0x9064('0x16')],_0x9064('0x19'))[_0x9064('0x1a')](';');return _0x114b06(handleCheckRowError(_0x9064('0x12'),_0x455d11,null,_0x4c5766));}var _0x5c82c6={};for(var _0x8b06c8 in FIELDS){if(FIELDS[_0x9064('0x1b')](_0x8b06c8)&&FIELDS[_0x8b06c8]){_0x5c82c6[_0x8b06c8]=_0x357846[_0x9064('0x1c')][0x0][FIELDS[_0x8b06c8]]||_0x357846['data'][0x0]['\ufeff'+FIELDS[_0x8b06c8]];}}if(!_0x5c82c6[_0x9064('0x1d')]){return _0x114b06(handleCheckRowError(_0x9064('0x12'),'firstName\x20not\x20specified!',null,_0x4c5766));}if(!_0x5c82c6['phone']){return _0x114b06(handleCheckRowError(_0x9064('0x12'),_0x9064('0x1e'),null,_0x4c5766));}if(_0x5c82c6[_0x9064('0x1f')]){var _0x6d956c=moment(_0x5c82c6[_0x9064('0x1f')],_0x9064('0x20'));if(!_0x6d956c[_0x9064('0x21')]()){return _0x114b06(handleCheckRowError('error',_0x9064('0x22'),null,_0x4c5766));}}if(_0x5c82c6[_0x9064('0x23')]){if(!isEmail(_0x5c82c6[_0x9064('0x23')])){return _0x114b06(handleCheckRowError('error',_0x9064('0x24'),null,_0x4c5766));}}_0x5c82c6[_0x9064('0x25')]=LISTID;_0x5c82c6[_0x9064('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9064('0x17')]&&_0xac1a1c){var _0x22be64={};for(var _0x50f35b=0x0,_0x2d1e88=DUPLICATES['length'];_0x50f35b<_0x2d1e88;_0x50f35b+=0x1){_0x22be64[DUPLICATES[_0x50f35b]]=_0x5c82c6[DUPLICATES[_0x50f35b]];}var _0x5b58f3=_[_0x9064('0x27')](_0xac1a1c,_0x22be64);if(_0x5b58f3){return _0x114b06(handleCheckRowError(_0x9064('0x28'),_0x9064('0x29'),_0x5b58f3,_0x4c5766));}}return db[_0x9064('0x2a')][_0x9064('0x2b')](_0x5c82c6,{'raw':!![],'hooks':![],'fields':_[_0x9064('0x2c')](_0x5c82c6)})[_0x9064('0x2d')](function(_0x55c4e1){if(DUPLICATES&&DUPLICATES[_0x9064('0x17')]&&_0xac1a1c){_0xac1a1c['push'](_[_0x9064('0x2e')](_0x5c82c6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x55c4e1['id'];return _0x584221();})['catch'](function(_0x3be429){return _0x114b06(handleCheckRowError('error',_0x9064('0x2f')+(_0x3be429[_0x9064('0x19')]||JSON[_0x9064('0x30')](_0x3be429)),null,_0x4c5766));});});}function checkHopper(){function _0x2b2a8b(){return function(_0x28c207){logger['error']('cmContact',_0x9064('0x31'),util[_0x9064('0x32')](_0x28c207,{'showHidden':![],'depth':null}));};}var _0x11e067=function(_0x5b5f6b,_0x211bf2){var _0x3ec3ea=squel[_0x9064('0x33')]()[_0x9064('0x34')]('cm_hopper')[_0x9064('0x35')]([_0x9064('0x36'),_0x9064('0x37'),_0x9064('0x38'),_0x9064('0x25'),_0x211bf2,_0x9064('0x39'),_0x9064('0x3a')],squel[_0x9064('0x3b')]()[_0x9064('0x3c')](_0x9064('0x36'),_0x9064('0x36'))[_0x9064('0x3c')](_0x9064('0x3d'),_0x9064('0x37'))['field']('id',_0x9064('0x38'))[_0x9064('0x3c')](LISTID[_0x9064('0x3e')](),_0x9064('0x25'))[_0x9064('0x3c')](_0x5b5f6b['id'][_0x9064('0x3e')](),_0x211bf2)[_0x9064('0x3c')](_0x9064('0x3d'),_0x9064('0x39'))[_0x9064('0x3c')](_0x9064('0x3d'),_0x9064('0x3a'))['from'](_0x9064('0x3f'))[_0x9064('0x40')]('deletedAt\x20IS\x20NULL')[_0x9064('0x40')]('ListId\x20=\x20?',LISTID[_0x9064('0x3e')]())['where'](_0x9064('0x41'))['where'](_0x9064('0x42'),squel[_0x9064('0x3b')]()[_0x9064('0x3c')](_0x9064('0x36'))[_0x9064('0x43')](_0x9064('0x44'))[_0x9064('0x40')](_0x211bf2+'\x20=\x20?',_0x5b5f6b['id']['toString']())))[_0x9064('0x3e')]();return _0x3ec3ea;};var _0x77b4c9=function(_0x3c4723,_0x42a2a8){var _0x45bade=squel['insert']()['into'](_0x9064('0x44'))[_0x9064('0x35')]([_0x9064('0x36'),_0x9064('0x37'),_0x9064('0x38'),'ListId',_0x42a2a8,'createdAt',_0x9064('0x3a')],squel[_0x9064('0x3b')]()[_0x9064('0x3c')](_0x9064('0x36'),_0x9064('0x36'))[_0x9064('0x3c')]('NOW()',_0x9064('0x37'))['field']('id',_0x9064('0x38'))[_0x9064('0x3c')](LISTID[_0x9064('0x3e')](),_0x9064('0x25'))[_0x9064('0x3c')](_0x3c4723['id'][_0x9064('0x3e')](),_0x42a2a8)[_0x9064('0x3c')](_0x9064('0x3d'),_0x9064('0x39'))['field'](_0x9064('0x3d'),_0x9064('0x3a'))['from'](_0x9064('0x3f'))['where']('deletedAt\x20IS\x20NULL')[_0x9064('0x40')](_0x9064('0x45'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x9064('0x46')](hopperContacts))['where'](_0x9064('0x41'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x9064('0x3b')]()[_0x9064('0x3c')](_0x9064('0x47'))[_0x9064('0x43')](_0x9064('0x48'))[_0x9064('0x40')](_0x42a2a8+'\x20=\x20?',_0x3c4723['id']['toString']()))[_0x9064('0x40')](_0x9064('0x42'),squel[_0x9064('0x3b')]()['field'](_0x9064('0x36'))[_0x9064('0x43')](_0x9064('0x44'))[_0x9064('0x40')](_0x42a2a8+_0x9064('0x49'),_0x3c4723['id'][_0x9064('0x3e')]())))[_0x9064('0x3e')]();return _0x45bade;};function _0xf92bfb(_0x8901ba,_0x3ffbcc){var _0xc0ef1e=squel[_0x9064('0x33')]()[_0x9064('0x34')](_0x9064('0x44'))[_0x9064('0x35')]([_0x9064('0x36'),_0x9064('0x37'),_0x9064('0x38'),_0x9064('0x25'),_0x3ffbcc,_0x9064('0x39'),_0x9064('0x3a')],squel[_0x9064('0x3b')]()[_0x9064('0x3c')]('phone','phone')[_0x9064('0x3c')](_0x9064('0x3d'),'scheduledAt')[_0x9064('0x3c')]('id',_0x9064('0x38'))[_0x9064('0x3c')](LISTID[_0x9064('0x3e')](),_0x9064('0x25'))['field'](_0x8901ba['id'][_0x9064('0x3e')](),_0x3ffbcc)[_0x9064('0x3c')]('NOW()',_0x9064('0x39'))['field'](_0x9064('0x3d'),_0x9064('0x3a'))['from'](_0x9064('0x3f'))[_0x9064('0x40')](_0x9064('0x4a'))[_0x9064('0x40')](_0x9064('0x45'),LISTID[_0x9064('0x3e')]())['where'](_0x9064('0x4b'),squel[_0x9064('0x46')](hopperContacts))['where'](_0x9064('0x41')))[_0x9064('0x3e')]();return _0xc0ef1e;}function _0x57b847(_0x3dcef1,_0x265f5e){var _0x49b97a=squel[_0x9064('0x33')]()[_0x9064('0x34')](_0x9064('0x4c'))[_0x9064('0x35')]([_0x9064('0x36'),'ContactId','ListId',_0x265f5e,_0x9064('0x39'),_0x9064('0x3a')],squel[_0x9064('0x3b')]()[_0x9064('0x3c')]('phone',_0x9064('0x36'))[_0x9064('0x3c')]('id','ContactId')[_0x9064('0x3c')](LISTID[_0x9064('0x3e')](),'ListId')[_0x9064('0x3c')](_0x3dcef1['id'][_0x9064('0x3e')](),_0x265f5e)[_0x9064('0x3c')](_0x9064('0x3d'),'createdAt')[_0x9064('0x3c')](_0x9064('0x3d'),_0x9064('0x3a'))[_0x9064('0x43')]('cm_contacts')['where'](_0x9064('0x4a'))[_0x9064('0x40')](_0x9064('0x45'),LISTID[_0x9064('0x3e')]())[_0x9064('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x9064('0x40')](_0x9064('0x41')))[_0x9064('0x3e')]();return _0x49b97a;}return db[_0x9064('0x4d')][_0x9064('0x4e')]({'where':{'type':_0x9064('0x4f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x9064('0x50')],'as':_0x9064('0x51'),'where':{'id':LISTID}}]})[_0x9064('0x2d')](function(_0x4b382c){var _0xaebcec=[];if(_0x4b382c){var _0x478435;for(var _0x7ad74e=0x0,_0x195a9b;_0x7ad74e<_0x4b382c[_0x9064('0x17')];_0x7ad74e+=0x1){_0x195a9b=_0x4b382c[_0x7ad74e][_0x9064('0x52')]({'plain':!![]});switch(_0x195a9b[_0x9064('0x53')]){case _0x9064('0x54'):_0xaebcec[_0x9064('0x55')](db[_0x9064('0x56')][_0x9064('0x57')](_0x77b4c9(_0x195a9b,_0x9064('0x58')))[_0x9064('0x2d')](function(){})['catch'](_0x2b2a8b()));break;case _0x9064('0x59'):_0xaebcec[_0x9064('0x55')](db[_0x9064('0x56')][_0x9064('0x57')](_0x11e067(_0x195a9b,_0x9064('0x58')))['then'](function(){})[_0x9064('0x5a')](_0x2b2a8b()));break;default:_0xaebcec[_0x9064('0x55')](db[_0x9064('0x56')][_0x9064('0x57')](_0xf92bfb(_0x195a9b,_0x9064('0x58')))['then'](function(){})[_0x9064('0x5a')](_0x2b2a8b()));}}}return _0xaebcec;})[_0x9064('0x5b')]()[_0x9064('0x2d')](function(){return db[_0x9064('0x4d')][_0x9064('0x4e')]({'where':{'type':_0x9064('0x4f')},'attributes':['id'],'include':[{'model':db[_0x9064('0x50')],'as':_0x9064('0x5c'),'where':{'id':LISTID}}]})[_0x9064('0x2d')](function(_0x5d9935){var _0x16d091=[];if(_0x5d9935){var _0x328919;for(var _0x4b3a40=0x0,_0x4dbc30;_0x4b3a40<_0x5d9935[_0x9064('0x17')];_0x4b3a40+=0x1){_0x4dbc30=_0x5d9935[_0x4b3a40][_0x9064('0x52')]({'plain':!![]});_0x16d091[_0x9064('0x55')](db[_0x9064('0x56')][_0x9064('0x57')](_0x57b847(_0x4dbc30,_0x9064('0x58')))[_0x9064('0x2d')](function(){})[_0x9064('0x5a')](_0x2b2a8b()));}}return _0x16d091;})[_0x9064('0x5b')]();})['then'](function(){return db[_0x9064('0x5d')][_0x9064('0x4e')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db['CmList'],'as':_0x9064('0x51'),'where':{'id':LISTID}}]})[_0x9064('0x2d')](function(_0x29b5cf){var _0x1364e6=[];if(_0x29b5cf){for(var _0x14c061=0x0,_0xb17eac;_0x14c061<_0x29b5cf[_0x9064('0x17')];_0x14c061+=0x1){_0xb17eac=_0x29b5cf[_0x14c061][_0x9064('0x52')]({'plain':!![]});switch(_0xb17eac[_0x9064('0x53')]){case _0x9064('0x54'):_0x1364e6[_0x9064('0x55')](db[_0x9064('0x56')][_0x9064('0x57')](_0x77b4c9(_0xb17eac,'CampaignId'))[_0x9064('0x2d')](function(){})[_0x9064('0x5a')](_0x2b2a8b()));break;case'onlyIfOpen':_0x1364e6[_0x9064('0x55')](db[_0x9064('0x56')][_0x9064('0x57')](_0x11e067(_0xb17eac,_0x9064('0x5e')))[_0x9064('0x2d')](function(){})[_0x9064('0x5a')](_0x2b2a8b()));break;default:_0x1364e6[_0x9064('0x55')](db[_0x9064('0x56')][_0x9064('0x57')](_0xf92bfb(_0xb17eac,_0x9064('0x5e')))[_0x9064('0x2d')](function(){})['catch'](_0x2b2a8b()));}}}return _0x1364e6;})[_0x9064('0x5b')]();})[_0x9064('0x2d')](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0x9064('0x50')],'as':_0x9064('0x5c'),'where':{'id':LISTID}}]})[_0x9064('0x2d')](function(_0x32023a){var _0xbdc10=[];if(_0x32023a){for(var _0x1a044a=0x0,_0x47cab4;_0x1a044a<_0x32023a[_0x9064('0x17')];_0x1a044a+=0x1){_0x47cab4=_0x32023a[_0x1a044a]['get']({'plain':!![]});_0xbdc10['push'](db[_0x9064('0x56')][_0x9064('0x57')](_0x57b847(_0x47cab4,'CampaignId'))[_0x9064('0x2d')](function(){})[_0x9064('0x5a')](_0x2b2a8b()));}}return _0xbdc10;})['all']();})[_0x9064('0x5a')](function(_0x24a3de){logger['error'](_0x9064('0x5f'),_0x9064('0x60'),_0x24a3de[_0x9064('0x19')]);});}var processPromises=function(_0x1f7707){return BPromise[_0x9064('0x5b')](promises)['then'](function(_0x318a24){})['catch'](function(_0x30a053){logger[_0x9064('0x12')]('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x30a053));})[_0x9064('0x61')](function(){socket[_0x9064('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1f7707){return _0x1f7707[_0x9064('0x63')]();}});};var endCsv=function(){return BPromise[_0x9064('0x64')]()[_0x9064('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x9064('0x2d')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9064('0x65')](FILEPATH);}catch(_0x1a7ca0){logger[_0x9064('0x12')](_0x9064('0x66'),JSON[_0x9064('0x30')](_0x1a7ca0));}finally{process[_0x9064('0x67')](0x0);}});};process['on'](_0x9064('0x68'),function(){logger['info'](_0x9064('0x69'));endCsv();});function main(){return BPromise[_0x9064('0x64')]()[_0x9064('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9064('0xf')](',');return db[_0x9064('0x2a')][_0x9064('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9064('0x2d')](function(_0x11086d){var _0x122f35=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x122f35,{'header':!![],'skipEmptyLines':!![],'step':function(_0x510ce7,_0xb81515){total+=0x1;var _0x326f3e=total;promises[_0x9064('0x55')](checkRow(_0x510ce7,_0x11086d,_0x326f3e)[_0x9064('0x2d')](function(){success+=0x1;})[_0x9064('0x5a')](function(_0x1a2fd0){if(_0x1a2fd0[_0x9064('0x12')]){errors+=0x1;delete _0x1a2fd0[_0x9064('0x12')];}else if(_0x1a2fd0[_0x9064('0x28')]){duplicates+=0x1;delete _0x1a2fd0[_0x9064('0x28')];}rows[_0x9064('0x55')](_0x1a2fd0);}));if(total%0xc8===0x0){_0xb81515[_0x9064('0x6a')]();return processPromises(_0xb81515);}},'complete':function(){return processPromises()['then'](function(){logger[_0x9064('0x6b')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x2fe456,_0x352959){logger['info'](_0x9064('0x6c'),JSON[_0x9064('0x30')](_0x2fe456));endCsv();}});})[_0x9064('0x5a')](function(_0x88601c){logger[_0x9064('0x12')](_0x9064('0x6d'),JSON[_0x9064('0x30')](_0x88601c));});}main(); \ No newline at end of file +var _0xfbea=['onlyIfOpen','sequelize','VoiceQueueId','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','resolve','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','info','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','contact','index','test','isNil','error','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','duplicate','Duplicate\x20Contact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','insert','into','cm_hopper','fromQuery','ContactId','createdAt','updatedAt','select','field','NOW()','toString','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','\x20=\x20?','scheduledAt','cm_contacts','id\x20IN\x20?','str','calleridnum','phone\x20NOT\x20IN\x20(?)','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','query'];(function(_0x5b78fe,_0x44542c){var _0x24ac3c=function(_0x552b51){while(--_0x552b51){_0x5b78fe['push'](_0x5b78fe['shift']());}};_0x24ac3c(++_0x44542c);}(_0xfbea,0xf2));var _0xafbe=function(_0x3b8b03,_0x49ff54){_0x3b8b03=_0x3b8b03-0x0;var _0xefe7ae=_0xfbea[_0x3b8b03];return _0xefe7ae;};'use strict';var BPromise=require(_0xafbe('0x0'));var util=require('util');var _=require(_0xafbe('0x1'));var fs=require('fs');var squel=require(_0xafbe('0x2'));var Papa=require(_0xafbe('0x3'));var Redis=require(_0xafbe('0x4'));var db=require(_0xafbe('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xafbe('0x6'))('api');config[_0xafbe('0x7')]=_[_0xafbe('0x8')](config[_0xafbe('0x7')],{'host':_0xafbe('0x9'),'port':0x18eb});var socket=require(_0xafbe('0xa'))(new Redis(config[_0xafbe('0x7')]));require(_0xafbe('0xb'))[_0xafbe('0xc')](socket);try{if(!process[_0xafbe('0xd')][0x2]||process[_0xafbe('0xd')][0x2]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x2]===_0xafbe('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xafbe('0xd')][0x2];if(!process[_0xafbe('0xd')][0x3]||process[_0xafbe('0xd')][0x3]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x3]===_0xafbe('0xf')||!process[_0xafbe('0xd')][0x4]||process[_0xafbe('0xd')][0x4]==='undefined'||process[_0xafbe('0xd')][0x4]===_0xafbe('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xafbe('0x10')](process[_0xafbe('0xd')][0x3]['split'](','),process[_0xafbe('0xd')][0x4][_0xafbe('0x11')](','));if(!process[_0xafbe('0xd')][0x5]||process['argv'][0x5]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x5]==='null'){throw new Error(_0xafbe('0x12'));}var LISTID=process[_0xafbe('0xd')][0x5];var COMPANYID=process[_0xafbe('0xd')][0x6]&&process[_0xafbe('0xd')][0x6]!=='undefined'&&process[_0xafbe('0xd')][0x6]!==_0xafbe('0xf')?process[_0xafbe('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0xafbe('0xd')][0x7]!==_0xafbe('0xe')&&process[_0xafbe('0xd')][0x7]!==_0xafbe('0xf')?process[_0xafbe('0xd')][0x7]:null;if(!process[_0xafbe('0xd')][0x8]||process[_0xafbe('0xd')][0x8]===_0xafbe('0xe')||process[_0xafbe('0xd')][0x8]==='null'){throw new Error(_0xafbe('0x13'));}var SOCKET_TIMESTAMP=process[_0xafbe('0xd')][0x8];}catch(_0x3a1d0b){logger['error'](_0x3a1d0b);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(_0x230639,_0x30f472,_0x12177c,_0x37b968){var _0x5c2ed0={'message':_0x30f472};_0x5c2ed0[_0x230639]=!![];if(_0x12177c){_0x5c2ed0[_0xafbe('0x14')]=_0x12177c;}if(_0x37b968){_0x5c2ed0[_0xafbe('0x15')]=_0x37b968;}return _0x5c2ed0;}function isEmail(_0x47ca6d){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))*$/[_0xafbe('0x16')](_0x47ca6d);}function checkRow(_0xf6fc8b,_0x49f41c,_0x20d02a){return new BPromise(function(_0x255366,_0x4d29cb){if(_[_0xafbe('0x17')](_0xf6fc8b)){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x20d02a));}if(_0xf6fc8b[_0xafbe('0x19')]&&_0xf6fc8b[_0xafbe('0x19')][_0xafbe('0x1a')]){var _0x27ec20=_[_0xafbe('0x1b')](_0xf6fc8b[_0xafbe('0x19')],_0xafbe('0x1c'))[_0xafbe('0x1d')](';');return _0x4d29cb(handleCheckRowError('error',_0x27ec20,null,_0x20d02a));}var _0x3a8a5d={};for(var _0x301c30 in FIELDS){if(FIELDS[_0xafbe('0x1e')](_0x301c30)&&FIELDS[_0x301c30]){_0x3a8a5d[_0x301c30]=_0xf6fc8b[_0xafbe('0x1f')][0x0][FIELDS[_0x301c30]]||_0xf6fc8b[_0xafbe('0x1f')][0x0]['\ufeff'+FIELDS[_0x301c30]];}}if(!_0x3a8a5d[_0xafbe('0x20')]){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),_0xafbe('0x21'),null,_0x20d02a));}if(!_0x3a8a5d[_0xafbe('0x22')]){return _0x4d29cb(handleCheckRowError('error',_0xafbe('0x23'),null,_0x20d02a));}if(_0x3a8a5d[_0xafbe('0x24')]){var _0x21e25f=moment(_0x3a8a5d['birthDate'],'YYYY-MM-DD');if(!_0x21e25f[_0xafbe('0x25')]()){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),_0xafbe('0x26'),null,_0x20d02a));}}if(_0x3a8a5d[_0xafbe('0x27')]){if(!isEmail(_0x3a8a5d[_0xafbe('0x27')])){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),'email\x20format\x20is\x20not\x20valid!',null,_0x20d02a));}}_0x3a8a5d[_0xafbe('0x28')]=LISTID;_0x3a8a5d[_0xafbe('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xafbe('0x1a')]&&_0x49f41c){var _0x17c23a={};for(var _0x18c2ec=0x0,_0x272891=DUPLICATES['length'];_0x18c2ec<_0x272891;_0x18c2ec+=0x1){_0x17c23a[DUPLICATES[_0x18c2ec]]=_0x3a8a5d[DUPLICATES[_0x18c2ec]];}var _0xf48e2f=_['find'](_0x49f41c,_0x17c23a);if(_0xf48e2f){return _0x4d29cb(handleCheckRowError(_0xafbe('0x2a'),_0xafbe('0x2b'),_0xf48e2f,_0x20d02a));}}return db['CmContact'][_0xafbe('0x2c')](_0x3a8a5d,{'raw':!![],'hooks':![],'fields':_['keys'](_0x3a8a5d)})[_0xafbe('0x2d')](function(_0x35a1dd){if(DUPLICATES&&DUPLICATES['length']&&_0x49f41c){_0x49f41c[_0xafbe('0x2e')](_[_0xafbe('0x2f')](_0x3a8a5d,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x35a1dd['id'];return _0x255366();})[_0xafbe('0x30')](function(_0x566799){return _0x4d29cb(handleCheckRowError(_0xafbe('0x18'),_0xafbe('0x31')+(_0x566799[_0xafbe('0x1c')]||JSON[_0xafbe('0x32')](_0x566799)),null,_0x20d02a));});});}function checkHopper(){function _0x48ce95(){return function(_0x317fa1){logger[_0xafbe('0x18')]('cmContact',_0xafbe('0x33'),util['inspect'](_0x317fa1,{'showHidden':![],'depth':null}));};}var _0xaace82=function(_0x3fe9ad,_0x564c82){var _0x497d1a=squel[_0xafbe('0x34')]()[_0xafbe('0x35')](_0xafbe('0x36'))[_0xafbe('0x37')]([_0xafbe('0x22'),'scheduledAt',_0xafbe('0x38'),'ListId',_0x564c82,_0xafbe('0x39'),_0xafbe('0x3a')],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'),_0xafbe('0x22'))['field'](_0xafbe('0x3d'),'scheduledAt')['field']('id',_0xafbe('0x38'))['field'](LISTID[_0xafbe('0x3e')](),_0xafbe('0x28'))[_0xafbe('0x3c')](_0x3fe9ad['id'][_0xafbe('0x3e')](),_0x564c82)['field']('NOW()','createdAt')['field'](_0xafbe('0x3d'),_0xafbe('0x3a'))['from']('cm_contacts')[_0xafbe('0x3f')](_0xafbe('0x40'))[_0xafbe('0x3f')](_0xafbe('0x41'),LISTID['toString']())[_0xafbe('0x3f')](_0xafbe('0x42'))[_0xafbe('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xafbe('0x3c')](_0xafbe('0x22'))[_0xafbe('0x43')](_0xafbe('0x36'))[_0xafbe('0x3f')](_0x564c82+_0xafbe('0x44'),_0x3fe9ad['id'][_0xafbe('0x3e')]())))[_0xafbe('0x3e')]();return _0x497d1a;};var _0x398314=function(_0x5a9e3e,_0x456ab6){var _0x52213c=squel[_0xafbe('0x34')]()[_0xafbe('0x35')](_0xafbe('0x36'))['fromQuery'](['phone','scheduledAt',_0xafbe('0x38'),'ListId',_0x456ab6,'createdAt',_0xafbe('0x3a')],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'),_0xafbe('0x22'))[_0xafbe('0x3c')]('NOW()',_0xafbe('0x45'))[_0xafbe('0x3c')]('id',_0xafbe('0x38'))[_0xafbe('0x3c')](LISTID[_0xafbe('0x3e')](),'ListId')[_0xafbe('0x3c')](_0x5a9e3e['id'][_0xafbe('0x3e')](),_0x456ab6)['field']('NOW()',_0xafbe('0x39'))[_0xafbe('0x3c')](_0xafbe('0x3d'),_0xafbe('0x3a'))[_0xafbe('0x43')](_0xafbe('0x46'))['where'](_0xafbe('0x40'))[_0xafbe('0x3f')](_0xafbe('0x41'),LISTID[_0xafbe('0x3e')]())[_0xafbe('0x3f')](_0xafbe('0x47'),squel[_0xafbe('0x48')](hopperContacts))['where'](_0xafbe('0x42'))[_0xafbe('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0xafbe('0x3b')]()['field'](_0xafbe('0x49'))['from']('cm_hopper_final')[_0xafbe('0x3f')](_0x456ab6+_0xafbe('0x44'),_0x5a9e3e['id']['toString']()))['where'](_0xafbe('0x4a'),squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'))[_0xafbe('0x43')](_0xafbe('0x36'))[_0xafbe('0x3f')](_0x456ab6+_0xafbe('0x44'),_0x5a9e3e['id']['toString']())))['toString']();return _0x52213c;};function _0x2cc54d(_0x48c8f3,_0x102412){var _0x2c3df0=squel['insert']()[_0xafbe('0x35')](_0xafbe('0x36'))[_0xafbe('0x37')](['phone','scheduledAt',_0xafbe('0x38'),_0xafbe('0x28'),_0x102412,_0xafbe('0x39'),_0xafbe('0x3a')],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')](_0xafbe('0x22'),_0xafbe('0x22'))[_0xafbe('0x3c')](_0xafbe('0x3d'),_0xafbe('0x45'))['field']('id',_0xafbe('0x38'))[_0xafbe('0x3c')](LISTID[_0xafbe('0x3e')](),_0xafbe('0x28'))['field'](_0x48c8f3['id'][_0xafbe('0x3e')](),_0x102412)['field'](_0xafbe('0x3d'),_0xafbe('0x39'))['field']('NOW()','updatedAt')['from'](_0xafbe('0x46'))[_0xafbe('0x3f')](_0xafbe('0x40'))[_0xafbe('0x3f')]('ListId\x20=\x20?',LISTID[_0xafbe('0x3e')]())['where']('id\x20IN\x20?',squel[_0xafbe('0x48')](hopperContacts))['where'](_0xafbe('0x42')))[_0xafbe('0x3e')]();return _0x2c3df0;}function _0x949833(_0x3d33b5,_0x46d326){var _0x28d613=squel[_0xafbe('0x34')]()[_0xafbe('0x35')](_0xafbe('0x4b'))[_0xafbe('0x37')]([_0xafbe('0x22'),_0xafbe('0x38'),_0xafbe('0x28'),_0x46d326,_0xafbe('0x39'),'updatedAt'],squel[_0xafbe('0x3b')]()[_0xafbe('0x3c')]('phone','phone')[_0xafbe('0x3c')]('id',_0xafbe('0x38'))[_0xafbe('0x3c')](LISTID[_0xafbe('0x3e')](),_0xafbe('0x28'))[_0xafbe('0x3c')](_0x3d33b5['id'][_0xafbe('0x3e')](),_0x46d326)[_0xafbe('0x3c')](_0xafbe('0x3d'),'createdAt')[_0xafbe('0x3c')](_0xafbe('0x3d'),_0xafbe('0x3a'))[_0xafbe('0x43')](_0xafbe('0x46'))['where'](_0xafbe('0x40'))[_0xafbe('0x3f')](_0xafbe('0x41'),LISTID['toString']())[_0xafbe('0x3f')](_0xafbe('0x47'),squel[_0xafbe('0x48')](hopperContacts))[_0xafbe('0x3f')](_0xafbe('0x42')))['toString']();return _0x28d613;}return db[_0xafbe('0x4c')][_0xafbe('0x4d')]({'where':{'type':_0xafbe('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xafbe('0x4f')],'as':_0xafbe('0x50'),'where':{'id':LISTID}}]})[_0xafbe('0x2d')](function(_0x1d08fb){var _0x1e7c23=[];if(_0x1d08fb){var _0xaa234d;for(var _0xf2d775=0x0,_0x188ab5;_0xf2d775<_0x1d08fb[_0xafbe('0x1a')];_0xf2d775+=0x1){_0x188ab5=_0x1d08fb[_0xf2d775][_0xafbe('0x51')]({'plain':!![]});switch(_0x188ab5[_0xafbe('0x52')]){case _0xafbe('0x53'):_0x1e7c23['push'](db['sequelize'][_0xafbe('0x54')](_0x398314(_0x188ab5,'VoiceQueueId'))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;case _0xafbe('0x55'):_0x1e7c23[_0xafbe('0x2e')](db[_0xafbe('0x56')]['query'](_0xaace82(_0x188ab5,_0xafbe('0x57')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;default:_0x1e7c23['push'](db['sequelize'][_0xafbe('0x54')](_0x2cc54d(_0x188ab5,_0xafbe('0x57')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));}}}return _0x1e7c23;})[_0xafbe('0x58')]()[_0xafbe('0x2d')](function(){return db[_0xafbe('0x4c')][_0xafbe('0x4d')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xafbe('0x4f')],'as':_0xafbe('0x59'),'where':{'id':LISTID}}]})[_0xafbe('0x2d')](function(_0x16890b){var _0x105960=[];if(_0x16890b){var _0x14e696;for(var _0x16dc7d=0x0,_0x4ea165;_0x16dc7d<_0x16890b[_0xafbe('0x1a')];_0x16dc7d+=0x1){_0x4ea165=_0x16890b[_0x16dc7d][_0xafbe('0x51')]({'plain':!![]});_0x105960[_0xafbe('0x2e')](db['sequelize'][_0xafbe('0x54')](_0x949833(_0x4ea165,_0xafbe('0x57')))[_0xafbe('0x2d')](function(){})['catch'](_0x48ce95()));}}return _0x105960;})[_0xafbe('0x58')]();})[_0xafbe('0x2d')](function(){return db[_0xafbe('0x5a')][_0xafbe('0x4d')]({'attributes':['id',_0xafbe('0x52')],'include':[{'model':db['CmList'],'as':_0xafbe('0x50'),'where':{'id':LISTID}}]})[_0xafbe('0x2d')](function(_0xeee29){var _0x285d41=[];if(_0xeee29){for(var _0x4abe68=0x0,_0x4069de;_0x4abe68<_0xeee29['length'];_0x4abe68+=0x1){_0x4069de=_0xeee29[_0x4abe68]['get']({'plain':!![]});switch(_0x4069de[_0xafbe('0x52')]){case _0xafbe('0x53'):_0x285d41[_0xafbe('0x2e')](db[_0xafbe('0x56')][_0xafbe('0x54')](_0x398314(_0x4069de,_0xafbe('0x5b')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;case _0xafbe('0x55'):_0x285d41[_0xafbe('0x2e')](db[_0xafbe('0x56')][_0xafbe('0x54')](_0xaace82(_0x4069de,_0xafbe('0x5b')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));break;default:_0x285d41[_0xafbe('0x2e')](db[_0xafbe('0x56')]['query'](_0x2cc54d(_0x4069de,_0xafbe('0x5b')))[_0xafbe('0x2d')](function(){})[_0xafbe('0x30')](_0x48ce95()));}}}return _0x285d41;})[_0xafbe('0x58')]();})[_0xafbe('0x2d')](function(){return db[_0xafbe('0x5a')][_0xafbe('0x4d')]({'attributes':['id'],'include':[{'model':db[_0xafbe('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x8fb6d0){var _0x2c5192=[];if(_0x8fb6d0){for(var _0x3b8ba2=0x0,_0x56f694;_0x3b8ba2<_0x8fb6d0[_0xafbe('0x1a')];_0x3b8ba2+=0x1){_0x56f694=_0x8fb6d0[_0x3b8ba2][_0xafbe('0x51')]({'plain':!![]});_0x2c5192[_0xafbe('0x2e')](db[_0xafbe('0x56')][_0xafbe('0x54')](_0x949833(_0x56f694,_0xafbe('0x5b')))['then'](function(){})[_0xafbe('0x30')](_0x48ce95()));}}return _0x2c5192;})[_0xafbe('0x58')]();})[_0xafbe('0x30')](function(_0x9eea1d){logger[_0xafbe('0x18')](_0xafbe('0x5c'),_0xafbe('0x5d'),_0x9eea1d[_0xafbe('0x1c')]);});}var processPromises=function(_0x10cb9d){return BPromise['all'](promises)[_0xafbe('0x2d')](function(_0x592a84){})[_0xafbe('0x30')](function(_0x278ae9){logger['error'](_0xafbe('0x5e'),JSON[_0xafbe('0x32')](_0x278ae9));})['finally'](function(){socket[_0xafbe('0x5f')](_0xafbe('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x10cb9d){return _0x10cb9d[_0xafbe('0x61')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xafbe('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xafbe('0x2d')](function(){socket[_0xafbe('0x5f')](_0xafbe('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xafbe('0x62')](FILEPATH);}catch(_0x109286){logger[_0xafbe('0x18')](_0xafbe('0x63'),JSON[_0xafbe('0x32')](_0x109286));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xafbe('0x64')]()[_0xafbe('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xafbe('0x11')](',');return db[_0xafbe('0x65')][_0xafbe('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xafbe('0x2d')](function(_0x4cd321){var _0x51d207=fs[_0xafbe('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xafbe('0x67')](_0x51d207,{'header':!![],'skipEmptyLines':!![],'step':function(_0x121b7d,_0x45726d){total+=0x1;var _0x23d11a=total;promises['push'](checkRow(_0x121b7d,_0x4cd321,_0x23d11a)['then'](function(){success+=0x1;})[_0xafbe('0x30')](function(_0x2b9e1f){if(_0x2b9e1f[_0xafbe('0x18')]){errors+=0x1;delete _0x2b9e1f[_0xafbe('0x18')];}else if(_0x2b9e1f[_0xafbe('0x2a')]){duplicates+=0x1;delete _0x2b9e1f[_0xafbe('0x2a')];}rows[_0xafbe('0x2e')](_0x2b9e1f);}));if(total%0xc8===0x0){_0x45726d[_0xafbe('0x68')]();return processPromises(_0x45726d);}},'complete':function(){return processPromises()[_0xafbe('0x2d')](function(){logger['info'](_0xafbe('0x69'));endCsv();});},'error':function(_0x57d651,_0x444004){logger[_0xafbe('0x6a')](_0xafbe('0x6b'),JSON[_0xafbe('0x32')](_0x57d651));endCsv();}});})[_0xafbe('0x30')](function(_0x2ca5e4){logger[_0xafbe('0x18')](_0xafbe('0x6c'),JSON[_0xafbe('0x32')](_0x2ca5e4));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index e120681..8edb862 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 _0x13d4=['MIN(id)','min_id','group','info','error','message','errors','code','sequelize','query','push','catch','main','stringify','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','hasOwnProperty','data','replace','isValid','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_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','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','each','then','finish','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','select','phone','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.UserId','into','cm_hopper','fromQuery','scheduledat','ListId','createdAt','UserId','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.updatedAt','insert','cm_hopper_black','ContactId','cm_contacts.createdAt\x20=\x20?','field','concat','keys','CompanyId','updatedAt','fields',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?'];(function(_0x47e4ce,_0x5389bf){var _0x388765=function(_0xd7c734){while(--_0xd7c734){_0x47e4ce['push'](_0x47e4ce['shift']());}};_0x388765(++_0x5389bf);}(_0x13d4,0x1ca));var _0x413d=function(_0x4e9038,_0x347083){_0x4e9038=_0x4e9038-0x0;var _0x1002cc=_0x13d4[_0x4e9038];return _0x1002cc;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x413d('0x0'));var Papa=require(_0x413d('0x1'));var util=require('util');var BPromise=require(_0x413d('0x2'));var moment=require(_0x413d('0x3'));var squel=require(_0x413d('0x4'));var Redis=require('ioredis');var db=require(_0x413d('0x5'))['db'];var config=require(_0x413d('0x6'));var logger=require(_0x413d('0x7'))(_0x413d('0x8'));config[_0x413d('0x9')]=_[_0x413d('0xa')](config[_0x413d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x413d('0xb'))(new Redis(config[_0x413d('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x413d('0xc')](_0x413d('0xd'));function isEmail(_0x2195be){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x2195be);}function selectNotIn(_0x51c455,_0x47ff48,_0x5bad73,_0x1722de,_0x4e2ef4){return squel[_0x413d('0xe')]()['field'](_0x413d('0xf'))[_0x413d('0x10')](_0x1722de)['join'](_0x47ff48,null,_0x47ff48+_0x413d('0x11')+_0x1722de+'.'+_0x5bad73)['where'](_0x1722de+'.'+_0x5bad73+_0x413d('0x12')+_0x51c455+'.'+_0x5bad73)[_0x413d('0x13')](_0x47ff48+_0x413d('0x14')+_0x4e2ef4[_0x413d('0x15')]()+')');}function insertCmHopper(_0x15dadc,_0x415a94,_0x454070,_0x2bcaff,_0x568b5d){var _0x2f444b=[_0x413d('0x16'),_0x413d('0x17'),_0x413d('0x18'),_0x413d('0x19'),_0x415a94+'.'+_0x2bcaff,_0x413d('0x1a'),'cm_contacts.updatedAt','cm_contacts.priority',_0x413d('0x1b'),'\x22'+_0x568b5d+'\x22'];return squel['insert']()[_0x413d('0x1c')](_0x413d('0x1d'))[_0x413d('0x1e')](['phone',_0x413d('0x1f'),'ContactId',_0x413d('0x20'),_0x2bcaff,_0x413d('0x21'),'updatedAt','priority',_0x413d('0x22'),_0x413d('0x23')],squel[_0x413d('0xe')]()['fields'](_0x2f444b)[_0x413d('0x10')](_0x415a94)['join'](_0x413d('0x24'),null,_0x413d('0x25')+_0x415a94+_0x413d('0x26'))[_0x413d('0x15')](_0x454070,null,_0x454070+_0x413d('0x11')+_0x415a94+'.'+_0x2bcaff)[_0x413d('0x13')](_0x415a94+_0x413d('0x27'),_0x15dadc)[_0x413d('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x413d('0x28'),selectNotIn(_0x415a94,_0x454070,_0x2bcaff,_0x413d('0x1d'),[_0x413d('0x29'),'\x22onlyIfOpen\x22']))[_0x413d('0x13')](_0x413d('0x28'),selectNotIn(_0x415a94,_0x454070,_0x2bcaff,_0x413d('0x1d'),['\x22always\x22'])))[_0x413d('0x2a')]();}function insertCmHopperBlack(_0x49428e,_0x2c7385,_0x1abf03,_0x3b4fa6){var _0x2e26eb=['cm_contacts.phone',_0x413d('0x18'),_0x413d('0x19'),_0x2c7385+'.'+_0x3b4fa6,'cm_contacts.createdAt',_0x413d('0x2b')];return squel[_0x413d('0x2c')]()['into'](_0x413d('0x2d'))[_0x413d('0x1e')](['phone',_0x413d('0x2e'),_0x413d('0x20'),_0x3b4fa6,_0x413d('0x21'),'updatedAt'],squel['select']()['fields'](_0x2e26eb)[_0x413d('0x10')](_0x2c7385)[_0x413d('0x15')](_0x413d('0x24'),null,_0x413d('0x25')+_0x2c7385+'.CmListId')[_0x413d('0x15')](_0x1abf03,null,_0x1abf03+'.id\x20=\x20'+_0x2c7385+'.'+_0x3b4fa6)[_0x413d('0x13')](_0x2c7385+_0x413d('0x27'),_0x49428e)[_0x413d('0x13')](_0x413d('0x2f'),NOW)['where'](_0x413d('0x28'),squel[_0x413d('0xe')]()[_0x413d('0x30')]('phone')[_0x413d('0x10')](_0x413d('0x2d'))[_0x413d('0x13')]('ListId\x20=\x20?',_0x49428e)['where'](_0x3b4fa6+'\x20=\x20?',_0x2c7385+'.'+_0x3b4fa6)))[_0x413d('0x2a')]();}function insertCmContact(_0x38cbd7,_0x2b9040,_0xb3cfd5,_0x1e4b3a){var _0x16c812=_[_0x413d('0x31')](_[_0x413d('0x32')](_0x1e4b3a),[_0x413d('0x20'),_0x413d('0x33'),_0x413d('0x21'),_0x413d('0x34')]);return squel[_0x413d('0x2c')]()[_0x413d('0x1c')](_0x413d('0x24'))[_0x413d('0x1e')](_0x16c812,squel[_0x413d('0xe')]()[_0x413d('0x35')](_0x16c812)['from'](_0x2b9040)['where']('('+_0xb3cfd5[_0x413d('0x15')](',')+_0x413d('0x36'),squel[_0x413d('0xe')]()[_0x413d('0x35')](_0xb3cfd5)[_0x413d('0x10')]('cm_contacts')['where'](_0x413d('0x37'),_0x38cbd7)[_0x413d('0x13')](_0x413d('0x38')))[_0x413d('0x13')](_0x413d('0x39'),squel[_0x413d('0xe')]()[_0x413d('0x30')](_0x413d('0x3a'),_0x413d('0x3b'))['from'](_0x2b9040)[_0x413d('0x3c')](_0xb3cfd5['join'](','))))[_0x413d('0x2a')]();}function handleStop(){logger[_0x413d('0x3d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2c2932){logger[_0x413d('0x3e')](_0x2c2932[_0x413d('0x3f')]);process['exit'](0x1);}function handleError(_0x392fde,_0x21aba3){stats[_0x413d('0x40')]['push']({'name':_0x21aba3[_0x413d('0x41')],'message':_0x21aba3[_0x413d('0x3f')],'row':_0x392fde});}function handleQuery(_0x157463){logger[_0x413d('0x3d')](_0x157463);return db[_0x413d('0x42')][_0x413d('0x43')](_0x157463)['spread'](function(_0x513610){results[_0x413d('0x44')](_0x513610);})[_0x413d('0x45')](function(_0x1a040f){logger['error'](_0x1a040f[_0x413d('0x3f')]);});}function main(_0x6a8e2e,_0x390838,_0x3af2d9,_0x22ce07){logger['info'](_0x413d('0x46'),_0x6a8e2e,JSON[_0x413d('0x47')](_0x390838));process['send']('start');var _0x3e1e83=_0x390838[_0x413d('0x48')];var _0x1c815c=_0x390838[_0x413d('0x49')];var _0x2321d5=path['join'](config[_0x413d('0x4a')],_0x413d('0x4b'),_0x1c815c+_0x413d('0x4c'));var _0x1a5a7a=_[_0x413d('0x32')](_0x3e1e83)['join']();logger['info'](_0x413d('0x4d'),_0x1a5a7a);fs[_0x413d('0x4e')](_0x2321d5,_0x1a5a7a+'\x0a');Papa[_0x413d('0x4f')](fs[_0x413d('0x50')](_0x6a8e2e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x32ccfd,_0x48842d){try{for(var _0x1bf11a=0x0,_0x4c1652=[];_0x1bf11a<_0x32ccfd['data'][_0x413d('0x51')];_0x1bf11a++){stats['rows']+=0x1;if(_0x32ccfd[_0x413d('0x40')][_0x1bf11a]){handleError(_0x32ccfd['data'][_0x1bf11a],_0x32ccfd[_0x413d('0x40')][_0x1bf11a]);}else{var _0x451c7b=[];for(var _0x5546d1 in _0x3e1e83){if(_0x3e1e83[_0x413d('0x52')](_0x5546d1)){if(_0x32ccfd[_0x413d('0x53')][_0x1bf11a][_0x3e1e83[_0x5546d1]]){var _0x1104f1=_['trim'](_0x32ccfd['data'][_0x1bf11a][_0x3e1e83[_0x5546d1]][_0x413d('0x54')](/"/g,'\x27'));switch(_0x5546d1){case _0x413d('0x1f'):var _0x52fe87=moment(_0x1104f1,_0x413d('0xd'),!![]);if(_0x52fe87[_0x413d('0x55')]()){_0x4c1652[_0x413d('0x44')]('\x22'+_0x1104f1+'\x22');}else{_0x451c7b[_0x413d('0x44')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x45755b=parseInt(_0x1104f1);_0x1104f1=_['isNaN'](_0x45755b)||_0x45755b<0x0||_0x45755b>0x4?_0x22ce07?0x3:0x2:_0x45755b;_0x4c1652[_0x413d('0x44')]('\x22'+_0x1104f1+'\x22');break;case _0x413d('0x22'):var _0x36d43b=parseInt(_0x1104f1);if(_[_0x413d('0x56')](_0x36d43b)&&_[_0x413d('0x57')](_0x3af2d9,_0x36d43b)){_0x4c1652[_0x413d('0x44')]('\x22'+_0x36d43b+'\x22');}else{_0x451c7b[_0x413d('0x44')]('agent\x20not\x20exists');}break;case _0x413d('0x58'):if(isEmail(_0x1104f1)){_0x4c1652[_0x413d('0x44')]('\x22'+_0x1104f1+'\x22');}else{_0x451c7b[_0x413d('0x44')](_0x413d('0x59'));}break;case _0x413d('0x5a'):var _0x128571=moment(_0x1104f1,'YYYY-MM-DD',!![]);if(_0x128571[_0x413d('0x55')]()){_0x4c1652['push']('\x22'+_0x1104f1+'\x22');}else{_0x451c7b[_0x413d('0x44')](_0x413d('0x5b'));}break;default:_0x4c1652[_0x413d('0x44')]('\x22'+_0x1104f1+'\x22');}}else{switch(_0x5546d1){case _0x413d('0x5c'):case _0x413d('0xf'):_0x451c7b[_0x413d('0x44')](_0x5546d1+_0x413d('0x5d'));break;default:_0x4c1652[_0x413d('0x44')]('\x22\x22');}}}}if(_0x451c7b[_0x413d('0x51')]){handleError(_0x32ccfd[_0x413d('0x53')][_0x1bf11a],{'code':_0x413d('0x5e'),'message':_0x451c7b[_0x413d('0x15')]()});}else{fs[_0x413d('0x5f')](_0x2321d5,_0x4c1652['join']()+'\x0a');}_0x4c1652=[];}if(!(stats[_0x413d('0x60')]%0xc8)){socket[_0x413d('0x61')](_0x413d('0x62')+_0x1c815c,stats);stats[_0x413d('0x40')]=[];}}if(stopped){logger[_0x413d('0x3d')](_0x413d('0x63'));_0x48842d[_0x413d('0x64')]();}}catch(_0x4c1900){handleError(_0x32ccfd[_0x413d('0x53')][_0x1bf11a],{'code':'SystemError','message':_0x4c1900['message']});logger[_0x413d('0x3e')](_0x413d('0x65'),_0x4c1900[_0x413d('0x3f')]);}},'complete':function(){try{var _0x26dc47=[];var _0x43e20a=_0x413d('0x24');if(_0x390838[_0x413d('0x66')]&&_0x390838['duplicates']['length']){_0x43e20a='cm_contacts_'+_0x1c815c;_0x26dc47['push'](_0x413d('0x67')+_0x43e20a+_0x413d('0x68'));}var _0x4e6c63=util[_0x413d('0xc')](_0x413d('0x69'),_0x2321d5,_0x43e20a,_0x1a5a7a,_0x390838['ListId'],_0x390838[_0x413d('0x33')]||null,NOW,NOW);if(_[_0x413d('0x6a')](_0x3e1e83['scheduledat'])){_0x4e6c63+=',\x20scheduledAt\x20=\x20NOW()';}_0x26dc47[_0x413d('0x44')](_0x4e6c63);if(_0x390838['duplicates']&&_0x390838[_0x413d('0x66')][_0x413d('0x51')]){_0x26dc47[_0x413d('0x44')](insertCmContact(_0x390838[_0x413d('0x20')],_0x43e20a,_0x390838[_0x413d('0x66')],_0x3e1e83));_0x26dc47['push'](_0x413d('0x6b')+_0x43e20a+';');}_0x26dc47[_0x413d('0x44')](insertCmHopper(_0x390838[_0x413d('0x20')],'voice_queues_has_cm_lists',_0x413d('0x6c'),_0x413d('0x6d'),_0x22ce07));_0x26dc47[_0x413d('0x44')](insertCmHopperBlack(_0x390838[_0x413d('0x20')],_0x413d('0x6e'),_0x413d('0x6c'),_0x413d('0x6d')));_0x26dc47[_0x413d('0x44')](insertCmHopper(_0x390838[_0x413d('0x20')],_0x413d('0x6f'),_0x413d('0x70'),_0x413d('0x71'),_0x22ce07));_0x26dc47['push'](insertCmHopperBlack(_0x390838['ListId'],'campaigns_has_cm_blacklists','campaigns',_0x413d('0x71')));BPromise[_0x413d('0x72')](_0x26dc47,handleQuery)[_0x413d('0x73')](function(_0x18aad3){stats[_0x413d('0x74')]=!![];stats[_0x413d('0x75')]=_0x390838[_0x413d('0x66')]&&_0x390838[_0x413d('0x66')]['length']?results[0x2]['affectedRows']:results[0x0][_0x413d('0x75')];socket[_0x413d('0x61')](_0x413d('0x62')+_0x1c815c,stats);fs['unlink'](_0x6a8e2e);fs[_0x413d('0x76')](_0x2321d5);process[_0x413d('0x77')](0x0);})[_0x413d('0x45')](function(_0x4b16ea){logger[_0x413d('0x3e')](_0x4b16ea['message']);process['exit'](0x1);});}catch(_0x42e373){logger[_0x413d('0x3e')](_0x413d('0x78'),_0x42e373[_0x413d('0x3f')]);process[_0x413d('0x77')](0x1);}},'error':function(_0x22c1fc,_0x9b1ae8,_0x2c86e9,_0x43fd96){throw new Error(_0x43fd96);}});}function validate(){if(process[_0x413d('0x79')]&&process['argv']['length']<0x4){throw new Error(_0x413d('0x7a'));}var _0xd47e32=path[_0x413d('0x15')](config[_0x413d('0x4a')],_0x413d('0x4b'),process['argv'][0x2]);if(!fs['existsSync'](_0xd47e32)){throw new Error(_0x413d('0x7b'));}var _0x17483d={};try{_0x17483d=JSON[_0x413d('0x4f')](process['argv'][0x3]);if(!_0x17483d[_0x413d('0x48')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x17483d[_0x413d('0x48')][_0x413d('0xf')]){throw new Error(_0x413d('0x7c'));}if(!_0x17483d[_0x413d('0x48')][_0x413d('0x5c')]){throw new Error(_0x413d('0x7d'));}var _0x499fc3=0x0;if(_0x17483d[_0x413d('0x48')][_0x413d('0x22')]){_0x499fc3=0x1;}if(!_0x17483d[_0x413d('0x20')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0x10bf4f){throw new Error(_0x413d('0x7e'));}var _0x585980=[];try{_0x585980=_[_0x413d('0x7f')](JSON[_0x413d('0x4f')](process[_0x413d('0x79')][0x4]),'id');}catch(_0x230375){logger[_0x413d('0x3d')]('No\x20agent\x20available');}main(_0xd47e32,_0x17483d,_0x585980,_0x499fc3);}validate();process['on'](_0x413d('0x80'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x519c=['LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','updatedAt','priority','UserId','recallme','select','fields','join','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper_black','createdAt','cm_contacts','cm_contacts.ListId\x20=\x20','ListId\x20=\x20?','\x20=\x20?','toString','keys','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','exit','errors','code','query','spread','push','catch','message','stringify','send','binding','socket_timestamp','.csv','writeFileSync','parse','data','length','rows','hasOwnProperty','trim','scheduledat','isNaN','isNumber','includes','agent\x20not\x20exists','email','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20'];(function(_0xe0b86c,_0x1b16dc){var _0xf607e3=function(_0x2c7cf1){while(--_0x2c7cf1){_0xe0b86c['push'](_0xe0b86c['shift']());}};_0xf607e3(++_0x1b16dc);}(_0x519c,0x19f));var _0xc519=function(_0x427faa,_0x4760d6){_0x427faa=_0x427faa-0x0;var _0x5420f3=_0x519c[_0x427faa];return _0x5420f3;};'use strict';var fs=require('fs');var path=require(_0xc519('0x0'));var _=require(_0xc519('0x1'));var Papa=require(_0xc519('0x2'));var util=require(_0xc519('0x3'));var BPromise=require(_0xc519('0x4'));var moment=require(_0xc519('0x5'));var squel=require(_0xc519('0x6'));var Redis=require('ioredis');var db=require(_0xc519('0x7'))['db'];var config=require(_0xc519('0x8'));var logger=require(_0xc519('0x9'))(_0xc519('0xa'));config['redis']=_[_0xc519('0xb')](config[_0xc519('0xc')],{'host':_0xc519('0xd'),'port':0x18eb});var socket=require(_0xc519('0xe'))(new Redis(config[_0xc519('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xc519('0xf'));function isEmail(_0x512495){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))*$/[_0xc519('0x10')](_0x512495);}function selectNotIn(_0x153ef6,_0x3f5f65,_0x12bc59,_0x5f28e2,_0xde3ac2){return squel['select']()[_0xc519('0x11')]('phone')[_0xc519('0x12')](_0x5f28e2)['join'](_0x3f5f65,null,_0x3f5f65+_0xc519('0x13')+_0x5f28e2+'.'+_0x12bc59)[_0xc519('0x14')](_0x5f28e2+'.'+_0x12bc59+_0xc519('0x15')+_0x153ef6+'.'+_0x12bc59)['where'](_0x3f5f65+_0xc519('0x16')+_0xde3ac2['join']()+')');}function insertCmHopper(_0x489387,_0x3ddde4,_0x41dce5,_0x551be4,_0x3871e8){var _0x124087=[_0xc519('0x17'),_0xc519('0x18'),_0xc519('0x19'),_0xc519('0x1a'),_0x3ddde4+'.'+_0x551be4,_0xc519('0x1b'),_0xc519('0x1c'),_0xc519('0x1d'),'cm_contacts.UserId','\x22'+_0x3871e8+'\x22'];return squel[_0xc519('0x1e')]()[_0xc519('0x1f')](_0xc519('0x20'))[_0xc519('0x21')]([_0xc519('0x22'),'scheduledat',_0xc519('0x23'),_0xc519('0x24'),_0x551be4,'createdAt',_0xc519('0x25'),_0xc519('0x26'),_0xc519('0x27'),_0xc519('0x28')],squel[_0xc519('0x29')]()[_0xc519('0x2a')](_0x124087)[_0xc519('0x12')](_0x3ddde4)[_0xc519('0x2b')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x3ddde4+_0xc519('0x2c'))[_0xc519('0x2b')](_0x41dce5,null,_0x41dce5+'.id\x20=\x20'+_0x3ddde4+'.'+_0x551be4)[_0xc519('0x14')](_0x3ddde4+_0xc519('0x2d'),_0x489387)[_0xc519('0x14')](_0xc519('0x2e'),NOW)[_0xc519('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3ddde4,_0x41dce5,_0x551be4,'cm_hopper',['\x22always\x22','\x22onlyIfOpen\x22']))[_0xc519('0x14')](_0xc519('0x2f'),selectNotIn(_0x3ddde4,_0x41dce5,_0x551be4,_0xc519('0x20'),['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x2bdd35,_0x20aaa5,_0x49d6bc,_0xbd4957){var _0x459e5e=['cm_contacts.phone',_0xc519('0x19'),_0xc519('0x1a'),_0x20aaa5+'.'+_0xbd4957,_0xc519('0x1b'),'cm_contacts.updatedAt'];return squel[_0xc519('0x1e')]()[_0xc519('0x1f')](_0xc519('0x30'))[_0xc519('0x21')]([_0xc519('0x22'),_0xc519('0x23'),_0xc519('0x24'),_0xbd4957,_0xc519('0x31'),'updatedAt'],squel['select']()[_0xc519('0x2a')](_0x459e5e)[_0xc519('0x12')](_0x20aaa5)['join'](_0xc519('0x32'),null,_0xc519('0x33')+_0x20aaa5+_0xc519('0x2c'))[_0xc519('0x2b')](_0x49d6bc,null,_0x49d6bc+_0xc519('0x13')+_0x20aaa5+'.'+_0xbd4957)['where'](_0x20aaa5+_0xc519('0x2d'),_0x2bdd35)[_0xc519('0x14')](_0xc519('0x2e'),NOW)[_0xc519('0x14')](_0xc519('0x2f'),squel[_0xc519('0x29')]()['field'](_0xc519('0x22'))['from'](_0xc519('0x30'))[_0xc519('0x14')](_0xc519('0x34'),_0x2bdd35)['where'](_0xbd4957+_0xc519('0x35'),_0x20aaa5+'.'+_0xbd4957)))[_0xc519('0x36')]();}function insertCmContact(_0x4d5b49,_0x26079f,_0x596c51,_0x10705b){var _0x871e97=_['concat'](_[_0xc519('0x37')](_0x10705b),['ListId','CompanyId',_0xc519('0x31'),_0xc519('0x25')]);return squel[_0xc519('0x1e')]()[_0xc519('0x1f')]('cm_contacts')[_0xc519('0x21')](_0x871e97,squel['select']()[_0xc519('0x2a')](_0x871e97)['from'](_0x26079f)[_0xc519('0x14')]('('+_0x596c51['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xc519('0x29')]()['fields'](_0x596c51)[_0xc519('0x12')](_0xc519('0x32'))[_0xc519('0x14')](_0xc519('0x34'),_0x4d5b49)[_0xc519('0x14')]('deletedAt\x20IS\x20NULL'))[_0xc519('0x14')](_0xc519('0x38'),squel[_0xc519('0x29')]()[_0xc519('0x11')](_0xc519('0x39'),'min_id')[_0xc519('0x12')](_0x26079f)[_0xc519('0x3a')](_0x596c51[_0xc519('0x2b')](','))))[_0xc519('0x36')]();}function handleStop(){logger[_0xc519('0x3b')](_0xc519('0x3c'));stopped=!![];}function handleUncaughtException(_0xd6520d){logger[_0xc519('0x3d')](_0xd6520d['message']);process[_0xc519('0x3e')](0x1);}function handleError(_0x30ec0a,_0x45f4c1){stats[_0xc519('0x3f')]['push']({'name':_0x45f4c1[_0xc519('0x40')],'message':_0x45f4c1['message'],'row':_0x30ec0a});}function handleQuery(_0x20a4f1){logger['info'](_0x20a4f1);return db['sequelize'][_0xc519('0x41')](_0x20a4f1)[_0xc519('0x42')](function(_0x4f849e){results[_0xc519('0x43')](_0x4f849e);})[_0xc519('0x44')](function(_0x453748){logger[_0xc519('0x3d')](_0x453748[_0xc519('0x45')]);});}function main(_0x34770e,_0x13c7a8,_0xf8fefe,_0x1175f4){logger[_0xc519('0x3b')]('main',_0x34770e,JSON[_0xc519('0x46')](_0x13c7a8));process[_0xc519('0x47')]('start');var _0x3b6016=_0x13c7a8[_0xc519('0x48')];var _0x40e18b=_0x13c7a8[_0xc519('0x49')];var _0x42b40b=path[_0xc519('0x2b')](config['root'],'server/files/tmp',_0x40e18b+_0xc519('0x4a'));var _0x56826f=_[_0xc519('0x37')](_0x3b6016)['join']();logger[_0xc519('0x3b')]('header',_0x56826f);fs[_0xc519('0x4b')](_0x42b40b,_0x56826f+'\x0a');Papa[_0xc519('0x4c')](fs['createReadStream'](_0x34770e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x883abd,_0x224f7d){try{for(var _0x2a24c1=0x0,_0x1985a5=[];_0x2a24c1<_0x883abd[_0xc519('0x4d')][_0xc519('0x4e')];_0x2a24c1++){stats[_0xc519('0x4f')]+=0x1;if(_0x883abd[_0xc519('0x3f')][_0x2a24c1]){handleError(_0x883abd[_0xc519('0x4d')][_0x2a24c1],_0x883abd[_0xc519('0x3f')][_0x2a24c1]);}else{var _0x20e03d=[];for(var _0x1b7cbf in _0x3b6016){if(_0x3b6016[_0xc519('0x50')](_0x1b7cbf)){if(_0x883abd[_0xc519('0x4d')][_0x2a24c1][_0x3b6016[_0x1b7cbf]]){var _0x353170=_[_0xc519('0x51')](_0x883abd[_0xc519('0x4d')][_0x2a24c1][_0x3b6016[_0x1b7cbf]]['replace'](/"/g,'\x27'));switch(_0x1b7cbf){case _0xc519('0x52'):var _0x31699b=moment(_0x353170,_0xc519('0xf'),!![]);if(_0x31699b['isValid']()){_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}else{_0x20e03d[_0xc519('0x43')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xc519('0x26'):var _0x1afcdf=parseInt(_0x353170);_0x353170=_[_0xc519('0x53')](_0x1afcdf)||_0x1afcdf<0x0||_0x1afcdf>0x4?_0x1175f4?0x3:0x2:_0x1afcdf;_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');break;case'UserId':var _0x4ea7cc=parseInt(_0x353170);if(_[_0xc519('0x54')](_0x4ea7cc)&&_[_0xc519('0x55')](_0xf8fefe,_0x4ea7cc)){_0x1985a5[_0xc519('0x43')]('\x22'+_0x4ea7cc+'\x22');}else{_0x20e03d['push'](_0xc519('0x56'));}break;case _0xc519('0x57'):if(isEmail(_0x353170)){_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}else{_0x20e03d[_0xc519('0x43')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x27d2ed=moment(_0x353170,_0xc519('0x58'),!![]);if(_0x27d2ed[_0xc519('0x59')]()){_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}else{_0x20e03d[_0xc519('0x43')](_0xc519('0x5a'));}break;default:_0x1985a5[_0xc519('0x43')]('\x22'+_0x353170+'\x22');}}else{switch(_0x1b7cbf){case _0xc519('0x5b'):case _0xc519('0x22'):_0x20e03d[_0xc519('0x43')](_0x1b7cbf+_0xc519('0x5c'));break;default:_0x1985a5['push']('\x22\x22');}}}}if(_0x20e03d[_0xc519('0x4e')]){handleError(_0x883abd[_0xc519('0x4d')][_0x2a24c1],{'code':_0xc519('0x5d'),'message':_0x20e03d[_0xc519('0x2b')]()});}else{fs[_0xc519('0x5e')](_0x42b40b,_0x1985a5[_0xc519('0x2b')]()+'\x0a');}_0x1985a5=[];}if(!(stats[_0xc519('0x4f')]%0xc8)){socket[_0xc519('0x5f')]('contact:import:'+_0x40e18b,stats);stats[_0xc519('0x3f')]=[];}}if(stopped){logger['info'](_0xc519('0x60'));_0x224f7d[_0xc519('0x61')]();}}catch(_0x58dea0){handleError(_0x883abd[_0xc519('0x4d')][_0x2a24c1],{'code':'SystemError','message':_0x58dea0[_0xc519('0x45')]});logger['error']('step',_0x58dea0[_0xc519('0x45')]);}},'complete':function(){try{var _0x122407=[];var _0x117a9a=_0xc519('0x32');if(_0x13c7a8[_0xc519('0x62')]&&_0x13c7a8['duplicates']['length']){_0x117a9a=_0xc519('0x63')+_0x40e18b;_0x122407['push'](_0xc519('0x64')+_0x117a9a+'\x20LIKE\x20cm_contacts;');}var _0x24a934=util['format'](_0xc519('0x65'),_0x42b40b,_0x117a9a,_0x56826f,_0x13c7a8[_0xc519('0x24')],_0x13c7a8[_0xc519('0x66')]||null,NOW,NOW);if(_[_0xc519('0x67')](_0x3b6016[_0xc519('0x52')])){_0x24a934+=_0xc519('0x68');}_0x122407[_0xc519('0x43')](_0x24a934);if(_0x13c7a8[_0xc519('0x62')]&&_0x13c7a8[_0xc519('0x62')][_0xc519('0x4e')]){_0x122407[_0xc519('0x43')](insertCmContact(_0x13c7a8[_0xc519('0x24')],_0x117a9a,_0x13c7a8['duplicates'],_0x3b6016));_0x122407[_0xc519('0x43')](_0xc519('0x69')+_0x117a9a+';');}_0x122407[_0xc519('0x43')](insertCmHopper(_0x13c7a8[_0xc519('0x24')],_0xc519('0x6a'),'voice_queues',_0xc519('0x6b'),_0x1175f4));_0x122407[_0xc519('0x43')](insertCmHopperBlack(_0x13c7a8[_0xc519('0x24')],_0xc519('0x6c'),'voice_queues',_0xc519('0x6b')));_0x122407['push'](insertCmHopper(_0x13c7a8[_0xc519('0x24')],_0xc519('0x6d'),_0xc519('0x6e'),_0xc519('0x6f'),_0x1175f4));_0x122407[_0xc519('0x43')](insertCmHopperBlack(_0x13c7a8[_0xc519('0x24')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));BPromise['each'](_0x122407,handleQuery)['then'](function(_0x56e9b2){stats[_0xc519('0x70')]=!![];stats['affectedRows']=_0x13c7a8[_0xc519('0x62')]&&_0x13c7a8['duplicates']['length']?results[0x2][_0xc519('0x71')]:results[0x0]['affectedRows'];socket[_0xc519('0x5f')](_0xc519('0x72')+_0x40e18b,stats);fs[_0xc519('0x73')](_0x34770e);fs[_0xc519('0x73')](_0x42b40b);process[_0xc519('0x3e')](0x0);})['catch'](function(_0x33aa72){logger[_0xc519('0x3d')](_0x33aa72['message']);process[_0xc519('0x3e')](0x1);});}catch(_0x11daa2){logger[_0xc519('0x3d')](_0xc519('0x74'),_0x11daa2[_0xc519('0x45')]);process[_0xc519('0x3e')](0x1);}},'error':function(_0x1d71b3,_0x508a72,_0x49c159,_0x20821a){throw new Error(_0x20821a);}});}function validate(){if(process[_0xc519('0x75')]&&process[_0xc519('0x75')]['length']<0x4){throw new Error(_0xc519('0x76'));}var _0x3736b7=path[_0xc519('0x2b')](config[_0xc519('0x77')],'server/files/tmp',process[_0xc519('0x75')][0x2]);if(!fs[_0xc519('0x78')](_0x3736b7)){throw new Error(_0xc519('0x79'));}var _0x47f51b={};try{_0x47f51b=JSON['parse'](process['argv'][0x3]);if(!_0x47f51b[_0xc519('0x48')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x47f51b[_0xc519('0x48')][_0xc519('0x22')]){throw new Error(_0xc519('0x7a'));}if(!_0x47f51b[_0xc519('0x48')]['firstName']){throw new Error(_0xc519('0x7b'));}var _0x29bd73=0x0;if(_0x47f51b[_0xc519('0x48')][_0xc519('0x27')]){_0x29bd73=0x1;}if(!_0x47f51b[_0xc519('0x24')]){throw new Error(_0xc519('0x7c'));}}catch(_0x45dbf5){throw new Error(_0xc519('0x7d'));}var _0x36a913=[];try{_0x36a913=_[_0xc519('0x7e')](JSON[_0xc519('0x4c')](process['argv'][0x4]),'id');}catch(_0x315b30){logger['info'](_0xc519('0x7f'));}main(_0x3736b7,_0x47f51b,_0x36a913,_0x29bd73);}validate();process['on'](_0xc519('0x80'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index a3fa9cb..a08d018 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 _0xed1e=['Date','starttime','Answer\x20Time','answertime','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','voice','variable','push','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','toLowerCase','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','calleridname','Call\x20To','destexten','queue','uniqueid','agentcalledAt','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Connect','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId'];(function(_0x52c82f,_0xe6b2ef){var _0x25d738=function(_0x477974){while(--_0x477974){_0x52c82f['push'](_0x52c82f['shift']());}};_0x25d738(++_0xe6b2ef);}(_0xed1e,0x127));var _0xeed1=function(_0x248703,_0xa58c07){_0x248703=_0x248703-0x0;var _0x12daa9=_0xed1e[_0x248703];return _0x12daa9;};'use strict';exports['getSubjects']=function(_0x8dfc18,_0x18b081){var _0x23a60d=[{'type':_0xeed1('0x0'),'content':_0xeed1('0x1'),'variableName':null}];switch(_0x8dfc18['toLowerCase']()){case _0xeed1('0x2'):switch(_0x18b081['toLowerCase']()){case'inbound':_0x23a60d['push']({'type':_0xeed1('0x3'),'content':'','variableName':'queue'});_0x23a60d[_0xeed1('0x4')]({'type':'variable','content':'','variableName':_0xeed1('0x5')});break;case _0xeed1('0x6'):_0x23a60d[_0xeed1('0x4')]({'type':'string','content':_0xeed1('0x7'),'variableName':null});_0x23a60d[_0xeed1('0x4')]({'type':'variable','content':'','variableName':_0xeed1('0x8')});break;}}return _0x23a60d;};exports[_0xeed1('0x9')]=function(_0x15cdb1,_0xf38026){var _0x38dd1d=[];switch(_0x15cdb1['toLowerCase']()){case _0xeed1('0x2'):switch(_0xf38026[_0xeed1('0xa')]()){case _0xeed1('0xb'):_0x38dd1d=[{'type':_0xeed1('0x0'),'content':_0xeed1('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xeed1('0xd'),'content':'','key':'Caller\x20Number','keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x5')},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0xe'),'keyType':_0xeed1('0x3'),'variableName':_0xeed1('0xf')},{'type':'keyValue','content':'','key':_0xeed1('0x10'),'keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x11')},{'type':_0xeed1('0xd'),'content':'','key':'Queue','keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x12')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x13')},{'type':_0xeed1('0xd'),'content':'','key':'Date','keyType':'variable','variableName':_0xeed1('0x14')},{'type':_0xeed1('0x0'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x15')},{'type':_0xeed1('0xd'),'content':'','key':'Agent\x20Number','keyType':_0xeed1('0x3'),'variableName':'destcalleridnum'},{'type':_0xeed1('0x0'),'content':_0xeed1('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xeed1('0xd'),'content':'','key':'Agent\x20Ring','keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x14')},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0x17'),'keyType':_0xeed1('0x3'),'variableName':'agentconnectAt'},{'type':_0xeed1('0xd'),'content':'','key':'Agent\x20Complete','keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x18')},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0x19'),'keyType':_0xeed1('0x3'),'variableName':_0xeed1('0x1a')},{'type':'keyValue','content':'','key':_0xeed1('0x1b'),'keyType':'variable','variableName':_0xeed1('0x1c')}];break;case _0xeed1('0x6'):_0x38dd1d=[{'type':_0xeed1('0x0'),'content':_0xeed1('0xc'),'variableName':null},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0x1d'),'keyType':_0xeed1('0x3'),'keyContent':'','variableName':_0xeed1('0x8')},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0x1e'),'keyType':_0xeed1('0x3'),'keyContent':'','variableName':_0xeed1('0x1f')},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0x20'),'keyType':_0xeed1('0x3'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0xeed1('0x21'),'keyType':_0xeed1('0x3'),'keyContent':'','variableName':_0xeed1('0x22')},{'type':'string','content':'***\x20Time\x20Info\x20***'},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0x23'),'keyType':_0xeed1('0x3'),'keyContent':'','variableName':_0xeed1('0x24')},{'type':_0xeed1('0xd'),'content':'','key':'Complete\x20Time','keyType':_0xeed1('0x3'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0xeed1('0x25'),'keyType':_0xeed1('0x3'),'keyContent':'','variableName':_0xeed1('0x26')},{'type':_0xeed1('0xd'),'content':'','key':_0xeed1('0x27'),'keyType':'variable','keyContent':'','variableName':_0xeed1('0x28')}];break;}}return _0x38dd1d;}; \ No newline at end of file +var _0x59c4=['destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','queue','calleridnum','outbound','Outbound\x20Call','variable','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','Date','agentcalledAt','Agent\x20Name'];(function(_0x1b7759,_0x4bfc2b){var _0x4f0d0c=function(_0x5c0c01){while(--_0x5c0c01){_0x1b7759['push'](_0x1b7759['shift']());}};_0x4f0d0c(++_0x4bfc2b);}(_0x59c4,0x1a0));var _0x459c=function(_0x1705a1,_0x327cdf){_0x1705a1=_0x1705a1-0x0;var _0x2d37fa=_0x59c4[_0x1705a1];return _0x2d37fa;};'use strict';exports[_0x459c('0x0')]=function(_0x5c5808,_0x4ed9ec){var _0xf60d0a=[{'type':_0x459c('0x1'),'content':_0x459c('0x2'),'variableName':null}];switch(_0x5c5808[_0x459c('0x3')]()){case _0x459c('0x4'):switch(_0x4ed9ec[_0x459c('0x3')]()){case _0x459c('0x5'):_0xf60d0a[_0x459c('0x6')]({'type':'variable','content':'','variableName':_0x459c('0x7')});_0xf60d0a[_0x459c('0x6')]({'type':'variable','content':'','variableName':_0x459c('0x8')});break;case _0x459c('0x9'):_0xf60d0a[_0x459c('0x6')]({'type':_0x459c('0x1'),'content':_0x459c('0xa'),'variableName':null});_0xf60d0a[_0x459c('0x6')]({'type':_0x459c('0xb'),'content':'','variableName':'destcalleridnum'});break;}}return _0xf60d0a;};exports[_0x459c('0xc')]=function(_0x16ac24,_0x1642ed){var _0x1fa70d=[];switch(_0x16ac24[_0x459c('0x3')]()){case _0x459c('0x4'):switch(_0x1642ed[_0x459c('0x3')]()){case _0x459c('0x5'):_0x1fa70d=[{'type':_0x459c('0x1'),'content':_0x459c('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0xf'),'keyType':_0x459c('0xb'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0x459c('0x10'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x11')},{'type':'keyValue','content':'','key':_0x459c('0x12'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x13')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x14'),'keyType':'variable','variableName':_0x459c('0x7')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x15'),'keyType':_0x459c('0xb'),'variableName':'uniqueid'},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x16'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x17')},{'type':'string','content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x18'),'keyType':'variable','variableName':_0x459c('0x19')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x1a'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x1b')},{'type':_0x459c('0x1'),'content':_0x459c('0x1c'),'key':null,'keyType':null,'variableName':null},{'type':_0x459c('0xe'),'content':'','key':'Agent\x20Ring','keyType':_0x459c('0xb'),'variableName':_0x459c('0x17')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x1d'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x1e')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x1f'),'keyType':_0x459c('0xb'),'variableName':_0x459c('0x20')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x21'),'keyType':'variable','variableName':_0x459c('0x22')},{'type':'keyValue','content':'','key':_0x459c('0x23'),'keyType':'variable','variableName':_0x459c('0x24')}];break;case _0x459c('0x9'):_0x1fa70d=[{'type':_0x459c('0x1'),'content':_0x459c('0xd'),'variableName':null},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x25'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x1b')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x26'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':'membername'},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x15'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x27')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x16'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x28')},{'type':_0x459c('0x1'),'content':_0x459c('0x1c')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x29'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x2a')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x2b'),'keyType':'variable','keyContent':'','variableName':_0x459c('0x2c')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x2d'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x2e')},{'type':_0x459c('0xe'),'content':'','key':_0x459c('0x2f'),'keyType':_0x459c('0xb'),'keyContent':'','variableName':_0x459c('0x30')}];break;}}return _0x1fa70d;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index a22f0dc..17b8940 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 _0x4ad5=['name','stringify','Interaction','findOne','then','catch','error','user','clone','omit','body','phone','fax','mobile','../../config/logger','mail-interactions','fax-interactions','chat-interactions','upperFirst','InteractionId','toLowerCase','toUpperCase'];(function(_0x5d085a,_0x17a9fe){var _0x520046=function(_0x250dc9){while(--_0x250dc9){_0x5d085a['push'](_0x5d085a['shift']());}};_0x520046(++_0x17a9fe);}(_0x4ad5,0x7c));var _0x54ad=function(_0x293c04,_0x4bcc3c){_0x293c04=_0x293c04-0x0;var _0x323620=_0x4ad5[_0x293c04];return _0x323620;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x54ad('0x0'))('openchannel-interactions'),'mail':require(_0x54ad('0x0'))(_0x54ad('0x1')),'fax':require(_0x54ad('0x0'))(_0x54ad('0x2')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0x54ad('0x0'))(_0x54ad('0x3')),'whatsapp':require(_0x54ad('0x0'))('whatsapp-interactions')};function getInteractionId(_0x4a865e,_0x515015,_0x37a653){if(_0x4a865e&&_0x4a865e[_[_0x54ad('0x4')](_0x37a653)+_0x54ad('0x5')]){return _0x4a865e[_['upperFirst'](_0x37a653)+'InteractionId'];}else if(_0x4a865e&&_0x4a865e['id']){return _0x4a865e['id'];}else if(_0x515015&&_0x515015['id']){return _0x515015['id'];}else{return'unknown';}}function log(_0x506658,_0x22bdb2,_0x241b6c,_0x419927,_0x444848,_0x47cf28){loggers[_0x444848[_0x54ad('0x6')]()][_0x506658]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x47cf28[_0x54ad('0x7')](),_0x22bdb2?_0x22bdb2['id']:null,_0x22bdb2?_0x22bdb2[_0x54ad('0x8')]:null,_0x22bdb2?_0x22bdb2['role']:null,getInteractionId(_0x241b6c,_0x419927,_0x444848),_0x241b6c?JSON[_0x54ad('0x9')](_0x241b6c):'null');}function updateUser(_0x14e7b6,_0x13b441,_0x580cf7,_0x291c0e,_0x566a27){db[_['upperFirst'](_0x291c0e)+_0x54ad('0xa')][_0x54ad('0xb')]({'where':{'id':getInteractionId(_0x13b441,_0x580cf7,_0x291c0e)}})[_0x54ad('0xc')](function(_0x181709){if(_0x181709){return _0x181709['update']({'UserId':_0x14e7b6?_0x14e7b6['id']:null});}})[_0x54ad('0xc')](function(_0xc250a5){if(_0xc250a5){log('info',_0x14e7b6,_0x13b441,_0x580cf7,_0x291c0e,_0x566a27);}})[_0x54ad('0xd')](function(){log(_0x54ad('0xe'),_0x14e7b6,_0x13b441,_0x580cf7,_0x291c0e,_0x566a27);});}exports['tracked']=function(_0x27917b,_0x422fcb){return function(_0x304c7b,_0x11b279,_0x177adc){var _0x4a2b8b=_0x304c7b[_0x54ad('0xf')];var _0x3cf4a9={};var _0x404b3f=_0x304c7b['query'];if(_0x3cf4a9){_0x3cf4a9=_[_0x54ad('0x10')](_0x304c7b['body']);_0x3cf4a9=_[_0x54ad('0x11')](_0x3cf4a9,[_0x54ad('0x12'),'html',_0x54ad('0x13'),_0x54ad('0x14'),_0x54ad('0x15')]);}updateUser(_0x4a2b8b,_0x3cf4a9,_0x404b3f,_0x27917b,_0x422fcb);_0x177adc(null);};}; \ No newline at end of file +var _0x203f=['fax-interactions','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null','Interaction','then','info','error','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x203f,0xf0));var _0xf203=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x203f[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0xf203('0x0'));var db=require(_0xf203('0x1'))['db'];var loggers={'openchannel':require(_0xf203('0x2'))('openchannel-interactions'),'mail':require(_0xf203('0x2'))('mail-interactions'),'fax':require(_0xf203('0x2'))(_0xf203('0x3')),'sms':require(_0xf203('0x2'))(_0xf203('0x4')),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require('../../config/logger')(_0xf203('0x5'))};function getInteractionId(_0x194f44,_0x4638fd,_0x15ec6b){if(_0x194f44&&_0x194f44[_[_0xf203('0x6')](_0x15ec6b)+'InteractionId']){return _0x194f44[_[_0xf203('0x6')](_0x15ec6b)+_0xf203('0x7')];}else if(_0x194f44&&_0x194f44['id']){return _0x194f44['id'];}else if(_0x4638fd&&_0x4638fd['id']){return _0x4638fd['id'];}else{return'unknown';}}function log(_0x27e181,_0x262fba,_0x1d64dd,_0x35892f,_0x3022bd,_0x579397){loggers[_0x3022bd[_0xf203('0x8')]()][_0x27e181](_0xf203('0x9'),_0x579397['toUpperCase'](),_0x262fba?_0x262fba['id']:null,_0x262fba?_0x262fba[_0xf203('0xa')]:null,_0x262fba?_0x262fba[_0xf203('0xb')]:null,getInteractionId(_0x1d64dd,_0x35892f,_0x3022bd),_0x1d64dd?JSON[_0xf203('0xc')](_0x1d64dd):_0xf203('0xd'));}function updateUser(_0x25a8f6,_0x2248ef,_0x4e82f4,_0x15c520,_0x44515c){db[_['upperFirst'](_0x15c520)+_0xf203('0xe')]['findOne']({'where':{'id':getInteractionId(_0x2248ef,_0x4e82f4,_0x15c520)}})['then'](function(_0x5a4fcf){if(_0x5a4fcf){return _0x5a4fcf['update']({'UserId':_0x25a8f6?_0x25a8f6['id']:null});}})[_0xf203('0xf')](function(_0x50c15f){if(_0x50c15f){log(_0xf203('0x10'),_0x25a8f6,_0x2248ef,_0x4e82f4,_0x15c520,_0x44515c);}})['catch'](function(){log(_0xf203('0x11'),_0x25a8f6,_0x2248ef,_0x4e82f4,_0x15c520,_0x44515c);});}exports['tracked']=function(_0x3bbd14,_0x285195){return function(_0x401619,_0x4657ef,_0x15f713){var _0x3790f6=_0x401619[_0xf203('0x12')];var _0x35fda6={};var _0x3838cf=_0x401619[_0xf203('0x13')];if(_0x35fda6){_0x35fda6=_[_0xf203('0x14')](_0x401619[_0xf203('0x15')]);_0x35fda6=_[_0xf203('0x16')](_0x35fda6,[_0xf203('0x15'),_0xf203('0x17'),_0xf203('0x18'),_0xf203('0x19'),_0xf203('0x1a')]);}updateUser(_0x3790f6,_0x35fda6,_0x3838cf,_0x3bbd14,_0x285195);_0x15f713(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index d1989c0..4289dc1 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 _0x6e8e=['count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','then'];(function(_0x54496d,_0x5b8572){var _0x40e626=function(_0xb6475c){while(--_0xb6475c){_0x54496d['push'](_0x54496d['shift']());}};_0x40e626(++_0x5b8572);}(_0x6e8e,0x14d));var _0xe6e8=function(_0x1a5b78,_0x40090a){_0x1a5b78=_0x1a5b78-0x0;var _0x9f9569=_0x6e8e[_0x1a5b78];return _0x9f9569;};'use strict';var crypto=require(_0xe6e8('0x0'));var util=require(_0xe6e8('0x1'));var compose=require(_0xe6e8('0x2'));var db=require(_0xe6e8('0x3'))['db'];var config=require(_0xe6e8('0x4'));function getValueFromLicense(_0x5a994d,_0x3b3495){if(_0x5a994d&&_0x3b3495){if(_0x3b3495[_0xe6e8('0x5')]&&_0x3b3495[_0xe6e8('0x6')]){var _0x42386c=_0x3b3495[_0xe6e8('0x5')];var _0x381b6e=_0x3b3495[_0xe6e8('0x6')];var _0x121891=_0x42386c['split']('-')[0x4];var _0x159a2c=_0x42386c[_0xe6e8('0x7')]('-')[0x0];var _0xa8669c=crypto[_0xe6e8('0x8')](_0xe6e8('0x9'),util['format'](_0xe6e8('0xa'),_0x121891,_0x42386c,_0x159a2c));var _0x5e0f47=_0xa8669c['update'](_0x381b6e,_0xe6e8('0xb'),_0xe6e8('0xc'));_0x5e0f47+=_0xa8669c[_0xe6e8('0xd')]('utf8');var _0x2dc7fb=JSON[_0xe6e8('0xe')](_0x5e0f47);return _0x2dc7fb[_0xe6e8('0xf')](_0x5a994d)?_0x2dc7fb[_0x5a994d]:null;}}return null;}function isLimit(_0x55726c,_0x45b5b2,_0x2799be,_0x2deac9){var _0x291b23=_0x45b5b2;return compose()[_0xe6e8('0x10')](function(_0x3ae73c,_0x7db4bb,_0x1f05e8){return db['License']['findOne']({'where':{'id':0x1},'raw':!![]})[_0xe6e8('0x11')](function(_0x42d351){var _0x1c799c=getValueFromLicense(_0x55726c,_0x42d351);return _0x1c799c?_0x1c799c:_0x291b23;})[_0xe6e8('0x11')](function(_0x3fb685){_0x291b23=_0x3fb685;return _0x2799be[_0xe6e8('0x12')](_0x2deac9);})[_0xe6e8('0x11')](function(_0x451b57){if(_0x451b57>=_0x291b23){return _0x7db4bb['status'](0x193)[_0xe6e8('0x13')]({'message':util[_0xe6e8('0x14')](_0xe6e8('0x15'),_0x55726c)});}_0x1f05e8();})[_0xe6e8('0x16')](function(_0x235b12){_0x1f05e8(_0x235b12);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xe6e8('0x17')],{'where':{'$or':[{'role':_0xe6e8('0x18')},{'role':_0xe6e8('0x19')}]}});}exports[_0xe6e8('0x1a')]=isUserLimit; \ No newline at end of file +var _0x7268=['parse','use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','split','format','%s:%s:%s','base64','utf8'];(function(_0x561f25,_0x2d95c1){var _0x150e4c=function(_0x266e99){while(--_0x266e99){_0x561f25['push'](_0x561f25['shift']());}};_0x150e4c(++_0x2d95c1);}(_0x7268,0x16b));var _0x8726=function(_0x21e63a,_0x138fe3){_0x21e63a=_0x21e63a-0x0;var _0x28eef4=_0x7268[_0x21e63a];return _0x28eef4;};'use strict';var crypto=require(_0x8726('0x0'));var util=require(_0x8726('0x1'));var compose=require('composable-middleware');var db=require(_0x8726('0x2'))['db'];var config=require(_0x8726('0x3'));function getValueFromLicense(_0x25e9ef,_0x27ef96){if(_0x25e9ef&&_0x27ef96){if(_0x27ef96[_0x8726('0x4')]&&_0x27ef96[_0x8726('0x5')]){var _0x38cf46=_0x27ef96['data1'];var _0x39b02f=_0x27ef96[_0x8726('0x5')];var _0x566f00=_0x38cf46[_0x8726('0x6')]('-')[0x4];var _0xc74d0b=_0x38cf46[_0x8726('0x6')]('-')[0x0];var _0x2a2222=crypto['createDecipher']('aes-256-ctr',util[_0x8726('0x7')](_0x8726('0x8'),_0x566f00,_0x38cf46,_0xc74d0b));var _0x5b8891=_0x2a2222['update'](_0x39b02f,_0x8726('0x9'),_0x8726('0xa'));_0x5b8891+=_0x2a2222['final'](_0x8726('0xa'));var _0x4829f3=JSON[_0x8726('0xb')](_0x5b8891);return _0x4829f3['hasOwnProperty'](_0x25e9ef)?_0x4829f3[_0x25e9ef]:null;}}return null;}function isLimit(_0x1a2a11,_0x170978,_0x248f9c,_0x4e6d18){var _0x3257f5=_0x170978;return compose()[_0x8726('0xc')](function(_0x3a16a0,_0x4c6f4e,_0x3e5442){return db['License'][_0x8726('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x7356c4){var _0x5eb003=getValueFromLicense(_0x1a2a11,_0x7356c4);return _0x5eb003?_0x5eb003:_0x3257f5;})[_0x8726('0xe')](function(_0x5eb40c){_0x3257f5=_0x5eb40c;return _0x248f9c[_0x8726('0xf')](_0x4e6d18);})[_0x8726('0xe')](function(_0xd9e71c){if(_0xd9e71c>=_0x3257f5){return _0x4c6f4e[_0x8726('0x10')](0x193)[_0x8726('0x11')]({'message':util['format'](_0x8726('0x12'),_0x1a2a11)});}_0x3e5442();})[_0x8726('0x13')](function(_0x206ae1){_0x3e5442(_0x206ae1);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x8726('0x14')},{'role':_0x8726('0x15')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 743176c..a22f3cd 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 _0xe0d9=['filter','map','push','buildExpression','DATE','operator','$eq','$between','value','add','days','format','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20IS\x20NULL)','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','$lt','<\x20?','$gt','>\x20?','$lte','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','utcOffset','seconds','lodash','moment','sqlOperator','startsWith','and','[$and]','replace','split','length','slice','forEach','shift'];(function(_0x273f0d,_0x1d273d){var _0x2a4953=function(_0x5bb247){while(--_0x5bb247){_0x273f0d['push'](_0x273f0d['shift']());}};_0x2a4953(++_0x1d273d);}(_0xe0d9,0x1bf));var _0x9e0d=function(_0x17882c,_0x4b964b){_0x17882c=_0x17882c-0x0;var _0x355a59=_0xe0d9[_0x17882c];return _0x355a59;};'use strict';var _=require(_0x9e0d('0x0'));var moment=require(_0x9e0d('0x1'));exports['parseSearch']=function(_0x3d0a21){var _0x512d8d={'conditions':[]};_0x512d8d[_0x9e0d('0x2')]=_[_0x9e0d('0x3')](_0x3d0a21,'[$or]')?'or':_0x9e0d('0x4');var _0x5098a6=_0x3d0a21['replace'](_0x9e0d('0x5'),'')[_0x9e0d('0x6')]('[$or]','')[_0x9e0d('0x7')]('||');for(var _0x4419c1=0x0;_0x4419c1<_0x5098a6[_0x9e0d('0x8')];_0x4419c1++){var _0x107f16=_0x5098a6[_0x4419c1][_0x9e0d('0x7')](':=');var _0x3c3f5a=_0x107f16[0x0];var _0x3881b4=_0x107f16[_0x9e0d('0x9')](0x1);_0x3881b4[_0x9e0d('0xa')](function(_0x1b30a2){var _0x508c07=_0x1b30a2[_0x9e0d('0x7')]('[')[_0x9e0d('0xb')]();var _0x2457b8=_0x1b30a2['match'](/\[(.*?)\]/g);_0x2457b8[_0x9e0d('0xa')](function(_0x528357){var _0x2d2cf4=_0x528357[_0x9e0d('0x7')]('[')[_0x9e0d('0xc')](function(_0x5799b7){return _0x5799b7['indexOf'](']')>-0x1;})[_0x9e0d('0xd')](function(_0x1957bd){return _0x1957bd['split'](']')[0x0];})[0x0];_0x512d8d['conditions'][_0x9e0d('0xe')]({'field':_0x3c3f5a,'operator':_0x508c07,'value':_0x2d2cf4});});});}return _0x512d8d;};exports[_0x9e0d('0xf')]=function(_0x30cfb2,_0x237128,_0x167e4d){var _0x2715f0={};if(_0x237128===_0x9e0d('0x10')){if(_0x167e4d[_0x9e0d('0x11')]===_0x9e0d('0x12')){_0x167e4d[_0x9e0d('0x11')]=_0x9e0d('0x13');_0x167e4d[_0x9e0d('0x14')]+=','+_0x167e4d['value'];}else if(_['includes'](['$gt','$lte'],_0x167e4d[_0x9e0d('0x11')])){_0x167e4d[_0x9e0d('0x14')]=moment(_0x167e4d[_0x9e0d('0x14')])[_0x9e0d('0x15')](0x1,_0x9e0d('0x16'))[_0x9e0d('0x17')]('YYYY-MM-DD');}}if(_0x167e4d[_0x9e0d('0x18')]){_0x237128=_0x167e4d[_0x9e0d('0x18')];_0x2715f0[_0x9e0d('0x19')]=_0x9e0d('0x1a')+_0x30cfb2+'.'+_0x167e4d[_0x9e0d('0x1b')]+_0x9e0d('0x1c')+_0x167e4d[_0x9e0d('0x18')]+')\x20'+parseOperator(_0x167e4d[_0x9e0d('0x11')]);}else{_0x2715f0[_0x9e0d('0x19')]=_0x30cfb2+'.'+_0x167e4d[_0x9e0d('0x1b')]+'\x20'+parseOperator(_0x167e4d[_0x9e0d('0x11')]);}if(_[_0x9e0d('0x1d')]([_0x9e0d('0x1e'),_0x9e0d('0x1f')],_0x167e4d[_0x9e0d('0x11')]))_0x2715f0[_0x9e0d('0x19')]='('+_0x2715f0[_0x9e0d('0x19')]+'\x20OR\x20'+_0x30cfb2+'.'+_0x167e4d[_0x9e0d('0x1b')]+_0x9e0d('0x20');_0x2715f0[_0x9e0d('0x14')]=parseValue(_0x237128,_0x167e4d[_0x9e0d('0x11')],_0x167e4d[_0x9e0d('0x14')]);return _0x2715f0;};function parseOperator(_0x4d7037){var _0x5df1a8;switch(_0x4d7037){case'$in':_0x5df1a8='IN\x20?';break;case _0x9e0d('0x1f'):_0x5df1a8=_0x9e0d('0x21');break;case _0x9e0d('0x12'):_0x5df1a8=_0x9e0d('0x22');break;case'$ne':_0x5df1a8=_0x9e0d('0x23');break;case _0x9e0d('0x24'):case'$startsWith':case _0x9e0d('0x25'):_0x5df1a8='LIKE\x20?';break;case _0x9e0d('0x26'):_0x5df1a8=_0x9e0d('0x27');break;case _0x9e0d('0x28'):_0x5df1a8=_0x9e0d('0x29');break;case _0x9e0d('0x2a'):_0x5df1a8=_0x9e0d('0x2b');break;case _0x9e0d('0x2c'):_0x5df1a8=_0x9e0d('0x2d');break;case _0x9e0d('0x13'):_0x5df1a8=_0x9e0d('0x2e');break;}return _0x5df1a8;}function parseValue(_0x45dd68,_0xb6f998,_0x42730b){var _0xa8f42={'start':undefined,'end':undefined};switch(_0xb6f998){case _0x9e0d('0x2f'):case'$notIn':_0xa8f42[_0x9e0d('0x30')]=_0x42730b[_0x9e0d('0x7')](',');break;case _0x9e0d('0x24'):_0xa8f42[_0x9e0d('0x30')]='%'+_0x42730b+'%';break;case'$startsWith':_0xa8f42['start']=_0x42730b+'%';break;case _0x9e0d('0x25'):_0xa8f42[_0x9e0d('0x30')]='%'+_0x42730b;break;case'$between':var _0x23cd41=_0x42730b[_0x9e0d('0x7')](',');var _0x42730b=_0x23cd41['shift']();var _0x357090=_0x23cd41['pop']();if(_0x45dd68==='DATE'){_0x42730b=moment(_0x42730b)['utcOffset'](0x0,!![])[_0x9e0d('0x17')]();_0x357090=moment(_0x357090)[_0x9e0d('0x31')](0x0,!![])[_0x9e0d('0x15')](0x17,'hours')['add'](0x3b,'minutes')[_0x9e0d('0x15')](0x3b,_0x9e0d('0x32'))[_0x9e0d('0x17')]();}_0xa8f42={'start':_0x42730b,'end':_0x357090};break;default:_0xa8f42[_0x9e0d('0x30')]=_0x42730b;break;}return _0xa8f42;} \ No newline at end of file +var _0x223b=['start','pop','utcOffset','minutes','format','lodash','moment','parseSearch','sqlOperator','[$or]','and','[$and]','replace','length','split','slice','forEach','shift','match','filter','indexOf','map','push','buildExpression','DATE','operator','$eq','$between','value','$gt','add','days','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<=\x20?','$gte','>=\x20?'];(function(_0x2da71d,_0x34f66b){var _0x16c334=function(_0x4fd1cf){while(--_0x4fd1cf){_0x2da71d['push'](_0x2da71d['shift']());}};_0x16c334(++_0x34f66b);}(_0x223b,0xa7));var _0xb223=function(_0x42dfc1,_0x2b6e18){_0x42dfc1=_0x42dfc1-0x0;var _0x3274bb=_0x223b[_0x42dfc1];return _0x3274bb;};'use strict';var _=require(_0xb223('0x0'));var moment=require(_0xb223('0x1'));exports[_0xb223('0x2')]=function(_0x8ea81e){var _0x4297c1={'conditions':[]};_0x4297c1[_0xb223('0x3')]=_['startsWith'](_0x8ea81e,_0xb223('0x4'))?'or':_0xb223('0x5');var _0x3a260d=_0x8ea81e['replace'](_0xb223('0x6'),'')[_0xb223('0x7')]('[$or]','')['split']('||');for(var _0xeabfc5=0x0;_0xeabfc5<_0x3a260d[_0xb223('0x8')];_0xeabfc5++){var _0x461f5d=_0x3a260d[_0xeabfc5][_0xb223('0x9')](':=');var _0xa5a8e3=_0x461f5d[0x0];var _0x1c4fe1=_0x461f5d[_0xb223('0xa')](0x1);_0x1c4fe1[_0xb223('0xb')](function(_0x1c80e3){var _0x594a51=_0x1c80e3['split']('[')[_0xb223('0xc')]();var _0x27f86a=_0x1c80e3[_0xb223('0xd')](/\[(.*?)\]/g);_0x27f86a[_0xb223('0xb')](function(_0x1f4d30){var _0x32308a=_0x1f4d30[_0xb223('0x9')]('[')[_0xb223('0xe')](function(_0x7b529a){return _0x7b529a[_0xb223('0xf')](']')>-0x1;})[_0xb223('0x10')](function(_0x567cd7){return _0x567cd7[_0xb223('0x9')](']')[0x0];})[0x0];_0x4297c1['conditions'][_0xb223('0x11')]({'field':_0xa5a8e3,'operator':_0x594a51,'value':_0x32308a});});});}return _0x4297c1;};exports[_0xb223('0x12')]=function(_0x1e3305,_0x44c54f,_0x37fab9){var _0x1f0656={};if(_0x44c54f===_0xb223('0x13')){if(_0x37fab9[_0xb223('0x14')]===_0xb223('0x15')){_0x37fab9[_0xb223('0x14')]=_0xb223('0x16');_0x37fab9[_0xb223('0x17')]+=','+_0x37fab9['value'];}else if(_['includes']([_0xb223('0x18'),'$lte'],_0x37fab9[_0xb223('0x14')])){_0x37fab9[_0xb223('0x17')]=moment(_0x37fab9[_0xb223('0x17')])[_0xb223('0x19')](0x1,_0xb223('0x1a'))['format'](_0xb223('0x1b'));}}if(_0x37fab9[_0xb223('0x1c')]){_0x44c54f=_0x37fab9['castTo'];_0x1f0656[_0xb223('0x1d')]=_0xb223('0x1e')+_0x1e3305+'.'+_0x37fab9[_0xb223('0x1f')]+_0xb223('0x20')+_0x37fab9[_0xb223('0x1c')]+')\x20'+parseOperator(_0x37fab9['operator']);}else{_0x1f0656['text']=_0x1e3305+'.'+_0x37fab9[_0xb223('0x1f')]+'\x20'+parseOperator(_0x37fab9[_0xb223('0x14')]);}if(_[_0xb223('0x21')]([_0xb223('0x22'),_0xb223('0x23')],_0x37fab9[_0xb223('0x14')]))_0x1f0656['text']='('+_0x1f0656[_0xb223('0x1d')]+_0xb223('0x24')+_0x1e3305+'.'+_0x37fab9[_0xb223('0x1f')]+_0xb223('0x25');_0x1f0656[_0xb223('0x17')]=parseValue(_0x44c54f,_0x37fab9['operator'],_0x37fab9[_0xb223('0x17')]);return _0x1f0656;};function parseOperator(_0x32127c){var _0x319303;switch(_0x32127c){case _0xb223('0x26'):_0x319303=_0xb223('0x27');break;case'$notIn':_0x319303='NOT\x20IN\x20?';break;case _0xb223('0x15'):_0x319303='=\x20?';break;case _0xb223('0x22'):_0x319303=_0xb223('0x28');break;case _0xb223('0x29'):case _0xb223('0x2a'):case _0xb223('0x2b'):_0x319303=_0xb223('0x2c');break;case _0xb223('0x2d'):_0x319303='<\x20?';break;case _0xb223('0x18'):_0x319303='>\x20?';break;case'$lte':_0x319303=_0xb223('0x2e');break;case _0xb223('0x2f'):_0x319303=_0xb223('0x30');break;case _0xb223('0x16'):_0x319303='BETWEEN\x20?\x20AND\x20?';break;}return _0x319303;}function parseValue(_0x3f2b20,_0x2d9356,_0x1a166a){var _0x3a2932={'start':undefined,'end':undefined};switch(_0x2d9356){case'$in':case'$notIn':_0x3a2932['start']=_0x1a166a[_0xb223('0x9')](',');break;case _0xb223('0x29'):_0x3a2932[_0xb223('0x31')]='%'+_0x1a166a+'%';break;case'$startsWith':_0x3a2932[_0xb223('0x31')]=_0x1a166a+'%';break;case _0xb223('0x2b'):_0x3a2932['start']='%'+_0x1a166a;break;case _0xb223('0x16'):var _0x3af862=_0x1a166a[_0xb223('0x9')](',');var _0x1a166a=_0x3af862['shift']();var _0x156c7d=_0x3af862[_0xb223('0x32')]();if(_0x3f2b20===_0xb223('0x13')){_0x1a166a=moment(_0x1a166a)['utcOffset'](0x0,!![])['format']();_0x156c7d=moment(_0x156c7d)[_0xb223('0x33')](0x0,!![])[_0xb223('0x19')](0x17,'hours')[_0xb223('0x19')](0x3b,_0xb223('0x34'))['add'](0x3b,'seconds')[_0xb223('0x35')]();}_0x3a2932={'start':_0x1a166a,'end':_0x156c7d};break;default:_0x3a2932[_0xb223('0x31')]=_0x1a166a;break;}return _0x3a2932;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index e5b4df3..ddcc878 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 _0xf4bf=['map','indexOf','priority','cast','unsigned','substr','DESC','col','ASC','omit','isObject','isString','length','unset','hasOwnProperty','isNumeric','forEach','query','$id','model','intersection','attributes','fields','nolimit','where','pick','filter','merge','lower','options','sequelize','moment','parse','keys','split','filters','isEmpty','find','type','format','utc','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','sort'];(function(_0x1d1fd9,_0x343c4f){var _0x48c07e=function(_0x2ccbef){while(--_0x2ccbef){_0x1d1fd9['push'](_0x1d1fd9['shift']());}};_0x48c07e(++_0x343c4f);}(_0xf4bf,0xb1));var _0xff4b=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0xf4bf[_0x296754];return _0x1d9f1d;};'use strict';var _=require('lodash');var sequelize=require(_0xff4b('0x0'));var moment=require(_0xff4b('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x10e9fa){var _0x1bb0ea=['ne'];try{var _0x44b410=JSON[_0xff4b('0x2')](_0x10e9fa);var _0xcb0479=Object[_0xff4b('0x3')](_0x44b410)[0x0];return _0x1bb0ea['includes'](_0xcb0479);}catch(_0x3da63b){return![];}}function getOperatorValue(_0x48223a){var _0x3adf9c=JSON[_0xff4b('0x2')](_0x48223a);var _0x58ee85=Object[_0xff4b('0x3')](_0x3adf9c)[0x0];var _0x176db9=_0x3adf9c[_0x58ee85];return{['$'+_0x58ee85]:_0x176db9};}exports['fields']=function(_0x4de4bb){var _0x5a7b19=null;if(_0x4de4bb){_0x5a7b19=_0x4de4bb[_0xff4b('0x4')](',');}return _0x5a7b19;};exports[_0xff4b('0x5')]=function(_0x1fcaec,_0x5af8a7){var _0x3667ec={};if(!_[_0xff4b('0x6')](_0x1fcaec)){_['forOwn'](_0x1fcaec,function(_0x2effaa,_0x3d5444){try{if(_0x5af8a7){var _0x25e0e0=_[_0xff4b('0x7')](_0x5af8a7,{'name':_0x3d5444})||{};if(hasSequelizeOperator(_0x2effaa)){_0x3667ec[_0x3d5444]=getOperatorValue(_0x2effaa);}else if(_0x25e0e0[_0xff4b('0x8')]==='DATE'&&_['isPlainObject'](_0x2effaa)){var _0xe6e5eb=JSON[_0xff4b('0x2')](_0x2effaa);var _0x5f493e={'$gte':moment(moment(_0xe6e5eb['$gte'])[_0xff4b('0x9')]('YYYY-MM-DD'))[_0xff4b('0xa')]()[_0xff4b('0x9')](),'$lte':moment(moment(_0xe6e5eb['$lte'])['format'](_0xff4b('0xb')))[_0xff4b('0xa')]()[_0xff4b('0xc')](0x1,'s')[_0xff4b('0x9')]()};_0x3667ec[_0x3d5444]=_0x5f493e;}else if(_0x25e0e0[_0xff4b('0xd')]===_0xff4b('0xe')){_0x3667ec[_0x3d5444]=_0x2effaa;}else{_0x3667ec[_0x3d5444]=_[_0xff4b('0xf')](_0x2effaa)?_0x2effaa:JSON['parse'](_0x2effaa);}}else{_0x3667ec[_0x3d5444]=_[_0xff4b('0xf')](_0x2effaa)?_0x2effaa:JSON[_0xff4b('0x2')](_0x2effaa);}}catch(_0x16b3c9){_0x3667ec[_0x3d5444]=_0x2effaa[_0xff4b('0x4')](',');}});}return _0x3667ec;};exports[_0xff4b('0x10')]=function(_0x32e082){_0x32e082=parseInt(_0x32e082,0xa);if(!_0x32e082||_0x32e082<0x0){_0x32e082=LIMIT_VALUE;}return _0x32e082;};exports[_0xff4b('0x11')]=function(_0x3793af){_0x3793af=parseInt(_0x3793af,0xa);if(!_0x3793af||_0x3793af<0x0){_0x3793af=0x0;}return _0x3793af;};exports[_0xff4b('0x12')]=function(_0x5537a3){var _0x30de8b,_0x2df27a=null;if(_0x5537a3){_0x30de8b=_0x5537a3[_0xff4b('0x4')](',');_0x2df27a=_[_0xff4b('0x13')](_0x30de8b,function(_0x525051){if(_0x525051[_0xff4b('0x14')]('-')===0x0){return[_0x525051===_0xff4b('0x15')?sequelize[_0xff4b('0x16')](sequelize['col'](_0xff4b('0x15')),_0xff4b('0x17')):_0x525051[_0xff4b('0x18')](0x1),_0xff4b('0x19')];}else{return[_0x525051==='priority'?sequelize['cast'](sequelize[_0xff4b('0x1a')]('priority'),'unsigned'):_0x525051,_0xff4b('0x1b')];}});}return _0x2df27a;};exports['omit']=function(_0x1d3e62,_0x4aec27){if(_[_0xff4b('0x6')](_0x1d3e62)){return _0x1d3e62;}if(_[_0xff4b('0xf')](_0x1d3e62)){for(var _0x546b21=0x0;_0x546b21<_0x1d3e62['length'];_0x546b21+=0x1){_0x1d3e62[_0x546b21]=this[_0xff4b('0x1c')](_0x1d3e62[_0x546b21],_0x4aec27);}return _0x1d3e62;}if(!_[_0xff4b('0x1d')](_0x1d3e62)){return _0x1d3e62;}if(_[_0xff4b('0x1e')](_0x4aec27)){_0x4aec27=[_0x4aec27];}if(!_[_0xff4b('0xf')](_0x4aec27)){return _0x1d3e62;}for(var _0x35bce0=0x0;_0x35bce0<_0x4aec27[_0xff4b('0x1f')];_0x35bce0+=0x1){_[_0xff4b('0x20')](_0x1d3e62,_0x4aec27[_0x35bce0]);}for(var _0x53b2a1 in _0x1d3e62){if(_0x1d3e62[_0xff4b('0x21')](_0x53b2a1)){_0x1d3e62[_0x53b2a1]=this['omit'](_0x1d3e62[_0x53b2a1],_0x4aec27);}}return _0x1d3e62;};exports[_0xff4b('0x22')]=function(_0x4c10a7){return _0x4c10a7['match'](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports['isEmail']=function(_0x1dcbe7){return _0x1dcbe7['match'](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x34b113){var _0x2e4b3b=[];_0x34b113[_0xff4b('0x4')](/[ ,]+/)[_0xff4b('0x23')](function(_0x12965f){_0x12965f=_0x12965f['replace'](/([^:]")"+/g,'$1');_0x12965f='+'+_0x12965f+'*';if(_0x12965f['includes']('@'))_0x12965f='\x22'+_0x12965f+'\x22';_0x2e4b3b['push'](_0x12965f);});return _0x2e4b3b['join']('\x20');};exports['getOptions']=function(_0x236057,_0x2dc547,_0x248876){var _0x5de365={},_0x57cd4e={};if(_0x2dc547[_0xff4b('0x24')][_0xff4b('0x25')]){_0x2dc547['query']['id']=_0x2dc547[_0xff4b('0x24')][_0xff4b('0x25')];delete _0x2dc547[_0xff4b('0x24')]['$id'];}_0x5de365[_0xff4b('0x26')]=_[_0xff4b('0x13')](_0x236057,_0xff4b('0xd'));_0x5de365['query']=_[_0xff4b('0x3')](_0x2dc547[_0xff4b('0x24')]);_0x5de365['filters']=_[_0xff4b('0x27')](_0x5de365[_0xff4b('0x26')],_0x5de365['query']);_0x57cd4e[_0xff4b('0x28')]=_['intersection'](_0x5de365['model'],this[_0xff4b('0x29')](_0x2dc547[_0xff4b('0x24')][_0xff4b('0x29')]));_0x57cd4e['attributes']=_0x57cd4e[_0xff4b('0x28')][_0xff4b('0x1f')]?_0x57cd4e['attributes']:_0x5de365['model'];if(!_0x2dc547['query'][_0xff4b('0x21')](_0xff4b('0x2a'))){_0x57cd4e[_0xff4b('0x10')]=this['limit'](_0x2dc547[_0xff4b('0x24')][_0xff4b('0x10')]);_0x57cd4e[_0xff4b('0x11')]=this['offset'](_0x2dc547[_0xff4b('0x24')]['offset']);}_0x57cd4e['order']=this['sort'](_0x2dc547[_0xff4b('0x24')][_0xff4b('0x12')]);_0x57cd4e[_0xff4b('0x2b')]=this['filters'](_[_0xff4b('0x2c')](_0x2dc547[_0xff4b('0x24')],_0x5de365[_0xff4b('0x5')]),_0x236057);if(_0x2dc547[_0xff4b('0x24')][_0xff4b('0x2d')]){_0x57cd4e[_0xff4b('0x2b')]=_[_0xff4b('0x2e')](_0x57cd4e[_0xff4b('0x2b')],{'$or':_['map'](_0x236057,function(_0x58185e){if(_0x58185e[_0xff4b('0x8')]!=='VIRTUAL'){if(_0x248876){return sequelize[_0xff4b('0x2b')](sequelize['fn'](_0xff4b('0x2f'),sequelize[_0xff4b('0x1a')](_0x58185e[_0xff4b('0xd')])),{'$like':sequelize['fn'](_0xff4b('0x2f'),'%'+_0x2dc547[_0xff4b('0x24')][_0xff4b('0x2d')]+'%')});}else{var _0x4f2b20={};_0x4f2b20[_0x58185e[_0xff4b('0xd')]]={'$like':'%'+_0x2dc547[_0xff4b('0x24')][_0xff4b('0x2d')]+'%'};return _0x4f2b20;}}})});}_0x57cd4e=_[_0xff4b('0x2e')]({},_0x57cd4e,_0x2dc547[_0xff4b('0x30')]);return _0x57cd4e;}; \ No newline at end of file +var _0x17de=['offset','order','where','pick','filter','merge','VIRTUAL','lower','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','format','YYYY-MM-DD','$lte','utc','name','isArray','limit','sort','map','indexOf','priority','cast','col','unsigned','omit','length','isObject','isString','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','push','join','$id','query','intersection','attributes','model','nolimit'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x17de,0xdc));var _0xe17d=function(_0x277fda,_0x57df6e){_0x277fda=_0x277fda-0x0;var _0x34475a=_0x17de[_0x277fda];return _0x34475a;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xe17d('0x0'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x223c45){var _0x2c461c=['ne'];try{var _0x481730=JSON[_0xe17d('0x1')](_0x223c45);var _0x31250d=Object[_0xe17d('0x2')](_0x481730)[0x0];return _0x2c461c[_0xe17d('0x3')](_0x31250d);}catch(_0x37603f){return![];}}function getOperatorValue(_0xb531b4){var _0x1efb34=JSON[_0xe17d('0x1')](_0xb531b4);var _0x6e97bf=Object[_0xe17d('0x2')](_0x1efb34)[0x0];var _0x1d904b=_0x1efb34[_0x6e97bf];return{['$'+_0x6e97bf]:_0x1d904b};}exports[_0xe17d('0x4')]=function(_0x156f0f){var _0x508d1b=null;if(_0x156f0f){_0x508d1b=_0x156f0f[_0xe17d('0x5')](',');}return _0x508d1b;};exports[_0xe17d('0x6')]=function(_0x23fecb,_0x1bb1f6){var _0x4508ce={};if(!_[_0xe17d('0x7')](_0x23fecb)){_[_0xe17d('0x8')](_0x23fecb,function(_0x4ea485,_0x1a5b6e){try{if(_0x1bb1f6){var _0x14b51b=_[_0xe17d('0x9')](_0x1bb1f6,{'name':_0x1a5b6e})||{};if(hasSequelizeOperator(_0x4ea485)){_0x4508ce[_0x1a5b6e]=getOperatorValue(_0x4ea485);}else if(_0x14b51b[_0xe17d('0xa')]===_0xe17d('0xb')&&_[_0xe17d('0xc')](_0x4ea485)){var _0x13886a=JSON[_0xe17d('0x1')](_0x4ea485);var _0x44d3fc={'$gte':moment(moment(_0x13886a['$gte'])[_0xe17d('0xd')](_0xe17d('0xe')))['utc']()['format'](),'$lte':moment(moment(_0x13886a[_0xe17d('0xf')])[_0xe17d('0xd')](_0xe17d('0xe')))[_0xe17d('0x10')]()['subtract'](0x1,'s')[_0xe17d('0xd')]()};_0x4508ce[_0x1a5b6e]=_0x44d3fc;}else if(_0x14b51b[_0xe17d('0x11')]==='uniqueid'){_0x4508ce[_0x1a5b6e]=_0x4ea485;}else{_0x4508ce[_0x1a5b6e]=_['isArray'](_0x4ea485)?_0x4ea485:JSON[_0xe17d('0x1')](_0x4ea485);}}else{_0x4508ce[_0x1a5b6e]=_[_0xe17d('0x12')](_0x4ea485)?_0x4ea485:JSON['parse'](_0x4ea485);}}catch(_0x241082){_0x4508ce[_0x1a5b6e]=_0x4ea485['split'](',');}});}return _0x4508ce;};exports[_0xe17d('0x13')]=function(_0x474bb3){_0x474bb3=parseInt(_0x474bb3,0xa);if(!_0x474bb3||_0x474bb3<0x0){_0x474bb3=LIMIT_VALUE;}return _0x474bb3;};exports['offset']=function(_0x269c70){_0x269c70=parseInt(_0x269c70,0xa);if(!_0x269c70||_0x269c70<0x0){_0x269c70=0x0;}return _0x269c70;};exports[_0xe17d('0x14')]=function(_0x1207ba){var _0x3c9421,_0x12d294=null;if(_0x1207ba){_0x3c9421=_0x1207ba[_0xe17d('0x5')](',');_0x12d294=_[_0xe17d('0x15')](_0x3c9421,function(_0x5e3baf){if(_0x5e3baf[_0xe17d('0x16')]('-')===0x0){return[_0x5e3baf===_0xe17d('0x17')?sequelize[_0xe17d('0x18')](sequelize[_0xe17d('0x19')](_0xe17d('0x17')),_0xe17d('0x1a')):_0x5e3baf['substr'](0x1),'DESC'];}else{return[_0x5e3baf===_0xe17d('0x17')?sequelize[_0xe17d('0x18')](sequelize[_0xe17d('0x19')](_0xe17d('0x17')),'unsigned'):_0x5e3baf,'ASC'];}});}return _0x12d294;};exports[_0xe17d('0x1b')]=function(_0x1ac77c,_0x1a13b6){if(_['isEmpty'](_0x1ac77c)){return _0x1ac77c;}if(_[_0xe17d('0x12')](_0x1ac77c)){for(var _0x47f9c6=0x0;_0x47f9c6<_0x1ac77c[_0xe17d('0x1c')];_0x47f9c6+=0x1){_0x1ac77c[_0x47f9c6]=this[_0xe17d('0x1b')](_0x1ac77c[_0x47f9c6],_0x1a13b6);}return _0x1ac77c;}if(!_[_0xe17d('0x1d')](_0x1ac77c)){return _0x1ac77c;}if(_[_0xe17d('0x1e')](_0x1a13b6)){_0x1a13b6=[_0x1a13b6];}if(!_[_0xe17d('0x12')](_0x1a13b6)){return _0x1ac77c;}for(var _0x2abc4b=0x0;_0x2abc4b<_0x1a13b6[_0xe17d('0x1c')];_0x2abc4b+=0x1){_['unset'](_0x1ac77c,_0x1a13b6[_0x2abc4b]);}for(var _0x539b99 in _0x1ac77c){if(_0x1ac77c[_0xe17d('0x1f')](_0x539b99)){_0x1ac77c[_0x539b99]=this[_0xe17d('0x1b')](_0x1ac77c[_0x539b99],_0x1a13b6);}}return _0x1ac77c;};exports[_0xe17d('0x20')]=function(_0x2b8895){return _0x2b8895[_0xe17d('0x21')](RegExp(_0xe17d('0x22')))?!![]:![];};exports['isEmail']=function(_0x3ff8ce){return _0x3ff8ce[_0xe17d('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0xe17d('0x23')]=function(_0xa469ff){var _0x2063db=[];_0xa469ff[_0xe17d('0x5')](/[ ,]+/)[_0xe17d('0x24')](function(_0xf3eb2e){_0xf3eb2e=_0xf3eb2e['replace'](/([^:]")"+/g,'$1');_0xf3eb2e='+'+_0xf3eb2e+'*';if(_0xf3eb2e[_0xe17d('0x3')]('@'))_0xf3eb2e='\x22'+_0xf3eb2e+'\x22';_0x2063db[_0xe17d('0x25')](_0xf3eb2e);});return _0x2063db[_0xe17d('0x26')]('\x20');};exports['getOptions']=function(_0x35e6d2,_0x3d74e5,_0xdfc0a){var _0x655dd8={},_0x280d2a={};if(_0x3d74e5['query'][_0xe17d('0x27')]){_0x3d74e5['query']['id']=_0x3d74e5[_0xe17d('0x28')]['$id'];delete _0x3d74e5['query'][_0xe17d('0x27')];}_0x655dd8['model']=_[_0xe17d('0x15')](_0x35e6d2,_0xe17d('0x11'));_0x655dd8['query']=_[_0xe17d('0x2')](_0x3d74e5['query']);_0x655dd8[_0xe17d('0x6')]=_[_0xe17d('0x29')](_0x655dd8['model'],_0x655dd8[_0xe17d('0x28')]);_0x280d2a[_0xe17d('0x2a')]=_[_0xe17d('0x29')](_0x655dd8[_0xe17d('0x2b')],this[_0xe17d('0x4')](_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x4')]));_0x280d2a[_0xe17d('0x2a')]=_0x280d2a[_0xe17d('0x2a')][_0xe17d('0x1c')]?_0x280d2a[_0xe17d('0x2a')]:_0x655dd8['model'];if(!_0x3d74e5['query'][_0xe17d('0x1f')](_0xe17d('0x2c'))){_0x280d2a[_0xe17d('0x13')]=this[_0xe17d('0x13')](_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x13')]);_0x280d2a['offset']=this[_0xe17d('0x2d')](_0x3d74e5[_0xe17d('0x28')]['offset']);}_0x280d2a[_0xe17d('0x2e')]=this[_0xe17d('0x14')](_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x14')]);_0x280d2a[_0xe17d('0x2f')]=this[_0xe17d('0x6')](_[_0xe17d('0x30')](_0x3d74e5['query'],_0x655dd8[_0xe17d('0x6')]),_0x35e6d2);if(_0x3d74e5['query'][_0xe17d('0x31')]){_0x280d2a[_0xe17d('0x2f')]=_[_0xe17d('0x32')](_0x280d2a[_0xe17d('0x2f')],{'$or':_[_0xe17d('0x15')](_0x35e6d2,function(_0x5c705f){if(_0x5c705f['type']!==_0xe17d('0x33')){if(_0xdfc0a){return sequelize['where'](sequelize['fn'](_0xe17d('0x34'),sequelize[_0xe17d('0x19')](_0x5c705f[_0xe17d('0x11')])),{'$like':sequelize['fn'](_0xe17d('0x34'),'%'+_0x3d74e5[_0xe17d('0x28')]['filter']+'%')});}else{var _0x2cedd4={};_0x2cedd4[_0x5c705f[_0xe17d('0x11')]]={'$like':'%'+_0x3d74e5[_0xe17d('0x28')][_0xe17d('0x31')]+'%'};return _0x2cedd4;}}})});}_0x280d2a=_['merge']({},_0x280d2a,_0x3d74e5['options']);return _0x280d2a;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 46f403f..1b6a102 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbec8=['use','json\x20replacer','toISOString','views','html','ejs','renderFile','view\x20engine','urlencoded','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','moment','../mysqldb','default','get','env','production','set','appPath','join','root','public','test','client'];(function(_0x21eba6,_0x33067a){var _0x1fbead=function(_0x2a3cd7){while(--_0x2a3cd7){_0x21eba6['push'](_0x21eba6['shift']());}};_0x1fbead(++_0x33067a);}(_0xbec8,0x6b));var _0x8bec=function(_0x459963,_0x5a366a){_0x459963=_0x459963-0x0;var _0xbe84e3=_0xbec8[_0x459963];return _0xbe84e3;};'use strict';var express=require(_0x8bec('0x0'));var favicon=require(_0x8bec('0x1'));var bodyParser=require(_0x8bec('0x2'));var methodOverride=require(_0x8bec('0x3'));var cookieParser=require(_0x8bec('0x4'));var errorHandler=require(_0x8bec('0x5'));var path=require('path');var passport=require(_0x8bec('0x6'));var cors=require(_0x8bec('0x7'));var moment=require(_0x8bec('0x8'));var config=require('./environment');var db=require(_0x8bec('0x9'))['db'];exports[_0x8bec('0xa')]=function(_0x2bcd7f){var _0x141b96=_0x2bcd7f[_0x8bec('0xb')](_0x8bec('0xc'));if(_0x141b96===_0x8bec('0xd')){_0x2bcd7f[_0x8bec('0xe')](_0x8bec('0xf'),path[_0x8bec('0x10')](config[_0x8bec('0x11')],_0x8bec('0x12')));}if(_0x141b96==='development'||_0x141b96===_0x8bec('0x13')){_0x2bcd7f['set']('appPath',path[_0x8bec('0x10')](config[_0x8bec('0x11')],_0x8bec('0x14')));_0x2bcd7f[_0x8bec('0x15')](errorHandler());}_0x2bcd7f[_0x8bec('0xe')](_0x8bec('0x16'),function(_0x3b7531,_0x4fb343){if(this[_0x3b7531]instanceof Date){_0x4fb343=this[_0x3b7531][_0x8bec('0x17')]()['split']('.')[0x0]+'Z';}return _0x4fb343;});_0x2bcd7f[_0x8bec('0x15')](express['static'](_0x2bcd7f[_0x8bec('0xb')](_0x8bec('0xf'))));_0x2bcd7f[_0x8bec('0xe')](_0x8bec('0x18'),config[_0x8bec('0x11')]+'/server/views');_0x2bcd7f['engine'](_0x8bec('0x19'),require(_0x8bec('0x1a'))[_0x8bec('0x1b')]);_0x2bcd7f[_0x8bec('0xe')](_0x8bec('0x1c'),_0x8bec('0x19'));_0x2bcd7f[_0x8bec('0x15')](bodyParser[_0x8bec('0x1d')]({'limit':_0x8bec('0x1e'),'extended':!![]}));_0x2bcd7f[_0x8bec('0x15')](bodyParser['json']({'limit':_0x8bec('0x1e')}));_0x2bcd7f[_0x8bec('0x15')](cors());_0x2bcd7f[_0x8bec('0x15')](methodOverride());_0x2bcd7f[_0x8bec('0x15')](cookieParser());_0x2bcd7f[_0x8bec('0x15')](passport[_0x8bec('0x1f')]());}; \ No newline at end of file +var _0xcc59=['split','views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','errorhandler','cors','moment','./environment','../mysqldb','default','get','env','production','set','appPath','join','root','public','development','use','toISOString'];(function(_0x2a1845,_0x319e33){var _0x733165=function(_0x3073ce){while(--_0x3073ce){_0x2a1845['push'](_0x2a1845['shift']());}};_0x733165(++_0x319e33);}(_0xcc59,0x1ab));var _0x9cc5=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xcc59[_0x24f31b];return _0x488401;};'use strict';var express=require(_0x9cc5('0x0'));var favicon=require(_0x9cc5('0x1'));var bodyParser=require(_0x9cc5('0x2'));var methodOverride=require(_0x9cc5('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x9cc5('0x4'));var path=require('path');var passport=require('passport');var cors=require(_0x9cc5('0x5'));var moment=require(_0x9cc5('0x6'));var config=require(_0x9cc5('0x7'));var db=require(_0x9cc5('0x8'))['db'];exports[_0x9cc5('0x9')]=function(_0x2e4c4a){var _0x1c243a=_0x2e4c4a[_0x9cc5('0xa')](_0x9cc5('0xb'));if(_0x1c243a===_0x9cc5('0xc')){_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0xe'),path[_0x9cc5('0xf')](config[_0x9cc5('0x10')],_0x9cc5('0x11')));}if(_0x1c243a===_0x9cc5('0x12')||_0x1c243a==='test'){_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0xe'),path[_0x9cc5('0xf')](config['root'],'client'));_0x2e4c4a[_0x9cc5('0x13')](errorHandler());}_0x2e4c4a[_0x9cc5('0xd')]('json\x20replacer',function(_0x4a0230,_0x171ce4){if(this[_0x4a0230]instanceof Date){_0x171ce4=this[_0x4a0230][_0x9cc5('0x14')]()[_0x9cc5('0x15')]('.')[0x0]+'Z';}return _0x171ce4;});_0x2e4c4a['use'](express['static'](_0x2e4c4a[_0x9cc5('0xa')](_0x9cc5('0xe'))));_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0x16'),config[_0x9cc5('0x10')]+'/server/views');_0x2e4c4a[_0x9cc5('0x17')](_0x9cc5('0x18'),require(_0x9cc5('0x19'))[_0x9cc5('0x1a')]);_0x2e4c4a[_0x9cc5('0xd')](_0x9cc5('0x1b'),'html');_0x2e4c4a[_0x9cc5('0x13')](bodyParser[_0x9cc5('0x1c')]({'limit':'50mb','extended':!![]}));_0x2e4c4a[_0x9cc5('0x13')](bodyParser[_0x9cc5('0x1d')]({'limit':_0x9cc5('0x1e')}));_0x2e4c4a['use'](cors());_0x2e4c4a[_0x9cc5('0x13')](methodOverride());_0x2e4c4a['use'](cookieParser());_0x2e4c4a['use'](passport[_0x9cc5('0x1f')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 48a81a6..40b9391 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 _0x3c00=['00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','md5','update','digest','hex','getUuid','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','createHash','substring','lodash','crypto','child_process','execSync','../environment','orderBy','keys','length','filter','IPv4','concat','mac'];(function(_0x396e2f,_0x34478b){var _0x1879c6=function(_0x227be4){while(--_0x227be4){_0x396e2f['push'](_0x396e2f['shift']());}};_0x1879c6(++_0x34478b);}(_0x3c00,0xcc));var _0x03c0=function(_0x3834a0,_0x5e3a43){_0x3834a0=_0x3834a0-0x0;var _0xd1cae=_0x3c00[_0x3834a0];return _0xd1cae;};'use strict';var _=require(_0x03c0('0x0'));var os=require('os');var crypto=require(_0x03c0('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x03c0('0x2'))[_0x03c0('0x3')];var config=require(_0x03c0('0x4'));function getInterfaces(){var _0x2d1995=[];var _0x10cc8d=os['networkInterfaces']();var _0x40e2d2=_[_0x03c0('0x5')](_[_0x03c0('0x6')](_0x10cc8d));for(var _0x4f2ba2=0x0;_0x4f2ba2<_0x40e2d2[_0x03c0('0x7')];_0x4f2ba2++){var _0x682e60=_0x10cc8d[_0x40e2d2[_0x4f2ba2]][_0x03c0('0x8')](function(_0xf52e21){return _0xf52e21['family']===_0x03c0('0x9')&&_0xf52e21['internal']===![];});_0x2d1995=_0x2d1995[_0x03c0('0xa')](_0x682e60);}return _0x2d1995;}function getFirstInterface(){var _0x386a4d=_['head'](getInterfaces());return{'macAddress':_0x386a4d&&_0x386a4d[_0x03c0('0xb')]?_0x386a4d[_0x03c0('0xb')]:_0x03c0('0xc'),'ipAddress':_0x386a4d&&_0x386a4d['address']?_0x386a4d[_0x03c0('0xd')]:_0x03c0('0xe')};}exports[_0x03c0('0xf')]=getFirstInterface;function getCPUhash(){var _0x40f942=_['orderBy'](os[_0x03c0('0x10')]()[_0x03c0('0x11')](function(_0x369210){return _0x369210[_0x03c0('0x12')];}))[_0x03c0('0x13')](':');return crypto['createHash'](_0x03c0('0x14'))[_0x03c0('0x15')](_0x40f942)[_0x03c0('0x16')](_0x03c0('0x17'));}exports[_0x03c0('0x18')]=function(){var _0x1c6ca1=os['platform']();var _0x4b9e9a=/[0-9a-f-]{36}/;if(config[_0x03c0('0x19')]&&_0x4b9e9a[_0x03c0('0x1a')](config['licenseToken'])){return config[_0x03c0('0x19')];}else if(_0x1c6ca1===_0x03c0('0x1b')){return exec(_0x03c0('0x1c'),{'encoding':_0x03c0('0x1d')})[_0x03c0('0x1e')]('\x0d\x0a','');}else{var _0x2c0b93=getFirstInterface();var _0x4e9f39=getCPUhash();var _0x5e4874=_0x4e9f39+'|'+os[_0x03c0('0x1f')]()+'|'+_0x2c0b93[_0x03c0('0x20')]+'|'+_0x2c0b93[_0x03c0('0x21')];var _0x4882be=crypto[_0x03c0('0x22')](_0x03c0('0x14'))[_0x03c0('0x15')](_0x5e4874)[_0x03c0('0x16')]('hex');return _0x4882be['substring'](0x0,0x8)+'-'+_0x4882be['substring'](0x8,0xc)+'-'+_0x4882be['substring'](0xc,0x10)+'-'+_0x4882be['substring'](0x10,0x14)+'-'+_0x4882be[_0x03c0('0x23')](0x14);}}; \ No newline at end of file +var _0xd7b4=['win32','utf8','replace','macAddress','ipAddress','digest','substring','crypto','bimedia-machine-uuid','execSync','keys','filter','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','map','join','createHash','md5','update','hex','platform','test'];(function(_0x32da70,_0x5dfdc3){var _0x3a40cc=function(_0xf0217b){while(--_0xf0217b){_0x32da70['push'](_0x32da70['shift']());}};_0x3a40cc(++_0x5dfdc3);}(_0xd7b4,0x98));var _0x4d7b=function(_0x23e5d2,_0x415e7a){_0x23e5d2=_0x23e5d2-0x0;var _0x51ee49=_0xd7b4[_0x23e5d2];return _0x51ee49;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x4d7b('0x0'));var machine=require(_0x4d7b('0x1'));var exec=require('child_process')[_0x4d7b('0x2')];var config=require('../environment');function getInterfaces(){var _0x537c4b=[];var _0x36e244=os['networkInterfaces']();var _0x3d438a=_['orderBy'](_[_0x4d7b('0x3')](_0x36e244));for(var _0xbd671a=0x0;_0xbd671a<_0x3d438a['length'];_0xbd671a++){var _0x4d2f29=_0x36e244[_0x3d438a[_0xbd671a]][_0x4d7b('0x4')](function(_0x4bc318){return _0x4bc318['family']===_0x4d7b('0x5')&&_0x4bc318[_0x4d7b('0x6')]===![];});_0x537c4b=_0x537c4b['concat'](_0x4d2f29);}return _0x537c4b;}function getFirstInterface(){var _0x221933=_[_0x4d7b('0x7')](getInterfaces());return{'macAddress':_0x221933&&_0x221933[_0x4d7b('0x8')]?_0x221933[_0x4d7b('0x8')]:_0x4d7b('0x9'),'ipAddress':_0x221933&&_0x221933[_0x4d7b('0xa')]?_0x221933['address']:_0x4d7b('0xb')};}exports[_0x4d7b('0xc')]=getFirstInterface;function getCPUhash(){var _0x294975=_[_0x4d7b('0xd')](os['cpus']()[_0x4d7b('0xe')](function(_0x12e126){return _0x12e126['model'];}))[_0x4d7b('0xf')](':');return crypto[_0x4d7b('0x10')](_0x4d7b('0x11'))[_0x4d7b('0x12')](_0x294975)['digest'](_0x4d7b('0x13'));}exports['getUuid']=function(){var _0x6e22d0=os[_0x4d7b('0x14')]();var _0x86f504=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x86f504[_0x4d7b('0x15')](config['licenseToken'])){return config['licenseToken'];}else if(_0x6e22d0===_0x4d7b('0x16')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4d7b('0x17')})[_0x4d7b('0x18')]('\x0d\x0a','');}else{var _0x3f4f64=getFirstInterface();var _0x1aaa43=getCPUhash();var _0x49d0de=_0x1aaa43+'|'+os['hostname']()+'|'+_0x3f4f64[_0x4d7b('0x19')]+'|'+_0x3f4f64[_0x4d7b('0x1a')];var _0x3ef37e=crypto[_0x4d7b('0x10')](_0x4d7b('0x11'))[_0x4d7b('0x12')](_0x49d0de)[_0x4d7b('0x1b')](_0x4d7b('0x13'));return _0x3ef37e[_0x4d7b('0x1c')](0x0,0x8)+'-'+_0x3ef37e['substring'](0x8,0xc)+'-'+_0x3ef37e[_0x4d7b('0x1c')](0xc,0x10)+'-'+_0x3ef37e[_0x4d7b('0x1c')](0x10,0x14)+'-'+_0x3ef37e[_0x4d7b('0x1c')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 383ebe6..7d7af24 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 _0xfbf8=['exports','GET','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','moment','bluebird','version','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x401a08,_0x3f69e1){var _0x592fec=function(_0x3bc23b){while(--_0x3bc23b){_0x401a08['push'](_0x401a08['shift']());}};_0x592fec(++_0x3f69e1);}(_0xfbf8,0x6b));var _0x8fbf=function(_0x13668f,_0x31edcc){_0x13668f=_0x13668f-0x0;var _0x57bfba=_0xfbf8[_0x13668f];return _0x57bfba;};'use strict';var util=require('util');var moment=require(_0x8fbf('0x0'));var rp=require('request-promise');var BPromise=require(_0x8fbf('0x1'));var pkginfo=require('pkginfo')(module,_0x8fbf('0x2'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x8fbf('0x3'));var hardware=require(_0x8fbf('0x4'));var logger=require(_0x8fbf('0x5'))('license');var HOST=_0x8fbf('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x510141){return new BPromise(function(_0x4227cd,_0x2db3e3){var _0x467d63=util[_0x8fbf('0x7')](_0x8fbf('0x8'),HOST,_0x510141,module['exports']['version']);if(oldToken){_0x467d63=util['format'](_0x8fbf('0x9'),HOST,_0x510141,module[_0x8fbf('0xa')][_0x8fbf('0x2')],oldToken);}var _0x98c7c7={'uri':_0x467d63,'method':_0x8fbf('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x98c7c7)['then'](function(_0xd9a543){_0x4227cd(_0xd9a543);})['catch'](function(_0x3ca7c4){_0x2db3e3(_0x3ca7c4);});});}function manageLicense(_0x43ac42,_0x5e0218){var _0x468bee=_0x5e0218['get']({'plain':!![]});if(!isOldTokenSent&&_0x468bee[_0x8fbf('0xc')]!==_0x43ac42&&!_0x468bee[_0x8fbf('0xd')]){oldToken=_0x468bee[_0x8fbf('0xc')];}httpRequest(_0x43ac42)[_0x8fbf('0xe')](function(_0x57cecb){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x57cecb[_0x8fbf('0xf')]){isOldTokenSent=![];if(!_0x468bee[_0x8fbf('0x10')]&&_0x468bee['license']!=_0x57cecb[_0x8fbf('0x10')]||_0x468bee['license']&&_0x468bee[_0x8fbf('0xd')]){logger[_0x8fbf('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x468bee[_0x8fbf('0x10')]&&!_0x468bee[_0x8fbf('0xd')]&&_0x468bee[_0x8fbf('0x10')]!=_0x57cecb[_0x8fbf('0x10')]){logger['info'](_0x8fbf('0x12'));}if(_0x468bee[_0x8fbf('0x10')]&&!_0x468bee['data2']&&_0x468bee[_0x8fbf('0x10')]==_0x57cecb[_0x8fbf('0x10')]){return _0x5e0218;}return _0x5e0218[_0x8fbf('0x13')]({'data1':_0x43ac42,'data2':null,'license':_0x57cecb[_0x8fbf('0x10')]});}else{if(_0x57cecb[_0x8fbf('0x10')]||_0x468bee[_0x8fbf('0x10')]){if(!_0x468bee[_0x8fbf('0xd')]){if(_0x468bee[_0x8fbf('0xc')]==_0x43ac42){GRAY_PERIOD_REASON=_0x8fbf('0x14');logger[_0x8fbf('0x11')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x8fbf('0x11')](_0x8fbf('0x15'),_0x468bee[_0x8fbf('0xc')],_0x43ac42);}logger[_0x8fbf('0x11')](_0x8fbf('0x16'),GRAY_PERIOD_REASON[_0x8fbf('0x17')](),moment()[_0x8fbf('0x7')](_0x8fbf('0x18')));return _0x5e0218[_0x8fbf('0x13')]({'data2':encryptor[_0x8fbf('0x19')](moment()[_0x8fbf('0x7')](_0x8fbf('0x18')))});}else{if(moment()[_0x8fbf('0x1a')](encryptor[_0x8fbf('0x1b')](_0x468bee[_0x8fbf('0xd')]),_0x8fbf('0x1c'))>DAYS){logger[_0x8fbf('0x11')]('DEMO\x20START\x20AT\x20%s',moment()[_0x8fbf('0x7')](_0x8fbf('0x18')));isOldTokenSent=![];return _0x5e0218['update']({'data1':_0x43ac42,'data2':null,'license':null});}}}else{if(_0x468bee[_0x8fbf('0xc')]!=_0x43ac42){logger[_0x8fbf('0x11')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x468bee[_0x8fbf('0xc')],_0x43ac42);return _0x5e0218['update']({'data1':_0x43ac42,'data2':null,'license':null});}}}return _0x5e0218;})[_0x8fbf('0xe')](function(_0x1ac187){_0x5e0218=_0x1ac187;})[_0x8fbf('0x1d')](function(_0x279160){logger[_0x8fbf('0x1e')](_0x279160[_0x8fbf('0x1f')]);})[_0x8fbf('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x8fbf('0x21')](),_0x5e0218);},TIME);});}function defaultLicense(){var _0x3f584c=hardware[_0x8fbf('0x21')]();if(_0x3f584c){return db[_0x8fbf('0x22')][_0x8fbf('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x3f584c}})[_0x8fbf('0x24')](function(_0x207e7c,_0x243e75){logger['info'](_0x8fbf('0x25'),_0x3f584c);manageLicense(_0x3f584c,_0x207e7c);})[_0x8fbf('0x1d')](function(_0x3c7d39){logger['error'](_0x3c7d39[_0x8fbf('0x1f')]);});}}exports[_0x8fbf('0x26')]=defaultLicense; \ No newline at end of file +var _0xe8df=['days','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','license','https://www.xcallymotion.com','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','format','diff','decryptString'];(function(_0x32ff1d,_0x3e29bb){var _0x50489e=function(_0x588ff3){while(--_0x588ff3){_0x32ff1d['push'](_0x32ff1d['shift']());}};_0x50489e(++_0x3e29bb);}(_0xe8df,0x171));var _0xfe8d=function(_0x2f1ec4,_0x4099aa){_0x2f1ec4=_0x2f1ec4-0x0;var _0x148894=_0xe8df[_0x2f1ec4];return _0x148894;};'use strict';var util=require(_0xfe8d('0x0'));var moment=require(_0xfe8d('0x1'));var rp=require(_0xfe8d('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0xfe8d('0x3'))(module,_0xfe8d('0x4'));var db=require(_0xfe8d('0x5'))['db'];var encryptor=require(_0xfe8d('0x6'));var hardware=require(_0xfe8d('0x7'));var logger=require('../logger')(_0xfe8d('0x8'));var HOST=_0xfe8d('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0xd6601d){return new BPromise(function(_0x3c5425,_0x1bace1){var _0x3167b1=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0xd6601d,module[_0xfe8d('0xa')][_0xfe8d('0x4')]);if(oldToken){_0x3167b1=util['format'](_0xfe8d('0xb'),HOST,_0xd6601d,module[_0xfe8d('0xa')][_0xfe8d('0x4')],oldToken);}var _0x171909={'uri':_0x3167b1,'method':_0xfe8d('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x171909)[_0xfe8d('0xd')](function(_0x52ff11){_0x3c5425(_0x52ff11);})[_0xfe8d('0xe')](function(_0x44eb8c){_0x1bace1(_0x44eb8c);});});}function manageLicense(_0x24f522,_0xd54644){var _0x30e480=_0xd54644['get']({'plain':!![]});if(!isOldTokenSent&&_0x30e480[_0xfe8d('0xf')]!==_0x24f522&&!_0x30e480[_0xfe8d('0x10')]){oldToken=_0x30e480['data1'];}httpRequest(_0x24f522)[_0xfe8d('0xd')](function(_0x1e4e2e){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1e4e2e['active']){isOldTokenSent=![];if(!_0x30e480[_0xfe8d('0x8')]&&_0x30e480[_0xfe8d('0x8')]!=_0x1e4e2e[_0xfe8d('0x8')]||_0x30e480[_0xfe8d('0x8')]&&_0x30e480[_0xfe8d('0x10')]){logger[_0xfe8d('0x11')](_0xfe8d('0x12'));}if(_0x30e480[_0xfe8d('0x8')]&&!_0x30e480[_0xfe8d('0x10')]&&_0x30e480[_0xfe8d('0x8')]!=_0x1e4e2e[_0xfe8d('0x8')]){logger['info'](_0xfe8d('0x13'));}if(_0x30e480['license']&&!_0x30e480[_0xfe8d('0x10')]&&_0x30e480[_0xfe8d('0x8')]==_0x1e4e2e[_0xfe8d('0x8')]){return _0xd54644;}return _0xd54644[_0xfe8d('0x14')]({'data1':_0x24f522,'data2':null,'license':_0x1e4e2e[_0xfe8d('0x8')]});}else{if(_0x1e4e2e[_0xfe8d('0x8')]||_0x30e480[_0xfe8d('0x8')]){if(!_0x30e480[_0xfe8d('0x10')]){if(_0x30e480[_0xfe8d('0xf')]==_0x24f522){GRAY_PERIOD_REASON=_0xfe8d('0x15');logger[_0xfe8d('0x11')](_0xfe8d('0x16'));}else{GRAY_PERIOD_REASON=_0xfe8d('0x17');logger[_0xfe8d('0x11')](_0xfe8d('0x18'),_0x30e480[_0xfe8d('0xf')],_0x24f522);}logger[_0xfe8d('0x11')](_0xfe8d('0x19'),GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xfe8d('0x1a')));return _0xd54644[_0xfe8d('0x14')]({'data2':encryptor[_0xfe8d('0x1b')](moment()[_0xfe8d('0x1c')](_0xfe8d('0x1a')))});}else{if(moment()[_0xfe8d('0x1d')](encryptor[_0xfe8d('0x1e')](_0x30e480[_0xfe8d('0x10')]),_0xfe8d('0x1f'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xfe8d('0x1c')](_0xfe8d('0x1a')));isOldTokenSent=![];return _0xd54644[_0xfe8d('0x14')]({'data1':_0x24f522,'data2':null,'license':null});}}}else{if(_0x30e480[_0xfe8d('0xf')]!=_0x24f522){logger[_0xfe8d('0x11')](_0xfe8d('0x18'),_0x30e480[_0xfe8d('0xf')],_0x24f522);return _0xd54644[_0xfe8d('0x14')]({'data1':_0x24f522,'data2':null,'license':null});}}}return _0xd54644;})['then'](function(_0x77a141){_0xd54644=_0x77a141;})[_0xfe8d('0xe')](function(_0x328c6b){logger['error'](_0x328c6b[_0xfe8d('0x20')]);})[_0xfe8d('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0xfe8d('0x22')](),_0xd54644);},TIME);});}function defaultLicense(){var _0x9c8b9a=hardware['getUuid']();if(_0x9c8b9a){return db[_0xfe8d('0x23')][_0xfe8d('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x9c8b9a}})[_0xfe8d('0x25')](function(_0x36be94,_0x1b41aa){logger[_0xfe8d('0x11')](_0xfe8d('0x26'),_0x9c8b9a);manageLicense(_0x9c8b9a,_0x36be94);})[_0xfe8d('0xe')](function(_0x353026){logger[_0xfe8d('0x27')](_0x353026[_0xfe8d('0x20')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 06a1fdd..cbb883d 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 _0xf1ac=['machineUuid','gray','add','grayReason','changed','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','users','telephones','forEach','countBy','telephone','License\x20limit\x20reached\x20for\x20users','exports','./hardware','../../components/encryptor','2027-01-01T00:00:00.000Z','Breaking\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','License\x20key\x20value\x20not\x20found','data2','split','decryptString','parse'];(function(_0x4d9c49,_0x4bf2dd){var _0x451615=function(_0x1fe8b5){while(--_0x1fe8b5){_0x4d9c49['push'](_0x4d9c49['shift']());}};_0x451615(++_0x4bf2dd);}(_0xf1ac,0x100));var _0xcf1a=function(_0x1a87b3,_0x45ba68){_0x1a87b3=_0x1a87b3-0x0;var _0x37e84d=_0xf1ac[_0x1a87b3];return _0x37e84d;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var hardware=require(_0xcf1a('0x0'));var encryptor=require(_0xcf1a('0x1'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcf1a('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xcf1a('0x2'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xcf1a('0x3'),'machineUuid':hardware[_0xcf1a('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x506166){return new BPromise(function(_0x52a0c0,_0x51aeec){return db[_0xcf1a('0x5')][_0xcf1a('0x6')](_[_0xcf1a('0x7')](_0x506166,{'raw':!![],'where':{'id':0x1}}))[_0xcf1a('0x8')](function(_0x8bc6a6){return checkLicense(_0x8bc6a6,null);})[_0xcf1a('0x8')](function(_0x2db180){_0x52a0c0(_0x2db180);return;})[_0xcf1a('0x9')](function(_0x127cf0){_0x51aeec(_0x127cf0);});});}function checkLicense(_0x1a187f,_0x199302){if(!_0x1a187f){demoLicense[_0xcf1a('0xa')]=_0x1a187f[_0xcf1a('0xb')];return demoLicense;}try{var _0x5f5089=_0x199302||_0x1a187f['license'];if(_['isEmpty'](_0x5f5089)){throw new Error(_0xcf1a('0xc'));}var _0x57621c=_0x1a187f[_0xcf1a('0xb')];var _0x58213f=_0x1a187f[_0xcf1a('0xd')];var _0x57dc4b=_0x57621c[_0xcf1a('0xe')]('-')[0x4];var _0x13726d=_0x57621c[_0xcf1a('0xe')]('-')[0x0];var _0x40f22f=encryptor[_0xcf1a('0xf')](_0x5f5089,util['format']('%s:%s:%s',_0x57dc4b,_0x57621c,_0x13726d));var _0x4354bf=JSON[_0xcf1a('0x10')](_0x40f22f);_0x4354bf['demo']=![];_0x4354bf[_0xcf1a('0xa')]=_0x57621c;_0x4354bf[_0xcf1a('0x11')]=hardware[_0xcf1a('0x4')]();if(_0x58213f){var _0xeee4b5=encryptor[_0xcf1a('0xf')](_0x58213f);_0x4354bf[_0xcf1a('0x12')]=_0xeee4b5;_0x4354bf['deadline']=moment(_0xeee4b5)[_0xcf1a('0x13')](0x7,'days')['format']();_0x4354bf[_0xcf1a('0x14')]=_0x4354bf[_0xcf1a('0xa')]!=_0x4354bf[_0xcf1a('0x11')]?_0xcf1a('0x15'):'disabled';}return _0x4354bf;}catch(_0x96038f){breakingLicense['uuid']=_0x1a187f[_0xcf1a('0xb')];breakingLicense[_0xcf1a('0x16')]=_0x96038f[_0xcf1a('0x16')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3e7c19,_0x15fa9b){getLicense()[_0xcf1a('0x8')](function(_0x588cea){return db[_0xcf1a('0x17')][_0xcf1a('0x18')]({'attributes':[_0xcf1a('0x19'),[db[_0xcf1a('0x1a')]['fn'](_0xcf1a('0x1b'),db['sequelize'][_0xcf1a('0x1c')](_0xcf1a('0x19'))),_0xcf1a('0x1d')]],'group':_0xcf1a('0x19'),'where':{'role':{'$or':[_0xcf1a('0x1e'),_0xcf1a('0x1f'),'telephone']}},'raw':!![]})[_0xcf1a('0x8')](function(_0x3d19f6){var _0x252cc0={'user':_0x588cea[_0xcf1a('0x20')]||0x0,'telephone':_0x588cea[_0xcf1a('0x21')]||0x0};_0x3d19f6[_0xcf1a('0x22')](function(_0x126a73){var _0xf8768a=_0x126a73[_0xcf1a('0x19')]==='admin'?_0xcf1a('0x1f'):_0x126a73['role'];_0x252cc0[_0xf8768a]-=_0x126a73[_0xcf1a('0x1d')];if(_0x252cc0[_0xf8768a]<0x0)_0x252cc0[_0xf8768a]=0x0;});_0x3e7c19(_0x252cc0);return;});})[_0xcf1a('0x9')](function(_0x174b54){_0x15fa9b(_0x174b54);});});}function checkUserLimits(_0x13c967){return new BPromise(function(_0xc5945e,_0xf94dae){getLimits()['then'](function(_0x3e05f6){var _0x2c7406=_['pick'](_[_0xcf1a('0x23')](_0x13c967,_0xcf1a('0x19')),[_0xcf1a('0x1e'),_0xcf1a('0x1f'),'telephone']);var _0x266487=(_0x2c7406[_0xcf1a('0x1e')]||0x0)+(_0x2c7406[_0xcf1a('0x1f')]||0x0);var _0x49b636=_0x2c7406[_0xcf1a('0x24')]||0x0;if(_0x266487>_0x3e05f6[_0xcf1a('0x1f')])return _0xf94dae(_0xcf1a('0x25'));if(_0x49b636>_0x3e05f6[_0xcf1a('0x24')])return _0xf94dae('License\x20limit\x20reached\x20for\x20telephones');return _0xc5945e();})[_0xcf1a('0x9')](function(_0x234da9){_0xf94dae(_0x234da9);});});}module[_0xcf1a('0x26')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x4c08=['defaults','then','catch','uuid','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','demo','machineUuid','gray','deadline','add','disabled','data1','message','User','findAll','role','sequelize','COUNT','col','user','users','telephones','forEach','pick','countBy','admin','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find'];(function(_0x379d6e,_0x3e0404){var _0x261bcf=function(_0x39033a){while(--_0x39033a){_0x379d6e['push'](_0x379d6e['shift']());}};_0x261bcf(++_0x3e0404);}(_0x4c08,0xb1));var _0x84c0=function(_0xb99421,_0xaab133){_0xb99421=_0xb99421-0x0;var _0x4b3ec7=_0x4c08[_0xb99421];return _0x4b3ec7;};'use strict';var util=require(_0x84c0('0x0'));var _=require(_0x84c0('0x1'));var moment=require(_0x84c0('0x2'));var BPromise=require('bluebird');var hardware=require(_0x84c0('0x3'));var encryptor=require('../../components/encryptor');var db=require(_0x84c0('0x4'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x84c0('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x84c0('0x6'),'machineUuid':hardware[_0x84c0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x84c0('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x84c0('0x8'),'machineUuid':hardware[_0x84c0('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x3c632d){return new BPromise(function(_0x1f3eff,_0x5bd81b){return db[_0x84c0('0x9')][_0x84c0('0xa')](_[_0x84c0('0xb')](_0x3c632d,{'raw':!![],'where':{'id':0x1}}))[_0x84c0('0xc')](function(_0x3fab24){return checkLicense(_0x3fab24,null);})['then'](function(_0x513584){_0x1f3eff(_0x513584);return;})[_0x84c0('0xd')](function(_0x336efc){_0x5bd81b(_0x336efc);});});}function checkLicense(_0x41f70a,_0x18689){if(!_0x41f70a){demoLicense[_0x84c0('0xe')]=_0x41f70a['data1'];return demoLicense;}try{var _0x3e3d6e=_0x18689||_0x41f70a[_0x84c0('0xf')];if(_['isEmpty'](_0x3e3d6e)){throw new Error(_0x84c0('0x10'));}var _0x2e5bc6=_0x41f70a['data1'];var _0x42ba7e=_0x41f70a[_0x84c0('0x11')];var _0x115290=_0x2e5bc6[_0x84c0('0x12')]('-')[0x4];var _0x1f3c76=_0x2e5bc6[_0x84c0('0x12')]('-')[0x0];var _0x389197=encryptor[_0x84c0('0x13')](_0x3e3d6e,util[_0x84c0('0x14')](_0x84c0('0x15'),_0x115290,_0x2e5bc6,_0x1f3c76));var _0x4c1b7c=JSON['parse'](_0x389197);_0x4c1b7c[_0x84c0('0x16')]=![];_0x4c1b7c[_0x84c0('0xe')]=_0x2e5bc6;_0x4c1b7c[_0x84c0('0x17')]=hardware[_0x84c0('0x7')]();if(_0x42ba7e){var _0x411b36=encryptor[_0x84c0('0x13')](_0x42ba7e);_0x4c1b7c[_0x84c0('0x18')]=_0x411b36;_0x4c1b7c[_0x84c0('0x19')]=moment(_0x411b36)[_0x84c0('0x1a')](0x7,'days')['format']();_0x4c1b7c['grayReason']=_0x4c1b7c[_0x84c0('0xe')]!=_0x4c1b7c[_0x84c0('0x17')]?'changed':_0x84c0('0x1b');}return _0x4c1b7c;}catch(_0x314b6b){breakingLicense[_0x84c0('0xe')]=_0x41f70a[_0x84c0('0x1c')];breakingLicense['message']=_0x314b6b[_0x84c0('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x15f23f,_0x24dcca){getLicense()[_0x84c0('0xc')](function(_0x25fca7){return db[_0x84c0('0x1e')][_0x84c0('0x1f')]({'attributes':[_0x84c0('0x20'),[db[_0x84c0('0x21')]['fn'](_0x84c0('0x22'),db['sequelize'][_0x84c0('0x23')](_0x84c0('0x20'))),'count']],'group':'role','where':{'role':{'$or':['admin',_0x84c0('0x24'),'telephone']}},'raw':!![]})[_0x84c0('0xc')](function(_0x4f2e53){var _0x466a30={'user':_0x25fca7[_0x84c0('0x25')]||0x0,'telephone':_0x25fca7[_0x84c0('0x26')]||0x0};_0x4f2e53[_0x84c0('0x27')](function(_0x2aeb5d){var _0x4bea68=_0x2aeb5d[_0x84c0('0x20')]==='admin'?_0x84c0('0x24'):_0x2aeb5d[_0x84c0('0x20')];_0x466a30[_0x4bea68]-=_0x2aeb5d['count'];if(_0x466a30[_0x4bea68]<0x0)_0x466a30[_0x4bea68]=0x0;});_0x15f23f(_0x466a30);return;});})[_0x84c0('0xd')](function(_0x2c16f9){_0x24dcca(_0x2c16f9);});});}function checkUserLimits(_0x2e47b1){return new BPromise(function(_0x4f9a0f,_0x5b5679){getLimits()[_0x84c0('0xc')](function(_0x4d6d27){var _0x25381d=_[_0x84c0('0x28')](_[_0x84c0('0x29')](_0x2e47b1,_0x84c0('0x20')),[_0x84c0('0x2a'),_0x84c0('0x24'),_0x84c0('0x2b')]);var _0x2068a5=(_0x25381d[_0x84c0('0x2a')]||0x0)+(_0x25381d[_0x84c0('0x24')]||0x0);var _0x3a37f5=_0x25381d[_0x84c0('0x2b')]||0x0;if(_0x2068a5>_0x4d6d27[_0x84c0('0x24')])return _0x5b5679(_0x84c0('0x2c'));if(_0x3a37f5>_0x4d6d27['telephone'])return _0x5b5679(_0x84c0('0x2d'));return _0x4f9a0f();})[_0x84c0('0xd')](function(_0x4ed38f){_0x5b5679(_0x4ed38f);});});}module[_0x84c0('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index e1993ea..af5f726 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 _0x7880=['http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x309dd3,_0x1089f7){var _0x139965=function(_0x15ba73){while(--_0x15ba73){_0x309dd3['push'](_0x309dd3['shift']());}};_0x139965(++_0x1089f7);}(_0x7880,0x1f4));var _0x0788=function(_0x53b611,_0x2912fa){_0x53b611=_0x53b611-0x0;var _0x5649aa=_0x7880[_0x53b611];return _0x5649aa;};'use strict';module['exports']={'DOMAIN':_0x0788('0x0'),'SESSION_SECRET':_0x0788('0x1'),'GOOGLE_ID':_0x0788('0x2'),'GOOGLE_SECRET':_0x0788('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x0598=['http://localhost:9000','app-id','exports'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x0598,0x92));var _0x8059=function(_0x39af19,_0x39e8c0){_0x39af19=_0x39af19-0x0;var _0x22673a=_0x0598[_0x39af19];return _0x22673a;};'use strict';module[_0x8059('0x0')]={'DOMAIN':_0x8059('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x8059('0x2'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index bd31a73..07e19d3 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb1e=['File','%s-%s','info','Console','debugLevel','moment','winston','util','join','/var','log','xcally','format','message','replace','{{{','}}}','level','exports','transports','error'];(function(_0x2872b0,_0x4b0855){var _0x58b379=function(_0x18954b){while(--_0x18954b){_0x2872b0['push'](_0x2872b0['shift']());}};_0x58b379(++_0x4b0855);}(_0xeb1e,0x1be));var _0xeeb1=function(_0x7aa412,_0x5c7546){_0x7aa412=_0x7aa412-0x0;var _0x5c8e36=_0xeb1e[_0x7aa412];return _0x5c8e36;};'use strict';var moment=require(_0xeeb1('0x0'));var winston=require(_0xeeb1('0x1'));var util=require(_0xeeb1('0x2'));var path=require('path');var debugLevel='INFO';function filename(_0x28ef30,_0x1ef321){return path[_0xeeb1('0x3')](_0xeeb1('0x4'),_0xeeb1('0x5'),_0xeeb1('0x6'),util[_0xeeb1('0x7')]('%s-%s.log',_0x28ef30,_0x1ef321));}function formatter(_0x2198e5,_0x5e68ca){_0x5e68ca[_0xeeb1('0x8')]=_0x5e68ca[_0xeeb1('0x8')][_0xeeb1('0x9')](/@@{/g,_0xeeb1('0xa'))[_0xeeb1('0x9')](/}@@/g,_0xeeb1('0xb'))[_0xeeb1('0x9')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xeeb1('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0xeeb1('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x5e68ca[_0xeeb1('0xc')]['toUpperCase'](),_0x2198e5,_0x5e68ca['message']);}module[_0xeeb1('0xd')]=function(_0x493cf5){return new winston['Logger']({'transports':[new winston[(_0xeeb1('0xe'))]['File']({'name':util[_0xeeb1('0x7')]('%s-%s',_0x493cf5,_0xeeb1('0xf')),'filename':filename(_0x493cf5,'error'),'level':_0xeeb1('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x530137){return formatter(_0x493cf5,_0x530137);}}),new winston[(_0xeeb1('0xe'))][(_0xeeb1('0x10'))]({'name':util[_0xeeb1('0x7')](_0xeeb1('0x11'),_0x493cf5,_0xeeb1('0x12')),'filename':filename(_0x493cf5,'info'),'level':_0xeeb1('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x48e7ef){return formatter(_0x493cf5,_0x48e7ef);}}),new winston[(_0xeeb1('0xe'))][(_0xeeb1('0x13'))]({'level':process['env'][_0xeeb1('0x14')]||debugLevel,'json':![],'formatter':function(_0x493808){return formatter(_0x493cf5,_0x493808);}})]});}; \ No newline at end of file +var _0x16bf=['/var','log','xcally','%s-%s.log','message','replace','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','File','error','transports','%s-%s','info','env','debugLevel','winston','util','path','INFO','join'];(function(_0x42698b,_0x8a72c8){var _0x2f6de0=function(_0x2bb94d){while(--_0x2bb94d){_0x42698b['push'](_0x42698b['shift']());}};_0x2f6de0(++_0x8a72c8);}(_0x16bf,0x1ab));var _0xf16b=function(_0xb32c85,_0x45545a){_0xb32c85=_0xb32c85-0x0;var _0x4865d9=_0x16bf[_0xb32c85];return _0x4865d9;};'use strict';var moment=require('moment');var winston=require(_0xf16b('0x0'));var util=require(_0xf16b('0x1'));var path=require(_0xf16b('0x2'));var debugLevel=_0xf16b('0x3');function filename(_0x171c3c,_0x3c049d){return path[_0xf16b('0x4')](_0xf16b('0x5'),_0xf16b('0x6'),_0xf16b('0x7'),util['format'](_0xf16b('0x8'),_0x171c3c,_0x3c049d));}function formatter(_0x59254c,_0x12f67c){_0x12f67c[_0xf16b('0x9')]=_0x12f67c['message'][_0xf16b('0xa')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0xf16b('0xa')](/@{/g,'{{')[_0xf16b('0xa')](/}@/g,'}}');return util[_0xf16b('0xb')](_0xf16b('0xc'),moment()[_0xf16b('0xb')](_0xf16b('0xd')),_0x12f67c[_0xf16b('0xe')]['toUpperCase'](),_0x59254c,_0x12f67c[_0xf16b('0x9')]);}module[_0xf16b('0xf')]=function(_0x2b111d){return new winston[(_0xf16b('0x10'))]({'transports':[new winston['transports'][(_0xf16b('0x11'))]({'name':util[_0xf16b('0xb')]('%s-%s',_0x2b111d,'error'),'filename':filename(_0x2b111d,_0xf16b('0x12')),'level':_0xf16b('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xbaa561){return formatter(_0x2b111d,_0xbaa561);}}),new winston[(_0xf16b('0x13'))][(_0xf16b('0x11'))]({'name':util[_0xf16b('0xb')](_0xf16b('0x14'),_0x2b111d,'info'),'filename':filename(_0x2b111d,_0xf16b('0x15')),'level':_0xf16b('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x183dd1){return formatter(_0x2b111d,_0x183dd1);}}),new winston[(_0xf16b('0x13'))]['Console']({'level':process[_0xf16b('0x16')][_0xf16b('0x17')]||debugLevel,'json':![],'formatter':function(_0x59e21d){return formatter(_0x2b111d,_0x59e21d);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 3a094ef..c75cdd7 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 _0xe378=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','../../services/express/index.js','join','agi','../../services/email/index.js','routing'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe378,0x90));var _0x8e37=function(_0x40c1ce,_0x174a7d){_0x40c1ce=_0x40c1ce-0x0;var _0x3eb837=_0xe378[_0x40c1ce];return _0x3eb837;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x8e37('0x0'),'script':path['join'](__dirname,_0x8e37('0x1'))},{'name':'ami','script':path[_0x8e37('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x8e37('0x3'),'script':path[_0x8e37('0x2')](__dirname,'../../services/agi/index.js')},{'name':'email','script':path[_0x8e37('0x2')](__dirname,_0x8e37('0x4'))},{'name':_0x8e37('0x5'),'script':path[_0x8e37('0x2')](__dirname,_0x8e37('0x6'))},{'name':_0x8e37('0x7'),'script':path['join'](__dirname,_0x8e37('0x8'))}]};module[_0x8e37('0x9')]=config; \ No newline at end of file +var _0x8feb=['../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','email','routing','../../services/xdr/index.js','exports','path','express'];(function(_0x3cbf12,_0x4b9dd0){var _0x507ae7=function(_0x41e907){while(--_0x41e907){_0x3cbf12['push'](_0x3cbf12['shift']());}};_0x507ae7(++_0x4b9dd0);}(_0x8feb,0xca));var _0xb8fe=function(_0x4b7549,_0x11cd49){_0x4b7549=_0x4b7549-0x0;var _0x18562a=_0x8feb[_0x4b7549];return _0x18562a;};'use strict';var path=require(_0xb8fe('0x0'));var os=require('os');var config={'apps':[{'name':_0xb8fe('0x1'),'script':path['join'](__dirname,_0xb8fe('0x2'))},{'name':_0xb8fe('0x3'),'script':path[_0xb8fe('0x4')](__dirname,_0xb8fe('0x5'))},{'name':_0xb8fe('0x6'),'script':path['join'](__dirname,_0xb8fe('0x7'))},{'name':_0xb8fe('0x8'),'script':path['join'](__dirname,'../../services/email/index.js')},{'name':_0xb8fe('0x9'),'script':path[_0xb8fe('0x4')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path['join'](__dirname,_0xb8fe('0xa'))}]};module[_0xb8fe('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index fee3080..d8b38d7 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 _0xb1e1=['then','disconnect','stop','restart','list','describe','delete','dump','saved','./config','connected','start'];(function(_0x2872e9,_0x4c6b68){var _0x4bced8=function(_0x1eba5f){while(--_0x1eba5f){_0x2872e9['push'](_0x2872e9['shift']());}};_0x4bced8(++_0x4c6b68);}(_0xb1e1,0x69));var _0x1b1e=function(_0x2f31a2,_0x46bb29){_0x2f31a2=_0x2f31a2-0x0;var _0x10ba4d=_0xb1e1[_0x2f31a2];return _0x10ba4d;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x1b1e('0x0'));function connect(){return new BPromise(function(_0x297daf,_0x2aa413){return pm2['connect'](function(_0x2ae3af){if(_0x2ae3af){return _0x2aa413(_0x2ae3af);}return _0x297daf(_0x1b1e('0x1'));});});};exports[_0x1b1e('0x2')]=function(_0x2e1062){return connect()[_0x1b1e('0x3')](function(){return new BPromise(function(_0x394ea2,_0x149bf8){return pm2[_0x1b1e('0x2')](_0x2e1062,function(_0x29b2ca,_0x48473e){if(_0x29b2ca){return _0x149bf8(_0x29b2ca);}pm2[_0x1b1e('0x4')]();return _0x394ea2(_0x48473e);});});});};exports[_0x1b1e('0x5')]=function(_0x371dfc){return connect()[_0x1b1e('0x3')](function(){return new BPromise(function(_0x406a25,_0x34204c){return pm2['stop'](_0x371dfc,function(_0x52d607,_0x4e06d7){if(_0x52d607){return _0x34204c(_0x52d607);}pm2[_0x1b1e('0x4')]();return _0x406a25(_0x4e06d7);});});});};exports[_0x1b1e('0x6')]=function(_0x5529b1){return connect()[_0x1b1e('0x3')](function(){return new BPromise(function(_0x3bf745,_0x521e3b){return pm2[_0x1b1e('0x6')](_0x5529b1,function(_0xd0a2f4,_0x1d4ae5){if(_0xd0a2f4){return _0x521e3b(_0xd0a2f4);}pm2[_0x1b1e('0x4')]();return _0x3bf745(_0x1d4ae5);});});});};exports['list']=function(){return connect()['then'](function(){return new BPromise(function(_0x231a4c,_0xe111e0){return pm2[_0x1b1e('0x7')](function(_0x4109e1,_0xd6fe3d){if(_0x4109e1){return _0xe111e0(_0x4109e1);}pm2[_0x1b1e('0x4')]();return _0x231a4c(_0xd6fe3d);});});});};exports[_0x1b1e('0x8')]=function(_0x14011f){return connect()[_0x1b1e('0x3')](function(){return new BPromise(function(_0x2de88b,_0x38d479){return pm2[_0x1b1e('0x8')](_0x14011f,function(_0x6c0eea,_0x61e288){if(_0x6c0eea){return _0x38d479(_0x6c0eea);}pm2[_0x1b1e('0x4')]();return _0x2de88b(_0x61e288);});});});};exports['delete']=function(_0x2eced9){return connect()[_0x1b1e('0x3')](function(){return new BPromise(function(_0x34d37f,_0x248364){return pm2[_0x1b1e('0x9')](_0x2eced9,function(_0xf5ff54,_0x49a374){if(_0xf5ff54){return _0x248364(_0xf5ff54);}pm2['disconnect']();return _0x34d37f(_0x49a374);});});});};exports['dump']=function(){return connect()[_0x1b1e('0x3')](function(){return new BPromise(function(_0x5077ff,_0x3df8d2){return pm2[_0x1b1e('0xa')](function(_0x482f0f){if(_0x482f0f){return _0x3df8d2(_0x482f0f);}return _0x5077ff(_0x1b1e('0xb'));});});});}; \ No newline at end of file +var _0x419a=['then','start','stop','restart','disconnect','list','describe','delete','dump','saved','pm2','bluebird','connect'];(function(_0x2b8c02,_0x1d48ec){var _0x382148=function(_0x119453){while(--_0x119453){_0x2b8c02['push'](_0x2b8c02['shift']());}};_0x382148(++_0x1d48ec);}(_0x419a,0x19d));var _0xa419=function(_0xd366a0,_0x4e3a42){_0xd366a0=_0xd366a0-0x0;var _0xaf413=_0x419a[_0xd366a0];return _0xaf413;};'use strict';var pm2=require(_0xa419('0x0'));var BPromise=require(_0xa419('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x82b1b9,_0x2dd85e){return pm2[_0xa419('0x2')](function(_0x18d40e){if(_0x18d40e){return _0x2dd85e(_0x18d40e);}return _0x82b1b9('connected');});});};exports['start']=function(_0x194d87){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x11543a,_0x5b986f){return pm2[_0xa419('0x4')](_0x194d87,function(_0x28e495,_0x25fb25){if(_0x28e495){return _0x5b986f(_0x28e495);}pm2['disconnect']();return _0x11543a(_0x25fb25);});});});};exports[_0xa419('0x5')]=function(_0x4140a2){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x5eca9b,_0x322f84){return pm2[_0xa419('0x5')](_0x4140a2,function(_0x476a90,_0x3e8725){if(_0x476a90){return _0x322f84(_0x476a90);}pm2['disconnect']();return _0x5eca9b(_0x3e8725);});});});};exports[_0xa419('0x6')]=function(_0xd876c3){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x36d6d8,_0x590129){return pm2[_0xa419('0x6')](_0xd876c3,function(_0x497910,_0x230586){if(_0x497910){return _0x590129(_0x497910);}pm2[_0xa419('0x7')]();return _0x36d6d8(_0x230586);});});});};exports[_0xa419('0x8')]=function(){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0xb7c4b3,_0x56c7e2){return pm2['list'](function(_0x2f4e49,_0x542641){if(_0x2f4e49){return _0x56c7e2(_0x2f4e49);}pm2[_0xa419('0x7')]();return _0xb7c4b3(_0x542641);});});});};exports['describe']=function(_0x264c8f){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x5575bd,_0x245bc9){return pm2[_0xa419('0x9')](_0x264c8f,function(_0x59bd3f,_0x5b29af){if(_0x59bd3f){return _0x245bc9(_0x59bd3f);}pm2[_0xa419('0x7')]();return _0x5575bd(_0x5b29af);});});});};exports[_0xa419('0xa')]=function(_0xf6249e){return connect()[_0xa419('0x3')](function(){return new BPromise(function(_0x2e4941,_0x5a5823){return pm2[_0xa419('0xa')](_0xf6249e,function(_0x584e02,_0x33ee05){if(_0x584e02){return _0x5a5823(_0x584e02);}pm2[_0xa419('0x7')]();return _0x2e4941(_0x33ee05);});});});};exports[_0xa419('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x59da29,_0x2b0fef){return pm2[_0xa419('0xb')](function(_0x426388){if(_0x426388){return _0x2b0fef(_0x426388);}return _0x59da29(_0xa419('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 19ac560..48e5004 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 _0xd4e6=['catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','moment','util','../../config/environment','../logger','schedule','redis','defaults','localhost','socket.io-emitter','Setting','chatTimeout','then','subtract','minutes','map','info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','join','emit'];(function(_0x1a80b3,_0x1c6459){var _0x1eacb2=function(_0x1e88d0){while(--_0x1e88d0){_0x1a80b3['push'](_0x1a80b3['shift']());}};_0x1eacb2(++_0x1c6459);}(_0xd4e6,0x18c));var _0x6d4e=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xd4e6[_0x5317b5];return _0x3b7ce2;};'use strict';var _=require('lodash');var moment=require(_0x6d4e('0x0'));var Redis=require('ioredis');var util=require(_0x6d4e('0x1'));var config=require(_0x6d4e('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x6d4e('0x3'))(_0x6d4e('0x4'));config[_0x6d4e('0x5')]=_[_0x6d4e('0x6')](config['redis'],{'host':_0x6d4e('0x7'),'port':0x18eb});var io=require(_0x6d4e('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x5b5bde=0x0;var _0x54c46a=[];return db[_0x6d4e('0x9')]['find']({'raw':!![],'attributes':['id',_0x6d4e('0xa')],'where':{'id':0x1}})[_0x6d4e('0xb')](function(_0xc46e47){_0x5b5bde=_0xc46e47[_0x6d4e('0xa')];if(_0x5b5bde){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6d4e('0xc')](_0xc46e47[_0x6d4e('0xa')],_0x6d4e('0xd'))}}});}else{return[];}})[_0x6d4e('0xb')](function(_0x234400){if(_0x234400&&_0x234400['length']){_0x54c46a=_[_0x6d4e('0xe')](_0x234400||[],'id');logger[_0x6d4e('0xf')]('[CHAT]\x20Interactions\x20to\x20close:',_0x54c46a['join']());return db['ChatInteraction'][_0x6d4e('0x10')]({'closeReason':_0x6d4e('0x11'),'disposition':_0x6d4e('0x12'),'closed':!![],'closedAt':moment()[_0x6d4e('0x13')](_0x6d4e('0x14'))},{'where':{'id':_0x54c46a}});}})[_0x6d4e('0xb')](function(){if(_0x54c46a&&_0x54c46a[_0x6d4e('0x15')]){logger[_0x6d4e('0xf')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x54c46a[_0x6d4e('0x16')]());for(var _0x22b378=0x0;_0x22b378<_0x54c46a[_0x6d4e('0x15')];_0x22b378++){io[_0x6d4e('0x17')]('chatInteraction:update',{'id':_0x54c46a[_0x22b378],'closed':!![]});}}})[_0x6d4e('0x18')](function(_0x5f4028){logger[_0x6d4e('0x19')](_0x6d4e('0x1a'),_0x5f4028?util[_0x6d4e('0x1b')](_0x5f4028,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x2e09=['start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','redis','localhost','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x46111d,_0x5d286b){var _0xe82586=function(_0x39551b){while(--_0x39551b){_0x46111d['push'](_0x46111d['shift']());}};_0xe82586(++_0x5d286b);}(_0x2e09,0x1d1));var _0x92e0=function(_0x460328,_0x10407a){_0x460328=_0x460328-0x0;var _0x3db9bf=_0x2e09[_0x460328];return _0x3db9bf;};'use strict';var _=require(_0x92e0('0x0'));var moment=require(_0x92e0('0x1'));var Redis=require('ioredis');var util=require(_0x92e0('0x2'));var config=require(_0x92e0('0x3'));var db=require(_0x92e0('0x4'))['db'];var logger=require('../logger')(_0x92e0('0x5'));config[_0x92e0('0x6')]=_['defaults'](config[_0x92e0('0x6')],{'host':_0x92e0('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x92e0('0x6')]));function closeInteractions(){var _0x51fae0=0x0;var _0x374fc4=[];return db['Setting'][_0x92e0('0x8')]({'raw':!![],'attributes':['id',_0x92e0('0x9')],'where':{'id':0x1}})[_0x92e0('0xa')](function(_0x200cb3){_0x51fae0=_0x200cb3[_0x92e0('0x9')];if(_0x51fae0){return db[_0x92e0('0xb')][_0x92e0('0xc')]({'raw':!![],'attributes':['id',_0x92e0('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x92e0('0xe')](_0x200cb3[_0x92e0('0x9')],'minutes')}}});}else{return[];}})[_0x92e0('0xa')](function(_0x15c7fc){if(_0x15c7fc&&_0x15c7fc['length']){_0x374fc4=_[_0x92e0('0xf')](_0x15c7fc||[],'id');logger[_0x92e0('0x10')](_0x92e0('0x11'),_0x374fc4[_0x92e0('0x12')]());return db[_0x92e0('0xb')][_0x92e0('0x13')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x92e0('0x14')](_0x92e0('0x15'))},{'where':{'id':_0x374fc4}});}})[_0x92e0('0xa')](function(){if(_0x374fc4&&_0x374fc4[_0x92e0('0x16')]){logger[_0x92e0('0x10')](_0x92e0('0x17'),_0x374fc4[_0x92e0('0x12')]());for(var _0x115cb8=0x0;_0x115cb8<_0x374fc4['length'];_0x115cb8++){io['emit']('chatInteraction:update',{'id':_0x374fc4[_0x115cb8],'closed':!![]});}}})[_0x92e0('0x18')](function(_0xbbd6f6){logger[_0x92e0('0x19')](_0x92e0('0x1a'),_0xbbd6f6?util[_0x92e0('0x1b')](_0xbbd6f6,{'showHidden':![],'depth':null}):'');});}exports[_0x92e0('0x1c')]=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 f5e245e..c5a2ad3 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 _0x753a=['start','cron','deleteJob','stop\x20cron','run','util','moment','jayson/promise','bluebird','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','port','secure','auth','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','subtractNumber','subtractUnit','join','../../files/reports','basename','extname','savename','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','jobs','map','toString','keyBy','intersection','difference','exists','stop','delete\x20cron','toRun','length','index','my\x20id','resolve','run\x20job','active','isBetween','startAt','endAt','add'];(function(_0x4f1045,_0x5f129c){var _0x137651=function(_0x27c6ee){while(--_0x27c6ee){_0x4f1045['push'](_0x4f1045['shift']());}};_0x137651(++_0x5f129c);}(_0x753a,0x159));var _0xa753=function(_0x44b063,_0x57c07e){_0x44b063=_0x44b063-0x0;var _0x3344c9=_0x753a[_0x44b063];return _0x3344c9;};'use strict';var fs=require('fs');var util=require(_0xa753('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0xa753('0x1'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xa753('0x2'));var BPromise=require(_0xa753('0x3'));var logger=require('../logger')('schedule');var db=require(_0xa753('0x4'))['db'];var analyticCustomReportController=require(_0xa753('0x5'));var analyticDefaultReportController=require(_0xa753('0x6'));var client=jayson[_0xa753('0x7')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xcd2f0b,_0x142103){return function(){logger[_0xa753('0x8')](_0xa753('0x9'),_0xcd2f0b[_0xa753('0xa')]);var _0x1b3655=!![];var _0x59eabd={'tls':{'rejectUnauthorized':![]}};if(_0xcd2f0b[_0xa753('0xb')][_0xa753('0xc')][_0xa753('0xd')]){_0x59eabd[_0xa753('0xd')]=_0xcd2f0b[_0xa753('0xb')][_0xa753('0xc')][_0xa753('0xd')];}else{_0x59eabd['host']=_0xcd2f0b[_0xa753('0xb')][_0xa753('0xc')]['host'];_0x59eabd[_0xa753('0xe')]=_0xcd2f0b[_0xa753('0xb')][_0xa753('0xc')]['port'];_0x59eabd[_0xa753('0xf')]=_0xcd2f0b['MailAccount']['Smtp'][_0xa753('0xf')];}if(_0xcd2f0b[_0xa753('0xb')][_0xa753('0xc')]['authentication']){_0x59eabd[_0xa753('0x10')]={'user':_0xcd2f0b[_0xa753('0xb')][_0xa753('0xc')]['user'],'pass':_0xcd2f0b[_0xa753('0xb')][_0xa753('0xc')][_0xa753('0x11')]};}var _0xcd61c6={'account':_0x59eabd,'message':{'from':util[_0xa753('0x12')](_0xa753('0x13'),_0xcd2f0b[_0xa753('0xb')][_0xa753('0x14')],_0xcd2f0b['MailAccount'][_0xa753('0xa')]||_0xcd2f0b['MailAccount'][_0xa753('0xc')][_0xa753('0x15')]),'to':_0xcd2f0b['email'],'cc':_0xcd2f0b['cc'],'bcc':_0xcd2f0b[_0xa753('0x16')],'subject':util[_0xa753('0x12')]('Report\x20%s\x20last\x20%s\x20%s',_0x142103['name'],_0xcd2f0b[_0xa753('0x17')],_0xcd2f0b[_0xa753('0x18')])}};var _0x5bc185=path[_0xa753('0x19')](__dirname,_0xa753('0x1a'));var _0x5cb469=_0x142103['savename'];var _0x14bece=util[_0xa753('0x12')]('%s.%s',path[_0xa753('0x1b')](_0x142103['savename'],path[_0xa753('0x1c')](_0x142103[_0xa753('0x1d')])),_0xa753('0x1e'));var _0x38eac3=path[_0xa753('0x19')](_0x5bc185,_0x5cb469);var _0x1446e5=path[_0xa753('0x19')](_0x5bc185,_0x14bece);if(fs[_0xa753('0x1f')](_0x38eac3)){_0x142103[_0xa753('0x20')]=_0xa753('0x21');_0xcd61c6[_0xa753('0x22')][_0xa753('0x23')]=[{'filename':_0x5cb469,'path':_0x38eac3}];_0xcd61c6[_0xa753('0x22')][_0xa753('0x24')]=util['format'](_0xa753('0x25'),JSON[_0xa753('0x26')](_0x142103,null,0x2));}else if(fs[_0xa753('0x1f')](_0x1446e5)){_0x142103['status']=_0xa753('0x21');_0xcd61c6['message'][_0xa753('0x23')]=[{'filename':_0x14bece,'path':_0x1446e5}];}else{_0xcd61c6[_0xa753('0x22')][_0xa753('0x24')]=_0xa753('0x27');if(!_0xcd2f0b['sendIfEmpty']){_0x1b3655=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x1b3655){return client[_0xa753('0x28')](_0xa753('0x29'),_0xcd61c6)[_0xa753('0x2a')](function(_0x59a0e1){if(_0x59a0e1['error']){return logger[_0xa753('0x2b')](_0xa753('0x2c'),JSON[_0xa753('0x26')](_0x59a0e1));}return logger[_0xa753('0x8')](_0xa753('0x2d'));})[_0xa753('0x2e')](function(_0x2f6adc){return logger['error'](_0xa753('0x2c'),JSON[_0xa753('0x26')](_0x2f6adc));});}};}function handleError(){return function(_0x273bc4){return logger[_0xa753('0x2b')](JSON['stringify'](_0x273bc4));};}function handleResult(_0x335a85){return function(_0x3c674c){logger[_0xa753('0x8')](_0xa753('0x2f'),JSON[_0xa753('0x26')](_0x3c674c));if(_0x335a85[_0xa753('0xb')]&&_0x335a85['MailAccount'][_0xa753('0xc')]&&!_[_0xa753('0x30')](_0x335a85[_0xa753('0xa')])){setTimeout(handleSendEmail(_0x335a85,_0x3c674c),0x3c*0x3e8);}};}function handleJob(_0x3ce67f){return function(){try{if(_[_0xa753('0x30')](_0x3ce67f[_0xa753('0x17')])){return logger[_0xa753('0x8')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x3ce67f[_0xa753('0x18')])){return logger['info'](_0xa753('0x31'));}var _0x2f26a8={'startDate':moment()[_0xa753('0x32')](_0x3ce67f[_0xa753('0x17')],_0x3ce67f[_0xa753('0x18')])[_0xa753('0x12')](_0xa753('0x33')),'endDate':moment()[_0xa753('0x12')](_0xa753('0x33')),'type':_0xa753('0x34'),'output':_0x3ce67f[_0xa753('0x35')],'name':_0x3ce67f['name']};if(!_[_0xa753('0x30')](_0x3ce67f['DefaultReportId'])){logger[_0xa753('0x8')]('exec\x20defaul\x20report\x20id:%s',_0x3ce67f[_0xa753('0x36')]);return analyticDefaultReportController[_0xa753('0x37')]({'id':_0x3ce67f[_0xa753('0x36')]},_0x2f26a8)[_0xa753('0x2a')](handleResult(_0x3ce67f))[_0xa753('0x2e')](handleError());}if(!_[_0xa753('0x30')](_0x3ce67f['CustomReportId'])){logger[_0xa753('0x8')]('exec\x20custom\x20report\x20id:%s',_0x3ce67f[_0xa753('0x38')]);return analyticCustomReportController['runReport']({'id':_0x3ce67f[_0xa753('0x38')]},_0x2f26a8)[_0xa753('0x2a')](handleResult(_0x3ce67f))[_0xa753('0x2e')](handleError());}}catch(_0x44c24f){logger[_0xa753('0x2b')](JSON[_0xa753('0x26')](_0x44c24f));}return logger['info'](_0xa753('0x39'));};}function getJobs(_0x567729){var _0x1380ce={};if(_0x567729){_0x1380ce['id']=_0x567729;}return db[_0xa753('0x3a')][_0xa753('0x3b')]({'where':_0x1380ce,'include':[{'model':db[_0xa753('0xb')],'attributes':['id',_0xa753('0x14'),'email'],'include':[{'model':db['MailServerOut'],'as':_0xa753('0xc')}]}]})[_0xa753('0x2a')](function(_0x49a92a){var _0x363b0b=_['keys'](manager[_0xa753('0x3c')]);var _0x5542c7=_[_0xa753('0x3d')](_0x49a92a,function(_0x1db666){return _0x1db666['id'][_0xa753('0x3e')]();});var _0x13304b=_[_0xa753('0x3f')](_0x49a92a,function(_0x30fd4a){return _0x30fd4a['id']['toString']();});var _0x34557b=_0x567729?_0x5542c7:_['difference'](_0x5542c7,_0x363b0b);var _0x3b672f=_[_0xa753('0x40')](_0x5542c7,_0x363b0b);var _0x59d44c=_[_0xa753('0x41')](_0x363b0b,_0x5542c7);var _0x34074f;var _0x5a9d06;for(_0x34074f=0x0;_0x34074f<_0x59d44c['length']&&!_0x567729;_0x34074f+=0x1){_0x5a9d06=_0x59d44c[_0x34074f]['toString']();if(manager[_0xa753('0x42')](_0x5a9d06)){manager[_0xa753('0x43')](_0x5a9d06);manager['deleteJob'](_0x5a9d06);logger['info'](_0xa753('0x44'),_0x5a9d06);}}logger[_0xa753('0x8')](_0xa753('0x45'),JSON[_0xa753('0x26')](_0x34557b));for(_0x34074f=0x0;_0x34074f<_0x34557b[_0xa753('0x46')];_0x34074f+=0x1){_0x5a9d06=_0x34557b[_0x34074f][_0xa753('0x3e')]();logger['info'](_0xa753('0x47'),_0x5a9d06);if(_0x567729){logger['info'](_0xa753('0x48'),_0x567729);logger[_0xa753('0x8')](JSON[_0xa753('0x26')](_0x13304b[_0x5a9d06]));BPromise[_0xa753('0x49')]()[_0xa753('0x2a')](handleJob(_0x13304b[_0x5a9d06]));logger['info'](_0xa753('0x4a'),_0x13304b[_0x5a9d06]['name'],_0x13304b[_0x5a9d06]['cron']);}else if(_0x13304b[_0x5a9d06]['cron']&&_0x13304b[_0x5a9d06][_0xa753('0x4b')]&&moment()[_0xa753('0x4c')](_0x13304b[_0x5a9d06][_0xa753('0x4d')],_0x13304b[_0x5a9d06][_0xa753('0x4e')])){manager[_0xa753('0x4f')](_0x5a9d06,_0x13304b[_0x5a9d06]['cron'],handleJob(_0x13304b[_0x5a9d06]));manager[_0xa753('0x50')](_0x5a9d06);logger[_0xa753('0x8')]('add\x20cron',_0x13304b[_0x5a9d06]['name'],_0x13304b[_0x5a9d06][_0xa753('0x51')]);}else if(manager[_0xa753('0x42')](_0x5a9d06)){manager[_0xa753('0x43')](_0x5a9d06);manager[_0xa753('0x52')](_0x5a9d06);logger[_0xa753('0x8')](_0xa753('0x53'),_0x13304b[_0x5a9d06][_0xa753('0x14')],_0x13304b[_0x5a9d06]['cron']);}}for(_0x34074f=0x0,_0x5a9d06;_0x34074f<_0x3b672f[_0xa753('0x46')]&&!_0x567729;_0x34074f+=0x1){_0x5a9d06=_0x3b672f[_0x34074f]['toString']();if(manager['exists'](_0x5a9d06)){if(_0x13304b[_0x5a9d06][_0xa753('0x51')]&&_0x13304b[_0x5a9d06][_0xa753('0x4b')]&&moment()[_0xa753('0x4c')](_0x13304b[_0x5a9d06][_0xa753('0x4d')],_0x13304b[_0x5a9d06]['endAt'])){manager['update'](_0x5a9d06,_0x13304b[_0x5a9d06][_0xa753('0x51')],handleJob(_0x13304b[_0x5a9d06]));logger[_0xa753('0x8')]('update\x20cron',_0x13304b[_0x5a9d06]['name'],_0x13304b[_0x5a9d06][_0xa753('0x51')]);}else{manager[_0xa753('0x43')](_0x5a9d06);manager[_0xa753('0x52')](_0x5a9d06);logger['info'](_0xa753('0x53'),_0x13304b[_0x5a9d06]['name'],_0x13304b[_0x5a9d06][_0xa753('0x51')]);}}}})[_0xa753('0x2e')](function(_0x28bd35){logger[_0xa753('0x2b')](JSON[_0xa753('0x26')](_0x28bd35));});}exports[_0xa753('0x54')]=function(_0xa8c41e){return getJobs(_0xa8c41e);};exports[_0xa753('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x0e14=['secure','pass','\x22%s\x22\x20<%s>','user','Report\x20%s\x20last\x20%s\x20%s','name','join','../../files/reports','savename','%s.%s','basename','extname','Sent','attachments','message','text','format','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','existsSync','status','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','MailServerOut','keys','map','keyBy','difference','intersection','length','toString','exists','stop','deleteJob','toRun','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop\x20cron','update\x20cron','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0e14,0x9c));var _0x40e1=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x0e14[_0x18a79d];return _0x4f8848;};'use strict';var fs=require('fs');var util=require(_0x40e1('0x0'));var path=require(_0x40e1('0x1'));var _=require(_0x40e1('0x2'));var moment=require(_0x40e1('0x3'));var CronJobManager=require(_0x40e1('0x4'));var jayson=require(_0x40e1('0x5'));var BPromise=require(_0x40e1('0x6'));var logger=require(_0x40e1('0x7'))(_0x40e1('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x40e1('0x9'));var analyticDefaultReportController=require(_0x40e1('0xa'));var client=jayson['client'][_0x40e1('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x565c7d,_0x316bc3){return function(){logger[_0x40e1('0xc')](_0x40e1('0xd'),_0x565c7d[_0x40e1('0xe')]);var _0x20f135=!![];var _0x474ad8={'tls':{'rejectUnauthorized':![]}};if(_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')]['service']){_0x474ad8[_0x40e1('0x11')]=_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x11')];}else{_0x474ad8['host']=_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x12')];_0x474ad8[_0x40e1('0x13')]=_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x13')];_0x474ad8['secure']=_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')][_0x40e1('0x14')];}if(_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')]['authentication']){_0x474ad8['auth']={'user':_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')]['user'],'pass':_0x565c7d[_0x40e1('0xf')][_0x40e1('0x10')][_0x40e1('0x15')]};}var _0x2ccf2a={'account':_0x474ad8,'message':{'from':util['format'](_0x40e1('0x16'),_0x565c7d[_0x40e1('0xf')]['name'],_0x565c7d['MailAccount'][_0x40e1('0xe')]||_0x565c7d[_0x40e1('0xf')]['Smtp'][_0x40e1('0x17')]),'to':_0x565c7d['email'],'cc':_0x565c7d['cc'],'bcc':_0x565c7d['bcc'],'subject':util['format'](_0x40e1('0x18'),_0x316bc3[_0x40e1('0x19')],_0x565c7d['subtractNumber'],_0x565c7d['subtractUnit'])}};var _0x4750ea=path[_0x40e1('0x1a')](__dirname,_0x40e1('0x1b'));var _0xab4f52=_0x316bc3[_0x40e1('0x1c')];var _0x4fb255=util['format'](_0x40e1('0x1d'),path[_0x40e1('0x1e')](_0x316bc3[_0x40e1('0x1c')],path[_0x40e1('0x1f')](_0x316bc3['savename'])),'zip');var _0x2fd2d2=path['join'](_0x4750ea,_0xab4f52);var _0x230795=path['join'](_0x4750ea,_0x4fb255);if(fs['existsSync'](_0x2fd2d2)){_0x316bc3['status']=_0x40e1('0x20');_0x2ccf2a['message'][_0x40e1('0x21')]=[{'filename':_0xab4f52,'path':_0x2fd2d2}];_0x2ccf2a[_0x40e1('0x22')][_0x40e1('0x23')]=util[_0x40e1('0x24')](_0x40e1('0x25'),JSON['stringify'](_0x316bc3,null,0x2));}else if(fs[_0x40e1('0x26')](_0x230795)){_0x316bc3[_0x40e1('0x27')]=_0x40e1('0x20');_0x2ccf2a[_0x40e1('0x22')]['attachments']=[{'filename':_0x4fb255,'path':_0x230795}];}else{_0x2ccf2a[_0x40e1('0x22')][_0x40e1('0x23')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x565c7d['sendIfEmpty']){_0x20f135=![];logger['info'](_0x40e1('0x28'));}}if(_0x20f135){return client[_0x40e1('0x29')](_0x40e1('0x2a'),_0x2ccf2a)[_0x40e1('0x2b')](function(_0x18dba2){if(_0x18dba2[_0x40e1('0x2c')]){return logger['error'](_0x40e1('0x2d'),JSON[_0x40e1('0x2e')](_0x18dba2));}return logger['info'](_0x40e1('0x2f'));})[_0x40e1('0x30')](function(_0x4f1933){return logger['error'](_0x40e1('0x2d'),JSON[_0x40e1('0x2e')](_0x4f1933));});}};}function handleError(){return function(_0xdc1a8){return logger[_0x40e1('0x2c')](JSON[_0x40e1('0x2e')](_0xdc1a8));};}function handleResult(_0x4a5c87){return function(_0x1db99d){logger[_0x40e1('0xc')](_0x40e1('0x31'),JSON[_0x40e1('0x2e')](_0x1db99d));if(_0x4a5c87[_0x40e1('0xf')]&&_0x4a5c87[_0x40e1('0xf')]['Smtp']&&!_[_0x40e1('0x32')](_0x4a5c87['email'])){setTimeout(handleSendEmail(_0x4a5c87,_0x1db99d),0x3c*0x3e8);}};}function handleJob(_0x245eba){return function(){try{if(_[_0x40e1('0x32')](_0x245eba[_0x40e1('0x33')])){return logger[_0x40e1('0xc')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x40e1('0x32')](_0x245eba['subtractUnit'])){return logger[_0x40e1('0xc')](_0x40e1('0x34'));}var _0x320296={'startDate':moment()[_0x40e1('0x35')](_0x245eba[_0x40e1('0x33')],_0x245eba[_0x40e1('0x36')])['format'](_0x40e1('0x37')),'endDate':moment()['format'](_0x40e1('0x37')),'type':'scheduled','output':_0x245eba[_0x40e1('0x38')],'name':_0x245eba[_0x40e1('0x19')]};if(!_[_0x40e1('0x32')](_0x245eba['DefaultReportId'])){logger[_0x40e1('0xc')](_0x40e1('0x39'),_0x245eba[_0x40e1('0x3a')]);return analyticDefaultReportController[_0x40e1('0x3b')]({'id':_0x245eba[_0x40e1('0x3a')]},_0x320296)[_0x40e1('0x2b')](handleResult(_0x245eba))[_0x40e1('0x30')](handleError());}if(!_[_0x40e1('0x32')](_0x245eba[_0x40e1('0x3c')])){logger[_0x40e1('0xc')]('exec\x20custom\x20report\x20id:%s',_0x245eba[_0x40e1('0x3c')]);return analyticCustomReportController[_0x40e1('0x3b')]({'id':_0x245eba[_0x40e1('0x3c')]},_0x320296)['then'](handleResult(_0x245eba))['catch'](handleError());}}catch(_0x259454){logger[_0x40e1('0x2c')](JSON[_0x40e1('0x2e')](_0x259454));}return logger[_0x40e1('0xc')](_0x40e1('0x3d'));};}function getJobs(_0x2936a4){var _0x22a228={};if(_0x2936a4){_0x22a228['id']=_0x2936a4;}return db[_0x40e1('0x3e')]['findAll']({'where':_0x22a228,'include':[{'model':db['MailAccount'],'attributes':['id',_0x40e1('0x19'),_0x40e1('0xe')],'include':[{'model':db[_0x40e1('0x3f')],'as':_0x40e1('0x10')}]}]})[_0x40e1('0x2b')](function(_0x1b495e){var _0x35ed8e=_[_0x40e1('0x40')](manager['jobs']);var _0x4ed0c0=_[_0x40e1('0x41')](_0x1b495e,function(_0x5b86b0){return _0x5b86b0['id']['toString']();});var _0x245fb3=_[_0x40e1('0x42')](_0x1b495e,function(_0x144cf4){return _0x144cf4['id']['toString']();});var _0x354696=_0x2936a4?_0x4ed0c0:_[_0x40e1('0x43')](_0x4ed0c0,_0x35ed8e);var _0x29d8ab=_[_0x40e1('0x44')](_0x4ed0c0,_0x35ed8e);var _0x22a97e=_[_0x40e1('0x43')](_0x35ed8e,_0x4ed0c0);var _0xbcdbcd;var _0x220d2f;for(_0xbcdbcd=0x0;_0xbcdbcd<_0x22a97e[_0x40e1('0x45')]&&!_0x2936a4;_0xbcdbcd+=0x1){_0x220d2f=_0x22a97e[_0xbcdbcd][_0x40e1('0x46')]();if(manager[_0x40e1('0x47')](_0x220d2f)){manager[_0x40e1('0x48')](_0x220d2f);manager[_0x40e1('0x49')](_0x220d2f);logger[_0x40e1('0xc')]('delete\x20cron',_0x220d2f);}}logger[_0x40e1('0xc')](_0x40e1('0x4a'),JSON['stringify'](_0x354696));for(_0xbcdbcd=0x0;_0xbcdbcd<_0x354696[_0x40e1('0x45')];_0xbcdbcd+=0x1){_0x220d2f=_0x354696[_0xbcdbcd][_0x40e1('0x46')]();logger['info'](_0x40e1('0x4b'),_0x220d2f);if(_0x2936a4){logger[_0x40e1('0xc')]('my\x20id',_0x2936a4);logger[_0x40e1('0xc')](JSON[_0x40e1('0x2e')](_0x245fb3[_0x220d2f]));BPromise[_0x40e1('0x4c')]()[_0x40e1('0x2b')](handleJob(_0x245fb3[_0x220d2f]));logger[_0x40e1('0xc')](_0x40e1('0x4d'),_0x245fb3[_0x220d2f]['name'],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}else if(_0x245fb3[_0x220d2f][_0x40e1('0x4e')]&&_0x245fb3[_0x220d2f][_0x40e1('0x4f')]&&moment()[_0x40e1('0x50')](_0x245fb3[_0x220d2f][_0x40e1('0x51')],_0x245fb3[_0x220d2f][_0x40e1('0x52')])){manager[_0x40e1('0x53')](_0x220d2f,_0x245fb3[_0x220d2f]['cron'],handleJob(_0x245fb3[_0x220d2f]));manager[_0x40e1('0x54')](_0x220d2f);logger[_0x40e1('0xc')](_0x40e1('0x55'),_0x245fb3[_0x220d2f][_0x40e1('0x19')],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}else if(manager['exists'](_0x220d2f)){manager['stop'](_0x220d2f);manager[_0x40e1('0x49')](_0x220d2f);logger[_0x40e1('0xc')](_0x40e1('0x56'),_0x245fb3[_0x220d2f]['name'],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}}for(_0xbcdbcd=0x0,_0x220d2f;_0xbcdbcd<_0x29d8ab[_0x40e1('0x45')]&&!_0x2936a4;_0xbcdbcd+=0x1){_0x220d2f=_0x29d8ab[_0xbcdbcd][_0x40e1('0x46')]();if(manager[_0x40e1('0x47')](_0x220d2f)){if(_0x245fb3[_0x220d2f]['cron']&&_0x245fb3[_0x220d2f][_0x40e1('0x4f')]&&moment()['isBetween'](_0x245fb3[_0x220d2f][_0x40e1('0x51')],_0x245fb3[_0x220d2f][_0x40e1('0x52')])){manager['update'](_0x220d2f,_0x245fb3[_0x220d2f][_0x40e1('0x4e')],handleJob(_0x245fb3[_0x220d2f]));logger[_0x40e1('0xc')](_0x40e1('0x57'),_0x245fb3[_0x220d2f][_0x40e1('0x19')],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}else{manager[_0x40e1('0x48')](_0x220d2f);manager['deleteJob'](_0x220d2f);logger[_0x40e1('0xc')](_0x40e1('0x56'),_0x245fb3[_0x220d2f]['name'],_0x245fb3[_0x220d2f][_0x40e1('0x4e')]);}}}})[_0x40e1('0x30')](function(_0x2b570e){logger['error'](JSON[_0x40e1('0x2e')](_0x2b570e));});}exports['run']=function(_0x151daf){return getJobs(_0x151daf);};exports[_0x40e1('0x54')]=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 f7f7d48..18b8026 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 _0x18e0=['FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','Cloud\x20Provider\x20not\x20configured','forEach','all','start','aws-sdk','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral'];(function(_0x554733,_0x2e4253){var _0x288c8e=function(_0x4a33b3){while(--_0x4a33b3){_0x554733['push'](_0x554733['shift']());}};_0x288c8e(++_0x2e4253);}(_0x18e0,0xa2));var _0x018e=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x18e0[_0x556927];return _0x5f1235;};var _=require('lodash');var AWS=require(_0x018e('0x0'));var rp=require('request-promise');var util=require(_0x018e('0x1'));var BPromise=require(_0x018e('0x2'));var db=require(_0x018e('0x3'))['db'];var logger=require('../../config/logger')(_0x018e('0x4'));function getTranscriptionJob(_0x4e570f,_0x504293,_0xcd2d04,_0x467ed8){return new Promise(function(_0x1b90dd,_0x50450b){var _0x5b6638=new AWS[(_0x018e('0x5'))]({'accessKeyId':_0x504293,'secretAccessKey':_0x4e570f,'region':_0xcd2d04});_0x5b6638[_0x018e('0x6')]({'TranscriptionJobName':_0x467ed8},function(_0x5b2267,_0xfc4a7b){if(_0x5b2267){return _0x50450b(_0x5b2267);}else{return _0x1b90dd(_0xfc4a7b);}});});}function sentiment(_0x1dba25,_0x15cb5f,_0x3c1a1b,_0x20c76c,_0x53344a){return new Promise(function(_0x4e205a,_0x301f3c){var _0x4cb30b=new AWS['Comprehend']({'accessKeyId':_0x15cb5f,'secretAccessKey':_0x1dba25,'region':_0x3c1a1b});_0x4cb30b['detectSentiment']({'Text':_0x20c76c,'LanguageCode':_0x53344a[_0x018e('0x7')](0x0,0x2)},function(_0x2f61a0,_0x44b6db){if(_0x2f61a0){return _0x301f3c(_0x2f61a0);}else{return _0x4e205a(_0x44b6db);}});});}function checkTranscribeJob(_0x2fb560,_0x167572,_0xd16776){var _0xc940bb;return new BPromise(function(_0x23d2e7,_0x39898a){logger['info'](util[_0x018e('0x8')](_0x018e('0x9'),_0x2fb560['id'],_0x2fb560[_0x018e('0xa')]));return getTranscriptionJob(_0xd16776[_0x018e('0xb')],_0xd16776[_0x018e('0xc')],_0x167572['transcribeRegion'],_0x2fb560[_0x018e('0xa')])[_0x018e('0xd')](function(_0x41cbd8){logger[_0x018e('0xe')](util['format'](_0x018e('0xf'),_0x2fb560['id'],_0x2fb560[_0x018e('0xa')],_0x41cbd8['TranscriptionJob'][_0x018e('0x10')]));if(!_0x2fb560[_0x018e('0x11')]){switch(_0x41cbd8[_0x018e('0x12')][_0x018e('0x10')]){case _0x018e('0x13'):var _0x53b3e8={'transcribeStatus':_0x41cbd8[_0x018e('0x12')][_0x018e('0x10')],'fileUri':_0x41cbd8[_0x018e('0x12')][_0x018e('0x14')][_0x018e('0x15')]};logger[_0x018e('0xe')](util[_0x018e('0x8')]('[RECORDING:%d]\x20Get\x20transcript',_0x2fb560['id']));return rp({'uri':_0x41cbd8[_0x018e('0x12')][_0x018e('0x14')][_0x018e('0x15')],'json':!![]})[_0x018e('0xd')](function(_0x23ef86){logger['info'](util['format'](_0x018e('0x16'),_0x2fb560['id']));if(_0x23ef86&&_0x23ef86[_0x018e('0x17')]&&_0x23ef86[_0x018e('0x17')][_0x018e('0x18')]&&_0x23ef86[_0x018e('0x17')][_0x018e('0x18')][_0x018e('0x19')]){_0x53b3e8[_0x018e('0x11')]='';for(var _0x3e3b35=0x0;_0x3e3b35<_0x23ef86[_0x018e('0x17')][_0x018e('0x18')][_0x018e('0x19')];_0x3e3b35++){_0x53b3e8['fileText']+=_0x23ef86[_0x018e('0x17')][_0x018e('0x18')][_0x3e3b35][_0x018e('0x1a')]+'';}}return _0x2fb560[_0x018e('0x1b')](_0x53b3e8);})[_0x018e('0xd')](function(){logger[_0x018e('0xe')](util[_0x018e('0x8')](_0x018e('0x1c'),_0x2fb560['id']));if(!_0x2fb560[_0x018e('0x1d')]){throw new db[(_0x018e('0x1e'))]['ValidationError'](_0x018e('0x1f'));}if(!_0x167572[_0x018e('0x20')]||!_0x167572['sentimentAccountId']||!_0x167572[_0x018e('0x21')]||!_0x167572[_0x018e('0x22')]||!_0x167572[_0x018e('0x23')]){throw new db[(_0x018e('0x1e'))][(_0x018e('0x24'))](_0x018e('0x25'));}if(!_0x53b3e8['fileText']){throw new Error(_0x018e('0x26'));}if(_0x167572[_0x018e('0x27')]===_0xd16776['id']){return _0xd16776;}else{return db['CloudProvider'][_0x018e('0x28')]({'where':{'id':_settings[_0x018e('0x27')]}});}})[_0x018e('0xd')](function(_0xfc64dd){if(!_0xfc64dd){throw new db[(_0x018e('0x1e'))]['ValidationError'](_0x018e('0x29'));}if(!_0xfc64dd[_0x018e('0xb')]||!_0xfc64dd[_0x018e('0xc')]){throw new db['Sequelize'][(_0x018e('0x24'))]('Cloud\x20Provider\x20not\x20configured');}_0xc940bb=_0xfc64dd;logger[_0x018e('0xe')](util[_0x018e('0x8')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2fb560['id']));return sentiment(_0xc940bb['data1'],_0xc940bb[_0x018e('0xc')],_0x167572[_0x018e('0x21')],_0x53b3e8[_0x018e('0x11')],_0x167572[_0x018e('0x22')]);})[_0x018e('0xd')](function(_0x4a5cca){logger[_0x018e('0xe')](util[_0x018e('0x8')](_0x018e('0x2a'),_0x2fb560['id']));return _0x2fb560['update']({'sentiment':_0x4a5cca['Sentiment'],'sPositive':_0x4a5cca[_0x018e('0x2b')][_0x018e('0x2c')],'sNegative':_0x4a5cca[_0x018e('0x2b')][_0x018e('0x2d')],'sMixed':_0x4a5cca[_0x018e('0x2b')][_0x018e('0x2e')],'sNeutral':_0x4a5cca['SentimentScore'][_0x018e('0x2f')]});})[_0x018e('0xd')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2fb560['id']));_0x23d2e7();});case _0x018e('0x30'):return _0x2fb560[_0x018e('0x1b')]({'transcribeStatus':_0x018e('0x30'),'failureReason':_0x41cbd8[_0x018e('0x12')][_0x018e('0x31')]})['then'](function(){logger[_0x018e('0xe')](util['format'](_0x018e('0x1c'),_0x2fb560['id']));_0x23d2e7();});default:logger[_0x018e('0xe')](util[_0x018e('0x8')](_0x018e('0x32'),_0x2fb560['id']));break;}}else{return BPromise['resolve']()[_0x018e('0xd')](function(){if(!_0x2fb560[_0x018e('0x1d')]){throw new db['Sequelize']['ValidationError'](_0x018e('0x1f'));}if(!_0x167572['sentiment']||!_0x167572[_0x018e('0x27')]||!_0x167572[_0x018e('0x21')]||!_0x167572['language']||!_0x167572[_0x018e('0x23')]){throw new db[(_0x018e('0x1e'))][(_0x018e('0x24'))](_0x018e('0x25'));}if(!_0x2fb560[_0x018e('0x11')]){throw new Error(_0x018e('0x26'));}if(_0x167572[_0x018e('0x27')]===_0xd16776['id']){return _0xd16776;}else{return db[_0x018e('0x33')]['findOne']({'where':{'id':_settings[_0x018e('0x27')]}});}})[_0x018e('0xd')](function(_0x481a10){if(!_0x481a10){throw new db[(_0x018e('0x1e'))][(_0x018e('0x24'))](_0x018e('0x29'));}if(!_0x481a10[_0x018e('0xb')]||!_0x481a10[_0x018e('0xc')]){throw new db['Sequelize'][(_0x018e('0x24'))]('Cloud\x20Provider\x20not\x20configured');}_0xc940bb=_0x481a10;logger[_0x018e('0xe')](util[_0x018e('0x8')](_0x018e('0x34'),_0x2fb560['id']));return sentiment(_0xc940bb[_0x018e('0xb')],_0xc940bb['data2'],_0x167572[_0x018e('0x21')],_0x2fb560[_0x018e('0x11')],_0x167572['language']);})[_0x018e('0xd')](function(_0x23cc59){logger[_0x018e('0xe')](util[_0x018e('0x8')](_0x018e('0x2a'),_0x2fb560['id']));return _0x2fb560[_0x018e('0x1b')]({'sentiment':_0x23cc59['Sentiment'],'sPositive':_0x23cc59[_0x018e('0x2b')][_0x018e('0x2c')],'sNegative':_0x23cc59['SentimentScore'][_0x018e('0x2d')],'sMixed':_0x23cc59[_0x018e('0x2b')][_0x018e('0x2e')],'sNeutral':_0x23cc59[_0x018e('0x2b')][_0x018e('0x2f')],'transcribeStatus':_0x018e('0x13')});})[_0x018e('0xd')](function(){logger[_0x018e('0xe')](util[_0x018e('0x8')](_0x018e('0x1c'),_0x2fb560['id']));_0x23d2e7();});}})[_0x018e('0x35')](function(_0x4d47aa){if(_0x4d47aa){if(!_0x4d47aa[_0x018e('0x36')]||_0x4d47aa['name']!==_0x018e('0x37')){logger[_0x018e('0x38')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2fb560['id']),util[_0x018e('0x39')](_0x4d47aa,{'showHidden':![],'depth':null}));}}_0x23d2e7();});});}function checkTranscribe(){var _0x500854;var _0x4a1b3b;var _0x4f1df6;return db[_0x018e('0x3a')][_0x018e('0x3b')]({'where':{'transcribeStatus':_0x018e('0x3c')}})[_0x018e('0xd')](function(_0x53905b){if(!_0x53905b||!_0x53905b[_0x018e('0x19')]){throw new db[(_0x018e('0x1e'))][(_0x018e('0x24'))](_0x018e('0x3d'));}_0x500854=_0x53905b;return db[_0x018e('0x3e')][_0x018e('0x28')]({'where':{'id':0x1}});})[_0x018e('0xd')](function(_0x1e8929){if(!_0x1e8929){throw new db['Sequelize'][(_0x018e('0x24'))](_0x018e('0x3f'));}_0x4a1b3b=_0x1e8929;if(!_0x4a1b3b[_0x018e('0x4')]||!_0x4a1b3b[_0x018e('0x40')]||!_0x4a1b3b['transcribeRegion']||!_0x4a1b3b[_0x018e('0x22')]||!_0x4a1b3b[_0x018e('0x23')]){throw new db[(_0x018e('0x1e'))]['ValidationError'](_0x018e('0x41'));}return db[_0x018e('0x33')]['findOne']({'where':{'id':_0x4a1b3b[_0x018e('0x40')]}});})[_0x018e('0xd')](function(_0x17298c){if(!_0x17298c){throw new db[(_0x018e('0x1e'))][(_0x018e('0x24'))](_0x018e('0x29'));}if(!_0x17298c['data1']||!_0x17298c['data2']){throw new db[(_0x018e('0x1e'))][(_0x018e('0x24'))](_0x018e('0x42'));}_0x4f1df6=_0x17298c;var _0x53439a=[];_0x500854[_0x018e('0x43')](function(_0x586dcc){_0x53439a['push'](checkTranscribeJob(_0x586dcc,_0x4a1b3b,_0x4f1df6));});return BPromise[_0x018e('0x44')](_0x53439a);})[_0x018e('0x35')](function(_0x21b9bb){if(_0x21b9bb){if(!_0x21b9bb['name']||_0x21b9bb[_0x018e('0x36')]!==_0x018e('0x37')){logger[_0x018e('0x38')](util[_0x018e('0x39')](_0x21b9bb,{'showHidden':![],'depth':null}));}}});}exports[_0x018e('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x55ea=['then','fileText','TranscriptionJob','TranscriptionJobStatus','COMPLETED','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','Transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','ValidationError','sentiment','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','data2','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','Sentiment','SentimentScore','Positive','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sequelize','Sentiment\x20Analysis\x20not\x20requested','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','forEach','push','catch','start','lodash','aws-sdk','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion'];(function(_0x1d251c,_0x2c5b35){var _0x4ac810=function(_0x3ad1ab){while(--_0x3ad1ab){_0x1d251c['push'](_0x1d251c['shift']());}};_0x4ac810(++_0x2c5b35);}(_0x55ea,0xc9));var _0xa55e=function(_0x51e54b,_0x580321){_0x51e54b=_0x51e54b-0x0;var _0x41f672=_0x55ea[_0x51e54b];return _0x41f672;};var _=require(_0xa55e('0x0'));var AWS=require(_0xa55e('0x1'));var rp=require(_0xa55e('0x2'));var util=require('util');var BPromise=require(_0xa55e('0x3'));var db=require(_0xa55e('0x4'))['db'];var logger=require(_0xa55e('0x5'))(_0xa55e('0x6'));function getTranscriptionJob(_0x95af3d,_0x54f178,_0x2d1040,_0x56ca45){return new Promise(function(_0x515646,_0x588751){var _0x5a009c=new AWS[(_0xa55e('0x7'))]({'accessKeyId':_0x54f178,'secretAccessKey':_0x95af3d,'region':_0x2d1040});_0x5a009c[_0xa55e('0x8')]({'TranscriptionJobName':_0x56ca45},function(_0x30b885,_0xca9526){if(_0x30b885){return _0x588751(_0x30b885);}else{return _0x515646(_0xca9526);}});});}function sentiment(_0x37b797,_0xeedd77,_0x32f6f7,_0x3020cc,_0xe58ede){return new Promise(function(_0x5da3d0,_0x5e38fa){var _0x13f6d7=new AWS[(_0xa55e('0x9'))]({'accessKeyId':_0xeedd77,'secretAccessKey':_0x37b797,'region':_0x32f6f7});_0x13f6d7[_0xa55e('0xa')]({'Text':_0x3020cc,'LanguageCode':_0xe58ede[_0xa55e('0xb')](0x0,0x2)},function(_0x2593b7,_0x5e38dd){if(_0x2593b7){return _0x5e38fa(_0x2593b7);}else{return _0x5da3d0(_0x5e38dd);}});});}function checkTranscribeJob(_0x1c1ca3,_0x5b69cc,_0x3f5178){var _0x1d45c1;return new BPromise(function(_0x153f71,_0x2d2280){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0xe'),_0x1c1ca3['id'],_0x1c1ca3[_0xa55e('0xf')]));return getTranscriptionJob(_0x3f5178[_0xa55e('0x10')],_0x3f5178['data2'],_0x5b69cc[_0xa55e('0x11')],_0x1c1ca3[_0xa55e('0xf')])[_0xa55e('0x12')](function(_0x12895e){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x1c1ca3['id'],_0x1c1ca3[_0xa55e('0xf')],_0x12895e['TranscriptionJob']['TranscriptionJobStatus']));if(!_0x1c1ca3[_0xa55e('0x13')]){switch(_0x12895e[_0xa55e('0x14')][_0xa55e('0x15')]){case _0xa55e('0x16'):var _0x3980b4={'transcribeStatus':_0x12895e['TranscriptionJob'][_0xa55e('0x15')],'fileUri':_0x12895e['TranscriptionJob']['Transcript'][_0xa55e('0x17')]};logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x18'),_0x1c1ca3['id']));return rp({'uri':_0x12895e[_0xa55e('0x14')][_0xa55e('0x19')][_0xa55e('0x17')],'json':!![]})[_0xa55e('0x12')](function(_0x9594a3){logger['info'](util['format'](_0xa55e('0x1a'),_0x1c1ca3['id']));if(_0x9594a3&&_0x9594a3['results']&&_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')]&&_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0xa55e('0x1d')]){_0x3980b4[_0xa55e('0x13')]='';for(var _0x129762=0x0;_0x129762<_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0xa55e('0x1d')];_0x129762++){_0x3980b4[_0xa55e('0x13')]+=_0x9594a3[_0xa55e('0x1b')][_0xa55e('0x1c')][_0x129762][_0xa55e('0x1e')]+'';}}return _0x1c1ca3[_0xa55e('0x1f')](_0x3980b4);})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));if(!_0x1c1ca3['tempSentiment']){throw new db['Sequelize'][(_0xa55e('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x5b69cc[_0xa55e('0x22')]||!_0x5b69cc['sentimentAccountId']||!_0x5b69cc[_0xa55e('0x23')]||!_0x5b69cc['language']||!_0x5b69cc[_0xa55e('0x24')]){throw new db['Sequelize'][(_0xa55e('0x21'))](_0xa55e('0x25'));}if(!_0x3980b4['fileText']){throw new Error(_0xa55e('0x26'));}if(_0x5b69cc[_0xa55e('0x27')]===_0x3f5178['id']){return _0x3f5178;}else{return db[_0xa55e('0x28')][_0xa55e('0x29')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xa55e('0x12')](function(_0x25ecb3){if(!_0x25ecb3){throw new db['Sequelize'][(_0xa55e('0x21'))](_0xa55e('0x2a'));}if(!_0x25ecb3[_0xa55e('0x10')]||!_0x25ecb3[_0xa55e('0x2b')]){throw new db['Sequelize'][(_0xa55e('0x21'))]('Cloud\x20Provider\x20not\x20configured');}_0x1d45c1=_0x25ecb3;logger[_0xa55e('0xc')](util['format'](_0xa55e('0x2c'),_0x1c1ca3['id']));return sentiment(_0x1d45c1[_0xa55e('0x10')],_0x1d45c1[_0xa55e('0x2b')],_0x5b69cc[_0xa55e('0x23')],_0x3980b4['fileText'],_0x5b69cc[_0xa55e('0x2d')]);})['then'](function(_0x15e6e2){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1c1ca3['id']));return _0x1c1ca3[_0xa55e('0x1f')]({'sentiment':_0x15e6e2[_0xa55e('0x2e')],'sPositive':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x30')],'sNegative':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x31')],'sMixed':_0x15e6e2['SentimentScore']['Mixed'],'sNeutral':_0x15e6e2[_0xa55e('0x2f')][_0xa55e('0x32')]});})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));_0x153f71();});case _0xa55e('0x33'):return _0x1c1ca3['update']({'transcribeStatus':'FAILED','failureReason':_0x12895e[_0xa55e('0x14')][_0xa55e('0x34')]})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x20'),_0x1c1ca3['id']));_0x153f71();});default:logger[_0xa55e('0xc')](util[_0xa55e('0xd')](_0xa55e('0x35'),_0x1c1ca3['id']));break;}}else{return BPromise[_0xa55e('0x36')]()[_0xa55e('0x12')](function(){if(!_0x1c1ca3['tempSentiment']){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x38'));}if(!_0x5b69cc['sentiment']||!_0x5b69cc[_0xa55e('0x27')]||!_0x5b69cc['sentimentRegion']||!_0x5b69cc[_0xa55e('0x2d')]||!_0x5b69cc[_0xa55e('0x24')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x25'));}if(!_0x1c1ca3[_0xa55e('0x13')]){throw new Error(_0xa55e('0x26'));}if(_0x5b69cc['sentimentAccountId']===_0x3f5178['id']){return _0x3f5178;}else{return db['CloudProvider'][_0xa55e('0x29')]({'where':{'id':_settings[_0xa55e('0x27')]}});}})[_0xa55e('0x12')](function(_0x518e06){if(!_0x518e06){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x2a'));}if(!_0x518e06[_0xa55e('0x10')]||!_0x518e06[_0xa55e('0x2b')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x39'));}_0x1d45c1=_0x518e06;logger['info'](util['format'](_0xa55e('0x2c'),_0x1c1ca3['id']));return sentiment(_0x1d45c1[_0xa55e('0x10')],_0x1d45c1[_0xa55e('0x2b')],_0x5b69cc[_0xa55e('0x23')],_0x1c1ca3[_0xa55e('0x13')],_0x5b69cc[_0xa55e('0x2d')]);})[_0xa55e('0x12')](function(_0xd6b91f){logger['info'](util['format'](_0xa55e('0x3a'),_0x1c1ca3['id']));return _0x1c1ca3['update']({'sentiment':_0xd6b91f[_0xa55e('0x2e')],'sPositive':_0xd6b91f['SentimentScore']['Positive'],'sNegative':_0xd6b91f[_0xa55e('0x2f')][_0xa55e('0x31')],'sMixed':_0xd6b91f['SentimentScore']['Mixed'],'sNeutral':_0xd6b91f[_0xa55e('0x2f')][_0xa55e('0x32')],'transcribeStatus':_0xa55e('0x16')});})[_0xa55e('0x12')](function(){logger[_0xa55e('0xc')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1c1ca3['id']));_0x153f71();});}})['catch'](function(_0x2282f9){if(_0x2282f9){if(!_0x2282f9[_0xa55e('0x3b')]||_0x2282f9[_0xa55e('0x3b')]!==_0xa55e('0x3c')){logger[_0xa55e('0x3d')](util[_0xa55e('0xd')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1c1ca3['id']),util[_0xa55e('0x3e')](_0x2282f9,{'showHidden':![],'depth':null}));}}_0x153f71();});});}function checkTranscribe(){var _0x1f81af;var _0x1405cb;var _0x1de3a8;return db[_0xa55e('0x3f')][_0xa55e('0x40')]({'where':{'transcribeStatus':'IN_PROGRESS'}})['then'](function(_0x395e73){if(!_0x395e73||!_0x395e73['length']){throw new db[(_0xa55e('0x37'))]['ValidationError'](_0xa55e('0x41'));}_0x1f81af=_0x395e73;return db[_0xa55e('0x42')][_0xa55e('0x29')]({'where':{'id':0x1}});})[_0xa55e('0x12')](function(_0x2c35a8){if(!_0x2c35a8){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x43'));}_0x1405cb=_0x2c35a8;if(!_0x1405cb['transcribe']||!_0x1405cb[_0xa55e('0x44')]||!_0x1405cb[_0xa55e('0x11')]||!_0x1405cb[_0xa55e('0x2d')]||!_0x1405cb[_0xa55e('0x24')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))]('Transcribe\x20not\x20configured');}return db[_0xa55e('0x28')][_0xa55e('0x29')]({'where':{'id':_0x1405cb[_0xa55e('0x44')]}});})[_0xa55e('0x12')](function(_0x4559c8){if(!_0x4559c8){throw new db[(_0xa55e('0x37'))]['ValidationError'](_0xa55e('0x2a'));}if(!_0x4559c8['data1']||!_0x4559c8[_0xa55e('0x2b')]){throw new db[(_0xa55e('0x37'))][(_0xa55e('0x21'))](_0xa55e('0x39'));}_0x1de3a8=_0x4559c8;var _0xa01634=[];_0x1f81af[_0xa55e('0x45')](function(_0x570474){_0xa01634[_0xa55e('0x46')](checkTranscribeJob(_0x570474,_0x1405cb,_0x1de3a8));});return BPromise['all'](_0xa01634);})[_0xa55e('0x47')](function(_0x5be88c){if(_0x5be88c){if(!_0x5be88c['name']||_0x5be88c[_0xa55e('0x3b')]!==_0xa55e('0x3c')){logger[_0xa55e('0x3d')](util[_0xa55e('0x3e')](_0x5be88c,{'showHidden':![],'depth':null}));}}});}exports[_0xa55e('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index c029389..568e408 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 _0x7510=['info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','start','moment','util','../../config/environment','../../mysqldb','schedule','redis','defaults','findAll','lastMsgAt','subtract','hours','then','length'];(function(_0x2d7ef2,_0x3990c3){var _0x39bfd0=function(_0x418ef8){while(--_0x418ef8){_0x2d7ef2['push'](_0x2d7ef2['shift']());}};_0x39bfd0(++_0x3990c3);}(_0x7510,0xa9));var _0x0751=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x7510[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var moment=require(_0x0751('0x0'));var Redis=require('ioredis');var util=require(_0x0751('0x1'));var config=require(_0x0751('0x2'));var db=require(_0x0751('0x3'))['db'];var logger=require('../logger')(_0x0751('0x4'));config[_0x0751('0x5')]=_[_0x0751('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x199fe1=[];return db['WhatsappInteraction'][_0x0751('0x7')]({'raw':!![],'attributes':['id',_0x0751('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0751('0x9')](0x18,_0x0751('0xa'))}}})[_0x0751('0xb')](function(_0x42964b){if(_0x42964b&&_0x42964b[_0x0751('0xc')]){_0x199fe1=_['map'](_0x42964b||[],'id');logger[_0x0751('0xd')](_0x0751('0xe'),_0x199fe1[_0x0751('0xf')]());return db[_0x0751('0x10')][_0x0751('0x11')]({'closeReason':'system','disposition':_0x0751('0x12'),'closed':!![],'closedAt':moment()[_0x0751('0x13')](_0x0751('0x14'))},{'where':{'id':_0x199fe1}});}})[_0x0751('0xb')](function(){if(_0x199fe1&&_0x199fe1[_0x0751('0xc')]){logger[_0x0751('0xd')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x199fe1['join']());for(var _0x244b35=0x0;_0x244b35<_0x199fe1[_0x0751('0xc')];_0x244b35++){io[_0x0751('0x15')](_0x0751('0x16'),{'id':_0x199fe1[_0x244b35],'closed':!![]});}}})[_0x0751('0x17')](function(_0x3bd842){logger['error'](_0x0751('0x18'),_0x3bd842?util['inspect'](_0x3bd842,{'showHidden':![],'depth':null}):'');});}exports[_0x0751('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xfb6e=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','update','system','timeout','format','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','localhost','socket.io-emitter','findAll','subtract','length','map','info'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xfb6e,0x177));var _0xefb6=function(_0x3d3817,_0x5d0b91){_0x3d3817=_0x3d3817-0x0;var _0x4f23ce=_0xfb6e[_0x3d3817];return _0x4f23ce;};'use strict';var _=require('lodash');var moment=require(_0xefb6('0x0'));var Redis=require(_0xefb6('0x1'));var util=require(_0xefb6('0x2'));var config=require(_0xefb6('0x3'));var db=require(_0xefb6('0x4'))['db'];var logger=require(_0xefb6('0x5'))(_0xefb6('0x6'));config[_0xefb6('0x7')]=_['defaults'](config[_0xefb6('0x7')],{'host':_0xefb6('0x8'),'port':0x18eb});var io=require(_0xefb6('0x9'))(new Redis(config[_0xefb6('0x7')]));function closeInteractions(){var _0x4c5ea6=[];return db['WhatsappInteraction'][_0xefb6('0xa')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xefb6('0xb')](0x18,'hours')}}})['then'](function(_0x21138b){if(_0x21138b&&_0x21138b[_0xefb6('0xc')]){_0x4c5ea6=_[_0xefb6('0xd')](_0x21138b||[],'id');logger[_0xefb6('0xe')](_0xefb6('0xf'),_0x4c5ea6[_0xefb6('0x10')]());return db[_0xefb6('0x11')][_0xefb6('0x12')]({'closeReason':_0xefb6('0x13'),'disposition':_0xefb6('0x14'),'closed':!![],'closedAt':moment()[_0xefb6('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x4c5ea6}});}})[_0xefb6('0x16')](function(){if(_0x4c5ea6&&_0x4c5ea6[_0xefb6('0xc')]){logger['info'](_0xefb6('0x17'),_0x4c5ea6['join']());for(var _0x551e6b=0x0;_0x551e6b<_0x4c5ea6[_0xefb6('0xc')];_0x551e6b++){io['emit'](_0xefb6('0x18'),{'id':_0x4c5ea6[_0x551e6b],'closed':!![]});}}})[_0xefb6('0x19')](function(_0x33e482){logger[_0xefb6('0x1a')](_0xefb6('0x1b'),_0x33e482?util[_0xefb6('0x1c')](_0x33e482,{'showHidden':![],'depth':null}):'');});}exports[_0xefb6('0x1d')]=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 09309bb..070624e 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c9a=['util','../mysqldb','push','Biondo','now','Innocenzo','innocenzo.biondo','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch'];(function(_0x46cf00,_0x457a43){var _0x3974dc=function(_0x4b5d0a){while(--_0x4b5d0a){_0x46cf00['push'](_0x46cf00['shift']());}};_0x3974dc(++_0x457a43);}(_0x4c9a,0x140));var _0xa4c9=function(_0x60bc6f,_0x41deae){_0x60bc6f=_0x60bc6f-0x0;var _0xc82c12=_0x4c9a[_0x60bc6f];return _0xc82c12;};'use strict';var util=require(_0xa4c9('0x0'));var db=require(_0xa4c9('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa4c9('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xa4c9('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa4c9('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa4c9('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa4c9('0x4')](),'updatedAt':Date[_0xa4c9('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa4c9('0x2')]({'id':i,'firstName':_0xa4c9('0x5')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xa4c9('0x6')+i+_0xa4c9('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa4c9('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa4c9('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa4c9('0x4')](),'updatedAt':Date[_0xa4c9('0x4')]()});}db[_0xa4c9('0x8')][_0xa4c9('0x9')]({'where':{}})[_0xa4c9('0xa')](function(){return db[_0xa4c9('0x8')][_0xa4c9('0xb')](contacts);})[_0xa4c9('0xa')](function(){console[_0xa4c9('0xc')](_0xa4c9('0xd'),_0xa4c9('0xe'));return db[_0xa4c9('0xf')][_0xa4c9('0x9')]({'where':{}});})[_0xa4c9('0xa')](function(){return db[_0xa4c9('0xf')][_0xa4c9('0xb')](hopper);})['then'](function(){console[_0xa4c9('0xc')]('finished\x20populating',_0xa4c9('0x10'));return db[_0xa4c9('0x8')][_0xa4c9('0xb')](contacts2);})['then'](function(){console['log'](_0xa4c9('0xd'),_0xa4c9('0x11'));return db[_0xa4c9('0xf')]['bulkCreate'](hopper2);})['then'](function(){console['log'](_0xa4c9('0xd'),_0xa4c9('0x12'));})[_0xa4c9('0x13')](function(_0x365c37){console[_0xa4c9('0xc')](_0x365c37);}); \ No newline at end of file +var _0x4810=['@xcally.com','now','Innocenzo','CmContact','destroy','then','contacts1','CmHopper','bulkCreate','log','finished\x20populating','contacts2','hopper2','catch','util','../mysqldb','push','Biondo','innocenzo.biondo'];(function(_0x5a16c8,_0x491fcc){var _0x39873d=function(_0xc90b4a){while(--_0xc90b4a){_0x5a16c8['push'](_0x5a16c8['shift']());}};_0x39873d(++_0x491fcc);}(_0x4810,0x1b0));var _0x0481=function(_0x3355a6,_0x30078a){_0x3355a6=_0x3355a6-0x0;var _0x599f40=_0x4810[_0x3355a6];return _0x599f40;};'use strict';var util=require(_0x0481('0x0'));var db=require(_0x0481('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0481('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x0481('0x3')+i,'phone':0xf879fb460+i,'email':_0x0481('0x4')+i+_0x0481('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0481('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0481('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0481('0x6')](),'updatedAt':Date[_0x0481('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0481('0x2')]({'id':i,'firstName':_0x0481('0x7')+i,'lastName':_0x0481('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x0481('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0481('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0481('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x0481('0x8')][_0x0481('0x9')]({'where':{}})[_0x0481('0xa')](function(){return db[_0x0481('0x8')]['bulkCreate'](contacts);})['then'](function(){console['log']('finished\x20populating',_0x0481('0xb'));return db[_0x0481('0xc')][_0x0481('0x9')]({'where':{}});})[_0x0481('0xa')](function(){return db['CmHopper'][_0x0481('0xd')](hopper);})[_0x0481('0xa')](function(){console[_0x0481('0xe')](_0x0481('0xf'),'hopper1');return db[_0x0481('0x8')][_0x0481('0xd')](contacts2);})[_0x0481('0xa')](function(){console[_0x0481('0xe')](_0x0481('0xf'),_0x0481('0x10'));return db[_0x0481('0xc')][_0x0481('0xd')](hopper2);})['then'](function(){console[_0x0481('0xe')](_0x0481('0xf'),_0x0481('0x11'));})[_0x0481('0x12')](function(_0x519781){console[_0x0481('0xe')](_0x519781);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 80e1b77..73a4033 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe3c5=['wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp'];(function(_0x498de3,_0x4fe659){var _0x3d8f0d=function(_0x4a6f49){while(--_0x4a6f49){_0x498de3['push'](_0x498de3['shift']());}};_0x3d8f0d(++_0x4fe659);}(_0xe3c5,0x1da));var _0x5e3c=function(_0x2a6501,_0x9c5a0e){_0x2a6501=_0x2a6501-0x0;var _0x34d3ae=_0xe3c5[_0x2a6501];return _0x34d3ae;};'use strict';var util=require('util');var db=require(_0x5e3c('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x5e3c('0x1')]({'name':util[_0x5e3c('0x2')](_0x5e3c('0x3'),_0x5e3c('0x4'),i),'fullname':util[_0x5e3c('0x2')](_0x5e3c('0x3'),_0x5e3c('0x4'),i),'email':util[_0x5e3c('0x2')](_0x5e3c('0x5'),'agent',i),'role':_0x5e3c('0x4'),'password':_0x5e3c('0x6'),'internal':0xfa0+i,'type':_0x5e3c('0x7'),'transport':[_0x5e3c('0x8'),'ws',_0x5e3c('0x9')],'disallow':['all'],'allow':[_0x5e3c('0xa')],'defaultuser':util['format'](_0x5e3c('0x3'),'agent',i),'encryption':'yes','avpf':_0x5e3c('0xb'),'force_avp':_0x5e3c('0xb'),'icesupport':_0x5e3c('0xb'),'dtlsenable':_0x5e3c('0xb'),'dtlsverify':'no','dtlscertfile':_0x5e3c('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x5e3c('0xd'),'callerid':util[_0x5e3c('0x2')](_0x5e3c('0xe'),util[_0x5e3c('0x2')](_0x5e3c('0x3'),_0x5e3c('0x4'),i),0xfa0+i)});}db[_0x5e3c('0xf')][_0x5e3c('0x10')](users)[_0x5e3c('0x11')](function(){console[_0x5e3c('0x12')](_0x5e3c('0x13'));})[_0x5e3c('0x14')](function(_0x44b579){console[_0x5e3c('0x12')](_0x44b579);}); \ No newline at end of file +var _0x1bdf=['\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key'];(function(_0x1e79b9,_0x223ef3){var _0x2c2d29=function(_0x4573aa){while(--_0x4573aa){_0x1e79b9['push'](_0x1e79b9['shift']());}};_0x2c2d29(++_0x223ef3);}(_0x1bdf,0x9a));var _0xf1bd=function(_0x20087d,_0xcb0a44){_0x20087d=_0x20087d-0x0;var _0x2eb59b=_0x1bdf[_0x20087d];return _0x2eb59b;};'use strict';var util=require(_0xf1bd('0x0'));var db=require(_0xf1bd('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xf1bd('0x2')]({'name':util['format'](_0xf1bd('0x3'),_0xf1bd('0x4'),i),'fullname':util[_0xf1bd('0x5')]('%s%s',_0xf1bd('0x4'),i),'email':util['format'](_0xf1bd('0x6'),_0xf1bd('0x4'),i),'role':_0xf1bd('0x4'),'password':_0xf1bd('0x7'),'internal':0xfa0+i,'type':_0xf1bd('0x8'),'transport':['udp','ws',_0xf1bd('0x9')],'disallow':['all'],'allow':[_0xf1bd('0xa')],'defaultuser':util['format']('%s%s',_0xf1bd('0x4'),i),'encryption':_0xf1bd('0xb'),'avpf':'yes','force_avp':_0xf1bd('0xb'),'icesupport':_0xf1bd('0xb'),'dtlsenable':_0xf1bd('0xb'),'dtlsverify':'no','dtlscertfile':_0xf1bd('0xc'),'dtlsprivatekey':_0xf1bd('0xd'),'dtlssetup':'actpass','callerid':util['format'](_0xf1bd('0xe'),util['format']('%s%s',_0xf1bd('0x4'),i),0xfa0+i)});}db[_0xf1bd('0xf')][_0xf1bd('0x10')](users)[_0xf1bd('0x11')](function(){console[_0xf1bd('0x12')](_0xf1bd('0x13'));})[_0xf1bd('0x14')](function(_0x4cccfa){console[_0xf1bd('0x12')](_0x4cccfa);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 782e626..5ba73e2 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6515=['getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','whatsapp','telephone:%s','trunk:%s','leave','ChatInteractions','emit','user_has_chat_interactions:remove','MailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','catch','log','default','connection','request','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','Campaign','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','VoiceQueue','ChatQueues','FaxQueues','SmsQueue','Telephones','getVoiceQueues','getFaxQueues','getSmsQueues'];(function(_0x507269,_0x499341){var _0x505d6f=function(_0x450d05){while(--_0x450d05){_0x507269['push'](_0x507269['shift']());}};_0x505d6f(++_0x499341);}(_0x6515,0x1e5));var _0x5651=function(_0x136a7c,_0x530676){_0x136a7c=_0x136a7c-0x0;var _0x398e90=_0x6515[_0x136a7c];return _0x398e90;};'use strict';var _=require(_0x5651('0x0'));var util=require(_0x5651('0x1'));var BPromise=require(_0x5651('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x5651('0x3'));var queryQueues={'attributes':['id',_0x5651('0x4')],'include':[{'as':_0x5651('0x5'),'model':db[_0x5651('0x6')],'attributes':['id',_0x5651('0x4'),_0x5651('0x7')],'raw':!![],'where':{'role':_0x5651('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5651('0x4')],'where':{'role':_0x5651('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x5651('0x4')],'where':{'role':_0x5651('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5651('0x4'),_0x5651('0xa')],'where':{'type':_0x5651('0xb')}};function getAssociatedResources(_0x445b30,_0x36310d,_0x384f42){return db[_0x5651('0xc')][_0x5651('0xd')]({'where':{'name':_0x445b30,'userProfileId':_0x36310d},'raw':!![]})[_0x5651('0xe')](function(_0x1d5541){if(_0x1d5541){if(_0x1d5541[_0x5651('0xf')]){switch(_0x445b30){case _0x5651('0x10'):case'ChatQueues':case'FaxQueues':case _0x5651('0x11'):case _0x5651('0x12'):case _0x5651('0x13'):case _0x5651('0x14'):return db[_0x384f42]['findAll'](queryQueues);case'Telephones':return db[_0x384f42][_0x5651('0x15')](queryTelephones);case _0x5651('0x16'):return db[_0x384f42][_0x5651('0x15')](queryTrunks);case _0x5651('0x17'):return db[_0x384f42][_0x5651('0x15')](queryCampaigns);}}else{return db[_0x5651('0x18')][_0x5651('0x15')]({'attributes':['resourceId'],'where':{'sectionId':_0x1d5541['id']},'raw':!![]})[_0x5651('0xe')](function(_0x27bbd3){if(_0x27bbd3){var _0x1a4325={'where':{'id':_[_0x5651('0x19')](_0x27bbd3,_0x5651('0x1a'))},'raw':!![]};switch(_0x384f42){case _0x5651('0x6'):_0x1a4325['where'][_0x5651('0x7')]=_0x5651('0x9');break;case _0x5651('0x1b'):_0x1a4325['where'][_0x5651('0xa')]='ivr';break;}return db[_0x384f42]['findAll'](_0x1a4325);}else{return[];}});}}else{return[];}})['then'](function(_0x58ccab){return _0x58ccab;});}function joinOrLeaveQueues(_0x225d8b,_0x2f3996,_0x314cba,_0x2c31d7){_0x225d8b[_0x2f3996](util[_0x5651('0x1c')](_0x5651('0x1d'),_0x314cba,_0x2c31d7[_0x5651('0x4')]));if(_0x2c31d7[_0x5651('0x5')]){for(var _0x52b29c=0x0;_0x52b29c<_0x2c31d7[_0x5651('0x5')][_0x5651('0x1e')];_0x52b29c+=0x1){_0x225d8b[_0x2f3996](util['format'](_0x5651('0x1f'),_0x2c31d7[_0x5651('0x5')][_0x52b29c][_0x5651('0x4')]));}}}function joinOrLeave(_0xf968fb,_0x178eca,_0x2517e7){var _0x41de3a;if(_0xf968fb[_0x5651('0x20')][_0x5651('0x21')]['id']){db[_0x5651('0x6')]['find']({'attributes':['id',_0x5651('0x4'),'role',_0x5651('0x22')],'where':{'id':_0xf968fb['handshake'][_0x5651('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5651('0x23')],'as':_0x5651('0x24'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x5651('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5651('0x26')],'as':_0x5651('0x27'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x5651('0x28'),'attributes':['id'],'raw':!![]}]})[_0x5651('0xe')](function(_0xfac646){if(_0xfac646){_0x41de3a=_0xfac646;_0xf968fb[_0x178eca](util[_0x5651('0x1c')](_0x5651('0x1f'),_0xfac646[_0x5651('0x4')]));var _0x3e5c31=[];switch(_0xfac646[_0x5651('0x7')]){case'admin':_0xf968fb[_0x178eca](_0x5651('0x29'));_0xf968fb[_0x178eca](_0x5651('0x2a'));if(queryQueues[_0x5651('0x2b')](_0x5651('0x2c'))){delete queryQueues[_0x5651('0x2c')];}_0x3e5c31[_0x5651('0x2d')](db['VoiceQueue']['findAll'](queryQueues));_0x3e5c31['push'](db[_0x5651('0x2e')][_0x5651('0x15')](queryQueues));_0x3e5c31['push'](db[_0x5651('0x2f')][_0x5651('0x15')](queryQueues));_0x3e5c31[_0x5651('0x2d')](db['SmsQueue'][_0x5651('0x15')](queryQueues));_0x3e5c31[_0x5651('0x2d')](db[_0x5651('0x30')][_0x5651('0x15')](queryQueues));_0x3e5c31[_0x5651('0x2d')](db[_0x5651('0x31')][_0x5651('0x15')](queryQueues));_0x3e5c31['push'](db[_0x5651('0x32')][_0x5651('0x15')](queryQueues));_0x3e5c31[_0x5651('0x2d')](db[_0x5651('0x6')][_0x5651('0x15')](queryTelephones));_0x3e5c31['push'](db[_0x5651('0x33')][_0x5651('0x15')](queryTrunks));_0x3e5c31['push'](db['Campaign'][_0x5651('0x15')](queryCampaigns));_0x3e5c31[_0x5651('0x2d')](db['User'][_0x5651('0x15')](queryAgents));break;case _0x5651('0x34'):_0xf968fb[_0x178eca](_0x5651('0x29'));_0xf968fb[_0x178eca](_0x5651('0x2a'));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources(_0x5651('0x10'),_0xfac646[_0x5651('0x22')],_0x5651('0x35')));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources(_0x5651('0x36'),_0xfac646[_0x5651('0x22')],_0x5651('0x2e')));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources(_0x5651('0x37'),_0xfac646[_0x5651('0x22')],_0x5651('0x2f')));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources(_0x5651('0x11'),_0xfac646[_0x5651('0x22')],_0x5651('0x38')));_0x3e5c31['push'](getAssociatedResources(_0x5651('0x12'),_0xfac646['userProfileId'],_0x5651('0x30')));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources(_0x5651('0x13'),_0xfac646[_0x5651('0x22')],_0x5651('0x31')));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources('WhatsappQueues',_0xfac646[_0x5651('0x22')],_0x5651('0x32')));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources(_0x5651('0x39'),_0xfac646[_0x5651('0x22')],'User'));_0x3e5c31[_0x5651('0x2d')](getAssociatedResources(_0x5651('0x16'),_0xfac646[_0x5651('0x22')],_0x5651('0x33')));_0x3e5c31['push'](getAssociatedResources(_0x5651('0x17'),_0xfac646[_0x5651('0x22')],_0x5651('0x1b')));_0x3e5c31['push'](db[_0x5651('0x6')]['findAll'](queryAgents));break;case _0x5651('0x8'):_0xf968fb[_0x178eca](_0x5651('0x29'));_0xf968fb[_0x178eca]('voice:outbound');_0x3e5c31['push'](_0xfac646[_0x5651('0x3a')]({'attributes':['id','name']}));_0x3e5c31[_0x5651('0x2d')](_0xfac646['getChatQueues']({'attributes':['id',_0x5651('0x4')]}));_0x3e5c31[_0x5651('0x2d')](_0xfac646[_0x5651('0x3b')]({'attributes':['id','name']}));_0x3e5c31[_0x5651('0x2d')](_0xfac646[_0x5651('0x3c')]({'attributes':['id','name']}));_0x3e5c31[_0x5651('0x2d')](_0xfac646['getMailQueues']({'attributes':['id',_0x5651('0x4')]}));_0x3e5c31[_0x5651('0x2d')](_0xfac646[_0x5651('0x3d')]({'attributes':['id','name']}));_0x3e5c31[_0x5651('0x2d')](_0xfac646[_0x5651('0x3e')]({'attributes':['id',_0x5651('0x4')]}));break;}return BPromise[_0x5651('0x3f')](_0x3e5c31);}})[_0x5651('0xe')](function(_0x486bee){if(_0x486bee&&_0x486bee[_0x5651('0x1e')]){for(var _0x4aaac4=0x0;_0x4aaac4<_0x486bee[_0x5651('0x1e')];_0x4aaac4+=0x1){for(var _0x2bf1f4=0x0;_0x2bf1f4<_0x486bee[_0x4aaac4][_0x5651('0x1e')];_0x2bf1f4+=0x1){switch(_0x4aaac4){case 0x0:joinOrLeaveQueues(_0xf968fb,_0x178eca,_0x5651('0x40'),_0x486bee[_0x4aaac4][_0x2bf1f4]);break;case 0x1:joinOrLeaveQueues(_0xf968fb,_0x178eca,_0x5651('0x41'),_0x486bee[_0x4aaac4][_0x2bf1f4]);break;case 0x2:joinOrLeaveQueues(_0xf968fb,_0x178eca,_0x5651('0x42'),_0x486bee[_0x4aaac4][_0x2bf1f4]);break;case 0x3:joinOrLeaveQueues(_0xf968fb,_0x178eca,_0x5651('0x43'),_0x486bee[_0x4aaac4][_0x2bf1f4]);break;case 0x4:joinOrLeaveQueues(_0xf968fb,_0x178eca,'mail',_0x486bee[_0x4aaac4][_0x2bf1f4]);break;case 0x5:joinOrLeaveQueues(_0xf968fb,_0x178eca,'openchannel',_0x486bee[_0x4aaac4][_0x2bf1f4]);break;case 0x6:joinOrLeaveQueues(_0xf968fb,_0x178eca,_0x5651('0x44'),_0x486bee[_0x4aaac4][_0x2bf1f4]);break;case 0x7:if(_0x41de3a['role']!==_0x5651('0x8'))_0xf968fb[_0x178eca](util['format'](_0x5651('0x45'),_0x486bee[_0x4aaac4][_0x2bf1f4]['name']));break;case 0x8:if(_0x41de3a[_0x5651('0x7')]!=='agent')_0xf968fb[_0x178eca](util[_0x5651('0x1c')](_0x5651('0x46'),_0x486bee[_0x4aaac4][_0x2bf1f4][_0x5651('0x4')]));break;case 0x9:if(_0x41de3a['role']!==_0x5651('0x8'))_0xf968fb[_0x178eca](util['format']('campaign:%s:%s',_0x486bee[_0x4aaac4][_0x2bf1f4][_0x5651('0xa')],_0x486bee[_0x4aaac4][_0x2bf1f4][_0x5651('0x4')]));break;case 0xa:_0xf968fb[_0x178eca](util[_0x5651('0x1c')]('user:%s',_0x486bee[_0x4aaac4][_0x2bf1f4][_0x5651('0x4')]));break;}}}}})['then'](function(){if(_0x178eca===_0x5651('0x47')){var _0x2a7131=_[_0x5651('0x19')](_0x41de3a[_0x5651('0x48')],'id');return _0x41de3a['removeChatInteractions'](_0x2a7131)[_0x5651('0xe')](function(){for(var _0x231b2d=0x0;_0x231b2d<_0x2a7131['length'];_0x231b2d+=0x1){_0x2517e7[_0x5651('0x49')](_0x5651('0x4a'),{'ChatInteractionId':Number(_0x2a7131[_0x231b2d]),'UserId':Number(_0x41de3a['id'])});}});}})[_0x5651('0xe')](function(){if(_0x178eca===_0x5651('0x47')){var _0x4fb60b=_['map'](_0x41de3a[_0x5651('0x4b')],'id');return _0x41de3a['removeMailInteractions'](_0x4fb60b)[_0x5651('0xe')](function(){for(var _0xfdf441=0x0;_0xfdf441<_0x4fb60b[_0x5651('0x1e')];_0xfdf441+=0x1){_0x2517e7[_0x5651('0x49')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4fb60b[_0xfdf441]),'UserId':Number(_0x41de3a['id'])});}});}})[_0x5651('0xe')](function(){if(_0x178eca===_0x5651('0x47')){var _0x93eb78=_[_0x5651('0x19')](_0x41de3a[_0x5651('0x24')],'id');return _0x41de3a[_0x5651('0x4c')](_0x93eb78)['then'](function(){for(var _0x1f1106=0x0;_0x1f1106<_0x93eb78[_0x5651('0x1e')];_0x1f1106+=0x1){_0x2517e7[_0x5651('0x49')](_0x5651('0x4d'),{'FaxInteractionId':Number(_0x93eb78[_0x1f1106]),'UserId':Number(_0x41de3a['id'])});}});}})[_0x5651('0xe')](function(){if(_0x178eca===_0x5651('0x47')){var _0x50a9ca=_[_0x5651('0x19')](_0x41de3a['SmsInteractions'],'id');return _0x41de3a['removeSmsInteractions'](_0x50a9ca)[_0x5651('0xe')](function(){for(var _0x291704=0x0;_0x291704<_0x50a9ca['length'];_0x291704+=0x1){_0x2517e7[_0x5651('0x49')](_0x5651('0x4e'),{'SmsInteractionId':Number(_0x50a9ca[_0x291704]),'UserId':Number(_0x41de3a['id'])});}});}})['then'](function(){if(_0x178eca===_0x5651('0x47')){var _0x785af8=_[_0x5651('0x19')](_0x41de3a[_0x5651('0x27')],'id');return _0x41de3a[_0x5651('0x4f')](_0x785af8)[_0x5651('0xe')](function(){for(var _0x5d5aed=0x0;_0x5d5aed<_0x785af8[_0x5651('0x1e')];_0x5d5aed+=0x1){_0x2517e7['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x785af8[_0x5d5aed]),'UserId':Number(_0x41de3a['id'])});}});}})['then'](function(){if(_0x178eca===_0x5651('0x47')){var _0x4a42ec=_[_0x5651('0x19')](_0x41de3a[_0x5651('0x28')],'id');return _0x41de3a[_0x5651('0x50')](_0x4a42ec)['then'](function(){for(var _0xaa03f9=0x0;_0xaa03f9<_0x4a42ec['length'];_0xaa03f9+=0x1){_0x2517e7[_0x5651('0x49')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x4a42ec[_0xaa03f9]),'UserId':Number(_0x41de3a['id'])});}});}})[_0x5651('0x51')](function(_0x4a3c70){_0xf968fb[_0x5651('0x52')](_0x4a3c70);});}}function onDisconnect(_0x9c0987,_0x387efd){joinOrLeave(_0x9c0987,'leave',_0x387efd);}function onConnect(_0x114406){joinOrLeave(_0x114406,'join');}exports[_0x5651('0x53')]=function(_0x5732ca){_0x5732ca['on'](_0x5651('0x54'),function(_0x1a454c){_0x1a454c['setMaxListeners'](0x0);_0x1a454c['address']=_0x1a454c[_0x5651('0x55')][_0x5651('0x54')]['remoteAddress']+':'+_0x1a454c[_0x5651('0x55')][_0x5651('0x54')]['remotePort'];_0x1a454c['connectedAt']=new Date();_0x1a454c[_0x5651('0x52')]=function(_0x70989f){console[_0x5651('0x52')](_0x5651('0x56')+_0x1a454c[_0x5651('0x57')]['name']+'['+_0x1a454c['address']+']',_0x70989f);};_0x1a454c['on'](_0x5651('0x58'),function(){onDisconnect(_0x1a454c,_0x5732ca);_0x1a454c[_0x5651('0x52')](_0x5651('0x59'));});onConnect(_0x1a454c);_0x1a454c[_0x5651('0x52')](_0x5651('0x5a'));});}; \ No newline at end of file +var _0x3ef7=['length','user:%s','handshake','query','find','MailInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','FaxQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','voice:outbound','VoiceQueues','userProfileId','VoiceQueue','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','mail','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','map','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','role','agent','type','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','User','telephone','Campaign','where','format','%s:queue:%s'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x3ef7,0xa2));var _0x73ef=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3ef7[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x73ef('0x0'));var util=require('util');var BPromise=require(_0x73ef('0x1'));var db=require(_0x73ef('0x2'))['db'];var config=require(_0x73ef('0x3'));var queryQueues={'attributes':['id',_0x73ef('0x4')],'include':[{'as':_0x73ef('0x5'),'model':db['User'],'attributes':['id',_0x73ef('0x4'),_0x73ef('0x6')],'raw':!![],'where':{'role':_0x73ef('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x73ef('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x73ef('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x73ef('0x4')],'where':{'role':_0x73ef('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x73ef('0x4'),_0x73ef('0x8')],'where':{'type':'ivr'}};function getAssociatedResources(_0x2b60fd,_0x8ee23,_0x50098a){return db[_0x73ef('0x9')][_0x73ef('0xa')]({'where':{'name':_0x2b60fd,'userProfileId':_0x8ee23},'raw':!![]})[_0x73ef('0xb')](function(_0x3bd4c9){if(_0x3bd4c9){if(_0x3bd4c9[_0x73ef('0xc')]){switch(_0x2b60fd){case'VoiceQueues':case _0x73ef('0xd'):case _0x73ef('0xe'):case _0x73ef('0xf'):case _0x73ef('0x10'):case _0x73ef('0x11'):case _0x73ef('0x12'):return db[_0x50098a][_0x73ef('0x13')](queryQueues);case _0x73ef('0x14'):return db[_0x50098a][_0x73ef('0x13')](queryTelephones);case _0x73ef('0x15'):return db[_0x50098a][_0x73ef('0x13')](queryTrunks);case _0x73ef('0x16'):return db[_0x50098a][_0x73ef('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x73ef('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x3bd4c9['id']},'raw':!![]})[_0x73ef('0xb')](function(_0x2faa63){if(_0x2faa63){var _0x3c0c3b={'where':{'id':_['map'](_0x2faa63,_0x73ef('0x17'))},'raw':!![]};switch(_0x50098a){case _0x73ef('0x18'):_0x3c0c3b['where'][_0x73ef('0x6')]=_0x73ef('0x19');break;case _0x73ef('0x1a'):_0x3c0c3b[_0x73ef('0x1b')][_0x73ef('0x8')]='ivr';break;}return db[_0x50098a][_0x73ef('0x13')](_0x3c0c3b);}else{return[];}});}}else{return[];}})['then'](function(_0x8d6fe5){return _0x8d6fe5;});}function joinOrLeaveQueues(_0x4d1a9a,_0x1ba9cb,_0x2168ec,_0x36d02f){_0x4d1a9a[_0x1ba9cb](util[_0x73ef('0x1c')](_0x73ef('0x1d'),_0x2168ec,_0x36d02f[_0x73ef('0x4')]));if(_0x36d02f[_0x73ef('0x5')]){for(var _0x1d5e1f=0x0;_0x1d5e1f<_0x36d02f['Agents'][_0x73ef('0x1e')];_0x1d5e1f+=0x1){_0x4d1a9a[_0x1ba9cb](util[_0x73ef('0x1c')](_0x73ef('0x1f'),_0x36d02f[_0x73ef('0x5')][_0x1d5e1f]['name']));}}}function joinOrLeave(_0xc3ba9d,_0x28406c,_0x40907a){var _0x1519f9;if(_0xc3ba9d[_0x73ef('0x20')][_0x73ef('0x21')]['id']){db[_0x73ef('0x18')][_0x73ef('0x22')]({'attributes':['id',_0x73ef('0x4'),_0x73ef('0x6'),'userProfileId'],'where':{'id':_0xc3ba9d[_0x73ef('0x20')][_0x73ef('0x21')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x23')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x73ef('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x25')],'as':_0x73ef('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x73ef('0x28')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x73ef('0xb')](function(_0x517e70){if(_0x517e70){_0x1519f9=_0x517e70;_0xc3ba9d[_0x28406c](util[_0x73ef('0x1c')](_0x73ef('0x1f'),_0x517e70[_0x73ef('0x4')]));var _0xa3f75b=[];switch(_0x517e70[_0x73ef('0x6')]){case _0x73ef('0x29'):_0xc3ba9d[_0x28406c](_0x73ef('0x2a'));_0xc3ba9d[_0x28406c]('voice:outbound');if(queryQueues[_0x73ef('0x2b')](_0x73ef('0x2c'))){delete queryQueues[_0x73ef('0x2c')];}_0xa3f75b['push'](db['VoiceQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db['ChatQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b['push'](db[_0x73ef('0x2e')][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db['SmsQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db['MailQueue'][_0x73ef('0x13')](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x2f')]['findAll'](queryQueues));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x30')][_0x73ef('0x13')](queryQueues));_0xa3f75b['push'](db[_0x73ef('0x18')][_0x73ef('0x13')](queryTelephones));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x31')][_0x73ef('0x13')](queryTrunks));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x1a')][_0x73ef('0x13')](queryCampaigns));_0xa3f75b[_0x73ef('0x2d')](db[_0x73ef('0x18')]['findAll'](queryAgents));break;case _0x73ef('0x32'):_0xc3ba9d[_0x28406c](_0x73ef('0x2a'));_0xc3ba9d[_0x28406c](_0x73ef('0x33'));_0xa3f75b['push'](getAssociatedResources(_0x73ef('0x34'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x36')));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0xd'),_0x517e70['userProfileId'],'ChatQueue'));_0xa3f75b['push'](getAssociatedResources(_0x73ef('0xe'),_0x517e70[_0x73ef('0x35')],'FaxQueue'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0xf'),_0x517e70[_0x73ef('0x35')],'SmsQueue'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x10'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x37')));_0xa3f75b['push'](getAssociatedResources(_0x73ef('0x11'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x2f')));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x12'),_0x517e70[_0x73ef('0x35')],_0x73ef('0x30')));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x14'),_0x517e70['userProfileId'],'User'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x15'),_0x517e70['userProfileId'],'Trunk'));_0xa3f75b[_0x73ef('0x2d')](getAssociatedResources(_0x73ef('0x16'),_0x517e70['userProfileId'],'Campaign'));_0xa3f75b['push'](db['User'][_0x73ef('0x13')](queryAgents));break;case _0x73ef('0x7'):_0xc3ba9d[_0x28406c](_0x73ef('0x2a'));_0xc3ba9d[_0x28406c](_0x73ef('0x33'));_0xa3f75b[_0x73ef('0x2d')](_0x517e70[_0x73ef('0x38')]({'attributes':['id',_0x73ef('0x4')]}));_0xa3f75b['push'](_0x517e70[_0x73ef('0x39')]({'attributes':['id',_0x73ef('0x4')]}));_0xa3f75b['push'](_0x517e70[_0x73ef('0x3a')]({'attributes':['id','name']}));_0xa3f75b[_0x73ef('0x2d')](_0x517e70['getSmsQueues']({'attributes':['id','name']}));_0xa3f75b[_0x73ef('0x2d')](_0x517e70[_0x73ef('0x3b')]({'attributes':['id','name']}));_0xa3f75b[_0x73ef('0x2d')](_0x517e70[_0x73ef('0x3c')]({'attributes':['id',_0x73ef('0x4')]}));_0xa3f75b['push'](_0x517e70[_0x73ef('0x3d')]({'attributes':['id',_0x73ef('0x4')]}));break;}return BPromise['all'](_0xa3f75b);}})[_0x73ef('0xb')](function(_0x55219d){if(_0x55219d&&_0x55219d[_0x73ef('0x1e')]){for(var _0x3c1334=0x0;_0x3c1334<_0x55219d[_0x73ef('0x1e')];_0x3c1334+=0x1){for(var _0x3006b7=0x0;_0x3006b7<_0x55219d[_0x3c1334][_0x73ef('0x1e')];_0x3006b7+=0x1){switch(_0x3c1334){case 0x0:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,_0x73ef('0x3e'),_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x1:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'chat',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x2:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'fax',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x3:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'sms',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x4:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,_0x73ef('0x3f'),_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x5:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'openchannel',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x6:joinOrLeaveQueues(_0xc3ba9d,_0x28406c,'whatsapp',_0x55219d[_0x3c1334][_0x3006b7]);break;case 0x7:if(_0x1519f9[_0x73ef('0x6')]!==_0x73ef('0x7'))_0xc3ba9d[_0x28406c](util[_0x73ef('0x1c')](_0x73ef('0x40'),_0x55219d[_0x3c1334][_0x3006b7]['name']));break;case 0x8:if(_0x1519f9[_0x73ef('0x6')]!==_0x73ef('0x7'))_0xc3ba9d[_0x28406c](util[_0x73ef('0x1c')]('trunk:%s',_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x4')]));break;case 0x9:if(_0x1519f9[_0x73ef('0x6')]!==_0x73ef('0x7'))_0xc3ba9d[_0x28406c](util['format'](_0x73ef('0x41'),_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x8')],_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x4')]));break;case 0xa:_0xc3ba9d[_0x28406c](util['format'](_0x73ef('0x1f'),_0x55219d[_0x3c1334][_0x3006b7][_0x73ef('0x4')]));break;}}}}})['then'](function(){if(_0x28406c===_0x73ef('0x42')){var _0x2ff899=_['map'](_0x1519f9[_0x73ef('0x43')],'id');return _0x1519f9[_0x73ef('0x44')](_0x2ff899)['then'](function(){for(var _0x31a65e=0x0;_0x31a65e<_0x2ff899['length'];_0x31a65e+=0x1){_0x40907a[_0x73ef('0x45')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x2ff899[_0x31a65e]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c==='leave'){var _0x261fcc=_[_0x73ef('0x46')](_0x1519f9[_0x73ef('0x47')],'id');return _0x1519f9['removeMailInteractions'](_0x261fcc)[_0x73ef('0xb')](function(){for(var _0x37365e=0x0;_0x37365e<_0x261fcc[_0x73ef('0x1e')];_0x37365e+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x48'),{'MailInteractionId':Number(_0x261fcc[_0x37365e]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c==='leave'){var _0x155abe=_['map'](_0x1519f9[_0x73ef('0x24')],'id');return _0x1519f9[_0x73ef('0x49')](_0x155abe)['then'](function(){for(var _0x533702=0x0;_0x533702<_0x155abe['length'];_0x533702+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x4a'),{'FaxInteractionId':Number(_0x155abe[_0x533702]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c===_0x73ef('0x42')){var _0x38aaa7=_[_0x73ef('0x46')](_0x1519f9[_0x73ef('0x26')],'id');return _0x1519f9[_0x73ef('0x4b')](_0x38aaa7)[_0x73ef('0xb')](function(){for(var _0x3d5968=0x0;_0x3d5968<_0x38aaa7[_0x73ef('0x1e')];_0x3d5968+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x4c'),{'SmsInteractionId':Number(_0x38aaa7[_0x3d5968]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0xb')](function(){if(_0x28406c===_0x73ef('0x42')){var _0x190044=_['map'](_0x1519f9['OpenchannelInteractions'],'id');return _0x1519f9[_0x73ef('0x4d')](_0x190044)[_0x73ef('0xb')](function(){for(var _0x41298e=0x0;_0x41298e<_0x190044['length'];_0x41298e+=0x1){_0x40907a[_0x73ef('0x45')](_0x73ef('0x4e'),{'OpenchannelInteractionId':Number(_0x190044[_0x41298e]),'UserId':Number(_0x1519f9['id'])});}});}})['then'](function(){if(_0x28406c===_0x73ef('0x42')){var _0x5dddd5=_[_0x73ef('0x46')](_0x1519f9[_0x73ef('0x4f')],'id');return _0x1519f9[_0x73ef('0x50')](_0x5dddd5)[_0x73ef('0xb')](function(){for(var _0x92497e=0x0;_0x92497e<_0x5dddd5[_0x73ef('0x1e')];_0x92497e+=0x1){_0x40907a[_0x73ef('0x45')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x5dddd5[_0x92497e]),'UserId':Number(_0x1519f9['id'])});}});}})[_0x73ef('0x51')](function(_0x3c61d3){_0xc3ba9d[_0x73ef('0x52')](_0x3c61d3);});}}function onDisconnect(_0x33dca3,_0x239a56){joinOrLeave(_0x33dca3,_0x73ef('0x42'),_0x239a56);}function onConnect(_0xf5f512){joinOrLeave(_0xf5f512,_0x73ef('0x53'));}exports[_0x73ef('0x54')]=function(_0x237073){_0x237073['on'](_0x73ef('0x55'),function(_0x316743){_0x316743['setMaxListeners'](0x0);_0x316743[_0x73ef('0x56')]=_0x316743[_0x73ef('0x57')][_0x73ef('0x55')][_0x73ef('0x58')]+':'+_0x316743['request']['connection'][_0x73ef('0x59')];_0x316743[_0x73ef('0x5a')]=new Date();_0x316743['log']=function(_0x20c182){console['log'](_0x73ef('0x5b')+_0x316743[_0x73ef('0x5c')][_0x73ef('0x4')]+'['+_0x316743[_0x73ef('0x56')]+']',_0x20c182);};_0x316743['on'](_0x73ef('0x5d'),function(){onDisconnect(_0x316743,_0x237073);_0x316743[_0x73ef('0x52')](_0x73ef('0x5e'));});onConnect(_0x316743);_0x316743['log'](_0x73ef('0x5f'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a892bef..abe9da3 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 _0x6d1a=['Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','query','Sequelize','QueryTypes','SELECT','contact','find','name','fullname','email','internal','interface','format','channel','agent','incomingmessage','outgoingmessage','opened','changed','closed','sequelize','UserId','User','SIP/%s','default','length','hasOwnProperty','model','hook','toLowerCase','condition','util','jayson/promise','../logger','triggers','lodash','client','http','afterCreate','newinteraction','Chat','ChatInteraction','closedinteraction','ChatMessage','newmessage','Sms','SmsMessage','Whatsapp','WhatsappInteraction','afterUpdate','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage'];(function(_0x326811,_0x419d5d){var _0x2554e3=function(_0x49e1cb){while(--_0x49e1cb){_0x326811['push'](_0x326811['shift']());}};_0x2554e3(++_0x419d5d);}(_0x6d1a,0x1de));var _0xa6d1=function(_0x4958c8,_0x4bab44){_0x4958c8=_0x4958c8-0x0;var _0x5e0155=_0x6d1a[_0x4958c8];return _0x5e0155;};'use strict';var util=require(_0xa6d1('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa6d1('0x1'));var logger=require(_0xa6d1('0x2'))(_0xa6d1('0x3'));var _=require(_0xa6d1('0x4'));var client=jayson[_0xa6d1('0x5')][_0xa6d1('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0xa6d1('0x7'),'condition':_0xa6d1('0x8'),'callback':afterCreate},{'channel':_0xa6d1('0x9'),'model':_0xa6d1('0xa'),'event':'afterUpdate','condition':_0xa6d1('0xb'),'callback':afterUpdate},{'channel':_0xa6d1('0x9'),'model':_0xa6d1('0xc'),'event':'afterCreate','condition':_0xa6d1('0xd'),'callback':afterCreateMessage},{'channel':_0xa6d1('0xe'),'model':'SmsInteraction','event':_0xa6d1('0x7'),'condition':_0xa6d1('0x8'),'callback':afterCreate},{'channel':_0xa6d1('0xe'),'model':'SmsInteraction','event':'afterUpdate','condition':_0xa6d1('0xb'),'callback':afterUpdate},{'channel':_0xa6d1('0xe'),'model':_0xa6d1('0xf'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa6d1('0x10'),'model':_0xa6d1('0x11'),'event':_0xa6d1('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa6d1('0x10'),'model':_0xa6d1('0x11'),'event':_0xa6d1('0x12'),'condition':_0xa6d1('0xb'),'callback':afterUpdate},{'channel':_0xa6d1('0x10'),'model':_0xa6d1('0x13'),'event':_0xa6d1('0x7'),'condition':_0xa6d1('0xd'),'callback':afterCreateMessage},{'channel':_0xa6d1('0x14'),'model':_0xa6d1('0x15'),'event':_0xa6d1('0x7'),'condition':_0xa6d1('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0xa6d1('0x15'),'event':_0xa6d1('0x12'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xa6d1('0x14'),'model':_0xa6d1('0x16'),'event':_0xa6d1('0x7'),'condition':_0xa6d1('0xd'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xa6d1('0x17'),'event':_0xa6d1('0x7'),'condition':_0xa6d1('0x8'),'callback':afterCreate},{'channel':'Mail','model':_0xa6d1('0x17'),'event':_0xa6d1('0x12'),'condition':_0xa6d1('0xb'),'callback':afterUpdate},{'channel':_0xa6d1('0x18'),'model':_0xa6d1('0x19'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xa6d1('0x1a'),'model':_0xa6d1('0x1b'),'event':_0xa6d1('0x7'),'condition':_0xa6d1('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':_0xa6d1('0x1b'),'event':'afterUpdate','condition':_0xa6d1('0xb'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xa6d1('0x1c'),'event':_0xa6d1('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x58cdff){return client[_0xa6d1('0x1d')](_0xa6d1('0x1e'),_0x58cdff)[_0xa6d1('0x1f')](function(_0x321710){logger['info'](_0xa6d1('0x20'),_0xa6d1('0x1e'),_0x321710);if(_0x321710[_0xa6d1('0x21')]){if(_0x321710[_0xa6d1('0x21')][_0xa6d1('0x22')]===0x1f4){logger[_0xa6d1('0x21')](_0xa6d1('0x20'),_0xa6d1('0x1e'),_0x321710['error']);}}})[_0xa6d1('0x23')](function(_0x1ffcb4){logger[_0xa6d1('0x21')](_0xa6d1('0x20'),_0xa6d1('0x1e'),_0x1ffcb4);});}function afterCreateMessage(_0x10ab42,_0x280907){return function(_0xc96de5,_0x39ef25){_0xc96de5=_0xc96de5[_0xa6d1('0x24')]({'plain':!![]});_0xc96de5['channel']=_0x10ab42;_0xc96de5[_0xa6d1('0x25')]=_0x10ab42;_0xc96de5[_0xa6d1('0x26')]=_0xc96de5[_0xa6d1('0x27')];var _0x5df54f=_0xa6d1('0x28')+_0xc96de5[_0xa6d1('0x29')];return db['sequelize'][_0xa6d1('0x2a')](_0x5df54f,{'type':db[_0xa6d1('0x2b')][_0xa6d1('0x2c')][_0xa6d1('0x2d')],'raw':!![]})[_0xa6d1('0x1f')](function(_0x52e064){return _0x52e064;})['then'](function(_0x5610b7){if(_0x5610b7){_0xc96de5[_0xa6d1('0x2e')]=_0x5610b7[0x0];}if(_0xc96de5['UserId']){return db['User'][_0xa6d1('0x2f')]({'where':{'id':_0xc96de5['UserId']},'attributes':['id',_0xa6d1('0x30'),_0xa6d1('0x31'),_0xa6d1('0x32'),_0xa6d1('0x33')],'raw':!![]})[_0xa6d1('0x1f')](function(_0x1a0ea6){_0xc96de5[_0xa6d1('0x34')]=util[_0xa6d1('0x35')]('SIP/%s',_0x1a0ea6[_0xa6d1('0x30')]);_0xc96de5[_0xa6d1('0x36')]=_0x10ab42;_0xc96de5[_0xa6d1('0x37')]=_0x1a0ea6;return request({'event':_0xa6d1('0x38'),'message':_0xc96de5});})[_0xa6d1('0x23')](function(_0x4d54f3){console[_0xa6d1('0x21')](_0x4d54f3);});}else{return request({'event':_0xa6d1('0x39'),'message':_0xc96de5});}});};}function afterCreate(_0x240a23,_0x13bd44){return function(_0x31b777,_0x4e49dd){_0x31b777=_0x31b777[_0xa6d1('0x24')]({'plain':!![]});_0x31b777['channel']=_0x240a23;_0x31b777[_0xa6d1('0x25')]=_0x240a23;_0x31b777[_0xa6d1('0x26')]=_0xa6d1('0x3a');var _0x494353=_0xa6d1('0x28')+_0x31b777['ContactId'];return db['sequelize'][_0xa6d1('0x2a')](_0x494353,{'type':db[_0xa6d1('0x2b')][_0xa6d1('0x2c')][_0xa6d1('0x2d')],'raw':!![]})[_0xa6d1('0x1f')](function(_0x35c650){return _0x35c650;})[_0xa6d1('0x1f')](function(_0x2dc36c){if(_0x2dc36c){_0x31b777[_0xa6d1('0x2e')]=_0x2dc36c[0x0];}return request({'event':_0x13bd44,'message':_0x31b777});});};}function afterUpdate(_0xec95e4){return function(_0x2b5ee3){var _0x50fce4=_0x2b5ee3[_0xa6d1('0x3b')](_0xa6d1('0x3c'))&&_0x2b5ee3[_0xa6d1('0x3c')];var _0x568dc3=_0x2b5ee3[_0xa6d1('0x3b')]('substatus');if(_0x50fce4||_0x568dc3){var _0x58b94=_0x50fce4?_0xa6d1('0xb'):'substatus';var _0x548eee=_0x2b5ee3[_0xa6d1('0x24')]({'plain':!![]});_0x548eee[_0xa6d1('0x36')]=_0xec95e4;_0x548eee['motionChannel']=_0xec95e4;_0x548eee['event']=_0x50fce4?_0xa6d1('0x3c'):'substatus';var _0x4a2130=_0xa6d1('0x28')+_0x548eee[_0xa6d1('0x29')];return db[_0xa6d1('0x3d')][_0xa6d1('0x2a')](_0x4a2130,{'type':db[_0xa6d1('0x2b')][_0xa6d1('0x2c')][_0xa6d1('0x2d')],'raw':!![]})['then'](function(_0x7c03b5){if(_0x7c03b5){_0x548eee[_0xa6d1('0x2e')]=_0x7c03b5[0x0];}if(_0x548eee[_0xa6d1('0x3e')]){return db[_0xa6d1('0x3f')][_0xa6d1('0x2f')]({'where':{'id':_0x548eee[_0xa6d1('0x3e')]},'attributes':['id',_0xa6d1('0x30'),_0xa6d1('0x31'),_0xa6d1('0x32'),_0xa6d1('0x33')],'raw':!![]})['then'](function(_0xb03eae){_0x548eee[_0xa6d1('0x34')]=util[_0xa6d1('0x35')](_0xa6d1('0x40'),_0xb03eae[_0xa6d1('0x30')]);_0x548eee['agent']=_0xb03eae;return request({'event':_0x58b94,'message':_0x548eee});})[_0xa6d1('0x23')](function(_0x5c4f9e){console['error'](_0x5c4f9e);});}else{return request({'event':_0x58b94,'message':_0x548eee});}});}};}exports[_0xa6d1('0x41')]=function(){for(var _0x92b287=0x0;_0x92b287=_0x3ee231[_0x9fe2('0x11')]){throw Error(_0x9fe2('0x12'));}_0x5552b2(_0x1e7e8a);})[_0x9fe2('0x13')](function(_0x4fb94a){_0x430796(_0x4fb94a);});});}; \ No newline at end of file +var _0xaa85=['clearBlockUser','isUndefined','updateAttributes','getLicense','role','agent','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','mail','chat','fax','sms','openchannel','isValidChannel','toLowerCase','includes'];(function(_0x16573b,_0x219475){var _0x2a6964=function(_0x3c2cbc){while(--_0x3c2cbc){_0x16573b['push'](_0x16573b['shift']());}};_0x2a6964(++_0x219475);}(_0xaa85,0x1ee));var _0x5aa8=function(_0x1c628f,_0x2f40c0){_0x1c628f=_0x1c628f-0x0;var _0x897f1a=_0xaa85[_0x1c628f];return _0x897f1a;};'use strict';var _=require(_0x5aa8('0x0'));var BPromise=require('bluebird');var db=require(_0x5aa8('0x1'))['db'];var util=require(_0x5aa8('0x2'));var channels=[_0x5aa8('0x3'),_0x5aa8('0x4'),_0x5aa8('0x5'),_0x5aa8('0x6'),_0x5aa8('0x7'),'whatsapp',_0x5aa8('0x8')];exports['getChannels']=function(){return channels;};exports[_0x5aa8('0x9')]=function(_0x500b56){_0x500b56=_0x500b56[_0x5aa8('0xa')]();return _[_0x5aa8('0xb')](channels,_0x500b56);};exports[_0x5aa8('0xc')]=function(_0x321a1b,_0x45222f,_0x34d213,_0x25aba8){var _0x5b43f3={'loginAttempts':_0x45222f,'blocked':_0x34d213};if(!_[_0x5aa8('0xd')](_0x25aba8)){_0x5b43f3['blockedAt']=_0x25aba8;}return _0x321a1b[_0x5aa8('0xe')](_0x5b43f3);};exports[_0x5aa8('0xf')]=function(_0x1715d2){return new BPromise(function(_0x31020,_0x45cebd){var _0x38f12d=0x0;if(_0x1715d2[_0x5aa8('0x10')]!==_0x5aa8('0x11')){_0x31020(_0x1715d2);}db['User'][_0x5aa8('0x12')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1715d2['id']}}})[_0x5aa8('0x13')](function(_0x13079d){_0x38f12d=_0x13079d;return util[_0x5aa8('0xf')]();})[_0x5aa8('0x13')](function(_0x2147ca){if(_0x2147ca&&_0x2147ca['agents']&&_0x38f12d>=_0x2147ca[_0x5aa8('0x14')]){throw Error(_0x5aa8('0x15'));}_0x31020(_0x1715d2);})[_0x5aa8('0x16')](function(_0x223cec){_0x45cebd(_0x223cec);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index e79f0d8..39b293b 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x66d3=['send','exports','404','status','render','json'];(function(_0x4c8b6d,_0x17d3f3){var _0x527bf8=function(_0x4fa366){while(--_0x4fa366){_0x4c8b6d['push'](_0x4c8b6d['shift']());}};_0x527bf8(++_0x17d3f3);}(_0x66d3,0x10f));var _0x366d=function(_0x368c2f,_0x2dfddc){_0x368c2f=_0x368c2f-0x0;var _0x162368=_0x66d3[_0x368c2f];return _0x162368;};'use strict';module[_0x366d('0x0')][0x194]=function pageNotFound(_0x594f4c,_0x3eab36){var _0x57bd86=_0x366d('0x1');var _0xc6ce62=0x194;var _0x4cf051={'status':_0xc6ce62};_0x3eab36[_0x366d('0x2')](_0x4cf051['status']);_0x3eab36[_0x366d('0x3')](_0x57bd86,{},function(_0x5d2396,_0x33a0c2){if(_0x5d2396){return _0x3eab36[_0x366d('0x2')](_0x4cf051[_0x366d('0x2')])[_0x366d('0x4')](_0x4cf051);}_0x3eab36[_0x366d('0x5')](_0x33a0c2);});}; \ No newline at end of file +var _0xdd2e=['404','status','render','json','send','exports'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0xdd2e,0x13d));var _0xedd2=function(_0x228019,_0x279e36){_0x228019=_0x228019-0x0;var _0x25c52b=_0xdd2e[_0x228019];return _0x25c52b;};'use strict';module[_0xedd2('0x0')][0x194]=function pageNotFound(_0x5908d6,_0x556c16){var _0x34111e=_0xedd2('0x1');var _0x4dc316=0x194;var _0xd66e72={'status':_0x4dc316};_0x556c16[_0xedd2('0x2')](_0xd66e72[_0xedd2('0x2')]);_0x556c16[_0xedd2('0x3')](_0x34111e,{},function(_0x599169,_0x4b924c){if(_0x599169){return _0x556c16[_0xedd2('0x2')](_0xd66e72[_0xedd2('0x2')])[_0xedd2('0x4')](_0xd66e72);}_0x556c16[_0xedd2('0x5')](_0x4b924c);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 21f18a3..14e7752 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6f7a=['../api/mailApplication/mailApplication.model','MailQueueReport','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','hasOne','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteraction','MailInteractions','WhatsappInteractions','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','cm_user_has_contacts','Lists','user_has_teams','user_has_mail_interactions','user_has_openchannel_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','UserMailQueue','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccounts','user_has_square_projects','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperBlacks','TrunkId','TrunkBackup','IntervalId','mandatoryDispositionPauseId','Agents','Teams','BlackLists','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','VoiceAgentReport','Contact','ContactId','MailAccountId','MailServerOut','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','Applications','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Interaction','ChatWebsiteId','restrict','List','Items','FaxAccountId','Exntensions','mandatoryDispositionPause','user_has_fax_accounts','TagId','fax_interaction_has_tags','user_has_fax_interactions','FaxInteractionId','Account','team_has_fax_queues','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','AttachmentId','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatMessage','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroup','chat_group_has_users','Contacts','CompanyId','HopperHistories','Company','cm_contact_has_tags','OwnerId','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','FaxApplications','Schedule','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','Variable','VariableId','SugarcrmAccount','SugarcrmConfiguration','Configurations','DeskConfiguration','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerConfiguration','VtigerField','Dynamics365Account','FromId','ToId','ProjectId','ChatQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToQueue','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','voice_queues_has_cm_lists','TeamVoicePrefix','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappQueue','WhatsappInteractionId','WhatsappTransferReport','ToWhatsappAccountId','WhatsappQueueId','exports','../config/environment','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','utf8_general_ci','database','username','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication'];(function(_0x2ec0f6,_0x42e247){var _0x11e9c9=function(_0x49fb6b){while(--_0x49fb6b){_0x2ec0f6['push'](_0x2ec0f6['shift']());}};_0x11e9c9(++_0x42e247);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x4850ab,_0x219a9a){_0x4850ab=_0x4850ab-0x0;var _0x59a928=_0x6f7a[_0x4850ab];return _0x59a928;};'use strict';var config=require(_0xa6f7('0x0'));var Sequelize=require(_0xa6f7('0x1'));var _=require(_0xa6f7('0x2'));var jstz=require(_0xa6f7('0x3'));var timezone=jstz['determine']();config[_0xa6f7('0x1')]=_[_0xa6f7('0x4')](config[_0xa6f7('0x1')],{'database':_0xa6f7('0x5'),'username':_0xa6f7('0x6'),'password':_0xa6f7('0x7'),'options':{'host':_0xa6f7('0x8'),'port':0xcea,'dialect':_0xa6f7('0x9'),'dialectOptions':{'charset':_0xa6f7('0xa')},'logging':![],'timezone':timezone[_0xa6f7('0xb')](),'define':{'charset':_0xa6f7('0xc'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0xa6f7('0x4')](config[_0xa6f7('0xd')],{'database':_0xa6f7('0x5'),'username':_0xa6f7('0x6'),'password':_0xa6f7('0x7'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xa6f7('0xa')},'logging':![],'timezone':timezone[_0xa6f7('0xb')](),'define':{'charset':'utf8','collate':_0xa6f7('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xa6f7('0xf')],config[_0xa6f7('0x1')][_0xa6f7('0x10')],config[_0xa6f7('0x1')]['password'],config[_0xa6f7('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xa6f7('0xd')][_0xa6f7('0xf')],config[_0xa6f7('0xd')]['username'],config[_0xa6f7('0xd')]['password'],config[_0xa6f7('0xd')]['options'])};db[_0xa6f7('0x11')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/user/user.model');db[_0xa6f7('0x13')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x14'));db['VoiceContext']=db['sequelize'][_0xa6f7('0x12')]('../api/voiceContext/voiceContext.model');db[_0xa6f7('0x15')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x16'));db[_0xa6f7('0x17')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x18'));db[_0xa6f7('0x19')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x1a'));db['VoiceRecording']=db['sequelize']['import'](_0xa6f7('0x1b'));db[_0xa6f7('0x1c')]=db['sequelize']['import']('../api/screenRecording/screenRecording.model');db[_0xa6f7('0x1d')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xa6f7('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xa6f7('0x1e')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x1f'));db[_0xa6f7('0x20')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0xa6f7('0x21')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x22'));db[_0xa6f7('0x23')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x24'));db[_0xa6f7('0x25')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x26'));db['VoiceTransferReport']=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xa6f7('0x27')]=db[_0xa6f7('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xa6f7('0x28')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x29'));db[_0xa6f7('0x2a')]=db['sequelize']['import'](_0xa6f7('0x2b'));db['UserMailQueue']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x2c'));db[_0xa6f7('0x2d')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/userFaxQueue/userFaxQueue.model');db[_0xa6f7('0x2e')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/userSmsQueue/userSmsQueue.model');db[_0xa6f7('0x2f')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x30'));db[_0xa6f7('0x31')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x32'));db[_0xa6f7('0x33')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x34'));db['MailServerOut']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x35'));db[_0xa6f7('0x36')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x37'));db[_0xa6f7('0x38')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x39'));db[_0xa6f7('0x3a')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x3b'));db['MailInteraction']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x3c'));db[_0xa6f7('0x3d')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x3e'));db[_0xa6f7('0x3f')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x40'));db[_0xa6f7('0x41')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x42'));db[_0xa6f7('0x43')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x44'));db[_0xa6f7('0x45')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/faxAccount/faxAccount.model');db[_0xa6f7('0x46')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x47'));db[_0xa6f7('0x48')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/faxInteraction/faxInteraction.model');db[_0xa6f7('0x49')]=db['sequelize']['import'](_0xa6f7('0x4a'));db[_0xa6f7('0x4b')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x4c'));db[_0xa6f7('0x4d')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x4e'));db[_0xa6f7('0x4f')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x50'));db[_0xa6f7('0x51')]=db['sequelize'][_0xa6f7('0x12')]('../api/smsApplication/smsApplication.model');db[_0xa6f7('0x52')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/smsInteraction/smsInteraction.model');db['SmsMessage']=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x53'));db['SmsQueue']=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x54'));db[_0xa6f7('0x55')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x56'));db['OpenchannelApplication']=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/openchannelApplication/openchannelApplication.model');db[_0xa6f7('0x57')]=db['sequelize'][_0xa6f7('0x12')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x58'));db[_0xa6f7('0x59')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x5a'));db[_0xa6f7('0x5b')]=db['sequelize'][_0xa6f7('0x12')]('../api/chatWebsite/chatWebsite.model');db[_0xa6f7('0x5c')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xa6f7('0x5d')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x5e'));db[_0xa6f7('0x5f')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x60'));db[_0xa6f7('0x61')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x62'));db[_0xa6f7('0x63')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x64'));db['ChatGroup']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x65'));db['ChatProactiveAction']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x66'));db[_0xa6f7('0x67')]=db['sequelize']['import'](_0xa6f7('0x68'));db[_0xa6f7('0x69')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x6a'));db[_0xa6f7('0x6b')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x6c'));db[_0xa6f7('0x6d')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x6e'));db[_0xa6f7('0x6f')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x70'));db[_0xa6f7('0x71')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x72'));db['ReportAgentPreview']=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x73'));db[_0xa6f7('0x74')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x75'));db[_0xa6f7('0x76')]=db['sequelize'][_0xa6f7('0x12')]('../api/action/action.model');db[_0xa6f7('0x77')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x78'));db['CannedAnswer']=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x79'));db[_0xa6f7('0x7a')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x7b'));db[_0xa6f7('0x7c')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x7d'));db[_0xa6f7('0x7e')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/interval/interval.model');db[_0xa6f7('0x7f')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x80'));db[_0xa6f7('0x81')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x82'));db['VoiceQueuesLog']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x83'));db['Schedule']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x84'));db[_0xa6f7('0x85')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x86'));db[_0xa6f7('0x87')]=db['sequelize']['import'](_0xa6f7('0x88'));db[_0xa6f7('0x89')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0x8a'));db[_0xa6f7('0x8b')]=db['sequelize'][_0xa6f7('0x12')]('../api/trigger/trigger.model');db['Variable']=db['sequelize']['import']('../api/variable/variable.model');db[_0xa6f7('0x8c')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/integration/integration.model');db[_0xa6f7('0x8d')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x8e'));db[_0xa6f7('0x8f')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x90'));db[_0xa6f7('0x91')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x92'));db[_0xa6f7('0x93')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x94'));db[_0xa6f7('0x95')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x96'));db[_0xa6f7('0x97')]=db[_0xa6f7('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xa6f7('0x98')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xa6f7('0x99')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x9a'));db[_0xa6f7('0x9b')]=db['sequelize']['import'](_0xa6f7('0x9c'));db['SalesforceField']=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/intSalesforceField/intSalesforceField.model');db['SugarcrmAccount']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x9d'));db['SugarcrmConfiguration']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x9e'));db[_0xa6f7('0x9f')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xa0'));db[_0xa6f7('0xa1')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xa2'));db['DeskConfiguration']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xa3'));db[_0xa6f7('0xa4')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/intDeskField/intDeskField.model');db[_0xa6f7('0xa5')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xa6'));db[_0xa6f7('0xa7')]=db[_0xa6f7('0x1')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xa6f7('0xa8')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xa9'));db[_0xa6f7('0xaa')]=db['sequelize'][_0xa6f7('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xa6f7('0xab')]=db[_0xa6f7('0x1')]['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xa6f7('0xac')]=db['sequelize']['import'](_0xa6f7('0xad'));db[_0xa6f7('0xae')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xa6f7('0xaf')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xb0'));db[_0xa6f7('0xb1')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xb2'));db['VtigerAccount']=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xb3'));db['VtigerConfiguration']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xb4'));db['VtigerField']=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xb5'));db[_0xa6f7('0xb6')]=db['sequelize'][_0xa6f7('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xa6f7('0xb7')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xb8'));db[_0xa6f7('0xb9')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xba'));db['Dynamics365Account']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xbb'));db[_0xa6f7('0xbc')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xbd'));db[_0xa6f7('0xbe')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xbf'));db[_0xa6f7('0xc0')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xc1'));db[_0xa6f7('0xc2')]=db['sequelize'][_0xa6f7('0x12')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xa6f7('0xc3')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xc4'));db[_0xa6f7('0x8c')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xc5'));db['Network']=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xc6'));db[_0xa6f7('0xc7')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xc8'));db[_0xa6f7('0xc9')]=db['sequelize']['import'](_0xa6f7('0xca'));db[_0xa6f7('0xcb')]=db['sequelize']['import'](_0xa6f7('0xcc'));db[_0xa6f7('0xcd')]=db['sequelize'][_0xa6f7('0x12')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xa6f7('0xce')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xcf'));db[_0xa6f7('0xd0')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xd1'));db[_0xa6f7('0xd2')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xd3'));db[_0xa6f7('0xd4')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xd5'));db[_0xa6f7('0xd6')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xd7'));db[_0xa6f7('0xd8')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xd9'));db[_0xa6f7('0xda')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xdb'));db[_0xa6f7('0xdc')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xdd'));db[_0xa6f7('0xde')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xdf'));db[_0xa6f7('0xe0')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xe1'));db[_0xa6f7('0xe2')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xe3'));db[_0xa6f7('0xe4')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/license/license.model');db[_0xa6f7('0xe5')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xe6'));db['Migration']=db[_0xa6f7('0x1')]['import']('../api/migration/migration.model');db[_0xa6f7('0xe7')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xe8'));db[_0xa6f7('0xe9')]=db[_0xa6f7('0x1')]['import']('../api/plugin/plugin.model');db[_0xa6f7('0xea')]=db['sequelize'][_0xa6f7('0x12')](_0xa6f7('0xeb'));db[_0xa6f7('0xec')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xed'));db[_0xa6f7('0xee')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xef'));db['OpenchannelTransferReport']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xf0'));db[_0xa6f7('0xf1')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xf2'));db[_0xa6f7('0xf3')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/cmList/cmList.model');db[_0xa6f7('0xf4')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xf5'));db['UserProfile']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xf6'));db[_0xa6f7('0xf7')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xf8'));db[_0xa6f7('0xf9')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xfa'));db[_0xa6f7('0xfb')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0xfc'));db[_0xa6f7('0xfd')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0xa6f7('0xfe')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0xff'));db['WhatsappInteraction']=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xa6f7('0x100')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x101'));db[_0xa6f7('0x102')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x103'));db['WhatsappTransferReport']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x104'));db['WhatsappQueue']=db[_0xa6f7('0x1')][_0xa6f7('0x12')](_0xa6f7('0x105'));db[_0xa6f7('0x106')]=db['sequelize']['import'](_0xa6f7('0x107'));db[_0xa6f7('0x108')]=db[_0xa6f7('0x1')]['import'](_0xa6f7('0x109'));db['TeamVoicePrefix']=db['sequelize']['import'](_0xa6f7('0x10a'));db[_0xa6f7('0x10b')]=db[_0xa6f7('0x1')][_0xa6f7('0x12')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xa6f7('0x11')][_0xa6f7('0x10c')](db['VoiceMail'],{'as':_0xa6f7('0x1d'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x11')][_0xa6f7('0x10f')](db[_0xa6f7('0x110')],{'as':_0xa6f7('0x111'),'foreignKey':_0xa6f7('0x10e')});db['User']['hasMany'](db[_0xa6f7('0x27')],{'as':_0xa6f7('0x112'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x11')][_0xa6f7('0x10f')](db[_0xa6f7('0x15')],{'as':_0xa6f7('0x113'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db[_0xa6f7('0x11')][_0xa6f7('0x10f')](db[_0xa6f7('0x6f')],{'as':_0xa6f7('0x114'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x11')]['hasMany'](db[_0xa6f7('0x71')],{'as':'HopperHistory','foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x11')][_0xa6f7('0x10f')](db[_0xa6f7('0x115')],{'as':_0xa6f7('0x115'),'foreignKey':_0xa6f7('0x10e')});db['User'][_0xa6f7('0x10f')](db[_0xa6f7('0x57')],{'as':_0xa6f7('0x116'),'foreignKey':'UserId'});db[_0xa6f7('0x11')]['hasMany'](db[_0xa6f7('0x5f')],{'as':_0xa6f7('0x117'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xa6f7('0x52')],{'as':_0xa6f7('0x118'),'foreignKey':'UserId'});db['User'][_0xa6f7('0x10f')](db[_0xa6f7('0x48')],{'as':'FaxInteractions','foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x11')]['hasMany'](db[_0xa6f7('0x119')],{'as':_0xa6f7('0x11a'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x11')][_0xa6f7('0x10f')](db['WhatsappInteraction'],{'as':_0xa6f7('0x11b'),'foreignKey':'UserId'});db[_0xa6f7('0x11')][_0xa6f7('0x10f')](db[_0xa6f7('0xfb')],{'as':'UserNotifications','foreignKey':_0xa6f7('0x11c')});db[_0xa6f7('0x11')][_0xa6f7('0x11d')](db['UserProfile'],{'as':_0xa6f7('0x11e'),'foreignKey':_0xa6f7('0x11f')});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0x69')],{'as':'Contacts','through':_0xa6f7('0x121')});db[_0xa6f7('0x11')]['belongsToMany'](db['CmList'],{'as':_0xa6f7('0x122'),'through':'cm_user_has_lists'});db['User'][_0xa6f7('0x120')](db[_0xa6f7('0xe2')],{'through':_0xa6f7('0x123')});db[_0xa6f7('0x11')]['belongsToMany'](db[_0xa6f7('0x119')],{'as':_0xa6f7('0x11a'),'through':_0xa6f7('0x124')});db[_0xa6f7('0x11')]['belongsToMany'](db['ChatInteraction'],{'as':_0xa6f7('0x117'),'through':'user_has_chat_interactions'});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0x48')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db['User'][_0xa6f7('0x120')](db[_0xa6f7('0x52')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':_0xa6f7('0x116'),'through':_0xa6f7('0x125')});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0x126')],{'as':_0xa6f7('0x11b'),'through':_0xa6f7('0x127')});db[_0xa6f7('0x11')]['belongsToMany'](db['VoiceQueue'],{'as':_0xa6f7('0x128'),'through':_0xa6f7('0x28'),'required':![]});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0xf4')],{'as':_0xa6f7('0x129'),'through':_0xa6f7('0x10b'),'required':![]});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0x38')],{'as':_0xa6f7('0x12a'),'through':_0xa6f7('0x12b'),'required':![]});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db['ChatQueue'],{'as':'ChatQueues','through':_0xa6f7('0x2a'),'required':![],'hooks':!![]});db['User'][_0xa6f7('0x120')](db[_0xa6f7('0x4b')],{'as':_0xa6f7('0x12c'),'through':_0xa6f7('0x2d'),'required':![]});db[_0xa6f7('0x11')]['belongsToMany'](db[_0xa6f7('0x12d')],{'as':_0xa6f7('0x12e'),'through':'UserSmsQueue','required':![]});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db['OpenchannelQueue'],{'as':_0xa6f7('0x12f'),'through':_0xa6f7('0x2f'),'required':![]});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db['WhatsappQueue'],{'as':_0xa6f7('0x130'),'through':_0xa6f7('0x31'),'required':![]});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db['CmList'],{'through':_0xa6f7('0x131')});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0x5b')],{'as':_0xa6f7('0x132'),'through':_0xa6f7('0x133')});db['User']['belongsToMany'](db[_0xa6f7('0x45')],{'as':'FaxAccounts','through':'user_has_fax_accounts'});db[_0xa6f7('0x11')]['belongsToMany'](db['MailAccount'],{'as':_0xa6f7('0x134'),'through':_0xa6f7('0x135')});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0x55')],{'as':_0xa6f7('0x136'),'through':_0xa6f7('0x137')});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0x4f')],{'as':_0xa6f7('0x138'),'through':'user_has_sms_accounts'});db[_0xa6f7('0x11')][_0xa6f7('0x120')](db[_0xa6f7('0xfd')],{'as':_0xa6f7('0x139'),'through':'user_has_whatsapp_accounts'});db[_0xa6f7('0x11')]['belongsToMany'](db['SquareProject'],{'as':'SquareProjects','through':_0xa6f7('0x13a')});db['VoiceChanSpy'][_0xa6f7('0x10f')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0xa6f7('0x13b')});db[_0xa6f7('0x13c')][_0xa6f7('0x10f')](db['VoiceExtension'],{'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x15')][_0xa6f7('0x10f')](db[_0xa6f7('0x15')],{'as':'Applications','onDelete':'cascade'});db[_0xa6f7('0x17')][_0xa6f7('0x120')](db['Sound'],{'as':_0xa6f7('0x13d'),'through':_0xa6f7('0x13e')});db['VoiceQueue'][_0xa6f7('0x10f')](db['UserVoiceQueueRt'],{'as':_0xa6f7('0x13f'),'foreignKey':_0xa6f7('0x140')});db[_0xa6f7('0x19')]['hasMany'](db[_0xa6f7('0x6b')],{'as':_0xa6f7('0x141'),'foreignKey':_0xa6f7('0x140')});db[_0xa6f7('0x19')][_0xa6f7('0x10f')](db[_0xa6f7('0x6f')],{'as':_0xa6f7('0x114'),'foreignKey':_0xa6f7('0x140')});db[_0xa6f7('0x19')][_0xa6f7('0x10f')](db[_0xa6f7('0x71')],{'as':'HopperHistories','foreignKey':_0xa6f7('0x140')});db[_0xa6f7('0x19')][_0xa6f7('0x10f')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xa6f7('0x140')});db[_0xa6f7('0x19')][_0xa6f7('0x10f')](db[_0xa6f7('0x6d')],{'as':_0xa6f7('0x142'),'foreignKey':_0xa6f7('0x140')});db[_0xa6f7('0x19')][_0xa6f7('0x10f')](db[_0xa6f7('0xce')],{'as':'JscriptySessions','foreignKey':_0xa6f7('0x140')});db[_0xa6f7('0x19')][_0xa6f7('0x11d')](db[_0xa6f7('0x25')],{'as':'Trunk','foreignKey':_0xa6f7('0x143')});db[_0xa6f7('0x19')][_0xa6f7('0x11d')](db['Trunk'],{'as':_0xa6f7('0x144'),'foreignKey':'TrunkBackupId'});db[_0xa6f7('0x19')][_0xa6f7('0x11d')](db['Interval'],{'as':'Interval','foreignKey':_0xa6f7('0x145')});db[_0xa6f7('0x19')][_0xa6f7('0x11d')](db[_0xa6f7('0x7f')],{'as':'mandatoryDispositionPause','foreignKey':_0xa6f7('0x146')});db[_0xa6f7('0x19')][_0xa6f7('0x120')](db[_0xa6f7('0xf3')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xa6f7('0x19')][_0xa6f7('0x120')](db['User'],{'as':_0xa6f7('0x147'),'through':_0xa6f7('0x28')});db[_0xa6f7('0x19')][_0xa6f7('0x120')](db[_0xa6f7('0xe2')],{'as':_0xa6f7('0x148'),'through':_0xa6f7('0x108')});db[_0xa6f7('0x19')][_0xa6f7('0x120')](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x149'),'through':'voice_queues_has_cm_blacklists'});db[_0xa6f7('0x110')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x11'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x1c')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x11'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x1d')]['hasMany'](db[_0xa6f7('0x14a')],{'as':_0xa6f7('0x14b'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x14c'),'sourceKey':_0xa6f7('0x14d')});db['VoiceMailMessage']['belongsTo'](db[_0xa6f7('0x1d')],{'foreignKey':_0xa6f7('0x14c'),'targetKey':_0xa6f7('0x14d')});db['VoiceCallReport'][_0xa6f7('0x10f')](db[_0xa6f7('0x21')],{'as':'QueueCalls','foreignKey':_0xa6f7('0x14e'),'constraints':![]});db[_0xa6f7('0x1e')][_0xa6f7('0x10f')](db[_0xa6f7('0x14f')],{'as':'AgentReports','foreignKey':_0xa6f7('0x14e'),'constraints':![]});db[_0xa6f7('0x1e')]['belongsTo'](db['User'],{'as':_0xa6f7('0x11'),'foreignKey':_0xa6f7('0x10e')});db['VoiceCallReport']['belongsTo'](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x33')][_0xa6f7('0x11d')](db[_0xa6f7('0x36')],{'as':_0xa6f7('0x36'),'foreignKey':_0xa6f7('0x152')});db[_0xa6f7('0x153')][_0xa6f7('0x11d')](db[_0xa6f7('0x36')],{'as':_0xa6f7('0x36'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xa6f7('0x10c')](db['MailServerIn'],{'as':_0xa6f7('0x154'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x36')][_0xa6f7('0x10c')](db[_0xa6f7('0x153')],{'as':_0xa6f7('0x155'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x36')][_0xa6f7('0x10f')](db['Disposition'],{'as':_0xa6f7('0x156'),'foreignKey':_0xa6f7('0x152'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x36')][_0xa6f7('0x10f')](db[_0xa6f7('0x157')],{'as':_0xa6f7('0x158'),'foreignKey':_0xa6f7('0x152')});db['MailAccount'][_0xa6f7('0x10f')](db[_0xa6f7('0x3d')],{'as':_0xa6f7('0x14b'),'foreignKey':_0xa6f7('0x152')});db[_0xa6f7('0x36')]['hasMany'](db[_0xa6f7('0x119')],{'as':_0xa6f7('0x159')});db[_0xa6f7('0x36')][_0xa6f7('0x10f')](db[_0xa6f7('0x3f')],{'as':_0xa6f7('0x15a')});db[_0xa6f7('0x36')][_0xa6f7('0x11d')](db['CmList'],{'as':'List','foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0x36')][_0xa6f7('0x11d')](db[_0xa6f7('0x89')],{'as':_0xa6f7('0x89'),'foreignKey':_0xa6f7('0x15c')});db[_0xa6f7('0x36')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xa6f7('0x36')]['belongsToMany'](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x135')});db[_0xa6f7('0x38')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x147'),'through':_0xa6f7('0x12b')});db[_0xa6f7('0x38')]['belongsToMany'](db[_0xa6f7('0xe2')],{'through':_0xa6f7('0x15d'),'as':_0xa6f7('0x148')});db[_0xa6f7('0x119')][_0xa6f7('0x10f')](db[_0xa6f7('0x3d')],{'as':_0xa6f7('0x14b'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x15e')});db[_0xa6f7('0x119')][_0xa6f7('0x11d')](db[_0xa6f7('0x36')],{'as':'Account','foreignKey':_0xa6f7('0x152')});db[_0xa6f7('0x119')][_0xa6f7('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailInteraction'][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x15f'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x119')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':'mail_interaction_has_tags','as':_0xa6f7('0x160')});db[_0xa6f7('0x119')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x161'),'as':_0xa6f7('0x162')});db['MailInteraction']['belongsToMany'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x163'),'through':'user_has_mail_interactions','foreignKey':_0xa6f7('0x15e')});db[_0xa6f7('0x3d')][_0xa6f7('0x10f')](db['Attachment'],{'as':'Attachments','onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x3d')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x11')});db['MailMessage'][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x150')});db[_0xa6f7('0x3d')][_0xa6f7('0x11d')](db['MailInteraction'],{'as':_0xa6f7('0x164'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xa6f7('0x11d')](db[_0xa6f7('0x36')],{'as':'Account','foreignKey':'MailAccountId'});db[_0xa6f7('0x3d')][_0xa6f7('0x11d')](db['ChatWebsite'],{'as':_0xa6f7('0x5b'),'foreignKey':_0xa6f7('0x165')});db['MailMessage']['belongsTo'](db[_0xa6f7('0x61')],{'as':_0xa6f7('0x61'),'foreignKey':'ChatOfflineMessageId'});db[_0xa6f7('0x3f')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x3f')][_0xa6f7('0x11d')](db[_0xa6f7('0x38')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x3f')][_0xa6f7('0x11d')](db['MailAccount'],{'onDelete':'restrict'});db['MailApplication'][_0xa6f7('0x11d')](db[_0xa6f7('0x7e')],{'onDelete':_0xa6f7('0x166'),'foreignKey':_0xa6f7('0x145')});db[_0xa6f7('0x3f')][_0xa6f7('0x11d')](db[_0xa6f7('0x87')],{'onDelete':_0xa6f7('0x166'),'foreignKey':'TagId'});db[_0xa6f7('0x41')]['belongsTo'](db['MailAccount'],{});db[_0xa6f7('0x41')][_0xa6f7('0x11d')](db['CmList'],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b')});db['MailQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x41')][_0xa6f7('0x11d')](db[_0xa6f7('0x119')],{});db[_0xa6f7('0x41')][_0xa6f7('0x11d')](db['MailMessage'],{});db['MailQueueReport'][_0xa6f7('0x11d')](db['User'],{});db['MailQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x38')],{});db['Dashboard'][_0xa6f7('0x10f')](db['DashboardItem'],{'as':_0xa6f7('0x168'),'onDelete':_0xa6f7('0x10d')});db['FaxAccount']['hasMany'](db['Disposition'],{'as':_0xa6f7('0x156'),'foreignKey':_0xa6f7('0x169'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x45')][_0xa6f7('0x10f')](db[_0xa6f7('0x157')],{'as':_0xa6f7('0x158'),'foreignKey':_0xa6f7('0x169')});db[_0xa6f7('0x45')][_0xa6f7('0x10f')](db[_0xa6f7('0x48')],{'as':'Interactions'});db['FaxAccount'][_0xa6f7('0x10f')](db[_0xa6f7('0x46')],{'as':_0xa6f7('0x15a')});db['FaxAccount']['hasMany'](db[_0xa6f7('0x15')],{'as':_0xa6f7('0x16a'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x45')][_0xa6f7('0x10f')](db[_0xa6f7('0x49')],{'as':_0xa6f7('0x14b')});db[_0xa6f7('0x45')][_0xa6f7('0x11d')](db['Trunk'],{'as':_0xa6f7('0x25')});db[_0xa6f7('0x45')][_0xa6f7('0x11d')](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0x45')][_0xa6f7('0x11d')](db[_0xa6f7('0x7f')],{'as':_0xa6f7('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa6f7('0x45')]['belongsToMany'](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x16c')});db[_0xa6f7('0x46')]['belongsTo'](db[_0xa6f7('0x11')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x46')][_0xa6f7('0x11d')](db[_0xa6f7('0x4b')],{'onDelete':_0xa6f7('0x166')});db['FaxApplication']['belongsTo'](db[_0xa6f7('0x45')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x46')][_0xa6f7('0x11d')](db[_0xa6f7('0x87')],{'onDelete':_0xa6f7('0x166'),'foreignKey':_0xa6f7('0x16d')});db[_0xa6f7('0x48')]['hasMany'](db[_0xa6f7('0x49')],{'as':'Messages','onDelete':_0xa6f7('0x10d'),'foreignKey':'FaxInteractionId'});db[_0xa6f7('0x48')][_0xa6f7('0x11d')](db[_0xa6f7('0x45')],{'as':'Account','foreignKey':_0xa6f7('0x169')});db['FaxInteraction'][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':'ContactId'});db[_0xa6f7('0x48')]['belongsTo'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x15f'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x48')]['belongsToMany'](db['Tag'],{'through':_0xa6f7('0x16e'),'as':_0xa6f7('0x160')});db['FaxInteraction'][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':'fax_interaction_has_tags','as':_0xa6f7('0x162')});db[_0xa6f7('0x48')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':'Users','through':_0xa6f7('0x16f'),'foreignKey':_0xa6f7('0x170')});db[_0xa6f7('0x49')]['belongsTo'](db[_0xa6f7('0x11')],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x11')});db['FaxMessage']['belongsTo'](db[_0xa6f7('0x48')],{'as':_0xa6f7('0x164'),'foreignKey':_0xa6f7('0x170')});db[_0xa6f7('0x49')]['belongsTo'](db[_0xa6f7('0x69')],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x150')});db[_0xa6f7('0x49')]['belongsTo'](db[_0xa6f7('0xe7')],{'as':_0xa6f7('0xe7'),'foreignKey':'AttachmentId'});db[_0xa6f7('0x49')]['belongsTo'](db[_0xa6f7('0x45')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x169')});db[_0xa6f7('0x4b')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x2d')});db['FaxQueue'][_0xa6f7('0x120')](db['Team'],{'through':_0xa6f7('0x172'),'as':_0xa6f7('0x148')});db['FaxQueueReport']['belongsTo'](db[_0xa6f7('0x45')],{});db[_0xa6f7('0x4d')][_0xa6f7('0x11d')](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0x4d')][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x4d')]['belongsTo'](db['FaxInteraction'],{});db[_0xa6f7('0x4d')]['belongsTo'](db[_0xa6f7('0x49')],{});db[_0xa6f7('0x4d')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{});db[_0xa6f7('0x4d')]['belongsTo'](db[_0xa6f7('0x4b')],{});db['SmsAccount']['hasMany'](db['Disposition'],{'as':_0xa6f7('0x156'),'foreignKey':_0xa6f7('0x173'),'onDelete':'cascade'});db[_0xa6f7('0x4f')][_0xa6f7('0x10f')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xa6f7('0x173')});db['SmsAccount'][_0xa6f7('0x10f')](db[_0xa6f7('0x174')],{'as':_0xa6f7('0x14b'),'foreignKey':_0xa6f7('0x173')});db[_0xa6f7('0x4f')]['hasMany'](db[_0xa6f7('0x52')],{'as':'Interactions'});db[_0xa6f7('0x4f')][_0xa6f7('0x10f')](db[_0xa6f7('0x51')],{'as':_0xa6f7('0x15a')});db['SmsAccount'][_0xa6f7('0x11d')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xa6f7('0x4f')]['belongsTo'](db[_0xa6f7('0x7f')],{'as':_0xa6f7('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xa6f7('0x4f')]['belongsToMany'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x147'),'through':_0xa6f7('0x175')});db['SmsApplication'][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x51')]['belongsTo'](db[_0xa6f7('0x12d')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x51')][_0xa6f7('0x11d')](db['SmsAccount'],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x51')][_0xa6f7('0x11d')](db[_0xa6f7('0x7e')],{'onDelete':_0xa6f7('0x166'),'foreignKey':'IntervalId'});db[_0xa6f7('0x51')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db['SmsInteraction']['hasMany'](db[_0xa6f7('0x174')],{'as':_0xa6f7('0x14b'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x176')});db[_0xa6f7('0x52')]['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0xa6f7('0x52')][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db['SmsInteraction']['belongsTo'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x15f'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x52')]['belongsToMany'](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x177'),'as':_0xa6f7('0x160')});db['SmsInteraction'][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x177'),'as':_0xa6f7('0x162')});db[_0xa6f7('0x52')]['belongsToMany'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x163'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0xa6f7('0x174')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x11')});db[_0xa6f7('0x174')][_0xa6f7('0x11d')](db['CmContact'],{'onDelete':_0xa6f7('0x10d'),'as':'Contact'});db[_0xa6f7('0x174')][_0xa6f7('0x11d')](db[_0xa6f7('0x52')],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x164'),'foreignKey':_0xa6f7('0x176')});db[_0xa6f7('0x174')][_0xa6f7('0x11d')](db[_0xa6f7('0x4f')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x173')});db[_0xa6f7('0x12d')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x2e'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0xa6f7('0x120')](db['Team'],{'through':_0xa6f7('0x178'),'as':_0xa6f7('0x148')});db[_0xa6f7('0x55')][_0xa6f7('0x10f')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa6f7('0x179'),'onDelete':'cascade'});db[_0xa6f7('0x55')][_0xa6f7('0x10f')](db[_0xa6f7('0x157')],{'as':_0xa6f7('0x158'),'foreignKey':_0xa6f7('0x179')});db[_0xa6f7('0x55')][_0xa6f7('0x10f')](db[_0xa6f7('0x57')],{'as':'Interactions','foreignKey':_0xa6f7('0x179')});db[_0xa6f7('0x55')][_0xa6f7('0x10f')](db[_0xa6f7('0x17a')],{'as':'Messages','foreignKey':_0xa6f7('0x179')});db['OpenchannelAccount'][_0xa6f7('0x10f')](db[_0xa6f7('0x17b')],{'as':_0xa6f7('0x15a'),'foreignKey':_0xa6f7('0x179')});db[_0xa6f7('0x55')]['belongsTo'](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0x55')][_0xa6f7('0x11d')](db[_0xa6f7('0x7f')],{'as':_0xa6f7('0x16b'),'foreignKey':_0xa6f7('0x146')});db[_0xa6f7('0x55')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x137')});db[_0xa6f7('0x17b')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0xa6f7('0x17b')][_0xa6f7('0x11d')](db[_0xa6f7('0x59')],{'onDelete':_0xa6f7('0x166'),'foreignKey':_0xa6f7('0x17c')});db[_0xa6f7('0x17b')]['belongsTo'](db[_0xa6f7('0x55')],{'onDelete':_0xa6f7('0x166'),'foreignKey':_0xa6f7('0x179')});db[_0xa6f7('0x17b')]['belongsTo'](db[_0xa6f7('0x7e')],{'onDelete':_0xa6f7('0x166'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xa6f7('0x11d')](db[_0xa6f7('0x87')],{'onDelete':_0xa6f7('0x166'),'foreignKey':'TagId'});db['OpenchannelInteraction'][_0xa6f7('0x10f')](db[_0xa6f7('0x17a')],{'as':_0xa6f7('0x14b'),'onDelete':_0xa6f7('0x10d'),'foreignKey':'OpenchannelInteractionId'});db[_0xa6f7('0x57')][_0xa6f7('0x11d')](db['OpenchannelAccount'],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xa6f7('0x57')][_0xa6f7('0x11d')](db['CmContact'],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x57')]['belongsTo'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x15f'),'foreignKey':_0xa6f7('0x10e')});db[_0xa6f7('0x57')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x17d'),'as':_0xa6f7('0x160')});db[_0xa6f7('0x57')][_0xa6f7('0x120')](db['Tag'],{'through':_0xa6f7('0x17d'),'as':'ThroughTags'});db[_0xa6f7('0x57')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x163'),'through':_0xa6f7('0x125'),'foreignKey':_0xa6f7('0x17e')});db[_0xa6f7('0x17a')]['belongsTo'](db['User'],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x11')});db[_0xa6f7('0x17a')][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'onDelete':'cascade','as':_0xa6f7('0x150')});db[_0xa6f7('0x17a')][_0xa6f7('0x11d')](db[_0xa6f7('0x57')],{'onDelete':_0xa6f7('0x10d'),'as':'Interaction','foreignKey':'OpenchannelInteractionId'});db[_0xa6f7('0x17a')][_0xa6f7('0x11d')](db[_0xa6f7('0xe7')],{'as':_0xa6f7('0xe7'),'foreignKey':_0xa6f7('0x17f')});db[_0xa6f7('0x17a')][_0xa6f7('0x11d')](db['OpenchannelAccount'],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x179')});db[_0xa6f7('0x59')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x147'),'through':_0xa6f7('0x2f'),'foreignKey':_0xa6f7('0x17c')});db[_0xa6f7('0x59')][_0xa6f7('0x120')](db[_0xa6f7('0xe2')],{'through':'team_has_openchannel_queues','as':_0xa6f7('0x148')});db['ChatWebsite']['hasMany'](db['Disposition'],{'as':'Dispositions','foreignKey':_0xa6f7('0x165'),'onDelete':'cascade'});db[_0xa6f7('0x5b')]['hasMany'](db[_0xa6f7('0x157')],{'as':_0xa6f7('0x158'),'foreignKey':'ChatWebsiteId'});db[_0xa6f7('0x5b')][_0xa6f7('0x10f')](db[_0xa6f7('0x180')],{'as':_0xa6f7('0x181')});db['ChatWebsite'][_0xa6f7('0x10f')](db[_0xa6f7('0x5f')],{'as':_0xa6f7('0x159')});db['ChatWebsite'][_0xa6f7('0x10f')](db[_0xa6f7('0x5d')],{'as':'Applications'});db[_0xa6f7('0x5b')][_0xa6f7('0x10f')](db['ChatMessage'],{'as':_0xa6f7('0x14b')});db[_0xa6f7('0x5b')][_0xa6f7('0x11d')](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0x5b')][_0xa6f7('0x11d')](db['Interval'],{'as':_0xa6f7('0x7e'),'foreignKey':_0xa6f7('0x145')});db[_0xa6f7('0x5b')][_0xa6f7('0x11d')](db[_0xa6f7('0x36')],{'as':_0xa6f7('0x36'),'foreignKey':'MailAccountId'});db[_0xa6f7('0x5b')][_0xa6f7('0x11d')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xa6f7('0x146')});db['ChatWebsite']['belongsToMany'](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x133')});db[_0xa6f7('0x5c')][_0xa6f7('0x11d')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':'ListId'});db['OpenchannelQueueReport']['belongsTo'](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x5c')][_0xa6f7('0x11d')](db['OpenchannelInteraction'],{});db[_0xa6f7('0x5c')]['belongsTo'](db[_0xa6f7('0x17a')],{});db[_0xa6f7('0x5c')][_0xa6f7('0x11d')](db['User'],{});db['OpenchannelQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x59')],{});db['ChatApplication']['belongsTo'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x182'),'foreignKey':'UserId','onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x5d')][_0xa6f7('0x11d')](db[_0xa6f7('0x63')],{'as':_0xa6f7('0x183'),'foreignKey':_0xa6f7('0x184'),'onDelete':_0xa6f7('0x166')});db['ChatApplication'][_0xa6f7('0x11d')](db['ChatWebsite'],{'as':_0xa6f7('0x185'),'foreignKey':_0xa6f7('0x165'),'onDelete':'restrict'});db['ChatApplication']['belongsTo'](db[_0xa6f7('0x87')],{'onDelete':_0xa6f7('0x166'),'foreignKey':'TagId'});db[_0xa6f7('0x5f')][_0xa6f7('0x10f')](db[_0xa6f7('0x186')],{'as':_0xa6f7('0x14b'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x187')});db[_0xa6f7('0x5f')][_0xa6f7('0x11d')](db[_0xa6f7('0x5b')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x165')});db[_0xa6f7('0x5f')][_0xa6f7('0x11d')](db['CmContact'],{'as':'Contact','foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x5f')]['belongsTo'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x15f'),'foreignKey':'UserId'});db[_0xa6f7('0x5f')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x188'),'as':_0xa6f7('0x160')});db[_0xa6f7('0x5f')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':'chat_interaction_has_tags','as':_0xa6f7('0x162')});db['ChatInteraction'][_0xa6f7('0x120')](db['User'],{'as':'Users','through':_0xa6f7('0x189'),'foreignKey':'ChatInteractionId'});db[_0xa6f7('0x186')]['belongsTo'](db['User'],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x11')});db[_0xa6f7('0x186')]['belongsTo'](db[_0xa6f7('0x69')],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x186')][_0xa6f7('0x11d')](db['ChatInteraction'],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x164'),'foreignKey':_0xa6f7('0x187')});db[_0xa6f7('0x186')][_0xa6f7('0x11d')](db['Attachment'],{'as':_0xa6f7('0xe7'),'foreignKey':_0xa6f7('0x17f')});db[_0xa6f7('0x186')][_0xa6f7('0x11d')](db[_0xa6f7('0x5b')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x165')});db[_0xa6f7('0x61')][_0xa6f7('0x10f')](db[_0xa6f7('0xe7')],{'as':'Attachments','foreignKey':_0xa6f7('0x18a'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db['ChatOfflineMessage'][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'onDelete':_0xa6f7('0x10d'),'as':_0xa6f7('0x150'),'foreignKey':'ContactId'});db[_0xa6f7('0x61')][_0xa6f7('0x11d')](db[_0xa6f7('0x5b')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x165')});db[_0xa6f7('0x63')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x2a'),'hooks':!![]});db[_0xa6f7('0x63')][_0xa6f7('0x120')](db[_0xa6f7('0xe2')],{'through':_0xa6f7('0x18b'),'as':_0xa6f7('0x148')});db[_0xa6f7('0x18c')][_0xa6f7('0x10f')](db[_0xa6f7('0xc9')],{'as':'Messages','foreignKey':'ChatGroupId','onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x18c')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x13f'),'through':_0xa6f7('0x18d')});db['ChatProactiveAction'][_0xa6f7('0x11d')](db[_0xa6f7('0x5b')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0xa6f7('0x67')][_0xa6f7('0x10f')](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x18e'),'foreignKey':_0xa6f7('0x18f')});db[_0xa6f7('0x69')]['hasMany'](db[_0xa6f7('0x6b')],{'as':_0xa6f7('0x141'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x69')][_0xa6f7('0x10f')](db[_0xa6f7('0x6f')],{'as':_0xa6f7('0x114'),'foreignKey':'ContactId'});db['CmContact'][_0xa6f7('0x10f')](db[_0xa6f7('0x71')],{'as':_0xa6f7('0x190'),'foreignKey':_0xa6f7('0x151')});db['CmContact'][_0xa6f7('0x10f')](db[_0xa6f7('0x115')],{'as':_0xa6f7('0x115'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x69')]['hasMany'](db[_0xa6f7('0xce')],{'as':'JscriptySessions','foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x69')]['hasMany'](db[_0xa6f7('0x57')],{'as':_0xa6f7('0x116'),'foreignKey':'ContactId','onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x69')][_0xa6f7('0x10f')](db[_0xa6f7('0x5f')],{'as':_0xa6f7('0x117'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa6f7('0x69')][_0xa6f7('0x10f')](db[_0xa6f7('0x52')],{'as':_0xa6f7('0x118'),'foreignKey':_0xa6f7('0x151'),'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x69')]['hasMany'](db[_0xa6f7('0x48')],{'as':'FaxInteractions','foreignKey':_0xa6f7('0x151'),'onDelete':'restrict'});db['CmContact'][_0xa6f7('0x10f')](db[_0xa6f7('0x119')],{'as':_0xa6f7('0x11a'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xa6f7('0x69')][_0xa6f7('0x11d')](db[_0xa6f7('0x67')],{'as':_0xa6f7('0x191'),'foreignKey':_0xa6f7('0x18f')});db[_0xa6f7('0x69')][_0xa6f7('0x11d')](db['CmList'],{'as':_0xa6f7('0x167'),'foreignKey':'ListId','onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x69')]['belongsToMany'](db['User'],{'as':_0xa6f7('0x163'),'through':_0xa6f7('0x121')});db[_0xa6f7('0x69')]['belongsToMany'](db[_0xa6f7('0x87')],{'as':_0xa6f7('0x160'),'through':_0xa6f7('0x192')});db[_0xa6f7('0x69')]['belongsToMany'](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x192'),'as':_0xa6f7('0x162')});db[_0xa6f7('0x6b')]['belongsTo'](db['CmContact'],{'as':_0xa6f7('0x150'),'foreignKey':'ContactId','onDelete':_0xa6f7('0x10d')});db['CmHopper']['belongsTo'](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x6b')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x182'),'foreignKey':_0xa6f7('0x10e')});db['CmHopper'][_0xa6f7('0x11d')](db[_0xa6f7('0x19')],{'as':_0xa6f7('0x183'),'foreignKey':_0xa6f7('0x140'),'onDelete':'cascade'});db['CmHopper'][_0xa6f7('0x11d')](db[_0xa6f7('0xe5')],{'as':_0xa6f7('0xe5'),'foreignKey':'CampaignId','onDelete':_0xa6f7('0x10d')});db['CmHopper']['belongsTo'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x15f'),'foreignKey':_0xa6f7('0x193')});db[_0xa6f7('0x6d')][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':'Contact','foreignKey':_0xa6f7('0x151'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x6d')][_0xa6f7('0x11d')](db['CmList'],{'as':'List','foreignKey':'ListId','onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x6d')]['belongsTo'](db['VoiceQueue'],{'as':_0xa6f7('0x183'),'foreignKey':_0xa6f7('0x140'),'onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0x6d')]['belongsTo'](db[_0xa6f7('0xe5')],{'as':'Campaign','foreignKey':_0xa6f7('0x194'),'onDelete':'cascade'});db[_0xa6f7('0x77')][_0xa6f7('0x10f')](db['Condition'],{'as':{'plural':_0xa6f7('0x195'),'singular':_0xa6f7('0x196')},'foreignKey':_0xa6f7('0x197'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db[_0xa6f7('0x77')]['hasMany'](db[_0xa6f7('0x7c')],{'as':{'plural':_0xa6f7('0x198'),'singular':_0xa6f7('0x199')},'foreignKey':_0xa6f7('0x19a'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db[_0xa6f7('0x77')][_0xa6f7('0x10f')](db['Action'],{'as':_0xa6f7('0x19b'),'foreignKey':_0xa6f7('0x19c'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db[_0xa6f7('0x7a')][_0xa6f7('0x10f')](db[_0xa6f7('0x7a')],{'as':_0xa6f7('0x156'),'foreignKey':_0xa6f7('0x19d'),'onDelete':'cascade'});db[_0xa6f7('0x7e')]['hasMany'](db[_0xa6f7('0x7e')],{'as':_0xa6f7('0x19e'),'foreignKey':'IntervalId','onDelete':_0xa6f7('0x10d'),'hooks':!![],'required':![]});db[_0xa6f7('0x7e')][_0xa6f7('0x10f')](db['VoiceExtension'],{'as':_0xa6f7('0x113'),'foreignKey':_0xa6f7('0x145'),'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x7e')][_0xa6f7('0x10f')](db[_0xa6f7('0x3f')],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xa6f7('0x7e')][_0xa6f7('0x10f')](db[_0xa6f7('0x5d')],{'as':_0xa6f7('0x19f'),'foreignKey':_0xa6f7('0x145')});db[_0xa6f7('0x7e')][_0xa6f7('0x10f')](db['FaxApplication'],{'as':_0xa6f7('0x1a0'),'foreignKey':_0xa6f7('0x145')});db[_0xa6f7('0x7e')][_0xa6f7('0x10f')](db[_0xa6f7('0x51')],{'as':'SmsApplications','foreignKey':_0xa6f7('0x145')});db['Schedule'][_0xa6f7('0x11d')](db[_0xa6f7('0x36')],{});db[_0xa6f7('0x1a1')][_0xa6f7('0x11d')](db[_0xa6f7('0x91')],{'foreignKey':_0xa6f7('0x1a2')});db[_0xa6f7('0x1a1')][_0xa6f7('0x11d')](db['AnalyticCustomReport'],{'foreignKey':_0xa6f7('0x1a3')});db[_0xa6f7('0x85')][_0xa6f7('0x120')](db[_0xa6f7('0x17')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xa6f7('0x166')});db[_0xa6f7('0x87')][_0xa6f7('0x120')](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0xa6f7('0x87')][_0xa6f7('0x120')](db[_0xa6f7('0x5f')],{'through':'chat_interaction_has_tags'});db[_0xa6f7('0x87')][_0xa6f7('0x120')](db[_0xa6f7('0x119')],{'through':_0xa6f7('0x161')});db[_0xa6f7('0x87')][_0xa6f7('0x120')](db[_0xa6f7('0x52')],{'through':_0xa6f7('0x177')});db[_0xa6f7('0x87')][_0xa6f7('0x120')](db[_0xa6f7('0x48')],{'through':_0xa6f7('0x16e')});db[_0xa6f7('0x87')][_0xa6f7('0x120')](db[_0xa6f7('0x57')],{'through':_0xa6f7('0x17d')});db['Tag'][_0xa6f7('0x120')](db[_0xa6f7('0x126')],{'through':_0xa6f7('0x1a4')});db['Trigger']['hasMany'](db[_0xa6f7('0x7c')],{'as':{'plural':_0xa6f7('0x1a5'),'singular':'AllCondition'},'foreignKey':_0xa6f7('0x1a6'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db[_0xa6f7('0x8b')][_0xa6f7('0x10f')](db[_0xa6f7('0x7c')],{'as':{'plural':_0xa6f7('0x1a7'),'singular':_0xa6f7('0x1a8')},'foreignKey':_0xa6f7('0x1a9'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db[_0xa6f7('0x8b')][_0xa6f7('0x10f')](db[_0xa6f7('0x76')],{'as':_0xa6f7('0x19b'),'foreignKey':_0xa6f7('0x1aa'),'onDelete':_0xa6f7('0x10d'),'hooks':!![]});db[_0xa6f7('0x8f')]['hasMany'](db['AnalyticFieldReport'],{'as':_0xa6f7('0x1ab'),'onDelete':'cascade','foreignKey':_0xa6f7('0x1a3'),'hooks':!![]});db['AnalyticDefaultReport'][_0xa6f7('0x10f')](db[_0xa6f7('0x97')],{'as':_0xa6f7('0x1ab'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1a2')});db['AnalyticMetric'][_0xa6f7('0x10f')](db[_0xa6f7('0x97')],{'as':'Fields','onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1ac')});db[_0xa6f7('0x97')][_0xa6f7('0x11d')](db[_0xa6f7('0x95')],{'foreignKey':_0xa6f7('0x1ac')});db[_0xa6f7('0x99')]['hasMany'](db[_0xa6f7('0x9b')],{'as':'Configurations','onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1ad')});db['SalesforceConfiguration']['hasMany'](db[_0xa6f7('0x1ae')],{'as':_0xa6f7('0x1af'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0x9b')]['hasMany'](db[_0xa6f7('0x1ae')],{'as':_0xa6f7('0x1b1'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0x9b')][_0xa6f7('0x10f')](db['SalesforceField'],{'as':_0xa6f7('0x1ab'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b3')});db['SalesforceConfiguration']['belongsTo'](db[_0xa6f7('0x99')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0x1ae')][_0xa6f7('0x10f')](db[_0xa6f7('0x1ae')],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db['SalesforceField']['hasMany'](db[_0xa6f7('0x1ae')],{'as':_0xa6f7('0x1b5'),'foreignKey':'DescriptionId'});db[_0xa6f7('0x1ae')][_0xa6f7('0x10f')](db[_0xa6f7('0x1ae')],{'as':_0xa6f7('0x1b6'),'foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0x1ae')][_0xa6f7('0x11d')](db[_0xa6f7('0x1b7')],{'as':_0xa6f7('0x1b7'),'foreignKey':_0xa6f7('0x1b8')});db[_0xa6f7('0x1b9')][_0xa6f7('0x10f')](db[_0xa6f7('0x1ba')],{'as':_0xa6f7('0x1bb'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0x1ba')][_0xa6f7('0x10f')](db[_0xa6f7('0x9f')],{'as':_0xa6f7('0x1af'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b0')});db['SugarcrmConfiguration'][_0xa6f7('0x10f')](db['SugarcrmField'],{'as':_0xa6f7('0x1b1'),'onDelete':_0xa6f7('0x10d'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':'Fields','onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0x1ba')][_0xa6f7('0x11d')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0xa6f7('0x1ad')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db['SugarcrmField'][_0xa6f7('0x10f')](db['SugarcrmField'],{'as':'Description','foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0x9f')][_0xa6f7('0x10f')](db['SugarcrmField'],{'as':_0xa6f7('0x1b6'),'foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0x9f')][_0xa6f7('0x11d')](db[_0xa6f7('0x1b7')],{'as':'Variable','foreignKey':_0xa6f7('0x1b8')});db[_0xa6f7('0xa1')][_0xa6f7('0x10f')](db[_0xa6f7('0x1bc')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0x1bc')][_0xa6f7('0x10f')](db[_0xa6f7('0xa4')],{'as':_0xa6f7('0x1af'),'onDelete':'cascade','foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0x1bc')]['hasMany'](db['DeskField'],{'as':_0xa6f7('0x1b1'),'onDelete':_0xa6f7('0x10d'),'foreignKey':'DescriptionId'});db[_0xa6f7('0x1bc')][_0xa6f7('0x10f')](db[_0xa6f7('0xa4')],{'as':_0xa6f7('0x1ab'),'onDelete':'cascade','foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0x1bc')][_0xa6f7('0x11d')](db[_0xa6f7('0xa1')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1ad')});db['DeskConfiguration']['belongsToMany'](db['Tag'],{'through':_0xa6f7('0x1bd')});db['DeskField'][_0xa6f7('0x10f')](db['DeskField'],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0xa4')]['hasMany'](db['DeskField'],{'as':_0xa6f7('0x1b5'),'foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0xa4')][_0xa6f7('0x10f')](db[_0xa6f7('0xa4')],{'as':_0xa6f7('0x1b6'),'foreignKey':_0xa6f7('0x1b3')});db['DeskField']['belongsTo'](db['Variable'],{'as':_0xa6f7('0x1b7'),'foreignKey':_0xa6f7('0x1b8')});db[_0xa6f7('0xa5')][_0xa6f7('0x10f')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xa7')]['hasMany'](db[_0xa6f7('0xa8')],{'as':_0xa6f7('0x1af'),'onDelete':_0xa6f7('0x10d'),'foreignKey':'SubjectId'});db[_0xa6f7('0xa7')][_0xa6f7('0x10f')](db[_0xa6f7('0xa8')],{'as':'Descriptions','onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b2')});db['ZohoConfiguration'][_0xa6f7('0x10f')](db[_0xa6f7('0xa8')],{'as':_0xa6f7('0x1ab'),'onDelete':_0xa6f7('0x10d'),'foreignKey':'FieldId'});db['ZohoConfiguration']['belongsTo'](db[_0xa6f7('0xa5')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xa8')]['hasMany'](db[_0xa6f7('0xa8')],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0xa8')]['hasMany'](db[_0xa6f7('0xa8')],{'as':'Description','foreignKey':_0xa6f7('0x1b2')});db['ZohoField']['hasMany'](db[_0xa6f7('0xa8')],{'as':_0xa6f7('0x1b6'),'foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0xa8')][_0xa6f7('0x11d')](db[_0xa6f7('0x1b7')],{'as':_0xa6f7('0x1b7'),'foreignKey':_0xa6f7('0x1b8')});db[_0xa6f7('0xaa')][_0xa6f7('0x10f')](db[_0xa6f7('0xab')],{'as':_0xa6f7('0x1bb'),'onDelete':'cascade','foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xab')][_0xa6f7('0x10f')](db['ZendeskField'],{'as':_0xa6f7('0x1af'),'foreignKey':'SubjectId'});db[_0xa6f7('0xab')]['hasMany'](db[_0xa6f7('0xac')],{'as':_0xa6f7('0x1b1'),'foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0xab')][_0xa6f7('0x10f')](db[_0xa6f7('0xac')],{'as':_0xa6f7('0x1ab'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0xa6f7('0x11d')](db[_0xa6f7('0xaa')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xab')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x1be')});db['ZendeskField'][_0xa6f7('0x10f')](db[_0xa6f7('0xac')],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db['ZendeskField'][_0xa6f7('0x10f')](db['ZendeskField'],{'as':_0xa6f7('0x1b5'),'foreignKey':'DescriptionId'});db[_0xa6f7('0xac')]['hasMany'](db['ZendeskField'],{'as':_0xa6f7('0x1b6'),'foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0xac')][_0xa6f7('0x11d')](db['Variable'],{'as':_0xa6f7('0x1b7'),'foreignKey':_0xa6f7('0x1b8')});db[_0xa6f7('0xae')][_0xa6f7('0x10f')](db[_0xa6f7('0xaf')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xa6f7('0xaf')]['hasMany'](db[_0xa6f7('0xb1')],{'as':'Subjects','onDelete':_0xa6f7('0x10d'),'foreignKey':'SubjectId'});db[_0xa6f7('0xaf')][_0xa6f7('0x10f')](db[_0xa6f7('0xb1')],{'as':_0xa6f7('0x1b1'),'onDelete':'cascade','foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0xaf')][_0xa6f7('0x10f')](db[_0xa6f7('0xb1')],{'as':'Fields','onDelete':_0xa6f7('0x10d'),'foreignKey':'FieldId'});db[_0xa6f7('0xaf')][_0xa6f7('0x11d')](db[_0xa6f7('0xae')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xaf')]['belongsToMany'](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x1bf')});db[_0xa6f7('0xb1')][_0xa6f7('0x10f')](db[_0xa6f7('0xb1')],{'as':'Subject','foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0xb1')][_0xa6f7('0x10f')](db[_0xa6f7('0xb1')],{'as':_0xa6f7('0x1b5'),'foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0xb1')][_0xa6f7('0x10f')](db[_0xa6f7('0xb1')],{'as':_0xa6f7('0x1b6'),'foreignKey':'FieldId'});db['FreshdeskField'][_0xa6f7('0x11d')](db[_0xa6f7('0x1b7')],{'as':'Variable','foreignKey':'VariableId'});db[_0xa6f7('0x1c0')]['hasMany'](db[_0xa6f7('0x1c1')],{'as':_0xa6f7('0x1bb'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0x1c1')][_0xa6f7('0x10f')](db['VtigerField'],{'as':_0xa6f7('0x1af'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0x1c1')][_0xa6f7('0x10f')](db[_0xa6f7('0x1c2')],{'as':'Descriptions','foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0x1c1')][_0xa6f7('0x10f')](db['VtigerField'],{'as':'Fields','foreignKey':'FieldId'});db['VtigerConfiguration'][_0xa6f7('0x11d')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0x1c2')][_0xa6f7('0x10f')](db[_0xa6f7('0x1c2')],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0x1c2')]['hasMany'](db['VtigerField'],{'as':_0xa6f7('0x1b5'),'foreignKey':'DescriptionId'});db[_0xa6f7('0x1c2')][_0xa6f7('0x10f')](db[_0xa6f7('0x1c2')],{'as':_0xa6f7('0x1b6'),'foreignKey':_0xa6f7('0x1b3')});db['VtigerField'][_0xa6f7('0x11d')](db[_0xa6f7('0x1b7')],{'as':_0xa6f7('0x1b7'),'foreignKey':_0xa6f7('0x1b8')});db['ServicenowAccount'][_0xa6f7('0x10f')](db[_0xa6f7('0xb7')],{'as':'Configurations','onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xb7')][_0xa6f7('0x10f')](db['ServicenowField'],{'as':_0xa6f7('0x1af'),'foreignKey':'SubjectId'});db['ServicenowConfiguration']['hasMany'](db[_0xa6f7('0xb9')],{'as':_0xa6f7('0x1b1'),'foreignKey':'DescriptionId'});db[_0xa6f7('0xb7')]['hasMany'](db['ServicenowField'],{'as':'Fields','foreignKey':_0xa6f7('0x1b3')});db['ServicenowConfiguration']['belongsTo'](db[_0xa6f7('0xb6')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xb9')]['hasMany'](db[_0xa6f7('0xb9')],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0xb9')][_0xa6f7('0x10f')](db[_0xa6f7('0xb9')],{'as':_0xa6f7('0x1b5'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xa6f7('0x10f')](db[_0xa6f7('0xb9')],{'as':_0xa6f7('0x1b6'),'foreignKey':_0xa6f7('0x1b3')});db['ServicenowField'][_0xa6f7('0x11d')](db[_0xa6f7('0x1b7')],{'as':_0xa6f7('0x1b7'),'foreignKey':'VariableId'});db[_0xa6f7('0x1c3')]['hasMany'](db['Dynamics365Configuration'],{'as':_0xa6f7('0x1bb'),'onDelete':'cascade','foreignKey':_0xa6f7('0x1ad')});db['Dynamics365Configuration'][_0xa6f7('0x10f')](db[_0xa6f7('0xbe')],{'as':_0xa6f7('0x1af'),'onDelete':_0xa6f7('0x10d'),'foreignKey':'SubjectId'});db[_0xa6f7('0xbc')]['hasMany'](db[_0xa6f7('0xbe')],{'as':_0xa6f7('0x1b1'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0xbc')][_0xa6f7('0x10f')](db[_0xa6f7('0xbe')],{'as':_0xa6f7('0x1ab'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1b3')});db['Dynamics365Configuration'][_0xa6f7('0x11d')](db['Dynamics365Account'],{'as':'Account','foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xbe')][_0xa6f7('0x10f')](db[_0xa6f7('0xbe')],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0xbe')][_0xa6f7('0x10f')](db['Dynamics365Field'],{'as':_0xa6f7('0x1b5'),'foreignKey':'DescriptionId'});db[_0xa6f7('0xbe')][_0xa6f7('0x10f')](db['Dynamics365Field'],{'as':_0xa6f7('0x1b6'),'foreignKey':'FieldId'});db[_0xa6f7('0xbe')][_0xa6f7('0x11d')](db[_0xa6f7('0x1b7')],{'as':_0xa6f7('0x1b7'),'foreignKey':_0xa6f7('0x1b8')});db[_0xa6f7('0xc0')][_0xa6f7('0x10f')](db[_0xa6f7('0xc2')],{'as':_0xa6f7('0x1bb'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1ad')});db[_0xa6f7('0xc2')][_0xa6f7('0x10f')](db['FreshsalesField'],{'as':'Subjects','foreignKey':_0xa6f7('0x1b0')});db['FreshsalesConfiguration'][_0xa6f7('0x10f')](db[_0xa6f7('0xc3')],{'as':_0xa6f7('0x1b1'),'foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0xc2')][_0xa6f7('0x10f')](db[_0xa6f7('0xc3')],{'as':'Fields','foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0xc2')][_0xa6f7('0x11d')](db[_0xa6f7('0xc0')],{'as':_0xa6f7('0x171'),'foreignKey':'AccountId'});db['FreshsalesField'][_0xa6f7('0x10f')](db[_0xa6f7('0xc3')],{'as':_0xa6f7('0x1b4'),'foreignKey':_0xa6f7('0x1b0')});db[_0xa6f7('0xc3')][_0xa6f7('0x10f')](db[_0xa6f7('0xc3')],{'as':_0xa6f7('0x1b5'),'foreignKey':_0xa6f7('0x1b2')});db[_0xa6f7('0xc3')][_0xa6f7('0x10f')](db[_0xa6f7('0xc3')],{'as':'Field','foreignKey':_0xa6f7('0x1b3')});db[_0xa6f7('0xc3')][_0xa6f7('0x11d')](db['Variable'],{'as':'Variable','foreignKey':_0xa6f7('0x1b8')});db[_0xa6f7('0xc7')]['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0xf3')],{'as':'List','foreignKey':'ListId'});db['ChatQueueReport'][_0xa6f7('0x11d')](db['CmContact'],{'as':_0xa6f7('0x150'),'foreignKey':'ContactId'});db[_0xa6f7('0xc7')][_0xa6f7('0x11d')](db[_0xa6f7('0x5f')],{});db[_0xa6f7('0xc7')]['belongsTo'](db['ChatMessage'],{});db[_0xa6f7('0xc7')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{});db['ChatQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x63')],{});db[_0xa6f7('0xc9')][_0xa6f7('0x11d')](db['User'],{'onDelete':'cascade','foreignKey':_0xa6f7('0x1c4')});db[_0xa6f7('0xc9')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1c5')});db[_0xa6f7('0xce')][_0xa6f7('0x10f')](db[_0xa6f7('0xcd')],{'foreignKey':'SessionId','onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0xce')]['hasMany'](db[_0xa6f7('0xcb')],{'foreignKey':'SessionId','onDelete':_0xa6f7('0x10d')});db[_0xa6f7('0xd0')][_0xa6f7('0x11d')](db[_0xa6f7('0x4f')],{});db[_0xa6f7('0xd0')][_0xa6f7('0x11d')](db['CmList'],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0xd0')][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':'Contact','foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0xd0')][_0xa6f7('0x11d')](db['SmsInteraction'],{});db[_0xa6f7('0xd0')][_0xa6f7('0x11d')](db[_0xa6f7('0x174')],{});db[_0xa6f7('0xd0')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{});db['SmsQueueReport'][_0xa6f7('0x11d')](db['SmsQueue'],{});db['JscriptyProject'][_0xa6f7('0x10f')](db[_0xa6f7('0xce')],{'foreignKey':_0xa6f7('0x1c6')});db[_0xa6f7('0xd6')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xa6f7('0x10f')](db[_0xa6f7('0xcb')],{'foreignKey':_0xa6f7('0x1c6')});db[_0xa6f7('0xdc')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x163'),'through':_0xa6f7('0x13a')});db[_0xa6f7('0xe2')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x147'),'through':_0xa6f7('0x123')});db[_0xa6f7('0xe2')][_0xa6f7('0x120')](db[_0xa6f7('0x19')],{'through':_0xa6f7('0x108'),'as':'VoiceQueues'});db[_0xa6f7('0xe2')]['belongsToMany'](db['MailQueue'],{'through':_0xa6f7('0x15d'),'as':_0xa6f7('0x12a')});db['Team'][_0xa6f7('0x120')](db['ChatQueue'],{'through':_0xa6f7('0x18b'),'as':_0xa6f7('0x1c7')});db[_0xa6f7('0xe2')][_0xa6f7('0x120')](db['FaxQueue'],{'through':_0xa6f7('0x172'),'as':_0xa6f7('0x12c')});db[_0xa6f7('0xe2')]['belongsToMany'](db[_0xa6f7('0x12d')],{'through':_0xa6f7('0x178'),'as':_0xa6f7('0x12e')});db['Team'][_0xa6f7('0x120')](db[_0xa6f7('0x59')],{'through':_0xa6f7('0x1c8'),'as':'OpenchannelQueues'});db[_0xa6f7('0xe2')][_0xa6f7('0x120')](db['WhatsappQueue'],{'through':_0xa6f7('0x1c9'),'as':_0xa6f7('0x130')});db[_0xa6f7('0xe2')][_0xa6f7('0x120')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':_0xa6f7('0x129')});db['Campaign'][_0xa6f7('0x10f')](db[_0xa6f7('0x6b')],{'as':_0xa6f7('0x141'),'foreignKey':_0xa6f7('0x194')});db[_0xa6f7('0xe5')]['hasMany'](db[_0xa6f7('0x6f')],{'as':'HopperFinals','foreignKey':_0xa6f7('0x194')});db['Campaign'][_0xa6f7('0x10f')](db['CmHopperHistory'],{'as':_0xa6f7('0x190'),'foreignKey':'CampaignId'});db[_0xa6f7('0xe5')][_0xa6f7('0x10f')](db[_0xa6f7('0x6d')],{'as':_0xa6f7('0x142'),'foreignKey':'CampaignId'});db[_0xa6f7('0xe5')][_0xa6f7('0x11d')](db[_0xa6f7('0x25')],{'as':_0xa6f7('0x25'),'foreignKey':_0xa6f7('0x143')});db['Campaign'][_0xa6f7('0x11d')](db['Trunk'],{'as':_0xa6f7('0x144'),'foreignKey':_0xa6f7('0x1ca')});db['Campaign'][_0xa6f7('0x11d')](db[_0xa6f7('0x7e')],{'as':_0xa6f7('0x7e'),'foreignKey':'IntervalId'});db[_0xa6f7('0xe5')]['belongsTo'](db[_0xa6f7('0xdc')],{'as':_0xa6f7('0xdc'),'foreignKey':_0xa6f7('0x1cb')});db[_0xa6f7('0xe5')][_0xa6f7('0x120')](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x122'),'through':_0xa6f7('0x1cc')});db[_0xa6f7('0xe5')]['belongsToMany'](db['CmList'],{'as':_0xa6f7('0x149'),'through':'campaigns_has_cm_blacklists'});db['Attachment']['belongsTo'](db[_0xa6f7('0x61')],{'as':_0xa6f7('0x61'),'foreignKey':_0xa6f7('0x18a')});db[_0xa6f7('0xea')]['belongsTo'](db['MailMessage'],{});db[_0xa6f7('0xea')][_0xa6f7('0x11d')](db[_0xa6f7('0x119')],{});db[_0xa6f7('0xea')][_0xa6f7('0x11d')](db['MailAccount'],{'foreignKey':_0xa6f7('0x1cd'),'as':_0xa6f7('0x1ce')});db[_0xa6f7('0xea')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1cf'),'as':_0xa6f7('0x1d0')});db[_0xa6f7('0xea')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1d1'),'as':_0xa6f7('0x1d2')});db[_0xa6f7('0xea')][_0xa6f7('0x11d')](db[_0xa6f7('0x38')],{'foreignKey':_0xa6f7('0x1d3'),'as':'ToQueue'});db[_0xa6f7('0xea')]['belongsTo'](db['MailAccount'],{'foreignKey':_0xa6f7('0x1d4'),'as':_0xa6f7('0x1d5')});db[_0xa6f7('0xec')][_0xa6f7('0x11d')](db[_0xa6f7('0x186')],{});db[_0xa6f7('0xec')][_0xa6f7('0x11d')](db[_0xa6f7('0x5f')],{});db[_0xa6f7('0xec')][_0xa6f7('0x11d')](db[_0xa6f7('0x5b')],{'foreignKey':_0xa6f7('0x1d6'),'as':_0xa6f7('0x1ce')});db[_0xa6f7('0xec')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1cf'),'as':_0xa6f7('0x1d0')});db[_0xa6f7('0xec')]['belongsTo'](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1d1'),'as':_0xa6f7('0x1d2')});db['ChatTransferReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x63')],{'foreignKey':_0xa6f7('0x1d7'),'as':'ToQueue'});db['ChatTransferReport'][_0xa6f7('0x11d')](db['ChatWebsite'],{'foreignKey':_0xa6f7('0x1d8'),'as':_0xa6f7('0x1d5')});db['FaxTransferReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x49')],{});db['FaxTransferReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x48')],{});db['FaxTransferReport']['belongsTo'](db['FaxAccount'],{'foreignKey':_0xa6f7('0x1d9'),'as':_0xa6f7('0x1ce')});db[_0xa6f7('0xee')][_0xa6f7('0x11d')](db['User'],{'foreignKey':_0xa6f7('0x1cf'),'as':_0xa6f7('0x1d0')});db['FaxTransferReport'][_0xa6f7('0x11d')](db['User'],{'foreignKey':_0xa6f7('0x1d1'),'as':_0xa6f7('0x1d2')});db[_0xa6f7('0xee')][_0xa6f7('0x11d')](db[_0xa6f7('0x4b')],{'foreignKey':'ToFaxQueueId','as':_0xa6f7('0x1da')});db[_0xa6f7('0xee')][_0xa6f7('0x11d')](db[_0xa6f7('0x45')],{'foreignKey':_0xa6f7('0x1db'),'as':_0xa6f7('0x1d5')});db[_0xa6f7('0x1dc')][_0xa6f7('0x11d')](db[_0xa6f7('0x17a')],{});db['OpenchannelTransferReport']['belongsTo'](db[_0xa6f7('0x57')],{});db[_0xa6f7('0x1dc')]['belongsTo'](db[_0xa6f7('0x55')],{'foreignKey':_0xa6f7('0x1dd'),'as':'FromAccount'});db[_0xa6f7('0x1dc')]['belongsTo'](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1cf'),'as':_0xa6f7('0x1d0')});db[_0xa6f7('0x1dc')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1d1'),'as':_0xa6f7('0x1d2')});db[_0xa6f7('0x1dc')][_0xa6f7('0x11d')](db[_0xa6f7('0x59')],{'foreignKey':_0xa6f7('0x1de'),'as':_0xa6f7('0x1da')});db[_0xa6f7('0x1dc')][_0xa6f7('0x11d')](db[_0xa6f7('0x55')],{'foreignKey':_0xa6f7('0x1df'),'as':_0xa6f7('0x1d5')});db['SmsTransferReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x174')],{});db[_0xa6f7('0xf1')]['belongsTo'](db['SmsInteraction'],{});db['SmsTransferReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x4f')],{'foreignKey':_0xa6f7('0x1e0'),'as':_0xa6f7('0x1ce')});db[_0xa6f7('0xf1')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1cf'),'as':_0xa6f7('0x1d0')});db[_0xa6f7('0xf1')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1d1'),'as':'ToAgent'});db[_0xa6f7('0xf1')][_0xa6f7('0x11d')](db[_0xa6f7('0x12d')],{'foreignKey':_0xa6f7('0x1e1'),'as':_0xa6f7('0x1da')});db[_0xa6f7('0xf1')][_0xa6f7('0x11d')](db[_0xa6f7('0x4f')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xa6f7('0xf3')][_0xa6f7('0x10f')](db[_0xa6f7('0x7a')],{'as':_0xa6f7('0x156'),'foreignKey':_0xa6f7('0x15b'),'onDelete':'cascade'});db['CmList'][_0xa6f7('0x10f')](db[_0xa6f7('0x74')],{'as':'CustomFields','foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0xf3')]['hasMany'](db[_0xa6f7('0x69')],{'as':'Contacts','onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0xf3')][_0xa6f7('0x10f')](db[_0xa6f7('0x6f')],{'as':_0xa6f7('0x114'),'foreignKey':_0xa6f7('0x15b')});db['CmList'][_0xa6f7('0x10f')](db[_0xa6f7('0x71')],{'as':'HopperHistory','foreignKey':_0xa6f7('0x15b')});db['CmList']['hasMany'](db[_0xa6f7('0x115')],{'as':'ReportAgentPreview','foreignKey':_0xa6f7('0x15b')});db[_0xa6f7('0xf3')][_0xa6f7('0x120')](db['VoiceQueue'],{'as':'Queues','through':_0xa6f7('0x1e2')});db[_0xa6f7('0xf3')][_0xa6f7('0x120')](db['User'],{'as':_0xa6f7('0x147'),'through':'cm_user_has_lists'});db[_0xa6f7('0xf4')]['hasMany'](db['VoiceExtension'],{'as':_0xa6f7('0x113'),'onDelete':_0xa6f7('0x10d')});db['VoicePrefix'][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':'Agents','through':_0xa6f7('0x10b')});db[_0xa6f7('0xf4')][_0xa6f7('0x120')](db[_0xa6f7('0xe2')],{'through':_0xa6f7('0x1e3'),'as':_0xa6f7('0x148')});db[_0xa6f7('0x11e')]['hasMany'](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x163'),'foreignKey':_0xa6f7('0x11f')});db['UserProfile']['hasMany'](db[_0xa6f7('0xf7')],{'as':_0xa6f7('0x1e4'),'foreignKey':_0xa6f7('0x11f'),'onDelete':'cascade'});db['UserProfileSection'][_0xa6f7('0x10f')](db['UserProfileResource'],{'as':_0xa6f7('0x1e5'),'foreignKey':_0xa6f7('0x1e6'),'onDelete':'cascade'});db[_0xa6f7('0xfd')][_0xa6f7('0x10f')](db[_0xa6f7('0x7a')],{'as':_0xa6f7('0x156'),'foreignKey':_0xa6f7('0x1e7'),'onDelete':'cascade'});db['WhatsappAccount'][_0xa6f7('0x10f')](db[_0xa6f7('0x157')],{'as':_0xa6f7('0x158'),'foreignKey':_0xa6f7('0x1e7')});db[_0xa6f7('0xfd')]['hasMany'](db[_0xa6f7('0x100')],{'as':'Messages','foreignKey':'WhatsappAccountId'});db[_0xa6f7('0xfd')][_0xa6f7('0x10f')](db[_0xa6f7('0x126')],{'as':'Interactions'});db[_0xa6f7('0xfd')]['hasMany'](db['WhatsappApplication'],{'as':_0xa6f7('0x15a')});db[_0xa6f7('0xfd')]['belongsTo'](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':'ListId'});db['WhatsappAccount']['belongsTo'](db[_0xa6f7('0x7f')],{'as':_0xa6f7('0x16b'),'foreignKey':_0xa6f7('0x146')});db[_0xa6f7('0xfd')][_0xa6f7('0x120')](db['User'],{'as':_0xa6f7('0x147'),'through':'user_has_whatsapp_accounts'});db[_0xa6f7('0xfe')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0xfe')]['belongsTo'](db[_0xa6f7('0x1e8')],{'onDelete':_0xa6f7('0x166')});db[_0xa6f7('0xfe')][_0xa6f7('0x11d')](db[_0xa6f7('0xfd')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xa6f7('0x11d')](db[_0xa6f7('0x7e')],{'onDelete':_0xa6f7('0x166'),'foreignKey':_0xa6f7('0x145')});db[_0xa6f7('0xfe')][_0xa6f7('0x11d')](db[_0xa6f7('0x87')],{'onDelete':_0xa6f7('0x166'),'foreignKey':_0xa6f7('0x16d')});db[_0xa6f7('0x126')][_0xa6f7('0x10f')](db[_0xa6f7('0x100')],{'as':_0xa6f7('0x14b'),'onDelete':_0xa6f7('0x10d'),'foreignKey':_0xa6f7('0x1e9')});db[_0xa6f7('0x126')][_0xa6f7('0x11d')](db[_0xa6f7('0xfd')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1e7')});db[_0xa6f7('0x126')][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db[_0xa6f7('0x126')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x15f'),'foreignKey':'UserId'});db[_0xa6f7('0x126')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x1a4'),'as':'Tags'});db[_0xa6f7('0x126')][_0xa6f7('0x120')](db[_0xa6f7('0x87')],{'through':_0xa6f7('0x1a4'),'as':'ThroughTags'});db[_0xa6f7('0x126')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':'Users','through':_0xa6f7('0x127'),'foreignKey':_0xa6f7('0x1e9')});db[_0xa6f7('0x100')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x11')});db[_0xa6f7('0x100')][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'onDelete':'cascade','as':_0xa6f7('0x150')});db[_0xa6f7('0x100')][_0xa6f7('0x11d')](db[_0xa6f7('0x126')],{'onDelete':_0xa6f7('0x10d'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db[_0xa6f7('0x100')][_0xa6f7('0x11d')](db[_0xa6f7('0xfd')],{'as':_0xa6f7('0x171'),'foreignKey':_0xa6f7('0x1e7')});db[_0xa6f7('0x102')][_0xa6f7('0x11d')](db[_0xa6f7('0xfd')],{});db[_0xa6f7('0x102')][_0xa6f7('0x11d')](db[_0xa6f7('0xf3')],{'as':_0xa6f7('0x167'),'foreignKey':_0xa6f7('0x15b')});db['WhatsappQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x69')],{'as':_0xa6f7('0x150'),'foreignKey':_0xa6f7('0x151')});db['WhatsappQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x126')],{});db[_0xa6f7('0x102')][_0xa6f7('0x11d')](db['WhatsappQueue'],{});db[_0xa6f7('0x102')]['belongsTo'](db[_0xa6f7('0x100')],{});db['WhatsappQueueReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{});db['WhatsappTransferReport'][_0xa6f7('0x11d')](db[_0xa6f7('0x100')],{});db[_0xa6f7('0x1ea')]['belongsTo'](db[_0xa6f7('0x126')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xa6f7('0xfd')],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db['WhatsappTransferReport'][_0xa6f7('0x11d')](db['WhatsappAccount'],{'foreignKey':_0xa6f7('0x1eb'),'as':'ToAccount'});db[_0xa6f7('0x1ea')][_0xa6f7('0x11d')](db[_0xa6f7('0x1e8')],{'foreignKey':'ToQueueId','as':_0xa6f7('0x1da')});db[_0xa6f7('0x1ea')][_0xa6f7('0x11d')](db[_0xa6f7('0x11')],{'foreignKey':_0xa6f7('0x1cf'),'as':_0xa6f7('0x1d0')});db[_0xa6f7('0x1ea')]['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xa6f7('0x1e8')][_0xa6f7('0x120')](db[_0xa6f7('0x11')],{'as':_0xa6f7('0x147'),'through':_0xa6f7('0x31'),'foreignKey':_0xa6f7('0x1ec')});db[_0xa6f7('0x1e8')]['belongsToMany'](db[_0xa6f7('0xe2')],{'through':_0xa6f7('0x1c9'),'as':_0xa6f7('0x148')});module[_0xa6f7('0x1ed')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x878f=['CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','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/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','HopperFinals','OpenchannelInteraction','OpenchannelInteractions','SmsInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteraction','user_has_openchannel_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','Contact','ContactId','MailAccountId','MailServerOut','Smtp','Dispositions','MailMessage','List','ListId','team_has_mail_queues','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','TagId','FaxAccountId','Answers','Interactions','FaxMessage','Owner','fax_interaction_has_tags','FaxInteractionId','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CmCompany','CompanyId','cm_contact_has_tags','CampaignId','OwnerId','Queue','Automation','All','OneAll','AutomationAllId','Any','OneAny','Action','Actions','AutomationId','Intervals','Extensions','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','Sound','Mohs','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','SalesforceConfiguration','Subjects','SubjectId','Descriptions','FieldId','AccountId','Subject','Description','DescriptionId','SugarcrmAccount','Field','VariableId','DeskConfiguration','int_desk_configuration_has_tags','ZohoAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','FreshdeskField','Dynamics365Field','FreshsalesConfiguration','ChatQueueReport','ToId','SessionId','ProjectId','team_has_whatsapp_queues','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','UserVoicePrefix','UserProfileSections','Resources','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','ToWhatsappAccountId','ToQueueId','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','name','utf8','sequelizeHistory','mysql','username','options','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','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','../api/automation/automation.model'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x878f,0x173));var _0xf878=function(_0x91d213,_0xd4588c){_0x91d213=_0x91d213-0x0;var _0x2bbf2b=_0x878f[_0x91d213];return _0x2bbf2b;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xf878('0x0'));var _=require(_0xf878('0x1'));var jstz=require(_0xf878('0x2'));var timezone=jstz[_0xf878('0x3')]();config[_0xf878('0x0')]=_[_0xf878('0x4')](config[_0xf878('0x0')],{'database':_0xf878('0x5'),'username':_0xf878('0x6'),'password':_0xf878('0x7'),'options':{'host':_0xf878('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf878('0x9')](),'define':{'charset':_0xf878('0xa'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_['defaultsDeep'](config[_0xf878('0xb')],{'database':'motion2','username':'xcall','password':_0xf878('0x7'),'options':{'host':_0xf878('0x8'),'port':0xcea,'dialect':_0xf878('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf878('0x9')](),'define':{'charset':_0xf878('0xa'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf878('0x0')]['database'],config[_0xf878('0x0')][_0xf878('0xd')],config[_0xf878('0x0')]['password'],config[_0xf878('0x0')][_0xf878('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf878('0xb')]['database'],config[_0xf878('0xb')][_0xf878('0xd')],config[_0xf878('0xb')]['password'],config['sequelizeHistory'][_0xf878('0xe')])};db[_0xf878('0xf')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x11'));db[_0xf878('0x12')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x13'));db[_0xf878('0x14')]=db[_0xf878('0x0')]['import'](_0xf878('0x15'));db[_0xf878('0x16')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x17'));db[_0xf878('0x18')]=db[_0xf878('0x0')]['import'](_0xf878('0x19'));db[_0xf878('0x1a')]=db[_0xf878('0x0')]['import'](_0xf878('0x1b'));db[_0xf878('0x1c')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x1d'));db[_0xf878('0x1e')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x1f'));db[_0xf878('0x20')]=db[_0xf878('0x0')]['import'](_0xf878('0x21'));db['VoiceMailMessage']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x22'));db[_0xf878('0x23')]=db[_0xf878('0x0')]['import']('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x24'));db['VoiceAgentReport']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x25'));db[_0xf878('0x26')]=db[_0xf878('0x0')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0xf878('0x27')]=db[_0xf878('0x0')]['import'](_0xf878('0x28'));db['Trunk']=db[_0xf878('0x0')]['import'](_0xf878('0x29'));db['VoiceTransferReport']=db[_0xf878('0x0')]['import'](_0xf878('0x2a'));db[_0xf878('0x2b')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x2c'));db[_0xf878('0x2d')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x2e'));db[_0xf878('0x2f')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/userChatQueue/userChatQueue.model');db[_0xf878('0x30')]=db[_0xf878('0x0')]['import'](_0xf878('0x31'));db[_0xf878('0x32')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x33'));db['UserSmsQueue']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x34'));db[_0xf878('0x35')]=db['sequelize'][_0xf878('0x10')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x36'));db[_0xf878('0x37')]=db[_0xf878('0x0')]['import'](_0xf878('0x38'));db['MailServerOut']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/mailServerOut/mailServerOut.model');db[_0xf878('0x39')]=db[_0xf878('0x0')]['import'](_0xf878('0x3a'));db[_0xf878('0x3b')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x3c'));db[_0xf878('0x3d')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x3e'));db[_0xf878('0x3f')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x40'));db['MailMessage']=db[_0xf878('0x0')]['import']('../api/mailMessage/mailMessage.model');db[_0xf878('0x41')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x42'));db[_0xf878('0x43')]=db['sequelize'][_0xf878('0x10')]('../api/mailQueueReport/mailQueueReport.model');db[_0xf878('0x44')]=db[_0xf878('0x0')]['import']('../api/dashboard/dashboard.model');db[_0xf878('0x45')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x46'));db[_0xf878('0x47')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x48'));db[_0xf878('0x49')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x4a'));db[_0xf878('0x4b')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x4c'));db['FaxMessage']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x4d'));db[_0xf878('0x4e')]=db[_0xf878('0x0')]['import'](_0xf878('0x4f'));db[_0xf878('0x50')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/faxQueueReport/faxQueueReport.model');db[_0xf878('0x51')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xf878('0x0')]['import']('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0xf878('0x0')]['import'](_0xf878('0x52'));db[_0xf878('0x53')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x54'));db[_0xf878('0x55')]=db[_0xf878('0x0')]['import'](_0xf878('0x56'));db[_0xf878('0x57')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x58'));db['OpenchannelApplication']=db['sequelize'][_0xf878('0x10')](_0xf878('0x59'));db['OpenchannelInteraction']=db[_0xf878('0x0')]['import'](_0xf878('0x5a'));db[_0xf878('0x5b')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/openchannelMessage/openchannelMessage.model');db[_0xf878('0x5c')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/openchannelQueue/openchannelQueue.model');db[_0xf878('0x5d')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x5e'));db['OpenchannelQueueReport']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x5f'));db['ChatApplication']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x60'));db[_0xf878('0x61')]=db['sequelize']['import']('../api/chatInteraction/chatInteraction.model');db[_0xf878('0x62')]=db['sequelize']['import']('../api/chatMessage/chatMessage.model');db[_0xf878('0x63')]=db[_0xf878('0x0')]['import'](_0xf878('0x64'));db[_0xf878('0x65')]=db[_0xf878('0x0')]['import']('../api/chatQueue/chatQueue.model');db[_0xf878('0x66')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x67'));db[_0xf878('0x68')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x69'));db['CmCompany']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/cmCompany/cmCompany.model');db[_0xf878('0x6a')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x6b'));db[_0xf878('0x6c')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/cmHopper/cmHopper.model');db[_0xf878('0x6d')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0xf878('0x6e')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x6f'));db[_0xf878('0x70')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x71'));db[_0xf878('0x72')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x73'));db['CmCustomField']=db['sequelize']['import'](_0xf878('0x74'));db['Action']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/action/action.model');db['Automation']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x75'));db[_0xf878('0x76')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x77'));db[_0xf878('0x78')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x79'));db[_0xf878('0x7a')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x7b'));db[_0xf878('0x7c')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/interval/interval.model');db[_0xf878('0x7d')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x7e'));db[_0xf878('0x7f')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x80'));db[_0xf878('0x81')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xf878('0x82')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x83'));db['Sound']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x84'));db[_0xf878('0x85')]=db[_0xf878('0x0')]['import']('../api/tag/tag.model');db[_0xf878('0x86')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x87'));db[_0xf878('0x88')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x89'));db[_0xf878('0x8a')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x8b'));db[_0xf878('0x8c')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x8d'));db[_0xf878('0x8e')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x8f'));db[_0xf878('0x90')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x91'));db[_0xf878('0x92')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xf878('0x93')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x94'));db[_0xf878('0x95')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0xf878('0x0')]['import'](_0xf878('0x96'));db[_0xf878('0x97')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xf878('0x98')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x99'));db['SalesforceConfiguration']=db[_0xf878('0x0')]['import'](_0xf878('0x9a'));db[_0xf878('0x9b')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x9c'));db['SugarcrmAccount']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x9d'));db[_0xf878('0x9e')]=db['sequelize'][_0xf878('0x10')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0xf878('0x9f')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa0'));db[_0xf878('0xa1')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa2'));db['DeskConfiguration']=db['sequelize']['import'](_0xf878('0xa3'));db[_0xf878('0xa4')]=db['sequelize']['import'](_0xf878('0xa5'));db['ZohoAccount']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa6'));db[_0xf878('0xa7')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xa8'));db[_0xf878('0xa9')]=db[_0xf878('0x0')]['import'](_0xf878('0xaa'));db[_0xf878('0xab')]=db[_0xf878('0x0')]['import'](_0xf878('0xac'));db[_0xf878('0xad')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xae'));db[_0xf878('0xaf')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xb0'));db[_0xf878('0xb1')]=db[_0xf878('0x0')]['import'](_0xf878('0xb2'));db['FreshdeskConfiguration']=db['sequelize'][_0xf878('0x10')](_0xf878('0xb3'));db['FreshdeskField']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xb4'));db[_0xf878('0xb5')]=db[_0xf878('0x0')]['import'](_0xf878('0xb6'));db[_0xf878('0xb7')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xb8'));db[_0xf878('0xb9')]=db[_0xf878('0x0')]['import']('../api/intVtigerField/intVtigerField.model');db[_0xf878('0xba')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xbb'));db[_0xf878('0xbc')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xbd'));db[_0xf878('0xbe')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xbf'));db[_0xf878('0xc0')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xf878('0xc1')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xc2'));db['Dynamics365Field']=db[_0xf878('0x0')]['import'](_0xf878('0xc3'));db[_0xf878('0xc4')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xc5'));db['FreshsalesConfiguration']=db['sequelize'][_0xf878('0x10')](_0xf878('0xc6'));db[_0xf878('0xc7')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xc8'));db[_0xf878('0x8c')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x8d'));db['Network']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xc9'));db['ChatQueueReport']=db[_0xf878('0x0')]['import'](_0xf878('0xca'));db[_0xf878('0xcb')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xcc'));db[_0xf878('0xcd')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xce'));db[_0xf878('0xcf')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xd0'));db[_0xf878('0xd1')]=db['sequelize']['import'](_0xf878('0xd2'));db[_0xf878('0xd3')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xd4'));db['SquareReport']=db['sequelize']['import'](_0xf878('0xd5'));db['SquareDetailsReport']=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareReportDetail/squareReportDetail.model');db[_0xf878('0xd6')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xd7'));db[_0xf878('0xd8')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xd9'));db[_0xf878('0xda')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareOdbc/squareOdbc.model');db[_0xf878('0xdb')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareProject/squareProject.model');db[_0xf878('0xdc')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xdd'));db[_0xf878('0xde')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/squareMessage/squareMessage.model');db[_0xf878('0xdf')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/team/team.model');db['License']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xe0'));db[_0xf878('0xe1')]=db['sequelize']['import'](_0xf878('0xe2'));db[_0xf878('0xe3')]=db[_0xf878('0x0')]['import']('../api/migration/migration.model');db[_0xf878('0xe4')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/attachment/attachment.model');db[_0xf878('0xe5')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xe6'));db[_0xf878('0xe7')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xe8'));db[_0xf878('0xe9')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xea'));db[_0xf878('0xeb')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xec'));db[_0xf878('0xed')]=db[_0xf878('0x0')]['import'](_0xf878('0xee'));db[_0xf878('0xef')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xf0'));db[_0xf878('0xf1')]=db['sequelize']['import'](_0xf878('0xf2'));db[_0xf878('0xf3')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xf4'));db[_0xf878('0xf5')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/userProfileSection/userProfileSection.model');db[_0xf878('0xf6')]=db[_0xf878('0x0')]['import'](_0xf878('0xf7'));db[_0xf878('0xf8')]=db[_0xf878('0x0')]['import'](_0xf878('0xf9'));db[_0xf878('0xfa')]=db['sequelize'][_0xf878('0x10')](_0xf878('0xfb'));db[_0xf878('0xfc')]=db[_0xf878('0x0')][_0xf878('0x10')]('../api/whatsappApplication/whatsappApplication.model');db[_0xf878('0xfd')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0xfe'));db[_0xf878('0xff')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x100'));db[_0xf878('0x101')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x102'));db[_0xf878('0x103')]=db[_0xf878('0x0')][_0xf878('0x10')](_0xf878('0x104'));db[_0xf878('0x105')]=db[_0xf878('0x0')]['import']('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db['sequelize'][_0xf878('0x10')]('../api/cloudProvider/cloudProvider.model');db[_0xf878('0x106')]=db[_0xf878('0x0')]['import'](_0xf878('0x107'));db[_0xf878('0x108')]=db['sequelize'][_0xf878('0x10')](_0xf878('0x109'));db['UserVoicePrefix']=db['sequelize'][_0xf878('0x10')](_0xf878('0x10a'));db[_0xf878('0xf')][_0xf878('0x10b')](db['VoiceMail'],{'as':_0xf878('0x20'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')]['hasMany'](db[_0xf878('0x1c')],{'as':'Recordings','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')]['hasMany'](db[_0xf878('0x2b')],{'as':'VoiceQueuesRt','foreignKey':_0xf878('0x10d')});db['User']['hasMany'](db[_0xf878('0x16')],{'as':'Extensions','onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0xf')][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':_0xf878('0x10f'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')]['hasMany'](db[_0xf878('0x70')],{'as':'HopperHistory','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db[_0xf878('0x110')],{'as':_0xf878('0x111'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db[_0xf878('0x61')],{'as':'ChatInteractions','foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db['SmsInteraction'],{'as':_0xf878('0x112'),'foreignKey':_0xf878('0x10d')});db['User'][_0xf878('0x10e')](db[_0xf878('0x4b')],{'as':'FaxInteractions','foreignKey':'UserId'});db['User'][_0xf878('0x10e')](db[_0xf878('0x3f')],{'as':_0xf878('0x113'),'foreignKey':_0xf878('0x10d')});db['User'][_0xf878('0x10e')](db[_0xf878('0xfd')],{'as':_0xf878('0x114'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xf')][_0xf878('0x10e')](db['UserNotification'],{'as':'UserNotifications','foreignKey':_0xf878('0x115')});db[_0xf878('0xf')][_0xf878('0x116')](db[_0xf878('0x117')],{'as':_0xf878('0x117'),'foreignKey':_0xf878('0x118')});db[_0xf878('0xf')][_0xf878('0x119')](db['ChatGroup'],{'as':_0xf878('0x11a'),'through':_0xf878('0x11b')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x6a')],{'as':_0xf878('0x11c'),'through':'cm_user_has_contacts'});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0xf1')],{'as':_0xf878('0x11d'),'through':_0xf878('0x11e')});db['User'][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x11f')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x3f')],{'as':'MailInteractions','through':_0xf878('0x120')});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0x61')],{'as':_0xf878('0x121'),'through':_0xf878('0x122')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x4b')],{'as':_0xf878('0x123'),'through':_0xf878('0x124')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x125')],{'as':_0xf878('0x112'),'through':'user_has_sms_interactions'});db['User']['belongsToMany'](db[_0xf878('0x110')],{'as':_0xf878('0x111'),'through':_0xf878('0x126')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0xfd')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db['User']['belongsToMany'](db[_0xf878('0x1a')],{'as':_0xf878('0x127'),'through':_0xf878('0x2d'),'required':![]});db[_0xf878('0xf')][_0xf878('0x119')](db['VoicePrefix'],{'as':_0xf878('0x128'),'through':'UserVoicePrefix','required':![]});db['User'][_0xf878('0x119')](db[_0xf878('0x3b')],{'as':_0xf878('0x129'),'through':_0xf878('0x30'),'required':![]});db['User'][_0xf878('0x119')](db['ChatQueue'],{'as':_0xf878('0x12a'),'through':_0xf878('0x2f'),'required':![],'hooks':!![]});db[_0xf878('0xf')]['belongsToMany'](db['FaxQueue'],{'as':_0xf878('0x12b'),'through':_0xf878('0x32'),'required':![]});db['User'][_0xf878('0x119')](db[_0xf878('0x55')],{'as':_0xf878('0x12c'),'through':_0xf878('0x12d'),'required':![]});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0x5c')],{'as':_0xf878('0x12e'),'through':'UserOpenchannelQueue','required':![]});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x105')],{'as':'WhatsappQueues','through':'UserWhatsappQueue','required':![]});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0xf1')],{'through':_0xf878('0x11e')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x5d')],{'as':'ChatWebsites','through':_0xf878('0x12f')});db[_0xf878('0xf')][_0xf878('0x119')](db[_0xf878('0x47')],{'as':_0xf878('0x130'),'through':_0xf878('0x131')});db['User'][_0xf878('0x119')](db['MailAccount'],{'as':_0xf878('0x132'),'through':_0xf878('0x133')});db[_0xf878('0xf')][_0xf878('0x119')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db[_0xf878('0xf')][_0xf878('0x119')](db['SmsAccount'],{'as':_0xf878('0x134'),'through':_0xf878('0x135')});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0xfa')],{'as':_0xf878('0x136'),'through':_0xf878('0x137')});db[_0xf878('0xf')]['belongsToMany'](db[_0xf878('0xdb')],{'as':_0xf878('0x138'),'through':_0xf878('0x139')});db[_0xf878('0x12')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':'SpiedAgents','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x13a')});db[_0xf878('0x14')][_0xf878('0x10e')](db[_0xf878('0x16')],{'onDelete':_0xf878('0x10c')});db[_0xf878('0x16')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':_0xf878('0x13b'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x18')][_0xf878('0x119')](db['Sound'],{'as':_0xf878('0x13c'),'through':_0xf878('0x13d')});db[_0xf878('0x1a')][_0xf878('0x10e')](db[_0xf878('0x2b')],{'as':_0xf878('0x13e'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db['CmHopper'],{'as':_0xf878('0x140'),'foreignKey':_0xf878('0x13f')});db['VoiceQueue'][_0xf878('0x10e')](db['CmHopperFinal'],{'as':_0xf878('0x10f'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db[_0xf878('0x70')],{'as':_0xf878('0x141'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db['ReportAgentPreview'],{'as':_0xf878('0x72'),'foreignKey':_0xf878('0x13f')});db[_0xf878('0x1a')][_0xf878('0x10e')](db['CmHopperBlack'],{'as':_0xf878('0x142'),'foreignKey':_0xf878('0x13f')});db['VoiceQueue']['hasMany'](db[_0xf878('0xd1')],{'as':_0xf878('0x143'),'foreignKey':_0xf878('0x13f')});db['VoiceQueue'][_0xf878('0x116')](db[_0xf878('0x144')],{'as':_0xf878('0x144'),'foreignKey':_0xf878('0x145')});db['VoiceQueue']['belongsTo'](db[_0xf878('0x144')],{'as':_0xf878('0x146'),'foreignKey':_0xf878('0x147')});db['VoiceQueue'][_0xf878('0x116')](db['Interval'],{'as':_0xf878('0x7c'),'foreignKey':_0xf878('0x148')});db[_0xf878('0x1a')][_0xf878('0x116')](db[_0xf878('0x7d')],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x1a')]['belongsToMany'](db[_0xf878('0xf1')],{'as':_0xf878('0x11d'),'through':'voice_queues_has_cm_lists'});db[_0xf878('0x1a')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x2d')});db[_0xf878('0x1a')][_0xf878('0x119')](db[_0xf878('0xdf')],{'as':_0xf878('0x14c'),'through':_0xf878('0x106')});db[_0xf878('0x1a')][_0xf878('0x119')](db[_0xf878('0xf1')],{'as':_0xf878('0x14d'),'through':_0xf878('0x14e')});db[_0xf878('0x1c')]['belongsTo'](db[_0xf878('0xf')],{'as':_0xf878('0xf'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x1e')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':'User','foreignKey':_0xf878('0x10d')});db[_0xf878('0x20')][_0xf878('0x10e')](db[_0xf878('0x14f')],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x151'),'sourceKey':_0xf878('0x152')});db['VoiceMailMessage'][_0xf878('0x116')](db[_0xf878('0x20')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0xf878('0x23')][_0xf878('0x10e')](db['VoiceQueueReport'],{'as':_0xf878('0x153'),'foreignKey':'uniqueid','constraints':![]});db[_0xf878('0x23')][_0xf878('0x10e')](db[_0xf878('0x154')],{'as':_0xf878('0x155'),'foreignKey':_0xf878('0x156'),'constraints':![]});db[_0xf878('0x23')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0xf'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x23')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x37')][_0xf878('0x116')](db[_0xf878('0x39')],{'as':_0xf878('0x39'),'foreignKey':_0xf878('0x159')});db[_0xf878('0x15a')][_0xf878('0x116')](db[_0xf878('0x39')],{'as':_0xf878('0x39'),'foreignKey':_0xf878('0x159')});db[_0xf878('0x39')][_0xf878('0x10b')](db[_0xf878('0x37')],{'as':'Imap','onDelete':_0xf878('0x10c')});db[_0xf878('0x39')]['hasOne'](db[_0xf878('0x15a')],{'as':_0xf878('0x15b'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':'Answers','foreignKey':_0xf878('0x159')});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x15d')],{'as':_0xf878('0x150'),'foreignKey':'MailAccountId'});db[_0xf878('0x39')][_0xf878('0x10e')](db['MailInteraction'],{'as':'Interactions'});db[_0xf878('0x39')][_0xf878('0x10e')](db[_0xf878('0x41')],{'as':_0xf878('0x13b')});db[_0xf878('0x39')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db['MailAccount'][_0xf878('0x116')](db[_0xf878('0x86')],{'as':_0xf878('0x86'),'foreignKey':'TemplateId'});db['MailAccount'][_0xf878('0x116')](db['Pause'],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x39')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x133')});db['MailQueue'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':'Agents','through':_0xf878('0x30')});db[_0xf878('0x3b')][_0xf878('0x119')](db['Team'],{'through':_0xf878('0x160'),'as':_0xf878('0x14c')});db[_0xf878('0x3f')][_0xf878('0x10e')](db[_0xf878('0x15d')],{'as':'Messages','onDelete':_0xf878('0x10c'),'foreignKey':'MailInteractionId'});db['MailInteraction']['belongsTo'](db['MailAccount'],{'as':_0xf878('0x161'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0xf878('0x116')](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x3f')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':'Owner','foreignKey':_0xf878('0x10d')});db[_0xf878('0x3f')]['belongsToMany'](db[_0xf878('0x85')],{'through':_0xf878('0x162'),'as':_0xf878('0x163')});db[_0xf878('0x3f')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':'mail_interaction_has_tags','as':_0xf878('0x164')});db[_0xf878('0x3f')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':'user_has_mail_interactions','foreignKey':_0xf878('0x166')});db['MailMessage'][_0xf878('0x10e')](db[_0xf878('0xe4')],{'as':_0xf878('0x167'),'onDelete':_0xf878('0x10c')});db['MailMessage'][_0xf878('0x116')](db['User'],{'as':_0xf878('0xf')});db[_0xf878('0x15d')]['belongsTo'](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':'Contact'});db[_0xf878('0x15d')]['belongsTo'](db['MailInteraction'],{'as':'Interaction','foreignKey':_0xf878('0x166')});db[_0xf878('0x15d')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0xf878('0x159')});db['MailMessage'][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':_0xf878('0x5d'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x15d')][_0xf878('0x116')](db['ChatOfflineMessage'],{'as':_0xf878('0x63'),'foreignKey':_0xf878('0x169')});db[_0xf878('0x41')]['belongsTo'](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x41')][_0xf878('0x116')](db['MailQueue'],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x41')][_0xf878('0x116')](db[_0xf878('0x39')],{'onDelete':'restrict'});db[_0xf878('0x41')][_0xf878('0x116')](db[_0xf878('0x7c')],{'onDelete':'restrict','foreignKey':_0xf878('0x148')});db['MailApplication'][_0xf878('0x116')](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x39')],{});db[_0xf878('0x43')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':'ContactId'});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x3f')],{});db['MailQueueReport'][_0xf878('0x116')](db[_0xf878('0x15d')],{});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x43')][_0xf878('0x116')](db[_0xf878('0x3b')],{});db[_0xf878('0x44')][_0xf878('0x10e')](db[_0xf878('0x45')],{'as':'Items','onDelete':'cascade'});db[_0xf878('0x47')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x16c'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x47')][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':_0xf878('0x16d'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0xf878('0x10e')](db['FaxInteraction'],{'as':_0xf878('0x16e')});db[_0xf878('0x47')][_0xf878('0x10e')](db['FaxApplication'],{'as':_0xf878('0x13b')});db[_0xf878('0x47')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':'Exntensions','onDelete':_0xf878('0x10c')});db['FaxAccount'][_0xf878('0x10e')](db[_0xf878('0x16f')],{'as':_0xf878('0x150')});db[_0xf878('0x47')][_0xf878('0x116')](db['Trunk'],{'as':_0xf878('0x144')});db['FaxAccount'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':'List','foreignKey':'ListId'});db['FaxAccount'][_0xf878('0x116')](db[_0xf878('0x7d')],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x47')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':'Agents','through':_0xf878('0x131')});db[_0xf878('0x49')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db['FaxApplication'][_0xf878('0x116')](db['FaxQueue'],{'onDelete':_0xf878('0x16a')});db['FaxApplication'][_0xf878('0x116')](db[_0xf878('0x47')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x49')][_0xf878('0x116')](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db['FaxInteraction']['hasMany'](db[_0xf878('0x16f')],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':'FaxInteractionId'});db[_0xf878('0x4b')][_0xf878('0x116')](db[_0xf878('0x47')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x16c')});db[_0xf878('0x4b')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x4b')][_0xf878('0x116')](db['User'],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x4b')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x171'),'as':_0xf878('0x163')});db[_0xf878('0x4b')]['belongsToMany'](db[_0xf878('0x85')],{'through':_0xf878('0x171'),'as':'ThroughTags'});db[_0xf878('0x4b')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':'Users','through':_0xf878('0x124'),'foreignKey':_0xf878('0x172')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0xf')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0x4b')],{'as':_0xf878('0x173'),'foreignKey':_0xf878('0x172')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0x6a')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x157')});db[_0xf878('0x16f')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xf878('0x174')});db[_0xf878('0x16f')][_0xf878('0x116')](db[_0xf878('0x47')],{'as':'Account','foreignKey':_0xf878('0x16c')});db['FaxQueue'][_0xf878('0x119')](db['User'],{'as':_0xf878('0x14b'),'through':'UserFaxQueue'});db['FaxQueue']['belongsToMany'](db['Team'],{'through':_0xf878('0x175'),'as':_0xf878('0x14c')});db[_0xf878('0x50')]['belongsTo'](db['FaxAccount'],{});db[_0xf878('0x50')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x50')][_0xf878('0x116')](db['CmContact'],{'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x50')][_0xf878('0x116')](db[_0xf878('0x4b')],{});db[_0xf878('0x50')][_0xf878('0x116')](db['FaxMessage'],{});db[_0xf878('0x50')][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x50')][_0xf878('0x116')](db['FaxQueue'],{});db['SmsAccount']['hasMany'](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x176'),'onDelete':_0xf878('0x10c')});db['SmsAccount'][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':'Answers','foreignKey':_0xf878('0x176')});db[_0xf878('0x51')][_0xf878('0x10e')](db['SmsMessage'],{'as':'Messages','foreignKey':_0xf878('0x176')});db[_0xf878('0x51')][_0xf878('0x10e')](db[_0xf878('0x125')],{'as':'Interactions'});db[_0xf878('0x51')]['hasMany'](db[_0xf878('0x177')],{'as':_0xf878('0x13b')});db['SmsAccount'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x51')]['belongsTo'](db[_0xf878('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xf878('0x14a')});db[_0xf878('0x51')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x14b'),'through':_0xf878('0x135')});db[_0xf878('0x177')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0x177')]['belongsTo'](db[_0xf878('0x55')],{'onDelete':_0xf878('0x16a')});db['SmsApplication'][_0xf878('0x116')](db['SmsAccount'],{'onDelete':_0xf878('0x16a')});db['SmsApplication'][_0xf878('0x116')](db[_0xf878('0x7c')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x148')});db[_0xf878('0x177')]['belongsTo'](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':'TagId'});db[_0xf878('0x125')]['hasMany'](db['SmsMessage'],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x178')});db[_0xf878('0x125')][_0xf878('0x116')](db[_0xf878('0x51')],{'as':'Account','foreignKey':_0xf878('0x176')});db['SmsInteraction'][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x125')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0x125')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x179'),'as':_0xf878('0x163')});db[_0xf878('0x125')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':'sms_interaction_has_tags','as':_0xf878('0x164')});db[_0xf878('0x125')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x165'),'through':'user_has_sms_interactions','foreignKey':_0xf878('0x178')});db[_0xf878('0x53')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0xf')});db['SmsMessage'][_0xf878('0x116')](db[_0xf878('0x6a')],{'onDelete':'cascade','as':'Contact'});db[_0xf878('0x53')]['belongsTo'](db[_0xf878('0x125')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x173'),'foreignKey':_0xf878('0x178')});db[_0xf878('0x53')][_0xf878('0x116')](db[_0xf878('0x51')],{'as':_0xf878('0x161'),'foreignKey':'SmsAccountId'});db['SmsQueue']['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x12d'),'foreignKey':_0xf878('0x17a')});db[_0xf878('0x55')][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x17b'),'as':_0xf878('0x14c')});db[_0xf878('0x57')]['hasMany'](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x17c'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x57')][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':_0xf878('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0xf878('0x57')]['hasMany'](db[_0xf878('0x110')],{'as':_0xf878('0x16e'),'foreignKey':_0xf878('0x17c')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0xf878('0x150'),'foreignKey':_0xf878('0x17c')});db[_0xf878('0x57')][_0xf878('0x10e')](db[_0xf878('0x17d')],{'as':'Applications','foreignKey':_0xf878('0x17c')});db[_0xf878('0x57')][_0xf878('0x116')](db['CmList'],{'as':'List','foreignKey':_0xf878('0x15f')});db[_0xf878('0x57')][_0xf878('0x116')](db[_0xf878('0x7d')],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x57')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':'user_has_openchannel_accounts'});db[_0xf878('0x17d')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db['OpenchannelApplication'][_0xf878('0x116')](db[_0xf878('0x5c')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x17e')});db[_0xf878('0x17d')][_0xf878('0x116')](db[_0xf878('0x57')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x17c')});db['OpenchannelApplication'][_0xf878('0x116')](db[_0xf878('0x7c')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x148')});db['OpenchannelApplication'][_0xf878('0x116')](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db[_0xf878('0x110')][_0xf878('0x10e')](db[_0xf878('0x5b')],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x17f')});db[_0xf878('0x110')][_0xf878('0x116')](db[_0xf878('0x57')],{'as':_0xf878('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0xf878('0x110')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x110')][_0xf878('0x116')](db['User'],{'as':_0xf878('0x170'),'foreignKey':'UserId'});db[_0xf878('0x110')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x180'),'as':_0xf878('0x163')});db[_0xf878('0x110')][_0xf878('0x119')](db['Tag'],{'through':_0xf878('0x180'),'as':_0xf878('0x164')});db[_0xf878('0x110')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':_0xf878('0x126'),'foreignKey':_0xf878('0x17f')});db[_0xf878('0x5b')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0xf')});db[_0xf878('0x5b')][_0xf878('0x116')](db[_0xf878('0x6a')],{'onDelete':_0xf878('0x10c'),'as':'Contact'});db[_0xf878('0x5b')]['belongsTo'](db[_0xf878('0x110')],{'onDelete':'cascade','as':_0xf878('0x173'),'foreignKey':_0xf878('0x17f')});db[_0xf878('0x5b')][_0xf878('0x116')](db['Attachment'],{'as':'Attachment','foreignKey':_0xf878('0x174')});db['OpenchannelMessage'][_0xf878('0x116')](db[_0xf878('0x57')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x17c')});db[_0xf878('0x5c')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf878('0x35'),'foreignKey':'OpenchannelQueueId'});db[_0xf878('0x5c')][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x181'),'as':'Teams'});db['ChatWebsite'][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x168'),'onDelete':_0xf878('0x10c')});db['ChatWebsite'][_0xf878('0x10e')](db[_0xf878('0x76')],{'as':_0xf878('0x16d'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x5d')]['hasMany'](db[_0xf878('0x68')],{'as':_0xf878('0x182')});db[_0xf878('0x5d')][_0xf878('0x10e')](db[_0xf878('0x61')],{'as':_0xf878('0x16e')});db[_0xf878('0x5d')][_0xf878('0x10e')](db[_0xf878('0x183')],{'as':_0xf878('0x13b')});db['ChatWebsite'][_0xf878('0x10e')](db[_0xf878('0x62')],{'as':_0xf878('0x150')});db['ChatWebsite'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':'ListId'});db[_0xf878('0x5d')][_0xf878('0x116')](db['Interval'],{'as':'Interval','foreignKey':_0xf878('0x148')});db[_0xf878('0x5d')]['belongsTo'](db[_0xf878('0x39')],{'as':_0xf878('0x39'),'foreignKey':_0xf878('0x159')});db['ChatWebsite'][_0xf878('0x116')](db['Pause'],{'as':_0xf878('0x149'),'foreignKey':_0xf878('0x14a')});db[_0xf878('0x5d')]['belongsToMany'](db['User'],{'as':_0xf878('0x14b'),'through':'user_has_chat_websites'});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0x57')],{});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':'List','foreignKey':'ListId'});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x184')]['belongsTo'](db[_0xf878('0x110')],{});db[_0xf878('0x184')][_0xf878('0x116')](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x184')][_0xf878('0x116')](db[_0xf878('0x5c')],{});db[_0xf878('0x183')][_0xf878('0x116')](db['User'],{'as':_0xf878('0x185'),'foreignKey':'UserId','onDelete':'restrict'});db[_0xf878('0x183')][_0xf878('0x116')](db[_0xf878('0x65')],{'as':'Queue','foreignKey':_0xf878('0x186'),'onDelete':'restrict'});db[_0xf878('0x183')][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0xf878('0x183')]['belongsTo'](db[_0xf878('0x85')],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x16b')});db[_0xf878('0x61')][_0xf878('0x10e')](db['ChatMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0xf878('0x187')});db[_0xf878('0x61')][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':'Account','foreignKey':_0xf878('0x168')});db[_0xf878('0x61')]['belongsTo'](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':'ContactId'});db['ChatInteraction']['belongsTo'](db[_0xf878('0xf')],{'as':_0xf878('0x170'),'foreignKey':'UserId'});db[_0xf878('0x61')]['belongsToMany'](db['Tag'],{'through':_0xf878('0x188'),'as':_0xf878('0x163')});db[_0xf878('0x61')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x188'),'as':_0xf878('0x164')});db[_0xf878('0x61')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':_0xf878('0x122'),'foreignKey':'ChatInteractionId'});db[_0xf878('0x62')][_0xf878('0x116')](db['User'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0xf')});db[_0xf878('0x62')]['belongsTo'](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x62')][_0xf878('0x116')](db[_0xf878('0x61')],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x173'),'foreignKey':_0xf878('0x187')});db['ChatMessage'][_0xf878('0x116')](db[_0xf878('0xe4')],{'as':_0xf878('0xe4'),'foreignKey':_0xf878('0x174')});db[_0xf878('0x62')][_0xf878('0x116')](db[_0xf878('0x5d')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x63')][_0xf878('0x10e')](db['Attachment'],{'as':_0xf878('0x167'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x63')][_0xf878('0x116')](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x63')][_0xf878('0x116')](db['ChatWebsite'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x168')});db[_0xf878('0x65')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xf878('0x2f'),'hooks':!![]});db[_0xf878('0x65')][_0xf878('0x119')](db['Team'],{'through':_0xf878('0x189'),'as':_0xf878('0x14c')});db[_0xf878('0x66')][_0xf878('0x10e')](db[_0xf878('0xcb')],{'as':_0xf878('0x150'),'foreignKey':_0xf878('0x18a'),'onDelete':'cascade'});db['ChatGroup'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x13e'),'through':_0xf878('0x11b')});db['ChatProactiveAction']['belongsTo'](db[_0xf878('0x5d')],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0xf878('0x18b')][_0xf878('0x10e')](db[_0xf878('0x6a')],{'as':_0xf878('0x11c'),'foreignKey':_0xf878('0x18c')});db[_0xf878('0x6a')]['hasMany'](db[_0xf878('0x6c')],{'as':_0xf878('0x140'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':'HopperFinals','foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')]['hasMany'](db['CmHopperHistory'],{'as':_0xf878('0x141'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x72')],{'as':_0xf878('0x72'),'foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')]['hasMany'](db[_0xf878('0xd1')],{'as':'JscriptySessions','foreignKey':_0xf878('0x158')});db[_0xf878('0x6a')]['hasMany'](db[_0xf878('0x110')],{'as':_0xf878('0x111'),'foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x61')],{'as':_0xf878('0x121'),'foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x125')],{'as':_0xf878('0x112'),'foreignKey':_0xf878('0x158'),'onDelete':_0xf878('0x16a')});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x4b')],{'as':_0xf878('0x123'),'foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x10e')](db[_0xf878('0x3f')],{'as':'MailInteractions','foreignKey':_0xf878('0x158'),'onDelete':'restrict'});db[_0xf878('0x6a')][_0xf878('0x116')](db[_0xf878('0x18b')],{'as':'Company','foreignKey':'CompanyId'});db['CmContact'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6a')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':'cm_user_has_contacts'});db['CmContact'][_0xf878('0x119')](db['Tag'],{'as':'Tags','through':_0xf878('0x18d')});db['CmContact'][_0xf878('0x119')](db['Tag'],{'through':_0xf878('0x18d'),'as':_0xf878('0x164')});db[_0xf878('0x6c')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6c')]['belongsTo'](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f'),'onDelete':_0xf878('0x10c')});db['CmHopper'][_0xf878('0x116')](db[_0xf878('0xf')],{'as':'Agent','foreignKey':'UserId'});db[_0xf878('0x6c')][_0xf878('0x116')](db[_0xf878('0x1a')],{'as':'Queue','foreignKey':_0xf878('0x13f'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6c')]['belongsTo'](db[_0xf878('0xe1')],{'as':_0xf878('0xe1'),'foreignKey':_0xf878('0x18e'),'onDelete':_0xf878('0x10c')});db['CmHopper'][_0xf878('0x116')](db['User'],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x18f')});db['CmHopperBlack'][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6d')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':'ListId','onDelete':'cascade'});db[_0xf878('0x6d')][_0xf878('0x116')](db[_0xf878('0x1a')],{'as':_0xf878('0x190'),'foreignKey':_0xf878('0x13f'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x6d')]['belongsTo'](db[_0xf878('0xe1')],{'as':_0xf878('0xe1'),'foreignKey':_0xf878('0x18e'),'onDelete':_0xf878('0x10c')});db[_0xf878('0x191')][_0xf878('0x10e')](db['Condition'],{'as':{'plural':_0xf878('0x192'),'singular':_0xf878('0x193')},'foreignKey':_0xf878('0x194'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x191')][_0xf878('0x10e')](db['Condition'],{'as':{'plural':_0xf878('0x195'),'singular':_0xf878('0x196')},'foreignKey':'AutomationAnyId','onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x191')][_0xf878('0x10e')](db[_0xf878('0x197')],{'as':_0xf878('0x198'),'foreignKey':_0xf878('0x199'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x78')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':'ParentId','onDelete':_0xf878('0x10c')});db[_0xf878('0x7c')]['hasMany'](db[_0xf878('0x7c')],{'as':_0xf878('0x19a'),'foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0xf878('0x7c')]['hasMany'](db['VoiceExtension'],{'as':_0xf878('0x19b'),'foreignKey':_0xf878('0x148'),'onDelete':_0xf878('0x16a')});db[_0xf878('0x7c')][_0xf878('0x10e')](db[_0xf878('0x41')],{'as':'MailApplications','foreignKey':_0xf878('0x148')});db[_0xf878('0x7c')]['hasMany'](db[_0xf878('0x183')],{'as':_0xf878('0x19c'),'foreignKey':'IntervalId'});db[_0xf878('0x7c')][_0xf878('0x10e')](db[_0xf878('0x49')],{'as':_0xf878('0x19d'),'foreignKey':_0xf878('0x148')});db[_0xf878('0x7c')][_0xf878('0x10e')](db['SmsApplication'],{'as':_0xf878('0x19e'),'foreignKey':'IntervalId'});db[_0xf878('0x82')][_0xf878('0x116')](db[_0xf878('0x39')],{});db[_0xf878('0x82')][_0xf878('0x116')](db[_0xf878('0x92')],{'foreignKey':_0xf878('0x19f')});db[_0xf878('0x82')][_0xf878('0x116')](db[_0xf878('0x90')],{'foreignKey':_0xf878('0x1a0')});db[_0xf878('0x1a1')]['belongsToMany'](db[_0xf878('0x18')],{'as':_0xf878('0x1a2'),'through':_0xf878('0x13d'),'onDelete':_0xf878('0x16a')});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x6a')],{'through':'cm_contact_has_tags'});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x61')],{'through':_0xf878('0x188')});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x3f')],{'through':_0xf878('0x162')});db[_0xf878('0x85')][_0xf878('0x119')](db[_0xf878('0x125')],{'through':_0xf878('0x179')});db[_0xf878('0x85')][_0xf878('0x119')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xf878('0x85')][_0xf878('0x119')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xf878('0xfd')],{'through':'whatsapp_interaction_has_tags'});db[_0xf878('0x88')]['hasMany'](db[_0xf878('0x7a')],{'as':{'plural':'AllConditions','singular':_0xf878('0x1a3')},'foreignKey':_0xf878('0x1a4'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x88')][_0xf878('0x10e')](db['Condition'],{'as':{'plural':_0xf878('0x1a5'),'singular':_0xf878('0x1a6')},'foreignKey':_0xf878('0x1a7'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x88')][_0xf878('0x10e')](db[_0xf878('0x197')],{'as':_0xf878('0x198'),'foreignKey':_0xf878('0x1a8'),'onDelete':_0xf878('0x10c'),'hooks':!![]});db[_0xf878('0x90')][_0xf878('0x10e')](db[_0xf878('0x1a9')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1a0'),'hooks':!![]});db[_0xf878('0x92')][_0xf878('0x10e')](db[_0xf878('0x1a9')],{'as':_0xf878('0x1aa'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xf878('0x95')][_0xf878('0x10e')](db[_0xf878('0x1a9')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1ab')});db[_0xf878('0x1a9')]['belongsTo'](db[_0xf878('0x95')],{'foreignKey':'MetricId'});db[_0xf878('0x98')][_0xf878('0x10e')](db['SalesforceConfiguration'],{'as':_0xf878('0x1ac'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xf878('0x1ad')][_0xf878('0x10e')](db[_0xf878('0x9b')],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1ad')][_0xf878('0x10e')](db['SalesforceField'],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':'DescriptionId'});db[_0xf878('0x1ad')][_0xf878('0x10e')](db[_0xf878('0x9b')],{'as':_0xf878('0x1aa'),'onDelete':'cascade','foreignKey':_0xf878('0x1b1')});db['SalesforceConfiguration'][_0xf878('0x116')](db[_0xf878('0x98')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x9b')][_0xf878('0x10e')](db['SalesforceField'],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x9b')][_0xf878('0x10e')](db[_0xf878('0x9b')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0xf878('0x1b1')});db[_0xf878('0x9b')][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0x1b6')][_0xf878('0x10e')](db[_0xf878('0x9e')],{'as':'Configurations','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db['SugarcrmConfiguration'][_0xf878('0x10e')](db['SugarcrmField'],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1af')});db['SugarcrmConfiguration']['hasMany'](db[_0xf878('0x9f')],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0x9e')][_0xf878('0x10e')](db[_0xf878('0x9f')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x9e')][_0xf878('0x116')](db[_0xf878('0x1b6')],{'as':_0xf878('0x161'),'foreignKey':'AccountId'});db[_0xf878('0x9f')][_0xf878('0x10e')](db[_0xf878('0x9f')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x9f')]['hasMany'](db[_0xf878('0x9f')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0x9f')][_0xf878('0x10e')](db[_0xf878('0x9f')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x9f')][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':'Variable','foreignKey':_0xf878('0x1b8')});db[_0xf878('0xa1')][_0xf878('0x10e')](db[_0xf878('0x1b9')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1b9')][_0xf878('0x10e')](db[_0xf878('0xa4')],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':'SubjectId'});db[_0xf878('0x1b9')]['hasMany'](db[_0xf878('0xa4')],{'as':_0xf878('0x1b0'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xf878('0x1b9')]['hasMany'](db[_0xf878('0xa4')],{'as':'Fields','onDelete':_0xf878('0x10c'),'foreignKey':'FieldId'});db[_0xf878('0x1b9')][_0xf878('0x116')](db[_0xf878('0xa1')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1b9')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x1ba')});db[_0xf878('0xa4')][_0xf878('0x10e')](db['DeskField'],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xa4')][_0xf878('0x10e')](db[_0xf878('0xa4')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xa4')][_0xf878('0x10e')](db[_0xf878('0xa4')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0xa4')][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0x1bb')][_0xf878('0x10e')](db[_0xf878('0xa7')],{'as':'Configurations','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xa7')]['hasMany'](db[_0xf878('0xa9')],{'as':_0xf878('0x1ae'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xf878('0xa7')][_0xf878('0x10e')](db[_0xf878('0xa9')],{'as':_0xf878('0x1b0'),'onDelete':'cascade','foreignKey':_0xf878('0x1b5')});db[_0xf878('0xa7')][_0xf878('0x10e')](db['ZohoField'],{'as':_0xf878('0x1aa'),'onDelete':'cascade','foreignKey':_0xf878('0x1b1')});db[_0xf878('0xa7')]['belongsTo'](db[_0xf878('0x1bb')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xa9')]['hasMany'](db[_0xf878('0xa9')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xa9')][_0xf878('0x10e')](db['ZohoField'],{'as':_0xf878('0x1b4'),'foreignKey':'DescriptionId'});db[_0xf878('0xa9')]['hasMany'](db['ZohoField'],{'as':'Field','foreignKey':_0xf878('0x1b1')});db['ZohoField'][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0xab')][_0xf878('0x10e')](db[_0xf878('0xad')],{'as':_0xf878('0x1ac'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db['ZendeskConfiguration'][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1ae'),'foreignKey':'SubjectId'});db[_0xf878('0xad')]['hasMany'](db['ZendeskField'],{'as':_0xf878('0x1b0'),'foreignKey':'DescriptionId'});db[_0xf878('0xad')]['hasMany'](db[_0xf878('0xaf')],{'as':_0xf878('0x1aa'),'foreignKey':'FieldId'});db[_0xf878('0xad')][_0xf878('0x116')](db['ZendeskAccount'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xad')]['belongsToMany'](db['Tag'],{'through':_0xf878('0x1bc')});db['ZendeskField'][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xaf')][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xaf')][_0xf878('0x10e')](db[_0xf878('0xaf')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db['ZendeskField'][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db['FreshdeskAccount'][_0xf878('0x10e')](db[_0xf878('0x1bd')],{'as':_0xf878('0x1ac'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1bd')]['hasMany'](db['FreshdeskField'],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1bd')][_0xf878('0x10e')](db['FreshdeskField'],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0x1bd')][_0xf878('0x10e')](db['FreshdeskField'],{'as':_0xf878('0x1aa'),'onDelete':_0xf878('0x10c'),'foreignKey':'FieldId'});db[_0xf878('0x1bd')][_0xf878('0x116')](db[_0xf878('0xb1')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1bd')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x1be')});db[_0xf878('0x1bf')][_0xf878('0x10e')](db[_0xf878('0x1bf')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1bf')][_0xf878('0x10e')](db[_0xf878('0x1bf')],{'as':_0xf878('0x1b4'),'foreignKey':'DescriptionId'});db[_0xf878('0x1bf')][_0xf878('0x10e')](db[_0xf878('0x1bf')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x1bf')][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db[_0xf878('0xb5')][_0xf878('0x10e')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xb7')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1ae'),'foreignKey':_0xf878('0x1af')});db['VtigerConfiguration'][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1b0'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xb7')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':'Fields','foreignKey':'FieldId'});db[_0xf878('0xb7')]['belongsTo'](db['VtigerAccount'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db['VtigerField'][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':'Subject','foreignKey':_0xf878('0x1af')});db[_0xf878('0xb9')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1b4'),'foreignKey':'DescriptionId'});db[_0xf878('0xb9')][_0xf878('0x10e')](db[_0xf878('0xb9')],{'as':_0xf878('0x1b7'),'foreignKey':'FieldId'});db['VtigerField']['belongsTo'](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':'VariableId'});db[_0xf878('0xba')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0xf878('0xbc')][_0xf878('0x10e')](db[_0xf878('0xbe')],{'as':_0xf878('0x1ae'),'foreignKey':'SubjectId'});db[_0xf878('0xbc')][_0xf878('0x10e')](db['ServicenowField'],{'as':_0xf878('0x1b0'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0xf878('0xbe')],{'as':_0xf878('0x1aa'),'foreignKey':_0xf878('0x1b1')});db['ServicenowConfiguration']['belongsTo'](db['ServicenowAccount'],{'as':_0xf878('0x161'),'foreignKey':'AccountId'});db[_0xf878('0xbe')]['hasMany'](db[_0xf878('0xbe')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xbe')][_0xf878('0x10e')](db[_0xf878('0xbe')],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db['ServicenowField']['hasMany'](db['ServicenowField'],{'as':'Field','foreignKey':_0xf878('0x1b1')});db[_0xf878('0xbe')][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db[_0xf878('0xc0')][_0xf878('0x10e')](db[_0xf878('0xc1')],{'as':_0xf878('0x1ac'),'onDelete':'cascade','foreignKey':_0xf878('0x1b2')});db[_0xf878('0xc1')][_0xf878('0x10e')](db[_0xf878('0x1c0')],{'as':_0xf878('0x1ae'),'onDelete':_0xf878('0x10c'),'foreignKey':'SubjectId'});db[_0xf878('0xc1')][_0xf878('0x10e')](db['Dynamics365Field'],{'as':_0xf878('0x1b0'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b5')});db[_0xf878('0xc1')][_0xf878('0x10e')](db['Dynamics365Field'],{'as':_0xf878('0x1aa'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0xc1')][_0xf878('0x116')](db[_0xf878('0xc0')],{'as':'Account','foreignKey':_0xf878('0x1b2')});db[_0xf878('0x1c0')][_0xf878('0x10e')](db['Dynamics365Field'],{'as':_0xf878('0x1b3'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0xf878('0x10e')](db[_0xf878('0x1c0')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xf878('0x1c0')][_0xf878('0x10e')](db[_0xf878('0x1c0')],{'as':_0xf878('0x1b7'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x1c0')][_0xf878('0x116')](db[_0xf878('0x8a')],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db['FreshsalesAccount'][_0xf878('0x10e')](db[_0xf878('0x1c1')],{'as':_0xf878('0x1ac'),'onDelete':_0xf878('0x10c'),'foreignKey':'AccountId'});db[_0xf878('0x1c1')]['hasMany'](db['FreshsalesField'],{'as':_0xf878('0x1ae'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0x1c1')]['hasMany'](db[_0xf878('0xc7')],{'as':'Descriptions','foreignKey':_0xf878('0x1b5')});db[_0xf878('0x1c1')][_0xf878('0x10e')](db[_0xf878('0xc7')],{'as':_0xf878('0x1aa'),'foreignKey':_0xf878('0x1b1')});db[_0xf878('0x1c1')]['belongsTo'](db[_0xf878('0xc4')],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1b2')});db[_0xf878('0xc7')]['hasMany'](db[_0xf878('0xc7')],{'as':_0xf878('0x1b3'),'foreignKey':_0xf878('0x1af')});db[_0xf878('0xc7')][_0xf878('0x10e')](db['FreshsalesField'],{'as':_0xf878('0x1b4'),'foreignKey':_0xf878('0x1b5')});db['FreshsalesField'][_0xf878('0x10e')](db[_0xf878('0xc7')],{'as':_0xf878('0x1b7'),'foreignKey':'FieldId'});db['FreshsalesField'][_0xf878('0x116')](db['Variable'],{'as':_0xf878('0x8a'),'foreignKey':_0xf878('0x1b8')});db[_0xf878('0x1c2')][_0xf878('0x116')](db[_0xf878('0x5d')],{});db['ChatQueueReport'][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x1c2')]['belongsTo'](db[_0xf878('0x6a')],{'as':'Contact','foreignKey':_0xf878('0x158')});db[_0xf878('0x1c2')][_0xf878('0x116')](db[_0xf878('0x61')],{});db[_0xf878('0x1c2')][_0xf878('0x116')](db['ChatMessage'],{});db[_0xf878('0x1c2')][_0xf878('0x116')](db[_0xf878('0xf')],{});db[_0xf878('0x1c2')]['belongsTo'](db[_0xf878('0x65')],{});db['ChatInternalMessage'][_0xf878('0x116')](db['User'],{'onDelete':_0xf878('0x10c'),'foreignKey':'FromId'});db[_0xf878('0xcb')][_0xf878('0x116')](db['User'],{'onDelete':'cascade','foreignKey':_0xf878('0x1c3')});db[_0xf878('0xd1')][_0xf878('0x10e')](db[_0xf878('0xcf')],{'foreignKey':_0xf878('0x1c4'),'onDelete':'cascade'});db[_0xf878('0xd1')][_0xf878('0x10e')](db[_0xf878('0xcd')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xf878('0xd3')][_0xf878('0x116')](db[_0xf878('0x51')],{});db[_0xf878('0xd3')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db['SmsQueueReport'][_0xf878('0x116')](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':'ContactId'});db[_0xf878('0xd3')]['belongsTo'](db[_0xf878('0x125')],{});db['SmsQueueReport']['belongsTo'](db[_0xf878('0x53')],{});db[_0xf878('0xd3')][_0xf878('0x116')](db['User'],{});db[_0xf878('0xd3')][_0xf878('0x116')](db[_0xf878('0x55')],{});db[_0xf878('0xd6')][_0xf878('0x10e')](db[_0xf878('0xd1')],{'foreignKey':_0xf878('0x1c5')});db[_0xf878('0xd6')]['hasMany'](db[_0xf878('0xcf')],{'foreignKey':'ProjectId'});db[_0xf878('0xd6')][_0xf878('0x10e')](db[_0xf878('0xcd')],{'foreignKey':_0xf878('0x1c5')});db['SquareProject'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x165'),'through':_0xf878('0x139')});db['Team']['belongsToMany'](db['User'],{'as':_0xf878('0x14b'),'through':'user_has_teams'});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0x1a')],{'through':_0xf878('0x106'),'as':_0xf878('0x127')});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0x3b')],{'through':'team_has_mail_queues','as':_0xf878('0x129')});db[_0xf878('0xdf')][_0xf878('0x119')](db['ChatQueue'],{'through':_0xf878('0x189'),'as':_0xf878('0x12a')});db['Team'][_0xf878('0x119')](db[_0xf878('0x4e')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xf878('0xdf')]['belongsToMany'](db[_0xf878('0x55')],{'through':'team_has_sms_queues','as':'SmsQueues'});db[_0xf878('0xdf')]['belongsToMany'](db[_0xf878('0x5c')],{'through':_0xf878('0x181'),'as':_0xf878('0x12e')});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0x105')],{'through':_0xf878('0x1c6'),'as':'WhatsappQueues'});db[_0xf878('0xdf')][_0xf878('0x119')](db[_0xf878('0xf3')],{'through':_0xf878('0x108'),'as':_0xf878('0x128')});db[_0xf878('0xe1')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xf878('0x18e')});db['Campaign'][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':_0xf878('0x10f'),'foreignKey':'CampaignId'});db[_0xf878('0xe1')][_0xf878('0x10e')](db[_0xf878('0x70')],{'as':_0xf878('0x141'),'foreignKey':_0xf878('0x18e')});db[_0xf878('0xe1')]['hasMany'](db['CmHopperBlack'],{'as':_0xf878('0x142'),'foreignKey':_0xf878('0x18e')});db[_0xf878('0xe1')][_0xf878('0x116')](db[_0xf878('0x144')],{'as':_0xf878('0x144'),'foreignKey':_0xf878('0x145')});db[_0xf878('0xe1')][_0xf878('0x116')](db[_0xf878('0x144')],{'as':_0xf878('0x146'),'foreignKey':_0xf878('0x147')});db[_0xf878('0xe1')][_0xf878('0x116')](db[_0xf878('0x7c')],{'as':_0xf878('0x7c'),'foreignKey':_0xf878('0x148')});db['Campaign'][_0xf878('0x116')](db[_0xf878('0xdb')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xf878('0xe1')][_0xf878('0x119')](db[_0xf878('0xf1')],{'as':_0xf878('0x11d'),'through':'campaigns_has_cm_lists'});db['Campaign'][_0xf878('0x119')](db['CmList'],{'as':_0xf878('0x14d'),'through':_0xf878('0x1c7')});db[_0xf878('0xe4')][_0xf878('0x116')](db[_0xf878('0x63')],{'as':_0xf878('0x63'),'foreignKey':_0xf878('0x169')});db[_0xf878('0xe7')]['belongsTo'](db[_0xf878('0x15d')],{});db[_0xf878('0xe7')][_0xf878('0x116')](db[_0xf878('0x3f')],{});db['MailTransferReport'][_0xf878('0x116')](db[_0xf878('0x39')],{'foreignKey':_0xf878('0x1c8'),'as':_0xf878('0x1c9')});db[_0xf878('0xe7')][_0xf878('0x116')](db['User'],{'foreignKey':'FromUserId','as':_0xf878('0x1ca')});db[_0xf878('0xe7')]['belongsTo'](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db['MailTransferReport'][_0xf878('0x116')](db['MailQueue'],{'foreignKey':'ToMailQueueId','as':_0xf878('0x1cd')});db['MailTransferReport'][_0xf878('0x116')](db[_0xf878('0x39')],{'foreignKey':'ToMailAccountId','as':_0xf878('0x1ce')});db['ChatTransferReport'][_0xf878('0x116')](db[_0xf878('0x62')],{});db[_0xf878('0xe9')]['belongsTo'](db[_0xf878('0x61')],{});db['ChatTransferReport'][_0xf878('0x116')](db[_0xf878('0x5d')],{'foreignKey':_0xf878('0x1cf'),'as':_0xf878('0x1c9')});db[_0xf878('0xe9')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':_0xf878('0x1ca')});db[_0xf878('0xe9')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf878('0xe9')][_0xf878('0x116')](db[_0xf878('0x65')],{'foreignKey':_0xf878('0x1d1'),'as':_0xf878('0x1cd')});db['ChatTransferReport'][_0xf878('0x116')](db[_0xf878('0x5d')],{'foreignKey':_0xf878('0x1d2'),'as':_0xf878('0x1ce')});db[_0xf878('0xeb')]['belongsTo'](db[_0xf878('0x16f')],{});db[_0xf878('0xeb')]['belongsTo'](db['FaxInteraction'],{});db['FaxTransferReport'][_0xf878('0x116')](db['FaxAccount'],{'foreignKey':_0xf878('0x1d3'),'as':'FromAccount'});db[_0xf878('0xeb')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':_0xf878('0x1ca')});db[_0xf878('0xeb')]['belongsTo'](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db[_0xf878('0xeb')][_0xf878('0x116')](db[_0xf878('0x4e')],{'foreignKey':_0xf878('0x1d4'),'as':'ToQueue'});db['FaxTransferReport'][_0xf878('0x116')](db[_0xf878('0x47')],{'foreignKey':_0xf878('0x1d5'),'as':_0xf878('0x1ce')});db['OpenchannelTransferReport']['belongsTo'](db[_0xf878('0x5b')],{});db[_0xf878('0xed')]['belongsTo'](db[_0xf878('0x110')],{});db[_0xf878('0xed')][_0xf878('0x116')](db[_0xf878('0x57')],{'foreignKey':_0xf878('0x1d6'),'as':_0xf878('0x1c9')});db['OpenchannelTransferReport'][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':'FromAgent'});db[_0xf878('0xed')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db[_0xf878('0xed')][_0xf878('0x116')](db[_0xf878('0x5c')],{'foreignKey':'ToOpenchannelQueueId','as':_0xf878('0x1cd')});db[_0xf878('0xed')]['belongsTo'](db[_0xf878('0x57')],{'foreignKey':_0xf878('0x1d7'),'as':_0xf878('0x1ce')});db[_0xf878('0xef')][_0xf878('0x116')](db[_0xf878('0x53')],{});db[_0xf878('0xef')][_0xf878('0x116')](db[_0xf878('0x125')],{});db['SmsTransferReport'][_0xf878('0x116')](db['SmsAccount'],{'foreignKey':_0xf878('0x1d8'),'as':_0xf878('0x1c9')});db[_0xf878('0xef')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':_0xf878('0x1d0'),'as':_0xf878('0x1ca')});db[_0xf878('0xef')]['belongsTo'](db['User'],{'foreignKey':_0xf878('0x1cb'),'as':_0xf878('0x1cc')});db[_0xf878('0xef')][_0xf878('0x116')](db['SmsQueue'],{'foreignKey':_0xf878('0x1d9'),'as':_0xf878('0x1cd')});db[_0xf878('0xef')][_0xf878('0x116')](db['SmsAccount'],{'foreignKey':_0xf878('0x1da'),'as':_0xf878('0x1ce')});db[_0xf878('0xf1')][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x15f'),'onDelete':'cascade'});db[_0xf878('0xf1')]['hasMany'](db[_0xf878('0x1db')],{'as':_0xf878('0x1dc'),'foreignKey':'ListId'});db[_0xf878('0xf1')]['hasMany'](db[_0xf878('0x6a')],{'as':_0xf878('0x11c'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0xf1')][_0xf878('0x10e')](db[_0xf878('0x6e')],{'as':_0xf878('0x10f'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0xf1')][_0xf878('0x10e')](db[_0xf878('0x70')],{'as':_0xf878('0x1dd'),'foreignKey':_0xf878('0x15f')});db['CmList']['hasMany'](db[_0xf878('0x72')],{'as':_0xf878('0x72'),'foreignKey':_0xf878('0x15f')});db['CmList'][_0xf878('0x119')](db['VoiceQueue'],{'as':_0xf878('0x1de'),'through':_0xf878('0x1df')});db['CmList'][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x11e')});db[_0xf878('0xf3')][_0xf878('0x10e')](db[_0xf878('0x16')],{'as':_0xf878('0x19b'),'onDelete':_0xf878('0x10c')});db[_0xf878('0xf3')]['belongsToMany'](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x1e0')});db['VoicePrefix']['belongsToMany'](db['Team'],{'through':_0xf878('0x108'),'as':_0xf878('0x14c')});db[_0xf878('0x117')][_0xf878('0x10e')](db[_0xf878('0xf')],{'as':'Users','foreignKey':'userProfileId'});db[_0xf878('0x117')][_0xf878('0x10e')](db[_0xf878('0xf5')],{'as':_0xf878('0x1e1'),'foreignKey':_0xf878('0x118'),'onDelete':_0xf878('0x10c')});db[_0xf878('0xf5')]['hasMany'](db[_0xf878('0xf6')],{'as':_0xf878('0x1e2'),'foreignKey':'sectionId','onDelete':_0xf878('0x10c')});db['WhatsappAccount'][_0xf878('0x10e')](db[_0xf878('0x78')],{'as':_0xf878('0x15c'),'foreignKey':_0xf878('0x1e3'),'onDelete':_0xf878('0x10c')});db[_0xf878('0xfa')]['hasMany'](db[_0xf878('0x76')],{'as':'Answers','foreignKey':_0xf878('0x1e3')});db['WhatsappAccount'][_0xf878('0x10e')](db[_0xf878('0xff')],{'as':'Messages','foreignKey':_0xf878('0x1e3')});db[_0xf878('0xfa')][_0xf878('0x10e')](db['WhatsappInteraction'],{'as':_0xf878('0x16e')});db[_0xf878('0xfa')]['hasMany'](db[_0xf878('0xfc')],{'as':_0xf878('0x13b')});db[_0xf878('0xfa')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':'List','foreignKey':_0xf878('0x15f')});db[_0xf878('0xfa')]['belongsTo'](db[_0xf878('0x7d')],{'as':'mandatoryDispositionPause','foreignKey':_0xf878('0x14a')});db[_0xf878('0xfa')][_0xf878('0x119')](db[_0xf878('0xf')],{'as':_0xf878('0x14b'),'through':_0xf878('0x137')});db[_0xf878('0xfc')][_0xf878('0x116')](db[_0xf878('0xf')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0xfc')][_0xf878('0x116')](db[_0xf878('0x105')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0xf878('0xfa')],{'onDelete':_0xf878('0x16a')});db[_0xf878('0xfc')]['belongsTo'](db['Interval'],{'onDelete':_0xf878('0x16a'),'foreignKey':_0xf878('0x148')});db[_0xf878('0xfc')][_0xf878('0x116')](db['Tag'],{'onDelete':_0xf878('0x16a'),'foreignKey':'TagId'});db[_0xf878('0xfd')][_0xf878('0x10e')](db['WhatsappMessage'],{'as':_0xf878('0x150'),'onDelete':_0xf878('0x10c'),'foreignKey':_0xf878('0x1e4')});db[_0xf878('0xfd')][_0xf878('0x116')](db['WhatsappAccount'],{'as':_0xf878('0x161'),'foreignKey':_0xf878('0x1e3')});db[_0xf878('0xfd')][_0xf878('0x116')](db['CmContact'],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db[_0xf878('0xfd')][_0xf878('0x116')](db[_0xf878('0xf')],{'as':_0xf878('0x170'),'foreignKey':_0xf878('0x10d')});db[_0xf878('0xfd')]['belongsToMany'](db['Tag'],{'through':_0xf878('0x1e5'),'as':_0xf878('0x163')});db[_0xf878('0xfd')][_0xf878('0x119')](db[_0xf878('0x85')],{'through':_0xf878('0x1e5'),'as':_0xf878('0x164')});db[_0xf878('0xfd')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x165'),'through':'user_has_whatsapp_interactions','foreignKey':_0xf878('0x1e4')});db['WhatsappMessage']['belongsTo'](db[_0xf878('0xf')],{'as':'User'});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x157')});db[_0xf878('0xff')][_0xf878('0x116')](db['WhatsappInteraction'],{'onDelete':_0xf878('0x10c'),'as':_0xf878('0x173'),'foreignKey':_0xf878('0x1e4')});db[_0xf878('0xff')][_0xf878('0x116')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0xf878('0x116')](db[_0xf878('0xfa')],{});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0xf1')],{'as':_0xf878('0x15e'),'foreignKey':_0xf878('0x15f')});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0x6a')],{'as':_0xf878('0x157'),'foreignKey':_0xf878('0x158')});db['WhatsappQueueReport'][_0xf878('0x116')](db[_0xf878('0xfd')],{});db['WhatsappQueueReport'][_0xf878('0x116')](db[_0xf878('0x105')],{});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0xff')],{});db[_0xf878('0x101')][_0xf878('0x116')](db[_0xf878('0xf')],{});db['WhatsappTransferReport'][_0xf878('0x116')](db[_0xf878('0xff')],{});db[_0xf878('0x103')][_0xf878('0x116')](db['WhatsappInteraction'],{});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0xfa')],{'foreignKey':'FromWhatsappAccountId','as':_0xf878('0x1c9')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xf878('0x1e6'),'as':_0xf878('0x1ce')});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0x105')],{'foreignKey':_0xf878('0x1e7'),'as':_0xf878('0x1cd')});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':'FromUserId','as':_0xf878('0x1ca')});db[_0xf878('0x103')][_0xf878('0x116')](db[_0xf878('0xf')],{'foreignKey':'ToUserId','as':_0xf878('0x1cc')});db[_0xf878('0x105')][_0xf878('0x119')](db['User'],{'as':_0xf878('0x14b'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db[_0xf878('0x105')][_0xf878('0x119')](db[_0xf878('0xdf')],{'through':_0xf878('0x1c6'),'as':'Teams'});module[_0xf878('0x1e8')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index b7bb496..8d17153 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb512=['./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/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/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/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/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/version','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','/snippet','snippet','3.0.0','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','lastName','phone','mobile','fax','email','clientSecret','securityToken','code','tenantId','token','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','pass','dsn','oldPassword','isPlainObject','isArray','length','isString','replace','@@{','}@@','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','auth','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','role','logger','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','other','agent_id','agent_name','test','url','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./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/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication'];(function(_0x46b968,_0xc65e97){var _0x3044d0=function(_0x397bcb){while(--_0x397bcb){_0x46b968['push'](_0x46b968['shift']());}};_0x3044d0(++_0xc65e97);}(_0xb512,0xe8));var _0x2b51=function(_0x417083,_0x5af11d){_0x417083=_0x417083-0x0;var _0x5c3a8a=_0xb512[_0x417083];return _0x5c3a8a;};'use strict';var _=require(_0x2b51('0x0'));var path=require(_0x2b51('0x1'));var express=require(_0x2b51('0x2'));var ewinston=require(_0x2b51('0x3'));var util=require('util');var errors=require(_0x2b51('0x4'));var config=require(_0x2b51('0x5'));var logger=require(_0x2b51('0x6'))('api');var authLogger=require(_0x2b51('0x6'))(_0x2b51('0x7'));exports['default']=function(_0x158776){_0x158776[_0x2b51('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3d90c6,_0x5c4cf8){var _0x3c631f=_0x2b51('0x9');if(!_[_0x2b51('0xa')](_0x3d90c6['body'])){_0x3c631f+=_0x2b51('0xb');var _0x319a80=_0x3d90c6[_0x2b51('0xc')];maskSensitiveData(_0x319a80);}return util[_0x2b51('0xd')](_0x3c631f,_0x3d90c6['method'],_0x3d90c6[_0x2b51('0xe')][_0x2b51('0xf')]?_0x3d90c6[_0x2b51('0xe')][_0x2b51('0xf')]:_0x3d90c6[_0x2b51('0x10')][_0x2b51('0x11')]||_0x3d90c6['ip'],_0x3d90c6['url'],_0x5c4cf8[_0x2b51('0x12')],_0x5c4cf8[_0x2b51('0x13')],_0x3d90c6[_0x2b51('0x14')]?_0x3d90c6[_0x2b51('0x14')]['id']:null,_0x3d90c6['user']?_0x3d90c6[_0x2b51('0x14')][_0x2b51('0x15')]:null,_0x3d90c6['user']?_0x3d90c6[_0x2b51('0x14')][_0x2b51('0x16')]:null,_0x319a80?util['inspect'](_0x319a80,![],null):'');}}));_0x158776[_0x2b51('0x8')](ewinston[_0x2b51('0x17')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x51fc69,_0x48e32d){var _0x1b37b1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x51fc69['body']&&_0x51fc69[_0x2b51('0xc')][_0x2b51('0x18')]&&_0x51fc69[_0x2b51('0xc')]['agent_id']){_0x1b37b1=_0x2b51('0x19');}return util[_0x2b51('0xd')](_0x1b37b1,_0x51fc69[_0x2b51('0x1a')],_0x51fc69[_0x2b51('0xe')]['x-forwarded-for']?_0x51fc69[_0x2b51('0xe')][_0x2b51('0xf')]:_0x51fc69[_0x2b51('0x10')][_0x2b51('0x11')]||_0x51fc69['ip'],_0x51fc69['url'],_0x48e32d['statusCode'],_0x48e32d[_0x2b51('0x13')],_0x51fc69[_0x2b51('0x14')]?_0x51fc69['user']['id']:null,_0x51fc69[_0x2b51('0x14')]?_0x51fc69[_0x2b51('0x14')][_0x2b51('0x15')]:null,_0x51fc69['user']?_0x51fc69[_0x2b51('0x14')][_0x2b51('0x16')]:null,_0x51fc69['body']&&_0x51fc69[_0x2b51('0xc')][_0x2b51('0x18')]?_0x51fc69['body'][_0x2b51('0x18')]:_0x2b51('0x1b'),_0x51fc69[_0x2b51('0xc')]&&_0x51fc69[_0x2b51('0xc')][_0x2b51('0x1c')]?_0x51fc69[_0x2b51('0xc')][_0x2b51('0x1c')]:'',_0x51fc69[_0x2b51('0xc')]&&_0x51fc69['body'][_0x2b51('0x1d')]?_0x51fc69[_0x2b51('0xc')][_0x2b51('0x1d')]:'');},'ignoreRoute':function(_0x70b3d9){var _0x4ee49b=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4ee49b[_0x2b51('0x1e')](_0x70b3d9[_0x2b51('0x1f')]);}}));_0x158776[_0x2b51('0x8')]('/api/users',require(_0x2b51('0x20')));_0x158776[_0x2b51('0x8')](_0x2b51('0x21'),require(_0x2b51('0x22')));_0x158776['use'](_0x2b51('0x23'),require(_0x2b51('0x24')));_0x158776[_0x2b51('0x8')](_0x2b51('0x25'),require(_0x2b51('0x26')));_0x158776[_0x2b51('0x8')](_0x2b51('0x27'),require('./api/voiceMusicOnHold'));_0x158776[_0x2b51('0x8')](_0x2b51('0x28'),require('./api/voiceQueue'));_0x158776[_0x2b51('0x8')](_0x2b51('0x29'),require(_0x2b51('0x2a')));_0x158776[_0x2b51('0x8')]('/api/screen/recordings',require(_0x2b51('0x2b')));_0x158776[_0x2b51('0x8')](_0x2b51('0x2c'),require(_0x2b51('0x2d')));_0x158776[_0x2b51('0x8')](_0x2b51('0x2e'),require('./api/voiceMailMessage'));_0x158776[_0x2b51('0x8')](_0x2b51('0x2f'),require('./api/voiceCallReport'));_0x158776[_0x2b51('0x8')](_0x2b51('0x30'),require(_0x2b51('0x31')));_0x158776[_0x2b51('0x8')](_0x2b51('0x32'),require(_0x2b51('0x33')));_0x158776['use'](_0x2b51('0x34'),require(_0x2b51('0x35')));_0x158776[_0x2b51('0x8')](_0x2b51('0x36'),require(_0x2b51('0x37')));_0x158776[_0x2b51('0x8')](_0x2b51('0x38'),require(_0x2b51('0x39')));_0x158776[_0x2b51('0x8')](_0x2b51('0x3a'),require(_0x2b51('0x3b')));_0x158776[_0x2b51('0x8')]('/api/mail/out_servers',require(_0x2b51('0x3c')));_0x158776[_0x2b51('0x8')](_0x2b51('0x3d'),require(_0x2b51('0x3e')));_0x158776[_0x2b51('0x8')]('/api/mail/queues',require(_0x2b51('0x3f')));_0x158776[_0x2b51('0x8')](_0x2b51('0x40'),require(_0x2b51('0x41')));_0x158776[_0x2b51('0x8')](_0x2b51('0x42'),require('./api/mailInteraction'));_0x158776['use'](_0x2b51('0x43'),require('./api/mailMessage'));_0x158776['use'](_0x2b51('0x44'),require(_0x2b51('0x45')));_0x158776[_0x2b51('0x8')](_0x2b51('0x46'),require(_0x2b51('0x47')));_0x158776['use']('/api/dashboards',require(_0x2b51('0x48')));_0x158776[_0x2b51('0x8')]('/api/dashboards/items',require(_0x2b51('0x49')));_0x158776[_0x2b51('0x8')](_0x2b51('0x4a'),require(_0x2b51('0x4b')));_0x158776[_0x2b51('0x8')](_0x2b51('0x4c'),require(_0x2b51('0x4d')));_0x158776[_0x2b51('0x8')](_0x2b51('0x4e'),require(_0x2b51('0x4f')));_0x158776[_0x2b51('0x8')](_0x2b51('0x50'),require('./api/faxMessage'));_0x158776[_0x2b51('0x8')](_0x2b51('0x51'),require(_0x2b51('0x52')));_0x158776[_0x2b51('0x8')](_0x2b51('0x53'),require('./api/faxQueueReport'));_0x158776[_0x2b51('0x8')](_0x2b51('0x54'),require(_0x2b51('0x55')));_0x158776[_0x2b51('0x8')](_0x2b51('0x56'),require(_0x2b51('0x57')));_0x158776[_0x2b51('0x8')](_0x2b51('0x58'),require(_0x2b51('0x59')));_0x158776[_0x2b51('0x8')](_0x2b51('0x5a'),require(_0x2b51('0x5b')));_0x158776[_0x2b51('0x8')](_0x2b51('0x5c'),require(_0x2b51('0x5d')));_0x158776[_0x2b51('0x8')](_0x2b51('0x5e'),require(_0x2b51('0x5f')));_0x158776[_0x2b51('0x8')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x158776[_0x2b51('0x8')](_0x2b51('0x60'),require('./api/openchannelInteraction'));_0x158776['use'](_0x2b51('0x61'),require(_0x2b51('0x62')));_0x158776[_0x2b51('0x8')](_0x2b51('0x63'),require(_0x2b51('0x64')));_0x158776[_0x2b51('0x8')](_0x2b51('0x65'),require('./api/chatWebsite'));_0x158776[_0x2b51('0x8')](_0x2b51('0x66'),require(_0x2b51('0x67')));_0x158776['use'](_0x2b51('0x68'),require(_0x2b51('0x69')));_0x158776[_0x2b51('0x8')]('/api/chat/interactions',require(_0x2b51('0x6a')));_0x158776[_0x2b51('0x8')](_0x2b51('0x6b'),require(_0x2b51('0x6c')));_0x158776[_0x2b51('0x8')]('/api/chat/offline_messages',require(_0x2b51('0x6d')));_0x158776[_0x2b51('0x8')]('/api/chat/queues',require('./api/chatQueue'));_0x158776[_0x2b51('0x8')](_0x2b51('0x6e'),require(_0x2b51('0x6f')));_0x158776[_0x2b51('0x8')](_0x2b51('0x70'),require(_0x2b51('0x71')));_0x158776[_0x2b51('0x8')]('/api/cm/companies',require(_0x2b51('0x72')));_0x158776[_0x2b51('0x8')]('/api/cm/contacts',require(_0x2b51('0x73')));_0x158776[_0x2b51('0x8')](_0x2b51('0x74'),require(_0x2b51('0x75')));_0x158776['use'](_0x2b51('0x76'),require(_0x2b51('0x77')));_0x158776['use'](_0x2b51('0x78'),require('./api/cmHopperFinal'));_0x158776[_0x2b51('0x8')](_0x2b51('0x79'),require(_0x2b51('0x7a')));_0x158776[_0x2b51('0x8')](_0x2b51('0x7b'),require(_0x2b51('0x7c')));_0x158776['use'](_0x2b51('0x7d'),require(_0x2b51('0x7e')));_0x158776[_0x2b51('0x8')](_0x2b51('0x7f'),require(_0x2b51('0x80')));_0x158776[_0x2b51('0x8')](_0x2b51('0x81'),require('./api/cannedAnswer'));_0x158776['use'](_0x2b51('0x82'),require(_0x2b51('0x83')));_0x158776[_0x2b51('0x8')](_0x2b51('0x84'),require(_0x2b51('0x85')));_0x158776[_0x2b51('0x8')]('/api/intervals',require(_0x2b51('0x86')));_0x158776['use'](_0x2b51('0x87'),require(_0x2b51('0x88')));_0x158776['use'](_0x2b51('0x89'),require('./api/cdr'));_0x158776[_0x2b51('0x8')](_0x2b51('0x8a'),require(_0x2b51('0x8b')));_0x158776[_0x2b51('0x8')](_0x2b51('0x8c'),require('./api/schedule'));_0x158776[_0x2b51('0x8')](_0x2b51('0x8d'),require(_0x2b51('0x8e')));_0x158776[_0x2b51('0x8')](_0x2b51('0x8f'),require(_0x2b51('0x90')));_0x158776['use'](_0x2b51('0x91'),require('./api/template'));_0x158776[_0x2b51('0x8')]('/api/triggers',require(_0x2b51('0x92')));_0x158776[_0x2b51('0x8')](_0x2b51('0x93'),require(_0x2b51('0x94')));_0x158776[_0x2b51('0x8')]('/api/integrations',require(_0x2b51('0x95')));_0x158776['use'](_0x2b51('0x96'),require(_0x2b51('0x97')));_0x158776[_0x2b51('0x8')]('/api/analytics/custom_reports',require(_0x2b51('0x98')));_0x158776['use'](_0x2b51('0x99'),require(_0x2b51('0x9a')));_0x158776[_0x2b51('0x8')](_0x2b51('0x9b'),require(_0x2b51('0x9c')));_0x158776[_0x2b51('0x8')](_0x2b51('0x9d'),require('./api/analyticMetric'));_0x158776[_0x2b51('0x8')](_0x2b51('0x9e'),require(_0x2b51('0x9f')));_0x158776[_0x2b51('0x8')](_0x2b51('0xa0'),require(_0x2b51('0xa1')));_0x158776[_0x2b51('0x8')](_0x2b51('0xa2'),require(_0x2b51('0xa3')));_0x158776[_0x2b51('0x8')](_0x2b51('0xa4'),require(_0x2b51('0xa5')));_0x158776[_0x2b51('0x8')](_0x2b51('0xa6'),require('./api/intSalesforceField'));_0x158776[_0x2b51('0x8')](_0x2b51('0xa7'),require(_0x2b51('0xa8')));_0x158776[_0x2b51('0x8')](_0x2b51('0xa9'),require(_0x2b51('0xaa')));_0x158776[_0x2b51('0x8')]('/api/integrations/sugarcrm/fields',require(_0x2b51('0xab')));_0x158776['use'](_0x2b51('0xac'),require(_0x2b51('0xad')));_0x158776[_0x2b51('0x8')](_0x2b51('0xae'),require(_0x2b51('0xaf')));_0x158776[_0x2b51('0x8')]('/api/integrations/desk/fields',require(_0x2b51('0xb0')));_0x158776[_0x2b51('0x8')](_0x2b51('0xb1'),require(_0x2b51('0xb2')));_0x158776[_0x2b51('0x8')](_0x2b51('0xb3'),require(_0x2b51('0xb4')));_0x158776[_0x2b51('0x8')](_0x2b51('0xb5'),require(_0x2b51('0xb6')));_0x158776[_0x2b51('0x8')](_0x2b51('0xb7'),require(_0x2b51('0xb8')));_0x158776[_0x2b51('0x8')](_0x2b51('0xb9'),require(_0x2b51('0xba')));_0x158776[_0x2b51('0x8')](_0x2b51('0xbb'),require(_0x2b51('0xbc')));_0x158776[_0x2b51('0x8')](_0x2b51('0xbd'),require(_0x2b51('0xbe')));_0x158776['use'](_0x2b51('0xbf'),require(_0x2b51('0xc0')));_0x158776['use'](_0x2b51('0xc1'),require(_0x2b51('0xc2')));_0x158776[_0x2b51('0x8')](_0x2b51('0xc3'),require(_0x2b51('0xc4')));_0x158776[_0x2b51('0x8')](_0x2b51('0xc5'),require('./api/intVtigerConfiguration'));_0x158776[_0x2b51('0x8')](_0x2b51('0xc6'),require('./api/intVtigerField'));_0x158776['use'](_0x2b51('0xc7'),require('./api/intServicenowAccount'));_0x158776['use']('/api/integrations/servicenow/configurations',require(_0x2b51('0xc8')));_0x158776[_0x2b51('0x8')](_0x2b51('0xc9'),require(_0x2b51('0xca')));_0x158776[_0x2b51('0x8')]('/api/integrations/dynamics365/accounts',require(_0x2b51('0xcb')));_0x158776['use']('/api/integrations/dynamics365/configurations',require(_0x2b51('0xcc')));_0x158776[_0x2b51('0x8')]('/api/integrations/dynamics365/fields',require(_0x2b51('0xcd')));_0x158776[_0x2b51('0x8')](_0x2b51('0xce'),require(_0x2b51('0xcf')));_0x158776['use']('/api/integrations/freshsales/configurations',require(_0x2b51('0xd0')));_0x158776[_0x2b51('0x8')](_0x2b51('0xd1'),require(_0x2b51('0xd2')));_0x158776[_0x2b51('0x8')](_0x2b51('0xd3'),require(_0x2b51('0xd4')));_0x158776[_0x2b51('0x8')](_0x2b51('0xd5'),require('./api/chatQueueReport'));_0x158776['use'](_0x2b51('0xd6'),require(_0x2b51('0xd7')));_0x158776[_0x2b51('0x8')](_0x2b51('0xd8'),require('./api/jscriptyAnswerReport'));_0x158776['use']('/api/jscripty/questions/reports',require(_0x2b51('0xd9')));_0x158776[_0x2b51('0x8')](_0x2b51('0xda'),require(_0x2b51('0xdb')));_0x158776[_0x2b51('0x8')](_0x2b51('0xdc'),require(_0x2b51('0xdd')));_0x158776[_0x2b51('0x8')]('/api/square/reports',require(_0x2b51('0xde')));_0x158776['use']('/api/square/details/reports',require('./api/squareReportDetail'));_0x158776['use'](_0x2b51('0xdf'),require(_0x2b51('0xe0')));_0x158776[_0x2b51('0x8')](_0x2b51('0xe1'),require('./api/setting'));_0x158776[_0x2b51('0x8')]('/api/square/odbc',require(_0x2b51('0xe2')));_0x158776[_0x2b51('0x8')](_0x2b51('0xe3'),require(_0x2b51('0xe4')));_0x158776[_0x2b51('0x8')](_0x2b51('0xe5'),require(_0x2b51('0xe6')));_0x158776[_0x2b51('0x8')](_0x2b51('0xe7'),require(_0x2b51('0xe8')));_0x158776[_0x2b51('0x8')](_0x2b51('0xe9'),require('./api/team'));_0x158776[_0x2b51('0x8')](_0x2b51('0xea'),require(_0x2b51('0xeb')));_0x158776['use']('/api/campaigns',require('./api/campaign'));_0x158776[_0x2b51('0x8')]('/api/migrations',require('./api/migration'));_0x158776[_0x2b51('0x8')]('/api/attachments',require(_0x2b51('0xec')));_0x158776[_0x2b51('0x8')]('/api/plugins',require(_0x2b51('0xed')));_0x158776[_0x2b51('0x8')](_0x2b51('0xee'),require(_0x2b51('0xef')));_0x158776[_0x2b51('0x8')](_0x2b51('0xf0'),require(_0x2b51('0xf1')));_0x158776[_0x2b51('0x8')](_0x2b51('0xf2'),require('./api/faxTransferReport'));_0x158776[_0x2b51('0x8')](_0x2b51('0xf3'),require(_0x2b51('0xf4')));_0x158776['use'](_0x2b51('0xf5'),require(_0x2b51('0xf6')));_0x158776[_0x2b51('0x8')](_0x2b51('0xf7'),require(_0x2b51('0xf8')));_0x158776[_0x2b51('0x8')](_0x2b51('0xf9'),require(_0x2b51('0xfa')));_0x158776['use'](_0x2b51('0xfb'),require(_0x2b51('0xfc')));_0x158776['use'](_0x2b51('0xfd'),require(_0x2b51('0xfe')));_0x158776[_0x2b51('0x8')](_0x2b51('0xff'),require(_0x2b51('0x100')));_0x158776[_0x2b51('0x8')](_0x2b51('0x101'),require(_0x2b51('0x102')));_0x158776[_0x2b51('0x8')]('/api/whatsapp/accounts',require(_0x2b51('0x103')));_0x158776['use'](_0x2b51('0x104'),require(_0x2b51('0x105')));_0x158776[_0x2b51('0x8')](_0x2b51('0x106'),require(_0x2b51('0x107')));_0x158776['use'](_0x2b51('0x108'),require(_0x2b51('0x109')));_0x158776[_0x2b51('0x8')](_0x2b51('0x10a'),require(_0x2b51('0x10b')));_0x158776['use'](_0x2b51('0x10c'),require(_0x2b51('0x10d')));_0x158776['use'](_0x2b51('0x10e'),require(_0x2b51('0x10f')));_0x158776[_0x2b51('0x8')](_0x2b51('0x110'),require(_0x2b51('0x111')));_0x158776[_0x2b51('0x8')](_0x2b51('0x112'),require('./api/realtime'));_0x158776['use'](_0x2b51('0x113'),require(_0x2b51('0x114')));_0x158776[_0x2b51('0x8')](_0x2b51('0x115'),require(_0x2b51('0x116')));_0x158776[_0x2b51('0x8')](_0x2b51('0x117'),require(_0x2b51('0x118')));_0x158776['use'](_0x2b51('0x119'),require('./api/rpc'));_0x158776[_0x2b51('0x8')]('/api/version',require(_0x2b51('0x11a')));_0x158776[_0x2b51('0x8')]('/api/system',require('./api/system'));_0x158776[_0x2b51('0x8')]('/api/pm2',require(_0x2b51('0x11b')));_0x158776[_0x2b51('0x8')](_0x2b51('0x11c'),require(_0x2b51('0x11d')));_0x158776[_0x2b51('0x8')](_0x2b51('0x11e'),express['static'](path[_0x2b51('0x11f')](config['root'],_0x2b51('0x11e'))));_0x158776[_0x2b51('0x8')](_0x2b51('0x120'),express[_0x2b51('0x121')](path[_0x2b51('0x11f')](config[_0x2b51('0x122')],_0x2b51('0x120'))));_0x158776['use']('/demo',express[_0x2b51('0x121')](path['join'](config[_0x2b51('0x122')],_0x2b51('0x123'))));_0x158776[_0x2b51('0x8')](_0x2b51('0x124'),express['static'](path[_0x2b51('0x11f')](config['root'],_0x2b51('0x125'),_0x2b51('0x126'))));_0x158776[_0x2b51('0x8')]('/plugins',express['static'](path['join'](config[_0x2b51('0x122')],'/server/files/plugins')));_0x158776[_0x2b51('0x127')](_0x2b51('0x128'))[_0x2b51('0x129')](errors[0x194]);_0x158776[_0x2b51('0x127')]('/*')[_0x2b51('0x129')](function(_0x54affd,_0x27bdae){_0x27bdae[_0x2b51('0x12a')](path[_0x2b51('0x12b')](_0x158776[_0x2b51('0x129')](_0x2b51('0x12c'))+_0x2b51('0x12d')));});};var sensitiveFields=[_0x2b51('0x12e'),_0x2b51('0x12f'),_0x2b51('0x130'),_0x2b51('0x131'),'firstName',_0x2b51('0x132'),'street',_0x2b51('0x133'),_0x2b51('0x134'),_0x2b51('0x135'),_0x2b51('0x136'),'clientId',_0x2b51('0x137'),_0x2b51('0x138'),_0x2b51('0x139'),'accessKey',_0x2b51('0x13a'),_0x2b51('0x13b'),_0x2b51('0x13c'),'accessToken',_0x2b51('0x13d'),_0x2b51('0x13e'),'consumerKey',_0x2b51('0x13f'),'membername',_0x2b51('0x140'),_0x2b51('0x141'),_0x2b51('0x142'),'vidaooApiKey',_0x2b51('0x143'),_0x2b51('0x144'),_0x2b51('0x145'),_0x2b51('0x146'),_0x2b51('0x147'),_0x2b51('0x14'),_0x2b51('0x148'),'accountSid','localstationid',_0x2b51('0x149'),'secret','registry',_0x2b51('0x14a')];function maskSensitiveData(_0x45ff80){var _0x11ac43=/(?!^)[\s\S](?!$)/g;if(!_[_0x2b51('0x14b')](_0x45ff80))return;for(var _0x5d6649 in _0x45ff80){if(_[_0x2b51('0x14c')](_0x45ff80[_0x5d6649])){for(var _0x286536=0x0;_0x286536<_0x45ff80[_0x5d6649][_0x2b51('0x14d')];_0x286536++){maskSensitiveData(_0x45ff80[_0x5d6649][_0x286536]);}}else if(_['isPlainObject'](_0x45ff80[_0x5d6649])){maskSensitiveData(_0x45ff80[_0x5d6649]);}else if(_[_0x2b51('0x14e')](_0x45ff80[_0x5d6649])){_0x45ff80[_0x5d6649]=_0x45ff80[_0x5d6649][_0x2b51('0x14f')](/{{{/g,_0x2b51('0x150'))[_0x2b51('0x14f')](/}}}/g,_0x2b51('0x151'))['replace'](/{{/g,'@{')[_0x2b51('0x14f')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x5d6649)){_0x45ff80[_0x5d6649]=_0x45ff80[_0x5d6649]['replace'](_0x11ac43,'*');}}}} \ No newline at end of file +var _0x1675=['./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','/api/integrations/reports','./api/integrationReport','/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/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','./api/license','/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/cm/lists','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','lastName','phone','mobile','fax','email','clientId','clientSecret','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','key','pass','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','replace','@@{','includes','lodash','path','express','express-winston','util','./errors','./config/logger','api','auth','default','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites'];(function(_0x1c5e2f,_0x372a8d){var _0x5defd1=function(_0x189fa3){while(--_0x189fa3){_0x1c5e2f['push'](_0x1c5e2f['shift']());}};_0x5defd1(++_0x372a8d);}(_0x1675,0xed));var _0x5167=function(_0x5e6440,_0x409bb5){_0x5e6440=_0x5e6440-0x0;var _0x47e4ec=_0x1675[_0x5e6440];return _0x47e4ec;};'use strict';var _=require(_0x5167('0x0'));var path=require(_0x5167('0x1'));var express=require(_0x5167('0x2'));var ewinston=require(_0x5167('0x3'));var util=require(_0x5167('0x4'));var errors=require(_0x5167('0x5'));var config=require('./config/environment');var logger=require(_0x5167('0x6'))(_0x5167('0x7'));var authLogger=require('./config/logger')(_0x5167('0x8'));exports[_0x5167('0x9')]=function(_0x18b01b){_0x18b01b['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3ebdd5,_0x470dd4){var _0x3cc3cf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x5167('0xa')](_0x3ebdd5['body'])){_0x3cc3cf+=_0x5167('0xb');var _0xde9276=_0x3ebdd5[_0x5167('0xc')];maskSensitiveData(_0xde9276);}return util[_0x5167('0xd')](_0x3cc3cf,_0x3ebdd5[_0x5167('0xe')],_0x3ebdd5[_0x5167('0xf')][_0x5167('0x10')]?_0x3ebdd5['headers'][_0x5167('0x10')]:_0x3ebdd5[_0x5167('0x11')][_0x5167('0x12')]||_0x3ebdd5['ip'],_0x3ebdd5[_0x5167('0x13')],_0x470dd4[_0x5167('0x14')],_0x470dd4[_0x5167('0x15')],_0x3ebdd5[_0x5167('0x16')]?_0x3ebdd5['user']['id']:null,_0x3ebdd5[_0x5167('0x16')]?_0x3ebdd5[_0x5167('0x16')][_0x5167('0x17')]:null,_0x3ebdd5[_0x5167('0x16')]?_0x3ebdd5[_0x5167('0x16')][_0x5167('0x18')]:null,_0xde9276?util[_0x5167('0x19')](_0xde9276,![],null):'');}}));_0x18b01b[_0x5167('0x1a')](ewinston[_0x5167('0x1b')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x51789e,_0xc5157d){var _0x5e30d0=_0x5167('0x1c');if(_0x51789e[_0x5167('0xc')]&&_0x51789e['body'][_0x5167('0x1d')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x1e')]){_0x5e30d0=_0x5167('0x1f');}return util[_0x5167('0xd')](_0x5e30d0,_0x51789e[_0x5167('0xe')],_0x51789e[_0x5167('0xf')][_0x5167('0x10')]?_0x51789e[_0x5167('0xf')]['x-forwarded-for']:_0x51789e[_0x5167('0x11')][_0x5167('0x12')]||_0x51789e['ip'],_0x51789e[_0x5167('0x13')],_0xc5157d[_0x5167('0x14')],_0xc5157d[_0x5167('0x15')],_0x51789e[_0x5167('0x16')]?_0x51789e[_0x5167('0x16')]['id']:null,_0x51789e[_0x5167('0x16')]?_0x51789e[_0x5167('0x16')][_0x5167('0x17')]:null,_0x51789e['user']?_0x51789e['user'][_0x5167('0x18')]:null,_0x51789e[_0x5167('0xc')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x1d')]?_0x51789e[_0x5167('0xc')]['device']:_0x5167('0x20'),_0x51789e[_0x5167('0xc')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x1e')]?_0x51789e[_0x5167('0xc')][_0x5167('0x1e')]:'',_0x51789e[_0x5167('0xc')]&&_0x51789e[_0x5167('0xc')][_0x5167('0x21')]?_0x51789e[_0x5167('0xc')][_0x5167('0x21')]:'');},'ignoreRoute':function(_0x5cbcf3){var _0x3fdd34=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3fdd34[_0x5167('0x22')](_0x5cbcf3['url']);}}));_0x18b01b['use'](_0x5167('0x23'),require('./api/user'));_0x18b01b['use'](_0x5167('0x24'),require(_0x5167('0x25')));_0x18b01b['use'](_0x5167('0x26'),require(_0x5167('0x27')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x28'),require(_0x5167('0x29')));_0x18b01b['use'](_0x5167('0x2a'),require(_0x5167('0x2b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x2c'),require(_0x5167('0x2d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x2e'),require('./api/voiceRecording'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x2f'),require(_0x5167('0x30')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x31'),require(_0x5167('0x32')));_0x18b01b[_0x5167('0x1a')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x18b01b[_0x5167('0x1a')]('/api/voice/calls/reports',require(_0x5167('0x33')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x34'),require(_0x5167('0x35')));_0x18b01b['use'](_0x5167('0x36'),require('./api/voiceAgentReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x37'),require('./api/voiceQueueReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x38'),require(_0x5167('0x39')));_0x18b01b['use'](_0x5167('0x3a'),require(_0x5167('0x3b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x3c'),require('./api/voiceTransferReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x3d'),require(_0x5167('0x3e')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x3f'),require(_0x5167('0x40')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x41'),require('./api/mailQueue'));_0x18b01b['use'](_0x5167('0x42'),require('./api/mailSubstatus'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x43'),require('./api/mailInteraction'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x44'),require('./api/mailMessage'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x45'),require(_0x5167('0x46')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x47'),require(_0x5167('0x48')));_0x18b01b['use'](_0x5167('0x49'),require(_0x5167('0x4a')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x4b'),require(_0x5167('0x4c')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x4d'),require(_0x5167('0x4e')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x4f'),require(_0x5167('0x50')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x51'),require(_0x5167('0x52')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x53'),require(_0x5167('0x54')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x55'),require(_0x5167('0x56')));_0x18b01b['use']('/api/fax/reports/queue',require(_0x5167('0x57')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x58'),require(_0x5167('0x59')));_0x18b01b['use'](_0x5167('0x5a'),require(_0x5167('0x5b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x5c'),require(_0x5167('0x5d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x5e'),require(_0x5167('0x5f')));_0x18b01b[_0x5167('0x1a')]('/api/sms/queues',require(_0x5167('0x60')));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/applications',require(_0x5167('0x61')));_0x18b01b['use'](_0x5167('0x62'),require('./api/openchannelInteraction'));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/messages',require(_0x5167('0x63')));_0x18b01b[_0x5167('0x1a')]('/api/openchannel/queues',require(_0x5167('0x64')));_0x18b01b['use'](_0x5167('0x65'),require(_0x5167('0x66')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x67'),require(_0x5167('0x68')));_0x18b01b['use'](_0x5167('0x69'),require(_0x5167('0x6a')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x6b'),require(_0x5167('0x6c')));_0x18b01b[_0x5167('0x1a')]('/api/chat/messages',require(_0x5167('0x6d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x6e'),require('./api/chatOfflineMessage'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x6f'),require('./api/chatQueue'));_0x18b01b['use'](_0x5167('0x70'),require('./api/chatGroup'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x71'),require(_0x5167('0x72')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x73'),require(_0x5167('0x74')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x75'),require(_0x5167('0x76')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x77'),require('./api/cmHopper'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x78'),require(_0x5167('0x79')));_0x18b01b['use'](_0x5167('0x7a'),require(_0x5167('0x7b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x7c'),require(_0x5167('0x7d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x7e'),require('./api/cmCustomField'));_0x18b01b['use'](_0x5167('0x7f'),require('./api/action'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x80'),require(_0x5167('0x81')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x82'),require(_0x5167('0x83')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x84'),require(_0x5167('0x85')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x86'),require(_0x5167('0x87')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x88'),require(_0x5167('0x89')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x8a'),require(_0x5167('0x8b')));_0x18b01b['use'](_0x5167('0x8c'),require(_0x5167('0x8d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x8e'),require(_0x5167('0x8f')));_0x18b01b['use'](_0x5167('0x90'),require(_0x5167('0x91')));_0x18b01b[_0x5167('0x1a')]('/api/sounds',require(_0x5167('0x92')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x93'),require(_0x5167('0x94')));_0x18b01b['use'](_0x5167('0x95'),require(_0x5167('0x96')));_0x18b01b['use'](_0x5167('0x97'),require(_0x5167('0x98')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x99'),require('./api/variable'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x9a'),require('./api/integration'));_0x18b01b['use'](_0x5167('0x9b'),require(_0x5167('0x9c')));_0x18b01b[_0x5167('0x1a')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x9d'),require(_0x5167('0x9e')));_0x18b01b[_0x5167('0x1a')]('/api/analytics/extracted_reports',require(_0x5167('0x9f')));_0x18b01b['use'](_0x5167('0xa0'),require(_0x5167('0xa1')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa2'),require(_0x5167('0xa3')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa4'),require(_0x5167('0xa5')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/salesforce/accounts',require(_0x5167('0xa6')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa7'),require(_0x5167('0xa8')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xa9'),require(_0x5167('0xaa')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xab'),require('./api/intSugarcrmAccount'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xac'),require(_0x5167('0xad')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xae'),require(_0x5167('0xaf')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb0'),require('./api/intDeskAccount'));_0x18b01b['use'](_0x5167('0xb1'),require(_0x5167('0xb2')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb3'),require(_0x5167('0xb4')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/zoho/accounts',require(_0x5167('0xb5')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/zoho/configurations',require(_0x5167('0xb6')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb7'),require(_0x5167('0xb8')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xb9'),require('./api/intZendeskAccount'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xba'),require('./api/intZendeskConfiguration'));_0x18b01b[_0x5167('0x1a')]('/api/integrations/zendesk/fields',require(_0x5167('0xbb')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/freshdesk/accounts',require(_0x5167('0xbc')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xbd'),require(_0x5167('0xbe')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xbf'),require(_0x5167('0xc0')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xc1'),require(_0x5167('0xc2')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/vtiger/configurations',require(_0x5167('0xc3')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x18b01b[_0x5167('0x1a')]('/api/integrations/servicenow/accounts',require(_0x5167('0xc4')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xc5'),require(_0x5167('0xc6')));_0x18b01b['use'](_0x5167('0xc7'),require('./api/intServicenowField'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xc8'),require(_0x5167('0xc9')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xca'),require('./api/intDynamics365Configuration'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xcb'),require(_0x5167('0xcc')));_0x18b01b[_0x5167('0x1a')]('/api/integrations/freshsales/accounts',require(_0x5167('0xcd')));_0x18b01b['use'](_0x5167('0xce'),require(_0x5167('0xcf')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd0'),require('./api/intFreshsalesField'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd1'),require(_0x5167('0xd2')));_0x18b01b[_0x5167('0x1a')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd3'),require(_0x5167('0xd4')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd5'),require(_0x5167('0xd6')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd7'),require(_0x5167('0xd8')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xd9'),require('./api/jscriptySessionReport'));_0x18b01b[_0x5167('0x1a')]('/api/sms/reports/queue',require(_0x5167('0xda')));_0x18b01b['use'](_0x5167('0xdb'),require(_0x5167('0xdc')));_0x18b01b['use']('/api/square/details/reports',require(_0x5167('0xdd')));_0x18b01b['use'](_0x5167('0xde'),require(_0x5167('0xdf')));_0x18b01b['use'](_0x5167('0xe0'),require(_0x5167('0xe1')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xe2'),require(_0x5167('0xe3')));_0x18b01b['use'](_0x5167('0xe4'),require(_0x5167('0xe5')));_0x18b01b['use'](_0x5167('0xe6'),require(_0x5167('0xe7')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xe8'),require(_0x5167('0xe9')));_0x18b01b['use'](_0x5167('0xea'),require('./api/team'));_0x18b01b['use'](_0x5167('0xeb'),require(_0x5167('0xec')));_0x18b01b['use']('/api/campaigns',require('./api/campaign'));_0x18b01b[_0x5167('0x1a')]('/api/migrations',require('./api/migration'));_0x18b01b['use'](_0x5167('0xed'),require(_0x5167('0xee')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xef'),require(_0x5167('0xf0')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf1'),require(_0x5167('0xf2')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf3'),require(_0x5167('0xf4')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf5'),require(_0x5167('0xf6')));_0x18b01b['use'](_0x5167('0xf7'),require(_0x5167('0xf8')));_0x18b01b[_0x5167('0x1a')]('/api/sms/reports/transfer',require('./api/smsTransferReport'));_0x18b01b[_0x5167('0x1a')](_0x5167('0xf9'),require(_0x5167('0xfa')));_0x18b01b[_0x5167('0x1a')]('/api/voice/prefixes',require(_0x5167('0xfb')));_0x18b01b[_0x5167('0x1a')]('/api/userProfiles',require(_0x5167('0xfc')));_0x18b01b[_0x5167('0x1a')](_0x5167('0xfd'),require(_0x5167('0xfe')));_0x18b01b['use']('/api/userProfile/resources',require('./api/userProfileResource'));_0x18b01b[_0x5167('0x1a')]('/api/userNotifications',require(_0x5167('0xff')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x100'),require(_0x5167('0x101')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x102'),require(_0x5167('0x103')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x104'),require('./api/whatsappInteraction'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x105'),require(_0x5167('0x106')));_0x18b01b[_0x5167('0x1a')]('/api/whatsapp/reports/queue',require(_0x5167('0x107')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x108'),require(_0x5167('0x109')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x10a'),require(_0x5167('0x10b')));_0x18b01b['use'](_0x5167('0x10c'),require(_0x5167('0x10d')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x10e'),require('./api/realtime'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x10f'),require(_0x5167('0x110')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x111'),require(_0x5167('0x112')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x113'),require(_0x5167('0x114')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x115'),require('./api/rpc'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x116'),require(_0x5167('0x117')));_0x18b01b[_0x5167('0x1a')]('/api/system',require('./api/system'));_0x18b01b[_0x5167('0x1a')](_0x5167('0x118'),require(_0x5167('0x119')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x11a'),require(_0x5167('0x11b')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x11c'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config[_0x5167('0x11f')],'/apidoc')));_0x18b01b[_0x5167('0x1a')](_0x5167('0x120'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config[_0x5167('0x11f')],'/www')));_0x18b01b[_0x5167('0x1a')]('/demo',express['static'](path[_0x5167('0x11e')](config[_0x5167('0x11f')],_0x5167('0x121'))));_0x18b01b[_0x5167('0x1a')](_0x5167('0x122'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config[_0x5167('0x11f')],_0x5167('0x123'),_0x5167('0x124'))));_0x18b01b['use'](_0x5167('0x125'),express[_0x5167('0x11d')](path[_0x5167('0x11e')](config['root'],'/server/files/plugins')));_0x18b01b[_0x5167('0x126')](_0x5167('0x127'))[_0x5167('0x128')](errors[0x194]);_0x18b01b[_0x5167('0x126')]('/*')['get'](function(_0x474079,_0x3ba208){_0x3ba208[_0x5167('0x129')](path[_0x5167('0x12a')](_0x18b01b[_0x5167('0x128')](_0x5167('0x12b'))+_0x5167('0x12c')));});};var sensitiveFields=[_0x5167('0x12d'),_0x5167('0x12e'),_0x5167('0x12f'),'apiKey','firstName',_0x5167('0x130'),'street',_0x5167('0x131'),_0x5167('0x132'),_0x5167('0x133'),_0x5167('0x134'),_0x5167('0x135'),_0x5167('0x136'),'securityToken','code',_0x5167('0x137'),_0x5167('0x138'),_0x5167('0x139'),_0x5167('0x13a'),_0x5167('0x13b'),'accessTokenSecret',_0x5167('0x13c'),_0x5167('0x13d'),_0x5167('0x13e'),_0x5167('0x13f'),_0x5167('0x140'),_0x5167('0x141'),_0x5167('0x142'),_0x5167('0x143'),_0x5167('0x144'),_0x5167('0x145'),_0x5167('0x146'),'secretaccesskey',_0x5167('0x147'),_0x5167('0x16'),_0x5167('0x148'),'accountSid','localstationid',_0x5167('0x149'),_0x5167('0x14a'),_0x5167('0x14b'),_0x5167('0x14c')];function maskSensitiveData(_0xb8500a){var _0x2af895=/(?!^)[\s\S](?!$)/g;if(!_[_0x5167('0x14d')](_0xb8500a))return;for(var _0x43e1c2 in _0xb8500a){if(_[_0x5167('0x14e')](_0xb8500a[_0x43e1c2])){for(var _0xf2ad6b=0x0;_0xf2ad6b<_0xb8500a[_0x43e1c2][_0x5167('0x14f')];_0xf2ad6b++){maskSensitiveData(_0xb8500a[_0x43e1c2][_0xf2ad6b]);}}else if(_[_0x5167('0x14d')](_0xb8500a[_0x43e1c2])){maskSensitiveData(_0xb8500a[_0x43e1c2]);}else if(_['isString'](_0xb8500a[_0x43e1c2])){_0xb8500a[_0x43e1c2]=_0xb8500a[_0x43e1c2][_0x5167('0x150')](/{{{/g,_0x5167('0x151'))[_0x5167('0x150')](/}}}/g,'}@@')['replace'](/{{/g,'@{')[_0x5167('0x150')](/}}/g,'}@');if(_[_0x5167('0x152')](sensitiveFields,_0x43e1c2)){_0xb8500a[_0x43e1c2]=_0xb8500a[_0x43e1c2]['replace'](_0x2af895,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 0c3321c..f375580 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ae5=['../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc'];(function(_0x43d558,_0x76a7ae){var _0x28c54c=function(_0x4d4d64){while(--_0x4d4d64){_0x43d558['push'](_0x43d558['shift']());}};_0x28c54c(++_0x76a7ae);}(_0x0ae5,0xf3));var _0x50ae=function(_0x13e612,_0x57ce24){_0x13e612=_0x13e612-0x0;var _0xfc4e35=_0x0ae5[_0x13e612];return _0xfc4e35;};'use strict';var jayson=require(_0x50ae('0x0'));var BPromise=require(_0x50ae('0x1'));var _=require('lodash');var config=require(_0x50ae('0x2'));exports[_0x50ae('0x3')]=function(){return new BPromise(function(_0x501e1e,_0xe9964a){var _0xe39797={};_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x5')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x6')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x7')));_0xe39797=_['merge'](_0xe39797,require('../api/voiceRecording/voiceRecording.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/voiceDialReport/voiceDialReport.rpc'));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0x8')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x9')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/memberReport/memberReport.rpc'));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0xa')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0xb')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0xc')));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0xd')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0xe')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0xf')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x10')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/mailMessage/mailMessage.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x11')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/mailQueueReport/mailQueueReport.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x12')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x13')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x14')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x15')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x16')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x17')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x18')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x19')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x1a')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x1b')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x1c')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x1d')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x1e')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x1f')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x20')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x21')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/chatMessage/chatMessage.rpc'));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0x22')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/cmContact/cmContact.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/cmHopper/cmHopper.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x23')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x24')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/interval/interval.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x25')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x26')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x27')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x28')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/variable/variable.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x29')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x2a')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/intDeskAccount/intDeskAccount.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x2b')));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0x2c')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x2d')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x2e')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x2f')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0x30')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x31')));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0x32')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x33')));_0xe39797=_['merge'](_0xe39797,require('../api/squareReportDetail/squareReportDetail.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x34')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/squareOdbc/squareOdbc.rpc'));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0x35')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x36')));_0xe39797=_['merge'](_0xe39797,require('../api/squareMessage/squareMessage.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x37')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require('../api/attachment/attachment.rpc'));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x38')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x39')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x3a')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x3b')));_0xe39797=_[_0x50ae('0x4')](_0xe39797,require(_0x50ae('0x3c')));_0xe39797=_['merge'](_0xe39797,require(_0x50ae('0x3d')));var _0x8f27ee=jayson[_0x50ae('0x3e')](_0xe39797)[_0x50ae('0x3f')]();var _0x2c8cd2=config[_0x50ae('0x40')][_0x50ae('0x41')]||config[_0x50ae('0x41')]+0x1;var _0x1a61aa=config[_0x50ae('0x40')]['ip']||_0x50ae('0x42');_0x8f27ee['on'](_0x50ae('0x43'),function(_0x36f3c5){return _0xe9964a(_0x36f3c5);});_0x8f27ee[_0x50ae('0x3')](_0x2c8cd2,_0x1a61aa,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1a61aa,_0x2c8cd2);require('../config/triggers')[_0x50ae('0x44')]();return _0x501e1e(_0x50ae('0x45')+_0x1a61aa+':'+_0x2c8cd2);});});}; \ No newline at end of file +var _0xc648=['listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','jayson/promise','bluebird','lodash'];(function(_0x997ede,_0x5a0814){var _0x1f3288=function(_0x5ddd2a){while(--_0x5ddd2a){_0x997ede['push'](_0x997ede['shift']());}};_0x1f3288(++_0x5a0814);}(_0xc648,0xf9));var _0x8c64=function(_0x50f356,_0x39d0d9){_0x50f356=_0x50f356-0x0;var _0x36bca1=_0xc648[_0x50f356];return _0x36bca1;};'use strict';var jayson=require(_0x8c64('0x0'));var BPromise=require(_0x8c64('0x1'));var _=require(_0x8c64('0x2'));var config=require('../config/environment');exports[_0x8c64('0x3')]=function(){return new BPromise(function(_0x319948,_0x10292a){var _0xbd5ca4={};_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/user/user.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x5')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x6')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x7')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x8')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x9')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xa')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/memberReport/memberReport.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0xb')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xc')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xd')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0xe')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/mailQueue/mailQueue.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0xf')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x10')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/mailApplication/mailApplication.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x11')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/faxAccount/faxAccount.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x12')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x13')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x14')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x15')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/faxQueueReport/faxQueueReport.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x16')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x17')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/smsMessage/smsMessage.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x18')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/openchannelApplication/openchannelApplication.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x19')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1a')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1b')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/chatInteraction/chatInteraction.rpc'));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/chatMessage/chatMessage.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1c')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1d')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/cmHopper/cmHopper.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x1e')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x1f')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x20')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x21')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/pause/pause.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/sound/sound.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/template/template.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x22')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x23')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x24')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intZohoAccount/intZohoAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x25')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x26')));_0xbd5ca4=_['merge'](_0xbd5ca4,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x27')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x28')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x29')));_0xbd5ca4=_['merge'](_0xbd5ca4,require(_0x8c64('0x2a')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2b')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2c')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2d')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/squareProject/squareProject.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2e')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/squareMessage/squareMessage.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x2f')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x30')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require('../api/plugin/plugin.rpc'));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x31')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x32')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x33')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x34')));_0xbd5ca4=_[_0x8c64('0x4')](_0xbd5ca4,require(_0x8c64('0x35')));var _0x4509bb=jayson[_0x8c64('0x36')](_0xbd5ca4)[_0x8c64('0x37')]();var _0x2486e5=config[_0x8c64('0x38')][_0x8c64('0x39')]||config[_0x8c64('0x39')]+0x1;var _0x3ebe92=config[_0x8c64('0x38')]['ip']||_0x8c64('0x3a');_0x4509bb['on'](_0x8c64('0x3b'),function(_0x288e0b){return _0x10292a(_0x288e0b);});_0x4509bb[_0x8c64('0x3')](_0x2486e5,_0x3ebe92,function(){console[_0x8c64('0x3c')](_0x8c64('0x3d'),_0x3ebe92,_0x2486e5);require('../config/triggers')[_0x8c64('0x3e')]();return _0x319948('RPC\x20listening\x20on\x20'+_0x3ebe92+':'+_0x2486e5);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 47ccf7e..a3820c2 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 _0xf781=['headers','emit','ready','line','hangup','520-Invalid','520\x20End\x20of\x20proper','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','error','code','E_AGI_SOCKET_CLOSE','timeout','pipe','function','write','close','prototype','sync','answer','sendRequest','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','getVariable','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0xf781,0xd2));var _0x1f78=function(_0x144022,_0xe9a742){_0x144022=_0x144022-0x0;var _0x5a1ed9=_0xf781[_0x144022];return _0x5a1ed9;};'use strict';var util=require(_0x1f78('0x0'));var _=require('lodash');var EventEmitter=require(_0x1f78('0x1'))[_0x1f78('0x2')];var AGIReply=require(_0x1f78('0x3'));var AGIError=require(_0x1f78('0x4'));function AGIChannel(_0x972c4c){var _0x572154=this,_0x37a5b1=new AGIReply(),_0x2cac13=![],_0x2f035d={};EventEmitter[_0x1f78('0x5')](_0x572154);_0x972c4c[_0x1f78('0x6')](_0x1f78('0x7'));_0x972c4c[_0x1f78('0x8')](0x8*0x3c*0x3c*0x3e8);_0x37a5b1[_0x1f78('0x6')](_0x1f78('0x7'));_0x37a5b1['on'](_0x1f78('0x9'),function(_0x44defc){for(var _0x38c270 in _0x44defc){_0x572154[_0x38c270]=_0x44defc[_0x38c270];}_0x572154[_0x1f78('0xa')](_0x1f78('0xb'));});_0x37a5b1['on'](_0x1f78('0xc'),function(_0x297a6e){if(_0x297a6e['toLowerCase']()==_0x1f78('0xd')){_0x572154[_0x1f78('0xa')](_0x1f78('0xd'));return;}if(_0x297a6e['substring'](0x0,0xb)==_0x1f78('0xe')){_0x2cac13=!![];}if(_0x2cac13){_0x2f035d['rx']+=_0x297a6e+'\x0a';if(_0x297a6e['search'](_0x1f78('0xf'))!=-0x1){_0x2cac13=![];}}else{_0x2f035d['rx']=_0x297a6e;}if(_0x2cac13){return;}if(typeof _0x2f035d['cb']=='function'){var _0x4901f=_0x2f035d['rx'][_0x1f78('0x10')](0x0,0x3),_0x36a0f3=null,_0x15e249=null;_0x4901f=parseInt(_0x4901f);if(isNaN(_0x4901f)){_0x2f035d['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1f78('0x11')});return;}if(_0x4901f!=0xc8){_0x2f035d['cb'](null,{'code':_0x4901f,'result':-0x1,'extra':'KO'});return;}_0x36a0f3=_0x2f035d['rx'][_0x1f78('0x10')](0x4)[_0x1f78('0x12')](_0x1f78('0x13'),'');if(_0x36a0f3[_0x1f78('0x14')]('\x20')!=-0x1){_0x36a0f3=_0x36a0f3['substr'](0x0,_0x36a0f3['indexOf']('\x20'));}if(_[_0x1f78('0x15')](_0x36a0f3,'-1')){_0x36a0f3=parseInt(_0x36a0f3);}_0x15e249=_0x2f035d['rx'][_0x1f78('0x16')]('\x20');if(_0x15e249['length']==0x3){_0x15e249=_0x15e249[0x2]['substring'](0x1,_0x15e249[0x2][_0x1f78('0x17')]-0x1);}else if(_0x15e249['length']>0x3){var _0x159e0f=/\((.+)\)/;var _0x18da2a=_0x2f035d['rx']['match'](_0x159e0f);if(_0x18da2a){_0x15e249=_0x18da2a[0x1];}else{_0x15e249=null;}}else{_0x15e249=null;}_0x2f035d['cb'](null,{'code':_0x4901f,'result':_0x36a0f3,'extra':_0x15e249});}});_0x972c4c['on'](_0x1f78('0x18'),function(_0x4d96f6){_0x572154[_0x1f78('0xa')](_0x1f78('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x4d96f6[_0x1f78('0x19')]));});_0x972c4c['on']('close',function(){_0x572154[_0x1f78('0xa')]('close',new AGIError(_0x1f78('0x1a')));});_0x972c4c['on']('timeout',function(){_0x572154[_0x1f78('0xa')](_0x1f78('0x1b'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x972c4c['destroy']();});_0x972c4c[_0x1f78('0x1c')](_0x37a5b1);this['command']=function(_0x4f17cb,_0x57a8c5){var _0x4f17cb=_0x4f17cb||'',_0x57a8c5=typeof _0x57a8c5==_0x1f78('0x1d')?_0x57a8c5:new Function();_0x2f035d={'tx':_0x4f17cb,'rx':'','cb':_0x57a8c5};_0x972c4c[_0x1f78('0x1e')](_0x4f17cb+'\x0a');},this[_0x1f78('0x1f')]=function(){_0x972c4c['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x1f78('0x20')]['sendRequest']=function(_0x116da8){return this['command'][_0x1f78('0x21')](this,_0x116da8);};AGIChannel[_0x1f78('0x20')][_0x1f78('0x22')]=function(){return this[_0x1f78('0x23')](_0x1f78('0x24'));};AGIChannel[_0x1f78('0x20')]['getData']=function(_0x4a6cd5,_0x212809,_0x3469f7){_0x4a6cd5=_0x4a6cd5===undefined?_0x1f78('0x25'):_0x4a6cd5;_0x212809=_0x212809===undefined?'5':_0x212809;_0x3469f7=_0x3469f7===undefined?'1':_0x3469f7;return this[_0x1f78('0x23')](util[_0x1f78('0x26')](_0x1f78('0x27'),_0x4a6cd5,_0x212809*0x3e8,_0x3469f7));};AGIChannel[_0x1f78('0x20')]['noop']=function(_0x306817){_0x306817=_0x306817||_0x1f78('0x28');return this[_0x1f78('0x23')](util[_0x1f78('0x26')]('VERBOSE\x20\x22%s\x22',_0x306817));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x29')]=function(_0x1f12a4,_0x13b0c8){if(_[_0x1f78('0x2a')](_0x13b0c8)){return this['sendRequest'](util[_0x1f78('0x26')](_0x1f78('0x2b'),_0x1f12a4,_0x13b0c8['join'](',')));}return this['sendRequest'](util['format']('EXEC\x20%s\x20%s',_0x1f12a4,_0x13b0c8));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x2c')]=function(_0x51cd0b){return this[_0x1f78('0x23')](util[_0x1f78('0x26')]('SET\x20CONTEXT\x20%s',_0x51cd0b));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x2d')]=function(_0xe08701){return this[_0x1f78('0x23')](util[_0x1f78('0x26')](_0x1f78('0x2e'),_0xe08701));};AGIChannel['prototype'][_0x1f78('0x2f')]=function(_0x4252e5){return this[_0x1f78('0x23')](util[_0x1f78('0x26')](_0x1f78('0x30'),_0x4252e5));};AGIChannel[_0x1f78('0x20')]['hangup']=function(){return this[_0x1f78('0x23')](_0x1f78('0x31'));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x32')]=function(_0x25d036,_0x10b043){var _0xf01faf=_[_0x1f78('0x33')](_0x10b043)||_[_0x1f78('0x34')](_0x10b043)?_0x10b043[_0x1f78('0x35')]():_0x10b043;return this[_0x1f78('0x23')](util['format'](_0x1f78('0x36'),_0x25d036,_0xf01faf?_0xf01faf[_0x1f78('0x35')]()[_0x1f78('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x37')]=function(_0x3fa1f8,_0x1c8ffb){return this[_0x1f78('0x23')](util[_0x1f78('0x26')](_0x1f78('0x38'),_0x3fa1f8,_0x1c8ffb));};AGIChannel[_0x1f78('0x20')]['sayDigits']=function(_0x3b8009,_0x3a3247){return this['sendRequest'](util[_0x1f78('0x26')](_0x1f78('0x39'),_0x3b8009,_0x3a3247));};AGIChannel['prototype']['sayPhonetic']=function(_0xc62c2d,_0x4dd2fa){return this[_0x1f78('0x23')](util[_0x1f78('0x26')](_0x1f78('0x3a'),_0xc62c2d,_0x4dd2fa));};AGIChannel[_0x1f78('0x20')]['continueAt']=function(_0x2dd4bc,_0x1a9485,_0x571d8b){_0x1a9485=_0x1a9485||this[_0x1f78('0x3b')];_0x571d8b=_0x571d8b||0x1;this[_0x1f78('0x2c')](_0x2dd4bc);this['setExtension'](_0x1a9485);this[_0x1f78('0x2f')](_0x571d8b);return this['noop'](util[_0x1f78('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x2dd4bc,_0x1a9485,_0x571d8b));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x3c')]=function(_0x2a1f03){return this[_0x1f78('0x23')](util[_0x1f78('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x2a1f03));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x3d')]=function(_0x3d0db1,_0x2eb581,_0x295dd3,_0x407d8c,_0x3c386a,_0x40234c){_0x2eb581=_0x2eb581||_0x1f78('0x3e');_0x295dd3=_0x295dd3||'';_0x407d8c=_0x407d8c===undefined?-0x1:_0x407d8c==='-1'?-0x1:_0x407d8c*0x3e8;_0x3c386a=_0x3c386a===undefined?'':'s='+_0x3c386a;_0x40234c=_0x40234c?'BEEP':'';return this[_0x1f78('0x23')](util[_0x1f78('0x26')](_0x1f78('0x3f'),_0x3d0db1,_0x2eb581,_0x295dd3,_0x407d8c,_0x40234c,_0x3c386a));};AGIChannel[_0x1f78('0x20')][_0x1f78('0x40')]=function(_0x32d302,_0x295c6f){_0x295c6f=_0x295c6f||'';return this[_0x1f78('0x23')](util[_0x1f78('0x26')](_0x1f78('0x41'),_0x32d302,_0x295c6f));};AGIChannel['prototype']['agi']=function(_0x209b0f){return this['exec'](_0x1f78('0x42'),_0x209b0f);};AGIChannel[_0x1f78('0x20')][_0x1f78('0x43')]=function(_0x422a1b){return this[_0x1f78('0x29')](_0x1f78('0x44'),_0x422a1b);};AGIChannel[_0x1f78('0x20')][_0x1f78('0x18')]=function(_0x4cee38,_0x5c1783){this[_0x1f78('0x45')](util[_0x1f78('0x26')](_0x1f78('0x46'),_0x4cee38['id'],_0x4cee38[_0x1f78('0x47')],_0x5c1783));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1f78('0x48')]=AGIChannel; \ No newline at end of file +var _0xa423=['lodash','events','EventEmitter','./reply','call','setEncoding','utf8','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','no\x20code','replace','result=','substr','startsWith','length','match','error','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','answer','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','extension','setContext','setPriority','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util'];(function(_0x152720,_0x413122){var _0x47956c=function(_0x559252){while(--_0x559252){_0x152720['push'](_0x152720['shift']());}};_0x47956c(++_0x413122);}(_0xa423,0x16c));var _0x3a42=function(_0x26ce6f,_0x1ce3ca){_0x26ce6f=_0x26ce6f-0x0;var _0x18368d=_0xa423[_0x26ce6f];return _0x18368d;};'use strict';var util=require(_0x3a42('0x0'));var _=require(_0x3a42('0x1'));var EventEmitter=require(_0x3a42('0x2'))[_0x3a42('0x3')];var AGIReply=require(_0x3a42('0x4'));var AGIError=require('./error');function AGIChannel(_0x28bbcd){var _0x857de4=this,_0x5c4f6a=new AGIReply(),_0xc6780b=![],_0x33f87e={};EventEmitter[_0x3a42('0x5')](_0x857de4);_0x28bbcd[_0x3a42('0x6')](_0x3a42('0x7'));_0x28bbcd['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x5c4f6a[_0x3a42('0x6')](_0x3a42('0x7'));_0x5c4f6a['on'](_0x3a42('0x8'),function(_0x3a08a1){for(var _0x1be0b7 in _0x3a08a1){_0x857de4[_0x1be0b7]=_0x3a08a1[_0x1be0b7];}_0x857de4[_0x3a42('0x9')](_0x3a42('0xa'));});_0x5c4f6a['on'](_0x3a42('0xb'),function(_0x1aba7e){if(_0x1aba7e[_0x3a42('0xc')]()==_0x3a42('0xd')){_0x857de4['emit'](_0x3a42('0xd'));return;}if(_0x1aba7e[_0x3a42('0xe')](0x0,0xb)==_0x3a42('0xf')){_0xc6780b=!![];}if(_0xc6780b){_0x33f87e['rx']+=_0x1aba7e+'\x0a';if(_0x1aba7e[_0x3a42('0x10')]('520\x20End\x20of\x20proper')!=-0x1){_0xc6780b=![];}}else{_0x33f87e['rx']=_0x1aba7e;}if(_0xc6780b){return;}if(typeof _0x33f87e['cb']=='function'){var _0x11ccc8=_0x33f87e['rx'][_0x3a42('0xe')](0x0,0x3),_0x4df153=null,_0x4008ea=null;_0x11ccc8=parseInt(_0x11ccc8);if(isNaN(_0x11ccc8)){_0x33f87e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3a42('0x11')});return;}if(_0x11ccc8!=0xc8){_0x33f87e['cb'](null,{'code':_0x11ccc8,'result':-0x1,'extra':'KO'});return;}_0x4df153=_0x33f87e['rx'][_0x3a42('0xe')](0x4)[_0x3a42('0x12')](_0x3a42('0x13'),'');if(_0x4df153['indexOf']('\x20')!=-0x1){_0x4df153=_0x4df153[_0x3a42('0x14')](0x0,_0x4df153['indexOf']('\x20'));}if(_[_0x3a42('0x15')](_0x4df153,'-1')){_0x4df153=parseInt(_0x4df153);}_0x4008ea=_0x33f87e['rx']['split']('\x20');if(_0x4008ea[_0x3a42('0x16')]==0x3){_0x4008ea=_0x4008ea[0x2][_0x3a42('0xe')](0x1,_0x4008ea[0x2][_0x3a42('0x16')]-0x1);}else if(_0x4008ea['length']>0x3){var _0x486c74=/\((.+)\)/;var _0x4eae89=_0x33f87e['rx'][_0x3a42('0x17')](_0x486c74);if(_0x4eae89){_0x4008ea=_0x4eae89[0x1];}else{_0x4008ea=null;}}else{_0x4008ea=null;}_0x33f87e['cb'](null,{'code':_0x11ccc8,'result':_0x4df153,'extra':_0x4008ea});}});_0x28bbcd['on'](_0x3a42('0x18'),function(_0x438cf1){_0x857de4[_0x3a42('0x9')](_0x3a42('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0x438cf1[_0x3a42('0x19')]));});_0x28bbcd['on'](_0x3a42('0x1a'),function(){_0x857de4[_0x3a42('0x9')](_0x3a42('0x1a'),new AGIError(_0x3a42('0x1b')));});_0x28bbcd['on'](_0x3a42('0x1c'),function(){_0x857de4['emit'](_0x3a42('0x1c'),new AGIError(_0x3a42('0x1d')));_0x28bbcd[_0x3a42('0x1e')]();});_0x28bbcd[_0x3a42('0x1f')](_0x5c4f6a);this[_0x3a42('0x20')]=function(_0x526d7c,_0x34927a){var _0x526d7c=_0x526d7c||'',_0x34927a=typeof _0x34927a==_0x3a42('0x21')?_0x34927a:new Function();_0x33f87e={'tx':_0x526d7c,'rx':'','cb':_0x34927a};_0x28bbcd[_0x3a42('0x22')](_0x526d7c+'\x0a');},this['close']=function(){_0x28bbcd[_0x3a42('0x1e')]();};}util[_0x3a42('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x3a42('0x24')][_0x3a42('0x25')]=function(_0x1540e5){return this[_0x3a42('0x20')][_0x3a42('0x26')](this,_0x1540e5);};AGIChannel[_0x3a42('0x24')][_0x3a42('0x27')]=function(){return this[_0x3a42('0x25')](_0x3a42('0x28'));};AGIChannel['prototype'][_0x3a42('0x29')]=function(_0x468ea8,_0x4b3062,_0x3027dd){_0x468ea8=_0x468ea8===undefined?'beep':_0x468ea8;_0x4b3062=_0x4b3062===undefined?'5':_0x4b3062;_0x3027dd=_0x3027dd===undefined?'1':_0x3027dd;return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x2b'),_0x468ea8,_0x4b3062*0x3e8,_0x3027dd));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x2c')]=function(_0xaf28ad){_0xaf28ad=_0xaf28ad||'NO\x20MESSAGE';return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x2d'),_0xaf28ad));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x2e')]=function(_0x44ef39,_0x41776f){if(_['isArray'](_0x41776f)){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x2f'),_0x44ef39,_0x41776f[_0x3a42('0x30')](',')));}return this[_0x3a42('0x25')](util['format']('EXEC\x20%s\x20%s',_0x44ef39,_0x41776f));};AGIChannel[_0x3a42('0x24')]['setContext']=function(_0x3fb07d){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x31'),_0x3fb07d));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x32')]=function(_0x57123d){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x33'),_0x57123d));};AGIChannel['prototype']['setPriority']=function(_0x41df56){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x34'),_0x41df56));};AGIChannel[_0x3a42('0x24')]['hangup']=function(){return this['sendRequest'](_0x3a42('0x35'));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x36')]=function(_0x28794e,_0x49e720){var _0x32992e=_[_0x3a42('0x37')](_0x49e720)||_['isNumber'](_0x49e720)?_0x49e720['toString']():_0x49e720;return this['sendRequest'](util[_0x3a42('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x28794e,_0x32992e?_0x32992e[_0x3a42('0x38')]()[_0x3a42('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x39')]=function(_0x20bfb6,_0x3cda8c){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x3a'),_0x20bfb6,_0x3cda8c));};AGIChannel['prototype'][_0x3a42('0x3b')]=function(_0x3a33f3,_0x2541db){return this[_0x3a42('0x25')](util[_0x3a42('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x3a33f3,_0x2541db));};AGIChannel[_0x3a42('0x24')]['sayPhonetic']=function(_0x4e9224,_0x4d356d){return this['sendRequest'](util[_0x3a42('0x2a')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x4e9224,_0x4d356d));};AGIChannel['prototype']['continueAt']=function(_0x32b3a0,_0x5bb3df,_0x4d8d60){_0x5bb3df=_0x5bb3df||this[_0x3a42('0x3c')];_0x4d8d60=_0x4d8d60||0x1;this[_0x3a42('0x3d')](_0x32b3a0);this[_0x3a42('0x32')](_0x5bb3df);this[_0x3a42('0x3e')](_0x4d8d60);return this[_0x3a42('0x2c')](util[_0x3a42('0x2a')]('GOTO\x20%s\x20%s\x20%s',_0x32b3a0,_0x5bb3df,_0x4d8d60));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x3f')]=function(_0x3e5f89){return this['sendRequest'](util[_0x3a42('0x2a')](_0x3a42('0x40'),_0x3e5f89));};AGIChannel['prototype'][_0x3a42('0x41')]=function(_0x463617,_0x3b7e7d,_0x96f531,_0x452b9c,_0x395fc6,_0x473dac){_0x3b7e7d=_0x3b7e7d||'wav';_0x96f531=_0x96f531||'';_0x452b9c=_0x452b9c===undefined?-0x1:_0x452b9c==='-1'?-0x1:_0x452b9c*0x3e8;_0x395fc6=_0x395fc6===undefined?'':'s='+_0x395fc6;_0x473dac=_0x473dac?_0x3a42('0x42'):'';return this[_0x3a42('0x25')](util[_0x3a42('0x2a')](_0x3a42('0x43'),_0x463617,_0x3b7e7d,_0x96f531,_0x452b9c,_0x473dac,_0x395fc6));};AGIChannel[_0x3a42('0x24')]['streamFile']=function(_0x4ad40c,_0x258026){_0x258026=_0x258026||'';return this[_0x3a42('0x25')](util['format'](_0x3a42('0x44'),_0x4ad40c,_0x258026));};AGIChannel[_0x3a42('0x24')][_0x3a42('0x45')]=function(_0x1645b8){return this[_0x3a42('0x2e')]('AGI',_0x1645b8);};AGIChannel[_0x3a42('0x24')][_0x3a42('0x46')]=function(_0x3a3293){return this[_0x3a42('0x2e')]('WAIT',_0x3a3293);};AGIChannel[_0x3a42('0x24')][_0x3a42('0x18')]=function(_0x3d4897,_0x2d3e3c){this[_0x3a42('0x2c')](util[_0x3a42('0x2a')](_0x3a42('0x47'),_0x3d4897['id'],_0x3d4897['label'],_0x2d3e3c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3a42('0x48')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 798ba9c..a460479 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 _0xf112=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.'];(function(_0x4aea97,_0x5420d8){var _0x37daeb=function(_0x4a859a){while(--_0x4a859a){_0x4aea97['push'](_0x4aea97['shift']());}};_0x37daeb(++_0x5420d8);}(_0xf112,0x10e));var _0x2f11=function(_0x2c3a47,_0x170687){_0x2c3a47=_0x2c3a47-0x0;var _0x1c04de=_0xf112[_0x2c3a47];return _0x1c04de;};'use strict';var util=require(_0x2f11('0x0'));var error={'E_AGI_UNDEFINED':_0x2f11('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x2f11('0x2'),'E_AGI_SERVER_CLOSE':_0x2f11('0x3'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x2f11('0x4'),'E_AGI_SOCKET_ERROR':_0x2f11('0x5'),'E_AGI_SOCKET_CLOSE':_0x2f11('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x2f11('0x7'),'E_AGI_COMMAND_EMPTY':_0x2f11('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2f11('0x9'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x45d84b){var _0x45d84b=_0x45d84b||null,_0xd2c119=_0xd2c119||[],_0xe67d28=0x1,_0x369204='';if(!error[_0x45d84b]){_0x45d84b=_0x2f11('0xa');}_0xd2c119[_0x2f11('0xb')](error[_0x45d84b]);while(arguments[_0xe67d28]){_0xd2c119[_0x2f11('0xb')](arguments[_0xe67d28]);_0xe67d28++;}_0x369204=util[_0x2f11('0xc')][_0x2f11('0xd')](util,_0xd2c119);this[_0x2f11('0xe')]=_0x369204;this[_0x2f11('0xf')]=_0x45d84b;}module[_0x2f11('0x10')]=AGIError; \ No newline at end of file +var _0x0aea=['apply','message','exports','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format'];(function(_0x3c5561,_0x5bbeed){var _0x44e097=function(_0x523dea){while(--_0x523dea){_0x3c5561['push'](_0x3c5561['shift']());}};_0x44e097(++_0x5bbeed);}(_0x0aea,0xcf));var _0xa0ae=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0x0aea[_0x295314];return _0x584b0c;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xa0ae('0x0'),'E_AGI_SERVER_MAXCONNECTION':_0xa0ae('0x1'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xa0ae('0x2'),'E_AGI_SOCKET_TIMEOUT':_0xa0ae('0x3'),'E_AGI_COMMAND_EMPTY':_0xa0ae('0x4'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xa0ae('0x5')};function AGIError(_0x1aaa42){var _0x1aaa42=_0x1aaa42||null,_0xac1047=_0xac1047||[],_0x53286f=0x1,_0x21e3ad='';if(!error[_0x1aaa42]){_0x1aaa42=_0xa0ae('0x6');}_0xac1047[_0xa0ae('0x7')](error[_0x1aaa42]);while(arguments[_0x53286f]){_0xac1047[_0xa0ae('0x7')](arguments[_0x53286f]);_0x53286f++;}_0x21e3ad=util[_0xa0ae('0x8')][_0xa0ae('0x9')](util,_0xac1047);this[_0xa0ae('0xa')]=_0x21e3ad;this['name']=_0x1aaa42;}module[_0xa0ae('0xb')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 0c8d025..e174a95 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 _0xdc3f=['default','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target'];(function(_0x29076e,_0xd8cf1){var _0x37d212=function(_0x45f065){while(--_0x45f065){_0x29076e['push'](_0x29076e['shift']());}};_0x37d212(++_0xd8cf1);}(_0xdc3f,0xa1));var _0xfdc3=function(_0x20bd9a,_0x1e8a7f){_0x20bd9a=_0x20bd9a-0x0;var _0x39150f=_0xdc3f[_0x20bd9a];return _0x39150f;};'use strict';var _=require(_0xfdc3('0x0'));var logger=require(_0xfdc3('0x1'))('agi');var verticesWithRetry=[_0xfdc3('0x2'),_0xfdc3('0x3'),_0xfdc3('0x4')];var Graph=function(){this[_0xfdc3('0x5')]={};this[_0xfdc3('0x6')]={};this[_0xfdc3('0x7')]=0x0;};Graph[_0xfdc3('0x8')][_0xfdc3('0x9')]=function(_0x2d167b){this[_0xfdc3('0x5')][_0x2d167b['id']]=_0x2d167b;this[_0xfdc3('0x6')][_0x2d167b['id']]=[];};Graph['prototype'][_0xfdc3('0xa')]=function(_0x27a499,_0x49c9f7,_0x26caca){this[_0xfdc3('0x6')][_0x27a499][_0xfdc3('0xb')]({'target':_0x49c9f7,'condition':_0x26caca});this['numberOfEdges']+=0x1;};Graph[_0xfdc3('0x8')][_0xfdc3('0xc')]=function(){return _['size'](this[_0xfdc3('0x5')]);};Graph['prototype'][_0xfdc3('0xd')]=function(){return this[_0xfdc3('0x7')];};Graph[_0xfdc3('0x8')][_0xfdc3('0xe')]=function(_0x3401e8){return this[_0xfdc3('0x5')][_0x3401e8];};Graph[_0xfdc3('0x8')][_0xfdc3('0xf')]=function(_0x5612d,_0x4fc800){if(!this[_0xfdc3('0x5')][_0x5612d]){return logger['info']('no\x20vertex\x20found');}var _0x57e7f6=_0x4fc800(this['vertices'][_0x5612d]);if(!_0x57e7f6){return logger[_0xfdc3('0x10')](_0xfdc3('0x11'));}if(this[_0xfdc3('0x6')][_0x5612d][_0xfdc3('0x12')]===0x0){return logger[_0xfdc3('0x10')](_0xfdc3('0x13'));}for(var _0x422a9c=0x0,_0x14047c=[],_0x27f389=![];_0x422a9c\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]','./server','listening','connection','xml2json','util','../../config/environment','../../config/logger','../../config/license/util','./graph','./vertices','agi','defaults','nextTick','error','stack','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','addEdge','target','getSquareProject','then','catch','createSquareReport','indexOf','agi_','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','debug','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x63baac,_0x347d42){var _0x410e4e=function(_0x1867b1){while(--_0x1867b1){_0x63baac['push'](_0x63baac['shift']());}};_0x410e4e(++_0x347d42);}(_0x7f6d,0xc3));var _0xd7f6=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x7f6d[_0x45bf86];return _0x1f02b7;};'use strict';var parser=require(_0xd7f6('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0xd7f6('0x1'));var moment=require('moment');var config=require(_0xd7f6('0x2'));var logger=require(_0xd7f6('0x3'))('agi');var utilLicense=require(_0xd7f6('0x4'));var rpc=require('./rpc');var mailRpc=require('./mailRpc');var Graph=require(_0xd7f6('0x5'));var Vertices=require(_0xd7f6('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xd7f6('0x7')]=_[_0xd7f6('0x8')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x1efd94){process[_0xd7f6('0x9')](function(){syncho(function(){try{setChannelVariables(_0x1efd94);agiHandler(_0x1efd94);}catch(_0x5ecd19){logger[_0xd7f6('0xa')](_0x5ecd19[_0xd7f6('0xb')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config['agi'][_0xd7f6('0xc')]);logger[_0xd7f6('0xd')](util[_0xd7f6('0xe')](_0xd7f6('0xf'),config[_0xd7f6('0x7')]['ip'],config[_0xd7f6('0x7')][_0xd7f6('0xc')]));}function errorHandler(_0x5df161){if(_0x5df161&&_0x5df161[_0xd7f6('0x10')]&&_0x5df161['message']){logger[_0xd7f6('0xa')](util[_0xd7f6('0xe')](_0xd7f6('0x11'),_0x5df161[_0xd7f6('0x10')],_0x5df161[_0xd7f6('0x12')]));}else{logger['error'](util[_0xd7f6('0xe')](_0xd7f6('0x13'),_0x5df161[_0xd7f6('0xb')]));}}function closeHandler(){logger['info'](util[_0xd7f6('0xe')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xd7f6('0x14')],this['calleridname'],this[_0xd7f6('0x15')],this[_0xd7f6('0x16')],this[_0xd7f6('0x17')]));try{createSquareReport(this);}catch(_0x1d5299){logger[_0xd7f6('0xa')](_0x1d5299[_0xd7f6('0xb')]);}}function timeoutHandler(){logger[_0xd7f6('0xd')](util['format'](_0xd7f6('0x18'),this[_0xd7f6('0x14')],this[_0xd7f6('0x19')],this[_0xd7f6('0x15')],this[_0xd7f6('0x16')],this[_0xd7f6('0x17')]));}function hangupHandler(){logger[_0xd7f6('0xd')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xd7f6('0x14')],this[_0xd7f6('0x19')],this['callerid'],this[_0xd7f6('0x16')],this[_0xd7f6('0x17')]));this['evtHangup']=!![];}function getRoot(_0x4eb473){return parser['toJson'](_0x4eb473,{'object':!![]})[_0xd7f6('0x1a')][_0xd7f6('0x1b')];}function addVertex(_0x49a3bc,_0x3f7c0a,_0x269aae){_0x3f7c0a[_0xd7f6('0x1c')]=_0x269aae;if(_0x3f7c0a[_0xd7f6('0x1d')]('retry')){_0x3f7c0a[_0xd7f6('0x1e')]=parseInt(_0x3f7c0a[_0xd7f6('0x1f')],0xa);}_0x49a3bc[_0xd7f6('0x20')](_[_0xd7f6('0x21')](_0x3f7c0a,_0xd7f6('0x22')));}function initGraph(_0x271ea5,_0x16f376){var _0x113a4d=new Graph();for(var _0x16fe9f in _0x271ea5){if(_0x271ea5[_0xd7f6('0x1d')](_0x16fe9f)){if(_[_0xd7f6('0x23')](_0x271ea5[_0x16fe9f])){for(var _0x387111=0x0;_0x387111<_0x271ea5[_0x16fe9f][_0xd7f6('0x24')];_0x387111+=0x1){addVertex(_0x113a4d,_0x271ea5[_0x16fe9f][_0x387111],_0x16fe9f);}}else{addVertex(_0x113a4d,_0x271ea5[_0x16fe9f],_0x16fe9f);}}}for(var _0x1efab1=0x0;_0x1efab1<_0x16f376[_0xd7f6('0x24')];_0x1efab1+=0x1){if(_0x16f376[_0x1efab1][_0xd7f6('0x25')]&&_0x16f376[_0x1efab1]['target']){_0x113a4d[_0xd7f6('0x26')](_0x16f376[_0x1efab1][_0xd7f6('0x25')],_0x16f376[_0x1efab1][_0xd7f6('0x27')],_0x16f376[_0x1efab1]['value']);}}return _0x113a4d;}function getSquareProject(_0x106843,_0x5e8537){rpc[_0xd7f6('0x28')](_0x106843)[_0xd7f6('0x29')](function(_0x4089b9){_0x5e8537(null,_0x4089b9);})[_0xd7f6('0x2a')](function(_0x19c9ed){_0x5e8537(null,_0x19c9ed);});}function createSquareReport(_0x100395,_0x3e21c6){rpc[_0xd7f6('0x2b')](_0x100395)['then'](function(_0x1f8fda){if(_0x3e21c6){_0x3e21c6(null,_0x1f8fda);}})[_0xd7f6('0x2a')](function(_0x393354){if(_0x3e21c6){_0x3e21c6(null,_0x393354);}});}function setChannelVariables(_0x4c1859){for(var _0xf3fbf5 in _0x4c1859){if(_0x4c1859[_0xd7f6('0x1d')](_0xf3fbf5)){if(_0xf3fbf5[_0xd7f6('0x2c')](_0xd7f6('0x2d'))===0x0){_0x4c1859[_0xf3fbf5['substring'](0x4)]=_0x4c1859[_0xf3fbf5];delete _0x4c1859[_0xf3fbf5];}}}}function getLogFromObject(_0x512cb0){return util[_0xd7f6('0x2e')](_0x512cb0,{'showHidden':![],'depth':null});}function agiHandler(_0x37eb34){var _0x1d56b0,_0x3285ab,_0x5ae1fa,_0x748017,_0x5312d5;logger['debug'](_0xd7f6('0x2f'),JSON[_0xd7f6('0x30')](_0x37eb34,null,0x2));logger[_0xd7f6('0xd')](util[_0xd7f6('0xe')](_0xd7f6('0x31'),_0x37eb34['arg_1'],_0x37eb34[_0xd7f6('0x19')],_0x37eb34['callerid'],_0x37eb34[_0xd7f6('0x16')],_0x37eb34[_0xd7f6('0x17')]));_0x37eb34['on'](_0xd7f6('0xa'),errorHandler);_0x37eb34['on'](_0xd7f6('0x32'),closeHandler);_0x37eb34['on'](_0xd7f6('0x33'),timeoutHandler);_0x37eb34[_0xd7f6('0x34')]=![];_0x37eb34['on'](_0xd7f6('0x35'),hangupHandler);var _0x201e5a=getSquareProject[_0xd7f6('0x36')](null,_0x37eb34['arg_1']);if(_0x201e5a){if(_0x201e5a['production']){_0x1d56b0=getRoot(_0x201e5a[_0xd7f6('0x37')]);if(_0x1d56b0&&_0x1d56b0['start']){logger['debug']('root',JSON[_0xd7f6('0x30')](_0x1d56b0,null,0x2));_0x37eb34[_0xd7f6('0x38')]=moment()[_0xd7f6('0xe')](_0xd7f6('0x39'));_0x3285ab=initGraph(_[_0xd7f6('0x21')](_0x1d56b0,_0xd7f6('0x22')),_0x1d56b0[_0xd7f6('0x22')]);_0x5ae1fa=new Vertices(_0x37eb34,rpc,mailRpc);logger['info'](util['format'](_0xd7f6('0x3a'),_0x37eb34[_0xd7f6('0x14')],_0x37eb34[_0xd7f6('0x19')],_0x37eb34[_0xd7f6('0x15')],_0x37eb34[_0xd7f6('0x16')],_0x37eb34[_0xd7f6('0x17')]));_0x3285ab[_0xd7f6('0x3b')](_0x1d56b0['start']['id'],function(_0x1057a3){try{_0x1057a3=_0x5ae1fa['clear'](_0x1057a3);logger[_0xd7f6('0x3c')](_0xd7f6('0x3d'),JSON['stringify'](_0x1057a3,null,0x2));if(_0x1057a3[_0xd7f6('0x1c')]===_0xd7f6('0x3e')){logger[_0xd7f6('0xd')](_0xd7f6('0x3f'));_0x37eb34[_0xd7f6('0x40')]=_0x1057a3[_0xd7f6('0x40')]||_0x37eb34['context'];_0x37eb34[_0xd7f6('0x41')]=_0x1057a3[_0xd7f6('0x41')];_0x37eb34[_0xd7f6('0x42')]=_0x1057a3[_0xd7f6('0x42')]?_0x1057a3[_0xd7f6('0x42')]-0x1:0x1;return null;}else if(_0x1057a3&&_0x5ae1fa[_0x1057a3[_0xd7f6('0x1c')]]){_0x5312d5=_0x5ae1fa[_0x1057a3[_0xd7f6('0x1c')]](_0x1057a3);logger[_0xd7f6('0xd')](_0xd7f6('0x43'),JSON[_0xd7f6('0x30')](_0x5312d5,null,0x2));if(_0x5312d5&&_0x5312d5[_0xd7f6('0x44')]===AGI_CODE_SUCCESS&&_0x5312d5[_0xd7f6('0x45')]!==AGI_RESULT_ERROR&&!_0x37eb34[_0xd7f6('0x34')]){logger[_0xd7f6('0x3c')](_0xd7f6('0x43'),getLogFromObject(_0x5312d5));return _[_0xd7f6('0x46')](_0x5312d5[_0xd7f6('0x45')])?null:_0x5312d5[_0xd7f6('0x45')][_0xd7f6('0x47')]();}else{logger[_0xd7f6('0xa')](_0xd7f6('0x43'),getLogFromObject(_0x5312d5));return null;}}else{logger[_0xd7f6('0xa')](_0xd7f6('0x48'));return null;}}catch(_0x4de6a7){logger[_0xd7f6('0xa')](_0x4de6a7['stack']);return null;}});if(_0x1d56b0[_0xd7f6('0x49')]){logger[_0xd7f6('0xd')](util[_0xd7f6('0xe')](_0xd7f6('0x4a'),_0x37eb34['arg_1'],_0x37eb34['calleridname'],_0x37eb34[_0xd7f6('0x15')],_0x37eb34[_0xd7f6('0x16')],_0x37eb34[_0xd7f6('0x17')]));_0x3285ab[_0xd7f6('0x3b')](_0x1d56b0[_0xd7f6('0x49')]['id'],function(_0x504ef3){try{_0x504ef3=_0x5ae1fa[_0xd7f6('0x4b')](_0x504ef3);logger['debug'](_0xd7f6('0x3d'),JSON[_0xd7f6('0x30')](_0x504ef3,null,0x2));if(_0x504ef3&&_0x5ae1fa[_0x504ef3[_0xd7f6('0x1c')]]){_0x5312d5=_0x5ae1fa[_0x504ef3[_0xd7f6('0x1c')]](_0x504ef3);if(_0x5312d5){logger[_0xd7f6('0x3c')]('response',getLogFromObject(_0x5312d5));return _[_0xd7f6('0x46')](_0x5312d5[_0xd7f6('0x45')])?null:_0x5312d5[_0xd7f6('0x45')][_0xd7f6('0x47')]();}else{logger[_0xd7f6('0xa')](_0xd7f6('0x43'),getLogFromObject(_0x5312d5));return null;}}else{logger['error'](_0xd7f6('0x48'));return null;}}catch(_0x4e55dd){logger['error'](_0x4e55dd[_0xd7f6('0xb')]);return null;}});}logger[_0xd7f6('0xd')](util[_0xd7f6('0xe')](_0xd7f6('0x4c'),_0x37eb34[_0xd7f6('0x14')],_0x37eb34['calleridname'],_0x37eb34[_0xd7f6('0x15')],_0x37eb34[_0xd7f6('0x16')],_0x37eb34[_0xd7f6('0x17')]));logger['info'](util['format'](_0xd7f6('0x4d'),_0x37eb34[_0xd7f6('0x40')],_0x37eb34[_0xd7f6('0x41')],parseInt(_0x37eb34[_0xd7f6('0x42')],0xa)+0x1));_0x37eb34[_0xd7f6('0x4e')](_0x37eb34[_0xd7f6('0x40')],_0x37eb34[_0xd7f6('0x41')],parseInt(_0x37eb34[_0xd7f6('0x42')],0xa)+0x1);_0x37eb34[_0xd7f6('0x32')]();}}else{logger['error'](util['format'](_0xd7f6('0x4f'),_0x37eb34[_0xd7f6('0x14')]));_0x37eb34['continueAt'](_0x37eb34[_0xd7f6('0x40')],_0x37eb34[_0xd7f6('0x41')],parseInt(_0x37eb34['priority'],0xa)+0x1);_0x37eb34[_0xd7f6('0x32')]();}}else{logger['error'](util[_0xd7f6('0xe')](_0xd7f6('0x50'),_0x37eb34[_0xd7f6('0x14')]));_0x37eb34[_0xd7f6('0x4e')](_0x37eb34['context'],_0x37eb34['extension'],parseInt(_0x37eb34['priority'],0xa)+0x1);_0x37eb34['close']();}}function main(){var _0x3d9fe6;return utilLicense[_0xd7f6('0x51')]()[_0xd7f6('0x29')](function(_0xfb2357){if(_0xfb2357){if(_0xfb2357[_0xd7f6('0x52')]){if(_0xfb2357['callysquare']&&_0xfb2357[_0xd7f6('0x53')]>0x0){logger[_0xd7f6('0xd')](util[_0xd7f6('0xe')](_0xd7f6('0x54'),_0xfb2357[_0xd7f6('0x53')]));_0x3d9fe6=_0xfb2357[_0xd7f6('0x53')];}else{logger['info'](_0xd7f6('0x55'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x3d9fe6=-0x1;}}})['catch'](function(_0xd053e1){logger[_0xd7f6('0xa')](_0xd7f6('0x56'),_0xd053e1[_0xd7f6('0xb')]);})[_0xd7f6('0x49')](function(){var _0x38ad18=require(_0xd7f6('0x57'))(config[_0xd7f6('0x7')]['port'],config[_0xd7f6('0x7')]['ip'],_0x3d9fe6);_0x38ad18['on']('error',errorHandler);_0x38ad18['on'](_0xd7f6('0x58'),listeningHandler);_0x38ad18['on'](_0xd7f6('0x59'),connectionHandler);_0x38ad18['on'](_0xd7f6('0x32'),closeHandler);});}main(); \ No newline at end of file +var _0x232f=['Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','message','[%s]\x20%s','name','[ERROR]\x20%s','stack','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','agicommand','hasOwnProperty','retry','omit','isArray','length','target','addEdge','source','value','getSquareProject','then','catch','createSquareReport','indexOf','inspect','stringify','close','timeout','hangup','sync','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','debug','vertex','gotoc','context','extension','priority','response','code','isUndefined','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','util','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','127.0.0.1','nextTick','error'];(function(_0xe337a4,_0x552ea5){var _0x416b9d=function(_0x556140){while(--_0x556140){_0xe337a4['push'](_0xe337a4['shift']());}};_0x416b9d(++_0x552ea5);}(_0x232f,0xa0));var _0xf232=function(_0x58b250,_0x210a75){_0x58b250=_0x58b250-0x0;var _0x2ad6d6=_0x232f[_0x58b250];return _0x2ad6d6;};'use strict';var parser=require(_0xf232('0x0'));var _=require('lodash');var syncho=require('syncho');var util=require(_0xf232('0x1'));var moment=require('moment');var config=require('../../config/environment');var logger=require(_0xf232('0x2'))(_0xf232('0x3'));var utilLicense=require(_0xf232('0x4'));var rpc=require(_0xf232('0x5'));var mailRpc=require(_0xf232('0x6'));var Graph=require(_0xf232('0x7'));var Vertices=require(_0xf232('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0xf232('0x3')],{'ip':_0xf232('0x9'),'port':0x11dd});function connectionHandler(_0xe96796){process[_0xf232('0xa')](function(){syncho(function(){try{setChannelVariables(_0xe96796);agiHandler(_0xe96796);}catch(_0x3d0e46){logger[_0xf232('0xb')](_0x3d0e46['stack']);}});});}function listeningHandler(){console['log'](_0xf232('0xc'),config[_0xf232('0x3')][_0xf232('0xd')]);logger[_0xf232('0xe')](util[_0xf232('0xf')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xf232('0x3')]['ip'],config[_0xf232('0x3')][_0xf232('0xd')]));}function errorHandler(_0x1fb76b){if(_0x1fb76b&&_0x1fb76b['name']&&_0x1fb76b[_0xf232('0x10')]){logger['error'](util[_0xf232('0xf')](_0xf232('0x11'),_0x1fb76b[_0xf232('0x12')],_0x1fb76b[_0xf232('0x10')]));}else{logger[_0xf232('0xb')](util[_0xf232('0xf')](_0xf232('0x13'),_0x1fb76b[_0xf232('0x14')]));}}function closeHandler(){logger['info'](util[_0xf232('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0xf232('0x15')],this[_0xf232('0x16')],this[_0xf232('0x17')],this[_0xf232('0x18')],this[_0xf232('0x19')]));try{createSquareReport(this);}catch(_0x5e8a10){logger[_0xf232('0xb')](_0x5e8a10[_0xf232('0x14')]);}}function timeoutHandler(){logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x1a'),this[_0xf232('0x15')],this[_0xf232('0x16')],this[_0xf232('0x17')],this[_0xf232('0x18')],this[_0xf232('0x19')]));}function hangupHandler(){logger[_0xf232('0xe')](util['format'](_0xf232('0x1b'),this[_0xf232('0x15')],this[_0xf232('0x16')],this[_0xf232('0x17')],this[_0xf232('0x18')],this[_0xf232('0x19')]));this[_0xf232('0x1c')]=!![];}function getRoot(_0x299e38){return parser['toJson'](_0x299e38,{'object':!![]})[_0xf232('0x1d')]['root'];}function addVertex(_0x302b5c,_0x41b23f,_0x4c635d){_0x41b23f[_0xf232('0x1e')]=_0x4c635d;if(_0x41b23f[_0xf232('0x1f')](_0xf232('0x20'))){_0x41b23f['maxRetry']=parseInt(_0x41b23f['retry'],0xa);}_0x302b5c['addVertex'](_[_0xf232('0x21')](_0x41b23f,'mxCell'));}function initGraph(_0x3818a7,_0x2697cd){var _0x2113d2=new Graph();for(var _0x14729b in _0x3818a7){if(_0x3818a7[_0xf232('0x1f')](_0x14729b)){if(_[_0xf232('0x22')](_0x3818a7[_0x14729b])){for(var _0x1a35d5=0x0;_0x1a35d5<_0x3818a7[_0x14729b][_0xf232('0x23')];_0x1a35d5+=0x1){addVertex(_0x2113d2,_0x3818a7[_0x14729b][_0x1a35d5],_0x14729b);}}else{addVertex(_0x2113d2,_0x3818a7[_0x14729b],_0x14729b);}}}for(var _0x491d67=0x0;_0x491d67<_0x2697cd[_0xf232('0x23')];_0x491d67+=0x1){if(_0x2697cd[_0x491d67]['source']&&_0x2697cd[_0x491d67][_0xf232('0x24')]){_0x2113d2[_0xf232('0x25')](_0x2697cd[_0x491d67][_0xf232('0x26')],_0x2697cd[_0x491d67][_0xf232('0x24')],_0x2697cd[_0x491d67][_0xf232('0x27')]);}}return _0x2113d2;}function getSquareProject(_0x31c59e,_0x16805e){rpc[_0xf232('0x28')](_0x31c59e)[_0xf232('0x29')](function(_0x190ced){_0x16805e(null,_0x190ced);})[_0xf232('0x2a')](function(_0x43c2e9){_0x16805e(null,_0x43c2e9);});}function createSquareReport(_0x4cec7a,_0x1c1735){rpc[_0xf232('0x2b')](_0x4cec7a)[_0xf232('0x29')](function(_0x577a94){if(_0x1c1735){_0x1c1735(null,_0x577a94);}})[_0xf232('0x2a')](function(_0x5e449d){if(_0x1c1735){_0x1c1735(null,_0x5e449d);}});}function setChannelVariables(_0x36ae65){for(var _0x56dfaf in _0x36ae65){if(_0x36ae65[_0xf232('0x1f')](_0x56dfaf)){if(_0x56dfaf[_0xf232('0x2c')]('agi_')===0x0){_0x36ae65[_0x56dfaf['substring'](0x4)]=_0x36ae65[_0x56dfaf];delete _0x36ae65[_0x56dfaf];}}}}function getLogFromObject(_0xceb352){return util[_0xf232('0x2d')](_0xceb352,{'showHidden':![],'depth':null});}function agiHandler(_0x1bdb80){var _0x399bcd,_0x33e62f,_0x35fac5,_0x14b93b,_0x146158;logger['debug']('variables',JSON[_0xf232('0x2e')](_0x1bdb80,null,0x2));logger[_0xf232('0xe')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x1bdb80['arg_1'],_0x1bdb80[_0xf232('0x16')],_0x1bdb80['callerid'],_0x1bdb80[_0xf232('0x18')],_0x1bdb80[_0xf232('0x19')]));_0x1bdb80['on'](_0xf232('0xb'),errorHandler);_0x1bdb80['on'](_0xf232('0x2f'),closeHandler);_0x1bdb80['on'](_0xf232('0x30'),timeoutHandler);_0x1bdb80['evtHangup']=![];_0x1bdb80['on'](_0xf232('0x31'),hangupHandler);var _0x270853=getSquareProject[_0xf232('0x32')](null,_0x1bdb80[_0xf232('0x15')]);if(_0x270853){if(_0x270853['production']){_0x399bcd=getRoot(_0x270853['production']);if(_0x399bcd&&_0x399bcd[_0xf232('0x33')]){logger['debug'](_0xf232('0x34'),JSON['stringify'](_0x399bcd,null,0x2));_0x1bdb80[_0xf232('0x35')]=moment()[_0xf232('0xf')](_0xf232('0x36'));_0x33e62f=initGraph(_[_0xf232('0x21')](_0x399bcd,_0xf232('0x37')),_0x399bcd['mxCell']);_0x35fac5=new Vertices(_0x1bdb80,rpc,mailRpc);logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x38'),_0x1bdb80[_0xf232('0x15')],_0x1bdb80[_0xf232('0x16')],_0x1bdb80[_0xf232('0x17')],_0x1bdb80[_0xf232('0x18')],_0x1bdb80[_0xf232('0x19')]));_0x33e62f[_0xf232('0x39')](_0x399bcd[_0xf232('0x33')]['id'],function(_0x32e580){try{_0x32e580=_0x35fac5['clear'](_0x32e580);logger[_0xf232('0x3a')](_0xf232('0x3b'),JSON[_0xf232('0x2e')](_0x32e580,null,0x2));if(_0x32e580[_0xf232('0x1e')]===_0xf232('0x3c')){logger[_0xf232('0xe')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x1bdb80['context']=_0x32e580[_0xf232('0x3d')]||_0x1bdb80[_0xf232('0x3d')];_0x1bdb80[_0xf232('0x3e')]=_0x32e580[_0xf232('0x3e')];_0x1bdb80[_0xf232('0x3f')]=_0x32e580[_0xf232('0x3f')]?_0x32e580[_0xf232('0x3f')]-0x1:0x1;return null;}else if(_0x32e580&&_0x35fac5[_0x32e580['agicommand']]){_0x146158=_0x35fac5[_0x32e580[_0xf232('0x1e')]](_0x32e580);logger['info'](_0xf232('0x40'),JSON['stringify'](_0x146158,null,0x2));if(_0x146158&&_0x146158[_0xf232('0x41')]===AGI_CODE_SUCCESS&&_0x146158['result']!==AGI_RESULT_ERROR&&!_0x1bdb80[_0xf232('0x1c')]){logger[_0xf232('0x3a')](_0xf232('0x40'),getLogFromObject(_0x146158));return _[_0xf232('0x42')](_0x146158[_0xf232('0x43')])?null:_0x146158[_0xf232('0x43')][_0xf232('0x44')]();}else{logger[_0xf232('0xb')]('response',getLogFromObject(_0x146158));return null;}}else{logger[_0xf232('0xb')](_0xf232('0x45'));return null;}}catch(_0x32344d){logger[_0xf232('0xb')](_0x32344d[_0xf232('0x14')]);return null;}});if(_0x399bcd[_0xf232('0x46')]){logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x47'),_0x1bdb80[_0xf232('0x15')],_0x1bdb80[_0xf232('0x16')],_0x1bdb80[_0xf232('0x17')],_0x1bdb80['dnid'],_0x1bdb80[_0xf232('0x19')]));_0x33e62f[_0xf232('0x39')](_0x399bcd[_0xf232('0x46')]['id'],function(_0x3932cd){try{_0x3932cd=_0x35fac5[_0xf232('0x48')](_0x3932cd);logger[_0xf232('0x3a')](_0xf232('0x3b'),JSON['stringify'](_0x3932cd,null,0x2));if(_0x3932cd&&_0x35fac5[_0x3932cd[_0xf232('0x1e')]]){_0x146158=_0x35fac5[_0x3932cd['agicommand']](_0x3932cd);if(_0x146158){logger[_0xf232('0x3a')](_0xf232('0x40'),getLogFromObject(_0x146158));return _[_0xf232('0x42')](_0x146158[_0xf232('0x43')])?null:_0x146158[_0xf232('0x43')]['toString']();}else{logger[_0xf232('0xb')]('response',getLogFromObject(_0x146158));return null;}}else{logger[_0xf232('0xb')](_0xf232('0x45'));return null;}}catch(_0x5810ec){logger['error'](_0x5810ec[_0xf232('0x14')]);return null;}});}logger[_0xf232('0xe')](util['format'](_0xf232('0x49'),_0x1bdb80[_0xf232('0x15')],_0x1bdb80['calleridname'],_0x1bdb80[_0xf232('0x17')],_0x1bdb80['dnid'],_0x1bdb80[_0xf232('0x19')]));logger['info'](util[_0xf232('0xf')](_0xf232('0x4a'),_0x1bdb80['context'],_0x1bdb80['extension'],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1));_0x1bdb80[_0xf232('0x4b')](_0x1bdb80[_0xf232('0x3d')],_0x1bdb80[_0xf232('0x3e')],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1);_0x1bdb80[_0xf232('0x2f')]();}}else{logger[_0xf232('0xb')](util[_0xf232('0xf')]('Project\x20%s\x20not\x20published',_0x1bdb80['arg_1']));_0x1bdb80[_0xf232('0x4b')](_0x1bdb80['context'],_0x1bdb80[_0xf232('0x3e')],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1);_0x1bdb80[_0xf232('0x2f')]();}}else{logger[_0xf232('0xb')](util[_0xf232('0xf')](_0xf232('0x4c'),_0x1bdb80[_0xf232('0x15')]));_0x1bdb80[_0xf232('0x4b')](_0x1bdb80[_0xf232('0x3d')],_0x1bdb80[_0xf232('0x3e')],parseInt(_0x1bdb80[_0xf232('0x3f')],0xa)+0x1);_0x1bdb80[_0xf232('0x2f')]();}}function main(){var _0x23759a;return utilLicense[_0xf232('0x4d')]()[_0xf232('0x29')](function(_0xda3307){if(_0xda3307){if(_0xda3307[_0xf232('0x4e')]){if(_0xda3307[_0xf232('0x4f')]&&_0xda3307[_0xf232('0x4f')]>0x0){logger[_0xf232('0xe')](util[_0xf232('0xf')](_0xf232('0x50'),_0xda3307[_0xf232('0x4f')]));_0x23759a=_0xda3307[_0xf232('0x4f')];}else{logger[_0xf232('0xe')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xf232('0xe')](_0xf232('0x51'));_0x23759a=-0x1;}}})['catch'](function(_0x31f922){logger[_0xf232('0xb')](_0xf232('0x52'),_0x31f922[_0xf232('0x14')]);})[_0xf232('0x46')](function(){var _0x791cbd=require(_0xf232('0x53'))(config[_0xf232('0x3')][_0xf232('0xd')],config[_0xf232('0x3')]['ip'],_0x23759a);_0x791cbd['on'](_0xf232('0xb'),errorHandler);_0x791cbd['on'](_0xf232('0x54'),listeningHandler);_0x791cbd['on'](_0xf232('0x55'),connectionHandler);_0x791cbd['on'](_0xf232('0x2f'),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 fd16a97..ac0b55e 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 _0xebb1=['jayson/promise','client','http','request','then','message','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x19159a,_0x1cb5c3){var _0xa677f4=function(_0x24bb85){while(--_0x24bb85){_0x19159a['push'](_0x19159a['shift']());}};_0xa677f4(++_0x1cb5c3);}(_0xebb1,0xba));var _0x1ebb=function(_0x12d737,_0x61027e){_0x12d737=_0x12d737-0x0;var _0x10f9b7=_0xebb1[_0x12d737];return _0x10f9b7;};'use strict';var BPromise=require(_0x1ebb('0x0'));var jayson=require(_0x1ebb('0x1'));var client=jayson[_0x1ebb('0x2')][_0x1ebb('0x3')]({'port':0x232b});function request(_0x7ecf7c,_0x5c0910){return new BPromise(function(_0x2cd784,_0x4c29e8){return client[_0x1ebb('0x4')](_0x7ecf7c,_0x5c0910)[_0x1ebb('0x5')](function(_0x162058){if(_0x162058['error']){return _0x4c29e8(_0x162058['error'][_0x1ebb('0x6')]);}else{return _0x2cd784(_0x162058[_0x1ebb('0x7')]);}})[_0x1ebb('0x8')](function(_0x1f00fd){return _0x4c29e8(_0x1f00fd);});});}exports[_0x1ebb('0x9')]=function(_0x162e77,_0x22e1ed){return request(_0x1ebb('0xa'),{'account':_0x162e77,'message':_0x22e1ed});}; \ No newline at end of file +var _0xde8b=['bluebird','jayson/promise','client','request','message','result','catch','sendMailMessage'];(function(_0xd6db21,_0x1d08f3){var _0x3b96a0=function(_0x157017){while(--_0x157017){_0xd6db21['push'](_0xd6db21['shift']());}};_0x3b96a0(++_0x1d08f3);}(_0xde8b,0x1e0));var _0xbde8=function(_0x2248c1,_0x564bd8){_0x2248c1=_0x2248c1-0x0;var _0x31ba20=_0xde8b[_0x2248c1];return _0x31ba20;};'use strict';var BPromise=require(_0xbde8('0x0'));var jayson=require(_0xbde8('0x1'));var client=jayson[_0xbde8('0x2')]['http']({'port':0x232b});function request(_0x353128,_0x2db6bf){return new BPromise(function(_0x16f6f3,_0x19a403){return client[_0xbde8('0x3')](_0x353128,_0x2db6bf)['then'](function(_0x360f99){if(_0x360f99['error']){return _0x19a403(_0x360f99['error'][_0xbde8('0x4')]);}else{return _0x16f6f3(_0x360f99[_0xbde8('0x5')]);}})[_0xbde8('0x6')](function(_0x278bd8){return _0x19a403(_0x278bd8);});});}exports[_0xbde8('0x7')]=function(_0x3b19c3,_0xdc9e3f){return request('SendMail',{'account':_0x3b19c3,'message':_0xdc9e3f});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 5f38cbb..dfe4d38 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 _0x867d=['headers','line','exports','stream','call','_localBuffer','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','toString','indexOf','substring','split','trim','slice','length'];(function(_0x176ed3,_0xfe1c7){var _0x1f9182=function(_0x5d7aa0){while(--_0x5d7aa0){_0x176ed3['push'](_0x176ed3['shift']());}};_0x1f9182(++_0xfe1c7);}(_0x867d,0x147));var _0xd867=function(_0xb103ce,_0x188c52){_0xb103ce=_0xb103ce-0x0;var _0x446d34=_0x867d[_0xb103ce];return _0x446d34;};'use strict';var util=require('util');var Transform=require(_0xd867('0x0'))['Transform'];function AGIReply(_0x465592){Transform[_0xd867('0x1')](this,_0x465592);this[_0xd867('0x2')]='';this[_0xd867('0x3')]=![];}util[_0xd867('0x4')](AGIReply,Transform);AGIReply[_0xd867('0x5')][_0xd867('0x6')]=function(_0x36260c,_0x3761a6,_0x27c068){var _0x437d97='\x0a',_0x3f5257=['\x0a\x0a',_0xd867('0x7')],_0x4863ab=-0x1,_0x33cc7c=-0x1,_0x51e80f='',_0x28f1e7=0x0,_0x45e9aa='',_0x55d85a='';this[_0xd867('0x2')]+=_0x36260c[_0xd867('0x8')]();_0x45e9aa=this[_0xd867('0x2')];if(!this[_0xd867('0x3')]){_0x28f1e7=0x0;while(_0x3f5257[_0x28f1e7]){while((_0x33cc7c=_0x45e9aa[_0xd867('0x9')](_0x3f5257[_0x28f1e7]))!=-0x1){_0x51e80f=_0x3f5257[_0x28f1e7];_0x55d85a=_0x45e9aa[_0xd867('0xa')](0x0,_0x33cc7c);_0x45e9aa=_0x45e9aa['substring'](_0x33cc7c+_0x51e80f['length']);var _0x2e8439=_0x55d85a[_0xd867('0xb')](_0x437d97),_0x2e8f0c=0x0,_0x41bf10={},_0x7136d4='',_0x2782e8='',_0x5d922a=-0x1;while(_0x2e8439[_0x2e8f0c]){_0x5d922a=_0x2e8439[_0x2e8f0c][_0xd867('0x9')](':');if(_0x5d922a!=-0x1){_0x7136d4=_0x2e8439[_0x2e8f0c]['slice'](0x0,_0x5d922a)[_0xd867('0xc')]();_0x2782e8=_0x2e8439[_0x2e8f0c][_0xd867('0xd')](_0x5d922a+0x1)['trim']();if(_0x7136d4[_0xd867('0xe')]>0x0){_0x41bf10[_0x7136d4]=_0x2782e8;}}else{}_0x2e8f0c++;}this['emit'](_0xd867('0xf'),_0x41bf10);this[_0xd867('0x3')]=!![];}_0x28f1e7++;}this['_localBuffer']=_0x45e9aa;}else{while((_0x4863ab=_0x45e9aa['indexOf'](_0x437d97))!=-0x1){_0x55d85a=_0x45e9aa[_0xd867('0xa')](0x0,_0x4863ab);this['emit'](_0xd867('0x10'),_0x55d85a);_0x45e9aa=_0x45e9aa[_0xd867('0xa')](_0x4863ab+_0x437d97[_0xd867('0xe')]);}this['_localBuffer']=_0x45e9aa;}_0x27c068();};module[_0xd867('0x11')]=AGIReply; \ No newline at end of file +var _0xa0e2=['substring','length','split','slice','trim','emit','line','exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','indexOf'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0xa0e2,0xaa));var _0x2a0e=function(_0xa970d1,_0x8e9f98){_0xa970d1=_0xa970d1-0x0;var _0x4c5a31=_0xa0e2[_0xa970d1];return _0x4c5a31;};'use strict';var util=require(_0x2a0e('0x0'));var Transform=require(_0x2a0e('0x1'))[_0x2a0e('0x2')];function AGIReply(_0x4785ca){Transform[_0x2a0e('0x3')](this,_0x4785ca);this[_0x2a0e('0x4')]='';this[_0x2a0e('0x5')]=![];}util[_0x2a0e('0x6')](AGIReply,Transform);AGIReply[_0x2a0e('0x7')][_0x2a0e('0x8')]=function(_0xcc5c8f,_0x5d7d4c,_0x14df50){var _0x5c0099='\x0a',_0x4dbf67=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x5a492e=-0x1,_0x125961=-0x1,_0x339857='',_0x33ad16=0x0,_0x25e0bb='',_0x763315='';this['_localBuffer']+=_0xcc5c8f['toString']();_0x25e0bb=this[_0x2a0e('0x4')];if(!this[_0x2a0e('0x5')]){_0x33ad16=0x0;while(_0x4dbf67[_0x33ad16]){while((_0x125961=_0x25e0bb[_0x2a0e('0x9')](_0x4dbf67[_0x33ad16]))!=-0x1){_0x339857=_0x4dbf67[_0x33ad16];_0x763315=_0x25e0bb[_0x2a0e('0xa')](0x0,_0x125961);_0x25e0bb=_0x25e0bb[_0x2a0e('0xa')](_0x125961+_0x339857[_0x2a0e('0xb')]);var _0x523ee6=_0x763315[_0x2a0e('0xc')](_0x5c0099),_0x262f88=0x0,_0xc78297={},_0x59322f='',_0x1001f4='',_0x1c8254=-0x1;while(_0x523ee6[_0x262f88]){_0x1c8254=_0x523ee6[_0x262f88][_0x2a0e('0x9')](':');if(_0x1c8254!=-0x1){_0x59322f=_0x523ee6[_0x262f88][_0x2a0e('0xd')](0x0,_0x1c8254)[_0x2a0e('0xe')]();_0x1001f4=_0x523ee6[_0x262f88][_0x2a0e('0xd')](_0x1c8254+0x1)[_0x2a0e('0xe')]();if(_0x59322f[_0x2a0e('0xb')]>0x0){_0xc78297[_0x59322f]=_0x1001f4;}}else{}_0x262f88++;}this[_0x2a0e('0xf')]('headers',_0xc78297);this[_0x2a0e('0x5')]=!![];}_0x33ad16++;}this[_0x2a0e('0x4')]=_0x25e0bb;}else{while((_0x5a492e=_0x25e0bb[_0x2a0e('0x9')](_0x5c0099))!=-0x1){_0x763315=_0x25e0bb[_0x2a0e('0xa')](0x0,_0x5a492e);this[_0x2a0e('0xf')](_0x2a0e('0x10'),_0x763315);_0x25e0bb=_0x25e0bb[_0x2a0e('0xa')](_0x5a492e+_0x5c0099['length']);}this[_0x2a0e('0x4')]=_0x25e0bb;}_0x14df50();};module[_0x2a0e('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 fbe826f..a1319fc 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 _0xd4c4=['request','error','result','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','getSquareProjectById','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','save_name','ShowInterval','Interval','Intervals','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','lodash','util','client','http'];(function(_0x2f9e65,_0x571a4c){var _0x4b4e16=function(_0x555637){while(--_0x555637){_0x2f9e65['push'](_0x2f9e65['shift']());}};_0x4b4e16(++_0x571a4c);}(_0xd4c4,0x6d));var _0x4d4c=function(_0x5b8a39,_0x18eb9c){_0x5b8a39=_0x5b8a39-0x0;var _0x12394d=_0xd4c4[_0x5b8a39];return _0x12394d;};'use strict';var BPromise=require(_0x4d4c('0x0'));var moment=require('moment');var _=require(_0x4d4c('0x1'));var util=require(_0x4d4c('0x2'));var jayson=require('jayson/promise');var client=jayson[_0x4d4c('0x3')][_0x4d4c('0x4')]({'port':0x2329});function request(_0x36ffa1,_0x5f4e58){return new BPromise(function(_0x173604,_0x116433){return client[_0x4d4c('0x5')](_0x36ffa1,_0x5f4e58)['then'](function(_0x359cf5){if(_0x359cf5[_0x4d4c('0x6')]){return _0x116433(_0x359cf5['error']['message']);}else{return _0x173604(_0x359cf5[_0x4d4c('0x7')]);}})['catch'](function(_0x3fab28){return _0x116433(_0x3fab28);});});}exports['getSquareProject']=function(_0x59087f){return request(_0x4d4c('0x8'),{'options':{'raw':![],'where':{'name':_0x59087f},'attributes':[_0x4d4c('0x9')]}});};exports[_0x4d4c('0xa')]=function(_0xef0e51){return request(_0x4d4c('0xb'),{'options':{'raw':![],'where':{'id':_0xef0e51},'include':[{'model':_0x4d4c('0xc'),'as':_0x4d4c('0xd')}],'attributes':['id','name','email']}});};exports[_0x4d4c('0xe')]=function(_0x2896e1){return request(_0x4d4c('0x8'),{'options':{'where':{'id':_0x2896e1},'attributes':[_0x4d4c('0xf')]}});};exports[_0x4d4c('0x10')]=function(_0x3e2238){return request(_0x4d4c('0x11'),{'options':{'where':{'id':_0x3e2238},'attributes':['name']}});};exports[_0x4d4c('0x12')]=function(_0x5b0a07){return request(_0x4d4c('0x13'),{'options':{'where':{'id':_0x5b0a07},'attributes':[_0x4d4c('0xf')]}});};exports[_0x4d4c('0x14')]=function(_0x23a296){return request(_0x4d4c('0x15'),{'options':{'where':{'id':_0x23a296},'attributes':[_0x4d4c('0x16')]}});};exports[_0x4d4c('0x17')]=function(_0x5771a4){return request(_0x4d4c('0x18'),{'options':{'where':{'id':_0x5771a4},'attributes':['name']}});};exports[_0x4d4c('0x19')]=function(_0x2ff886){return request(_0x4d4c('0x1a'),{'options':{'where':{'id':_0x2ff886},'attributes':[_0x4d4c('0xf')]}});};exports[_0x4d4c('0x1b')]=function(_0x13bdc8){return request('ShowSound',{'options':{'where':{'id':_0x13bdc8},'attributes':[_0x4d4c('0x1c')]}});};exports['getIntervalById']=function(_0x9aebee){return request(_0x4d4c('0x1d'),{'options':{'raw':![],'where':{'id':_0x9aebee},'include':[{'model':_0x4d4c('0x1e'),'as':_0x4d4c('0x1f')}]}});};exports['getSmsAccountById']=function(_0x53b04a){return request('ShowSmsAccount',{'options':{'where':{'id':_0x53b04a},'attributes':['id',_0x4d4c('0xf')]}});};exports[_0x4d4c('0x20')]=function(_0x18213e){return request(_0x4d4c('0x21'),{'body':_0x18213e});};exports['createSquareDetailsReport']=function(_0x185676){return request(_0x4d4c('0x22'),{'body':_0x185676});};exports[_0x4d4c('0x23')]=function(_0x24c3ad){return request('CreateSquareReport',{'body':_[_0x4d4c('0x24')](_0x24c3ad,{'project_name':_0x24c3ad[_0x4d4c('0x25')],'prev_project_name':_0x24c3ad['arg_2']||'','is_subproject':_0x24c3ad['arg_2']?!![]:![],'leaveAt':moment()[_0x4d4c('0x26')](_0x4d4c('0x27'))})});};exports[_0x4d4c('0x28')]=function(_0x33f7cc){return request(_0x4d4c('0x29'),{'body':_0x33f7cc});};exports[_0x4d4c('0x2a')]=function(_0x3a5bae){return request(_0x4d4c('0x2b'),{'body':_0x3a5bae});};exports[_0x4d4c('0x2c')]=function(_0x4d1382){return request(_0x4d4c('0x2d'),{'options':{'raw':![],'where':{'phone':_0x4d1382['phone'],'ListId':_0x4d1382[_0x4d4c('0x2e')]}}})['then'](function(_0x50d57b){if(_0x50d57b){return _0x50d57b;}return request(_0x4d4c('0x2f'),{'body':_0x4d1382});});};exports[_0x4d4c('0x30')]=function(_0x3d29aa){return request(_0x4d4c('0x31'),{'options':{'where':{'id':_0x3d29aa},'attributes':[_0x4d4c('0xf')]}});};exports[_0x4d4c('0x32')]=function(_0x136b0b,_0x159e9c){return request(_0x4d4c('0x33'),{'body':{'interface':_0x159e9c},'options':{'where':_0x136b0b}});};exports[_0x4d4c('0x34')]=function(_0x10b845,_0x1ee5d0,_0x1351d8){return request(_0x4d4c('0x35'),{'body':{'type':_0x1ee5d0,'uniqueid':_0x1351d8},'options':{'where':_0x10b845}});};exports[_0x4d4c('0x36')]=function(_0x5277d8){return request('UnpauseUser',{'body':{},'options':{'where':_0x5277d8}});};exports[_0x4d4c('0x37')]=function(_0x20c1ba){return request(_0x4d4c('0x38'),{'body':{},'options':{'where':_0x20c1ba}});}; \ No newline at end of file +var _0x98b5=['catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','name','ShowVoiceQueue','ShowSquareOdbc','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','UnpauseUser','bluebird','lodash','util','request','then','error','message','result'];(function(_0xd7e133,_0x3191e0){var _0x2f2714=function(_0x29362b){while(--_0x29362b){_0xd7e133['push'](_0xd7e133['shift']());}};_0x2f2714(++_0x3191e0);}(_0x98b5,0x148));var _0x598b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x98b5[_0x42cae2];return _0x5f256f;};'use strict';var BPromise=require(_0x598b('0x0'));var moment=require('moment');var _=require(_0x598b('0x1'));var util=require(_0x598b('0x2'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x2329});function request(_0x37a87c,_0x544f6a){return new BPromise(function(_0x4b5a56,_0x410894){return client[_0x598b('0x3')](_0x37a87c,_0x544f6a)[_0x598b('0x4')](function(_0x3c74c1){if(_0x3c74c1[_0x598b('0x5')]){return _0x410894(_0x3c74c1[_0x598b('0x5')][_0x598b('0x6')]);}else{return _0x4b5a56(_0x3c74c1[_0x598b('0x7')]);}})[_0x598b('0x8')](function(_0x1e515f){return _0x410894(_0x1e515f);});});}exports[_0x598b('0x9')]=function(_0x94991c){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x94991c},'attributes':[_0x598b('0xa')]}});};exports[_0x598b('0xb')]=function(_0x55c7a6){return request(_0x598b('0xc'),{'options':{'raw':![],'where':{'id':_0x55c7a6},'include':[{'model':_0x598b('0xd'),'as':_0x598b('0xe')}],'attributes':['id','name',_0x598b('0xf')]}});};exports[_0x598b('0x10')]=function(_0x10238c){return request(_0x598b('0x11'),{'options':{'where':{'id':_0x10238c},'attributes':[_0x598b('0x12')]}});};exports['getVoiceQueueById']=function(_0x2e957c){return request(_0x598b('0x13'),{'options':{'where':{'id':_0x2e957c},'attributes':['name']}});};exports['getVariableById']=function(_0x195476){return request('ShowVariable',{'options':{'where':{'id':_0x195476},'attributes':[_0x598b('0x12')]}});};exports['getSquareOdbcById']=function(_0x39473d){return request(_0x598b('0x14'),{'options':{'where':{'id':_0x39473d},'attributes':['dsn']}});};exports[_0x598b('0x15')]=function(_0x17508f){return request(_0x598b('0x16'),{'options':{'where':{'id':_0x17508f},'attributes':['name']}});};exports[_0x598b('0x17')]=function(_0x484143){return request(_0x598b('0x18'),{'options':{'where':{'id':_0x484143},'attributes':[_0x598b('0x12')]}});};exports[_0x598b('0x19')]=function(_0x4e1411){return request(_0x598b('0x1a'),{'options':{'where':{'id':_0x4e1411},'attributes':[_0x598b('0x1b')]}});};exports['getIntervalById']=function(_0x2c402e){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x2c402e},'include':[{'model':_0x598b('0x1c'),'as':_0x598b('0x1d')}]}});};exports['getSmsAccountById']=function(_0x113282){return request(_0x598b('0x1e'),{'options':{'where':{'id':_0x113282},'attributes':['id',_0x598b('0x12')]}});};exports['createSmsMessage']=function(_0x5dc95c){return request(_0x598b('0x1f'),{'body':_0x5dc95c});};exports[_0x598b('0x20')]=function(_0x585e6d){return request('CreateSquareDetailsReport',{'body':_0x585e6d});};exports[_0x598b('0x21')]=function(_0xdb6ec3){return request(_0x598b('0x22'),{'body':_['merge'](_0xdb6ec3,{'project_name':_0xdb6ec3['arg_1'],'prev_project_name':_0xdb6ec3[_0x598b('0x23')]||'','is_subproject':_0xdb6ec3['arg_2']?!![]:![],'leaveAt':moment()[_0x598b('0x24')](_0x598b('0x25'))})});};exports['createSquareRecording']=function(_0x401a80){return request(_0x598b('0x26'),{'body':_0x401a80});};exports['createSquareMessage']=function(_0x1858b1){return request(_0x598b('0x27'),{'body':_0x1858b1});};exports['createCmContact']=function(_0x5255ba){return request(_0x598b('0x28'),{'options':{'raw':![],'where':{'phone':_0x5255ba['phone'],'ListId':_0x5255ba[_0x598b('0x29')]}}})[_0x598b('0x4')](function(_0x4a75f3){if(_0x4a75f3){return _0x4a75f3;}return request(_0x598b('0x2a'),{'body':_0x5255ba});});};exports['getPauseById']=function(_0x496ef9){return request(_0x598b('0x2b'),{'options':{'where':{'id':_0x496ef9},'attributes':[_0x598b('0x12')]}});};exports[_0x598b('0x2c')]=function(_0x134bb7,_0x33f45e){return request(_0x598b('0x2d'),{'body':{'interface':_0x33f45e},'options':{'where':_0x134bb7}});};exports[_0x598b('0x2e')]=function(_0x5943a7,_0x1c57c5,_0x124f5a){return request('PauseUser',{'body':{'type':_0x1c57c5,'uniqueid':_0x124f5a},'options':{'where':_0x5943a7}});};exports['agentUnpause']=function(_0x2cc927){return request(_0x598b('0x2f'),{'body':{},'options':{'where':_0x2cc927}});};exports['agentLogout']=function(_0xe47b76){return request('LogoutUser',{'body':{},'options':{'where':_0xe47b76}});}; \ 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 ff7bc2d..aacb8e6 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 _0x83d0=['./polly','./lex','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x83d0,0xb7));var _0x083d=function(_0x5af6c3,_0x3a34ea){_0x5af6c3=_0x5af6c3-0x0;var _0x66e97f=_0x83d0[_0x5af6c3];return _0x66e97f;};var polly=require(_0x083d('0x0'));var lex=require(_0x083d('0x1'));module[_0x083d('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xcde7=['exports'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xcde7,0x65));var _0x7cde=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcde7[_0x59ee6f];return _0x4c0979;};var polly=require('./polly');var lex=require('./lex');module[_0x7cde('0x0')]={'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 4d52302..31d3f23 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 _0x4ea3=['./lib/api','exports'];(function(_0x275419,_0x4321bc){var _0x39a751=function(_0x99c074){while(--_0x99c074){_0x275419['push'](_0x275419['shift']());}};_0x39a751(++_0x4321bc);}(_0x4ea3,0x70));var _0x34ea=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4ea3[_0x618414];return _0x21c19a;};'use strict';var lex=require(_0x34ea('0x0'));module[_0x34ea('0x1')]=function(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c){return lex(_0x324f65,_0x3ab582,_0x588172,_0x374ec1,_0x494b56,_0x269d4c);}; \ No newline at end of file +var _0x153f=['exports','./lib/api'];(function(_0x28f32c,_0x4cc342){var _0x355402=function(_0xdb5032){while(--_0xdb5032){_0x28f32c['push'](_0x28f32c['shift']());}};_0x355402(++_0x4cc342);}(_0x153f,0x15b));var _0xf153=function(_0x3d5bc,_0x40c621){_0x3d5bc=_0x3d5bc-0x0;var _0x3ea844=_0x153f[_0x3d5bc];return _0x3ea844;};'use strict';var lex=require(_0xf153('0x0'));module[_0xf153('0x1')]=function(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c){return lex(_0xde7eae,_0x44cea3,_0x2afb9a,_0x1ccc1c,_0x3b85fc,_0x59757c);}; \ 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 3c29085..39c78a6 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(_0x44f7a8,_0x145756){var _0x4bfe0b=function(_0x44a1ea){while(--_0x44a1ea){_0x44f7a8['push'](_0x44f7a8['shift']());}};_0x4bfe0b(++_0x145756);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x557851,_0x417a5f){var _0x15e530=function(_0xcf881d){while(--_0xcf881d){_0x557851['push'](_0x557851['shift']());}};_0x15e530(++_0x417a5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 17ceb33..d3aca66 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 _0x00d1=['exports'];(function(_0x56569b,_0xfa107b){var _0x4040b7=function(_0x3a7c7a){while(--_0x3a7c7a){_0x56569b['push'](_0x56569b['shift']());}};_0x4040b7(++_0xfa107b);}(_0x00d1,0xc9));var _0x100d=function(_0x2a0e45,_0x370c5d){_0x2a0e45=_0x2a0e45-0x0;var _0x3595b8=_0x00d1[_0x2a0e45];return _0x3595b8;};'use strict';var polly=require('./lib/api');module[_0x100d('0x0')]=function(_0x2e3c31,_0xcb06ac,_0x2f92ac,_0x5bf6ff,_0x3bb351,_0x3cdb4e,_0x12ab3b){return polly(_0x2e3c31,_0xcb06ac,_0x2f92ac,_0x5bf6ff,_0x3bb351,_0x3cdb4e,_0x12ab3b);}; \ No newline at end of file +var _0x6929=['./lib/api','exports'];(function(_0x2669b3,_0x77cf0a){var _0x57a665=function(_0x293c40){while(--_0x293c40){_0x2669b3['push'](_0x2669b3['shift']());}};_0x57a665(++_0x77cf0a);}(_0x6929,0xe4));var _0x9692=function(_0x519a2b,_0x53ad27){_0x519a2b=_0x519a2b-0x0;var _0x5598dd=_0x6929[_0x519a2b];return _0x5598dd;};'use strict';var polly=require(_0x9692('0x0'));module[_0x9692('0x1')]=function(_0x1aa7e5,_0xd4e009,_0x1f7ed6,_0x2953eb,_0x120802,_0x155f2f,_0x25d397){return polly(_0x1aa7e5,_0xd4e009,_0x1f7ed6,_0x2953eb,_0x120802,_0x155f2f,_0x25d397);}; \ 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 6ae8b39..7b4fda0 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 _0x85d0=['aws-sdk','synthesizeSpeech','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring'];(function(_0x62f62c,_0x333e38){var _0x4b6650=function(_0x1c7d98){while(--_0x1c7d98){_0x62f62c['push'](_0x62f62c['shift']());}};_0x4b6650(++_0x333e38);}(_0x85d0,0xbd));var _0x085d=function(_0x511ca2,_0xd6f51e){_0x511ca2=_0x511ca2-0x0;var _0xf23323=_0x85d0[_0x511ca2];return _0xf23323;};'use strict';var fs=require('fs');var path=require(_0x085d('0x0'));var BPromise=require(_0x085d('0x1'));var rs=require(_0x085d('0x2'));var AWS=require(_0x085d('0x3'));function pollyResult(_0x32e69f,_0x34db4b,_0x302880){return new BPromise(function(_0x14c507,_0x61b4e3){_0x32e69f[_0x085d('0x4')](_0x34db4b,function(_0xd1daa7,_0x411eb0){if(_0xd1daa7){_0x61b4e3(_0xd1daa7);}else if(_0x411eb0){if(_0x411eb0[_0x085d('0x5')]instanceof Buffer){fs[_0x085d('0x6')](_0x302880,_0x411eb0[_0x085d('0x5')],function(_0x5f44b4){if(_0x5f44b4){_0x61b4e3(_0x5f44b4);}else{_0x14c507();}});}else{_0x61b4e3(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x61b4e3(new Error(_0x085d('0x7')));}});});}module[_0x085d('0x8')]=function(_0xc0a730,_0xcc55e1,_0x14da64,_0x3fd3df,_0x1bd43c,_0x136327,_0x1d8a3c){var _0x16f122=new AWS[(_0x085d('0x9'))]({'accessKeyId':_0xc0a730,'secretAccessKey':_0xcc55e1,'region':_0x14da64});var _0x2dad7e={'Text':_0x1bd43c,'TextType':_0x136327||_0x085d('0xa'),'OutputFormat':_0x085d('0xb'),'VoiceId':_0x3fd3df};return pollyResult(_0x16f122,_0x2dad7e,_0x1d8a3c);}; \ No newline at end of file +var _0x3efb=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','bluebird','randomstring','synthesizeSpeech','writeFile'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x3efb,0xec));var _0xb3ef=function(_0x680821,_0x23e67f){_0x680821=_0x680821-0x0;var _0x3f132c=_0x3efb[_0x680821];return _0x3f132c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xb3ef('0x0'));var rs=require(_0xb3ef('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x13ad79,_0x3b1544,_0x356ff2){return new BPromise(function(_0xa1f499,_0x4c576c){_0x13ad79[_0xb3ef('0x2')](_0x3b1544,function(_0x2b2400,_0x22847b){if(_0x2b2400){_0x4c576c(_0x2b2400);}else if(_0x22847b){if(_0x22847b['AudioStream']instanceof Buffer){fs[_0xb3ef('0x3')](_0x356ff2,_0x22847b[_0xb3ef('0x4')],function(_0x4d0819){if(_0x4d0819){_0x4c576c(_0x4d0819);}else{_0xa1f499();}});}else{_0x4c576c(new Error(_0xb3ef('0x5')));}}else{_0x4c576c(new Error(_0xb3ef('0x6')));}});});}module[_0xb3ef('0x7')]=function(_0x2f21bd,_0x207af4,_0x1c028,_0x20f773,_0x258b13,_0x353ca4,_0x33f71c){var _0x1cea7f=new AWS[(_0xb3ef('0x8'))]({'accessKeyId':_0x2f21bd,'secretAccessKey':_0x207af4,'region':_0x1c028});var _0xcabd54={'Text':_0x258b13,'TextType':_0x353ca4||'text','OutputFormat':_0xb3ef('0x9'),'VoiceId':_0x20f773};return pollyResult(_0x1cea7f,_0xcabd54,_0x33f71c);}; \ 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 a31c2cd..6b09340 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 _0xbb3b=['./lib/api'];(function(_0x48bba6,_0x4d10f7){var _0x277f53=function(_0x31e2b9){while(--_0x31e2b9){_0x48bba6['push'](_0x48bba6['shift']());}};_0x277f53(++_0x4d10f7);}(_0xbb3b,0x81));var _0xbbb3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb3b[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require(_0xbbb3('0x0'));module['exports']=function(_0x41d13f,_0x34c92f,_0x1499d6,_0x1f69bf){return asr(_0x41d13f,_0x34c92f,_0x1499d6);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x196e86,_0x398d75,_0x21a538,_0x57f025){return asr(_0x196e86,_0x398d75,_0x21a538);}; \ 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 1aafea1..68568ad 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 _0x9b87=['/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST'];(function(_0x445427,_0x3a2fa6){var _0x3f101a=function(_0x4c922d){while(--_0x4c922d){_0x445427['push'](_0x445427['shift']());}};_0x3f101a(++_0x3a2fa6);}(_0x9b87,0x8e));var _0x79b8=function(_0x195d6a,_0xe8b683){_0x195d6a=_0x195d6a-0x0;var _0xbc91cf=_0x9b87[_0x195d6a];return _0xbc91cf;};'use strict';var url=require(_0x79b8('0x0'));var BPromise=require(_0x79b8('0x1'));var fs=require('fs');var host=_0x79b8('0x2');module[_0x79b8('0x3')]=function(_0x77ad5c,_0x4386a6,_0x23b645){return new BPromise(function(_0xb4e3e7,_0xbc1e74){var _0xa65bbc;if(typeof _0x77ad5c!==_0x79b8('0x4')||_0x77ad5c[_0x79b8('0x5')]===0x0){return _0xbc1e74(_0x79b8('0x6'));}if(typeof _0x4386a6!==_0x79b8('0x4')||_0x4386a6[_0x79b8('0x5')]===0x0){return _0xbc1e74(_0x79b8('0x7'));}if(typeof _0x23b645!=='undefined'&&(typeof _0x23b645!=='string'||_0x23b645['length']===0x0)){return _0xbc1e74('lang\x20should\x20be\x20a\x20string');}try{_0xa65bbc=fs[_0x79b8('0x8')](_0x77ad5c)[_0x79b8('0x9')](_0x79b8('0xa'));}catch(_0x4bc41f){return _0xbc1e74(_0x4bc41f);}return _0xb4e3e7({'method':_0x79b8('0xb'),'uri':host+_0x79b8('0xc')+_0x4386a6,'body':{'config':{'encoding':_0x79b8('0xd'),'sampleRateHertz':'8000','languageCode':_0x23b645},'audio':{'content':_0xa65bbc}},'json':!![]});});}; \ No newline at end of file +var _0xad36=['POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xad36,0x11c));var _0x6ad3=function(_0x4e5c2c,_0x4b841d){_0x4e5c2c=_0x4e5c2c-0x0;var _0x5bbfe7=_0xad36[_0x4e5c2c];return _0x5bbfe7;};'use strict';var url=require('url');var BPromise=require(_0x6ad3('0x0'));var fs=require('fs');var host=_0x6ad3('0x1');module[_0x6ad3('0x2')]=function(_0x1164e0,_0x32fb2f,_0x35a0ee){return new BPromise(function(_0xef54ab,_0x17a9b2){var _0x3d8fee;if(typeof _0x1164e0!=='string'||_0x1164e0[_0x6ad3('0x3')]===0x0){return _0x17a9b2(_0x6ad3('0x4'));}if(typeof _0x32fb2f!==_0x6ad3('0x5')||_0x32fb2f[_0x6ad3('0x3')]===0x0){return _0x17a9b2('key\x20should\x20be\x20a\x20string');}if(typeof _0x35a0ee!=='undefined'&&(typeof _0x35a0ee!=='string'||_0x35a0ee['length']===0x0)){return _0x17a9b2(_0x6ad3('0x6'));}try{_0x3d8fee=fs[_0x6ad3('0x7')](_0x1164e0)[_0x6ad3('0x8')](_0x6ad3('0x9'));}catch(_0x236745){return _0x17a9b2(_0x236745);}return _0xef54ab({'method':_0x6ad3('0xa'),'uri':host+_0x6ad3('0xb')+_0x32fb2f,'body':{'config':{'encoding':_0x6ad3('0xc'),'sampleRateHertz':_0x6ad3('0xd'),'languageCode':_0x35a0ee},'audio':{'content':_0x3d8fee}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 073dfbc..24a186d 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 _0x2db0=['./asr','exports'];(function(_0xe9dbe9,_0x14b58a){var _0x4b9ebd=function(_0x3d045e){while(--_0x3d045e){_0xe9dbe9['push'](_0xe9dbe9['shift']());}};_0x4b9ebd(++_0x14b58a);}(_0x2db0,0x184));var _0x02db=function(_0x2f12b6,_0x25d172){_0x2f12b6=_0x2f12b6-0x0;var _0x985ba3=_0x2db0[_0x2f12b6];return _0x985ba3;};var asr=require(_0x02db('0x0'));module[_0x02db('0x1')]={'asr':asr}; \ No newline at end of file +var _0x76f5=['./asr','exports'];(function(_0x20d91b,_0x168dbd){var _0x1940ff=function(_0x4dc8ab){while(--_0x4dc8ab){_0x20d91b['push'](_0x20d91b['shift']());}};_0x1940ff(++_0x168dbd);}(_0x76f5,0xf2));var _0x576f=function(_0x34f7d1,_0x3495b5){_0x34f7d1=_0x34f7d1-0x0;var _0x4cdd94=_0x76f5[_0x34f7d1];return _0x4cdd94;};var asr=require(_0x576f('0x0'));module[_0x576f('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 3c4a750..c9bbfb8 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 _0xcac8=['allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','isFallback','languageCode','queryText','responseId','fulfillmentText','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','polly','awsLex','lex','ispeechTTS','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','format','model=%s','parse','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','https','md5','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','finish\x20download\x20file','close','end','path','data','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','777','split','toString','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','audioContent','writeFile','chmodSync','.wav','unlink','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','action','fulfillment','speech','score','status','code','endConversation','metadata','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult'];(function(_0x251847,_0x4fa77a){var _0x2e62db=function(_0x5ab1e4){while(--_0x5ab1e4){_0x251847['push'](_0x251847['shift']());}};_0x2e62db(++_0x4fa77a);}(_0xcac8,0x1c3));var _0x8cac=function(_0x338992,_0x475800){_0x338992=_0x338992-0x0;var _0x335d85=_0xcac8[_0x338992];return _0x335d85;};'use strict';var apiai=require(_0x8cac('0x0'));var BPromise=require(_0x8cac('0x1'));var dialogflow=require(_0x8cac('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x8cac('0x3'));var md5=require(_0x8cac('0x4'));var path=require('path');var querystring=require(_0x8cac('0x5'));var rp=require(_0x8cac('0x6'));var rs=require(_0x8cac('0x7'));var sox=require(_0x8cac('0x8'));var tts=require(_0x8cac('0x9'));var urlParse=require(_0x8cac('0xa'))['parse'];var util=require(_0x8cac('0xb'));var aws=require(_0x8cac('0xc'));var google=require(_0x8cac('0xd'));var sestek=require(_0x8cac('0xe'));var tilde=require(_0x8cac('0xf'));var logger=require(_0x8cac('0x10'))(_0x8cac('0x11'));var ISPEECH_API=_0x8cac('0x12');function downloadFile(_0x587fd4,_0x813239){return new BPromise(function(_0x5d53e5,_0x4fa33a){var _0x2792cc=urlParse(_0x587fd4);var _0x507c25=_0x2792cc[_0x8cac('0x13')]===_0x8cac('0x14')?https:http;var _0x51ebe4={'host':_0x2792cc[_0x8cac('0x15')],'path':_0x2792cc['path'],'headers':{'user-agent':_0x8cac('0x16')}};_0x507c25[_0x8cac('0x17')](_0x51ebe4,function(_0x472d0a){if(_0x472d0a[_0x8cac('0x18')]!==0xc8){logger[_0x8cac('0x19')](_0x8cac('0x1a')+_0x587fd4+'\x20failed,\x20status\x20code\x20=\x20'+_0x472d0a[_0x8cac('0x18')]+'\x20('+_0x472d0a[_0x8cac('0x1b')]+')');_0x4fa33a(new Error(_0x8cac('0x1a')+_0x587fd4+_0x8cac('0x1c')+_0x472d0a[_0x8cac('0x18')]+'\x20('+_0x472d0a[_0x8cac('0x1b')]+')'));return;}var _0x3b965e=fs[_0x8cac('0x1d')](_0x813239);_0x3b965e['on'](_0x8cac('0x1e'),function(){logger[_0x8cac('0x1f')](_0x8cac('0x20'));_0x3b965e[_0x8cac('0x21')](_0x5d53e5);});_0x3b965e['on'](_0x8cac('0x19'),function(_0x198177){fs['unlink'](_0x813239);logger[_0x8cac('0x19')]('download\x20error',_0x198177);_0x4fa33a(_0x198177);});_0x472d0a['pipe'](_0x3b965e);})['on']('error',function(_0x2284d3){logger[_0x8cac('0x19')](_0x2284d3);_0x4fa33a(_0x2284d3);})[_0x8cac('0x22')]();});}function uploadFile(_0x285258){return new BPromise(function(_0x405dbd,_0x1ae06f){var _0x102afb=urlParse(_0x285258);var _0x5c6d7e=_0x102afb[_0x8cac('0x13')]===_0x8cac('0x14')?https:http;var _0x507634={'host':_0x102afb[_0x8cac('0x15')],'path':_0x102afb[_0x8cac('0x23')],'headers':{'user-agent':_0x8cac('0x16')}};_0x5c6d7e[_0x8cac('0x17')](_0x507634,function(_0x2a4c4b){if(_0x2a4c4b[_0x8cac('0x18')]!==0xc8){_0x1ae06f(new Error(_0x8cac('0x1a')+_0x285258+_0x8cac('0x1c')+_0x2a4c4b[_0x8cac('0x18')]+'\x20('+_0x2a4c4b[_0x8cac('0x1b')]+')'));return;}var _0x14e1e3='';_0x2a4c4b['on'](_0x8cac('0x24'),function(_0x267ef9){_0x14e1e3+=_0x267ef9;});_0x2a4c4b['on'](_0x8cac('0x22'),function(){_0x405dbd(_0x14e1e3);});})['on'](_0x8cac('0x19'),function(_0x4a6f1d){_0x1ae06f(_0x4a6f1d);})[_0x8cac('0x22')]();});}function convertFile(_0x2fa092,_0x5accce){return new BPromise(function(_0x15310a,_0x5a2eba){var _0x5017f8=sox[_0x8cac('0x25')](_0x2fa092,_0x5accce,{'sampleRate':0x1f40,'format':_0x8cac('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5017f8['on'](_0x8cac('0x19'),function(_0x161b91){logger[_0x8cac('0x19')]('error\x20convert',_0x161b91);_0x5a2eba(_0x161b91);});_0x5017f8['on'](_0x8cac('0x22'),function(){logger[_0x8cac('0x1f')](_0x8cac('0x27'));_0x15310a();});_0x5017f8[_0x8cac('0x28')]();});}function base64Decode(_0x2378cf,_0x3931d1){var _0x19a7e6=path[_0x8cac('0x29')](__dirname,_0x8cac('0x2a'),rs[_0x8cac('0x2b')](0x4)+'.wav');fs[_0x8cac('0x2c')](_0x19a7e6,_0x2378cf,_0x8cac('0x2d'));return convertFile(_0x19a7e6,_0x3931d1)[_0x8cac('0x2e')](function(){try{fs['unlink'](_0x19a7e6);fs['chmodSync'](_0x3931d1,_0x8cac('0x2f'));}catch(_0x18017b){logger[_0x8cac('0x19')](_0x18017b);}return _0x3931d1[_0x8cac('0x30')]('.')[0x0];});}function base64Encode(_0x29dfbc){var _0x293131=fs['readFileSync'](_0x29dfbc);return new Buffer(_0x293131)[_0x8cac('0x31')](_0x8cac('0x2d'));}exports['googleCloudTTS']=function(_0x203cc1,_0x3c99c7,_0x1bfd26,_0x1d4c39,_0x3c37a9,_0x459d90){var _0x11ba06,_0x916dc;var _0x84afa9=_0x8cac('0x32');var _0x56ada0=_0x8cac('0x33')+_0x203cc1;var _0x42827c={};if(_0x3c99c7===_0x8cac('0x34')){_0x42827c['input']={'ssml':_0x1bfd26};}else{_0x42827c[_0x8cac('0x35')]={'text':_0x1bfd26};};_0x42827c[_0x8cac('0x36')]={'languageCode':_0x1d4c39,'ssmlGender':_0x3c37a9};_0x42827c[_0x8cac('0x37')]={'audioEncoding':_0x8cac('0x38'),'sampleRateHertz':0x1f40};var _0x28f8b8={'url':_0x84afa9+_0x8cac('0x39')+_0x56ada0,'method':_0x8cac('0x3a'),'json':!![],'body':_0x42827c};return rp(_0x28f8b8)[_0x8cac('0x2e')](function(_0x2be95d){return new BPromise(function(_0x92e074,_0x399326){_0x11ba06=path[_0x8cac('0x29')](__dirname,'tmp',rs[_0x8cac('0x2b')](0x4)+'.mp3');var _0x163bae=Buffer['from'](_0x2be95d[_0x8cac('0x3b')],_0x8cac('0x2d'));return fs[_0x8cac('0x3c')](_0x11ba06,_0x163bae,function(_0x11a79c){_0x399326(_0x11a79c);},function(_0x3f63a7){fs[_0x8cac('0x3d')](_0x11ba06,_0x8cac('0x2f'));_0x92e074(_0x3f63a7);});});})[_0x8cac('0x2e')](function(_0x16d2f4){_0x916dc=path['resolve'](__dirname,_0x8cac('0x2a'),rs['generate'](0x4)+_0x8cac('0x3e'));return convertFile(_0x11ba06,_0x916dc);})['then'](function(){try{fs[_0x8cac('0x3f')](_0x11ba06);fs['chmodSync'](_0x916dc,_0x8cac('0x2f'));}catch(_0x2405fc){logger['error'](_0x2405fc);}logger[_0x8cac('0x1f')](_0x8cac('0x40'),_0x916dc['split']('.')[0x0]);return _0x916dc[_0x8cac('0x30')]('.')[0x0];});};exports[_0x8cac('0x41')]=function(_0x2bb4ce,_0xe2ebbc){var _0x20d391=_0x8cac('0x42');var _0x1c9024,_0x580471;var _0x56cd02;var _0x4aeb31={'encoding':_0x8cac('0x43'),'method':'POST','timeout':0x2710,'url':_0x20d391,'headers':{'Content-Type':_0x8cac('0x44')},'body':_0x8cac('0x45')+encodeURIComponent(JSON[_0x8cac('0x46')]([[[_0x8cac('0x47'),JSON['stringify']([_0x2bb4ce,_0xe2ebbc||'en',![],'null']),null,'generic']]]))};return rp(_0x4aeb31)['then'](function(_0x4e7ed5){try{_0x56cd02=eval(_0x4e7ed5[_0x8cac('0x48')](0x5))[0x0][0x2];}catch(_0x5c0536){throw new Error(_0x8cac('0x49')+_0x4e7ed5[_0x8cac('0x24')]);}if(!_0x56cd02){if(_0x2bb4ce[_0x8cac('0x4a')]>0xc8){throw new Error(_0x8cac('0x4b'));}else{throw new Error(_0x8cac('0x4c')+_0xe2ebbc+'\x22\x20might\x20not\x20exist');}}try{_0x56cd02=eval(_0x56cd02)[0x0];}catch(_0x4010be){throw new Error(_0x8cac('0x49')+res[_0x8cac('0x24')]);}const _0x41cdfd=_0x56cd02;_0x1c9024=path[_0x8cac('0x29')](__dirname,_0x8cac('0x2a'),rs['generate'](0x4)+'.mp3');fs[_0x8cac('0x2c')](_0x1c9024,_0x56cd02,{'encoding':_0x8cac('0x2d')});_0x580471=path[_0x8cac('0x29')](__dirname,_0x8cac('0x2a'),rs[_0x8cac('0x2b')](0x4)+_0x8cac('0x3e'));return convertFile(_0x1c9024,_0x580471);})['then'](function(){try{fs[_0x8cac('0x3f')](_0x1c9024);fs[_0x8cac('0x3d')](_0x580471,_0x8cac('0x2f'));}catch(_0x4b05a5){logger[_0x8cac('0x19')](_0x4b05a5);}logger[_0x8cac('0x1f')](_0x8cac('0x4d'),_0x580471[_0x8cac('0x30')]('.')[0x0]);return _0x580471[_0x8cac('0x30')]('.')[0x0];});};exports['googleASR']=function(_0x5f5b4a,_0x2600dd,_0xef3ed6){return google[_0x8cac('0x4e')](_0x5f5b4a,_0x2600dd,_0xef3ed6)[_0x8cac('0x2e')](function(_0x59fca2){logger[_0x8cac('0x1f')](_0x59fca2[_0x8cac('0x4f')]);return rp(_0x59fca2);})[_0x8cac('0x2e')](function(_0x3cd8bb){var _0x2c296d='';var _0x133895=0x0;try{fs[_0x8cac('0x3f')](_0x5f5b4a);}catch(_0xc8b42d){logger[_0x8cac('0x19')](_0xc8b42d);}if(_0x3cd8bb&&_0x3cd8bb[_0x8cac('0x50')]){_0x2c296d=_0x3cd8bb['results'][_0x8cac('0x51')](function(_0x1552ac){return _0x1552ac&&_0x1552ac[_0x8cac('0x52')][0x0]&&_0x1552ac[_0x8cac('0x52')][0x0]['transcript']?_0x1552ac[_0x8cac('0x52')][0x0][_0x8cac('0x53')]:'';})[_0x8cac('0x54')]('\x0a');_0x133895=_0x3cd8bb[_0x8cac('0x50')][_0x8cac('0x51')](function(_0x51f46c){return _0x51f46c&&_0x51f46c[_0x8cac('0x52')][0x0]&&_0x51f46c[_0x8cac('0x52')][0x0][_0x8cac('0x55')]?_0x51f46c[_0x8cac('0x52')][0x0][_0x8cac('0x55')]:0x0;})[_0x8cac('0x54')]('\x0a');}logger[_0x8cac('0x1f')]('googleASR\x20transcription',_0x2c296d);logger[_0x8cac('0x1f')](_0x8cac('0x56'),_0x133895);return{'transcript':_0x2c296d,'confidence':_0x133895};})[_0x8cac('0x57')](function(_0x1e5b4e){logger[_0x8cac('0x19')](_0x8cac('0x58'),_0x1e5b4e[_0x8cac('0x18')],_0x1e5b4e[_0x8cac('0x59')],_0x1e5b4e[_0x8cac('0x5a')]);});};exports[_0x8cac('0x5b')]=function(_0x2399d3,_0x27d74a,_0x587957,_0xc92965){var _0x4c3c6b=apiai(_0x27d74a,{'language':_0xc92965||'en'});return _0x4c3c6b[_0x8cac('0x5c')](_0x587957,{'sessionId':md5(_0x2399d3)})['then'](function(_0x3da341){logger[_0x8cac('0x1f')](JSON['stringify'](_0x3da341));return{'source':_0x3da341['result'][_0x8cac('0x5d')],'resolvedQuery':_0x3da341[_0x8cac('0x5e')]['resolvedQuery'],'action':_0x3da341['result'][_0x8cac('0x5f')],'actionIncomplete':_0x3da341['result']['actionIncomplete'],'speech':_0x3da341[_0x8cac('0x5e')][_0x8cac('0x60')][_0x8cac('0x61')],'score':_0x3da341[_0x8cac('0x5e')][_0x8cac('0x62')],'statusCode':_0x3da341[_0x8cac('0x63')][_0x8cac('0x64')],'endConversation':_0x3da341[_0x8cac('0x5e')]['metadata'][_0x8cac('0x65')]||![],'isFallbackIntent':_0x3da341[_0x8cac('0x5e')][_0x8cac('0x66')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x408043,_0x3e97fc,_0xb57db3,_0x4ca55a,_0x1da39f,_0x28ae21){var _0xce5ff3=_0x4ca55a[_0x8cac('0x67')](/\\n/g,'\x0a');var _0x5516a5={'credentials':{'private_key':_0xce5ff3,'client_email':_0xb57db3}};var _0x25c1e9=new dialogflow[(_0x8cac('0x68'))](_0x5516a5);var _0x49dcd5=_0x25c1e9[_0x8cac('0x69')](_0x3e97fc,md5(_0x408043));var _0x3f10f0={'session':_0x49dcd5,'queryInput':{'text':{'text':_0x1da39f,'languageCode':_0x28ae21}}};return _0x25c1e9[_0x8cac('0x6a')](_0x3f10f0)[_0x8cac('0x2e')](function(_0x18bfd3){if(_0x18bfd3&&_0x18bfd3[_0x8cac('0x4a')]){logger[_0x8cac('0x1f')](_0x8cac('0x6b'),JSON[_0x8cac('0x46')](_0x18bfd3));var _0xd7a74c=_0x18bfd3[0x0];if(_0xd7a74c){var _0x2db337={'action':_0xd7a74c['queryResult'][_0x8cac('0x5f')],'allRequiredParamsPresent':_0xd7a74c[_0x8cac('0x6c')][_0x8cac('0x6d')],'endConversation':_0xd7a74c[_0x8cac('0x6c')]['diagnosticInfo']&&_0xd7a74c[_0x8cac('0x6c')][_0x8cac('0x6e')][_0x8cac('0x6f')]?_0xd7a74c['queryResult'][_0x8cac('0x6e')][_0x8cac('0x6f')][_0x8cac('0x70')]['boolValue']:![],'fulfillmentText':_0xd7a74c['queryResult']['fulfillmentText'],'intentName':_0xd7a74c[_0x8cac('0x6c')][_0x8cac('0x71')][_0x8cac('0x59')],'intentDisplayName':_0xd7a74c[_0x8cac('0x6c')]['intent']['displayName'],'isFallbackIntent':_0xd7a74c['queryResult'][_0x8cac('0x71')][_0x8cac('0x72')],'languageCode':_0xd7a74c[_0x8cac('0x6c')][_0x8cac('0x73')],'queryText':_0xd7a74c['queryResult'][_0x8cac('0x74')],'responseId':_0xd7a74c[_0x8cac('0x75')],'score':_0xd7a74c[_0x8cac('0x6c')]['intentDetectionConfidence'],'speech':_0xd7a74c[_0x8cac('0x6c')][_0x8cac('0x76')],'providerResponse':JSON[_0x8cac('0x46')](_0x18bfd3)};return _0x2db337;}}});};exports['tildeASR']=function(_0x126bdb,_0x45bc5b,_0x36ecb5,_0x172e47){return tilde[_0x8cac('0x4e')](_0x126bdb,_0x45bc5b,_0x36ecb5,_0x172e47)[_0x8cac('0x2e')](function(_0x1f62ef){try{fs[_0x8cac('0x3f')](_0x126bdb);}catch(_0x35b8f0){logger[_0x8cac('0x19')](_0x35b8f0);}logger[_0x8cac('0x1f')](_0x8cac('0x77'),_0x1f62ef['transcript']);logger[_0x8cac('0x1f')](_0x8cac('0x78'),_0x1f62ef[_0x8cac('0x55')]);return _0x1f62ef;});};exports[_0x8cac('0x79')]=function(_0x229c28,_0x29bbbf,_0x5ed5ef,_0x3530a5,_0x40d725,_0x150f30){var _0x26f89c=path['resolve'](__dirname,_0x8cac('0x2a'),rs[_0x8cac('0x2b')](0x4)+_0x8cac('0x7a'));var _0x443c32;return aws[_0x8cac('0x7b')](_0x229c28,_0x29bbbf,_0x5ed5ef,_0x3530a5,_0x40d725,_0x150f30,_0x26f89c)['then'](function(){_0x443c32=path[_0x8cac('0x29')](__dirname,_0x8cac('0x2a'),rs[_0x8cac('0x2b')](0x4)+_0x8cac('0x3e'));return convertFile(_0x26f89c,_0x443c32);})[_0x8cac('0x2e')](function(){try{fs[_0x8cac('0x3f')](_0x26f89c);fs[_0x8cac('0x3d')](_0x443c32,_0x8cac('0x2f'));}catch(_0x4d2fbc){logger[_0x8cac('0x19')](_0x4d2fbc);}return _0x443c32[_0x8cac('0x30')]('.')[0x0];});};exports[_0x8cac('0x7c')]=function(_0x45c0fc,_0x139ce2,_0x5c34d4,_0x79fbab,_0xfbe8f7,_0x2aa9a4){return aws[_0x8cac('0x7d')](_0x45c0fc,_0x139ce2,_0x5c34d4,_0x79fbab,_0xfbe8f7,_0x2aa9a4)[_0x8cac('0x2e')](function(_0xabe240){logger[_0x8cac('0x1f')](JSON[_0x8cac('0x46')](_0xabe240));return _0xabe240;});};exports[_0x8cac('0x7e')]=function(_0x2aa4e6,_0x2eac59,_0x281141,_0x92f76){var _0x415fa1=util['format']('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x2aa4e6,encodeURIComponent(_0x2eac59),_0x281141,_0x92f76);var _0x5bbf0b=path[_0x8cac('0x29')](__dirname,'tmp',rs['generate'](0x4)+_0x8cac('0x7a'));var _0xf2f5ad;return downloadFile(_0x415fa1,_0x5bbf0b)[_0x8cac('0x2e')](function(){_0xf2f5ad=path['resolve'](__dirname,_0x8cac('0x2a'),rs['generate'](0x4)+_0x8cac('0x3e'));return convertFile(_0x5bbf0b,_0xf2f5ad);})[_0x8cac('0x2e')](function(){try{fs['unlink'](_0x5bbf0b);fs[_0x8cac('0x3d')](_0xf2f5ad,_0x8cac('0x2f'));}catch(_0x599157){logger['error'](_0x599157);}return _0xf2f5ad[_0x8cac('0x30')]('.')[0x0];});};exports[_0x8cac('0x7f')]=function(_0x3c81c0,_0x4bcb6f,_0x282439,_0x282800){var _0x424997=util['format'](_0x8cac('0x80'),ISPEECH_API,_0x4bcb6f,_0x282439,base64Encode(_0x3c81c0),_0x282800?util[_0x8cac('0x81')](_0x8cac('0x82'),encodeURIComponent(_0x282800)):'freeform=3');return uploadFile(_0x424997)[_0x8cac('0x2e')](function(_0x40e96c){return querystring[_0x8cac('0x83')](_0x40e96c);});};exports[_0x8cac('0x84')]=function(_0x4f950f,_0x4b77b4){return sestek[_0x8cac('0x85')](_0x4f950f,_0x4b77b4)[_0x8cac('0x2e')](function(_0x3eb1e8){logger['info'](JSON[_0x8cac('0x46')](_0x3eb1e8));var _0x54e2fa={'speech':_0x3eb1e8[_0x8cac('0x86')],'action':_0x3eb1e8['channelData']?_0x3eb1e8[_0x8cac('0x87')][_0x8cac('0x88')]:undefined,'actiondata':_0x3eb1e8[_0x8cac('0x87')]?_0x3eb1e8[_0x8cac('0x87')]['CustomActionData']:undefined};if(_0x3eb1e8[_0x8cac('0x87')]&&_0x3eb1e8[_0x8cac('0x87')]['AudioFromTts']){return base64Decode(_0x3eb1e8[_0x8cac('0x87')][_0x8cac('0x89')][_0x8cac('0x8a')],path[_0x8cac('0x29')](__dirname,_0x8cac('0x2a'),rs[_0x8cac('0x2b')](0x4)+_0x8cac('0x3e')))[_0x8cac('0x2e')](function(_0x500b3b){_0x54e2fa[_0x8cac('0x8b')]=_0x500b3b;return _0x54e2fa;});}return _0x54e2fa;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xeb9c=['get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','finish\x20download\x20file','close','download\x20error','pipe','data','end','transcode','error\x20convert','start','tmp','.wav','writeFileSync','unlink','chmodSync','split','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','then','resolve','generate','.mp3','from','writeFile','777','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','application/x-www-form-urlencoded','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','goggleTTS\x20path','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','result','action','fulfillment','speech','status','metadata','googleDialogflowV2','replace','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','fields','diagnosticInfo','end_conversation','name','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','fulfillmentText','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','text','channelData','CustomAction','AudioFromTts','Data','dirName','bluebird','https','md5','path','querystring','randomstring','sox','url','parse','./aws','./google','./tilde','../../../config/logger','protocol','WHAT_EVER'];(function(_0x42639d,_0x2d1f80){var _0x390dff=function(_0x1c742f){while(--_0x1c742f){_0x42639d['push'](_0x42639d['shift']());}};_0x390dff(++_0x2d1f80);}(_0xeb9c,0x66));var _0xceb9=function(_0x46d8e4,_0x581be5){_0x46d8e4=_0x46d8e4-0x0;var _0x13e1bb=_0xeb9c[_0x46d8e4];return _0x13e1bb;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xceb9('0x0'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require('http');var https=require(_0xceb9('0x1'));var md5=require(_0xceb9('0x2'));var path=require(_0xceb9('0x3'));var querystring=require(_0xceb9('0x4'));var rp=require('request-promise');var rs=require(_0xceb9('0x5'));var sox=require(_0xceb9('0x6'));var tts=require('google-tts-api');var urlParse=require(_0xceb9('0x7'))[_0xceb9('0x8')];var util=require('util');var aws=require(_0xceb9('0x9'));var google=require(_0xceb9('0xa'));var sestek=require('./sestek');var tilde=require(_0xceb9('0xb'));var logger=require(_0xceb9('0xc'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x11b3d9,_0x41cb23){return new BPromise(function(_0x310909,_0x106e05){var _0x2b88cc=urlParse(_0x11b3d9);var _0x14d44a=_0x2b88cc[_0xceb9('0xd')]==='https:'?https:http;var _0x2643e4={'host':_0x2b88cc['host'],'path':_0x2b88cc[_0xceb9('0x3')],'headers':{'user-agent':_0xceb9('0xe')}};_0x14d44a[_0xceb9('0xf')](_0x2643e4,function(_0x34be69){if(_0x34be69['statusCode']!==0xc8){logger[_0xceb9('0x10')](_0xceb9('0x11')+_0x11b3d9+_0xceb9('0x12')+_0x34be69[_0xceb9('0x13')]+'\x20('+_0x34be69[_0xceb9('0x14')]+')');_0x106e05(new Error(_0xceb9('0x11')+_0x11b3d9+_0xceb9('0x12')+_0x34be69[_0xceb9('0x13')]+'\x20('+_0x34be69[_0xceb9('0x14')]+')'));return;}var _0x251bcb=fs['createWriteStream'](_0x41cb23);_0x251bcb['on'](_0xceb9('0x15'),function(){logger[_0xceb9('0x16')](_0xceb9('0x17'));_0x251bcb[_0xceb9('0x18')](_0x310909);});_0x251bcb['on'](_0xceb9('0x10'),function(_0xaf926b){fs['unlink'](_0x41cb23);logger[_0xceb9('0x10')](_0xceb9('0x19'),_0xaf926b);_0x106e05(_0xaf926b);});_0x34be69[_0xceb9('0x1a')](_0x251bcb);})['on']('error',function(_0x14ebbe){logger['error'](_0x14ebbe);_0x106e05(_0x14ebbe);})['end']();});}function uploadFile(_0x292b8c){return new BPromise(function(_0x362b81,_0x53ce95){var _0x10ed62=urlParse(_0x292b8c);var _0x2d95fb=_0x10ed62[_0xceb9('0xd')]==='https:'?https:http;var _0xfebf8e={'host':_0x10ed62['host'],'path':_0x10ed62[_0xceb9('0x3')],'headers':{'user-agent':_0xceb9('0xe')}};_0x2d95fb[_0xceb9('0xf')](_0xfebf8e,function(_0x4efa44){if(_0x4efa44[_0xceb9('0x13')]!==0xc8){_0x53ce95(new Error('request\x20to\x20'+_0x292b8c+'\x20failed,\x20status\x20code\x20=\x20'+_0x4efa44[_0xceb9('0x13')]+'\x20('+_0x4efa44[_0xceb9('0x14')]+')'));return;}var _0x25f8bd='';_0x4efa44['on'](_0xceb9('0x1b'),function(_0x283c39){_0x25f8bd+=_0x283c39;});_0x4efa44['on'](_0xceb9('0x1c'),function(){_0x362b81(_0x25f8bd);});})['on']('error',function(_0x9d1fda){_0x53ce95(_0x9d1fda);})[_0xceb9('0x1c')]();});}function convertFile(_0x5c6c70,_0x16bf83){return new BPromise(function(_0xd0345a,_0x10a5d1){var _0x3cc976=sox[_0xceb9('0x1d')](_0x5c6c70,_0x16bf83,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3cc976['on'](_0xceb9('0x10'),function(_0x6a2bc4){logger[_0xceb9('0x10')](_0xceb9('0x1e'),_0x6a2bc4);_0x10a5d1(_0x6a2bc4);});_0x3cc976['on'](_0xceb9('0x1c'),function(){logger[_0xceb9('0x16')]('finish\x20to\x20convert');_0xd0345a();});_0x3cc976[_0xceb9('0x1f')]();});}function base64Decode(_0x257b75,_0x4641d7){var _0x296843=path['resolve'](__dirname,_0xceb9('0x20'),rs['generate'](0x4)+_0xceb9('0x21'));fs[_0xceb9('0x22')](_0x296843,_0x257b75,'base64');return convertFile(_0x296843,_0x4641d7)['then'](function(){try{fs[_0xceb9('0x23')](_0x296843);fs[_0xceb9('0x24')](_0x4641d7,'777');}catch(_0x483aae){logger[_0xceb9('0x10')](_0x483aae);}return _0x4641d7[_0xceb9('0x25')]('.')[0x0];});}function base64Encode(_0x3a5aaa){var _0x526110=fs['readFileSync'](_0x3a5aaa);return new Buffer(_0x526110)[_0xceb9('0x26')](_0xceb9('0x27'));}exports[_0xceb9('0x28')]=function(_0x5c9ff9,_0x8c7a15,_0xaafec5,_0x189203,_0x326dc1,_0x53b522){var _0x3f0f74,_0x246a2a;var _0x5c1da3=_0xceb9('0x29');var _0x288742=_0xceb9('0x2a')+_0x5c9ff9;var _0x23a540={};if(_0x8c7a15===_0xceb9('0x2b')){_0x23a540['input']={'ssml':_0xaafec5};}else{_0x23a540[_0xceb9('0x2c')]={'text':_0xaafec5};};_0x23a540[_0xceb9('0x2d')]={'languageCode':_0x189203,'ssmlGender':_0x326dc1};_0x23a540[_0xceb9('0x2e')]={'audioEncoding':_0xceb9('0x2f'),'sampleRateHertz':0x1f40};var _0x4e359f={'url':_0x5c1da3+'text:synthesize'+_0x288742,'method':'POST','json':!![],'body':_0x23a540};return rp(_0x4e359f)[_0xceb9('0x30')](function(_0x5721d9){return new BPromise(function(_0x547b00,_0x1a90ee){_0x3f0f74=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x33'));var _0x56e4de=Buffer[_0xceb9('0x34')](_0x5721d9['audioContent'],_0xceb9('0x27'));return fs[_0xceb9('0x35')](_0x3f0f74,_0x56e4de,function(_0x5ac328){_0x1a90ee(_0x5ac328);},function(_0x26c253){fs['chmodSync'](_0x3f0f74,_0xceb9('0x36'));_0x547b00(_0x26c253);});});})[_0xceb9('0x30')](function(_0x31836b){_0x246a2a=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs['generate'](0x4)+_0xceb9('0x21'));return convertFile(_0x3f0f74,_0x246a2a);})['then'](function(){try{fs[_0xceb9('0x23')](_0x3f0f74);fs[_0xceb9('0x24')](_0x246a2a,_0xceb9('0x36'));}catch(_0x3098f1){logger['error'](_0x3098f1);}logger[_0xceb9('0x16')](_0xceb9('0x37'),_0x246a2a[_0xceb9('0x25')]('.')[0x0]);return _0x246a2a[_0xceb9('0x25')]('.')[0x0];});};exports['googleTTS']=function(_0x5a5a2b,_0x55cfd0){var _0x393ccb=_0xceb9('0x38');var _0x6ab9f,_0x5b41be;var _0x14fce4;var _0x2acd00={'encoding':_0xceb9('0x39'),'method':_0xceb9('0x3a'),'timeout':0x2710,'url':_0x393ccb,'headers':{'Content-Type':_0xceb9('0x3b')},'body':'f.req='+encodeURIComponent(JSON[_0xceb9('0x3c')]([[['jQ1olc',JSON[_0xceb9('0x3c')]([_0x5a5a2b,_0x55cfd0||'en',![],_0xceb9('0x3d')]),null,_0xceb9('0x3e')]]]))};return rp(_0x2acd00)['then'](function(_0x4bee1c){try{_0x14fce4=eval(_0x4bee1c[_0xceb9('0x3f')](0x5))[0x0][0x2];}catch(_0x3536cb){throw new Error(_0xceb9('0x40')+_0x4bee1c['data']);}if(!_0x14fce4){if(_0x5a5a2b[_0xceb9('0x41')]>0xc8){throw new Error(_0xceb9('0x42'));}else{throw new Error('lang\x20\x22'+_0x55cfd0+'\x22\x20might\x20not\x20exist');}}try{_0x14fce4=eval(_0x14fce4)[0x0];}catch(_0x277cd5){throw new Error(_0xceb9('0x40')+res[_0xceb9('0x1b')]);}const _0x1b6473=_0x14fce4;_0x6ab9f=path['resolve'](__dirname,'tmp',rs[_0xceb9('0x32')](0x4)+'.mp3');fs[_0xceb9('0x22')](_0x6ab9f,_0x14fce4,{'encoding':_0xceb9('0x27')});_0x5b41be=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x21'));return convertFile(_0x6ab9f,_0x5b41be);})[_0xceb9('0x30')](function(){try{fs[_0xceb9('0x23')](_0x6ab9f);fs[_0xceb9('0x24')](_0x5b41be,_0xceb9('0x36'));}catch(_0x333e83){logger[_0xceb9('0x10')](_0x333e83);}logger[_0xceb9('0x16')](_0xceb9('0x43'),_0x5b41be[_0xceb9('0x25')]('.')[0x0]);return _0x5b41be[_0xceb9('0x25')]('.')[0x0];});};exports['googleASR']=function(_0x4a9d40,_0x705067,_0x46e0cf){return google[_0xceb9('0x44')](_0x4a9d40,_0x705067,_0x46e0cf)[_0xceb9('0x30')](function(_0x3e9492){logger[_0xceb9('0x16')](_0x3e9492[_0xceb9('0x45')]);return rp(_0x3e9492);})['then'](function(_0x57ae2d){var _0x39da15='';var _0xa3689a=0x0;try{fs[_0xceb9('0x23')](_0x4a9d40);}catch(_0x2bec20){logger[_0xceb9('0x10')](_0x2bec20);}if(_0x57ae2d&&_0x57ae2d[_0xceb9('0x46')]){_0x39da15=_0x57ae2d[_0xceb9('0x46')][_0xceb9('0x47')](function(_0x2627a4){return _0x2627a4&&_0x2627a4[_0xceb9('0x48')][0x0]&&_0x2627a4[_0xceb9('0x48')][0x0][_0xceb9('0x49')]?_0x2627a4['alternatives'][0x0][_0xceb9('0x49')]:'';})[_0xceb9('0x4a')]('\x0a');_0xa3689a=_0x57ae2d['results'][_0xceb9('0x47')](function(_0x8bf921){return _0x8bf921&&_0x8bf921['alternatives'][0x0]&&_0x8bf921['alternatives'][0x0][_0xceb9('0x4b')]?_0x8bf921[_0xceb9('0x48')][0x0][_0xceb9('0x4b')]:0x0;})[_0xceb9('0x4a')]('\x0a');}logger[_0xceb9('0x16')]('googleASR\x20transcription',_0x39da15);logger['info'](_0xceb9('0x4c'),_0xa3689a);return{'transcript':_0x39da15,'confidence':_0xa3689a};})[_0xceb9('0x4d')](function(_0x5c0cd8){logger['error'](_0xceb9('0x4e'),_0x5c0cd8[_0xceb9('0x13')],_0x5c0cd8['name'],_0x5c0cd8[_0xceb9('0x4f')]);});};exports[_0xceb9('0x50')]=function(_0x3001ec,_0x314c2e,_0x2bc1b7,_0x52edc4){var _0x145d62=apiai(_0x314c2e,{'language':_0x52edc4||'en'});return _0x145d62['textRequest'](_0x2bc1b7,{'sessionId':md5(_0x3001ec)})[_0xceb9('0x30')](function(_0x119cca){logger[_0xceb9('0x16')](JSON[_0xceb9('0x3c')](_0x119cca));return{'source':_0x119cca[_0xceb9('0x51')]['source'],'resolvedQuery':_0x119cca[_0xceb9('0x51')]['resolvedQuery'],'action':_0x119cca[_0xceb9('0x51')][_0xceb9('0x52')],'actionIncomplete':_0x119cca[_0xceb9('0x51')]['actionIncomplete'],'speech':_0x119cca[_0xceb9('0x51')][_0xceb9('0x53')][_0xceb9('0x54')],'score':_0x119cca['result']['score'],'statusCode':_0x119cca[_0xceb9('0x55')]['code'],'endConversation':_0x119cca[_0xceb9('0x51')][_0xceb9('0x56')]['endConversation']||![],'isFallbackIntent':_0x119cca['result'][_0xceb9('0x56')]['isFallbackIntent']};});};exports[_0xceb9('0x57')]=function(_0x38fd17,_0x1b8d0c,_0x22970b,_0x155b92,_0x1d1c69,_0x4eb9b0){var _0x479487=_0x155b92[_0xceb9('0x58')](/\\n/g,'\x0a');var _0x162041={'credentials':{'private_key':_0x479487,'client_email':_0x22970b}};var _0xfb88b6=new dialogflow['SessionsClient'](_0x162041);var _0x3ad7d4=_0xfb88b6[_0xceb9('0x59')](_0x1b8d0c,md5(_0x38fd17));var _0x54c190={'session':_0x3ad7d4,'queryInput':{'text':{'text':_0x1d1c69,'languageCode':_0x4eb9b0}}};return _0xfb88b6[_0xceb9('0x5a')](_0x54c190)[_0xceb9('0x30')](function(_0x1ad432){if(_0x1ad432&&_0x1ad432[_0xceb9('0x41')]){logger[_0xceb9('0x16')]('Dialogflow\x20V2\x20response:',JSON[_0xceb9('0x3c')](_0x1ad432));var _0x1e93c4=_0x1ad432[0x0];if(_0x1e93c4){var _0x34d654={'action':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x52')],'allRequiredParamsPresent':_0x1e93c4['queryResult'][_0xceb9('0x5c')],'endConversation':_0x1e93c4[_0xceb9('0x5b')]['diagnosticInfo']&&_0x1e93c4[_0xceb9('0x5b')]['diagnosticInfo'][_0xceb9('0x5d')]?_0x1e93c4['queryResult'][_0xceb9('0x5e')][_0xceb9('0x5d')][_0xceb9('0x5f')]['boolValue']:![],'fulfillmentText':_0x1e93c4[_0xceb9('0x5b')]['fulfillmentText'],'intentName':_0x1e93c4[_0xceb9('0x5b')]['intent'][_0xceb9('0x60')],'intentDisplayName':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x61')][_0xceb9('0x62')],'isFallbackIntent':_0x1e93c4[_0xceb9('0x5b')]['intent'][_0xceb9('0x63')],'languageCode':_0x1e93c4['queryResult'][_0xceb9('0x64')],'queryText':_0x1e93c4['queryResult']['queryText'],'responseId':_0x1e93c4[_0xceb9('0x65')],'score':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x66')],'speech':_0x1e93c4[_0xceb9('0x5b')][_0xceb9('0x67')],'providerResponse':JSON[_0xceb9('0x3c')](_0x1ad432)};return _0x34d654;}}});};exports['tildeASR']=function(_0x271846,_0x46b303,_0x89c4dc,_0xb0a28d){return tilde[_0xceb9('0x44')](_0x271846,_0x46b303,_0x89c4dc,_0xb0a28d)[_0xceb9('0x30')](function(_0x16032a){try{fs['unlink'](_0x271846);}catch(_0x53966e){logger[_0xceb9('0x10')](_0x53966e);}logger['info']('Tilde\x20ASR\x20transcription',_0x16032a[_0xceb9('0x49')]);logger[_0xceb9('0x16')]('Tilde\x20ASR\x20confidence',_0x16032a[_0xceb9('0x4b')]);return _0x16032a;});};exports['awsPolly']=function(_0x11d417,_0x20aa48,_0x4c7050,_0x5ac905,_0x4d85e9,_0x54466e){var _0x4f88de=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x33'));var _0x343318;return aws[_0xceb9('0x68')](_0x11d417,_0x20aa48,_0x4c7050,_0x5ac905,_0x4d85e9,_0x54466e,_0x4f88de)[_0xceb9('0x30')](function(){_0x343318=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x21'));return convertFile(_0x4f88de,_0x343318);})[_0xceb9('0x30')](function(){try{fs[_0xceb9('0x23')](_0x4f88de);fs[_0xceb9('0x24')](_0x343318,_0xceb9('0x36'));}catch(_0x4788b5){logger['error'](_0x4788b5);}return _0x343318[_0xceb9('0x25')]('.')[0x0];});};exports['awsLex']=function(_0xb3cfe5,_0x474b25,_0x5b1593,_0x597201,_0x3b4690,_0x451435){return aws[_0xceb9('0x69')](_0xb3cfe5,_0x474b25,_0x5b1593,_0x597201,_0x3b4690,_0x451435)[_0xceb9('0x30')](function(_0x508f17){logger[_0xceb9('0x16')](JSON[_0xceb9('0x3c')](_0x508f17));return _0x508f17;});};exports[_0xceb9('0x6a')]=function(_0x55e270,_0x3567f2,_0x272936,_0x10ab56){var _0x3a1441=util[_0xceb9('0x6b')](_0xceb9('0x6c'),ISPEECH_API,_0x55e270,encodeURIComponent(_0x3567f2),_0x272936,_0x10ab56);var _0x2fc162=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x33'));var _0x259bb9;return downloadFile(_0x3a1441,_0x2fc162)['then'](function(){_0x259bb9=path[_0xceb9('0x31')](__dirname,_0xceb9('0x20'),rs[_0xceb9('0x32')](0x4)+_0xceb9('0x21'));return convertFile(_0x2fc162,_0x259bb9);})[_0xceb9('0x30')](function(){try{fs['unlink'](_0x2fc162);fs[_0xceb9('0x24')](_0x259bb9,_0xceb9('0x36'));}catch(_0x66d4fe){logger['error'](_0x66d4fe);}return _0x259bb9[_0xceb9('0x25')]('.')[0x0];});};exports['ispeechASR']=function(_0x1ef191,_0x17eb14,_0xb17e03,_0x12f9e7){var _0x426b40=util[_0xceb9('0x6b')](_0xceb9('0x6d'),ISPEECH_API,_0x17eb14,_0xb17e03,base64Encode(_0x1ef191),_0x12f9e7?util[_0xceb9('0x6b')]('model=%s',encodeURIComponent(_0x12f9e7)):_0xceb9('0x6e'));return uploadFile(_0x426b40)[_0xceb9('0x30')](function(_0x4f2d58){return querystring['parse'](_0x4f2d58);});};exports['sestekNDA']=function(_0x1c023e,_0x1f44b5){return sestek['nda'](_0x1c023e,_0x1f44b5)[_0xceb9('0x30')](function(_0x52960a){logger['info'](JSON[_0xceb9('0x3c')](_0x52960a));var _0x28f49e={'speech':_0x52960a[_0xceb9('0x6f')],'action':_0x52960a[_0xceb9('0x70')]?_0x52960a[_0xceb9('0x70')][_0xceb9('0x71')]:undefined,'actiondata':_0x52960a[_0xceb9('0x70')]?_0x52960a[_0xceb9('0x70')]['CustomActionData']:undefined};if(_0x52960a[_0xceb9('0x70')]&&_0x52960a['channelData'][_0xceb9('0x72')]){return base64Decode(_0x52960a[_0xceb9('0x70')][_0xceb9('0x72')][_0xceb9('0x73')],path['resolve'](__dirname,_0xceb9('0x20'),rs['generate'](0x4)+'.wav'))[_0xceb9('0x30')](function(_0x221c11){_0x28f49e['audiofile']=_0x221c11;return _0x28f49e;});}return _0x28f49e;});};exports[_0xceb9('0x74')]=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 d26c5cd..7714c3c 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 _0xd616=['./nda','exports'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0xd616,0x16a));var _0x6d61=function(_0x575934,_0x4a6760){_0x575934=_0x575934-0x0;var _0x109a3d=_0xd616[_0x575934];return _0x109a3d;};var nda=require(_0x6d61('0x0'));module[_0x6d61('0x1')]={'nda':nda}; \ No newline at end of file +var _0x6ddb=['./nda'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x6ddb,0x1cd));var _0xb6dd=function(_0x57bc28,_0x162717){_0x57bc28=_0x57bc28-0x0;var _0x4d3b22=_0x6ddb[_0x57bc28];return _0x4d3b22;};var nda=require(_0xb6dd('0x0'));module['exports']={'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 9d8bded..e65b606 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 _0x18e0=['project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','agi','exports','ndauth_url','/token','password','then','POST','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','extension','text','Bearer\x20','access_token'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x18e0,0xa2));var _0x018e=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x18e0[_0x172747];return _0x509692;};'use strict';var rp=require('request-promise');var url=require(_0x018e('0x0'));var logger=require('../../../../../config/logger')(_0x018e('0x1'));module[_0x018e('0x2')]=function(_0x356418,_0x4d12a5){var _0x2a0965={'method':'POST','uri':url['resolve'](_0x4d12a5[_0x018e('0x3')],_0x018e('0x4')),'form':{'grant_type':_0x018e('0x5'),'username':_0x4d12a5['username'],'password':_0x4d12a5['password']},'json':!![]};return rp(_0x2a0965)[_0x018e('0x6')](function(_0x24e838){var _0x5b2267={'method':_0x018e('0x7'),'uri':url[_0x018e('0x8')](_0x4d12a5[_0x018e('0x9')],_0x018e('0xa')),'body':{'type':_0x4d12a5[_0x018e('0xb')]||_0x018e('0xc'),'channelId':'Nda','conversation':{'id':_0x356418[_0x018e('0xd')]},'from':{'id':_0x356418['callerid'],'name':_0x356418['calleridname']},'recipient':{'id':_0x356418['dnid'],'name':_0x356418[_0x018e('0xe')]},'text':_0x4d12a5[_0x018e('0xf')],'channelData':{}},'headers':{'Authorization':_0x018e('0x10')+_0x24e838[_0x018e('0x11')]},'json':!![]};if(_0x4d12a5[_0x018e('0x12')]){_0x5b2267[_0x018e('0x13')][_0x018e('0x14')][_0x018e('0x15')]=_0x4d12a5[_0x018e('0x12')];}if(_0x4d12a5['ndagenerate_audio']=='1'){_0x5b2267[_0x018e('0x13')][_0x018e('0x14')][_0x018e('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x018e('0x17')};}if(_0x4d12a5[_0x018e('0x18')]){_0x5b2267['body'][_0x018e('0x14')][_0x018e('0x19')]=_0x4d12a5[_0x018e('0x18')];if(_0x4d12a5[_0x018e('0x1a')]){_0x5b2267['body'][_0x018e('0x14')][_0x018e('0x1b')]=_0x4d12a5['custom_action_data'];}}logger[_0x018e('0x1c')](JSON[_0x018e('0x1d')](_0x5b2267));return rp(_0x5b2267);});}; \ No newline at end of file +var _0x222f=['custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','/token','username','password','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction'];(function(_0x40f6f1,_0x593961){var _0x32f6b7=function(_0x3b7786){while(--_0x3b7786){_0x40f6f1['push'](_0x40f6f1['shift']());}};_0x32f6b7(++_0x593961);}(_0x222f,0x1a4));var _0xf222=function(_0x533110,_0x20937f){_0x533110=_0x533110-0x0;var _0xc3c866=_0x222f[_0x533110];return _0xc3c866;};'use strict';var rp=require(_0xf222('0x0'));var url=require(_0xf222('0x1'));var logger=require(_0xf222('0x2'))(_0xf222('0x3'));module['exports']=function(_0x4b4237,_0x195de1){var _0x233e95={'method':_0xf222('0x4'),'uri':url[_0xf222('0x5')](_0x195de1['ndauth_url'],_0xf222('0x6')),'form':{'grant_type':'password','username':_0x195de1[_0xf222('0x7')],'password':_0x195de1[_0xf222('0x8')]},'json':!![]};return rp(_0x233e95)['then'](function(_0xf5a105){var _0x302d7a={'method':'POST','uri':url[_0xf222('0x5')](_0x195de1[_0xf222('0x9')],_0xf222('0xa')),'body':{'type':_0x195de1[_0xf222('0xb')]||_0xf222('0xc'),'channelId':_0xf222('0xd'),'conversation':{'id':_0x4b4237['uniqueid']},'from':{'id':_0x4b4237[_0xf222('0xe')],'name':_0x4b4237[_0xf222('0xf')]},'recipient':{'id':_0x4b4237[_0xf222('0x10')],'name':_0x4b4237[_0xf222('0x11')]},'text':_0x195de1['text'],'channelData':{}},'headers':{'Authorization':_0xf222('0x12')+_0xf5a105[_0xf222('0x13')]},'json':!![]};if(_0x195de1[_0xf222('0x14')]){_0x302d7a[_0xf222('0x15')][_0xf222('0x16')][_0xf222('0x17')]=_0x195de1[_0xf222('0x14')];}if(_0x195de1[_0xf222('0x18')]=='1'){_0x302d7a['body']['channelData'][_0xf222('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf222('0x1a')};}if(_0x195de1['custom_action']){_0x302d7a[_0xf222('0x15')][_0xf222('0x16')][_0xf222('0x1b')]=_0x195de1[_0xf222('0x1c')];if(_0x195de1[_0xf222('0x1d')]){_0x302d7a[_0xf222('0x15')][_0xf222('0x16')]['CustomActionData']=_0x195de1[_0xf222('0x1d')];}}logger[_0xf222('0x1e')](JSON[_0xf222('0x1f')](_0x302d7a));return rp(_0x302d7a);});}; \ 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 380713a..1ddd5e0 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 _0xdac0=['exports'];(function(_0x5238b5,_0x19dc13){var _0x2950ca=function(_0x44910f){while(--_0x44910f){_0x5238b5['push'](_0x5238b5['shift']());}};_0x2950ca(++_0x19dc13);}(_0xdac0,0x117));var _0x0dac=function(_0x367125,_0x422229){_0x367125=_0x367125-0x0;var _0x210ab9=_0xdac0[_0x367125];return _0x210ab9;};'use strict';var asr=require('./lib/api');module[_0x0dac('0x0')]=function(_0x5000b2,_0x5ec564,_0x47f513,_0x7518e6){return asr(_0x5000b2,_0x5ec564,_0x47f513,_0x7518e6);}; \ No newline at end of file +var _0xd4ee=['exports'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xd4ee,0x107));var _0xed4e=function(_0x24ccba,_0x47c493){_0x24ccba=_0x24ccba-0x0;var _0x2c008a=_0xd4ee[_0x24ccba];return _0x2c008a;};'use strict';var asr=require('./lib/api');module[_0xed4e('0x0')]=function(_0x22fcae,_0x30ab2f,_0x8ac6bc,_0x582989){return asr(_0x22fcae,_0x30ab2f,_0x8ac6bc,_0x582989);}; \ 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 79cdc21..bb27a17 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 _0xf529=['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','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Error\x20Tilde\x20ASR\x20socket','message','close','bluebird','lodash','moment','crypto','../../../../../../config/logger','agi','exports'];(function(_0x4e329c,_0x5264ef){var _0xe2dea1=function(_0x1bbd25){while(--_0x1bbd25){_0x4e329c['push'](_0x4e329c['shift']());}};_0xe2dea1(++_0x5264ef);}(_0xf529,0xd7));var _0x9f52=function(_0x337d1f,_0x1e0490){_0x337d1f=_0x337d1f-0x0;var _0x53a8c6=_0xf529[_0x337d1f];return _0x53a8c6;};'use strict';var BPromise=require(_0x9f52('0x0'));var _=require(_0x9f52('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x9f52('0x2'));var crypto=require(_0x9f52('0x3'));var logger=require(_0x9f52('0x4'))(_0x9f52('0x5'));module[_0x9f52('0x6')]=function(_0x2e93cf,_0x8b5a42,_0x59148d,_0x119102){return new BPromise(function(_0xd8c14c,_0x209f47){logger[_0x9f52('0x7')](_0x9f52('0x8'),_0x119102||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x3017bf=new WebSocket(_0x119102||_0x9f52('0x9'),{'perMessageDeflate':![]});var _0x33640b='';var _0x360d22='0';var _0x2343ad='1';var _0x3ab5f9=_0x9f52('0xa');function _0x3cda25(_0x133810){var _0x53a374=crypto[_0x9f52('0xb')](_0x9f52('0xc'));_0x53a374[_0x9f52('0xd')](_0x133810);return _0x53a374['digest']('hex');}function _0x2a222f(){try{logger[_0x9f52('0x7')]('Open\x20Tilde\x20ASR\x20socket');var _0x3eaa17=moment()['unix']();var _0x3c8558=_0x3cda25(_0x3eaa17+_0x8b5a42+_0x59148d);_0x3017bf[_0x9f52('0xe')](JSON[_0x9f52('0xf')]({'appID':_0x8b5a42,'timestamp':_0x3eaa17,'appKey':_0x3c8558}));var _0x31b319=fs[_0x9f52('0x10')](_0x2e93cf);_0x31b319['on'](_0x9f52('0x11'),function(_0x4c2ac0){_0x3017bf[_0x9f52('0xe')](_0x4c2ac0);});_0x31b319['on']('close',function(){_0x3017bf[_0x9f52('0xe')](_0x9f52('0x12'));});}catch(_0x5e3c8c){logger[_0x9f52('0x13')](_0x9f52('0x14'),JSON[_0x9f52('0xf')](_0x5e3c8c));_0x3017bf[_0x9f52('0x15')]();}}function _0x5a3e6a(_0x5482ae){try{if(_0x5482ae){var _0x509cbf=JSON['parse'](_0x5482ae);switch(_0x509cbf[_0x9f52('0x16')]){case 0x0:if(_0x509cbf[_0x9f52('0x17')]){if(_0x509cbf[_0x9f52('0x17')][_0x9f52('0x18')]){logger[_0x9f52('0x7')](_0x9f52('0x19'),JSON[_0x9f52('0xf')](_0x509cbf['result']['hypotheses']));_0x33640b=_0x509cbf[_0x9f52('0x17')][_0x9f52('0x1a')][0x0][_0x9f52('0x1b')];_0x360d22=_0x509cbf[_0x9f52('0x17')][_0x9f52('0x1a')][0x0][_0x9f52('0x1c')];_0x2343ad='0';_0x3ab5f9=_0x9f52('0x1d');_0x3017bf['terminate']();}}break;case 0x1:logger['info'](_0x9f52('0xa'));_0x2343ad='1';_0x3ab5f9=_0x9f52('0xa');break;case 0x2:logger[_0x9f52('0x7')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x2343ad='2';_0x3ab5f9=_0x9f52('0x1e');break;case 0x9:logger[_0x9f52('0x7')](_0x9f52('0x1f'));_0x2343ad='9';_0x3ab5f9='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0x9f52('0x20'));_0x2343ad='10';_0x3ab5f9=_0x9f52('0x20');break;case 0xb:logger[_0x9f52('0x7')](_0x9f52('0x21'));_0x2343ad='11';_0x3ab5f9=_0x9f52('0x21');}}}catch(_0x3fe600){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x3fe600));_0x3017bf[_0x9f52('0x15')]();}}function _0x35e99c(){logger[_0x9f52('0x7')]('Close\x20Tilde\x20ASR\x20socket');_0xd8c14c({'transcript':_0x33640b,'confidence':_0x360d22,'status':_0x2343ad,'status_message':_0x3ab5f9});}function _0x51dda7(_0x5cca67){logger[_0x9f52('0x13')](_0x9f52('0x22'));if(!_['isNil'](_0x5cca67)){logger[_0x9f52('0x13')](_['isObject'](_0x5cca67)?JSON[_0x9f52('0xf')](_0x5cca67):_0x5cca67);}}_0x3017bf['on']('open',_0x2a222f);_0x3017bf['on'](_0x9f52('0x23'),_0x5a3e6a);_0x3017bf['on'](_0x9f52('0x24'),_0x35e99c);_0x3017bf['on'](_0x9f52('0x13'),_0x51dda7);});}; \ No newline at end of file +var _0x432f=['message','lodash','crypto','../../../../../../config/logger','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','info','unix','send','createReadStream','close','EOS','error','stringify','parse','status','result','final','hypotheses','transcript','likelihood','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','open'];(function(_0x538209,_0x16bf6c){var _0x30e7f1=function(_0x4eabc1){while(--_0x4eabc1){_0x538209['push'](_0x538209['shift']());}};_0x30e7f1(++_0x16bf6c);}(_0x432f,0x121));var _0xf432=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x432f[_0x2b5eae];return _0x5f3ac9;};'use strict';var BPromise=require('bluebird');var _=require(_0xf432('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf432('0x1'));var logger=require(_0xf432('0x2'))('agi');module[_0xf432('0x3')]=function(_0x1d0165,_0x386abf,_0x4052f7,_0x2f4f61){return new BPromise(function(_0x1121b6,_0x2e94b8){logger['info']('Tilde\x20URI',_0x2f4f61||_0xf432('0x4'));var _0x3de37b=new WebSocket(_0x2f4f61||_0xf432('0x4'),{'perMessageDeflate':![]});var _0x39d2a3='';var _0x663f9e='0';var _0x29d00d='1';var _0x50090a=_0xf432('0x5');function _0x176d14(_0xb1f6a3){var _0x372bb2=crypto[_0xf432('0x6')](_0xf432('0x7'));_0x372bb2[_0xf432('0x8')](_0xb1f6a3);return _0x372bb2[_0xf432('0x9')](_0xf432('0xa'));}function _0x467291(){try{logger[_0xf432('0xb')]('Open\x20Tilde\x20ASR\x20socket');var _0x1c21ee=moment()[_0xf432('0xc')]();var _0x3c55c8=_0x176d14(_0x1c21ee+_0x386abf+_0x4052f7);_0x3de37b[_0xf432('0xd')](JSON['stringify']({'appID':_0x386abf,'timestamp':_0x1c21ee,'appKey':_0x3c55c8}));var _0x32bb82=fs[_0xf432('0xe')](_0x1d0165);_0x32bb82['on']('data',function(_0xce4576){_0x3de37b[_0xf432('0xd')](_0xce4576);});_0x32bb82['on'](_0xf432('0xf'),function(){_0x3de37b[_0xf432('0xd')](_0xf432('0x10'));});}catch(_0xf47bc){logger[_0xf432('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf432('0x12')](_0xf47bc));_0x3de37b['terminate']();}}function _0x42e42f(_0x3f6023){try{if(_0x3f6023){var _0xcc3ac1=JSON[_0xf432('0x13')](_0x3f6023);switch(_0xcc3ac1[_0xf432('0x14')]){case 0x0:if(_0xcc3ac1[_0xf432('0x15')]){if(_0xcc3ac1['result'][_0xf432('0x16')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0xf432('0x12')](_0xcc3ac1[_0xf432('0x15')][_0xf432('0x17')]));_0x39d2a3=_0xcc3ac1[_0xf432('0x15')][_0xf432('0x17')][0x0][_0xf432('0x18')];_0x663f9e=_0xcc3ac1[_0xf432('0x15')][_0xf432('0x17')][0x0][_0xf432('0x19')];_0x29d00d='0';_0x50090a='Success.';_0x3de37b[_0xf432('0x1a')]();}}break;case 0x1:logger[_0xf432('0xb')](_0xf432('0x5'));_0x29d00d='1';_0x50090a=_0xf432('0x5');break;case 0x2:logger['info']('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x29d00d='2';_0x50090a=_0xf432('0x1b');break;case 0x9:logger[_0xf432('0xb')](_0xf432('0x1c'));_0x29d00d='9';_0x50090a=_0xf432('0x1c');break;case 0xa:logger['info']('Authentication\x20failed.');_0x29d00d='10';_0x50090a=_0xf432('0x1d');break;case 0xb:logger[_0xf432('0xb')](_0xf432('0x1e'));_0x29d00d='11';_0x50090a=_0xf432('0x1e');}}}catch(_0x25a0c7){logger['error'](_0xf432('0x1f'),JSON[_0xf432('0x12')](_0x25a0c7));_0x3de37b['terminate']();}}function _0x3f99d0(){logger[_0xf432('0xb')]('Close\x20Tilde\x20ASR\x20socket');_0x1121b6({'transcript':_0x39d2a3,'confidence':_0x663f9e,'status':_0x29d00d,'status_message':_0x50090a});}function _0x445b73(_0xbdc847){logger[_0xf432('0x11')](_0xf432('0x20'));if(!_['isNil'](_0xbdc847)){logger[_0xf432('0x11')](_[_0xf432('0x21')](_0xbdc847)?JSON[_0xf432('0x12')](_0xbdc847):_0xbdc847);}}_0x3de37b['on'](_0xf432('0x22'),_0x467291);_0x3de37b['on'](_0xf432('0x23'),_0x42e42f);_0x3de37b['on'](_0xf432('0xf'),_0x3f99d0);_0x3de37b['on'](_0xf432('0x11'),_0x445b73);});}; \ 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 078f5ec..8f89df2 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 _0xb1c7=['exports','./asr'];(function(_0x59d1c2,_0x51e7d2){var _0x9249f6=function(_0x495411){while(--_0x495411){_0x59d1c2['push'](_0x59d1c2['shift']());}};_0x9249f6(++_0x51e7d2);}(_0xb1c7,0x1e1));var _0x7b1c=function(_0x38080e,_0x95512d){_0x38080e=_0x38080e-0x0;var _0x4e4c87=_0xb1c7[_0x38080e];return _0x4e4c87;};var asr=require(_0x7b1c('0x0'));module[_0x7b1c('0x1')]={'asr':asr}; \ No newline at end of file +var _0xb94e=['./asr'];(function(_0x47328d,_0x2969ba){var _0x1538ed=function(_0x2a60c9){while(--_0x2a60c9){_0x47328d['push'](_0x47328d['shift']());}};_0x1538ed(++_0x2969ba);}(_0xb94e,0x109));var _0xeb94=function(_0x1c3907,_0x41e1a7){_0x1c3907=_0x1c3907-0x0;var _0x27fcd6=_0xb94e[_0x1c3907];return _0x27fcd6;};var asr=require(_0xeb94('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4b17dd0..37a43e0 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 _0xb7c4=['close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','EventEmitter','./error','./channel','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION'];(function(_0xcd9f85,_0x235ee0){var _0x363a8a=function(_0x576944){while(--_0x576944){_0xcd9f85['push'](_0xcd9f85['shift']());}};_0x363a8a(++_0x235ee0);}(_0xb7c4,0x1b9));var _0x4b7c=function(_0x38ea4a,_0x4c381e){_0x38ea4a=_0x38ea4a-0x0;var _0x25c58f=_0xb7c4[_0x38ea4a];return _0x25c58f;};'use strict';var util=require(_0x4b7c('0x0'));var net=require(_0x4b7c('0x1'));var EventEmitter=require('events')[_0x4b7c('0x2')];var AGIError=require(_0x4b7c('0x3'));var AGIChannel=require(_0x4b7c('0x4'));var AGIServer=function(_0x1ac027,_0x113e0,_0x3690c9){var _0x4b1d69=this,_0x1ac027=_0x1ac027||0x11dd,_0x113e0=_0x113e0||_0x4b7c('0x5'),_0x32af5f=null,_0x88782b=0x0;EventEmitter[_0x4b7c('0x6')](_0x4b1d69);function _0xb0a188(){if(!_0x1ac027){_0x4b1d69[_0x4b7c('0x7')](_0x4b7c('0x8'),new AGIError(_0x4b7c('0x9')));return![];}_0x32af5f=net[_0x4b7c('0xa')]();_0x32af5f[_0x4b7c('0xb')](_0x1ac027,_0x113e0);_0x32af5f['on'](_0x4b7c('0xc'),function(){_0x4b1d69['emit'](_0x4b7c('0xc'));});_0x32af5f['on'](_0x4b7c('0xd'),function(_0x758491){_0x32af5f[_0x4b7c('0xe')](function(_0x401a28,_0x2342a4){if(_0x401a28){_0x4b1d69[_0x4b7c('0x7')](_0x4b7c('0x8'),new AGIError(_0x4b7c('0xf'),_0x401a28));}else if(_0x3690c9&&_0x3690c9<0x0){_0x4b1d69[_0x4b7c('0x7')]('error',new AGIError(_0x4b7c('0x10')));_0x758491[_0x4b7c('0x11')]();}else if(_0x3690c9&&_0x3690c9>0x0&&_0x3690c9<_0x2342a4){_0x88782b+=0x1;_0x4b1d69[_0x4b7c('0x7')](_0x4b7c('0x8'),new AGIError(_0x4b7c('0x12'),_0x88782b));_0x758491[_0x4b7c('0x11')]();}else{var _0x3a2b70=new AGIChannel(_0x758491);_0x3a2b70['on']('ready',function(){_0x4b1d69[_0x4b7c('0x7')](_0x4b7c('0xd'),_0x3a2b70);});}});});_0x32af5f['on'](_0x4b7c('0x8'),function(_0x46d162){_0x4b1d69[_0x4b7c('0x7')](_0x4b7c('0x8'),new AGIError('E_AGI_SERVER_ERROR',_0x46d162['code']));});_0x32af5f['on']('close',function(){_0x4b1d69[_0x4b7c('0x7')](_0x4b7c('0x13'),new AGIError(_0x4b7c('0x14')));});}process['nextTick'](function(){_0xb0a188();});};util[_0x4b7c('0x15')](AGIServer,EventEmitter);module[_0x4b7c('0x16')]=function(_0x545966,_0x310c01,_0x370488){return new AGIServer(_0x545966,_0x310c01,_0x370488);}; \ No newline at end of file +var _0x6077=['E_AGI_SERVER_ERROR','E_AGI_SERVER_MAXCONNECTION','destroy','ready','code','close','nextTick','inherits','exports','util','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections'];(function(_0x11a287,_0x57df55){var _0x111e64=function(_0x34be85){while(--_0x34be85){_0x11a287['push'](_0x11a287['shift']());}};_0x111e64(++_0x57df55);}(_0x6077,0x11a));var _0x7607=function(_0x504199,_0x2fba2d){_0x504199=_0x504199-0x0;var _0x2b2dd3=_0x6077[_0x504199];return _0x2b2dd3;};'use strict';var util=require(_0x7607('0x0'));var net=require('net');var EventEmitter=require('events')['EventEmitter'];var AGIError=require(_0x7607('0x1'));var AGIChannel=require('./channel');var AGIServer=function(_0x551002,_0x53ab7c,_0x384434){var _0xa39929=this,_0x551002=_0x551002||0x11dd,_0x53ab7c=_0x53ab7c||_0x7607('0x2'),_0x3b8aeb=null,_0x1ad21d=0x0;EventEmitter[_0x7607('0x3')](_0xa39929);function _0x38797f(){if(!_0x551002){_0xa39929[_0x7607('0x4')](_0x7607('0x5'),new AGIError(_0x7607('0x6')));return![];}_0x3b8aeb=net[_0x7607('0x7')]();_0x3b8aeb[_0x7607('0x8')](_0x551002,_0x53ab7c);_0x3b8aeb['on'](_0x7607('0x9'),function(){_0xa39929[_0x7607('0x4')](_0x7607('0x9'));});_0x3b8aeb['on'](_0x7607('0xa'),function(_0x891e75){_0x3b8aeb[_0x7607('0xb')](function(_0x46c870,_0x5b538e){if(_0x46c870){_0xa39929['emit'](_0x7607('0x5'),new AGIError(_0x7607('0xc'),_0x46c870));}else if(_0x384434&&_0x384434<0x0){_0xa39929[_0x7607('0x4')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x891e75['destroy']();}else if(_0x384434&&_0x384434>0x0&&_0x384434<_0x5b538e){_0x1ad21d+=0x1;_0xa39929['emit'](_0x7607('0x5'),new AGIError(_0x7607('0xd'),_0x1ad21d));_0x891e75[_0x7607('0xe')]();}else{var _0x580940=new AGIChannel(_0x891e75);_0x580940['on'](_0x7607('0xf'),function(){_0xa39929[_0x7607('0x4')](_0x7607('0xa'),_0x580940);});}});});_0x3b8aeb['on'](_0x7607('0x5'),function(_0x45c95e){_0xa39929[_0x7607('0x4')](_0x7607('0x5'),new AGIError(_0x7607('0xc'),_0x45c95e[_0x7607('0x10')]));});_0x3b8aeb['on'](_0x7607('0x11'),function(){_0xa39929[_0x7607('0x4')](_0x7607('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x7607('0x12')](function(){_0x38797f();});};util[_0x7607('0x13')](AGIServer,EventEmitter);module[_0x7607('0x14')]=function(_0xaa7f61,_0x6e74fb,_0x151b97){return new AGIServer(_0xaa7f61,_0x6e74fb,_0x151b97);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 8424c47..be2aefa 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 _0xbef7=['Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','SESTEK_ASR_CONFIDENCE','RECOG_INSTANCE()','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','no\x20query\x20configured','replace','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','bot','Trying\x20SestekNDA:\x20%s','sestekNDA','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','unlink','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','no\x20file\x20audio\x20found','PLAYBACK','queue','queue_id','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','recordingFormat','%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','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','getMailAccount','email','Smtp','user','bcc','subject','service','host','port','secure','authentication','auth','pass','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','sms_text','sendSMS\x20message','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','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','./scripts','/var/opt/motion2/server/files','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariableById','name','catch','getVoiceQueue','then','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','arg_1','file','createSquareMessage','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','trim','googleCloudTTS','apiKey','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','timeout','includes','POST','method','toUpperCase','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','sync','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','ispeechTTS','key','ispeech_tts_language','en-US','speed','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','exec','lumenvoxasr'];(function(_0x4bed4f,_0x545a01){var _0x44fbf1=function(_0x1f9677){while(--_0x1f9677){_0x4bed4f['push'](_0x4bed4f['shift']());}};_0x44fbf1(++_0x545a01);}(_0xbef7,0x10d));var _0x7bef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbef7[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x7bef('0x0'));var util=require('util');var _=require(_0x7bef('0x1'));var sh=require('shelljs');var odbc=require(_0x7bef('0x2'))();var rs=require(_0x7bef('0x3'));var moment=require(_0x7bef('0x4'));var Mustache=require(_0x7bef('0x5'));var rp=require(_0x7bef('0x6'));var logger=require(_0x7bef('0x7'))(_0x7bef('0x8'));var config=require('../../config/environment');var scripts=require(_0x7bef('0x9'));var FILES_PATH=_0x7bef('0xa');var recursiveMapAttributes=['rawHeaders',_0x7bef('0xb')];var verticesWithRetry=[_0x7bef('0xc'),'getdigits',_0x7bef('0xd')];var AGIVertices=function(_0x2dc54d,_0xf0efdc,_0x65a09b){this[_0x7bef('0xe')]=_0x2dc54d;this[_0x7bef('0xf')]=_0xf0efdc;this[_0x7bef('0x10')]=_0x65a09b;};AGIVertices[_0x7bef('0x11')]['getVariable']=function(_0x1006c4,_0x3ac4ea){this['rpc'][_0x7bef('0x12')](_0x1006c4)['then'](function(_0x1a8780){_0x3ac4ea(null,_0x1a8780?_0x1a8780[_0x7bef('0x13')]:![]);})[_0x7bef('0x14')](function(_0x1d3f42){_0x3ac4ea(_0x1d3f42);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x15')]=function(_0x2c5172,_0x45c4e2){this[_0x7bef('0xf')]['getVoiceQueueById'](_0x2c5172)[_0x7bef('0x16')](function(_0x80e61f){_0x45c4e2(null,_0x80e61f?_0x80e61f[_0x7bef('0x13')]:![]);})[_0x7bef('0x14')](function(_0xf6cbc){_0x45c4e2(_0xf6cbc);});};AGIVertices['prototype'][_0x7bef('0x17')]=function(_0x360c72,_0x133370){this[_0x7bef('0xf')]['getSquareProjectById'](_0x360c72)['then'](function(_0x595cbc){_0x133370(null,_0x595cbc?_0x595cbc[_0x7bef('0x13')]:![]);})['catch'](function(_0x3ec256){_0x133370(_0x3ec256);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x18')]=function(_0x452bb5,_0x5eaad8){this[_0x7bef('0xf')][_0x7bef('0x19')](_0x452bb5)[_0x7bef('0x16')](function(_0x2f2e65){_0x5eaad8(null,_0x2f2e65?_0x2f2e65[_0x7bef('0x1a')]:![]);})[_0x7bef('0x14')](function(_0x5363c6){_0x5eaad8(_0x5363c6);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1b')]=function(_0x2c2da4,_0xe4e6b0){this['rpc'][_0x7bef('0x1c')](_0x2c2da4)[_0x7bef('0x16')](function(_0x2fc499){_0xe4e6b0(null,_0x2fc499?_0x2fc499['name']:![]);})[_0x7bef('0x14')](function(_0x291abb){_0xe4e6b0(_0x291abb);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1d')]=function(_0x47df2e,_0x210ae3){this['rpc']['getTrunkById'](_0x47df2e)['then'](function(_0x16e531){_0x210ae3(null,_0x16e531?_0x16e531[_0x7bef('0x13')]:![]);})['catch'](function(_0x433f49){_0x210ae3(_0x433f49);});};AGIVertices['prototype'][_0x7bef('0x1e')]=function(_0x33ec3b,_0x59c080){var _0x314ee0=this;this[_0x7bef('0xf')][_0x7bef('0x1f')](_0x33ec3b)[_0x7bef('0x16')](function(_0x3bbca2){_0x59c080(null,_0x3bbca2?_0x314ee0[_0x7bef('0x20')](_0x3bbca2[_0x7bef('0x21')]):![]);})[_0x7bef('0x14')](function(_0x5d1c1d){_0x59c080(_0x5d1c1d);});};AGIVertices[_0x7bef('0x11')]['getMailAccount']=function(_0x32b1d1,_0x3a732c){this[_0x7bef('0xf')][_0x7bef('0x22')](_0x32b1d1)[_0x7bef('0x16')](function(_0x236c74){_0x3a732c(null,_0x236c74?_0x236c74:![]);})[_0x7bef('0x14')](function(_0x2f809c){_0x3a732c(_0x2f809c);});};AGIVertices[_0x7bef('0x11')]['sendMailMessage']=function(_0x1225da,_0x9d8ce7,_0x374808){this[_0x7bef('0x10')][_0x7bef('0x23')](_0x1225da,_0x9d8ce7)[_0x7bef('0x16')](function(){_0x374808(null);})[_0x7bef('0x14')](function(_0x37cfc8){_0x374808(_0x37cfc8);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x24')]=function(_0x449af8,_0xbd4907){this[_0x7bef('0xf')][_0x7bef('0x25')](_0x449af8)[_0x7bef('0x16')](function(_0x5dfa51){if(_0x5dfa51){if(_0x5dfa51[_0x7bef('0x26')]){_0xbd4907(null,[_0x5dfa51[_0x7bef('0x27')]]);}else{_0xbd4907(null,_[_0x7bef('0x28')](_0x5dfa51[_0x7bef('0x29')],_0x7bef('0x27')));}}else{_0xbd4907(null,![]);}})[_0x7bef('0x14')](function(_0x1182dd){_0xbd4907(_0x1182dd);});};AGIVertices['prototype'][_0x7bef('0x20')]=function(_0x49cd06){return util['format'](_0x7bef('0x2a'),FILES_PATH,_0x49cd06);};AGIVertices[_0x7bef('0x11')][_0x7bef('0x2b')]=function(_0x149e9f,_0x2a5fae,_0x2c80fa){odbc['open'](_0x149e9f,function(_0xd79b84){if(_0xd79b84){logger[_0x7bef('0x2c')](_0x7bef('0x2d'),_0xd79b84);_0x2c80fa(_0xd79b84);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x2a5fae,function(_0x2a0097,_0x4939ab){if(_0x2a0097){logger[_0x7bef('0x2e')](_0x7bef('0x2f'),_0x2a5fae);_0x2c80fa(_0x2a0097);}else{logger[_0x7bef('0x2e')](_0x7bef('0x30'),_0x2a5fae);odbc[_0x7bef('0x31')](function(_0x4da312){if(_0x4da312){logger[_0x7bef('0x2c')](_0x7bef('0x32'),_0x4da312);}_0x2c80fa(null,_0x4939ab);});}});}});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x33')]=function(_0x307709,_0xdbf677){this['rpc'][_0x7bef('0x34')](_0x307709)['then'](function(_0xc98b00){_0xdbf677(null,_0xc98b00?_0xc98b00:![]);})['catch'](function(_0x505a76){_0xdbf677(_0x505a76);});};AGIVertices[_0x7bef('0x11')]['createSmsMessage']=function(_0x25dc06,_0xb875eb){this[_0x7bef('0xf')][_0x7bef('0x35')](_0x25dc06)[_0x7bef('0x16')](function(_0x4a3fc5){_0xb875eb(null,_0x4a3fc5);})['catch'](function(_0x24f83e){_0xb875eb(_0x24f83e);});};AGIVertices[_0x7bef('0x11')]['createSquareDetailsReport']=function(_0x17895c,_0x302730,_0x12558b){this[_0x7bef('0xf')][_0x7bef('0x36')]({'uniqueid':this[_0x7bef('0xe')][_0x7bef('0x37')],'node':_0x17895c[_0x7bef('0x38')],'application':_0x17895c[_0x7bef('0x39')],'data':_0x302730||null,'project_name':this['channel']['arg_1'],'callerid':this[_0x7bef('0xe')][_0x7bef('0x3a')]})['then'](function(_0x20ee47){if(_0x12558b){_0x12558b(null,_0x20ee47);}})['catch'](function(_0x2af968){if(_0x12558b){_0x12558b(_0x2af968);}});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x3b')]=function(_0x23d541,_0x4313a1,_0xffe646,_0x32e422){this[_0x7bef('0xf')][_0x7bef('0x3b')]({'uniqueid':this['channel'][_0x7bef('0x37')],'callerid':this[_0x7bef('0xe')][_0x7bef('0x3a')],'calleridname':this[_0x7bef('0xe')][_0x7bef('0x3c')],'context':this[_0x7bef('0xe')][_0x7bef('0x3d')],'extension':this[_0x7bef('0xe')][_0x7bef('0x3e')],'priority':this[_0x7bef('0xe')][_0x7bef('0x3f')],'accountcode':this[_0x7bef('0xe')][_0x7bef('0x40')],'dnid':this[_0x7bef('0xe')]['dnid'],'projectName':this['channel'][_0x7bef('0x41')],'saveName':_0x4313a1,'filename':_0x23d541[_0x7bef('0x42')]||_0x4313a1,'savePath':_0xffe646})[_0x7bef('0x16')](function(_0x4d86bf){_0x32e422(null,_0x4d86bf);})[_0x7bef('0x14')](function(_0x5e307e){_0x32e422(_0x5e307e);});};AGIVertices[_0x7bef('0x11')]['createSquareMessage']=function(_0x4c417c,_0x4e8339,_0x5b6c6a,_0x2ba492,_0x292e2b){this[_0x7bef('0xf')][_0x7bef('0x43')]({'uniqueid':this[_0x7bef('0xe')][_0x7bef('0x37')],'body':_0x4c417c,'direction':_0x4e8339,'providerName':_0x5b6c6a,'providerResponse':_0x2ba492})[_0x7bef('0x16')](function(_0x58f0b3){if(_0x292e2b){_0x292e2b(null,_0x58f0b3);}})[_0x7bef('0x14')](function(_0x3f5ba8){if(_0x292e2b){_0x292e2b(_0x3f5ba8);}});};AGIVertices[_0x7bef('0x11')]['createCmContact']=function(_0x2c2014,_0x254aca){this[_0x7bef('0xf')]['createCmContact']({'firstName':_[_0x7bef('0x44')](_0x2c2014[_0x7bef('0x13')])||_[_0x7bef('0x45')](_0x2c2014[_0x7bef('0x13')])?'callback_'+Math[_0x7bef('0x46')]():_0x2c2014['name'],'lastName':_[_0x7bef('0x44')](_0x2c2014['lastName'])||_[_0x7bef('0x45')](_0x2c2014[_0x7bef('0x47')])?null:_0x2c2014['lastName'],'phone':_0x2c2014[_0x7bef('0x48')],'ListId':_0x2c2014[_0x7bef('0x49')],'scheduledat':_0x2c2014[_0x7bef('0x4a')],'callbackUniqueid':this[_0x7bef('0xe')][_0x7bef('0x37')],'tags':_0x7bef('0x4b'),'description':'Callback\x20scheduled\x20at\x20'+_0x2c2014[_0x7bef('0x4a')][_0x7bef('0x4c')](),'priority':_0x2c2014[_0x7bef('0x4d')]})[_0x7bef('0x16')](function(_0x25025f){_0x254aca(null,_0x25025f);})[_0x7bef('0x14')](function(_0x406486){_0x254aca(_0x406486);});};AGIVertices['prototype']['getPause']=function(_0x498e1f,_0x49408e){this[_0x7bef('0xf')]['getPauseById'](_0x498e1f)['then'](function(_0x4afa42){_0x49408e(null,_0x4afa42?_0x4afa42[_0x7bef('0x13')]:![]);})['catch'](function(_0x52f88e){_0x49408e(_0x52f88e);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x4e')]=function(_0x2439b1,_0x20a2c6,_0x2bb7ea){var _0x318cd9={'role':_0x7bef('0x4f')};_0x318cd9[_0x2439b1]=this['channel']['callerid'];this['rpc'][_0x7bef('0x4e')](_0x318cd9,_0x20a2c6,this[_0x7bef('0xe')][_0x7bef('0x37')])[_0x7bef('0x16')](function(_0x2c2f46){_0x2bb7ea(null,_[_0x7bef('0x45')](_0x2c2f46)?![]:!![]);})['catch'](function(_0x5aff00){logger['error'](_0x5aff00);_0x2bb7ea(null,![]);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x50')]=function(_0x50bbac,_0x4d743f){var _0x2534c6={'role':_0x7bef('0x4f')};_0x2534c6[_0x50bbac]=this[_0x7bef('0xe')][_0x7bef('0x3a')];this[_0x7bef('0xf')][_0x7bef('0x50')](_0x2534c6)[_0x7bef('0x16')](function(_0x16d5de){_0x4d743f(null,_['isNil'](_0x16d5de)?![]:!![]);})[_0x7bef('0x14')](function(_0x3f3756){logger[_0x7bef('0x2c')](_0x3f3756);_0x4d743f(null,![]);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x51')]=function(_0x337125,_0x2517c3){var _0x11c345={'role':_0x7bef('0x4f')};_0x11c345[_0x337125]=this[_0x7bef('0xe')]['callerid'];this[_0x7bef('0xf')][_0x7bef('0x51')](_0x11c345)[_0x7bef('0x16')](function(_0x26dbcf){_0x2517c3(null,_[_0x7bef('0x45')](_0x26dbcf)?![]:!![]);})['catch'](function(_0x5323bf){logger[_0x7bef('0x2c')](_0x5323bf);_0x2517c3(null,![]);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x52')]=function(_0x4f7c1f,_0x540d6e){var _0x8a7d2={'role':'agent'};_0x8a7d2[_0x4f7c1f]=this[_0x7bef('0xe')][_0x7bef('0x3a')];var _0x4a080c=_0x4f7c1f!=_0x7bef('0x53')?util[_0x7bef('0x54')](_0x7bef('0x55'),'LOCAL',this[_0x7bef('0xe')][_0x7bef('0x3a')]):undefined;this['rpc'][_0x7bef('0x52')](_0x8a7d2,_0x4a080c)[_0x7bef('0x16')](function(_0x1ddd7a){_0x540d6e(null,_[_0x7bef('0x45')](_0x1ddd7a)?![]:!![]);})[_0x7bef('0x14')](function(_0x5d5f01){logger[_0x7bef('0x2c')](_0x5d5f01);_0x540d6e(null,![]);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x56')]=function(_0x136856,_0xdee9eb){sh['exec'](_[_0x7bef('0x57')](_0x136856),function(_0x227a20,_0x272c11){var _0x1f14d5=_0x272c11['replace'](/(\r\n|\n|\r)/gm,'');_0xdee9eb(null,_0x1f14d5);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x58')]=function(_0x3bb24,_0x3383de){scripts[_0x7bef('0x58')](_0x3bb24[_0x7bef('0x59')],_0x3bb24['google_cloud_tts_text_type']||_0x7bef('0x5a'),_0x3bb24[_0x7bef('0x5a')],_0x3bb24['languageCode']||'en-US',_0x3bb24[_0x7bef('0x5b')]||_0x7bef('0x5c'),_0x3bb24[_0x7bef('0x5d')]||_0x7bef('0x5e'))[_0x7bef('0x16')](function(_0x7dca14){_0x3383de(null,_0x7dca14);})[_0x7bef('0x14')](function(_0x412021){_0x3383de(_0x412021);});};AGIVertices['prototype'][_0x7bef('0x5f')]=function(_0xed5311,_0x24ffa5){scripts[_0x7bef('0x5f')](_0xed5311[_0x7bef('0x5a')],_0xed5311[_0x7bef('0x60')]||'en',0x1)[_0x7bef('0x16')](function(_0xd9e14b){_0x24ffa5(null,_0xd9e14b);})[_0x7bef('0x14')](function(_0x982308){_0x24ffa5(_0x982308);});};AGIVertices['prototype'][_0x7bef('0x61')]=function(_0x427f41,_0x516730){var _0x122a06={'uri':_0x427f41['url'],'method':_0x427f41['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x427f41[_0x7bef('0x62')])==='number'&&parseInt(_0x427f41['timeout'])>=0x1?parseInt(_0x427f41['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x7bef('0x63')]([_0x7bef('0x64'),'PUT'],_0x122a06[_0x7bef('0x65')][_0x7bef('0x66')]())){try{_0x122a06[_0x7bef('0x67')]=_0x427f41['rawBody']?JSON[_0x7bef('0x68')](_0x427f41[_0x7bef('0xb')]):{};}catch(_0x403d2d){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x403d2d);}}try{_0x122a06[_0x7bef('0x69')]=_0x427f41[_0x7bef('0x6a')]?JSON[_0x7bef('0x68')](_0x427f41[_0x7bef('0x6a')]):{};}catch(_0x1046d0){logger[_0x7bef('0x2c')](_0x7bef('0x6b'),_0x1046d0);}if(_0x427f41['computedVariables']){try{var _0x5c45b2=require(_0x427f41['computedVariables'])[_0x7bef('0x6c')](this,_0x122a06);_0x122a06['uri']=Mustache[_0x7bef('0x6d')](_0x427f41[_0x7bef('0x6e')],_0x5c45b2,{},['$$','$$']);if(_0x122a06[_0x7bef('0x69')]){_0x122a06['headers']=JSON['parse'](Mustache[_0x7bef('0x6d')](JSON[_0x7bef('0x6f')](_0x122a06[_0x7bef('0x69')]),_0x5c45b2,{},['$$','$$']));}if(_0x122a06['body']){_0x122a06[_0x7bef('0x67')]=JSON[_0x7bef('0x68')](Mustache['render'](JSON[_0x7bef('0x6f')](_0x122a06[_0x7bef('0x67')]),_0x5c45b2,{},['$$','$$']));}}catch(_0x12174a){logger['error'](_0x7bef('0x70'),_0x12174a);}}rp(_0x122a06)[_0x7bef('0x16')](function(_0x100686){var _0xcdcb2e={'statusCode':_0x100686[_0x7bef('0x71')]||0xc8,'statusMessage':_0x100686[_0x7bef('0x72')]||'OK','headers':_0x100686['headers']||{},'body':_0x100686['body']||{}};_0x516730(null,_0xcdcb2e);})[_0x7bef('0x14')](function(_0x4ac6a8){var _0x3735d2={'statusCode':_0x4ac6a8[_0x7bef('0x71')]||0x1f4,'statusMessage':_0x4ac6a8[_0x7bef('0x73')]||_0x7bef('0x74'),'headers':_0x4ac6a8['options'][_0x7bef('0x69')]||{},'body':_0x4ac6a8[_0x7bef('0x75')][_0x7bef('0x67')]||{}};_0x516730(null,_0x3735d2);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x76')]=function(_0x5df38d,_0x7ba11f){scripts[_0x7bef('0x76')](this[_0x7bef('0xe')][_0x7bef('0x37')],_0x5df38d['key'],_0x5df38d[_0x7bef('0x5a')],_0x5df38d[_0x7bef('0x77')]||'en')[_0x7bef('0x16')](function(_0x333af6){_0x7ba11f(null,_0x333af6);})[_0x7bef('0x14')](function(_0x181e06){_0x7ba11f(_0x181e06);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x78')]=function(_0x580c6b,_0x28a198){scripts[_0x7bef('0x78')](this[_0x7bef('0xe')][_0x7bef('0x37')],_0x580c6b[_0x7bef('0x79')],_0x580c6b[_0x7bef('0x7a')],_0x580c6b[_0x7bef('0x7b')],_0x580c6b[_0x7bef('0x5a')],_0x580c6b[_0x7bef('0x7c')]||'en')['then'](function(_0x4fc4c9){_0x28a198(null,_0x4fc4c9);})[_0x7bef('0x14')](function(_0x3b80e6){_0x28a198(_0x3b80e6);});};AGIVertices[_0x7bef('0x11')]['sestekNDA']=function(_0x8aac3d,_0x17edf6){scripts['sestekNDA'](this[_0x7bef('0xe')],_0x8aac3d)[_0x7bef('0x16')](function(_0x2eecab){_0x17edf6(null,_0x2eecab);})['catch'](function(_0x29d1a3){_0x17edf6(_0x29d1a3);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x7d')]=function(_0x499290,_0x5e2807){scripts[_0x7bef('0x7d')](_0x499290[_0x7bef('0x7e')],_0x499290[_0x7bef('0x5a')],_0x499290[_0x7bef('0x7f')]||_0x7bef('0x80'),_0x499290[_0x7bef('0x81')])['then'](function(_0x43c271){_0x5e2807(null,_0x43c271);})[_0x7bef('0x14')](function(_0x2fef73){_0x5e2807(_0x2fef73);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x82')]=function(_0x465e8,_0x5a5ac9,_0x53b259){scripts[_0x7bef('0x82')](_0x5a5ac9,_0x465e8[_0x7bef('0x7e')],_0x465e8[_0x7bef('0x83')]||_0x7bef('0x80'),this[_0x7bef('0x84')](_0x465e8['model'])?_0x465e8['model']:undefined)[_0x7bef('0x16')](function(_0x5d6648){_0x53b259(null,_0x5d6648);})[_0x7bef('0x14')](function(_0x5e7267){_0x53b259(_0x5e7267);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x85')]=function(_0xfc968e,_0xd8cad7){scripts[_0x7bef('0x85')](_0xfc968e['aws_access_key_id'],_0xfc968e[_0x7bef('0x86')],_0xfc968e[_0x7bef('0x87')],_0xfc968e['aws_polly_voice']||_0x7bef('0x88'),_0xfc968e[_0x7bef('0x5a')],_0xfc968e['aws_text_type']||_0x7bef('0x5a'))[_0x7bef('0x16')](function(_0x1206b1){_0xd8cad7(null,_0x1206b1);})[_0x7bef('0x14')](function(_0x23a1e3){_0xd8cad7(_0x23a1e3);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x89')]=function(_0x14087d,_0x19088f){scripts['awsLex'](this[_0x7bef('0xe')][_0x7bef('0x37')],_0x14087d[_0x7bef('0x8a')],_0x14087d[_0x7bef('0x86')],_0x14087d[_0x7bef('0x8b')],_0x14087d[_0x7bef('0x5a')],_0x14087d[_0x7bef('0x8c')])[_0x7bef('0x16')](function(_0x4fe1cc){_0x19088f(null,_0x4fe1cc);})[_0x7bef('0x14')](function(_0x340a4d){_0x19088f(_0x340a4d);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x8d')]=function(_0x456e72,_0x245394,_0x45d968){scripts[_0x7bef('0x8d')](_0x245394,_0x456e72[_0x7bef('0x7e')],_0x456e72[_0x7bef('0x8e')]||_0x7bef('0x80'))[_0x7bef('0x16')](function(_0x4174ca){_0x45d968(null,_0x4174ca);})[_0x7bef('0x14')](function(_0x9296bd){_0x45d968(_0x9296bd);});};AGIVertices[_0x7bef('0x11')][_0x7bef('0x8f')]=function(_0x419368,_0x3ef673,_0x16a07a){scripts[_0x7bef('0x8f')](_0x3ef673,_0x419368[_0x7bef('0x90')],_0x419368[_0x7bef('0x91')],_0x419368[_0x7bef('0x92')])[_0x7bef('0x16')](function(_0x1c6f3e){_0x16a07a(null,_0x1c6f3e);})[_0x7bef('0x14')](function(_0x7abb4f){_0x16a07a(_0x7abb4f);});};AGIVertices[_0x7bef('0x11')]['clear']=function(_0x52e213){var _0x590f70=_['includes'](verticesWithRetry,_0x52e213[_0x7bef('0x39')])?_0x52e213:_[_0x7bef('0x93')](_0x52e213);for(var _0x5c460f in _0x590f70){if(_0x590f70[_0x7bef('0x94')](_0x5c460f)){if(_0x590f70[_0x5c460f]&&_[_0x7bef('0x95')](_0x590f70[_0x5c460f])){if(_['includes'](recursiveMapAttributes,_0x5c460f)){_0x590f70[_0x5c460f]=this['replaceObjectAllVariables'](_0x590f70[_0x5c460f]);}else{_0x590f70[_0x5c460f]=this[_0x7bef('0x96')](_0x590f70[_0x5c460f]);}}}}return _0x590f70;};AGIVertices['prototype'][_0x7bef('0x97')]=function(_0x325616){for(var _0x5f0c93 in _0x325616){if(_0x325616['hasOwnProperty'](_0x5f0c93)){if(_[_0x7bef('0x98')](_0x325616[_0x5f0c93])){this[_0x7bef('0x97')](_0x325616[_0x5f0c93]);}else if(_[_0x7bef('0x99')](_0x325616[_0x5f0c93])){for(var _0x50f6a1=0x0;_0x50f6a1<_0x325616[_0x5f0c93][_0x7bef('0x9a')];_0x50f6a1++){this[_0x7bef('0x97')](_0x325616[_0x5f0c93][_0x50f6a1]);}}else if(_[_0x7bef('0x95')](_0x325616[_0x5f0c93])){_0x325616[_0x5f0c93]=this['replaceAllVariables'](_0x325616[_0x5f0c93]);}}}};AGIVertices[_0x7bef('0x11')][_0x7bef('0x9b')]=function(_0x243ac1,_0x558623){for(var _0x5deb81 in _0x243ac1){if(_0x243ac1['hasOwnProperty'](_0x5deb81)){if(_['isPlainObject'](_0x243ac1[_0x5deb81])){if(!_['isEmpty'](_0x243ac1[_0x5deb81])){this[_0x7bef('0x9b')](_0x243ac1[_0x5deb81],util[_0x7bef('0x54')](_0x7bef('0x9c'),_0x558623,_0x5deb81));}}else if(_[_0x7bef('0x99')](_0x243ac1[_0x5deb81])){for(var _0x1fefb7=0x0;_0x1fefb7<_0x243ac1[_0x5deb81][_0x7bef('0x9a')];_0x1fefb7++){this[_0x7bef('0x9b')](_0x243ac1[_0x5deb81][_0x1fefb7],util['format'](_0x7bef('0x9c'),_0x558623,_0x5deb81+'['+_0x1fefb7+']'));}}else{if(!_[_0x7bef('0x45')](_0x243ac1[_0x5deb81])){this[_0x7bef('0xe')][_0x7bef('0x9d')](util[_0x7bef('0x54')]('%s.%s',_0x558623,_0x5deb81),_0x243ac1[_0x5deb81]);}}}}};AGIVertices['prototype'][_0x7bef('0x9e')]=function(_0x1228d0){try{var _0x294bc9=JSON[_0x7bef('0x68')](_0x1228d0);this['recursiveNodeIndex'](_0x294bc9);return JSON[_0x7bef('0x6f')](_0x294bc9);}catch(_0x21961c){return this[_0x7bef('0x96')](_0x1228d0);}};AGIVertices[_0x7bef('0x11')][_0x7bef('0x96')]=function(_0x5053a3){var _0x383868=_0x5053a3[_0x7bef('0x9f')]('{');for(var _0x504e44=0x1;_0x504e44<_0x383868[_0x7bef('0x9a')];_0x504e44+=0x1){var _0x46f983=_0x383868[_0x504e44][_0x7bef('0x9f')]('}');if(_0x46f983[_0x7bef('0x9a')]>0x1){_0x5053a3=_0x5053a3[_0x7bef('0xa0')]('{'+_0x46f983[0x0]+'}',this[_0x7bef('0xe')][_0x7bef('0xa1')](_0x46f983[0x0])[_0x7bef('0xa2')]||_0x46f983[0x0]);}}if(_0x383868['length']===0x1){return _0x5053a3[_0x7bef('0x4c')]();}return this['replaceAllVariables'](_0x5053a3);};AGIVertices[_0x7bef('0x11')][_0x7bef('0xa3')]=function(_0x5aab59,_0x2c4abc){var _0xf6274e=this[_0x7bef('0xe')]['getVariable'](_0x5aab59);if(_0xf6274e[_0x7bef('0xa4')]===-0x1){return _0xf6274e;}logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0xa5'),_0x2c4abc,_0xf6274e[_0x7bef('0xa2')]));return this[_0x7bef('0xe')][_0x7bef('0x9d')](_0x2c4abc,_0xf6274e[_0x7bef('0xa2')]);};AGIVertices['prototype'][_0x7bef('0x84')]=function(_0x48c36f){return _0x48c36f&&_0x48c36f!=='0'&&_0x48c36f!=='-1'&&_0x48c36f!=='';};AGIVertices[_0x7bef('0x11')]['maxRetry']=function(_0x4254c8){this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x4254c8,'-');_0x4254c8[_0x7bef('0xa6')]=_0x4254c8[_0x7bef('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x7bef('0x11')][_0x7bef('0xa8')]=function(_0x237672){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0xa9'),_0x237672[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x237672[_0x7bef('0x5a')])){return this[_0x7bef('0xe')]['noop'](_0x7bef('0xaa'));}var _0x27167c='\x22'+_0x237672[_0x7bef('0x5a')]+'\x22';if(this[_0x7bef('0x84')](_0x237672[_0x7bef('0x75')])){_0x27167c+=','+_0x237672[_0x7bef('0x75')];}var _0x1b5372=this[_0x7bef('0xe')]['exec'](_0x7bef('0xab'),_0x27167c);if(_0x1b5372['result']===-0x1){return _0x1b5372;}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xad'),_0x27167c));};AGIVertices[_0x7bef('0x11')][_0x7bef('0xae')]=function(_0x12c63b){logger['info'](util[_0x7bef('0x54')](_0x7bef('0xaf'),_0x12c63b[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x12c63b[_0x7bef('0xb0')])){return this[_0x7bef('0xe')]['noop']('no\x20grammar\x20configured');}var _0x1d5225=_0x12c63b[_0x7bef('0xb0')];if(this['isConfigured'](_0x12c63b[_0x7bef('0x75')])){_0x1d5225+=','+_0x12c63b['options'];}var _0x291610=this[_0x7bef('0xe')]['exec']('MRCPRecog',_0x1d5225);if(_0x291610[_0x7bef('0xa4')]===-0x1){return _0x291610;}var _0xf0636=this[_0x7bef('0xa3')](_0x7bef('0xb1'),_0x7bef('0xb2'));if(_0xf0636['result']===-0x1){return _0xf0636;}var _0x56d0d4=this['getAndSetVariable'](_0x7bef('0xb3'),'MRCP_RECOG_TRANSCRIPT');if(_0x56d0d4[_0x7bef('0xa4')]===-0x1){return _0x56d0d4;}var _0x31953e=this['getAndSetVariable']('RECOG_INSTANCE()',_0x7bef('0xb4'));if(_0x31953e[_0x7bef('0xa4')]===-0x1){return _0x31953e;}return this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0x1d5225));};AGIVertices['prototype'][_0x7bef('0x8')]=function(_0x4d727f){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0xb5'),_0x4d727f[_0x7bef('0x38')]));return this['channel'][_0x7bef('0x8')]([_0x4d727f[_0x7bef('0xb6')],_0x4d727f[_0x7bef('0xb7')]]);};AGIVertices[_0x7bef('0x11')][_0x7bef('0xb8')]=function(_0x3e84b1){logger[_0x7bef('0x2e')](util['format']('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x3e84b1[_0x7bef('0x38')]));if(this['isConfigured'](_0x3e84b1[_0x7bef('0x62')])){logger['info'](util[_0x7bef('0x54')](_0x7bef('0xb9'),_0x3e84b1[_0x7bef('0x62')]));var _0x4ff1db=this[_0x7bef('0xe')][_0x7bef('0xba')](_0x3e84b1[_0x7bef('0x62')]);if(_0x4ff1db[_0x7bef('0xa4')]===-0x1){return _0x4ff1db;}}return this[_0x7bef('0xe')][_0x7bef('0xb8')]();};AGIVertices[_0x7bef('0x11')][_0x7bef('0x4b')]=function(_0x4c2409){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0xbb'),_0x4c2409[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x4c2409[_0x7bef('0x49')])){return this['channel'][_0x7bef('0x2c')](_0x4c2409,_0x7bef('0xbc'));}_0x4c2409['scheduledAt']=moment();if(this[_0x7bef('0x84')](_0x4c2409[_0x7bef('0xbd')])){_0x4c2409[_0x7bef('0x4a')]=moment()[_0x7bef('0xbe')](_0x4c2409[_0x7bef('0xbd')],_0x7bef('0xbf'));}if(!this[_0x7bef('0x84')](_0x4c2409['callback_priority'])){_0x4c2409[_0x7bef('0x4d')]=0x2;}this['createCmContact'][_0x7bef('0x6c')](this,_0x4c2409);return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xc0'),_0x4c2409[_0x7bef('0x48')],_0x4c2409['list_id'],_0x4c2409[_0x7bef('0x4a')]));};AGIVertices[_0x7bef('0x11')][_0x7bef('0xc1')]=function(_0x4f99a3){logger['info'](util[_0x7bef('0x54')](_0x7bef('0xc2'),_0x4f99a3[_0x7bef('0x38')]));var _0x184318=this[_0x7bef('0xe')]['exec'](_0x4f99a3[_0x7bef('0xc3')],_0x4f99a3[_0x7bef('0x75')]);if(_0x184318[_0x7bef('0xa4')]===-0x1){return _0x184318;}return this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xc4'),_0x4f99a3[_0x7bef('0xc3')],_0x4f99a3[_0x7bef('0x75')]));};AGIVertices[_0x7bef('0x11')]['lumenvoxtts']=function(_0x44dd86){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x44dd86[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x44dd86[_0x7bef('0x5a')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xaa'));}var _0x3f91f9='\x22'+_0x44dd86['text']+'\x22';if(this['isConfigured'](_0x44dd86[_0x7bef('0x75')])){_0x3f91f9+=','+_0x44dd86['options'];}var _0x3517af=this[_0x7bef('0xe')]['exec'](_0x7bef('0xab'),_0x3f91f9);if(_0x3517af[_0x7bef('0xa4')]===-0x1){return _0x3517af;}return this[_0x7bef('0xe')]['noop'](util['format'](_0x7bef('0xad'),_0x3f91f9));};AGIVertices['prototype']['sestektts']=function(_0x294b49){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0xc5'),_0x294b49['label']));if(!this['isConfigured'](_0x294b49[_0x7bef('0x5a')])){return this[_0x7bef('0xe')]['noop']('no\x20text\x20configured');}var _0x368e3a='\x22'+_0x294b49[_0x7bef('0x5a')]+'\x22';if(this[_0x7bef('0x84')](_0x294b49[_0x7bef('0x75')])){_0x368e3a+=','+_0x294b49[_0x7bef('0x75')];}var _0x5770a2=this[_0x7bef('0xe')][_0x7bef('0xc6')](_0x7bef('0xab'),_0x368e3a);if(_0x5770a2['result']===-0x1){return _0x5770a2;}return this[_0x7bef('0xe')]['noop'](util['format'](_0x7bef('0xad'),_0x368e3a));};AGIVertices['prototype'][_0x7bef('0xc7')]=function(_0x7c065c){logger['info'](util[_0x7bef('0x54')](_0x7bef('0xc8'),_0x7c065c[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x7c065c[_0x7bef('0xb0')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xc9'));}var _0x6fe1ff=_0x7c065c['grammar'];if(this[_0x7bef('0x84')](_0x7c065c[_0x7bef('0x75')])){_0x6fe1ff+=','+_0x7c065c[_0x7bef('0x75')];}var _0x46bc80=this[_0x7bef('0xe')][_0x7bef('0xc6')]('MRCPRecog',_0x6fe1ff);if(_0x46bc80['result']===-0x1){return _0x46bc80;}var _0x5eaa5f=this[_0x7bef('0xa3')](_0x7bef('0xb1'),'LUMENVOX_ASR_CONFIDENCE');if(_0x5eaa5f[_0x7bef('0xa4')]===-0x1){return _0x5eaa5f;}var _0x147ad1=this['getAndSetVariable'](_0x7bef('0xb3'),_0x7bef('0xca'));if(_0x147ad1[_0x7bef('0xa4')]===-0x1){return _0x147ad1;}var _0x220360=this[_0x7bef('0xa3')]('RECOG_INSTANCE()',_0x7bef('0xcb'));if(_0x220360['result']===-0x1){return _0x220360;}return this[_0x7bef('0xe')]['noop'](util['format'](_0x7bef('0xcc'),_0x6fe1ff));};AGIVertices[_0x7bef('0x11')][_0x7bef('0xcd')]=function(_0xdea814){logger['info'](util[_0x7bef('0x54')](_0x7bef('0xce'),_0xdea814[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0xdea814['grammar'])){return this['channel'][_0x7bef('0xac')](_0x7bef('0xc9'));}var _0x23c9ee=_0xdea814[_0x7bef('0xb0')];if(this['isConfigured'](_0xdea814[_0x7bef('0x75')])){_0x23c9ee+=','+_0xdea814[_0x7bef('0x75')];}var _0x55c300=this[_0x7bef('0xe')][_0x7bef('0xc6')](_0x7bef('0xcf'),_0x23c9ee);if(_0x55c300[_0x7bef('0xa4')]===-0x1){return _0x55c300;}var _0x2cb06e=this[_0x7bef('0xa3')](_0x7bef('0xb1'),_0x7bef('0xd0'));if(_0x2cb06e['result']===-0x1){return _0x2cb06e;}var _0x29795b=this[_0x7bef('0xa3')]('RECOG_INPUT()','SESTEK_ASR_TRANSCRIPT');if(_0x29795b['result']===-0x1){return _0x29795b;}var _0x524a7f=this[_0x7bef('0xa3')](_0x7bef('0xd1'),'SESTEK_ASR_INSTANCE');if(_0x524a7f[_0x7bef('0xa4')]===-0x1){return _0x524a7f;}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xcc'),_0x23c9ee));};AGIVertices[_0x7bef('0x11')][_0x7bef('0xd2')]=function(_0x4f7657){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0xd3'),_0x4f7657['label']));if(!this[_0x7bef('0x84')](_0x4f7657[_0x7bef('0xd4')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x4f7657,_0x7bef('0xd5'));}var _0x4b2a18=this['getSquareOdbc'][_0x7bef('0x6c')](this,_0x4f7657[_0x7bef('0xd4')]);if(!_0x4b2a18){return this['channel'][_0x7bef('0x2c')](_0x4f7657,_0x7bef('0xd6'));}if(!this[_0x7bef('0x84')](_0x4f7657[_0x7bef('0xd7')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x4f7657,_0x7bef('0xd8'));}var _0x6a990f=_0x4f7657['query'][_0x7bef('0xd9')](/(\r\n|\n|\r)/gm,'\x20');this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')]('query:\x20%s',_0x6a990f));var _0x1340ff=this[_0x7bef('0x2b')]['sync'](this,_0x4b2a18,_0x6a990f);this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x4f7657,_0x6a990f);if(!this['isConfigured'](_0x4f7657['variable_id'])){return this[_0x7bef('0xe')]['noop'](_0x7bef('0xda'));}var _0xb956e6=this[_0x7bef('0xa1')][_0x7bef('0x6c')](this,_0x4f7657[_0x7bef('0xdb')]);if(!_0xb956e6){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x4f7657,_0x7bef('0xdc'));}var _0x2d0bdb=this;_0x1340ff['forEach'](function(_0x2c1ce1,_0x71154f){Object[_0x7bef('0xdd')](_0x2c1ce1)['forEach'](function(_0x4a4cf4){_0x2d0bdb['channel'][_0x7bef('0x9d')](util[_0x7bef('0x54')](_0x7bef('0xde'),_0xb956e6,_0x71154f,_0x4a4cf4),_0x2c1ce1[_0x4a4cf4]);});});this[_0x7bef('0xe')][_0x7bef('0x9d')](util['format'](_0x7bef('0xdf'),_0xb956e6),_0x1340ff[_0x7bef('0x9a')]);return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xe0'),_0xb956e6));};AGIVertices['prototype'][_0x7bef('0xe1')]=function(_0x954c6e){logger[_0x7bef('0xe2')](util[_0x7bef('0x54')](_0x7bef('0xe3'),_0x954c6e[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x954c6e['sip_id'])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x954c6e,_0x7bef('0xe4'));}var _0x469ac4=this['getUser'][_0x7bef('0x6c')](this,_0x954c6e[_0x7bef('0xe5')]);if(!_0x469ac4){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x954c6e,_0x7bef('0xe6'));}var _0x51939a=this[_0x7bef('0xe')][_0x7bef('0xc6')](_0x7bef('0xe7'),[util[_0x7bef('0x54')]('SIP/%s',_0x469ac4),_0x954c6e[_0x7bef('0x62')],_0x954c6e[_0x7bef('0xe8')],_0x954c6e[_0x7bef('0x6e')]]);if(_0x51939a[_0x7bef('0xa4')]===-0x1){return _0x51939a;}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xe9'),_0x7bef('0xe7')));};AGIVertices[_0x7bef('0x11')][_0x7bef('0xea')]=function(_0xbb7929){logger['info'](util[_0x7bef('0x54')](_0x7bef('0xeb'),_0xbb7929[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0xbb7929[_0x7bef('0x7e')])){return this[_0x7bef('0xe')]['noop'](_0x7bef('0xec'));}if(!this[_0x7bef('0x84')](_0xbb7929['text'])){return this[_0x7bef('0xe')][_0x7bef('0xac')]('no\x20text\x20configured');}this[_0x7bef('0xe')]['bot']=!![];this[_0x7bef('0x36')](_0xbb7929);this['createSquareMessage'](_0xbb7929[_0x7bef('0x5a')],'in','','');this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xed'),_0xbb7929[_0x7bef('0x5a')]));var _0x5df5d1=this['googleDialogflow'][_0x7bef('0x6c')](this,_0xbb7929);if(_0x5df5d1){for(var _0x4c3125 in _0x5df5d1){if(_0x5df5d1[_0x7bef('0x94')](_0x4c3125)){this['channel'][_0x7bef('0x9d')](util[_0x7bef('0x54')](_0x7bef('0xee'),_0x4c3125[_0x7bef('0x66')]()),_0x5df5d1[_0x4c3125]);}}this[_0x7bef('0x43')](_0x5df5d1[_0x7bef('0xef')],_0x7bef('0xf0'),_0x7bef('0xea'),'');return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xf1'),_0x5df5d1[_0x7bef('0xef')]));}return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0xbb7929,_0x7bef('0xf2'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0xf3')]=function(_0x3011e4){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0xf4'),_0x3011e4[_0x7bef('0x38')]));if(!this['isConfigured'](_0x3011e4['dialogflowV2_project_id'])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xf5'));}if(!this[_0x7bef('0x84')](_0x3011e4[_0x7bef('0x7a')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xf6'));}if(!this['isConfigured'](_0x3011e4[_0x7bef('0x7b')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xf7'));}if(!this['isConfigured'](_0x3011e4[_0x7bef('0x7c')])){return this['channel']['noop'](_0x7bef('0xf8'));}if(!this[_0x7bef('0x84')](_0x3011e4[_0x7bef('0x5a')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xaa'));}this[_0x7bef('0xe')]['bot']=!![];this[_0x7bef('0x36')](_0x3011e4);this[_0x7bef('0x43')](_0x3011e4[_0x7bef('0x5a')],'in','','');this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')]('Trying\x20DialogflowV2:\x20%s',_0x3011e4['text']));var _0x458493=this[_0x7bef('0x78')][_0x7bef('0x6c')](this,_0x3011e4);if(_0x458493){for(var _0x1ad2c2 in _0x458493){if(_0x458493[_0x7bef('0x94')](_0x1ad2c2)){if(_0x1ad2c2!=='providerResponse'){this['channel'][_0x7bef('0x9d')](util[_0x7bef('0x54')](_0x7bef('0xee'),_0x1ad2c2['toUpperCase']()),_0x458493[_0x1ad2c2]);}}}this['createSquareMessage'](_0x458493[_0x7bef('0xef')],'out',_0x7bef('0xf3'),_0x458493[_0x7bef('0xf9')]);return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xfa'),_0x458493[_0x7bef('0xef')]));}return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x3011e4,_0x7bef('0xfb'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0xfc')]=function(_0x4003cd){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0xfd'),_0x4003cd[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x4003cd[_0x7bef('0xfe')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xff'));}if(!this[_0x7bef('0x84')](_0x4003cd[_0x7bef('0x100')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x101'));}if(!this[_0x7bef('0x84')](_0x4003cd[_0x7bef('0x102')])){return this['channel'][_0x7bef('0xac')](_0x7bef('0x103'));}if(!this['isConfigured'](_0x4003cd['ndassistant_url'])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xaa'));}this['channel'][_0x7bef('0x104')]=!![];this[_0x7bef('0x36')](_0x4003cd);this[_0x7bef('0x43')](_0x4003cd[_0x7bef('0x5a')],'in','','');this['channel']['noop'](util[_0x7bef('0x54')](_0x7bef('0x105'),_0x4003cd['text']));var _0xf5c8d7=this[_0x7bef('0x106')]['sync'](this,_0x4003cd);if(_0xf5c8d7){for(var _0x6ac9d9 in _0xf5c8d7){if(_0xf5c8d7[_0x7bef('0x94')](_0x6ac9d9)){this[_0x7bef('0xe')][_0x7bef('0x9d')](util[_0x7bef('0x54')]('SESTEK_NDA_%s',_0x6ac9d9[_0x7bef('0x66')]()),_0xf5c8d7[_0x6ac9d9]);}}this[_0x7bef('0x43')](_0xf5c8d7[_0x7bef('0xef')],'out','sesteknda','');if(_0xf5c8d7[_0x7bef('0x107')]){this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x108'),_0xf5c8d7['audiofile']));var _0x16228b=this['channel'][_0x7bef('0x109')](_0xf5c8d7[_0x7bef('0x107')]);try{fs['unlink'](_0xf5c8d7[_0x7bef('0x107')]+'.wav');}catch(_0x5c708e){logger[_0x7bef('0x2c')](_0x5c708e);}return _0x16228b;}else{return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x10a'),_0xf5c8d7[_0x7bef('0xef')]));}}return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x4003cd,_0x7bef('0x10b'));};AGIVertices['prototype']['end']=function(_0x179fef){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')]('Enter\x20in\x20END\x20(%s)\x20block',_0x179fef[_0x7bef('0x38')]));return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x10c'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x10d')]=function(_0x4d49c2){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x10e'),_0x4d49c2[_0x7bef('0x38')]));var _0x23a29b='';if(_0x4d49c2[_0x7bef('0x10f')]){if(!this[_0x7bef('0x84')](_0x4d49c2[_0x7bef('0x10f')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x4d49c2,_0x7bef('0x110'));}else{var _0xdd1491=parseInt(_0x4d49c2[_0x7bef('0x10f')],0xa);if(isNaN(_0xdd1491)){_0x23a29b=_0x4d49c2[_0x7bef('0x10f')];}else{_0x23a29b=this[_0x7bef('0x1d')][_0x7bef('0x6c')](this,_0x4d49c2[_0x7bef('0x10f')]);if(!_0x23a29b){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x4d49c2,_0x7bef('0x111'));}}}}else if(_0x4d49c2[_0x7bef('0x112')]){_0x23a29b=_0x4d49c2[_0x7bef('0x112')];}else{return this['channel'][_0x7bef('0x2c')](_0x4d49c2,_0x7bef('0x110'));}var _0x5712fe=this[_0x7bef('0xe')][_0x7bef('0xc6')]('DIAL',[util['format'](_0x7bef('0x113'),_0x23a29b,_0x4d49c2['phone']),_0x4d49c2[_0x7bef('0x62')],_0x4d49c2['opts'],_0x4d49c2['url']]);if(_0x5712fe[_0x7bef('0xa4')]===-0x1){return _0x5712fe;}return this[_0x7bef('0xe')][_0x7bef('0xac')](util['format'](_0x7bef('0xe9'),'DIAL'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x114')]=function(_0x3ee9ee){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x115'),_0x3ee9ee[_0x7bef('0x38')]));return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x114'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x116')]=function(_0x1b11e2){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x117'),_0x1b11e2[_0x7bef('0x38')]));if(_0x1b11e2[_0x7bef('0xa6')]===0x0){return this['maxRetry'](_0x1b11e2);}_0x1b11e2[_0x7bef('0xa6')]-=0x1;if(!this['isConfigured'](_0x1b11e2[_0x7bef('0x118')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x1b11e2,_0x7bef('0x119'));}var _0x580802=this[_0x7bef('0x1e')][_0x7bef('0x6c')](this,_0x1b11e2[_0x7bef('0x118')]);if(!_0x580802){return this['channel'][_0x7bef('0x2c')](_0x1b11e2,'no\x20file\x20audio\x20found');}if(!this[_0x7bef('0x84')](_0x1b11e2[_0x7bef('0xdb')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x7bef('0xda'));}var _0x8a37e4=this['channel'][_0x7bef('0x11a')](_0x580802,_0x1b11e2[_0x7bef('0x11b')],_0x1b11e2[_0x7bef('0x11c')]);var _0x42c472=_0x8a37e4[_0x7bef('0xa4')]?_0x8a37e4['result'][_0x7bef('0x4c')]():'';logger[_0x7bef('0x2e')]('test',JSON[_0x7bef('0x6f')](_0x8a37e4));if(_0x8a37e4[_0x7bef('0xa4')]===-0x1){this[_0x7bef('0x36')]['sync'](this,_0x1b11e2,_0x42c472);return _0x8a37e4;}else if(_0x8a37e4['extra']===_0x7bef('0x62')){_0x8a37e4[_0x7bef('0xa4')]=_0x42c472[_0x7bef('0x9a')]>=parseInt(_0x1b11e2[_0x7bef('0x11d')])?'x':'i';}else{_0x8a37e4[_0x7bef('0xa4')]=_0x42c472['length']>=parseInt(_0x1b11e2[_0x7bef('0x11d')])&&_0x42c472[_0x7bef('0x9a')]<=parseInt(_0x1b11e2[_0x7bef('0x11c')])?'x':'i';}var _0x1422dc=this[_0x7bef('0xa1')]['sync'](this,_0x1b11e2[_0x7bef('0xdb')]);if(!_0x1422dc){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x1b11e2,'no\x20variable\x20found');}this[_0x7bef('0xe')][_0x7bef('0x9d')](_0x1422dc,_0x42c472);if(this[_0x7bef('0x84')](_0x1b11e2[_0x7bef('0x11e')])){var _0x4007db=parseInt(_0x1b11e2['hiddendigitsnum'],0xa);var _0x3c2467=rs[_0x7bef('0x11f')]({'charset':'*','length':_0x4007db});var _0x203ff7=_0x42c472[_0x7bef('0x9a')];if(_0x203ff7>0x0){if(_0x203ff7>_0x4007db){this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x1b11e2,_0x1b11e2['hiddendigitspos']===_0x7bef('0x120')?_0x3c2467+_0x42c472[_0x7bef('0x121')](_0x4007db):_0x42c472[_0x7bef('0x121')](0x0,_0x203ff7-_0x4007db)+_0x3c2467);}else{this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x1b11e2,rs['generate']({'charset':'*','length':_0x203ff7}));}}else{this[_0x7bef('0x36')]['sync'](this,_0x1b11e2,'');}}else{this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x1b11e2,_0x42c472);}return _0x8a37e4;};AGIVertices['prototype']['getsecretdigits']=function(_0x4797a9){logger['info'](util[_0x7bef('0x54')](_0x7bef('0x122'),_0x4797a9[_0x7bef('0x38')]));return this['getdigits'](_0x4797a9);};AGIVertices[_0x7bef('0x11')]['goal']=function(_0x453312){logger['info'](util[_0x7bef('0x54')](_0x7bef('0x123'),_0x453312[_0x7bef('0x38')]));this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x453312,_0x453312['goalname']);return this[_0x7bef('0xe')]['noop'](util['format'](_0x7bef('0x124'),_0x453312[_0x7bef('0x125')]));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x126')]=function(_0x129b0f){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x127'),_0x129b0f[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x129b0f[_0x7bef('0x8a')])||!this[_0x7bef('0x84')](_0x129b0f[_0x7bef('0x86')])){return this['channel'][_0x7bef('0xac')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x7bef('0x84')](_0x129b0f[_0x7bef('0x5a')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xaa'));}this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x128'),_0x129b0f[_0x7bef('0x5a')]));var _0x27fdf2=this['awsPolly'][_0x7bef('0x6c')](this,_0x129b0f);if(_0x27fdf2){this[_0x7bef('0xe')][_0x7bef('0xac')](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x27fdf2));var _0x284514=this[_0x7bef('0xe')][_0x7bef('0x109')](_0x27fdf2);try{fs[_0x7bef('0x129')](_0x27fdf2+_0x7bef('0x12a'));}catch(_0x4acf76){logger[_0x7bef('0x2c')](_0x4acf76);}return _0x284514;}return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x129b0f,_0x7bef('0x12b'));};AGIVertices['prototype']['awslex']=function(_0x4c639b){logger['info'](util[_0x7bef('0x54')](_0x7bef('0x12c'),_0x4c639b[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x4c639b['aws_access_key_id'])||!this[_0x7bef('0x84')](_0x4c639b[_0x7bef('0x86')])){return this['channel'][_0x7bef('0xac')](_0x7bef('0x12d'));}if(!this[_0x7bef('0x84')](_0x4c639b[_0x7bef('0x8c')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x12e'));}if(!this[_0x7bef('0x84')](_0x4c639b[_0x7bef('0x5a')])){return this['channel'][_0x7bef('0xac')]('no\x20text\x20configured');}this['channel'][_0x7bef('0x104')]=!![];this[_0x7bef('0x36')](_0x4c639b);this['createSquareMessage'](_0x4c639b[_0x7bef('0x5a')],'in','','');this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x12f'),_0x4c639b[_0x7bef('0x5a')]));var _0xffc7c3=this[_0x7bef('0x89')]['sync'](this,_0x4c639b);if(_0xffc7c3){for(var _0x4aa9ae in _0xffc7c3){if(_0xffc7c3['hasOwnProperty'](_0x4aa9ae)&&_[_0x7bef('0x95')](_0xffc7c3[_0x4aa9ae])){this[_0x7bef('0xe')][_0x7bef('0x9d')](util[_0x7bef('0x54')]('AWS_LEX_%s',_0x4aa9ae['toUpperCase']()),_0xffc7c3[_0x4aa9ae]);}}if(_[_0x7bef('0x45')](_0xffc7c3[_0x7bef('0x73')])){return this['channel'][_0x7bef('0xac')](_0x7bef('0x130'));}else{this[_0x7bef('0x43')](_0xffc7c3['message'],'out',_0x7bef('0x131'),'');return this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x132'),_0xffc7c3[_0x7bef('0x73')]));}}return this[_0x7bef('0xe')]['error'](_0x4c639b,_0x7bef('0x133'));};AGIVertices['prototype'][_0x7bef('0x134')]=function(_0x1fbdfe){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x135'),_0x1fbdfe[_0x7bef('0x38')],_0x1fbdfe[_0x7bef('0x62')]));if(!this[_0x7bef('0x84')](_0x1fbdfe['key'])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xec'));}var _0x428ddd='wav';var _0x28256a=util['format'](_0x7bef('0x136'),FILES_PATH,rs[_0x7bef('0x11f')](0x4));var _0x47a621=util[_0x7bef('0x54')]('%s.%s',_0x28256a,_0x428ddd);var _0x2fbdcb=!![];if(_0x1fbdfe[_0x7bef('0x137')]===_0x7bef('0x138')){_0x2fbdcb=![];}var _0x4c7b6e=this['channel'][_0x7bef('0x139')](_0x28256a,_0x428ddd,_0x1fbdfe['intKey'],_0x1fbdfe['timeout'],undefined,_0x2fbdcb);if(_0x4c7b6e[_0x7bef('0xa4')]!==-0x1){this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')](_0x7bef('0x13a'),_0x47a621));var _0x46a7a5=this['googleASR'][_0x7bef('0x6c')](this,_0x1fbdfe,_0x47a621);if(_0x46a7a5){for(var _0x435d92 in _0x46a7a5){if(_0x46a7a5[_0x7bef('0x94')](_0x435d92)){this[_0x7bef('0xe')][_0x7bef('0x9d')](util[_0x7bef('0x54')](_0x7bef('0x13b'),_0x435d92['toUpperCase']()),_0x46a7a5[_0x435d92]);}}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x13c'),JSON[_0x7bef('0x6f')](_0x46a7a5)));}}return _0x4c7b6e;};AGIVertices['prototype']['tildeasr']=function(_0x475357){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x13d'),_0x475357[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x475357[_0x7bef('0x90')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x13e'));}if(!this[_0x7bef('0x84')](_0x475357['appsecret'])){return this[_0x7bef('0xe')]['noop'](_0x7bef('0x13f'));}var _0x108e75=_0x7bef('0x140');var _0x58c2c9=util[_0x7bef('0x54')]('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3493a3=util['format'](_0x7bef('0x9c'),_0x58c2c9,_0x108e75);var _0x403821=!![];if(_0x475357[_0x7bef('0x137')]==='NOBEEP'){_0x403821=![];}var _0x2f4cef=this['channel']['recordFile'](_0x58c2c9,_0x108e75,_0x475357[_0x7bef('0x141')],_0x475357['timeout'],undefined,_0x403821);if(_0x2f4cef[_0x7bef('0xa4')]!==-0x1){this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')](_0x7bef('0x142'),_0x3493a3));var _0x42741c=this[_0x7bef('0x8f')][_0x7bef('0x6c')](this,_0x475357,_0x3493a3);if(_0x42741c){for(var _0xa345b0 in _0x42741c){if(_0x42741c[_0x7bef('0x94')](_0xa345b0)){this[_0x7bef('0xe')]['setVariable'](util[_0x7bef('0x54')](_0x7bef('0x143'),_0xa345b0[_0x7bef('0x66')]()),_0x42741c[_0xa345b0]);}}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x144'),JSON[_0x7bef('0x6f')](_0x42741c)));}}return _0x2f4cef;};AGIVertices[_0x7bef('0x11')][_0x7bef('0x145')]=function(_0x3e9865){logger['info'](util[_0x7bef('0x54')](_0x7bef('0x146'),_0x3e9865[_0x7bef('0x38')]));return this[_0x7bef('0xe')][_0x7bef('0x147')](_0x3e9865[_0x7bef('0x3d')],_0x3e9865[_0x7bef('0x3e')],_0x3e9865[_0x7bef('0x3f')]);};AGIVertices[_0x7bef('0x11')][_0x7bef('0x148')]=function(_0x8bb138){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x149'),_0x8bb138[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x8bb138['condition'])){return this[_0x7bef('0xe')]['error'](_0x8bb138,_0x7bef('0x14a'));}try{var _0x134a21=eval(_0x8bb138[_0x7bef('0x14b')])?_0x7bef('0x14c'):_0x7bef('0x14d');this[_0x7bef('0xe')]['noop'](util['format'](_0x7bef('0x14e'),_0x8bb138[_0x7bef('0x14b')],_0x134a21));return{'code':0xc8,'result':_0x134a21};}catch(_0x187e35){return{'code':0xc8,'result':_0x7bef('0x14d')};}};AGIVertices['prototype'][_0x7bef('0x14f')]=function(_0x59c2fa){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x150'),_0x59c2fa[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x59c2fa[_0x7bef('0x151')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x59c2fa,_0x7bef('0x152'));}var _0x88788f=this[_0x7bef('0x24')]['sync'](this,_0x59c2fa[_0x7bef('0x151')]);if(!_0x88788f){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x59c2fa,_0x7bef('0x153'));}for(var _0x5ce570=0x0;_0x5ce570<_0x88788f['length'];_0x5ce570+=0x1){var _0x1260a6=this[_0x7bef('0xe')][_0x7bef('0xa1')](util[_0x7bef('0x54')]('IFTIME(%s?true:false)',_0x88788f[_0x5ce570]));if(_0x1260a6['result']===-0x1){return _0x1260a6;}logger['info'](util[_0x7bef('0x54')]('IFTIME\x20%s\x20%s',_0x88788f[_0x5ce570],_0x1260a6[_0x7bef('0xa2')]));if(_0x1260a6[_0x7bef('0xa2')]===_0x7bef('0x14c')){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x154'),_0x88788f[_0x5ce570],_0x7bef('0x14c')));this['channel']['noop'](util[_0x7bef('0x54')](_0x7bef('0x154'),_0x88788f[_0x5ce570],_0x7bef('0x14c')));return{'code':0xc8,'result':_0x7bef('0x14c')};}else{logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x154'),_0x88788f[_0x5ce570],_0x7bef('0x14d')));this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')]('IFTIME\x20%s\x20%s',_0x88788f[_0x5ce570],_0x7bef('0x14d')));}}return{'code':0xc8,'result':_0x7bef('0x14d')};};AGIVertices[_0x7bef('0x11')][_0x7bef('0x155')]=function(_0x82fd77){logger['info'](util['format'](_0x7bef('0x156'),_0x82fd77['label']));return this['channel'][_0x7bef('0x155')]();};AGIVertices['prototype'][_0x7bef('0x157')]=function(_0x84de1){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x84de1['label']));if(!this['isConfigured'](_0x84de1['key'])){return this[_0x7bef('0xe')]['noop'](_0x7bef('0xec'));}var _0x379bd4=_0x7bef('0x140');var _0x37a9da=util['format'](_0x7bef('0x136'),FILES_PATH,rs[_0x7bef('0x11f')](0x4));var _0xd55d7d=util[_0x7bef('0x54')](_0x7bef('0x9c'),_0x37a9da,_0x379bd4);var _0x56e3fb=!![];if(_0x84de1[_0x7bef('0x137')]===_0x7bef('0x138')){_0x56e3fb=![];}var _0x459b2d=this[_0x7bef('0xe')][_0x7bef('0x139')](_0x37a9da,_0x379bd4,_0x84de1[_0x7bef('0x141')],_0x84de1[_0x7bef('0x62')],undefined,_0x56e3fb);if(_0x459b2d[_0x7bef('0xa4')]!==-0x1){this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x158'),_0xd55d7d));var _0x52b5d7=this[_0x7bef('0x82')]['sync'](this,_0x84de1,_0xd55d7d);if(_0x52b5d7){for(var _0x3a3b12 in _0x52b5d7){if(_0x52b5d7[_0x7bef('0x94')](_0x3a3b12)){this[_0x7bef('0xe')]['setVariable'](util['format'](_0x7bef('0x159'),_0x3a3b12[_0x7bef('0x66')]()),_0x52b5d7[_0x3a3b12]);}}return this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')](_0x7bef('0x15a'),JSON[_0x7bef('0x6f')](_0x52b5d7)));}}return _0x459b2d;};AGIVertices[_0x7bef('0x11')]['ispeechtts']=function(_0x2e19fc){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x15b'),_0x2e19fc[_0x7bef('0x38')]));if(!this['isConfigured'](_0x2e19fc[_0x7bef('0x7e')])){return this['channel']['noop'](_0x7bef('0xec'));}if(!this[_0x7bef('0x84')](_0x2e19fc[_0x7bef('0x5a')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xaa'));}this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')]('Trying\x20ispeech\x20TTS\x20%s',_0x2e19fc['text']));var _0x62a881=this[_0x7bef('0x7d')][_0x7bef('0x6c')](this,_0x2e19fc);if(_0x62a881){this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x158'),_0x62a881));var _0x4f3e10=this[_0x7bef('0xe')][_0x7bef('0x109')](_0x62a881,_0x2e19fc['intKey']);try{fs[_0x7bef('0x129')](_0x62a881+'.wav');}catch(_0x20e536){logger[_0x7bef('0x2c')](_0x20e536);}return _0x4f3e10;}return this[_0x7bef('0xe')]['error'](_0x2e19fc,_0x7bef('0x15c'));};AGIVertices['prototype'][_0x7bef('0x15d')]=function(_0x198ec2){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x198ec2['label']));if(!this[_0x7bef('0x84')](_0x198ec2[_0x7bef('0x15e')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x198ec2,_0x7bef('0x15f'));}logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x160'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x198ec2[_0x7bef('0x15e')]));var _0x1edf66=this[_0x7bef('0x52')][_0x7bef('0x6c')](this,_0x198ec2['findBy']);if(_0x1edf66){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x161'),this[_0x7bef('0xe')]['callerid'],_0x198ec2[_0x7bef('0x15e')]));this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x198ec2[_0x7bef('0x15e')]));return{'code':0xc8,'result':_0x7bef('0x162')};}else{logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x163'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x198ec2[_0x7bef('0x15e')]));this['channel'][_0x7bef('0xac')](util['format'](_0x7bef('0x163'),this['channel'][_0x7bef('0x3a')],_0x198ec2[_0x7bef('0x15e')]));return{'code':0xc8,'result':_0x7bef('0x164')};}};AGIVertices[_0x7bef('0x11')]['logout']=function(_0x3beb05){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x165'),_0x3beb05[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x3beb05['findBy'])){return this['channel'][_0x7bef('0x2c')](_0x3beb05,_0x7bef('0x15f'));}logger[_0x7bef('0x2e')](util[_0x7bef('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x3beb05[_0x7bef('0x15e')]));var _0x1b6a89=this[_0x7bef('0x51')][_0x7bef('0x6c')](this,_0x3beb05[_0x7bef('0x15e')]);if(_0x1b6a89){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x3beb05[_0x7bef('0x15e')]));this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7bef('0xe')]['callerid'],_0x3beb05[_0x7bef('0x15e')]));return{'code':0xc8,'result':_0x7bef('0x162')};}else{logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x163'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x3beb05['findBy']));this[_0x7bef('0xe')]['noop'](util['format'](_0x7bef('0x163'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x3beb05['findBy']));return{'code':0xc8,'result':_0x7bef('0x164')};}};AGIVertices[_0x7bef('0x11')][_0x7bef('0x166')]=function(_0x49a970){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x167'),_0x49a970['label']));if(!this[_0x7bef('0x84')](_0x49a970[_0x7bef('0x168')])){return this[_0x7bef('0xe')]['error'](_0x49a970,'no\x20operation\x20configured');}this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x169'),_0x49a970[_0x7bef('0x168')]));var _0x43cdb3=eval(_0x49a970[_0x7bef('0x168')]);if(!this[_0x7bef('0x84')](_0x49a970[_0x7bef('0xdb')])){return this[_0x7bef('0xe')][_0x7bef('0xac')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x14d24a=this[_0x7bef('0xa1')]['sync'](this,_0x49a970[_0x7bef('0xdb')]);if(!_0x14d24a){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x49a970,_0x7bef('0xdc'));}if(_[_0x7bef('0x99')](_0x43cdb3)){var _0x4e1593=this;_0x43cdb3[_0x7bef('0x16a')](function(_0x21cda5,_0x4960a0){_0x4e1593[_0x7bef('0xe')][_0x7bef('0x9d')](util['format'](_0x7bef('0x16b'),_0x14d24a,_0x4960a0),_0x21cda5);});return this[_0x7bef('0xe')][_0x7bef('0xac')](util['format'](_0x7bef('0x16c'),_0x14d24a));}else{return this['channel'][_0x7bef('0x9d')](_0x14d24a,_0x43cdb3);}};AGIVertices[_0x7bef('0x11')][_0x7bef('0xc')]=function(_0x5bbb64){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x16d'),_0x5bbb64['label']));if(_0x5bbb64[_0x7bef('0xa6')]===0x0){return this[_0x7bef('0xa7')](_0x5bbb64);}_0x5bbb64['retry']-=0x1;if(!this['isConfigured'](_0x5bbb64[_0x7bef('0x118')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x5bbb64,'no\x20file\x20audio\x20selected');}var _0x312bfb=this[_0x7bef('0x1e')][_0x7bef('0x6c')](this,_0x5bbb64['file_id']);if(!_0x312bfb){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x5bbb64,'no\x20file\x20audio\x20found');}var _0x1f6a19=this['channel'][_0x7bef('0x11a')](_0x312bfb,_0x5bbb64['response'],_0x5bbb64['digit']);var _0x326e57=_0x1f6a19['result'];if(_0x1f6a19[_0x7bef('0xa4')]===-0x1){this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x5bbb64,'-1');return _0x1f6a19;}else if(_0x1f6a19[_0x7bef('0xa2')]===_0x7bef('0x62')){_0x1f6a19['result']=_0x1f6a19['result'][_0x7bef('0x9a')]>0x0?_0x1f6a19[_0x7bef('0xa4')]:'t';}else if(_[_0x7bef('0x44')](_0x1f6a19[_0x7bef('0xa4')])){_0x1f6a19[_0x7bef('0xa4')]='#';_0x326e57='#';}if(!this[_0x7bef('0x84')](_0x5bbb64[_0x7bef('0xdb')])){this[_0x7bef('0xe')]['noop'](_0x7bef('0xda'));}else{var _0x332f52=this[_0x7bef('0xa1')][_0x7bef('0x6c')](this,_0x5bbb64[_0x7bef('0xdb')]);if(!_0x332f52){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x5bbb64,_0x7bef('0xdc'));}this[_0x7bef('0xe')][_0x7bef('0x9d')](_0x332f52,_0x326e57);}this['createSquareDetailsReport'][_0x7bef('0x6c')](this,_0x5bbb64,_0x326e57);return _0x1f6a19;};AGIVertices['prototype'][_0x7bef('0xac')]=function(_0x3fd978){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x16e'),_0x3fd978['label']));return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x3fd978[_0x7bef('0x16f')]||_0x3fd978[_0x7bef('0x38')]);};AGIVertices[_0x7bef('0x11')][_0x7bef('0x170')]=function(_0x1d1f0c){logger['info'](util['format'](_0x7bef('0x171'),_0x1d1f0c[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x1d1f0c[_0x7bef('0x15e')])){return this['channel'][_0x7bef('0x2c')](_0x1d1f0c,_0x7bef('0x15f'));}logger[_0x7bef('0x2e')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x1d1f0c[_0x7bef('0x15e')]));var _0x174fac=this[_0x7bef('0x172')][_0x7bef('0x6c')](this,_0x1d1f0c['pause_id']);var _0x49cf1a=this[_0x7bef('0x4e')][_0x7bef('0x6c')](this,_0x1d1f0c[_0x7bef('0x15e')],_0x174fac);if(_0x49cf1a){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x161'),this['channel'][_0x7bef('0x3a')],_0x1d1f0c['findBy']));this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x161'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x1d1f0c[_0x7bef('0x15e')]));return{'code':0xc8,'result':_0x7bef('0x162')};}else{logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x163'),this['channel']['callerid'],_0x1d1f0c[_0x7bef('0x15e')]));this['channel']['noop'](util[_0x7bef('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x1d1f0c[_0x7bef('0x15e')]));return{'code':0xc8,'result':_0x7bef('0x164')};}};AGIVertices['prototype'][_0x7bef('0x173')]=function(_0x2650f7){logger[_0x7bef('0x2e')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2650f7[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x2650f7[_0x7bef('0x118')])){return this['channel']['error'](_0x2650f7,_0x7bef('0x119'));}var _0xf8a3b1=this['getSound']['sync'](this,_0x2650f7[_0x7bef('0x118')]);if(!_0xf8a3b1){return this['channel'][_0x7bef('0x2c')](_0x2650f7,_0x7bef('0x174'));}var _0xbe6aea=this[_0x7bef('0xe')][_0x7bef('0xc6')](_0x7bef('0x175'),[_0xf8a3b1,_0x2650f7[_0x7bef('0xe8')]]);if(_0xbe6aea[_0x7bef('0xa4')]===-0x1){return _0xbe6aea;}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xc4'),'PLAYBACK',_0xf8a3b1));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x176')]=function(_0x488e8e){logger[_0x7bef('0x2e')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x488e8e[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x488e8e[_0x7bef('0x177')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x488e8e,'no\x20queue\x20selected');}var _0x48a3f6='';var _0x2a7351=parseInt(_0x488e8e['queue_id'],0xa);if(isNaN(_0x2a7351)){_0x48a3f6=_0x488e8e[_0x7bef('0x177')];}else{_0x48a3f6=this['getVoiceQueue'][_0x7bef('0x6c')](this,_0x488e8e[_0x7bef('0x177')]);if(!_0x48a3f6){return this['channel'][_0x7bef('0x2c')](_0x488e8e,_0x7bef('0x178'));}}var _0x58611d='';if(this[_0x7bef('0x84')](_0x488e8e[_0x7bef('0x118')])){var _0x233538=this[_0x7bef('0x1e')][_0x7bef('0x6c')](this,_0x488e8e[_0x7bef('0x118')]);if(_0x233538){_0x58611d=_0x233538;}}this['createSquareDetailsReport'][_0x7bef('0x6c')](this,_0x488e8e,_0x48a3f6);if(_0x488e8e['opts']['indexOf']('x')<0x0){_0x488e8e[_0x7bef('0xe8')]+='x';}if(_0x488e8e[_0x7bef('0xe8')]['indexOf']('X')<0x0){_0x488e8e[_0x7bef('0xe8')]+='X';}this[_0x7bef('0xe')][_0x7bef('0x9d')](_0x7bef('0x179'),_0x48a3f6?_0x48a3f6[_0x7bef('0x17a')]():'');var _0x1ba4b4=this[_0x7bef('0xe')]['exec'](_0x7bef('0x17b'),[_0x48a3f6,_0x488e8e[_0x7bef('0xe8')],_0x488e8e[_0x7bef('0x6e')],_0x58611d,_0x488e8e[_0x7bef('0x62')],_0x488e8e['agi'],_0x488e8e[_0x7bef('0x17c')],_0x488e8e[_0x7bef('0x17d')],'',_0x488e8e['position']]);if(_0x1ba4b4[_0x7bef('0xa4')]===-0x1){return _0x1ba4b4;}return this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')](_0x7bef('0xc4'),_0x7bef('0x17b'),_0x48a3f6));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x17e')]=function(_0x57f402){logger['info'](util[_0x7bef('0x54')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x57f402[_0x7bef('0x38')]));var _0x3937f8=_0x57f402[_0x7bef('0x17f')]||_0x7bef('0x140');var _0x21271e=util[_0x7bef('0x54')](_0x7bef('0x180'),this['channel'][_0x7bef('0x37')],rs['generate'](0x5));var _0x4d869a=util[_0x7bef('0x54')]('%s/recordings/%s.%s',FILES_PATH,_0x21271e,_0x3937f8);var _0x701f37=util['format'](_0x7bef('0x136'),FILES_PATH,_0x21271e);this['createSquareRecording'][_0x7bef('0x6c')](this,_0x57f402,_0x21271e,_0x4d869a);this[_0x7bef('0xe')][_0x7bef('0x9d')](_0x7bef('0x181'),_0x21271e);logger[_0x7bef('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x701f37,_0x3937f8,_0x57f402['escape_digits'],_0x57f402[_0x7bef('0x62')]);return this[_0x7bef('0xe')][_0x7bef('0x139')](_0x701f37,_0x3937f8,_0x57f402[_0x7bef('0x182')],_0x57f402[_0x7bef('0x62')],undefined,!![]);};AGIVertices[_0x7bef('0x11')][_0x7bef('0x183')]=function(_0xc2aed7){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x184'),_0xc2aed7[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0xc2aed7['url'])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x185'));}var _0x142736=this[_0x7bef('0x61')][_0x7bef('0x6c')](this,_0xc2aed7);logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x186'),util[_0x7bef('0x187')](_0x142736,{'showHidden':![],'depth':null})));if(!this[_0x7bef('0x84')](_0xc2aed7['variable_id'])){return this['channel'][_0x7bef('0xac')](_0x7bef('0x188'));}var _0x288e31=this[_0x7bef('0xa1')]['sync'](this,_0xc2aed7[_0x7bef('0xdb')]);if(!_0x288e31){return this['channel']['error'](_0xc2aed7,_0x7bef('0xdc'));}this['channel']['setVariable'](util[_0x7bef('0x54')](_0x7bef('0x189'),_0x288e31),_0x142736['statusCode']?_0x142736[_0x7bef('0x71')]:_0x7bef('0x18a'));this[_0x7bef('0xe')][_0x7bef('0x9d')](util[_0x7bef('0x54')](_0x7bef('0x18b'),_0x288e31),_0x142736['statusMessage']?_0x142736[_0x7bef('0x72')]:'OK');if(_0x142736[_0x7bef('0x67')]){try{this[_0x7bef('0x9b')](_0x142736['body'],_0x288e31);}catch(_0x1fd1f0){logger[_0x7bef('0x2c')](util['format'](_0x7bef('0x18c'),_0x288e31));}}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xe0'),_0x288e31));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x18d')]=function(_0x55c62f){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x18e'),_0x55c62f['label']));return this['channel'][_0x7bef('0x18f')](_0x55c62f[_0x7bef('0x190')][_0x7bef('0xd9')](/\s+/g,''),_0x55c62f[_0x7bef('0x182')]);};AGIVertices[_0x7bef('0x11')][_0x7bef('0x191')]=function(_0x3bfa48){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x192'),_0x3bfa48[_0x7bef('0x38')]));return this[_0x7bef('0xe')][_0x7bef('0x193')](_0x3bfa48[_0x7bef('0x194')]['replace'](/\s+/g,''),_0x3bfa48[_0x7bef('0x182')]);};AGIVertices[_0x7bef('0x11')]['sayphonetic']=function(_0xdfa820){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x195'),_0xdfa820[_0x7bef('0x38')]));return this[_0x7bef('0xe')][_0x7bef('0x196')](_0xdfa820['text'],_0xdfa820['escape_digits']);};AGIVertices[_0x7bef('0x11')][_0x7bef('0x197')]=function(_0x27d732){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x198'),_0x27d732[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x27d732[_0x7bef('0x199')])){return this[_0x7bef('0xe')][_0x7bef('0xac')]('no\x20mail\x20account\x20configured');}var _0x17a0bf=this[_0x7bef('0x19a')][_0x7bef('0x6c')](this,_0x27d732[_0x7bef('0x199')]);if(!_0x17a0bf||!_0x17a0bf['Smtp']){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x27d732,'no\x20mail\x20account\x20found');}var _0x1e685e={'from':util[_0x7bef('0x54')]('\x22%s\x22\x20<%s>',_0x17a0bf[_0x7bef('0x13')],_0x17a0bf[_0x7bef('0x19b')]||_0x17a0bf[_0x7bef('0x19c')][_0x7bef('0x19d')]),'to':_0x27d732['to']||'','cc':_0x27d732['cc']||'','bcc':_0x27d732[_0x7bef('0x19e')]||'','subject':_0x27d732[_0x7bef('0x19f')],'html':_0x27d732[_0x7bef('0x5a')],'text':_0x27d732[_0x7bef('0x5a')]};var _0x1fc50a={'tls':{'rejectUnauthorized':![]}};if(_0x17a0bf['Smtp']['service']){_0x1fc50a[_0x7bef('0x1a0')]=_0x17a0bf[_0x7bef('0x19c')]['service'];}else{_0x1fc50a['host']=_0x17a0bf[_0x7bef('0x19c')][_0x7bef('0x1a1')];_0x1fc50a[_0x7bef('0x1a2')]=_0x17a0bf[_0x7bef('0x19c')][_0x7bef('0x1a2')];_0x1fc50a[_0x7bef('0x1a3')]=_0x17a0bf[_0x7bef('0x19c')][_0x7bef('0x1a3')];}if(_0x17a0bf[_0x7bef('0x19c')][_0x7bef('0x1a4')]){_0x1fc50a[_0x7bef('0x1a5')]={'user':_0x17a0bf[_0x7bef('0x19c')][_0x7bef('0x19d')],'pass':_0x17a0bf[_0x7bef('0x19c')][_0x7bef('0x1a6')]};}if(this[_0x7bef('0x84')](_0x27d732['template_id'])){}logger[_0x7bef('0xe2')](_0x7bef('0x1a7'),JSON['stringify'](_0x1e685e));this[_0x7bef('0x36')]['sync'](this,_0x27d732,_0x27d732[_0x7bef('0x199')]);this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x1a8'),_0x17a0bf[_0x7bef('0x13')]));this[_0x7bef('0x23')][_0x7bef('0x6c')](this,_0x1fc50a,_0x1e685e);return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x1a9'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1aa')]=function(_0x2d1b7b){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1ab'),_0x2d1b7b[_0x7bef('0x38')]));return this['channel'][_0x7bef('0xac')](_0x7bef('0x1ac'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1ad')]=function(_0x2d1759){logger['info'](util[_0x7bef('0x54')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2d1759[_0x7bef('0x38')]));if(!this['isConfigured'](_0x2d1759[_0x7bef('0x1ae')])){return this['channel'][_0x7bef('0xac')]('no\x20sms\x20account\x20configured');}var _0x290fa3=this[_0x7bef('0x33')]['sync'](this,_0x2d1759[_0x7bef('0x1ae')]);if(!_0x290fa3){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x2d1759,'no\x20sms\x20account\x20found');}var _0x3d5896={'body':_0x2d1759[_0x7bef('0x1af')],'phone':_0x2d1759['to']||'','SmsAccountId':_0x290fa3['id']};logger['debug'](_0x7bef('0x1b0'),JSON[_0x7bef('0x6f')](_0x3d5896));this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x2d1759,_0x2d1759['sms_account_id']);this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x290fa3[_0x7bef('0x13')]));this[_0x7bef('0x35')][_0x7bef('0x6c')](this,_0x3d5896);return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x1b1'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1b2')]=function(_0x554d09){logger[_0x7bef('0x2e')](util['format'](_0x7bef('0x1b3'),_0x554d09[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x554d09[_0x7bef('0xdb')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x554d09,_0x7bef('0x1b4'));}var _0x4c1fbd=this[_0x7bef('0xa1')][_0x7bef('0x6c')](this,_0x554d09[_0x7bef('0xdb')]);if(!_0x4c1fbd){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x554d09,_0x7bef('0xdc'));}return this[_0x7bef('0xe')]['setVariable'](_0x4c1fbd,_0x554d09[_0x7bef('0x1b5')]);};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1b6')]=function(_0x186974){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1b7'),_0x186974[_0x7bef('0x38')]));this['channel'][_0x7bef('0xac')](_0x7bef('0x1b8'));if(_0x186974['answer']===_0x7bef('0x1b9')){this[_0x7bef('0xe')]['noop'](_0x7bef('0x1ba'));return this['channel']['answer']();}return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0x1bb'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1bc')]=function(_0x1a49b5){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1bd'),_0x1a49b5['label']));if(!this[_0x7bef('0x84')](_0x1a49b5[_0x7bef('0x1be')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x1a49b5,_0x7bef('0x1bf'));}var _0x4f9bd4=this[_0x7bef('0x17')][_0x7bef('0x6c')](this,_0x1a49b5[_0x7bef('0x1be')]);if(!this[_0x7bef('0x84')](_0x4f9bd4)){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x1a49b5,util[_0x7bef('0x54')](_0x7bef('0x1c0'),_0x1a49b5['project_id']));}if(_0x4f9bd4===this[_0x7bef('0xe')][_0x7bef('0x41')]){return this[_0x7bef('0xe')]['error'](_0x1a49b5,_0x7bef('0x1c1'));}this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x1a49b5,_0x4f9bd4);var _0x5ad359=this[_0x7bef('0xe')][_0x7bef('0xc6')]('AGI',util[_0x7bef('0x54')](_0x7bef('0x1c2'),config['agi'][_0x7bef('0x1a1')]||_0x7bef('0x1c3'),_0x4f9bd4,this['channel'][_0x7bef('0x41')]));if(_0x5ad359[_0x7bef('0xa4')]===-0x1){return _0x5ad359;}return this['channel'][_0x7bef('0xac')](util['format'](_0x7bef('0xc4'),_0x7bef('0x1c4'),_0x4f9bd4));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1c5')]=function(_0x2e4621){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1c6'),_0x2e4621[_0x7bef('0x38')]));var _0x21cc81=this['shellCommand'][_0x7bef('0x6c')](this,_0x2e4621['command']);this[_0x7bef('0x36')][_0x7bef('0x6c')](this,_0x2e4621,_0x2e4621[_0x7bef('0xb6')]);if(this[_0x7bef('0x84')](_0x2e4621[_0x7bef('0xdb')])){var _0x56c488=this[_0x7bef('0xa1')]['sync'](this,_0x2e4621['variable_id']);if(_0x56c488){this[_0x7bef('0xe')][_0x7bef('0x9d')](_0x56c488,_0x21cc81);return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x1c7'),_0x2e4621[_0x7bef('0xb6')],_0x56c488));}}return this['channel'][_0x7bef('0xac')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x2e4621[_0x7bef('0xb6')]));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1c8')]=function(_0x3f16f2){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1c9'),_0x3f16f2[_0x7bef('0x38')]));_0x3f16f2[_0x7bef('0x5a')]=_0x3f16f2[_0x7bef('0x5a')][_0x7bef('0xd9')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3f16f2[_0x7bef('0x59')])){return this[_0x7bef('0xe')][_0x7bef('0xac')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0x3f16f2[_0x7bef('0x5a')])){return this[_0x7bef('0xe')][_0x7bef('0xac')](_0x7bef('0xaa'));}this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x3f16f2['text']));var _0x255ca9=this[_0x7bef('0x58')][_0x7bef('0x6c')](this,_0x3f16f2);if(_0x255ca9){this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x1ca'),_0x255ca9));var _0x4b44cc=this[_0x7bef('0xe')][_0x7bef('0x109')](_0x255ca9);try{fs['unlink'](_0x255ca9+_0x7bef('0x12a'));}catch(_0x4b9c6c){logger[_0x7bef('0x2c')](_0x4b9c6c);}return _0x4b44cc;}return this['channel'][_0x7bef('0x2c')](_0x3f16f2,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x7bef('0x11')]['tts']=function(_0x4ccf23){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1cb'),_0x4ccf23[_0x7bef('0x38')]));_0x4ccf23[_0x7bef('0x5a')]=_0x4ccf23[_0x7bef('0x5a')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x7bef('0x84')](_0x4ccf23[_0x7bef('0x5a')])){return this[_0x7bef('0xe')][_0x7bef('0xac')]('no\x20text\x20configured');}this['channel']['noop'](util[_0x7bef('0x54')]('Trying\x20Google\x20TTS\x20%s',_0x4ccf23[_0x7bef('0x5a')]));var _0xaa0fc0=this[_0x7bef('0x5f')]['sync'](this,_0x4ccf23);if(_0xaa0fc0){this['channel'][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0x1cc'),_0xaa0fc0));var _0x437ac0=this[_0x7bef('0xe')][_0x7bef('0x109')](_0xaa0fc0);try{fs[_0x7bef('0x129')](_0xaa0fc0+_0x7bef('0x12a'));}catch(_0x8cf488){logger['error'](_0x8cf488);}return _0x437ac0;}return this['channel'][_0x7bef('0x2c')](_0x4ccf23,_0x7bef('0x1cd'));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1ce')]=function(_0x16f7c4){logger['info'](util[_0x7bef('0x54')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x16f7c4[_0x7bef('0x38')]));if(!this[_0x7bef('0x84')](_0x16f7c4[_0x7bef('0x15e')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x16f7c4,_0x7bef('0x15f'));}logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x160'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x16f7c4[_0x7bef('0x15e')]));var _0x13a2b1=this[_0x7bef('0x50')][_0x7bef('0x6c')](this,_0x16f7c4[_0x7bef('0x15e')]);if(_0x13a2b1){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x7bef('0x3a')],_0x16f7c4[_0x7bef('0x15e')]));this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')](_0x7bef('0x161'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x16f7c4['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x16f7c4['findBy']));this[_0x7bef('0xe')]['noop'](util[_0x7bef('0x54')](_0x7bef('0x163'),this[_0x7bef('0xe')][_0x7bef('0x3a')],_0x16f7c4[_0x7bef('0x15e')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x7bef('0x11')]['voicemail']=function(_0x4b67f1){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1cf'),_0x4b67f1[_0x7bef('0x38')]));var _0x566d78=this[_0x7bef('0xe')][_0x7bef('0xc6')](_0x7bef('0x1d0'),[_0x4b67f1[_0x7bef('0x1d1')],_0x4b67f1[_0x7bef('0x75')]]);if(_0x566d78[_0x7bef('0xa4')]===-0x1){return _0x566d78;}return this[_0x7bef('0xe')][_0x7bef('0xac')](util[_0x7bef('0x54')](_0x7bef('0xc4'),_0x7bef('0x1d0'),_0x4b67f1[_0x7bef('0x1d1')]));};AGIVertices[_0x7bef('0x11')][_0x7bef('0x1d2')]=function(_0x28a96a){logger[_0x7bef('0x2e')](util[_0x7bef('0x54')](_0x7bef('0x1d3'),_0x28a96a['label']));if(!this[_0x7bef('0x84')](_0x28a96a[_0x7bef('0xdb')])){return this[_0x7bef('0xe')][_0x7bef('0x2c')](_0x28a96a,_0x7bef('0x1b4'));}var _0x3271be=this[_0x7bef('0xa1')]['sync'](this,_0x28a96a[_0x7bef('0xdb')]);if(!_0x3271be){return this[_0x7bef('0xe')]['error'](_0x28a96a,_0x7bef('0xdc'));}var _0x43f415=this[_0x7bef('0xe')][_0x7bef('0xa1')](_0x3271be);return{'code':0xc8,'result':_0x43f415[_0x7bef('0xa2')]?_0x43f415[_0x7bef('0xa2')]:'-'};};String[_0x7bef('0x11')][_0x7bef('0xa0')]=function(_0x3f3a4f,_0x2dc416){return this[_0x7bef('0x9f')](_0x3f3a4f)['join'](_0x2dc416);};module[_0x7bef('0x1d4')]=AGIVertices; \ No newline at end of file +var _0x3e33=['saveRestApiResult','%s.%s','isArray','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','googleDialogflow','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','DIALOGFLOW_%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','no\x20trunk\x20selected','trunk_id','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','maxdigit','test','mindigit','hiddendigitsnum','first','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','recordFile','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','response','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','service','host','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','getSmsAccount','no\x20sms\x20account\x20found','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','path','lodash','randomstring','moment','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getSquareProjectById','getSquareOdbc','dsn','getUserById','getTrunk','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','map','interval','getSoundPath','format','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','callback','scheduledAt','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%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','number','includes','POST','PUT','toUpperCase','body','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','key','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','length','replaceAllVariables'];(function(_0x4f617a,_0x2475f7){var _0x9d2059=function(_0x498fa6){while(--_0x498fa6){_0x4f617a['push'](_0x4f617a['shift']());}};_0x9d2059(++_0x2475f7);}(_0x3e33,0x137));var _0x33e3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3e33[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x33e3('0x0'));var util=require('util');var _=require(_0x33e3('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x33e3('0x2'));var moment=require(_0x33e3('0x3'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0x33e3('0x4'));var scripts=require(_0x33e3('0x5'));var FILES_PATH=_0x33e3('0x6');var recursiveMapAttributes=[_0x33e3('0x7'),_0x33e3('0x8')];var verticesWithRetry=[_0x33e3('0x9'),_0x33e3('0xa'),_0x33e3('0xb')];var AGIVertices=function(_0x785815,_0x5207f4,_0x1e5673){this[_0x33e3('0xc')]=_0x785815;this[_0x33e3('0xd')]=_0x5207f4;this[_0x33e3('0xe')]=_0x1e5673;};AGIVertices[_0x33e3('0xf')][_0x33e3('0x10')]=function(_0x1462d8,_0x101f2){this[_0x33e3('0xd')]['getVariableById'](_0x1462d8)[_0x33e3('0x11')](function(_0x4aec56){_0x101f2(null,_0x4aec56?_0x4aec56[_0x33e3('0x12')]:![]);})['catch'](function(_0x1f3d5a){_0x101f2(_0x1f3d5a);});};AGIVertices[_0x33e3('0xf')]['getVoiceQueue']=function(_0x45042b,_0x390841){this[_0x33e3('0xd')]['getVoiceQueueById'](_0x45042b)[_0x33e3('0x11')](function(_0x112978){_0x390841(null,_0x112978?_0x112978[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0x3e2859){_0x390841(_0x3e2859);});};AGIVertices['prototype']['getSquareProject']=function(_0x398857,_0x4d3346){this[_0x33e3('0xd')][_0x33e3('0x14')](_0x398857)[_0x33e3('0x11')](function(_0x14790c){_0x4d3346(null,_0x14790c?_0x14790c[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0x30d8f2){_0x4d3346(_0x30d8f2);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x15')]=function(_0x402b52,_0x33bc34){this['rpc']['getSquareOdbcById'](_0x402b52)[_0x33e3('0x11')](function(_0x43e0b4){_0x33bc34(null,_0x43e0b4?_0x43e0b4[_0x33e3('0x16')]:![]);})[_0x33e3('0x13')](function(_0x1b6def){_0x33bc34(_0x1b6def);});};AGIVertices['prototype']['getUser']=function(_0x1dcd84,_0x27433a){this[_0x33e3('0xd')][_0x33e3('0x17')](_0x1dcd84)['then'](function(_0x5f4553){_0x27433a(null,_0x5f4553?_0x5f4553[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0x2e1809){_0x27433a(_0x2e1809);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x18')]=function(_0x2c5fd,_0x4e79c5){this[_0x33e3('0xd')][_0x33e3('0x19')](_0x2c5fd)[_0x33e3('0x11')](function(_0x27e651){_0x4e79c5(null,_0x27e651?_0x27e651[_0x33e3('0x12')]:![]);})[_0x33e3('0x13')](function(_0xeb282d){_0x4e79c5(_0xeb282d);});};AGIVertices['prototype'][_0x33e3('0x1a')]=function(_0x23434d,_0x272357){var _0x48389b=this;this[_0x33e3('0xd')]['getSoundById'](_0x23434d)[_0x33e3('0x11')](function(_0x4ff5c1){_0x272357(null,_0x4ff5c1?_0x48389b['getSoundPath'](_0x4ff5c1[_0x33e3('0x1b')]):![]);})[_0x33e3('0x13')](function(_0x633a1b){_0x272357(_0x633a1b);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1c')]=function(_0x36344c,_0x5e4f6d){this['rpc'][_0x33e3('0x1d')](_0x36344c)[_0x33e3('0x11')](function(_0x217bca){_0x5e4f6d(null,_0x217bca?_0x217bca:![]);})['catch'](function(_0x17eb65){_0x5e4f6d(_0x17eb65);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1e')]=function(_0x112dd0,_0x41b7f4,_0x576198){this[_0x33e3('0xe')][_0x33e3('0x1e')](_0x112dd0,_0x41b7f4)[_0x33e3('0x11')](function(){_0x576198(null);})[_0x33e3('0x13')](function(_0x4e58c5){_0x576198(_0x4e58c5);});};AGIVertices['prototype'][_0x33e3('0x1f')]=function(_0x44d667,_0x138d7f){this[_0x33e3('0xd')][_0x33e3('0x20')](_0x44d667)[_0x33e3('0x11')](function(_0x4fb69b){if(_0x4fb69b){if(_0x4fb69b[_0x33e3('0x21')]){_0x138d7f(null,[_0x4fb69b['interval']]);}else{_0x138d7f(null,_[_0x33e3('0x22')](_0x4fb69b['Intervals'],_0x33e3('0x23')));}}else{_0x138d7f(null,![]);}})[_0x33e3('0x13')](function(_0x476c93){_0x138d7f(_0x476c93);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x24')]=function(_0x953c3f){return util[_0x33e3('0x25')]('%s/sounds/converted/%s',FILES_PATH,_0x953c3f);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x26')]=function(_0x35a169,_0x3aef65,_0x108ec1){odbc[_0x33e3('0x27')](_0x35a169,function(_0xfa3f4e){if(_0xfa3f4e){logger[_0x33e3('0x28')](_0x33e3('0x29'),_0xfa3f4e);_0x108ec1(_0xfa3f4e);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x3aef65,function(_0x327277,_0x1373bf){if(_0x327277){logger[_0x33e3('0x2a')](_0x33e3('0x2b'),_0x3aef65);_0x108ec1(_0x327277);}else{logger[_0x33e3('0x2a')](_0x33e3('0x2c'),_0x3aef65);odbc[_0x33e3('0x2d')](function(_0x30464f){if(_0x30464f){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x30464f);}_0x108ec1(null,_0x1373bf);});}});}});};AGIVertices[_0x33e3('0xf')]['getSmsAccount']=function(_0x196812,_0x4ec1ff){this[_0x33e3('0xd')][_0x33e3('0x2e')](_0x196812)[_0x33e3('0x11')](function(_0x14fd7c){_0x4ec1ff(null,_0x14fd7c?_0x14fd7c:![]);})[_0x33e3('0x13')](function(_0x3f32f4){_0x4ec1ff(_0x3f32f4);});};AGIVertices['prototype'][_0x33e3('0x2f')]=function(_0x5cded2,_0x385d14){this[_0x33e3('0xd')]['createSmsMessage'](_0x5cded2)[_0x33e3('0x11')](function(_0x994da6){_0x385d14(null,_0x994da6);})['catch'](function(_0x489e36){_0x385d14(_0x489e36);});};AGIVertices[_0x33e3('0xf')]['createSquareDetailsReport']=function(_0x5c1335,_0x373e30,_0x25b472){this[_0x33e3('0xd')][_0x33e3('0x30')]({'uniqueid':this[_0x33e3('0xc')]['uniqueid'],'node':_0x5c1335['label'],'application':_0x5c1335[_0x33e3('0x31')],'data':_0x373e30||null,'project_name':this[_0x33e3('0xc')][_0x33e3('0x32')],'callerid':this[_0x33e3('0xc')][_0x33e3('0x33')]})[_0x33e3('0x11')](function(_0x53b72a){if(_0x25b472){_0x25b472(null,_0x53b72a);}})[_0x33e3('0x13')](function(_0x4e4d76){if(_0x25b472){_0x25b472(_0x4e4d76);}});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x34')]=function(_0x58743a,_0x362201,_0x2a333b,_0x3504bc){this[_0x33e3('0xd')]['createSquareRecording']({'uniqueid':this[_0x33e3('0xc')][_0x33e3('0x35')],'callerid':this['channel'][_0x33e3('0x33')],'calleridname':this['channel'][_0x33e3('0x36')],'context':this[_0x33e3('0xc')][_0x33e3('0x37')],'extension':this[_0x33e3('0xc')][_0x33e3('0x38')],'priority':this['channel'][_0x33e3('0x39')],'accountcode':this[_0x33e3('0xc')][_0x33e3('0x3a')],'dnid':this[_0x33e3('0xc')][_0x33e3('0x3b')],'projectName':this['channel'][_0x33e3('0x32')],'saveName':_0x362201,'filename':_0x58743a[_0x33e3('0x3c')]||_0x362201,'savePath':_0x2a333b})[_0x33e3('0x11')](function(_0x3b45a6){_0x3504bc(null,_0x3b45a6);})[_0x33e3('0x13')](function(_0x65dcee){_0x3504bc(_0x65dcee);});};AGIVertices['prototype'][_0x33e3('0x3d')]=function(_0x5703c4,_0x9264c,_0x530c3c,_0x266a07,_0x4bb874){this[_0x33e3('0xd')][_0x33e3('0x3d')]({'uniqueid':this['channel'][_0x33e3('0x35')],'body':_0x5703c4,'direction':_0x9264c,'providerName':_0x530c3c,'providerResponse':_0x266a07})[_0x33e3('0x11')](function(_0x221ee5){if(_0x4bb874){_0x4bb874(null,_0x221ee5);}})['catch'](function(_0x4e78d6){if(_0x4bb874){_0x4bb874(_0x4e78d6);}});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x3e')]=function(_0x487ba4,_0x1c8bfe){this[_0x33e3('0xd')][_0x33e3('0x3e')]({'firstName':_[_0x33e3('0x3f')](_0x487ba4[_0x33e3('0x12')])||_[_0x33e3('0x40')](_0x487ba4['name'])?'callback_'+Math['random']():_0x487ba4[_0x33e3('0x12')],'lastName':_['isEmpty'](_0x487ba4['lastName'])||_[_0x33e3('0x40')](_0x487ba4['lastName'])?null:_0x487ba4[_0x33e3('0x41')],'phone':_0x487ba4[_0x33e3('0x42')],'ListId':_0x487ba4['list_id'],'scheduledat':_0x487ba4['scheduledAt'],'callbackUniqueid':this[_0x33e3('0xc')][_0x33e3('0x35')],'tags':_0x33e3('0x43'),'description':'Callback\x20scheduled\x20at\x20'+_0x487ba4[_0x33e3('0x44')][_0x33e3('0x45')](),'priority':_0x487ba4[_0x33e3('0x46')]})[_0x33e3('0x11')](function(_0xdecd65){_0x1c8bfe(null,_0xdecd65);})[_0x33e3('0x13')](function(_0x50085f){_0x1c8bfe(_0x50085f);});};AGIVertices[_0x33e3('0xf')]['getPause']=function(_0x2b4186,_0x56586e){this['rpc'][_0x33e3('0x47')](_0x2b4186)[_0x33e3('0x11')](function(_0x5ce82b){_0x56586e(null,_0x5ce82b?_0x5ce82b['name']:![]);})[_0x33e3('0x13')](function(_0x47c285){_0x56586e(_0x47c285);});};AGIVertices['prototype'][_0x33e3('0x48')]=function(_0x2e499d,_0x2ea80d,_0x2c65b4){var _0x24d0f6={'role':_0x33e3('0x49')};_0x24d0f6[_0x2e499d]=this[_0x33e3('0xc')][_0x33e3('0x33')];this[_0x33e3('0xd')][_0x33e3('0x48')](_0x24d0f6,_0x2ea80d,this[_0x33e3('0xc')][_0x33e3('0x35')])[_0x33e3('0x11')](function(_0xe14c9){_0x2c65b4(null,_[_0x33e3('0x40')](_0xe14c9)?![]:!![]);})[_0x33e3('0x13')](function(_0x2bd864){logger[_0x33e3('0x28')](_0x2bd864);_0x2c65b4(null,![]);});};AGIVertices['prototype'][_0x33e3('0x4a')]=function(_0x571463,_0x33492a){var _0x94ca32={'role':'agent'};_0x94ca32[_0x571463]=this[_0x33e3('0xc')][_0x33e3('0x33')];this[_0x33e3('0xd')]['agentUnpause'](_0x94ca32)['then'](function(_0x5d62c0){_0x33492a(null,_[_0x33e3('0x40')](_0x5d62c0)?![]:!![]);})[_0x33e3('0x13')](function(_0x411953){logger[_0x33e3('0x28')](_0x411953);_0x33492a(null,![]);});};AGIVertices[_0x33e3('0xf')]['agentLogout']=function(_0x4bda42,_0x490636){var _0x205668={'role':_0x33e3('0x49')};_0x205668[_0x4bda42]=this['channel']['callerid'];this[_0x33e3('0xd')][_0x33e3('0x4b')](_0x205668)[_0x33e3('0x11')](function(_0x4a4471){_0x490636(null,_[_0x33e3('0x40')](_0x4a4471)?![]:!![]);})[_0x33e3('0x13')](function(_0x3f52f3){logger[_0x33e3('0x28')](_0x3f52f3);_0x490636(null,![]);});};AGIVertices['prototype'][_0x33e3('0x4c')]=function(_0x3202e2,_0x1e10a4){var _0x29fdb3={'role':_0x33e3('0x49')};_0x29fdb3[_0x3202e2]=this[_0x33e3('0xc')][_0x33e3('0x33')];var _0x34b47f=_0x3202e2!=_0x33e3('0x4d')?util[_0x33e3('0x25')](_0x33e3('0x4e'),_0x33e3('0x4f'),this[_0x33e3('0xc')][_0x33e3('0x33')]):undefined;this[_0x33e3('0xd')]['agentLogin'](_0x29fdb3,_0x34b47f)[_0x33e3('0x11')](function(_0x3946fa){_0x1e10a4(null,_[_0x33e3('0x40')](_0x3946fa)?![]:!![]);})[_0x33e3('0x13')](function(_0x1c011a){logger['error'](_0x1c011a);_0x1e10a4(null,![]);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x50')]=function(_0x27420a,_0x396629){sh[_0x33e3('0x51')](_[_0x33e3('0x52')](_0x27420a),function(_0x50e8d4,_0x219c7b){var _0x5e5711=_0x219c7b[_0x33e3('0x53')](/(\r\n|\n|\r)/gm,'');_0x396629(null,_0x5e5711);});};AGIVertices['prototype'][_0x33e3('0x54')]=function(_0x2adbe0,_0x377745){scripts[_0x33e3('0x54')](_0x2adbe0[_0x33e3('0x55')],_0x2adbe0[_0x33e3('0x56')]||'text',_0x2adbe0[_0x33e3('0x57')],_0x2adbe0[_0x33e3('0x58')]||_0x33e3('0x59'),_0x2adbe0[_0x33e3('0x5a')]||_0x33e3('0x5b'),_0x2adbe0[_0x33e3('0x5c')]||_0x33e3('0x5d'))[_0x33e3('0x11')](function(_0x54ccb5){_0x377745(null,_0x54ccb5);})[_0x33e3('0x13')](function(_0x53a40d){_0x377745(_0x53a40d);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x5e')]=function(_0x4ee6cd,_0x51f5e6){scripts[_0x33e3('0x5e')](_0x4ee6cd['text'],_0x4ee6cd[_0x33e3('0x5f')]||'en',0x1)[_0x33e3('0x11')](function(_0x3afb79){_0x51f5e6(null,_0x3afb79);})['catch'](function(_0x283e0b){_0x51f5e6(_0x283e0b);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x60')]=function(_0x6212c5,_0x4cb3a4){var _0x548c1f={'uri':_0x6212c5[_0x33e3('0x61')],'method':_0x6212c5[_0x33e3('0x62')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x6212c5[_0x33e3('0x63')])===_0x33e3('0x64')&&parseInt(_0x6212c5[_0x33e3('0x63')])>=0x1?parseInt(_0x6212c5[_0x33e3('0x63')])*0x3e8:0x5*0x3e8};if(_[_0x33e3('0x65')]([_0x33e3('0x66'),_0x33e3('0x67')],_0x548c1f[_0x33e3('0x62')][_0x33e3('0x68')]())){try{_0x548c1f[_0x33e3('0x69')]=_0x6212c5[_0x33e3('0x8')]?JSON['parse'](_0x6212c5['rawBody']):{};}catch(_0xd8756a){logger[_0x33e3('0x28')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0xd8756a);}}try{_0x548c1f[_0x33e3('0x6a')]=_0x6212c5[_0x33e3('0x7')]?JSON[_0x33e3('0x6b')](_0x6212c5[_0x33e3('0x7')]):{};}catch(_0x101c1f){logger['error'](_0x33e3('0x6c'),_0x101c1f);}if(_0x6212c5[_0x33e3('0x6d')]){try{var _0x3b32d8=require(_0x6212c5[_0x33e3('0x6d')])[_0x33e3('0x6e')](this,_0x548c1f);_0x548c1f[_0x33e3('0x6f')]=Mustache[_0x33e3('0x70')](_0x6212c5[_0x33e3('0x61')],_0x3b32d8,{},['$$','$$']);if(_0x548c1f[_0x33e3('0x6a')]){_0x548c1f[_0x33e3('0x6a')]=JSON['parse'](Mustache[_0x33e3('0x70')](JSON[_0x33e3('0x71')](_0x548c1f['headers']),_0x3b32d8,{},['$$','$$']));}if(_0x548c1f['body']){_0x548c1f[_0x33e3('0x69')]=JSON['parse'](Mustache[_0x33e3('0x70')](JSON[_0x33e3('0x71')](_0x548c1f[_0x33e3('0x69')]),_0x3b32d8,{},['$$','$$']));}}catch(_0x56b493){logger[_0x33e3('0x28')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x56b493);}}rp(_0x548c1f)[_0x33e3('0x11')](function(_0x234810){var _0x1ce6ca={'statusCode':_0x234810[_0x33e3('0x72')]||0xc8,'statusMessage':_0x234810[_0x33e3('0x73')]||'OK','headers':_0x234810[_0x33e3('0x6a')]||{},'body':_0x234810[_0x33e3('0x69')]||{}};_0x4cb3a4(null,_0x1ce6ca);})[_0x33e3('0x13')](function(_0x1463c6){var _0x3d21e7={'statusCode':_0x1463c6['statusCode']||0x1f4,'statusMessage':_0x1463c6[_0x33e3('0x74')]||_0x33e3('0x75'),'headers':_0x1463c6['options']['headers']||{},'body':_0x1463c6[_0x33e3('0x76')]['body']||{}};_0x4cb3a4(null,_0x3d21e7);});};AGIVertices[_0x33e3('0xf')]['googleDialogflow']=function(_0x186835,_0x394c20){scripts['googleDialogflow'](this['channel'][_0x33e3('0x35')],_0x186835['key'],_0x186835[_0x33e3('0x57')],_0x186835['dialogflow_language']||'en')['then'](function(_0x2b4ed3){_0x394c20(null,_0x2b4ed3);})[_0x33e3('0x13')](function(_0x1eb911){_0x394c20(_0x1eb911);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x102f54,_0x98fd16){scripts[_0x33e3('0x77')](this[_0x33e3('0xc')][_0x33e3('0x35')],_0x102f54[_0x33e3('0x78')],_0x102f54[_0x33e3('0x79')],_0x102f54[_0x33e3('0x7a')],_0x102f54[_0x33e3('0x57')],_0x102f54['dialogflowV2_language']||'en')['then'](function(_0x3cfa26){_0x98fd16(null,_0x3cfa26);})[_0x33e3('0x13')](function(_0x162f2a){_0x98fd16(_0x162f2a);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x7b')]=function(_0x135319,_0x506840){scripts[_0x33e3('0x7b')](this[_0x33e3('0xc')],_0x135319)[_0x33e3('0x11')](function(_0x3ab97b){_0x506840(null,_0x3ab97b);})['catch'](function(_0x41c2a7){_0x506840(_0x41c2a7);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x7c')]=function(_0x24f044,_0x1b27e1){scripts[_0x33e3('0x7c')](_0x24f044['key'],_0x24f044[_0x33e3('0x57')],_0x24f044[_0x33e3('0x7d')]||_0x33e3('0x59'),_0x24f044['speed'])[_0x33e3('0x11')](function(_0x5200b5){_0x1b27e1(null,_0x5200b5);})[_0x33e3('0x13')](function(_0x2562dd){_0x1b27e1(_0x2562dd);});};AGIVertices['prototype'][_0x33e3('0x7e')]=function(_0x3430dd,_0x5d858c,_0x41943d){scripts[_0x33e3('0x7e')](_0x5d858c,_0x3430dd[_0x33e3('0x7f')],_0x3430dd[_0x33e3('0x80')]||_0x33e3('0x59'),this['isConfigured'](_0x3430dd[_0x33e3('0x81')])?_0x3430dd[_0x33e3('0x81')]:undefined)[_0x33e3('0x11')](function(_0x3af4c3){_0x41943d(null,_0x3af4c3);})[_0x33e3('0x13')](function(_0x50d2bb){_0x41943d(_0x50d2bb);});};AGIVertices['prototype'][_0x33e3('0x82')]=function(_0x400c41,_0x3fa7d3){scripts[_0x33e3('0x82')](_0x400c41[_0x33e3('0x83')],_0x400c41[_0x33e3('0x84')],_0x400c41[_0x33e3('0x85')],_0x400c41['aws_polly_voice']||_0x33e3('0x86'),_0x400c41[_0x33e3('0x57')],_0x400c41[_0x33e3('0x87')]||_0x33e3('0x57'))[_0x33e3('0x11')](function(_0x147d04){_0x3fa7d3(null,_0x147d04);})[_0x33e3('0x13')](function(_0x492ef1){_0x3fa7d3(_0x492ef1);});};AGIVertices['prototype'][_0x33e3('0x88')]=function(_0x3430ad,_0xb0f4aa){scripts['awsLex'](this[_0x33e3('0xc')][_0x33e3('0x35')],_0x3430ad[_0x33e3('0x83')],_0x3430ad[_0x33e3('0x84')],_0x3430ad['aws_lex_region'],_0x3430ad[_0x33e3('0x57')],_0x3430ad[_0x33e3('0x89')])['then'](function(_0x43ea55){_0xb0f4aa(null,_0x43ea55);})[_0x33e3('0x13')](function(_0x409b4e){_0xb0f4aa(_0x409b4e);});};AGIVertices[_0x33e3('0xf')][_0x33e3('0x8a')]=function(_0x3a80c9,_0x5f4a5d,_0x210794){scripts[_0x33e3('0x8a')](_0x5f4a5d,_0x3a80c9[_0x33e3('0x7f')],_0x3a80c9[_0x33e3('0x8b')]||_0x33e3('0x59'))['then'](function(_0x1fe981){_0x210794(null,_0x1fe981);})['catch'](function(_0x341f73){_0x210794(_0x341f73);});};AGIVertices['prototype'][_0x33e3('0x8c')]=function(_0x19b46f,_0x1be810,_0x530f57){scripts['tildeASR'](_0x1be810,_0x19b46f[_0x33e3('0x8d')],_0x19b46f[_0x33e3('0x8e')],_0x19b46f['uri'])[_0x33e3('0x11')](function(_0x1a0f57){_0x530f57(null,_0x1a0f57);})[_0x33e3('0x13')](function(_0x367ae9){_0x530f57(_0x367ae9);});};AGIVertices['prototype'][_0x33e3('0x8f')]=function(_0x3a3cfe){var _0x1486c0=_['includes'](verticesWithRetry,_0x3a3cfe[_0x33e3('0x31')])?_0x3a3cfe:_[_0x33e3('0x90')](_0x3a3cfe);for(var _0x381f54 in _0x1486c0){if(_0x1486c0[_0x33e3('0x91')](_0x381f54)){if(_0x1486c0[_0x381f54]&&_[_0x33e3('0x92')](_0x1486c0[_0x381f54])){if(_[_0x33e3('0x65')](recursiveMapAttributes,_0x381f54)){_0x1486c0[_0x381f54]=this[_0x33e3('0x93')](_0x1486c0[_0x381f54]);}else{_0x1486c0[_0x381f54]=this['replaceAllVariables'](_0x1486c0[_0x381f54]);}}}}return _0x1486c0;};AGIVertices[_0x33e3('0xf')][_0x33e3('0x94')]=function(_0x253864){for(var _0xc5b9dd in _0x253864){if(_0x253864['hasOwnProperty'](_0xc5b9dd)){if(_[_0x33e3('0x95')](_0x253864[_0xc5b9dd])){this['recursiveNodeIndex'](_0x253864[_0xc5b9dd]);}else if(_['isArray'](_0x253864[_0xc5b9dd])){for(var _0x182238=0x0;_0x182238<_0x253864[_0xc5b9dd][_0x33e3('0x96')];_0x182238++){this['recursiveNodeIndex'](_0x253864[_0xc5b9dd][_0x182238]);}}else if(_[_0x33e3('0x92')](_0x253864[_0xc5b9dd])){_0x253864[_0xc5b9dd]=this[_0x33e3('0x97')](_0x253864[_0xc5b9dd]);}}}};AGIVertices[_0x33e3('0xf')]['saveRestApiResult']=function(_0x388b4a,_0x21366c){for(var _0x4ab59c in _0x388b4a){if(_0x388b4a[_0x33e3('0x91')](_0x4ab59c)){if(_['isPlainObject'](_0x388b4a[_0x4ab59c])){if(!_[_0x33e3('0x3f')](_0x388b4a[_0x4ab59c])){this[_0x33e3('0x98')](_0x388b4a[_0x4ab59c],util[_0x33e3('0x25')](_0x33e3('0x99'),_0x21366c,_0x4ab59c));}}else if(_[_0x33e3('0x9a')](_0x388b4a[_0x4ab59c])){for(var _0x1b13a5=0x0;_0x1b13a5<_0x388b4a[_0x4ab59c]['length'];_0x1b13a5++){this['saveRestApiResult'](_0x388b4a[_0x4ab59c][_0x1b13a5],util[_0x33e3('0x25')](_0x33e3('0x99'),_0x21366c,_0x4ab59c+'['+_0x1b13a5+']'));}}else{if(!_[_0x33e3('0x40')](_0x388b4a[_0x4ab59c])){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x99'),_0x21366c,_0x4ab59c),_0x388b4a[_0x4ab59c]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x553563){try{var _0x2dafe5=JSON[_0x33e3('0x6b')](_0x553563);this[_0x33e3('0x94')](_0x2dafe5);return JSON['stringify'](_0x2dafe5);}catch(_0x4b792b){return this[_0x33e3('0x97')](_0x553563);}};AGIVertices[_0x33e3('0xf')]['replaceAllVariables']=function(_0x101bad){var _0x53a4f8=_0x101bad[_0x33e3('0x9c')]('{');for(var _0x3f6743=0x1;_0x3f6743<_0x53a4f8[_0x33e3('0x96')];_0x3f6743+=0x1){var _0x4cd9f1=_0x53a4f8[_0x3f6743]['split']('}');if(_0x4cd9f1[_0x33e3('0x96')]>0x1){_0x101bad=_0x101bad[_0x33e3('0x9d')]('{'+_0x4cd9f1[0x0]+'}',this['channel'][_0x33e3('0x10')](_0x4cd9f1[0x0])[_0x33e3('0x9e')]||_0x4cd9f1[0x0]);}}if(_0x53a4f8['length']===0x1){return _0x101bad['toString']();}return this[_0x33e3('0x97')](_0x101bad);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x9f')]=function(_0x5961d5,_0x5729a2){var _0x572da3=this[_0x33e3('0xc')][_0x33e3('0x10')](_0x5961d5);if(_0x572da3[_0x33e3('0xa0')]===-0x1){return _0x572da3;}logger['info'](util['format'](_0x33e3('0xa1'),_0x5729a2,_0x572da3['extra']));return this['channel'][_0x33e3('0x9b')](_0x5729a2,_0x572da3[_0x33e3('0x9e')]);};AGIVertices['prototype'][_0x33e3('0xa2')]=function(_0x28326d){return _0x28326d&&_0x28326d!=='0'&&_0x28326d!=='-1'&&_0x28326d!=='';};AGIVertices[_0x33e3('0xf')][_0x33e3('0xa3')]=function(_0x23cf20){this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x23cf20,'-');_0x23cf20[_0x33e3('0xa4')]=_0x23cf20[_0x33e3('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x33e3('0xa5')]=function(_0x78d8b){logger['info'](util['format'](_0x33e3('0xa6'),_0x78d8b['label']));if(!this[_0x33e3('0xa2')](_0x78d8b[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}var _0x1122ce='\x22'+_0x78d8b[_0x33e3('0x57')]+'\x22';if(this[_0x33e3('0xa2')](_0x78d8b[_0x33e3('0x76')])){_0x1122ce+=','+_0x78d8b[_0x33e3('0x76')];}var _0x21d43a=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xa9'),_0x1122ce);if(_0x21d43a[_0x33e3('0xa0')]===-0x1){return _0x21d43a;}return this['channel']['noop'](util[_0x33e3('0x25')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1122ce));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xaa')]=function(_0x25e276){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xab'),_0x25e276[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x25e276[_0x33e3('0xad')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20grammar\x20configured');}var _0x29192f=_0x25e276[_0x33e3('0xad')];if(this[_0x33e3('0xa2')](_0x25e276[_0x33e3('0x76')])){_0x29192f+=','+_0x25e276['options'];}var _0x6cd7e0=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xae'),_0x29192f);if(_0x6cd7e0['result']===-0x1){return _0x6cd7e0;}var _0xb729e3=this[_0x33e3('0x9f')](_0x33e3('0xaf'),'MRCP_RECOG_CONFIDENCE');if(_0xb729e3[_0x33e3('0xa0')]===-0x1){return _0xb729e3;}var _0x1c276f=this[_0x33e3('0x9f')](_0x33e3('0xb0'),_0x33e3('0xb1'));if(_0x1c276f[_0x33e3('0xa0')]===-0x1){return _0x1c276f;}var _0x51d310=this[_0x33e3('0x9f')](_0x33e3('0xb2'),_0x33e3('0xb3'));if(_0x51d310['result']===-0x1){return _0x51d310;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('Executed\x20command\x20MRCPRecog\x20%s',_0x29192f));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xb4')]=function(_0xc476df){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xb5'),_0xc476df[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0xb4')]([_0xc476df[_0x33e3('0xb6')],_0xc476df[_0x33e3('0xb7')]]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0xb8')]=function(_0x1bbd5a){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x1bbd5a[_0x33e3('0xac')]));if(this['isConfigured'](_0x1bbd5a[_0x33e3('0x63')])){logger['info'](util[_0x33e3('0x25')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1bbd5a[_0x33e3('0x63')]));var _0x10cd68=this[_0x33e3('0xc')][_0x33e3('0xb9')](_0x1bbd5a[_0x33e3('0x63')]);if(_0x10cd68['result']===-0x1){return _0x10cd68;}}return this['channel'][_0x33e3('0xb8')]();};AGIVertices[_0x33e3('0xf')][_0x33e3('0x43')]=function(_0x2a1ade){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xba'),_0x2a1ade[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x2a1ade[_0x33e3('0xbb')])){return this[_0x33e3('0xc')]['error'](_0x2a1ade,_0x33e3('0xbc'));}_0x2a1ade[_0x33e3('0x44')]=moment();if(this[_0x33e3('0xa2')](_0x2a1ade['delay'])){_0x2a1ade[_0x33e3('0x44')]=moment()[_0x33e3('0xbd')](_0x2a1ade[_0x33e3('0xbe')],_0x33e3('0xbf'));}if(!this[_0x33e3('0xa2')](_0x2a1ade['callback_priority'])){_0x2a1ade[_0x33e3('0x46')]=0x2;}this[_0x33e3('0x3e')]['sync'](this,_0x2a1ade);return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xc0'),_0x2a1ade['phone'],_0x2a1ade[_0x33e3('0xbb')],_0x2a1ade[_0x33e3('0x44')]));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xc1')]=function(_0xce29f2){logger['info'](util[_0x33e3('0x25')](_0x33e3('0xc2'),_0xce29f2['label']));var _0x2b2759=this['channel'][_0x33e3('0x51')](_0xce29f2[_0x33e3('0xc3')],_0xce29f2[_0x33e3('0x76')]);if(_0x2b2759['result']===-0x1){return _0x2b2759;}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0xce29f2[_0x33e3('0xc3')],_0xce29f2[_0x33e3('0x76')]));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xc5')]=function(_0x3f3c86){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3f3c86[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x3f3c86[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}var _0x500220='\x22'+_0x3f3c86[_0x33e3('0x57')]+'\x22';if(this[_0x33e3('0xa2')](_0x3f3c86[_0x33e3('0x76')])){_0x500220+=','+_0x3f3c86['options'];}var _0x201c6a=this['channel'][_0x33e3('0x51')]('MRCPSynth',_0x500220);if(_0x201c6a[_0x33e3('0xa0')]===-0x1){return _0x201c6a;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0xc6'),_0x500220));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xc7')]=function(_0x260f07){logger['info'](util[_0x33e3('0x25')](_0x33e3('0xc8'),_0x260f07[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x260f07[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}var _0x36d230='\x22'+_0x260f07[_0x33e3('0x57')]+'\x22';if(this[_0x33e3('0xa2')](_0x260f07[_0x33e3('0x76')])){_0x36d230+=','+_0x260f07[_0x33e3('0x76')];}var _0x498726=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xa9'),_0x36d230);if(_0x498726[_0x33e3('0xa0')]===-0x1){return _0x498726;}return this[_0x33e3('0xc')]['noop'](util['format'](_0x33e3('0xc6'),_0x36d230));};AGIVertices[_0x33e3('0xf')]['lumenvoxasr']=function(_0x17dec3){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0xc9'),_0x17dec3[_0x33e3('0xac')]));if(!this['isConfigured'](_0x17dec3['grammar'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20grammar\x20configured');}var _0x1d4128=_0x17dec3['grammar'];if(this[_0x33e3('0xa2')](_0x17dec3[_0x33e3('0x76')])){_0x1d4128+=','+_0x17dec3[_0x33e3('0x76')];}var _0x3d06de=this['channel'][_0x33e3('0x51')](_0x33e3('0xae'),_0x1d4128);if(_0x3d06de['result']===-0x1){return _0x3d06de;}var _0x29bcc8=this['getAndSetVariable'](_0x33e3('0xaf'),_0x33e3('0xca'));if(_0x29bcc8[_0x33e3('0xa0')]===-0x1){return _0x29bcc8;}var _0x223a80=this['getAndSetVariable']('RECOG_INPUT()',_0x33e3('0xcb'));if(_0x223a80[_0x33e3('0xa0')]===-0x1){return _0x223a80;}var _0x29a8b4=this[_0x33e3('0x9f')](_0x33e3('0xb2'),_0x33e3('0xcc'));if(_0x29a8b4[_0x33e3('0xa0')]===-0x1){return _0x29a8b4;}return this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0xcd'),_0x1d4128));};AGIVertices[_0x33e3('0xf')]['sestekasr']=function(_0x5376bf){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5376bf[_0x33e3('0xac')]));if(!this['isConfigured'](_0x5376bf[_0x33e3('0xad')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0xce'));}var _0x2e2d09=_0x5376bf['grammar'];if(this[_0x33e3('0xa2')](_0x5376bf[_0x33e3('0x76')])){_0x2e2d09+=','+_0x5376bf['options'];}var _0x4d71f4=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0xae'),_0x2e2d09);if(_0x4d71f4[_0x33e3('0xa0')]===-0x1){return _0x4d71f4;}var _0xf79cfa=this[_0x33e3('0x9f')](_0x33e3('0xaf'),_0x33e3('0xcf'));if(_0xf79cfa[_0x33e3('0xa0')]===-0x1){return _0xf79cfa;}var _0x1667fb=this['getAndSetVariable'](_0x33e3('0xb0'),'SESTEK_ASR_TRANSCRIPT');if(_0x1667fb[_0x33e3('0xa0')]===-0x1){return _0x1667fb;}var _0x16813e=this[_0x33e3('0x9f')](_0x33e3('0xb2'),_0x33e3('0xd0'));if(_0x16813e[_0x33e3('0xa0')]===-0x1){return _0x16813e;}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xcd'),_0x2e2d09));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xd1')]=function(_0x40a252){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0xd2'),_0x40a252[_0x33e3('0xac')]));if(!this['isConfigured'](_0x40a252[_0x33e3('0xd3')])){return this['channel'][_0x33e3('0x28')](_0x40a252,_0x33e3('0xd4'));}var _0x4c2610=this[_0x33e3('0x15')][_0x33e3('0x6e')](this,_0x40a252[_0x33e3('0xd3')]);if(!_0x4c2610){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x40a252,_0x33e3('0xd5'));}if(!this[_0x33e3('0xa2')](_0x40a252[_0x33e3('0xd6')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x40a252,'no\x20query\x20configured');}var _0x3619ff=_0x40a252[_0x33e3('0xd6')][_0x33e3('0x53')](/(\r\n|\n|\r)/gm,'\x20');this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0xd7'),_0x3619ff));var _0x5c34f3=this[_0x33e3('0x26')]['sync'](this,_0x4c2610,_0x3619ff);this['createSquareDetailsReport'][_0x33e3('0x6e')](this,_0x40a252,_0x3619ff);if(!this[_0x33e3('0xa2')](_0x40a252[_0x33e3('0xd8')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xd9'));}var _0x48c02f=this['getVariable'][_0x33e3('0x6e')](this,_0x40a252[_0x33e3('0xd8')]);if(!_0x48c02f){return this['channel'][_0x33e3('0x28')](_0x40a252,_0x33e3('0xda'));}var _0x4d380f=this;_0x5c34f3[_0x33e3('0xdb')](function(_0x2df9a1,_0x23f8fb){Object[_0x33e3('0xdc')](_0x2df9a1)[_0x33e3('0xdb')](function(_0x276b45){_0x4d380f[_0x33e3('0xc')][_0x33e3('0x9b')](util['format'](_0x33e3('0xdd'),_0x48c02f,_0x23f8fb,_0x276b45),_0x2df9a1[_0x276b45]);});});this[_0x33e3('0xc')][_0x33e3('0x9b')](util['format']('%s_ROWS_COUNT',_0x48c02f),_0x5c34f3['length']);return this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0xde'),_0x48c02f));};AGIVertices[_0x33e3('0xf')]['dial']=function(_0xdd5f3d){logger[_0x33e3('0xdf')](util[_0x33e3('0x25')](_0x33e3('0xe0'),_0xdd5f3d[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0xdd5f3d['sip_id'])){return this['channel'][_0x33e3('0x28')](_0xdd5f3d,_0x33e3('0xe1'));}var _0x4bd74d=this['getUser']['sync'](this,_0xdd5f3d[_0x33e3('0xe2')]);if(!_0x4bd74d){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0xdd5f3d,_0x33e3('0xe3'));}var _0x31bab9=this['channel'][_0x33e3('0x51')]('DIAL',[util[_0x33e3('0x25')](_0x33e3('0xe4'),_0x4bd74d),_0xdd5f3d[_0x33e3('0x63')],_0xdd5f3d[_0x33e3('0xe5')],_0xdd5f3d[_0x33e3('0x61')]]);if(_0x31bab9[_0x33e3('0xa0')]===-0x1){return _0x31bab9;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xe6'),_0x33e3('0xe7')));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xe8')]=function(_0x603761){logger['info'](util[_0x33e3('0x25')](_0x33e3('0xe9'),_0x603761['label']));if(!this[_0x33e3('0xa2')](_0x603761[_0x33e3('0x7f')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xea'));}if(!this[_0x33e3('0xa2')](_0x603761[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20text\x20configured');}this['channel'][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x603761);this[_0x33e3('0x3d')](_0x603761[_0x33e3('0x57')],'in','','');this['channel']['noop'](util[_0x33e3('0x25')](_0x33e3('0xec'),_0x603761[_0x33e3('0x57')]));var _0x1f0000=this[_0x33e3('0xed')][_0x33e3('0x6e')](this,_0x603761);if(_0x1f0000){for(var _0x30fd54 in _0x1f0000){if(_0x1f0000[_0x33e3('0x91')](_0x30fd54)){this[_0x33e3('0xc')]['setVariable'](util[_0x33e3('0x25')]('DIALOGFLOW_%s',_0x30fd54[_0x33e3('0x68')]()),_0x1f0000[_0x30fd54]);}}this['createSquareMessage'](_0x1f0000[_0x33e3('0xee')],_0x33e3('0xef'),_0x33e3('0xe8'),'');return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xf0'),_0x1f0000[_0x33e3('0xee')]));}return this['channel'][_0x33e3('0x28')](_0x603761,_0x33e3('0xf1'));};AGIVertices['prototype'][_0x33e3('0xf2')]=function(_0x250357){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0xf3'),_0x250357[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x78')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xf4'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x79')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xf5'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x7a')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xf6'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0xf7')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0xf8'));}if(!this[_0x33e3('0xa2')](_0x250357[_0x33e3('0x57')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xa8'));}this['channel'][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x250357);this['createSquareMessage'](_0x250357[_0x33e3('0x57')],'in','','');this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xf9'),_0x250357[_0x33e3('0x57')]));var _0x4be6c5=this['googleDialogflowV2'][_0x33e3('0x6e')](this,_0x250357);if(_0x4be6c5){for(var _0x2ff1f6 in _0x4be6c5){if(_0x4be6c5[_0x33e3('0x91')](_0x2ff1f6)){if(_0x2ff1f6!=='providerResponse'){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0xfa'),_0x2ff1f6[_0x33e3('0x68')]()),_0x4be6c5[_0x2ff1f6]);}}}this[_0x33e3('0x3d')](_0x4be6c5[_0x33e3('0xee')],_0x33e3('0xef'),_0x33e3('0xf2'),_0x4be6c5[_0x33e3('0xfb')]);return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xfc'),_0x4be6c5[_0x33e3('0xee')]));}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x250357,_0x33e3('0xfd'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xfe')]=function(_0x1fed95){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x1fed95['label']));if(!this['isConfigured'](_0x1fed95[_0x33e3('0xff')])){return this['channel']['noop'](_0x33e3('0x100'));}if(!this[_0x33e3('0xa2')](_0x1fed95['username'])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0x101'));}if(!this[_0x33e3('0xa2')](_0x1fed95[_0x33e3('0x102')])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0x103'));}if(!this['isConfigured'](_0x1fed95[_0x33e3('0x104')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20text\x20configured');}this[_0x33e3('0xc')][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x1fed95);this[_0x33e3('0x3d')](_0x1fed95[_0x33e3('0x57')],'in','','');this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x105'),_0x1fed95['text']));var _0x7b8b6d=this[_0x33e3('0x7b')][_0x33e3('0x6e')](this,_0x1fed95);if(_0x7b8b6d){for(var _0x1613c9 in _0x7b8b6d){if(_0x7b8b6d['hasOwnProperty'](_0x1613c9)){this[_0x33e3('0xc')][_0x33e3('0x9b')](util['format'](_0x33e3('0x106'),_0x1613c9[_0x33e3('0x68')]()),_0x7b8b6d[_0x1613c9]);}}this['createSquareMessage'](_0x7b8b6d[_0x33e3('0xee')],'out',_0x33e3('0xfe'),'');if(_0x7b8b6d[_0x33e3('0x107')]){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x7b8b6d[_0x33e3('0x107')]));var _0xa8b0b4=this['channel']['streamFile'](_0x7b8b6d['audiofile']);try{fs[_0x33e3('0x108')](_0x7b8b6d[_0x33e3('0x107')]+_0x33e3('0x109'));}catch(_0x54828f){logger[_0x33e3('0x28')](_0x54828f);}return _0xa8b0b4;}else{return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x10a'),_0x7b8b6d['speech']));}}return this[_0x33e3('0xc')]['error'](_0x1fed95,_0x33e3('0x10b'));};AGIVertices['prototype'][_0x33e3('0x10c')]=function(_0x3858a1){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x10d'),_0x3858a1[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x10c'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x10e')]=function(_0x102ecb){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x102ecb[_0x33e3('0xac')]));var _0x1708ad='';if(_0x102ecb['trunk_id']){if(!this[_0x33e3('0xa2')](_0x102ecb['trunk_id'])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x102ecb,_0x33e3('0x10f'));}else{var _0x48ced6=parseInt(_0x102ecb[_0x33e3('0x110')],0xa);if(isNaN(_0x48ced6)){_0x1708ad=_0x102ecb['trunk_id'];}else{_0x1708ad=this[_0x33e3('0x18')][_0x33e3('0x6e')](this,_0x102ecb[_0x33e3('0x110')]);if(!_0x1708ad){return this['channel'][_0x33e3('0x28')](_0x102ecb,_0x33e3('0x111'));}}}}else if(_0x102ecb[_0x33e3('0x112')]){_0x1708ad=_0x102ecb[_0x33e3('0x112')];}else{return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x102ecb,_0x33e3('0x10f'));}var _0x91552b=this[_0x33e3('0xc')]['exec']('DIAL',[util['format'](_0x33e3('0x113'),_0x1708ad,_0x102ecb[_0x33e3('0x42')]),_0x102ecb[_0x33e3('0x63')],_0x102ecb[_0x33e3('0xe5')],_0x102ecb[_0x33e3('0x61')]]);if(_0x91552b[_0x33e3('0xa0')]===-0x1){return _0x91552b;}return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xe6'),'DIAL'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x114')]=function(_0x2b1f78){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x115'),_0x2b1f78[_0x33e3('0xac')]));return this['channel'][_0x33e3('0xa7')](_0x33e3('0x114'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0xa')]=function(_0x3cf689){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x116'),_0x3cf689[_0x33e3('0xac')]));if(_0x3cf689['retry']===0x0){return this[_0x33e3('0xa3')](_0x3cf689);}_0x3cf689['retry']-=0x1;if(!this['isConfigured'](_0x3cf689[_0x33e3('0x117')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x3cf689,_0x33e3('0x118'));}var _0x2c03dc=this[_0x33e3('0x1a')][_0x33e3('0x6e')](this,_0x3cf689[_0x33e3('0x117')]);if(!_0x2c03dc){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x3cf689,'no\x20file\x20audio\x20found');}if(!this[_0x33e3('0xa2')](_0x3cf689[_0x33e3('0xd8')])){return this['channel']['error'](_0x33e3('0xd9'));}var _0xbd625a=this['channel'][_0x33e3('0x119')](_0x2c03dc,_0x3cf689['response'],_0x3cf689[_0x33e3('0x11a')]);var _0x1aed1a=_0xbd625a[_0x33e3('0xa0')]?_0xbd625a[_0x33e3('0xa0')][_0x33e3('0x45')]():'';logger[_0x33e3('0x2a')](_0x33e3('0x11b'),JSON[_0x33e3('0x71')](_0xbd625a));if(_0xbd625a[_0x33e3('0xa0')]===-0x1){this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x3cf689,_0x1aed1a);return _0xbd625a;}else if(_0xbd625a[_0x33e3('0x9e')]==='timeout'){_0xbd625a[_0x33e3('0xa0')]=_0x1aed1a[_0x33e3('0x96')]>=parseInt(_0x3cf689[_0x33e3('0x11c')])?'x':'i';}else{_0xbd625a[_0x33e3('0xa0')]=_0x1aed1a[_0x33e3('0x96')]>=parseInt(_0x3cf689[_0x33e3('0x11c')])&&_0x1aed1a['length']<=parseInt(_0x3cf689['maxdigit'])?'x':'i';}var _0x351710=this['getVariable']['sync'](this,_0x3cf689[_0x33e3('0xd8')]);if(!_0x351710){return this[_0x33e3('0xc')]['error'](_0x3cf689,_0x33e3('0xda'));}this['channel'][_0x33e3('0x9b')](_0x351710,_0x1aed1a);if(this['isConfigured'](_0x3cf689[_0x33e3('0x11d')])){var _0x3dd91e=parseInt(_0x3cf689[_0x33e3('0x11d')],0xa);var _0x3e3116=rs['generate']({'charset':'*','length':_0x3dd91e});var _0x51e262=_0x1aed1a[_0x33e3('0x96')];if(_0x51e262>0x0){if(_0x51e262>_0x3dd91e){this['createSquareDetailsReport'][_0x33e3('0x6e')](this,_0x3cf689,_0x3cf689['hiddendigitspos']===_0x33e3('0x11e')?_0x3e3116+_0x1aed1a[_0x33e3('0x11f')](_0x3dd91e):_0x1aed1a[_0x33e3('0x11f')](0x0,_0x51e262-_0x3dd91e)+_0x3e3116);}else{this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x3cf689,rs[_0x33e3('0x120')]({'charset':'*','length':_0x51e262}));}}else{this['createSquareDetailsReport']['sync'](this,_0x3cf689,'');}}else{this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x3cf689,_0x1aed1a);}return _0xbd625a;};AGIVertices['prototype'][_0x33e3('0xb')]=function(_0x2711eb){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x121'),_0x2711eb['label']));return this[_0x33e3('0xa')](_0x2711eb);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x122')]=function(_0x53b1cd){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x123'),_0x53b1cd['label']));this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x53b1cd,_0x53b1cd[_0x33e3('0x124')]);return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('GOAL\x20%s',_0x53b1cd[_0x33e3('0x124')]));};AGIVertices['prototype'][_0x33e3('0x125')]=function(_0x1f003e){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x1f003e['label']));if(!this[_0x33e3('0xa2')](_0x1f003e[_0x33e3('0x83')])||!this[_0x33e3('0xa2')](_0x1f003e[_0x33e3('0x84')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x33e3('0xa2')](_0x1f003e[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x126'),_0x1f003e[_0x33e3('0x57')]));var _0x290f0b=this[_0x33e3('0x82')][_0x33e3('0x6e')](this,_0x1f003e);if(_0x290f0b){this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format'](_0x33e3('0x127'),_0x290f0b));var _0x2cd8d5=this[_0x33e3('0xc')][_0x33e3('0x128')](_0x290f0b);try{fs['unlink'](_0x290f0b+'.wav');}catch(_0x16272f){logger[_0x33e3('0x28')](_0x16272f);}return _0x2cd8d5;}return this[_0x33e3('0xc')]['error'](_0x1f003e,_0x33e3('0x129'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x12a')]=function(_0x8cbe34){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x12b'),_0x8cbe34[_0x33e3('0xac')]));if(!this['isConfigured'](_0x8cbe34[_0x33e3('0x83')])||!this[_0x33e3('0xa2')](_0x8cbe34[_0x33e3('0x84')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x12c'));}if(!this[_0x33e3('0xa2')](_0x8cbe34[_0x33e3('0x89')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0x12d'));}if(!this[_0x33e3('0xa2')](_0x8cbe34[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this[_0x33e3('0xc')][_0x33e3('0xeb')]=!![];this[_0x33e3('0x30')](_0x8cbe34);this[_0x33e3('0x3d')](_0x8cbe34['text'],'in','','');this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('Trying\x20Amazon\x20Lex:\x20%s',_0x8cbe34['text']));var _0x6b3025=this[_0x33e3('0x88')][_0x33e3('0x6e')](this,_0x8cbe34);if(_0x6b3025){for(var _0x1ef744 in _0x6b3025){if(_0x6b3025[_0x33e3('0x91')](_0x1ef744)&&_[_0x33e3('0x92')](_0x6b3025[_0x1ef744])){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')]('AWS_LEX_%s',_0x1ef744[_0x33e3('0x68')]()),_0x6b3025[_0x1ef744]);}}if(_[_0x33e3('0x40')](_0x6b3025[_0x33e3('0x74')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x12e'));}else{this[_0x33e3('0x3d')](_0x6b3025[_0x33e3('0x74')],_0x33e3('0xef'),_0x33e3('0x12f'),'');return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x130'),_0x6b3025[_0x33e3('0x74')]));}}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x8cbe34,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x33e3('0xf')][_0x33e3('0x131')]=function(_0x56e3e6){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x132'),_0x56e3e6['label'],_0x56e3e6[_0x33e3('0x63')]));if(!this[_0x33e3('0xa2')](_0x56e3e6['key'])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xea'));}var _0x534280='wav';var _0x426d82=util['format'](_0x33e3('0x133'),FILES_PATH,rs[_0x33e3('0x120')](0x4));var _0x384c55=util[_0x33e3('0x25')](_0x33e3('0x99'),_0x426d82,_0x534280);var _0x3539e8=!![];if(_0x56e3e6[_0x33e3('0x134')]===_0x33e3('0x135')){_0x3539e8=![];}var _0x304767=this['channel']['recordFile'](_0x426d82,_0x534280,_0x56e3e6[_0x33e3('0x136')],_0x56e3e6[_0x33e3('0x63')],undefined,_0x3539e8);if(_0x304767[_0x33e3('0xa0')]!==-0x1){this[_0x33e3('0xc')]['noop'](util['format'](_0x33e3('0x137'),_0x384c55));var _0x1fe96d=this[_0x33e3('0x8a')][_0x33e3('0x6e')](this,_0x56e3e6,_0x384c55);if(_0x1fe96d){for(var _0x53ca0a in _0x1fe96d){if(_0x1fe96d[_0x33e3('0x91')](_0x53ca0a)){this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x138'),_0x53ca0a[_0x33e3('0x68')]()),_0x1fe96d[_0x53ca0a]);}}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x139'),JSON[_0x33e3('0x71')](_0x1fe96d)));}}return _0x304767;};AGIVertices[_0x33e3('0xf')]['tildeasr']=function(_0x56699b){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x13a'),_0x56699b[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x56699b[_0x33e3('0x8d')])){return this['channel'][_0x33e3('0xa7')](_0x33e3('0x13b'));}if(!this[_0x33e3('0xa2')](_0x56699b[_0x33e3('0x8e')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x13c'));}var _0x291118=_0x33e3('0x13d');var _0x50ca99=util['format'](_0x33e3('0x133'),FILES_PATH,rs[_0x33e3('0x120')](0x4));var _0x5d19c9=util[_0x33e3('0x25')](_0x33e3('0x99'),_0x50ca99,_0x291118);var _0x55c34c=!![];if(_0x56699b[_0x33e3('0x134')]===_0x33e3('0x135')){_0x55c34c=![];}var _0x2df0b5=this['channel'][_0x33e3('0x13e')](_0x50ca99,_0x291118,_0x56699b[_0x33e3('0x136')],_0x56699b[_0x33e3('0x63')],undefined,_0x55c34c);if(_0x2df0b5[_0x33e3('0xa0')]!==-0x1){this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('tilde\x20%s\x20file\x20created',_0x5d19c9));var _0x26db75=this[_0x33e3('0x8c')][_0x33e3('0x6e')](this,_0x56699b,_0x5d19c9);if(_0x26db75){for(var _0x173ee4 in _0x26db75){if(_0x26db75[_0x33e3('0x91')](_0x173ee4)){this['channel']['setVariable'](util[_0x33e3('0x25')]('TILDE_ASR_%s',_0x173ee4['toUpperCase']()),_0x26db75[_0x173ee4]);}}return this['channel'][_0x33e3('0xa7')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x33e3('0x71')](_0x26db75)));}}return _0x2df0b5;};AGIVertices[_0x33e3('0xf')]['gotoc']=function(_0x351dcb){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x351dcb[_0x33e3('0xac')]));return this['channel'][_0x33e3('0x13f')](_0x351dcb[_0x33e3('0x37')],_0x351dcb[_0x33e3('0x38')],_0x351dcb[_0x33e3('0x39')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x140')]=function(_0x1fc13d){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x141'),_0x1fc13d['label']));if(!this['isConfigured'](_0x1fc13d[_0x33e3('0x142')])){return this['channel'][_0x33e3('0x28')](_0x1fc13d,_0x33e3('0x143'));}try{var _0x2eb421=eval(_0x1fc13d[_0x33e3('0x142')])?_0x33e3('0x144'):_0x33e3('0x145');this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('EVAL\x20CONDITION\x20%s\x20%s',_0x1fc13d[_0x33e3('0x142')],_0x2eb421));return{'code':0xc8,'result':_0x2eb421};}catch(_0xe350db){return{'code':0xc8,'result':_0x33e3('0x145')};}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x146')]=function(_0x539e57){logger['info'](util[_0x33e3('0x25')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x539e57[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x539e57[_0x33e3('0x147')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x539e57,_0x33e3('0x148'));}var _0x4d32d1=this[_0x33e3('0x1f')][_0x33e3('0x6e')](this,_0x539e57[_0x33e3('0x147')]);if(!_0x4d32d1){return this['channel'][_0x33e3('0x28')](_0x539e57,_0x33e3('0x149'));}for(var _0x8d65b7=0x0;_0x8d65b7<_0x4d32d1[_0x33e3('0x96')];_0x8d65b7+=0x1){var _0x5dc199=this[_0x33e3('0xc')][_0x33e3('0x10')](util['format'](_0x33e3('0x14a'),_0x4d32d1[_0x8d65b7]));if(_0x5dc199['result']===-0x1){return _0x5dc199;}logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('IFTIME\x20%s\x20%s',_0x4d32d1[_0x8d65b7],_0x5dc199[_0x33e3('0x9e')]));if(_0x5dc199['extra']===_0x33e3('0x144')){logger['info'](util[_0x33e3('0x25')]('IFTIME\x20%s\x20%s',_0x4d32d1[_0x8d65b7],_0x33e3('0x144')));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x14b'),_0x4d32d1[_0x8d65b7],_0x33e3('0x144')));return{'code':0xc8,'result':'true'};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x14b'),_0x4d32d1[_0x8d65b7],_0x33e3('0x145')));this['channel'][_0x33e3('0xa7')](util['format']('IFTIME\x20%s\x20%s',_0x4d32d1[_0x8d65b7],'false'));}}return{'code':0xc8,'result':_0x33e3('0x145')};};AGIVertices[_0x33e3('0xf')][_0x33e3('0x14c')]=function(_0x511624){logger['info'](util['format'](_0x33e3('0x14d'),_0x511624[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0x14c')]();};AGIVertices['prototype']['ispeechasr']=function(_0xe21740){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x14e'),_0xe21740[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0xe21740[_0x33e3('0x7f')])){return this[_0x33e3('0xc')]['noop']('no\x20key\x20configured');}var _0x69f5ac=_0x33e3('0x13d');var _0x44a89c=util[_0x33e3('0x25')](_0x33e3('0x133'),FILES_PATH,rs[_0x33e3('0x120')](0x4));var _0x2f758b=util[_0x33e3('0x25')](_0x33e3('0x99'),_0x44a89c,_0x69f5ac);var _0x22f36c=!![];if(_0xe21740['beep']===_0x33e3('0x135')){_0x22f36c=![];}var _0xac5680=this[_0x33e3('0xc')]['recordFile'](_0x44a89c,_0x69f5ac,_0xe21740[_0x33e3('0x136')],_0xe21740[_0x33e3('0x63')],undefined,_0x22f36c);if(_0xac5680[_0x33e3('0xa0')]!==-0x1){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x14f'),_0x2f758b));var _0x166548=this['ispeechASR'][_0x33e3('0x6e')](this,_0xe21740,_0x2f758b);if(_0x166548){for(var _0x1fa1ae in _0x166548){if(_0x166548['hasOwnProperty'](_0x1fa1ae)){this[_0x33e3('0xc')][_0x33e3('0x9b')](util['format'](_0x33e3('0x150'),_0x1fa1ae['toUpperCase']()),_0x166548[_0x1fa1ae]);}}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x151'),JSON[_0x33e3('0x71')](_0x166548)));}}return _0xac5680;};AGIVertices['prototype']['ispeechtts']=function(_0x421692){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x152'),_0x421692[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x421692['key'])){return this[_0x33e3('0xc')]['noop'](_0x33e3('0xea'));}if(!this[_0x33e3('0xa2')](_0x421692[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x153'),_0x421692['text']));var _0x33b26c=this[_0x33e3('0x7c')][_0x33e3('0x6e')](this,_0x421692);if(_0x33b26c){this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')]('ispeech\x20%s\x20file\x20created',_0x33b26c));var _0x9bea49=this[_0x33e3('0xc')]['streamFile'](_0x33b26c,_0x421692['intKey']);try{fs['unlink'](_0x33b26c+_0x33e3('0x109'));}catch(_0x500080){logger[_0x33e3('0x28')](_0x500080);}return _0x9bea49;}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x421692,_0x33e3('0x154'));};AGIVertices[_0x33e3('0xf')]['login']=function(_0x281d41){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x155'),_0x281d41[_0x33e3('0xac')]));if(!this['isConfigured'](_0x281d41[_0x33e3('0x156')])){return this['channel'][_0x33e3('0x28')](_0x281d41,_0x33e3('0x157'));}logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x158'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41[_0x33e3('0x156')]));var _0x149a10=this[_0x33e3('0x4c')]['sync'](this,_0x281d41[_0x33e3('0x156')]);if(_0x149a10){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x159'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x159'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41['findBy']));return{'code':0xc8,'result':_0x33e3('0x15a')};}else{logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x15b'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41[_0x33e3('0x156')]));this[_0x33e3('0xc')][_0x33e3('0xa7')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x33e3('0xc')][_0x33e3('0x33')],_0x281d41[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x15d')]=function(_0x23c0fa){logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x15e'),_0x23c0fa[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x23c0fa['findBy'])){return this[_0x33e3('0xc')]['error'](_0x23c0fa,_0x33e3('0x157'));}logger['info'](util[_0x33e3('0x25')](_0x33e3('0x158'),this[_0x33e3('0xc')]['callerid'],_0x23c0fa['findBy']));var _0x215535=this['agentLogout']['sync'](this,_0x23c0fa[_0x33e3('0x156')]);if(_0x215535){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x159'),this['channel']['callerid'],_0x23c0fa['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x159'),this['channel']['callerid'],_0x23c0fa['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x23c0fa[_0x33e3('0x156')]));this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x33e3('0x33')],_0x23c0fa['findBy']));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')]['math']=function(_0x28d0ec){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x28d0ec['label']));if(!this[_0x33e3('0xa2')](_0x28d0ec[_0x33e3('0x15f')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x28d0ec,_0x33e3('0x160'));}this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x161'),_0x28d0ec[_0x33e3('0x15f')]));var _0x59bbbe=eval(_0x28d0ec[_0x33e3('0x15f')]);if(!this[_0x33e3('0xa2')](_0x28d0ec['variable_id'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xd9'));}var _0x70b730=this[_0x33e3('0x10')]['sync'](this,_0x28d0ec[_0x33e3('0xd8')]);if(!_0x70b730){return this[_0x33e3('0xc')]['error'](_0x28d0ec,_0x33e3('0xda'));}if(_[_0x33e3('0x9a')](_0x59bbbe)){var _0x5129ac=this;_0x59bbbe[_0x33e3('0xdb')](function(_0x319e81,_0x38ef68){_0x5129ac[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x162'),_0x70b730,_0x38ef68),_0x319e81);});return this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x163'),_0x70b730));}else{return this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x70b730,_0x59bbbe);}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x9')]=function(_0x48385e){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x164'),_0x48385e[_0x33e3('0xac')]));if(_0x48385e[_0x33e3('0xa4')]===0x0){return this[_0x33e3('0xa3')](_0x48385e);}_0x48385e[_0x33e3('0xa4')]-=0x1;if(!this[_0x33e3('0xa2')](_0x48385e[_0x33e3('0x117')])){return this['channel']['error'](_0x48385e,_0x33e3('0x118'));}var _0x4cede5=this[_0x33e3('0x1a')]['sync'](this,_0x48385e[_0x33e3('0x117')]);if(!_0x4cede5){return this['channel'][_0x33e3('0x28')](_0x48385e,_0x33e3('0x165'));}var _0x27cb97=this['channel'][_0x33e3('0x119')](_0x4cede5,_0x48385e[_0x33e3('0x166')],_0x48385e['digit']);var _0xe3aaa0=_0x27cb97[_0x33e3('0xa0')];if(_0x27cb97['result']===-0x1){this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x48385e,'-1');return _0x27cb97;}else if(_0x27cb97['extra']===_0x33e3('0x63')){_0x27cb97[_0x33e3('0xa0')]=_0x27cb97[_0x33e3('0xa0')]['length']>0x0?_0x27cb97[_0x33e3('0xa0')]:'t';}else if(_[_0x33e3('0x3f')](_0x27cb97[_0x33e3('0xa0')])){_0x27cb97['result']='#';_0xe3aaa0='#';}if(!this[_0x33e3('0xa2')](_0x48385e[_0x33e3('0xd8')])){this['channel'][_0x33e3('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x3b29a1=this[_0x33e3('0x10')][_0x33e3('0x6e')](this,_0x48385e[_0x33e3('0xd8')]);if(!_0x3b29a1){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x48385e,_0x33e3('0xda'));}this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x3b29a1,_0xe3aaa0);}this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x48385e,_0xe3aaa0);return _0x27cb97;};AGIVertices['prototype'][_0x33e3('0xa7')]=function(_0x2d7fa4){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x167'),_0x2d7fa4[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x2d7fa4['output']||_0x2d7fa4[_0x33e3('0xac')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x168')]=function(_0x14a260){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x169'),_0x14a260[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x14a260[_0x33e3('0x156')])){return this['channel']['error'](_0x14a260,_0x33e3('0x157'));}logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x158'),this[_0x33e3('0xc')]['callerid'],_0x14a260['findBy']));var _0x3e48e7=this[_0x33e3('0x16a')][_0x33e3('0x6e')](this,_0x14a260[_0x33e3('0x16b')]);var _0x107b78=this[_0x33e3('0x48')][_0x33e3('0x6e')](this,_0x14a260[_0x33e3('0x156')],_0x3e48e7);if(_0x107b78){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x159'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x14a260[_0x33e3('0x156')]));this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x33e3('0xc')][_0x33e3('0x33')],_0x14a260['findBy']));return{'code':0xc8,'result':_0x33e3('0x15a')};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x15b'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x14a260[_0x33e3('0x156')]));this['channel']['noop'](util['format'](_0x33e3('0x159'),this[_0x33e3('0xc')]['callerid'],_0x14a260[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')][_0x33e3('0x16c')]=function(_0xee5cfe){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x16d'),_0xee5cfe[_0x33e3('0xac')]));if(!this['isConfigured'](_0xee5cfe['file_id'])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0xee5cfe,'no\x20file\x20audio\x20selected');}var _0x2b2df2=this[_0x33e3('0x1a')]['sync'](this,_0xee5cfe[_0x33e3('0x117')]);if(!_0x2b2df2){return this[_0x33e3('0xc')]['error'](_0xee5cfe,'no\x20file\x20audio\x20found');}var _0x1e7773=this['channel']['exec'](_0x33e3('0x16e'),[_0x2b2df2,_0xee5cfe['opts']]);if(_0x1e7773[_0x33e3('0xa0')]===-0x1){return _0x1e7773;}return this['channel']['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x33e3('0x16e'),_0x2b2df2));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x16f')]=function(_0x5f1e7b){logger['info'](util['format'](_0x33e3('0x170'),_0x5f1e7b['label']));if(!this['isConfigured'](_0x5f1e7b['queue_id'])){return this['channel'][_0x33e3('0x28')](_0x5f1e7b,'no\x20queue\x20selected');}var _0x474110='';var _0x8d176e=parseInt(_0x5f1e7b[_0x33e3('0x171')],0xa);if(isNaN(_0x8d176e)){_0x474110=_0x5f1e7b[_0x33e3('0x171')];}else{_0x474110=this[_0x33e3('0x172')]['sync'](this,_0x5f1e7b[_0x33e3('0x171')]);if(!_0x474110){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x5f1e7b,_0x33e3('0x173'));}}var _0x201b1f='';if(this[_0x33e3('0xa2')](_0x5f1e7b[_0x33e3('0x117')])){var _0x44ae65=this[_0x33e3('0x1a')][_0x33e3('0x6e')](this,_0x5f1e7b['file_id']);if(_0x44ae65){_0x201b1f=_0x44ae65;}}this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x5f1e7b,_0x474110);if(_0x5f1e7b['opts'][_0x33e3('0x174')]('x')<0x0){_0x5f1e7b[_0x33e3('0xe5')]+='x';}if(_0x5f1e7b[_0x33e3('0xe5')][_0x33e3('0x174')]('X')<0x0){_0x5f1e7b[_0x33e3('0xe5')]+='X';}this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x33e3('0x175'),_0x474110?_0x474110[_0x33e3('0x176')]():'');var _0x324b64=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0x177'),[_0x474110,_0x5f1e7b[_0x33e3('0xe5')],_0x5f1e7b[_0x33e3('0x61')],_0x201b1f,_0x5f1e7b[_0x33e3('0x63')],_0x5f1e7b[_0x33e3('0xb4')],_0x5f1e7b[_0x33e3('0x178')],_0x5f1e7b[_0x33e3('0x179')],'',_0x5f1e7b[_0x33e3('0x17a')]]);if(_0x324b64[_0x33e3('0xa0')]===-0x1){return _0x324b64;}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0x33e3('0x177'),_0x474110));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x17b')]=function(_0xb1e20){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x17c'),_0xb1e20[_0x33e3('0xac')]));var _0x2c8563=_0xb1e20[_0x33e3('0x17d')]||_0x33e3('0x13d');var _0x3bb694=util[_0x33e3('0x25')]('%s_%s',this[_0x33e3('0xc')][_0x33e3('0x35')],rs['generate'](0x5));var _0x581eba=util['format'](_0x33e3('0x17e'),FILES_PATH,_0x3bb694,_0x2c8563);var _0xffa843=util['format'](_0x33e3('0x133'),FILES_PATH,_0x3bb694);this[_0x33e3('0x34')][_0x33e3('0x6e')](this,_0xb1e20,_0x3bb694,_0x581eba);this[_0x33e3('0xc')][_0x33e3('0x9b')]('RECORDING_SAVENAME',_0x3bb694);logger['info']('Recording\x20%s\x20%s\x20%s\x20%s',_0xffa843,_0x2c8563,_0xb1e20[_0x33e3('0x17f')],_0xb1e20[_0x33e3('0x63')]);return this[_0x33e3('0xc')][_0x33e3('0x13e')](_0xffa843,_0x2c8563,_0xb1e20[_0x33e3('0x17f')],_0xb1e20[_0x33e3('0x63')],undefined,!![]);};AGIVertices[_0x33e3('0xf')]['restapi']=function(_0x48ed54){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x180'),_0x48ed54['label']));if(!this[_0x33e3('0xa2')](_0x48ed54[_0x33e3('0x61')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20url\x20configured');}var _0x57c429=this[_0x33e3('0x60')][_0x33e3('0x6e')](this,_0x48ed54);logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x181'),util[_0x33e3('0x182')](_0x57c429,{'showHidden':![],'depth':null})));if(!this[_0x33e3('0xa2')](_0x48ed54[_0x33e3('0xd8')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x183'));}var _0x46efb2=this['getVariable'][_0x33e3('0x6e')](this,_0x48ed54['variable_id']);if(!_0x46efb2){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x48ed54,'no\x20variable\x20found');}this['channel']['setVariable'](util[_0x33e3('0x25')](_0x33e3('0x184'),_0x46efb2),_0x57c429[_0x33e3('0x72')]?_0x57c429[_0x33e3('0x72')]:_0x33e3('0x185'));this[_0x33e3('0xc')][_0x33e3('0x9b')](util[_0x33e3('0x25')](_0x33e3('0x186'),_0x46efb2),_0x57c429[_0x33e3('0x73')]?_0x57c429[_0x33e3('0x73')]:'OK');if(_0x57c429[_0x33e3('0x69')]){try{this[_0x33e3('0x98')](_0x57c429[_0x33e3('0x69')],_0x46efb2);}catch(_0x3a672a){logger[_0x33e3('0x28')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x46efb2));}}return this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0xde'),_0x46efb2));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x187')]=function(_0x22d79d){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x188'),_0x22d79d[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0x189')](_0x22d79d[_0x33e3('0x18a')][_0x33e3('0x53')](/\s+/g,''),_0x22d79d[_0x33e3('0x17f')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x18b')]=function(_0x226a93){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x18c'),_0x226a93[_0x33e3('0xac')]));return this[_0x33e3('0xc')][_0x33e3('0x18d')](_0x226a93[_0x33e3('0x64')][_0x33e3('0x53')](/\s+/g,''),_0x226a93[_0x33e3('0x17f')]);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x18e')]=function(_0x573060){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x18f'),_0x573060[_0x33e3('0xac')]));return this['channel'][_0x33e3('0x190')](_0x573060[_0x33e3('0x57')],_0x573060['escape_digits']);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x191')]=function(_0x86ac68){logger[_0x33e3('0x2a')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x86ac68[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x86ac68[_0x33e3('0x192')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x193'));}var _0x46b9ed=this[_0x33e3('0x1c')][_0x33e3('0x6e')](this,_0x86ac68[_0x33e3('0x192')]);if(!_0x46b9ed||!_0x46b9ed[_0x33e3('0x194')]){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x86ac68,_0x33e3('0x195'));}var _0x61c54d={'from':util[_0x33e3('0x25')](_0x33e3('0x196'),_0x46b9ed[_0x33e3('0x12')],_0x46b9ed[_0x33e3('0x197')]||_0x46b9ed['Smtp'][_0x33e3('0x198')]),'to':_0x86ac68['to']||'','cc':_0x86ac68['cc']||'','bcc':_0x86ac68[_0x33e3('0x199')]||'','subject':_0x86ac68['subject'],'html':_0x86ac68[_0x33e3('0x57')],'text':_0x86ac68['text']};var _0x5de621={'tls':{'rejectUnauthorized':![]}};if(_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19a')]){_0x5de621[_0x33e3('0x19a')]=_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19a')];}else{_0x5de621[_0x33e3('0x19b')]=_0x46b9ed[_0x33e3('0x194')]['host'];_0x5de621[_0x33e3('0x19c')]=_0x46b9ed[_0x33e3('0x194')]['port'];_0x5de621[_0x33e3('0x19d')]=_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19d')];}if(_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x19e')]){_0x5de621[_0x33e3('0x19f')]={'user':_0x46b9ed[_0x33e3('0x194')][_0x33e3('0x198')],'pass':_0x46b9ed['Smtp'][_0x33e3('0x1a0')]};}if(this[_0x33e3('0xa2')](_0x86ac68[_0x33e3('0x1a1')])){}logger['debug'](_0x33e3('0x1a2'),JSON[_0x33e3('0x71')](_0x61c54d));this['createSquareDetailsReport'][_0x33e3('0x6e')](this,_0x86ac68,_0x86ac68[_0x33e3('0x192')]);this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1a3'),_0x46b9ed[_0x33e3('0x12')]));this['sendMailMessage'][_0x33e3('0x6e')](this,_0x5de621,_0x61c54d);return this['channel'][_0x33e3('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0x33e3('0x1a4')]=function(_0x330954){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1a5'),_0x330954['label']));return this[_0x33e3('0xc')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype']['sendSMS']=function(_0x2b8b42){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1a6'),_0x2b8b42[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x2b8b42[_0x33e3('0x1a7')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1a8'));}var _0x4510a9=this[_0x33e3('0x1a9')][_0x33e3('0x6e')](this,_0x2b8b42[_0x33e3('0x1a7')]);if(!_0x4510a9){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x2b8b42,_0x33e3('0x1aa'));}var _0x4f879f={'body':_0x2b8b42['sms_text'],'phone':_0x2b8b42['to']||'','SmsAccountId':_0x4510a9['id']};logger[_0x33e3('0xdf')]('sendSMS\x20message',JSON[_0x33e3('0x71')](_0x4f879f));this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x2b8b42,_0x2b8b42[_0x33e3('0x1a7')]);this[_0x33e3('0xc')][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1ab'),_0x4510a9['name']));this[_0x33e3('0x2f')][_0x33e3('0x6e')](this,_0x4f879f);return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1ac'));};AGIVertices['prototype'][_0x33e3('0x1ad')]=function(_0x673481){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x1ae'),_0x673481[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x673481[_0x33e3('0xd8')])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x673481,'no\x20variable\x20selected');}var _0x2a8da3=this[_0x33e3('0x10')]['sync'](this,_0x673481[_0x33e3('0xd8')]);if(!_0x2a8da3){return this['channel'][_0x33e3('0x28')](_0x673481,_0x33e3('0xda'));}return this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x2a8da3,_0x673481['variable_value']);};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1af')]=function(_0x552755){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1b0'),_0x552755[_0x33e3('0xac')]));this[_0x33e3('0xc')]['noop'](_0x33e3('0x1b1'));if(_0x552755[_0x33e3('0xb8')]===_0x33e3('0x1b2')){this[_0x33e3('0xc')][_0x33e3('0xa7')]('Answer');return this[_0x33e3('0xc')][_0x33e3('0xb8')]();}return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1b3'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1b4')]=function(_0x14fba9){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1b5'),_0x14fba9[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x14fba9['project_id'])){return this['channel'][_0x33e3('0x28')](_0x14fba9,'no\x20subproject\x20selected');}var _0x155490=this[_0x33e3('0x1b6')]['sync'](this,_0x14fba9['project_id']);if(!this[_0x33e3('0xa2')](_0x155490)){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x14fba9,util[_0x33e3('0x25')](_0x33e3('0x1b7'),_0x14fba9[_0x33e3('0x1b8')]));}if(_0x155490===this[_0x33e3('0xc')][_0x33e3('0x32')]){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x14fba9,_0x33e3('0x1b9'));}this[_0x33e3('0x30')][_0x33e3('0x6e')](this,_0x14fba9,_0x155490);var _0x1a50bb=this[_0x33e3('0xc')][_0x33e3('0x51')]('AGI',util[_0x33e3('0x25')](_0x33e3('0x1ba'),config[_0x33e3('0xb4')][_0x33e3('0x19b')]||_0x33e3('0x1bb'),_0x155490,this[_0x33e3('0xc')]['arg_1']));if(_0x1a50bb[_0x33e3('0xa0')]===-0x1){return _0x1a50bb;}return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0x33e3('0x1bc'),_0x155490));};AGIVertices[_0x33e3('0xf')]['system']=function(_0x535678){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1bd'),_0x535678[_0x33e3('0xac')]));var _0x4b85c2=this[_0x33e3('0x50')]['sync'](this,_0x535678[_0x33e3('0xb6')]);this[_0x33e3('0x30')]['sync'](this,_0x535678,_0x535678['command']);if(this[_0x33e3('0xa2')](_0x535678[_0x33e3('0xd8')])){var _0x28fb91=this['getVariable'][_0x33e3('0x6e')](this,_0x535678[_0x33e3('0xd8')]);if(_0x28fb91){this[_0x33e3('0xc')][_0x33e3('0x9b')](_0x28fb91,_0x4b85c2);return this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x1be'),_0x535678[_0x33e3('0xb6')],_0x28fb91));}}return this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1bf'),_0x535678[_0x33e3('0xb6')]));};AGIVertices['prototype']['google_cloud_tts']=function(_0x18d4a9){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1c0'),_0x18d4a9[_0x33e3('0xac')]));_0x18d4a9[_0x33e3('0x57')]=_0x18d4a9['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x18d4a9['apiKey'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0x1c1'));}if(!this[_0x33e3('0xa2')](_0x18d4a9[_0x33e3('0x57')])){return this[_0x33e3('0xc')][_0x33e3('0xa7')]('no\x20text\x20configured');}this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x1c2'),_0x18d4a9[_0x33e3('0x57')]));var _0x138dc1=this[_0x33e3('0x54')]['sync'](this,_0x18d4a9);if(_0x138dc1){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1c3'),_0x138dc1));var _0x22ae25=this[_0x33e3('0xc')]['streamFile'](_0x138dc1);try{fs[_0x33e3('0x108')](_0x138dc1+_0x33e3('0x109'));}catch(_0x16336e){logger[_0x33e3('0x28')](_0x16336e);}return _0x22ae25;}return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x18d4a9,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1c4')]=function(_0x12aca9){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1c5'),_0x12aca9[_0x33e3('0xac')]));_0x12aca9[_0x33e3('0x57')]=_0x12aca9[_0x33e3('0x57')][_0x33e3('0x53')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x33e3('0xa2')](_0x12aca9['text'])){return this[_0x33e3('0xc')][_0x33e3('0xa7')](_0x33e3('0xa8'));}this['channel'][_0x33e3('0xa7')](util['format'](_0x33e3('0x1c6'),_0x12aca9[_0x33e3('0x57')]));var _0x52c0bc=this['googleTTS']['sync'](this,_0x12aca9);if(_0x52c0bc){this['channel'][_0x33e3('0xa7')](util[_0x33e3('0x25')](_0x33e3('0x1c7'),_0x52c0bc));var _0x476b1a=this['channel']['streamFile'](_0x52c0bc);try{fs[_0x33e3('0x108')](_0x52c0bc+_0x33e3('0x109'));}catch(_0x2786f6){logger[_0x33e3('0x28')](_0x2786f6);}return _0x476b1a;}return this['channel'][_0x33e3('0x28')](_0x12aca9,_0x33e3('0x1c8'));};AGIVertices[_0x33e3('0xf')][_0x33e3('0x1c9')]=function(_0x317d12){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x1ca'),_0x317d12[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x317d12[_0x33e3('0x156')])){return this['channel'][_0x33e3('0x28')](_0x317d12,_0x33e3('0x157'));}logger[_0x33e3('0x2a')](util['format'](_0x33e3('0x158'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x317d12[_0x33e3('0x156')]));var _0x29e9ab=this[_0x33e3('0x4a')][_0x33e3('0x6e')](this,_0x317d12[_0x33e3('0x156')]);if(_0x29e9ab){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x33e3('0xc')][_0x33e3('0x33')],_0x317d12['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x159'),this['channel'][_0x33e3('0x33')],_0x317d12[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15a')};}else{logger[_0x33e3('0x2a')](util[_0x33e3('0x25')](_0x33e3('0x15b'),this[_0x33e3('0xc')][_0x33e3('0x33')],_0x317d12['findBy']));this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0x15b'),this[_0x33e3('0xc')]['callerid'],_0x317d12[_0x33e3('0x156')]));return{'code':0xc8,'result':_0x33e3('0x15c')};}};AGIVertices[_0x33e3('0xf')]['voicemail']=function(_0x57b10e){logger[_0x33e3('0x2a')](util[_0x33e3('0x25')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x57b10e['label']));var _0x41ef36=this[_0x33e3('0xc')][_0x33e3('0x51')](_0x33e3('0x1cb'),[_0x57b10e[_0x33e3('0x1cc')],_0x57b10e[_0x33e3('0x76')]]);if(_0x41ef36[_0x33e3('0xa0')]===-0x1){return _0x41ef36;}return this[_0x33e3('0xc')]['noop'](util[_0x33e3('0x25')](_0x33e3('0xc4'),_0x33e3('0x1cb'),_0x57b10e[_0x33e3('0x1cc')]));};AGIVertices[_0x33e3('0xf')]['vswitch']=function(_0x35a3fb){logger['info'](util[_0x33e3('0x25')](_0x33e3('0x1cd'),_0x35a3fb[_0x33e3('0xac')]));if(!this[_0x33e3('0xa2')](_0x35a3fb['variable_id'])){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x35a3fb,_0x33e3('0x1ce'));}var _0x516783=this[_0x33e3('0x10')][_0x33e3('0x6e')](this,_0x35a3fb[_0x33e3('0xd8')]);if(!_0x516783){return this[_0x33e3('0xc')][_0x33e3('0x28')](_0x35a3fb,'no\x20variable\x20found');}var _0x16bc99=this[_0x33e3('0xc')][_0x33e3('0x10')](_0x516783);return{'code':0xc8,'result':_0x16bc99[_0x33e3('0x9e')]?_0x16bc99[_0x33e3('0x9e')]:'-'};};String[_0x33e3('0xf')]['replaceAll']=function(_0x253520,_0x46bc77){return this[_0x33e3('0x9c')](_0x253520)['join'](_0x46bc77);};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 21ac67c..e2729c6 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 _0x0030=['acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','lastPauseAt','timer','info','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','mandatoryDisposition','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','prototype','startAcw','interface','queue','name','mandatoryDispositionPause','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','channels','attended','destlinkedid','savePause'];(function(_0x504adc,_0x57dfcb){var _0x4ecfa7=function(_0x46a224){while(--_0x46a224){_0x504adc['push'](_0x504adc['shift']());}};_0x4ecfa7(++_0x57dfcb);}(_0x0030,0x85));var _0x0003=function(_0x227a9d,_0xbeac83){_0x227a9d=_0x227a9d-0x0;var _0xe7794b=_0x0030[_0x227a9d];return _0xe7794b;};'use strict';var util=require('util');var _=require(_0x0003('0x0'));var moment=require(_0x0003('0x1'));var ami=require('../ami');var logger=require(_0x0003('0x2'))(_0x0003('0x3'));var RpcUser=require(_0x0003('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x535196){this[_0x0003('0x5')]=_0x535196[_0x0003('0x5')];this[_0x0003('0x6')]=_0x535196[_0x0003('0x6')];this[_0x0003('0x7')]=_0x535196[_0x0003('0x7')];this['channels']={};ami['on'](_0x0003('0x8'),this[_0x0003('0x9')][_0x0003('0xa')](this));ami['on'](_0x0003('0xb'),this[_0x0003('0xc')][_0x0003('0xa')](this));ami['on'](_0x0003('0xd'),this[_0x0003('0xe')][_0x0003('0xa')](this));ami['on'](_0x0003('0xf'),this['syncAgentRingNoAnswer'][_0x0003('0xa')](this));ami['on'](_0x0003('0x10'),this[_0x0003('0x11')]['bind'](this));ami['on'](_0x0003('0x12'),this[_0x0003('0x13')][_0x0003('0xa')](this));ami['on'](_0x0003('0x14'),this[_0x0003('0x15')][_0x0003('0xa')](this));}function getDiff(_0x2fea98){var _0xaaf4db=moment()[_0x0003('0x16')](0x0);var _0x4f08e6=moment(_0x2fea98)[_0x0003('0x16')](0x0);return _0xaaf4db[_0x0003('0x17')](_0x4f08e6,'seconds');}Acw[_0x0003('0x18')][_0x0003('0x19')]=function(_0x228cd3){try{var _0x38a864=this;var _0x2bd8d0=this['channels'][_0x228cd3][_0x0003('0x1a')];var _0x16e13d=this['channels'][_0x228cd3][_0x0003('0x1b')];var _0x2b02f3=this[_0x0003('0x5')][_0x16e13d];var _0x13ab39=![];var _0x58b28e='ACW';if(_0x2b02f3['mandatoryDisposition']){if(_0x2b02f3['mandatoryDispositionPause'][_0x0003('0x1c')]){_0x13ab39=!![];_0x58b28e=_0x2b02f3[_0x0003('0x1d')][_0x0003('0x1c')];}}ami['Action']({'action':_0x0003('0x1e'),'interface':_0x2bd8d0,'paused':!![],'reason':_0x58b28e})['then'](function(_0x47dc7c){if(_0x38a864[_0x0003('0x6')][_0x2bd8d0]){return RpcUser[_0x0003('0x1f')](_0x38a864[_0x0003('0x6')][_0x2bd8d0]['id'])[_0x0003('0x20')](function(_0x34f3ff){if(_0x34f3ff&&!_0x34f3ff[_0x0003('0x21')]){logger['info'](_0x0003('0x22'),_0x228cd3,_0x2bd8d0,_0x16e13d);var _0x86a292=_0x38a864[_0x0003('0x23')][_0x228cd3][_0x0003('0x24')]&&_0x38a864[_0x0003('0x23')][_0x228cd3]['destlinkedid']?_0x38a864[_0x0003('0x23')][_0x228cd3][_0x0003('0x25')]:_0x228cd3;return RpcUser[_0x0003('0x26')](_0x38a864[_0x0003('0x6')][_0x2bd8d0],_0x58b28e,_0x86a292)[_0x0003('0x20')](function(_0x2a17ea){if(!_0x13ab39){_0x38a864[_0x0003('0x7')][_0x2bd8d0]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x228cd3,_0x38a864[_0x0003('0x5')][_0x16e13d][_0x0003('0x27')],_0x2bd8d0,_0x16e13d);_0x38a864[_0x0003('0x7')][_0x2bd8d0]['timer']=setTimeout(_0x38a864[_0x0003('0x28')][_0x0003('0xa')](_0x38a864,_0x2bd8d0),_0x38a864['voiceQueues'][_0x16e13d][_0x0003('0x27')]*0x3e8);_0x38a864[_0x0003('0x7')][_0x2bd8d0]['lastPauseAt']=moment()[_0x0003('0x29')](_0x0003('0x2a'));_0x38a864[_0x0003('0x7')][_0x2bd8d0][_0x0003('0x2b')]=_0x228cd3;_0x38a864[_0x0003('0x7')][_0x2bd8d0]['queue']=_0x16e13d;_0x38a864[_0x0003('0x7')][_0x2bd8d0][_0x0003('0x2c')]=function(){var _0x58dbde=getDiff(_0x38a864[_0x0003('0x7')][_0x2bd8d0][_0x0003('0x2d')]);clearTimeout(_0x38a864[_0x0003('0x7')][_0x2bd8d0][_0x0003('0x2e')]);_0x38a864['timers'][_0x2bd8d0][_0x0003('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x58dbde},_0x38a864['timers'][_0x2bd8d0][_0x0003('0x2b')],_0x2bd8d0)[_0x0003('0x20')](function(_0x185e1c){logger[_0x0003('0x2f')](_0x0003('0x30'),_0x228cd3,_0x58dbde,_0x185e1c);})['catch'](function(_0x27bade){logger[_0x0003('0x31')](_0x0003('0x32'),_0x228cd3,_0x27bade);});delete _0x38a864[_0x0003('0x7')][_0x2bd8d0];};}});}else{logger[_0x0003('0x2f')](_0x0003('0x33'),_0x228cd3,_0x2bd8d0,_0x16e13d);}});}})['catch'](function(_0x337aca){logger[_0x0003('0x31')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x228cd3,_0x38a864['voiceQueues'][_0x16e13d][_0x0003('0x27')],_0x2bd8d0,_0x16e13d);})[_0x0003('0x34')](function(){delete _0x38a864['channels'][_0x228cd3];});}catch(_0x4f974c){logger[_0x0003('0x31')]('[ACW][START]\x20%s',_0x4f974c[_0x0003('0x35')]);}};Acw['prototype']['stopAcw']=function(_0x32b127){try{var _0x2eaf14=this;if(_0x2eaf14[_0x0003('0x7')][_0x32b127]){_0x2eaf14[_0x0003('0x7')][_0x32b127]['timer']=![];var _0x29c3f5=_0x2eaf14[_0x0003('0x7')][_0x32b127][_0x0003('0x2b')];var _0x28cb2e=_0x2eaf14[_0x0003('0x7')][_0x32b127][_0x0003('0x1b')];var _0x393c9b=_0x2eaf14['voiceQueues'][_0x28cb2e][_0x0003('0x27')];logger[_0x0003('0x2f')](_0x0003('0x36'),_0x29c3f5,_0x32b127);RpcUser[_0x0003('0x37')](this[_0x0003('0x6')][_0x32b127]);RpcVoiceAgentReport[_0x0003('0x38')]({'acwtime':_0x393c9b,'agentacw':!![]},_0x29c3f5,_0x32b127)[_0x0003('0x20')](function(_0x1f00e9){logger[_0x0003('0x2f')](_0x0003('0x30'),_0x29c3f5,_0x393c9b,_0x1f00e9);})[_0x0003('0x39')](function(_0x1d80f5){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x29c3f5,_0x1d80f5);});}else{logger['error'](_0x0003('0x3a'),_0x32b127);if(_0x2eaf14[_0x0003('0x7')]){logger[_0x0003('0x2f')](_0x0003('0x3b'),JSON[_0x0003('0x3c')](_0x2eaf14[_0x0003('0x7')]));}}}catch(_0x347cf3){logger['error'](_0x0003('0x3d'),_0x347cf3[_0x0003('0x35')]);}};Acw[_0x0003('0x18')]['syncAgentConnect']=function(_0x5ec588){try{if(this[_0x0003('0x5')][_0x5ec588[_0x0003('0x1b')]]&&(this[_0x0003('0x5')][_0x5ec588[_0x0003('0x1b')]]['acw']||this[_0x0003('0x5')][_0x5ec588[_0x0003('0x1b')]][_0x0003('0x3e')])){if(this[_0x0003('0x6')][_0x5ec588[_0x0003('0x1a')]]){this[_0x0003('0x23')][_0x5ec588[_0x0003('0x2b')]]={'queue':_0x5ec588[_0x0003('0x1b')],'interface':_0x5ec588[_0x0003('0x1a')],'destlinkedid':_0x5ec588[_0x0003('0x25')]};}}}catch(_0x54434d){logger[_0x0003('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x54434d['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4c7be3){try{if(this[_0x0003('0x5')][_0x4c7be3[_0x0003('0x1b')]]&&(this[_0x0003('0x5')][_0x4c7be3['queue']]['acw']||this[_0x0003('0x5')][_0x4c7be3[_0x0003('0x1b')]][_0x0003('0x3e')])){if(this[_0x0003('0x6')][_0x4c7be3[_0x0003('0x1a')]]){this[_0x0003('0x23')][_0x4c7be3['uniqueid']]={'queue':_0x4c7be3['queue'],'interface':_0x4c7be3[_0x0003('0x1a')]};}}}catch(_0x1fca67){logger[_0x0003('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x1fca67[_0x0003('0x35')]);}};Acw[_0x0003('0x18')][_0x0003('0xc')]=function(_0x469543){try{if(this[_0x0003('0x23')][_0x469543[_0x0003('0x2b')]]&&_['isUndefined'](this[_0x0003('0x23')][_0x469543[_0x0003('0x2b')]][_0x0003('0x24')])){logger[_0x0003('0x2f')]('[%s][HANGUP:UNIQUEID]',_0x469543['uniqueid']);this[_0x0003('0x19')](_0x469543[_0x0003('0x2b')]);}else if(this[_0x0003('0x23')][_0x469543[_0x0003('0x3f')]]&&_[_0x0003('0x40')](this[_0x0003('0x23')][_0x469543['linkedid']][_0x0003('0x24')])){logger['info'](_0x0003('0x41'),_0x469543[_0x0003('0x3f')]);this[_0x0003('0x19')](_0x469543[_0x0003('0x3f')]);}}catch(_0x4db596){logger[_0x0003('0x31')](_0x0003('0x42'),_0x4db596['message']);}};Acw[_0x0003('0x18')][_0x0003('0xe')]=function(_0x3588e9){try{if(this[_0x0003('0x23')][_0x3588e9['uniqueid']]&&this[_0x0003('0x23')][_0x3588e9[_0x0003('0x2b')]]['attended']){logger[_0x0003('0x2f')](_0x0003('0x43'),_0x3588e9['uniqueid']);this[_0x0003('0x19')](_0x3588e9[_0x0003('0x2b')]);}else if(this[_0x0003('0x23')][_0x3588e9[_0x0003('0x3f')]]&&this[_0x0003('0x23')][_0x3588e9[_0x0003('0x3f')]][_0x0003('0x24')]){logger['info'](_0x0003('0x44'),_0x3588e9[_0x0003('0x3f')]);this[_0x0003('0x19')](_0x3588e9[_0x0003('0x3f')]);}}catch(_0x4a145f){logger[_0x0003('0x31')]('[ACW][syncHangup]\x20%s',_0x4a145f['message']);}};Acw[_0x0003('0x18')][_0x0003('0x11')]=function(_0x220a41){try{if(!_[_0x0003('0x45')](this[_0x0003('0x23')][_0x220a41[_0x0003('0x46')]])){this['startAcw'](_0x220a41['transfereeuniqueid']);if(this[_0x0003('0x23')][_0x220a41['secondtransfereruniqueid']]){this[_0x0003('0x23')][_0x220a41['secondtransfereruniqueid']][_0x0003('0x24')]=!![];this[_0x0003('0x23')][_0x220a41[_0x0003('0x47')]]=this['channels'][_0x220a41[_0x0003('0x48')]];delete this[_0x0003('0x23')][_0x220a41[_0x0003('0x48')]];}}else if(!_[_0x0003('0x45')](this['channels'][_0x220a41['transfertargetuniqueid']])){this[_0x0003('0x19')](_0x220a41[_0x0003('0x47')]);if(this[_0x0003('0x23')][_0x220a41[_0x0003('0x49')]]){this[_0x0003('0x23')][_0x220a41[_0x0003('0x49')]]['attended']=!![];this[_0x0003('0x23')][_0x220a41['transfereeuniqueid']]=this[_0x0003('0x23')][_0x220a41[_0x0003('0x49')]];delete this[_0x0003('0x23')][_0x220a41[_0x0003('0x49')]];}}}catch(_0x393b57){logger[_0x0003('0x31')](_0x0003('0x4a'),_0x393b57[_0x0003('0x35')]);}};Acw[_0x0003('0x18')][_0x0003('0x13')]=function(_0x3709b1){try{if(this[_0x0003('0x23')][_0x3709b1[_0x0003('0x4b')]]){logger[_0x0003('0x2f')](_0x0003('0x4c'),JSON[_0x0003('0x3c')](_0x3709b1[_0x0003('0x4b')]));this['startAcw'](_0x3709b1[_0x0003('0x4b')]);}else if(this[_0x0003('0x23')][_0x3709b1['transfererlinkedid']]){logger[_0x0003('0x2f')](_0x0003('0x4d'),JSON['stringify'](_0x3709b1['transfererlinkedid']));this[_0x0003('0x19')](_0x3709b1[_0x0003('0x4e')]);}}catch(_0x410375){logger[_0x0003('0x31')](_0x0003('0x4f'),_0x410375['message']);}};Acw['prototype'][_0x0003('0x50')]=function(_0x3f0a16){try{if(this[_0x0003('0x5')][_0x3f0a16[_0x0003('0x1b')]]&&this[_0x0003('0x5')][_0x3f0a16[_0x0003('0x1b')]][_0x0003('0x51')]===_0x0003('0x52')){if(this['agents'][_0x3f0a16['interface']]){logger[_0x0003('0x2f')](_0x0003('0x53'),_0x3f0a16[_0x0003('0x2b')],_0x3f0a16[_0x0003('0x1a')],_0x3f0a16[_0x0003('0x1b')]);return RpcUser['savePause'](this['agents'][_0x3f0a16[_0x0003('0x1a')]],_0x0003('0x54'),_0x3f0a16[_0x0003('0x2b')]);}}}catch(_0x7a3d5a){logger[_0x0003('0x31')](_0x0003('0x55'),_0x7a3d5a['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x9a58=['syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','voiceQueues','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','timer','update','uniqueid','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','catch','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','moment','../ami','../../../config/logger','acw','../rpc/user','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x9a58,0x137));var _0x89a5=function(_0x2eec1f,_0x1b9987){_0x2eec1f=_0x2eec1f-0x0;var _0x543075=_0x9a58[_0x2eec1f];return _0x543075;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x89a5('0x0'));var ami=require(_0x89a5('0x1'));var logger=require(_0x89a5('0x2'))(_0x89a5('0x3'));var RpcUser=require(_0x89a5('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x2721f9){this['voiceQueues']=_0x2721f9['voiceQueues'];this[_0x89a5('0x5')]=_0x2721f9[_0x89a5('0x5')];this['timers']=_0x2721f9[_0x89a5('0x6')];this[_0x89a5('0x7')]={};ami['on'](_0x89a5('0x8'),this['syncAgentConnect'][_0x89a5('0x9')](this));ami['on'](_0x89a5('0xa'),this[_0x89a5('0xb')]['bind'](this));ami['on'](_0x89a5('0xc'),this[_0x89a5('0xd')][_0x89a5('0x9')](this));ami['on'](_0x89a5('0xe'),this[_0x89a5('0xf')][_0x89a5('0x9')](this));ami['on'](_0x89a5('0x10'),this[_0x89a5('0x11')]['bind'](this));ami['on'](_0x89a5('0x12'),this[_0x89a5('0x13')][_0x89a5('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x89a5('0x14')][_0x89a5('0x9')](this));}function getDiff(_0xcad325){var _0x5b1208=moment()[_0x89a5('0x15')](0x0);var _0x2305d6=moment(_0xcad325)['milliseconds'](0x0);return _0x5b1208[_0x89a5('0x16')](_0x2305d6,_0x89a5('0x17'));}Acw[_0x89a5('0x18')]['startAcw']=function(_0x362f13){try{var _0x5be4ef=this;var _0x297ef8=this[_0x89a5('0x7')][_0x362f13][_0x89a5('0x19')];var _0x960a31=this['channels'][_0x362f13][_0x89a5('0x1a')];var _0x49bde4=this[_0x89a5('0x1b')][_0x960a31];var _0x394bd7=![];var _0x450397=_0x89a5('0x1c');if(_0x49bde4[_0x89a5('0x1d')]){if(_0x49bde4[_0x89a5('0x1e')][_0x89a5('0x1f')]){_0x394bd7=!![];_0x450397=_0x49bde4[_0x89a5('0x1e')][_0x89a5('0x1f')];}}ami['Action']({'action':_0x89a5('0x20'),'interface':_0x297ef8,'paused':!![],'reason':_0x450397})[_0x89a5('0x21')](function(_0x1e3ce6){if(_0x5be4ef[_0x89a5('0x5')][_0x297ef8]){return RpcUser[_0x89a5('0x22')](_0x5be4ef['agents'][_0x297ef8]['id'])['then'](function(_0x23eec5){if(_0x23eec5&&!_0x23eec5['voicePause']){logger['info'](_0x89a5('0x23'),_0x362f13,_0x297ef8,_0x960a31);var _0x3f70b2=_0x5be4ef[_0x89a5('0x7')][_0x362f13]['attended']&&_0x5be4ef['channels'][_0x362f13][_0x89a5('0x24')]?_0x5be4ef[_0x89a5('0x7')][_0x362f13]['destlinkedid']:_0x362f13;return RpcUser[_0x89a5('0x25')](_0x5be4ef[_0x89a5('0x5')][_0x297ef8],_0x450397,_0x3f70b2)[_0x89a5('0x21')](function(_0x4b9d1d){if(!_0x394bd7){_0x5be4ef[_0x89a5('0x6')][_0x297ef8]={};logger['info'](_0x89a5('0x26'),_0x362f13,_0x5be4ef[_0x89a5('0x1b')][_0x960a31][_0x89a5('0x27')],_0x297ef8,_0x960a31);_0x5be4ef[_0x89a5('0x6')][_0x297ef8]['timer']=setTimeout(_0x5be4ef[_0x89a5('0x28')][_0x89a5('0x9')](_0x5be4ef,_0x297ef8),_0x5be4ef['voiceQueues'][_0x960a31][_0x89a5('0x27')]*0x3e8);_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x29')]=moment()[_0x89a5('0x2a')](_0x89a5('0x2b'));_0x5be4ef[_0x89a5('0x6')][_0x297ef8]['uniqueid']=_0x362f13;_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x1a')]=_0x960a31;_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x2c')]=function(){var _0x199f41=getDiff(_0x5be4ef['timers'][_0x297ef8]['lastPauseAt']);clearTimeout(_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x2d')]);_0x5be4ef[_0x89a5('0x6')][_0x297ef8][_0x89a5('0x2d')]=![];RpcVoiceAgentReport[_0x89a5('0x2e')]({'acwtime':_0x199f41},_0x5be4ef['timers'][_0x297ef8][_0x89a5('0x2f')],_0x297ef8)[_0x89a5('0x21')](function(_0x13b41b){logger[_0x89a5('0x30')]('[%s][UPDATE][ACWTIME:%s]',_0x362f13,_0x199f41,_0x13b41b);})['catch'](function(_0x4fd01a){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x362f13,_0x4fd01a);});delete _0x5be4ef[_0x89a5('0x6')][_0x297ef8];};}});}else{logger['info'](_0x89a5('0x31'),_0x362f13,_0x297ef8,_0x960a31);}});}})['catch'](function(_0x542440){logger[_0x89a5('0x32')](_0x89a5('0x26'),_0x362f13,_0x5be4ef[_0x89a5('0x1b')][_0x960a31][_0x89a5('0x27')],_0x297ef8,_0x960a31);})['finally'](function(){delete _0x5be4ef['channels'][_0x362f13];});}catch(_0x1f4aad){logger['error']('[ACW][START]\x20%s',_0x1f4aad[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x28')]=function(_0x2f4f0f){try{var _0x13ff0e=this;if(_0x13ff0e[_0x89a5('0x6')][_0x2f4f0f]){_0x13ff0e['timers'][_0x2f4f0f][_0x89a5('0x2d')]=![];var _0x29f8d1=_0x13ff0e[_0x89a5('0x6')][_0x2f4f0f][_0x89a5('0x2f')];var _0x454390=_0x13ff0e['timers'][_0x2f4f0f]['queue'];var _0x1a2a25=_0x13ff0e[_0x89a5('0x1b')][_0x454390][_0x89a5('0x27')];logger[_0x89a5('0x30')](_0x89a5('0x34'),_0x29f8d1,_0x2f4f0f);RpcUser[_0x89a5('0x35')](this[_0x89a5('0x5')][_0x2f4f0f]);RpcVoiceAgentReport[_0x89a5('0x2e')]({'acwtime':_0x1a2a25,'agentacw':!![]},_0x29f8d1,_0x2f4f0f)['then'](function(_0x420e01){logger[_0x89a5('0x30')]('[%s][UPDATE][ACWTIME:%s]',_0x29f8d1,_0x1a2a25,_0x420e01);})[_0x89a5('0x36')](function(_0x482a8f){logger['error'](_0x89a5('0x37'),_0x29f8d1,_0x482a8f);});}else{logger['error'](_0x89a5('0x38'),_0x2f4f0f);if(_0x13ff0e[_0x89a5('0x6')]){logger[_0x89a5('0x30')]('[ACW][TIMERS]',JSON['stringify'](_0x13ff0e[_0x89a5('0x6')]));}}}catch(_0x5b0d1d){logger[_0x89a5('0x32')](_0x89a5('0x39'),_0x5b0d1d[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x3a')]=function(_0x697d26){try{if(this[_0x89a5('0x1b')][_0x697d26[_0x89a5('0x1a')]]&&(this[_0x89a5('0x1b')][_0x697d26[_0x89a5('0x1a')]][_0x89a5('0x3')]||this[_0x89a5('0x1b')][_0x697d26[_0x89a5('0x1a')]][_0x89a5('0x1d')])){if(this[_0x89a5('0x5')][_0x697d26[_0x89a5('0x19')]]){this[_0x89a5('0x7')][_0x697d26[_0x89a5('0x2f')]]={'queue':_0x697d26[_0x89a5('0x1a')],'interface':_0x697d26[_0x89a5('0x19')],'destlinkedid':_0x697d26[_0x89a5('0x24')]};}}}catch(_0x43bf58){logger[_0x89a5('0x32')](_0x89a5('0x3b'),_0x43bf58[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x14')]=function(_0x542240){try{if(this['voiceQueues'][_0x542240['queue']]&&(this['voiceQueues'][_0x542240[_0x89a5('0x1a')]][_0x89a5('0x3')]||this[_0x89a5('0x1b')][_0x542240['queue']][_0x89a5('0x1d')])){if(this[_0x89a5('0x5')][_0x542240[_0x89a5('0x19')]]){this[_0x89a5('0x7')][_0x542240[_0x89a5('0x2f')]]={'queue':_0x542240[_0x89a5('0x1a')],'interface':_0x542240[_0x89a5('0x19')]};}}}catch(_0x3eddee){logger[_0x89a5('0x32')](_0x89a5('0x3c'),_0x3eddee['message']);}};Acw[_0x89a5('0x18')][_0x89a5('0xb')]=function(_0x29f73f){try{if(this[_0x89a5('0x7')][_0x29f73f[_0x89a5('0x2f')]]&&_[_0x89a5('0x3d')](this[_0x89a5('0x7')][_0x29f73f[_0x89a5('0x2f')]][_0x89a5('0x3e')])){logger[_0x89a5('0x30')](_0x89a5('0x3f'),_0x29f73f['uniqueid']);this[_0x89a5('0x40')](_0x29f73f[_0x89a5('0x2f')]);}else if(this['channels'][_0x29f73f['linkedid']]&&_['isUndefined'](this[_0x89a5('0x7')][_0x29f73f[_0x89a5('0x41')]]['attended'])){logger[_0x89a5('0x30')](_0x89a5('0x42'),_0x29f73f[_0x89a5('0x41')]);this['startAcw'](_0x29f73f[_0x89a5('0x41')]);}}catch(_0x2733b0){logger[_0x89a5('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x2733b0[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0xd')]=function(_0x2a2e76){try{if(this[_0x89a5('0x7')][_0x2a2e76[_0x89a5('0x2f')]]&&this['channels'][_0x2a2e76[_0x89a5('0x2f')]][_0x89a5('0x3e')]){logger['info'](_0x89a5('0x43'),_0x2a2e76[_0x89a5('0x2f')]);this[_0x89a5('0x40')](_0x2a2e76[_0x89a5('0x2f')]);}else if(this['channels'][_0x2a2e76['linkedid']]&&this[_0x89a5('0x7')][_0x2a2e76[_0x89a5('0x41')]][_0x89a5('0x3e')]){logger[_0x89a5('0x30')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x2a2e76[_0x89a5('0x41')]);this[_0x89a5('0x40')](_0x2a2e76[_0x89a5('0x41')]);}}catch(_0x28cc07){logger['error']('[ACW][syncHangup]\x20%s',_0x28cc07['message']);}};Acw[_0x89a5('0x18')]['syncAttendedTransfer']=function(_0x568125){try{if(!_[_0x89a5('0x44')](this[_0x89a5('0x7')][_0x568125[_0x89a5('0x45')]])){this[_0x89a5('0x40')](_0x568125[_0x89a5('0x45')]);if(this[_0x89a5('0x7')][_0x568125[_0x89a5('0x46')]]){this[_0x89a5('0x7')][_0x568125['secondtransfereruniqueid']][_0x89a5('0x3e')]=!![];this[_0x89a5('0x7')][_0x568125['transfertargetuniqueid']]=this[_0x89a5('0x7')][_0x568125[_0x89a5('0x46')]];delete this[_0x89a5('0x7')][_0x568125['secondtransfereruniqueid']];}}else if(!_[_0x89a5('0x44')](this[_0x89a5('0x7')][_0x568125[_0x89a5('0x47')]])){this[_0x89a5('0x40')](_0x568125[_0x89a5('0x47')]);if(this[_0x89a5('0x7')][_0x568125['origtransfereruniqueid']]){this[_0x89a5('0x7')][_0x568125[_0x89a5('0x48')]][_0x89a5('0x3e')]=!![];this['channels'][_0x568125[_0x89a5('0x45')]]=this['channels'][_0x568125[_0x89a5('0x48')]];delete this[_0x89a5('0x7')][_0x568125[_0x89a5('0x48')]];}}}catch(_0x56c154){logger[_0x89a5('0x32')]('[ACW][syncAttendedTransfer]\x20%s',_0x56c154[_0x89a5('0x33')]);}};Acw[_0x89a5('0x18')][_0x89a5('0x13')]=function(_0x1ef2bc){try{if(this[_0x89a5('0x7')][_0x1ef2bc[_0x89a5('0x49')]]){logger[_0x89a5('0x30')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x89a5('0x4a')](_0x1ef2bc[_0x89a5('0x49')]));this[_0x89a5('0x40')](_0x1ef2bc['transfereruniqueid']);}else if(this['channels'][_0x1ef2bc[_0x89a5('0x4b')]]){logger['info'](_0x89a5('0x4c'),JSON[_0x89a5('0x4a')](_0x1ef2bc[_0x89a5('0x4b')]));this[_0x89a5('0x40')](_0x1ef2bc[_0x89a5('0x4b')]);}}catch(_0x3d759f){logger[_0x89a5('0x32')](_0x89a5('0x4d'),_0x3d759f[_0x89a5('0x33')]);}};Acw['prototype'][_0x89a5('0xf')]=function(_0xc5ded4){try{if(this[_0x89a5('0x1b')][_0xc5ded4[_0x89a5('0x1a')]]&&this[_0x89a5('0x1b')][_0xc5ded4['queue']][_0x89a5('0x4e')]==='all'){if(this[_0x89a5('0x5')][_0xc5ded4[_0x89a5('0x19')]]){logger['info'](_0x89a5('0x4f'),_0xc5ded4[_0x89a5('0x2f')],_0xc5ded4[_0x89a5('0x19')],_0xc5ded4[_0x89a5('0x1a')]);return RpcUser[_0x89a5('0x25')](this['agents'][_0xc5ded4[_0x89a5('0x19')]],'Auto-Pause',_0xc5ded4[_0x89a5('0x2f')]);}}}catch(_0x3200ac){logger[_0x89a5('0x32')](_0x89a5('0x50'),_0x3200ac[_0x89a5('0x33')]);}};module[_0x89a5('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 9a99d65..3ca3aed 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 _0x14c6=['exports','asterisk-manager','bluebird','moment','lodash','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0x14c6,0x7c));var _0x614c=function(_0x3ebdf5,_0x329be8){_0x3ebdf5=_0x3ebdf5-0x0;var _0x3594de=_0x14c6[_0x3ebdf5];return _0x3594de;};'use strict';var Manager=require(_0x614c('0x0'));var BPromise=require(_0x614c('0x1'));var moment=require(_0x614c('0x2'));var util=require('util');var _=require(_0x614c('0x3'));var logger=require(_0x614c('0x4'))(_0x614c('0x5'));var config=require(_0x614c('0x6'));var ami=new Manager(config[_0x614c('0x7')][_0x614c('0x8')],config[_0x614c('0x7')]['ip'],config['asterisk'][_0x614c('0x9')],config[_0x614c('0x7')][_0x614c('0xa')],!![]);ami[_0x614c('0xb')]();ami[_0x614c('0xc')]=BPromise[_0x614c('0xd')](ami[_0x614c('0xe')]);function error(_0x16f5b7){logger[_0x614c('0xf')](util[_0x614c('0x10')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x614c('0x7')][_0x614c('0x9')],config['asterisk']['ip'],config['asterisk']['port'],util[_0x614c('0x11')](_0x16f5b7,![],null)));}function close(){logger[_0x614c('0xf')](util[_0x614c('0x10')](_0x614c('0x12'),config[_0x614c('0x7')][_0x614c('0x9')],config[_0x614c('0x7')]['ip'],config[_0x614c('0x7')]['port']));}ami[_0x614c('0x13')]=function(){return function(){return ami['Action']({'action':_0x614c('0x14')});};};ami[_0x614c('0x15')]=function(){return function(){return ami[_0x614c('0xc')]({'action':_0x614c('0x16')});};};ami[_0x614c('0x17')]=function(){return function(){return ami[_0x614c('0xc')]({'action':_0x614c('0x18')});};};ami[_0x614c('0x19')]=function(){return function(){return ami[_0x614c('0xc')]({'action':_0x614c('0x1a')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x614c('0xc')]({'action':_0x614c('0x1b')});};};function connect(_0x13e388){logger[_0x614c('0x1c')](util[_0x614c('0x10')](_0x614c('0x1d'),config[_0x614c('0x7')][_0x614c('0x9')],config['asterisk']['ip'],config[_0x614c('0x7')][_0x614c('0x8')]));ami[_0x614c('0x1e')]('error',error);ami['once'](_0x614c('0x1f'),close);}ami['on'](_0x614c('0x20'),connect);ami['on'](_0x614c('0x21'),function(_0x4d318f){logger['info'](util['format'](_0x614c('0x22'),config[_0x614c('0x7')][_0x614c('0x9')],config['asterisk']['ip'],config[_0x614c('0x7')]['port'],util['inspect'](_0x4d318f,![],null)));});ami['on'](_0x614c('0x23'),function(_0x3521be){logger['info'](util[_0x614c('0x10')](_0x614c('0x24'),config[_0x614c('0x7')][_0x614c('0x9')],config['asterisk']['ip'],config[_0x614c('0x7')][_0x614c('0x8')]));return BPromise[_0x614c('0x25')]()['then'](ami[_0x614c('0x13')]())[_0x614c('0x26')](ami[_0x614c('0x15')]())[_0x614c('0x26')](ami['actionSipPeerStatus']())[_0x614c('0x26')](ami[_0x614c('0x19')]())[_0x614c('0x26')](ami['actionCoreShowChannels']())[_0x614c('0x27')](function(_0x412624){console['log'](_0x412624);});});ami[_0x614c('0x1e')]('error',error);ami[_0x614c('0x1e')]('close',close);module[_0x614c('0x28')]=ami; \ No newline at end of file +var _0x0960=['fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','actionDeviceStateList','actionQueueSummary','then','log','once','exports','asterisk-manager','moment','lodash','../../config/logger','asterisk','port','username','password','Action','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x0960,0x15c));var _0x0096=function(_0xa9df71,_0x1a06c9){_0xa9df71=_0xa9df71-0x0;var _0x3cfa15=_0x0960[_0xa9df71];return _0x3cfa15;};'use strict';var Manager=require(_0x0096('0x0'));var BPromise=require('bluebird');var moment=require(_0x0096('0x1'));var util=require('util');var _=require(_0x0096('0x2'));var logger=require(_0x0096('0x3'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x0096('0x4')][_0x0096('0x5')],config[_0x0096('0x4')]['ip'],config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk'][_0x0096('0x7')],!![]);ami['keepConnected']();ami[_0x0096('0x8')]=BPromise[_0x0096('0x9')](ami['action']);function error(_0x2b92ef){logger['error'](util[_0x0096('0xa')](_0x0096('0xb'),config[_0x0096('0x4')][_0x0096('0x6')],config[_0x0096('0x4')]['ip'],config['asterisk'][_0x0096('0x5')],util['inspect'](_0x2b92ef,![],null)));}function close(){logger[_0x0096('0xc')](util[_0x0096('0xa')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk']['ip'],config[_0x0096('0x4')][_0x0096('0x5')]));}ami[_0x0096('0xd')]=function(){return function(){return ami[_0x0096('0x8')]({'action':_0x0096('0xe')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x0096('0x8')]({'action':_0x0096('0xf')});};};ami[_0x0096('0x10')]=function(){return function(){return ami['Action']({'action':_0x0096('0x11')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami[_0x0096('0x12')]=function(){return function(){return ami[_0x0096('0x8')]({'action':_0x0096('0x13')});};};function connect(_0x37e4a7){logger[_0x0096('0x14')](util[_0x0096('0xa')](_0x0096('0x15'),config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk']['ip'],config[_0x0096('0x4')]['port']));ami['once'](_0x0096('0xc'),error);ami['once'](_0x0096('0x16'),close);}ami['on'](_0x0096('0x17'),connect);ami['on'](_0x0096('0x18'),function(_0x2f6854){logger[_0x0096('0x14')](util[_0x0096('0xa')](_0x0096('0x19'),config[_0x0096('0x4')][_0x0096('0x6')],config['asterisk']['ip'],config[_0x0096('0x4')][_0x0096('0x5')],util['inspect'](_0x2f6854,![],null)));});ami['on'](_0x0096('0x1a'),function(_0x14b7c0){logger[_0x0096('0x14')](util['format'](_0x0096('0x1b'),config[_0x0096('0x4')]['username'],config['asterisk']['ip'],config['asterisk'][_0x0096('0x5')]));return BPromise['resolve']()['then'](ami[_0x0096('0xd')]())['then'](ami[_0x0096('0x1c')]())['then'](ami[_0x0096('0x10')]())['then'](ami[_0x0096('0x1d')]())[_0x0096('0x1e')](ami[_0x0096('0x12')]())['catch'](function(_0x3f653e){console[_0x0096('0x1f')](_0x3f653e);});});ami[_0x0096('0x20')]('error',error);ami['once'](_0x0096('0x16'),close);module[_0x0096('0x21')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index d829593..1298835 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 _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x4689d0,_0x5a28c5){var _0xb61270=function(_0x290db1){while(--_0x290db1){_0x4689d0['push'](_0x4689d0['shift']());}};_0xb61270(++_0x5a28c5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file +var _0xbdb7=['result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','debug','error','message'];(function(_0x5e0899,_0x5919e0){var _0x57c743=function(_0x4e65a4){while(--_0x4e65a4){_0x5e0899['push'](_0x5e0899['shift']());}};_0x57c743(++_0x5919e0);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x348ca1,_0x429707){_0x348ca1=_0x348ca1-0x0;var _0x466322=_0xbdb7[_0x348ca1];return _0x466322;};'use strict';var jayson=require(_0x7bdb('0x0'));var BPromise=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var client=jayson[_0x7bdb('0x4')][_0x7bdb('0x5')]({'port':0x2329});client[_0x7bdb('0x6')]=function(_0x2c7e07,_0x46c068){return new BPromise(function(_0x47aec5,_0x28542c){return client['request'](_0x2c7e07,_0x46c068)['then'](function(_0xffdc86){logger[_0x7bdb('0x7')]('rpc','memberReport',_0x2c7e07,_0x46c068,_0xffdc86);if(_0xffdc86[_0x7bdb('0x8')]){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')],_0x46c068);return _0x28542c(_0xffdc86[_0x7bdb('0x8')][_0x7bdb('0x9')]);}else{return _0x47aec5(_0xffdc86[_0x7bdb('0xa')]);}})[_0x7bdb('0xb')](function(_0x297724){logger[_0x7bdb('0x8')]('rpc','memberReport',_0x2c7e07,_0x297724,_0x46c068);return _0x28542c(_0x297724);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index f52089b..db295d6 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 _0x001c=['originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','util','moment','isNil','string','voiceQueue','uniqueid','name','Contact','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme'];(function(_0x2f5c34,_0x63774c){var _0x427902=function(_0x2c98e2){while(--_0x2c98e2){_0x2f5c34['push'](_0x2f5c34['shift']());}};_0x427902(++_0x63774c);}(_0x001c,0x14a));var _0xc001=function(_0x411b5b,_0x55ba11){_0x411b5b=_0x411b5b-0x0;var _0x4e8c9f=_0x001c[_0x411b5b];return _0x4e8c9f;};'use strict';var util=require(_0xc001('0x0'));var _=require('lodash');var moment=require(_0xc001('0x1'));function checkNameSurname(_0x4baf57,_0x1534cb,_0x2ea36f){var _0x1f8b31='';if(!_[_0xc001('0x2')](_0x1534cb)&&_0xc001('0x3')===typeof _0x1534cb){_0x1f8b31+=_0x1534cb;}if(!_[_0xc001('0x2')](_0x2ea36f)&&'string'===typeof _0x2ea36f){_0x1f8b31+='\x20'+_0x2ea36f;}if(_0x1f8b31!==''){return _0x1f8b31;}return _0x4baf57;}function Action(_0x37d13e,_0x55da46,_0x46b272){this[_0xc001('0x4')]=_0x37d13e;this[_0xc001('0x5')]=_0x46b272||undefined;this[_0xc001('0x6')]=checkNameSurname(_0x55da46['Contact']['phone'],_0x55da46[_0xc001('0x7')]['firstName'],_0x55da46['Contact']['lastName']);this[_0xc001('0x8')]=_0x55da46[_0xc001('0x7')][_0xc001('0x9')];this[_0xc001('0xa')]=_0x37d13e['name'];this['active']=_0x55da46[_0xc001('0xb')]||![];this[_0xc001('0xc')]=_0x37d13e[_0xc001('0xc')];this[_0xc001('0xd')]=_0x37d13e[_0xc001('0xd')]||0x3;this[_0xc001('0xe')]=_0x55da46['scheduledat'];this[_0xc001('0xf')]=_0x55da46['countbusyretry'];this[_0xc001('0x10')]=_0x55da46['countcongestionretry'];this[_0xc001('0x11')]=_0x55da46[_0xc001('0x11')];this[_0xc001('0x12')]=_0x55da46[_0xc001('0x12')];this[_0xc001('0x13')]=_0x55da46[_0xc001('0x13')];this[_0xc001('0x14')]=_0x55da46[_0xc001('0x14')];this[_0xc001('0x15')]=_0x55da46[_0xc001('0x15')];this['countagentrejectretry']=_0x55da46[_0xc001('0x16')];this[_0xc001('0x17')]=_0x55da46[_0xc001('0x17')];this[_0xc001('0x18')]=_0x55da46[_0xc001('0x18')];this[_0xc001('0x19')]=_0x55da46['UserId'];this[_0xc001('0x1a')]=_0x55da46[_0xc001('0x1a')];this[_0xc001('0x1b')]=_0x55da46['CampaignId'];this[_0xc001('0x1c')]=_0x55da46['id'];this[_0xc001('0x1d')]=_0x55da46[_0xc001('0x7')][_0xc001('0x1e')]||'';this[_0xc001('0x1f')]=moment()[_0xc001('0x20')](_0xc001('0x21'));this['callback']=_0x55da46[_0xc001('0x22')];this[_0xc001('0x23')]=_0x55da46[_0xc001('0x23')];this[_0xc001('0x24')]=_0x55da46['callbackat'];this['recallme']=_0x55da46[_0xc001('0x25')];this[_0xc001('0x26')]='';this[_0xc001('0x27')]='';}Action[_0xc001('0x28')][_0xc001('0x29')]=function(){return util[_0xc001('0x20')](_0xc001('0x2a'),this[_0xc001('0x6')],this[_0xc001('0x4')][_0xc001('0x2b')]>0x0?this['number'][_0xc001('0x2c')](this[_0xc001('0x4')][_0xc001('0x2b')]):this[_0xc001('0x8')]);};Action[_0xc001('0x28')][_0xc001('0x2d')]=function(){return this[_0xc001('0xa')];};module['exports']=Action; \ No newline at end of file +var _0xfa4d=['dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','queue','exports','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','active','type'];(function(_0x1d05ef,_0x1df6a8){var _0x1436eb=function(_0x49b1ec){while(--_0x49b1ec){_0x1d05ef['push'](_0x1d05ef['shift']());}};_0x1436eb(++_0x1df6a8);}(_0xfa4d,0x122));var _0xdfa4=function(_0x1cc6a0,_0x409da3){_0x1cc6a0=_0x1cc6a0-0x0;var _0x28e566=_0xfa4d[_0x1cc6a0];return _0x28e566;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x5e1b9c,_0x25e0e5,_0x17a707){var _0x439337='';if(!_[_0xdfa4('0x0')](_0x25e0e5)&&_0xdfa4('0x1')===typeof _0x25e0e5){_0x439337+=_0x25e0e5;}if(!_['isNil'](_0x17a707)&&_0xdfa4('0x1')===typeof _0x17a707){_0x439337+='\x20'+_0x17a707;}if(_0x439337!==''){return _0x439337;}return _0x5e1b9c;}function Action(_0xc7ca03,_0x283b40,_0x16f30b){this[_0xdfa4('0x2')]=_0xc7ca03;this[_0xdfa4('0x3')]=_0x16f30b||undefined;this[_0xdfa4('0x4')]=checkNameSurname(_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x6')],_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x7')],_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x8')]);this['number']=_0x283b40[_0xdfa4('0x5')][_0xdfa4('0x6')];this['queue']=_0xc7ca03[_0xdfa4('0x4')];this[_0xdfa4('0x9')]=_0x283b40[_0xdfa4('0x9')]||![];this['type']=_0xc7ca03[_0xdfa4('0xa')];this[_0xdfa4('0xb')]=_0xc7ca03[_0xdfa4('0xb')]||0x3;this[_0xdfa4('0xc')]=_0x283b40[_0xdfa4('0xc')];this['countbusyretry']=_0x283b40[_0xdfa4('0xd')];this[_0xdfa4('0xe')]=_0x283b40['countcongestionretry'];this[_0xdfa4('0xf')]=_0x283b40[_0xdfa4('0xf')];this[_0xdfa4('0x10')]=_0x283b40[_0xdfa4('0x10')];this[_0xdfa4('0x11')]=_0x283b40[_0xdfa4('0x11')];this[_0xdfa4('0x12')]=_0x283b40[_0xdfa4('0x12')];this[_0xdfa4('0x13')]=_0x283b40[_0xdfa4('0x13')];this['countagentrejectretry']=_0x283b40[_0xdfa4('0x14')];this[_0xdfa4('0x15')]=_0x283b40[_0xdfa4('0x15')];this[_0xdfa4('0x16')]=_0x283b40[_0xdfa4('0x16')];this[_0xdfa4('0x17')]=_0x283b40['UserId'];this[_0xdfa4('0x18')]=_0x283b40[_0xdfa4('0x18')];this['CampaignId']=_0x283b40['CampaignId'];this['idHopper']=_0x283b40['id'];this[_0xdfa4('0x19')]=_0x283b40[_0xdfa4('0x5')]['firstName']||'';this[_0xdfa4('0x1a')]=moment()[_0xdfa4('0x1b')](_0xdfa4('0x1c'));this[_0xdfa4('0x1d')]=_0x283b40[_0xdfa4('0x1d')];this['callbackuniqueid']=_0x283b40['callbackuniqueid'];this[_0xdfa4('0x1e')]=_0x283b40['callbackat'];this[_0xdfa4('0x1f')]=_0x283b40[_0xdfa4('0x1f')];this[_0xdfa4('0x20')]='';this[_0xdfa4('0x21')]='';}Action[_0xdfa4('0x22')][_0xdfa4('0x23')]=function(){return util[_0xdfa4('0x1b')](_0xdfa4('0x24'),this[_0xdfa4('0x4')],this[_0xdfa4('0x2')][_0xdfa4('0x25')]>0x0?this[_0xdfa4('0x26')][_0xdfa4('0x27')](this[_0xdfa4('0x2')][_0xdfa4('0x25')]):this[_0xdfa4('0x26')]);};Action['prototype'][_0xdfa4('0x28')]=function(){return this[_0xdfa4('0x29')];};module[_0xdfa4('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 b5cec6e..fe5421a 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 _0xe12b=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x353d12,_0x52dcdc){var _0x24ad8b=function(_0x547b60){while(--_0x547b60){_0x353d12['push'](_0x353d12['shift']());}};_0x24ad8b(++_0x52dcdc);}(_0xe12b,0x65));var _0xbe12=function(_0x3c34e6,_0x254d61){_0x3c34e6=_0x3c34e6-0x0;var _0x57198e=_0xe12b[_0x3c34e6];return _0x57198e;};'use strict';var util=require(_0xbe12('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x2063e0,_0x31cfaa){var _0x27276e=moment(_0x2063e0)[_0xbe12('0x1')](0x0);var _0x32b3a0=moment(_0x31cfaa)[_0xbe12('0x1')](0x0);return _0x27276e[_0xbe12('0x2')](_0x32b3a0,_0xbe12('0x3'));}function AgentComplete(_0x4ffbca,_0x2ac3c3){this['state']=0x4;this[_0xbe12('0x4')]=_0xbe12('0x5');this['scheduledat']=_0x4ffbca[_0xbe12('0x6')];this[_0xbe12('0x7')]=_0x4ffbca[_0xbe12('0x7')];this[_0xbe12('0x8')]=_0x4ffbca[_0xbe12('0x7')]===_0xbe12('0x9')?_0xbe12('0xa'):_0x4ffbca[_0xbe12('0x7')];this[_0xbe12('0xb')]=_0x4ffbca[_0xbe12('0xb')];this[_0xbe12('0xc')]=_0x4ffbca[_0xbe12('0xc')];this[_0xbe12('0xd')]=_0x4ffbca['countnoanswerretry'];this[_0xbe12('0xe')]=_0x4ffbca[_0xbe12('0xb')]+_0x4ffbca[_0xbe12('0xc')]+_0x4ffbca[_0xbe12('0xd')]+_0x4ffbca[_0xbe12('0xf')]+_0x4ffbca[_0xbe12('0x10')]+_0x4ffbca[_0xbe12('0x11')]+_0x4ffbca[_0xbe12('0x12')]+_0x4ffbca[_0xbe12('0x13')];this['countnosuchnumberretry']=_0x4ffbca[_0xbe12('0xf')];this[_0xbe12('0x10')]=_0x4ffbca[_0xbe12('0x10')];this[_0xbe12('0x11')]=_0x4ffbca[_0xbe12('0x11')];this[_0xbe12('0x12')]=_0x4ffbca['countmachineretry'];this[_0xbe12('0x13')]=_0x4ffbca[_0xbe12('0x13')];this[_0xbe12('0x14')]=_0x2ac3c3[_0xbe12('0x14')];this[_0xbe12('0x15')]=_0x4ffbca[_0xbe12('0x16')];this[_0xbe12('0x17')]=_0x4ffbca[_0xbe12('0x18')];this[_0xbe12('0x19')]=_0x4ffbca[_0xbe12('0x19')];this[_0xbe12('0x1a')]=_0x4ffbca[_0xbe12('0x1a')];this[_0xbe12('0x1b')]=_0x4ffbca[_0xbe12('0x1b')];this['endtime']=moment()[_0xbe12('0x1c')](_0xbe12('0x1d'));this[_0xbe12('0x1e')]=getSeconds(_0x4ffbca[_0xbe12('0x1a')],_0x4ffbca[_0xbe12('0x19')]);this[_0xbe12('0x1f')]=getSeconds(_0x4ffbca[_0xbe12('0x1b')],_0x4ffbca[_0xbe12('0x1a')]);this[_0xbe12('0x20')]=getSeconds(this['endtime'],_0x4ffbca['answertime']);this['queue']=_0x2ac3c3['queue'];this[_0xbe12('0x21')]=_0x2ac3c3['membername'];this[_0xbe12('0x22')]=_0x2ac3c3['reason'];this[_0xbe12('0x23')]=_0x4ffbca[_0xbe12('0x23')];this['callbackuniqueid']=_0x4ffbca[_0xbe12('0x24')];this[_0xbe12('0x25')]=_0x4ffbca['callbackat'];this[_0xbe12('0x26')]=_0x4ffbca[_0xbe12('0x26')];this['ContactId']=_0x4ffbca[_0xbe12('0x27')];this[_0xbe12('0x28')]=_0x4ffbca[_0xbe12('0x28')];this[_0xbe12('0x29')]=_0x4ffbca[_0xbe12('0x29')];this[_0xbe12('0x2a')]=_0x4ffbca[_0xbe12('0x2a')];this[_0xbe12('0x2b')]=_0x4ffbca[_0xbe12('0x2b')];this[_0xbe12('0x2c')]=_0x4ffbca[_0xbe12('0x2c')]||'';this['originatecalleridname']=_0x4ffbca[_0xbe12('0x2d')]||'';}module[_0xbe12('0x2e')]=AgentComplete; \ No newline at end of file +var _0x242d=['talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','state','statedesc','scheduledat','type','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','endtime','format'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x242d,0x19d));var _0xd242=function(_0x271d02,_0x5cd222){_0x271d02=_0x271d02-0x0;var _0x14112d=_0x242d[_0x271d02];return _0x14112d;};'use strict';var util=require('util');var _=require(_0xd242('0x0'));var moment=require(_0xd242('0x1'));function getSeconds(_0x356c02,_0x64c7f8){var _0x13c75f=moment(_0x356c02)[_0xd242('0x2')](0x0);var _0x41f56a=moment(_0x64c7f8)[_0xd242('0x2')](0x0);return _0x13c75f[_0xd242('0x3')](_0x41f56a,'seconds');}function AgentComplete(_0x35dd66,_0x16238d){this[_0xd242('0x4')]=0x4;this[_0xd242('0x5')]='Answer';this['scheduledat']=_0x35dd66[_0xd242('0x6')];this[_0xd242('0x7')]=_0x35dd66['type'];this['campaigntype']=_0x35dd66[_0xd242('0x7')]==='outbound'?_0xd242('0x8'):_0x35dd66[_0xd242('0x7')];this['countbusyretry']=_0x35dd66['countbusyretry'];this[_0xd242('0x9')]=_0x35dd66['countcongestionretry'];this[_0xd242('0xa')]=_0x35dd66[_0xd242('0xa')];this[_0xd242('0xb')]=_0x35dd66[_0xd242('0xc')]+_0x35dd66[_0xd242('0x9')]+_0x35dd66[_0xd242('0xa')]+_0x35dd66['countnosuchnumberretry']+_0x35dd66[_0xd242('0xd')]+_0x35dd66[_0xd242('0xe')]+_0x35dd66[_0xd242('0xf')]+_0x35dd66['countagentrejectretry'];this[_0xd242('0x10')]=_0x35dd66[_0xd242('0x10')];this[_0xd242('0xd')]=_0x35dd66['countdropretry'];this[_0xd242('0xe')]=_0x35dd66['countabandonedretry'];this[_0xd242('0xf')]=_0x35dd66['countmachineretry'];this[_0xd242('0x11')]=_0x35dd66['countagentrejectretry'];this[_0xd242('0x12')]=_0x16238d[_0xd242('0x12')];this['calleridname']=_0x35dd66[_0xd242('0x13')];this[_0xd242('0x14')]=_0x35dd66[_0xd242('0x15')];this[_0xd242('0x16')]=_0x35dd66[_0xd242('0x16')];this[_0xd242('0x17')]=_0x35dd66[_0xd242('0x17')];this[_0xd242('0x18')]=_0x35dd66['answertime'];this[_0xd242('0x19')]=moment()[_0xd242('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x35dd66[_0xd242('0x17')],_0x35dd66[_0xd242('0x16')]);this['holdtime']=getSeconds(_0x35dd66['answertime'],_0x35dd66[_0xd242('0x17')]);this[_0xd242('0x1b')]=getSeconds(this['endtime'],_0x35dd66[_0xd242('0x18')]);this[_0xd242('0x8')]=_0x16238d['queue'];this[_0xd242('0x1c')]=_0x16238d[_0xd242('0x1c')];this[_0xd242('0x1d')]=_0x16238d['reason'];this[_0xd242('0x1e')]=_0x35dd66[_0xd242('0x1e')];this[_0xd242('0x1f')]=_0x35dd66[_0xd242('0x1f')];this[_0xd242('0x20')]=_0x35dd66[_0xd242('0x20')];this[_0xd242('0x21')]=_0x35dd66[_0xd242('0x21')];this[_0xd242('0x22')]=_0x35dd66[_0xd242('0x22')];this[_0xd242('0x23')]=_0x35dd66[_0xd242('0x23')];this[_0xd242('0x24')]=_0x35dd66[_0xd242('0x24')];this[_0xd242('0x25')]=_0x35dd66[_0xd242('0x25')];this[_0xd242('0x26')]=_0x35dd66['CampaignId'];this['originatecalleridnum']=_0x35dd66['originatecalleridnum']||'';this['originatecalleridname']=_0x35dd66['originatecalleridname']||'';}module[_0xd242('0x27')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index d72af24..695b1c4 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 _0xb647=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype'];(function(_0x5b668a,_0x5249fb){var _0x144688=function(_0x303273){while(--_0x303273){_0x5b668a['push'](_0x5b668a['shift']());}};_0x144688(++_0x5249fb);}(_0xb647,0xdb));var _0x7b64=function(_0x1cd01d,_0x306c15){_0x1cd01d=_0x1cd01d-0x0;var _0x640f87=_0xb647[_0x1cd01d];return _0x640f87;};'use strict';var util=require(_0x7b64('0x0'));var _=require(_0x7b64('0x1'));var moment=require(_0x7b64('0x2'));function getSeconds(_0x248af6,_0x38de52){var _0x3b659e=moment(_0x248af6)[_0x7b64('0x3')](0x0);var _0x2b0ff5=moment(_0x38de52)['milliseconds'](0x0);return _0x3b659e[_0x7b64('0x4')](_0x2b0ff5,'seconds');}function Final(_0x1daa28){this[_0x7b64('0x5')]=_0x1daa28[_0x7b64('0x5')];this[_0x7b64('0x6')]=_0x1daa28[_0x7b64('0x6')];this[_0x7b64('0x7')]=_0x1daa28[_0x7b64('0x7')];this[_0x7b64('0x8')]=_0x1daa28[_0x7b64('0x7')]==='outbound'?_0x7b64('0x9'):_0x1daa28['type'];this[_0x7b64('0xa')]=_0x1daa28['countbusyretry'];this['countcongestionretry']=_0x1daa28[_0x7b64('0xb')];this[_0x7b64('0xc')]=_0x1daa28['countnoanswerretry'];this[_0x7b64('0xd')]=_0x1daa28[_0x7b64('0xa')]+_0x1daa28[_0x7b64('0xb')]+_0x1daa28[_0x7b64('0xc')]+_0x1daa28[_0x7b64('0xe')]+_0x1daa28[_0x7b64('0xf')]+_0x1daa28[_0x7b64('0x10')]+_0x1daa28['countmachineretry']+_0x1daa28[_0x7b64('0x11')];this['countnosuchnumberretry']=_0x1daa28['countnosuchnumberretry'];this[_0x7b64('0xf')]=_0x1daa28[_0x7b64('0xf')];this[_0x7b64('0x10')]=_0x1daa28[_0x7b64('0x10')];this[_0x7b64('0x12')]=_0x1daa28[_0x7b64('0x12')];this[_0x7b64('0x11')]=_0x1daa28['countagentrejectretry'];this[_0x7b64('0x9')]=_0x1daa28[_0x7b64('0x9')];this[_0x7b64('0x13')]=_0x1daa28[_0x7b64('0x13')];this[_0x7b64('0x14')]=_0x1daa28['calleridnum'];this[_0x7b64('0x15')]=_0x1daa28[_0x7b64('0x15')];this['responsetime']=_0x1daa28[_0x7b64('0x16')];this[_0x7b64('0x17')]=_0x1daa28['responsetime'];this[_0x7b64('0x18')]=_0x1daa28[_0x7b64('0x18')]||0x0;this[_0x7b64('0x19')]=_0x1daa28[_0x7b64('0x19')]||0x0;this['talktime']=_0x1daa28[_0x7b64('0x1a')]||0x0;this[_0x7b64('0x1b')]=_0x1daa28['callback'];this[_0x7b64('0x1c')]=_0x1daa28['callbackuniqueid'];this[_0x7b64('0x1d')]=_0x1daa28['callbackat'];this[_0x7b64('0x1e')]=_0x1daa28[_0x7b64('0x1e')];this[_0x7b64('0x1f')]=_0x1daa28[_0x7b64('0x1f')];this[_0x7b64('0x20')]=_0x1daa28[_0x7b64('0x20')];this[_0x7b64('0x21')]=_0x1daa28[_0x7b64('0x21')];this[_0x7b64('0x22')]=_0x1daa28[_0x7b64('0x22')];this[_0x7b64('0x23')]=_0x1daa28[_0x7b64('0x23')];this[_0x7b64('0x24')]=_0x1daa28[_0x7b64('0x24')]||'';this['originatecalleridname']=_0x1daa28[_0x7b64('0x25')]||'';}module['exports']=Final; \ No newline at end of file +var _0x6c32=['originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId'];(function(_0x53fb9a,_0x5d9d96){var _0x4cbf98=function(_0x5a2a59){while(--_0x5a2a59){_0x53fb9a['push'](_0x53fb9a['shift']());}};_0x4cbf98(++_0x5d9d96);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x26c3('0x0'));var _=require(_0x26c3('0x1'));var moment=require(_0x26c3('0x2'));function getSeconds(_0x416a62,_0x2bbfc4){var _0x44fc8c=moment(_0x416a62)[_0x26c3('0x3')](0x0);var _0x321cc5=moment(_0x2bbfc4)[_0x26c3('0x3')](0x0);return _0x44fc8c['diff'](_0x321cc5,_0x26c3('0x4'));}function Final(_0x3f7065){this[_0x26c3('0x5')]=_0x3f7065['uniqueid'];this[_0x26c3('0x6')]=_0x3f7065['scheduledat'];this[_0x26c3('0x7')]=_0x3f7065[_0x26c3('0x7')];this[_0x26c3('0x8')]=_0x3f7065[_0x26c3('0x7')]===_0x26c3('0x9')?_0x26c3('0xa'):_0x3f7065[_0x26c3('0x7')];this[_0x26c3('0xb')]=_0x3f7065[_0x26c3('0xb')];this[_0x26c3('0xc')]=_0x3f7065['countcongestionretry'];this['countnoanswerretry']=_0x3f7065['countnoanswerretry'];this['countglobal']=_0x3f7065[_0x26c3('0xb')]+_0x3f7065[_0x26c3('0xc')]+_0x3f7065[_0x26c3('0xd')]+_0x3f7065[_0x26c3('0xe')]+_0x3f7065['countdropretry']+_0x3f7065['countabandonedretry']+_0x3f7065[_0x26c3('0xf')]+_0x3f7065[_0x26c3('0x10')];this[_0x26c3('0xe')]=_0x3f7065[_0x26c3('0xe')];this[_0x26c3('0x11')]=_0x3f7065['countdropretry'];this['countabandonedretry']=_0x3f7065[_0x26c3('0x12')];this[_0x26c3('0xf')]=_0x3f7065['countmachineretry'];this['countagentrejectretry']=_0x3f7065[_0x26c3('0x10')];this['queue']=_0x3f7065[_0x26c3('0xa')];this['calleridname']=_0x3f7065['calleridname'];this[_0x26c3('0x13')]=_0x3f7065['calleridnum'];this[_0x26c3('0x14')]=_0x3f7065['starttime'];this[_0x26c3('0x15')]=_0x3f7065[_0x26c3('0x15')];this[_0x26c3('0x16')]=_0x3f7065[_0x26c3('0x15')];this[_0x26c3('0x17')]=_0x3f7065['ringtime']||0x0;this['holdtime']=_0x3f7065[_0x26c3('0x18')]||0x0;this[_0x26c3('0x19')]=_0x3f7065['talktime']||0x0;this['callback']=_0x3f7065[_0x26c3('0x1a')];this['callbackuniqueid']=_0x3f7065['callbackuniqueid'];this[_0x26c3('0x1b')]=_0x3f7065['callbackat'];this[_0x26c3('0x1c')]=_0x3f7065['recallme'];this[_0x26c3('0x1d')]=_0x3f7065['ContactId'];this[_0x26c3('0x1e')]=_0x3f7065[_0x26c3('0x1e')];this[_0x26c3('0x1f')]=_0x3f7065[_0x26c3('0x1f')];this[_0x26c3('0x20')]=_0x3f7065[_0x26c3('0x20')];this[_0x26c3('0x21')]=_0x3f7065[_0x26c3('0x21')];this[_0x26c3('0x22')]=_0x3f7065[_0x26c3('0x22')]||'';this['originatecalleridname']=_0x3f7065[_0x26c3('0x23')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 73bd67e..636f03c 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 _0x70d6=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','IVR','cause-txt'];(function(_0x3e5034,_0x5bb42f){var _0x3e8dd3=function(_0x265c3c){while(--_0x265c3c){_0x3e5034['push'](_0x3e5034['shift']());}};_0x3e8dd3(++_0x5bb42f);}(_0x70d6,0x184));var _0x670d=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x70d6[_0x3e5086];return _0xfeb102;};'use strict';var util=require(_0x670d('0x0'));var _=require('lodash');var moment=require(_0x670d('0x1'));function getSeconds(_0x48a295,_0x580534){var _0x3d1520=moment(_0x48a295)[_0x670d('0x2')](0x0);var _0x1cec25=moment(_0x580534)[_0x670d('0x2')](0x0);return _0x3d1520[_0x670d('0x3')](_0x1cec25,_0x670d('0x4'));}function Hangup(_0x2e93da,_0x1da405){this['state']=0x4;this[_0x670d('0x5')]='Answer';this[_0x670d('0x6')]=_0x2e93da[_0x670d('0x6')];this[_0x670d('0x7')]=_0x2e93da[_0x670d('0x7')];this[_0x670d('0x8')]=_0x2e93da[_0x670d('0x7')]===_0x670d('0x9')?_0x670d('0xa'):_0x2e93da[_0x670d('0x7')];this[_0x670d('0xb')]=_0x2e93da[_0x670d('0xb')];this[_0x670d('0xc')]=_0x2e93da[_0x670d('0xc')];this[_0x670d('0xd')]=_0x2e93da[_0x670d('0xd')];this[_0x670d('0xe')]=_0x2e93da['countbusyretry']+_0x2e93da[_0x670d('0xc')]+_0x2e93da[_0x670d('0xd')]+_0x2e93da[_0x670d('0xf')]+_0x2e93da['countdropretry']+_0x2e93da[_0x670d('0x10')]+_0x2e93da[_0x670d('0x11')]+_0x2e93da[_0x670d('0x12')];this['countnosuchnumberretry']=_0x2e93da[_0x670d('0xf')];this['countdropretry']=_0x2e93da[_0x670d('0x13')];this[_0x670d('0x10')]=_0x2e93da[_0x670d('0x10')];this[_0x670d('0x11')]=_0x2e93da[_0x670d('0x11')];this[_0x670d('0x12')]=_0x2e93da[_0x670d('0x12')];this[_0x670d('0x14')]=_0x1da405[_0x670d('0x14')];this[_0x670d('0x15')]=_0x2e93da['name'];this[_0x670d('0x16')]=_0x2e93da[_0x670d('0x17')];this[_0x670d('0x18')]=_0x2e93da['starttime'];this[_0x670d('0x19')]=_0x2e93da[_0x670d('0x19')];this['endtime']=moment()[_0x670d('0x1a')](_0x670d('0x1b'));this[_0x670d('0x1c')]=getSeconds(_0x2e93da[_0x670d('0x19')],_0x2e93da[_0x670d('0x18')]);this[_0x670d('0x1d')]=0x0;this['talktime']=getSeconds(this['endtime'],_0x2e93da[_0x670d('0x19')]);this[_0x670d('0xa')]=_0x2e93da[_0x670d('0xa')];this['membername']=_0x670d('0x1e');this['reason']=_0x1da405[_0x670d('0x1f')];this['callback']=_0x2e93da[_0x670d('0x20')];this['callbackuniqueid']=_0x2e93da[_0x670d('0x21')];this[_0x670d('0x22')]=_0x2e93da[_0x670d('0x22')];this[_0x670d('0x23')]=_0x2e93da[_0x670d('0x23')];this[_0x670d('0x24')]=_0x2e93da[_0x670d('0x24')];this[_0x670d('0x25')]=_0x2e93da[_0x670d('0x25')];this[_0x670d('0x26')]=_0x2e93da['UserId'];this[_0x670d('0x27')]=_0x2e93da['VoiceQueueId'];this[_0x670d('0x28')]=_0x2e93da[_0x670d('0x28')];}module[_0x670d('0x29')]=Hangup; \ No newline at end of file +var _0x2374=['countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry'];(function(_0x784673,_0x3b2f2e){var _0x1ab8a5=function(_0x49754d){while(--_0x49754d){_0x784673['push'](_0x784673['shift']());}};_0x1ab8a5(++_0x3b2f2e);}(_0x2374,0x6a));var _0x4237=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x2374[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0x4237('0x0'));var _=require('lodash');var moment=require(_0x4237('0x1'));function getSeconds(_0x5af9d2,_0x20f6c5){var _0xff676c=moment(_0x5af9d2)[_0x4237('0x2')](0x0);var _0x5234f0=moment(_0x20f6c5)['milliseconds'](0x0);return _0xff676c['diff'](_0x5234f0,'seconds');}function Hangup(_0x5a0d7d,_0x4280e4){this['state']=0x4;this['statedesc']='Answer';this[_0x4237('0x3')]=_0x5a0d7d[_0x4237('0x3')];this['type']=_0x5a0d7d[_0x4237('0x4')];this[_0x4237('0x5')]=_0x5a0d7d[_0x4237('0x4')]==='outbound'?_0x4237('0x6'):_0x5a0d7d['type'];this[_0x4237('0x7')]=_0x5a0d7d['countbusyretry'];this[_0x4237('0x8')]=_0x5a0d7d['countcongestionretry'];this[_0x4237('0x9')]=_0x5a0d7d[_0x4237('0x9')];this['countglobal']=_0x5a0d7d[_0x4237('0x7')]+_0x5a0d7d[_0x4237('0x8')]+_0x5a0d7d[_0x4237('0x9')]+_0x5a0d7d[_0x4237('0xa')]+_0x5a0d7d['countdropretry']+_0x5a0d7d['countabandonedretry']+_0x5a0d7d['countmachineretry']+_0x5a0d7d[_0x4237('0xb')];this[_0x4237('0xa')]=_0x5a0d7d[_0x4237('0xa')];this['countdropretry']=_0x5a0d7d[_0x4237('0xc')];this[_0x4237('0xd')]=_0x5a0d7d[_0x4237('0xd')];this[_0x4237('0xe')]=_0x5a0d7d[_0x4237('0xe')];this['countagentrejectretry']=_0x5a0d7d['countagentrejectretry'];this[_0x4237('0xf')]=_0x4280e4[_0x4237('0xf')];this[_0x4237('0x10')]=_0x5a0d7d[_0x4237('0x11')];this[_0x4237('0x12')]=_0x5a0d7d[_0x4237('0x13')];this[_0x4237('0x14')]=_0x5a0d7d[_0x4237('0x14')];this[_0x4237('0x15')]=_0x5a0d7d[_0x4237('0x15')];this[_0x4237('0x16')]=moment()[_0x4237('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x4237('0x18')]=getSeconds(_0x5a0d7d['responsetime'],_0x5a0d7d[_0x4237('0x14')]);this['holdtime']=0x0;this[_0x4237('0x19')]=getSeconds(this[_0x4237('0x16')],_0x5a0d7d[_0x4237('0x15')]);this[_0x4237('0x6')]=_0x5a0d7d[_0x4237('0x6')];this[_0x4237('0x1a')]=_0x4237('0x1b');this[_0x4237('0x1c')]=_0x4280e4[_0x4237('0x1d')];this[_0x4237('0x1e')]=_0x5a0d7d['callback'];this['callbackuniqueid']=_0x5a0d7d['callbackuniqueid'];this[_0x4237('0x1f')]=_0x5a0d7d[_0x4237('0x1f')];this[_0x4237('0x20')]=_0x5a0d7d['recallme'];this[_0x4237('0x21')]=_0x5a0d7d[_0x4237('0x21')];this[_0x4237('0x22')]=_0x5a0d7d[_0x4237('0x22')];this['UserId']=_0x5a0d7d[_0x4237('0x23')];this[_0x4237('0x24')]=_0x5a0d7d['VoiceQueueId'];this['CampaignId']=_0x5a0d7d[_0x4237('0x25')];}module[_0x4237('0x26')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 2359cb5..fb83287 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 _0x3d69=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0x3d69,0xf4));var _0x93d6=function(_0x4852df,_0x2c2113){_0x4852df=_0x4852df-0x0;var _0x75ec6=_0x3d69[_0x4852df];return _0x75ec6;};'use strict';var util=require(_0x93d6('0x0'));var _=require(_0x93d6('0x1'));var moment=require(_0x93d6('0x2'));function getSeconds(_0x29fb10,_0x349bda){var _0x1fa3d5=moment(_0x29fb10)[_0x93d6('0x3')](0x0);var _0x5d5997=moment(_0x349bda)[_0x93d6('0x3')](0x0);return _0x1fa3d5[_0x93d6('0x4')](_0x5d5997,_0x93d6('0x5'));}function History(_0x11f0ea){this[_0x93d6('0x6')]=_0x11f0ea[_0x93d6('0x6')];this[_0x93d6('0x7')]=_0x11f0ea['scheduledat']||undefined;this[_0x93d6('0x8')]=_0x11f0ea[_0x93d6('0x8')];this[_0x93d6('0x9')]=_0x11f0ea['type']==='outbound'?_0x93d6('0xa'):_0x11f0ea[_0x93d6('0x8')];this['countbusyretry']=_0x11f0ea[_0x93d6('0xb')];this['countcongestionretry']=_0x11f0ea[_0x93d6('0xc')];this['countnoanswerretry']=_0x11f0ea[_0x93d6('0xd')];this[_0x93d6('0xe')]=_0x11f0ea[_0x93d6('0xb')]+_0x11f0ea['countcongestionretry']+_0x11f0ea[_0x93d6('0xd')]+_0x11f0ea[_0x93d6('0xf')]+_0x11f0ea[_0x93d6('0x10')]+_0x11f0ea[_0x93d6('0x11')]+_0x11f0ea[_0x93d6('0x12')]+_0x11f0ea[_0x93d6('0x13')];this['countnosuchnumberretry']=_0x11f0ea[_0x93d6('0xf')];this[_0x93d6('0x10')]=_0x11f0ea['countdropretry'];this[_0x93d6('0x11')]=_0x11f0ea[_0x93d6('0x11')];this[_0x93d6('0x12')]=_0x11f0ea[_0x93d6('0x12')];this[_0x93d6('0x13')]=_0x11f0ea[_0x93d6('0x13')];this[_0x93d6('0xa')]=_0x11f0ea[_0x93d6('0xa')];this[_0x93d6('0x14')]=_0x11f0ea['name'];this[_0x93d6('0x15')]=_0x11f0ea[_0x93d6('0x16')];this[_0x93d6('0x17')]=_0x11f0ea[_0x93d6('0x17')];this[_0x93d6('0x18')]=_0x11f0ea[_0x93d6('0x18')];this[_0x93d6('0x19')]=_0x11f0ea[_0x93d6('0x18')];this[_0x93d6('0x1a')]=getSeconds(_0x11f0ea[_0x93d6('0x18')],_0x11f0ea[_0x93d6('0x17')]);this[_0x93d6('0x1b')]=0x0;this[_0x93d6('0x1c')]=0x0;this[_0x93d6('0x1d')]=_0x11f0ea['callback'];this[_0x93d6('0x1e')]=_0x11f0ea[_0x93d6('0x1e')];this[_0x93d6('0x1f')]=_0x11f0ea['callbackat'];this['recallme']=_0x11f0ea[_0x93d6('0x20')];this[_0x93d6('0x21')]=_0x11f0ea['ContactId'];this['ListId']=_0x11f0ea[_0x93d6('0x22')];this[_0x93d6('0x23')]=_0x11f0ea[_0x93d6('0x23')];this[_0x93d6('0x24')]=_0x11f0ea[_0x93d6('0x24')];this[_0x93d6('0x25')]=_0x11f0ea['CampaignId'];this[_0x93d6('0x26')]=_0x11f0ea[_0x93d6('0x26')]||'';this[_0x93d6('0x27')]=_0x11f0ea[_0x93d6('0x27')]||'';}module[_0x93d6('0x28')]=History; \ No newline at end of file +var _0x3e05=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x63b5e6,_0x4547de){var _0x29efdb=function(_0x53fb77){while(--_0x53fb77){_0x63b5e6['push'](_0x63b5e6['shift']());}};_0x29efdb(++_0x4547de);}(_0x3e05,0x64));var _0x53e0=function(_0x2278b5,_0x46a568){_0x2278b5=_0x2278b5-0x0;var _0x5575b9=_0x3e05[_0x2278b5];return _0x5575b9;};'use strict';var util=require('util');var _=require(_0x53e0('0x0'));var moment=require(_0x53e0('0x1'));function getSeconds(_0x54c629,_0x4c2742){var _0x5b7b18=moment(_0x54c629)[_0x53e0('0x2')](0x0);var _0x3d0af2=moment(_0x4c2742)[_0x53e0('0x2')](0x0);return _0x5b7b18[_0x53e0('0x3')](_0x3d0af2,_0x53e0('0x4'));}function History(_0x3d506d){this[_0x53e0('0x5')]=_0x3d506d[_0x53e0('0x5')];this[_0x53e0('0x6')]=_0x3d506d[_0x53e0('0x6')]||undefined;this['type']=_0x3d506d[_0x53e0('0x7')];this['campaigntype']=_0x3d506d['type']===_0x53e0('0x8')?_0x53e0('0x9'):_0x3d506d[_0x53e0('0x7')];this[_0x53e0('0xa')]=_0x3d506d[_0x53e0('0xa')];this[_0x53e0('0xb')]=_0x3d506d[_0x53e0('0xb')];this[_0x53e0('0xc')]=_0x3d506d['countnoanswerretry'];this[_0x53e0('0xd')]=_0x3d506d[_0x53e0('0xa')]+_0x3d506d[_0x53e0('0xb')]+_0x3d506d[_0x53e0('0xc')]+_0x3d506d[_0x53e0('0xe')]+_0x3d506d[_0x53e0('0xf')]+_0x3d506d[_0x53e0('0x10')]+_0x3d506d['countmachineretry']+_0x3d506d['countagentrejectretry'];this[_0x53e0('0xe')]=_0x3d506d[_0x53e0('0xe')];this[_0x53e0('0xf')]=_0x3d506d[_0x53e0('0xf')];this[_0x53e0('0x10')]=_0x3d506d['countabandonedretry'];this[_0x53e0('0x11')]=_0x3d506d[_0x53e0('0x11')];this[_0x53e0('0x12')]=_0x3d506d[_0x53e0('0x12')];this['queue']=_0x3d506d[_0x53e0('0x9')];this[_0x53e0('0x13')]=_0x3d506d['name'];this[_0x53e0('0x14')]=_0x3d506d[_0x53e0('0x15')];this[_0x53e0('0x16')]=_0x3d506d[_0x53e0('0x16')];this[_0x53e0('0x17')]=_0x3d506d[_0x53e0('0x17')];this[_0x53e0('0x18')]=_0x3d506d[_0x53e0('0x17')];this[_0x53e0('0x19')]=getSeconds(_0x3d506d[_0x53e0('0x17')],_0x3d506d[_0x53e0('0x16')]);this['holdtime']=0x0;this[_0x53e0('0x1a')]=0x0;this[_0x53e0('0x1b')]=_0x3d506d[_0x53e0('0x1b')];this['callbackuniqueid']=_0x3d506d[_0x53e0('0x1c')];this[_0x53e0('0x1d')]=_0x3d506d[_0x53e0('0x1d')];this['recallme']=_0x3d506d[_0x53e0('0x1e')];this['ContactId']=_0x3d506d['ContactId'];this[_0x53e0('0x1f')]=_0x3d506d['ListId'];this['UserId']=_0x3d506d[_0x53e0('0x20')];this[_0x53e0('0x21')]=_0x3d506d['VoiceQueueId'];this[_0x53e0('0x22')]=_0x3d506d[_0x53e0('0x22')];this['originatecalleridnum']=_0x3d506d[_0x53e0('0x23')]||'';this['originatecalleridname']=_0x3d506d[_0x53e0('0x24')]||'';}module[_0x53e0('0x25')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 1faef86..fb211c0 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 _0x9181=['stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','SIP/%s','reachable','unmonitored','syncVarSet','variable','exten','xcally-motion-dialer','HANGUP','voiceQueues','outboundAnswerCallsDay','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','value','Machine','membername','countmachineretry','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','uniqueid','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countglobal','[syncAgentComplete][createHistory][0]','reason\x2019\x20machine....','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','agent','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','dropreason','agiafterat','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','[rescheduleContact][Drop]','Drop','starttime','endtime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','paused','agents','stateinterface','locked','queueBooked','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','finally','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','interval','content','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Timezone:\x20','checkDialMethod','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialTimezone','[syncQueueSummary]','syncCampaigns','checkIsTrunkReachable','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','SIP/%s/%s%s','substring','from-sip','OriginateError','[originate][error]','syncOriginateResponse','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','outboundBusyCallsDay','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','outboundDropCallsDayTimeout','round','predictiveIntervalMaxThreshold','talking','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','Dropped\x20calls\x20day','dropRate','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','dialRecallMeTimeout','Agent','voicePause','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[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]','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','prototype','enqueue','tail','sequence','campaigns','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','type','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice_queue:save','ivr','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','inspect','error'];(function(_0x319449,_0x465890){var _0x176c7d=function(_0x3d5302){while(--_0x3d5302){_0x319449['push'](_0x319449['shift']());}};_0x176c7d(++_0x465890);}(_0x9181,0x182));var _0x1918=function(_0x39b811,_0x1f51fa){_0x39b811=_0x39b811-0x0;var _0x5ed29b=_0x9181[_0x39b811];return _0x5ed29b;};'use strict';var util=require(_0x1918('0x0'));var _=require(_0x1918('0x1'));var BPromise=require(_0x1918('0x2'));var uuid=require(_0x1918('0x3'));var moment=require(_0x1918('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x1918('0x5'));var ut=require('../preview/util/util');var config=require(_0x1918('0x6'));var logger=require(_0x1918('0x7'))(_0x1918('0x8'));var loggerBooked=require(_0x1918('0x7'))(_0x1918('0x9'));var loggerPredictive=require(_0x1918('0x7'))('predictive');var loggerPredictiveCalls=require(_0x1918('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x1918('0x7'))('syncQueueSummary');var ami=require(_0x1918('0xa'));config[_0x1918('0xb')]=_[_0x1918('0xc')](config[_0x1918('0xb')],{'host':_0x1918('0xd'),'port':0x18eb});var io=require(_0x1918('0xe'))(new Redis(config[_0x1918('0xb')]));var cmHopper=require(_0x1918('0xf'));var cmHopperHistory=require(_0x1918('0x10'));var cmHopperBlack=require(_0x1918('0x11'));var voiceQueueRt=require(_0x1918('0x12'));var Action=require(_0x1918('0x13'));var History=require(_0x1918('0x14'));var Final=require('./final');var AgentComplete=require(_0x1918('0x15'));var QueueCallerAbandon=require(_0x1918('0x16'));var Hangup=require(_0x1918('0x17'));var ipAgi=process[_0x1918('0x18')][_0x1918('0x19')]||_0x1918('0x1a');var strategy={'rrmemory':_0x1918('0x1b'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x1918('0x1c')][_0x1918('0x1d')]=function(_0x258c53){this[_0x1918('0x1e')]=this['tail']?this['tail']['finally'](_0x258c53):_0x258c53();};function Dialer(_0x193305,_0x844035){this[_0x1918('0x1f')]=new Sequence();this['preview']=_0x844035;this['voiceQueues']=_0x193305['voiceQueues'];this[_0x1918('0x20')]=_0x193305[_0x1918('0x20')];this['agents']=_0x193305['agents'];this['trunks']=_0x193305[_0x1918('0x21')];this[_0x1918('0x22')]=config[_0x1918('0x22')]||0x2;this['channels']={};this[_0x1918('0x23')]={};this[_0x1918('0x24')]={};this[_0x1918('0x25')]={};this[_0x1918('0x26')]={};this[_0x1918('0x27')]={};this[_0x1918('0x28')]={};this[_0x1918('0x29')]={};this['queueBooked']={};this[_0x1918('0x2a')]={};ami['on'](_0x1918('0x2b'),this[_0x1918('0x2c')][_0x1918('0x2d')](this));ami['on'](_0x1918('0x2e'),this['syncQueueCallerAbandon'][_0x1918('0x2d')](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));ami['on'](_0x1918('0x2f'),this[_0x1918('0x30')][_0x1918('0x2d')](this));ami['on'](_0x1918('0x31'),this[_0x1918('0x32')][_0x1918('0x2d')](this));ami['on'](_0x1918('0x33'),this[_0x1918('0x34')][_0x1918('0x2d')](this));ami['on'](_0x1918('0x35'),this[_0x1918('0x36')][_0x1918('0x2d')](this));ami['on'](_0x1918('0x37'),this['syncVarSet'][_0x1918('0x2d')](this));ami['on']('queuemember',this[_0x1918('0x38')][_0x1918('0x2d')](this));ami['on']('queuestatuscomplete',this[_0x1918('0x39')][_0x1918('0x2d')](this));this[_0x1918('0x3a')]();this[_0x1918('0x3b')]();}function isNotNull(_0x1dcecb){return _0x1dcecb!==null&&!_[_0x1918('0x3c')](_0x1dcecb);}function checkIsLoggedIn(_0x4adba0,_0x351405){return function(){if(_0x351405<=0x0){_0x4adba0[_0x1918('0x3d')]=_0x1918('0x3e');throw _0x4adba0['name']+_0x1918('0x3f');}};}function isActive(_0x3dbc81){return _0x3dbc81;}function checkIsActive(_0xd6944b,_0x440389){return function(){if(!isActive(_0x440389)){_0xd6944b[_0x1918('0x3d')]=_0x1918('0x40');throw _0xd6944b[_0x1918('0x41')]+_0x1918('0x42');}};}function checkInterval(_0x1a8103){return function(){if(!isNotNull(_0x1a8103['Interval'])){_0x1a8103[_0x1918('0x3d')]=_0x1918('0x43');throw _0x1a8103['name']+_0x1918('0x44');}if(!isNotNull(_0x1a8103[_0x1918('0x45')][_0x1918('0x46')])){_0x1a8103[_0x1918('0x3d')]='INTERVAL_IS_NULL';throw _0x1a8103[_0x1918('0x41')]+_0x1918('0x44');}if(!isNotNull(_[_0x1918('0x47')](_0x1a8103[_0x1918('0x45')][_0x1918('0x46')]))){_0x1a8103[_0x1918('0x3d')]=_0x1918('0x43');throw _0x1a8103[_0x1918('0x41')]+_0x1918('0x44');}};}function msgResponse(_0x2aa40d,_0x224394,_0x5d5963){return{'action':_0x2aa40d,'response':_0x224394,'message':_0x5d5963,'stack':_0x5d5963};}function myreject(_0x2e2916){return function(_0x22a753){return _0x2e2916(msgResponse(_0x1918('0x48'),_0x1918('0x49'),JSON[_0x1918('0x4a')](_0x22a753)));};}function getSeconds(_0x3ca167,_0x1ad6a1){var _0xad54b8=moment(_0x3ca167)[_0x1918('0x4b')](0x0);var _0x337ed7=moment(_0x1ad6a1)[_0x1918('0x4b')](0x0);return _0xad54b8[_0x1918('0x4c')](_0x337ed7,_0x1918('0x4d'));}function emit(_0x3a935d,_0x3db63b,_0x9996d8){io['to'](_0x3a935d)['emit'](_0x3db63b,_0x9996d8);}function emitVoiceQueueSummary(_0x20fd82){if(_0x20fd82['type']===_0x1918('0x4e')){var _0xc9a3dc={'id':_0x20fd82['id'],'name':_0x20fd82[_0x1918('0x41')],'strategy':_0x20fd82[_0x1918('0x4f')],'answered':_0x20fd82[_0x1918('0x50')],'available':_0x20fd82[_0x1918('0x51')],'loggedIn':_0x20fd82[_0x1918('0x52')],'pTalking':_0x20fd82[_0x1918('0x53')],'sumBillable':_0x20fd82[_0x1918('0x54')],'sumDuration':_0x20fd82['sumDuration'],'sumHoldTime':_0x20fd82[_0x1918('0x55')]||0x0,'talking':_0x20fd82['talking'],'total':_0x20fd82[_0x1918('0x56')],'type':_0x20fd82[_0x1918('0x57')],'unmanaged':_0x20fd82['unmanaged'],'abandoned':_0x20fd82['abandoned'],'waiting':_0x20fd82['waiting'],'loggedInDb':_0x20fd82[_0x1918('0x58')],'dialActive':_0x20fd82[_0x1918('0x59')],'dialMethod':_0x20fd82[_0x1918('0x5a')],'dialOriginateCallerIdName':_0x20fd82['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x20fd82[_0x1918('0x5b')],'dialOriginateTimeout':_0x20fd82[_0x1918('0x5c')],'dialPrefix':_0x20fd82[_0x1918('0x5d')],'outboundAnswerAgiCallsDay':_0x20fd82[_0x1918('0x5e')],'outboundAnswerCallsDay':_0x20fd82['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x20fd82[_0x1918('0x5f')],'outboundBusyCallsDay':_0x20fd82['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x20fd82['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x20fd82[_0x1918('0x60')],'outboundDropCallsDayCallersExit':_0x20fd82[_0x1918('0x61')],'outboundDropCallsDayTimeout':_0x20fd82['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x20fd82[_0x1918('0x62')],'outboundNoSuchCallsDay':_0x20fd82[_0x1918('0x63')],'outboundOriginateFailureCallsDay':_0x20fd82[_0x1918('0x64')],'outboundReCallsDay':_0x20fd82[_0x1918('0x65')],'outboundRejectCallsDay':_0x20fd82[_0x1918('0x66')],'outboundUnknownCallsDay':_0x20fd82[_0x1918('0x67')],'predictiveIntervalAnsweredCalls':_0x20fd82[_0x1918('0x68')],'predictiveIntervalAvgHoldtime':_0x20fd82['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x20fd82[_0x1918('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x20fd82[_0x1918('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x20fd82['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x20fd82['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x20fd82[_0x1918('0x6b')],'predictiveIntervalHitRate':_0x20fd82[_0x1918('0x6c')],'predictiveIntervalMultiplicativeFactor':_0x20fd82[_0x1918('0x6d')],'predictiveIntervalPauses':_0x20fd82[_0x1918('0x6e')],'predictiveIntervalAvailable':_0x20fd82[_0x1918('0x6f')],'predictiveIntervalTotalCalls':_0x20fd82[_0x1918('0x70')],'message':_0x20fd82[_0x1918('0x3d')],'originated':_0x20fd82[_0x1918('0x71')],'erlangCalls':_0x20fd82[_0x1918('0x72')],'erlangCallToSecond':_0x20fd82[_0x1918('0x73')],'erlangAbandonmentRate':_0x20fd82[_0x1918('0x74')],'erlangBusyFactor':_0x20fd82[_0x1918('0x75')],'startPredictive':_0x20fd82[_0x1918('0x27')],'startProgressive':_0x20fd82[_0x1918('0x28')]};if(_0x20fd82[_0x1918('0x76')]){_0xc9a3dc['Trunk']={'id':_0x20fd82[_0x1918('0x76')]['id'],'name':_0x20fd82[_0x1918('0x76')][_0x1918('0x41')],'active':_0x20fd82[_0x1918('0x76')][_0x1918('0x77')],'callerid':_0x20fd82['Trunk'][_0x1918('0x78')]};}if(_0x20fd82['Interval']){_0xc9a3dc[_0x1918('0x45')]={'id':_0x20fd82[_0x1918('0x45')]['id'],'name':_0x20fd82['Interval'][_0x1918('0x41')]};}var _0x54e117=md5(JSON['stringify'](_0xc9a3dc));if(_0x20fd82[_0x1918('0x79')]!==_0x54e117){_0x20fd82[_0x1918('0x79')]=_0x54e117;emit(util[_0x1918('0x7a')]('voice:queue:%s',_0xc9a3dc[_0x1918('0x41')]),_0x1918('0x7b'),_0xc9a3dc);}}}function emitCampaignSummary(_0x52cb45){if(_0x52cb45[_0x1918('0x57')]===_0x1918('0x7c')){emit(util['format'](_0x1918('0x7d'),_0x52cb45['name']),'campaign:save',_0x52cb45);}}function checkGetDataPredictive(_0x55bf84){if(isNotNull(_0x55bf84)&&!_[_0x1918('0x47')](_0x55bf84)){loggerPredictive[_0x1918('0x7e')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x1918('0x7e')](_0x1918('0x7f'),_0x55bf84[_0x1918('0x70')]);loggerPredictive[_0x1918('0x7e')](_0x1918('0x80'),_0x55bf84['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x1918('0x7e')](_0x1918('0x81'),_0x55bf84[_0x1918('0x82')]);loggerPredictive[_0x1918('0x7e')](_0x1918('0x83'),_0x55bf84[_0x1918('0x6a')]);loggerPredictive[_0x1918('0x7e')](_0x1918('0x84'),_0x55bf84[_0x1918('0x85')]);loggerPredictive[_0x1918('0x7e')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x55bf84['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x1918('0x86'));if(_0x55bf84[_0x1918('0x70')]>0x0){if(!_[_0x1918('0x3c')](_0x55bf84[_0x1918('0x69')])&&_0x55bf84[_0x1918('0x69')]>0x0){return!![];}loggerPredictive[_0x1918('0x7e')](_0x1918('0x87'));if(!_[_0x1918('0x3c')](_0x55bf84[_0x1918('0x85')])&&_0x55bf84['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x1918('0x7e')](_0x1918('0x88'));}else{loggerPredictive[_0x1918('0x7e')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x1918('0x89'));}return![];}function mergeDataErlangB(_0x175ca2){return function(_0x1ed717){loggerPredictive['info'](_0x1918('0x8a'));loggerPredictive[_0x1918('0x7e')](_0x1918('0x8b'),_0x1ed717[_0x1918('0x72')]);loggerPredictive[_0x1918('0x7e')](_0x1918('0x8c'),_0x1ed717[_0x1918('0x73')]);loggerPredictive[_0x1918('0x7e')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ed717['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1ed717[_0x1918('0x75')]);loggerPredictive[_0x1918('0x7e')](_0x1918('0x8d'),_0x1ed717[_0x1918('0x74')]);loggerPredictive['info'](_0x1918('0x86'));_[_0x1918('0x8e')](_0x175ca2,_0x1ed717);};}function getDiff(_0x3ea017){var _0x395b05=moment()[_0x1918('0x4b')](0x0);var _0x388bfe=moment(_0x3ea017)[_0x1918('0x4b')](0x0);return _0x395b05[_0x1918('0x4c')](_0x388bfe,_0x1918('0x4d'));}function ifInterval(_0x4a4d4c,_0x20e1df){if(_[_0x1918('0x3c')](_0x20e1df)){return![];}return getDiff(_0x20e1df)<_0x4a4d4c*0x3c;}function freeVariablesPredictive(_0x2b8ab2){if(isNotNull(_0x2b8ab2)){if(!_['isUndefined'](_0x2b8ab2[_0x1918('0x28')])){_0x2b8ab2['startProgressive']=undefined;loggerPredictive['info'](_0x2b8ab2[_0x1918('0x41')],_0x1918('0x8f'));}if(!_[_0x1918('0x3c')](_0x2b8ab2[_0x1918('0x27')])){_0x2b8ab2[_0x1918('0x27')]=undefined;loggerPredictive['info'](_0x2b8ab2[_0x1918('0x41')],_0x1918('0x90'));}if(!_[_0x1918('0x3c')](_0x2b8ab2[_0x1918('0x91')])){clearInterval(_0x2b8ab2['handlePredictive']);_0x2b8ab2[_0x1918('0x91')]=undefined;loggerPredictive[_0x1918('0x7e')](_0x2b8ab2[_0x1918('0x41')],_0x1918('0x92'));}}}function erlangb(_0x143033,_0x52c155){if(_0x52c155===0x0){return 0x0;}var _0x576ca3=0x1;for(var _0x5a7f14=0x1;_0x5a7f14<=_0x52c155;_0x5a7f14+=0x1){_0x576ca3=0x1+_0x576ca3*_0x5a7f14/_0x143033;}return 0x1/_0x576ca3;}function isVoiceQueueOutbound(_0x43253e){return _0x43253e===_0x1918('0x4e');}function isNotPreview(_0x4d0e6a){return _0x4d0e6a!==_0x1918('0x93');}function isCampaignIvr(_0x52dfc0){return _0x52dfc0===_0x1918('0x7c');}function getCallerId(_0x4c1ac3,_0x549137,_0x47f88b){if(!_[_0x1918('0x3c')](_0x47f88b)&&typeof _0x47f88b===_0x1918('0x94')&&!_[_0x1918('0x47')](_0x47f88b)){if(!_[_0x1918('0x3c')](_0x549137)&&typeof _0x549137==='string'&&!_[_0x1918('0x47')](_0x549137)){return util[_0x1918('0x7a')](_0x1918('0x95'),_0x549137,_0x47f88b);}return util[_0x1918('0x7a')](_0x1918('0x95'),_0x47f88b,_0x47f88b);}if(!_[_0x1918('0x3c')](_0x4c1ac3)&&typeof _0x4c1ac3===_0x1918('0x94')&&!_['isEmpty'](_0x4c1ac3)){return _0x4c1ac3;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x13eccd,_0xbff133){return function(_0x4a4a14){freeVariablesPredictive(_0xbff133);emitVoiceQueueSummary(_0xbff133);emitCampaignSummary(_0xbff133);loggerSyncQueueSummary['error'](_0x13eccd,util[_0x1918('0x96')](_0x4a4a14,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x44a3aa,_0xab181d){return function(_0x5258c9){loggerPredictive[_0x1918('0x97')](_0xab181d[_0x1918('0x41')],_0x44a3aa);loggerPredictive[_0x1918('0x97')](_0x5258c9[_0x1918('0x98')]);freeVariablesPredictive(_0xab181d);};}function loggerCatch(_0x1c1c3f){return function(_0x43a37f){logger[_0x1918('0x97')](_0x1c1c3f,util[_0x1918('0x96')](_0x43a37f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x104ee5){return _0x104ee5&&!_[_0x1918('0x3c')](_0x104ee5)&&_0x104ee5[_0x1918('0x99')]>0x0;}function decremetOriginate(_0x434ebe){if(!_['isUndefined'](_0x434ebe)&&_0x434ebe!==null){if(typeof _0x434ebe[_0x1918('0x71')]!==_0x1918('0x9a')){if(_0x434ebe[_0x1918('0x71')]>0x0){_0x434ebe[_0x1918('0x71')]-=0x1;}else{logger[_0x1918('0x97')](_0x1918('0x9b'));}}}else{logger[_0x1918('0x97')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x220c2b,_0x22b812,_0x137f0e){if(_0x22b812>_0x137f0e){for(var _0x12b368=0x0;_0x12b368<_0x22b812-_0x137f0e;_0x12b368+=0x1){decremetOriginate(_0x220c2b);}}}function loggerGetContactDialer(_0x30d29e,_0x1cba83,_0x3acd56){return function(_0x20bbd4){checkContactLowerLimitOriginate(_0x1cba83,_0x3acd56,0x0);logger[_0x1918('0x97')](_0x30d29e,util[_0x1918('0x96')](_0x20bbd4,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2fe8a7){return function(_0x71d3f6){if(isNotNull(_0x71d3f6)&&isNotNull(_0x71d3f6[0x0])){if(_0x71d3f6[0x0]['contactsRescheduled']>0x0){_0x2fe8a7[_0x1918('0x3d')]=_0x1918('0x9c');logger[_0x1918('0x7e')](_0x1918('0x9d')+_0x2fe8a7[_0x1918('0x41')],_0x71d3f6[0x0][_0x1918('0x9e')],_0x1918('0x9f'));}else{_0x2fe8a7['message']=_0x1918('0xa0');logger[_0x1918('0x7e')]('[getContactDialer2][Empty]'+_0x2fe8a7['name']);}}};}function notSendMessagesQueue(_0x575047){if(_0x575047[_0x1918('0xa1')]){freeVariablesPredictive(_0x575047);if(_0x575047[_0x1918('0x71')]===0x0&&_0x575047['talking']===0x0&&_0x575047[_0x1918('0xa2')]===0x0&&(_0x575047[_0x1918('0x53')]||0x0)===0x0){_0x575047[_0x1918('0xa1')]=![];_0x575047[_0x1918('0x51')]=0x0;_0x575047[_0x1918('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x1918('0xa3'),_0x575047['name'],_0x1918('0xa4'));}else{_0x575047[_0x1918('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x1918('0x97')](_0x1918('0xa3'),_0x575047[_0x1918('0x41')],'is\x20disactive');}emitVoiceQueueSummary(_0x575047);}}function notSendMessagesCampaign(_0x16fbd2){if(_0x16fbd2['sendMessageOneNotActive']){if(_0x16fbd2[_0x1918('0x71')]===0x0){_0x16fbd2[_0x1918('0xa1')]=![];_0x16fbd2[_0x1918('0x3d')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x1918('0x97')](_0x1918('0xa5'),_0x16fbd2[_0x1918('0x41')],_0x1918('0xa4'));}else{_0x16fbd2[_0x1918('0x3d')]=_0x1918('0xa6');loggerSyncQueueSummary[_0x1918('0x97')](_0x1918('0xa5'),_0x16fbd2[_0x1918('0x41')],'is\x20disactive');}emitCampaignSummary(_0x16fbd2);}}function createObjHistory(_0x5097e6,_0x4da2e6,_0x400375,_0x54aa19,_0x4ba630){_0x5097e6[_0x1918('0x3d')]=_0x400375;var _0x2afe9d=new Action(_0x5097e6,_0x4da2e6);var _0x340a41=new History(_0x2afe9d);_0x340a41[_0x1918('0xa7')]=_0x54aa19;_0x340a41[_0x1918('0xa8')]=_0x4ba630;_0x340a41['endtime']=_0x2afe9d['starttime'];return _0x340a41;}Dialer['prototype'][_0x1918('0x3b')]=function(){var _0x544d68=this;setInterval(function(){_0x544d68[_0x1918('0xa9')](_0x544d68[_0x1918('0x25')],'[uniqueid]');_0x544d68[_0x1918('0xa9')](_0x544d68[_0x1918('0x23')],_0x1918('0xaa'));},0x32c8);};Dialer[_0x1918('0x1c')][_0x1918('0xa9')]=function(_0x150e84,_0x21ddaf){var _0x3b896e=this;for(var _0x402748 in _0x150e84){if(typeof _0x150e84[_0x402748]!==_0x1918('0x9a')){this['sequence'][_0x1918('0x1d')](function(){if(!_[_0x1918('0xab')](_0x150e84[_0x402748])){return ami[_0x1918('0xac')]({'action':_0x1918('0xad'),'channel':_0x150e84[_0x402748][_0x1918('0xae')]})[_0x1918('0xaf')](function(_0x4f1a5c){if(_0x4f1a5c[_0x1918('0x3d')]===_0x1918('0xb0')){setTimeout(function(){if(_0x150e84[_0x402748]&&_0x150e84[_0x402748][_0x1918('0x57')]!==_0x1918('0x7c')){_0x3b896e[_0x1918('0xb1')](_0x3b896e['voiceQueues'][_0x150e84[_0x402748][_0x1918('0xb2')]]);logger['error']('[Dialer][checkChannel]',_0x21ddaf,_0x402748,_0x150e84[_0x402748][_0x1918('0xb2')]);delete _0x150e84[_0x402748];}if(_0x150e84[_0x402748]&&_0x150e84[_0x402748][_0x1918('0x57')]==='ivr'){_0x3b896e[_0x1918('0xb1')](_0x3b896e[_0x1918('0x20')][_0x150e84[_0x402748]['queue']]);logger[_0x1918('0x97')](_0x1918('0xb3'),_0x21ddaf,_0x402748,_0x150e84[_0x402748][_0x1918('0xb2')]);delete _0x150e84[_0x402748];}},0x2328);}});}});}}};Dialer[_0x1918('0x1c')][_0x1918('0xb4')]=function(_0xdc02bd){return BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](cmHopper['countReScheduled'](_0xdc02bd))[_0x1918('0xaf')](loggerCatch(_0x1918('0xb7')));};Dialer['prototype'][_0x1918('0xb8')]=function(_0x2775db){return BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](cmHopperBlack[_0x1918('0xb8')](_0x2775db))[_0x1918('0xaf')](loggerCatch(_0x1918('0xb9')));};Dialer[_0x1918('0x1c')]['checkIsBlackListIvr']=function(_0xb368ed){return BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](cmHopperBlack['checkIsBlackListIvr'](_0xb368ed))['catch'](loggerCatch(_0x1918('0xba')));};Dialer[_0x1918('0x1c')][_0x1918('0xbb')]=function(_0x3c53d1){return BPromise['resolve']()[_0x1918('0xb6')](cmHopperHistory[_0x1918('0xbc')](_0x3c53d1))['catch'](loggerCatch(_0x1918('0xbd')));};Dialer[_0x1918('0x1c')][_0x1918('0xbe')]=function(_0x559415){return BPromise['resolve']()[_0x1918('0xb6')](cmHopper['rescheduleContact'](_0x559415))[_0x1918('0xaf')](loggerCatch(_0x1918('0xbf')));};Dialer[_0x1918('0x1c')][_0x1918('0xc0')]=function(_0x226298,_0x24b842,_0x2a2541){return BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](cmHopper[_0x1918('0xc0')](_0x226298,_0x24b842,_0x2a2541))[_0x1918('0xaf')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x1918('0x1c')]['getContactDialer']=function(_0x579832,_0x48b866,_0x3e63ab,_0x5ea661,_0x84d4a9){return BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](cmHopper[_0x1918('0xc1')](_0x579832,_0x48b866,_0x3e63ab,_0x5ea661))[_0x1918('0xaf')](function(_0x10b549){_0x84d4a9['temp']-=_0x3e63ab;_0x84d4a9[_0x1918('0xc2')]=_0x84d4a9['temp']>0x0?_0x84d4a9[_0x1918('0xc2')]:0x0;loggerCatch(_0x1918('0xc3'))(_0x10b549);});};Dialer[_0x1918('0x1c')][_0x1918('0xc4')]=function(_0x4d9586,_0xa74011,_0x4ecfec,_0x5dad23){return BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](cmHopper[_0x1918('0xc4')](_0x4d9586,_0xa74011,_0x4ecfec))['catch'](function(_0x2a3d8e){_0x5dad23[_0x1918('0xc2')]-=_0xa74011;_0x5dad23['temp']=_0x5dad23[_0x1918('0xc2')]>0x0?_0x5dad23['temp']:0x0;loggerCatch(_0x1918('0xc5'))(_0x2a3d8e);});};Dialer[_0x1918('0x1c')][_0x1918('0xc6')]=function(_0x3340b2){return BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](voiceQueueRt['getVoiceQueueRtPauses'](_0x3340b2))[_0x1918('0xaf')](loggerCatch(_0x1918('0xc7')));};Dialer['prototype'][_0x1918('0xc8')]=function(_0x547af1){return BPromise['resolve']()[_0x1918('0xb6')](cmHopper[_0x1918('0xc8')](_0x547af1))[_0x1918('0xaf')](loggerCatch(_0x1918('0xc9')));};Dialer['prototype']['createHistory']=function(_0x1aeca3){return BPromise['resolve']()[_0x1918('0xb6')](cmHopperHistory[_0x1918('0xca')](_0x1aeca3))[_0x1918('0xaf')](loggerCatch('[createHistory]\x20'));};Dialer[_0x1918('0x1c')][_0x1918('0xb1')]=function(_0x3d40db){if(!_['isUndefined'](_0x3d40db)&&_0x3d40db!==null){if(typeof _0x3d40db['originated']!==_0x1918('0x9a')){if(_0x3d40db[_0x1918('0x71')]>0x0){_0x3d40db[_0x1918('0x71')]-=0x1;}else{logger[_0x1918('0x97')](_0x1918('0xcb'));}}}else{logger[_0x1918('0x97')](_0x1918('0xcc'));}};Dialer[_0x1918('0x1c')][_0x1918('0xcd')]=function(_0x4baf4d,_0x259065){var _0x50f28d=this;return function(_0x1ac392){_0x50f28d['updateOriginated'](_0x259065);logger[_0x1918('0x97')](_0x4baf4d,util[_0x1918('0x96')](_0x1ac392,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x1918('0xce')]=function(_0x28a196,_0x3457b3,_0x7bf791){var _0x2e27d6={'state':0x19,'statedesc':'notFound'};this[_0x1918('0xb1')](_0x3457b3);this[_0x1918('0xcf')](_[_0x1918('0x8e')](_0x2e27d6,_[_0x1918('0xd0')](_0x7bf791,[_0x1918('0xd1'),_0x1918('0xd2'),_0x1918('0xd3'),_0x1918('0xd4'),_0x1918('0xd5')])),_0x1918('0xd6'),'[emptyContact]');logger[_0x1918('0x97')](_0x28a196);};Dialer['prototype']['isSuccess']=function(_0x2218c8){return _0x2218c8===_0x1918('0xd7');};Dialer[_0x1918('0x1c')]['isTrunkReachable']=function(_0x2bda4a){return!_[_0x1918('0x3c')](_0x2bda4a)&&_0x2bda4a&&!_[_0x1918('0x3c')](_0x2bda4a[_0x1918('0x41')])&&!_[_0x1918('0x3c')](_0x2bda4a[_0x1918('0x77')])&&_0x2bda4a[_0x1918('0x77')]&&(this[_0x1918('0x21')][util[_0x1918('0x7a')](_0x1918('0xd8'),_0x2bda4a['name'])][_0x1918('0xad')]===_0x1918('0xd9')||this[_0x1918('0x21')][util[_0x1918('0x7a')](_0x1918('0xd8'),_0x2bda4a[_0x1918('0x41')])][_0x1918('0xad')]===_0x1918('0xda'));};Dialer[_0x1918('0x1c')]['saveInDb']=function(_0x5dc977,_0x4fb2e8,_0x15edb0){this['createHistory'](_0x5dc977)['catch'](loggerCatch(_0x4fb2e8));this[_0x1918('0xc8')](_0x5dc977)[_0x1918('0xaf')](loggerCatch(_0x15edb0));};Dialer[_0x1918('0x1c')][_0x1918('0xdb')]=function(_0x355378){var _0xb73c29=this[_0x1918('0x25')][_0x355378['uniqueid']];var _0x5d986c;if(!_[_0x1918('0xab')](_0x355378)&&!_['isNil'](_0x355378[_0x1918('0xdc')])&&!_[_0x1918('0xab')](_0x355378[_0x1918('0xdc')]['amdstatus'])&&_0x355378[_0x1918('0xdd')]===_0x1918('0xde')&&_0xb73c29){if(_0xb73c29['type']!==_0x1918('0x7c')&&this['voiceQueues'][_0xb73c29[_0x1918('0xb2')]]['dialAMDActive']&&_0x355378['value']===_0x1918('0xdf')){delete this['uniqueId'][_0x355378['uniqueid']];this[_0x1918('0xb1')](this[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]]);this[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]][_0x1918('0xe1')]+=0x1;this[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]][_0x1918('0x5e')]+=0x1;_0x5d986c=new Hangup(_0xb73c29,_0x355378);_0x5d986c[_0x1918('0xa7')]=0x12;_0x5d986c[_0x1918('0xa8')]='HangupInAMD';_0x5d986c['membername']=_0x1918('0xe2');ami[_0x1918('0xe3')](_0x1918('0xe4'),ut[_0x1918('0xe5')](_0x5d986c,_0x1918('0xe6')));this[_0x1918('0xcf')](_0x5d986c,_0x1918('0xe7'),_0x1918('0xe8'));}if(_0xb73c29['type']!=='ivr'&&this[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]][_0x1918('0xe9')]&&_0x355378[_0x1918('0xea')]==='MACHINE'){var _0x492402=this;return new BPromise(function(_0x427810,_0x56edff){delete _0x492402[_0x1918('0x25')][_0x355378['uniqueid']];_0x492402[_0x1918('0xb1')](_0x492402[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]]);_0x492402[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]][_0x1918('0xe1')]+=0x1;_0x492402[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1480f9=_0x492402[_0x1918('0xe0')][_0xb73c29[_0x1918('0xb2')]];var _0x5400c8=new Hangup(_0xb73c29,_0x355378);_0x5400c8[_0x1918('0xa7')]=0x13;_0x5400c8[_0x1918('0xa8')]=_0x1918('0xeb');_0x5400c8[_0x1918('0xec')]=_0x1918('0xe2');_0x5400c8[_0x1918('0xed')]+=0x1;_0x5400c8['countglobal']+=0x1;_0x5400c8[_0x1918('0xe6')]=!![];ami[_0x1918('0xe3')]('custom:amd',ut[_0x1918('0xe5')](_0x5400c8,_0x1918('0xe6')));_0x492402['createHistory'](_0x5400c8)[_0x1918('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5400c8[_0x1918('0xee')]+_0x5400c8[_0x1918('0xef')]+_0x5400c8[_0x1918('0xf0')]+_0x5400c8[_0x1918('0xf1')]+_0x5400c8[_0x1918('0xf2')]+_0x5400c8[_0x1918('0xf3')]+_0x5400c8[_0x1918('0xed')]+_0x5400c8[_0x1918('0xf4')]>=_0x1480f9[_0x1918('0xf5')]){_0x492402[_0x1918('0xf6')](_0x5400c8,_0x427810,_0x56edff,_0x1918('0xf7'));}else{if(_0x5400c8['countmachineretry']>=_0x1480f9[_0x1918('0xf8')]){_0x492402[_0x1918('0xf9')](_0x5400c8,_0x427810,_0x56edff,'reason\x2019\x20machine....');}else{_0x492402[_0x1918('0xbe')]({'active':![],'countmachineretry':_0x5400c8[_0x1918('0xed')],'scheduledat':moment()[_0x1918('0xfa')](_0x1480f9[_0x1918('0xfb')],_0x1918('0xfc'))[_0x1918('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5400c8['ContactId'],'ListId':_0x5400c8[_0x1918('0xd2')],'VoiceQueueId':_0x5400c8[_0x1918('0xd4')]||undefined,'CampaignId':_0x5400c8[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0xfd')));_0x427810({'reschedule':0x1});}}});}if(_0xb73c29[_0x1918('0x57')]==='ivr'&&this[_0x1918('0x20')][_0xb73c29[_0x1918('0xb2')]]['dialAMDActive']&&_0x355378['value']===_0x1918('0xdf')){delete this['uniqueId'][_0x355378[_0x1918('0xfe')]];this['updateOriginated'](this['campaigns'][_0xb73c29['queue']]);_0x5d986c=new Hangup(_0xb73c29,_0x355378);_0x5d986c[_0x1918('0xa7')]=0x12;_0x5d986c[_0x1918('0xa8')]=_0x1918('0xff');_0x5d986c[_0x1918('0xec')]=_0x1918('0xe2');ami[_0x1918('0xe3')](_0x1918('0xe4'),ut[_0x1918('0xe5')](_0x5d986c,_0x1918('0xe6')));this['saveInDb'](_0x5d986c,_0x1918('0x100'),_0x1918('0x101'));}if(_0xb73c29[_0x1918('0x57')]==='ivr'&&this['campaigns'][_0xb73c29[_0x1918('0xb2')]]['dialAMDActive']&&_0x355378[_0x1918('0xea')]===_0x1918('0x102')){var _0x492402=this;return new BPromise(function(_0x1aa777,_0x177241){delete _0x492402[_0x1918('0x25')][_0x355378[_0x1918('0xfe')]];_0x492402[_0x1918('0xb1')](_0x492402[_0x1918('0x20')][_0xb73c29['queue']]);_0x492402['campaigns'][_0xb73c29[_0x1918('0xb2')]][_0x1918('0xe1')]+=0x1;_0x492402[_0x1918('0x20')][_0xb73c29['queue']][_0x1918('0x5e')]+=0x1;var _0x11413a=_0x492402[_0x1918('0x20')][_0xb73c29['queue']];var _0x280879=new Hangup(_0xb73c29,_0x355378);_0x280879[_0x1918('0xa7')]=0x13;_0x280879['statedesc']=_0x1918('0xeb');_0x280879[_0x1918('0xec')]=_0x1918('0xe2');_0x280879[_0x1918('0xed')]+=0x1;_0x280879[_0x1918('0x103')]+=0x1;_0x280879[_0x1918('0xe6')]=!![];ami[_0x1918('0xe3')](_0x1918('0xe4'),ut['buildObj'](_0x280879,_0x1918('0xe6')));_0x492402[_0x1918('0xca')](_0x280879)[_0x1918('0xaf')](loggerCatch(_0x1918('0x104')));if(_0x280879[_0x1918('0xee')]+_0x280879[_0x1918('0xef')]+_0x280879[_0x1918('0xf0')]+_0x280879[_0x1918('0xf1')]+_0x280879[_0x1918('0xf2')]+_0x280879[_0x1918('0xf3')]+_0x280879[_0x1918('0xed')]+_0x280879[_0x1918('0xf4')]>=_0x11413a['dialGlobalMaxRetry']){_0x492402[_0x1918('0xf6')](_0x280879,_0x1aa777,_0x177241,_0x1918('0xf7'));}else{if(_0x280879[_0x1918('0xed')]>=_0x11413a[_0x1918('0xf8')]){_0x492402['createStateFinal'](_0x280879,_0x1aa777,_0x177241,_0x1918('0x105'));}else{_0x492402[_0x1918('0xbe')]({'active':![],'countmachineretry':_0x280879['countmachineretry'],'scheduledat':moment()['add'](_0x11413a[_0x1918('0xfb')],_0x1918('0xfc'))[_0x1918('0x7a')](_0x1918('0x106')),'ContactId':_0x280879[_0x1918('0xd1')],'ListId':_0x280879[_0x1918('0xd2')],'VoiceQueueId':_0x280879[_0x1918('0xd4')]||undefined,'CampaignId':_0x280879['CampaignId']||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0xfd')));_0x1aa777({'reschedule':0x1});}}});}}};Dialer['prototype'][_0x1918('0x34')]=function(_0x2aac17){var _0x137fb8=this[_0x1918('0x25')][_0x2aac17[_0x1918('0xfe')]];var _0xe29b5d=this;var _0x2d3cec;if(_0x137fb8&&_0x137fb8['type']===_0x1918('0x7c')){delete this[_0x1918('0x25')][_0x2aac17[_0x1918('0xfe')]];this[_0x1918('0xb1')](this[_0x1918('0x20')][_0x137fb8[_0x1918('0xb2')]]);this[_0x1918('0x20')][_0x137fb8['queue']][_0x1918('0x107')]+=0x1;_0x2d3cec=new Hangup(_0x137fb8,_0x2aac17);this['createHistory'](_0x2d3cec)['catch'](loggerCatch(_0x1918('0x108')));this[_0x1918('0xc8')](_0x2d3cec)[_0x1918('0xaf')](loggerCatch(_0x1918('0x109')));}if(_0x137fb8&&_0x137fb8['type']!==_0x1918('0x7c')&&isNotNull(this['voiceQueues'][_0x137fb8[_0x1918('0xb2')]][_0x1918('0x10a')])){delete this['uniqueId'][_0x2aac17[_0x1918('0xfe')]];this[_0x1918('0xb1')](this[_0x1918('0xe0')][_0x137fb8[_0x1918('0xb2')]]);this[_0x1918('0xe0')][_0x137fb8[_0x1918('0xb2')]]['outboundAnswerCallsDay']+=0x1;this[_0x1918('0xe0')][_0x137fb8['queue']][_0x1918('0x5e')]+=0x1;_0x2d3cec=new Hangup(_0x137fb8,_0x2aac17);_0x2d3cec[_0x1918('0xa7')]=0x10;_0x2d3cec[_0x1918('0xa8')]=_0x1918('0x10b');_0x2d3cec[_0x1918('0xec')]=_0x1918('0x10c');this[_0x1918('0xca')](_0x2d3cec)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x1918('0xc8')](_0x2d3cec)[_0x1918('0xaf')](loggerCatch(_0x1918('0x109')));}if(_0x137fb8&&_0x137fb8[_0x1918('0x57')]!==_0x1918('0x7c')&&!isNotNull(this['voiceQueues'][_0x137fb8[_0x1918('0xb2')]]['dialQueueProject'])){delete this[_0x1918('0x25')][_0x2aac17[_0x1918('0xfe')]];this[_0x1918('0xb1')](this['voiceQueues'][_0x137fb8[_0x1918('0xb2')]]);this[_0x1918('0xe0')][_0x137fb8[_0x1918('0xb2')]][_0x1918('0x67')]+=0x1;_0x2d3cec=new Hangup(_0x137fb8,_0x2aac17);_0x2d3cec[_0x1918('0xa7')]=0xc;_0x2d3cec[_0x1918('0xa8')]=_0x2aac17['cause-txt'];_0x2d3cec[_0x1918('0xec')]=_0x1918('0x10d');this[_0x1918('0xca')](_0x2d3cec)[_0x1918('0xaf')](loggerCatch(_0x1918('0x108')));this[_0x1918('0xc8')](_0x2d3cec)[_0x1918('0xaf')](loggerCatch(_0x1918('0x109')));}};Dialer[_0x1918('0x1c')][_0x1918('0x30')]=function(_0x13afbe){var _0x36b97e=this[_0x1918('0x25')][_0x13afbe[_0x1918('0xfe')]];var _0x5106da=this;if(this[_0x1918('0xe0')][_0x13afbe[_0x1918('0xb2')]]){if(_0x36b97e&&_0x36b97e[_0x1918('0x57')]!==_0x1918('0x7c')){delete this[_0x1918('0x25')][_0x13afbe[_0x1918('0xfe')]];this['voiceQueues'][_0x13afbe['queue']][_0x1918('0xe1')]+=0x1;var _0x2c95dc=new AgentComplete(_0x36b97e,_0x13afbe);if(_0x13afbe['reason']===_0x1918('0x10e')){_0x2c95dc['agiafterat']=this[_0x1918('0xe0')][_0x13afbe['queue']]['dialQueueProject2']&&this['voiceQueues'][_0x13afbe[_0x1918('0xb2')]][_0x1918('0x10f')]?moment()[_0x1918('0x7a')](_0x1918('0x106')):undefined;}this[_0x1918('0xca')](_0x2c95dc)[_0x1918('0xaf')](loggerCatch(_0x1918('0x110')));this[_0x1918('0xc8')](_0x2c95dc)[_0x1918('0xaf')](loggerCatch(_0x1918('0x111')));}}};Dialer[_0x1918('0x1c')][_0x1918('0x2c')]=function(_0x31f9ac){if(this['voiceQueues'][_0x31f9ac[_0x1918('0xb2')]]){if(this[_0x1918('0x25')][_0x31f9ac[_0x1918('0xfe')]]&&this['uniqueId'][_0x31f9ac['uniqueid']][_0x1918('0x57')]!==_0x1918('0x7c')){this['updateOriginated'](this[_0x1918('0xe0')][_0x31f9ac[_0x1918('0xb2')]]);this[_0x1918('0x25')][_0x31f9ac[_0x1918('0xfe')]][_0x1918('0x112')]=moment()[_0x1918('0x7a')](_0x1918('0x106'));}}};Dialer[_0x1918('0x1c')]['queueCallerAbandonCreateState']=function(_0x2b030d){this[_0x1918('0xca')](_0x2b030d)[_0x1918('0xaf')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x1918('0xc8')](_0x2b030d)[_0x1918('0xaf')](loggerCatch(_0x1918('0x113')));};Dialer[_0x1918('0x1c')][_0x1918('0x114')]=function(_0x3283ee){var _0xae9c02=this[_0x1918('0x25')][_0x3283ee[_0x1918('0xfe')]];var _0x29df30=this;if(this['voiceQueues'][_0x3283ee[_0x1918('0xb2')]]){if(_0xae9c02&&_0xae9c02['type']!==_0x1918('0x7c')){delete this[_0x1918('0x25')][_0x3283ee[_0x1918('0xfe')]];this['updateOriginated'](this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]]);_0xae9c02['droptime']=moment()[_0x1918('0x7a')](_0x1918('0x106'));var _0x5b1867=new QueueCallerAbandon(_0xae9c02,_0x3283ee);if(getSeconds(_0xae9c02[_0x1918('0x115')],_0xae9c02[_0x1918('0x116')])>=_0xae9c02[_0x1918('0x117')]){this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]][_0x1918('0x6b')]+=0x1;_0x5b1867[_0x1918('0xa7')]=0xa;_0x5b1867[_0x1918('0xa8')]='Drop';_0x5b1867[_0x1918('0x118')]='TIMEOUT';_0x5b1867[_0x1918('0x119')]=this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]][_0x1918('0x11a')]?moment()['format'](_0x1918('0x106')):undefined;_0x5b1867[_0x1918('0xf2')]+=0x1;_0x5b1867[_0x1918('0x103')]+=0x1;if(_0x5b1867['countdropretry']>=this[_0x1918('0xe0')][_0x3283ee['queue']][_0x1918('0x11b')]){this[_0x1918('0x11c')](_0x5b1867);}else{this[_0x1918('0xbe')]({'active':![],'countdropretry':_0x5b1867['countdropretry'],'scheduledat':moment()[_0x1918('0xfa')](this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]]['dialDropRetryFrequency'],_0x1918('0xfc'))[_0x1918('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xae9c02['ContactId'],'ListId':_0xae9c02[_0x1918('0xd2')],'VoiceQueueId':_0xae9c02[_0x1918('0xd4')]||undefined,'CampaignId':_0xae9c02[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x11d')));var _0x2314e=new History(_0x5b1867);_0x2314e[_0x1918('0xa7')]=0xa;_0x2314e[_0x1918('0xa8')]=_0x1918('0x11e');_0x2314e[_0x1918('0x11f')]=moment()[_0x1918('0x7a')](_0x1918('0x106'));_0x2314e[_0x1918('0x120')]=_0x2314e[_0x1918('0x11f')];_0x2314e[_0x1918('0x121')]=_0x5b1867[_0x1918('0x121')];_0x2314e['calleridnum']=_0x5b1867[_0x1918('0x122')];this[_0x1918('0xca')](_0x2314e)['catch'](loggerCatch(_0x1918('0x123')));}}else{this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]][_0x1918('0x6a')]+=0x1;this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]][_0x1918('0x61')]+=0x1;_0x5b1867['state']=0xb;_0x5b1867['statedesc']=_0x1918('0x124');_0x5b1867[_0x1918('0x118')]=_0x1918('0x125');_0x5b1867[_0x1918('0xf3')]+=0x1;_0x5b1867[_0x1918('0x103')]+=0x1;if(_0x5b1867[_0x1918('0xf3')]>=this['voiceQueues'][_0x3283ee[_0x1918('0xb2')]][_0x1918('0x126')]){this[_0x1918('0x11c')](_0x5b1867);}else{this[_0x1918('0xbe')]({'active':![],'countabandonedretry':_0x5b1867[_0x1918('0xf3')],'scheduledat':moment()['add'](this[_0x1918('0xe0')][_0x3283ee[_0x1918('0xb2')]]['dialAbandonedRetryFrequency'],_0x1918('0xfc'))[_0x1918('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xae9c02[_0x1918('0xd1')],'ListId':_0xae9c02[_0x1918('0xd2')],'VoiceQueueId':_0xae9c02[_0x1918('0xd4')]||undefined,'CampaignId':_0xae9c02[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x127')));var _0x2314e=new History(_0x5b1867);_0x2314e['state']=0xb;_0x2314e[_0x1918('0xa8')]='Abandoned';_0x2314e[_0x1918('0x11f')]=moment()[_0x1918('0x7a')](_0x1918('0x106'));_0x2314e[_0x1918('0x120')]=_0x2314e[_0x1918('0x11f')];_0x2314e[_0x1918('0x121')]=_0x5b1867[_0x1918('0x121')];_0x2314e[_0x1918('0x122')]=_0x5b1867[_0x1918('0x122')];this[_0x1918('0xca')](_0x2314e)['catch'](loggerCatch(_0x1918('0x128')));}}}}};Dialer[_0x1918('0x1c')][_0x1918('0x36')]=function(_0x1d4937){if(this[_0x1918('0x23')][_0x1d4937[_0x1918('0xfe')]]){this[_0x1918('0x23')][_0x1d4937[_0x1918('0xfe')]]['channel']=_0x1d4937[_0x1918('0xae')];}if(this[_0x1918('0x25')][_0x1d4937[_0x1918('0xfe')]]){this['uniqueId'][_0x1d4937[_0x1918('0xfe')]][_0x1918('0xae')]=_0x1d4937['channel'];}};Dialer[_0x1918('0x1c')][_0x1918('0x38')]=function(_0x48d007){if(strategy[this[_0x1918('0xe0')][this['actions'][_0x48d007[_0x1918('0x129')]]['queue']][_0x1918('0x4f')]]==='roundrobin'){if(this[_0x1918('0x23')][_0x48d007[_0x1918('0x129')]]&&_[_0x1918('0xab')](this[_0x1918('0x23')][_0x48d007['actionid']]['locked'])&&_0x48d007['status']==='1'&&_0x48d007[_0x1918('0x12a')]==='0'){if(this[_0x1918('0x12b')][_0x48d007[_0x1918('0x12c')]]){if(!this[_0x1918('0x12b')][_0x48d007[_0x1918('0x12c')]]['locked']){this['agents'][_0x48d007[_0x1918('0x12c')]][_0x1918('0x12d')]=!![];this[_0x1918('0x23')][_0x48d007[_0x1918('0x129')]][_0x1918('0x12d')]=!![];this[_0x1918('0x23')][_0x48d007[_0x1918('0x129')]][_0x1918('0x12c')]=_0x48d007['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x1918('0x23')][_0x48d007[_0x1918('0x129')]][_0x1918('0xb2')]][_0x1918('0x4f')]]||_0x1918('0x1b'))===_0x1918('0x1b')){if(this['actions'][_0x48d007['actionid']]){if(this[_0x1918('0x12b')][_0x48d007[_0x1918('0x12c')]]){this['actions'][_0x48d007[_0x1918('0x129')]][_0x1918('0x12c')]=_0x48d007[_0x1918('0x12c')];if(_[_0x1918('0xab')](this[_0x1918('0x12e')][this['actions'][_0x48d007[_0x1918('0x129')]]['queue']])){this[_0x1918('0x12e')][this['actions'][_0x48d007[_0x1918('0x129')]][_0x1918('0xb2')]]=[];}this[_0x1918('0x12e')][this['actions'][_0x48d007[_0x1918('0x129')]][_0x1918('0xb2')]]['push'](_['merge'](_[_0x1918('0xd0')](this['actions'][_0x48d007['actionid']],[_0x1918('0x12f'),'stateinterface']),{'status':_0x48d007[_0x1918('0xad')],'paused':_0x48d007[_0x1918('0x12a')]}));}}}};function unlockQueueStatus(_0x3005e5,_0x3bbc57){setTimeout(function(){if(_['isUndefined'](_0x3005e5['queueStatusComplete'])){loggerBooked['error'](_0x1918('0x130'),_0x3bbc57);}_0x3005e5[_0x1918('0x131')]=!![];loggerBooked[_0x1918('0x7e')](_0x1918('0x132'),_0x3bbc57,JSON[_0x1918('0x4a')](_[_0x1918('0xd0')](_0x3005e5,['name',_0x1918('0x131')])));},0x1f3);}Dialer[_0x1918('0x1c')]['syncQueueStatusComplete']=function(_0x7b5e0e){var _0x7dcf88=this;var _0x7e30cb=_0x7dcf88[_0x1918('0xe0')][_0x7dcf88[_0x1918('0x23')][_0x7b5e0e['actionid']][_0x1918('0xb2')]];if(strategy[this[_0x1918('0xe0')][this[_0x1918('0x23')][_0x7b5e0e['actionid']][_0x1918('0xb2')]][_0x1918('0x4f')]]==='roundrobin'){if(this['actions'][_0x7b5e0e[_0x1918('0x129')]]&&this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0x12c')]){this[_0x1918('0x93')][_0x1918('0x133')](this['actions'][_0x7b5e0e[_0x1918('0x129')]]['idHopper'],this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0x12c')])[_0x1918('0xaf')](function(_0x535e43){logger[_0x1918('0x97')](_0x1918('0x134'),util['inspect'](_0x535e43,{'showHidden':![],'depth':null}));})['finally'](function(){_0x7dcf88[_0x1918('0xb1')](_0x7dcf88[_0x1918('0xe0')][_0x7dcf88[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]]);_0x7dcf88[_0x1918('0x12b')][_0x7dcf88[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0x12c')]]['locked']=![];delete _0x7dcf88[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]];unlockQueueStatus(_0x7e30cb);});}else{this[_0x1918('0xb1')](this[_0x1918('0xe0')][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]]);this[_0x1918('0xbe')]({'active':![],'ContactId':this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xd1')],'ListId':this['actions'][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xd2')],'VoiceQueueId':this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xd4')]||undefined,'CampaignId':this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x135')));delete this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]];unlockQueueStatus(_0x7e30cb);}}else if((strategy[this[_0x1918('0xe0')][this['actions'][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]][_0x1918('0x4f')]]||'rrmemory')===_0x1918('0x1b')){var _0x4ba4d6;if(this['actions'][_0x7b5e0e[_0x1918('0x129')]]&&!_[_0x1918('0x47')](this['queueBooked'][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]])){if(this[_0x1918('0x2a')][_0x7dcf88['actions'][_0x7b5e0e[_0x1918('0x129')]]['queue']]){this[_0x1918('0x2a')][_0x7dcf88[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]]=this[_0x1918('0x2a')][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]]?this[_0x1918('0x2a')][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]]:this[_0x1918('0x12e')][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]]?this[_0x1918('0x12e')][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]][_0x1918('0x136')]||0x0:0x0;}this[_0x1918('0x12e')][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]][_0x1918('0x136')]=this[_0x1918('0x2a')][this[_0x1918('0x23')][_0x7b5e0e[_0x1918('0x129')]][_0x1918('0xb2')]];for(var _0x2f2e61=0x0;_0x2f2e61=0x0;})['catch'](myreject(_0x1ccc49)));}}else{_0x177251['push'](ami[_0x1918('0xac')]({'action':'command','command':util[_0x1918('0x7a')](_0x1918('0x151'),_0x3712dc,!_[_0x1918('0x3c')](config[_0x1918('0x14b')][_0x2400ca])?_0x2400ca:'')})[_0x1918('0xb6')](function(_0x514fc4){return _0x514fc4[_0x1918('0x153')]['indexOf'](_0x1918('0x154'))>=0x0;})[_0x1918('0xaf')](myreject(_0x1ccc49)));}BPromise[_0x1918('0x155')](_0x177251)[_0x1918('0xb6')](function(_0x500926){var _0x14d2c6=_[_0x1918('0x156')](_0x500926);if(_0x14d2c6){return _0x59a433(_0x14d2c6);}else{_0x26065b[_0x1918('0x3d')]=_0x4b9be7?_0x1918('0x157'):_0x1918('0x158');return _0x1ccc49(msgResponse('[ifTime][promiseAll]','Failure','Global:\x20'+_0x4b9be7+'\x20'+_0x15298b+'\x20Interval\x20is\x20overtime:\x20'+util[_0x1918('0x96')](_0x3712dc,{'showHidden':![],'depth':null})+_0x1918('0x159')+_0x2400ca));}})[_0x1918('0xaf')](function(_0x5ed6a9){return _0x1ccc49(msgResponse(_0x1918('0x146'),'Failure',JSON[_0x1918('0x4a')](_0x5ed6a9)));});});};Dialer['prototype'][_0x1918('0x15a')]=function(_0x257ee2){var _0x544177=this;return function(){switch(_0x257ee2[_0x1918('0x5a')]){case'progressive':freeVariablesPredictive(_0x257ee2);_0x544177[_0x1918('0x15b')](_0x257ee2,0x1);break;case'power':freeVariablesPredictive(_0x257ee2);_0x544177[_0x1918('0x15b')](_0x257ee2,_0x257ee2[_0x1918('0x15c')]);break;case _0x1918('0x15d'):_0x544177[_0x1918('0x15d')](_0x257ee2);break;case'booked':freeVariablesPredictive(_0x257ee2);_0x544177[_0x1918('0x15b')](_0x257ee2,0x1);break;default:freeVariablesPredictive(_0x257ee2);logger[_0x1918('0x97')](_0x1918('0x15e'),_0x257ee2[_0x1918('0x41')],_0x1918('0x15f'));}};};Dialer[_0x1918('0x1c')][_0x1918('0x160')]=function(_0x25b6b0){var _0x4a6dc9=this;return function(){_0x4a6dc9[_0x1918('0x161')](_0x25b6b0);};};Dialer[_0x1918('0x1c')][_0x1918('0x32')]=function(_0x52a7ef){var _0x41a2c2=this;if(isNotPreview(_0x52a7ef[_0x1918('0x5a')])){if(isVoiceQueueOutbound(_0x52a7ef[_0x1918('0x57')])&&isActive(_0x52a7ef['dialActive'])){_0x52a7ef[_0x1918('0xa1')]=!![];BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](checkIsLoggedIn(_0x52a7ef,_0x52a7ef[_0x1918('0x52')]))[_0x1918('0xb6')](checkIsActive(_0x52a7ef,_0x52a7ef['dialActive']))[_0x1918('0xb6')](checkInterval(_0x52a7ef))['then'](_0x41a2c2['checkIsTrunkReachable'](_0x52a7ef))[_0x1918('0xb6')](_0x41a2c2[_0x1918('0x145')](_0x52a7ef['dialGlobalInterval'],_0x52a7ef[_0x1918('0x162')],_0x52a7ef['name'],_0x52a7ef))[_0x1918('0xb6')](_0x41a2c2[_0x1918('0x147')](_0x52a7ef['Interval'],_0x52a7ef[_0x1918('0x162')],_0x52a7ef[_0x1918('0x41')],_0x52a7ef))[_0x1918('0xb6')](_0x41a2c2[_0x1918('0x15a')](_0x52a7ef))['catch'](loggerCatchQueueSummary(_0x1918('0x163'),_0x52a7ef));}else{notSendMessagesQueue(_0x52a7ef);}}else{freeVariablesPredictive(_0x52a7ef);}};Dialer[_0x1918('0x1c')][_0x1918('0x164')]=function(){var _0x413adc=this;var _0x485f77;for(var _0x192676 in this[_0x1918('0x20')]){if(typeof this[_0x1918('0x20')][_0x192676]!==_0x1918('0x9a')){_0x485f77=this[_0x1918('0x20')][_0x192676];if(isCampaignIvr(_0x485f77[_0x1918('0x57')])&&isActive(_0x485f77[_0x1918('0x77')])){_0x485f77[_0x1918('0xa1')]=!![];BPromise[_0x1918('0xb5')]()[_0x1918('0xb6')](checkIsActive(_0x485f77,_0x485f77[_0x1918('0x77')]))[_0x1918('0xb6')](checkInterval(_0x485f77))[_0x1918('0xb6')](_0x413adc[_0x1918('0x165')](_0x485f77))['then'](_0x413adc[_0x1918('0x145')](_0x485f77[_0x1918('0x166')],_0x485f77[_0x1918('0x162')],_0x485f77[_0x1918('0x41')],_0x485f77))[_0x1918('0xb6')](_0x413adc['checkIfTimeIntervals'](_0x485f77[_0x1918('0x45')],_0x485f77['dialTimezone'],_0x485f77['name'],_0x485f77))[_0x1918('0xb6')](_0x413adc[_0x1918('0x160')](_0x485f77))[_0x1918('0xaf')](loggerCatchQueueSummary(_0x1918('0x167'),_0x485f77));}else{notSendMessagesCampaign(_0x485f77);}}}};function getCallerIdRandom(_0x3e434b,_0x514c0f){var _0x389902;var _0x7c0560;var _0x3520a4;if(_0x514c0f<=0x0){_0x514c0f=0x1;}_0x389902=new RegExp(_0x1918('0x168')+_0x514c0f+'}$');_0x7c0560=Math[_0x1918('0x169')](0xa,_0x514c0f-0x1);_0x3520a4=Math[_0x1918('0x169')](0xa,_0x514c0f)-0x1;return util[_0x1918('0x7a')]('%s',_[_0x1918('0x16a')](_0x3e434b,_0x389902,_[_0x1918('0x16b')](_0x7c0560,_0x3520a4)));}function extractCalleridName(_0x4f35e9){var _0x55a415=_0x4f35e9['match'](/"(.*?)"/);return _0x55a415?_0x55a415[0x1]:_0x4f35e9;}function extractCalleridNumber(_0x3df576){var _0x28416a=_0x3df576[_0x1918('0x16c')](/<(.*?)>/);return _0x28416a?_0x28416a[0x1]:_0x3df576;}Dialer[_0x1918('0x1c')]['actionOriginate']=function(_0x9dc9ef,_0x1b5026){var _0x37f96b=this;var _0x834551=uuid['v4']();this[_0x1918('0x23')][_0x834551]=new Action(_0x9dc9ef,_0x1b5026,_0x834551);return new BPromise(function(_0x1e435e,_0x18c042){if(_['isUndefined'](_0x9dc9ef)&&typeof _0x9dc9ef!==_0x1918('0x16d')){return _0x18c042(msgResponse(_0x1918('0x16e'),_0x1918('0x148'),_0x1918('0x16f')));}if(_[_0x1918('0x3c')](_0x1b5026[_0x1918('0x170')][_0x1918('0x171')])||_0x1b5026[_0x1918('0x170')][_0x1918('0x171')]===null){return _0x18c042(msgResponse(_0x1918('0x16e'),_0x1918('0x148'),_0x1918('0x172')));}var _0x23e568={'XMD-CALLERID':_0x37f96b[_0x1918('0x23')][_0x834551][_0x1918('0x173')](),'XMD-AGI':_0x9dc9ef[_0x1918('0x10a')]?util[_0x1918('0x7a')](_0x1918('0x174'),ipAgi,_0x9dc9ef[_0x1918('0x10a')]):_0x1918('0x175'),'XMD-AGIAFTER':_0x9dc9ef[_0x1918('0x11a')]?util[_0x1918('0x7a')](_0x1918('0x174'),ipAgi,_0x9dc9ef[_0x1918('0x11a')]):_0x1918('0x175'),'XMD-QUEUE':_0x9dc9ef[_0x1918('0x57')]==='outbound'?util[_0x1918('0x7a')](_0x1918('0x176'),_0x9dc9ef[_0x1918('0x41')],_0x9dc9ef['dialQueueOptions']||'',_0x9dc9ef['dialAgiAfterHangupAgent']?'c':'',_0x9dc9ef[_0x1918('0x117')]||0x3):_0x1918('0x175'),'XMD-CONTACTID':_0x1b5026[_0x1918('0xd1')],'XMD-CDRTYPE':_0x1918('0x8'),'CALLERID(all)':_0x37f96b[_0x1918('0x23')][_0x834551][_0x1918('0x173')](),'XMD-AMD':_0x9dc9ef[_0x1918('0xe9')]?_0x1918('0x177'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x9dc9ef[_0x1918('0xe9')]){_0x23e568[_0x1918('0x178')]=_0x9dc9ef['dialAMDInitialSilence']||0x9c4;_0x23e568['XMD-AMDGREETING']=_0x9dc9ef['dialAMDGreeting']||0x5dc;_0x23e568[_0x1918('0x179')]=_0x9dc9ef[_0x1918('0x17a')]||0x320;_0x23e568[_0x1918('0x17b')]=_0x9dc9ef[_0x1918('0x17c')]||0x1388;_0x23e568[_0x1918('0x17d')]=_0x9dc9ef[_0x1918('0x17e')]||0x64;_0x23e568[_0x1918('0x17f')]=_0x9dc9ef[_0x1918('0x180')]||0x32;_0x23e568[_0x1918('0x181')]=_0x9dc9ef['dialAMDMaximumNumberOfWords']||0x3;_0x23e568['XMD-AMDSILENCETHRESHOLD']=_0x9dc9ef[_0x1918('0x182')]||0x100;_0x23e568[_0x1918('0x183')]=_0x9dc9ef['dialAMDMaximumWordLength']||0x1388;}if(_0x9dc9ef['type']==='outbound'){_0x23e568[_0x1918('0x184')]=_0x1b5026[_0x1918('0xd4')];}else{_0x23e568['XMD-CAMPAIGNID']=_0x1b5026[_0x1918('0xd5')];}for(var _0x3e2318 in _0x1b5026[_0x1918('0x170')]){if(typeof _0x1b5026[_0x1918('0x170')][_0x3e2318]!==_0x1918('0x9a')){if(isNotNull(_0x1b5026[_0x1918('0x170')][_0x3e2318])&&_0x3e2318!=='id'&&_0x3e2318!==_0x1918('0x185')&&_0x3e2318!==_0x1918('0x186')&&_0x3e2318!==_0x1918('0x187')){_0x23e568[util['format'](_0x1918('0x188'),_0x1918('0x189'),_['toUpper'](_0x3e2318))]=_0x1b5026['Contact'][_0x3e2318];}}}var _0x176850=_0x37f96b[_0x1918('0x141')](_0x9dc9ef[_0x1918('0x76')])?getCallerId(_0x9dc9ef[_0x1918('0x76')][_0x1918('0x78')],_0x9dc9ef[_0x1918('0x18a')],_0x9dc9ef[_0x1918('0x18b')]>0x0?getCallerIdRandom(_0x9dc9ef[_0x1918('0x5b')],_0x9dc9ef[_0x1918('0x18b')]):_0x9dc9ef['dialOriginateCallerIdNumber']):getCallerId(_[_0x1918('0xab')](_0x9dc9ef[_0x1918('0x142')])?_0x9dc9ef['Trunk']['callerid']:_0x9dc9ef['TrunkBackup'][_0x1918('0x78')],_0x9dc9ef[_0x1918('0x18a')],_0x9dc9ef[_0x1918('0x18b')]>0x0?getCallerIdRandom(_0x9dc9ef[_0x1918('0x5b')],_0x9dc9ef[_0x1918('0x18b')]):_0x9dc9ef[_0x1918('0x5b')]);if(_0x176850){_0x23e568[_0x1918('0x18c')]=_0x37f96b[_0x1918('0x23')][_0x834551]['originatecalleridname']=extractCalleridName(_0x176850);_0x23e568[_0x1918('0x18d')]=_0x37f96b[_0x1918('0x23')][_0x834551][_0x1918('0x18e')]=extractCalleridNumber(_0x176850);}return ami['Action']({'actionid':_0x834551,'action':'originate','channel':_0x37f96b[_0x1918('0x141')](_0x9dc9ef[_0x1918('0x76')])?util['format']('SIP/%s/%s%s',_0x9dc9ef[_0x1918('0x76')][_0x1918('0x41')],isNotNull(_0x9dc9ef[_0x1918('0x5d')])?_0x9dc9ef[_0x1918('0x5d')][_0x1918('0x18f')]()||'':'',_0x9dc9ef[_0x1918('0x190')]>0x0?_0x1b5026[_0x1918('0x170')][_0x1918('0x171')]['substring'](_0x9dc9ef[_0x1918('0x190')]):_0x1b5026[_0x1918('0x170')][_0x1918('0x171')]):util[_0x1918('0x7a')](_0x1918('0x191'),_[_0x1918('0xab')](_0x9dc9ef[_0x1918('0x142')])?_0x9dc9ef[_0x1918('0x76')][_0x1918('0x41')]:_0x9dc9ef[_0x1918('0x142')]['name'],isNotNull(_0x9dc9ef['dialPrefix'])?_0x9dc9ef[_0x1918('0x5d')][_0x1918('0x18f')]()||'':'',_0x9dc9ef[_0x1918('0x190')]>0x0?_0x1b5026[_0x1918('0x170')][_0x1918('0x171')][_0x1918('0x192')](_0x9dc9ef[_0x1918('0x190')]):_0x1b5026[_0x1918('0x170')]['phone']),'callerid':_0x176850,'Exten':_0x1918('0xde'),'Context':_0x1918('0x193'),'Priority':'1','variable':_0x23e568,'timeout':(_0x9dc9ef['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x834551})[_0x1918('0xb6')](function(_0x36d476){return _0x1e435e(_0x36d476);})['catch'](function(_0x4bf15e){_0x9dc9ef[_0x1918('0x64')]+=0x1;var _0x44dac7=new History(_0x37f96b[_0x1918('0x23')][_0x834551]);logger['error'](util[_0x1918('0x7a')]('[originateError]:\x20%s',JSON[_0x1918('0x4a')](_0x4bf15e)));_0x44dac7[_0x1918('0xa7')]=0xe;_0x44dac7[_0x1918('0xa8')]=_0x1918('0x194');_0x44dac7[_0x1918('0x11f')]=moment()['format'](_0x1918('0x106'));_0x44dac7['endtime']=_0x44dac7[_0x1918('0x11f')];_0x37f96b['createHistory'](_0x44dac7)[_0x1918('0xaf')](loggerCatch(_0x1918('0x195')));_0x37f96b[_0x1918('0xc8')](_0x44dac7)[_0x1918('0xaf')](loggerCatch('[originate][error]'))[_0x1918('0x13a')](function(){delete _0x37f96b['actions'][_0x834551];return _0x18c042(msgResponse(_0x1918('0x16e'),_0x1918('0x49'),'originate\x20action\x20Error'));});});});};Dialer[_0x1918('0x1c')][_0x1918('0x196')]=function(_0x196cb2){var _0x184f71=this[_0x1918('0x23')][_0x196cb2['actionid']];if(_0x184f71){delete this[_0x1918('0x23')][_0x196cb2[_0x1918('0x129')]];_0x184f71[_0x1918('0x116')]=moment()[_0x1918('0x7a')](_0x1918('0x106'));var _0x12ff84=_0x184f71[_0x1918('0x57')]==='ivr'?this['campaigns'][_0x184f71[_0x1918('0xb2')]]:this[_0x1918('0xe0')][_0x184f71[_0x1918('0x197')]()];if(!this[_0x1918('0x198')](_0x196cb2[_0x1918('0x199')])){this['updateOriginated'](_0x12ff84);return this[_0x1918('0x19a')](_0x184f71,_0x12ff84,_0x196cb2)[_0x1918('0xaf')](loggerCatch(_0x1918('0x19b')));}this[_0x1918('0x25')][_0x196cb2[_0x1918('0xfe')]]=_0x184f71;}};Dialer[_0x1918('0x1c')][_0x1918('0x19c')]=function(_0x455911,_0x11b60f,_0x161d89){var _0x4f5195=new History(_0x11b60f);if(_0x4f5195[_0x1918('0xee')]+_0x4f5195[_0x1918('0xef')]+_0x4f5195[_0x1918('0xf0')]+_0x4f5195[_0x1918('0xf1')]+_0x4f5195[_0x1918('0xf2')]+_0x4f5195[_0x1918('0xf3')]+_0x4f5195['countmachineretry']+_0x4f5195[_0x1918('0xf4')]>=_0x161d89[_0x1918('0xf5')]-0x1){return!![];}switch(_0x455911){case 0x3:if(_0x4f5195[_0x1918('0xf0')]>=_0x161d89['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4f5195[_0x1918('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x161d89[_0x1918('0x19d')],_0x1918('0xfc'))[_0x1918('0x7a')](_0x1918('0x106')),'ContactId':_0x4f5195['ContactId'],'ListId':_0x4f5195['ListId'],'VoiceQueueId':_0x4f5195['VoiceQueueId']||undefined,'CampaignId':_0x4f5195[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x19e')));break;case 0x5:if(_0x4f5195[_0x1918('0xee')]>=_0x161d89['dialBusyMaxRetry']-0x1){return!![];}this[_0x1918('0xbe')]({'active':![],'countbusyretry':_0x4f5195['countbusyretry']+=0x1,'scheduledat':moment()[_0x1918('0xfa')](_0x161d89[_0x1918('0x19f')],'minutes')['format'](_0x1918('0x106')),'ContactId':_0x4f5195[_0x1918('0xd1')],'ListId':_0x4f5195[_0x1918('0xd2')],'VoiceQueueId':_0x4f5195[_0x1918('0xd4')]||undefined,'CampaignId':_0x4f5195[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x1a0')));break;case 0x8:if(_0x4f5195[_0x1918('0xef')]>=_0x161d89[_0x1918('0x1a1')]-0x1){return!![];}this[_0x1918('0xbe')]({'active':![],'countcongestionretry':_0x4f5195[_0x1918('0xef')]+=0x1,'scheduledat':moment()[_0x1918('0xfa')](_0x161d89[_0x1918('0x1a2')],_0x1918('0xfc'))[_0x1918('0x7a')](_0x1918('0x106')),'ContactId':_0x4f5195[_0x1918('0xd1')],'ListId':_0x4f5195[_0x1918('0xd2')],'VoiceQueueId':_0x4f5195[_0x1918('0xd4')]||undefined,'CampaignId':_0x4f5195[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x1a3')));break;case 0x0:if(_0x4f5195[_0x1918('0xf1')]>=_0x161d89[_0x1918('0x1a4')]-0x1){return!![];}else{this[_0x1918('0xbe')]({'active':![],'countnosuchnumberretry':_0x4f5195['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x161d89[_0x1918('0x1a5')],_0x1918('0xfc'))[_0x1918('0x7a')](_0x1918('0x106')),'ContactId':_0x4f5195['ContactId'],'ListId':_0x4f5195[_0x1918('0xd2')],'VoiceQueueId':_0x4f5195[_0x1918('0xd4')]||undefined,'CampaignId':_0x4f5195[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x1a6')));}break;case 0xa:if(_0x4f5195[_0x1918('0xf2')]>=_0x161d89['dialDropMaxRetry']-0x1){return!![];}this[_0x1918('0xbe')]({'active':![],'countdropretry':_0x4f5195[_0x1918('0xf2')]+=0x1,'scheduledat':moment()[_0x1918('0xfa')](_0x161d89[_0x1918('0x1a7')],_0x1918('0xfc'))[_0x1918('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f5195[_0x1918('0xd1')],'ListId':_0x4f5195[_0x1918('0xd2')],'VoiceQueueId':_0x4f5195['VoiceQueueId']||undefined,'CampaignId':_0x4f5195['CampaignId']||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x11d')));break;case 0xb:if(_0x4f5195[_0x1918('0xf3')]>=_0x161d89[_0x1918('0x126')]-0x1){return!![];}this[_0x1918('0xbe')]({'active':![],'countabandonedretry':_0x4f5195[_0x1918('0xf3')]+=0x1,'scheduledat':moment()[_0x1918('0xfa')](_0x161d89['dialAbandonedRetryFrequency'],_0x1918('0xfc'))[_0x1918('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f5195['ContactId'],'ListId':_0x4f5195[_0x1918('0xd2')],'VoiceQueueId':_0x4f5195['VoiceQueueId']||undefined,'CampaignId':_0x4f5195[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x127')));break;case 0x13:if(_0x4f5195['countmachineretry']>=_0x161d89['dialMachineMaxRetry']-0x1){return!![];}this[_0x1918('0xbe')]({'active':![],'countmachineretry':_0x4f5195['countmachineretry']+=0x1,'scheduledat':moment()[_0x1918('0xfa')](_0x161d89['dialMachineRetryFrequency'],_0x1918('0xfc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f5195[_0x1918('0xd1')],'ListId':_0x4f5195[_0x1918('0xd2')],'VoiceQueueId':_0x4f5195[_0x1918('0xd4')]||undefined,'CampaignId':_0x4f5195[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0xfd')));break;case 0x14:if(_0x4f5195['countagentrejectretry']>=_0x161d89[_0x1918('0x1a8')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x4f5195[_0x1918('0xf4')]+=0x1,'scheduledat':moment()[_0x1918('0xfa')](_0x161d89[_0x1918('0x1a9')],_0x1918('0xfc'))[_0x1918('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f5195[_0x1918('0xd1')],'ListId':_0x4f5195[_0x1918('0xd2')],'VoiceQueueId':_0x4f5195[_0x1918('0xd4')]||undefined,'CampaignId':_0x4f5195['CampaignId']||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x1aa')));break;default:return!![];}};Dialer[_0x1918('0x1c')][_0x1918('0x19a')]=function(_0x51cf96,_0x29f953,_0x7c9c36){var _0x5d819b=this;var _0x488b01=new History(_0x51cf96);return new BPromise(function(_0xa0917e,_0x55becd){if(_['isUndefined'](_0x29f953)&&typeof _0x29f953!==_0x1918('0x16d')){return _0x55becd(msgResponse(_0x1918('0x1ab'),'Failure',_0x1918('0x1ac')));}if(_[_0x1918('0x3c')](_0x7c9c36)&&typeof _0x7c9c36!==_0x1918('0x16d')){return _0x55becd(msgResponse(_0x1918('0x1ab'),_0x1918('0x148'),_0x1918('0x1ad')));}switch(_0x7c9c36[_0x1918('0x1ae')]){case'0':_0x29f953[_0x1918('0x63')]+=0x1;_0x488b01['state']=0x0;_0x488b01[_0x1918('0xa8')]=_0x1918('0x1af');_0x488b01[_0x1918('0xf1')]+=0x1;_0x488b01['countglobal']+=0x1;ami[_0x1918('0xe3')](_0x1918('0x1b0'),ut['buildObj'](_0x51cf96,_0x1918('0x1b1')));_0x5d819b[_0x1918('0xca')](_0x488b01)[_0x1918('0xaf')](loggerCatch(_0x1918('0x104')));if(_0x5d819b[_0x1918('0x19c')](0x0,_0x51cf96,_0x29f953)){if(_0x488b01[_0x1918('0xf1')]>=_0x29f953[_0x1918('0x1a4')]){_0x5d819b[_0x1918('0xf9')](_0x488b01,_0xa0917e,_0x55becd,'reason\x200\x20no\x20such\x20number....');}else{_0x5d819b[_0x1918('0xf6')](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1b2'));}}break;case'3':_0x29f953[_0x1918('0x62')]+=0x1;_0x488b01['state']=0x3;_0x488b01[_0x1918('0xa8')]=_0x1918('0x1b3');_0x488b01[_0x1918('0xf0')]+=0x1;_0x488b01[_0x1918('0x103')]+=0x1;ami[_0x1918('0xe3')]('custom:agentnoanswer',ut[_0x1918('0xe5')](_0x51cf96,_0x1918('0x1b4')));_0x5d819b[_0x1918('0xca')](_0x488b01)['catch'](loggerCatch(_0x1918('0x1b5')));if(_0x5d819b[_0x1918('0x19c')](0x3,_0x51cf96,_0x29f953)){if(_0x488b01[_0x1918('0xf0')]>=_0x29f953['dialNoAnswerMaxRetry']){_0x5d819b[_0x1918('0xf9')](_0x488b01,_0xa0917e,_0x55becd,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5d819b[_0x1918('0xf6')](_0x488b01,_0xa0917e,_0x55becd,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x29f953[_0x1918('0x1b6')]+=0x1;_0x488b01['state']=0x5;_0x488b01[_0x1918('0xa8')]='Busy';_0x488b01['countbusyretry']+=0x1;_0x488b01['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0x1918('0xe5')](_0x51cf96,_0x1918('0x1b7')));_0x5d819b[_0x1918('0xca')](_0x488b01)['catch'](loggerCatch(_0x1918('0x1b8')));if(_0x5d819b[_0x1918('0x19c')](0x5,_0x51cf96,_0x29f953)){if(_0x488b01[_0x1918('0xee')]>=_0x29f953[_0x1918('0x1b9')]){_0x5d819b[_0x1918('0xf9')](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1ba'));}else{_0x5d819b[_0x1918('0xf6')](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1ba'));}}break;case'8':_0x29f953['outboundCongestionCallsDay']+=0x1;_0x488b01[_0x1918('0xa7')]=0x8;_0x488b01[_0x1918('0xa8')]=_0x1918('0x1bb');_0x488b01[_0x1918('0xef')]+=0x1;_0x488b01['countglobal']+=0x1;ami[_0x1918('0xe3')](_0x1918('0x1bc'),ut[_0x1918('0xe5')](_0x51cf96,_0x1918('0x1bd')));_0x5d819b[_0x1918('0xca')](_0x488b01)['catch'](loggerCatch(_0x1918('0x1be')));if(_0x5d819b[_0x1918('0x19c')](0x8,_0x51cf96,_0x29f953)){if(_0x488b01[_0x1918('0xef')]>=_0x29f953[_0x1918('0x1a1')]){_0x5d819b[_0x1918('0xf9')](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1bf'));}else{_0x5d819b['stateGlobal'](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1bf'));}}break;case'11':_0x29f953[_0x1918('0x1c0')]+=0x1;_0x488b01[_0x1918('0xa7')]=0xb;_0x488b01['statedesc']='Abandoned';_0x488b01[_0x1918('0xf3')]+=0x1;_0x488b01['countglobal']+=0x1;_0x5d819b[_0x1918('0xca')](_0x488b01)[_0x1918('0xaf')](loggerCatch(_0x1918('0x128')));if(_0x5d819b['checkRetriveMax'](0xb,_0x51cf96,_0x29f953)){if(_0x488b01[_0x1918('0xf3')]>=_0x29f953[_0x1918('0x126')]){_0x5d819b[_0x1918('0xf9')](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1c1'));}else{_0x5d819b[_0x1918('0xf6')](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1c1'));}}break;case'20':_0x29f953[_0x1918('0x66')]+=0x1;_0x488b01['state']=0x14;_0x488b01[_0x1918('0xa8')]=_0x1918('0x1c2');_0x488b01[_0x1918('0xf4')]+=0x1;_0x488b01[_0x1918('0x103')]+=0x1;ami[_0x1918('0xe3')](_0x1918('0x1c3'),ut[_0x1918('0xe5')](_0x51cf96,_0x1918('0x1c4')));_0x5d819b[_0x1918('0xca')](_0x488b01)['catch'](loggerCatch(_0x1918('0x1c5')));if(_0x5d819b['checkRetriveMax'](0x14,_0x51cf96,_0x29f953)){if(_0x488b01[_0x1918('0xf4')]>=_0x29f953[_0x1918('0x1a8')]){_0x5d819b[_0x1918('0xf9')](_0x488b01,_0xa0917e,_0x55becd,'reason\x2020\x20agentreject');}else{_0x5d819b[_0x1918('0xf6')](_0x488b01,_0xa0917e,_0x55becd,_0x1918('0x1c6'));}}break;default:_0x29f953[_0x1918('0x67')]+=0x1;_0x488b01[_0x1918('0xa7')]=0xc;_0x488b01[_0x1918('0xa8')]=_0x7c9c36[_0x1918('0x1ae')];_0x5d819b[_0x1918('0xca')](_0x488b01)[_0x1918('0xaf')](loggerCatch(_0x1918('0x1c7')));if(_0x5d819b[_0x1918('0x19c')](_0x7c9c36[_0x1918('0x1ae')],_0x51cf96,_0x29f953)){if(_0x488b01[_0x1918('0xee')]+_0x488b01['countcongestionretry']+_0x488b01[_0x1918('0xf0')]+_0x488b01[_0x1918('0xf1')]+_0x488b01[_0x1918('0xf2')]+_0x488b01['countabandonedretry']+_0x488b01['countmachineretry']+_0x488b01[_0x1918('0xf4')]>=_0x29f953[_0x1918('0xf5')]){_0x5d819b[_0x1918('0xf6')](_0x488b01,_0xa0917e,_0x55becd,_0x7c9c36[_0x1918('0x1ae')]);}else{_0x5d819b[_0x1918('0xf9')](_0x488b01,_0xa0917e,_0x55becd,_0x7c9c36[_0x1918('0x1ae')]);}}}});};Dialer[_0x1918('0x1c')][_0x1918('0xf6')]=function(_0x3e4259,_0x540c71,_0x43b7b9,_0x4e92e2){var _0x2adbdd=new Final(_0x3e4259);_0x2adbdd[_0x1918('0xa7')]=0xf;_0x2adbdd[_0x1918('0xa8')]=_0x1918('0x1c8');this[_0x1918('0xf9')](_0x2adbdd,_0x540c71,_0x43b7b9,_0x4e92e2);};Dialer['prototype'][_0x1918('0xf9')]=function(_0x2f563a,_0x27a04e,_0x4733fd,_0x115f12){this[_0x1918('0xc8')](_0x2f563a)[_0x1918('0xb6')](function(){return _0x27a04e(msgResponse(_0x1918('0x1ab'),'Success',_0x115f12));})[_0x1918('0xaf')](function(){return _0x4733fd(msgResponse(_0x1918('0x1c9'),_0x1918('0x148'),_0x1918('0x1ca')));});};Dialer[_0x1918('0x1c')][_0x1918('0x15d')]=function(_0xbe05f0){var _0x3ac541=_0xbe05f0[_0x1918('0x1cb')]/0x64;var _0x184d54=_0xbe05f0['outboundDropCallsDayTimeout']/(_0xbe05f0[_0x1918('0x1cc')]+_0xbe05f0[_0x1918('0xe1')]);var _0x70066e=Math[_0x1918('0x1cd')](_0xbe05f0[_0x1918('0x6f')]*(_0xbe05f0[_0x1918('0x1ce')]/0x64));var _0x47364c=Math[_0x1918('0x1cd')](_0xbe05f0['predictiveIntervalAvailable']*(_0xbe05f0['predictiveIntervalMinThreshold']/0x64));var _0x206fb8=_0xbe05f0['available']+_0xbe05f0[_0x1918('0x1cf')];var _0x1147ee=Math[_0x1918('0x1d0')](_0xbe05f0[_0x1918('0x72')]*_0xbe05f0[_0x1918('0x74')]*_0xbe05f0[_0x1918('0x6c')]*_0xbe05f0['predictiveIntervalMultiplicativeFactor']);if(_[_0x1918('0x3c')](_0xbe05f0[_0x1918('0x28')])){if(!_[_0x1918('0x3c')](_0xbe05f0[_0x1918('0x27')])){_0xbe05f0[_0x1918('0x27')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x1918('0x3c')](_0xbe05f0[_0x1918('0x91')])){loggerPredictive['error'](_0x1918('0x1d1'),_0x1918('0x1d2'));clearInterval(_0xbe05f0[_0x1918('0x91')]);_0xbe05f0[_0x1918('0x91')]=undefined;}_0xbe05f0[_0x1918('0x28')]=moment()[_0x1918('0x7a')](_0x1918('0x106'));loggerPredictive['info'](_0xbe05f0[_0x1918('0x41')],_0x1918('0x1d3'),_0xbe05f0[_0x1918('0x28')]);this['handlePower'](_0xbe05f0,0x1);}else if(ifInterval(_0xbe05f0[_0x1918('0x1d4')],_0xbe05f0[_0x1918('0x28')])){this[_0x1918('0x15b')](_0xbe05f0,0x1);loggerPredictiveCalls[_0x1918('0x7e')](_0x1918('0x1d5'),_0xbe05f0[_0x1918('0x28')],_0xbe05f0[_0x1918('0x41')]);_0xbe05f0[_0x1918('0x72')]=0x0;_0xbe05f0[_0x1918('0x6b')]=0x0;}else if(_0x3ac541<_0x184d54&&_0xbe05f0[_0x1918('0x1d6')]==='dropRate'){freeVariablesPredictive(_0xbe05f0);loggerPredictive[_0x1918('0x7e')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x1918('0x1d7'),_0x184d54,_0x1918('0x28'),_0xbe05f0['name']);}else if(_0x1147ee<_0xbe05f0[_0x1918('0x6b')]&&_0xbe05f0[_0x1918('0x1d6')]===_0x1918('0x1d8')){freeVariablesPredictive(_0xbe05f0);loggerPredictive[_0x1918('0x7e')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x1918('0x1d9'),_0x1147ee,_0x1918('0x1da'),_0xbe05f0['predictiveIntervalErlangCallsDroppedCalls'],_0x1918('0x28'),_0xbe05f0[_0x1918('0x41')]);}else if(!ifInterval(_0xbe05f0['dialPredictiveInterval'],_0xbe05f0[_0x1918('0x28')])&&_[_0x1918('0x3c')](_0xbe05f0[_0x1918('0x27')])&&!_[_0x1918('0x3c')](_0xbe05f0['startProgressive'])){_0xbe05f0[_0x1918('0x27')]=moment()['format'](_0x1918('0x106'));loggerPredictive['info'](_0xbe05f0[_0x1918('0x41')],_0x1918('0x1db'),_0xbe05f0[_0x1918('0x27')]);this[_0x1918('0xbb')](_0xbe05f0[_0x1918('0x1d4')])['then'](this[_0x1918('0x1dc')](_0xbe05f0))[_0x1918('0xb6')](mergeDataErlangB(_0xbe05f0))[_0x1918('0xb6')](this[_0x1918('0x1dd')](_0xbe05f0))[_0x1918('0xaf')](loggerCatchPredictive(_0x1918('0x1de'),_0xbe05f0));}else if(!ifInterval(_0xbe05f0[_0x1918('0x1d4')],_0xbe05f0[_0x1918('0x27')])){_0xbe05f0[_0x1918('0x6b')]=0x0;_0xbe05f0[_0x1918('0x27')]=moment()[_0x1918('0x7a')](_0x1918('0x106'));loggerPredictive[_0x1918('0x7e')](_0xbe05f0[_0x1918('0x41')],_0x1918('0x1df'),_0xbe05f0[_0x1918('0x27')]);clearInterval(_0xbe05f0['handlePredictive']);_0xbe05f0[_0x1918('0x91')]=undefined;this['averageHandleTime'](_0xbe05f0[_0x1918('0x1d4')])[_0x1918('0xb6')](this['getDataPredictive'](_0xbe05f0))['then'](mergeDataErlangB(_0xbe05f0))['then'](this[_0x1918('0x1dd')](_0xbe05f0))[_0x1918('0xaf')](loggerCatchPredictive(_0x1918('0x1e0'),_0xbe05f0));}else if(_0xbe05f0['predictiveIntervalAvailable']&&_0x206fb8<_0xbe05f0['predictiveIntervalAvailable']-_0x47364c){freeVariablesPredictive(_0xbe05f0);loggerPredictive[_0x1918('0x7e')](_0xbe05f0[_0x1918('0x41')],_0x1918('0x1e1'),_0x206fb8,')\x20are\x20less\x20than\x20threshold\x20(',_0xbe05f0[_0x1918('0x6f')],'-',_0x47364c,'=',_0xbe05f0['predictiveIntervalAvailable']-_0x47364c,')');}else if(_0xbe05f0[_0x1918('0x6f')]&&_0x206fb8>_0xbe05f0['predictiveIntervalAvailable']+_0x70066e){freeVariablesPredictive(_0xbe05f0);loggerPredictive['info'](_0xbe05f0[_0x1918('0x41')],_0x1918('0x1e1'),_0x206fb8,_0x1918('0x1e2'),_0xbe05f0[_0x1918('0x6f')],'+',_0x70066e,'=',_0xbe05f0[_0x1918('0x6f')]+_0x70066e,')');}};Dialer[_0x1918('0x1c')]['getDataPredictive']=function(_0x5b9f14){var _0x1be8b6=this;return function(_0x2dcb4b){return new BPromise(function(_0x32a5a4,_0x283ce8){_[_0x1918('0x8e')](_0x5b9f14,_0x2dcb4b[0x0]);if(checkGetDataPredictive(_0x2dcb4b[0x0])){var _0x39a552=_0x5b9f14['predictiveIntervalAvailable']=_0x5b9f14['talking']+_0x5b9f14[_0x1918('0x51')];var _0x581cdb=_0x5b9f14[_0x1918('0x1d4')]*0x3c;var _0xbe456a=_0x2dcb4b[0x0][_0x1918('0x69')]+_0x2dcb4b[0x0][_0x1918('0x85')];var _0x5c7227=(_0x2dcb4b[0x0]['predictiveIntervalAnsweredCalls']+_0x2dcb4b[0x0][_0x1918('0x82')]+_0x2dcb4b[0x0][_0x1918('0x6a')])/_0x2dcb4b[0x0][_0x1918('0x70')];_0x5b9f14['predictiveIntervalHitRate']=_0x5c7227>0x0?_0x5c7227:0x1;switch(_0x5b9f14['dialPredictiveOptimization']){case _0x1918('0x1d8'):var _0x5f304c=_0x5b9f14[_0x1918('0x1cb')]/0x64;return _0x1be8b6[_0x1918('0x1e3')](_0x39a552,_0x581cdb,_0xbe456a,_0x5c7227,_0x5f304c)['then'](function(_0x27cec4){return _0x32a5a4(_0x27cec4);});case _0x1918('0x1e4'):var _0x2e9569=_0x5b9f14[_0x1918('0x1cb')]/0x64;return _0x1be8b6['busyFactor'](_0x39a552,_0x581cdb,_0xbe456a,_0x5c7227,_0x2e9569)[_0x1918('0xb6')](function(_0x3a4a27){return _0x32a5a4(_0x3a4a27);});default:return _0x283ce8(msgResponse(_0x1918('0x1e5'),_0x1918('0x148'),_0x1918('0x1e6')));}}else{return _0x283ce8(msgResponse(_0x1918('0x1e5'),_0x1918('0x148'),_0x1918('0x1e7')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x1b19ff){var _0x3441ef=this;return function(_0x43c6e9){return new BPromise(function(_0x1d49ed,_0x4054cb){_['merge'](_0x1b19ff,_0x43c6e9[0x0]);if(checkGetDataPredictive(_0x43c6e9[0x0])){loggerPredictive[_0x1918('0x7e')](JSON[_0x1918('0x4a')](_0x43c6e9[0x0]));if(_0x1b19ff[_0x1918('0x1d6')]==='dropRate'){return _0x3441ef['getVoiceQueueRtPauses'](_0x1b19ff['id'])[_0x1918('0xb6')](function(_0x5889dc){var _0x3fdfda=_0x1b19ff[_0x1918('0x52')]-_0x5889dc[0x0][_0x1918('0x1e8')];var _0x300f10=_0x1b19ff[_0x1918('0x1d4')]*0x3c;var _0x5addaf=_0x43c6e9[0x0][_0x1918('0x69')]+_0x43c6e9[0x0]['predictiveIntervalAvgHoldtime'];var _0x3e8603=(_0x43c6e9[0x0][_0x1918('0x68')]+_0x43c6e9[0x0][_0x1918('0x82')]+_0x43c6e9[0x0][_0x1918('0x6a')])/_0x43c6e9[0x0][_0x1918('0x70')];var _0x256e9d=_0x1b19ff[_0x1918('0x1cb')]/0x64;_0x1b19ff[_0x1918('0x6e')]=_0x5889dc[0x0][_0x1918('0x1e8')]||0x0;_0x1b19ff['predictiveIntervalHitRate']=_0x3e8603>0x0?_0x3e8603:0x1;return _0x3441ef[_0x1918('0x1e3')](_0x3fdfda,_0x300f10,_0x5addaf,_0x3e8603,_0x256e9d);})[_0x1918('0xb6')](function(_0x28f523){return _0x1d49ed(_0x28f523);})[_0x1918('0xaf')](function(_0x499d37){return _0x4054cb(msgResponse(_0x1918('0x1e9'),_0x1918('0x148'),JSON[_0x1918('0x4a')](_0x499d37)));});}if(_0x1b19ff[_0x1918('0x1d6')]===_0x1918('0x1e4')){return _0x3441ef['getVoiceQueueRtPauses'](_0x1b19ff['id'])[_0x1918('0xb6')](function(_0x4e3956){var _0x52ab52=_0x1b19ff[_0x1918('0x52')]-_0x4e3956[0x0]['outboundQueuePauses'];var _0x1cdfdd=_0x1b19ff[_0x1918('0x1d4')]*0x3c;var _0x1370f7=_0x43c6e9[0x0][_0x1918('0x69')]+_0x43c6e9[0x0][_0x1918('0x85')];var _0x293a42=(_0x43c6e9[0x0][_0x1918('0x68')]+_0x43c6e9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x43c6e9[0x0][_0x1918('0x6a')])/_0x43c6e9[0x0][_0x1918('0x70')];var _0x42dc9b=_0x1b19ff[_0x1918('0x1cb')]/0x64;_0x1b19ff[_0x1918('0x6e')]=_0x4e3956[0x0][_0x1918('0x1e8')]||0x0;_0x1b19ff[_0x1918('0x6c')]=_0x293a42>0x0?_0x293a42:0x1;return _0x3441ef['busyFactor'](_0x52ab52,_0x1cdfdd,_0x1370f7,_0x293a42,_0x42dc9b);})['then'](function(_0x1fa5b2){return _0x1d49ed(_0x1fa5b2);})['catch'](function(_0x379dbe){return _0x4054cb(msgResponse('[CatchErlangB]','Failure',JSON['stringify'](_0x379dbe)));});}}else{return _0x4054cb(msgResponse('[getDataPredictive]','Failure',_0x1918('0x1e7')));}});};};Dialer[_0x1918('0x1c')][_0x1918('0x1dd')]=function(_0x1500e0){var _0x54499f=this;return function(){var _0x489b1e=0x0;var _0xa814b=Math[_0x1918('0x1d0')](_0x1500e0[_0x1918('0x73')]*0x3e8);if(_0xa814b>0x0){_0xa814b=_0xa814b<0x64?0x64:_0xa814b;loggerPredictive[_0x1918('0x7e')](_0x1500e0[_0x1918('0x41')],_0x1918('0x1ea'),_0xa814b,_0x1918('0x4b'));_0x1500e0[_0x1918('0x91')]=setInterval(function(){_0x54499f[_0x1918('0x91')](_0x1500e0);loggerPredictiveCalls[_0x1918('0x7e')](_0x1918('0x1eb'),_0x489b1e+=0x1);},_0xa814b);}else{loggerPredictive['info'](_0x1500e0[_0x1918('0x41')],_0x1918('0x1ec'));}};};Dialer[_0x1918('0x1c')][_0x1918('0x1ed')]=function(_0x275f29,_0xe46e2){var _0x8705f2=this;return function(_0x562736){if(_[_0x1918('0x47')](_0x562736)){if(_[_0x1918('0xab')](_0xe46e2['UserId'])||!_0xe46e2[_0x1918('0x1ee')]){if(_0x275f29[_0x1918('0x5a')]===_0x1918('0x9')){_0x275f29[_0x1918('0x131')]=_[_0x1918('0x3c')](_0x275f29['queueStatusComplete'])?!![]:_0x275f29['queueStatusComplete'];var _0x47ed4b=uuid['v4']();_0x8705f2[_0x1918('0x23')][_0x47ed4b]=new Action(_0x275f29,_0xe46e2,_0x47ed4b);loggerBooked[_0x1918('0x7e')]('[booked][checkContactBlack]',_0x47ed4b,'queueStatusComplete:\x20',JSON['stringify'](_0x275f29['queueStatusComplete']),_0x1918('0x1ef'),_0x275f29['name']);if(_0x275f29['queueStatusComplete']){_0x275f29['queueStatusComplete']=![];_0x8705f2[_0x1918('0x12e')][_0x8705f2[_0x1918('0x23')][_0x47ed4b][_0x1918('0xb2')]]=[];ami[_0x1918('0xac')]({'actionid':_0x47ed4b,'action':'queuestatus','queue':_0x275f29['name']})[_0x1918('0xaf')](function(){_0x8705f2['updateOriginated'](_0x275f29);_0x8705f2['rescheduleContact']({'active':![],'ContactId':_0x8705f2['actions'][_0x47ed4b][_0x1918('0xd1')],'ListId':_0x8705f2[_0x1918('0x23')][_0x47ed4b][_0x1918('0xd2')],'VoiceQueueId':_0x8705f2[_0x1918('0x23')][_0x47ed4b][_0x1918('0xd4')]||undefined,'CampaignId':_0x8705f2[_0x1918('0x23')][_0x47ed4b][_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x8705f2['actions'][_0x47ed4b];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x1918('0x4a')](_0x275f29[_0x1918('0x131')]),'Queue:\x20',_0x275f29['name']);_0x8705f2[_0x1918('0xb1')](_0x275f29);_0x8705f2[_0x1918('0xbe')]({'active':![],'ContactId':_0x8705f2[_0x1918('0x23')][_0x47ed4b][_0x1918('0xd1')],'ListId':_0x8705f2['actions'][_0x47ed4b]['ListId'],'VoiceQueueId':_0x8705f2['actions'][_0x47ed4b]['VoiceQueueId']||undefined,'CampaignId':_0x8705f2[_0x1918('0x23')][_0x47ed4b]['CampaignId']||undefined})[_0x1918('0xaf')](loggerCatch(_0x1918('0x1f0')));delete _0x8705f2['actions'][_0x47ed4b];}}else{return _0x8705f2[_0x1918('0x1f1')](_0x275f29,_0xe46e2);}}else{if(getDiff(_0xe46e2['scheduledat'])<_0x275f29[_0x1918('0x1f2')]*0x3c){if(_0xe46e2[_0x1918('0x1f3')]&&!_0xe46e2['Agent'][_0x1918('0x1f4')]){_0x8705f2[_0x1918('0x93')][_0x1918('0x133')](_0xe46e2['id'])['finally'](function(){_0x8705f2[_0x1918('0xb1')](_0x275f29);});}else{_0x8705f2['unlockContact']({'active':![]},_0xe46e2['id'],0x1)['finally'](function(){_0x8705f2['updateOriginated'](_0x275f29);});}}else{_0x275f29['outboundReCallsDay']+=0x1;_0x8705f2[_0x1918('0xb1')](_0x275f29);if(_0x275f29['dialRecallInQueue']){_0x8705f2[_0x1918('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xe46e2['ContactId'],'ListId':_0xe46e2[_0x1918('0xd2')],'VoiceQueueId':_0xe46e2[_0x1918('0xd4')]||undefined,'CampaignId':_0xe46e2[_0x1918('0xd5')]||undefined})[_0x1918('0xaf')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x8705f2['createHistory'](createObjHistory(_0x275f29,_0xe46e2,_0x1918('0x1f5'),0x17,_0x1918('0x1f6')))['catch'](loggerCatch(_0x1918('0x1f7')));}else{_0x8705f2[_0x1918('0xcf')](createObjHistory(_0x275f29,_0xe46e2,_0x1918('0x1f8'),0x16,_0x1918('0x1f9')),_0x1918('0x1fa'),_0x1918('0x1fb'));}}}}else{_0x275f29[_0x1918('0x5f')]+=0x1;_0x8705f2[_0x1918('0xcf')](createObjHistory(_0x275f29,_0xe46e2,_0x1918('0x1fc'),0xd,_0x1918('0x1fd')),_0x1918('0x1fe'),_0x1918('0x1ff'));throw'inBlackList';}};};Dialer[_0x1918('0x1c')][_0x1918('0x161')]=function(_0x2a21c6){var _0x16b71d=this;var _0x23614d=_0x2a21c6[_0x1918('0x200')]-_0x2a21c6['originated']-_0x2a21c6[_0x1918('0xc2')];emitCampaignSummary(_0x2a21c6);if(_0x23614d>0x0){if(_0x23614d>this[_0x1918('0x22')]){_0x23614d=this[_0x1918('0x22')];}_0x2a21c6['temp']+=_0x23614d;this[_0x1918('0xc4')](_0x2a21c6['id'],_0x23614d,_0x2a21c6[_0x1918('0x201')],_0x2a21c6)['then'](function(_0x3f656f){_0x2a21c6[_0x1918('0xc2')]-=_0x23614d;_0x2a21c6[_0x1918('0xc2')]=_0x2a21c6[_0x1918('0xc2')]>0x0?_0x2a21c6[_0x1918('0xc2')]:0x0;if(!checkContactEmpty(_0x3f656f)){_0x2a21c6['message']=_0x1918('0xa0');logger[_0x1918('0x7e')](_0x1918('0x202')+_0x2a21c6[_0x1918('0x41')]);}else{_0x2a21c6['originated']+=_0x3f656f[_0x1918('0x99')];_0x2a21c6[_0x1918('0x3d')]=_0x1918('0x203');for(var _0x1b1cb5=0x0;_0x1b1cb5<_0x3f656f[_0x1918('0x99')];_0x1b1cb5+=0x1){_0x2a21c6[_0x1918('0x204')]+=0x1;if(_[_0x1918('0xab')](_0x3f656f[_0x1b1cb5])||_[_0x1918('0xab')](_0x3f656f[_0x1b1cb5][_0x1918('0x170')])||_[_0x1918('0xab')](_0x3f656f[_0x1b1cb5][_0x1918('0x170')][_0x1918('0x171')])){_0x16b71d[_0x1918('0xce')](_0x1918('0x205'),_0x2a21c6,_0x3f656f[_0x1b1cb5]);}else{_0x16b71d[_0x1918('0x206')](_[_0x1918('0xd0')](_0x3f656f[_0x1b1cb5],[_0x1918('0xd5'),_0x1918('0x207')]))[_0x1918('0xb6')](_0x16b71d[_0x1918('0x1ed')](_0x2a21c6,_0x3f656f[_0x1b1cb5]))[_0x1918('0xaf')](_0x16b71d[_0x1918('0xcd')](_0x1918('0x208'),_0x2a21c6));}}}})[_0x1918('0xaf')](loggerGetContactDialer('[getContactCampaign2]',_0x2a21c6,_0x23614d));}};Dialer['prototype'][_0x1918('0x15b')]=function(_0x52d059,_0x29aa73){var _0x96d197=this;var _0x3a5452=[];var _0x5823e3=_0x29aa73>=0x1?_0x29aa73:0x1;if(_0x52d059[_0x1918('0x5a')]==='booked'){_0x5823e3=0x1;}var _0x3d176b=Math[_0x1918('0x1d0')](_0x52d059['available']*_0x5823e3)-_0x52d059['originated']-_0x52d059[_0x1918('0xc2')];emitVoiceQueueSummary(_0x52d059);if(_0x52d059[_0x1918('0x209')]>0x0){var _0x3b6984=_0x52d059['dialLimitQueue']-_0x52d059[_0x1918('0x71')]-_0x52d059[_0x1918('0x1cf')]-_0x52d059[_0x1918('0xc2')]-_0x52d059[_0x1918('0x53')];if(_0x3d176b>_0x3b6984){_0x3d176b=_0x3b6984;}}if(_0x3d176b>0x0){if(_0x52d059['dialMethod']===_0x1918('0x9')){_0x3d176b=0x1;}if(_0x3d176b>this[_0x1918('0x22')]){_0x3d176b=this[_0x1918('0x22')];}_0x52d059[_0x1918('0xc2')]+=_0x3d176b;for(var _0x2665dc in this[_0x1918('0x12b')]){if(typeof this[_0x1918('0x12b')][_0x2665dc]!==_0x1918('0x9a')){if(this[_0x1918('0x12b')][_0x2665dc]['state']===_0x1918('0x20a')&&this['agents'][_0x2665dc][_0x1918('0xad')]==='reachable'){_0x3a5452['push'](this[_0x1918('0x12b')][_0x2665dc]['id']);}}}this['getContactDialer'](_0x52d059['id'],_0x3a5452,_0x3d176b,_0x52d059['dialOrderByScheduledAt'],_0x52d059)[_0x1918('0xb6')](function(_0x2db6e1){_0x52d059[_0x1918('0xc2')]-=_0x3d176b;_0x52d059[_0x1918('0xc2')]=_0x52d059['temp']>0x0?_0x52d059[_0x1918('0xc2')]:0x0;if(!checkContactEmpty(_0x2db6e1)){_0x96d197[_0x1918('0xb4')](_0x52d059)[_0x1918('0xb6')](sendMessageReschedule(_0x52d059))[_0x1918('0xaf')](loggerCatch(_0x1918('0xb7')));}else{_0x52d059['originated']+=_0x2db6e1[_0x1918('0x99')];_0x52d059[_0x1918('0x3d')]=_0x52d059['dialMethod']==='booked'?_0x1918('0x177'):_0x1918('0x203');for(var _0x124957=0x0;_0x124957<_0x2db6e1[_0x1918('0x99')];_0x124957+=0x1){if(_[_0x1918('0xab')](_0x2db6e1[_0x124957])||_[_0x1918('0xab')](_0x2db6e1[_0x124957][_0x1918('0x170')])||_[_0x1918('0xab')](_0x2db6e1[_0x124957][_0x1918('0x170')][_0x1918('0x171')])){_0x96d197[_0x1918('0xce')](_0x1918('0x205'),_0x52d059,_0x2db6e1[_0x124957]);}else{_0x96d197['checkIsBlackList'](_[_0x1918('0xd0')](_0x2db6e1[_0x124957],[_0x1918('0xd4'),_0x1918('0x207')]))['then'](_0x96d197[_0x1918('0x1ed')](_0x52d059,_0x2db6e1[_0x124957]))[_0x1918('0xaf')](_0x96d197[_0x1918('0xcd')]('[actionOriginate]\x20',_0x52d059));}}}})[_0x1918('0xaf')](loggerGetContactDialer('[getContactDialer2]',_0x52d059,_0x3d176b));}};Dialer[_0x1918('0x1c')][_0x1918('0x91')]=function(_0x197616){if(_0x197616[_0x1918('0x209')]>0x0){var _0xb0bd72=_0x197616[_0x1918('0x209')]-_0x197616[_0x1918('0x71')]-_0x197616[_0x1918('0x1cf')];if(_0xb0bd72>0x0){this[_0x1918('0x20b')](_0x197616);}else{loggerPredictiveCalls['info'](_0x1918('0x20c'));}}else{this['tryOriginatePredictive'](_0x197616);}};Dialer[_0x1918('0x1c')][_0x1918('0x20b')]=function(_0x299f2c){var _0x58a923=this;var _0x48bf91=[];_0x299f2c[_0x1918('0x71')]+=0x1;for(var _0x23e058 in this[_0x1918('0x12b')]){if(typeof this[_0x1918('0x12b')][_0x23e058]!==_0x1918('0x9a')){if(this[_0x1918('0x12b')][_0x23e058][_0x1918('0xa7')]===_0x1918('0x20a')&&this[_0x1918('0x12b')][_0x23e058][_0x1918('0xad')]===_0x1918('0xd9')){_0x48bf91[_0x1918('0x14f')](this['agents'][_0x23e058]['id']);}}}this[_0x1918('0xc1')](_0x299f2c['id'],_0x48bf91,0x1,_0x299f2c[_0x1918('0x201')],_0x299f2c)['then'](function(_0x11847f){if(!checkContactEmpty(_0x11847f)){checkContactLowerLimitOriginate(_0x299f2c,0x1,0x0);_0x58a923['countReScheduled'](_0x299f2c)[_0x1918('0xb6')](sendMessageReschedule(_0x299f2c))[_0x1918('0xaf')](loggerCatch(_0x1918('0xb7')));}else{_0x299f2c['message']=_0x1918('0x203');if(_[_0x1918('0xab')](_0x11847f[0x0])||_[_0x1918('0xab')](_0x11847f[0x0][_0x1918('0x170')])||_[_0x1918('0xab')](_0x11847f[0x0][_0x1918('0x170')][_0x1918('0x171')])){_0x58a923[_0x1918('0xce')]('[actionOriginate]\x20',_0x299f2c,_0x11847f[0x0]);}else{_0x58a923[_0x1918('0xb8')](_[_0x1918('0xd0')](_0x11847f[0x0],[_0x1918('0xd4'),_0x1918('0x207')]))[_0x1918('0xb6')](_0x58a923['checkContactBlack'](_0x299f2c,_0x11847f[0x0]))[_0x1918('0xaf')](_0x58a923['loggerHandler'](_0x1918('0x20d'),_0x299f2c));}}})['catch'](loggerGetContactDialer('[getContactDialerPredictive]',_0x299f2c,0x1));emitVoiceQueueSummary(_0x299f2c);};Dialer[_0x1918('0x1c')][_0x1918('0x1e3')]=function(_0x4eb64f,_0x3478d3,_0x48eb49,_0x4ff163,_0x269e6f,_0x152440){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x1918('0x20e'),_0x4eb64f);loggerPredictive[_0x1918('0x7e')](_0x1918('0x20f'),_0x3478d3);loggerPredictive[_0x1918('0x7e')](_0x1918('0x210'),_0x48eb49);loggerPredictive['info'](_0x1918('0x211'),_0x4ff163);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x269e6f);loggerPredictive[_0x1918('0x7e')](_0x1918('0x86'));return new BPromise(function(_0x4fb489,_0x3a1be7){if(_0x4eb64f<=0x0||isNaN(_0x4eb64f)){return _0x3a1be7(msgResponse(_0x1918('0x212'),'Error',_0x1918('0x213')+_0x4eb64f));}if(_0x48eb49<=0x0||isNaN(_0x48eb49)){return _0x3a1be7(msgResponse(_0x1918('0x212'),'Error',_0x1918('0x214')+_0x48eb49));}if(_0x4ff163<=0x0||isNaN(_0x4ff163)){return _0x3a1be7(msgResponse(_0x1918('0x212'),'Error',_0x1918('0x215')+_0x4ff163));}if(_0x3478d3<=0x0||isNaN(_0x3478d3)){return _0x3a1be7(msgResponse(_0x1918('0x212'),_0x1918('0x49'),'interval\x20=\x20'+_0x3478d3));}if(_0x269e6f<=0x0||isNaN(_0x269e6f)){return _0x3a1be7(msgResponse('[abandonmentRate]',_0x1918('0x49'),_0x1918('0x216')+_0x269e6f));}_0x152440=_0x152440||0x0;var _0x68345e=0x1/_0x48eb49;var _0xaf6287=0x0;var _0x1256b6=0x0;var _0x521254=0x0;var _0x3a4984=0x0;for(var _0x25bd2d=0x0;_0x521254<_0x269e6f;_0x25bd2d+=0x1){_0x1256b6=_0x25bd2d/_0x3478d3;_0xaf6287=(_0x4ff163*_0x1256b6+_0x152440)/_0x68345e;_0x521254=erlangb(_0xaf6287,_0x4eb64f);_0x3a4984=_0xaf6287/_0x4eb64f*(0x1-erlangb(_0xaf6287,_0x4eb64f));}return _0x4fb489({'erlangCalls':_0x25bd2d,'erlangCallToSecond':_0x3478d3/_0x25bd2d,'erlangAbandonmentRate':_0x521254,'erlangBusyFactor':_0x3a4984});});};Dialer[_0x1918('0x1c')]['busyFactor']=function(_0x381bc5,_0x1d72b1,_0x576e6a,_0x16f8fd,_0x56b015,_0x452f5d){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info'](_0x1918('0x20e'),_0x381bc5);loggerPredictive['info'](_0x1918('0x20f'),_0x1d72b1);loggerPredictive[_0x1918('0x7e')]('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',_0x576e6a);loggerPredictive[_0x1918('0x7e')](_0x1918('0x211'),_0x16f8fd);loggerPredictive[_0x1918('0x7e')](_0x1918('0x217'),_0x56b015);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3eacee,_0x27c24d){if(_0x381bc5<=0x0||isNaN(_0x381bc5)){return _0x27c24d(msgResponse(_0x1918('0x218'),_0x1918('0x49'),'m\x20=\x20'+_0x381bc5));}if(_0x576e6a<=0x0||isNaN(_0x576e6a)){return _0x27c24d(msgResponse('[busyFactor]',_0x1918('0x49'),'Ts\x20=\x20'+_0x576e6a));}if(_0x16f8fd<=0x0||isNaN(_0x16f8fd)){return _0x27c24d(msgResponse(_0x1918('0x218'),_0x1918('0x49'),_0x1918('0x215')+_0x16f8fd));}if(_0x1d72b1<=0x0||isNaN(_0x1d72b1)){return _0x27c24d(msgResponse(_0x1918('0x218'),'Error','interval\x20=\x20'+_0x1d72b1));}if(_0x56b015<=0x0||isNaN(_0x56b015)){return _0x27c24d(msgResponse('[busyFactor]',_0x1918('0x49'),'Umin\x20=\x20'+_0x56b015));}_0x452f5d=_0x452f5d||0x0;var _0x447ebd=0x1/_0x576e6a;var _0x2cd14f=0x0;var _0xb157a1=0x0;var _0x99582b=0x0;var _0xbfad75=0x0;for(var _0x5db1b3=0x0;_0xbfad75<_0x56b015;_0x5db1b3+=0x1){_0xb157a1=_0x5db1b3/_0x1d72b1;_0x2cd14f=(_0x16f8fd*_0xb157a1+_0x452f5d)/_0x447ebd;_0x99582b=erlangb(_0x2cd14f,_0x381bc5);_0xbfad75=_0x2cd14f/_0x381bc5*(0x1-erlangb(_0x2cd14f,_0x381bc5));}return _0x3eacee({'erlangCalls':_0x5db1b3,'erlangCallToSecond':_0x1d72b1/_0x5db1b3,'erlangAbandonmentRate':_0x99582b,'erlangBusyFactor':_0xbfad75});});};module[_0x1918('0x219')]=Dialer; \ No newline at end of file +var _0x0e35=['handleIvr','syncQueueSummary','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','checkDialMethod','[syncCampaigns]','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','OriginateError','[originate][error]','Error','originate\x20action\x20Error','getQueue','response','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','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','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','voicePause','dialRecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','emptyContact','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','interval\x20=\x20','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./agentComplete','./queueCallerAbandon','./hangup','env','127.0.0.1','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','milliseconds','diff','seconds','emit','outbound','strategy','answered','available','loggedIn','sumDuration','total','type','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','stringify','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\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','---------------------------','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','stack','length','error','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','actions','undefined','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','countReScheduled','then','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','saveInDb','pick','ContactId','ListId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','dialAMDActive','HangupInAMD','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','MACHINE','Machine','membername','countmachineretry','countglobal','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','VoiceQueueId','[rescheduleContact][Machine]','HANGUP','[syncHangupInAMDIvr][createHistory]','countabandonedretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','minutes','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','channel','syncQueueMember','actionid','roundrobin','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','indexOf','content','all','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0e35,0xc2));var _0x50e3=function(_0x24d650,_0x3bb1e0){_0x24d650=_0x24d650-0x0;var _0x52078c=_0x0e35[_0x24d650];return _0x52078c;};'use strict';var util=require(_0x50e3('0x0'));var _=require(_0x50e3('0x1'));var BPromise=require(_0x50e3('0x2'));var uuid=require(_0x50e3('0x3'));var moment=require(_0x50e3('0x4'));var rr=require('rr');var md5=require(_0x50e3('0x5'));var Redis=require(_0x50e3('0x6'));var ut=require(_0x50e3('0x7'));var config=require(_0x50e3('0x8'));var logger=require(_0x50e3('0x9'))('dialer');var loggerBooked=require(_0x50e3('0x9'))(_0x50e3('0xa'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x50e3('0x9'))(_0x50e3('0xb'));var loggerSyncQueueSummary=require('../../../config/logger')('syncQueueSummary');var ami=require(_0x50e3('0xc'));config[_0x50e3('0xd')]=_[_0x50e3('0xe')](config[_0x50e3('0xd')],{'host':_0x50e3('0xf'),'port':0x18eb});var io=require(_0x50e3('0x10'))(new Redis(config[_0x50e3('0xd')]));var cmHopper=require(_0x50e3('0x11'));var cmHopperHistory=require(_0x50e3('0x12'));var cmHopperBlack=require(_0x50e3('0x13'));var voiceQueueRt=require(_0x50e3('0x14'));var Action=require(_0x50e3('0x15'));var History=require(_0x50e3('0x16'));var Final=require('./final');var AgentComplete=require(_0x50e3('0x17'));var QueueCallerAbandon=require(_0x50e3('0x18'));var Hangup=require(_0x50e3('0x19'));var ipAgi=process[_0x50e3('0x1a')]['XCALLY_IP_AGI']||_0x50e3('0x1b');var strategy={'rrmemory':_0x50e3('0x1c'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x50e3('0x1d')][_0x50e3('0x1e')]=function(_0x4b5ed5){this[_0x50e3('0x1f')]=this[_0x50e3('0x1f')]?this['tail'][_0x50e3('0x20')](_0x4b5ed5):_0x4b5ed5();};function Dialer(_0x5f44e1,_0x411267){this[_0x50e3('0x21')]=new Sequence();this[_0x50e3('0x22')]=_0x411267;this['voiceQueues']=_0x5f44e1[_0x50e3('0x23')];this[_0x50e3('0x24')]=_0x5f44e1[_0x50e3('0x24')];this[_0x50e3('0x25')]=_0x5f44e1['agents'];this['trunks']=_0x5f44e1[_0x50e3('0x26')];this['maxNumberOriginate']=config[_0x50e3('0x27')]||0x2;this[_0x50e3('0x28')]={};this['actions']={};this['contactsId']={};this[_0x50e3('0x29')]={};this[_0x50e3('0x2a')]={};this['startPredictive']={};this[_0x50e3('0x2b')]={};this[_0x50e3('0x2c')]={};this[_0x50e3('0x2d')]={};this[_0x50e3('0x2e')]={};ami['on'](_0x50e3('0x2f'),this[_0x50e3('0x30')]['bind'](this));ami['on'](_0x50e3('0x31'),this[_0x50e3('0x32')][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x34'),this[_0x50e3('0x35')][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x36'),this[_0x50e3('0x37')]['bind'](this));ami['on'](_0x50e3('0x38'),this['syncQueueSummary'][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x39'),this[_0x50e3('0x3a')][_0x50e3('0x33')](this));ami['on'](_0x50e3('0x3b'),this['syncNewExten']['bind'](this));ami['on'](_0x50e3('0x3c'),this['syncVarSet'][_0x50e3('0x33')](this));ami['on']('queuemember',this['syncQueueMember']['bind'](this));ami['on'](_0x50e3('0x3d'),this[_0x50e3('0x3e')][_0x50e3('0x33')](this));this[_0x50e3('0x3f')]();this[_0x50e3('0x40')]();}function isNotNull(_0x23a5f4){return _0x23a5f4!==null&&!_[_0x50e3('0x41')](_0x23a5f4);}function checkIsLoggedIn(_0x2a028b,_0x518a11){return function(){if(_0x518a11<=0x0){_0x2a028b[_0x50e3('0x42')]=_0x50e3('0x43');throw _0x2a028b[_0x50e3('0x44')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x2228e6){return _0x2228e6;}function checkIsActive(_0x3dd69f,_0x412d48){return function(){if(!isActive(_0x412d48)){_0x3dd69f['message']=_0x50e3('0x45');throw _0x3dd69f[_0x50e3('0x44')]+'\x20NOT\x20Active';}};}function checkInterval(_0x3ac5d0){return function(){if(!isNotNull(_0x3ac5d0[_0x50e3('0x46')])){_0x3ac5d0[_0x50e3('0x42')]='INTERVAL_IS_NULL';throw _0x3ac5d0[_0x50e3('0x44')]+_0x50e3('0x47');}if(!isNotNull(_0x3ac5d0[_0x50e3('0x46')][_0x50e3('0x48')])){_0x3ac5d0[_0x50e3('0x42')]=_0x50e3('0x49');throw _0x3ac5d0['name']+_0x50e3('0x47');}if(!isNotNull(_[_0x50e3('0x4a')](_0x3ac5d0[_0x50e3('0x46')]['Intervals']))){_0x3ac5d0[_0x50e3('0x42')]=_0x50e3('0x49');throw _0x3ac5d0['name']+_0x50e3('0x47');}};}function msgResponse(_0x5ab382,_0x24ff31,_0x549220){return{'action':_0x5ab382,'response':_0x24ff31,'message':_0x549220,'stack':_0x549220};}function myreject(_0x2b6e59){return function(_0x5a1f77){return _0x2b6e59(msgResponse(_0x50e3('0x4b'),'Error',JSON['stringify'](_0x5a1f77)));};}function getSeconds(_0x193635,_0x5a849e){var _0x5a7552=moment(_0x193635)[_0x50e3('0x4c')](0x0);var _0x211ad0=moment(_0x5a849e)[_0x50e3('0x4c')](0x0);return _0x5a7552[_0x50e3('0x4d')](_0x211ad0,_0x50e3('0x4e'));}function emit(_0x3748fa,_0xee2040,_0x4adf79){io['to'](_0x3748fa)[_0x50e3('0x4f')](_0xee2040,_0x4adf79);}function emitVoiceQueueSummary(_0x142ced){if(_0x142ced['type']===_0x50e3('0x50')){var _0x3b1385={'id':_0x142ced['id'],'name':_0x142ced['name'],'strategy':_0x142ced[_0x50e3('0x51')],'answered':_0x142ced[_0x50e3('0x52')],'available':_0x142ced[_0x50e3('0x53')],'loggedIn':_0x142ced[_0x50e3('0x54')],'pTalking':_0x142ced['pTalking'],'sumBillable':_0x142ced['sumBillable'],'sumDuration':_0x142ced[_0x50e3('0x55')],'sumHoldTime':_0x142ced['sumHoldTime']||0x0,'talking':_0x142ced['talking'],'total':_0x142ced[_0x50e3('0x56')],'type':_0x142ced[_0x50e3('0x57')],'unmanaged':_0x142ced[_0x50e3('0x58')],'abandoned':_0x142ced['abandoned'],'waiting':_0x142ced[_0x50e3('0x59')],'loggedInDb':_0x142ced[_0x50e3('0x5a')],'dialActive':_0x142ced[_0x50e3('0x5b')],'dialMethod':_0x142ced[_0x50e3('0x5c')],'dialOriginateCallerIdName':_0x142ced['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x142ced['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x142ced[_0x50e3('0x5d')],'dialPrefix':_0x142ced[_0x50e3('0x5e')],'outboundAnswerAgiCallsDay':_0x142ced[_0x50e3('0x5f')],'outboundAnswerCallsDay':_0x142ced[_0x50e3('0x60')],'outboundBlacklistCallsDay':_0x142ced['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x142ced['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x142ced[_0x50e3('0x61')],'outboundDropCallsDayACS':_0x142ced[_0x50e3('0x62')],'outboundDropCallsDayCallersExit':_0x142ced[_0x50e3('0x63')],'outboundDropCallsDayTimeout':_0x142ced[_0x50e3('0x64')],'outboundNoAnswerCallsDay':_0x142ced[_0x50e3('0x65')],'outboundNoSuchCallsDay':_0x142ced[_0x50e3('0x66')],'outboundOriginateFailureCallsDay':_0x142ced[_0x50e3('0x67')],'outboundReCallsDay':_0x142ced[_0x50e3('0x68')],'outboundRejectCallsDay':_0x142ced[_0x50e3('0x69')],'outboundUnknownCallsDay':_0x142ced[_0x50e3('0x6a')],'predictiveIntervalAnsweredCalls':_0x142ced[_0x50e3('0x6b')],'predictiveIntervalAvgHoldtime':_0x142ced[_0x50e3('0x6c')],'predictiveIntervalAvgTalktime':_0x142ced[_0x50e3('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x142ced['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x142ced[_0x50e3('0x6e')],'predictiveIntervalErlangCalls':_0x142ced[_0x50e3('0x6f')],'predictiveIntervalErlangCallsDroppedCalls':_0x142ced[_0x50e3('0x70')],'predictiveIntervalHitRate':_0x142ced[_0x50e3('0x71')],'predictiveIntervalMultiplicativeFactor':_0x142ced['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x142ced[_0x50e3('0x72')],'predictiveIntervalAvailable':_0x142ced[_0x50e3('0x73')],'predictiveIntervalTotalCalls':_0x142ced[_0x50e3('0x74')],'message':_0x142ced['message'],'originated':_0x142ced[_0x50e3('0x75')],'erlangCalls':_0x142ced[_0x50e3('0x76')],'erlangCallToSecond':_0x142ced['erlangCallToSecond'],'erlangAbandonmentRate':_0x142ced[_0x50e3('0x77')],'erlangBusyFactor':_0x142ced[_0x50e3('0x78')],'startPredictive':_0x142ced[_0x50e3('0x79')],'startProgressive':_0x142ced[_0x50e3('0x2b')]};if(_0x142ced[_0x50e3('0x7a')]){_0x3b1385[_0x50e3('0x7a')]={'id':_0x142ced[_0x50e3('0x7a')]['id'],'name':_0x142ced[_0x50e3('0x7a')][_0x50e3('0x44')],'active':_0x142ced[_0x50e3('0x7a')][_0x50e3('0x7b')],'callerid':_0x142ced['Trunk'][_0x50e3('0x7c')]};}if(_0x142ced[_0x50e3('0x46')]){_0x3b1385[_0x50e3('0x46')]={'id':_0x142ced[_0x50e3('0x46')]['id'],'name':_0x142ced[_0x50e3('0x46')][_0x50e3('0x44')]};}var _0x36e9e3=md5(JSON[_0x50e3('0x7d')](_0x3b1385));if(_0x142ced[_0x50e3('0x5')]!==_0x36e9e3){_0x142ced[_0x50e3('0x5')]=_0x36e9e3;emit(util['format'](_0x50e3('0x7e'),_0x3b1385[_0x50e3('0x44')]),'voice_queue:save',_0x3b1385);}}}function emitCampaignSummary(_0x2d9f33){if(_0x2d9f33['type']===_0x50e3('0x7f')){emit(util[_0x50e3('0x80')](_0x50e3('0x81'),_0x2d9f33[_0x50e3('0x44')]),_0x50e3('0x82'),_0x2d9f33);}}function checkGetDataPredictive(_0x58e9aa){if(isNotNull(_0x58e9aa)&&!_['isEmpty'](_0x58e9aa)){loggerPredictive[_0x50e3('0x83')](_0x50e3('0x84'));loggerPredictive['info'](_0x50e3('0x85'),_0x58e9aa[_0x50e3('0x74')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x86'),_0x58e9aa['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x50e3('0x83')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x58e9aa[_0x50e3('0x6e')]);loggerPredictive['info'](_0x50e3('0x87'),_0x58e9aa[_0x50e3('0x88')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x89'),_0x58e9aa[_0x50e3('0x6c')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x8a'),_0x58e9aa[_0x50e3('0x6d')]);loggerPredictive['info']('---------------------------');if(_0x58e9aa[_0x50e3('0x74')]>0x0){if(!_['isUndefined'](_0x58e9aa[_0x50e3('0x6d')])&&_0x58e9aa[_0x50e3('0x6d')]>0x0){return!![];}loggerPredictive[_0x50e3('0x83')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x50e3('0x41')](_0x58e9aa['predictiveIntervalAvgHoldtime'])&&_0x58e9aa['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0x50e3('0x8b'));}else{loggerPredictive[_0x50e3('0x83')](_0x50e3('0x8c'));}}else{loggerPredictive['info'](_0x50e3('0x8d'));}return![];}function mergeDataErlangB(_0x4f956f){return function(_0x5c9a19){loggerPredictive[_0x50e3('0x83')](_0x50e3('0x8e'));loggerPredictive['info'](_0x50e3('0x8f'),_0x5c9a19[_0x50e3('0x76')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x90'),_0x5c9a19[_0x50e3('0x91')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x92'),_0x5c9a19[_0x50e3('0x77')]);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x93'),_0x5c9a19[_0x50e3('0x78')]);loggerPredictive[_0x50e3('0x83')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c9a19[_0x50e3('0x77')]);loggerPredictive['info'](_0x50e3('0x94'));_[_0x50e3('0x95')](_0x4f956f,_0x5c9a19);};}function getDiff(_0x4a90b8){var _0x13bc4c=moment()[_0x50e3('0x4c')](0x0);var _0x14200f=moment(_0x4a90b8)[_0x50e3('0x4c')](0x0);return _0x13bc4c[_0x50e3('0x4d')](_0x14200f,_0x50e3('0x4e'));}function ifInterval(_0x37997a,_0xd0bb04){if(_[_0x50e3('0x41')](_0xd0bb04)){return![];}return getDiff(_0xd0bb04)<_0x37997a*0x3c;}function freeVariablesPredictive(_0x449c42){if(isNotNull(_0x449c42)){if(!_['isUndefined'](_0x449c42['startProgressive'])){_0x449c42[_0x50e3('0x2b')]=undefined;loggerPredictive[_0x50e3('0x83')](_0x449c42[_0x50e3('0x44')],_0x50e3('0x96'));}if(!_[_0x50e3('0x41')](_0x449c42['startPredictive'])){_0x449c42[_0x50e3('0x79')]=undefined;loggerPredictive[_0x50e3('0x83')](_0x449c42[_0x50e3('0x44')],_0x50e3('0x97'));}if(!_[_0x50e3('0x41')](_0x449c42[_0x50e3('0x98')])){clearInterval(_0x449c42[_0x50e3('0x98')]);_0x449c42[_0x50e3('0x98')]=undefined;loggerPredictive[_0x50e3('0x83')](_0x449c42['name'],_0x50e3('0x99'));}}}function erlangb(_0x4c3937,_0x5a21a1){if(_0x5a21a1===0x0){return 0x0;}var _0x1ae555=0x1;for(var _0xe75227=0x1;_0xe75227<=_0x5a21a1;_0xe75227+=0x1){_0x1ae555=0x1+_0x1ae555*_0xe75227/_0x4c3937;}return 0x1/_0x1ae555;}function isVoiceQueueOutbound(_0x3a3a83){return _0x3a3a83===_0x50e3('0x50');}function isNotPreview(_0x2c283f){return _0x2c283f!==_0x50e3('0x22');}function isCampaignIvr(_0x47fbc5){return _0x47fbc5==='ivr';}function getCallerId(_0x284bfd,_0x2d3344,_0x418133){if(!_[_0x50e3('0x41')](_0x418133)&&typeof _0x418133===_0x50e3('0x9a')&&!_[_0x50e3('0x4a')](_0x418133)){if(!_['isUndefined'](_0x2d3344)&&typeof _0x2d3344==='string'&&!_[_0x50e3('0x4a')](_0x2d3344)){return util['format'](_0x50e3('0x9b'),_0x2d3344,_0x418133);}return util[_0x50e3('0x80')]('\x22%s\x22\x20<%s>',_0x418133,_0x418133);}if(!_[_0x50e3('0x41')](_0x284bfd)&&typeof _0x284bfd===_0x50e3('0x9a')&&!_['isEmpty'](_0x284bfd)){return _0x284bfd;}return _0x50e3('0x9c');}function loggerCatchQueueSummary(_0x54715a,_0x4b8322){return function(_0x2e68f6){freeVariablesPredictive(_0x4b8322);emitVoiceQueueSummary(_0x4b8322);emitCampaignSummary(_0x4b8322);loggerSyncQueueSummary['error'](_0x54715a,util[_0x50e3('0x9d')](_0x2e68f6,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x176e65,_0x401623){return function(_0x7188c1){loggerPredictive['error'](_0x401623['name'],_0x176e65);loggerPredictive['error'](_0x7188c1[_0x50e3('0x9e')]);freeVariablesPredictive(_0x401623);};}function loggerCatch(_0x1d2555){return function(_0xb88c41){logger['error'](_0x1d2555,util[_0x50e3('0x9d')](_0xb88c41,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5186be){return _0x5186be&&!_['isUndefined'](_0x5186be)&&_0x5186be[_0x50e3('0x9f')]>0x0;}function decremetOriginate(_0x26aa09){if(!_[_0x50e3('0x41')](_0x26aa09)&&_0x26aa09!==null){if(typeof _0x26aa09[_0x50e3('0x75')]!=='undefined'){if(_0x26aa09[_0x50e3('0x75')]>0x0){_0x26aa09[_0x50e3('0x75')]-=0x1;}else{logger[_0x50e3('0xa0')](_0x50e3('0xa1'));}}}else{logger[_0x50e3('0xa0')](_0x50e3('0xa2'));}}function checkContactLowerLimitOriginate(_0x454853,_0x494d9d,_0x3db59f){if(_0x494d9d>_0x3db59f){for(var _0x4620bf=0x0;_0x4620bf<_0x494d9d-_0x3db59f;_0x4620bf+=0x1){decremetOriginate(_0x454853);}}}function loggerGetContactDialer(_0x4da043,_0x2d6ace,_0x253f1e){return function(_0xb94351){checkContactLowerLimitOriginate(_0x2d6ace,_0x253f1e,0x0);logger['error'](_0x4da043,util[_0x50e3('0x9d')](_0xb94351,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x5aa1e8){return function(_0x5d4db3){if(isNotNull(_0x5d4db3)&&isNotNull(_0x5d4db3[0x0])){if(_0x5d4db3[0x0]['contactsRescheduled']>0x0){_0x5aa1e8[_0x50e3('0x42')]=_0x50e3('0xa3');logger['info'](_0x50e3('0xa4')+_0x5aa1e8[_0x50e3('0x44')],_0x5d4db3[0x0]['contactsRescheduled'],'contacts');}else{_0x5aa1e8['message']=_0x50e3('0xa5');logger[_0x50e3('0x83')]('[getContactDialer2][Empty]'+_0x5aa1e8[_0x50e3('0x44')]);}}};}function notSendMessagesQueue(_0x4bea64){if(_0x4bea64[_0x50e3('0xa6')]){freeVariablesPredictive(_0x4bea64);if(_0x4bea64[_0x50e3('0x75')]===0x0&&_0x4bea64['talking']===0x0&&_0x4bea64['waiting']===0x0&&(_0x4bea64[_0x50e3('0xa7')]||0x0)===0x0){_0x4bea64['sendMessageOneNotActive']=![];_0x4bea64[_0x50e3('0x53')]=0x0;_0x4bea64[_0x50e3('0x42')]=_0x50e3('0x45');loggerSyncQueueSummary[_0x50e3('0xa0')](_0x50e3('0xa8'),_0x4bea64[_0x50e3('0x44')],_0x50e3('0xa9'));}else{_0x4bea64['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x50e3('0xa0')](_0x50e3('0xa8'),_0x4bea64[_0x50e3('0x44')],_0x50e3('0xaa'));}emitVoiceQueueSummary(_0x4bea64);}}function notSendMessagesCampaign(_0x45ca01){if(_0x45ca01['sendMessageOneNotActive']){if(_0x45ca01[_0x50e3('0x75')]===0x0){_0x45ca01[_0x50e3('0xa6')]=![];_0x45ca01[_0x50e3('0x42')]='NOT_ACTIVE';loggerSyncQueueSummary['error'](_0x50e3('0xab'),_0x45ca01[_0x50e3('0x44')],'is\x20not\x20active');}else{_0x45ca01[_0x50e3('0x42')]=_0x50e3('0xac');loggerSyncQueueSummary[_0x50e3('0xa0')](_0x50e3('0xab'),_0x45ca01[_0x50e3('0x44')],_0x50e3('0xaa'));}emitCampaignSummary(_0x45ca01);}}function createObjHistory(_0x4caf37,_0x30808e,_0xc49309,_0x14f1d7,_0x5560aa){_0x4caf37['message']=_0xc49309;var _0x38dbad=new Action(_0x4caf37,_0x30808e);var _0x23c4e0=new History(_0x38dbad);_0x23c4e0[_0x50e3('0xad')]=_0x14f1d7;_0x23c4e0[_0x50e3('0xae')]=_0x5560aa;_0x23c4e0[_0x50e3('0xaf')]=_0x38dbad[_0x50e3('0xb0')];return _0x23c4e0;}Dialer[_0x50e3('0x1d')]['loopClearZombieChannels']=function(){var _0x5c7181=this;setInterval(function(){_0x5c7181[_0x50e3('0xb1')](_0x5c7181['uniqueId'],_0x50e3('0xb2'));_0x5c7181['clearZombieChannels'](_0x5c7181[_0x50e3('0xb3')],'[actions]');},0x32c8);};Dialer['prototype'][_0x50e3('0xb1')]=function(_0x4cdbcc,_0x58ff76){var _0x41378b=this;for(var _0x326eef in _0x4cdbcc){if(typeof _0x4cdbcc[_0x326eef]!==_0x50e3('0xb4')){this['sequence']['enqueue'](function(){if(!_[_0x50e3('0xb5')](_0x4cdbcc[_0x326eef])){return ami[_0x50e3('0xb6')]({'action':_0x50e3('0xb7'),'channel':_0x4cdbcc[_0x326eef]['channel']})[_0x50e3('0xb8')](function(_0x1de03c){if(_0x1de03c['message']===_0x50e3('0xb9')){setTimeout(function(){if(_0x4cdbcc[_0x326eef]&&_0x4cdbcc[_0x326eef][_0x50e3('0x57')]!==_0x50e3('0x7f')){_0x41378b[_0x50e3('0xba')](_0x41378b['voiceQueues'][_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]]);logger[_0x50e3('0xa0')](_0x50e3('0xbc'),_0x58ff76,_0x326eef,_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]);delete _0x4cdbcc[_0x326eef];}if(_0x4cdbcc[_0x326eef]&&_0x4cdbcc[_0x326eef][_0x50e3('0x57')]===_0x50e3('0x7f')){_0x41378b['updateOriginated'](_0x41378b[_0x50e3('0x24')][_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]]);logger[_0x50e3('0xa0')]('[Dialer][checkChannel][ivr]',_0x58ff76,_0x326eef,_0x4cdbcc[_0x326eef][_0x50e3('0xbb')]);delete _0x4cdbcc[_0x326eef];}},0x2328);}});}});}}};Dialer[_0x50e3('0x1d')][_0x50e3('0xbd')]=function(_0x461af0){return BPromise['resolve']()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xbd')](_0x461af0))['catch'](loggerCatch(_0x50e3('0xbf')));};Dialer['prototype'][_0x50e3('0xc0')]=function(_0x125e14){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperBlack[_0x50e3('0xc0')](_0x125e14))['catch'](loggerCatch(_0x50e3('0xc2')));};Dialer[_0x50e3('0x1d')][_0x50e3('0xc3')]=function(_0x3b30e9){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperBlack[_0x50e3('0xc3')](_0x3b30e9))[_0x50e3('0xb8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype']['averageHandleTime']=function(_0x1a231d){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperHistory[_0x50e3('0xc4')](_0x1a231d))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xc5')));};Dialer[_0x50e3('0x1d')]['rescheduleContact']=function(_0x229885){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xc6')](_0x229885))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xc7')));};Dialer['prototype'][_0x50e3('0xc8')]=function(_0x3e52ce,_0x35a0da,_0x55aacc){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xc8')](_0x3e52ce,_0x35a0da,_0x55aacc))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xc9')));};Dialer[_0x50e3('0x1d')]['getContactDialer']=function(_0xeb35b9,_0x19a7da,_0x487e87,_0x4a75f1,_0x1607d1){return BPromise['resolve']()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xca')](_0xeb35b9,_0x19a7da,_0x487e87,_0x4a75f1))['catch'](function(_0x13b9fc){_0x1607d1[_0x50e3('0xcb')]-=_0x487e87;_0x1607d1['temp']=_0x1607d1[_0x50e3('0xcb')]>0x0?_0x1607d1[_0x50e3('0xcb')]:0x0;loggerCatch(_0x50e3('0xcc'))(_0x13b9fc);});};Dialer[_0x50e3('0x1d')][_0x50e3('0xcd')]=function(_0x58207b,_0x5b4b33,_0x5368cb,_0x1b9404){return BPromise['resolve']()[_0x50e3('0xbe')](cmHopper[_0x50e3('0xcd')](_0x58207b,_0x5b4b33,_0x5368cb))[_0x50e3('0xb8')](function(_0x5d4a4a){_0x1b9404[_0x50e3('0xcb')]-=_0x5b4b33;_0x1b9404[_0x50e3('0xcb')]=_0x1b9404[_0x50e3('0xcb')]>0x0?_0x1b9404[_0x50e3('0xcb')]:0x0;loggerCatch(_0x50e3('0xce'))(_0x5d4a4a);});};Dialer[_0x50e3('0x1d')][_0x50e3('0xcf')]=function(_0x434504){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](voiceQueueRt[_0x50e3('0xcf')](_0x434504))['catch'](loggerCatch(_0x50e3('0xd0')));};Dialer[_0x50e3('0x1d')][_0x50e3('0xd1')]=function(_0x3f4cf4){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopper['moveContactManagedDialer'](_0x3f4cf4))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xd2')));};Dialer['prototype'][_0x50e3('0xd3')]=function(_0x5ac306){return BPromise[_0x50e3('0xc1')]()[_0x50e3('0xbe')](cmHopperHistory[_0x50e3('0xd3')](_0x5ac306))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xd4')));};Dialer['prototype'][_0x50e3('0xba')]=function(_0x19b947){if(!_[_0x50e3('0x41')](_0x19b947)&&_0x19b947!==null){if(typeof _0x19b947[_0x50e3('0x75')]!==_0x50e3('0xb4')){if(_0x19b947['originated']>0x0){_0x19b947['originated']-=0x1;}else{logger[_0x50e3('0xa0')](_0x50e3('0xd5'));}}}else{logger[_0x50e3('0xa0')](_0x50e3('0xd6'));}};Dialer[_0x50e3('0x1d')]['loggerHandler']=function(_0x45ab81,_0x392138){var _0x155e55=this;return function(_0x369b2c){_0x155e55['updateOriginated'](_0x392138);logger[_0x50e3('0xa0')](_0x45ab81,util[_0x50e3('0x9d')](_0x369b2c,{'showHidden':![],'depth':null}));};};Dialer[_0x50e3('0x1d')]['emptyContact']=function(_0xeae3a6,_0xc39894,_0x43414e){var _0x33c1a4={'state':0x19,'statedesc':'notFound'};this[_0x50e3('0xba')](_0xc39894);this[_0x50e3('0xd7')](_['merge'](_0x33c1a4,_[_0x50e3('0xd8')](_0x43414e,[_0x50e3('0xd9'),_0x50e3('0xda'),'UserId','VoiceQueueId',_0x50e3('0xdb')])),'[emptyContact][createHistory]',_0x50e3('0xdc'));logger[_0x50e3('0xa0')](_0xeae3a6);};Dialer[_0x50e3('0x1d')][_0x50e3('0xdd')]=function(_0x3ce4c1){return _0x3ce4c1===_0x50e3('0xde');};Dialer[_0x50e3('0x1d')][_0x50e3('0xdf')]=function(_0x27ce9a){return!_[_0x50e3('0x41')](_0x27ce9a)&&_0x27ce9a&&!_[_0x50e3('0x41')](_0x27ce9a['name'])&&!_['isUndefined'](_0x27ce9a['active'])&&_0x27ce9a['active']&&(this[_0x50e3('0x26')][util[_0x50e3('0x80')](_0x50e3('0xe0'),_0x27ce9a['name'])]['status']===_0x50e3('0xe1')||this[_0x50e3('0x26')][util[_0x50e3('0x80')](_0x50e3('0xe0'),_0x27ce9a['name'])][_0x50e3('0xb7')]===_0x50e3('0xe2'));};Dialer['prototype'][_0x50e3('0xd7')]=function(_0x49e198,_0x35e7ab,_0x51d6eb){this['createHistory'](_0x49e198)[_0x50e3('0xb8')](loggerCatch(_0x35e7ab));this[_0x50e3('0xd1')](_0x49e198)['catch'](loggerCatch(_0x51d6eb));};Dialer['prototype']['syncVarSet']=function(_0x2a69f1){var _0x4b7490=this[_0x50e3('0x29')][_0x2a69f1[_0x50e3('0xe3')]];var _0x177fff;if(!_['isNil'](_0x2a69f1)&&!_['isNil'](_0x2a69f1[_0x50e3('0xe4')])&&!_[_0x50e3('0xb5')](_0x2a69f1['variable'][_0x50e3('0xe5')])&&_0x2a69f1[_0x50e3('0xe6')]==='xcally-motion-dialer'&&_0x4b7490){if(_0x4b7490[_0x50e3('0x57')]!==_0x50e3('0x7f')&&this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1['value']==='HANGUP'){delete this['uniqueId'][_0x2a69f1['uniqueid']];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]]);this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0x60')]+=0x1;this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0x5f')]+=0x1;_0x177fff=new Hangup(_0x4b7490,_0x2a69f1);_0x177fff[_0x50e3('0xad')]=0x12;_0x177fff[_0x50e3('0xae')]=_0x50e3('0xe8');_0x177fff['membername']=_0x50e3('0xe9');ami[_0x50e3('0x4f')](_0x50e3('0xea'),ut[_0x50e3('0xeb')](_0x177fff,'amd'));this[_0x50e3('0xd7')](_0x177fff,_0x50e3('0xec'),_0x50e3('0xed'));}if(_0x4b7490[_0x50e3('0x57')]!==_0x50e3('0x7f')&&this[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1[_0x50e3('0xee')]===_0x50e3('0xef')){var _0x2c122f=this;return new BPromise(function(_0x5c34cc,_0x32b66d){delete _0x2c122f[_0x50e3('0x29')][_0x2a69f1[_0x50e3('0xe3')]];_0x2c122f[_0x50e3('0xba')](_0x2c122f[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]]);_0x2c122f[_0x50e3('0x23')][_0x4b7490[_0x50e3('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x2c122f['voiceQueues'][_0x4b7490['queue']][_0x50e3('0x5f')]+=0x1;var _0x505581=_0x2c122f['voiceQueues'][_0x4b7490[_0x50e3('0xbb')]];var _0x4ff172=new Hangup(_0x4b7490,_0x2a69f1);_0x4ff172['state']=0x13;_0x4ff172[_0x50e3('0xae')]=_0x50e3('0xf0');_0x4ff172[_0x50e3('0xf1')]=_0x50e3('0xe9');_0x4ff172[_0x50e3('0xf2')]+=0x1;_0x4ff172[_0x50e3('0xf3')]+=0x1;_0x4ff172[_0x50e3('0xf4')]=!![];ami[_0x50e3('0x4f')](_0x50e3('0xea'),ut[_0x50e3('0xeb')](_0x4ff172,_0x50e3('0xf4')));_0x2c122f[_0x50e3('0xd3')](_0x4ff172)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xf5')));if(_0x4ff172[_0x50e3('0xf6')]+_0x4ff172[_0x50e3('0xf7')]+_0x4ff172[_0x50e3('0xf8')]+_0x4ff172[_0x50e3('0xf9')]+_0x4ff172[_0x50e3('0xfa')]+_0x4ff172['countabandonedretry']+_0x4ff172[_0x50e3('0xf2')]+_0x4ff172['countagentrejectretry']>=_0x505581[_0x50e3('0xfb')]){_0x2c122f[_0x50e3('0xfc')](_0x4ff172,_0x5c34cc,_0x32b66d,_0x50e3('0xfd'));}else{if(_0x4ff172[_0x50e3('0xf2')]>=_0x505581['dialMachineMaxRetry']){_0x2c122f['createStateFinal'](_0x4ff172,_0x5c34cc,_0x32b66d,'reason\x2019\x20machine....');}else{_0x2c122f[_0x50e3('0xc6')]({'active':![],'countmachineretry':_0x4ff172[_0x50e3('0xf2')],'scheduledat':moment()[_0x50e3('0xfe')](_0x505581[_0x50e3('0xff')],'minutes')['format'](_0x50e3('0x100')),'ContactId':_0x4ff172[_0x50e3('0xd9')],'ListId':_0x4ff172['ListId'],'VoiceQueueId':_0x4ff172[_0x50e3('0x101')]||undefined,'CampaignId':_0x4ff172[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x102')));_0x5c34cc({'reschedule':0x1});}}});}if(_0x4b7490[_0x50e3('0x57')]===_0x50e3('0x7f')&&this[_0x50e3('0x24')][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1[_0x50e3('0xee')]===_0x50e3('0x103')){delete this[_0x50e3('0x29')][_0x2a69f1['uniqueid']];this[_0x50e3('0xba')](this[_0x50e3('0x24')][_0x4b7490[_0x50e3('0xbb')]]);_0x177fff=new Hangup(_0x4b7490,_0x2a69f1);_0x177fff[_0x50e3('0xad')]=0x12;_0x177fff[_0x50e3('0xae')]=_0x50e3('0xe8');_0x177fff[_0x50e3('0xf1')]='AMD';ami[_0x50e3('0x4f')]('custom:amd',ut[_0x50e3('0xeb')](_0x177fff,_0x50e3('0xf4')));this[_0x50e3('0xd7')](_0x177fff,_0x50e3('0x104'),'[syncHangupInAMDIvr]');}if(_0x4b7490[_0x50e3('0x57')]===_0x50e3('0x7f')&&this['campaigns'][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0xe7')]&&_0x2a69f1['value']===_0x50e3('0xef')){var _0x2c122f=this;return new BPromise(function(_0x5d2932,_0x2f0c6d){delete _0x2c122f[_0x50e3('0x29')][_0x2a69f1[_0x50e3('0xe3')]];_0x2c122f[_0x50e3('0xba')](_0x2c122f[_0x50e3('0x24')][_0x4b7490['queue']]);_0x2c122f['campaigns'][_0x4b7490[_0x50e3('0xbb')]][_0x50e3('0x60')]+=0x1;_0x2c122f[_0x50e3('0x24')][_0x4b7490['queue']][_0x50e3('0x5f')]+=0x1;var _0x8d87ce=_0x2c122f[_0x50e3('0x24')][_0x4b7490['queue']];var _0x54267b=new Hangup(_0x4b7490,_0x2a69f1);_0x54267b[_0x50e3('0xad')]=0x13;_0x54267b[_0x50e3('0xae')]=_0x50e3('0xf0');_0x54267b[_0x50e3('0xf1')]=_0x50e3('0xe9');_0x54267b[_0x50e3('0xf2')]+=0x1;_0x54267b[_0x50e3('0xf3')]+=0x1;_0x54267b[_0x50e3('0xf4')]=!![];ami[_0x50e3('0x4f')](_0x50e3('0xea'),ut[_0x50e3('0xeb')](_0x54267b,'amd'));_0x2c122f[_0x50e3('0xd3')](_0x54267b)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xf5')));if(_0x54267b[_0x50e3('0xf6')]+_0x54267b[_0x50e3('0xf7')]+_0x54267b['countnoanswerretry']+_0x54267b[_0x50e3('0xf9')]+_0x54267b[_0x50e3('0xfa')]+_0x54267b[_0x50e3('0x105')]+_0x54267b[_0x50e3('0xf2')]+_0x54267b[_0x50e3('0x106')]>=_0x8d87ce[_0x50e3('0xfb')]){_0x2c122f[_0x50e3('0xfc')](_0x54267b,_0x5d2932,_0x2f0c6d,_0x50e3('0xfd'));}else{if(_0x54267b['countmachineretry']>=_0x8d87ce[_0x50e3('0x107')]){_0x2c122f[_0x50e3('0x108')](_0x54267b,_0x5d2932,_0x2f0c6d,_0x50e3('0x109'));}else{_0x2c122f[_0x50e3('0xc6')]({'active':![],'countmachineretry':_0x54267b[_0x50e3('0xf2')],'scheduledat':moment()[_0x50e3('0xfe')](_0x8d87ce[_0x50e3('0xff')],_0x50e3('0x10a'))[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54267b[_0x50e3('0xd9')],'ListId':_0x54267b[_0x50e3('0xda')],'VoiceQueueId':_0x54267b[_0x50e3('0x101')]||undefined,'CampaignId':_0x54267b['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact][Machine]'));_0x5d2932({'reschedule':0x1});}}});}}};Dialer[_0x50e3('0x1d')][_0x50e3('0x3a')]=function(_0x733574){var _0xb14798=this[_0x50e3('0x29')][_0x733574[_0x50e3('0xe3')]];var _0x106ea8=this;var _0x3d6354;if(_0xb14798&&_0xb14798[_0x50e3('0x57')]===_0x50e3('0x7f')){delete this[_0x50e3('0x29')][_0x733574['uniqueid']];this[_0x50e3('0xba')](this['campaigns'][_0xb14798[_0x50e3('0xbb')]]);this[_0x50e3('0x24')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x10b')]+=0x1;_0x3d6354=new Hangup(_0xb14798,_0x733574);this[_0x50e3('0xd3')](_0x3d6354)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x10c')));this[_0x50e3('0xd1')](_0x3d6354)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x10d')));}if(_0xb14798&&_0xb14798[_0x50e3('0x57')]!==_0x50e3('0x7f')&&isNotNull(this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x10e')])){delete this[_0x50e3('0x29')][_0x733574[_0x50e3('0xe3')]];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0xb14798['queue']]);this[_0x50e3('0x23')][_0xb14798['queue']][_0x50e3('0x60')]+=0x1;this['voiceQueues'][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x5f')]+=0x1;_0x3d6354=new Hangup(_0xb14798,_0x733574);_0x3d6354[_0x50e3('0xad')]=0x10;_0x3d6354[_0x50e3('0xae')]=_0x50e3('0x10f');_0x3d6354[_0x50e3('0xf1')]=_0x50e3('0x110');this[_0x50e3('0xd3')](_0x3d6354)['catch'](loggerCatch(_0x50e3('0x10c')));this[_0x50e3('0xd1')](_0x3d6354)['catch'](loggerCatch(_0x50e3('0x10d')));}if(_0xb14798&&_0xb14798[_0x50e3('0x57')]!=='ivr'&&!isNotNull(this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x10e')])){delete this['uniqueId'][_0x733574[_0x50e3('0xe3')]];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]]);this[_0x50e3('0x23')][_0xb14798[_0x50e3('0xbb')]][_0x50e3('0x6a')]+=0x1;_0x3d6354=new Hangup(_0xb14798,_0x733574);_0x3d6354[_0x50e3('0xad')]=0xc;_0x3d6354[_0x50e3('0xae')]=_0x733574[_0x50e3('0x111')];_0x3d6354['membername']=_0x50e3('0x112');this['createHistory'](_0x3d6354)[_0x50e3('0xb8')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x50e3('0xd1')](_0x3d6354)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x10d')));}};Dialer['prototype'][_0x50e3('0x37')]=function(_0x23a197){var _0x19a082=this['uniqueId'][_0x23a197[_0x50e3('0xe3')]];var _0x20ff97=this;if(this[_0x50e3('0x23')][_0x23a197[_0x50e3('0xbb')]]){if(_0x19a082&&_0x19a082['type']!==_0x50e3('0x7f')){delete this['uniqueId'][_0x23a197[_0x50e3('0xe3')]];this['voiceQueues'][_0x23a197[_0x50e3('0xbb')]][_0x50e3('0x60')]+=0x1;var _0x5b5b50=new AgentComplete(_0x19a082,_0x23a197);if(_0x23a197[_0x50e3('0x113')]===_0x50e3('0x114')){_0x5b5b50[_0x50e3('0x115')]=this[_0x50e3('0x23')][_0x23a197[_0x50e3('0xbb')]]['dialQueueProject2']&&this[_0x50e3('0x23')][_0x23a197[_0x50e3('0xbb')]][_0x50e3('0x116')]?moment()[_0x50e3('0x80')](_0x50e3('0x100')):undefined;}this[_0x50e3('0xd3')](_0x5b5b50)['catch'](loggerCatch(_0x50e3('0x117')));this[_0x50e3('0xd1')](_0x5b5b50)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x118')));}}};Dialer[_0x50e3('0x1d')]['syncAgentConnect']=function(_0xf88efb){if(this[_0x50e3('0x23')][_0xf88efb[_0x50e3('0xbb')]]){if(this[_0x50e3('0x29')][_0xf88efb['uniqueid']]&&this['uniqueId'][_0xf88efb[_0x50e3('0xe3')]][_0x50e3('0x57')]!==_0x50e3('0x7f')){this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0xf88efb['queue']]);this[_0x50e3('0x29')][_0xf88efb['uniqueid']]['answertime']=moment()['format'](_0x50e3('0x100'));}}};Dialer[_0x50e3('0x1d')]['queueCallerAbandonCreateState']=function(_0x20f045){this[_0x50e3('0xd3')](_0x20f045)[_0x50e3('0xb8')](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x50e3('0xd1')](_0x20f045)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x119')));};Dialer[_0x50e3('0x1d')][_0x50e3('0x32')]=function(_0x20d89a){var _0x20bb45=this[_0x50e3('0x29')][_0x20d89a[_0x50e3('0xe3')]];var _0x58ca0f=this;if(this['voiceQueues'][_0x20d89a[_0x50e3('0xbb')]]){if(_0x20bb45&&_0x20bb45['type']!==_0x50e3('0x7f')){delete this['uniqueId'][_0x20d89a[_0x50e3('0xe3')]];this[_0x50e3('0xba')](this[_0x50e3('0x23')][_0x20d89a['queue']]);_0x20bb45['droptime']=moment()[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2d5e31=new QueueCallerAbandon(_0x20bb45,_0x20d89a);if(getSeconds(_0x20bb45[_0x50e3('0x11a')],_0x20bb45[_0x50e3('0x11b')])>=_0x20bb45[_0x50e3('0x11c')]){this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x6e')]+=0x1;this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x64')]+=0x1;this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x70')]+=0x1;_0x2d5e31[_0x50e3('0xad')]=0xa;_0x2d5e31[_0x50e3('0xae')]=_0x50e3('0x11d');_0x2d5e31[_0x50e3('0x11e')]=_0x50e3('0x11f');_0x2d5e31[_0x50e3('0x115')]=this[_0x50e3('0x23')][_0x20d89a['queue']][_0x50e3('0x120')]?moment()[_0x50e3('0x80')](_0x50e3('0x100')):undefined;_0x2d5e31[_0x50e3('0xfa')]+=0x1;_0x2d5e31[_0x50e3('0xf3')]+=0x1;if(_0x2d5e31[_0x50e3('0xfa')]>=this[_0x50e3('0x23')][_0x20d89a['queue']][_0x50e3('0x121')]){this[_0x50e3('0x122')](_0x2d5e31);}else{this[_0x50e3('0xc6')]({'active':![],'countdropretry':_0x2d5e31[_0x50e3('0xfa')],'scheduledat':moment()[_0x50e3('0xfe')](this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x123')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x20bb45[_0x50e3('0xd9')],'ListId':_0x20bb45[_0x50e3('0xda')],'VoiceQueueId':_0x20bb45[_0x50e3('0x101')]||undefined,'CampaignId':_0x20bb45[_0x50e3('0xdb')]||undefined})['catch'](loggerCatch(_0x50e3('0x124')));var _0x73328a=new History(_0x2d5e31);_0x73328a[_0x50e3('0xad')]=0xa;_0x73328a['statedesc']=_0x50e3('0x11d');_0x73328a['starttime']=moment()[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss');_0x73328a['endtime']=_0x73328a[_0x50e3('0xb0')];_0x73328a[_0x50e3('0x125')]=_0x2d5e31[_0x50e3('0x125')];_0x73328a['calleridnum']=_0x2d5e31['calleridnum'];this[_0x50e3('0xd3')](_0x73328a)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x126')));}}else{this['voiceQueues'][_0x20d89a['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]]['outboundDropCallsDayCallersExit']+=0x1;_0x2d5e31[_0x50e3('0xad')]=0xb;_0x2d5e31[_0x50e3('0xae')]='Abandoned';_0x2d5e31[_0x50e3('0x11e')]=_0x50e3('0x127');_0x2d5e31[_0x50e3('0x105')]+=0x1;_0x2d5e31[_0x50e3('0xf3')]+=0x1;if(_0x2d5e31[_0x50e3('0x105')]>=this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x128')]){this['queueCallerAbandonCreateState'](_0x2d5e31);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x2d5e31['countabandonedretry'],'scheduledat':moment()['add'](this[_0x50e3('0x23')][_0x20d89a[_0x50e3('0xbb')]][_0x50e3('0x129')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x20bb45['ContactId'],'ListId':_0x20bb45[_0x50e3('0xda')],'VoiceQueueId':_0x20bb45[_0x50e3('0x101')]||undefined,'CampaignId':_0x20bb45['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x12a')));var _0x73328a=new History(_0x2d5e31);_0x73328a[_0x50e3('0xad')]=0xb;_0x73328a[_0x50e3('0xae')]=_0x50e3('0x12b');_0x73328a[_0x50e3('0xb0')]=moment()[_0x50e3('0x80')](_0x50e3('0x100'));_0x73328a[_0x50e3('0xaf')]=_0x73328a[_0x50e3('0xb0')];_0x73328a['calleridname']=_0x2d5e31[_0x50e3('0x125')];_0x73328a['calleridnum']=_0x2d5e31['calleridnum'];this[_0x50e3('0xd3')](_0x73328a)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x12c')));}}}}};Dialer[_0x50e3('0x1d')][_0x50e3('0x12d')]=function(_0x3513f7){if(this[_0x50e3('0xb3')][_0x3513f7[_0x50e3('0xe3')]]){this[_0x50e3('0xb3')][_0x3513f7['uniqueid']]['channel']=_0x3513f7[_0x50e3('0x12e')];}if(this['uniqueId'][_0x3513f7[_0x50e3('0xe3')]]){this[_0x50e3('0x29')][_0x3513f7[_0x50e3('0xe3')]][_0x50e3('0x12e')]=_0x3513f7[_0x50e3('0x12e')];}};Dialer[_0x50e3('0x1d')][_0x50e3('0x12f')]=function(_0x414bf4){if(strategy[this[_0x50e3('0x23')][this['actions'][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0xbb')]]['strategy']]===_0x50e3('0x131')){if(this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]]&&_[_0x50e3('0xb5')](this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0x132')])&&_0x414bf4[_0x50e3('0xb7')]==='1'&&_0x414bf4['paused']==='0'){if(this[_0x50e3('0x25')][_0x414bf4[_0x50e3('0x133')]]){if(!this[_0x50e3('0x25')][_0x414bf4['stateinterface']]['locked']){this[_0x50e3('0x25')][_0x414bf4[_0x50e3('0x133')]][_0x50e3('0x132')]=!![];this[_0x50e3('0xb3')][_0x414bf4['actionid']][_0x50e3('0x132')]=!![];this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0x133')]=_0x414bf4['stateinterface'];}}}}else if((strategy[this[_0x50e3('0x23')][this[_0x50e3('0xb3')][_0x414bf4['actionid']][_0x50e3('0xbb')]][_0x50e3('0x51')]]||_0x50e3('0x1c'))==='rrmemory'){if(this['actions'][_0x414bf4[_0x50e3('0x130')]]){if(this[_0x50e3('0x25')][_0x414bf4[_0x50e3('0x133')]]){this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]]['stateinterface']=_0x414bf4['stateinterface'];if(_['isNil'](this[_0x50e3('0x2d')][this['actions'][_0x414bf4['actionid']]['queue']])){this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0xbb')]]=[];}this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x134')](_['merge'](_['pick'](this[_0x50e3('0xb3')][_0x414bf4[_0x50e3('0x130')]],[_0x50e3('0x135'),_0x50e3('0x133')]),{'status':_0x414bf4['status'],'paused':_0x414bf4[_0x50e3('0x136')]}));}}}};function unlockQueueStatus(_0x38d4fe,_0x2f2da5){setTimeout(function(){if(_['isUndefined'](_0x38d4fe[_0x50e3('0x137')])){loggerBooked[_0x50e3('0xa0')](_0x50e3('0x138'),_0x2f2da5);}_0x38d4fe['queueStatusComplete']=!![];loggerBooked[_0x50e3('0x83')](_0x50e3('0x139'),_0x2f2da5,JSON['stringify'](_[_0x50e3('0xd8')](_0x38d4fe,[_0x50e3('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x50e3('0x1d')][_0x50e3('0x3e')]=function(_0x46fc51){var _0x5527e1=this;var _0x29be24=_0x5527e1[_0x50e3('0x23')][_0x5527e1['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]];if(strategy[this[_0x50e3('0x23')][this['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x51')]]==='roundrobin'){if(this[_0x50e3('0xb3')][_0x46fc51['actionid']]&&this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0x133')]){this[_0x50e3('0x22')][_0x50e3('0x13a')](this['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0x135')],this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0x133')])[_0x50e3('0xb8')](function(_0xbf506d){logger[_0x50e3('0xa0')](_0x50e3('0x13b'),util[_0x50e3('0x9d')](_0xbf506d,{'showHidden':![],'depth':null}));})[_0x50e3('0x20')](function(){_0x5527e1['updateOriginated'](_0x5527e1[_0x50e3('0x23')][_0x5527e1[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]);_0x5527e1[_0x50e3('0x25')][_0x5527e1[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]['stateinterface']]['locked']=![];delete _0x5527e1['actions'][_0x46fc51['actionid']];unlockQueueStatus(_0x29be24);});}else{this[_0x50e3('0xba')](this['voiceQueues'][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]['queue']]);this[_0x50e3('0xc6')]({'active':![],'ContactId':this[_0x50e3('0xb3')][_0x46fc51['actionid']]['ContactId'],'ListId':this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xda')],'VoiceQueueId':this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0x101')]||undefined,'CampaignId':this['actions'][_0x46fc51[_0x50e3('0x130')]]['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x13c')));delete this[_0x50e3('0xb3')][_0x46fc51['actionid']];unlockQueueStatus(_0x29be24);}}else if((strategy[this['voiceQueues'][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x51')]]||_0x50e3('0x1c'))===_0x50e3('0x1c')){var _0x3d97a2;if(this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]]&&!_[_0x50e3('0x4a')](this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]])){if(this[_0x50e3('0x2e')][_0x5527e1['actions'][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]){this['queueBookedRR'][_0x5527e1[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]=this[_0x50e3('0x2e')][this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]?this[_0x50e3('0x2e')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]]:this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51['actionid']][_0x50e3('0xbb')]]?this[_0x50e3('0x2d')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x13d')]||0x0:0x0;}this['queueBooked'][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]][_0x50e3('0x13d')]=this[_0x50e3('0x2e')][this[_0x50e3('0xb3')][_0x46fc51[_0x50e3('0x130')]][_0x50e3('0xbb')]];for(var _0x1b34c6=0x0;_0x1b34c6=0x0;})['catch'](myreject(_0xfde8bd)));}}else{_0x1cc9dc[_0x50e3('0x134')](ami[_0x50e3('0xb6')]({'action':_0x50e3('0x153'),'command':util['format'](_0x50e3('0x154'),_0x3871fc,!_[_0x50e3('0x41')](config[_0x50e3('0x150')][_0x3f7aee])?_0x3f7aee:'')})[_0x50e3('0xbe')](function(_0x4ebcbf){return _0x4ebcbf[_0x50e3('0x156')]['indexOf']('true')>=0x0;})[_0x50e3('0xb8')](myreject(_0xfde8bd)));}BPromise[_0x50e3('0x157')](_0x1cc9dc)[_0x50e3('0xbe')](function(_0x46665c){var _0x4e91cb=_['some'](_0x46665c);if(_0x4e91cb){return _0x212ae2(_0x4e91cb);}else{_0x40677b[_0x50e3('0x42')]=_0x164011?'GLOBAL_INTERVAL_IS_OVERTIME':_0x50e3('0x158');return _0xfde8bd(msgResponse(_0x50e3('0x159'),'Failure',_0x50e3('0x15a')+_0x164011+'\x20'+_0x251d75+_0x50e3('0x15b')+util['inspect'](_0x3871fc,{'showHidden':![],'depth':null})+_0x50e3('0x15c')+_0x3f7aee));}})[_0x50e3('0xb8')](function(_0xd98a0f){return _0xfde8bd(msgResponse(_0x50e3('0x14c'),_0x50e3('0x14d'),JSON['stringify'](_0xd98a0f)));});});};Dialer[_0x50e3('0x1d')]['checkDialMethod']=function(_0x26d43a){var _0x378955=this;return function(){switch(_0x26d43a[_0x50e3('0x5c')]){case _0x50e3('0x15d'):freeVariablesPredictive(_0x26d43a);_0x378955[_0x50e3('0x15e')](_0x26d43a,0x1);break;case'power':freeVariablesPredictive(_0x26d43a);_0x378955[_0x50e3('0x15e')](_0x26d43a,_0x26d43a[_0x50e3('0x15f')]);break;case _0x50e3('0x160'):_0x378955[_0x50e3('0x160')](_0x26d43a);break;case _0x50e3('0xa'):freeVariablesPredictive(_0x26d43a);_0x378955[_0x50e3('0x15e')](_0x26d43a,0x1);break;default:freeVariablesPredictive(_0x26d43a);logger[_0x50e3('0xa0')](_0x50e3('0x161'),_0x26d43a[_0x50e3('0x44')],_0x50e3('0x162'));}};};Dialer[_0x50e3('0x1d')][_0x50e3('0x163')]=function(_0x5e5428){var _0x13fc4b=this;return function(){_0x13fc4b[_0x50e3('0x164')](_0x5e5428);};};Dialer[_0x50e3('0x1d')][_0x50e3('0x165')]=function(_0xe4e551){var _0xf171f3=this;if(isNotPreview(_0xe4e551['dialMethod'])){if(isVoiceQueueOutbound(_0xe4e551[_0x50e3('0x57')])&&isActive(_0xe4e551[_0x50e3('0x5b')])){_0xe4e551[_0x50e3('0xa6')]=!![];BPromise['resolve']()[_0x50e3('0xbe')](checkIsLoggedIn(_0xe4e551,_0xe4e551['loggedIn']))[_0x50e3('0xbe')](checkIsActive(_0xe4e551,_0xe4e551[_0x50e3('0x5b')]))['then'](checkInterval(_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x166')](_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x14b')](_0xe4e551[_0x50e3('0x167')],_0xe4e551[_0x50e3('0x168')],_0xe4e551['name'],_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x169')](_0xe4e551[_0x50e3('0x46')],_0xe4e551[_0x50e3('0x168')],_0xe4e551[_0x50e3('0x44')],_0xe4e551))[_0x50e3('0xbe')](_0xf171f3[_0x50e3('0x16a')](_0xe4e551))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0xe4e551));}else{notSendMessagesQueue(_0xe4e551);}}else{freeVariablesPredictive(_0xe4e551);}};Dialer[_0x50e3('0x1d')]['syncCampaigns']=function(){var _0x4d40f9=this;var _0x4d38f4;for(var _0x7daae in this['campaigns']){if(typeof this[_0x50e3('0x24')][_0x7daae]!=='undefined'){_0x4d38f4=this[_0x50e3('0x24')][_0x7daae];if(isCampaignIvr(_0x4d38f4[_0x50e3('0x57')])&&isActive(_0x4d38f4[_0x50e3('0x7b')])){_0x4d38f4['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x50e3('0xbe')](checkIsActive(_0x4d38f4,_0x4d38f4[_0x50e3('0x7b')]))['then'](checkInterval(_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9[_0x50e3('0x166')](_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9[_0x50e3('0x14b')](_0x4d38f4[_0x50e3('0x167')],_0x4d38f4['dialTimezone'],_0x4d38f4[_0x50e3('0x44')],_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9['checkIfTimeIntervals'](_0x4d38f4['Interval'],_0x4d38f4['dialTimezone'],_0x4d38f4[_0x50e3('0x44')],_0x4d38f4))[_0x50e3('0xbe')](_0x4d40f9[_0x50e3('0x163')](_0x4d38f4))[_0x50e3('0xb8')](loggerCatchQueueSummary(_0x50e3('0x16b'),_0x4d38f4));}else{notSendMessagesCampaign(_0x4d38f4);}}}};function getCallerIdRandom(_0x3c4d92,_0x102d35){var _0x491fa1;var _0x1e0f23;var _0x55f11c;if(_0x102d35<=0x0){_0x102d35=0x1;}_0x491fa1=new RegExp('\x5cw{0,'+_0x102d35+'}$');_0x1e0f23=Math['pow'](0xa,_0x102d35-0x1);_0x55f11c=Math[_0x50e3('0x16c')](0xa,_0x102d35)-0x1;return util[_0x50e3('0x80')]('%s',_[_0x50e3('0x16d')](_0x3c4d92,_0x491fa1,_[_0x50e3('0x16e')](_0x1e0f23,_0x55f11c)));}function extractCalleridName(_0x41a2c5){var _0x1b1632=_0x41a2c5[_0x50e3('0x16f')](/"(.*?)"/);return _0x1b1632?_0x1b1632[0x1]:_0x41a2c5;}function extractCalleridNumber(_0x233798){var _0x5a2c66=_0x233798[_0x50e3('0x16f')](/<(.*?)>/);return _0x5a2c66?_0x5a2c66[0x1]:_0x233798;}Dialer[_0x50e3('0x1d')][_0x50e3('0x170')]=function(_0x466574,_0xb901fb){var _0x1ae683=this;var _0x22aee8=uuid['v4']();this[_0x50e3('0xb3')][_0x22aee8]=new Action(_0x466574,_0xb901fb,_0x22aee8);return new BPromise(function(_0x575536,_0x91e9){if(_[_0x50e3('0x41')](_0x466574)&&typeof _0x466574!==_0x50e3('0x171')){return _0x91e9(msgResponse(_0x50e3('0x172'),_0x50e3('0x14d'),_0x50e3('0x173')));}if(_[_0x50e3('0x41')](_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')])||_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')]===null){return _0x91e9(msgResponse(_0x50e3('0x172'),'Failure','contact\x20is\x20undefine'));}var _0x5545b5={'XMD-CALLERID':_0x1ae683[_0x50e3('0xb3')][_0x22aee8][_0x50e3('0x176')](),'XMD-AGI':_0x466574[_0x50e3('0x10e')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x466574['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x466574['dialQueueProject2']?util[_0x50e3('0x80')](_0x50e3('0x177'),ipAgi,_0x466574['dialQueueProject2']):_0x50e3('0x178'),'XMD-QUEUE':_0x466574[_0x50e3('0x57')]==='outbound'?util['format'](_0x50e3('0x179'),_0x466574[_0x50e3('0x44')],_0x466574[_0x50e3('0x17a')]||'',_0x466574[_0x50e3('0x116')]?'c':'',_0x466574[_0x50e3('0x11c')]||0x3):_0x50e3('0x178'),'XMD-CONTACTID':_0xb901fb['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1ae683[_0x50e3('0xb3')][_0x22aee8][_0x50e3('0x176')](),'XMD-AMD':_0x466574['dialAMDActive']?_0x50e3('0x17b'):_0x50e3('0x178'),'XMD-DESTINATION':_0x50e3('0x17c')};if(_0x466574[_0x50e3('0xe7')]){_0x5545b5[_0x50e3('0x17d')]=_0x466574[_0x50e3('0x17e')]||0x9c4;_0x5545b5[_0x50e3('0x17f')]=_0x466574[_0x50e3('0x180')]||0x5dc;_0x5545b5['XMD-AMDAFTERGREETINGSILENCE']=_0x466574[_0x50e3('0x181')]||0x320;_0x5545b5['XMD-AMDTOTALANALYSISTIME']=_0x466574[_0x50e3('0x182')]||0x1388;_0x5545b5[_0x50e3('0x183')]=_0x466574[_0x50e3('0x184')]||0x64;_0x5545b5[_0x50e3('0x185')]=_0x466574[_0x50e3('0x186')]||0x32;_0x5545b5[_0x50e3('0x187')]=_0x466574[_0x50e3('0x188')]||0x3;_0x5545b5['XMD-AMDSILENCETHRESHOLD']=_0x466574[_0x50e3('0x189')]||0x100;_0x5545b5[_0x50e3('0x18a')]=_0x466574[_0x50e3('0x18b')]||0x1388;}if(_0x466574[_0x50e3('0x57')]==='outbound'){_0x5545b5[_0x50e3('0x18c')]=_0xb901fb['VoiceQueueId'];}else{_0x5545b5[_0x50e3('0x18d')]=_0xb901fb['CampaignId'];}for(var _0x265df1 in _0xb901fb[_0x50e3('0x174')]){if(typeof _0xb901fb[_0x50e3('0x174')][_0x265df1]!=='undefined'){if(isNotNull(_0xb901fb['Contact'][_0x265df1])&&_0x265df1!=='id'&&_0x265df1!==_0x50e3('0x18e')&&_0x265df1!==_0x50e3('0x18f')&&_0x265df1!==_0x50e3('0x190')){_0x5545b5[util[_0x50e3('0x80')](_0x50e3('0x191'),_0x50e3('0x192'),_[_0x50e3('0x193')](_0x265df1))]=_0xb901fb[_0x50e3('0x174')][_0x265df1];}}}var _0x2a1675=_0x1ae683[_0x50e3('0xdf')](_0x466574['Trunk'])?getCallerId(_0x466574['Trunk'][_0x50e3('0x7c')],_0x466574[_0x50e3('0x194')],_0x466574[_0x50e3('0x195')]>0x0?getCallerIdRandom(_0x466574[_0x50e3('0x196')],_0x466574[_0x50e3('0x195')]):_0x466574[_0x50e3('0x196')]):getCallerId(_['isNil'](_0x466574['TrunkBackup'])?_0x466574['Trunk']['callerid']:_0x466574[_0x50e3('0x197')][_0x50e3('0x7c')],_0x466574['dialOriginateCallerIdName'],_0x466574['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x466574[_0x50e3('0x196')],_0x466574['dialRandomLastDigitCallerIdNumber']):_0x466574[_0x50e3('0x196')]);if(_0x2a1675){_0x5545b5[_0x50e3('0x198')]=_0x1ae683['actions'][_0x22aee8][_0x50e3('0x199')]=extractCalleridName(_0x2a1675);_0x5545b5['XMD-ORIGINATECALLERIDNUM']=_0x1ae683[_0x50e3('0xb3')][_0x22aee8][_0x50e3('0x19a')]=extractCalleridNumber(_0x2a1675);}return ami[_0x50e3('0xb6')]({'actionid':_0x22aee8,'action':_0x50e3('0x172'),'channel':_0x1ae683[_0x50e3('0xdf')](_0x466574['Trunk'])?util[_0x50e3('0x80')](_0x50e3('0x19b'),_0x466574['Trunk'][_0x50e3('0x44')],isNotNull(_0x466574[_0x50e3('0x5e')])?_0x466574['dialPrefix'][_0x50e3('0x19c')]()||'':'',_0x466574[_0x50e3('0x19d')]>0x0?_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')][_0x50e3('0x19e')](_0x466574[_0x50e3('0x19d')]):_0xb901fb['Contact']['phone']):util[_0x50e3('0x80')](_0x50e3('0x19b'),_[_0x50e3('0xb5')](_0x466574[_0x50e3('0x197')])?_0x466574['Trunk'][_0x50e3('0x44')]:_0x466574[_0x50e3('0x197')]['name'],isNotNull(_0x466574[_0x50e3('0x5e')])?_0x466574[_0x50e3('0x5e')]['trim']()||'':'',_0x466574['dialCutDigit']>0x0?_0xb901fb[_0x50e3('0x174')]['phone'][_0x50e3('0x19e')](_0x466574[_0x50e3('0x19d')]):_0xb901fb[_0x50e3('0x174')][_0x50e3('0x175')]),'callerid':_0x2a1675,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x5545b5,'timeout':(_0x466574[_0x50e3('0x5d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x22aee8})[_0x50e3('0xbe')](function(_0x3706fa){return _0x575536(_0x3706fa);})['catch'](function(_0x34b2c1){_0x466574[_0x50e3('0x67')]+=0x1;var _0x3bf266=new History(_0x1ae683[_0x50e3('0xb3')][_0x22aee8]);logger['error'](util[_0x50e3('0x80')]('[originateError]:\x20%s',JSON[_0x50e3('0x7d')](_0x34b2c1)));_0x3bf266[_0x50e3('0xad')]=0xe;_0x3bf266[_0x50e3('0xae')]=_0x50e3('0x19f');_0x3bf266[_0x50e3('0xb0')]=moment()['format'](_0x50e3('0x100'));_0x3bf266[_0x50e3('0xaf')]=_0x3bf266[_0x50e3('0xb0')];_0x1ae683[_0x50e3('0xd3')](_0x3bf266)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1a0')));_0x1ae683[_0x50e3('0xd1')](_0x3bf266)[_0x50e3('0xb8')](loggerCatch('[originate][error]'))[_0x50e3('0x20')](function(){delete _0x1ae683[_0x50e3('0xb3')][_0x22aee8];return _0x91e9(msgResponse('originate',_0x50e3('0x1a1'),_0x50e3('0x1a2')));});});});};Dialer[_0x50e3('0x1d')]['syncOriginateResponse']=function(_0x26c10d){var _0x47742f=this[_0x50e3('0xb3')][_0x26c10d['actionid']];if(_0x47742f){delete this[_0x50e3('0xb3')][_0x26c10d[_0x50e3('0x130')]];_0x47742f[_0x50e3('0x11b')]=moment()['format'](_0x50e3('0x100'));var _0x5901dc=_0x47742f[_0x50e3('0x57')]===_0x50e3('0x7f')?this[_0x50e3('0x24')][_0x47742f['queue']]:this['voiceQueues'][_0x47742f[_0x50e3('0x1a3')]()];if(!this[_0x50e3('0xdd')](_0x26c10d[_0x50e3('0x1a4')])){this[_0x50e3('0xba')](_0x5901dc);return this['callProgressDetecting'](_0x47742f,_0x5901dc,_0x26c10d)[_0x50e3('0xb8')](loggerCatch('[callProgressDetecting]\x20'));}this['uniqueId'][_0x26c10d[_0x50e3('0xe3')]]=_0x47742f;}};Dialer[_0x50e3('0x1d')]['checkRetriveMax']=function(_0x376dab,_0x84c02d,_0x4ec1c6){var _0x44afe4=new History(_0x84c02d);if(_0x44afe4[_0x50e3('0xf6')]+_0x44afe4['countcongestionretry']+_0x44afe4[_0x50e3('0xf8')]+_0x44afe4[_0x50e3('0xf9')]+_0x44afe4[_0x50e3('0xfa')]+_0x44afe4[_0x50e3('0x105')]+_0x44afe4[_0x50e3('0xf2')]+_0x44afe4[_0x50e3('0x106')]>=_0x4ec1c6[_0x50e3('0xfb')]-0x1){return!![];}switch(_0x376dab){case 0x3:if(_0x44afe4[_0x50e3('0xf8')]>=_0x4ec1c6[_0x50e3('0x1a5')]-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countnoanswerretry':_0x44afe4[_0x50e3('0xf8')]+=0x1,'scheduledat':moment()['add'](_0x4ec1c6[_0x50e3('0x1a6')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})['catch'](loggerCatch(_0x50e3('0x1a7')));break;case 0x5:if(_0x44afe4[_0x50e3('0xf6')]>=_0x4ec1c6[_0x50e3('0x1a8')]-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countbusyretry':_0x44afe4['countbusyretry']+=0x1,'scheduledat':moment()['add'](_0x4ec1c6['dialBusyRetryFrequency'],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4['VoiceQueueId']||undefined,'CampaignId':_0x44afe4['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x44afe4[_0x50e3('0xf7')]>=_0x4ec1c6['dialCongestionMaxRetry']-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countcongestionretry':_0x44afe4['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x4ec1c6['dialCongestionRetryFrequency'],_0x50e3('0x10a'))['format'](_0x50e3('0x100')),'ContactId':_0x44afe4['ContactId'],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1a9')));break;case 0x0:if(_0x44afe4['countnosuchnumberretry']>=_0x4ec1c6[_0x50e3('0x1aa')]-0x1){return!![];}else{this[_0x50e3('0xc6')]({'active':![],'countnosuchnumberretry':_0x44afe4[_0x50e3('0xf9')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6[_0x50e3('0x1ab')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x44afe4[_0x50e3('0xfa')]>=_0x4ec1c6[_0x50e3('0x121')]-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countdropretry':_0x44afe4[_0x50e3('0xfa')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6['dialDropRetryFrequency'],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x124')));break;case 0xb:if(_0x44afe4[_0x50e3('0x105')]>=_0x4ec1c6['dialAbandonedMaxRetry']-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countabandonedretry':_0x44afe4[_0x50e3('0x105')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6[_0x50e3('0x129')],_0x50e3('0x10a'))[_0x50e3('0x80')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x44afe4['ContactId'],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})['catch'](loggerCatch(_0x50e3('0x12a')));break;case 0x13:if(_0x44afe4['countmachineretry']>=_0x4ec1c6[_0x50e3('0x107')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x44afe4[_0x50e3('0xf2')]+=0x1,'scheduledat':moment()[_0x50e3('0xfe')](_0x4ec1c6['dialMachineRetryFrequency'],'minutes')[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4['CampaignId']||undefined})['catch'](loggerCatch(_0x50e3('0x102')));break;case 0x14:if(_0x44afe4['countagentrejectretry']>=_0x4ec1c6['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x50e3('0xc6')]({'active':![],'countagentrejectretry':_0x44afe4[_0x50e3('0x106')]+=0x1,'scheduledat':moment()['add'](_0x4ec1c6[_0x50e3('0x1ac')],_0x50e3('0x10a'))[_0x50e3('0x80')](_0x50e3('0x100')),'ContactId':_0x44afe4[_0x50e3('0xd9')],'ListId':_0x44afe4[_0x50e3('0xda')],'VoiceQueueId':_0x44afe4[_0x50e3('0x101')]||undefined,'CampaignId':_0x44afe4[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1ad')));break;default:return!![];}};Dialer[_0x50e3('0x1d')][_0x50e3('0x1ae')]=function(_0x30d4bc,_0x16a7f4,_0x284874){var _0x12eac6=this;var _0xcbc925=new History(_0x30d4bc);return new BPromise(function(_0x231121,_0x476824){if(_[_0x50e3('0x41')](_0x16a7f4)&&typeof _0x16a7f4!=='object'){return _0x476824(msgResponse(_0x50e3('0x1af'),'Failure',_0x50e3('0x1b0')));}if(_['isUndefined'](_0x284874)&&typeof _0x284874!==_0x50e3('0x171')){return _0x476824(msgResponse('[callProgressDetecting]',_0x50e3('0x14d'),_0x50e3('0x1b1')));}switch(_0x284874[_0x50e3('0x113')]){case'0':_0x16a7f4[_0x50e3('0x66')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x0;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x1b2');_0xcbc925['countnosuchnumberretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')]('custom:agentnosuchnumber',ut['buildObj'](_0x30d4bc,_0x50e3('0x1b3')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0xf5')));if(_0x12eac6[_0x50e3('0x1b4')](0x0,_0x30d4bc,_0x16a7f4)){if(_0xcbc925['countnosuchnumberretry']>=_0x16a7f4[_0x50e3('0x1aa')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b5'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b5'));}}break;case'3':_0x16a7f4[_0x50e3('0x65')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x3;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x1b6');_0xcbc925['countnoanswerretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')]('custom:agentnoanswer',ut['buildObj'](_0x30d4bc,_0x50e3('0x1b7')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)['catch'](loggerCatch(_0x50e3('0x1b8')));if(_0x12eac6[_0x50e3('0x1b4')](0x3,_0x30d4bc,_0x16a7f4)){if(_0xcbc925['countnoanswerretry']>=_0x16a7f4[_0x50e3('0x1a5')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b9'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1b9'));}}break;case'5':_0x16a7f4[_0x50e3('0x1ba')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x5;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x1bb');_0xcbc925[_0x50e3('0xf6')]+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')](_0x50e3('0x1bc'),ut['buildObj'](_0x30d4bc,_0x50e3('0x1bd')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1be')));if(_0x12eac6[_0x50e3('0x1b4')](0x5,_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0xf6')]>=_0x16a7f4[_0x50e3('0x1a8')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1bf'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1bf'));}}break;case'8':_0x16a7f4[_0x50e3('0x61')]+=0x1;_0xcbc925[_0x50e3('0xad')]=0x8;_0xcbc925['statedesc']=_0x50e3('0x1c0');_0xcbc925[_0x50e3('0xf7')]+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')]('custom:agentcongestion',ut['buildObj'](_0x30d4bc,_0x50e3('0x1c1')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x12eac6['checkRetriveMax'](0x8,_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0xf7')]>=_0x16a7f4[_0x50e3('0x1c2')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1c3'));}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,'reason\x208\x20congestion');}}break;case'11':_0x16a7f4['outboundAbandonedCallsDay']+=0x1;_0xcbc925[_0x50e3('0xad')]=0xb;_0xcbc925[_0x50e3('0xae')]=_0x50e3('0x12b');_0xcbc925['countabandonedretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;_0x12eac6['createHistory'](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x12c')));if(_0x12eac6['checkRetriveMax'](0xb,_0x30d4bc,_0x16a7f4)){if(_0xcbc925['countabandonedretry']>=_0x16a7f4[_0x50e3('0x128')]){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,'reason\x2011\x20abandoned');}else{_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,'reason\x2011\x20abandoned');}}break;case'20':_0x16a7f4['outboundRejectCallsDay']+=0x1;_0xcbc925[_0x50e3('0xad')]=0x14;_0xcbc925['statedesc']='AgentReject';_0xcbc925['countagentrejectretry']+=0x1;_0xcbc925[_0x50e3('0xf3')]+=0x1;ami[_0x50e3('0x4f')](_0x50e3('0x1c4'),ut['buildObj'](_0x30d4bc,_0x50e3('0x1c5')));_0x12eac6[_0x50e3('0xd3')](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1c6')));if(_0x12eac6[_0x50e3('0x1b4')](0x14,_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0x106')]>=_0x16a7f4['dialAgentRejectMaxRetry']){_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1c7'));}else{_0x12eac6['stateGlobal'](_0xcbc925,_0x231121,_0x476824,_0x50e3('0x1c7'));}}break;default:_0x16a7f4['outboundUnknownCallsDay']+=0x1;_0xcbc925[_0x50e3('0xad')]=0xc;_0xcbc925['statedesc']=_0x284874['reason'];_0x12eac6['createHistory'](_0xcbc925)[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1c8')));if(_0x12eac6['checkRetriveMax'](_0x284874[_0x50e3('0x113')],_0x30d4bc,_0x16a7f4)){if(_0xcbc925[_0x50e3('0xf6')]+_0xcbc925[_0x50e3('0xf7')]+_0xcbc925['countnoanswerretry']+_0xcbc925['countnosuchnumberretry']+_0xcbc925[_0x50e3('0xfa')]+_0xcbc925[_0x50e3('0x105')]+_0xcbc925[_0x50e3('0xf2')]+_0xcbc925['countagentrejectretry']>=_0x16a7f4['dialGlobalMaxRetry']){_0x12eac6[_0x50e3('0xfc')](_0xcbc925,_0x231121,_0x476824,_0x284874[_0x50e3('0x113')]);}else{_0x12eac6[_0x50e3('0x108')](_0xcbc925,_0x231121,_0x476824,_0x284874['reason']);}}}});};Dialer['prototype'][_0x50e3('0xfc')]=function(_0x3d8462,_0x51a774,_0x579c52,_0x248acd){var _0x594b57=new Final(_0x3d8462);_0x594b57['state']=0xf;_0x594b57[_0x50e3('0xae')]=_0x50e3('0x1c9');this[_0x50e3('0x108')](_0x594b57,_0x51a774,_0x579c52,_0x248acd);};Dialer['prototype']['createStateFinal']=function(_0x1ae804,_0x37d27d,_0x3e29a6,_0x4544f0){this[_0x50e3('0xd1')](_0x1ae804)[_0x50e3('0xbe')](function(){return _0x37d27d(msgResponse(_0x50e3('0x1af'),_0x50e3('0xde'),_0x4544f0));})[_0x50e3('0xb8')](function(){return _0x3e29a6(msgResponse(_0x50e3('0x1ca'),_0x50e3('0x14d'),_0x50e3('0x1cb')));});};Dialer['prototype'][_0x50e3('0x160')]=function(_0x571ed9){var _0x5622ba=_0x571ed9[_0x50e3('0x1cc')]/0x64;var _0x44e5d8=_0x571ed9[_0x50e3('0x64')]/(_0x571ed9['outboundDropCallsDayTimeout']+_0x571ed9[_0x50e3('0x60')]);var _0x15684d=Math[_0x50e3('0x1cd')](_0x571ed9['predictiveIntervalAvailable']*(_0x571ed9[_0x50e3('0x1ce')]/0x64));var _0x4765aa=Math[_0x50e3('0x1cd')](_0x571ed9['predictiveIntervalAvailable']*(_0x571ed9[_0x50e3('0x1cf')]/0x64));var _0x5e9735=_0x571ed9[_0x50e3('0x53')]+_0x571ed9[_0x50e3('0x1d0')];var _0x15b643=Math[_0x50e3('0x1d1')](_0x571ed9[_0x50e3('0x76')]*_0x571ed9[_0x50e3('0x77')]*_0x571ed9[_0x50e3('0x71')]*_0x571ed9[_0x50e3('0x1d2')]);if(_['isUndefined'](_0x571ed9[_0x50e3('0x2b')])){if(!_['isUndefined'](_0x571ed9[_0x50e3('0x79')])){_0x571ed9[_0x50e3('0x79')]=undefined;loggerPredictive[_0x50e3('0xa0')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x50e3('0x41')](_0x571ed9['handlePredictive'])){loggerPredictive[_0x50e3('0xa0')](_0x50e3('0x1d3'),_0x50e3('0x1d4'));clearInterval(_0x571ed9['handlePredictive']);_0x571ed9[_0x50e3('0x98')]=undefined;}_0x571ed9['startProgressive']=moment()[_0x50e3('0x80')](_0x50e3('0x100'));loggerPredictive['info'](_0x571ed9[_0x50e3('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x571ed9[_0x50e3('0x2b')]);this['handlePower'](_0x571ed9,0x1);}else if(ifInterval(_0x571ed9[_0x50e3('0x1d5')],_0x571ed9[_0x50e3('0x2b')])){this[_0x50e3('0x15e')](_0x571ed9,0x1);loggerPredictiveCalls[_0x50e3('0x83')](_0x50e3('0x1d6'),_0x571ed9[_0x50e3('0x2b')],_0x571ed9['name']);_0x571ed9['erlangCalls']=0x0;_0x571ed9[_0x50e3('0x70')]=0x0;}else if(_0x5622ba<_0x44e5d8&&_0x571ed9[_0x50e3('0x1d7')]==='dropRate'){freeVariablesPredictive(_0x571ed9);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x1d8'),_0x50e3('0x1d9'),_0x44e5d8,_0x50e3('0x2b'),_0x571ed9[_0x50e3('0x44')]);}else if(_0x15b643<_0x571ed9[_0x50e3('0x70')]&&_0x571ed9['dialPredictiveOptimization']===_0x50e3('0x1da')){freeVariablesPredictive(_0x571ed9);loggerPredictive['info'](_0x50e3('0x1db'),_0x50e3('0x1dc'),_0x15b643,_0x50e3('0x1dd'),_0x571ed9[_0x50e3('0x70')],_0x50e3('0x2b'),_0x571ed9[_0x50e3('0x44')]);}else if(!ifInterval(_0x571ed9['dialPredictiveInterval'],_0x571ed9['startProgressive'])&&_[_0x50e3('0x41')](_0x571ed9[_0x50e3('0x79')])&&!_[_0x50e3('0x41')](_0x571ed9[_0x50e3('0x2b')])){_0x571ed9['startPredictive']=moment()[_0x50e3('0x80')](_0x50e3('0x100'));loggerPredictive[_0x50e3('0x83')](_0x571ed9[_0x50e3('0x44')],_0x50e3('0x1de'),_0x571ed9[_0x50e3('0x79')]);this[_0x50e3('0x1df')](_0x571ed9[_0x50e3('0x1d5')])['then'](this[_0x50e3('0x1e0')](_0x571ed9))[_0x50e3('0xbe')](mergeDataErlangB(_0x571ed9))[_0x50e3('0xbe')](this[_0x50e3('0x1e1')](_0x571ed9))[_0x50e3('0xb8')](loggerCatchPredictive(_0x50e3('0x1e2'),_0x571ed9));}else if(!ifInterval(_0x571ed9[_0x50e3('0x1d5')],_0x571ed9[_0x50e3('0x79')])){_0x571ed9['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x571ed9[_0x50e3('0x79')]=moment()['format'](_0x50e3('0x100'));loggerPredictive[_0x50e3('0x83')](_0x571ed9[_0x50e3('0x44')],_0x50e3('0x1e3'),_0x571ed9[_0x50e3('0x79')]);clearInterval(_0x571ed9[_0x50e3('0x98')]);_0x571ed9['handlePredictive']=undefined;this['averageHandleTime'](_0x571ed9[_0x50e3('0x1d5')])[_0x50e3('0xbe')](this[_0x50e3('0x1e0')](_0x571ed9))[_0x50e3('0xbe')](mergeDataErlangB(_0x571ed9))[_0x50e3('0xbe')](this[_0x50e3('0x1e1')](_0x571ed9))[_0x50e3('0xb8')](loggerCatchPredictive(_0x50e3('0x1e4'),_0x571ed9));}else if(_0x571ed9['predictiveIntervalAvailable']&&_0x5e9735<_0x571ed9['predictiveIntervalAvailable']-_0x4765aa){freeVariablesPredictive(_0x571ed9);loggerPredictive[_0x50e3('0x83')](_0x571ed9['name'],_0x50e3('0x1e5'),_0x5e9735,_0x50e3('0x1e6'),_0x571ed9[_0x50e3('0x73')],'-',_0x4765aa,'=',_0x571ed9[_0x50e3('0x73')]-_0x4765aa,')');}else if(_0x571ed9[_0x50e3('0x73')]&&_0x5e9735>_0x571ed9[_0x50e3('0x73')]+_0x15684d){freeVariablesPredictive(_0x571ed9);loggerPredictive[_0x50e3('0x83')](_0x571ed9[_0x50e3('0x44')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x5e9735,_0x50e3('0x1e7'),_0x571ed9[_0x50e3('0x73')],'+',_0x15684d,'=',_0x571ed9[_0x50e3('0x73')]+_0x15684d,')');}};Dialer[_0x50e3('0x1d')][_0x50e3('0x1e0')]=function(_0x43da4e){var _0x26921c=this;return function(_0xe56fb0){return new BPromise(function(_0x4605e1,_0x34aed8){_[_0x50e3('0x95')](_0x43da4e,_0xe56fb0[0x0]);if(checkGetDataPredictive(_0xe56fb0[0x0])){var _0x34ca49=_0x43da4e['predictiveIntervalAvailable']=_0x43da4e['talking']+_0x43da4e[_0x50e3('0x53')];var _0x3e01c7=_0x43da4e[_0x50e3('0x1d5')]*0x3c;var _0x69cf9a=_0xe56fb0[0x0]['predictiveIntervalAvgTalktime']+_0xe56fb0[0x0][_0x50e3('0x6c')];var _0x388756=(_0xe56fb0[0x0][_0x50e3('0x6b')]+_0xe56fb0[0x0][_0x50e3('0x6e')]+_0xe56fb0[0x0][_0x50e3('0x88')])/_0xe56fb0[0x0][_0x50e3('0x74')];_0x43da4e[_0x50e3('0x71')]=_0x388756>0x0?_0x388756:0x1;switch(_0x43da4e[_0x50e3('0x1d7')]){case _0x50e3('0x1da'):var _0xb018f3=_0x43da4e[_0x50e3('0x1cc')]/0x64;return _0x26921c[_0x50e3('0x1e8')](_0x34ca49,_0x3e01c7,_0x69cf9a,_0x388756,_0xb018f3)[_0x50e3('0xbe')](function(_0x532801){return _0x4605e1(_0x532801);});case'agentBusyFactor':var _0x2da902=_0x43da4e['dialPredictiveOptimizationPercentage']/0x64;return _0x26921c[_0x50e3('0x1e9')](_0x34ca49,_0x3e01c7,_0x69cf9a,_0x388756,_0x2da902)[_0x50e3('0xbe')](function(_0x1f1517){return _0x4605e1(_0x1f1517);});default:return _0x34aed8(msgResponse('[getDataPredictive]','Failure',_0x50e3('0x1ea')));}}else{return _0x34aed8(msgResponse(_0x50e3('0x1eb'),'Failure',_0x50e3('0x1ec')));}});};};Dialer[_0x50e3('0x1d')][_0x50e3('0x1ed')]=function(_0x96f112){var _0x3af048=this;return function(_0x4b81d1){return new BPromise(function(_0x1d4899,_0x50c182){_[_0x50e3('0x95')](_0x96f112,_0x4b81d1[0x0]);if(checkGetDataPredictive(_0x4b81d1[0x0])){loggerPredictive['info'](JSON['stringify'](_0x4b81d1[0x0]));if(_0x96f112['dialPredictiveOptimization']==='dropRate'){return _0x3af048['getVoiceQueueRtPauses'](_0x96f112['id'])['then'](function(_0xda6781){var _0x1d357e=_0x96f112['loggedIn']-_0xda6781[0x0][_0x50e3('0x1ee')];var _0x3ec7a8=_0x96f112[_0x50e3('0x1d5')]*0x3c;var _0x242fe8=_0x4b81d1[0x0][_0x50e3('0x6d')]+_0x4b81d1[0x0][_0x50e3('0x6c')];var _0x5513dd=(_0x4b81d1[0x0][_0x50e3('0x6b')]+_0x4b81d1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4b81d1[0x0][_0x50e3('0x88')])/_0x4b81d1[0x0]['predictiveIntervalTotalCalls'];var _0x259ce8=_0x96f112[_0x50e3('0x1cc')]/0x64;_0x96f112[_0x50e3('0x72')]=_0xda6781[0x0][_0x50e3('0x1ee')]||0x0;_0x96f112['predictiveIntervalHitRate']=_0x5513dd>0x0?_0x5513dd:0x1;return _0x3af048[_0x50e3('0x1e8')](_0x1d357e,_0x3ec7a8,_0x242fe8,_0x5513dd,_0x259ce8);})[_0x50e3('0xbe')](function(_0x2a1c99){return _0x1d4899(_0x2a1c99);})[_0x50e3('0xb8')](function(_0x17d610){return _0x50c182(msgResponse(_0x50e3('0x1ef'),_0x50e3('0x14d'),JSON[_0x50e3('0x7d')](_0x17d610)));});}if(_0x96f112[_0x50e3('0x1d7')]===_0x50e3('0x1f0')){return _0x3af048[_0x50e3('0xcf')](_0x96f112['id'])[_0x50e3('0xbe')](function(_0xb4eeab){var _0x20f0c8=_0x96f112[_0x50e3('0x54')]-_0xb4eeab[0x0][_0x50e3('0x1ee')];var _0x254283=_0x96f112[_0x50e3('0x1d5')]*0x3c;var _0x5cb8de=_0x4b81d1[0x0][_0x50e3('0x6d')]+_0x4b81d1[0x0][_0x50e3('0x6c')];var _0x3a46e1=(_0x4b81d1[0x0]['predictiveIntervalAnsweredCalls']+_0x4b81d1[0x0][_0x50e3('0x6e')]+_0x4b81d1[0x0][_0x50e3('0x88')])/_0x4b81d1[0x0][_0x50e3('0x74')];var _0x1f0832=_0x96f112[_0x50e3('0x1cc')]/0x64;_0x96f112[_0x50e3('0x72')]=_0xb4eeab[0x0][_0x50e3('0x1ee')]||0x0;_0x96f112[_0x50e3('0x71')]=_0x3a46e1>0x0?_0x3a46e1:0x1;return _0x3af048[_0x50e3('0x1e9')](_0x20f0c8,_0x254283,_0x5cb8de,_0x3a46e1,_0x1f0832);})[_0x50e3('0xbe')](function(_0x36a64e){return _0x1d4899(_0x36a64e);})['catch'](function(_0x1fd007){return _0x50c182(msgResponse(_0x50e3('0x1ef'),'Failure',JSON[_0x50e3('0x7d')](_0x1fd007)));});}}else{return _0x50c182(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x50e3('0x1d')]['startMethodPredictive']=function(_0x117f4e){var _0x4d5500=this;return function(){var _0x3ed423=0x0;var _0x39dca4=Math[_0x50e3('0x1d1')](_0x117f4e[_0x50e3('0x91')]*0x3e8);if(_0x39dca4>0x0){_0x39dca4=_0x39dca4<0x64?0x64:_0x39dca4;loggerPredictive[_0x50e3('0x83')](_0x117f4e[_0x50e3('0x44')],_0x50e3('0x1f1'),_0x39dca4,'milliseconds');_0x117f4e[_0x50e3('0x98')]=setInterval(function(){_0x4d5500[_0x50e3('0x98')](_0x117f4e);loggerPredictiveCalls['info'](_0x50e3('0x1f2'),_0x3ed423+=0x1);},_0x39dca4);}else{loggerPredictive['info'](_0x117f4e[_0x50e3('0x44')],_0x50e3('0x1f3'));}};};Dialer['prototype'][_0x50e3('0x1f4')]=function(_0x5e6cf6,_0x3c7a83){var _0x1269f1=this;return function(_0x57ff3c){if(_[_0x50e3('0x4a')](_0x57ff3c)){if(_['isNil'](_0x3c7a83[_0x50e3('0x1f5')])||!_0x3c7a83[_0x50e3('0x1f6')]){if(_0x5e6cf6['dialMethod']===_0x50e3('0xa')){_0x5e6cf6[_0x50e3('0x137')]=_['isUndefined'](_0x5e6cf6[_0x50e3('0x137')])?!![]:_0x5e6cf6[_0x50e3('0x137')];var _0x447d4d=uuid['v4']();_0x1269f1[_0x50e3('0xb3')][_0x447d4d]=new Action(_0x5e6cf6,_0x3c7a83,_0x447d4d);loggerBooked[_0x50e3('0x83')](_0x50e3('0x1f7'),_0x447d4d,_0x50e3('0x1f8'),JSON['stringify'](_0x5e6cf6[_0x50e3('0x137')]),'Queue:\x20',_0x5e6cf6[_0x50e3('0x44')]);if(_0x5e6cf6[_0x50e3('0x137')]){_0x5e6cf6[_0x50e3('0x137')]=![];_0x1269f1[_0x50e3('0x2d')][_0x1269f1[_0x50e3('0xb3')][_0x447d4d][_0x50e3('0xbb')]]=[];ami[_0x50e3('0xb6')]({'actionid':_0x447d4d,'action':_0x50e3('0x1f9'),'queue':_0x5e6cf6['name']})[_0x50e3('0xb8')](function(){_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);_0x1269f1['rescheduleContact']({'active':![],'ContactId':_0x1269f1['actions'][_0x447d4d][_0x50e3('0xd9')],'ListId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['ListId'],'VoiceQueueId':_0x1269f1['actions'][_0x447d4d]['VoiceQueueId']||undefined,'CampaignId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['CampaignId']||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1fa')));delete _0x1269f1[_0x50e3('0xb3')][_0x447d4d];});}else{loggerBooked[_0x50e3('0x83')]('[booked][checkContactBlack][else]',JSON[_0x50e3('0x7d')](_0x5e6cf6[_0x50e3('0x137')]),_0x50e3('0x1fb'),_0x5e6cf6[_0x50e3('0x44')]);_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);_0x1269f1[_0x50e3('0xc6')]({'active':![],'ContactId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['ContactId'],'ListId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['ListId'],'VoiceQueueId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d]['VoiceQueueId']||undefined,'CampaignId':_0x1269f1[_0x50e3('0xb3')][_0x447d4d][_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1fa')));delete _0x1269f1[_0x50e3('0xb3')][_0x447d4d];}}else{return _0x1269f1[_0x50e3('0x170')](_0x5e6cf6,_0x3c7a83);}}else{if(getDiff(_0x3c7a83[_0x50e3('0x1fc')])<_0x5e6cf6['dialRecallMeTimeout']*0x3c){if(_0x3c7a83['Agent']&&!_0x3c7a83['Agent'][_0x50e3('0x1fd')]){_0x1269f1['preview'][_0x50e3('0x13a')](_0x3c7a83['id'])['finally'](function(){_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);});}else{_0x1269f1['unlockContact']({'active':![]},_0x3c7a83['id'],0x1)[_0x50e3('0x20')](function(){_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);});}}else{_0x5e6cf6[_0x50e3('0x68')]+=0x1;_0x1269f1[_0x50e3('0xba')](_0x5e6cf6);if(_0x5e6cf6[_0x50e3('0x1fe')]){_0x1269f1[_0x50e3('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c7a83[_0x50e3('0xd9')],'ListId':_0x3c7a83[_0x50e3('0xda')],'VoiceQueueId':_0x3c7a83[_0x50e3('0x101')]||undefined,'CampaignId':_0x3c7a83[_0x50e3('0xdb')]||undefined})[_0x50e3('0xb8')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x1269f1[_0x50e3('0xd3')](createObjHistory(_0x5e6cf6,_0x3c7a83,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0x50e3('0xb8')](loggerCatch(_0x50e3('0x1ff')));}else{_0x1269f1[_0x50e3('0xd7')](createObjHistory(_0x5e6cf6,_0x3c7a83,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0x50e3('0x200'),_0x50e3('0x201'));}}}}else{_0x5e6cf6[_0x50e3('0x202')]+=0x1;_0x1269f1[_0x50e3('0xd7')](createObjHistory(_0x5e6cf6,_0x3c7a83,_0x50e3('0x203'),0xd,_0x50e3('0x204')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x50e3('0x205');}};};Dialer['prototype'][_0x50e3('0x164')]=function(_0x20287d){var _0x90986a=this;var _0x29ccd9=_0x20287d[_0x50e3('0x206')]-_0x20287d[_0x50e3('0x75')]-_0x20287d[_0x50e3('0xcb')];emitCampaignSummary(_0x20287d);if(_0x29ccd9>0x0){if(_0x29ccd9>this['maxNumberOriginate']){_0x29ccd9=this[_0x50e3('0x27')];}_0x20287d['temp']+=_0x29ccd9;this[_0x50e3('0xcd')](_0x20287d['id'],_0x29ccd9,_0x20287d[_0x50e3('0x207')],_0x20287d)[_0x50e3('0xbe')](function(_0x4f0805){_0x20287d[_0x50e3('0xcb')]-=_0x29ccd9;_0x20287d[_0x50e3('0xcb')]=_0x20287d[_0x50e3('0xcb')]>0x0?_0x20287d[_0x50e3('0xcb')]:0x0;if(!checkContactEmpty(_0x4f0805)){_0x20287d['message']=_0x50e3('0xa5');logger[_0x50e3('0x83')](_0x50e3('0x208')+_0x20287d[_0x50e3('0x44')]);}else{_0x20287d[_0x50e3('0x75')]+=_0x4f0805['length'];_0x20287d['message']=_0x50e3('0x209');for(var _0xb94b41=0x0;_0xb94b41<_0x4f0805[_0x50e3('0x9f')];_0xb94b41+=0x1){_0x20287d['ivrTotalCallsDays']+=0x1;if(_['isNil'](_0x4f0805[_0xb94b41])||_[_0x50e3('0xb5')](_0x4f0805[_0xb94b41]['Contact'])||_[_0x50e3('0xb5')](_0x4f0805[_0xb94b41][_0x50e3('0x174')][_0x50e3('0x175')])){_0x90986a['emptyContact'](_0x50e3('0x20a'),_0x20287d,_0x4f0805[_0xb94b41]);}else{_0x90986a[_0x50e3('0xc3')](_[_0x50e3('0xd8')](_0x4f0805[_0xb94b41],[_0x50e3('0xdb'),_0x50e3('0x20b')]))[_0x50e3('0xbe')](_0x90986a[_0x50e3('0x1f4')](_0x20287d,_0x4f0805[_0xb94b41]))['catch'](_0x90986a[_0x50e3('0x20c')](_0x50e3('0x20d'),_0x20287d));}}}})[_0x50e3('0xb8')](loggerGetContactDialer(_0x50e3('0x20e'),_0x20287d,_0x29ccd9));}};Dialer[_0x50e3('0x1d')][_0x50e3('0x15e')]=function(_0x9b5fb7,_0x558752){var _0x22f343=this;var _0x75f89e=[];var _0x1afd45=_0x558752>=0x1?_0x558752:0x1;if(_0x9b5fb7[_0x50e3('0x5c')]===_0x50e3('0xa')){_0x1afd45=0x1;}var _0x3b0cb2=Math['floor'](_0x9b5fb7[_0x50e3('0x53')]*_0x1afd45)-_0x9b5fb7[_0x50e3('0x75')]-_0x9b5fb7['temp'];emitVoiceQueueSummary(_0x9b5fb7);if(_0x9b5fb7['dialLimitQueue']>0x0){var _0x57583c=_0x9b5fb7[_0x50e3('0x20f')]-_0x9b5fb7[_0x50e3('0x75')]-_0x9b5fb7[_0x50e3('0x1d0')]-_0x9b5fb7[_0x50e3('0xcb')]-_0x9b5fb7[_0x50e3('0xa7')];if(_0x3b0cb2>_0x57583c){_0x3b0cb2=_0x57583c;}}if(_0x3b0cb2>0x0){if(_0x9b5fb7[_0x50e3('0x5c')]==='booked'){_0x3b0cb2=0x1;}if(_0x3b0cb2>this[_0x50e3('0x27')]){_0x3b0cb2=this[_0x50e3('0x27')];}_0x9b5fb7['temp']+=_0x3b0cb2;for(var _0x50e49d in this['agents']){if(typeof this['agents'][_0x50e49d]!==_0x50e3('0xb4')){if(this['agents'][_0x50e49d][_0x50e3('0xad')]===_0x50e3('0x210')&&this[_0x50e3('0x25')][_0x50e49d]['status']===_0x50e3('0xe1')){_0x75f89e[_0x50e3('0x134')](this['agents'][_0x50e49d]['id']);}}}this['getContactDialer'](_0x9b5fb7['id'],_0x75f89e,_0x3b0cb2,_0x9b5fb7[_0x50e3('0x207')],_0x9b5fb7)[_0x50e3('0xbe')](function(_0x5d9c6b){_0x9b5fb7[_0x50e3('0xcb')]-=_0x3b0cb2;_0x9b5fb7['temp']=_0x9b5fb7[_0x50e3('0xcb')]>0x0?_0x9b5fb7[_0x50e3('0xcb')]:0x0;if(!checkContactEmpty(_0x5d9c6b)){_0x22f343[_0x50e3('0xbd')](_0x9b5fb7)[_0x50e3('0xbe')](sendMessageReschedule(_0x9b5fb7))['catch'](loggerCatch(_0x50e3('0xbf')));}else{_0x9b5fb7[_0x50e3('0x75')]+=_0x5d9c6b[_0x50e3('0x9f')];_0x9b5fb7[_0x50e3('0x42')]=_0x9b5fb7[_0x50e3('0x5c')]===_0x50e3('0xa')?_0x50e3('0x17b'):_0x50e3('0x209');for(var _0x1ff7b1=0x0;_0x1ff7b1<_0x5d9c6b[_0x50e3('0x9f')];_0x1ff7b1+=0x1){if(_[_0x50e3('0xb5')](_0x5d9c6b[_0x1ff7b1])||_[_0x50e3('0xb5')](_0x5d9c6b[_0x1ff7b1][_0x50e3('0x174')])||_[_0x50e3('0xb5')](_0x5d9c6b[_0x1ff7b1][_0x50e3('0x174')]['phone'])){_0x22f343[_0x50e3('0x211')]('[actionOriginate]\x20',_0x9b5fb7,_0x5d9c6b[_0x1ff7b1]);}else{_0x22f343[_0x50e3('0xc0')](_[_0x50e3('0xd8')](_0x5d9c6b[_0x1ff7b1],[_0x50e3('0x101'),_0x50e3('0x20b')]))[_0x50e3('0xbe')](_0x22f343[_0x50e3('0x1f4')](_0x9b5fb7,_0x5d9c6b[_0x1ff7b1]))[_0x50e3('0xb8')](_0x22f343[_0x50e3('0x20c')](_0x50e3('0x20a'),_0x9b5fb7));}}}})[_0x50e3('0xb8')](loggerGetContactDialer('[getContactDialer2]',_0x9b5fb7,_0x3b0cb2));}};Dialer[_0x50e3('0x1d')][_0x50e3('0x98')]=function(_0x5caae7){if(_0x5caae7[_0x50e3('0x20f')]>0x0){var _0x3eaad9=_0x5caae7[_0x50e3('0x20f')]-_0x5caae7[_0x50e3('0x75')]-_0x5caae7['talking'];if(_0x3eaad9>0x0){this[_0x50e3('0x212')](_0x5caae7);}else{loggerPredictiveCalls['info'](_0x50e3('0x213'));}}else{this['tryOriginatePredictive'](_0x5caae7);}};Dialer['prototype'][_0x50e3('0x212')]=function(_0x43996c){var _0x35886a=this;var _0x2062d3=[];_0x43996c['originated']+=0x1;for(var _0xff01ee in this[_0x50e3('0x25')]){if(typeof this['agents'][_0xff01ee]!=='undefined'){if(this[_0x50e3('0x25')][_0xff01ee][_0x50e3('0xad')]===_0x50e3('0x210')&&this[_0x50e3('0x25')][_0xff01ee][_0x50e3('0xb7')]===_0x50e3('0xe1')){_0x2062d3[_0x50e3('0x134')](this[_0x50e3('0x25')][_0xff01ee]['id']);}}}this[_0x50e3('0xca')](_0x43996c['id'],_0x2062d3,0x1,_0x43996c[_0x50e3('0x207')],_0x43996c)['then'](function(_0x4b0ca0){if(!checkContactEmpty(_0x4b0ca0)){checkContactLowerLimitOriginate(_0x43996c,0x1,0x0);_0x35886a[_0x50e3('0xbd')](_0x43996c)[_0x50e3('0xbe')](sendMessageReschedule(_0x43996c))['catch'](loggerCatch(_0x50e3('0xbf')));}else{_0x43996c[_0x50e3('0x42')]=_0x50e3('0x209');if(_['isNil'](_0x4b0ca0[0x0])||_[_0x50e3('0xb5')](_0x4b0ca0[0x0][_0x50e3('0x174')])||_[_0x50e3('0xb5')](_0x4b0ca0[0x0][_0x50e3('0x174')][_0x50e3('0x175')])){_0x35886a[_0x50e3('0x211')](_0x50e3('0x20a'),_0x43996c,_0x4b0ca0[0x0]);}else{_0x35886a[_0x50e3('0xc0')](_[_0x50e3('0xd8')](_0x4b0ca0[0x0],[_0x50e3('0x101'),_0x50e3('0x20b')]))[_0x50e3('0xbe')](_0x35886a[_0x50e3('0x1f4')](_0x43996c,_0x4b0ca0[0x0]))[_0x50e3('0xb8')](_0x35886a[_0x50e3('0x20c')](_0x50e3('0x214'),_0x43996c));}}})[_0x50e3('0xb8')](loggerGetContactDialer(_0x50e3('0x215'),_0x43996c,0x1));emitVoiceQueueSummary(_0x43996c);};Dialer[_0x50e3('0x1d')][_0x50e3('0x1e8')]=function(_0x369dd5,_0x39a031,_0x2f903b,_0x2f947b,_0x3e65a7,_0x5bd30c){loggerPredictive[_0x50e3('0x83')](_0x50e3('0x216'));loggerPredictive[_0x50e3('0x83')](_0x50e3('0x217'),_0x369dd5);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x218'),_0x39a031);loggerPredictive['info'](_0x50e3('0x219'),_0x2f903b);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x21a'),_0x2f947b);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x21b'),_0x3e65a7);loggerPredictive[_0x50e3('0x83')]('---------------------------');return new BPromise(function(_0x30ee63,_0x20f0a5){if(_0x369dd5<=0x0||isNaN(_0x369dd5)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),_0x50e3('0x21d')+_0x369dd5));}if(_0x2f903b<=0x0||isNaN(_0x2f903b)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),_0x50e3('0x21e')+_0x2f903b));}if(_0x2f947b<=0x0||isNaN(_0x2f947b)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),'p\x20=\x20'+_0x2f947b));}if(_0x39a031<=0x0||isNaN(_0x39a031)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),_0x50e3('0x1a1'),'interval\x20=\x20'+_0x39a031));}if(_0x3e65a7<=0x0||isNaN(_0x3e65a7)){return _0x20f0a5(msgResponse(_0x50e3('0x21c'),'Error',_0x50e3('0x21f')+_0x3e65a7));}_0x5bd30c=_0x5bd30c||0x0;var _0x32eeea=0x1/_0x2f903b;var _0x4afe57=0x0;var _0x273d8a=0x0;var _0x9fecd1=0x0;var _0x5d2123=0x0;for(var _0x149f5b=0x0;_0x9fecd1<_0x3e65a7;_0x149f5b+=0x1){_0x273d8a=_0x149f5b/_0x39a031;_0x4afe57=(_0x2f947b*_0x273d8a+_0x5bd30c)/_0x32eeea;_0x9fecd1=erlangb(_0x4afe57,_0x369dd5);_0x5d2123=_0x4afe57/_0x369dd5*(0x1-erlangb(_0x4afe57,_0x369dd5));}return _0x30ee63({'erlangCalls':_0x149f5b,'erlangCallToSecond':_0x39a031/_0x149f5b,'erlangAbandonmentRate':_0x9fecd1,'erlangBusyFactor':_0x5d2123});});};Dialer[_0x50e3('0x1d')]['busyFactor']=function(_0x3d45f7,_0x57e71f,_0x824cb4,_0x164ead,_0x486703,_0x2ed073){loggerPredictive['info'](_0x50e3('0x220'));loggerPredictive[_0x50e3('0x83')]('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',_0x3d45f7);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x218'),_0x57e71f);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x219'),_0x824cb4);loggerPredictive['info'](_0x50e3('0x21a'),_0x164ead);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x221'),_0x486703);loggerPredictive[_0x50e3('0x83')](_0x50e3('0x94'));return new BPromise(function(_0x4ad6ed,_0x3c83dd){if(_0x3d45f7<=0x0||isNaN(_0x3d45f7)){return _0x3c83dd(msgResponse(_0x50e3('0x222'),_0x50e3('0x1a1'),_0x50e3('0x21d')+_0x3d45f7));}if(_0x824cb4<=0x0||isNaN(_0x824cb4)){return _0x3c83dd(msgResponse(_0x50e3('0x222'),_0x50e3('0x1a1'),_0x50e3('0x21e')+_0x824cb4));}if(_0x164ead<=0x0||isNaN(_0x164ead)){return _0x3c83dd(msgResponse('[busyFactor]','Error',_0x50e3('0x223')+_0x164ead));}if(_0x57e71f<=0x0||isNaN(_0x57e71f)){return _0x3c83dd(msgResponse(_0x50e3('0x222'),_0x50e3('0x1a1'),_0x50e3('0x224')+_0x57e71f));}if(_0x486703<=0x0||isNaN(_0x486703)){return _0x3c83dd(msgResponse('[busyFactor]',_0x50e3('0x1a1'),'Umin\x20=\x20'+_0x486703));}_0x2ed073=_0x2ed073||0x0;var _0x4a6435=0x1/_0x824cb4;var _0x281c0e=0x0;var _0x36c42f=0x0;var _0x21e89e=0x0;var _0xa9673a=0x0;for(var _0x311d72=0x0;_0xa9673a<_0x486703;_0x311d72+=0x1){_0x36c42f=_0x311d72/_0x57e71f;_0x281c0e=(_0x164ead*_0x36c42f+_0x2ed073)/_0x4a6435;_0x21e89e=erlangb(_0x281c0e,_0x3d45f7);_0xa9673a=_0x281c0e/_0x3d45f7*(0x1-erlangb(_0x281c0e,_0x3d45f7));}return _0x4ad6ed({'erlangCalls':_0x311d72,'erlangCallToSecond':_0x57e71f/_0x311d72,'erlangAbandonmentRate':_0x21e89e,'erlangBusyFactor':_0xa9673a});});};module[_0x50e3('0x225')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5fa27a2..52d387f 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 _0xc3cb=['countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','droptime','ringtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0x34f476,_0x39fe2e){var _0x30fe20=function(_0x488835){while(--_0x488835){_0x34f476['push'](_0x34f476['shift']());}};_0x30fe20(++_0x39fe2e);}(_0xc3cb,0x16d));var _0xbc3c=function(_0x4ef707,_0x2d93ed){_0x4ef707=_0x4ef707-0x0;var _0x3b9f8c=_0xc3cb[_0x4ef707];return _0x3b9f8c;};'use strict';var util=require(_0xbc3c('0x0'));var _=require(_0xbc3c('0x1'));var moment=require(_0xbc3c('0x2'));function getSeconds(_0x22c47e,_0x2c53a0){var _0x2fa3a3=moment(_0x22c47e)[_0xbc3c('0x3')](0x0);var _0x325287=moment(_0x2c53a0)[_0xbc3c('0x3')](0x0);return _0x2fa3a3['diff'](_0x325287,'seconds');}function QueueCallerAbandon(_0xd0b427,_0xd9c1ab){this[_0xbc3c('0x4')]=_0xd0b427[_0xbc3c('0x4')];this[_0xbc3c('0x5')]=_0xd0b427['type'];this[_0xbc3c('0x6')]=_0xd0b427[_0xbc3c('0x5')]===_0xbc3c('0x7')?_0xbc3c('0x8'):_0xd0b427[_0xbc3c('0x5')];this[_0xbc3c('0x9')]=_0xd0b427[_0xbc3c('0x9')];this[_0xbc3c('0xa')]=_0xd0b427[_0xbc3c('0xa')];this[_0xbc3c('0xb')]=_0xd0b427[_0xbc3c('0xb')];this[_0xbc3c('0xc')]=_0xd0b427['countbusyretry']+_0xd0b427[_0xbc3c('0xa')]+_0xd0b427[_0xbc3c('0xb')]+_0xd0b427[_0xbc3c('0xd')]+_0xd0b427['countdropretry']+_0xd0b427[_0xbc3c('0xe')]+_0xd0b427[_0xbc3c('0xf')]+_0xd0b427[_0xbc3c('0x10')];this['countnosuchnumberretry']=_0xd0b427[_0xbc3c('0xd')];this['countdropretry']=_0xd0b427['countdropretry'];this[_0xbc3c('0xe')]=_0xd0b427[_0xbc3c('0xe')];this[_0xbc3c('0xf')]=_0xd0b427[_0xbc3c('0xf')];this[_0xbc3c('0x10')]=_0xd0b427[_0xbc3c('0x10')];this['uniqueid']=_0xd9c1ab[_0xbc3c('0x11')];this[_0xbc3c('0x12')]=_0xd0b427[_0xbc3c('0x13')];this['calleridnum']=_0xd0b427[_0xbc3c('0x14')];this[_0xbc3c('0x15')]=_0xd0b427[_0xbc3c('0x15')];this[_0xbc3c('0x16')]=_0xd0b427[_0xbc3c('0x16')];this['droptime']=_0xd0b427['droptime'];this[_0xbc3c('0x17')]=this[_0xbc3c('0x18')];this[_0xbc3c('0x19')]=getSeconds(_0xd0b427[_0xbc3c('0x16')],_0xd0b427['starttime']);this['holdtime']=getSeconds(this[_0xbc3c('0x18')],_0xd0b427['responsetime']);this[_0xbc3c('0x1a')]=0x0;this[_0xbc3c('0x8')]=_0xd9c1ab[_0xbc3c('0x8')];this[_0xbc3c('0x1b')]=_0xd9c1ab[_0xbc3c('0x1c')];this[_0xbc3c('0x1d')]=_0xd9c1ab['reason'];this[_0xbc3c('0x1e')]=_0xd0b427['callback'];this[_0xbc3c('0x1f')]=_0xd0b427['callbackuniqueid'];this[_0xbc3c('0x20')]=_0xd0b427[_0xbc3c('0x20')];this['recallme']=_0xd0b427[_0xbc3c('0x21')];this[_0xbc3c('0x22')]=_0xd0b427[_0xbc3c('0x22')];this[_0xbc3c('0x23')]=_0xd0b427['ListId'];this[_0xbc3c('0x24')]=_0xd0b427[_0xbc3c('0x24')];this[_0xbc3c('0x25')]=_0xd0b427[_0xbc3c('0x25')];this[_0xbc3c('0x26')]=_0xd0b427[_0xbc3c('0x26')];this['originatecalleridnum']=_0xd0b427[_0xbc3c('0x27')]||'';this[_0xbc3c('0x28')]=_0xd0b427[_0xbc3c('0x28')]||'';}module[_0xbc3c('0x29')]=QueueCallerAbandon; \ No newline at end of file +var _0x6a26=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','droptime','queue','reason','callback','callbackuniqueid','callbackat','recallme','ListId'];(function(_0x51e97f,_0x44a9f7){var _0x406a1c=function(_0x1d6949){while(--_0x1d6949){_0x51e97f['push'](_0x51e97f['shift']());}};_0x406a1c(++_0x44a9f7);}(_0x6a26,0xa6));var _0x66a2=function(_0x4fb073,_0x2e92e8){_0x4fb073=_0x4fb073-0x0;var _0x32401f=_0x6a26[_0x4fb073];return _0x32401f;};'use strict';var util=require(_0x66a2('0x0'));var _=require(_0x66a2('0x1'));var moment=require(_0x66a2('0x2'));function getSeconds(_0xeb22e7,_0x5cc17b){var _0x56eb22=moment(_0xeb22e7)['milliseconds'](0x0);var _0x22e381=moment(_0x5cc17b)[_0x66a2('0x3')](0x0);return _0x56eb22[_0x66a2('0x4')](_0x22e381,_0x66a2('0x5'));}function QueueCallerAbandon(_0x344203,_0x373f81){this['scheduledat']=_0x344203[_0x66a2('0x6')];this['type']=_0x344203['type'];this[_0x66a2('0x7')]=_0x344203[_0x66a2('0x8')]===_0x66a2('0x9')?'queue':_0x344203['type'];this['countbusyretry']=_0x344203[_0x66a2('0xa')];this[_0x66a2('0xb')]=_0x344203[_0x66a2('0xb')];this[_0x66a2('0xc')]=_0x344203[_0x66a2('0xc')];this[_0x66a2('0xd')]=_0x344203[_0x66a2('0xa')]+_0x344203[_0x66a2('0xb')]+_0x344203[_0x66a2('0xc')]+_0x344203[_0x66a2('0xe')]+_0x344203[_0x66a2('0xf')]+_0x344203['countabandonedretry']+_0x344203[_0x66a2('0x10')]+_0x344203[_0x66a2('0x11')];this[_0x66a2('0xe')]=_0x344203[_0x66a2('0xe')];this[_0x66a2('0xf')]=_0x344203['countdropretry'];this[_0x66a2('0x12')]=_0x344203[_0x66a2('0x12')];this['countmachineretry']=_0x344203['countmachineretry'];this[_0x66a2('0x11')]=_0x344203[_0x66a2('0x11')];this[_0x66a2('0x13')]=_0x373f81[_0x66a2('0x13')];this['calleridname']=_0x344203[_0x66a2('0x14')];this[_0x66a2('0x15')]=_0x344203[_0x66a2('0x16')];this[_0x66a2('0x17')]=_0x344203[_0x66a2('0x17')];this[_0x66a2('0x18')]=_0x344203[_0x66a2('0x18')];this['droptime']=_0x344203['droptime'];this[_0x66a2('0x19')]=this[_0x66a2('0x1a')];this['ringtime']=getSeconds(_0x344203[_0x66a2('0x18')],_0x344203['starttime']);this['holdtime']=getSeconds(this[_0x66a2('0x1a')],_0x344203[_0x66a2('0x18')]);this['talktime']=0x0;this['queue']=_0x373f81[_0x66a2('0x1b')];this['membername']=_0x373f81['connectedlinename'];this['reason']=_0x373f81[_0x66a2('0x1c')];this['callback']=_0x344203[_0x66a2('0x1d')];this['callbackuniqueid']=_0x344203[_0x66a2('0x1e')];this['callbackat']=_0x344203[_0x66a2('0x1f')];this[_0x66a2('0x20')]=_0x344203[_0x66a2('0x20')];this['ContactId']=_0x344203['ContactId'];this[_0x66a2('0x21')]=_0x344203[_0x66a2('0x21')];this[_0x66a2('0x22')]=_0x344203['UserId'];this[_0x66a2('0x23')]=_0x344203[_0x66a2('0x23')];this[_0x66a2('0x24')]=_0x344203['CampaignId'];this[_0x66a2('0x25')]=_0x344203[_0x66a2('0x25')]||'';this[_0x66a2('0x26')]=_0x344203['originatecalleridname']||'';}module[_0x66a2('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 1c1be13..3a39502 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(_0x33f0fe,_0x3416cb){var _0x57c3f5=function(_0x1c5662){while(--_0x1c5662){_0x33f0fe['push'](_0x33f0fe['shift']());}};_0x57c3f5(++_0x3416cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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(_0x2e1f25,_0x299328){var _0x40454a=function(_0x4d7483){while(--_0x4d7483){_0x2e1f25['push'](_0x2e1f25['shift']());}};_0x40454a(++_0x299328);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 2670b36..c8a268d 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 _0xb5b6=['application/pdf','notify','catch','error','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','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','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isNil','active','SIP/%s','status','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','util','uuid','moment','path','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','actions','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb5b6,0x12c));var _0x6b5b=function(_0x5b574e,_0x14accd){_0x5b574e=_0x5b574e-0x0;var _0x1d42b9=_0xb5b6[_0x5b574e];return _0x1d42b9;};'use strict';var util=require(_0x6b5b('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x6b5b('0x1'));var moment=require(_0x6b5b('0x2'));var path=require(_0x6b5b('0x3'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x6b5b('0x4'));var logger=require(_0x6b5b('0x5'))(_0x6b5b('0x6'));var ami=require(_0x6b5b('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x6b5b('0x8'));var ut=require(_0x6b5b('0x9'));var Action=require(_0x6b5b('0xa'));var faxAccount=require(_0x6b5b('0xb'));var attachment=require(_0x6b5b('0xc'));var faxMessage=require(_0x6b5b('0xd'));function Fax(_0x3495c1){this[_0x6b5b('0xe')]={};this['faxAccounts']=_0x3495c1[_0x6b5b('0xf')];this[_0x6b5b('0x10')]=_0x3495c1[_0x6b5b('0x10')];this['actions']={};ami['on'](_0x6b5b('0x11'),this[_0x6b5b('0x12')][_0x6b5b('0x13')](this));ami['on'](_0x6b5b('0x14'),this[_0x6b5b('0x15')]['bind'](this));ami['on'](_0x6b5b('0x16'),this[_0x6b5b('0x17')][_0x6b5b('0x13')](this));ami['on'](_0x6b5b('0x18'),this[_0x6b5b('0x19')][_0x6b5b('0x13')](this));ami['on'](_0x6b5b('0x1a'),this[_0x6b5b('0x1b')][_0x6b5b('0x13')](this));ami['on'](_0x6b5b('0x1c'),this[_0x6b5b('0x1d')][_0x6b5b('0x13')](this));ami['on'](_0x6b5b('0x1e'),this['syncHangup']['bind'](this));ami['on'](_0x6b5b('0x1f'),this[_0x6b5b('0x20')][_0x6b5b('0x13')](this));}Fax[_0x6b5b('0x21')][_0x6b5b('0x12')]=function(_0x4c7527){if(_0x4c7527['context']===_0x6b5b('0x22')){for(var _0x2805a2 in this[_0x6b5b('0xf')]){if(this['faxAccounts'][_0x6b5b('0x23')](_0x2805a2)){if(_0x4c7527['exten']===this[_0x6b5b('0xf')][_0x2805a2][_0x6b5b('0x24')]){this[_0x6b5b('0xe')][_0x4c7527[_0x6b5b('0x25')]]={};this['channels'][_0x4c7527[_0x6b5b('0x25')]]['channel']=_0x4c7527[_0x6b5b('0x26')];this[_0x6b5b('0xe')][_0x4c7527[_0x6b5b('0x25')]]['id']=this[_0x6b5b('0xf')][_0x2805a2]['id'];this['channels'][_0x4c7527['uniqueid']][_0x6b5b('0x27')]=this[_0x6b5b('0xf')][_0x2805a2][_0x6b5b('0x27')];logger[_0x6b5b('0x28')](_0x4c7527['uniqueid'],'\x20syncNewchannel\x20');}}}}if(this[_0x6b5b('0x29')][_0x4c7527[_0x6b5b('0x25')]]){this['channels'][_0x4c7527['uniqueid']]={};this['channels'][_0x4c7527[_0x6b5b('0x25')]][_0x6b5b('0x26')]=_0x4c7527[_0x6b5b('0x26')];logger[_0x6b5b('0x28')](_0x4c7527[_0x6b5b('0x25')],_0x6b5b('0x2a'));}};Fax[_0x6b5b('0x21')]['syncVarSet']=function(_0x41340e){if(this['channels'][_0x41340e[_0x6b5b('0x25')]]){for(var _0xd52de1 in _0x41340e[_0x6b5b('0x2b')]){if(_0x41340e[_0x6b5b('0x2b')]['hasOwnProperty'](_0xd52de1)){this[_0x6b5b('0xe')][_0x41340e['uniqueid']][_0xd52de1]=_0x41340e[_0x6b5b('0x2c')];}}}};Fax[_0x6b5b('0x21')][_0x6b5b('0x17')]=function(_0x1e37fe){if(this[_0x6b5b('0xe')][_0x1e37fe[_0x6b5b('0x25')]]){this['channels'][_0x1e37fe[_0x6b5b('0x25')]][_0x6b5b('0x2d')]=_0x1e37fe['channelstate'];this['channels'][_0x1e37fe[_0x6b5b('0x25')]][_0x6b5b('0x2e')]=_0x1e37fe['channelstatedesc'];}};Fax['prototype'][_0x6b5b('0x19')]=function(_0x105369){if(this[_0x6b5b('0xe')][_0x105369[_0x6b5b('0x25')]]){for(var _0x377b45 in _0x105369[_0x6b5b('0x2b')]){if(_0x105369[_0x6b5b('0x2b')][_0x6b5b('0x23')](_0x377b45)){this[_0x6b5b('0xe')][_0x105369[_0x6b5b('0x25')]][_0x377b45]=_0x105369[_0x6b5b('0x2c')];}}}};Fax[_0x6b5b('0x21')]['syncFaxStatus']=function(_0x51d557){if(this[_0x6b5b('0xe')][_0x51d557[_0x6b5b('0x25')]]){this[_0x6b5b('0xe')][_0x51d557[_0x6b5b('0x25')]]['operation']=_0x51d557[_0x6b5b('0x2f')];this['channels'][_0x51d557[_0x6b5b('0x25')]]['status']=_0x51d557['status'];this['channels'][_0x51d557['uniqueid']][_0x6b5b('0x24')]=_0x51d557[_0x6b5b('0x24')];this['channels'][_0x51d557[_0x6b5b('0x25')]][_0x6b5b('0x30')]=_0x51d557[_0x6b5b('0x30')];logger['info'](_0x51d557['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x6b5b('0x21')][_0x6b5b('0x1d')]=function(_0x51a0f6){var _0x1cb44e=this;if(this[_0x6b5b('0xe')][_0x51a0f6['uniqueid']]){var _0x129132=this[_0x6b5b('0xe')][_0x51a0f6[_0x6b5b('0x25')]]['id'];this['channels'][_0x51a0f6['uniqueid']][_0x6b5b('0x31')]=_0x51a0f6[_0x6b5b('0x31')];this[_0x6b5b('0xe')][_0x51a0f6[_0x6b5b('0x25')]]['pagestransferred']=_0x51a0f6[_0x6b5b('0x32')];this[_0x6b5b('0xe')][_0x51a0f6['uniqueid']][_0x6b5b('0x24')]=_0x51a0f6['localstationid'];this[_0x6b5b('0xe')][_0x51a0f6[_0x6b5b('0x25')]][_0x6b5b('0x33')]=_0x51a0f6[_0x6b5b('0x33')];this['channels'][_0x51a0f6[_0x6b5b('0x25')]][_0x6b5b('0x34')]=_0x51a0f6[_0x6b5b('0x34')];this[_0x6b5b('0xe')][_0x51a0f6[_0x6b5b('0x25')]][_0x6b5b('0x30')]=_0x51a0f6[_0x6b5b('0x30')];this[_0x6b5b('0xe')][_0x51a0f6[_0x6b5b('0x25')]][_0x6b5b('0x35')]=_0x51a0f6['calleridnum'];if(this[_0x6b5b('0xe')][_0x51a0f6[_0x6b5b('0x25')]][_0x6b5b('0x32')]>0x0){tiff2pdf(_0x51a0f6[_0x6b5b('0x30')],_0x6b5b('0x36'),function(_0x4766a2){logger['info'](_0x51a0f6[_0x6b5b('0x25')],_0x6b5b('0x37'),_0x4766a2[_0x6b5b('0x38')]);attachment[_0x6b5b('0x39')]({'name':path[_0x6b5b('0x3a')](_0x51a0f6['filename'])[_0x6b5b('0x27')],'basename':path[_0x6b5b('0x3a')](_0x51a0f6[_0x6b5b('0x30')])[_0x6b5b('0x27')]+_0x6b5b('0x3b'),'type':_0x6b5b('0x3c')})['then'](function(_0x4499cb){faxAccount[_0x6b5b('0x3d')](_0x129132,{'from':_0x51a0f6[_0x6b5b('0x35')],'mapKey':_0x6b5b('0x6'),'body':path['parse'](_0x51a0f6[_0x6b5b('0x30')])[_0x6b5b('0x27')]+_0x6b5b('0x3b'),'AttachmentId':_0x4499cb['id']})[_0x6b5b('0x3e')](function(_0x72afb4){logger[_0x6b5b('0x3f')](_0x51a0f6[_0x6b5b('0x25')],'\x20notify\x20',JSON[_0x6b5b('0x40')](_0x72afb4));});})['catch'](function(_0x5cfd19){logger['error'](_0x51a0f6['uniqueid'],_0x6b5b('0x41'),JSON[_0x6b5b('0x40')](_0x5cfd19));});});}logger[_0x6b5b('0x28')](_0x51a0f6[_0x6b5b('0x25')],_0x6b5b('0x41'));}};Fax[_0x6b5b('0x21')][_0x6b5b('0x20')]=function(_0x73fc89){if(this['actions'][_0x73fc89['uniqueid']]){_['merge'](this[_0x6b5b('0xe')][_0x73fc89[_0x6b5b('0x25')]],_[_0x6b5b('0x42')](_0x73fc89,[_0x6b5b('0x43'),_0x6b5b('0x44')]));}};function updateStatus(_0x58d4b0){if(_0x58d4b0[_0x6b5b('0x45')]){faxMessage[_0x6b5b('0x46')](_0x58d4b0[_0x6b5b('0x45')],{'failMessage':_0x6b5b('0x47')})[_0x6b5b('0x48')](function(_0x47d1a4){ut['logger'](_0x6b5b('0x49'),_0x47d1a4);})[_0x6b5b('0x3e')](function(_0x11d15e){ut[_0x6b5b('0x4a')](_0x6b5b('0x4b'),_0x11d15e);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x6b5b('0x21')][_0x6b5b('0x4c')]=function(_0xffaab9,_0x20c2c2,_0x1e0c23){var _0x4a6492=this;var _0x3369be={};if(_0x20c2c2){_0x3369be={'read':_0x20c2c2};}else{_0x3369be={'failMessage':_0x1e0c23};}if(this['actions'][_0xffaab9][_0x6b5b('0x45')]){faxMessage[_0x6b5b('0x46')](this[_0x6b5b('0x29')][_0xffaab9]['AttachmentId'],_0x3369be)[_0x6b5b('0x48')](function(_0x37486e){ut[_0x6b5b('0x4a')](_0x6b5b('0x4d'),_0x37486e);})['catch'](function(_0x8573f9){ut[_0x6b5b('0x4a')](_0x6b5b('0x4e'),_0x8573f9);})['finally'](function(){delete _0x4a6492[_0x6b5b('0xe')][_0xffaab9];delete _0x4a6492[_0x6b5b('0x29')][_0xffaab9];});}else{ut[_0x6b5b('0x4a')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0xffaab9];delete this[_0x6b5b('0x29')][_0xffaab9];}};Fax['prototype']['syncHangup']=function(_0x43efc8){var _0x2e991a=this;if(this['channels'][_0x43efc8[_0x6b5b('0x25')]]){if(this[_0x6b5b('0x29')][_0x43efc8[_0x6b5b('0x25')]]){this[_0x6b5b('0xe')][_0x43efc8['uniqueid']]['id']=this[_0x6b5b('0x29')][_0x43efc8[_0x6b5b('0x25')]]['id'];this[_0x6b5b('0xe')][_0x43efc8[_0x6b5b('0x25')]][_0x6b5b('0x27')]=this[_0x6b5b('0x29')][_0x43efc8['uniqueid']]['name'];}logger[_0x6b5b('0x28')](_0x43efc8[_0x6b5b('0x25')],this['actions'][_0x43efc8[_0x6b5b('0x25')]]?_0x6b5b('0x4f'):_0x6b5b('0x50'),JSON[_0x6b5b('0x40')](this['channels'][_0x43efc8[_0x6b5b('0x25')]]));if(this[_0x6b5b('0x29')][_0x43efc8[_0x6b5b('0x25')]]){if(this[_0x6b5b('0xe')][_0x43efc8['uniqueid']][_0x6b5b('0x51')]>0x0&&this['channels'][_0x43efc8[_0x6b5b('0x25')]][_0x6b5b('0x1a')]===_0x6b5b('0x52')){this['updateStatus'](_0x43efc8[_0x6b5b('0x25')],!![]);}else{this['updateStatus'](_0x43efc8['uniqueid'],![],this[_0x6b5b('0xe')][_0x43efc8[_0x6b5b('0x25')]][_0x6b5b('0x53')]?_0x6b5b('0x54')+this[_0x6b5b('0xe')][_0x43efc8[_0x6b5b('0x25')]]['faxstatusstring']:_0x6b5b('0x55'));}}}};Fax[_0x6b5b('0x21')][_0x6b5b('0x56')]=function(_0x4171cc){var _0x3d4333=this;return new BPromise(function(_0x3d37ca,_0x2aef44){_0x3d4333[_0x6b5b('0x57')](_0x4171cc,_0x3d4333[_0x6b5b('0xf')][_0x4171cc[_0x6b5b('0x58')]])[_0x6b5b('0x48')](function(_0x5c7c49){ut['logger']('[Fax][execOriginate][success]',_0x5c7c49);_0x3d37ca(ut['message'](_0x6b5b('0x59')));})[_0x6b5b('0x3e')](function(_0x20cfa4){ut[_0x6b5b('0x4a')](_0x6b5b('0x5a'),_0x20cfa4);updateStatus(_0x4171cc);_0x2aef44(ut[_0x6b5b('0x38')](_0x6b5b('0x5b')));});});};Fax[_0x6b5b('0x21')]['checkAfterSend']=function(_0x34ffd5){var _0x59e865=this;return new BPromise(function(_0x4d361a,_0x457f10){var _0x531f73=_0x59e865[_0x6b5b('0x5c')](_0x59e865[_0x6b5b('0xf')][_0x34ffd5[_0x6b5b('0x58')]][_0x6b5b('0x5d')],_0x34ffd5);if(_0x531f73[_0x6b5b('0x5e')]){_0x4d361a(ut['message'](_0x6b5b('0x5f')));}else{_0x457f10(ut[_0x6b5b('0x38')](_0x531f73[_0x6b5b('0x38')]));}});};function originate(_0xf4898e,_0x45b67e,_0x1bd14a){return new BPromise(function(_0x4d742a,_0x1943a8){if(_0x1bd14a){var _0x161afa=util[_0x6b5b('0x60')](_0x6b5b('0x61'),path[_0x6b5b('0x3a')](_0xf4898e[_0x6b5b('0x3')])[_0x6b5b('0x27')],_0xf4898e[_0x6b5b('0x3')]);gs[_0x6b5b('0x62')](_0x161afa)[_0x6b5b('0x48')](function(){_0xf4898e[_0x6b5b('0x3')]=util[_0x6b5b('0x60')](_0x6b5b('0x63'),path[_0x6b5b('0x3a')](_0xf4898e[_0x6b5b('0x3')])[_0x6b5b('0x64')],path[_0x6b5b('0x3a')](_0xf4898e[_0x6b5b('0x3')])[_0x6b5b('0x27')]);_0x45b67e[_0x6b5b('0x65')]=_0xf4898e[_0x6b5b('0x3')];ut[_0x6b5b('0x4a')](_0x6b5b('0x66'),'');ami[_0x6b5b('0x67')](ut[_0x6b5b('0x68')](_0xf4898e,_0x45b67e))[_0x6b5b('0x48')](function(_0x549a9e){_0x4d742a(_0x549a9e);})[_0x6b5b('0x3e')](function(_0x261639){_0x1943a8(_0x261639);});})[_0x6b5b('0x3e')](function(_0x23bc3f){_0x1943a8(_0x23bc3f);});}else{ami[_0x6b5b('0x67')](ut['variablesAction'](_0xf4898e,_0x45b67e))[_0x6b5b('0x48')](function(_0x33f33b){_0x4d742a(_0x33f33b);})['catch'](function(_0x466ba5){_0x1943a8(_0x466ba5);});}});}Fax[_0x6b5b('0x21')][_0x6b5b('0x57')]=function(_0x5b47c9,_0x124822){var _0x20ec67=this;return new BPromise(function(_0x4d6220,_0x3c8338){var _0x201377=uuid['v4']();var _0x3122df=ut['addVariables'](_0x5b47c9,_0x124822);_0x20ec67[_0x6b5b('0x29')][_0x201377]=new Action(_0x201377,_0x124822,_0x5b47c9);var _0x21c2de=_0x20ec67[_0x6b5b('0x29')][_0x201377];if(path[_0x6b5b('0x3a')](_0x5b47c9[_0x6b5b('0x3')])[_0x6b5b('0x69')]==='.pdf'){originate(_0x21c2de,_0x3122df,!![])[_0x6b5b('0x48')](function(_0x192b65){_0x4d6220(_0x192b65);})[_0x6b5b('0x3e')](function(_0x3e8a0d){_0x3c8338(_0x3e8a0d);});}else{originate(_0x21c2de,_0x3122df,![])['then'](function(_0x66ba09){_0x4d6220(_0x66ba09);})[_0x6b5b('0x3e')](function(_0x52b356){_0x3c8338(_0x52b356);});}});};Fax[_0x6b5b('0x21')]['isTrunkReachable']=function(_0x2b01f2){return!_[_0x6b5b('0x6a')](_0x2b01f2)&&!_['isNil'](_0x2b01f2[_0x6b5b('0x27')])&&!_[_0x6b5b('0x6a')](_0x2b01f2['active'])&&_0x2b01f2[_0x6b5b('0x6b')]&&!_[_0x6b5b('0x6a')](this[_0x6b5b('0x10')][util[_0x6b5b('0x60')]('SIP/%s',_0x2b01f2['name'])])&&!_['isNil'](this[_0x6b5b('0x10')][util[_0x6b5b('0x60')](_0x6b5b('0x6c'),_0x2b01f2[_0x6b5b('0x27')])][_0x6b5b('0x6d')])&&(this['trunks'][util[_0x6b5b('0x60')](_0x6b5b('0x6c'),_0x2b01f2[_0x6b5b('0x27')])][_0x6b5b('0x6d')]===_0x6b5b('0x6e')||this[_0x6b5b('0x10')][util[_0x6b5b('0x60')](_0x6b5b('0x6c'),_0x2b01f2[_0x6b5b('0x27')])][_0x6b5b('0x6d')]===_0x6b5b('0x6f'));};Fax['prototype'][_0x6b5b('0x5c')]=function(_0x2e06c3,_0x4c330c){if(!this[_0x6b5b('0x70')](_0x2e06c3)){ut['logger'](_0x6b5b('0x71'),_['isNil'](_0x2e06c3)?'':_0x2e06c3[_0x6b5b('0x27')]+_0x6b5b('0x72'));return{'isValid':![],'message':_0x6b5b('0x73')};}if(_['isNil'](_0x4c330c[_0x6b5b('0x6')])){ut[_0x6b5b('0x4a')](_0x6b5b('0x74'),JSON[_0x6b5b('0x40')](_0x4c330c));return{'isValid':![],'message':_0x6b5b('0x75')};}if(_['isNil'](_0x4c330c[_0x6b5b('0x3')])){ut['logger'](_0x6b5b('0x76'),JSON[_0x6b5b('0x40')](_0x4c330c));return{'isValid':![],'message':_0x6b5b('0x77')};}return{'isValid':!![],'message':'Is\x20Valid'};};module['exports']=Fax; \ No newline at end of file +var _0x97d1=['actions','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','context','from-voip-provider','hasOwnProperty','exten','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','update','AttachmentId','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isNil','active','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks'];(function(_0x441d10,_0x3f6cae){var _0x36dda3=function(_0x2b21bc){while(--_0x2b21bc){_0x441d10['push'](_0x441d10['shift']());}};_0x36dda3(++_0x3f6cae);}(_0x97d1,0x67));var _0x197d=function(_0x105a8a,_0x15a3a2){_0x105a8a=_0x105a8a-0x0;var _0x105a0e=_0x97d1[_0x105a8a];return _0x105a0e;};'use strict';var util=require(_0x197d('0x0'));var _=require(_0x197d('0x1'));var BPromise=require(_0x197d('0x2'));var uuid=require(_0x197d('0x3'));var moment=require(_0x197d('0x4'));var path=require(_0x197d('0x5'));var tiff2pdf=require(_0x197d('0x6'));var gs=require(_0x197d('0x7'));var logger=require(_0x197d('0x8'))(_0x197d('0x9'));var ami=require(_0x197d('0xa'));var rpcDb=require(_0x197d('0xb'));var Channel=require(_0x197d('0xc'));var ut=require(_0x197d('0xd'));var Action=require(_0x197d('0xe'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x197d('0xf'));var faxMessage=require(_0x197d('0x10'));function Fax(_0x393286){this['channels']={};this[_0x197d('0x11')]=_0x393286[_0x197d('0x11')];this[_0x197d('0x12')]=_0x393286['trunks'];this[_0x197d('0x13')]={};ami['on']('newchannel',this[_0x197d('0x14')][_0x197d('0x15')](this));ami['on'](_0x197d('0x16'),this['syncVarSet']['bind'](this));ami['on'](_0x197d('0x17'),this[_0x197d('0x18')]['bind'](this));ami['on'](_0x197d('0x19'),this[_0x197d('0x1a')][_0x197d('0x15')](this));ami['on']('faxstatus',this[_0x197d('0x1b')][_0x197d('0x15')](this));ami['on'](_0x197d('0x1c'),this[_0x197d('0x1d')][_0x197d('0x15')](this));ami['on'](_0x197d('0x1e'),this[_0x197d('0x1f')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse']['bind'](this));}Fax[_0x197d('0x20')]['syncNewchannel']=function(_0x4829bf){if(_0x4829bf[_0x197d('0x21')]===_0x197d('0x22')){for(var _0x454251 in this['faxAccounts']){if(this[_0x197d('0x11')][_0x197d('0x23')](_0x454251)){if(_0x4829bf[_0x197d('0x24')]===this[_0x197d('0x11')][_0x454251]['localstationid']){this[_0x197d('0x25')][_0x4829bf['uniqueid']]={};this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]][_0x197d('0x27')]=_0x4829bf['channel'];this['channels'][_0x4829bf[_0x197d('0x26')]]['id']=this[_0x197d('0x11')][_0x454251]['id'];this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]][_0x197d('0x28')]=this['faxAccounts'][_0x454251]['name'];logger['info'](_0x4829bf[_0x197d('0x26')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x4829bf[_0x197d('0x26')]]){this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]]={};this[_0x197d('0x25')][_0x4829bf[_0x197d('0x26')]]['channel']=_0x4829bf[_0x197d('0x27')];logger[_0x197d('0x29')](_0x4829bf[_0x197d('0x26')],_0x197d('0x2a'));}};Fax['prototype'][_0x197d('0x2b')]=function(_0x541b02){if(this[_0x197d('0x25')][_0x541b02[_0x197d('0x26')]]){for(var _0x259179 in _0x541b02['variable']){if(_0x541b02[_0x197d('0x2c')][_0x197d('0x23')](_0x259179)){this[_0x197d('0x25')][_0x541b02[_0x197d('0x26')]][_0x259179]=_0x541b02['value'];}}}};Fax[_0x197d('0x20')][_0x197d('0x18')]=function(_0xb600c4){if(this[_0x197d('0x25')][_0xb600c4[_0x197d('0x26')]]){this[_0x197d('0x25')][_0xb600c4[_0x197d('0x26')]][_0x197d('0x2d')]=_0xb600c4['channelstate'];this[_0x197d('0x25')][_0xb600c4['uniqueid']][_0x197d('0x2e')]=_0xb600c4['channelstatedesc'];}};Fax[_0x197d('0x20')][_0x197d('0x1a')]=function(_0x35139f){if(this[_0x197d('0x25')][_0x35139f['uniqueid']]){for(var _0x34f694 in _0x35139f[_0x197d('0x2c')]){if(_0x35139f[_0x197d('0x2c')][_0x197d('0x23')](_0x34f694)){this[_0x197d('0x25')][_0x35139f['uniqueid']][_0x34f694]=_0x35139f[_0x197d('0x2f')];}}}};Fax[_0x197d('0x20')][_0x197d('0x1b')]=function(_0x25d7d7){if(this[_0x197d('0x25')][_0x25d7d7['uniqueid']]){this['channels'][_0x25d7d7[_0x197d('0x26')]][_0x197d('0x30')]=_0x25d7d7[_0x197d('0x30')];this[_0x197d('0x25')][_0x25d7d7['uniqueid']]['status']=_0x25d7d7[_0x197d('0x31')];this[_0x197d('0x25')][_0x25d7d7[_0x197d('0x26')]]['localstationid']=_0x25d7d7[_0x197d('0x32')];this['channels'][_0x25d7d7[_0x197d('0x26')]][_0x197d('0x33')]=_0x25d7d7['filename'];logger[_0x197d('0x29')](_0x25d7d7[_0x197d('0x26')],_0x197d('0x34'));}};Fax[_0x197d('0x20')][_0x197d('0x1d')]=function(_0x6dc998){var _0x1435f7=this;if(this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]]){var _0xf53879=this['channels'][_0x6dc998['uniqueid']]['id'];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]]['remotestationid']=_0x6dc998[_0x197d('0x35')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x36')]=_0x6dc998[_0x197d('0x36')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x32')]=_0x6dc998[_0x197d('0x32')];this['channels'][_0x6dc998['uniqueid']]['resolution']=_0x6dc998[_0x197d('0x37')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x38')]=_0x6dc998[_0x197d('0x38')];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x33')]=_0x6dc998['filename'];this[_0x197d('0x25')][_0x6dc998[_0x197d('0x26')]][_0x197d('0x39')]=_0x6dc998['calleridnum'];if(this['channels'][_0x6dc998[_0x197d('0x26')]][_0x197d('0x36')]>0x0){tiff2pdf(_0x6dc998[_0x197d('0x33')],_0x197d('0x3a'),function(_0x3d15fa){logger[_0x197d('0x29')](_0x6dc998[_0x197d('0x26')],'\x20result\x20conversion\x20file\x20',_0x3d15fa[_0x197d('0x3b')]);attachment[_0x197d('0x3c')]({'name':path[_0x197d('0x3d')](_0x6dc998[_0x197d('0x33')])[_0x197d('0x28')],'basename':path[_0x197d('0x3d')](_0x6dc998['filename'])[_0x197d('0x28')]+_0x197d('0x3e'),'type':_0x197d('0x3f')})[_0x197d('0x40')](function(_0x5a35ec){faxAccount['notify'](_0xf53879,{'from':_0x6dc998[_0x197d('0x39')],'mapKey':_0x197d('0x9'),'body':path[_0x197d('0x3d')](_0x6dc998[_0x197d('0x33')])[_0x197d('0x28')]+_0x197d('0x3e'),'AttachmentId':_0x5a35ec['id']})[_0x197d('0x41')](function(_0x15db2b){logger[_0x197d('0x42')](_0x6dc998[_0x197d('0x26')],_0x197d('0x43'),JSON[_0x197d('0x44')](_0x15db2b));});})[_0x197d('0x41')](function(_0x435b9a){logger['error'](_0x6dc998['uniqueid'],_0x197d('0x45'),JSON[_0x197d('0x44')](_0x435b9a));});});}logger[_0x197d('0x29')](_0x6dc998[_0x197d('0x26')],'\x20receiveFax\x20');}};Fax['prototype'][_0x197d('0x46')]=function(_0x49ac9e){if(this[_0x197d('0x13')][_0x49ac9e[_0x197d('0x26')]]){_[_0x197d('0x47')](this[_0x197d('0x25')][_0x49ac9e[_0x197d('0x26')]],_[_0x197d('0x48')](_0x49ac9e,[_0x197d('0x49'),_0x197d('0x4a')]));}};function updateStatus(_0x440e0c){if(_0x440e0c['AttachmentId']){faxMessage[_0x197d('0x4b')](_0x440e0c[_0x197d('0x4c')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x197d('0x40')](function(_0x454a3c){ut[_0x197d('0x4d')](_0x197d('0x4e'),_0x454a3c);})[_0x197d('0x41')](function(_0x3d3d5c){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x3d3d5c);});}else{ut[_0x197d('0x4d')](_0x197d('0x4f'));}}Fax[_0x197d('0x20')]['updateStatus']=function(_0x2e3152,_0x1de8e0,_0x5b5b76){var _0x477660=this;var _0x285865={};if(_0x1de8e0){_0x285865={'read':_0x1de8e0};}else{_0x285865={'failMessage':_0x5b5b76};}if(this['actions'][_0x2e3152][_0x197d('0x4c')]){faxMessage['update'](this[_0x197d('0x13')][_0x2e3152][_0x197d('0x4c')],_0x285865)[_0x197d('0x40')](function(_0x2f196e){ut['logger'](_0x197d('0x50'),_0x2f196e);})[_0x197d('0x41')](function(_0x372f5f){ut[_0x197d('0x4d')](_0x197d('0x51'),_0x372f5f);})[_0x197d('0x52')](function(){delete _0x477660[_0x197d('0x25')][_0x2e3152];delete _0x477660[_0x197d('0x13')][_0x2e3152];});}else{ut[_0x197d('0x4d')]('[Fax][Message][NoUpdate2]');delete this[_0x197d('0x25')][_0x2e3152];delete this['actions'][_0x2e3152];}};Fax['prototype']['syncHangup']=function(_0x4d16ef){var _0x30911=this;if(this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]){if(this[_0x197d('0x13')][_0x4d16ef['uniqueid']]){this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]['id']=this[_0x197d('0x13')][_0x4d16ef[_0x197d('0x26')]]['id'];this['channels'][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x28')]=this[_0x197d('0x13')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x28')];}logger[_0x197d('0x29')](_0x4d16ef[_0x197d('0x26')],this[_0x197d('0x13')][_0x4d16ef['uniqueid']]?_0x197d('0x53'):'\x20hangup\x20faxRiceive\x20',JSON[_0x197d('0x44')](this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]));if(this['actions'][_0x4d16ef['uniqueid']]){if(this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x54')]>0x0&&this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]]['faxstatus']==='SUCCESS'){this[_0x197d('0x55')](_0x4d16ef[_0x197d('0x26')],!![]);}else{this[_0x197d('0x55')](_0x4d16ef[_0x197d('0x26')],![],this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x56')]?_0x197d('0x57')+this[_0x197d('0x25')][_0x4d16ef[_0x197d('0x26')]][_0x197d('0x56')]:_0x197d('0x58'));}}}};Fax[_0x197d('0x20')][_0x197d('0x59')]=function(_0x20c28b){var _0x380488=this;return new BPromise(function(_0x4cc7df,_0x2b339e){_0x380488[_0x197d('0x5a')](_0x20c28b,_0x380488['faxAccounts'][_0x20c28b['FaxAccountId']])[_0x197d('0x40')](function(_0x4e1d2c){ut['logger']('[Fax][execOriginate][success]',_0x4e1d2c);_0x4cc7df(ut[_0x197d('0x3b')](_0x197d('0x5b')));})[_0x197d('0x41')](function(_0x43aa08){ut[_0x197d('0x4d')](_0x197d('0x5c'),_0x43aa08);updateStatus(_0x20c28b);_0x2b339e(ut[_0x197d('0x3b')](_0x197d('0x5d')));});});};Fax['prototype'][_0x197d('0x5e')]=function(_0x58d83a){var _0x6269e7=this;return new BPromise(function(_0x5444cc,_0x1294dd){var _0x59978c=_0x6269e7[_0x197d('0x5f')](_0x6269e7[_0x197d('0x11')][_0x58d83a[_0x197d('0x60')]][_0x197d('0x61')],_0x58d83a);if(_0x59978c[_0x197d('0x62')]){_0x5444cc(ut[_0x197d('0x3b')](_0x197d('0x63')));}else{_0x1294dd(ut[_0x197d('0x3b')](_0x59978c['message']));}});};function originate(_0x270e55,_0x4cf19f,_0x29870b){return new BPromise(function(_0x2fc3cb,_0x2cc7c9){if(_0x29870b){var _0x5a5df9=util[_0x197d('0x64')](_0x197d('0x65'),path[_0x197d('0x3d')](_0x270e55[_0x197d('0x5')])[_0x197d('0x28')],_0x270e55['path']);gs[_0x197d('0x66')](_0x5a5df9)[_0x197d('0x40')](function(){_0x270e55[_0x197d('0x5')]=util[_0x197d('0x64')](_0x197d('0x67'),path['parse'](_0x270e55[_0x197d('0x5')])[_0x197d('0x68')],path[_0x197d('0x3d')](_0x270e55[_0x197d('0x5')])['name']);_0x4cf19f[_0x197d('0x69')]=_0x270e55[_0x197d('0x5')];ut[_0x197d('0x4d')](_0x197d('0x6a'),'');ami[_0x197d('0x6b')](ut['variablesAction'](_0x270e55,_0x4cf19f))[_0x197d('0x40')](function(_0x35e506){_0x2fc3cb(_0x35e506);})[_0x197d('0x41')](function(_0x171737){_0x2cc7c9(_0x171737);});})[_0x197d('0x41')](function(_0x17900a){_0x2cc7c9(_0x17900a);});}else{ami[_0x197d('0x6b')](ut[_0x197d('0x6c')](_0x270e55,_0x4cf19f))[_0x197d('0x40')](function(_0x6e84ed){_0x2fc3cb(_0x6e84ed);})[_0x197d('0x41')](function(_0x243ada){_0x2cc7c9(_0x243ada);});}});}Fax[_0x197d('0x20')]['execOriginate']=function(_0x5426e7,_0x2fd9c7){var _0x78cffc=this;return new BPromise(function(_0x2d5cac,_0x4e8273){var _0x3756ef=uuid['v4']();var _0x147abf=ut[_0x197d('0x6d')](_0x5426e7,_0x2fd9c7);_0x78cffc[_0x197d('0x13')][_0x3756ef]=new Action(_0x3756ef,_0x2fd9c7,_0x5426e7);var _0x4fc20b=_0x78cffc[_0x197d('0x13')][_0x3756ef];if(path['parse'](_0x5426e7[_0x197d('0x5')])['ext']===_0x197d('0x3e')){originate(_0x4fc20b,_0x147abf,!![])[_0x197d('0x40')](function(_0x3296f0){_0x2d5cac(_0x3296f0);})[_0x197d('0x41')](function(_0x350eae){_0x4e8273(_0x350eae);});}else{originate(_0x4fc20b,_0x147abf,![])[_0x197d('0x40')](function(_0xc2ed93){_0x2d5cac(_0xc2ed93);})[_0x197d('0x41')](function(_0x5c7de0){_0x4e8273(_0x5c7de0);});}});};Fax[_0x197d('0x20')]['isTrunkReachable']=function(_0x5d6ec2){return!_[_0x197d('0x6e')](_0x5d6ec2)&&!_['isNil'](_0x5d6ec2[_0x197d('0x28')])&&!_['isNil'](_0x5d6ec2[_0x197d('0x6f')])&&_0x5d6ec2[_0x197d('0x6f')]&&!_[_0x197d('0x6e')](this['trunks'][util[_0x197d('0x64')](_0x197d('0x70'),_0x5d6ec2['name'])])&&!_[_0x197d('0x6e')](this[_0x197d('0x12')][util[_0x197d('0x64')]('SIP/%s',_0x5d6ec2['name'])][_0x197d('0x31')])&&(this[_0x197d('0x12')][util[_0x197d('0x64')](_0x197d('0x70'),_0x5d6ec2[_0x197d('0x28')])][_0x197d('0x31')]===_0x197d('0x71')||this[_0x197d('0x12')][util[_0x197d('0x64')](_0x197d('0x70'),_0x5d6ec2[_0x197d('0x28')])][_0x197d('0x31')]==='unmonitored');};Fax[_0x197d('0x20')][_0x197d('0x5f')]=function(_0x41d85e,_0x11737c){if(!this[_0x197d('0x72')](_0x41d85e)){ut[_0x197d('0x4d')](_0x197d('0x73'),_[_0x197d('0x6e')](_0x41d85e)?'':_0x41d85e['name']+_0x197d('0x74'));return{'isValid':![],'message':_0x197d('0x75')};}if(_['isNil'](_0x11737c['fax'])){ut[_0x197d('0x4d')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x11737c));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x11737c[_0x197d('0x5')])){ut[_0x197d('0x4d')](_0x197d('0x76'),JSON[_0x197d('0x44')](_0x11737c));return{'isValid':![],'message':_0x197d('0x77')};}return{'isValid':!![],'message':_0x197d('0x78')};};module[_0x197d('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 0f2d9d7..47d7b04 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 _0x1722=['bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20','util'];(function(_0x373614,_0x158596){var _0x4d66bb=function(_0xa40031){while(--_0xa40031){_0x373614['push'](_0x373614['shift']());}};_0x4d66bb(++_0x158596);}(_0x1722,0x17f));var _0x2172=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x1722[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0x2172('0x0'));var BPromise=require(_0x2172('0x1'));var logger=require(_0x2172('0x2'))(_0x2172('0x3'));var _=require(_0x2172('0x4'));var faxAccount=require(_0x2172('0x5'));function loggerCatch(_0x514a94){return function(_0x5856af){logger[_0x2172('0x6')](_0x514a94,util['inspect'](_0x5856af,{'showHidden':![],'depth':null}));};}exports[_0x2172('0x7')]=function(_0x1fbc23,_0x120bb0){return BPromise[_0x2172('0x8')]()[_0x2172('0x9')](faxAccount[_0x2172('0x7')](_0x1fbc23,_0x120bb0))[_0x2172('0xa')](loggerCatch(_0x2172('0xb')));}; \ No newline at end of file +var _0xa94b=['catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa94b,0x6a));var _0xba94=function(_0x27da9e,_0x219cbd){_0x27da9e=_0x27da9e-0x0;var _0x110e7e=_0xa94b[_0x27da9e];return _0x110e7e;};'use strict';var util=require(_0xba94('0x0'));var BPromise=require(_0xba94('0x1'));var logger=require(_0xba94('0x2'))(_0xba94('0x3'));var _=require(_0xba94('0x4'));var faxAccount=require(_0xba94('0x5'));function loggerCatch(_0xb94aa2){return function(_0x48ed33){logger[_0xba94('0x6')](_0xb94aa2,util[_0xba94('0x7')](_0x48ed33,{'showHidden':![],'depth':null}));};}exports[_0xba94('0x8')]=function(_0x5644d3,_0x381801){return BPromise[_0xba94('0x9')]()[_0xba94('0xa')](faxAccount[_0xba94('0x8')](_0x5644d3,_0x381801))[_0xba94('0xb')](loggerCatch(_0xba94('0xc')));}; \ 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 118cb9c..e69abdf 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 _0xd58e=['info','Exec\x20gs','\x20Error\x20:','inspect','fax','bluebird','child_process','exec'];(function(_0x237b9f,_0x2d5a54){var _0x48f42d=function(_0x3f3a1c){while(--_0x3f3a1c){_0x237b9f['push'](_0x237b9f['shift']());}};_0x48f42d(++_0x2d5a54);}(_0xd58e,0x8c));var _0xed58=function(_0x454368,_0x320e8c){_0x454368=_0x454368-0x0;var _0x2f400b=_0xd58e[_0x454368];return _0x2f400b;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0xed58('0x0'));var BPromise=require(_0xed58('0x1'));var exec=require(_0xed58('0x2'))[_0xed58('0x3')];exports['execute']=function(_0x315fbd){return new BPromise(function(_0x140b66,_0x234124){exec(_0x315fbd,function(_0x21d5c8,_0x1ea98b,_0x18cb9d){logger[_0xed58('0x4')]('Exec\x20gs',_0x1ea98b);if(_0x21d5c8){logger[_0xed58('0x4')](_0xed58('0x5'),_0xed58('0x6'),util[_0xed58('0x7')](_0x21d5c8,{'showHidden':![],'depth':null}),_0x1ea98b,_0x18cb9d);_0x234124(_0x21d5c8);}_0x140b66(_0x1ea98b);});});}; \ No newline at end of file +var _0x59dc=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','execute','info','Exec\x20gs'];(function(_0x14f6db,_0x4d9f26){var _0x45344d=function(_0x44cace){while(--_0x44cace){_0x14f6db['push'](_0x14f6db['shift']());}};_0x45344d(++_0x4d9f26);}(_0x59dc,0x105));var _0xc59d=function(_0x15a2da,_0x545bf3){_0x15a2da=_0x15a2da-0x0;var _0x25a18a=_0x59dc[_0x15a2da];return _0x25a18a;};'use strict';var util=require(_0xc59d('0x0'));var logger=require(_0xc59d('0x1'))(_0xc59d('0x2'));var BPromise=require(_0xc59d('0x3'));var exec=require(_0xc59d('0x4'))[_0xc59d('0x5')];exports[_0xc59d('0x6')]=function(_0x2c7199){return new BPromise(function(_0x5c3f51,_0x4cc193){exec(_0x2c7199,function(_0x2cda44,_0x59b8f9,_0x30e64c){logger[_0xc59d('0x7')]('Exec\x20gs',_0x59b8f9);if(_0x2cda44){logger[_0xc59d('0x7')](_0xc59d('0x8'),'\x20Error\x20:',util[_0xc59d('0x9')](_0x2cda44,{'showHidden':![],'depth':null}),_0x59b8f9,_0x30e64c);_0x4cc193(_0x2cda44);}_0x5c3f51(_0x59b8f9);});});}; \ 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 9274ec0..97472ac 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 _0xf06f=['variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','headerinfo','minrate','maxrate','format','gateway','faxdetect','t38timeout','localstationid'];(function(_0x4f4e4b,_0x46ea73){var _0x23a628=function(_0x56791){while(--_0x56791){_0x4f4e4b['push'](_0x4f4e4b['shift']());}};_0x23a628(++_0x46ea73);}(_0xf06f,0x18d));var _0xff06=function(_0x471e5d,_0x1c1a99){_0x471e5d=_0x471e5d-0x0;var _0x4888b4=_0xf06f[_0x471e5d];return _0x4888b4;};'use strict';var util=require(_0xff06('0x0'));var _=require('lodash');var moment=require(_0xff06('0x1'));var logger=require(_0xff06('0x2'))(_0xff06('0x3'));exports[_0xff06('0x4')]=function(_0x3245c7){return{'message':_0x3245c7};};exports[_0xff06('0x5')]=function(_0xdece39,_0x2ef9cc){logger[_0xff06('0x6')](_0xdece39,util[_0xff06('0x7')](_0x2ef9cc,{'showHidden':![],'depth':null}));};exports[_0xff06('0x8')]=function(_0x29c99c,_0x4c325c){var _0x3c7b79={'XMF-ECM':_0x4c325c['ecm'],'XMF-HEADERINFO':_0x4c325c[_0xff06('0x9')],'XMF-MINRATE':_0x4c325c[_0xff06('0xa')],'XMF-MAXRATE':_0x4c325c[_0xff06('0xb')],'XMF-MODEM':util[_0xff06('0xc')]('\x22%s\x22',_0x4c325c['modem']),'XMF-GATEWAY':_0x4c325c[_0xff06('0xd')],'XMF-FAXDETECT':_0x4c325c[_0xff06('0xe')],'XMF-T38TIMEOUT':_0x4c325c[_0xff06('0xf')],'XMF-LOCALSTATIONID':_0x4c325c[_0xff06('0x10')],'XMF-PATH':_0x29c99c['path']};return _0x3c7b79;};exports[_0xff06('0x11')]=function(_0xba61a9,_0x150b11){return{'actionid':_0xba61a9[_0xff06('0x12')],'action':_0xff06('0x13'),'channel':_0xba61a9[_0xff06('0x14')],'Exten':'xcally-motion-fax','Context':_0xff06('0x15'),'Priority':'1','callerid':util['format'](_0xff06('0x16'),_0xba61a9['headerinfo']?_0xba61a9['headerinfo']:'',_0xba61a9[_0xff06('0x10')]),'variable':_0x150b11,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xba61a9[_0xff06('0x12')]};}; \ No newline at end of file +var _0xbee3=['uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','fax','logger','info','addVariables','ecm','maxrate','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path'];(function(_0x3a596d,_0x408752){var _0x42147e=function(_0x25cee8){while(--_0x25cee8){_0x3a596d['push'](_0x3a596d['shift']());}};_0x42147e(++_0x408752);}(_0xbee3,0x1ea));var _0x3bee=function(_0x498f45,_0x33a0d7){_0x498f45=_0x498f45-0x0;var _0x5dedf1=_0xbee3[_0x498f45];return _0x5dedf1;};'use strict';var util=require(_0x3bee('0x0'));var _=require(_0x3bee('0x1'));var moment=require(_0x3bee('0x2'));var logger=require('../../../../config/logger')(_0x3bee('0x3'));exports['message']=function(_0x20d41e){return{'message':_0x20d41e};};exports[_0x3bee('0x4')]=function(_0x19a838,_0x36ff33){logger[_0x3bee('0x5')](_0x19a838,util['inspect'](_0x36ff33,{'showHidden':![],'depth':null}));};exports[_0x3bee('0x6')]=function(_0x2257ea,_0x4e01ba){var _0x3f8e2a={'XMF-ECM':_0x4e01ba[_0x3bee('0x7')],'XMF-HEADERINFO':_0x4e01ba['headerinfo'],'XMF-MINRATE':_0x4e01ba['minrate'],'XMF-MAXRATE':_0x4e01ba[_0x3bee('0x8')],'XMF-MODEM':util['format'](_0x3bee('0x9'),_0x4e01ba[_0x3bee('0xa')]),'XMF-GATEWAY':_0x4e01ba[_0x3bee('0xb')],'XMF-FAXDETECT':_0x4e01ba[_0x3bee('0xc')],'XMF-T38TIMEOUT':_0x4e01ba[_0x3bee('0xd')],'XMF-LOCALSTATIONID':_0x4e01ba[_0x3bee('0xe')],'XMF-PATH':_0x2257ea[_0x3bee('0xf')]};return _0x3f8e2a;};exports['variablesAction']=function(_0x2233ee,_0x327de5){return{'actionid':_0x2233ee[_0x3bee('0x10')],'action':_0x3bee('0x11'),'channel':_0x2233ee[_0x3bee('0x12')],'Exten':_0x3bee('0x13'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x3bee('0x14'),_0x2233ee[_0x3bee('0x15')]?_0x2233ee[_0x3bee('0x15')]:'',_0x2233ee[_0x3bee('0xe')]),'variable':_0x327de5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2233ee[_0x3bee('0x10')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 782f46f..0fc9e94 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 _0x577a=['initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./report','./acw','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','initTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts'];(function(_0x59317e,_0xc7f932){var _0x17e657=function(_0x47d7e1){while(--_0x47d7e1){_0x59317e['push'](_0x59317e['shift']());}};_0x17e657(++_0xc7f932);}(_0x577a,0x13a));var _0xa577=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x577a[_0x29d915];return _0x160f86;};'use strict';var BPromise=require(_0xa577('0x0'));var util=require(_0xa577('0x1'));var moment=require(_0xa577('0x2'));var server=require('./server');var Realtime=require('./realtime');var Report=require(_0xa577('0x3'));var Acw=require(_0xa577('0x4'));var Trigger=require('./trigger');var Dialer=require(_0xa577('0x5'));var Preview=require('./preview');var Fax=require(_0xa577('0x6'));var user=require(_0xa577('0x7'));var voiceQueue=require(_0xa577('0x8'));var voiceQueueReport=require(_0xa577('0x9'));var voiceCallReport=require(_0xa577('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0xa577('0xb'));var template=require(_0xa577('0xc'));var cmHopperHistory=require(_0xa577('0xd'));var campaign=require(_0xa577('0xe'));var voiceExtension=require(_0xa577('0xf'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xa577('0x10'));var salesforce=require(_0xa577('0x11'));var sugarcrm=require(_0xa577('0x12'));var freshdesk=require(_0xa577('0x13'));var desk=require(_0xa577('0x14'));var zoho=require(_0xa577('0x15'));var vtiger=require(_0xa577('0x16'));var freshsales=require(_0xa577('0x17'));var servicenow=require(_0xa577('0x18'));var dynamics365=require(_0xa577('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xa577('0x1a')](_0xa577('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xa577('0x1a')](_0xa577('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xa577('0x1c')](user['getAgents']())[_0xa577('0x1c')](realtime[_0xa577('0x1d')]())['then'](user[_0xa577('0x1e')]())['then'](realtime[_0xa577('0x1f')]())[_0xa577('0x1c')](trunk[_0xa577('0x20')]())[_0xa577('0x1c')](realtime[_0xa577('0x21')]())[_0xa577('0x1c')](voiceQueue[_0xa577('0x22')]())['then'](realtime[_0xa577('0x23')]())[_0xa577('0x1c')](trigger['getTriggers']())[_0xa577('0x1c')](realtime[_0xa577('0x24')]())[_0xa577('0x1c')](template['getTemplates']())['then'](realtime[_0xa577('0x25')]())['then'](zendesk[_0xa577('0x26')]())[_0xa577('0x1c')](realtime[_0xa577('0x27')]())[_0xa577('0x1c')](salesforce[_0xa577('0x28')]())[_0xa577('0x1c')](realtime[_0xa577('0x29')]())[_0xa577('0x1c')](sugarcrm[_0xa577('0x2a')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xa577('0x2b')]())['then'](realtime[_0xa577('0x2c')]())[_0xa577('0x1c')](desk[_0xa577('0x2d')]())[_0xa577('0x1c')](realtime['initDeskAccounts']())['then'](zoho[_0xa577('0x2e')]())[_0xa577('0x1c')](realtime[_0xa577('0x2f')]())[_0xa577('0x1c')](vtiger[_0xa577('0x30')]())['then'](realtime[_0xa577('0x31')]())['then'](freshsales[_0xa577('0x32')]())['then'](realtime[_0xa577('0x33')]())['then'](servicenow[_0xa577('0x34')]())[_0xa577('0x1c')](realtime[_0xa577('0x35')]())[_0xa577('0x1c')](dynamics365[_0xa577('0x36')]())[_0xa577('0x1c')](realtime[_0xa577('0x37')]())[_0xa577('0x1c')](campaign[_0xa577('0x38')]())[_0xa577('0x1c')](realtime[_0xa577('0x39')]())['then'](voiceExtension[_0xa577('0x3a')]())['then'](realtime[_0xa577('0x3b')]())['then'](faxAccount[_0xa577('0x3c')]())[_0xa577('0x1c')](realtime['initFaxAccounts']())[_0xa577('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0xa577('0x3d')]()[_0xa577('0x1c')](voiceQueueReport[_0xa577('0x3e')]())[_0xa577('0x1c')](realtime[_0xa577('0x3f')]())[_0xa577('0x1c')](cmHopperHistory[_0xa577('0x40')]())[_0xa577('0x1c')](realtime[_0xa577('0x41')]())[_0xa577('0x1c')](cmHopperHistory[_0xa577('0x42')]())[_0xa577('0x1c')](realtime[_0xa577('0x43')]())['then'](voiceCallReport[_0xa577('0x44')]())['then'](realtime['initVoiceCallReports']())[_0xa577('0x1c')](function(_0x3957bd){})[_0xa577('0x45')](function(_0x56520c){console[_0xa577('0x46')](_0x56520c);});}function main(){return server[_0xa577('0x47')](realtime,preview,fax)['then'](function(_0x3b8473){return initRealtime();})[_0xa577('0x1c')](function(){return initParams();})[_0xa577('0x1c')](function(){report[_0xa577('0x48')]();setInterval(initRealtime,0x1388);})[_0xa577('0x45')](function(_0x5c19c4){console[_0xa577('0x46')](_0x5c19c4);});}main(); \ No newline at end of file +var _0x4da9=['getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts'];(function(_0x1f29b2,_0x1db7a2){var _0x1c8c2f=function(_0x2ad5b0){while(--_0x2ad5b0){_0x1f29b2['push'](_0x1f29b2['shift']());}};_0x1c8c2f(++_0x1db7a2);}(_0x4da9,0x158));var _0x94da=function(_0x78937a,_0x45058b){_0x78937a=_0x78937a-0x0;var _0xd5e2e9=_0x4da9[_0x78937a];return _0xd5e2e9;};'use strict';var BPromise=require(_0x94da('0x0'));var util=require(_0x94da('0x1'));var moment=require(_0x94da('0x2'));var server=require(_0x94da('0x3'));var Realtime=require(_0x94da('0x4'));var Report=require(_0x94da('0x5'));var Acw=require(_0x94da('0x6'));var Trigger=require(_0x94da('0x7'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x94da('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x94da('0x9'));var voiceCallReport=require(_0x94da('0xa'));var trunk=require('./rpc/trunk');var trigger=require(_0x94da('0xb'));var template=require(_0x94da('0xc'));var cmHopperHistory=require(_0x94da('0xd'));var campaign=require(_0x94da('0xe'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x94da('0xf'));var zendesk=require(_0x94da('0x10'));var salesforce=require(_0x94da('0x11'));var sugarcrm=require(_0x94da('0x12'));var freshdesk=require(_0x94da('0x13'));var desk=require(_0x94da('0x14'));var zoho=require(_0x94da('0x15'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x94da('0x16'));var servicenow=require(_0x94da('0x17'));var dynamics365=require(_0x94da('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x94da('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x94da('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x94da('0x1a')](user[_0x94da('0x1b')]())['then'](realtime[_0x94da('0x1c')]())[_0x94da('0x1a')](user[_0x94da('0x1d')]())[_0x94da('0x1a')](realtime[_0x94da('0x1e')]())['then'](trunk[_0x94da('0x1f')]())['then'](realtime[_0x94da('0x20')]())['then'](voiceQueue[_0x94da('0x21')]())[_0x94da('0x1a')](realtime['initVoiceQueues']())[_0x94da('0x1a')](trigger['getTriggers']())[_0x94da('0x1a')](realtime['initTriggers']())['then'](template[_0x94da('0x22')]())[_0x94da('0x1a')](realtime[_0x94da('0x23')]())['then'](zendesk['getZendeskAccounts']())[_0x94da('0x1a')](realtime[_0x94da('0x24')]())[_0x94da('0x1a')](salesforce[_0x94da('0x25')]())[_0x94da('0x1a')](realtime[_0x94da('0x26')]())[_0x94da('0x1a')](sugarcrm[_0x94da('0x27')]())['then'](realtime['initSugarcrmAccounts']())['then'](freshdesk['getFreshdeskAccounts']())[_0x94da('0x1a')](realtime['initFreshdeskAccounts']())[_0x94da('0x1a')](desk[_0x94da('0x28')]())[_0x94da('0x1a')](realtime[_0x94da('0x29')]())[_0x94da('0x1a')](zoho['getZohoAccounts']())[_0x94da('0x1a')](realtime[_0x94da('0x2a')]())[_0x94da('0x1a')](vtiger[_0x94da('0x2b')]())[_0x94da('0x1a')](realtime[_0x94da('0x2c')]())[_0x94da('0x1a')](freshsales[_0x94da('0x2d')]())['then'](realtime[_0x94da('0x2e')]())[_0x94da('0x1a')](servicenow[_0x94da('0x2f')]())['then'](realtime[_0x94da('0x30')]())[_0x94da('0x1a')](dynamics365[_0x94da('0x31')]())[_0x94da('0x1a')](realtime['initDynamics365Accounts']())[_0x94da('0x1a')](campaign[_0x94da('0x32')]())[_0x94da('0x1a')](realtime['initCampaigns']())[_0x94da('0x1a')](voiceExtension[_0x94da('0x33')]())[_0x94da('0x1a')](realtime['initVoiceExtensions']())[_0x94da('0x1a')](faxAccount[_0x94da('0x34')]())[_0x94da('0x1a')](realtime[_0x94da('0x35')]())[_0x94da('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x94da('0x36')]()[_0x94da('0x1a')](voiceQueueReport[_0x94da('0x37')]())[_0x94da('0x1a')](realtime[_0x94da('0x38')]())[_0x94da('0x1a')](cmHopperHistory[_0x94da('0x39')]())['then'](realtime[_0x94da('0x3a')]())[_0x94da('0x1a')](cmHopperHistory[_0x94da('0x3b')]())[_0x94da('0x1a')](realtime[_0x94da('0x3c')]())[_0x94da('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x94da('0x1a')](realtime[_0x94da('0x3d')]())[_0x94da('0x1a')](function(_0x56c975){})['catch'](function(_0x311d3b){console['log'](_0x311d3b);});}function main(){return server['listen'](realtime,preview,fax)[_0x94da('0x1a')](function(_0x331af4){return initRealtime();})['then'](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x94da('0x3e')](function(_0x15f241){console[_0x94da('0x3f')](_0x15f241);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index c290eb5..3430ea6 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 _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0xdd5d91,_0x1302f4){var _0x32b60f=function(_0x309353){while(--_0x309353){_0xdd5d91['push'](_0xdd5d91['shift']());}};_0x32b60f(++_0x1302f4);}(_0x70e0,0x17b));var _0x070e=function(_0x498c78,_0x2eab48){_0x498c78=_0x498c78-0x0;var _0xb7697f=_0x70e0[_0x498c78];return _0xb7697f;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0xcb91=['name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusQueue','onhold','local','updateStatusRealtime','state','idle','inuse','talking','statePause','voiceStatusTime','toNumber','voiceStatusCallerIdNumber','stringify','format','emit','user:presence','exports','moment','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter'];(function(_0x5563de,_0x3590a5){var _0x5ca6de=function(_0x48cc84){while(--_0x48cc84){_0x5563de['push'](_0x5563de['shift']());}};_0x5ca6de(++_0x3590a5);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xcb91[_0x4164f2];return _0x2575c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var md5=require(_0x1cb9('0x1'));var Redis=require(_0x1cb9('0x2'));var config=require(_0x1cb9('0x3'));config['redis']=_[_0x1cb9('0x4')](config[_0x1cb9('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x1cb9('0x6'))(new Redis(config[_0x1cb9('0x5')]));function Agent(_0x53ffbd){this['id']=_0x53ffbd['id']||0x0;this[_0x1cb9('0x7')]=_0x53ffbd[_0x1cb9('0x7')]||'';this['email']=_0x53ffbd[_0x1cb9('0x8')]||'';this[_0x1cb9('0x9')]=_0x53ffbd['accountcode']||'';this[_0x1cb9('0xa')]=_0x53ffbd['fullname']||'';this['state']=_0x1cb9('0xb');this[_0x1cb9('0xc')]=0x0;this[_0x1cb9('0xd')]=_0x1cb9('0xb');this[_0x1cb9('0xe')]='';this['phone']='';this[_0x1cb9('0xf')]='';this[_0x1cb9('0x10')]='';this[_0x1cb9('0x11')]=_0x53ffbd[_0x1cb9('0x11')]||![];this[_0x1cb9('0x12')]='unknown';this['voiceStatusTime']=0x0;this['voiceStatusCallerIdNumber']='';this[_0x1cb9('0x13')]='';this[_0x1cb9('0x14')]=![];this[_0x1cb9('0x15')]=![];this[_0x1cb9('0x1')]='';}Agent['prototype'][_0x1cb9('0x16')]=function(_0x6ef389){var _0x1b3cd7;if(_0x6ef389&&_0x6ef389[_0x1cb9('0x17')]){_0x1b3cd7=_0x6ef389[_0x1cb9('0x17')]['toLowerCase']();switch(_0x1b3cd7){case'not_inuse':_0x1b3cd7=_0x1cb9('0x18');break;case _0x1cb9('0x19'):_0x1b3cd7=_0x1cb9('0x1a');break;}}if(_0x1b3cd7&&this[_0x1cb9('0x12')]!==_0x1b3cd7||_0x6ef389[_0x1cb9('0x1b')]){this[_0x1cb9('0x1c')]=_[_0x1cb9('0x1d')](moment()['format']('x'));}if(_0x1b3cd7){this['voiceStatus']=_0x1b3cd7;}var _0x1b2fa6={'id':this['id'],'name':this[_0x1cb9('0x7')],'email':this[_0x1cb9('0x8')],'accountcode':this[_0x1cb9('0x9')],'fullname':this[_0x1cb9('0xa')],'state':this[_0x1cb9('0x17')],'stateTime':this[_0x1cb9('0xc')],'status':this['status'],'address':this['address'],'online':this[_0x1cb9('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1cb9('0x1c')],'voiceStatusCallerIdNumber':this[_0x1cb9('0x1e')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this['interface'],'onhold':this[_0x1cb9('0x14')]};var _0x325637=md5(JSON[_0x1cb9('0x1f')](_0x1b2fa6));if(this[_0x1cb9('0x1')]!==_0x325637){this[_0x1cb9('0x1')]=_0x325637;io['to'](util[_0x1cb9('0x20')]('user:%s',_0x1b2fa6['name']))[_0x1cb9('0x21')]('user:save',_0x1b2fa6);io[_0x1cb9('0x21')](_0x1cb9('0x22'),_0x1b2fa6);}};module[_0x1cb9('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 8174c69..51ce4c5 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 _0x8416=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x23af4c,_0x434b6f){var _0x4c465c=function(_0x2ccdd4){while(--_0x2ccdd4){_0x23af4c['push'](_0x23af4c['shift']());}};_0x4c465c(++_0x434b6f);}(_0x8416,0x73));var _0x6841=function(_0x3c9487,_0x1316d5){_0x3c9487=_0x3c9487-0x0;var _0x1149c0=_0x8416[_0x3c9487];return _0x1149c0;};'use strict';function Campaign(_0x3ef4b9){this['id']=_0x3ef4b9['id']||0x0;this[_0x6841('0x0')]=_0x3ef4b9[_0x6841('0x0')]||'';this[_0x6841('0x1')]=_0x3ef4b9['type']||_0x6841('0x2');this[_0x6841('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0x6841('0x4')]='';this['sendMessageOneNotActive']=!![];this[_0x6841('0x5')]=_0x3ef4b9[_0x6841('0x5')];this[_0x6841('0x6')]=_0x3ef4b9[_0x6841('0x6')];this['dialTimezone']=_0x3ef4b9[_0x6841('0x7')]||null;this['dialGlobalInterval']=_0x3ef4b9['dialGlobalInterval']?_0x3ef4b9[_0x6841('0x8')]:null;this[_0x6841('0x9')]=_0x3ef4b9['dialOriginateCallerIdName'];this[_0x6841('0xa')]=_0x3ef4b9['dialOriginateCallerIdNumber'];this[_0x6841('0xb')]=_0x3ef4b9[_0x6841('0xb')]||0x1e;this[_0x6841('0xc')]=_0x3ef4b9[_0x6841('0xc')];this[_0x6841('0xd')]=_0x3ef4b9[_0x6841('0xd')];this[_0x6841('0xe')]=_0x3ef4b9['dialBusyMaxRetry'];this[_0x6841('0xf')]=_0x3ef4b9['dialBusyRetryFrequency'];this['dialNoAnswerMaxRetry']=_0x3ef4b9[_0x6841('0x10')];this['dialNoAnswerRetryFrequency']=_0x3ef4b9[_0x6841('0x11')];this['dialGlobalMaxRetry']=_0x3ef4b9['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x3ef4b9[_0x6841('0x12')]||0x3;this[_0x6841('0x13')]=_0x3ef4b9[_0x6841('0x13')]||0x96;this[_0x6841('0x14')]=_0x3ef4b9[_0x6841('0x14')]||0x3;this[_0x6841('0x15')]=_0x3ef4b9[_0x6841('0x15')]||0x96;this['dialAbandonedMaxRetry']=_0x3ef4b9[_0x6841('0x16')]||0x3;this[_0x6841('0x17')]=_0x3ef4b9[_0x6841('0x17')]||0x96;this[_0x6841('0x18')]=_0x3ef4b9[_0x6841('0x18')]||0x3;this[_0x6841('0x19')]=_0x3ef4b9[_0x6841('0x19')]||0x96;this['dialAgentRejectMaxRetry']=_0x3ef4b9['dialAgentRejectMaxRetry']||0x3;this[_0x6841('0x1a')]=_0x3ef4b9[_0x6841('0x1a')]||0x96;this[_0x6841('0x1b')]=_0x3ef4b9[_0x6841('0x1b')]||'DESC';this[_0x6841('0x1c')]=_0x3ef4b9[_0x6841('0x1c')]||undefined;this[_0x6841('0x1d')]=_0x3ef4b9[_0x6841('0x1d')]||undefined;this[_0x6841('0x1e')]=_0x3ef4b9[_0x6841('0x1e')]||undefined;this[_0x6841('0x1f')]=_0x3ef4b9['TrunkBackup']?_0x3ef4b9[_0x6841('0x1f')]:undefined;this['Trunk']=_0x3ef4b9[_0x6841('0x20')]?_0x3ef4b9[_0x6841('0x20')]:undefined;this[_0x6841('0x21')]=_0x3ef4b9['Interval']?_0x3ef4b9[_0x6841('0x21')]:undefined;this[_0x6841('0x22')]=_0x3ef4b9['SquareProject']?_0x3ef4b9[_0x6841('0x22')]:undefined;this['dialQueueProject']=_0x3ef4b9['SquareProject']?_0x3ef4b9[_0x6841('0x22')][_0x6841('0x0')]:undefined;this[_0x6841('0x23')]=_0x3ef4b9[_0x6841('0x23')]||![];this[_0x6841('0x24')]=_0x3ef4b9[_0x6841('0x24')];this[_0x6841('0x25')]=_0x3ef4b9[_0x6841('0x25')];this['dialAMDAfterGreetingSilence']=_0x3ef4b9[_0x6841('0x26')];this['dialAMDTotalAnalysisTime']=_0x3ef4b9[_0x6841('0x27')];this[_0x6841('0x28')]=_0x3ef4b9[_0x6841('0x28')];this['dialAMDBetweenWordsSilence']=_0x3ef4b9[_0x6841('0x29')];this[_0x6841('0x2a')]=_0x3ef4b9[_0x6841('0x2a')];this['dialAMDSilenceThreshold']=_0x3ef4b9[_0x6841('0x2b')];this[_0x6841('0x2c')]=_0x3ef4b9[_0x6841('0x2c')];}module[_0x6841('0x2d')]=Campaign; \ No newline at end of file +var _0x5694=['dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence'];(function(_0x4a591e,_0x16f954){var _0x57a6ea=function(_0x26ca66){while(--_0x26ca66){_0x4a591e['push'](_0x4a591e['shift']());}};_0x57a6ea(++_0x16f954);}(_0x5694,0x1f2));var _0x4569=function(_0x54673a,_0x233063){_0x54673a=_0x54673a-0x0;var _0x22d19f=_0x5694[_0x54673a];return _0x22d19f;};'use strict';function Campaign(_0x1e595){this['id']=_0x1e595['id']||0x0;this[_0x4569('0x0')]=_0x1e595[_0x4569('0x0')]||'';this['type']=_0x1e595[_0x4569('0x1')]||_0x4569('0x2');this[_0x4569('0x3')]=0x0;this[_0x4569('0x4')]=0x0;this[_0x4569('0x5')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x4569('0x6')]='';this[_0x4569('0x7')]=!![];this[_0x4569('0x8')]=_0x1e595[_0x4569('0x8')];this['limitCalls']=_0x1e595[_0x4569('0x9')];this[_0x4569('0xa')]=_0x1e595[_0x4569('0xa')]||null;this[_0x4569('0xb')]=_0x1e595[_0x4569('0xb')]?_0x1e595['dialGlobalInterval']:null;this[_0x4569('0xc')]=_0x1e595[_0x4569('0xc')];this[_0x4569('0xd')]=_0x1e595[_0x4569('0xd')];this[_0x4569('0xe')]=_0x1e595['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x1e595[_0x4569('0xf')];this[_0x4569('0x10')]=_0x1e595[_0x4569('0x10')];this[_0x4569('0x11')]=_0x1e595['dialBusyMaxRetry'];this[_0x4569('0x12')]=_0x1e595['dialBusyRetryFrequency'];this[_0x4569('0x13')]=_0x1e595[_0x4569('0x13')];this[_0x4569('0x14')]=_0x1e595[_0x4569('0x14')];this[_0x4569('0x15')]=_0x1e595[_0x4569('0x15')];this['dialNoSuchNumberMaxRetry']=_0x1e595['dialNoSuchNumberMaxRetry']||0x3;this[_0x4569('0x16')]=_0x1e595[_0x4569('0x16')]||0x96;this['dialDropMaxRetry']=_0x1e595[_0x4569('0x17')]||0x3;this['dialDropRetryFrequency']=_0x1e595['dialDropRetryFrequency']||0x96;this[_0x4569('0x18')]=_0x1e595['dialAbandonedMaxRetry']||0x3;this[_0x4569('0x19')]=_0x1e595['dialAbandonedRetryFrequency']||0x96;this[_0x4569('0x1a')]=_0x1e595[_0x4569('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x1e595[_0x4569('0x1b')]||0x96;this[_0x4569('0x1c')]=_0x1e595['dialAgentRejectMaxRetry']||0x3;this[_0x4569('0x1d')]=_0x1e595[_0x4569('0x1d')]||0x96;this['dialOrderByScheduledAt']=_0x1e595[_0x4569('0x1e')]||_0x4569('0x1f');this['dialPrefix']=_0x1e595['dialPrefix']||undefined;this[_0x4569('0x20')]=_0x1e595[_0x4569('0x20')]||undefined;this[_0x4569('0x21')]=_0x1e595[_0x4569('0x21')]||undefined;this[_0x4569('0x22')]=_0x1e595['TrunkBackup']?_0x1e595[_0x4569('0x22')]:undefined;this[_0x4569('0x23')]=_0x1e595[_0x4569('0x23')]?_0x1e595[_0x4569('0x23')]:undefined;this[_0x4569('0x24')]=_0x1e595['Interval']?_0x1e595[_0x4569('0x24')]:undefined;this[_0x4569('0x25')]=_0x1e595[_0x4569('0x25')]?_0x1e595[_0x4569('0x25')]:undefined;this[_0x4569('0x26')]=_0x1e595[_0x4569('0x25')]?_0x1e595[_0x4569('0x25')]['name']:undefined;this[_0x4569('0x27')]=_0x1e595[_0x4569('0x27')]||![];this[_0x4569('0x28')]=_0x1e595['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1e595[_0x4569('0x29')];this[_0x4569('0x2a')]=_0x1e595[_0x4569('0x2a')];this[_0x4569('0x2b')]=_0x1e595[_0x4569('0x2b')];this[_0x4569('0x2c')]=_0x1e595[_0x4569('0x2c')];this[_0x4569('0x2d')]=_0x1e595[_0x4569('0x2d')];this[_0x4569('0x2e')]=_0x1e595['dialAMDMaximumNumberOfWords'];this[_0x4569('0x2f')]=_0x1e595[_0x4569('0x2f')];this[_0x4569('0x30')]=_0x1e595[_0x4569('0x30')];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 304b69a..597dcd3 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 _0xf954=['connectedlinenum','connectedlinename','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','billableseconds','holdtime','type','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0xf954,0x10e));var _0x4f95=function(_0xc00490,_0x41e43f){_0xc00490=_0xc00490-0x0;var _0x155c46=_0xf954[_0xc00490];return _0x155c46;};'use strict';function Channel(){this[_0x4f95('0x0')]=null;this[_0x4f95('0x1')]='';this[_0x4f95('0x2')]='';this[_0x4f95('0x3')]=0x0;this[_0x4f95('0x4')]='';this[_0x4f95('0x5')]=undefined;this[_0x4f95('0x6')]=undefined;this['accountcode']=0x0;this['context']='';this[_0x4f95('0x7')]=0x0;this[_0x4f95('0x8')]=0x0;this[_0x4f95('0x9')]=0x0;this[_0x4f95('0xa')]=![];this['answertime']=null;this[_0x4f95('0xb')]=null;this[_0x4f95('0xc')]=![];this[_0x4f95('0xd')]=![];this[_0x4f95('0xe')]='';this['lastdata']='';this['duration']=0x0;this[_0x4f95('0xf')]=0x0;this[_0x4f95('0x10')]=0x0;this[_0x4f95('0x11')]=null;this['tag']=null;this['disposition']=null;this['monitor']=![];this[_0x4f95('0x12')]=null;this[_0x4f95('0x13')]=null;this[_0x4f95('0x14')]=[];this[_0x4f95('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x4f95('0x16')]=undefined;this[_0x4f95('0x17')]=0x0;}module[_0x4f95('0x18')]=Channel; \ No newline at end of file +var _0x6244=['calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastdata','duration','billableseconds','type','tag','disposition','monitor','queue','monitors','transfercalleridnum','transferType','mohtime','exports','starttime','channel','calleridnum'];(function(_0x37c455,_0xbe5637){var _0x3ff4a0=function(_0xb3191b){while(--_0xb3191b){_0x37c455['push'](_0x37c455['shift']());}};_0x3ff4a0(++_0xbe5637);}(_0x6244,0x1ad));var _0x4624=function(_0x346741,_0x534b43){_0x346741=_0x346741-0x0;var _0x2047e5=_0x6244[_0x346741];return _0x2047e5;};'use strict';function Channel(){this[_0x4624('0x0')]=null;this[_0x4624('0x1')]='';this['destinationchannel']='';this[_0x4624('0x2')]=0x0;this[_0x4624('0x3')]='';this[_0x4624('0x4')]=undefined;this[_0x4624('0x5')]=undefined;this[_0x4624('0x6')]=0x0;this['context']='';this[_0x4624('0x7')]=0x0;this[_0x4624('0x8')]=0x0;this[_0x4624('0x9')]=0x0;this[_0x4624('0xa')]=![];this[_0x4624('0xb')]=null;this[_0x4624('0xc')]=null;this['unmanaged']=![];this[_0x4624('0xd')]=![];this['lastapplication']='';this[_0x4624('0xe')]='';this[_0x4624('0xf')]=0x0;this[_0x4624('0x10')]=0x0;this['holdtime']=0x0;this[_0x4624('0x11')]=null;this[_0x4624('0x12')]=null;this[_0x4624('0x13')]=null;this[_0x4624('0x14')]=![];this['monitorFilename']=null;this[_0x4624('0x15')]=null;this[_0x4624('0x16')]=[];this[_0x4624('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x4624('0x18')]=undefined;this[_0x4624('0x19')]=0x0;}module[_0x4624('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index d41cf2d..df53fb2 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 _0x45f6=['consumerKey','consumerSecret','token','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType','password'];(function(_0x565b3d,_0x1ffbdc){var _0x3a7918=function(_0x485126){while(--_0x485126){_0x565b3d['push'](_0x565b3d['shift']());}};_0x3a7918(++_0x1ffbdc);}(_0x45f6,0x97));var _0x645f=function(_0x312ff8,_0x5d7167){_0x312ff8=_0x312ff8-0x0;var _0x4e144b=_0x45f6[_0x312ff8];return _0x4e144b;};'use strict';function DeskAccount(_0x5cd9c0){this['id']=_0x5cd9c0['id']||0x0;this['name']=_0x5cd9c0[_0x645f('0x0')]||'';this[_0x645f('0x1')]=_0x5cd9c0[_0x645f('0x1')]||'';this['remoteUri']=_0x5cd9c0[_0x645f('0x2')]||'';this[_0x645f('0x3')]=_0x5cd9c0['authType']||'';this[_0x645f('0x4')]=_0x5cd9c0[_0x645f('0x4')]||'';this[_0x645f('0x5')]=_0x5cd9c0[_0x645f('0x5')]||'';this[_0x645f('0x6')]=_0x5cd9c0[_0x645f('0x6')]||'';this[_0x645f('0x7')]=_0x5cd9c0[_0x645f('0x7')]||'';this['tokenSecret']=_0x5cd9c0[_0x645f('0x8')]||'';this['type']=_0x5cd9c0['type']||'';this[_0x645f('0x9')]=_0x5cd9c0['serverUrl']||'';this[_0x645f('0xa')]=_0x5cd9c0['Configurations']||{};}module[_0x645f('0xb')]=DeskAccount; \ No newline at end of file +var _0x3f9a=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x410bad,_0x5e69e4){var _0x295eb8=function(_0x5ec5a5){while(--_0x5ec5a5){_0x410bad['push'](_0x410bad['shift']());}};_0x295eb8(++_0x5e69e4);}(_0x3f9a,0x1d4));var _0xa3f9=function(_0xb82940,_0x530318){_0xb82940=_0xb82940-0x0;var _0x2e152a=_0x3f9a[_0xb82940];return _0x2e152a;};'use strict';function DeskAccount(_0x1341ac){this['id']=_0x1341ac['id']||0x0;this[_0xa3f9('0x0')]=_0x1341ac[_0xa3f9('0x0')]||'';this['username']=_0x1341ac[_0xa3f9('0x1')]||'';this[_0xa3f9('0x2')]=_0x1341ac['remoteUri']||'';this[_0xa3f9('0x3')]=_0x1341ac[_0xa3f9('0x3')]||'';this[_0xa3f9('0x4')]=_0x1341ac['password']||'';this[_0xa3f9('0x5')]=_0x1341ac['consumerKey']||'';this[_0xa3f9('0x6')]=_0x1341ac[_0xa3f9('0x6')]||'';this[_0xa3f9('0x7')]=_0x1341ac[_0xa3f9('0x7')]||'';this[_0xa3f9('0x8')]=_0x1341ac[_0xa3f9('0x8')]||'';this['type']=_0x1341ac[_0xa3f9('0x9')]||'';this[_0xa3f9('0xa')]=_0x1341ac['serverUrl']||'';this[_0xa3f9('0xb')]=_0x1341ac[_0xa3f9('0xb')]||{};}module[_0xa3f9('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index d2eb069..1bfa016 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 _0x41bb=['username','password','remoteUri','tenantId','clientId','serverUrl','Configurations','exports','name'];(function(_0x200045,_0x4e5da1){var _0x566a8d=function(_0x46b5a1){while(--_0x46b5a1){_0x200045['push'](_0x200045['shift']());}};_0x566a8d(++_0x4e5da1);}(_0x41bb,0xc5));var _0xb41b=function(_0x47d267,_0x5ebbeb){_0x47d267=_0x47d267-0x0;var _0x1bef7a=_0x41bb[_0x47d267];return _0x1bef7a;};'use strict';function Dynamics365Account(_0x4337f5){this['id']=_0x4337f5['id']||0x0;this[_0xb41b('0x0')]=_0x4337f5['name']||'';this[_0xb41b('0x1')]=_0x4337f5['username']||'';this[_0xb41b('0x2')]=_0x4337f5[_0xb41b('0x2')]||'';this[_0xb41b('0x3')]=_0x4337f5[_0xb41b('0x3')]||'';this['tenantId']=_0x4337f5[_0xb41b('0x4')]||'';this[_0xb41b('0x5')]=_0x4337f5[_0xb41b('0x5')]||'';this['clientSecret']=_0x4337f5['clientSecret']||{};this['serverUrl']=_0x4337f5[_0xb41b('0x6')]||'';this[_0xb41b('0x7')]=_0x4337f5['Configurations']||{};}module[_0xb41b('0x8')]=Dynamics365Account; \ No newline at end of file +var _0xd8b0=['Configurations','exports','name','password','remoteUri','tenantId','clientId','clientSecret','serverUrl'];(function(_0xa63ea3,_0x4367ff){var _0x2aa5ff=function(_0x30dc84){while(--_0x30dc84){_0xa63ea3['push'](_0xa63ea3['shift']());}};_0x2aa5ff(++_0x4367ff);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';function Dynamics365Account(_0x5d04de){this['id']=_0x5d04de['id']||0x0;this[_0x0d8b('0x0')]=_0x5d04de['name']||'';this['username']=_0x5d04de['username']||'';this[_0x0d8b('0x1')]=_0x5d04de[_0x0d8b('0x1')]||'';this[_0x0d8b('0x2')]=_0x5d04de[_0x0d8b('0x2')]||'';this[_0x0d8b('0x3')]=_0x5d04de['tenantId']||'';this['clientId']=_0x5d04de[_0x0d8b('0x4')]||'';this[_0x0d8b('0x5')]=_0x5d04de[_0x0d8b('0x5')]||{};this['serverUrl']=_0x5d04de[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5d04de['Configurations']||{};}module[_0x0d8b('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 09294a4..7543a41 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 _0x7de8=['tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x5a14bc,_0x3cdf58){var _0x8a2423=function(_0x3f4377){while(--_0x3f4377){_0x5a14bc['push'](_0x5a14bc['shift']());}};_0x8a2423(++_0x3cdf58);}(_0x7de8,0x9e));var _0x87de=function(_0x9b23f6,_0x4d8376){_0x9b23f6=_0x9b23f6-0x0;var _0x253168=_0x7de8[_0x9b23f6];return _0x253168;};'use strict';function FaxAccount(_0x2bcb1b){this['id']=_0x2bcb1b['id']||0x0;this['name']=_0x2bcb1b[_0x87de('0x0')]||'';this[_0x87de('0x1')]=_0x2bcb1b[_0x87de('0x1')];this['ecm']=_0x2bcb1b[_0x87de('0x2')];this['headerinfo']=_0x2bcb1b[_0x87de('0x3')];this['localstationid']=_0x2bcb1b[_0x87de('0x4')];this[_0x87de('0x5')]=_0x2bcb1b[_0x87de('0x5')]||0x960;this[_0x87de('0x6')]=_0x2bcb1b[_0x87de('0x6')]||0x3840;this[_0x87de('0x7')]=_0x2bcb1b['modem']||_0x87de('0x8');this[_0x87de('0x9')]=_0x2bcb1b[_0x87de('0x9')]||'no';this[_0x87de('0xa')]=_0x2bcb1b[_0x87de('0xa')]||'no';this[_0x87de('0xb')]=_0x2bcb1b[_0x87de('0xb')]||0x1388;this[_0x87de('0xc')]=_0x2bcb1b[_0x87de('0xc')]||_0x87de('0xd');this[_0x87de('0xe')]=_0x2bcb1b['Trunk']?_0x2bcb1b[_0x87de('0xe')]:undefined;this['ListId']=_0x2bcb1b[_0x87de('0xf')];this[_0x87de('0x10')]=_0x2bcb1b[_0x87de('0x10')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x632f=['v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x1ef805,_0x8dedd1){var _0x4b196d=function(_0x5acbd0){while(--_0x5acbd0){_0x1ef805['push'](_0x1ef805['shift']());}};_0x4b196d(++_0x8dedd1);}(_0x632f,0x1e5));var _0xf632=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x632f[_0x5d4607];return _0x5e4a86;};'use strict';function FaxAccount(_0x428c0f){this['id']=_0x428c0f['id']||0x0;this[_0xf632('0x0')]=_0x428c0f[_0xf632('0x0')]||'';this[_0xf632('0x1')]=_0x428c0f[_0xf632('0x1')];this[_0xf632('0x2')]=_0x428c0f[_0xf632('0x2')];this[_0xf632('0x3')]=_0x428c0f[_0xf632('0x3')];this[_0xf632('0x4')]=_0x428c0f[_0xf632('0x4')];this[_0xf632('0x5')]=_0x428c0f[_0xf632('0x5')]||0x960;this[_0xf632('0x6')]=_0x428c0f[_0xf632('0x6')]||0x3840;this[_0xf632('0x7')]=_0x428c0f['modem']||_0xf632('0x8');this[_0xf632('0x9')]=_0x428c0f['gateway']||'no';this['faxdetect']=_0x428c0f[_0xf632('0xa')]||'no';this[_0xf632('0xb')]=_0x428c0f[_0xf632('0xb')]||0x1388;this['tech']=_0x428c0f['tech']||_0xf632('0xc');this[_0xf632('0xd')]=_0x428c0f[_0xf632('0xd')]?_0x428c0f[_0xf632('0xd')]:undefined;this[_0xf632('0xe')]=_0x428c0f[_0xf632('0xe')];this[_0xf632('0xf')]=_0x428c0f[_0xf632('0xf')];}module[_0xf632('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index f1249fc..04beecc 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 _0x697d=['exports','name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x44a717,_0x19ce18){var _0x34d9ff=function(_0x38303d){while(--_0x38303d){_0x44a717['push'](_0x44a717['shift']());}};_0x34d9ff(++_0x19ce18);}(_0x697d,0x17b));var _0xd697=function(_0x40b191,_0x2787dd){_0x40b191=_0x40b191-0x0;var _0xded37a=_0x697d[_0x40b191];return _0xded37a;};'use strict';function FreshdeskAccount(_0x149be6){this['id']=_0x149be6['id']||0x0;this[_0xd697('0x0')]=_0x149be6[_0xd697('0x0')]||'';this['username']=_0x149be6[_0xd697('0x1')]||'';this[_0xd697('0x2')]=_0x149be6['token']||'';this[_0xd697('0x3')]=_0x149be6[_0xd697('0x3')]||'';this[_0xd697('0x4')]=_0x149be6[_0xd697('0x4')]||'';this[_0xd697('0x5')]=_0x149be6['Configurations']||{};}module[_0xd697('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xde33=['remoteUri','serverUrl','Configurations','exports','name','username','token'];(function(_0xda65c1,_0x5aa11a){var _0x26eb9e=function(_0x2d0386){while(--_0x2d0386){_0xda65c1['push'](_0xda65c1['shift']());}};_0x26eb9e(++_0x5aa11a);}(_0xde33,0xba));var _0x3de3=function(_0xe2002f,_0x42ded7){_0xe2002f=_0xe2002f-0x0;var _0x5e9477=_0xde33[_0xe2002f];return _0x5e9477;};'use strict';function FreshdeskAccount(_0x105e00){this['id']=_0x105e00['id']||0x0;this[_0x3de3('0x0')]=_0x105e00[_0x3de3('0x0')]||'';this[_0x3de3('0x1')]=_0x105e00['username']||'';this['apiKey']=_0x105e00[_0x3de3('0x2')]||'';this[_0x3de3('0x3')]=_0x105e00[_0x3de3('0x3')]||'';this[_0x3de3('0x4')]=_0x105e00[_0x3de3('0x4')]||'';this[_0x3de3('0x5')]=_0x105e00[_0x3de3('0x5')]||{};}module[_0x3de3('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 9207556..8032c7d 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 _0xf3ff=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xe8e194,_0x3c0f63){var _0x907512=function(_0x1e147c){while(--_0x1e147c){_0xe8e194['push'](_0xe8e194['shift']());}};_0x907512(++_0x3c0f63);}(_0xf3ff,0xae));var _0xff3f=function(_0x580c6e,_0xd0516d){_0x580c6e=_0x580c6e-0x0;var _0x4b9ba2=_0xf3ff[_0x580c6e];return _0x4b9ba2;};'use strict';function FreshsalesAccount(_0x30792c){this['id']=_0x30792c['id']||0x0;this['name']=_0x30792c[_0xff3f('0x0')]||'';this[_0xff3f('0x1')]=_0x30792c[_0xff3f('0x1')]||'';this[_0xff3f('0x2')]=_0x30792c[_0xff3f('0x3')]||'';this[_0xff3f('0x4')]=_0x30792c['remoteUri']||'';this[_0xff3f('0x5')]=_0x30792c[_0xff3f('0x5')]||'';this[_0xff3f('0x6')]=_0x30792c['Configurations']||{};}module[_0xff3f('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xa7e6=['remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x46451c,_0x88ddd){var _0x12dce4=function(_0x2e4087){while(--_0x2e4087){_0x46451c['push'](_0x46451c['shift']());}};_0x12dce4(++_0x88ddd);}(_0xa7e6,0x74));var _0x6a7e=function(_0x5bf9e0,_0x400291){_0x5bf9e0=_0x5bf9e0-0x0;var _0x2d4653=_0xa7e6[_0x5bf9e0];return _0x2d4653;};'use strict';function FreshsalesAccount(_0x495a94){this['id']=_0x495a94['id']||0x0;this[_0x6a7e('0x0')]=_0x495a94[_0x6a7e('0x0')]||'';this[_0x6a7e('0x1')]=_0x495a94[_0x6a7e('0x1')]||'';this[_0x6a7e('0x2')]=_0x495a94['token']||'';this[_0x6a7e('0x3')]=_0x495a94[_0x6a7e('0x3')]||'';this[_0x6a7e('0x4')]=_0x495a94[_0x6a7e('0x4')]||'';this[_0x6a7e('0x5')]=_0x495a94['Configurations']||{};}module[_0x6a7e('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index f61e24c..6269f5e 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 _0x989b=['channel','connectedlinenum','accountcode','context','exten','priority','holdtime','motionChannel','voice','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','originalposition'];(function(_0x3614a3,_0x2343f4){var _0x4cfb67=function(_0x115130){while(--_0x115130){_0x3614a3['push'](_0x3614a3['shift']());}};_0x4cfb67(++_0x2343f4);}(_0x989b,0x14c));var _0xb989=function(_0x212e3a,_0x3ab657){_0x212e3a=_0x212e3a-0x0;var _0x4e0922=_0x989b[_0x212e3a];return _0x4e0922;};'use strict';function QueueReport(){this[_0xb989('0x0')]=_0xb989('0x1');this[_0xb989('0x2')]='';this[_0xb989('0x3')]='';this[_0xb989('0x4')]='';this['queue']='';this[_0xb989('0x5')]=null;this[_0xb989('0x6')]=null;this[_0xb989('0x7')]=0x1;this['count']=0x1;this[_0xb989('0x8')]=![];this[_0xb989('0x9')]=null;this[_0xb989('0xa')]=![];this[_0xb989('0xb')]=null;this['queuecallerexit']=![];this['queuecallerexitAt']=null;this[_0xb989('0xc')]=0x1;this[_0xb989('0xd')]='';this[_0xb989('0xe')]='';this['connectedlinename']='';this[_0xb989('0xf')]='';this[_0xb989('0x10')]='';this[_0xb989('0x11')]='';this[_0xb989('0x12')]='';this[_0xb989('0x13')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0xb989('0x14')]=_0xb989('0x15');this['mohtime']=0x0;this['variables']={};}module[_0xb989('0x16')]=QueueReport; \ No newline at end of file +var _0xa863=['channel','accountcode','context','holdtime','lastAssignedTo','motionChannel','voice','variables','exports','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition'];(function(_0x43a7ce,_0x309be4){var _0xf5d9db=function(_0x1cd2d1){while(--_0x1cd2d1){_0x43a7ce['push'](_0x43a7ce['shift']());}};_0xf5d9db(++_0x309be4);}(_0xa863,0x106));var _0x3a86=function(_0xd19c,_0x35cfb2){_0xd19c=_0xd19c-0x0;var _0x183d3d=_0xa863[_0xd19c];return _0x183d3d;};'use strict';function QueueReport(){this['type']=_0x3a86('0x0');this[_0x3a86('0x1')]='';this[_0x3a86('0x2')]='';this[_0x3a86('0x3')]='';this[_0x3a86('0x4')]='';this[_0x3a86('0x5')]=null;this[_0x3a86('0x6')]=null;this[_0x3a86('0x7')]=0x1;this[_0x3a86('0x8')]=0x1;this[_0x3a86('0x9')]=![];this['queuecallerabandonAt']=null;this[_0x3a86('0xa')]=![];this[_0x3a86('0xb')]=null;this[_0x3a86('0xc')]=![];this['queuecallerexitAt']=null;this[_0x3a86('0xd')]=0x1;this[_0x3a86('0xe')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0x3a86('0xf')]='';this[_0x3a86('0x10')]='';this['exten']='';this['priority']='';this[_0x3a86('0x11')]=0x0;this['assigned']=![];this[_0x3a86('0x12')]='';this[_0x3a86('0x13')]=_0x3a86('0x14');this['mohtime']=0x0;this[_0x3a86('0x15')]={};}module[_0x3a86('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 9cbcb47..4360e54 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 _0xaac4=['name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x5e07ab,_0x55490f){var _0x2903c6=function(_0x11cf1e){while(--_0x11cf1e){_0x5e07ab['push'](_0x5e07ab['shift']());}};_0x2903c6(++_0x55490f);}(_0xaac4,0x6c));var _0x4aac=function(_0x50b295,_0x420eaf){_0x50b295=_0x50b295-0x0;var _0x230324=_0xaac4[_0x50b295];return _0x230324;};'use strict';function SalesforceAccount(_0x4b964b){this['id']=_0x4b964b['id']||0x0;this[_0x4aac('0x0')]=_0x4b964b['name']||'';this[_0x4aac('0x1')]=_0x4b964b[_0x4aac('0x1')]||'';this[_0x4aac('0x2')]=_0x4b964b['remoteUri']||'';this[_0x4aac('0x3')]=_0x4b964b[_0x4aac('0x3')]||'';this[_0x4aac('0x4')]=_0x4b964b[_0x4aac('0x4')]||'';this[_0x4aac('0x5')]=_0x4b964b['clientSecret']||'';this[_0x4aac('0x6')]=_0x4b964b[_0x4aac('0x6')]||'';this[_0x4aac('0x7')]=_0x4b964b['type']||_0x4aac('0x8');this['serverUrl']=_0x4b964b[_0x4aac('0x9')]||'';this[_0x4aac('0xa')]=_0x4b964b[_0x4aac('0xa')]||{};}module[_0x4aac('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xb94c=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x5c2f86,_0x55e2d5){var _0x544b2=function(_0x233b2a){while(--_0x233b2a){_0x5c2f86['push'](_0x5c2f86['shift']());}};_0x544b2(++_0x55e2d5);}(_0xb94c,0x176));var _0xcb94=function(_0x418e4d,_0x1d1fb7){_0x418e4d=_0x418e4d-0x0;var _0x3387f2=_0xb94c[_0x418e4d];return _0x3387f2;};'use strict';function SalesforceAccount(_0x3fe1cb){this['id']=_0x3fe1cb['id']||0x0;this[_0xcb94('0x0')]=_0x3fe1cb['name']||'';this[_0xcb94('0x1')]=_0x3fe1cb[_0xcb94('0x1')]||'';this['remoteUri']=_0x3fe1cb[_0xcb94('0x2')]||'';this['password']=_0x3fe1cb[_0xcb94('0x3')]||'';this[_0xcb94('0x4')]=_0x3fe1cb[_0xcb94('0x4')]||'';this[_0xcb94('0x5')]=_0x3fe1cb[_0xcb94('0x5')]||'';this['securityToken']=_0x3fe1cb[_0xcb94('0x6')]||'';this[_0xcb94('0x7')]=_0x3fe1cb[_0xcb94('0x7')]||_0xcb94('0x8');this[_0xcb94('0x9')]=_0x3fe1cb['serverUrl']||'';this[_0xcb94('0xa')]=_0x3fe1cb[_0xcb94('0xa')]||{};}module[_0xcb94('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 f8b83d4..c9508df 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 _0xae61=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x342b9c,_0x18105b){var _0x4c698a=function(_0x555900){while(--_0x555900){_0x342b9c['push'](_0x342b9c['shift']());}};_0x4c698a(++_0x18105b);}(_0xae61,0x1cb));var _0x1ae6=function(_0x3c2551,_0x428564){_0x3c2551=_0x3c2551-0x0;var _0xe9a78=_0xae61[_0x3c2551];return _0xe9a78;};'use strict';function ServicenowAccount(_0x27843d){this['id']=_0x27843d['id']||0x0;this['name']=_0x27843d[_0x1ae6('0x0')]||'';this[_0x1ae6('0x1')]=_0x27843d[_0x1ae6('0x1')]||'';this['password']=_0x27843d[_0x1ae6('0x2')]||'';this['remoteUri']=_0x27843d[_0x1ae6('0x3')]||'';this['serverUrl']=_0x27843d[_0x1ae6('0x4')]||'';this[_0x1ae6('0x5')]=_0x27843d['Configurations']||{};}module[_0x1ae6('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xbf4c=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1357e9,_0x24f365){var _0x56343e=function(_0x13994a){while(--_0x13994a){_0x1357e9['push'](_0x1357e9['shift']());}};_0x56343e(++_0x24f365);}(_0xbf4c,0x189));var _0xcbf4=function(_0x153d3f,_0x242877){_0x153d3f=_0x153d3f-0x0;var _0x3e78a5=_0xbf4c[_0x153d3f];return _0x3e78a5;};'use strict';function ServicenowAccount(_0x618099){this['id']=_0x618099['id']||0x0;this['name']=_0x618099[_0xcbf4('0x0')]||'';this[_0xcbf4('0x1')]=_0x618099[_0xcbf4('0x1')]||'';this['password']=_0x618099[_0xcbf4('0x2')]||'';this[_0xcbf4('0x3')]=_0x618099[_0xcbf4('0x3')]||'';this['serverUrl']=_0x618099[_0xcbf4('0x4')]||'';this[_0xcbf4('0x5')]=_0x618099[_0xcbf4('0x5')]||{};}module[_0xcbf4('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 7060b03..16bee7d 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 _0x8e70=['Configurations','name','username','remoteUri','serverUrl'];(function(_0x2a140b,_0x2cb1eb){var _0xd4f1e4=function(_0x5a8c66){while(--_0x5a8c66){_0x2a140b['push'](_0x2a140b['shift']());}};_0xd4f1e4(++_0x2cb1eb);}(_0x8e70,0x88));var _0x08e7=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x8e70[_0x263a74];return _0x2aa86c;};'use strict';function SugarcrmAccount(_0x53bc84){this['id']=_0x53bc84['id']||0x0;this[_0x08e7('0x0')]=_0x53bc84['name']||'';this[_0x08e7('0x1')]=_0x53bc84[_0x08e7('0x1')]||'';this['password']=_0x53bc84['password']||'';this[_0x08e7('0x2')]=_0x53bc84['remoteUri']||'';this['serverUrl']=_0x53bc84[_0x08e7('0x3')]||'';this[_0x08e7('0x4')]=_0x53bc84[_0x08e7('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0x975f=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x975f,0x109));var _0xf975=function(_0x7729b1,_0x468322){_0x7729b1=_0x7729b1-0x0;var _0x349504=_0x975f[_0x7729b1];return _0x349504;};'use strict';function SugarcrmAccount(_0x15a84f){this['id']=_0x15a84f['id']||0x0;this[_0xf975('0x0')]=_0x15a84f['name']||'';this['username']=_0x15a84f[_0xf975('0x1')]||'';this[_0xf975('0x2')]=_0x15a84f['password']||'';this[_0xf975('0x3')]=_0x15a84f[_0xf975('0x3')]||'';this[_0xf975('0x4')]=_0x15a84f[_0xf975('0x4')]||'';this['Configurations']=_0x15a84f[_0xf975('0x5')]||{};}module[_0xf975('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 85255f5..5b96f95 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 _0x7e07=['name','accountcode','unknown','stateTime','status','address','exports'];(function(_0x79ef88,_0xb78161){var _0x29ff0a=function(_0x20a0f3){while(--_0x20a0f3){_0x79ef88['push'](_0x79ef88['shift']());}};_0x29ff0a(++_0xb78161);}(_0x7e07,0xfc));var _0x77e0=function(_0x42833c,_0x1001c9){_0x42833c=_0x42833c-0x0;var _0x2b9063=_0x7e07[_0x42833c];return _0x2b9063;};'use strict';function Telephone(_0x107929){this['id']=_0x107929['id']||0x0;this[_0x77e0('0x0')]=_0x107929[_0x77e0('0x0')]||'';this[_0x77e0('0x1')]=_0x107929[_0x77e0('0x1')]||'';this['state']=_0x77e0('0x2');this[_0x77e0('0x3')]=0x0;this[_0x77e0('0x4')]='unknown';this[_0x77e0('0x5')]='';}module[_0x77e0('0x6')]=Telephone; \ No newline at end of file +var _0xf290=['state','unknown','stateTime','status','exports','name','accountcode'];(function(_0x553095,_0x427c95){var _0xfbbe43=function(_0x35005a){while(--_0x35005a){_0x553095['push'](_0x553095['shift']());}};_0xfbbe43(++_0x427c95);}(_0xf290,0xde));var _0x0f29=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xf290[_0x4de1b1];return _0x639f27;};'use strict';function Telephone(_0x1149f4){this['id']=_0x1149f4['id']||0x0;this[_0x0f29('0x0')]=_0x1149f4['name']||'';this[_0x0f29('0x1')]=_0x1149f4['accountcode']||'';this[_0x0f29('0x2')]=_0x0f29('0x3');this[_0x0f29('0x4')]=0x0;this[_0x0f29('0x5')]=_0x0f29('0x3');this['address']='';}module[_0x0f29('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 9436a44..a626331 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(_0x36e3bd,_0x3b1f64){var _0x12ca3b=function(_0x288403){while(--_0x288403){_0x36e3bd['push'](_0x36e3bd['shift']());}};_0x12ca3b(++_0x3b1f64);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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(_0x1ae4d,_0x55d7f2){var _0x22440d=function(_0x38b5a0){while(--_0x38b5a0){_0x1ae4d['push'](_0x1ae4d['shift']());}};_0x22440d(++_0x55d7f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'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 aa25c90..1a7d9c6 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 _0x1a85=['status','AllConditions','AnyConditions','Actions','name','channel'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x1a85,0x178));var _0x51a8=function(_0x4662e3,_0x3c9e27){_0x4662e3=_0x4662e3-0x0;var _0x3ab0e7=_0x1a85[_0x4662e3];return _0x3ab0e7;};'use strict';function Trigger(_0x4570ac){this['id']=_0x4570ac['id']||0x0;this['name']=_0x4570ac[_0x51a8('0x0')]||'';this[_0x51a8('0x1')]=_0x4570ac[_0x51a8('0x1')]||'voice';this['status']=_0x4570ac[_0x51a8('0x2')]||![];this[_0x51a8('0x3')]=_0x4570ac[_0x51a8('0x3')]||[];this['AnyConditions']=_0x4570ac[_0x51a8('0x4')]||[];this['Actions']=_0x4570ac[_0x51a8('0x5')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x35f461,_0x5b38e7){var _0x3390dd=function(_0x5d0072){while(--_0x5d0072){_0x35f461['push'](_0x35f461['shift']());}};_0x3390dd(++_0x5b38e7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4f0d23,_0x3f8652){_0x4f0d23=_0x4f0d23-0x0;var _0xcb57f5=_0x9ffd[_0x4f0d23];return _0xcb57f5;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 537acdb..d4a8bac 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 _0x8095=['exports','active','name','state','unknown','split','host','port','domain','domainport','stateRegistry','registrationtime','defaultuser'];(function(_0x5989d5,_0x5775f7){var _0x452e5a=function(_0x2cb182){while(--_0x2cb182){_0x5989d5['push'](_0x5989d5['shift']());}};_0x452e5a(++_0x5775f7);}(_0x8095,0xd1));var _0x5809=function(_0x1051ec,_0x21a076){_0x1051ec=_0x1051ec-0x0;var _0x24e564=_0x8095[_0x1051ec];return _0x24e564;};'use strict';function Trunk(_0x46b678){this['id']=_0x46b678['id']||0x0;this[_0x5809('0x0')]=_0x46b678[_0x5809('0x0')]||![];this[_0x5809('0x1')]=_0x46b678[_0x5809('0x1')]||'';this[_0x5809('0x2')]=_0x5809('0x3');this['stateTime']=0x0;this['status']=_0x5809('0x3');this['registry']=_0x46b678['registry']&&_0x46b678['registry']['indexOf'](':')?_0x46b678['registry'][_0x5809('0x4')](':')[0x0]:'';this[_0x5809('0x5')]='';this[_0x5809('0x6')]='';this[_0x5809('0x7')]='';this[_0x5809('0x8')]='';this['refresh']='';this[_0x5809('0x9')]=_0x5809('0x3');this[_0x5809('0xa')]='';this['address']='';this[_0x5809('0xb')]=_0x46b678[_0x5809('0xb')]||'';}module[_0x5809('0xc')]=Trunk; \ No newline at end of file +var _0x974c=['indexOf','split','port','domainport','refresh','stateRegistry','registrationtime','defaultuser','active','name','unknown','stateTime','registry'];(function(_0x57d475,_0x4d9c33){var _0x46c459=function(_0x206594){while(--_0x206594){_0x57d475['push'](_0x57d475['shift']());}};_0x46c459(++_0x4d9c33);}(_0x974c,0xb1));var _0xc974=function(_0x16e65f,_0x5a7261){_0x16e65f=_0x16e65f-0x0;var _0x5dee3f=_0x974c[_0x16e65f];return _0x5dee3f;};'use strict';function Trunk(_0x4b894e){this['id']=_0x4b894e['id']||0x0;this[_0xc974('0x0')]=_0x4b894e['active']||![];this[_0xc974('0x1')]=_0x4b894e[_0xc974('0x1')]||'';this['state']=_0xc974('0x2');this[_0xc974('0x3')]=0x0;this['status']=_0xc974('0x2');this[_0xc974('0x4')]=_0x4b894e[_0xc974('0x4')]&&_0x4b894e[_0xc974('0x4')][_0xc974('0x5')](':')?_0x4b894e[_0xc974('0x4')][_0xc974('0x6')](':')[0x0]:'';this['host']='';this[_0xc974('0x7')]='';this['domain']='';this[_0xc974('0x8')]='';this[_0xc974('0x9')]='';this[_0xc974('0xa')]=_0xc974('0x2');this[_0xc974('0xb')]='';this['address']='';this[_0xc974('0xc')]=_0x4b894e['defaultuser']||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index a69474d..f50f2c0 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 _0x64dc=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x6815bb,_0x15fc8a){var _0x11b250=function(_0x4ea77a){while(--_0x4ea77a){_0x6815bb['push'](_0x6815bb['shift']());}};_0x11b250(++_0x15fc8a);}(_0x64dc,0x106));var _0xc64d=function(_0x163a08,_0x527f61){_0x163a08=_0x163a08-0x0;var _0x1cbe9e=_0x64dc[_0x163a08];return _0x1cbe9e;};'use strict';function voiceExtension(_0x415d0b){this['id']=_0x415d0b['id']||0x0;this[_0xc64d('0x0')]=_0x415d0b[_0xc64d('0x0')]||'';this[_0xc64d('0x1')]=_0x415d0b[_0xc64d('0x1')]||_0xc64d('0x2');this[_0xc64d('0x3')]=_0x415d0b[_0xc64d('0x3')]||![];}module[_0xc64d('0x4')]=voiceExtension; \ No newline at end of file +var _0x68af=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x42458c,_0x1acdc0){var _0x5c2872=function(_0x1c4ac1){while(--_0x1c4ac1){_0x42458c['push'](_0x42458c['shift']());}};_0x5c2872(++_0x1acdc0);}(_0x68af,0x19b));var _0xf68a=function(_0x150d01,_0x40fad1){_0x150d01=_0x150d01-0x0;var _0x28e865=_0x68af[_0x150d01];return _0x28e865;};'use strict';function voiceExtension(_0x5e80bf){this['id']=_0x5e80bf['id']||0x0;this[_0xf68a('0x0')]=_0x5e80bf['exten']||'';this['recordingFormat']=_0x5e80bf[_0xf68a('0x1')]||_0xf68a('0x2');this[_0xf68a('0x3')]=_0x5e80bf['mandatoryDisposition']||![];}module[_0xf68a('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 8c83645..0f046b0 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 _0x5b43=['DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','waiting','talking','sumDuration','sumHoldTime','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt'];(function(_0x5dbd27,_0x38f94b){var _0x225bc4=function(_0x4209b2){while(--_0x4209b2){_0x5dbd27['push'](_0x5dbd27['shift']());}};_0x225bc4(++_0x38f94b);}(_0x5b43,0x123));var _0x35b4=function(_0x2c1443,_0x1cbe7f){_0x2c1443=_0x2c1443-0x0;var _0x179d64=_0x5b43[_0x2c1443];return _0x179d64;};'use strict';var statusDesc=[_0x35b4('0x0'),_0x35b4('0x1'),_0x35b4('0x2'),_0x35b4('0x3'),_0x35b4('0x4'),_0x35b4('0x5'),'ringing',_0x35b4('0x6'),'onhold'];var monitorFormat={'wav':_0x35b4('0x7'),'wav49':_0x35b4('0x8'),'gsm':_0x35b4('0x9')};var strategy={'rrmemory':_0x35b4('0xa'),'roundrobin':_0x35b4('0xb')};function VoiceQueue(_0x201695){this['id']=_0x201695['id']||0x0;this[_0x35b4('0xc')]=_0x201695[_0x35b4('0xc')]||'';this[_0x35b4('0xd')]=_0x201695[_0x35b4('0xd')]||'';this['type']=_0x201695[_0x35b4('0xe')]||'inbound';this[_0x35b4('0xf')]=0x0;this[_0x35b4('0x10')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0x35b4('0x11')]=0x0;this[_0x35b4('0x12')]=0x0;this[_0x35b4('0x13')]=0x0;this[_0x35b4('0x14')]=0x0;this['abandoned']=0x0;this[_0x35b4('0x15')]=0x0;this[_0x35b4('0x16')]=0x0;this['acw']=_0x201695[_0x35b4('0x17')]||![];this[_0x35b4('0x18')]=_0x201695[_0x35b4('0x18')]||0xa;this[_0x35b4('0x19')]=_0x201695['autopause']||'no';this[_0x35b4('0x1a')]=!![];this['message']='';this[_0x35b4('0x1b')]=0x0;this[_0x35b4('0x1c')]=0x0;this[_0x35b4('0x1d')]=_0x201695[_0x35b4('0x1d')]||null;this['dialGlobalInterval']=_0x201695[_0x35b4('0x1e')]?_0x201695[_0x35b4('0x1e')]:null;this['dialActive']=_0x201695['dialActive'];this[_0x35b4('0x1f')]=_0x201695[_0x35b4('0x1f')]||_0x35b4('0x20');this[_0x35b4('0x21')]=_0x201695[_0x35b4('0x21')]||0x0;this[_0x35b4('0x22')]=_0x201695[_0x35b4('0x22')]||0x0;this[_0x35b4('0x23')]=_0x201695[_0x35b4('0x23')]||0x1;this[_0x35b4('0x24')]=_0x201695[_0x35b4('0x24')]||_0x35b4('0x25');this[_0x35b4('0x26')]=_0x201695['dialPredictiveOptimizationPercentage']||0.03;this[_0x35b4('0x27')]=_0x201695[_0x35b4('0x27')]||0x258;this[_0x35b4('0x28')]=_0x201695[_0x35b4('0x28')]||_0x35b4('0x29');this[_0x35b4('0x2a')]=_0x201695[_0x35b4('0x2a')]||_0x35b4('0x29');this[_0x35b4('0x2b')]=_0x201695[_0x35b4('0x2b')]||0x1e;this[_0x35b4('0x2c')]=_0x201695[_0x35b4('0x2c')]||_0x35b4('0x2d');this[_0x35b4('0x2e')]=_0x201695[_0x35b4('0x2e')]||0x3;this[_0x35b4('0x2f')]=_0x201695[_0x35b4('0x2f')]||undefined;this[_0x35b4('0x30')]=_0x201695[_0x35b4('0x30')]||0x3;this[_0x35b4('0x31')]=_0x201695[_0x35b4('0x31')]||0x96;this['dialBusyMaxRetry']=_0x201695[_0x35b4('0x32')]||0x3;this[_0x35b4('0x33')]=_0x201695[_0x35b4('0x33')]||0x96;this[_0x35b4('0x34')]=_0x201695[_0x35b4('0x34')]||0x3;this[_0x35b4('0x35')]=_0x201695[_0x35b4('0x35')]||0x96;this[_0x35b4('0x36')]=_0x201695['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x201695[_0x35b4('0x37')]||0x96;this[_0x35b4('0x38')]=_0x201695[_0x35b4('0x38')]||0x3;this[_0x35b4('0x39')]=_0x201695[_0x35b4('0x39')]||0x96;this['dialAbandonedMaxRetry']=_0x201695['dialAbandonedMaxRetry']||0x3;this[_0x35b4('0x3a')]=_0x201695['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x201695[_0x35b4('0x3b')]||0x3;this[_0x35b4('0x3c')]=_0x201695[_0x35b4('0x3c')]||0x96;this[_0x35b4('0x3d')]=_0x201695['dialAgentRejectMaxRetry']||0x3;this[_0x35b4('0x3e')]=_0x201695[_0x35b4('0x3e')]||0x96;this[_0x35b4('0x3f')]=_0x201695[_0x35b4('0x3f')]||0x4;this[_0x35b4('0x40')]=_0x201695[_0x35b4('0x40')]?_0x201695[_0x35b4('0x40')]:undefined;this[_0x35b4('0x41')]=_0x201695['TrunkBackup']?_0x201695[_0x35b4('0x41')]:undefined;this[_0x35b4('0x42')]=_0x201695[_0x35b4('0x42')]||undefined;this[_0x35b4('0x43')]=_0x201695[_0x35b4('0x43')]?_0x201695['Interval']:undefined;this['dialOrderByScheduledAt']=_0x201695[_0x35b4('0x44')]||_0x35b4('0x45');this[_0x35b4('0x46')]=_0x201695[_0x35b4('0x46')]||undefined;this[_0x35b4('0x47')]=_0x201695[_0x35b4('0x47')]||undefined;this[_0x35b4('0x48')]=strategy[_0x201695[_0x35b4('0x48')]]||_0x35b4('0xa');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x201695['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x201695[_0x35b4('0x49')];this[_0x35b4('0x4a')]=_0x201695[_0x35b4('0x4a')];this[_0x35b4('0x4b')]=_0x201695[_0x35b4('0x4b')];this[_0x35b4('0x4c')]=_0x201695[_0x35b4('0x4c')];this[_0x35b4('0x4d')]=_0x201695[_0x35b4('0x4d')];this[_0x35b4('0x4e')]=_0x201695['dialAMDBetweenWordsSilence'];this[_0x35b4('0x4f')]=_0x201695[_0x35b4('0x4f')];this['dialAMDSilenceThreshold']=_0x201695[_0x35b4('0x50')];this[_0x35b4('0x51')]=_0x201695[_0x35b4('0x51')];this[_0x35b4('0x52')]=0x0;this[_0x35b4('0x53')]=0x0;this[_0x35b4('0x54')]=_0x201695[_0x35b4('0x54')];this[_0x35b4('0x55')]=0x0;this[_0x35b4('0x56')]=0x0;this[_0x35b4('0x57')]=0x0;this[_0x35b4('0x58')]=0x0;this[_0x35b4('0x59')]=0x0;this[_0x35b4('0x5a')]=0x0;this[_0x35b4('0x5b')]=0x0;this[_0x35b4('0x5c')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x35b4('0x5d')]=0x0;this[_0x35b4('0x5e')]=0x0;this[_0x35b4('0x5f')]=0x0;this[_0x35b4('0x60')]=0x0;this[_0x35b4('0x61')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this['handlePredictive']=undefined;this[_0x35b4('0x62')]=1.05;this[_0x35b4('0x63')]=0x0;this[_0x35b4('0x64')]=0x0;this[_0x35b4('0x65')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x35b4('0x66')]=0x0;this[_0x35b4('0x67')]=0x0;this[_0x35b4('0x68')]=0x0;this[_0x35b4('0x69')]=0x0;this[_0x35b4('0x6a')]=_0x201695[_0x35b4('0x6b')]||0x14;this[_0x35b4('0x6c')]=_0x201695[_0x35b4('0x6b')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x35b4('0x6d')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x35b4('0x6e')]=0x0;this['erlangCallToSecond']=0x0;this[_0x35b4('0x6f')]=0x0;this[_0x35b4('0x70')]=0x0;this[_0x35b4('0x71')]=_0x201695[_0x35b4('0x71')]||0x1e;this[_0x35b4('0x72')]=_0x201695[_0x35b4('0x72')]||![];this['dialQueueProject2']=_0x201695['dialQueueProject2']||undefined;this[_0x35b4('0x73')]=_0x201695['dialAgiAfterHangupClient']||![];this[_0x35b4('0x74')]=_0x201695[_0x35b4('0x74')]||![];this[_0x35b4('0xd')]=monitorFormat[_0x201695[_0x35b4('0xd')]]?monitorFormat[_0x201695[_0x35b4('0xd')]]:undefined;this['mandatoryDisposition']=_0x201695[_0x35b4('0x75')]||![];this['mandatoryDispositionPause']=_0x201695[_0x35b4('0x76')]?_0x201695[_0x35b4('0x76')]:undefined;}module[_0x35b4('0x77')]=VoiceQueue; \ No newline at end of file +var _0xe082=['startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','loggedIn','available','acw','acwTimeout','autopause','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe082,0x8f));var _0x2e08=function(_0x70bb8,_0x1da278){_0x70bb8=_0x70bb8-0x0;var _0x48ba84=_0xe082[_0x70bb8];return _0x48ba84;};'use strict';var statusDesc=[_0x2e08('0x0'),_0x2e08('0x1'),_0x2e08('0x2'),'busy',_0x2e08('0x3'),_0x2e08('0x4'),_0x2e08('0x5'),_0x2e08('0x6'),_0x2e08('0x7')];var monitorFormat={'wav':_0x2e08('0x8'),'wav49':_0x2e08('0x9'),'gsm':_0x2e08('0xa')};var strategy={'rrmemory':_0x2e08('0xb'),'roundrobin':_0x2e08('0xc')};function VoiceQueue(_0x1036b1){this['id']=_0x1036b1['id']||0x0;this[_0x2e08('0xd')]=_0x1036b1[_0x2e08('0xd')]||'';this[_0x2e08('0xe')]=_0x1036b1[_0x2e08('0xe')]||'';this['type']=_0x1036b1[_0x2e08('0xf')]||_0x2e08('0x10');this[_0x2e08('0x11')]=0x0;this[_0x2e08('0x12')]=0x0;this[_0x2e08('0x13')]=0x0;this[_0x2e08('0x14')]=0x0;this[_0x2e08('0x15')]=0x0;this['sumHoldTime']=0x0;this[_0x2e08('0x16')]=0x0;this[_0x2e08('0x17')]=0x0;this['abandoned']=0x0;this[_0x2e08('0x18')]=0x0;this[_0x2e08('0x19')]=0x0;this[_0x2e08('0x1a')]=_0x1036b1[_0x2e08('0x1a')]||![];this[_0x2e08('0x1b')]=_0x1036b1[_0x2e08('0x1b')]||0xa;this['autopause']=_0x1036b1[_0x2e08('0x1c')]||'no';this['sendMessageOneNotActive']=!![];this['message']='';this[_0x2e08('0x1d')]=0x0;this[_0x2e08('0x1e')]=0x0;this[_0x2e08('0x1f')]=_0x1036b1['dialTimezone']||null;this['dialGlobalInterval']=_0x1036b1[_0x2e08('0x20')]?_0x1036b1[_0x2e08('0x20')]:null;this[_0x2e08('0x21')]=_0x1036b1[_0x2e08('0x21')];this[_0x2e08('0x22')]=_0x1036b1[_0x2e08('0x22')]||'progressive';this[_0x2e08('0x23')]=_0x1036b1['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x1036b1[_0x2e08('0x24')]||0x0;this[_0x2e08('0x25')]=_0x1036b1[_0x2e08('0x25')]||0x1;this[_0x2e08('0x26')]=_0x1036b1[_0x2e08('0x26')]||_0x2e08('0x27');this[_0x2e08('0x28')]=_0x1036b1[_0x2e08('0x28')]||0.03;this[_0x2e08('0x29')]=_0x1036b1[_0x2e08('0x29')]||0x258;this['dialOriginateCallerIdName']=_0x1036b1['dialOriginateCallerIdName']||_0x2e08('0x2a');this[_0x2e08('0x2b')]=_0x1036b1[_0x2e08('0x2b')]||_0x2e08('0x2a');this[_0x2e08('0x2c')]=_0x1036b1[_0x2e08('0x2c')]||0x1e;this[_0x2e08('0x2d')]=_0x1036b1['dialQueueOptions']||_0x2e08('0x2e');this['dialQueueTimeout']=_0x1036b1[_0x2e08('0x2f')]||0x3;this[_0x2e08('0x30')]=_0x1036b1[_0x2e08('0x30')]||undefined;this[_0x2e08('0x31')]=_0x1036b1['dialCongestionMaxRetry']||0x3;this[_0x2e08('0x32')]=_0x1036b1[_0x2e08('0x32')]||0x96;this['dialBusyMaxRetry']=_0x1036b1[_0x2e08('0x33')]||0x3;this['dialBusyRetryFrequency']=_0x1036b1['dialBusyRetryFrequency']||0x96;this[_0x2e08('0x34')]=_0x1036b1[_0x2e08('0x34')]||0x3;this[_0x2e08('0x35')]=_0x1036b1[_0x2e08('0x35')]||0x96;this[_0x2e08('0x36')]=_0x1036b1['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1036b1['dialNoSuchNumberRetryFrequency']||0x96;this[_0x2e08('0x37')]=_0x1036b1[_0x2e08('0x37')]||0x3;this[_0x2e08('0x38')]=_0x1036b1[_0x2e08('0x38')]||0x96;this['dialAbandonedMaxRetry']=_0x1036b1[_0x2e08('0x39')]||0x3;this[_0x2e08('0x3a')]=_0x1036b1[_0x2e08('0x3a')]||0x96;this['dialMachineMaxRetry']=_0x1036b1[_0x2e08('0x3b')]||0x3;this['dialMachineRetryFrequency']=_0x1036b1[_0x2e08('0x3c')]||0x96;this[_0x2e08('0x3d')]=_0x1036b1[_0x2e08('0x3d')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1036b1[_0x2e08('0x3e')]||0x96;this[_0x2e08('0x3f')]=_0x1036b1['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x1036b1['Trunk']?_0x1036b1['Trunk']:undefined;this[_0x2e08('0x40')]=_0x1036b1[_0x2e08('0x40')]?_0x1036b1['TrunkBackup']:undefined;this[_0x2e08('0x41')]=_0x1036b1['dialPrefix']||undefined;this['Interval']=_0x1036b1[_0x2e08('0x42')]?_0x1036b1['Interval']:undefined;this[_0x2e08('0x43')]=_0x1036b1[_0x2e08('0x43')]||_0x2e08('0x44');this[_0x2e08('0x45')]=_0x1036b1[_0x2e08('0x45')]||undefined;this[_0x2e08('0x46')]=_0x1036b1['dialCutDigit']||undefined;this[_0x2e08('0x47')]=strategy[_0x1036b1[_0x2e08('0x47')]]||_0x2e08('0xb');this[_0x2e08('0x48')]=!![];this[_0x2e08('0x49')]=_0x1036b1[_0x2e08('0x49')]||![];this[_0x2e08('0x4a')]=_0x1036b1[_0x2e08('0x4a')];this[_0x2e08('0x4b')]=_0x1036b1[_0x2e08('0x4b')];this[_0x2e08('0x4c')]=_0x1036b1['dialAMDAfterGreetingSilence'];this[_0x2e08('0x4d')]=_0x1036b1[_0x2e08('0x4d')];this[_0x2e08('0x4e')]=_0x1036b1['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x1036b1[_0x2e08('0x4f')];this[_0x2e08('0x50')]=_0x1036b1[_0x2e08('0x50')];this[_0x2e08('0x51')]=_0x1036b1[_0x2e08('0x51')];this['dialAMDMaximumWordLength']=_0x1036b1[_0x2e08('0x52')];this[_0x2e08('0x53')]=0x0;this[_0x2e08('0x54')]=0x0;this[_0x2e08('0x55')]=_0x1036b1['timeout'];this[_0x2e08('0x56')]=0x0;this[_0x2e08('0x57')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x2e08('0x58')]=0x0;this[_0x2e08('0x59')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x2e08('0x5a')]=0x0;this[_0x2e08('0x5b')]=0x0;this[_0x2e08('0x5c')]=0x0;this[_0x2e08('0x5d')]=0x0;this[_0x2e08('0x5e')]=0x0;this[_0x2e08('0x5f')]=0x0;this[_0x2e08('0x60')]=0x0;this[_0x2e08('0x61')]=0x0;this[_0x2e08('0x62')]=undefined;this[_0x2e08('0x63')]=undefined;this[_0x2e08('0x64')]=undefined;this[_0x2e08('0x65')]=1.05;this[_0x2e08('0x66')]=0x0;this[_0x2e08('0x67')]=0x0;this[_0x2e08('0x68')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x2e08('0x69')]=0x0;this[_0x2e08('0x6a')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x2e08('0x6b')]=_0x1036b1['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x2e08('0x6c')]=_0x1036b1[_0x2e08('0x6d')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x2e08('0x6e')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x2e08('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x2e08('0x70')]=0x0;this['erlangBusyFactor']=0x0;this[_0x2e08('0x71')]=_0x1036b1[_0x2e08('0x71')]||0x1e;this[_0x2e08('0x72')]=_0x1036b1['dialRecallInQueue']||![];this[_0x2e08('0x73')]=_0x1036b1[_0x2e08('0x73')]||undefined;this['dialAgiAfterHangupClient']=_0x1036b1[_0x2e08('0x74')]||![];this[_0x2e08('0x75')]=_0x1036b1[_0x2e08('0x75')]||![];this['monitor_format']=monitorFormat[_0x1036b1[_0x2e08('0xe')]]?monitorFormat[_0x1036b1[_0x2e08('0xe')]]:undefined;this[_0x2e08('0x76')]=_0x1036b1['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x1036b1['mandatoryDispositionPause']?_0x1036b1[_0x2e08('0x77')]:undefined;}module[_0x2e08('0x78')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 498d3eb..3a842fc 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 _0x7e34=['username','accessKey','remoteUri','serverUrl','exports'];(function(_0x17de24,_0x1a46e9){var _0x5ee816=function(_0x5012a1){while(--_0x5012a1){_0x17de24['push'](_0x17de24['shift']());}};_0x5ee816(++_0x1a46e9);}(_0x7e34,0x87));var _0x47e3=function(_0x50c125,_0x657025){_0x50c125=_0x50c125-0x0;var _0x2f8a9a=_0x7e34[_0x50c125];return _0x2f8a9a;};'use strict';function VtigerAccount(_0x5d349c){this['id']=_0x5d349c['id']||0x0;this['name']=_0x5d349c['name']||'';this[_0x47e3('0x0')]=_0x5d349c[_0x47e3('0x0')]||'';this[_0x47e3('0x1')]=_0x5d349c[_0x47e3('0x1')]||'';this['remoteUri']=_0x5d349c[_0x47e3('0x2')]||'';this[_0x47e3('0x3')]=_0x5d349c[_0x47e3('0x3')]||'';this['Configurations']=_0x5d349c['Configurations']||{};}module[_0x47e3('0x4')]=VtigerAccount; \ No newline at end of file +var _0x699e=['remoteUri','serverUrl','Configurations','name','accessKey'];(function(_0x37756b,_0x24db76){var _0x46efec=function(_0x319807){while(--_0x319807){_0x37756b['push'](_0x37756b['shift']());}};_0x46efec(++_0x24db76);}(_0x699e,0x175));var _0xe699=function(_0x5d53ac,_0x5415f9){_0x5d53ac=_0x5d53ac-0x0;var _0x2a9615=_0x699e[_0x5d53ac];return _0x2a9615;};'use strict';function VtigerAccount(_0x428198){this['id']=_0x428198['id']||0x0;this[_0xe699('0x0')]=_0x428198[_0xe699('0x0')]||'';this['username']=_0x428198['username']||'';this[_0xe699('0x1')]=_0x428198[_0xe699('0x1')]||'';this[_0xe699('0x2')]=_0x428198['remoteUri']||'';this[_0xe699('0x3')]=_0x428198[_0xe699('0x3')]||'';this[_0xe699('0x4')]=_0x428198[_0xe699('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index c90f900..f72d18c 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 _0x4099=['exports','name','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations'];(function(_0x253318,_0x2e154e){var _0x1910b3=function(_0x455129){while(--_0x455129){_0x253318['push'](_0x253318['shift']());}};_0x1910b3(++_0x2e154e);}(_0x4099,0x141));var _0x9409=function(_0x609988,_0x507944){_0x609988=_0x609988-0x0;var _0x159984=_0x4099[_0x609988];return _0x159984;};'use strict';function ZendeskAccount(_0x56241e){this['id']=_0x56241e['id']||0x0;this['name']=_0x56241e[_0x9409('0x0')]||'';this['username']=_0x56241e['username']||'';this['password']=_0x56241e[_0x9409('0x1')]||'';this[_0x9409('0x2')]=_0x56241e['token']||'';this[_0x9409('0x3')]=_0x56241e[_0x9409('0x3')]||'';this[_0x9409('0x4')]=_0x56241e[_0x9409('0x4')]||'';this[_0x9409('0x5')]=_0x56241e[_0x9409('0x5')]||_0x9409('0x6');this['serverUrl']=_0x56241e[_0x9409('0x7')]||'';this[_0x9409('0x8')]=_0x56241e[_0x9409('0x8')]||{};}module[_0x9409('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x82fb=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x27f004,_0x1a1e9d){var _0x411a9d=function(_0x41a952){while(--_0x41a952){_0x27f004['push'](_0x27f004['shift']());}};_0x411a9d(++_0x1a1e9d);}(_0x82fb,0x15f));var _0xb82f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x82fb[_0x4565bf];return _0x5610ba;};'use strict';function ZendeskAccount(_0x32a6b8){this['id']=_0x32a6b8['id']||0x0;this['name']=_0x32a6b8[_0xb82f('0x0')]||'';this[_0xb82f('0x1')]=_0x32a6b8[_0xb82f('0x1')]||'';this[_0xb82f('0x2')]=_0x32a6b8[_0xb82f('0x2')]||'';this['token']=_0x32a6b8[_0xb82f('0x3')]||'';this[_0xb82f('0x4')]=_0x32a6b8[_0xb82f('0x4')]||'';this[_0xb82f('0x5')]=_0x32a6b8['authType']||'';this[_0xb82f('0x6')]=_0x32a6b8['type']||_0xb82f('0x7');this['serverUrl']=_0x32a6b8[_0xb82f('0x8')]||'';this['Configurations']=_0x32a6b8[_0xb82f('0x9')]||{};}module[_0xb82f('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 0436dcb..d04a43f 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 _0x68b1=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','description'];(function(_0x250fde,_0x11aabb){var _0x40c3e8=function(_0x12932f){while(--_0x12932f){_0x250fde['push'](_0x250fde['shift']());}};_0x40c3e8(++_0x11aabb);}(_0x68b1,0x8f));var _0x168b=function(_0x10f154,_0x12cf31){_0x10f154=_0x10f154-0x0;var _0xa58978=_0x68b1[_0x10f154];return _0xa58978;};'use strict';function ZohoAccount(_0x5cd3cb){this['id']=_0x5cd3cb['id']||0x0;this['name']=_0x5cd3cb['name']||'';this[_0x168b('0x0')]=_0x5cd3cb['description']||'';this['host']=_0x5cd3cb[_0x168b('0x1')]||'';this['zone']=_0x5cd3cb[_0x168b('0x2')]||'';this[_0x168b('0x3')]=_0x5cd3cb[_0x168b('0x3')]||'';this[_0x168b('0x4')]=_0x5cd3cb['clientSecret']||'';this[_0x168b('0x5')]=_0x5cd3cb['serverUrl']||'';this[_0x168b('0x6')]=_0x5cd3cb[_0x168b('0x6')]||'';this[_0x168b('0x7')]=_0x5cd3cb['refreshToken']||'';this[_0x168b('0x8')]=_0x5cd3cb[_0x168b('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x0183=['Configurations','exports','name','host','zone','clientSecret','serverUrl','code','refreshToken'];(function(_0x196854,_0x1a4f71){var _0x5f5023=function(_0x164185){while(--_0x164185){_0x196854['push'](_0x196854['shift']());}};_0x5f5023(++_0x1a4f71);}(_0x0183,0x197));var _0x3018=function(_0x174654,_0x38a11b){_0x174654=_0x174654-0x0;var _0x574521=_0x0183[_0x174654];return _0x574521;};'use strict';function ZohoAccount(_0x9c5e6e){this['id']=_0x9c5e6e['id']||0x0;this[_0x3018('0x0')]=_0x9c5e6e[_0x3018('0x0')]||'';this['description']=_0x9c5e6e['description']||'';this[_0x3018('0x1')]=_0x9c5e6e[_0x3018('0x1')]||'';this[_0x3018('0x2')]=_0x9c5e6e[_0x3018('0x2')]||'';this['clientId']=_0x9c5e6e['clientId']||'';this['clientSecret']=_0x9c5e6e[_0x3018('0x3')]||'';this[_0x3018('0x4')]=_0x9c5e6e['serverUrl']||'';this['code']=_0x9c5e6e[_0x3018('0x5')]||'';this[_0x3018('0x6')]=_0x9c5e6e[_0x3018('0x6')]||'';this[_0x3018('0x7')]=_0x9c5e6e[_0x3018('0x7')]||{};}module[_0x3018('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index aed67fc..36c39fe 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 _0x9021=['countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','isNil','string','uniqueid','name','type','campaigntype','queue','dialAnswer','membername','Agent','format','SIP/%s','calleridname','phone','firstName','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry'];(function(_0x526a30,_0x29b980){var _0x4fbc62=function(_0x5f5b6e){while(--_0x5f5b6e){_0x526a30['push'](_0x526a30['shift']());}};_0x4fbc62(++_0x29b980);}(_0x9021,0x145));var _0x1902=function(_0x299144,_0x461ddc){_0x299144=_0x299144-0x0;var _0x2f5bf2=_0x9021[_0x299144];return _0x2f5bf2;};'use strict';var util=require(_0x1902('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x42bc06,_0x91aff1,_0x479a95){var _0x564072='';if(!_[_0x1902('0x1')](_0x91aff1)&&_0x1902('0x2')===typeof _0x91aff1){_0x564072+=_0x91aff1;}if(!_[_0x1902('0x1')](_0x479a95)&&_0x1902('0x2')===typeof _0x479a95){_0x564072+='\x20'+_0x479a95;}if(_0x564072!==''){return _0x564072;}return _0x42bc06;}function Action(_0x3c481f,_0x1f53da,_0x1f3628,_0x4e9ab2,_0x25ca4d){this[_0x1902('0x3')]=_0x1f3628||undefined;this['idContact']=_0x3c481f['id'];this['queue']=_0x1f53da[_0x1902('0x4')];this[_0x1902('0x5')]=_0x1f53da[_0x1902('0x5')];this[_0x1902('0x6')]=_0x1902('0x7');this[_0x1902('0x8')]=![];this[_0x1902('0x9')]=_['isNil'](_0x3c481f['Agent'])?undefined:_0x3c481f[_0x1902('0xa')]['name'];this['channelAgent']=this[_0x1902('0x9')]?util[_0x1902('0xb')](_0x1902('0xc'),this['membername']):_0x4e9ab2||undefined;this[_0x1902('0xd')]=checkNameSurname(_0x3c481f['Contact'][_0x1902('0xe')],_0x3c481f['Contact'][_0x1902('0xf')],_0x3c481f[_0x1902('0x10')][_0x1902('0x11')]);this['active']=_0x3c481f[_0x1902('0x12')]||![];this[_0x1902('0x13')]=_0x3c481f['Contact']['phone'];this[_0x1902('0x14')]=_0x3c481f[_0x1902('0x14')];this[_0x1902('0x15')]=_0x3c481f[_0x1902('0x15')]||0x0;this[_0x1902('0x16')]=_0x3c481f[_0x1902('0x16')]||0x0;this['countnoanswerretry']=_0x3c481f[_0x1902('0x17')]||0x0;this[_0x1902('0x18')]=(_0x3c481f[_0x1902('0x15')]||0x0)+(_0x3c481f[_0x1902('0x16')]||0x0)+(_0x3c481f[_0x1902('0x17')]||0x0)+(_0x3c481f[_0x1902('0x19')]||0x0)+(_0x3c481f[_0x1902('0x1a')]||0x0)+(_0x3c481f[_0x1902('0x1b')]||0x0)+(_0x3c481f[_0x1902('0x1c')]||0x0)+(_0x3c481f[_0x1902('0x1d')]||0x0);this[_0x1902('0x19')]=_0x3c481f[_0x1902('0x19')]||0x0;this[_0x1902('0x1a')]=_0x3c481f[_0x1902('0x1a')]||0x0;this['countabandonedretry']=_0x3c481f[_0x1902('0x1b')]||0x0;this[_0x1902('0x1c')]=_0x3c481f[_0x1902('0x1c')]||0x0;this[_0x1902('0x1d')]=_0x3c481f[_0x1902('0x1d')]||0x0;this['callback']=_0x3c481f[_0x1902('0x1e')];this[_0x1902('0x1f')]=_0x3c481f[_0x1902('0x1f')];this['callbackat']=_0x3c481f[_0x1902('0x20')];this['recallme']=_0x3c481f[_0x1902('0x21')];this[_0x1902('0x22')]=_0x3c481f[_0x1902('0x22')];this[_0x1902('0x23')]=_0x3c481f[_0x1902('0x23')];this[_0x1902('0x24')]=_['isNil'](_0x3c481f[_0x1902('0xa')])?_0x3c481f['UserId']:_0x3c481f['Agent']['id'];this[_0x1902('0x25')]=_0x3c481f[_0x1902('0x25')];this[_0x1902('0x26')]='';this[_0x1902('0x27')]='';}Action[_0x1902('0x28')]['getCaller']=function(){return util[_0x1902('0xb')](_0x1902('0x29'),this[_0x1902('0xd')],this[_0x1902('0x2a')]);};module[_0x1902('0x2b')]=Action; \ No newline at end of file +var _0xef8c=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','phone','Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry'];(function(_0x329d8d,_0x48b6c2){var _0x3bf18f=function(_0x151e83){while(--_0x151e83){_0x329d8d['push'](_0x329d8d['shift']());}};_0x3bf18f(++_0x48b6c2);}(_0xef8c,0xea));var _0xcef8=function(_0x5d6392,_0x271a01){_0x5d6392=_0x5d6392-0x0;var _0x5808ab=_0xef8c[_0x5d6392];return _0x5808ab;};'use strict';var util=require(_0xcef8('0x0'));var _=require(_0xcef8('0x1'));var moment=require(_0xcef8('0x2'));function checkNameSurname(_0x23fc75,_0x71b903,_0x55ed3a){var _0x56a1bf='';if(!_[_0xcef8('0x3')](_0x71b903)&&_0xcef8('0x4')===typeof _0x71b903){_0x56a1bf+=_0x71b903;}if(!_[_0xcef8('0x3')](_0x55ed3a)&&_0xcef8('0x4')===typeof _0x55ed3a){_0x56a1bf+='\x20'+_0x55ed3a;}if(_0x56a1bf!==''){return _0x56a1bf;}return _0x23fc75;}function Action(_0x39c309,_0x166dd4,_0x2b0dd6,_0x2b7de8,_0x155def){this[_0xcef8('0x5')]=_0x2b0dd6||undefined;this[_0xcef8('0x6')]=_0x39c309['id'];this[_0xcef8('0x7')]=_0x166dd4[_0xcef8('0x8')];this[_0xcef8('0x9')]=_0x166dd4['type'];this[_0xcef8('0xa')]=_0xcef8('0x7');this[_0xcef8('0xb')]=![];this[_0xcef8('0xc')]=_['isNil'](_0x39c309[_0xcef8('0xd')])?undefined:_0x39c309[_0xcef8('0xd')][_0xcef8('0x8')];this[_0xcef8('0xe')]=this[_0xcef8('0xc')]?util[_0xcef8('0xf')]('SIP/%s',this[_0xcef8('0xc')]):_0x2b7de8||undefined;this['calleridname']=checkNameSurname(_0x39c309['Contact'][_0xcef8('0x10')],_0x39c309[_0xcef8('0x11')][_0xcef8('0x12')],_0x39c309[_0xcef8('0x11')][_0xcef8('0x13')]);this[_0xcef8('0x14')]=_0x39c309[_0xcef8('0x14')]||![];this[_0xcef8('0x15')]=_0x39c309[_0xcef8('0x11')][_0xcef8('0x10')];this[_0xcef8('0x16')]=_0x39c309['scheduledat'];this[_0xcef8('0x17')]=_0x39c309[_0xcef8('0x17')]||0x0;this[_0xcef8('0x18')]=_0x39c309['countcongestionretry']||0x0;this[_0xcef8('0x19')]=_0x39c309[_0xcef8('0x19')]||0x0;this['countglobal']=(_0x39c309[_0xcef8('0x17')]||0x0)+(_0x39c309[_0xcef8('0x18')]||0x0)+(_0x39c309['countnoanswerretry']||0x0)+(_0x39c309[_0xcef8('0x1a')]||0x0)+(_0x39c309[_0xcef8('0x1b')]||0x0)+(_0x39c309['countabandonedretry']||0x0)+(_0x39c309[_0xcef8('0x1c')]||0x0)+(_0x39c309[_0xcef8('0x1d')]||0x0);this[_0xcef8('0x1a')]=_0x39c309['countnosuchnumberretry']||0x0;this[_0xcef8('0x1b')]=_0x39c309[_0xcef8('0x1b')]||0x0;this[_0xcef8('0x1e')]=_0x39c309[_0xcef8('0x1e')]||0x0;this[_0xcef8('0x1c')]=_0x39c309[_0xcef8('0x1c')]||0x0;this[_0xcef8('0x1d')]=_0x39c309[_0xcef8('0x1d')]||0x0;this['callback']=_0x39c309['callback'];this[_0xcef8('0x1f')]=_0x39c309['callbackuniqueid'];this[_0xcef8('0x20')]=_0x39c309[_0xcef8('0x20')];this['recallme']=_0x39c309[_0xcef8('0x21')];this['ContactId']=_0x39c309[_0xcef8('0x22')];this['ListId']=_0x39c309[_0xcef8('0x23')];this[_0xcef8('0x24')]=_[_0xcef8('0x3')](_0x39c309['Agent'])?_0x39c309[_0xcef8('0x24')]:_0x39c309['Agent']['id'];this[_0xcef8('0x25')]=_0x39c309[_0xcef8('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype'][_0xcef8('0x26')]=function(){return util[_0xcef8('0xf')](_0xcef8('0x27'),this[_0xcef8('0x28')],this[_0xcef8('0x29')]);};module[_0xcef8('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index d94be18..6ae68ec 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 _0xbe80=['[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','isNil','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','setMessage','sendMessageOneNotActive','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','total','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','cause-txt','amd','[callProgressDetectingCustomer][hangupInAMD]','custom:amd','[callProgressDetectingCustomer][machine]','[default]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','SIP/%s','unlock','execRun','getContactPreview','recallme','validateContact','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','extractCalleridName','originatecalleridnum','merge','toLowerVariables','variablesAction','channelAgent','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','syncOriginateResponse','logLookAgent','clone','isFailure','response','unlockContact','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','addVariable','variables','syncVarSet','filterKey','keys','variable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','emit','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','callerid','format','voice:queue:%s','voice_queue:save','stringify','voice_queue_channel:remove','voice_queue_presence:remove','originated','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','logger','\x20is\x20disactive','syncCampaigns','booked','clearZombieChannels','hasOwnProperty','recallMe','clearZombieChannel','info','Queue','originated:\x20','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated'];(function(_0x53f945,_0x2c4ef7){var _0x127c8b=function(_0x26feb8){while(--_0x26feb8){_0x53f945['push'](_0x53f945['shift']());}};_0x127c8b(++_0x2c4ef7);}(_0xbe80,0xdf));var _0x0be8=function(_0x722d84,_0x5b02fa){_0x722d84=_0x722d84-0x0;var _0x4a7442=_0xbe80[_0x722d84];return _0x4a7442;};'use strict';var util=require(_0x0be8('0x0'));var _=require(_0x0be8('0x1'));var BPromise=require(_0x0be8('0x2'));var uuid=require(_0x0be8('0x3'));var moment=require(_0x0be8('0x4'));var md5=require(_0x0be8('0x5'));var Redis=require(_0x0be8('0x6'));var config=require('../../../config/environment');var logger=require(_0x0be8('0x7'))(_0x0be8('0x8'));var loggerAction=require('../../../config/logger')(_0x0be8('0x9'));var ami=require(_0x0be8('0xa'));var rpcDb=require(_0x0be8('0xb'));var Action=require(_0x0be8('0xc'));var ut=require(_0x0be8('0xd'));config[_0x0be8('0xe')]=_[_0x0be8('0xf')](config[_0x0be8('0xe')],{'host':_0x0be8('0x10'),'port':0x18eb});var io=require(_0x0be8('0x11'))(new Redis(config[_0x0be8('0xe')]));var Sequence=function(){};Sequence[_0x0be8('0x12')][_0x0be8('0x13')]=function(_0x28b3c7){this['tail']=this[_0x0be8('0x14')]?this[_0x0be8('0x14')][_0x0be8('0x15')](_0x28b3c7):_0x28b3c7();};function Preview(_0x5f3148){this[_0x0be8('0x16')]=new Sequence();this[_0x0be8('0x17')]=_0x5f3148['voiceQueues'];this[_0x0be8('0x18')]=_0x5f3148[_0x0be8('0x18')];this[_0x0be8('0x19')]={};this[_0x0be8('0x1a')]=_0x5f3148['agents'];this[_0x0be8('0x1b')]=0x0;ami['on'](_0x0be8('0x1c'),this['syncOriginateResponse'][_0x0be8('0x1d')](this));ami['on'](_0x0be8('0x1e'),this[_0x0be8('0x1f')][_0x0be8('0x1d')](this));ami['on'](_0x0be8('0x20'),this[_0x0be8('0x21')][_0x0be8('0x1d')](this));ami['on'](_0x0be8('0x22'),this[_0x0be8('0x23')][_0x0be8('0x1d')](this));ami['on'](_0x0be8('0x24'),this[_0x0be8('0x25')]['bind'](this));ami['on'](_0x0be8('0x26'),this['syncVarSet'][_0x0be8('0x1d')](this));ami['on']('attendedtransfer',this[_0x0be8('0x27')][_0x0be8('0x1d')](this));ami['on']('blindtransfer',this[_0x0be8('0x28')][_0x0be8('0x1d')](this));this[_0x0be8('0x29')](this[_0x0be8('0x17')]);}function emit(_0x1071e7,_0x1bf6b5,_0x20cacf){io['to'](_0x1071e7)[_0x0be8('0x2a')](_0x1bf6b5,_0x20cacf);}function emitCampaignPreview(_0x2ccbcd){if(_0x2ccbcd['type']===_0x0be8('0x2b')){var _0x294785={'id':_0x2ccbcd['id'],'name':_0x2ccbcd['name'],'strategy':_0x2ccbcd[_0x0be8('0x2c')],'answered':_0x2ccbcd[_0x0be8('0x2d')],'available':_0x2ccbcd[_0x0be8('0x2e')],'loggedIn':_0x2ccbcd[_0x0be8('0x2f')],'pTalking':_0x2ccbcd[_0x0be8('0x30')],'sumBillable':_0x2ccbcd[_0x0be8('0x31')],'sumDuration':_0x2ccbcd[_0x0be8('0x32')],'sumHoldTime':_0x2ccbcd[_0x0be8('0x33')]||0x0,'talking':_0x2ccbcd[_0x0be8('0x34')],'total':_0x2ccbcd['total'],'type':_0x2ccbcd[_0x0be8('0x35')],'unmanaged':_0x2ccbcd[_0x0be8('0x36')],'abandoned':_0x2ccbcd[_0x0be8('0x37')],'waiting':_0x2ccbcd['waiting'],'loggedInDb':_0x2ccbcd[_0x0be8('0x38')],'dialActive':_0x2ccbcd[_0x0be8('0x39')],'dialMethod':_0x2ccbcd[_0x0be8('0x3a')],'dialOriginateCallerIdName':_0x2ccbcd['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2ccbcd['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2ccbcd['dialOriginateTimeout'],'dialPrefix':_0x2ccbcd[_0x0be8('0x3b')],'outboundAnswerAgiCallsDay':_0x2ccbcd[_0x0be8('0x3c')],'outboundAnswerCallsDay':_0x2ccbcd[_0x0be8('0x3d')],'outboundBlacklistCallsDay':_0x2ccbcd[_0x0be8('0x3e')],'outboundBusyCallsDay':_0x2ccbcd[_0x0be8('0x3f')],'outboundCongestionCallsDay':_0x2ccbcd[_0x0be8('0x40')],'outboundDropCallsDayACS':_0x2ccbcd[_0x0be8('0x41')],'outboundDropCallsDayCallersExit':_0x2ccbcd[_0x0be8('0x42')],'outboundDropCallsDayTimeout':_0x2ccbcd['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x2ccbcd['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2ccbcd[_0x0be8('0x43')],'outboundOriginateFailureCallsDay':_0x2ccbcd[_0x0be8('0x44')],'outboundReCallsDay':_0x2ccbcd[_0x0be8('0x45')],'outboundRejectCallsDay':_0x2ccbcd['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2ccbcd[_0x0be8('0x46')],'outboundAbandonedCallsDay':_0x2ccbcd[_0x0be8('0x47')],'predictiveIntervalAnsweredCalls':_0x2ccbcd[_0x0be8('0x48')],'predictiveIntervalAvgHoldtime':_0x2ccbcd[_0x0be8('0x49')],'predictiveIntervalAvgTalktime':_0x2ccbcd['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x2ccbcd['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x2ccbcd[_0x0be8('0x4a')],'predictiveIntervalErlangCalls':_0x2ccbcd['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x2ccbcd[_0x0be8('0x4b')],'predictiveIntervalHitRate':_0x2ccbcd['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x2ccbcd['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x2ccbcd['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x2ccbcd[_0x0be8('0x4c')],'predictiveIntervalTotalCalls':_0x2ccbcd[_0x0be8('0x4d')],'message':_0x2ccbcd[_0x0be8('0x4e')],'originated':_0x2ccbcd['originated'],'erlangCalls':_0x2ccbcd[_0x0be8('0x4f')],'erlangCallToSecond':_0x2ccbcd[_0x0be8('0x50')],'erlangAbandonmentRate':_0x2ccbcd[_0x0be8('0x51')],'erlangBusyFactor':_0x2ccbcd[_0x0be8('0x52')],'startPredictive':_0x2ccbcd[_0x0be8('0x53')],'startProgressive':_0x2ccbcd[_0x0be8('0x54')]};if(_0x2ccbcd[_0x0be8('0x55')]){_0x294785[_0x0be8('0x55')]={'id':_0x2ccbcd['Trunk']['id'],'name':_0x2ccbcd[_0x0be8('0x55')][_0x0be8('0x56')],'active':_0x2ccbcd[_0x0be8('0x55')][_0x0be8('0x57')],'callerid':_0x2ccbcd[_0x0be8('0x55')][_0x0be8('0x58')]};}if(_0x2ccbcd['Interval']){_0x294785['Interval']={'id':_0x2ccbcd['Interval']['id'],'name':_0x2ccbcd['Interval'][_0x0be8('0x56')]};}var _0x3c3b8a=md5(JSON['stringify'](_0x294785));if(_0x2ccbcd[_0x0be8('0x5')]!==_0x3c3b8a){_0x2ccbcd[_0x0be8('0x5')]=_0x3c3b8a;emit(util[_0x0be8('0x59')](_0x0be8('0x5a'),_0x294785[_0x0be8('0x56')]),_0x0be8('0x5b'),_0x294785);}}}function emitVoiceQueueChannelRemove(_0x24ffab){logger['info']('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x0be8('0x5c')](_0x24ffab));emit(util['format']('voice:queue:%s',_0x24ffab['name']),_0x0be8('0x5d'),_0x24ffab);io[_0x0be8('0x2a')](_0x0be8('0x5e'),_0x24ffab);}function notSendMessagesQueue(_0x470987){if(_0x470987['sendMessageOneNotActive']){if(_0x470987[_0x0be8('0x5f')]===0x0&&_0x470987['pTalking']===0x0){_0x470987['sendMessageOneNotActive']=![];_0x470987[_0x0be8('0x2e')]=0x0;_0x470987['paused']=0x0;_0x470987[_0x0be8('0x4e')]=_0x0be8('0x60');ut['logger'](_0x0be8('0x61'),_0x470987['name']+'\x20is\x20not\x20active');}else{_0x470987[_0x0be8('0x4e')]=_0x0be8('0x62');ut[_0x0be8('0x63')](_0x0be8('0x61'),_0x470987['name']+_0x0be8('0x64'));}emitCampaignPreview(_0x470987);}}Preview[_0x0be8('0x12')]['loopCampaigns']=function(){var _0xbfca2f=this;setInterval(function(){_0xbfca2f[_0x0be8('0x65')]();},0x7cf);};Preview[_0x0be8('0x12')]['syncCampaigns']=function(){var _0x4e142c=this[_0x0be8('0x17')];this[_0x0be8('0x1b')]+=0x1;for(var _0x22fc4f in _0x4e142c){if(_0x4e142c['hasOwnProperty'](_0x22fc4f)&&(_0x4e142c[_0x22fc4f][_0x0be8('0x3a')]===_0x0be8('0x8')||_0x4e142c[_0x22fc4f][_0x0be8('0x3a')]===_0x0be8('0x66'))&&_0x4e142c[_0x22fc4f][_0x0be8('0x35')]===_0x0be8('0x2b')){if(this[_0x0be8('0x1b')]>0x7){this[_0x0be8('0x1b')]=0x0;this[_0x0be8('0x67')]();}}if(_0x4e142c[_0x0be8('0x68')](_0x22fc4f)&&_0x4e142c[_0x22fc4f]['dialMethod']===_0x0be8('0x8')&&_0x4e142c[_0x22fc4f]['type']===_0x0be8('0x2b')){if(_0x4e142c[_0x22fc4f][_0x0be8('0x39')]){this['setMessage'](_0x4e142c[_0x22fc4f]);this[_0x0be8('0x69')](_0x4e142c[_0x22fc4f]);}else{notSendMessagesQueue(_0x4e142c[_0x22fc4f]);}}}};Preview[_0x0be8('0x12')][_0x0be8('0x6a')]=function(_0x1ee051){var _0x38ac9d=this;this[_0x0be8('0x16')]['enqueue'](function(){if(!_['isNil'](_0x38ac9d[_0x0be8('0x19')][_0x1ee051])){loggerAction[_0x0be8('0x6b')]('[clearZombieChannels][talking]',_0x1ee051,_0x0be8('0x6c'),_0x38ac9d[_0x0be8('0x19')][_0x1ee051]['queue'],_0x0be8('0x6d'),JSON[_0x0be8('0x5c')](_0x38ac9d[_0x0be8('0x17')][_0x38ac9d[_0x0be8('0x19')][_0x1ee051][_0x0be8('0x6e')]][_0x0be8('0x5f')]),_0x0be8('0x6f'),JSON['stringify'](_0x38ac9d['campaignsPreview'][_0x38ac9d[_0x0be8('0x19')][_0x1ee051]['queue']]['pTalking']),JSON[_0x0be8('0x5c')](_0x38ac9d[_0x0be8('0x19')][_0x1ee051][_0x0be8('0x70')]),JSON[_0x0be8('0x5c')](_[_0x0be8('0x71')](_0x38ac9d['actions'][_0x1ee051],[_0x0be8('0x72'),_0x0be8('0x73'),'VoiceQueueId','ListId'])));return ami[_0x0be8('0x74')]({'action':_0x0be8('0x75'),'channel':_0x38ac9d['actions'][_0x1ee051][_0x0be8('0x76')]})[_0x0be8('0x77')](function(_0x5344b6){if(_0x5344b6[_0x0be8('0x4e')]===_0x0be8('0x78')){setTimeout(function(){if(_0x38ac9d[_0x0be8('0x19')][_0x1ee051]){ut[_0x0be8('0x79')](_0x38ac9d[_0x0be8('0x17')][_0x38ac9d[_0x0be8('0x19')][_0x1ee051][_0x0be8('0x6e')]],_0x0be8('0x7a'));if(_0x38ac9d['actions'][_0x1ee051]['dialAnswer']===!![]){ut[_0x0be8('0x7b')](_0x38ac9d[_0x0be8('0x17')][_0x38ac9d[_0x0be8('0x19')][_0x1ee051][_0x0be8('0x6e')]],_0x0be8('0x7a'));ut['loggerError'](_0x0be8('0x7c')+_0x1ee051,_0x38ac9d['actions'][_0x1ee051][_0x0be8('0x6e')]);}ut[_0x0be8('0x7d')](_0x0be8('0x7e')+_0x1ee051,_0x38ac9d['actions'][_0x1ee051][_0x0be8('0x6e')]);delete _0x38ac9d[_0x0be8('0x19')][_0x1ee051];}},0x2328);}});}});};Preview['prototype'][_0x0be8('0x67')]=function(){var _0x1643e5=this;loggerAction[_0x0be8('0x6b')](_0x0be8('0x7f'),_[_0x0be8('0x80')](this[_0x0be8('0x19')]));for(var _0x18143e in this[_0x0be8('0x19')]){if(_0x1643e5['actions'][_0x0be8('0x68')](_0x18143e)){_0x1643e5[_0x0be8('0x6a')](_0x18143e);}}};Preview[_0x0be8('0x12')][_0x0be8('0x69')]=function(_0x2a0d96){var _0x5dfd0f=this;rpcDb[_0x0be8('0x81')](_0x2a0d96['id'],ut[_0x0be8('0x82')](this[_0x0be8('0x1a')]))[_0x0be8('0x83')](function(_0x1351e6){if(!_[_0x0be8('0x84')](_0x1351e6)){for(var _0x34005e=0x0;_0x34005e<_0x1351e6[_0x0be8('0x85')];_0x34005e+=0x1){if(ut[_0x0be8('0x86')](_0x1351e6[_0x34005e]['scheduledat'])<_0x2a0d96[_0x0be8('0x87')]*0x3c){if(_0x1351e6[_0x34005e][_0x0be8('0x88')]&&!_0x1351e6[_0x34005e][_0x0be8('0x88')][_0x0be8('0x89')]){_0x5dfd0f[_0x0be8('0x8a')](_0x1351e6[_0x34005e]['id'])[_0x0be8('0x83')](ut[_0x0be8('0x8b')](_0x0be8('0x8c')))['catch'](ut[_0x0be8('0x8b')]('[RecallMe]'));}else{rpcDb[_0x0be8('0x8d')](_0x1351e6[_0x34005e]['id']);}}else{var _0x1d6e1c=new Action(_0x1351e6[_0x34005e],_0x2a0d96);_0x1d6e1c[_0x0be8('0x8e')]=moment()['format'](_0x0be8('0x8f'));_0x2a0d96[_0x0be8('0x45')]+=0x1;ut[_0x0be8('0x90')](_0x1d6e1c,0x17,_0x0be8('0x91'));if(_0x2a0d96[_0x0be8('0x92')]){rpcDb[_0x0be8('0x93')](ut[_0x0be8('0x94')](_0x1351e6[_0x34005e]));rpcDb[_0x0be8('0x95')](_0x1d6e1c,_0x0be8('0x96'));}else{ut[_0x0be8('0x90')](_0x1d6e1c,0x16,_0x0be8('0x97'));rpcDb[_0x0be8('0x95')](_0x1d6e1c,_0x0be8('0x98'));rpcDb['createCustomerFinal'](_0x1d6e1c,_0x0be8('0x98'));}}}}})['catch'](ut['logger2'](_0x0be8('0x99')));};Preview[_0x0be8('0x12')][_0x0be8('0x9a')]=function(_0x1aed62){_0x1aed62[_0x0be8('0x9b')]=!![];if(ut['IsNotLoggedIn'](_0x1aed62['loggedIn'])){_0x1aed62[_0x0be8('0x4e')]=_0x0be8('0x9c');}else if(!ut[_0x0be8('0x9d')](_0x1aed62['dialActive'])){_0x1aed62[_0x0be8('0x4e')]=_0x0be8('0x60');}else if(!this[_0x0be8('0x9e')](_0x1aed62[_0x0be8('0x55')])){if(!this['isTrunkReachable'](_0x1aed62[_0x0be8('0x9f')])){_0x1aed62['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x1aed62['message']=_0x0be8('0xa0');}}else{_0x1aed62[_0x0be8('0x4e')]=_0x0be8('0xa0');}emitCampaignPreview(_0x1aed62);};Preview['prototype']['callProgressDetectingCustomer']=function(_0x2c3dcb,_0x12adcb,_0x49b54b){var _0x219482=this;var _0x3deaca=this['actions'][_0x12adcb];var _0x4c768d=this['campaignsPreview'][_0x3deaca[_0x0be8('0x6e')]];var _0x4153b5;if(_0x4c768d){switch(_0x49b54b){case'1':_0x4c768d[_0x0be8('0x43')]+=0x1;_0x3deaca[_0x0be8('0xa1')]+=0x1;_0x3deaca['countglobal']=ut[_0x0be8('0xa2')](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0x0,_0x0be8('0xa3'));ami[_0x0be8('0x2a')](_0x0be8('0xa4'),ut[_0x0be8('0xa5')](_0x3deaca,_0x0be8('0xa6')));rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xa7'));if(ut[_0x0be8('0xa2')](_0x3deaca)>=_0x4c768d[_0x0be8('0xa8')]){_0x4153b5=ut['cloneAction'](_0x3deaca,0xf,'Global');rpcDb[_0x0be8('0xa9')](_0x4153b5,_0x0be8('0xaa'));}else{if(_0x3deaca['countnosuchnumberretry']>=_0x4c768d[_0x0be8('0xab')]){rpcDb['createCustomerFinal'](_0x3deaca,_0x0be8('0xaa'));}else{rpcDb[_0x0be8('0xac')](ut[_0x0be8('0xad')](_0x3deaca,'countnosuchnumberretry',_0x4c768d['dialNoSuchNumberRetryFrequency']),_0x3deaca[_0x0be8('0xae')],_0x3deaca[_0x0be8('0xaf')]);}}delete this[_0x0be8('0x19')][_0x2c3dcb[_0x0be8('0xb0')]];break;case _0x0be8('0xb1'):var _0x30b202=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3deaca[_0x0be8('0xb2')]=_0x30b202;_0x3deaca[_0x0be8('0xb3')]=_0x30b202;_0x3deaca[_0x0be8('0x70')]=!![];_0x4c768d[_0x0be8('0x30')]+=0x1;logger[_0x0be8('0x6b')]('[syncHangup][talking][increment]',_0x3deaca[_0x0be8('0xb4')],_0x0be8('0xb5'),_0x4c768d[_0x0be8('0x56')],_0x0be8('0x6f'),_0x4c768d[_0x0be8('0x30')]);ami['emit'](_0x0be8('0xb6'),ut['buildObj'](_0x3deaca,_0x0be8('0xb7'),this[_0x0be8('0x17')][_0x3deaca['queue']]));if(_0x4c768d[_0x0be8('0xb8')]){ami['emit']('custom:agentConnectPreview',ut[_0x0be8('0xb9')](_0x3deaca));}break;case'16':ami[_0x0be8('0x2a')](_0x0be8('0xba'),ut[_0x0be8('0xa5')](_0x3deaca,_0x0be8('0xbb'),this[_0x0be8('0x17')][_0x3deaca[_0x0be8('0x6e')]]));emitVoiceQueueChannelRemove(ut[_0x0be8('0xa5')](_0x3deaca,'complete'));_0x4c768d[_0x0be8('0x3d')]+=0x1;_0x4c768d[_0x0be8('0xbc')]+=0x1;_0x4c768d[_0x0be8('0x2d')]+=0x1;ut[_0x0be8('0x7b')](_0x4c768d,_0x0be8('0xbd'));_0x3deaca[_0x0be8('0xbe')]=ut['totalGlobal'](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0x4,_0x0be8('0xbf'));rpcDb['createCustomerHistory'](_0x3deaca,_0x0be8('0xc0'));rpcDb[_0x0be8('0xa9')](_0x3deaca,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x0be8('0xc1')](_0x3deaca);_0x4c768d[_0x0be8('0x32')]+=_0x3deaca[_0x0be8('0xc2')];_0x4c768d[_0x0be8('0x31')]+=_0x3deaca[_0x0be8('0xc2')];logger[_0x0be8('0x6b')](_0x0be8('0xc3'),_0x3deaca[_0x0be8('0xb4')],_0x0be8('0xb5'),_0x4c768d['name'],_0x0be8('0x6f'),_0x4c768d[_0x0be8('0x30')]);delete this[_0x0be8('0x19')][_0x2c3dcb['linkedid']];break;case'BUSY':_0x4c768d[_0x0be8('0x3f')]+=0x1;_0x3deaca['countbusyretry']+=0x1;_0x3deaca[_0x0be8('0xbe')]=ut[_0x0be8('0xa2')](_0x3deaca);ut['logCustomer'](_0x3deaca,0x5,_0x0be8('0xc4'));ami['emit'](_0x0be8('0xc5'),ut[_0x0be8('0xa5')](_0x3deaca,_0x0be8('0xc6')));rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xc7'));if(ut[_0x0be8('0xa2')](_0x3deaca)>=_0x4c768d[_0x0be8('0xa8')]){_0x4153b5=ut[_0x0be8('0xc8')](_0x3deaca,0xf,_0x0be8('0xc9'));rpcDb[_0x0be8('0xa9')](_0x4153b5,_0x0be8('0xca'));}else{if(_0x3deaca[_0x0be8('0xcb')]>=_0x4c768d[_0x0be8('0xcc')]){rpcDb['createCustomerFinal'](_0x3deaca,_0x0be8('0xc7'));}else{rpcDb[_0x0be8('0xac')](ut['scheduledAt'](_0x3deaca,_0x0be8('0xcb'),_0x4c768d[_0x0be8('0xcd')]),_0x3deaca['unlockAgent'],_0x3deaca['activeContact']);}}break;case'NOANSWER':_0x4c768d[_0x0be8('0xce')]+=0x1;_0x3deaca[_0x0be8('0xcf')]+=0x1;_0x3deaca[_0x0be8('0xbe')]=ut['totalGlobal'](_0x3deaca);ut['logCustomer'](_0x3deaca,0x3,_0x0be8('0xd0'));ami['emit']('custom:agentnoanswer',ut[_0x0be8('0xa5')](_0x3deaca,_0x0be8('0xd1')));rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xd2'));if(ut['totalGlobal'](_0x3deaca)>=_0x4c768d['dialGlobalMaxRetry']){_0x4153b5=ut[_0x0be8('0xc8')](_0x3deaca,0xf,'Global');rpcDb[_0x0be8('0xa9')](_0x4153b5,_0x0be8('0xd3'));}else{if(_0x3deaca['countnoanswerretry']>=_0x4c768d[_0x0be8('0xd4')]){rpcDb[_0x0be8('0xa9')](_0x3deaca,_0x0be8('0xd2'));}else{rpcDb['rescheduleContact'](ut[_0x0be8('0xad')](_0x3deaca,'countnoanswerretry',_0x4c768d[_0x0be8('0xd5')]),_0x3deaca[_0x0be8('0xae')],_0x3deaca[_0x0be8('0xaf')]);}}break;case _0x0be8('0xd6'):_0x4c768d[_0x0be8('0x40')]+=0x1;_0x3deaca['countcongestionretry']+=0x1;_0x3deaca[_0x0be8('0xbe')]=ut[_0x0be8('0xa2')](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0x8,'Congestion');ami[_0x0be8('0x2a')]('custom:agentcongestion',ut[_0x0be8('0xa5')](_0x3deaca,'congestion'));rpcDb['createCustomerHistory'](_0x3deaca,_0x0be8('0xd7'));if(ut[_0x0be8('0xa2')](_0x3deaca)>=_0x4c768d[_0x0be8('0xa8')]){_0x4153b5=ut[_0x0be8('0xc8')](_0x3deaca,0xf,_0x0be8('0xc9'));rpcDb[_0x0be8('0xa9')](_0x4153b5,_0x0be8('0xd8'));}else{if(_0x3deaca[_0x0be8('0xd9')]>=_0x4c768d[_0x0be8('0xda')]){rpcDb[_0x0be8('0xa9')](_0x3deaca,_0x0be8('0xd7'));}else{rpcDb[_0x0be8('0xac')](ut[_0x0be8('0xad')](_0x3deaca,'countcongestionretry',_0x4c768d[_0x0be8('0xcd')]),_0x3deaca[_0x0be8('0xae')],_0x3deaca[_0x0be8('0xaf')]);}}break;case _0x0be8('0xdb'):_0x4c768d[_0x0be8('0xdc')]+=0x1;_0x3deaca[_0x0be8('0xdd')]+=0x1;_0x3deaca[_0x0be8('0xbe')]=ut[_0x0be8('0xa2')](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0x14,_0x0be8('0xde'));ami[_0x0be8('0x2a')](_0x0be8('0xdf'),ut[_0x0be8('0xa5')](_0x3deaca,_0x0be8('0xe0')));rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xe1'));if(ut[_0x0be8('0xa2')](_0x3deaca)>=_0x4c768d[_0x0be8('0xa8')]){_0x4153b5=ut[_0x0be8('0xc8')](_0x3deaca,0x14,_0x0be8('0xde'));rpcDb['createCustomerFinal'](_0x4153b5,_0x0be8('0xe2'));}else{if(_0x3deaca[_0x0be8('0xdd')]>=_0x4c768d[_0x0be8('0xe3')]){rpcDb[_0x0be8('0xa9')](_0x3deaca,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0be8('0xac')](ut[_0x0be8('0xad')](_0x3deaca,_0x0be8('0xdd'),_0x4c768d[_0x0be8('0xe4')]),_0x3deaca['unlockAgent'],_0x3deaca['activeContact']);}}break;case _0x0be8('0xe5'):_0x4c768d[_0x0be8('0x47')]+=0x1;_0x3deaca[_0x0be8('0xe6')]+=0x1;_0x3deaca[_0x0be8('0xbe')]=ut['totalGlobal'](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0xb,_0x0be8('0xe7'));rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xe8'));if(ut['totalGlobal'](_0x3deaca)>=_0x4c768d[_0x0be8('0xa8')]){_0x4153b5=ut['cloneAction'](_0x3deaca,0xf,_0x0be8('0xc9'));rpcDb['createCustomerFinal'](_0x4153b5,_0x0be8('0xe8'));}else{if(_0x3deaca[_0x0be8('0xe9')]>=_0x4c768d[_0x0be8('0xea')]){rpcDb[_0x0be8('0xa9')](_0x3deaca,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0x0be8('0xac')](ut[_0x0be8('0xad')](_0x3deaca,'countabandonedretry',_0x4c768d['dialAbandonedRetryFrequency']),_0x3deaca[_0x0be8('0xae')],_0x3deaca[_0x0be8('0xaf')]);}}break;case'18':_0x4c768d['outboundUnknownCallsDay']+=0x1;_0x3deaca['countmachineretry']+=0x1;_0x3deaca['countglobal']=ut[_0x0be8('0xa2')](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0x12,_0x2c3dcb[_0x0be8('0xeb')]||_0x2c3dcb['dialstatus']);ami['emit']('custom:amd',ut[_0x0be8('0xa5')](_0x3deaca,_0x0be8('0xec')));rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xed'));if(ut[_0x0be8('0xa2')](_0x3deaca)>=_0x4c768d[_0x0be8('0xa8')]){_0x4153b5=ut['cloneAction'](_0x3deaca,0xf,_0x0be8('0xc9'));rpcDb['createCustomerFinal'](_0x4153b5,_0x0be8('0xed'));}else{rpcDb[_0x0be8('0xa9')](_0x3deaca,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x0be8('0x19')][_0x2c3dcb['linkedid']];break;case'19':_0x4c768d[_0x0be8('0x46')]+=0x1;_0x3deaca[_0x0be8('0xbe')]=ut['totalGlobal'](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0x13,_0x2c3dcb[_0x0be8('0xeb')]||_0x2c3dcb['dialstatus']);ami[_0x0be8('0x2a')](_0x0be8('0xee'),ut[_0x0be8('0xa5')](_0x3deaca,'amd'));rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xef'));if(ut[_0x0be8('0xa2')](_0x3deaca)>=_0x4c768d['dialGlobalMaxRetry']){_0x4153b5=ut[_0x0be8('0xc8')](_0x3deaca,0xf,'Global');rpcDb[_0x0be8('0xa9')](_0x4153b5,_0x0be8('0xef'));}else{rpcDb['createCustomerFinal'](_0x3deaca,_0x0be8('0xef'));}delete this[_0x0be8('0x19')][_0x2c3dcb[_0x0be8('0xb0')]];break;default:if(_0x3deaca[_0x0be8('0x70')]){ut[_0x0be8('0x7b')](_0x4c768d,_0x0be8('0xf0'));ut[_0x0be8('0x7d')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x4c768d[_0x0be8('0x56')],_0x2c3dcb);}_0x4c768d[_0x0be8('0x46')]+=0x1;_0x3deaca[_0x0be8('0xbe')]=ut[_0x0be8('0xa2')](_0x3deaca);ut[_0x0be8('0x90')](_0x3deaca,0xc,_0x2c3dcb[_0x0be8('0xeb')]||_0x2c3dcb[_0x0be8('0xf1')]);rpcDb[_0x0be8('0x95')](_0x3deaca,_0x0be8('0xf2'));if(ut['totalGlobal'](_0x3deaca)>=_0x4c768d[_0x0be8('0xa8')]){_0x4153b5=ut[_0x0be8('0xc8')](_0x3deaca,0xf,_0x0be8('0xc9'));rpcDb[_0x0be8('0xa9')](_0x4153b5,_0x0be8('0xf3'));}else{rpcDb['createCustomerFinal'](_0x3deaca,_0x0be8('0xf3'));}delete this[_0x0be8('0x19')][_0x2c3dcb[_0x0be8('0xb0')]];}if(!(_0x3deaca[_0x0be8('0x70')]&&_0x49b54b==='16')){ut[_0x0be8('0x79')](_0x4c768d,_0x0be8('0xf4'));logger[_0x0be8('0x6b')](_0x0be8('0xf5'),_0x3deaca['uniqueid'],_0x0be8('0xb5'),_0x4c768d[_0x0be8('0x56')],_0x0be8('0x6d'),_0x4c768d[_0x0be8('0x5f')]);}if(_0x49b54b!==_0x0be8('0xb1')){delete this[_0x0be8('0x19')][_0x2c3dcb[_0x0be8('0xb0')]];delete this[_0x0be8('0x19')][_0x2c3dcb[_0x0be8('0xf6')]];}}};Preview[_0x0be8('0x12')][_0x0be8('0xf7')]=function(_0x5d2542,_0x4fee0e,_0x1f00c8){if(_['isUndefined'](_0x4fee0e)&&_0x0be8('0xf8')!==typeof _0x4fee0e){return;}if(_[_0x0be8('0xf9')](_0x1f00c8)&&_0x0be8('0xf8')!==typeof _0x1f00c8){return;}switch(_0x1f00c8[_0x0be8('0xfa')]){case'0':ut[_0x0be8('0xfb')](_0x5d2542,0x0,'NoSuchNumber');rpcDb[_0x0be8('0xfc')](_0x5d2542,_0x0be8('0xfd'));break;case'3':ut[_0x0be8('0xfb')](_0x5d2542,0x3,'NoAnswer');rpcDb[_0x0be8('0xfc')](_0x5d2542,_0x0be8('0xfe'));break;case'5':ut[_0x0be8('0xfb')](_0x5d2542,0x5,_0x0be8('0xc4'));rpcDb['createAgentHistory'](_0x5d2542,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0x0be8('0xfb')](_0x5d2542,0x8,'Congestion');rpcDb[_0x0be8('0xfc')](_0x5d2542,_0x0be8('0xff'));break;case'22':ut[_0x0be8('0xfb')](_0x5d2542,0x16,_0x0be8('0x100'));rpcDb[_0x0be8('0xfc')](_0x5d2542,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x5d2542,0xc,_0x1f00c8['reason']);rpcDb['createAgentHistory'](_0x5d2542,_0x0be8('0xff'));}ut['updateOriginated'](_0x4fee0e,'[callProgressDetectingAgent]');logger['info'](_0x0be8('0x101'),_0x5d2542['uniqueid'],_0x0be8('0xb5'),_0x4fee0e[_0x0be8('0x56')],'originated:\x20',_0x4fee0e['originated']);delete this[_0x0be8('0x19')][_0x5d2542[_0x0be8('0xb4')]];};Preview[_0x0be8('0x12')][_0x0be8('0x102')]=function(_0x767870,_0x14d4b2,_0x1981a8,_0x5a07a7,_0x58bc55){var _0x43d751=this;return new BPromise(function(_0x20cb77,_0x4181f2){if(_[_0x0be8('0x84')](_0x14d4b2)||_['isNil'](_0x14d4b2[_0x0be8('0x103')])||_[_0x0be8('0x84')](_0x14d4b2['Contact'][_0x0be8('0x104')])||_[_0x0be8('0x84')](_0x14d4b2[_0x0be8('0x105')])){_0x4181f2(ut[_0x0be8('0x4e')](_0x0be8('0x106'),_0x5a07a7,_0x58bc55));return;}var _0x1fc812=uuid['v4']();var _0x15446c=_0x43d751[_0x0be8('0x17')][_0x14d4b2[_0x0be8('0x6c')][_0x0be8('0x56')]];var _0x95ed8e=_0x1981a8?_0x43d751['agents'][_0x1981a8]['id']:undefined;_0x43d751[_0x0be8('0x19')][_0x1fc812]=new Action(_0x14d4b2,_0x15446c,_0x1fc812,_0x1981a8,_0x95ed8e);var _0x4eecf2=_0x43d751[_0x0be8('0x19')][_0x1fc812];_0x4eecf2['unlockAgent']=_0x5a07a7;_0x4eecf2['activeContact']=_0x58bc55;_0x4eecf2[_0x0be8('0x107')]=_0x1981a8;if(_[_0x0be8('0x108')](_0x767870)){_0x43d751[_0x0be8('0x109')](_0x4eecf2,_0x15446c,_0x14d4b2,_0x1981a8)['then'](function(_0x18300a){logger[_0x0be8('0x6b')](_0x0be8('0x10a'),'Queue:\x20'+_0x4eecf2[_0x0be8('0x6e')]+_0x0be8('0x10b')+_0x4eecf2[_0x0be8('0x10c')],JSON[_0x0be8('0x5c')](_0x18300a));ami[_0x0be8('0x2a')](_0x0be8('0x10d'),ut['buildObj'](_0x4eecf2,_0x0be8('0x10e'),_0x43d751[_0x0be8('0x17')][_0x4eecf2[_0x0be8('0x6e')]]));_0x20cb77(ut[_0x0be8('0x4e')](_0x0be8('0x10f')));})[_0x0be8('0x77')](function(_0x2276a6){ut['logger'](_0x0be8('0x110'),_0x2276a6);_0x4181f2(ut[_0x0be8('0x4e')](_0x0be8('0x111'),_0x5a07a7,_0x58bc55));});}else{_0x15446c[_0x0be8('0x3e')]+=0x1;ut[_0x0be8('0x112')](_0x4eecf2);rpcDb['createHistory'](_0x4eecf2,_0x0be8('0x113'));delete _0x43d751[_0x0be8('0x19')][_0x1fc812];_0x4181f2(ut[_0x0be8('0x4e')]('Contact\x20in\x20black\x20List',_0x5a07a7,_0x58bc55));}});};Preview[_0x0be8('0x12')][_0x0be8('0x9e')]=function(_0x44a29a){return!_[_0x0be8('0x84')](_0x44a29a)&&!_[_0x0be8('0x84')](_0x44a29a[_0x0be8('0x56')])&&!_[_0x0be8('0x84')](_0x44a29a['active'])&&_0x44a29a['active']&&!_[_0x0be8('0x84')](this[_0x0be8('0x18')][util[_0x0be8('0x59')](_0x0be8('0x114'),_0x44a29a[_0x0be8('0x56')])])&&!_[_0x0be8('0x84')](this[_0x0be8('0x18')][util[_0x0be8('0x59')]('SIP/%s',_0x44a29a[_0x0be8('0x56')])][_0x0be8('0x75')])&&(this[_0x0be8('0x18')][util[_0x0be8('0x59')](_0x0be8('0x114'),_0x44a29a[_0x0be8('0x56')])][_0x0be8('0x75')]==='reachable'||this[_0x0be8('0x18')][util[_0x0be8('0x59')]('SIP/%s',_0x44a29a[_0x0be8('0x56')])][_0x0be8('0x75')]==='unmonitored');};Preview['prototype'][_0x0be8('0x8a')]=function(_0x1c331f,_0x69652f){var _0x2763d0=this;return new BPromise(function(_0xa839e2,_0x520984){_0x2763d0['execRun'](_0x1c331f,_0x69652f)[_0x0be8('0x83')](function(_0x1e9728){_0xa839e2(_[_0x0be8('0x71')](_0x1e9728,[_0x0be8('0x4e')]));})[_0x0be8('0x77')](function(_0x52a609){if(_0x52a609[_0x0be8('0x115')]){rpcDb['unlockContact'](_0x1c331f);}if(_0x52a609[_0x0be8('0x57')]){rpcDb[_0x0be8('0x8d')](_0x1c331f);}_0x520984(_['pick'](_0x52a609,[_0x0be8('0x4e')]));});});};Preview['prototype'][_0x0be8('0x116')]=function(_0x38d120,_0x50b5bd){var _0x4edc42=this;return new BPromise(function(_0x5e6b9f,_0x4cb6c7){var _0x55e206,_0x4402b3;rpcDb[_0x0be8('0x117')](_0x38d120)[_0x0be8('0x83')](function(_0x2c03bb){if(!_[_0x0be8('0x84')](_0x2c03bb[0x0])){_0x4402b3=_0x2c03bb[0x0][_0x0be8('0x118')]?![]:!![];_0x55e206=_0x2c03bb[0x0]['recallme']?!![]:![];_0x55e206=_0x50b5bd?!![]:_0x55e206;}var _0x45df8e=_0x4edc42[_0x0be8('0x119')](_0x2c03bb);if(_0x45df8e['isValid']){rpcDb['checkIsBlackList'](_[_0x0be8('0x71')](_0x2c03bb[0x0],[_0x0be8('0x105'),_0x0be8('0x11a')]))[_0x0be8('0x83')](function(_0x307a4e){_0x4edc42[_0x0be8('0x102')](_0x307a4e,_0x2c03bb[0x0],_0x50b5bd,_0x4402b3,_0x55e206)['then'](function(_0x1942c3){_0x5e6b9f(_0x1942c3);})['catch'](function(_0x288d08){_0x4cb6c7(_0x288d08);});})[_0x0be8('0x77')](function(_0x238ecb){ut['logger'](_0x0be8('0x11b'),_0x238ecb);_0x4cb6c7(ut[_0x0be8('0x4e')]('Call\x20unsuccessful',_0x4402b3,_0x55e206));});}else{_0x4cb6c7(ut['message'](_0x45df8e[_0x0be8('0x4e')],_0x4402b3,_0x55e206));}})[_0x0be8('0x77')](function(_0xc4725a){ut[_0x0be8('0x63')](_0x0be8('0x11c'),_0xc4725a);_0x4cb6c7(ut['message'](_0x0be8('0x11d'),![],!![]));});});};Preview['prototype'][_0x0be8('0x119')]=function(_0x4422de){if(_[_0x0be8('0x84')](_0x4422de)||_[_0x0be8('0x108')](_0x4422de)||!_['isNil'](_0x4422de[0x0][_0x0be8('0x88')])&&_[_0x0be8('0x84')](_0x4422de[0x0][_0x0be8('0x88')][_0x0be8('0x56')])){ut[_0x0be8('0x63')](_0x0be8('0x11e'),_0x4422de);return{'isValid':![],'message':_0x0be8('0x11f')};}var _0x20e626=this[_0x0be8('0x17')][_0x4422de[0x0][_0x0be8('0x6c')]['name']];_0x20e626[_0x0be8('0x4e')]=_0x0be8('0xa0');if(_['isNil'](_0x20e626)){ut[_0x0be8('0x63')](_0x0be8('0x120'),_0x20e626);return{'isValid':![],'message':_0x0be8('0x121')};}if(!this[_0x0be8('0x9e')](_0x20e626[_0x0be8('0x55')])){ut[_0x0be8('0x63')](_0x0be8('0x122'),_0x0be8('0x123')+_0x20e626[_0x0be8('0x56')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x0be8('0x9e')](_0x20e626[_0x0be8('0x9f')])){ut['logger'](_0x0be8('0x122'),_0x20e626[_0x0be8('0x56')]+_0x0be8('0x124'));return{'isValid':![],'message':_0x0be8('0x125')};}}if(!ut[_0x0be8('0x9d')](_0x20e626[_0x0be8('0x39')])){ut[_0x0be8('0x63')]('[Preview][validateContact][Campaign\x20Active]',_0x20e626[_0x0be8('0x56')]+_0x0be8('0x126'));return{'isValid':![],'message':_0x0be8('0x123')+_0x20e626[_0x0be8('0x56')]+_0x0be8('0x126')};}return{'isValid':!![],'message':_0x0be8('0x127')};};Preview['prototype'][_0x0be8('0x109')]=function(_0x102a2f,_0x2cdb4d,_0x109334,_0x584a9a){var _0x513d05=this;return new BPromise(function(_0x8d1bf7,_0x3af70a){var _0x357734=_0x102a2f['uniqueid'];var _0x4c7d33=_0x513d05[_0x0be8('0x9e')](_0x2cdb4d['Trunk'])?util[_0x0be8('0x59')](_0x0be8('0x128'),_0x2cdb4d[_0x0be8('0x55')][_0x0be8('0x56')],_[_0x0be8('0x84')](_0x2cdb4d[_0x0be8('0x3b')])?'':_0x2cdb4d[_0x0be8('0x3b')][_0x0be8('0x129')]()||'',_0x2cdb4d[_0x0be8('0x12a')]>0x0?_0x109334[_0x0be8('0x103')]['phone'][_0x0be8('0x12b')](_0x2cdb4d['dialCutDigit']):_0x109334[_0x0be8('0x103')][_0x0be8('0x104')]):util[_0x0be8('0x59')](_0x0be8('0x128'),_[_0x0be8('0x84')](_0x2cdb4d[_0x0be8('0x9f')])?_0x2cdb4d[_0x0be8('0x55')][_0x0be8('0x56')]:_0x2cdb4d[_0x0be8('0x9f')][_0x0be8('0x56')],_['isNil'](_0x2cdb4d['dialPrefix'])?'':_0x2cdb4d[_0x0be8('0x3b')][_0x0be8('0x129')]()||'',_0x2cdb4d['dialCutDigit']>0x0?_0x109334['Contact'][_0x0be8('0x104')][_0x0be8('0x12b')](_0x2cdb4d['dialCutDigit']):_0x109334[_0x0be8('0x103')][_0x0be8('0x104')]);var _0x337981=_0x513d05[_0x0be8('0x9e')](_0x2cdb4d[_0x0be8('0x55')])?ut[_0x0be8('0x12c')](_0x2cdb4d[_0x0be8('0x55')][_0x0be8('0x58')],_0x2cdb4d[_0x0be8('0x12d')],_0x2cdb4d['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0be8('0x12e')](_0x2cdb4d[_0x0be8('0x12f')],_0x2cdb4d[_0x0be8('0x130')]):_0x2cdb4d[_0x0be8('0x12f')]):ut[_0x0be8('0x12c')](_[_0x0be8('0x84')](_0x2cdb4d[_0x0be8('0x9f')])?_0x2cdb4d[_0x0be8('0x55')][_0x0be8('0x58')]:_0x2cdb4d[_0x0be8('0x9f')][_0x0be8('0x58')],_0x2cdb4d[_0x0be8('0x12d')],_0x2cdb4d['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0be8('0x12e')](_0x2cdb4d[_0x0be8('0x12f')],_0x2cdb4d[_0x0be8('0x130')]):_0x2cdb4d['dialOriginateCallerIdNumber']);if(_0x337981){_0x102a2f['originatecalleridname']=ut[_0x0be8('0x131')](_0x337981);_0x102a2f[_0x0be8('0x132')]=ut['extractCalleridNumber'](_0x337981);}var _0xabd852=ut['addVariables'](_0x2cdb4d,_0x109334,_0x4c7d33,_0x337981,_0x357734,_0x102a2f);_[_0x0be8('0x133')](_0x102a2f,ut[_0x0be8('0x134')](_0xabd852));_0x102a2f[_0x0be8('0x8e')]=moment()[_0x0be8('0x59')](_0x0be8('0x8f'));ami['Action'](ut[_0x0be8('0x135')](_0x102a2f,_0x2cdb4d,_0xabd852,_0x102a2f[_0x0be8('0xaf')],_0x584a9a))[_0x0be8('0x83')](function(_0x439358){var _0x35b243=_0x102a2f[_0x0be8('0x136')];if(!_[_0x0be8('0x84')](_0x35b243)){if(!_[_0x0be8('0x84')](_0x513d05[_0x0be8('0x1a')][_0x35b243])){_0x513d05[_0x0be8('0x1a')][_0x35b243]['destconnectedlinenum']=_0x102a2f[_0x0be8('0x137')];emit(util[_0x0be8('0x59')](_0x0be8('0x138'),_0x513d05[_0x0be8('0x1a')][_0x35b243]['name']),_0x0be8('0x139'),{'destaccountcode':_0x513d05['agents'][_0x35b243][_0x0be8('0x13a')],'destconnectedlinenum':_0x102a2f[_0x0be8('0x137')]});}}_0x2cdb4d[_0x0be8('0x5f')]+=0x1;logger[_0x0be8('0x6b')](_0x0be8('0x13b'),_0x357734,_0x0be8('0xb5'),_0x2cdb4d[_0x0be8('0x56')],_0x0be8('0x6d'),_0x2cdb4d[_0x0be8('0x5f')]);_0x8d1bf7(_0x439358);})[_0x0be8('0x77')](function(_0x3bccc3){ut['logAgent'](_0x102a2f,0xe,'OriginateError');rpcDb[_0x0be8('0xfc')](_0x102a2f,'[originateFailure][logOriginateFailure]');_0x3af70a(_0x3bccc3);});});};Preview['prototype'][_0x0be8('0x25')]=function(_0x21a5dd){if(this['actions'][_0x21a5dd[_0x0be8('0xb0')]]){this[_0x0be8('0x19')][_0x21a5dd['linkedid']][_0x0be8('0x76')]=_0x21a5dd['channel'];}};Preview[_0x0be8('0x12')][_0x0be8('0x13c')]=function(_0x4bc73e){var _0x9abb4b=this;var _0x294eed=this[_0x0be8('0x19')][_0x4bc73e['actionid']];if(_0x294eed){if(_0x294eed['lookAgent']&&this[_0x0be8('0x1a')][_0x294eed[_0x0be8('0x107')]]){ut[_0x0be8('0x13d')](_0x294eed,this[_0x0be8('0x1a')][_0x294eed[_0x0be8('0x107')]][_0x0be8('0x56')],this[_0x0be8('0x1a')][_0x294eed[_0x0be8('0x107')]]['id']);}var _0x13ff66=_[_0x0be8('0x13e')](_0x294eed);_0x13ff66[_0x0be8('0xb2')]=moment()[_0x0be8('0x59')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3a959d=_0x9abb4b[_0x0be8('0x17')][_0x294eed[_0x0be8('0x6e')]];if(ut[_0x0be8('0x13f')](_0x4bc73e[_0x0be8('0x140')])){if(_0x294eed[_0x0be8('0xae')]){rpcDb[_0x0be8('0x141')](_0x294eed[_0x0be8('0x10c')]);}if(_0x294eed[_0x0be8('0xaf')]){rpcDb[_0x0be8('0x8d')](_0x294eed[_0x0be8('0x10c')]);}ami['emit'](_0x0be8('0x142'),ut[_0x0be8('0xa5')](_0x294eed,_0x0be8('0x143'),this[_0x0be8('0x17')][_0x294eed[_0x0be8('0x6e')]]));this[_0x0be8('0xf7')](_0x13ff66,_0x3a959d,_0x4bc73e);}else{_0x294eed[_0x0be8('0x8e')]=moment()[_0x0be8('0x59')](_0x0be8('0x8f'));ut[_0x0be8('0xfb')](_0x13ff66,0x4,'Answer');rpcDb[_0x0be8('0xfc')](_0x13ff66,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x0be8('0x12')][_0x0be8('0x1f')]=function(_0x404aa8){var _0xa4cd6a=this;var _0x17e24b=this[_0x0be8('0x19')][_0x404aa8['linkedid']];var _0x5a11e5;if(_0x17e24b){_0x5a11e5=this['campaignsPreview'][_0x17e24b[_0x0be8('0x6e')]];logger[_0x0be8('0x6b')](_0x0be8('0x144'),_0x404aa8[_0x0be8('0xb0')],'\x20Queue',_0x5a11e5[_0x0be8('0x56')],'pTalking:\x20',_0x5a11e5[_0x0be8('0x30')]);}if(this[_0x0be8('0x19')][_0x404aa8[_0x0be8('0xb0')]]&&_0x404aa8[_0x0be8('0xb0')]!==_0x404aa8['uniqueid']){if(_0x404aa8[_0x0be8('0x145')]==='16'&&this[_0x0be8('0x19')][_0x404aa8[_0x0be8('0xb0')]][_0x0be8('0x70')]){this[_0x0be8('0x146')](_0x404aa8,_0x404aa8[_0x0be8('0xb0')],_0x404aa8[_0x0be8('0x145')]);}else if(this[_0x0be8('0x19')][_0x404aa8[_0x0be8('0xb0')]]['dialAnswer']){logger[_0x0be8('0x6b')](_0x0be8('0x147'),_0x404aa8['linkedid'],_0x404aa8[_0x0be8('0x145')],_0x0be8('0xb5'),_0x5a11e5[_0x0be8('0x56')],'pTalking:\x20',_0x5a11e5['pTalking']);this[_0x0be8('0x146')](_0x404aa8,_0x404aa8[_0x0be8('0xb0')],_0x404aa8[_0x0be8('0x145')]);}}else if(_0x17e24b&&_[_0x0be8('0x84')](_0x17e24b[_0x0be8('0x148')])&&_0x5a11e5[_0x0be8('0x149')]&&_0x404aa8[_0x0be8('0xb0')]===_0x404aa8[_0x0be8('0xb4')]&&_['isNil'](_0x404aa8['reason'])&&_0x404aa8[_0x0be8('0x145')]==='16'&&_0x404aa8[_0x0be8('0x14a')]==='6'&&_[_0x0be8('0xf9')](_0x17e24b[_0x0be8('0x14b')])){if(_0x17e24b[_0x0be8('0xae')]){rpcDb[_0x0be8('0x141')](_0x17e24b[_0x0be8('0x10c')]);}if(_0x17e24b[_0x0be8('0xaf')]){rpcDb[_0x0be8('0x8d')](_0x17e24b[_0x0be8('0x10c')]);}_0x404aa8[_0x0be8('0xfa')]='22';this[_0x0be8('0xf7')](_0x17e24b,_0x5a11e5,_0x404aa8);}else if(_0x17e24b&&_0x17e24b[_0x0be8('0x14b')]){if(_0x404aa8['cause']==='16'&&this['actions'][_0x404aa8[_0x0be8('0xb0')]][_0x0be8('0x70')]){logger[_0x0be8('0x6b')](_0x0be8('0x14c'),_0x404aa8['linkedid'],_0x404aa8[_0x0be8('0x145')],_0x0be8('0xb5'),_0x5a11e5[_0x0be8('0x56')],_0x0be8('0x6f'),_0x5a11e5[_0x0be8('0x30')]);this['callProgressDetectingCustomer'](_0x404aa8,_0x404aa8[_0x0be8('0xb0')],_0x404aa8[_0x0be8('0x145')]);}else if(this['actions'][_0x404aa8[_0x0be8('0xb0')]][_0x0be8('0x70')]){logger[_0x0be8('0x6b')]('[syncHangup][talking][cause]',_0x404aa8[_0x0be8('0xb0')],_0x404aa8[_0x0be8('0x145')],_0x0be8('0xb5'),_0x5a11e5[_0x0be8('0x56')],'pTalking:\x20',_0x5a11e5[_0x0be8('0x30')]);this[_0x0be8('0x146')](_0x404aa8,_0x404aa8[_0x0be8('0xb0')],_0x404aa8['cause']);}}};Preview[_0x0be8('0x12')][_0x0be8('0x23')]=function(_0x3d0aa5){if(this['actions'][_0x3d0aa5[_0x0be8('0xf6')]]&&_0x3d0aa5['destlinkedid']!==_0x3d0aa5['destuniqueid']){this[_0x0be8('0x146')](_0x3d0aa5,_0x3d0aa5[_0x0be8('0xf6')],_0x3d0aa5[_0x0be8('0xf1')]);}};Preview[_0x0be8('0x12')][_0x0be8('0x21')]=function(_0xdeb185){if(this[_0x0be8('0x19')][_0xdeb185[_0x0be8('0xb0')]]&&_0xdeb185['linkedid']!==_0xdeb185[_0x0be8('0xb4')]&&!this[_0x0be8('0x19')][_0xdeb185['linkedid']][_0x0be8('0x70')]){if(_0xdeb185['cause']==='1'){this[_0x0be8('0x146')](_0xdeb185,_0xdeb185[_0x0be8('0xb0')],_0xdeb185[_0x0be8('0x145')]);}}};Preview[_0x0be8('0x12')][_0x0be8('0x14d')]=function(_0x22989a,_0x46d27d,_0x24db2b){if(this['actions'][_0x22989a]){if(_[_0x0be8('0x84')](this[_0x0be8('0x19')][_0x22989a][_0x0be8('0x14e')])){this['actions'][_0x22989a][_0x0be8('0x14e')]={};}this[_0x0be8('0x19')][_0x22989a][_0x0be8('0x14e')][_0x46d27d]=_0x24db2b;}};Preview[_0x0be8('0x12')][_0x0be8('0x14f')]=function(_0x1bf656){try{if(!_[_0x0be8('0x84')](_0x1bf656)){if(ut[_0x0be8('0x150')](_[_0x0be8('0x151')](_0x1bf656[_0x0be8('0x152')])[0x0])){this[_0x0be8('0x14d')](_0x1bf656['uniqueid'],_['keys'](_0x1bf656['variable'])[0x0],_0x1bf656[_0x0be8('0x153')]);}}}catch(_0x2c8b83){logger[_0x0be8('0x154')](_0x0be8('0x155'),util['inspect'](_0x2c8b83,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x0be8('0x27')]=function(_0x306f66){if(_0x306f66){if(this[_0x0be8('0x19')][_0x306f66['transfertargetlinkedid']]){this[_0x0be8('0x19')][_0x306f66[_0x0be8('0x156')]][_0x0be8('0x14b')]=!![];}}};Preview[_0x0be8('0x12')][_0x0be8('0x28')]=function(_0x23b6bd){if(_0x23b6bd){if(this[_0x0be8('0x19')][_0x23b6bd[_0x0be8('0x157')]]){this[_0x0be8('0x19')][_0x23b6bd[_0x0be8('0x157')]][_0x0be8('0x14b')]=!![];}}};module[_0x0be8('0x158')]=Preview; \ No newline at end of file +var _0x7fa3=['merge','toLowerVariables','channelAgent','destconnectedlinenum','calleridnum','accountcode','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','responsetime','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','./action','./util/util','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','Interval','stringify','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','setMessage','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','hasOwnProperty','recallMe','getContactRecallMe','agentReadyId','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','NOT_ACTIVE','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','custom:agentnosuchnumber','buildObj','nosuchnumber','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','linkedid','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','[syncHangup][talking][decrement]','\x20Queue','Busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','activeContact','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','countnoanswerretry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectRetryFrequency','countabandonedretry','Abandoned','countabandonedetry','dialAbandonedMaxRety','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','ANSWER','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','checkInBlack','Contact','phone','agents','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables'];(function(_0x198775,_0x29077e){var _0x389c74=function(_0x425690){while(--_0x425690){_0x198775['push'](_0x198775['shift']());}};_0x389c74(++_0x29077e);}(_0x7fa3,0x177));var _0x37fa=function(_0x442ae1,_0x34e977){_0x442ae1=_0x442ae1-0x0;var _0x585adb=_0x7fa3[_0x442ae1];return _0x585adb;};'use strict';var util=require(_0x37fa('0x0'));var _=require('lodash');var BPromise=require(_0x37fa('0x1'));var uuid=require(_0x37fa('0x2'));var moment=require(_0x37fa('0x3'));var md5=require(_0x37fa('0x4'));var Redis=require('ioredis');var config=require(_0x37fa('0x5'));var logger=require(_0x37fa('0x6'))(_0x37fa('0x7'));var loggerAction=require(_0x37fa('0x6'))('actionPreview');var ami=require(_0x37fa('0x8'));var rpcDb=require(_0x37fa('0x9'));var Action=require(_0x37fa('0xa'));var ut=require(_0x37fa('0xb'));config['redis']=_[_0x37fa('0xc')](config[_0x37fa('0xd')],{'host':_0x37fa('0xe'),'port':0x18eb});var io=require(_0x37fa('0xf'))(new Redis(config[_0x37fa('0xd')]));var Sequence=function(){};Sequence[_0x37fa('0x10')][_0x37fa('0x11')]=function(_0x416133){this[_0x37fa('0x12')]=this['tail']?this[_0x37fa('0x12')][_0x37fa('0x13')](_0x416133):_0x416133();};function Preview(_0x49eec2){this[_0x37fa('0x14')]=new Sequence();this[_0x37fa('0x15')]=_0x49eec2['voiceQueues'];this[_0x37fa('0x16')]=_0x49eec2[_0x37fa('0x16')];this[_0x37fa('0x17')]={};this['agents']=_0x49eec2['agents'];this[_0x37fa('0x18')]=0x0;ami['on']('originateresponse',this[_0x37fa('0x19')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x1b'),this[_0x37fa('0x1c')]['bind'](this));ami['on']('hanguprequest',this[_0x37fa('0x1d')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x1e'),this[_0x37fa('0x1f')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x20'),this[_0x37fa('0x21')][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x22'),this['syncVarSet'][_0x37fa('0x1a')](this));ami['on'](_0x37fa('0x23'),this['syncAttendedTransfer'][_0x37fa('0x1a')](this));ami['on']('blindtransfer',this[_0x37fa('0x24')]['bind'](this));this[_0x37fa('0x25')](this['campaignsPreview']);}function emit(_0x1a62e9,_0x34bed2,_0x55d5dc){io['to'](_0x1a62e9)[_0x37fa('0x26')](_0x34bed2,_0x55d5dc);}function emitCampaignPreview(_0x480578){if(_0x480578[_0x37fa('0x27')]===_0x37fa('0x28')){var _0x55967c={'id':_0x480578['id'],'name':_0x480578[_0x37fa('0x29')],'strategy':_0x480578[_0x37fa('0x2a')],'answered':_0x480578['answered'],'available':_0x480578[_0x37fa('0x2b')],'loggedIn':_0x480578[_0x37fa('0x2c')],'pTalking':_0x480578[_0x37fa('0x2d')],'sumBillable':_0x480578[_0x37fa('0x2e')],'sumDuration':_0x480578['sumDuration'],'sumHoldTime':_0x480578[_0x37fa('0x2f')]||0x0,'talking':_0x480578[_0x37fa('0x30')],'total':_0x480578[_0x37fa('0x31')],'type':_0x480578[_0x37fa('0x27')],'unmanaged':_0x480578[_0x37fa('0x32')],'abandoned':_0x480578[_0x37fa('0x33')],'waiting':_0x480578[_0x37fa('0x34')],'loggedInDb':_0x480578[_0x37fa('0x35')],'dialActive':_0x480578[_0x37fa('0x36')],'dialMethod':_0x480578[_0x37fa('0x37')],'dialOriginateCallerIdName':_0x480578['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x480578[_0x37fa('0x38')],'dialOriginateTimeout':_0x480578[_0x37fa('0x39')],'dialPrefix':_0x480578[_0x37fa('0x3a')],'outboundAnswerAgiCallsDay':_0x480578[_0x37fa('0x3b')],'outboundAnswerCallsDay':_0x480578[_0x37fa('0x3c')],'outboundBlacklistCallsDay':_0x480578['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x480578[_0x37fa('0x3d')],'outboundCongestionCallsDay':_0x480578['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x480578[_0x37fa('0x3e')],'outboundDropCallsDayCallersExit':_0x480578[_0x37fa('0x3f')],'outboundDropCallsDayTimeout':_0x480578[_0x37fa('0x40')],'outboundNoAnswerCallsDay':_0x480578[_0x37fa('0x41')],'outboundNoSuchCallsDay':_0x480578['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x480578[_0x37fa('0x42')],'outboundReCallsDay':_0x480578[_0x37fa('0x43')],'outboundRejectCallsDay':_0x480578[_0x37fa('0x44')],'outboundUnknownCallsDay':_0x480578['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x480578[_0x37fa('0x45')],'predictiveIntervalAnsweredCalls':_0x480578[_0x37fa('0x46')],'predictiveIntervalAvgHoldtime':_0x480578[_0x37fa('0x47')],'predictiveIntervalAvgTalktime':_0x480578['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x480578['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x480578[_0x37fa('0x48')],'predictiveIntervalErlangCalls':_0x480578[_0x37fa('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x480578['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x480578[_0x37fa('0x4a')],'predictiveIntervalMultiplicativeFactor':_0x480578['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x480578[_0x37fa('0x4b')],'predictiveIntervalAvailable':_0x480578['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x480578['predictiveIntervalTotalCalls'],'message':_0x480578[_0x37fa('0x4c')],'originated':_0x480578[_0x37fa('0x4d')],'erlangCalls':_0x480578[_0x37fa('0x4e')],'erlangCallToSecond':_0x480578[_0x37fa('0x4f')],'erlangAbandonmentRate':_0x480578['erlangAbandonmentRate'],'erlangBusyFactor':_0x480578[_0x37fa('0x50')],'startPredictive':_0x480578['startPredictive'],'startProgressive':_0x480578['startProgressive']};if(_0x480578[_0x37fa('0x51')]){_0x55967c[_0x37fa('0x51')]={'id':_0x480578[_0x37fa('0x51')]['id'],'name':_0x480578[_0x37fa('0x51')]['name'],'active':_0x480578['Trunk'][_0x37fa('0x52')],'callerid':_0x480578[_0x37fa('0x51')]['callerid']};}if(_0x480578['Interval']){_0x55967c[_0x37fa('0x53')]={'id':_0x480578[_0x37fa('0x53')]['id'],'name':_0x480578[_0x37fa('0x53')][_0x37fa('0x29')]};}var _0x15613f=md5(JSON[_0x37fa('0x54')](_0x55967c));if(_0x480578[_0x37fa('0x4')]!==_0x15613f){_0x480578[_0x37fa('0x4')]=_0x15613f;emit(util['format']('voice:queue:%s',_0x55967c['name']),_0x37fa('0x55'),_0x55967c);}}}function emitVoiceQueueChannelRemove(_0x172ee0){logger[_0x37fa('0x56')](_0x37fa('0x57'),JSON[_0x37fa('0x54')](_0x172ee0));emit(util[_0x37fa('0x58')]('voice:queue:%s',_0x172ee0['name']),_0x37fa('0x59'),_0x172ee0);io[_0x37fa('0x26')](_0x37fa('0x5a'),_0x172ee0);}function notSendMessagesQueue(_0x26e6f1){if(_0x26e6f1['sendMessageOneNotActive']){if(_0x26e6f1[_0x37fa('0x4d')]===0x0&&_0x26e6f1[_0x37fa('0x2d')]===0x0){_0x26e6f1[_0x37fa('0x5b')]=![];_0x26e6f1[_0x37fa('0x2b')]=0x0;_0x26e6f1[_0x37fa('0x5c')]=0x0;_0x26e6f1[_0x37fa('0x4c')]='NOT_ACTIVE';ut[_0x37fa('0x5d')](_0x37fa('0x5e'),_0x26e6f1[_0x37fa('0x29')]+_0x37fa('0x5f'));}else{_0x26e6f1[_0x37fa('0x4c')]=_0x37fa('0x60');ut['logger'](_0x37fa('0x5e'),_0x26e6f1[_0x37fa('0x29')]+_0x37fa('0x61'));}emitCampaignPreview(_0x26e6f1);}}Preview[_0x37fa('0x10')][_0x37fa('0x25')]=function(){var _0x46d6ad=this;setInterval(function(){_0x46d6ad[_0x37fa('0x62')]();},0x7cf);};Preview[_0x37fa('0x10')]['syncCampaigns']=function(){var _0x5bad10=this[_0x37fa('0x15')];this[_0x37fa('0x18')]+=0x1;for(var _0x454d70 in _0x5bad10){if(_0x5bad10['hasOwnProperty'](_0x454d70)&&(_0x5bad10[_0x454d70][_0x37fa('0x37')]==='preview'||_0x5bad10[_0x454d70]['dialMethod']==='booked')&&_0x5bad10[_0x454d70][_0x37fa('0x27')]===_0x37fa('0x28')){if(this[_0x37fa('0x18')]>0x7){this[_0x37fa('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x5bad10['hasOwnProperty'](_0x454d70)&&_0x5bad10[_0x454d70]['dialMethod']===_0x37fa('0x7')&&_0x5bad10[_0x454d70][_0x37fa('0x27')]==='outbound'){if(_0x5bad10[_0x454d70][_0x37fa('0x36')]){this[_0x37fa('0x63')](_0x5bad10[_0x454d70]);this['recallMe'](_0x5bad10[_0x454d70]);}else{notSendMessagesQueue(_0x5bad10[_0x454d70]);}}}};Preview[_0x37fa('0x10')][_0x37fa('0x64')]=function(_0x4d77bf){var _0x3a67c6=this;this[_0x37fa('0x14')][_0x37fa('0x11')](function(){if(!_[_0x37fa('0x65')](_0x3a67c6['actions'][_0x4d77bf])){loggerAction[_0x37fa('0x56')](_0x37fa('0x66'),_0x4d77bf,_0x37fa('0x67'),_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')],_0x37fa('0x69'),JSON[_0x37fa('0x54')](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf]['queue']][_0x37fa('0x4d')]),_0x37fa('0x6a'),JSON['stringify'](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]][_0x37fa('0x2d')]),JSON[_0x37fa('0x54')](_0x3a67c6['actions'][_0x4d77bf][_0x37fa('0x6b')]),JSON['stringify'](_[_0x37fa('0x6c')](_0x3a67c6[_0x37fa('0x17')][_0x4d77bf],['contactId',_0x37fa('0x6d'),_0x37fa('0x6e'),_0x37fa('0x6f')])));return ami[_0x37fa('0x70')]({'action':_0x37fa('0x71'),'channel':_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x72')]})[_0x37fa('0x73')](function(_0x53524c){if(_0x53524c[_0x37fa('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3a67c6[_0x37fa('0x17')][_0x4d77bf]){ut[_0x37fa('0x74')](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]],'[clearZombieChannel]');if(_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x6b')]===!![]){ut[_0x37fa('0x75')](_0x3a67c6[_0x37fa('0x15')][_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]],'[clearZombieChannel]');ut[_0x37fa('0x76')](_0x37fa('0x77')+_0x4d77bf,_0x3a67c6[_0x37fa('0x17')][_0x4d77bf]['queue']);}ut[_0x37fa('0x76')](_0x37fa('0x78')+_0x4d77bf,_0x3a67c6[_0x37fa('0x17')][_0x4d77bf][_0x37fa('0x68')]);delete _0x3a67c6['actions'][_0x4d77bf];}},0x2328);}});}});};Preview[_0x37fa('0x10')][_0x37fa('0x79')]=function(){var _0x2b65fc=this;loggerAction[_0x37fa('0x56')](_0x37fa('0x7a'),_[_0x37fa('0x7b')](this[_0x37fa('0x17')]));for(var _0x10bc2f in this[_0x37fa('0x17')]){if(_0x2b65fc[_0x37fa('0x17')][_0x37fa('0x7c')](_0x10bc2f)){_0x2b65fc[_0x37fa('0x64')](_0x10bc2f);}}};Preview[_0x37fa('0x10')][_0x37fa('0x7d')]=function(_0x5ab026){var _0x1027bb=this;rpcDb[_0x37fa('0x7e')](_0x5ab026['id'],ut[_0x37fa('0x7f')](this['agents']))['then'](function(_0x547dac){if(!_[_0x37fa('0x65')](_0x547dac)){for(var _0xcb4bbc=0x0;_0xcb4bbc<_0x547dac[_0x37fa('0x80')];_0xcb4bbc+=0x1){if(ut[_0x37fa('0x81')](_0x547dac[_0xcb4bbc][_0x37fa('0x82')])<_0x5ab026[_0x37fa('0x83')]*0x3c){if(_0x547dac[_0xcb4bbc][_0x37fa('0x84')]&&!_0x547dac[_0xcb4bbc][_0x37fa('0x84')]['voicePause']){_0x1027bb[_0x37fa('0x85')](_0x547dac[_0xcb4bbc]['id'])[_0x37fa('0x86')](ut[_0x37fa('0x87')](_0x37fa('0x88')))[_0x37fa('0x73')](ut[_0x37fa('0x87')](_0x37fa('0x88')));}else{rpcDb[_0x37fa('0x89')](_0x547dac[_0xcb4bbc]['id']);}}else{var _0x3f8289=new Action(_0x547dac[_0xcb4bbc],_0x5ab026);_0x3f8289[_0x37fa('0x8a')]=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));_0x5ab026['outboundReCallsDay']+=0x1;ut[_0x37fa('0x8c')](_0x3f8289,0x17,_0x37fa('0x8d'));if(_0x5ab026[_0x37fa('0x8e')]){rpcDb['rescheduleContactInQueue'](ut[_0x37fa('0x8f')](_0x547dac[_0xcb4bbc]));rpcDb['createCustomerHistory'](_0x3f8289,_0x37fa('0x90'));}else{ut[_0x37fa('0x8c')](_0x3f8289,0x16,'RecallFailedTimeout');rpcDb[_0x37fa('0x91')](_0x3f8289,_0x37fa('0x92'));rpcDb['createCustomerFinal'](_0x3f8289,_0x37fa('0x92'));}}}}})[_0x37fa('0x73')](ut['logger2'](_0x37fa('0x93')));};Preview['prototype']['setMessage']=function(_0x1a5666){_0x1a5666['sendMessageOneNotActive']=!![];if(ut[_0x37fa('0x94')](_0x1a5666[_0x37fa('0x2c')])){_0x1a5666['message']=_0x37fa('0x95');}else if(!ut['isActive'](_0x1a5666['dialActive'])){_0x1a5666['message']=_0x37fa('0x96');}else if(!this[_0x37fa('0x97')](_0x1a5666[_0x37fa('0x51')])){if(!this['isTrunkReachable'](_0x1a5666['TrunkBackup'])){_0x1a5666['message']=_0x37fa('0x98');}else{_0x1a5666['message']=_0x37fa('0x99');}}else{_0x1a5666[_0x37fa('0x4c')]=_0x37fa('0x99');}emitCampaignPreview(_0x1a5666);};Preview['prototype'][_0x37fa('0x9a')]=function(_0x26b95a,_0x4f0df0,_0x364e7a){var _0xa28b85=this;var _0x25c359=this[_0x37fa('0x17')][_0x4f0df0];var _0x268c0f=this['campaignsPreview'][_0x25c359[_0x37fa('0x68')]];var _0x50d876;if(_0x268c0f){switch(_0x364e7a){case'1':_0x268c0f[_0x37fa('0x9b')]+=0x1;_0x25c359['countnosuchnumberretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut['totalGlobal'](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x0,'NoSuchNumber');ami[_0x37fa('0x26')](_0x37fa('0x9d'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0x9f')));rpcDb[_0x37fa('0x91')](_0x25c359,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb['createCustomerFinal'](_0x50d876,_0x37fa('0xa4'));}else{if(_0x25c359[_0x37fa('0xa5')]>=_0x268c0f[_0x37fa('0xa6')]){rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xa5'),_0x268c0f[_0x37fa('0xaa')]),_0x25c359[_0x37fa('0xab')],_0x25c359['activeContact']);}}delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];break;case'ANSWER':var _0x500107=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));_0x25c359['responsetime']=_0x500107;_0x25c359[_0x37fa('0xad')]=_0x500107;_0x25c359[_0x37fa('0x6b')]=!![];_0x268c0f[_0x37fa('0x2d')]+=0x1;logger[_0x37fa('0x56')](_0x37fa('0xae'),_0x25c359[_0x37fa('0xaf')],'\x20Queue',_0x268c0f[_0x37fa('0x29')],_0x37fa('0x6a'),_0x268c0f[_0x37fa('0x2d')]);ami[_0x37fa('0x26')](_0x37fa('0xb0'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xb1'),this[_0x37fa('0x15')][_0x25c359['queue']]));if(_0x268c0f['acw']){ami[_0x37fa('0x26')]('custom:agentConnectPreview',ut['buildAcw'](_0x25c359));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x37fa('0x9e')](_0x25c359,'complete',this[_0x37fa('0x15')][_0x25c359[_0x37fa('0x68')]]));emitVoiceQueueChannelRemove(ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xb2')));_0x268c0f[_0x37fa('0x3c')]+=0x1;_0x268c0f[_0x37fa('0x31')]+=0x1;_0x268c0f[_0x37fa('0xb3')]+=0x1;ut['decrementTalkink'](_0x268c0f,_0x37fa('0xb4'));_0x25c359['countglobal']=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x4,_0x37fa('0xb5'));rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xb6'));rpcDb[_0x37fa('0xa7')](_0x25c359,_0x37fa('0xb7'));rpcDb['crateCustomerReportQueue'](_0x25c359);_0x268c0f[_0x37fa('0xb8')]+=_0x25c359[_0x37fa('0xb9')];_0x268c0f[_0x37fa('0x2e')]+=_0x25c359[_0x37fa('0xb9')];logger[_0x37fa('0x56')](_0x37fa('0xba'),_0x25c359[_0x37fa('0xaf')],_0x37fa('0xbb'),_0x268c0f[_0x37fa('0x29')],_0x37fa('0x6a'),_0x268c0f['pTalking']);delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];break;case'BUSY':_0x268c0f[_0x37fa('0x3d')]+=0x1;_0x25c359['countbusyretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x5,_0x37fa('0xbc'));ami[_0x37fa('0x26')]('custom:agentbusy',ut['buildObj'](_0x25c359,'busy'));rpcDb['createCustomerHistory'](_0x25c359,_0x37fa('0xbd'));if(ut['totalGlobal'](_0x25c359)>=_0x268c0f['dialGlobalMaxRetry']){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,_0x37fa('0xbe'));}else{if(_0x25c359[_0x37fa('0xbf')]>=_0x268c0f[_0x37fa('0xc0')]){rpcDb[_0x37fa('0xa7')](_0x25c359,_0x37fa('0xbd'));}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xbf'),_0x268c0f[_0x37fa('0xc1')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case'NOANSWER':_0x268c0f[_0x37fa('0x41')]+=0x1;_0x25c359['countnoanswerretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x3,'NoAnswer');ami[_0x37fa('0x26')](_0x37fa('0xc3'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xc4')));rpcDb[_0x37fa('0x91')](_0x25c359,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb['createCustomerFinal'](_0x50d876,_0x37fa('0xc5'));}else{if(_0x25c359['countnoanswerretry']>=_0x268c0f[_0x37fa('0xc6')]){rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xc7'),_0x268c0f[_0x37fa('0xc8')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case _0x37fa('0xc9'):_0x268c0f[_0x37fa('0xca')]+=0x1;_0x25c359['countcongestionretry']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x8,_0x37fa('0xcb'));ami[_0x37fa('0x26')](_0x37fa('0xcc'),ut['buildObj'](_0x25c359,_0x37fa('0xcd')));rpcDb['createCustomerHistory'](_0x25c359,_0x37fa('0xce'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f['dialGlobalMaxRetry']){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,_0x37fa('0xcf'));}else{if(_0x25c359['countcongestionretry']>=_0x268c0f['dialCongestionMaxRetry']){rpcDb[_0x37fa('0xa7')](_0x25c359,_0x37fa('0xce'));}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xd0'),_0x268c0f[_0x37fa('0xc1')]),_0x25c359['unlockAgent'],_0x25c359[_0x37fa('0xc2')]);}}break;case _0x37fa('0xd1'):_0x268c0f[_0x37fa('0x44')]+=0x1;_0x25c359[_0x37fa('0xd2')]+=0x1;_0x25c359[_0x37fa('0x9c')]=ut['totalGlobal'](_0x25c359);ut['logCustomer'](_0x25c359,0x14,_0x37fa('0xd3'));ami[_0x37fa('0x26')](_0x37fa('0xd4'),ut[_0x37fa('0x9e')](_0x25c359,_0x37fa('0xd5')));rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xd6'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0x14,_0x37fa('0xd3'));rpcDb['createCustomerFinal'](_0x50d876,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x25c359['countagentrejectretry']>=_0x268c0f['dialAgentRejectMaxRetry']){rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xd2'),_0x268c0f[_0x37fa('0xd7')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case'ABANDONED':_0x268c0f[_0x37fa('0x45')]+=0x1;_0x25c359[_0x37fa('0xd8')]+=0x1;_0x25c359['countglobal']=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0xb,_0x37fa('0xd9'));rpcDb['createCustomerHistory'](_0x25c359,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f['dialGlobalMaxRetry']){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x25c359[_0x37fa('0xda')]>=_0x268c0f[_0x37fa('0xdb')]){rpcDb['createCustomerFinal'](_0x25c359,_0x37fa('0xdc'));}else{rpcDb[_0x37fa('0xa8')](ut[_0x37fa('0xa9')](_0x25c359,_0x37fa('0xd8'),_0x268c0f[_0x37fa('0xdd')]),_0x25c359[_0x37fa('0xab')],_0x25c359[_0x37fa('0xc2')]);}}break;case'18':_0x268c0f[_0x37fa('0xde')]+=0x1;_0x25c359[_0x37fa('0xdf')]+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x12,_0x26b95a[_0x37fa('0xe0')]||_0x26b95a[_0x37fa('0xe1')]);ami[_0x37fa('0x26')]('custom:amd',ut['buildObj'](_0x25c359,_0x37fa('0xe2')));rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xe3'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut[_0x37fa('0xa2')](_0x25c359,0xf,'Global');rpcDb[_0x37fa('0xa7')](_0x50d876,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x26b95a[_0x37fa('0xac')]];break;case'19':_0x268c0f['outboundUnknownCallsDay']+=0x1;_0x25c359[_0x37fa('0x9c')]=ut[_0x37fa('0xa0')](_0x25c359);ut[_0x37fa('0x8c')](_0x25c359,0x13,_0x26b95a[_0x37fa('0xe0')]||_0x26b95a['dialstatus']);ami[_0x37fa('0x26')]('custom:amd',ut['buildObj'](_0x25c359,_0x37fa('0xe2')));rpcDb['createCustomerHistory'](_0x25c359,'[callProgressDetectingCustomer][machine]');if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb['createCustomerFinal'](_0x50d876,_0x37fa('0xe4'));}else{rpcDb[_0x37fa('0xa7')](_0x25c359,'[callProgressDetectingCustomer][machine]');}delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];break;default:if(_0x25c359[_0x37fa('0x6b')]){ut['decrementTalkink'](_0x268c0f,'[default]');ut[_0x37fa('0x76')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x268c0f[_0x37fa('0x29')],_0x26b95a);}_0x268c0f['outboundUnknownCallsDay']+=0x1;_0x25c359['countglobal']=ut[_0x37fa('0xa0')](_0x25c359);ut['logCustomer'](_0x25c359,0xc,_0x26b95a[_0x37fa('0xe0')]||_0x26b95a[_0x37fa('0xe1')]);rpcDb[_0x37fa('0x91')](_0x25c359,_0x37fa('0xe5'));if(ut[_0x37fa('0xa0')](_0x25c359)>=_0x268c0f[_0x37fa('0xa1')]){_0x50d876=ut['cloneAction'](_0x25c359,0xf,_0x37fa('0xa3'));rpcDb[_0x37fa('0xa7')](_0x50d876,_0x37fa('0xe6'));}else{rpcDb['createCustomerFinal'](_0x25c359,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x37fa('0x17')][_0x26b95a[_0x37fa('0xac')]];}if(!(_0x25c359['dialAnswer']&&_0x364e7a==='16')){ut[_0x37fa('0x74')](_0x268c0f,_0x37fa('0xe7'));logger[_0x37fa('0x56')](_0x37fa('0xe8'),_0x25c359[_0x37fa('0xaf')],_0x37fa('0xbb'),_0x268c0f[_0x37fa('0x29')],_0x37fa('0x69'),_0x268c0f[_0x37fa('0x4d')]);}if(_0x364e7a!==_0x37fa('0xe9')){delete this[_0x37fa('0x17')][_0x26b95a['linkedid']];delete this['actions'][_0x26b95a[_0x37fa('0xea')]];}}};Preview[_0x37fa('0x10')][_0x37fa('0xeb')]=function(_0x5d15ed,_0x23a2aa,_0xb651e3){if(_[_0x37fa('0xec')](_0x23a2aa)&&_0x37fa('0xed')!==typeof _0x23a2aa){return;}if(_[_0x37fa('0xec')](_0xb651e3)&&_0x37fa('0xed')!==typeof _0xb651e3){return;}switch(_0xb651e3[_0x37fa('0xee')]){case'0':ut['logAgent'](_0x5d15ed,0x0,_0x37fa('0xef'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf1'));break;case'3':ut[_0x37fa('0xf2')](_0x5d15ed,0x3,_0x37fa('0xf3'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf4'));break;case'5':ut[_0x37fa('0xf2')](_0x5d15ed,0x5,_0x37fa('0xbc'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf5'));break;case'8':ut[_0x37fa('0xf2')](_0x5d15ed,0x8,_0x37fa('0xcb'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf6'));break;case'22':ut[_0x37fa('0xf2')](_0x5d15ed,0x16,_0x37fa('0xf7'));rpcDb[_0x37fa('0xf0')](_0x5d15ed,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x37fa('0xf2')](_0x5d15ed,0xc,_0xb651e3[_0x37fa('0xee')]);rpcDb[_0x37fa('0xf0')](_0x5d15ed,_0x37fa('0xf6'));}ut['updateOriginated'](_0x23a2aa,_0x37fa('0xf8'));logger[_0x37fa('0x56')]('[originated][decrement][callProgressDetectingAgent]',_0x5d15ed[_0x37fa('0xaf')],_0x37fa('0xbb'),_0x23a2aa['name'],'originated:\x20',_0x23a2aa[_0x37fa('0x4d')]);delete this[_0x37fa('0x17')][_0x5d15ed[_0x37fa('0xaf')]];};Preview['prototype'][_0x37fa('0xf9')]=function(_0x7f5e0f,_0x3c1d8c,_0x244e38,_0x73a021,_0x1f4575){var _0x578ac9=this;return new BPromise(function(_0x53cc68,_0x2f3b08){if(_['isNil'](_0x3c1d8c)||_[_0x37fa('0x65')](_0x3c1d8c[_0x37fa('0xfa')])||_[_0x37fa('0x65')](_0x3c1d8c[_0x37fa('0xfa')][_0x37fa('0xfb')])||_[_0x37fa('0x65')](_0x3c1d8c[_0x37fa('0x6e')])){_0x2f3b08(ut[_0x37fa('0x4c')]('Contact\x20is\x20undefined',_0x73a021,_0x1f4575));return;}var _0x20fd41=uuid['v4']();var _0xac99f1=_0x578ac9[_0x37fa('0x15')][_0x3c1d8c[_0x37fa('0x67')][_0x37fa('0x29')]];var _0x53fa3c=_0x244e38?_0x578ac9[_0x37fa('0xfc')][_0x244e38]['id']:undefined;_0x578ac9['actions'][_0x20fd41]=new Action(_0x3c1d8c,_0xac99f1,_0x20fd41,_0x244e38,_0x53fa3c);var _0x4a5d60=_0x578ac9['actions'][_0x20fd41];_0x4a5d60['unlockAgent']=_0x73a021;_0x4a5d60[_0x37fa('0xc2')]=_0x1f4575;_0x4a5d60[_0x37fa('0xfd')]=_0x244e38;if(_[_0x37fa('0xfe')](_0x7f5e0f)){_0x578ac9[_0x37fa('0xff')](_0x4a5d60,_0xac99f1,_0x3c1d8c,_0x244e38)['then'](function(_0x1df6ca){logger[_0x37fa('0x56')](_0x37fa('0x100'),_0x37fa('0x101')+_0x4a5d60[_0x37fa('0x68')]+_0x37fa('0x102')+_0x4a5d60[_0x37fa('0x103')],JSON['stringify'](_0x1df6ca));ami['emit'](_0x37fa('0x104'),ut['buildObj'](_0x4a5d60,'called',_0x578ac9[_0x37fa('0x15')][_0x4a5d60['queue']]));_0x53cc68(ut['message'](_0x37fa('0x105')));})['catch'](function(_0xc55c37){ut[_0x37fa('0x5d')]('[Preview][execCall][failure]',_0xc55c37);_0x2f3b08(ut[_0x37fa('0x4c')](_0x37fa('0x106'),_0x73a021,_0x1f4575));});}else{_0xac99f1['outboundBlacklistCallsDay']+=0x1;ut[_0x37fa('0x107')](_0x4a5d60);rpcDb[_0x37fa('0x108')](_0x4a5d60,_0x37fa('0x109'));delete _0x578ac9[_0x37fa('0x17')][_0x20fd41];_0x2f3b08(ut[_0x37fa('0x4c')]('Contact\x20in\x20black\x20List',_0x73a021,_0x1f4575));}});};Preview['prototype'][_0x37fa('0x97')]=function(_0x1ca43f){return!_[_0x37fa('0x65')](_0x1ca43f)&&!_['isNil'](_0x1ca43f[_0x37fa('0x29')])&&!_[_0x37fa('0x65')](_0x1ca43f['active'])&&_0x1ca43f[_0x37fa('0x52')]&&!_[_0x37fa('0x65')](this[_0x37fa('0x16')][util[_0x37fa('0x58')](_0x37fa('0x10a'),_0x1ca43f[_0x37fa('0x29')])])&&!_[_0x37fa('0x65')](this[_0x37fa('0x16')][util['format'](_0x37fa('0x10a'),_0x1ca43f[_0x37fa('0x29')])][_0x37fa('0x71')])&&(this[_0x37fa('0x16')][util['format']('SIP/%s',_0x1ca43f[_0x37fa('0x29')])]['status']===_0x37fa('0x10b')||this[_0x37fa('0x16')][util[_0x37fa('0x58')](_0x37fa('0x10a'),_0x1ca43f[_0x37fa('0x29')])]['status']===_0x37fa('0x10c'));};Preview['prototype'][_0x37fa('0x85')]=function(_0xaccb84,_0x509890){var _0x2bfc60=this;return new BPromise(function(_0x4d98be,_0x2cc09d){_0x2bfc60[_0x37fa('0x10d')](_0xaccb84,_0x509890)[_0x37fa('0x86')](function(_0x1ff5ed){_0x4d98be(_[_0x37fa('0x6c')](_0x1ff5ed,[_0x37fa('0x4c')]));})[_0x37fa('0x73')](function(_0x358b30){if(_0x358b30[_0x37fa('0x10e')]){rpcDb[_0x37fa('0x10f')](_0xaccb84);}if(_0x358b30[_0x37fa('0x52')]){rpcDb[_0x37fa('0x89')](_0xaccb84);}_0x2cc09d(_['pick'](_0x358b30,['message']));});});};Preview[_0x37fa('0x10')][_0x37fa('0x10d')]=function(_0x2dfa6b,_0x1eadb0){var _0x27d0ab=this;return new BPromise(function(_0x15a67a,_0x15f4a7){var _0x823d89,_0x5cad75;rpcDb[_0x37fa('0x110')](_0x2dfa6b)['then'](function(_0x2e2d58){if(!_[_0x37fa('0x65')](_0x2e2d58[0x0])){_0x5cad75=_0x2e2d58[0x0][_0x37fa('0x111')]?![]:!![];_0x823d89=_0x2e2d58[0x0][_0x37fa('0x111')]?!![]:![];_0x823d89=_0x1eadb0?!![]:_0x823d89;}var _0x272780=_0x27d0ab[_0x37fa('0x112')](_0x2e2d58);if(_0x272780['isValid']){rpcDb[_0x37fa('0x113')](_[_0x37fa('0x6c')](_0x2e2d58[0x0],[_0x37fa('0x6e'),_0x37fa('0x114')]))['then'](function(_0x588320){_0x27d0ab[_0x37fa('0xf9')](_0x588320,_0x2e2d58[0x0],_0x1eadb0,_0x5cad75,_0x823d89)[_0x37fa('0x86')](function(_0x5d08f9){_0x15a67a(_0x5d08f9);})[_0x37fa('0x73')](function(_0x56d2bd){_0x15f4a7(_0x56d2bd);});})[_0x37fa('0x73')](function(_0x5d8728){ut['logger']('[Preview][checkIsBlackList]',_0x5d8728);_0x15f4a7(ut[_0x37fa('0x4c')](_0x37fa('0x115'),_0x5cad75,_0x823d89));});}else{_0x15f4a7(ut[_0x37fa('0x4c')](_0x272780['message'],_0x5cad75,_0x823d89));}})[_0x37fa('0x73')](function(_0x305f2f){ut[_0x37fa('0x5d')](_0x37fa('0x116'),_0x305f2f);_0x15f4a7(ut[_0x37fa('0x4c')](_0x37fa('0x115'),![],!![]));});});};Preview[_0x37fa('0x10')]['validateContact']=function(_0x3cb22a){if(_['isNil'](_0x3cb22a)||_['isEmpty'](_0x3cb22a)||!_[_0x37fa('0x65')](_0x3cb22a[0x0][_0x37fa('0x84')])&&_['isNil'](_0x3cb22a[0x0][_0x37fa('0x84')]['name'])){ut[_0x37fa('0x5d')](_0x37fa('0x117'),_0x3cb22a);return{'isValid':![],'message':_0x37fa('0x118')};}var _0x59133c=this[_0x37fa('0x15')][_0x3cb22a[0x0][_0x37fa('0x67')][_0x37fa('0x29')]];_0x59133c[_0x37fa('0x4c')]=_0x37fa('0x99');if(_[_0x37fa('0x65')](_0x59133c)){ut[_0x37fa('0x5d')](_0x37fa('0x119'),_0x59133c);return{'isValid':![],'message':_0x37fa('0x11a')};}if(!this[_0x37fa('0x97')](_0x59133c[_0x37fa('0x51')])){ut[_0x37fa('0x5d')](_0x37fa('0x11b'),_0x37fa('0x11c')+_0x59133c[_0x37fa('0x29')]+_0x37fa('0x11d'));if(!this[_0x37fa('0x97')](_0x59133c[_0x37fa('0x11e')])){ut['logger'](_0x37fa('0x11b'),_0x59133c[_0x37fa('0x29')]+_0x37fa('0x11f'));return{'isValid':![],'message':_0x37fa('0x120')};}}if(!ut[_0x37fa('0x121')](_0x59133c['dialActive'])){ut[_0x37fa('0x5d')](_0x37fa('0x122'),_0x59133c[_0x37fa('0x29')]+_0x37fa('0x123'));return{'isValid':![],'message':_0x37fa('0x11c')+_0x59133c[_0x37fa('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0x37fa('0x124')};};Preview[_0x37fa('0x10')]['execCall']=function(_0x625d5f,_0x49dc64,_0x457eea,_0x4234cd){var _0x1c9229=this;return new BPromise(function(_0x49bba3,_0x639f7c){var _0x43f74b=_0x625d5f[_0x37fa('0xaf')];var _0x150741=_0x1c9229[_0x37fa('0x97')](_0x49dc64[_0x37fa('0x51')])?util[_0x37fa('0x58')](_0x37fa('0x125'),_0x49dc64[_0x37fa('0x51')][_0x37fa('0x29')],_['isNil'](_0x49dc64[_0x37fa('0x3a')])?'':_0x49dc64[_0x37fa('0x3a')][_0x37fa('0x126')]()||'',_0x49dc64[_0x37fa('0x127')]>0x0?_0x457eea[_0x37fa('0xfa')][_0x37fa('0xfb')][_0x37fa('0x128')](_0x49dc64['dialCutDigit']):_0x457eea[_0x37fa('0xfa')][_0x37fa('0xfb')]):util[_0x37fa('0x58')]('SIP/%s/%s%s',_[_0x37fa('0x65')](_0x49dc64['TrunkBackup'])?_0x49dc64[_0x37fa('0x51')][_0x37fa('0x29')]:_0x49dc64[_0x37fa('0x11e')][_0x37fa('0x29')],_[_0x37fa('0x65')](_0x49dc64['dialPrefix'])?'':_0x49dc64[_0x37fa('0x3a')][_0x37fa('0x126')]()||'',_0x49dc64[_0x37fa('0x127')]>0x0?_0x457eea[_0x37fa('0xfa')]['phone'][_0x37fa('0x128')](_0x49dc64[_0x37fa('0x127')]):_0x457eea[_0x37fa('0xfa')][_0x37fa('0xfb')]);var _0x366188=_0x1c9229[_0x37fa('0x97')](_0x49dc64[_0x37fa('0x51')])?ut[_0x37fa('0x129')](_0x49dc64[_0x37fa('0x51')]['callerid'],_0x49dc64[_0x37fa('0x12a')],_0x49dc64[_0x37fa('0x12b')]>0x0?ut['getCallerIdRandom'](_0x49dc64[_0x37fa('0x38')],_0x49dc64[_0x37fa('0x12b')]):_0x49dc64[_0x37fa('0x38')]):ut[_0x37fa('0x129')](_[_0x37fa('0x65')](_0x49dc64[_0x37fa('0x11e')])?_0x49dc64['Trunk']['callerid']:_0x49dc64[_0x37fa('0x11e')]['callerid'],_0x49dc64['dialOriginateCallerIdName'],_0x49dc64['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x49dc64[_0x37fa('0x38')],_0x49dc64[_0x37fa('0x12b')]):_0x49dc64[_0x37fa('0x38')]);if(_0x366188){_0x625d5f[_0x37fa('0x12c')]=ut[_0x37fa('0x12d')](_0x366188);_0x625d5f[_0x37fa('0x12e')]=ut[_0x37fa('0x12f')](_0x366188);}var _0x192f3b=ut[_0x37fa('0x130')](_0x49dc64,_0x457eea,_0x150741,_0x366188,_0x43f74b,_0x625d5f);_[_0x37fa('0x131')](_0x625d5f,ut[_0x37fa('0x132')](_0x192f3b));_0x625d5f[_0x37fa('0x8a')]=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));ami['Action'](ut['variablesAction'](_0x625d5f,_0x49dc64,_0x192f3b,_0x625d5f[_0x37fa('0xc2')],_0x4234cd))[_0x37fa('0x86')](function(_0x419108){var _0x5091a8=_0x625d5f[_0x37fa('0x133')];if(!_[_0x37fa('0x65')](_0x5091a8)){if(!_[_0x37fa('0x65')](_0x1c9229[_0x37fa('0xfc')][_0x5091a8])){_0x1c9229['agents'][_0x5091a8][_0x37fa('0x134')]=_0x625d5f[_0x37fa('0x135')];emit(util[_0x37fa('0x58')]('user:%s',_0x1c9229[_0x37fa('0xfc')][_0x5091a8][_0x37fa('0x29')]),'user:agentconnect',{'destaccountcode':_0x1c9229[_0x37fa('0xfc')][_0x5091a8][_0x37fa('0x136')],'destconnectedlinenum':_0x625d5f[_0x37fa('0x135')]});}}_0x49dc64['originated']+=0x1;logger[_0x37fa('0x56')](_0x37fa('0x137'),_0x43f74b,_0x37fa('0xbb'),_0x49dc64[_0x37fa('0x29')],_0x37fa('0x69'),_0x49dc64[_0x37fa('0x4d')]);_0x49bba3(_0x419108);})[_0x37fa('0x73')](function(_0x647d35){ut['logAgent'](_0x625d5f,0xe,_0x37fa('0x138'));rpcDb['createAgentHistory'](_0x625d5f,_0x37fa('0x139'));_0x639f7c(_0x647d35);});});};Preview[_0x37fa('0x10')][_0x37fa('0x21')]=function(_0x18c2e4){if(this[_0x37fa('0x17')][_0x18c2e4[_0x37fa('0xac')]]){this[_0x37fa('0x17')][_0x18c2e4[_0x37fa('0xac')]][_0x37fa('0x72')]=_0x18c2e4[_0x37fa('0x72')];}};Preview[_0x37fa('0x10')][_0x37fa('0x19')]=function(_0x3c3757){var _0x4d31b2=this;var _0x20a95b=this[_0x37fa('0x17')][_0x3c3757[_0x37fa('0x13a')]];if(_0x20a95b){if(_0x20a95b[_0x37fa('0xfd')]&&this[_0x37fa('0xfc')][_0x20a95b[_0x37fa('0xfd')]]){ut[_0x37fa('0x13b')](_0x20a95b,this[_0x37fa('0xfc')][_0x20a95b[_0x37fa('0xfd')]][_0x37fa('0x29')],this['agents'][_0x20a95b['lookAgent']]['id']);}var _0x2e6816=_['clone'](_0x20a95b);_0x2e6816[_0x37fa('0x13c')]=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));var _0x4acc6e=_0x4d31b2[_0x37fa('0x15')][_0x20a95b[_0x37fa('0x68')]];if(ut['isFailure'](_0x3c3757[_0x37fa('0x13d')])){if(_0x20a95b[_0x37fa('0xab')]){rpcDb[_0x37fa('0x10f')](_0x20a95b[_0x37fa('0x103')]);}if(_0x20a95b[_0x37fa('0xc2')]){rpcDb['disableContact'](_0x20a95b['idContact']);}ami[_0x37fa('0x26')](_0x37fa('0x13e'),ut[_0x37fa('0x9e')](_0x20a95b,_0x37fa('0x13f'),this[_0x37fa('0x15')][_0x20a95b['queue']]));this[_0x37fa('0xeb')](_0x2e6816,_0x4acc6e,_0x3c3757);}else{_0x20a95b['starttime']=moment()[_0x37fa('0x58')](_0x37fa('0x8b'));ut[_0x37fa('0xf2')](_0x2e6816,0x4,_0x37fa('0xb5'));rpcDb[_0x37fa('0xf0')](_0x2e6816,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x37fa('0x10')][_0x37fa('0x1c')]=function(_0x292c83){var _0x2e6c16=this;var _0x7157a4=this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]];var _0xce0156;if(_0x7157a4){_0xce0156=this[_0x37fa('0x15')][_0x7157a4[_0x37fa('0x68')]];logger[_0x37fa('0x56')](_0x37fa('0x140'),_0x292c83[_0x37fa('0xac')],_0x37fa('0xbb'),_0xce0156['name'],_0x37fa('0x6a'),_0xce0156[_0x37fa('0x2d')]);}if(this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]]&&_0x292c83[_0x37fa('0xac')]!==_0x292c83[_0x37fa('0xaf')]){if(_0x292c83[_0x37fa('0x141')]==='16'&&this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]][_0x37fa('0x6b')]){this[_0x37fa('0x9a')](_0x292c83,_0x292c83[_0x37fa('0xac')],_0x292c83[_0x37fa('0x141')]);}else if(this['actions'][_0x292c83[_0x37fa('0xac')]][_0x37fa('0x6b')]){logger[_0x37fa('0x56')]('[syncHangup][talking][cause]',_0x292c83['linkedid'],_0x292c83[_0x37fa('0x141')],_0x37fa('0xbb'),_0xce0156['name'],_0x37fa('0x6a'),_0xce0156[_0x37fa('0x2d')]);this[_0x37fa('0x9a')](_0x292c83,_0x292c83[_0x37fa('0xac')],_0x292c83['cause']);}}else if(_0x7157a4&&_[_0x37fa('0x65')](_0x7157a4[_0x37fa('0x142')])&&_0xce0156[_0x37fa('0x143')]&&_0x292c83[_0x37fa('0xac')]===_0x292c83['uniqueid']&&_[_0x37fa('0x65')](_0x292c83['reason'])&&_0x292c83[_0x37fa('0x141')]==='16'&&_0x292c83[_0x37fa('0x144')]==='6'&&_[_0x37fa('0xec')](_0x7157a4[_0x37fa('0x145')])){if(_0x7157a4[_0x37fa('0xab')]){rpcDb[_0x37fa('0x10f')](_0x7157a4[_0x37fa('0x103')]);}if(_0x7157a4[_0x37fa('0xc2')]){rpcDb[_0x37fa('0x89')](_0x7157a4[_0x37fa('0x103')]);}_0x292c83[_0x37fa('0xee')]='22';this[_0x37fa('0xeb')](_0x7157a4,_0xce0156,_0x292c83);}else if(_0x7157a4&&_0x7157a4[_0x37fa('0x145')]){if(_0x292c83[_0x37fa('0x141')]==='16'&&this[_0x37fa('0x17')][_0x292c83[_0x37fa('0xac')]][_0x37fa('0x6b')]){logger['info'](_0x37fa('0x146'),_0x292c83[_0x37fa('0xac')],_0x292c83['cause'],'\x20Queue',_0xce0156[_0x37fa('0x29')],'pTalking:\x20',_0xce0156[_0x37fa('0x2d')]);this['callProgressDetectingCustomer'](_0x292c83,_0x292c83[_0x37fa('0xac')],_0x292c83[_0x37fa('0x141')]);}else if(this['actions'][_0x292c83[_0x37fa('0xac')]]['dialAnswer']){logger[_0x37fa('0x56')]('[syncHangup][talking][cause]',_0x292c83[_0x37fa('0xac')],_0x292c83[_0x37fa('0x141')],_0x37fa('0xbb'),_0xce0156[_0x37fa('0x29')],'pTalking:\x20',_0xce0156[_0x37fa('0x2d')]);this['callProgressDetectingCustomer'](_0x292c83,_0x292c83['linkedid'],_0x292c83[_0x37fa('0x141')]);}}};Preview[_0x37fa('0x10')][_0x37fa('0x1f')]=function(_0x5f013c){if(this[_0x37fa('0x17')][_0x5f013c['destlinkedid']]&&_0x5f013c['destlinkedid']!==_0x5f013c[_0x37fa('0x147')]){this[_0x37fa('0x9a')](_0x5f013c,_0x5f013c[_0x37fa('0xea')],_0x5f013c['dialstatus']);}};Preview[_0x37fa('0x10')][_0x37fa('0x1d')]=function(_0x2f86c7){if(this[_0x37fa('0x17')][_0x2f86c7[_0x37fa('0xac')]]&&_0x2f86c7[_0x37fa('0xac')]!==_0x2f86c7[_0x37fa('0xaf')]&&!this['actions'][_0x2f86c7[_0x37fa('0xac')]]['dialAnswer']){if(_0x2f86c7['cause']==='1'){this[_0x37fa('0x9a')](_0x2f86c7,_0x2f86c7['linkedid'],_0x2f86c7['cause']);}}};Preview[_0x37fa('0x10')][_0x37fa('0x148')]=function(_0xb40e14,_0x6a2013,_0x1a07c9){if(this[_0x37fa('0x17')][_0xb40e14]){if(_[_0x37fa('0x65')](this[_0x37fa('0x17')][_0xb40e14][_0x37fa('0x149')])){this['actions'][_0xb40e14][_0x37fa('0x149')]={};}this[_0x37fa('0x17')][_0xb40e14][_0x37fa('0x149')][_0x6a2013]=_0x1a07c9;}};Preview[_0x37fa('0x10')][_0x37fa('0x14a')]=function(_0x38ca25){try{if(!_[_0x37fa('0x65')](_0x38ca25)){if(ut['filterKey'](_[_0x37fa('0x14b')](_0x38ca25[_0x37fa('0x14c')])[0x0])){this[_0x37fa('0x148')](_0x38ca25[_0x37fa('0xaf')],_['keys'](_0x38ca25[_0x37fa('0x14c')])[0x0],_0x38ca25[_0x37fa('0x14d')]);}}}catch(_0x1e5c92){logger[_0x37fa('0x14e')](_0x37fa('0x14f'),util[_0x37fa('0x150')](_0x1e5c92,{'showHidden':![],'depth':null}));}};Preview[_0x37fa('0x10')]['syncAttendedTransfer']=function(_0x4fc579){if(_0x4fc579){if(this[_0x37fa('0x17')][_0x4fc579[_0x37fa('0x151')]]){this[_0x37fa('0x17')][_0x4fc579[_0x37fa('0x151')]][_0x37fa('0x145')]=!![];}}};Preview[_0x37fa('0x10')][_0x37fa('0x24')]=function(_0x22dcb9){if(_0x22dcb9){if(this[_0x37fa('0x17')][_0x22dcb9[_0x37fa('0x152')]]){this['actions'][_0x22dcb9[_0x37fa('0x152')]][_0x37fa('0x145')]=!![];}}};module[_0x37fa('0x153')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 17d41a5..b467c4a 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 _0x8f33=['crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8f33,0x8f));var _0x38f3=function(_0x373afe,_0x4841f3){_0x373afe=_0x373afe-0x0;var _0x4decea=_0x8f33[_0x373afe];return _0x4decea;};'use strict';var util=require(_0x38f3('0x0'));var BPromise=require(_0x38f3('0x1'));var logger=require(_0x38f3('0x2'))(_0x38f3('0x3'));var _=require('lodash');var cmHopper=require(_0x38f3('0x4'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x38f3('0x5'));var cmHopperBlack=require(_0x38f3('0x6'));var voiceQueueRt=require(_0x38f3('0x7'));var agentReportPreview=require(_0x38f3('0x8'));var voiceQueueReport=require(_0x38f3('0x9'));function loggerCatch(_0x18a501){return function(_0x338152){logger[_0x38f3('0xa')](_0x18a501,util[_0x38f3('0xb')](_0x338152,{'showHidden':![],'depth':null}));};}function create(_0x3d794f){return BPromise[_0x38f3('0xc')]()[_0x38f3('0xd')](cmHopperHistory[_0x38f3('0xe')](_0x3d794f))['catch'](loggerCatch(_0x38f3('0xf')));}function createAgent(_0x4f9c6f){return BPromise[_0x38f3('0xc')]()['then'](agentReportPreview[_0x38f3('0xe')](_0x4f9c6f))[_0x38f3('0x10')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x5fd5b9){return BPromise[_0x38f3('0xc')]()['then'](cmHopper[_0x38f3('0x11')](_0x5fd5b9,!![]))[_0x38f3('0x10')](loggerCatch(_0x38f3('0x12')));}exports['checkIsBlackList']=function(_0x5138ba){return BPromise[_0x38f3('0xc')]()[_0x38f3('0xd')](cmHopperBlack[_0x38f3('0x13')](_0x5138ba))[_0x38f3('0x10')](loggerCatch(_0x38f3('0x14')));};exports[_0x38f3('0x15')]=function(_0x4ced88){return BPromise[_0x38f3('0xc')]()[_0x38f3('0xd')](cmHopper[_0x38f3('0x15')](_0x4ced88))[_0x38f3('0x10')](loggerCatch(_0x38f3('0x16')));};exports[_0x38f3('0xe')]=function(_0x9e74ee,_0xd572ea){create(_0x9e74ee)[_0x38f3('0x10')](loggerCatch(_0xd572ea));moveContact(_0x9e74ee)['catch'](loggerCatch(_0xd572ea));};exports[_0x38f3('0x17')]=function(_0x10c8e0,_0x5a7c7b){createAgent(_0x10c8e0)[_0x38f3('0x10')](loggerCatch(_0x5a7c7b));};exports[_0x38f3('0x18')]=function(_0x3147fe,_0x4c1f74){create(_0x3147fe)[_0x38f3('0x10')](loggerCatch(_0x4c1f74));};exports[_0x38f3('0x19')]=function(_0x450edc,_0x1f8461){moveContact(_0x450edc)['catch'](loggerCatch(_0x1f8461));};exports['rescheduleContact']=function(_0x309310,_0x2813ff,_0x55f1d8){if(_0x2813ff){_0x309310[_0x38f3('0x1a')]=null;}if(_0x55f1d8){_0x309310[_0x38f3('0x1b')]=![];}return BPromise[_0x38f3('0xc')]()[_0x38f3('0xd')](cmHopper[_0x38f3('0x1c')](_0x309310))[_0x38f3('0x10')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x38f3('0x1d')]=function(_0x16fd0f){return BPromise['resolve']()[_0x38f3('0xd')](cmHopper['countReScheduled'](_0x16fd0f))[_0x38f3('0x10')](loggerCatch(_0x38f3('0x1e')));};exports[_0x38f3('0x1f')]=function(_0xd53b39){return BPromise['resolve']()[_0x38f3('0xd')](cmHopper[_0x38f3('0x1f')]({'UserId':null},_0xd53b39,0x1))[_0x38f3('0x10')](loggerCatch(_0x38f3('0x20')));};exports['disableContact']=function(_0x5e9681){return BPromise[_0x38f3('0xc')]()[_0x38f3('0xd')](cmHopper[_0x38f3('0x1f')]({'active':![]},_0x5e9681,0x1))[_0x38f3('0x10')](loggerCatch(_0x38f3('0x21')));};exports[_0x38f3('0x22')]=function(_0x296aa3){var _0x8ead96={};_0x8ead96[_0x38f3('0x23')]=_0x296aa3['type'];_0x8ead96['uniqueid']=_0x296aa3[_0x38f3('0x24')];_0x8ead96[_0x38f3('0x25')]=_0x296aa3['calleridnum'];_0x8ead96[_0x38f3('0x26')]=_0x296aa3[_0x38f3('0x26')];_0x8ead96[_0x38f3('0x27')]=_0x296aa3[_0x38f3('0x27')];_0x8ead96['queuecallerjoinAt']=_0x296aa3['answertime'];_0x8ead96['queuecallerleaveAt']=_0x296aa3[_0x38f3('0x28')];_0x8ead96[_0x38f3('0x29')]=0x1;_0x8ead96[_0x38f3('0x2a')]=_0x296aa3[_0x38f3('0x2b')];_0x8ead96[_0x38f3('0x2c')]=_0x296aa3['membername'];_0x8ead96[_0x38f3('0x2d')]=_0x38f3('0x2e');_0x8ead96[_0x38f3('0x2f')]=_0x38f3('0x30');_0x8ead96[_0x38f3('0x31')]=0x0;_0x8ead96[_0x38f3('0x32')]=0x1;_0x8ead96[_0x38f3('0x33')]=_0x296aa3[_0x38f3('0x34')];_0x8ead96[_0x38f3('0x35')]=_0x38f3('0x36');return BPromise[_0x38f3('0xc')]()[_0x38f3('0xd')](voiceQueueReport[_0x38f3('0x37')](_0x8ead96))[_0x38f3('0x10')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x38f3('0x38')]=function(_0x2b8657,_0x2a9a2d){return BPromise['resolve']()[_0x38f3('0xd')](cmHopper['getContactRecallMe'](_0x2b8657,_0x2a9a2d))[_0x38f3('0x10')](loggerCatch(_0x38f3('0x39')));};exports[_0x38f3('0x3a')]=function(_0x259a8c){return BPromise[_0x38f3('0xc')]()['then'](cmHopper[_0x38f3('0x1c')](_0x259a8c,!![],!![]))[_0x38f3('0x10')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xa1b4=['[countReScheduled]\x20','unlockContact','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','then','createHistory','catch','[createHistory]\x20','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled'];(function(_0x5c6244,_0x112ab8){var _0x5800ce=function(_0x304e3d){while(--_0x304e3d){_0x5c6244['push'](_0x5c6244['shift']());}};_0x5800ce(++_0x112ab8);}(_0xa1b4,0x8a));var _0x4a1b=function(_0xce9195,_0x1963e1){_0xce9195=_0xce9195-0x0;var _0x530fe6=_0xa1b4[_0xce9195];return _0x530fe6;};'use strict';var util=require(_0x4a1b('0x0'));var BPromise=require('bluebird');var logger=require(_0x4a1b('0x1'))('preview');var _=require(_0x4a1b('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x4a1b('0x3'));var cmHopperBlack=require(_0x4a1b('0x4'));var voiceQueueRt=require(_0x4a1b('0x5'));var agentReportPreview=require(_0x4a1b('0x6'));var voiceQueueReport=require(_0x4a1b('0x7'));function loggerCatch(_0x37f51f){return function(_0x1e1eeb){logger['error'](_0x37f51f,util[_0x4a1b('0x8')](_0x1e1eeb,{'showHidden':![],'depth':null}));};}function create(_0x215185){return BPromise['resolve']()[_0x4a1b('0x9')](cmHopperHistory[_0x4a1b('0xa')](_0x215185))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0xc')));}function createAgent(_0x45fbc6){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](agentReportPreview[_0x4a1b('0xa')](_0x45fbc6))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0xc')));}function moveContact(_0x2bd4ce){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0xe')](_0x2bd4ce,!![]))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0xf')));}exports[_0x4a1b('0x10')]=function(_0x4c68a3){return BPromise['resolve']()[_0x4a1b('0x9')](cmHopperBlack[_0x4a1b('0x10')](_0x4c68a3))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x11')));};exports['getContactPreview']=function(_0x4e2cf1){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x12')](_0x4e2cf1))[_0x4a1b('0xb')](loggerCatch('[getContactPreview]\x20'));};exports[_0x4a1b('0xa')]=function(_0x87c907,_0x4fc505){create(_0x87c907)[_0x4a1b('0xb')](loggerCatch(_0x4fc505));moveContact(_0x87c907)['catch'](loggerCatch(_0x4fc505));};exports[_0x4a1b('0x13')]=function(_0x4e7c3d,_0xd70c44){createAgent(_0x4e7c3d)[_0x4a1b('0xb')](loggerCatch(_0xd70c44));};exports[_0x4a1b('0x14')]=function(_0x2f75ae,_0x2bea0a){create(_0x2f75ae)[_0x4a1b('0xb')](loggerCatch(_0x2bea0a));};exports[_0x4a1b('0x15')]=function(_0x579637,_0x5e0e81){moveContact(_0x579637)[_0x4a1b('0xb')](loggerCatch(_0x5e0e81));};exports['rescheduleContact']=function(_0x58a2f1,_0x2141b9,_0x3617e1){if(_0x2141b9){_0x58a2f1[_0x4a1b('0x16')]=null;}if(_0x3617e1){_0x58a2f1[_0x4a1b('0x17')]=![];}return BPromise['resolve']()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x18')](_0x58a2f1))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x19')));};exports[_0x4a1b('0x1a')]=function(_0x331041){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x1a')](_0x331041))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x1b')));};exports[_0x4a1b('0x1c')]=function(_0x4608a1){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x1c')]({'UserId':null},_0x4608a1,0x1))[_0x4a1b('0xb')](loggerCatch('[unlockContact]\x20'));};exports[_0x4a1b('0x1d')]=function(_0x3196cd){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x1c')]({'active':![]},_0x3196cd,0x1))[_0x4a1b('0xb')](loggerCatch('[activeContact]\x20'));};exports[_0x4a1b('0x1e')]=function(_0xf1e58d){var _0x5941ed={};_0x5941ed[_0x4a1b('0x1f')]=_0xf1e58d[_0x4a1b('0x1f')];_0x5941ed[_0x4a1b('0x20')]=_0xf1e58d[_0x4a1b('0x20')];_0x5941ed[_0x4a1b('0x21')]=_0xf1e58d[_0x4a1b('0x21')];_0x5941ed[_0x4a1b('0x22')]=_0xf1e58d[_0x4a1b('0x22')];_0x5941ed['queue']=_0xf1e58d[_0x4a1b('0x23')];_0x5941ed[_0x4a1b('0x24')]=_0xf1e58d['answertime'];_0x5941ed['queuecallerleaveAt']=_0xf1e58d[_0x4a1b('0x25')];_0x5941ed['queuecallercomplete']=0x1;_0x5941ed[_0x4a1b('0x26')]=_0xf1e58d[_0x4a1b('0x27')];_0x5941ed[_0x4a1b('0x28')]=_0xf1e58d[_0x4a1b('0x29')];_0x5941ed[_0x4a1b('0x2a')]=_0x4a1b('0x2b');_0x5941ed['exten']=_0x4a1b('0x2c');_0x5941ed[_0x4a1b('0x2d')]=0x0;_0x5941ed[_0x4a1b('0x2e')]=0x1;_0x5941ed[_0x4a1b('0x2f')]=_0xf1e58d['membername'];_0x5941ed[_0x4a1b('0x30')]=_0x4a1b('0x31');return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](voiceQueueReport[_0x4a1b('0x32')](_0x5941ed))[_0x4a1b('0xb')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x32e5cc,_0x9a0e2b){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x33')](_0x32e5cc,_0x9a0e2b))['catch'](loggerCatch(_0x4a1b('0x34')));};exports[_0x4a1b('0x35')]=function(_0x2ef8f1){return BPromise[_0x4a1b('0xd')]()[_0x4a1b('0x9')](cmHopper[_0x4a1b('0x18')](_0x2ef8f1,!![],!![]))[_0x4a1b('0xb')](loggerCatch(_0x4a1b('0x36')));}; \ 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 707ed2e..b147227 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 _0x62ec=['\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','membername','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','queue','interface','motionChannel','mandatoryDisposition','buildAcw','not_inuse','reachable','push','getDiff','seconds','createBody','filterKey','idContact','type','dialAnswer','countnoanswerretry','callback','callbackuniqueid','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','replace','random','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','error','inspect','loggerError','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout'];(function(_0xf3de8e,_0x3cdbde){var _0x31dca6=function(_0x3912f1){while(--_0x3912f1){_0xf3de8e['push'](_0xf3de8e['shift']());}};_0x31dca6(++_0x3cdbde);}(_0x62ec,0x6e));var _0xc62e=function(_0x4b826e,_0x33b6b){_0x4b826e=_0x4b826e-0x0;var _0x10e06c=_0x62ec[_0x4b826e];return _0x10e06c;};'use strict';var util=require(_0xc62e('0x0'));var _=require(_0xc62e('0x1'));var moment=require(_0xc62e('0x2'));var logger=require(_0xc62e('0x3'))(_0xc62e('0x4'));var ipAgi=process[_0xc62e('0x5')][_0xc62e('0x6')]||_0xc62e('0x7');function getSeconds(_0x512ef2,_0x5ecfed){var _0x30d5ff=moment(_0x512ef2)[_0xc62e('0x8')](0x0);var _0x24070d=moment(_0x5ecfed)[_0xc62e('0x8')](0x0);return _0x30d5ff[_0xc62e('0x9')](_0x24070d,'seconds');}exports['loggerCatch']=function(_0x5a16d7){return function(_0x4cd5b4){logger[_0xc62e('0xa')](_0x5a16d7,util['inspect'](_0x4cd5b4,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1fad16,_0x7ef432){logger['info'](_0x1fad16,util[_0xc62e('0xb')](_0x7ef432,{'showHidden':![],'depth':null}));};exports[_0xc62e('0xc')]=function(_0x33b713,_0x1147bf){logger['error'](_0x33b713,util[_0xc62e('0xb')](_0x1147bf,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x1f2cee){return function(_0x4652da){logger[_0xc62e('0xd')](_0x1f2cee,util['inspect'](_0x4652da,{'showHidden':![],'depth':null}));};};exports[_0xc62e('0xe')]=function(_0x86c184,_0x2081a5,_0xa2e141){return{'message':_0x86c184,'unlock':_0x2081a5,'active':_0xa2e141};};exports[_0xc62e('0xf')]=function(_0x3da25e,_0x1e8c5e,_0x1b3386){if(!_[_0xc62e('0x10')](_0x1b3386)&&_0xc62e('0x11')===typeof _0x1b3386&&!_['isEmpty'](_0x1b3386)){if(!_[_0xc62e('0x10')](_0x1e8c5e)&&_0xc62e('0x11')===typeof _0x1e8c5e&&!_[_0xc62e('0x12')](_0x1e8c5e)){return util[_0xc62e('0x13')](_0xc62e('0x14'),_0x1e8c5e,_0x1b3386);}return util[_0xc62e('0x13')](_0xc62e('0x14'),_0x1b3386,_0x1b3386);}if(!_['isUndefined'](_0x3da25e)&&'string'===typeof _0x3da25e&&!_[_0xc62e('0x12')](_0x3da25e)){return _0x3da25e;}return'\x22\x22\x20<>';};exports[_0xc62e('0x15')]=function(_0x5bd48e){if(_[_0xc62e('0x16')](_0x5bd48e)){return![];}return _0x5bd48e;};exports[_0xc62e('0x17')]=function(_0x1e6804,_0x5573bd,_0x6660a2,_0x3d98e5,_0x29ca0c,_0x4c3ffc){var _0x4b591f={'XMD-QUEUE':_0x5573bd[_0xc62e('0x18')]?_0x5573bd['Queue'][_0xc62e('0x19')]:'','XMD-CALLERID':_0x3d98e5,'XMD-CALLERID-PREVIEW':_0x4c3ffc?util[_0xc62e('0x13')](_0xc62e('0x14'),_0x4c3ffc[_0xc62e('0x1a')],_0x4c3ffc[_0xc62e('0x1b')]):_0x3d98e5,'XMD-DIALID':_0x29ca0c,'XMD-CONTACTID':_0x5573bd[_0xc62e('0x1c')],'XMD-CDRTYPE':_0xc62e('0x1d'),'CALLERID(all)':_0x3d98e5,'XMD-VOICEQUEUEID':_0x5573bd['VoiceQueueId'],'XMD-DIALCHANNEL':_0x6660a2,'XMD-DIALTIMEOUT':_0x1e6804[_0xc62e('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xc62e('0x13')](_0xc62e('0x1f'),_0x1e6804['dialQueueProject2']?'g':'',_[_0xc62e('0x12')](_0x1e6804[_0xc62e('0x20')])?'':_0xc62e('0x21')),'XMD-DIALURL':_0x1e6804['dialPreviewUrl']||'','XMD-AGI':_0x1e6804[_0xc62e('0x22')]?util[_0xc62e('0x13')](_0xc62e('0x23'),ipAgi,_0x1e6804[_0xc62e('0x22')]):_0xc62e('0x24'),'XMD-AGIAFTER':_0x1e6804[_0xc62e('0x25')]?util['format'](_0xc62e('0x23'),ipAgi,_0x1e6804[_0xc62e('0x25')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4c3ffc?_0x4c3ffc[_0xc62e('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x4c3ffc?_0x4c3ffc['originatecalleridname']:'','XMD-DESTINATION':_0xc62e('0x27')};if(!_[_0xc62e('0x12')](_0x1e6804[_0xc62e('0x20')])){_0x4b591f[util[_0xc62e('0x13')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x1e6804[_0xc62e('0x20')];_0x4b591f[util['format']('%s',_0xc62e('0x28'))]=_0x29ca0c;}if(_0x5573bd&&_0x5573bd[_0xc62e('0x29')]){for(var _0x11c1bc in _0x5573bd['Contact']){if(_0x5573bd[_0xc62e('0x29')][_0xc62e('0x2a')](_0x11c1bc)){if(!_['isNil'](_0x5573bd['Contact'][_0x11c1bc])&&_0x11c1bc!=='id'&&_0x11c1bc!==_0xc62e('0x2b')&&_0x11c1bc!==_0xc62e('0x2c')&&_0x11c1bc!==_0xc62e('0x2d')){_0x4b591f[util[_0xc62e('0x13')](_0xc62e('0x2e'),'XMD-',_[_0xc62e('0x2f')](_0x11c1bc))]=_0x5573bd[_0xc62e('0x29')][_0x11c1bc];}}}}return _0x4b591f;};exports['toLowerVariables']=function(_0x5aeaf4){var _0x2061d4={};for(var _0x3ad0bd in _0x5aeaf4){if(_0x5aeaf4[_0xc62e('0x2a')](_0x3ad0bd)){_0x2061d4[util['format']('%s',_[_0xc62e('0x30')](_0x3ad0bd))]=_0x5aeaf4[_0x3ad0bd];}}return{'variables':_0x2061d4};};exports[_0xc62e('0x31')]=function(_0x6c6538,_0x4f266e){if(!_['isNil'](_0x6c6538)){if(_0x6c6538[_0xc62e('0x2a')]('originated')){if(_0x6c6538[_0xc62e('0x32')]>0x0){_0x6c6538[_0xc62e('0x32')]-=0x1;}else{logger[_0xc62e('0xa')](_0xc62e('0x33'),_0x4f266e);}}}else{logger[_0xc62e('0xa')](_0xc62e('0x34'),_0x4f266e);}};exports['logBlacklist']=function(_0x4dde0b){var _0x954d8c=moment()[_0xc62e('0x13')](_0xc62e('0x35'));_0x4dde0b[_0xc62e('0x36')]=0xd;_0x4dde0b[_0xc62e('0x37')]=_0xc62e('0x38');_0x4dde0b[_0xc62e('0x39')]=_0x954d8c;_0x4dde0b[_0xc62e('0x3a')]=_0x954d8c;_0x4dde0b[_0xc62e('0x3b')]=_0x954d8c;};exports[_0xc62e('0x3c')]=function(_0x4d518d,_0x5dae58,_0x11eae6){var _0x5ba50e=moment()[_0xc62e('0x13')](_0xc62e('0x35'));_0x4d518d[_0xc62e('0x36')]=_0x5dae58;_0x4d518d[_0xc62e('0x37')]=_0x11eae6;_0x4d518d[_0xc62e('0x3a')]=_0x5ba50e;_0x4d518d['ringtime']=getSeconds(_0x4d518d[_0xc62e('0x3a')],_0x4d518d['starttime']);};exports[_0xc62e('0x3d')]=function(_0x411e68,_0x346d16,_0x442dcf){_0x411e68[_0xc62e('0x3e')]=_0x346d16;_0x411e68['UserId']=_0x442dcf;};exports[_0xc62e('0x3f')]=function(_0x4e6a7e,_0x229cb6,_0x57c809){var _0x36381c=moment()['format'](_0xc62e('0x35'));_0x4e6a7e[_0xc62e('0x36')]=_0x229cb6;_0x4e6a7e[_0xc62e('0x37')]=_0x57c809;_0x4e6a7e[_0xc62e('0x3a')]=_0x4e6a7e[_0xc62e('0x3a')]?_0x4e6a7e[_0xc62e('0x3a')]:_0x36381c;_0x4e6a7e[_0xc62e('0x3b')]=_0x4e6a7e[_0xc62e('0x3b')]?_0x4e6a7e['endtime']:_0x36381c;_0x4e6a7e[_0xc62e('0x40')]=getSeconds(_0x4e6a7e[_0xc62e('0x3a')]||0x0,_0x4e6a7e['starttime']||0x0);_0x4e6a7e[_0xc62e('0x41')]=_0x4e6a7e[_0xc62e('0x42')]?getSeconds(_0x4e6a7e['endtime'],_0x4e6a7e[_0xc62e('0x42')]):0x0;};exports[_0xc62e('0x43')]=function(_0x4a4dc0){return _0x4a4dc0===_0xc62e('0x44');};exports[_0xc62e('0x45')]=function(_0x55c8c8,_0x4a88ab,_0x1ef386,_0x5a8ca4,_0x2e0082){var _0x59fad6=_0x5a8ca4?_0xc62e('0x46'):_0x55c8c8[_0xc62e('0x1a')];_0x59fad6=_0x2e0082?_0xc62e('0x47'):_0x59fad6;return{'actionid':_0x55c8c8[_0xc62e('0x48')],'action':_0xc62e('0x49'),'channel':_0x55c8c8[_0xc62e('0x4a')],'callerid':util[_0xc62e('0x13')](_0xc62e('0x14'),_0x59fad6,_0x55c8c8[_0xc62e('0x1b')]),'Exten':'xcally-motion-preview','Context':_0xc62e('0x4b'),'Priority':'1','variable':_0x1ef386,'timeout':(_0x4a88ab[_0xc62e('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x55c8c8[_0xc62e('0x48')]};};exports[_0xc62e('0x4d')]=function(_0x4ab5ec){return _0x4ab5ec[_0xc62e('0x4e')]+_0x4ab5ec[_0xc62e('0x4f')]+_0x4ab5ec['countnoanswerretry']+_0x4ab5ec[_0xc62e('0x50')]+_0x4ab5ec[_0xc62e('0x51')];};exports[_0xc62e('0x52')]=function(_0x559008){var _0x33e876=_[_0xc62e('0x53')](_0x559008);_0x33e876['state']=0xf;_0x33e876[_0xc62e('0x37')]='Global';return _0x33e876;};exports[_0xc62e('0x54')]=function(_0x302260,_0x500216,_0x4f05bf){var _0x4f2e36={};_0x4f2e36[_0x500216]=_0x302260[_0x500216];_0x4f2e36[_0xc62e('0x55')]=![];_0x4f2e36[_0xc62e('0x56')]=moment()[_0xc62e('0x57')](_0x4f05bf,_0xc62e('0x58'))[_0xc62e('0x13')](_0xc62e('0x35'));_0x4f2e36[_0xc62e('0x1c')]=_0x302260[_0xc62e('0x1c')];_0x4f2e36[_0xc62e('0x59')]=_0x302260[_0xc62e('0x59')];_0x4f2e36[_0xc62e('0x5a')]=_0x302260['VoiceQueueId']||undefined;return _0x4f2e36;};exports['decrementTalkink']=function(_0x5ddbc4,_0x65376c){if(!_[_0xc62e('0x16')](_0x5ddbc4)){if(_0x5ddbc4[_0xc62e('0x5b')]>0x0){_0x5ddbc4['pTalking']-=0x1;}else{logger[_0xc62e('0xa')](_0x65376c,_0xc62e('0x5c'));}}else{logger[_0xc62e('0xa')](_0x65376c,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0xc62e('0x5d')]=function(_0x4e0969){if(_0x4e0969<=0x0){return!![];}return![];};exports['buildObj']=function(_0x26df62,_0x429890,_0x441ff0){_0x26df62['lastevent']=_0x429890;_0x26df62['name']=_0x26df62[_0xc62e('0x5e')];_0x26df62[_0xc62e('0x5f')]=_0x26df62['channelAgent'];_0x26df62[_0xc62e('0x60')]='voice';if(_0x441ff0){_0x26df62[_0xc62e('0x61')]=_0x441ff0[_0xc62e('0x61')];}return _0x26df62;};exports[_0xc62e('0x62')]=function(_0x4859b8){var _0x1b3d42={};_0x1b3d42[_0xc62e('0x5e')]=_0x4859b8[_0xc62e('0x5e')];_0x1b3d42['interface']=_0x4859b8[_0xc62e('0x4a')];_0x1b3d42[_0xc62e('0x48')]=_0x4859b8[_0xc62e('0x48')];return _0x1b3d42;};exports['agentReadyId']=function(_0xef2c63){var _0x2f7ff2=[];for(var _0x31801f in _0xef2c63){if(_0xef2c63[_0xc62e('0x2a')](_0x31801f)){if(!_['isNil'](_0xef2c63[_0x31801f])&&_0xef2c63[_0x31801f][_0xc62e('0x36')]===_0xc62e('0x63')&&_0xef2c63[_0x31801f]['status']===_0xc62e('0x64')){_0x2f7ff2[_0xc62e('0x65')](_0xef2c63[_0x31801f]['id']);}}}return _0x2f7ff2;};exports[_0xc62e('0x66')]=function(_0x41d5ea){var _0x388960=moment()[_0xc62e('0x8')](0x0);var _0x3aa09c=moment(_0x41d5ea)[_0xc62e('0x8')](0x0);return _0x388960[_0xc62e('0x9')](_0x3aa09c,_0xc62e('0x67'));};exports[_0xc62e('0x68')]=function(_0x3fe3cb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3fe3cb[_0xc62e('0x1c')],'ListId':_0x3fe3cb[_0xc62e('0x59')],'VoiceQueueId':_0x3fe3cb[_0xc62e('0x5a')]||undefined,'CampaignId':_0x3fe3cb['CampaignId']||undefined};};exports[_0xc62e('0x69')]=function(_0x5f0170){if(_0x5f0170===_0xc62e('0x48')||_0x5f0170===_0xc62e('0x6a')||_0x5f0170===_0xc62e('0x5e')||_0x5f0170===_0xc62e('0x6b')||_0x5f0170==='campaigntype'||_0x5f0170===_0xc62e('0x6c')||_0x5f0170===_0xc62e('0x3e')||_0x5f0170===_0xc62e('0x4a')||_0x5f0170===_0xc62e('0x1a')||_0x5f0170===_0xc62e('0x55')||_0x5f0170===_0xc62e('0x1b')||_0x5f0170===_0xc62e('0x56')||_0x5f0170==='countbusyretry'||_0x5f0170===_0xc62e('0x4f')||_0x5f0170===_0xc62e('0x6d')||_0x5f0170==='countglobal'||_0x5f0170===_0xc62e('0x6e')||_0x5f0170===_0xc62e('0x6f')||_0x5f0170===_0xc62e('0x70')||_0x5f0170==='recallme'||_0x5f0170===_0xc62e('0x1c')||_0x5f0170===_0xc62e('0x59')||_0x5f0170===_0xc62e('0x71')||_0x5f0170===_0xc62e('0x5a')||_0x5f0170===_0xc62e('0x72')||_0x5f0170===_0xc62e('0x73')||_0x5f0170===_0xc62e('0x74')||_0x5f0170===_0xc62e('0x75')||_0x5f0170==='xmd-listid'||_0x5f0170===_0xc62e('0x76')||_0x5f0170===_0xc62e('0x77')||_0x5f0170===_0xc62e('0x78')||_0x5f0170===_0xc62e('0x79')||_0x5f0170==='xmd-dialchannel'||_0x5f0170===_0xc62e('0x7a')||_0x5f0170===_0xc62e('0x7b')||_0x5f0170===_0xc62e('0x7c')||_0x5f0170===_0xc62e('0x7d')||_0x5f0170==='xmd-agi'||_0x5f0170==='rtpaudioqos'||_0x5f0170===_0xc62e('0x7e')||_0x5f0170===_0xc62e('0x7f')||_0x5f0170===_0xc62e('0x80')||_0x5f0170===_0xc62e('0x81')||_0x5f0170===_0xc62e('0x82')||_0x5f0170===_0xc62e('0x83')||_0x5f0170===_0xc62e('0x84')||_0x5f0170===_0xc62e('0x85')||_0x5f0170===_0xc62e('0x7e')||_0x5f0170===_0xc62e('0x7f')||_0x5f0170==='rtpaudioqosjitterbridged'||_0x5f0170===_0xc62e('0x81')||_0x5f0170===_0xc62e('0x82')||_0x5f0170==='rtpaudioqosrtt'||_0x5f0170===_0xc62e('0x84')||_0x5f0170===_0xc62e('0x86')||_0x5f0170==='bridgepvtcallid'||_0x5f0170===_0xc62e('0x36')||_0x5f0170==='statedesc'){return![];}return!![];};exports[_0xc62e('0x87')]=function(_0x5ba910,_0x57bb1a){var _0x315423,_0x234513,_0x3e8ce9;if(_0x57bb1a<=0x0){_0x57bb1a=0x1;}_0x315423=new RegExp(_0xc62e('0x88')+_0x57bb1a+'}$');_0x234513=Math[_0xc62e('0x89')](0xa,_0x57bb1a-0x1);_0x3e8ce9=Math[_0xc62e('0x89')](0xa,_0x57bb1a)-0x1;return util[_0xc62e('0x13')]('%s',_[_0xc62e('0x8a')](_0x5ba910,_0x315423,_[_0xc62e('0x8b')](_0x234513,_0x3e8ce9)));};exports['extractCalleridName']=function(_0x4a83ac){var _0x77b6b0=_0x4a83ac[_0xc62e('0x8c')](/"(.*?)"/);return _0x77b6b0?_0x77b6b0[0x1]:_0x4a83ac;};exports['extractCalleridNumber']=function(_0x293777){var _0x507ce9=_0x293777[_0xc62e('0x8c')](/<(.*?)>/);return _0x507ce9?_0x507ce9[0x1]:_0x293777;}; \ No newline at end of file +var _0x253e=['[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','channelAgent','motionChannel','voice','mandatoryDisposition','buildAcw','interface','agentReadyId','status','push','seconds','createBody','filterKey','idContact','type','dialAnswer','countglobal','callbackuniqueid','recallme','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitterbridged','getCallerIdRandom','pow','replace','match','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','loggerCatch','error','inspect','logger','info','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','Blacklist','responsetime','logAgent','ringtime','starttime','membername','UserId','state','statedesc','endtime','answertime','Failure','RECALL','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','Global','scheduledAt','active','scheduledat','minutes','ListId','pTalking'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x253e,0x1ae));var _0xe253=function(_0x21222a,_0xa2aa7b){_0x21222a=_0x21222a-0x0;var _0x4cf9e9=_0x253e[_0x21222a];return _0x4cf9e9;};'use strict';var util=require(_0xe253('0x0'));var _=require(_0xe253('0x1'));var moment=require('moment');var logger=require(_0xe253('0x2'))(_0xe253('0x3'));var ipAgi=process[_0xe253('0x4')][_0xe253('0x5')]||_0xe253('0x6');function getSeconds(_0x2c5791,_0xc6e9b0){var _0x5513ff=moment(_0x2c5791)[_0xe253('0x7')](0x0);var _0x57b465=moment(_0xc6e9b0)[_0xe253('0x7')](0x0);return _0x5513ff[_0xe253('0x8')](_0x57b465,'seconds');}exports[_0xe253('0x9')]=function(_0x3fc7c3){return function(_0x323841){logger[_0xe253('0xa')](_0x3fc7c3,util[_0xe253('0xb')](_0x323841,{'showHidden':![],'depth':null}));};};exports[_0xe253('0xc')]=function(_0x493522,_0x5307fe){logger[_0xe253('0xd')](_0x493522,util[_0xe253('0xb')](_0x5307fe,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x260138,_0x8d9582){logger[_0xe253('0xa')](_0x260138,util[_0xe253('0xb')](_0x8d9582,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x487558){return function(_0x3daefd){logger[_0xe253('0xd')](_0x487558,util[_0xe253('0xb')](_0x3daefd,{'showHidden':![],'depth':null}));};};exports[_0xe253('0xe')]=function(_0x3adbe1,_0x50111c,_0x4f7b04){return{'message':_0x3adbe1,'unlock':_0x50111c,'active':_0x4f7b04};};exports['getCallerId']=function(_0x48313d,_0x28c429,_0x3a6aa8){if(!_[_0xe253('0xf')](_0x3a6aa8)&&_0xe253('0x10')===typeof _0x3a6aa8&&!_[_0xe253('0x11')](_0x3a6aa8)){if(!_['isUndefined'](_0x28c429)&&_0xe253('0x10')===typeof _0x28c429&&!_[_0xe253('0x11')](_0x28c429)){return util[_0xe253('0x12')](_0xe253('0x13'),_0x28c429,_0x3a6aa8);}return util[_0xe253('0x12')](_0xe253('0x13'),_0x3a6aa8,_0x3a6aa8);}if(!_[_0xe253('0xf')](_0x48313d)&&_0xe253('0x10')===typeof _0x48313d&&!_[_0xe253('0x11')](_0x48313d)){return _0x48313d;}return _0xe253('0x14');};exports[_0xe253('0x15')]=function(_0x499b67){if(_[_0xe253('0x16')](_0x499b67)){return![];}return _0x499b67;};exports[_0xe253('0x17')]=function(_0x4ed500,_0x40e688,_0x174540,_0x4a8bc2,_0x30e295,_0x30472f){var _0x2f91ab={'XMD-QUEUE':_0x40e688[_0xe253('0x18')]?_0x40e688[_0xe253('0x18')][_0xe253('0x19')]:'','XMD-CALLERID':_0x4a8bc2,'XMD-CALLERID-PREVIEW':_0x30472f?util[_0xe253('0x12')](_0xe253('0x13'),_0x30472f[_0xe253('0x1a')],_0x30472f[_0xe253('0x1b')]):_0x4a8bc2,'XMD-DIALID':_0x30e295,'XMD-CONTACTID':_0x40e688[_0xe253('0x1c')],'XMD-CDRTYPE':_0xe253('0x1d'),'CALLERID(all)':_0x4a8bc2,'XMD-VOICEQUEUEID':_0x40e688[_0xe253('0x1e')],'XMD-DIALCHANNEL':_0x174540,'XMD-DIALTIMEOUT':_0x4ed500[_0xe253('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0xe253('0x12')](_0xe253('0x20'),_0x4ed500[_0xe253('0x21')]?'g':'',_[_0xe253('0x11')](_0x4ed500[_0xe253('0x22')])?'':_0xe253('0x23')),'XMD-DIALURL':_0x4ed500[_0xe253('0x24')]||'','XMD-AGI':_0x4ed500['dialQueueProject']?util[_0xe253('0x12')](_0xe253('0x25'),ipAgi,_0x4ed500['dialQueueProject']):_0xe253('0x26'),'XMD-AGIAFTER':_0x4ed500[_0xe253('0x21')]?util[_0xe253('0x12')](_0xe253('0x25'),ipAgi,_0x4ed500['dialQueueProject2']):'NONE','XMD-ORIGINATECALLERIDNUM':_0x30472f?_0x30472f[_0xe253('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x30472f?_0x30472f['originatecalleridname']:'','XMD-DESTINATION':_0xe253('0x28')};if(!_['isEmpty'](_0x4ed500[_0xe253('0x22')])){_0x2f91ab[util[_0xe253('0x12')]('%s',_0xe253('0x29'))]=_0x4ed500[_0xe253('0x22')];_0x2f91ab[util[_0xe253('0x12')]('%s',_0xe253('0x2a'))]=_0x30e295;}if(_0x40e688&&_0x40e688['Contact']){for(var _0xa15fa4 in _0x40e688[_0xe253('0x2b')]){if(_0x40e688[_0xe253('0x2b')][_0xe253('0x2c')](_0xa15fa4)){if(!_['isNil'](_0x40e688[_0xe253('0x2b')][_0xa15fa4])&&_0xa15fa4!=='id'&&_0xa15fa4!==_0xe253('0x2d')&&_0xa15fa4!==_0xe253('0x2e')&&_0xa15fa4!==_0xe253('0x2f')){_0x2f91ab[util['format'](_0xe253('0x30'),_0xe253('0x31'),_[_0xe253('0x32')](_0xa15fa4))]=_0x40e688[_0xe253('0x2b')][_0xa15fa4];}}}}return _0x2f91ab;};exports[_0xe253('0x33')]=function(_0xda192f){var _0x51aa37={};for(var _0x17d8f6 in _0xda192f){if(_0xda192f['hasOwnProperty'](_0x17d8f6)){_0x51aa37[util['format']('%s',_[_0xe253('0x34')](_0x17d8f6))]=_0xda192f[_0x17d8f6];}}return{'variables':_0x51aa37};};exports['updateOriginated']=function(_0x47bdfb,_0x224816){if(!_['isNil'](_0x47bdfb)){if(_0x47bdfb[_0xe253('0x2c')](_0xe253('0x35'))){if(_0x47bdfb[_0xe253('0x35')]>0x0){_0x47bdfb['originated']-=0x1;}else{logger[_0xe253('0xa')](_0xe253('0x36'),_0x224816);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x224816);}};exports[_0xe253('0x37')]=function(_0x2cb4b4){var _0x2b4309=moment()['format'](_0xe253('0x38'));_0x2cb4b4['state']=0xd;_0x2cb4b4['statedesc']=_0xe253('0x39');_0x2cb4b4['starttime']=_0x2b4309;_0x2cb4b4[_0xe253('0x3a')]=_0x2b4309;_0x2cb4b4['endtime']=_0x2b4309;};exports[_0xe253('0x3b')]=function(_0x2896cd,_0x10e0d3,_0x25f688){var _0xb4ecdb=moment()['format'](_0xe253('0x38'));_0x2896cd['state']=_0x10e0d3;_0x2896cd['statedesc']=_0x25f688;_0x2896cd[_0xe253('0x3a')]=_0xb4ecdb;_0x2896cd[_0xe253('0x3c')]=getSeconds(_0x2896cd['responsetime'],_0x2896cd[_0xe253('0x3d')]);};exports['logLookAgent']=function(_0x2c52d5,_0x513ae0,_0x250f87){_0x2c52d5[_0xe253('0x3e')]=_0x513ae0;_0x2c52d5[_0xe253('0x3f')]=_0x250f87;};exports['logCustomer']=function(_0x542a13,_0x59fe97,_0x2ec675){var _0x159908=moment()[_0xe253('0x12')](_0xe253('0x38'));_0x542a13[_0xe253('0x40')]=_0x59fe97;_0x542a13[_0xe253('0x41')]=_0x2ec675;_0x542a13[_0xe253('0x3a')]=_0x542a13['responsetime']?_0x542a13[_0xe253('0x3a')]:_0x159908;_0x542a13[_0xe253('0x42')]=_0x542a13['endtime']?_0x542a13['endtime']:_0x159908;_0x542a13[_0xe253('0x3c')]=getSeconds(_0x542a13[_0xe253('0x3a')]||0x0,_0x542a13['starttime']||0x0);_0x542a13['talktime']=_0x542a13[_0xe253('0x43')]?getSeconds(_0x542a13[_0xe253('0x42')],_0x542a13[_0xe253('0x43')]):0x0;};exports['isFailure']=function(_0xd7a5c5){return _0xd7a5c5===_0xe253('0x44');};exports['variablesAction']=function(_0x531f24,_0x54f38e,_0x55e806,_0x283892,_0x433c4d){var _0x49bfa2=_0x283892?_0xe253('0x45'):_0x531f24[_0xe253('0x1a')];_0x49bfa2=_0x433c4d?'BOOKED':_0x49bfa2;return{'actionid':_0x531f24[_0xe253('0x46')],'action':_0xe253('0x47'),'channel':_0x531f24['channelAgent'],'callerid':util['format'](_0xe253('0x13'),_0x49bfa2,_0x531f24['calleridnum']),'Exten':_0xe253('0x28'),'Context':_0xe253('0x48'),'Priority':'1','variable':_0x55e806,'timeout':(_0x54f38e[_0xe253('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x531f24[_0xe253('0x46')]};};exports[_0xe253('0x4a')]=function(_0x202540){return _0x202540[_0xe253('0x4b')]+_0x202540[_0xe253('0x4c')]+_0x202540[_0xe253('0x4d')]+_0x202540['countagentrejectretry']+_0x202540[_0xe253('0x4e')];};exports['cloneAction']=function(_0x439308){var _0x25390b=_['clone'](_0x439308);_0x25390b['state']=0xf;_0x25390b[_0xe253('0x41')]=_0xe253('0x4f');return _0x25390b;};exports[_0xe253('0x50')]=function(_0x1a503c,_0x392414,_0xeb64a4){var _0x3fa4b3={};_0x3fa4b3[_0x392414]=_0x1a503c[_0x392414];_0x3fa4b3[_0xe253('0x51')]=![];_0x3fa4b3[_0xe253('0x52')]=moment()['add'](_0xeb64a4,_0xe253('0x53'))[_0xe253('0x12')](_0xe253('0x38'));_0x3fa4b3[_0xe253('0x1c')]=_0x1a503c[_0xe253('0x1c')];_0x3fa4b3[_0xe253('0x54')]=_0x1a503c[_0xe253('0x54')];_0x3fa4b3[_0xe253('0x1e')]=_0x1a503c[_0xe253('0x1e')]||undefined;return _0x3fa4b3;};exports['decrementTalkink']=function(_0x574c04,_0x5119fb){if(!_[_0xe253('0x16')](_0x574c04)){if(_0x574c04[_0xe253('0x55')]>0x0){_0x574c04[_0xe253('0x55')]-=0x1;}else{logger['error'](_0x5119fb,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xe253('0xa')](_0x5119fb,_0xe253('0x56'));}};exports['IsNotLoggedIn']=function(_0x51f1f1){if(_0x51f1f1<=0x0){return!![];}return![];};exports['buildObj']=function(_0xc0078,_0x103aec,_0x227ca2){_0xc0078[_0xe253('0x57')]=_0x103aec;_0xc0078['name']=_0xc0078[_0xe253('0x58')];_0xc0078['interface']=_0xc0078[_0xe253('0x59')];_0xc0078[_0xe253('0x5a')]=_0xe253('0x5b');if(_0x227ca2){_0xc0078[_0xe253('0x5c')]=_0x227ca2[_0xe253('0x5c')];}return _0xc0078;};exports[_0xe253('0x5d')]=function(_0x4b8d6f){var _0x3743c7={};_0x3743c7[_0xe253('0x58')]=_0x4b8d6f[_0xe253('0x58')];_0x3743c7[_0xe253('0x5e')]=_0x4b8d6f[_0xe253('0x59')];_0x3743c7[_0xe253('0x46')]=_0x4b8d6f[_0xe253('0x46')];return _0x3743c7;};exports[_0xe253('0x5f')]=function(_0x4cc240){var _0x80735c=[];for(var _0x42f216 in _0x4cc240){if(_0x4cc240[_0xe253('0x2c')](_0x42f216)){if(!_['isNil'](_0x4cc240[_0x42f216])&&_0x4cc240[_0x42f216][_0xe253('0x40')]==='not_inuse'&&_0x4cc240[_0x42f216][_0xe253('0x60')]==='reachable'){_0x80735c[_0xe253('0x61')](_0x4cc240[_0x42f216]['id']);}}}return _0x80735c;};exports['getDiff']=function(_0x299e18){var _0x4e28aa=moment()[_0xe253('0x7')](0x0);var _0x48c9fc=moment(_0x299e18)[_0xe253('0x7')](0x0);return _0x4e28aa[_0xe253('0x8')](_0x48c9fc,_0xe253('0x62'));};exports[_0xe253('0x63')]=function(_0x1a737c){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1a737c['ContactId'],'ListId':_0x1a737c['ListId'],'VoiceQueueId':_0x1a737c[_0xe253('0x1e')]||undefined,'CampaignId':_0x1a737c['CampaignId']||undefined};};exports[_0xe253('0x64')]=function(_0x56d7d5){if(_0x56d7d5==='uniqueid'||_0x56d7d5===_0xe253('0x65')||_0x56d7d5===_0xe253('0x58')||_0x56d7d5===_0xe253('0x66')||_0x56d7d5==='campaigntype'||_0x56d7d5===_0xe253('0x67')||_0x56d7d5===_0xe253('0x3e')||_0x56d7d5===_0xe253('0x59')||_0x56d7d5===_0xe253('0x1a')||_0x56d7d5===_0xe253('0x51')||_0x56d7d5===_0xe253('0x1b')||_0x56d7d5===_0xe253('0x52')||_0x56d7d5===_0xe253('0x4b')||_0x56d7d5===_0xe253('0x4c')||_0x56d7d5==='countnoanswerretry'||_0x56d7d5===_0xe253('0x68')||_0x56d7d5==='callback'||_0x56d7d5===_0xe253('0x69')||_0x56d7d5==='callbackat'||_0x56d7d5===_0xe253('0x6a')||_0x56d7d5==='ContactId'||_0x56d7d5===_0xe253('0x54')||_0x56d7d5===_0xe253('0x3f')||_0x56d7d5===_0xe253('0x1e')||_0x56d7d5==='sipcallid'||_0x56d7d5===_0xe253('0x6b')||_0x56d7d5===_0xe253('0x6c')||_0x56d7d5==='xmd-phone'||_0x56d7d5===_0xe253('0x6d')||_0x56d7d5==='xmd-dialurl'||_0x56d7d5==='xmd-dialtimeout'||_0x56d7d5===_0xe253('0x6e')||_0x56d7d5===_0xe253('0x6f')||_0x56d7d5===_0xe253('0x70')||_0x56d7d5===_0xe253('0x71')||_0x56d7d5===_0xe253('0x72')||_0x56d7d5===_0xe253('0x73')||_0x56d7d5==='xmd-agiafter'||_0x56d7d5===_0xe253('0x74')||_0x56d7d5==='rtpaudioqos'||_0x56d7d5===_0xe253('0x75')||_0x56d7d5===_0xe253('0x76')||_0x56d7d5==='rtpaudioqosjitterbridged'||_0x56d7d5===_0xe253('0x77')||_0x56d7d5===_0xe253('0x78')||_0x56d7d5===_0xe253('0x79')||_0x56d7d5===_0xe253('0x7a')||_0x56d7d5===_0xe253('0x7b')||_0x56d7d5===_0xe253('0x75')||_0x56d7d5==='rtpaudioqosjitter'||_0x56d7d5===_0xe253('0x7c')||_0x56d7d5===_0xe253('0x77')||_0x56d7d5===_0xe253('0x78')||_0x56d7d5===_0xe253('0x79')||_0x56d7d5===_0xe253('0x7a')||_0x56d7d5==='bridgepeer'||_0x56d7d5==='bridgepvtcallid'||_0x56d7d5===_0xe253('0x40')||_0x56d7d5==='statedesc'){return![];}return!![];};exports[_0xe253('0x7d')]=function(_0x24c8ff,_0x2d6e60){var _0x33bc11,_0x127890,_0x1a164e;if(_0x2d6e60<=0x0){_0x2d6e60=0x1;}_0x33bc11=new RegExp('\x5cw{0,'+_0x2d6e60+'}$');_0x127890=Math['pow'](0xa,_0x2d6e60-0x1);_0x1a164e=Math[_0xe253('0x7e')](0xa,_0x2d6e60)-0x1;return util[_0xe253('0x12')]('%s',_[_0xe253('0x7f')](_0x24c8ff,_0x33bc11,_['random'](_0x127890,_0x1a164e)));};exports['extractCalleridName']=function(_0x50acd5){var _0x1fdc9f=_0x50acd5[_0xe253('0x80')](/"(.*?)"/);return _0x1fdc9f?_0x1fdc9f[0x1]:_0x50acd5;};exports['extractCalleridNumber']=function(_0x4f8ca4){var _0x1ab910=_0x4f8ca4['match'](/<(.*?)>/);return _0x1ab910?_0x1ab910[0x1]:_0x4f8ca4;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 512e7bf..f1d0937 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 _0x0207=['reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queuepause'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0207,0x69));var _0x7020=function(_0x2754c2,_0x10ceb4){_0x2754c2=_0x2754c2-0x0;var _0x4d5454=_0x0207[_0x2754c2];return _0x4d5454;};'use strict';exports[_0x7020('0x0')]={'queue':{'type':_0x7020('0x1'),'required':!![]},'interface':{'type':_0x7020('0x1'),'required':!![]},'membername':{'type':_0x7020('0x1'),'required':!![]},'penalty':{'type':_0x7020('0x2'),'required':![]},'paused':{'type':_0x7020('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x7020('0x1'),'required':!![]},'interface':{'type':_0x7020('0x1'),'required':!![]}};exports[_0x7020('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x7020('0x3')},'reason':{'type':_0x7020('0x1'),'required':![]}};exports[_0x7020('0x5')]={'module':{'type':_0x7020('0x1'),'required':![]}};exports[_0x7020('0x6')]={'uniqueid':{'type':_0x7020('0x1'),'required':!![]}};exports[_0x7020('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x7020('0x1')},'format':{'type':_0x7020('0x1')},'mixmonitorid':{'type':_0x7020('0x1')}};exports[_0x7020('0x8')]={'uniqueid':{'type':_0x7020('0x1'),'required':!![]}};exports[_0x7020('0x9')]={'uniqueid':{'type':_0x7020('0x1'),'required':!![]},'exten':{'type':_0x7020('0x1'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x8221=['boolean','queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number'];(function(_0x22bea1,_0x39476f){var _0x4cc8f9=function(_0x3a6588){while(--_0x3a6588){_0x22bea1['push'](_0x22bea1['shift']());}};_0x4cc8f9(++_0x39476f);}(_0x8221,0x16f));var _0x1822=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x8221[_0x245afe];return _0x4eefde;};'use strict';exports[_0x1822('0x0')]={'queue':{'type':_0x1822('0x1'),'required':!![]},'interface':{'type':_0x1822('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x1822('0x2'),'required':![]},'paused':{'type':_0x1822('0x3'),'required':![]}};exports[_0x1822('0x4')]={'queue':{'type':_0x1822('0x1'),'required':!![]},'interface':{'type':_0x1822('0x1'),'required':!![]}};exports[_0x1822('0x5')]={'interface':{'type':_0x1822('0x1'),'required':!![]},'paused':{'type':_0x1822('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x1822('0x1'),'required':![]}};exports[_0x1822('0x6')]={'uniqueid':{'type':_0x1822('0x1'),'required':!![]}};exports[_0x1822('0x7')]={'uniqueid':{'type':_0x1822('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x1822('0x1')},'mixmonitorid':{'type':_0x1822('0x1')}};exports[_0x1822('0x8')]={'uniqueid':{'type':_0x1822('0x1'),'required':!![]}};exports[_0x1822('0x9')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x1822('0x1'),'required':!![]},'context':{'type':_0x1822('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 3305788..c05f98b 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 _0xdb2b=['sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','initTelephones','isUndefined','name','initTrunks','initVoiceQueues','initTriggers','triggers','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','queue','queuecallerexit','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','duration','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions','merge','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','interface','total','sumHoldTime','sumDuration'];(function(_0x3116d6,_0x2d574f){var _0x18729d=function(_0x1945a0){while(--_0x1945a0){_0x3116d6['push'](_0x3116d6['shift']());}};_0x18729d(++_0x2d574f);}(_0xdb2b,0x187));var _0xbdb2=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xdb2b[_0x19babd];return _0x314eaf;};'use strict';var BPromise=require(_0xbdb2('0x0'));var util=require(_0xbdb2('0x1'));var _=require(_0xbdb2('0x2'));var moment=require(_0xbdb2('0x3'));var Agent=require(_0xbdb2('0x4'));var Telephone=require(_0xbdb2('0x5'));var Trunk=require(_0xbdb2('0x6'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xbdb2('0x7'));var Template=require('../model/template');var Campaign=require(_0xbdb2('0x8'));var VoiceExtension=require(_0xbdb2('0x9'));var ZendeskAccount=require(_0xbdb2('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbdb2('0xb'));var SugarcrmAccount=require(_0xbdb2('0xc'));var ZohoAccount=require(_0xbdb2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xbdb2('0xe'));var ServicenowAccount=require(_0xbdb2('0xf'));var Dynamics365Account=require(_0xbdb2('0x10'));var FreshsalesAccount=require(_0xbdb2('0x11'));var FaxAccount=require(_0xbdb2('0x12'));var Realtime=function(){this[_0xbdb2('0x13')]={};this[_0xbdb2('0x14')]={};this[_0xbdb2('0x15')]={};this[_0xbdb2('0x16')]={};this['triggers']={};this[_0xbdb2('0x17')]={};this[_0xbdb2('0x18')]={};this[_0xbdb2('0x19')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xbdb2('0x1a')]={};this[_0xbdb2('0x1b')]={};this[_0xbdb2('0x1c')]={};this[_0xbdb2('0x1d')]={};this['settings']={};this[_0xbdb2('0x1e')]={};this[_0xbdb2('0x1f')]={};this[_0xbdb2('0x20')]={};this[_0xbdb2('0x21')]={};this[_0xbdb2('0x22')]={};this[_0xbdb2('0x23')]={};this[_0xbdb2('0x24')]={};this['servicenowAccounts']={};this[_0xbdb2('0x25')]={};this[_0xbdb2('0x26')]={};this[_0xbdb2('0x27')]={};};function freeIsNotKey(_0x4e9e58,_0x1372db,_0x5bbe9f){var _0x567cfe=_[_0xbdb2('0x28')](_0x4e9e58,function(_0x3acb54,_0x49aea0){return _0x3acb54[_0x5bbe9f];});for(var _0xe2bff2 in _0x1372db){if(_0x1372db[_0xbdb2('0x29')](_0xe2bff2)){if(!_0x567cfe[_0xe2bff2]){delete _0x1372db[_0xe2bff2];}}}}function freeIsNotKeySip(_0x1fe518,_0x165e4e){var _0x4a1f36=_['mapKeys'](_0x1fe518,function(_0x2a3c31,_0x43b2f0){return util[_0xbdb2('0x2a')](_0xbdb2('0x2b'),_0x2a3c31['name']);});for(var _0x1ebc0e in _0x165e4e){if(_0x165e4e[_0xbdb2('0x29')](_0x1ebc0e)){if(!_0x4a1f36[_0x1ebc0e]){delete _0x165e4e[_0x1ebc0e];}}}}function freeIsNotKeyAgent(_0x36608b,_0xaef88d){var _0x40fb3b=_[_0xbdb2('0x28')](_0x36608b,function(_0x425460,_0x14feed){var _0x458ab0=_[_0xbdb2('0x2c')](_0x425460[_0xbdb2('0x2d')])?util['format']('SIP/%s',_0x425460['name']):_0x425460[_0xbdb2('0x2d')];return _0x458ab0;});for(var _0x57c063 in _0xaef88d){if(_0xaef88d[_0xbdb2('0x29')](_0x57c063)){if(!_0x40fb3b[_0x57c063]){delete _0xaef88d[_0x57c063];}}}}function clearVoiceCallReports(_0x5e60be){_0x5e60be[_0xbdb2('0x2e')]=0x0;_0x5e60be['answered']=0x0;_0x5e60be[_0xbdb2('0x2f')]=0x0;_0x5e60be[_0xbdb2('0x30')]=0x0;_0x5e60be[_0xbdb2('0x31')]=0x0;}function clearCampaigns(_0x36c2d3){if(!_[_0xbdb2('0x32')](_0x36c2d3)){for(var _0x1a6353 in _0x36c2d3){if(_0x36c2d3[_0xbdb2('0x29')](_0x1a6353)){_0x36c2d3[_0x1a6353][_0xbdb2('0x33')]=0x0;_0x36c2d3[_0x1a6353][_0xbdb2('0x34')]=0x0;}}}}function clearVoiceQueues(_0x447ffb){if(!_[_0xbdb2('0x32')](_0x447ffb)){for(var _0x4b98cb in _0x447ffb){if(_0x447ffb[_0xbdb2('0x29')](_0x4b98cb)){_0x447ffb[_0x4b98cb][_0xbdb2('0x2e')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x35')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x36')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x37')]=0x0;_0x447ffb[_0x4b98cb]['sumHoldTime']=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x30')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x31')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x38')]=0x0;_0x447ffb[_0x4b98cb]['outboundNoAnswerCallsDay']=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x39')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x3a')]=0x0;_0x447ffb[_0x4b98cb]['outboundNoSuchCallsDay']=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x3b')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x3c')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x3d')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x3e')]=0x0;_0x447ffb[_0x4b98cb]['outboundOriginateFailureCallsDay']=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x3f')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x40')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x38')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x41')]=0x0;_0x447ffb[_0x4b98cb][_0xbdb2('0x42')]=!![];}}}}Realtime[_0xbdb2('0x43')][_0xbdb2('0x44')]=function(_0x59816d,_0x2559f2){for(var _0x1049ab in _0x2559f2){if(_0x59816d[_0xbdb2('0x29')](_0x1049ab)){_0x59816d[_0x1049ab]=_0x2559f2[_0x1049ab];}}};Realtime[_0xbdb2('0x43')][_0xbdb2('0x45')]=function(){var _0x3092c2=this;return function(_0x33abdb){if(_0x33abdb){freeIsNotKeyAgent(_0x33abdb,_0x3092c2[_0xbdb2('0x13')]);for(var _0x2058bf=0x0,_0x5508c5={},_0x5d10f8={};_0x2058bf<_0x33abdb[_0xbdb2('0x46')];_0x2058bf+=0x1){_0x5508c5=_0x33abdb[_0x2058bf];var _0xbeb017=_[_0xbdb2('0x2c')](_0x5508c5['interface'])?util[_0xbdb2('0x2a')](_0xbdb2('0x2b'),_0x5508c5['name']):_0x5508c5[_0xbdb2('0x2d')];if(_['isUndefined'](_0x3092c2[_0xbdb2('0x13')][_0xbeb017])){_0x3092c2['agents'][_0xbeb017]=new Agent(_0x5508c5);}else{_0x3092c2['mergeFromDatabase'](_0x3092c2[_0xbdb2('0x13')][_0xbeb017],_0x5508c5);}}}return _0x3092c2[_0xbdb2('0x13')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x47')]=function(){var _0x4ae560=this;return function(_0x28314d){if(_0x28314d){freeIsNotKeySip(_0x28314d,_0x4ae560[_0xbdb2('0x14')]);for(var _0x362474=0x0,_0x5ce8d8={},_0x452fdf={};_0x362474<_0x28314d['length'];_0x362474+=0x1){_0x5ce8d8=_0x28314d[_0x362474];if(_[_0xbdb2('0x48')](_0x4ae560[_0xbdb2('0x14')][util['format'](_0xbdb2('0x2b'),_0x5ce8d8['name'])])){_0x4ae560[_0xbdb2('0x14')][util[_0xbdb2('0x2a')](_0xbdb2('0x2b'),_0x5ce8d8[_0xbdb2('0x49')])]=new Telephone(_0x5ce8d8);}else{_0x4ae560[_0xbdb2('0x44')](_0x4ae560[_0xbdb2('0x14')][util[_0xbdb2('0x2a')](_0xbdb2('0x2b'),_0x5ce8d8['name'])],_0x5ce8d8);}}}return _0x4ae560[_0xbdb2('0x14')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x4a')]=function(){var _0x554936=this;return function(_0x1633a0){if(_0x1633a0){freeIsNotKeySip(_0x1633a0,_0x554936[_0xbdb2('0x15')]);for(var _0x36a59f=0x0,_0x59af1b={},_0x482afa={};_0x36a59f<_0x1633a0['length'];_0x36a59f+=0x1){_0x59af1b=_0x1633a0[_0x36a59f];if(_[_0xbdb2('0x48')](_0x554936[_0xbdb2('0x15')][util[_0xbdb2('0x2a')](_0xbdb2('0x2b'),_0x59af1b['name'])])){_0x554936['trunks'][util[_0xbdb2('0x2a')]('SIP/%s',_0x59af1b[_0xbdb2('0x49')])]=new Trunk(_0x59af1b);}else{_0x554936[_0xbdb2('0x44')](_0x554936['trunks'][util[_0xbdb2('0x2a')](_0xbdb2('0x2b'),_0x59af1b['name'])],_0x59af1b);}}}return _0x554936[_0xbdb2('0x15')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x4b')]=function(){var _0x54a628=this;return function(_0x1b3ca3){if(_0x1b3ca3){freeIsNotKey(_0x1b3ca3,_0x54a628['voiceQueues'],'name');for(var _0x32780d=0x0,_0xb2ec35={},_0x1f9bd8={};_0x32780d<_0x1b3ca3[_0xbdb2('0x46')];_0x32780d+=0x1){_0xb2ec35=_0x1b3ca3[_0x32780d];if(_[_0xbdb2('0x48')](_0x54a628['voiceQueues'][_0xb2ec35[_0xbdb2('0x49')]])){_0x54a628[_0xbdb2('0x16')][_0xb2ec35[_0xbdb2('0x49')]]=new VoiceQueue(_0xb2ec35);}else{_0x54a628[_0xbdb2('0x44')](_0x54a628[_0xbdb2('0x16')][_0xb2ec35[_0xbdb2('0x49')]],_0xb2ec35);}}}return _0x54a628['voiceQueues'];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x4c')]=function(){var _0x825e0d=this;return function(_0x5ada13){if(_0x5ada13){freeIsNotKey(_0x5ada13,_0x825e0d[_0xbdb2('0x4d')],'id');for(var _0x33dafa=0x0,_0x44d203={},_0x1a2bde={};_0x33dafa<_0x5ada13[_0xbdb2('0x46')];_0x33dafa+=0x1){_0x44d203=_0x5ada13[_0x33dafa];if(_[_0xbdb2('0x48')](_0x825e0d[_0xbdb2('0x4d')][_0x44d203['id']])){_0x825e0d[_0xbdb2('0x4d')][_0x44d203['id']]=new Trigger(_0x44d203);}else{_0x825e0d[_0xbdb2('0x44')](_0x825e0d[_0xbdb2('0x4d')][_0x44d203['id']],_0x44d203);}}}return _0x825e0d[_0xbdb2('0x4d')];};};Realtime[_0xbdb2('0x43')]['initTemplates']=function(){var _0xb5bf40=this;return function(_0xf9d652){if(_0xf9d652){freeIsNotKey(_0xf9d652,_0xb5bf40[_0xbdb2('0x18')],'id');for(var _0x2068d5=0x0,_0xc45997={},_0x1b0f52={};_0x2068d5<_0xf9d652[_0xbdb2('0x46')];_0x2068d5+=0x1){_0xc45997=_0xf9d652[_0x2068d5];if(_['isUndefined'](_0xb5bf40[_0xbdb2('0x18')][_0xc45997['id']])){_0xb5bf40[_0xbdb2('0x18')][_0xc45997['id']]=new Template(_0xc45997);}else{_0xb5bf40['mergeFromDatabase'](_0xb5bf40['templates'][_0xc45997['id']],_0xc45997);}}}return _0xb5bf40['templates'];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x4e')]=function(){var _0x43bab4=this;return function(_0x3b8600){if(_0x3b8600){freeIsNotKey(_0x3b8600,_0x43bab4[_0xbdb2('0x1e')],'id');for(var _0x461c11=0x0,_0x2b82ea={},_0x229cb9={};_0x461c11<_0x3b8600[_0xbdb2('0x46')];_0x461c11+=0x1){_0x2b82ea=_0x3b8600[_0x461c11];if(_[_0xbdb2('0x48')](_0x43bab4[_0xbdb2('0x1e')][_0x2b82ea['id']])){_0x43bab4['zendeskAccounts'][_0x2b82ea['id']]=new ZendeskAccount(_0x2b82ea);}else{_0x43bab4[_0xbdb2('0x44')](_0x43bab4[_0xbdb2('0x1e')][_0x2b82ea['id']],_0x2b82ea);}}}return _0x43bab4[_0xbdb2('0x1e')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x4f')]=function(){var _0xb9960=this;return function(_0x4e2429){if(_0x4e2429){freeIsNotKey(_0x4e2429,_0xb9960['salesforceAccounts'],'id');for(var _0x2196f9=0x0,_0x4ae32d={},_0x820287={};_0x2196f9<_0x4e2429[_0xbdb2('0x46')];_0x2196f9+=0x1){_0x4ae32d=_0x4e2429[_0x2196f9];if(_['isUndefined'](_0xb9960[_0xbdb2('0x1f')][_0x4ae32d['id']])){_0xb9960['salesforceAccounts'][_0x4ae32d['id']]=new SalesforceAccount(_0x4ae32d);}else{_0xb9960[_0xbdb2('0x44')](_0xb9960[_0xbdb2('0x1f')][_0x4ae32d['id']],_0x4ae32d);}}}return _0xb9960[_0xbdb2('0x1f')];};};Realtime['prototype'][_0xbdb2('0x50')]=function(){var _0x175896=this;return function(_0x2afaae){if(_0x2afaae){freeIsNotKey(_0x2afaae,_0x175896[_0xbdb2('0x21')],'id');for(var _0x20e574=0x0,_0x4df30b={},_0x539047={};_0x20e574<_0x2afaae['length'];_0x20e574+=0x1){_0x4df30b=_0x2afaae[_0x20e574];if(_['isUndefined'](_0x175896[_0xbdb2('0x21')][_0x4df30b['id']])){_0x175896[_0xbdb2('0x21')][_0x4df30b['id']]=new FreshdeskAccount(_0x4df30b);}else{_0x175896[_0xbdb2('0x44')](_0x175896['freshdeskAccounts'][_0x4df30b['id']],_0x4df30b);}}}return _0x175896[_0xbdb2('0x21')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x51')]=function(){var _0x206b39=this;return function(_0x445710){if(_0x445710){freeIsNotKey(_0x445710,_0x206b39[_0xbdb2('0x22')],'id');for(var _0x177926=0x0,_0x34888c={},_0x3dfaa7={};_0x177926<_0x445710['length'];_0x177926+=0x1){_0x34888c=_0x445710[_0x177926];if(_[_0xbdb2('0x48')](_0x206b39[_0xbdb2('0x22')][_0x34888c['id']])){_0x206b39['zohoAccounts'][_0x34888c['id']]=new ZohoAccount(_0x34888c);}else{_0x206b39[_0xbdb2('0x44')](_0x206b39['zohoAccounts'][_0x34888c['id']],_0x34888c);}}}return _0x206b39[_0xbdb2('0x22')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x52')]=function(){var _0x5a9d70=this;return function(_0x4559af){if(_0x4559af){freeIsNotKey(_0x4559af,_0x5a9d70['deskAccounts'],'id');for(var _0x5d5ab8=0x0,_0x2ef32f={},_0x475327={};_0x5d5ab8<_0x4559af[_0xbdb2('0x46')];_0x5d5ab8+=0x1){_0x2ef32f=_0x4559af[_0x5d5ab8];if(_[_0xbdb2('0x48')](_0x5a9d70['deskAccounts'][_0x2ef32f['id']])){_0x5a9d70[_0xbdb2('0x23')][_0x2ef32f['id']]=new DeskAccount(_0x2ef32f);}else{_0x5a9d70[_0xbdb2('0x44')](_0x5a9d70[_0xbdb2('0x23')][_0x2ef32f['id']],_0x2ef32f);}}}return _0x5a9d70['deskAccounts'];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x53')]=function(){var _0x211014=this;return function(_0x485ca7){if(_0x485ca7){freeIsNotKey(_0x485ca7,_0x211014['sugarcrmAccounts'],'id');for(var _0x7fd117=0x0,_0x54fffd={},_0x1f4d9a={};_0x7fd117<_0x485ca7[_0xbdb2('0x46')];_0x7fd117+=0x1){_0x54fffd=_0x485ca7[_0x7fd117];if(_[_0xbdb2('0x48')](_0x211014['sugarcrmAccounts'][_0x54fffd['id']])){_0x211014['sugarcrmAccounts'][_0x54fffd['id']]=new SugarcrmAccount(_0x54fffd);}else{_0x211014[_0xbdb2('0x44')](_0x211014['sugarcrmAccounts'][_0x54fffd['id']],_0x54fffd);}}}return _0x211014[_0xbdb2('0x20')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x54')]=function(){var _0x5a616a=this;return function(_0x1bb51e){if(_0x1bb51e){freeIsNotKey(_0x1bb51e,_0x5a616a['vtigerAccounts'],'id');for(var _0x907727=0x0,_0x33bc6b={},_0x249e24={};_0x907727<_0x1bb51e[_0xbdb2('0x46')];_0x907727+=0x1){_0x33bc6b=_0x1bb51e[_0x907727];if(_[_0xbdb2('0x48')](_0x5a616a[_0xbdb2('0x24')][_0x33bc6b['id']])){_0x5a616a[_0xbdb2('0x24')][_0x33bc6b['id']]=new VtigerAccount(_0x33bc6b);}else{_0x5a616a[_0xbdb2('0x44')](_0x5a616a['vtigerAccounts'][_0x33bc6b['id']],_0x33bc6b);}}}return _0x5a616a[_0xbdb2('0x24')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x55')]=function(){var _0x4ad9e2=this;return function(_0x475ebb){if(_0x475ebb){freeIsNotKey(_0x475ebb,_0x4ad9e2[_0xbdb2('0x56')],'id');for(var _0x4c68c8=0x0,_0x14d309={},_0x1986b8={};_0x4c68c8<_0x475ebb[_0xbdb2('0x46')];_0x4c68c8+=0x1){_0x14d309=_0x475ebb[_0x4c68c8];if(_[_0xbdb2('0x48')](_0x4ad9e2['servicenowAccounts'][_0x14d309['id']])){_0x4ad9e2[_0xbdb2('0x56')][_0x14d309['id']]=new ServicenowAccount(_0x14d309);}else{_0x4ad9e2[_0xbdb2('0x44')](_0x4ad9e2['servicenowAccounts'][_0x14d309['id']],_0x14d309);}}}return _0x4ad9e2[_0xbdb2('0x56')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x57')]=function(){var _0x27e660=this;return function(_0x285f99){if(_0x285f99){freeIsNotKey(_0x285f99,_0x27e660[_0xbdb2('0x25')],'id');for(var _0xc41632=0x0,_0x1176a1={},_0x1a8202={};_0xc41632<_0x285f99[_0xbdb2('0x46')];_0xc41632+=0x1){_0x1176a1=_0x285f99[_0xc41632];if(_[_0xbdb2('0x48')](_0x27e660['dynamics365Accounts'][_0x1176a1['id']])){_0x27e660[_0xbdb2('0x25')][_0x1176a1['id']]=new Dynamics365Account(_0x1176a1);}else{_0x27e660[_0xbdb2('0x44')](_0x27e660[_0xbdb2('0x25')][_0x1176a1['id']],_0x1176a1);}}}return _0x27e660['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x22e667=this;return function(_0x1cd30d){if(_0x1cd30d){freeIsNotKey(_0x1cd30d,_0x22e667[_0xbdb2('0x26')],'id');for(var _0x5d0448=0x0,_0x362265={},_0x240b0c={};_0x5d0448<_0x1cd30d[_0xbdb2('0x46')];_0x5d0448+=0x1){_0x362265=_0x1cd30d[_0x5d0448];if(_[_0xbdb2('0x48')](_0x22e667[_0xbdb2('0x26')][_0x362265['id']])){_0x22e667[_0xbdb2('0x26')][_0x362265['id']]=new FreshsalesAccount(_0x362265);}else{_0x22e667[_0xbdb2('0x44')](_0x22e667['freshsalesAccounts'][_0x362265['id']],_0x362265);}}}return _0x22e667[_0xbdb2('0x26')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x58')]=function(){var _0x18a9d4=this;return function(_0x274fb6){for(var _0x383dc9=0x0;_0x383dc9<_0x274fb6[_0xbdb2('0x46')];_0x383dc9+=0x1){_['merge'](_0x18a9d4[_0xbdb2('0x16')][_0x274fb6[_0x383dc9][_0xbdb2('0x49')]],_0x274fb6[_0x383dc9]);}return _0x18a9d4[_0xbdb2('0x16')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x59')]=function(){var _0x7bceef=this;return function(_0x13ddb0){clearVoiceQueues(_0x7bceef[_0xbdb2('0x16')]);if(_0x13ddb0){_0x13ddb0=_['groupBy'](_0x13ddb0,'uniqueid');for(var _0x3e0e0d in _0x13ddb0){if(_0x13ddb0[_0xbdb2('0x29')](_0x3e0e0d)){var _0x49a968={};for(var _0x4327e2=0x0;_0x4327e2<_0x13ddb0[_0x3e0e0d]['length'];_0x4327e2+=0x1){var _0x13c539=_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x5a')];if(_0x7bceef[_0xbdb2('0x16')][_0x13c539]){if(_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x5b')]){_0x7bceef[_0xbdb2('0x16')][_0x13c539]['unmanaged']+=0x1;}if(_0x13ddb0[_0x3e0e0d][_0x4327e2]['queuecallerabandon']){_0x7bceef[_0xbdb2('0x16')][_0x13c539][_0xbdb2('0x37')]+=0x1;}_0x7bceef[_0xbdb2('0x16')][_0x13c539][_0xbdb2('0x2f')]+=moment(_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x5c')])['diff'](moment(_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x5d')]),_0xbdb2('0x5e'))||0x0;if(_0x4327e2===_0x13ddb0[_0x3e0e0d][_0xbdb2('0x46')]-0x1){_0x7bceef[_0xbdb2('0x16')][_0x13c539][_0xbdb2('0x30')]+=moment(_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x5f')]||_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x60')]||_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x61')])[_0xbdb2('0x62')](moment(_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x5d')]),_0xbdb2('0x5e'))||0x0;_0x7bceef['voiceQueues'][_0x13c539]['total']+=0x1;if(_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x63')]){_0x7bceef[_0xbdb2('0x16')][_0x13c539][_0xbdb2('0x35')]+=0x1;_0x7bceef['voiceQueues'][_0x13c539][_0xbdb2('0x31')]+=moment(_0x13ddb0[_0x3e0e0d][_0x4327e2]['queuecallercompleteAt'])[_0xbdb2('0x62')](moment(_0x13ddb0[_0x3e0e0d][_0x4327e2][_0xbdb2('0x5c')]),_0xbdb2('0x5e'))||0x0;}}else{_0x7bceef[_0xbdb2('0x16')][_0x13c539][_0xbdb2('0x30')]+=_0x7bceef[_0xbdb2('0x16')][_0x13c539][_0xbdb2('0x2f')]||0x0;}}}}}}return _0x7bceef[_0xbdb2('0x16')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x64')]=function(){var _0x30bbd6=this;return function(_0x5c85f8){clearVoiceCallReports(_0x30bbd6[_0xbdb2('0x19')]);if(_0x5c85f8){for(var _0x6e5290=0x0;_0x6e5290<_0x5c85f8[_0xbdb2('0x46')];_0x6e5290+=0x1){_0x30bbd6[_0xbdb2('0x19')][_0xbdb2('0x2e')]+=0x1;_0x30bbd6['outbound'][_0xbdb2('0x30')]+=_0x5c85f8[_0x6e5290]['duration'];if(_0x5c85f8[_0x6e5290]['disposition']==='ANSWERED'){_0x30bbd6[_0xbdb2('0x19')][_0xbdb2('0x35')]+=0x1;_0x30bbd6[_0xbdb2('0x19')]['sumHoldTime']+=_0x5c85f8[_0x6e5290][_0xbdb2('0x65')]-_0x5c85f8[_0x6e5290][_0xbdb2('0x66')]||0x0;_0x30bbd6[_0xbdb2('0x19')]['sumBillable']+=_0x5c85f8[_0x6e5290][_0xbdb2('0x66')];}}}return _0x30bbd6[_0xbdb2('0x19')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x67')]=function(){var _0x431e6d=this;return function(_0x12e2fa){if(_0x12e2fa){freeIsNotKey(_0x12e2fa,_0x431e6d[_0xbdb2('0x17')],_0xbdb2('0x49'));for(var _0x5eeeb4=0x0,_0x37d8f5={};_0x5eeeb4<_0x12e2fa['length'];_0x5eeeb4+=0x1){_0x37d8f5=_0x12e2fa[_0x5eeeb4];if(_[_0xbdb2('0x48')](_0x431e6d[_0xbdb2('0x17')][_0x37d8f5['name']])){_0x431e6d[_0xbdb2('0x17')][_0x37d8f5['name']]=new Campaign(_0x37d8f5);}else{_0x431e6d[_0xbdb2('0x44')](_0x431e6d[_0xbdb2('0x17')][_0x37d8f5[_0xbdb2('0x49')]],_0x37d8f5);_0x431e6d['campaigns'][_0x37d8f5['name']][_0xbdb2('0x68')]=_0x37d8f5['SquareProject']?_0x37d8f5[_0xbdb2('0x69')][_0xbdb2('0x49')]:undefined;}}}return _0x431e6d[_0xbdb2('0x17')];};};Realtime[_0xbdb2('0x43')][_0xbdb2('0x6a')]=function(){var _0x4f7a91=this;return function(_0x1fc39f){if(_0x1fc39f){freeIsNotKey(_0x1fc39f,_0x4f7a91[_0xbdb2('0x6b')],'id');for(var _0x3fe44e=0x0,_0x326872={};_0x3fe44e<_0x1fc39f['length'];_0x3fe44e+=0x1){_0x326872=_0x1fc39f[_0x3fe44e];if(_['isUndefined'](_0x4f7a91[_0xbdb2('0x6b')][_0x326872['id']])){_0x4f7a91[_0xbdb2('0x6b')][_0x326872['id']]=new VoiceExtension(_0x326872);}else{_0x4f7a91[_0xbdb2('0x44')](_0x4f7a91[_0xbdb2('0x6b')][_0x326872['id']],_0x326872);}}}return _0x4f7a91[_0xbdb2('0x6b')];};};Realtime[_0xbdb2('0x43')]['initCampaignHopperHistory']=function(){var _0x18774e=this;return function(_0x5cf457){clearCampaigns(_0x18774e['campaigns']);for(var _0x24c4b8=0x0;_0x24c4b8<_0x5cf457[_0xbdb2('0x46')];_0x24c4b8+=0x1){_[_0xbdb2('0x6c')](_0x18774e[_0xbdb2('0x17')][_0x5cf457[_0x24c4b8][_0xbdb2('0x49')]],_0x5cf457[_0x24c4b8]);}return _0x18774e[_0xbdb2('0x17')];};};Realtime[_0xbdb2('0x43')]['initFaxAccounts']=function(){var _0x36d5f3=this;return function(_0xd46b1f){if(_0xd46b1f){freeIsNotKey(_0xd46b1f,_0x36d5f3[_0xbdb2('0x27')],'id');for(var _0x1b2214=0x0,_0x4bbba9={},_0x237fb9={};_0x1b2214<_0xd46b1f[_0xbdb2('0x46')];_0x1b2214+=0x1){_0x4bbba9=_0xd46b1f[_0x1b2214];if(_[_0xbdb2('0x48')](_0x36d5f3[_0xbdb2('0x27')][_0x4bbba9['id']])){_0x36d5f3[_0xbdb2('0x27')][_0x4bbba9['id']]=new FaxAccount(_0x4bbba9);}else{_0x36d5f3['mergeFromDatabase'](_0x36d5f3[_0xbdb2('0x27')][_0x4bbba9['id']],_0x4bbba9);}}}return _0x36d5f3[_0xbdb2('0x27')];};};module[_0xbdb2('0x6d')]=Realtime; \ No newline at end of file +var _0x6d44=['initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','merge','groupBy','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','seconds','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','outbound','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','format','name','hasOwnProperty','isNil','interface','total','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','SIP/%s','isUndefined','initTelephones','length','initTrunks','trunks','initVoiceQueues','templates','initZendeskAccounts'];(function(_0x5962ad,_0x3074bf){var _0x13e49e=function(_0xfa9e4b){while(--_0xfa9e4b){_0x5962ad['push'](_0x5962ad['shift']());}};_0x13e49e(++_0x3074bf);}(_0x6d44,0xfc));var _0x46d4=function(_0xe86041,_0x2fbd7b){_0xe86041=_0xe86041-0x0;var _0x1230a9=_0x6d44[_0xe86041];return _0x1230a9;};'use strict';var BPromise=require(_0x46d4('0x0'));var util=require(_0x46d4('0x1'));var _=require(_0x46d4('0x2'));var moment=require('moment');var Agent=require(_0x46d4('0x3'));var Telephone=require(_0x46d4('0x4'));var Trunk=require(_0x46d4('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x46d4('0x6'));var Template=require('../model/template');var Campaign=require(_0x46d4('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x46d4('0x8'));var SalesforceAccount=require(_0x46d4('0x9'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x46d4('0xa'));var ZohoAccount=require(_0x46d4('0xb'));var DeskAccount=require(_0x46d4('0xc'));var VtigerAccount=require(_0x46d4('0xd'));var ServicenowAccount=require(_0x46d4('0xe'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x46d4('0xf'));var FaxAccount=require(_0x46d4('0x10'));var Realtime=function(){this[_0x46d4('0x11')]={};this[_0x46d4('0x12')]={};this['trunks']={};this[_0x46d4('0x13')]={};this[_0x46d4('0x14')]={};this['campaigns']={};this['templates']={};this[_0x46d4('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this['channels']={};this[_0x46d4('0x16')]={};this[_0x46d4('0x17')]={};this['timers']={};this[_0x46d4('0x18')]={};this[_0x46d4('0x19')]={};this[_0x46d4('0x1a')]={};this[_0x46d4('0x1b')]={};this[_0x46d4('0x1c')]={};this[_0x46d4('0x1d')]={};this[_0x46d4('0x1e')]={};this['vtigerAccounts']={};this[_0x46d4('0x1f')]={};this[_0x46d4('0x20')]={};this[_0x46d4('0x21')]={};this[_0x46d4('0x22')]={};};function freeIsNotKey(_0x1bebbf,_0x1d7bed,_0x2ee621){var _0x1ffb17=_['mapKeys'](_0x1bebbf,function(_0x4b762c,_0x58936d){return _0x4b762c[_0x2ee621];});for(var _0x6beac in _0x1d7bed){if(_0x1d7bed['hasOwnProperty'](_0x6beac)){if(!_0x1ffb17[_0x6beac]){delete _0x1d7bed[_0x6beac];}}}}function freeIsNotKeySip(_0x3d8f81,_0x568c64){var _0x20de28=_[_0x46d4('0x23')](_0x3d8f81,function(_0x161a40,_0x5a8b29){return util[_0x46d4('0x24')]('SIP/%s',_0x161a40[_0x46d4('0x25')]);});for(var _0x16424b in _0x568c64){if(_0x568c64[_0x46d4('0x26')](_0x16424b)){if(!_0x20de28[_0x16424b]){delete _0x568c64[_0x16424b];}}}}function freeIsNotKeyAgent(_0x49df0c,_0x10958e){var _0x200464=_[_0x46d4('0x23')](_0x49df0c,function(_0x259a0c,_0x1ff5e6){var _0x43b641=_[_0x46d4('0x27')](_0x259a0c[_0x46d4('0x28')])?util[_0x46d4('0x24')]('SIP/%s',_0x259a0c[_0x46d4('0x25')]):_0x259a0c['interface'];return _0x43b641;});for(var _0x325617 in _0x10958e){if(_0x10958e[_0x46d4('0x26')](_0x325617)){if(!_0x200464[_0x325617]){delete _0x10958e[_0x325617];}}}}function clearVoiceCallReports(_0x12192c){_0x12192c[_0x46d4('0x29')]=0x0;_0x12192c['answered']=0x0;_0x12192c['sumHoldTime']=0x0;_0x12192c[_0x46d4('0x2a')]=0x0;_0x12192c[_0x46d4('0x2b')]=0x0;}function clearCampaigns(_0xd9c2ff){if(!_[_0x46d4('0x2c')](_0xd9c2ff)){for(var _0x96ce0e in _0xd9c2ff){if(_0xd9c2ff['hasOwnProperty'](_0x96ce0e)){_0xd9c2ff[_0x96ce0e][_0x46d4('0x2d')]=0x0;_0xd9c2ff[_0x96ce0e][_0x46d4('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x438e9c){if(!_[_0x46d4('0x2c')](_0x438e9c)){for(var _0x351492 in _0x438e9c){if(_0x438e9c[_0x46d4('0x26')](_0x351492)){_0x438e9c[_0x351492][_0x46d4('0x29')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x2f')]=0x0;_0x438e9c[_0x351492]['unmanaged']=0x0;_0x438e9c[_0x351492][_0x46d4('0x30')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x31')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x2a')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x2b')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x32')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x33')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x34')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x35')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x36')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x37')]=0x0;_0x438e9c[_0x351492]['outboundDropCallsDayTimeout']=0x0;_0x438e9c[_0x351492][_0x46d4('0x38')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x39')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3a')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3b')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3c')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x32')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3d')]=0x0;_0x438e9c[_0x351492][_0x46d4('0x3e')]=!![];}}}}Realtime[_0x46d4('0x3f')][_0x46d4('0x40')]=function(_0x440614,_0x2fb472){for(var _0x201aa3 in _0x2fb472){if(_0x440614[_0x46d4('0x26')](_0x201aa3)){_0x440614[_0x201aa3]=_0x2fb472[_0x201aa3];}}};Realtime[_0x46d4('0x3f')][_0x46d4('0x41')]=function(){var _0x408183=this;return function(_0x2f962f){if(_0x2f962f){freeIsNotKeyAgent(_0x2f962f,_0x408183['agents']);for(var _0x153d2d=0x0,_0x156737={},_0x54ab12={};_0x153d2d<_0x2f962f['length'];_0x153d2d+=0x1){_0x156737=_0x2f962f[_0x153d2d];var _0x17ddc5=_['isNil'](_0x156737[_0x46d4('0x28')])?util[_0x46d4('0x24')](_0x46d4('0x42'),_0x156737[_0x46d4('0x25')]):_0x156737['interface'];if(_[_0x46d4('0x43')](_0x408183[_0x46d4('0x11')][_0x17ddc5])){_0x408183[_0x46d4('0x11')][_0x17ddc5]=new Agent(_0x156737);}else{_0x408183[_0x46d4('0x40')](_0x408183[_0x46d4('0x11')][_0x17ddc5],_0x156737);}}}return _0x408183[_0x46d4('0x11')];};};Realtime['prototype'][_0x46d4('0x44')]=function(){var _0x5e8116=this;return function(_0x1762a2){if(_0x1762a2){freeIsNotKeySip(_0x1762a2,_0x5e8116[_0x46d4('0x12')]);for(var _0x3060d7=0x0,_0x4d0b8a={},_0x571962={};_0x3060d7<_0x1762a2[_0x46d4('0x45')];_0x3060d7+=0x1){_0x4d0b8a=_0x1762a2[_0x3060d7];if(_['isUndefined'](_0x5e8116[_0x46d4('0x12')][util['format'](_0x46d4('0x42'),_0x4d0b8a[_0x46d4('0x25')])])){_0x5e8116[_0x46d4('0x12')][util['format'](_0x46d4('0x42'),_0x4d0b8a[_0x46d4('0x25')])]=new Telephone(_0x4d0b8a);}else{_0x5e8116['mergeFromDatabase'](_0x5e8116['telephones'][util[_0x46d4('0x24')]('SIP/%s',_0x4d0b8a[_0x46d4('0x25')])],_0x4d0b8a);}}}return _0x5e8116['telephones'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x46')]=function(){var _0x1a0a6f=this;return function(_0xfa2668){if(_0xfa2668){freeIsNotKeySip(_0xfa2668,_0x1a0a6f[_0x46d4('0x47')]);for(var _0x1da9c9=0x0,_0x4d8dda={},_0x30268b={};_0x1da9c9<_0xfa2668[_0x46d4('0x45')];_0x1da9c9+=0x1){_0x4d8dda=_0xfa2668[_0x1da9c9];if(_[_0x46d4('0x43')](_0x1a0a6f[_0x46d4('0x47')][util[_0x46d4('0x24')](_0x46d4('0x42'),_0x4d8dda[_0x46d4('0x25')])])){_0x1a0a6f[_0x46d4('0x47')][util[_0x46d4('0x24')](_0x46d4('0x42'),_0x4d8dda[_0x46d4('0x25')])]=new Trunk(_0x4d8dda);}else{_0x1a0a6f['mergeFromDatabase'](_0x1a0a6f[_0x46d4('0x47')][util['format'](_0x46d4('0x42'),_0x4d8dda[_0x46d4('0x25')])],_0x4d8dda);}}}return _0x1a0a6f[_0x46d4('0x47')];};};Realtime['prototype'][_0x46d4('0x48')]=function(){var _0x339c62=this;return function(_0x117287){if(_0x117287){freeIsNotKey(_0x117287,_0x339c62[_0x46d4('0x13')],_0x46d4('0x25'));for(var _0x5e284d=0x0,_0x42ebc3={},_0x55dd85={};_0x5e284d<_0x117287[_0x46d4('0x45')];_0x5e284d+=0x1){_0x42ebc3=_0x117287[_0x5e284d];if(_['isUndefined'](_0x339c62[_0x46d4('0x13')][_0x42ebc3['name']])){_0x339c62['voiceQueues'][_0x42ebc3[_0x46d4('0x25')]]=new VoiceQueue(_0x42ebc3);}else{_0x339c62[_0x46d4('0x40')](_0x339c62[_0x46d4('0x13')][_0x42ebc3[_0x46d4('0x25')]],_0x42ebc3);}}}return _0x339c62['voiceQueues'];};};Realtime[_0x46d4('0x3f')]['initTriggers']=function(){var _0x385f8b=this;return function(_0x562293){if(_0x562293){freeIsNotKey(_0x562293,_0x385f8b[_0x46d4('0x14')],'id');for(var _0xb6645c=0x0,_0x111d9a={},_0x507a39={};_0xb6645c<_0x562293[_0x46d4('0x45')];_0xb6645c+=0x1){_0x111d9a=_0x562293[_0xb6645c];if(_['isUndefined'](_0x385f8b[_0x46d4('0x14')][_0x111d9a['id']])){_0x385f8b[_0x46d4('0x14')][_0x111d9a['id']]=new Trigger(_0x111d9a);}else{_0x385f8b[_0x46d4('0x40')](_0x385f8b['triggers'][_0x111d9a['id']],_0x111d9a);}}}return _0x385f8b['triggers'];};};Realtime[_0x46d4('0x3f')]['initTemplates']=function(){var _0xc3dcff=this;return function(_0x55351e){if(_0x55351e){freeIsNotKey(_0x55351e,_0xc3dcff[_0x46d4('0x49')],'id');for(var _0x1ad375=0x0,_0x439711={},_0x511fb0={};_0x1ad375<_0x55351e[_0x46d4('0x45')];_0x1ad375+=0x1){_0x439711=_0x55351e[_0x1ad375];if(_['isUndefined'](_0xc3dcff[_0x46d4('0x49')][_0x439711['id']])){_0xc3dcff['templates'][_0x439711['id']]=new Template(_0x439711);}else{_0xc3dcff[_0x46d4('0x40')](_0xc3dcff[_0x46d4('0x49')][_0x439711['id']],_0x439711);}}}return _0xc3dcff['templates'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x4a')]=function(){var _0x5a2125=this;return function(_0x42a3e5){if(_0x42a3e5){freeIsNotKey(_0x42a3e5,_0x5a2125[_0x46d4('0x19')],'id');for(var _0x3bc5ac=0x0,_0x59a394={},_0x118262={};_0x3bc5ac<_0x42a3e5['length'];_0x3bc5ac+=0x1){_0x59a394=_0x42a3e5[_0x3bc5ac];if(_['isUndefined'](_0x5a2125[_0x46d4('0x19')][_0x59a394['id']])){_0x5a2125[_0x46d4('0x19')][_0x59a394['id']]=new ZendeskAccount(_0x59a394);}else{_0x5a2125[_0x46d4('0x40')](_0x5a2125[_0x46d4('0x19')][_0x59a394['id']],_0x59a394);}}}return _0x5a2125[_0x46d4('0x19')];};};Realtime[_0x46d4('0x3f')]['initSalesforceAccounts']=function(){var _0x1d04ce=this;return function(_0x55e3bb){if(_0x55e3bb){freeIsNotKey(_0x55e3bb,_0x1d04ce[_0x46d4('0x1a')],'id');for(var _0x3fec6d=0x0,_0x1a45d6={},_0x5da8d2={};_0x3fec6d<_0x55e3bb[_0x46d4('0x45')];_0x3fec6d+=0x1){_0x1a45d6=_0x55e3bb[_0x3fec6d];if(_[_0x46d4('0x43')](_0x1d04ce[_0x46d4('0x1a')][_0x1a45d6['id']])){_0x1d04ce[_0x46d4('0x1a')][_0x1a45d6['id']]=new SalesforceAccount(_0x1a45d6);}else{_0x1d04ce[_0x46d4('0x40')](_0x1d04ce[_0x46d4('0x1a')][_0x1a45d6['id']],_0x1a45d6);}}}return _0x1d04ce[_0x46d4('0x1a')];};};Realtime['prototype'][_0x46d4('0x4b')]=function(){var _0x44610b=this;return function(_0x1ef747){if(_0x1ef747){freeIsNotKey(_0x1ef747,_0x44610b['freshdeskAccounts'],'id');for(var _0x2d5997=0x0,_0x1c7206={},_0x3a8605={};_0x2d5997<_0x1ef747['length'];_0x2d5997+=0x1){_0x1c7206=_0x1ef747[_0x2d5997];if(_[_0x46d4('0x43')](_0x44610b[_0x46d4('0x1c')][_0x1c7206['id']])){_0x44610b[_0x46d4('0x1c')][_0x1c7206['id']]=new FreshdeskAccount(_0x1c7206);}else{_0x44610b[_0x46d4('0x40')](_0x44610b[_0x46d4('0x1c')][_0x1c7206['id']],_0x1c7206);}}}return _0x44610b[_0x46d4('0x1c')];};};Realtime['prototype'][_0x46d4('0x4c')]=function(){var _0x2e202b=this;return function(_0x301a94){if(_0x301a94){freeIsNotKey(_0x301a94,_0x2e202b[_0x46d4('0x1d')],'id');for(var _0x2c5d0a=0x0,_0x532a7f={},_0x1f10ee={};_0x2c5d0a<_0x301a94['length'];_0x2c5d0a+=0x1){_0x532a7f=_0x301a94[_0x2c5d0a];if(_[_0x46d4('0x43')](_0x2e202b[_0x46d4('0x1d')][_0x532a7f['id']])){_0x2e202b[_0x46d4('0x1d')][_0x532a7f['id']]=new ZohoAccount(_0x532a7f);}else{_0x2e202b[_0x46d4('0x40')](_0x2e202b[_0x46d4('0x1d')][_0x532a7f['id']],_0x532a7f);}}}return _0x2e202b[_0x46d4('0x1d')];};};Realtime['prototype'][_0x46d4('0x4d')]=function(){var _0x2c63d0=this;return function(_0x5305f3){if(_0x5305f3){freeIsNotKey(_0x5305f3,_0x2c63d0['deskAccounts'],'id');for(var _0x21ba20=0x0,_0x12c5db={},_0x4be256={};_0x21ba20<_0x5305f3[_0x46d4('0x45')];_0x21ba20+=0x1){_0x12c5db=_0x5305f3[_0x21ba20];if(_['isUndefined'](_0x2c63d0[_0x46d4('0x1e')][_0x12c5db['id']])){_0x2c63d0['deskAccounts'][_0x12c5db['id']]=new DeskAccount(_0x12c5db);}else{_0x2c63d0[_0x46d4('0x40')](_0x2c63d0['deskAccounts'][_0x12c5db['id']],_0x12c5db);}}}return _0x2c63d0['deskAccounts'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x4e')]=function(){var _0x1f31ec=this;return function(_0x4ce374){if(_0x4ce374){freeIsNotKey(_0x4ce374,_0x1f31ec[_0x46d4('0x1b')],'id');for(var _0x1f1b16=0x0,_0x50f7a3={},_0x48b15a={};_0x1f1b16<_0x4ce374['length'];_0x1f1b16+=0x1){_0x50f7a3=_0x4ce374[_0x1f1b16];if(_[_0x46d4('0x43')](_0x1f31ec[_0x46d4('0x1b')][_0x50f7a3['id']])){_0x1f31ec[_0x46d4('0x1b')][_0x50f7a3['id']]=new SugarcrmAccount(_0x50f7a3);}else{_0x1f31ec['mergeFromDatabase'](_0x1f31ec['sugarcrmAccounts'][_0x50f7a3['id']],_0x50f7a3);}}}return _0x1f31ec[_0x46d4('0x1b')];};};Realtime[_0x46d4('0x3f')]['initVtigerAccounts']=function(){var _0x5b64be=this;return function(_0x2ae8cf){if(_0x2ae8cf){freeIsNotKey(_0x2ae8cf,_0x5b64be[_0x46d4('0x4f')],'id');for(var _0x117d93=0x0,_0x53f7f7={},_0x45228b={};_0x117d93<_0x2ae8cf['length'];_0x117d93+=0x1){_0x53f7f7=_0x2ae8cf[_0x117d93];if(_['isUndefined'](_0x5b64be[_0x46d4('0x4f')][_0x53f7f7['id']])){_0x5b64be[_0x46d4('0x4f')][_0x53f7f7['id']]=new VtigerAccount(_0x53f7f7);}else{_0x5b64be['mergeFromDatabase'](_0x5b64be[_0x46d4('0x4f')][_0x53f7f7['id']],_0x53f7f7);}}}return _0x5b64be[_0x46d4('0x4f')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x50')]=function(){var _0xdc4b37=this;return function(_0x192183){if(_0x192183){freeIsNotKey(_0x192183,_0xdc4b37[_0x46d4('0x1f')],'id');for(var _0x50bc16=0x0,_0x39e4dd={},_0x6c3787={};_0x50bc16<_0x192183['length'];_0x50bc16+=0x1){_0x39e4dd=_0x192183[_0x50bc16];if(_[_0x46d4('0x43')](_0xdc4b37[_0x46d4('0x1f')][_0x39e4dd['id']])){_0xdc4b37['servicenowAccounts'][_0x39e4dd['id']]=new ServicenowAccount(_0x39e4dd);}else{_0xdc4b37['mergeFromDatabase'](_0xdc4b37[_0x46d4('0x1f')][_0x39e4dd['id']],_0x39e4dd);}}}return _0xdc4b37['servicenowAccounts'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x51')]=function(){var _0x4e3cb4=this;return function(_0x3f50a4){if(_0x3f50a4){freeIsNotKey(_0x3f50a4,_0x4e3cb4['dynamics365Accounts'],'id');for(var _0x6a705e=0x0,_0x39a2e4={},_0x541e47={};_0x6a705e<_0x3f50a4[_0x46d4('0x45')];_0x6a705e+=0x1){_0x39a2e4=_0x3f50a4[_0x6a705e];if(_[_0x46d4('0x43')](_0x4e3cb4[_0x46d4('0x20')][_0x39a2e4['id']])){_0x4e3cb4['dynamics365Accounts'][_0x39a2e4['id']]=new Dynamics365Account(_0x39a2e4);}else{_0x4e3cb4[_0x46d4('0x40')](_0x4e3cb4[_0x46d4('0x20')][_0x39a2e4['id']],_0x39a2e4);}}}return _0x4e3cb4['dynamics365Accounts'];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x52')]=function(){var _0x39aee3=this;return function(_0xd4332){if(_0xd4332){freeIsNotKey(_0xd4332,_0x39aee3[_0x46d4('0x21')],'id');for(var _0x5b16f6=0x0,_0x45d564={},_0x3ddcdf={};_0x5b16f6<_0xd4332[_0x46d4('0x45')];_0x5b16f6+=0x1){_0x45d564=_0xd4332[_0x5b16f6];if(_['isUndefined'](_0x39aee3[_0x46d4('0x21')][_0x45d564['id']])){_0x39aee3[_0x46d4('0x21')][_0x45d564['id']]=new FreshsalesAccount(_0x45d564);}else{_0x39aee3[_0x46d4('0x40')](_0x39aee3['freshsalesAccounts'][_0x45d564['id']],_0x45d564);}}}return _0x39aee3['freshsalesAccounts'];};};Realtime[_0x46d4('0x3f')]['initVoiceQueueHopperHistory']=function(){var _0x488d93=this;return function(_0xe06121){for(var _0xe55eca=0x0;_0xe55eca<_0xe06121[_0x46d4('0x45')];_0xe55eca+=0x1){_[_0x46d4('0x53')](_0x488d93[_0x46d4('0x13')][_0xe06121[_0xe55eca]['name']],_0xe06121[_0xe55eca]);}return _0x488d93[_0x46d4('0x13')];};};Realtime[_0x46d4('0x3f')]['initVoiceQueueReports']=function(){var _0x17ccf7=this;return function(_0x2ce403){clearVoiceQueues(_0x17ccf7[_0x46d4('0x13')]);if(_0x2ce403){_0x2ce403=_[_0x46d4('0x54')](_0x2ce403,'uniqueid');for(var _0x455474 in _0x2ce403){if(_0x2ce403['hasOwnProperty'](_0x455474)){var _0x228642={};for(var _0x2cdb94=0x0;_0x2cdb94<_0x2ce403[_0x455474][_0x46d4('0x45')];_0x2cdb94+=0x1){var _0x360980=_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x55')];if(_0x17ccf7[_0x46d4('0x13')][_0x360980]){if(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x56')]){_0x17ccf7['voiceQueues'][_0x360980][_0x46d4('0x57')]+=0x1;}if(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x58')]){_0x17ccf7[_0x46d4('0x13')][_0x360980]['abandoned']+=0x1;}_0x17ccf7['voiceQueues'][_0x360980][_0x46d4('0x31')]+=moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x59')])['diff'](moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5a')]),'seconds')||0x0;if(_0x2cdb94===_0x2ce403[_0x455474][_0x46d4('0x45')]-0x1){_0x17ccf7[_0x46d4('0x13')][_0x360980][_0x46d4('0x2a')]+=moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5b')]||_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5c')]||_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5d')])[_0x46d4('0x5e')](moment(_0x2ce403[_0x455474][_0x2cdb94]['queuecallerjoinAt']),_0x46d4('0x5f'))||0x0;_0x17ccf7[_0x46d4('0x13')][_0x360980][_0x46d4('0x29')]+=0x1;if(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x60')]){_0x17ccf7['voiceQueues'][_0x360980][_0x46d4('0x2f')]+=0x1;_0x17ccf7[_0x46d4('0x13')][_0x360980][_0x46d4('0x2b')]+=moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x5b')])[_0x46d4('0x5e')](moment(_0x2ce403[_0x455474][_0x2cdb94][_0x46d4('0x59')]),_0x46d4('0x5f'))||0x0;}}else{_0x17ccf7[_0x46d4('0x13')][_0x360980]['sumDuration']+=_0x17ccf7[_0x46d4('0x13')][_0x360980]['sumHoldTime']||0x0;}}}}}}return _0x17ccf7[_0x46d4('0x13')];};};Realtime['prototype'][_0x46d4('0x61')]=function(){var _0x3c90aa=this;return function(_0xf9a28c){clearVoiceCallReports(_0x3c90aa[_0x46d4('0x15')]);if(_0xf9a28c){for(var _0xdf787c=0x0;_0xdf787c<_0xf9a28c[_0x46d4('0x45')];_0xdf787c+=0x1){_0x3c90aa['outbound']['total']+=0x1;_0x3c90aa[_0x46d4('0x15')][_0x46d4('0x2a')]+=_0xf9a28c[_0xdf787c][_0x46d4('0x62')];if(_0xf9a28c[_0xdf787c][_0x46d4('0x63')]===_0x46d4('0x64')){_0x3c90aa[_0x46d4('0x15')]['answered']+=0x1;_0x3c90aa[_0x46d4('0x15')][_0x46d4('0x31')]+=_0xf9a28c[_0xdf787c][_0x46d4('0x62')]-_0xf9a28c[_0xdf787c][_0x46d4('0x65')]||0x0;_0x3c90aa['outbound']['sumBillable']+=_0xf9a28c[_0xdf787c]['billableseconds'];}}}return _0x3c90aa[_0x46d4('0x15')];};};Realtime['prototype']['initCampaigns']=function(){var _0x540533=this;return function(_0x576455){if(_0x576455){freeIsNotKey(_0x576455,_0x540533[_0x46d4('0x66')],_0x46d4('0x25'));for(var _0x5609a7=0x0,_0x2b9a97={};_0x5609a7<_0x576455[_0x46d4('0x45')];_0x5609a7+=0x1){_0x2b9a97=_0x576455[_0x5609a7];if(_[_0x46d4('0x43')](_0x540533[_0x46d4('0x66')][_0x2b9a97[_0x46d4('0x25')]])){_0x540533['campaigns'][_0x2b9a97[_0x46d4('0x25')]]=new Campaign(_0x2b9a97);}else{_0x540533[_0x46d4('0x40')](_0x540533[_0x46d4('0x66')][_0x2b9a97[_0x46d4('0x25')]],_0x2b9a97);_0x540533[_0x46d4('0x66')][_0x2b9a97[_0x46d4('0x25')]][_0x46d4('0x67')]=_0x2b9a97['SquareProject']?_0x2b9a97['SquareProject'][_0x46d4('0x25')]:undefined;}}}return _0x540533[_0x46d4('0x66')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x68')]=function(){var _0x4c9649=this;return function(_0x6402c0){if(_0x6402c0){freeIsNotKey(_0x6402c0,_0x4c9649[_0x46d4('0x69')],'id');for(var _0x54e2a8=0x0,_0x21ba8b={};_0x54e2a8<_0x6402c0[_0x46d4('0x45')];_0x54e2a8+=0x1){_0x21ba8b=_0x6402c0[_0x54e2a8];if(_['isUndefined'](_0x4c9649[_0x46d4('0x69')][_0x21ba8b['id']])){_0x4c9649[_0x46d4('0x69')][_0x21ba8b['id']]=new VoiceExtension(_0x21ba8b);}else{_0x4c9649['mergeFromDatabase'](_0x4c9649[_0x46d4('0x69')][_0x21ba8b['id']],_0x21ba8b);}}}return _0x4c9649[_0x46d4('0x69')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x6a')]=function(){var _0x3d1cd9=this;return function(_0x3c05b8){clearCampaigns(_0x3d1cd9['campaigns']);for(var _0x173258=0x0;_0x173258<_0x3c05b8[_0x46d4('0x45')];_0x173258+=0x1){_[_0x46d4('0x53')](_0x3d1cd9[_0x46d4('0x66')][_0x3c05b8[_0x173258]['name']],_0x3c05b8[_0x173258]);}return _0x3d1cd9[_0x46d4('0x66')];};};Realtime[_0x46d4('0x3f')][_0x46d4('0x6b')]=function(){var _0x736060=this;return function(_0x7d4b0b){if(_0x7d4b0b){freeIsNotKey(_0x7d4b0b,_0x736060[_0x46d4('0x22')],'id');for(var _0x51b453=0x0,_0x3478cc={},_0x5e8678={};_0x51b453<_0x7d4b0b[_0x46d4('0x45')];_0x51b453+=0x1){_0x3478cc=_0x7d4b0b[_0x51b453];if(_[_0x46d4('0x43')](_0x736060['faxAccounts'][_0x3478cc['id']])){_0x736060[_0x46d4('0x22')][_0x3478cc['id']]=new FaxAccount(_0x3478cc);}else{_0x736060[_0x46d4('0x40')](_0x736060[_0x46d4('0x22')][_0x3478cc['id']],_0x3478cc);}}}return _0x736060[_0x46d4('0x22')];};};module[_0x46d4('0x6c')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 97ec1e0..dcfdafd 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 _0x7f7a=['\x22%s\x22\x20<%s>','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','blindTransfer','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceDialReport','attendedtransfer','attendedTransfer','findAgent','find','name','accountcode','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','interface','format','YYYY-MM-DD\x20HH:mm:ss','create','match','destination','exten','type','dialer','lastapplication','queue','context','callerid','xcally-motion-preview','calleridnum','originatecalleridnum','destinationchannel','channel','calleridpreview','disposition','ANSWERED'];(function(_0x1faf63,_0x253cd2){var _0x172eef=function(_0x595ca3){while(--_0x595ca3){_0x1faf63['push'](_0x1faf63['shift']());}};_0x172eef(++_0x253cd2);}(_0x7f7a,0x1a6));var _0xa7f7=function(_0x58a9ee,_0x124b82){_0x58a9ee=_0x58a9ee-0x0;var _0x5ad150=_0x7f7a[_0x58a9ee];return _0x5ad150;};'use strict';var _=require(_0xa7f7('0x0'));var moment=require(_0xa7f7('0x1'));var util=require(_0xa7f7('0x2'));var config=require('../../../config/environment');var ami=require(_0xa7f7('0x3'));var RpcVoiceAgentReport=require(_0xa7f7('0x4'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xa7f7('0x5'));var RpcMemberReport=require(_0xa7f7('0x6'));var RpcVoiceQueueReport=require(_0xa7f7('0x7'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xa7f7('0x8'));var VoiceQueueReport=require(_0xa7f7('0x9'));var VoiceCallReport=require(_0xa7f7('0xa'));var VoiceAgentReport=require(_0xa7f7('0xb'));var VoiceDialReport=require(_0xa7f7('0xc'));var UserReport=require(_0xa7f7('0xd'));function Report(_0x3b5842){this[_0xa7f7('0xe')]=_0x3b5842;this['agents']=_0x3b5842[_0xa7f7('0xf')];this[_0xa7f7('0x10')]=_0x3b5842[_0xa7f7('0x10')];}Report[_0xa7f7('0x11')]['sync']=function(_0x1fe69c){var _0x43c3b2=new VoiceQueueReport(this['realtime']);var _0x4ab831=new VoiceAgentReport(this[_0xa7f7('0xe')]);var _0x4aceb3=new VoiceDialReport(this[_0xa7f7('0xe')]);var _0x22073a=new VoiceCallReport(this['realtime']);var _0x48ed57=new UserReport(this['realtime']);if(config['xdr']&&config[_0xa7f7('0x12')]['disabled']){ami['on'](_0xa7f7('0x13'),this[_0xa7f7('0x14')][_0xa7f7('0x15')](this));ami['on']('custom:voiceCallReport',this[_0xa7f7('0x16')][_0xa7f7('0x15')](this));ami['on'](_0xa7f7('0x17'),this['voiceAgentReport']['bind'](this));ami['on']('custom:voiceDialReport',this[_0xa7f7('0x18')][_0xa7f7('0x15')](this));ami['on']('blindtransfer',this['blindTransfer'][_0xa7f7('0x15')](this));ami['on'](_0xa7f7('0x19'),this[_0xa7f7('0x1a')][_0xa7f7('0x15')](this));}};Report['prototype'][_0xa7f7('0x1b')]=function(_0x105d6c){var _0x346d1a;_0x346d1a=_[_0xa7f7('0x1c')](this['agents'],function(_0x2bc7a1){return _0x2bc7a1['accountcode']==_0x105d6c||_0x2bc7a1[_0xa7f7('0x1d')]==_0x105d6c;});if(_['isNil'](_0x346d1a)){var _0x26b9f8=_[_0xa7f7('0x1c')](this[_0xa7f7('0x10')],function(_0x31cb38){return _0x31cb38[_0xa7f7('0x1e')]==_0x105d6c||_0x31cb38[_0xa7f7('0x1d')]==_0x105d6c;});if(_0x26b9f8){_0x346d1a=_[_0xa7f7('0x1c')](this[_0xa7f7('0xf')],function(_0x2d39e5){return _0x2d39e5['interface']==util['format'](_0xa7f7('0x1f'),_0x26b9f8[_0xa7f7('0x1d')]);});}}return _0x346d1a;};Report['prototype']['voiceQueueReport']=function(_0x42fd40){for(var _0x2a8d59=0x0;_0x2a8d59<_0x42fd40[_0xa7f7('0x20')];_0x2a8d59+=0x1){var _0x4e40ee=this['findAgent'](_0x42fd40[_0x2a8d59][_0xa7f7('0x21')]);if(_0x4e40ee){_0x42fd40[_0x2a8d59][_0xa7f7('0x1e')]=_0x4e40ee['accountcode'];_0x42fd40[_0x2a8d59][_0xa7f7('0x22')]=!![];_0x42fd40[_0x2a8d59][_0xa7f7('0x23')]=_0x4e40ee['name'];_0x42fd40[_0x2a8d59]['interface']=_[_0xa7f7('0x24')](_0x4e40ee[_0xa7f7('0x25')])?util[_0xa7f7('0x26')](_0xa7f7('0x1f'),_0x4e40ee[_0xa7f7('0x1d')]):_0x4e40ee[_0xa7f7('0x25')];if(_0x42fd40[_0x2a8d59]['queuecallercomplete']){_0x42fd40[_0x2a8d59]['queuecallercompleteAt']=moment()['format'](_0xa7f7('0x27'));}if(_0x42fd40[_0x2a8d59]['queuecallerexit']){_0x42fd40[_0x2a8d59]['queuecallerexitAt']=moment()['format'](_0xa7f7('0x27'));}RpcMemberReport[_0xa7f7('0x14')](_0x42fd40[_0x2a8d59]);}RpcVoiceQueueReport[_0xa7f7('0x28')](_0x42fd40[_0x2a8d59]);}};function extractCalleridNumber(_0x5e50ba){var _0x1e92ce=_0x5e50ba[_0xa7f7('0x29')](/<(.*?)>/);return _0x1e92ce?_0x1e92ce[0x1]:_0x5e50ba;}Report['prototype'][_0xa7f7('0x16')]=function(_0x202359){_0x202359['destination']=_0x202359[_0xa7f7('0x2a')]||_0x202359[_0xa7f7('0x2b')];if(_0x202359[_0xa7f7('0x2c')]==_0xa7f7('0x2d')){_0x202359[_0xa7f7('0x2e')]=_0xa7f7('0x2f');_0x202359['lastdata']=_0x202359[_0xa7f7('0x2f')];if(_0x202359[_0xa7f7('0x30')]=='from-voip-provider'){_0x202359[_0xa7f7('0x1e')]='';_0x202359[_0xa7f7('0x2a')]=extractCalleridNumber(_0x202359[_0xa7f7('0x31')]);}else if(_0x202359['context']=='from-sip'){if(_0x202359['destination']==_0xa7f7('0x32')){_0x202359['destination']=extractCalleridNumber(_0x202359['calleridpreview']);_0x202359[_0xa7f7('0x33')]=_0x202359[_0xa7f7('0x34')];_0x202359[_0xa7f7('0x35')]=[_0x202359[_0xa7f7('0x36')],_0x202359['channel']=_0x202359[_0xa7f7('0x35')]][0x0];_0x202359['callerid']=_0x202359[_0xa7f7('0x37')];}else{_0x202359[_0xa7f7('0x2a')]=_0x202359[_0xa7f7('0x33')];_0x202359[_0xa7f7('0x33')]=_0x202359[_0xa7f7('0x34')];if(_0x202359[_0xa7f7('0x38')]==_0xa7f7('0x39')){_0x202359[_0xa7f7('0x1e')]=_0x202359['connectedlinenum'];}else{_0x202359[_0xa7f7('0x1e')]='';}}}}else{_0x202359[_0xa7f7('0x31')]=util['format'](_0xa7f7('0x3a'),_0x202359[_0xa7f7('0x3b')],_0x202359[_0xa7f7('0x33')]);}if(RpcVoiceTransferReport['transfers'][_0x202359[_0xa7f7('0x3c')]]){var _0x1e5271=RpcVoiceTransferReport[_0xa7f7('0x3d')][_0x202359[_0xa7f7('0x3c')]];_0x1e5271[_0xa7f7('0x3e')]=_0x202359[_0xa7f7('0x3f')];RpcVoiceTransferReport[_0xa7f7('0x40')](_0x1e5271);delete RpcVoiceTransferReport[_0xa7f7('0x3d')][_0x202359[_0xa7f7('0x3c')]];}RpcVoiceCallReport[_0xa7f7('0x28')](_0x202359);if(_0x202359[_0xa7f7('0x41')]){for(var _0x1b7183=0x0;_0x1b7183<_0x202359[_0xa7f7('0x42')][_0xa7f7('0x20')];_0x1b7183+=0x1){_0x202359[_0xa7f7('0x43')]=_0x202359[_0xa7f7('0x42')][_0x1b7183]['filename'];_0x202359[_0xa7f7('0x44')]=_0x202359[_0xa7f7('0x42')][_0x1b7183]['createdAt'];if(_0x202359[_0xa7f7('0x2b')]==_0xa7f7('0x32')){_0x202359[_0xa7f7('0x33')]=_0x202359[_0xa7f7('0x21')];_0x202359[_0xa7f7('0x3b')]=_0x202359[_0xa7f7('0x45')];_0x202359[_0xa7f7('0x21')]=_0x202359['accountcode'];_0x202359['connectedlinename']=_0x202359[_0xa7f7('0x46')];_0x202359[_0xa7f7('0x2b')]=_0x202359['originatecalleridnum'];}else if(_0x202359[_0xa7f7('0x2b')]==_0xa7f7('0x47')){_0x202359[_0xa7f7('0x33')]=_0x202359['destination'];_0x202359[_0xa7f7('0x2b')]=_0x202359[_0xa7f7('0x34')];}RpcVoiceRecording[_0xa7f7('0x28')](_0x202359);}}};Report['prototype']['voiceAgentReport']=function(_0x4de53d){if(_[_0xa7f7('0x48')](_0x4de53d)){_0x4de53d['forEach'](function(_0x544b8d){RpcVoiceAgentReport[_0xa7f7('0x28')](_0x544b8d);});}else{RpcVoiceAgentReport[_0xa7f7('0x28')](_0x4de53d);}};Report[_0xa7f7('0x11')][_0xa7f7('0x18')]=function(_0x599780){RpcVoiceDialReport[_0xa7f7('0x28')](_0x599780);var _0x451e8a;var _0x2721a4;var _0x1fc0ec=_0x599780[_0xa7f7('0x36')];if(_[_0xa7f7('0x49')](_0x1fc0ec,'Local')){_0x2721a4=_0x1fc0ec[_0xa7f7('0x4a')](_0x1fc0ec[_0xa7f7('0x4b')]('/')+0x1,_0x1fc0ec['indexOf']('@'));_0x451e8a=_[_0xa7f7('0x1c')](this[_0xa7f7('0xf')],function(_0x3a7435){return _0x3a7435[_0xa7f7('0x4c')]==_0x2721a4||_0x3a7435[_0xa7f7('0x4d')]==_0x2721a4||_0x3a7435[_0xa7f7('0x1e')]==_0x2721a4;});}else{_0x2721a4=_0x1fc0ec[_0xa7f7('0x4a')](_0x1fc0ec[_0xa7f7('0x4b')]('/')+0x1,_0x1fc0ec[_0xa7f7('0x4e')]('-'));_0x451e8a=this[_0xa7f7('0x1b')](_0x2721a4);}if(_0x451e8a){_0x599780[_0xa7f7('0x25')]=_[_0xa7f7('0x24')](_0x451e8a[_0xa7f7('0x25')])?util[_0xa7f7('0x26')](_0xa7f7('0x1f'),_0x451e8a[_0xa7f7('0x1d')]):_0x451e8a[_0xa7f7('0x25')];_0x599780[_0xa7f7('0x46')]=_0x451e8a[_0xa7f7('0x1d')];_0x599780[_0xa7f7('0x1e')]=_0x451e8a['accountcode'];RpcMemberReport[_0xa7f7('0x18')](_0x599780);}};Report['prototype']['blindTransfer']=function(_0x487796){RpcVoiceTransferReport[_0xa7f7('0x3d')][_0x487796['transfererlinkedid']]=_0x487796;};Report[_0xa7f7('0x11')][_0xa7f7('0x1a')]=function(_0x233d88){RpcVoiceTransferReport[_0xa7f7('0x1a')](_0x233d88);};module[_0xa7f7('0x4f')]=Report; \ No newline at end of file +var _0xeae9=['context','from-sip','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','length','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','membername','transfererlinkedid','exports','lodash','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','agents','telephones','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','name','isNil','accountcode','interface','SIP/%s','voiceQueueReport','connectedlinenum','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','voiceCallReport','destination','type','lastapplication','queue','lastdata','callerid'];(function(_0x2ae960,_0x2ba93c){var _0x5cced8=function(_0x19b7b5){while(--_0x19b7b5){_0x2ae960['push'](_0x2ae960['shift']());}};_0x5cced8(++_0x2ba93c);}(_0xeae9,0xc1));var _0x9eae=function(_0x266247,_0x406437){_0x266247=_0x266247-0x0;var _0x335374=_0xeae9[_0x266247];return _0x335374;};'use strict';var _=require(_0x9eae('0x0'));var moment=require('moment');var util=require(_0x9eae('0x1'));var config=require(_0x9eae('0x2'));var ami=require(_0x9eae('0x3'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9eae('0x4'));var RpcVoiceDialReport=require(_0x9eae('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x9eae('0x6'));var RpcVoiceRecording=require(_0x9eae('0x7'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x9eae('0x8'));var VoiceCallReport=require(_0x9eae('0x9'));var VoiceAgentReport=require(_0x9eae('0xa'));var VoiceDialReport=require(_0x9eae('0xb'));var UserReport=require('./userReport');function Report(_0x113af8){this['realtime']=_0x113af8;this[_0x9eae('0xc')]=_0x113af8[_0x9eae('0xc')];this[_0x9eae('0xd')]=_0x113af8['telephones'];}Report['prototype']['sync']=function(_0x47f155){var _0x3b562e=new VoiceQueueReport(this[_0x9eae('0xe')]);var _0x24161e=new VoiceAgentReport(this[_0x9eae('0xe')]);var _0xeef11c=new VoiceDialReport(this[_0x9eae('0xe')]);var _0x5f263a=new VoiceCallReport(this['realtime']);var _0x34b009=new UserReport(this['realtime']);if(config[_0x9eae('0xf')]&&config[_0x9eae('0xf')][_0x9eae('0x10')]){ami['on'](_0x9eae('0x11'),this['voiceQueueReport'][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x13'),this['voiceCallReport'][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x14'),this[_0x9eae('0x15')]['bind'](this));ami['on'](_0x9eae('0x16'),this[_0x9eae('0x17')][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x18'),this[_0x9eae('0x19')][_0x9eae('0x12')](this));ami['on'](_0x9eae('0x1a'),this[_0x9eae('0x1b')]['bind'](this));}};Report[_0x9eae('0x1c')][_0x9eae('0x1d')]=function(_0x45d9c0){var _0x352a8d;_0x352a8d=_[_0x9eae('0x1e')](this[_0x9eae('0xc')],function(_0x541cfb){return _0x541cfb['accountcode']==_0x45d9c0||_0x541cfb[_0x9eae('0x1f')]==_0x45d9c0;});if(_[_0x9eae('0x20')](_0x352a8d)){var _0x231e13=_['find'](this[_0x9eae('0xd')],function(_0x1cdc76){return _0x1cdc76[_0x9eae('0x21')]==_0x45d9c0||_0x1cdc76[_0x9eae('0x1f')]==_0x45d9c0;});if(_0x231e13){_0x352a8d=_[_0x9eae('0x1e')](this[_0x9eae('0xc')],function(_0x5bd522){return _0x5bd522[_0x9eae('0x22')]==util['format'](_0x9eae('0x23'),_0x231e13[_0x9eae('0x1f')]);});}}return _0x352a8d;};Report['prototype'][_0x9eae('0x24')]=function(_0x5cebb7){for(var _0x4aded8=0x0;_0x4aded8<_0x5cebb7['length'];_0x4aded8+=0x1){var _0x11833b=this[_0x9eae('0x1d')](_0x5cebb7[_0x4aded8][_0x9eae('0x25')]);if(_0x11833b){_0x5cebb7[_0x4aded8][_0x9eae('0x21')]=_0x11833b['accountcode'];_0x5cebb7[_0x4aded8]['assigned']=!![];_0x5cebb7[_0x4aded8]['lastAssignedTo']=_0x11833b[_0x9eae('0x1f')];_0x5cebb7[_0x4aded8][_0x9eae('0x22')]=_[_0x9eae('0x20')](_0x11833b['interface'])?util['format'](_0x9eae('0x23'),_0x11833b['name']):_0x11833b[_0x9eae('0x22')];if(_0x5cebb7[_0x4aded8]['queuecallercomplete']){_0x5cebb7[_0x4aded8][_0x9eae('0x26')]=moment()[_0x9eae('0x27')](_0x9eae('0x28'));}if(_0x5cebb7[_0x4aded8]['queuecallerexit']){_0x5cebb7[_0x4aded8][_0x9eae('0x29')]=moment()[_0x9eae('0x27')](_0x9eae('0x28'));}RpcMemberReport[_0x9eae('0x24')](_0x5cebb7[_0x4aded8]);}RpcVoiceQueueReport[_0x9eae('0x2a')](_0x5cebb7[_0x4aded8]);}};function extractCalleridNumber(_0x54b46e){var _0x33dbd1=_0x54b46e['match'](/<(.*?)>/);return _0x33dbd1?_0x33dbd1[0x1]:_0x54b46e;}Report[_0x9eae('0x1c')][_0x9eae('0x2b')]=function(_0xe79fb3){_0xe79fb3[_0x9eae('0x2c')]=_0xe79fb3[_0x9eae('0x2c')]||_0xe79fb3['exten'];if(_0xe79fb3[_0x9eae('0x2d')]=='dialer'){_0xe79fb3[_0x9eae('0x2e')]=_0x9eae('0x2f');_0xe79fb3[_0x9eae('0x30')]=_0xe79fb3[_0x9eae('0x2f')];if(_0xe79fb3['context']=='from-voip-provider'){_0xe79fb3[_0x9eae('0x21')]='';_0xe79fb3[_0x9eae('0x2c')]=extractCalleridNumber(_0xe79fb3[_0x9eae('0x31')]);}else if(_0xe79fb3[_0x9eae('0x32')]==_0x9eae('0x33')){if(_0xe79fb3['destination']==_0x9eae('0x34')){_0xe79fb3[_0x9eae('0x2c')]=extractCalleridNumber(_0xe79fb3[_0x9eae('0x35')]);_0xe79fb3['calleridnum']=_0xe79fb3[_0x9eae('0x36')];_0xe79fb3[_0x9eae('0x37')]=[_0xe79fb3[_0x9eae('0x38')],_0xe79fb3['channel']=_0xe79fb3['destinationchannel']][0x0];_0xe79fb3[_0x9eae('0x31')]=_0xe79fb3['calleridpreview'];}else{_0xe79fb3[_0x9eae('0x2c')]=_0xe79fb3['calleridnum'];_0xe79fb3[_0x9eae('0x39')]=_0xe79fb3[_0x9eae('0x36')];if(_0xe79fb3['disposition']=='ANSWERED'){_0xe79fb3[_0x9eae('0x21')]=_0xe79fb3[_0x9eae('0x25')];}else{_0xe79fb3[_0x9eae('0x21')]='';}}}}else{_0xe79fb3[_0x9eae('0x31')]=util[_0x9eae('0x27')](_0x9eae('0x3a'),_0xe79fb3[_0x9eae('0x3b')],_0xe79fb3[_0x9eae('0x39')]);}if(RpcVoiceTransferReport[_0x9eae('0x3c')][_0xe79fb3[_0x9eae('0x3d')]]){var _0x505b7e=RpcVoiceTransferReport[_0x9eae('0x3c')][_0xe79fb3[_0x9eae('0x3d')]];_0x505b7e[_0x9eae('0x3e')]=_0xe79fb3[_0x9eae('0x3f')];RpcVoiceTransferReport[_0x9eae('0x19')](_0x505b7e);delete RpcVoiceTransferReport[_0x9eae('0x3c')][_0xe79fb3[_0x9eae('0x3d')]];}RpcVoiceCallReport[_0x9eae('0x2a')](_0xe79fb3);if(_0xe79fb3['monitor']){for(var _0x28aac1=0x0;_0x28aac1<_0xe79fb3[_0x9eae('0x40')][_0x9eae('0x41')];_0x28aac1+=0x1){_0xe79fb3['monitorFilename']=_0xe79fb3['monitors'][_0x28aac1][_0x9eae('0x42')];_0xe79fb3[_0x9eae('0x43')]=_0xe79fb3[_0x9eae('0x40')][_0x28aac1][_0x9eae('0x43')];if(_0xe79fb3[_0x9eae('0x44')]==_0x9eae('0x34')){_0xe79fb3[_0x9eae('0x39')]=_0xe79fb3[_0x9eae('0x25')];_0xe79fb3[_0x9eae('0x3b')]=_0xe79fb3[_0x9eae('0x45')];_0xe79fb3[_0x9eae('0x25')]=_0xe79fb3[_0x9eae('0x21')];_0xe79fb3[_0x9eae('0x45')]=_0xe79fb3['membername'];_0xe79fb3[_0x9eae('0x44')]=_0xe79fb3[_0x9eae('0x36')];}else if(_0xe79fb3[_0x9eae('0x44')]==_0x9eae('0x46')){_0xe79fb3[_0x9eae('0x39')]=_0xe79fb3[_0x9eae('0x2c')];_0xe79fb3[_0x9eae('0x44')]=_0xe79fb3[_0x9eae('0x36')];}RpcVoiceRecording[_0x9eae('0x2a')](_0xe79fb3);}}};Report[_0x9eae('0x1c')][_0x9eae('0x15')]=function(_0x53c039){if(_['isArray'](_0x53c039)){_0x53c039[_0x9eae('0x47')](function(_0x186f11){RpcVoiceAgentReport['create'](_0x186f11);});}else{RpcVoiceAgentReport[_0x9eae('0x2a')](_0x53c039);}};Report[_0x9eae('0x1c')][_0x9eae('0x17')]=function(_0x217b69){RpcVoiceDialReport[_0x9eae('0x2a')](_0x217b69);var _0x5aff38;var _0x2a0950;var _0xb97f60=_0x217b69[_0x9eae('0x38')];if(_[_0x9eae('0x48')](_0xb97f60,'Local')){_0x2a0950=_0xb97f60[_0x9eae('0x49')](_0xb97f60[_0x9eae('0x4a')]('/')+0x1,_0xb97f60[_0x9eae('0x4a')]('@'));_0x5aff38=_[_0x9eae('0x1e')](this[_0x9eae('0xc')],function(_0x2906fb){return _0x2906fb[_0x9eae('0x4b')]==_0x2a0950||_0x2906fb[_0x9eae('0x4c')]==_0x2a0950||_0x2906fb['accountcode']==_0x2a0950;});}else{_0x2a0950=_0xb97f60['substring'](_0xb97f60[_0x9eae('0x4a')]('/')+0x1,_0xb97f60[_0x9eae('0x4d')]('-'));_0x5aff38=this[_0x9eae('0x1d')](_0x2a0950);}if(_0x5aff38){_0x217b69[_0x9eae('0x22')]=_[_0x9eae('0x20')](_0x5aff38[_0x9eae('0x22')])?util[_0x9eae('0x27')](_0x9eae('0x23'),_0x5aff38[_0x9eae('0x1f')]):_0x5aff38['interface'];_0x217b69[_0x9eae('0x4e')]=_0x5aff38[_0x9eae('0x1f')];_0x217b69[_0x9eae('0x21')]=_0x5aff38['accountcode'];RpcMemberReport[_0x9eae('0x17')](_0x217b69);}};Report[_0x9eae('0x1c')][_0x9eae('0x19')]=function(_0x2cbac0){RpcVoiceTransferReport[_0x9eae('0x3c')][_0x2cbac0[_0x9eae('0x4f')]]=_0x2cbac0;};Report[_0x9eae('0x1c')][_0x9eae('0x1b')]=function(_0x5bd5c6){RpcVoiceTransferReport['attendedTransfer'](_0x5bd5c6);};module[_0x9eae('0x50')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 83275f6..a80b717 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 _0xd4ff=['[userReport][registry]\x20registry:%s\x20state:%s','username','debug','[userReport][registry]','stateRegistry','state','merge','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','stateTime','telephone:%s','name','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','find','mobile','phone','accountcode','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','registered','status','address','updateStatusRealtime','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','trunks','agents','telephones','registryentry','bind','peerstatus','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','actionDeviceStateList','error','resolve','actionSipPeerStatus','inspect','prototype','syncRealtimeShow','isNotNull','isUndefined','emit','syncRegistry','info'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xd4ff,0x151));var _0xfd4f=function(_0xc0d498,_0x268586){_0xc0d498=_0xc0d498-0x0;var _0x486115=_0xd4ff[_0xc0d498];return _0x486115;};'use strict';var _=require(_0xfd4f('0x0'));var moment=require(_0xfd4f('0x1'));var util=require(_0xfd4f('0x2'));var Redis=require(_0xfd4f('0x3'));var BPromise=require(_0xfd4f('0x4'));var config=require(_0xfd4f('0x5'));var logger=require(_0xfd4f('0x6'))(_0xfd4f('0x7'));var ami=require(_0xfd4f('0x8'));config[_0xfd4f('0x9')]=_['defaults'](config[_0xfd4f('0x9')],{'host':_0xfd4f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xfd4f('0x9')]));function UserReport(_0x395138){this[_0xfd4f('0xb')]=_0x395138[_0xfd4f('0xb')];this['agents']=_0x395138[_0xfd4f('0xc')];this[_0xfd4f('0xd')]=_0x395138[_0xfd4f('0xd')];ami['on'](_0xfd4f('0xe'),this['syncRegistry'][_0xfd4f('0xf')](this));ami['on']('registry',this['syncRegistry'][_0xfd4f('0xf')](this));ami['on']('devicestatechange',this['syncDeviceState'][_0xfd4f('0xf')](this));ami['on'](_0xfd4f('0x10'),this['syncPeerStatus'][_0xfd4f('0xf')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise['resolve']()[_0xfd4f('0x11')](ami[_0xfd4f('0x12')]())[_0xfd4f('0x13')](function(_0x2e1b3){logger['error'](_0xfd4f('0x14'),util['inspect'](_0x2e1b3,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()['then'](ami[_0xfd4f('0x15')]())[_0xfd4f('0x13')](function(_0x41d399){logger[_0xfd4f('0x16')]('[userReport][devicestatelist]',util['inspect'](_0x41d399,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xfd4f('0x17')]()[_0xfd4f('0x11')](ami[_0xfd4f('0x18')]())[_0xfd4f('0x13')](function(_0x2fde08){logger[_0xfd4f('0x16')]('[userReport][sippeerstatus]',util[_0xfd4f('0x19')](_0x2fde08,{'showHidden':![],'depth':null}));});}UserReport[_0xfd4f('0x1a')][_0xfd4f('0x1b')]=function(){setInterval(function(){BPromise['resolve']()[_0xfd4f('0x11')](showSipRegistrations())[_0xfd4f('0x11')](listDeviceStates())[_0xfd4f('0x11')](showPeersStatus());},0x32c8);};UserReport[_0xfd4f('0x1a')][_0xfd4f('0x1c')]=function(_0xc62f90){return _0xc62f90!==null&&!_[_0xfd4f('0x1d')](_0xc62f90);};UserReport[_0xfd4f('0x1a')][_0xfd4f('0x1e')]=function(_0x51a6d6,_0x523618,_0x98dc5b){io['to'](_0x51a6d6)[_0xfd4f('0x1e')](_0x523618,_0x98dc5b);};UserReport[_0xfd4f('0x1a')][_0xfd4f('0x1f')]=function(_0x18692d){try{if(this[_0xfd4f('0x1c')](_0x18692d)){logger[_0xfd4f('0x20')](_0xfd4f('0x21'),_0x18692d[_0xfd4f('0x22')],_0x18692d['state']);logger[_0xfd4f('0x23')](_0xfd4f('0x24'),util['inspect'](_0x18692d,{'showHidden':![],'depth':null}));var _0x3fec88=_['find'](this[_0xfd4f('0xb')],{'defaultuser':_0x18692d['username']});if(_0x3fec88){_0x18692d[_0xfd4f('0x25')]=_0x18692d[_0xfd4f('0x26')];_[_0xfd4f('0x27')](_0x3fec88,_['omit'](_0x18692d,['event',_0xfd4f('0x28'),_0xfd4f('0x22'),'state']));logger[_0xfd4f('0x23')](_0xfd4f('0x29'),util[_0xfd4f('0x19')](_0x3fec88,{'showHidden':![],'depth':null}));this['emit'](util[_0xfd4f('0x2a')](_0xfd4f('0x2b'),_0x3fec88['name']),_0xfd4f('0x2c'),_0x3fec88);}}}catch(_0x2c3a9c){logger[_0xfd4f('0x16')]('[userReport][registry]',util[_0xfd4f('0x19')](_0x2c3a9c,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x128b22){try{if(this[_0xfd4f('0x1c')](_0x128b22)){logger[_0xfd4f('0x20')](_0xfd4f('0x2d'),_0x128b22[_0xfd4f('0x2e')],_0x128b22[_0xfd4f('0x26')]);logger['debug'](_0xfd4f('0x2f'),util[_0xfd4f('0x19')](_0x128b22,{'showHidden':![],'depth':null}));if(this[_0xfd4f('0xc')][_0x128b22[_0xfd4f('0x2e')]]){if(!this[_0xfd4f('0xc')][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x30')]||_0x128b22[_0xfd4f('0x26')][_0xfd4f('0x31')]()==_0xfd4f('0x32')){this['agents'][_0x128b22[_0xfd4f('0x2e')]]['local']=![];if(this[_0xfd4f('0xc')][_0x128b22['device']][_0xfd4f('0x26')]!==_0x128b22[_0xfd4f('0x26')][_0xfd4f('0x31')]()){this[_0xfd4f('0xc')][_0x128b22[_0xfd4f('0x2e')]]['stateTime']=_[_0xfd4f('0x33')](moment()[_0xfd4f('0x2a')]('x'));}this[_0xfd4f('0xc')][_0x128b22['device']][_0xfd4f('0x26')]=_0x128b22['state'][_0xfd4f('0x31')]();this['agents'][_0x128b22[_0xfd4f('0x2e')]]['updateStatusRealtime'](_0x128b22);}}else if(this[_0xfd4f('0xd')][_0x128b22[_0xfd4f('0x2e')]]){if(this[_0xfd4f('0xd')][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x26')]!==_0x128b22[_0xfd4f('0x26')][_0xfd4f('0x31')]()){this[_0xfd4f('0xd')][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x34')]=_[_0xfd4f('0x33')](moment()['format']('x'));}this[_0xfd4f('0xd')][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x26')]=_0x128b22[_0xfd4f('0x26')][_0xfd4f('0x31')]();logger[_0xfd4f('0x23')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xfd4f('0x19')](this[_0xfd4f('0xd')][_0x128b22[_0xfd4f('0x2e')]],{'showHidden':![],'depth':null}));this[_0xfd4f('0x1e')](util[_0xfd4f('0x2a')](_0xfd4f('0x35'),this[_0xfd4f('0xd')][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x36')]),_0xfd4f('0x37'),this['telephones'][_0x128b22[_0xfd4f('0x2e')]]);}else if(this[_0xfd4f('0xb')][_0x128b22['device']]){if(this['trunks'][_0x128b22['device']][_0xfd4f('0x26')]!==_0x128b22['state'][_0xfd4f('0x31')]()){this[_0xfd4f('0xb')][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x34')]=_[_0xfd4f('0x33')](moment()[_0xfd4f('0x2a')]('x'));}this[_0xfd4f('0xb')][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x26')]=_0x128b22[_0xfd4f('0x26')]['toLowerCase']();logger[_0xfd4f('0x23')](_0xfd4f('0x38'),util['inspect'](this[_0xfd4f('0xb')][_0x128b22[_0xfd4f('0x2e')]],{'showHidden':![],'depth':null}));this[_0xfd4f('0x1e')](util['format'](_0xfd4f('0x2b'),this['trunks'][_0x128b22[_0xfd4f('0x2e')]][_0xfd4f('0x36')]),_0xfd4f('0x2c'),this[_0xfd4f('0xb')][_0x128b22[_0xfd4f('0x2e')]]);}else if(_[_0xfd4f('0x39')](_0x128b22[_0xfd4f('0x2e')],_0xfd4f('0x3a'))){var _0x49497d=_0x128b22[_0xfd4f('0x2e')];var _0x4d02d2=_0x49497d[_0xfd4f('0x3b')](_0x49497d[_0xfd4f('0x3c')]('/')+0x1,_0x49497d[_0xfd4f('0x3c')]('@'));var _0x45b7ea=_[_0xfd4f('0x3d')](this[_0xfd4f('0xc')],function(_0x2fb327){return _0x2fb327[_0xfd4f('0x3e')]==_0x4d02d2||_0x2fb327[_0xfd4f('0x3f')]==_0x4d02d2||_0x2fb327[_0xfd4f('0x40')]==_0x4d02d2;});if(_0x45b7ea){if(_0x45b7ea[_0xfd4f('0x26')]!==_0x128b22[_0xfd4f('0x26')][_0xfd4f('0x31')]()){_0x45b7ea['stateTime']=_[_0xfd4f('0x33')](moment()['format']('x'));}_0x45b7ea[_0xfd4f('0x26')]=_0x128b22[_0xfd4f('0x26')][_0xfd4f('0x31')]();_0x45b7ea[_0xfd4f('0x30')]=!![];_0x45b7ea['updateStatusRealtime'](_0x128b22);}}}}catch(_0x52f6fb){logger['error'](_0xfd4f('0x2f'),util[_0xfd4f('0x19')](_0x52f6fb,{'showHidden':![],'depth':null}));}};UserReport[_0xfd4f('0x1a')][_0xfd4f('0x41')]=function(_0x571de6){try{if(this[_0xfd4f('0x1c')](_0x571de6)&&this['isNotNull'](_0x571de6[_0xfd4f('0x10')])){logger[_0xfd4f('0x20')](_0xfd4f('0x42'),_0x571de6[_0xfd4f('0x43')],_0x571de6['address'],_0x571de6[_0xfd4f('0x10')]);logger['debug']('[userReport][peerstatus]',util['inspect'](_0x571de6,{'showHidden':![],'depth':null}));if(this['agents'][_0x571de6[_0xfd4f('0x43')]]){if(!this[_0xfd4f('0xc')][_0x571de6[_0xfd4f('0x43')]][_0xfd4f('0x30')]||_0x571de6[_0xfd4f('0x10')][_0xfd4f('0x31')]()==_0xfd4f('0x44')){this[_0xfd4f('0xc')][_0x571de6['peer']][_0xfd4f('0x30')]=![];this[_0xfd4f('0xc')][_0x571de6[_0xfd4f('0x43')]][_0xfd4f('0x45')]=_0x571de6[_0xfd4f('0x10')][_0xfd4f('0x31')]();this[_0xfd4f('0xc')][_0x571de6[_0xfd4f('0x43')]]['address']=_0x571de6[_0xfd4f('0x46')];this['agents'][_0x571de6[_0xfd4f('0x43')]][_0xfd4f('0x47')](_0x571de6);}}else if(this[_0xfd4f('0xd')][_0x571de6[_0xfd4f('0x43')]]){this['telephones'][_0x571de6['peer']][_0xfd4f('0x45')]=_0x571de6[_0xfd4f('0x10')][_0xfd4f('0x31')]();this[_0xfd4f('0xd')][_0x571de6[_0xfd4f('0x43')]][_0xfd4f('0x46')]=_0x571de6[_0xfd4f('0x46')];logger[_0xfd4f('0x23')](_0xfd4f('0x48'),util[_0xfd4f('0x19')](this[_0xfd4f('0xd')][_0x571de6['peer']],{'showHidden':![],'depth':null}));this[_0xfd4f('0x1e')](util[_0xfd4f('0x2a')](_0xfd4f('0x35'),this[_0xfd4f('0xd')][_0x571de6['peer']][_0xfd4f('0x36')]),_0xfd4f('0x37'),this[_0xfd4f('0xd')][_0x571de6['peer']]);}else if(this[_0xfd4f('0xb')][_0x571de6[_0xfd4f('0x43')]]){this['trunks'][_0x571de6[_0xfd4f('0x43')]][_0xfd4f('0x45')]=_0x571de6[_0xfd4f('0x10')][_0xfd4f('0x31')]();this[_0xfd4f('0xb')][_0x571de6['peer']][_0xfd4f('0x46')]=_0x571de6[_0xfd4f('0x46')];logger[_0xfd4f('0x23')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0xfd4f('0x19')](this[_0xfd4f('0xb')][_0x571de6[_0xfd4f('0x43')]],{'showHidden':![],'depth':null}));this[_0xfd4f('0x1e')](util[_0xfd4f('0x2a')]('trunk:%s',this[_0xfd4f('0xb')][_0x571de6[_0xfd4f('0x43')]][_0xfd4f('0x36')]),_0xfd4f('0x2c'),this[_0xfd4f('0xb')][_0x571de6[_0xfd4f('0x43')]]);}}}catch(_0x182c3a){logger['error'](_0xfd4f('0x49'),util[_0xfd4f('0x19')](_0x182c3a,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file +var _0x4d65=['[userReport][sipshowregistry]','[userReport][devicestatelist]','inspect','prototype','isUndefined','emit','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','username','[userReport][registry]','find','stateRegistry','merge','omit','event','actionid','state','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','debug','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','startsWith','Local','substring','indexOf','mobile','accountcode','peerstatus','peer','address','[userReport][peerstatus]','registered','status','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d65,0xc0));var _0x54d6=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0x4d65[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x54d6('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var BPromise=require(_0x54d6('0x1'));var config=require('../../../config/environment');var logger=require(_0x54d6('0x2'))(_0x54d6('0x3'));var ami=require(_0x54d6('0x4'));config[_0x54d6('0x5')]=_[_0x54d6('0x6')](config[_0x54d6('0x5')],{'host':_0x54d6('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x54d6('0x5')]));function UserReport(_0x45347c){this[_0x54d6('0x8')]=_0x45347c['trunks'];this[_0x54d6('0x9')]=_0x45347c[_0x54d6('0x9')];this[_0x54d6('0xa')]=_0x45347c[_0x54d6('0xa')];ami['on'](_0x54d6('0xb'),this[_0x54d6('0xc')]['bind'](this));ami['on'](_0x54d6('0xd'),this[_0x54d6('0xc')][_0x54d6('0xe')](this));ami['on'](_0x54d6('0xf'),this[_0x54d6('0x10')]['bind'](this));ami['on']('peerstatus',this[_0x54d6('0x11')][_0x54d6('0xe')](this));return this[_0x54d6('0x12')]();}function showSipRegistrations(){Promise[_0x54d6('0x13')]()[_0x54d6('0x14')](ami[_0x54d6('0x15')]())[_0x54d6('0x16')](function(_0x2458fa){logger[_0x54d6('0x17')](_0x54d6('0x18'),util['inspect'](_0x2458fa,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x54d6('0x13')]()[_0x54d6('0x14')](ami['actionDeviceStateList']())[_0x54d6('0x16')](function(_0x441e74){logger[_0x54d6('0x17')](_0x54d6('0x19'),util[_0x54d6('0x1a')](_0x441e74,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x54d6('0x13')]()[_0x54d6('0x14')](ami['actionSipPeerStatus']())['catch'](function(_0x3c395d){logger[_0x54d6('0x17')]('[userReport][sippeerstatus]',util['inspect'](_0x3c395d,{'showHidden':![],'depth':null}));});}UserReport[_0x54d6('0x1b')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x54d6('0x14')](showSipRegistrations())[_0x54d6('0x14')](listDeviceStates())[_0x54d6('0x14')](showPeersStatus());},0x32c8);};UserReport['prototype']['isNotNull']=function(_0x533eb3){return _0x533eb3!==null&&!_[_0x54d6('0x1c')](_0x533eb3);};UserReport[_0x54d6('0x1b')]['emit']=function(_0x124d02,_0x2b4d0b,_0x247ab8){io['to'](_0x124d02)[_0x54d6('0x1d')](_0x2b4d0b,_0x247ab8);};UserReport[_0x54d6('0x1b')][_0x54d6('0xc')]=function(_0x4b7eaa){try{if(this[_0x54d6('0x1e')](_0x4b7eaa)){logger['info'](_0x54d6('0x1f'),_0x4b7eaa[_0x54d6('0x20')],_0x4b7eaa['state']);logger['debug'](_0x54d6('0x21'),util['inspect'](_0x4b7eaa,{'showHidden':![],'depth':null}));var _0x4ecfde=_[_0x54d6('0x22')](this['trunks'],{'defaultuser':_0x4b7eaa[_0x54d6('0x20')]});if(_0x4ecfde){_0x4b7eaa[_0x54d6('0x23')]=_0x4b7eaa['state'];_[_0x54d6('0x24')](_0x4ecfde,_[_0x54d6('0x25')](_0x4b7eaa,[_0x54d6('0x26'),_0x54d6('0x27'),_0x54d6('0x20'),_0x54d6('0x28')]));logger['debug'](_0x54d6('0x29'),util[_0x54d6('0x1a')](_0x4ecfde,{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util[_0x54d6('0x2a')](_0x54d6('0x2b'),_0x4ecfde[_0x54d6('0x2c')]),_0x54d6('0x2d'),_0x4ecfde);}}}catch(_0xeeafde){logger[_0x54d6('0x17')](_0x54d6('0x21'),util['inspect'](_0xeeafde,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x378daa){try{if(this[_0x54d6('0x1e')](_0x378daa)){logger[_0x54d6('0x2e')](_0x54d6('0x2f'),_0x378daa[_0x54d6('0x30')],_0x378daa[_0x54d6('0x28')]);logger[_0x54d6('0x31')](_0x54d6('0x32'),util[_0x54d6('0x1a')](_0x378daa,{'showHidden':![],'depth':null}));if(this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]]){if(!this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x33')]||_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()==_0x54d6('0x35')){this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x33')]=![];if(this[_0x54d6('0x9')][_0x378daa['device']][_0x54d6('0x28')]!==_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()){this['agents'][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x36')]=_[_0x54d6('0x37')](moment()[_0x54d6('0x2a')]('x'));}this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x28')]=_0x378daa['state'][_0x54d6('0x34')]();this[_0x54d6('0x9')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x38')](_0x378daa);}}else if(this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]]){if(this['telephones'][_0x378daa[_0x54d6('0x30')]]['state']!==_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()){this['telephones'][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x36')]=_['toNumber'](moment()['format']('x'));}this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]]['state']=_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]();logger[_0x54d6('0x31')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util['inspect'](this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x54d6('0x39'),this[_0x54d6('0xa')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x2c')]),'telephone:save',this[_0x54d6('0xa')][_0x378daa['device']]);}else if(this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]]){if(this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x28')]!==_0x378daa[_0x54d6('0x28')][_0x54d6('0x34')]()){this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x36')]=_['toNumber'](moment()[_0x54d6('0x2a')]('x'));}this[_0x54d6('0x8')][_0x378daa[_0x54d6('0x30')]][_0x54d6('0x28')]=_0x378daa[_0x54d6('0x28')]['toLowerCase']();logger[_0x54d6('0x31')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x378daa[_0x54d6('0x30')]],{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util[_0x54d6('0x2a')](_0x54d6('0x2b'),this['trunks'][_0x378daa['device']][_0x54d6('0x2c')]),_0x54d6('0x2d'),this[_0x54d6('0x8')][_0x378daa['device']]);}else if(_[_0x54d6('0x3a')](_0x378daa[_0x54d6('0x30')],_0x54d6('0x3b'))){var _0x7b462=_0x378daa[_0x54d6('0x30')];var _0xc04f12=_0x7b462[_0x54d6('0x3c')](_0x7b462[_0x54d6('0x3d')]('/')+0x1,_0x7b462[_0x54d6('0x3d')]('@'));var _0x2736e3=_[_0x54d6('0x22')](this[_0x54d6('0x9')],function(_0x1aeb47){return _0x1aeb47[_0x54d6('0x3e')]==_0xc04f12||_0x1aeb47['phone']==_0xc04f12||_0x1aeb47[_0x54d6('0x3f')]==_0xc04f12;});if(_0x2736e3){if(_0x2736e3[_0x54d6('0x28')]!==_0x378daa[_0x54d6('0x28')]['toLowerCase']()){_0x2736e3[_0x54d6('0x36')]=_[_0x54d6('0x37')](moment()[_0x54d6('0x2a')]('x'));}_0x2736e3[_0x54d6('0x28')]=_0x378daa['state'][_0x54d6('0x34')]();_0x2736e3[_0x54d6('0x33')]=!![];_0x2736e3[_0x54d6('0x38')](_0x378daa);}}}}catch(_0x118ed9){logger['error'](_0x54d6('0x32'),util[_0x54d6('0x1a')](_0x118ed9,{'showHidden':![],'depth':null}));}};UserReport[_0x54d6('0x1b')][_0x54d6('0x11')]=function(_0x44b6b0){try{if(this[_0x54d6('0x1e')](_0x44b6b0)&&this['isNotNull'](_0x44b6b0[_0x54d6('0x40')])){logger[_0x54d6('0x2e')]('[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s',_0x44b6b0[_0x54d6('0x41')],_0x44b6b0[_0x54d6('0x42')],_0x44b6b0[_0x54d6('0x40')]);logger['debug'](_0x54d6('0x43'),util[_0x54d6('0x1a')](_0x44b6b0,{'showHidden':![],'depth':null}));if(this[_0x54d6('0x9')][_0x44b6b0[_0x54d6('0x41')]]){if(!this[_0x54d6('0x9')][_0x44b6b0['peer']][_0x54d6('0x33')]||_0x44b6b0['peerstatus']['toLowerCase']()==_0x54d6('0x44')){this['agents'][_0x44b6b0[_0x54d6('0x41')]]['local']=![];this[_0x54d6('0x9')][_0x44b6b0['peer']][_0x54d6('0x45')]=_0x44b6b0[_0x54d6('0x40')]['toLowerCase']();this[_0x54d6('0x9')][_0x44b6b0[_0x54d6('0x41')]]['address']=_0x44b6b0[_0x54d6('0x42')];this[_0x54d6('0x9')][_0x44b6b0[_0x54d6('0x41')]]['updateStatusRealtime'](_0x44b6b0);}}else if(this[_0x54d6('0xa')][_0x44b6b0[_0x54d6('0x41')]]){this[_0x54d6('0xa')][_0x44b6b0[_0x54d6('0x41')]][_0x54d6('0x45')]=_0x44b6b0[_0x54d6('0x40')]['toLowerCase']();this[_0x54d6('0xa')][_0x44b6b0[_0x54d6('0x41')]]['address']=_0x44b6b0[_0x54d6('0x42')];logger[_0x54d6('0x31')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0x54d6('0x1a')](this['telephones'][_0x44b6b0[_0x54d6('0x41')]],{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util[_0x54d6('0x2a')]('telephone:%s',this[_0x54d6('0xa')][_0x44b6b0['peer']][_0x54d6('0x2c')]),'telephone:save',this['telephones'][_0x44b6b0[_0x54d6('0x41')]]);}else if(this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]){this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]][_0x54d6('0x45')]=_0x44b6b0['peerstatus'][_0x54d6('0x34')]();this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]['address']=_0x44b6b0[_0x54d6('0x42')];logger[_0x54d6('0x31')](_0x54d6('0x46'),util[_0x54d6('0x1a')](this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]],{'showHidden':![],'depth':null}));this[_0x54d6('0x1d')](util['format']('trunk:%s',this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]['name']),_0x54d6('0x2d'),this[_0x54d6('0x8')][_0x44b6b0[_0x54d6('0x41')]]);}}}catch(_0x40d366){logger[_0x54d6('0x17')](_0x54d6('0x43'),util[_0x54d6('0x1a')](_0x40d366,{'showHidden':![],'depth':null}));}};module[_0x54d6('0x47')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index e018b88..ad4333b 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 _0x9cdb=['diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','defaults','redis','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStop','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','inspect','format','called','queue','mandatoryDisposition','type','merge','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','YYYY-MM-DD\x20HH:mm:ss','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','interface','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','lastevent','reason','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%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:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','agentcompleteAt','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cdb,0x142));var _0xb9cd=function(_0x2b98d4,_0x1de753){_0x2b98d4=_0x2b98d4-0x0;var _0x76ce5b=_0x9cdb[_0x2b98d4];return _0x76ce5b;};'use strict';var _=require(_0xb9cd('0x0'));var moment=require(_0xb9cd('0x1'));var util=require('util');var Redis=require(_0xb9cd('0x2'));var config=require(_0xb9cd('0x3'));var logger=require(_0xb9cd('0x4'))('ami');var ami=require('../ami');config['redis']=_[_0xb9cd('0x5')](config[_0xb9cd('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xb9cd('0x7'))(new Redis(config[_0xb9cd('0x6')]));function VoiceAgentReport(_0x52ae07){this[_0xb9cd('0x8')]={};this['voiceChannels']=_0x52ae07['channels'];this[_0xb9cd('0x9')]=_0x52ae07['voiceQueues'];this[_0xb9cd('0xa')]=_0x52ae07[_0xb9cd('0xa')];this[_0xb9cd('0xb')]={};ami['on'](_0xb9cd('0xc'),this[_0xb9cd('0xd')]['bind'](this));ami['on'](_0xb9cd('0xe'),this[_0xb9cd('0xf')][_0xb9cd('0x10')](this));ami['on'](_0xb9cd('0x11'),this[_0xb9cd('0x12')]['bind'](this));ami['on'](_0xb9cd('0x13'),this[_0xb9cd('0x14')][_0xb9cd('0x10')](this));ami['on'](_0xb9cd('0x15'),this['syncAgentComplete'][_0xb9cd('0x10')](this));ami['on'](_0xb9cd('0x16'),this[_0xb9cd('0x17')][_0xb9cd('0x10')](this));ami['on']('hangup',this[_0xb9cd('0x18')][_0xb9cd('0x10')](this));ami['on'](_0xb9cd('0x19'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this[_0xb9cd('0x1a')][_0xb9cd('0x10')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xb9cd('0x10')](this));ami['on'](_0xb9cd('0x1b'),this[_0xb9cd('0x1c')][_0xb9cd('0x10')](this));}VoiceAgentReport[_0xb9cd('0x1d')]['emit']=function(_0x4b1f19,_0x2c0e44,_0x4511b7){io['to'](_0x4b1f19)[_0xb9cd('0x1e')](_0x2c0e44,_0x4511b7);};VoiceAgentReport['prototype'][_0xb9cd('0x1f')]=function(_0x1c39a1){return _0x1c39a1!==null&&!_[_0xb9cd('0x20')](_0x1c39a1);};VoiceAgentReport[_0xb9cd('0x1d')]['syncAgentCalled']=function(_0xc2dc40){try{if(this[_0xb9cd('0x1f')](_0xc2dc40)){logger[_0xb9cd('0x21')](_0xb9cd('0x22'),_0xc2dc40[_0xb9cd('0x23')],_0xc2dc40[_0xb9cd('0x24')],_0xc2dc40[_0xb9cd('0x25')]);logger[_0xb9cd('0x26')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0xc2dc40['uniqueid'],util[_0xb9cd('0x27')](_0xc2dc40,{'showHidden':![],'depth':null}));if(_[_0xb9cd('0x20')](this[_0xb9cd('0x8')][_0xc2dc40['uniqueid']])){this[_0xb9cd('0x8')][_0xc2dc40[_0xb9cd('0x23')]]={};}if(_['isUndefined'](this[_0xb9cd('0x8')][_0xc2dc40[_0xb9cd('0x23')]][_0xc2dc40[_0xb9cd('0x25')]])){this['channels'][_0xc2dc40[_0xb9cd('0x23')]][_0xc2dc40[_0xb9cd('0x25')]]={'agentcalledAt':moment()[_0xb9cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xb9cd('0x29'),'mandatoryDisposition':this[_0xb9cd('0x9')][_0xc2dc40[_0xb9cd('0x2a')]]?this[_0xb9cd('0x9')][_0xc2dc40['queue']][_0xb9cd('0x2b')]||![]:![],'type':this[_0xb9cd('0x9')][_0xc2dc40[_0xb9cd('0x2a')]]?this[_0xb9cd('0x9')][_0xc2dc40[_0xb9cd('0x2a')]][_0xb9cd('0x2c')]||'inbound':'inbound','variables':this['variables'][_0xc2dc40[_0xb9cd('0x23')]],'motionChannel':'voice'};}_[_0xb9cd('0x2d')](this['channels'][_0xc2dc40[_0xb9cd('0x23')]][_0xc2dc40[_0xb9cd('0x25')]],_[_0xb9cd('0x2e')](_0xc2dc40,['event',_0xb9cd('0x2f')]));logger[_0xb9cd('0x26')](_0xb9cd('0x30'),_0xc2dc40[_0xb9cd('0x23')],util[_0xb9cd('0x27')](this[_0xb9cd('0x8')][_0xc2dc40[_0xb9cd('0x23')]][_0xc2dc40[_0xb9cd('0x25')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcalled',this[_0xb9cd('0x8')][_0xc2dc40[_0xb9cd('0x23')]][_0xc2dc40[_0xb9cd('0x25')]]);logger[_0xb9cd('0x26')](_0xb9cd('0x31'),_0xc2dc40['uniqueid'],util['inspect'](this[_0xb9cd('0x8')][_0xc2dc40['uniqueid']][_0xc2dc40[_0xb9cd('0x25')]],{'showHidden':![],'depth':null}));this[_0xb9cd('0x1e')](util[_0xb9cd('0x28')](_0xb9cd('0x32'),_0xc2dc40[_0xb9cd('0x24')]),'user:called',this[_0xb9cd('0x8')][_0xc2dc40['uniqueid']][_0xc2dc40[_0xb9cd('0x25')]]);}}catch(_0x54a851){logger['error']('[%s][voiceAgentReport][agentcalled]',_0xc2dc40['uniqueid'],util['inspect'](_0x54a851,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb9cd('0xf')]=function(_0x48ec94){try{if(this[_0xb9cd('0x1f')](_0x48ec94)){if(this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]]){logger[_0xb9cd('0x26')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x48ec94[_0xb9cd('0x23')],util['inspect'](_0x48ec94,{'showHidden':![],'depth':null}));for(var _0x3c64d9 in this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]]){if(this['channels'][_0x48ec94['uniqueid']][_0xb9cd('0x33')](_0x3c64d9)){if(_0x48ec94[_0xb9cd('0x25')]===_0x3c64d9){logger[_0xb9cd('0x21')](_0xb9cd('0x34'),_0x48ec94[_0xb9cd('0x23')],_0x48ec94['membername'],_0x48ec94[_0xb9cd('0x25')]);this[_0xb9cd('0x8')][_0x48ec94['uniqueid']][_0x3c64d9]['agentconnectAt']=moment()[_0xb9cd('0x28')](_0xb9cd('0x35'));this[_0xb9cd('0x8')][_0x48ec94['uniqueid']][_0x3c64d9][_0xb9cd('0x36')]=_0x48ec94['connectedlinename'];this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9]['connectedlinenum']=_0x48ec94[_0xb9cd('0x37')];this[_0xb9cd('0x8')][_0x48ec94['uniqueid']][_0x3c64d9][_0xb9cd('0x38')]=_0x48ec94[_0xb9cd('0x38')];this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9][_0xb9cd('0x39')]=_0x48ec94[_0xb9cd('0x39')];this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9][_0xb9cd('0x3a')]=_0x48ec94[_0xb9cd('0x3a')];this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9]['lastevent']=_0xb9cd('0x3b');if(this[_0xb9cd('0x3c')][this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9][_0xb9cd('0x23')]]){var _0x4adc75=this[_0xb9cd('0x3c')][this['channels'][_0x48ec94['uniqueid']][_0x3c64d9][_0xb9cd('0x23')]]['routealias'];this['channels'][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9]['routealias']=_0x4adc75;_0x48ec94[_0xb9cd('0x3d')]=_0x4adc75;}_[_0xb9cd('0x2d')](this[_0xb9cd('0xa')][_0x48ec94[_0xb9cd('0x3e')]],_['pick'](_0x48ec94,[_0xb9cd('0x2a'),_0xb9cd('0x3f'),'routealias']));logger[_0xb9cd('0x26')](_0xb9cd('0x40'),_0x48ec94[_0xb9cd('0x23')],util['inspect'](this['channels'][_0x48ec94[_0xb9cd('0x23')]][_0x48ec94[_0xb9cd('0x25')]],{'showHidden':![],'depth':null}));ami[_0xb9cd('0x1e')](_0xb9cd('0x41'),this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x48ec94[_0xb9cd('0x25')]]);logger[_0xb9cd('0x26')](_0xb9cd('0x42'),_0x48ec94[_0xb9cd('0x23')],util['inspect'](this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x48ec94[_0xb9cd('0x25')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xb9cd('0x28')](_0xb9cd('0x32'),_0x48ec94['membername']),_0xb9cd('0x43'),this['channels'][_0x48ec94['uniqueid']][_0x48ec94[_0xb9cd('0x25')]]);}else if(!this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9][_0xb9cd('0x11')]&&!this['channels'][_0x48ec94['uniqueid']][_0x3c64d9]['agentcomplete']){logger[_0xb9cd('0x21')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x48ec94[_0xb9cd('0x23')],this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9]['membername'],_0x3c64d9);this[_0xb9cd('0x8')][_0x48ec94['uniqueid']][_0x3c64d9]['agentringnoanswer']=!![];this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9][_0xb9cd('0x44')]=moment()['format'](_0xb9cd('0x35'));this['channels'][_0x48ec94['uniqueid']][_0x3c64d9][_0xb9cd('0x45')]=_0x48ec94[_0xb9cd('0x25')];this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9]['answeredelsewheremembername']=_0x48ec94[_0xb9cd('0x24')];this[_0xb9cd('0x8')][_0x48ec94['uniqueid']][_0x3c64d9][_0xb9cd('0x46')]='answered_elsewhere';this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9][_0xb9cd('0x47')]=_0xb9cd('0x48');logger['debug']('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x48ec94['uniqueid'],util[_0xb9cd('0x27')](this[_0xb9cd('0x8')][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9],{'showHidden':![],'depth':null}));ami[_0xb9cd('0x1e')](_0xb9cd('0x49'),this['channels'][_0x48ec94[_0xb9cd('0x23')]][_0x3c64d9]);}}}}}}catch(_0x29afac){logger['error'](_0xb9cd('0x4a'),_0x48ec94['uniqueid'],util[_0xb9cd('0x27')](_0x29afac,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb9cd('0x12')]=function(_0x514e67){try{if(this[_0xb9cd('0x1f')](_0x514e67)){logger[_0xb9cd('0x26')](_0xb9cd('0x4b'),_0x514e67[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x514e67,{'showHidden':![],'depth':null}));if(this[_0xb9cd('0x8')][_0x514e67[_0xb9cd('0x23')]]&&this[_0xb9cd('0x8')][_0x514e67[_0xb9cd('0x23')]][_0x514e67[_0xb9cd('0x25')]]){logger[_0xb9cd('0x21')](_0xb9cd('0x4c'),_0x514e67[_0xb9cd('0x23')],_0x514e67['membername'],_0x514e67['destuniqueid']);this[_0xb9cd('0x8')][_0x514e67['uniqueid']][_0x514e67['destuniqueid']][_0xb9cd('0x11')]=!![];this[_0xb9cd('0x8')][_0x514e67[_0xb9cd('0x23')]][_0x514e67[_0xb9cd('0x25')]][_0xb9cd('0x44')]=moment()[_0xb9cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x514e67[_0xb9cd('0x23')]][_0x514e67[_0xb9cd('0x25')]][_0xb9cd('0x46')]='rejected';this['channels'][_0x514e67['uniqueid']][_0x514e67['destuniqueid']][_0xb9cd('0x47')]=_0xb9cd('0x4d');logger['debug'](_0xb9cd('0x4e'),_0x514e67[_0xb9cd('0x23')],util[_0xb9cd('0x27')](this[_0xb9cd('0x8')][_0x514e67[_0xb9cd('0x23')]][_0x514e67[_0xb9cd('0x25')]],{'showHidden':![],'depth':null}));ami[_0xb9cd('0x1e')](_0xb9cd('0x4f'),this[_0xb9cd('0x8')][_0x514e67['uniqueid']][_0x514e67[_0xb9cd('0x25')]]);}}}catch(_0x4b6732){logger[_0xb9cd('0x50')](_0xb9cd('0x51'),_0x514e67[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x4b6732,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb9cd('0x1d')]['syncQueueCallerAbandon']=function(_0x13597c){try{if(this[_0xb9cd('0x1f')](_0x13597c)){logger[_0xb9cd('0x26')](_0xb9cd('0x52'),_0x13597c[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x13597c,{'showHidden':![],'depth':null}));if(this[_0xb9cd('0x8')][_0x13597c['uniqueid']]){for(var _0xd28e1c in this[_0xb9cd('0x8')][_0x13597c[_0xb9cd('0x23')]]){if(this['channels'][_0x13597c[_0xb9cd('0x23')]][_0xb9cd('0x33')](_0xd28e1c)&&!this[_0xb9cd('0x8')][_0x13597c[_0xb9cd('0x23')]][_0xd28e1c][_0xb9cd('0x11')]&&!this[_0xb9cd('0x8')][_0x13597c[_0xb9cd('0x23')]][_0xd28e1c]['agentcomplete']){logger[_0xb9cd('0x21')](_0xb9cd('0x53'),_0x13597c[_0xb9cd('0x23')],this[_0xb9cd('0x8')][_0x13597c[_0xb9cd('0x23')]][_0xd28e1c][_0xb9cd('0x24')],_0xd28e1c);this[_0xb9cd('0x8')][_0x13597c[_0xb9cd('0x23')]][_0xd28e1c][_0xb9cd('0x11')]=!![];this[_0xb9cd('0x8')][_0x13597c['uniqueid']][_0xd28e1c][_0xb9cd('0x44')]=moment()[_0xb9cd('0x28')](_0xb9cd('0x35'));this[_0xb9cd('0x8')][_0x13597c['uniqueid']][_0xd28e1c]['lastevent']=_0xb9cd('0x54');this[_0xb9cd('0x8')][_0x13597c[_0xb9cd('0x23')]][_0xd28e1c][_0xb9cd('0x47')]=_0xb9cd('0x54');logger[_0xb9cd('0x26')](_0xb9cd('0x55'),_0x13597c[_0xb9cd('0x23')],util[_0xb9cd('0x27')](this[_0xb9cd('0x8')][_0x13597c[_0xb9cd('0x23')]][_0xd28e1c],{'showHidden':![],'depth':null}));ami[_0xb9cd('0x1e')]('custom:agentqueuecallerabandon',this['channels'][_0x13597c[_0xb9cd('0x23')]][_0xd28e1c]);}}}}}catch(_0x3e3056){logger[_0xb9cd('0x50')](_0xb9cd('0x56'),_0x13597c['uniqueid'],util[_0xb9cd('0x27')](_0x3e3056,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb9cd('0x1d')][_0xb9cd('0x57')]=function(_0x59eebe){try{if(this['isNotNull'](_0x59eebe)){logger[_0xb9cd('0x26')](_0xb9cd('0x58'),_0x59eebe[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x59eebe,{'showHidden':![],'depth':null}));if(this[_0xb9cd('0x8')][_0x59eebe[_0xb9cd('0x23')]]){for(var _0x451969 in this['channels'][_0x59eebe[_0xb9cd('0x23')]]){if(this[_0xb9cd('0x8')][_0x59eebe[_0xb9cd('0x23')]][_0xb9cd('0x33')](_0x451969)){if(this[_0xb9cd('0x8')][_0x59eebe[_0xb9cd('0x23')]][_0x451969][_0xb9cd('0x59')]&&!this[_0xb9cd('0x8')][_0x59eebe['uniqueid']][_0x451969][_0xb9cd('0x15')]){logger[_0xb9cd('0x21')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x59eebe[_0xb9cd('0x23')],this['channels'][_0x59eebe['uniqueid']][_0x451969]['membername'],_0x451969);this[_0xb9cd('0x8')][_0x59eebe[_0xb9cd('0x23')]][_0x451969][_0xb9cd('0x15')]=!![];this[_0xb9cd('0x8')][_0x59eebe['uniqueid']][_0x451969][_0xb9cd('0x5a')]=moment()['format'](_0xb9cd('0x35'));this['channels'][_0x59eebe[_0xb9cd('0x23')]][_0x451969][_0xb9cd('0x46')]='complete';this['channels'][_0x59eebe['uniqueid']][_0x451969][_0xb9cd('0x47')]=_0x59eebe[_0xb9cd('0x47')]==_0xb9cd('0x5b')?_0xb9cd('0x5c'):_0x59eebe['reason'];this['channels'][_0x59eebe[_0xb9cd('0x23')]][_0x451969][_0xb9cd('0x5d')]=_0x59eebe[_0xb9cd('0x5d')];if(this['voiceQueues'][_0x59eebe[_0xb9cd('0x2a')]]&&this[_0xb9cd('0x9')][_0x59eebe[_0xb9cd('0x2a')]][_0xb9cd('0x5e')]){this[_0xb9cd('0x8')][_0x59eebe[_0xb9cd('0x23')]][_0x451969][_0xb9cd('0x5f')]=this[_0xb9cd('0x9')][_0x59eebe[_0xb9cd('0x2a')]][_0xb9cd('0x60')];this[_0xb9cd('0x8')][_0x59eebe[_0xb9cd('0x23')]][_0x451969][_0xb9cd('0x61')]=!![];}this[_0xb9cd('0xa')][_0x59eebe[_0xb9cd('0x3e')]]=_['omit'](this[_0xb9cd('0xa')][_0x59eebe[_0xb9cd('0x3e')]],[_0xb9cd('0x2a'),_0xb9cd('0x3f')]);logger['debug'](_0xb9cd('0x62'),_0x59eebe[_0xb9cd('0x23')],util[_0xb9cd('0x27')](this['channels'][_0x59eebe[_0xb9cd('0x23')]][_0x451969],{'showHidden':![],'depth':null}));ami[_0xb9cd('0x1e')](_0xb9cd('0x63'),this['channels'][_0x59eebe['uniqueid']][_0x451969]);logger['debug'](_0xb9cd('0x64'),_0x59eebe[_0xb9cd('0x23')],util[_0xb9cd('0x27')](this[_0xb9cd('0x8')][_0x59eebe['uniqueid']][_0x451969],{'showHidden':![],'depth':null}));this[_0xb9cd('0x1e')](util['format'](_0xb9cd('0x32'),_0x59eebe['membername']),_0xb9cd('0x65'),this['channels'][_0x59eebe[_0xb9cd('0x23')]][_0x451969]);}}}}}}catch(_0x5a9f0c){logger[_0xb9cd('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x59eebe[_0xb9cd('0x23')],util['inspect'](_0x5a9f0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb9cd('0x1d')]['syncVarSet']=function(_0x191d82){try{if(this[_0xb9cd('0x1f')](_0x191d82)){logger['debug'](_0xb9cd('0x66'),_0x191d82[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x191d82,{'showHidden':![],'depth':null}));this[_0xb9cd('0x67')](_0x191d82[_0xb9cd('0x23')],_[_0xb9cd('0x68')](_0x191d82[_0xb9cd('0x69')])[0x0],_0x191d82['value']);if(this['channels'][_0x191d82['uniqueid']]){for(var _0x22af1b in this[_0xb9cd('0x8')][_0x191d82[_0xb9cd('0x23')]]){if(this[_0xb9cd('0x8')][_0x191d82[_0xb9cd('0x23')]]['hasOwnProperty'](_0x22af1b)){logger[_0xb9cd('0x21')](_0xb9cd('0x6a'),_0x191d82['uniqueid'],_0x22af1b,_['keys'](_0x191d82['variable'])[0x0],_0x191d82[_0xb9cd('0x6b')]);if(_[_0xb9cd('0x20')](this[_0xb9cd('0x8')][_0x191d82[_0xb9cd('0x23')]][_0x22af1b][_0xb9cd('0xb')])){this[_0xb9cd('0x8')][_0x191d82['uniqueid']][_0x22af1b][_0xb9cd('0xb')]={};}this[_0xb9cd('0x8')][_0x191d82[_0xb9cd('0x23')]][_0x22af1b][_0xb9cd('0xb')]=this[_0xb9cd('0xb')][_0x191d82['uniqueid']];}}}}}catch(_0x482189){logger[_0xb9cd('0x50')](_0xb9cd('0x6c'),_0x191d82[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x482189,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb9cd('0x1d')][_0xb9cd('0x67')]=function(_0x5c2b50,_0x5c2395,_0x4c98ae){var _0x552fe4=['rtpaudioqos',_0xb9cd('0x6d'),'rtpaudioqosjitter',_0xb9cd('0x6e'),_0xb9cd('0x6f'),_0xb9cd('0x70'),_0xb9cd('0x71'),_0xb9cd('0x72'),_0xb9cd('0x73'),_0xb9cd('0x74'),'bridgepeer',_0xb9cd('0x75'),_0xb9cd('0x76'),_0xb9cd('0x77'),'memberinterface',_0xb9cd('0x78'),_0xb9cd('0x24'),_0xb9cd('0x79'),'memberrealtime'];if(!_['isNil'](_0x5c2395)&&!_[_0xb9cd('0x7a')](_0x552fe4,_0x5c2395)){if(_['isUndefined'](this[_0xb9cd('0xb')][_0x5c2b50])){this[_0xb9cd('0xb')][_0x5c2b50]={};}this[_0xb9cd('0xb')][_0x5c2b50][_0x5c2395]=_0x4c98ae;}};VoiceAgentReport[_0xb9cd('0x1d')]['syncHangup']=function(_0x8d4563){try{if(this['isNotNull'](_0x8d4563)){logger[_0xb9cd('0x26')](_0xb9cd('0x7b'),_0x8d4563[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x8d4563,{'showHidden':![],'depth':null}));if(this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]]){for(var _0x1ce39e in this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]]){if(this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]][_0xb9cd('0x33')](_0x1ce39e)){if(this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]][_0x1ce39e]['reason']==_0xb9cd('0x5b')&&this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]][_0x1ce39e][_0xb9cd('0x15')]){logger['info'](_0xb9cd('0x7c'),_0x8d4563[_0xb9cd('0x23')],_0x1ce39e);this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]][_0x1ce39e]['agentcompleteAt']=moment()[_0xb9cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0xb9cd('0x26')](_0xb9cd('0x7d'),_0x8d4563[_0xb9cd('0x23')],util['inspect'](_[_0xb9cd('0x7e')](this['channels'][_0x8d4563[_0xb9cd('0x23')]]),{'showHidden':![],'depth':null}));ami[_0xb9cd('0x1e')](_0xb9cd('0x7f'),_[_0xb9cd('0x7e')](this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]]));delete this[_0xb9cd('0x8')][_0x8d4563[_0xb9cd('0x23')]];}if(this[_0xb9cd('0xb')][_0x8d4563[_0xb9cd('0x23')]]){delete this[_0xb9cd('0xb')][_0x8d4563[_0xb9cd('0x23')]];}}}catch(_0x2b1629){logger[_0xb9cd('0x50')](_0xb9cd('0x80'),_0x8d4563['uniqueid'],util[_0xb9cd('0x27')](_0x2b1629,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb9cd('0x1d')][_0xb9cd('0x81')]=function(_0x5e8189){try{if(this[_0xb9cd('0x1f')](_0x5e8189)){logger[_0xb9cd('0x26')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x5e8189[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x5e8189,{'showHidden':![],'depth':null}));if(this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]]){for(var _0xcc53f4 in this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]]){if(this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]]['hasOwnProperty'](_0xcc53f4)){if(_0x5e8189[_0xb9cd('0x83')]===_0xcc53f4){logger[_0xb9cd('0x21')](_0xb9cd('0x84'),_0x5e8189['uniqueid'],this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]][_0xcc53f4]['membername'],_0xcc53f4);var _0x5cdc1c=moment();this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]][_0xcc53f4][_0xb9cd('0x15')]=!![];this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]][_0xcc53f4][_0xb9cd('0x5a')]=moment()[_0xb9cd('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]][_0xcc53f4][_0xb9cd('0x46')]=_0xb9cd('0x85');this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]][_0xcc53f4]['reason']='transfer';this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x82')]][_0xcc53f4][_0xb9cd('0x5d')]=_0x5cdc1c[_0xb9cd('0x86')](this[_0xb9cd('0x8')][_0x5e8189['transfereeuniqueid']][_0xcc53f4][_0xb9cd('0x59')],_0xb9cd('0x87'));}}}}if(this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x88')]]){var _0x411475=this[_0xb9cd('0x8')][_0x5e8189[_0xb9cd('0x88')]];this[_0xb9cd('0x8')][_0x5e8189['secondtransfereruniqueid']]=this['channels'][_0x5e8189[_0xb9cd('0x82')]];this['channels'][_0x5e8189['transfereeuniqueid']]=_0x411475;}}}catch(_0x45222e){logger[_0xb9cd('0x50')](_0xb9cd('0x89'),_0x5e8189[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x45222e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb9cd('0x1d')][_0xb9cd('0x1c')]=function(_0x5b78e8){try{if(this['isNotNull'](_0x5b78e8)){logger[_0xb9cd('0x26')](_0xb9cd('0x8a'),_0x5b78e8['uniqueid'],util[_0xb9cd('0x27')](_0x5b78e8,{'showHidden':![],'depth':null}));if(this[_0xb9cd('0x8')][_0x5b78e8['transfereeuniqueid']]){for(var _0x3a1ea4 in this[_0xb9cd('0x8')][_0x5b78e8[_0xb9cd('0x82')]]){if(this['channels'][_0x5b78e8[_0xb9cd('0x82')]][_0xb9cd('0x33')](_0x3a1ea4)){if(_0x5b78e8[_0xb9cd('0x8b')]===_0x3a1ea4){logger[_0xb9cd('0x21')](_0xb9cd('0x8c'),_0x5b78e8[_0xb9cd('0x23')],this[_0xb9cd('0x8')][_0x5b78e8['transfereeuniqueid']][_0x3a1ea4][_0xb9cd('0x24')],_0x3a1ea4);var _0x2c2269=moment();this[_0xb9cd('0x8')][_0x5b78e8[_0xb9cd('0x82')]][_0x3a1ea4][_0xb9cd('0x15')]=!![];this[_0xb9cd('0x8')][_0x5b78e8['transfereeuniqueid']][_0x3a1ea4][_0xb9cd('0x5a')]=_0x2c2269;this[_0xb9cd('0x8')][_0x5b78e8[_0xb9cd('0x82')]][_0x3a1ea4][_0xb9cd('0x46')]=_0xb9cd('0x85');this[_0xb9cd('0x8')][_0x5b78e8[_0xb9cd('0x82')]][_0x3a1ea4]['reason']=_0xb9cd('0x5b');this[_0xb9cd('0x8')][_0x5b78e8['transfereeuniqueid']][_0x3a1ea4][_0xb9cd('0x5d')]=_0x2c2269['diff'](this[_0xb9cd('0x8')][_0x5b78e8['transfereeuniqueid']][_0x3a1ea4][_0xb9cd('0x59')],_0xb9cd('0x87'));}}}}}}catch(_0x352f9c){logger[_0xb9cd('0x50')](_0xb9cd('0x8d'),_0x5b78e8[_0xb9cd('0x23')],util['inspect'](_0x352f9c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x5bab38){var _0x4ed589='';try{if(this['isNotNull'](_0x5bab38)){logger[_0xb9cd('0x26')](_0xb9cd('0x8e'),_0x5bab38['uniqueid'],util[_0xb9cd('0x27')](_0x5bab38,{'showHidden':![],'depth':null}));if(_0x5bab38['channel']){_0x4ed589=_0x5bab38['channel']['substring'](0x0,_0x5bab38[_0xb9cd('0x8f')][_0xb9cd('0x90')]('-'));if(this[_0xb9cd('0xa')][_0x4ed589]){logger[_0xb9cd('0x21')](_0xb9cd('0x91'),_0x5bab38[_0xb9cd('0x23')],_0x4ed589);this[_0xb9cd('0xa')][_0x4ed589][_0xb9cd('0x92')]=!![];}}}}catch(_0x36ea92){logger['error'](_0xb9cd('0x93'),_0x5bab38[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x36ea92,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb9cd('0x1d')][_0xb9cd('0x1a')]=function(_0x3d8aee){var _0x1e50ca='';try{if(this[_0xb9cd('0x1f')](_0x3d8aee)){logger[_0xb9cd('0x26')](_0xb9cd('0x94'),_0x3d8aee[_0xb9cd('0x23')],util[_0xb9cd('0x27')](_0x3d8aee,{'showHidden':![],'depth':null}));if(_0x3d8aee[_0xb9cd('0x8f')]){_0x1e50ca=_0x3d8aee[_0xb9cd('0x8f')]['substring'](0x0,_0x3d8aee[_0xb9cd('0x8f')][_0xb9cd('0x90')]('-'));if(this[_0xb9cd('0xa')][_0x1e50ca]){logger[_0xb9cd('0x21')](_0xb9cd('0x95'),_0x3d8aee['uniqueid'],_0x1e50ca);this[_0xb9cd('0xa')][_0x1e50ca]['onhold']=![];}}}}catch(_0xfefb1a){logger[_0xb9cd('0x50')](_0xb9cd('0x96'),_0x3d8aee[_0xb9cd('0x23')],util['inspect'](_0xfefb1a,{'showHidden':![],'depth':null}));}};module[_0xb9cd('0x97')]=VoiceAgentReport; \ No newline at end of file +var _0x614b=['bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstart]','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStop','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','destuniqueid','debug','uniqueid','inspect','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','variables','voice','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','membername','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','voiceChannels','routealias','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','lastevent','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer'];(function(_0x586d01,_0x60c90f){var _0x40691c=function(_0x9d2cf3){while(--_0x9d2cf3){_0x586d01['push'](_0x586d01['shift']());}};_0x40691c(++_0x60c90f);}(_0x614b,0xb3));var _0xb614=function(_0x45872a,_0x4e1103){_0x45872a=_0x45872a-0x0;var _0x37d69f=_0x614b[_0x45872a];return _0x37d69f;};'use strict';var _=require(_0xb614('0x0'));var moment=require(_0xb614('0x1'));var util=require('util');var Redis=require(_0xb614('0x2'));var config=require(_0xb614('0x3'));var logger=require(_0xb614('0x4'))(_0xb614('0x5'));var ami=require(_0xb614('0x6'));config[_0xb614('0x7')]=_[_0xb614('0x8')](config[_0xb614('0x7')],{'host':_0xb614('0x9'),'port':0x18eb});var io=require(_0xb614('0xa'))(new Redis(config[_0xb614('0x7')]));function VoiceAgentReport(_0xe2c67a){this[_0xb614('0xb')]={};this['voiceChannels']=_0xe2c67a[_0xb614('0xb')];this[_0xb614('0xc')]=_0xe2c67a[_0xb614('0xc')];this[_0xb614('0xd')]=_0xe2c67a[_0xb614('0xd')];this['variables']={};ami['on'](_0xb614('0xe'),this[_0xb614('0xf')][_0xb614('0x10')](this));ami['on'](_0xb614('0x11'),this[_0xb614('0x12')]['bind'](this));ami['on'](_0xb614('0x13'),this[_0xb614('0x14')][_0xb614('0x10')](this));ami['on'](_0xb614('0x15'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xb614('0x16'),this[_0xb614('0x17')][_0xb614('0x10')](this));ami['on'](_0xb614('0x18'),this[_0xb614('0x19')][_0xb614('0x10')](this));ami['on'](_0xb614('0x1a'),this[_0xb614('0x1b')]['bind'](this));ami['on'](_0xb614('0x1c'),this['syncMusicOnHoldStart'][_0xb614('0x10')](this));ami['on']('musiconholdstop',this[_0xb614('0x1d')][_0xb614('0x10')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xb614('0x10')](this));ami['on']('blindtransfer',this[_0xb614('0x1e')][_0xb614('0x10')](this));}VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x20')]=function(_0x2d392c,_0x31ab11,_0x2c5922){io['to'](_0x2d392c)[_0xb614('0x20')](_0x31ab11,_0x2c5922);};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x21')]=function(_0x1b3ab0){return _0x1b3ab0!==null&&!_[_0xb614('0x22')](_0x1b3ab0);};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0xf')]=function(_0x381273){try{if(this[_0xb614('0x21')](_0x381273)){logger[_0xb614('0x23')](_0xb614('0x24'),_0x381273['uniqueid'],_0x381273['membername'],_0x381273[_0xb614('0x25')]);logger[_0xb614('0x26')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x381273[_0xb614('0x27')],util[_0xb614('0x28')](_0x381273,{'showHidden':![],'depth':null}));if(_[_0xb614('0x22')](this['channels'][_0x381273['uniqueid']])){this['channels'][_0x381273['uniqueid']]={};}if(_['isUndefined'](this[_0xb614('0xb')][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]])){this[_0xb614('0xb')][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]]={'agentcalledAt':moment()['format'](_0xb614('0x29')),'lastevent':_0xb614('0x2a'),'mandatoryDisposition':this[_0xb614('0xc')][_0x381273['queue']]?this[_0xb614('0xc')][_0x381273[_0xb614('0x2b')]][_0xb614('0x2c')]||![]:![],'type':this[_0xb614('0xc')][_0x381273['queue']]?this[_0xb614('0xc')][_0x381273[_0xb614('0x2b')]][_0xb614('0x2d')]||_0xb614('0x2e'):'inbound','variables':this[_0xb614('0x2f')][_0x381273[_0xb614('0x27')]],'motionChannel':_0xb614('0x30')};}_['merge'](this['channels'][_0x381273['uniqueid']][_0x381273[_0xb614('0x25')]],_[_0xb614('0x31')](_0x381273,[_0xb614('0x32'),_0xb614('0x33')]));logger[_0xb614('0x26')](_0xb614('0x34'),_0x381273[_0xb614('0x27')],util[_0xb614('0x28')](this[_0xb614('0xb')][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x35'),this['channels'][_0x381273['uniqueid']][_0x381273[_0xb614('0x25')]]);logger[_0xb614('0x26')](_0xb614('0x36'),_0x381273['uniqueid'],util[_0xb614('0x28')](this['channels'][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]],{'showHidden':![],'depth':null}));this[_0xb614('0x20')](util[_0xb614('0x37')]('user:%s',_0x381273[_0xb614('0x38')]),'user:called',this['channels'][_0x381273[_0xb614('0x27')]][_0x381273[_0xb614('0x25')]]);}}catch(_0x54558b){logger[_0xb614('0x39')](_0xb614('0x3a'),_0x381273[_0xb614('0x27')],util[_0xb614('0x28')](_0x54558b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x12')]=function(_0x26dacf){try{if(this[_0xb614('0x21')](_0x26dacf)){if(this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]]){logger[_0xb614('0x26')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x26dacf[_0xb614('0x27')],util['inspect'](_0x26dacf,{'showHidden':![],'depth':null}));for(var _0x2404dd in this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]]){if(this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0xb614('0x3b')](_0x2404dd)){if(_0x26dacf[_0xb614('0x25')]===_0x2404dd){logger[_0xb614('0x23')](_0xb614('0x3c'),_0x26dacf['uniqueid'],_0x26dacf['membername'],_0x26dacf['destuniqueid']);this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x3d')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['connectedlinename']=_0x26dacf[_0xb614('0x3e')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x3f')]=_0x26dacf['connectedlinenum'];this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x40')]=_0x26dacf['destchannelstate'];this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x41')]=_0x26dacf[_0xb614('0x41')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x42')]=_0x26dacf[_0xb614('0x42')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['lastevent']='connect';if(this[_0xb614('0x43')][this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x27')]]){var _0x806c04=this[_0xb614('0x43')][this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x27')]][_0xb614('0x44')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['routealias']=_0x806c04;_0x26dacf[_0xb614('0x44')]=_0x806c04;}_['merge'](this[_0xb614('0xd')][_0x26dacf[_0xb614('0x45')]],_[_0xb614('0x46')](_0x26dacf,['queue',_0xb614('0x47'),_0xb614('0x44')]));logger[_0xb614('0x26')](_0xb614('0x48'),_0x26dacf[_0xb614('0x27')],util['inspect'](this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x26dacf[_0xb614('0x25')]],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x49'),this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x26dacf[_0xb614('0x25')]]);logger['debug'](_0xb614('0x4a'),_0x26dacf['uniqueid'],util[_0xb614('0x28')](this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x26dacf[_0xb614('0x25')]],{'showHidden':![],'depth':null}));this[_0xb614('0x20')](util[_0xb614('0x37')](_0xb614('0x4b'),_0x26dacf['membername']),'user:agentconnect',this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x26dacf[_0xb614('0x25')]]);}else if(!this['channels'][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x13')]&&!this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['agentcomplete']){logger[_0xb614('0x23')](_0xb614('0x4c'),_0x26dacf[_0xb614('0x27')],this[_0xb614('0xb')][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x38')],_0x2404dd);this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['agentringnoanswer']=!![];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x4d')]=moment()[_0xb614('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x26dacf['uniqueid']][_0x2404dd][_0xb614('0x4e')]=_0x26dacf[_0xb614('0x25')];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x4f')]=_0x26dacf['membername'];this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]['lastevent']=_0xb614('0x50');this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd][_0xb614('0x51')]='answered_elsewhere';logger[_0xb614('0x26')](_0xb614('0x52'),_0x26dacf[_0xb614('0x27')],util['inspect'](this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x53'),this[_0xb614('0xb')][_0x26dacf[_0xb614('0x27')]][_0x2404dd]);}}}}}}catch(_0xc834d7){logger['error'](_0xb614('0x54'),_0x26dacf[_0xb614('0x27')],util['inspect'](_0xc834d7,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xb614('0x14')]=function(_0x538e4d){try{if(this['isNotNull'](_0x538e4d)){logger[_0xb614('0x26')](_0xb614('0x55'),_0x538e4d[_0xb614('0x27')],util[_0xb614('0x28')](_0x538e4d,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x538e4d[_0xb614('0x27')]]&&this['channels'][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]]){logger[_0xb614('0x23')](_0xb614('0x56'),_0x538e4d[_0xb614('0x27')],_0x538e4d[_0xb614('0x38')],_0x538e4d['destuniqueid']);this['channels'][_0x538e4d['uniqueid']][_0x538e4d[_0xb614('0x25')]][_0xb614('0x13')]=!![];this[_0xb614('0xb')][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]][_0xb614('0x4d')]=moment()[_0xb614('0x37')](_0xb614('0x29'));this['channels'][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]][_0xb614('0x57')]=_0xb614('0x58');this[_0xb614('0xb')][_0x538e4d[_0xb614('0x27')]][_0x538e4d[_0xb614('0x25')]][_0xb614('0x51')]=_0xb614('0x58');logger[_0xb614('0x26')](_0xb614('0x59'),_0x538e4d[_0xb614('0x27')],util[_0xb614('0x28')](this['channels'][_0x538e4d['uniqueid']][_0x538e4d['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')](_0xb614('0x5a'),this[_0xb614('0xb')][_0x538e4d['uniqueid']][_0x538e4d['destuniqueid']]);}}}catch(_0x56c2a9){logger[_0xb614('0x39')](_0xb614('0x5b'),_0x538e4d[_0xb614('0x27')],util[_0xb614('0x28')](_0x56c2a9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')]['syncQueueCallerAbandon']=function(_0x3a3c59){try{if(this[_0xb614('0x21')](_0x3a3c59)){logger[_0xb614('0x26')](_0xb614('0x5c'),_0x3a3c59[_0xb614('0x27')],util['inspect'](_0x3a3c59,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x3a3c59['uniqueid']]){for(var _0x471c4a in this[_0xb614('0xb')][_0x3a3c59['uniqueid']]){if(this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0xb614('0x3b')](_0x471c4a)&&!this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a][_0xb614('0x13')]&&!this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['agentcomplete']){logger[_0xb614('0x23')](_0xb614('0x5d'),_0x3a3c59[_0xb614('0x27')],this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['membername'],_0x471c4a);this[_0xb614('0xb')][_0x3a3c59['uniqueid']][_0x471c4a][_0xb614('0x13')]=!![];this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a][_0xb614('0x4d')]=moment()[_0xb614('0x37')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['lastevent']=_0xb614('0x5e');this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]['reason']=_0xb614('0x5e');logger[_0xb614('0x26')](_0xb614('0x5f'),_0x3a3c59[_0xb614('0x27')],util[_0xb614('0x28')](this['channels'][_0x3a3c59[_0xb614('0x27')]][_0x471c4a],{'showHidden':![],'depth':null}));ami['emit']('custom:agentqueuecallerabandon',this[_0xb614('0xb')][_0x3a3c59[_0xb614('0x27')]][_0x471c4a]);}}}}}catch(_0x45b470){logger[_0xb614('0x39')](_0xb614('0x60'),_0x3a3c59[_0xb614('0x27')],util['inspect'](_0x45b470,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')]['syncAgentComplete']=function(_0x7d30ec){try{if(this['isNotNull'](_0x7d30ec)){logger[_0xb614('0x26')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x7d30ec[_0xb614('0x27')],util[_0xb614('0x28')](_0x7d30ec,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]]){for(var _0x426896 in this['channels'][_0x7d30ec['uniqueid']]){if(this['channels'][_0x7d30ec[_0xb614('0x27')]]['hasOwnProperty'](_0x426896)){if(this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x3d')]&&!this['channels'][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x16')]){logger[_0xb614('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x7d30ec[_0xb614('0x27')],this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x38')],_0x426896);this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x16')]=!![];this['channels'][_0x7d30ec['uniqueid']][_0x426896][_0xb614('0x61')]=moment()[_0xb614('0x37')](_0xb614('0x29'));this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x57')]=_0xb614('0x62');this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x51')]=_0x7d30ec['reason']==_0xb614('0x63')?_0xb614('0x64'):_0x7d30ec[_0xb614('0x51')];this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x65')]=_0x7d30ec['talktime'];if(this['voiceQueues'][_0x7d30ec[_0xb614('0x2b')]]&&this[_0xb614('0xc')][_0x7d30ec[_0xb614('0x2b')]][_0xb614('0x66')]){this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896][_0xb614('0x67')]=this[_0xb614('0xc')][_0x7d30ec[_0xb614('0x2b')]][_0xb614('0x68')];this[_0xb614('0xb')][_0x7d30ec['uniqueid']][_0x426896]['agentacw']=!![];}this[_0xb614('0xd')][_0x7d30ec[_0xb614('0x45')]]=_['omit'](this['agents'][_0x7d30ec['interface']],[_0xb614('0x2b'),_0xb614('0x47')]);logger['debug'](_0xb614('0x69'),_0x7d30ec['uniqueid'],util[_0xb614('0x28')](this[_0xb614('0xb')][_0x7d30ec[_0xb614('0x27')]][_0x426896],{'showHidden':![],'depth':null}));ami[_0xb614('0x20')]('custom:agentcomplete',this['channels'][_0x7d30ec[_0xb614('0x27')]][_0x426896]);logger[_0xb614('0x26')](_0xb614('0x6a'),_0x7d30ec[_0xb614('0x27')],util['inspect'](this['channels'][_0x7d30ec[_0xb614('0x27')]][_0x426896],{'showHidden':![],'depth':null}));this[_0xb614('0x20')](util['format'](_0xb614('0x4b'),_0x7d30ec[_0xb614('0x38')]),'user:agentcomplete',this['channels'][_0x7d30ec['uniqueid']][_0x426896]);}}}}}}catch(_0x334cff){logger[_0xb614('0x39')]('[%s][voiceAgentReport][agentcomplete]',_0x7d30ec[_0xb614('0x27')],util[_0xb614('0x28')](_0x334cff,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x19')]=function(_0x23ec37){try{if(this[_0xb614('0x21')](_0x23ec37)){logger[_0xb614('0x26')](_0xb614('0x6b'),_0x23ec37[_0xb614('0x27')],util[_0xb614('0x28')](_0x23ec37,{'showHidden':![],'depth':null}));this[_0xb614('0x6c')](_0x23ec37[_0xb614('0x27')],_[_0xb614('0x6d')](_0x23ec37[_0xb614('0x6e')])[0x0],_0x23ec37[_0xb614('0x6f')]);if(this[_0xb614('0xb')][_0x23ec37['uniqueid']]){for(var _0x2385dd in this['channels'][_0x23ec37[_0xb614('0x27')]]){if(this['channels'][_0x23ec37[_0xb614('0x27')]][_0xb614('0x3b')](_0x2385dd)){logger[_0xb614('0x23')](_0xb614('0x70'),_0x23ec37[_0xb614('0x27')],_0x2385dd,_[_0xb614('0x6d')](_0x23ec37[_0xb614('0x6e')])[0x0],_0x23ec37[_0xb614('0x6f')]);if(_[_0xb614('0x22')](this['channels'][_0x23ec37[_0xb614('0x27')]][_0x2385dd][_0xb614('0x2f')])){this['channels'][_0x23ec37[_0xb614('0x27')]][_0x2385dd][_0xb614('0x2f')]={};}this['channels'][_0x23ec37[_0xb614('0x27')]][_0x2385dd][_0xb614('0x2f')]=this['variables'][_0x23ec37[_0xb614('0x27')]];}}}}}catch(_0x23838b){logger[_0xb614('0x39')]('[%s][voiceAgentReport][varset]',_0x23ec37[_0xb614('0x27')],util[_0xb614('0x28')](_0x23838b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x6c')]=function(_0x52c920,_0x2180c6,_0x48ed7d){var _0xe8e4ba=['rtpaudioqos',_0xb614('0x71'),'rtpaudioqosjitter',_0xb614('0x72'),_0xb614('0x73'),_0xb614('0x74'),'rtpaudioqosrtt',_0xb614('0x75'),_0xb614('0x76'),_0xb614('0x77'),_0xb614('0x78'),_0xb614('0x79'),'membercalls',_0xb614('0x7a'),_0xb614('0x7b'),_0xb614('0x7c'),_0xb614('0x38'),_0xb614('0x7d'),_0xb614('0x7e')];if(!_[_0xb614('0x7f')](_0x2180c6)&&!_['includes'](_0xe8e4ba,_0x2180c6)){if(_[_0xb614('0x22')](this[_0xb614('0x2f')][_0x52c920])){this[_0xb614('0x2f')][_0x52c920]={};}this[_0xb614('0x2f')][_0x52c920][_0x2180c6]=_0x48ed7d;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x38f7ea){try{if(this[_0xb614('0x21')](_0x38f7ea)){logger['debug']('[%s][voiceAgentReport][hangup]\x20event:',_0x38f7ea[_0xb614('0x27')],util[_0xb614('0x28')](_0x38f7ea,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]]){for(var _0x2577f0 in this[_0xb614('0xb')][_0x38f7ea['uniqueid']]){if(this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]][_0xb614('0x3b')](_0x2577f0)){if(this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]][_0x2577f0][_0xb614('0x51')]==_0xb614('0x63')&&this[_0xb614('0xb')][_0x38f7ea['uniqueid']][_0x2577f0][_0xb614('0x16')]){logger['info'](_0xb614('0x80'),_0x38f7ea['uniqueid'],_0x2577f0);this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]][_0x2577f0][_0xb614('0x61')]=moment()['format'](_0xb614('0x29'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x38f7ea[_0xb614('0x27')],util['inspect'](_['values'](this[_0xb614('0xb')][_0x38f7ea['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xb614('0x20')]('custom:voiceAgentReport',_[_0xb614('0x81')](this[_0xb614('0xb')][_0x38f7ea[_0xb614('0x27')]]));delete this[_0xb614('0xb')][_0x38f7ea['uniqueid']];}if(this[_0xb614('0x2f')][_0x38f7ea[_0xb614('0x27')]]){delete this['variables'][_0x38f7ea[_0xb614('0x27')]];}}}catch(_0x1dc0eb){logger[_0xb614('0x39')](_0xb614('0x82'),_0x38f7ea[_0xb614('0x27')],util[_0xb614('0x28')](_0x1dc0eb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x83')]=function(_0x55825a){try{if(this['isNotNull'](_0x55825a)){logger['debug']('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x55825a[_0xb614('0x27')],util[_0xb614('0x28')](_0x55825a,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]]){for(var _0x2a2012 in this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]]){if(this['channels'][_0x55825a[_0xb614('0x84')]][_0xb614('0x3b')](_0x2a2012)){if(_0x55825a[_0xb614('0x85')]===_0x2a2012){logger[_0xb614('0x23')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x55825a[_0xb614('0x27')],this['channels'][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x38')],_0x2a2012);var _0x2fa260=moment();this[_0xb614('0xb')][_0x55825a['transfereeuniqueid']][_0x2a2012][_0xb614('0x16')]=!![];this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]][_0x2a2012]['agentcompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x55825a['transfereeuniqueid']][_0x2a2012][_0xb614('0x57')]=_0xb614('0x62');this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x51')]='transfer';this['channels'][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x65')]=_0x2fa260[_0xb614('0x86')](this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]][_0x2a2012][_0xb614('0x3d')],_0xb614('0x87'));}}}}if(this[_0xb614('0xb')][_0x55825a[_0xb614('0x88')]]){var _0xf13a84=this[_0xb614('0xb')][_0x55825a[_0xb614('0x88')]];this[_0xb614('0xb')][_0x55825a[_0xb614('0x88')]]=this[_0xb614('0xb')][_0x55825a[_0xb614('0x84')]];this['channels'][_0x55825a[_0xb614('0x84')]]=_0xf13a84;}}}catch(_0x54776f){logger[_0xb614('0x39')](_0xb614('0x89'),_0x55825a[_0xb614('0x27')],util[_0xb614('0x28')](_0x54776f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x1e')]=function(_0x1be96b){try{if(this[_0xb614('0x21')](_0x1be96b)){logger['debug'](_0xb614('0x8a'),_0x1be96b[_0xb614('0x27')],util[_0xb614('0x28')](_0x1be96b,{'showHidden':![],'depth':null}));if(this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]]){for(var _0x2eb521 in this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]]){if(this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0xb614('0x3b')](_0x2eb521)){if(_0x1be96b[_0xb614('0x8b')]===_0x2eb521){logger[_0xb614('0x23')]('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x1be96b[_0xb614('0x27')],this['channels'][_0x1be96b['transfereeuniqueid']][_0x2eb521][_0xb614('0x38')],_0x2eb521);var _0x4c26f8=moment();this[_0xb614('0xb')][_0x1be96b['transfereeuniqueid']][_0x2eb521][_0xb614('0x16')]=!![];this[_0xb614('0xb')][_0x1be96b['transfereeuniqueid']][_0x2eb521][_0xb614('0x61')]=_0x4c26f8;this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521][_0xb614('0x57')]=_0xb614('0x62');this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521]['reason']=_0xb614('0x63');this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521][_0xb614('0x65')]=_0x4c26f8[_0xb614('0x86')](this[_0xb614('0xb')][_0x1be96b[_0xb614('0x84')]][_0x2eb521]['agentconnectAt'],_0xb614('0x87'));}}}}}}catch(_0x57ac32){logger['error'](_0xb614('0x8c'),_0x1be96b[_0xb614('0x27')],util[_0xb614('0x28')](_0x57ac32,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0x104759){var _0x32480a='';try{if(this[_0xb614('0x21')](_0x104759)){logger[_0xb614('0x26')](_0xb614('0x8d'),_0x104759['uniqueid'],util[_0xb614('0x28')](_0x104759,{'showHidden':![],'depth':null}));if(_0x104759[_0xb614('0x8e')]){_0x32480a=_0x104759[_0xb614('0x8e')][_0xb614('0x8f')](0x0,_0x104759[_0xb614('0x8e')]['lastIndexOf']('-'));if(this['agents'][_0x32480a]){logger[_0xb614('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0x104759[_0xb614('0x27')],_0x32480a);this[_0xb614('0xd')][_0x32480a][_0xb614('0x90')]=!![];}}}}catch(_0x5d6030){logger[_0xb614('0x39')](_0xb614('0x91'),_0x104759[_0xb614('0x27')],util[_0xb614('0x28')](_0x5d6030,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb614('0x1f')][_0xb614('0x1d')]=function(_0x431940){var _0x303e73='';try{if(this[_0xb614('0x21')](_0x431940)){logger['debug']('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x431940[_0xb614('0x27')],util['inspect'](_0x431940,{'showHidden':![],'depth':null}));if(_0x431940[_0xb614('0x8e')]){_0x303e73=_0x431940['channel'][_0xb614('0x8f')](0x0,_0x431940['channel'][_0xb614('0x92')]('-'));if(this['agents'][_0x303e73]){logger[_0xb614('0x23')](_0xb614('0x93'),_0x431940[_0xb614('0x27')],_0x303e73);this[_0xb614('0xd')][_0x303e73][_0xb614('0x90')]=![];}}}}catch(_0x206e69){logger[_0xb614('0x39')](_0xb614('0x94'),_0x431940[_0xb614('0x27')],util[_0xb614('0x28')](_0x206e69,{'showHidden':![],'depth':null}));}};module[_0xb614('0x95')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 30eceae..584a7ca 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 _0xbd9b=['some','routeid','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstart]','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','../rpc/setting','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','syncNewExten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','from-sip','split','exten','xcally-motion-preview','channel','destconnectedlinenum','connectedlinenum','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','format','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','disposition','includes','cdr(','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','holdtime','connectedlinename','destinationchannel','membername','UserId','context','routealias','user:%s','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','isNil','rec','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','mixmonitor_filename','parse','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','answertime','billableseconds','omit','user:agentcomplete','transferType','undefined','getSettings','then','stopRecordingOnTransfer','StopMixMonitor','catch','Action','webbar:stopmonitors','event','outbound','blindTransfers','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid'];(function(_0x14739a,_0x3ac4e5){var _0x654e91=function(_0x1d5fe6){while(--_0x1d5fe6){_0x14739a['push'](_0x14739a['shift']());}};_0x654e91(++_0x3ac4e5);}(_0xbd9b,0x1b4));var _0xbbd9=function(_0x4b1bb0,_0x7dc32b){_0x4b1bb0=_0x4b1bb0-0x0;var _0x549407=_0xbd9b[_0x4b1bb0];return _0x549407;};'use strict';var BPromise=require(_0xbbd9('0x0'));var _=require(_0xbbd9('0x1'));var moment=require(_0xbbd9('0x2'));var util=require(_0xbbd9('0x3'));var path=require(_0xbbd9('0x4'));var Redis=require(_0xbbd9('0x5'));var config=require(_0xbbd9('0x6'));var logger=require('../../../config/logger')(_0xbbd9('0x7'));var ami=require(_0xbbd9('0x8'));var Channel=require(_0xbbd9('0x9'));var RpcSetting=require(_0xbbd9('0xa'));var statusDesc=[_0xbbd9('0xb'),'not_inuse',_0xbbd9('0xc'),_0xbbd9('0xd'),_0xbbd9('0xe'),_0xbbd9('0xf'),_0xbbd9('0x10'),_0xbbd9('0x11'),_0xbbd9('0x12')];var applications=[_0xbbd9('0x13'),_0xbbd9('0x14'),'agi',_0xbbd9('0x15'),_0xbbd9('0x16'),_0xbbd9('0x17')];var dispositions=['NO\x20ANSWER',_0xbbd9('0x18'),'FAILED','NO\x20ANSWER',_0xbbd9('0x19'),_0xbbd9('0x19'),_0xbbd9('0x1a'),_0xbbd9('0x1b'),_0xbbd9('0x18'),_0xbbd9('0x18'),_0xbbd9('0x18')];var actions={};config['redis']=_['defaults'](config[_0xbbd9('0x1c')],{'host':_0xbbd9('0x1d'),'port':0x18eb});var io=require(_0xbbd9('0x1e'))(new Redis(config[_0xbbd9('0x1c')]));function VoiceCallReport(_0x489a32){this[_0xbbd9('0x1f')]=_0x489a32['channels'];this['agents']=_0x489a32[_0xbbd9('0x20')];this['blindTransfers']={};ami['on'](_0xbbd9('0x21'),this['syncNewExten'][_0xbbd9('0x22')](this));ami['on'](_0xbbd9('0x23'),this[_0xbbd9('0x24')]['bind'](this));ami['on'](_0xbbd9('0x25'),this[_0xbbd9('0x26')]['bind'](this));ami['on'](_0xbbd9('0x27'),this[_0xbbd9('0x28')]['bind'](this));ami['on'](_0xbbd9('0x29'),this[_0xbbd9('0x2a')][_0xbbd9('0x22')](this));ami['on'](_0xbbd9('0x2b'),this[_0xbbd9('0x2c')]['bind'](this));ami['on'](_0xbbd9('0x2d'),this[_0xbbd9('0x2e')][_0xbbd9('0x22')](this));ami['on']('attendedtransfer',this[_0xbbd9('0x2f')][_0xbbd9('0x22')](this));ami['on'](_0xbbd9('0x30'),this['syncBlindTransfer']['bind'](this));ami['on'](_0xbbd9('0x31'),this['syncMusicOnHoldStart'][_0xbbd9('0x22')](this));ami['on'](_0xbbd9('0x32'),this[_0xbbd9('0x33')][_0xbbd9('0x22')](this));try{logger[_0xbbd9('0x34')](_0xbbd9('0x35'));ami[_0xbbd9('0x36')]();}catch(_0x7266fd){logger[_0xbbd9('0x37')]('[voiceCallReport][coreshowchannels]',util[_0xbbd9('0x38')](_0x7266fd,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xbbd9('0x39')][_0xbbd9('0x3a')]=function(_0x4a412d){return _0x4a412d!==null&&!_[_0xbbd9('0x3b')](_0x4a412d);};VoiceCallReport['prototype']['emit']=function(_0x31b5ea,_0x19cd3c,_0x203d7c){io['to'](_0x31b5ea)[_0xbbd9('0x3c')](_0x19cd3c,_0x203d7c);};VoiceCallReport['prototype']['syncNewCallerId']=function(_0x5ba542){try{if(this['isNotNull'](_0x5ba542)){logger[_0xbbd9('0x34')](_0xbbd9('0x3d'),_0x5ba542[_0xbbd9('0x3e')],_0x5ba542[_0xbbd9('0x3f')],_0x5ba542[_0xbbd9('0x40')]);logger['debug'](_0xbbd9('0x41'),_0x5ba542[_0xbbd9('0x3e')],util['inspect'](_0x5ba542,{'showHidden':![],'depth':null}));if(_0x5ba542['uniqueid']===_0x5ba542[_0xbbd9('0x42')]){if(!_[_0xbbd9('0x3b')](this[_0xbbd9('0x1f')][_0x5ba542[_0xbbd9('0x3e')]])){_[_0xbbd9('0x43')](this[_0xbbd9('0x1f')][_0x5ba542[_0xbbd9('0x3e')]],_[_0xbbd9('0x44')](_0x5ba542,_[_0xbbd9('0x45')](this[_0xbbd9('0x1f')][_0x5ba542['uniqueid']])));}}if(_0x5ba542['context']===_0xbbd9('0x46')){if(this[_0xbbd9('0x20')][_0x5ba542['channel'][_0xbbd9('0x47')]('-')[0x0]]){if(_0x5ba542[_0xbbd9('0x48')]==_0xbbd9('0x49')){this['agents'][_0x5ba542[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4b')]=_0x5ba542[_0xbbd9('0x4c')];this['emit'](util['format']('user:%s',this['agents'][_0x5ba542[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4d')]),_0xbbd9('0x4e'),{'destaccountcode':this['agents'][_0x5ba542[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4f')],'destconnectedlinenum':_0x5ba542[_0xbbd9('0x4c')]});}}}}}catch(_0x1fd6f6){logger[_0xbbd9('0x37')](_0xbbd9('0x50'),_0x5ba542[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x1fd6f6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')]['syncNewChannel']=function(_0x22b775){try{if(this[_0xbbd9('0x3a')](_0x22b775)){logger[_0xbbd9('0x51')](_0xbbd9('0x52'),_0x22b775[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x22b775,{'showHidden':![],'depth':null}));if(_0x22b775[_0xbbd9('0x3e')]===_0x22b775[_0xbbd9('0x42')]&&_0x22b775[_0xbbd9('0x4a')]!=_0xbbd9('0x53')){if(_[_0xbbd9('0x3b')](this[_0xbbd9('0x1f')][_0x22b775[_0xbbd9('0x3e')]])){logger[_0xbbd9('0x34')](_0xbbd9('0x54'),_0x22b775['uniqueid'],_0x22b775['context'],_0x22b775[_0xbbd9('0x48')]);this[_0xbbd9('0x1f')][_0x22b775['uniqueid']]=new Channel();this[_0xbbd9('0x1f')][_0x22b775[_0xbbd9('0x3e')]][_0xbbd9('0x55')]=moment()[_0xbbd9('0x56')](_0xbbd9('0x57'));this[_0xbbd9('0x1f')][_0x22b775[_0xbbd9('0x3e')]]['disposition']=dispositions[_[_0xbbd9('0x58')](_0x22b775[_0xbbd9('0x59')])];_['merge'](this[_0xbbd9('0x1f')][_0x22b775[_0xbbd9('0x3e')]],_[_0xbbd9('0x44')](_0x22b775,_[_0xbbd9('0x45')](this['channels'][_0x22b775[_0xbbd9('0x3e')]])));if(_0x22b775['context']===_0xbbd9('0x46')){if(this[_0xbbd9('0x20')][_0x22b775[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]]){if(_[_0xbbd9('0x3b')](this[_0xbbd9('0x20')][_0x22b775['channel']['split']('-')[0x0]][_0xbbd9('0x4b')])){this[_0xbbd9('0x20')][_0x22b775[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4b')]=_0x22b775['exten'];logger['debug']('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x22b775['uniqueid'],util[_0xbbd9('0x38')]({'destaccountcode':this[_0xbbd9('0x20')][_0x22b775[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4f')],'destconnectedlinenum':_0x22b775[_0xbbd9('0x48')]},{'showHidden':![],'depth':null}));this[_0xbbd9('0x3c')](util[_0xbbd9('0x56')]('user:%s',this['agents'][_0x22b775[_0xbbd9('0x4a')]['split']('-')[0x0]][_0xbbd9('0x4d')]),_0xbbd9('0x4e'),{'destaccountcode':this[_0xbbd9('0x20')][_0x22b775['channel'][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4f')],'destconnectedlinenum':_0x22b775['exten']});}}}}}}}catch(_0x44d8d5){logger[_0xbbd9('0x37')](_0xbbd9('0x5a'),_0x22b775['uniqueid'],util[_0xbbd9('0x38')](_0x44d8d5,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')][_0xbbd9('0x24')]=function(_0x2cf12a){try{if(this[_0xbbd9('0x3a')](_0x2cf12a)){logger[_0xbbd9('0x51')](_0xbbd9('0x5b'),_0x2cf12a[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x2cf12a,{'showHidden':![],'depth':null}));if(_0x2cf12a[_0xbbd9('0x3e')]===_0x2cf12a[_0xbbd9('0x42')]&&_0x2cf12a[_0xbbd9('0x48')]!='h'&&_0x2cf12a[_0xbbd9('0x4a')]!=_0xbbd9('0x53')){_0x2cf12a['application']=_0x2cf12a[_0xbbd9('0x5c')][_0xbbd9('0x5d')]();_0x2cf12a[_0xbbd9('0x5e')]=_0x2cf12a['appdata']&&_0x2cf12a[_0xbbd9('0x5f')][_0xbbd9('0x60')](_0xbbd9('0x61'))?_0x2cf12a[_0xbbd9('0x5f')]:(_0x2cf12a[_0xbbd9('0x5f')]||_0x2cf12a[_0xbbd9('0x5e')])['toLowerCase']();logger['info'](_0xbbd9('0x62'),_0x2cf12a[_0xbbd9('0x3e')],_0x2cf12a[_0xbbd9('0x5c')],_0x2cf12a[_0xbbd9('0x5e')]);if(_[_0xbbd9('0x3b')](this[_0xbbd9('0x1f')][_0x2cf12a['uniqueid']])){this[_0xbbd9('0x1f')][_0x2cf12a['uniqueid']]=new Channel();this['channels'][_0x2cf12a[_0xbbd9('0x3e')]][_0xbbd9('0x55')]=_0x2cf12a[_0xbbd9('0x63')]?moment()[_0xbbd9('0x64')](moment[_0xbbd9('0x63')](_0x2cf12a[_0xbbd9('0x63')])[_0xbbd9('0x65')](),_0xbbd9('0x65'))[_0xbbd9('0x56')](_0xbbd9('0x57')):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xbbd9('0x1f')][_0x2cf12a[_0xbbd9('0x3e')]][_0xbbd9('0x66')]=_0xbbd9('0x19');}_[_0xbbd9('0x43')](this[_0xbbd9('0x1f')][_0x2cf12a[_0xbbd9('0x3e')]],_[_0xbbd9('0x44')](_0x2cf12a,_[_0xbbd9('0x45')](this[_0xbbd9('0x1f')][_0x2cf12a[_0xbbd9('0x3e')]])));if(_[_0xbbd9('0x67')](applications,_0x2cf12a[_0xbbd9('0x5c')])){this[_0xbbd9('0x1f')][_0x2cf12a['uniqueid']]['lastapplication']=_0x2cf12a[_0xbbd9('0x5c')];this[_0xbbd9('0x1f')][_0x2cf12a['uniqueid']]['lastdata']=_0x2cf12a[_0xbbd9('0x5e')];if(_0x2cf12a['application']===_0xbbd9('0x13')&&_[_0xbbd9('0x60')](_0x2cf12a[_0xbbd9('0x5e')][_0xbbd9('0x5d')](),_0xbbd9('0x68'))){var _0x4d2c78=_0x2cf12a['applicationdata'][_0xbbd9('0x47')]('=');var _0x4ca137=_0x4d2c78[0x0][_0xbbd9('0x5d')]()['match'](/cdr\((.*)\)/);if(_0x4ca137){this[_0xbbd9('0x1f')][_0x2cf12a[_0xbbd9('0x3e')]][_0x4ca137[0x1]]=_0x4d2c78[0x1];}}else if(_0x2cf12a[_0xbbd9('0x5c')]===_0xbbd9('0x14')){this[_0xbbd9('0x1f')][_0x2cf12a[_0xbbd9('0x3e')]][_0xbbd9('0x14')]=_0x2cf12a[_0xbbd9('0x5e')][_0xbbd9('0x47')](',')[0x0];}}}}}catch(_0x4762a9){logger[_0xbbd9('0x37')](_0xbbd9('0x69'),_0x2cf12a[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x4762a9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')][_0xbbd9('0x28')]=function(_0x283055){try{if(this[_0xbbd9('0x3a')](_0x283055)){logger[_0xbbd9('0x34')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x283055[_0xbbd9('0x3e')],_0x283055['linkedid'],_0x283055[_0xbbd9('0x3f')],_0x283055['calleridnum']);logger[_0xbbd9('0x51')](_0xbbd9('0x6a'),_0x283055[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x283055,{'showHidden':![],'depth':null}));if(_0x283055[_0xbbd9('0x3e')]!==_0x283055[_0xbbd9('0x42')]){if(this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]]){if(_0x283055['channelstate']==='6'){if(!this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x6b')]){var _0x4c0453=moment();this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x6b')]=!![];this[_0xbbd9('0x1f')][_0x283055['linkedid']]['answertime']=_0x4c0453['format'](_0xbbd9('0x57'));if(this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]]['starttime']){this['channels'][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x6c')]=_0x4c0453['diff'](this['channels'][_0x283055['linkedid']]['starttime'],'seconds');}}this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]]['linkedid']=_0x283055[_0xbbd9('0x3e')];if(_0x283055['calleridnum']!=='xcally-motion-preview'){this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x4c')]=_0x283055['calleridnum'];}this['channels'][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x6d')]=_0x283055[_0xbbd9('0x3f')];this['channels'][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x6e')]=_0x283055[_0xbbd9('0x4a')];this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x66')]=dispositions[_[_0xbbd9('0x58')](_0x283055[_0xbbd9('0x59')])];if(this['agents'][_0x283055[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]]){this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]]['UserId']=this[_0xbbd9('0x20')][_0x283055['channel'][_0xbbd9('0x47')]('-')[0x0]]['id'];this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x6f')]=this[_0xbbd9('0x20')][_0x283055['channel'][_0xbbd9('0x47')]('-')[0x0]]['name'];}}}}else{if(this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x3e')]]){if(_0x283055['channelstate']==='6'){if(this[_0xbbd9('0x20')][_0x283055[_0xbbd9('0x4a')]['split']('-')[0x0]]){this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x3e')]][_0xbbd9('0x70')]=this[_0xbbd9('0x20')][_0x283055[_0xbbd9('0x4a')]['split']('-')[0x0]]['id'];this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x3e')]][_0xbbd9('0x6f')]=this[_0xbbd9('0x20')][_0x283055[_0xbbd9('0x4a')]['split']('-')[0x0]][_0xbbd9('0x4d')];}}}}if(_0x283055[_0xbbd9('0x59')]==='6'&&_0x283055[_0xbbd9('0x71')]==='from-sip'){if(this[_0xbbd9('0x20')][_0x283055[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]]){this[_0xbbd9('0x20')][_0x283055[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4b')]=_0x283055['exten'];var _0x1845cc;if(this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x3e')]])_0x1845cc=this['channels'][_0x283055[_0xbbd9('0x3e')]][_0xbbd9('0x72')];else if(this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]])_0x1845cc=this[_0xbbd9('0x1f')][_0x283055[_0xbbd9('0x42')]][_0xbbd9('0x72')];logger[_0xbbd9('0x51')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x283055[_0xbbd9('0x3e')],util[_0xbbd9('0x38')]({'destaccountcode':this[_0xbbd9('0x20')][_0x283055[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x283055[_0xbbd9('0x48')],'routealias':_0x1845cc},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xbbd9('0x73'),this['agents'][_0x283055[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]]['name']),_0xbbd9('0x4e'),{'destaccountcode':this[_0xbbd9('0x20')][_0x283055[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4f')],'destconnectedlinenum':_0x283055['exten'],'routealias':_0x1845cc});}}}}catch(_0x4cb84d){logger[_0xbbd9('0x37')](_0xbbd9('0x74'),_0x283055[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x4cb84d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbbd9('0x75')]=function(_0x5bbdc3,_0x579f7b){try{if(this[_0xbbd9('0x1f')][_0x5bbdc3]){logger[_0xbbd9('0x34')](_0xbbd9('0x76'),_0x5bbdc3,_0x579f7b);this[_0xbbd9('0x1f')][_0x5bbdc3]['monitor']=!![];if(_[_0xbbd9('0x77')](_0x579f7b,'.wav49')){_0x579f7b=_0x579f7b[_0xbbd9('0x78')](_0xbbd9('0x79'),_0xbbd9('0x7a'));}this[_0xbbd9('0x1f')][_0x5bbdc3][_0xbbd9('0x7b')]=_0x579f7b;var _0x1209a2=_[_0xbbd9('0x7c')](this[_0xbbd9('0x1f')][_0x5bbdc3][_0xbbd9('0x7d')],{'filename':_0x579f7b});if(_[_0xbbd9('0x7e')](_0x1209a2)){this[_0xbbd9('0x1f')][_0x5bbdc3][_0xbbd9('0x7d')]['push']({'filename':_0x579f7b,'createdAt':moment()[_0xbbd9('0x56')](_0xbbd9('0x57')),'mixmonitorid':'','status':_0xbbd9('0x7f')});}}}catch(_0x356265){logger[_0xbbd9('0x37')]('[%s][voiceCallReport][mixMonitorFilename]',_0x5bbdc3,util[_0xbbd9('0x38')](_0x356265,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xbbd9('0x2a')]=function(_0x2f3dec){try{if(this[_0xbbd9('0x3a')](_0x2f3dec)){logger['debug'](_0xbbd9('0x80'),_0x2f3dec[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x2f3dec,{'showHidden':![],'depth':null}));if(this['channels'][_0x2f3dec[_0xbbd9('0x3e')]]&&_0x2f3dec['channel']!=_0xbbd9('0x53')){if(this[_0xbbd9('0x3a')](_0x2f3dec[_0xbbd9('0x81')])){if(this[_0xbbd9('0x3a')](_0x2f3dec[_0xbbd9('0x81')]['mixmonitor_filename'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec[_0xbbd9('0x82')]);this[_0xbbd9('0x75')](_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec[_0xbbd9('0x82')]);}else if(this['isNotNull'](_0x2f3dec['variable'][_0xbbd9('0x83')])){logger[_0xbbd9('0x34')](_0xbbd9('0x84'),_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec[_0xbbd9('0x82')]);this[_0xbbd9('0x1f')][_0x2f3dec[_0xbbd9('0x3e')]][_0xbbd9('0x40')]=_0x2f3dec[_0xbbd9('0x82')];}else if(this[_0xbbd9('0x3a')](_0x2f3dec[_0xbbd9('0x81')]['xmd-callerid'])){logger[_0xbbd9('0x34')](_0xbbd9('0x85'),_0x2f3dec['uniqueid'],_0x2f3dec[_0xbbd9('0x82')]);this[_0xbbd9('0x1f')][_0x2f3dec['uniqueid']][_0xbbd9('0x86')]=_0x2f3dec['value'];}else if(this[_0xbbd9('0x3a')](_0x2f3dec[_0xbbd9('0x81')][_0xbbd9('0x87')])){logger[_0xbbd9('0x34')](_0xbbd9('0x88'),_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec[_0xbbd9('0x82')]);this['channels'][_0x2f3dec[_0xbbd9('0x3e')]][_0xbbd9('0x89')]=_0x2f3dec[_0xbbd9('0x82')];}else if(this['isNotNull'](_0x2f3dec[_0xbbd9('0x81')]['xmd-queue'])){logger[_0xbbd9('0x34')](_0xbbd9('0x8a'),_0x2f3dec['uniqueid'],_0x2f3dec['value'][_0xbbd9('0x47')](',')[0x0]);this[_0xbbd9('0x1f')][_0x2f3dec[_0xbbd9('0x3e')]][_0xbbd9('0x14')]=_0x2f3dec['value'][_0xbbd9('0x47')](',')[0x0];}else if(this[_0xbbd9('0x3a')](_0x2f3dec['variable'][_0xbbd9('0x8b')])){logger[_0xbbd9('0x34')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec[_0xbbd9('0x82')]);this[_0xbbd9('0x1f')][_0x2f3dec[_0xbbd9('0x3e')]][_0xbbd9('0x8c')]=_0x2f3dec['value'];}else if(this[_0xbbd9('0x3a')](_0x2f3dec['variable']['xmd-destination'])){logger[_0xbbd9('0x34')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec['value']);this[_0xbbd9('0x1f')][_0x2f3dec[_0xbbd9('0x3e')]][_0xbbd9('0x8d')]=_0x2f3dec['value'];}else if(this[_0xbbd9('0x3a')](_0x2f3dec[_0xbbd9('0x81')][_0xbbd9('0x8e')])){logger['info'](_0xbbd9('0x8f'),_0x2f3dec['uniqueid'],_0x2f3dec[_0xbbd9('0x82')]);this['channels'][_0x2f3dec['uniqueid']][_0xbbd9('0x90')]=_0x2f3dec[_0xbbd9('0x82')];}else if(this[_0xbbd9('0x3a')](_0x2f3dec[_0xbbd9('0x81')][_0xbbd9('0x91')])){logger[_0xbbd9('0x34')](_0xbbd9('0x92'),_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec['value']);this[_0xbbd9('0x1f')][_0x2f3dec[_0xbbd9('0x3e')]]['queue']=_0x2f3dec[_0xbbd9('0x82')];}else if(this['isNotNull'](_0x2f3dec[_0xbbd9('0x81')][_0xbbd9('0x93')])){logger[_0xbbd9('0x34')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2f3dec[_0xbbd9('0x3e')],_0x2f3dec[_0xbbd9('0x82')]);this[_0xbbd9('0x1f')][_0x2f3dec['uniqueid']][_0xbbd9('0x94')]=_0x2f3dec['value'];}}}else if(this[_0xbbd9('0x3a')](_0x2f3dec[_0xbbd9('0x81')][_0xbbd9('0x95')])){if(_0x2f3dec['value']){var _0x4503b2=path[_0xbbd9('0x96')](_0x2f3dec['value'])[_0xbbd9('0x4d')];logger[_0xbbd9('0x34')](_0xbbd9('0x97'),_0x4503b2,_0x2f3dec[_0xbbd9('0x82')]);this[_0xbbd9('0x75')](_0x4503b2,_0x2f3dec[_0xbbd9('0x82')]);}}else if(this[_0xbbd9('0x1f')][_0x2f3dec[_0xbbd9('0x42')]]){if(this[_0xbbd9('0x3a')](_0x2f3dec['variable'])){if(this[_0xbbd9('0x3a')](_0x2f3dec['variable'][_0xbbd9('0x93')])){logger[_0xbbd9('0x34')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2f3dec['linkedid'],_0x2f3dec['value']);this[_0xbbd9('0x1f')][_0x2f3dec[_0xbbd9('0x42')]][_0xbbd9('0x98')]=_0x2f3dec[_0xbbd9('0x82')];}}}}}catch(_0x3369ed){logger[_0xbbd9('0x37')](_0xbbd9('0x99'),_0x2f3dec[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x3369ed,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')][_0xbbd9('0x2c')]=function(_0x173b15){try{if(this['isNotNull'](_0x173b15)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x173b15[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x173b15,{'showHidden':![],'depth':null}));if(this[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]]){logger[_0xbbd9('0x34')](_0xbbd9('0x9a'),_0x173b15[_0xbbd9('0x3e')],_0x173b15[_0xbbd9('0x9b')]);var _0x28c2c2=moment();this[_0xbbd9('0x1f')][_0x173b15['uniqueid']]['endtime']=_0x28c2c2[_0xbbd9('0x56')](_0xbbd9('0x57'));this['channels'][_0x173b15[_0xbbd9('0x3e')]]['duration']=_0x28c2c2['diff'](this[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x55')],_0xbbd9('0x65'));if(this[_0xbbd9('0x1f')][_0x173b15['uniqueid']][_0xbbd9('0x6b')]){this[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]]['billableseconds']=_0x28c2c2['diff'](this['channels'][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x9c')],_0xbbd9('0x65'));this[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]]['holdtime']=this['channels'][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x63')]-this[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x9d')];}if(_0x173b15['context']==='from-sip'){if(this[_0xbbd9('0x20')][_0x173b15['channel']['split']('-')[0x0]]){this[_0xbbd9('0x20')][_0x173b15[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]]=_[_0xbbd9('0x9e')](this[_0xbbd9('0x20')][_0x173b15[_0xbbd9('0x4a')]['split']('-')[0x0]],[_0xbbd9('0x4b')]);logger['debug']('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x173b15[_0xbbd9('0x3e')],util[_0xbbd9('0x38')]({'id':this[_0xbbd9('0x20')][_0x173b15[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]]['id'],'destaccountcode':this[_0xbbd9('0x20')][_0x173b15[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4f')]},{'showHidden':![],'depth':null}));this[_0xbbd9('0x3c')](util['format'](_0xbbd9('0x73'),this[_0xbbd9('0x20')][_0x173b15[_0xbbd9('0x4a')][_0xbbd9('0x47')]('-')[0x0]][_0xbbd9('0x4d')]),_0xbbd9('0x9f'),{'id':this['agents'][_0x173b15['channel'][_0xbbd9('0x47')]('-')[0x0]]['id'],'destaccountcode':this[_0xbbd9('0x20')][_0x173b15['channel'][_0xbbd9('0x47')]('-')[0x0]]['accountcode']});}}var _0x46ed14=this;Promise['resolve']()['then'](function(){var _0x7d9103=_0x46ed14[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]];if(typeof _0x7d9103[_0xbbd9('0xa0')]===_0xbbd9('0xa1'))return;if(_['isEmpty'](_0x7d9103['monitors']))return;return RpcSetting[_0xbbd9('0xa2')]()[_0xbbd9('0xa3')](function(_0x2b7a17){if(!_0x2b7a17[_0xbbd9('0xa4')])return;return Promise['resolve']()['then'](function(){return ami['Action']({'action':_0xbbd9('0xa5'),'channel':_0x7d9103['channel']})[_0xbbd9('0xa6')](function(){});})[_0xbbd9('0xa3')](function(){return ami[_0xbbd9('0xa7')]({'action':_0xbbd9('0xa5'),'channel':_0x7d9103[_0xbbd9('0x6e')]})['catch'](function(){})['finally'](function(){var _0x4f5742=_0x46ed14[_0xbbd9('0x20')][_0x7d9103[_0xbbd9('0x6e')]['split']('-')[0x0]];if(!_0x4f5742)return;io[_0xbbd9('0x3c')](_0xbbd9('0xa8'),{'agentId':_0x4f5742['id'],'uniqueid':_0x7d9103['uniqueid']});});});});})[_0xbbd9('0xa3')](function(){if(_0x173b15[_0xbbd9('0xa9')]==='BlindTransfer'){_0x46ed14['blindTransfers'][_0x173b15['uniqueid']]=_0x46ed14['channels'][_0x173b15[_0xbbd9('0x3e')]];}else{if(_0x46ed14['channels'][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x89')]===_0xbbd9('0xaa')&&_0x46ed14['blindTransfers'][_0x173b15[_0xbbd9('0x3e')]]){_0x46ed14[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x3e')]=[_0x46ed14[_0xbbd9('0x1f')][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x42')],_0x46ed14[_0xbbd9('0x1f')][_0x173b15['uniqueid']][_0xbbd9('0x42')]=_0x46ed14['channels'][_0x173b15[_0xbbd9('0x3e')]][_0xbbd9('0x3e')]][0x0];delete _0x46ed14[_0xbbd9('0xab')][_0x173b15[_0xbbd9('0x3e')]];}}logger['debug'](_0xbbd9('0xac'),_0x173b15[_0xbbd9('0x3e')],util['inspect'](_0x46ed14['channels'][_0x173b15[_0xbbd9('0x3e')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceCallReport',_0x46ed14[_0xbbd9('0x1f')][_0x173b15['uniqueid']]);delete _0x46ed14['channels'][_0x173b15[_0xbbd9('0x3e')]];});}}}catch(_0x44e96f){logger[_0xbbd9('0x37')](_0xbbd9('0xad'),_0x173b15['uniqueid'],util[_0xbbd9('0x38')](_0x44e96f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')]['syncAttendedTransfer']=function(_0x371c68){try{if(this['isNotNull'](_0x371c68)){logger['info'](_0xbbd9('0xae'),_0x371c68[_0xbbd9('0x3e')],_0x371c68[_0xbbd9('0xaf')],_0x371c68[_0xbbd9('0xb0')]);logger[_0xbbd9('0x51')](_0xbbd9('0xb1'),_0x371c68[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x371c68,{'showHidden':![],'depth':null}));if(this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb2')]]){this['channels'][_0x371c68[_0xbbd9('0xb2')]][_0xbbd9('0xb3')]=_0x371c68[_0xbbd9('0xaf')];this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb2')]][_0xbbd9('0xb4')]=_0x371c68[_0xbbd9('0xb0')];if(this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb5')]]){var _0x3d729c=this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb5')]];this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb5')]]=this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb2')]];this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb2')]]=_0x3d729c;}}else if(this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb6')]]){this[_0xbbd9('0x1f')][_0x371c68['transfertargetuniqueid']]['transfercalleridnum']=_0x371c68['origtransferercalleridnum'];this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb6')]]['transferconnectedlinenum']=_0x371c68[_0xbbd9('0xb0')];if(this['channels'][_0x371c68['origtransfereruniqueid']]){var _0x3d729c=this[_0xbbd9('0x1f')][_0x371c68['origtransfereruniqueid']];this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb7')]]=this['channels'][_0x371c68[_0xbbd9('0xb6')]];this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb6')]]=_0x3d729c;}}if((this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb7')]]||this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb8')]])&&this[_0xbbd9('0x1f')][_0x371c68['secondtransfereruniqueid']]){var _0x1fd3fc=_[_0xbbd9('0xb9')]([this['channels'][_0x371c68[_0xbbd9('0xb7')]],this[_0xbbd9('0x1f')][_0x371c68['origtransfererlinkedid']],this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb5')]]],function(_0x429840){return _0x429840&&_0x429840[_0xbbd9('0x89')]===_0xbbd9('0xaa')&&_0x429840[_0xbbd9('0xba')];});if(_0x1fd3fc){if(this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb7')]])this[_0xbbd9('0x1f')][_0x371c68['origtransfereruniqueid']]['transferType']=_0xbbd9('0xbb');if(this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb8')]])this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb8')]][_0xbbd9('0xa0')]=_0xbbd9('0xbb');this[_0xbbd9('0x1f')][_0x371c68[_0xbbd9('0xb5')]]['transferType']='ATTENDED';}}}}catch(_0x27a604){logger[_0xbbd9('0x37')]('[%s][voiceCallReport][attendedtransfer]',_0x371c68[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x27a604,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')][_0xbbd9('0xbc')]=function(_0x189b96){try{if(this['isNotNull'](_0x189b96)){logger[_0xbbd9('0x34')](_0xbbd9('0xbd'),_0x189b96['uniqueid'],_0x189b96[_0xbbd9('0xbe')],_0x189b96[_0xbbd9('0xbf')]);logger[_0xbbd9('0x51')](_0xbbd9('0xc0'),_0x189b96[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x189b96,{'showHidden':![],'depth':null}));if(this['channels'][_0x189b96[_0xbbd9('0xb2')]]){this[_0xbbd9('0x1f')][_0x189b96[_0xbbd9('0xb2')]][_0xbbd9('0xb3')]=_0x189b96[_0xbbd9('0xbe')];this['channels'][_0x189b96[_0xbbd9('0xb2')]]['transferconnectedlinenum']=_0x189b96[_0xbbd9('0xbf')];this['channels'][_0x189b96[_0xbbd9('0xb2')]][_0xbbd9('0xa0')]=_0xbbd9('0xc1');this[_0xbbd9('0x2c')]({'event':_0xbbd9('0xc2'),'uniqueid':_0x189b96[_0xbbd9('0xb2')],'context':_0x189b96[_0xbbd9('0x71')],'channel':_0x189b96[_0xbbd9('0xc3')]});}else{this['channels'][_0x189b96[_0xbbd9('0xc4')]][_0xbbd9('0xa0')]='BLIND';}}}catch(_0x3b7e1d){logger['error'](_0xbbd9('0xc5'),_0x189b96['uniqueid'],util[_0xbbd9('0x38')](_0x3b7e1d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')][_0xbbd9('0xc6')]=function(_0x1b6ab2){try{if(this[_0xbbd9('0x3a')](_0x1b6ab2)){logger['debug'](_0xbbd9('0xc7'),_0x1b6ab2[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x1b6ab2,{'showHidden':![],'depth':null}));if(this[_0xbbd9('0x1f')][_0x1b6ab2[_0xbbd9('0x3e')]]){if(!_[_0xbbd9('0x7e')](this[_0xbbd9('0x1f')][_0x1b6ab2[_0xbbd9('0x3e')]][_0xbbd9('0x9c')])){this[_0xbbd9('0x1f')][_0x1b6ab2[_0xbbd9('0x3e')]]['mohstarttime']=moment()[_0xbbd9('0x56')](_0xbbd9('0x57'));logger[_0xbbd9('0x34')](_0xbbd9('0xc8'),_0x1b6ab2[_0xbbd9('0x3e')],this['channels'][_0x1b6ab2['uniqueid']][_0xbbd9('0xc9')]);}}}}catch(_0x266ff2){logger['error'](_0xbbd9('0xca'),_0x1b6ab2[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x266ff2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xbbd9('0x39')][_0xbbd9('0x33')]=function(_0x48f325){try{if(this[_0xbbd9('0x3a')](_0x48f325)){logger[_0xbbd9('0x51')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x48f325[_0xbbd9('0x3e')],util[_0xbbd9('0x38')](_0x48f325,{'showHidden':![],'depth':null}));if(this['channels'][_0x48f325[_0xbbd9('0x3e')]]){if(!_[_0xbbd9('0x7e')](this[_0xbbd9('0x1f')][_0x48f325[_0xbbd9('0x3e')]][_0xbbd9('0xc9')])){this[_0xbbd9('0x1f')][_0x48f325[_0xbbd9('0x3e')]][_0xbbd9('0xcb')]+=moment()[_0xbbd9('0xcc')](0x0)['diff'](this[_0xbbd9('0x1f')][_0x48f325[_0xbbd9('0x3e')]][_0xbbd9('0xc9')],_0xbbd9('0x65'));logger[_0xbbd9('0x34')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x48f325[_0xbbd9('0x3e')],this[_0xbbd9('0x1f')][_0x48f325[_0xbbd9('0x3e')]][_0xbbd9('0xcb')]);delete this['channels'][_0x48f325[_0xbbd9('0x3e')]][_0xbbd9('0xc9')];}}}}catch(_0x2257b2){logger[_0xbbd9('0x37')](_0xbbd9('0xcd'),_0x48f325['uniqueid'],util['inspect'](_0x2257b2,{'showHidden':![],'depth':null}));}};module[_0xbbd9('0xce')]=VoiceCallReport; \ No newline at end of file +var _0x56f2=['type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','bluebird','path','../../../config/logger','ami','../ami','../model/channel','../rpc/setting','unknown','inuse','busy','invalid','unavailable','ringinuse','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','redis','defaults','localhost','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','actionCoreShowChannels','error','inspect','isUndefined','prototype','emit','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','merge','keys','context','from-sip','channel','split','exten','xcally-motion-preview','connectedlinenum','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','isNotNull','[%s][voiceCallReport][newchannel]\x20event:','info','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','format','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','startsWith','CDR(routeAlias)','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','match','queue','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','starttime','holdtime','diff','connectedlinename','toNumber','membername','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','monitorFilename','find','isNil','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','isEmpty','getSettings','StopMixMonitor','catch','Action','destinationchannel','finally','webbar:stopmonitors','event'];(function(_0x109549,_0x5a7c70){var _0x44cfa6=function(_0x424e45){while(--_0x424e45){_0x109549['push'](_0x109549['shift']());}};_0x44cfa6(++_0x5a7c70);}(_0x56f2,0xe8));var _0x256f=function(_0xc073cd,_0x38e1ae){_0xc073cd=_0xc073cd-0x0;var _0x57616c=_0x56f2[_0xc073cd];return _0x57616c;};'use strict';var BPromise=require(_0x256f('0x0'));var _=require('lodash');var moment=require('moment');var util=require('util');var path=require(_0x256f('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x256f('0x2'))(_0x256f('0x3'));var ami=require(_0x256f('0x4'));var Channel=require(_0x256f('0x5'));var RpcSetting=require(_0x256f('0x6'));var statusDesc=[_0x256f('0x7'),'not_inuse',_0x256f('0x8'),_0x256f('0x9'),_0x256f('0xa'),_0x256f('0xb'),'ringing',_0x256f('0xc'),'onhold'];var applications=[_0x256f('0xd'),'queue',_0x256f('0xe'),_0x256f('0xf'),_0x256f('0x10'),_0x256f('0x11')];var dispositions=[_0x256f('0x12'),_0x256f('0x13'),_0x256f('0x13'),_0x256f('0x12'),'NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0x256f('0x14'),_0x256f('0x13'),_0x256f('0x13'),_0x256f('0x13')];var actions={};config[_0x256f('0x15')]=_[_0x256f('0x16')](config[_0x256f('0x15')],{'host':_0x256f('0x17'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x256f('0x15')]));function VoiceCallReport(_0x304e78){this[_0x256f('0x18')]=_0x304e78[_0x256f('0x18')];this[_0x256f('0x19')]=_0x304e78['agents'];this[_0x256f('0x1a')]={};ami['on'](_0x256f('0x1b'),this[_0x256f('0x1c')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x1e'),this[_0x256f('0x1c')][_0x256f('0x1d')](this));ami['on']('newchannel',this['syncNewChannel']['bind'](this));ami['on'](_0x256f('0x1f'),this[_0x256f('0x20')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x21'),this[_0x256f('0x22')]['bind'](this));ami['on'](_0x256f('0x23'),this[_0x256f('0x24')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x25'),this['syncNewCallerId']['bind'](this));ami['on']('attendedtransfer',this[_0x256f('0x26')][_0x256f('0x1d')](this));ami['on'](_0x256f('0x27'),this[_0x256f('0x28')]['bind'](this));ami['on'](_0x256f('0x29'),this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x256f('0x1d')](this));try{logger['info']('[voiceCallReport][coreshowchannels]\x20started');ami[_0x256f('0x2a')]();}catch(_0x4b7f45){logger[_0x256f('0x2b')]('[voiceCallReport][coreshowchannels]',util[_0x256f('0x2c')](_0x4b7f45,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype']['isNotNull']=function(_0xcd2e4b){return _0xcd2e4b!==null&&!_[_0x256f('0x2d')](_0xcd2e4b);};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x2f')]=function(_0x679a74,_0xc7fd58,_0x343d14){io['to'](_0x679a74)[_0x256f('0x2f')](_0xc7fd58,_0x343d14);};VoiceCallReport[_0x256f('0x2e')]['syncNewCallerId']=function(_0xd31de1){try{if(this['isNotNull'](_0xd31de1)){logger['info']('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0xd31de1['uniqueid'],_0xd31de1[_0x256f('0x30')],_0xd31de1[_0x256f('0x31')]);logger[_0x256f('0x32')](_0x256f('0x33'),_0xd31de1[_0x256f('0x34')],util[_0x256f('0x2c')](_0xd31de1,{'showHidden':![],'depth':null}));if(_0xd31de1[_0x256f('0x34')]===_0xd31de1[_0x256f('0x35')]){if(!_[_0x256f('0x2d')](this[_0x256f('0x18')][_0xd31de1[_0x256f('0x34')]])){_[_0x256f('0x36')](this[_0x256f('0x18')][_0xd31de1[_0x256f('0x34')]],_['pick'](_0xd31de1,_[_0x256f('0x37')](this[_0x256f('0x18')][_0xd31de1[_0x256f('0x34')]])));}}if(_0xd31de1[_0x256f('0x38')]===_0x256f('0x39')){if(this['agents'][_0xd31de1[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){if(_0xd31de1[_0x256f('0x3c')]==_0x256f('0x3d')){this['agents'][_0xd31de1[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['destconnectedlinenum']=_0xd31de1[_0x256f('0x3e')];this[_0x256f('0x2f')](util['format'](_0x256f('0x3f'),this[_0x256f('0x19')][_0xd31de1[_0x256f('0x3a')]['split']('-')[0x0]][_0x256f('0x40')]),_0x256f('0x41'),{'destaccountcode':this[_0x256f('0x19')][_0xd31de1[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0xd31de1[_0x256f('0x3e')]});}}}}}catch(_0x304b3f){logger['error'](_0x256f('0x43'),_0xd31de1[_0x256f('0x34')],util['inspect'](_0x304b3f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x44')]=function(_0x29cc86){try{if(this[_0x256f('0x45')](_0x29cc86)){logger[_0x256f('0x32')](_0x256f('0x46'),_0x29cc86[_0x256f('0x34')],util['inspect'](_0x29cc86,{'showHidden':![],'depth':null}));if(_0x29cc86[_0x256f('0x34')]===_0x29cc86[_0x256f('0x35')]&&_0x29cc86['channel']!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]])){logger[_0x256f('0x47')](_0x256f('0x48'),_0x29cc86['uniqueid'],_0x29cc86[_0x256f('0x38')],_0x29cc86[_0x256f('0x3c')]);this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]]=new Channel();this['channels'][_0x29cc86['uniqueid']]['starttime']=moment()[_0x256f('0x49')](_0x256f('0x4a'));this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]][_0x256f('0x4b')]=dispositions[_['toNumber'](_0x29cc86[_0x256f('0x4c')])];_[_0x256f('0x36')](this[_0x256f('0x18')][_0x29cc86['uniqueid']],_['pick'](_0x29cc86,_[_0x256f('0x37')](this[_0x256f('0x18')][_0x29cc86[_0x256f('0x34')]])));if(_0x29cc86[_0x256f('0x38')]===_0x256f('0x39')){if(this['agents'][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){if(_[_0x256f('0x2d')](this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x4d')])){this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x4d')]=_0x29cc86['exten'];logger['debug'](_0x256f('0x4e'),_0x29cc86['uniqueid'],util[_0x256f('0x2c')]({'destaccountcode':this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x29cc86[_0x256f('0x3c')]},{'showHidden':![],'depth':null}));this[_0x256f('0x2f')](util[_0x256f('0x49')]('user:%s',this[_0x256f('0x19')][_0x29cc86[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x40')]),_0x256f('0x41'),{'destaccountcode':this['agents'][_0x29cc86['channel'][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0x29cc86[_0x256f('0x3c')]});}}}}}}}catch(_0x20dd3b){logger[_0x256f('0x2b')](_0x256f('0x4f'),_0x29cc86[_0x256f('0x34')],util['inspect'](_0x20dd3b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x256f('0x1c')]=function(_0x50cc96){try{if(this[_0x256f('0x45')](_0x50cc96)){logger[_0x256f('0x32')](_0x256f('0x50'),_0x50cc96['uniqueid'],util[_0x256f('0x2c')](_0x50cc96,{'showHidden':![],'depth':null}));if(_0x50cc96[_0x256f('0x34')]===_0x50cc96[_0x256f('0x35')]&&_0x50cc96[_0x256f('0x3c')]!='h'&&_0x50cc96[_0x256f('0x3a')]!=_0x256f('0x51')){_0x50cc96[_0x256f('0x52')]=_0x50cc96[_0x256f('0x52')][_0x256f('0x53')]();_0x50cc96[_0x256f('0x54')]=_0x50cc96['appdata']&&_0x50cc96['appdata'][_0x256f('0x55')](_0x256f('0x56'))?_0x50cc96[_0x256f('0x57')]:(_0x50cc96['appdata']||_0x50cc96['applicationdata'])['toLowerCase']();logger[_0x256f('0x47')](_0x256f('0x58'),_0x50cc96[_0x256f('0x34')],_0x50cc96[_0x256f('0x52')],_0x50cc96['applicationdata']);if(_[_0x256f('0x2d')](this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]])){this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]]=new Channel();this['channels'][_0x50cc96['uniqueid']]['starttime']=_0x50cc96[_0x256f('0x59')]?moment()[_0x256f('0x5a')](moment[_0x256f('0x59')](_0x50cc96[_0x256f('0x59')])[_0x256f('0x5b')](),_0x256f('0x5b'))['format'](_0x256f('0x4a')):moment()[_0x256f('0x49')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]][_0x256f('0x4b')]='NO\x20ANSWER';}_[_0x256f('0x36')](this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]],_['pick'](_0x50cc96,_[_0x256f('0x37')](this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]])));if(_[_0x256f('0x5c')](applications,_0x50cc96[_0x256f('0x52')])){this['channels'][_0x50cc96[_0x256f('0x34')]][_0x256f('0x5d')]=_0x50cc96[_0x256f('0x52')];this[_0x256f('0x18')][_0x50cc96['uniqueid']]['lastdata']=_0x50cc96['applicationdata'];if(_0x50cc96['application']===_0x256f('0xd')&&_['startsWith'](_0x50cc96[_0x256f('0x54')][_0x256f('0x53')](),'cdr(')){var _0x47cf75=_0x50cc96[_0x256f('0x54')]['split']('=');var _0x5eacca=_0x47cf75[0x0][_0x256f('0x53')]()[_0x256f('0x5e')](/cdr\((.*)\)/);if(_0x5eacca){this[_0x256f('0x18')][_0x50cc96['uniqueid']][_0x5eacca[0x1]]=_0x47cf75[0x1];}}else if(_0x50cc96[_0x256f('0x52')]===_0x256f('0x5f')){this[_0x256f('0x18')][_0x50cc96[_0x256f('0x34')]]['queue']=_0x50cc96['applicationdata'][_0x256f('0x3b')](',')[0x0];}}}}}catch(_0x5b5c10){logger[_0x256f('0x2b')]('[%s][voiceCallReport][newexten]',_0x50cc96['uniqueid'],util['inspect'](_0x5b5c10,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x256f('0x20')]=function(_0x5c9a79){try{if(this[_0x256f('0x45')](_0x5c9a79)){logger[_0x256f('0x47')](_0x256f('0x60'),_0x5c9a79[_0x256f('0x34')],_0x5c9a79[_0x256f('0x35')],_0x5c9a79[_0x256f('0x30')],_0x5c9a79[_0x256f('0x31')]);logger['debug'](_0x256f('0x61'),_0x5c9a79[_0x256f('0x34')],util[_0x256f('0x2c')](_0x5c9a79,{'showHidden':![],'depth':null}));if(_0x5c9a79[_0x256f('0x34')]!==_0x5c9a79[_0x256f('0x35')]){if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]]){if(_0x5c9a79[_0x256f('0x4c')]==='6'){if(!this['channels'][_0x5c9a79[_0x256f('0x35')]]['answered']){var _0x1e1116=moment();this['channels'][_0x5c9a79['linkedid']][_0x256f('0x62')]=!![];this[_0x256f('0x18')][_0x5c9a79['linkedid']][_0x256f('0x63')]=_0x1e1116['format'](_0x256f('0x4a'));if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x64')]){this[_0x256f('0x18')][_0x5c9a79['linkedid']][_0x256f('0x65')]=_0x1e1116[_0x256f('0x66')](this[_0x256f('0x18')][_0x5c9a79['linkedid']]['starttime'],_0x256f('0x5b'));}}this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x35')]=_0x5c9a79[_0x256f('0x34')];if(_0x5c9a79[_0x256f('0x31')]!==_0x256f('0x3d')){this[_0x256f('0x18')][_0x5c9a79['linkedid']][_0x256f('0x3e')]=_0x5c9a79[_0x256f('0x31')];}this['channels'][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x67')]=_0x5c9a79[_0x256f('0x30')];this['channels'][_0x5c9a79[_0x256f('0x35')]]['destinationchannel']=_0x5c9a79['channel'];this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]]['disposition']=dispositions[_[_0x256f('0x68')](_0x5c9a79[_0x256f('0x4c')])];if(this['agents'][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x18')][_0x5c9a79['linkedid']]['UserId']=this['agents'][_0x5c9a79['channel'][_0x256f('0x3b')]('-')[0x0]]['id'];this['channels'][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x69')]=this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['name'];}}}}else{if(this[_0x256f('0x18')][_0x5c9a79['uniqueid']]){if(_0x5c9a79[_0x256f('0x4c')]==='6'){if(this[_0x256f('0x19')][_0x5c9a79['channel'][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]]['UserId']=this['agents'][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['id'];this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]]['membername']=this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x40')];}}}}if(_0x5c9a79[_0x256f('0x4c')]==='6'&&_0x5c9a79[_0x256f('0x38')]===_0x256f('0x39')){if(this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')]['split']('-')[0x0]]['destconnectedlinenum']=_0x5c9a79[_0x256f('0x3c')];var _0x219d51;if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]])_0x219d51=this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x34')]][_0x256f('0x6a')];else if(this[_0x256f('0x18')][_0x5c9a79[_0x256f('0x35')]])_0x219d51=this['channels'][_0x5c9a79[_0x256f('0x35')]][_0x256f('0x6a')];logger[_0x256f('0x32')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x5c9a79['uniqueid'],util[_0x256f('0x2c')]({'destaccountcode':this['agents'][_0x5c9a79['channel']['split']('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0x5c9a79[_0x256f('0x3c')],'routealias':_0x219d51},{'showHidden':![],'depth':null}));this[_0x256f('0x2f')](util[_0x256f('0x49')](_0x256f('0x3f'),this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x40')]),_0x256f('0x41'),{'destaccountcode':this[_0x256f('0x19')][_0x5c9a79[_0x256f('0x3a')]['split']('-')[0x0]][_0x256f('0x42')],'destconnectedlinenum':_0x5c9a79[_0x256f('0x3c')],'routealias':_0x219d51});}}}}catch(_0x2057b7){logger[_0x256f('0x2b')](_0x256f('0x6b'),_0x5c9a79[_0x256f('0x34')],util[_0x256f('0x2c')](_0x2057b7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x6c')]=function(_0xc4279b,_0x4b2eb4){try{if(this[_0x256f('0x18')][_0xc4279b]){logger[_0x256f('0x47')](_0x256f('0x6d'),_0xc4279b,_0x4b2eb4);this['channels'][_0xc4279b][_0x256f('0x6e')]=!![];if(_[_0x256f('0x6f')](_0x4b2eb4,_0x256f('0x70'))){_0x4b2eb4=_0x4b2eb4[_0x256f('0x71')](_0x256f('0x70'),'.WAV');}this[_0x256f('0x18')][_0xc4279b][_0x256f('0x72')]=_0x4b2eb4;var _0x1e7ba2=_[_0x256f('0x73')](this[_0x256f('0x18')][_0xc4279b]['monitors'],{'filename':_0x4b2eb4});if(_[_0x256f('0x74')](_0x1e7ba2)){this[_0x256f('0x18')][_0xc4279b][_0x256f('0x75')][_0x256f('0x76')]({'filename':_0x4b2eb4,'createdAt':moment()['format'](_0x256f('0x4a')),'mixmonitorid':'','status':_0x256f('0x77')});}}}catch(_0x3da4cb){logger[_0x256f('0x2b')](_0x256f('0x78'),_0xc4279b,util[_0x256f('0x2c')](_0x3da4cb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')]['syncVarSet']=function(_0xd68d4e){try{if(this[_0x256f('0x45')](_0xd68d4e)){logger[_0x256f('0x32')]('[%s][voiceCallReport][varset]\x20event:',_0xd68d4e['uniqueid'],util[_0x256f('0x2c')](_0xd68d4e,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0xd68d4e['uniqueid']]&&_0xd68d4e[_0x256f('0x3a')]!=_0x256f('0x51')){if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')])){if(this[_0x256f('0x45')](_0xd68d4e['variable'][_0x256f('0x7a')])){logger[_0x256f('0x47')](_0x256f('0x7b'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e['value']);this[_0x256f('0x6c')](_0xd68d4e['uniqueid'],_0xd68d4e[_0x256f('0x7c')]);}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x7d')])){logger['info'](_0x256f('0x7e'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x31')]=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x7f')])){logger[_0x256f('0x47')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this['channels'][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x80')]=_0xd68d4e['value'];}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x81')])){logger[_0x256f('0x47')](_0x256f('0x82'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]]['type']=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x83')])){logger[_0x256f('0x47')](_0x256f('0x84'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]['split'](',')[0x0]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x5f')]=_0xd68d4e[_0x256f('0x7c')]['split'](',')[0x0];}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x85')])){logger['info'](_0x256f('0x86'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this['channels'][_0xd68d4e[_0x256f('0x34')]]['originatecalleridnum']=_0xd68d4e[_0x256f('0x7c')];}else if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')][_0x256f('0x87')])){logger[_0x256f('0x47')](_0x256f('0x88'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e['uniqueid']][_0x256f('0x89')]=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')]['xmd-callerid-preview'])){logger[_0x256f('0x47')](_0x256f('0x8a'),_0xd68d4e[_0x256f('0x34')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e['uniqueid']][_0x256f('0x8b')]=_0xd68d4e[_0x256f('0x7c')];}else if(this[_0x256f('0x45')](_0xd68d4e['variable'][_0x256f('0x8c')])){logger[_0x256f('0x47')](_0x256f('0x8d'),_0xd68d4e['uniqueid'],_0xd68d4e['value']);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x5f')]=_0xd68d4e['value'];}else if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x8e')])){logger[_0x256f('0x47')](_0x256f('0x8f'),_0xd68d4e['uniqueid'],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x34')]][_0x256f('0x90')]=_0xd68d4e[_0x256f('0x7c')];}}}else if(this[_0x256f('0x45')](_0xd68d4e['variable'][_0x256f('0x7a')])){if(_0xd68d4e['value']){var _0xbec3bd=path[_0x256f('0x91')](_0xd68d4e[_0x256f('0x7c')])[_0x256f('0x40')];logger['info'](_0x256f('0x7b'),_0xbec3bd,_0xd68d4e['value']);this[_0x256f('0x6c')](_0xbec3bd,_0xd68d4e['value']);}}else if(this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x35')]]){if(this['isNotNull'](_0xd68d4e[_0x256f('0x79')])){if(this[_0x256f('0x45')](_0xd68d4e[_0x256f('0x79')][_0x256f('0x8e')])){logger[_0x256f('0x47')](_0x256f('0x8f'),_0xd68d4e[_0x256f('0x35')],_0xd68d4e[_0x256f('0x7c')]);this[_0x256f('0x18')][_0xd68d4e[_0x256f('0x35')]][_0x256f('0x92')]=_0xd68d4e[_0x256f('0x7c')];}}}}}catch(_0x43df1c){logger[_0x256f('0x2b')]('[%s][voiceCallReport][varset]',_0xd68d4e[_0x256f('0x34')],util[_0x256f('0x2c')](_0x43df1c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x24')]=function(_0x2fef04){try{if(this['isNotNull'](_0x2fef04)){logger[_0x256f('0x32')](_0x256f('0x93'),_0x2fef04[_0x256f('0x34')],util[_0x256f('0x2c')](_0x2fef04,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0x2fef04['uniqueid']]){logger[_0x256f('0x47')](_0x256f('0x94'),_0x2fef04[_0x256f('0x34')],_0x2fef04[_0x256f('0x95')]);var _0x2be543=moment();this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x96')]=_0x2be543[_0x256f('0x49')](_0x256f('0x4a'));this['channels'][_0x2fef04['uniqueid']][_0x256f('0x59')]=_0x2be543[_0x256f('0x66')](this['channels'][_0x2fef04[_0x256f('0x34')]]['starttime'],_0x256f('0x5b'));if(this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]]['answered']){this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x97')]=_0x2be543['diff'](this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x63')],_0x256f('0x5b'));this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x65')]=this['channels'][_0x2fef04['uniqueid']][_0x256f('0x59')]-this[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]]['billableseconds'];}if(_0x2fef04[_0x256f('0x38')]===_0x256f('0x39')){if(this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]){this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]=_['omit'](this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')]['split']('-')[0x0]],['destconnectedlinenum']);logger['debug'](_0x256f('0x98'),_0x2fef04[_0x256f('0x34')],util[_0x256f('0x2c')]({'id':this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')]},{'showHidden':![],'depth':null}));this[_0x256f('0x2f')](util[_0x256f('0x49')]('user:%s',this['agents'][_0x2fef04[_0x256f('0x3a')]['split']('-')[0x0]][_0x256f('0x40')]),_0x256f('0x99'),{'id':this['agents'][_0x2fef04['channel'][_0x256f('0x3b')]('-')[0x0]]['id'],'destaccountcode':this[_0x256f('0x19')][_0x2fef04[_0x256f('0x3a')][_0x256f('0x3b')]('-')[0x0]][_0x256f('0x42')]});}}var _0x72153b=this;Promise[_0x256f('0x9a')]()[_0x256f('0x9b')](function(){var _0x56df51=_0x72153b['channels'][_0x2fef04[_0x256f('0x34')]];if(typeof _0x56df51[_0x256f('0x9c')]==='undefined')return;if(_[_0x256f('0x9d')](_0x56df51[_0x256f('0x75')]))return;return RpcSetting[_0x256f('0x9e')]()[_0x256f('0x9b')](function(_0x413875){if(!_0x413875['stopRecordingOnTransfer'])return;return Promise['resolve']()[_0x256f('0x9b')](function(){return ami['Action']({'action':_0x256f('0x9f'),'channel':_0x56df51[_0x256f('0x3a')]})[_0x256f('0xa0')](function(){});})['then'](function(){return ami[_0x256f('0xa1')]({'action':_0x256f('0x9f'),'channel':_0x56df51[_0x256f('0xa2')]})[_0x256f('0xa0')](function(){})[_0x256f('0xa3')](function(){var _0x4a2842=_0x72153b[_0x256f('0x19')][_0x56df51['destinationchannel'][_0x256f('0x3b')]('-')[0x0]];if(!_0x4a2842)return;io[_0x256f('0x2f')](_0x256f('0xa4'),{'agentId':_0x4a2842['id'],'uniqueid':_0x56df51[_0x256f('0x34')]});});});});})[_0x256f('0x9b')](function(){if(_0x2fef04[_0x256f('0xa5')]==='BlindTransfer'){_0x72153b['blindTransfers'][_0x2fef04[_0x256f('0x34')]]=_0x72153b[_0x256f('0x18')][_0x2fef04['uniqueid']];}else{if(_0x72153b['channels'][_0x2fef04['uniqueid']][_0x256f('0xa6')]===_0x256f('0xa7')&&_0x72153b[_0x256f('0x1a')][_0x2fef04['uniqueid']]){_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x34')]=[_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x35')],_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x35')]=_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]][_0x256f('0x34')]][0x0];delete _0x72153b[_0x256f('0x1a')][_0x2fef04[_0x256f('0x34')]];}}logger[_0x256f('0x32')](_0x256f('0xa8'),_0x2fef04[_0x256f('0x34')],util['inspect'](_0x72153b['channels'][_0x2fef04[_0x256f('0x34')]],{'showHidden':![],'depth':null}));ami[_0x256f('0x2f')](_0x256f('0xa9'),_0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]]);delete _0x72153b[_0x256f('0x18')][_0x2fef04[_0x256f('0x34')]];});}}}catch(_0x2bca24){logger['error']('[%s][voiceCallReport][hangup]',_0x2fef04[_0x256f('0x34')],util[_0x256f('0x2c')](_0x2bca24,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')][_0x256f('0x26')]=function(_0x4746d4){try{if(this[_0x256f('0x45')](_0x4746d4)){logger[_0x256f('0x47')](_0x256f('0xaa'),_0x4746d4[_0x256f('0x34')],_0x4746d4['origtransferercalleridnum'],_0x4746d4[_0x256f('0xab')]);logger[_0x256f('0x32')](_0x256f('0xac'),_0x4746d4[_0x256f('0x34')],util[_0x256f('0x2c')](_0x4746d4,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xad')]]){this[_0x256f('0x18')][_0x4746d4['transfereeuniqueid']][_0x256f('0xae')]=_0x4746d4[_0x256f('0xaf')];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xad')]][_0x256f('0xb0')]=_0x4746d4[_0x256f('0xab')];if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]){var _0x5e7a86=this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]=this[_0x256f('0x18')][_0x4746d4[_0x256f('0xad')]];this['channels'][_0x4746d4['transfereeuniqueid']]=_0x5e7a86;}}else if(this['channels'][_0x4746d4[_0x256f('0xb2')]]){this[_0x256f('0x18')][_0x4746d4['transfertargetuniqueid']][_0x256f('0xae')]=_0x4746d4[_0x256f('0xaf')];this['channels'][_0x4746d4['transfertargetuniqueid']][_0x256f('0xb0')]=_0x4746d4[_0x256f('0xab')];if(this['channels'][_0x4746d4[_0x256f('0xb3')]]){var _0x5e7a86=this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]]=this['channels'][_0x4746d4['transfertargetuniqueid']];this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb2')]]=_0x5e7a86;}}if((this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]]||this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]])&&this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]){var _0x4bb270=_[_0x256f('0xb5')]([this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]],this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]],this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]]],function(_0x452ee4){return _0x452ee4&&_0x452ee4[_0x256f('0xa6')]===_0x256f('0xa7')&&_0x452ee4[_0x256f('0xb6')];});if(_0x4bb270){if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb3')]])this[_0x256f('0x18')][_0x4746d4['origtransfereruniqueid']][_0x256f('0x9c')]=_0x256f('0xb7');if(this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]])this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb4')]][_0x256f('0x9c')]=_0x256f('0xb7');this[_0x256f('0x18')][_0x4746d4[_0x256f('0xb1')]][_0x256f('0x9c')]=_0x256f('0xb7');}}}}catch(_0x2b8ad7){logger[_0x256f('0x2b')]('[%s][voiceCallReport][attendedtransfer]',_0x4746d4['uniqueid'],util['inspect'](_0x2b8ad7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')]['syncBlindTransfer']=function(_0x542efa){try{if(this[_0x256f('0x45')](_0x542efa)){logger[_0x256f('0x47')](_0x256f('0xb8'),_0x542efa['uniqueid'],_0x542efa['transfereecalleridnum'],_0x542efa[_0x256f('0xb9')]);logger['debug'](_0x256f('0xba'),_0x542efa[_0x256f('0x34')],util[_0x256f('0x2c')](_0x542efa,{'showHidden':![],'depth':null}));if(this['channels'][_0x542efa[_0x256f('0xad')]]){this[_0x256f('0x18')][_0x542efa['transfereeuniqueid']][_0x256f('0xae')]=_0x542efa['transfereecalleridnum'];this['channels'][_0x542efa[_0x256f('0xad')]]['transferconnectedlinenum']=_0x542efa['extension'];this['channels'][_0x542efa[_0x256f('0xad')]][_0x256f('0x9c')]=_0x256f('0xbb');this[_0x256f('0x24')]({'event':'BlindTransfer','uniqueid':_0x542efa['transfereeuniqueid'],'context':_0x542efa[_0x256f('0x38')],'channel':_0x542efa[_0x256f('0xbc')]});}else{this[_0x256f('0x18')][_0x542efa[_0x256f('0xbd')]][_0x256f('0x9c')]=_0x256f('0xbb');}}}catch(_0xbf44b8){logger[_0x256f('0x2b')]('[%s][voiceCallReport][blindtransfer]',_0x542efa[_0x256f('0x34')],util[_0x256f('0x2c')](_0xbf44b8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x256f('0x2e')]['syncMusicOnHoldStart']=function(_0x3cd240){try{if(this['isNotNull'](_0x3cd240)){logger[_0x256f('0x32')](_0x256f('0xbe'),_0x3cd240['uniqueid'],util[_0x256f('0x2c')](_0x3cd240,{'showHidden':![],'depth':null}));if(this['channels'][_0x3cd240[_0x256f('0x34')]]){if(!_[_0x256f('0x74')](this[_0x256f('0x18')][_0x3cd240[_0x256f('0x34')]][_0x256f('0x63')])){this[_0x256f('0x18')][_0x3cd240['uniqueid']]['mohstarttime']=moment()['format'](_0x256f('0x4a'));logger['info'](_0x256f('0xbf'),_0x3cd240[_0x256f('0x34')],this['channels'][_0x3cd240[_0x256f('0x34')]]['mohstarttime']);}}}}catch(_0x2df722){logger[_0x256f('0x2b')](_0x256f('0xc0'),_0x3cd240[_0x256f('0x34')],util['inspect'](_0x2df722,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x256f('0xc1')]=function(_0x20762b){try{if(this[_0x256f('0x45')](_0x20762b)){logger[_0x256f('0x32')](_0x256f('0xc2'),_0x20762b[_0x256f('0x34')],util['inspect'](_0x20762b,{'showHidden':![],'depth':null}));if(this[_0x256f('0x18')][_0x20762b[_0x256f('0x34')]]){if(!_[_0x256f('0x74')](this[_0x256f('0x18')][_0x20762b['uniqueid']][_0x256f('0xc3')])){this[_0x256f('0x18')][_0x20762b[_0x256f('0x34')]][_0x256f('0xc4')]+=moment()[_0x256f('0xc5')](0x0)[_0x256f('0x66')](this['channels'][_0x20762b['uniqueid']][_0x256f('0xc3')],_0x256f('0x5b'));logger[_0x256f('0x47')](_0x256f('0xc6'),_0x20762b[_0x256f('0x34')],this[_0x256f('0x18')][_0x20762b['uniqueid']][_0x256f('0xc4')]);delete this[_0x256f('0x18')][_0x20762b[_0x256f('0x34')]][_0x256f('0xc3')];}}}}catch(_0x532bf7){logger[_0x256f('0x2b')]('[%s][voiceCallReport][musiconholdstop]',_0x20762b['uniqueid'],util['inspect'](_0x532bf7,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 2c9f464..291d813 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 _0xcf91=['[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','value','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','cause-txt','endtime','YYYY-MM-DD\x20HH:mm:ss','seconds','complete','total','answered','holdtime','answertime','diff','starttime','billableseconds','sumHoldTime','sumBillable','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','appdata','applicationdata','startsWith','cdr(','match','[%s][voiceDialReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','called','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','voice_outbound_channel:save','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]'];(function(_0x16bf4b,_0x561dec){var _0x46c166=function(_0x3e68f3){while(--_0x3e68f3){_0x16bf4b['push'](_0x16bf4b['shift']());}};_0x46c166(++_0x561dec);}(_0xcf91,0xb7));var _0x1cf9=function(_0x373e31,_0x317ce2){_0x373e31=_0x373e31-0x0;var _0x25ff2f=_0xcf91[_0x373e31];return _0x25ff2f;};'use strict';var _=require('lodash');var moment=require(_0x1cf9('0x0'));var util=require(_0x1cf9('0x1'));var Redis=require(_0x1cf9('0x2'));var config=require(_0x1cf9('0x3'));var logger=require(_0x1cf9('0x4'))(_0x1cf9('0x5'));var ami=require(_0x1cf9('0x6'));config[_0x1cf9('0x7')]=_['defaults'](config[_0x1cf9('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x1cf9('0x8'))(new Redis(config[_0x1cf9('0x7')]));function VoiceDialReport(_0xc1011f){this[_0x1cf9('0x9')]=_0xc1011f[_0x1cf9('0xa')];this[_0x1cf9('0xb')]=_0xc1011f[_0x1cf9('0xb')];this[_0x1cf9('0xc')]={};this[_0x1cf9('0xd')]={};ami['on']('dialbegin',this[_0x1cf9('0xe')][_0x1cf9('0xf')](this));ami['on'](_0x1cf9('0x10'),this[_0x1cf9('0x11')][_0x1cf9('0xf')](this));ami['on'](_0x1cf9('0x12'),this[_0x1cf9('0x13')][_0x1cf9('0xf')](this));ami['on']('newexten',this[_0x1cf9('0x14')]['bind'](this));ami['on'](_0x1cf9('0x15'),this[_0x1cf9('0x16')][_0x1cf9('0xf')](this));}VoiceDialReport[_0x1cf9('0x17')][_0x1cf9('0x18')]=function(_0x344485){return _0x344485!==null&&!_[_0x1cf9('0x19')](_0x344485);};VoiceDialReport['prototype']['emit']=function(_0x2b3187,_0x2e3e19,_0x1bb79d){io['to'](_0x2b3187)[_0x1cf9('0x1a')](_0x2e3e19,_0x1bb79d);};VoiceDialReport['prototype']['syncDialBegin']=function(_0x3fa6e4){try{if(this['isNotNull'](_0x3fa6e4)){logger['debug'](_0x1cf9('0x1b'),_0x3fa6e4[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](_0x3fa6e4,{'showHidden':![],'depth':null}));if(this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]]){_[_0x1cf9('0x1e')](this[_0x1cf9('0x9')][_0x3fa6e4['uniqueid']],{'starttime':moment()[_0x1cf9('0x1f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x1cf9('0x20'),'interface':_0x3fa6e4[_0x1cf9('0x21')][_0x1cf9('0x22')](0x0,_0x3fa6e4[_0x1cf9('0x21')][_0x1cf9('0x23')]('-')),'membername':_0x3fa6e4[_0x1cf9('0x21')][_0x1cf9('0x22')](_0x3fa6e4[_0x1cf9('0x21')]['lastIndexOf']('/')+0x1,_0x3fa6e4[_0x1cf9('0x21')][_0x1cf9('0x23')]('-'))},_[_0x1cf9('0x24')](_0x3fa6e4,[_0x1cf9('0x25'),_0x1cf9('0x26')]));logger[_0x1cf9('0x27')](_0x1cf9('0x28'),_0x3fa6e4[_0x1cf9('0x1c')],this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]][_0x1cf9('0x29')],this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]][_0x1cf9('0x2a')]);logger['debug'](_0x1cf9('0x2b'),_0x3fa6e4[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x3fa6e4[_0x1cf9('0x1c')]])_[_0x1cf9('0x1e')](this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]],this[_0x1cf9('0xc')][_0x3fa6e4[_0x1cf9('0x1c')]]);this[_0x1cf9('0x1a')](_0x1cf9('0x2c'),_0x1cf9('0x2d'),this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]]);logger[_0x1cf9('0x2e')](_0x1cf9('0x2f'),_0x3fa6e4['uniqueid'],util[_0x1cf9('0x1d')](this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x1cf9('0x30'),this[_0x1cf9('0x9')][_0x3fa6e4[_0x1cf9('0x1c')]]);}}}catch(_0x476d0d){logger[_0x1cf9('0x31')](_0x1cf9('0x32'),_0x3fa6e4[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](_0x476d0d,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1cf9('0x17')][_0x1cf9('0x11')]=function(_0x4b3fb3){try{if(this[_0x1cf9('0x18')](_0x4b3fb3)){logger[_0x1cf9('0x2e')]('[%s][voiceDialReport][dialend]\x20event:',_0x4b3fb3['uniqueid'],util['inspect'](_0x4b3fb3,{'showHidden':![],'depth':null}));if(this[_0x1cf9('0x9')][_0x4b3fb3[_0x1cf9('0x1c')]]){this['channels'][_0x4b3fb3[_0x1cf9('0x1c')]][_0x1cf9('0x33')]=_0x4b3fb3[_0x1cf9('0x33')];if(_0x4b3fb3[_0x1cf9('0x33')]===_0x1cf9('0x34')){this[_0x1cf9('0x9')][_0x4b3fb3[_0x1cf9('0x1c')]][_0x1cf9('0x35')]=_0x4b3fb3[_0x1cf9('0x35')];this[_0x1cf9('0x9')][_0x4b3fb3[_0x1cf9('0x1c')]][_0x1cf9('0x36')]=_0x4b3fb3[_0x1cf9('0x36')];this[_0x1cf9('0x9')][_0x4b3fb3[_0x1cf9('0x1c')]]['answertime']=moment()[_0x1cf9('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1cf9('0x9')][_0x4b3fb3[_0x1cf9('0x1c')]][_0x1cf9('0x37')]='connect';logger[_0x1cf9('0x27')](_0x1cf9('0x38'),_0x4b3fb3[_0x1cf9('0x1c')],_0x4b3fb3[_0x1cf9('0x21')]['substring'](_0x4b3fb3[_0x1cf9('0x21')][_0x1cf9('0x23')]('/')+0x1,_0x4b3fb3[_0x1cf9('0x21')][_0x1cf9('0x23')]('-')));logger[_0x1cf9('0x2e')](_0x1cf9('0x39'),_0x4b3fb3[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](this['channels'][_0x4b3fb3[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x1cf9('0x1a')](_0x1cf9('0x3a'),this[_0x1cf9('0x9')][_0x4b3fb3[_0x1cf9('0x1c')]]);}logger[_0x1cf9('0x2e')](_0x1cf9('0x3b'),_0x4b3fb3[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](this['channels'][_0x4b3fb3[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));this[_0x1cf9('0x1a')](_0x1cf9('0x2c'),_0x1cf9('0x2d'),this[_0x1cf9('0x9')][_0x4b3fb3[_0x1cf9('0x1c')]]);}}}catch(_0x35b4e3){logger[_0x1cf9('0x31')](_0x1cf9('0x3c'),_0x4b3fb3[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](_0x35b4e3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1cf9('0x17')][_0x1cf9('0x13')]=function(_0x4f4849){try{if(this[_0x1cf9('0x18')](_0x4f4849)){logger[_0x1cf9('0x2e')](_0x1cf9('0x3d'),_0x4f4849[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](_0x4f4849,{'showHidden':![],'depth':null}));this[_0x1cf9('0x3e')](_0x4f4849[_0x1cf9('0x1c')],_[_0x1cf9('0x3f')](_0x4f4849[_0x1cf9('0x40')])[0x0],_0x4f4849['value']);if(this[_0x1cf9('0x18')](_0x4f4849[_0x1cf9('0x40')])&&this[_0x1cf9('0x18')](_0x4f4849[_0x1cf9('0x40')][_0x1cf9('0x41')])){if(_[_0x1cf9('0x19')](this[_0x1cf9('0x9')][_0x4f4849['uniqueid']])){this[_0x1cf9('0x9')][_0x4f4849['uniqueid']]={'routeId':_0x4f4849['value'],'variables':this[_0x1cf9('0xd')][_0x4f4849['uniqueid']],'motionChannel':_0x1cf9('0x42')};logger[_0x1cf9('0x27')](_0x1cf9('0x43'),_0x4f4849[_0x1cf9('0x1c')],_0x4f4849['variable'][_0x1cf9('0x41')],_['keys'](_0x4f4849[_0x1cf9('0x40')])[0x0],_0x4f4849[_0x1cf9('0x44')]);logger['debug'](_0x1cf9('0x45'),_0x4f4849[_0x1cf9('0x1c')],util['inspect'](this['channels'][_0x4f4849[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));this[_0x1cf9('0x1a')](_0x1cf9('0x2c'),'voice_outbound_channel:save',this[_0x1cf9('0x9')][_0x4f4849[_0x1cf9('0x1c')]]);}}}}catch(_0x73c288){logger[_0x1cf9('0x31')](_0x1cf9('0x46'),_0x4f4849[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](_0x73c288,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x1cf9('0x17')]['addVariable']=function(_0x32c8b9,_0x175fb7,_0x2425b0){var _0xca2ed5=[_0x1cf9('0x47'),_0x1cf9('0x48'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x1cf9('0x49'),_0x1cf9('0x4a'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x1cf9('0x4b'),'sipuri',_0x1cf9('0x4c'),_0x1cf9('0x4d'),_0x1cf9('0x4e'),_0x1cf9('0x4f'),_0x1cf9('0x50'),_0x1cf9('0x51'),'membername','memberpenalty',_0x1cf9('0x52')];if(!_[_0x1cf9('0x53')](_0x175fb7)&&!_[_0x1cf9('0x54')](_0xca2ed5,_0x175fb7)){if(_['isUndefined'](this[_0x1cf9('0xd')][_0x32c8b9])){this[_0x1cf9('0xd')][_0x32c8b9]={};}this[_0x1cf9('0xd')][_0x32c8b9][_0x175fb7]=_0x2425b0;}};VoiceDialReport[_0x1cf9('0x17')][_0x1cf9('0x16')]=function(_0x23c497){try{if(this['isNotNull'](_0x23c497)){logger['debug'](_0x1cf9('0x55'),_0x23c497['uniqueid'],util['inspect'](_0x23c497,{'showHidden':![],'depth':null}));if(this[_0x1cf9('0x9')][_0x23c497['uniqueid']]){logger[_0x1cf9('0x27')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x23c497[_0x1cf9('0x1c')],_0x23c497[_0x1cf9('0x56')]);this['channels'][_0x23c497[_0x1cf9('0x1c')]][_0x1cf9('0x57')]=moment()[_0x1cf9('0x1f')](_0x1cf9('0x58'));this[_0x1cf9('0x9')][_0x23c497['uniqueid']]['duration']=moment(this[_0x1cf9('0x9')][_0x23c497['uniqueid']][_0x1cf9('0x57')])['diff'](this['channels'][_0x23c497[_0x1cf9('0x1c')]]['starttime'],_0x1cf9('0x59'));this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]]['lastevent']=_0x1cf9('0x5a');this[_0x1cf9('0xb')][_0x1cf9('0x5b')]+=0x1;if(this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]]['answertime']){this[_0x1cf9('0xb')][_0x1cf9('0x5c')]+=0x1;this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]][_0x1cf9('0x5d')]=moment(this[_0x1cf9('0x9')][_0x23c497['uniqueid']][_0x1cf9('0x5e')])[_0x1cf9('0x5f')](this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]][_0x1cf9('0x60')],'seconds');this[_0x1cf9('0x9')][_0x23c497['uniqueid']][_0x1cf9('0x61')]=moment(this[_0x1cf9('0x9')][_0x23c497['uniqueid']]['endtime'])[_0x1cf9('0x5f')](this[_0x1cf9('0x9')][_0x23c497['uniqueid']][_0x1cf9('0x5e')],_0x1cf9('0x59'));this[_0x1cf9('0xb')][_0x1cf9('0x62')]+=this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]]['holdtime']||0x0;this[_0x1cf9('0xb')][_0x1cf9('0x63')]+=this[_0x1cf9('0x9')][_0x23c497['uniqueid']][_0x1cf9('0x61')];}this['outbound']['sumDuration']+=this[_0x1cf9('0x9')][_0x23c497['uniqueid']][_0x1cf9('0x64')];logger[_0x1cf9('0x2e')](_0x1cf9('0x65'),_0x23c497['uniqueid'],util[_0x1cf9('0x1d')](this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x1cf9('0x1a')](_0x1cf9('0x66'),this[_0x1cf9('0x9')][_0x23c497['uniqueid']]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:',_0x23c497['uniqueid'],util[_0x1cf9('0x1d')](this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));ami[_0x1cf9('0x1a')]('custom:dialend',this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]]);logger[_0x1cf9('0x2e')](_0x1cf9('0x67'),_0x23c497[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));this[_0x1cf9('0x1a')](_0x1cf9('0x2c'),_0x1cf9('0x68'),this[_0x1cf9('0xb')]);logger[_0x1cf9('0x27')](_0x1cf9('0x69'),JSON[_0x1cf9('0x6a')](this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]]));logger[_0x1cf9('0x2e')](_0x1cf9('0x6b'),_0x23c497[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x1c')]],{'showHidden':![],'depth':null}));this['emit'](_0x1cf9('0x2c'),_0x1cf9('0x6c'),this['channels'][_0x23c497['uniqueid']]);delete this[_0x1cf9('0x9')][_0x23c497['uniqueid']];}else if(this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x6d')]]){this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x6d')]][_0x1cf9('0x1c')]=this[_0x1cf9('0x9')][_0x23c497[_0x1cf9('0x6d')]]['destuniqueid'];}if(this[_0x1cf9('0xd')][_0x23c497[_0x1cf9('0x1c')]]){delete this['variables'][_0x23c497[_0x1cf9('0x1c')]];}}}catch(_0x2210c2){logger[_0x1cf9('0x31')](_0x1cf9('0x6e'),_0x23c497[_0x1cf9('0x1c')],util[_0x1cf9('0x1d')](_0x2210c2,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x1cf9('0x14')]=function(_0x2b0a5e){try{if(this[_0x1cf9('0x18')](_0x2b0a5e)){logger[_0x1cf9('0x2e')](_0x1cf9('0x6f'),_0x2b0a5e['uniqueid'],util[_0x1cf9('0x1d')](_0x2b0a5e,{'showHidden':![],'depth':null}));if(_0x2b0a5e[_0x1cf9('0x70')][_0x1cf9('0x71')]()===_0x1cf9('0x72')){_0x2b0a5e['applicationdata']=(_0x2b0a5e[_0x1cf9('0x73')]||_0x2b0a5e[_0x1cf9('0x74')])[_0x1cf9('0x71')]();if(_[_0x1cf9('0x75')](_0x2b0a5e[_0x1cf9('0x74')],_0x1cf9('0x76'))){if(_[_0x1cf9('0x19')](this[_0x1cf9('0xc')][_0x2b0a5e[_0x1cf9('0x1c')]]))this[_0x1cf9('0xc')][_0x2b0a5e[_0x1cf9('0x1c')]]={};logger[_0x1cf9('0x27')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x2b0a5e['uniqueid'],_0x2b0a5e[_0x1cf9('0x70')],_0x2b0a5e[_0x1cf9('0x74')]);var _0x5d4c96=_0x2b0a5e['applicationdata']['split']('=');var _0x110741=_0x5d4c96[0x0][_0x1cf9('0x77')](/cdr\((.*)\)/);if(_0x110741)this[_0x1cf9('0xc')][_0x2b0a5e['uniqueid']][_0x110741[0x1]]=_0x5d4c96[0x1];}}}}catch(_0x3767e4){logger[_0x1cf9('0x31')](_0x1cf9('0x78'),_0x2b0a5e['uniqueid'],util[_0x1cf9('0x1d')](_0x3767e4,{'showHidden':![],'depth':null}));}};module[_0x1cf9('0x79')]=VoiceDialReport; \ No newline at end of file +var _0xb57d=['membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','info','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','complete','total','answered','seconds','billableseconds','sumHoldTime','holdtime','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','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','channels','outbound','applications','dialbegin','bind','syncDialEnd','varset','syncVarSet','newexten','syncNewExten','hangup','syncHangup','isNotNull','prototype','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge','format','substring','channel','lastIndexOf','omit','event','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','keys','variable','outboundrouteid','isUndefined','value','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][varset]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid'];(function(_0x33368a,_0x132fe3){var _0x4713ff=function(_0x5da8ef){while(--_0x5da8ef){_0x33368a['push'](_0x33368a['shift']());}};_0x4713ff(++_0x132fe3);}(_0xb57d,0xa5));var _0xdb57=function(_0x6fa8f9,_0x5d48d2){_0x6fa8f9=_0x6fa8f9-0x0;var _0x39b579=_0xb57d[_0x6fa8f9];return _0x39b579;};'use strict';var _=require(_0xdb57('0x0'));var moment=require(_0xdb57('0x1'));var util=require(_0xdb57('0x2'));var Redis=require(_0xdb57('0x3'));var config=require('../../../config/environment');var logger=require(_0xdb57('0x4'))(_0xdb57('0x5'));var ami=require(_0xdb57('0x6'));config['redis']=_[_0xdb57('0x7')](config[_0xdb57('0x8')],{'host':_0xdb57('0x9'),'port':0x18eb});var io=require(_0xdb57('0xa'))(new Redis(config[_0xdb57('0x8')]));function VoiceDialReport(_0x4f494a){this[_0xdb57('0xb')]=_0x4f494a['outboundChannels'];this[_0xdb57('0xc')]=_0x4f494a['outbound'];this[_0xdb57('0xd')]={};this['variables']={};ami['on'](_0xdb57('0xe'),this['syncDialBegin'][_0xdb57('0xf')](this));ami['on']('dialend',this[_0xdb57('0x10')][_0xdb57('0xf')](this));ami['on'](_0xdb57('0x11'),this[_0xdb57('0x12')][_0xdb57('0xf')](this));ami['on'](_0xdb57('0x13'),this[_0xdb57('0x14')][_0xdb57('0xf')](this));ami['on'](_0xdb57('0x15'),this[_0xdb57('0x16')][_0xdb57('0xf')](this));}VoiceDialReport['prototype'][_0xdb57('0x17')]=function(_0x3dcb05){return _0x3dcb05!==null&&!_['isUndefined'](_0x3dcb05);};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x19')]=function(_0x4bb4f,_0x267258,_0x1be55a){io['to'](_0x4bb4f)[_0xdb57('0x19')](_0x267258,_0x1be55a);};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x1a')]=function(_0x28200b){try{if(this[_0xdb57('0x17')](_0x28200b)){logger[_0xdb57('0x1b')](_0xdb57('0x1c'),_0x28200b['uniqueid'],util[_0xdb57('0x1d')](_0x28200b,{'showHidden':![],'depth':null}));if(this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]]){_[_0xdb57('0x1f')](this[_0xdb57('0xb')][_0x28200b['uniqueid']],{'starttime':moment()[_0xdb57('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x28200b['channel'][_0xdb57('0x21')](0x0,_0x28200b[_0xdb57('0x22')][_0xdb57('0x23')]('-')),'membername':_0x28200b[_0xdb57('0x22')][_0xdb57('0x21')](_0x28200b['channel']['lastIndexOf']('/')+0x1,_0x28200b[_0xdb57('0x22')]['lastIndexOf']('-'))},_[_0xdb57('0x24')](_0x28200b,[_0xdb57('0x25'),'privilege']));logger['info'](_0xdb57('0x26'),_0x28200b[_0xdb57('0x1e')],this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]][_0xdb57('0x27')],this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]]['interface']);logger[_0xdb57('0x1b')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x28200b[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));if(this[_0xdb57('0xd')][_0x28200b['uniqueid']])_[_0xdb57('0x1f')](this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]],this[_0xdb57('0xd')][_0x28200b[_0xdb57('0x1e')]]);this[_0xdb57('0x19')](_0xdb57('0x28'),_0xdb57('0x29'),this[_0xdb57('0xb')][_0x28200b['uniqueid']]);logger['debug'](_0xdb57('0x2a'),_0x28200b[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xdb57('0x19')](_0xdb57('0x2b'),this[_0xdb57('0xb')][_0x28200b[_0xdb57('0x1e')]]);}}}catch(_0x56642c){logger['error']('[%s][voiceDialReport][dialbegin]',_0x28200b['uniqueid'],util[_0xdb57('0x1d')](_0x56642c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x10')]=function(_0x56735c){try{if(this[_0xdb57('0x17')](_0x56735c)){logger[_0xdb57('0x1b')](_0xdb57('0x2c'),_0x56735c[_0xdb57('0x1e')],util['inspect'](_0x56735c,{'showHidden':![],'depth':null}));if(this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]]){this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x2d')]=_0x56735c[_0xdb57('0x2d')];if(_0x56735c['dialstatus']===_0xdb57('0x2e')){this['channels'][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x2f')]=_0x56735c[_0xdb57('0x2f')];this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x30')]=_0x56735c[_0xdb57('0x30')];this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x31')]=moment()[_0xdb57('0x20')](_0xdb57('0x32'));this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]][_0xdb57('0x33')]=_0xdb57('0x34');logger['info'](_0xdb57('0x35'),_0x56735c['uniqueid'],_0x56735c[_0xdb57('0x22')]['substring'](_0x56735c['channel']['lastIndexOf']('/')+0x1,_0x56735c[_0xdb57('0x22')]['lastIndexOf']('-')));logger[_0xdb57('0x1b')](_0xdb57('0x36'),_0x56735c[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this['channels'][_0x56735c[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xdb57('0x19')]('custom:dialconnect',this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]]);}logger['debug'](_0xdb57('0x37'),_0x56735c[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this[_0xdb57('0x19')](_0xdb57('0x28'),'voice_outbound_channel:save',this[_0xdb57('0xb')][_0x56735c[_0xdb57('0x1e')]]);}}}catch(_0x2e49f7){logger[_0xdb57('0x38')](_0xdb57('0x39'),_0x56735c[_0xdb57('0x1e')],util['inspect'](_0x2e49f7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x12')]=function(_0x134df6){try{if(this[_0xdb57('0x17')](_0x134df6)){logger[_0xdb57('0x1b')](_0xdb57('0x3a'),_0x134df6[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x134df6,{'showHidden':![],'depth':null}));this['addVariable'](_0x134df6[_0xdb57('0x1e')],_[_0xdb57('0x3b')](_0x134df6[_0xdb57('0x3c')])[0x0],_0x134df6['value']);if(this[_0xdb57('0x17')](_0x134df6[_0xdb57('0x3c')])&&this['isNotNull'](_0x134df6[_0xdb57('0x3c')][_0xdb57('0x3d')])){if(_[_0xdb57('0x3e')](this['channels'][_0x134df6[_0xdb57('0x1e')]])){this[_0xdb57('0xb')][_0x134df6[_0xdb57('0x1e')]]={'routeId':_0x134df6[_0xdb57('0x3f')],'variables':this[_0xdb57('0x40')][_0x134df6[_0xdb57('0x1e')]],'motionChannel':_0xdb57('0x41')};logger['info'](_0xdb57('0x42'),_0x134df6[_0xdb57('0x1e')],_0x134df6[_0xdb57('0x3c')][_0xdb57('0x3d')],_[_0xdb57('0x3b')](_0x134df6[_0xdb57('0x3c')])[0x0],_0x134df6[_0xdb57('0x3f')]);logger[_0xdb57('0x1b')](_0xdb57('0x43'),_0x134df6[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x134df6[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this['emit'](_0xdb57('0x28'),_0xdb57('0x29'),this[_0xdb57('0xb')][_0x134df6['uniqueid']]);}}}}catch(_0x539182){logger[_0xdb57('0x38')](_0xdb57('0x44'),_0x134df6[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x539182,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x45')]=function(_0x544009,_0x45d770,_0x5cf8ca){var _0x236f41=['rtpaudioqos',_0xdb57('0x46'),_0xdb57('0x47'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xdb57('0x48'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0xdb57('0x49'),_0xdb57('0x4a'),_0xdb57('0x4b'),_0xdb57('0x4c'),_0xdb57('0x4d'),_0xdb57('0x4e'),'memberinterface',_0xdb57('0x4f'),_0xdb57('0x27'),_0xdb57('0x50'),_0xdb57('0x51')];if(!_[_0xdb57('0x52')](_0x45d770)&&!_[_0xdb57('0x53')](_0x236f41,_0x45d770)){if(_[_0xdb57('0x3e')](this['variables'][_0x544009])){this[_0xdb57('0x40')][_0x544009]={};}this[_0xdb57('0x40')][_0x544009][_0x45d770]=_0x5cf8ca;}};VoiceDialReport[_0xdb57('0x18')][_0xdb57('0x16')]=function(_0x3e9a64){try{if(this['isNotNull'](_0x3e9a64)){logger[_0xdb57('0x1b')](_0xdb57('0x54'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x3e9a64,{'showHidden':![],'depth':null}));if(this[_0xdb57('0xb')][_0x3e9a64['uniqueid']]){logger[_0xdb57('0x55')](_0xdb57('0x56'),_0x3e9a64[_0xdb57('0x1e')],_0x3e9a64[_0xdb57('0x57')]);this[_0xdb57('0xb')][_0x3e9a64['uniqueid']][_0xdb57('0x58')]=moment()['format'](_0xdb57('0x32'));this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x59')]=moment(this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['endtime'])[_0xdb57('0x5a')](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['starttime'],'seconds');this['channels'][_0x3e9a64['uniqueid']][_0xdb57('0x33')]=_0xdb57('0x5b');this[_0xdb57('0xc')][_0xdb57('0x5c')]+=0x1;if(this['channels'][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x31')]){this['outbound'][_0xdb57('0x5d')]+=0x1;this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['holdtime']=moment(this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]['answertime'])[_0xdb57('0x5a')](this[_0xdb57('0xb')][_0x3e9a64['uniqueid']]['starttime'],_0xdb57('0x5e'));this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x5f')]=moment(this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x58')])[_0xdb57('0x5a')](this[_0xdb57('0xb')][_0x3e9a64['uniqueid']][_0xdb57('0x31')],'seconds');this[_0xdb57('0xc')][_0xdb57('0x60')]+=this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x61')]||0x0;this['outbound']['sumBillable']+=this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]][_0xdb57('0x5f')];}this[_0xdb57('0xc')][_0xdb57('0x62')]+=this[_0xdb57('0xb')][_0x3e9a64['uniqueid']][_0xdb57('0x59')];logger[_0xdb57('0x1b')](_0xdb57('0x63'),_0x3e9a64[_0xdb57('0x1e')],util['inspect'](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami[_0xdb57('0x19')](_0xdb57('0x64'),this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]);logger['debug'](_0xdb57('0x65'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));ami['emit'](_0xdb57('0x66'),this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]);logger[_0xdb57('0x1b')](_0xdb57('0x67'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this['emit'](_0xdb57('0x28'),_0xdb57('0x68'),this[_0xdb57('0xc')]);logger[_0xdb57('0x55')](_0xdb57('0x69'),JSON[_0xdb57('0x6a')](this[_0xdb57('0xb')][_0x3e9a64['uniqueid']]));logger[_0xdb57('0x1b')](_0xdb57('0x6b'),_0x3e9a64[_0xdb57('0x1e')],util[_0xdb57('0x1d')](this['channels'][_0x3e9a64[_0xdb57('0x1e')]],{'showHidden':![],'depth':null}));this[_0xdb57('0x19')](_0xdb57('0x28'),_0xdb57('0x6c'),this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]]);delete this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x1e')]];}else if(this['channels'][_0x3e9a64[_0xdb57('0x6d')]]){this[_0xdb57('0xb')][_0x3e9a64[_0xdb57('0x6d')]][_0xdb57('0x1e')]=this['channels'][_0x3e9a64[_0xdb57('0x6d')]]['destuniqueid'];}if(this['variables'][_0x3e9a64[_0xdb57('0x1e')]]){delete this[_0xdb57('0x40')][_0x3e9a64[_0xdb57('0x1e')]];}}}catch(_0x4c1654){logger[_0xdb57('0x38')](_0xdb57('0x6e'),_0x3e9a64[_0xdb57('0x1e')],util['inspect'](_0x4c1654,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xdb57('0x14')]=function(_0x2e9b11){try{if(this[_0xdb57('0x17')](_0x2e9b11)){logger[_0xdb57('0x1b')](_0xdb57('0x6f'),_0x2e9b11[_0xdb57('0x1e')],util[_0xdb57('0x1d')](_0x2e9b11,{'showHidden':![],'depth':null}));if(_0x2e9b11['application'][_0xdb57('0x70')]()===_0xdb57('0x71')){_0x2e9b11[_0xdb57('0x72')]=(_0x2e9b11[_0xdb57('0x73')]||_0x2e9b11[_0xdb57('0x72')])[_0xdb57('0x70')]();if(_[_0xdb57('0x74')](_0x2e9b11['applicationdata'],'cdr(')){if(_[_0xdb57('0x3e')](this[_0xdb57('0xd')][_0x2e9b11[_0xdb57('0x1e')]]))this['applications'][_0x2e9b11['uniqueid']]={};logger[_0xdb57('0x55')](_0xdb57('0x75'),_0x2e9b11[_0xdb57('0x1e')],_0x2e9b11['application'],_0x2e9b11[_0xdb57('0x72')]);var _0x55fac0=_0x2e9b11[_0xdb57('0x72')][_0xdb57('0x76')]('=');var _0x176729=_0x55fac0[0x0]['match'](/cdr\((.*)\)/);if(_0x176729)this[_0xdb57('0xd')][_0x2e9b11[_0xdb57('0x1e')]][_0x176729[0x1]]=_0x55fac0[0x1];}}}}catch(_0x4821cb){logger['error'](_0xdb57('0x77'),_0x2e9b11['uniqueid'],util[_0xdb57('0x1d')](_0x4821cb,{'showHidden':![],'depth':null}));}};module[_0xdb57('0x78')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 4cb0cf0..9bbf3f6 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 _0xe3ed=['isUndefined','loopQueueShow','clearZombieChannels','queues','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedIn','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','linkedid','queuecallerexit','queuecallerexitAt','add','seconds','FORWARDTRANSFER','transfertype','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','agentcomplete','[%s][voiceQueueReport][varset]','keys','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberrealtime','includes','abandoned','sumHoldTime','length','diff','answered','milliseconds','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferexten','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','lodash','moment','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','socket.io-emitter','enqueue','tail','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','syncAgentComplete','syncAgentConnect','varset','syncHangup','fullybooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','pTalking','waiting','prototype','switch','isNil','Action','status','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','variables','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','sumBillable','sumDuration','talking','Trunk','active','Interval','stringify','[voiceQueueReport][','format','voice_queue:save','isNotNull'];(function(_0x31ee6c,_0x3c4217){var _0x8fae3a=function(_0x569129){while(--_0x569129){_0x31ee6c['push'](_0x31ee6c['shift']());}};_0x8fae3a(++_0x3c4217);}(_0xe3ed,0x8d));var _0xde3e=function(_0x37c39d,_0x43db74){_0x37c39d=_0x37c39d-0x0;var _0x5a8f35=_0xe3ed[_0x37c39d];return _0x5a8f35;};'use strict';var _=require(_0xde3e('0x0'));var moment=require(_0xde3e('0x1'));var util=require(_0xde3e('0x2'));var md5=require(_0xde3e('0x3'));var Redis=require(_0xde3e('0x4'));var config=require(_0xde3e('0x5'));var logger=require(_0xde3e('0x6'))(_0xde3e('0x7'));var ami=require('../ami');var QueueReport=require(_0xde3e('0x8'));config[_0xde3e('0x9')]=_['defaults'](config[_0xde3e('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xde3e('0xa'))(new Redis(config[_0xde3e('0x9')]));var Sequence=function(){};Sequence['prototype'][_0xde3e('0xb')]=function(_0x3b1597){this[_0xde3e('0xc')]=this[_0xde3e('0xc')]?this[_0xde3e('0xc')]['finally'](_0x3b1597):_0x3b1597();};function VoiceQueueReport(_0x1ca45c){this[_0xde3e('0xd')]=new Sequence();this[_0xde3e('0xe')]={};this[_0xde3e('0xf')]=_0x1ca45c['agents'];this[_0xde3e('0x10')]=_0x1ca45c[_0xde3e('0x11')];this['voiceQueues']=_0x1ca45c[_0xde3e('0x12')];this[_0xde3e('0x13')]=!![];this['campaigns']=_0x1ca45c[_0xde3e('0x14')];this['variables']={};ami['on'](_0xde3e('0x15'),this[_0xde3e('0x16')][_0xde3e('0x17')](this));ami['on']('queuesummarycomplete',this[_0xde3e('0x18')][_0xde3e('0x17')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0xde3e('0x17')](this));ami['on'](_0xde3e('0x19'),this[_0xde3e('0x1a')]['bind'](this));ami['on']('queuecallerleave',this[_0xde3e('0x1b')]['bind'](this));ami['on']('agentcomplete',this[_0xde3e('0x1c')][_0xde3e('0x17')](this));ami['on']('agentconnect',this[_0xde3e('0x1d')][_0xde3e('0x17')](this));ami['on'](_0xde3e('0x1e'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0xde3e('0x1f')][_0xde3e('0x17')](this));ami['on'](_0xde3e('0x20'),this['syncFullyBooted'][_0xde3e('0x17')](this));ami['on'](_0xde3e('0x21'),this[_0xde3e('0x22')][_0xde3e('0x17')](this));ami['on'](_0xde3e('0x23'),this[_0xde3e('0x24')][_0xde3e('0x17')](this));ami['on'](_0xde3e('0x25'),this[_0xde3e('0x26')]['bind'](this));ami['on'](_0xde3e('0x27'),this[_0xde3e('0x28')][_0xde3e('0x17')](this));ami['on']('blindtransfer',this[_0xde3e('0x29')][_0xde3e('0x17')](this));this[_0xde3e('0x2a')]();this['loopQueueShow']();}function clearChannels(_0x2103da){if(!_[_0xde3e('0x2b')](_0x2103da)){for(var _0x1d9432 in _0x2103da){if(_0x2103da[_0xde3e('0x2c')](_0x1d9432)){delete _0x2103da[_0x1d9432];}}}}function clearCampaigns(_0x19a8be){if(!_['isEmpty'](_0x19a8be)){for(var _0x5313cb in _0x19a8be){if(_0x19a8be[_0xde3e('0x2c')](_0x5313cb)){_0x19a8be[_0x5313cb][_0xde3e('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x40b702){if(!_['isEmpty'](_0x40b702)){for(var _0x3d1404 in _0x40b702){if(_0x40b702[_0xde3e('0x2c')](_0x3d1404)){_0x40b702[_0x3d1404]['originated']=0x0;_0x40b702[_0x3d1404]['talking']=0x0;_0x40b702[_0x3d1404][_0xde3e('0x2e')]=0x0;_0x40b702[_0x3d1404][_0xde3e('0x2f')]=0x0;_0x40b702[_0x3d1404]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x2e4c62){if(!_[_0xde3e('0x2b')](_0x2e4c62)){for(var _0x46db9d in _0x2e4c62){if(_0x2e4c62['hasOwnProperty'](_0x46db9d)){_0x2e4c62[_0x46db9d]['unlockRR']=!![];}}}}VoiceQueueReport[_0xde3e('0x30')]['clearZombieChannels']=function(){var _0x49c77a=this;for(var _0x2c4548 in this[_0xde3e('0x10')]){if(this[_0xde3e('0x10')][_0xde3e('0x2c')](_0x2c4548)&&!this[_0xde3e('0x10')][_0x2c4548][_0xde3e('0x31')]){this[_0xde3e('0xd')][_0xde3e('0xb')](function(){if(!_[_0xde3e('0x32')](_0x49c77a[_0xde3e('0x10')][_0x2c4548])){return ami[_0xde3e('0x33')]({'action':_0xde3e('0x34'),'channel':_0x49c77a[_0xde3e('0x10')][_0x2c4548][_0xde3e('0x35')]})[_0xde3e('0x36')](function(_0x27e556){if(_0x27e556[_0xde3e('0x37')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x49c77a[_0xde3e('0x10')][_0x2c4548]){delete _0x49c77a[_0xde3e('0x10')][_0x2c4548];logger[_0xde3e('0x38')](_0xde3e('0x39'),_0x2c4548,util[_0xde3e('0x3a')](_0x27e556,{'showHidden':![],'depth':null}));}if(_0x49c77a[_0xde3e('0xe')][_0x2c4548]){delete _0x49c77a[_0xde3e('0xe')][_0x2c4548];logger[_0xde3e('0x38')]('[%s][voiceQueueReport][checkQueueReport]',_0x2c4548,util['inspect'](_0x27e556,{'showHidden':![],'depth':null}));}if(_0x49c77a[_0xde3e('0x3b')][_0x2c4548]){delete _0x49c77a['variables'][_0x2c4548];logger['error'](_0xde3e('0x3c'),_0x2c4548,util[_0xde3e('0x3a')](_0x27e556,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x3d')]=function(){logger[_0xde3e('0x38')](_0xde3e('0x3e'));clearChannels(this['channels']);this['clearQueueReport'](this[_0xde3e('0xe')]);clearAgentBooked(this[_0xde3e('0xf')]);clearVoiceQueues(this[_0xde3e('0x12')]);clearCampaigns(this[_0xde3e('0x14')]);};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x3f')]=function(_0x58a5c8){var _0x291c64=this;if(!_['isEmpty'](_0x58a5c8)){for(var _0xbb92ab in _0x58a5c8){if(_0x58a5c8[_0xde3e('0x2c')](_0xbb92ab)){_0x291c64[_0xde3e('0x40')](_0x58a5c8[_0xbb92ab],_0xde3e('0x41'));delete _0x58a5c8[_0xbb92ab];}}}};VoiceQueueReport['prototype'][_0xde3e('0x42')]=function(_0x202dcb,_0x5e6ac8,_0x17d451){io['to'](_0x202dcb)[_0xde3e('0x42')](_0x5e6ac8,_0x17d451);};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x43')]=function(_0x35fb56,_0x473a2f){logger[_0xde3e('0x44')](_0xde3e('0x45')+_0x473a2f+_0xde3e('0x46'),_0x35fb56[_0xde3e('0x47')],util['inspect'](_0x35fb56,{'showHidden':![],'depth':null}));this[_0xde3e('0x42')](util['format'](_0xde3e('0x48'),_0x35fb56[_0xde3e('0x49')]),_0xde3e('0x4a'),_0x35fb56);io[_0xde3e('0x42')](_0xde3e('0x4b'),_0x35fb56);};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x40')]=function(_0x59646c,_0x23dc36){logger[_0xde3e('0x44')](_0xde3e('0x45')+_0x23dc36+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x59646c[_0xde3e('0x47')],util[_0xde3e('0x3a')](_0x59646c,{'showHidden':![],'depth':null}));this[_0xde3e('0x42')](util['format'](_0xde3e('0x48'),_0x59646c[_0xde3e('0x49')]),_0xde3e('0x4c'),_0x59646c);io[_0xde3e('0x42')]('voice_queue_presence:remove',_0x59646c);};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x4d')]=function(_0x5e6b2d,_0xda858){if(_0x5e6b2d[_0xde3e('0x4e')]===_0xde3e('0x4f')){var _0x509dbf={'id':_0x5e6b2d['id'],'name':_0x5e6b2d[_0xde3e('0x49')],'strategy':_0x5e6b2d['strategy'],'answered':_0x5e6b2d['answered'],'available':_0x5e6b2d['available'],'loggedIn':_0x5e6b2d['loggedIn'],'pTalking':_0x5e6b2d[_0xde3e('0x2e')],'sumBillable':_0x5e6b2d[_0xde3e('0x50')],'sumDuration':_0x5e6b2d[_0xde3e('0x51')],'sumHoldTime':_0x5e6b2d['sumHoldTime']||0x0,'talking':_0x5e6b2d[_0xde3e('0x52')],'total':_0x5e6b2d['total'],'type':_0x5e6b2d[_0xde3e('0x4e')],'unmanaged':_0x5e6b2d['unmanaged'],'abandoned':_0x5e6b2d['abandoned'],'waiting':_0x5e6b2d[_0xde3e('0x2f')]};if(_0x5e6b2d['Trunk']){_0x509dbf['Trunk']={'id':_0x5e6b2d[_0xde3e('0x53')]['id'],'name':_0x5e6b2d[_0xde3e('0x53')][_0xde3e('0x49')],'active':_0x5e6b2d[_0xde3e('0x53')][_0xde3e('0x54')],'callerid':_0x5e6b2d[_0xde3e('0x53')]['callerid']};}if(_0x5e6b2d['Interval']){_0x509dbf[_0xde3e('0x55')]={'id':_0x5e6b2d[_0xde3e('0x55')]['id'],'name':_0x5e6b2d[_0xde3e('0x55')]['name']};}var _0x18a384=md5(JSON[_0xde3e('0x56')](_0x509dbf));if(_0x5e6b2d['md5']!==_0x18a384){_0x5e6b2d[_0xde3e('0x3')]=_0x18a384;logger[_0xde3e('0x44')](_0xde3e('0x57')+_0xda858+']\x20sending\x20voice_queue:save\x20event:',util[_0xde3e('0x3a')](_0x509dbf,{'showHidden':![],'depth':null}));this[_0xde3e('0x42')](util[_0xde3e('0x58')](_0xde3e('0x48'),_0x509dbf[_0xde3e('0x49')]),_0xde3e('0x59'),_0x509dbf);}}};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x5a')]=function(_0x50723f){return _0x50723f!==null&&!_[_0xde3e('0x5b')](_0x50723f);};VoiceQueueReport['prototype'][_0xde3e('0x5c')]=function(){var _0x450343=this;setInterval(function(){_0x450343[_0xde3e('0x5d')]();ami[_0xde3e('0x33')]({'action':_0xde3e('0x5e')})[_0xde3e('0x36')](function(_0x4b25c6){logger[_0xde3e('0x38')]('[voiceQueueReport][queues]',util[_0xde3e('0x3a')](_0x4b25c6,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x2a')]=function(){var _0x5a0809=this;setInterval(function(){if(_0x5a0809['flagQueueSummary']){return ami[_0xde3e('0x33')]({'action':_0xde3e('0x15')})[_0xde3e('0x5f')](function(_0x3fd6e0){_0x5a0809[_0xde3e('0x13')]=![];})[_0xde3e('0x36')](function(_0xca212e){logger[_0xde3e('0x38')](_0xde3e('0x60'),util[_0xde3e('0x3a')](_0xca212e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xde3e('0x30')]['syncQueueSummary']=function(_0x2083c7){try{if(this['isNotNull'](_0x2083c7)&&this[_0xde3e('0x5a')](_0x2083c7[_0xde3e('0x61')])){logger[_0xde3e('0x44')](_0xde3e('0x62'),util['inspect'](_0x2083c7,{'showHidden':![],'depth':null}));if(this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]]){logger[_0xde3e('0x63')](_0xde3e('0x64'),_0x2083c7[_0xde3e('0x61')]);var _0x3e118d=_[_0xde3e('0x65')](this[_0xde3e('0x10')],_0xde3e('0x61'))[_0x2083c7[_0xde3e('0x61')]]||0x0;var _0x3ab088=_0x3e118d-_0x2083c7[_0xde3e('0x66')];if(this[_0xde3e('0x12')][_0x2083c7['queue']][_0xde3e('0x2f')]!==_[_0xde3e('0x67')](_0x2083c7[_0xde3e('0x66')])||this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x68')]!==_[_0xde3e('0x67')](_0x2083c7[_0xde3e('0x69')])||this['voiceQueues'][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x6a')]!==_[_0xde3e('0x67')](_0x2083c7[_0xde3e('0x6a')])||this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x52')]!==_0x3ab088){this['voiceQueues'][_0x2083c7['queue']]['waiting']=_[_0xde3e('0x67')](_0x2083c7[_0xde3e('0x66')]);this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x68')]=_[_0xde3e('0x67')](_0x2083c7[_0xde3e('0x69')]);this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x6a')]=_['toNumber'](_0x2083c7[_0xde3e('0x6a')]);this[_0xde3e('0x12')][_0x2083c7['queue']]['talking']=_0x3ab088>0x0?_0x3ab088:0x0;this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x52')]=this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x52')]>_[_0xde3e('0x67')](_0x2083c7[_0xde3e('0x69')])?_[_0xde3e('0x67')](_0x2083c7[_0xde3e('0x69')]):this['voiceQueues'][_0x2083c7[_0xde3e('0x61')]][_0xde3e('0x52')];this[_0xde3e('0x4d')](this['voiceQueues'][_0x2083c7['queue']],_0xde3e('0x15'));}logger['debug'](_0xde3e('0x6b'),util['inspect'](this[_0xde3e('0x12')][_0x2083c7[_0xde3e('0x61')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this[_0xde3e('0x12')][_0x2083c7['queue']]);}}}catch(_0x2c1913){logger[_0xde3e('0x38')](_0xde3e('0x60'),util['inspect'](_0x2c1913,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x38c421){logger[_0xde3e('0x44')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xde3e('0x3a')](_0x38c421,{'showHidden':![],'depth':null}));this[_0xde3e('0x13')]=!![];};VoiceQueueReport['prototype'][_0xde3e('0x6c')]=function(_0x113232){try{if(this[_0xde3e('0x5a')](_0x113232)){logger['debug'](_0xde3e('0x6d'),_0x113232[_0xde3e('0x47')],util['inspect'](_0x113232,{'showHidden':![],'depth':null}));if(_[_0xde3e('0x5b')](this[_0xde3e('0xe')][_0x113232[_0xde3e('0x47')]]))this['queueReports'][_0x113232[_0xde3e('0x47')]]=[];if(_[_0xde3e('0x5b')](this[_0xde3e('0x10')][_0x113232[_0xde3e('0x47')]]))this[_0xde3e('0x10')][_0x113232[_0xde3e('0x47')]]={};var _0x3de377=new QueueReport();_0x3de377[_0xde3e('0x49')]=_0x113232[_0xde3e('0x61')];_0x3de377['type']=this['voiceQueues'][_0x3de377[_0xde3e('0x49')]]&&this[_0xde3e('0x12')][_0x3de377[_0xde3e('0x49')]][_0xde3e('0x4e')]?this['voiceQueues'][_0x3de377[_0xde3e('0x49')]][_0xde3e('0x4e')]||_0xde3e('0x4f'):_0xde3e('0x4f');_0x3de377[_0xde3e('0x61')]=_0x113232[_0xde3e('0x61')];_0x3de377[_0xde3e('0x6e')]=moment()[_0xde3e('0x58')](_0xde3e('0x6f'));_0x3de377['position']=_0x113232[_0xde3e('0x70')];_0x3de377[_0xde3e('0x71')]=_0x113232[_0xde3e('0x71')];_0x3de377[_0xde3e('0x47')]=_0x113232[_0xde3e('0x47')];_0x3de377[_0xde3e('0x72')]=this[_0xde3e('0x10')][_0x113232['uniqueid']]['routealias'];logger[_0xde3e('0x63')](_0xde3e('0x73'),_0x3de377['name'],_0x3de377['type']);_[_0xde3e('0x74')](_0x3de377,_[_0xde3e('0x75')](_0x113232,_['keys'](_0x3de377)));this[_0xde3e('0xe')][_0x113232[_0xde3e('0x47')]][_0xde3e('0x76')](_0x3de377);this[_0xde3e('0x10')][_0x113232['uniqueid']]=_0x3de377;this[_0xde3e('0x43')](_0x3de377,_0xde3e('0x77'));}}catch(_0x4b6ce7){logger[_0xde3e('0x38')]('[%s][voiceQueueReport][queuecallerjoin]',_0x113232[_0xde3e('0x47')],util[_0xde3e('0x3a')](_0x4b6ce7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xde3e('0x1a')]=function(_0x58e1ae){try{if(this[_0xde3e('0x5a')](_0x58e1ae)){logger[_0xde3e('0x44')](_0xde3e('0x78'),_0x58e1ae[_0xde3e('0x47')],util['inspect'](_0x58e1ae,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x58e1ae['uniqueid']]){var _0x449223=_[_0xde3e('0x79')](this[_0xde3e('0xe')][_0x58e1ae['uniqueid']]);_0x449223[_0xde3e('0x7a')]=![];_0x449223[_0xde3e('0x7b')]=null;_0x449223[_0xde3e('0x7c')]=_0x58e1ae['holdtime'];_0x449223[_0xde3e('0x7d')]=_0x58e1ae[_0xde3e('0x7d')];_0x449223[_0xde3e('0x19')]=!![];_0x449223[_0xde3e('0x7e')]=moment()[_0xde3e('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x449223['queuecallerexitreason']=_0xde3e('0x7f');_0x449223[_0xde3e('0x80')]=null;logger[_0xde3e('0x63')](_0xde3e('0x81'),_0x449223['name'],_0x449223[_0xde3e('0x4e')]);this[_0xde3e('0x10')][_0x58e1ae['uniqueid']]=_0x449223;this['emitVoiceQueueChannelRemove'](_0x449223,_0xde3e('0x19'));}}}catch(_0x2fd986){logger['error'](_0xde3e('0x78'),_0x58e1ae[_0xde3e('0x47')],util['inspect'](_0x2fd986,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x267b4c){try{if(this[_0xde3e('0x5a')](_0x267b4c)){logger[_0xde3e('0x44')](_0xde3e('0x82'),_0x267b4c['uniqueid'],util[_0xde3e('0x3a')](_0x267b4c,{'showHidden':![],'depth':null}));if(this[_0xde3e('0xe')][_0x267b4c['uniqueid']]){var _0xd6aff3=_[_0xde3e('0x79')](this['queueReports'][_0x267b4c[_0xde3e('0x47')]]);_0xd6aff3[_0xde3e('0x83')]=moment()[_0xde3e('0x58')](_0xde3e('0x6f'));_0xd6aff3[_0xde3e('0x84')]=_0x267b4c[_0xde3e('0x84')];_0xd6aff3['connectedlinename']=_0x267b4c[_0xde3e('0x85')];logger['info'](_0xde3e('0x86'),_0xd6aff3['name'],_0xd6aff3[_0xde3e('0x4e')],_0x267b4c[_0xde3e('0x84')],_0x267b4c['connectedlinename']);this['channels'][_0x267b4c[_0xde3e('0x47')]]=_0xd6aff3;this[_0xde3e('0x43')](_0xd6aff3,_0xde3e('0x87'));}}}catch(_0x47de28){logger['error'](_0xde3e('0x82'),_0x267b4c[_0xde3e('0x47')],util['inspect'](_0x47de28,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x1d')]=function(_0x41987b){try{if(this[_0xde3e('0x5a')](_0x41987b)){logger[_0xde3e('0x44')](_0xde3e('0x88'),_0x41987b['uniqueid'],util['inspect'](_0x41987b,{'showHidden':![],'depth':null}));if(this[_0xde3e('0xe')][_0x41987b[_0xde3e('0x47')]]){var _0x3aa1d3=_['last'](this[_0xde3e('0xe')][_0x41987b[_0xde3e('0x47')]]);_0x3aa1d3[_0xde3e('0x7a')]=!![];_0x3aa1d3[_0xde3e('0x89')]=_0xde3e('0x8a');logger[_0xde3e('0x63')](_0xde3e('0x8b'),_0x3aa1d3['name'],_0x3aa1d3[_0xde3e('0x4e')]);}}}catch(_0x13efd6){logger['error'](_0xde3e('0x88'),_0x41987b[_0xde3e('0x47')],util[_0xde3e('0x3a')](_0x13efd6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde3e('0x30')]['syncAgentComplete']=function(_0x5c131e){try{if(this[_0xde3e('0x5a')](_0x5c131e)){logger[_0xde3e('0x44')](_0xde3e('0x8c'),_0x5c131e[_0xde3e('0x47')],util[_0xde3e('0x3a')](_0x5c131e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5c131e[_0xde3e('0x47')]]){var _0x16a7d6=_['last'](this[_0xde3e('0xe')][_0x5c131e['uniqueid']]);_0x16a7d6[_0xde3e('0x19')]=![];_0x16a7d6['queuecallerabandonAt']=null;_0x16a7d6[_0xde3e('0x8d')]=!![];_0x16a7d6['lastAssignedTo']=_0x5c131e[_0xde3e('0x8e')];_0x16a7d6['holdtime']=_0x5c131e[_0xde3e('0x7c')];_0x16a7d6['queuecallercomplete']=!![];_0x16a7d6['queuecallerexit']=![];_0x16a7d6['queuecallerexitAt']=null;if(!_0x16a7d6[_0xde3e('0x8f')]){if(_0x5c131e[_0xde3e('0x90')]==_0xde3e('0x8f')){_0x16a7d6[_0xde3e('0x89')]=_0xde3e('0x91');logger['info'](_0xde3e('0x92'),_0x16a7d6[_0xde3e('0x49')],_0x16a7d6[_0xde3e('0x4e')]);}else{if(_['startsWith'](_0x5c131e[_0xde3e('0x35')]['toLowerCase'](),'local/')){if(this[_0xde3e('0xe')][_0x5c131e[_0xde3e('0x93')]]){var _0x1eb082=_['last'](this[_0xde3e('0xe')][_0x5c131e[_0xde3e('0x93')]]);_0x1eb082[_0xde3e('0x7a')]=![];_0x1eb082[_0xde3e('0x94')]=!![];_0x1eb082[_0xde3e('0x95')]=moment(_0x16a7d6['queuecallerjoinAt'])[_0xde3e('0x96')](_0x5c131e[_0xde3e('0x7c')],_0xde3e('0x97'))[_0xde3e('0x58')](_0xde3e('0x6f'));_0x1eb082[_0xde3e('0x89')]=_0xde3e('0x98');_0x1eb082[_0xde3e('0x8f')]=!![];_0x1eb082[_0xde3e('0x99')]='FORWARD';_0x1eb082['transferexten']=_0x5c131e[_0xde3e('0x9a')];_0x1eb082['transferuniqueid']=_0x5c131e[_0xde3e('0x47')];logger[_0xde3e('0x63')](_0xde3e('0x9b'),_0x1eb082[_0xde3e('0x49')],_0x1eb082['type']);var _0x2b44fd=this[_0xde3e('0xe')][_0x5c131e[_0xde3e('0x93')]];this[_0xde3e('0xe')][_0x5c131e[_0xde3e('0x93')]]=this['queueReports'][_0x5c131e[_0xde3e('0x47')]];this[_0xde3e('0xe')][_0x5c131e[_0xde3e('0x47')]]=_0x2b44fd;}}else{_0x16a7d6[_0xde3e('0x89')]=_0xde3e('0x9c')+_0x5c131e[_0xde3e('0x90')][_0xde3e('0x9d')]();logger[_0xde3e('0x63')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x16a7d6[_0xde3e('0x49')],_0x16a7d6[_0xde3e('0x4e')],_0x16a7d6['queuecallerexitreason']);}}}this[_0xde3e('0x10')][_0x5c131e[_0xde3e('0x47')]]=_0x16a7d6;this['emitVoiceQueueChannelRemove'](_0x16a7d6,_0xde3e('0x9e'));}}}catch(_0x9e15bc){logger['error'](_0xde3e('0x8c'),_0x5c131e['uniqueid'],util[_0xde3e('0x3a')](_0x9e15bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xde3e('0x30')]['syncVarSet']=function(_0x14365c){try{if(this[_0xde3e('0x5a')](_0x14365c)){logger[_0xde3e('0x44')](_0xde3e('0x9f'),_0x14365c['uniqueid'],util['inspect'](_0x14365c,{'showHidden':![],'depth':null}));this['addVariable'](_0x14365c[_0xde3e('0x47')],_[_0xde3e('0xa0')](_0x14365c[_0xde3e('0xa1')])[0x0],_0x14365c[_0xde3e('0xa2')]);if(this[_0xde3e('0xe')][_0x14365c[_0xde3e('0x47')]]){var _0x17a560=_['last'](this[_0xde3e('0xe')][_0x14365c[_0xde3e('0x47')]]);if(_0x17a560){if(this[_0xde3e('0x5a')](_0x14365c[_0xde3e('0xa1')])&&this[_0xde3e('0x5a')](_0x14365c[_0xde3e('0xa1')][_0xde3e('0xa3')])){switch(_0x14365c[_0xde3e('0xa2')]){case _0xde3e('0xa4'):_0x17a560[_0xde3e('0x94')]=![];_0x17a560[_0xde3e('0x95')]=null;break;case _0xde3e('0xa5'):_0x17a560[_0xde3e('0xa6')]='timeout';_0x17a560['queuecallerexit']=!![];_0x17a560[_0xde3e('0x95')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x17a560[_0xde3e('0x83')]=moment()[_0xde3e('0x58')](_0xde3e('0x6f'));logger[_0xde3e('0x44')](_0xde3e('0xa7'),_0x14365c['uniqueid'],util['inspect'](_0x17a560,{'showHidden':![],'depth':null}));ami[_0xde3e('0x42')](_0xde3e('0xa8'),_0x17a560);break;default:_0x17a560[_0xde3e('0x94')]=!![];_0x17a560[_0xde3e('0x95')]=moment()[_0xde3e('0x58')](_0xde3e('0x6f'));_0x17a560[_0xde3e('0x83')]=moment()[_0xde3e('0x58')](_0xde3e('0x6f'));}_0x17a560['queuecallerabandon']=![];_0x17a560['queuecallerabandonAt']=null;_0x17a560[_0xde3e('0x89')]=_0x14365c[_0xde3e('0xa2')];this[_0xde3e('0x10')][_0x14365c[_0xde3e('0x47')]]=_0x17a560;this[_0xde3e('0x40')](_0x17a560,'varset');}else if(this['isNotNull'](_0x14365c[_0xde3e('0xa1')])&&this[_0xde3e('0x5a')](_0x14365c[_0xde3e('0xa1')]['queueposition'])){if(!_0x17a560[_0xde3e('0x19')]){_0x17a560['queuecallerexit']=!![];_0x17a560[_0xde3e('0x95')]=moment()[_0xde3e('0x58')](_0xde3e('0x6f'));_0x17a560[_0xde3e('0x89')]=_0xde3e('0xa9');_0x17a560['queuecallerleaveAt']=moment()['format'](_0xde3e('0x6f'));this[_0xde3e('0x10')][_0x14365c['uniqueid']]=_0x17a560;}}logger[_0xde3e('0x63')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x14365c[_0xde3e('0x47')],_0x17a560[_0xde3e('0x49')],_0x17a560['type'],_[_0xde3e('0xa0')](_0x14365c[_0xde3e('0xa1')])[0x0],_0x14365c[_0xde3e('0xa2')]);_0x17a560[_0xde3e('0x3b')]=this[_0xde3e('0x3b')][_0x14365c[_0xde3e('0x47')]];}}}}catch(_0x59c405){logger[_0xde3e('0x38')](_0xde3e('0x9f'),_0x14365c['uniqueid'],util[_0xde3e('0x3a')](_0x59c405,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x52bbf4,_0x34d160,_0x131b30){var _0x4f733b=['rtpaudioqos',_0xde3e('0xaa'),_0xde3e('0xab'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0xde3e('0xac'),_0xde3e('0xad'),_0xde3e('0xae'),_0xde3e('0xaf'),'sipuri',_0xde3e('0xb0'),_0xde3e('0xb1'),_0xde3e('0xb2'),_0xde3e('0xb3'),_0xde3e('0xb4'),'memberlastcall','membername','memberpenalty',_0xde3e('0xb5')];if(!_[_0xde3e('0x32')](_0x34d160)&&!_[_0xde3e('0xb6')](_0x4f733b,_0x34d160)){if(_[_0xde3e('0x5b')](this[_0xde3e('0x3b')][_0x52bbf4])){this[_0xde3e('0x3b')][_0x52bbf4]={};}this['variables'][_0x52bbf4][_0x34d160]=_0x131b30;}};VoiceQueueReport[_0xde3e('0x30')][_0xde3e('0x1f')]=function(_0x35e383){try{if(this['isNotNull'](_0x35e383)){logger[_0xde3e('0x44')]('[%s][voiceQueueReport][hangup]',_0x35e383[_0xde3e('0x47')],util[_0xde3e('0x3a')](_0x35e383,{'showHidden':![],'depth':null}));if(this[_0xde3e('0xe')][_0x35e383[_0xde3e('0x47')]]){for(var _0x177bc6=0x0,_0x34e4e4={};_0x177bc60x0?_0x156779:0x0;this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x34')]=this[_0xac5b('0x16')][_0x561c3c[_0xac5b('0x69')]][_0xac5b('0x34')]>_[_0xac5b('0x6d')](_0x561c3c[_0xac5b('0x6e')])?_[_0xac5b('0x6d')](_0x561c3c[_0xac5b('0x6e')]):this[_0xac5b('0x16')][_0x561c3c['queue']][_0xac5b('0x34')];this[_0xac5b('0x54')](this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]],_0xac5b('0x1a'));}logger[_0xac5b('0x4a')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xac5b('0x43')](this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0xac5b('0x6f'),this['voiceQueues'][_0x561c3c[_0xac5b('0x69')]]);}}}catch(_0x5bcc27){logger[_0xac5b('0x3f')](_0xac5b('0x68'),util[_0xac5b('0x43')](_0x5bcc27,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')]['syncQueueSummaryComplete']=function(_0x352930){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xac5b('0x43')](_0x352930,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xac5b('0x70')]=function(_0x4c7cd5){try{if(this[_0xac5b('0x61')](_0x4c7cd5)){logger[_0xac5b('0x4a')](_0xac5b('0x71'),_0x4c7cd5[_0xac5b('0x4f')],util['inspect'](_0x4c7cd5,{'showHidden':![],'depth':null}));if(_[_0xac5b('0x62')](this[_0xac5b('0x12')][_0x4c7cd5[_0xac5b('0x4f')]]))this[_0xac5b('0x12')][_0x4c7cd5[_0xac5b('0x4f')]]=[];if(_[_0xac5b('0x62')](this['channels'][_0x4c7cd5[_0xac5b('0x4f')]]))this[_0xac5b('0x14')][_0x4c7cd5[_0xac5b('0x4f')]]={};var _0x4b6d41=new QueueReport();_0x4b6d41[_0xac5b('0x51')]=_0x4c7cd5[_0xac5b('0x69')];_0x4b6d41[_0xac5b('0x72')]=this['voiceQueues'][_0x4b6d41['name']]&&this['voiceQueues'][_0x4b6d41['name']][_0xac5b('0x72')]?this[_0xac5b('0x16')][_0x4b6d41['name']]['type']||_0xac5b('0x55'):'inbound';_0x4b6d41[_0xac5b('0x69')]=_0x4c7cd5[_0xac5b('0x69')];_0x4b6d41[_0xac5b('0x73')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));_0x4b6d41[_0xac5b('0x76')]=_0x4c7cd5[_0xac5b('0x76')];_0x4b6d41[_0xac5b('0x77')]=_0x4c7cd5['count'];_0x4b6d41[_0xac5b('0x4f')]=_0x4c7cd5[_0xac5b('0x4f')];_0x4b6d41[_0xac5b('0x78')]=this[_0xac5b('0x14')][_0x4c7cd5[_0xac5b('0x4f')]][_0xac5b('0x78')];logger[_0xac5b('0x6a')](_0xac5b('0x79'),_0x4b6d41[_0xac5b('0x51')],_0x4b6d41[_0xac5b('0x72')]);_[_0xac5b('0x7a')](_0x4b6d41,_['pick'](_0x4c7cd5,_[_0xac5b('0x7b')](_0x4b6d41)));this[_0xac5b('0x12')][_0x4c7cd5['uniqueid']][_0xac5b('0x7c')](_0x4b6d41);this[_0xac5b('0x14')][_0x4c7cd5[_0xac5b('0x4f')]]=_0x4b6d41;this['emitVoiceQueueChannelSave'](_0x4b6d41,_0xac5b('0x1f'));}}catch(_0x3d863d){logger[_0xac5b('0x3f')](_0xac5b('0x71'),_0x4c7cd5[_0xac5b('0x4f')],util['inspect'](_0x3d863d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x21')]=function(_0x2feffd){try{if(this[_0xac5b('0x61')](_0x2feffd)){logger['debug'](_0xac5b('0x7d'),_0x2feffd['uniqueid'],util[_0xac5b('0x43')](_0x2feffd,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2feffd[_0xac5b('0x4f')]]){var _0x372c9d=_[_0xac5b('0x7e')](this['queueReports'][_0x2feffd[_0xac5b('0x4f')]]);_0x372c9d[_0xac5b('0x7f')]=![];_0x372c9d[_0xac5b('0x80')]=null;_0x372c9d[_0xac5b('0x81')]=_0x2feffd[_0xac5b('0x81')];_0x372c9d[_0xac5b('0x82')]=_0x2feffd[_0xac5b('0x82')];_0x372c9d[_0xac5b('0x20')]=!![];_0x372c9d[_0xac5b('0x83')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));_0x372c9d['queuecallerexitreason']=_0xac5b('0x84');_0x372c9d['lastAssignedTo']=null;logger['info'](_0xac5b('0x85'),_0x372c9d['name'],_0x372c9d[_0xac5b('0x72')]);this[_0xac5b('0x14')][_0x2feffd[_0xac5b('0x4f')]]=_0x372c9d;this[_0xac5b('0x47')](_0x372c9d,_0xac5b('0x20'));}}}catch(_0x5222d0){logger[_0xac5b('0x3f')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2feffd[_0xac5b('0x4f')],util['inspect'](_0x5222d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x23')]=function(_0x522c48){try{if(this['isNotNull'](_0x522c48)){logger[_0xac5b('0x4a')]('[%s][voiceQueueReport][queuecallerleave]',_0x522c48['uniqueid'],util[_0xac5b('0x43')](_0x522c48,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x522c48[_0xac5b('0x4f')]]){var _0x213acf=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x522c48['uniqueid']]);_0x213acf[_0xac5b('0x86')]=moment()[_0xac5b('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x213acf[_0xac5b('0x87')]=_0x522c48[_0xac5b('0x87')];_0x213acf[_0xac5b('0x88')]=_0x522c48[_0xac5b('0x88')];logger['info'](_0xac5b('0x89'),_0x213acf[_0xac5b('0x51')],_0x213acf[_0xac5b('0x72')],_0x522c48[_0xac5b('0x87')],_0x522c48[_0xac5b('0x88')]);this[_0xac5b('0x14')][_0x522c48[_0xac5b('0x4f')]]=_0x213acf;this[_0xac5b('0x8a')](_0x213acf,_0xac5b('0x22'));}}}catch(_0x25141c){logger[_0xac5b('0x3f')](_0xac5b('0x8b'),_0x522c48[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x25141c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x8c')]=function(_0x3fffce){try{if(this['isNotNull'](_0x3fffce)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x3fffce[_0xac5b('0x4f')],util['inspect'](_0x3fffce,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x3fffce[_0xac5b('0x4f')]]){var _0x59ef2c=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x3fffce[_0xac5b('0x4f')]]);_0x59ef2c[_0xac5b('0x7f')]=!![];_0x59ef2c['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0xac5b('0x6a')](_0xac5b('0x8d'),_0x59ef2c['name'],_0x59ef2c[_0xac5b('0x72')]);}}}catch(_0x4f428a){logger['error'](_0xac5b('0x8e'),_0x3fffce[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x4f428a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xac5b('0x25')]=function(_0xe6543b){try{if(this[_0xac5b('0x61')](_0xe6543b)){logger['debug'](_0xac5b('0x8f'),_0xe6543b[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0xe6543b,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]]){var _0x381895=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]]);_0x381895[_0xac5b('0x20')]=![];_0x381895[_0xac5b('0x83')]=null;_0x381895['assigned']=!![];_0x381895['lastAssignedTo']=_0xe6543b[_0xac5b('0x90')];_0x381895[_0xac5b('0x81')]=_0xe6543b[_0xac5b('0x81')];_0x381895[_0xac5b('0x7f')]=!![];_0x381895['queuecallerexit']=![];_0x381895[_0xac5b('0x91')]=null;if(!_0x381895[_0xac5b('0x92')]){if(_0xe6543b[_0xac5b('0x93')]==_0xac5b('0x92')){_0x381895[_0xac5b('0x94')]=_0xac5b('0x95');logger[_0xac5b('0x6a')](_0xac5b('0x96'),_0x381895[_0xac5b('0x51')],_0x381895[_0xac5b('0x72')]);}else{if(_[_0xac5b('0x97')](_0xe6543b[_0xac5b('0x3c')][_0xac5b('0x98')](),_0xac5b('0x99'))){if(this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x9a')]]){var _0x412734=_[_0xac5b('0x7e')](this['queueReports'][_0xe6543b[_0xac5b('0x9a')]]);_0x412734[_0xac5b('0x7f')]=![];_0x412734[_0xac5b('0x9b')]=!![];_0x412734[_0xac5b('0x91')]=moment(_0x381895[_0xac5b('0x73')])[_0xac5b('0x9c')](_0xe6543b[_0xac5b('0x81')],_0xac5b('0x9d'))[_0xac5b('0x74')](_0xac5b('0x75'));_0x412734[_0xac5b('0x94')]='FORWARDTRANSFER';_0x412734['transfer']=!![];_0x412734['transfertype']=_0xac5b('0x9e');_0x412734[_0xac5b('0x9f')]=_0xe6543b[_0xac5b('0xa0')];_0x412734['transferuniqueid']=_0xe6543b[_0xac5b('0x4f')];logger[_0xac5b('0x6a')](_0xac5b('0xa1'),_0x412734[_0xac5b('0x51')],_0x412734[_0xac5b('0x72')]);var _0x115f09=this['queueReports'][_0xe6543b['linkedid']];this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x9a')]]=this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]];this[_0xac5b('0x12')][_0xe6543b[_0xac5b('0x4f')]]=_0x115f09;}}else{_0x381895[_0xac5b('0x94')]=_0xac5b('0xa2')+_0xe6543b[_0xac5b('0x93')][_0xac5b('0xa3')]();logger[_0xac5b('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x381895['name'],_0x381895[_0xac5b('0x72')],_0x381895[_0xac5b('0x94')]);}}}this['channels'][_0xe6543b[_0xac5b('0x4f')]]=_0x381895;this[_0xac5b('0x47')](_0x381895,_0xac5b('0x24'));}}}catch(_0x3ebcb7){logger['error'](_0xac5b('0x8f'),_0xe6543b[_0xac5b('0x4f')],util['inspect'](_0x3ebcb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xac5b('0xe')][_0xac5b('0x27')]=function(_0x35a093){try{if(this[_0xac5b('0x61')](_0x35a093)){logger[_0xac5b('0x4a')](_0xac5b('0xa4'),_0x35a093[_0xac5b('0x4f')],util[_0xac5b('0x43')](_0x35a093,{'showHidden':![],'depth':null}));this[_0xac5b('0xa5')](_0x35a093[_0xac5b('0x4f')],_[_0xac5b('0x7b')](_0x35a093['variable'])[0x0],_0x35a093['value']);if(this['queueReports'][_0x35a093[_0xac5b('0x4f')]]){var _0x3bf6eb=_[_0xac5b('0x7e')](this[_0xac5b('0x12')][_0x35a093[_0xac5b('0x4f')]]);if(_0x3bf6eb){if(this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')])&&this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')][_0xac5b('0xa7')])){switch(_0x35a093[_0xac5b('0xa8')]){case _0xac5b('0xa9'):_0x3bf6eb[_0xac5b('0x9b')]=![];_0x3bf6eb[_0xac5b('0x91')]=null;break;case _0xac5b('0xaa'):_0x3bf6eb[_0xac5b('0xab')]=_0xac5b('0xac');_0x3bf6eb[_0xac5b('0x9b')]=!![];_0x3bf6eb[_0xac5b('0x91')]=moment()[_0xac5b('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x3bf6eb[_0xac5b('0x86')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x35a093['uniqueid'],util['inspect'](_0x3bf6eb,{'showHidden':![],'depth':null}));ami[_0xac5b('0x49')](_0xac5b('0xad'),_0x3bf6eb);break;default:_0x3bf6eb['queuecallerexit']=!![];_0x3bf6eb[_0xac5b('0x91')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));_0x3bf6eb[_0xac5b('0x86')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));}_0x3bf6eb['queuecallerabandon']=![];_0x3bf6eb[_0xac5b('0x83')]=null;_0x3bf6eb[_0xac5b('0x94')]=_0x35a093[_0xac5b('0xa8')];this[_0xac5b('0x14')][_0x35a093[_0xac5b('0x4f')]]=_0x3bf6eb;this['emitVoiceQueueChannelRemove'](_0x3bf6eb,_0xac5b('0xae'));}else if(this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')])&&this[_0xac5b('0x61')](_0x35a093[_0xac5b('0xa6')]['queueposition'])){if(!_0x3bf6eb[_0xac5b('0x20')]){_0x3bf6eb[_0xac5b('0x9b')]=!![];_0x3bf6eb['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3bf6eb[_0xac5b('0x94')]=_0xac5b('0xaf');_0x3bf6eb[_0xac5b('0x86')]=moment()[_0xac5b('0x74')](_0xac5b('0x75'));this[_0xac5b('0x14')][_0x35a093['uniqueid']]=_0x3bf6eb;}}logger['info'](_0xac5b('0xb0'),_0x35a093[_0xac5b('0x4f')],_0x3bf6eb[_0xac5b('0x51')],_0x3bf6eb[_0xac5b('0x72')],_[_0xac5b('0x7b')](_0x35a093['variable'])[0x0],_0x35a093['value']);_0x3bf6eb[_0xac5b('0x19')]=this[_0xac5b('0x19')][_0x35a093[_0xac5b('0x4f')]];}}}}catch(_0x6030c2){logger[_0xac5b('0x3f')](_0xac5b('0xa4'),_0x35a093['uniqueid'],util[_0xac5b('0x43')](_0x6030c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0xf3f246,_0x1b879c,_0x20d341){var _0x344392=[_0xac5b('0xb1'),_0xac5b('0xb2'),_0xac5b('0xb3'),_0xac5b('0xb4'),_0xac5b('0xb5'),'rtpaudioqoslossbridged',_0xac5b('0xb6'),_0xac5b('0xb7'),_0xac5b('0xb8'),'sipuri',_0xac5b('0xb9'),_0xac5b('0xba'),_0xac5b('0xbb'),_0xac5b('0xbc'),_0xac5b('0xbd'),_0xac5b('0xbe'),'membername','memberpenalty','memberrealtime'];if(!_[_0xac5b('0x3b')](_0x1b879c)&&!_[_0xac5b('0xbf')](_0x344392,_0x1b879c)){if(_[_0xac5b('0x62')](this[_0xac5b('0x19')][_0xf3f246])){this['variables'][_0xf3f246]={};}this[_0xac5b('0x19')][_0xf3f246][_0x1b879c]=_0x20d341;}};VoiceQueueReport['prototype'][_0xac5b('0x29')]=function(_0x203de6){try{if(this['isNotNull'](_0x203de6)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x203de6[_0xac5b('0x4f')],util['inspect'](_0x203de6,{'showHidden':![],'depth':null}));if(this[_0xac5b('0x12')][_0x203de6[_0xac5b('0x4f')]]){for(var _0x26bb01=0x0,_0x12ff12={};_0x26bb01=0x0?moment(_0x50d964[_0x298f('0x14')])['diff'](_0x50d964[_0x298f('0x16')],'seconds'):null,'data1':_0x298f('0x18'),'data2':_0x50d964[_0x298f('0xd')],'data3':_0x50d964['exten'],'data4':_0x50d964['dialstring']||null,'role':'agent','internal':_0x50d964[_0x298f('0xd')]?_['toNumber'](_0x50d964[_0x298f('0xd')]):undefined,'uniqueid':_0x50d964[_0x298f('0xf')]},'log':_0x298f('0x5')});}; \ No newline at end of file +var _0x069b=['diff','seconds','inbound','calleridnum','agent','accountcode','toNumber','voiceDialReport','membername','TALKING','endtime','starttime','outbound','exten','uniqueid','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','interface','format','SIP/%s','queuecallerleaveAt'];(function(_0x52a95b,_0x12b149){var _0x476d7b=function(_0x3b7b47){while(--_0x3b7b47){_0x52a95b['push'](_0x52a95b['shift']());}};_0x476d7b(++_0x12b149);}(_0x069b,0x10b));var _0xb069=function(_0x5687e6,_0x4e44ad){_0x5687e6=_0x5687e6-0x0;var _0x4a1b13=_0x069b[_0x5687e6];return _0x4a1b13;};'use strict';var moment=require(_0xb069('0x0'));var _=require(_0xb069('0x1'));var util=require(_0xb069('0x2'));var client=require(_0xb069('0x3'));exports['voiceQueueReport']=function(_0x3f71f7){var _0x3119b9=_0x3f71f7[_0xb069('0x4')]||_0x3f71f7[_0xb069('0x5')];return client[_0xb069('0x6')](_0xb069('0x7'),{'body':{'channel':_0xb069('0x8'),'membername':_0x3f71f7['lastAssignedTo'],'interface':_['isNil'](_0x3f71f7[_0xb069('0x9')])?util[_0xb069('0xa')](_0xb069('0xb'),_0x3f71f7['lastAssignedTo']):_0x3f71f7[_0xb069('0x9')],'type':'TALKING','enterAt':_0x3f71f7[_0xb069('0xc')],'exitAt':_0x3119b9,'duration':moment(_0x3119b9)[_0xb069('0xd')](_0x3f71f7['queuecallerleaveAt'],_0xb069('0xe')),'data1':_0xb069('0xf'),'data2':_0x3f71f7[_0xb069('0x10')],'data3':_0x3f71f7['exten'],'data4':null,'data5':_0x3f71f7['queue'],'role':_0xb069('0x11'),'internal':_0x3f71f7[_0xb069('0x12')]?_[_0xb069('0x13')](_0x3f71f7[_0xb069('0x12')]):undefined,'uniqueid':_0x3f71f7['uniqueid']},'log':_0xb069('0x7')});};exports[_0xb069('0x14')]=function(_0x41bb89){return client[_0xb069('0x6')](_0xb069('0x7'),{'body':{'channel':_0xb069('0x8'),'membername':_0x41bb89[_0xb069('0x15')],'interface':_0x41bb89[_0xb069('0x9')],'type':_0xb069('0x16'),'enterAt':_0x41bb89['starttime'],'exitAt':_0x41bb89[_0xb069('0x17')],'duration':moment(_0x41bb89[_0xb069('0x17')])[_0xb069('0xd')](_0x41bb89[_0xb069('0x18')],_0xb069('0xe'))>=0x0?moment(_0x41bb89['endtime'])[_0xb069('0xd')](_0x41bb89['starttime'],_0xb069('0xe')):null,'data1':_0xb069('0x19'),'data2':_0x41bb89[_0xb069('0x12')],'data3':_0x41bb89[_0xb069('0x1a')],'data4':_0x41bb89['dialstring']||null,'role':_0xb069('0x11'),'internal':_0x41bb89[_0xb069('0x12')]?_['toNumber'](_0x41bb89[_0xb069('0x12')]):undefined,'uniqueid':_0x41bb89[_0xb069('0x1b')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 87135b3..ce03b47 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 _0xa1fd=['GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x4b7f85,_0x9535bf){var _0x177f8c=function(_0x9fc135){while(--_0x9fc135){_0x4b7f85['push'](_0x4b7f85['shift']());}};_0x177f8c(++_0x9535bf);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x5c6022,_0x5cd10b){_0x5c6022=_0x5c6022-0x0;var _0x4ab5af=_0xa1fd[_0x5c6022];return _0x4ab5af;};'use strict';var client=require(_0xda1f('0x0'));exports[_0xda1f('0x1')]=function(){return client[_0xda1f('0x2')](_0xda1f('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xda1f('0x4')});}; \ No newline at end of file +var _0x220b=['ShowSetting','stopRecordingOnTransfer','getSettings','Request'];(function(_0x241cb7,_0x580fbb){var _0x199d0d=function(_0x41b7d4){while(--_0x41b7d4){_0x241cb7['push'](_0x241cb7['shift']());}};_0x199d0d(++_0x580fbb);}(_0x220b,0x1a2));var _0xb220=function(_0x256d6a,_0x2f002f){_0x256d6a=_0x256d6a-0x0;var _0x460058=_0x220b[_0x256d6a];return _0x460058;};'use strict';var client=require('../client');exports[_0xb220('0x0')]=function(){return client[_0xb220('0x1')](_0xb220('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb220('0x3')]},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ab34832..f4a1063 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 _0x75af=['GetTemplate','name','html','../client','getTemplates','Request'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x75af,0x17d));var _0xf75a=function(_0x1dccdf,_0x30881d){_0x1dccdf=_0x1dccdf-0x0;var _0x22f333=_0x75af[_0x1dccdf];return _0x22f333;};'use strict';var client=require(_0xf75a('0x0'));exports[_0xf75a('0x1')]=function(_0x435961){return function(_0x424df8){return client[_0xf75a('0x2')](_0xf75a('0x3'),{'options':{'raw':!![],'attributes':['id',_0xf75a('0x4'),_0xf75a('0x5')]},'log':_0xf75a('0x3')});};}; \ No newline at end of file +var _0xa3c6=['name','html','GetTemplate','../client','getTemplates','Request'];(function(_0x36a77e,_0x232297){var _0x4ef836=function(_0x485166){while(--_0x485166){_0x36a77e['push'](_0x36a77e['shift']());}};_0x4ef836(++_0x232297);}(_0xa3c6,0xb1));var _0x6a3c=function(_0x3fe727,_0x4173cd){_0x3fe727=_0x3fe727-0x0;var _0x277c45=_0xa3c6[_0x3fe727];return _0x277c45;};'use strict';var client=require(_0x6a3c('0x0'));exports[_0x6a3c('0x1')]=function(_0x7ba933){return function(_0x28b56b){return client[_0x6a3c('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x6a3c('0x3'),_0x6a3c('0x4')]},'log':_0x6a3c('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 57bb968..2629d95 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 _0x6e36=['GetTrigger','name','channel','status','Condition','field','operator','value','AnyConditions','Action','Actions','data1','data2','data6','data7','getTriggers','Request'];(function(_0x10fe7f,_0x291456){var _0x256b09=function(_0x266356){while(--_0x266356){_0x10fe7f['push'](_0x10fe7f['shift']());}};_0x256b09(++_0x291456);}(_0x6e36,0x185));var _0x66e3=function(_0xf4555e,_0xff6417){_0xf4555e=_0xf4555e-0x0;var _0x207720=_0x6e36[_0xf4555e];return _0x207720;};'use strict';var client=require('../client');exports[_0x66e3('0x0')]=function(_0x5319fc){return function(_0x1af2d9){return client[_0x66e3('0x1')](_0x66e3('0x2'),{'options':{'raw':![],'attributes':['id',_0x66e3('0x3'),_0x66e3('0x4'),_0x66e3('0x5')],'include':[{'model':_0x66e3('0x6'),'as':'AllConditions','attributes':['id',_0x66e3('0x7'),_0x66e3('0x8'),_0x66e3('0x9')]},{'model':_0x66e3('0x6'),'as':_0x66e3('0xa'),'attributes':['id','field',_0x66e3('0x8'),_0x66e3('0x9')]},{'model':_0x66e3('0xb'),'as':_0x66e3('0xc'),'attributes':['id','action',_0x66e3('0xd'),_0x66e3('0xe'),'data3','data4','data5',_0x66e3('0xf'),_0x66e3('0x10')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xc8bd=['data4','data5','data6','data7','../client','getTriggers','GetTrigger','name','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data2','data3'];(function(_0xeecd58,_0x15b2bd){var _0x6757e4=function(_0x35c160){while(--_0x35c160){_0xeecd58['push'](_0xeecd58['shift']());}};_0x6757e4(++_0x15b2bd);}(_0xc8bd,0x158));var _0xdc8b=function(_0x2820fc,_0x481318){_0x2820fc=_0x2820fc-0x0;var _0x1e1508=_0xc8bd[_0x2820fc];return _0x1e1508;};'use strict';var client=require(_0xdc8b('0x0'));exports[_0xdc8b('0x1')]=function(_0x3f5306){return function(_0x159810){return client['Request'](_0xdc8b('0x2'),{'options':{'raw':![],'attributes':['id',_0xdc8b('0x3'),'channel',_0xdc8b('0x4')],'include':[{'model':_0xdc8b('0x5'),'as':_0xdc8b('0x6'),'attributes':['id',_0xdc8b('0x7'),_0xdc8b('0x8'),_0xdc8b('0x9')]},{'model':_0xdc8b('0x5'),'as':_0xdc8b('0xa'),'attributes':['id','field',_0xdc8b('0x8'),_0xdc8b('0x9')]},{'model':_0xdc8b('0xb'),'as':_0xdc8b('0xc'),'attributes':['id',_0xdc8b('0xd'),'data1',_0xdc8b('0xe'),_0xdc8b('0xf'),_0xdc8b('0x10'),_0xdc8b('0x11'),_0xdc8b('0x12'),_0xdc8b('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 7201b68..b2a0813 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 _0x9275=['GetTrunk','name','registry','defaultuser','getTrunks'];(function(_0x4d4c58,_0x404692){var _0x130d2e=function(_0x44549f){while(--_0x44549f){_0x4d4c58['push'](_0x4d4c58['shift']());}};_0x130d2e(++_0x404692);}(_0x9275,0x130));var _0x5927=function(_0x4aa4e6,_0x278c45){_0x4aa4e6=_0x4aa4e6-0x0;var _0x322588=_0x9275[_0x4aa4e6];return _0x322588;};'use strict';var client=require('../client');exports[_0x5927('0x0')]=function(_0xcde304){return function(_0x16b603){return client['Request'](_0x5927('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x5927('0x2'),_0x5927('0x3'),_0x5927('0x4')]},'log':_0x5927('0x1')});};}; \ No newline at end of file +var _0x1b36=['GetTrunk','getTrunks','Request','registry','defaultuser'];(function(_0x307ef5,_0x5dbf62){var _0x378b98=function(_0x24ff53){while(--_0x24ff53){_0x307ef5['push'](_0x307ef5['shift']());}};_0x378b98(++_0x5dbf62);}(_0x1b36,0x169));var _0x61b3=function(_0x5c54da,_0x4e74d5){_0x5c54da=_0x5c54da-0x0;var _0x40c155=_0x1b36[_0x5c54da];return _0x40c155;};'use strict';var client=require('../client');exports[_0x61b3('0x0')]=function(_0x8b6a30){return function(_0x598916){return client[_0x61b3('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x61b3('0x2'),_0x61b3('0x3')]},'log':_0x61b3('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index e063ca3..eea50a4 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x16db73,_0x4c06d3){var _0x523f67=function(_0x222e22){while(--_0x222e22){_0x16db73['push'](_0x16db73['shift']());}};_0x523f67(++_0x4c06d3);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x1151ec,_0x4576b9){var _0xce4b78=function(_0x9d4742){while(--_0x9d4742){_0x1151ec['push'](_0x1151ec['shift']());}};_0xce4b78(++_0x4576b9);}(_0x34e8,0x12c));var _0x834e=function(_0x5bb702,_0x44a577){_0x5bb702=_0x5bb702-0x0;var _0x5604b9=_0x34e8[_0x5bb702];return _0x5604b9;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 536d2c0..b27fcc3 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 _0x8926=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x3c3fe0,_0x3c7923){var _0x582ac9=function(_0x221cc5){while(--_0x221cc5){_0x3c3fe0['push'](_0x3c3fe0['shift']());}};_0x582ac9(++_0x3c7923);}(_0x8926,0x197));var _0x6892=function(_0xc1d14c,_0x414ced){_0xc1d14c=_0xc1d14c-0x0;var _0x5855a2=_0x8926[_0xc1d14c];return _0x5855a2;};'use strict';var client=require(_0x6892('0x0'));exports[_0x6892('0x1')]=function(_0x2c6ecd){return client[_0x6892('0x2')](_0x6892('0x3'),{'body':_0x2c6ecd,'log':_0x6892('0x3')});};exports['update']=function(_0x5efdf8,_0x24cac1,_0x1bb270){return client[_0x6892('0x2')]('UpdateVoiceAgentReport',{'body':_0x5efdf8,'options':{'where':{'uniqueid':_0x24cac1,'interface':_0x1bb270,'agentcomplete':!![]}},'log':_0x6892('0x4')});}; \ No newline at end of file +var _0x515b=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x446cce,_0x377102){var _0x541b3f=function(_0x1c14ee){while(--_0x1c14ee){_0x446cce['push'](_0x446cce['shift']());}};_0x541b3f(++_0x377102);}(_0x515b,0xfa));var _0xb515=function(_0x27cc6d,_0x1cd770){_0x27cc6d=_0x27cc6d-0x0;var _0x1f87f0=_0x515b[_0x27cc6d];return _0x1f87f0;};'use strict';var client=require(_0xb515('0x0'));exports[_0xb515('0x1')]=function(_0x2867e9){return client[_0xb515('0x2')](_0xb515('0x3'),{'body':_0x2867e9,'log':_0xb515('0x3')});};exports[_0xb515('0x4')]=function(_0x4e7a74,_0x51c6ae,_0x374620){return client[_0xb515('0x2')](_0xb515('0x5'),{'body':_0x4e7a74,'options':{'where':{'uniqueid':_0x51c6ae,'interface':_0x374620,'agentcomplete':!![]}},'log':_0xb515('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 1af086b..19d6014 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 _0xb65e=['type','disposition','duration','GetVoiceCallReports','moment','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x3be1a7,_0x4bb8fe){var _0x4a6085=function(_0x3d97c6){while(--_0x3d97c6){_0x3be1a7['push'](_0x3be1a7['shift']());}};_0x4a6085(++_0x4bb8fe);}(_0xb65e,0x180));var _0xeb65=function(_0x34fd50,_0x467434){_0x34fd50=_0x34fd50-0x0;var _0xc6930a=_0xb65e[_0x34fd50];return _0xc6930a;};'use strict';var moment=require(_0xeb65('0x0'));var util=require('util');var _=require(_0xeb65('0x1'));var client=require(_0xeb65('0x2'));exports[_0xeb65('0x3')]=function(_0x392e76){return client[_0xeb65('0x4')](_0xeb65('0x5'),{'body':_[_0xeb65('0x6')](_0x392e76,{'source':_0x392e76['calleridnum'],'destinationcontext':_0x392e76[_0xeb65('0x7')],'callerid':_0x392e76[_0xeb65('0x8')],'amaflags':_0xeb65('0x9')}),'log':_0xeb65('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xeb65('0x4')](_0xeb65('0xa'),{'options':{'where':{'type':[_0xeb65('0xb')],'createdAt':{'$between':[moment()['startOf'](_0xeb65('0xc'))[_0xeb65('0xd')](_0xeb65('0xe')),moment()[_0xeb65('0xf')](_0xeb65('0xc'))[_0xeb65('0xd')](_0xeb65('0xe'))]}},'attributes':[_0xeb65('0x10'),_0xeb65('0x11'),_0xeb65('0x12'),'billableseconds']},'log':_0xeb65('0x13')});};}; \ No newline at end of file +var _0x2763=['endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','../client','create','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x768345,_0x2ab450){var _0x48550a=function(_0x3f88b6){while(--_0x3f88b6){_0x768345['push'](_0x768345['shift']());}};_0x48550a(++_0x2ab450);}(_0x2763,0xcc));var _0x3276=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2763[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x3276('0x0'));var util=require(_0x3276('0x1'));var _=require(_0x3276('0x2'));var client=require(_0x3276('0x3'));exports[_0x3276('0x4')]=function(_0x5c5b03){return client['Request'](_0x3276('0x5'),{'body':_[_0x3276('0x6')](_0x5c5b03,{'source':_0x5c5b03[_0x3276('0x7')],'destinationcontext':_0x5c5b03[_0x3276('0x8')],'callerid':_0x5c5b03[_0x3276('0x9')],'amaflags':_0x3276('0xa')}),'log':_0x3276('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x3276('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x3276('0xc')](_0x3276('0xd'))[_0x3276('0xe')](_0x3276('0xf')),moment()[_0x3276('0x10')](_0x3276('0xd'))[_0x3276('0xe')](_0x3276('0xf'))]}},'attributes':[_0x3276('0x11'),_0x3276('0x12'),_0x3276('0x13'),_0x3276('0x14')]},'log':_0x3276('0x15')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index aa216e5..94e3057 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 _0x462d=['create','Request','CreateVoiceDialReport','../client'];(function(_0x52cbd1,_0x167f47){var _0x57471a=function(_0x473b24){while(--_0x473b24){_0x52cbd1['push'](_0x52cbd1['shift']());}};_0x57471a(++_0x167f47);}(_0x462d,0xd3));var _0xd462=function(_0x2e1e55,_0x3b1085){_0x2e1e55=_0x2e1e55-0x0;var _0x13e55c=_0x462d[_0x2e1e55];return _0x13e55c;};'use strict';var client=require(_0xd462('0x0'));exports[_0xd462('0x1')]=function(_0x3cb5ad){return client[_0xd462('0x2')](_0xd462('0x3'),{'body':_0x3cb5ad,'log':_0xd462('0x3')});}; \ No newline at end of file +var _0x23ba=['CreateVoiceDialReport','../client'];(function(_0x519051,_0x6675fe){var _0x43b9c9=function(_0x1dfaaf){while(--_0x1dfaaf){_0x519051['push'](_0x519051['shift']());}};_0x43b9c9(++_0x6675fe);}(_0x23ba,0x143));var _0xa23b=function(_0x11bf53,_0x47b0a6){_0x11bf53=_0x11bf53-0x0;var _0x19d79c=_0x23ba[_0x11bf53];return _0x19d79c;};'use strict';var client=require(_0xa23b('0x0'));exports['create']=function(_0x17f2ad){return client['Request'](_0xa23b('0x1'),{'body':_0x17f2ad,'log':_0xa23b('0x1')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3859b5b..38b6b05 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 _0xbee3=['getVoiceExtensions','exten','recordingFormat'];(function(_0xac7e76,_0x1fa476){var _0x51bf57=function(_0x324ff6){while(--_0x324ff6){_0xac7e76['push'](_0xac7e76['shift']());}};_0x51bf57(++_0x1fa476);}(_0xbee3,0xd5));var _0x3bee=function(_0x14f7f5,_0x286ac7){_0x14f7f5=_0x14f7f5-0x0;var _0x3207f1=_0xbee3[_0x14f7f5];return _0x3207f1;};'use strict';var client=require('../client');exports[_0x3bee('0x0')]=function(){return function(){return client['Request']('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x3bee('0x1'),_0x3bee('0x2')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xfd6f=['Request','GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0xb3f12b,_0x40e1e8){var _0x50e42f=function(_0x51507e){while(--_0x51507e){_0xb3f12b['push'](_0xb3f12b['shift']());}};_0x50e42f(++_0x40e1e8);}(_0xfd6f,0x19d));var _0xffd6=function(_0x383527,_0x36992d){_0x383527=_0x383527-0x0;var _0x1a05aa=_0xfd6f[_0x383527];return _0x1a05aa;};'use strict';var client=require(_0xffd6('0x0'));exports[_0xffd6('0x1')]=function(){return function(){return client[_0xffd6('0x2')](_0xffd6('0x3'),{'options':{'raw':!![],'attributes':['id',_0xffd6('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xffd6('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index efa8137..980b60b 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 _0xaad2=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','TrunkBackup','Interval','interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaad2,0x139));var _0x2aad=function(_0x421c56,_0x4efd00){_0x421c56=_0x421c56-0x0;var _0x49b244=_0xaad2[_0x421c56];return _0x49b244;};'use strict';var client=require(_0x2aad('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x2aad('0x1')](_0x2aad('0x2'),{'options':{'raw':![],'attributes':['id',_0x2aad('0x3'),_0x2aad('0x4'),'acwTimeout',_0x2aad('0x5'),_0x2aad('0x6'),'type',_0x2aad('0x7'),_0x2aad('0x8'),'dialLimitChannel',_0x2aad('0x9'),'dialPowerLevel',_0x2aad('0xa'),_0x2aad('0xb'),_0x2aad('0xc'),_0x2aad('0xd'),'dialOriginateCallerIdNumber',_0x2aad('0xe'),_0x2aad('0xf'),_0x2aad('0x10'),'dialQueueProject',_0x2aad('0x11'),'dialCongestionRetryFrequency',_0x2aad('0x12'),_0x2aad('0x13'),_0x2aad('0x14'),_0x2aad('0x15'),_0x2aad('0x16'),_0x2aad('0x17'),_0x2aad('0x18'),'dialPrefix','dialCheckDuplicateType',_0x2aad('0x19'),_0x2aad('0x1a'),'dialAMDGreeting','dialAMDAfterGreetingSilence',_0x2aad('0x1b'),_0x2aad('0x1c'),'dialAMDBetweenWordsSilence',_0x2aad('0x1d'),_0x2aad('0x1e'),'dialAMDMaximumWordLength',_0x2aad('0x1f'),_0x2aad('0x20'),_0x2aad('0x21'),_0x2aad('0x22'),_0x2aad('0x23'),_0x2aad('0x24'),_0x2aad('0x25'),_0x2aad('0x6'),_0x2aad('0x26'),'dialRandomLastDigitCallerIdNumber',_0x2aad('0x27'),_0x2aad('0x28'),_0x2aad('0x29'),_0x2aad('0x2a'),_0x2aad('0x2b'),_0x2aad('0x2c'),_0x2aad('0x2d'),_0x2aad('0x2e'),_0x2aad('0x2f'),_0x2aad('0x30'),_0x2aad('0x31'),_0x2aad('0x32'),_0x2aad('0x33'),_0x2aad('0x34')],'include':[{'model':_0x2aad('0x35'),'as':'Trunk','attributes':['id',_0x2aad('0x3'),_0x2aad('0x36'),_0x2aad('0x37')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0x2aad('0x3')]},{'model':_0x2aad('0x35'),'as':_0x2aad('0x38'),'attributes':['id',_0x2aad('0x3'),'callerid',_0x2aad('0x37')]},{'model':'Interval','as':_0x2aad('0x39'),'attributes':['id',_0x2aad('0x3')],'include':[{'model':_0x2aad('0x39'),'as':'Intervals','attributes':['id',_0x2aad('0x3'),_0x2aad('0x3a')]}]}]},'log':_0x2aad('0x3b')});};}; \ No newline at end of file +var _0x7a98=['dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt'];(function(_0x5ce4d2,_0x2365f7){var _0x1e5009=function(_0x33aabf){while(--_0x33aabf){_0x5ce4d2['push'](_0x5ce4d2['shift']());}};_0x1e5009(++_0x2365f7);}(_0x7a98,0xc9));var _0x87a9=function(_0x50c5a7,_0x10cf88){_0x50c5a7=_0x50c5a7-0x0;var _0xe2bf08=_0x7a98[_0x50c5a7];return _0xe2bf08;};'use strict';var client=require(_0x87a9('0x0'));exports[_0x87a9('0x1')]=function(){return function(){return client[_0x87a9('0x2')](_0x87a9('0x3'),{'options':{'raw':![],'attributes':['id',_0x87a9('0x4'),_0x87a9('0x5'),_0x87a9('0x6'),'autopause',_0x87a9('0x7'),_0x87a9('0x8'),_0x87a9('0x9'),_0x87a9('0xa'),'dialLimitChannel',_0x87a9('0xb'),_0x87a9('0xc'),'dialPredictiveOptimization',_0x87a9('0xd'),'dialPredictiveInterval',_0x87a9('0xe'),_0x87a9('0xf'),_0x87a9('0x10'),_0x87a9('0x11'),_0x87a9('0x12'),'dialQueueProject',_0x87a9('0x13'),_0x87a9('0x14'),'dialBusyMaxRetry',_0x87a9('0x15'),'dialNoAnswerMaxRetry',_0x87a9('0x16'),_0x87a9('0x17'),'dialTimezone',_0x87a9('0x18'),_0x87a9('0x19'),_0x87a9('0x1a'),_0x87a9('0x1b'),_0x87a9('0x1c'),'dialAMDGreeting',_0x87a9('0x1d'),_0x87a9('0x1e'),_0x87a9('0x1f'),_0x87a9('0x20'),'dialAMDMaximumNumberOfWords',_0x87a9('0x21'),_0x87a9('0x22'),_0x87a9('0x23'),_0x87a9('0x24'),_0x87a9('0x25'),_0x87a9('0x26'),_0x87a9('0x27'),_0x87a9('0x28'),_0x87a9('0x29'),_0x87a9('0x7'),_0x87a9('0x2a'),_0x87a9('0x2b'),_0x87a9('0x2c'),_0x87a9('0x2d'),'dialNoSuchNumberRetryFrequency',_0x87a9('0x2e'),'dialDropRetryFrequency',_0x87a9('0x2f'),'dialAbandonedRetryFrequency',_0x87a9('0x30'),_0x87a9('0x31'),'dialAgentRejectMaxRetry',_0x87a9('0x32'),'mandatoryDisposition',_0x87a9('0x33'),_0x87a9('0x34')],'include':[{'model':_0x87a9('0x35'),'as':_0x87a9('0x35'),'attributes':['id',_0x87a9('0x4'),'callerid','active']},{'model':_0x87a9('0x36'),'as':_0x87a9('0x37'),'attributes':['id',_0x87a9('0x4')]},{'model':_0x87a9('0x35'),'as':_0x87a9('0x38'),'attributes':['id','name','callerid',_0x87a9('0x39')]},{'model':'Interval','as':_0x87a9('0x3a'),'attributes':['id','name'],'include':[{'model':_0x87a9('0x3a'),'as':_0x87a9('0x3b'),'attributes':['id',_0x87a9('0x4'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 24a2b2d..dc830f8 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(_0x194f92,_0x76a1ee){var _0x5039d5=function(_0x3871db){while(--_0x3871db){_0x194f92['push'](_0x194f92['shift']());}};_0x5039d5(++_0x76a1ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x18fc81,_0x7e7392){var _0x1f1bf4=function(_0x2a06d3){while(--_0x2a06d3){_0x18fc81['push'](_0x18fc81['shift']());}};_0x1f1bf4(++_0x7e7392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 52d32b2..0b207d9 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 _0x55d1=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x55d1,0x8a));var _0x155d=function(_0x46b8aa,_0x246d21){_0x46b8aa=_0x46b8aa-0x0;var _0x5a3d61=_0x55d1[_0x46b8aa];return _0x5a3d61;};'use strict';var client=require('../client');exports[_0x155d('0x0')]=function(_0x5b7fd5){return function(){return client['Request'](_0x155d('0x1'),{'options':{'where':{'VoiceQueueId':_0x5b7fd5,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0x235f=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x8047da,_0x5ab144){var _0x364806=function(_0x3dc1d8){while(--_0x3dc1d8){_0x8047da['push'](_0x8047da['shift']());}};_0x364806(++_0x5ab144);}(_0x235f,0x67));var _0xf235=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x235f[_0x511bd1];return _0x4c48ec;};'use strict';var client=require(_0xf235('0x0'));exports[_0xf235('0x1')]=function(_0x50e147){return function(){return client['Request'](_0xf235('0x2'),{'options':{'where':{'VoiceQueueId':_0x50e147,'paused':!![]},'raw':!![]},'log':_0xf235('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 0b155f0..bc0335a 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(_0x4a5569,_0x59f540){var _0x47e1c1=function(_0xf964ee){while(--_0xf964ee){_0x4a5569['push'](_0x4a5569['shift']());}};_0x47e1c1(++_0x59f540);}(_0x7a54,0x106));var _0x47a5=function(_0x4b1941,_0x51a23a){_0x4b1941=_0x4b1941-0x0;var _0x68a823=_0x7a54[_0x4b1941];return _0x68a823;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x363934,_0x317855){var _0x37b9d7=function(_0x1f8cf9){while(--_0x1f8cf9){_0x363934['push'](_0x363934['shift']());}};_0x37b9d7(++_0x317855);}(_0x7a54,0x106));var _0x47a5=function(_0x64b61d,_0x3e5dec){_0x64b61d=_0x64b61d-0x0;var _0x4ba44d=_0x7a54[_0x64b61d];return _0x4ba44d;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2b04c5b..7272e92 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 _0xc1ef=['transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','transfers','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xc1ef,0x1eb));var _0xfc1e=function(_0x3db822,_0x365976){_0x3db822=_0x3db822-0x0;var _0x3c96f1=_0xc1ef[_0x3db822];return _0x3c96f1;};'use strict';var client=require('../client');exports[_0xfc1e('0x0')]={};exports['blindTransfer']=function(_0x13a321){return client[_0xfc1e('0x1')](_0xfc1e('0x2'),{'body':{'result':_0x13a321[_0xfc1e('0x3')],'transfererchannel':_0x13a321[_0xfc1e('0x4')],'transferercalleridnum':_0x13a321['transferercalleridnum'],'transferercalleridname':_0x13a321[_0xfc1e('0x5')],'transfererconnectedlinenum':_0x13a321[_0xfc1e('0x6')],'transfererconnectedlinename':_0x13a321['transfererconnectedlinename'],'transfereraccountcode':_0x13a321[_0xfc1e('0x7')],'transferercontext':_0x13a321[_0xfc1e('0x8')],'transfererexten':_0x13a321[_0xfc1e('0x9')],'transfererlinkedid':_0x13a321[_0xfc1e('0xa')],'transfereechannel':_0x13a321[_0xfc1e('0xb')],'transfereecalleridnum':_0x13a321['transfereecalleridnum'],'transfereecalleridname':_0x13a321[_0xfc1e('0xc')],'transfereeconnectedlinenum':_0x13a321[_0xfc1e('0xd')],'transfereeconnectedlinename':_0x13a321['transfereeconnectedlinename'],'transfereeaccountcode':_0x13a321[_0xfc1e('0xe')],'transfereecontext':_0x13a321[_0xfc1e('0xf')],'transfereeexten':_0x13a321[_0xfc1e('0x10')],'transfereelinkedid':_0x13a321[_0xfc1e('0x11')],'isexternal':_0x13a321[_0xfc1e('0x12')],'context':_0x13a321['context'],'extension':_0x13a321[_0xfc1e('0x13')],'type':_0xfc1e('0x14')},'log':_0xfc1e('0x2')});};exports[_0xfc1e('0x15')]=function(_0x37e575){return client[_0xfc1e('0x1')](_0xfc1e('0x2'),{'body':{'result':_0x37e575['result'],'transfererchannel':_0x37e575[_0xfc1e('0x16')],'transferercalleridnum':_0x37e575['origtransferercalleridnum'],'transferercalleridname':_0x37e575[_0xfc1e('0x17')],'transfererconnectedlinenum':_0x37e575['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x37e575[_0xfc1e('0x18')],'transfereraccountcode':_0x37e575[_0xfc1e('0x19')],'transferercontext':_0x37e575['secondtransferercontext'],'transfererexten':_0x37e575[_0xfc1e('0x1a')],'transfererlinkedid':_0x37e575['origtransfererlinkedid'],'transfereechannel':_0x37e575['transfertargetchannel'],'transfereecalleridnum':_0x37e575[_0xfc1e('0x1b')],'transfereecalleridname':_0x37e575[_0xfc1e('0x1c')],'transfereeconnectedlinenum':_0x37e575[_0xfc1e('0x1d')],'transfereeconnectedlinename':_0x37e575['transfertargetconnectedlinename'],'transfereeaccountcode':_0x37e575[_0xfc1e('0x1e')],'transfereecontext':_0x37e575[_0xfc1e('0x1f')],'transfereeexten':_0x37e575[_0xfc1e('0x20')],'transfereelinkedid':_0x37e575[_0xfc1e('0x21')],'isexternal':_0x37e575['isexternal'],'context':_0x37e575[_0xfc1e('0x22')],'extension':_0x37e575['origtransfererexten'],'type':_0xfc1e('0x23')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x4077=['transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','context','blind','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransfererlinkedid'];(function(_0x4f9673,_0x4313bd){var _0x337e5e=function(_0x5677cf){while(--_0x5677cf){_0x4f9673['push'](_0x4f9673['shift']());}};_0x337e5e(++_0x4313bd);}(_0x4077,0x1a1));var _0x7407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4077[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x7407('0x0'));exports[_0x7407('0x1')]={};exports[_0x7407('0x2')]=function(_0x14ca13){return client[_0x7407('0x3')](_0x7407('0x4'),{'body':{'result':_0x14ca13[_0x7407('0x5')],'transfererchannel':_0x14ca13[_0x7407('0x6')],'transferercalleridnum':_0x14ca13[_0x7407('0x7')],'transferercalleridname':_0x14ca13[_0x7407('0x8')],'transfererconnectedlinenum':_0x14ca13[_0x7407('0x9')],'transfererconnectedlinename':_0x14ca13[_0x7407('0xa')],'transfereraccountcode':_0x14ca13[_0x7407('0xb')],'transferercontext':_0x14ca13['transferercontext'],'transfererexten':_0x14ca13['transfererexten'],'transfererlinkedid':_0x14ca13[_0x7407('0xc')],'transfereechannel':_0x14ca13[_0x7407('0xd')],'transfereecalleridnum':_0x14ca13[_0x7407('0xe')],'transfereecalleridname':_0x14ca13['transfereecalleridname'],'transfereeconnectedlinenum':_0x14ca13[_0x7407('0xf')],'transfereeconnectedlinename':_0x14ca13[_0x7407('0x10')],'transfereeaccountcode':_0x14ca13[_0x7407('0x11')],'transfereecontext':_0x14ca13['transfereecontext'],'transfereeexten':_0x14ca13['transfereeexten'],'transfereelinkedid':_0x14ca13['transfereelinkedid'],'isexternal':_0x14ca13['isexternal'],'context':_0x14ca13[_0x7407('0x12')],'extension':_0x14ca13['extension'],'type':_0x7407('0x13')},'log':_0x7407('0x4')});};exports['attendedTransfer']=function(_0xc4c7c4){return client[_0x7407('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0xc4c7c4[_0x7407('0x5')],'transfererchannel':_0xc4c7c4[_0x7407('0x14')],'transferercalleridnum':_0xc4c7c4[_0x7407('0x15')],'transferercalleridname':_0xc4c7c4[_0x7407('0x16')],'transfererconnectedlinenum':_0xc4c7c4[_0x7407('0x17')],'transfererconnectedlinename':_0xc4c7c4['secondtransfererconnectedlinename'],'transfereraccountcode':_0xc4c7c4['origtransfereraccountcode'],'transferercontext':_0xc4c7c4[_0x7407('0x18')],'transfererexten':_0xc4c7c4[_0x7407('0x19')],'transfererlinkedid':_0xc4c7c4[_0x7407('0x1a')],'transfereechannel':_0xc4c7c4[_0x7407('0x1b')],'transfereecalleridnum':_0xc4c7c4['transfertargetcalleridnum'],'transfereecalleridname':_0xc4c7c4[_0x7407('0x1c')],'transfereeconnectedlinenum':_0xc4c7c4[_0x7407('0x1d')],'transfereeconnectedlinename':_0xc4c7c4[_0x7407('0x1e')],'transfereeaccountcode':_0xc4c7c4['transfertargetaccountcode'],'transfereecontext':_0xc4c7c4[_0x7407('0x1f')],'transfereeexten':_0xc4c7c4[_0x7407('0x20')],'transfereelinkedid':_0xc4c7c4[_0x7407('0x21')],'isexternal':_0xc4c7c4['isexternal'],'context':_0xc4c7c4[_0x7407('0x22')],'extension':_0xc4c7c4[_0x7407('0x23')],'type':_0x7407('0x24')},'log':_0x7407('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 6dffac3..5521929 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 _0x8ace=['YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','stop','%s.%s','status','StopMixMonitor\x20Success','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','campaigns','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','pick','keys','action','Reload','Action','then','message','join','command','Command','content','catch','voiceQueues','hasOwnProperty','answered','available','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','omit','undefined','channels','length','voicechannel','map','find','channel','format','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8ace,0x1bc));var _0xe8ac=function(_0x1765c4,_0x151565){_0x1765c4=_0x1765c4-0x0;var _0x56645f=_0x8ace[_0x1765c4];return _0x56645f;};'use strict';var _=require(_0xe8ac('0x0'));var util=require(_0xe8ac('0x1'));var jayson=require(_0xe8ac('0x2'));var schema=require(_0xe8ac('0x3'));var BPromise=require(_0xe8ac('0x4'));var moment=require(_0xe8ac('0x5'));var config=require(_0xe8ac('0x6'));var properties=require(_0xe8ac('0x7'));var ami=require(_0xe8ac('0x8'));exports[_0xe8ac('0x9')]=function(_0x199794,_0x224fc8,_0x170e14){return new BPromise(function(_0x2b48ec,_0x4eb087){var _0x2d56f0={'QueuePause':function(_0x1357ed){return new Promise(function(_0x4f9233,_0x5c83e1){var _0x4644ef=util['format'](_0xe8ac('0xa'),_0xe8ac('0xb'),_0x1357ed[_0xe8ac('0xc')]);if(_0x199794[_0xe8ac('0xd')]&&_0x199794[_0xe8ac('0xd')][_0x4644ef]&&_0x199794[_0xe8ac('0xd')][_0x4644ef]['timer']){_0x199794[_0xe8ac('0xd')][_0x4644ef][_0xe8ac('0xe')]();}if(_0x199794[_0xe8ac('0xf')][_0x4644ef]){_0x199794['agents'][_0x4644ef][_0xe8ac('0x10')]({'statePause':_0x1357ed[_0xe8ac('0x11')]?!![]:![]});}_0x4f9233({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x183b7d){var _0x2d2935=this;return new Promise(function(_0x383fe0,_0x101b33){if(ami[_0xe8ac('0x12')]()==![]){return _0x101b33(_0x2d2935[_0xe8ac('0x13')](0x1f4,[config[_0xe8ac('0x14')]['ip'],config[_0xe8ac('0x14')][_0xe8ac('0x15')],_0xe8ac('0x16')]['join']('\x20')));}_0x183b7d=_[_0xe8ac('0x17')](_0x183b7d,_[_0xe8ac('0x18')](properties['module']));_0x183b7d[_0xe8ac('0x19')]=_0xe8ac('0x1a');return ami[_0xe8ac('0x1b')](_0x183b7d)[_0xe8ac('0x1c')](function(_0x25d219){_0x383fe0({'code':0xc8,'message':_0x25d219[_0xe8ac('0x1d')]});})['catch'](function(_0x59df3d){_0x101b33(_0x2d2935['error'](0x1f5,_0x59df3d[_0xe8ac('0x1d')]));});});},'Command':function(_0x24a346){var _0x4e5d00=this;return new Promise(function(_0x6d7bb2,_0x5bc15e){if(ami[_0xe8ac('0x12')]()==![]){return _0x5bc15e(_0x4e5d00[_0xe8ac('0x13')](0x1f4,[config['asterisk']['ip'],config[_0xe8ac('0x14')][_0xe8ac('0x15')],_0xe8ac('0x16')][_0xe8ac('0x1e')]('\x20')));}_0x24a346=_['pick'](_0x24a346,_0xe8ac('0x1f'));_0x24a346['action']=_0xe8ac('0x20');return ami[_0xe8ac('0x1b')](_0x24a346)[_0xe8ac('0x1c')](function(_0x252440){_0x6d7bb2({'code':0xc8,'message':_0x252440[_0xe8ac('0x21')]});})[_0xe8ac('0x22')](function(_0x38565d){_0x5bc15e(_0x4e5d00['error'](0x1f5,_0x38565d[_0xe8ac('0x1d')]));});});},'VoiceQueues':function(_0x44663c){return new Promise(function(_0x183dbf,_0x7c3450){var _0x340ae0=[];for(var _0x3a92e1 in _0x199794[_0xe8ac('0x23')]){if(_0x199794[_0xe8ac('0x23')][_0xe8ac('0x24')](_0x3a92e1)){var _0x562e44=_0x199794['voiceQueues'][_0x3a92e1];var _0x346dcb={'id':_0x562e44['id'],'name':_0x562e44[_0xe8ac('0xc')],'strategy':_0x562e44['strategy'],'answered':_0x562e44[_0xe8ac('0x25')],'available':_0x562e44[_0xe8ac('0x26')],'loggedIn':_0x562e44['loggedIn'],'pTalking':_0x562e44['pTalking'],'sumBillable':_0x562e44[_0xe8ac('0x27')],'sumDuration':_0x562e44[_0xe8ac('0x28')],'sumHoldTime':_0x562e44[_0xe8ac('0x29')]||0x0,'talking':_0x562e44[_0xe8ac('0x2a')],'total':_0x562e44[_0xe8ac('0x2b')],'type':_0x562e44[_0xe8ac('0x2c')],'unmanaged':_0x562e44[_0xe8ac('0x2d')],'abandoned':_0x562e44['abandoned'],'waiting':_0x562e44[_0xe8ac('0x2e')],'loggedInDb':_0x562e44['loggedInDb']};if(_0x562e44[_0xe8ac('0x2c')]==='outbound'){_0x346dcb['dialActive']=_0x562e44['dialActive'];_0x346dcb['dialMethod']=_0x562e44[_0xe8ac('0x2f')];_0x346dcb[_0xe8ac('0x30')]=_0x562e44[_0xe8ac('0x30')];_0x346dcb[_0xe8ac('0x31')]=_0x562e44[_0xe8ac('0x31')];_0x346dcb[_0xe8ac('0x32')]=_0x562e44[_0xe8ac('0x32')];_0x346dcb['dialPrefix']=_0x562e44[_0xe8ac('0x33')];_0x346dcb['temp']=_0x562e44['temp'];_0x346dcb['outboundAnswerAgiCallsDay']=_0x562e44[_0xe8ac('0x34')];_0x346dcb[_0xe8ac('0x35')]=_0x562e44[_0xe8ac('0x35')];_0x346dcb['outboundBlacklistCallsDay']=_0x562e44['outboundBlacklistCallsDay'];_0x346dcb[_0xe8ac('0x36')]=_0x562e44[_0xe8ac('0x36')];_0x346dcb[_0xe8ac('0x37')]=_0x562e44[_0xe8ac('0x37')];_0x346dcb['outboundDropCallsDayACS']=_0x562e44[_0xe8ac('0x38')];_0x346dcb[_0xe8ac('0x39')]=_0x562e44[_0xe8ac('0x39')];_0x346dcb[_0xe8ac('0x3a')]=_0x562e44[_0xe8ac('0x3a')];_0x346dcb[_0xe8ac('0x3b')]=_0x562e44[_0xe8ac('0x3b')];_0x346dcb['outboundNoSuchCallsDay']=_0x562e44[_0xe8ac('0x3c')];_0x346dcb[_0xe8ac('0x3d')]=_0x562e44['outboundOriginateFailureCallsDay'];_0x346dcb[_0xe8ac('0x3e')]=_0x562e44[_0xe8ac('0x3e')];_0x346dcb[_0xe8ac('0x3f')]=_0x562e44[_0xe8ac('0x3f')];_0x346dcb['outboundUnknownCallsDay']=_0x562e44[_0xe8ac('0x40')];_0x346dcb['predictiveIntervalAnsweredCalls']=_0x562e44['predictiveIntervalAnsweredCalls'];_0x346dcb[_0xe8ac('0x41')]=_0x562e44[_0xe8ac('0x41')];_0x346dcb[_0xe8ac('0x42')]=_0x562e44[_0xe8ac('0x42')];_0x346dcb[_0xe8ac('0x43')]=_0x562e44[_0xe8ac('0x43')];_0x346dcb[_0xe8ac('0x44')]=_0x562e44[_0xe8ac('0x44')];_0x346dcb[_0xe8ac('0x45')]=_0x562e44['predictiveIntervalErlangCalls'];_0x346dcb['predictiveIntervalErlangCallsDroppedCalls']=_0x562e44[_0xe8ac('0x46')];_0x346dcb[_0xe8ac('0x47')]=_0x562e44['predictiveIntervalHitRate'];_0x346dcb['predictiveIntervalMultiplicativeFactor']=_0x562e44['predictiveIntervalMultiplicativeFactor'];_0x346dcb[_0xe8ac('0x48')]=_0x562e44[_0xe8ac('0x48')];_0x346dcb[_0xe8ac('0x49')]=_0x562e44[_0xe8ac('0x49')];_0x346dcb['predictiveIntervalTotalCalls']=_0x562e44[_0xe8ac('0x4a')];_0x346dcb[_0xe8ac('0x1d')]=_0x562e44['message'];_0x346dcb[_0xe8ac('0x4b')]=_0x562e44[_0xe8ac('0x4b')];_0x346dcb[_0xe8ac('0x4c')]=_0x562e44[_0xe8ac('0x4c')];_0x346dcb['erlangCallToSecond']=_0x562e44['erlangCallToSecond'];_0x346dcb['erlangAbandonmentRate']=_0x562e44[_0xe8ac('0x4d')];_0x346dcb[_0xe8ac('0x4e')]=_0x562e44[_0xe8ac('0x4e')];_0x346dcb[_0xe8ac('0x4f')]=_0x562e44['startPredictive'];_0x346dcb['startProgressive']=_0x562e44[_0xe8ac('0x50')];}if(_0x562e44[_0xe8ac('0x51')]){_0x346dcb[_0xe8ac('0x51')]={'id':_0x562e44[_0xe8ac('0x51')]['id'],'name':_0x562e44[_0xe8ac('0x51')][_0xe8ac('0xc')],'active':_0x562e44[_0xe8ac('0x51')][_0xe8ac('0x52')],'callerid':_0x562e44[_0xe8ac('0x51')][_0xe8ac('0x53')]};}if(_0x562e44[_0xe8ac('0x54')]){_0x346dcb[_0xe8ac('0x54')]={'id':_0x562e44[_0xe8ac('0x54')]['id'],'name':_0x562e44[_0xe8ac('0x54')]['name']};}_0x340ae0[_0xe8ac('0x55')](_0x346dcb);}}_0x183dbf({'count':_0x340ae0['length'],'rows':_0x340ae0});});},'UpdateVoiceQueue':function(_0x5f0fc0){return new Promise(function(_0x50e65a,_0x51fefc){var _0x368e31=_['find'](_0x199794[_0xe8ac('0x23')],{'id':parseInt(_0x5f0fc0['id'])});var _0x49c0af=_[_0xe8ac('0x56')](_0x5f0fc0,['id']);if(_0x368e31){for(var _0x27ce51 in _0x49c0af){if(typeof _0x49c0af[_0x27ce51]!=='undefined'&&typeof _0x368e31[_0x27ce51]!==_0xe8ac('0x57')){_0x368e31[_0x27ce51]=_0x49c0af[_0x27ce51];}}_0x50e65a(_0x368e31);}else{_0x51fefc();}});},'VoiceChannels':function(_0x4ec426){return new Promise(function(_0x160dfb,_0x388115){var _0x386aca=_['values'](_0x199794[_0xe8ac('0x58')]);_0x160dfb({'count':_0x386aca[_0xe8ac('0x59')],'rows':_0x386aca});});},'VoiceChannelMixMonitor':function(_0x2eba9e){var _0x52c6a5=this;return new Promise(function(_0x45b3d7,_0x2cad0c){if(ami[_0xe8ac('0x12')]()==![]){return _0x2cad0c(_0x52c6a5['error'](0x1f4,[config[_0xe8ac('0x14')]['ip'],config['asterisk'][_0xe8ac('0x15')],_0xe8ac('0x16')][_0xe8ac('0x1e')]('\x20')));}var _0x5686d9=schema(properties[_0xe8ac('0x5a')])[_0xe8ac('0x3')](_0x2eba9e);if(_0x5686d9[_0xe8ac('0x59')]>0x0){return _0x2cad0c(_0x52c6a5[_0xe8ac('0x13')](0x1f4,_[_0xe8ac('0x5b')](_0x5686d9,_0xe8ac('0x1d'))[_0xe8ac('0x1e')](',\x20')));}var _0x21272e=_[_0xe8ac('0x5c')](_0x199794[_0xe8ac('0x58')],{'uniqueid':_0x2eba9e['uniqueid']});if(_0x21272e&&_0x21272e[_0xe8ac('0x5d')]){var _0xf34f72=util[_0xe8ac('0x5e')]('%s.%s',_0x2eba9e[_0xe8ac('0x5f')]||_0x2eba9e[_0xe8ac('0x60')],_0x2eba9e[_0xe8ac('0x5e')]||_0xe8ac('0x61'));return ami[_0xe8ac('0x1b')]({'action':_0xe8ac('0x62'),'channel':_0x21272e[_0xe8ac('0x5d')],'file':_0xf34f72,'options':_0xe8ac('0x63')})[_0xe8ac('0x1c')](function(_0x29fa3b){var _0xf6ff7f=_['find'](_0x21272e[_0xe8ac('0x64')],{'filename':_0xe8ac('0x65')+_0xf34f72[_0xe8ac('0x66')]()});if(_[_0xe8ac('0x67')](_0xf6ff7f)){_0x21272e[_0xe8ac('0x64')][_0xe8ac('0x55')]({'filename':_0xe8ac('0x65')+_0xf34f72[_0xe8ac('0x66')](),'createdAt':moment()[_0xe8ac('0x5e')](_0xe8ac('0x68')),'mixmonitorid':_0x29fa3b['mixmonitorid'],'status':_0xe8ac('0x69')});}else{_0xf6ff7f[_0xe8ac('0x6a')]=_0x29fa3b[_0xe8ac('0x6a')];_0xf6ff7f['status']=_0xe8ac('0x69');}_0x45b3d7({'code':0xc8,'message':[_0x2eba9e[_0xe8ac('0x60')],_0xe8ac('0x6b'),_0x29fa3b[_0xe8ac('0x6a')]][_0xe8ac('0x1e')]('\x20'),'mixmonitorid':_0x29fa3b[_0xe8ac('0x6a')]});})[_0xe8ac('0x22')](function(_0x4c5894){_0x2cad0c(_0x52c6a5[_0xe8ac('0x13')](0x1f5,[_0x2eba9e[_0xe8ac('0x60')],_0x4c5894[_0xe8ac('0x1d')][_0xe8ac('0x66')]()][_0xe8ac('0x1e')]('\x20')));});}else{return _0x2cad0c(_0x52c6a5['error'](0x1f5,_0xe8ac('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x2d534a){var _0x3ffd17=this;return new Promise(function(_0x5ae2a5,_0x133ac1){if(ami['isConnected']()==![]){return _0x133ac1(_0x3ffd17[_0xe8ac('0x13')](0x1f4,[config[_0xe8ac('0x14')]['ip'],config[_0xe8ac('0x14')][_0xe8ac('0x15')],_0xe8ac('0x16')]['join']('\x20')));}var _0x5d4e08=schema(properties[_0xe8ac('0x5a')])[_0xe8ac('0x3')](_0x2d534a);if(_0x5d4e08[_0xe8ac('0x59')]>0x0){return _0x133ac1(_0x3ffd17['error'](0x1f4,_[_0xe8ac('0x5b')](_0x5d4e08,_0xe8ac('0x1d'))[_0xe8ac('0x1e')](',\x20')));}var _0x112e41=_[_0xe8ac('0x5c')](_0x199794[_0xe8ac('0x58')],{'uniqueid':_0x2d534a[_0xe8ac('0x60')]});if(_0x112e41){return BPromise['resolve']()[_0xe8ac('0x1c')](function(){if(_0x112e41[_0xe8ac('0x5d')]){return ami[_0xe8ac('0x1b')]({'action':_0xe8ac('0x6d'),'channel':_0x112e41[_0xe8ac('0x5d')],'mixmonitorid':_0x2d534a[_0xe8ac('0x6a')]})[_0xe8ac('0x22')](function(_0xa94389){});}})['then'](function(){if(_0x112e41['destinationchannel']){return ami[_0xe8ac('0x1b')]({'action':'StopMixMonitor','channel':_0x112e41['destinationchannel'],'mixmonitorid':_0x2d534a[_0xe8ac('0x6a')]})[_0xe8ac('0x22')](function(_0x43c38f){});}})['then'](function(_0x4878a6){var _0x5a3bb8=_[_0xe8ac('0x5c')](_0x112e41['monitors'],{'mixmonitorid':_0x2d534a[_0xe8ac('0x6a')]});if(_0x5a3bb8){_0x5a3bb8['status']=_0xe8ac('0x6e');}})[_0xe8ac('0x1c')](function(){var _0x1d187e=util[_0xe8ac('0x5e')](_0xe8ac('0x6f'),_0x2d534a[_0xe8ac('0x5f')]||_0x2d534a[_0xe8ac('0x60')],_0x2d534a[_0xe8ac('0x5e')]||_0xe8ac('0x61'));var _0x5d5721=_[_0xe8ac('0x5c')](_0x112e41[_0xe8ac('0x64')],{'filename':_0xe8ac('0x65')+_0x1d187e[_0xe8ac('0x66')]()});if(_0x5d5721){_0x5d5721[_0xe8ac('0x70')]=_0xe8ac('0x6e');}})['then'](function(){_0x5ae2a5({'code':0xc8,'message':[_0x2d534a['uniqueid'],_0xe8ac('0x71')]['join']('\x20')});})['catch'](function(_0x354b17){_0x133ac1(_0x3ffd17[_0xe8ac('0x13')](0x1f5,[_0x2d534a['uniqueid'],_0x354b17[_0xe8ac('0x1d')][_0xe8ac('0x66')]()][_0xe8ac('0x1e')]('\x20')));});}else{return _0x133ac1(_0x3ffd17[_0xe8ac('0x13')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x14e41e){return new Promise(function(_0x330e0e,_0x28d1a5){var _0x4ae5e6=_[_0xe8ac('0x72')](_0x199794[_0xe8ac('0x73')]);_0x330e0e({'count':_0x4ae5e6[_0xe8ac('0x59')],'rows':_0x4ae5e6});});},'VoiceQueuesChannel':function(_0x3cfdca){var _0x1c0113=this;return new Promise(function(_0x50de53,_0xea75ac){var _0x107512=schema(properties[_0xe8ac('0x74')])[_0xe8ac('0x3')](_0x3cfdca);if(_0x107512[_0xe8ac('0x59')]>0x0){return _0xea75ac(_0x1c0113['error'](0x1f4,_[_0xe8ac('0x5b')](_0x107512,_0xe8ac('0x1d'))['join'](',\x20')));}var _0x1a3aba=_[_0xe8ac('0x5c')](_0x199794['queueChannels'],{'uniqueid':_0x3cfdca['uniqueid']});if(_0x1a3aba){_0x50de53(_0x1a3aba);}else{return _0xea75ac(_0x1c0113[_0xe8ac('0x13')](0x1f5,_0xe8ac('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x47304b){var _0x1046de=this;return new Promise(function(_0x1c06a1,_0x533eb3){if(ami['isConnected']()==![]){return _0x533eb3(_0x1046de['error'](0x1f4,[config[_0xe8ac('0x14')]['ip'],config[_0xe8ac('0x14')][_0xe8ac('0x15')],_0xe8ac('0x16')][_0xe8ac('0x1e')]('\x20')));}var _0x57d057=schema(properties[_0xe8ac('0x75')])[_0xe8ac('0x3')](_0x47304b);if(_0x57d057[_0xe8ac('0x59')]>0x0){return _0x533eb3(_0x1046de[_0xe8ac('0x13')](0x1f4,_[_0xe8ac('0x5b')](_0x57d057,_0xe8ac('0x1d'))[_0xe8ac('0x1e')](',\x20')));}var _0x1cc697=_[_0xe8ac('0x5c')](_0x199794[_0xe8ac('0x73')],{'uniqueid':_0x47304b[_0xe8ac('0x60')]});if(_0x1cc697&&_0x1cc697[_0xe8ac('0x5d')]){return ami[_0xe8ac('0x1b')]({'action':_0xe8ac('0x76'),'channel':_0x1cc697[_0xe8ac('0x5d')]})[_0xe8ac('0x1c')](function(_0xc4bc94){_0x1c06a1({'code':0xc8,'message':[_0x47304b['uniqueid'],_0xc4bc94[_0xe8ac('0x1d')][_0xe8ac('0x66')]()][_0xe8ac('0x1e')]('\x20')});})[_0xe8ac('0x22')](function(_0x2942e1){_0x533eb3(_0x1046de[_0xe8ac('0x13')](0x1f5,[_0x47304b[_0xe8ac('0x60')],_0x2942e1[_0xe8ac('0x1d')]['toLowerCase']()]['join']('\x20')));});}else{return _0x533eb3(_0x1046de['error'](0x1f5,_0xe8ac('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0xef97f4){var _0x24b643=this;return new Promise(function(_0x29f0b4,_0x469fff){if(ami['isConnected']()==![]){return _0x469fff(_0x24b643[_0xe8ac('0x13')](0x1f4,[config[_0xe8ac('0x14')]['ip'],config[_0xe8ac('0x14')][_0xe8ac('0x15')],_0xe8ac('0x16')][_0xe8ac('0x1e')]('\x20')));}var _0x500900=schema(properties[_0xe8ac('0x77')])['validate'](_0xef97f4);if(_0x500900['length']>0x0){return _0x469fff(_0x24b643['error'](0x1f4,_['map'](_0x500900,_0xe8ac('0x1d'))[_0xe8ac('0x1e')](',\x20')));}var _0x3dfb38=_['find'](_0x199794['queueChannels'],{'uniqueid':_0xef97f4[_0xe8ac('0x60')]});if(_0x3dfb38&&_0x3dfb38[_0xe8ac('0x5d')]){return ami['Action']({'action':'Redirect','channel':_0x3dfb38[_0xe8ac('0x5d')],'exten':_0xef97f4[_0xe8ac('0x78')],'context':_0xef97f4[_0xe8ac('0x79')]||_0x3dfb38[_0xe8ac('0x79')],'priority':0x1})['then'](function(_0x109d62){_0x29f0b4({'code':0xc8,'message':[_0xef97f4[_0xe8ac('0x60')],_0x109d62['message']['toLowerCase']()]['join']('\x20')});})[_0xe8ac('0x22')](function(_0x3a0569){_0x469fff(_0x24b643['error'](0x1f5,[_0xef97f4[_0xe8ac('0x60')],_0x3a0569['message'][_0xe8ac('0x66')]()]['join']('\x20')));});}else{return _0x469fff(_0x24b643[_0xe8ac('0x13')](0x1f5,_0xe8ac('0x6c')));}});},'Agents':function(_0x257888){return new Promise(function(_0x368bca,_0x28b4b6){var _0x23f72d=_[_0xe8ac('0x72')](_0x199794[_0xe8ac('0xf')]);_0x368bca({'count':_0x23f72d['length'],'rows':_0x23f72d});});},'Telephones':function(_0x2176f2){return new Promise(function(_0x4ef62b,_0x32ce8f){var _0x35b160=_[_0xe8ac('0x72')](_0x199794[_0xe8ac('0x7a')]);_0x4ef62b({'count':_0x35b160['length'],'rows':_0x35b160});});},'Trunks':function(_0x38a3c4){return new Promise(function(_0x195d4c,_0x25a07a){var _0x487a8a=_[_0xe8ac('0x72')](_0x199794[_0xe8ac('0x7b')]);_0x195d4c({'count':_0x487a8a[_0xe8ac('0x59')],'rows':_0x487a8a});});},'OutboundChannels':function(_0x5e017e){return new Promise(function(_0x59a42d,_0x1086ad){var _0xeff512=_[_0xe8ac('0x72')](_0x199794['outboundChannels']);_0x59a42d({'count':_0xeff512[_0xe8ac('0x59')],'rows':_0xeff512});});},'Outbound':function(_0x8b1baa){return new Promise(function(_0x1e80f6,_0x57be43){_0x1e80f6(_0x199794['outbound']);});},'Campaigns':function(_0x382407){return new Promise(function(_0x27cd5f,_0x49a13b){var _0x5a3399=_[_0xe8ac('0x72')](_0x199794[_0xe8ac('0x7c')]);_0x27cd5f({'count':_0x5a3399[_0xe8ac('0x59')],'rows':_0x5a3399});});},'VoiceQueuesPreview':function(_0x42bb51){var _0x1a888a=this;return new Promise(function(_0xca6bfb,_0x19b0df){_0x224fc8[_0xe8ac('0x7d')](_0x42bb51['id'])[_0xe8ac('0x1c')](function(_0x28756e){_0xca6bfb({'code':0xc8,'message':_0x28756e['message']});})[_0xe8ac('0x22')](function(_0x37fca2){_0x19b0df(_0x1a888a[_0xe8ac('0x13')](0x1f4,_0x37fca2['message']));});});},'EventManager':function(_0x350036){var _0x3eceab=this;return new Promise(function(_0x15d0b0,_0x2dc961){if(!_0x350036[_0xe8ac('0x7e')]){return _0x2dc961(_0x3eceab['error'](0x1f4,_0xe8ac('0x7f')));}ami['emit'](_0xe8ac('0x80')+_0x350036[_0xe8ac('0x7e')],_0x350036['message']);_0x15d0b0({'code':0xc8,'message':_0x350036});});},'FaxAccounts':function(_0x4d7f22){return new Promise(function(_0x372c35,_0x11c465){var _0xf11aa9=_[_0xe8ac('0x72')](_0x199794[_0xe8ac('0x81')]);_0x372c35({'count':_0xf11aa9[_0xe8ac('0x59')],'rows':_0xf11aa9});});},'SendFax':function(_0x36eb59){var _0x499d69=this;return new Promise(function(_0x6143b1,_0x1d7163){_0x170e14[_0xe8ac('0x82')](_0x36eb59)[_0xe8ac('0x1c')](function(_0x190257){_0x6143b1({'code':0xc8,'message':_0x190257[_0xe8ac('0x1d')]});})[_0xe8ac('0x22')](function(_0x120d3e){_0x1d7163(_0x499d69[_0xe8ac('0x13')](0x1f4,_0x120d3e[_0xe8ac('0x1d')]));});});},'CheckAfterSend':function(_0x549f55){var _0x1cf4cf=this;return new Promise(function(_0x254531,_0x2ae498){_0x170e14[_0xe8ac('0x83')](_0x549f55)['then'](function(_0x1a115e){_0x254531({'code':0xc8,'message':_0x1a115e['message']});})['catch'](function(_0x4677ee){_0x2ae498(_0x1cf4cf[_0xe8ac('0x13')](0x1f4,_0x4677ee['message']));});});}};var _0x5c1960=jayson[_0xe8ac('0x84')](_0x2d56f0)[_0xe8ac('0x85')]();_0x5c1960['on']('error',function(_0x19f735){return _0x4eb087(_0x19f735);});_0x5c1960['listen'](0x232a,_0xe8ac('0x86'),function(){console[_0xe8ac('0x87')](_0xe8ac('0x88'),0x232a);return _0x2b48ec('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xd9fb=['sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','omit','values','channels','length','map','find','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','voicechannel','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen','%s/%s','SIP','name','timers','timer','updateStatusRealtime','QueuePause','error','asterisk','username','join','pick','keys','module','action','Reload','Action','message','isConnected','ami\x20disconnected','command','Command','then','content','catch','voiceQueues','strategy','loggedIn','pTalking','sumBillable'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xd9fb,0x189));var _0xbd9f=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xd9fb[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xbd9f('0x0'));var util=require(_0xbd9f('0x1'));var jayson=require(_0xbd9f('0x2'));var schema=require(_0xbd9f('0x3'));var BPromise=require(_0xbd9f('0x4'));var moment=require(_0xbd9f('0x5'));var config=require(_0xbd9f('0x6'));var properties=require('../properties');var ami=require(_0xbd9f('0x7'));exports[_0xbd9f('0x8')]=function(_0x4ce2e2,_0x469446,_0x5b6052){return new BPromise(function(_0x2e7eea,_0x43a5a2){var _0x5e2143={'QueuePause':function(_0x30f0ae){return new Promise(function(_0x16f086,_0x3dbc8e){var _0x2196a6=util['format'](_0xbd9f('0x9'),_0xbd9f('0xa'),_0x30f0ae[_0xbd9f('0xb')]);if(_0x4ce2e2[_0xbd9f('0xc')]&&_0x4ce2e2[_0xbd9f('0xc')][_0x2196a6]&&_0x4ce2e2[_0xbd9f('0xc')][_0x2196a6][_0xbd9f('0xd')]){_0x4ce2e2['timers'][_0x2196a6]['updateAcw']();}if(_0x4ce2e2['agents'][_0x2196a6]){_0x4ce2e2['agents'][_0x2196a6][_0xbd9f('0xe')]({'statePause':_0x30f0ae['pause']?!![]:![]});}_0x16f086({'code':0xc8,'message':_0xbd9f('0xf')});});},'Reload':function(_0x44672c){var _0x3030f5=this;return new Promise(function(_0x530513,_0x1430fc){if(ami['isConnected']()==![]){return _0x1430fc(_0x3030f5[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],'ami\x20disconnected'][_0xbd9f('0x13')]('\x20')));}_0x44672c=_[_0xbd9f('0x14')](_0x44672c,_[_0xbd9f('0x15')](properties[_0xbd9f('0x16')]));_0x44672c[_0xbd9f('0x17')]=_0xbd9f('0x18');return ami[_0xbd9f('0x19')](_0x44672c)['then'](function(_0x49a818){_0x530513({'code':0xc8,'message':_0x49a818[_0xbd9f('0x1a')]});})['catch'](function(_0x2f52dd){_0x1430fc(_0x3030f5[_0xbd9f('0x10')](0x1f5,_0x2f52dd[_0xbd9f('0x1a')]));});});},'Command':function(_0x1a42a0){var _0x2c276b=this;return new Promise(function(_0x381f68,_0x3f6c17){if(ami[_0xbd9f('0x1b')]()==![]){return _0x3f6c17(_0x2c276b['error'](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}_0x1a42a0=_[_0xbd9f('0x14')](_0x1a42a0,_0xbd9f('0x1d'));_0x1a42a0[_0xbd9f('0x17')]=_0xbd9f('0x1e');return ami[_0xbd9f('0x19')](_0x1a42a0)[_0xbd9f('0x1f')](function(_0x4e929d){_0x381f68({'code':0xc8,'message':_0x4e929d[_0xbd9f('0x20')]});})[_0xbd9f('0x21')](function(_0x256aec){_0x3f6c17(_0x2c276b[_0xbd9f('0x10')](0x1f5,_0x256aec['message']));});});},'VoiceQueues':function(_0x3e0ba5){return new Promise(function(_0x2eca22,_0x278a10){var _0x36f503=[];for(var _0x46fcc0 in _0x4ce2e2[_0xbd9f('0x22')]){if(_0x4ce2e2[_0xbd9f('0x22')]['hasOwnProperty'](_0x46fcc0)){var _0xd89fc2=_0x4ce2e2[_0xbd9f('0x22')][_0x46fcc0];var _0xa46ce3={'id':_0xd89fc2['id'],'name':_0xd89fc2[_0xbd9f('0xb')],'strategy':_0xd89fc2[_0xbd9f('0x23')],'answered':_0xd89fc2['answered'],'available':_0xd89fc2['available'],'loggedIn':_0xd89fc2[_0xbd9f('0x24')],'pTalking':_0xd89fc2[_0xbd9f('0x25')],'sumBillable':_0xd89fc2[_0xbd9f('0x26')],'sumDuration':_0xd89fc2['sumDuration'],'sumHoldTime':_0xd89fc2[_0xbd9f('0x27')]||0x0,'talking':_0xd89fc2[_0xbd9f('0x28')],'total':_0xd89fc2[_0xbd9f('0x29')],'type':_0xd89fc2['type'],'unmanaged':_0xd89fc2[_0xbd9f('0x2a')],'abandoned':_0xd89fc2[_0xbd9f('0x2b')],'waiting':_0xd89fc2[_0xbd9f('0x2c')],'loggedInDb':_0xd89fc2[_0xbd9f('0x2d')]};if(_0xd89fc2[_0xbd9f('0x2e')]===_0xbd9f('0x2f')){_0xa46ce3[_0xbd9f('0x30')]=_0xd89fc2['dialActive'];_0xa46ce3['dialMethod']=_0xd89fc2[_0xbd9f('0x31')];_0xa46ce3[_0xbd9f('0x32')]=_0xd89fc2[_0xbd9f('0x32')];_0xa46ce3[_0xbd9f('0x33')]=_0xd89fc2[_0xbd9f('0x33')];_0xa46ce3[_0xbd9f('0x34')]=_0xd89fc2[_0xbd9f('0x34')];_0xa46ce3[_0xbd9f('0x35')]=_0xd89fc2[_0xbd9f('0x35')];_0xa46ce3['temp']=_0xd89fc2['temp'];_0xa46ce3[_0xbd9f('0x36')]=_0xd89fc2['outboundAnswerAgiCallsDay'];_0xa46ce3['outboundAnswerCallsDay']=_0xd89fc2[_0xbd9f('0x37')];_0xa46ce3[_0xbd9f('0x38')]=_0xd89fc2[_0xbd9f('0x38')];_0xa46ce3[_0xbd9f('0x39')]=_0xd89fc2[_0xbd9f('0x39')];_0xa46ce3[_0xbd9f('0x3a')]=_0xd89fc2[_0xbd9f('0x3a')];_0xa46ce3[_0xbd9f('0x3b')]=_0xd89fc2['outboundDropCallsDayACS'];_0xa46ce3[_0xbd9f('0x3c')]=_0xd89fc2[_0xbd9f('0x3c')];_0xa46ce3[_0xbd9f('0x3d')]=_0xd89fc2['outboundDropCallsDayTimeout'];_0xa46ce3['outboundNoAnswerCallsDay']=_0xd89fc2[_0xbd9f('0x3e')];_0xa46ce3[_0xbd9f('0x3f')]=_0xd89fc2['outboundNoSuchCallsDay'];_0xa46ce3[_0xbd9f('0x40')]=_0xd89fc2['outboundOriginateFailureCallsDay'];_0xa46ce3[_0xbd9f('0x41')]=_0xd89fc2[_0xbd9f('0x41')];_0xa46ce3[_0xbd9f('0x42')]=_0xd89fc2[_0xbd9f('0x42')];_0xa46ce3[_0xbd9f('0x43')]=_0xd89fc2['outboundUnknownCallsDay'];_0xa46ce3[_0xbd9f('0x44')]=_0xd89fc2[_0xbd9f('0x44')];_0xa46ce3['predictiveIntervalAvgHoldtime']=_0xd89fc2[_0xbd9f('0x45')];_0xa46ce3[_0xbd9f('0x46')]=_0xd89fc2[_0xbd9f('0x46')];_0xa46ce3[_0xbd9f('0x47')]=_0xd89fc2['predictiveIntervalDroppedCallsCallersExit'];_0xa46ce3[_0xbd9f('0x48')]=_0xd89fc2[_0xbd9f('0x48')];_0xa46ce3[_0xbd9f('0x49')]=_0xd89fc2[_0xbd9f('0x49')];_0xa46ce3['predictiveIntervalErlangCallsDroppedCalls']=_0xd89fc2[_0xbd9f('0x4a')];_0xa46ce3[_0xbd9f('0x4b')]=_0xd89fc2[_0xbd9f('0x4b')];_0xa46ce3[_0xbd9f('0x4c')]=_0xd89fc2['predictiveIntervalMultiplicativeFactor'];_0xa46ce3['predictiveIntervalPauses']=_0xd89fc2[_0xbd9f('0x4d')];_0xa46ce3[_0xbd9f('0x4e')]=_0xd89fc2['predictiveIntervalAvailable'];_0xa46ce3[_0xbd9f('0x4f')]=_0xd89fc2['predictiveIntervalTotalCalls'];_0xa46ce3[_0xbd9f('0x1a')]=_0xd89fc2['message'];_0xa46ce3[_0xbd9f('0x50')]=_0xd89fc2[_0xbd9f('0x50')];_0xa46ce3['erlangCalls']=_0xd89fc2['erlangCalls'];_0xa46ce3['erlangCallToSecond']=_0xd89fc2[_0xbd9f('0x51')];_0xa46ce3[_0xbd9f('0x52')]=_0xd89fc2['erlangAbandonmentRate'];_0xa46ce3['erlangBusyFactor']=_0xd89fc2[_0xbd9f('0x53')];_0xa46ce3[_0xbd9f('0x54')]=_0xd89fc2[_0xbd9f('0x54')];_0xa46ce3[_0xbd9f('0x55')]=_0xd89fc2['startProgressive'];}if(_0xd89fc2[_0xbd9f('0x56')]){_0xa46ce3[_0xbd9f('0x56')]={'id':_0xd89fc2[_0xbd9f('0x56')]['id'],'name':_0xd89fc2[_0xbd9f('0x56')][_0xbd9f('0xb')],'active':_0xd89fc2['Trunk'][_0xbd9f('0x57')],'callerid':_0xd89fc2[_0xbd9f('0x56')][_0xbd9f('0x58')]};}if(_0xd89fc2[_0xbd9f('0x59')]){_0xa46ce3['Interval']={'id':_0xd89fc2[_0xbd9f('0x59')]['id'],'name':_0xd89fc2[_0xbd9f('0x59')][_0xbd9f('0xb')]};}_0x36f503['push'](_0xa46ce3);}}_0x2eca22({'count':_0x36f503['length'],'rows':_0x36f503});});},'UpdateVoiceQueue':function(_0xba219a){return new Promise(function(_0x387a7c,_0xd5d97b){var _0x175601=_['find'](_0x4ce2e2[_0xbd9f('0x22')],{'id':parseInt(_0xba219a['id'])});var _0x174125=_[_0xbd9f('0x5a')](_0xba219a,['id']);if(_0x175601){for(var _0x254075 in _0x174125){if(typeof _0x174125[_0x254075]!=='undefined'&&typeof _0x175601[_0x254075]!=='undefined'){_0x175601[_0x254075]=_0x174125[_0x254075];}}_0x387a7c(_0x175601);}else{_0xd5d97b();}});},'VoiceChannels':function(_0x525ca3){return new Promise(function(_0x23f7b2,_0x11e5d3){var _0x585065=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x5c')]);_0x23f7b2({'count':_0x585065[_0xbd9f('0x5d')],'rows':_0x585065});});},'VoiceChannelMixMonitor':function(_0x45bf27){var _0x141eaf=this;return new Promise(function(_0xbeca49,_0x157177){if(ami[_0xbd9f('0x1b')]()==![]){return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}var _0x31d6dc=schema(properties['voicechannel'])[_0xbd9f('0x3')](_0x45bf27);if(_0x31d6dc['length']>0x0){return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x31d6dc,'message')['join'](',\x20')));}var _0x3334c6=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x5c')],{'uniqueid':_0x45bf27[_0xbd9f('0x60')]});if(_0x3334c6&&_0x3334c6[_0xbd9f('0x61')]){var _0x786cdf=util[_0xbd9f('0x62')](_0xbd9f('0x63'),_0x45bf27[_0xbd9f('0x64')]||_0x45bf27[_0xbd9f('0x60')],_0x45bf27['format']||_0xbd9f('0x65'));return ami['Action']({'action':_0xbd9f('0x66'),'channel':_0x3334c6[_0xbd9f('0x61')],'file':_0x786cdf,'options':_0xbd9f('0x67')})[_0xbd9f('0x1f')](function(_0x1b9ca7){var _0x58fe5f=_[_0xbd9f('0x5f')](_0x3334c6[_0xbd9f('0x68')],{'filename':_0xbd9f('0x69')+_0x786cdf[_0xbd9f('0x6a')]()});if(_[_0xbd9f('0x6b')](_0x58fe5f)){_0x3334c6[_0xbd9f('0x68')][_0xbd9f('0x6c')]({'filename':_0xbd9f('0x69')+_0x786cdf[_0xbd9f('0x6a')](),'createdAt':moment()[_0xbd9f('0x62')](_0xbd9f('0x6d')),'mixmonitorid':_0x1b9ca7[_0xbd9f('0x6e')],'status':_0xbd9f('0x6f')});}else{_0x58fe5f[_0xbd9f('0x6e')]=_0x1b9ca7[_0xbd9f('0x6e')];_0x58fe5f[_0xbd9f('0x70')]=_0xbd9f('0x6f');}_0xbeca49({'code':0xc8,'message':[_0x45bf27[_0xbd9f('0x60')],_0xbd9f('0x71'),_0x1b9ca7[_0xbd9f('0x6e')]]['join']('\x20'),'mixmonitorid':_0x1b9ca7['mixmonitorid']});})[_0xbd9f('0x21')](function(_0x7d17f3){_0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f5,[_0x45bf27['uniqueid'],_0x7d17f3['message'][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x157177(_0x141eaf[_0xbd9f('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x36806a){var _0x23c56c=this;return new Promise(function(_0x55341e,_0xecee10){if(ami['isConnected']()==![]){return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')][_0xbd9f('0x12')],_0xbd9f('0x1c')][_0xbd9f('0x13')]('\x20')));}var _0x29e082=schema(properties[_0xbd9f('0x72')])[_0xbd9f('0x3')](_0x36806a);if(_0x29e082[_0xbd9f('0x5d')]>0x0){return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x29e082,'message')['join'](',\x20')));}var _0x59423b=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x5c')],{'uniqueid':_0x36806a[_0xbd9f('0x60')]});if(_0x59423b){return BPromise[_0xbd9f('0x73')]()[_0xbd9f('0x1f')](function(){if(_0x59423b[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x74'),'channel':_0x59423b['channel'],'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]})[_0xbd9f('0x21')](function(_0x552ada){});}})[_0xbd9f('0x1f')](function(){if(_0x59423b[_0xbd9f('0x75')]){return ami[_0xbd9f('0x19')]({'action':'StopMixMonitor','channel':_0x59423b['destinationchannel'],'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]})[_0xbd9f('0x21')](function(_0x2cb9d9){});}})[_0xbd9f('0x1f')](function(_0x2db02a){var _0x1725f1=_[_0xbd9f('0x5f')](_0x59423b[_0xbd9f('0x68')],{'mixmonitorid':_0x36806a[_0xbd9f('0x6e')]});if(_0x1725f1){_0x1725f1['status']=_0xbd9f('0x76');}})[_0xbd9f('0x1f')](function(){var _0x27f25d=util[_0xbd9f('0x62')](_0xbd9f('0x63'),_0x36806a[_0xbd9f('0x64')]||_0x36806a[_0xbd9f('0x60')],_0x36806a[_0xbd9f('0x62')]||_0xbd9f('0x65'));var _0x42b6af=_[_0xbd9f('0x5f')](_0x59423b['monitors'],{'filename':_0xbd9f('0x69')+_0x27f25d[_0xbd9f('0x6a')]()});if(_0x42b6af){_0x42b6af[_0xbd9f('0x70')]=_0xbd9f('0x76');}})[_0xbd9f('0x1f')](function(){_0x55341e({'code':0xc8,'message':[_0x36806a[_0xbd9f('0x60')],_0xbd9f('0x77')][_0xbd9f('0x13')]('\x20')});})[_0xbd9f('0x21')](function(_0x5add9c){_0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f5,[_0x36806a[_0xbd9f('0x60')],_0x5add9c['message'][_0xbd9f('0x6a')]()]['join']('\x20')));});}else{return _0xecee10(_0x23c56c[_0xbd9f('0x10')](0x1f5,_0xbd9f('0x78')));}});},'VoiceQueuesChannels':function(_0x197b9d){return new Promise(function(_0x5162bf,_0x599a3a){var _0x48f037=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x79')]);_0x5162bf({'count':_0x48f037[_0xbd9f('0x5d')],'rows':_0x48f037});});},'VoiceQueuesChannel':function(_0x1600f9){var _0x35d96f=this;return new Promise(function(_0x5e1db0,_0x236a33){var _0x3f14e3=schema(properties['voicequeuechannel'])[_0xbd9f('0x3')](_0x1600f9);if(_0x3f14e3[_0xbd9f('0x5d')]>0x0){return _0x236a33(_0x35d96f[_0xbd9f('0x10')](0x1f4,_[_0xbd9f('0x5e')](_0x3f14e3,'message')[_0xbd9f('0x13')](',\x20')));}var _0x2f55c6=_['find'](_0x4ce2e2[_0xbd9f('0x79')],{'uniqueid':_0x1600f9['uniqueid']});if(_0x2f55c6){_0x5e1db0(_0x2f55c6);}else{return _0x236a33(_0x35d96f['error'](0x1f5,_0xbd9f('0x78')));}});},'VoiceQueuesChannelHangup':function(_0x444792){var _0x164569=this;return new Promise(function(_0x54cec3,_0x2914ce){if(ami[_0xbd9f('0x1b')]()==![]){return _0x2914ce(_0x164569['error'](0x1f4,[config[_0xbd9f('0x11')]['ip'],config['asterisk']['username'],'ami\x20disconnected']['join']('\x20')));}var _0x39062c=schema(properties[_0xbd9f('0x7a')])['validate'](_0x444792);if(_0x39062c[_0xbd9f('0x5d')]>0x0){return _0x2914ce(_0x164569['error'](0x1f4,_['map'](_0x39062c,'message')[_0xbd9f('0x13')](',\x20')));}var _0x3a3586=_[_0xbd9f('0x5f')](_0x4ce2e2[_0xbd9f('0x79')],{'uniqueid':_0x444792[_0xbd9f('0x60')]});if(_0x3a3586&&_0x3a3586[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x7b'),'channel':_0x3a3586[_0xbd9f('0x61')]})[_0xbd9f('0x1f')](function(_0x45755a){_0x54cec3({'code':0xc8,'message':[_0x444792[_0xbd9f('0x60')],_0x45755a['message'][_0xbd9f('0x6a')]()]['join']('\x20')});})[_0xbd9f('0x21')](function(_0x34f158){_0x2914ce(_0x164569[_0xbd9f('0x10')](0x1f5,[_0x444792[_0xbd9f('0x60')],_0x34f158['message'][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x2914ce(_0x164569['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x25ecb1){var _0x10a6bc=this;return new Promise(function(_0x1b5f8c,_0x25d8a8){if(ami[_0xbd9f('0x1b')]()==![]){return _0x25d8a8(_0x10a6bc[_0xbd9f('0x10')](0x1f4,[config[_0xbd9f('0x11')]['ip'],config[_0xbd9f('0x11')]['username'],_0xbd9f('0x1c')]['join']('\x20')));}var _0x4edcd4=schema(properties[_0xbd9f('0x7c')])[_0xbd9f('0x3')](_0x25ecb1);if(_0x4edcd4['length']>0x0){return _0x25d8a8(_0x10a6bc['error'](0x1f4,_['map'](_0x4edcd4,_0xbd9f('0x1a'))[_0xbd9f('0x13')](',\x20')));}var _0x4b7920=_[_0xbd9f('0x5f')](_0x4ce2e2['queueChannels'],{'uniqueid':_0x25ecb1[_0xbd9f('0x60')]});if(_0x4b7920&&_0x4b7920[_0xbd9f('0x61')]){return ami[_0xbd9f('0x19')]({'action':_0xbd9f('0x7d'),'channel':_0x4b7920['channel'],'exten':_0x25ecb1[_0xbd9f('0x7e')],'context':_0x25ecb1['context']||_0x4b7920[_0xbd9f('0x7f')],'priority':0x1})[_0xbd9f('0x1f')](function(_0x1cb0b1){_0x1b5f8c({'code':0xc8,'message':[_0x25ecb1[_0xbd9f('0x60')],_0x1cb0b1[_0xbd9f('0x1a')][_0xbd9f('0x6a')]()]['join']('\x20')});})[_0xbd9f('0x21')](function(_0x3fb0d6){_0x25d8a8(_0x10a6bc['error'](0x1f5,[_0x25ecb1[_0xbd9f('0x60')],_0x3fb0d6[_0xbd9f('0x1a')][_0xbd9f('0x6a')]()][_0xbd9f('0x13')]('\x20')));});}else{return _0x25d8a8(_0x10a6bc['error'](0x1f5,_0xbd9f('0x78')));}});},'Agents':function(_0x21db4e){return new Promise(function(_0x527595,_0x3626ce){var _0x4a130d=_[_0xbd9f('0x5b')](_0x4ce2e2['agents']);_0x527595({'count':_0x4a130d[_0xbd9f('0x5d')],'rows':_0x4a130d});});},'Telephones':function(_0x423a2d){return new Promise(function(_0xcfb788,_0x4f3679){var _0x2808cd=_['values'](_0x4ce2e2[_0xbd9f('0x80')]);_0xcfb788({'count':_0x2808cd[_0xbd9f('0x5d')],'rows':_0x2808cd});});},'Trunks':function(_0x115639){return new Promise(function(_0x1b8f4f,_0x4b3e44){var _0x3063a0=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x81')]);_0x1b8f4f({'count':_0x3063a0[_0xbd9f('0x5d')],'rows':_0x3063a0});});},'OutboundChannels':function(_0x1c8b01){return new Promise(function(_0x210873,_0x20faf6){var _0x58b49c=_['values'](_0x4ce2e2[_0xbd9f('0x82')]);_0x210873({'count':_0x58b49c[_0xbd9f('0x5d')],'rows':_0x58b49c});});},'Outbound':function(_0x551b08){return new Promise(function(_0x156740,_0x4e4bd9){_0x156740(_0x4ce2e2[_0xbd9f('0x2f')]);});},'Campaigns':function(_0x274221){return new Promise(function(_0x3fb6fe,_0x3e8881){var _0x376314=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x83')]);_0x3fb6fe({'count':_0x376314[_0xbd9f('0x5d')],'rows':_0x376314});});},'VoiceQueuesPreview':function(_0x1aa387){var _0x5447b1=this;return new Promise(function(_0x56976c,_0x23eff7){_0x469446[_0xbd9f('0x84')](_0x1aa387['id'])['then'](function(_0x5dc5a2){_0x56976c({'code':0xc8,'message':_0x5dc5a2[_0xbd9f('0x1a')]});})[_0xbd9f('0x21')](function(_0x346b86){_0x23eff7(_0x5447b1[_0xbd9f('0x10')](0x1f4,_0x346b86[_0xbd9f('0x1a')]));});});},'EventManager':function(_0x3a564b){var _0x14f9f0=this;return new Promise(function(_0x571c68,_0x3d9322){if(!_0x3a564b[_0xbd9f('0x85')]){return _0x3d9322(_0x14f9f0['error'](0x1f4,_0xbd9f('0x86')));}ami[_0xbd9f('0x87')](_0xbd9f('0x88')+_0x3a564b[_0xbd9f('0x85')],_0x3a564b[_0xbd9f('0x1a')]);_0x571c68({'code':0xc8,'message':_0x3a564b});});},'FaxAccounts':function(_0x43d375){return new Promise(function(_0x538984,_0x4a3db3){var _0x22f7ad=_[_0xbd9f('0x5b')](_0x4ce2e2[_0xbd9f('0x89')]);_0x538984({'count':_0x22f7ad['length'],'rows':_0x22f7ad});});},'SendFax':function(_0x35c2a1){var _0x55b4e5=this;return new Promise(function(_0x5bc569,_0x5a3bce){_0x5b6052[_0xbd9f('0x8a')](_0x35c2a1)[_0xbd9f('0x1f')](function(_0x3826f3){_0x5bc569({'code':0xc8,'message':_0x3826f3[_0xbd9f('0x1a')]});})['catch'](function(_0x49dc1e){_0x5a3bce(_0x55b4e5[_0xbd9f('0x10')](0x1f4,_0x49dc1e[_0xbd9f('0x1a')]));});});},'CheckAfterSend':function(_0x3061d1){var _0x24c576=this;return new Promise(function(_0x6bd70f,_0x5d7e50){_0x5b6052[_0xbd9f('0x8b')](_0x3061d1)[_0xbd9f('0x1f')](function(_0x3fa6cc){_0x6bd70f({'code':0xc8,'message':_0x3fa6cc['message']});})[_0xbd9f('0x21')](function(_0x1dafa4){_0x5d7e50(_0x24c576[_0xbd9f('0x10')](0x1f4,_0x1dafa4[_0xbd9f('0x1a')]));});});}};var _0x5aa1f4=jayson['server'](_0x5e2143)[_0xbd9f('0x8c')]();_0x5aa1f4['on'](_0xbd9f('0x10'),function(_0x3f7729){return _0x43a5a2(_0x3f7729);});_0x5aa1f4[_0xbd9f('0x8')](0x232a,'127.0.0.1',function(){console[_0xbd9f('0x8d')](_0xbd9f('0x8e'),0x232a);return _0x2e7eea(_0xbd9f('0x8f')+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 e040ab8..1674ea3 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 _0x34e8=['xmd-contactid','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','ListId','createdAt','scheduledAt','union','then','getContacts','length','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5'];(function(_0x364951,_0x2bfbbe){var _0x2e823a=function(_0x5c20d8){while(--_0x5c20d8){_0x364951['push'](_0x364951['shift']());}};_0x2e823a(++_0x2bfbbe);}(_0x34e8,0x12c));var _0x834e=function(_0x689523,_0xd037f2){_0x689523=_0x689523-0x0;var _0x974e29=_0x34e8[_0x689523];return _0x974e29;};'use strict';var _=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var Redis=require(_0x834e('0x2'));var util=require(_0x834e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x834e('0x4'))(_0x834e('0x5'));var cmContactRpc=require(_0x834e('0x6'));config[_0x834e('0x7')]=_[_0x834e('0x8')](config[_0x834e('0x7')],{'host':_0x834e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x7')]));function emit(_0x52056d,_0x3e16d2,_0x3cc2e3,_0x3a3ef6,_0x2e69e2){logger[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,_0x3e16d2['id'],_0x3cc2e3,_0x3a3ef6,JSON[_0x834e('0xc')](_0x2e69e2));io['to'](_0x3cc2e3)[_0x834e('0xd')](_0x3a3ef6,_0x2e69e2);}exports[_0x834e('0xe')]=function(_0x186b3b,_0x1e41fe,_0x36e124,_0x14038b){var _0x2e1a37,_0x293514;var _0x1e00de={};var _0x2fd95c=Number(_0x36e124['data1']);var _0x5e5b6d=_0x36e124[_0x834e('0xf')]?Boolean(Number(_0x36e124['data2'])):![];var _0x23848e;var _0x2d95f2=![];if(!_[_0x834e('0x10')](_0x36e124[_0x834e('0x11')])){if(_0x36e124['data5']=='1')_0x2d95f2=!![];}if(!_0x2d95f2){if(_0x14038b[_0x834e('0x12')]){_0x1e00de['id']=_0x14038b[_0x834e('0x12')];}}if(!_0x1e00de['id']){_0x1e00de['ListId']=_0x2fd95c;_0x23848e=_0x36e124[_0x834e('0x13')]&&_0x36e124['data3']!=='0'?_0x36e124[_0x834e('0x13')][_0x834e('0x14')](','):['phone'];_0x1e00de[_0x834e('0x15')]=_[_0x834e('0x16')](_0x23848e,function(_0x370fb5){var _0x50b3f6={};_0x50b3f6[_0x370fb5]=_0x14038b[_0x834e('0x17')]?_0x14038b[_0x834e('0x18')]:_0x14038b[_0x834e('0x19')];return _0x50b3f6;});}var _0xb993a1=['id',_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'mobile',_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),'updatedAt'];var _0x45a630=_[_0x834e('0x21')](_0xb993a1,_0x23848e);BPromise['resolve']()[_0x834e('0x22')](cmContactRpc[_0x834e('0x23')]({'attributes':_0x45a630,'where':_0x1e00de}))[_0x834e('0x22')](function(_0x5c55ca){_0x293514=_0x5c55ca;if(!_['isEmpty'](_0x293514)){if(_0x293514[_0x834e('0x24')]===0x1){_0x2e1a37=_0x293514[0x0];logger[_0x834e('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x14038b[_0x834e('0x25')],_0x1e41fe['id'],_0x2e1a37['id']);}else{logger[_0x834e('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x14038b[_0x834e('0x25')],_0x1e41fe['id'],_[_0x834e('0x16')](_0x293514,'id')[_0x834e('0x26')](','));}return;}else{logger['info'](_0x834e('0x27'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id']);var _0x5e1cc5={'ListId':_0x2fd95c};var _0x5bef62=_0x36e124[_0x834e('0x28')]&&_0x36e124['data4']!=='0'?_0x36e124[_0x834e('0x28')]:_0x834e('0x1c');if(_0x5e5b6d){logger[_0x834e('0xa')](_0x834e('0x29'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id']);_0x5e1cc5[_0x5bef62]=_[_0x834e('0x10')](_0x14038b['routeId'])?_0x14038b['calleridnum']:_0x14038b['destcalleridnum'];if(_['isNil'](_0x14038b[_0x834e('0x17')])){_0x5e1cc5[_0x834e('0x1a')]=_0x14038b[_0x834e('0x2a')]&&_0x14038b['calleridname']!==_0x834e('0x2b')?_0x14038b[_0x834e('0x2a')]:_0x834e('0x2c');}else{_0x5e1cc5[_0x834e('0x1a')]=_0x14038b[_0x834e('0x2d')]&&_0x14038b[_0x834e('0x2d')]!==_0x834e('0x2b')?_0x14038b[_0x834e('0x2d')]:_0x834e('0x2c');}return BPromise['resolve']()[_0x834e('0x22')](cmContactRpc['createContact'](_0x5e1cc5))[_0x834e('0x22')](function(_0x3787b0){_0x2e1a37=_0x3787b0;_0x293514[_0x834e('0x2e')](_0x3787b0);if(_0x2e1a37){logger[_0x834e('0xa')](_0x834e('0x2f'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id'],_0x2e1a37['id']);}return;});}else{logger[_0x834e('0xa')](_0x834e('0x30'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id']);_0x5e1cc5[_0x5bef62]=_[_0x834e('0x10')](_0x14038b['routeId'])?_0x14038b[_0x834e('0x19')]:_0x14038b[_0x834e('0x18')];if(_[_0x834e('0x10')](_0x14038b[_0x834e('0x17')])){_0x5e1cc5['firstName']=_0x14038b[_0x834e('0x2a')]&&_0x14038b[_0x834e('0x2a')]!==''?_0x14038b['calleridname']:'Unknown';}else{_0x5e1cc5[_0x834e('0x1a')]=_0x14038b[_0x834e('0x2d')]&&_0x14038b[_0x834e('0x2d')]!==_0x834e('0x2b')?_0x14038b[_0x834e('0x2d')]:_0x834e('0x2c');}_0x2e1a37=_0x5e1cc5;_0x293514['push'](_0x5e1cc5);return;}}})[_0x834e('0x22')](function(){if(_0x186b3b){emit(_0x14038b['uniqueid'],_0x1e41fe,util[_0x834e('0x31')](_0x834e('0x32'),_0x186b3b['name']),util[_0x834e('0x31')](_0x834e('0x33'),_0x36e124['action']['toLowerCase']()),{'evt':_[_0x834e('0x34')](_0x14038b,{'autoCreate':_0x5e5b6d}),'contact':_0x2e1a37===undefined?{}:_0x2e1a37,'contacts':_0x293514[_0x834e('0x24')]===0x0?undefined:_0x293514});}});}; \ No newline at end of file +var _0x6f0d=['length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','info','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','action','toLowerCase','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','fax','scheduledAt','updatedAt','resolve','then','isEmpty'];(function(_0x56f8de,_0x143cc4){var _0x5d83b5=function(_0x42738c){while(--_0x42738c){_0x56f8de['push'](_0x56f8de['shift']());}};_0x5d83b5(++_0x143cc4);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x37a6fd,_0x25edae){_0x37a6fd=_0x37a6fd-0x0;var _0x572126=_0x6f0d[_0x37a6fd];return _0x572126;};'use strict';var _=require('lodash');var BPromise=require(_0xd6f0('0x0'));var Redis=require(_0xd6f0('0x1'));var util=require(_0xd6f0('0x2'));var config=require(_0xd6f0('0x3'));var logger=require('../../../../config/logger')(_0xd6f0('0x4'));var cmContactRpc=require(_0xd6f0('0x5'));config[_0xd6f0('0x6')]=_[_0xd6f0('0x7')](config[_0xd6f0('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd6f0('0x8'))(new Redis(config['redis']));function emit(_0xe21ac4,_0x1af29c,_0x8b89a9,_0x1a48a0,_0x4c4916){logger['info'](_0xd6f0('0x9'),_0xe21ac4,_0x1af29c['id'],_0x8b89a9,_0x1a48a0,JSON[_0xd6f0('0xa')](_0x4c4916));io['to'](_0x8b89a9)[_0xd6f0('0xb')](_0x1a48a0,_0x4c4916);}exports[_0xd6f0('0xc')]=function(_0x225dcf,_0x4db64a,_0x136eee,_0xee144c){var _0x329f69,_0x44bba6;var _0x4d10a1={};var _0x1ce8d5=Number(_0x136eee[_0xd6f0('0xd')]);var _0x306aad=_0x136eee[_0xd6f0('0xe')]?Boolean(Number(_0x136eee[_0xd6f0('0xe')])):![];var _0x409549;var _0x2bf5b8=![];if(!_[_0xd6f0('0xf')](_0x136eee[_0xd6f0('0x10')])){if(_0x136eee['data5']=='1')_0x2bf5b8=!![];}if(!_0x2bf5b8){if(_0xee144c[_0xd6f0('0x11')]){_0x4d10a1['id']=_0xee144c[_0xd6f0('0x11')];}}if(!_0x4d10a1['id']){_0x4d10a1['ListId']=_0x1ce8d5;_0x409549=_0x136eee[_0xd6f0('0x12')]&&_0x136eee['data3']!=='0'?_0x136eee[_0xd6f0('0x12')][_0xd6f0('0x13')](','):[_0xd6f0('0x14')];_0x4d10a1[_0xd6f0('0x15')]=_[_0xd6f0('0x16')](_0x409549,function(_0x61defb){var _0x25da0c={};_0x25da0c[_0x61defb]=_0xee144c[_0xd6f0('0x17')]?_0xee144c[_0xd6f0('0x18')]:_0xee144c[_0xd6f0('0x19')];return _0x25da0c;});}var _0x23ab6c=['id',_0xd6f0('0x1a'),_0xd6f0('0x1b'),_0xd6f0('0x14'),_0xd6f0('0x1c'),_0xd6f0('0x1d'),'ListId','createdAt',_0xd6f0('0x1e'),_0xd6f0('0x1f')];var _0x1158dc=_['union'](_0x23ab6c,_0x409549);BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc['getContacts']({'attributes':_0x1158dc,'where':_0x4d10a1}))[_0xd6f0('0x21')](function(_0x515687){_0x44bba6=_0x515687;if(!_[_0xd6f0('0x22')](_0x44bba6)){if(_0x44bba6[_0xd6f0('0x23')]===0x1){_0x329f69=_0x44bba6[0x0];logger['info'](_0xd6f0('0x24'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}else{logger['info'](_0xd6f0('0x26'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_[_0xd6f0('0x16')](_0x44bba6,'id')['join'](','));}return;}else{logger[_0xd6f0('0x27')](_0xd6f0('0x28'),_0xee144c['uniqueid'],_0x4db64a['id']);var _0xcea0ae={'ListId':_0x1ce8d5};var _0x551be8=_0x136eee[_0xd6f0('0x29')]&&_0x136eee[_0xd6f0('0x29')]!=='0'?_0x136eee[_0xd6f0('0x29')]:_0xd6f0('0x14');if(_0x306aad){logger[_0xd6f0('0x27')](_0xd6f0('0x2a'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_[_0xd6f0('0xf')](_0xee144c['routeId'])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_['isNil'](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c[_0xd6f0('0x2b')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c[_0xd6f0('0x2e')]!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}return BPromise[_0xd6f0('0x20')]()[_0xd6f0('0x21')](cmContactRpc[_0xd6f0('0x2f')](_0xcea0ae))[_0xd6f0('0x21')](function(_0x376890){_0x329f69=_0x376890;_0x44bba6[_0xd6f0('0x30')](_0x376890);if(_0x329f69){logger[_0xd6f0('0x27')](_0xd6f0('0x31'),_0xee144c[_0xd6f0('0x25')],_0x4db64a['id'],_0x329f69['id']);}return;});}else{logger['info'](_0xd6f0('0x32'),_0xee144c['uniqueid'],_0x4db64a['id']);_0xcea0ae[_0x551be8]=_['isNil'](_0xee144c[_0xd6f0('0x17')])?_0xee144c[_0xd6f0('0x19')]:_0xee144c[_0xd6f0('0x18')];if(_[_0xd6f0('0xf')](_0xee144c[_0xd6f0('0x17')])){_0xcea0ae['firstName']=_0xee144c[_0xd6f0('0x2b')]&&_0xee144c['calleridname']!==_0xd6f0('0x2c')?_0xee144c[_0xd6f0('0x2b')]:_0xd6f0('0x2d');}else{_0xcea0ae[_0xd6f0('0x1a')]=_0xee144c[_0xd6f0('0x2e')]&&_0xee144c['destcalleridname']!==''?_0xee144c[_0xd6f0('0x2e')]:_0xd6f0('0x2d');}_0x329f69=_0xcea0ae;_0x44bba6['push'](_0xcea0ae);return;}}})[_0xd6f0('0x21')](function(){if(_0x225dcf){emit(_0xee144c['uniqueid'],_0x4db64a,util[_0xd6f0('0x33')](_0xd6f0('0x34'),_0x225dcf[_0xd6f0('0x35')]),util[_0xd6f0('0x33')](_0xd6f0('0x36'),_0x136eee[_0xd6f0('0x37')][_0xd6f0('0x38')]()),{'evt':_['merge'](_0xee144c,{'autoCreate':_0x306aad}),'contact':_0x329f69===undefined?{}:_0x329f69,'contacts':_0x44bba6['length']===0x0?undefined:_0x44bba6});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index ff06d3d..4c20db7 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 _0xf9b0=['TemplateId','data2','html','render','template\x20not\x20found','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winApplication','format','name','toLowerCase','merge','user:%s','data1','trigger:%s','integration','exec','queue','routeId','urlforward','script','parse','query','channel','every','checkConditions','AnyConditions','some','field','ChatWebsiteId','operator','value','upperFirst','AccountId','event','agent','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','stringify','clone','motionChannel','undefined','voice','checkTriggers','hasOwnProperty','checkTrigger','Actions','length','interface','action','contactmanager','browser'];(function(_0x15145d,_0x55ec8b){var _0x1acf25=function(_0x153804){while(--_0x153804){_0x15145d['push'](_0x15145d['shift']());}};_0x1acf25(++_0x55ec8b);}(_0xf9b0,0x121));var _0x0f9b=function(_0x27d310,_0x5bfda9){_0x27d310=_0x27d310-0x0;var _0x484d80=_0xf9b0[_0x27d310];return _0x484d80;};'use strict';var util=require(_0x0f9b('0x0'));var _=require(_0x0f9b('0x1'));var url=require(_0x0f9b('0x2'));var Mustache=require(_0x0f9b('0x3'));var Redis=require(_0x0f9b('0x4'));var urlforward=require(_0x0f9b('0x5'));var integration=require(_0x0f9b('0x6'));var cmContact=require(_0x0f9b('0x7'));var script=require(_0x0f9b('0x8'));var config=require(_0x0f9b('0x9'));var logger=require(_0x0f9b('0xa'))(_0x0f9b('0xb'));var ami=require(_0x0f9b('0xc'));config[_0x0f9b('0xd')]=_[_0x0f9b('0xe')](config[_0x0f9b('0xd')],{'host':_0x0f9b('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x37eab6,_0x1b4d3e){return _0x37eab6==_0x1b4d3e;},'not_equals':function(_0x1d7a0f,_0x330328){return _0x1d7a0f!=_0x330328;}};var barAndWebActions=[_0x0f9b('0x10'),_0x0f9b('0x2'),_0x0f9b('0x11')];function Trigger(_0xe66b21){this[_0x0f9b('0x12')]=_0xe66b21['triggers'];this[_0x0f9b('0x13')]=_0xe66b21[_0x0f9b('0x13')];this[_0x0f9b('0x14')]=_0xe66b21['voiceQueues'];this[_0x0f9b('0x15')]=_0xe66b21[_0x0f9b('0x15')];this[_0x0f9b('0x16')]=_0xe66b21['voiceExtensions'];this['zendeskAccounts']=_0xe66b21[_0x0f9b('0x17')];this[_0x0f9b('0x18')]=_0xe66b21[_0x0f9b('0x18')];this[_0x0f9b('0x19')]=_0xe66b21[_0x0f9b('0x19')];this['sugarcrmAccounts']=_0xe66b21[_0x0f9b('0x1a')];this['zohoAccounts']=_0xe66b21[_0x0f9b('0x1b')];this[_0x0f9b('0x1c')]=_0xe66b21['deskAccounts'];this['vtigerAccounts']=_0xe66b21[_0x0f9b('0x1d')];this['servicenowAccounts']=_0xe66b21[_0x0f9b('0x1e')];this[_0x0f9b('0x1f')]=_0xe66b21['dynamics365Accounts'];this[_0x0f9b('0x20')]=_0xe66b21[_0x0f9b('0x20')];this[_0x0f9b('0x21')]={'zendesk':this[_0x0f9b('0x17')],'salesforce':this[_0x0f9b('0x19')],'freshdesk':this[_0x0f9b('0x18')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x0f9b('0x1b')],'desk':this[_0x0f9b('0x1c')],'vtiger':this[_0x0f9b('0x1d')],'dynamics365':this[_0x0f9b('0x1f')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x0f9b('0x1e')]};ami['on']('custom:agentcalled',this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on']('custom:agentconnect',this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x24'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x25'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x26'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x27'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x28'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x29'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x2a'),this['syncCustomEvent'][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x2b'),this['syncCustomEvent'][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x2c'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x2d'),this[_0x0f9b('0x22')]['bind'](this));ami['on'](_0x0f9b('0x2e'),this['syncAgentDial'][_0x0f9b('0x23')](this));ami['on']('custom:dialconnect',this[_0x0f9b('0x2f')][_0x0f9b('0x23')](this));ami['on']('custom:dialend',this[_0x0f9b('0x2f')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x30'),this['syncCustomEvent'][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x0f9b('0x32'),this['syncCustomEvent'][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x33'),this[_0x0f9b('0x22')]['bind'](this));ami['on'](_0x0f9b('0x34'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x35'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));ami['on'](_0x0f9b('0x36'),this[_0x0f9b('0x22')][_0x0f9b('0x23')](this));}Trigger[_0x0f9b('0x37')][_0x0f9b('0x38')]=function(_0x41f0d9,_0x3961b2,_0x1ee81c){logger['info'](_0x41f0d9,_0x3961b2,JSON[_0x0f9b('0x39')](_0x1ee81c));io['to'](_0x41f0d9)[_0x0f9b('0x38')](_0x3961b2,_0x1ee81c);};Trigger[_0x0f9b('0x37')][_0x0f9b('0x22')]=function(_0x3139a6){var _0x25c5cc=_[_0x0f9b('0x3a')](_0x3139a6);if(typeof _0x25c5cc[_0x0f9b('0x3b')]===_0x0f9b('0x3c')){_0x25c5cc[_0x0f9b('0x3b')]=_0x0f9b('0x3d');}this['checkTriggers'](_0x25c5cc);};Trigger[_0x0f9b('0x37')]['syncAgentDial']=function(_0x9bc066){if(this['agents'][_0x9bc066['interface']]){this[_0x0f9b('0x22')](_0x9bc066);}};Trigger[_0x0f9b('0x37')][_0x0f9b('0x3e')]=function(_0x210cfd){var _0x364312;for(var _0x5da02a in this[_0x0f9b('0x12')]){if(this[_0x0f9b('0x12')][_0x0f9b('0x3f')](_0x5da02a)){if(this[_0x0f9b('0x12')][_0x5da02a]['status']){_0x364312=this[_0x0f9b('0x40')](this[_0x0f9b('0x12')][_0x5da02a],_0x210cfd);if(_0x364312){_['merge'](_0x210cfd,_0x210cfd['variables']);for(var _0x131e36=0x0,_0xfd0c71,_0x1d81a6,_0x4dbe46;_0x131e360x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x5fc3=['map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','custom_fields','variable','variableName','idField','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','recordingURL','The\x20User\x20ID\x20is:','destcalleridnum','Ticket\x20created!','[OUTBOUND]','unmanaged','lastevent','Recording\x20is\x20enabled!','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','remoteUri','total_entries','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','%s/users/me','debug','stringify','authType','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x5fc3,0xa8));var _0x35fc=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0x5fc3[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0x35fc('0x0'));var rp=require(_0x35fc('0x1'));var md5=require('md5');var util=require(_0x35fc('0x2'));var Redis=require(_0x35fc('0x3'));var intUtil=require(_0x35fc('0x4'));var config=require(_0x35fc('0x5'));var logger=require(_0x35fc('0x6'))('desk');config[_0x35fc('0x7')]=_[_0x35fc('0x8')](config[_0x35fc('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35fc('0x7')]));function emit(_0x508b32,_0x16e153,_0x27524f){io['to'](_0x508b32)[_0x35fc('0x9')](_0x16e153,_0x27524f);}var headers={'Content-Type':_0x35fc('0xa'),'Accept':_0x35fc('0xa')};function getUser(_0xf9d3a6,_0x2051ab){if(intUtil['validateEmail'](_0x2051ab)===!![]){logger[_0x35fc('0xb')](_0x35fc('0xc'),_0x2051ab);return request({'uri':util['format'](_0x35fc('0xd'),_0xf9d3a6[_0x35fc('0xe')])})['then'](function(_0xda83fb){if(_0xda83fb[_0x35fc('0xf')]){return _['find'](_0xda83fb['_embedded'][_0x35fc('0x10')],{'email':_0x2051ab});}})['then'](function(_0x397738){if(_0x397738){logger[_0x35fc('0xb')](_0x35fc('0x11'));return _0x397738;}else{logger[_0x35fc('0xb')](_0x35fc('0x12'));return request({'uri':util['format']('%s/users/me',_0xf9d3a6['remoteUri'])});}});}else{logger['info'](_0x35fc('0x13'));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x15'),_0xf9d3a6[_0x35fc('0xe')])});}}function request(_0x227a49){logger[_0x35fc('0x16')]('[HTTP]',JSON[_0x35fc('0x17')](_0x227a49));return rp(_[_0x35fc('0x8')](_0x227a49,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x41e165){var _0x363e47;if(_0x41e165[_0x35fc('0x18')]==='basic'){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x19'),_0x41e165[_0x35fc('0x1a')],_0x41e165['password']);}else if(_0x41e165[_0x35fc('0x18')]===_0x35fc('0x1b')){_0x363e47=util[_0x35fc('0x14')](_0x35fc('0x1c'),_0x41e165[_0x35fc('0x1a')],_0x41e165[_0x35fc('0x1b')]);}return util[_0x35fc('0x14')](_0x35fc('0x1d'),new Buffer(_0x363e47)[_0x35fc('0x1e')](_0x35fc('0x1f')));}function getEndUser(_0x5bd2b8,_0x323aee,_0xd5399f){logger[_0x35fc('0xb')](_0x35fc('0x20'),_0xd5399f);return request({'uri':util[_0x35fc('0x14')]('%s/customers/search',_0x5bd2b8[_0x35fc('0xe')]),'qs':{'phone':_0xd5399f}})[_0x35fc('0x21')](function(_0x561bf8){if(_0x561bf8[_0x35fc('0xf')]){logger[_0x35fc('0xb')](_0x35fc('0x22'));return _0x561bf8['_embedded'][_0x35fc('0x10')][0x0];}else{logger['info'](_0x35fc('0x23'));return request({'uri':util[_0x35fc('0x14')]('%s/customers',_0x5bd2b8['remoteUri']),'method':_0x35fc('0x24'),'body':{'first_name':_0x323aee,'title':_0x323aee,'phone_numbers':[{'type':'work','value':_0xd5399f}]}});}});}function getTags(_0x274208,_0x1a5d92){var _0x57001c=[];if(_0x274208&&_0x274208[_0x35fc('0x25')]>0x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 5f74f25..4d9d5c1 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 _0x9a39=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','socket.io-emitter','POST','remoteUri','username','clientSecret','then','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','contactid',']\x20Enduser\x20Created!','forEach','string','picklist','type','customField','idField','content','ticketType','incident','incidents','assign','Subjects','getString','/contacts(','Fields','phonecall','phonecalls','Descriptions','callDirection','queue','headers','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x44c325,_0x19c625){var _0x55f09e=function(_0x322d1b){while(--_0x322d1b){_0x44c325['push'](_0x44c325['shift']());}};_0x55f09e(++_0x19c625);}(_0x9a39,0xd1));var _0x99a3=function(_0x8b5835,_0x1ad3f2){_0x8b5835=_0x8b5835-0x0;var _0x28a7b3=_0x9a39[_0x8b5835];return _0x28a7b3;};'use strict';var _=require('lodash');var BPromise=require(_0x99a3('0x0'));var rp=require(_0x99a3('0x1'));var util=require('util');var intUtil=require('./util');var md5=require(_0x99a3('0x2'));var Redis=require(_0x99a3('0x3'));var logger=require(_0x99a3('0x4'))('dynamics365');var config=require(_0x99a3('0x5'));config[_0x99a3('0x6')]=_['defaults'](config[_0x99a3('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x99a3('0x7'))(new Redis(config[_0x99a3('0x6')]));function getAuthToken(_0x44d646,_0x5558c8,_0x4956e0){var _0x2f389e={'method':_0x99a3('0x8'),'uri':_0x5558c8,'form':{'client_id':_0x44d646['clientId'],'resource':_0x44d646[_0x99a3('0x9')],'username':_0x44d646[_0x99a3('0xa')],'password':_0x44d646['password'],'grant_type':'password','client_secret':_0x44d646[_0x99a3('0xb')]},'json':!![]};return rp(_0x2f389e)[_0x99a3('0xc')](function(_0x6ca30f){return _0x6ca30f['access_token'];})[_0x99a3('0xd')](function(_0x3c758a){logger['error']('['+[_0x4956e0[_0x99a3('0xe')]()]+_0x99a3('0xf'));return _0x3c758a[_0x99a3('0x10')];});}function getUser(_0xcaba16,_0x2cca93,_0x535c9c,_0x461b46,_0x1790f4,_0x58d890){return new BPromise(function(_0x460d7a,_0xdfa1e1){return getAuthToken(_0x2cca93,_0x461b46,_0x58d890)['then'](function(_0x5a48e5){var _0x34178a={'method':_0x99a3('0x11'),'uri':_0x1790f4+_0x99a3('0x12'),'headers':{'Authorization':_0x99a3('0x13')+_0x5a48e5,'OData-Version':'4.0'},'json':!![]};return rp(_0x34178a);})[_0x99a3('0xc')](function(_0x2013eb){var _0x5cb2cd=_0x2013eb[_0x99a3('0x14')];var _0x41b093=![];var _0x9d74c1=null;if(!_[_0x99a3('0x15')](_0x535c9c)){if(intUtil[_0x99a3('0x16')](_0x535c9c[_0x99a3('0x17')])){_0xcaba16[_0x99a3('0x18')]=_0x535c9c[_0x99a3('0x17')];for(_0x9d74c1=0x0;_0x9d74c1<_0x5cb2cd[_0x99a3('0x19')];_0x9d74c1++){if(_0x5cb2cd[_0x9d74c1][_0x99a3('0x1a')]===_0x535c9c[_0x99a3('0x17')]&&!_0x5cb2cd[_0x9d74c1][_0x99a3('0x1b')]){_0x41b093=!![];logger[_0x99a3('0x1c')]('['+[_0x58d890[_0x99a3('0xe')]()]+_0x99a3('0x1d')+_0x5cb2cd[_0x9d74c1][_0x99a3('0x1e')]+'!');_0xcaba16[_0x99a3('0x1f')]=_0x5cb2cd[_0x9d74c1]['systemuserid'];}}}}if(!_0x41b093){logger[_0x99a3('0x1c')]('['+[_0x58d890[_0x99a3('0xe')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xcaba16['userEmail']=_0x2cca93[_0x99a3('0xa')];for(_0x9d74c1=0x0;_0x9d74c1<_0x5cb2cd[_0x99a3('0x19')];_0x9d74c1++){if(_0x5cb2cd[_0x9d74c1][_0x99a3('0x1a')]===_0x2cca93[_0x99a3('0xa')]){_0xcaba16[_0x99a3('0x1f')]=_0x5cb2cd[_0x9d74c1]['systemuserid'];}}}_0x460d7a(_0xcaba16);})[_0x99a3('0xd')](function(_0x4e9667){_0xdfa1e1(_0x4e9667[_0x99a3('0x10')]);});});}function createEndUser(_0x65428a,_0x4f66a1,_0x277aed,_0x4f3d44,_0x55ce8f,_0x4a5942){return new BPromise(function(_0x36b21d,_0x3a09bf){return getAuthToken(_0x4f66a1,_0x277aed,_0x4a5942)['then'](function(_0x28a0cc){var _0x4baf0f=_0x4a5942[_0x99a3('0x20')]()===_0x99a3('0x21')?_0x55ce8f[_0x99a3('0x22')]:_0x55ce8f[_0x99a3('0x23')];var _0x3a3274={'method':'POST','uri':_0x4f3d44+_0x99a3('0x24'),'body':{'telephone1':_0x4baf0f,'fullname':_0x4baf0f,'firstname':_0x4baf0f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x99a3('0x25')+_0x65428a[_0x99a3('0x1f')]+')'},'headers':{'Authorization':_0x99a3('0x13')+_0x28a0cc,'OData-Version':_0x99a3('0x26')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3a3274);})[_0x99a3('0xc')](function(_0x13536d){var _0x27b5b0=_0x13536d['headers'][_0x99a3('0x27')];var _0x1ac40f=_0x27b5b0[_0x99a3('0x28')](_0x27b5b0[_0x99a3('0x29')]('(')+0x1,_0x27b5b0[_0x99a3('0x29')](')'));_0x65428a[_0x99a3('0x2a')]=_0x1ac40f;_0x36b21d(_0x65428a);})['catch'](function(_0xd85b07){_0x3a09bf(_0xd85b07['message']);});});}function getEndUser(_0xc2cbd6,_0x2522df,_0x263e52,_0x4bb53f,_0x20a7a0,_0x2ea665){return new BPromise(function(_0x5c4184,_0x5da449){var _0x1fb7a3=_0x2ea665[_0x99a3('0x20')]()==='outbound'?_0x20a7a0['destcalleridnum']:_0x20a7a0[_0x99a3('0x23')];return getAuthToken(_0x2522df,_0x263e52,_0x2ea665)[_0x99a3('0xc')](function(_0x1f0c09){var _0x4a5287={'method':_0x99a3('0x11'),'uri':_0x4bb53f+_0x99a3('0x2b')+_0x1fb7a3[_0x99a3('0x2c')]('+','%2b')+'\x27','headers':{'Authorization':_0x99a3('0x13')+_0x1f0c09,'If-None-Match':null,'OData-Version':_0x99a3('0x26')},'json':!![]};return rp(_0x4a5287);})[_0x99a3('0xc')](function(_0x98f76){var _0x1d39f1=null;if(_0x98f76){var _0x153c61=_0x98f76[_0x99a3('0x14')];var _0x1205e4=![];for(_0x1d39f1=0x0;_0x1d39f1<_0x153c61[_0x99a3('0x19')];_0x1d39f1++){if(_0x153c61[_0x1d39f1][_0x99a3('0x2d')]===_0x1fb7a3){_0x1205e4=!![];_0xc2cbd6[_0x99a3('0x2a')]=_0x153c61[_0x1d39f1][_0x99a3('0x2e')];}}if(_0x1205e4){_0x5c4184(_0xc2cbd6);}else{return createEndUser(_0xc2cbd6,_0x2522df,_0x263e52,_0x4bb53f,_0x20a7a0,_0x2ea665)['then'](function(_0x53cadf){logger[_0x99a3('0x1c')]('['+[_0x2ea665[_0x99a3('0xe')]()]+']\x20Enduser\x20created!',_0x53cadf['enduserId']);_0x5c4184(_0x53cadf);});}}else{return createEndUser(_0xc2cbd6,_0x2522df,_0x263e52,_0x4bb53f,_0x20a7a0,_0x2ea665)['then'](function(_0xed4b69){logger[_0x99a3('0x1c')]('['+[_0x2ea665[_0x99a3('0xe')]()]+_0x99a3('0x2f'),_0xed4b69[_0x99a3('0x2a')]);_0x5c4184(_0xed4b69);});}});});}function getCustomFields(_0x16df23,_0x3d613a,_0x3e7efa){var _0x470170={};if(_0x16df23[_0x99a3('0x19')]>0x0){_[_0x99a3('0x30')](_0x16df23,function(_0x4e33b0){if(_['includes']([_0x99a3('0x31'),_0x99a3('0x32')],_0x4e33b0[_0x99a3('0x33')])&&_0x4e33b0['nameField']&&!_0x4e33b0[_0x99a3('0x34')]){var _0x2c0918=_0x4e33b0[_0x99a3('0x35')][_0x99a3('0x20')]();var _0x2f41e1=_0x2c0918['substring'](0x0,_0x2c0918['indexOf']('_'));var _0x5daba3=_0x2c0918['substring'](_0x2c0918['indexOf']('_')+0x1);if(_0x2f41e1===_0x3e7efa){_0x470170[_0x5daba3]=_0x4e33b0[_0x99a3('0x36')];}}});}return _0x470170;}function getTicket(_0x4c6280,_0x22bc55,_0xffca68,_0x82b425,_0x295197,_0x2bc550,_0x261ad4){return new BPromise(function(_0x4660d9,_0x13a6b4){var _0x396875;return getAuthToken(_0x22bc55,_0xffca68,_0x261ad4)[_0x99a3('0xc')](function(_0x394cea){if(_0x2bc550[_0x99a3('0x37')]===_0x99a3('0x38')){_0x396875={'method':_0x99a3('0x8'),'uri':_0x82b425+_0x99a3('0x39'),'body':Object[_0x99a3('0x3a')]({},{'title':intUtil['getString'](_0x2bc550[_0x99a3('0x3b')],_0x295197,'\x20'),'description':intUtil[_0x99a3('0x3c')](_0x2bc550['Descriptions'],_0x295197,'\x0a'),'customerid_contact@odata.bind':_0x99a3('0x3d')+_0x4c6280[_0x99a3('0x2a')]+')','ownerid@odata.bind':'/systemusers('+_0x4c6280['userId']+')','caseorigincode':'1'},getCustomFields(_0x2bc550[_0x99a3('0x3e')],_0x295197,_0x2bc550[_0x99a3('0x37')])),'headers':{'Authorization':_0x99a3('0x13')+_0x394cea,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2bc550[_0x99a3('0x37')]===_0x99a3('0x3f')){_0x396875={'method':'POST','uri':_0x82b425+_0x99a3('0x40'),'body':Object[_0x99a3('0x3a')]({},{'subject':intUtil[_0x99a3('0x3c')](_0x2bc550[_0x99a3('0x3b')],_0x295197,'\x20'),'phonenumber':String(_0x295197['calleridnum']),'description':intUtil['getString'](_0x2bc550[_0x99a3('0x41')],_0x295197,'\x0a'),'regardingobjectid_contact@odata.bind':_0x99a3('0x3d')+_0x4c6280['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x4c6280['userId']+')','directioncode':_0x4c6280['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x99a3('0x25')+_0x4c6280[_0x99a3('0x1f')]+')','participationtypemask':_0x4c6280[_0x99a3('0x42')]===_0x99a3('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x99a3('0x3d')+_0x4c6280['enduserId']+')','participationtypemask':_0x4c6280['callDirection']===_0x99a3('0x43')?0x1:0x2}]},getCustomFields(_0x2bc550[_0x99a3('0x3e')],_0x295197,_0x2bc550[_0x99a3('0x37')])),'headers':{'Authorization':_0x99a3('0x13')+_0x394cea,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x396875);})[_0x99a3('0xc')](function(_0x5a59bb){var _0x10798b=_0x5a59bb[_0x99a3('0x44')]['odata-entityid'];var _0x211d1d=_0x10798b[_0x99a3('0x28')](_0x10798b[_0x99a3('0x29')]('(')+0x1,_0x10798b[_0x99a3('0x29')](')'));_0x4c6280[_0x99a3('0x45')]=_0x211d1d;_0x4660d9(_0x4c6280);})[_0x99a3('0xd')](function(_0x49304f){_0x13a6b4(_0x49304f[_0x99a3('0x10')]);});});}function emit(_0x12754e,_0x3bbac0,_0xe6a6c2,_0x25c9ea){var _0x5af844={'uri':util['format'](_0x99a3('0x46'),_0x12754e,_0xe6a6c2,_0x25c9ea)};io['to'](util[_0x99a3('0x47')]('user:%s',_0x3bbac0))[_0x99a3('0x48')]('trigger:browser:url',_0x5af844);}exports['cs']=function(_0xd703f7,_0x46cfe2,_0x45e3cf,_0x5d9557,_0x310ec4,_0x5705b3,_0x4212d8,_0x5213d0){var _0x1b6b0f={};_0x5705b3['remoteUri']=intUtil['stripTrailingSlash'](_0x5705b3[_0x99a3('0x9')]);_0x5705b3['serverUrl']=intUtil[_0x99a3('0x49')](_0x5705b3[_0x99a3('0x4a')]);_0x1b6b0f[_0x99a3('0x42')]=_0x5213d0===_0x99a3('0x43')||_0x5213d0===_0x99a3('0x4b')?_0x99a3('0x43'):'outbound';var _0x31091a=util[_0x99a3('0x47')](_0x99a3('0x4c'),_0x5705b3[_0x99a3('0x9')]);var _0x4bdf32=util[_0x99a3('0x47')](_0x99a3('0x4d'),_0x5705b3['tenantId']);var _0x280e78=util[_0x99a3('0x47')](_0x99a3('0x4e'),_0x5705b3[_0x99a3('0x4a')],_0x46cfe2[_0x99a3('0x4f')],md5(_0x46cfe2[_0x99a3('0x4f')]));if(_0x310ec4&&_0x310ec4[_0x99a3('0x50')]){logger[_0x99a3('0x1c')](_0x99a3('0x51'),_0x99a3('0x52'));_0x46cfe2[_0x99a3('0x53')]=_0x280e78;}else if(_0x4212d8&&_0x4212d8['recordingFormat']&&_0x4212d8[_0x99a3('0x54')]!==_0x99a3('0x55')){logger['info'](_0x99a3('0x56'),_0x99a3('0x52'));_0x46cfe2[_0x99a3('0x53')]=_0x280e78;}else{_0x46cfe2[_0x99a3('0x53')]='';}return getUser(_0x1b6b0f,_0x5705b3,_0x5d9557,_0x4bdf32,_0x31091a,_0x5213d0)[_0x99a3('0xc')](function(_0x22c9c0){logger[_0x99a3('0x1c')]('['+_0x5213d0['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x22c9c0[_0x99a3('0x1f')]);logger[_0x99a3('0x1c')]('['+_0x5213d0[_0x99a3('0xe')]()+_0x99a3('0x57'),_0x22c9c0['userEmail']);return getEndUser(_0x22c9c0,_0x5705b3,_0x4bdf32,_0x31091a,_0x46cfe2,_0x5213d0);})[_0x99a3('0xc')](function(_0x317122){logger[_0x99a3('0x1c')]('['+_0x5213d0['toUpperCase']()+_0x99a3('0x58'),_0x317122[_0x99a3('0x2a')]);logger[_0x99a3('0x1c')]('['+_0x5213d0[_0x99a3('0xe')]()+_0x99a3('0x59'),_0x46cfe2[_0x99a3('0x23')]);return getTicket(_0x317122,_0x5705b3,_0x4bdf32,_0x31091a,_0x46cfe2,_0x45e3cf,_0x5213d0);})['then'](function(_0x138a2b){logger['info'](util[_0x99a3('0x47')]('['+_0x5213d0[_0x99a3('0xe')]()+_0x99a3('0x5a'),_0x45e3cf[_0x99a3('0x37')],_0x138a2b[_0x99a3('0x45')]));logger['info'](util[_0x99a3('0x47')]('['+_0x5213d0[_0x99a3('0xe')]()+_0x99a3('0x5b'),_0x5213d0));if(_0x5213d0!==_0x99a3('0x4b')){logger[_0x99a3('0x1c')]('['+_0x5213d0[_0x99a3('0xe')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5705b3[_0x99a3('0x9')],_0x5d9557[_0x99a3('0x5c')],_0x45e3cf[_0x99a3('0x37')],_0x138a2b['ticketId']);}})['catch'](function(_0xa1a92b){logger[_0x99a3('0x5d')]('['+_0x5213d0[_0x99a3('0xe')]()+_0x99a3('0x5e'),util[_0x99a3('0x5f')](_0xa1a92b,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xe799=['validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','Bearer\x20','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','includes','picklist','nameField','customField','indexOf','content','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','callDirection','queue','headers','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','remoteUri','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','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','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xe799,0x11c));var _0x9e79=function(_0x21bd5e,_0x3d2bc6){_0x21bd5e=_0x21bd5e-0x0;var _0x4b500d=_0xe799[_0x21bd5e];return _0x4b500d;};'use strict';var _=require(_0x9e79('0x0'));var BPromise=require(_0x9e79('0x1'));var rp=require(_0x9e79('0x2'));var util=require(_0x9e79('0x3'));var intUtil=require(_0x9e79('0x4'));var md5=require('md5');var Redis=require(_0x9e79('0x5'));var logger=require(_0x9e79('0x6'))('dynamics365');var config=require(_0x9e79('0x7'));config[_0x9e79('0x8')]=_[_0x9e79('0x9')](config[_0x9e79('0x8')],{'host':_0x9e79('0xa'),'port':0x18eb});var io=require(_0x9e79('0xb'))(new Redis(config[_0x9e79('0x8')]));function getAuthToken(_0x10d6a2,_0x4a3eaa,_0x4093f7){var _0x5d34f8={'method':_0x9e79('0xc'),'uri':_0x4a3eaa,'form':{'client_id':_0x10d6a2[_0x9e79('0xd')],'resource':_0x10d6a2['remoteUri'],'username':_0x10d6a2[_0x9e79('0xe')],'password':_0x10d6a2[_0x9e79('0xf')],'grant_type':_0x9e79('0xf'),'client_secret':_0x10d6a2[_0x9e79('0x10')]},'json':!![]};return rp(_0x5d34f8)[_0x9e79('0x11')](function(_0x5e4158){return _0x5e4158[_0x9e79('0x12')];})[_0x9e79('0x13')](function(_0x9acf14){logger[_0x9e79('0x14')]('['+[_0x4093f7[_0x9e79('0x15')]()]+_0x9e79('0x16'));return _0x9acf14[_0x9e79('0x17')];});}function getUser(_0x2a8f66,_0x37ea46,_0x201474,_0x1980b6,_0x326692,_0x4ad49a){return new BPromise(function(_0x4eddc0,_0x34b388){return getAuthToken(_0x37ea46,_0x1980b6,_0x4ad49a)[_0x9e79('0x11')](function(_0x4e8f6d){var _0x59f57e={'method':_0x9e79('0x18'),'uri':_0x326692+_0x9e79('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x4e8f6d,'OData-Version':_0x9e79('0x1a')},'json':!![]};return rp(_0x59f57e);})[_0x9e79('0x11')](function(_0xb8dc5d){var _0x2e145d=_0xb8dc5d[_0x9e79('0x1b')];var _0x316eb4=![];var _0x17a970=null;if(!_['isNil'](_0x201474)){if(intUtil[_0x9e79('0x1c')](_0x201474[_0x9e79('0x1d')])){_0x2a8f66[_0x9e79('0x1e')]=_0x201474[_0x9e79('0x1d')];for(_0x17a970=0x0;_0x17a970<_0x2e145d[_0x9e79('0x1f')];_0x17a970++){if(_0x2e145d[_0x17a970][_0x9e79('0x20')]===_0x201474[_0x9e79('0x1d')]&&!_0x2e145d[_0x17a970][_0x9e79('0x21')]){_0x316eb4=!![];logger[_0x9e79('0x22')]('['+[_0x4ad49a[_0x9e79('0x15')]()]+_0x9e79('0x23')+_0x2e145d[_0x17a970][_0x9e79('0x24')]+'!');_0x2a8f66['userId']=_0x2e145d[_0x17a970][_0x9e79('0x24')];}}}}if(!_0x316eb4){logger[_0x9e79('0x22')]('['+[_0x4ad49a[_0x9e79('0x15')]()]+_0x9e79('0x25'));_0x2a8f66[_0x9e79('0x1e')]=_0x37ea46[_0x9e79('0xe')];for(_0x17a970=0x0;_0x17a970<_0x2e145d[_0x9e79('0x1f')];_0x17a970++){if(_0x2e145d[_0x17a970][_0x9e79('0x20')]===_0x37ea46['username']){_0x2a8f66[_0x9e79('0x26')]=_0x2e145d[_0x17a970]['systemuserid'];}}}_0x4eddc0(_0x2a8f66);})['catch'](function(_0x59f32a){_0x34b388(_0x59f32a[_0x9e79('0x17')]);});});}function createEndUser(_0x4c5f69,_0x290b3e,_0x4e89f6,_0x165d82,_0x497669,_0x4f657a){return new BPromise(function(_0x19c6ed,_0x1bd18d){return getAuthToken(_0x290b3e,_0x4e89f6,_0x4f657a)[_0x9e79('0x11')](function(_0x1ae332){var _0x20ffc5=_0x4f657a[_0x9e79('0x27')]()===_0x9e79('0x28')?_0x497669[_0x9e79('0x29')]:_0x497669[_0x9e79('0x2a')];var _0x43a4d7={'method':_0x9e79('0xc'),'uri':_0x165d82+_0x9e79('0x2b'),'body':{'telephone1':_0x20ffc5,'fullname':_0x20ffc5,'firstname':_0x20ffc5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9e79('0x2c')+_0x4c5f69[_0x9e79('0x26')]+')'},'headers':{'Authorization':_0x9e79('0x2d')+_0x1ae332,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x43a4d7);})['then'](function(_0x3e9a1a){var _0x25563f=_0x3e9a1a['headers'][_0x9e79('0x2e')];var _0xa67cf=_0x25563f[_0x9e79('0x2f')](_0x25563f[_0x9e79('0x30')]('(')+0x1,_0x25563f[_0x9e79('0x30')](')'));_0x4c5f69[_0x9e79('0x31')]=_0xa67cf;_0x19c6ed(_0x4c5f69);})[_0x9e79('0x13')](function(_0x5cf216){_0x1bd18d(_0x5cf216['message']);});});}function getEndUser(_0x43f1d0,_0x32474f,_0x56a2d4,_0x4300b4,_0x24eb51,_0x567ef9){return new BPromise(function(_0x21843b,_0x51fa76){var _0x1deaae=_0x567ef9[_0x9e79('0x27')]()===_0x9e79('0x28')?_0x24eb51['destcalleridnum']:_0x24eb51['calleridnum'];return getAuthToken(_0x32474f,_0x56a2d4,_0x567ef9)['then'](function(_0x1678b4){var _0x5e404b={'method':'GET','uri':_0x4300b4+_0x9e79('0x32')+_0x1deaae['replace']('+',_0x9e79('0x33'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x1678b4,'If-None-Match':null,'OData-Version':_0x9e79('0x1a')},'json':!![]};return rp(_0x5e404b);})[_0x9e79('0x11')](function(_0xdb8016){var _0x376914=null;if(_0xdb8016){var _0x5e652e=_0xdb8016[_0x9e79('0x1b')];var _0x2f1cfb=![];for(_0x376914=0x0;_0x376914<_0x5e652e[_0x9e79('0x1f')];_0x376914++){if(_0x5e652e[_0x376914][_0x9e79('0x34')]===_0x1deaae){_0x2f1cfb=!![];_0x43f1d0[_0x9e79('0x31')]=_0x5e652e[_0x376914][_0x9e79('0x35')];}}if(_0x2f1cfb){_0x21843b(_0x43f1d0);}else{return createEndUser(_0x43f1d0,_0x32474f,_0x56a2d4,_0x4300b4,_0x24eb51,_0x567ef9)['then'](function(_0x582fd9){logger[_0x9e79('0x22')]('['+[_0x567ef9[_0x9e79('0x15')]()]+_0x9e79('0x36'),_0x582fd9[_0x9e79('0x31')]);_0x21843b(_0x582fd9);});}}else{return createEndUser(_0x43f1d0,_0x32474f,_0x56a2d4,_0x4300b4,_0x24eb51,_0x567ef9)[_0x9e79('0x11')](function(_0xcda90){logger[_0x9e79('0x22')]('['+[_0x567ef9[_0x9e79('0x15')]()]+_0x9e79('0x37'),_0xcda90[_0x9e79('0x31')]);_0x21843b(_0xcda90);});}});});}function getCustomFields(_0x296b00,_0x10b32d,_0x3d7533){var _0x910be5={};if(_0x296b00['length']>0x0){_['forEach'](_0x296b00,function(_0x532e22){if(_[_0x9e79('0x38')](['string',_0x9e79('0x39')],_0x532e22['type'])&&_0x532e22[_0x9e79('0x3a')]&&!_0x532e22[_0x9e79('0x3b')]){var _0x1478ee=_0x532e22['idField'][_0x9e79('0x27')]();var _0x58b6da=_0x1478ee['substring'](0x0,_0x1478ee[_0x9e79('0x3c')]('_'));var _0x4d8d3b=_0x1478ee[_0x9e79('0x2f')](_0x1478ee[_0x9e79('0x3c')]('_')+0x1);if(_0x58b6da===_0x3d7533){_0x910be5[_0x4d8d3b]=_0x532e22[_0x9e79('0x3d')];}}});}return _0x910be5;}function getTicket(_0x42a97f,_0x23615e,_0x346f81,_0x173178,_0x2c8939,_0x52a445,_0x20fbc7){return new BPromise(function(_0x54b3cc,_0x10e23b){var _0x450a0c;return getAuthToken(_0x23615e,_0x346f81,_0x20fbc7)[_0x9e79('0x11')](function(_0x5ef6ba){if(_0x52a445['ticketType']===_0x9e79('0x3e')){_0x450a0c={'method':_0x9e79('0xc'),'uri':_0x173178+_0x9e79('0x3f'),'body':Object[_0x9e79('0x40')]({},{'title':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x42')],_0x2c8939,'\x20'),'description':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x43')],_0x2c8939,'\x0a'),'customerid_contact@odata.bind':_0x9e79('0x44')+_0x42a97f[_0x9e79('0x31')]+')','ownerid@odata.bind':_0x9e79('0x2c')+_0x42a97f[_0x9e79('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x52a445[_0x9e79('0x45')],_0x2c8939,_0x52a445[_0x9e79('0x46')])),'headers':{'Authorization':_0x9e79('0x2d')+_0x5ef6ba,'OData-Version':_0x9e79('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x52a445[_0x9e79('0x46')]==='phonecall'){_0x450a0c={'method':_0x9e79('0xc'),'uri':_0x173178+'phonecalls','body':Object[_0x9e79('0x40')]({},{'subject':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x42')],_0x2c8939,'\x20'),'phonenumber':String(_0x2c8939[_0x9e79('0x2a')]),'description':intUtil[_0x9e79('0x41')](_0x52a445[_0x9e79('0x43')],_0x2c8939,'\x0a'),'regardingobjectid_contact@odata.bind':_0x9e79('0x44')+_0x42a97f[_0x9e79('0x31')]+')','ownerid@odata.bind':_0x9e79('0x2c')+_0x42a97f[_0x9e79('0x26')]+')','directioncode':_0x42a97f[_0x9e79('0x47')]===_0x9e79('0x48')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x9e79('0x2c')+_0x42a97f[_0x9e79('0x26')]+')','participationtypemask':_0x42a97f[_0x9e79('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x9e79('0x44')+_0x42a97f[_0x9e79('0x31')]+')','participationtypemask':_0x42a97f[_0x9e79('0x47')]===_0x9e79('0x48')?0x1:0x2}]},getCustomFields(_0x52a445[_0x9e79('0x45')],_0x2c8939,_0x52a445[_0x9e79('0x46')])),'headers':{'Authorization':_0x9e79('0x2d')+_0x5ef6ba,'OData-Version':_0x9e79('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x450a0c);})[_0x9e79('0x11')](function(_0x2ec85f){var _0x137903=_0x2ec85f[_0x9e79('0x49')]['odata-entityid'];var _0x50a778=_0x137903['substring'](_0x137903[_0x9e79('0x30')]('(')+0x1,_0x137903['lastIndexOf'](')'));_0x42a97f[_0x9e79('0x4a')]=_0x50a778;_0x54b3cc(_0x42a97f);})['catch'](function(_0x59000f){_0x10e23b(_0x59000f[_0x9e79('0x17')]);});});}function emit(_0x1d0ba3,_0x7846a,_0x5e6eeb,_0x52d065){var _0xf62e05={'uri':util[_0x9e79('0x4b')](_0x9e79('0x4c'),_0x1d0ba3,_0x5e6eeb,_0x52d065)};io['to'](util[_0x9e79('0x4b')](_0x9e79('0x4d'),_0x7846a))[_0x9e79('0x4e')](_0x9e79('0x4f'),_0xf62e05);}exports['cs']=function(_0x229911,_0x1a71b7,_0x5e2ac7,_0x3ba211,_0x5b6312,_0x2e3a26,_0x35427f,_0x14b89c){var _0x1b4513={};_0x2e3a26['remoteUri']=intUtil[_0x9e79('0x50')](_0x2e3a26[_0x9e79('0x51')]);_0x2e3a26[_0x9e79('0x52')]=intUtil[_0x9e79('0x50')](_0x2e3a26[_0x9e79('0x52')]);_0x1b4513[_0x9e79('0x47')]=_0x14b89c==='queue'||_0x14b89c===_0x9e79('0x53')?'queue':_0x9e79('0x28');var _0x466b37=util[_0x9e79('0x4b')](_0x9e79('0x54'),_0x2e3a26['remoteUri']);var _0x1f31e9=util[_0x9e79('0x4b')](_0x9e79('0x55'),_0x2e3a26[_0x9e79('0x56')]);var _0x20f965=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2e3a26[_0x9e79('0x52')],_0x1a71b7[_0x9e79('0x57')],md5(_0x1a71b7[_0x9e79('0x57')]));if(_0x5b6312&&_0x5b6312[_0x9e79('0x58')]){logger['info'](_0x9e79('0x59'),_0x9e79('0x5a'));_0x1a71b7[_0x9e79('0x5b')]=_0x20f965;}else if(_0x35427f&&_0x35427f[_0x9e79('0x5c')]&&_0x35427f[_0x9e79('0x5c')]!==_0x9e79('0x5d')){logger[_0x9e79('0x22')](_0x9e79('0x5e'),'Recording\x20is\x20enabled!');_0x1a71b7[_0x9e79('0x5b')]=_0x20f965;}else{_0x1a71b7[_0x9e79('0x5b')]='';}return getUser(_0x1b4513,_0x2e3a26,_0x3ba211,_0x1f31e9,_0x466b37,_0x14b89c)['then'](function(_0x14fd3d){logger[_0x9e79('0x22')]('['+_0x14b89c['toUpperCase']()+_0x9e79('0x5f'),_0x14fd3d[_0x9e79('0x26')]);logger['info']('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x60'),_0x14fd3d[_0x9e79('0x1e')]);return getEndUser(_0x14fd3d,_0x2e3a26,_0x1f31e9,_0x466b37,_0x1a71b7,_0x14b89c);})[_0x9e79('0x11')](function(_0x5e640f){logger['info']('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x61'),_0x5e640f['enduserId']);logger['info']('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x62'),_0x1a71b7['calleridnum']);return getTicket(_0x5e640f,_0x2e3a26,_0x1f31e9,_0x466b37,_0x1a71b7,_0x5e2ac7,_0x14b89c);})[_0x9e79('0x11')](function(_0x4c313e){logger['info'](util[_0x9e79('0x4b')]('['+_0x14b89c[_0x9e79('0x15')]()+_0x9e79('0x63'),_0x5e2ac7['ticketType'],_0x4c313e[_0x9e79('0x4a')]));logger[_0x9e79('0x22')](util['format']('['+_0x14b89c[_0x9e79('0x15')]()+']\x20Call\x20direction:\x20%s',_0x14b89c));if(_0x14b89c!=='unmanaged'){logger[_0x9e79('0x22')]('['+_0x14b89c[_0x9e79('0x15')]()+']',_0x9e79('0x64'));emit(_0x2e3a26[_0x9e79('0x51')],_0x3ba211[_0x9e79('0x65')],_0x5e2ac7[_0x9e79('0x46')],_0x4c313e['ticketId']);}})[_0x9e79('0x13')](function(_0x4560f5){logger['error']('['+_0x14b89c['toUpperCase']()+_0x9e79('0x66'),util[_0x9e79('0x67')](_0x4560f5,{'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 1ca3339..5eead1d 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 _0xb5ad=['./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','POST','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','toString','base64','debug','GET','map','string','picklist','type','nameField','customField','content','includes','push','idField','variable','variableName','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','stringify','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','%s/helpdesk/tickets/%d','catch','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis'];(function(_0xe254d0,_0x139743){var _0x3c564e=function(_0x3b8e93){while(--_0x3b8e93){_0xe254d0['push'](_0xe254d0['shift']());}};_0x3c564e(++_0x139743);}(_0xb5ad,0xbb));var _0xdb5a=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0xb5ad[_0x1780f8];return _0x33a410;};'use strict';var _=require(_0xdb5a('0x0'));var rp=require(_0xdb5a('0x1'));var md5=require(_0xdb5a('0x2'));var util=require(_0xdb5a('0x3'));var Redis=require(_0xdb5a('0x4'));var intUtil=require(_0xdb5a('0x5'));var config=require(_0xdb5a('0x6'));var logger=require(_0xdb5a('0x7'))(_0xdb5a('0x8'));config[_0xdb5a('0x9')]=_[_0xdb5a('0xa')](config[_0xdb5a('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xdb5a('0xb'))(new Redis(config['redis']));var headers={'Content-Type':_0xdb5a('0xc'),'Accept':_0xdb5a('0xc')};function emit(_0x3751ec,_0x320fa6,_0x17852d){io['to'](_0x3751ec)[_0xdb5a('0xd')](_0x320fa6,_0x17852d);}function getTicket(_0x28fb5,_0x441374,_0x54fa2c,_0x4aeb4c,_0x3ffb5f){logger[_0xdb5a('0xe')](_0xdb5a('0xf'));var _0x5f600e=_[_0xdb5a('0x10')]({'responder_id':_0x441374['id'],'requester_id':_0x54fa2c['id'],'name':util[_0xdb5a('0x11')](_0xdb5a('0x12'),_0x3ffb5f[_0xdb5a('0x13')]),'phone':_0x3ffb5f['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdb5a('0x14')](_0x4aeb4c[_0xdb5a('0x15')],_0x3ffb5f,'\x20'),'description':intUtil[_0xdb5a('0x14')](_0x4aeb4c[_0xdb5a('0x16')],_0x3ffb5f,_0xdb5a('0x17')),'tags':getTags(_0x4aeb4c[_0xdb5a('0x18')],_0xdb5a('0x19'))},getCustomFields(_0x4aeb4c[_0xdb5a('0x1a')],_0x3ffb5f));_0x5f600e[_0xdb5a('0x1b')]=_[_0xdb5a('0x1c')](_[_0xdb5a('0x1d')](_0x5f600e[_0xdb5a('0x1b')],'id'),'value');return request({'uri':util[_0xdb5a('0x11')](_0xdb5a('0x1e'),_0x28fb5['remoteUri']),'method':_0xdb5a('0x1f'),'body':_0x5f600e})[_0xdb5a('0x20')](function(_0x338323){logger[_0xdb5a('0xe')](_0xdb5a('0x21'));return _0x338323;});}function getUser(_0x2a5f98,_0x2ea8e0){if(intUtil['validateEmail'](_0x2ea8e0)){return request({'uri':util[_0xdb5a('0x11')](_0xdb5a('0x22'),_0x2a5f98[_0xdb5a('0x23')]),'qs':{'email':_0x2ea8e0}})['then'](function(_0x2a6dd7){if(_0x2a6dd7[_0xdb5a('0x24')]){logger[_0xdb5a('0xe')](_0xdb5a('0x25'));return _[_0xdb5a('0x26')](_0x2a6dd7,function(_0x2fb061){return _0x2fb061[_0xdb5a('0x27')][_0xdb5a('0x28')]===_0x2ea8e0;});}else{logger[_0xdb5a('0xe')](_0xdb5a('0x29'));return request({'uri':util['format'](_0xdb5a('0x2a'),_0x2a5f98[_0xdb5a('0x23')])})[_0xdb5a('0x20')](function(_0x1603c0){logger['info'](_0xdb5a('0x2b'));return _0x1603c0;});}});}else{logger[_0xdb5a('0xe')](_0xdb5a('0x2c'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x2a5f98[_0xdb5a('0x23')])})[_0xdb5a('0x20')](function(_0xcedf8b){logger['info'](_0xdb5a('0x2b'));return _0xcedf8b;});}}function getEndUser(_0x199691,_0x25a717,_0x585f04){logger[_0xdb5a('0xe')](_0xdb5a('0x2d'),_0x585f04);return request({'uri':util['format']('%s/api/v2/contacts',_0x199691[_0xdb5a('0x23')]),'qs':{'phone':_0x585f04}})['then'](function(_0x7d374d){if(_0x7d374d['length']){logger[_0xdb5a('0xe')](_0xdb5a('0x2e'));return _[_0xdb5a('0x26')](_0x7d374d,{'phone':_0x585f04});}else{logger[_0xdb5a('0xe')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xdb5a('0x11')](_0xdb5a('0x2f'),_0x199691[_0xdb5a('0x23')]),'method':'POST','body':{'name':_0x25a717,'phone':_0x585f04}})[_0xdb5a('0x20')](function(_0xa83319){logger['info'](_0xdb5a('0x30'));return _0xa83319;});}});}function getAuth(_0x34b538){return util[_0xdb5a('0x11')](_0xdb5a('0x31'),new Buffer(_0x34b538['apiKey']+':X')[_0xdb5a('0x32')](_0xdb5a('0x33')));}function request(_0x55f189){logger[_0xdb5a('0x34')]('[HTTP]',JSON['stringify'](_0x55f189));return rp(_['defaults'](_0x55f189,{'method':_0xdb5a('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x3a0507,_0x427a64){var _0x35b1de=[];if(_0x3a0507&&_0x3a0507['length']>0x0){_0x35b1de=_[_0xdb5a('0x36')](_0x3a0507,_0x427a64);}return _0x35b1de;}function getCustomFields(_0x938200,_0xee2f37){var _0x3a7569=[];var _0x1dcae7={'custom_fields':[]};if(_0x938200[_0xdb5a('0x24')]>0x0){_['forEach'](_0x938200,function(_0xacbf65){if(_['includes']([_0xdb5a('0x37'),_0xdb5a('0x38')],_0xacbf65[_0xdb5a('0x39')])&&_0xacbf65[_0xdb5a('0x3a')]&&!_0xacbf65[_0xdb5a('0x3b')]){_0x1dcae7[_0xacbf65[_0xdb5a('0x3a')]['toLowerCase']()]=_0xacbf65[_0xdb5a('0x3c')][_0xdb5a('0x32')]();}else if(_[_0xdb5a('0x3d')]([_0xdb5a('0x37'),_0xdb5a('0x38')],_0xacbf65[_0xdb5a('0x39')])&&_0xacbf65['idField']&&_0xacbf65[_0xdb5a('0x3b')]){_0x1dcae7[_0xdb5a('0x1b')][_0xdb5a('0x3e')]({'id':_0xacbf65[_0xdb5a('0x3f')],'value':_0xacbf65[_0xdb5a('0x3c')]['toString']()});}else if(_0xacbf65['type']===_0xdb5a('0x40')&&_0xacbf65[_0xdb5a('0x41')]&&_0xacbf65[_0xdb5a('0x3f')]&&_0xacbf65[_0xdb5a('0x3b')]){_0xee2f37[_0xacbf65[_0xdb5a('0x41')]]&&_0x1dcae7[_0xdb5a('0x1b')]['push']({'id':_0xacbf65[_0xdb5a('0x3f')],'value':_0xee2f37[_0xacbf65['variableName']][_0xdb5a('0x32')]()});}else if(_0xacbf65[_0xdb5a('0x39')]===_0xdb5a('0x42')&&_0xacbf65['Variable']&&_0xacbf65[_0xdb5a('0x43')][_0xdb5a('0x19')]&&_0xacbf65[_0xdb5a('0x3f')]&&_0xacbf65[_0xdb5a('0x3b')]){_0xee2f37[_0xacbf65[_0xdb5a('0x43')][_0xdb5a('0x19')][_0xdb5a('0x44')]()]&&_0x1dcae7[_0xdb5a('0x1b')][_0xdb5a('0x3e')]({'id':_0xacbf65[_0xdb5a('0x3f')],'value':_0xee2f37[_0xacbf65[_0xdb5a('0x43')][_0xdb5a('0x19')][_0xdb5a('0x44')]()]['toString']()});}});}return _0x1dcae7;}exports['queue']=function(_0x14ec17,_0x2866e5,_0x1c1101,_0x37015d,_0x3f5b19,_0x287df3){var _0x414d7e,_0x1b777b;_0x287df3[_0xdb5a('0x23')]=intUtil[_0xdb5a('0x45')](_0x287df3[_0xdb5a('0x23')]);_0x287df3['serverUrl']=intUtil[_0xdb5a('0x45')](_0x287df3[_0xdb5a('0x46')]);if(_0x3f5b19&&_0x3f5b19[_0xdb5a('0x47')]){logger['info']('[QUEUE]',_0xdb5a('0x48'));_0x2866e5[_0xdb5a('0x49')]=util['format'](_0xdb5a('0x4a'),_0x287df3['serverUrl'],_0x2866e5['uniqueid'],md5(_0x2866e5['uniqueid']));}else{_0x2866e5[_0xdb5a('0x49')]='';}headers[_0xdb5a('0x4b')]=getAuth(_0x287df3);return getUser(_0x287df3,_0x37015d['email'])[_0xdb5a('0x20')](function(_0x5d1eb4){_0x414d7e=_0x5d1eb4;logger['info'](_0xdb5a('0x4c'),_0x414d7e['id']);return getEndUser(_0x287df3,_0x2866e5[_0xdb5a('0x13')],_0x2866e5[_0xdb5a('0x4d')]);})['then'](function(_0x1e113d){_0x1b777b=_0x1e113d;logger['info'](_0xdb5a('0x4e'),_0x1b777b['id']);return getTicket(_0x287df3,_0x414d7e,_0x1b777b,_0x1c1101,_0x2866e5);})[_0xdb5a('0x20')](function(_0x76bac4){if(_0x76bac4&&_0x76bac4['id']){logger[_0xdb5a('0xe')](_0xdb5a('0x21'));logger[_0xdb5a('0xe')](_0xdb5a('0x4f'),_0x76bac4['id']);logger[_0xdb5a('0xe')](_0xdb5a('0x50'),_0xdb5a('0x51'));emit(util[_0xdb5a('0x11')](_0xdb5a('0x52'),_0x37015d[_0xdb5a('0x19')]),_0xdb5a('0x53'),{'uri':util[_0xdb5a('0x11')]('%s/helpdesk/tickets/%d',_0x287df3['remoteUri'],_0x76bac4['id'])});}})['catch'](function(_0x13dea4){logger[_0xdb5a('0x54')](_0xdb5a('0x50'),JSON[_0xdb5a('0x55')](_0x13dea4));});};exports['outbound']=function(_0x1c22a3,_0x3b016b,_0x1f4199,_0x47f9aa,_0x3a0576,_0x3dfa18,_0x4a8f68){var _0x1eefc0,_0x495333;_0x3dfa18[_0xdb5a('0x23')]=intUtil['stripTrailingSlash'](_0x3dfa18[_0xdb5a('0x23')]);_0x3dfa18[_0xdb5a('0x46')]=intUtil[_0xdb5a('0x45')](_0x3dfa18[_0xdb5a('0x46')]);if(_0x4a8f68&&_0x4a8f68['recordingFormat']&&_0x4a8f68[_0xdb5a('0x56')]!==_0xdb5a('0x57')){logger[_0xdb5a('0xe')](_0xdb5a('0x58'),'Recording\x20is\x20enabled!');_0x3b016b['recordingURL']=util[_0xdb5a('0x11')](_0xdb5a('0x4a'),_0x3dfa18[_0xdb5a('0x46')],_0x3b016b[_0xdb5a('0x59')],md5(_0x3b016b[_0xdb5a('0x59')]));}headers[_0xdb5a('0x4b')]=getAuth(_0x3dfa18);return getUser(_0x3dfa18,_0x47f9aa['email'])[_0xdb5a('0x20')](function(_0x52ff3c){_0x1eefc0=_0x52ff3c;logger['info'](_0xdb5a('0x4c'),_0x1eefc0['id']);return getEndUser(_0x3dfa18,_0x3b016b[_0xdb5a('0x5a')],_0x3b016b[_0xdb5a('0x5b')]);})[_0xdb5a('0x20')](function(_0x54c145){_0x495333=_0x54c145;logger[_0xdb5a('0xe')](_0xdb5a('0x4e'),_0x495333['id']);return getTicket(_0x3dfa18,_0x1eefc0,_0x495333,_0x1f4199,_0x3b016b);})['then'](function(_0x2a2d9b){if(_0x2a2d9b&&_0x2a2d9b['id']){logger['info'](_0xdb5a('0x21'));logger[_0xdb5a('0xe')](_0xdb5a('0x4f'),_0x2a2d9b['id']);logger[_0xdb5a('0xe')]('[OUTBOUND]',_0xdb5a('0x51'));emit(util['format'](_0xdb5a('0x52'),_0x47f9aa[_0xdb5a('0x19')]),_0xdb5a('0x53'),{'uri':util['format'](_0xdb5a('0x5c'),_0x3dfa18[_0xdb5a('0x23')],_0x2a2d9b['id'])});}})[_0xdb5a('0x5d')](function(_0x2a4bb6){logger[_0xdb5a('0x54')](_0xdb5a('0x58'),JSON[_0xdb5a('0x55')](_0x2a4bb6));});};exports['unmanaged']=function(_0x59e94c,_0x437406,_0x1f9069,_0xcb9841,_0x3311c8,_0x32f64f){var _0x1cea92,_0x2c50e9;_0x32f64f[_0xdb5a('0x23')]=intUtil[_0xdb5a('0x45')](_0x32f64f[_0xdb5a('0x23')]);_0x32f64f[_0xdb5a('0x46')]=intUtil[_0xdb5a('0x45')](_0x32f64f[_0xdb5a('0x46')]);if(_0x3311c8&&_0x3311c8['monitor_format']){logger['info']('['+_0x437406[_0xdb5a('0x5e')]['toUpperCase']()+']',_0xdb5a('0x48'));_0x437406[_0xdb5a('0x49')]=util[_0xdb5a('0x11')](_0xdb5a('0x4a'),_0x32f64f[_0xdb5a('0x46')],_0x437406[_0xdb5a('0x59')],md5(_0x437406['uniqueid']));}else{_0x437406[_0xdb5a('0x49')]='';}headers['Authorization']=getAuth(_0x32f64f);return getUser(_0x32f64f,'')[_0xdb5a('0x20')](function(_0x530842){_0x1cea92=_0x530842;logger['info'](_0xdb5a('0x4c'),_0x1cea92['id']);return getEndUser(_0x32f64f,_0x437406[_0xdb5a('0x13')],_0x437406[_0xdb5a('0x4d')]);})[_0xdb5a('0x20')](function(_0x27c08c){_0x2c50e9=_0x27c08c;logger['info'](_0xdb5a('0x4e'),_0x2c50e9['id']);return getTicket(_0x32f64f,_0x1cea92,_0x2c50e9,_0x1f9069,_0x437406);})[_0xdb5a('0x20')](function(_0x2867ac){if(_0x2867ac){logger['info'](_0xdb5a('0x21'));logger[_0xdb5a('0xe')](_0xdb5a('0x4f'),_0x2867ac['id']);}})[_0xdb5a('0x5d')](function(_0x415c96){logger[_0xdb5a('0x54')]('['+_0x437406[_0xdb5a('0x5e')][_0xdb5a('0x5f')]()+']',JSON['stringify'](_0x415c96));});}; \ No newline at end of file +var _0xf831=['forEach','includes','string','type','customField','nameField','toLowerCase','content','picklist','idField','push','variable','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','catch','monitor_format','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','request-promise','md5','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','then','info','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map'];(function(_0xf428de,_0x2c619a){var _0x193e25=function(_0x2934f2){while(--_0x2934f2){_0xf428de['push'](_0xf428de['shift']());}};_0x193e25(++_0x2c619a);}(_0xf831,0x89));var _0x1f83=function(_0x5a8d0d,_0x3ed8aa){_0x5a8d0d=_0x5a8d0d-0x0;var _0xedf21f=_0xf831[_0x5a8d0d];return _0xedf21f;};'use strict';var _=require('lodash');var rp=require(_0x1f83('0x0'));var md5=require(_0x1f83('0x1'));var util=require(_0x1f83('0x2'));var Redis=require(_0x1f83('0x3'));var intUtil=require('./util');var config=require(_0x1f83('0x4'));var logger=require('../../../../config/logger')('freshdesk');config[_0x1f83('0x5')]=_[_0x1f83('0x6')](config[_0x1f83('0x5')],{'host':_0x1f83('0x7'),'port':0x18eb});var io=require(_0x1f83('0x8'))(new Redis(config['redis']));var headers={'Content-Type':_0x1f83('0x9'),'Accept':'application/json'};function emit(_0x5ccc58,_0x526ed2,_0x2cb258){io['to'](_0x5ccc58)[_0x1f83('0xa')](_0x526ed2,_0x2cb258);}function getTicket(_0xf6d404,_0x113968,_0x32f2cf,_0x30f251,_0x1c6d87){logger['info'](_0x1f83('0xb'));var _0x417788=_[_0x1f83('0xc')]({'responder_id':_0x113968['id'],'requester_id':_0x32f2cf['id'],'name':util[_0x1f83('0xd')]('Caller\x20-\x20%s',_0x1c6d87[_0x1f83('0xe')]),'phone':_0x1c6d87[_0x1f83('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x1f83('0x10')](_0x30f251[_0x1f83('0x11')],_0x1c6d87,'\x20'),'description':intUtil[_0x1f83('0x10')](_0x30f251[_0x1f83('0x12')],_0x1c6d87,_0x1f83('0x13')),'tags':getTags(_0x30f251['Tags'],_0x1f83('0x14'))},getCustomFields(_0x30f251[_0x1f83('0x15')],_0x1c6d87));_0x417788[_0x1f83('0x16')]=_[_0x1f83('0x17')](_[_0x1f83('0x18')](_0x417788[_0x1f83('0x16')],'id'),_0x1f83('0x19'));return request({'uri':util['format'](_0x1f83('0x1a'),_0xf6d404['remoteUri']),'method':_0x1f83('0x1b'),'body':_0x417788})[_0x1f83('0x1c')](function(_0x384898){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));return _0x384898;});}function getUser(_0x2d5020,_0x31ed7c){if(intUtil['validateEmail'](_0x31ed7c)){return request({'uri':util['format'](_0x1f83('0x1f'),_0x2d5020[_0x1f83('0x20')]),'qs':{'email':_0x31ed7c}})[_0x1f83('0x1c')](function(_0x301711){if(_0x301711[_0x1f83('0x21')]){logger[_0x1f83('0x1d')](_0x1f83('0x22'));return _[_0x1f83('0x23')](_0x301711,function(_0x2bd619){return _0x2bd619[_0x1f83('0x24')][_0x1f83('0x25')]===_0x31ed7c;});}else{logger['info'](_0x1f83('0x26'));return request({'uri':util[_0x1f83('0xd')](_0x1f83('0x27'),_0x2d5020[_0x1f83('0x20')])})[_0x1f83('0x1c')](function(_0x51897d){logger[_0x1f83('0x1d')](_0x1f83('0x28'));return _0x51897d;});}});}else{logger[_0x1f83('0x1d')](_0x1f83('0x29'));return request({'uri':util[_0x1f83('0xd')]('%s/api/v2/agents/me',_0x2d5020[_0x1f83('0x20')])})['then'](function(_0x413cad){logger['info'](_0x1f83('0x28'));return _0x413cad;});}}function getEndUser(_0x369f14,_0xb83572,_0xbba255){logger[_0x1f83('0x1d')](_0x1f83('0x2a'),_0xbba255);return request({'uri':util[_0x1f83('0xd')]('%s/api/v2/contacts',_0x369f14['remoteUri']),'qs':{'phone':_0xbba255}})[_0x1f83('0x1c')](function(_0x47cde4){if(_0x47cde4['length']){logger['info'](_0x1f83('0x2b'));return _[_0x1f83('0x23')](_0x47cde4,{'phone':_0xbba255});}else{logger[_0x1f83('0x1d')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1f83('0xd')](_0x1f83('0x2c'),_0x369f14[_0x1f83('0x20')]),'method':_0x1f83('0x1b'),'body':{'name':_0xb83572,'phone':_0xbba255}})[_0x1f83('0x1c')](function(_0x1a4542){logger['info'](_0x1f83('0x2d'));return _0x1a4542;});}});}function getAuth(_0x429dfe){return util[_0x1f83('0xd')](_0x1f83('0x2e'),new Buffer(_0x429dfe[_0x1f83('0x2f')]+':X')[_0x1f83('0x30')](_0x1f83('0x31')));}function request(_0x51a0be){logger[_0x1f83('0x32')](_0x1f83('0x33'),JSON[_0x1f83('0x34')](_0x51a0be));return rp(_[_0x1f83('0x6')](_0x51a0be,{'method':_0x1f83('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x50814b,_0x11a391){var _0x5d4bc4=[];if(_0x50814b&&_0x50814b[_0x1f83('0x21')]>0x0){_0x5d4bc4=_[_0x1f83('0x36')](_0x50814b,_0x11a391);}return _0x5d4bc4;}function getCustomFields(_0x2c95d2,_0x165e32){var _0x36d6b8=[];var _0x4f8ff4={'custom_fields':[]};if(_0x2c95d2[_0x1f83('0x21')]>0x0){_[_0x1f83('0x37')](_0x2c95d2,function(_0x5cc246){if(_[_0x1f83('0x38')]([_0x1f83('0x39'),'picklist'],_0x5cc246[_0x1f83('0x3a')])&&_0x5cc246['nameField']&&!_0x5cc246[_0x1f83('0x3b')]){_0x4f8ff4[_0x5cc246[_0x1f83('0x3c')][_0x1f83('0x3d')]()]=_0x5cc246[_0x1f83('0x3e')][_0x1f83('0x30')]();}else if(_[_0x1f83('0x38')]([_0x1f83('0x39'),_0x1f83('0x3f')],_0x5cc246[_0x1f83('0x3a')])&&_0x5cc246[_0x1f83('0x40')]&&_0x5cc246['customField']){_0x4f8ff4['custom_fields'][_0x1f83('0x41')]({'id':_0x5cc246[_0x1f83('0x40')],'value':_0x5cc246[_0x1f83('0x3e')][_0x1f83('0x30')]()});}else if(_0x5cc246[_0x1f83('0x3a')]===_0x1f83('0x42')&&_0x5cc246['variableName']&&_0x5cc246[_0x1f83('0x40')]&&_0x5cc246['customField']){_0x165e32[_0x5cc246[_0x1f83('0x43')]]&&_0x4f8ff4[_0x1f83('0x16')][_0x1f83('0x41')]({'id':_0x5cc246[_0x1f83('0x40')],'value':_0x165e32[_0x5cc246[_0x1f83('0x43')]][_0x1f83('0x30')]()});}else if(_0x5cc246[_0x1f83('0x3a')]===_0x1f83('0x44')&&_0x5cc246[_0x1f83('0x45')]&&_0x5cc246['Variable'][_0x1f83('0x14')]&&_0x5cc246[_0x1f83('0x40')]&&_0x5cc246[_0x1f83('0x3b')]){_0x165e32[_0x5cc246[_0x1f83('0x45')][_0x1f83('0x14')][_0x1f83('0x3d')]()]&&_0x4f8ff4[_0x1f83('0x16')][_0x1f83('0x41')]({'id':_0x5cc246[_0x1f83('0x40')],'value':_0x165e32[_0x5cc246[_0x1f83('0x45')][_0x1f83('0x14')][_0x1f83('0x3d')]()][_0x1f83('0x30')]()});}});}return _0x4f8ff4;}exports[_0x1f83('0x46')]=function(_0x297de1,_0x835a18,_0x2a6386,_0xd22cbe,_0x2453bd,_0x2d46ac){var _0x588281,_0x33c25f;_0x2d46ac['remoteUri']=intUtil['stripTrailingSlash'](_0x2d46ac['remoteUri']);_0x2d46ac[_0x1f83('0x47')]=intUtil[_0x1f83('0x48')](_0x2d46ac[_0x1f83('0x47')]);if(_0x2453bd&&_0x2453bd['monitor_format']){logger['info'](_0x1f83('0x49'),'Recording\x20is\x20enabled!');_0x835a18[_0x1f83('0x4a')]=util[_0x1f83('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2d46ac['serverUrl'],_0x835a18['uniqueid'],md5(_0x835a18[_0x1f83('0x4b')]));}else{_0x835a18[_0x1f83('0x4a')]='';}headers[_0x1f83('0x4c')]=getAuth(_0x2d46ac);return getUser(_0x2d46ac,_0xd22cbe[_0x1f83('0x25')])['then'](function(_0x3d3cd2){_0x588281=_0x3d3cd2;logger['info'](_0x1f83('0x4d'),_0x588281['id']);return getEndUser(_0x2d46ac,_0x835a18[_0x1f83('0xe')],_0x835a18[_0x1f83('0xf')]);})[_0x1f83('0x1c')](function(_0x3ce7b6){_0x33c25f=_0x3ce7b6;logger[_0x1f83('0x1d')](_0x1f83('0x4e'),_0x33c25f['id']);return getTicket(_0x2d46ac,_0x588281,_0x33c25f,_0x2a6386,_0x835a18);})[_0x1f83('0x1c')](function(_0x193b10){if(_0x193b10&&_0x193b10['id']){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));logger[_0x1f83('0x1d')](_0x1f83('0x4f'),_0x193b10['id']);logger[_0x1f83('0x1d')](_0x1f83('0x49'),_0x1f83('0x50'));emit(util[_0x1f83('0xd')](_0x1f83('0x51'),_0xd22cbe[_0x1f83('0x14')]),_0x1f83('0x52'),{'uri':util[_0x1f83('0xd')](_0x1f83('0x53'),_0x2d46ac[_0x1f83('0x20')],_0x193b10['id'])});}})['catch'](function(_0x1b02db){logger[_0x1f83('0x54')](_0x1f83('0x49'),JSON['stringify'](_0x1b02db));});};exports['outbound']=function(_0x3f7b98,_0xb35c49,_0x50e532,_0xa96788,_0x3b30ee,_0x356f76,_0x2a6768){var _0x18e3fb,_0x526741;_0x356f76[_0x1f83('0x20')]=intUtil[_0x1f83('0x48')](_0x356f76[_0x1f83('0x20')]);_0x356f76[_0x1f83('0x47')]=intUtil[_0x1f83('0x48')](_0x356f76['serverUrl']);if(_0x2a6768&&_0x2a6768[_0x1f83('0x55')]&&_0x2a6768[_0x1f83('0x55')]!==_0x1f83('0x56')){logger[_0x1f83('0x1d')](_0x1f83('0x57'),_0x1f83('0x58'));_0xb35c49[_0x1f83('0x4a')]=util[_0x1f83('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x356f76[_0x1f83('0x47')],_0xb35c49[_0x1f83('0x4b')],md5(_0xb35c49['uniqueid']));}headers['Authorization']=getAuth(_0x356f76);return getUser(_0x356f76,_0xa96788[_0x1f83('0x25')])[_0x1f83('0x1c')](function(_0x4aab33){_0x18e3fb=_0x4aab33;logger['info'](_0x1f83('0x4d'),_0x18e3fb['id']);return getEndUser(_0x356f76,_0xb35c49[_0x1f83('0x59')],_0xb35c49[_0x1f83('0x5a')]);})[_0x1f83('0x1c')](function(_0x374868){_0x526741=_0x374868;logger['info'](_0x1f83('0x4e'),_0x526741['id']);return getTicket(_0x356f76,_0x18e3fb,_0x526741,_0x50e532,_0xb35c49);})[_0x1f83('0x1c')](function(_0x27ddc2){if(_0x27ddc2&&_0x27ddc2['id']){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));logger[_0x1f83('0x1d')](_0x1f83('0x4f'),_0x27ddc2['id']);logger[_0x1f83('0x1d')](_0x1f83('0x57'),_0x1f83('0x50'));emit(util[_0x1f83('0xd')]('user:%s',_0xa96788['name']),'trigger:browser:url',{'uri':util[_0x1f83('0xd')]('%s/helpdesk/tickets/%d',_0x356f76[_0x1f83('0x20')],_0x27ddc2['id'])});}})[_0x1f83('0x5b')](function(_0x56987f){logger['error'](_0x1f83('0x57'),JSON[_0x1f83('0x34')](_0x56987f));});};exports['unmanaged']=function(_0x5916b2,_0x42b285,_0xdccb5c,_0x53458f,_0x32427b,_0x2b7ce2){var _0x519f26,_0x4b6a45;_0x2b7ce2['remoteUri']=intUtil[_0x1f83('0x48')](_0x2b7ce2[_0x1f83('0x20')]);_0x2b7ce2['serverUrl']=intUtil[_0x1f83('0x48')](_0x2b7ce2[_0x1f83('0x47')]);if(_0x32427b&&_0x32427b[_0x1f83('0x5c')]){logger[_0x1f83('0x1d')]('['+_0x42b285[_0x1f83('0x5d')][_0x1f83('0x5e')]()+']',_0x1f83('0x58'));_0x42b285[_0x1f83('0x4a')]=util[_0x1f83('0xd')](_0x1f83('0x5f'),_0x2b7ce2[_0x1f83('0x47')],_0x42b285[_0x1f83('0x4b')],md5(_0x42b285[_0x1f83('0x4b')]));}else{_0x42b285[_0x1f83('0x4a')]='';}headers[_0x1f83('0x4c')]=getAuth(_0x2b7ce2);return getUser(_0x2b7ce2,'')[_0x1f83('0x1c')](function(_0x1a8730){_0x519f26=_0x1a8730;logger[_0x1f83('0x1d')](_0x1f83('0x4d'),_0x519f26['id']);return getEndUser(_0x2b7ce2,_0x42b285[_0x1f83('0xe')],_0x42b285['calleridnum']);})[_0x1f83('0x1c')](function(_0x8ee51c){_0x4b6a45=_0x8ee51c;logger[_0x1f83('0x1d')](_0x1f83('0x4e'),_0x4b6a45['id']);return getTicket(_0x2b7ce2,_0x519f26,_0x4b6a45,_0xdccb5c,_0x42b285);})[_0x1f83('0x1c')](function(_0x3f6209){if(_0x3f6209){logger[_0x1f83('0x1d')](_0x1f83('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3f6209['id']);}})[_0x1f83('0x5b')](function(_0x2488c3){logger[_0x1f83('0x54')]('['+_0x42b285[_0x1f83('0x5d')][_0x1f83('0x5e')]()+']',JSON[_0x1f83('0x34')](_0x2488c3));});}; \ 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 cb87626..ac1389b 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 _0x99fd=['none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','lodash','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','Admin\x20selected','message','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','ticketId','task','Task\x20created:','user:%s','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat'];(function(_0x4f1672,_0x11dc60){var _0xea01af=function(_0x1cc05b){while(--_0x1cc05b){_0x4f1672['push'](_0x4f1672['shift']());}};_0xea01af(++_0x11dc60);}(_0x99fd,0xa6));var _0xd99f=function(_0x568938,_0x40fa95){_0x568938=_0x568938-0x0;var _0x228587=_0x99fd[_0x568938];return _0x228587;};'use strict';var _=require(_0xd99f('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xd99f('0x1'));var moment=require(_0xd99f('0x2'));var Promise=require(_0xd99f('0x3'));var Redis=require(_0xd99f('0x4'));var intUtil=require(_0xd99f('0x5'));var config=require('../../../../config/environment');var logger=require(_0xd99f('0x6'))(_0xd99f('0x7'));config[_0xd99f('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd99f('0x9'))(new Redis(config[_0xd99f('0x8')]));function getAdminId(_0x49020b,_0x58aa0d,_0x2e7865,_0x1dd3ae){return new Promise(function(_0x1649b0,_0x430b4e){var _0x21b802=![];var _0x3f71ab={'method':_0xd99f('0xa'),'uri':_0x1dd3ae+_0xd99f('0xb'),'json':!![]};_0x3f71ab[_0xd99f('0xc')]=_0x2e7865;logger[_0xd99f('0xd')](_0xd99f('0xe'));return rp(_0x3f71ab)[_0xd99f('0xf')](function(_0xadc7c){if(_0xadc7c){var _0x54c5de=_0xadc7c[_0xd99f('0x10')];var _0x476e55=null;for(_0x476e55=0x0;_0x476e55<_0x54c5de['length'];_0x476e55++){if(_0x54c5de[_0x476e55][_0xd99f('0x11')]===_0x49020b[_0xd99f('0x12')]){_0x49020b[_0xd99f('0x13')]=_0x54c5de[_0x476e55]['id'];_0x21b802=!![];}}if(_0x21b802){logger['info'](_0xd99f('0x14'),_0x49020b[_0xd99f('0x13')]);_0x1649b0(_0x49020b);}else{_0x430b4e({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x430b4e({'statusCode':0x194,'message':_0xd99f('0x15')});}})[_0xd99f('0x16')](function(_0x17cb6b){logger[_0xd99f('0x17')]('['+[_0x58aa0d[_0xd99f('0x18')]()]+']',_0x17cb6b['message']);_0x430b4e(_0x17cb6b);});});}function getUser(_0x5766ac,_0x21dcbc,_0x53c5c2){return function(_0x1ed01e){return new Promise(function(_0x596245,_0x2e45f6){var _0x4218a5={'method':_0xd99f('0xa'),'uri':_0x53c5c2+_0xd99f('0xb'),'json':!![]};_0x4218a5[_0xd99f('0xc')]=_0x21dcbc;logger[_0xd99f('0xd')](_0xd99f('0x19'));return rp(_0x4218a5)[_0xd99f('0xf')](function(_0x4f88c8){if(_0x4f88c8){var _0x2f2099=_0x4f88c8['users'];var _0xe73e10=![];var _0x4fb587=null;if(_0x1ed01e[_0xd99f('0x1a')]!==null){logger[_0xd99f('0xd')](_0xd99f('0x1b'),_0x1ed01e['agentEmail']);_0x1ed01e[_0xd99f('0x1c')]=_0x1ed01e['agentEmail'];for(_0x4fb587=0x0;_0x4fb587<_0x2f2099[_0xd99f('0x1d')];_0x4fb587++){if(_0x2f2099[_0x4fb587][_0xd99f('0x11')]===_0x1ed01e[_0xd99f('0x1a')]){_0xe73e10=!![];_0x1ed01e[_0xd99f('0x1e')]=_0x2f2099[_0x4fb587]['id'];logger['info']('User\x20found:',_0x1ed01e[_0xd99f('0x1e')]);}}}if(!_0xe73e10){logger[_0xd99f('0xd')](_0xd99f('0x1f'));_0x1ed01e[_0xd99f('0x1c')]=_0x1ed01e[_0xd99f('0x12')];_0x1ed01e[_0xd99f('0x1e')]=_0x1ed01e[_0xd99f('0x13')];_0xe73e10=!![];}if(_0xe73e10){_0x596245(_0x1ed01e);}else{_0x2e45f6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x2e45f6({'statusCode':0x194,'message':_0xd99f('0x15')});}})[_0xd99f('0x16')](function(_0x42ee42){logger[_0xd99f('0x17')]('['+[_0x5766ac[_0xd99f('0x18')]()]+']',_0x42ee42[_0xd99f('0x20')]);_0x2e45f6(_0x42ee42);});});};}function searchContact(_0x3f7183,_0x54629a,_0x4394ec,_0x379b0d){return new Promise(function(_0x1d076f,_0x6ea56b){var _0x5f38ac={'method':'GET','headers':_0x54629a,'uri':_0x3f7183+'/api/lookup?q='+_0x379b0d+_0xd99f('0x21')+_0x4394ec+'&entities=contact','json':!![]};rp(_0x5f38ac)[_0xd99f('0xf')](function(_0x1e477a){var _0x1ec649=_[_0xd99f('0x22')](_0x1e477a[_0xd99f('0x23')][_0xd99f('0x23')],[_0x4394ec,_0x379b0d]);_0x1d076f(_0x1ec649);})['catch'](function(_0x3df3f6){_0x6ea56b(_0x3df3f6);});});}function getEndUser(_0x11db34,_0x39b03d,_0x2aeccb){return function(_0x22d9f8){return new Promise(function(_0x149aea,_0x2140ca){logger[_0xd99f('0xd')](util[_0xd99f('0x24')](_0xd99f('0x25'),_0x22d9f8[_0xd99f('0x26')]));searchContact(_0x2aeccb,_0x39b03d,_0xd99f('0x27'),_0x22d9f8[_0xd99f('0x26')])[_0xd99f('0xf')](function(_0x16c61c){if(_0x16c61c){_0x22d9f8[_0xd99f('0x28')]=_0x16c61c['id'];logger['info'](_0xd99f('0x29'),_0x22d9f8[_0xd99f('0x28')]);return _0x149aea(_0x22d9f8);}searchContact(_0x2aeccb,_0x39b03d,_0xd99f('0x2a'),_0x22d9f8[_0xd99f('0x26')])[_0xd99f('0xf')](function(_0x1297e0){if(_0x1297e0){_0x22d9f8[_0xd99f('0x28')]=_0x1297e0['id'];logger[_0xd99f('0xd')](_0xd99f('0x2b'),_0x22d9f8['endUserId']);return _0x149aea(_0x22d9f8);}createEndUser(_0x22d9f8,_0x11db34,_0x39b03d,_0x2aeccb)[_0xd99f('0xf')](function(_0xfc236e){logger[_0xd99f('0xd')]('Contact\x20created:',_0xfc236e[_0xd99f('0x28')]);return _0x149aea(_0xfc236e);});});})[_0xd99f('0x16')](function(_0x226a0e){_0x2140ca(_0x226a0e);});});};}function createEndUser(_0x3dcb31,_0xe7fe92,_0x4713ff,_0x36a4ea){return new Promise(function(_0x2146ff,_0x14cc3e){var _0x93f8ec=moment();var _0x21e493={'method':_0xd99f('0x2c'),'uri':_0x36a4ea+_0xd99f('0x2d'),'body':{'contact':{'last_name':_0x3dcb31[_0xd99f('0x26')],'work_number':_0x3dcb31['contactNumber'],'mobile_number':_0x3dcb31['contactNumber'],'owner_id':_0x3dcb31[_0xd99f('0x1e')],'created_at':_0x93f8ec['format'](_0xd99f('0x2e'))}},'json':!![]};_0x21e493[_0xd99f('0xc')]=_0x4713ff;logger['info'](_0xd99f('0x2f'));return rp(_0x21e493)['then'](function(_0x50eac0){_0x3dcb31[_0xd99f('0x28')]=_0x50eac0[_0xd99f('0x30')]['id'];_0x2146ff(_0x3dcb31);})['catch'](function(_0x5b9adf){logger[_0xd99f('0x17')]('['+[_0xe7fe92[_0xd99f('0x18')]()]+']',_0x5b9adf[_0xd99f('0x20')]);_0x14cc3e(_0x5b9adf[_0xd99f('0x20')]);});});}function getTicket(_0x111b59,_0x425d3f,_0x147064,_0x311737,_0x476785){return function(_0x2546ed){logger[_0xd99f('0xd')](_0xd99f('0x31'));return new Promise(function(_0x5ca9fc,_0x20d586){var _0x13af53=moment();var _0x373871={'method':'POST','uri':_0x147064+_0xd99f('0x32'),'body':{'title':intUtil[_0xd99f('0x33')](_0x311737[_0xd99f('0x34')],_0x476785,'\x20'),'description':intUtil['getString'](_0x311737[_0xd99f('0x35')],_0x476785,'\x0a'),'owner_id':_0x2546ed[_0xd99f('0x1e')],'creater_id':_0x2546ed[_0xd99f('0x13')],'targetable_id':_0x2546ed['endUserId'],'targetable_type':'Contact','created_at':_0x13af53[_0xd99f('0x24')](_0xd99f('0x2e')),'due_date':_0x13af53['add'](0x1e,'m')[_0xd99f('0x24')](_0xd99f('0x2e'))},'json':!![]};_0x373871[_0xd99f('0xc')]=_0x425d3f;return rp(_0x373871)['then'](function(_0xcb4860){_0x2546ed[_0xd99f('0x36')]=_0xcb4860[_0xd99f('0x37')]['id'];logger[_0xd99f('0xd')](_0xd99f('0x38'),_0x2546ed[_0xd99f('0x36')]);_0x5ca9fc(_0x2546ed);})['catch'](function(_0x37b6f7){logger[_0xd99f('0x17')]('['+[_0x111b59[_0xd99f('0x18')]()]+']',_0x37b6f7[_0xd99f('0x20')]);_0x20d586(_0x37b6f7[_0xd99f('0x20')]);});});};}function emit(_0x4f3726,_0xdec0fb,_0xaaa062){var _0x4ecc50={'uri':_0x4f3726+'/contacts/'+_0xaaa062};io['to'](util['format'](_0xd99f('0x39'),_0xdec0fb))['emit'](_0xd99f('0x3a'),_0x4ecc50);}exports['cs']=function(_0x18bc2b,_0x51c55a,_0x3aa98d,_0x3d80b8,_0x18ca34,_0x1828ba,_0x10cdef,_0x552db7){var _0x590533={};var _0x424be4={'Authorization':_0xd99f('0x3b')+_0x1828ba[_0xd99f('0x3c')]};_0x1828ba['remoteUri']=intUtil[_0xd99f('0x3d')](_0x1828ba['remoteUri']);_0x1828ba['serverUrl']=intUtil[_0xd99f('0x3d')](_0x1828ba[_0xd99f('0x3e')]);var _0x25fab6=_0x1828ba[_0xd99f('0x3f')];_0x590533['adminEmail']=_0x1828ba[_0xd99f('0x40')];_0x590533[_0xd99f('0x26')]=_0x552db7[_0xd99f('0x41')]()==='outbound'?_0x51c55a[_0xd99f('0x42')]:_0x51c55a['calleridnum'];_0x590533[_0xd99f('0x43')]=_0x552db7===_0xd99f('0x44')||_0x552db7===_0xd99f('0x45')?_0xd99f('0x44'):_0xd99f('0x46');if(_0x3d80b8){_0x590533[_0xd99f('0x1a')]=_0x3d80b8['email'];}var _0x30ed0a=util[_0xd99f('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1828ba[_0xd99f('0x3e')],_0x51c55a['uniqueid'],md5(_0x51c55a[_0xd99f('0x47')]));if(_0x18ca34&&_0x18ca34[_0xd99f('0x48')]){logger[_0xd99f('0xd')](_0xd99f('0x49'),_0xd99f('0x4a'));_0x51c55a[_0xd99f('0x4b')]=_0x30ed0a;}else if(_0x10cdef&&_0x10cdef[_0xd99f('0x4c')]&&_0x10cdef[_0xd99f('0x4c')]!==_0xd99f('0x4d')){logger[_0xd99f('0xd')](_0xd99f('0x4e'),_0xd99f('0x4a'));_0x51c55a[_0xd99f('0x4b')]=_0x30ed0a;}else{_0x51c55a[_0xd99f('0x4b')]='';}return getAdminId(_0x590533,_0x552db7,_0x424be4,_0x25fab6)[_0xd99f('0xf')](getUser(_0x552db7,_0x424be4,_0x25fab6))['then'](getEndUser(_0x552db7,_0x424be4,_0x25fab6))[_0xd99f('0xf')](getTicket(_0x552db7,_0x424be4,_0x25fab6,_0x3aa98d,_0x51c55a))[_0xd99f('0xf')](function(_0x2659e6){logger[_0xd99f('0xd')](util[_0xd99f('0x24')](_0xd99f('0x4f'),_0x2659e6['ticketId']));if(_0x552db7!=='unmanaged'){logger[_0xd99f('0xd')]('['+[_0x552db7[_0xd99f('0x18')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x25fab6,_0x3d80b8['name'],_0x2659e6[_0xd99f('0x28')]);}})[_0xd99f('0x16')](function(_0x41fafa){logger['error']('['+[_0x552db7[_0xd99f('0x18')]()]+_0xd99f('0x50'),util['inspect'](_0x41fafa,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd0e1=['../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','toUpperCase','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','User\x20found:','userId','Admin\x20selected','userEmail','catch','message','&entities=contact','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','destcalleridnum','calleridnum','unmanaged','outbound','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','md5','util','moment','ioredis','./util','../../../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd0e1,0xa2));var _0x1d0e=function(_0x3967fc,_0x353ab6){_0x3967fc=_0x3967fc-0x0;var _0x5d332c=_0xd0e1[_0x3967fc];return _0x5d332c;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x1d0e('0x0'));var util=require(_0x1d0e('0x1'));var moment=require(_0x1d0e('0x2'));var Promise=require('bluebird');var Redis=require(_0x1d0e('0x3'));var intUtil=require(_0x1d0e('0x4'));var config=require(_0x1d0e('0x5'));var logger=require(_0x1d0e('0x6'))(_0x1d0e('0x7'));config[_0x1d0e('0x8')]=_[_0x1d0e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x1d0e('0xa'))(new Redis(config[_0x1d0e('0x8')]));function getAdminId(_0x330620,_0x1ca306,_0x300ca9,_0x100b74){return new Promise(function(_0x12566d,_0x28a0af){var _0x17ec4b=![];var _0x95e0a0={'method':_0x1d0e('0xb'),'uri':_0x100b74+_0x1d0e('0xc'),'json':!![]};_0x95e0a0[_0x1d0e('0xd')]=_0x300ca9;logger['info'](_0x1d0e('0xe'));return rp(_0x95e0a0)[_0x1d0e('0xf')](function(_0x1ee778){if(_0x1ee778){var _0x239b41=_0x1ee778[_0x1d0e('0x10')];var _0x596b47=null;for(_0x596b47=0x0;_0x596b47<_0x239b41[_0x1d0e('0x11')];_0x596b47++){if(_0x239b41[_0x596b47][_0x1d0e('0x12')]===_0x330620[_0x1d0e('0x13')]){_0x330620[_0x1d0e('0x14')]=_0x239b41[_0x596b47]['id'];_0x17ec4b=!![];}}if(_0x17ec4b){logger[_0x1d0e('0x15')](_0x1d0e('0x16'),_0x330620['adminId']);_0x12566d(_0x330620);}else{_0x28a0af({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x28a0af({'statusCode':0x194,'message':_0x1d0e('0x17')});}})['catch'](function(_0x8cf990){logger[_0x1d0e('0x18')]('['+[_0x1ca306[_0x1d0e('0x19')]()]+']',_0x8cf990['message']);_0x28a0af(_0x8cf990);});});}function getUser(_0x35234b,_0x21d586,_0x2db338){return function(_0x400c4c){return new Promise(function(_0x5bd7af,_0xb11ff6){var _0x38e47d={'method':'GET','uri':_0x2db338+_0x1d0e('0xc'),'json':!![]};_0x38e47d['headers']=_0x21d586;logger[_0x1d0e('0x15')](_0x1d0e('0x1a'));return rp(_0x38e47d)[_0x1d0e('0xf')](function(_0x3603af){if(_0x3603af){var _0x34bff5=_0x3603af[_0x1d0e('0x10')];var _0x4de627=![];var _0x333b7d=null;if(_0x400c4c[_0x1d0e('0x1b')]!==null){logger[_0x1d0e('0x15')](_0x1d0e('0x1c'),_0x400c4c[_0x1d0e('0x1b')]);_0x400c4c['userEmail']=_0x400c4c[_0x1d0e('0x1b')];for(_0x333b7d=0x0;_0x333b7d<_0x34bff5[_0x1d0e('0x11')];_0x333b7d++){if(_0x34bff5[_0x333b7d][_0x1d0e('0x12')]===_0x400c4c[_0x1d0e('0x1b')]){_0x4de627=!![];_0x400c4c['userId']=_0x34bff5[_0x333b7d]['id'];logger[_0x1d0e('0x15')](_0x1d0e('0x1d'),_0x400c4c[_0x1d0e('0x1e')]);}}}if(!_0x4de627){logger['info'](_0x1d0e('0x1f'));_0x400c4c[_0x1d0e('0x20')]=_0x400c4c[_0x1d0e('0x13')];_0x400c4c[_0x1d0e('0x1e')]=_0x400c4c[_0x1d0e('0x14')];_0x4de627=!![];}if(_0x4de627){_0x5bd7af(_0x400c4c);}else{_0xb11ff6({'statusCode':0x194,'message':_0x1d0e('0x17')});}}else{_0xb11ff6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x1d0e('0x21')](function(_0x18c253){logger[_0x1d0e('0x18')]('['+[_0x35234b[_0x1d0e('0x19')]()]+']',_0x18c253[_0x1d0e('0x22')]);_0xb11ff6(_0x18c253);});});};}function searchContact(_0x35e6e8,_0x4053af,_0x540fc7,_0x2830ce){return new Promise(function(_0x1e7d1a,_0x5d528a){var _0x1dd437={'method':_0x1d0e('0xb'),'headers':_0x4053af,'uri':_0x35e6e8+'/api/lookup?q='+_0x2830ce+'&f='+_0x540fc7+_0x1d0e('0x23'),'json':!![]};rp(_0x1dd437)[_0x1d0e('0xf')](function(_0xaf38e9){var _0x290b7f=_['find'](_0xaf38e9['contacts'][_0x1d0e('0x24')],[_0x540fc7,_0x2830ce]);_0x1e7d1a(_0x290b7f);})[_0x1d0e('0x21')](function(_0xcebd9b){_0x5d528a(_0xcebd9b);});});}function getEndUser(_0x4cabe8,_0x4d37c6,_0xb9e41f){return function(_0x1837a2){return new Promise(function(_0x4ccf41,_0x6df9a5){logger[_0x1d0e('0x15')](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x1837a2[_0x1d0e('0x25')]));searchContact(_0xb9e41f,_0x4d37c6,_0x1d0e('0x26'),_0x1837a2[_0x1d0e('0x25')])[_0x1d0e('0xf')](function(_0x316aac){if(_0x316aac){_0x1837a2[_0x1d0e('0x27')]=_0x316aac['id'];logger[_0x1d0e('0x15')](_0x1d0e('0x28'),_0x1837a2['endUserId']);return _0x4ccf41(_0x1837a2);}searchContact(_0xb9e41f,_0x4d37c6,_0x1d0e('0x29'),_0x1837a2[_0x1d0e('0x25')])['then'](function(_0x31637d){if(_0x31637d){_0x1837a2[_0x1d0e('0x27')]=_0x31637d['id'];logger['info'](_0x1d0e('0x2a'),_0x1837a2[_0x1d0e('0x27')]);return _0x4ccf41(_0x1837a2);}createEndUser(_0x1837a2,_0x4cabe8,_0x4d37c6,_0xb9e41f)[_0x1d0e('0xf')](function(_0x4869d3){logger[_0x1d0e('0x15')](_0x1d0e('0x2b'),_0x4869d3[_0x1d0e('0x27')]);return _0x4ccf41(_0x4869d3);});});})['catch'](function(_0x5bd106){_0x6df9a5(_0x5bd106);});});};}function createEndUser(_0x24dae4,_0x1572df,_0x16559b,_0x1650cd){return new Promise(function(_0x3a5eb9,_0x2891fd){var _0x526273=moment();var _0x49dd3b={'method':'POST','uri':_0x1650cd+'/api/contacts','body':{'contact':{'last_name':_0x24dae4[_0x1d0e('0x25')],'work_number':_0x24dae4[_0x1d0e('0x25')],'mobile_number':_0x24dae4['contactNumber'],'owner_id':_0x24dae4[_0x1d0e('0x1e')],'created_at':_0x526273[_0x1d0e('0x2c')](_0x1d0e('0x2d'))}},'json':!![]};_0x49dd3b[_0x1d0e('0xd')]=_0x16559b;logger[_0x1d0e('0x15')](_0x1d0e('0x2e'));return rp(_0x49dd3b)[_0x1d0e('0xf')](function(_0x4af6ff){_0x24dae4[_0x1d0e('0x27')]=_0x4af6ff[_0x1d0e('0x2f')]['id'];_0x3a5eb9(_0x24dae4);})[_0x1d0e('0x21')](function(_0x5ad052){logger[_0x1d0e('0x18')]('['+[_0x1572df[_0x1d0e('0x19')]()]+']',_0x5ad052[_0x1d0e('0x22')]);_0x2891fd(_0x5ad052[_0x1d0e('0x22')]);});});}function getTicket(_0x3484ca,_0x4ec1bf,_0x5a14eb,_0xae5321,_0x551aa1){return function(_0x3ce179){logger[_0x1d0e('0x15')](_0x1d0e('0x30'));return new Promise(function(_0x5073db,_0x3bee1b){var _0x5e43f6=moment();var _0x3e9080={'method':_0x1d0e('0x31'),'uri':_0x5a14eb+_0x1d0e('0x32'),'body':{'title':intUtil[_0x1d0e('0x33')](_0xae5321[_0x1d0e('0x34')],_0x551aa1,'\x20'),'description':intUtil['getString'](_0xae5321[_0x1d0e('0x35')],_0x551aa1,'\x0a'),'owner_id':_0x3ce179[_0x1d0e('0x1e')],'creater_id':_0x3ce179[_0x1d0e('0x14')],'targetable_id':_0x3ce179[_0x1d0e('0x27')],'targetable_type':_0x1d0e('0x36'),'created_at':_0x5e43f6[_0x1d0e('0x2c')](_0x1d0e('0x2d')),'due_date':_0x5e43f6[_0x1d0e('0x37')](0x1e,'m')[_0x1d0e('0x2c')](_0x1d0e('0x2d'))},'json':!![]};_0x3e9080[_0x1d0e('0xd')]=_0x4ec1bf;return rp(_0x3e9080)[_0x1d0e('0xf')](function(_0x128433){_0x3ce179[_0x1d0e('0x38')]=_0x128433[_0x1d0e('0x39')]['id'];logger[_0x1d0e('0x15')](_0x1d0e('0x3a'),_0x3ce179[_0x1d0e('0x38')]);_0x5073db(_0x3ce179);})['catch'](function(_0x1dd4b5){logger[_0x1d0e('0x18')]('['+[_0x3484ca[_0x1d0e('0x19')]()]+']',_0x1dd4b5['message']);_0x3bee1b(_0x1dd4b5[_0x1d0e('0x22')]);});});};}function emit(_0x2cc3b4,_0x3e1be4,_0x1f7aa6){var _0x119916={'uri':_0x2cc3b4+_0x1d0e('0x3b')+_0x1f7aa6};io['to'](util[_0x1d0e('0x2c')](_0x1d0e('0x3c'),_0x3e1be4))[_0x1d0e('0x3d')]('trigger:browser:url',_0x119916);}exports['cs']=function(_0x1506f3,_0x1e39ca,_0x475dce,_0x2eb508,_0x5c5268,_0x383533,_0x14d25d,_0x55c422){var _0x40b096={};var _0x152489={'Authorization':_0x1d0e('0x3e')+_0x383533['apiKey']};_0x383533['remoteUri']=intUtil['stripTrailingSlash'](_0x383533[_0x1d0e('0x3f')]);_0x383533[_0x1d0e('0x40')]=intUtil[_0x1d0e('0x41')](_0x383533[_0x1d0e('0x40')]);var _0x1bacc6=_0x383533[_0x1d0e('0x3f')];_0x40b096[_0x1d0e('0x13')]=_0x383533[_0x1d0e('0x42')];_0x40b096[_0x1d0e('0x25')]=_0x55c422[_0x1d0e('0x43')]()==='outbound'?_0x1e39ca[_0x1d0e('0x44')]:_0x1e39ca[_0x1d0e('0x45')];_0x40b096['callDirection']=_0x55c422==='queue'||_0x55c422===_0x1d0e('0x46')?'queue':_0x1d0e('0x47');if(_0x2eb508){_0x40b096[_0x1d0e('0x1b')]=_0x2eb508['email'];}var _0x5f0ead=util[_0x1d0e('0x2c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x383533[_0x1d0e('0x40')],_0x1e39ca['uniqueid'],md5(_0x1e39ca['uniqueid']));if(_0x5c5268&&_0x5c5268[_0x1d0e('0x48')]){logger[_0x1d0e('0x15')](_0x1d0e('0x49'),_0x1d0e('0x4a'));_0x1e39ca[_0x1d0e('0x4b')]=_0x5f0ead;}else if(_0x14d25d&&_0x14d25d[_0x1d0e('0x4c')]&&_0x14d25d[_0x1d0e('0x4c')]!==_0x1d0e('0x4d')){logger[_0x1d0e('0x15')](_0x1d0e('0x4e'),'Recording\x20is\x20enabled!');_0x1e39ca[_0x1d0e('0x4b')]=_0x5f0ead;}else{_0x1e39ca[_0x1d0e('0x4b')]='';}return getAdminId(_0x40b096,_0x55c422,_0x152489,_0x1bacc6)[_0x1d0e('0xf')](getUser(_0x55c422,_0x152489,_0x1bacc6))[_0x1d0e('0xf')](getEndUser(_0x55c422,_0x152489,_0x1bacc6))[_0x1d0e('0xf')](getTicket(_0x55c422,_0x152489,_0x1bacc6,_0x475dce,_0x1e39ca))[_0x1d0e('0xf')](function(_0x1cd248){logger[_0x1d0e('0x15')](util['format'](_0x1d0e('0x4f'),_0x1cd248[_0x1d0e('0x38')]));if(_0x55c422!==_0x1d0e('0x46')){logger[_0x1d0e('0x15')]('['+[_0x55c422[_0x1d0e('0x19')]()]+']',_0x1d0e('0x50'));emit(_0x1bacc6,_0x2eb508[_0x1d0e('0x51')],_0x1cd248[_0x1d0e('0x27')]);}})[_0x1d0e('0x21')](function(_0x714d33){logger[_0x1d0e('0x18')]('['+[_0x55c422[_0x1d0e('0x19')]()]+_0x1d0e('0x52'),util[_0x1d0e('0x53')](_0x714d33,{'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 e966232..95578a3 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 _0x0439=['servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','log','EVENT\x20UNKNOWN','unmanaged','zoho','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','vtiger','dynamics365','freshsales'];(function(_0x1b7043,_0x2e35ff){var _0x17dd57=function(_0x3ec64f){while(--_0x3ec64f){_0x1b7043['push'](_0x1b7043['shift']());}};_0x17dd57(++_0x2e35ff);}(_0x0439,0xaa));var _0x9043=function(_0x31c3ec,_0x41a015){_0x31c3ec=_0x31c3ec-0x0;var _0x319164=_0x0439[_0x31c3ec];return _0x319164;};'use strict';var _=require(_0x9043('0x0'));var util=require(_0x9043('0x1'));var zendesk=require('./zendesk');var salesforce=require(_0x9043('0x2'));var sugarcrm=require(_0x9043('0x3'));var freshdesk=require(_0x9043('0x4'));var zoho=require(_0x9043('0x5'));var desk=require('./desk');var vtiger=require(_0x9043('0x6'));var servicenow=require(_0x9043('0x7'));var dynamics365=require(_0x9043('0x8'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x9043('0x9'),_0x9043('0xa'),_0x9043('0xb'),'zoho','desk',_0x9043('0xc'),_0x9043('0xd'),_0x9043('0xe'),_0x9043('0xf')];exports[_0x9043('0x10')]=function(_0x2b67f5,_0x1a0f79,_0x26a620,_0x22cfa8,_0xfc2bfc,_0x4400e5){if(_0x26a620){if(_[_0x9043('0x11')](integrations,_0x2b67f5[_0x9043('0x12')]['toLowerCase']())){try{var _0x3c80dd=null;var _0x53e237='';var _0x5efc96=_0x26a620[_0x2b67f5[_0x9043('0x12')][_0x9043('0x13')]()];if(_0x5efc96){var _0xba9956=_0x5efc96[_0x2b67f5[_0x9043('0x14')]];if(_0xba9956){var _0x39814d=_[_0x9043('0x15')](_0xba9956[_0x9043('0x16')],{'id':parseInt(_0x2b67f5[_0x9043('0x17')],0xa)});if(_0x39814d){if(_0x22cfa8){if(_0xfc2bfc&&_0x1a0f79[_0x9043('0x18')]){_0x53e237=_0x9043('0x18');}else if(_0x1a0f79['routeId']){_0x53e237='outbound';}else{console[_0x9043('0x19')](_0x9043('0x1a'),_0x1a0f79);}}else{_0x53e237=_0x9043('0x1b');}switch(_0x2b67f5[_0x9043('0x12')]['toLowerCase']()){case'zendesk':zendesk[_0x53e237](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5);break;case _0x9043('0x9'):salesforce[_0x53e237](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5);break;case _0x9043('0xa'):sugarcrm[_0x53e237](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5);break;case _0x9043('0xb'):freshdesk[_0x53e237](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5);break;case _0x9043('0x1c'):zoho[_0x53e237](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5);break;case _0x9043('0x1d'):desk[_0x53e237](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5);break;case _0x9043('0xc'):vtiger[_0x53e237](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5);break;case _0x9043('0xe'):freshsales['cs'](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5,_0x53e237);break;case'servicenow':servicenow['cs'](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5,_0x53e237);break;case _0x9043('0xd'):dynamics365['cs'](_0x2b67f5,_0x1a0f79,_0x39814d,_0x22cfa8,_0xfc2bfc,_0xba9956,_0x4400e5,_0x53e237);break;default:console[_0x9043('0x19')](_0x9043('0x1e'));}}else{_0x3c80dd=require(_0x9043('0x1f'))(_0x2b67f5['data1'][_0x9043('0x13')]());_0x3c80dd[_0x9043('0x20')](_0x9043('0x21'),util[_0x9043('0x22')](_0x9043('0x23'),_0x2b67f5[_0x9043('0x12')][_0x9043('0x13')](),_0x2b67f5[_0x9043('0x17')]));}}else{_0x3c80dd=require(_0x9043('0x1f'))(_0x2b67f5[_0x9043('0x12')][_0x9043('0x13')]());_0x3c80dd[_0x9043('0x20')](_0x9043('0x21'),util['format'](_0x9043('0x24'),_0x2b67f5['data1'][_0x9043('0x13')](),_0x2b67f5['data2']));}}else{}}catch(_0x4a4474){console[_0x9043('0x20')](_0x4a4474);}}}}; \ No newline at end of file +var _0x0c3a=['lodash','./zendesk','./salesforce','./freshdesk','./desk','./vtiger','./servicenow','./freshsales','salesforce','freshdesk','zoho','desk','vtiger','servicenow','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','outbound','EVENT\x20UNKNOWN','unmanaged','zendesk','sugarcrm','freshsales','dynamics365','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','data2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c3a,0x90));var _0xa0c3=function(_0x4b90f8,_0x3a3331){_0x4b90f8=_0x4b90f8-0x0;var _0x3723f3=_0x0c3a[_0x4b90f8];return _0x3723f3;};'use strict';var _=require(_0xa0c3('0x0'));var util=require('util');var zendesk=require(_0xa0c3('0x1'));var salesforce=require(_0xa0c3('0x2'));var sugarcrm=require('./sugarcrm');var freshdesk=require(_0xa0c3('0x3'));var zoho=require('./zoho');var desk=require(_0xa0c3('0x4'));var vtiger=require(_0xa0c3('0x5'));var servicenow=require(_0xa0c3('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0xa0c3('0x7'));var integrations=['zendesk',_0xa0c3('0x8'),'sugarcrm',_0xa0c3('0x9'),_0xa0c3('0xa'),_0xa0c3('0xb'),_0xa0c3('0xc'),'dynamics365','freshsales',_0xa0c3('0xd')];exports[_0xa0c3('0xe')]=function(_0x21771c,_0x41d326,_0x317a45,_0x112976,_0x2e2794,_0x8b87d1){if(_0x317a45){if(_[_0xa0c3('0xf')](integrations,_0x21771c[_0xa0c3('0x10')][_0xa0c3('0x11')]())){try{var _0x434f20=null;var _0x2c2cff='';var _0x28c0d7=_0x317a45[_0x21771c[_0xa0c3('0x10')]['toLowerCase']()];if(_0x28c0d7){var _0x402758=_0x28c0d7[_0x21771c['data2']];if(_0x402758){var _0x411925=_[_0xa0c3('0x12')](_0x402758[_0xa0c3('0x13')],{'id':parseInt(_0x21771c[_0xa0c3('0x14')],0xa)});if(_0x411925){if(_0x112976){if(_0x2e2794&&_0x41d326[_0xa0c3('0x15')]){_0x2c2cff=_0xa0c3('0x15');}else if(_0x41d326['routeId']){_0x2c2cff=_0xa0c3('0x16');}else{console['log'](_0xa0c3('0x17'),_0x41d326);}}else{_0x2c2cff=_0xa0c3('0x18');}switch(_0x21771c['data1'][_0xa0c3('0x11')]()){case _0xa0c3('0x19'):zendesk[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x8'):salesforce[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x1a'):sugarcrm[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x9'):freshdesk[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0xa'):zoho[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0xb'):desk[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0xc'):vtiger[_0x2c2cff](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1);break;case _0xa0c3('0x1b'):freshsales['cs'](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1,_0x2c2cff);break;case _0xa0c3('0xd'):servicenow['cs'](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1,_0x2c2cff);break;case _0xa0c3('0x1c'):dynamics365['cs'](_0x21771c,_0x41d326,_0x411925,_0x112976,_0x2e2794,_0x402758,_0x8b87d1,_0x2c2cff);break;default:console[_0xa0c3('0x1d')](_0xa0c3('0x1e'));}}else{_0x434f20=require(_0xa0c3('0x1f'))(_0x21771c[_0xa0c3('0x10')]['toLowerCase']());_0x434f20[_0xa0c3('0x20')](_0xa0c3('0x21'),util[_0xa0c3('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x21771c[_0xa0c3('0x10')][_0xa0c3('0x11')](),_0x21771c['data3']));}}else{_0x434f20=require(_0xa0c3('0x1f'))(_0x21771c[_0xa0c3('0x10')][_0xa0c3('0x11')]());_0x434f20[_0xa0c3('0x20')](_0xa0c3('0x21'),util[_0xa0c3('0x22')]('%s\x20account\x20#%s\x20not\x20found',_0x21771c['data1'][_0xa0c3('0x11')](),_0x21771c[_0xa0c3('0x23')]));}}else{}}catch(_0x4428c1){console[_0xa0c3('0x20')](_0x4428c1);}}}}; \ 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 6c52b99..c921f98 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 _0xa73e=['contact','lead','WhoId','account','ticketType','Case','ContactId','AccountId','leadId','sobject','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','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','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','','Company','No\x20Company','upperFirst','create','forEach','includes','string','idField','content','toString','variable','variableName','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','queue','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','serverUrl','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','instanceUrl','toUpperCase','isNil','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Subjects','getString','ActivityDate','utc','IsRecurrence','endUserType'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xa73e,0x1e7));var _0xea73=function(_0x1ffeb2,_0x1225e1){_0x1ffeb2=_0x1ffeb2-0x0;var _0x8bf6dd=_0xa73e[_0x1ffeb2];return _0x8bf6dd;};'use strict';var _=require(_0xea73('0x0'));var rp=require(_0xea73('0x1'));var moment=require(_0xea73('0x2'));var BPromise=require(_0xea73('0x3'));var md5=require(_0xea73('0x4'));var jsforce=require('jsforce');var util=require(_0xea73('0x5'));var Redis=require(_0xea73('0x6'));var intUtil=require(_0xea73('0x7'));var config=require(_0xea73('0x8'));var logger=require('../../../../config/logger')(_0xea73('0x9'));config[_0xea73('0xa')]=_[_0xea73('0xb')](config[_0xea73('0xa')],{'host':_0xea73('0xc'),'port':0x18eb});var io=require(_0xea73('0xd'))(new Redis(config['redis']));function emit(_0x41f258,_0x5627d4,_0x450e79){io['to'](_0x41f258)[_0xea73('0xe')](_0x5627d4,_0x450e79);}function getTicket(_0x328dac,_0xb330f8,_0x1d10ba,_0x34fe82,_0x5a3ea1,_0x53ada1,_0x1113ce,_0xf014fe){var _0x4c9b40=Object['assign']({},{'OwnerId':_0xb330f8['id'],'Subject':intUtil['getString'](_0x34fe82[_0xea73('0xf')],_0x5a3ea1,'\x20'),'Description':intUtil[_0xea73('0x10')](_0x34fe82['Descriptions'],_0x5a3ea1,'\x0a')},getCustomFields(_0x53ada1,_0x5a3ea1));if(_0x1d10ba){if(_0x34fe82['ticketType']==='Task'){_0x4c9b40[_0xea73('0x11')]=moment[_0xea73('0x12')]();_0x4c9b40['IsReminderSet']=![];_0x4c9b40[_0xea73('0x13')]=![];if(_0x1d10ba[_0xea73('0x14')]===_0xea73('0x15')||_0x1d10ba[_0xea73('0x14')]===_0xea73('0x16')){_0x4c9b40[_0xea73('0x17')]=_0x1d10ba['id'];}else if(_0x1d10ba['endUserType']===_0xea73('0x18')){_0x4c9b40['WhatId']=_0x1d10ba['id'];}}else if(_0x34fe82[_0xea73('0x19')]===_0xea73('0x1a')){if(_0x1d10ba['endUserType']===_0xea73('0x15')){_0x4c9b40[_0xea73('0x1b')]=_0x1d10ba['id'];}else if(_0x1d10ba[_0xea73('0x14')]===_0xea73('0x18')){_0x4c9b40[_0xea73('0x1c')]=_0x1d10ba['id'];}else if(_0x1d10ba['endUserType']===_0xea73('0x16')&&_0x34fe82[_0xea73('0x1d')]){_0x4c9b40[_0x34fe82[_0xea73('0x1d')]]=_0x1d10ba['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x1113ce[_0xea73('0x1e')](_0x34fe82[_0xea73('0x19')])['create'](_0x4c9b40);}function getUser(_0x52eb9f,_0x1fb973,_0x5d0218){if(!_['isNil'](_0x1fb973)&&intUtil[_0xea73('0x1f')](_0x1fb973)){var _0x3cccde={'Email':_0x1fb973};var _0x28a1e3={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5d0218['sobject'](_0xea73('0x20'))[_0xea73('0x21')](_0x3cccde,_0x28a1e3)[_0xea73('0x22')]()[_0xea73('0x23')](function(_0x1df820){if(_0x1df820[_0xea73('0x24')]){var _0x16c8d8=_['find'](_0x1df820,function(_0x4f3e32){return _0x4f3e32[_0xea73('0x25')]===_0x1fb973;});if(_0x16c8d8){logger[_0xea73('0x26')](_0xea73('0x27'),_0x1fb973);return BPromise[_0xea73('0x28')]({'id':_0x16c8d8['Id'],'name':_0x16c8d8[_0xea73('0x29')]});}}else{logger[_0xea73('0x26')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x1fb973);return _0x5d0218[_0xea73('0x2a')]()[_0xea73('0x23')](function(_0x5af560){return BPromise[_0xea73('0x28')]({'id':_0x5af560[_0xea73('0x2b')],'name':_0x5af560[_0xea73('0x2c')]});});}});}else{logger[_0xea73('0x26')](_0xea73('0x2d'),_0x1fb973);return _0x5d0218[_0xea73('0x2a')]()[_0xea73('0x23')](function(_0x2b2a8f){return BPromise['resolve']({'id':_0x2b2a8f[_0xea73('0x2b')],'name':_0x2b2a8f['display_name']});});}}function getEndUser(_0x4318b5,_0x1f7d3a,_0xb57819,_0x1241b6,_0x505b4b){var _0x428eb3={'$or':{'Phone':_0x1241b6}};var _0xbe5acd={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xea73('0x23')](function(){logger['info'](_0xea73('0x2e'),_0x1241b6,_0x1f7d3a[_0xea73('0x2f')]);switch(_0x1f7d3a['moduleSearch']){case _0xea73('0x30'):var _0xbdd2fd=_[_0xea73('0x31')](_0x428eb3);if(_0x1f7d3a[_0xea73('0x32')]){var _0x226527={};_0x226527[_0x1f7d3a[_0xea73('0x32')]]=_0x1241b6;_[_0xea73('0x33')](_0xbdd2fd[_0xea73('0x34')],_0x226527);}return _0x505b4b[_0xea73('0x1e')](_0xea73('0x35'))[_0xea73('0x21')](_0xbdd2fd,_0xbe5acd)[_0xea73('0x22')]()[_0xea73('0x23')](function(_0x152b20){if(_0x152b20&&_0x152b20[_0xea73('0x24')]){return _0x152b20;}else{var _0x52007a=_[_0xea73('0x31')](_0x428eb3);if(_0x1f7d3a[_0xea73('0x36')]){var _0x419fad={};_0x419fad[_0x1f7d3a['additionalSearchLead']]=_0x1241b6;_[_0xea73('0x33')](_0x52007a['$or'],_0x419fad);}return _0x505b4b[_0xea73('0x1e')](_0xea73('0x37'))['find'](_0x52007a,_0xbe5acd);}});case'account_contact_lead':var _0xa90e4=_[_0xea73('0x31')](_0x428eb3);if(_0x1f7d3a[_0xea73('0x38')]){var _0x226527={};_0x226527[_0x1f7d3a[_0xea73('0x38')]]=_0x1241b6;_[_0xea73('0x33')](_0xa90e4[_0xea73('0x34')],_0x226527);}return _0x505b4b['sobject']('Account')['find'](_0xa90e4,_0xbe5acd)[_0xea73('0x22')]()[_0xea73('0x23')](function(_0x1b76d9){if(_0x1b76d9&&_0x1b76d9[_0xea73('0x24')]){return _0x1b76d9;}else{var _0x38b7ef=_['cloneDeep'](_0x428eb3);if(_0x1f7d3a[_0xea73('0x32')]){var _0x3164dc={};_0x3164dc[_0x1f7d3a[_0xea73('0x32')]]=_0x1241b6;_[_0xea73('0x33')](_0x38b7ef[_0xea73('0x34')],_0x3164dc);}return _0x505b4b[_0xea73('0x1e')](_0xea73('0x35'))[_0xea73('0x21')](_0x38b7ef,_0xbe5acd)['then'](function(_0xf4b66){if(_0xf4b66&&_0xf4b66[_0xea73('0x24')]){return _0xf4b66;}else{var _0x4014cd=_[_0xea73('0x31')](_0x428eb3);if(_0x1f7d3a[_0xea73('0x36')]){var _0x41ddfe={};_0x41ddfe[_0x1f7d3a['additionalSearchLead']]=_0x1241b6;_[_0xea73('0x33')](_0x4014cd['$or'],_0x41ddfe);}return _0x505b4b['sobject']('Lead')[_0xea73('0x21')](_0x4014cd,_0xbe5acd);}});}});case _0xea73('0x15'):var _0xbdd2fd=_[_0xea73('0x31')](_0x428eb3);if(_0x1f7d3a[_0xea73('0x32')]){var _0x226527={};_0x226527[_0x1f7d3a[_0xea73('0x32')]]=_0x1241b6;_[_0xea73('0x33')](_0xbdd2fd[_0xea73('0x34')],_0x226527);}return _0x505b4b['sobject'](_0xea73('0x35'))['find'](_0xbdd2fd,_0xbe5acd)[_0xea73('0x22')]();case _0xea73('0x16'):var _0x2b290c=_[_0xea73('0x31')](_0x428eb3);if(_0x1f7d3a[_0xea73('0x36')]){var _0x226527={};_0x226527[_0x1f7d3a['additionalSearchLead']]=_0x1241b6;_['merge'](_0x2b290c['$or'],_0x226527);}return _0x505b4b[_0xea73('0x1e')](_0xea73('0x37'))[_0xea73('0x21')](_0x2b290c,_0xbe5acd);case _0xea73('0x18'):var _0xa90e4=_[_0xea73('0x31')](_0x428eb3);if(_0x1f7d3a[_0xea73('0x38')]){var _0x226527={};_0x226527[_0x1f7d3a['additionalSearchAccount']]=_0x1241b6;_[_0xea73('0x33')](_0xa90e4[_0xea73('0x34')],_0x226527);}return _0x505b4b[_0xea73('0x1e')](_0xea73('0x39'))['find'](_0xa90e4,_0xbe5acd);default:return null;}})[_0xea73('0x23')](function(_0x544826){if(_0x544826&&_0x544826[_0xea73('0x24')]){var _0x7d7f9f=_[_0xea73('0x3a')](_0x544826);if(_0x7d7f9f){return BPromise['resolve']({'id':_0x7d7f9f['Id'],'name':_0x7d7f9f[_0xea73('0x29')],'phone':_0x7d7f9f[_0xea73('0x3b')],'endUserType':_0x7d7f9f[_0xea73('0x3c')][_0xea73('0x3d')][_0xea73('0x3e')]()});}}})[_0xea73('0x23')](function(_0x567b0e){if(_0x567b0e){logger[_0xea73('0x26')](_0xea73('0x3f'),_0x567b0e['endUserType'],_0x1241b6);return BPromise['resolve'](_0x567b0e);}else{logger['info'](_0xea73('0x40'),_0x1241b6);var _0x1f1508={'Phone':_0x1241b6};if(_0x1f7d3a[_0xea73('0x41')]){if(_0x1f7d3a[_0xea73('0x41')]===_0xea73('0x15')){logger[_0xea73('0x26')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x1241b6,_0x1f7d3a[_0xea73('0x41')]);_0x1f1508[_0xea73('0x42')]=_0xb57819!==''?_0xb57819:util[_0xea73('0x43')](_0xea73('0x44'),_0x1241b6);}else if(_0x1f7d3a[_0xea73('0x41')]===_0xea73('0x16')){logger['info'](_0xea73('0x45'),_0x1241b6,_0x1f7d3a[_0xea73('0x41')]);_0x1f1508['LastName']=_0xb57819!==_0xea73('0x46')?_0xb57819:util[_0xea73('0x43')](_0xea73('0x44'),_0x1241b6);_0x1f1508[_0xea73('0x47')]=_0xea73('0x48');}else if(_0x1f7d3a[_0xea73('0x41')]===_0xea73('0x18')){logger[_0xea73('0x26')](_0xea73('0x45'),_0x1241b6,_0x1f7d3a['moduleCreate']);_0x1f1508[_0xea73('0x29')]=_0xb57819!==''?_0xb57819:util['format']('Caller\x20-\x20%s',_0x1241b6);}else{return null;}}return _0x505b4b[_0xea73('0x1e')](_[_0xea73('0x49')](_0x1f7d3a[_0xea73('0x41')]))[_0xea73('0x4a')](_0x1f1508)['then'](function(_0x1ad1d5){return BPromise[_0xea73('0x28')]({'id':_0x1ad1d5['id'],'endUserType':_0x1f7d3a[_0xea73('0x41')]});});}});}function getCustomFields(_0x48b376,_0x133751){var _0x36e7b6={};if(_0x48b376[_0xea73('0x24')]>0x0){_[_0xea73('0x4b')](_0x48b376,function(_0x364d2b){if(_[_0xea73('0x4c')]([_0xea73('0x4d'),'picklist'],_0x364d2b[_0xea73('0x3d')])&&_0x364d2b['idField']){_0x36e7b6[_0x364d2b[_0xea73('0x4e')]]=_0x364d2b[_0xea73('0x4f')][_0xea73('0x50')]();}else if(_0x364d2b['type']===_0xea73('0x51')&&_0x364d2b[_0xea73('0x52')]&&_0x364d2b['idField']){_0x133751[_0x364d2b[_0xea73('0x52')]]&&(_0x36e7b6[_0x364d2b[_0xea73('0x4e')]]=_0x133751[_0x364d2b[_0xea73('0x52')]]['toString']());}else if(_0x364d2b[_0xea73('0x3d')]==='customVariable'&&_0x364d2b['Variable']&&_0x364d2b[_0xea73('0x53')]['name']&&_0x364d2b[_0xea73('0x4e')]){_0x133751[_0x364d2b['Variable'][_0xea73('0x54')]['toLowerCase']()]&&(_0x36e7b6[_0x364d2b[_0xea73('0x4e')]]=_0x133751[_0x364d2b[_0xea73('0x53')][_0xea73('0x54')]['toLowerCase']()][_0xea73('0x50')]());}});}return _0x36e7b6;}function getConnection(_0x408789){var _0x2590bf=_0x408789[_0xea73('0x55')]['concat'](_0x408789[_0xea73('0x56')]);var _0x1685b9=new jsforce[(_0xea73('0x57'))]({'oauth2':{'loginUrl':_0x408789[_0xea73('0x58')]||_0xea73('0x59'),'clientId':_0x408789[_0xea73('0x5a')],'clientSecret':_0x408789[_0xea73('0x5b')]}});return _0x1685b9[_0xea73('0x5c')](_0x408789[_0xea73('0x5d')],_0x2590bf)[_0xea73('0x23')](function(){logger[_0xea73('0x26')]('Connection\x20established.');return _0x1685b9;});}exports[_0xea73('0x5e')]=function(_0x359b13,_0x8413b3,_0x2b2b74,_0x516122,_0x4841e6,_0x50ca41){var _0x3362f0,_0x587ddd,_0x1b3de2,_0x36840e;_0x50ca41['serverUrl']=intUtil[_0xea73('0x5f')](_0x50ca41['serverUrl']);_0x50ca41[_0xea73('0x58')]=intUtil[_0xea73('0x5f')](_0x50ca41[_0xea73('0x58')]);if(_0x4841e6&&_0x4841e6[_0xea73('0x60')]){logger[_0xea73('0x26')]('[QUEUE]','Recording\x20is\x20enabled!');_0x8413b3[_0xea73('0x61')]=util[_0xea73('0x43')](_0xea73('0x62'),_0x50ca41['serverUrl'],_0x8413b3['uniqueid'],md5(_0x8413b3[_0xea73('0x63')]));}else{_0x8413b3[_0xea73('0x61')]='';}return getConnection(_0x50ca41)[_0xea73('0x23')](function(_0x12637f){_0x36840e=_0x12637f;return getUser(_0x50ca41,_0x516122[_0xea73('0x64')],_0x36840e);})[_0xea73('0x23')](function(_0x4de14b){_0x3362f0=_0x4de14b;return getEndUser(_0x50ca41,_0x2b2b74,_0x8413b3[_0xea73('0x65')],_0x8413b3['calleridnum'],_0x36840e);})[_0xea73('0x23')](function(_0x36ee0e){_0x587ddd=_0x36ee0e;return getTicket(_0x50ca41,_0x3362f0,_0x587ddd,_0x2b2b74,_0x8413b3,_0x2b2b74[_0xea73('0x66')],_0x36840e,_0xea73('0x5e'));})[_0xea73('0x23')](function(_0x4df0b9){_0x1b3de2=_0x4df0b9;logger[_0xea73('0x26')](_0xea73('0x67'),_0x1b3de2['id']);logger[_0xea73('0x26')](_0xea73('0x68'),_0x1b3de2['id'],_0x516122['name'],_0x50ca41[_0xea73('0x3d')]);switch(_0x50ca41[_0xea73('0x3d')]){case _0xea73('0x69'):emit(util['format'](_0xea73('0x6a'),_0x516122['name']),_0xea73('0x6b'),{'recordId':_0x1b3de2['id']});break;case _0xea73('0x6c'):emit(util[_0xea73('0x43')](_0xea73('0x6a'),_0x516122[_0xea73('0x54')]),_0xea73('0x6d'),{'uri':util[_0xea73('0x43')](_0xea73('0x6e'),_0x36840e['instanceUrl'],_0x1b3de2['id'])});break;default:logger[_0xea73('0x6f')](_0xea73('0x70'));}})[_0xea73('0x71')](function(_0x7a3033){logger['error']('[QUEUE]',_0x7a3033);});};exports[_0xea73('0x72')]=function(_0x760e29,_0x42ded8,_0x531279,_0x6fb55b,_0x271546,_0x391f5b,_0x42658f){var _0x4eb22c,_0xb1a795,_0x10b086,_0x333559;_0x391f5b[_0xea73('0x73')]=intUtil[_0xea73('0x5f')](_0x391f5b[_0xea73('0x73')]);_0x391f5b[_0xea73('0x58')]=intUtil[_0xea73('0x5f')](_0x391f5b[_0xea73('0x58')]);if(_0x42658f&&_0x42658f['recordingFormat']&&_0x42658f['recordingFormat']!=='none'){logger[_0xea73('0x26')](_0xea73('0x74'),_0xea73('0x75'));_0x42ded8[_0xea73('0x61')]=util[_0xea73('0x43')](_0xea73('0x62'),_0x391f5b[_0xea73('0x73')],_0x42ded8[_0xea73('0x63')],md5(_0x42ded8[_0xea73('0x63')]));}return getConnection(_0x391f5b)[_0xea73('0x23')](function(_0x2c4eee){_0x333559=_0x2c4eee;return getUser(_0x391f5b,_0x6fb55b['email'],_0x333559);})[_0xea73('0x23')](function(_0x85f394){_0x4eb22c=_0x85f394;return getEndUser(_0x391f5b,_0x531279,_0x42ded8[_0xea73('0x76')],_0x42ded8['destcalleridnum'],_0x333559);})[_0xea73('0x23')](function(_0xcf2638){_0xb1a795=_0xcf2638;return getTicket(_0x391f5b,_0x4eb22c,_0xb1a795,_0x531279,_0x42ded8,_0x531279[_0xea73('0x66')],_0x333559,_0xea73('0x72'));})[_0xea73('0x23')](function(_0x5cfb82){_0x10b086=_0x5cfb82;logger[_0xea73('0x26')](_0xea73('0x77'),_0x10b086['id']);logger[_0xea73('0x26')](_0xea73('0x78'),_0x10b086['id'],_0x6fb55b[_0xea73('0x54')],_0x391f5b[_0xea73('0x3d')]);switch(_0x391f5b[_0xea73('0x3d')]){case _0xea73('0x69'):emit(util[_0xea73('0x43')]('user:%s',_0x6fb55b[_0xea73('0x54')]),'trigger:salesforce:display',{'recordId':_0x10b086['id']});break;case _0xea73('0x6c'):emit(util[_0xea73('0x43')](_0xea73('0x6a'),_0x6fb55b['name']),_0xea73('0x6d'),{'uri':util[_0xea73('0x43')]('%s/%s/e',_0x333559[_0xea73('0x79')],_0x10b086['id'])});break;default:logger[_0xea73('0x6f')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x28b02d){logger[_0xea73('0x6f')](_0xea73('0x74'),_0x28b02d);});};exports['unmanaged']=function(_0x721035,_0x3b8335,_0x1c96d5,_0x2b95e5,_0x41a24b,_0x27239a){var _0xb84a9c,_0x1b78e3,_0x441830,_0x812d0e;_0x27239a[_0xea73('0x73')]=intUtil[_0xea73('0x5f')](_0x27239a[_0xea73('0x73')]);_0x27239a[_0xea73('0x58')]=intUtil[_0xea73('0x5f')](_0x27239a['remoteUri']);if(_0x41a24b&&_0x41a24b[_0xea73('0x60')]){logger['info']('['+_0x3b8335['lastevent'][_0xea73('0x7a')]()+']',_0xea73('0x75'));_0x3b8335[_0xea73('0x61')]=util[_0xea73('0x43')](_0xea73('0x62'),_0x27239a[_0xea73('0x73')],_0x3b8335[_0xea73('0x63')],md5(_0x3b8335['uniqueid']));}else{_0x3b8335[_0xea73('0x61')]='';}return getConnection(_0x27239a)['then'](function(_0x5af9a5){_0x812d0e=_0x5af9a5;if(!_[_0xea73('0x7b')](_0x2b95e5)){return getUser(_0x27239a,_0x2b95e5[_0xea73('0x54')],_0x812d0e);}else{return getUser(_0x27239a,null,_0x812d0e);}})[_0xea73('0x23')](function(_0x326076){_0xb84a9c=_0x326076;return getEndUser(_0x27239a,_0x1c96d5,_0x3b8335[_0xea73('0x65')],_0x3b8335['calleridnum'],_0x812d0e);})[_0xea73('0x23')](function(_0x35a9d1){_0x1b78e3=_0x35a9d1;return getTicket(_0x27239a,_0xb84a9c,_0x1b78e3,_0x1c96d5,_0x3b8335,_0x1c96d5[_0xea73('0x66')],_0x812d0e);})['then'](function(_0x2541d8){_0x441830=_0x2541d8;logger[_0xea73('0x26')]('['+_0x3b8335[_0xea73('0x7c')]['toUpperCase']()+_0xea73('0x7d'),_0x441830['id']);logger[_0xea73('0x26')]('['+_0x3b8335[_0xea73('0x7c')][_0xea73('0x7a')]()+_0xea73('0x7e'),_0x27239a['type']);})[_0xea73('0x71')](function(_0x2a044b){logger[_0xea73('0x6f')]('['+_0x3b8335['lastevent'][_0xea73('0x7a')]()+']',_0x2a044b);});}; \ No newline at end of file +var _0x81f4=['WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','lead','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','Phone','attributes','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','No\x20Company','upperFirst','forEach','includes','picklist','idField','content','toString','variableName','customVariable','Variable','toLowerCase','securityToken','remoteUri','https://login.salesforce.com','login','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','name','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','Salesforce\x20account\x20type\x20not\x20recognized','catch','toUpperCase','isNil','lastevent',']\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','util','./util','salesforce','redis','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','utc','IsReminderSet','IsRecurrence','contact','endUserType'];(function(_0x223d34,_0x3e5231){var _0x2a32eb=function(_0xbf7aa){while(--_0xbf7aa){_0x223d34['push'](_0x223d34['shift']());}};_0x2a32eb(++_0x3e5231);}(_0x81f4,0x163));var _0x481f=function(_0x4040b7,_0x3bf5fd){_0x4040b7=_0x4040b7-0x0;var _0x456961=_0x81f4[_0x4040b7];return _0x456961;};'use strict';var _=require(_0x481f('0x0'));var rp=require(_0x481f('0x1'));var moment=require(_0x481f('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require('jsforce');var util=require(_0x481f('0x3'));var Redis=require('ioredis');var intUtil=require(_0x481f('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x481f('0x5'));config['redis']=_['defaults'](config[_0x481f('0x6')],{'host':_0x481f('0x7'),'port':0x18eb});var io=require(_0x481f('0x8'))(new Redis(config[_0x481f('0x6')]));function emit(_0x2d7345,_0x246675,_0x4044f3){io['to'](_0x2d7345)[_0x481f('0x9')](_0x246675,_0x4044f3);}function getTicket(_0x3ebbfc,_0x1e07bb,_0x1466dc,_0x3d31c9,_0x523a2a,_0x393a3f,_0x5949ed,_0x28f27b){var _0x30cb7d=Object[_0x481f('0xa')]({},{'OwnerId':_0x1e07bb['id'],'Subject':intUtil[_0x481f('0xb')](_0x3d31c9[_0x481f('0xc')],_0x523a2a,'\x20'),'Description':intUtil[_0x481f('0xb')](_0x3d31c9[_0x481f('0xd')],_0x523a2a,'\x0a')},getCustomFields(_0x393a3f,_0x523a2a));if(_0x1466dc){if(_0x3d31c9['ticketType']===_0x481f('0xe')){_0x30cb7d['ActivityDate']=moment[_0x481f('0xf')]();_0x30cb7d[_0x481f('0x10')]=![];_0x30cb7d[_0x481f('0x11')]=![];if(_0x1466dc['endUserType']===_0x481f('0x12')||_0x1466dc[_0x481f('0x13')]==='lead'){_0x30cb7d[_0x481f('0x14')]=_0x1466dc['id'];}else if(_0x1466dc[_0x481f('0x13')]===_0x481f('0x15')){_0x30cb7d[_0x481f('0x16')]=_0x1466dc['id'];}}else if(_0x3d31c9[_0x481f('0x17')]===_0x481f('0x18')){if(_0x1466dc[_0x481f('0x13')]===_0x481f('0x12')){_0x30cb7d[_0x481f('0x19')]=_0x1466dc['id'];}else if(_0x1466dc[_0x481f('0x13')]===_0x481f('0x15')){_0x30cb7d[_0x481f('0x1a')]=_0x1466dc['id'];}else if(_0x1466dc['endUserType']===_0x481f('0x1b')&&_0x3d31c9[_0x481f('0x1c')]){_0x30cb7d[_0x3d31c9['leadId']]=_0x1466dc['id'];}else{logger['info'](_0x481f('0x1d'));}}}return _0x5949ed[_0x481f('0x1e')](_0x3d31c9[_0x481f('0x17')])[_0x481f('0x1f')](_0x30cb7d);}function getUser(_0x36fe66,_0x149298,_0x5573de){if(!_['isNil'](_0x149298)&&intUtil[_0x481f('0x20')](_0x149298)){var _0x445c50={'Email':_0x149298};var _0x608f31={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5573de[_0x481f('0x1e')](_0x481f('0x21'))[_0x481f('0x22')](_0x445c50,_0x608f31)[_0x481f('0x23')]()[_0x481f('0x24')](function(_0x5ef1c6){if(_0x5ef1c6[_0x481f('0x25')]){var _0x5c7ff2=_[_0x481f('0x22')](_0x5ef1c6,function(_0xdda790){return _0xdda790[_0x481f('0x26')]===_0x149298;});if(_0x5c7ff2){logger['info'](_0x481f('0x27'),_0x149298);return BPromise[_0x481f('0x28')]({'id':_0x5c7ff2['Id'],'name':_0x5c7ff2[_0x481f('0x29')]});}}else{logger[_0x481f('0x2a')](_0x481f('0x2b'),_0x149298);return _0x5573de['identity']()[_0x481f('0x24')](function(_0xbfe4b0){return BPromise[_0x481f('0x28')]({'id':_0xbfe4b0[_0x481f('0x2c')],'name':_0xbfe4b0['display_name']});});}});}else{logger[_0x481f('0x2a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x149298);return _0x5573de[_0x481f('0x2d')]()[_0x481f('0x24')](function(_0x3aec9f){return BPromise[_0x481f('0x28')]({'id':_0x3aec9f['user_id'],'name':_0x3aec9f[_0x481f('0x2e')]});});}}function getEndUser(_0x432dfd,_0x4fae80,_0x4a73c7,_0x2ee240,_0x3cdde9){var _0x59fa45={'$or':{'Phone':_0x2ee240}};var _0x2782fe={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x481f('0x24')](function(){logger['info'](_0x481f('0x2f'),_0x2ee240,_0x4fae80['moduleSearch']);switch(_0x4fae80[_0x481f('0x30')]){case _0x481f('0x31'):var _0x5d51f4=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x33')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x33')]]=_0x2ee240;_[_0x481f('0x34')](_0x5d51f4[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9['sobject'](_0x481f('0x36'))[_0x481f('0x22')](_0x5d51f4,_0x2782fe)['execute']()[_0x481f('0x24')](function(_0x1d5197){if(_0x1d5197&&_0x1d5197[_0x481f('0x25')]){return _0x1d5197;}else{var _0x497f15=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80['additionalSearchLead']){var _0x113292={};_0x113292[_0x4fae80[_0x481f('0x37')]]=_0x2ee240;_[_0x481f('0x34')](_0x497f15[_0x481f('0x35')],_0x113292);}return _0x3cdde9['sobject']('Lead')['find'](_0x497f15,_0x2782fe);}});case _0x481f('0x38'):var _0x9a5f9a=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x39')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x39')]]=_0x2ee240;_['merge'](_0x9a5f9a[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x3a'))[_0x481f('0x22')](_0x9a5f9a,_0x2782fe)['execute']()['then'](function(_0x1562b9){if(_0x1562b9&&_0x1562b9['length']){return _0x1562b9;}else{var _0x1b2933=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x33')]){var _0x4a7503={};_0x4a7503[_0x4fae80['additionalSearchContact']]=_0x2ee240;_[_0x481f('0x34')](_0x1b2933['$or'],_0x4a7503);}return _0x3cdde9['sobject'](_0x481f('0x36'))[_0x481f('0x22')](_0x1b2933,_0x2782fe)[_0x481f('0x24')](function(_0x5396ad){if(_0x5396ad&&_0x5396ad[_0x481f('0x25')]){return _0x5396ad;}else{var _0xa49f32=_['cloneDeep'](_0x59fa45);if(_0x4fae80[_0x481f('0x37')]){var _0x55e314={};_0x55e314[_0x4fae80[_0x481f('0x37')]]=_0x2ee240;_[_0x481f('0x34')](_0xa49f32[_0x481f('0x35')],_0x55e314);}return _0x3cdde9['sobject'](_0x481f('0x3b'))['find'](_0xa49f32,_0x2782fe);}});}});case _0x481f('0x12'):var _0x5d51f4=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x33')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x33')]]=_0x2ee240;_[_0x481f('0x34')](_0x5d51f4[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x36'))[_0x481f('0x22')](_0x5d51f4,_0x2782fe)[_0x481f('0x23')]();case _0x481f('0x1b'):var _0xf9e297=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x37')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x37')]]=_0x2ee240;_['merge'](_0xf9e297[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x3b'))[_0x481f('0x22')](_0xf9e297,_0x2782fe);case'account':var _0x9a5f9a=_[_0x481f('0x32')](_0x59fa45);if(_0x4fae80[_0x481f('0x39')]){var _0x2cb4f1={};_0x2cb4f1[_0x4fae80[_0x481f('0x39')]]=_0x2ee240;_['merge'](_0x9a5f9a[_0x481f('0x35')],_0x2cb4f1);}return _0x3cdde9[_0x481f('0x1e')](_0x481f('0x3a'))['find'](_0x9a5f9a,_0x2782fe);default:return null;}})[_0x481f('0x24')](function(_0x138347){if(_0x138347&&_0x138347[_0x481f('0x25')]){var _0x2cc14c=_['first'](_0x138347);if(_0x2cc14c){return BPromise[_0x481f('0x28')]({'id':_0x2cc14c['Id'],'name':_0x2cc14c[_0x481f('0x29')],'phone':_0x2cc14c[_0x481f('0x3c')],'endUserType':_0x2cc14c[_0x481f('0x3d')][_0x481f('0x3e')]['toLowerCase']()});}}})['then'](function(_0x496bbc){if(_0x496bbc){logger[_0x481f('0x2a')](_0x481f('0x3f'),_0x496bbc[_0x481f('0x13')],_0x2ee240);return BPromise['resolve'](_0x496bbc);}else{logger['info'](_0x481f('0x40'),_0x2ee240);var _0x13e5b6={'Phone':_0x2ee240};if(_0x4fae80[_0x481f('0x41')]){if(_0x4fae80[_0x481f('0x41')]===_0x481f('0x12')){logger[_0x481f('0x2a')](_0x481f('0x42'),_0x2ee240,_0x4fae80[_0x481f('0x41')]);_0x13e5b6[_0x481f('0x43')]=_0x4a73c7!==_0x481f('0x44')?_0x4a73c7:util[_0x481f('0x45')](_0x481f('0x46'),_0x2ee240);}else if(_0x4fae80[_0x481f('0x41')]==='lead'){logger[_0x481f('0x2a')](_0x481f('0x42'),_0x2ee240,_0x4fae80[_0x481f('0x41')]);_0x13e5b6[_0x481f('0x43')]=_0x4a73c7!==_0x481f('0x44')?_0x4a73c7:util[_0x481f('0x45')](_0x481f('0x46'),_0x2ee240);_0x13e5b6['Company']=_0x481f('0x47');}else if(_0x4fae80['moduleCreate']==='account'){logger[_0x481f('0x2a')](_0x481f('0x42'),_0x2ee240,_0x4fae80[_0x481f('0x41')]);_0x13e5b6[_0x481f('0x29')]=_0x4a73c7!==_0x481f('0x44')?_0x4a73c7:util[_0x481f('0x45')]('Caller\x20-\x20%s',_0x2ee240);}else{return null;}}return _0x3cdde9['sobject'](_[_0x481f('0x48')](_0x4fae80[_0x481f('0x41')]))[_0x481f('0x1f')](_0x13e5b6)[_0x481f('0x24')](function(_0x581cd0){return BPromise[_0x481f('0x28')]({'id':_0x581cd0['id'],'endUserType':_0x4fae80['moduleCreate']});});}});}function getCustomFields(_0x17e948,_0x4b1765){var _0x10c1c6={};if(_0x17e948[_0x481f('0x25')]>0x0){_[_0x481f('0x49')](_0x17e948,function(_0x23bd70){if(_[_0x481f('0x4a')](['string',_0x481f('0x4b')],_0x23bd70[_0x481f('0x3e')])&&_0x23bd70[_0x481f('0x4c')]){_0x10c1c6[_0x23bd70['idField']]=_0x23bd70[_0x481f('0x4d')][_0x481f('0x4e')]();}else if(_0x23bd70[_0x481f('0x3e')]==='variable'&&_0x23bd70[_0x481f('0x4f')]&&_0x23bd70[_0x481f('0x4c')]){_0x4b1765[_0x23bd70[_0x481f('0x4f')]]&&(_0x10c1c6[_0x23bd70['idField']]=_0x4b1765[_0x23bd70[_0x481f('0x4f')]][_0x481f('0x4e')]());}else if(_0x23bd70[_0x481f('0x3e')]===_0x481f('0x50')&&_0x23bd70[_0x481f('0x51')]&&_0x23bd70[_0x481f('0x51')]['name']&&_0x23bd70['idField']){_0x4b1765[_0x23bd70[_0x481f('0x51')]['name'][_0x481f('0x52')]()]&&(_0x10c1c6[_0x23bd70['idField']]=_0x4b1765[_0x23bd70[_0x481f('0x51')]['name'][_0x481f('0x52')]()][_0x481f('0x4e')]());}});}return _0x10c1c6;}function getConnection(_0x3221e0){var _0x1c4e22=_0x3221e0['password']['concat'](_0x3221e0[_0x481f('0x53')]);var _0x2fa67e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3221e0[_0x481f('0x54')]||_0x481f('0x55'),'clientId':_0x3221e0['clientId'],'clientSecret':_0x3221e0['clientSecret']}});return _0x2fa67e[_0x481f('0x56')](_0x3221e0['username'],_0x1c4e22)[_0x481f('0x24')](function(){logger[_0x481f('0x2a')]('Connection\x20established.');return _0x2fa67e;});}exports[_0x481f('0x57')]=function(_0x3c7a9a,_0x5eee0c,_0x4d15ed,_0x274d99,_0x1d5107,_0x182c5a){var _0x5bf479,_0x1791f4,_0x1e6486,_0x11a770;_0x182c5a[_0x481f('0x58')]=intUtil[_0x481f('0x59')](_0x182c5a[_0x481f('0x58')]);_0x182c5a[_0x481f('0x54')]=intUtil['stripTrailingSlash'](_0x182c5a['remoteUri']);if(_0x1d5107&&_0x1d5107[_0x481f('0x5a')]){logger[_0x481f('0x2a')]('[QUEUE]',_0x481f('0x5b'));_0x5eee0c[_0x481f('0x5c')]=util[_0x481f('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x182c5a[_0x481f('0x58')],_0x5eee0c['uniqueid'],md5(_0x5eee0c[_0x481f('0x5d')]));}else{_0x5eee0c[_0x481f('0x5c')]='';}return getConnection(_0x182c5a)[_0x481f('0x24')](function(_0x167f62){_0x11a770=_0x167f62;return getUser(_0x182c5a,_0x274d99[_0x481f('0x5e')],_0x11a770);})['then'](function(_0x82cc58){_0x5bf479=_0x82cc58;return getEndUser(_0x182c5a,_0x4d15ed,_0x5eee0c['calleridname'],_0x5eee0c[_0x481f('0x5f')],_0x11a770);})[_0x481f('0x24')](function(_0x5c7d4b){_0x1791f4=_0x5c7d4b;return getTicket(_0x182c5a,_0x5bf479,_0x1791f4,_0x4d15ed,_0x5eee0c,_0x4d15ed[_0x481f('0x60')],_0x11a770,_0x481f('0x57'));})[_0x481f('0x24')](function(_0x3057df){_0x1e6486=_0x3057df;logger[_0x481f('0x2a')](_0x481f('0x61'),_0x1e6486['id']);logger[_0x481f('0x2a')](_0x481f('0x62'),_0x1e6486['id'],_0x274d99[_0x481f('0x63')],_0x182c5a[_0x481f('0x3e')]);switch(_0x182c5a[_0x481f('0x3e')]){case _0x481f('0x64'):emit(util[_0x481f('0x45')]('user:%s',_0x274d99[_0x481f('0x63')]),_0x481f('0x65'),{'recordId':_0x1e6486['id']});break;case'newTab':emit(util[_0x481f('0x45')](_0x481f('0x66'),_0x274d99[_0x481f('0x63')]),_0x481f('0x67'),{'uri':util[_0x481f('0x45')](_0x481f('0x68'),_0x11a770[_0x481f('0x69')],_0x1e6486['id'])});break;default:logger[_0x481f('0x6a')](_0x481f('0x6b'));}})['catch'](function(_0x39cd7a){logger[_0x481f('0x6a')](_0x481f('0x6c'),_0x39cd7a);});};exports[_0x481f('0x6d')]=function(_0x4e9c60,_0x4780a4,_0xe9cba4,_0x232c18,_0x5dddda,_0x1ab208,_0x5bdda7){var _0x258ab1,_0x28a6e3,_0x454496,_0x46b41b;_0x1ab208['serverUrl']=intUtil['stripTrailingSlash'](_0x1ab208[_0x481f('0x58')]);_0x1ab208[_0x481f('0x54')]=intUtil[_0x481f('0x59')](_0x1ab208[_0x481f('0x54')]);if(_0x5bdda7&&_0x5bdda7[_0x481f('0x6e')]&&_0x5bdda7[_0x481f('0x6e')]!==_0x481f('0x6f')){logger[_0x481f('0x2a')](_0x481f('0x70'),_0x481f('0x5b'));_0x4780a4['recordingURL']=util[_0x481f('0x45')](_0x481f('0x71'),_0x1ab208[_0x481f('0x58')],_0x4780a4[_0x481f('0x5d')],md5(_0x4780a4[_0x481f('0x5d')]));}return getConnection(_0x1ab208)[_0x481f('0x24')](function(_0x2a4744){_0x46b41b=_0x2a4744;return getUser(_0x1ab208,_0x232c18[_0x481f('0x5e')],_0x46b41b);})[_0x481f('0x24')](function(_0x20d4b2){_0x258ab1=_0x20d4b2;return getEndUser(_0x1ab208,_0xe9cba4,_0x4780a4[_0x481f('0x72')],_0x4780a4[_0x481f('0x73')],_0x46b41b);})[_0x481f('0x24')](function(_0x55999d){_0x28a6e3=_0x55999d;return getTicket(_0x1ab208,_0x258ab1,_0x28a6e3,_0xe9cba4,_0x4780a4,_0xe9cba4['Fields'],_0x46b41b,_0x481f('0x6d'));})['then'](function(_0x4b1f83){_0x454496=_0x4b1f83;logger[_0x481f('0x2a')](_0x481f('0x74'),_0x454496['id']);logger['info'](_0x481f('0x75'),_0x454496['id'],_0x232c18['name'],_0x1ab208['type']);switch(_0x1ab208[_0x481f('0x3e')]){case'integrationTab':emit(util[_0x481f('0x45')](_0x481f('0x66'),_0x232c18[_0x481f('0x63')]),_0x481f('0x65'),{'recordId':_0x454496['id']});break;case _0x481f('0x76'):emit(util['format'](_0x481f('0x66'),_0x232c18[_0x481f('0x63')]),_0x481f('0x67'),{'uri':util[_0x481f('0x45')](_0x481f('0x68'),_0x46b41b['instanceUrl'],_0x454496['id'])});break;default:logger['error'](_0x481f('0x70'),_0x481f('0x77'));}})[_0x481f('0x78')](function(_0x3fbd2a){logger[_0x481f('0x6a')]('[OUTBOUND]',_0x3fbd2a);});};exports['unmanaged']=function(_0x1040b7,_0x1ba8ab,_0x15536e,_0x36f829,_0x5938fa,_0xfedf2f){var _0x4fdc4e,_0x32ed8a,_0x6105a8,_0x3594f9;_0xfedf2f[_0x481f('0x58')]=intUtil['stripTrailingSlash'](_0xfedf2f['serverUrl']);_0xfedf2f[_0x481f('0x54')]=intUtil[_0x481f('0x59')](_0xfedf2f[_0x481f('0x54')]);if(_0x5938fa&&_0x5938fa[_0x481f('0x5a')]){logger[_0x481f('0x2a')]('['+_0x1ba8ab['lastevent'][_0x481f('0x79')]()+']',_0x481f('0x5b'));_0x1ba8ab[_0x481f('0x5c')]=util['format'](_0x481f('0x71'),_0xfedf2f[_0x481f('0x58')],_0x1ba8ab['uniqueid'],md5(_0x1ba8ab[_0x481f('0x5d')]));}else{_0x1ba8ab[_0x481f('0x5c')]='';}return getConnection(_0xfedf2f)[_0x481f('0x24')](function(_0x30b932){_0x3594f9=_0x30b932;if(!_[_0x481f('0x7a')](_0x36f829)){return getUser(_0xfedf2f,_0x36f829['name'],_0x3594f9);}else{return getUser(_0xfedf2f,null,_0x3594f9);}})[_0x481f('0x24')](function(_0x331ee4){_0x4fdc4e=_0x331ee4;return getEndUser(_0xfedf2f,_0x15536e,_0x1ba8ab['calleridname'],_0x1ba8ab[_0x481f('0x5f')],_0x3594f9);})['then'](function(_0x119b50){_0x32ed8a=_0x119b50;return getTicket(_0xfedf2f,_0x4fdc4e,_0x32ed8a,_0x15536e,_0x1ba8ab,_0x15536e[_0x481f('0x60')],_0x3594f9);})['then'](function(_0x2dcffa){_0x6105a8=_0x2dcffa;logger['info']('['+_0x1ba8ab[_0x481f('0x7b')][_0x481f('0x79')]()+_0x481f('0x7c'),_0x6105a8['id']);logger['info']('['+_0x1ba8ab[_0x481f('0x7b')][_0x481f('0x79')]()+']\x20Integration\x20account\x20type\x20%s.',_0xfedf2f[_0x481f('0x3e')]);})[_0x481f('0x78')](function(_0x19de38){logger[_0x481f('0x6a')]('['+_0x1ba8ab[_0x481f('0x7b')]['toUpperCase']()+']',_0x19de38);});}; \ 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 4896530..b6afa48 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 _0xc2c5=['endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','variable','variableName','customVariable','Variable','name','outbound','POST','incident','assign','getString','Descriptions','Fields','ticketId','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','],\x20getAdminUser\x20crm','error','toUpperCase','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','active','true','userId','adminEmail','],\x20getUser\x20crm','catch',']\x20using\x20admin\x20profile','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema'];(function(_0x5e99f9,_0x189f62){var _0x1652e3=function(_0x353733){while(--_0x353733){_0x5e99f9['push'](_0x5e99f9['shift']());}};_0x1652e3(++_0x189f62);}(_0xc2c5,0x187));var _0x5c2c=function(_0x4d9a48,_0x20bc50){_0x4d9a48=_0x4d9a48-0x0;var _0xef464d=_0xc2c5[_0x4d9a48];return _0xef464d;};'use strict';var _=require(_0x5c2c('0x0'));var Promise=require(_0x5c2c('0x1'));var rp=require(_0x5c2c('0x2'));var util=require(_0x5c2c('0x3'));var md5=require(_0x5c2c('0x4'));var Redis=require(_0x5c2c('0x5'));var intUtil=require(_0x5c2c('0x6'));var config=require(_0x5c2c('0x7'));var logger=require(_0x5c2c('0x8'))(_0x5c2c('0x9'));config[_0x5c2c('0xa')]=_[_0x5c2c('0xb')](config[_0x5c2c('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x5c2c('0xc'))(new Redis(config[_0x5c2c('0xa')]));function getAdminUser(_0x12d4a5,_0x23d74e,_0x188b5a,_0x20ce7f,_0x57c71b,_0x5e8f80){return new Promise(function(_0x5b6682,_0x3d6e0d){var _0x4e95db={'method':_0x5c2c('0xd'),'uri':_0x20ce7f+_0x5c2c('0xe')+'&'+_0x57c71b+'&'+_0x5e8f80,'auth':_0x23d74e,'json':!![]};return rp(_0x4e95db)['then'](function(_0x1db95e){if(_0x1db95e[_0x5c2c('0xf')][_0x5c2c('0x10')]>0x0){_0x188b5a[_0x5c2c('0x11')]=_0x1db95e[_0x5c2c('0xf')][0x0][_0x5c2c('0x12')];}logger[_0x5c2c('0x13')]('['+[_0x12d4a5['toUpperCase']()]+_0x5c2c('0x14'),_0x188b5a);_0x5b6682(_0x188b5a);})['catch'](function(_0xefd62e){logger[_0x5c2c('0x15')]('['+[_0x12d4a5[_0x5c2c('0x16')]()]+']',_0xefd62e[_0x5c2c('0x17')]);_0x3d6e0d(_0xefd62e[_0x5c2c('0x17')]);});});}function getUser(_0x459f74,_0x4cb710,_0x53ad4a,_0x2f1a5a,_0x900bd5){return function(_0x52a1e2){logger['info']('['+[_0x459f74[_0x5c2c('0x16')]()]+_0x5c2c('0x18'),_0x52a1e2);return new Promise(function(_0x3e0066,_0x1880b2){if(intUtil['validateEmail'](_0x52a1e2[_0x5c2c('0x19')])){var _0x5b0fc3={'method':'GET','uri':_0x53ad4a+_0x5c2c('0x1a')+_0x52a1e2[_0x5c2c('0x19')]+'&'+_0x2f1a5a+'&'+_0x900bd5,'auth':_0x4cb710,'json':!![]};logger[_0x5c2c('0x13')]('['+[_0x459f74[_0x5c2c('0x16')]()]+'],\x20getUser\x20rp\x20obj',_0x5b0fc3);return rp(_0x5b0fc3)[_0x5c2c('0x1b')](function(_0x799769){logger[_0x5c2c('0x13')]('['+[_0x459f74[_0x5c2c('0x16')]()]+_0x5c2c('0x1c'),_0x799769);if(_0x799769[_0x5c2c('0xf')][_0x5c2c('0x10')]>0x0&&String(_0x799769[_0x5c2c('0xf')][0x0][_0x5c2c('0x1d')])===_0x5c2c('0x1e')){_0x52a1e2['userId']=_0x799769[_0x5c2c('0xf')][0x0]['sys_id'];}else{_0x52a1e2[_0x5c2c('0x1f')]=_0x52a1e2['adminId'];_0x52a1e2[_0x5c2c('0x19')]=_0x52a1e2[_0x5c2c('0x20')];}logger[_0x5c2c('0x13')]('['+[_0x459f74['toUpperCase']()]+_0x5c2c('0x21'),_0x52a1e2);_0x3e0066(_0x52a1e2);})[_0x5c2c('0x22')](function(_0x3a94b2){logger[_0x5c2c('0x15')]('['+[_0x459f74[_0x5c2c('0x16')]()]+']',_0x3a94b2[_0x5c2c('0x17')]);_0x1880b2(_0x3a94b2['message']);});}else{logger[_0x5c2c('0x13')]('['+[_0x459f74[_0x5c2c('0x16')]()]+_0x5c2c('0x23'));_0x52a1e2[_0x5c2c('0x1f')]=_0x52a1e2['adminId'];_0x52a1e2['userEmail']=_0x52a1e2['adminEmail'];_0x3e0066(_0x52a1e2);}});};}function createEndUser(_0x430bf3,_0x2259af,_0xa03c78,_0x26a588,_0x2a6787){logger[_0x5c2c('0x13')]('['+[_0x430bf3[_0x5c2c('0x16')]()]+'],\x20createEndUser\x20input\x20crm',_0xa03c78);return new Promise(function(_0x3863fe,_0x217423){var _0x3a139b={'method':'POST','uri':_0x26a588+_0x5c2c('0x24')+_0x2a6787,'body':{'user_name':_0xa03c78[_0x5c2c('0x25')],'roles':_0x5c2c('0x26'),'first_name':_0xa03c78[_0x5c2c('0x25')],'active':_0x5c2c('0x1e'),'date_format':_0x5c2c('0x27'),'phone':_0xa03c78[_0x5c2c('0x25')]},'auth':_0x2259af,'json':!![]};return rp(_0x3a139b)[_0x5c2c('0x1b')](function(_0x23c2e8){logger[_0x5c2c('0x13')]('['+[_0x430bf3[_0x5c2c('0x16')]()]+_0x5c2c('0x28'),_0x23c2e8[_0x5c2c('0xf')]);_0xa03c78[_0x5c2c('0x29')]=_0x23c2e8[_0x5c2c('0xf')]['sys_id'];_0x3863fe(_0xa03c78);})['catch'](function(_0x5ce91e){logger[_0x5c2c('0x15')]('['+[_0x430bf3[_0x5c2c('0x16')]()]+']',_0x5ce91e[_0x5c2c('0x17')]);_0x217423(_0x5ce91e['message']);});});}function getEndUser(_0x37bff6,_0x1c08e1,_0x21034d,_0x466e7b,_0x45288e){return function(_0x286338){logger['info']('['+[_0x37bff6[_0x5c2c('0x16')]()]+_0x5c2c('0x2a'),_0x286338);return new Promise(function(_0x128283,_0x7a8b15){var _0x28696a={'method':_0x5c2c('0xd'),'uri':_0x21034d+'sys_user?sysparm_query=phone%3D'+_0x286338[_0x5c2c('0x25')]+'&'+_0x466e7b+'&'+_0x45288e,'auth':_0x1c08e1,'json':!![]};return rp(_0x28696a)[_0x5c2c('0x1b')](function(_0x18b8e0){if(_0x18b8e0[_0x5c2c('0xf')][_0x5c2c('0x10')]>0x0){_0x286338[_0x5c2c('0x29')]=_0x18b8e0[_0x5c2c('0xf')][0x0][_0x5c2c('0x12')];logger['info']('['+[_0x37bff6['toUpperCase']()]+_0x5c2c('0x2b'),_0x286338);_0x128283(_0x286338);}else{return createEndUser(_0x37bff6,_0x1c08e1,_0x286338,_0x21034d,_0x466e7b)[_0x5c2c('0x1b')](function(_0x4ec647){logger[_0x5c2c('0x13')]('['+[_0x37bff6['toUpperCase']()]+_0x5c2c('0x2c'),_0x4ec647);_0x128283(_0x4ec647);});}})[_0x5c2c('0x22')](function(_0x17829f){logger[_0x5c2c('0x15')]('['+[_0x37bff6[_0x5c2c('0x16')]()]+']',_0x17829f[_0x5c2c('0x17')]);_0x7a8b15(_0x17829f[_0x5c2c('0x17')]);});});};}function getCustomFields(_0x45d649,_0x3adbcc){var _0x2ad28={};if(_0x45d649['length']>0x0){_[_0x5c2c('0x2d')](_0x45d649,function(_0x51a366){if(_['includes']([_0x5c2c('0x2e'),_0x5c2c('0x2f')],_0x51a366[_0x5c2c('0x30')])&&_0x51a366[_0x5c2c('0x31')]&&!_0x51a366[_0x5c2c('0x32')]){_0x2ad28[_0x51a366[_0x5c2c('0x31')][_0x5c2c('0x33')]()]=_0x51a366[_0x5c2c('0x34')][_0x5c2c('0x35')]();}else if(_[_0x5c2c('0x36')]([_0x5c2c('0x2e'),_0x5c2c('0x2f')],_0x51a366[_0x5c2c('0x30')])&&_0x51a366[_0x5c2c('0x37')]&&_0x51a366[_0x5c2c('0x32')]){_0x2ad28[_0x51a366[_0x5c2c('0x37')]['toLowerCase']()]=_0x51a366[_0x5c2c('0x34')][_0x5c2c('0x35')]();}else if(_0x51a366['type']===_0x5c2c('0x38')&&_0x51a366['variableName']&&_0x51a366[_0x5c2c('0x37')]&&_0x51a366['customField']){_0x2ad28[_0x51a366[_0x5c2c('0x37')][_0x5c2c('0x33')]()]=_0x3adbcc[_0x51a366[_0x5c2c('0x39')]][_0x5c2c('0x35')]();}else if(_0x51a366[_0x5c2c('0x30')]===_0x5c2c('0x3a')&&_0x51a366[_0x5c2c('0x3b')]&&_0x51a366[_0x5c2c('0x3b')][_0x5c2c('0x3c')]&&_0x51a366[_0x5c2c('0x37')]&&_0x51a366['customField']){_0x2ad28[_0x51a366[_0x5c2c('0x37')][_0x5c2c('0x33')]()]=_0x3adbcc[_0x51a366[_0x5c2c('0x3b')][_0x5c2c('0x3c')][_0x5c2c('0x33')]()]['toString']();}});}return _0x2ad28;}function getTicket(_0x2807cc,_0x36fd12,_0x4183a3,_0x145429,_0x661b3f,_0x438874){return function(_0x51077d){logger[_0x5c2c('0x13')]('['+[_0x2807cc[_0x5c2c('0x16')]()]+']\x20getTicket\x20input\x20crm',_0x51077d);return new Promise(function(_0x358bb3,_0x1220d0){var _0x458b49=_0x2807cc['toLowerCase']()===_0x5c2c('0x3d')?_0x51077d[_0x5c2c('0x1f')]:_0x51077d[_0x5c2c('0x29')];var _0x357043={'method':_0x5c2c('0x3e'),'uri':_0x4183a3+_0x5c2c('0x3f')+'?'+_0x438874,'body':Object[_0x5c2c('0x40')]({},{'active':_0x5c2c('0x1e'),'caller_id':_0x458b49,'assigned_to':_0x51077d[_0x5c2c('0x1f')],'short_description':intUtil[_0x5c2c('0x41')](_0x145429['Subjects'],_0x661b3f,'\x20'),'description':intUtil[_0x5c2c('0x41')](_0x145429[_0x5c2c('0x42')],_0x661b3f,'\x0a')},getCustomFields(_0x145429[_0x5c2c('0x43')],_0x661b3f)),'auth':_0x36fd12,'json':!![]};return rp(_0x357043)[_0x5c2c('0x1b')](function(_0x5df56a){logger[_0x5c2c('0x13')]('['+[_0x2807cc[_0x5c2c('0x16')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x5df56a['result']);_0x51077d[_0x5c2c('0x44')]=_0x5df56a[_0x5c2c('0xf')][_0x5c2c('0x12')];_0x51077d['ticketNumber']=_0x5df56a[_0x5c2c('0xf')]['number'];logger[_0x5c2c('0x13')]('['+[_0x2807cc[_0x5c2c('0x16')]()]+']\x20getTicket\x20crm',_0x51077d);_0x358bb3(_0x51077d);})[_0x5c2c('0x22')](function(_0x199426){logger[_0x5c2c('0x15')]('['+[_0x2807cc[_0x5c2c('0x16')]()]+']',_0x199426['message']);_0x1220d0(_0x199426[_0x5c2c('0x17')]);});});};}function createRemoteTag(_0x4c25c6,_0x5b6e2a,_0x3c8ed4,_0x55b80d){return new Promise(function(_0x227e71,_0x369e4f){var _0x2a56af={'method':_0x5c2c('0x3e'),'uri':_0x3c8ed4+_0x5c2c('0x45')+'?'+_0x55b80d,'body':{'short_description':_0x4c25c6,'global':!![],'active':!![],'name':_0x4c25c6},'auth':_0x5b6e2a,'json':!![]};return rp(_0x2a56af)[_0x5c2c('0x1b')](function(_0x13ef77){var _0x4f5ad3=_0x13ef77['result']['sys_id'];_0x227e71(_0x4f5ad3);});});}function getRemoteTag(_0x118f04,_0x20c26a,_0x4cbe13,_0x5acee6,_0x30d003){return new Promise(function(_0x4248b8,_0x53fcbc){var _0x4562f7={'method':_0x5c2c('0xd'),'uri':_0x4cbe13+_0x5c2c('0x45')+_0x5c2c('0x46')+_0x118f04+'&'+_0x5acee6,'auth':_0x20c26a,'json':!![]};return rp(_0x4562f7)[_0x5c2c('0x1b')](function(_0x8afb12){if(_0x8afb12[_0x5c2c('0xf')][_0x5c2c('0x10')]>0x0){var _0x3cfd06=_0x8afb12['result'][0x0]['sys_id'];_0x4248b8(_0x3cfd06);}else{return createRemoteTag(_0x118f04,_0x20c26a,_0x4cbe13,_0x5acee6)['then'](function(_0x108bd4){_0x4248b8(_0x108bd4);});}});});}function assignTagToIncident(_0x7cf964,_0x10c594,_0xaffdba,_0x5d8d85,_0xa6dbda){return new Promise(function(_0x299b4c,_0x18fb7c){var _0x5ebc7b={'method':_0x5c2c('0x3e'),'uri':_0xaffdba+_0x5c2c('0x47')+'?'+_0xa6dbda,'body':{'label':_0x7cf964,'table':_0x5c2c('0x3f'),'id_type':_0x5c2c('0x48'),'table_key':_0x5d8d85[_0x5c2c('0x44')],'title':'Incident\x20-\x20'+_0x5d8d85['ticketNumber'],'id_display':_0x5d8d85['ticketNumber']},'auth':_0x10c594,'json':!![]};return rp(_0x5ebc7b)[_0x5c2c('0x1b')](function(_0x58fcfa){_0x299b4c();})['catch'](function(){_0x299b4c();});});}function manageTags(_0x2f046f,_0x381809,_0x18106e,_0x369bec,_0x562d29,_0xf8d614,_0x3f1cd1){return new Promise(function(_0xa6eac2,_0x270587){var _0x32834d=[];_0x381809[_0x5c2c('0x2d')](function(_0x49680b){_0x32834d[_0x5c2c('0x49')](getRemoteTag(_0x49680b,_0x18106e,_0x369bec,_0xf8d614,_0x3f1cd1));});return Promise[_0x5c2c('0x4a')](_0x32834d)[_0x5c2c('0x1b')](function(_0x3ab393){if(_0x3ab393[_0x5c2c('0x10')]){logger[_0x5c2c('0x13')]('['+[_0x2f046f[_0x5c2c('0x16')]()]+_0x5c2c('0x4b'),_0x3ab393);var _0x2c6628=[];_0x3ab393[_0x5c2c('0x2d')](function(_0x4b6010){_0x2c6628[_0x5c2c('0x49')](assignTagToIncident(_0x4b6010,_0x18106e,_0x369bec,_0x562d29,_0xf8d614));});return Promise['all'](_0x2c6628)[_0x5c2c('0x1b')](function(){_0xa6eac2();})['catch'](function(){_0xa6eac2();});}else{_0xa6eac2();}});});}function getTags(_0xd2cc8d,_0x2396f6,_0x2c2422,_0x53c260,_0xda831e,_0x27849f){return function(_0x33fdf7){return new Promise(function(_0x369244,_0x50ee29){var _0x10f1a1=[];var _0x1c6f39=_0x53c260[_0x5c2c('0x4c')];if(_0x1c6f39&&_0x1c6f39['length']>0x0){_0x10f1a1=_[_0x5c2c('0x4d')](_0x1c6f39,_0x5c2c('0x3c'));}if(_0x10f1a1[_0x5c2c('0x10')]>0x0){return manageTags(_0xd2cc8d,_0x10f1a1,_0x2396f6,_0x2c2422,_0x33fdf7,_0xda831e,_0x27849f)[_0x5c2c('0x1b')](function(){_0x369244(_0x33fdf7);});}else{_0x369244(_0x33fdf7);}});};}function emit(_0x5ec0dc,_0x16e66a,_0x4ebd4b){var _0x12251f=_0x5c2c('0x4e')+_0x5c2c('0x4f')+'%26sysparm_record_list%3Dactive%253Dtrue'+'%255EORDERBYDESCnumber';var _0x46258b={'uri':_0x5ec0dc+_0x5c2c('0x50')+_0x4ebd4b+_0x12251f};io['to'](util[_0x5c2c('0x51')]('user:%s',_0x16e66a))[_0x5c2c('0x52')](_0x5c2c('0x53'),_0x46258b);}exports['cs']=function(_0x13deb3,_0x65921c,_0x2a5e60,_0x1cf716,_0x5f1e99,_0x3ef588,_0x259652,_0xb292b9){var _0x353686={};var _0xacd163={'user':_0x3ef588[_0x5c2c('0x54')],'pass':_0x3ef588['password']};var _0x213b35=_0x5c2c('0x55');var _0x2570a9='sysparm_display_value=true';_0x3ef588[_0x5c2c('0x56')]=intUtil[_0x5c2c('0x57')](_0x3ef588[_0x5c2c('0x56')]);_0x3ef588[_0x5c2c('0x58')]=intUtil[_0x5c2c('0x57')](_0x3ef588[_0x5c2c('0x58')]);var _0xd7c25a=util[_0x5c2c('0x51')](_0x5c2c('0x59'),_0x3ef588['remoteUri']);_0x353686[_0x5c2c('0x19')]=!_[_0x5c2c('0x5a')](_0x1cf716)?_0x1cf716[_0x5c2c('0x5b')]:null;_0x353686[_0x5c2c('0x20')]=_0x3ef588[_0x5c2c('0x5b')];_0x353686[_0x5c2c('0x25')]=_0xb292b9[_0x5c2c('0x33')]()===_0x5c2c('0x3d')?_0x65921c['destcalleridnum']:_0x65921c[_0x5c2c('0x5c')];_0x353686[_0x5c2c('0x5d')]=_0xb292b9===_0x5c2c('0x5e')||_0xb292b9===_0x5c2c('0x5f')?'queue':'outbound';var _0x310b46=util[_0x5c2c('0x51')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ef588[_0x5c2c('0x58')],_0x65921c[_0x5c2c('0x60')],md5(_0x65921c[_0x5c2c('0x60')]));if(_0x5f1e99&&_0x5f1e99[_0x5c2c('0x61')]){logger[_0x5c2c('0x13')](_0x5c2c('0x62'),_0x5c2c('0x63'));_0x65921c['recordingURL']=_0x310b46;}else if(_0x259652&&_0x259652['recordingFormat']&&_0x259652[_0x5c2c('0x64')]!==_0x5c2c('0x65')){logger[_0x5c2c('0x13')](_0x5c2c('0x66'),_0x5c2c('0x63'));_0x65921c[_0x5c2c('0x67')]=_0x310b46;}else{_0x65921c['recordingURL']='';}return getAdminUser(_0xb292b9,_0xacd163,_0x353686,_0xd7c25a,_0x2570a9,_0x213b35)['then'](getUser(_0xb292b9,_0xacd163,_0xd7c25a,_0x2570a9,_0x213b35))[_0x5c2c('0x1b')](getEndUser(_0xb292b9,_0xacd163,_0xd7c25a,_0x2570a9,_0x213b35))[_0x5c2c('0x1b')](getTicket(_0xb292b9,_0xacd163,_0xd7c25a,_0x2a5e60,_0x65921c,_0x2570a9))[_0x5c2c('0x1b')](function(_0x3dcc53){logger[_0x5c2c('0x13')](util[_0x5c2c('0x51')](_0x5c2c('0x68'),_0x3dcc53[_0x5c2c('0x44')]));logger[_0x5c2c('0x13')](util[_0x5c2c('0x51')](_0x5c2c('0x69'),_0xb292b9));if(_0xb292b9!==_0x5c2c('0x5f')){logger[_0x5c2c('0x13')]('['+[_0xb292b9['toUpperCase']()]+']',_0x5c2c('0x6a'));emit(_0x3ef588[_0x5c2c('0x56')],_0x1cf716[_0x5c2c('0x3c')],_0x3dcc53['ticketId']);}})[_0x5c2c('0x22')](function(_0x5b14f7){logger[_0x5c2c('0x15')]('['+[_0xb292b9['toUpperCase']()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0x5c2c('0x6b')](_0x5b14f7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfb2b=['],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','userId','adminEmail',']\x20using\x20admin\x20profile','POST','user','endUserNumber','true','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','endUserId','],\x20createEndUser\x20crm','forEach','includes','string','picklist','type','nameField','toLowerCase','toString','idField','content','variableName','customField','customVariable','Variable','name','incident','assign','getString','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','push','all','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','sys_id','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail'];(function(_0x36e963,_0x61d1f9){var _0x5e4971=function(_0x1d1eeb){while(--_0x1d1eeb){_0x36e963['push'](_0x36e963['shift']());}};_0x5e4971(++_0x61d1f9);}(_0xfb2b,0x121));var _0xbfb2=function(_0x3923d4,_0x41d061){_0x3923d4=_0x3923d4-0x0;var _0x3179ed=_0xfb2b[_0x3923d4];return _0x3179ed;};'use strict';var _=require(_0xbfb2('0x0'));var Promise=require('bluebird');var rp=require(_0xbfb2('0x1'));var util=require('util');var md5=require(_0xbfb2('0x2'));var Redis=require(_0xbfb2('0x3'));var intUtil=require(_0xbfb2('0x4'));var config=require(_0xbfb2('0x5'));var logger=require(_0xbfb2('0x6'))(_0xbfb2('0x7'));config[_0xbfb2('0x8')]=_[_0xbfb2('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xbfb2('0xa'))(new Redis(config[_0xbfb2('0x8')]));function getAdminUser(_0xc56711,_0xd4e3c7,_0x4cd42a,_0x3c4ae4,_0x3d8bd2,_0x2fe9de){return new Promise(function(_0x1e25b4,_0x5f2f7f){var _0x3fb5f7={'method':_0xbfb2('0xb'),'uri':_0x3c4ae4+_0xbfb2('0xc')+'&'+_0x3d8bd2+'&'+_0x2fe9de,'auth':_0xd4e3c7,'json':!![]};return rp(_0x3fb5f7)[_0xbfb2('0xd')](function(_0x168b2d){if(_0x168b2d['result'][_0xbfb2('0xe')]>0x0){_0x4cd42a[_0xbfb2('0xf')]=_0x168b2d[_0xbfb2('0x10')][0x0][_0xbfb2('0x11')];}logger[_0xbfb2('0x12')]('['+[_0xc56711[_0xbfb2('0x13')]()]+'],\x20getAdminUser\x20crm',_0x4cd42a);_0x1e25b4(_0x4cd42a);})[_0xbfb2('0x14')](function(_0x28ebe3){logger[_0xbfb2('0x15')]('['+[_0xc56711[_0xbfb2('0x13')]()]+']',_0x28ebe3['message']);_0x5f2f7f(_0x28ebe3[_0xbfb2('0x16')]);});});}function getUser(_0x2b27aa,_0x4dda27,_0x26b9ea,_0x4e049d,_0x1c8eca){return function(_0x1cbfbc){logger[_0xbfb2('0x12')]('['+[_0x2b27aa['toUpperCase']()]+_0xbfb2('0x17'),_0x1cbfbc);return new Promise(function(_0x1bd69a,_0x285ee0){if(intUtil[_0xbfb2('0x18')](_0x1cbfbc[_0xbfb2('0x19')])){var _0x2512c7={'method':_0xbfb2('0xb'),'uri':_0x26b9ea+'sys_user?sysparm_query=email%3D'+_0x1cbfbc[_0xbfb2('0x19')]+'&'+_0x4e049d+'&'+_0x1c8eca,'auth':_0x4dda27,'json':!![]};logger['info']('['+[_0x2b27aa[_0xbfb2('0x13')]()]+_0xbfb2('0x1a'),_0x2512c7);return rp(_0x2512c7)[_0xbfb2('0xd')](function(_0x481de8){logger[_0xbfb2('0x12')]('['+[_0x2b27aa['toUpperCase']()]+_0xbfb2('0x1b'),_0x481de8);if(_0x481de8[_0xbfb2('0x10')][_0xbfb2('0xe')]>0x0&&String(_0x481de8[_0xbfb2('0x10')][0x0]['active'])==='true'){_0x1cbfbc[_0xbfb2('0x1c')]=_0x481de8[_0xbfb2('0x10')][0x0][_0xbfb2('0x11')];}else{_0x1cbfbc[_0xbfb2('0x1c')]=_0x1cbfbc[_0xbfb2('0xf')];_0x1cbfbc['userEmail']=_0x1cbfbc[_0xbfb2('0x1d')];}logger[_0xbfb2('0x12')]('['+[_0x2b27aa[_0xbfb2('0x13')]()]+'],\x20getUser\x20crm',_0x1cbfbc);_0x1bd69a(_0x1cbfbc);})[_0xbfb2('0x14')](function(_0x4ea012){logger[_0xbfb2('0x15')]('['+[_0x2b27aa[_0xbfb2('0x13')]()]+']',_0x4ea012['message']);_0x285ee0(_0x4ea012[_0xbfb2('0x16')]);});}else{logger[_0xbfb2('0x12')]('['+[_0x2b27aa[_0xbfb2('0x13')]()]+_0xbfb2('0x1e'));_0x1cbfbc[_0xbfb2('0x1c')]=_0x1cbfbc['adminId'];_0x1cbfbc[_0xbfb2('0x19')]=_0x1cbfbc[_0xbfb2('0x1d')];_0x1bd69a(_0x1cbfbc);}});};}function createEndUser(_0x1c003a,_0x59dc8d,_0x32b07d,_0x2491f1,_0x250953){logger[_0xbfb2('0x12')]('['+[_0x1c003a[_0xbfb2('0x13')]()]+'],\x20createEndUser\x20input\x20crm',_0x32b07d);return new Promise(function(_0x4d3be1,_0x1af2ed){var _0xdbdfa4={'method':_0xbfb2('0x1f'),'uri':_0x2491f1+'sys_user?'+_0x250953,'body':{'user_name':_0x32b07d['endUserNumber'],'roles':_0xbfb2('0x20'),'first_name':_0x32b07d[_0xbfb2('0x21')],'active':_0xbfb2('0x22'),'date_format':_0xbfb2('0x23'),'phone':_0x32b07d[_0xbfb2('0x21')]},'auth':_0x59dc8d,'json':!![]};return rp(_0xdbdfa4)['then'](function(_0x135104){logger[_0xbfb2('0x12')]('['+[_0x1c003a[_0xbfb2('0x13')]()]+_0xbfb2('0x24'),_0x135104[_0xbfb2('0x10')]);_0x32b07d['endUserId']=_0x135104['result'][_0xbfb2('0x11')];_0x4d3be1(_0x32b07d);})[_0xbfb2('0x14')](function(_0x7c7802){logger['error']('['+[_0x1c003a[_0xbfb2('0x13')]()]+']',_0x7c7802[_0xbfb2('0x16')]);_0x1af2ed(_0x7c7802[_0xbfb2('0x16')]);});});}function getEndUser(_0x5b7e4f,_0x387f94,_0xdede98,_0x2070d4,_0xc96532){return function(_0x4d9e84){logger[_0xbfb2('0x12')]('['+[_0x5b7e4f[_0xbfb2('0x13')]()]+_0xbfb2('0x25'),_0x4d9e84);return new Promise(function(_0xeb49af,_0xba8cba){var _0x437cc6={'method':_0xbfb2('0xb'),'uri':_0xdede98+'sys_user?sysparm_query=phone%3D'+_0x4d9e84[_0xbfb2('0x21')]+'&'+_0x2070d4+'&'+_0xc96532,'auth':_0x387f94,'json':!![]};return rp(_0x437cc6)[_0xbfb2('0xd')](function(_0x2246c8){if(_0x2246c8[_0xbfb2('0x10')][_0xbfb2('0xe')]>0x0){_0x4d9e84[_0xbfb2('0x26')]=_0x2246c8[_0xbfb2('0x10')][0x0][_0xbfb2('0x11')];logger[_0xbfb2('0x12')]('['+[_0x5b7e4f[_0xbfb2('0x13')]()]+'],\x20getEndUser\x20crm',_0x4d9e84);_0xeb49af(_0x4d9e84);}else{return createEndUser(_0x5b7e4f,_0x387f94,_0x4d9e84,_0xdede98,_0x2070d4)[_0xbfb2('0xd')](function(_0x5bc14c){logger[_0xbfb2('0x12')]('['+[_0x5b7e4f['toUpperCase']()]+_0xbfb2('0x27'),_0x5bc14c);_0xeb49af(_0x5bc14c);});}})['catch'](function(_0x58e3ff){logger['error']('['+[_0x5b7e4f[_0xbfb2('0x13')]()]+']',_0x58e3ff[_0xbfb2('0x16')]);_0xba8cba(_0x58e3ff[_0xbfb2('0x16')]);});});};}function getCustomFields(_0x174894,_0x205c07){var _0x22e9a4={};if(_0x174894[_0xbfb2('0xe')]>0x0){_[_0xbfb2('0x28')](_0x174894,function(_0x40987e){if(_[_0xbfb2('0x29')]([_0xbfb2('0x2a'),_0xbfb2('0x2b')],_0x40987e[_0xbfb2('0x2c')])&&_0x40987e[_0xbfb2('0x2d')]&&!_0x40987e['customField']){_0x22e9a4[_0x40987e[_0xbfb2('0x2d')][_0xbfb2('0x2e')]()]=_0x40987e['content'][_0xbfb2('0x2f')]();}else if(_[_0xbfb2('0x29')]([_0xbfb2('0x2a'),_0xbfb2('0x2b')],_0x40987e[_0xbfb2('0x2c')])&&_0x40987e[_0xbfb2('0x30')]&&_0x40987e['customField']){_0x22e9a4[_0x40987e[_0xbfb2('0x30')][_0xbfb2('0x2e')]()]=_0x40987e[_0xbfb2('0x31')][_0xbfb2('0x2f')]();}else if(_0x40987e[_0xbfb2('0x2c')]==='variable'&&_0x40987e[_0xbfb2('0x32')]&&_0x40987e[_0xbfb2('0x30')]&&_0x40987e[_0xbfb2('0x33')]){_0x22e9a4[_0x40987e[_0xbfb2('0x30')][_0xbfb2('0x2e')]()]=_0x205c07[_0x40987e['variableName']][_0xbfb2('0x2f')]();}else if(_0x40987e[_0xbfb2('0x2c')]===_0xbfb2('0x34')&&_0x40987e[_0xbfb2('0x35')]&&_0x40987e['Variable'][_0xbfb2('0x36')]&&_0x40987e['idField']&&_0x40987e['customField']){_0x22e9a4[_0x40987e[_0xbfb2('0x30')][_0xbfb2('0x2e')]()]=_0x205c07[_0x40987e[_0xbfb2('0x35')][_0xbfb2('0x36')]['toLowerCase']()][_0xbfb2('0x2f')]();}});}return _0x22e9a4;}function getTicket(_0x2615bb,_0x148648,_0x223e53,_0x3f7d31,_0x2533cf,_0x2f4a98){return function(_0x3698fe){logger[_0xbfb2('0x12')]('['+[_0x2615bb[_0xbfb2('0x13')]()]+']\x20getTicket\x20input\x20crm',_0x3698fe);return new Promise(function(_0x3615a8,_0x54e83c){var _0x3a28e2=_0x2615bb[_0xbfb2('0x2e')]()==='outbound'?_0x3698fe[_0xbfb2('0x1c')]:_0x3698fe[_0xbfb2('0x26')];var _0x6670b6={'method':_0xbfb2('0x1f'),'uri':_0x223e53+_0xbfb2('0x37')+'?'+_0x2f4a98,'body':Object[_0xbfb2('0x38')]({},{'active':_0xbfb2('0x22'),'caller_id':_0x3a28e2,'assigned_to':_0x3698fe[_0xbfb2('0x1c')],'short_description':intUtil[_0xbfb2('0x39')](_0x3f7d31[_0xbfb2('0x3a')],_0x2533cf,'\x20'),'description':intUtil[_0xbfb2('0x39')](_0x3f7d31['Descriptions'],_0x2533cf,'\x0a')},getCustomFields(_0x3f7d31[_0xbfb2('0x3b')],_0x2533cf)),'auth':_0x148648,'json':!![]};return rp(_0x6670b6)[_0xbfb2('0xd')](function(_0x12540a){logger[_0xbfb2('0x12')]('['+[_0x2615bb['toUpperCase']()]+_0xbfb2('0x3c'),_0x12540a[_0xbfb2('0x10')]);_0x3698fe[_0xbfb2('0x3d')]=_0x12540a[_0xbfb2('0x10')]['sys_id'];_0x3698fe[_0xbfb2('0x3e')]=_0x12540a['result'][_0xbfb2('0x3f')];logger[_0xbfb2('0x12')]('['+[_0x2615bb[_0xbfb2('0x13')]()]+_0xbfb2('0x40'),_0x3698fe);_0x3615a8(_0x3698fe);})['catch'](function(_0x4b9bfc){logger['error']('['+[_0x2615bb[_0xbfb2('0x13')]()]+']',_0x4b9bfc[_0xbfb2('0x16')]);_0x54e83c(_0x4b9bfc[_0xbfb2('0x16')]);});});};}function createRemoteTag(_0x21d7fc,_0x40b0f3,_0x3a421b,_0x396b96){return new Promise(function(_0x43c9e5,_0x3e2743){var _0x4746dc={'method':'POST','uri':_0x3a421b+_0xbfb2('0x41')+'?'+_0x396b96,'body':{'short_description':_0x21d7fc,'global':!![],'active':!![],'name':_0x21d7fc},'auth':_0x40b0f3,'json':!![]};return rp(_0x4746dc)[_0xbfb2('0xd')](function(_0x42e051){var _0x4e6faf=_0x42e051['result'][_0xbfb2('0x11')];_0x43c9e5(_0x4e6faf);});});}function getRemoteTag(_0x1fb20c,_0x27f319,_0xd5f5e,_0x5188ec,_0xe3a5ae){return new Promise(function(_0x15f517,_0x5c14e1){var _0x2e5615={'method':'GET','uri':_0xd5f5e+_0xbfb2('0x41')+_0xbfb2('0x42')+_0x1fb20c+'&'+_0x5188ec,'auth':_0x27f319,'json':!![]};return rp(_0x2e5615)[_0xbfb2('0xd')](function(_0x5547f4){if(_0x5547f4[_0xbfb2('0x10')][_0xbfb2('0xe')]>0x0){var _0x1316ba=_0x5547f4[_0xbfb2('0x10')][0x0]['sys_id'];_0x15f517(_0x1316ba);}else{return createRemoteTag(_0x1fb20c,_0x27f319,_0xd5f5e,_0x5188ec)[_0xbfb2('0xd')](function(_0x16f618){_0x15f517(_0x16f618);});}});});}function assignTagToIncident(_0x35dab0,_0x2882c5,_0x10c4fe,_0x34c957,_0x274ad4){return new Promise(function(_0x56e7ad,_0x3e19ed){var _0x122165={'method':_0xbfb2('0x1f'),'uri':_0x10c4fe+_0xbfb2('0x43')+'?'+_0x274ad4,'body':{'label':_0x35dab0,'table':_0xbfb2('0x37'),'id_type':_0xbfb2('0x44'),'table_key':_0x34c957[_0xbfb2('0x3d')],'title':'Incident\x20-\x20'+_0x34c957[_0xbfb2('0x3e')],'id_display':_0x34c957[_0xbfb2('0x3e')]},'auth':_0x2882c5,'json':!![]};return rp(_0x122165)[_0xbfb2('0xd')](function(_0x477237){_0x56e7ad();})[_0xbfb2('0x14')](function(){_0x56e7ad();});});}function manageTags(_0xc79fc4,_0x277fee,_0x4cc795,_0x2d9e21,_0x5155d6,_0x8cf9d5,_0x1ff72d){return new Promise(function(_0x3a1874,_0x17ed0a){var _0x3a3c41=[];_0x277fee[_0xbfb2('0x28')](function(_0x170cd9){_0x3a3c41[_0xbfb2('0x45')](getRemoteTag(_0x170cd9,_0x4cc795,_0x2d9e21,_0x8cf9d5,_0x1ff72d));});return Promise[_0xbfb2('0x46')](_0x3a3c41)[_0xbfb2('0xd')](function(_0x5719c0){if(_0x5719c0[_0xbfb2('0xe')]){logger['info']('['+[_0xc79fc4[_0xbfb2('0x13')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x5719c0);var _0x20ddc1=[];_0x5719c0[_0xbfb2('0x28')](function(_0x3c68cd){_0x20ddc1[_0xbfb2('0x45')](assignTagToIncident(_0x3c68cd,_0x4cc795,_0x2d9e21,_0x5155d6,_0x8cf9d5));});return Promise['all'](_0x20ddc1)[_0xbfb2('0xd')](function(){_0x3a1874();})['catch'](function(){_0x3a1874();});}else{_0x3a1874();}});});}function getTags(_0x53f41f,_0x5a96c9,_0x3d84e0,_0x3ff4f4,_0x476d38,_0x2d25ba){return function(_0x2fa148){return new Promise(function(_0x139a59,_0x8a2de){var _0xae1869=[];var _0x5e0695=_0x3ff4f4['Tags'];if(_0x5e0695&&_0x5e0695[_0xbfb2('0xe')]>0x0){_0xae1869=_[_0xbfb2('0x47')](_0x5e0695,'name');}if(_0xae1869[_0xbfb2('0xe')]>0x0){return manageTags(_0x53f41f,_0xae1869,_0x5a96c9,_0x3d84e0,_0x2fa148,_0x476d38,_0x2d25ba)[_0xbfb2('0xd')](function(){_0x139a59(_0x2fa148);});}else{_0x139a59(_0x2fa148);}});};}function emit(_0x538479,_0x27287c,_0xcfef5f){var _0x13baa7=_0xbfb2('0x48')+_0xbfb2('0x49')+_0xbfb2('0x4a')+'%255EORDERBYDESCnumber';var _0x7779d9={'uri':_0x538479+_0xbfb2('0x4b')+_0xcfef5f+_0x13baa7};io['to'](util[_0xbfb2('0x4c')]('user:%s',_0x27287c))[_0xbfb2('0x4d')](_0xbfb2('0x4e'),_0x7779d9);}exports['cs']=function(_0x28b3af,_0x1e4509,_0x180195,_0x3eeed2,_0x330810,_0x4b80a9,_0x18c837,_0x15f80c){var _0x1da73d={};var _0xa75515={'user':_0x4b80a9[_0xbfb2('0x4f')],'pass':_0x4b80a9[_0xbfb2('0x50')]};var _0x44de6d=_0xbfb2('0x51');var _0x392dea='sysparm_display_value=true';_0x4b80a9[_0xbfb2('0x52')]=intUtil[_0xbfb2('0x53')](_0x4b80a9[_0xbfb2('0x52')]);_0x4b80a9[_0xbfb2('0x54')]=intUtil['stripTrailingSlash'](_0x4b80a9['serverUrl']);var _0x563c5a=util[_0xbfb2('0x4c')](_0xbfb2('0x55'),_0x4b80a9[_0xbfb2('0x52')]);_0x1da73d[_0xbfb2('0x19')]=!_[_0xbfb2('0x56')](_0x3eeed2)?_0x3eeed2[_0xbfb2('0x57')]:null;_0x1da73d[_0xbfb2('0x1d')]=_0x4b80a9[_0xbfb2('0x57')];_0x1da73d[_0xbfb2('0x21')]=_0x15f80c[_0xbfb2('0x2e')]()==='outbound'?_0x1e4509[_0xbfb2('0x58')]:_0x1e4509[_0xbfb2('0x59')];_0x1da73d[_0xbfb2('0x5a')]=_0x15f80c==='queue'||_0x15f80c===_0xbfb2('0x5b')?'queue':_0xbfb2('0x5c');var _0x35c717=util[_0xbfb2('0x4c')](_0xbfb2('0x5d'),_0x4b80a9[_0xbfb2('0x54')],_0x1e4509['uniqueid'],md5(_0x1e4509['uniqueid']));if(_0x330810&&_0x330810[_0xbfb2('0x5e')]){logger[_0xbfb2('0x12')](_0xbfb2('0x5f'),'Recording\x20is\x20enabled!');_0x1e4509[_0xbfb2('0x60')]=_0x35c717;}else if(_0x18c837&&_0x18c837['recordingFormat']&&_0x18c837[_0xbfb2('0x61')]!==_0xbfb2('0x62')){logger[_0xbfb2('0x12')](_0xbfb2('0x63'),'Recording\x20is\x20enabled!');_0x1e4509['recordingURL']=_0x35c717;}else{_0x1e4509['recordingURL']='';}return getAdminUser(_0x15f80c,_0xa75515,_0x1da73d,_0x563c5a,_0x392dea,_0x44de6d)[_0xbfb2('0xd')](getUser(_0x15f80c,_0xa75515,_0x563c5a,_0x392dea,_0x44de6d))[_0xbfb2('0xd')](getEndUser(_0x15f80c,_0xa75515,_0x563c5a,_0x392dea,_0x44de6d))[_0xbfb2('0xd')](getTicket(_0x15f80c,_0xa75515,_0x563c5a,_0x180195,_0x1e4509,_0x392dea))[_0xbfb2('0xd')](function(_0x5ebd7c){logger['info'](util[_0xbfb2('0x4c')](_0xbfb2('0x64'),_0x5ebd7c['ticketId']));logger['info'](util['format'](_0xbfb2('0x65'),_0x15f80c));if(_0x15f80c!==_0xbfb2('0x5b')){logger[_0xbfb2('0x12')]('['+[_0x15f80c['toUpperCase']()]+']',_0xbfb2('0x66'));emit(_0x4b80a9[_0xbfb2('0x52')],_0x3eeed2[_0xbfb2('0x36')],_0x5ebd7c[_0xbfb2('0x3d')]);}})[_0xbfb2('0x14')](function(_0x810dd6){logger[_0xbfb2('0x15')]('['+[_0x15f80c['toUpperCase']()]+_0xbfb2('0x67'),util[_0xbfb2('0x68')](_0x810dd6,{'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 a94663d..44fc679 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 _0x372b=['emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','description','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','name','forEach','variableName','push','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','user_name','then','length','find','entry_list','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','debug','[HTTP]','merge','map','type','customField','nameField','toLowerCase','string','custom_fields','idField','content','variable','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','unmanaged','lastevent','calleridname','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST'];(function(_0x1b75a1,_0x27c30a){var _0x189b8e=function(_0x6259e7){while(--_0x6259e7){_0x1b75a1['push'](_0x1b75a1['shift']());}};_0x189b8e(++_0x27c30a);}(_0x372b,0xe9));var _0xb372=function(_0x32e570,_0x13ed27){_0x32e570=_0x32e570-0x0;var _0x251675=_0x372b[_0x32e570];return _0x251675;};'use strict';var _=require(_0xb372('0x0'));var rp=require(_0xb372('0x1'));var BPromise=require(_0xb372('0x2'));var md5=require(_0xb372('0x3'));var util=require(_0xb372('0x4'));var Redis=require(_0xb372('0x5'));var intUtil=require(_0xb372('0x6'));var config=require('../../../../config/environment');var logger=require(_0xb372('0x7'))(_0xb372('0x8'));config[_0xb372('0x9')]=_['defaults'](config['redis'],{'host':_0xb372('0xa'),'port':0x18eb});var io=require(_0xb372('0xb'))(new Redis(config[_0xb372('0x9')]));var def={'method':_0xb372('0xc'),'json':!![]};function emit(_0x54622d,_0x12a900,_0x3e8ab8){io['to'](_0x54622d)[_0xb372('0xd')](_0x12a900,_0x3e8ab8);}function getTicket(_0x40fdd2,_0x5b4b4e,_0x3deb2d,_0x454bcc,_0x187dc7,_0x41c299,_0xd7a92d,_0x75239c){logger[_0xb372('0xe')](_0xb372('0xf'));var _0x5f8170=new Date();var _0x5b6022=[{'name':'name','value':intUtil[_0xb372('0x10')](_0x454bcc[_0xb372('0x11')],_0x187dc7,'\x20')},{'name':_0xb372('0x12'),'value':_0x5b4b4e['id']},{'name':'created_by','value':_0x5b4b4e['id']},{'name':_0xb372('0x13'),'value':intUtil[_0xb372('0x10')](_0x454bcc[_0xb372('0x14')],_0x187dc7,'\x0a')},{'name':_0xb372('0x15'),'value':_0x5f8170[_0xb372('0x16')]()[_0xb372('0x17')](0x0,0x13)['replace']('T','\x20')},{'name':_0xb372('0x18'),'value':'0'},{'name':_0xb372('0x19'),'value':'15'},{'name':_0xb372('0x1a'),'value':_0x3deb2d['id']},{'name':_0xb372('0x1b'),'value':_0xb372('0x1c')},{'name':'parent_name','value':_0x3deb2d[_0xb372('0x1d')]},{'name':'direction','value':_0x75239c}];if(_0x41c299['length']){_[_0xb372('0x1e')](_0x41c299,function(_0x72808){if(_0x187dc7[_0x72808[_0xb372('0x1f')]]){_0x5b6022[_0xb372('0x20')]({'name':_0x72808['idField'],'value':_0x187dc7[_0x72808[_0xb372('0x1f')]]});}});}return request({'form':{'method':'set_entry','input_type':_0xb372('0x21'),'response_type':_0xb372('0x21'),'rest_data':JSON[_0xb372('0x22')]({'session':_0xd7a92d['id'],'module_name':_0xb372('0x23'),'name_value_list':_0x5b6022})}});}function getAuth(_0x5ecc5e){return util[_0xb372('0x24')](_0xb372('0x25'),new Buffer(_0x5ecc5e[_0xb372('0x26')]+':X')[_0xb372('0x27')](_0xb372('0x28')));}function getServerInfo(_0x14346f){return request({'form':{'method':_0xb372('0x29'),'input_type':_0xb372('0x21'),'response_type':_0xb372('0x21'),'rest_data':JSON[_0xb372('0x22')]({'session':_0x14346f['id']})}});}function getUser(_0x151ab9,_0x2e6bb0,_0x430f57){if(!_[_0xb372('0x2a')](_0x2e6bb0)){logger[_0xb372('0xe')](_0xb372('0x2b'),_0x2e6bb0);return request({'form':{'method':'get_entry_list','input_type':_0xb372('0x21'),'response_type':'JSON','rest_data':JSON[_0xb372('0x22')]({'session':_0x430f57['id'],'module_name':_0xb372('0x2c'),'query':util[_0xb372('0x24')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x2e6bb0),'order_by':'','offset':'0','select_fields':['id',_0xb372('0x1d'),_0xb372('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb372('0x2e')](function(_0x2388d3){if(_0x2388d3['entry_list'][_0xb372('0x2f')]){var _0x5b12e3=_[_0xb372('0x30')](_0x2388d3[_0xb372('0x31')],function(_0x4822f3){return _0x4822f3['name_value_list'][_0xb372('0x2d')][_0xb372('0x32')]===_0x2e6bb0;});if(_0x5b12e3){logger[_0xb372('0xe')](_0xb372('0x33'));return BPromise[_0xb372('0x34')]({'id':_0x5b12e3[_0xb372('0x35')]['id']['value'],'name':_0x5b12e3[_0xb372('0x35')][_0xb372('0x1d')]['value']});}}logger[_0xb372('0xe')](_0xb372('0x36'));return BPromise[_0xb372('0x34')]({'id':_0x430f57[_0xb372('0x35')][_0xb372('0x37')][_0xb372('0x32')],'name':_0x430f57[_0xb372('0x35')][_0xb372('0x2d')][_0xb372('0x32')]});});}else{logger['info'](_0xb372('0x38'));return BPromise[_0xb372('0x34')]({'id':_0x430f57[_0xb372('0x35')][_0xb372('0x37')]['value'],'name':_0x430f57[_0xb372('0x35')][_0xb372('0x2d')][_0xb372('0x32')]});}}function getEndUser(_0x2bbf7c,_0xb31cda,_0x3873f4,_0x497632){logger[_0xb372('0xe')](_0xb372('0x39'),_0x3873f4);return request({'form':{'method':'get_entry_list','input_type':_0xb372('0x21'),'response_type':_0xb372('0x21'),'rest_data':JSON['stringify']({'session':_0x497632['id'],'module_name':'Contacts','query':util[_0xb372('0x24')](_0xb372('0x3a'),_0x3873f4),'order_by':'','offset':'0','select_fields':['id',_0xb372('0x1d'),_0xb372('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x498ed5){if(_0x498ed5['entry_list'][_0xb372('0x2f')]){var _0x4e7af8=_[_0xb372('0x30')](_0x498ed5[_0xb372('0x31')],function(_0x4955ba){return _0x4955ba[_0xb372('0x35')][_0xb372('0x3b')][_0xb372('0x32')]===_0x3873f4;});if(_0x4e7af8){logger['info'](_0xb372('0x3c'));return BPromise[_0xb372('0x34')]({'id':_0x4e7af8[_0xb372('0x35')]['id'][_0xb372('0x32')],'name':_0x4e7af8[_0xb372('0x35')][_0xb372('0x1d')][_0xb372('0x32')],'phone':_0x4e7af8[_0xb372('0x35')][_0xb372('0x3b')][_0xb372('0x32')]});}}else{logger[_0xb372('0xe')](_0xb372('0x3d'));return request({'form':{'method':_0xb372('0x3e'),'input_type':_0xb372('0x21'),'response_type':_0xb372('0x21'),'rest_data':JSON[_0xb372('0x22')]({'session':_0x497632['id'],'module_name':_0xb372('0x1c'),'name_value_list':[{'name':_0xb372('0x3f'),'value':_0xb31cda!==_0xb372('0x40')?_0xb31cda:util['format']('Caller\x20-\x20%s',_0x3873f4)},{'name':_0xb372('0x3b'),'value':_0x3873f4}]})}})['then'](function(_0x5cafab){logger[_0xb372('0xe')]('Enduser\x20created.');return BPromise[_0xb372('0x34')]({'id':_0x5cafab['id'],'name':_0x5cafab[_0xb372('0x31')][_0xb372('0x3f')][_0xb372('0x32')],'phone':_0x5cafab['entry_list']['phone_home'][_0xb372('0x32')]});});}});}function request(_0x28913f){logger[_0xb372('0x41')](_0xb372('0x42'),JSON['stringify'](_0x28913f));return rp(_[_0xb372('0x43')](def,_0x28913f));}function getTags(_0x50ff6d,_0x3d9db4){var _0x3f46b5=[];if(_0x50ff6d&&_0x50ff6d[_0xb372('0x2f')]>0x0){_0x3f46b5=_[_0xb372('0x44')](_0x50ff6d,_0x3d9db4);}return _0x3f46b5;}function getCustomFields(_0x2b28b4,_0x5c849d){var _0xf05ed9=[];var _0x434a51={'custom_fields':[]};if(_0x2b28b4['length']>0x0){_[_0xb372('0x1e')](_0x2b28b4,function(_0x1c2ecb){if(_0x1c2ecb[_0xb372('0x45')]==='string'&&_0x1c2ecb['nameField']&&!_0x1c2ecb[_0xb372('0x46')]){_0x434a51[_0x1c2ecb[_0xb372('0x47')][_0xb372('0x48')]()]=_0x1c2ecb['content'][_0xb372('0x27')]();}else if(_0x1c2ecb['type']===_0xb372('0x49')&&_0x1c2ecb['idField']&&_0x1c2ecb[_0xb372('0x46')]){_0x434a51[_0xb372('0x4a')][_0xb372('0x20')]({'id':_0x1c2ecb[_0xb372('0x4b')],'value':_0x1c2ecb[_0xb372('0x4c')][_0xb372('0x27')]()});}else if(_0x1c2ecb[_0xb372('0x45')]===_0xb372('0x4d')&&_0x1c2ecb[_0xb372('0x1f')]&&_0x1c2ecb[_0xb372('0x4b')]&&_0x1c2ecb['customField']){_0x5c849d[_0x1c2ecb['variableName']]&&_0x434a51[_0xb372('0x4a')]['push']({'id':_0x1c2ecb[_0xb372('0x4b')],'value':_0x5c849d[_0x1c2ecb[_0xb372('0x1f')]][_0xb372('0x27')]()});}else if(_0x1c2ecb[_0xb372('0x45')]===_0xb372('0x4e')&&_0x1c2ecb[_0xb372('0x4f')]&&_0x1c2ecb[_0xb372('0x4f')][_0xb372('0x1d')]&&_0x1c2ecb[_0xb372('0x4b')]&&_0x1c2ecb['customField']){_0x5c849d[_0x1c2ecb[_0xb372('0x4f')][_0xb372('0x1d')][_0xb372('0x48')]()]&&_0x434a51[_0xb372('0x4a')]['push']({'id':_0x1c2ecb[_0xb372('0x4b')],'value':_0x5c849d[_0x1c2ecb[_0xb372('0x4f')][_0xb372('0x1d')]['toLowerCase']()][_0xb372('0x27')]()});}});}return _0x434a51;}function getConnection(_0x29646c){return request({'method':_0xb372('0xc'),'form':{'method':_0xb372('0x50'),'input_type':_0xb372('0x21'),'response_type':_0xb372('0x21'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x29646c[_0xb372('0x51')],'password':_0x29646c['password'],'encryption':_0xb372('0x52')},'application':_0xb372('0x53')})}})[_0xb372('0x2e')](function(_0x5c4b73){var _0x44609d=_0x5c4b73;if(_0x44609d['id']){def['sessionID']=_0x44609d['id'];return BPromise[_0xb372('0x34')](_0x44609d);}else{throw new Error(util[_0xb372('0x24')](_0xb372('0x54'),_0x29646c['id']));}});}function setRelationship(_0x1e254b,_0x3e6190,_0x335d87,_0x3f9fba){return request({'form':{'method':_0xb372('0x55'),'input_type':_0xb372('0x21'),'response_type':_0xb372('0x21'),'rest_data':JSON[_0xb372('0x22')]({'session':_0x1e254b['id'],'module_name':_0xb372('0x23'),'module_id':_0x335d87['id'],'link_field_name':_0x3f9fba,'related_ids':[_0x3e6190['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xb372('0x56')]=function(_0xfe2717,_0x4f990e,_0x56b38a,_0x114e56,_0x36ba92,_0x4c6db7){var _0x4d6b5d,_0x134869,_0x548861,_0x3a5853;_0x4c6db7[_0xb372('0x57')]=intUtil[_0xb372('0x58')](_0x4c6db7[_0xb372('0x57')]);_0x4c6db7[_0xb372('0x59')]=intUtil[_0xb372('0x58')](_0x4c6db7[_0xb372('0x59')]);def[_0xb372('0x5a')]=util[_0xb372('0x24')](_0xb372('0x5b'),_0x4c6db7['remoteUri']);if(_0x36ba92&&_0x36ba92[_0xb372('0x5c')]){logger[_0xb372('0xe')](_0xb372('0x5d'),_0xb372('0x5e'));_0x4f990e['recordingURL']=util[_0xb372('0x24')](_0xb372('0x5f'),_0x4c6db7['serverUrl'],_0x4f990e[_0xb372('0x60')],md5(_0x4f990e['uniqueid']));}else{_0x4f990e[_0xb372('0x61')]='';}return getConnection(_0x4c6db7)[_0xb372('0x2e')](function(_0x2aa30f){_0x3a5853=_0x2aa30f;return getUser(_0x4c6db7,_0x114e56[_0xb372('0x1d')],_0x3a5853);})[_0xb372('0x2e')](function(_0x5adc89){_0x4d6b5d=_0x5adc89;logger[_0xb372('0xe')]('The\x20User\x20ID\x20is:',_0x4d6b5d['id']);return getEndUser(_0x4c6db7,_0x4f990e['calleridname'],_0x4f990e[_0xb372('0x62')],_0x3a5853);})['then'](function(_0x2d73cc){_0x134869=_0x2d73cc;logger['info'](_0xb372('0x63'),_0x134869['id']);return getTicket(_0x4c6db7,_0x4d6b5d,_0x134869,_0x56b38a,_0x4f990e,_0x56b38a[_0xb372('0x64')],_0x3a5853,_0xb372('0x65'));})[_0xb372('0x2e')](function(_0x13b6d5){_0x548861=_0x13b6d5;logger['info'](_0xb372('0x66'));logger[_0xb372('0xe')](_0xb372('0x67'),_0x548861['id']);return setRelationship(_0x3a5853,_0x4d6b5d,_0x548861,_0xb372('0x68'));})['then'](function(){return setRelationship(_0x3a5853,_0x134869,_0x548861,_0xb372('0x69'));})[_0xb372('0x2e')](function(){return getServerInfo(_0x3a5853);})[_0xb372('0x2e')](function(_0xfcb05d){var _0x54cc77=parseInt(_0xfcb05d[_0xb372('0x6a')][_0xb372('0x6b')](0x0));var _0x79305=util[_0xb372('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4c6db7[_0xb372('0x57')],_0x548861['id']);if(_0x54cc77>0x6){_0x79305=util[_0xb372('0x24')](_0xb372('0x6c'),_0x4c6db7['remoteUri'],_0x548861['id']);}logger['info'](_0xb372('0x5d'),_0xb372('0x6d'));emit(util[_0xb372('0x24')]('user:%s',_0x114e56[_0xb372('0x1d')]),_0xb372('0x6e'),{'uri':_0x79305});})[_0xb372('0x6f')](function(_0x2ee874){logger[_0xb372('0x70')](_0xb372('0x5d'),JSON[_0xb372('0x22')](_0x2ee874));});};exports['outbound']=function(_0x1156ad,_0x1ef309,_0x2ebca0,_0x1dc39d,_0x4c9655,_0x1da360,_0x4e71a6){var _0x2ddc8c,_0x262a26,_0x207db9,_0x55047a;_0x1da360['remoteUri']=intUtil[_0xb372('0x58')](_0x1da360['remoteUri']);_0x1da360['serverUrl']=intUtil[_0xb372('0x58')](_0x1da360[_0xb372('0x59')]);def['uri']=util[_0xb372('0x24')](_0xb372('0x5b'),_0x1da360['remoteUri']);if(_0x4e71a6&&_0x4e71a6[_0xb372('0x71')]&&_0x4e71a6[_0xb372('0x71')]!=='none'){logger[_0xb372('0xe')](_0xb372('0x72'),_0xb372('0x5e'));_0x1ef309[_0xb372('0x61')]=util[_0xb372('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1da360[_0xb372('0x59')],_0x1ef309[_0xb372('0x60')],md5(_0x1ef309[_0xb372('0x60')]));}return getConnection(_0x1da360)[_0xb372('0x2e')](function(_0x53fba0){_0x55047a=_0x53fba0;return getUser(_0x1da360,_0x1dc39d[_0xb372('0x1d')],_0x55047a);})[_0xb372('0x2e')](function(_0xb54453){_0x2ddc8c=_0xb54453;logger['info'](_0xb372('0x73'),_0x2ddc8c['id']);return getEndUser(_0x1da360,_0x1ef309['destcalleridname'],_0x1ef309[_0xb372('0x74')],_0x55047a);})[_0xb372('0x2e')](function(_0x3dc0a9){_0x262a26=_0x3dc0a9;logger[_0xb372('0xe')]('The\x20Enduser\x20ID\x20is:',_0x262a26['id']);return getTicket(_0x1da360,_0x2ddc8c,_0x262a26,_0x2ebca0,_0x1ef309,_0x2ebca0[_0xb372('0x64')],_0x55047a,'Outbound');})[_0xb372('0x2e')](function(_0x88ffcb){_0x207db9=_0x88ffcb;logger['info']('Ticket\x20created!');logger[_0xb372('0xe')](_0xb372('0x67'),_0x207db9['id']);return setRelationship(_0x55047a,_0x2ddc8c,_0x207db9,_0xb372('0x68'));})['then'](function(){return setRelationship(_0x55047a,_0x262a26,_0x207db9,_0xb372('0x69'));})['then'](function(){return getServerInfo(_0x55047a);})[_0xb372('0x2e')](function(_0x35fd29){var _0x453091=parseInt(_0x35fd29[_0xb372('0x6a')]['charAt'](0x0));var _0x355cdb=util[_0xb372('0x24')](_0xb372('0x75'),_0x1da360['remoteUri'],_0x207db9['id']);if(_0x453091>0x6){_0x355cdb=util[_0xb372('0x24')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1da360[_0xb372('0x57')],_0x207db9['id']);}logger[_0xb372('0xe')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb372('0x24')](_0xb372('0x76'),_0x1dc39d[_0xb372('0x1d')]),'trigger:browser:url',{'uri':_0x355cdb});})[_0xb372('0x6f')](function(_0x5a2089){logger[_0xb372('0x70')](_0xb372('0x72'),JSON[_0xb372('0x22')](_0x5a2089));});};exports[_0xb372('0x77')]=function(_0x269db1,_0x2d2715,_0x211b43,_0x37cd5b,_0x75a767,_0x3f3dd4){var _0x38a46d,_0x35e8a3,_0x55d12f,_0x4e076e;_0x3f3dd4[_0xb372('0x57')]=intUtil[_0xb372('0x58')](_0x3f3dd4[_0xb372('0x57')]);_0x3f3dd4['serverUrl']=intUtil[_0xb372('0x58')](_0x3f3dd4[_0xb372('0x59')]);def[_0xb372('0x5a')]=util[_0xb372('0x24')](_0xb372('0x5b'),_0x3f3dd4['remoteUri']);if(_0x75a767&&_0x75a767['monitor_format']){logger['info']('['+_0x2d2715[_0xb372('0x78')]['toUpperCase']()+']',_0xb372('0x5e'));_0x2d2715[_0xb372('0x61')]=util[_0xb372('0x24')](_0xb372('0x5f'),_0x3f3dd4[_0xb372('0x59')],_0x2d2715[_0xb372('0x60')],md5(_0x2d2715[_0xb372('0x60')]));}else{_0x2d2715[_0xb372('0x61')]='';}return getConnection(_0x3f3dd4)[_0xb372('0x2e')](function(_0x1e103b){_0x4e076e=_0x1e103b;if(!_[_0xb372('0x2a')](_0x37cd5b)){return getUser(_0x3f3dd4,_0x37cd5b[_0xb372('0x1d')],_0x4e076e);}else{return getUser(_0x3f3dd4,null,_0x4e076e);}})[_0xb372('0x2e')](function(_0x32d638){_0x38a46d=_0x32d638;logger[_0xb372('0xe')]('The\x20User\x20ID\x20is:',_0x38a46d['id']);return getEndUser(_0x3f3dd4,_0x2d2715[_0xb372('0x79')],_0x2d2715['calleridnum'],_0x4e076e);})[_0xb372('0x2e')](function(_0x30a013){_0x35e8a3=_0x30a013;logger[_0xb372('0xe')]('The\x20Enduser\x20ID\x20is:',_0x35e8a3['id']);return getTicket(_0x3f3dd4,_0x38a46d,_0x35e8a3,_0x211b43,_0x2d2715,_0x211b43['Fields'],_0x4e076e,_0xb372('0x65'));})[_0xb372('0x2e')](function(_0x3cacf6){_0x55d12f=_0x3cacf6;logger['info'](_0xb372('0x66'));logger[_0xb372('0xe')](_0xb372('0x67'),_0x55d12f['id']);return setRelationship(_0x4e076e,_0x38a46d,_0x55d12f,_0xb372('0x68'));})[_0xb372('0x2e')](function(){return setRelationship(_0x4e076e,_0x35e8a3,_0x55d12f,_0xb372('0x69'));})['then'](function(){return getServerInfo(_0x4e076e);})[_0xb372('0x6f')](function(_0x80595d){logger[_0xb372('0x70')]('['+_0x2d2715[_0xb372('0x78')][_0xb372('0x7a')]()+']',JSON[_0xb372('0x22')](_0x80595d));});}; \ No newline at end of file +var _0x4a75=['users','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','contacts','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','trigger:browser:url','unmanaged','lastevent','toUpperCase','calleridname','Fields','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','getString','Subjects','assigned_user_id','created_by','Descriptions','replace','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','JSON','stringify','Calls','format','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','find','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','idField','custom_fields','content','variable','customVariable','Variable','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:'];(function(_0x5af5e4,_0x4458d0){var _0x48ecdc=function(_0x2055f8){while(--_0x2055f8){_0x5af5e4['push'](_0x5af5e4['shift']());}};_0x48ecdc(++_0x4458d0);}(_0x4a75,0x17d));var _0x54a7=function(_0xf51c06,_0x388e5b){_0xf51c06=_0xf51c06-0x0;var _0x1d5420=_0x4a75[_0xf51c06];return _0x1d5420;};'use strict';var _=require('lodash');var rp=require(_0x54a7('0x0'));var BPromise=require('bluebird');var md5=require(_0x54a7('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x54a7('0x2'));var config=require(_0x54a7('0x3'));var logger=require(_0x54a7('0x4'))(_0x54a7('0x5'));config[_0x54a7('0x6')]=_[_0x54a7('0x7')](config['redis'],{'host':_0x54a7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x54a7('0x6')]));var def={'method':_0x54a7('0x9'),'json':!![]};function emit(_0x253865,_0x4ead46,_0x4e3cae){io['to'](_0x253865)[_0x54a7('0xa')](_0x4ead46,_0x4e3cae);}function getTicket(_0x2359d0,_0x14494a,_0x1512d7,_0x14ebbf,_0x765782,_0x4c1f54,_0x3c2669,_0x4be78a){logger[_0x54a7('0xb')](_0x54a7('0xc'));var _0x578434=new Date();var _0x2e47c3=[{'name':'name','value':intUtil[_0x54a7('0xd')](_0x14ebbf[_0x54a7('0xe')],_0x765782,'\x20')},{'name':_0x54a7('0xf'),'value':_0x14494a['id']},{'name':_0x54a7('0x10'),'value':_0x14494a['id']},{'name':'description','value':intUtil[_0x54a7('0xd')](_0x14ebbf[_0x54a7('0x11')],_0x765782,'\x0a')},{'name':'date_start','value':_0x578434['toISOString']()['slice'](0x0,0x13)[_0x54a7('0x12')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x54a7('0x13'),'value':_0x1512d7['id']},{'name':_0x54a7('0x14'),'value':_0x54a7('0x15')},{'name':_0x54a7('0x16'),'value':_0x1512d7[_0x54a7('0x17')]},{'name':_0x54a7('0x18'),'value':_0x4be78a}];if(_0x4c1f54[_0x54a7('0x19')]){_[_0x54a7('0x1a')](_0x4c1f54,function(_0x1e11c8){if(_0x765782[_0x1e11c8[_0x54a7('0x1b')]]){_0x2e47c3[_0x54a7('0x1c')]({'name':_0x1e11c8['idField'],'value':_0x765782[_0x1e11c8[_0x54a7('0x1b')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON[_0x54a7('0x1e')]({'session':_0x3c2669['id'],'module_name':_0x54a7('0x1f'),'name_value_list':_0x2e47c3})}});}function getAuth(_0x3d00e6){return util[_0x54a7('0x20')]('Basic\x20%s',new Buffer(_0x3d00e6['apiKey']+':X')[_0x54a7('0x21')](_0x54a7('0x22')));}function getServerInfo(_0x11a100){return request({'form':{'method':_0x54a7('0x23'),'input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON['stringify']({'session':_0x11a100['id']})}});}function getUser(_0x27bb44,_0x345d2f,_0x550fec){if(!_[_0x54a7('0x24')](_0x345d2f)){logger['info'](_0x54a7('0x25'),_0x345d2f);return request({'form':{'method':'get_entry_list','input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON[_0x54a7('0x1e')]({'session':_0x550fec['id'],'module_name':_0x54a7('0x26'),'query':util[_0x54a7('0x20')](_0x54a7('0x27'),_0x345d2f),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x54a7('0x28')](function(_0x58977c){if(_0x58977c['entry_list'][_0x54a7('0x19')]){var _0x161b0f=_[_0x54a7('0x29')](_0x58977c[_0x54a7('0x2a')],function(_0x1d10cd){return _0x1d10cd[_0x54a7('0x2b')][_0x54a7('0x2c')][_0x54a7('0x2d')]===_0x345d2f;});if(_0x161b0f){logger['info'](_0x54a7('0x2e'));return BPromise[_0x54a7('0x2f')]({'id':_0x161b0f[_0x54a7('0x2b')]['id'][_0x54a7('0x2d')],'name':_0x161b0f[_0x54a7('0x2b')][_0x54a7('0x17')]['value']});}}logger[_0x54a7('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x54a7('0x2f')]({'id':_0x550fec[_0x54a7('0x2b')]['user_id']['value'],'name':_0x550fec[_0x54a7('0x2b')][_0x54a7('0x2c')][_0x54a7('0x2d')]});});}else{logger[_0x54a7('0xb')](_0x54a7('0x30'));return BPromise[_0x54a7('0x2f')]({'id':_0x550fec[_0x54a7('0x2b')][_0x54a7('0x31')][_0x54a7('0x2d')],'name':_0x550fec[_0x54a7('0x2b')]['user_name']['value']});}}function getEndUser(_0x52b8b9,_0x2d1afa,_0x1c8fb1,_0x1b67ca){logger['info'](_0x54a7('0x32'),_0x1c8fb1);return request({'form':{'method':_0x54a7('0x33'),'input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON[_0x54a7('0x1e')]({'session':_0x1b67ca['id'],'module_name':_0x54a7('0x15'),'query':util[_0x54a7('0x20')](_0x54a7('0x34'),_0x1c8fb1),'order_by':'','offset':'0','select_fields':['id',_0x54a7('0x17'),_0x54a7('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x3a4698){if(_0x3a4698['entry_list'][_0x54a7('0x19')]){var _0x1989e1=_[_0x54a7('0x29')](_0x3a4698[_0x54a7('0x2a')],function(_0x17bfe3){return _0x17bfe3['name_value_list'][_0x54a7('0x35')][_0x54a7('0x2d')]===_0x1c8fb1;});if(_0x1989e1){logger['info']('Enduser\x20found!');return BPromise[_0x54a7('0x2f')]({'id':_0x1989e1[_0x54a7('0x2b')]['id']['value'],'name':_0x1989e1['name_value_list']['name'][_0x54a7('0x2d')],'phone':_0x1989e1['name_value_list'][_0x54a7('0x35')][_0x54a7('0x2d')]});}}else{logger['info'](_0x54a7('0x36'));return request({'form':{'method':_0x54a7('0x37'),'input_type':_0x54a7('0x1d'),'response_type':'JSON','rest_data':JSON[_0x54a7('0x1e')]({'session':_0x1b67ca['id'],'module_name':_0x54a7('0x15'),'name_value_list':[{'name':_0x54a7('0x38'),'value':_0x2d1afa!==''?_0x2d1afa:util[_0x54a7('0x20')]('Caller\x20-\x20%s',_0x1c8fb1)},{'name':_0x54a7('0x35'),'value':_0x1c8fb1}]})}})[_0x54a7('0x28')](function(_0x458177){logger[_0x54a7('0xb')](_0x54a7('0x39'));return BPromise[_0x54a7('0x2f')]({'id':_0x458177['id'],'name':_0x458177['entry_list'][_0x54a7('0x38')][_0x54a7('0x2d')],'phone':_0x458177[_0x54a7('0x2a')][_0x54a7('0x35')][_0x54a7('0x2d')]});});}});}function request(_0x51c82b){logger[_0x54a7('0x3a')](_0x54a7('0x3b'),JSON[_0x54a7('0x1e')](_0x51c82b));return rp(_[_0x54a7('0x3c')](def,_0x51c82b));}function getTags(_0x463535,_0x324399){var _0x2cf3ef=[];if(_0x463535&&_0x463535[_0x54a7('0x19')]>0x0){_0x2cf3ef=_[_0x54a7('0x3d')](_0x463535,_0x324399);}return _0x2cf3ef;}function getCustomFields(_0x53d6b9,_0x4351d2){var _0x3e299d=[];var _0x1ef4b3={'custom_fields':[]};if(_0x53d6b9['length']>0x0){_[_0x54a7('0x1a')](_0x53d6b9,function(_0x4e9372){if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x3f')&&_0x4e9372[_0x54a7('0x40')]&&!_0x4e9372[_0x54a7('0x41')]){_0x1ef4b3[_0x4e9372[_0x54a7('0x40')][_0x54a7('0x42')]()]=_0x4e9372['content'][_0x54a7('0x21')]();}else if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x3f')&&_0x4e9372[_0x54a7('0x43')]&&_0x4e9372[_0x54a7('0x41')]){_0x1ef4b3[_0x54a7('0x44')][_0x54a7('0x1c')]({'id':_0x4e9372['idField'],'value':_0x4e9372[_0x54a7('0x45')][_0x54a7('0x21')]()});}else if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x46')&&_0x4e9372[_0x54a7('0x1b')]&&_0x4e9372['idField']&&_0x4e9372[_0x54a7('0x41')]){_0x4351d2[_0x4e9372['variableName']]&&_0x1ef4b3[_0x54a7('0x44')]['push']({'id':_0x4e9372[_0x54a7('0x43')],'value':_0x4351d2[_0x4e9372[_0x54a7('0x1b')]]['toString']()});}else if(_0x4e9372[_0x54a7('0x3e')]===_0x54a7('0x47')&&_0x4e9372[_0x54a7('0x48')]&&_0x4e9372[_0x54a7('0x48')][_0x54a7('0x17')]&&_0x4e9372['idField']&&_0x4e9372['customField']){_0x4351d2[_0x4e9372['Variable'][_0x54a7('0x17')][_0x54a7('0x42')]()]&&_0x1ef4b3[_0x54a7('0x44')]['push']({'id':_0x4e9372[_0x54a7('0x43')],'value':_0x4351d2[_0x4e9372[_0x54a7('0x48')][_0x54a7('0x17')][_0x54a7('0x42')]()][_0x54a7('0x21')]()});}});}return _0x1ef4b3;}function getConnection(_0x4d2fe7){return request({'method':_0x54a7('0x9'),'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x54a7('0x1e')]({'user_auth':{'user_name':_0x4d2fe7[_0x54a7('0x49')],'password':_0x4d2fe7[_0x54a7('0x4a')],'encryption':'PLAIN'},'application':_0x54a7('0x4b')})}})[_0x54a7('0x28')](function(_0x466231){var _0x1a6c9f=_0x466231;if(_0x1a6c9f['id']){def[_0x54a7('0x4c')]=_0x1a6c9f['id'];return BPromise[_0x54a7('0x2f')](_0x1a6c9f);}else{throw new Error(util[_0x54a7('0x20')](_0x54a7('0x4d'),_0x4d2fe7['id']));}});}function setRelationship(_0x25c84a,_0x54fd97,_0x31a0b2,_0x39cf4b){return request({'form':{'method':_0x54a7('0x4e'),'input_type':_0x54a7('0x1d'),'response_type':_0x54a7('0x1d'),'rest_data':JSON['stringify']({'session':_0x25c84a['id'],'module_name':'Calls','module_id':_0x31a0b2['id'],'link_field_name':_0x39cf4b,'related_ids':[_0x54fd97['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x54a7('0x4f')]=function(_0xeb0f66,_0x325546,_0x31a9c9,_0x32cb9e,_0x422715,_0x4ddd3c){var _0x223a5d,_0x187294,_0x306674,_0x1ce618;_0x4ddd3c[_0x54a7('0x50')]=intUtil[_0x54a7('0x51')](_0x4ddd3c[_0x54a7('0x50')]);_0x4ddd3c[_0x54a7('0x52')]=intUtil[_0x54a7('0x51')](_0x4ddd3c[_0x54a7('0x52')]);def[_0x54a7('0x53')]=util['format'](_0x54a7('0x54'),_0x4ddd3c[_0x54a7('0x50')]);if(_0x422715&&_0x422715[_0x54a7('0x55')]){logger[_0x54a7('0xb')](_0x54a7('0x56'),_0x54a7('0x57'));_0x325546['recordingURL']=util[_0x54a7('0x20')](_0x54a7('0x58'),_0x4ddd3c[_0x54a7('0x52')],_0x325546[_0x54a7('0x59')],md5(_0x325546[_0x54a7('0x59')]));}else{_0x325546[_0x54a7('0x5a')]='';}return getConnection(_0x4ddd3c)[_0x54a7('0x28')](function(_0x401bf2){_0x1ce618=_0x401bf2;return getUser(_0x4ddd3c,_0x32cb9e[_0x54a7('0x17')],_0x1ce618);})[_0x54a7('0x28')](function(_0x5156a4){_0x223a5d=_0x5156a4;logger[_0x54a7('0xb')]('The\x20User\x20ID\x20is:',_0x223a5d['id']);return getEndUser(_0x4ddd3c,_0x325546['calleridname'],_0x325546[_0x54a7('0x5b')],_0x1ce618);})[_0x54a7('0x28')](function(_0x329cfa){_0x187294=_0x329cfa;logger[_0x54a7('0xb')](_0x54a7('0x5c'),_0x187294['id']);return getTicket(_0x4ddd3c,_0x223a5d,_0x187294,_0x31a9c9,_0x325546,_0x31a9c9['Fields'],_0x1ce618,_0x54a7('0x5d'));})['then'](function(_0x22f7a3){_0x306674=_0x22f7a3;logger[_0x54a7('0xb')]('Ticket\x20created!');logger[_0x54a7('0xb')](_0x54a7('0x5e'),_0x306674['id']);return setRelationship(_0x1ce618,_0x223a5d,_0x306674,_0x54a7('0x5f'));})[_0x54a7('0x28')](function(){return setRelationship(_0x1ce618,_0x187294,_0x306674,'contacts');})[_0x54a7('0x28')](function(){return getServerInfo(_0x1ce618);})['then'](function(_0x1281d1){var _0x13d73c=parseInt(_0x1281d1[_0x54a7('0x60')][_0x54a7('0x61')](0x0));var _0x423a1b=util[_0x54a7('0x20')](_0x54a7('0x62'),_0x4ddd3c['remoteUri'],_0x306674['id']);if(_0x13d73c>0x6){_0x423a1b=util[_0x54a7('0x20')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x4ddd3c[_0x54a7('0x50')],_0x306674['id']);}logger['info'](_0x54a7('0x56'),_0x54a7('0x63'));emit(util[_0x54a7('0x20')]('user:%s',_0x32cb9e[_0x54a7('0x17')]),'trigger:browser:url',{'uri':_0x423a1b});})[_0x54a7('0x64')](function(_0x369383){logger[_0x54a7('0x65')](_0x54a7('0x56'),JSON[_0x54a7('0x1e')](_0x369383));});};exports[_0x54a7('0x66')]=function(_0x3b2aa6,_0x5ccd00,_0x4ec21,_0x27fd07,_0x45129d,_0x431903,_0x22edd1){var _0x497cb6,_0x155ee6,_0x395fc4,_0x6ac9ab;_0x431903[_0x54a7('0x50')]=intUtil[_0x54a7('0x51')](_0x431903[_0x54a7('0x50')]);_0x431903[_0x54a7('0x52')]=intUtil['stripTrailingSlash'](_0x431903['serverUrl']);def[_0x54a7('0x53')]=util[_0x54a7('0x20')]('%s/service/v4_1/rest.php',_0x431903['remoteUri']);if(_0x22edd1&&_0x22edd1[_0x54a7('0x67')]&&_0x22edd1[_0x54a7('0x67')]!==_0x54a7('0x68')){logger['info'](_0x54a7('0x69'),'Recording\x20is\x20enabled!');_0x5ccd00[_0x54a7('0x5a')]=util[_0x54a7('0x20')](_0x54a7('0x58'),_0x431903[_0x54a7('0x52')],_0x5ccd00['uniqueid'],md5(_0x5ccd00[_0x54a7('0x59')]));}return getConnection(_0x431903)[_0x54a7('0x28')](function(_0x3ee595){_0x6ac9ab=_0x3ee595;return getUser(_0x431903,_0x27fd07[_0x54a7('0x17')],_0x6ac9ab);})[_0x54a7('0x28')](function(_0x521ba1){_0x497cb6=_0x521ba1;logger['info'](_0x54a7('0x6a'),_0x497cb6['id']);return getEndUser(_0x431903,_0x5ccd00[_0x54a7('0x6b')],_0x5ccd00[_0x54a7('0x6c')],_0x6ac9ab);})[_0x54a7('0x28')](function(_0x116ca4){_0x155ee6=_0x116ca4;logger['info'](_0x54a7('0x5c'),_0x155ee6['id']);return getTicket(_0x431903,_0x497cb6,_0x155ee6,_0x4ec21,_0x5ccd00,_0x4ec21['Fields'],_0x6ac9ab,_0x54a7('0x6d'));})[_0x54a7('0x28')](function(_0x4f4bcb){_0x395fc4=_0x4f4bcb;logger[_0x54a7('0xb')](_0x54a7('0x6e'));logger[_0x54a7('0xb')](_0x54a7('0x5e'),_0x395fc4['id']);return setRelationship(_0x6ac9ab,_0x497cb6,_0x395fc4,'users');})[_0x54a7('0x28')](function(){return setRelationship(_0x6ac9ab,_0x155ee6,_0x395fc4,_0x54a7('0x6f'));})['then'](function(){return getServerInfo(_0x6ac9ab);})['then'](function(_0x1b81c7){var _0x44373b=parseInt(_0x1b81c7[_0x54a7('0x60')]['charAt'](0x0));var _0x1bcda8=util[_0x54a7('0x20')](_0x54a7('0x62'),_0x431903[_0x54a7('0x50')],_0x395fc4['id']);if(_0x44373b>0x6){_0x1bcda8=util[_0x54a7('0x20')](_0x54a7('0x70'),_0x431903[_0x54a7('0x50')],_0x395fc4['id']);}logger['info']('[OUTBOUND]',_0x54a7('0x63'));emit(util[_0x54a7('0x20')]('user:%s',_0x27fd07['name']),_0x54a7('0x71'),{'uri':_0x1bcda8});})[_0x54a7('0x64')](function(_0x5e36dc){logger[_0x54a7('0x65')]('[OUTBOUND]',JSON['stringify'](_0x5e36dc));});};exports[_0x54a7('0x72')]=function(_0x3ede85,_0x18d4a1,_0x123628,_0x52dc05,_0x46e4dd,_0x212b33){var _0x3b80cf,_0x3858c2,_0x318739,_0x1e0e93;_0x212b33['remoteUri']=intUtil[_0x54a7('0x51')](_0x212b33['remoteUri']);_0x212b33[_0x54a7('0x52')]=intUtil[_0x54a7('0x51')](_0x212b33[_0x54a7('0x52')]);def[_0x54a7('0x53')]=util['format']('%s/service/v4_1/rest.php',_0x212b33[_0x54a7('0x50')]);if(_0x46e4dd&&_0x46e4dd['monitor_format']){logger['info']('['+_0x18d4a1[_0x54a7('0x73')][_0x54a7('0x74')]()+']',_0x54a7('0x57'));_0x18d4a1[_0x54a7('0x5a')]=util[_0x54a7('0x20')](_0x54a7('0x58'),_0x212b33['serverUrl'],_0x18d4a1[_0x54a7('0x59')],md5(_0x18d4a1[_0x54a7('0x59')]));}else{_0x18d4a1[_0x54a7('0x5a')]='';}return getConnection(_0x212b33)[_0x54a7('0x28')](function(_0x3d1c09){_0x1e0e93=_0x3d1c09;if(!_[_0x54a7('0x24')](_0x52dc05)){return getUser(_0x212b33,_0x52dc05[_0x54a7('0x17')],_0x1e0e93);}else{return getUser(_0x212b33,null,_0x1e0e93);}})[_0x54a7('0x28')](function(_0x4bd9d3){_0x3b80cf=_0x4bd9d3;logger['info'](_0x54a7('0x6a'),_0x3b80cf['id']);return getEndUser(_0x212b33,_0x18d4a1[_0x54a7('0x75')],_0x18d4a1[_0x54a7('0x5b')],_0x1e0e93);})['then'](function(_0x5e8964){_0x3858c2=_0x5e8964;logger[_0x54a7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3858c2['id']);return getTicket(_0x212b33,_0x3b80cf,_0x3858c2,_0x123628,_0x18d4a1,_0x123628[_0x54a7('0x76')],_0x1e0e93,'Inbound');})[_0x54a7('0x28')](function(_0x154d0e){_0x318739=_0x154d0e;logger[_0x54a7('0xb')](_0x54a7('0x6e'));logger['info'](_0x54a7('0x5e'),_0x318739['id']);return setRelationship(_0x1e0e93,_0x3b80cf,_0x318739,'users');})['then'](function(){return setRelationship(_0x1e0e93,_0x3858c2,_0x318739,'contacts');})[_0x54a7('0x28')](function(){return getServerInfo(_0x1e0e93);})['catch'](function(_0x356c68){logger[_0x54a7('0x65')]('['+_0x18d4a1[_0x54a7('0x73')][_0x54a7('0x74')]()+']',JSON[_0x54a7('0x1e')](_0x356c68));});}; \ 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 e1a0ecc..b55dd39 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 _0x36bf=['key','join','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','push','content','variable','variableName','name','Variable','toLowerCase','toString','keyValue','keyType','string','format','%s:\x20%s'];(function(_0x478159,_0x29b50d){var _0x197c18=function(_0x26f445){while(--_0x26f445){_0x478159['push'](_0x478159['shift']());}};_0x197c18(++_0x29b50d);}(_0x36bf,0x17e));var _0xf36b=function(_0x4e9176,_0x215689){_0x4e9176=_0x4e9176-0x0;var _0x26f375=_0x36bf[_0x4e9176];return _0x26f375;};'use strict';var _=require(_0xf36b('0x0'));var util=require(_0xf36b('0x1'));exports['getString']=function(_0x322c18,_0x126132,_0x5e0ce4){var _0xc040e9=[];if(_0x322c18[_0xf36b('0x2')]>0x0){var _0x18d76b=_[_0xf36b('0x3')](_0x322c18,['id']);for(var _0x35046a=0x0;_0x35046a<_0x18d76b[_0xf36b('0x2')];_0x35046a++){var _0xe4d029=_0x18d76b[_0x35046a];if(_0xe4d029[_0xf36b('0x4')]==='string'){_0xc040e9[_0xf36b('0x5')](_0xe4d029[_0xf36b('0x6')]);}else if(_0xe4d029[_0xf36b('0x4')]===_0xf36b('0x7')&&_0xe4d029['variableName']){_0x126132[_0xe4d029[_0xf36b('0x8')]]&&_0xc040e9[_0xf36b('0x5')](_0x126132[_0xe4d029['variableName']]['toString']());}else if(_0xe4d029['type']==='customVariable'&&_0xe4d029['Variable']&&_0xe4d029['Variable'][_0xf36b('0x9')]){_0x126132[_0xe4d029[_0xf36b('0xa')][_0xf36b('0x9')][_0xf36b('0xb')]()]&&_0xc040e9[_0xf36b('0x5')](_0x126132[_0xe4d029[_0xf36b('0xa')][_0xf36b('0x9')][_0xf36b('0xb')]()][_0xf36b('0xc')]());}else if(_0xe4d029['type']===_0xf36b('0xd')){if(_0xe4d029[_0xf36b('0xe')]===_0xf36b('0xf')&&_0xe4d029['key']){_0xc040e9[_0xf36b('0x5')](util[_0xf36b('0x10')](_0xf36b('0x11'),_0xe4d029['key'],_0xe4d029['keyContent']));}else if(_0xe4d029['keyType']===_0xf36b('0x7')&&_0xe4d029[_0xf36b('0x8')]&&_0xe4d029[_0xf36b('0x12')]){_0x126132[_0xe4d029[_0xf36b('0x8')]]&&_0xc040e9[_0xf36b('0x5')](util[_0xf36b('0x10')]('%s:\x20%s',_0xe4d029[_0xf36b('0x12')],_0x126132[_0xe4d029[_0xf36b('0x8')]]));}else if(_0xe4d029[_0xf36b('0xe')]==='customVariable'&&_0xe4d029['Variable']&&_0xe4d029[_0xf36b('0xa')][_0xf36b('0x9')]&&_0xe4d029[_0xf36b('0x12')]){_0x126132[_0xe4d029[_0xf36b('0xa')][_0xf36b('0x9')][_0xf36b('0xb')]()]&&_0xc040e9[_0xf36b('0x5')](util['format'](_0xf36b('0x11'),_0xe4d029[_0xf36b('0x12')],_0x126132[_0xe4d029[_0xf36b('0xa')][_0xf36b('0x9')][_0xf36b('0xb')]()]));}}}}return _0xc040e9[_0xf36b('0x13')](_0x5e0ce4);};exports['stripTrailingSlash']=function(_0x1ed967){var _0x4b8967=_0x1ed967['slice'](-0x1);if(_0x4b8967==='/'){_0x1ed967=_0x1ed967[_0xf36b('0x14')](0x0,_0x1ed967[_0xf36b('0x15')](_0x4b8967));}return _0x1ed967;};exports[_0xf36b('0x16')]=function(_0x3b5e2a){if(!_[_0xf36b('0x17')](_0x3b5e2a)&&_0x3b5e2a!==''){var _0x3adf39=/^(([^<>()\[\]\\.,;:\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 _0x3adf39[_0xf36b('0x18')](String(_0x3b5e2a)[_0xf36b('0xb')]());}else{return![];}}; \ No newline at end of file +var _0xcab0=['customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','variableName','push','toString'];(function(_0x5bd03c,_0x1558dc){var _0x37d752=function(_0x1c6a94){while(--_0x1c6a94){_0x5bd03c['push'](_0x5bd03c['shift']());}};_0x37d752(++_0x1558dc);}(_0xcab0,0x87));var _0x0cab=function(_0x593e44,_0x589362){_0x593e44=_0x593e44-0x0;var _0x884f76=_0xcab0[_0x593e44];return _0x884f76;};'use strict';var _=require(_0x0cab('0x0'));var util=require(_0x0cab('0x1'));exports[_0x0cab('0x2')]=function(_0x13b1ba,_0x2ad35e,_0x201196){var _0x2ce2ce=[];if(_0x13b1ba[_0x0cab('0x3')]>0x0){var _0x2762a3=_[_0x0cab('0x4')](_0x13b1ba,['id']);for(var _0x2c77c9=0x0;_0x2c77c9<_0x2762a3[_0x0cab('0x3')];_0x2c77c9++){var _0x1558ce=_0x2762a3[_0x2c77c9];if(_0x1558ce[_0x0cab('0x5')]===_0x0cab('0x6')){_0x2ce2ce['push'](_0x1558ce['content']);}else if(_0x1558ce[_0x0cab('0x5')]==='variable'&&_0x1558ce[_0x0cab('0x7')]){_0x2ad35e[_0x1558ce[_0x0cab('0x7')]]&&_0x2ce2ce[_0x0cab('0x8')](_0x2ad35e[_0x1558ce[_0x0cab('0x7')]][_0x0cab('0x9')]());}else if(_0x1558ce[_0x0cab('0x5')]===_0x0cab('0xa')&&_0x1558ce[_0x0cab('0xb')]&&_0x1558ce[_0x0cab('0xb')]['name']){_0x2ad35e[_0x1558ce['Variable'][_0x0cab('0xc')][_0x0cab('0xd')]()]&&_0x2ce2ce[_0x0cab('0x8')](_0x2ad35e[_0x1558ce[_0x0cab('0xb')][_0x0cab('0xc')]['toLowerCase']()][_0x0cab('0x9')]());}else if(_0x1558ce[_0x0cab('0x5')]===_0x0cab('0xe')){if(_0x1558ce[_0x0cab('0xf')]===_0x0cab('0x6')&&_0x1558ce[_0x0cab('0x10')]){_0x2ce2ce[_0x0cab('0x8')](util[_0x0cab('0x11')](_0x0cab('0x12'),_0x1558ce[_0x0cab('0x10')],_0x1558ce[_0x0cab('0x13')]));}else if(_0x1558ce[_0x0cab('0xf')]===_0x0cab('0x14')&&_0x1558ce[_0x0cab('0x7')]&&_0x1558ce[_0x0cab('0x10')]){_0x2ad35e[_0x1558ce['variableName']]&&_0x2ce2ce[_0x0cab('0x8')](util['format'](_0x0cab('0x12'),_0x1558ce[_0x0cab('0x10')],_0x2ad35e[_0x1558ce[_0x0cab('0x7')]]));}else if(_0x1558ce[_0x0cab('0xf')]===_0x0cab('0xa')&&_0x1558ce['Variable']&&_0x1558ce['Variable'][_0x0cab('0xc')]&&_0x1558ce[_0x0cab('0x10')]){_0x2ad35e[_0x1558ce[_0x0cab('0xb')]['name'][_0x0cab('0xd')]()]&&_0x2ce2ce['push'](util[_0x0cab('0x11')]('%s:\x20%s',_0x1558ce['key'],_0x2ad35e[_0x1558ce[_0x0cab('0xb')]['name']['toLowerCase']()]));}}}}return _0x2ce2ce[_0x0cab('0x15')](_0x201196);};exports[_0x0cab('0x16')]=function(_0x25cb54){var _0x91ebe2=_0x25cb54[_0x0cab('0x17')](-0x1);if(_0x91ebe2==='/'){_0x25cb54=_0x25cb54[_0x0cab('0x18')](0x0,_0x25cb54[_0x0cab('0x19')](_0x91ebe2));}return _0x25cb54;};exports[_0x0cab('0x1a')]=function(_0x50f3cc){if(!_[_0x0cab('0x1b')](_0x50f3cc)&&_0x50f3cc!==''){var _0x36a592=/^(([^<>()\[\]\\.,;:\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 _0x36a592[_0x0cab('0x1c')](String(_0x50f3cc)[_0x0cab('0xd')]());}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 9328e67..a512f22 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x37698f,_0x347747){var _0x529dfe=function(_0x5b0947){while(--_0x5b0947){_0x37698f['push'](_0x37698f['shift']());}};_0x529dfe(++_0x347747);}(_0xe706,0xa3));var _0x6e70=function(_0x2bcf3b,_0x2443d7){_0x2bcf3b=_0x2bcf3b-0x0;var _0x1d2898=_0xe706[_0x2bcf3b];return _0x1d2898;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +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(_0x4aebaa,_0x1e17d3){var _0x38cd3d=function(_0x25dbcb){while(--_0x25dbcb){_0x4aebaa['push'](_0x4aebaa['shift']());}};_0x38cd3d(++_0x1e17d3);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 33947e2..cbe202e 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 _0xa322=['map','includes','string','type','customField','nameField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','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','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','lastevent','toUpperCase','calleridnum','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','zendesk','defaults','redis','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Subjects','getString','Descriptions','Fields','then','info','Ticket\x20created!','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','username','token','toString','debug','stringify','GET'];(function(_0x5a9625,_0x5661a7){var _0x2c1c00=function(_0x41e556){while(--_0x41e556){_0x5a9625['push'](_0x5a9625['shift']());}};_0x2c1c00(++_0x5661a7);}(_0xa322,0xa0));var _0x2a32=function(_0x3110a0,_0x58214f){_0x3110a0=_0x3110a0-0x0;var _0x1f7c2c=_0xa322[_0x3110a0];return _0x1f7c2c;};'use strict';var _=require(_0x2a32('0x0'));var rp=require(_0x2a32('0x1'));var md5=require(_0x2a32('0x2'));var util=require(_0x2a32('0x3'));var Redis=require('ioredis');var intUtil=require(_0x2a32('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x2a32('0x5'));config['redis']=_[_0x2a32('0x6')](config[_0x2a32('0x7')],{'host':_0x2a32('0x8'),'port':0x18eb});var io=require(_0x2a32('0x9'))(new Redis(config['redis']));function emit(_0x4c6538,_0x748927,_0x2592f1){io['to'](_0x4c6538)['emit'](_0x748927,_0x2592f1);}var headers={'Content-Type':_0x2a32('0xa'),'Accept':_0x2a32('0xa')};function getTicket(_0x435658,_0x165005,_0x470981,_0x41174b,_0x3709c3){logger['info'](_0x2a32('0xb'));return request({'uri':util[_0x2a32('0xc')](_0x2a32('0xd'),_0x435658[_0x2a32('0xe')]),'method':_0x2a32('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x470981['id'],'submitter_id':_0x165005?_0x165005['id']:undefined,'assignee_id':_0x165005?_0x165005['id']:undefined,'tags':getTags(_0x41174b['Tags'],'name'),'subject':intUtil['getString'](_0x41174b[_0x2a32('0x10')],_0x3709c3,'\x20'),'description':intUtil[_0x2a32('0x11')](_0x41174b[_0x2a32('0x12')],_0x3709c3,'\x0a'),'comment':{'public':![],'body':intUtil[_0x2a32('0x11')](_0x41174b[_0x2a32('0x12')],_0x3709c3,'\x0a')}},getCustomFields(_0x41174b[_0x2a32('0x13')],_0x3709c3))}})[_0x2a32('0x14')](function(_0x262a62){logger[_0x2a32('0x15')](_0x2a32('0x16'));return _0x262a62['ticket'];});}function getUser(_0x3b530d,_0xddf6c4){if(intUtil['validateEmail'](_0xddf6c4)){logger[_0x2a32('0x15')](_0x2a32('0x17'),_0xddf6c4);return request({'uri':util['format']('%s/search.json',_0x3b530d[_0x2a32('0xe')]),'qs':{'query':util[_0x2a32('0xc')](_0x2a32('0x18'),_0xddf6c4)}})[_0x2a32('0x14')](function(_0x4e10d9){if(_0x4e10d9[_0x2a32('0x19')]){logger['info'](_0x2a32('0x1a'));return _[_0x2a32('0x1b')](_0x4e10d9[_0x2a32('0x1c')],{'email':_0xddf6c4,'role':_0x2a32('0x1d')});}else{logger[_0x2a32('0x15')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x2a32('0xc')](_0x2a32('0x1e'),_0x3b530d[_0x2a32('0xe')])})[_0x2a32('0x14')](function(_0x111eca){logger['info'](_0x2a32('0x1f'));return _0x111eca[_0x2a32('0x20')];});}});}else{logger[_0x2a32('0x15')](_0x2a32('0x21'));return request({'uri':util['format'](_0x2a32('0x1e'),_0x3b530d[_0x2a32('0xe')])})['then'](function(_0x30f658){logger[_0x2a32('0x15')](_0x2a32('0x1f'));return _0x30f658['user'];});}}function getEndUser(_0x1d32a0,_0xcd9e6f,_0x52f501){logger[_0x2a32('0x15')](_0x2a32('0x22'),_0x52f501);return request({'uri':util[_0x2a32('0xc')](_0x2a32('0x23'),_0x1d32a0[_0x2a32('0xe')]),'qs':{'query':util[_0x2a32('0xc')](_0x2a32('0x24'),_0x52f501)}})['then'](function(_0x5c3549){var _0xe0e859;if(_0x5c3549[_0x2a32('0x1c')][_0x2a32('0x25')]){_0x5c3549[_0x2a32('0x1c')]=_[_0x2a32('0x26')](_0x5c3549[_0x2a32('0x1c')],{'suspended':![],'role':'end-user'});if(_0x5c3549[_0x2a32('0x1c')][_0x2a32('0x25')]){_0xe0e859=_[_0x2a32('0x27')](_0x5c3549['results']);}}if(_0xe0e859){logger[_0x2a32('0x15')](_0x2a32('0x28'));return _0xe0e859;}else{logger[_0x2a32('0x15')](_0x2a32('0x29'));return request({'uri':util[_0x2a32('0xc')]('%s/users.json',_0x1d32a0['remoteUri']),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x2a32('0xc')](_0x2a32('0x2a'),_0xcd9e6f||_0x52f501),'phone':_0x52f501}}})[_0x2a32('0x14')](function(_0x47e306){logger[_0x2a32('0x15')](_0x2a32('0x2b'));return _0x47e306['user'];});}});}function getAuth(_0x2152ab){var _0x42f42f;if(_0x2152ab[_0x2a32('0x2c')]===_0x2a32('0x2d')){_0x42f42f=util['format']('%s:%s',_0x2152ab[_0x2a32('0x2e')],_0x2152ab['password']);}else if(_0x2152ab[_0x2a32('0x2c')]===_0x2a32('0x2f')){_0x42f42f=util[_0x2a32('0xc')]('%s/token:%s',_0x2152ab[_0x2a32('0x2e')],_0x2152ab['token']);}return util[_0x2a32('0xc')]('Basic\x20%s',new Buffer(_0x42f42f)[_0x2a32('0x30')]('base64'));}function request(_0x1a6a52){logger[_0x2a32('0x31')]('[HTTP]',JSON[_0x2a32('0x32')](_0x1a6a52));return rp(_['defaults'](_0x1a6a52,{'method':_0x2a32('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x1f226c,_0x27f723){var _0x489237=[];if(_0x1f226c&&_0x1f226c[_0x2a32('0x25')]>0x0){_0x489237=_[_0x2a32('0x34')](_0x1f226c,_0x27f723);}return _0x489237;}function getCustomFields(_0x2e5575,_0x4afc92){var _0x5b79bb=[];var _0x2bb0a4={'custom_fields':[]};if(_0x2e5575[_0x2a32('0x25')]>0x0){_['forEach'](_0x2e5575,function(_0x26e0ef){if(_[_0x2a32('0x35')]([_0x2a32('0x36'),'picklist'],_0x26e0ef[_0x2a32('0x37')])&&_0x26e0ef['nameField']&&!_0x26e0ef[_0x2a32('0x38')]){_0x2bb0a4[_0x26e0ef[_0x2a32('0x39')][_0x2a32('0x3a')]()]=_0x26e0ef[_0x2a32('0x3b')][_0x2a32('0x30')]();}else if(_[_0x2a32('0x35')]([_0x2a32('0x36'),'picklist'],_0x26e0ef[_0x2a32('0x37')])&&_0x26e0ef[_0x2a32('0x3c')]&&_0x26e0ef['customField']){_0x2bb0a4[_0x2a32('0x3d')][_0x2a32('0x3e')]({'id':_0x26e0ef[_0x2a32('0x3c')],'value':_0x26e0ef[_0x2a32('0x3b')][_0x2a32('0x30')]()});}else if(_0x26e0ef[_0x2a32('0x37')]===_0x2a32('0x3f')&&_0x26e0ef[_0x2a32('0x40')]&&_0x26e0ef[_0x2a32('0x3c')]&&_0x26e0ef[_0x2a32('0x38')]){_0x4afc92[_0x26e0ef[_0x2a32('0x40')]]&&_0x2bb0a4[_0x2a32('0x3d')][_0x2a32('0x3e')]({'id':_0x26e0ef[_0x2a32('0x3c')],'value':_0x4afc92[_0x26e0ef['variableName']][_0x2a32('0x30')]()});}else if(_0x26e0ef[_0x2a32('0x37')]===_0x2a32('0x41')&&_0x26e0ef[_0x2a32('0x42')]&&_0x26e0ef[_0x2a32('0x42')]['name']&&_0x26e0ef[_0x2a32('0x3c')]&&_0x26e0ef[_0x2a32('0x38')]){_0x4afc92[_0x26e0ef[_0x2a32('0x42')][_0x2a32('0x43')][_0x2a32('0x3a')]()]&&_0x2bb0a4['custom_fields'][_0x2a32('0x3e')]({'id':_0x26e0ef[_0x2a32('0x3c')],'value':_0x4afc92[_0x26e0ef['Variable']['name'][_0x2a32('0x3a')]()][_0x2a32('0x30')]()});}});}return _0x2bb0a4;}exports[_0x2a32('0x44')]=function(_0x10294a,_0x3dc2b2,_0x19ccbc,_0x14d572,_0x53cb90,_0x588f55){var _0x77a280,_0x2e368e;_0x588f55['remoteUri']=intUtil[_0x2a32('0x45')](_0x588f55[_0x2a32('0xe')]);_0x588f55[_0x2a32('0x46')]=intUtil[_0x2a32('0x45')](_0x588f55[_0x2a32('0x46')]);if(_0x53cb90&&_0x53cb90[_0x2a32('0x47')]){logger['info'](_0x2a32('0x48'),_0x2a32('0x49'));_0x3dc2b2[_0x2a32('0x4a')]=util['format'](_0x2a32('0x4b'),_0x588f55[_0x2a32('0x46')],_0x3dc2b2[_0x2a32('0x4c')],md5(_0x3dc2b2['uniqueid']));}else{_0x3dc2b2['recordingURL']='';}headers[_0x2a32('0x4d')]=getAuth(_0x588f55);return getUser(_0x588f55,_0x14d572[_0x2a32('0x4e')])[_0x2a32('0x14')](function(_0x1f8917){_0x77a280=_0x1f8917;logger[_0x2a32('0x15')](_0x2a32('0x4f'),_0x77a280['id']);return getEndUser(_0x588f55,_0x3dc2b2[_0x2a32('0x50')],_0x3dc2b2['calleridnum']);})['then'](function(_0x405063){_0x2e368e=_0x405063;logger[_0x2a32('0x15')](_0x2a32('0x51'),_0x2e368e['id']);return getTicket(_0x588f55,_0x77a280,_0x2e368e,_0x19ccbc,_0x3dc2b2);})['then'](function(_0x532527){if(_0x532527){logger['info'](_0x2a32('0x52'),_0x532527['id']);switch(_0x588f55['type']){case _0x2a32('0x53'):logger['info'](_0x2a32('0x48'),_0x2a32('0x54'));return request({'uri':util['format'](_0x2a32('0x55'),_0x588f55[_0x2a32('0xe')],_0x77a280['id'],_0x532527['id']),'method':_0x2a32('0xf')});case _0x2a32('0x56'):logger[_0x2a32('0x15')]('[QUEUE]',_0x2a32('0x57'));emit(util[_0x2a32('0xc')](_0x2a32('0x58'),_0x14d572[_0x2a32('0x43')]),_0x2a32('0x59'),{'uri':util[_0x2a32('0xc')](_0x2a32('0x5a'),_0x588f55[_0x2a32('0xe')][_0x2a32('0x5b')](_0x2a32('0x5c'),''),_0x532527['id'])});break;default:logger[_0x2a32('0x5d')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x2a32('0x5e')](function(_0x125622){logger[_0x2a32('0x5d')](_0x2a32('0x5f'),util[_0x2a32('0x60')](_0x125622,{'showHidden':!![],'depth':null}));});};exports[_0x2a32('0x61')]=function(_0x327eac,_0x22a3f3,_0x1691d4,_0x3c87d7,_0x24d006,_0xca161,_0x312958){var _0x1b5133,_0xc10216;_0xca161[_0x2a32('0xe')]=intUtil[_0x2a32('0x45')](_0xca161[_0x2a32('0xe')]);_0xca161[_0x2a32('0x46')]=intUtil[_0x2a32('0x45')](_0xca161[_0x2a32('0x46')]);if(_0x312958&&_0x312958[_0x2a32('0x62')]&&_0x312958[_0x2a32('0x62')]!==_0x2a32('0x63')){logger[_0x2a32('0x15')](_0x2a32('0x64'),_0x2a32('0x49'));_0x22a3f3['recordingURL']=util[_0x2a32('0xc')](_0x2a32('0x4b'),_0xca161[_0x2a32('0x46')],_0x22a3f3[_0x2a32('0x4c')],md5(_0x22a3f3[_0x2a32('0x4c')]));}headers['Authorization']=getAuth(_0xca161);return getUser(_0xca161,_0x3c87d7[_0x2a32('0x4e')])[_0x2a32('0x14')](function(_0x1bf1a7){_0x1b5133=_0x1bf1a7;logger[_0x2a32('0x15')](_0x2a32('0x4f'),_0x1b5133['id']);return getEndUser(_0xca161,_0x22a3f3[_0x2a32('0x65')],_0x22a3f3['destcalleridnum']);})[_0x2a32('0x14')](function(_0x5d0178){_0xc10216=_0x5d0178;logger[_0x2a32('0x15')](_0x2a32('0x51'),_0xc10216['id']);return getTicket(_0xca161,_0x1b5133,_0xc10216,_0x1691d4,_0x22a3f3);})[_0x2a32('0x14')](function(_0x907181){if(_0x907181){logger[_0x2a32('0x15')]('The\x20Ticket\x20ID\x20is:',_0x907181['id']);switch(_0xca161[_0x2a32('0x37')]){case _0x2a32('0x53'):logger[_0x2a32('0x15')](_0x2a32('0x64'),_0x2a32('0x54'));return request({'uri':util[_0x2a32('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xca161[_0x2a32('0xe')],_0x1b5133['id'],_0x907181['id']),'method':'POST'});case _0x2a32('0x56'):logger[_0x2a32('0x15')](_0x2a32('0x64'),_0x2a32('0x57'));emit(util[_0x2a32('0xc')](_0x2a32('0x58'),_0x3c87d7[_0x2a32('0x43')]),_0x2a32('0x59'),{'uri':util[_0x2a32('0xc')](_0x2a32('0x5a'),_0xca161[_0x2a32('0xe')][_0x2a32('0x5b')](_0x2a32('0x5c'),''),_0x907181['id'])});break;default:logger[_0x2a32('0x5d')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x2a32('0x5e')](function(_0x427abc){logger[_0x2a32('0x5d')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x2a32('0x60')](_0x427abc,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x430814,_0x1ec96e,_0x27249a,_0x48bc74,_0x2b9fca,_0x191401){var _0x1b4742,_0x2c4087;_0x191401[_0x2a32('0xe')]=intUtil['stripTrailingSlash'](_0x191401[_0x2a32('0xe')]);_0x191401['serverUrl']=intUtil['stripTrailingSlash'](_0x191401[_0x2a32('0x46')]);if(_0x2b9fca&&_0x2b9fca[_0x2a32('0x47')]){logger[_0x2a32('0x15')]('['+_0x1ec96e[_0x2a32('0x66')][_0x2a32('0x67')]()+']',_0x2a32('0x49'));_0x1ec96e['recordingURL']=util[_0x2a32('0xc')](_0x2a32('0x4b'),_0x191401[_0x2a32('0x46')],_0x1ec96e[_0x2a32('0x4c')],md5(_0x1ec96e['uniqueid']));}else{_0x1ec96e[_0x2a32('0x4a')]='';}headers[_0x2a32('0x4d')]=getAuth(_0x191401);return getUser(_0x191401)[_0x2a32('0x14')](function(_0x1277ea){_0x1b4742=_0x1277ea;logger[_0x2a32('0x15')](_0x2a32('0x4f'),_0x1b4742['id']);return getEndUser(_0x191401,_0x1ec96e[_0x2a32('0x50')],_0x1ec96e[_0x2a32('0x68')]);})[_0x2a32('0x14')](function(_0x5f4e5d){_0x2c4087=_0x5f4e5d;logger['info'](_0x2a32('0x51'),_0x2c4087['id']);return getTicket(_0x191401,_0x1b4742,_0x2c4087,_0x27249a,_0x1ec96e);})['then'](function(_0x3a6f21){if(_0x3a6f21){logger['info'](_0x2a32('0x52'),_0x3a6f21['id']);}})[_0x2a32('0x5e')](function(_0x42ce52){logger[_0x2a32('0x5d')]('['+_0x1ec96e['lastevent'][_0x2a32('0x67')]()+']'+_0x2a32('0x69'),util['inspect'](_0x42ce52,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9f90=['destcalleridnum','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','Zendesk\x20account\x20type\x20not\x20recognized','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','%s/search.json','count','Agent\x20found!','results','agent','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','length','map','forEach','string','picklist','nameField','customField','toLowerCase','toString','type','custom_fields','push','content','variable','idField','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname'];(function(_0x1c43b6,_0x17d244){var _0x2d7fa8=function(_0xa7013e){while(--_0xa7013e){_0x1c43b6['push'](_0x1c43b6['shift']());}};_0x2d7fa8(++_0x17d244);}(_0x9f90,0xe9));var _0x09f9=function(_0x50c1a4,_0x4f7d7b){_0x50c1a4=_0x50c1a4-0x0;var _0x52e89a=_0x9f90[_0x50c1a4];return _0x52e89a;};'use strict';var _=require(_0x09f9('0x0'));var rp=require(_0x09f9('0x1'));var md5=require(_0x09f9('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x09f9('0x3'));var config=require(_0x09f9('0x4'));var logger=require(_0x09f9('0x5'))(_0x09f9('0x6'));config[_0x09f9('0x7')]=_[_0x09f9('0x8')](config[_0x09f9('0x7')],{'host':_0x09f9('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x36e2ae,_0xdd70c2,_0x45bfac){io['to'](_0x36e2ae)[_0x09f9('0xa')](_0xdd70c2,_0x45bfac);}var headers={'Content-Type':_0x09f9('0xb'),'Accept':'application/json'};function getTicket(_0x140e73,_0x21ab59,_0x542810,_0x8df316,_0x50a415){logger['info'](_0x09f9('0xc'));return request({'uri':util[_0x09f9('0xd')](_0x09f9('0xe'),_0x140e73[_0x09f9('0xf')]),'method':_0x09f9('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x542810['id'],'submitter_id':_0x21ab59?_0x21ab59['id']:undefined,'assignee_id':_0x21ab59?_0x21ab59['id']:undefined,'tags':getTags(_0x8df316[_0x09f9('0x11')],_0x09f9('0x12')),'subject':intUtil['getString'](_0x8df316[_0x09f9('0x13')],_0x50a415,'\x20'),'description':intUtil['getString'](_0x8df316['Descriptions'],_0x50a415,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x8df316[_0x09f9('0x14')],_0x50a415,'\x0a')}},getCustomFields(_0x8df316[_0x09f9('0x15')],_0x50a415))}})[_0x09f9('0x16')](function(_0x804796){logger['info'](_0x09f9('0x17'));return _0x804796[_0x09f9('0x18')];});}function getUser(_0x3a06d6,_0x6b32d3){if(intUtil[_0x09f9('0x19')](_0x6b32d3)){logger[_0x09f9('0x1a')](_0x09f9('0x1b'),_0x6b32d3);return request({'uri':util[_0x09f9('0xd')](_0x09f9('0x1c'),_0x3a06d6[_0x09f9('0xf')]),'qs':{'query':util[_0x09f9('0xd')]('type:user\x20role:agent\x20email:%s',_0x6b32d3)}})[_0x09f9('0x16')](function(_0x56ea4){if(_0x56ea4[_0x09f9('0x1d')]){logger[_0x09f9('0x1a')](_0x09f9('0x1e'));return _['find'](_0x56ea4[_0x09f9('0x1f')],{'email':_0x6b32d3,'role':_0x09f9('0x20')});}else{logger[_0x09f9('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x3a06d6[_0x09f9('0xf')])})[_0x09f9('0x16')](function(_0x275f90){logger[_0x09f9('0x1a')]('Admin\x20account\x20selected.');return _0x275f90[_0x09f9('0x21')];});}});}else{logger['info'](_0x09f9('0x22'));return request({'uri':util['format'](_0x09f9('0x23'),_0x3a06d6[_0x09f9('0xf')])})[_0x09f9('0x16')](function(_0x1bbfb4){logger['info'](_0x09f9('0x24'));return _0x1bbfb4['user'];});}}function getEndUser(_0x375032,_0x4b0687,_0x2baff3){logger['info']('Searching\x20enduser\x20with\x20phone',_0x2baff3);return request({'uri':util['format'](_0x09f9('0x1c'),_0x375032['remoteUri']),'qs':{'query':util[_0x09f9('0xd')]('type:user\x20role:end-user\x20phone:%s',_0x2baff3)}})['then'](function(_0xe5cd36){var _0x4a4b84;if(_0xe5cd36[_0x09f9('0x1f')]['length']){_0xe5cd36[_0x09f9('0x1f')]=_[_0x09f9('0x25')](_0xe5cd36[_0x09f9('0x1f')],{'suspended':![],'role':_0x09f9('0x26')});if(_0xe5cd36[_0x09f9('0x1f')]['length']){_0x4a4b84=_['first'](_0xe5cd36['results']);}}if(_0x4a4b84){logger[_0x09f9('0x1a')]('Enduser\x20found!');return _0x4a4b84;}else{logger['info'](_0x09f9('0x27'));return request({'uri':util[_0x09f9('0xd')](_0x09f9('0x28'),_0x375032['remoteUri']),'method':_0x09f9('0x10'),'body':{'user':{'role':_0x09f9('0x26'),'name':util[_0x09f9('0xd')](_0x09f9('0x29'),_0x4b0687||_0x2baff3),'phone':_0x2baff3}}})['then'](function(_0x3457ed){logger['info'](_0x09f9('0x2a'));return _0x3457ed['user'];});}});}function getAuth(_0x513f02){var _0x46d5a1;if(_0x513f02[_0x09f9('0x2b')]===_0x09f9('0x2c')){_0x46d5a1=util['format'](_0x09f9('0x2d'),_0x513f02[_0x09f9('0x2e')],_0x513f02[_0x09f9('0x2c')]);}else if(_0x513f02['authType']===_0x09f9('0x2f')){_0x46d5a1=util[_0x09f9('0xd')](_0x09f9('0x30'),_0x513f02[_0x09f9('0x2e')],_0x513f02[_0x09f9('0x2f')]);}return util['format'](_0x09f9('0x31'),new Buffer(_0x46d5a1)['toString'](_0x09f9('0x32')));}function request(_0x1662b2){logger[_0x09f9('0x33')](_0x09f9('0x34'),JSON['stringify'](_0x1662b2));return rp(_[_0x09f9('0x8')](_0x1662b2,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x3a6e0c,_0x42ca7c){var _0x58bc07=[];if(_0x3a6e0c&&_0x3a6e0c[_0x09f9('0x35')]>0x0){_0x58bc07=_[_0x09f9('0x36')](_0x3a6e0c,_0x42ca7c);}return _0x58bc07;}function getCustomFields(_0x4cf4d3,_0x597256){var _0x326f97=[];var _0x70306c={'custom_fields':[]};if(_0x4cf4d3[_0x09f9('0x35')]>0x0){_[_0x09f9('0x37')](_0x4cf4d3,function(_0x2df67){if(_['includes']([_0x09f9('0x38'),_0x09f9('0x39')],_0x2df67['type'])&&_0x2df67[_0x09f9('0x3a')]&&!_0x2df67[_0x09f9('0x3b')]){_0x70306c[_0x2df67[_0x09f9('0x3a')][_0x09f9('0x3c')]()]=_0x2df67['content'][_0x09f9('0x3d')]();}else if(_['includes']([_0x09f9('0x38'),_0x09f9('0x39')],_0x2df67[_0x09f9('0x3e')])&&_0x2df67['idField']&&_0x2df67[_0x09f9('0x3b')]){_0x70306c[_0x09f9('0x3f')][_0x09f9('0x40')]({'id':_0x2df67['idField'],'value':_0x2df67[_0x09f9('0x41')]['toString']()});}else if(_0x2df67[_0x09f9('0x3e')]===_0x09f9('0x42')&&_0x2df67['variableName']&&_0x2df67[_0x09f9('0x43')]&&_0x2df67['customField']){_0x597256[_0x2df67[_0x09f9('0x44')]]&&_0x70306c['custom_fields'][_0x09f9('0x40')]({'id':_0x2df67['idField'],'value':_0x597256[_0x2df67[_0x09f9('0x44')]][_0x09f9('0x3d')]()});}else if(_0x2df67[_0x09f9('0x3e')]===_0x09f9('0x45')&&_0x2df67['Variable']&&_0x2df67[_0x09f9('0x46')][_0x09f9('0x12')]&&_0x2df67[_0x09f9('0x43')]&&_0x2df67[_0x09f9('0x3b')]){_0x597256[_0x2df67[_0x09f9('0x46')][_0x09f9('0x12')][_0x09f9('0x3c')]()]&&_0x70306c['custom_fields'][_0x09f9('0x40')]({'id':_0x2df67[_0x09f9('0x43')],'value':_0x597256[_0x2df67[_0x09f9('0x46')][_0x09f9('0x12')]['toLowerCase']()][_0x09f9('0x3d')]()});}});}return _0x70306c;}exports[_0x09f9('0x47')]=function(_0xfdc4e0,_0x3002eb,_0x17cb92,_0x3939ed,_0x53b8f7,_0x4d37b6){var _0x403ca3,_0x5dd876;_0x4d37b6[_0x09f9('0xf')]=intUtil[_0x09f9('0x48')](_0x4d37b6['remoteUri']);_0x4d37b6[_0x09f9('0x49')]=intUtil[_0x09f9('0x48')](_0x4d37b6[_0x09f9('0x49')]);if(_0x53b8f7&&_0x53b8f7[_0x09f9('0x4a')]){logger[_0x09f9('0x1a')](_0x09f9('0x4b'),_0x09f9('0x4c'));_0x3002eb[_0x09f9('0x4d')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4d37b6['serverUrl'],_0x3002eb['uniqueid'],md5(_0x3002eb[_0x09f9('0x4e')]));}else{_0x3002eb[_0x09f9('0x4d')]='';}headers[_0x09f9('0x4f')]=getAuth(_0x4d37b6);return getUser(_0x4d37b6,_0x3939ed[_0x09f9('0x50')])['then'](function(_0x31e7ba){_0x403ca3=_0x31e7ba;logger[_0x09f9('0x1a')](_0x09f9('0x51'),_0x403ca3['id']);return getEndUser(_0x4d37b6,_0x3002eb[_0x09f9('0x52')],_0x3002eb[_0x09f9('0x53')]);})[_0x09f9('0x16')](function(_0x120d12){_0x5dd876=_0x120d12;logger[_0x09f9('0x1a')](_0x09f9('0x54'),_0x5dd876['id']);return getTicket(_0x4d37b6,_0x403ca3,_0x5dd876,_0x17cb92,_0x3002eb);})[_0x09f9('0x16')](function(_0x2b0ac2){if(_0x2b0ac2){logger[_0x09f9('0x1a')](_0x09f9('0x55'),_0x2b0ac2['id']);switch(_0x4d37b6[_0x09f9('0x3e')]){case'integrationTab':logger[_0x09f9('0x1a')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x09f9('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4d37b6[_0x09f9('0xf')],_0x403ca3['id'],_0x2b0ac2['id']),'method':'POST'});case _0x09f9('0x56'):logger[_0x09f9('0x1a')](_0x09f9('0x4b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x09f9('0x57'),_0x3939ed[_0x09f9('0x12')]),_0x09f9('0x58'),{'uri':util[_0x09f9('0xd')](_0x09f9('0x59'),_0x4d37b6[_0x09f9('0xf')][_0x09f9('0x5a')](_0x09f9('0x5b'),''),_0x2b0ac2['id'])});break;default:logger['error'](_0x09f9('0x4b'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x09f9('0x5c')](function(_0x5d121a){logger['error'](_0x09f9('0x5d'),util[_0x09f9('0x5e')](_0x5d121a,{'showHidden':!![],'depth':null}));});};exports[_0x09f9('0x5f')]=function(_0x287e3b,_0x1829b3,_0x3a9f28,_0x3f6205,_0x4700f9,_0x188d40,_0x125bce){var _0x96d703,_0x27b7b2;_0x188d40['remoteUri']=intUtil[_0x09f9('0x48')](_0x188d40[_0x09f9('0xf')]);_0x188d40[_0x09f9('0x49')]=intUtil[_0x09f9('0x48')](_0x188d40[_0x09f9('0x49')]);if(_0x125bce&&_0x125bce['recordingFormat']&&_0x125bce['recordingFormat']!==_0x09f9('0x60')){logger[_0x09f9('0x1a')](_0x09f9('0x61'),_0x09f9('0x4c'));_0x1829b3[_0x09f9('0x4d')]=util[_0x09f9('0xd')](_0x09f9('0x62'),_0x188d40['serverUrl'],_0x1829b3[_0x09f9('0x4e')],md5(_0x1829b3[_0x09f9('0x4e')]));}headers[_0x09f9('0x4f')]=getAuth(_0x188d40);return getUser(_0x188d40,_0x3f6205[_0x09f9('0x50')])['then'](function(_0x40b7c2){_0x96d703=_0x40b7c2;logger[_0x09f9('0x1a')](_0x09f9('0x51'),_0x96d703['id']);return getEndUser(_0x188d40,_0x1829b3[_0x09f9('0x63')],_0x1829b3[_0x09f9('0x64')]);})['then'](function(_0x249dc2){_0x27b7b2=_0x249dc2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x27b7b2['id']);return getTicket(_0x188d40,_0x96d703,_0x27b7b2,_0x3a9f28,_0x1829b3);})['then'](function(_0x29e485){if(_0x29e485){logger[_0x09f9('0x1a')](_0x09f9('0x55'),_0x29e485['id']);switch(_0x188d40['type']){case _0x09f9('0x65'):logger[_0x09f9('0x1a')]('[OUTBOUND]',_0x09f9('0x66'));return request({'uri':util[_0x09f9('0xd')](_0x09f9('0x67'),_0x188d40[_0x09f9('0xf')],_0x96d703['id'],_0x29e485['id']),'method':_0x09f9('0x10')});case _0x09f9('0x56'):logger['info'](_0x09f9('0x61'),_0x09f9('0x68'));emit(util[_0x09f9('0xd')](_0x09f9('0x57'),_0x3f6205[_0x09f9('0x12')]),_0x09f9('0x58'),{'uri':util[_0x09f9('0xd')](_0x09f9('0x59'),_0x188d40['remoteUri'][_0x09f9('0x5a')](_0x09f9('0x5b'),''),_0x29e485['id'])});break;default:logger['error']('[OUTBOUND]',_0x09f9('0x69'));}}})[_0x09f9('0x5c')](function(_0x12e8e9){logger[_0x09f9('0x6a')](_0x09f9('0x6b'),util[_0x09f9('0x5e')](_0x12e8e9,{'showHidden':!![],'depth':null}));});};exports[_0x09f9('0x6c')]=function(_0x396530,_0x4315bd,_0x55be15,_0x4a3d9d,_0xe27b0f,_0x24e2fe){var _0x36712a,_0x54bb9a;_0x24e2fe['remoteUri']=intUtil[_0x09f9('0x48')](_0x24e2fe[_0x09f9('0xf')]);_0x24e2fe[_0x09f9('0x49')]=intUtil[_0x09f9('0x48')](_0x24e2fe[_0x09f9('0x49')]);if(_0xe27b0f&&_0xe27b0f['monitor_format']){logger[_0x09f9('0x1a')]('['+_0x4315bd[_0x09f9('0x6d')][_0x09f9('0x6e')]()+']',_0x09f9('0x4c'));_0x4315bd[_0x09f9('0x4d')]=util[_0x09f9('0xd')](_0x09f9('0x62'),_0x24e2fe[_0x09f9('0x49')],_0x4315bd['uniqueid'],md5(_0x4315bd[_0x09f9('0x4e')]));}else{_0x4315bd[_0x09f9('0x4d')]='';}headers[_0x09f9('0x4f')]=getAuth(_0x24e2fe);return getUser(_0x24e2fe)['then'](function(_0x32e754){_0x36712a=_0x32e754;logger['info'](_0x09f9('0x51'),_0x36712a['id']);return getEndUser(_0x24e2fe,_0x4315bd[_0x09f9('0x52')],_0x4315bd[_0x09f9('0x53')]);})[_0x09f9('0x16')](function(_0x5d9590){_0x54bb9a=_0x5d9590;logger[_0x09f9('0x1a')](_0x09f9('0x54'),_0x54bb9a['id']);return getTicket(_0x24e2fe,_0x36712a,_0x54bb9a,_0x55be15,_0x4315bd);})[_0x09f9('0x16')](function(_0xb9828d){if(_0xb9828d){logger[_0x09f9('0x1a')](_0x09f9('0x55'),_0xb9828d['id']);}})['catch'](function(_0x28b8e2){logger[_0x09f9('0x6a')]('['+_0x4315bd[_0x09f9('0x6d')][_0x09f9('0x6e')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x09f9('0x5e')](_0x28b8e2,{'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 2d0a694..bfb8f08 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 _0x537f=['includes','picklist','type','idField','toString','variable','variableName','customVariable','Variable','toLowerCase','name','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','catch','stack','info','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','users','email','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','error','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','The\x20failing\x20result\x20is','Error:\x20','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','Recording\x20is\x20enabled!','/api/voice/recordings/','destcalleridnum','Outbound','[OUTBOUND]','Inbound','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach'];(function(_0x812830,_0x48ff7f){var _0x4a97d2=function(_0x4b2d72){while(--_0x4b2d72){_0x812830['push'](_0x812830['shift']());}};_0x4a97d2(++_0x48ff7f);}(_0x537f,0x1c4));var _0xf537=function(_0x3f257c,_0x5b1bdd){_0x3f257c=_0x3f257c-0x0;var _0xd49917=_0x537f[_0x3f257c];return _0xd49917;};'use strict';var _=require(_0xf537('0x0'));var rp=require(_0xf537('0x1'));var md5=require(_0xf537('0x2'));var util=require(_0xf537('0x3'));var intUtil=require(_0xf537('0x4'));var moment=require('moment');var Redis=require(_0xf537('0x5'));var BPromise=require(_0xf537('0x6'));var config=require(_0xf537('0x7'));var logger=require('../../../../config/logger')(_0xf537('0x8'));config['redis']=_[_0xf537('0x9')](config[_0xf537('0xa')],{'host':_0xf537('0xb'),'port':0x18eb});var io=require(_0xf537('0xc'))(new Redis(config[_0xf537('0xa')]));function emit(_0x5788c0,_0x5b788a,_0x6d099a){io['to'](_0x5788c0)[_0xf537('0xd')](_0x5b788a,_0x6d099a);}function request(_0x338cd4){logger[_0xf537('0xe')](_0xf537('0xf'),JSON[_0xf537('0x10')](_0x338cd4));return rp(_0x338cd4);}function getCustomFields(_0x457134,_0x472671){var _0x704c78={};if(_0x457134[_0xf537('0x11')]>0x0){_[_0xf537('0x12')](_0x457134,function(_0x41eba1){if(_[_0xf537('0x13')](['string',_0xf537('0x14')],_0x41eba1[_0xf537('0x15')])&&_0x41eba1['idField']){_0x704c78[_0x41eba1[_0xf537('0x16')]]=_0x41eba1['content'][_0xf537('0x17')]();}else if(_0x41eba1[_0xf537('0x15')]===_0xf537('0x18')&&_0x41eba1[_0xf537('0x19')]&&_0x41eba1[_0xf537('0x16')]&&_0x472671[_0x41eba1['variableName']]){_0x704c78[_0x41eba1[_0xf537('0x16')]]=_0x472671[_0x41eba1['variableName']][_0xf537('0x17')]();}else if(_0x41eba1[_0xf537('0x15')]===_0xf537('0x1a')&&_0x41eba1['Variable']&&_0x41eba1[_0xf537('0x1b')]['name']&&_0x41eba1[_0xf537('0x16')]&&_0x472671[_0x41eba1[_0xf537('0x1b')]['name'][_0xf537('0x1c')]()]){_0x704c78[_0x41eba1[_0xf537('0x16')]]=_0x472671[_0x41eba1['Variable'][_0xf537('0x1d')][_0xf537('0x1c')]()]['toString']();}});}return _0x704c78;}function getName(_0x41a1f4){if(_0x41a1f4['indexOf']('\x20')>0x0){var _0x448b8b=_0x41a1f4[_0xf537('0x1e')](/ (.+)/);if(_0x448b8b[0x1]){return _0x448b8b;}}return[_0x41a1f4,_0x41a1f4];}var accountsTokens={};function getAccessToken(_0xc52263){return new Promise(function(_0x500e08,_0x4e2648){if(!_[_0xf537('0x1f')](accountsTokens[_0xc52263['id']])&&!_['isNil'](accountsTokens[_0xc52263['id']][_0xf537('0x20')])){if(moment()[_0xf537('0x21')](accountsTokens[_0xc52263['id']][_0xf537('0x22')])){_0x500e08(accountsTokens[_0xc52263['id']][_0xf537('0x20')]);}}var _0x550754;switch(_0xc52263['zone']){case'US':_0x550754=_0xf537('0x23');break;case'AU':_0x550754=_0xf537('0x24');break;case'EU':_0x550754=_0xf537('0x25');break;case'IN':_0x550754=_0xf537('0x26');break;case'CN':_0x550754=_0xf537('0x27');break;default:_0x550754=_0xf537('0x25');break;}var _0x71fb1e={'method':'POST','uri':_0x550754+_0xf537('0x28'),'qs':{'refresh_token':_0xc52263[_0xf537('0x29')],'client_id':_0xc52263[_0xf537('0x2a')],'client_secret':_0xc52263[_0xf537('0x2b')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x71fb1e)[_0xf537('0x2c')](function(_0x3567a0){accountsTokens[_0xc52263['id']]={'access_token':_0x3567a0[_0xf537('0x20')],'expires_in':moment()[_0xf537('0x2d')](_0x3567a0[_0xf537('0x22')],'seconds')};_0x500e08(_0x3567a0[_0xf537('0x20')]);})[_0xf537('0x2e')](function(_0x1cd51c){logger['error']('Failing\x20creating\x20the\x20access_token',_0x1cd51c[_0xf537('0x2f')]);_0x4e2648(_0x1cd51c);});});}function getUser(_0x2efc09,_0x21e9c7,_0x180d57,_0x1b7733){logger[_0xf537('0x30')](_0xf537('0x31'));return request({'method':_0xf537('0x32'),'uri':util[_0xf537('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x21e9c7),'qs':{'type':_0xf537('0x34')},'headers':{'Authorization':_0xf537('0x35')+_0x2efc09},'json':!![]})[_0xf537('0x2c')](function(_0x26a42f){if(_0x26a42f['users']){var _0x34ef83=-0x1;if(_['isArrayLikeObject'](_0x26a42f[_0xf537('0x36')])){if(!_[_0xf537('0x1f')](_0x1b7733)){_0x34ef83=_['findIndex'](_0x26a42f[_0xf537('0x36')],function(_0x3ebe74){return _0x3ebe74[_0xf537('0x37')]===_0x1b7733;});}if(_0x34ef83>=0x0){logger[_0xf537('0x30')](_0xf537('0x38'));}else{logger[_0xf537('0x30')](_0xf537('0x39'));_0x34ef83=_[_0xf537('0x3a')](_0x26a42f[_0xf537('0x36')],function(_0x3cce4b){return _0x3cce4b[_0xf537('0x3b')][_0xf537('0x1d')]==='Administrator';});}return _0x26a42f[_0xf537('0x36')][_0x34ef83];}else{if(_0x26a42f['user'][_0xf537('0x3b')]['name']==='Administrator'){logger[_0xf537('0x30')]('Using\x20the\x20admin\x20account!');user=_0x26a42f['user'];return user;}else{logger[_0xf537('0x3c')]('The\x20failing\x20result\x20is',JSON[_0xf537('0x10')](_0x26a42f));throw new Error(_0xf537('0x3d')+JSON['stringify'](_0x26a42f));}}}else{logger[_0xf537('0x3c')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x26a42f));throw new Error(_0xf537('0x3d')+JSON[_0xf537('0x10')](_0x26a42f));}})[_0xf537('0x2e')](function(_0x33b6ef){console['error'](_0x33b6ef);});}function getZohoUser(_0x44d917,_0x308118){return new BPromise(function(_0x1a5883,_0x320d7f){request(_0x44d917)[_0xf537('0x2c')](function(_0x355c0a){var _0x53047a=null;if(_0x355c0a){_0x53047a=_0x355c0a[_0xf537('0x3e')][0x0];_0x53047a[_0xf537('0x3f')]=_0x308118;}_0x1a5883(_0x53047a);})[_0xf537('0x2e')](function(_0x5bfa8b){_0x320d7f(_0x5bfa8b);});});}function createEndUser(_0x17a693,_0x4e11b1,_0x4502e4,_0x2521c1,_0x2c8373,_0x68de36){var _0x4502e4=getName(_0x4502e4);return request({'method':_0xf537('0x40'),'uri':_0xf537('0x41')+_0x4e11b1+_0xf537('0x42')+_[_0xf537('0x43')](_0x68de36[_0xf537('0x44')])+'s','body':{'data':[{'Last_Name':_0x4502e4[0x1],'First_Name':_0x4502e4[0x0],'Phone':_0x2521c1,'Owner':{'name':!_[_0xf537('0x1f')](_0x2c8373['role']['name'])?_0x2c8373[_0xf537('0x45')][_0xf537('0x1d')]:!_['isNil'](_0x2c8373[_0xf537('0x46')])?_0x2c8373['first_name']+'\x20'+_0x2c8373['last_name']:_0x2c8373[_0xf537('0x47')],'id':_0x2c8373['id']}}]},'headers':{'Authorization':_0xf537('0x35')+_0x17a693},'json':!![]})[_0xf537('0x2c')](function(_0xaefe08){if(_0xaefe08&&_0xaefe08['data'][0x0][_0xf537('0x48')]===_0xf537('0x49')){var _0x44cb31=_0xaefe08[_0xf537('0x3e')][0x0][_0xf537('0x4a')];_0x44cb31[_0xf537('0x3f')]=_[_0xf537('0x43')](_0x68de36[_0xf537('0x44')])+'s';return _0x44cb31;}logger[_0xf537('0x3c')](_0xf537('0x4b'),JSON[_0xf537('0x10')](data));throw new Error(_0xf537('0x4c')+JSON['stringify'](data));})[_0xf537('0x2e')](function(_0x1030b5){console['log'](_0xf537('0x4d'),_0x1030b5);});}function getEndUser(_0x56bd97,_0x4df9a0,_0x11cf6e,_0x315d82,_0x302cfb,_0x2cddd0,_0x21f620){var _0xb2b921={'method':_0xf537('0x32'),'uri':'','headers':{'Authorization':_0xf537('0x35')+_0x56bd97},'json':!![]};switch(_0x21f620[_0xf537('0x4e')]){case _0xf537('0x4f'):_0xb2b921[_0xf537('0x50')]=_0xf537('0x41')+_0x4df9a0+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x302cfb+'))';return getZohoUser(_0xb2b921,'Contacts')[_0xf537('0x2c')](function(_0xec56fc){if(_0xec56fc)return _0xec56fc;_0xb2b921[_0xf537('0x50')]='https://www.zohoapis.'+_0x4df9a0+_0xf537('0x51')+_0x302cfb+'))';return getZohoUser(_0xb2b921,_0xf537('0x52'))[_0xf537('0x2c')](function(_0x4b014f){if(_0x4b014f)return _0x4b014f;if(_0x21f620[_0xf537('0x44')]!=_0xf537('0x53')){return createEndUser(_0x56bd97,_0x4df9a0,_0x315d82,_0x302cfb,_0x2cddd0,_0x21f620);}else{return{};}});});break;case _0xf537('0x54'):_0xb2b921[_0xf537('0x50')]=_0xf537('0x41')+_0x4df9a0+_0xf537('0x55')+_0x302cfb+'))';return getZohoUser(_0xb2b921,_0xf537('0x56'))[_0xf537('0x2c')](function(_0x17562d){if(_0x17562d)return _0x17562d;if(_0x21f620[_0xf537('0x44')]!=_0xf537('0x53')){return createEndUser(_0x56bd97,_0x4df9a0,_0x315d82,_0x302cfb,_0x2cddd0,_0x21f620);}else{return{};}});break;case'lead':_0xb2b921[_0xf537('0x50')]=_0xf537('0x41')+_0x4df9a0+_0xf537('0x51')+_0x302cfb+'))';return getZohoUser(_0xb2b921,'Leads')[_0xf537('0x2c')](function(_0x32c779){if(_0x32c779)return _0x32c779;if(_0x21f620['moduleCreate']!=_0xf537('0x53')){return createEndUser(_0x56bd97,_0x4df9a0,_0x315d82,_0x302cfb,_0x2cddd0,_0x21f620);}else{return{};}});break;}}function getCall(_0x46fe46,_0x275e34,_0xc9a14f,_0x5f329c,_0x46f130,_0x3ab64c,_0x59d7cd,_0x4cc4af){logger[_0xf537('0x30')](_0xf537('0x57'));var _0x18b92e={};_0x18b92e[_0xf537('0x58')]={'name':!_[_0xf537('0x1f')](_0x5f329c[_0xf537('0x45')]['name'])&&!_['isNil'](_0x5f329c[_0xf537('0x3b')][_0xf537('0x1d')])&&_0x5f329c['profile']['name']===_0xf537('0x59')?_0x5f329c[_0xf537('0x45')]['name']:!_[_0xf537('0x1f')](_0x5f329c['first_name'])?_0x5f329c[_0xf537('0x46')]+'\x20'+_0x5f329c['last_name']:_0x5f329c[_0xf537('0x47')],'id':_0x5f329c['id']};_0x18b92e[_0xf537('0x5a')]=intUtil[_0xf537('0x5b')](_0x3ab64c[_0xf537('0x5c')],_0x59d7cd,'\x20');_0x18b92e[_0xf537('0x5d')]=intUtil[_0xf537('0x5b')](_0x3ab64c[_0xf537('0x5e')],_0x59d7cd,'\x0a');if(_0x46f130[_0xf537('0x3f')]===_0xf537('0x56')){_0x18b92e[_0xf537('0x5f')]={'name':!_[_0xf537('0x1f')](_0x46f130[_0xf537('0x60')])?_0x46f130[_0xf537('0x60')]:!_[_0xf537('0x1f')](_0x46f130['First_Name'])?_0x46f130[_0xf537('0x61')]+'\x20'+_0x46f130[_0xf537('0x62')]:_0x46f130[_0xf537('0x62')],'id':_0x46f130['id']};}if(_0x46f130[_0xf537('0x3f')]==='Leads'){_0x18b92e[_0xf537('0x63')]={'name':!_[_0xf537('0x1f')](_0x46f130[_0xf537('0x60')])?_0x46f130[_0xf537('0x60')]:!_['isNil'](_0x46f130[_0xf537('0x61')])?_0x46f130['First_Name']+'\x20'+_0x46f130[_0xf537('0x62')]:_0x46f130['Last_Name'],'id':_0x46f130['id']};_0x18b92e['$se_module']=_[_0xf537('0x43')](_0x46f130[_0xf537('0x3f')]);}if(_0x59d7cd[_0xf537('0x64')]){_0x18b92e[_0xf537('0x65')]=moment[_0xf537('0x66')](parseInt(_0x59d7cd[_0xf537('0x64')])*0x3e8)[_0xf537('0x33')](_0xf537('0x67'));}else if(_0x59d7cd[_0xf537('0x68')]&&_0x59d7cd[_0xf537('0x69')]){_0x18b92e[_0xf537('0x65')]=moment[_0xf537('0x66')](moment(_0x59d7cd[_0xf537('0x69')],_0xf537('0x6a'))['diff'](moment(_0x59d7cd[_0xf537('0x6b')],'YYYY-MM-DDTHH:mm:ss')))[_0xf537('0x33')](_0xf537('0x67'));}switch(_0x59d7cd[_0xf537('0x6c')]){case _0xf537('0x6d'):_0x18b92e[_0xf537('0x6e')]=_0xf537('0x6f');break;case _0xf537('0x70'):case _0xf537('0x71'):_0x18b92e[_0xf537('0x6e')]=_0xf537('0x72');break;case _0xf537('0x73'):_0x18b92e[_0xf537('0x6e')]=_0xf537('0x74');break;case'abandoned':_0x18b92e[_0xf537('0x6e')]=_0xf537('0x75');break;case _0xf537('0x76'):_0x18b92e[_0xf537('0x6e')]=_0xf537('0x77');default:}_0x18b92e[_0xf537('0x78')]=(_0x4cc4af===_0xf537('0x79')?moment(_0x59d7cd[_0xf537('0x6b')])[_0xf537('0x33')](_0xf537('0x6a')):moment(_0x59d7cd['agentcalledAt'])[_0xf537('0x33')](_0xf537('0x6a')))||moment()[_0xf537('0x33')](_0xf537('0x6a'));_0x18b92e['Call_Type']=_0x4cc4af||'Inbound';_0x18b92e=_[_0xf537('0x7a')](_0x18b92e,getCustomFields(_0x3ab64c[_0xf537('0x7b')],_0x59d7cd));return request({'method':_0xf537('0x40'),'uri':_0xf537('0x41')+_0x275e34+_0xf537('0x7c'),'headers':{'Authorization':_0xf537('0x35')+_0x46fe46},'body':{'data':[_0x18b92e]},'json':!![]})[_0xf537('0x2c')](function(_0x37e1df){if(_0x37e1df&&_0x37e1df['data'][0x0][_0xf537('0x48')]===_0xf537('0x49')){logger[_0xf537('0x30')](_0xf537('0x7d'));return{'id':_0x37e1df[_0xf537('0x3e')][0x0][_0xf537('0x4a')]['id']};}})['catch'](function(_0x3fed64){logger[_0xf537('0x30')](_0xf537('0x7e'),_0x3fed64[_0xf537('0x2f')]);console[_0xf537('0x7f')](_0xf537('0x7e'),_0x3fed64);});}exports[_0xf537('0x80')]=function(_0x1cb47f,_0x59f5eb,_0x276e1f,_0x4fb549,_0x2cb480,_0x5dd249){var _0x291008,_0x27ad4e,_0x39981f;_0x5dd249[_0xf537('0x81')]=intUtil[_0xf537('0x82')](_0x5dd249[_0xf537('0x81')]);_0x5dd249[_0xf537('0x83')]=intUtil['stripTrailingSlash'](_0x5dd249[_0xf537('0x83')]);if(_0x2cb480&&_0x2cb480[_0xf537('0x84')]){logger[_0xf537('0x30')]('[QUEUE]','Recording\x20is\x20enabled!');_0x59f5eb[_0xf537('0x85')]=_0x5dd249[_0xf537('0x83')]+'/api/voice/recordings/'+_0x59f5eb[_0xf537('0x86')]+_0xf537('0x87')+md5(_0x59f5eb[_0xf537('0x86')]);}else{_0x59f5eb[_0xf537('0x85')]='';}var _0xf2d6c0=_0x5dd249['host']===_0xf537('0x88')?'eu':_0xf537('0x89');return getAccessToken(_0x5dd249)[_0xf537('0x2c')](function(_0x447882){_0x39981f=_0x447882;return getUser(_0x39981f,_0xf2d6c0,_0x5dd249,_0x4fb549[_0xf537('0x37')]);})[_0xf537('0x2c')](function(_0x1bfd11){_0x291008=_0x1bfd11;logger[_0xf537('0x30')](_0xf537('0x8a'),_0x291008['id']);return getEndUser(_0x39981f,_0xf2d6c0,_0x5dd249,_0x59f5eb[_0xf537('0x8b')],_0x59f5eb[_0xf537('0x8c')],_0x291008,_0x276e1f);})['then'](function(_0xea9a02){_0x27ad4e=_0xea9a02;return getCall(_0x39981f,_0xf2d6c0,_0x5dd249,_0x291008,_0x27ad4e,_0x276e1f,_0x59f5eb,'Inbound');})[_0xf537('0x2c')](function(_0x33b71c){if(_0x33b71c){logger[_0xf537('0x30')](_0xf537('0x8d'),_0x33b71c['id']);logger[_0xf537('0x30')](_0xf537('0x8e'),_0xf537('0x8f'));emit(util[_0xf537('0x33')](_0xf537('0x90'),_0x4fb549[_0xf537('0x1d')]),_0xf537('0x91'),{'uri':_0xf537('0x92')+_0x5dd249[_0xf537('0x81')]+_0xf537('0x93')+_0x33b71c['id']});}})[_0xf537('0x2e')](function(_0x2e88a3){logger['error']('[QUEUE]',JSON[_0xf537('0x10')](_0x2e88a3));});};exports[_0xf537('0x79')]=function(_0x1148d1,_0x2e5640,_0x35e059,_0x1cd83b,_0x5b2014,_0x535330,_0x51398a){var _0x42dbdd,_0x177402,_0x11c250;_0x535330[_0xf537('0x81')]=intUtil[_0xf537('0x82')](_0x535330[_0xf537('0x81')]);_0x535330[_0xf537('0x83')]=intUtil[_0xf537('0x82')](_0x535330[_0xf537('0x83')]);if(_0x51398a&&_0x51398a[_0xf537('0x94')]&&_0x51398a[_0xf537('0x94')]!==_0xf537('0x95')){logger[_0xf537('0x30')]('[OUTBOUND]',_0xf537('0x96'));_0x2e5640[_0xf537('0x85')]=_0x535330['serverUrl']+_0xf537('0x97')+_0x2e5640[_0xf537('0x86')]+'/downloads?type=uniqueid&token='+md5(_0x2e5640[_0xf537('0x86')]);}var _0x162176=_0x535330['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x535330)[_0xf537('0x2c')](function(_0x1da917){_0x11c250=_0x1da917;return getUser(_0x11c250,_0x162176,_0x535330,_0x1cd83b[_0xf537('0x37')]);})[_0xf537('0x2c')](function(_0xebf09){_0x42dbdd=_0xebf09;logger[_0xf537('0x30')](_0xf537('0x8a'),_0x42dbdd['id']);return getEndUser(_0x11c250,_0x162176,_0x535330,_0x2e5640['destcalleridname'],_0x2e5640[_0xf537('0x98')],_0x42dbdd,_0x35e059);})[_0xf537('0x2c')](function(_0x59d49c){_0x177402=_0x59d49c;return getCall(_0x11c250,_0x162176,_0x535330,_0x42dbdd,_0x177402,_0x35e059,_0x2e5640,_0xf537('0x99'));})[_0xf537('0x2c')](function(_0x5db37b){if(_0x5db37b){logger[_0xf537('0x30')](_0xf537('0x8d'),_0x5db37b['id']);logger[_0xf537('0x30')](_0xf537('0x9a'),_0xf537('0x8f'));emit(util[_0xf537('0x33')](_0xf537('0x90'),_0x1cd83b['name']),_0xf537('0x91'),{'uri':_0xf537('0x92')+_0x535330['host']+_0xf537('0x93')+_0x5db37b['id']});}})[_0xf537('0x2e')](function(_0x17d493){logger[_0xf537('0x3c')]('[OUTBOUND]',JSON[_0xf537('0x10')](_0x17d493));});};exports['unmanaged']=function(_0x3831fb,_0x21e307,_0x338741,_0x3c098c,_0x51dae9,_0x58eed4){var _0x29fc36,_0x188975,_0x543dfc;_0x58eed4[_0xf537('0x81')]=intUtil['stripTrailingSlash'](_0x58eed4[_0xf537('0x81')]);_0x58eed4[_0xf537('0x83')]=intUtil[_0xf537('0x82')](_0x58eed4[_0xf537('0x83')]);if(_0x51dae9&&_0x51dae9[_0xf537('0x84')]){logger[_0xf537('0x30')]('['+_0x21e307['lastevent']['toUpperCase']()+']',_0xf537('0x96'));_0x21e307[_0xf537('0x85')]=_0x58eed4[_0xf537('0x83')]+_0xf537('0x97')+_0x21e307[_0xf537('0x86')]+_0xf537('0x87')+md5(_0x21e307[_0xf537('0x86')]);}else{_0x21e307['recordingURL']='';}var _0x1de0ec=_0x58eed4[_0xf537('0x81')]===_0xf537('0x88')?'eu':'com';return getAccessToken(_0x58eed4)[_0xf537('0x2c')](function(_0x4495e7){_0x543dfc=_0x4495e7;return getUser(_0x543dfc,_0x1de0ec,_0x58eed4);})[_0xf537('0x2c')](function(_0x37d2fe){_0x29fc36=_0x37d2fe;logger['info']('The\x20User\x20ID\x20is:',_0x29fc36['id']);return getEndUser(_0x543dfc,_0x1de0ec,_0x58eed4,_0x21e307[_0xf537('0x8b')],_0x21e307[_0xf537('0x8c')],_0x29fc36,_0x338741);})[_0xf537('0x2c')](function(_0x437048){_0x188975=_0x437048;return getCall(_0x543dfc,_0x1de0ec,_0x58eed4,_0x29fc36,_0x188975,_0x338741,_0x21e307,_0xf537('0x9b'));})[_0xf537('0x2c')](function(_0x4251c0){if(_0x4251c0){logger['info'](_0xf537('0x8d'),_0x4251c0['id']);}})[_0xf537('0x2e')](function(_0x56f2a5){logger['error']('['+_0x21e307[_0xf537('0x6c')][_0xf537('0x9c')]()+']',JSON[_0xf537('0x10')](_0x56f2a5));});}; \ No newline at end of file +var _0xa9b7=['first_name','last_name','data','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner','administrator','Subject','Subjects','Description','getString','Descriptions','Who_Id','Last_Name','What_Id','Full_Name','First_Name','$se_module','talktime','utc','mm:ss','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','connect','Answered','rejected','abandoned','Abandoned','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','code','err','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','host','zoho.eu','com','calleridname','calleridnum','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','none','The\x20User\x20ID\x20is:','destcalleridname','Outbound','[OUTBOUND]','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','emit','[HTTP]','stringify','length','picklist','type','content','toString','variableName','idField','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','access_token','add','seconds','error','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','email','Agent\x20found!','findIndex','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','role'];(function(_0x13583c,_0x4f2af7){var _0x2191d5=function(_0x4cf184){while(--_0x4cf184){_0x13583c['push'](_0x13583c['shift']());}};_0x2191d5(++_0x4f2af7);}(_0xa9b7,0x18a));var _0x7a9b=function(_0x3e82e5,_0xcb388f){_0x3e82e5=_0x3e82e5-0x0;var _0x2338dd=_0xa9b7[_0x3e82e5];return _0x2338dd;};'use strict';var _=require(_0x7a9b('0x0'));var rp=require(_0x7a9b('0x1'));var md5=require(_0x7a9b('0x2'));var util=require(_0x7a9b('0x3'));var intUtil=require(_0x7a9b('0x4'));var moment=require(_0x7a9b('0x5'));var Redis=require(_0x7a9b('0x6'));var BPromise=require(_0x7a9b('0x7'));var config=require(_0x7a9b('0x8'));var logger=require(_0x7a9b('0x9'))(_0x7a9b('0xa'));config[_0x7a9b('0xb')]=_[_0x7a9b('0xc')](config[_0x7a9b('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7a9b('0xb')]));function emit(_0x1f1cc5,_0x5e96a4,_0x1a7da8){io['to'](_0x1f1cc5)[_0x7a9b('0xd')](_0x5e96a4,_0x1a7da8);}function request(_0x210e9f){logger['debug'](_0x7a9b('0xe'),JSON[_0x7a9b('0xf')](_0x210e9f));return rp(_0x210e9f);}function getCustomFields(_0x1fb36a,_0x3e3ccd){var _0x57723b={};if(_0x1fb36a[_0x7a9b('0x10')]>0x0){_['forEach'](_0x1fb36a,function(_0x2d4011){if(_['includes'](['string',_0x7a9b('0x11')],_0x2d4011[_0x7a9b('0x12')])&&_0x2d4011['idField']){_0x57723b[_0x2d4011['idField']]=_0x2d4011[_0x7a9b('0x13')][_0x7a9b('0x14')]();}else if(_0x2d4011[_0x7a9b('0x12')]==='variable'&&_0x2d4011[_0x7a9b('0x15')]&&_0x2d4011[_0x7a9b('0x16')]&&_0x3e3ccd[_0x2d4011['variableName']]){_0x57723b[_0x2d4011[_0x7a9b('0x16')]]=_0x3e3ccd[_0x2d4011['variableName']][_0x7a9b('0x14')]();}else if(_0x2d4011['type']===_0x7a9b('0x17')&&_0x2d4011[_0x7a9b('0x18')]&&_0x2d4011['Variable']['name']&&_0x2d4011[_0x7a9b('0x16')]&&_0x3e3ccd[_0x2d4011['Variable'][_0x7a9b('0x19')][_0x7a9b('0x1a')]()]){_0x57723b[_0x2d4011[_0x7a9b('0x16')]]=_0x3e3ccd[_0x2d4011[_0x7a9b('0x18')][_0x7a9b('0x19')][_0x7a9b('0x1a')]()][_0x7a9b('0x14')]();}});}return _0x57723b;}function getName(_0x3bfdc1){if(_0x3bfdc1[_0x7a9b('0x1b')]('\x20')>0x0){var _0x4f4a64=_0x3bfdc1[_0x7a9b('0x1c')](/ (.+)/);if(_0x4f4a64[0x1]){return _0x4f4a64;}}return[_0x3bfdc1,_0x3bfdc1];}var accountsTokens={};function getAccessToken(_0x1c2b4a){return new Promise(function(_0x570831,_0x23341b){if(!_[_0x7a9b('0x1d')](accountsTokens[_0x1c2b4a['id']])&&!_[_0x7a9b('0x1d')](accountsTokens[_0x1c2b4a['id']]['access_token'])){if(moment()[_0x7a9b('0x1e')](accountsTokens[_0x1c2b4a['id']]['expires_in'])){_0x570831(accountsTokens[_0x1c2b4a['id']]['access_token']);}}var _0x50d6f0;switch(_0x1c2b4a[_0x7a9b('0x1f')]){case'US':_0x50d6f0=_0x7a9b('0x20');break;case'AU':_0x50d6f0=_0x7a9b('0x21');break;case'EU':_0x50d6f0=_0x7a9b('0x22');break;case'IN':_0x50d6f0=_0x7a9b('0x23');break;case'CN':_0x50d6f0=_0x7a9b('0x24');break;default:_0x50d6f0='https://accounts.zoho.eu';break;}var _0x206767={'method':'POST','uri':_0x50d6f0+_0x7a9b('0x25'),'qs':{'refresh_token':_0x1c2b4a[_0x7a9b('0x26')],'client_id':_0x1c2b4a['clientId'],'client_secret':_0x1c2b4a[_0x7a9b('0x27')],'grant_type':_0x7a9b('0x28')},'json':!![]};return rp(_0x206767)[_0x7a9b('0x29')](function(_0x55baf0){accountsTokens[_0x1c2b4a['id']]={'access_token':_0x55baf0[_0x7a9b('0x2a')],'expires_in':moment()[_0x7a9b('0x2b')](_0x55baf0['expires_in'],_0x7a9b('0x2c'))};_0x570831(_0x55baf0[_0x7a9b('0x2a')]);})['catch'](function(_0x2dc3e2){logger[_0x7a9b('0x2d')]('Failing\x20creating\x20the\x20access_token',_0x2dc3e2[_0x7a9b('0x2e')]);_0x23341b(_0x2dc3e2);});});}function getUser(_0x3b23db,_0x43393f,_0x5214bd,_0x2a0853){logger[_0x7a9b('0x2f')](_0x7a9b('0x30'));return request({'method':_0x7a9b('0x31'),'uri':util[_0x7a9b('0x32')](_0x7a9b('0x33'),_0x43393f),'qs':{'type':_0x7a9b('0x34')},'headers':{'Authorization':_0x7a9b('0x35')+_0x3b23db},'json':!![]})[_0x7a9b('0x29')](function(_0x5798f5){if(_0x5798f5[_0x7a9b('0x36')]){var _0x361c63=-0x1;if(_[_0x7a9b('0x37')](_0x5798f5[_0x7a9b('0x36')])){if(!_[_0x7a9b('0x1d')](_0x2a0853)){_0x361c63=_['findIndex'](_0x5798f5[_0x7a9b('0x36')],function(_0x41df63){return _0x41df63[_0x7a9b('0x38')]===_0x2a0853;});}if(_0x361c63>=0x0){logger[_0x7a9b('0x2f')](_0x7a9b('0x39'));}else{logger[_0x7a9b('0x2f')]('Using\x20the\x20admin\x20account!');_0x361c63=_[_0x7a9b('0x3a')](_0x5798f5[_0x7a9b('0x36')],function(_0x2673b9){return _0x2673b9[_0x7a9b('0x3b')]['name']===_0x7a9b('0x3c');});}return _0x5798f5['users'][_0x361c63];}else{if(_0x5798f5['user']['profile']['name']===_0x7a9b('0x3c')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x5798f5[_0x7a9b('0x3d')];return user;}else{logger[_0x7a9b('0x2d')](_0x7a9b('0x3e'),JSON['stringify'](_0x5798f5));throw new Error(_0x7a9b('0x3f')+JSON[_0x7a9b('0xf')](_0x5798f5));}}}else{logger[_0x7a9b('0x2d')](_0x7a9b('0x3e'),JSON['stringify'](_0x5798f5));throw new Error(_0x7a9b('0x3f')+JSON[_0x7a9b('0xf')](_0x5798f5));}})[_0x7a9b('0x40')](function(_0x19ccae){console['error'](_0x19ccae);});}function getZohoUser(_0x50690e,_0x41f1c3){return new BPromise(function(_0x2fa0ff,_0x533d2e){request(_0x50690e)[_0x7a9b('0x29')](function(_0x2c8217){var _0x39dacc=null;if(_0x2c8217){_0x39dacc=_0x2c8217['data'][0x0];_0x39dacc[_0x7a9b('0x41')]=_0x41f1c3;}_0x2fa0ff(_0x39dacc);})[_0x7a9b('0x40')](function(_0x3d3186){_0x533d2e(_0x3d3186);});});}function createEndUser(_0x2be05c,_0x4d2217,_0x5585e3,_0x5bb526,_0x131653,_0xf8c0b9){var _0x5585e3=getName(_0x5585e3);return request({'method':_0x7a9b('0x42'),'uri':_0x7a9b('0x43')+_0x4d2217+_0x7a9b('0x44')+_[_0x7a9b('0x45')](_0xf8c0b9['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x5585e3[0x1],'First_Name':_0x5585e3[0x0],'Phone':_0x5bb526,'Owner':{'name':!_['isNil'](_0x131653[_0x7a9b('0x46')][_0x7a9b('0x19')])?_0x131653[_0x7a9b('0x46')][_0x7a9b('0x19')]:!_[_0x7a9b('0x1d')](_0x131653[_0x7a9b('0x47')])?_0x131653[_0x7a9b('0x47')]+'\x20'+_0x131653['last_name']:_0x131653[_0x7a9b('0x48')],'id':_0x131653['id']}}]},'headers':{'Authorization':_0x7a9b('0x35')+_0x2be05c},'json':!![]})['then'](function(_0x179217){if(_0x179217&&_0x179217[_0x7a9b('0x49')][0x0]['code']===_0x7a9b('0x4a')){var _0x39f0f2=_0x179217[_0x7a9b('0x49')][0x0][_0x7a9b('0x4b')];_0x39f0f2[_0x7a9b('0x41')]=_[_0x7a9b('0x45')](_0xf8c0b9[_0x7a9b('0x4c')])+'s';return _0x39f0f2;}logger['error'](_0x7a9b('0x3e'),JSON['stringify'](data));throw new Error(_0x7a9b('0x4d')+JSON[_0x7a9b('0xf')](data));})[_0x7a9b('0x40')](function(_0x3cf515){console[_0x7a9b('0x4e')](_0x7a9b('0x4f'),_0x3cf515);});}function getEndUser(_0x40e0b8,_0x5d9b05,_0x138b7f,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea){var _0x3385e7={'method':_0x7a9b('0x31'),'uri':'','headers':{'Authorization':_0x7a9b('0x35')+_0x40e0b8},'json':!![]};switch(_0xefd6ea[_0x7a9b('0x50')]){case'contact_lead':_0x3385e7[_0x7a9b('0x51')]=_0x7a9b('0x43')+_0x5d9b05+_0x7a9b('0x52')+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x53'))['then'](function(_0x3c8efb){if(_0x3c8efb)return _0x3c8efb;_0x3385e7['uri']=_0x7a9b('0x43')+_0x5d9b05+_0x7a9b('0x54')+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x55'))[_0x7a9b('0x29')](function(_0x553cc2){if(_0x553cc2)return _0x553cc2;if(_0xefd6ea[_0x7a9b('0x4c')]!=_0x7a9b('0x56')){return createEndUser(_0x40e0b8,_0x5d9b05,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea);}else{return{};}});});break;case _0x7a9b('0x57'):_0x3385e7[_0x7a9b('0x51')]=_0x7a9b('0x43')+_0x5d9b05+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x53'))[_0x7a9b('0x29')](function(_0x3b7f47){if(_0x3b7f47)return _0x3b7f47;if(_0xefd6ea[_0x7a9b('0x4c')]!=_0x7a9b('0x56')){return createEndUser(_0x40e0b8,_0x5d9b05,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea);}else{return{};}});break;case _0x7a9b('0x58'):_0x3385e7[_0x7a9b('0x51')]=_0x7a9b('0x43')+_0x5d9b05+_0x7a9b('0x54')+_0x2db12a+'))';return getZohoUser(_0x3385e7,_0x7a9b('0x55'))['then'](function(_0x876e01){if(_0x876e01)return _0x876e01;if(_0xefd6ea['moduleCreate']!=_0x7a9b('0x56')){return createEndUser(_0x40e0b8,_0x5d9b05,_0x490a70,_0x2db12a,_0x36f772,_0xefd6ea);}else{return{};}});break;}}function getCall(_0x443010,_0x47648a,_0x39e3b1,_0x3a5abd,_0x698eb0,_0x1ad6f7,_0x27242b,_0x34811a){logger[_0x7a9b('0x2f')]('Creating\x20new\x20call...');var _0xc1b40={};_0xc1b40[_0x7a9b('0x59')]={'name':!_[_0x7a9b('0x1d')](_0x3a5abd['role']['name'])&&!_[_0x7a9b('0x1d')](_0x3a5abd[_0x7a9b('0x3b')][_0x7a9b('0x19')])&&_0x3a5abd[_0x7a9b('0x3b')]['name']===_0x7a9b('0x5a')?_0x3a5abd[_0x7a9b('0x46')][_0x7a9b('0x19')]:!_[_0x7a9b('0x1d')](_0x3a5abd[_0x7a9b('0x47')])?_0x3a5abd[_0x7a9b('0x47')]+'\x20'+_0x3a5abd[_0x7a9b('0x48')]:_0x3a5abd[_0x7a9b('0x48')],'id':_0x3a5abd['id']};_0xc1b40[_0x7a9b('0x5b')]=intUtil['getString'](_0x1ad6f7[_0x7a9b('0x5c')],_0x27242b,'\x20');_0xc1b40[_0x7a9b('0x5d')]=intUtil[_0x7a9b('0x5e')](_0x1ad6f7[_0x7a9b('0x5f')],_0x27242b,'\x0a');if(_0x698eb0[_0x7a9b('0x41')]===_0x7a9b('0x53')){_0xc1b40[_0x7a9b('0x60')]={'name':!_['isNil'](_0x698eb0['Full_Name'])?_0x698eb0['Full_Name']:!_['isNil'](_0x698eb0['First_Name'])?_0x698eb0['First_Name']+'\x20'+_0x698eb0[_0x7a9b('0x61')]:_0x698eb0['Last_Name'],'id':_0x698eb0['id']};}if(_0x698eb0['enduserType']==='Leads'){_0xc1b40[_0x7a9b('0x62')]={'name':!_['isNil'](_0x698eb0[_0x7a9b('0x63')])?_0x698eb0['Full_Name']:!_['isNil'](_0x698eb0[_0x7a9b('0x64')])?_0x698eb0['First_Name']+'\x20'+_0x698eb0[_0x7a9b('0x61')]:_0x698eb0[_0x7a9b('0x61')],'id':_0x698eb0['id']};_0xc1b40[_0x7a9b('0x65')]=_['startCase'](_0x698eb0[_0x7a9b('0x41')]);}if(_0x27242b[_0x7a9b('0x66')]){_0xc1b40['Call_Duration']=moment[_0x7a9b('0x67')](parseInt(_0x27242b[_0x7a9b('0x66')])*0x3e8)[_0x7a9b('0x32')](_0x7a9b('0x68'));}else if(_0x27242b['answertime']&&_0x27242b['endtime']){_0xc1b40['Call_Duration']=moment['utc'](moment(_0x27242b[_0x7a9b('0x69')],'YYYY-MM-DDTHH:mm:ss')[_0x7a9b('0x6a')](moment(_0x27242b[_0x7a9b('0x6b')],_0x7a9b('0x6c'))))[_0x7a9b('0x32')](_0x7a9b('0x68'));}switch(_0x27242b[_0x7a9b('0x6d')]){case _0x7a9b('0x6e'):_0xc1b40[_0x7a9b('0x6f')]=_0x7a9b('0x70');break;case'complete':case _0x7a9b('0x71'):_0xc1b40[_0x7a9b('0x6f')]=_0x7a9b('0x72');break;case _0x7a9b('0x73'):_0xc1b40[_0x7a9b('0x6f')]='Rejected';break;case _0x7a9b('0x74'):_0xc1b40['Call_Result']=_0x7a9b('0x75');break;case'timeout':_0xc1b40['Call_Result']='Timeout';default:}_0xc1b40['Call_Start_Time']=(_0x34811a===_0x7a9b('0x76')?moment(_0x27242b[_0x7a9b('0x6b')])[_0x7a9b('0x32')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x27242b[_0x7a9b('0x77')])[_0x7a9b('0x32')](_0x7a9b('0x6c')))||moment()[_0x7a9b('0x32')](_0x7a9b('0x6c'));_0xc1b40[_0x7a9b('0x78')]=_0x34811a||_0x7a9b('0x79');_0xc1b40=_[_0x7a9b('0x7a')](_0xc1b40,getCustomFields(_0x1ad6f7[_0x7a9b('0x7b')],_0x27242b));return request({'method':_0x7a9b('0x42'),'uri':_0x7a9b('0x43')+_0x47648a+_0x7a9b('0x7c'),'headers':{'Authorization':_0x7a9b('0x35')+_0x443010},'body':{'data':[_0xc1b40]},'json':!![]})[_0x7a9b('0x29')](function(_0x49d2df){if(_0x49d2df&&_0x49d2df[_0x7a9b('0x49')][0x0][_0x7a9b('0x7d')]===_0x7a9b('0x4a')){logger[_0x7a9b('0x2f')]('Call\x20created!');return{'id':_0x49d2df[_0x7a9b('0x49')][0x0][_0x7a9b('0x4b')]['id']};}})['catch'](function(_0x3de99a){logger[_0x7a9b('0x2f')](_0x7a9b('0x7e'),_0x3de99a['stack']);console[_0x7a9b('0x4e')](_0x7a9b('0x7e'),_0x3de99a);});}exports['queue']=function(_0x4f4ef9,_0x5eefb1,_0x26d2d2,_0x523a2d,_0x182eb4,_0x358116){var _0x9b895a,_0x2dca18,_0x41a582;_0x358116['host']=intUtil[_0x7a9b('0x7f')](_0x358116['host']);_0x358116['serverUrl']=intUtil['stripTrailingSlash'](_0x358116[_0x7a9b('0x80')]);if(_0x182eb4&&_0x182eb4[_0x7a9b('0x81')]){logger[_0x7a9b('0x2f')](_0x7a9b('0x82'),_0x7a9b('0x83'));_0x5eefb1['recordingURL']=_0x358116[_0x7a9b('0x80')]+_0x7a9b('0x84')+_0x5eefb1[_0x7a9b('0x85')]+_0x7a9b('0x86')+md5(_0x5eefb1[_0x7a9b('0x85')]);}else{_0x5eefb1[_0x7a9b('0x87')]='';}var _0x1c7585=_0x358116[_0x7a9b('0x88')]===_0x7a9b('0x89')?'eu':_0x7a9b('0x8a');return getAccessToken(_0x358116)[_0x7a9b('0x29')](function(_0x2fc647){_0x41a582=_0x2fc647;return getUser(_0x41a582,_0x1c7585,_0x358116,_0x523a2d[_0x7a9b('0x38')]);})[_0x7a9b('0x29')](function(_0x21739){_0x9b895a=_0x21739;logger[_0x7a9b('0x2f')]('The\x20User\x20ID\x20is:',_0x9b895a['id']);return getEndUser(_0x41a582,_0x1c7585,_0x358116,_0x5eefb1[_0x7a9b('0x8b')],_0x5eefb1[_0x7a9b('0x8c')],_0x9b895a,_0x26d2d2);})[_0x7a9b('0x29')](function(_0x10e330){_0x2dca18=_0x10e330;return getCall(_0x41a582,_0x1c7585,_0x358116,_0x9b895a,_0x2dca18,_0x26d2d2,_0x5eefb1,'Inbound');})[_0x7a9b('0x29')](function(_0x19a1f7){if(_0x19a1f7){logger['info'](_0x7a9b('0x8d'),_0x19a1f7['id']);logger[_0x7a9b('0x2f')]('[QUEUE]',_0x7a9b('0x8e'));emit(util[_0x7a9b('0x32')](_0x7a9b('0x8f'),_0x523a2d[_0x7a9b('0x19')]),_0x7a9b('0x90'),{'uri':_0x7a9b('0x91')+_0x358116['host']+_0x7a9b('0x92')+_0x19a1f7['id']});}})[_0x7a9b('0x40')](function(_0x17294b){logger[_0x7a9b('0x2d')](_0x7a9b('0x82'),JSON[_0x7a9b('0xf')](_0x17294b));});};exports[_0x7a9b('0x76')]=function(_0x5c7f5d,_0x38afb2,_0x1b2ac0,_0x2736b7,_0x2b7b94,_0x19bdd3,_0x2d673e){var _0x268307,_0xd5653,_0x503636;_0x19bdd3['host']=intUtil[_0x7a9b('0x7f')](_0x19bdd3[_0x7a9b('0x88')]);_0x19bdd3[_0x7a9b('0x80')]=intUtil[_0x7a9b('0x7f')](_0x19bdd3[_0x7a9b('0x80')]);if(_0x2d673e&&_0x2d673e[_0x7a9b('0x93')]&&_0x2d673e['recordingFormat']!==_0x7a9b('0x94')){logger[_0x7a9b('0x2f')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x38afb2[_0x7a9b('0x87')]=_0x19bdd3[_0x7a9b('0x80')]+'/api/voice/recordings/'+_0x38afb2[_0x7a9b('0x85')]+_0x7a9b('0x86')+md5(_0x38afb2['uniqueid']);}var _0x318545=_0x19bdd3[_0x7a9b('0x88')]===_0x7a9b('0x89')?'eu':_0x7a9b('0x8a');return getAccessToken(_0x19bdd3)[_0x7a9b('0x29')](function(_0x558b98){_0x503636=_0x558b98;return getUser(_0x503636,_0x318545,_0x19bdd3,_0x2736b7[_0x7a9b('0x38')]);})[_0x7a9b('0x29')](function(_0x1ee64e){_0x268307=_0x1ee64e;logger['info'](_0x7a9b('0x95'),_0x268307['id']);return getEndUser(_0x503636,_0x318545,_0x19bdd3,_0x38afb2[_0x7a9b('0x96')],_0x38afb2['destcalleridnum'],_0x268307,_0x1b2ac0);})[_0x7a9b('0x29')](function(_0x52c962){_0xd5653=_0x52c962;return getCall(_0x503636,_0x318545,_0x19bdd3,_0x268307,_0xd5653,_0x1b2ac0,_0x38afb2,_0x7a9b('0x97'));})['then'](function(_0x44135b){if(_0x44135b){logger['info'](_0x7a9b('0x8d'),_0x44135b['id']);logger[_0x7a9b('0x2f')](_0x7a9b('0x98'),_0x7a9b('0x8e'));emit(util[_0x7a9b('0x32')](_0x7a9b('0x8f'),_0x2736b7[_0x7a9b('0x19')]),'trigger:browser:url',{'uri':'https://crm.'+_0x19bdd3[_0x7a9b('0x88')]+_0x7a9b('0x92')+_0x44135b['id']});}})[_0x7a9b('0x40')](function(_0x2dcab8){logger[_0x7a9b('0x2d')](_0x7a9b('0x98'),JSON['stringify'](_0x2dcab8));});};exports[_0x7a9b('0x99')]=function(_0x4d0c5b,_0x3c15f8,_0x48aa89,_0x4d377b,_0x585cd1,_0x417e92){var _0x38e049,_0x5f277b,_0x42ff77;_0x417e92['host']=intUtil[_0x7a9b('0x7f')](_0x417e92['host']);_0x417e92['serverUrl']=intUtil[_0x7a9b('0x7f')](_0x417e92[_0x7a9b('0x80')]);if(_0x585cd1&&_0x585cd1[_0x7a9b('0x81')]){logger['info']('['+_0x3c15f8['lastevent'][_0x7a9b('0x9a')]()+']',_0x7a9b('0x83'));_0x3c15f8[_0x7a9b('0x87')]=_0x417e92[_0x7a9b('0x80')]+_0x7a9b('0x84')+_0x3c15f8['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x3c15f8['uniqueid']);}else{_0x3c15f8[_0x7a9b('0x87')]='';}var _0x4bdece=_0x417e92[_0x7a9b('0x88')]===_0x7a9b('0x89')?'eu':_0x7a9b('0x8a');return getAccessToken(_0x417e92)[_0x7a9b('0x29')](function(_0x5a5212){_0x42ff77=_0x5a5212;return getUser(_0x42ff77,_0x4bdece,_0x417e92);})['then'](function(_0x1aa4bb){_0x38e049=_0x1aa4bb;logger[_0x7a9b('0x2f')](_0x7a9b('0x95'),_0x38e049['id']);return getEndUser(_0x42ff77,_0x4bdece,_0x417e92,_0x3c15f8[_0x7a9b('0x8b')],_0x3c15f8[_0x7a9b('0x8c')],_0x38e049,_0x48aa89);})[_0x7a9b('0x29')](function(_0x3b34d2){_0x5f277b=_0x3b34d2;return getCall(_0x42ff77,_0x4bdece,_0x417e92,_0x38e049,_0x5f277b,_0x48aa89,_0x3c15f8,_0x7a9b('0x79'));})[_0x7a9b('0x29')](function(_0x29381a){if(_0x29381a){logger[_0x7a9b('0x2f')](_0x7a9b('0x8d'),_0x29381a['id']);}})[_0x7a9b('0x40')](function(_0x295a53){logger[_0x7a9b('0x2d')]('['+_0x3c15f8[_0x7a9b('0x6d')]['toUpperCase']()+']',JSON[_0x7a9b('0xf')](_0x295a53));});}; \ 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 5f0d24b..57e97ae 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 _0x979a=['../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','info','util','shelljs'];(function(_0x13ccbd,_0xcab2bb){var _0xfae6dd=function(_0x247868){while(--_0x247868){_0x13ccbd['push'](_0x13ccbd['shift']());}};_0xfae6dd(++_0xcab2bb);}(_0x979a,0x14e));var _0xa979=function(_0x484ad6,_0x4efaee){_0x484ad6=_0x484ad6-0x0;var _0x4950d0=_0x979a[_0x484ad6];return _0x4950d0;};'use strict';var util=require(_0xa979('0x0'));var sh=require(_0xa979('0x1'));var Mustache=require('mustache');var logger=require(_0xa979('0x2'))(_0xa979('0x3'));exports[_0xa979('0x4')]=function(_0x4243bc,_0x433435){var _0x1edc4d=_0x4243bc[_0xa979('0x5')]?_0x4243bc['data2']:_0xa979('0x6');var _0x1a58e8=_0x4243bc[_0xa979('0x7')]?Mustache[_0xa979('0x8')](_0x4243bc[_0xa979('0x7')],_0x433435):_0x433435;sh[_0xa979('0x4')](_0x1a58e8,function(_0x5b6983,_0x1e47e7,_0x590c08){if(_0x5b6983!==0x0){logger[_0xa979('0x9')](util[_0xa979('0xa')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x1edc4d,_0x1a58e8,_0x5b6983,_0x590c08));}else{logger[_0xa979('0xb')](util[_0xa979('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x1edc4d,_0x1a58e8,_0x1e47e7));}});}; \ No newline at end of file +var _0xcef2=['data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','exec','data2','render'];(function(_0x22edc5,_0x3a4152){var _0x22f10f=function(_0x108c2c){while(--_0x108c2c){_0x22edc5['push'](_0x22edc5['shift']());}};_0x22f10f(++_0x3a4152);}(_0xcef2,0x69));var _0x2cef=function(_0x4b2e22,_0x282151){_0x4b2e22=_0x4b2e22-0x0;var _0x57a0ee=_0xcef2[_0x4b2e22];return _0x57a0ee;};'use strict';var util=require(_0x2cef('0x0'));var sh=require('shelljs');var Mustache=require(_0x2cef('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x2cef('0x2')]=function(_0x284830,_0x129874){var _0x46fb32=_0x284830[_0x2cef('0x3')]?_0x284830[_0x2cef('0x3')]:'Script';var _0x4999e4=_0x284830['data3']?Mustache[_0x2cef('0x4')](_0x284830[_0x2cef('0x5')],_0x129874):_0x129874;sh[_0x2cef('0x2')](_0x4999e4,function(_0x5c5ab5,_0x58261d,_0xb8bd25){if(_0x5c5ab5!==0x0){logger[_0x2cef('0x6')](util[_0x2cef('0x7')](_0x2cef('0x8'),_0x46fb32,_0x4999e4,_0x5c5ab5,_0xb8bd25));}else{logger[_0x2cef('0x9')](util[_0x2cef('0x7')](_0x2cef('0xa'),_0x46fb32,_0x4999e4,_0x58261d));}});}; \ 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 6462357..959b6bc 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 _0xfe59=['body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','util','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','error','stack','GET','POST','PUT','data7'];(function(_0xb1baec,_0x110e02){var _0x44f817=function(_0x1c4248){while(--_0x1c4248){_0xb1baec['push'](_0xb1baec['shift']());}};_0x44f817(++_0x110e02);}(_0xfe59,0xa7));var _0x9fe5=function(_0x174c80,_0x2ce564){_0x174c80=_0x174c80-0x0;var _0x188ea2=_0xfe59[_0x174c80];return _0x188ea2;};'use strict';var rp=require('request-promise');var util=require(_0x9fe5('0x0'));var _=require('lodash');var Mustache=require(_0x9fe5('0x1'));var logger=require(_0x9fe5('0x2'))(_0x9fe5('0x3'));exports[_0x9fe5('0x4')]=function(_0x1edf9a,_0x317831){var _0x7b5f8b,_0x375881;var _0x44f027={'method':_0x1edf9a[_0x9fe5('0x5')][_0x9fe5('0x6')](),'uri':Mustache[_0x9fe5('0x7')](_0x1edf9a[_0x9fe5('0x8')],_0x317831),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1edf9a[_0x9fe5('0x9')])===_0x9fe5('0xa')&&parseInt(_0x1edf9a[_0x9fe5('0x9')])>=0x1&&parseInt(_0x1edf9a['data5'])<=0xa?parseInt(_0x1edf9a[_0x9fe5('0x9')])*0x3e8:0x5*0x3e8};try{_0x44f027[_0x9fe5('0xb')]=_0x1edf9a[_0x9fe5('0xc')]?JSON['parse'](Mustache[_0x9fe5('0x7')](_0x1edf9a[_0x9fe5('0xc')],_0x317831)):{};}catch(_0x3947f6){logger[_0x9fe5('0xd')](_0x3947f6[_0x9fe5('0xe')]);}switch(_0x1edf9a[_0x9fe5('0x5')][_0x9fe5('0x6')]()){case _0x9fe5('0xf'):case'DELETE':_0x7b5f8b=null;_0x44f027['qs']=_0x317831;break;case _0x9fe5('0x10'):case _0x9fe5('0x11'):if(_0x1edf9a[_0x9fe5('0x12')]){try{_0x7b5f8b=JSON['parse'](Mustache[_0x9fe5('0x7')](_0x1edf9a['data7'],_0x317831));_0x44f027[_0x9fe5('0x13')]=_0x7b5f8b;}catch(_0x2d2c19){logger[_0x9fe5('0xd')](_0x2d2c19[_0x9fe5('0xe')]);logger[_0x9fe5('0xd')](_0x9fe5('0x14'));}}else{_0x7b5f8b=_0x317831;_0x44f027['body']=_0x7b5f8b;}break;}logger['info'](util[_0x9fe5('0x15')](_0x9fe5('0x16'),_0x1edf9a[_0x9fe5('0x5')],_0x1edf9a[_0x9fe5('0x8')],JSON['stringify'](_0x44f027)));rp(_0x44f027)['then'](function(_0xd1cb05){_0x7b5f8b=!_['isNil'](_0x7b5f8b)?',\x20request\x20body:\x20'+_0x7b5f8b:'';_0x375881=typeof _0xd1cb05[_0x9fe5('0x13')]===_0x9fe5('0x17')?JSON['stringify'](_0xd1cb05[_0x9fe5('0x13')]):_0xd1cb05[_0x9fe5('0x13')];logger[_0x9fe5('0x18')](util[_0x9fe5('0x15')](_0x9fe5('0x19'),_0x1edf9a['data1'],_0x1edf9a['data2'],_0xd1cb05['statusCode'],_0x375881));})[_0x9fe5('0x1a')](function(_0x1a3a3e){logger[_0x9fe5('0xd')](util[_0x9fe5('0x15')](_0x9fe5('0x1b'),_0x1edf9a[_0x9fe5('0x5')],_0x1edf9a[_0x9fe5('0x8')],_0x1a3a3e[_0x9fe5('0x1c')],_0x1a3a3e[_0x9fe5('0x1d')],_0x1a3a3e[_0x9fe5('0x1e')]));});}; \ No newline at end of file +var _0x9c36=['exec','toUpperCase','render','data2','data5','data6','parse','error','stack','data1','GET','POST','PUT','data7','body','info','format','then','isNil','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','../../../../config/logger','trigger'];(function(_0x540238,_0x2a4d7a){var _0x54bd92=function(_0x4ebafb){while(--_0x4ebafb){_0x540238['push'](_0x540238['shift']());}};_0x54bd92(++_0x2a4d7a);}(_0x9c36,0x88));var _0x69c3=function(_0x153d07,_0x31d657){_0x153d07=_0x153d07-0x0;var _0x1d829f=_0x9c36[_0x153d07];return _0x1d829f;};'use strict';var rp=require(_0x69c3('0x0'));var util=require(_0x69c3('0x1'));var _=require('lodash');var Mustache=require('mustache');var logger=require(_0x69c3('0x2'))(_0x69c3('0x3'));exports[_0x69c3('0x4')]=function(_0x1c91bd,_0x7bca8d){var _0x40ad5b,_0x119ebb;var _0x55a285={'method':_0x1c91bd['data1'][_0x69c3('0x5')](),'uri':Mustache[_0x69c3('0x6')](_0x1c91bd[_0x69c3('0x7')],_0x7bca8d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1c91bd[_0x69c3('0x8')])==='number'&&parseInt(_0x1c91bd[_0x69c3('0x8')])>=0x1&&parseInt(_0x1c91bd[_0x69c3('0x8')])<=0xa?parseInt(_0x1c91bd[_0x69c3('0x8')])*0x3e8:0x5*0x3e8};try{_0x55a285['headers']=_0x1c91bd[_0x69c3('0x9')]?JSON[_0x69c3('0xa')](Mustache[_0x69c3('0x6')](_0x1c91bd[_0x69c3('0x9')],_0x7bca8d)):{};}catch(_0x46243e){logger[_0x69c3('0xb')](_0x46243e[_0x69c3('0xc')]);}switch(_0x1c91bd[_0x69c3('0xd')][_0x69c3('0x5')]()){case _0x69c3('0xe'):case'DELETE':_0x40ad5b=null;_0x55a285['qs']=_0x7bca8d;break;case _0x69c3('0xf'):case _0x69c3('0x10'):if(_0x1c91bd[_0x69c3('0x11')]){try{_0x40ad5b=JSON[_0x69c3('0xa')](Mustache['render'](_0x1c91bd['data7'],_0x7bca8d));_0x55a285[_0x69c3('0x12')]=_0x40ad5b;}catch(_0x4a2f6e){logger[_0x69c3('0xb')](_0x4a2f6e[_0x69c3('0xc')]);logger[_0x69c3('0xb')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x40ad5b=_0x7bca8d;_0x55a285[_0x69c3('0x12')]=_0x40ad5b;}break;}logger[_0x69c3('0x13')](util[_0x69c3('0x14')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x1c91bd['data1'],_0x1c91bd[_0x69c3('0x7')],JSON['stringify'](_0x55a285)));rp(_0x55a285)[_0x69c3('0x15')](function(_0xa85a0d){_0x40ad5b=!_[_0x69c3('0x16')](_0x40ad5b)?',\x20request\x20body:\x20'+_0x40ad5b:'';_0x119ebb=typeof _0xa85a0d[_0x69c3('0x12')]==='object'?JSON['stringify'](_0xa85a0d['body']):_0xa85a0d[_0x69c3('0x12')];logger[_0x69c3('0x13')](util[_0x69c3('0x14')](_0x69c3('0x17'),_0x1c91bd['data1'],_0x1c91bd[_0x69c3('0x7')],_0xa85a0d[_0x69c3('0x18')],_0x119ebb));})[_0x69c3('0x19')](function(_0x187af4){logger['error'](util[_0x69c3('0x14')](_0x69c3('0x1a'),_0x1c91bd['data1'],_0x1c91bd['data2'],_0x187af4[_0x69c3('0x18')],_0x187af4[_0x69c3('0x1b')],_0x187af4['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8b8ddec..0972982 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 _0x31a2=['message','result','catch','jayson/promise','routing','client','http','Request','request','then','debug','rpc','error'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x31a2,0x16f));var _0x231a=function(_0x4649a3,_0x3ce198){_0x4649a3=_0x4649a3-0x0;var _0x38c9a2=_0x31a2[_0x4649a3];return _0x38c9a2;};'use strict';var jayson=require(_0x231a('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x231a('0x1'));var client=jayson[_0x231a('0x2')][_0x231a('0x3')]({'port':0x2329});client[_0x231a('0x4')]=function(_0x3d0b95,_0x17e7f6){return new BPromise(function(_0x3bf04f,_0xfc7a1e){return client[_0x231a('0x5')](_0x3d0b95,_0x17e7f6)[_0x231a('0x6')](function(_0x41552b){logger[_0x231a('0x7')](_0x231a('0x8'),_0x231a('0x1'),_0x3d0b95,_0x17e7f6,_0x41552b);if(_0x41552b['error']){logger[_0x231a('0x9')]('rpc',_0x231a('0x1'),_0x3d0b95,_0x41552b['error'][_0x231a('0xa')],_0x17e7f6);return _0xfc7a1e(_0x41552b['error'][_0x231a('0xa')]);}else{return _0x3bf04f(_0x41552b[_0x231a('0xb')]);}})[_0x231a('0xc')](function(_0x52684d){logger['error'](_0x231a('0x8'),_0x231a('0x1'),_0x3d0b95,_0x52684d,_0x17e7f6);return _0xfc7a1e(_0x52684d);});});};module['exports']=client; \ No newline at end of file +var _0x85ed=['jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','routing','error','rpc','message','result','catch','exports'];(function(_0x4bb366,_0x582499){var _0x39bbec=function(_0xad0d64){while(--_0xad0d64){_0x4bb366['push'](_0x4bb366['shift']());}};_0x39bbec(++_0x582499);}(_0x85ed,0x140));var _0xd85e=function(_0x277107,_0x3420dc){_0x277107=_0x277107-0x0;var _0x1da046=_0x85ed[_0x277107];return _0x1da046;};'use strict';var jayson=require(_0xd85e('0x0'));var BPromise=require(_0xd85e('0x1'));var logger=require(_0xd85e('0x2'))('routing');var client=jayson[_0xd85e('0x3')][_0xd85e('0x4')]({'port':0x2329});client[_0xd85e('0x5')]=function(_0x1f2453,_0x2d9b3e){return new BPromise(function(_0x21f934,_0xde2d8){return client[_0xd85e('0x6')](_0x1f2453,_0x2d9b3e)[_0xd85e('0x7')](function(_0x381dac){logger[_0xd85e('0x8')]('rpc',_0xd85e('0x9'),_0x1f2453,_0x2d9b3e,_0x381dac);if(_0x381dac[_0xd85e('0xa')]){logger[_0xd85e('0xa')](_0xd85e('0xb'),_0xd85e('0x9'),_0x1f2453,_0x381dac[_0xd85e('0xa')]['message'],_0x2d9b3e);return _0xde2d8(_0x381dac[_0xd85e('0xa')][_0xd85e('0xc')]);}else{return _0x21f934(_0x381dac[_0xd85e('0xd')]);}})[_0xd85e('0xe')](function(_0x3b7f83){logger[_0xd85e('0xa')](_0xd85e('0xb'),_0xd85e('0x9'),_0x1f2453,_0x3b7f83,_0x2d9b3e);return _0xde2d8(_0x3b7f83);});});};module[_0xd85e('0xf')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 496a4f7..be42962 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 _0xba38=['initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','log','./server','./realtime','./lib/email','./rpc/setting','then','getMailAccounts'];(function(_0x292a71,_0x44631b){var _0x213949=function(_0xbea2fe){while(--_0xbea2fe){_0x292a71['push'](_0x292a71['shift']());}};_0x213949(++_0x44631b);}(_0xba38,0x190));var _0x8ba3=function(_0x213a4c,_0xdf152d){_0x213a4c=_0x213a4c-0x0;var _0x1a8ee6=_0xba38[_0x213a4c];return _0x1a8ee6;};'use strict';var BPromise=require('bluebird');var server=require(_0x8ba3('0x0'));var Realtime=require(_0x8ba3('0x1'));var EmailChannel=require(_0x8ba3('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0x8ba3('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x8ba3('0x4')](mailAccount[_0x8ba3('0x5')]())[_0x8ba3('0x4')](realtime[_0x8ba3('0x6')]())[_0x8ba3('0x4')](function(){email[_0x8ba3('0x7')](realtime[_0x8ba3('0x8')]);return realtime;});}function main(){return server[_0x8ba3('0x9')](realtime,email)[_0x8ba3('0x4')](function(){return initRealtime();})[_0x8ba3('0x4')](function(){return setting[_0x8ba3('0xa')]();})[_0x8ba3('0x4')](function(_0x47b61b){return setInterval(initRealtime,_0x47b61b[_0x8ba3('0xb')]*0x3e8);})[_0x8ba3('0xc')](function(_0x49e57b){console[_0x8ba3('0xd')](_0x49e57b);});}main(); \ No newline at end of file +var _0x5829=['./rpc/mailAccount','resolve','getMailAccounts','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','bluebird','./server','./realtime'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x5829,0xf4));var _0x9582=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x5829[_0x2aa0e7];return _0x1472c0;};'use strict';var BPromise=require(_0x9582('0x0'));var server=require(_0x9582('0x1'));var Realtime=require(_0x9582('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x9582('0x3'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x9582('0x4')]()['then'](mailAccount[_0x9582('0x5')]())[_0x9582('0x6')](realtime[_0x9582('0x7')]())[_0x9582('0x6')](function(){email[_0x9582('0x8')](realtime[_0x9582('0x9')]);return realtime;});}function main(){return server[_0x9582('0xa')](realtime,email)[_0x9582('0x6')](function(){return initRealtime();})[_0x9582('0x6')](function(){return setting[_0x9582('0xb')]();})[_0x9582('0x6')](function(_0x4a1395){return setInterval(initRealtime,_0x4a1395[_0x9582('0xc')]*0x3e8);})['catch'](function(_0x1e61f3){console['log'](_0x1e61f3);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 80c9bd7..e272f71 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 _0x6fef=['active','Imap','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','messageStatus','status','connected','messages','total','firstName','lastName','from','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','verifySmtp','Smtp','lastSync','then','verified','verify','exports','lodash','moment','bluebird','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x6fef,0xc1));var _0xf6fe=function(_0x3a5967,_0x2c7bd8){_0x3a5967=_0x3a5967-0x0;var _0x16f712=_0x6fef[_0x3a5967];return _0x16f712;};'use strict';var _=require(_0xf6fe('0x0'));var moment=require(_0xf6fe('0x1'));var BPromise=require(_0xf6fe('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xf6fe('0x3'));var logger=require('../../../config/logger')(_0xf6fe('0x4'));config[_0xf6fe('0x5')]=_[_0xf6fe('0x6')](config[_0xf6fe('0x5')],{'host':_0xf6fe('0x7'),'port':0x18eb});var io=require(_0xf6fe('0x8'))(new Redis(config[_0xf6fe('0x5')]));var EmailImap=require(_0xf6fe('0x9'));var EmailSmtp=require(_0xf6fe('0xa'));var mailAccount=require(_0xf6fe('0xb'));var md5Accounts={};function EmailChannel(_0x3edff3){logger[_0xf6fe('0xc')]('start\x20email\x20channel');this[_0xf6fe('0xd')]=_0x3edff3[_0xf6fe('0xd')];this[_0xf6fe('0xe')]={};this[_0xf6fe('0xf')]=new EmailSmtp();}EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x11')]=function(_0x5107e9){var _0x48ae7b=this[_0xf6fe('0xd')][_0x5107e9];var _0xa4dc44={'id':_0x48ae7b['id'],'name':_0x48ae7b[_0xf6fe('0x12')],'key':_0x48ae7b['key'],'active':_0x48ae7b[_0xf6fe('0x13')],'Imap':{'status':_0x48ae7b[_0xf6fe('0x14')]['status'],'messageStatus':_0x48ae7b[_0xf6fe('0x14')]['messageStatus'],'total':_0x48ae7b[_0xf6fe('0x14')]['total']}};if(_[_0xf6fe('0x15')](md5Accounts[_0x5107e9])){md5Accounts[_0x5107e9]={};}var _0x1ba00e=md5(JSON[_0xf6fe('0x16')](_0xa4dc44));if(md5Accounts[_0x5107e9]['md5']!==_0x1ba00e){md5Accounts[_0x5107e9][_0xf6fe('0x17')]=_0x1ba00e;io['emit'](_0xf6fe('0x18'),_0xa4dc44);}};EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x19')]=function(_0x38c25b){for(var _0x38716f in _0x38c25b){if(_0x38c25b[_0xf6fe('0x1a')](_0x38716f)){if(_0x38c25b[_0x38716f][_0xf6fe('0x14')]&&_0x38c25b[_0x38716f]['active']){var _0x48fe1b=_0x38c25b[_0x38716f][_0xf6fe('0x14')];if(!this[_0xf6fe('0xe')]['hasOwnProperty'](_0x48fe1b['id'])){this[_0xf6fe('0xe')][_0x48fe1b['id']]=new EmailImap(_0x48fe1b,_0x38c25b[_0x38716f][_0xf6fe('0x4')]);this[_0xf6fe('0xe')][_0x48fe1b['id']]['on'](_0xf6fe('0x1b'),this[_0xf6fe('0x1c')][_0xf6fe('0x1d')](this,_0x38716f));this[_0xf6fe('0xe')][_0x48fe1b['id']]['on'](_0xf6fe('0x4'),this[_0xf6fe('0x1e')]['bind'](this,_0x38716f));this['imapAccounts'][_0x48fe1b['id']]['on']('end',this[_0xf6fe('0x1f')][_0xf6fe('0x1d')](this,_0x38716f));this[_0xf6fe('0xe')][_0x48fe1b['id']]['on'](_0xf6fe('0x20'),this[_0xf6fe('0x21')][_0xf6fe('0x1d')](this,_0x38716f));}}else{if(_[_0xf6fe('0x15')](this[_0xf6fe('0xd')][_0x38716f][_0xf6fe('0x14')])){this[_0xf6fe('0xd')][_0x38716f][_0xf6fe('0x14')]={};}this[_0xf6fe('0xd')][_0x38716f][_0xf6fe('0x14')]['status']=_0xf6fe('0x22');this['mailAccounts'][_0x38716f][_0xf6fe('0x14')][_0xf6fe('0x23')]='';this[_0xf6fe('0x11')](_0x38716f);}}}};EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x1c')]=function(_0xb9ec07,_0x207f7a){if(this[_0xf6fe('0xd')][_0xb9ec07]){this['mailAccounts'][_0xb9ec07][_0xf6fe('0x14')][_0xf6fe('0x24')]=_0xf6fe('0x25');this[_0xf6fe('0xd')][_0xb9ec07][_0xf6fe('0x14')][_0xf6fe('0x23')]=_0x207f7a['name'];if(_0x207f7a[_0xf6fe('0x26')]){this[_0xf6fe('0xd')][_0xb9ec07][_0xf6fe('0x14')][_0xf6fe('0x27')]=_0x207f7a[_0xf6fe('0x26')]['total'];}return this['emit'](_0xb9ec07);}};EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x1e')]=function(_0x32c8e4,_0x11de4e){logger[_0xf6fe('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x11de4e[_0xf6fe('0x28')],_0x11de4e[_0xf6fe('0x29')],_0x11de4e[_0xf6fe('0x2a')],_0x32c8e4);if(this[_0xf6fe('0xd')][_0x32c8e4]){return mailAccount['notify'](_0x32c8e4,_0x11de4e)['then'](function(_0x560337){if(_0x560337){logger['info'](_0xf6fe('0x2b'));}})['catch'](function(_0x5aa67b){logger[_0xf6fe('0x20')](_0xf6fe('0x2c'),JSON[_0xf6fe('0x16')](_0x5aa67b));});}};EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x1f')]=function(_0xd44a33){if(this[_0xf6fe('0xd')][_0xd44a33]&&this[_0xf6fe('0xd')][_0xd44a33]['Imap']){if(this[_0xf6fe('0xe')][this['mailAccounts'][_0xd44a33][_0xf6fe('0x14')]['id']]){delete this[_0xf6fe('0xe')][this[_0xf6fe('0xd')][_0xd44a33][_0xf6fe('0x14')]['id']];}this[_0xf6fe('0xd')][_0xd44a33][_0xf6fe('0x14')]['lastSync']=moment();this[_0xf6fe('0x11')](_0xd44a33);}};EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x21')]=function(_0x1c11b7,_0x1fff42){if(this['mailAccounts'][_0x1c11b7]){this[_0xf6fe('0xd')][_0x1c11b7][_0xf6fe('0x14')][_0xf6fe('0x24')]=_0xf6fe('0x20');this[_0xf6fe('0xd')][_0x1c11b7][_0xf6fe('0x14')][_0xf6fe('0x23')]=_0x1fff42;return this['emit'](_0x1c11b7);}};EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x2d')]=function(_0x5b984f,_0x1dc4a7){return this['smtp']['send'](_0x5b984f,_0x1dc4a7);};EmailChannel[_0xf6fe('0x10')][_0xf6fe('0x2e')]=function(_0x128f94){var _0x187eae=this;if(this[_0xf6fe('0xd')][_0x128f94['id']]){if(_[_0xf6fe('0x15')](this['mailAccounts'][_0x128f94['id']][_0xf6fe('0x2f')])){this[_0xf6fe('0xd')][_0x128f94['id']][_0xf6fe('0x2f')]={};}this[_0xf6fe('0xd')][_0x128f94['id']][_0xf6fe('0x2f')][_0xf6fe('0x30')]=moment();return new BPromise(function(_0x552c12,_0x132cf4){return _0x187eae[_0xf6fe('0xf')]['verify'](_0x128f94)[_0xf6fe('0x31')](function(_0x497170){_0x187eae['mailAccounts'][_0x128f94['id']][_0xf6fe('0x2f')]['status']=_0xf6fe('0x32');_0x187eae['mailAccounts'][_0x128f94['id']][_0xf6fe('0x2f')][_0xf6fe('0x23')]='';_0x187eae[_0xf6fe('0x11')](_0x128f94['id']);_0x552c12(_0x497170);})['catch'](function(_0x10b22b){_0x187eae[_0xf6fe('0xd')][_0x128f94['id']][_0xf6fe('0x2f')][_0xf6fe('0x24')]=_0xf6fe('0x20');_0x187eae[_0xf6fe('0xd')][_0x128f94['id']][_0xf6fe('0x2f')][_0xf6fe('0x23')]=_0x10b22b;_0x187eae['emit'](_0x128f94['id']);_0x132cf4(_0x10b22b);});});}return this[_0xf6fe('0xf')][_0xf6fe('0x33')](_0x128f94);};module[_0xf6fe('0x34')]=EmailChannel; \ No newline at end of file +var _0x001e=['mailAccounts','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','box','bind','handleImapEmail','handleImapEnd','error','handleImapError','status','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verified','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x001e,0x1c1));var _0xe001=function(_0x395be8,_0x285479){_0x395be8=_0x395be8-0x0;var _0x5ceb20=_0x001e[_0x395be8];return _0x5ceb20;};'use strict';var _=require(_0xe001('0x0'));var moment=require(_0xe001('0x1'));var BPromise=require(_0xe001('0x2'));var md5=require(_0xe001('0x3'));var Redis=require(_0xe001('0x4'));var config=require(_0xe001('0x5'));var logger=require(_0xe001('0x6'))(_0xe001('0x7'));config[_0xe001('0x8')]=_['defaults'](config[_0xe001('0x8')],{'host':_0xe001('0x9'),'port':0x18eb});var io=require(_0xe001('0xa'))(new Redis(config[_0xe001('0x8')]));var EmailImap=require(_0xe001('0xb'));var EmailSmtp=require(_0xe001('0xc'));var mailAccount=require(_0xe001('0xd'));var md5Accounts={};function EmailChannel(_0x160ee5){logger[_0xe001('0xe')]('start\x20email\x20channel');this[_0xe001('0xf')]=_0x160ee5['mailAccounts'];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0xe001('0x10')][_0xe001('0x11')]=function(_0x20d393){var _0x2a3db5=this[_0xe001('0xf')][_0x20d393];var _0x242191={'id':_0x2a3db5['id'],'name':_0x2a3db5[_0xe001('0x12')],'key':_0x2a3db5[_0xe001('0x13')],'active':_0x2a3db5[_0xe001('0x14')],'Imap':{'status':_0x2a3db5[_0xe001('0x15')]['status'],'messageStatus':_0x2a3db5[_0xe001('0x15')][_0xe001('0x16')],'total':_0x2a3db5[_0xe001('0x15')][_0xe001('0x17')]}};if(_[_0xe001('0x18')](md5Accounts[_0x20d393])){md5Accounts[_0x20d393]={};}var _0x132bbe=md5(JSON[_0xe001('0x19')](_0x242191));if(md5Accounts[_0x20d393][_0xe001('0x3')]!==_0x132bbe){md5Accounts[_0x20d393][_0xe001('0x3')]=_0x132bbe;io['emit'](_0xe001('0x1a'),_0x242191);}};EmailChannel['prototype'][_0xe001('0x1b')]=function(_0x4a8692){for(var _0x39d378 in _0x4a8692){if(_0x4a8692[_0xe001('0x1c')](_0x39d378)){if(_0x4a8692[_0x39d378]['Imap']&&_0x4a8692[_0x39d378]['active']){var _0xe1b4e1=_0x4a8692[_0x39d378][_0xe001('0x15')];if(!this[_0xe001('0x1d')][_0xe001('0x1c')](_0xe1b4e1['id'])){this[_0xe001('0x1d')][_0xe1b4e1['id']]=new EmailImap(_0xe1b4e1,_0x4a8692[_0x39d378][_0xe001('0x7')]);this[_0xe001('0x1d')][_0xe1b4e1['id']]['on'](_0xe001('0x1e'),this['handleImapBox'][_0xe001('0x1f')](this,_0x39d378));this[_0xe001('0x1d')][_0xe1b4e1['id']]['on'](_0xe001('0x7'),this[_0xe001('0x20')]['bind'](this,_0x39d378));this[_0xe001('0x1d')][_0xe1b4e1['id']]['on']('end',this[_0xe001('0x21')][_0xe001('0x1f')](this,_0x39d378));this[_0xe001('0x1d')][_0xe1b4e1['id']]['on'](_0xe001('0x22'),this[_0xe001('0x23')][_0xe001('0x1f')](this,_0x39d378));}}else{if(_[_0xe001('0x18')](this[_0xe001('0xf')][_0x39d378][_0xe001('0x15')])){this[_0xe001('0xf')][_0x39d378]['Imap']={};}this[_0xe001('0xf')][_0x39d378]['Imap'][_0xe001('0x24')]=_0xe001('0x25');this['mailAccounts'][_0x39d378][_0xe001('0x15')][_0xe001('0x16')]='';this[_0xe001('0x11')](_0x39d378);}}}};EmailChannel[_0xe001('0x10')][_0xe001('0x26')]=function(_0xe7220e,_0x40cf15){if(this[_0xe001('0xf')][_0xe7220e]){this[_0xe001('0xf')][_0xe7220e][_0xe001('0x15')][_0xe001('0x24')]=_0xe001('0x27');this[_0xe001('0xf')][_0xe7220e][_0xe001('0x15')][_0xe001('0x16')]=_0x40cf15[_0xe001('0x12')];if(_0x40cf15['messages']){this[_0xe001('0xf')][_0xe7220e]['Imap'][_0xe001('0x17')]=_0x40cf15[_0xe001('0x28')]['total'];}return this['emit'](_0xe7220e);}};EmailChannel['prototype'][_0xe001('0x20')]=function(_0x492b7f,_0x4a4896){logger[_0xe001('0xe')](_0xe001('0x29'),_0x4a4896['firstName'],_0x4a4896[_0xe001('0x2a')],_0x4a4896[_0xe001('0x2b')],_0x492b7f);if(this[_0xe001('0xf')][_0x492b7f]){return mailAccount[_0xe001('0x2c')](_0x492b7f,_0x4a4896)[_0xe001('0x2d')](function(_0x581928){if(_0x581928){logger[_0xe001('0xe')](_0xe001('0x2e'));}})[_0xe001('0x2f')](function(_0x2eaf02){logger['error'](_0xe001('0x30'),JSON[_0xe001('0x19')](_0x2eaf02));});}};EmailChannel[_0xe001('0x10')][_0xe001('0x21')]=function(_0x26b277){if(this[_0xe001('0xf')][_0x26b277]&&this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')]){if(this[_0xe001('0x1d')][this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')]['id']]){delete this[_0xe001('0x1d')][this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')]['id']];}this[_0xe001('0xf')][_0x26b277][_0xe001('0x15')][_0xe001('0x31')]=moment();this['emit'](_0x26b277);}};EmailChannel[_0xe001('0x10')][_0xe001('0x23')]=function(_0x39b040,_0x50d67e){if(this[_0xe001('0xf')][_0x39b040]){this['mailAccounts'][_0x39b040]['Imap'][_0xe001('0x24')]='error';this['mailAccounts'][_0x39b040][_0xe001('0x15')]['messageStatus']=_0x50d67e;return this[_0xe001('0x11')](_0x39b040);}};EmailChannel[_0xe001('0x10')][_0xe001('0x32')]=function(_0x14be89,_0x2af218){return this[_0xe001('0x33')][_0xe001('0x34')](_0x14be89,_0x2af218);};EmailChannel[_0xe001('0x10')][_0xe001('0x35')]=function(_0xfd23c5){var _0x11676a=this;if(this[_0xe001('0xf')][_0xfd23c5['id']]){if(_['isNil'](this[_0xe001('0xf')][_0xfd23c5['id']]['Smtp'])){this[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')]={};}this['mailAccounts'][_0xfd23c5['id']][_0xe001('0x36')]['lastSync']=moment();return new BPromise(function(_0x5d1690,_0x531b97){return _0x11676a[_0xe001('0x33')]['verify'](_0xfd23c5)[_0xe001('0x2d')](function(_0x3d731e){_0x11676a[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x24')]=_0xe001('0x37');_0x11676a['mailAccounts'][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x16')]='';_0x11676a[_0xe001('0x11')](_0xfd23c5['id']);_0x5d1690(_0x3d731e);})['catch'](function(_0x4844eb){_0x11676a[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x24')]=_0xe001('0x22');_0x11676a[_0xe001('0xf')][_0xfd23c5['id']][_0xe001('0x36')][_0xe001('0x16')]=_0x4844eb;_0x11676a[_0xe001('0x11')](_0xfd23c5['id']);_0x531b97(_0x4844eb);});});}return this['smtp'][_0xe001('0x38')](_0xfd23c5);};module[_0xe001('0x39')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 5c54e03..c9b304d 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 _0x5304=['prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','end','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','closeBox','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','mailparser','simpleParser','iconv','events','./utils','email','mailbox','INBOX','account','getAccount','imap','once','error','handleError','bind','connect','inherits'];(function(_0x397eb2,_0x3a92f1){var _0x183633=function(_0x3d63ad){while(--_0x3d63ad){_0x397eb2['push'](_0x397eb2['shift']());}};_0x183633(++_0x3a92f1);}(_0x5304,0x167));var _0x4530=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0x5304[_0x3e32a8];return _0x2997b0;};'use strict';var fs=require('fs');var path=require(_0x4530('0x0'));var util=require(_0x4530('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x4530('0x2'))[_0x4530('0x3')];var Iconv=require(_0x4530('0x4'))['Iconv'];var EventEmitter=require(_0x4530('0x5'))['EventEmitter'];var utils=require(_0x4530('0x6'));var logger=require('../../../config/logger')(_0x4530('0x7'));function EmailImap(_0x578432,_0x18d8de){this[_0x4530('0x8')]=_0x4530('0x9');this[_0x4530('0xa')]=this[_0x4530('0xb')](_0x578432,_0x18d8de);this['imap']=new Imap(this[_0x4530('0xa')]);this[_0x4530('0xc')][_0x4530('0xd')]('ready',this['handleReady']['bind'](this));this['imap']['once']('end',this['handleEnd']['bind'](this));this[_0x4530('0xc')]['on'](_0x4530('0xe'),this[_0x4530('0xf')][_0x4530('0x10')](this));this[_0x4530('0xc')][_0x4530('0x11')]();}util[_0x4530('0x12')](EmailImap,EventEmitter);EmailImap[_0x4530('0x13')][_0x4530('0xb')]=function(_0x4ed52b,_0xcce6b8){var _0x46363f={'connTimeout':_0x4ed52b[_0x4530('0x14')]?_0x4ed52b[_0x4530('0x14')]*0x3e8:0x2710,'authTimeout':_0x4ed52b['authTimeout']?_0x4ed52b[_0x4530('0x15')]*0x3e8:0x1388};if(_[_0x4530('0x16')](_0x4ed52b[_0x4530('0x17')])){if(_0x4ed52b[_0x4530('0x18')]){_0x46363f[_0x4530('0x19')]=_0x4ed52b[_0x4530('0x19')];_0x46363f['password']=_0x4ed52b[_0x4530('0x1a')];}_0x46363f[_0x4530('0x1b')]=_0x4ed52b[_0x4530('0x1b')];_0x46363f[_0x4530('0x1c')]=_0x4ed52b[_0x4530('0x1c')]||0x3e1;if(_0x4ed52b['tls']){_0x46363f[_0x4530('0x1d')]=!![];}else{_0x46363f['tls']=![];_0x46363f[_0x4530('0x1e')]=_0x4530('0x1f');}}else{_0x46363f[_0x4530('0x19')]=_0x4ed52b['user'];_0x46363f['password']=_0x4ed52b['password'];_0x46363f['host']=utils[_0x4530('0x20')](_0x4ed52b['service']);_0x46363f[_0x4530('0x1c')]=0x3e1;_0x46363f[_0x4530('0x1d')]=!![];}_0x46363f[_0x4530('0x7')]=_0xcce6b8||_0x4ed52b['user']||_0x4530('0x21');return _0x46363f;};EmailImap[_0x4530('0x13')][_0x4530('0x22')]=function(){this[_0x4530('0xc')][_0x4530('0x23')](this['mailbox'],![],this[_0x4530('0x24')][_0x4530('0x10')](this));};EmailImap[_0x4530('0x13')][_0x4530('0x24')]=function(_0x3a2eb3,_0x320862){if(_0x3a2eb3){this[_0x4530('0xf')](_0x3a2eb3,!![]);}else{this[_0x4530('0x25')](_0x4530('0x26'),_0x320862);this[_0x4530('0x27')]();}};EmailImap['prototype'][_0x4530('0x28')]=function(_0x1cbf7e){if(_0x1cbf7e){this[_0x4530('0xf')](_0x1cbf7e,!![]);}else{this['imap'][_0x4530('0x29')]();}};EmailImap[_0x4530('0x13')]['readUnseen']=function(){this['imap']['search']([_0x4530('0x2a')],this[_0x4530('0x2b')][_0x4530('0x10')](this));};EmailImap[_0x4530('0x13')]['handleReadUnseen']=function(_0x5218e4,_0x1c5e3d){if(_0x5218e4){this[_0x4530('0xf')](_0x5218e4,!![]);}else{if(_0x1c5e3d[_0x4530('0x2c')]){try{var _0x15337c=this[_0x4530('0xc')]['fetch'](_0x1c5e3d,{'bodies':'','markSeen':!![]});_0x15337c['on'](_0x4530('0x2d'),this[_0x4530('0x2e')]['bind'](this));_0x15337c['once']('error',this[_0x4530('0x2f')][_0x4530('0x10')](this));_0x15337c[_0x4530('0xd')](_0x4530('0x29'),this[_0x4530('0x30')][_0x4530('0x10')](this));}catch(_0x5149e9){logger[_0x4530('0xe')](_0x5149e9);}}else{this[_0x4530('0xc')]['closeBox'](!![],this[_0x4530('0x28')][_0x4530('0x10')](this));}}};EmailImap['prototype'][_0x4530('0x2e')]=function(_0x45a419,_0xaf5b5e){_0x45a419['on'](_0x4530('0x31'),this[_0x4530('0x32')][_0x4530('0x10')](this));_0x45a419[_0x4530('0xd')](_0x4530('0x33'),this[_0x4530('0x34')][_0x4530('0x10')](this));_0x45a419[_0x4530('0xd')](_0x4530('0x29'),this['handleMessageEnd'][_0x4530('0x10')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x348de3,_0x2e09bc){simpleParser(_0x348de3,{'Iconv':Iconv},this[_0x4530('0x35')][_0x4530('0x10')](this));};EmailImap['prototype']['handleMessageAttributes']=function(_0x50de21){};EmailImap[_0x4530('0x13')][_0x4530('0x36')]=function(){};EmailImap[_0x4530('0x13')][_0x4530('0x35')]=function(_0x2c7f96,_0xf21fa3){if(_0x2c7f96){logger[_0x4530('0xe')](_0x2c7f96);}else{var _0x1bed7b=this;utils[_0x4530('0x37')](this[_0x4530('0xa')],_0xf21fa3,function(_0x441353){_0x1bed7b[_0x4530('0x25')](_0x4530('0x7'),_0x441353);});}};EmailImap[_0x4530('0x13')][_0x4530('0x30')]=function(){this[_0x4530('0xc')][_0x4530('0x38')](!![],this[_0x4530('0x28')][_0x4530('0x10')](this));};EmailImap[_0x4530('0x13')][_0x4530('0x2f')]=function(_0x386cb5){this[_0x4530('0xf')](_0x386cb5);this['imap'][_0x4530('0x38')](!![],this[_0x4530('0x28')][_0x4530('0x10')](this));};EmailImap[_0x4530('0x13')][_0x4530('0x39')]=function(){this[_0x4530('0x25')](_0x4530('0x29'));};EmailImap[_0x4530('0x13')][_0x4530('0xf')]=function(_0x27d926,_0x365ecc){logger[_0x4530('0xe')](_0x4530('0xf'),this['account']['email'],JSON[_0x4530('0x3a')](_0x27d926));var _0x2a5e8b='';if(_0x27d926){if(_0x27d926[_0x4530('0x3b')]){_0x2a5e8b=_0x27d926[_0x4530('0x3b')];}else{for(var _0x1d33a4 in _0x27d926){if(_0x27d926[_0x4530('0x3c')](_0x1d33a4)){_0x2a5e8b+=_[_0x4530('0x3d')](_0x1d33a4)+':\x20'+_0x27d926[_0x1d33a4]+'\x0a';}}}}if(_0x365ecc){this['imap'][_0x4530('0x29')]();}else{this[_0x4530('0x25')]('error',_0x2a5e8b);this[_0x4530('0x25')](_0x4530('0x29'));}};module[_0x4530('0x3e')]=EmailImap; \ No newline at end of file +var _0x9d9b=['handleMessageEnd','handleSimpleParser','parser','emit','handleFetchEnd','stringify','textCode','hasOwnProperty','exports','util','imap','randomstring','simpleParser','iconv','Iconv','EventEmitter','../../../config/logger','email','mailbox','INBOX','account','getAccount','bind','once','handleEnd','error','connect','inherits','prototype','connTimeout','authTimeout','isNil','user','password','host','port','tls','autotls','getHost','service','anonymous@xcally.com','handleReady','openBox','handleOpenBox','handleError','box','readUnseen','end','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','closeBox','handleCloseBox','body','handleMessageBody','handleMessageAttributes'];(function(_0x44ad4b,_0x13ccad){var _0x4c0516=function(_0x1a841e){while(--_0x1a841e){_0x44ad4b['push'](_0x44ad4b['shift']());}};_0x4c0516(++_0x13ccad);}(_0x9d9b,0x1e1));var _0xb9d9=function(_0x181779,_0x13a536){_0x181779=_0x181779-0x0;var _0x4b6222=_0x9d9b[_0x181779];return _0x4b6222;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xb9d9('0x0'));var Imap=require(_0xb9d9('0x1'));var _=require('lodash');var rs=require(_0xb9d9('0x2'));var simpleParser=require('mailparser')[_0xb9d9('0x3')];var Iconv=require(_0xb9d9('0x4'))[_0xb9d9('0x5')];var EventEmitter=require('events')[_0xb9d9('0x6')];var utils=require('./utils');var logger=require(_0xb9d9('0x7'))(_0xb9d9('0x8'));function EmailImap(_0x51af61,_0x13743f){this[_0xb9d9('0x9')]=_0xb9d9('0xa');this[_0xb9d9('0xb')]=this[_0xb9d9('0xc')](_0x51af61,_0x13743f);this[_0xb9d9('0x1')]=new Imap(this[_0xb9d9('0xb')]);this['imap']['once']('ready',this['handleReady'][_0xb9d9('0xd')](this));this[_0xb9d9('0x1')][_0xb9d9('0xe')]('end',this[_0xb9d9('0xf')][_0xb9d9('0xd')](this));this['imap']['on'](_0xb9d9('0x10'),this['handleError'][_0xb9d9('0xd')](this));this[_0xb9d9('0x1')][_0xb9d9('0x11')]();}util[_0xb9d9('0x12')](EmailImap,EventEmitter);EmailImap[_0xb9d9('0x13')][_0xb9d9('0xc')]=function(_0x4f0c77,_0xfc9733){var _0x4cbc4d={'connTimeout':_0x4f0c77['connTimeout']?_0x4f0c77[_0xb9d9('0x14')]*0x3e8:0x2710,'authTimeout':_0x4f0c77[_0xb9d9('0x15')]?_0x4f0c77[_0xb9d9('0x15')]*0x3e8:0x1388};if(_[_0xb9d9('0x16')](_0x4f0c77['service'])){if(_0x4f0c77['authentication']){_0x4cbc4d[_0xb9d9('0x17')]=_0x4f0c77['user'];_0x4cbc4d['password']=_0x4f0c77[_0xb9d9('0x18')];}_0x4cbc4d[_0xb9d9('0x19')]=_0x4f0c77[_0xb9d9('0x19')];_0x4cbc4d['port']=_0x4f0c77[_0xb9d9('0x1a')]||0x3e1;if(_0x4f0c77[_0xb9d9('0x1b')]){_0x4cbc4d['tls']=!![];}else{_0x4cbc4d[_0xb9d9('0x1b')]=![];_0x4cbc4d[_0xb9d9('0x1c')]='required';}}else{_0x4cbc4d[_0xb9d9('0x17')]=_0x4f0c77[_0xb9d9('0x17')];_0x4cbc4d['password']=_0x4f0c77[_0xb9d9('0x18')];_0x4cbc4d[_0xb9d9('0x19')]=utils[_0xb9d9('0x1d')](_0x4f0c77[_0xb9d9('0x1e')]);_0x4cbc4d[_0xb9d9('0x1a')]=0x3e1;_0x4cbc4d[_0xb9d9('0x1b')]=!![];}_0x4cbc4d['email']=_0xfc9733||_0x4f0c77[_0xb9d9('0x17')]||_0xb9d9('0x1f');return _0x4cbc4d;};EmailImap['prototype'][_0xb9d9('0x20')]=function(){this[_0xb9d9('0x1')][_0xb9d9('0x21')](this[_0xb9d9('0x9')],![],this['handleOpenBox'][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x22')]=function(_0x436cb7,_0x2650f7){if(_0x436cb7){this[_0xb9d9('0x23')](_0x436cb7,!![]);}else{this['emit'](_0xb9d9('0x24'),_0x2650f7);this[_0xb9d9('0x25')]();}};EmailImap[_0xb9d9('0x13')]['handleCloseBox']=function(_0x2a30fe){if(_0x2a30fe){this[_0xb9d9('0x23')](_0x2a30fe,!![]);}else{this[_0xb9d9('0x1')][_0xb9d9('0x26')]();}};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x25')]=function(){this[_0xb9d9('0x1')]['search']([_0xb9d9('0x27')],this[_0xb9d9('0x28')][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x28')]=function(_0x26a480,_0x5dbb27){if(_0x26a480){this[_0xb9d9('0x23')](_0x26a480,!![]);}else{if(_0x5dbb27[_0xb9d9('0x29')]){try{var _0x1f8192=this[_0xb9d9('0x1')]['fetch'](_0x5dbb27,{'bodies':'','markSeen':!![]});_0x1f8192['on'](_0xb9d9('0x2a'),this[_0xb9d9('0x2b')][_0xb9d9('0xd')](this));_0x1f8192[_0xb9d9('0xe')](_0xb9d9('0x10'),this[_0xb9d9('0x2c')]['bind'](this));_0x1f8192['once'](_0xb9d9('0x26'),this['handleFetchEnd'][_0xb9d9('0xd')](this));}catch(_0x2b267b){logger[_0xb9d9('0x10')](_0x2b267b);}}else{this['imap'][_0xb9d9('0x2d')](!![],this[_0xb9d9('0x2e')][_0xb9d9('0xd')](this));}}};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x2b')]=function(_0xffcf20,_0x3a38b8){_0xffcf20['on'](_0xb9d9('0x2f'),this[_0xb9d9('0x30')]['bind'](this));_0xffcf20['once']('attributes',this[_0xb9d9('0x31')][_0xb9d9('0xd')](this));_0xffcf20[_0xb9d9('0xe')](_0xb9d9('0x26'),this[_0xb9d9('0x32')][_0xb9d9('0xd')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x492be2,_0x359a6f){simpleParser(_0x492be2,{'Iconv':Iconv},this[_0xb9d9('0x33')][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x31')]=function(_0x1f351d){};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x32')]=function(){};EmailImap[_0xb9d9('0x13')][_0xb9d9('0x33')]=function(_0xd8b9a2,_0x2ae9a4){if(_0xd8b9a2){logger[_0xb9d9('0x10')](_0xd8b9a2);}else{var _0x46d9a7=this;utils[_0xb9d9('0x34')](this[_0xb9d9('0xb')],_0x2ae9a4,function(_0x1b4e3e){_0x46d9a7[_0xb9d9('0x35')](_0xb9d9('0x8'),_0x1b4e3e);});}};EmailImap['prototype'][_0xb9d9('0x36')]=function(){this[_0xb9d9('0x1')]['closeBox'](!![],this['handleCloseBox'][_0xb9d9('0xd')](this));};EmailImap['prototype'][_0xb9d9('0x2c')]=function(_0x4c63e3){this['handleError'](_0x4c63e3);this[_0xb9d9('0x1')][_0xb9d9('0x2d')](!![],this[_0xb9d9('0x2e')][_0xb9d9('0xd')](this));};EmailImap[_0xb9d9('0x13')][_0xb9d9('0xf')]=function(){this[_0xb9d9('0x35')](_0xb9d9('0x26'));};EmailImap['prototype']['handleError']=function(_0x3f4b76,_0xb7c4ec){logger[_0xb9d9('0x10')]('handleError',this[_0xb9d9('0xb')][_0xb9d9('0x8')],JSON[_0xb9d9('0x37')](_0x3f4b76));var _0x22c923='';if(_0x3f4b76){if(_0x3f4b76[_0xb9d9('0x38')]){_0x22c923=_0x3f4b76[_0xb9d9('0x38')];}else{for(var _0x10b62e in _0x3f4b76){if(_0x3f4b76[_0xb9d9('0x39')](_0x10b62e)){_0x22c923+=_['upperFirst'](_0x10b62e)+':\x20'+_0x3f4b76[_0x10b62e]+'\x0a';}}}}if(_0xb7c4ec){this[_0xb9d9('0x1')][_0xb9d9('0x26')]();}else{this[_0xb9d9('0x35')](_0xb9d9('0x10'),_0x22c923);this[_0xb9d9('0x35')](_0xb9d9('0x26'));}};module[_0xb9d9('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 7069c60..5692497 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 _0x5eee=['Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','verify','toString'];(function(_0x2e7237,_0x5be71b){var _0x2cf3cc=function(_0x4ab597){while(--_0x4ab597){_0x2e7237['push'](_0x2e7237['shift']());}};_0x2cf3cc(++_0x5be71b);}(_0x5eee,0x1ca));var _0xe5ee=function(_0x4fae18,_0x9c3fbf){_0x4fae18=_0x4fae18-0x0;var _0x1322c5=_0x5eee[_0x4fae18];return _0x1322c5;};'use strict';var nodemailer=require(_0xe5ee('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xe5ee('0x1'));function EmailSmtp(){}EmailSmtp[_0xe5ee('0x2')][_0xe5ee('0x3')]=function(_0x47103e,_0x1716fc){return new BPromise(function(_0xb582fd,_0x11374b){var _0x49a535=nodemailer[_0xe5ee('0x4')](_0x47103e);_0x49a535[_0xe5ee('0x5')](_0xe5ee('0x6'),inlineBase64());_0x49a535[_0xe5ee('0x7')](_0x1716fc,function(_0x266485,_0x243762){if(_0x266485){_0x11374b(_0x266485['toString']());}else{_0xb582fd(_0x243762);}});});};EmailSmtp[_0xe5ee('0x2')]['verify']=function(_0x2ea774){return new BPromise(function(_0x52d6fc,_0x16c20b){var _0x7f3d8=nodemailer[_0xe5ee('0x4')](_0x2ea774);_0x7f3d8[_0xe5ee('0x8')](function(_0x218210,_0x4c11cf){if(_0x218210){_0x16c20b(_0x218210[_0xe5ee('0x9')]());}else{if(_0x4c11cf){_0x52d6fc(_0x4c11cf);}else{_0x16c20b(_0xe5ee('0xa'));}}});});};module[_0xe5ee('0xb')]=EmailSmtp; \ No newline at end of file +var _0x300a=['bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile','sendMail','verify','toString','exports','nodemailer'];(function(_0x552f5d,_0x231959){var _0x3be170=function(_0x516d38){while(--_0x516d38){_0x552f5d['push'](_0x552f5d['shift']());}};_0x3be170(++_0x231959);}(_0x300a,0xcb));var _0xa300=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x300a[_0x255ac0];return _0x437bf1;};'use strict';var nodemailer=require(_0xa300('0x0'));var BPromise=require(_0xa300('0x1'));var inlineBase64=require(_0xa300('0x2'));function EmailSmtp(){}EmailSmtp[_0xa300('0x3')][_0xa300('0x4')]=function(_0x54f975,_0x14b65a){return new BPromise(function(_0x20f678,_0x38e6a1){var _0x40b428=nodemailer[_0xa300('0x5')](_0x54f975);_0x40b428[_0xa300('0x6')](_0xa300('0x7'),inlineBase64());_0x40b428[_0xa300('0x8')](_0x14b65a,function(_0x492046,_0xa54412){if(_0x492046){_0x38e6a1(_0x492046['toString']());}else{_0x20f678(_0xa54412);}});});};EmailSmtp[_0xa300('0x3')]['verify']=function(_0x26d7da){return new BPromise(function(_0x5f2282,_0x187a2f){var _0xb3bcb3=nodemailer['createTransport'](_0x26d7da);_0xb3bcb3[_0xa300('0x9')](function(_0x5e13ea,_0x1512fb){if(_0x5e13ea){_0x187a2f(_0x5e13ea[_0xa300('0xa')]());}else{if(_0x1512fb){_0x5f2282(_0x1512fb);}else{_0x187a2f('Not\x20verifired');}}});});};module[_0xa300('0xb')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index f2c3ca8..392f58b 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 _0x3a15=['imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','randomstring','util','node-tnef','../../../config/logger','address','anonymous','generate','@xcally.com','head','name','substring','split','length','join','Anonymous','value','pop','test','html','includes','\x20[Attachment:\x20','body','textAsHtml','Empty\x20message

','gmail'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3a15,0xde));var _0x53a1=function(_0x4c5770,_0x48b574){_0x4c5770=_0x4c5770-0x0;var _0x303251=_0x3a15[_0x4c5770];return _0x303251;};'use strict';var _=require(_0x53a1('0x0'));var moment=require('moment');var random=require(_0x53a1('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x53a1('0x2'));var tnef=require(_0x53a1('0x3'));var logger=require(_0x53a1('0x4'))('email');var config=require('../../../config/environment');function getAddress(_0x467848){var _0x479af7=_['head'](_0x467848['value']);return _0x479af7&&_0x479af7[_0x53a1('0x5')]?_0x479af7['address']:_0x53a1('0x6')+random[_0x53a1('0x7')](0x6)+_0x53a1('0x8');}function getFirstName(_0x5252d4){var _0xa6fa00=_[_0x53a1('0x9')](_0x5252d4['value']);if(_0xa6fa00&&_0xa6fa00['name']){if(_0xa6fa00['name']==_0xa6fa00[_0x53a1('0x5')]){return _0xa6fa00[_0x53a1('0xa')][_0x53a1('0xb')](0x0,_0xa6fa00[_0x53a1('0xa')]['indexOf']('@'));}var _0x499f17=_0xa6fa00['name'][_0x53a1('0xc')](/\s+/);return _0x499f17[_0x53a1('0xd')]>0x1?_0x499f17['slice'](0x0,-0x1)[_0x53a1('0xe')]('\x20'):_0xa6fa00[_0x53a1('0xa')];}return _0x53a1('0xf');}function getLastName(_0x4a14bc){var _0x192ec5=_[_0x53a1('0x9')](_0x4a14bc[_0x53a1('0x10')]);if(_0x192ec5&&_0x192ec5[_0x53a1('0xa')]){var _0x2dbca7=_0x192ec5[_0x53a1('0xa')][_0x53a1('0xc')](/\s+/);return _0x2dbca7[_0x53a1('0xd')]>0x1?_0x2dbca7[_0x53a1('0x11')]():'';}return'';}function getMails(_0x552306,_0x367f3e){var _0xd7a6a4='';for(var _0x1793e0=0x0;_0x1793e0<_0x367f3e[_0x53a1('0x10')][_0x53a1('0xd')];_0x1793e0+=0x1){if(_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]!==_0x552306){if(!_['isEmpty'](_0xd7a6a4)){_0xd7a6a4+=',';}_0xd7a6a4+=_0x367f3e[_0x53a1('0x10')][_0x1793e0]['name']||_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]||'';_0xd7a6a4+='\x20<';_0xd7a6a4+=_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]?_0x367f3e[_0x53a1('0x10')][_0x1793e0][_0x53a1('0x5')]:'anonymous'+random[_0x53a1('0x7')](0x6)+_0x53a1('0x8');_0xd7a6a4+='>';}}return _0xd7a6a4;}function parseEmail(_0x4eb6bd,_0xcea683,_0x32c5f5){if(_0xcea683['html']){var _0x2f0f7e=/)<[^<]*)*<\/script>/gi;while(_0x2f0f7e[_0x53a1('0x12')](_0xcea683['html'])){_0xcea683[_0x53a1('0x13')]=_0xcea683[_0x53a1('0x13')]['replace'](_0x2f0f7e,'');}if(_0xcea683[_0x53a1('0x13')][_0x53a1('0x14')](_0x53a1('0x15'))){var _0x26f84a=[];_0xcea683['attachments'][_0x53a1('0x16')](_0x428866=>{_0x26f84a[_0x53a1('0x17')](_0x428866[_0x53a1('0x18')]);});var _0x3bf15c=/]+>/g;var _0x30a0cc=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x507a9e=_0xcea683[_0x53a1('0x13')][_0x53a1('0x19')](_0x30a0cc,_0x53a1('0x1a'));var _0x94b6bf=_0x507a9e[_0x53a1('0x19')](_0x3bf15c,_0x53a1('0x1b'));for(let _0x13f5f7=0x0;_0x13f5f7<_0x26f84a[_0x53a1('0xd')];_0x13f5f7++){var _0x322baf=_0x94b6bf[_0x53a1('0x19')](_0x53a1('0x1b'),_0x53a1('0x1c')+_0x26f84a[_0x13f5f7]+'\x20]');_0x94b6bf=_0x322baf;}_0xcea683[_0x53a1('0x13')]=_0x94b6bf;}_0x32c5f5[_0x53a1('0x1d')]=_0xcea683[_0x53a1('0x13')];}else{_0x32c5f5[_0x53a1('0x1d')]=_0xcea683[_0x53a1('0x1e')];}if(_0x32c5f5[_0x53a1('0x1d')]){_0x32c5f5[_0x53a1('0x1d')]=_0x32c5f5['body']['replace'](/0x0){var _0x38303b=['Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x2c08b2=0x0;_0x2c08b2<_0xcea683[_0x53a1('0x30')][_0x53a1('0xd')];_0x2c08b2++){var _0x224208=_['indexOf'](_0x38303b,_0xcea683[_0x53a1('0x30')][_0x2c08b2]['line']);if(_0x224208>=0x0){_0x32c5f5['isAutoreply']=!![];}}}return _0x32c5f5;}exports[_0x53a1('0x31')]=function(_0x4baec9,_0x2e8242,_0x2b12a4){var _0x54bc26={'from':getAddress(_0x2e8242[_0x53a1('0x32')]),'firstName':getFirstName(_0x2e8242['from']),'lastName':getLastName(_0x2e8242[_0x53a1('0x32')]),'mapKey':'email','message':{'from':getMails(_0x4baec9[_0x53a1('0x22')],_0x2e8242['from']),'to':_0x4baec9['email'],'cc':'','subject':_0x2e8242[_0x53a1('0x33')]||'','messageId':_0x2e8242['messageId'],'inReplyTo':_0x2e8242['inReplyTo'],'sentAt':moment(_0x2e8242[_0x53a1('0x34')])[_0x53a1('0x35')](_0x53a1('0x36')),'attach':![],'attachments':[]}};if(!_0x2e8242['html']&&!_0x2e8242[_0x53a1('0x1e')]){var _0x24e5bd=_[_0x53a1('0x37')](_0x2e8242[_0x53a1('0x26')],{'contentType':_0x53a1('0x38')});if(_0x24e5bd['length']){logger[_0x53a1('0x39')](util[_0x53a1('0x35')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x2e8242[_0x53a1('0x3a')]));tnef[_0x53a1('0x3b')](_[_0x53a1('0x3c')](_0x24e5bd)[_0x53a1('0x2f')],function(_0x354b82,_0x511ccb){if(_0x511ccb){_0x2e8242[_0x53a1('0x13')]=_0x511ccb[_0x53a1('0x3d')]||'

Empty\x20message

';if(_0x511ccb['Attachments']){for(var _0x2d352d=0x0;_0x2d352d<_0x511ccb[_0x53a1('0x3e')][_0x53a1('0xd')];_0x2d352d++){var _0x3d109d=_0x511ccb[_0x53a1('0x3e')][_0x2d352d];_0x54bc26[_0x53a1('0x20')][_0x53a1('0x26')][_0x53a1('0x17')]({'filename':_0x3d109d[_0x53a1('0x3f')],'content':Buffer[_0x53a1('0x32')](_0x3d109d['Data'])});}}}_0x2b12a4(parseEmail(_0x4baec9,_0x2e8242,_0x54bc26));});}else{_0x2e8242['html']=_0x53a1('0x40');_0x2b12a4(parseEmail(_0x4baec9,_0x2e8242,_0x54bc26));}}else{_0x2b12a4(parseEmail(_0x4baec9,_0x2e8242,_0x54bc26));}};exports['getHost']=function(_0x1d38dc){switch(_0x1d38dc){case _0x53a1('0x41'):return _0x53a1('0x42');case'yahoo':return _0x53a1('0x43');case _0x53a1('0x44'):return _0x53a1('0x45');case _0x53a1('0x46'):return _0x53a1('0x47');}return'127.0.0.1';}; \ No newline at end of file +var _0x404d=['getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','@xcally.com','value','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','generate','html','replace','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','attach','type','attachment','attachment-','format','now','root','server/files/attachments/','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','line','isAutoreply','parser','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','BodyHTML','Attachments','Title','Data','

Empty\x20message

'];(function(_0x52d065,_0x31d24){var _0x49f7bc=function(_0x2f0966){while(--_0x2f0966){_0x52d065['push'](_0x52d065['shift']());}};_0x49f7bc(++_0x31d24);}(_0x404d,0x1e9));var _0xd404=function(_0x16a600,_0x49e711){_0x16a600=_0x16a600-0x0;var _0x39834c=_0x404d[_0x16a600];return _0x39834c;};'use strict';var _=require(_0xd404('0x0'));var moment=require(_0xd404('0x1'));var random=require(_0xd404('0x2'));var fs=require('fs');var path=require(_0xd404('0x3'));var util=require(_0xd404('0x4'));var tnef=require(_0xd404('0x5'));var logger=require(_0xd404('0x6'))(_0xd404('0x7'));var config=require(_0xd404('0x8'));function getAddress(_0x4b084c){var _0x10153c=_[_0xd404('0x9')](_0x4b084c['value']);return _0x10153c&&_0x10153c[_0xd404('0xa')]?_0x10153c[_0xd404('0xa')]:'anonymous'+random['generate'](0x6)+_0xd404('0xb');}function getFirstName(_0x3d7e8a){var _0x506b18=_['head'](_0x3d7e8a[_0xd404('0xc')]);if(_0x506b18&&_0x506b18[_0xd404('0xd')]){if(_0x506b18[_0xd404('0xd')]==_0x506b18[_0xd404('0xa')]){return _0x506b18['name']['substring'](0x0,_0x506b18[_0xd404('0xd')][_0xd404('0xe')]('@'));}var _0x569542=_0x506b18[_0xd404('0xd')][_0xd404('0xf')](/\s+/);return _0x569542[_0xd404('0x10')]>0x1?_0x569542[_0xd404('0x11')](0x0,-0x1)[_0xd404('0x12')]('\x20'):_0x506b18[_0xd404('0xd')];}return _0xd404('0x13');}function getLastName(_0x32f760){var _0x1b0dcd=_[_0xd404('0x9')](_0x32f760[_0xd404('0xc')]);if(_0x1b0dcd&&_0x1b0dcd[_0xd404('0xd')]){var _0x28d1e9=_0x1b0dcd[_0xd404('0xd')][_0xd404('0xf')](/\s+/);return _0x28d1e9[_0xd404('0x10')]>0x1?_0x28d1e9[_0xd404('0x14')]():'';}return'';}function getMails(_0xa4d1b2,_0xc5fe91){var _0x122813='';for(var _0x155186=0x0;_0x155186<_0xc5fe91['value'][_0xd404('0x10')];_0x155186+=0x1){if(_0xc5fe91[_0xd404('0xc')][_0x155186]['address']!==_0xa4d1b2){if(!_[_0xd404('0x15')](_0x122813)){_0x122813+=',';}_0x122813+=_0xc5fe91[_0xd404('0xc')][_0x155186]['name']||_0xc5fe91[_0xd404('0xc')][_0x155186][_0xd404('0xa')]||'';_0x122813+='\x20<';_0x122813+=_0xc5fe91[_0xd404('0xc')][_0x155186]['address']?_0xc5fe91[_0xd404('0xc')][_0x155186][_0xd404('0xa')]:_0xd404('0x16')+random[_0xd404('0x17')](0x6)+_0xd404('0xb');_0x122813+='>';}}return _0x122813;}function parseEmail(_0x3b67d4,_0x458f6e,_0x5c0264){if(_0x458f6e[_0xd404('0x18')]){var _0xcc7bf1=/)<[^<]*)*<\/script>/gi;while(_0xcc7bf1['test'](_0x458f6e[_0xd404('0x18')])){_0x458f6e['html']=_0x458f6e['html'][_0xd404('0x19')](_0xcc7bf1,'');}if(_0x458f6e[_0xd404('0x18')][_0xd404('0x1a')](_0xd404('0x1b'))){var _0x4c00de=[];_0x458f6e[_0xd404('0x1c')][_0xd404('0x1d')](_0x13af69=>{_0x4c00de['push'](_0x13af69['filename']);});var _0x3e706a=/]+>/g;var _0xaccaa8=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2d7af8=_0x458f6e[_0xd404('0x18')][_0xd404('0x19')](_0xaccaa8,_0xd404('0x1e'));var _0x256277=_0x2d7af8[_0xd404('0x19')](_0x3e706a,'_IMG');for(let _0x47d0b4=0x0;_0x47d0b4<_0x4c00de[_0xd404('0x10')];_0x47d0b4++){var _0x4a7dfc=_0x256277[_0xd404('0x19')]('_IMG',_0xd404('0x1f')+_0x4c00de[_0x47d0b4]+_0xd404('0x20'));_0x256277=_0x4a7dfc;}_0x458f6e[_0xd404('0x18')]=_0x256277;}_0x5c0264[_0xd404('0x21')]=_0x458f6e[_0xd404('0x18')];}else{_0x5c0264[_0xd404('0x21')]=_0x458f6e[_0xd404('0x22')];}if(_0x5c0264['body']){_0x5c0264['body']=_0x5c0264[_0xd404('0x21')]['replace'](/0x0){var _0x539f0f=[_0xd404('0x33'),'X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply'];for(var _0x35494f=0x0;_0x35494f<_0x458f6e[_0xd404('0x32')][_0xd404('0x10')];_0x35494f++){var _0x392afa=_['indexOf'](_0x539f0f,_0x458f6e['headerLines'][_0x35494f][_0xd404('0x34')]);if(_0x392afa>=0x0){_0x5c0264[_0xd404('0x35')]=!![];}}}return _0x5c0264;}exports[_0xd404('0x36')]=function(_0x108cc3,_0x199d66,_0x2c7fcc){var _0x1c0d91={'from':getAddress(_0x199d66['from']),'firstName':getFirstName(_0x199d66[_0xd404('0x37')]),'lastName':getLastName(_0x199d66['from']),'mapKey':_0xd404('0x7'),'message':{'from':getMails(_0x108cc3['email'],_0x199d66[_0xd404('0x37')]),'to':_0x108cc3[_0xd404('0x7')],'cc':'','subject':_0x199d66[_0xd404('0x38')]||'','messageId':_0x199d66['messageId'],'inReplyTo':_0x199d66[_0xd404('0x39')],'sentAt':moment(_0x199d66[_0xd404('0x3a')])[_0xd404('0x2a')](_0xd404('0x3b')),'attach':![],'attachments':[]}};if(!_0x199d66['html']&&!_0x199d66[_0xd404('0x22')]){var _0x1ecdda=_[_0xd404('0x3c')](_0x199d66[_0xd404('0x1c')],{'contentType':_0xd404('0x3d')});if(_0x1ecdda[_0xd404('0x10')]){logger[_0xd404('0x3e')](util[_0xd404('0x2a')](_0xd404('0x3f'),_0x199d66[_0xd404('0x40')]));tnef[_0xd404('0x41')](_['first'](_0x1ecdda)[_0xd404('0x2f')],function(_0x202bd6,_0x3c7213){if(_0x3c7213){_0x199d66[_0xd404('0x18')]=_0x3c7213[_0xd404('0x42')]||'

Empty\x20message

';if(_0x3c7213[_0xd404('0x43')]){for(var _0x30cc1c=0x0;_0x30cc1c<_0x3c7213['Attachments'][_0xd404('0x10')];_0x30cc1c++){var _0xb8bda4=_0x3c7213[_0xd404('0x43')][_0x30cc1c];_0x1c0d91[_0xd404('0x23')][_0xd404('0x1c')][_0xd404('0x30')]({'filename':_0xb8bda4[_0xd404('0x44')],'content':Buffer[_0xd404('0x37')](_0xb8bda4[_0xd404('0x45')])});}}}_0x2c7fcc(parseEmail(_0x108cc3,_0x199d66,_0x1c0d91));});}else{_0x199d66['html']=_0xd404('0x46');_0x2c7fcc(parseEmail(_0x108cc3,_0x199d66,_0x1c0d91));}}else{_0x2c7fcc(parseEmail(_0x108cc3,_0x199d66,_0x1c0d91));}};exports[_0xd404('0x47')]=function(_0x5c7c68){switch(_0x5c7c68){case _0xd404('0x48'):return _0xd404('0x49');case _0xd404('0x4a'):return'imap.mail.yahoo.com';case _0xd404('0x4b'):return _0xd404('0x4c');case _0xd404('0x4d'):return _0xd404('0x4e');}return _0xd404('0x4f');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 99f2f9e..6e8e987 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 _0x826e=['name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x826e,0x70));var _0xe826=function(_0x34d03a,_0x51573d){_0x34d03a=_0x34d03a-0x0;var _0x126aa0=_0x826e[_0x34d03a];return _0x126aa0;};'use strict';var _=require('lodash');function MailAccount(_0x1c445f){this['id']=_0x1c445f['id']||0x0;this[_0xe826('0x0')]=_0x1c445f['name']||_0xe826('0x1');this[_0xe826('0x2')]=_0x1c445f[_0xe826('0x2')]||_0xe826('0x3');this[_0xe826('0x4')]=_0x1c445f['active']||![];this[_0xe826('0x5')]=_0x1c445f[_0xe826('0x5')]||[];this[_0xe826('0x6')]=_0x1c445f['Smtp']||[];}module[_0xe826('0x7')]=MailAccount; \ No newline at end of file +var _0x6758=['exports','lodash','name','Service','SERV','active','Imap'];(function(_0x41c01c,_0xe3f555){var _0x1a3c03=function(_0x35cafa){while(--_0x35cafa){_0x41c01c['push'](_0x41c01c['shift']());}};_0x1a3c03(++_0xe3f555);}(_0x6758,0x7f));var _0x8675=function(_0x27cb07,_0x2ec9be){_0x27cb07=_0x27cb07-0x0;var _0x411b3b=_0x6758[_0x27cb07];return _0x411b3b;};'use strict';var _=require(_0x8675('0x0'));function MailAccount(_0xad8d57){this['id']=_0xad8d57['id']||0x0;this[_0x8675('0x1')]=_0xad8d57[_0x8675('0x1')]||_0x8675('0x2');this['key']=_0xad8d57['key']||_0x8675('0x3');this[_0x8675('0x4')]=_0xad8d57['active']||![];this[_0x8675('0x5')]=_0xad8d57[_0x8675('0x5')]||[];this['Smtp']=_0xad8d57['Smtp']||[];}module[_0x8675('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 4f6007e..c5b78cc 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 _0x4258=['hasOwnProperty','mailAccounts','length','exports','lodash','../model/mailAccount','mapKeys','prototype','mergeFromDatabase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4258,0xc1));var _0x8425=function(_0x539d8f,_0x23ab08){_0x539d8f=_0x539d8f-0x0;var _0x23189b=_0x4258[_0x539d8f];return _0x23189b;};'use strict';var _=require(_0x8425('0x0'));var MailAccount=require(_0x8425('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x2ccaee,_0x355aea,_0x3b0db7){var _0x32d563=_[_0x8425('0x2')](_0x2ccaee,function(_0x19c1d7,_0x4fb801){return _0x19c1d7[_0x3b0db7];});for(var _0x264a42 in _0x355aea){if(_0x355aea['hasOwnProperty'](_0x264a42)){if(!_0x32d563[_0x264a42]){delete _0x355aea[_0x264a42];}}}}Realtime[_0x8425('0x3')][_0x8425('0x4')]=function(_0x543971,_0x149116){for(var _0x2a6431 in _0x149116){if(_0x543971[_0x8425('0x5')](_0x2a6431)){_0x543971[_0x2a6431]=_0x149116[_0x2a6431];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x3c8a94=this;return function(_0x9ef159){if(_0x9ef159){freeIsNotKey(_0x9ef159,_0x3c8a94[_0x8425('0x6')],'id');for(var _0x303252=0x0,_0x3f9049={},_0x2e8f31={};_0x303252<_0x9ef159[_0x8425('0x7')];_0x303252+=0x1){_0x3f9049=_0x9ef159[_0x303252];if(_['isUndefined'](_0x3c8a94[_0x8425('0x6')][_0x3f9049['id']])){_0x3c8a94[_0x8425('0x6')][_0x3f9049['id']]=new MailAccount(_0x3f9049);}else{_['merge'](_0x3c8a94[_0x8425('0x6')][_0x3f9049['id']],_0x3f9049);}}}return _0x3c8a94[_0x8425('0x6')];};};module[_0x8425('0x8')]=Realtime; \ No newline at end of file +var _0x9466=['length','isUndefined','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','mergeFromDatabase','initMailAccounts'];(function(_0x40657d,_0x4d0cbd){var _0x48baa3=function(_0x4b6107){while(--_0x4b6107){_0x40657d['push'](_0x40657d['shift']());}};_0x48baa3(++_0x4d0cbd);}(_0x9466,0x92));var _0x6946=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x9466[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x6946('0x0'));var MailAccount=require(_0x6946('0x1'));var Realtime=function(){this[_0x6946('0x2')]={};};function freeIsNotKey(_0x35f2c3,_0xea55a5,_0x128d12){var _0x52d0da=_[_0x6946('0x3')](_0x35f2c3,function(_0x33540f,_0x42ee17){return _0x33540f[_0x128d12];});for(var _0x37ff0a in _0xea55a5){if(_0xea55a5[_0x6946('0x4')](_0x37ff0a)){if(!_0x52d0da[_0x37ff0a]){delete _0xea55a5[_0x37ff0a];}}}}Realtime['prototype'][_0x6946('0x5')]=function(_0x4b32e4,_0x2c8d2a){for(var _0x219470 in _0x2c8d2a){if(_0x4b32e4[_0x6946('0x4')](_0x219470)){_0x4b32e4[_0x219470]=_0x2c8d2a[_0x219470];}}};Realtime['prototype'][_0x6946('0x6')]=function(){var _0x436557=this;return function(_0x27069d){if(_0x27069d){freeIsNotKey(_0x27069d,_0x436557[_0x6946('0x2')],'id');for(var _0x26f732=0x0,_0x3e7765={},_0x93897e={};_0x26f732<_0x27069d[_0x6946('0x7')];_0x26f732+=0x1){_0x3e7765=_0x27069d[_0x26f732];if(_[_0x6946('0x8')](_0x436557[_0x6946('0x2')][_0x3e7765['id']])){_0x436557[_0x6946('0x2')][_0x3e7765['id']]=new MailAccount(_0x3e7765);}else{_['merge'](_0x436557[_0x6946('0x2')][_0x3e7765['id']],_0x3e7765);}}}return _0x436557[_0x6946('0x2')];};};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 f9ab9df..87fb3c1 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 _0x8506=['MailServerOut','Smtp','Request','NotifyMailAccount','getMailAccounts','GetMailAccount','service','active','key','ListId','MailServerIn','Imap'];(function(_0x54e075,_0x23ef12){var _0x22fa02=function(_0x595c35){while(--_0x595c35){_0x54e075['push'](_0x54e075['shift']());}};_0x22fa02(++_0x23ef12);}(_0x8506,0xe8));var _0x6850=function(_0x456c81,_0xc115f3){_0x456c81=_0x456c81-0x0;var _0x353665=_0x8506[_0x456c81];return _0x353665;};'use strict';var client=require('../client');exports[_0x6850('0x0')]=function(){return function(){return client['Request'](_0x6850('0x1'),{'options':{'attributes':['id','name',_0x6850('0x2'),'email',_0x6850('0x3'),_0x6850('0x4'),_0x6850('0x5'),'TemplateId'],'raw':![],'include':[{'model':_0x6850('0x6'),'as':_0x6850('0x7')},{'model':_0x6850('0x8'),'as':_0x6850('0x9')}]},'log':'getMailAccount'});};};exports['notify']=function(_0x5466ee,_0x117706){return client[_0x6850('0xa')](_0x6850('0xb'),{'account':{'id':_0x5466ee},'body':_0x117706,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xd48e=['ListId','MailServerIn','Imap','MailServerOut','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','name','service','active','key'];(function(_0x47ce46,_0x4f2fa8){var _0x16881c=function(_0x57873b){while(--_0x57873b){_0x47ce46['push'](_0x47ce46['shift']());}};_0x16881c(++_0x4f2fa8);}(_0xd48e,0x93));var _0xed48=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xd48e[_0x1a9204];return _0x17ca68;};'use strict';var client=require('../client');exports[_0xed48('0x0')]=function(){return function(){return client[_0xed48('0x1')](_0xed48('0x2'),{'options':{'attributes':['id',_0xed48('0x3'),_0xed48('0x4'),'email',_0xed48('0x5'),_0xed48('0x6'),_0xed48('0x7'),'TemplateId'],'raw':![],'include':[{'model':_0xed48('0x8'),'as':_0xed48('0x9')},{'model':_0xed48('0xa'),'as':'Smtp'}]},'log':_0xed48('0xb')});};};exports[_0xed48('0xc')]=function(_0x52a5e2,_0x5f0f1b){return client['Request'](_0xed48('0xd'),{'account':{'id':_0x52a5e2},'body':_0x5f0f1b,'log':_0xed48('0xd')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index b1cdc3f..ff3cd8a 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 _0x83e7=['getSettings','Request','ShowSetting','loginMailFrequency','GetSettings','../client'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x83e7,0xcb));var _0x783e=function(_0x5ec84c,_0xa6b2b1){_0x5ec84c=_0x5ec84c-0x0;var _0x4d86d7=_0x83e7[_0x5ec84c];return _0x4d86d7;};'use strict';var client=require(_0x783e('0x0'));exports[_0x783e('0x1')]=function(){return client[_0x783e('0x2')](_0x783e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x783e('0x4')]},'log':_0x783e('0x5')});}; \ No newline at end of file +var _0x6d4e=['../client','getSettings','Request','ShowSetting','GetSettings'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x6d4e,0x109));var _0xe6d4=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0x6d4e[_0x35b7d4];return _0x4e8cee;};'use strict';var client=require(_0xe6d4('0x0'));exports[_0xe6d4('0x1')]=function(){return client[_0xe6d4('0x2')](_0xe6d4('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xe6d4('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 7e88e4c..64bd505 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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 94fdb66..91bb9e3 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 _0x48e2=['http','express','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','polling','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash'];(function(_0x118ad1,_0x2398ba){var _0x3c3e0d=function(_0x50036c){while(--_0x50036c){_0x118ad1['push'](_0x118ad1['shift']());}};_0x3c3e0d(++_0x2398ba);}(_0x48e2,0x144));var _0x248e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x48e2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x248e('0x0'));var http=require(_0x248e('0x1'));var express=require(_0x248e('0x2'));var sticky=require(_0x248e('0x3'));var Redis=require(_0x248e('0x4'));var config=require(_0x248e('0x5'));var app=express();var server=http[_0x248e('0x6')](app);server[_0x248e('0x7')]=0xdbba0;if(sticky[_0x248e('0x8')](server,config['port'])){var socketio=require(_0x248e('0x9'))(server,{'transports':['websocket',_0x248e('0xa')]});config[_0x248e('0xb')]=_[_0x248e('0xc')](config[_0x248e('0xb')],{'host':_0x248e('0xd'),'port':0x18eb});socketio[_0x248e('0xe')](require('socket.io-redis')({'pubClient':new Redis(config[_0x248e('0xb')]),'subClient':new Redis(config[_0x248e('0xb')])}));require(_0x248e('0xf'))[_0x248e('0x10')]();require(_0x248e('0x11'))[_0x248e('0x10')](socketio);require(_0x248e('0x12'))['default'](app);require('../../routes')['default'](app);}else{server[_0x248e('0x13')](_0x248e('0x14'),function(){console[_0x248e('0x15')](_0x248e('0x16'),config[_0x248e('0x17')]);});}exports=module[_0x248e('0x18')]=app; \ No newline at end of file +var _0x626a=['default','../../routes','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','ioredis','../../config/environment','timeout','listen','port','socket.io','polling','redis','defaults','../../config/triggers'];(function(_0x27d09e,_0x395ecb){var _0x43ee7c=function(_0x3ce2ce){while(--_0x3ce2ce){_0x27d09e['push'](_0x27d09e['shift']());}};_0x43ee7c(++_0x395ecb);}(_0x626a,0x1ce));var _0xa626=function(_0x135f09,_0x1adc3b){_0x135f09=_0x135f09-0x0;var _0x509edf=_0x626a[_0x135f09];return _0x509edf;};'use strict';var _=require(_0xa626('0x0'));var http=require(_0xa626('0x1'));var express=require(_0xa626('0x2'));var sticky=require('sticky-session');var Redis=require(_0xa626('0x3'));var config=require(_0xa626('0x4'));var app=express();var server=http['createServer'](app);server[_0xa626('0x5')]=0xdbba0;if(sticky[_0xa626('0x6')](server,config[_0xa626('0x7')])){var socketio=require(_0xa626('0x8'))(server,{'transports':['websocket',_0xa626('0x9')]});config[_0xa626('0xa')]=_[_0xa626('0xb')](config['redis'],{'host':'localhost','port':0x18eb});socketio['adapter'](require('socket.io-redis')({'pubClient':new Redis(config[_0xa626('0xa')]),'subClient':new Redis(config[_0xa626('0xa')])}));require(_0xa626('0xc'))[_0xa626('0xd')]();require('../../config/socketio')[_0xa626('0xd')](socketio);require('../../config/express')[_0xa626('0xd')](app);require(_0xa626('0xe'))['default'](app);}else{server['once'](_0xa626('0xf'),function(){console[_0xa626('0x10')](_0xa626('0x11'),config[_0xa626('0x7')]);});}exports=module[_0xa626('0x12')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 04fd8a3..6b07708 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 _0xf10c=['bluebird','../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','catch','exports','jayson/promise'];(function(_0x33b068,_0x2249ce){var _0x27df91=function(_0x46de54){while(--_0x46de54){_0x33b068['push'](_0x33b068['shift']());}};_0x27df91(++_0x2249ce);}(_0xf10c,0x133));var _0xcf10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf10c[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xcf10('0x0'));var BPromise=require(_0xcf10('0x1'));var logger=require(_0xcf10('0x2'))(_0xcf10('0x3'));var client=jayson[_0xcf10('0x4')][_0xcf10('0x5')]({'port':0x2329});client[_0xcf10('0x6')]=function(_0x2a1328,_0x3fb1ea){return new BPromise(function(_0x4a352c,_0x86caa3){return client[_0xcf10('0x7')](_0x2a1328,_0x3fb1ea)['then'](function(_0x5abb10){logger[_0xcf10('0x8')](_0xcf10('0x9'),_0xcf10('0x3'),_0x2a1328,_0x3fb1ea,_0x5abb10);if(_0x5abb10[_0xcf10('0xa')]){logger[_0xcf10('0xa')]('rpc',_0xcf10('0x3'),_0x2a1328,_0x5abb10[_0xcf10('0xa')][_0xcf10('0xb')],_0x3fb1ea);return _0x86caa3(_0x5abb10[_0xcf10('0xa')][_0xcf10('0xb')]);}else{return _0x4a352c(_0x5abb10['result']);}})[_0xcf10('0xc')](function(_0x7ac457){logger[_0xcf10('0xa')]('rpc',_0xcf10('0x3'),_0x2a1328,_0x7ac457,_0x3fb1ea);return _0x86caa3(_0x7ac457);});});};module[_0xcf10('0xd')]=client; \ No newline at end of file +var _0xdac2=['debug','rpc','error','result','catch','exports','bluebird','../../config/logger','routing','client'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0xdac2,0xd8));var _0x2dac=function(_0x42f0d1,_0x45fe4a){_0x42f0d1=_0x42f0d1-0x0;var _0x43f981=_0xdac2[_0x42f0d1];return _0x43f981;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x2dac('0x0'));var logger=require(_0x2dac('0x1'))(_0x2dac('0x2'));var client=jayson[_0x2dac('0x3')]['http']({'port':0x2329});client['Request']=function(_0x156ec8,_0x4c5b94){return new BPromise(function(_0x1ed9d9,_0x574fc9){return client['request'](_0x156ec8,_0x4c5b94)['then'](function(_0x1a0652){logger[_0x2dac('0x4')](_0x2dac('0x5'),_0x2dac('0x2'),_0x156ec8,_0x4c5b94,_0x1a0652);if(_0x1a0652[_0x2dac('0x6')]){logger[_0x2dac('0x6')](_0x2dac('0x5'),_0x2dac('0x2'),_0x156ec8,_0x1a0652[_0x2dac('0x6')]['message'],_0x4c5b94);return _0x574fc9(_0x1a0652[_0x2dac('0x6')]['message']);}else{return _0x1ed9d9(_0x1a0652[_0x2dac('0x7')]);}})[_0x2dac('0x8')](function(_0x5b25b0){logger[_0x2dac('0x6')](_0x2dac('0x5'),'routing',_0x156ec8,_0x5b25b0,_0x4c5b94);return _0x574fc9(_0x5b25b0);});});};module[_0x2dac('0x9')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index e07a59e..8271af1 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 _0xe1f9=['./server','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xe1f9,0xd1));var _0x9e1f=function(_0x5e45c1,_0x38c40a){_0x5e45c1=_0x5e45c1-0x0;var _0x31ad98=_0xe1f9[_0x5e45c1];return _0x31ad98;};'use strict';var BPromise=require(_0x9e1f('0x0'));var server=require(_0x9e1f('0x1'));var Realtime=require(_0x9e1f('0x2'));var user=require(_0x9e1f('0x3'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x9e1f('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x9e1f('0x5'));var faxQueue=require(_0x9e1f('0x6'));var whatsappQueue=require(_0x9e1f('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x9e1f('0x8')](user['getAgents']())[_0x9e1f('0x8')](realtime[_0x9e1f('0x9')]())[_0x9e1f('0x8')](interval[_0x9e1f('0xa')]())[_0x9e1f('0x8')](realtime['initIntervals']())[_0x9e1f('0x8')](openchannelQueue[_0x9e1f('0xb')]())[_0x9e1f('0x8')](realtime[_0x9e1f('0xc')]())[_0x9e1f('0x8')](chatQueue['getChatQueues']())[_0x9e1f('0x8')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())['then'](realtime['initSmsQueues']())[_0x9e1f('0x8')](mailQueue[_0x9e1f('0xd')]())['then'](realtime[_0x9e1f('0xe')]())[_0x9e1f('0x8')](faxQueue[_0x9e1f('0xf')]())['then'](realtime['initFaxQueues']())[_0x9e1f('0x8')](whatsappQueue[_0x9e1f('0x10')]())[_0x9e1f('0x8')](realtime[_0x9e1f('0x11')]())[_0x9e1f('0x8')](function(){return realtime;});}function main(){return server[_0x9e1f('0x12')](realtime)[_0x9e1f('0x8')](function(_0x301760){return initRealtime();})[_0x9e1f('0x8')](function(_0x2b3ffc){return setInterval(initRealtime,0x1388);})[_0x9e1f('0x13')](function(_0x64af99){console[_0x9e1f('0x14')](_0x64af99);});}main(); \ No newline at end of file +var _0xd66b=['./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','./server'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd66b,0x133));var _0xbd66=function(_0x3ad468,_0x184f68){_0x3ad468=_0x3ad468-0x0;var _0x180437=_0xd66b[_0x3ad468];return _0x180437;};'use strict';var BPromise=require('bluebird');var server=require(_0xbd66('0x0'));var Realtime=require(_0xbd66('0x1'));var user=require(_0xbd66('0x2'));var interval=require(_0xbd66('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xbd66('0x4'));var smsQueue=require(_0xbd66('0x5'));var mailQueue=require(_0xbd66('0x6'));var faxQueue=require(_0xbd66('0x7'));var whatsappQueue=require(_0xbd66('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xbd66('0x9')]()[_0xbd66('0xa')](user[_0xbd66('0xb')]())[_0xbd66('0xa')](realtime[_0xbd66('0xc')]())[_0xbd66('0xa')](interval[_0xbd66('0xd')]())[_0xbd66('0xa')](realtime[_0xbd66('0xe')]())[_0xbd66('0xa')](openchannelQueue[_0xbd66('0xf')]())[_0xbd66('0xa')](realtime[_0xbd66('0x10')]())['then'](chatQueue[_0xbd66('0x11')]())[_0xbd66('0xa')](realtime[_0xbd66('0x12')]())[_0xbd66('0xa')](smsQueue[_0xbd66('0x13')]())[_0xbd66('0xa')](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())[_0xbd66('0xa')](realtime[_0xbd66('0x14')]())[_0xbd66('0xa')](faxQueue[_0xbd66('0x15')]())[_0xbd66('0xa')](realtime[_0xbd66('0x16')]())[_0xbd66('0xa')](whatsappQueue[_0xbd66('0x17')]())[_0xbd66('0xa')](realtime[_0xbd66('0x18')]())[_0xbd66('0xa')](function(){return realtime;});}function main(){return server[_0xbd66('0x19')](realtime)[_0xbd66('0xa')](function(_0x59c897){return initRealtime();})['then'](function(_0x74223d){return setInterval(initRealtime,0x1388);})[_0xbd66('0x1a')](function(_0x237255){console[_0xbd66('0x1b')](_0x237255);});}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 d976ce5..28352c6 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 _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x37e4bf,_0x594dd2){var _0x3dc8=function(_0x4ebdd0){while(--_0x4ebdd0){_0x37e4bf['push'](_0x37e4bf['shift']());}};_0x3dc8(++_0x594dd2);}(_0x7a54,0x106));var _0x47a5=function(_0x430583,_0x19650c){_0x430583=_0x430583-0x0;var _0x10771a=_0x7a54[_0x430583];return _0x10771a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine; \ No newline at end of file +var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x27a474,_0x9975c4){var _0x3bdf3f=function(_0x2cfa4d){while(--_0x2cfa4d){_0x27a474['push'](_0x27a474['shift']());}};_0x3bdf3f(++_0x9975c4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index b448250..06734e9 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 _0x7e6d=['jayson/promise','client','http','then','error','result','sendMailMessage','SendMail','bluebird'];(function(_0x4c8942,_0x5962dc){var _0x3a1be8=function(_0x127dd2){while(--_0x127dd2){_0x4c8942['push'](_0x4c8942['shift']());}};_0x3a1be8(++_0x5962dc);}(_0x7e6d,0xbc));var _0xd7e6=function(_0x3a268d,_0x281b8a){_0x3a268d=_0x3a268d-0x0;var _0x1ad543=_0x7e6d[_0x3a268d];return _0x1ad543;};'use strict';var BPromise=require(_0xd7e6('0x0'));var jayson=require(_0xd7e6('0x1'));var client=jayson[_0xd7e6('0x2')][_0xd7e6('0x3')]({'port':0x232b});function request(_0x40191e,_0x518e44){return new BPromise(function(_0x495310,_0xa36f4a){return client['request'](_0x40191e,_0x518e44)[_0xd7e6('0x4')](function(_0xe90821){if(_0xe90821['error']){return _0xa36f4a(_0xe90821[_0xd7e6('0x5')]['message']);}else{return _0x495310(_0xe90821[_0xd7e6('0x6')]);}})['catch'](function(_0x50324c){return _0xa36f4a(_0x50324c);});});}exports[_0xd7e6('0x7')]=function(_0x54fc47,_0x4f7850){return request(_0xd7e6('0x8'),{'account':_0x54fc47,'message':_0x4f7850});}; \ No newline at end of file +var _0x6f27=['http','request','error','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6f27,0x16e));var _0x76f2=function(_0x1b776e,_0x1d341e){_0x1b776e=_0x1b776e-0x0;var _0x3b8294=_0x6f27[_0x1b776e];return _0x3b8294;};'use strict';var BPromise=require(_0x76f2('0x0'));var jayson=require(_0x76f2('0x1'));var client=jayson[_0x76f2('0x2')][_0x76f2('0x3')]({'port':0x232b});function request(_0x32c3a3,_0x53526b){return new BPromise(function(_0x78fd79,_0x2be21e){return client[_0x76f2('0x4')](_0x32c3a3,_0x53526b)['then'](function(_0x2bd889){if(_0x2bd889[_0x76f2('0x5')]){return _0x2be21e(_0x2bd889[_0x76f2('0x5')]['message']);}else{return _0x78fd79(_0x2bd889['result']);}})[_0x76f2('0x6')](function(_0x16932d){return _0x2be21e(_0x16932d);});});}exports[_0x76f2('0x7')]=function(_0x62c61f,_0xa6eabf){return request(_0x76f2('0x8'),{'account':_0x62c61f,'message':_0xa6eabf});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index f22b8c8..aa15e37 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 _0x9568=['whatsapp','length','Status','StatusTime','toNumber','format','openchannelPause','faxCurrentCapacity','smsStatusTime','whatsappStatus','openchannelStatusTime','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','sms'];(function(_0x421102,_0x457a13){var _0x16b9e3=function(_0x3429f2){while(--_0x3429f2){_0x421102['push'](_0x421102['shift']());}};_0x16b9e3(++_0x457a13);}(_0x9568,0xc7));var _0x8956=function(_0x35f969,_0x2c03bd){_0x35f969=_0x35f969-0x0;var _0x373c46=_0x9568[_0x35f969];return _0x373c46;};'use strict';var _=require(_0x8956('0x0'));var moment=require(_0x8956('0x1'));var md5=require(_0x8956('0x2'));var Redis=require(_0x8956('0x3'));var config=require(_0x8956('0x4'));config['redis']=_['defaults'](config[_0x8956('0x5')],{'host':_0x8956('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8956('0x5')]));function Agent(_0x506067){this['id']=_0x506067['id']||0x0;this[_0x8956('0x7')]=_0x506067[_0x8956('0x7')]||'';this[_0x8956('0x8')]=_0x506067['online']||!![];this[_0x8956('0x9')]=_0x506067['voicePause']||![];this[_0x8956('0xa')]=_0x506067[_0x8956('0xa')]||![];this[_0x8956('0xb')]=_0x506067[_0x8956('0xb')]||![];this['faxPause']=_0x506067[_0x8956('0xc')]||![];this[_0x8956('0xd')]=_0x506067[_0x8956('0xd')]||![];this['openchannelPause']=_0x506067['openchannelPause']||![];this[_0x8956('0xe')]='unknown';this[_0x8956('0xf')]=0x0;this[_0x8956('0x10')]=_0x506067['chatCapacity']||0x0;this[_0x8956('0x11')]=0x0;this[_0x8956('0x12')]=_0x8956('0x13');this[_0x8956('0x14')]=0x0;this[_0x8956('0x15')]=_0x506067[_0x8956('0x15')]||0x0;this[_0x8956('0x16')]=0x0;this[_0x8956('0x17')]=_0x8956('0x13');this[_0x8956('0x18')]=0x0;this[_0x8956('0x19')]=_0x506067[_0x8956('0x19')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x8956('0x1a')]=_0x8956('0x13');this['smsStatusTime']=0x0;this[_0x8956('0x1b')]=_0x506067['smsCapacity']||0x0;this[_0x8956('0x1c')]=0x0;this['whatsappStatus']='unknown';this[_0x8956('0x1d')]=0x0;this[_0x8956('0x1e')]=_0x506067[_0x8956('0x1e')]||0x0;this[_0x8956('0x1f')]=0x0;this[_0x8956('0x20')]=_0x8956('0x13');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x506067[_0x8956('0x21')]||0x0;this[_0x8956('0x22')]=0x0;this[_0x8956('0x23')]=![];this[_0x8956('0x24')]=undefined;this['md5']='';this[_0x8956('0x25')]();}Agent[_0x8956('0x26')][_0x8956('0x27')]=function(_0x3137bd){if(this[_0x3137bd+_0x8956('0x28')]>0x0){if(this[_0x3137bd+_0x8956('0x29')]>0x0&&this[_0x3137bd+'CurrentCapacity']>=this[_0x3137bd+_0x8956('0x29')]){return'maxcapacity';}else{return _0x8956('0x2a');}}else{return _0x8956('0x2b');}};Agent['prototype'][_0x8956('0x25')]=function(){var _0x49a0f7=[_0x8956('0x2c'),_0x8956('0x2d'),_0x8956('0x2e'),_0x8956('0x2f'),_0x8956('0x30'),_0x8956('0x31')];for(var _0x378c41=0x0;_0x378c41<_0x49a0f7[_0x8956('0x32')];_0x378c41+=0x1){var _0x450b12=this['getChannelStatus'](_0x49a0f7[_0x378c41]);if(this[_0x49a0f7[_0x378c41]+_0x8956('0x33')]!==_0x450b12){this[_0x49a0f7[_0x378c41]+_0x8956('0x34')]=_[_0x8956('0x35')](moment()[_0x8956('0x36')]('x'));}this[_0x49a0f7[_0x378c41]+_0x8956('0x33')]=_0x450b12;}var _0x4afb8e={'id':this['id'],'name':this['name'],'online':this[_0x8956('0x8')],'voicePause':this[_0x8956('0x9')],'chatPause':this[_0x8956('0xa')],'mailPause':this[_0x8956('0xb')],'smsPause':this[_0x8956('0xd')],'faxPause':this[_0x8956('0xc')],'openchannelPause':this[_0x8956('0x37')],'chatStatus':this[_0x8956('0xe')],'chatStatusTime':this[_0x8956('0xf')],'chatCapacity':this[_0x8956('0x10')],'chatCurrentCapacity':this[_0x8956('0x11')],'mailStatus':this[_0x8956('0x12')],'mailStatusTime':this[_0x8956('0x14')],'mailCapacity':this[_0x8956('0x15')],'mailCurrentCapacity':this[_0x8956('0x16')],'faxStatus':this[_0x8956('0x17')],'faxStatusTime':this[_0x8956('0x18')],'faxCapacity':this[_0x8956('0x19')],'faxCurrentCapacity':this[_0x8956('0x38')],'smsStatus':this[_0x8956('0x1a')],'smsStatusTime':this[_0x8956('0x39')],'smsCapacity':this[_0x8956('0x1b')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x8956('0x3a')],'whatsappStatusTime':this[_0x8956('0x1d')],'whatsappCapacity':this[_0x8956('0x1e')],'whatsappCurrentCapacity':this[_0x8956('0x1f')],'openchannelStatus':this[_0x8956('0x20')],'openchannelStatusTime':this[_0x8956('0x3b')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x8956('0x22')],'busy':this[_0x8956('0x23')],'busyQueue':this[_0x8956('0x24')]};var _0x372d1c=md5(JSON['stringify'](_0x4afb8e));if(this[_0x8956('0x2')]!==_0x372d1c){this[_0x8956('0x2')]=_0x372d1c;io[_0x8956('0x3c')](_0x8956('0x3d'),_0x4afb8e);}};module['exports']=Agent; \ No newline at end of file +var _0x05f3=['moment','md5','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','updateRealtime','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatCurrentCapacity','mailCurrentCapacity','faxCurrentCapacity','openchannelStatus','stringify','emit','exports'];(function(_0x140330,_0x45e1fa){var _0x263a28=function(_0x545e91){while(--_0x545e91){_0x140330['push'](_0x140330['shift']());}};_0x263a28(++_0x45e1fa);}(_0x05f3,0xf0));var _0x305f=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x05f3[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var moment=require(_0x305f('0x0'));var md5=require(_0x305f('0x1'));var Redis=require(_0x305f('0x2'));var config=require(_0x305f('0x3'));config['redis']=_['defaults'](config['redis'],{'host':_0x305f('0x4'),'port':0x18eb});var io=require(_0x305f('0x5'))(new Redis(config[_0x305f('0x6')]));function Agent(_0x5d7e41){this['id']=_0x5d7e41['id']||0x0;this['name']=_0x5d7e41[_0x305f('0x7')]||'';this[_0x305f('0x8')]=_0x5d7e41[_0x305f('0x8')]||!![];this[_0x305f('0x9')]=_0x5d7e41[_0x305f('0x9')]||![];this[_0x305f('0xa')]=_0x5d7e41['chatPause']||![];this['mailPause']=_0x5d7e41['mailPause']||![];this[_0x305f('0xb')]=_0x5d7e41['faxPause']||![];this[_0x305f('0xc')]=_0x5d7e41[_0x305f('0xc')]||![];this[_0x305f('0xd')]=_0x5d7e41[_0x305f('0xd')]||![];this[_0x305f('0xe')]=_0x305f('0xf');this[_0x305f('0x10')]=0x0;this[_0x305f('0x11')]=_0x5d7e41[_0x305f('0x11')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x305f('0x12')]='unknown';this[_0x305f('0x13')]=0x0;this[_0x305f('0x14')]=_0x5d7e41[_0x305f('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x305f('0x15')]='unknown';this[_0x305f('0x16')]=0x0;this[_0x305f('0x17')]=_0x5d7e41[_0x305f('0x17')]||0x0;this['faxCurrentCapacity']=0x0;this[_0x305f('0x18')]='unknown';this[_0x305f('0x19')]=0x0;this['smsCapacity']=_0x5d7e41[_0x305f('0x1a')]||0x0;this[_0x305f('0x1b')]=0x0;this[_0x305f('0x1c')]=_0x305f('0xf');this[_0x305f('0x1d')]=0x0;this[_0x305f('0x1e')]=_0x5d7e41[_0x305f('0x1e')]||0x0;this[_0x305f('0x1f')]=0x0;this['openchannelStatus']=_0x305f('0xf');this[_0x305f('0x20')]=0x0;this[_0x305f('0x21')]=_0x5d7e41[_0x305f('0x21')]||0x0;this[_0x305f('0x22')]=0x0;this[_0x305f('0x23')]=![];this[_0x305f('0x24')]=undefined;this[_0x305f('0x1')]='';this['updateRealtime']();}Agent[_0x305f('0x25')][_0x305f('0x26')]=function(_0xf84d0c){if(this[_0xf84d0c+_0x305f('0x27')]>0x0){if(this[_0xf84d0c+_0x305f('0x28')]>0x0&&this[_0xf84d0c+'CurrentCapacity']>=this[_0xf84d0c+_0x305f('0x28')]){return _0x305f('0x29');}else{return _0x305f('0x2a');}}else{return'idle';}};Agent[_0x305f('0x25')][_0x305f('0x2b')]=function(){var _0x531f21=['mail',_0x305f('0x2c'),_0x305f('0x2d'),_0x305f('0x2e'),_0x305f('0x2f'),_0x305f('0x30')];for(var _0x35bbfa=0x0;_0x35bbfa<_0x531f21[_0x305f('0x31')];_0x35bbfa+=0x1){var _0x106613=this[_0x305f('0x26')](_0x531f21[_0x35bbfa]);if(this[_0x531f21[_0x35bbfa]+_0x305f('0x32')]!==_0x106613){this[_0x531f21[_0x35bbfa]+_0x305f('0x33')]=_[_0x305f('0x34')](moment()['format']('x'));}this[_0x531f21[_0x35bbfa]+'Status']=_0x106613;}var _0x24d5c3={'id':this['id'],'name':this['name'],'online':this[_0x305f('0x8')],'voicePause':this[_0x305f('0x9')],'chatPause':this[_0x305f('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x305f('0xc')],'faxPause':this[_0x305f('0xb')],'openchannelPause':this[_0x305f('0xd')],'chatStatus':this[_0x305f('0xe')],'chatStatusTime':this[_0x305f('0x10')],'chatCapacity':this[_0x305f('0x11')],'chatCurrentCapacity':this[_0x305f('0x35')],'mailStatus':this[_0x305f('0x12')],'mailStatusTime':this[_0x305f('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x305f('0x36')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x305f('0x16')],'faxCapacity':this[_0x305f('0x17')],'faxCurrentCapacity':this[_0x305f('0x37')],'smsStatus':this[_0x305f('0x18')],'smsStatusTime':this[_0x305f('0x19')],'smsCapacity':this[_0x305f('0x1a')],'smsCurrentCapacity':this[_0x305f('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x305f('0x1d')],'whatsappCapacity':this[_0x305f('0x1e')],'whatsappCurrentCapacity':this[_0x305f('0x1f')],'openchannelStatus':this[_0x305f('0x38')],'openchannelStatusTime':this[_0x305f('0x20')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x305f('0x22')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x22915b=md5(JSON[_0x305f('0x39')](_0x24d5c3));if(this[_0x305f('0x1')]!==_0x22915b){this['md5']=_0x22915b;io[_0x305f('0x3a')]('user:save',_0x24d5c3);}};module[_0x305f('0x3b')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 24a1f1e..a2b4810 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 _0x27e7=['mapAgentsId','waiting','md5','updateRouting','updateRealtime','_rr','paused','length','loggedIn','chatPause','available','format','chat:queue:%s','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents'];(function(_0x3be43b,_0x3c10b3){var _0x2dc567=function(_0x2c33e8){while(--_0x2c33e8){_0x3be43b['push'](_0x3be43b['shift']());}};_0x2dc567(++_0x3c10b3);}(_0x27e7,0x1a4));var _0x727e=function(_0x660be6,_0x2b68f0){_0x660be6=_0x660be6-0x0;var _0x5a2eea=_0x27e7[_0x660be6];return _0x5a2eea;};'use strict';var _=require(_0x727e('0x0'));var md5=require('md5');var util=require(_0x727e('0x1'));var Redis=require(_0x727e('0x2'));var config=require(_0x727e('0x3'));config['redis']=_[_0x727e('0x4')](config['redis'],{'host':_0x727e('0x5'),'port':0x18eb});var io=require(_0x727e('0x6'))(new Redis(config[_0x727e('0x7')]));function ChatQueue(_0x5dbd1e){this['id']=_0x5dbd1e['id']||0x0;this[_0x727e('0x8')]=_0x5dbd1e[_0x727e('0x8')]||'';this[_0x727e('0x9')]=_0x5dbd1e[_0x727e('0x9')]||0xa;this[_0x727e('0xa')]=_0x5dbd1e['strategy']||'beepall';this[_0x727e('0xb')]=_0x5dbd1e['Agents'];this[_0x727e('0xc')]={};this[_0x727e('0xd')]=0x0;this[_0x727e('0xe')]='';this[_0x727e('0xf')]();this[_0x727e('0x10')]();}ChatQueue['prototype'][_0x727e('0xf')]=function(){var _0x51a570=this[_0x727e('0xc')]['_rr'];this['mapAgentsId']=_['map'](this[_0x727e('0xb')],'id');this[_0x727e('0xc')][_0x727e('0x11')]=_0x51a570;};ChatQueue['prototype'][_0x727e('0x10')]=function(){this['loggedIn']=0x0;this[_0x727e('0x12')]=0x0;for(var _0x2ac513=0x0;_0x2ac513=0x0?this[_0x727e('0x16')]:0x0;var _0x4ddbb9={'id':this['id'],'available':this[_0x727e('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x727e('0x8')],'paused':this['paused'],'waiting':this[_0x727e('0xd')]};var _0x20a856=md5(JSON['stringify'](_0x4ddbb9));if(this[_0x727e('0xe')]!==_0x20a856){this[_0x727e('0xe')]=_0x20a856;io['to'](util[_0x727e('0x17')](_0x727e('0x18'),_0x4ddbb9['name']))[_0x727e('0x19')](_0x727e('0x1a'),_0x4ddbb9);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xca46=['util','ioredis','../../../config/environment','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','available','stringify','format','chat:queue:%s','lodash','md5'];(function(_0x2902cc,_0x4d1d00){var _0x5f418f=function(_0x5e3846){while(--_0x5e3846){_0x2902cc['push'](_0x2902cc['shift']());}};_0x5f418f(++_0x4d1d00);}(_0xca46,0x175));var _0x6ca4=function(_0x4acf7e,_0x1e6dfd){_0x4acf7e=_0x4acf7e-0x0;var _0x2e9d7d=_0xca46[_0x4acf7e];return _0x2e9d7d;};'use strict';var _=require(_0x6ca4('0x0'));var md5=require(_0x6ca4('0x1'));var util=require(_0x6ca4('0x2'));var Redis=require(_0x6ca4('0x3'));var config=require(_0x6ca4('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x6ca4('0x5'),'port':0x18eb});var io=require(_0x6ca4('0x6'))(new Redis(config[_0x6ca4('0x7')]));function ChatQueue(_0xe95a73){this['id']=_0xe95a73['id']||0x0;this[_0x6ca4('0x8')]=_0xe95a73[_0x6ca4('0x8')]||'';this[_0x6ca4('0x9')]=_0xe95a73[_0x6ca4('0x9')]||0xa;this[_0x6ca4('0xa')]=_0xe95a73['strategy']||'beepall';this[_0x6ca4('0xb')]=_0xe95a73[_0x6ca4('0xb')];this[_0x6ca4('0xc')]={};this[_0x6ca4('0xd')]=0x0;this[_0x6ca4('0x1')]='';this[_0x6ca4('0xe')]();this[_0x6ca4('0xf')]();}ChatQueue[_0x6ca4('0x10')]['updateRouting']=function(){var _0x552eef=this[_0x6ca4('0xc')]['_rr'];this[_0x6ca4('0xc')]=_['map'](this[_0x6ca4('0xb')],'id');this[_0x6ca4('0xc')][_0x6ca4('0x11')]=_0x552eef;};ChatQueue[_0x6ca4('0x10')][_0x6ca4('0xf')]=function(){this[_0x6ca4('0x12')]=0x0;this[_0x6ca4('0x13')]=0x0;for(var _0x6b359a=0x0;_0x6b359a=0x0?this[_0x6ca4('0x15')]:0x0;var _0x52323d={'id':this['id'],'available':this[_0x6ca4('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x6ca4('0x8')],'paused':this[_0x6ca4('0x13')],'waiting':this[_0x6ca4('0xd')]};var _0x44b266=md5(JSON[_0x6ca4('0x16')](_0x52323d));if(this[_0x6ca4('0x1')]!==_0x44b266){this[_0x6ca4('0x1')]=_0x44b266;io['to'](util[_0x6ca4('0x17')](_0x6ca4('0x18'),_0x52323d[_0x6ca4('0x8')]))['emit']('chat_queue:save',_0x52323d);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index e3fe3ed..0da53d1 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 _0x889b=['prototype','mapAgentsId','_rr','map','updateRealtime','loggedIn','paused','length','online','faxPause','available','stringify','emit','fax_queue:save','exports','lodash','md5','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting'];(function(_0x5d964c,_0x43b083){var _0xbaea1d=function(_0x4d57e7){while(--_0x4d57e7){_0x5d964c['push'](_0x5d964c['shift']());}};_0xbaea1d(++_0x43b083);}(_0x889b,0x15f));var _0xb889=function(_0x34068f,_0x5758e4){_0x34068f=_0x34068f-0x0;var _0x351894=_0x889b[_0x34068f];return _0x351894;};'use strict';var _=require(_0xb889('0x0'));var md5=require(_0xb889('0x1'));var util=require('util');var Redis=require(_0xb889('0x2'));var config=require(_0xb889('0x3'));config['redis']=_[_0xb889('0x4')](config[_0xb889('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xb889('0x6'))(new Redis(config[_0xb889('0x5')]));function FaxQueue(_0x3b903e){this['id']=_0x3b903e['id']||0x0;this[_0xb889('0x7')]=_0x3b903e['name']||'';this[_0xb889('0x8')]=_0x3b903e[_0xb889('0x8')]||0xa;this[_0xb889('0x9')]=_0x3b903e[_0xb889('0x9')]||'beepall';this[_0xb889('0xa')]=_0x3b903e[_0xb889('0xa')];this['mapAgentsId']={};this[_0xb889('0xb')]=0x0;this[_0xb889('0x1')]='';this[_0xb889('0xc')]();this['updateRealtime']();}FaxQueue[_0xb889('0xd')]['updateRouting']=function(){var _0x357697=this[_0xb889('0xe')][_0xb889('0xf')];this[_0xb889('0xe')]=_[_0xb889('0x10')](this[_0xb889('0xa')],'id');this[_0xb889('0xe')][_0xb889('0xf')]=_0x357697;};FaxQueue['prototype'][_0xb889('0x11')]=function(){this[_0xb889('0x12')]=0x0;this[_0xb889('0x13')]=0x0;for(var _0x1605a9=0x0;_0x1605a9=0x0?this[_0xb889('0x17')]:0x0;var _0x4ed231={'id':this['id'],'available':this['available'],'loggedIn':this[_0xb889('0x12')],'name':this[_0xb889('0x7')],'paused':this[_0xb889('0x13')],'waiting':this['waiting']};var _0x48a6d1=md5(JSON[_0xb889('0x18')](_0x4ed231));if(this['md5']!==_0x48a6d1){this[_0xb889('0x1')]=_0x48a6d1;io['to'](util['format']('fax:queue:%s',_0x4ed231['name']))[_0xb889('0x19')](_0xb889('0x1a'),_0x4ed231);}};module[_0xb889('0x1b')]=FaxQueue; \ No newline at end of file +var _0x4e90=['prototype','map','Agents','loggedIn','paused','length','faxPause','available','stringify','format','fax:queue:%s','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0xd6b9f,_0x475f93){var _0x38b326=function(_0x3aec1f){while(--_0x3aec1f){_0xd6b9f['push'](_0xd6b9f['shift']());}};_0x38b326(++_0x475f93);}(_0x4e90,0xe4));var _0x04e9=function(_0x20da5d,_0x396eb6){_0x20da5d=_0x20da5d-0x0;var _0x69b4b6=_0x4e90[_0x20da5d];return _0x69b4b6;};'use strict';var _=require(_0x04e9('0x0'));var md5=require(_0x04e9('0x1'));var util=require('util');var Redis=require(_0x04e9('0x2'));var config=require(_0x04e9('0x3'));config[_0x04e9('0x4')]=_[_0x04e9('0x5')](config[_0x04e9('0x4')],{'host':_0x04e9('0x6'),'port':0x18eb});var io=require(_0x04e9('0x7'))(new Redis(config[_0x04e9('0x4')]));function FaxQueue(_0x558936){this['id']=_0x558936['id']||0x0;this[_0x04e9('0x8')]=_0x558936[_0x04e9('0x8')]||'';this[_0x04e9('0x9')]=_0x558936['timeout']||0xa;this['strategy']=_0x558936['strategy']||_0x04e9('0xa');this['Agents']=_0x558936['Agents'];this[_0x04e9('0xb')]={};this[_0x04e9('0xc')]=0x0;this[_0x04e9('0x1')]='';this[_0x04e9('0xd')]();this[_0x04e9('0xe')]();}FaxQueue[_0x04e9('0xf')][_0x04e9('0xd')]=function(){var _0x588aa7=this[_0x04e9('0xb')]['_rr'];this['mapAgentsId']=_[_0x04e9('0x10')](this[_0x04e9('0x11')],'id');this[_0x04e9('0xb')]['_rr']=_0x588aa7;};FaxQueue[_0x04e9('0xf')][_0x04e9('0xe')]=function(){this[_0x04e9('0x12')]=0x0;this[_0x04e9('0x13')]=0x0;for(var _0xc32a04=0x0;_0xc32a04=0x0?this[_0x04e9('0x16')]:0x0;var _0x492609={'id':this['id'],'available':this[_0x04e9('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x04e9('0x8')],'paused':this[_0x04e9('0x13')],'waiting':this['waiting']};var _0x39d038=md5(JSON[_0x04e9('0x17')](_0x492609));if(this[_0x04e9('0x1')]!==_0x39d038){this[_0x04e9('0x1')]=_0x39d038;io['to'](util[_0x04e9('0x18')](_0x04e9('0x19'),_0x492609[_0x04e9('0x8')]))['emit']('fax_queue:save',_0x492609);}};module[_0x04e9('0x1a')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index e6ae232..9939f42 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 _0xf86c=['exports','name'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xf86c,0xcd));var _0xcf86=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf86c[_0x3dd15e];return _0x231fd0;};'use strict';function Interval(_0x22e13e){this['id']=_0x22e13e['id']||0x0;this[_0xcf86('0x0')]=_0x22e13e[_0xcf86('0x0')]||'';this['Intervals']=_0x22e13e['Intervals']||{};}module[_0xcf86('0x1')]=Interval; \ No newline at end of file +var _0x1c5f=['Intervals','name'];(function(_0x171ac4,_0x125d4c){var _0x318904=function(_0x48f7b8){while(--_0x48f7b8){_0x171ac4['push'](_0x171ac4['shift']());}};_0x318904(++_0x125d4c);}(_0x1c5f,0x1e5));var _0xf1c5=function(_0x3f6d98,_0x2e1ff4){_0x3f6d98=_0x3f6d98-0x0;var _0x2517ae=_0x1c5f[_0x3f6d98];return _0x2517ae;};'use strict';function Interval(_0x2bac52){this['id']=_0x2bac52['id']||0x0;this[_0xf1c5('0x0')]=_0x2bac52[_0xf1c5('0x0')]||'';this[_0xf1c5('0x1')]=_0x2bac52['Intervals']||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 678e1a5..b57ee0d 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 _0x8bbc=['mailPause','available','stringify','md5','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','name','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length'];(function(_0x41ed6b,_0x2efccd){var _0x58b424=function(_0x2888cd){while(--_0x2888cd){_0x41ed6b['push'](_0x41ed6b['shift']());}};_0x58b424(++_0x2efccd);}(_0x8bbc,0x153));var _0xc8bb=function(_0x2dc7c9,_0x3a15f8){_0x2dc7c9=_0x2dc7c9-0x0;var _0x3e6536=_0x8bbc[_0x2dc7c9];return _0x3e6536;};'use strict';var _=require(_0xc8bb('0x0'));var md5=require('md5');var util=require(_0xc8bb('0x1'));var Redis=require(_0xc8bb('0x2'));var config=require(_0xc8bb('0x3'));config['redis']=_[_0xc8bb('0x4')](config[_0xc8bb('0x5')],{'host':_0xc8bb('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc8bb('0x5')]));function MailQueue(_0x5ccbaa){this['id']=_0x5ccbaa['id']||0x0;this[_0xc8bb('0x7')]=_0x5ccbaa[_0xc8bb('0x7')]||'';this['timeout']=_0x5ccbaa['timeout']||0xa;this[_0xc8bb('0x8')]=_0x5ccbaa[_0xc8bb('0x8')]||_0xc8bb('0x9');this[_0xc8bb('0xa')]=_0x5ccbaa[_0xc8bb('0xa')];this['mapAgentsId']={};this[_0xc8bb('0xb')]=0x0;this['md5']='';this['updateRouting']();this[_0xc8bb('0xc')]();}MailQueue[_0xc8bb('0xd')][_0xc8bb('0xe')]=function(){var _0x1b45f0=this[_0xc8bb('0xf')][_0xc8bb('0x10')];this[_0xc8bb('0xf')]=_[_0xc8bb('0x11')](this[_0xc8bb('0xa')],'id');this['mapAgentsId']['_rr']=_0x1b45f0;};MailQueue[_0xc8bb('0xd')][_0xc8bb('0xc')]=function(){this[_0xc8bb('0x12')]=0x0;this[_0xc8bb('0x13')]=0x0;for(var _0x3f0d8e=0x0;_0x3f0d8e=0x0?this['available']:0x0;var _0x1f2dc1={'id':this['id'],'available':this['available'],'loggedIn':this[_0xc8bb('0x12')],'name':this['name'],'paused':this[_0xc8bb('0x13')],'waiting':this[_0xc8bb('0xb')]};var _0x3b3a9e=md5(JSON[_0xc8bb('0x17')](_0x1f2dc1));if(this[_0xc8bb('0x18')]!==_0x3b3a9e){this[_0xc8bb('0x18')]=_0x3b3a9e;io['to'](util[_0xc8bb('0x19')](_0xc8bb('0x1a'),_0x1f2dc1['name']))[_0xc8bb('0x1b')](_0xc8bb('0x1c'),_0x1f2dc1);}};module[_0xc8bb('0x1d')]=MailQueue; \ No newline at end of file +var _0x7f70=['paused','online','loggedIn','mailPause','available','stringify','mail:queue:%s','emit','exports','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x29c5d5,_0x3cca19){var _0xeab79f=function(_0x8bf3bc){while(--_0x8bf3bc){_0x29c5d5['push'](_0x29c5d5['shift']());}};_0xeab79f(++_0x3cca19);}(_0x7f70,0x90));var _0x07f7=function(_0x20e451,_0x353808){_0x20e451=_0x20e451-0x0;var _0x3677a3=_0x7f70[_0x20e451];return _0x3677a3;};'use strict';var _=require('lodash');var md5=require('md5');var util=require('util');var Redis=require(_0x07f7('0x0'));var config=require(_0x07f7('0x1'));config['redis']=_[_0x07f7('0x2')](config[_0x07f7('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x07f7('0x4'))(new Redis(config[_0x07f7('0x3')]));function MailQueue(_0x512c8c){this['id']=_0x512c8c['id']||0x0;this[_0x07f7('0x5')]=_0x512c8c[_0x07f7('0x5')]||'';this[_0x07f7('0x6')]=_0x512c8c[_0x07f7('0x6')]||0xa;this[_0x07f7('0x7')]=_0x512c8c[_0x07f7('0x7')]||_0x07f7('0x8');this[_0x07f7('0x9')]=_0x512c8c['Agents'];this[_0x07f7('0xa')]={};this[_0x07f7('0xb')]=0x0;this[_0x07f7('0xc')]='';this[_0x07f7('0xd')]();this[_0x07f7('0xe')]();}MailQueue[_0x07f7('0xf')]['updateRouting']=function(){var _0x5d930b=this[_0x07f7('0xa')][_0x07f7('0x10')];this[_0x07f7('0xa')]=_[_0x07f7('0x11')](this['Agents'],'id');this['mapAgentsId'][_0x07f7('0x10')]=_0x5d930b;};MailQueue[_0x07f7('0xf')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x07f7('0x12')]=0x0;for(var _0x184fca=0x0;_0x184fca=0x0?this[_0x07f7('0x16')]:0x0;var _0x317764={'id':this['id'],'available':this[_0x07f7('0x16')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x07f7('0x12')],'waiting':this[_0x07f7('0xb')]};var _0x308c7a=md5(JSON[_0x07f7('0x17')](_0x317764));if(this[_0x07f7('0xc')]!==_0x308c7a){this[_0x07f7('0xc')]=_0x308c7a;io['to'](util['format'](_0x07f7('0x18'),_0x317764[_0x07f7('0x5')]))[_0x07f7('0x19')]('mail_queue:save',_0x317764);}};module[_0x07f7('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 5124944..9bf5c46 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 _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(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'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 +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x53c256,_0x382a24){var _0x25feb6=function(_0x2652fd){while(--_0x2652fd){_0x53c256['push'](_0x53c256['shift']());}};_0x25feb6(++_0x382a24);}(_0x1261,0x144));var _0x1126=function(_0x6acb69,_0xd36dbf){_0x6acb69=_0x6acb69-0x0;var _0x29a021=_0x1261[_0x6acb69];return _0x29a021;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index f4a9f71..b3f1f89 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 _0x34b2=['prototype','mapAgentsId','_rr','map','paused','length','online','loggedIn','smsPause','available','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','waiting','updateRouting','updateRealtime'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x34b2,0x11c));var _0x234b=function(_0x479b99,_0x1e5bec){_0x479b99=_0x479b99-0x0;var _0x1e7eb7=_0x34b2[_0x479b99];return _0x1e7eb7;};'use strict';var _=require(_0x234b('0x0'));var md5=require(_0x234b('0x1'));var util=require(_0x234b('0x2'));var Redis=require(_0x234b('0x3'));var config=require(_0x234b('0x4'));config[_0x234b('0x5')]=_[_0x234b('0x6')](config[_0x234b('0x5')],{'host':_0x234b('0x7'),'port':0x18eb});var io=require(_0x234b('0x8'))(new Redis(config[_0x234b('0x5')]));function SmsQueue(_0x35a8ef){this['id']=_0x35a8ef['id']||0x0;this[_0x234b('0x9')]=_0x35a8ef['name']||'';this['timeout']=_0x35a8ef['timeout']||0xa;this[_0x234b('0xa')]=_0x35a8ef[_0x234b('0xa')]||_0x234b('0xb');this[_0x234b('0xc')]=_0x35a8ef['Agents'];this['mapAgentsId']={};this[_0x234b('0xd')]=0x0;this[_0x234b('0x1')]='';this[_0x234b('0xe')]();this[_0x234b('0xf')]();}SmsQueue[_0x234b('0x10')][_0x234b('0xe')]=function(){var _0x3e4f17=this[_0x234b('0x11')][_0x234b('0x12')];this[_0x234b('0x11')]=_[_0x234b('0x13')](this[_0x234b('0xc')],'id');this[_0x234b('0x11')]['_rr']=_0x3e4f17;};SmsQueue[_0x234b('0x10')][_0x234b('0xf')]=function(){this['loggedIn']=0x0;this[_0x234b('0x14')]=0x0;for(var _0x836f55=0x0;_0x836f55=0x0?this[_0x234b('0x19')]:0x0;var _0x22696d={'id':this['id'],'available':this[_0x234b('0x19')],'loggedIn':this[_0x234b('0x17')],'name':this[_0x234b('0x9')],'paused':this[_0x234b('0x14')],'waiting':this[_0x234b('0xd')]};var _0x2f2b0f=md5(JSON['stringify'](_0x22696d));if(this[_0x234b('0x1')]!==_0x2f2b0f){this[_0x234b('0x1')]=_0x2f2b0f;io['to'](util[_0x234b('0x1a')](_0x234b('0x1b'),_0x22696d[_0x234b('0x9')]))['emit'](_0x234b('0x1c'),_0x22696d);}};module[_0x234b('0x1d')]=SmsQueue; \ No newline at end of file +var _0x4016=['smsPause','available','waiting','stringify','format','sms:queue:%s','emit','exports','md5','util','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online'];(function(_0x79b649,_0x2115b3){var _0x1af9b1=function(_0x153c9f){while(--_0x153c9f){_0x79b649['push'](_0x79b649['shift']());}};_0x1af9b1(++_0x2115b3);}(_0x4016,0x131));var _0x6401=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4016[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var md5=require(_0x6401('0x0'));var util=require(_0x6401('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x6401('0x2')](config['redis'],{'host':_0x6401('0x3'),'port':0x18eb});var io=require(_0x6401('0x4'))(new Redis(config['redis']));function SmsQueue(_0x5c5201){this['id']=_0x5c5201['id']||0x0;this[_0x6401('0x5')]=_0x5c5201[_0x6401('0x5')]||'';this['timeout']=_0x5c5201[_0x6401('0x6')]||0xa;this['strategy']=_0x5c5201[_0x6401('0x7')]||'beepall';this[_0x6401('0x8')]=_0x5c5201[_0x6401('0x8')];this[_0x6401('0x9')]={};this['waiting']=0x0;this['md5']='';this[_0x6401('0xa')]();this[_0x6401('0xb')]();}SmsQueue[_0x6401('0xc')]['updateRouting']=function(){var _0x154a67=this['mapAgentsId']['_rr'];this[_0x6401('0x9')]=_[_0x6401('0xd')](this[_0x6401('0x8')],'id');this[_0x6401('0x9')][_0x6401('0xe')]=_0x154a67;};SmsQueue[_0x6401('0xc')][_0x6401('0xb')]=function(){this[_0x6401('0xf')]=0x0;this[_0x6401('0x10')]=0x0;for(var _0x1f6edf=0x0;_0x1f6edf=0x0?this['available']:0x0;var _0x2d8f2d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x6401('0xf')],'name':this[_0x6401('0x5')],'paused':this[_0x6401('0x10')],'waiting':this[_0x6401('0x15')]};var _0x3e2af8=md5(JSON[_0x6401('0x16')](_0x2d8f2d));if(this[_0x6401('0x0')]!==_0x3e2af8){this['md5']=_0x3e2af8;io['to'](util[_0x6401('0x17')](_0x6401('0x18'),_0x2d8f2d[_0x6401('0x5')]))[_0x6401('0x19')]('sms_queue:save',_0x2d8f2d);}};module[_0x6401('0x1a')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 1588f87..a736580 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 _0x85ef=['strategy','Agents','mapAgentsId','updateRouting','_rr','prototype','updateRealtime','loggedIn','paused','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x15f86e,_0x23d21d){var _0x27c02d=function(_0x31135c){while(--_0x31135c){_0x15f86e['push'](_0x15f86e['shift']());}};_0x27c02d(++_0x23d21d);}(_0x85ef,0x17d));var _0xf85e=function(_0x4e015e,_0x1f7a0f){_0x4e015e=_0x4e015e-0x0;var _0x41c5c7=_0x85ef[_0x4e015e];return _0x41c5c7;};'use strict';var _=require(_0xf85e('0x0'));var md5=require(_0xf85e('0x1'));var util=require(_0xf85e('0x2'));var Redis=require(_0xf85e('0x3'));var config=require(_0xf85e('0x4'));config[_0xf85e('0x5')]=_[_0xf85e('0x6')](config[_0xf85e('0x5')],{'host':_0xf85e('0x7'),'port':0x18eb});var io=require(_0xf85e('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0xd01f6f){this['id']=_0xd01f6f['id']||0x0;this[_0xf85e('0x9')]=_0xd01f6f['name']||'';this[_0xf85e('0xa')]=_0xd01f6f['timeout']||0xa;this[_0xf85e('0xb')]=_0xd01f6f[_0xf85e('0xb')]||'beepall';this[_0xf85e('0xc')]=_0xd01f6f[_0xf85e('0xc')];this[_0xf85e('0xd')]={};this['waiting']=0x0;this[_0xf85e('0x1')]='';this[_0xf85e('0xe')]();this['updateRealtime']();}WhatsappQueue['prototype'][_0xf85e('0xe')]=function(){var _0x2fc1ad=this[_0xf85e('0xd')][_0xf85e('0xf')];this[_0xf85e('0xd')]=_['map'](this[_0xf85e('0xc')],'id');this['mapAgentsId']['_rr']=_0x2fc1ad;};WhatsappQueue[_0xf85e('0x10')][_0xf85e('0x11')]=function(){this[_0xf85e('0x12')]=0x0;this[_0xf85e('0x13')]=0x0;for(var _0x2d2b64=0x0;_0x2d2b64=0x0?this['available']:0x0;var _0x50c5c3={'id':this['id'],'available':this[_0xf85e('0x15')],'loggedIn':this[_0xf85e('0x12')],'name':this[_0xf85e('0x9')],'paused':this[_0xf85e('0x13')],'waiting':this[_0xf85e('0x16')]};var _0x3021a9=md5(JSON[_0xf85e('0x17')](_0x50c5c3));if(this[_0xf85e('0x1')]!==_0x3021a9){this[_0xf85e('0x1')]=_0x3021a9;io['to'](util[_0xf85e('0x18')](_0xf85e('0x19'),_0x50c5c3[_0xf85e('0x9')]))[_0xf85e('0x1a')](_0xf85e('0x1b'),_0x50c5c3);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0x8f3b=['available','name','format','whatsapp_queue:save','exports','lodash','util','ioredis','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','md5','updateRealtime','_rr','map','prototype','length','loggedIn','whatsappPause','paused'];(function(_0x530719,_0x50001d){var _0x473cb8=function(_0x4ae8f8){while(--_0x4ae8f8){_0x530719['push'](_0x530719['shift']());}};_0x473cb8(++_0x50001d);}(_0x8f3b,0x6d));var _0xb8f3=function(_0x26372b,_0x3d81e2){_0x26372b=_0x26372b-0x0;var _0x2e8a9b=_0x8f3b[_0x26372b];return _0x2e8a9b;};'use strict';var _=require(_0xb8f3('0x0'));var md5=require('md5');var util=require(_0xb8f3('0x1'));var Redis=require(_0xb8f3('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xb8f3('0x3')](config[_0xb8f3('0x4')],{'host':_0xb8f3('0x5'),'port':0x18eb});var io=require(_0xb8f3('0x6'))(new Redis(config[_0xb8f3('0x4')]));function WhatsappQueue(_0x3218f2){this['id']=_0x3218f2['id']||0x0;this['name']=_0x3218f2['name']||'';this[_0xb8f3('0x7')]=_0x3218f2[_0xb8f3('0x7')]||0xa;this[_0xb8f3('0x8')]=_0x3218f2[_0xb8f3('0x8')]||_0xb8f3('0x9');this[_0xb8f3('0xa')]=_0x3218f2[_0xb8f3('0xa')];this['mapAgentsId']={};this[_0xb8f3('0xb')]=0x0;this[_0xb8f3('0xc')]='';this['updateRouting']();this[_0xb8f3('0xd')]();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x724d6b=this['mapAgentsId'][_0xb8f3('0xe')];this['mapAgentsId']=_[_0xb8f3('0xf')](this[_0xb8f3('0xa')],'id');this['mapAgentsId'][_0xb8f3('0xe')]=_0x724d6b;};WhatsappQueue[_0xb8f3('0x10')][_0xb8f3('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x399683=0x0;_0x399683=0x0?this['available']:0x0;var _0x2dc40f={'id':this['id'],'available':this[_0xb8f3('0x15')],'loggedIn':this[_0xb8f3('0x12')],'name':this[_0xb8f3('0x16')],'paused':this[_0xb8f3('0x14')],'waiting':this[_0xb8f3('0xb')]};var _0x3b4322=md5(JSON['stringify'](_0x2dc40f));if(this['md5']!==_0x3b4322){this['md5']=_0x3b4322;io['to'](util[_0xb8f3('0x17')]('whatsapp:queue:%s',_0x2dc40f['name']))['emit'](_0xb8f3('0x18'),_0x2dc40f);}};module[_0xb8f3('0x19')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 50539d8..4fc50e6 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x519c6b,_0x3c4325){var _0x43d87c=function(_0x39775a){while(--_0x39775a){_0x519c6b['push'](_0x519c6b['shift']());}};_0x43d87c(++_0x3c4325);}(_0xb10b,0x12a));var _0xbb10=function(_0x3cb83f,_0x2bc6dd){_0x3cb83f=_0x3cb83f-0x0;var _0x105d68=_0xb10b[_0x3cb83f];return _0x105d68;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 49fb60d..89ffe36 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 _0x83b0=['../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x113cc4,_0x256958){var _0x4171c2=function(_0x480229){while(--_0x480229){_0x113cc4['push'](_0x113cc4['shift']());}};_0x4171c2(++_0x256958);}(_0x83b0,0x1dc));var _0x083b=function(_0x306da3,_0x3c558c){_0x306da3=_0x306da3-0x0;var _0x2273db=_0x83b0[_0x306da3];return _0x2273db;};'use strict';var client=require(_0x083b('0x0'));exports['update']=function(_0x252959,_0x522aa2){return client[_0x083b('0x1')](_0x083b('0x2'),{'body':_0x522aa2,'options':{'where':{'id':_0x252959}},'log':_0x083b('0x3')});};exports[_0x083b('0x4')]=function(_0x2f5d1a,_0x107a8f){return client['Request'](_0x083b('0x5'),{'body':_0x107a8f,'options':{'where':{'id':_0x2f5d1a}},'log':_0x083b('0x6')});}; \ No newline at end of file +var _0x131d=['../client','update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x55ed9c,_0x312431){var _0x43c649=function(_0x27441e){while(--_0x27441e){_0x55ed9c['push'](_0x55ed9c['shift']());}};_0x43c649(++_0x312431);}(_0x131d,0x10a));var _0xd131=function(_0x5f1918,_0x3c8c3f){_0x5f1918=_0x5f1918-0x0;var _0xedbd83=_0x131d[_0x5f1918];return _0xedbd83;};'use strict';var client=require(_0xd131('0x0'));exports[_0xd131('0x1')]=function(_0x51b8c2,_0xfafbe2){return client[_0xd131('0x2')](_0xd131('0x3'),{'body':_0xfafbe2,'options':{'where':{'id':_0x51b8c2}},'log':'updateChatInteraction'});};exports[_0xd131('0x4')]=function(_0xc5f15e,_0x49f5b9){return client[_0xd131('0x2')](_0xd131('0x5'),{'body':_0x49f5b9,'options':{'where':{'id':_0xc5f15e}},'log':_0xd131('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index aed0795..46a71ab 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 _0x1591=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x1591,0x190));var _0x1159=function(_0x27f5de,_0x577080){_0x27f5de=_0x27f5de-0x0;var _0x484149=_0x1591[_0x27f5de];return _0x484149;};'use strict';var client=require(_0x1159('0x0'));exports[_0x1159('0x1')]=function(_0x528d7d){return client[_0x1159('0x2')](_0x1159('0x3'),{'body':_0x528d7d,'log':_0x1159('0x4')});}; \ No newline at end of file +var _0x5716=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x9861ff,_0x41fb17){var _0x48852b=function(_0x557001){while(--_0x557001){_0x9861ff['push'](_0x9861ff['shift']());}};_0x48852b(++_0x41fb17);}(_0x5716,0x8c));var _0x6571=function(_0x430459,_0x58519c){_0x430459=_0x430459-0x0;var _0x3a2439=_0x5716[_0x430459];return _0x3a2439;};'use strict';var client=require(_0x6571('0x0'));exports[_0x6571('0x1')]=function(_0x524b9c){return client[_0x6571('0x2')](_0x6571('0x3'),{'body':_0x524b9c,'log':_0x6571('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 989e9b3..94bfdc7 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 _0xfcbd=['chatPause','../client','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x1b84b8,_0x34e128){var _0x4aeccd=function(_0x48ce30){while(--_0x48ce30){_0x1b84b8['push'](_0x1b84b8['shift']());}};_0x4aeccd(++_0x34e128);}(_0xfcbd,0x160));var _0xdfcb=function(_0x30730c,_0x5e00f2){_0x30730c=_0x30730c-0x0;var _0x554424=_0xfcbd[_0x30730c];return _0x554424;};'use strict';var client=require(_0xdfcb('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0xdfcb('0x1'),{'options':{'raw':![],'attributes':['id',_0xdfcb('0x2'),_0xdfcb('0x3'),_0xdfcb('0x4')],'include':[{'model':_0xdfcb('0x5'),'as':_0xdfcb('0x6'),'attributes':['id',_0xdfcb('0x2'),_0xdfcb('0x7'),_0xdfcb('0x8')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x8375=['name','timeout','strategy','User','Agents','chatPause','../client','getChatQueues','Request'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8375,0xa8));var _0x5837=function(_0xd85640,_0x2cec9f){_0xd85640=_0xd85640-0x0;var _0x3c170b=_0x8375[_0xd85640];return _0x3c170b;};'use strict';var client=require(_0x5837('0x0'));exports[_0x5837('0x1')]=function(){return function(){return client[_0x5837('0x2')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x5837('0x3'),_0x5837('0x4'),_0x5837('0x5')],'include':[{'model':_0x5837('0x6'),'as':_0x5837('0x7'),'attributes':['id',_0x5837('0x3'),'online',_0x5837('0x8')]}]},'log':_0x5837('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 7209e5f..9c0deb8 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 _0x7ec2=['../client','create','CreateChatQueueReport','Request','UpdateChatQueueReport','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ec2,0x15c));var _0x27ec=function(_0x157be0,_0x4e7f31){_0x157be0=_0x157be0-0x0;var _0x7b4183=_0x7ec2[_0x157be0];return _0x7b4183;};'use strict';var client=require(_0x27ec('0x0'));exports[_0x27ec('0x1')]=function(_0x29b076){return client['Request'](_0x27ec('0x2'),{'body':_0x29b076,'log':_0x27ec('0x2')});};exports['update']=function(_0x45b293,_0x340231){return client[_0x27ec('0x3')](_0x27ec('0x4'),{'body':_0x340231,'options':{'where':{'uniqueid':_0x45b293},'order':[['id',_0x27ec('0x5')]],'limit':0x1},'log':_0x27ec('0x4')});}; \ No newline at end of file +var _0xfc1e=['UpdateChatQueueReport','Request','CreateChatQueueReport','update'];(function(_0x390d3a,_0x5eaf16){var _0x294503=function(_0x25afa6){while(--_0x25afa6){_0x390d3a['push'](_0x390d3a['shift']());}};_0x294503(++_0x5eaf16);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xfc1e[_0x21549c];return _0x426cbd;};'use strict';var client=require('../client');exports['create']=function(_0x5407e7){return client[_0xefc1('0x0')](_0xefc1('0x1'),{'body':_0x5407e7,'log':_0xefc1('0x1')});};exports[_0xefc1('0x2')]=function(_0xbe8efc,_0x4960a1){return client[_0xefc1('0x0')](_0xefc1('0x3'),{'body':_0x4960a1,'options':{'where':{'uniqueid':_0xbe8efc},'order':[['id','DESC']],'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 a3127ee..53ffdec 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4ff92d,_0x452633){var _0x430ea5=function(_0x23fe2e){while(--_0x23fe2e){_0x4ff92d['push'](_0x4ff92d['shift']());}};_0x430ea5(++_0x452633);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x4ee964,_0x15b946){var _0x43827e=function(_0x2041d8){while(--_0x2041d8){_0x4ee964['push'](_0x4ee964['shift']());}};_0x43827e(++_0x15b946);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 86beb22..fb7aeff 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 _0x8e35=['../client','create','Request','createFaxMessage'];(function(_0x26df48,_0x22aa50){var _0x209047=function(_0x1d068b){while(--_0x1d068b){_0x26df48['push'](_0x26df48['shift']());}};_0x209047(++_0x22aa50);}(_0x8e35,0x18c));var _0x58e3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x8e35[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x58e3('0x0'));exports[_0x58e3('0x1')]=function(_0x1dc48e){return client[_0x58e3('0x2')]('CreateFaxMessage',{'body':_0x1dc48e,'log':_0x58e3('0x3')});}; \ No newline at end of file +var _0x6589=['../client','CreateFaxMessage'];(function(_0x36dc35,_0xc4ca23){var _0x4b2659=function(_0xf93f48){while(--_0xf93f48){_0x36dc35['push'](_0x36dc35['shift']());}};_0x4b2659(++_0xc4ca23);}(_0x6589,0x16c));var _0x9658=function(_0x5ae8f7,_0x330d91){_0x5ae8f7=_0x5ae8f7-0x0;var _0x54c636=_0x6589[_0x5ae8f7];return _0x54c636;};'use strict';var client=require(_0x9658('0x0'));exports['create']=function(_0x5f3243){return client['Request'](_0x9658('0x1'),{'body':_0x5f3243,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 4f6ab39..0a006f6 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 _0xb7f3=['Agents','name','faxPause','getFaxQueues','../client','Request','GetFaxQueue','timeout','strategy'];(function(_0x1d68ce,_0x2f4c57){var _0x535ff0=function(_0x452b33){while(--_0x452b33){_0x1d68ce['push'](_0x1d68ce['shift']());}};_0x535ff0(++_0x2f4c57);}(_0xb7f3,0xdc));var _0x3b7f=function(_0x1f1758,_0x787b50){_0x1f1758=_0x1f1758-0x0;var _0x960f10=_0xb7f3[_0x1f1758];return _0x960f10;};'use strict';var client=require(_0x3b7f('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x3b7f('0x1')](_0x3b7f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x3b7f('0x3'),_0x3b7f('0x4')],'include':[{'model':'User','as':_0x3b7f('0x5'),'attributes':['id',_0x3b7f('0x6'),'online',_0x3b7f('0x7')]}]},'log':_0x3b7f('0x8')});};}; \ No newline at end of file +var _0x620d=['User','online','faxPause','getFaxQueues','GetFaxQueue','name','timeout','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x620d,0x1c3));var _0xd620=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x620d[_0x2d7f0e];return _0x110b07;};'use strict';var client=require('../client');exports[_0xd620('0x0')]=function(){return function(){return client['Request'](_0xd620('0x1'),{'options':{'raw':![],'attributes':['id',_0xd620('0x2'),_0xd620('0x3'),_0xd620('0x4')],'include':[{'model':_0xd620('0x5'),'as':'Agents','attributes':['id',_0xd620('0x2'),_0xd620('0x6'),_0xd620('0x7')]}]},'log':_0xd620('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 4db97ed..d9822f5 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 _0x400a=['UpdateFaxQueueReport','create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x1d02d0,_0x59840f){var _0x15a16c=function(_0x1a30e2){while(--_0x1a30e2){_0x1d02d0['push'](_0x1d02d0['shift']());}};_0x15a16c(++_0x59840f);}(_0x400a,0xaf));var _0xa400=function(_0x25f341,_0x2847ab){_0x25f341=_0x25f341-0x0;var _0x219b50=_0x400a[_0x25f341];return _0x219b50;};'use strict';var client=require('../client');exports[_0xa400('0x0')]=function(_0x41c17f){return client[_0xa400('0x1')](_0xa400('0x2'),{'body':_0x41c17f,'log':_0xa400('0x2')});};exports[_0xa400('0x3')]=function(_0x51f61c,_0x1361ec){return client[_0xa400('0x1')]('UpdateFaxQueueReport',{'body':_0x1361ec,'options':{'where':{'uniqueid':_0x51f61c},'order':[['id',_0xa400('0x4')]],'limit':0x1},'log':_0xa400('0x5')});}; \ No newline at end of file +var _0x8898=['Request','../client','create','update'];(function(_0x5ce766,_0x495d80){var _0x4a68f3=function(_0x39aa58){while(--_0x39aa58){_0x5ce766['push'](_0x5ce766['shift']());}};_0x4a68f3(++_0x495d80);}(_0x8898,0x6d));var _0x8889=function(_0x319611,_0x35e4b2){_0x319611=_0x319611-0x0;var _0x290734=_0x8898[_0x319611];return _0x290734;};'use strict';var client=require(_0x8889('0x0'));exports[_0x8889('0x1')]=function(_0xa2071a){return client['Request']('CreateFaxQueueReport',{'body':_0xa2071a,'log':'CreateFaxQueueReport'});};exports[_0x8889('0x2')]=function(_0x55b4fd,_0x312b42){return client[_0x8889('0x3')]('UpdateFaxQueueReport',{'body':_0x312b42,'options':{'where':{'uniqueid':_0x55b4fd},'order':[['id','DESC']],'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 144733f..77130c2 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 _0xe3b5=['GetInterval','name','Interval','Intervals','interval','getIntervals'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xe3b5,0x1d3));var _0x5e3b=function(_0xf1e59f,_0x15bb1e){_0xf1e59f=_0xf1e59f-0x0;var _0x15dcd5=_0xe3b5[_0xf1e59f];return _0x15dcd5;};'use strict';var client=require('../client');exports[_0x5e3b('0x0')]=function(){return function(){return client['Request'](_0x5e3b('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x5e3b('0x2')],'include':[{'model':_0x5e3b('0x3'),'as':_0x5e3b('0x4'),'attributes':['id',_0x5e3b('0x2'),_0x5e3b('0x5')]}]},'log':_0x5e3b('0x0')});};}; \ No newline at end of file +var _0xfa7e=['Interval','Intervals','interval','getIntervals','Request','GetInterval','name'];(function(_0x321ba5,_0x5b2d3a){var _0x4c3d68=function(_0xbfe274){while(--_0xbfe274){_0x321ba5['push'](_0x321ba5['shift']());}};_0x4c3d68(++_0x5b2d3a);}(_0xfa7e,0x12a));var _0xefa7=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xfa7e[_0x2c1dcd];return _0x158ce5;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0xefa7('0x0')](_0xefa7('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xefa7('0x2')],'include':[{'model':_0xefa7('0x3'),'as':_0xefa7('0x4'),'attributes':['id',_0xefa7('0x2'),_0xefa7('0x5')]}]},'log':_0xefa7('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f85e44b..f9cce61 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 _0x7880=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x7880,0x1f4));var _0x0788=function(_0x158147,_0x15c105){_0x158147=_0x158147-0x0;var _0x2a751b=_0x7880[_0x158147];return _0x2a751b;};'use strict';var client=require('../client');exports[_0x0788('0x0')]=function(_0x219c25,_0x841a33){return client[_0x0788('0x1')](_0x0788('0x2'),{'body':_0x841a33,'options':{'where':{'id':_0x219c25}},'log':_0x0788('0x3')});};exports['addTags']=function(_0x3925a6,_0x1e0814){return client[_0x0788('0x1')](_0x0788('0x4'),{'body':_0x1e0814,'options':{'where':{'id':_0x3925a6}},'log':_0x0788('0x5')});}; \ No newline at end of file +var _0x93e9=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x4a4812,_0x5871b2){var _0x398037=function(_0x5f893e){while(--_0x5f893e){_0x4a4812['push'](_0x4a4812['shift']());}};_0x398037(++_0x5871b2);}(_0x93e9,0xcc));var _0x993e=function(_0x4ee140,_0xddce08){_0x4ee140=_0x4ee140-0x0;var _0x1c14bd=_0x93e9[_0x4ee140];return _0x1c14bd;};'use strict';var client=require(_0x993e('0x0'));exports[_0x993e('0x1')]=function(_0x444623,_0x4405ca){return client[_0x993e('0x2')](_0x993e('0x3'),{'body':_0x4405ca,'options':{'where':{'id':_0x444623}},'log':_0x993e('0x4')});};exports['addTags']=function(_0x55f739,_0x1b762e){return client[_0x993e('0x2')](_0x993e('0x5'),{'body':_0x1b762e,'options':{'where':{'id':_0x55f739}},'log':_0x993e('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index fb100b5..6080da8 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 _0x9c75=['CreateMailMessage','createMailMessage','../client','Request'];(function(_0x11d95b,_0x3058ed){var _0x50ca77=function(_0x4f95bb){while(--_0x4f95bb){_0x11d95b['push'](_0x11d95b['shift']());}};_0x50ca77(++_0x3058ed);}(_0x9c75,0x172));var _0x59c7=function(_0x1f007e,_0x4ed32b){_0x1f007e=_0x1f007e-0x0;var _0x54f186=_0x9c75[_0x1f007e];return _0x54f186;};'use strict';var client=require(_0x59c7('0x0'));exports['create']=function(_0x4fdbfe){return client[_0x59c7('0x1')](_0x59c7('0x2'),{'body':_0x4fdbfe,'log':_0x59c7('0x3')});}; \ No newline at end of file +var _0xcce0=['createMailMessage','create','Request'];(function(_0xe0e9a4,_0x359e29){var _0x47e93c=function(_0x5835a7){while(--_0x5835a7){_0xe0e9a4['push'](_0xe0e9a4['shift']());}};_0x47e93c(++_0x359e29);}(_0xcce0,0x1ae));var _0x0cce=function(_0x3fb4b4,_0x202910){_0x3fb4b4=_0x3fb4b4-0x0;var _0x3acabb=_0xcce0[_0x3fb4b4];return _0x3acabb;};'use strict';var client=require('../client');exports[_0x0cce('0x0')]=function(_0x547335){return client[_0x0cce('0x1')]('CreateMailMessage',{'body':_0x547335,'log':_0x0cce('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f04180d..a983189 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 _0x7c76=['mailPause','../client','getMailQueues','Request','name','timeout','strategy','Agents','online'];(function(_0x196c73,_0x2ab9e2){var _0x2a3950=function(_0x2b0537){while(--_0x2b0537){_0x196c73['push'](_0x196c73['shift']());}};_0x2a3950(++_0x2ab9e2);}(_0x7c76,0xe2));var _0x67c7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7c76[_0x432682];return _0x463d05;};'use strict';var client=require(_0x67c7('0x0'));exports[_0x67c7('0x1')]=function(){return function(){return client[_0x67c7('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x67c7('0x3'),_0x67c7('0x4'),_0x67c7('0x5')],'include':[{'model':'User','as':_0x67c7('0x6'),'attributes':['id',_0x67c7('0x3'),_0x67c7('0x7'),_0x67c7('0x8')]}]},'log':_0x67c7('0x1')});};}; \ No newline at end of file +var _0xab33=['../client','getMailQueues','Request','GetMailQueue','name','strategy','User','Agents','online','mailPause'];(function(_0x483603,_0x1ada16){var _0x3ae351=function(_0x4c549e){while(--_0x4c549e){_0x483603['push'](_0x483603['shift']());}};_0x3ae351(++_0x1ada16);}(_0xab33,0xf0));var _0x3ab3=function(_0x11ef33,_0x1d0c94){_0x11ef33=_0x11ef33-0x0;var _0xff86fd=_0xab33[_0x11ef33];return _0xff86fd;};'use strict';var client=require(_0x3ab3('0x0'));exports[_0x3ab3('0x1')]=function(){return function(){return client[_0x3ab3('0x2')](_0x3ab3('0x3'),{'options':{'raw':![],'attributes':['id',_0x3ab3('0x4'),'timeout',_0x3ab3('0x5')],'include':[{'model':_0x3ab3('0x6'),'as':_0x3ab3('0x7'),'attributes':['id',_0x3ab3('0x4'),_0x3ab3('0x8'),_0x3ab3('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1613d69..7a2384e 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 _0x5fc1=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','Request'];(function(_0x2e273d,_0x12f7b9){var _0x20d041=function(_0x4d0c77){while(--_0x4d0c77){_0x2e273d['push'](_0x2e273d['shift']());}};_0x20d041(++_0x12f7b9);}(_0x5fc1,0x178));var _0x15fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5fc1[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x15fc('0x0'));exports['create']=function(_0x486eaf){return client[_0x15fc('0x1')](_0x15fc('0x2'),{'body':_0x486eaf,'log':_0x15fc('0x2')});};exports[_0x15fc('0x3')]=function(_0x5c4fbe,_0x30b610){return client[_0x15fc('0x1')](_0x15fc('0x4'),{'body':_0x30b610,'options':{'where':{'uniqueid':_0x5c4fbe},'order':[['id',_0x15fc('0x5')]],'limit':0x1},'log':_0x15fc('0x4')});}; \ No newline at end of file +var _0x094b=['UpdateMailQueueReport','DESC','../client','create','CreateMailQueueReport','update'];(function(_0x1c36b1,_0x251ea5){var _0x1aefd6=function(_0x1ea5e1){while(--_0x1ea5e1){_0x1c36b1['push'](_0x1c36b1['shift']());}};_0x1aefd6(++_0x251ea5);}(_0x094b,0x1ee));var _0xb094=function(_0x5bd022,_0x34ae02){_0x5bd022=_0x5bd022-0x0;var _0x207041=_0x094b[_0x5bd022];return _0x207041;};'use strict';var client=require(_0xb094('0x0'));exports[_0xb094('0x1')]=function(_0x1ad102){return client['Request']('CreateMailQueueReport',{'body':_0x1ad102,'log':_0xb094('0x2')});};exports[_0xb094('0x3')]=function(_0x25ddf1,_0x5400bf){return client['Request'](_0xb094('0x4'),{'body':_0x5400bf,'options':{'where':{'uniqueid':_0x25ddf1},'order':[['id',_0xb094('0x5')]],'limit':0x1},'log':_0xb094('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 2a43ef6..ee56dd9 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 _0x11c6=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x5e51d0,_0x4fc72b){var _0x14879c=function(_0x14f994){while(--_0x14f994){_0x5e51d0['push'](_0x5e51d0['shift']());}};_0x14879c(++_0x4fc72b);}(_0x11c6,0x1b6));var _0x611c=function(_0x447a56,_0x5f31e2){_0x447a56=_0x447a56-0x0;var _0x2c79f1=_0x11c6[_0x447a56];return _0x2c79f1;};'use strict';var client=require(_0x611c('0x0'));exports['update']=function(_0x39b1b0,_0x18249b){return client[_0x611c('0x1')](_0x611c('0x2'),{'body':_0x18249b,'options':{'where':{'id':_0x39b1b0}},'log':_0x611c('0x3')});};exports[_0x611c('0x4')]=function(_0x454118,_0x20c810){return client[_0x611c('0x1')](_0x611c('0x5'),{'body':_0x20c810,'options':{'where':{'id':_0x454118}},'log':_0x611c('0x6')});}; \ No newline at end of file +var _0x0028=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request','updateOpenchannelInteraction'];(function(_0x532a03,_0x1064a1){var _0x1d8711=function(_0x53324e){while(--_0x53324e){_0x532a03['push'](_0x532a03['shift']());}};_0x1d8711(++_0x1064a1);}(_0x0028,0xdc));var _0x8002=function(_0x142d3e,_0x353e86){_0x142d3e=_0x142d3e-0x0;var _0x493084=_0x0028[_0x142d3e];return _0x493084;};'use strict';var client=require(_0x8002('0x0'));exports[_0x8002('0x1')]=function(_0x10dc30,_0x2dea68){return client[_0x8002('0x2')]('UpdateOpenchannelInteraction',{'body':_0x2dea68,'options':{'where':{'id':_0x10dc30}},'log':_0x8002('0x3')});};exports[_0x8002('0x4')]=function(_0x2c0493,_0x18e3d1){return client[_0x8002('0x2')](_0x8002('0x5'),{'body':_0x18e3d1,'options':{'where':{'id':_0x2c0493}},'log':_0x8002('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b3223c7..daed39c 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 _0xe765=['createOpenchannelMessage','../client','Request','CreateOpenchannelMessage'];(function(_0x542da3,_0x12b686){var _0x31c3fd=function(_0x3f9a66){while(--_0x3f9a66){_0x542da3['push'](_0x542da3['shift']());}};_0x31c3fd(++_0x12b686);}(_0xe765,0x1c5));var _0x5e76=function(_0x3979b5,_0x232dc7){_0x3979b5=_0x3979b5-0x0;var _0x1a2a30=_0xe765[_0x3979b5];return _0x1a2a30;};'use strict';var client=require(_0x5e76('0x0'));exports['create']=function(_0x1dc84a){return client[_0x5e76('0x1')](_0x5e76('0x2'),{'body':_0x1dc84a,'log':_0x5e76('0x3')});}; \ No newline at end of file +var _0x8f9b=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x50521f,_0x4375b3){var _0x29b4be=function(_0x1cb06e){while(--_0x1cb06e){_0x50521f['push'](_0x50521f['shift']());}};_0x29b4be(++_0x4375b3);}(_0x8f9b,0x136));var _0xb8f9=function(_0x1d2323,_0x26a478){_0x1d2323=_0x1d2323-0x0;var _0x570644=_0x8f9b[_0x1d2323];return _0x570644;};'use strict';var client=require(_0xb8f9('0x0'));exports[_0xb8f9('0x1')]=function(_0x37160a){return client[_0xb8f9('0x2')](_0xb8f9('0x3'),{'body':_0x37160a,'log':_0xb8f9('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 321e922..c2ec663 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 _0x487f=['getOpenchannelQueues','GetOpenchannelQueue','timeout','strategy','name','online','openchannelPause'];(function(_0x289f9c,_0x4fb5c9){var _0x54e021=function(_0x49472f){while(--_0x49472f){_0x289f9c['push'](_0x289f9c['shift']());}};_0x54e021(++_0x4fb5c9);}(_0x487f,0x165));var _0xf487=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x487f[_0x8de54f];return _0x14cba4;};'use strict';var client=require('../client');exports[_0xf487('0x0')]=function(){return function(){return client['Request'](_0xf487('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xf487('0x2'),_0xf487('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xf487('0x4'),_0xf487('0x5'),_0xf487('0x6')]}]},'log':_0xf487('0x0')});};}; \ No newline at end of file +var _0xa920=['timeout','User','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue','name'];(function(_0x566a46,_0x1c9d7a){var _0x1483d9=function(_0x37a16a){while(--_0x37a16a){_0x566a46['push'](_0x566a46['shift']());}};_0x1483d9(++_0x1c9d7a);}(_0xa920,0x7c));var _0x0a92=function(_0x3f936b,_0x4832f){_0x3f936b=_0x3f936b-0x0;var _0x5303f9=_0xa920[_0x3f936b];return _0x5303f9;};'use strict';var client=require('../client');exports[_0x0a92('0x0')]=function(){return function(){return client[_0x0a92('0x1')](_0x0a92('0x2'),{'options':{'raw':![],'attributes':['id',_0x0a92('0x3'),_0x0a92('0x4'),'strategy'],'include':[{'model':_0x0a92('0x5'),'as':'Agents','attributes':['id',_0x0a92('0x3'),_0x0a92('0x6'),_0x0a92('0x7')]}]},'log':_0x0a92('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 377e91a..95418c0 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 _0xa207=['create','Request','UpdateOpenchannelQueueReport'];(function(_0x48602b,_0x5a0592){var _0x11e4f0=function(_0x1a3946){while(--_0x1a3946){_0x48602b['push'](_0x48602b['shift']());}};_0x11e4f0(++_0x5a0592);}(_0xa207,0x69));var _0x7a20=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xa207[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require('../client');exports[_0x7a20('0x0')]=function(_0x20551a){return client[_0x7a20('0x1')]('CreateOpenchannelQueueReport',{'body':_0x20551a,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x22f4cc,_0x5663e7){return client[_0x7a20('0x1')](_0x7a20('0x2'),{'body':_0x5663e7,'options':{'where':{'uniqueid':_0x22f4cc},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x90db=['create','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x128443,_0x2fe025){var _0x1a4ce1=function(_0x12d72c){while(--_0x12d72c){_0x128443['push'](_0x128443['shift']());}};_0x1a4ce1(++_0x2fe025);}(_0x90db,0x1c0));var _0xb90d=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x90db[_0x220dbb];return _0x2b77de;};'use strict';var client=require('../client');exports[_0xb90d('0x0')]=function(_0x289d0e){return client[_0xb90d('0x1')]('CreateOpenchannelQueueReport',{'body':_0x289d0e,'log':'CreateOpenchannelQueueReport'});};exports['update']=function(_0x50a80e,_0x4aaef1){return client[_0xb90d('0x1')](_0xb90d('0x2'),{'body':_0x4aaef1,'options':{'where':{'uniqueid':_0x50a80e},'order':[['id',_0xb90d('0x3')]],'limit':0x1},'log':_0xb90d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 0bc67e5..1f96846 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 _0x59ce=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client'];(function(_0x4d967a,_0xc56013){var _0x362726=function(_0x39c753){while(--_0x39c753){_0x4d967a['push'](_0x4d967a['shift']());}};_0x362726(++_0xc56013);}(_0x59ce,0x92));var _0xe59c=function(_0x50743d,_0x34474a){_0x50743d=_0x50743d-0x0;var _0x2f4207=_0x59ce[_0x50743d];return _0x2f4207;};'use strict';var client=require(_0xe59c('0x0'));exports[_0xe59c('0x1')]=function(_0x1d28da,_0x4b05a0){return client[_0xe59c('0x2')](_0xe59c('0x3'),{'body':_0x4b05a0,'options':{'where':{'id':_0x1d28da}},'log':_0xe59c('0x4')});};exports[_0xe59c('0x5')]=function(_0x2ea56e,_0x42a856){return client[_0xe59c('0x2')]('AddTagsToSmsInteraction',{'body':_0x42a856,'options':{'where':{'id':_0x2ea56e}},'log':_0xe59c('0x6')});}; \ No newline at end of file +var _0x07c3=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x4ba9d7,_0x2ec6cc){var _0x45866e=function(_0x19036a){while(--_0x19036a){_0x4ba9d7['push'](_0x4ba9d7['shift']());}};_0x45866e(++_0x2ec6cc);}(_0x07c3,0x1bf));var _0x307c=function(_0x493cea,_0x144c6a){_0x493cea=_0x493cea-0x0;var _0x1c32ba=_0x07c3[_0x493cea];return _0x1c32ba;};'use strict';var client=require(_0x307c('0x0'));exports[_0x307c('0x1')]=function(_0x44b77c,_0xc54e42){return client[_0x307c('0x2')](_0x307c('0x3'),{'body':_0xc54e42,'options':{'where':{'id':_0x44b77c}},'log':_0x307c('0x4')});};exports[_0x307c('0x5')]=function(_0x52cf54,_0x37adf4){return client[_0x307c('0x2')](_0x307c('0x6'),{'body':_0x37adf4,'options':{'where':{'id':_0x52cf54}},'log':_0x307c('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 37fe491..e717139 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 _0xd600=['../client','create','Request','createSmsMessage'];(function(_0x322e63,_0x3e67e3){var _0x3b1da6=function(_0x257bf8){while(--_0x257bf8){_0x322e63['push'](_0x322e63['shift']());}};_0x3b1da6(++_0x3e67e3);}(_0xd600,0x154));var _0x0d60=function(_0xb151e9,_0x58ee0d){_0xb151e9=_0xb151e9-0x0;var _0x2fc8b9=_0xd600[_0xb151e9];return _0x2fc8b9;};'use strict';var client=require(_0x0d60('0x0'));exports[_0x0d60('0x1')]=function(_0x3a0740){return client[_0x0d60('0x2')]('CreateSmsMessage',{'body':_0x3a0740,'log':_0x0d60('0x3')});}; \ No newline at end of file +var _0x6c96=['createSmsMessage','../client'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x6c96,0xf1));var _0x66c9=function(_0x3b8884,_0x2b45bc){_0x3b8884=_0x3b8884-0x0;var _0x4ef77e=_0x6c96[_0x3b8884];return _0x4ef77e;};'use strict';var client=require(_0x66c9('0x0'));exports['create']=function(_0x291fae){return client['Request']('CreateSmsMessage',{'body':_0x291fae,'log':_0x66c9('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index b395a81..f43946e 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_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 +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x340781,_0x32b659){var _0x1a6ab9=function(_0x17823c){while(--_0x17823c){_0x340781['push'](_0x340781['shift']());}};_0x1a6ab9(++_0x32b659);}(_0x70e0,0x17b));var _0x070e=function(_0x2d6e7d,_0x2220e7){_0x2d6e7d=_0x2d6e7d-0x0;var _0x57e226=_0x70e0[_0x2d6e7d];return _0x57e226;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 0aa52a8..0dc5ff3 100644 --- a/server/services/routing/rpc/smsQueueReport.js +++ b/server/services/routing/rpc/smsQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x38037a,_0x196abc){var _0x1a1246=function(_0x4252b5){while(--_0x4252b5){_0x38037a['push'](_0x38037a['shift']());}};_0x1a1246(++_0x196abc);}(_0x70e0,0x17b));var _0x070e=function(_0x302a04,_0x579720){_0x302a04=_0x302a04-0x0;var _0xd84b5=_0x70e0[_0x302a04];return _0xd84b5;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x5c17cc,_0x17d1a2){var _0x187cf5=function(_0x558f51){while(--_0x558f51){_0x5c17cc['push'](_0x5c17cc['shift']());}};_0x187cf5(++_0x17d1a2);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 0084a39..451a4fe 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(_0x202bd9,_0x2e0442){var _0x754b2a=function(_0x4594a3){while(--_0x4594a3){_0x202bd9['push'](_0x202bd9['shift']());}};_0x754b2a(++_0x2e0442);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x2328ac,_0x6ee6fa){var _0x4de2a3=function(_0x5946e7){while(--_0x5946e7){_0x2328ac['push'](_0x2328ac['shift']());}};_0x4de2a3(++_0x6ee6fa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 3646275..dce77d3 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 _0x199c=['updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','Request','UpdateWhatsappInteraction'];(function(_0x1786fb,_0x76f76f){var _0x50d9c0=function(_0x1d3d3a){while(--_0x1d3d3a){_0x1786fb['push'](_0x1786fb['shift']());}};_0x50d9c0(++_0x76f76f);}(_0x199c,0x1d8));var _0xc199=function(_0x2d3f7a,_0x5c5230){_0x2d3f7a=_0x2d3f7a-0x0;var _0x1122fb=_0x199c[_0x2d3f7a];return _0x1122fb;};'use strict';var client=require('../client');exports['update']=function(_0x240cb4,_0x3fdf87){return client[_0xc199('0x0')](_0xc199('0x1'),{'body':_0x3fdf87,'options':{'where':{'id':_0x240cb4}},'log':_0xc199('0x2')});};exports[_0xc199('0x3')]=function(_0x3f06cc,_0x1eecc2){return client['Request'](_0xc199('0x4'),{'body':_0x1eecc2,'options':{'where':{'id':_0x3f06cc}},'log':_0xc199('0x5')});}; \ No newline at end of file +var _0x9f02=['addTags','addTagsToWhatsappInteraction','../client','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x53bcfa,_0x20eb6e){var _0x25e64e=function(_0x1d9515){while(--_0x1d9515){_0x53bcfa['push'](_0x53bcfa['shift']());}};_0x25e64e(++_0x20eb6e);}(_0x9f02,0x68));var _0x29f0=function(_0x47133f,_0x4e69e3){_0x47133f=_0x47133f-0x0;var _0x1982d4=_0x9f02[_0x47133f];return _0x1982d4;};'use strict';var client=require(_0x29f0('0x0'));exports['update']=function(_0x51f5c2,_0x4bb7b2){return client[_0x29f0('0x1')](_0x29f0('0x2'),{'body':_0x4bb7b2,'options':{'where':{'id':_0x51f5c2}},'log':_0x29f0('0x3')});};exports[_0x29f0('0x4')]=function(_0x1a49c1,_0x47e569){return client[_0x29f0('0x1')]('AddTagsToWhatsappInteraction',{'body':_0x47e569,'options':{'where':{'id':_0x1a49c1}},'log':_0x29f0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index ba12f24..0f1598c 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 _0x3001=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x2d33d5,_0x373405){var _0x2bb1ed=function(_0x4c1101){while(--_0x4c1101){_0x2d33d5['push'](_0x2d33d5['shift']());}};_0x2bb1ed(++_0x373405);}(_0x3001,0x68));var _0x1300=function(_0x179a11,_0x2ddd5f){_0x179a11=_0x179a11-0x0;var _0x54a39c=_0x3001[_0x179a11];return _0x54a39c;};'use strict';var client=require(_0x1300('0x0'));exports[_0x1300('0x1')]=function(_0x65e1bd){return client[_0x1300('0x2')](_0x1300('0x3'),{'body':_0x65e1bd,'log':_0x1300('0x4')});}; \ No newline at end of file +var _0x208f=['createWhatsappMessage','create','Request','CreateWhatsappMessage'];(function(_0x1b7ab6,_0x4323b0){var _0x3d1e62=function(_0x4874c9){while(--_0x4874c9){_0x1b7ab6['push'](_0x1b7ab6['shift']());}};_0x3d1e62(++_0x4323b0);}(_0x208f,0xa1));var _0xf208=function(_0x124be1,_0x3d5b4f){_0x124be1=_0x124be1-0x0;var _0x624ea5=_0x208f[_0x124be1];return _0x624ea5;};'use strict';var client=require('../client');exports[_0xf208('0x0')]=function(_0x2fc03c){return client[_0xf208('0x1')](_0xf208('0x2'),{'body':_0x2fc03c,'log':_0xf208('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 23d72b4..4a2486e 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 _0x144c=['online','getWhatsappQueues','GetWhatsappQueue','name','timeout','strategy','User'];(function(_0x25c448,_0x5ea511){var _0x4c6dd9=function(_0x4d2eeb){while(--_0x4d2eeb){_0x25c448['push'](_0x25c448['shift']());}};_0x4c6dd9(++_0x5ea511);}(_0x144c,0x166));var _0xc144=function(_0x3d905,_0x7b688d){_0x3d905=_0x3d905-0x0;var _0x3a990b=_0x144c[_0x3d905];return _0x3a990b;};'use strict';var client=require('../client');exports[_0xc144('0x0')]=function(){return function(){return client['Request'](_0xc144('0x1'),{'options':{'raw':![],'attributes':['id',_0xc144('0x2'),_0xc144('0x3'),_0xc144('0x4')],'include':[{'model':_0xc144('0x5'),'as':'Agents','attributes':['id',_0xc144('0x2'),_0xc144('0x6'),'whatsappPause']}]},'log':_0xc144('0x0')});};}; \ No newline at end of file +var _0x90ae=['getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','online','whatsappPause'];(function(_0x18b2a6,_0x9a66ec){var _0x78b233=function(_0x45fa24){while(--_0x45fa24){_0x18b2a6['push'](_0x18b2a6['shift']());}};_0x78b233(++_0x9a66ec);}(_0x90ae,0xbd));var _0xe90a=function(_0x2a0ab7,_0x14ea1d){_0x2a0ab7=_0x2a0ab7-0x0;var _0x2fb6f7=_0x90ae[_0x2a0ab7];return _0x2fb6f7;};'use strict';var client=require('../client');exports[_0xe90a('0x0')]=function(){return function(){return client[_0xe90a('0x1')](_0xe90a('0x2'),{'options':{'raw':![],'attributes':['id',_0xe90a('0x3'),_0xe90a('0x4'),_0xe90a('0x5')],'include':[{'model':_0xe90a('0x6'),'as':'Agents','attributes':['id','name',_0xe90a('0x7'),_0xe90a('0x8')]}]},'log':_0xe90a('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a04c4e8..8699e53 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 _0xd7b4=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client'];(function(_0xc84e3,_0xd631b){var _0x437a90=function(_0x584223){while(--_0x584223){_0xc84e3['push'](_0xc84e3['shift']());}};_0x437a90(++_0xd631b);}(_0xd7b4,0x1d3));var _0x4d7b=function(_0x1633e9,_0x50a939){_0x1633e9=_0x1633e9-0x0;var _0x549ace=_0xd7b4[_0x1633e9];return _0x549ace;};'use strict';var client=require(_0x4d7b('0x0'));exports[_0x4d7b('0x1')]=function(_0x5133af){return client[_0x4d7b('0x2')](_0x4d7b('0x3'),{'body':_0x5133af,'log':_0x4d7b('0x3')});};exports[_0x4d7b('0x4')]=function(_0x5c8acb,_0x950a34){return client['Request'](_0x4d7b('0x5'),{'body':_0x950a34,'options':{'where':{'uniqueid':_0x5c8acb},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0x63d4=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x63d4,0x1b5));var _0x463d=function(_0x23320c,_0x236158){_0x23320c=_0x23320c-0x0;var _0x1d8207=_0x63d4[_0x23320c];return _0x1d8207;};'use strict';var client=require(_0x463d('0x0'));exports[_0x463d('0x1')]=function(_0x14b44d){return client[_0x463d('0x2')](_0x463d('0x3'),{'body':_0x14b44d,'log':_0x463d('0x3')});};exports[_0x463d('0x4')]=function(_0x4d8959,_0x15c17a){return client[_0x463d('0x2')](_0x463d('0x5'),{'body':_0x15c17a,'options':{'where':{'uniqueid':_0x4d8959},'order':[['id',_0x463d('0x6')]],'limit':0x1},'log':_0x463d('0x5')});}; \ 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 a6da1ab..80ace4e 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 _0xca6b=['log','[%s][QUEUE]\x20%s','validate','lodash','util','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','message','stop','find','agents','name','timeout','createQueue','atimeout','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0x59a56e,_0xb9db7c){var _0x2e785d=function(_0x4b5e5e){while(--_0x4b5e5e){_0x59a56e['push'](_0x59a56e['shift']());}};_0x2e785d(++_0xb9db7c);}(_0xca6b,0x65));var _0xbca6=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xca6b[_0x2763f2];return _0x3ef471;};'use strict';var schema=require(_0xbca6('0x0'));var _=require(_0xbca6('0x1'));var util=require(_0xbca6('0x2'));var seqqueue=require('seq-queue');var logger=require('../../../../config/logger')(_0xbca6('0x3'));var strategy=require(_0xbca6('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0xbca6('0x5')},'timeout':{'type':'number','message':_0xbca6('0x6')}});function writeLog(_0x2a8cf6,_0x3208c8,_0xb2ac6c){return logger[_0xbca6('0x7')](util[_0xbca6('0x8')](_0xbca6('0x9'),_0x2a8cf6,_0x3208c8['name'],_0xb2ac6c));}function handleFindAgent(_0xa8f24d){return function(_0x4af306){return _0x4af306['name'][_0xbca6('0xa')]()===_0xa8f24d[_0xbca6('0xa')]();};}exports[_0xbca6('0xb')]=function(_0x34024e,_0x32b8c5,_0x4c2af3,_0x28a663){return function(_0x3259a8){try{var _0x285bfb={'name':_0x32b8c5[0x0],'timeout':_0x32b8c5[0x1]};var _0x2642f5=queue[_0xbca6('0x0')](_0x285bfb,{'typecast':!![]});if(_0x2642f5[_0xbca6('0xc')]){logger[_0xbca6('0xd')](_0xbca6('0xe'),_0x34024e,_['map'](_0x2642f5,_0xbca6('0xf'))['join'](',\x20'));_0x3259a8[_0xbca6('0x10')]();}else{var _0x353fd2=_[_0xbca6('0x11')](_0x4c2af3[_0xbca6('0x12')],handleFindAgent(_0x285bfb[_0xbca6('0x13')]));if(_0x353fd2){var _0x46c434=(_0x285bfb[_0xbca6('0x14')]||0xa)*0x3e8;var _0x5d40aa,_0x4e8ad3;var _0x5e0f45=seqqueue[_0xbca6('0x15')](_0x46c434);_0x5e0f45['id']=_0x34024e;_0x5e0f45[_0xbca6('0x16')]=_0x46c434;_0x5e0f45['channel']=_0x28a663['channel'];writeLog(_0x34024e,_0x353fd2,util['format'](_0xbca6('0x17'),_0x46c434));_0x4c2af3[_0xbca6('0x18')][_0x34024e]['on'](_0xbca6('0x19'),function(){logger['info'](_0xbca6('0x1a'),_0x34024e);clearTimeout(_0x4e8ad3);_0x4e8ad3=undefined;_0x5e0f45[_0xbca6('0x1b')]();if(_0x4c2af3['rules'][_0x34024e]){delete _0x4c2af3['rules'][_0x34024e];}_0x3259a8[_0xbca6('0x10')]();});_0x4c2af3[_0xbca6('0x18')][_0x34024e]['on']('complete',function(){if(_0x4c2af3[_0xbca6('0x18')][_0x34024e]){delete _0x4c2af3[_0xbca6('0x18')][_0x34024e];}});_0x4e8ad3=setTimeout(function(){logger[_0xbca6('0x7')](_0xbca6('0x1c'),_0x34024e);clearTimeout(_0x4e8ad3);_0x5e0f45[_0xbca6('0x1b')]();_0x3259a8[_0xbca6('0x1d')]();},_0x46c434);strategy['agent'](_0x5e0f45,_0x353fd2,_0x4c2af3,_0x28a663);}else{logger['error'](_0xbca6('0x1e'),_0x34024e,_0x285bfb['name']);_0x3259a8[_0xbca6('0x10')]();}}}catch(_0x3d422d){console[_0xbca6('0x1f')](_0x3d422d);logger[_0xbca6('0xd')](_0xbca6('0x20'),_0x34024e,_0x3d422d['stack']);_0x3259a8[_0xbca6('0x10')]();}};}; \ No newline at end of file +var _0x4438=['timeout','createQueue','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','error','[%s][AGENT]\x20%s','message','join','stop','find'];(function(_0x419dc6,_0x176a99){var _0x5b6c56=function(_0x535ea5){while(--_0x535ea5){_0x419dc6['push'](_0x419dc6['shift']());}};_0x5b6c56(++_0x176a99);}(_0x4438,0xc6));var _0x8443=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0x4438[_0x5b1c50];return _0x2d379b;};'use strict';var schema=require('validate');var _=require('lodash');var util=require('util');var seqqueue=require(_0x8443('0x0'));var logger=require(_0x8443('0x1'))(_0x8443('0x2'));var strategy=require(_0x8443('0x3'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x8443('0x4')},'timeout':{'type':_0x8443('0x5'),'message':_0x8443('0x6')}});function writeLog(_0x188942,_0x2b1d8b,_0x486480){return logger[_0x8443('0x7')](util[_0x8443('0x8')](_0x8443('0x9'),_0x188942,_0x2b1d8b[_0x8443('0xa')],_0x486480));}function handleFindAgent(_0x1ca642){return function(_0xe696df){return _0xe696df[_0x8443('0xa')][_0x8443('0xb')]()===_0x1ca642['toLowerCase']();};}exports['consequence']=function(_0x1ab65f,_0x24893f,_0x3733a2,_0x15da2e){return function(_0x53a848){try{var _0x2e69d4={'name':_0x24893f[0x0],'timeout':_0x24893f[0x1]};var _0x390a43=queue[_0x8443('0xc')](_0x2e69d4,{'typecast':!![]});if(_0x390a43['length']){logger[_0x8443('0xd')](_0x8443('0xe'),_0x1ab65f,_['map'](_0x390a43,_0x8443('0xf'))[_0x8443('0x10')](',\x20'));_0x53a848[_0x8443('0x11')]();}else{var _0x50c00f=_[_0x8443('0x12')](_0x3733a2['agents'],handleFindAgent(_0x2e69d4[_0x8443('0xa')]));if(_0x50c00f){var _0x1355dc=(_0x2e69d4[_0x8443('0x13')]||0xa)*0x3e8;var _0x165e42,_0x5b5491;var _0x221530=seqqueue[_0x8443('0x14')](_0x1355dc);_0x221530['id']=_0x1ab65f;_0x221530[_0x8443('0x15')]=_0x1355dc;_0x221530[_0x8443('0x16')]=_0x15da2e[_0x8443('0x16')];writeLog(_0x1ab65f,_0x50c00f,util[_0x8443('0x8')](_0x8443('0x17'),_0x1355dc));_0x3733a2[_0x8443('0x18')][_0x1ab65f]['on']('end',function(){logger[_0x8443('0x7')](_0x8443('0x19'),_0x1ab65f);clearTimeout(_0x5b5491);_0x5b5491=undefined;_0x221530[_0x8443('0x1a')]();if(_0x3733a2['rules'][_0x1ab65f]){delete _0x3733a2[_0x8443('0x18')][_0x1ab65f];}_0x53a848[_0x8443('0x11')]();});_0x3733a2[_0x8443('0x18')][_0x1ab65f]['on']('complete',function(){if(_0x3733a2[_0x8443('0x18')][_0x1ab65f]){delete _0x3733a2[_0x8443('0x18')][_0x1ab65f];}});_0x5b5491=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x1ab65f);clearTimeout(_0x5b5491);_0x221530[_0x8443('0x1a')]();_0x53a848['next']();},_0x1355dc);strategy[_0x8443('0x1b')](_0x221530,_0x50c00f,_0x3733a2,_0x15da2e);}else{logger[_0x8443('0xd')](_0x8443('0x1c'),_0x1ab65f,_0x2e69d4['name']);_0x53a848[_0x8443('0x11')]();}}}catch(_0x35fa4b){console['log'](_0x35fa4b);logger[_0x8443('0xd')](_0x8443('0x1d'),_0x1ab65f,_0x35fa4b[_0x8443('0x1e')]);_0x53a848['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 5578d35..c3432d0 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 _0x97f8=['$LATEST','message','toString','postText','next','amazonlex','providerName','providerResponse','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','whatsapp','phone','account','upperFirst','AccountId','InteractionId','getMustacheRender','Message','create','info','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97f8,0x1df));var _0x897f=function(_0x49208f,_0x22b46f){_0x49208f=_0x49208f-0x0;var _0x3d9d1c=_0x97f8[_0x49208f];return _0x3d9d1c;};'use strict';var _=require(_0x897f('0x0'));var moment=require(_0x897f('0x1'));var AWS=require(_0x897f('0x2'));var utils=require(_0x897f('0x3'));var logger=require(_0x897f('0x4'))(_0x897f('0x5'));var rpc={'chatMessage':require(_0x897f('0x6')),'openchannelMessage':require(_0x897f('0x7')),'mailMessage':require(_0x897f('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x897f('0x9')),'whatsappMessage':require(_0x897f('0xa'))};exports['consequence']=function(_0x22e581,_0x185c9a){return function(_0x18905d){try{if(!_[_0x897f('0xb')](this[_0x897f('0xc')][_0x897f('0xd')])){logger['info'](_0x897f('0xe'),_0x22e581,_0x897f('0xf'));return _0x18905d['next']();}var _0x1dcb77={'ContactId':this[_0x897f('0x10')]['id'],'sentAt':moment()[_0x897f('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x897f('0x12')};if(this[_0x897f('0x13')]==='sms'||this[_0x897f('0x13')]===_0x897f('0x14')){_0x1dcb77[_0x897f('0x15')]=this[_0x897f('0xc')][_0x897f('0x15')];}var _0x31db3b=this[_0x897f('0x13')];if(_0x31db3b==='chat'){_0x1dcb77['ChatWebsiteId']=this[_0x897f('0x16')]['id'];}else{_0x1dcb77[_[_0x897f('0x17')](_0x31db3b)+_0x897f('0x18')]=this[_0x897f('0x16')]['id'];}_0x1dcb77[_['upperFirst'](_0x31db3b)+_0x897f('0x19')]=this[_0x897f('0xc')]['id'];if(this[_0x897f('0xc')]['created']){var _0xd69e78=_0x185c9a[0x4];if(!_['isEmpty'](_0xd69e78)){_0x1dcb77['body']=utils[_0x897f('0x1a')](_0xd69e78,this);return rpc[_0x31db3b+_0x897f('0x1b')][_0x897f('0x1c')](_0x1dcb77)['then'](function(_0x3ff337){logger[_0x897f('0x1d')](_0x897f('0xe'),_0x22e581,_0x1dcb77[_0x897f('0x1e')]);})[_0x897f('0x1f')](function(_0x3737ef){logger[_0x897f('0x20')](_0x897f('0xe'),_0x22e581,JSON[_0x897f('0x21')](_0x3737ef));})[_0x897f('0x22')](function(){logger[_0x897f('0x1d')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x22e581);_0x18905d['stop']();});}else{logger[_0x897f('0x1d')](_0x897f('0x23'),_0x22e581);_0x18905d[_0x897f('0x24')]();}}else{var _0x51fb2d=this;var _0x5039ed=new AWS[(_0x897f('0x25'))]({'accessKeyId':_0x185c9a[0x0],'secretAccessKey':_0x185c9a[0x1],'region':_0x185c9a[0x2]});var _0x3f65c1={'botAlias':_0x897f('0x26'),'botName':_0x185c9a[0x3],'inputText':this[_0x897f('0x27')]['body'],'userId':this['channel']+':'+this['interaction']['id'][_0x897f('0x28')]()};_0x5039ed[_0x897f('0x29')](_0x3f65c1,function(_0x4e7edc,_0x4356a9){if(_0x4e7edc){logger['error'](_0x897f('0xe'),_0x22e581,_0x4e7edc[_0x897f('0x27')]);_0x18905d[_0x897f('0x2a')]();}else if(_0x4356a9&&_0x4356a9['message']){_0x51fb2d[_0x897f('0x1e')][_0x897f('0x2b')]=_0x4356a9;_0x1dcb77['body']=_0x4356a9[_0x897f('0x27')];_0x1dcb77[_0x897f('0x2c')]='amazonlex';_0x1dcb77[_0x897f('0x2d')]=JSON[_0x897f('0x21')](_0x4356a9);return rpc[_0x31db3b+_0x897f('0x1b')][_0x897f('0x1c')](_0x1dcb77)['then'](function(_0x543701){logger[_0x897f('0x1d')](_0x897f('0xe'),_0x22e581,_0x1dcb77['body']);if(_0x4356a9[_0x897f('0x2e')]=='Failed'){_0x18905d[_0x897f('0x2a')]();}else{_0x18905d[_0x897f('0x24')]();}})[_0x897f('0x1f')](function(_0xf426ea){logger[_0x897f('0x20')]('[%s][AMAZONLEX]\x20%s',_0x22e581,JSON[_0x897f('0x21')](_0xf426ea));_0x18905d[_0x897f('0x2a')]();});}else{_0x18905d[_0x897f('0x2a')]();}});}}catch(_0x354dca){logger[_0x897f('0x20')](_0x897f('0xe'),_0x22e581,JSON['stringify'](_0x354dca));_0x18905d['stop']();}};}; \ No newline at end of file +var _0x48b4=['Message','create','then','catch','error','stringify','stop','LexRuntime','$LATEST','message','toString','postText','providerName','amazonlex','providerResponse','body','Failed','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','getMustacheRender'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x48b4,0xf2));var _0x448b=function(_0x36eef9,_0x5cf5c7){_0x36eef9=_0x36eef9-0x0;var _0xfd543f=_0x48b4[_0x36eef9];return _0xfd543f;};'use strict';var _=require('lodash');var moment=require(_0x448b('0x0'));var AWS=require('aws-sdk');var utils=require(_0x448b('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x448b('0x2')),'openchannelMessage':require(_0x448b('0x3')),'mailMessage':require(_0x448b('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x448b('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x448b('0x6')]=function(_0x456cf1,_0x33b8c4){return function(_0x2d12d9){try{if(!_['isNil'](this['interaction'][_0x448b('0x7')])){logger[_0x448b('0x8')](_0x448b('0x9'),_0x456cf1,_0x448b('0xa'));return _0x2d12d9[_0x448b('0xb')]();}var _0x14ed20={'ContactId':this[_0x448b('0xc')]['id'],'sentAt':moment()[_0x448b('0xd')](_0x448b('0xe')),'direction':'out'};if(this[_0x448b('0xf')]===_0x448b('0x10')||this[_0x448b('0xf')]===_0x448b('0x11')){_0x14ed20[_0x448b('0x12')]=this[_0x448b('0x13')]['phone'];}var _0x5cdfde=this['channel'];if(_0x5cdfde===_0x448b('0x14')){_0x14ed20[_0x448b('0x15')]=this['account']['id'];}else{_0x14ed20[_[_0x448b('0x16')](_0x5cdfde)+_0x448b('0x17')]=this[_0x448b('0x18')]['id'];}_0x14ed20[_[_0x448b('0x16')](_0x5cdfde)+_0x448b('0x19')]=this[_0x448b('0x13')]['id'];if(this[_0x448b('0x13')]['created']){var _0x58d5a9=_0x33b8c4[0x4];if(!_[_0x448b('0x1a')](_0x58d5a9)){_0x14ed20['body']=utils[_0x448b('0x1b')](_0x58d5a9,this);return rpc[_0x5cdfde+_0x448b('0x1c')][_0x448b('0x1d')](_0x14ed20)[_0x448b('0x1e')](function(_0x4c7e12){logger[_0x448b('0x8')](_0x448b('0x9'),_0x456cf1,_0x14ed20['body']);})[_0x448b('0x1f')](function(_0x11f5ae){logger[_0x448b('0x20')](_0x448b('0x9'),_0x456cf1,JSON[_0x448b('0x21')](_0x11f5ae));})['finally'](function(){logger[_0x448b('0x8')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x456cf1);_0x2d12d9[_0x448b('0x22')]();});}else{logger[_0x448b('0x8')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x456cf1);_0x2d12d9[_0x448b('0x22')]();}}else{var _0x279c01=this;var _0x3421cf=new AWS[(_0x448b('0x23'))]({'accessKeyId':_0x33b8c4[0x0],'secretAccessKey':_0x33b8c4[0x1],'region':_0x33b8c4[0x2]});var _0x66bced={'botAlias':_0x448b('0x24'),'botName':_0x33b8c4[0x3],'inputText':this[_0x448b('0x25')]['body'],'userId':this[_0x448b('0xf')]+':'+this[_0x448b('0x13')]['id'][_0x448b('0x26')]()};_0x3421cf[_0x448b('0x27')](_0x66bced,function(_0x1d3fbb,_0x2cb438){if(_0x1d3fbb){logger[_0x448b('0x20')](_0x448b('0x9'),_0x456cf1,_0x1d3fbb[_0x448b('0x25')]);_0x2d12d9[_0x448b('0xb')]();}else if(_0x2cb438&&_0x2cb438[_0x448b('0x25')]){_0x279c01['body']['amazonlex']=_0x2cb438;_0x14ed20['body']=_0x2cb438[_0x448b('0x25')];_0x14ed20[_0x448b('0x28')]=_0x448b('0x29');_0x14ed20[_0x448b('0x2a')]=JSON[_0x448b('0x21')](_0x2cb438);return rpc[_0x5cdfde+_0x448b('0x1c')][_0x448b('0x1d')](_0x14ed20)[_0x448b('0x1e')](function(_0x454a12){logger[_0x448b('0x8')]('[%s][AMAZONLEX]\x20%s',_0x456cf1,_0x14ed20[_0x448b('0x2b')]);if(_0x2cb438['dialogState']==_0x448b('0x2c')){_0x2d12d9[_0x448b('0xb')]();}else{_0x2d12d9[_0x448b('0x22')]();}})[_0x448b('0x1f')](function(_0x27e89b){logger['error'](_0x448b('0x9'),_0x456cf1,JSON[_0x448b('0x21')](_0x27e89b));_0x2d12d9[_0x448b('0xb')]();});}else{_0x2d12d9[_0x448b('0xb')]();}});}}catch(_0x729994){logger[_0x448b('0x20')](_0x448b('0x9'),_0x456cf1,JSON[_0x448b('0x21')](_0x729994));_0x2d12d9['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index b19edfa..cfde517 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 _0xb8de=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','channel','mail','body','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','account','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','html','','','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','update','create','Interaction','lodash','moment','./utils','../../../../config/logger'];(function(_0x12f384,_0x50043d){var _0xaff984=function(_0x3ff1d8){while(--_0x3ff1d8){_0x12f384['push'](_0x12f384['shift']());}};_0xaff984(++_0x50043d);}(_0xb8de,0x1b8));var _0xeb8d=function(_0x4b83a2,_0x42fcdf){_0x4b83a2=_0x4b83a2-0x0;var _0x5b7aa2=_0xb8de[_0x4b83a2];return _0x5b7aa2;};'use strict';var _=require(_0xeb8d('0x0'));var moment=require(_0xeb8d('0x1'));var utils=require(_0xeb8d('0x2'));var logger=require(_0xeb8d('0x3'))(_0xeb8d('0x4'));var rpc={'chatMessage':require(_0xeb8d('0x5')),'openchannelMessage':require(_0xeb8d('0x6')),'mailMessage':require(_0xeb8d('0x7')),'smsMessage':require(_0xeb8d('0x8')),'faxMessage':require(_0xeb8d('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xeb8d('0xa')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xeb8d('0xb')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xeb8d('0xc')),'whatsappInteraction':require(_0xeb8d('0xd'))};var mailRpc=require('../../mailRpc');exports[_0xeb8d('0xe')]=function(_0x3c1cc5,_0x50cdca,_0x281ff1,_0x4dceb3){return function(_0x3e12cb){try{var _0x3e7a3e=this[_0xeb8d('0xf')];if(_0x3e7a3e===_0xeb8d('0x10')&&_0x4dceb3[_0xeb8d('0x11')][_0xeb8d('0x12')]){logger[_0xeb8d('0x13')]('[%s][AUTOREPLY]\x20%s',_0x3c1cc5,_0xeb8d('0x14'));return _0x3e12cb[_0xeb8d('0x15')]();}if(_0x50cdca[0x0]==='1'&&(_['isNil'](this[_0xeb8d('0x16')][_0xeb8d('0x17')])||!this['interaction'][_0xeb8d('0x17')])){logger[_0xeb8d('0x13')](_0xeb8d('0x18'),_0x3c1cc5,_0xeb8d('0x19'));return _0x3e12cb[_0xeb8d('0x15')]();}if(_0x50cdca[0x0]==='2'&&this['interaction'][_0xeb8d('0x1a')]){logger['info'](_0xeb8d('0x1b'),_0x3c1cc5,'One\x20Time\x20already\x20sent');return _0x3e12cb[_0xeb8d('0x15')]();}var _0x3c0ec3={'ContactId':this['contact']['id'],'sentAt':moment()[_0xeb8d('0x1c')](_0xeb8d('0x1d')),'direction':_0xeb8d('0x1e')};if(this[_0xeb8d('0xf')]==='mail'){_0x3c0ec3[_0xeb8d('0x11')]=utils[_0xeb8d('0x1f')](_0x50cdca[0x2],this);}else{_0x3c0ec3[_0xeb8d('0x11')]=utils[_0xeb8d('0x1f')](_0x50cdca[0x1],this);}if(this[_0xeb8d('0x20')]){_0x3c0ec3['to']=this[_0xeb8d('0x20')][_0xeb8d('0x21')]||'';if(this[_0xeb8d('0xf')]==='mail'&&_0x50cdca[0x1]==='1'){_0x3c0ec3['cc']=this[_0xeb8d('0x20')]['cc']||'';}_0x3c0ec3[_0xeb8d('0x21')]=this[_0xeb8d('0x20')]['to']||'';_0x3c0ec3['phone']=this['message'][_0xeb8d('0x22')]||'';_0x3c0ec3['read']=!![];if(this[_0xeb8d('0x20')]['subject']){_0x3c0ec3[_0xeb8d('0x23')]='';_0x3c0ec3[_0xeb8d('0x23')]+=_[_0xeb8d('0x24')](this[_0xeb8d('0x20')]['subject'],_0xeb8d('0x25'))?'':_0xeb8d('0x26');_0x3c0ec3['subject']+=this['message'][_0xeb8d('0x23')];}}if(this[_0xeb8d('0xf')]===_0xeb8d('0x27')){_0x3c0ec3[_0xeb8d('0x28')]=this['account']['id'];}else{_0x3c0ec3[_[_0xeb8d('0x29')](this[_0xeb8d('0xf')])+'AccountId']=this[_0xeb8d('0x2a')]['id'];}_0x3c0ec3[_[_0xeb8d('0x29')](this[_0xeb8d('0xf')])+_0xeb8d('0x2b')]=this[_0xeb8d('0x16')]['id'];var _0x55b207=this[_0xeb8d('0x16')];if(rpc[this['channel']+_0xeb8d('0x2c')]){if(this[_0xeb8d('0xf')]===_0xeb8d('0x10')){var _0xbbe340={'tls':{'rejectUnauthorized':![]}};if(this[_0xeb8d('0x2a')][_0xeb8d('0x2d')][_0xeb8d('0x2e')]){_0xbbe340[_0xeb8d('0x2e')]=this[_0xeb8d('0x2a')][_0xeb8d('0x2d')]['service'];}else{_0xbbe340[_0xeb8d('0x2f')]=this[_0xeb8d('0x2a')][_0xeb8d('0x2d')][_0xeb8d('0x2f')];_0xbbe340[_0xeb8d('0x30')]=this[_0xeb8d('0x2a')]['Smtp'][_0xeb8d('0x30')];_0xbbe340[_0xeb8d('0x31')]=this[_0xeb8d('0x2a')][_0xeb8d('0x2d')][_0xeb8d('0x31')];}if(this[_0xeb8d('0x2a')][_0xeb8d('0x2d')]['authentication']){_0xbbe340[_0xeb8d('0x32')]={'user':this[_0xeb8d('0x2a')][_0xeb8d('0x2d')][_0xeb8d('0x33')],'pass':this[_0xeb8d('0x2a')][_0xeb8d('0x2d')][_0xeb8d('0x34')]};}_0x3c0ec3[_0xeb8d('0x35')]=this[_0xeb8d('0x20')]['messageId'];_0x3c0ec3[_0xeb8d('0x36')]=_0xeb8d('0x37')+_['replace'](_0x3c0ec3[_0xeb8d('0x11')],_0xeb8d('0x38'),_0xeb8d('0x39'))+_0xeb8d('0x3a');_0x3c0ec3['headers']={'Auto-Submitted':_0xeb8d('0x3b'),'X-Auto-Response-Suppress':_0xeb8d('0x3c'),'Precedence':_0xeb8d('0x3d')};return mailRpc[_0xeb8d('0x3e')](_0xbbe340,_0x3c0ec3)[_0xeb8d('0x3f')](function(_0x4ae271){logger['info'](_0xeb8d('0x40'),_0x3c1cc5);_0x3c0ec3['messageId']=_0x4ae271[_0xeb8d('0x20')][_0xeb8d('0x41')];return rpc[_0x3e7a3e+_0xeb8d('0x2c')]['create'](_0x3c0ec3);})['then'](function(_0x522dff){logger[_0xeb8d('0x13')](_0xeb8d('0x18'),_0x3c1cc5,JSON[_0xeb8d('0x42')](_0x522dff));})[_0xeb8d('0x43')](function(_0x23227f){logger[_0xeb8d('0x44')](_0xeb8d('0x45'),_0x3c1cc5,JSON[_0xeb8d('0x42')](_0x23227f));})['finally'](function(){Promise[_0xeb8d('0x46')]()['then'](function(){if(_0x50cdca[0x0]!=='2'||_0x55b207[_0xeb8d('0x1a')])return;return rpc[_0x3e7a3e+'Interaction'][_0xeb8d('0x47')](_0x55b207['id'],{'autoreplyExecuted':!![]})[_0xeb8d('0x3f')](function(_0xa355ec){logger[_0xeb8d('0x13')](_0xeb8d('0x1b'),_0x3c1cc5,JSON[_0xeb8d('0x42')](_0xa355ec));})[_0xeb8d('0x43')](function(_0x390e30){logger[_0xeb8d('0x44')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3c1cc5,JSON[_0xeb8d('0x42')](_0x390e30));});})[_0xeb8d('0x3f')](function(){_0x3e12cb[_0xeb8d('0x15')]();});});}else{return rpc[this['channel']+_0xeb8d('0x2c')][_0xeb8d('0x48')](_0x3c0ec3)[_0xeb8d('0x3f')](function(_0x356f11){logger[_0xeb8d('0x13')]('[%s][AUTOREPLY]\x20%s',_0x3c1cc5,_0x3c0ec3[_0xeb8d('0x11')]);})['catch'](function(_0x1ec562){logger[_0xeb8d('0x44')](_0xeb8d('0x18'),_0x3c1cc5,JSON[_0xeb8d('0x42')](_0x1ec562));})['finally'](function(){Promise[_0xeb8d('0x46')]()[_0xeb8d('0x3f')](function(){if(_0x50cdca[0x0]!=='2'||_0x55b207[_0xeb8d('0x1a')])return;return rpc[_0x3e7a3e+_0xeb8d('0x49')][_0xeb8d('0x47')](_0x55b207['id'],{'autoreplyExecuted':!![]})[_0xeb8d('0x3f')](function(_0x4f5108){logger[_0xeb8d('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3c1cc5,JSON[_0xeb8d('0x42')](_0x4f5108));})[_0xeb8d('0x43')](function(_0x4bccef){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3c1cc5,JSON[_0xeb8d('0x42')](_0x4bccef));});})['then'](function(){_0x3e12cb[_0xeb8d('0x15')]();});});}}}catch(_0x5caa34){logger[_0xeb8d('0x44')](_0xeb8d('0x18'),_0x3c1cc5,JSON['stringify'](_0x5caa34));_0x3e12cb['stop']();}};}; \ No newline at end of file +var _0x1ed2=['created','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','body','getMustacheRender','message','from','phone','subject','startsWith','Re:','chat','account','upperFirst','AccountId','InteractionId','Smtp','service','host','secure','user','pass','inReplyTo','messageId','html','','','auto-replied','All','auto_reply','sendMailMessage','then','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','stringify','finally','resolve','Interaction','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction'];(function(_0x3cfa8d,_0x4c50b2){var _0x48c43b=function(_0x1cbdcb){while(--_0x1cbdcb){_0x3cfa8d['push'](_0x3cfa8d['shift']());}};_0x48c43b(++_0x4c50b2);}(_0x1ed2,0x106));var _0x21ed=function(_0x7c645f,_0x4177ab){_0x7c645f=_0x7c645f-0x0;var _0x1ae9c0=_0x1ed2[_0x7c645f];return _0x1ae9c0;};'use strict';var _=require(_0x21ed('0x0'));var moment=require('moment');var utils=require(_0x21ed('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x21ed('0x2')),'mailMessage':require(_0x21ed('0x3')),'smsMessage':require(_0x21ed('0x4')),'faxMessage':require(_0x21ed('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x21ed('0x6')),'openchannelInteraction':require(_0x21ed('0x7')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0x21ed('0x8')),'faxInteraction':require(_0x21ed('0x9')),'whatsappInteraction':require(_0x21ed('0xa'))};var mailRpc=require(_0x21ed('0xb'));exports[_0x21ed('0xc')]=function(_0x2ff6f2,_0x39b9a8,_0x95a23f,_0x1e7ae6){return function(_0x5383aa){try{var _0x3e88d3=this[_0x21ed('0xd')];if(_0x3e88d3===_0x21ed('0xe')&&_0x1e7ae6['body'][_0x21ed('0xf')]){logger[_0x21ed('0x10')](_0x21ed('0x11'),_0x2ff6f2,_0x21ed('0x12'));return _0x5383aa[_0x21ed('0x13')]();}if(_0x39b9a8[0x0]==='1'&&(_[_0x21ed('0x14')](this[_0x21ed('0x15')][_0x21ed('0x16')])||!this[_0x21ed('0x15')]['created'])){logger[_0x21ed('0x10')](_0x21ed('0x11'),_0x2ff6f2,_0x21ed('0x17'));return _0x5383aa[_0x21ed('0x13')]();}if(_0x39b9a8[0x0]==='2'&&this['interaction'][_0x21ed('0x18')]){logger[_0x21ed('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x2ff6f2,_0x21ed('0x19'));return _0x5383aa[_0x21ed('0x13')]();}var _0x42eb2f={'ContactId':this[_0x21ed('0x1a')]['id'],'sentAt':moment()[_0x21ed('0x1b')](_0x21ed('0x1c')),'direction':'out'};if(this[_0x21ed('0xd')]===_0x21ed('0xe')){_0x42eb2f[_0x21ed('0x1d')]=utils['getMustacheRender'](_0x39b9a8[0x2],this);}else{_0x42eb2f[_0x21ed('0x1d')]=utils[_0x21ed('0x1e')](_0x39b9a8[0x1],this);}if(this[_0x21ed('0x1f')]){_0x42eb2f['to']=this['message'][_0x21ed('0x20')]||'';if(this[_0x21ed('0xd')]===_0x21ed('0xe')&&_0x39b9a8[0x1]==='1'){_0x42eb2f['cc']=this[_0x21ed('0x1f')]['cc']||'';}_0x42eb2f[_0x21ed('0x20')]=this['message']['to']||'';_0x42eb2f['phone']=this[_0x21ed('0x1f')][_0x21ed('0x21')]||'';_0x42eb2f['read']=!![];if(this[_0x21ed('0x1f')]['subject']){_0x42eb2f['subject']='';_0x42eb2f[_0x21ed('0x22')]+=_[_0x21ed('0x23')](this[_0x21ed('0x1f')][_0x21ed('0x22')],_0x21ed('0x24'))?'':'Re:\x20';_0x42eb2f[_0x21ed('0x22')]+=this[_0x21ed('0x1f')][_0x21ed('0x22')];}}if(this['channel']===_0x21ed('0x25')){_0x42eb2f['ChatWebsiteId']=this[_0x21ed('0x26')]['id'];}else{_0x42eb2f[_[_0x21ed('0x27')](this[_0x21ed('0xd')])+_0x21ed('0x28')]=this[_0x21ed('0x26')]['id'];}_0x42eb2f[_[_0x21ed('0x27')](this[_0x21ed('0xd')])+_0x21ed('0x29')]=this[_0x21ed('0x15')]['id'];var _0x176204=this['interaction'];if(rpc[this[_0x21ed('0xd')]+'Message']){if(this[_0x21ed('0xd')]===_0x21ed('0xe')){var _0x308138={'tls':{'rejectUnauthorized':![]}};if(this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2b')]){_0x308138['service']=this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2b')];}else{_0x308138[_0x21ed('0x2c')]=this['account'][_0x21ed('0x2a')]['host'];_0x308138['port']=this[_0x21ed('0x26')][_0x21ed('0x2a')]['port'];_0x308138[_0x21ed('0x2d')]=this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2d')];}if(this[_0x21ed('0x26')]['Smtp']['authentication']){_0x308138['auth']={'user':this['account'][_0x21ed('0x2a')][_0x21ed('0x2e')],'pass':this[_0x21ed('0x26')][_0x21ed('0x2a')][_0x21ed('0x2f')]};}_0x42eb2f[_0x21ed('0x30')]=this['message'][_0x21ed('0x31')];_0x42eb2f[_0x21ed('0x32')]=_0x21ed('0x33')+_['replace'](_0x42eb2f[_0x21ed('0x1d')],_0x21ed('0x34'),']+(>|$)/g,''),'priorityTrue':_0x174610[0x1],'priorityFalse':_0x174610[0x2]};var _0x2a2b7e=gotoif['validate'](_0x914e66,{'typecast':!![]});if(_0x2a2b7e['length']){logger['error'](_0x1ad4('0xb'),_0x547c5f,_[_0x1ad4('0xc')](_0x2a2b7e,'message')['join'](',\x20'));_0x59c5d2['stop']();}else{try{var _0xaed7a5=eval('('+_0x914e66[_0x1ad4('0xd')]+')');var _0x416708=_0xaed7a5?_0x914e66[_0x1ad4('0xe')]:_0x914e66[_0x1ad4('0xf')];logger[_0x1ad4('0x10')](_0x1ad4('0x11'),_0x547c5f,_0x914e66['condition'],_0xaed7a5,_0x416708||_0x1ad4('0x12'));if(_0x416708){var _0x552460=_[_0x1ad4('0x13')](_0x59c5d2['rules'](),{'p':_0x416708});if(_0x552460>=0x0){logger[_0x1ad4('0x10')](_0x1ad4('0x14'),_0x547c5f,_0x416708||'next',_0x552460);_0x59c5d2[_0x1ad4('0x12')](_0x552460);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x547c5f,_0x416708||_0x1ad4('0x12'));_0x59c5d2[_0x1ad4('0x15')]();}}else{_0x59c5d2[_0x1ad4('0x12')]();}}catch(_0x47df47){logger[_0x1ad4('0x16')](_0x1ad4('0x17'),_0x547c5f,_0x47df47[_0x1ad4('0x18')]);_0x59c5d2[_0x1ad4('0x15')]();}}}catch(_0x4339cc){logger[_0x1ad4('0x16')](_0x1ad4('0xb'),_0x547c5f,JSON[_0x1ad4('0x19')](_0x4339cc));_0x59c5d2['stop']();}};}; \ No newline at end of file +var _0xe563=['lodash','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','message','join','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','stringify','validate'];(function(_0xec7013,_0x1b3e63){var _0x205820=function(_0x21a4b7){while(--_0x21a4b7){_0xec7013['push'](_0xec7013['shift']());}};_0x205820(++_0x1b3e63);}(_0xe563,0xb5));var _0x3e56=function(_0x4611af,_0x19a973){_0x4611af=_0x4611af-0x0;var _0x5bf8d5=_0xe563[_0x4611af];return _0x5bf8d5;};'use strict';var schema=require(_0x3e56('0x0'));var _=require(_0x3e56('0x1'));var htmlToText=require('html-to-text');var utils=require(_0x3e56('0x2'));var logger=require(_0x3e56('0x3'))(_0x3e56('0x4'));var gotoif=schema({'condition':{'type':_0x3e56('0x5'),'required':!![],'message':_0x3e56('0x6')},'priorityTrue':{'type':_0x3e56('0x7'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x3e56('0x7'),'message':_0x3e56('0x8')}});exports[_0x3e56('0x9')]=function(_0x1dbdcf,_0x5c0a26){return function(_0xbf62a3){try{var _0x1a7df3={'condition':htmlToText[_0x3e56('0xa')](utils['getMustacheRender'](_0x5c0a26[0x0],this),{'wordwrap':![]})[_0x3e56('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5c0a26[0x1],'priorityFalse':_0x5c0a26[0x2]};var _0x1b5b6d=gotoif[_0x3e56('0x0')](_0x1a7df3,{'typecast':!![]});if(_0x1b5b6d[_0x3e56('0xc')]){logger[_0x3e56('0xd')](_0x3e56('0xe'),_0x1dbdcf,_['map'](_0x1b5b6d,_0x3e56('0xf'))[_0x3e56('0x10')](',\x20'));_0xbf62a3['stop']();}else{try{var _0x3b3b51=eval('('+_0x1a7df3[_0x3e56('0x11')]+')');var _0x194879=_0x3b3b51?_0x1a7df3['priorityTrue']:_0x1a7df3[_0x3e56('0x12')];logger[_0x3e56('0x13')](_0x3e56('0x14'),_0x1dbdcf,_0x1a7df3[_0x3e56('0x11')],_0x3b3b51,_0x194879||'next');if(_0x194879){var _0x873129=_['findIndex'](_0xbf62a3[_0x3e56('0x15')](),{'p':_0x194879});if(_0x873129>=0x0){logger[_0x3e56('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1dbdcf,_0x194879||_0x3e56('0x16'),_0x873129);_0xbf62a3[_0x3e56('0x16')](_0x873129);}else{logger['info'](_0x3e56('0x17'),_0x1dbdcf,_0x194879||_0x3e56('0x16'));_0xbf62a3[_0x3e56('0x18')]();}}else{_0xbf62a3[_0x3e56('0x16')]();}}catch(_0x1431e7){logger[_0x3e56('0xd')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x1dbdcf,_0x1431e7['message']);_0xbf62a3['stop']();}}}catch(_0x1d148d){logger[_0x3e56('0xd')]('[%s][GOTOIF]\x20%s',_0x1dbdcf,JSON[_0x3e56('0x19')](_0x1d148d));_0xbf62a3[_0x3e56('0x18')]();}};}; \ 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 550935a..61e8d3f 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 _0x7f7e=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','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','stringify','validate','lodash','../../../../config/logger','routing','number'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7f7e,0x14b));var _0xe7f7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7f7e[_0x122ef9];return _0x42fba0;};'use strict';var schema=require(_0xe7f7('0x0'));var _=require(_0xe7f7('0x1'));var logger=require(_0xe7f7('0x2'))(_0xe7f7('0x3'));var gotop=schema({'priority':{'type':_0xe7f7('0x4'),'required':!![],'message':_0xe7f7('0x5')}});exports[_0xe7f7('0x6')]=function(_0x26f9a7,_0x57d9c9){return function(_0x313012){try{var _0x3341b7={'priority':_0x57d9c9[0x0]};var _0x126223=gotop['validate'](_0x3341b7,{'typecast':!![]});if(_0x126223[_0xe7f7('0x7')]){logger[_0xe7f7('0x8')](_0xe7f7('0x9'),_0x26f9a7,_['map'](_0x126223,'message')[_0xe7f7('0xa')](',\x20'));_0x313012[_0xe7f7('0xb')]();}else{logger[_0xe7f7('0xc')](_0xe7f7('0xd'),_0x26f9a7,_0x3341b7[_0xe7f7('0xe')]);if(_0x3341b7[_0xe7f7('0xe')]){var _0x3e66e7=_[_0xe7f7('0xf')](_0x313012[_0xe7f7('0x10')](),{'p':_0x3341b7[_0xe7f7('0xe')]});if(_0x3e66e7>=0x0){logger['info'](_0xe7f7('0x11'),_0x26f9a7,_0x3341b7[_0xe7f7('0xe')]||_0xe7f7('0x12'),_0x3e66e7);_0x313012['next'](_0x3e66e7);}else{logger[_0xe7f7('0xc')](_0xe7f7('0x13'),_0x26f9a7,_0x3341b7[_0xe7f7('0xe')]||'next');_0x313012[_0xe7f7('0xb')]();}}else{_0x313012[_0xe7f7('0x12')]();}}}catch(_0x13ce6f){logger[_0xe7f7('0x8')]('[%s][GOTOP]\x20%s',_0x26f9a7,JSON[_0xe7f7('0x14')](_0x13ce6f));_0x313012['stop']();}};}; \ No newline at end of file +var _0xe76d=['join','[%s][GOTOP]\x20priority\x20%s','priority','rules','info','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOP]\x20%s','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','message'];(function(_0x1ac38c,_0x56e1da){var _0x2d48d2=function(_0x374a79){while(--_0x374a79){_0x1ac38c['push'](_0x1ac38c['shift']());}};_0x2d48d2(++_0x56e1da);}(_0xe76d,0x170));var _0xde76=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xe76d[_0x4c12ec];return _0x3ae42c;};'use strict';var schema=require(_0xde76('0x0'));var _=require(_0xde76('0x1'));var logger=require(_0xde76('0x2'))(_0xde76('0x3'));var gotop=schema({'priority':{'type':_0xde76('0x4'),'required':!![],'message':_0xde76('0x5')}});exports[_0xde76('0x6')]=function(_0xefcbd8,_0x31e27e){return function(_0x3612c3){try{var _0xb6b88b={'priority':_0x31e27e[0x0]};var _0x1481c7=gotop[_0xde76('0x0')](_0xb6b88b,{'typecast':!![]});if(_0x1481c7[_0xde76('0x7')]){logger[_0xde76('0x8')]('[%s][GOTOP]\x20%s',_0xefcbd8,_['map'](_0x1481c7,_0xde76('0x9'))[_0xde76('0xa')](',\x20'));_0x3612c3['stop']();}else{logger['info'](_0xde76('0xb'),_0xefcbd8,_0xb6b88b[_0xde76('0xc')]);if(_0xb6b88b[_0xde76('0xc')]){var _0x6ff740=_['findIndex'](_0x3612c3[_0xde76('0xd')](),{'p':_0xb6b88b[_0xde76('0xc')]});if(_0x6ff740>=0x0){logger[_0xde76('0xe')](_0xde76('0xf'),_0xefcbd8,_0xb6b88b[_0xde76('0xc')]||'next',_0x6ff740);_0x3612c3[_0xde76('0x10')](_0x6ff740);}else{logger[_0xde76('0xe')](_0xde76('0x11'),_0xefcbd8,_0xb6b88b['priority']||_0xde76('0x10'));_0x3612c3[_0xde76('0x12')]();}}else{_0x3612c3[_0xde76('0x10')]();}}}catch(_0x25b92d){logger[_0xde76('0x8')](_0xde76('0x13'),_0xefcbd8,JSON[_0xde76('0x14')](_0x25b92d));_0x3612c3['stop']();}};}; \ 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 50cff2f..323a826 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 _0x34b7=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','getMustacheRender','channel','chat','account','upperFirst','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','catch','error','stringify','stop','../../../../config/logger','routing'];(function(_0x2e45f6,_0x108701){var _0x3730ad=function(_0x4fa4bb){while(--_0x4fa4bb){_0x2e45f6['push'](_0x2e45f6['shift']());}};_0x3730ad(++_0x108701);}(_0x34b7,0x196));var _0x734b=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0x34b7[_0x5e848d];return _0x3785e5;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require(_0x734b('0x0'))(_0x734b('0x1'));var rpc={'chatMessage':require(_0x734b('0x2')),'openchannelMessage':require(_0x734b('0x3')),'mailMessage':require(_0x734b('0x4')),'smsMessage':require(_0x734b('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x734b('0x6')]=function(_0x2fde69,_0x2f3128){return function(_0x34fd70){try{var _0x28918a={'body':utils[_0x734b('0x7')](_0x2f3128[0x0],this),'ContactId':this['contact']['id']};if(this[_0x734b('0x8')]===_0x734b('0x9')){_0x28918a['ChatWebsiteId']=this['account']['id'];}else{_0x28918a[_['upperFirst'](this[_0x734b('0x8')])+'AccountId']=this[_0x734b('0xa')]['id'];}_0x28918a[_[_0x734b('0xb')](this[_0x734b('0x8')])+_0x734b('0xc')]=this[_0x734b('0xd')]['id'];if(rpc[this[_0x734b('0x8')]+_0x734b('0xe')]){return rpc[this[_0x734b('0x8')]+_0x734b('0xe')][_0x734b('0xf')](_0x28918a)[_0x734b('0x10')](function(_0xff9ddf){logger[_0x734b('0x11')](_0x734b('0x12'),_0x2fde69,_0x28918a['body']);_0x34fd70[_0x734b('0x13')]();})[_0x734b('0x14')](function(_0x47791c){logger[_0x734b('0x15')](_0x734b('0x12'),_0x2fde69,JSON[_0x734b('0x16')](_0x47791c));_0x34fd70[_0x734b('0x17')]();});}}catch(_0x2c03bd){logger[_0x734b('0x15')](_0x734b('0x12'),_0x2fde69,JSON[_0x734b('0x16')](_0x2c03bd));_0x34fd70['stop']();}};}; \ No newline at end of file +var _0xa8c7=['[%s][MESSAGE]\x20%s','body','next','error','stringify','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId','account','upperFirst','AccountId','interaction','Message','create','then','info'];(function(_0x1590ce,_0x127795){var _0x37ea1e=function(_0x511300){while(--_0x511300){_0x1590ce['push'](_0x1590ce['shift']());}};_0x37ea1e(++_0x127795);}(_0xa8c7,0x1a3));var _0x7a8c=function(_0x367bf8,_0x31a041){_0x367bf8=_0x367bf8-0x0;var _0x58f63e=_0xa8c7[_0x367bf8];return _0x58f63e;};'use strict';var _=require('lodash');var utils=require(_0x7a8c('0x0'));var logger=require('../../../../config/logger')(_0x7a8c('0x1'));var rpc={'chatMessage':require(_0x7a8c('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x7a8c('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x7a8c('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x7a8c('0x5')]=function(_0xf239ac,_0x661ee7){return function(_0x2296cd){try{var _0x1c80c9={'body':utils[_0x7a8c('0x6')](_0x661ee7[0x0],this),'ContactId':this[_0x7a8c('0x7')]['id']};if(this[_0x7a8c('0x8')]==='chat'){_0x1c80c9[_0x7a8c('0x9')]=this[_0x7a8c('0xa')]['id'];}else{_0x1c80c9[_[_0x7a8c('0xb')](this[_0x7a8c('0x8')])+_0x7a8c('0xc')]=this[_0x7a8c('0xa')]['id'];}_0x1c80c9[_[_0x7a8c('0xb')](this[_0x7a8c('0x8')])+'InteractionId']=this[_0x7a8c('0xd')]['id'];if(rpc[this[_0x7a8c('0x8')]+'Message']){return rpc[this[_0x7a8c('0x8')]+_0x7a8c('0xe')][_0x7a8c('0xf')](_0x1c80c9)[_0x7a8c('0x10')](function(_0x4cae79){logger[_0x7a8c('0x11')](_0x7a8c('0x12'),_0xf239ac,_0x1c80c9[_0x7a8c('0x13')]);_0x2296cd[_0x7a8c('0x14')]();})['catch'](function(_0x421d1a){logger[_0x7a8c('0x15')]('[%s][MESSAGE]\x20%s',_0xf239ac,JSON['stringify'](_0x421d1a));_0x2296cd['stop']();});}}catch(_0x290f6a){logger[_0x7a8c('0x15')](_0x7a8c('0x12'),_0xf239ac,JSON[_0x7a8c('0x16')](_0x290f6a));_0x2296cd['stop']();}};}; \ 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 6b25498..d596c3e 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 _0x214c=['stringify','stop','./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0x214c,0xbd));var _0xc214=function(_0x44508f,_0x3d2edc){_0x44508f=_0x44508f-0x0;var _0x3cc7b9=_0x214c[_0x44508f];return _0x3cc7b9;};'use strict';var utils=require(_0xc214('0x0'));var logger=require(_0xc214('0x1'))(_0xc214('0x2'));exports[_0xc214('0x3')]=function(_0x49eed2,_0x4199e6){return function(_0x50d3da){try{logger[_0xc214('0x4')](_0xc214('0x5'),_0x49eed2,utils[_0xc214('0x6')](_0x4199e6[0x0],this));_0x50d3da[_0xc214('0x7')]();}catch(_0x46a773){logger[_0xc214('0x8')](_0xc214('0x5'),_0x49eed2,JSON[_0xc214('0x9')](_0x46a773));_0x50d3da[_0xc214('0xa')]();}};}; \ No newline at end of file +var _0x2d2b=['consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','./utils','../../../../config/logger'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0x2d2b,0x1c9));var _0xb2d2=function(_0x1fced3,_0x2aa7cb){_0x1fced3=_0x1fced3-0x0;var _0xd009be=_0x2d2b[_0x1fced3];return _0xd009be;};'use strict';var utils=require(_0xb2d2('0x0'));var logger=require(_0xb2d2('0x1'))('routing');exports[_0xb2d2('0x2')]=function(_0x38ea01,_0xb58b27){return function(_0x1bd751){try{logger[_0xb2d2('0x3')](_0xb2d2('0x4'),_0x38ea01,utils[_0xb2d2('0x5')](_0xb58b27[0x0],this));_0x1bd751[_0xb2d2('0x6')]();}catch(_0x2f746a){logger[_0xb2d2('0x7')](_0xb2d2('0x4'),_0x38ea01,JSON[_0xb2d2('0x8')](_0x2f746a));_0x1bd751['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 2e00325..2dedcd7 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 _0x7ee4=['timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','map','join','stop','find','Queues','atimeout','qtimeout','end','rules','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','util','moment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','account','queue','from','joinAt','emit','clone','format','pick','%sQueuesWaitingInteractions','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x46a12b,_0xd4c43f){var _0x4f2fa1=function(_0xfa4a83){while(--_0xfa4a83){_0x46a12b['push'](_0x46a12b['shift']());}};_0x4f2fa1(++_0xd4c43f);}(_0x7ee4,0xac));var _0x47ee=function(_0x57e196,_0x428408){_0x57e196=_0x57e196-0x0;var _0x5941ab=_0x7ee4[_0x57e196];return _0x5941ab;};'use strict';var schema=require('validate');var _=require(_0x47ee('0x0'));var util=require(_0x47ee('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x47ee('0x2'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0x47ee('0x3'))(_0x47ee('0x4'));var strategy=require(_0x47ee('0x5'));config[_0x47ee('0x6')]=_[_0x47ee('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x47ee('0x8'))(new Redis(config[_0x47ee('0x6')]));var attributes=['id','queue_id',_0x47ee('0x9'),_0x47ee('0xa'),_0x47ee('0xb'),_0x47ee('0xc')];function emit(_0x141d5c,_0x45906a,_0x547b9d){io['to'](_0x141d5c)[_0x47ee('0xd')](_0x45906a,_0x547b9d);}function emitChannelQueueInteraction(_0x4cb1ee,_0x6ea246,_0x4bcd8a,_0x54507b,_0x56a4e6,_0x12b7ae,_0x44f012,_0x73cc6c){var _0x1b2f55=_[_0x47ee('0xe')](_0x4bcd8a);_0x1b2f55['queue_id']=_0x73cc6c;_0x1b2f55[_0x47ee('0xa')]=_0x6ea246;_0x1b2f55[_0x47ee('0x9')]=_0x54507b;_0x1b2f55['id']=_0x56a4e6;if(_0x12b7ae){_0x44f012[util[_0x47ee('0xf')]('%sQueuesWaitingInteractions',_0x4cb1ee)][_0x56a4e6]=_[_0x47ee('0x10')](_0x1b2f55,attributes);}else{delete _0x44f012[util['format'](_0x47ee('0x11'),_0x4cb1ee)][_0x56a4e6];}emit(util['format']('%s:queue:%s',_0x4cb1ee,_0x6ea246),util[_0x47ee('0xf')](_0x47ee('0x12'),_0x4cb1ee,_0x12b7ae?_0x47ee('0x13'):'remove'),_[_0x47ee('0x10')](_0x1b2f55,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x47ee('0x14')),'chatQueueReport':require(_0x47ee('0x15')),'smsQueueReport':require(_0x47ee('0x16')),'faxQueueReport':require(_0x47ee('0x17')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x47ee('0x18'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x47ee('0x19'),'message':_0x47ee('0x1a')}});function startRouting(_0x962a26,_0x3aa8cb,_0x4ad7dd,_0x444cff){if(_0x962a26&&_0x3aa8cb&&_0x4ad7dd){_0x3aa8cb[_0x47ee('0x1b')]+=0x1;var _0x254632={'uniqueid':_0x962a26,'from':_0x4ad7dd[_0x47ee('0x1c')]?_0x4ad7dd[_0x47ee('0x1c')][_0x47ee('0xb')]:'','joinAt':moment()[_0x47ee('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4ad7dd[_0x47ee('0x1d')]?_0x4ad7dd[_0x47ee('0x1d')]['id']:null,'ListId':_0x4ad7dd[_0x47ee('0x1e')]?_0x4ad7dd[_0x47ee('0x1e')]['id']:null};_0x254632[_[_0x47ee('0x1f')](_0x4ad7dd['channel'])+_0x47ee('0x20')]=_0x3aa8cb['id']||null;_0x254632[_[_0x47ee('0x1f')](_0x4ad7dd[_0x47ee('0x21')])+'InteractionId']=_0x4ad7dd[_0x47ee('0x22')]?_0x4ad7dd['interaction']['id']:null;_0x254632[_[_0x47ee('0x1f')](_0x4ad7dd[_0x47ee('0x21')])+_0x47ee('0x23')]=_0x4ad7dd[_0x47ee('0x24')]?_0x4ad7dd[_0x47ee('0x24')]['id']:null;_0x254632[_[_0x47ee('0x1f')](_0x4ad7dd[_0x47ee('0x21')])+(_0x4ad7dd[_0x47ee('0x21')]!==_0x47ee('0x25')?_0x47ee('0x26'):_0x47ee('0x27'))]=_0x4ad7dd[_0x47ee('0x9')]?_0x4ad7dd[_0x47ee('0x9')]['id']:null;logger[_0x47ee('0x28')](util[_0x47ee('0xf')](_0x47ee('0x29'),_0x962a26,_0x3aa8cb[_0x47ee('0x2a')]));emitChannelQueueInteraction(_0x4ad7dd[_0x47ee('0x21')],_0x3aa8cb[_0x47ee('0x2a')],_0x254632,_0x4ad7dd[_0x47ee('0x9')][_0x47ee('0x2a')],_0x4ad7dd[_0x47ee('0x24')]['id'],!![],_0x444cff,_0x3aa8cb['id']);if(rpc[_0x4ad7dd[_0x47ee('0x21')]+_0x47ee('0x2b')]){return rpc[_0x4ad7dd[_0x47ee('0x21')]+_0x47ee('0x2b')][_0x47ee('0x2c')](_0x254632)[_0x47ee('0x2d')](function(_0x5aec37){logger[_0x47ee('0x2e')](_0x47ee('0x2f'));});}}}function stopRouting(_0x115c0b,_0x2d4016,_0x425b7f,_0x12f9c4){if(_0x115c0b&&_0x2d4016){_0x2d4016[_0x47ee('0x1b')]-=0x1;var _0x417544={'leaveAt':moment()[_0x47ee('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x47ee('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x47ee('0x30')};logger['info'](util[_0x47ee('0xf')](_0x47ee('0x31'),_0x115c0b,_0x2d4016[_0x47ee('0x2a')]));emitChannelQueueInteraction(_0x425b7f[_0x47ee('0x21')],_0x2d4016['name'],_0x425b7f[_0x47ee('0x1c')],_0x425b7f['account'][_0x47ee('0x2a')],_0x425b7f[_0x47ee('0x24')]['id'],![],_0x12f9c4,_0x2d4016['id']);if(rpc[_0x425b7f[_0x47ee('0x21')]+'QueueReport']){return rpc[_0x425b7f[_0x47ee('0x21')]+_0x47ee('0x2b')][_0x47ee('0x32')](_0x115c0b,_0x417544)[_0x47ee('0x2d')](function(_0x8c4531){logger[_0x47ee('0x2e')](_0x47ee('0x33'));});}}}function endRouting(_0x5c6108,_0x4006ac,_0x5adb13,_0x35ebd1){if(_0x5c6108&&_0x4006ac){_0x4006ac[_0x47ee('0x1b')]-=0x1;var _0x46f055={'leaveAt':moment()[_0x47ee('0xf')](_0x47ee('0x34')),'exitAt':moment()[_0x47ee('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x47ee('0x35')};logger[_0x47ee('0x28')](util['format'](_0x47ee('0x36'),_0x5c6108,_0x4006ac[_0x47ee('0x2a')]));emitChannelQueueInteraction(_0x5adb13[_0x47ee('0x21')],_0x4006ac[_0x47ee('0x2a')],_0x5adb13['body'],_0x5adb13[_0x47ee('0x9')][_0x47ee('0x2a')],_0x5adb13[_0x47ee('0x24')]['id'],![],_0x35ebd1);if(rpc[_0x5adb13[_0x47ee('0x21')]+_0x47ee('0x2b')]){return rpc[_0x5adb13[_0x47ee('0x21')]+_0x47ee('0x2b')][_0x47ee('0x32')](_0x5c6108,_0x46f055)[_0x47ee('0x2d')](function(_0x194e3a){logger[_0x47ee('0x2e')](_0x47ee('0x33'));});}}}function handleFindQueue(_0x23bf57){return function(_0x1cc562){return _0x1cc562[_0x47ee('0x2a')]['toLowerCase']()===_0x23bf57[_0x47ee('0x37')]();};}exports[_0x47ee('0x38')]=function(_0x55fd79,_0x4a89bb,_0x17526a,_0x4ca492){return function(_0x3ac6dd){try{var _0x6993e={'name':_0x4a89bb[0x0],'timeout':_0x4a89bb[0x1]};var _0x279483=queue[_0x47ee('0x39')](_0x6993e,{'typecast':!![]});if(_0x279483[_0x47ee('0x3a')]){logger[_0x47ee('0x2e')]('[%s][QUEUE]\x20%s',_0x55fd79,_[_0x47ee('0x3b')](_0x279483,_0x47ee('0x24'))[_0x47ee('0x3c')](',\x20'));_0x3ac6dd[_0x47ee('0x3d')]();}else{var _0x2f0ca5=_[_0x47ee('0x3e')](_0x17526a[_0x4ca492[_0x47ee('0x21')]+_0x47ee('0x3f')],handleFindQueue(_0x6993e[_0x47ee('0x2a')]));if(_0x2f0ca5){startRouting(_0x55fd79,_0x2f0ca5,_0x4ca492,_0x17526a);var _0x20f7aa=(_0x2f0ca5[_0x47ee('0x35')]||0xa)*0x3e8;var _0x40425c=(_0x6993e[_0x47ee('0x35')]||0x14)*0x3e8;var _0x3fa3ff,_0x4610ee;if(_0x20f7aa>_0x40425c){_0x40425c=_0x20f7aa;}var _0x4e1bcc=seqqueue['createQueue'](_0x20f7aa);_0x4e1bcc['id']=_0x55fd79;_0x4e1bcc[_0x47ee('0x40')]=_0x20f7aa;_0x4e1bcc[_0x47ee('0x41')]=_0x40425c;_0x4e1bcc[_0x47ee('0x21')]=_0x4ca492[_0x47ee('0x21')];_0x17526a['rules'][_0x55fd79]['on'](_0x47ee('0x42'),function(){logger[_0x47ee('0x28')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x55fd79);stopRouting(_0x55fd79,_0x2f0ca5,_0x4ca492,_0x17526a);clearTimeout(_0x3fa3ff);_0x3fa3ff=undefined;_0x4e1bcc['close'](!![]);if(_0x17526a['rules'][_0x55fd79]){delete _0x17526a[_0x47ee('0x43')][_0x55fd79];}_0x3ac6dd['stop']();});_0x17526a[_0x47ee('0x43')][_0x55fd79]['on']('complete',function(){if(_0x17526a['rules'][_0x55fd79]){delete _0x17526a[_0x47ee('0x43')][_0x55fd79];}});_0x3fa3ff=setTimeout(function(){logger['info'](_0x47ee('0x44'),_0x55fd79);endRouting(_0x55fd79,_0x2f0ca5,_0x4ca492,_0x17526a);clearTimeout(_0x3fa3ff);_0x4e1bcc['close'](!![]);_0x3ac6dd[_0x47ee('0x45')]();},_0x40425c);switch(_0x2f0ca5['strategy']){case _0x47ee('0x46'):strategy[_0x47ee('0x46')](_0x4e1bcc,_0x2f0ca5,_0x17526a,_0x4ca492);break;default:strategy[_0x47ee('0x47')](_0x4e1bcc,_0x2f0ca5,_0x17526a,_0x4ca492);}}else{logger[_0x47ee('0x2e')](_0x47ee('0x48'),_0x55fd79,_0x6993e[_0x47ee('0x2a')]);_0x3ac6dd[_0x47ee('0x3d')]();}}}catch(_0xde4916){console['log'](_0xde4916);logger['error'](_0x47ee('0x49'),_0x55fd79,_0xde4916[_0x47ee('0x4a')]);_0x3ac6dd[_0x47ee('0x3d')]();}};}; \ No newline at end of file +var _0x43fd=['[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/logger','routing','./strategy','redis','defaults','queue_id','account','queue','from','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','InteractionId','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','rules','end'];(function(_0xb3a9a,_0x2cb55a){var _0x4efe6b=function(_0x3dfc6f){while(--_0x3dfc6f){_0xb3a9a['push'](_0xb3a9a['shift']());}};_0x4efe6b(++_0x2cb55a);}(_0x43fd,0x186));var _0xd43f=function(_0x4c886a,_0x52f1ae){_0x4c886a=_0x4c886a-0x0;var _0x486e20=_0x43fd[_0x4c886a];return _0x486e20;};'use strict';var schema=require(_0xd43f('0x0'));var _=require(_0xd43f('0x1'));var util=require(_0xd43f('0x2'));var seqqueue=require(_0xd43f('0x3'));var moment=require(_0xd43f('0x4'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xd43f('0x5'))(_0xd43f('0x6'));var strategy=require(_0xd43f('0x7'));config[_0xd43f('0x8')]=_[_0xd43f('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd43f('0x8')]));var attributes=['id',_0xd43f('0xa'),_0xd43f('0xb'),_0xd43f('0xc'),_0xd43f('0xd'),'joinAt'];function emit(_0x23c350,_0x49fa49,_0x1175b8){io['to'](_0x23c350)['emit'](_0x49fa49,_0x1175b8);}function emitChannelQueueInteraction(_0x4bcbd3,_0x5da5d0,_0x25a13a,_0x47cf7b,_0x5cacf3,_0x39d753,_0x44a556,_0x44beb3){var _0xd8bf5d=_[_0xd43f('0xe')](_0x25a13a);_0xd8bf5d[_0xd43f('0xa')]=_0x44beb3;_0xd8bf5d[_0xd43f('0xc')]=_0x5da5d0;_0xd8bf5d[_0xd43f('0xb')]=_0x47cf7b;_0xd8bf5d['id']=_0x5cacf3;if(_0x39d753){_0x44a556[util[_0xd43f('0xf')](_0xd43f('0x10'),_0x4bcbd3)][_0x5cacf3]=_[_0xd43f('0x11')](_0xd8bf5d,attributes);}else{delete _0x44a556[util[_0xd43f('0xf')](_0xd43f('0x10'),_0x4bcbd3)][_0x5cacf3];}emit(util['format'](_0xd43f('0x12'),_0x4bcbd3,_0x5da5d0),util[_0xd43f('0xf')](_0xd43f('0x13'),_0x4bcbd3,_0x39d753?_0xd43f('0x14'):_0xd43f('0x15')),_[_0xd43f('0x11')](_0xd8bf5d,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xd43f('0x16')),'chatQueueReport':require(_0xd43f('0x17')),'smsQueueReport':require(_0xd43f('0x18')),'faxQueueReport':require(_0xd43f('0x19')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':'string','required':!![],'message':_0xd43f('0x1a')},'timeout':{'type':_0xd43f('0x1b'),'message':_0xd43f('0x1c')}});function startRouting(_0x20237b,_0x205030,_0x3887ca,_0x246eb2){if(_0x20237b&&_0x205030&&_0x3887ca){_0x205030[_0xd43f('0x1d')]+=0x1;var _0x5577bd={'uniqueid':_0x20237b,'from':_0x3887ca[_0xd43f('0x1e')]?_0x3887ca[_0xd43f('0x1e')][_0xd43f('0xd')]:'','joinAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'ContactId':_0x3887ca['contact']?_0x3887ca[_0xd43f('0x20')]['id']:null,'ListId':_0x3887ca['list']?_0x3887ca[_0xd43f('0x21')]['id']:null};_0x5577bd[_['upperFirst'](_0x3887ca[_0xd43f('0x22')])+_0xd43f('0x23')]=_0x205030['id']||null;_0x5577bd[_[_0xd43f('0x24')](_0x3887ca[_0xd43f('0x22')])+_0xd43f('0x25')]=_0x3887ca['interaction']?_0x3887ca['interaction']['id']:null;_0x5577bd[_[_0xd43f('0x24')](_0x3887ca[_0xd43f('0x22')])+_0xd43f('0x26')]=_0x3887ca[_0xd43f('0x27')]?_0x3887ca[_0xd43f('0x27')]['id']:null;_0x5577bd[_['upperFirst'](_0x3887ca[_0xd43f('0x22')])+(_0x3887ca['channel']!==_0xd43f('0x28')?_0xd43f('0x29'):_0xd43f('0x2a'))]=_0x3887ca['account']?_0x3887ca['account']['id']:null;logger[_0xd43f('0x2b')](util[_0xd43f('0xf')](_0xd43f('0x2c'),_0x20237b,_0x205030[_0xd43f('0x2d')]));emitChannelQueueInteraction(_0x3887ca[_0xd43f('0x22')],_0x205030[_0xd43f('0x2d')],_0x5577bd,_0x3887ca[_0xd43f('0xb')]['name'],_0x3887ca['message']['id'],!![],_0x246eb2,_0x205030['id']);if(rpc[_0x3887ca[_0xd43f('0x22')]+_0xd43f('0x2e')]){return rpc[_0x3887ca[_0xd43f('0x22')]+'QueueReport'][_0xd43f('0x2f')](_0x5577bd)[_0xd43f('0x30')](function(_0x44b3cf){logger[_0xd43f('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x597374,_0x4df495,_0x528ea1,_0x471f6b){if(_0x597374&&_0x4df495){_0x4df495[_0xd43f('0x1d')]-=0x1;var _0x3e0106={'leaveAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'acceptAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'reason':_0xd43f('0x32')};logger[_0xd43f('0x2b')](util[_0xd43f('0xf')](_0xd43f('0x33'),_0x597374,_0x4df495[_0xd43f('0x2d')]));emitChannelQueueInteraction(_0x528ea1[_0xd43f('0x22')],_0x4df495['name'],_0x528ea1[_0xd43f('0x1e')],_0x528ea1[_0xd43f('0xb')][_0xd43f('0x2d')],_0x528ea1[_0xd43f('0x27')]['id'],![],_0x471f6b,_0x4df495['id']);if(rpc[_0x528ea1[_0xd43f('0x22')]+_0xd43f('0x2e')]){return rpc[_0x528ea1[_0xd43f('0x22')]+_0xd43f('0x2e')][_0xd43f('0x34')](_0x597374,_0x3e0106)[_0xd43f('0x30')](function(_0x280b1a){logger['error'](_0xd43f('0x35'));});}}}function endRouting(_0x2648f0,_0x52db47,_0x3e7fd4,_0x149bd0){if(_0x2648f0&&_0x52db47){_0x52db47[_0xd43f('0x1d')]-=0x1;var _0x42b267={'leaveAt':moment()[_0xd43f('0xf')](_0xd43f('0x1f')),'exitAt':moment()['format'](_0xd43f('0x1f')),'reason':_0xd43f('0x36')};logger[_0xd43f('0x2b')](util[_0xd43f('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x2648f0,_0x52db47[_0xd43f('0x2d')]));emitChannelQueueInteraction(_0x3e7fd4[_0xd43f('0x22')],_0x52db47[_0xd43f('0x2d')],_0x3e7fd4[_0xd43f('0x1e')],_0x3e7fd4[_0xd43f('0xb')]['name'],_0x3e7fd4[_0xd43f('0x27')]['id'],![],_0x149bd0);if(rpc[_0x3e7fd4[_0xd43f('0x22')]+_0xd43f('0x2e')]){return rpc[_0x3e7fd4[_0xd43f('0x22')]+_0xd43f('0x2e')][_0xd43f('0x34')](_0x2648f0,_0x42b267)['catch'](function(_0xb5771f){logger[_0xd43f('0x31')](_0xd43f('0x35'));});}}}function handleFindQueue(_0x56462b){return function(_0x2b5a44){return _0x2b5a44[_0xd43f('0x2d')][_0xd43f('0x37')]()===_0x56462b[_0xd43f('0x37')]();};}exports['consequence']=function(_0x1b3713,_0x1a81d1,_0x486d9d,_0x4c98aa){return function(_0x17cdf6){try{var _0x2f163a={'name':_0x1a81d1[0x0],'timeout':_0x1a81d1[0x1]};var _0x4c57d4=queue['validate'](_0x2f163a,{'typecast':!![]});if(_0x4c57d4[_0xd43f('0x38')]){logger[_0xd43f('0x31')](_0xd43f('0x39'),_0x1b3713,_[_0xd43f('0x3a')](_0x4c57d4,'message')[_0xd43f('0x3b')](',\x20'));_0x17cdf6['stop']();}else{var _0x19cd6a=_[_0xd43f('0x3c')](_0x486d9d[_0x4c98aa[_0xd43f('0x22')]+_0xd43f('0x3d')],handleFindQueue(_0x2f163a['name']));if(_0x19cd6a){startRouting(_0x1b3713,_0x19cd6a,_0x4c98aa,_0x486d9d);var _0x1eb13f=(_0x19cd6a[_0xd43f('0x36')]||0xa)*0x3e8;var _0x5adc40=(_0x2f163a[_0xd43f('0x36')]||0x14)*0x3e8;var _0x2cc3b2,_0x40217d;if(_0x1eb13f>_0x5adc40){_0x5adc40=_0x1eb13f;}var _0x23e73b=seqqueue[_0xd43f('0x3e')](_0x1eb13f);_0x23e73b['id']=_0x1b3713;_0x23e73b[_0xd43f('0x3f')]=_0x1eb13f;_0x23e73b['qtimeout']=_0x5adc40;_0x23e73b[_0xd43f('0x22')]=_0x4c98aa[_0xd43f('0x22')];_0x486d9d[_0xd43f('0x40')][_0x1b3713]['on'](_0xd43f('0x41'),function(){logger[_0xd43f('0x2b')](_0xd43f('0x42'),_0x1b3713);stopRouting(_0x1b3713,_0x19cd6a,_0x4c98aa,_0x486d9d);clearTimeout(_0x2cc3b2);_0x2cc3b2=undefined;_0x23e73b['close'](!![]);if(_0x486d9d[_0xd43f('0x40')][_0x1b3713]){delete _0x486d9d[_0xd43f('0x40')][_0x1b3713];}_0x17cdf6[_0xd43f('0x43')]();});_0x486d9d[_0xd43f('0x40')][_0x1b3713]['on'](_0xd43f('0x44'),function(){if(_0x486d9d[_0xd43f('0x40')][_0x1b3713]){delete _0x486d9d[_0xd43f('0x40')][_0x1b3713];}});_0x2cc3b2=setTimeout(function(){logger[_0xd43f('0x2b')](_0xd43f('0x45'),_0x1b3713);endRouting(_0x1b3713,_0x19cd6a,_0x4c98aa,_0x486d9d);clearTimeout(_0x2cc3b2);_0x23e73b['close'](!![]);_0x17cdf6[_0xd43f('0x46')]();},_0x5adc40);switch(_0x19cd6a[_0xd43f('0x47')]){case _0xd43f('0x48'):strategy[_0xd43f('0x48')](_0x23e73b,_0x19cd6a,_0x486d9d,_0x4c98aa);break;default:strategy[_0xd43f('0x49')](_0x23e73b,_0x19cd6a,_0x486d9d,_0x4c98aa);}}else{logger[_0xd43f('0x31')](_0xd43f('0x4a'),_0x1b3713,_0x2f163a[_0xd43f('0x2d')]);_0x17cdf6[_0xd43f('0x43')]();}}}catch(_0x197809){console['log'](_0x197809);logger[_0xd43f('0x31')](_0xd43f('0x39'),_0x1b3713,_0x197809[_0xd43f('0x4b')]);_0x17cdf6['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index abc70a6..838e055 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 _0xbdd9=['bind','handleTimeout','timeout','drained','handleDrained','prototype','info','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','push','handleRun'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xbdd9,0x11f));var _0x9bdd=function(_0x40ddc0,_0x41c082){_0x40ddc0=_0x40ddc0-0x0;var _0x1aebf1=_0xbdd9[_0x40ddc0];return _0x1aebf1;};'use strict';var _=require(_0x9bdd('0x0'));var uuid=require(_0x9bdd('0x1'));var util=require(_0x9bdd('0x2'));var logger=require(_0x9bdd('0x3'))('routing');var Agent=function(_0x3dcb07,_0x4789e4,_0x28d539,_0x198f17){this[_0x9bdd('0x4')]=uuid['v4']();this[_0x9bdd('0x5')]=_0x3dcb07;this[_0x9bdd('0x6')]=_0x4789e4;this[_0x9bdd('0x7')]=_0x28d539;this['routing']=_0x198f17;this[_0x9bdd('0x5')][_0x9bdd('0x8')](this[_0x9bdd('0x9')][_0x9bdd('0xa')](this),this[_0x9bdd('0xb')]['bind'](this));this['squeue']['on'](_0x9bdd('0xc'),this['handleTimeout'][_0x9bdd('0xa')](this));this[_0x9bdd('0x5')]['on'](_0x9bdd('0xd'),this[_0x9bdd('0xe')]['bind'](this));};Agent['prototype'][_0x9bdd('0x8')]=function(){this['squeue'][_0x9bdd('0x8')](this['handleRun'][_0x9bdd('0xa')](this),this[_0x9bdd('0xb')]['bind'](this));};Agent[_0x9bdd('0xf')][_0x9bdd('0xe')]=function(){this[_0x9bdd('0xb')](!![]);};Agent[_0x9bdd('0xf')][_0x9bdd('0x9')]=function(_0x31771a){logger[_0x9bdd('0x10')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x9bdd('0x5')]['id'],this[_0x9bdd('0x6')]['id']);if(_['isNil'](this['realtime'][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']])){logger[_0x9bdd('0x10')](_0x9bdd('0x12'),this[_0x9bdd('0x5')]['id'],this[_0x9bdd('0x6')]['id']);setTimeout(this[_0x9bdd('0x8')]['bind'](this),0x3e8);}else{if(this[_0x9bdd('0x13')][_0x9bdd('0x14')]||util[_0x9bdd('0x15')](this['squeue']['id'],this['realtime']['agents'][this[_0x9bdd('0x6')]['id']],this[_0x9bdd('0x5')][_0x9bdd('0x16')],![])){this[_0x9bdd('0x7')][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']]['busy']=!![];this[_0x9bdd('0x7')][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']][_0x9bdd('0x17')]=undefined;util['showNotification'](this[_0x9bdd('0x4')],this[_0x9bdd('0x5')]['id'],this['realtime'][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']],null,this[_0x9bdd('0x13')]);util[_0x9bdd('0x18')](this[_0x9bdd('0x5')]['id'],this[_0x9bdd('0x7')][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']],_0x9bdd('0x19')+(this[_0x9bdd('0x13')]['forcedOwnership']?_0x9bdd('0x1a'):''));}else{logger[_0x9bdd('0x10')](_0x9bdd('0x1b'),this[_0x9bdd('0x5')]['id'],this[_0x9bdd('0x6')]['id']);setTimeout(this[_0x9bdd('0x8')][_0x9bdd('0xa')](this),0x3e8);}}};Agent[_0x9bdd('0xf')][_0x9bdd('0xb')]=function(_0x569256){if(_[_0x9bdd('0x1c')](this[_0x9bdd('0x7')][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']])){return logger[_0x9bdd('0x10')](_0x9bdd('0x12'),this[_0x9bdd('0x5')]['id'],this[_0x9bdd('0x6')]['id']);}else{logger[_0x9bdd('0x10')](_0x9bdd('0x1d'),this['squeue']['id'],this['agent']['id']);util['hideNotification'](this[_0x9bdd('0x4')],this[_0x9bdd('0x5')]['id'],this[_0x9bdd('0x7')][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']],null,this['routing']);this[_0x9bdd('0x7')][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']]['busy']=![];this['realtime']['agents'][this[_0x9bdd('0x6')]['id']]['busyQueue']=undefined;util[_0x9bdd('0x18')](this['squeue']['id'],this['realtime'][_0x9bdd('0x11')][this[_0x9bdd('0x6')]['id']],_0x569256?_0x9bdd('0x1e'):_0x9bdd('0x1f'));}if(!_0x569256){setTimeout(this[_0x9bdd('0x8')][_0x9bdd('0xa')](this),0x3e8);}};function agent(_0x2defc6,_0x22b9b8,_0x317f2f,_0x27451c){return new Agent(_0x2defc6,_0x22b9b8,_0x317f2f,_0x27451c);}module[_0x9bdd('0x20')]=agent; \ No newline at end of file +var _0xdf75=['handleDrained','prototype','squeue','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','RINGING','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','uuid','../../../../../config/logger','routing','notificationId','agent','realtime','push','bind','handleTimeout','timeout','drained'];(function(_0x3f6631,_0x25ca40){var _0xa4fadb=function(_0x179a77){while(--_0x179a77){_0x3f6631['push'](_0x3f6631['shift']());}};_0xa4fadb(++_0x25ca40);}(_0xdf75,0x95));var _0x5df7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdf75[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var uuid=require(_0x5df7('0x0'));var util=require('./util');var logger=require(_0x5df7('0x1'))(_0x5df7('0x2'));var Agent=function(_0x564ce2,_0x2389dc,_0x2fb752,_0x19641c){this[_0x5df7('0x3')]=uuid['v4']();this['squeue']=_0x564ce2;this[_0x5df7('0x4')]=_0x2389dc;this[_0x5df7('0x5')]=_0x2fb752;this[_0x5df7('0x2')]=_0x19641c;this['squeue'][_0x5df7('0x6')](this['handleRun'][_0x5df7('0x7')](this),this[_0x5df7('0x8')][_0x5df7('0x7')](this));this['squeue']['on'](_0x5df7('0x9'),this[_0x5df7('0x8')][_0x5df7('0x7')](this));this['squeue']['on'](_0x5df7('0xa'),this[_0x5df7('0xb')]['bind'](this));};Agent[_0x5df7('0xc')][_0x5df7('0x6')]=function(){this[_0x5df7('0xd')]['push'](this[_0x5df7('0xe')][_0x5df7('0x7')](this),this[_0x5df7('0x8')]['bind'](this));};Agent[_0x5df7('0xc')][_0x5df7('0xb')]=function(){this[_0x5df7('0x8')](!![]);};Agent['prototype'][_0x5df7('0xe')]=function(_0x1053f9){logger[_0x5df7('0xf')](_0x5df7('0x10'),this['squeue']['id'],this[_0x5df7('0x4')]['id']);if(_[_0x5df7('0x11')](this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']])){logger[_0x5df7('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5df7('0xd')]['id'],this[_0x5df7('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x5df7('0x2')][_0x5df7('0x13')]||util[_0x5df7('0x14')](this['squeue']['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],this[_0x5df7('0xd')][_0x5df7('0x15')],![])){this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x16')]=!![];this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x17')]=undefined;util[_0x5df7('0x18')](this[_0x5df7('0x3')],this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],null,this[_0x5df7('0x2')]);util['writeLog'](this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],_0x5df7('0x19')+(this[_0x5df7('0x2')][_0x5df7('0x13')]?':FORCED':''));}else{logger[_0x5df7('0xf')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x5df7('0xd')]['id'],this[_0x5df7('0x4')]['id']);setTimeout(this[_0x5df7('0x6')]['bind'](this),0x3e8);}}};Agent['prototype'][_0x5df7('0x8')]=function(_0x3f00ff){if(_[_0x5df7('0x11')](this['realtime'][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']])){return logger[_0x5df7('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x5df7('0xd')]['id'],this[_0x5df7('0x4')]['id']);}else{logger[_0x5df7('0xf')](_0x5df7('0x1a'),this[_0x5df7('0xd')]['id'],this['agent']['id']);util[_0x5df7('0x1b')](this[_0x5df7('0x3')],this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']],null,this['routing']);this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x16')]=![];this[_0x5df7('0x5')][_0x5df7('0x12')][this[_0x5df7('0x4')]['id']][_0x5df7('0x17')]=undefined;util[_0x5df7('0x1c')](this[_0x5df7('0xd')]['id'],this[_0x5df7('0x5')]['agents'][this[_0x5df7('0x4')]['id']],_0x3f00ff?_0x5df7('0x1d'):_0x5df7('0x1e'));}if(!_0x3f00ff){setTimeout(this[_0x5df7('0x6')][_0x5df7('0x7')](this),0x3e8);}};function agent(_0x41e86f,_0x1c041e,_0x188838,_0x1684d2){return new Agent(_0x41e86f,_0x1c041e,_0x188838,_0x1684d2);}module[_0x5df7('0x1f')]=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 363414a..5856707 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 _0x96aa=['isNil','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','busyQueue','lodash','uuid','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','queue','Agents','length'];(function(_0x5d0ecb,_0x4d8543){var _0x4a5c24=function(_0x3e8296){while(--_0x3e8296){_0x5d0ecb['push'](_0x5d0ecb['shift']());}};_0x4a5c24(++_0x4d8543);}(_0x96aa,0x67));var _0xa96a=function(_0x8181ee,_0x1f0000){_0x8181ee=_0x8181ee-0x0;var _0x2c74ee=_0x96aa[_0x8181ee];return _0x2c74ee;};'use strict';var _=require(_0xa96a('0x0'));var uuid=require(_0xa96a('0x1'));var util=require('./util');var logger=require(_0xa96a('0x2'))(_0xa96a('0x3'));var Beepall=function(_0x227d50,_0x12bbb7,_0x10a117,_0x4911c8){this[_0xa96a('0x4')]=uuid['v4']();this[_0xa96a('0x5')]=_0x227d50;this['queue']=_0x12bbb7;this[_0xa96a('0x6')]=_0x10a117;this[_0xa96a('0x3')]=_0x4911c8;this[_0xa96a('0x5')][_0xa96a('0x7')](this[_0xa96a('0x8')][_0xa96a('0x9')](this),this[_0xa96a('0xa')][_0xa96a('0x9')](this));this[_0xa96a('0x5')]['on'](_0xa96a('0xb'),this[_0xa96a('0xa')]['bind'](this));this[_0xa96a('0x5')]['on']('drained',this[_0xa96a('0xc')][_0xa96a('0x9')](this));};Beepall['prototype'][_0xa96a('0x7')]=function(){this[_0xa96a('0x5')][_0xa96a('0x7')](this[_0xa96a('0x8')][_0xa96a('0x9')](this),this[_0xa96a('0xa')][_0xa96a('0x9')](this));};Beepall[_0xa96a('0xd')][_0xa96a('0xc')]=function(_0x1a4644){this[_0xa96a('0xa')](!![]);};Beepall[_0xa96a('0xd')]['handleRun']=function(_0x49327a){var _0x945af=!![];if(!_['isNil'](this[_0xa96a('0xe')])&&!_['isNil'](this[_0xa96a('0xe')][_0xa96a('0xf')])&&this[_0xa96a('0xe')][_0xa96a('0xf')][_0xa96a('0x10')]>0x0){for(var _0x16257d=0x0,_0x5013f8;_0x16257d0x0){for(var _0x13c79f=0x0,_0xee4d8;_0x13c79f0x0&&_0x599654[_0x1585ba+_0x7413('0x27')]>=_0x599654[_0x1585ba+_0x7413('0x28')]){writeLog(_0x138508,_0x599654,_0x1585ba[_0x7413('0x29')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x7413('0x2a')]=function(_0x896552,_0x79cab6,_0x4843fd,_0x19970c,_0x2e521f){return sendNotification(!![],_0x896552,_0x79cab6,_0x4843fd,_0x19970c,_0x2e521f);};exports['hideNotification']=function(_0x24dce7,_0x4ed662,_0x1d0bde,_0x23e682,_0xae2969){return sendNotification(![],_0x24dce7,_0x4ed662,_0x1d0bde,_0x23e682,_0xae2969);};exports[_0x7413('0x2b')]=writeLog; \ No newline at end of file +var _0xacf4=['body','queue','msg','getMustacheRender','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','localhost','emit','format','name','\x20interaction','account','notificationSound','notificationShake'];(function(_0xbf337c,_0x41b7de){var _0x2dc44a=function(_0x339df2){while(--_0x339df2){_0xbf337c['push'](_0xbf337c['shift']());}};_0x2dc44a(++_0x41b7de);}(_0xacf4,0xe7));var _0x4acf=function(_0x24374c,_0x3db2a5){_0x24374c=_0x24374c-0x0;var _0x294ed5=_0xacf4[_0x24374c];return _0x294ed5;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x4acf('0x0'));var Mustache=require(_0x4acf('0x1'));var Redis=require(_0x4acf('0x2'));var config=require(_0x4acf('0x3'));var logger=require(_0x4acf('0x4'))(_0x4acf('0x5'));config[_0x4acf('0x6')]=_['defaults'](config[_0x4acf('0x6')],{'host':_0x4acf('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4acf('0x6')]));function emit(_0x2ba08a,_0x649ad2,_0x45a5a4){io['to'](_0x2ba08a)[_0x4acf('0x8')](_0x649ad2,_0x45a5a4);}function sendNotification(_0x50f5f4,_0x55f61d,_0x41970b,_0x59f559,_0x425c8d,_0x2c2cb4){io['to'](util[_0x4acf('0x9')]('user:%s',_0x59f559[_0x4acf('0xa')]))[_0x4acf('0x8')]('user:save',_0x59f559);var _0x5f22d9=_0x2c2cb4||{};var _0x1fe474=_0x41970b['split']('.');var _0x5bca4e={'uniqueid':_0x55f61d,'channel':_0x1fe474[0x0],'id':_0x1fe474[0x1],'title':_0x1fe474[0x0]+_0x4acf('0xb'),'interactionId':_0x1fe474[0x2],'queue':_0x425c8d?_0x425c8d[_0x4acf('0xa')]:null,'sound':_0x5f22d9[_0x4acf('0xc')][_0x4acf('0xd')],'shake':_0x5f22d9[_0x4acf('0xc')][_0x4acf('0xe')]};try{if(!_0x5f22d9[_0x4acf('0xf')]){_0x5f22d9[_0x4acf('0xf')]={};}if(_0x425c8d){_0x5f22d9[_0x4acf('0xf')][_0x4acf('0x10')]=_0x425c8d;}else if(_0x5f22d9[_0x4acf('0xf')]['queue']){delete _0x5f22d9[_0x4acf('0xf')]['queue'];}_0x5bca4e[_0x4acf('0x11')]=utils[_0x4acf('0x12')](_0x5f22d9[_0x4acf('0xc')]['notificationTemplate'],_0x5f22d9);}catch(_0x5207e7){_0x5bca4e[_0x4acf('0x11')]=_0x4acf('0x13');logger[_0x4acf('0x14')](util['format'](_0x4acf('0x15'),_0x55f61d,_0x5207e7[_0x4acf('0x16')]));}io['to'](util[_0x4acf('0x9')](_0x4acf('0x17'),_0x59f559[_0x4acf('0xa')]))[_0x4acf('0x8')](util[_0x4acf('0x9')](_0x4acf('0x18'),_0x50f5f4?_0x4acf('0x19'):_0x4acf('0x1a')),_0x5bca4e);}function writeLog(_0x1a3118,_0x5f0284,_0x28d698){return logger[_0x4acf('0x1b')](util['format'](_0x4acf('0x1c'),_0x1a3118,_0x5f0284[_0x4acf('0xa')],_0x28d698));}exports['isAgentAvailable']=function(_0x3b26ac,_0x34d154,_0x433b7a,_0x454555){if(_0x34d154['busy']){writeLog(_0x3b26ac,_0x34d154,_0x4acf('0x1d'));return![];}if(!_0x34d154[_0x4acf('0x1e')]){writeLog(_0x3b26ac,_0x34d154,'OFFLINE');return![];}if(_0x34d154[_0x433b7a+_0x4acf('0x1f')]){writeLog(_0x3b26ac,_0x34d154,_0x4acf('0x20'));return![];}if(_0x454555&&_0x34d154['hasOwnProperty'](_0x433b7a+_0x4acf('0x21'))&&_0x34d154[_0x4acf('0x22')](_0x433b7a+_0x4acf('0x23'))){if(_0x34d154[_0x433b7a+_0x4acf('0x21')]>0x0&&_0x34d154[_0x433b7a+'CurrentCapacity']>=_0x34d154[_0x433b7a+'Capacity']){writeLog(_0x3b26ac,_0x34d154,_0x433b7a[_0x4acf('0x24')]()+_0x4acf('0x25'));return![];}}return!![];};exports[_0x4acf('0x26')]=function(_0x42c90c,_0x14086c,_0x1b4da6,_0xb83274,_0x7a1e79){return sendNotification(!![],_0x42c90c,_0x14086c,_0x1b4da6,_0xb83274,_0x7a1e79);};exports[_0x4acf('0x27')]=function(_0x2a3830,_0x57989e,_0x3521c2,_0x3f5614,_0xd027c7){return sendNotification(![],_0x2a3830,_0x57989e,_0x3521c2,_0x3f5614,_0xd027c7);};exports[_0x4acf('0x28')]=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 5b0dbc5..5809b55 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 _0x6c32=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','trim','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','info'];(function(_0x551565,_0x478ff7){var _0x3174bb=function(_0x264765){while(--_0x264765){_0x551565['push'](_0x551565['shift']());}};_0x3174bb(++_0x478ff7);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var schema=require(_0x26c3('0x0'));var sh=require(_0x26c3('0x1'));var _=require(_0x26c3('0x2'));var utils=require(_0x26c3('0x3'));var logger=require(_0x26c3('0x4'))(_0x26c3('0x5'));var system=schema({'command':{'type':_0x26c3('0x6'),'required':!![],'message':_0x26c3('0x7')}});exports[_0x26c3('0x8')]=function(_0x49d4a1,_0x2bd400){return function(_0x3f7065){try{var _0x15ac36={'command':_0x2bd400[0x0]};var _0x57d915=system[_0x26c3('0x0')](_0x15ac36,{'typecast':!![]});if(_0x57d915['length']){logger[_0x26c3('0x9')](_0x26c3('0xa'),_0x49d4a1,_[_0x26c3('0xb')](_0x57d915,_0x26c3('0xc'))[_0x26c3('0xd')](',\x20'));logger[_0x26c3('0xe')](_0x26c3('0xf'),_0x49d4a1);_0x3f7065[_0x26c3('0x10')]();}else{var _0x356992=this;var _0x316ea7=utils['getMustacheRender'](_0x2bd400[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x49d4a1,_0x316ea7);sh['exec'](_[_0x26c3('0x11')](_0x316ea7),function(_0x161c20,_0xc07662){logger[_0x26c3('0xe')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x49d4a1,_0x161c20);if(_0x161c20==0x0){var _0x4c7b94=_0xc07662[_0x26c3('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x26c3('0x13')](_0x2bd400[0x1])||_[_0x26c3('0x14')](_0x2bd400[0x1])){logger[_0x26c3('0xe')](_0x26c3('0x15'),_0x49d4a1);_0x356992['body'][_0x2bd400[0x1]]=_0x4c7b94;}else{logger['info'](_0x26c3('0x16'),_0x49d4a1,_0x2bd400[0x1],_0x4c7b94);_0x356992[_0x26c3('0x17')][_0x2bd400[0x1]]=_0x4c7b94;}}_0x3f7065['next']();});}}catch(_0x4ed7c1){logger[_0x26c3('0x9')]('[%s][SYSTEM]\x20%s',_0x49d4a1,_[_0x26c3('0x18')](_0x4ed7c1)?JSON['stringify'](_0x4ed7c1):_0x4ed7c1);logger['info'](_0x26c3('0xf'),_0x49d4a1);_0x3f7065['next']();}};}; \ No newline at end of file +var _0xc69c=['validate','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify'];(function(_0x1057cb,_0x7b8162){var _0x7fbf7e=function(_0x5fa6a3){while(--_0x5fa6a3){_0x1057cb['push'](_0x1057cb['shift']());}};_0x7fbf7e(++_0x7b8162);}(_0xc69c,0x1ee));var _0xcc69=function(_0x44d809,_0x1f76fb){_0x44d809=_0x44d809-0x0;var _0x5361b9=_0xc69c[_0x44d809];return _0x5361b9;};'use strict';var schema=require(_0xcc69('0x0'));var sh=require('shelljs');var _=require(_0xcc69('0x1'));var utils=require(_0xcc69('0x2'));var logger=require(_0xcc69('0x3'))(_0xcc69('0x4'));var system=schema({'command':{'type':_0xcc69('0x5'),'required':!![],'message':_0xcc69('0x6')}});exports[_0xcc69('0x7')]=function(_0xda03e9,_0x546674){return function(_0x2deaf){try{var _0x3182cc={'command':_0x546674[0x0]};var _0x56fde8=system[_0xcc69('0x0')](_0x3182cc,{'typecast':!![]});if(_0x56fde8[_0xcc69('0x8')]){logger[_0xcc69('0x9')](_0xcc69('0xa'),_0xda03e9,_[_0xcc69('0xb')](_0x56fde8,_0xcc69('0xc'))[_0xcc69('0xd')](',\x20'));logger[_0xcc69('0xe')](_0xcc69('0xf'),_0xda03e9);_0x2deaf[_0xcc69('0x10')]();}else{var _0x486112=this;var _0x330f8c=utils[_0xcc69('0x11')](_0x546674[0x0],this);logger[_0xcc69('0xe')](_0xcc69('0x12'),_0xda03e9,_0x330f8c);sh[_0xcc69('0x13')](_[_0xcc69('0x14')](_0x330f8c),function(_0x3abfc4,_0x1ab146){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0xda03e9,_0x3abfc4);if(_0x3abfc4==0x0){var _0x46287b=_0x1ab146['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xcc69('0x15')](_0x546674[0x1])||_[_0xcc69('0x16')](_0x546674[0x1])){logger[_0xcc69('0xe')]('[%s][SYSTEM]\x20no\x20variable',_0xda03e9);_0x486112[_0xcc69('0x17')][_0x546674[0x1]]=_0x46287b;}else{logger[_0xcc69('0xe')](_0xcc69('0x18'),_0xda03e9,_0x546674[0x1],_0x46287b);_0x486112[_0xcc69('0x17')][_0x546674[0x1]]=_0x46287b;}}_0x2deaf['next']();});}}catch(_0x2163fa){logger[_0xcc69('0x9')](_0xcc69('0xa'),_0xda03e9,_['isObject'](_0x2163fa)?JSON[_0xcc69('0x19')](_0x2163fa):_0x2163fa);logger[_0xcc69('0xe')](_0xcc69('0xf'),_0xda03e9);_0x2deaf[_0xcc69('0x10')]();}};}; \ 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 460131b..d25443c 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 _0xd299=['isObject','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','number','consequence','length','error','map','message','join','info','channel','Interaction','addTags','interaction','then','catch','[%s][TAG]\x20%s','finally','next'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xd299,0x147));var _0x9d29=function(_0x13e0fc,_0x34132a){_0x13e0fc=_0x13e0fc-0x0;var _0x51309e=_0xd299[_0x13e0fc];return _0x51309e;};'use strict';var schema=require(_0x9d29('0x0'));var _=require(_0x9d29('0x1'));var rpc={'chatInteraction':require(_0x9d29('0x2')),'openchannelInteraction':require(_0x9d29('0x3')),'smsInteraction':require(_0x9d29('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x9d29('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x9d29('0x6'))('routing');var tag=schema({'tag':{'type':_0x9d29('0x7'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x9d29('0x8')]=function(_0x10563a,_0x38497a,_0x40af51,_0x1f467a){return function(_0x3a8c64){try{var _0x11bb8e={'tag':_0x38497a[0x0]};var _0x3d76e7=tag[_0x9d29('0x0')](_0x11bb8e,{'typecast':!![]});if(_0x3d76e7[_0x9d29('0x9')]){logger[_0x9d29('0xa')]('[%s][TAG]\x20%s',_0x10563a,_[_0x9d29('0xb')](_0x3d76e7,_0x9d29('0xc'))[_0x9d29('0xd')](',\x20'));logger[_0x9d29('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x10563a);_0x3a8c64['next']();}else{var _0x492933={'ids':[_0x38497a[0x0]]};if(rpc[_0x1f467a[_0x9d29('0xf')]+_0x9d29('0x10')]){rpc[_0x1f467a['channel']+_0x9d29('0x10')][_0x9d29('0x11')](_0x1f467a[_0x9d29('0x12')]['id'],_0x492933)[_0x9d29('0x13')](function(_0xc25027){logger[_0x9d29('0xe')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x10563a,_0x38497a[0x1],_0x1f467a[_0x9d29('0xf')],_0x1f467a[_0x9d29('0x12')]['id']);})[_0x9d29('0x14')](function(_0x23ab99){logger['error'](_0x9d29('0x15'),_0x10563a,JSON['stringify'](_0x23ab99));logger[_0x9d29('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x10563a);})[_0x9d29('0x16')](function(){_0x3a8c64[_0x9d29('0x17')]();});}}}catch(_0x123f29){logger[_0x9d29('0xa')](_0x9d29('0x15'),_0x10563a,_[_0x9d29('0x18')](_0x123f29)?JSON[_0x9d29('0x19')](_0x123f29):_0x123f29);logger['info'](_0x9d29('0x1a'),_0x10563a);_0x3a8c64[_0x9d29('0x17')]();}};}; \ No newline at end of file +var _0x6d59=['isObject','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','interaction','then','catch','stringify'];(function(_0x4cd297,_0x3ea87d){var _0x3f71e1=function(_0x5b483c){while(--_0x5b483c){_0x4cd297['push'](_0x4cd297['shift']());}};_0x3f71e1(++_0x3ea87d);}(_0x6d59,0x91));var _0x96d5=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6d59[_0xfae23b];return _0x200640;};'use strict';var schema=require(_0x96d5('0x0'));var _=require(_0x96d5('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x96d5('0x2')),'smsInteraction':require(_0x96d5('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x96d5('0x4')),'whatsappInteraction':require(_0x96d5('0x5'))};var logger=require('../../../../config/logger')(_0x96d5('0x6'));var tag=schema({'tag':{'type':_0x96d5('0x7'),'required':!![],'message':_0x96d5('0x8')}});exports['consequence']=function(_0x253310,_0x5edcc5,_0x12de30,_0x5951f5){return function(_0x53bd5b){try{var _0xdda5d4={'tag':_0x5edcc5[0x0]};var _0x593de3=tag[_0x96d5('0x0')](_0xdda5d4,{'typecast':!![]});if(_0x593de3['length']){logger[_0x96d5('0x9')](_0x96d5('0xa'),_0x253310,_[_0x96d5('0xb')](_0x593de3,_0x96d5('0xc'))[_0x96d5('0xd')](',\x20'));logger[_0x96d5('0xe')](_0x96d5('0xf'),_0x253310);_0x53bd5b[_0x96d5('0x10')]();}else{var _0xaa22b6={'ids':[_0x5edcc5[0x0]]};if(rpc[_0x5951f5[_0x96d5('0x11')]+_0x96d5('0x12')]){rpc[_0x5951f5['channel']+'Interaction']['addTags'](_0x5951f5[_0x96d5('0x13')]['id'],_0xaa22b6)[_0x96d5('0x14')](function(_0x505fe6){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x253310,_0x5edcc5[0x1],_0x5951f5[_0x96d5('0x11')],_0x5951f5[_0x96d5('0x13')]['id']);})[_0x96d5('0x15')](function(_0x1a661b){logger[_0x96d5('0x9')](_0x96d5('0xa'),_0x253310,JSON[_0x96d5('0x16')](_0x1a661b));logger[_0x96d5('0xe')](_0x96d5('0xf'),_0x253310);})['finally'](function(){_0x53bd5b[_0x96d5('0x10')]();});}}}catch(_0x16fca0){logger[_0x96d5('0x9')]('[%s][TAG]\x20%s',_0x253310,_[_0x96d5('0x17')](_0x16fca0)?JSON[_0x96d5('0x16')](_0x16fca0):_0x16fca0);logger['info'](_0x96d5('0xf'),_0x253310);_0x53bd5b[_0x96d5('0x10')]();}};}; \ 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 e7e1bc5..f03dc26 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x59a991,_0x1e2172){var _0xe38faa=function(_0x130829){while(--_0x130829){_0x59a991['push'](_0x59a991['shift']());}};_0xe38faa(++_0x1e2172);}(_0xe706,0xa3));var _0x6e70=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0xe706[_0x1385dc];return _0x2f6469;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x23d59f,_0x3c3d73){var _0x4976ca=function(_0x1c3456){while(--_0x1c3456){_0x23d59f['push'](_0x23d59f['shift']());}};_0x4976ca(++_0x3c3d73);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index ea762f5..2188df2 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 _0x4fb6=['127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','app','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','TagId','%s:%s:%s','./interval','condition','intervals','info','Push\x20new\x20rule','on\x20interval','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','error','routing\x20is\x20empty','agents','agent','busy','busyQueue','QueueReport','update','catch','stack','message\x20is\x20empty','end','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http'];(function(_0x24606c,_0xe88e33){var _0x58de40=function(_0x448f3d){while(--_0x448f3d){_0x24606c['push'](_0x24606c['shift']());}};_0x58de40(++_0xe88e33);}(_0x4fb6,0x121));var _0x64fb=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0x4fb6[_0x257b0e];return _0x27ac2a;};'use strict';var _=require(_0x64fb('0x0'));var util=require(_0x64fb('0x1'));var path=require(_0x64fb('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x64fb('0x3'));var uuid=require(_0x64fb('0x4'));var config=require('../../../config/environment');var logger=require(_0x64fb('0x5'))(_0x64fb('0x6'));var rpc={'openchannelQueueReport':require(_0x64fb('0x7')),'mailQueueReport':require(_0x64fb('0x8')),'chatQueueReport':require(_0x64fb('0x9')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x64fb('0xa')),'whatsappQueueReport':require(_0x64fb('0xb'))};var RuleEngine=require(_0x64fb('0xc'));function getId(_0x114a5c,_0x512c66,_0x2862a3){return util[_0x64fb('0xd')](_0x64fb('0xe'),_0x114a5c,_0x512c66||0x0,_0x2862a3||0x0);}function getIntervals(_0x4a22ab,_0xb10f87){var _0x421231=[];if(!_[_0x64fb('0xf')](_0xb10f87[_0x64fb('0x10')])&&!_[_0x64fb('0xf')](_0x4a22ab[_0xb10f87[_0x64fb('0x10')]])&&!_[_0x64fb('0xf')](_0x4a22ab[_0xb10f87[_0x64fb('0x10')]]['Intervals'])){_0x421231=_[_0x64fb('0x11')](_0x4a22ab[_0xb10f87[_0x64fb('0x10')]][_0x64fb('0x12')],_0x64fb('0x13'));}else if(!_[_0x64fb('0xf')](_0xb10f87[_0x64fb('0x13')])){_0x421231=[_0xb10f87[_0x64fb('0x13')]];}return _0x421231;}exports[_0x64fb('0x14')]=function(_0x322df9){_0x322df9[_0x64fb('0x15')]={};return new BPromise(function(_0x2b209f,_0x403728){var _0x330fc3={'Start':function(_0x40550d){var _0x55dce5=this;return new Promise(function(_0x1052c1,_0x1bb38f){if(_0x40550d){try{var _0x21c905=[];var _0xf5eedd=getId(_0x40550d[_0x64fb('0x16')],_0x40550d['message']?_0x40550d[_0x64fb('0x17')]['id']:0x0,_0x40550d[_0x64fb('0x18')]?_0x40550d['interaction']['id']:0x0);if(_0x40550d['applications']&&_[_0x64fb('0x19')](_0x40550d['applications'])&&_0x40550d[_0x64fb('0x1a')][_0x64fb('0x1b')]){for(var _0x5dc182=0x0;_0x5dc182<_0x40550d['applications'][_0x64fb('0x1b')];_0x5dc182+=0x1){var _0x7921f8=_0x40550d[_0x64fb('0x1a')][_0x5dc182];if(fs[_0x64fb('0x1c')](path['join'](__dirname,_0x64fb('0x1a'),_0x7921f8['app']+'.js'))){var _0x4e89db=[];switch(_0x7921f8[_0x64fb('0x1d')][_0x64fb('0x1e')]()){case _0x64fb('0x1f'):var _0x5aa3b7=_0x7921f8[_0x64fb('0x20')][_0x64fb('0x21')](',');if(_0x40550d[_0x64fb('0x16')]===_0x64fb('0x22')){_0x4e89db[_0x64fb('0x23')](_0x5aa3b7[0x0]);_0x4e89db[_0x64fb('0x23')](_0x5aa3b7[0x1]);_0x4e89db[_0x64fb('0x23')](_0x5aa3b7[_0x64fb('0x24')](0x2,_0x5aa3b7[_0x64fb('0x1b')])[_0x64fb('0x25')](','));}else{_0x4e89db[_0x64fb('0x23')](_0x5aa3b7[0x0]);_0x4e89db[_0x64fb('0x23')](_0x5aa3b7[_0x64fb('0x24')](0x1,_0x5aa3b7[_0x64fb('0x1b')])[_0x64fb('0x25')](','));}break;case _0x64fb('0x26'):var _0x2fccd6=_0x7921f8[_0x64fb('0x20')][_0x64fb('0x21')](',');_0x4e89db[_0x64fb('0x23')](_0x2fccd6[0x0]);_0x4e89db[_0x64fb('0x23')](_0x2fccd6[0x1]);_0x4e89db[_0x64fb('0x23')](_0x2fccd6[_0x64fb('0x24')](0x2,_0x2fccd6[_0x64fb('0x1b')])[_0x64fb('0x25')](','));break;case _0x64fb('0x27'):var _0x5cd977=_0x7921f8[_0x64fb('0x20')][_0x64fb('0x21')](',');_0x4e89db[_0x64fb('0x23')](_0x5cd977[0x0]);_0x4e89db[_0x64fb('0x23')](_0x5cd977[0x1]);_0x4e89db[_0x64fb('0x23')](_0x5cd977[0x2]);_0x4e89db[_0x64fb('0x23')](_0x5cd977[0x3]);_0x4e89db[_0x64fb('0x23')](_0x5cd977[_0x64fb('0x24')](0x4,_0x5cd977[_0x64fb('0x1b')])[_0x64fb('0x25')](','));break;case _0x64fb('0x28'):var _0x2a2edc=_0x7921f8[_0x64fb('0x20')]['split'](',');_0x4e89db['push'](_0x2a2edc[0x0]);_0x4e89db['push'](_0x2a2edc[0x1]);_0x4e89db[_0x64fb('0x23')](_0x2a2edc[0x2]);_0x4e89db[_0x64fb('0x23')](_0x2a2edc[0x3]);_0x4e89db['push'](_0x2a2edc['slice'](0x4,_0x2a2edc[_0x64fb('0x1b')])[_0x64fb('0x25')](','));break;case _0x64fb('0x17'):_0x4e89db['push'](_0x7921f8[_0x64fb('0x20')]);break;case'tag':_0x4e89db['push'](_0x7921f8[_0x64fb('0x29')]);_0x4e89db[_0x64fb('0x23')](_0x7921f8[_0x64fb('0x20')]);break;default:_0x4e89db=_[_0x64fb('0xf')](_0x7921f8[_0x64fb('0x20')])?[]:_0x7921f8['appdata'][_0x64fb('0x21')](',');}var _0x5ef027={'id':util[_0x64fb('0xd')](_0x64fb('0x2a'),_0xf5eedd,_0x7921f8['id'],_0x7921f8[_0x64fb('0x1d')]),'condition':require(_0x64fb('0x2b'))[_0x64fb('0x2c')](_0xf5eedd,getIntervals(_0x322df9[_0x64fb('0x2d')],_0x7921f8),_0x322df9),'consequence':require('./applications/'+_0x7921f8[_0x64fb('0x1d')])['consequence'](_0xf5eedd,_0x4e89db,_0x322df9,_0x40550d),'p':_0x7921f8['priority']||0x0};logger[_0x64fb('0x2e')](_0x64fb('0x2f'),_0x5ef027['id'],_0x64fb('0x30'),getIntervals(_0x322df9[_0x64fb('0x2d')],_0x7921f8)['join']('\x20|\x20'));_0x21c905[_0x64fb('0x23')](_0x5ef027);}else{logger['error'](_0x64fb('0x31'),path['join'](__dirname,_0x64fb('0x1a'),_0x7921f8['app']+_0x64fb('0x32')));}}_0x322df9['rules'][_0xf5eedd]=new RuleEngine(_0x21c905);_0x322df9[_0x64fb('0x15')][_0xf5eedd][_0x64fb('0x33')](_0x40550d,function(_0x5d3b5f){logger['info'](_0x64fb('0x34'),JSON[_0x64fb('0x35')](_0x5d3b5f['matchPath']));if(_0x322df9[_0x64fb('0x15')][_0xf5eedd]){_0x322df9['rules'][_0xf5eedd][_0x64fb('0x36')](_0x64fb('0x37'));}});return _0x1052c1({'code':0xc8,'message':_0x40550d});}else{logger['info'](_0x64fb('0x38'));return _0x1052c1({'code':0xc8,'message':_0x40550d});}}catch(_0x231363){logger['error'](_0x231363['stack']);return _0x1bb38f(_0x55dce5[_0x64fb('0x39')](0x1f4,_0x231363));}}return _0x1bb38f(_0x64fb('0x3a'));});},'AcceptMessage':function(_0x57168b){var _0x36c8e2=this;return new Promise(function(_0x352734,_0x10b480){if(_0x57168b['agent']&&_0x57168b['agent']['id']){if(_0x322df9[_0x64fb('0x3b')][_0x57168b['agent']['id']]){_0x322df9[_0x64fb('0x3b')][_0x57168b[_0x64fb('0x3c')]['id']][_0x64fb('0x3d')]=![];_0x322df9[_0x64fb('0x3b')][_0x57168b[_0x64fb('0x3c')]['id']][_0x64fb('0x3e')]=undefined;}}if(_0x57168b[_0x64fb('0x17')]&&_0x57168b[_0x64fb('0x17')]['id']){try{var _0xe0e6df=getId(_0x57168b['channel'],_0x57168b[_0x64fb('0x17')]?_0x57168b[_0x64fb('0x17')]['id']:0x0,_0x57168b[_0x64fb('0x18')]?_0x57168b[_0x64fb('0x18')]['id']:0x0);if(_0x322df9[_0x64fb('0x15')][_0xe0e6df]){_0x322df9[_0x64fb('0x15')][_0xe0e6df][_0x64fb('0x36')]('end');if(rpc[_0x57168b[_0x64fb('0x16')]+_0x64fb('0x3f')]){rpc[_0x57168b[_0x64fb('0x16')]+_0x64fb('0x3f')][_0x64fb('0x40')](_0xe0e6df,{'UserId':_0x57168b[_0x64fb('0x17')]['UserId']})[_0x64fb('0x41')](function(_0xfb2cf1){logger[_0x64fb('0x39')]('error\x20update\x20queue\x20report');});}}return _0x352734({'code':0xc8,'message':_0x57168b});}catch(_0x35693e){logger[_0x64fb('0x39')](_0x35693e[_0x64fb('0x42')]);return _0x10b480(_0x36c8e2[_0x64fb('0x39')](0x1f4,_0x35693e));}}logger['error'](_0x64fb('0x43'));return _0x10b480(_0x36c8e2[_0x64fb('0x39')](0x1f4,_0x64fb('0x43')));});},'RejectMessage':function(_0x1215ca){var _0x456b35=this;return new Promise(function(_0x10b4e5,_0x13e5a1){if(_0x1215ca[_0x64fb('0x3c')]&&_0x1215ca[_0x64fb('0x3c')]['id']){try{if(_0x322df9[_0x64fb('0x3b')][_0x1215ca[_0x64fb('0x3c')]['id']]){_0x322df9[_0x64fb('0x3b')][_0x1215ca['agent']['id']][_0x64fb('0x3d')]=![];_0x322df9['agents'][_0x1215ca[_0x64fb('0x3c')]['id']][_0x64fb('0x3e')]=undefined;}return _0x10b4e5({'code':0xc8,'message':_0x1215ca});}catch(_0x2500fe){logger[_0x64fb('0x39')](_0x2500fe[_0x64fb('0x42')]);return _0x13e5a1(_0x456b35[_0x64fb('0x39')](0x1f4,_0x2500fe));}}logger[_0x64fb('0x39')]('message\x20is\x20empty');return _0x13e5a1(_0x456b35[_0x64fb('0x39')](0x1f4,_0x64fb('0x43')));});},'AbandonInteraction':function(_0x39fcb4){var _0x511f72=this;return new Promise(function(_0x7a0d02,_0x6fbc6f){if(_0x39fcb4['channel']&&_0x39fcb4[_0x64fb('0x18')]&&_0x39fcb4[_0x64fb('0x18')]['id']){try{var _0x5cf957=getId(_0x39fcb4[_0x64fb('0x16')],_0x39fcb4[_0x64fb('0x17')]?_0x39fcb4[_0x64fb('0x17')]['id']:0x0,_0x39fcb4[_0x64fb('0x18')]?_0x39fcb4[_0x64fb('0x18')]['id']:0x0);if(_0x322df9[_0x64fb('0x15')][_0x5cf957]){_0x322df9[_0x64fb('0x15')][_0x5cf957][_0x64fb('0x36')](_0x64fb('0x44'));}return _0x7a0d02({'code':0xc8,'message':_0x39fcb4});}catch(_0x708bc4){logger[_0x64fb('0x39')](_0x708bc4[_0x64fb('0x42')]);return _0x6fbc6f(_0x511f72[_0x64fb('0x39')](0x1f4,_0x708bc4));}}logger[_0x64fb('0x39')](_0x64fb('0x43'));return _0x6fbc6f(_0x511f72[_0x64fb('0x39')](0x1f4,_0x64fb('0x43')));});},'AgentCapacity':function(_0x3b6c6c){var _0x1071a0=this;return new Promise(function(_0x5c1f75,_0x5e35e9){if(_0x322df9[_0x64fb('0x3b')][_0x64fb('0x45')](_0x3b6c6c['id'])){for(var _0x458b8b in _0x3b6c6c[_0x64fb('0x46')]){if(_0x3b6c6c['capacity'][_0x64fb('0x45')](_0x458b8b)){if(_0x322df9['agents'][_0x3b6c6c['id']][_0x64fb('0x45')](_0x458b8b+_0x64fb('0x47'))){_0x322df9[_0x64fb('0x3b')][_0x3b6c6c['id']][_0x458b8b+'CurrentCapacity']=parseInt(_0x3b6c6c[_0x64fb('0x46')][_0x458b8b],0xa);}}}_0x322df9['agents'][_0x3b6c6c['id']]['updateRealtime']();return _0x5c1f75({'code':0xc8,'message':_0x322df9[_0x64fb('0x3b')][_0x3b6c6c['id']]});}else{return _0x5e35e9(_0x1071a0['error'](0x1f4,_0x64fb('0x48')));}});},'Agents':function(_0x33af66){return new Promise(function(_0x53ddf2,_0x14d37f){var _0x52480d=_[_0x64fb('0x49')](_0x322df9['agents']);_0x53ddf2({'count':_0x52480d[_0x64fb('0x1b')],'rows':_0x52480d});});},'ChatQueues':function(_0x510f33){return new Promise(function(_0x318390,_0x35df2a){var _0x346007=[];for(var _0x115986 in _0x322df9[_0x64fb('0x4a')]){if(_0x322df9[_0x64fb('0x4a')]['hasOwnProperty'](_0x115986)){var _0xaf225e=_0x322df9[_0x64fb('0x4a')][_0x115986];var _0x1b1014={'id':_0xaf225e['id'],'available':_0xaf225e['available'],'loggedIn':_0xaf225e[_0x64fb('0x4b')],'name':_0xaf225e[_0x64fb('0x4c')],'paused':_0xaf225e[_0x64fb('0x4d')],'waiting':_0xaf225e[_0x64fb('0x4e')]};_0x346007[_0x64fb('0x23')](_0x1b1014);}}_0x318390({'count':_0x346007['length'],'rows':_0x346007});});},'MailQueues':function(_0x47732a){return new Promise(function(_0x355aaf,_0xde160a){var _0x359362=[];for(var _0x388fa0 in _0x322df9[_0x64fb('0x4f')]){if(_0x322df9[_0x64fb('0x4f')][_0x64fb('0x45')](_0x388fa0)){var _0x55b63a=_0x322df9['mailQueues'][_0x388fa0];var _0x59383b={'id':_0x55b63a['id'],'available':_0x55b63a[_0x64fb('0x50')],'loggedIn':_0x55b63a[_0x64fb('0x4b')],'name':_0x55b63a[_0x64fb('0x4c')],'paused':_0x55b63a[_0x64fb('0x4d')],'waiting':_0x55b63a[_0x64fb('0x4e')]};_0x359362[_0x64fb('0x23')](_0x59383b);}}_0x355aaf({'count':_0x359362['length'],'rows':_0x359362});});},'OpenchannelQueues':function(_0x4bd12d){return new Promise(function(_0x38d07c,_0x596b7f){var _0x14c41f=[];for(var _0xf3de62 in _0x322df9[_0x64fb('0x51')]){if(_0x322df9[_0x64fb('0x51')][_0x64fb('0x45')](_0xf3de62)){var _0xa6a9f7=_0x322df9[_0x64fb('0x51')][_0xf3de62];var _0x4a6624={'id':_0xa6a9f7['id'],'available':_0xa6a9f7['available'],'loggedIn':_0xa6a9f7[_0x64fb('0x4b')],'name':_0xa6a9f7[_0x64fb('0x4c')],'paused':_0xa6a9f7[_0x64fb('0x4d')],'waiting':_0xa6a9f7[_0x64fb('0x4e')]};_0x14c41f[_0x64fb('0x23')](_0x4a6624);}}_0x38d07c({'count':_0x14c41f[_0x64fb('0x1b')],'rows':_0x14c41f});});},'SmsQueues':function(_0x1fb54d){return new Promise(function(_0x2ac4f4,_0x24b43a){var _0x441a78=[];for(var _0x27abe4 in _0x322df9['smsQueues']){if(_0x322df9[_0x64fb('0x52')]['hasOwnProperty'](_0x27abe4)){var _0x34d6fc=_0x322df9['smsQueues'][_0x27abe4];var _0x4332ba={'id':_0x34d6fc['id'],'available':_0x34d6fc[_0x64fb('0x50')],'loggedIn':_0x34d6fc[_0x64fb('0x4b')],'name':_0x34d6fc[_0x64fb('0x4c')],'paused':_0x34d6fc['paused'],'waiting':_0x34d6fc[_0x64fb('0x4e')]};_0x441a78[_0x64fb('0x23')](_0x4332ba);}}_0x2ac4f4({'count':_0x441a78[_0x64fb('0x1b')],'rows':_0x441a78});});},'FaxQueues':function(_0x5fff9){return new Promise(function(_0xdf0a5b,_0x10e0ac){var _0x306693=[];for(var _0x3eec35 in _0x322df9[_0x64fb('0x53')]){if(_0x322df9[_0x64fb('0x53')][_0x64fb('0x45')](_0x3eec35)){var _0x33ea42=_0x322df9[_0x64fb('0x53')][_0x3eec35];var _0x449a60={'id':_0x33ea42['id'],'available':_0x33ea42[_0x64fb('0x50')],'loggedIn':_0x33ea42[_0x64fb('0x4b')],'name':_0x33ea42[_0x64fb('0x4c')],'paused':_0x33ea42['paused'],'waiting':_0x33ea42[_0x64fb('0x4e')]};_0x306693['push'](_0x449a60);}}_0xdf0a5b({'count':_0x306693['length'],'rows':_0x306693});});},'WhatsappQueues':function(_0x1dce3d){return new Promise(function(_0x494bc5,_0x4c719a){var _0xb21658=[];for(var _0x4c1c8f in _0x322df9['whatsappQueues']){if(_0x322df9[_0x64fb('0x54')]['hasOwnProperty'](_0x4c1c8f)){var _0x25654c=_0x322df9['whatsappQueues'][_0x4c1c8f];var _0x55a3d3={'id':_0x25654c['id'],'available':_0x25654c[_0x64fb('0x50')],'loggedIn':_0x25654c[_0x64fb('0x4b')],'name':_0x25654c['name'],'paused':_0x25654c[_0x64fb('0x4d')],'waiting':_0x25654c[_0x64fb('0x4e')]};_0xb21658[_0x64fb('0x23')](_0x55a3d3);}}_0x494bc5({'count':_0xb21658['length'],'rows':_0xb21658});});},'ChatQueuesWaitingInteractions':function(_0x350016){return new Promise(function(_0x17af00,_0x4ea502){var _0x3393b5=_[_0x64fb('0x49')](_0x322df9[_0x64fb('0x55')]);_0x17af00({'count':_0x3393b5[_0x64fb('0x1b')],'rows':_0x3393b5});});},'MailQueuesWaitingInteractions':function(_0x5710b0){return new Promise(function(_0x135fe9,_0x125ce0){var _0x2c3294=_['values'](_0x322df9[_0x64fb('0x56')]);_0x135fe9({'count':_0x2c3294[_0x64fb('0x1b')],'rows':_0x2c3294});});},'OpenchannelQueuesWaitingInteractions':function(_0x3998c5){return new Promise(function(_0x43dc7a,_0x260501){var _0x2e6823=_[_0x64fb('0x49')](_0x322df9[_0x64fb('0x57')]);_0x43dc7a({'count':_0x2e6823[_0x64fb('0x1b')],'rows':_0x2e6823});});},'SmsQueuesWaitingInteractions':function(_0x5bec8){return new Promise(function(_0x20c98a,_0xe2cada){var _0x39b0e3=_['values'](_0x322df9['smsQueuesWaitingInteractions']);_0x20c98a({'count':_0x39b0e3[_0x64fb('0x1b')],'rows':_0x39b0e3});});},'FaxQueuesWaitingInteractions':function(_0x33da37){return new Promise(function(_0x43f84b,_0xea987e){var _0x1902a5=_[_0x64fb('0x49')](_0x322df9[_0x64fb('0x58')]);_0x43f84b({'count':_0x1902a5['length'],'rows':_0x1902a5});});},'WhatsappQueuesWaitingInteractions':function(_0x149842){return new Promise(function(_0x15fca0,_0x210d7e){var _0x5cb403=_['values'](_0x322df9[_0x64fb('0x59')]);_0x15fca0({'count':_0x5cb403['length'],'rows':_0x5cb403});});}};var _0x282c5c=jayson['server'](_0x330fc3)[_0x64fb('0x5a')]();_0x282c5c['on']('error',function(_0x4404a4){logger['error'](JSON[_0x64fb('0x35')](_0x4404a4));return _0x403728(_0x4404a4);});_0x282c5c[_0x64fb('0x14')](0x232c,_0x64fb('0x5b'),function(){console[_0x64fb('0x5c')](_0x64fb('0x5d'),0x232c);return _0x2b209f(_0x64fb('0x5e')+0x232c);});});}; \ No newline at end of file +var _0x6878=['emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','UserId','catch','stack','message\x20is\x20empty','end','hasOwnProperty','CurrentCapacity','updateRealtime','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','bluebird','uuid','../../../config/environment','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','isNil','IntervalId','Intervals','map','interval','rules','channel','interaction','applications','isArray','length','join','app','.js','toLowerCase','autoreply','split','mail','push','slice','appdata','dialogflowv2','amazonlex','message','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','execute','info','Applications\x20executed','stringify','matchPath'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x6878,0x185));var _0x8687=function(_0x199208,_0x57146f){_0x199208=_0x199208-0x0;var _0x47a7d3=_0x6878[_0x199208];return _0x47a7d3;};'use strict';var _=require(_0x8687('0x0'));var util=require('util');var path=require(_0x8687('0x1'));var fs=require('fs');var jayson=require(_0x8687('0x2'));var BPromise=require(_0x8687('0x3'));var uuid=require(_0x8687('0x4'));var config=require(_0x8687('0x5'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x8687('0x6')),'chatQueueReport':require(_0x8687('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x8687('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x2520f3,_0x44e4cc,_0x53cc29){return util[_0x8687('0x9')]('%s.%s.%s',_0x2520f3,_0x44e4cc||0x0,_0x53cc29||0x0);}function getIntervals(_0x3fed85,_0x448e8b){var _0x2d87da=[];if(!_[_0x8687('0xa')](_0x448e8b[_0x8687('0xb')])&&!_[_0x8687('0xa')](_0x3fed85[_0x448e8b[_0x8687('0xb')]])&&!_[_0x8687('0xa')](_0x3fed85[_0x448e8b[_0x8687('0xb')]][_0x8687('0xc')])){_0x2d87da=_[_0x8687('0xd')](_0x3fed85[_0x448e8b['IntervalId']][_0x8687('0xc')],_0x8687('0xe'));}else if(!_[_0x8687('0xa')](_0x448e8b['interval'])){_0x2d87da=[_0x448e8b['interval']];}return _0x2d87da;}exports['listen']=function(_0x2562c2){_0x2562c2[_0x8687('0xf')]={};return new BPromise(function(_0x1edf6a,_0x5e2859){var _0x37b8ce={'Start':function(_0x17e5d1){var _0x5eca4e=this;return new Promise(function(_0x5ab942,_0x1ba6d4){if(_0x17e5d1){try{var _0x4d5ab3=[];var _0xd7779f=getId(_0x17e5d1[_0x8687('0x10')],_0x17e5d1['message']?_0x17e5d1['message']['id']:0x0,_0x17e5d1[_0x8687('0x11')]?_0x17e5d1[_0x8687('0x11')]['id']:0x0);if(_0x17e5d1[_0x8687('0x12')]&&_[_0x8687('0x13')](_0x17e5d1['applications'])&&_0x17e5d1['applications'][_0x8687('0x14')]){for(var _0x108c49=0x0;_0x108c49<_0x17e5d1['applications']['length'];_0x108c49+=0x1){var _0x46c396=_0x17e5d1[_0x8687('0x12')][_0x108c49];if(fs['existsSync'](path[_0x8687('0x15')](__dirname,_0x8687('0x12'),_0x46c396[_0x8687('0x16')]+_0x8687('0x17')))){var _0x3850a0=[];switch(_0x46c396[_0x8687('0x16')][_0x8687('0x18')]()){case _0x8687('0x19'):var _0x3beb0c=_0x46c396['appdata'][_0x8687('0x1a')](',');if(_0x17e5d1['channel']===_0x8687('0x1b')){_0x3850a0[_0x8687('0x1c')](_0x3beb0c[0x0]);_0x3850a0[_0x8687('0x1c')](_0x3beb0c[0x1]);_0x3850a0[_0x8687('0x1c')](_0x3beb0c['slice'](0x2,_0x3beb0c['length'])[_0x8687('0x15')](','));}else{_0x3850a0['push'](_0x3beb0c[0x0]);_0x3850a0[_0x8687('0x1c')](_0x3beb0c[_0x8687('0x1d')](0x1,_0x3beb0c['length'])[_0x8687('0x15')](','));}break;case'dialogflow':var _0x45a8e7=_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');_0x3850a0[_0x8687('0x1c')](_0x45a8e7[0x0]);_0x3850a0[_0x8687('0x1c')](_0x45a8e7[0x1]);_0x3850a0[_0x8687('0x1c')](_0x45a8e7[_0x8687('0x1d')](0x2,_0x45a8e7['length'])[_0x8687('0x15')](','));break;case _0x8687('0x1f'):var _0x3bf77e=_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');_0x3850a0['push'](_0x3bf77e[0x0]);_0x3850a0['push'](_0x3bf77e[0x1]);_0x3850a0[_0x8687('0x1c')](_0x3bf77e[0x2]);_0x3850a0['push'](_0x3bf77e[0x3]);_0x3850a0['push'](_0x3bf77e[_0x8687('0x1d')](0x4,_0x3bf77e[_0x8687('0x14')])[_0x8687('0x15')](','));break;case _0x8687('0x20'):var _0x529630=_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');_0x3850a0[_0x8687('0x1c')](_0x529630[0x0]);_0x3850a0[_0x8687('0x1c')](_0x529630[0x1]);_0x3850a0[_0x8687('0x1c')](_0x529630[0x2]);_0x3850a0['push'](_0x529630[0x3]);_0x3850a0['push'](_0x529630[_0x8687('0x1d')](0x4,_0x529630[_0x8687('0x14')])[_0x8687('0x15')](','));break;case _0x8687('0x21'):_0x3850a0[_0x8687('0x1c')](_0x46c396['appdata']);break;case _0x8687('0x22'):_0x3850a0[_0x8687('0x1c')](_0x46c396[_0x8687('0x23')]);_0x3850a0[_0x8687('0x1c')](_0x46c396[_0x8687('0x1e')]);break;default:_0x3850a0=_[_0x8687('0xa')](_0x46c396['appdata'])?[]:_0x46c396[_0x8687('0x1e')][_0x8687('0x1a')](',');}var _0x6d97aa={'id':util['format'](_0x8687('0x24'),_0xd7779f,_0x46c396['id'],_0x46c396[_0x8687('0x16')]),'condition':require(_0x8687('0x25'))[_0x8687('0x26')](_0xd7779f,getIntervals(_0x2562c2[_0x8687('0x27')],_0x46c396),_0x2562c2),'consequence':require(_0x8687('0x28')+_0x46c396[_0x8687('0x16')])['consequence'](_0xd7779f,_0x3850a0,_0x2562c2,_0x17e5d1),'p':_0x46c396[_0x8687('0x29')]||0x0};logger['info'](_0x8687('0x2a'),_0x6d97aa['id'],_0x8687('0x2b'),getIntervals(_0x2562c2['intervals'],_0x46c396)[_0x8687('0x15')](_0x8687('0x2c')));_0x4d5ab3[_0x8687('0x1c')](_0x6d97aa);}else{logger[_0x8687('0x2d')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,'applications',_0x46c396[_0x8687('0x16')]+_0x8687('0x17')));}}_0x2562c2[_0x8687('0xf')][_0xd7779f]=new RuleEngine(_0x4d5ab3);_0x2562c2[_0x8687('0xf')][_0xd7779f][_0x8687('0x2e')](_0x17e5d1,function(_0x2c90df){logger[_0x8687('0x2f')](_0x8687('0x30'),JSON[_0x8687('0x31')](_0x2c90df[_0x8687('0x32')]));if(_0x2562c2[_0x8687('0xf')][_0xd7779f]){_0x2562c2['rules'][_0xd7779f][_0x8687('0x33')](_0x8687('0x34'));}});return _0x5ab942({'code':0xc8,'message':_0x17e5d1});}else{logger[_0x8687('0x2f')](_0x8687('0x35'));return _0x5ab942({'code':0xc8,'message':_0x17e5d1});}}catch(_0x50aa92){logger[_0x8687('0x2d')](_0x50aa92['stack']);return _0x1ba6d4(_0x5eca4e['error'](0x1f4,_0x50aa92));}}return _0x1ba6d4(_0x8687('0x36'));});},'AcceptMessage':function(_0x425aa6){var _0x13c3ed=this;return new Promise(function(_0x2ff6fa,_0x57743b){if(_0x425aa6[_0x8687('0x37')]&&_0x425aa6[_0x8687('0x37')]['id']){if(_0x2562c2['agents'][_0x425aa6[_0x8687('0x37')]['id']]){_0x2562c2[_0x8687('0x38')][_0x425aa6[_0x8687('0x37')]['id']]['busy']=![];_0x2562c2['agents'][_0x425aa6[_0x8687('0x37')]['id']][_0x8687('0x39')]=undefined;}}if(_0x425aa6['message']&&_0x425aa6[_0x8687('0x21')]['id']){try{var _0x36bee9=getId(_0x425aa6[_0x8687('0x10')],_0x425aa6[_0x8687('0x21')]?_0x425aa6[_0x8687('0x21')]['id']:0x0,_0x425aa6['interaction']?_0x425aa6[_0x8687('0x11')]['id']:0x0);if(_0x2562c2[_0x8687('0xf')][_0x36bee9]){_0x2562c2['rules'][_0x36bee9][_0x8687('0x33')]('end');if(rpc[_0x425aa6[_0x8687('0x10')]+_0x8687('0x3a')]){rpc[_0x425aa6[_0x8687('0x10')]+'QueueReport']['update'](_0x36bee9,{'UserId':_0x425aa6[_0x8687('0x21')][_0x8687('0x3b')]})[_0x8687('0x3c')](function(_0x12c02d){logger['error']('error\x20update\x20queue\x20report');});}}return _0x2ff6fa({'code':0xc8,'message':_0x425aa6});}catch(_0x382560){logger[_0x8687('0x2d')](_0x382560[_0x8687('0x3d')]);return _0x57743b(_0x13c3ed[_0x8687('0x2d')](0x1f4,_0x382560));}}logger[_0x8687('0x2d')](_0x8687('0x3e'));return _0x57743b(_0x13c3ed[_0x8687('0x2d')](0x1f4,_0x8687('0x3e')));});},'RejectMessage':function(_0x465462){var _0x5904c7=this;return new Promise(function(_0x2cee23,_0x32ce22){if(_0x465462[_0x8687('0x37')]&&_0x465462[_0x8687('0x37')]['id']){try{if(_0x2562c2['agents'][_0x465462[_0x8687('0x37')]['id']]){_0x2562c2[_0x8687('0x38')][_0x465462[_0x8687('0x37')]['id']]['busy']=![];_0x2562c2[_0x8687('0x38')][_0x465462[_0x8687('0x37')]['id']][_0x8687('0x39')]=undefined;}return _0x2cee23({'code':0xc8,'message':_0x465462});}catch(_0x240d1c){logger[_0x8687('0x2d')](_0x240d1c['stack']);return _0x32ce22(_0x5904c7['error'](0x1f4,_0x240d1c));}}logger[_0x8687('0x2d')](_0x8687('0x3e'));return _0x32ce22(_0x5904c7[_0x8687('0x2d')](0x1f4,_0x8687('0x3e')));});},'AbandonInteraction':function(_0x28cd11){var _0x3767e7=this;return new Promise(function(_0x298a68,_0x42c7e0){if(_0x28cd11[_0x8687('0x10')]&&_0x28cd11[_0x8687('0x11')]&&_0x28cd11['interaction']['id']){try{var _0x179c02=getId(_0x28cd11['channel'],_0x28cd11['message']?_0x28cd11['message']['id']:0x0,_0x28cd11[_0x8687('0x11')]?_0x28cd11[_0x8687('0x11')]['id']:0x0);if(_0x2562c2[_0x8687('0xf')][_0x179c02]){_0x2562c2[_0x8687('0xf')][_0x179c02]['emit'](_0x8687('0x3f'));}return _0x298a68({'code':0xc8,'message':_0x28cd11});}catch(_0x40a522){logger[_0x8687('0x2d')](_0x40a522[_0x8687('0x3d')]);return _0x42c7e0(_0x3767e7['error'](0x1f4,_0x40a522));}}logger[_0x8687('0x2d')](_0x8687('0x3e'));return _0x42c7e0(_0x3767e7[_0x8687('0x2d')](0x1f4,_0x8687('0x3e')));});},'AgentCapacity':function(_0x7bb4dc){var _0x3912f8=this;return new Promise(function(_0x259ecb,_0x4fdb47){if(_0x2562c2[_0x8687('0x38')]['hasOwnProperty'](_0x7bb4dc['id'])){for(var _0x175f63 in _0x7bb4dc['capacity']){if(_0x7bb4dc['capacity']['hasOwnProperty'](_0x175f63)){if(_0x2562c2[_0x8687('0x38')][_0x7bb4dc['id']][_0x8687('0x40')](_0x175f63+_0x8687('0x41'))){_0x2562c2[_0x8687('0x38')][_0x7bb4dc['id']][_0x175f63+_0x8687('0x41')]=parseInt(_0x7bb4dc['capacity'][_0x175f63],0xa);}}}_0x2562c2['agents'][_0x7bb4dc['id']][_0x8687('0x42')]();return _0x259ecb({'code':0xc8,'message':_0x2562c2[_0x8687('0x38')][_0x7bb4dc['id']]});}else{return _0x4fdb47(_0x3912f8['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x52ce92){return new Promise(function(_0x16ff0b,_0x2be1ff){var _0x598fa3=_['values'](_0x2562c2[_0x8687('0x38')]);_0x16ff0b({'count':_0x598fa3[_0x8687('0x14')],'rows':_0x598fa3});});},'ChatQueues':function(_0x4312d5){return new Promise(function(_0x489227,_0x2ab638){var _0x4535bc=[];for(var _0x31d0e7 in _0x2562c2['chatQueues']){if(_0x2562c2[_0x8687('0x43')][_0x8687('0x40')](_0x31d0e7)){var _0x6800d3=_0x2562c2[_0x8687('0x43')][_0x31d0e7];var _0x42ba54={'id':_0x6800d3['id'],'available':_0x6800d3[_0x8687('0x44')],'loggedIn':_0x6800d3[_0x8687('0x45')],'name':_0x6800d3[_0x8687('0x46')],'paused':_0x6800d3[_0x8687('0x47')],'waiting':_0x6800d3[_0x8687('0x48')]};_0x4535bc['push'](_0x42ba54);}}_0x489227({'count':_0x4535bc[_0x8687('0x14')],'rows':_0x4535bc});});},'MailQueues':function(_0x2c49ed){return new Promise(function(_0x12b25b,_0x26b64b){var _0x151f08=[];for(var _0x1e2cd0 in _0x2562c2[_0x8687('0x49')]){if(_0x2562c2[_0x8687('0x49')][_0x8687('0x40')](_0x1e2cd0)){var _0x17459c=_0x2562c2[_0x8687('0x49')][_0x1e2cd0];var _0x792894={'id':_0x17459c['id'],'available':_0x17459c[_0x8687('0x44')],'loggedIn':_0x17459c[_0x8687('0x45')],'name':_0x17459c['name'],'paused':_0x17459c[_0x8687('0x47')],'waiting':_0x17459c[_0x8687('0x48')]};_0x151f08[_0x8687('0x1c')](_0x792894);}}_0x12b25b({'count':_0x151f08[_0x8687('0x14')],'rows':_0x151f08});});},'OpenchannelQueues':function(_0x207876){return new Promise(function(_0x28e6ee,_0x579b77){var _0x4c01d5=[];for(var _0x38e086 in _0x2562c2[_0x8687('0x4a')]){if(_0x2562c2[_0x8687('0x4a')][_0x8687('0x40')](_0x38e086)){var _0x3650bd=_0x2562c2[_0x8687('0x4a')][_0x38e086];var _0x565415={'id':_0x3650bd['id'],'available':_0x3650bd[_0x8687('0x44')],'loggedIn':_0x3650bd['loggedIn'],'name':_0x3650bd[_0x8687('0x46')],'paused':_0x3650bd['paused'],'waiting':_0x3650bd['waiting']};_0x4c01d5[_0x8687('0x1c')](_0x565415);}}_0x28e6ee({'count':_0x4c01d5['length'],'rows':_0x4c01d5});});},'SmsQueues':function(_0x12d0d3){return new Promise(function(_0x441f90,_0x415c56){var _0x5c7f38=[];for(var _0x53359b in _0x2562c2[_0x8687('0x4b')]){if(_0x2562c2[_0x8687('0x4b')]['hasOwnProperty'](_0x53359b)){var _0x54da36=_0x2562c2[_0x8687('0x4b')][_0x53359b];var _0x56e8b4={'id':_0x54da36['id'],'available':_0x54da36[_0x8687('0x44')],'loggedIn':_0x54da36[_0x8687('0x45')],'name':_0x54da36['name'],'paused':_0x54da36[_0x8687('0x47')],'waiting':_0x54da36[_0x8687('0x48')]};_0x5c7f38[_0x8687('0x1c')](_0x56e8b4);}}_0x441f90({'count':_0x5c7f38['length'],'rows':_0x5c7f38});});},'FaxQueues':function(_0x1f8302){return new Promise(function(_0x1d9921,_0x25ef00){var _0x222f45=[];for(var _0x13d81c in _0x2562c2[_0x8687('0x4c')]){if(_0x2562c2['faxQueues']['hasOwnProperty'](_0x13d81c)){var _0x516f13=_0x2562c2[_0x8687('0x4c')][_0x13d81c];var _0x1f5732={'id':_0x516f13['id'],'available':_0x516f13[_0x8687('0x44')],'loggedIn':_0x516f13['loggedIn'],'name':_0x516f13[_0x8687('0x46')],'paused':_0x516f13[_0x8687('0x47')],'waiting':_0x516f13[_0x8687('0x48')]};_0x222f45[_0x8687('0x1c')](_0x1f5732);}}_0x1d9921({'count':_0x222f45['length'],'rows':_0x222f45});});},'WhatsappQueues':function(_0x3510d1){return new Promise(function(_0x139aac,_0xa3f9eb){var _0xd7e4f6=[];for(var _0x548b22 in _0x2562c2[_0x8687('0x4d')]){if(_0x2562c2[_0x8687('0x4d')]['hasOwnProperty'](_0x548b22)){var _0x10a879=_0x2562c2[_0x8687('0x4d')][_0x548b22];var _0x231061={'id':_0x10a879['id'],'available':_0x10a879['available'],'loggedIn':_0x10a879['loggedIn'],'name':_0x10a879[_0x8687('0x46')],'paused':_0x10a879[_0x8687('0x47')],'waiting':_0x10a879[_0x8687('0x48')]};_0xd7e4f6[_0x8687('0x1c')](_0x231061);}}_0x139aac({'count':_0xd7e4f6[_0x8687('0x14')],'rows':_0xd7e4f6});});},'ChatQueuesWaitingInteractions':function(_0x1671db){return new Promise(function(_0x2a9e40,_0x43a154){var _0xb37b63=_['values'](_0x2562c2['chatQueuesWaitingInteractions']);_0x2a9e40({'count':_0xb37b63[_0x8687('0x14')],'rows':_0xb37b63});});},'MailQueuesWaitingInteractions':function(_0x5ac207){return new Promise(function(_0x465229,_0x5509a0){var _0x2a9fbb=_['values'](_0x2562c2['mailQueuesWaitingInteractions']);_0x465229({'count':_0x2a9fbb['length'],'rows':_0x2a9fbb});});},'OpenchannelQueuesWaitingInteractions':function(_0xab4454){return new Promise(function(_0x6196bb,_0x42f569){var _0x1a61f2=_[_0x8687('0x4e')](_0x2562c2[_0x8687('0x4f')]);_0x6196bb({'count':_0x1a61f2['length'],'rows':_0x1a61f2});});},'SmsQueuesWaitingInteractions':function(_0x2b4eda){return new Promise(function(_0x5aa0e4,_0xcda13c){var _0x5f593d=_[_0x8687('0x4e')](_0x2562c2['smsQueuesWaitingInteractions']);_0x5aa0e4({'count':_0x5f593d[_0x8687('0x14')],'rows':_0x5f593d});});},'FaxQueuesWaitingInteractions':function(_0x84d0e5){return new Promise(function(_0x176b4b,_0x114b25){var _0x1fb170=_[_0x8687('0x4e')](_0x2562c2[_0x8687('0x50')]);_0x176b4b({'count':_0x1fb170[_0x8687('0x14')],'rows':_0x1fb170});});},'WhatsappQueuesWaitingInteractions':function(_0x4a5728){return new Promise(function(_0x1b3869,_0x429cdc){var _0x5df5db=_[_0x8687('0x4e')](_0x2562c2[_0x8687('0x51')]);_0x1b3869({'count':_0x5df5db[_0x8687('0x14')],'rows':_0x5df5db});});}};var _0x2a5bdd=jayson[_0x8687('0x52')](_0x37b8ce)[_0x8687('0x53')]();_0x2a5bdd['on'](_0x8687('0x2d'),function(_0x396794){logger[_0x8687('0x2d')](JSON[_0x8687('0x31')](_0x396794));return _0x5e2859(_0x396794);});_0x2a5bdd[_0x8687('0x54')](0x232c,_0x8687('0x55'),function(){console['log'](_0x8687('0x56'),0x232c);return _0x1edf6a(_0x8687('0x57')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index dc92db4..6bf5a0a 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 _0xfe1e=['when','log','stack','stop','util','jayson/promise','routing','http','request','then','error','message','result','catch','rules','info','length','Command','format','indexOf','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20'];(function(_0x4c4393,_0x5490b1){var _0x2acd7d=function(_0x243044){while(--_0x243044){_0x4c4393['push'](_0x4c4393['shift']());}};_0x2acd7d(++_0x5490b1);}(_0xfe1e,0x162));var _0xefe1=function(_0x462e51,_0x16c80e){_0x462e51=_0x462e51-0x0;var _0x48e768=_0xfe1e[_0x462e51];return _0x48e768;};'use strict';var util=require(_0xefe1('0x0'));var BPromise=require('bluebird');var jayson=require(_0xefe1('0x1'));var _=require('lodash');var logger=require('../../../config/logger')(_0xefe1('0x2'));var client=jayson['client'][_0xefe1('0x3')]({'port':0x232a});function request(_0x31c577,_0x58cc77){return new BPromise(function(_0x16085f,_0x429844){return client[_0xefe1('0x4')](_0x31c577,_0x58cc77)[_0xefe1('0x5')](function(_0x45ba2b){if(_0x45ba2b[_0xefe1('0x6')]){return _0x429844(_0x45ba2b[_0xefe1('0x6')][_0xefe1('0x7')]);}else{return _0x16085f(_0x45ba2b[_0xefe1('0x8')]);}})[_0xefe1('0x9')](function(_0x5221ea){return _0x429844(_0x5221ea);});});}exports['condition']=function(_0x3448a0,_0x19862c,_0x56de51){return function(_0x41f7d9){if(_0x56de51[_0xefe1('0xa')]&&!_0x56de51[_0xefe1('0xa')][_0x3448a0]){logger[_0xefe1('0xb')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x3448a0);return _0x41f7d9['stop']();}var _0x4b9984=[];for(var _0x5b9c3c=0x0;_0x5b9c3c<_0x19862c[_0xefe1('0xc')];_0x5b9c3c+=0x1){_0x4b9984['push'](request(_0xefe1('0xd'),{'command':util[_0xefe1('0xe')]('iftime\x20%s',_0x19862c[_0x5b9c3c])})[_0xefe1('0x5')](function(_0x55e800){return _0x55e800&&_0x55e800[_0xefe1('0x7')]&&_0x55e800[_0xefe1('0x7')][_0xefe1('0xf')]('true')>=0x0?!![]:![];})[_0xefe1('0x9')](function(_0x1f0e8c){logger[_0xefe1('0x6')]('[%s][INTERVAL]\x20%s',_0x3448a0,_0x19862c[_0x5b9c3c]);}));}BPromise[_0xefe1('0x10')](_0x4b9984)[_0xefe1('0x5')](function(_0xc8338){var _0x3fbeed=_[_0xefe1('0x11')](_0xc8338);logger['info'](_0xefe1('0x12'),_0x3448a0,_0x19862c[_0xefe1('0x13')](_0xefe1('0x14')),_0x3fbeed);_0x41f7d9[_0xefe1('0x15')](_0x3fbeed);})['catch'](function(_0x301d2b){console[_0xefe1('0x16')](_0x301d2b);logger[_0xefe1('0x6')](_0xefe1('0x12'),_0x3448a0,_0x19862c[_0xefe1('0x13')](_0xefe1('0x14')),_0x301d2b[_0xefe1('0x17')]);_0x41f7d9[_0xefe1('0x18')]();});};}; \ No newline at end of file +var _0x49ca=['catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','when','log','join','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','client','http','request','then','error','result'];(function(_0x58dfbc,_0x4c5c67){var _0x5d2758=function(_0xf1cb53){while(--_0xf1cb53){_0x58dfbc['push'](_0x58dfbc['shift']());}};_0x5d2758(++_0x4c5c67);}(_0x49ca,0x1d1));var _0xa49c=function(_0x599998,_0x542413){_0x599998=_0x599998-0x0;var _0x371a27=_0x49ca[_0x599998];return _0x371a27;};'use strict';var util=require(_0xa49c('0x0'));var BPromise=require(_0xa49c('0x1'));var jayson=require(_0xa49c('0x2'));var _=require(_0xa49c('0x3'));var logger=require(_0xa49c('0x4'))('routing');var client=jayson[_0xa49c('0x5')][_0xa49c('0x6')]({'port':0x232a});function request(_0x4cb980,_0x2364c0){return new BPromise(function(_0x2be14b,_0x3ab1a6){return client[_0xa49c('0x7')](_0x4cb980,_0x2364c0)[_0xa49c('0x8')](function(_0x2e2c23){if(_0x2e2c23[_0xa49c('0x9')]){return _0x3ab1a6(_0x2e2c23['error']['message']);}else{return _0x2be14b(_0x2e2c23[_0xa49c('0xa')]);}})[_0xa49c('0xb')](function(_0x492b77){return _0x3ab1a6(_0x492b77);});});}exports[_0xa49c('0xc')]=function(_0x5cadcd,_0x206272,_0x5412b0){return function(_0x21649f){if(_0x5412b0[_0xa49c('0xd')]&&!_0x5412b0[_0xa49c('0xd')][_0x5cadcd]){logger[_0xa49c('0xe')](_0xa49c('0xf'),_0x5cadcd);return _0x21649f[_0xa49c('0x10')]();}var _0x4859a8=[];for(var _0x319ed4=0x0;_0x319ed4<_0x206272[_0xa49c('0x11')];_0x319ed4+=0x1){_0x4859a8[_0xa49c('0x12')](request(_0xa49c('0x13'),{'command':util[_0xa49c('0x14')](_0xa49c('0x15'),_0x206272[_0x319ed4])})[_0xa49c('0x8')](function(_0x45c0f0){return _0x45c0f0&&_0x45c0f0[_0xa49c('0x16')]&&_0x45c0f0[_0xa49c('0x16')][_0xa49c('0x17')](_0xa49c('0x18'))>=0x0?!![]:![];})[_0xa49c('0xb')](function(_0x147bb6){logger[_0xa49c('0x9')](_0xa49c('0x19'),_0x5cadcd,_0x206272[_0x319ed4]);}));}BPromise[_0xa49c('0x1a')](_0x4859a8)[_0xa49c('0x8')](function(_0x249e20){var _0x5a3924=_[_0xa49c('0x1b')](_0x249e20);logger[_0xa49c('0xe')](_0xa49c('0x1c'),_0x5cadcd,_0x206272['join']('\x20|\x20'),_0x5a3924);_0x21649f[_0xa49c('0x1d')](_0x5a3924);})['catch'](function(_0x1bc58f){console[_0xa49c('0x1e')](_0x1bc58f);logger[_0xa49c('0x9')](_0xa49c('0x1c'),_0x5cadcd,_0x206272[_0xa49c('0x1f')](_0xa49c('0x20')),_0x1bc58f[_0xa49c('0x21')]);_0x21649f['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index b5f0ef5..8307d84 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 _0x9aea=['[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','debug','agentringnoanswerAt','timeout','reason','holdtime','ringtime','[%s][agents][agentringnoanswer]','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format'];(function(_0x478de7,_0x4cd24c){var _0x560291=function(_0x408edd){while(--_0x408edd){_0x478de7['push'](_0x478de7['shift']());}};_0x560291(++_0x4cd24c);}(_0x9aea,0xdd));var _0xa9ae=function(_0xd3a6db,_0x4b447e){_0xd3a6db=_0xd3a6db-0x0;var _0x339d97=_0x9aea[_0xd3a6db];return _0x339d97;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var utils=require(_0xa9ae('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e1d51,_0x2b5e0c){utils[_0xa9ae('0x2')](util['format'](_0xa9ae('0x3'),_0x5e1d51[_0xa9ae('0x4')],_0x5e1d51[_0xa9ae('0x5')],_0x5e1d51[_0xa9ae('0x6')],_0x5e1d51[_0xa9ae('0x7')],_0x5e1d51['interface'],_0x5e1d51[_0xa9ae('0x8')],_0x5e1d51[_0xa9ae('0x9')],_0x5e1d51[_0xa9ae('0xa')]));if(_0x5e1d51['queue']){utils[_0xa9ae('0xb')](_0x5e1d51[_0xa9ae('0x6')])[_0xa9ae('0xc')](function(_0x44cf1b){if(_0x44cf1b){_0x5e1d51[_0xa9ae('0xd')]=_0x44cf1b[_0xa9ae('0xd')];_0x5e1d51[_0xa9ae('0xe')]=_0x5e1d51[_0xa9ae('0xf')]?_0x44cf1b[_0xa9ae('0x10')]:![];_0x5e1d51['acwtime']=_0x5e1d51[_0xa9ae('0xe')]?_0x44cf1b['acwTimeout']:0x0;}utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);});}else{utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);}if(_0x2b5e0c){delete transfers[_0x5e1d51[_0xa9ae('0x4')]];}else{delete agents[_0x5e1d51[_0xa9ae('0x13')]];}}exports[_0xa9ae('0x14')]=function(_0x2b511a){try{utils['debug'](util[_0xa9ae('0x15')](_0xa9ae('0x16'),_0x2b511a[_0xa9ae('0x4')]),_0x2b511a);agents[_0x2b511a[_0xa9ae('0x13')]]=_0x2b511a;agents[_0x2b511a['destuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x19');agents[_0x2b511a[_0xa9ae('0x13')]]['connectedlinenum']=null;agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0x1a')]=null;utils[_0xa9ae('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2b511a[_0xa9ae('0x4')],agents[_0x2b511a['destuniqueid']]['membername'],_0x2b511a[_0xa9ae('0x13')]));}catch(_0x3b8245){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentcalled]',_0x2b511a[_0xa9ae('0x4')]),_0x3b8245);}};exports[_0xa9ae('0x1c')]=function(_0x39f133){try{if(!_[_0xa9ae('0x1d')](agents[_0x39f133[_0xa9ae('0x13')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentringnoanswer]',_0x39f133[_0xa9ae('0x4')]),_0x39f133);utils['info'](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x39f133['uniqueid'],agents[_0x39f133[_0xa9ae('0x13')]]['membername'],_0x39f133[_0xa9ae('0x13')]));agents[_0x39f133['destuniqueid']][_0xa9ae('0x1c')]=!![];agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x20');agents[_0x39f133['destuniqueid']][_0xa9ae('0x21')]=_0xa9ae('0x20');agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x22')]=_0x39f133[_0xa9ae('0x23')]?parseInt(_0x39f133[_0xa9ae('0x23')])/0x3e8:0x0;agents[_0x39f133[_0xa9ae('0x13')]]['talktime']=0x0;unanswered['push'](_0x39f133[_0xa9ae('0x13')]);}}catch(_0x3c324e){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x24'),_0x39f133['uniqueid']),_0x3c324e);}};exports['queuecallerabandon']=function(_0x1892b5){try{_[_0xa9ae('0x25')](agents,function(_0x372ec7,_0x3a48b7){if(_0x372ec7[_0xa9ae('0x4')]==_0x1892b5[_0xa9ae('0x4')]&&!_['includes'](unanswered,_0x372ec7['destuniqueid'])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5[_0xa9ae('0x4')]),_0x1892b5);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x27'),_0x1892b5[_0xa9ae('0x4')],_0x372ec7['membername'],_0x372ec7[_0xa9ae('0x13')]));_0x372ec7['agentringnoanswer']=!![];_0x372ec7[_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();_0x372ec7[_0xa9ae('0xa')]='abandoned';_0x372ec7[_0xa9ae('0x21')]=_0xa9ae('0x28');_0x372ec7[_0xa9ae('0x22')]=_0x1892b5[_0xa9ae('0x22')];_0x372ec7[_0xa9ae('0x29')]=0x0;writeDB(_0x372ec7);}});}catch(_0x4cb3ae){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5['uniqueid']),_0x4cb3ae);}};exports['agentconnect']=function(_0x2155c8){try{if(agents[_0x2155c8[_0xa9ae('0x13')]]){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x2155c8);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x2a'),_0x2155c8[_0xa9ae('0x4')],agents[_0x2155c8['destuniqueid']][_0xa9ae('0x7')],_0x2155c8['destuniqueid']));agents[_0x2155c8[_0xa9ae('0x13')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();agents[_0x2155c8['destuniqueid']][_0xa9ae('0x9')]=_0x2155c8[_0xa9ae('0x9')];agents[_0x2155c8[_0xa9ae('0x13')]]['connectedlinename']=_0x2155c8[_0xa9ae('0x1a')];agents[_0x2155c8[_0xa9ae('0x13')]]['holdtime']=_0x2155c8[_0xa9ae('0x23')];agents[_0x2155c8['destuniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x2c');_['forIn'](agents,function(_0x37da9b,_0x15ce12){if(_0x37da9b[_0xa9ae('0x13')]!=_0x2155c8[_0xa9ae('0x13')]&&_0x37da9b[_0xa9ae('0x4')]==_0x2155c8[_0xa9ae('0x4')]){_0x37da9b['talktime']=0x0;_0x37da9b[_0xa9ae('0x22')]=_0x2155c8[_0xa9ae('0x23')];_0x37da9b['agentringnoanswer']=!![];_0x37da9b['agentringnoanswerAt']=utils[_0xa9ae('0x18')]();_0x37da9b[_0xa9ae('0xa')]=_0xa9ae('0x2d');_0x37da9b[_0xa9ae('0x21')]='answered_elsewhere';_0x37da9b[_0xa9ae('0x2e')]=_0x2155c8[_0xa9ae('0x13')];_0x37da9b[_0xa9ae('0x2f')]=_0x2155c8[_0xa9ae('0x7')];writeDB(_0x37da9b);}});}}catch(_0x23c91d){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x23c91d);}};exports[_0xa9ae('0xf')]=function(_0x566cb0){try{if(!_[_0xa9ae('0x1d')](agents[_0x566cb0['destuniqueid']])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x30'),_0x566cb0[_0xa9ae('0x4')]),_0x566cb0);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x31'),_0x566cb0['uniqueid'],agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x7')],_0x566cb0['destuniqueid']));agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xf')]=!![];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x566cb0[_0xa9ae('0x13')]]['talktime']=utils[_0xa9ae('0x33')](agents[_0x566cb0['destuniqueid']][_0xa9ae('0x32')],agents[_0x566cb0[_0xa9ae('0x13')]]['agentconnectAt']);agents[_0x566cb0['destuniqueid']][_0xa9ae('0x21')]=_0x566cb0[_0xa9ae('0x21')];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x34');writeDB(agents[_0x566cb0[_0xa9ae('0x13')]]);}}catch(_0x2961e4){utils[_0xa9ae('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x566cb0[_0xa9ae('0x4')]),_0x2961e4);}};exports[_0xa9ae('0x35')]=function(_0x4efe55){try{if(!_[_0xa9ae('0x1d')](agents[_0x4efe55[_0xa9ae('0x36')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x4efe55);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4efe55[_0xa9ae('0x4')],agents[_0x4efe55[_0xa9ae('0x36')]]['membername'],agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid']));agents[_0x4efe55['transfereruniqueid']]['transfer']=!![];agents[_0x4efe55[_0xa9ae('0x36')]][_0xa9ae('0x38')]='blind';agents[_0x4efe55['transfereruniqueid']]['transferexten']=_0x4efe55[_0xa9ae('0x39')];agents[_0x4efe55['transfereruniqueid']][_0xa9ae('0x3a')]=agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid'];}}catch(_0x1be415){utils['error'](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x1be415);}};exports[_0xa9ae('0x3b')]=function(_0x371760){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x371760);if(_0x371760[_0xa9ae('0x3d')]==_0x371760[_0xa9ae('0x3e')]){if(!_[_0xa9ae('0x1d')](agents[_0x371760['secondtransfereruniqueid']])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x3f'),_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x40')]]['membername']));agents[_0x371760['secondtransfereruniqueid']][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x40')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x40')]]['transferexten']=_0x371760[_0xa9ae('0x42')];agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x3a')]=_0x371760['origtransfereruniqueid'];}if(_0x371760[_0xa9ae('0x43')]&&agents[_0x371760['transfereeuniqueid']]){agents[_0x371760[_0xa9ae('0x43')]]['agententerreason']=0x1;transfers[_0x371760[_0xa9ae('0x43')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x43')]]);transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x40')]]['calleridnum'];transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x45')]=agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x45')];transfers[_0x371760['transfereeuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x22')]=0x0;transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x46')]=0x2;}}else if(_0x371760[_0xa9ae('0x40')]==_0x371760['secondtransfererlinkedid']){if(!_[_0xa9ae('0x1d')](agents[_0x371760[_0xa9ae('0x3d')]])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x3d')]]['membername']));agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x3d')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x47')]=_0x371760['secondtransfererexten'];agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x3a')]=_0x371760[_0xa9ae('0x40')];}if(_0x371760[_0xa9ae('0x48')]&&agents[_0x371760['transfertargetuniqueid']]){agents[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x46')]=0x1;transfers[_0x371760[_0xa9ae('0x48')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x48')]]);transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x8')];transfers[_0x371760[_0xa9ae('0x48')]]['calleridname']=agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x45')];transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x17')]=utils['now']();transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x371760[_0xa9ae('0x48')]]['agententerreason']=0x2;}}}catch(_0x14a720){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x14a720);}};exports[_0xa9ae('0x49')]=function(_0x1bf8e3){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3['uniqueid']),_0x1bf8e3);if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3['uniqueid']][_0xa9ae('0x21')]===_0xa9ae('0x20')){if(_0x1bf8e3[_0xa9ae('0x4b')]==='21'){agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]='rejected';agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x4c');}utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']]['lastevent']));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);var _0x2f4a73=unanswered[_0xa9ae('0x4d')](_0x1bf8e3[_0xa9ae('0x4')]);if(_0x2f4a73>-0x1){unanswered[_0xa9ae('0x4e')](_0x2f4a73,0x1);}}if(transfers[_0x1bf8e3['uniqueid']]){transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0x2b')]);transfers[_0x1bf8e3['uniqueid']]['reason']='agent';transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['membername'],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['reason'],transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]));writeDB(transfers[_0x1bf8e3[_0xa9ae('0x4')]],!![]);}if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]){agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](agents[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]);agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]=agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x41')]?_0xa9ae('0x41'):_0xa9ae('0x4f');agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x50'),_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);}}catch(_0x1f6465){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3[_0xa9ae('0x4')]),_0x1f6465);}}; \ No newline at end of file +var _0xd3d1=['transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension'];(function(_0x133655,_0x392340){var _0x38815a=function(_0x44c6ff){while(--_0x44c6ff){_0x133655['push'](_0x133655['shift']());}};_0x38815a(++_0x392340);}(_0xd3d1,0x172));var _0x1d3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd3d1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56f01c,_0x2d0605){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x4'),_0x56f01c[_0x1d3d('0x5')],_0x56f01c[_0x1d3d('0x6')],_0x56f01c[_0x1d3d('0x7')],_0x56f01c[_0x1d3d('0x8')],_0x56f01c[_0x1d3d('0x9')],_0x56f01c[_0x1d3d('0xa')],_0x56f01c[_0x1d3d('0xb')],_0x56f01c[_0x1d3d('0xc')]));if(_0x56f01c[_0x1d3d('0x7')]){utils[_0x1d3d('0xd')](_0x56f01c[_0x1d3d('0x7')])[_0x1d3d('0xe')](function(_0x3683c9){if(_0x3683c9){_0x56f01c['type']=_0x3683c9[_0x1d3d('0xf')];_0x56f01c[_0x1d3d('0x10')]=_0x56f01c[_0x1d3d('0x11')]?_0x3683c9[_0x1d3d('0x12')]:![];_0x56f01c[_0x1d3d('0x13')]=_0x56f01c[_0x1d3d('0x10')]?_0x3683c9[_0x1d3d('0x14')]:0x0;}utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);});}else{utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);}if(_0x2d0605){delete transfers[_0x56f01c['uniqueid']];}else{delete agents[_0x56f01c[_0x1d3d('0x17')]];}}exports[_0x1d3d('0x18')]=function(_0x494b82){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x19'),_0x494b82[_0x1d3d('0x5')]),_0x494b82);agents[_0x494b82['destuniqueid']]=_0x494b82;agents[_0x494b82[_0x1d3d('0x17')]]['agentcalledAt']=utils[_0x1d3d('0x1a')]();agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x1b');agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xb')]=null;agents[_0x494b82[_0x1d3d('0x17')]]['connectedlinename']=null;utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x1c'),_0x494b82['uniqueid'],agents[_0x494b82[_0x1d3d('0x17')]]['membername'],_0x494b82[_0x1d3d('0x17')]));}catch(_0x392e92){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][agentcalled]',_0x494b82[_0x1d3d('0x5')]),_0x392e92);}};exports['agentringnoanswer']=function(_0x56c424){try{if(!_[_0x1d3d('0x1e')](agents[_0x56c424[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x56c424);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x21'),_0x56c424[_0x1d3d('0x5')],agents[_0x56c424[_0x1d3d('0x17')]]['membername'],_0x56c424[_0x1d3d('0x17')]));agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswer']=!![];agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswerAt']=utils[_0x1d3d('0x1a')]();agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x23')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x24')]=_0x56c424[_0x1d3d('0x25')]?parseInt(_0x56c424[_0x1d3d('0x25')])/0x3e8:0x0;agents[_0x56c424['destuniqueid']][_0x1d3d('0x26')]=0x0;unanswered['push'](_0x56c424[_0x1d3d('0x17')]);}}catch(_0x2bcc2){utils['error'](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x2bcc2);}};exports[_0x1d3d('0x27')]=function(_0x4abbfc){try{_[_0x1d3d('0x28')](agents,function(_0x235ef3,_0x5d1b6c){if(_0x235ef3[_0x1d3d('0x5')]==_0x4abbfc['uniqueid']&&!_[_0x1d3d('0x29')](unanswered,_0x235ef3[_0x1d3d('0x17')])){utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc[_0x1d3d('0x5')]),_0x4abbfc);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2b'),_0x4abbfc[_0x1d3d('0x5')],_0x235ef3[_0x1d3d('0x8')],_0x235ef3[_0x1d3d('0x17')]));_0x235ef3['agentringnoanswer']=!![];_0x235ef3[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x235ef3[_0x1d3d('0xc')]=_0x1d3d('0x2d');_0x235ef3['reason']='abandoned';_0x235ef3[_0x1d3d('0x24')]=_0x4abbfc[_0x1d3d('0x24')];_0x235ef3['talktime']=0x0;writeDB(_0x235ef3);}});}catch(_0x43ef5d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc['uniqueid']),_0x43ef5d);}};exports['agentconnect']=function(_0x29fa6c){try{if(agents[_0x29fa6c['destuniqueid']]){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c[_0x1d3d('0x5')]),_0x29fa6c);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2f'),_0x29fa6c[_0x1d3d('0x5')],agents[_0x29fa6c['destuniqueid']][_0x1d3d('0x8')],_0x29fa6c['destuniqueid']));agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0x30')]=utils['now']();agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0xb')]=_0x29fa6c[_0x1d3d('0xb')];agents[_0x29fa6c[_0x1d3d('0x17')]]['connectedlinename']=_0x29fa6c['connectedlinename'];agents[_0x29fa6c[_0x1d3d('0x17')]]['holdtime']=_0x29fa6c[_0x1d3d('0x25')];agents[_0x29fa6c[_0x1d3d('0x17')]]['lastevent']=_0x1d3d('0x31');_[_0x1d3d('0x28')](agents,function(_0x51be79,_0x2d5015){if(_0x51be79[_0x1d3d('0x17')]!=_0x29fa6c[_0x1d3d('0x17')]&&_0x51be79[_0x1d3d('0x5')]==_0x29fa6c[_0x1d3d('0x5')]){_0x51be79[_0x1d3d('0x26')]=0x0;_0x51be79['holdtime']=_0x29fa6c[_0x1d3d('0x25')];_0x51be79[_0x1d3d('0x32')]=!![];_0x51be79[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x51be79[_0x1d3d('0xc')]='answered_elsewhere';_0x51be79[_0x1d3d('0x23')]=_0x1d3d('0x33');_0x51be79[_0x1d3d('0x34')]=_0x29fa6c[_0x1d3d('0x17')];_0x51be79['answeredelsewheremembername']=_0x29fa6c[_0x1d3d('0x8')];writeDB(_0x51be79);}});}}catch(_0x977ea8){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c['uniqueid']),_0x977ea8);}};exports['agentcomplete']=function(_0x229f48){try{if(!_[_0x1d3d('0x1e')](agents[_0x229f48[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')]('[%s][agents][agentcomplete]',_0x229f48[_0x1d3d('0x5')]),_0x229f48);utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x35'),_0x229f48[_0x1d3d('0x5')],agents[_0x229f48[_0x1d3d('0x17')]]['membername'],_0x229f48[_0x1d3d('0x17')]));agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x11')]=!![];agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x229f48[_0x1d3d('0x17')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x229f48['destuniqueid']][_0x1d3d('0x36')],agents[_0x229f48[_0x1d3d('0x17')]]['agentconnectAt']);agents[_0x229f48[_0x1d3d('0x17')]]['reason']=_0x229f48[_0x1d3d('0x23')];agents[_0x229f48['destuniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x38');writeDB(agents[_0x229f48[_0x1d3d('0x17')]]);}}catch(_0x25b547){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x39'),_0x229f48[_0x1d3d('0x5')]),_0x25b547);}};exports['blindtransfer']=function(_0x5899cc){try{if(!_['isNil'](agents[_0x5899cc[_0x1d3d('0x3a')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5899cc);utils[_0x1d3d('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5899cc['uniqueid'],agents[_0x5899cc['transfereruniqueid']][_0x1d3d('0x8')],agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')]));agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3c')]=!![];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3d')]=_0x1d3d('0x3e');agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3f')]=_0x5899cc[_0x1d3d('0x40')];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x41')]=agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')];}}catch(_0x5ce0d3){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5ce0d3);}};exports['attendedtransfer']=function(_0x41930f){try{utils['debug'](util['format'](_0x1d3d('0x42'),_0x41930f[_0x1d3d('0x43')]),_0x41930f);if(_0x41930f['origtransfereruniqueid']==_0x41930f[_0x1d3d('0x44')]){if(!_[_0x1d3d('0x1e')](agents[_0x41930f['secondtransfereruniqueid']])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x8')]));agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x46')]]['transfertype']=_0x1d3d('0x47');agents[_0x41930f['secondtransfereruniqueid']]['transferexten']=_0x41930f['origtransfererexten'];agents[_0x41930f['secondtransfereruniqueid']][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x43')];}if(_0x41930f[_0x1d3d('0x48')]&&agents[_0x41930f[_0x1d3d('0x48')]]){agents[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f['transfereeuniqueid']]=_[_0x1d3d('0x4a')](agents[_0x41930f[_0x1d3d('0x48')]]);transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0xa')]=agents[_0x41930f[_0x1d3d('0x46')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x4b')];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4c')]=utils['now']();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x24')]=0x0;transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x2;}}else if(_0x41930f['secondtransfereruniqueid']==_0x41930f[_0x1d3d('0x4d')]){if(!_['isNil'](agents[_0x41930f[_0x1d3d('0x43')]])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x8')]));agents[_0x41930f['origtransfereruniqueid']][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3d')]=_0x1d3d('0x47');agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3f')]=_0x41930f['secondtransfererexten'];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x46')];}if(_0x41930f[_0x1d3d('0x4e')]&&agents[_0x41930f[_0x1d3d('0x4e')]]){agents[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f[_0x1d3d('0x4e')]]=_[_0x1d3d('0x4a')](agents[_0x41930f['transfertargetuniqueid']]);transfers[_0x41930f[_0x1d3d('0x4e')]]['calleridnum']=agents[_0x41930f[_0x1d3d('0x43')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x43')]]['calleridname'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4c')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x4e')]]['holdtime']=0x0;transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x49')]=0x2;}}}catch(_0x37667d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][attendedtransfer]',_0x41930f[_0x1d3d('0x43')]),_0x37667d);}};exports[_0x1d3d('0x4f')]=function(_0x25f4e0){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x25f4e0);if(agents[_0x25f4e0[_0x1d3d('0x5')]]&&agents[_0x25f4e0[_0x1d3d('0x5')]]['reason']===_0x1d3d('0x22')){if(_0x25f4e0[_0x1d3d('0x51')]==='21'){agents[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x52');agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x52');}utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x25f4e0[_0x1d3d('0x5')],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(agents[_0x25f4e0[_0x1d3d('0x5')]]);var _0x4604cc=unanswered[_0x1d3d('0x53')](_0x25f4e0[_0x1d3d('0x5')]);if(_0x4604cc>-0x1){unanswered[_0x1d3d('0x54')](_0x4604cc,0x1);}}if(transfers[_0x25f4e0[_0x1d3d('0x5')]]){transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x11')]=!![];transfers[_0x25f4e0[_0x1d3d('0x5')]]['agentcompleteAt']=utils[_0x1d3d('0x1a')]();transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x26')]=utils['diffTime'](transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x30')]);transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x55');transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]='complete';utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(transfers[_0x25f4e0[_0x1d3d('0x5')]],!![]);}if(agents[_0x25f4e0['uniqueid']]&&agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]){agents[_0x25f4e0[_0x1d3d('0x5')]]['agentcomplete']=!![];agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x25f4e0[_0x1d3d('0x5')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]);agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x23')]=agents[_0x25f4e0['uniqueid']][_0x1d3d('0x3c')]?_0x1d3d('0x3c'):_0x1d3d('0x55');agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]=_0x1d3d('0x38');utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0[_0x1d3d('0x5')]]['lastevent']));writeDB(agents[_0x25f4e0['uniqueid']]);}}catch(_0x49d1e7){utils[_0x1d3d('0x1d')](util['format'](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x49d1e7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3980315..055ae56 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 _0xd8e0=['[%s][calls][hangup]','callerid','calleridname','endtime','duration','diffTime','starttime','billableseconds','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','value','source','xmd-phone','\x22\x20<','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','toLowerCase','set','startsWith','cdr','appdata','split','lastIndexOf','includes','noop','execif','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','OutgoingSpoolFailed','format','context','exten','calleridnum','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','toNumber','[%s][calls][newstate]','hangup'];(function(_0x162824,_0x4c8b6d){var _0x87b0a9=function(_0x242510){while(--_0x242510){_0x162824['push'](_0x162824['shift']());}};_0x87b0a9(++_0x4c8b6d);}(_0xd8e0,0x18e));var _0x0d8e=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xd8e0[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x0d8e('0x0'));var utils=require(_0x0d8e('0x1'));var transfers=require(_0x0d8e('0x2'));var dispositions=[_0x0d8e('0x3'),_0x0d8e('0x4'),_0x0d8e('0x4'),_0x0d8e('0x3'),_0x0d8e('0x3'),_0x0d8e('0x3'),_0x0d8e('0x5'),_0x0d8e('0x6'),_0x0d8e('0x4'),_0x0d8e('0x4'),_0x0d8e('0x4')];var channels={};function writeDB(_0x62c41b){var _0x2df0fc;if(transfers[_0x0d8e('0x7')][_0x62c41b[_0x0d8e('0x8')]]){_0x2df0fc=_0x62c41b[_0x0d8e('0x8')];_0x62c41b[_0x0d8e('0x8')]=transfers['blinds'][_0x62c41b[_0x0d8e('0x8')]][_0x0d8e('0x9')];}utils[_0x0d8e('0xa')](util['format'](_0x0d8e('0xb'),_0x62c41b[_0x0d8e('0x8')],_0x62c41b[_0x0d8e('0xc')],_0x62c41b[_0x0d8e('0xd')],_0x62c41b['membername'],_0x62c41b[_0x0d8e('0xe')],_0x62c41b['calleridnum'],_0x62c41b[_0x0d8e('0xf')],_0x62c41b[_0x0d8e('0x10')]));if(_0x62c41b['accountcode']){utils[_0x0d8e('0x11')](_0x62c41b[_0x0d8e('0x12')])[_0x0d8e('0x13')](function(_0x1b2185){if(_0x1b2185){_0x62c41b[_0x0d8e('0x14')]=_0x1b2185['id'];}utils['request']('CreateVoiceCallReport',_0x62c41b);});}else{utils[_0x0d8e('0x15')](_0x0d8e('0x16'),_0x62c41b);}if(channels[_0x62c41b[_0x0d8e('0x8')]]){delete channels[_0x62c41b[_0x0d8e('0x8')]];}else if(_0x2df0fc&&channels[_0x2df0fc]){delete transfers['blinds'][_0x2df0fc];delete channels[_0x2df0fc];}}exports[_0x0d8e('0x17')]=function(_0x1d09b1){try{utils[_0x0d8e('0x18')](util['format']('[%s][calls][newchannel]',_0x1d09b1[_0x0d8e('0x8')]),_0x1d09b1);if(_0x1d09b1[_0x0d8e('0x8')]==_0x1d09b1[_0x0d8e('0x19')]&&_0x1d09b1[_0x0d8e('0xc')]!=_0x0d8e('0x1a')){utils[_0x0d8e('0xa')](util[_0x0d8e('0x1b')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x1d09b1[_0x0d8e('0x8')],_0x1d09b1[_0x0d8e('0x1c')],_0x1d09b1[_0x0d8e('0x1d')]));channels[_0x1d09b1[_0x0d8e('0x8')]]={'uniqueid':_0x1d09b1[_0x0d8e('0x8')],'accountcode':_0x1d09b1[_0x0d8e('0x12')],'source':_0x1d09b1[_0x0d8e('0x1e')],'destination':_0x1d09b1[_0x0d8e('0x1d')],'destinationcontext':_0x1d09b1[_0x0d8e('0x1c')],'channel':_0x1d09b1[_0x0d8e('0xc')],'starttime':utils[_0x0d8e('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x0d8e('0x20')};}}catch(_0x144345){utils[_0x0d8e('0x21')](util['format'](_0x0d8e('0x22'),_0x1d09b1[_0x0d8e('0x8')]),_0x144345);}};exports[_0x0d8e('0x23')]=function(_0x37931f){try{utils[_0x0d8e('0x18')](util[_0x0d8e('0x1b')]('[%s][calls][newstate]',_0x37931f['uniqueid']),_0x37931f);if(!_[_0x0d8e('0x24')](channels[_0x37931f[_0x0d8e('0x8')]])&&_0x37931f[_0x0d8e('0x25')]==0x6){utils[_0x0d8e('0xa')](util['format'](_0x0d8e('0x26'),_0x37931f[_0x0d8e('0x8')],_0x37931f[_0x0d8e('0x1c')],_0x37931f[_0x0d8e('0xc')]));if(_[_0x0d8e('0x24')](channels[_0x37931f[_0x0d8e('0x8')]]['systemanswertime'])){channels[_0x37931f[_0x0d8e('0x8')]][_0x0d8e('0x27')]=utils[_0x0d8e('0x1f')]();}}else if(!_[_0x0d8e('0x24')](channels[_0x37931f[_0x0d8e('0x19')]])&&_0x37931f[_0x0d8e('0x25')]==0x6&&_0x37931f[_0x0d8e('0x1c')]!=_0x0d8e('0x28')){utils[_0x0d8e('0xa')](util['format'](_0x0d8e('0x29'),_0x37931f[_0x0d8e('0x8')],_0x37931f[_0x0d8e('0x19')],_0x37931f['context'],_0x37931f[_0x0d8e('0xc')]));channels[_0x37931f[_0x0d8e('0x19')]][_0x0d8e('0x12')]=_0x37931f[_0x0d8e('0x12')];channels[_0x37931f[_0x0d8e('0x19')]]['destinationchannel']=_0x37931f[_0x0d8e('0xc')];if(_[_0x0d8e('0x24')](channels[_0x37931f[_0x0d8e('0x19')]][_0x0d8e('0x2a')])){channels[_0x37931f[_0x0d8e('0x19')]][_0x0d8e('0x2a')]=utils[_0x0d8e('0x1f')]();}channels[_0x37931f[_0x0d8e('0x19')]]['disposition']=dispositions[_[_0x0d8e('0x2b')](_0x37931f['channelstate'])]||_0x0d8e('0x5');}}catch(_0xcd1bf1){utils[_0x0d8e('0x21')](util[_0x0d8e('0x1b')](_0x0d8e('0x2c'),_0x37931f['uniqueid']),_0xcd1bf1);}};exports[_0x0d8e('0x2d')]=function(_0x51f9eb){try{if(!_[_0x0d8e('0x24')](channels[_0x51f9eb[_0x0d8e('0x8')]])){utils['debug'](util[_0x0d8e('0x1b')](_0x0d8e('0x2e'),_0x51f9eb[_0x0d8e('0x8')]),_0x51f9eb);if(_[_0x0d8e('0x24')](channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x2f')])){channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x2f')]=_0x51f9eb[_0x0d8e('0x30')]+'\x20<'+_0x51f9eb[_0x0d8e('0x1e')]+'>';}utils[_0x0d8e('0xa')](util[_0x0d8e('0x1b')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x51f9eb[_0x0d8e('0x8')],channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x2f')],_0x51f9eb['cause-txt']));channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x31')]=utils[_0x0d8e('0x1f')]();channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x32')]=utils[_0x0d8e('0x33')](channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x31')],channels[_0x51f9eb['uniqueid']][_0x0d8e('0x34')]);channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x35')]=channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x2a')]?utils[_0x0d8e('0x33')](channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x31')],channels[_0x51f9eb[_0x0d8e('0x8')]][_0x0d8e('0x2a')]):0x0;writeDB(channels[_0x51f9eb[_0x0d8e('0x8')]]);}}catch(_0x4c3035){utils['error'](util[_0x0d8e('0x1b')](_0x0d8e('0x2e'),_0x51f9eb['uniqueid']),_0x4c3035);}};exports['attendedtransfer']=function(_0x3f80e2){try{if(!_[_0x0d8e('0x24')](channels[_0x3f80e2[_0x0d8e('0x36')]])){utils['debug'](util[_0x0d8e('0x1b')](_0x0d8e('0x37'),_0x3f80e2[_0x0d8e('0x38')]),_0x3f80e2);if(channels[_0x3f80e2['localtwolinkedid']][_0x0d8e('0xc')]==_0x3f80e2[_0x0d8e('0x39')]){utils[_0x0d8e('0xa')](util[_0x0d8e('0x1b')](_0x0d8e('0x3a'),_0x3f80e2['origtransfereruniqueid'],_0x3f80e2[_0x0d8e('0x36')],_0x3f80e2[_0x0d8e('0x3b')]));channels[_0x3f80e2[_0x0d8e('0x36')]][_0x0d8e('0x3c')]=_0x3f80e2[_0x0d8e('0x3b')];channels[_0x3f80e2[_0x0d8e('0x36')]][_0x0d8e('0x3d')]=_0x0d8e('0x3e');}else if(channels[_0x3f80e2['localtwolinkedid']][_0x0d8e('0xc')]=_0x3f80e2[_0x0d8e('0x3f')]){utils[_0x0d8e('0xa')](util[_0x0d8e('0x1b')](_0x0d8e('0x3a'),_0x3f80e2[_0x0d8e('0x38')],_0x3f80e2[_0x0d8e('0x36')],_0x3f80e2[_0x0d8e('0x40')]));channels[_0x3f80e2[_0x0d8e('0x36')]][_0x0d8e('0x3c')]=_0x3f80e2[_0x0d8e('0x40')];channels[_0x3f80e2[_0x0d8e('0x36')]][_0x0d8e('0x3d')]=_0x0d8e('0x3e');}}}catch(_0x4a727c){utils[_0x0d8e('0x21')](util[_0x0d8e('0x1b')](_0x0d8e('0x37'),_0x3f80e2['origtransfereruniqueid']),_0x4a727c);}};exports[_0x0d8e('0x41')]=function(_0x565a77){try{if(!_['isNil'](channels[_0x565a77[_0x0d8e('0x8')]])){utils[_0x0d8e('0x18')](util[_0x0d8e('0x1b')](_0x0d8e('0x42'),_0x565a77[_0x0d8e('0x8')]),_0x565a77);channels[_0x565a77[_0x0d8e('0x8')]][_0x0d8e('0x43')]=utils['now']();utils['info'](util[_0x0d8e('0x1b')](_0x0d8e('0x44'),_0x565a77[_0x0d8e('0x8')],channels[_0x565a77[_0x0d8e('0x8')]]['musiconholdstartAt']));}}catch(_0x141da7){utils[_0x0d8e('0x21')](util['format']('[%s][calls][musiconholdstart]',_0x565a77[_0x0d8e('0x8')]),_0x141da7);}};exports[_0x0d8e('0x45')]=function(_0x2332e6){try{if(!_[_0x0d8e('0x24')](channels[_0x2332e6[_0x0d8e('0x8')]])){utils[_0x0d8e('0x18')](util[_0x0d8e('0x1b')]('[%s][calls][musiconholdstop]',_0x2332e6[_0x0d8e('0x8')]),_0x2332e6);if(!_['isNil'](channels[_0x2332e6[_0x0d8e('0x8')]][_0x0d8e('0x43')])){channels[_0x2332e6[_0x0d8e('0x8')]][_0x0d8e('0x46')]+=utils[_0x0d8e('0x33')](utils[_0x0d8e('0x1f')](),channels[_0x2332e6[_0x0d8e('0x8')]][_0x0d8e('0x43')]);utils[_0x0d8e('0xa')](util['format'](_0x0d8e('0x47'),_0x2332e6[_0x0d8e('0x8')],channels[_0x2332e6[_0x0d8e('0x8')]][_0x0d8e('0x46')]));delete channels[_0x2332e6['uniqueid']][_0x0d8e('0x43')];}}}catch(_0x590fb0){utils[_0x0d8e('0x21')](util[_0x0d8e('0x1b')]('[%s][calls][musiconholdstop]',_0x2332e6['uniqueid']),_0x590fb0);}};exports[_0x0d8e('0x48')]=function(_0x703216){try{if(!_[_0x0d8e('0x24')](channels[_0x703216['uniqueid']])){utils[_0x0d8e('0x18')](util['format'](_0x0d8e('0x49'),_0x703216[_0x0d8e('0x8')]),_0x703216);if(!_[_0x0d8e('0x24')](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x4b')])){utils[_0x0d8e('0xa')](util[_0x0d8e('0x1b')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x703216[_0x0d8e('0x8')],_0x703216[_0x0d8e('0x4c')]));channels[_0x703216[_0x0d8e('0x8')]][_0x0d8e('0x4d')]=_0x703216[_0x0d8e('0x4c')];}if(!_[_0x0d8e('0x24')](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x4e')])){utils[_0x0d8e('0xa')](util['format']('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x703216[_0x0d8e('0x8')],_0x703216[_0x0d8e('0x4c')]));channels[_0x703216['uniqueid']]['destination']=_0x703216['value'];channels[_0x703216[_0x0d8e('0x8')]][_0x0d8e('0x2f')]='\x22'+_0x703216[_0x0d8e('0x4c')]+_0x0d8e('0x4f')+_0x703216[_0x0d8e('0x4c')]+'>';}if(!_['isNil'](_0x703216[_0x0d8e('0x4a')]['xmd-callerid-preview'])||!_[_0x0d8e('0x24')](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x50')])){utils['info'](util['format'](_0x0d8e('0x51'),_0x703216['uniqueid'],!_[_0x0d8e('0x24')](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x52')])?'xmd-callerid-preview':_0x0d8e('0x50'),_0x703216['value']));channels[_0x703216[_0x0d8e('0x8')]][_0x0d8e('0x2f')]=_0x703216['value'];}if(!_['isNil'](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x53')])||!_[_0x0d8e('0x24')](_0x703216[_0x0d8e('0x4a')]['xmcs-queue'])){utils[_0x0d8e('0xa')](util[_0x0d8e('0x1b')](_0x0d8e('0x51'),_0x703216[_0x0d8e('0x8')],!_[_0x0d8e('0x24')](_0x703216['variable']['xmd-queue'])?_0x0d8e('0x53'):_0x0d8e('0x54'),_0x703216[_0x0d8e('0x4c')]));channels[_0x703216['uniqueid']][_0x0d8e('0x55')]=_0x0d8e('0x56');channels[_0x703216['uniqueid']][_0x0d8e('0x57')]=_0x703216[_0x0d8e('0x4c')];channels[_0x703216[_0x0d8e('0x8')]]['queue']=!![];}if(!_['isNil'](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x58')])){utils[_0x0d8e('0xa')](util['format'](_0x0d8e('0x59'),_0x703216['uniqueid'],_0x703216[_0x0d8e('0x4c')]));channels[_0x703216['uniqueid']][_0x0d8e('0x5a')]=_0x703216['value'];}if(!_['isNil'](_0x703216['variable'][_0x0d8e('0x5b')])){utils['info'](util['format'](_0x0d8e('0x5c'),_0x703216[_0x0d8e('0x8')],_0x703216[_0x0d8e('0x4c')]));channels[_0x703216[_0x0d8e('0x8')]][_0x0d8e('0x5d')]=_0x703216[_0x0d8e('0x4c')];}if(!_['isNil'](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x5e')])){utils[_0x0d8e('0xa')](util['format'](_0x0d8e('0x5f'),_0x703216[_0x0d8e('0x8')],_0x703216['value']));channels[_0x703216[_0x0d8e('0x8')]][_0x0d8e('0x60')]=_0x703216[_0x0d8e('0x4c')];}if(!_[_0x0d8e('0x24')](_0x703216[_0x0d8e('0x4a')][_0x0d8e('0x61')])){utils[_0x0d8e('0xa')](util['format'](_0x0d8e('0x62'),_0x703216[_0x0d8e('0x8')],_0x703216['value']));channels[_0x703216[_0x0d8e('0x8')]][_0x0d8e('0x61')]=_0x703216[_0x0d8e('0x4c')];}}}catch(_0x1b1e8f){utils[_0x0d8e('0x21')](util[_0x0d8e('0x1b')](_0x0d8e('0x49'),_0x703216[_0x0d8e('0x8')]),_0x1b1e8f);}};exports[_0x0d8e('0x63')]=function(_0x314be1){try{if(!_[_0x0d8e('0x24')](channels[_0x314be1[_0x0d8e('0x8')]])){utils[_0x0d8e('0x18')](util[_0x0d8e('0x1b')]('[%s][calls][newexten]',_0x314be1[_0x0d8e('0x8')]),_0x314be1);utils[_0x0d8e('0xa')](util[_0x0d8e('0x1b')](_0x0d8e('0x64'),_0x314be1[_0x0d8e('0x8')],_0x314be1['application'],_0x314be1['appdata']));if(_0x314be1['application'][_0x0d8e('0x65')]()==_0x0d8e('0x66')&&_[_0x0d8e('0x67')](_0x314be1['appdata'][_0x0d8e('0x65')](),_0x0d8e('0x68'))){var _0x3359c5=_0x314be1[_0x0d8e('0x69')][_0x0d8e('0x6a')]('=');var _0x2188d6=_0x3359c5[0x0]['substring'](_0x3359c5[0x0]['lastIndexOf']('(')+0x1,_0x3359c5[0x0][_0x0d8e('0x6b')](')'));var _0x898c40=_0x3359c5[0x1];channels[_0x314be1[_0x0d8e('0x8')]][_0x2188d6]=_0x898c40;}if(!_[_0x0d8e('0x6c')]([_0x0d8e('0x2d'),_0x0d8e('0x6d'),_0x0d8e('0x6e'),_0x0d8e('0x66'),'gotoif'],_0x314be1['application']['toLowerCase']())){channels[_0x314be1[_0x0d8e('0x8')]][_0x0d8e('0x55')]=_0x314be1['application'];channels[_0x314be1['uniqueid']]['lastdata']=_0x314be1[_0x0d8e('0x69')];}}}catch(_0x3626af){utils[_0x0d8e('0x21')](util[_0x0d8e('0x1b')]('[%s][calls][newexten]',_0x314be1[_0x0d8e('0x8')]),_0x3626af);}}; \ No newline at end of file +var _0xa9aa=['[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','answertime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','source','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','appdata','cdr','split','substring','lastIndexOf','includes','noop','execif','set','gotoif','lodash','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','UserId','CreateVoiceCallReport','request','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','info','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','disposition','toNumber','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid'];(function(_0x508911,_0x54c10f){var _0x220e7f=function(_0x200dbd){while(--_0x200dbd){_0x508911['push'](_0x508911['shift']());}};_0x220e7f(++_0x54c10f);}(_0xa9aa,0xb2));var _0xaa9a=function(_0x6a579b,_0x3d8402){_0x6a579b=_0x6a579b-0x0;var _0x26f917=_0xa9aa[_0x6a579b];return _0x26f917;};'use strict';var _=require(_0xaa9a('0x0'));var util=require('util');var utils=require(_0xaa9a('0x1'));var transfers=require(_0xaa9a('0x2'));var dispositions=[_0xaa9a('0x3'),_0xaa9a('0x4'),'FAILED',_0xaa9a('0x3'),'NO\x20ANSWER','NO\x20ANSWER',_0xaa9a('0x5'),_0xaa9a('0x6'),_0xaa9a('0x4'),_0xaa9a('0x4'),_0xaa9a('0x4')];var channels={};function writeDB(_0xe98f2f){var _0x537607;if(transfers[_0xaa9a('0x7')][_0xe98f2f[_0xaa9a('0x8')]]){_0x537607=_0xe98f2f['uniqueid'];_0xe98f2f[_0xaa9a('0x8')]=transfers[_0xaa9a('0x7')][_0xe98f2f[_0xaa9a('0x8')]]['transfereeuniqueid'];}utils['info'](util[_0xaa9a('0x9')](_0xaa9a('0xa'),_0xe98f2f[_0xaa9a('0x8')],_0xe98f2f[_0xaa9a('0xb')],_0xe98f2f['queue'],_0xe98f2f[_0xaa9a('0xc')],_0xe98f2f[_0xaa9a('0xd')],_0xe98f2f[_0xaa9a('0xe')],_0xe98f2f[_0xaa9a('0xf')],_0xe98f2f[_0xaa9a('0x10')]));if(_0xe98f2f[_0xaa9a('0x11')]){utils[_0xaa9a('0x12')](_0xe98f2f[_0xaa9a('0x11')])['then'](function(_0x37f686){if(_0x37f686){_0xe98f2f[_0xaa9a('0x13')]=_0x37f686['id'];}utils['request'](_0xaa9a('0x14'),_0xe98f2f);});}else{utils[_0xaa9a('0x15')](_0xaa9a('0x14'),_0xe98f2f);}if(channels[_0xe98f2f[_0xaa9a('0x8')]]){delete channels[_0xe98f2f['uniqueid']];}else if(_0x537607&&channels[_0x537607]){delete transfers['blinds'][_0x537607];delete channels[_0x537607];}}exports['newchannel']=function(_0x39d0dc){try{utils['debug'](util['format'](_0xaa9a('0x16'),_0x39d0dc[_0xaa9a('0x8')]),_0x39d0dc);if(_0x39d0dc['uniqueid']==_0x39d0dc[_0xaa9a('0x17')]&&_0x39d0dc[_0xaa9a('0xb')]!=_0xaa9a('0x18')){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x1a'),_0x39d0dc[_0xaa9a('0x8')],_0x39d0dc[_0xaa9a('0x1b')],_0x39d0dc[_0xaa9a('0x1c')]));channels[_0x39d0dc[_0xaa9a('0x8')]]={'uniqueid':_0x39d0dc[_0xaa9a('0x8')],'accountcode':_0x39d0dc['accountcode'],'source':_0x39d0dc[_0xaa9a('0xe')],'destination':_0x39d0dc['exten'],'destinationcontext':_0x39d0dc[_0xaa9a('0x1b')],'channel':_0x39d0dc[_0xaa9a('0xb')],'starttime':utils[_0xaa9a('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaa9a('0x3'),'amaflags':_0xaa9a('0x1e')};}}catch(_0x5c8a1a){utils['error'](util[_0xaa9a('0x9')](_0xaa9a('0x16'),_0x39d0dc[_0xaa9a('0x8')]),_0x5c8a1a);}};exports[_0xaa9a('0x1f')]=function(_0x36923f){try{utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')]('[%s][calls][newstate]',_0x36923f[_0xaa9a('0x8')]),_0x36923f);if(!_[_0xaa9a('0x21')](channels[_0x36923f[_0xaa9a('0x8')]])&&_0x36923f[_0xaa9a('0x22')]==0x6){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x23'),_0x36923f[_0xaa9a('0x8')],_0x36923f['context'],_0x36923f[_0xaa9a('0xb')]));if(_['isNil'](channels[_0x36923f['uniqueid']][_0xaa9a('0x24')])){channels[_0x36923f[_0xaa9a('0x8')]]['systemanswertime']=utils[_0xaa9a('0x1d')]();}}else if(!_[_0xaa9a('0x21')](channels[_0x36923f[_0xaa9a('0x17')]])&&_0x36923f['channelstate']==0x6&&_0x36923f['context']!=_0xaa9a('0x25')){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x26'),_0x36923f[_0xaa9a('0x8')],_0x36923f['linkedid'],_0x36923f[_0xaa9a('0x1b')],_0x36923f['channel']));channels[_0x36923f[_0xaa9a('0x17')]][_0xaa9a('0x11')]=_0x36923f[_0xaa9a('0x11')];channels[_0x36923f[_0xaa9a('0x17')]]['destinationchannel']=_0x36923f[_0xaa9a('0xb')];if(_['isNil'](channels[_0x36923f[_0xaa9a('0x17')]]['answertime'])){channels[_0x36923f[_0xaa9a('0x17')]]['answertime']=utils['now']();}channels[_0x36923f[_0xaa9a('0x17')]][_0xaa9a('0x27')]=dispositions[_[_0xaa9a('0x28')](_0x36923f[_0xaa9a('0x22')])]||_0xaa9a('0x5');}}catch(_0x1b8b19){utils[_0xaa9a('0x29')](util[_0xaa9a('0x9')](_0xaa9a('0x2a'),_0x36923f['uniqueid']),_0x1b8b19);}};exports[_0xaa9a('0x2b')]=function(_0x502542){try{if(!_[_0xaa9a('0x21')](channels[_0x502542['uniqueid']])){utils[_0xaa9a('0x20')](util['format'](_0xaa9a('0x2c'),_0x502542[_0xaa9a('0x8')]),_0x502542);if(_[_0xaa9a('0x21')](channels[_0x502542[_0xaa9a('0x8')]]['callerid'])){channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x2d')]=_0x502542['calleridname']+'\x20<'+_0x502542[_0xaa9a('0xe')]+'>';}utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x2e'),_0x502542[_0xaa9a('0x8')],channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x2d')],_0x502542[_0xaa9a('0x2f')]));channels[_0x502542['uniqueid']][_0xaa9a('0x30')]=utils[_0xaa9a('0x1d')]();channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x31')]=utils[_0xaa9a('0x32')](channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x30')],channels[_0x502542['uniqueid']][_0xaa9a('0x33')]);channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x34')]=channels[_0x502542[_0xaa9a('0x8')]]['answertime']?utils[_0xaa9a('0x32')](channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x30')],channels[_0x502542[_0xaa9a('0x8')]][_0xaa9a('0x35')]):0x0;writeDB(channels[_0x502542[_0xaa9a('0x8')]]);}}catch(_0x323c0d){utils['error'](util['format']('[%s][calls][hangup]',_0x502542['uniqueid']),_0x323c0d);}};exports['attendedtransfer']=function(_0x4d8db3){try{if(!_[_0xaa9a('0x21')](channels[_0x4d8db3[_0xaa9a('0x36')]])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')](_0xaa9a('0x37'),_0x4d8db3[_0xaa9a('0x38')]),_0x4d8db3);if(channels[_0x4d8db3['localtwolinkedid']][_0xaa9a('0xb')]==_0x4d8db3['transfereechannel']){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x39'),_0x4d8db3['origtransfereruniqueid'],_0x4d8db3[_0xaa9a('0x36')],_0x4d8db3[_0xaa9a('0x3a')]));channels[_0x4d8db3['localtwolinkedid']][_0xaa9a('0x3b')]=_0x4d8db3['secondtransfererchannel'];channels[_0x4d8db3['localtwolinkedid']]['userfield']=_0xaa9a('0x3c');}else if(channels[_0x4d8db3['localtwolinkedid']]['channel']=_0x4d8db3[_0xaa9a('0x3d')]){utils[_0xaa9a('0x19')](util['format'](_0xaa9a('0x39'),_0x4d8db3[_0xaa9a('0x38')],_0x4d8db3['localtwolinkedid'],_0x4d8db3[_0xaa9a('0x3e')]));channels[_0x4d8db3[_0xaa9a('0x36')]]['destinationchannel']=_0x4d8db3[_0xaa9a('0x3e')];channels[_0x4d8db3['localtwolinkedid']][_0xaa9a('0x3f')]='_attended';}}}catch(_0x521a55){utils[_0xaa9a('0x29')](util[_0xaa9a('0x9')](_0xaa9a('0x37'),_0x4d8db3[_0xaa9a('0x38')]),_0x521a55);}};exports['musiconholdstart']=function(_0x591840){try{if(!_[_0xaa9a('0x21')](channels[_0x591840['uniqueid']])){utils['debug'](util[_0xaa9a('0x9')](_0xaa9a('0x40'),_0x591840[_0xaa9a('0x8')]),_0x591840);channels[_0x591840[_0xaa9a('0x8')]][_0xaa9a('0x41')]=utils[_0xaa9a('0x1d')]();utils[_0xaa9a('0x19')](util['format'](_0xaa9a('0x42'),_0x591840[_0xaa9a('0x8')],channels[_0x591840[_0xaa9a('0x8')]]['musiconholdstartAt']));}}catch(_0x3a7a92){utils[_0xaa9a('0x29')](util['format'](_0xaa9a('0x40'),_0x591840['uniqueid']),_0x3a7a92);}};exports[_0xaa9a('0x43')]=function(_0x286d29){try{if(!_[_0xaa9a('0x21')](channels[_0x286d29['uniqueid']])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')](_0xaa9a('0x44'),_0x286d29[_0xaa9a('0x8')]),_0x286d29);if(!_[_0xaa9a('0x21')](channels[_0x286d29[_0xaa9a('0x8')]][_0xaa9a('0x41')])){channels[_0x286d29[_0xaa9a('0x8')]][_0xaa9a('0x45')]+=utils['diffTime'](utils[_0xaa9a('0x1d')](),channels[_0x286d29['uniqueid']]['musiconholdstartAt']);utils[_0xaa9a('0x19')](util['format'](_0xaa9a('0x46'),_0x286d29[_0xaa9a('0x8')],channels[_0x286d29[_0xaa9a('0x8')]]['mohtime']));delete channels[_0x286d29[_0xaa9a('0x8')]]['musiconholdstartAt'];}}}catch(_0x5b7f9d){utils[_0xaa9a('0x29')](util[_0xaa9a('0x9')](_0xaa9a('0x44'),_0x286d29[_0xaa9a('0x8')]),_0x5b7f9d);}};exports[_0xaa9a('0x47')]=function(_0x510264){try{if(!_[_0xaa9a('0x21')](channels[_0x510264[_0xaa9a('0x8')]])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')]('[%s][calls][varset]',_0x510264[_0xaa9a('0x8')]),_0x510264);if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x49')])){utils[_0xaa9a('0x19')](util['format']('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x510264[_0xaa9a('0x8')],_0x510264['value']));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x4a')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x4c')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x510264['uniqueid'],_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x4d')]=_0x510264[_0xaa9a('0x4b')];channels[_0x510264[_0xaa9a('0x8')]]['callerid']='\x22'+_0x510264[_0xaa9a('0x4b')]+_0xaa9a('0x4e')+_0x510264[_0xaa9a('0x4b')]+'>';}if(!_['isNil'](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x4f')])||!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x50')])){utils['info'](util['format'](_0xaa9a('0x51'),_0x510264[_0xaa9a('0x8')],!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')]['xmd-callerid-preview'])?_0xaa9a('0x4f'):_0xaa9a('0x50'),_0x510264['value']));channels[_0x510264['uniqueid']][_0xaa9a('0x2d')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x52')])||!_['isNil'](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x53')])){utils['info'](util['format'](_0xaa9a('0x51'),_0x510264[_0xaa9a('0x8')],!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')]['xmd-queue'])?_0xaa9a('0x52'):'xmcs-queue',_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x54')]=_0xaa9a('0x55');channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x56')]=_0x510264[_0xaa9a('0x4b')];channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x57')]=!![];}if(!_[_0xaa9a('0x21')](_0x510264[_0xaa9a('0x48')][_0xaa9a('0x58')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x59'),_0x510264[_0xaa9a('0x8')],_0x510264['value']));channels[_0x510264['uniqueid']][_0xaa9a('0x5a')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264['variable'][_0xaa9a('0x5b')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x5c'),_0x510264[_0xaa9a('0x8')],_0x510264['value']));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x5d')]=_0x510264[_0xaa9a('0x4b')];}if(!_[_0xaa9a('0x21')](_0x510264['variable'][_0xaa9a('0x5e')])){utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x5f'),_0x510264[_0xaa9a('0x8')],_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]]['routeid']=_0x510264[_0xaa9a('0x4b')];}if(!_['isNil'](_0x510264[_0xaa9a('0x48')]['sipcallid'])){utils[_0xaa9a('0x19')](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x510264['uniqueid'],_0x510264[_0xaa9a('0x4b')]));channels[_0x510264[_0xaa9a('0x8')]][_0xaa9a('0x60')]=_0x510264[_0xaa9a('0x4b')];}}}catch(_0x2a99d5){utils[_0xaa9a('0x29')](util['format']('[%s][calls][varset]',_0x510264[_0xaa9a('0x8')]),_0x2a99d5);}};exports[_0xaa9a('0x61')]=function(_0x2f7253){try{if(!_['isNil'](channels[_0x2f7253[_0xaa9a('0x8')]])){utils[_0xaa9a('0x20')](util[_0xaa9a('0x9')](_0xaa9a('0x62'),_0x2f7253[_0xaa9a('0x8')]),_0x2f7253);utils[_0xaa9a('0x19')](util[_0xaa9a('0x9')](_0xaa9a('0x63'),_0x2f7253[_0xaa9a('0x8')],_0x2f7253[_0xaa9a('0x64')],_0x2f7253['appdata']));if(_0x2f7253['application'][_0xaa9a('0x65')]()=='set'&&_['startsWith'](_0x2f7253[_0xaa9a('0x66')][_0xaa9a('0x65')](),_0xaa9a('0x67'))){var _0x224f99=_0x2f7253[_0xaa9a('0x66')][_0xaa9a('0x68')]('=');var _0xa6b81a=_0x224f99[0x0][_0xaa9a('0x69')](_0x224f99[0x0][_0xaa9a('0x6a')]('(')+0x1,_0x224f99[0x0]['lastIndexOf'](')'));var _0x3c5ff2=_0x224f99[0x1];channels[_0x2f7253[_0xaa9a('0x8')]][_0xa6b81a]=_0x3c5ff2;}if(!_[_0xaa9a('0x6b')]([_0xaa9a('0x2b'),_0xaa9a('0x6c'),_0xaa9a('0x6d'),_0xaa9a('0x6e'),_0xaa9a('0x6f')],_0x2f7253[_0xaa9a('0x64')][_0xaa9a('0x65')]())){channels[_0x2f7253[_0xaa9a('0x8')]]['lastapplication']=_0x2f7253[_0xaa9a('0x64')];channels[_0x2f7253['uniqueid']][_0xaa9a('0x56')]=_0x2f7253['appdata'];}}}catch(_0x26c97a){utils[_0xaa9a('0x29')](util['format'](_0xaa9a('0x62'),_0x2f7253['uniqueid']),_0x26c97a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 0259db4..3378777 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 _0xb762=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x47ca72,_0x50cb51){var _0x2cf9e4=function(_0x37d425){while(--_0x37d425){_0x47ca72['push'](_0x47ca72['shift']());}};_0x2cf9e4(++_0x50cb51);}(_0xb762,0x175));var _0x2b76=function(_0xb684b0,_0x297d83){_0xb684b0=_0xb684b0-0x0;var _0x4cf57c=_0xb762[_0xb684b0];return _0x4cf57c;};'use strict';var utils=require(_0x2b76('0x0'));exports[_0x2b76('0x1')]=function(){utils[_0x2b76('0x2')](_0x2b76('0x3'));};exports[_0x2b76('0x4')]=function(){utils[_0x2b76('0x2')]('[core]\x20shutdown');};exports[_0x2b76('0x5')]=function(){utils[_0x2b76('0x2')](_0x2b76('0x6'));};exports['error']=function(_0x39c784){utils[_0x2b76('0x7')](_0x2b76('0x8'),_0x39c784);};exports[_0x2b76('0x9')]=function(){utils[_0x2b76('0x2')](_0x2b76('0xa'));};exports[_0x2b76('0xb')]=function(_0x1b14b5){}; \ No newline at end of file +var _0x13f5=['error','[core]\x20error','close','[core]\x20close','connect','info','[core]\x20connected','shutdown','[core]\x20fullybooted'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0x13f5,0x16c));var _0x513f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x13f5[_0x122ef9];return _0x42fba0;};'use strict';var utils=require('./utils');exports[_0x513f('0x0')]=function(){utils[_0x513f('0x1')](_0x513f('0x2'));};exports[_0x513f('0x3')]=function(){utils[_0x513f('0x1')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0x513f('0x1')](_0x513f('0x4'));};exports[_0x513f('0x5')]=function(_0x3062e4){utils['error'](_0x513f('0x6'),_0x3062e4);};exports[_0x513f('0x7')]=function(){utils[_0x513f('0x1')](_0x513f('0x8'));};exports['managerevent']=function(_0xfac421){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index e1dcbe7..76039d7 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 _0x4d83=['uniqueid','channel','dialstring','calleridnum','connectedlinenum','request','CreateVoiceDialReport','debug','[%s][dials][newexten]','info','application','appdata','toLowerCase','startsWith','varset','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','answertime','lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','diffTime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s'];(function(_0x48b24f,_0x565ddc){var _0xf03650=function(_0x472691){while(--_0x472691){_0x48b24f['push'](_0x48b24f['shift']());}};_0xf03650(++_0x565ddc);}(_0x4d83,0xeb));var _0x34d8=function(_0x15d9b4,_0x427b76){_0x15d9b4=_0x15d9b4-0x0;var _0x25543e=_0x4d83[_0x15d9b4];return _0x25543e;};'use strict';var _=require(_0x34d8('0x0'));var util=require(_0x34d8('0x1'));var utils=require(_0x34d8('0x2'));var dials={};function writeDB(_0x2d4fcc){utils['info'](util[_0x34d8('0x3')](_0x34d8('0x4'),_0x2d4fcc[_0x34d8('0x5')],_0x2d4fcc[_0x34d8('0x6')],_0x2d4fcc[_0x34d8('0x7')],_0x2d4fcc[_0x34d8('0x8')],_0x2d4fcc[_0x34d8('0x9')],_0x2d4fcc['dialstatus']));utils[_0x34d8('0xa')](_0x34d8('0xb'),_0x2d4fcc);delete dials[_0x2d4fcc['uniqueid']];}exports['newexten']=function(_0x2d89d){try{utils[_0x34d8('0xc')](util[_0x34d8('0x3')](_0x34d8('0xd'),_0x2d89d[_0x34d8('0x5')]),_0x2d89d);utils[_0x34d8('0xe')](util[_0x34d8('0x3')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x2d89d[_0x34d8('0x5')],_0x2d89d[_0x34d8('0xf')],_0x2d89d[_0x34d8('0x10')]));if(_0x2d89d[_0x34d8('0xf')][_0x34d8('0x11')]()=='set'&&_[_0x34d8('0x12')](_0x2d89d[_0x34d8('0x10')]['toLowerCase'](),'cdr(routeid)')){var _0xc711c4=_0x2d89d['appdata']['split']('=');dials[_0x2d89d[_0x34d8('0x5')]]={'routeId':_0xc711c4[0x1]};}}catch(_0x160a5c){utils['error'](util['format'](_0x34d8('0xd'),_0x2d89d[_0x34d8('0x5')]),_0x160a5c);}};exports[_0x34d8('0x13')]=function(_0x3ca5fb){try{utils[_0x34d8('0xc')](util[_0x34d8('0x3')](_0x34d8('0x14'),_0x3ca5fb[_0x34d8('0x5')]),_0x3ca5fb);if(!_[_0x34d8('0x15')](_0x3ca5fb['variable'][_0x34d8('0x16')])){utils[_0x34d8('0xe')](util['format'](_0x34d8('0x17'),_0x3ca5fb[_0x34d8('0x5')],_0x3ca5fb['value']));dials[_0x3ca5fb[_0x34d8('0x5')]]={'routeId':_0x3ca5fb[_0x34d8('0x18')]};}}catch(_0xcf371f){utils[_0x34d8('0x19')](util[_0x34d8('0x3')]('[%s][dials][varset]',_0x3ca5fb[_0x34d8('0x5')]),_0xcf371f);}};exports[_0x34d8('0x1a')]=function(_0x1bb3bc){try{if(!_[_0x34d8('0x15')](dials[_0x1bb3bc[_0x34d8('0x5')]])){utils[_0x34d8('0xc')](util['format'](_0x34d8('0x1b'),_0x1bb3bc[_0x34d8('0x5')]),_0x1bb3bc);dials[_0x1bb3bc[_0x34d8('0x5')]]=_[_0x34d8('0x1c')](dials[_0x1bb3bc[_0x34d8('0x5')]],_0x1bb3bc);dials[_0x1bb3bc[_0x34d8('0x5')]][_0x34d8('0x1d')]=utils[_0x34d8('0x1e')]();dials[_0x1bb3bc[_0x34d8('0x5')]]['lastevent']='called';utils['info'](util[_0x34d8('0x3')](_0x34d8('0x1f'),_0x1bb3bc['uniqueid'],dials[_0x1bb3bc[_0x34d8('0x5')]][_0x34d8('0x1d')]));}}catch(_0x437c61){utils[_0x34d8('0x19')](util[_0x34d8('0x3')]('[%s][dials][dialbegin]',_0x1bb3bc[_0x34d8('0x5')]),_0x437c61);}};exports[_0x34d8('0x20')]=function(_0x4f12b4){try{if(!_[_0x34d8('0x15')](dials[_0x4f12b4[_0x34d8('0x5')]])){utils[_0x34d8('0xc')](util[_0x34d8('0x3')](_0x34d8('0x21'),_0x4f12b4['uniqueid']),_0x4f12b4);dials[_0x4f12b4[_0x34d8('0x5')]]['dialstatus']=_0x4f12b4[_0x34d8('0x22')];if(_0x4f12b4[_0x34d8('0x22')]==_0x34d8('0x23')){dials[_0x4f12b4['uniqueid']]=_[_0x34d8('0x1c')](dials[_0x4f12b4[_0x34d8('0x5')]],_0x4f12b4);dials[_0x4f12b4[_0x34d8('0x5')]][_0x34d8('0x24')]=utils[_0x34d8('0x1e')]();dials[_0x4f12b4[_0x34d8('0x5')]][_0x34d8('0x25')]=_0x34d8('0x26');utils[_0x34d8('0xe')](util[_0x34d8('0x3')](_0x34d8('0x27'),_0x4f12b4[_0x34d8('0x5')],_0x4f12b4[_0x34d8('0x22')],dials[_0x4f12b4[_0x34d8('0x5')]]['answertime']));}else{utils[_0x34d8('0xe')](util['format'](_0x34d8('0x28'),_0x4f12b4[_0x34d8('0x5')],_0x4f12b4[_0x34d8('0x22')]));}}}catch(_0x48dfbb){utils[_0x34d8('0x19')](util['format'](_0x34d8('0x21'),_0x4f12b4[_0x34d8('0x5')]),_0x48dfbb);}};exports[_0x34d8('0x29')]=function(_0x1884ba){try{if(!_['isNil'](dials[_0x1884ba[_0x34d8('0x5')]])){utils[_0x34d8('0xc')](util['format'](_0x34d8('0x2a'),_0x1884ba[_0x34d8('0x5')]),_0x1884ba);utils[_0x34d8('0xe')](util[_0x34d8('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1884ba['uniqueid'],_0x1884ba[_0x34d8('0x8')],_0x1884ba[_0x34d8('0x2b')],_0x1884ba[_0x34d8('0x2c')]));dials[_0x1884ba[_0x34d8('0x5')]]=_[_0x34d8('0x1c')](dials[_0x1884ba['uniqueid']],{'endtime':utils[_0x34d8('0x1e')](),'lastevent':'complete'});dials[_0x1884ba['uniqueid']]['duration']=utils[_0x34d8('0x2d')](dials[_0x1884ba[_0x34d8('0x5')]]['endtime'],dials[_0x1884ba['uniqueid']][_0x34d8('0x1d')]);dials[_0x1884ba['uniqueid']][_0x34d8('0x2e')]=utils[_0x34d8('0x2d')](dials[_0x1884ba[_0x34d8('0x5')]][_0x34d8('0x24')]||dials[_0x1884ba[_0x34d8('0x5')]]['endtime'],dials[_0x1884ba[_0x34d8('0x5')]]['starttime']);dials[_0x1884ba['uniqueid']][_0x34d8('0x2f')]=dials[_0x1884ba[_0x34d8('0x5')]][_0x34d8('0x24')]?utils['diffTime'](dials[_0x1884ba[_0x34d8('0x5')]]['endtime'],dials[_0x1884ba['uniqueid']]['answertime']):0x0;writeDB(dials[_0x1884ba[_0x34d8('0x5')]]);}}catch(_0x1b51ec){utils[_0x34d8('0x19')](util['format'](_0x34d8('0x2a'),_0x1884ba[_0x34d8('0x5')]),_0x1b51ec);}}; \ No newline at end of file +var _0x44d7=['toLowerCase','split','error','varset','debug','[%s][dials][varset]','isNil','variable','outboundrouteid','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','lastevent','dialend','[%s][dials][dialend]','ANSWER','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','endtime','billableseconds','diffTime','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','[%s][dials][newexten]','application','appdata','startsWith'];(function(_0x9729d7,_0x1b79a8){var _0x3c4ac6=function(_0x401ba6){while(--_0x401ba6){_0x9729d7['push'](_0x9729d7['shift']());}};_0x3c4ac6(++_0x1b79a8);}(_0x44d7,0x7b));var _0x744d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x44d7[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require(_0x744d('0x0'));var utils=require(_0x744d('0x1'));var dials={};function writeDB(_0x4a6431){utils['info'](util[_0x744d('0x2')](_0x744d('0x3'),_0x4a6431[_0x744d('0x4')],_0x4a6431['channel'],_0x4a6431[_0x744d('0x5')],_0x4a6431[_0x744d('0x6')],_0x4a6431[_0x744d('0x7')],_0x4a6431[_0x744d('0x8')]));utils[_0x744d('0x9')](_0x744d('0xa'),_0x4a6431);delete dials[_0x4a6431[_0x744d('0x4')]];}exports['newexten']=function(_0x21f0cd){try{utils['debug'](util[_0x744d('0x2')](_0x744d('0xb'),_0x21f0cd[_0x744d('0x4')]),_0x21f0cd);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x21f0cd[_0x744d('0x4')],_0x21f0cd[_0x744d('0xc')],_0x21f0cd[_0x744d('0xd')]));if(_0x21f0cd['application']['toLowerCase']()=='set'&&_[_0x744d('0xe')](_0x21f0cd[_0x744d('0xd')][_0x744d('0xf')](),'cdr(routeid)')){var _0x3a1be4=_0x21f0cd[_0x744d('0xd')][_0x744d('0x10')]('=');dials[_0x21f0cd['uniqueid']]={'routeId':_0x3a1be4[0x1]};}}catch(_0x59a312){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0xb'),_0x21f0cd[_0x744d('0x4')]),_0x59a312);}};exports[_0x744d('0x12')]=function(_0x5e6405){try{utils[_0x744d('0x13')](util['format'](_0x744d('0x14'),_0x5e6405[_0x744d('0x4')]),_0x5e6405);if(!_[_0x744d('0x15')](_0x5e6405[_0x744d('0x16')][_0x744d('0x17')])){utils[_0x744d('0x18')](util[_0x744d('0x2')](_0x744d('0x19'),_0x5e6405[_0x744d('0x4')],_0x5e6405[_0x744d('0x1a')]));dials[_0x5e6405[_0x744d('0x4')]]={'routeId':_0x5e6405[_0x744d('0x1a')]};}}catch(_0x210797){utils[_0x744d('0x11')](util['format']('[%s][dials][varset]',_0x5e6405[_0x744d('0x4')]),_0x210797);}};exports['dialbegin']=function(_0x4de6af){try{if(!_[_0x744d('0x15')](dials[_0x4de6af[_0x744d('0x4')]])){utils['debug'](util[_0x744d('0x2')](_0x744d('0x1b'),_0x4de6af[_0x744d('0x4')]),_0x4de6af);dials[_0x4de6af['uniqueid']]=_[_0x744d('0x1c')](dials[_0x4de6af['uniqueid']],_0x4de6af);dials[_0x4de6af[_0x744d('0x4')]][_0x744d('0x1d')]=utils[_0x744d('0x1e')]();dials[_0x4de6af['uniqueid']][_0x744d('0x1f')]='called';utils[_0x744d('0x18')](util[_0x744d('0x2')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4de6af['uniqueid'],dials[_0x4de6af[_0x744d('0x4')]][_0x744d('0x1d')]));}}catch(_0x4e7a81){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0x1b'),_0x4de6af['uniqueid']),_0x4e7a81);}};exports[_0x744d('0x20')]=function(_0x19631f){try{if(!_[_0x744d('0x15')](dials[_0x19631f[_0x744d('0x4')]])){utils[_0x744d('0x13')](util[_0x744d('0x2')](_0x744d('0x21'),_0x19631f['uniqueid']),_0x19631f);dials[_0x19631f[_0x744d('0x4')]][_0x744d('0x8')]=_0x19631f[_0x744d('0x8')];if(_0x19631f[_0x744d('0x8')]==_0x744d('0x22')){dials[_0x19631f[_0x744d('0x4')]]=_[_0x744d('0x1c')](dials[_0x19631f['uniqueid']],_0x19631f);dials[_0x19631f[_0x744d('0x4')]]['answertime']=utils[_0x744d('0x1e')]();dials[_0x19631f[_0x744d('0x4')]]['lastevent']=_0x744d('0x23');utils[_0x744d('0x18')](util[_0x744d('0x2')](_0x744d('0x24'),_0x19631f[_0x744d('0x4')],_0x19631f['dialstatus'],dials[_0x19631f[_0x744d('0x4')]][_0x744d('0x25')]));}else{utils[_0x744d('0x18')](util[_0x744d('0x2')](_0x744d('0x26'),_0x19631f[_0x744d('0x4')],_0x19631f[_0x744d('0x8')]));}}}catch(_0x3819c0){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0x21'),_0x19631f['uniqueid']),_0x3819c0);}};exports['hangup']=function(_0x36bd9e){try{if(!_[_0x744d('0x15')](dials[_0x36bd9e[_0x744d('0x4')]])){utils['debug'](util[_0x744d('0x2')](_0x744d('0x27'),_0x36bd9e['uniqueid']),_0x36bd9e);utils['info'](util[_0x744d('0x2')](_0x744d('0x28'),_0x36bd9e[_0x744d('0x4')],_0x36bd9e['calleridnum'],_0x36bd9e[_0x744d('0x29')],_0x36bd9e['cause-txt']));dials[_0x36bd9e[_0x744d('0x4')]]=_[_0x744d('0x1c')](dials[_0x36bd9e[_0x744d('0x4')]],{'endtime':utils[_0x744d('0x1e')](),'lastevent':_0x744d('0x2a')});dials[_0x36bd9e[_0x744d('0x4')]]['duration']=utils['diffTime'](dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2b')],dials[_0x36bd9e['uniqueid']][_0x744d('0x1d')]);dials[_0x36bd9e['uniqueid']]['holdtime']=utils['diffTime'](dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x25')]||dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2b')],dials[_0x36bd9e[_0x744d('0x4')]]['starttime']);dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2c')]=dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x25')]?utils[_0x744d('0x2d')](dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x2b')],dials[_0x36bd9e[_0x744d('0x4')]][_0x744d('0x25')]):0x0;writeDB(dials[_0x36bd9e[_0x744d('0x4')]]);}}catch(_0x30d2c1){utils[_0x744d('0x11')](util[_0x744d('0x2')](_0x744d('0x27'),_0x36bd9e[_0x744d('0x4')]),_0x30d2c1);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 04fe7f4..8626d9c 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 _0x087b=['agentringnoanswer','debug','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','port','asterisk','username','password','xdr','disabled','info','XDR\x20DISABLED','./queues.controller','./recordings.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid'];(function(_0x53e878,_0x1db5f6){var _0x23d950=function(_0x1accd7){while(--_0x1accd7){_0x53e878['push'](_0x53e878['shift']());}};_0x23d950(++_0x1db5f6);}(_0x087b,0x1a5));var _0xb087=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x087b[_0x1deb03];return _0x189fe7;};var AsteriskManager=require(_0xb087('0x0'));var config=require(_0xb087('0x1'));var utils=require(_0xb087('0x2'));var util=require('util');var ami=new AsteriskManager(config['asterisk'][_0xb087('0x3')],config[_0xb087('0x4')]['ip'],config[_0xb087('0x4')][_0xb087('0x5')],config[_0xb087('0x4')][_0xb087('0x6')],!![]);ami['keepConnected']();if(config[_0xb087('0x7')]&&config[_0xb087('0x7')][_0xb087('0x8')]){utils[_0xb087('0x9')](_0xb087('0xa'));}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0xb087('0xb'));var recordings=require(_0xb087('0xc'));var members=require(_0xb087('0xd'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xb087('0xe'));ami['on'](_0xb087('0xf'),core[_0xb087('0xf')]);ami['on'](_0xb087('0x10'),core[_0xb087('0x10')]);ami['on']('fullybooted',core[_0xb087('0x11')]);ami['on'](_0xb087('0x12'),core[_0xb087('0x12')]);ami['on'](_0xb087('0x13'),core['close']);ami['on']('managerevent',core['managerevent']);ami['on'](_0xb087('0x14'),function(_0x3a8756){try{utils['debug'](util[_0xb087('0x15')](_0xb087('0x16'),_0x3a8756[_0xb087('0x17')]),_0x3a8756);members['devicestatechange'](_0x3a8756);}catch(_0xc1157d){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x16'),_0x3a8756['device']),_0xc1157d);}});ami['on'](_0xb087('0x18'),function(_0x2eec22){try{utils['debug'](util[_0xb087('0x15')](_0xb087('0x19'),_0x2eec22[_0xb087('0x1a')]),_0x2eec22);agents[_0xb087('0x18')](_0x2eec22);}catch(_0x176a35){utils['error'](util[_0xb087('0x15')]('[%s][index][agentcalled]',_0x2eec22[_0xb087('0x1a')]),_0x176a35);}});ami['on'](_0xb087('0x1b'),function(_0x1b5a59){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')]('[%s][index][agentringnoanswer]',_0x1b5a59[_0xb087('0x1a')]),_0x1b5a59);agents[_0xb087('0x1b')](_0x1b5a59);}catch(_0x4a38f6){utils['error'](util['format'](_0xb087('0x1d'),_0x1b5a59['uniqueid']),_0x4a38f6);}});ami['on'](_0xb087('0x1e'),function(_0x249b99){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')](_0xb087('0x1f'),_0x249b99[_0xb087('0x1a')]),_0x249b99);agents[_0xb087('0x1e')](_0x249b99);queues['agentconnect'](_0x249b99);}catch(_0x5916d0){utils['error'](util['format']('[%s][index][agentconnect]',_0x249b99['uniqueid']),_0x5916d0);}});ami['on'](_0xb087('0x20'),function(_0x1a4da8){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')](_0xb087('0x21'),_0x1a4da8[_0xb087('0x1a')]),_0x1a4da8);agents[_0xb087('0x20')](_0x1a4da8);queues['agentcomplete'](_0x1a4da8);members[_0xb087('0x20')](_0x1a4da8);}catch(_0x1b90cd){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x21'),_0x1a4da8['uniqueid']),_0x1b90cd);}});ami['on'](_0xb087('0x22'),function(_0x116cb6){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')](_0xb087('0x23'),_0x116cb6[_0xb087('0x1a')]),_0x116cb6);agents[_0xb087('0x22')](_0x116cb6);queues['queuecallerabandon'](_0x116cb6);}catch(_0x2ab404){utils[_0xb087('0x12')](util[_0xb087('0x15')]('[%s][index][queuecallerabandon]',_0x116cb6[_0xb087('0x1a')]),_0x2ab404);}});ami['on'](_0xb087('0x24'),function(_0x3e264c){try{utils[_0xb087('0x1c')](util['format'](_0xb087('0x25'),_0x3e264c[_0xb087('0x1a')]),_0x3e264c);queues[_0xb087('0x24')](_0x3e264c);recordings[_0xb087('0x24')](_0x3e264c);}catch(_0x17a0a5){utils['error'](util[_0xb087('0x15')](_0xb087('0x25'),_0x3e264c[_0xb087('0x1a')]),_0x17a0a5);}});ami['on'](_0xb087('0x26'),function(_0x27f21a){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')](_0xb087('0x27'),_0x27f21a[_0xb087('0x1a')]),_0x27f21a);queues[_0xb087('0x26')](_0x27f21a);}catch(_0x3fa589){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x27'),_0x27f21a[_0xb087('0x1a')]),_0x3fa589);}});ami['on'](_0xb087('0x28'),function(_0xcd122){try{utils['debug'](util[_0xb087('0x15')](_0xb087('0x29'),_0xcd122['uniqueid']),_0xcd122);queues['musiconholdstart'](_0xcd122);calls['musiconholdstart'](_0xcd122);}catch(_0x5c3bcc){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x29'),_0xcd122['uniqueid']),_0x5c3bcc);}});ami['on'](_0xb087('0x2a'),function(_0x411440){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')](_0xb087('0x2b'),_0x411440[_0xb087('0x1a')]),_0x411440);queues['musiconholdstop'](_0x411440);calls[_0xb087('0x2a')](_0x411440);}catch(_0x2dce63){utils[_0xb087('0x12')](util[_0xb087('0x15')]('[%s][index][musiconholdstop]',_0x411440[_0xb087('0x1a')]),_0x2dce63);}});ami['on']('newstate',function(_0x180d7f){try{utils[_0xb087('0x1c')](util['format'](_0xb087('0x2c'),_0x180d7f[_0xb087('0x1a')]),_0x180d7f);calls[_0xb087('0x2d')](_0x180d7f);recordings[_0xb087('0x2d')](_0x180d7f);}catch(_0x339869){utils[_0xb087('0x12')](util['format'](_0xb087('0x2c'),_0x180d7f[_0xb087('0x1a')]),_0x339869);}});ami['on'](_0xb087('0x2e'),function(_0x3dcaaa){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')](_0xb087('0x2f'),_0x3dcaaa['uniqueid']),_0x3dcaaa);calls[_0xb087('0x2e')](_0x3dcaaa);recordings[_0xb087('0x2e')](_0x3dcaaa);dials[_0xb087('0x2e')](_0x3dcaaa);agents[_0xb087('0x2e')](_0x3dcaaa);queues[_0xb087('0x2e')](_0x3dcaaa);}catch(_0x19ced2){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x2f'),_0x3dcaaa[_0xb087('0x1a')]),_0x19ced2);}});ami['on'](_0xb087('0x30'),function(_0x136a5a){try{utils[_0xb087('0x1c')](util['format']('[%s][index][cdr]',_0x136a5a[_0xb087('0x1a')]),_0x136a5a);members[_0xb087('0x30')](_0x136a5a);}catch(_0x34ff88){utils[_0xb087('0x12')](util['format'](_0xb087('0x31'),_0x136a5a['uniqueid']),_0x34ff88);}});ami['on'](_0xb087('0x32'),function(_0x2001fb){try{utils[_0xb087('0x1c')](util['format'](_0xb087('0x33'),_0x2001fb[_0xb087('0x1a')]),_0x2001fb);queues[_0xb087('0x32')](_0x2001fb);agents['blindtransfer'](_0x2001fb);transfers[_0xb087('0x32')](_0x2001fb);}catch(_0x2482fe){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x33'),_0x2001fb[_0xb087('0x1a')]),_0x2482fe);}});ami['on'](_0xb087('0x34'),function(_0x4be0f3){try{utils[_0xb087('0x1c')](util['format']('[%s][index][attendedtransfer]',_0x4be0f3[_0xb087('0x35')]),_0x4be0f3);queues[_0xb087('0x34')](_0x4be0f3);transfers['attendedtransfer'](_0x4be0f3);agents[_0xb087('0x34')](_0x4be0f3);calls[_0xb087('0x34')](_0x4be0f3);}catch(_0x4884d4){utils[_0xb087('0x12')](util[_0xb087('0x15')]('[%s][index][attendedtransfer]',_0x4be0f3[_0xb087('0x35')]),_0x4884d4);}});ami['on'](_0xb087('0x36'),function(_0x520369){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')]('[%s][index][varset]',_0x520369['uniqueid']),_0x520369);queues[_0xb087('0x36')](_0x520369);recordings[_0xb087('0x36')](_0x520369);calls['varset'](_0x520369);dials[_0xb087('0x36')](_0x520369);}catch(_0x589d0d){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x37'),_0x520369[_0xb087('0x1a')]),_0x589d0d);}});ami['on'](_0xb087('0x38'),function(_0x2de9b0){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')]('[%s][index][newexten]',_0x2de9b0[_0xb087('0x1a')]),_0x2de9b0);calls[_0xb087('0x38')](_0x2de9b0);recordings[_0xb087('0x38')](_0x2de9b0);dials[_0xb087('0x38')](_0x2de9b0);}catch(_0x1de08e){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x39'),_0x2de9b0['uniqueid']),_0x1de08e);}});ami['on'](_0xb087('0x3a'),function(_0x13c42e){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')]('[%s][index][newchannel]',_0x13c42e[_0xb087('0x1a')]),_0x13c42e);calls['newchannel'](_0x13c42e);recordings['newchannel'](_0x13c42e);}catch(_0x56d6df){utils['error'](util[_0xb087('0x15')]('[%s][index][newchannel]',_0x13c42e[_0xb087('0x1a')]),_0x56d6df);}});ami['on']('dialbegin',function(_0x33fa35){try{utils[_0xb087('0x1c')](util['format'](_0xb087('0x3b'),_0x33fa35['uniqueid']),_0x33fa35);dials[_0xb087('0x3c')](_0x33fa35);}catch(_0x339a7d){utils[_0xb087('0x12')](util['format'](_0xb087('0x3d'),_0x33fa35[_0xb087('0x1a')]),_0x339a7d);}});ami['on'](_0xb087('0x3e'),function(_0x10938e){try{utils[_0xb087('0x1c')](util[_0xb087('0x15')]('[%s][index][dialend]',_0x10938e[_0xb087('0x1a')]),_0x10938e);dials[_0xb087('0x3e')](_0x10938e);}catch(_0xeee58b){utils[_0xb087('0x12')](util[_0xb087('0x15')](_0xb087('0x3f'),_0x10938e[_0xb087('0x1a')]),_0xeee58b);}});} \ No newline at end of file +var _0xadb9=['[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten'];(function(_0x567fff,_0xd8acd8){var _0x465a37=function(_0x9d7bf7){while(--_0x9d7bf7){_0x567fff['push'](_0x567fff['shift']());}};_0x465a37(++_0xd8acd8);}(_0xadb9,0x90));var _0x9adb=function(_0x5e2382,_0x2eca83){_0x5e2382=_0x5e2382-0x0;var _0x533a35=_0xadb9[_0x5e2382];return _0x533a35;};var AsteriskManager=require('asterisk-manager');var config=require(_0x9adb('0x0'));var utils=require(_0x9adb('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0x9adb('0x2')][_0x9adb('0x3')],config[_0x9adb('0x2')]['ip'],config['asterisk'][_0x9adb('0x4')],config[_0x9adb('0x2')][_0x9adb('0x5')],!![]);ami[_0x9adb('0x6')]();if(config[_0x9adb('0x7')]&&config[_0x9adb('0x7')][_0x9adb('0x8')]){utils[_0x9adb('0x9')](_0x9adb('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x9adb('0xb'));var queues=require(_0x9adb('0xc'));var recordings=require(_0x9adb('0xd'));var members=require(_0x9adb('0xe'));var dials=require('./dials.controller');var transfers=require(_0x9adb('0xf'));var core=require(_0x9adb('0x10'));ami['on'](_0x9adb('0x11'),core[_0x9adb('0x11')]);ami['on'](_0x9adb('0x12'),core[_0x9adb('0x12')]);ami['on'](_0x9adb('0x13'),core['fullybooted']);ami['on'](_0x9adb('0x14'),core['error']);ami['on']('close',core[_0x9adb('0x15')]);ami['on'](_0x9adb('0x16'),core[_0x9adb('0x16')]);ami['on'](_0x9adb('0x17'),function(_0x5849f5){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x19'),_0x5849f5[_0x9adb('0x1a')]),_0x5849f5);members[_0x9adb('0x17')](_0x5849f5);}catch(_0x310b73){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x19'),_0x5849f5[_0x9adb('0x1a')]),_0x310b73);}});ami['on'](_0x9adb('0x1c'),function(_0x1f17e5){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x1d'),_0x1f17e5['uniqueid']),_0x1f17e5);agents['agentcalled'](_0x1f17e5);}catch(_0x5cc335){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x1d'),_0x1f17e5[_0x9adb('0x1e')]),_0x5cc335);}});ami['on'](_0x9adb('0x1f'),function(_0x455c6d){try{utils['debug'](util[_0x9adb('0x1b')](_0x9adb('0x20'),_0x455c6d[_0x9adb('0x1e')]),_0x455c6d);agents[_0x9adb('0x1f')](_0x455c6d);}catch(_0x1dbd41){utils[_0x9adb('0x14')](util['format'](_0x9adb('0x20'),_0x455c6d[_0x9adb('0x1e')]),_0x1dbd41);}});ami['on'](_0x9adb('0x21'),function(_0x55b4dc){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x22'),_0x55b4dc[_0x9adb('0x1e')]),_0x55b4dc);agents['agentconnect'](_0x55b4dc);queues['agentconnect'](_0x55b4dc);}catch(_0x2da0c3){utils[_0x9adb('0x14')](util['format'](_0x9adb('0x22'),_0x55b4dc[_0x9adb('0x1e')]),_0x2da0c3);}});ami['on'](_0x9adb('0x23'),function(_0x51b952){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x24'),_0x51b952[_0x9adb('0x1e')]),_0x51b952);agents[_0x9adb('0x23')](_0x51b952);queues[_0x9adb('0x23')](_0x51b952);members[_0x9adb('0x23')](_0x51b952);}catch(_0x161f83){utils['error'](util['format'](_0x9adb('0x24'),_0x51b952[_0x9adb('0x1e')]),_0x161f83);}});ami['on']('queuecallerabandon',function(_0x42f435){try{utils['debug'](util[_0x9adb('0x1b')](_0x9adb('0x25'),_0x42f435['uniqueid']),_0x42f435);agents[_0x9adb('0x26')](_0x42f435);queues[_0x9adb('0x26')](_0x42f435);}catch(_0x4a1800){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x25'),_0x42f435[_0x9adb('0x1e')]),_0x4a1800);}});ami['on'](_0x9adb('0x27'),function(_0x160af8){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x28'),_0x160af8[_0x9adb('0x1e')]),_0x160af8);queues[_0x9adb('0x27')](_0x160af8);recordings[_0x9adb('0x27')](_0x160af8);}catch(_0x5687a1){utils['error'](util['format'](_0x9adb('0x28'),_0x160af8[_0x9adb('0x1e')]),_0x5687a1);}});ami['on'](_0x9adb('0x29'),function(_0x278541){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x2a'),_0x278541[_0x9adb('0x1e')]),_0x278541);queues[_0x9adb('0x29')](_0x278541);}catch(_0x1fefee){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x2a'),_0x278541[_0x9adb('0x1e')]),_0x1fefee);}});ami['on']('musiconholdstart',function(_0x1610a0){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')]('[%s][index][musiconholdstart]',_0x1610a0[_0x9adb('0x1e')]),_0x1610a0);queues[_0x9adb('0x2b')](_0x1610a0);calls[_0x9adb('0x2b')](_0x1610a0);}catch(_0x32f141){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')]('[%s][index][musiconholdstart]',_0x1610a0['uniqueid']),_0x32f141);}});ami['on'](_0x9adb('0x2c'),function(_0x545af0){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x2d'),_0x545af0[_0x9adb('0x1e')]),_0x545af0);queues['musiconholdstop'](_0x545af0);calls[_0x9adb('0x2c')](_0x545af0);}catch(_0x2775ba){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x2d'),_0x545af0[_0x9adb('0x1e')]),_0x2775ba);}});ami['on']('newstate',function(_0x4f93da){try{utils[_0x9adb('0x18')](util['format'](_0x9adb('0x2e'),_0x4f93da[_0x9adb('0x1e')]),_0x4f93da);calls[_0x9adb('0x2f')](_0x4f93da);recordings[_0x9adb('0x2f')](_0x4f93da);}catch(_0x535dcd){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x2e'),_0x4f93da['uniqueid']),_0x535dcd);}});ami['on'](_0x9adb('0x30'),function(_0x4a716c){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x31'),_0x4a716c[_0x9adb('0x1e')]),_0x4a716c);calls['hangup'](_0x4a716c);recordings[_0x9adb('0x30')](_0x4a716c);dials['hangup'](_0x4a716c);agents[_0x9adb('0x30')](_0x4a716c);queues['hangup'](_0x4a716c);}catch(_0x17d3ef){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x31'),_0x4a716c[_0x9adb('0x1e')]),_0x17d3ef);}});ami['on'](_0x9adb('0x32'),function(_0x5b1631){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')]('[%s][index][cdr]',_0x5b1631[_0x9adb('0x1e')]),_0x5b1631);members[_0x9adb('0x32')](_0x5b1631);}catch(_0x1376b7){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x33'),_0x5b1631[_0x9adb('0x1e')]),_0x1376b7);}});ami['on'](_0x9adb('0x34'),function(_0x573ed7){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x35'),_0x573ed7[_0x9adb('0x1e')]),_0x573ed7);queues['blindtransfer'](_0x573ed7);agents[_0x9adb('0x34')](_0x573ed7);transfers['blindtransfer'](_0x573ed7);}catch(_0x22438f){utils['error'](util['format'](_0x9adb('0x35'),_0x573ed7[_0x9adb('0x1e')]),_0x22438f);}});ami['on'](_0x9adb('0x36'),function(_0x412818){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')]('[%s][index][attendedtransfer]',_0x412818['origtransfereruniqueid']),_0x412818);queues[_0x9adb('0x36')](_0x412818);transfers[_0x9adb('0x36')](_0x412818);agents[_0x9adb('0x36')](_0x412818);calls['attendedtransfer'](_0x412818);}catch(_0x5cf476){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x37'),_0x412818[_0x9adb('0x38')]),_0x5cf476);}});ami['on'](_0x9adb('0x39'),function(_0x1a4d13){try{utils[_0x9adb('0x18')](util['format']('[%s][index][varset]',_0x1a4d13[_0x9adb('0x1e')]),_0x1a4d13);queues[_0x9adb('0x39')](_0x1a4d13);recordings['varset'](_0x1a4d13);calls[_0x9adb('0x39')](_0x1a4d13);dials['varset'](_0x1a4d13);}catch(_0xa9d525){utils[_0x9adb('0x14')](util[_0x9adb('0x1b')](_0x9adb('0x3a'),_0x1a4d13[_0x9adb('0x1e')]),_0xa9d525);}});ami['on'](_0x9adb('0x3b'),function(_0xe26b69){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x3c'),_0xe26b69[_0x9adb('0x1e')]),_0xe26b69);calls[_0x9adb('0x3b')](_0xe26b69);recordings[_0x9adb('0x3b')](_0xe26b69);dials[_0x9adb('0x3b')](_0xe26b69);}catch(_0x520935){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x3c'),_0xe26b69[_0x9adb('0x1e')]),_0x520935);}});ami['on'](_0x9adb('0x3d'),function(_0x5e96db){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x3e'),_0x5e96db['uniqueid']),_0x5e96db);calls[_0x9adb('0x3d')](_0x5e96db);recordings[_0x9adb('0x3d')](_0x5e96db);}catch(_0x1ca781){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x3e'),_0x5e96db[_0x9adb('0x1e')]),_0x1ca781);}});ami['on'](_0x9adb('0x3f'),function(_0x4c12aa){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x40'),_0x4c12aa[_0x9adb('0x1e')]),_0x4c12aa);dials[_0x9adb('0x3f')](_0x4c12aa);}catch(_0x19af1c){utils[_0x9adb('0x14')](util['format'](_0x9adb('0x41'),_0x4c12aa[_0x9adb('0x1e')]),_0x19af1c);}});ami['on'](_0x9adb('0x42'),function(_0x3966b7){try{utils[_0x9adb('0x18')](util[_0x9adb('0x1b')](_0x9adb('0x43'),_0x3966b7[_0x9adb('0x1e')]),_0x3966b7);dials['dialend'](_0x3966b7);}catch(_0x289eb1){utils['error'](util[_0x9adb('0x1b')](_0x9adb('0x43'),_0x3966b7['uniqueid']),_0x289eb1);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 589a51b..1004bb3 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 _0xafe6=['[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data3','source','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','channel','membername','type','interface','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split','then','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','device','uniqueid','state','BUSY','TALKING','now','agent','isNil','exitAt','duration','agentcomplete','[%s][members][agentcomplete]','queue','assign','cdr','data1','data2','destination'];(function(_0x338b70,_0x4c9bd9){var _0x4045fc=function(_0x3a3625){while(--_0x3a3625){_0x338b70['push'](_0x338b70['shift']());}};_0x4045fc(++_0x4c9bd9);}(_0xafe6,0x66));var _0x6afe=function(_0x30c940,_0x34ccde){_0x30c940=_0x30c940-0x0;var _0x507894=_0xafe6[_0x30c940];return _0x507894;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var utils=require(_0x6afe('0x2'));var members={};var exclude=[_0x6afe('0x3'),_0x6afe('0x4')];function writeDB(_0x5e5f77){utils[_0x6afe('0x5')](util[_0x6afe('0x6')](_0x6afe('0x7'),_0x5e5f77['uniqueid'],_0x5e5f77['interface'],_0x5e5f77[_0x6afe('0x8')],_0x5e5f77['data2'],_0x5e5f77[_0x6afe('0x9')],_0x5e5f77[_0x6afe('0xa')]));if(_0x5e5f77[_0x6afe('0xb')]){utils[_0x6afe('0xc')](_0x5e5f77[_0x6afe('0xb')])['then'](function(_0x197e41){if(_0x197e41){_0x5e5f77['membername']=_0x197e41[_0x6afe('0xd')];_0x5e5f77['internal']=_0x197e41[_0x6afe('0xe')];utils[_0x6afe('0xf')](_0x6afe('0x10'),_0x5e5f77);}else{utils[_0x6afe('0x11')](_0x5e5f77[_0x6afe('0xb')][_0x6afe('0x12')]('/')[0x1])[_0x6afe('0x13')](function(_0x220d08){if(_0x220d08){_0x5e5f77[_0x6afe('0x9')]=_0x220d08['name'];_0x5e5f77[_0x6afe('0xe')]=_0x220d08['internal'];utils[_0x6afe('0xf')](_0x6afe('0x10'),_0x5e5f77);}});}})[_0x6afe('0x14')](function(_0x2bb416){utils[_0x6afe('0x15')](util[_0x6afe('0x6')](_0x6afe('0x16'),_0x5e5f77['uniqueid']),_0x2bb416);});}delete members[_0x5e5f77['interface']];}function startsWith(_0x16788f,_0x37915d){return _[_0x6afe('0x17')](_0x16788f,function(_0x3c4eca){return _[_0x6afe('0x18')](_0x37915d,_0x3c4eca);});}exports[_0x6afe('0x19')]=function(_0x2c7234){try{utils[_0x6afe('0x1a')](util[_0x6afe('0x6')]('[%s][members][devicestatechange]',members[_0x2c7234[_0x6afe('0x1b')]]?members[_0x2c7234[_0x6afe('0x1b')]]['uniqueid']:_0x2c7234[_0x6afe('0x1b')]),_0x2c7234);utils[_0x6afe('0x5')](util[_0x6afe('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x2c7234[_0x6afe('0x1b')]]?members[_0x2c7234['device']][_0x6afe('0x1c')]:_0x2c7234[_0x6afe('0x1b')],_0x2c7234['state'],_0x2c7234[_0x6afe('0x1b')]));switch(_0x2c7234[_0x6afe('0x1d')]){case'INUSE':case _0x6afe('0x1e'):if(!startsWith(exclude,_0x2c7234[_0x6afe('0x1b')])){members[_0x2c7234['device']]={'channel':'voice','interface':_0x2c7234[_0x6afe('0x1b')],'type':_0x6afe('0x1f'),'enterAt':utils[_0x6afe('0x20')](),'role':_0x6afe('0x21')};}break;case'NOT_INUSE':if(!_[_0x6afe('0x22')](members[_0x2c7234[_0x6afe('0x1b')]])){members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x23')]=utils[_0x6afe('0x20')]();members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x24')]=utils['diffTime'](members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x23')],members[_0x2c7234[_0x6afe('0x1b')]]['enterAt']);if(members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x1c')]){writeDB(members[_0x2c7234[_0x6afe('0x1b')]]);}}break;default:break;}}catch(_0x5ddeb9){utils[_0x6afe('0x15')](util[_0x6afe('0x6')]('[%s][members][devicestatechange]',members[_0x2c7234[_0x6afe('0x1b')]]?members[_0x2c7234[_0x6afe('0x1b')]][_0x6afe('0x1c')]:_0x2c7234[_0x6afe('0x1b')]),_0x5ddeb9);}};exports[_0x6afe('0x25')]=function(_0x56e6b6){try{if(!_[_0x6afe('0x22')](members[_0x56e6b6['interface']])){utils['debug'](util[_0x6afe('0x6')](_0x6afe('0x26'),_0x56e6b6[_0x6afe('0x1c')]),_0x56e6b6);utils[_0x6afe('0x5')](util[_0x6afe('0x6')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x56e6b6['uniqueid'],_0x56e6b6[_0x6afe('0xb')],_0x56e6b6[_0x6afe('0x27')]));members[_0x56e6b6[_0x6afe('0xb')]]=_[_0x6afe('0x28')](members[_0x56e6b6['interface']],{'data4':_0x56e6b6['queue'],'uniqueid':_0x56e6b6[_0x6afe('0x1c')]});}}catch(_0x161bcf){utils[_0x6afe('0x15')](util['format'](_0x6afe('0x26'),_0x56e6b6['uniqueid']),_0x161bcf);}};exports[_0x6afe('0x29')]=function(_0x23dd23){try{utils[_0x6afe('0x1a')](util[_0x6afe('0x6')]('[%s][members][cdr]',_0x23dd23[_0x6afe('0x1c')]),_0x23dd23);if(_0x23dd23[_0x6afe('0x8')]){var _0x264fbe=_0x23dd23[_0x6afe('0x8')][_0x6afe('0x12')]('-')[0x0];if(!_[_0x6afe('0x22')](members[_0x264fbe])){members[_0x264fbe]=_[_0x6afe('0x28')](members[_0x264fbe],{'data1':members[_0x264fbe][_0x6afe('0x2a')]||_0x23dd23[_0x6afe('0xa')],'data2':members[_0x264fbe][_0x6afe('0x2b')]||_0x23dd23['source'],'data3':members[_0x264fbe]['data3']||_0x23dd23[_0x6afe('0x2c')],'uniqueid':members[_0x264fbe][_0x6afe('0x1c')]||_0x23dd23[_0x6afe('0x1c')]});utils[_0x6afe('0x5')](util[_0x6afe('0x6')](_0x6afe('0x2d'),_0x23dd23[_0x6afe('0x1c')],members[_0x264fbe][_0x6afe('0x2a')],members[_0x264fbe][_0x6afe('0x2b')],members[_0x264fbe][_0x6afe('0x2e')]));if(members[_0x264fbe][_0x6afe('0x23')]){writeDB(members[_0x264fbe]);}}}if(_0x23dd23['destinationchannel']){var _0x3cfe59=_0x23dd23['destinationchannel']['split']('-')[0x0];if(!_[_0x6afe('0x22')](members[_0x3cfe59])){members[_0x3cfe59]=_[_0x6afe('0x28')](members[_0x3cfe59],{'data1':members[_0x3cfe59][_0x6afe('0x2a')]||_0x23dd23[_0x6afe('0xa')],'data2':members[_0x3cfe59][_0x6afe('0x2b')]||_0x23dd23[_0x6afe('0x2f')],'data3':members[_0x3cfe59][_0x6afe('0x2e')]||_0x23dd23[_0x6afe('0x2c')],'uniqueid':members[_0x3cfe59][_0x6afe('0x1c')]||_0x23dd23[_0x6afe('0x1c')]});utils[_0x6afe('0x5')](util[_0x6afe('0x6')](_0x6afe('0x2d'),_0x23dd23['uniqueid'],members[_0x3cfe59][_0x6afe('0x2a')],members[_0x3cfe59][_0x6afe('0x2b')],members[_0x3cfe59][_0x6afe('0x2e')]));if(members[_0x3cfe59][_0x6afe('0x23')]){writeDB(members[_0x3cfe59]);}}}}catch(_0x12cb10){utils['error'](util[_0x6afe('0x6')](_0x6afe('0x30'),_0x23dd23[_0x6afe('0x1c')]),_0x12cb10);}}; \ No newline at end of file +var _0x8bea=['split','catch','error','[%s][members][writeDB]','uniqueid','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','now','agent','isNil','diffTime','exitAt','enterAt','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][agentcomplete]','cdr','debug','[%s][members][cdr]','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','assign','lodash','./utils','Local/_attended@transfer','info','format','interface','channel','data2','membername','type','then','name','internal','request','CreateMemberReport','getUserByName'];(function(_0x2f8000,_0x37c02b){var _0x25cfee=function(_0x56aca2){while(--_0x56aca2){_0x2f8000['push'](_0x2f8000['shift']());}};_0x25cfee(++_0x37c02b);}(_0x8bea,0x116));var _0xa8be=function(_0x5a6a6b,_0x44295a){_0x5a6a6b=_0x5a6a6b-0x0;var _0x3587d2=_0x8bea[_0x5a6a6b];return _0x3587d2;};'use strict';var _=require(_0xa8be('0x0'));var util=require('util');var utils=require(_0xa8be('0x1'));var members={};var exclude=[_0xa8be('0x2'),'Queue:'];function writeDB(_0x3ba70e){utils[_0xa8be('0x3')](util[_0xa8be('0x4')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x3ba70e['uniqueid'],_0x3ba70e[_0xa8be('0x5')],_0x3ba70e[_0xa8be('0x6')],_0x3ba70e[_0xa8be('0x7')],_0x3ba70e[_0xa8be('0x8')],_0x3ba70e[_0xa8be('0x9')]));if(_0x3ba70e['interface']){utils['getUserByInterface'](_0x3ba70e[_0xa8be('0x5')])[_0xa8be('0xa')](function(_0x1de69c){if(_0x1de69c){_0x3ba70e[_0xa8be('0x8')]=_0x1de69c[_0xa8be('0xb')];_0x3ba70e[_0xa8be('0xc')]=_0x1de69c[_0xa8be('0xc')];utils[_0xa8be('0xd')](_0xa8be('0xe'),_0x3ba70e);}else{utils[_0xa8be('0xf')](_0x3ba70e[_0xa8be('0x5')][_0xa8be('0x10')]('/')[0x1])[_0xa8be('0xa')](function(_0x1b651e){if(_0x1b651e){_0x3ba70e['membername']=_0x1b651e[_0xa8be('0xb')];_0x3ba70e[_0xa8be('0xc')]=_0x1b651e[_0xa8be('0xc')];utils['request'](_0xa8be('0xe'),_0x3ba70e);}});}})[_0xa8be('0x11')](function(_0x16aaea){utils[_0xa8be('0x12')](util[_0xa8be('0x4')](_0xa8be('0x13'),_0x3ba70e[_0xa8be('0x14')]),_0x16aaea);});}delete members[_0x3ba70e[_0xa8be('0x5')]];}function startsWith(_0x113cb3,_0x3bc38f){return _[_0xa8be('0x15')](_0x113cb3,function(_0x32ca52){return _[_0xa8be('0x16')](_0x3bc38f,_0x32ca52);});}exports[_0xa8be('0x17')]=function(_0x546cd2){try{utils['debug'](util[_0xa8be('0x4')](_0xa8be('0x18'),members[_0x546cd2[_0xa8be('0x19')]]?members[_0x546cd2[_0xa8be('0x19')]]['uniqueid']:_0x546cd2['device']),_0x546cd2);utils[_0xa8be('0x3')](util[_0xa8be('0x4')](_0xa8be('0x1a'),members[_0x546cd2[_0xa8be('0x19')]]?members[_0x546cd2[_0xa8be('0x19')]][_0xa8be('0x14')]:_0x546cd2[_0xa8be('0x19')],_0x546cd2['state'],_0x546cd2[_0xa8be('0x19')]));switch(_0x546cd2[_0xa8be('0x1b')]){case _0xa8be('0x1c'):case'BUSY':if(!startsWith(exclude,_0x546cd2[_0xa8be('0x19')])){members[_0x546cd2['device']]={'channel':_0xa8be('0x1d'),'interface':_0x546cd2[_0xa8be('0x19')],'type':'TALKING','enterAt':utils[_0xa8be('0x1e')](),'role':_0xa8be('0x1f')};}break;case'NOT_INUSE':if(!_[_0xa8be('0x20')](members[_0x546cd2[_0xa8be('0x19')]])){members[_0x546cd2[_0xa8be('0x19')]]['exitAt']=utils['now']();members[_0x546cd2[_0xa8be('0x19')]]['duration']=utils[_0xa8be('0x21')](members[_0x546cd2['device']][_0xa8be('0x22')],members[_0x546cd2[_0xa8be('0x19')]][_0xa8be('0x23')]);if(members[_0x546cd2[_0xa8be('0x19')]]['uniqueid']){writeDB(members[_0x546cd2[_0xa8be('0x19')]]);}}break;default:break;}}catch(_0xa7cd7a){utils[_0xa8be('0x12')](util[_0xa8be('0x4')]('[%s][members][devicestatechange]',members[_0x546cd2[_0xa8be('0x19')]]?members[_0x546cd2[_0xa8be('0x19')]][_0xa8be('0x14')]:_0x546cd2['device']),_0xa7cd7a);}};exports['agentcomplete']=function(_0x1a5706){try{if(!_[_0xa8be('0x20')](members[_0x1a5706['interface']])){utils['debug'](util[_0xa8be('0x4')]('[%s][members][agentcomplete]',_0x1a5706[_0xa8be('0x14')]),_0x1a5706);utils[_0xa8be('0x3')](util[_0xa8be('0x4')](_0xa8be('0x24'),_0x1a5706[_0xa8be('0x14')],_0x1a5706[_0xa8be('0x5')],_0x1a5706[_0xa8be('0x25')]));members[_0x1a5706['interface']]=_['assign'](members[_0x1a5706['interface']],{'data4':_0x1a5706[_0xa8be('0x25')],'uniqueid':_0x1a5706['uniqueid']});}}catch(_0x46add9){utils[_0xa8be('0x12')](util[_0xa8be('0x4')](_0xa8be('0x26'),_0x1a5706['uniqueid']),_0x46add9);}};exports[_0xa8be('0x27')]=function(_0x53f8d5){try{utils[_0xa8be('0x28')](util[_0xa8be('0x4')](_0xa8be('0x29'),_0x53f8d5[_0xa8be('0x14')]),_0x53f8d5);if(_0x53f8d5[_0xa8be('0x6')]){var _0xbeaafe=_0x53f8d5[_0xa8be('0x6')][_0xa8be('0x10')]('-')[0x0];if(!_['isNil'](members[_0xbeaafe])){members[_0xbeaafe]=_['assign'](members[_0xbeaafe],{'data1':members[_0xbeaafe][_0xa8be('0x2a')]||_0x53f8d5[_0xa8be('0x9')],'data2':members[_0xbeaafe]['data2']||_0x53f8d5[_0xa8be('0x2b')],'data3':members[_0xbeaafe][_0xa8be('0x2c')]||_0x53f8d5[_0xa8be('0x2d')],'uniqueid':members[_0xbeaafe][_0xa8be('0x14')]||_0x53f8d5[_0xa8be('0x14')]});utils['info'](util[_0xa8be('0x4')](_0xa8be('0x2e'),_0x53f8d5[_0xa8be('0x14')],members[_0xbeaafe][_0xa8be('0x2a')],members[_0xbeaafe][_0xa8be('0x7')],members[_0xbeaafe][_0xa8be('0x2c')]));if(members[_0xbeaafe][_0xa8be('0x22')]){writeDB(members[_0xbeaafe]);}}}if(_0x53f8d5[_0xa8be('0x2f')]){var _0xfb6d7e=_0x53f8d5[_0xa8be('0x2f')]['split']('-')[0x0];if(!_[_0xa8be('0x20')](members[_0xfb6d7e])){members[_0xfb6d7e]=_[_0xa8be('0x30')](members[_0xfb6d7e],{'data1':members[_0xfb6d7e][_0xa8be('0x2a')]||_0x53f8d5[_0xa8be('0x9')],'data2':members[_0xfb6d7e][_0xa8be('0x7')]||_0x53f8d5['source'],'data3':members[_0xfb6d7e][_0xa8be('0x2c')]||_0x53f8d5[_0xa8be('0x2d')],'uniqueid':members[_0xfb6d7e][_0xa8be('0x14')]||_0x53f8d5[_0xa8be('0x14')]});utils['info'](util[_0xa8be('0x4')](_0xa8be('0x2e'),_0x53f8d5[_0xa8be('0x14')],members[_0xfb6d7e][_0xa8be('0x2a')],members[_0xfb6d7e]['data2'],members[_0xfb6d7e][_0xa8be('0x2c')]));if(members[_0xfb6d7e][_0xa8be('0x22')]){writeDB(members[_0xfb6d7e]);}}}}catch(_0x9bf4e2){utils[_0xa8be('0x12')](util[_0xa8be('0x4')](_0xa8be('0x29'),_0x53f8d5[_0xa8be('0x14')]),_0x9bf4e2);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index fba767e..5906785 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 _0x695b=['agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','lastAssignedTo','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transferexten','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','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','ATTENDED','transfertargetlinkedid','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','error','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','now','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','value','queueposition','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinename'];(function(_0x6fbc80,_0x355ace){var _0x57c2ff=function(_0x2f7b5c){while(--_0x2f7b5c){_0x6fbc80['push'](_0x6fbc80['shift']());}};_0x57c2ff(++_0x355ace);}(_0x695b,0x1d6));var _0xb695=function(_0x5adbf2,_0x49636b){_0x5adbf2=_0x5adbf2-0x0;var _0x58d2ee=_0x695b[_0x5adbf2];return _0x58d2ee;};'use strict';var _=require(_0xb695('0x0'));var util=require(_0xb695('0x1'));var utils=require(_0xb695('0x2'));var queues={};function writeDB(_0x4353f1){utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x5'),_0x4353f1[_0xb695('0x6')],_0x4353f1[_0xb695('0x7')],_0x4353f1[_0xb695('0x8')],_0x4353f1['lastAssignedTo'],_0x4353f1[_0xb695('0x9')],_0x4353f1[_0xb695('0xa')],_0x4353f1[_0xb695('0xb')]));if(_0x4353f1['queue']){utils['getVoiceQueueByName'](_0x4353f1['queue'])[_0xb695('0xc')](function(_0x16307a){if(_0x16307a){_0x4353f1[_0xb695('0xd')]=_0x16307a[_0xb695('0xd')];}utils[_0xb695('0xe')](_0xb695('0xf'),_0x4353f1);});}else{utils[_0xb695('0xe')]('CreateVoiceQueueReport',_0x4353f1);}if(_0x4353f1[_0xb695('0x10')]){delete queues[_0x4353f1['transfereduniqueid']];}else{delete queues[_0x4353f1[_0xb695('0x6')]];}}exports[_0xb695('0x11')]=function(_0x34bc7e){try{utils[_0xb695('0x12')](util[_0xb695('0x4')](_0xb695('0x13'),_0x34bc7e[_0xb695('0x6')]),_0x34bc7e);utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x14'),_0x34bc7e[_0xb695('0x6')],_0x34bc7e[_0xb695('0x8')],_0x34bc7e[_0xb695('0x15')]));queues[_0x34bc7e[_0xb695('0x6')]]=_[_0xb695('0x16')](_0x34bc7e,{'originalposition':_0x34bc7e['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x5acad4){utils[_0xb695('0x17')](util[_0xb695('0x4')](_0xb695('0x13'),_0x34bc7e[_0xb695('0x6')]),_0x5acad4);}};exports[_0xb695('0x18')]=function(_0x5f3396){try{if(!_[_0xb695('0x19')](queues[_0x5f3396['uniqueid']])){utils[_0xb695('0x12')](util['format']('[%s][queues][hangup]',_0x5f3396['uniqueid']),_0x5f3396);if(queues[_0x5f3396[_0xb695('0x6')]]['queuecallerleaveAt']){if(!queues[_0x5f3396[_0xb695('0x6')]][_0xb695('0x1a')]&&!queues[_0x5f3396['uniqueid']][_0xb695('0x1b')]){queues[_0x5f3396[_0xb695('0x6')]][_0xb695('0x1c')]=!![];queues[_0x5f3396[_0xb695('0x6')]][_0xb695('0x1d')]=utils[_0xb695('0x1e')]();queues[_0x5f3396['uniqueid']]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils['info'](util['format'](_0xb695('0x1f'),_0x5f3396[_0xb695('0x6')],queues[_0x5f3396['uniqueid']]['name'],queues[_0x5f3396[_0xb695('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x5f3396[_0xb695('0x6')]]);}else if(queues[_0x5f3396['uniqueid']][_0xb695('0x10')]){utils[_0xb695('0x3')](util[_0xb695('0x4')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5f3396[_0xb695('0x6')],queues[_0x5f3396[_0xb695('0x6')]][_0xb695('0x20')],queues[_0x5f3396['uniqueid']][_0xb695('0x10')]));queues[queues[_0x5f3396['uniqueid']]['transfereduniqueid']]=queues[_0x5f3396[_0xb695('0x6')]];queues[queues[_0x5f3396[_0xb695('0x6')]][_0xb695('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x5f3396[_0xb695('0x6')]];}}}catch(_0x458cee){utils[_0xb695('0x17')](util['format'](_0xb695('0x21'),_0x5f3396[_0xb695('0x6')]),_0x458cee);}};exports['varset']=function(_0x451d9d){try{utils['debug'](util[_0xb695('0x4')](_0xb695('0x22'),_0x451d9d[_0xb695('0x6')]),_0x451d9d);if(!_[_0xb695('0x19')](_0x451d9d[_0xb695('0x23')][_0xb695('0x24')])&&_0x451d9d['value'][_0xb695('0x25')]()!==_0xb695('0x26')){if(!_['isNil'](queues[_0x451d9d[_0xb695('0x6')]])){queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x1a')]=![];queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x27')]=null;queues[_0x451d9d[_0xb695('0x6')]]['queuecallerexit']=!![];queues[_0x451d9d['uniqueid']]['queuecallerexitAt']=utils[_0xb695('0x1e')]();queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0xb')]=_0x451d9d[_0xb695('0x28')][_0xb695('0x25')]();utils['info'](util[_0xb695('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x451d9d['uniqueid'],queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x20')],_0x451d9d[_0xb695('0x28')],queues[_0x451d9d[_0xb695('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x451d9d[_0xb695('0x6')]]);}}else if(!_[_0xb695('0x19')](_0x451d9d[_0xb695('0x23')][_0xb695('0x29')])){if(!_[_0xb695('0x19')](queues[_0x451d9d[_0xb695('0x6')]])&&!queues[_0x451d9d[_0xb695('0x6')]]['queuecallerabandon']){queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x1a')]=![];queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x27')]=null;queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x1b')]=!![];queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x2a')]=utils[_0xb695('0x1e')]();queues[_0x451d9d[_0xb695('0x6')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x2b'),_0x451d9d[_0xb695('0x6')],queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0x20')],_0x451d9d[_0xb695('0x28')],queues[_0x451d9d[_0xb695('0x6')]][_0xb695('0xb')]));}}}catch(_0x424ce6){utils[_0xb695('0x17')](util['format'](_0xb695('0x22'),_0x451d9d['uniqueid']),_0x424ce6);}};exports[_0xb695('0x1a')]=function(_0x42da59){try{if(!_[_0xb695('0x19')](queues[_0x42da59['uniqueid']])){utils[_0xb695('0x12')](util[_0xb695('0x4')](_0xb695('0x2c'),_0x42da59[_0xb695('0x6')]),_0x42da59);queues[_0x42da59['uniqueid']][_0xb695('0x1b')]=![];queues[_0x42da59['uniqueid']]['queuecallerexitAt']=null;queues[_0x42da59['uniqueid']][_0xb695('0x1a')]=!![];queues[_0x42da59['uniqueid']][_0xb695('0x27')]=utils['now']();queues[_0x42da59[_0xb695('0x6')]]['queuecallerexitreason']='ABANDONED';utils[_0xb695('0x3')](util[_0xb695('0x4')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x42da59[_0xb695('0x6')],queues[_0x42da59['uniqueid']][_0xb695('0x20')],queues[_0x42da59[_0xb695('0x6')]][_0xb695('0xb')]));}}catch(_0x2658cd){utils[_0xb695('0x17')](util[_0xb695('0x4')](_0xb695('0x2c'),_0x42da59['uniqueid']),_0x2658cd);}};exports[_0xb695('0x2d')]=function(_0x55b304){try{if(!_['isNil'](queues[_0x55b304['uniqueid']])){utils[_0xb695('0x12')](util['format'](_0xb695('0x2e'),_0x55b304[_0xb695('0x6')]),_0x55b304);utils['info'](util[_0xb695('0x4')](_0xb695('0x2f'),_0x55b304['uniqueid'],queues[_0x55b304[_0xb695('0x6')]][_0xb695('0x20')],_0x55b304[_0xb695('0x30')],_0x55b304['connectedlinename']));queues[_0x55b304[_0xb695('0x6')]][_0xb695('0x2d')]=!![];queues[_0x55b304['uniqueid']]['queuecallerleaveAt']=utils[_0xb695('0x1e')]();queues[_0x55b304[_0xb695('0x6')]][_0xb695('0x31')]=utils[_0xb695('0x32')](queues[_0x55b304[_0xb695('0x6')]][_0xb695('0x33')],queues[_0x55b304[_0xb695('0x6')]][_0xb695('0x34')]);queues[_0x55b304[_0xb695('0x6')]][_0xb695('0x15')]=_0x55b304[_0xb695('0x15')];queues[_0x55b304[_0xb695('0x6')]][_0xb695('0x35')]=_0x55b304['count'];queues[_0x55b304[_0xb695('0x6')]]['connectedlinenum']=_0x55b304[_0xb695('0x30')];queues[_0x55b304['uniqueid']][_0xb695('0x36')]=_0x55b304[_0xb695('0x36')];}}catch(_0x23ed94){utils['error'](util['format'](_0xb695('0x2e'),_0x55b304[_0xb695('0x6')]),_0x23ed94);}};exports[_0xb695('0x37')]=function(_0x19d141){try{if(!_[_0xb695('0x19')](queues[_0x19d141[_0xb695('0x6')]])){utils[_0xb695('0x12')](util[_0xb695('0x4')](_0xb695('0x38'),_0x19d141[_0xb695('0x6')]),_0x19d141);utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x39'),_0x19d141[_0xb695('0x6')],queues[_0x19d141[_0xb695('0x6')]][_0xb695('0x20')],_0x19d141[_0xb695('0x3a')],_0x19d141[_0xb695('0x3b')]));queues[_0x19d141[_0xb695('0x6')]][_0xb695('0x1a')]=![];queues[_0x19d141[_0xb695('0x6')]][_0xb695('0x1a')]=![];queues[_0x19d141[_0xb695('0x6')]]['queuecallerabandonAt']=null;queues[_0x19d141[_0xb695('0x6')]][_0xb695('0x1b')]=![];queues[_0x19d141[_0xb695('0x6')]][_0xb695('0xb')]=null;queues[_0x19d141[_0xb695('0x6')]][_0xb695('0x2a')]=null;queues[_0x19d141[_0xb695('0x6')]][_0xb695('0x3c')]=!![];queues[_0x19d141[_0xb695('0x6')]][_0xb695('0xa')]=_0x19d141[_0xb695('0x3b')];queues[_0x19d141[_0xb695('0x6')]]['lastAssignedTo']=_0x19d141[_0xb695('0x3a')];}}catch(_0x17321f){utils['error'](util['format']('[%s][queues][agentconnect]',_0x19d141['uniqueid']),_0x17321f);}};exports[_0xb695('0x3d')]=function(_0x4db6c1){try{if(!_[_0xb695('0x19')](queues[_0x4db6c1['uniqueid']])){if(queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x33')]){utils[_0xb695('0x12')](util[_0xb695('0x4')]('[%s][queues][agentcomplete]',_0x4db6c1[_0xb695('0x6')]),_0x4db6c1);queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x1a')]=![];queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x1a')]=![];queues[_0x4db6c1[_0xb695('0x6')]]['queuecallerabandonAt']=null;queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x1b')]=![];queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x2a')]=null;queues[_0x4db6c1['uniqueid']][_0xb695('0x3c')]=!![];queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x3e')]=_0x4db6c1[_0xb695('0x3a')];queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x1c')]=!![];queues[_0x4db6c1['uniqueid']]['queuecallercompleteAt']=utils[_0xb695('0x1e')]();if(_0x4db6c1[_0xb695('0x3f')]==_0xb695('0x40')){if(!queues[_0x4db6c1[_0xb695('0x6')]][_0xb695('0x40')]){queues[_0x4db6c1['uniqueid']]['queuecallerexitreason']=_0xb695('0x41');}}else{queues[_0x4db6c1['uniqueid']][_0xb695('0xb')]=_0xb695('0x42')+_0x4db6c1['reason'][_0xb695('0x25')]();}utils[_0xb695('0x3')](util['format']('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x4db6c1[_0xb695('0x6')],queues[_0x4db6c1[_0xb695('0x6')]]['name'],_0x4db6c1[_0xb695('0x3a')],queues[_0x4db6c1[_0xb695('0x6')]]['queuecallerexitreason']));writeDB(queues[_0x4db6c1[_0xb695('0x6')]]);}}}catch(_0x22bd0e){utils[_0xb695('0x17')](util[_0xb695('0x4')](_0xb695('0x43'),_0x4db6c1[_0xb695('0x6')]),_0x22bd0e);}};exports[_0xb695('0x44')]=function(_0x5cebd0){try{if(!_[_0xb695('0x19')](queues[_0x5cebd0[_0xb695('0x45')]])){utils[_0xb695('0x12')](util[_0xb695('0x4')](_0xb695('0x46'),_0x5cebd0[_0xb695('0x6')]),_0x5cebd0);queues[_0x5cebd0[_0xb695('0x45')]][_0xb695('0x40')]=!![];queues[_0x5cebd0[_0xb695('0x45')]][_0xb695('0x47')]=_0xb695('0x48');queues[_0x5cebd0[_0xb695('0x45')]]['transferexten']=_0x5cebd0[_0xb695('0x49')];queues[_0x5cebd0[_0xb695('0x45')]][_0xb695('0x4a')]=_0x5cebd0['transfereeuniqueid'];queues[_0x5cebd0['transfereeuniqueid']]['queuecallerexitreason']=_0xb695('0x4b');utils[_0xb695('0x3')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x5cebd0['uniqueid'],queues[_0x5cebd0[_0xb695('0x45')]][_0xb695('0x20')],_0x5cebd0[_0xb695('0x45')],_0x5cebd0['extension']));}}catch(_0x160235){utils[_0xb695('0x17')](util[_0xb695('0x4')](_0xb695('0x46'),_0x5cebd0['uniqueid']),_0x160235);}};exports[_0xb695('0x4c')]=function(_0x4dfa0d){try{utils[_0xb695('0x12')](util[_0xb695('0x4')](_0xb695('0x4d'),_0x4dfa0d[_0xb695('0x4e')]),_0x4dfa0d);if(_0x4dfa0d[_0xb695('0x4e')]==_0x4dfa0d[_0xb695('0x4f')]){if(!_['isNil'](queues[_0x4dfa0d[_0xb695('0x50')]])){utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x51'),_0x4dfa0d[_0xb695('0x4e')],queues[_0x4dfa0d['secondtransfererlinkedid']][_0xb695('0x20')],_0x4dfa0d[_0xb695('0x52')]));queues[_0x4dfa0d[_0xb695('0x50')]][_0xb695('0x40')]=!![];queues[_0x4dfa0d[_0xb695('0x50')]][_0xb695('0x47')]='ATTENDED';queues[_0x4dfa0d[_0xb695('0x50')]][_0xb695('0x53')]=_0x4dfa0d[_0xb695('0x52')];queues[_0x4dfa0d[_0xb695('0x50')]]['transferuniqueid']=_0x4dfa0d[_0xb695('0x4e')];queues[_0x4dfa0d[_0xb695('0x50')]][_0xb695('0xb')]=_0xb695('0x54');}if(!_[_0xb695('0x19')](queues[_0x4dfa0d['origtransfererlinkedid']])){if(_0x4dfa0d[_0xb695('0x55')]&&queues[_0x4dfa0d[_0xb695('0x55')]]){queues[_0x4dfa0d[_0xb695('0x55')]][_0xb695('0x56')]=0x1;queues[_0x4dfa0d[_0xb695('0x45')]]=_[_0xb695('0x57')](queues[_0x4dfa0d['transfereelinkedid']]);queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x10')]=_0x4dfa0d[_0xb695('0x58')];queues[_0x4dfa0d['transfereeuniqueid']][_0xb695('0x56')]=0x2;queues[_0x4dfa0d['transfereeuniqueid']][_0xb695('0x9')]=queues[_0x4dfa0d[_0xb695('0x50')]]['calleridnum'];queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x59')]=queues[_0x4dfa0d[_0xb695('0x50')]]['calleridname'];queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x34')]=utils['now']();queues[_0x4dfa0d[_0xb695('0x45')]]['queuecallerleaveAt']=utils['now']();queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x31')]=0x0;queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x5a')]=0x0;utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x5b'),_0x4dfa0d[_0xb695('0x4e')],queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x20')],queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x9')],queues[_0x4dfa0d[_0xb695('0x45')]][_0xb695('0x59')]));}else{utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x5c'),_0x4dfa0d[_0xb695('0x4e')],queues[_0x4dfa0d[_0xb695('0x4f')]][_0xb695('0x20')],_0x4dfa0d['secondtransfererlinkedid']));queues[_0x4dfa0d[_0xb695('0x4f')]][_0xb695('0x10')]=_0x4dfa0d['secondtransfererlinkedid'];}}}else if(_0x4dfa0d[_0xb695('0x5d')]==_0x4dfa0d[_0xb695('0x50')]){if(!_[_0xb695('0x19')](queues[_0x4dfa0d[_0xb695('0x4f')]])){utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x5e'),_0x4dfa0d[_0xb695('0x4e')],queues[_0x4dfa0d[_0xb695('0x4f')]][_0xb695('0x20')],_0x4dfa0d[_0xb695('0x5d')],_0x4dfa0d[_0xb695('0x5f')]));queues[_0x4dfa0d['origtransfererlinkedid']][_0xb695('0x40')]=!![];queues[_0x4dfa0d[_0xb695('0x4f')]]['transfertype']=_0xb695('0x60');queues[_0x4dfa0d[_0xb695('0x4f')]]['transferexten']=_0x4dfa0d[_0xb695('0x5f')];queues[_0x4dfa0d['origtransfererlinkedid']][_0xb695('0x4a')]=_0x4dfa0d[_0xb695('0x5d')];queues[_0x4dfa0d['origtransfererlinkedid']][_0xb695('0xb')]=_0xb695('0x54');}if(!_[_0xb695('0x19')](queues[_0x4dfa0d[_0xb695('0x50')]])){if(_0x4dfa0d[_0xb695('0x61')]&&queues[_0x4dfa0d[_0xb695('0x61')]]){queues[_0x4dfa0d[_0xb695('0x61')]][_0xb695('0x56')]=0x1;queues[_0x4dfa0d[_0xb695('0x58')]]=_[_0xb695('0x57')](queues[_0x4dfa0d['transfertargetlinkedid']]);queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x10')]=_0x4dfa0d[_0xb695('0x58')];queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x56')]=0x2;queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x9')]=queues[_0x4dfa0d[_0xb695('0x4f')]]['calleridnum'];queues[_0x4dfa0d['transfertargetuniqueid']][_0xb695('0x59')]=queues[_0x4dfa0d[_0xb695('0x4f')]][_0xb695('0x59')];queues[_0x4dfa0d[_0xb695('0x58')]]['queuecallerjoinAt']=utils[_0xb695('0x1e')]();queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x33')]=utils[_0xb695('0x1e')]();queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x31')]=0x0;queues[_0x4dfa0d[_0xb695('0x58')]]['mohtime']=0x0;utils[_0xb695('0x3')](util[_0xb695('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x4dfa0d[_0xb695('0x4e')],queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x20')],queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x10')],queues[_0x4dfa0d[_0xb695('0x58')]][_0xb695('0x9')],queues[_0x4dfa0d['transfertargetuniqueid']]['calleridname']));}else{utils[_0xb695('0x3')](util[_0xb695('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x4dfa0d[_0xb695('0x4e')],queues[_0x4dfa0d[_0xb695('0x50')]][_0xb695('0x20')],_0x4dfa0d[_0xb695('0x4f')]));queues[_0x4dfa0d[_0xb695('0x50')]][_0xb695('0x10')]=_0x4dfa0d[_0xb695('0x4f')];}}}}catch(_0x1bd0ec){utils['error'](util[_0xb695('0x4')]('[%s][queues][attendedtransfer]',_0x4dfa0d[_0xb695('0x4e')]),_0x1bd0ec);}};exports[_0xb695('0x62')]=function(_0x4b3cbc){try{if(!_[_0xb695('0x19')](queues[_0x4b3cbc[_0xb695('0x6')]])){utils[_0xb695('0x12')](util[_0xb695('0x4')](_0xb695('0x63'),_0x4b3cbc[_0xb695('0x6')]),_0x4b3cbc);queues[_0x4b3cbc['uniqueid']]['musiconholdstartAt']=utils[_0xb695('0x1e')]();utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x64'),_0x4b3cbc['uniqueid'],queues[_0x4b3cbc[_0xb695('0x6')]][_0xb695('0x20')],queues[_0x4b3cbc[_0xb695('0x6')]]['musiconholdstartAt']));}}catch(_0x805157){utils['error'](util[_0xb695('0x4')](_0xb695('0x63'),_0x4b3cbc['uniqueid']),_0x805157);}};exports[_0xb695('0x65')]=function(_0x34e7a2){try{if(!_[_0xb695('0x19')](queues[_0x34e7a2[_0xb695('0x6')]])){if(!_['isNil'](queues[_0x34e7a2[_0xb695('0x6')]]['musiconholdstartAt'])){utils['debug'](util['format'](_0xb695('0x66'),_0x34e7a2[_0xb695('0x6')]),_0x34e7a2);queues[_0x34e7a2[_0xb695('0x6')]][_0xb695('0x5a')]+=utils['diffTime'](utils['now'](),queues[_0x34e7a2[_0xb695('0x6')]][_0xb695('0x67')]);utils[_0xb695('0x3')](util[_0xb695('0x4')](_0xb695('0x68'),_0x34e7a2[_0xb695('0x6')],queues[_0x34e7a2[_0xb695('0x6')]][_0xb695('0x20')],queues[_0x34e7a2[_0xb695('0x6')]]['mohtime']));delete queues[_0x34e7a2['uniqueid']][_0xb695('0x67')];}}}catch(_0x4dbd0f){utils['error'](util[_0xb695('0x4')](_0xb695('0x66'),_0x34e7a2['uniqueid']),_0x4dbd0f);}}; \ No newline at end of file +var _0xe78b=['info','position','assign','now','error','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerexitreason','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queuecallerabandonAt','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','destaccountcode','assigned','membername','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','queuecallercompleteAt','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','queuecallerleaveAt','[%s][queues][attendedtransfer]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','accountcode','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','uniqueid'];(function(_0x43db78,_0x36dcdd){var _0x39bbee=function(_0x5f5335){while(--_0x5f5335){_0x43db78['push'](_0x43db78['shift']());}};_0x39bbee(++_0x36dcdd);}(_0xe78b,0x11b));var _0xbe78=function(_0x41e018,_0x54cb55){_0x41e018=_0x41e018-0x0;var _0x52327d=_0xe78b[_0x41e018];return _0x52327d;};'use strict';var _=require(_0xbe78('0x0'));var util=require(_0xbe78('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x2e519e){utils['info'](util[_0xbe78('0x2')](_0xbe78('0x3'),_0x2e519e['uniqueid'],_0x2e519e[_0xbe78('0x4')],_0x2e519e['queue'],_0x2e519e[_0xbe78('0x5')],_0x2e519e[_0xbe78('0x6')],_0x2e519e[_0xbe78('0x7')],_0x2e519e['queuecallerexitreason']));if(_0x2e519e['queue']){utils['getVoiceQueueByName'](_0x2e519e[_0xbe78('0x8')])['then'](function(_0x27bd0b){if(_0x27bd0b){_0x2e519e['type']=_0x27bd0b[_0xbe78('0x9')];}utils[_0xbe78('0xa')](_0xbe78('0xb'),_0x2e519e);});}else{utils[_0xbe78('0xa')](_0xbe78('0xb'),_0x2e519e);}if(_0x2e519e[_0xbe78('0xc')]){delete queues[_0x2e519e[_0xbe78('0xc')]];}else{delete queues[_0x2e519e['uniqueid']];}}exports[_0xbe78('0xd')]=function(_0x4338c7){try{utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0xf'),_0x4338c7[_0xbe78('0x10')]),_0x4338c7);utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x4338c7[_0xbe78('0x10')],_0x4338c7[_0xbe78('0x8')],_0x4338c7[_0xbe78('0x12')]));queues[_0x4338c7[_0xbe78('0x10')]]=_[_0xbe78('0x13')](_0x4338c7,{'originalposition':_0x4338c7[_0xbe78('0x12')],'queuecallerjoinAt':utils[_0xbe78('0x14')](),'mohtime':0x0});}catch(_0x5ce789){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0xf'),_0x4338c7[_0xbe78('0x10')]),_0x5ce789);}};exports['hangup']=function(_0x561fe8){try{if(!_[_0xbe78('0x16')](queues[_0x561fe8[_0xbe78('0x10')]])){utils[_0xbe78('0xe')](util['format'](_0xbe78('0x17'),_0x561fe8[_0xbe78('0x10')]),_0x561fe8);if(queues[_0x561fe8[_0xbe78('0x10')]]['queuecallerleaveAt']){if(!queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0x18')]&&!queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0x19')]){queues[_0x561fe8[_0xbe78('0x10')]]['queuecallercomplete']=!![];queues[_0x561fe8[_0xbe78('0x10')]]['queuecallercompleteAt']=utils[_0xbe78('0x14')]();queues[_0x561fe8[_0xbe78('0x10')]]['queuecallerexitreason']=_0xbe78('0x1a');}utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x1b'),_0x561fe8[_0xbe78('0x10')],queues[_0x561fe8['uniqueid']][_0xbe78('0x1c')],queues[_0x561fe8['uniqueid']][_0xbe78('0x1d')]));writeDB(queues[_0x561fe8[_0xbe78('0x10')]]);}else if(queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0xc')]){utils['info'](util['format'](_0xbe78('0x1e'),_0x561fe8[_0xbe78('0x10')],queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0xc')]));queues[queues[_0x561fe8[_0xbe78('0x10')]][_0xbe78('0xc')]]=queues[_0x561fe8[_0xbe78('0x10')]];queues[queues[_0x561fe8['uniqueid']][_0xbe78('0xc')]][_0xbe78('0x1f')]=0x2;delete queues[_0x561fe8[_0xbe78('0x10')]];}}}catch(_0x465729){utils['error'](util[_0xbe78('0x2')](_0xbe78('0x17'),_0x561fe8['uniqueid']),_0x465729);}};exports[_0xbe78('0x20')]=function(_0x3a425b){try{utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x21'),_0x3a425b[_0xbe78('0x10')]),_0x3a425b);if(!_[_0xbe78('0x16')](_0x3a425b[_0xbe78('0x22')]['queuestatus'])&&_0x3a425b[_0xbe78('0x23')][_0xbe78('0x24')]()!==_0xbe78('0x25')){if(!_['isNil'](queues[_0x3a425b[_0xbe78('0x10')]])){queues[_0x3a425b['uniqueid']][_0xbe78('0x18')]=![];queues[_0x3a425b[_0xbe78('0x10')]]['queuecallerabandonAt']=null;queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x19')]=!![];queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x26')]=utils[_0xbe78('0x14')]();queues[_0x3a425b['uniqueid']]['queuecallerexitreason']=_0x3a425b[_0xbe78('0x23')][_0xbe78('0x24')]();utils[_0xbe78('0x11')](util['format'](_0xbe78('0x27'),_0x3a425b[_0xbe78('0x10')],queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x1c')],_0x3a425b[_0xbe78('0x23')],queues[_0x3a425b['uniqueid']][_0xbe78('0x1d')]));writeDB(queues[_0x3a425b[_0xbe78('0x10')]]);}}else if(!_[_0xbe78('0x16')](_0x3a425b[_0xbe78('0x22')]['queueposition'])){if(!_[_0xbe78('0x16')](queues[_0x3a425b[_0xbe78('0x10')]])&&!queues[_0x3a425b['uniqueid']][_0xbe78('0x18')]){queues[_0x3a425b[_0xbe78('0x10')]]['queuecallerabandon']=![];queues[_0x3a425b['uniqueid']][_0xbe78('0x28')]=null;queues[_0x3a425b['uniqueid']][_0xbe78('0x19')]=!![];queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x26')]=utils[_0xbe78('0x14')]();queues[_0x3a425b[_0xbe78('0x10')]]['queuecallerexitreason']=_0xbe78('0x29');utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x3a425b[_0xbe78('0x10')],queues[_0x3a425b[_0xbe78('0x10')]][_0xbe78('0x1c')],_0x3a425b[_0xbe78('0x23')],queues[_0x3a425b['uniqueid']][_0xbe78('0x1d')]));}}}catch(_0x481fe1){utils[_0xbe78('0x15')](util[_0xbe78('0x2')]('[%s][queues][varset]',_0x3a425b[_0xbe78('0x10')]),_0x481fe1);}};exports[_0xbe78('0x18')]=function(_0x166d62){try{if(!_[_0xbe78('0x16')](queues[_0x166d62['uniqueid']])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x2a'),_0x166d62[_0xbe78('0x10')]),_0x166d62);queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x19')]=![];queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x26')]=null;queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x18')]=!![];queues[_0x166d62[_0xbe78('0x10')]]['queuecallerabandonAt']=utils[_0xbe78('0x14')]();queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x1d')]=_0xbe78('0x2b');utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x166d62[_0xbe78('0x10')],queues[_0x166d62[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x166d62[_0xbe78('0x10')]]['queuecallerexitreason']));}}catch(_0x46199e){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x2a'),_0x166d62[_0xbe78('0x10')]),_0x46199e);}};exports[_0xbe78('0x2c')]=function(_0x3e9eec){try{if(!_[_0xbe78('0x16')](queues[_0x3e9eec[_0xbe78('0x10')]])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x2d'),_0x3e9eec[_0xbe78('0x10')]),_0x3e9eec);utils['info'](util[_0xbe78('0x2')](_0xbe78('0x2e'),_0x3e9eec[_0xbe78('0x10')],queues[_0x3e9eec[_0xbe78('0x10')]][_0xbe78('0x1c')],_0x3e9eec[_0xbe78('0x2f')],_0x3e9eec[_0xbe78('0x30')]));queues[_0x3e9eec[_0xbe78('0x10')]]['queuecallerleave']=!![];queues[_0x3e9eec[_0xbe78('0x10')]]['queuecallerleaveAt']=utils['now']();queues[_0x3e9eec[_0xbe78('0x10')]][_0xbe78('0x31')]=utils[_0xbe78('0x32')](queues[_0x3e9eec[_0xbe78('0x10')]]['queuecallerleaveAt'],queues[_0x3e9eec['uniqueid']]['queuecallerjoinAt']);queues[_0x3e9eec['uniqueid']][_0xbe78('0x12')]=_0x3e9eec['position'];queues[_0x3e9eec['uniqueid']]['count']=_0x3e9eec[_0xbe78('0x33')];queues[_0x3e9eec[_0xbe78('0x10')]][_0xbe78('0x2f')]=_0x3e9eec['connectedlinenum'];queues[_0x3e9eec['uniqueid']][_0xbe78('0x30')]=_0x3e9eec[_0xbe78('0x30')];}}catch(_0x108af9){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x2d'),_0x3e9eec[_0xbe78('0x10')]),_0x108af9);}};exports[_0xbe78('0x34')]=function(_0x4afe18){try{if(!_[_0xbe78('0x16')](queues[_0x4afe18['uniqueid']])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x35'),_0x4afe18[_0xbe78('0x10')]),_0x4afe18);utils['info'](util['format']('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x4afe18[_0xbe78('0x10')],queues[_0x4afe18['uniqueid']][_0xbe78('0x1c')],_0x4afe18['membername'],_0x4afe18[_0xbe78('0x36')]));queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x18')]=![];queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x18')]=![];queues[_0x4afe18['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4afe18[_0xbe78('0x10')]]['queuecallerexit']=![];queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x1d')]=null;queues[_0x4afe18['uniqueid']][_0xbe78('0x26')]=null;queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x37')]=!![];queues[_0x4afe18[_0xbe78('0x10')]]['accountcode']=_0x4afe18[_0xbe78('0x36')];queues[_0x4afe18[_0xbe78('0x10')]][_0xbe78('0x5')]=_0x4afe18[_0xbe78('0x38')];}}catch(_0x566a9c){utils[_0xbe78('0x15')](util['format'](_0xbe78('0x35'),_0x4afe18['uniqueid']),_0x566a9c);}};exports[_0xbe78('0x39')]=function(_0x289d32){try{if(!_[_0xbe78('0x16')](queues[_0x289d32[_0xbe78('0x10')]])){if(queues[_0x289d32['uniqueid']]['queuecallerleaveAt']){utils[_0xbe78('0xe')](util[_0xbe78('0x2')](_0xbe78('0x3a'),_0x289d32[_0xbe78('0x10')]),_0x289d32);queues[_0x289d32['uniqueid']]['queuecallerabandon']=![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x18')]=![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x28')]=null;queues[_0x289d32['uniqueid']][_0xbe78('0x19')]=![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x26')]=null;queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x37')]=!![];queues[_0x289d32['uniqueid']][_0xbe78('0x5')]=_0x289d32['membername'];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x3b')]=!![];queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x3c')]=utils[_0xbe78('0x14')]();if(_0x289d32['reason']==_0xbe78('0x3d')){if(!queues[_0x289d32['uniqueid']][_0xbe78('0x3d')]){queues[_0x289d32[_0xbe78('0x10')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x289d32[_0xbe78('0x10')]][_0xbe78('0x1d')]=_0xbe78('0x3e')+_0x289d32[_0xbe78('0x3f')][_0xbe78('0x24')]();}utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x40'),_0x289d32[_0xbe78('0x10')],queues[_0x289d32['uniqueid']]['name'],_0x289d32[_0xbe78('0x38')],queues[_0x289d32['uniqueid']][_0xbe78('0x1d')]));writeDB(queues[_0x289d32[_0xbe78('0x10')]]);}}}catch(_0x27302d){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x3a'),_0x289d32[_0xbe78('0x10')]),_0x27302d);}};exports[_0xbe78('0x41')]=function(_0x1fddd3){try{if(!_['isNil'](queues[_0x1fddd3[_0xbe78('0x42')]])){utils['debug'](util[_0xbe78('0x2')]('[%s][queues][blindtransfer]',_0x1fddd3[_0xbe78('0x10')]),_0x1fddd3);queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x3d')]=!![];queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x43')]=_0xbe78('0x44');queues[_0x1fddd3['transfereeuniqueid']][_0xbe78('0x45')]=_0x1fddd3['extension'];queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x46')]=_0x1fddd3[_0xbe78('0x42')];queues[_0x1fddd3['transfereeuniqueid']][_0xbe78('0x1d')]=_0xbe78('0x47');utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x48'),_0x1fddd3['uniqueid'],queues[_0x1fddd3[_0xbe78('0x42')]][_0xbe78('0x1c')],_0x1fddd3[_0xbe78('0x42')],_0x1fddd3[_0xbe78('0x49')]));}}catch(_0xf71db5){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x4a'),_0x1fddd3['uniqueid']),_0xf71db5);}};exports[_0xbe78('0x4b')]=function(_0x79d799){try{utils[_0xbe78('0xe')](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]',_0x79d799['origtransfereruniqueid']),_0x79d799);if(_0x79d799[_0xbe78('0x4c')]==_0x79d799['origtransfererlinkedid']){if(!_['isNil'](queues[_0x79d799['secondtransfererlinkedid']])){utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x79d799['origtransfereruniqueid'],queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x1c')],_0x79d799[_0xbe78('0x4e')]));queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x3d')]=!![];queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x43')]=_0xbe78('0x4f');queues[_0x79d799[_0xbe78('0x4d')]]['transferexten']=_0x79d799['origtransfererexten'];queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x46')]=_0x79d799[_0xbe78('0x4c')];queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x1d')]=_0xbe78('0x50');}if(!_['isNil'](queues[_0x79d799[_0xbe78('0x51')]])){if(_0x79d799[_0xbe78('0x52')]&&queues[_0x79d799[_0xbe78('0x52')]]){queues[_0x79d799[_0xbe78('0x52')]][_0xbe78('0x1f')]=0x1;queues[_0x79d799[_0xbe78('0x42')]]=_[_0xbe78('0x53')](queues[_0x79d799[_0xbe78('0x52')]]);queues[_0x79d799[_0xbe78('0x42')]]['transfereduniqueid']=_0x79d799[_0xbe78('0x54')];queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x1f')]=0x2;queues[_0x79d799[_0xbe78('0x42')]]['calleridnum']=queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x6')];queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x55')]=queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x55')];queues[_0x79d799['transfereeuniqueid']][_0xbe78('0x56')]=utils['now']();queues[_0x79d799[_0xbe78('0x42')]]['queuecallerleaveAt']=utils['now']();queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x31')]=0x0;queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x57')]=0x0;utils[_0xbe78('0x11')](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x79d799['origtransfereruniqueid'],queues[_0x79d799[_0xbe78('0x42')]][_0xbe78('0x1c')],queues[_0x79d799[_0xbe78('0x42')]]['calleridnum'],queues[_0x79d799['transfereeuniqueid']][_0xbe78('0x55')]));}else{utils['info'](util[_0xbe78('0x2')](_0xbe78('0x58'),_0x79d799['origtransfereruniqueid'],queues[_0x79d799['origtransfererlinkedid']][_0xbe78('0x1c')],_0x79d799[_0xbe78('0x4d')]));queues[_0x79d799[_0xbe78('0x51')]]['transfereduniqueid']=_0x79d799['secondtransfererlinkedid'];}}}else if(_0x79d799[_0xbe78('0x59')]==_0x79d799[_0xbe78('0x4d')]){if(!_['isNil'](queues[_0x79d799[_0xbe78('0x51')]])){utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x5a'),_0x79d799[_0xbe78('0x4c')],queues[_0x79d799[_0xbe78('0x51')]]['name'],_0x79d799[_0xbe78('0x59')],_0x79d799[_0xbe78('0x5b')]));queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x3d')]=!![];queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x43')]=_0xbe78('0x4f');queues[_0x79d799[_0xbe78('0x51')]]['transferexten']=_0x79d799[_0xbe78('0x5b')];queues[_0x79d799['origtransfererlinkedid']][_0xbe78('0x46')]=_0x79d799['secondtransfereruniqueid'];queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x1d')]=_0xbe78('0x50');}if(!_[_0xbe78('0x16')](queues[_0x79d799[_0xbe78('0x4d')]])){if(_0x79d799[_0xbe78('0x5c')]&&queues[_0x79d799[_0xbe78('0x5c')]]){queues[_0x79d799[_0xbe78('0x5c')]][_0xbe78('0x1f')]=0x1;queues[_0x79d799[_0xbe78('0x54')]]=_[_0xbe78('0x53')](queues[_0x79d799[_0xbe78('0x5c')]]);queues[_0x79d799['transfertargetuniqueid']][_0xbe78('0xc')]=_0x79d799['transfertargetuniqueid'];queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x1f')]=0x2;queues[_0x79d799[_0xbe78('0x54')]]['calleridnum']=queues[_0x79d799['origtransfererlinkedid']][_0xbe78('0x6')];queues[_0x79d799['transfertargetuniqueid']][_0xbe78('0x55')]=queues[_0x79d799[_0xbe78('0x51')]][_0xbe78('0x55')];queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x56')]=utils[_0xbe78('0x14')]();queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x5d')]=utils[_0xbe78('0x14')]();queues[_0x79d799[_0xbe78('0x54')]]['holdtime']=0x0;queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x57')]=0x0;utils['info'](util[_0xbe78('0x2')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x79d799[_0xbe78('0x4c')],queues[_0x79d799[_0xbe78('0x54')]]['name'],queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0xc')],queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x6')],queues[_0x79d799[_0xbe78('0x54')]][_0xbe78('0x55')]));}else{utils['info'](util[_0xbe78('0x2')](_0xbe78('0x58'),_0x79d799['origtransfereruniqueid'],queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0x1c')],_0x79d799['origtransfererlinkedid']));queues[_0x79d799[_0xbe78('0x4d')]][_0xbe78('0xc')]=_0x79d799['origtransfererlinkedid'];}}}}catch(_0x549dca){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x5e'),_0x79d799[_0xbe78('0x4c')]),_0x549dca);}};exports['musiconholdstart']=function(_0x10aa41){try{if(!_[_0xbe78('0x16')](queues[_0x10aa41[_0xbe78('0x10')]])){utils[_0xbe78('0xe')](util[_0xbe78('0x2')]('[%s][queues][musiconholdstart]',_0x10aa41[_0xbe78('0x10')]),_0x10aa41);queues[_0x10aa41[_0xbe78('0x10')]][_0xbe78('0x5f')]=utils[_0xbe78('0x14')]();utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x60'),_0x10aa41['uniqueid'],queues[_0x10aa41[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x10aa41[_0xbe78('0x10')]][_0xbe78('0x5f')]));}}catch(_0x1313dc){utils[_0xbe78('0x15')](util[_0xbe78('0x2')]('[%s][queues][musiconholdstart]',_0x10aa41[_0xbe78('0x10')]),_0x1313dc);}};exports[_0xbe78('0x61')]=function(_0x25b0f9){try{if(!_[_0xbe78('0x16')](queues[_0x25b0f9[_0xbe78('0x10')]])){if(!_[_0xbe78('0x16')](queues[_0x25b0f9['uniqueid']][_0xbe78('0x5f')])){utils['debug'](util[_0xbe78('0x2')]('[%s][queues][musiconholdstop]',_0x25b0f9[_0xbe78('0x10')]),_0x25b0f9);queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x57')]+=utils[_0xbe78('0x32')](utils[_0xbe78('0x14')](),queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x5f')]);utils[_0xbe78('0x11')](util[_0xbe78('0x2')](_0xbe78('0x62'),_0x25b0f9[_0xbe78('0x10')],queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x1c')],queues[_0x25b0f9['uniqueid']][_0xbe78('0x57')]));delete queues[_0x25b0f9[_0xbe78('0x10')]][_0xbe78('0x5f')];}}}catch(_0x568d10){utils[_0xbe78('0x15')](util[_0xbe78('0x2')](_0xbe78('0x63'),_0x25b0f9[_0xbe78('0x10')]),_0x568d10);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 4342f88..dfa8673 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 _0x6dd9=['lastIndexOf','[%s][recordings][queuecallerjoin]','queue','util','./utils','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','channelstate','transfer','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','cause-txt','calleridnum','calleridname','connectedlinenum','type','outbound','forEach','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','split','substring'];(function(_0x2e212a,_0xd8066b){var _0x2608aa=function(_0x43a937){while(--_0x43a937){_0x2e212a['push'](_0x2e212a['shift']());}};_0x2608aa(++_0xd8066b);}(_0x6dd9,0x1ae));var _0x96dd=function(_0x574fdb,_0x43c766){_0x574fdb=_0x574fdb-0x0;var _0x548490=_0x6dd9[_0x574fdb];return _0x548490;};'use strict';var _=require('lodash');var util=require(_0x96dd('0x0'));var utils=require(_0x96dd('0x1'));var recordings={};function writeDB(_0x1f88e2){utils[_0x96dd('0x2')](util[_0x96dd('0x3')](_0x96dd('0x4'),_0x1f88e2['uniqueid']));if(_0x1f88e2[_0x96dd('0x5')]){utils[_0x96dd('0x6')](_0x1f88e2[_0x96dd('0x5')])[_0x96dd('0x7')](function(_0x2ed490){if(_0x2ed490){_0x1f88e2[_0x96dd('0x8')]=_0x2ed490[_0x96dd('0x9')];_0x1f88e2['UserId']=_0x2ed490['id'];}utils[_0x96dd('0xa')](_0x96dd('0xb'),_0x1f88e2);});}else{utils[_0x96dd('0xa')](_0x96dd('0xb'),_0x1f88e2);}}exports[_0x96dd('0xc')]=function(_0x3541f0){try{utils[_0x96dd('0xd')](util[_0x96dd('0x3')](_0x96dd('0xe'),_0x3541f0['uniqueid']),_0x3541f0);if(_0x3541f0[_0x96dd('0xf')]==_0x3541f0[_0x96dd('0x10')]){utils[_0x96dd('0x2')](util['format'](_0x96dd('0x11'),_0x3541f0[_0x96dd('0xf')],_0x3541f0['context'],_0x3541f0[_0x96dd('0x12')]));recordings[_0x3541f0[_0x96dd('0xf')]]={'uniqueid':_0x3541f0['uniqueid'],'accountcode':_0x3541f0[_0x96dd('0x5')],'exten':_0x3541f0['exten'],'context':_0x3541f0[_0x96dd('0x13')],'channel':_0x3541f0[_0x96dd('0x14')],'monitors':[]};}}catch(_0xa6f5a8){utils[_0x96dd('0x15')](util[_0x96dd('0x3')](_0x96dd('0xe'),_0x3541f0['uniqueid']),_0xa6f5a8);}};exports[_0x96dd('0x16')]=function(_0x575e76){try{utils['debug'](util[_0x96dd('0x3')](_0x96dd('0x17'),_0x575e76[_0x96dd('0xf')]),_0x575e76);if(!_['isNil'](recordings[_0x575e76[_0x96dd('0xf')]])&&_0x575e76['channelstate']==0x6){utils[_0x96dd('0x2')](util[_0x96dd('0x3')](_0x96dd('0x18'),_0x575e76[_0x96dd('0xf')],_0x575e76[_0x96dd('0x13')],_0x575e76['channel']));}else if(!_[_0x96dd('0x19')](recordings[_0x575e76[_0x96dd('0x10')]])&&_0x575e76[_0x96dd('0x1a')]==0x6&&_0x575e76[_0x96dd('0x13')]!=_0x96dd('0x1b')){utils['info'](util[_0x96dd('0x3')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x575e76['uniqueid'],_0x575e76[_0x96dd('0x10')],_0x575e76[_0x96dd('0x13')],_0x575e76[_0x96dd('0x14')]));recordings[_0x575e76[_0x96dd('0x10')]][_0x96dd('0x5')]=_0x575e76['accountcode'];}}catch(_0x1786cd){utils['error'](util['format']('[%s][recordings][newstate]',_0x575e76['uniqueid']),_0x1786cd);}};exports[_0x96dd('0x1c')]=function(_0x3b7e25){try{if(!_[_0x96dd('0x19')](_0x3b7e25['variable'])&&!_[_0x96dd('0x19')](_0x3b7e25[_0x96dd('0x1d')]['mixmonitor_filename'])){utils['debug'](util[_0x96dd('0x3')](_0x96dd('0x1e'),_0x3b7e25[_0x96dd('0xf')]),_0x3b7e25);utils[_0x96dd('0x2')](util[_0x96dd('0x3')](_0x96dd('0x1f'),_0x3b7e25[_0x96dd('0xf')],_0x3b7e25['variable'],_0x3b7e25['value']));if(_[_0x96dd('0x20')](_0x3b7e25[_0x96dd('0x21')],_0x96dd('0x22'))){_0x3b7e25[_0x96dd('0x21')]=_0x3b7e25[_0x96dd('0x21')][_0x96dd('0x23')](_0x96dd('0x22'),'.WAV');}if(recordings[_0x3b7e25[_0x96dd('0x10')]]){var _0x5aee61=_[_0x96dd('0x24')](recordings[_0x3b7e25[_0x96dd('0x10')]][_0x96dd('0x25')],{'value':_0x3b7e25[_0x96dd('0x21')]});if(_[_0x96dd('0x19')](_0x5aee61)){recordings[_0x3b7e25[_0x96dd('0x10')]][_0x96dd('0x25')][_0x96dd('0x26')]({'value':_0x3b7e25[_0x96dd('0x21')]});}}}}catch(_0x56b213){utils[_0x96dd('0x15')](util['format'](_0x96dd('0x1e'),_0x3b7e25[_0x96dd('0xf')]),_0x56b213);}};exports[_0x96dd('0x27')]=function(_0x5cecbd){try{if(!_[_0x96dd('0x19')](recordings[_0x5cecbd[_0x96dd('0xf')]])){utils[_0x96dd('0xd')](util['format'](_0x96dd('0x28'),_0x5cecbd['uniqueid']),_0x5cecbd);utils[_0x96dd('0x2')](util[_0x96dd('0x3')](_0x96dd('0x29'),_0x5cecbd[_0x96dd('0xf')],_0x5cecbd['calleridnum'],_0x5cecbd['calleridname'],_0x5cecbd[_0x96dd('0x2a')]));recordings[_0x5cecbd[_0x96dd('0xf')]][_0x96dd('0x2b')]=_0x5cecbd[_0x96dd('0x2b')];recordings[_0x5cecbd[_0x96dd('0xf')]][_0x96dd('0x2c')]=_0x5cecbd[_0x96dd('0x2c')];recordings[_0x5cecbd[_0x96dd('0xf')]]['connectedlinenum']=_0x5cecbd[_0x96dd('0x2d')];recordings[_0x5cecbd[_0x96dd('0xf')]]['connectedlinename']=_0x5cecbd['connectedlinename'];if(recordings[_0x5cecbd[_0x96dd('0xf')]][_0x96dd('0x2e')]==_0x96dd('0x2f')&&recordings[_0x5cecbd[_0x96dd('0xf')]][_0x96dd('0x5')]){recordings[_0x5cecbd[_0x96dd('0xf')]][_0x96dd('0x2d')]=recordings[_0x5cecbd[_0x96dd('0xf')]][_0x96dd('0x5')];recordings[_0x5cecbd[_0x96dd('0xf')]]['connectedlinename']='';}recordings[_0x5cecbd[_0x96dd('0xf')]][_0x96dd('0x25')][_0x96dd('0x30')](function(_0xe4f87f){var _0x3c0fe5=_['clone'](recordings[_0x5cecbd[_0x96dd('0xf')]]);_0x3c0fe5[_0x96dd('0x21')]=_0xe4f87f[_0x96dd('0x21')];writeDB(_0x3c0fe5);});delete recordings[_0x5cecbd[_0x96dd('0xf')]];}}catch(_0x4c3530){utils['error'](util['format']('[%s][recordings][hangup]',_0x5cecbd['uniqueid']),_0x4c3530);}};exports[_0x96dd('0x31')]=function(_0x3627f9){try{if(!_[_0x96dd('0x19')](recordings[_0x3627f9[_0x96dd('0xf')]])){utils[_0x96dd('0xd')](util[_0x96dd('0x3')](_0x96dd('0x32'),_0x3627f9['uniqueid']),_0x3627f9);utils[_0x96dd('0x2')](util[_0x96dd('0x3')](_0x96dd('0x33'),_0x3627f9['uniqueid'],_0x3627f9[_0x96dd('0x34')],_0x3627f9[_0x96dd('0x35')]));if(_0x3627f9[_0x96dd('0x34')][_0x96dd('0x36')]()=='set'&&_[_0x96dd('0x37')](_0x3627f9['appdata']['toLowerCase'](),'cdr')){var _0x3ad67f=_0x3627f9[_0x96dd('0x35')][_0x96dd('0x38')]('=');var _0xfb0308=_0x3ad67f[0x0][_0x96dd('0x39')](_0x3ad67f[0x0][_0x96dd('0x3a')]('(')+0x1,_0x3ad67f[0x0][_0x96dd('0x3a')](')'));var _0x2ace63=_0x3ad67f[0x1];recordings[_0x3627f9[_0x96dd('0xf')]][_0xfb0308]=_0x2ace63;}}}catch(_0xf5870f){utils[_0x96dd('0x15')](util[_0x96dd('0x3')](_0x96dd('0x32'),_0x3627f9[_0x96dd('0xf')]),_0xf5870f);}};exports['queuecallerjoin']=function(_0x451e3f){try{if(!_[_0x96dd('0x19')](recordings[_0x451e3f['uniqueid']])){utils['debug'](util[_0x96dd('0x3')](_0x96dd('0x3b'),_0x451e3f[_0x96dd('0xf')]),_0x451e3f);utils['info'](util[_0x96dd('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x451e3f['uniqueid'],_0x451e3f[_0x96dd('0x3c')]));recordings[_0x451e3f[_0x96dd('0xf')]]['queue']=_0x451e3f[_0x96dd('0x3c')];}}catch(_0x222822){utils[_0x96dd('0x15')](util[_0x96dd('0x3')](_0x96dd('0x3b'),_0x451e3f['uniqueid']),_0x222822);}}; \ No newline at end of file +var _0xb032=['.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinename','type','outbound','clone','newexten','application','appdata','toLowerCase','set','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','exten','context','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','linkedid','transfer','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0xb032,0x187));var _0x2b03=function(_0x107844,_0x41926f){_0x107844=_0x107844-0x0;var _0x40c2b5=_0xb032[_0x107844];return _0x40c2b5;};'use strict';var _=require(_0x2b03('0x0'));var util=require(_0x2b03('0x1'));var utils=require(_0x2b03('0x2'));var recordings={};function writeDB(_0x1475cf){utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x5'),_0x1475cf[_0x2b03('0x6')]));if(_0x1475cf[_0x2b03('0x7')]){utils[_0x2b03('0x8')](_0x1475cf[_0x2b03('0x7')])[_0x2b03('0x9')](function(_0x315001){if(_0x315001){_0x1475cf[_0x2b03('0xa')]=_0x315001[_0x2b03('0xb')];_0x1475cf[_0x2b03('0xc')]=_0x315001['id'];}utils['request'](_0x2b03('0xd'),_0x1475cf);});}else{utils['request'](_0x2b03('0xd'),_0x1475cf);}}exports[_0x2b03('0xe')]=function(_0x5ddc23){try{utils['debug'](util[_0x2b03('0x4')](_0x2b03('0xf'),_0x5ddc23['uniqueid']),_0x5ddc23);if(_0x5ddc23[_0x2b03('0x6')]==_0x5ddc23['linkedid']){utils[_0x2b03('0x3')](util[_0x2b03('0x4')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x5ddc23[_0x2b03('0x6')],_0x5ddc23['context'],_0x5ddc23[_0x2b03('0x10')]));recordings[_0x5ddc23[_0x2b03('0x6')]]={'uniqueid':_0x5ddc23[_0x2b03('0x6')],'accountcode':_0x5ddc23[_0x2b03('0x7')],'exten':_0x5ddc23[_0x2b03('0x10')],'context':_0x5ddc23[_0x2b03('0x11')],'channel':_0x5ddc23[_0x2b03('0x12')],'monitors':[]};}}catch(_0x115af8){utils[_0x2b03('0x13')](util[_0x2b03('0x4')](_0x2b03('0xf'),_0x5ddc23[_0x2b03('0x6')]),_0x115af8);}};exports[_0x2b03('0x14')]=function(_0x580149){try{utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x16'),_0x580149[_0x2b03('0x6')]),_0x580149);if(!_[_0x2b03('0x17')](recordings[_0x580149[_0x2b03('0x6')]])&&_0x580149[_0x2b03('0x18')]==0x6){utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x19'),_0x580149[_0x2b03('0x6')],_0x580149['context'],_0x580149[_0x2b03('0x12')]));}else if(!_['isNil'](recordings[_0x580149[_0x2b03('0x1a')]])&&_0x580149[_0x2b03('0x18')]==0x6&&_0x580149[_0x2b03('0x11')]!=_0x2b03('0x1b')){utils[_0x2b03('0x3')](util[_0x2b03('0x4')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x580149['uniqueid'],_0x580149[_0x2b03('0x1a')],_0x580149['context'],_0x580149[_0x2b03('0x12')]));recordings[_0x580149[_0x2b03('0x1a')]][_0x2b03('0x7')]=_0x580149[_0x2b03('0x7')];}}catch(_0x3faa54){utils[_0x2b03('0x13')](util[_0x2b03('0x4')]('[%s][recordings][newstate]',_0x580149[_0x2b03('0x6')]),_0x3faa54);}};exports[_0x2b03('0x1c')]=function(_0x42b387){try{if(!_['isNil'](_0x42b387['variable'])&&!_[_0x2b03('0x17')](_0x42b387[_0x2b03('0x1d')][_0x2b03('0x1e')])){utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x1f'),_0x42b387['uniqueid']),_0x42b387);utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x20'),_0x42b387[_0x2b03('0x6')],_0x42b387[_0x2b03('0x1d')],_0x42b387[_0x2b03('0x21')]));if(_['endsWith'](_0x42b387[_0x2b03('0x21')],_0x2b03('0x22'))){_0x42b387[_0x2b03('0x21')]=_0x42b387[_0x2b03('0x21')][_0x2b03('0x23')](_0x2b03('0x22'),_0x2b03('0x24'));}if(recordings[_0x42b387[_0x2b03('0x1a')]]){var _0x538bc2=_[_0x2b03('0x25')](recordings[_0x42b387[_0x2b03('0x1a')]][_0x2b03('0x26')],{'value':_0x42b387[_0x2b03('0x21')]});if(_['isNil'](_0x538bc2)){recordings[_0x42b387['linkedid']][_0x2b03('0x26')][_0x2b03('0x27')]({'value':_0x42b387[_0x2b03('0x21')]});}}}}catch(_0xdf1411){utils[_0x2b03('0x13')](util['format'](_0x2b03('0x1f'),_0x42b387['uniqueid']),_0xdf1411);}};exports[_0x2b03('0x28')]=function(_0x3246b5){try{if(!_[_0x2b03('0x17')](recordings[_0x3246b5[_0x2b03('0x6')]])){utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x29'),_0x3246b5[_0x2b03('0x6')]),_0x3246b5);utils[_0x2b03('0x3')](util[_0x2b03('0x4')](_0x2b03('0x2a'),_0x3246b5[_0x2b03('0x6')],_0x3246b5[_0x2b03('0x2b')],_0x3246b5[_0x2b03('0x2c')],_0x3246b5[_0x2b03('0x2d')]));recordings[_0x3246b5[_0x2b03('0x6')]]['calleridnum']=_0x3246b5[_0x2b03('0x2b')];recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x2c')]=_0x3246b5['calleridname'];recordings[_0x3246b5['uniqueid']]['connectedlinenum']=_0x3246b5['connectedlinenum'];recordings[_0x3246b5['uniqueid']][_0x2b03('0x2e')]=_0x3246b5[_0x2b03('0x2e')];if(recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x2f')]==_0x2b03('0x30')&&recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x7')]){recordings[_0x3246b5[_0x2b03('0x6')]]['connectedlinenum']=recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x7')];recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x2e')]='';}recordings[_0x3246b5[_0x2b03('0x6')]][_0x2b03('0x26')]['forEach'](function(_0x1ce678){var _0xb9dbf7=_[_0x2b03('0x31')](recordings[_0x3246b5['uniqueid']]);_0xb9dbf7[_0x2b03('0x21')]=_0x1ce678[_0x2b03('0x21')];writeDB(_0xb9dbf7);});delete recordings[_0x3246b5['uniqueid']];}}catch(_0x5c0445){utils[_0x2b03('0x13')](util[_0x2b03('0x4')](_0x2b03('0x29'),_0x3246b5[_0x2b03('0x6')]),_0x5c0445);}};exports[_0x2b03('0x32')]=function(_0x4626fe){try{if(!_[_0x2b03('0x17')](recordings[_0x4626fe[_0x2b03('0x6')]])){utils['debug'](util[_0x2b03('0x4')]('[%s][recordings][newexten]',_0x4626fe[_0x2b03('0x6')]),_0x4626fe);utils[_0x2b03('0x3')](util[_0x2b03('0x4')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x4626fe[_0x2b03('0x6')],_0x4626fe[_0x2b03('0x33')],_0x4626fe[_0x2b03('0x34')]));if(_0x4626fe[_0x2b03('0x33')][_0x2b03('0x35')]()==_0x2b03('0x36')&&_['startsWith'](_0x4626fe[_0x2b03('0x34')][_0x2b03('0x35')](),'cdr')){var _0x16def8=_0x4626fe[_0x2b03('0x34')]['split']('=');var _0x5b4229=_0x16def8[0x0][_0x2b03('0x37')](_0x16def8[0x0][_0x2b03('0x38')]('(')+0x1,_0x16def8[0x0]['lastIndexOf'](')'));var _0x468a63=_0x16def8[0x1];recordings[_0x4626fe[_0x2b03('0x6')]][_0x5b4229]=_0x468a63;}}}catch(_0x9a9e66){utils['error'](util[_0x2b03('0x4')]('[%s][recordings][newexten]',_0x4626fe[_0x2b03('0x6')]),_0x9a9e66);}};exports[_0x2b03('0x39')]=function(_0x1fef41){try{if(!_[_0x2b03('0x17')](recordings[_0x1fef41[_0x2b03('0x6')]])){utils[_0x2b03('0x15')](util[_0x2b03('0x4')](_0x2b03('0x3a'),_0x1fef41[_0x2b03('0x6')]),_0x1fef41);utils['info'](util[_0x2b03('0x4')](_0x2b03('0x3b'),_0x1fef41['uniqueid'],_0x1fef41[_0x2b03('0x3c')]));recordings[_0x1fef41[_0x2b03('0x6')]][_0x2b03('0x3c')]=_0x1fef41[_0x2b03('0x3c')];}}catch(_0x1741bf){utils[_0x2b03('0x13')](util['format'](_0x2b03('0x3a'),_0x1fef41[_0x2b03('0x6')]),_0x1741bf);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 7c6208d..4b7614e 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 _0x47ed=['transferercalleridnum','transferercalleridname','transfereecalleridname','blind','blinds','attendedtransfer','[%s][transfers][attendedtransfer]','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','assign','origtransfererchannel','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','request','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid'];(function(_0x14c145,_0x4d6c50){var _0x4ee1bd=function(_0x5c4a06){while(--_0x5c4a06){_0x14c145['push'](_0x14c145['shift']());}};_0x4ee1bd(++_0x4d6c50);}(_0x47ed,0x155));var _0xd47e=function(_0x367e5b,_0x5721e4){_0x367e5b=_0x367e5b-0x0;var _0x4b909e=_0x47ed[_0x367e5b];return _0x4b909e;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xd47e('0x0'));function writeDB(_0x195271){utils[_0xd47e('0x1')](util[_0xd47e('0x2')](_0xd47e('0x3'),_0x195271['type']==='attended'?_0x195271['origtransfereruniqueid']:_0x195271['uniqueid'],_0x195271[_0xd47e('0x4')]));utils[_0xd47e('0x5')]('CreateVoiceTransferReport',_0x195271);}exports['blinds']={};exports[_0xd47e('0x6')]=function(_0x34c07d){try{utils[_0xd47e('0x7')](util[_0xd47e('0x2')](_0xd47e('0x8'),_0x34c07d[_0xd47e('0x9')]),_0x34c07d);utils[_0xd47e('0x1')](util[_0xd47e('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x34c07d[_0xd47e('0x9')],_0x34c07d[_0xd47e('0xa')],_0x34c07d[_0xd47e('0xb')],_0x34c07d['transfereecalleridnum'],_0x34c07d[_0xd47e('0xc')]));_0x34c07d[_0xd47e('0x4')]=_0xd47e('0xd');exports[_0xd47e('0xe')][_0x34c07d['transfereruniqueid']]=_0x34c07d;writeDB(_0x34c07d);}catch(_0x3cfd29){utils['error'](util['format'](_0xd47e('0x8'),_0x34c07d['uniqueid']),_0x3cfd29);}};exports[_0xd47e('0xf')]=function(_0x4dcbfb){try{utils[_0xd47e('0x7')](util['format'](_0xd47e('0x10'),_0x4dcbfb['origtransfereruniqueid']),_0x4dcbfb);utils[_0xd47e('0x1')](util[_0xd47e('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4dcbfb[_0xd47e('0x11')],_0x4dcbfb[_0xd47e('0x12')],_0x4dcbfb[_0xd47e('0x13')],_0x4dcbfb['transfertargetcalleridnum'],_0x4dcbfb['transfertargetcalleridname']));_0x4dcbfb=_[_0xd47e('0x14')](_0x4dcbfb,{'transfererchannel':_0x4dcbfb[_0xd47e('0x15')],'transferercalleridnum':_0x4dcbfb[_0xd47e('0x12')],'transferercalleridname':_0x4dcbfb[_0xd47e('0x13')],'transfererconnectedlinenum':_0x4dcbfb['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x4dcbfb['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4dcbfb[_0xd47e('0x16')],'transferercontext':_0x4dcbfb[_0xd47e('0x17')],'transfererexten':_0x4dcbfb[_0xd47e('0x18')],'transfererlinkedid':_0x4dcbfb[_0xd47e('0x19')],'context':_0x4dcbfb[_0xd47e('0x1a')],'extension':_0x4dcbfb['origtransfererexten'],'type':_0xd47e('0x1b')});if(_['isNil'](_0x4dcbfb[_0xd47e('0x1c')])){_0x4dcbfb=_[_0xd47e('0x14')](_0x4dcbfb,{'transfereechannel':_0x4dcbfb[_0xd47e('0x1d')],'transfereecalleridnum':_0x4dcbfb[_0xd47e('0x1e')],'transfereecalleridname':_0x4dcbfb[_0xd47e('0x1f')],'transfereeconnectedlinenum':_0x4dcbfb[_0xd47e('0x20')],'transfereeconnectedlinename':_0x4dcbfb[_0xd47e('0x21')],'transfereeaccountcode':_0x4dcbfb[_0xd47e('0x22')],'transfereecontext':_0x4dcbfb[_0xd47e('0x23')],'transfereeexten':_0x4dcbfb[_0xd47e('0x24')],'transfereelinkedid':_0x4dcbfb[_0xd47e('0x25')]});}writeDB(_0x4dcbfb);}catch(_0x45406c){utils[_0xd47e('0x26')](util[_0xd47e('0x2')](_0xd47e('0x10'),_0x4dcbfb[_0xd47e('0x11')]),_0x45406c);}}; \ No newline at end of file +var _0x456d=['CreateVoiceTransferReport','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridname','blind','blinds','error','attendedtransfer','debug','info','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','origtransferercalleridnum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request'];(function(_0x1c3cc4,_0x11d2d3){var _0x2a7c1c=function(_0x3094f5){while(--_0x3094f5){_0x1c3cc4['push'](_0x1c3cc4['shift']());}};_0x2a7c1c(++_0x11d2d3);}(_0x456d,0x9b));var _0xd456=function(_0x2500c8,_0x2ad65e){_0x2500c8=_0x2500c8-0x0;var _0x59ec4e=_0x456d[_0x2500c8];return _0x59ec4e;};'use strict';var _=require('lodash');var util=require(_0xd456('0x0'));var utils=require(_0xd456('0x1'));function writeDB(_0x3af9f3){utils['info'](util[_0xd456('0x2')](_0xd456('0x3'),_0x3af9f3[_0xd456('0x4')]===_0xd456('0x5')?_0x3af9f3[_0xd456('0x6')]:_0x3af9f3[_0xd456('0x7')],_0x3af9f3[_0xd456('0x4')]));utils[_0xd456('0x8')](_0xd456('0x9'),_0x3af9f3);}exports['blinds']={};exports[_0xd456('0xa')]=function(_0x28b027){try{utils['debug'](util['format'](_0xd456('0xb'),_0x28b027[_0xd456('0x7')]),_0x28b027);utils['info'](util['format'](_0xd456('0xc'),_0x28b027[_0xd456('0x7')],_0x28b027[_0xd456('0xd')],_0x28b027['transferercalleridname'],_0x28b027['transfereecalleridnum'],_0x28b027[_0xd456('0xe')]));_0x28b027['type']=_0xd456('0xf');exports[_0xd456('0x10')][_0x28b027['transfereruniqueid']]=_0x28b027;writeDB(_0x28b027);}catch(_0x5a9f40){utils[_0xd456('0x11')](util[_0xd456('0x2')](_0xd456('0xb'),_0x28b027['uniqueid']),_0x5a9f40);}};exports[_0xd456('0x12')]=function(_0x105223){try{utils[_0xd456('0x13')](util['format']('[%s][transfers][attendedtransfer]',_0x105223[_0xd456('0x6')]),_0x105223);utils[_0xd456('0x14')](util[_0xd456('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x105223[_0xd456('0x6')],_0x105223['origtransferercalleridnum'],_0x105223[_0xd456('0x15')],_0x105223[_0xd456('0x16')],_0x105223[_0xd456('0x17')]));_0x105223=_[_0xd456('0x18')](_0x105223,{'transfererchannel':_0x105223[_0xd456('0x19')],'transferercalleridnum':_0x105223[_0xd456('0x1a')],'transferercalleridname':_0x105223[_0xd456('0x15')],'transfererconnectedlinenum':_0x105223['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x105223['secondtransfererconnectedlinename'],'transfereraccountcode':_0x105223[_0xd456('0x1b')],'transferercontext':_0x105223[_0xd456('0x1c')],'transfererexten':_0x105223[_0xd456('0x1d')],'transfererlinkedid':_0x105223[_0xd456('0x1e')],'context':_0x105223['origtransferercontext'],'extension':_0x105223[_0xd456('0x1f')],'type':_0xd456('0x5')});if(_[_0xd456('0x20')](_0x105223[_0xd456('0x21')])){_0x105223=_[_0xd456('0x18')](_0x105223,{'transfereechannel':_0x105223[_0xd456('0x22')],'transfereecalleridnum':_0x105223[_0xd456('0x16')],'transfereecalleridname':_0x105223[_0xd456('0x17')],'transfereeconnectedlinenum':_0x105223[_0xd456('0x23')],'transfereeconnectedlinename':_0x105223[_0xd456('0x24')],'transfereeaccountcode':_0x105223[_0xd456('0x25')],'transfereecontext':_0x105223[_0xd456('0x26')],'transfereeexten':_0x105223[_0xd456('0x27')],'transfereelinkedid':_0x105223[_0xd456('0x28')]});}writeDB(_0x105223);}catch(_0x185603){utils['error'](util[_0xd456('0x2')]('[%s][transfers][attendedtransfer]',_0x105223['origtransfereruniqueid']),_0x185603);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 28b2244..2ea9cb4 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 _0x1681=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','result','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','now','isAfter','isBefore','jayson/promise','moment','util','client','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','stringify','length','getUserByInternal','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]'];(function(_0x26c448,_0x4c4861){var _0x293e4a=function(_0x4af00e){while(--_0x4af00e){_0x26c448['push'](_0x26c448['shift']());}};_0x293e4a(++_0x4c4861);}(_0x1681,0xd7));var _0x1168=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1681[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x1168('0x0'));var moment=require(_0x1168('0x1'));var util=require(_0x1168('0x2'));var client=jayson[_0x1168('0x3')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x1168('0x4'));exports[_0x1168('0x5')]=function(_0x17f455,_0x1e675e){logger[_0x1168('0x5')](_0x17f455,_0x1e675e?util[_0x1168('0x6')](_0x1e675e,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x461faf,_0x1eb032){logger[_0x1168('0x7')](_0x461faf,_0x1eb032?util[_0x1168('0x6')](_0x1eb032,{'showHidden':![],'depth':null}):'');};exports[_0x1168('0x8')]=function(_0x2b24e3,_0x1165a2){logger[_0x1168('0x8')](_0x2b24e3,_0x1165a2?util[_0x1168('0x6')](_0x1165a2,{'showHidden':![],'depth':null}):'');};exports[_0x1168('0x9')]=function(_0x54809c,_0x4d5553){return client[_0x1168('0x9')](_0x54809c,{'body':_0x4d5553})[_0x1168('0xa')](function(_0x2e4d21){logger[_0x1168('0x7')](_0x1168('0xb'),_0x54809c,_0x2e4d21?util[_0x1168('0x6')](_0x2e4d21,{'showHidden':![],'depth':null}):'');})[_0x1168('0xc')](function(_0x38ac36){logger[_0x1168('0x8')](_0x1168('0xb'),_0x54809c,_0x38ac36?util[_0x1168('0x6')](_0x38ac36,{'showHidden':![],'depth':null}):'');});};function getUser(_0x49e231){return client[_0x1168('0x9')](_0x1168('0xd'),{'options':{'raw':!![],'attributes':['id',_0x1168('0xe'),_0x1168('0xf'),'interface'],'where':_0x49e231,'limit':0x1}})[_0x1168('0xa')](function(_0x51b410){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x1168('0x10')](_0x49e231),_0x51b410?util[_0x1168('0x6')](_0x51b410,{'showHidden':![],'depth':null}):'');return _0x51b410['result'][_0x1168('0x11')]?_0x51b410['result'][0x0]:null;});}exports[_0x1168('0x12')]=function(_0x2723f2){return new BPromise(function(_0x18ec45,_0x3bb555){if(_0x2723f2){return getUser({'internal':_0x2723f2})[_0x1168('0xa')](function(_0x588337){logger[_0x1168('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2723f2,_0x588337?_0x1168('0x13'):_0x1168('0x14'));return _0x18ec45(_0x588337);})[_0x1168('0xc')](function(_0x321345){logger[_0x1168('0x8')](_0x1168('0x15'),_0x321345?util[_0x1168('0x6')](_0x321345,{'showHidden':![],'depth':null}):'');return _0x18ec45(null);});}return _0x18ec45(null);});};exports[_0x1168('0x16')]=function(_0x8de64c){return new BPromise(function(_0x1472c4,_0x4879c8){if(_0x8de64c){return getUser({'interface':_0x8de64c})[_0x1168('0xa')](function(_0x3222b0){logger[_0x1168('0x5')](_0x1168('0x17'),_0x8de64c,_0x3222b0?_0x1168('0x13'):_0x1168('0x14'));return _0x1472c4(_0x3222b0);})[_0x1168('0xc')](function(_0xe5cba5){logger[_0x1168('0x8')](_0x1168('0x18'),_0xe5cba5?util['inspect'](_0xe5cba5,{'showHidden':![],'depth':null}):'');return _0x1472c4(null);});}return _0x1472c4(null);});};exports[_0x1168('0x19')]=function(_0xf92d){return new BPromise(function(_0x290898,_0x12f293){if(_0xf92d){return getUser({'name':_0xf92d})['then'](function(_0x5b2da8){logger[_0x1168('0x5')](_0x1168('0x1a'),_0xf92d,_0x5b2da8?_0x1168('0x13'):_0x1168('0x14'));return _0x290898(_0x5b2da8);})[_0x1168('0xc')](function(_0x161f23){logger[_0x1168('0x8')](_0x1168('0x1b'),_0x161f23?util['inspect'](_0x161f23,{'showHidden':![],'depth':null}):'');return _0x290898(null);});}return _0x290898(null);});};exports[_0x1168('0x1c')]=function(_0x2f8177){return new BPromise(function(_0x531c02,_0x458ad3){if(_0x2f8177){return client[_0x1168('0x9')](_0x1168('0x1d'),{'options':{'raw':!![],'attributes':['id',_0x1168('0xf'),_0x1168('0x1e'),_0x1168('0x1f'),_0x1168('0x20')],'where':{'name':_0x2f8177},'limit':0x1}})[_0x1168('0xa')](function(_0xa9cde3){logger['debug'](_0x1168('0x21'),_0x2f8177,_0xa9cde3?util[_0x1168('0x6')](_0xa9cde3,{'showHidden':![],'depth':null}):'');logger[_0x1168('0x5')](_0x1168('0x22'),_0x2f8177,_0xa9cde3?'found':_0x1168('0x14'));return _0x531c02(_0xa9cde3[_0x1168('0x23')][_0x1168('0x11')]?_0xa9cde3[_0x1168('0x23')][0x0]:null);})[_0x1168('0xc')](function(_0x3d4327){logger['error'](_0x1168('0x24'),_0x3d4327?util[_0x1168('0x6')](_0x3d4327,{'showHidden':![],'depth':null}):'');return _0x531c02(null);});}return _0x531c02(null);});};exports[_0x1168('0x25')]=function(_0x247b7f,_0x5bdb39){return moment(_0x247b7f)[_0x1168('0x26')](_0x5bdb39,_0x1168('0x27'))[_0x1168('0x28')](_0x1168('0x29'));};exports['subtractTime']=function(_0x5713d5,_0x5ebbba){return moment(_0x5713d5)[_0x1168('0x2a')](_0x5ebbba,'seconds')[_0x1168('0x28')](_0x1168('0x29'));};exports[_0x1168('0x2b')]=function(_0x213fb8,_0x12f6a3){return moment(_0x213fb8)[_0x1168('0x2c')](moment(_0x12f6a3),'seconds');};exports['sumTime']=function(_0x40a5e0,_0x28b52e){return parseInt(_0x40a5e0,0xa)+parseInt(_0x28b52e,0xa);};exports[_0x1168('0x2d')]=function(){return moment()[_0x1168('0x28')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x1168('0x2e')]=function(_0x3eb9aa,_0x19b263){if(_0x19b263){return moment(_0x3eb9aa)[_0x1168('0x2e')](_0x19b263);}return!![];};exports[_0x1168('0x2f')]=function(_0x5742a7,_0x34fb17){if(_0x34fb17){return moment(_0x5742a7)[_0x1168('0x2f')](_0x34fb17);}else if(_0x5742a7){return!![];}return![];}; \ No newline at end of file +var _0x681a=['getVoiceQueueByName','type','acw','acwTimeout','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtract','diffTime','diff','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','[utils][getUserByInternal]\x20internal:%s\x20%s','notfound','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','found','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]'];(function(_0x2d4b18,_0x1e3f5d){var _0x3242b4=function(_0x30e4f8){while(--_0x30e4f8){_0x2d4b18['push'](_0x2d4b18['shift']());}};_0x3242b4(++_0x1e3f5d);}(_0x681a,0xbf));var _0xa681=function(_0x2302a1,_0x4bc33d){_0x2302a1=_0x2302a1-0x0;var _0x413cae=_0x681a[_0x2302a1];return _0x413cae;};'use strict';var BPromise=require(_0xa681('0x0'));var jayson=require(_0xa681('0x1'));var moment=require(_0xa681('0x2'));var util=require(_0xa681('0x3'));var client=jayson[_0xa681('0x4')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0xa681('0x5'));exports[_0xa681('0x6')]=function(_0x20b7ef,_0xd72b3){logger['info'](_0x20b7ef,_0xd72b3?util['inspect'](_0xd72b3,{'showHidden':![],'depth':null}):'');};exports[_0xa681('0x7')]=function(_0xf29660,_0x3f2657){logger[_0xa681('0x7')](_0xf29660,_0x3f2657?util[_0xa681('0x8')](_0x3f2657,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x2e1fe2,_0x1d392b){logger[_0xa681('0x9')](_0x2e1fe2,_0x1d392b?util[_0xa681('0x8')](_0x1d392b,{'showHidden':![],'depth':null}):'');};exports[_0xa681('0xa')]=function(_0x5dd2fe,_0x39124b){return client[_0xa681('0xa')](_0x5dd2fe,{'body':_0x39124b})[_0xa681('0xb')](function(_0x202b6c){logger[_0xa681('0x7')](_0xa681('0xc'),_0x5dd2fe,_0x202b6c?util[_0xa681('0x8')](_0x202b6c,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x374fb6){logger['error'](_0xa681('0xc'),_0x5dd2fe,_0x374fb6?util[_0xa681('0x8')](_0x374fb6,{'showHidden':![],'depth':null}):'');});};function getUser(_0x5e1b4e){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0xa681('0xd'),_0xa681('0xe')],'where':_0x5e1b4e,'limit':0x1}})[_0xa681('0xb')](function(_0xfd251e){logger['debug'](_0xa681('0xf'),JSON[_0xa681('0x10')](_0x5e1b4e),_0xfd251e?util[_0xa681('0x8')](_0xfd251e,{'showHidden':![],'depth':null}):'');return _0xfd251e['result'][_0xa681('0x11')]?_0xfd251e[_0xa681('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x55b4dc){return new BPromise(function(_0x3bf396,_0x51f036){if(_0x55b4dc){return getUser({'internal':_0x55b4dc})[_0xa681('0xb')](function(_0x34302e){logger[_0xa681('0x6')](_0xa681('0x13'),_0x55b4dc,_0x34302e?'found':_0xa681('0x14'));return _0x3bf396(_0x34302e);})[_0xa681('0x15')](function(_0x2b6642){logger[_0xa681('0x9')](_0xa681('0x16'),_0x2b6642?util['inspect'](_0x2b6642,{'showHidden':![],'depth':null}):'');return _0x3bf396(null);});}return _0x3bf396(null);});};exports[_0xa681('0x17')]=function(_0x418854){return new BPromise(function(_0x1f7f9a,_0xf1311b){if(_0x418854){return getUser({'interface':_0x418854})[_0xa681('0xb')](function(_0x3e8fc6){logger[_0xa681('0x6')](_0xa681('0x18'),_0x418854,_0x3e8fc6?_0xa681('0x19'):_0xa681('0x14'));return _0x1f7f9a(_0x3e8fc6);})[_0xa681('0x15')](function(_0x51b06a){logger[_0xa681('0x9')]('[utils][getUserByInterface]',_0x51b06a?util[_0xa681('0x8')](_0x51b06a,{'showHidden':![],'depth':null}):'');return _0x1f7f9a(null);});}return _0x1f7f9a(null);});};exports[_0xa681('0x1a')]=function(_0x439d13){return new BPromise(function(_0x3212ec,_0x3fd364){if(_0x439d13){return getUser({'name':_0x439d13})[_0xa681('0xb')](function(_0x7358d3){logger[_0xa681('0x6')](_0xa681('0x1b'),_0x439d13,_0x7358d3?_0xa681('0x19'):_0xa681('0x14'));return _0x3212ec(_0x7358d3);})['catch'](function(_0x45b290){logger[_0xa681('0x9')](_0xa681('0x1c'),_0x45b290?util[_0xa681('0x8')](_0x45b290,{'showHidden':![],'depth':null}):'');return _0x3212ec(null);});}return _0x3212ec(null);});};exports[_0xa681('0x1d')]=function(_0x15caad){return new BPromise(function(_0x311c11,_0x17a00b){if(_0x15caad){return client[_0xa681('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xa681('0xd'),_0xa681('0x1e'),_0xa681('0x1f'),_0xa681('0x20')],'where':{'name':_0x15caad},'limit':0x1}})['then'](function(_0x2e5fad){logger[_0xa681('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x15caad,_0x2e5fad?util[_0xa681('0x8')](_0x2e5fad,{'showHidden':![],'depth':null}):'');logger[_0xa681('0x6')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x15caad,_0x2e5fad?_0xa681('0x19'):_0xa681('0x14'));return _0x311c11(_0x2e5fad[_0xa681('0x12')]['length']?_0x2e5fad['result'][0x0]:null);})[_0xa681('0x15')](function(_0x367c3f){logger[_0xa681('0x9')]('[utils][getVoiceQueueByName]',_0x367c3f?util['inspect'](_0x367c3f,{'showHidden':![],'depth':null}):'');return _0x311c11(null);});}return _0x311c11(null);});};exports[_0xa681('0x21')]=function(_0x310700,_0x5aabe5){return moment(_0x310700)[_0xa681('0x22')](_0x5aabe5,_0xa681('0x23'))[_0xa681('0x24')](_0xa681('0x25'));};exports['subtractTime']=function(_0x2ed2d6,_0x2ed17e){return moment(_0x2ed2d6)[_0xa681('0x26')](_0x2ed17e,_0xa681('0x23'))[_0xa681('0x24')](_0xa681('0x25'));};exports[_0xa681('0x27')]=function(_0x3ce5bd,_0x51dcf0){return moment(_0x3ce5bd)[_0xa681('0x28')](moment(_0x51dcf0),_0xa681('0x23'));};exports['sumTime']=function(_0x4c97d6,_0x4f51bf){return parseInt(_0x4c97d6,0xa)+parseInt(_0x4f51bf,0xa);};exports[_0xa681('0x29')]=function(){return moment()[_0xa681('0x24')](_0xa681('0x25'));};exports[_0xa681('0x2a')]=function(_0x17d8e,_0x2d6c0f){if(_0x2d6c0f){return moment(_0x17d8e)[_0xa681('0x2a')](_0x2d6c0f);}return!![];};exports[_0xa681('0x2b')]=function(_0x1252b0,_0x15e807){if(_0x15e807){return moment(_0x1252b0)[_0xa681('0x2b')](_0x15e807);}else if(_0x1252b0){return!![];}return![];}; \ No newline at end of file